From 6d4107fbaf2f83beba73ec1e8d2332a02cb30b51 Mon Sep 17 00:00:00 2001 From: support Date: Thu, 28 Apr 2022 06:38:20 +0000 Subject: [PATCH] Built motion from commit 2ff66822.|2.6.9 --- 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/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.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 +- 1195 files changed, 1195 insertions(+), 1195 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index cfa2c8b..6b146aa 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-04-27T16:06:29.519Z", + "time": "2022-04-28T06:30:29.800Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c2625f7..d2d527f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-27T16:06:29.519Z", + "time": "2022-04-28T06:30:29.800Z", "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 ce7211b..aae8254 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 _0x1b19=['jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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]','TEXT','exports','VIRTUAL','getDataValue','STRING','contactManager','motionbar'];(function(_0x33b93e,_0x1d19e3){var _0x1bc54e=function(_0x7e0970){while(--_0x7e0970){_0x33b93e['push'](_0x33b93e['shift']());}};_0x1bc54e(++_0x1d19e3);}(_0x1b19,0x1ca));var _0x91b1=function(_0x28ff84,_0x2db9c3){_0x28ff84=_0x28ff84-0x0;var _0x27d56b=_0x1b19[_0x28ff84];return _0x27d56b;};'use strict';var Sequelize=require('sequelize');module[_0x91b1('0x0')]={'name':{'type':Sequelize[_0x91b1('0x1')],'get':function(_0x40efbb){return this[_0x91b1('0x2')]('action');}},'action':{'type':Sequelize[_0x91b1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x91b1('0x4'),'integration',_0x91b1('0x5'),_0x91b1('0x6'),_0x91b1('0x7'),'browser',_0x91b1('0x8'),_0x91b1('0x9')]],'msg':_0x91b1('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x91b1('0x3')](0x1000),'comment':_0x91b1('0xb')},'data2':{'type':Sequelize[_0x91b1('0x3')](0x1000),'comment':_0x91b1('0xc')},'data3':{'type':Sequelize[_0x91b1('0x3')](0x1000),'comment':_0x91b1('0xd')},'data4':{'type':Sequelize[_0x91b1('0x3')](0x1000),'comments':_0x91b1('0xe')},'data5':{'type':Sequelize[_0x91b1('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x91b1('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x91b1('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xe50a=['sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0xbec2cd,_0xcf1938){var _0x38142e=function(_0x2abf51){while(--_0x2abf51){_0xbec2cd['push'](_0xbec2cd['shift']());}};_0x38142e(++_0xcf1938);}(_0xe50a,0x1c2));var _0xae50=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xe50a[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0xae50('0x0'));module[_0xae50('0x1')]={'name':{'type':Sequelize[_0xae50('0x2')],'get':function(_0x393ff8){return this[_0xae50('0x3')](_0xae50('0x4'));}},'action':{'type':Sequelize[_0xae50('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xae50('0x6'),_0xae50('0x7'),'motionbar',_0xae50('0x8'),'urlForward','browser','bot',_0xae50('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xae50('0xa')},'data1':{'type':Sequelize[_0xae50('0x5')](0x1000),'comment':_0xae50('0xb')},'data2':{'type':Sequelize[_0xae50('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xae50('0x5')](0x1000),'comment':_0xae50('0xc')},'data4':{'type':Sequelize[_0xae50('0x5')](0x1000),'comments':_0xae50('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xae50('0xe')},'data6':{'type':Sequelize[_0xae50('0x5')],'comments':_0xae50('0xf')},'data7':{'type':Sequelize[_0xae50('0x10')],'comments':_0xae50('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 10f1e82..23c78eb 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 _0x9ca5=['error','stack','name','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy'];(function(_0x28ae71,_0x956d7d){var _0x43a1e3=function(_0x7bea5){while(--_0x7bea5){_0x28ae71['push'](_0x28ae71['shift']());}};_0x43a1e3(++_0x956d7d);}(_0x9ca5,0xdf));var _0x59ca=function(_0x3b154f,_0x14fd22){_0x3b154f=_0x3b154f-0x0;var _0xe53d42=_0x9ca5[_0x3b154f];return _0xe53d42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59ca('0x0'));var zipdir=require(_0x59ca('0x1'));var jsonpatch=require(_0x59ca('0x2'));var rp=require(_0x59ca('0x3'));var moment=require(_0x59ca('0x4'));var BPromise=require(_0x59ca('0x5'));var Mustache=require('mustache');var util=require(_0x59ca('0x6'));var path=require(_0x59ca('0x7'));var sox=require('sox');var csv=require(_0x59ca('0x8'));var ejs=require(_0x59ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59ca('0xa'));var squel=require('squel');var crypto=require(_0x59ca('0xb'));var jsforce=require(_0x59ca('0xc'));var deskjs=require(_0x59ca('0xd'));var toCsv=require(_0x59ca('0x8'));var querystring=require('querystring');var Papa=require(_0x59ca('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59ca('0xf'));var hardwareService=require(_0x59ca('0x10'));var logger=require(_0x59ca('0x11'))(_0x59ca('0x12'));var utils=require(_0x59ca('0x13'));var config=require(_0x59ca('0x14'));var licenseUtil=require(_0x59ca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203909,_0x24ac5c){_0x24ac5c=_0x24ac5c||0xcc;return function(_0x1acf98){if(_0x1acf98){return _0x203909['sendStatus'](_0x24ac5c);}return _0x203909[_0x59ca('0x16')](_0x24ac5c)[_0x59ca('0x17')]();};}function respondWithResult(_0x289c35,_0x4279cc){_0x4279cc=_0x4279cc||0xc8;return function(_0x1f8fae){if(_0x1f8fae){return _0x289c35['status'](_0x4279cc)['json'](_0x1f8fae);}};}function respondWithFilteredResult(_0x4f85e9,_0x73d6a1){return function(_0x47d22b){if(_0x47d22b){var _0x25ef25=typeof _0x73d6a1[_0x59ca('0x18')]==='undefined'&&typeof _0x73d6a1['limit']===_0x59ca('0x19');var _0x1c51da=_0x47d22b[_0x59ca('0x1a')];var _0x2acb08=_0x25ef25?0x0:_0x73d6a1[_0x59ca('0x18')];var _0x335df2=_0x25ef25?_0x47d22b[_0x59ca('0x1a')]:_0x73d6a1[_0x59ca('0x18')]+_0x73d6a1[_0x59ca('0x1b')];var _0x5ef81d;if(_0x335df2>=_0x1c51da){_0x335df2=_0x1c51da;_0x5ef81d=0xc8;}else{_0x5ef81d=0xce;}_0x4f85e9[_0x59ca('0x16')](_0x5ef81d);return _0x4f85e9[_0x59ca('0x1c')]('Content-Range',_0x2acb08+'-'+_0x335df2+'/'+_0x1c51da)[_0x59ca('0x1d')](_0x47d22b);}return null;};}function patchUpdates(_0x469142){return function(_0x18473f){try{jsonpatch[_0x59ca('0x1e')](_0x18473f,_0x469142,!![]);}catch(_0x2c695b){return BPromise[_0x59ca('0x1f')](_0x2c695b);}return _0x18473f[_0x59ca('0x20')]();};}function saveUpdates(_0x448a98,_0x592270){return function(_0x1dd560){if(_0x1dd560){return _0x1dd560['update'](_0x448a98)[_0x59ca('0x21')](function(_0x4adc6d){return _0x4adc6d;});}return null;};}function removeEntity(_0x2b1f15,_0x503409){return function(_0x2ed513){if(_0x2ed513){return _0x2ed513[_0x59ca('0x22')]()['then'](function(){_0x2b1f15[_0x59ca('0x16')](0xcc)[_0x59ca('0x17')]();});}};}function handleEntityNotFound(_0x57a649,_0x3fa428){return function(_0x584032){if(!_0x584032){_0x57a649['sendStatus'](0x194);}return _0x584032;};}function handleError(_0x3d33ed,_0x16f9dc){_0x16f9dc=_0x16f9dc||0x1f4;return function(_0x1469d1){logger[_0x59ca('0x23')](_0x1469d1[_0x59ca('0x24')]);if(_0x1469d1[_0x59ca('0x25')]){delete _0x1469d1[_0x59ca('0x25')];}_0x3d33ed['status'](_0x16f9dc)['send'](_0x1469d1);};}exports['update']=function(_0x4d5296,_0x279a7c){if(_0x4d5296[_0x59ca('0x26')]['id']){delete _0x4d5296['body']['id'];}return db[_0x59ca('0x27')][_0x59ca('0x28')]({'where':{'id':_0x4d5296[_0x59ca('0x29')]['id']}})[_0x59ca('0x21')](handleEntityNotFound(_0x279a7c,null))[_0x59ca('0x21')](saveUpdates(_0x4d5296[_0x59ca('0x26')],null))[_0x59ca('0x21')](respondWithResult(_0x279a7c,null))[_0x59ca('0x2a')](handleError(_0x279a7c,null));};exports[_0x59ca('0x22')]=function(_0x1ddf40,_0xb1e5ac){return db['Action'][_0x59ca('0x28')]({'where':{'id':_0x1ddf40['params']['id']}})[_0x59ca('0x21')](handleEntityNotFound(_0xb1e5ac,null))['then'](removeEntity(_0xb1e5ac,null))['catch'](handleError(_0xb1e5ac,null));}; \ No newline at end of file +var _0x2a56=['lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','body','Action','find','params','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x2a56,0x186));var _0x62a5=function(_0x3fb56f,_0x2eeb34){_0x3fb56f=_0x3fb56f-0x0;var _0x4098fa=_0x2a56[_0x3fb56f];return _0x4098fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62a5('0x0'));var zipdir=require(_0x62a5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62a5('0x2'));var moment=require(_0x62a5('0x3'));var BPromise=require(_0x62a5('0x4'));var Mustache=require(_0x62a5('0x5'));var util=require('util');var path=require(_0x62a5('0x6'));var sox=require(_0x62a5('0x7'));var csv=require('to-csv');var ejs=require(_0x62a5('0x8'));var fs=require('fs');var fs_extra=require(_0x62a5('0x9'));var _=require(_0x62a5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x62a5('0xb'));var deskjs=require(_0x62a5('0xc'));var toCsv=require(_0x62a5('0xd'));var querystring=require(_0x62a5('0xe'));var Papa=require(_0x62a5('0xf'));var Redis=require(_0x62a5('0x10'));var authService=require(_0x62a5('0x11'));var qs=require(_0x62a5('0x12'));var as=require(_0x62a5('0x13'));var hardwareService=require(_0x62a5('0x14'));var logger=require(_0x62a5('0x15'))(_0x62a5('0x16'));var utils=require(_0x62a5('0x17'));var config=require(_0x62a5('0x18'));var licenseUtil=require(_0x62a5('0x19'));var db=require(_0x62a5('0x1a'))['db'];function respondWithStatusCode(_0x10aaa2,_0x77c4f6){_0x77c4f6=_0x77c4f6||0xcc;return function(_0x27350a){if(_0x27350a){return _0x10aaa2[_0x62a5('0x1b')](_0x77c4f6);}return _0x10aaa2[_0x62a5('0x1c')](_0x77c4f6)['end']();};}function respondWithResult(_0x331bcc,_0x1e29c5){_0x1e29c5=_0x1e29c5||0xc8;return function(_0x13bcb0){if(_0x13bcb0){return _0x331bcc[_0x62a5('0x1c')](_0x1e29c5)[_0x62a5('0x1d')](_0x13bcb0);}};}function respondWithFilteredResult(_0x9954bd,_0x109e4a){return function(_0x1dc8f5){if(_0x1dc8f5){var _0x1eae31=typeof _0x109e4a[_0x62a5('0x1e')]==='undefined'&&typeof _0x109e4a[_0x62a5('0x1f')]===_0x62a5('0x20');var _0x495eb3=_0x1dc8f5[_0x62a5('0x21')];var _0x481a49=_0x1eae31?0x0:_0x109e4a[_0x62a5('0x1e')];var _0xcab835=_0x1eae31?_0x1dc8f5[_0x62a5('0x21')]:_0x109e4a[_0x62a5('0x1e')]+_0x109e4a[_0x62a5('0x1f')];var _0x85eb68;if(_0xcab835>=_0x495eb3){_0xcab835=_0x495eb3;_0x85eb68=0xc8;}else{_0x85eb68=0xce;}_0x9954bd[_0x62a5('0x1c')](_0x85eb68);return _0x9954bd[_0x62a5('0x22')](_0x62a5('0x23'),_0x481a49+'-'+_0xcab835+'/'+_0x495eb3)[_0x62a5('0x1d')](_0x1dc8f5);}return null;};}function patchUpdates(_0x20b9a8){return function(_0x58fe0f){try{jsonpatch[_0x62a5('0x24')](_0x58fe0f,_0x20b9a8,!![]);}catch(_0x3333af){return BPromise[_0x62a5('0x25')](_0x3333af);}return _0x58fe0f['save']();};}function saveUpdates(_0x59efe4,_0x206396){return function(_0x201e78){if(_0x201e78){return _0x201e78[_0x62a5('0x26')](_0x59efe4)[_0x62a5('0x27')](function(_0x2f72df){return _0x2f72df;});}return null;};}function removeEntity(_0x504fdc,_0x48c5dc){return function(_0x47a4b4){if(_0x47a4b4){return _0x47a4b4[_0x62a5('0x28')]()[_0x62a5('0x27')](function(){_0x504fdc[_0x62a5('0x1c')](0xcc)[_0x62a5('0x29')]();});}};}function handleEntityNotFound(_0x5ca681,_0x17e5ae){return function(_0x19a87b){if(!_0x19a87b){_0x5ca681[_0x62a5('0x1b')](0x194);}return _0x19a87b;};}function handleError(_0x3d19d2,_0x4220f1){_0x4220f1=_0x4220f1||0x1f4;return function(_0x3e8c22){logger[_0x62a5('0x2a')](_0x3e8c22[_0x62a5('0x2b')]);if(_0x3e8c22[_0x62a5('0x2c')]){delete _0x3e8c22[_0x62a5('0x2c')];}_0x3d19d2[_0x62a5('0x1c')](_0x4220f1)['send'](_0x3e8c22);};}exports[_0x62a5('0x26')]=function(_0xd76a5f,_0xe61402){if(_0xd76a5f[_0x62a5('0x2d')]['id']){delete _0xd76a5f[_0x62a5('0x2d')]['id'];}return db[_0x62a5('0x2e')][_0x62a5('0x2f')]({'where':{'id':_0xd76a5f[_0x62a5('0x30')]['id']}})[_0x62a5('0x27')](handleEntityNotFound(_0xe61402,null))[_0x62a5('0x27')](saveUpdates(_0xd76a5f['body'],null))[_0x62a5('0x27')](respondWithResult(_0xe61402,null))['catch'](handleError(_0xe61402,null));};exports[_0x62a5('0x28')]=function(_0x4674d4,_0x583fce){return db['Action']['find']({'where':{'id':_0x4674d4[_0x62a5('0x30')]['id']}})['then'](handleEntityNotFound(_0x583fce,null))[_0x62a5('0x27')](removeEntity(_0x583fce,null))[_0x62a5('0x31')](handleError(_0x583fce,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 95aec9c..dcb227a 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 _0xf4f5=['bluebird','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','util','api'];(function(_0x44015d,_0x3f5c3a){var _0x2cb51a=function(_0x2f369c){while(--_0x2f369c){_0x44015d['push'](_0x44015d['shift']());}};_0x2cb51a(++_0x3f5c3a);}(_0xf4f5,0x89));var _0x5f4f=function(_0x5b5377,_0x504a69){_0x5b5377=_0x5b5377-0x0;var _0x53445f=_0xf4f5[_0x5b5377];return _0x53445f;};'use strict';var _=require(_0x5f4f('0x0'));var util=require(_0x5f4f('0x1'));var logger=require('../../config/logger')(_0x5f4f('0x2'));var moment=require('moment');var BPromise=require(_0x5f4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f4f('0x4'));var rimraf=require(_0x5f4f('0x5'));var config=require(_0x5f4f('0x6'));var attributes=require(_0x5f4f('0x7'));module['exports']=function(_0x18efa9,_0x5934cd){return _0x18efa9['define'](_0x5f4f('0x8'),attributes,{'tableName':_0x5f4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fa1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fa1,0x15e));var _0x18fa=function(_0x1e9706,_0x13d7f8){_0x1e9706=_0x1e9706-0x0;var _0x724a9c=_0x8fa1[_0x1e9706];return _0x724a9c;};'use strict';var _=require(_0x18fa('0x0'));var util=require('util');var logger=require(_0x18fa('0x1'))(_0x18fa('0x2'));var moment=require(_0x18fa('0x3'));var BPromise=require(_0x18fa('0x4'));var rp=require(_0x18fa('0x5'));var fs=require('fs');var path=require(_0x18fa('0x6'));var rimraf=require(_0x18fa('0x7'));var config=require(_0x18fa('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0xc23704,_0x403ed1){return _0xc23704[_0x18fa('0x9')]('Action',attributes,{'tableName':_0x18fa('0xa'),'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 3769070..e73a727 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(_0x3c34a1,_0xc35f37){var _0x5a92bc=function(_0xec8c5f){while(--_0xec8c5f){_0x3c34a1['push'](_0x3c34a1['shift']());}};_0x5a92bc(++_0xc35f37);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x5fc3[_0x5a19fc];return _0x34b413;};'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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x53ec,0x192));var _0xc53e=function(_0x170362,_0x1bf09a){_0x170362=_0x170362-0x0;var _0x2fd172=_0x53ec[_0x170362];return _0x2fd172;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e63024e..55bd89f 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 _0x59ee=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','put','/:id','update','delete','isAuthenticated'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x59ee,0x154));var _0xe59e=function(_0x2eb47c,_0x43bdf3){_0x2eb47c=_0x2eb47c-0x0;var _0x13097b=_0x59ee[_0x2eb47c];return _0x13097b;};'use strict';var multer=require(_0xe59e('0x0'));var util=require(_0xe59e('0x1'));var path=require(_0xe59e('0x2'));var timeout=require('connect-timeout');var express=require(_0xe59e('0x3'));var router=express[_0xe59e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe59e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0xe59e('0x6')](_0xe59e('0x7'),auth['isAuthenticated'](),controller[_0xe59e('0x8')]);router[_0xe59e('0x9')](_0xe59e('0x7'),auth[_0xe59e('0xa')](),controller[_0xe59e('0xb')]);module[_0xe59e('0xc')]=router; \ No newline at end of file +var _0xe0c9=['delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x156e99,_0x2bf27e){var _0x18870e=function(_0x3e6c3b){while(--_0x3e6c3b){_0x156e99['push'](_0x156e99['shift']());}};_0x18870e(++_0x2bf27e);}(_0xe0c9,0xa9));var _0x9e0c=function(_0x171d6d,_0x5aef21){_0x171d6d=_0x171d6d-0x0;var _0x3f8c6e=_0xe0c9[_0x171d6d];return _0x3f8c6e;};'use strict';var multer=require('multer');var util=require(_0x9e0c('0x0'));var path=require(_0x9e0c('0x1'));var timeout=require(_0x9e0c('0x2'));var express=require(_0x9e0c('0x3'));var router=express[_0x9e0c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9e0c('0x5'));var config=require(_0x9e0c('0x6'));var controller=require(_0x9e0c('0x7'));router[_0x9e0c('0x8')]('/:id',auth[_0x9e0c('0x9')](),controller[_0x9e0c('0xa')]);router[_0x9e0c('0xb')](_0x9e0c('0xc'),auth['isAuthenticated'](),controller[_0x9e0c('0xd')]);module[_0x9e0c('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 484f337..1b57f31 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0xecb298,_0x214007){_0xecb298=_0xecb298-0x0;var _0x5759d5=_0xb4c7[_0xecb298];return _0x5759d5;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}}; \ No newline at end of file +var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x46d242,_0x24d12e){var _0x585083=function(_0x460a09){while(--_0x460a09){_0x46d242['push'](_0x46d242['shift']());}};_0x585083(++_0x24d12e);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xeec6[_0x2c9b79];return _0x265032;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f7ad793..25286b8 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 _0x7bb9=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','index','AnalyticCustomReport','rawAttributes','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','includes','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','Sequelize','DESC','parentKey','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','MIN(%s)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra'];(function(_0x1eb374,_0x38c789){var _0x7ac296=function(_0x546649){while(--_0x546649){_0x1eb374['push'](_0x1eb374['shift']());}};_0x7ac296(++_0x38c789);}(_0x7bb9,0x1eb));var _0x97bb=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x7bb9[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0x97bb('0x0'));var rimraf=require(_0x97bb('0x1'));var zipdir=require(_0x97bb('0x2'));var jsonpatch=require(_0x97bb('0x3'));var rp=require(_0x97bb('0x4'));var moment=require('moment');var BPromise=require(_0x97bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x97bb('0x6'));var csv=require(_0x97bb('0x7'));var ejs=require(_0x97bb('0x8'));var fs=require('fs');var fs_extra=require(_0x97bb('0x9'));var _=require(_0x97bb('0xa'));var squel=require(_0x97bb('0xb'));var crypto=require(_0x97bb('0xc'));var jsforce=require(_0x97bb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x97bb('0x7'));var querystring=require(_0x97bb('0xe'));var Papa=require(_0x97bb('0xf'));var Redis=require(_0x97bb('0x10'));var authService=require(_0x97bb('0x11'));var qs=require(_0x97bb('0x12'));var as=require(_0x97bb('0x13'));var hardwareService=require(_0x97bb('0x14'));var logger=require(_0x97bb('0x15'))(_0x97bb('0x16'));var utils=require(_0x97bb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x97bb('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x97bb('0x19'))[_0x97bb('0x1a')];function respondWithStatusCode(_0x3ea5f1,_0x13365c){_0x13365c=_0x13365c||0xcc;return function(_0x2a2631){if(_0x2a2631){return _0x3ea5f1[_0x97bb('0x1b')](_0x13365c);}return _0x3ea5f1[_0x97bb('0x1c')](_0x13365c)[_0x97bb('0x1d')]();};}function respondWithResult(_0x16d843,_0x174093){_0x174093=_0x174093||0xc8;return function(_0x227562){if(_0x227562){return _0x16d843[_0x97bb('0x1c')](_0x174093)[_0x97bb('0x1e')](_0x227562);}};}function respondWithFilteredResult(_0x5dbbd9,_0x149bfe){return function(_0x308a77){if(_0x308a77){var _0x4f8506=typeof _0x149bfe[_0x97bb('0x1f')]===_0x97bb('0x20')&&typeof _0x149bfe[_0x97bb('0x21')]===_0x97bb('0x20');var _0xecc171=_0x308a77[_0x97bb('0x22')];var _0x235d12=_0x4f8506?0x0:_0x149bfe[_0x97bb('0x1f')];var _0x1b7515=_0x4f8506?_0x308a77[_0x97bb('0x22')]:_0x149bfe[_0x97bb('0x1f')]+_0x149bfe[_0x97bb('0x21')];var _0x293c69;if(_0x1b7515>=_0xecc171){_0x1b7515=_0xecc171;_0x293c69=0xc8;}else{_0x293c69=0xce;}_0x5dbbd9['status'](_0x293c69);return _0x5dbbd9[_0x97bb('0x23')](_0x97bb('0x24'),_0x235d12+'-'+_0x1b7515+'/'+_0xecc171)[_0x97bb('0x1e')](_0x308a77);}return null;};}function patchUpdates(_0x2b89b2){return function(_0x34c278){try{jsonpatch[_0x97bb('0x25')](_0x34c278,_0x2b89b2,!![]);}catch(_0x5537b0){return BPromise[_0x97bb('0x26')](_0x5537b0);}return _0x34c278[_0x97bb('0x27')]();};}function saveUpdates(_0x5dc8e3,_0x274be2){return function(_0xc6707){if(_0xc6707){return _0xc6707[_0x97bb('0x28')](_0x5dc8e3)[_0x97bb('0x29')](function(_0x2ab133){return _0x2ab133;});}return null;};}function removeEntity(_0xbecd0f,_0x5a969a){return function(_0x1dea61){if(_0x1dea61){return _0x1dea61[_0x97bb('0x2a')]()[_0x97bb('0x29')](function(){var _0x5eeb10=_0x1dea61[_0x97bb('0x2b')]({'plain':!![]});var _0x4e4701=_0x97bb('0x2c');return db[_0x97bb('0x2d')]['destroy']({'where':{'type':_0x4e4701,'resourceId':_0x5eeb10['id']}})[_0x97bb('0x29')](function(){return _0x1dea61;});})['then'](function(){_0xbecd0f['status'](0xcc)[_0x97bb('0x1d')]();});}};}function handleEntityNotFound(_0x3145bd,_0x4494a8){return function(_0x2ed467){if(!_0x2ed467){_0x3145bd['sendStatus'](0x194);}return _0x2ed467;};}function handleError(_0x2c1d70,_0xe3aa4e){_0xe3aa4e=_0xe3aa4e||0x1f4;return function(_0x568c3d){logger['error'](_0x568c3d[_0x97bb('0x2e')]);if(_0x568c3d[_0x97bb('0x2f')]){delete _0x568c3d[_0x97bb('0x2f')];}_0x2c1d70[_0x97bb('0x1c')](_0xe3aa4e)[_0x97bb('0x30')](_0x568c3d);};}exports[_0x97bb('0x31')]=function(_0x294504,_0xc803e5){var _0x58fc13={},_0x462c6a={},_0x5cd733={'count':0x0,'rows':[]};var _0x5ed08d=_['map'](db[_0x97bb('0x32')][_0x97bb('0x33')],function(_0x53cc9f){return{'name':_0x53cc9f['fieldName'],'type':_0x53cc9f[_0x97bb('0x34')]['key']};});_0x462c6a['model']=_[_0x97bb('0x35')](_0x5ed08d,'name');_0x462c6a[_0x97bb('0x36')]=_['keys'](_0x294504[_0x97bb('0x36')]);_0x462c6a[_0x97bb('0x37')]=_[_0x97bb('0x38')](_0x462c6a[_0x97bb('0x39')],_0x462c6a[_0x97bb('0x36')]);_0x58fc13[_0x97bb('0x3a')]=_[_0x97bb('0x38')](_0x462c6a[_0x97bb('0x39')],qs['fields'](_0x294504[_0x97bb('0x36')][_0x97bb('0x3b')]));_0x58fc13[_0x97bb('0x3a')]=_0x58fc13[_0x97bb('0x3a')][_0x97bb('0x3c')]?_0x58fc13[_0x97bb('0x3a')]:_0x462c6a['model'];if(!_0x294504['query'][_0x97bb('0x3d')]('nolimit')){_0x58fc13['limit']=qs[_0x97bb('0x21')](_0x294504[_0x97bb('0x36')][_0x97bb('0x21')]);_0x58fc13[_0x97bb('0x1f')]=qs[_0x97bb('0x1f')](_0x294504[_0x97bb('0x36')][_0x97bb('0x1f')]);}_0x58fc13[_0x97bb('0x3e')]=qs[_0x97bb('0x3f')](_0x294504[_0x97bb('0x36')][_0x97bb('0x3f')]);_0x58fc13[_0x97bb('0x40')]=qs[_0x97bb('0x37')](_[_0x97bb('0x41')](_0x294504['query'],_0x462c6a['filters']),_0x5ed08d);if(_0x294504[_0x97bb('0x36')][_0x97bb('0x42')]){_0x58fc13[_0x97bb('0x40')]=_[_0x97bb('0x43')](_0x58fc13[_0x97bb('0x40')],{'$or':_[_0x97bb('0x35')](_0x5ed08d,function(_0x91df73){if(_0x91df73[_0x97bb('0x34')]!=='VIRTUAL'){var _0x3fab5f={};_0x3fab5f[_0x91df73['name']]={'$like':'%'+_0x294504[_0x97bb('0x36')][_0x97bb('0x42')]+'%'};return _0x3fab5f;}})});}_0x58fc13=_[_0x97bb('0x43')]({},_0x58fc13,_0x294504[_0x97bb('0x44')]);var _0x123d11={'where':_0x58fc13[_0x97bb('0x40')]};return db[_0x97bb('0x32')][_0x97bb('0x22')](_0x123d11)[_0x97bb('0x29')](function(_0x54e4e9){_0x5cd733[_0x97bb('0x22')]=_0x54e4e9;if(_0x294504['query']['includeAll']){_0x58fc13[_0x97bb('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x58fc13);})['then'](function(_0x247144){_0x5cd733[_0x97bb('0x46')]=_0x247144;return _0x5cd733;})['then'](respondWithFilteredResult(_0xc803e5,_0x58fc13))[_0x97bb('0x47')](handleError(_0xc803e5,null));};exports[_0x97bb('0x48')]=function(_0x328815,_0x19bf65){var _0x1171dd={'raw':![],'where':{'id':_0x328815[_0x97bb('0x49')]['id']}},_0x34155f={};_0x34155f[_0x97bb('0x39')]=_[_0x97bb('0x4a')](db[_0x97bb('0x32')][_0x97bb('0x33')]);_0x34155f[_0x97bb('0x36')]=_[_0x97bb('0x4a')](_0x328815['query']);_0x34155f[_0x97bb('0x37')]=_[_0x97bb('0x38')](_0x34155f[_0x97bb('0x39')],_0x34155f[_0x97bb('0x36')]);_0x1171dd['attributes']=_[_0x97bb('0x38')](_0x34155f[_0x97bb('0x39')],qs[_0x97bb('0x3b')](_0x328815[_0x97bb('0x36')][_0x97bb('0x3b')]));_0x1171dd['attributes']=_0x1171dd[_0x97bb('0x3a')][_0x97bb('0x3c')]?_0x1171dd[_0x97bb('0x3a')]:_0x34155f['model'];if(_0x328815[_0x97bb('0x36')][_0x97bb('0x4b')]){_0x1171dd[_0x97bb('0x45')]=[{'all':!![]}];}_0x1171dd=_['merge']({},_0x1171dd,_0x328815['options']);return db[_0x97bb('0x32')][_0x97bb('0x4c')](_0x1171dd)[_0x97bb('0x29')](handleEntityNotFound(_0x19bf65,null))['then'](respondWithResult(_0x19bf65,null))[_0x97bb('0x47')](handleError(_0x19bf65,null));};exports[_0x97bb('0x4d')]=function(_0x5f3a73,_0x271053){return db['AnalyticCustomReport'][_0x97bb('0x4d')](_0x5f3a73[_0x97bb('0x4e')],{})['then'](function(_0x37c351){var _0x757b7c=_0x5f3a73[_0x97bb('0x4f')][_0x97bb('0x2b')]({'plain':!![]});if(!_0x757b7c)throw new Error(_0x97bb('0x50'));if(_0x757b7c[_0x97bb('0x51')]===_0x97bb('0x4f')){var _0x5c658c=_0x37c351['get']({'plain':!![]});var _0x353866='Reports';return db[_0x97bb('0x52')][_0x97bb('0x4c')]({'where':{'name':_0x353866,'userProfileId':_0x757b7c[_0x97bb('0x53')]},'raw':!![]})['then'](function(_0x7aad3){if(_0x7aad3&&_0x7aad3['autoAssociation']===0x0){return db[_0x97bb('0x2d')][_0x97bb('0x4d')]({'name':_0x5c658c[_0x97bb('0x2f')],'resourceId':_0x5c658c['id'],'type':_0x97bb('0x2c'),'sectionId':_0x7aad3['id']},{})[_0x97bb('0x29')](function(){return _0x37c351;});}else{return _0x37c351;}})[_0x97bb('0x47')](function(_0x468d60){logger['error'](_0x97bb('0x54'),_0x468d60);throw _0x468d60;});}return _0x37c351;})[_0x97bb('0x29')](respondWithResult(_0x271053,0xc9))[_0x97bb('0x47')](handleError(_0x271053,null));};exports[_0x97bb('0x28')]=function(_0x22653d,_0x3f4c4d){if(_0x22653d[_0x97bb('0x4e')]['id']){delete _0x22653d[_0x97bb('0x4e')]['id'];}return db[_0x97bb('0x32')][_0x97bb('0x4c')]({'where':{'id':_0x22653d[_0x97bb('0x49')]['id']}})[_0x97bb('0x29')](handleEntityNotFound(_0x3f4c4d,null))[_0x97bb('0x29')](saveUpdates(_0x22653d['body'],null))['then'](respondWithResult(_0x3f4c4d,null))['catch'](handleError(_0x3f4c4d,null));};exports[_0x97bb('0x2a')]=function(_0x35b63b,_0xd7ef5d){return db[_0x97bb('0x32')][_0x97bb('0x4c')]({'where':{'id':_0x35b63b['params']['id']}})[_0x97bb('0x29')](handleEntityNotFound(_0xd7ef5d,null))[_0x97bb('0x29')](removeEntity(_0xd7ef5d,null))[_0x97bb('0x47')](handleError(_0xd7ef5d,null));};exports[_0x97bb('0x55')]=function(_0x2b0c1e,_0x413c29){var _0x4f8a1d=0xa;var _0x12c307=['join',_0x97bb('0x56'),_0x97bb('0x57'),_0x97bb('0x58')];var _0x75a2d7={'SUM':_0x97bb('0x59'),'COUNT':_0x97bb('0x5a'),'COUNT DISTINCT':_0x97bb('0x5b'),'MAX':_0x97bb('0x5c'),'MIN':'MIN(%s)','AVG':_0x97bb('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x97bb('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x381417={'SEC_TO_TIME':_0x97bb('0x5f'),'DATE':_0x97bb('0x60'),'HOUR':_0x97bb('0x61'),'ROUND':_0x97bb('0x62'),'UNIX_TIMESTAMP':_0x97bb('0x63')};var _0xd20ebb=function(_0x18b807){return!_['includes']([_0x97bb('0x64'),'IS\x20NOT\x20NULL',_0x97bb('0x65'),_0x97bb('0x66')],_0x18b807);};var _0x593172=function(_0x251c5a){if(!_0x251c5a||!_0x251c5a[_0x97bb('0x67')][_0x97bb('0x3c')]){return'';}for(var _0x4228f0='(',_0x1ba83f=0x0;_0x1ba83f<_0x251c5a[_0x97bb('0x67')][_0x97bb('0x3c')];_0x1ba83f+=0x1){_0x1ba83f>0x0&&(_0x4228f0+='\x20'+_0x251c5a['operator']+'\x20');_0x4228f0+=_0x251c5a[_0x97bb('0x67')][_0x1ba83f][_0x97bb('0x68')]?_0x593172(_0x251c5a['rules'][_0x1ba83f][_0x97bb('0x68')]):_0x251c5a[_0x97bb('0x67')][_0x1ba83f][_0x97bb('0x69')]+'\x20'+_0x251c5a[_0x97bb('0x67')][_0x1ba83f][_0x97bb('0x6a')]+(_0xd20ebb(_0x251c5a[_0x97bb('0x67')][_0x1ba83f][_0x97bb('0x6a')])?'\x20'+_0x251c5a[_0x97bb('0x67')][_0x1ba83f][_0x97bb('0x6b')]:'');}return _0x4228f0+')';};var _0x104315={'where':{'id':_0x2b0c1e[_0x97bb('0x49')]['id']}},_0x359175,_0x7ca099,_0xa6bf7a,_0x441c1f,_0x310d5a;_0x104315=_['merge']({},_0x104315,_0x2b0c1e['options']);return db[_0x97bb('0x32')][_0x97bb('0x4c')](_0x104315)['then'](function(_0x946eb2){if(_0x946eb2){_0x359175=_0x946eb2;return _0x946eb2[_0x97bb('0x6c')]();}return null;})['then'](function(_0x4de7d5){if(_0x4de7d5){if(!_0x4de7d5[_0x97bb('0x3c')]){throw new db['Sequelize'][(_0x97bb('0x6d'))](_0x97bb('0x6e'),0x193);}_0x7ca099=_0x4de7d5;return db[_0x97bb('0x6f')][_0x97bb('0x70')]({'raw':!![]});}return null;})[_0x97bb('0x29')](function(_0x42397e){if(_0x42397e){_0xa6bf7a=_[_0x97bb('0x71')](_0x42397e,'id');var _0x40553e;var _0x2ed187=squel[_0x97bb('0x72')]();_0x2ed187[_0x97bb('0x73')](_0x359175['table']);for(var _0x54aea7=0x0;_0x54aea7<_0x7ca099[_0x97bb('0x3c')];_0x54aea7+=0x1){_0x40553e=_0x7ca099[_0x54aea7][_0x97bb('0x74')]?_0xa6bf7a[_0x7ca099[_0x54aea7][_0x97bb('0x74')]][_0x97bb('0x75')]:_0x7ca099[_0x54aea7][_0x97bb('0x69')];_0x40553e=_0x7ca099[_0x54aea7][_0x97bb('0x76')]?_[_0x97bb('0x77')](_0x75a2d7[_0x7ca099[_0x54aea7]['function']],'%s',_0x40553e):_0x40553e;_0x40553e=_0x7ca099[_0x54aea7]['format']?_[_0x97bb('0x77')](_0x381417[_0x7ca099[_0x54aea7][_0x97bb('0x78')]],'%s',_0x40553e):_0x40553e;if(_0x7ca099[_0x54aea7][_0x97bb('0x79')]){_0x2ed187['group'](_0x40553e);}_0x7ca099[_0x54aea7][_0x97bb('0x7a')]&&_0x2ed187[_0x97bb('0x3e')](_0x40553e,_0x7ca099[_0x54aea7]['orderBy']==='DESC'?![]:!![]);_0x2ed187[_0x97bb('0x69')](_0x40553e,_0x7ca099[_0x54aea7][_0x97bb('0x7b')]||_0x40553e);}if(_0x359175[_0x97bb('0x7c')]){_0x359175['joins']=JSON['parse'](_0x359175[_0x97bb('0x7c')]);for(var _0x210773=0x0;_0x210773<_0x359175[_0x97bb('0x7c')]['length'];_0x210773+=0x1){if(_0x359175[_0x97bb('0x7c')][_0x210773][_0x97bb('0x34')]&&_[_0x97bb('0x7d')](_0x12c307,_0x359175['joins'][_0x210773][_0x97bb('0x34')])&&_0x359175[_0x97bb('0x7c')][_0x210773]['parentKey']&&_0x359175[_0x97bb('0x7c')][_0x210773]['foreignTable']&&_0x359175['joins'][_0x210773][_0x97bb('0x7e')]){_0x2ed187[_0x359175[_0x97bb('0x7c')][_0x210773][_0x97bb('0x34')]](_0x359175[_0x97bb('0x7c')][_0x210773][_0x97bb('0x7f')],null,util[_0x97bb('0x78')](_0x97bb('0x80'),_0x359175[_0x97bb('0x81')],_0x359175['joins'][_0x210773]['parentKey'],_0x359175[_0x97bb('0x7c')][_0x210773]['foreignTable'],_0x359175['joins'][_0x210773][_0x97bb('0x7e')]));}}}if(_0x359175[_0x97bb('0x82')]){_0x359175[_0x97bb('0x82')]=JSON[_0x97bb('0x83')](_0x359175['conditions']);_0x2ed187[_0x97bb('0x40')](_0x593172(_0x359175[_0x97bb('0x82')]['group']));}_0x310d5a=_0x2ed187[_0x97bb('0x84')]();_0x2ed187[_0x97bb('0x21')](_0x4f8a1d);_0x2ed187[_0x97bb('0x1f')](0x0);logger['debug'](_0x97bb('0x85'),_0x2ed187['toString']());return dbH[_0x97bb('0x86')]['query'](_0x2ed187[_0x97bb('0x87')](),{'type':dbH[_0x97bb('0x86')][_0x97bb('0x88')][_0x97bb('0x89')]});}})[_0x97bb('0x29')](respondWithResult(_0x413c29,null))[_0x97bb('0x47')](handleError(_0x413c29,null));};function runReport(_0x397c02,_0x39d58e,_0x1bb6d9){var _0x2cc26e=_0x39d58e[_0x97bb('0x2f')];var _0x217943=0xa;var _0x503e94=[_0x97bb('0x8a'),_0x97bb('0x56'),_0x97bb('0x57'),_0x97bb('0x58')];var _0xe74439={'SUM':_0x97bb('0x59'),'COUNT':_0x97bb('0x5a'),'COUNT DISTINCT':_0x97bb('0x5b'),'MAX':_0x97bb('0x5c'),'MIN':'MIN(%s)','AVG':_0x97bb('0x5d'),'GROUP_CONCAT':_0x97bb('0x8b'),'GROUP_CONCAT ASC':_0x97bb('0x5e'),'GROUP_CONCAT DESC':_0x97bb('0x8c')};var _0xf65bac={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x97bb('0x60'),'HOUR':_0x97bb('0x61'),'ROUND':_0x97bb('0x62'),'UNIX_TIMESTAMP':_0x97bb('0x63')};var _0x38c036=function(_0x19eb00){return!_[_0x97bb('0x7d')]([_0x97bb('0x64'),'IS\x20NOT\x20NULL',_0x97bb('0x65'),'IS\x20NOT\x20EMPTY'],_0x19eb00);};var _0xb486fa=function(_0x2dcf85){if(!_0x2dcf85||!_0x2dcf85[_0x97bb('0x67')]['length']){return'';}for(var _0x18981c='(',_0x24683f=0x0;_0x24683f<_0x2dcf85['rules'][_0x97bb('0x3c')];_0x24683f+=0x1){_0x24683f>0x0&&(_0x18981c+='\x20'+_0x2dcf85[_0x97bb('0x8d')]+'\x20');_0x18981c+=_0x2dcf85[_0x97bb('0x67')][_0x24683f][_0x97bb('0x68')]?_0xb486fa(_0x2dcf85[_0x97bb('0x67')][_0x24683f]['group']):_0x2dcf85[_0x97bb('0x67')][_0x24683f][_0x97bb('0x69')]+'\x20'+_0x2dcf85['rules'][_0x24683f][_0x97bb('0x6a')]+(_0x38c036(_0x2dcf85[_0x97bb('0x67')][_0x24683f][_0x97bb('0x6a')])?'\x20'+_0x2dcf85[_0x97bb('0x67')][_0x24683f]['value']:'');}return _0x18981c+')';};var _0x23ff11={'where':{'id':_0x397c02['id']}},_0x216df3,_0x2a8475,_0x25dba9,_0xe9d971,_0x4d672b;_0x23ff11=_['merge']({},_0x23ff11,_0x1bb6d9);return db[_0x97bb('0x32')][_0x97bb('0x4c')](_0x23ff11)[_0x97bb('0x29')](function(_0x344d90){if(_0x344d90){_0x216df3=_0x344d90;return _0x344d90[_0x97bb('0x6c')]();}return null;})['then'](function(_0x1bc257){if(_0x1bc257){if(!_0x1bc257[_0x97bb('0x3c')]){throw new db[(_0x97bb('0x8e'))]['ValidationErrorItem'](_0x97bb('0x6e'),0x193);}_0x2a8475=_0x1bc257;return db[_0x97bb('0x6f')][_0x97bb('0x70')]({'raw':!![]});}return null;})[_0x97bb('0x29')](function(_0x1626db){if(_0x1626db){_0x25dba9=_['keyBy'](_0x1626db,'id');var _0x4229e8;var _0x180b23=squel[_0x97bb('0x72')]();_0x180b23[_0x97bb('0x73')](_0x216df3[_0x97bb('0x81')]);for(var _0x3dc9f8=0x0;_0x3dc9f8<_0x2a8475[_0x97bb('0x3c')];_0x3dc9f8+=0x1){_0x4229e8=_0x2a8475[_0x3dc9f8][_0x97bb('0x74')]?_0x25dba9[_0x2a8475[_0x3dc9f8]['MetricId']][_0x97bb('0x75')]:_0x2a8475[_0x3dc9f8][_0x97bb('0x69')];_0x4229e8=_0x2a8475[_0x3dc9f8][_0x97bb('0x76')]?_[_0x97bb('0x77')](_0xe74439[_0x2a8475[_0x3dc9f8]['function']],'%s',_0x4229e8):_0x4229e8;_0x4229e8=_0x2a8475[_0x3dc9f8]['format']?_[_0x97bb('0x77')](_0xf65bac[_0x2a8475[_0x3dc9f8]['format']],'%s',_0x4229e8):_0x4229e8;if(_0x2a8475[_0x3dc9f8]['groupBy']){_0x180b23['group'](_0x4229e8);}_0x2a8475[_0x3dc9f8][_0x97bb('0x7a')]&&_0x180b23[_0x97bb('0x3e')](_0x4229e8,_0x2a8475[_0x3dc9f8][_0x97bb('0x7a')]===_0x97bb('0x8f')?![]:!![]);_0x180b23[_0x97bb('0x69')](_0x4229e8,_0x2a8475[_0x3dc9f8][_0x97bb('0x7b')]||_0x4229e8);}if(_0x216df3['joins']){_0x216df3['joins']=JSON[_0x97bb('0x83')](_0x216df3[_0x97bb('0x7c')]);for(var _0x15e31a=0x0;_0x15e31a<_0x216df3['joins'][_0x97bb('0x3c')];_0x15e31a+=0x1){if(_0x216df3[_0x97bb('0x7c')][_0x15e31a]['type']&&_[_0x97bb('0x7d')](_0x503e94,_0x216df3[_0x97bb('0x7c')][_0x15e31a][_0x97bb('0x34')])&&_0x216df3[_0x97bb('0x7c')][_0x15e31a][_0x97bb('0x90')]&&_0x216df3[_0x97bb('0x7c')][_0x15e31a]['foreignTable']&&_0x216df3[_0x97bb('0x7c')][_0x15e31a][_0x97bb('0x7e')]){_0x180b23[_0x216df3[_0x97bb('0x7c')][_0x15e31a][_0x97bb('0x34')]](_0x216df3[_0x97bb('0x7c')][_0x15e31a][_0x97bb('0x7f')],null,util[_0x97bb('0x78')]('%s.%s\x20=\x20%s.%s',_0x216df3['table'],_0x216df3['joins'][_0x15e31a][_0x97bb('0x90')],_0x216df3['joins'][_0x15e31a][_0x97bb('0x7f')],_0x216df3[_0x97bb('0x7c')][_0x15e31a]['foreignKey']));}}}if(_0x216df3['conditions']){_0x216df3[_0x97bb('0x82')]=JSON[_0x97bb('0x83')](_0x216df3[_0x97bb('0x82')]);_0x180b23[_0x97bb('0x40')](_0xb486fa(_0x216df3['conditions'][_0x97bb('0x68')]));}_0x4d672b=_0x180b23[_0x97bb('0x84')]();_0x180b23['limit'](_0x217943);_0x180b23[_0x97bb('0x1f')](0x0);return;}})[_0x97bb('0x29')](function(){if(_0x39d58e[_0x97bb('0x91')]===_0x97bb('0x92')){return null;}var _0x3870e8=_[_0x97bb('0x43')](_0x39d58e,{'name':_0x39d58e['fullPath']||_0x39d58e[_0x97bb('0x2f')]||_0x216df3[_0x97bb('0x2f')],'basename':_0x2cc26e,'savename':util[_0x97bb('0x78')](_0x97bb('0x93'),_0x39d58e[_0x97bb('0x2f')]||_0x216df3[_0x97bb('0x2f')],require(_0x97bb('0x94'))[_0x97bb('0x95')](0x4),_0x39d58e[_0x97bb('0x91')]||_0x97bb('0x96')),'reportId':_0x216df3['id'],'reportType':'custom'});return db[_0x97bb('0x97')][_0x97bb('0x4d')](_0x3870e8,{'raw':!![]});})['then'](function(_0x2280cc){if(_0x216df3['table']===_0x97bb('0x98')){_0x4d672b[_0x97bb('0x40')](_0x216df3[_0x97bb('0x81')]+_0x97bb('0x99'),_0x39d58e[_0x97bb('0x9a')],_0x39d58e[_0x97bb('0x9b')]);}else{_0x4d672b[_0x97bb('0x40')](_0x216df3['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x39d58e['startDate'],_0x39d58e[_0x97bb('0x9b')]);}if(_0x2280cc){logger[_0x97bb('0x9c')](_0x97bb('0x9d'),_0x4d672b['toString']());require(_0x97bb('0x9e'))['fork'](path[_0x97bb('0x8a')](__dirname,_0x97bb('0x9f'),_0x2280cc[_0x97bb('0x91')]),[_0x2280cc['id'],_0x4d672b[_0x97bb('0x87')](),path[_0x97bb('0x8a')](__dirname,'../../files/reports',_0x2280cc[_0x97bb('0xa0')]),_0x2cc26e]);return _0x2280cc;}else{var _0x343117=squel[_0x97bb('0x72')]();_0x343117[_0x97bb('0x73')]('('+_0x4d672b[_0x97bb('0x87')]()+')',_0x97bb('0xa1'));_0x343117[_0x97bb('0x69')](_0x97bb('0xa2'),_0x97bb('0x22'));_0x4d672b[_0x97bb('0x21')](_0x39d58e['limit']||_0x217943);_0x4d672b[_0x97bb('0x1f')](_0x39d58e[_0x97bb('0x1f')]||0x0);return dbH[_0x97bb('0x86')][_0x97bb('0x36')](_0x343117[_0x97bb('0x87')](),{'type':dbH[_0x97bb('0x86')]['QueryTypes'][_0x97bb('0x89')]})['then'](function(_0x3349b9){if(!_0x3349b9[_0x97bb('0x3c')]){_0xe9d971=0x0;}else{_0xe9d971=_0x3349b9[0x0][_0x97bb('0x22')]||0x0;}return dbH[_0x97bb('0x86')][_0x97bb('0x36')](_0x4d672b[_0x97bb('0x87')](),{'type':dbH['sequelize'][_0x97bb('0x88')]['SELECT']});})[_0x97bb('0x29')](function(_0x91ed5b){return{'rows':_0x91ed5b||[],'count':_0xe9d971};});}});}exports[_0x97bb('0xa3')]=function(_0x3284b7,_0x2714fa){return runReport(_0x3284b7[_0x97bb('0x49')],_0x3284b7[_0x97bb('0x36')],_0x3284b7[_0x97bb('0x44')])['then'](respondWithResult(_0x2714fa,null))[_0x97bb('0x47')](handleError(_0x2714fa,null));};exports[_0x97bb('0xa4')]=runReport;exports[_0x97bb('0x36')]=function(_0x424dee,_0x3a4557){var _0x1ba653=0xa;var _0x4c8ac7=[_0x97bb('0x8a'),_0x97bb('0x56'),_0x97bb('0x57'),_0x97bb('0x58')];var _0x41a4a0={'SUM':_0x97bb('0x59'),'COUNT':_0x97bb('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x97bb('0x5c'),'MIN':_0x97bb('0xa5'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x97bb('0x8b'),'GROUP_CONCAT ASC':_0x97bb('0x5e'),'GROUP_CONCAT DESC':_0x97bb('0x8c')};var _0x5aca94={'SEC_TO_TIME':_0x97bb('0x5f'),'DATE':_0x97bb('0x60'),'HOUR':_0x97bb('0x61'),'ROUND':_0x97bb('0x62'),'UNIX_TIMESTAMP':_0x97bb('0x63')};var _0x26a318=function(_0x3fb0f0){return!_[_0x97bb('0x7d')](['IS\x20NULL',_0x97bb('0xa6'),_0x97bb('0x65'),_0x97bb('0x66')],_0x3fb0f0);};var _0x2813d4=function(_0x414620){if(!_0x414620||!_0x414620[_0x97bb('0x67')][_0x97bb('0x3c')]){return'';}for(var _0x19c77e='(',_0x170940=0x0;_0x170940<_0x414620[_0x97bb('0x67')]['length'];_0x170940+=0x1){_0x170940>0x0&&(_0x19c77e+='\x20'+_0x414620[_0x97bb('0x8d')]+'\x20');_0x19c77e+=_0x414620[_0x97bb('0x67')][_0x170940][_0x97bb('0x68')]?_0x2813d4(_0x414620[_0x97bb('0x67')][_0x170940][_0x97bb('0x68')]):_0x414620[_0x97bb('0x67')][_0x170940][_0x97bb('0x69')]+'\x20'+_0x414620[_0x97bb('0x67')][_0x170940][_0x97bb('0x6a')]+(_0x26a318(_0x414620['rules'][_0x170940][_0x97bb('0x6a')])?'\x20'+_0x414620[_0x97bb('0x67')][_0x170940]['value']:'');}return _0x19c77e+')';};var _0x5081ce={'where':{'id':_0x424dee[_0x97bb('0x49')]['id']}},_0x3870a7,_0x3ab834,_0x2fcd32,_0x585075,_0x50b498;_0x5081ce=_['merge']({},_0x5081ce,_0x424dee[_0x97bb('0x44')]);return db[_0x97bb('0x32')]['find'](_0x5081ce)[_0x97bb('0x29')](function(_0x10567b){if(_0x10567b){_0x3870a7=_0x10567b;return _0x10567b[_0x97bb('0x6c')]();}return null;})[_0x97bb('0x29')](function(_0x3a7621){if(_0x3a7621){if(!_0x3a7621['length']){throw new db[(_0x97bb('0x8e'))][(_0x97bb('0x6d'))](_0x97bb('0x6e'),0x193);}_0x3ab834=_0x3a7621;return db[_0x97bb('0x6f')][_0x97bb('0x70')]({'raw':!![]});}return null;})[_0x97bb('0x29')](function(_0x3373f8){if(_0x3373f8){_0x2fcd32=_['keyBy'](_0x3373f8,'id');var _0x539110;var _0x14f187=squel[_0x97bb('0x72')]();_0x14f187[_0x97bb('0x73')](_0x3870a7[_0x97bb('0x81')]);for(var _0x226515=0x0;_0x226515<_0x3ab834['length'];_0x226515+=0x1){_0x539110=_0x3ab834[_0x226515]['MetricId']?_0x2fcd32[_0x3ab834[_0x226515][_0x97bb('0x74')]]['metric']:_0x3ab834[_0x226515][_0x97bb('0x69')];_0x539110=_0x3ab834[_0x226515][_0x97bb('0x76')]?_[_0x97bb('0x77')](_0x41a4a0[_0x3ab834[_0x226515][_0x97bb('0x76')]],'%s',_0x539110):_0x539110;_0x539110=_0x3ab834[_0x226515][_0x97bb('0x78')]?_[_0x97bb('0x77')](_0x5aca94[_0x3ab834[_0x226515][_0x97bb('0x78')]],'%s',_0x539110):_0x539110;if(_0x3ab834[_0x226515][_0x97bb('0x79')]){_0x14f187['group'](_0x539110);}_0x3ab834[_0x226515][_0x97bb('0x7a')]&&_0x14f187[_0x97bb('0x3e')](_0x539110,_0x3ab834[_0x226515][_0x97bb('0x7a')]===_0x97bb('0x8f')?![]:!![]);_0x14f187[_0x97bb('0x69')](_0x539110,_0x3ab834[_0x226515][_0x97bb('0x7b')]||_0x539110);}if(_0x3870a7[_0x97bb('0x7c')]){_0x3870a7[_0x97bb('0x7c')]=JSON['parse'](_0x3870a7[_0x97bb('0x7c')]);for(var _0x244a4f=0x0;_0x244a4f<_0x3870a7[_0x97bb('0x7c')][_0x97bb('0x3c')];_0x244a4f+=0x1){if(_0x3870a7['joins'][_0x244a4f][_0x97bb('0x34')]&&_[_0x97bb('0x7d')](_0x4c8ac7,_0x3870a7['joins'][_0x244a4f][_0x97bb('0x34')])&&_0x3870a7[_0x97bb('0x7c')][_0x244a4f][_0x97bb('0x90')]&&_0x3870a7['joins'][_0x244a4f]['foreignTable']&&_0x3870a7[_0x97bb('0x7c')][_0x244a4f][_0x97bb('0x7e')]){_0x14f187[_0x3870a7[_0x97bb('0x7c')][_0x244a4f]['type']](_0x3870a7[_0x97bb('0x7c')][_0x244a4f][_0x97bb('0x7f')],null,util[_0x97bb('0x78')](_0x97bb('0x80'),_0x3870a7['table'],_0x3870a7[_0x97bb('0x7c')][_0x244a4f]['parentKey'],_0x3870a7[_0x97bb('0x7c')][_0x244a4f][_0x97bb('0x7f')],_0x3870a7[_0x97bb('0x7c')][_0x244a4f][_0x97bb('0x7e')]));}}}if(_0x3870a7[_0x97bb('0x82')]){_0x3870a7[_0x97bb('0x82')]=JSON['parse'](_0x3870a7[_0x97bb('0x82')]);_0x14f187[_0x97bb('0x40')](_0x2813d4(_0x3870a7[_0x97bb('0x82')][_0x97bb('0x68')]));}_0x50b498=_0x14f187[_0x97bb('0x84')]();_0x14f187[_0x97bb('0x21')](_0x1ba653);_0x14f187[_0x97bb('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x14f187[_0x97bb('0x87')]());return dbH[_0x97bb('0x86')][_0x97bb('0x36')](_0x14f187[_0x97bb('0x87')](),{'type':dbH[_0x97bb('0x86')]['QueryTypes'][_0x97bb('0x89')]});}})['then'](function(){return{'sql':_0x50b498['toString']()};})[_0x97bb('0x29')](respondWithResult(_0x3a4557,null))[_0x97bb('0x47')](handleError(_0x3a4557,null));}; \ No newline at end of file +var _0xd7a5=['show','params','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','rules','group','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','value','ValidationErrorItem','AnalyticMetric','keyBy','output','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','condition','%s.%s\x20=\x20%s.%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','include','findAll','rows'];(function(_0x2fcf3d,_0x21ea27){var _0x4834c3=function(_0x3bb741){while(--_0x3bb741){_0x2fcf3d['push'](_0x2fcf3d['shift']());}};_0x4834c3(++_0x21ea27);}(_0xd7a5,0x1ad));var _0x5d7a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd7a5[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x5d7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d7a('0x1'));var jsonpatch=require(_0x5d7a('0x2'));var rp=require('request-promise');var moment=require(_0x5d7a('0x3'));var BPromise=require(_0x5d7a('0x4'));var Mustache=require(_0x5d7a('0x5'));var util=require(_0x5d7a('0x6'));var path=require(_0x5d7a('0x7'));var sox=require(_0x5d7a('0x8'));var csv=require(_0x5d7a('0x9'));var ejs=require(_0x5d7a('0xa'));var fs=require('fs');var fs_extra=require(_0x5d7a('0xb'));var _=require(_0x5d7a('0xc'));var squel=require('squel');var crypto=require(_0x5d7a('0xd'));var jsforce=require(_0x5d7a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d7a('0x9'));var querystring=require(_0x5d7a('0xf'));var Papa=require(_0x5d7a('0x10'));var Redis=require(_0x5d7a('0x11'));var authService=require(_0x5d7a('0x12'));var qs=require(_0x5d7a('0x13'));var as=require(_0x5d7a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d7a('0x15'))(_0x5d7a('0x16'));var utils=require(_0x5d7a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5d7a('0x18'))['db'];var dbH=require(_0x5d7a('0x18'))[_0x5d7a('0x19')];function respondWithStatusCode(_0x29ddd4,_0x3fef30){_0x3fef30=_0x3fef30||0xcc;return function(_0x1e6a5a){if(_0x1e6a5a){return _0x29ddd4[_0x5d7a('0x1a')](_0x3fef30);}return _0x29ddd4[_0x5d7a('0x1b')](_0x3fef30)[_0x5d7a('0x1c')]();};}function respondWithResult(_0x287f0b,_0x59eeb8){_0x59eeb8=_0x59eeb8||0xc8;return function(_0x307803){if(_0x307803){return _0x287f0b[_0x5d7a('0x1b')](_0x59eeb8)[_0x5d7a('0x1d')](_0x307803);}};}function respondWithFilteredResult(_0x4a508c,_0xa34b97){return function(_0x392943){if(_0x392943){var _0xb4b3c4=typeof _0xa34b97[_0x5d7a('0x1e')]===_0x5d7a('0x1f')&&typeof _0xa34b97[_0x5d7a('0x20')]==='undefined';var _0x5a2362=_0x392943['count'];var _0x459292=_0xb4b3c4?0x0:_0xa34b97['offset'];var _0xe19b1=_0xb4b3c4?_0x392943[_0x5d7a('0x21')]:_0xa34b97['offset']+_0xa34b97[_0x5d7a('0x20')];var _0x3f080a;if(_0xe19b1>=_0x5a2362){_0xe19b1=_0x5a2362;_0x3f080a=0xc8;}else{_0x3f080a=0xce;}_0x4a508c[_0x5d7a('0x1b')](_0x3f080a);return _0x4a508c[_0x5d7a('0x22')](_0x5d7a('0x23'),_0x459292+'-'+_0xe19b1+'/'+_0x5a2362)[_0x5d7a('0x1d')](_0x392943);}return null;};}function patchUpdates(_0x481670){return function(_0x3965af){try{jsonpatch[_0x5d7a('0x24')](_0x3965af,_0x481670,!![]);}catch(_0x1abf79){return BPromise[_0x5d7a('0x25')](_0x1abf79);}return _0x3965af[_0x5d7a('0x26')]();};}function saveUpdates(_0x10b83c,_0x1dfe7c){return function(_0x57a196){if(_0x57a196){return _0x57a196[_0x5d7a('0x27')](_0x10b83c)[_0x5d7a('0x28')](function(_0x1d6670){return _0x1d6670;});}return null;};}function removeEntity(_0x459844,_0x552c08){return function(_0x4029fc){if(_0x4029fc){return _0x4029fc['destroy']()['then'](function(){var _0x14f7db=_0x4029fc[_0x5d7a('0x29')]({'plain':!![]});var _0x586e5a='CustomReports';return db[_0x5d7a('0x2a')][_0x5d7a('0x2b')]({'where':{'type':_0x586e5a,'resourceId':_0x14f7db['id']}})[_0x5d7a('0x28')](function(){return _0x4029fc;});})[_0x5d7a('0x28')](function(){_0x459844[_0x5d7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4911,_0x2dca36){return function(_0x842a3a){if(!_0x842a3a){_0x5f4911['sendStatus'](0x194);}return _0x842a3a;};}function handleError(_0x3bfa2b,_0x1eeca4){_0x1eeca4=_0x1eeca4||0x1f4;return function(_0x4cbe9e){logger[_0x5d7a('0x2c')](_0x4cbe9e['stack']);if(_0x4cbe9e[_0x5d7a('0x2d')]){delete _0x4cbe9e[_0x5d7a('0x2d')];}_0x3bfa2b[_0x5d7a('0x1b')](_0x1eeca4)['send'](_0x4cbe9e);};}exports[_0x5d7a('0x2e')]=function(_0x402a36,_0x1b5f83){var _0x1551ad={},_0x9059ca={},_0x14c02e={'count':0x0,'rows':[]};var _0xd92ed9=_['map'](db[_0x5d7a('0x2f')][_0x5d7a('0x30')],function(_0x186321){return{'name':_0x186321[_0x5d7a('0x31')],'type':_0x186321[_0x5d7a('0x32')][_0x5d7a('0x33')]};});_0x9059ca['model']=_['map'](_0xd92ed9,_0x5d7a('0x2d'));_0x9059ca[_0x5d7a('0x34')]=_['keys'](_0x402a36[_0x5d7a('0x34')]);_0x9059ca[_0x5d7a('0x35')]=_[_0x5d7a('0x36')](_0x9059ca['model'],_0x9059ca['query']);_0x1551ad[_0x5d7a('0x37')]=_['intersection'](_0x9059ca[_0x5d7a('0x38')],qs[_0x5d7a('0x39')](_0x402a36['query'][_0x5d7a('0x39')]));_0x1551ad[_0x5d7a('0x37')]=_0x1551ad[_0x5d7a('0x37')][_0x5d7a('0x3a')]?_0x1551ad['attributes']:_0x9059ca['model'];if(!_0x402a36['query'][_0x5d7a('0x3b')](_0x5d7a('0x3c'))){_0x1551ad[_0x5d7a('0x20')]=qs[_0x5d7a('0x20')](_0x402a36['query'][_0x5d7a('0x20')]);_0x1551ad['offset']=qs[_0x5d7a('0x1e')](_0x402a36[_0x5d7a('0x34')]['offset']);}_0x1551ad[_0x5d7a('0x3d')]=qs[_0x5d7a('0x3e')](_0x402a36[_0x5d7a('0x34')][_0x5d7a('0x3e')]);_0x1551ad['where']=qs[_0x5d7a('0x35')](_[_0x5d7a('0x3f')](_0x402a36[_0x5d7a('0x34')],_0x9059ca[_0x5d7a('0x35')]),_0xd92ed9);if(_0x402a36[_0x5d7a('0x34')][_0x5d7a('0x40')]){_0x1551ad[_0x5d7a('0x41')]=_[_0x5d7a('0x42')](_0x1551ad[_0x5d7a('0x41')],{'$or':_[_0x5d7a('0x43')](_0xd92ed9,function(_0x169e08){if(_0x169e08['type']!=='VIRTUAL'){var _0x34179e={};_0x34179e[_0x169e08[_0x5d7a('0x2d')]]={'$like':'%'+_0x402a36['query'][_0x5d7a('0x40')]+'%'};return _0x34179e;}})});}_0x1551ad=_[_0x5d7a('0x42')]({},_0x1551ad,_0x402a36[_0x5d7a('0x44')]);var _0x5ea56c={'where':_0x1551ad[_0x5d7a('0x41')]};return db[_0x5d7a('0x2f')][_0x5d7a('0x21')](_0x5ea56c)[_0x5d7a('0x28')](function(_0x550986){_0x14c02e[_0x5d7a('0x21')]=_0x550986;if(_0x402a36[_0x5d7a('0x34')]['includeAll']){_0x1551ad[_0x5d7a('0x45')]=[{'all':!![]}];}return db[_0x5d7a('0x2f')][_0x5d7a('0x46')](_0x1551ad);})['then'](function(_0x4e7932){_0x14c02e[_0x5d7a('0x47')]=_0x4e7932;return _0x14c02e;})[_0x5d7a('0x28')](respondWithFilteredResult(_0x1b5f83,_0x1551ad))['catch'](handleError(_0x1b5f83,null));};exports[_0x5d7a('0x48')]=function(_0x280641,_0x5e0fd1){var _0x228310={'raw':![],'where':{'id':_0x280641[_0x5d7a('0x49')]['id']}},_0x247b8b={};_0x247b8b[_0x5d7a('0x38')]=_[_0x5d7a('0x4a')](db[_0x5d7a('0x2f')][_0x5d7a('0x30')]);_0x247b8b[_0x5d7a('0x34')]=_[_0x5d7a('0x4a')](_0x280641[_0x5d7a('0x34')]);_0x247b8b['filters']=_[_0x5d7a('0x36')](_0x247b8b['model'],_0x247b8b[_0x5d7a('0x34')]);_0x228310[_0x5d7a('0x37')]=_[_0x5d7a('0x36')](_0x247b8b[_0x5d7a('0x38')],qs[_0x5d7a('0x39')](_0x280641[_0x5d7a('0x34')][_0x5d7a('0x39')]));_0x228310['attributes']=_0x228310[_0x5d7a('0x37')]['length']?_0x228310[_0x5d7a('0x37')]:_0x247b8b[_0x5d7a('0x38')];if(_0x280641[_0x5d7a('0x34')][_0x5d7a('0x4b')]){_0x228310['include']=[{'all':!![]}];}_0x228310=_[_0x5d7a('0x42')]({},_0x228310,_0x280641[_0x5d7a('0x44')]);return db[_0x5d7a('0x2f')][_0x5d7a('0x4c')](_0x228310)['then'](handleEntityNotFound(_0x5e0fd1,null))[_0x5d7a('0x28')](respondWithResult(_0x5e0fd1,null))[_0x5d7a('0x4d')](handleError(_0x5e0fd1,null));};exports[_0x5d7a('0x4e')]=function(_0x293622,_0x3d3040){return db[_0x5d7a('0x2f')]['create'](_0x293622[_0x5d7a('0x4f')],{})[_0x5d7a('0x28')](function(_0x3821ed){var _0x22da5e=_0x293622[_0x5d7a('0x50')]['get']({'plain':!![]});if(!_0x22da5e)throw new Error(_0x5d7a('0x51'));if(_0x22da5e[_0x5d7a('0x52')]===_0x5d7a('0x50')){var _0x527dd5=_0x3821ed[_0x5d7a('0x29')]({'plain':!![]});var _0x592312='Reports';return db[_0x5d7a('0x53')][_0x5d7a('0x4c')]({'where':{'name':_0x592312,'userProfileId':_0x22da5e[_0x5d7a('0x54')]},'raw':!![]})['then'](function(_0x2ab139){if(_0x2ab139&&_0x2ab139[_0x5d7a('0x55')]===0x0){return db['UserProfileResource'][_0x5d7a('0x4e')]({'name':_0x527dd5[_0x5d7a('0x2d')],'resourceId':_0x527dd5['id'],'type':'CustomReports','sectionId':_0x2ab139['id']},{})['then'](function(){return _0x3821ed;});}else{return _0x3821ed;}})['catch'](function(_0x465d8c){logger[_0x5d7a('0x2c')](_0x5d7a('0x56'),_0x465d8c);throw _0x465d8c;});}return _0x3821ed;})[_0x5d7a('0x28')](respondWithResult(_0x3d3040,0xc9))[_0x5d7a('0x4d')](handleError(_0x3d3040,null));};exports[_0x5d7a('0x27')]=function(_0x227a98,_0xff0892){if(_0x227a98[_0x5d7a('0x4f')]['id']){delete _0x227a98[_0x5d7a('0x4f')]['id'];}return db['AnalyticCustomReport'][_0x5d7a('0x4c')]({'where':{'id':_0x227a98[_0x5d7a('0x49')]['id']}})[_0x5d7a('0x28')](handleEntityNotFound(_0xff0892,null))[_0x5d7a('0x28')](saveUpdates(_0x227a98[_0x5d7a('0x4f')],null))[_0x5d7a('0x28')](respondWithResult(_0xff0892,null))[_0x5d7a('0x4d')](handleError(_0xff0892,null));};exports[_0x5d7a('0x2b')]=function(_0x3104ba,_0x5df0c0){return db[_0x5d7a('0x2f')][_0x5d7a('0x4c')]({'where':{'id':_0x3104ba[_0x5d7a('0x49')]['id']}})[_0x5d7a('0x28')](handleEntityNotFound(_0x5df0c0,null))[_0x5d7a('0x28')](removeEntity(_0x5df0c0,null))[_0x5d7a('0x4d')](handleError(_0x5df0c0,null));};exports['preview']=function(_0x5173e6,_0x5bf2da){var _0x539377=0xa;var _0x2ea408=[_0x5d7a('0x57'),_0x5d7a('0x58'),_0x5d7a('0x59'),'cross_join'];var _0x2981bd={'SUM':_0x5d7a('0x5a'),'COUNT':_0x5d7a('0x5b'),'COUNT DISTINCT':_0x5d7a('0x5c'),'MAX':'MAX(%s)','MIN':_0x5d7a('0x5d'),'AVG':_0x5d7a('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x40e815={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5d7a('0x5f'),'HOUR':_0x5d7a('0x60'),'ROUND':_0x5d7a('0x61'),'UNIX_TIMESTAMP':_0x5d7a('0x62')};var _0x1d73ac=function(_0x3a1775){return!_['includes']([_0x5d7a('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3a1775);};var _0xf91f7a=function(_0x57af10){if(!_0x57af10||!_0x57af10[_0x5d7a('0x64')][_0x5d7a('0x3a')]){return'';}for(var _0x534ef9='(',_0x40e9ef=0x0;_0x40e9ef<_0x57af10[_0x5d7a('0x64')][_0x5d7a('0x3a')];_0x40e9ef+=0x1){_0x40e9ef>0x0&&(_0x534ef9+='\x20'+_0x57af10['operator']+'\x20');_0x534ef9+=_0x57af10[_0x5d7a('0x64')][_0x40e9ef][_0x5d7a('0x65')]?_0xf91f7a(_0x57af10[_0x5d7a('0x64')][_0x40e9ef][_0x5d7a('0x65')]):_0x57af10[_0x5d7a('0x64')][_0x40e9ef]['field']+'\x20'+_0x57af10[_0x5d7a('0x64')][_0x40e9ef]['condition']+(_0x1d73ac(_0x57af10[_0x5d7a('0x64')][_0x40e9ef]['condition'])?'\x20'+_0x57af10[_0x5d7a('0x64')][_0x40e9ef]['value']:'');}return _0x534ef9+')';};var _0x2fc89a={'where':{'id':_0x5173e6[_0x5d7a('0x49')]['id']}},_0xec9e8c,_0x4ab95e,_0x3d7165,_0x54976d,_0x436d86;_0x2fc89a=_[_0x5d7a('0x42')]({},_0x2fc89a,_0x5173e6[_0x5d7a('0x44')]);return db[_0x5d7a('0x2f')][_0x5d7a('0x4c')](_0x2fc89a)[_0x5d7a('0x28')](function(_0x2ea609){if(_0x2ea609){_0xec9e8c=_0x2ea609;return _0x2ea609[_0x5d7a('0x66')]();}return null;})[_0x5d7a('0x28')](function(_0x562dbf){if(_0x562dbf){if(!_0x562dbf[_0x5d7a('0x3a')]){throw new db[(_0x5d7a('0x67'))]['ValidationErrorItem'](_0x5d7a('0x68'),0x193);}_0x4ab95e=_0x562dbf;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x2ef81c){if(_0x2ef81c){_0x3d7165=_['keyBy'](_0x2ef81c,'id');var _0x514353;var _0x42524d=squel[_0x5d7a('0x69')]();_0x42524d[_0x5d7a('0x6a')](_0xec9e8c[_0x5d7a('0x6b')]);for(var _0x4f22bb=0x0;_0x4f22bb<_0x4ab95e[_0x5d7a('0x3a')];_0x4f22bb+=0x1){_0x514353=_0x4ab95e[_0x4f22bb][_0x5d7a('0x6c')]?_0x3d7165[_0x4ab95e[_0x4f22bb][_0x5d7a('0x6c')]][_0x5d7a('0x6d')]:_0x4ab95e[_0x4f22bb][_0x5d7a('0x6e')];_0x514353=_0x4ab95e[_0x4f22bb][_0x5d7a('0x6f')]?_[_0x5d7a('0x70')](_0x2981bd[_0x4ab95e[_0x4f22bb][_0x5d7a('0x6f')]],'%s',_0x514353):_0x514353;_0x514353=_0x4ab95e[_0x4f22bb][_0x5d7a('0x71')]?_[_0x5d7a('0x70')](_0x40e815[_0x4ab95e[_0x4f22bb][_0x5d7a('0x71')]],'%s',_0x514353):_0x514353;if(_0x4ab95e[_0x4f22bb][_0x5d7a('0x72')]){_0x42524d['group'](_0x514353);}_0x4ab95e[_0x4f22bb][_0x5d7a('0x73')]&&_0x42524d[_0x5d7a('0x3d')](_0x514353,_0x4ab95e[_0x4f22bb][_0x5d7a('0x73')]==='DESC'?![]:!![]);_0x42524d['field'](_0x514353,_0x4ab95e[_0x4f22bb][_0x5d7a('0x74')]||_0x514353);}if(_0xec9e8c[_0x5d7a('0x75')]){_0xec9e8c[_0x5d7a('0x75')]=JSON[_0x5d7a('0x76')](_0xec9e8c[_0x5d7a('0x75')]);for(var _0x101fb3=0x0;_0x101fb3<_0xec9e8c[_0x5d7a('0x75')]['length'];_0x101fb3+=0x1){if(_0xec9e8c['joins'][_0x101fb3][_0x5d7a('0x32')]&&_['includes'](_0x2ea408,_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x32')])&&_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x77')]&&_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x78')]&&_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x79')]){_0x42524d[_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x32')]](_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x78')],null,util[_0x5d7a('0x71')]('%s.%s\x20=\x20%s.%s',_0xec9e8c[_0x5d7a('0x6b')],_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x77')],_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x78')],_0xec9e8c[_0x5d7a('0x75')][_0x101fb3][_0x5d7a('0x79')]));}}}if(_0xec9e8c[_0x5d7a('0x7a')]){_0xec9e8c[_0x5d7a('0x7a')]=JSON[_0x5d7a('0x76')](_0xec9e8c[_0x5d7a('0x7a')]);_0x42524d['where'](_0xf91f7a(_0xec9e8c[_0x5d7a('0x7a')][_0x5d7a('0x65')]));}_0x436d86=_0x42524d[_0x5d7a('0x7b')]();_0x42524d[_0x5d7a('0x20')](_0x539377);_0x42524d[_0x5d7a('0x1e')](0x0);logger[_0x5d7a('0x7c')](_0x5d7a('0x7d'),_0x42524d[_0x5d7a('0x7e')]());return dbH[_0x5d7a('0x7f')]['query'](_0x42524d[_0x5d7a('0x7e')](),{'type':dbH[_0x5d7a('0x7f')][_0x5d7a('0x80')][_0x5d7a('0x81')]});}})[_0x5d7a('0x28')](respondWithResult(_0x5bf2da,null))[_0x5d7a('0x4d')](handleError(_0x5bf2da,null));};function runReport(_0x10b68b,_0x5c4c13,_0x23e9d1){var _0x35016b=_0x5c4c13[_0x5d7a('0x2d')];var _0x49583f=0xa;var _0x2b2ab8=['join',_0x5d7a('0x58'),_0x5d7a('0x59'),_0x5d7a('0x82')];var _0x4f51ce={'SUM':_0x5d7a('0x5a'),'COUNT':_0x5d7a('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d7a('0x83'),'MIN':_0x5d7a('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5d7a('0x84'),'GROUP_CONCAT ASC':_0x5d7a('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x529bf2={'SEC_TO_TIME':_0x5d7a('0x86'),'DATE':_0x5d7a('0x5f'),'HOUR':_0x5d7a('0x60'),'ROUND':_0x5d7a('0x61'),'UNIX_TIMESTAMP':_0x5d7a('0x62')};var _0x1b8e41=function(_0x36b1e9){return!_[_0x5d7a('0x87')]([_0x5d7a('0x63'),_0x5d7a('0x88'),_0x5d7a('0x89'),_0x5d7a('0x8a')],_0x36b1e9);};var _0x2ffb5c=function(_0x456f85){if(!_0x456f85||!_0x456f85['rules'][_0x5d7a('0x3a')]){return'';}for(var _0x3aaded='(',_0x1f9d1c=0x0;_0x1f9d1c<_0x456f85[_0x5d7a('0x64')][_0x5d7a('0x3a')];_0x1f9d1c+=0x1){_0x1f9d1c>0x0&&(_0x3aaded+='\x20'+_0x456f85[_0x5d7a('0x8b')]+'\x20');_0x3aaded+=_0x456f85['rules'][_0x1f9d1c][_0x5d7a('0x65')]?_0x2ffb5c(_0x456f85[_0x5d7a('0x64')][_0x1f9d1c][_0x5d7a('0x65')]):_0x456f85[_0x5d7a('0x64')][_0x1f9d1c][_0x5d7a('0x6e')]+'\x20'+_0x456f85[_0x5d7a('0x64')][_0x1f9d1c]['condition']+(_0x1b8e41(_0x456f85[_0x5d7a('0x64')][_0x1f9d1c]['condition'])?'\x20'+_0x456f85[_0x5d7a('0x64')][_0x1f9d1c][_0x5d7a('0x8c')]:'');}return _0x3aaded+')';};var _0x1d9b19={'where':{'id':_0x10b68b['id']}},_0x3ac02c,_0x3635c6,_0x2019b2,_0xe3a563,_0x2cddb4;_0x1d9b19=_[_0x5d7a('0x42')]({},_0x1d9b19,_0x23e9d1);return db[_0x5d7a('0x2f')][_0x5d7a('0x4c')](_0x1d9b19)[_0x5d7a('0x28')](function(_0x258a7d){if(_0x258a7d){_0x3ac02c=_0x258a7d;return _0x258a7d[_0x5d7a('0x66')]();}return null;})[_0x5d7a('0x28')](function(_0x186545){if(_0x186545){if(!_0x186545['length']){throw new db[(_0x5d7a('0x67'))][(_0x5d7a('0x8d'))](_0x5d7a('0x68'),0x193);}_0x3635c6=_0x186545;return db[_0x5d7a('0x8e')][_0x5d7a('0x46')]({'raw':!![]});}return null;})['then'](function(_0x371d69){if(_0x371d69){_0x2019b2=_[_0x5d7a('0x8f')](_0x371d69,'id');var _0x5c6447;var _0x10ba5b=squel[_0x5d7a('0x69')]();_0x10ba5b[_0x5d7a('0x6a')](_0x3ac02c['table']);for(var _0x30faf8=0x0;_0x30faf8<_0x3635c6[_0x5d7a('0x3a')];_0x30faf8+=0x1){_0x5c6447=_0x3635c6[_0x30faf8][_0x5d7a('0x6c')]?_0x2019b2[_0x3635c6[_0x30faf8][_0x5d7a('0x6c')]]['metric']:_0x3635c6[_0x30faf8][_0x5d7a('0x6e')];_0x5c6447=_0x3635c6[_0x30faf8]['function']?_[_0x5d7a('0x70')](_0x4f51ce[_0x3635c6[_0x30faf8][_0x5d7a('0x6f')]],'%s',_0x5c6447):_0x5c6447;_0x5c6447=_0x3635c6[_0x30faf8][_0x5d7a('0x71')]?_['replace'](_0x529bf2[_0x3635c6[_0x30faf8][_0x5d7a('0x71')]],'%s',_0x5c6447):_0x5c6447;if(_0x3635c6[_0x30faf8][_0x5d7a('0x72')]){_0x10ba5b[_0x5d7a('0x65')](_0x5c6447);}_0x3635c6[_0x30faf8][_0x5d7a('0x73')]&&_0x10ba5b[_0x5d7a('0x3d')](_0x5c6447,_0x3635c6[_0x30faf8]['orderBy']==='DESC'?![]:!![]);_0x10ba5b[_0x5d7a('0x6e')](_0x5c6447,_0x3635c6[_0x30faf8][_0x5d7a('0x74')]||_0x5c6447);}if(_0x3ac02c[_0x5d7a('0x75')]){_0x3ac02c[_0x5d7a('0x75')]=JSON[_0x5d7a('0x76')](_0x3ac02c['joins']);for(var _0x45fcdc=0x0;_0x45fcdc<_0x3ac02c[_0x5d7a('0x75')][_0x5d7a('0x3a')];_0x45fcdc+=0x1){if(_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x32')]&&_[_0x5d7a('0x87')](_0x2b2ab8,_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x32')])&&_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc]['parentKey']&&_0x3ac02c['joins'][_0x45fcdc][_0x5d7a('0x78')]&&_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x79')]){_0x10ba5b[_0x3ac02c['joins'][_0x45fcdc][_0x5d7a('0x32')]](_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x78')],null,util[_0x5d7a('0x71')]('%s.%s\x20=\x20%s.%s',_0x3ac02c[_0x5d7a('0x6b')],_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x77')],_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x78')],_0x3ac02c[_0x5d7a('0x75')][_0x45fcdc][_0x5d7a('0x79')]));}}}if(_0x3ac02c['conditions']){_0x3ac02c[_0x5d7a('0x7a')]=JSON[_0x5d7a('0x76')](_0x3ac02c[_0x5d7a('0x7a')]);_0x10ba5b[_0x5d7a('0x41')](_0x2ffb5c(_0x3ac02c[_0x5d7a('0x7a')][_0x5d7a('0x65')]));}_0x2cddb4=_0x10ba5b[_0x5d7a('0x7b')]();_0x10ba5b[_0x5d7a('0x20')](_0x49583f);_0x10ba5b[_0x5d7a('0x1e')](0x0);return;}})['then'](function(){if(_0x5c4c13[_0x5d7a('0x90')]==='web'){return null;}var _0x16e322=_['merge'](_0x5c4c13,{'name':_0x5c4c13[_0x5d7a('0x91')]||_0x5c4c13[_0x5d7a('0x2d')]||_0x3ac02c[_0x5d7a('0x2d')],'basename':_0x35016b,'savename':util[_0x5d7a('0x71')]('%s-%s.%s',_0x5c4c13[_0x5d7a('0x2d')]||_0x3ac02c[_0x5d7a('0x2d')],require('randomstring')[_0x5d7a('0x92')](0x4),_0x5c4c13[_0x5d7a('0x90')]||_0x5d7a('0x93')),'reportId':_0x3ac02c['id'],'reportType':_0x5d7a('0x94')});return db[_0x5d7a('0x95')][_0x5d7a('0x4e')](_0x16e322,{'raw':!![]});})['then'](function(_0x1bac66){if(_0x3ac02c[_0x5d7a('0x6b')]===_0x5d7a('0x96')){_0x2cddb4['where'](_0x3ac02c[_0x5d7a('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5c4c13[_0x5d7a('0x97')],_0x5c4c13[_0x5d7a('0x98')]);}else{_0x2cddb4[_0x5d7a('0x41')](_0x3ac02c['table']+_0x5d7a('0x99'),_0x5c4c13[_0x5d7a('0x97')],_0x5c4c13[_0x5d7a('0x98')]);}if(_0x1bac66){logger[_0x5d7a('0x9a')](_0x5d7a('0x9b'),_0x2cddb4['toString']());require('child_process')[_0x5d7a('0x9c')](path['join'](__dirname,_0x5d7a('0x9d'),_0x1bac66[_0x5d7a('0x90')]),[_0x1bac66['id'],_0x2cddb4[_0x5d7a('0x7e')](),path[_0x5d7a('0x57')](__dirname,_0x5d7a('0x9e'),_0x1bac66[_0x5d7a('0x9f')]),_0x35016b]);return _0x1bac66;}else{var _0x4aedca=squel[_0x5d7a('0x69')]();_0x4aedca['from']('('+_0x2cddb4[_0x5d7a('0x7e')]()+')',_0x5d7a('0xa0'));_0x4aedca[_0x5d7a('0x6e')](_0x5d7a('0xa1'),_0x5d7a('0x21'));_0x2cddb4[_0x5d7a('0x20')](_0x5c4c13[_0x5d7a('0x20')]||_0x49583f);_0x2cddb4[_0x5d7a('0x1e')](_0x5c4c13['offset']||0x0);return dbH['sequelize'][_0x5d7a('0x34')](_0x4aedca['toString'](),{'type':dbH[_0x5d7a('0x7f')]['QueryTypes']['SELECT']})[_0x5d7a('0x28')](function(_0x574d6b){if(!_0x574d6b['length']){_0xe3a563=0x0;}else{_0xe3a563=_0x574d6b[0x0]['count']||0x0;}return dbH[_0x5d7a('0x7f')][_0x5d7a('0x34')](_0x2cddb4[_0x5d7a('0x7e')](),{'type':dbH[_0x5d7a('0x7f')][_0x5d7a('0x80')][_0x5d7a('0x81')]});})['then'](function(_0x2d8402){return{'rows':_0x2d8402||[],'count':_0xe3a563};});}});}exports[_0x5d7a('0xa2')]=function(_0x260601,_0x26539b){return runReport(_0x260601[_0x5d7a('0x49')],_0x260601[_0x5d7a('0x34')],_0x260601[_0x5d7a('0x44')])[_0x5d7a('0x28')](respondWithResult(_0x26539b,null))[_0x5d7a('0x4d')](handleError(_0x26539b,null));};exports[_0x5d7a('0xa3')]=runReport;exports[_0x5d7a('0x34')]=function(_0x4179c1,_0x1e4921){var _0x18239b=0xa;var _0xe168c9=['join','left_join',_0x5d7a('0x59'),'cross_join'];var _0x4ab8c0={'SUM':_0x5d7a('0x5a'),'COUNT':_0x5d7a('0x5b'),'COUNT DISTINCT':_0x5d7a('0x5c'),'MAX':_0x5d7a('0x83'),'MIN':_0x5d7a('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5d7a('0x84'),'GROUP_CONCAT ASC':_0x5d7a('0x85'),'GROUP_CONCAT DESC':_0x5d7a('0xa4')};var _0x146f88={'SEC_TO_TIME':_0x5d7a('0x86'),'DATE':_0x5d7a('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5d7a('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf3acd9=function(_0x47bac0){return!_[_0x5d7a('0x87')]([_0x5d7a('0x63'),_0x5d7a('0x88'),_0x5d7a('0x89'),_0x5d7a('0x8a')],_0x47bac0);};var _0x2a0a8f=function(_0x51e907){if(!_0x51e907||!_0x51e907[_0x5d7a('0x64')][_0x5d7a('0x3a')]){return'';}for(var _0x39aec3='(',_0x2d466c=0x0;_0x2d466c<_0x51e907['rules'][_0x5d7a('0x3a')];_0x2d466c+=0x1){_0x2d466c>0x0&&(_0x39aec3+='\x20'+_0x51e907[_0x5d7a('0x8b')]+'\x20');_0x39aec3+=_0x51e907[_0x5d7a('0x64')][_0x2d466c][_0x5d7a('0x65')]?_0x2a0a8f(_0x51e907[_0x5d7a('0x64')][_0x2d466c][_0x5d7a('0x65')]):_0x51e907['rules'][_0x2d466c]['field']+'\x20'+_0x51e907[_0x5d7a('0x64')][_0x2d466c]['condition']+(_0xf3acd9(_0x51e907[_0x5d7a('0x64')][_0x2d466c][_0x5d7a('0xa5')])?'\x20'+_0x51e907[_0x5d7a('0x64')][_0x2d466c][_0x5d7a('0x8c')]:'');}return _0x39aec3+')';};var _0x32b54f={'where':{'id':_0x4179c1['params']['id']}},_0x431a23,_0x462456,_0x2db95e,_0x37fc56,_0x5a9a60;_0x32b54f=_[_0x5d7a('0x42')]({},_0x32b54f,_0x4179c1['options']);return db[_0x5d7a('0x2f')][_0x5d7a('0x4c')](_0x32b54f)[_0x5d7a('0x28')](function(_0x5b4ef3){if(_0x5b4ef3){_0x431a23=_0x5b4ef3;return _0x5b4ef3[_0x5d7a('0x66')]();}return null;})[_0x5d7a('0x28')](function(_0x4505b9){if(_0x4505b9){if(!_0x4505b9[_0x5d7a('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5d7a('0x68'),0x193);}_0x462456=_0x4505b9;return db['AnalyticMetric'][_0x5d7a('0x46')]({'raw':!![]});}return null;})[_0x5d7a('0x28')](function(_0x28833a){if(_0x28833a){_0x2db95e=_[_0x5d7a('0x8f')](_0x28833a,'id');var _0x53a62e;var _0x42ea24=squel[_0x5d7a('0x69')]();_0x42ea24[_0x5d7a('0x6a')](_0x431a23['table']);for(var _0x265bd2=0x0;_0x265bd2<_0x462456['length'];_0x265bd2+=0x1){_0x53a62e=_0x462456[_0x265bd2][_0x5d7a('0x6c')]?_0x2db95e[_0x462456[_0x265bd2][_0x5d7a('0x6c')]][_0x5d7a('0x6d')]:_0x462456[_0x265bd2][_0x5d7a('0x6e')];_0x53a62e=_0x462456[_0x265bd2][_0x5d7a('0x6f')]?_['replace'](_0x4ab8c0[_0x462456[_0x265bd2][_0x5d7a('0x6f')]],'%s',_0x53a62e):_0x53a62e;_0x53a62e=_0x462456[_0x265bd2][_0x5d7a('0x71')]?_[_0x5d7a('0x70')](_0x146f88[_0x462456[_0x265bd2][_0x5d7a('0x71')]],'%s',_0x53a62e):_0x53a62e;if(_0x462456[_0x265bd2][_0x5d7a('0x72')]){_0x42ea24[_0x5d7a('0x65')](_0x53a62e);}_0x462456[_0x265bd2][_0x5d7a('0x73')]&&_0x42ea24['order'](_0x53a62e,_0x462456[_0x265bd2]['orderBy']==='DESC'?![]:!![]);_0x42ea24[_0x5d7a('0x6e')](_0x53a62e,_0x462456[_0x265bd2]['alias']||_0x53a62e);}if(_0x431a23['joins']){_0x431a23['joins']=JSON[_0x5d7a('0x76')](_0x431a23[_0x5d7a('0x75')]);for(var _0x33b9e7=0x0;_0x33b9e7<_0x431a23['joins']['length'];_0x33b9e7+=0x1){if(_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x32')]&&_[_0x5d7a('0x87')](_0xe168c9,_0x431a23[_0x5d7a('0x75')][_0x33b9e7]['type'])&&_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x77')]&&_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x78')]&&_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x79')]){_0x42ea24[_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x32')]](_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x78')],null,util['format'](_0x5d7a('0xa6'),_0x431a23['table'],_0x431a23[_0x5d7a('0x75')][_0x33b9e7]['parentKey'],_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x78')],_0x431a23[_0x5d7a('0x75')][_0x33b9e7][_0x5d7a('0x79')]));}}}if(_0x431a23[_0x5d7a('0x7a')]){_0x431a23[_0x5d7a('0x7a')]=JSON['parse'](_0x431a23[_0x5d7a('0x7a')]);_0x42ea24[_0x5d7a('0x41')](_0x2a0a8f(_0x431a23[_0x5d7a('0x7a')][_0x5d7a('0x65')]));}_0x5a9a60=_0x42ea24[_0x5d7a('0x7b')]();_0x42ea24[_0x5d7a('0x20')](_0x18239b);_0x42ea24[_0x5d7a('0x1e')](0x0);logger[_0x5d7a('0x7c')](_0x5d7a('0x7d'),_0x42ea24[_0x5d7a('0x7e')]());return dbH['sequelize'][_0x5d7a('0x34')](_0x42ea24[_0x5d7a('0x7e')](),{'type':dbH['sequelize']['QueryTypes'][_0x5d7a('0x81')]});}})['then'](function(){return{'sql':_0x5a9a60[_0x5d7a('0x7e')]()};})['then'](respondWithResult(_0x1e4921,null))[_0x5d7a('0x4d')](handleError(_0x1e4921,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5c00118..a10b95b 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 _0xfb00=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27c5f4,_0x3bf1f5){var _0x157e82=function(_0x53a1f5){while(--_0x53a1f5){_0x27c5f4['push'](_0x27c5f4['shift']());}};_0x157e82(++_0x3bf1f5);}(_0xfb00,0x8a));var _0x0fb0=function(_0x3c8838,_0x48bb83){_0x3c8838=_0x3c8838-0x0;var _0x35ba4d=_0xfb00[_0x3c8838];return _0x35ba4d;};'use strict';var _=require('lodash');var util=require(_0x0fb0('0x0'));var logger=require(_0x0fb0('0x1'))(_0x0fb0('0x2'));var moment=require(_0x0fb0('0x3'));var BPromise=require(_0x0fb0('0x4'));var rp=require(_0x0fb0('0x5'));var fs=require('fs');var path=require(_0x0fb0('0x6'));var rimraf=require(_0x0fb0('0x7'));var config=require('../../config/environment');var attributes=require(_0x0fb0('0x8'));module[_0x0fb0('0x9')]=function(_0xd96799,_0x3ad993){return _0xd96799[_0x0fb0('0xa')](_0x0fb0('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01e0=['moment','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x01e0,0x1a1));var _0x001e=function(_0x205328,_0x12c15a){_0x205328=_0x205328-0x0;var _0x4a30eb=_0x01e0[_0x205328];return _0x4a30eb;};'use strict';var _=require(_0x001e('0x0'));var util=require(_0x001e('0x1'));var logger=require(_0x001e('0x2'))('api');var moment=require(_0x001e('0x3'));var BPromise=require('bluebird');var rp=require(_0x001e('0x4'));var fs=require('fs');var path=require(_0x001e('0x5'));var rimraf=require(_0x001e('0x6'));var config=require('../../config/environment');var attributes=require(_0x001e('0x7'));module[_0x001e('0x8')]=function(_0x48c785,_0x3541a2){return _0x48c785[_0x001e('0x9')](_0x001e('0xa'),attributes,{'tableName':_0x001e('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index bc7ef34..5316861 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 _0xb1ca=['../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e0300,_0x3f1ea5){var _0x6a4ba8=function(_0x3a818c){while(--_0x3a818c){_0x4e0300['push'](_0x4e0300['shift']());}};_0x6a4ba8(++_0x3f1ea5);}(_0xb1ca,0x94));var _0xab1c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb1ca[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xab1c('0x0'));var util=require('util');var moment=require(_0xab1c('0x1'));var BPromise=require(_0xab1c('0x2'));var rs=require(_0xab1c('0x3'));var fs=require('fs');var Redis=require(_0xab1c('0x4'));var db=require(_0xab1c('0x5'))['db'];var utils=require(_0xab1c('0x6'));var logger=require('../../config/logger')(_0xab1c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab1c('0x8'));var client=jayson[_0xab1c('0x9')][_0xab1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f4d98,_0x5d94e2,_0x1c9001){return new BPromise(function(_0x4f0cdb,_0x2597d2){return client['request'](_0x3f4d98,_0x1c9001)[_0xab1c('0xb')](function(_0x58aa71){logger[_0xab1c('0xc')](_0xab1c('0xd'),_0x5d94e2,_0xab1c('0xe'));logger[_0xab1c('0xf')](_0xab1c('0x10'),_0x5d94e2,_0xab1c('0xe'),JSON[_0xab1c('0x11')](_0x58aa71));if(_0x58aa71[_0xab1c('0x12')]){if(_0x58aa71[_0xab1c('0x12')]['code']===0x1f4){logger['error'](_0xab1c('0xd'),_0x5d94e2,_0x58aa71[_0xab1c('0x12')][_0xab1c('0x13')]);return _0x2597d2(_0x58aa71[_0xab1c('0x12')][_0xab1c('0x13')]);}logger[_0xab1c('0x12')](_0xab1c('0xd'),_0x5d94e2,_0x58aa71[_0xab1c('0x12')][_0xab1c('0x13')]);return _0x4f0cdb(_0x58aa71[_0xab1c('0x12')][_0xab1c('0x13')]);}else{logger[_0xab1c('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d94e2,'request\x20sent');_0x4f0cdb(_0x58aa71[_0xab1c('0x14')]['message']);}})[_0xab1c('0x15')](function(_0x48723f){logger[_0xab1c('0x12')](_0xab1c('0xd'),_0x5d94e2,_0x48723f);_0x2597d2(_0x48723f);});});} \ No newline at end of file +var _0xab05=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x494fa2,_0x84b5d8){var _0xf013c7=function(_0x348859){while(--_0x348859){_0x494fa2['push'](_0x494fa2['shift']());}};_0xf013c7(++_0x84b5d8);}(_0xab05,0xfe));var _0x5ab0=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xab05[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require(_0x5ab0('0x0'));var moment=require(_0x5ab0('0x1'));var BPromise=require(_0x5ab0('0x2'));var rs=require(_0x5ab0('0x3'));var fs=require('fs');var Redis=require(_0x5ab0('0x4'));var db=require(_0x5ab0('0x5'))['db'];var utils=require(_0x5ab0('0x6'));var logger=require(_0x5ab0('0x7'))(_0x5ab0('0x8'));var config=require(_0x5ab0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128a69,_0x2d80b8,_0x3799ec){return new BPromise(function(_0x4e0e61,_0x270220){return client[_0x5ab0('0xb')](_0x128a69,_0x3799ec)[_0x5ab0('0xc')](function(_0x5cf163){logger[_0x5ab0('0xd')](_0x5ab0('0xe'),_0x2d80b8,'request\x20sent');logger[_0x5ab0('0xf')](_0x5ab0('0x10'),_0x2d80b8,_0x5ab0('0x11'),JSON[_0x5ab0('0x12')](_0x5cf163));if(_0x5cf163['error']){if(_0x5cf163[_0x5ab0('0x13')]['code']===0x1f4){logger[_0x5ab0('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2d80b8,_0x5cf163['error'][_0x5ab0('0x14')]);return _0x270220(_0x5cf163['error'][_0x5ab0('0x14')]);}logger[_0x5ab0('0x13')](_0x5ab0('0xe'),_0x2d80b8,_0x5cf163[_0x5ab0('0x13')][_0x5ab0('0x14')]);return _0x4e0e61(_0x5cf163[_0x5ab0('0x13')][_0x5ab0('0x14')]);}else{logger[_0x5ab0('0xd')](_0x5ab0('0xe'),_0x2d80b8,_0x5ab0('0x11'));_0x4e0e61(_0x5cf163[_0x5ab0('0x15')][_0x5ab0('0x14')]);}})[_0x5ab0('0x16')](function(_0x7936c5){logger[_0x5ab0('0x13')](_0x5ab0('0xe'),_0x2d80b8,_0x7936c5);_0x270220(_0x7936c5);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d531c3c..fb18b75 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 _0x3ce3=['express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','run','/:id/query','query','post','create','put','update','destroy','util','path','connect-timeout'];(function(_0x59d949,_0x13512c){var _0x244381=function(_0x30f50e){while(--_0x30f50e){_0x59d949['push'](_0x59d949['shift']());}};_0x244381(++_0x13512c);}(_0x3ce3,0xcf));var _0x33ce=function(_0x3441bb,_0x11052c){_0x3441bb=_0x3441bb-0x0;var _0xd94568=_0x3ce3[_0x3441bb];return _0xd94568;};'use strict';var multer=require('multer');var util=require(_0x33ce('0x0'));var path=require(_0x33ce('0x1'));var timeout=require(_0x33ce('0x2'));var express=require(_0x33ce('0x3'));var router=express[_0x33ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x33ce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x33ce('0x6'));var controller=require(_0x33ce('0x7'));router[_0x33ce('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x33ce('0x9'),auth[_0x33ce('0xa')](),controller[_0x33ce('0xb')]);router['get'](_0x33ce('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0x33ce('0x8')]('/:id/run',auth[_0x33ce('0xa')](),controller[_0x33ce('0xd')]);router[_0x33ce('0x8')](_0x33ce('0xe'),auth[_0x33ce('0xa')](),controller[_0x33ce('0xf')]);router[_0x33ce('0x10')]('/',auth[_0x33ce('0xa')](),controller[_0x33ce('0x11')]);router[_0x33ce('0x12')]('/:id',auth[_0x33ce('0xa')](),controller[_0x33ce('0x13')]);router['delete'](_0x33ce('0x9'),auth[_0x33ce('0xa')](),controller[_0x33ce('0x14')]);module['exports']=router; \ No newline at end of file +var _0xe813=['/:id','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe813,0xd2));var _0x3e81=function(_0x3fd455,_0x1f7c5b){_0x3fd455=_0x3fd455-0x0;var _0x1c259f=_0xe813[_0x3fd455];return _0x1c259f;};'use strict';var multer=require(_0x3e81('0x0'));var util=require('util');var path=require(_0x3e81('0x1'));var timeout=require('connect-timeout');var express=require(_0x3e81('0x2'));var router=express[_0x3e81('0x3')]();var fs_extra=require(_0x3e81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3e81('0x5'));var config=require(_0x3e81('0x6'));var controller=require(_0x3e81('0x7'));router[_0x3e81('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e81('0x9')]);router[_0x3e81('0x8')](_0x3e81('0xa'),auth[_0x3e81('0xb')](),controller['show']);router[_0x3e81('0x8')](_0x3e81('0xc'),auth[_0x3e81('0xb')](),controller['preview']);router['get'](_0x3e81('0xd'),auth[_0x3e81('0xb')](),controller[_0x3e81('0xe')]);router[_0x3e81('0x8')](_0x3e81('0xf'),auth['isAuthenticated'](),controller[_0x3e81('0x10')]);router[_0x3e81('0x11')]('/',auth[_0x3e81('0xb')](),controller[_0x3e81('0x12')]);router['put']('/:id',auth[_0x3e81('0xb')](),controller[_0x3e81('0x13')]);router[_0x3e81('0x14')](_0x3e81('0xa'),auth[_0x3e81('0xb')](),controller[_0x3e81('0x15')]);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 a1c4931..5700bee 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0xc21e7c,_0x4a34ad){var _0x25da9b=function(_0x5a4d61){while(--_0x5a4d61){_0xc21e7c['push'](_0xc21e7c['shift']());}};_0x25da9b(++_0x4a34ad);}(_0x326f,0xd1));var _0xf326=function(_0x420673,_0x1fe8b6){_0x420673=_0x420673-0x0;var _0x2e45e9=_0x326f[_0x420673];return _0x2e45e9;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file +var _0x71ab=['TEXT','exports','STRING'];(function(_0x56344f,_0x2071f1){var _0x3b0828=function(_0x48c2a8){while(--_0x48c2a8){_0x56344f['push'](_0x56344f['shift']());}};_0x3b0828(++_0x2071f1);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4823042..a922384 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x4edd73,_0x31c9f4){var _0x60a855=function(_0x183bce){while(--_0x183bce){_0x4edd73['push'](_0x4edd73['shift']());}};_0x60a855(++_0x31c9f4);}(_0x7a54,0x106));var _0x47a5=function(_0x512196,_0xd84c4b){_0x512196=_0x512196-0x0;var _0x503e2e=_0x7a54[_0x512196];return _0x503e2e;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0xc6ac=['keyBy','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','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','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','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5261e3,_0x96f8e4){_0x5261e3=_0x5261e3-0x0;var _0x308398=_0xc6ac[_0x5261e3];return _0x308398;};'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'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ab9c5e3..2a20bd8 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 _0x4db7=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x1b91ea,_0x2be1bb){var _0x13625f=function(_0x5d1f75){while(--_0x5d1f75){_0x1b91ea['push'](_0x1b91ea['shift']());}};_0x13625f(++_0x2be1bb);}(_0x4db7,0x12d));var _0x74db=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4db7[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x74db('0x0'));var util=require(_0x74db('0x1'));var logger=require(_0x74db('0x2'))(_0x74db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74db('0x4'));var rimraf=require(_0x74db('0x5'));var config=require(_0x74db('0x6'));var attributes=require(_0x74db('0x7'));module['exports']=function(_0x48d912,_0x56563e){return _0x48d912[_0x74db('0x8')](_0x74db('0x9'),attributes,{'tableName':_0x74db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf68c=['util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x50a8ca,_0x43aa15){var _0x2ef4d4=function(_0x359a8a){while(--_0x359a8a){_0x50a8ca['push'](_0x50a8ca['shift']());}};_0x2ef4d4(++_0x43aa15);}(_0xf68c,0x107));var _0xcf68=function(_0x67a262,_0x115e6d){_0x67a262=_0x67a262-0x0;var _0x5835ff=_0xf68c[_0x67a262];return _0x5835ff;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var logger=require('../../config/logger')(_0xcf68('0x2'));var moment=require(_0xcf68('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf68('0x4'));var fs=require('fs');var path=require(_0xcf68('0x5'));var rimraf=require(_0xcf68('0x6'));var config=require(_0xcf68('0x7'));var attributes=require(_0xcf68('0x8'));module['exports']=function(_0x444052,_0x12914b){return _0x444052['define'](_0xcf68('0x9'),attributes,{'tableName':_0xcf68('0xa'),'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 fbf484d..fe87fbc 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 _0x8ce2=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x30c901,_0x119390){var _0x4d50fc=function(_0x3b0b58){while(--_0x3b0b58){_0x30c901['push'](_0x30c901['shift']());}};_0x4d50fc(++_0x119390);}(_0x8ce2,0x1a7));var _0x28ce=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8ce2[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x28ce('0x0'));var util=require(_0x28ce('0x1'));var moment=require(_0x28ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x28ce('0x3'));var fs=require('fs');var Redis=require(_0x28ce('0x4'));var db=require(_0x28ce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28ce('0x6'))(_0x28ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x28ce('0x8'));var client=jayson['client'][_0x28ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf10467,_0x32355e,_0x2904ce){return new BPromise(function(_0x155b02,_0xce727c){return client['request'](_0xf10467,_0x2904ce)[_0x28ce('0xa')](function(_0x431e0f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x32355e,_0x28ce('0xb'));logger[_0x28ce('0xc')](_0x28ce('0xd'),_0x32355e,_0x28ce('0xb'),JSON[_0x28ce('0xe')](_0x431e0f));if(_0x431e0f[_0x28ce('0xf')]){if(_0x431e0f['error'][_0x28ce('0x10')]===0x1f4){logger[_0x28ce('0xf')](_0x28ce('0x11'),_0x32355e,_0x431e0f[_0x28ce('0xf')][_0x28ce('0x12')]);return _0xce727c(_0x431e0f['error']['message']);}logger[_0x28ce('0xf')](_0x28ce('0x11'),_0x32355e,_0x431e0f[_0x28ce('0xf')][_0x28ce('0x12')]);return _0x155b02(_0x431e0f[_0x28ce('0xf')]['message']);}else{logger['info'](_0x28ce('0x11'),_0x32355e,_0x28ce('0xb'));_0x155b02(_0x431e0f[_0x28ce('0x13')]['message']);}})[_0x28ce('0x14')](function(_0x4acb0a){logger[_0x28ce('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x32355e,_0x4acb0a);_0xce727c(_0x4acb0a);});});} \ No newline at end of file +var _0x2610=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x2610,0x106));var _0x0261=function(_0x4f6faf,_0x148286){_0x4f6faf=_0x4f6faf-0x0;var _0xb9736b=_0x2610[_0x4f6faf];return _0xb9736b;};'use strict';var _=require(_0x0261('0x0'));var util=require('util');var moment=require(_0x0261('0x1'));var BPromise=require(_0x0261('0x2'));var rs=require(_0x0261('0x3'));var fs=require('fs');var Redis=require(_0x0261('0x4'));var db=require(_0x0261('0x5'))['db'];var utils=require(_0x0261('0x6'));var logger=require(_0x0261('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0261('0x8'));var client=jayson[_0x0261('0x9')][_0x0261('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5454fa,_0x568fb8,_0x46948c){return new BPromise(function(_0x6b174c,_0x1af16a){return client['request'](_0x5454fa,_0x46948c)[_0x0261('0xb')](function(_0x46ce7e){logger[_0x0261('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x568fb8,_0x0261('0xd'));logger[_0x0261('0xe')](_0x0261('0xf'),_0x568fb8,_0x0261('0xd'),JSON[_0x0261('0x10')](_0x46ce7e));if(_0x46ce7e['error']){if(_0x46ce7e[_0x0261('0x11')][_0x0261('0x12')]===0x1f4){logger[_0x0261('0x11')](_0x0261('0x13'),_0x568fb8,_0x46ce7e[_0x0261('0x11')][_0x0261('0x14')]);return _0x1af16a(_0x46ce7e[_0x0261('0x11')][_0x0261('0x14')]);}logger['error'](_0x0261('0x13'),_0x568fb8,_0x46ce7e[_0x0261('0x11')][_0x0261('0x14')]);return _0x6b174c(_0x46ce7e[_0x0261('0x11')]['message']);}else{logger[_0x0261('0xc')](_0x0261('0x13'),_0x568fb8,_0x0261('0xd'));_0x6b174c(_0x46ce7e[_0x0261('0x15')][_0x0261('0x14')]);}})[_0x0261('0x16')](function(_0x4d9b02){logger[_0x0261('0x11')](_0x0261('0x13'),_0x568fb8,_0x4d9b02);_0x1af16a(_0x4d9b02);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e782483..9e12bf9 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 _0x857d=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','show','preview','/:id/run','isAuthenticated','run','/:id/query','query','create','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x857d,0x15d));var _0xd857=function(_0x5b09b1,_0x3887e9){_0x5b09b1=_0x5b09b1-0x0;var _0xe9e254=_0x857d[_0x5b09b1];return _0xe9e254;};'use strict';var multer=require(_0xd857('0x0'));var util=require(_0xd857('0x1'));var path=require('path');var timeout=require(_0xd857('0x2'));var express=require(_0xd857('0x3'));var router=express[_0xd857('0x4')]();var fs_extra=require(_0xd857('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd857('0x6'));var config=require(_0xd857('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xd857('0x8')]('/',auth['isAuthenticated'](),controller[_0xd857('0x9')]);router[_0xd857('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd857('0xa')]);router[_0xd857('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0xd857('0xb')]);router[_0xd857('0x8')](_0xd857('0xc'),auth[_0xd857('0xd')](),controller[_0xd857('0xe')]);router[_0xd857('0x8')](_0xd857('0xf'),auth[_0xd857('0xd')](),controller[_0xd857('0x10')]);router['post']('/',auth[_0xd857('0xd')](),controller[_0xd857('0x11')]);router['put'](_0xd857('0x12'),auth[_0xd857('0xd')](),controller['update']);router[_0xd857('0x13')](_0xd857('0x12'),auth['isAuthenticated'](),controller[_0xd857('0x14')]);module[_0xd857('0x15')]=router; \ No newline at end of file +var _0x84d6=['preview','/:id/run','run','/:id/query','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x433d00,_0x118c3b){var _0x2de080=function(_0x34c71d){while(--_0x34c71d){_0x433d00['push'](_0x433d00['shift']());}};_0x2de080(++_0x118c3b);}(_0x84d6,0x180));var _0x684d=function(_0x16115d,_0x58f185){_0x16115d=_0x16115d-0x0;var _0x10d5da=_0x84d6[_0x16115d];return _0x10d5da;};'use strict';var multer=require(_0x684d('0x0'));var util=require(_0x684d('0x1'));var path=require(_0x684d('0x2'));var timeout=require(_0x684d('0x3'));var express=require(_0x684d('0x4'));var router=express[_0x684d('0x5')]();var fs_extra=require(_0x684d('0x6'));var auth=require(_0x684d('0x7'));var interaction=require(_0x684d('0x8'));var config=require(_0x684d('0x9'));var controller=require(_0x684d('0xa'));router[_0x684d('0xb')]('/',auth[_0x684d('0xc')](),controller[_0x684d('0xd')]);router['get']('/:id',auth[_0x684d('0xc')](),controller[_0x684d('0xe')]);router[_0x684d('0xb')](_0x684d('0xf'),auth[_0x684d('0xc')](),controller[_0x684d('0x10')]);router['get'](_0x684d('0x11'),auth[_0x684d('0xc')](),controller[_0x684d('0x12')]);router[_0x684d('0xb')](_0x684d('0x13'),auth[_0x684d('0xc')](),controller['query']);router['post']('/',auth[_0x684d('0xc')](),controller[_0x684d('0x14')]);router[_0x684d('0x15')]('/:id',auth[_0x684d('0xc')](),controller['update']);router[_0x684d('0x16')](_0x684d('0x17'),auth[_0x684d('0xc')](),controller[_0x684d('0x18')]);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 a5ce30f..b7a909b 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 _0x3527=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x3527,0x12c));var _0x7352=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3527[_0x79b649];return _0x1af9b1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7352('0x0'));module[_0x7352('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x7352('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x7352('0x3')](_0x7352('0x4'),_0x7352('0x5'),_0x7352('0x6')),'allowNull':![],'defaultValue':_0x7352('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x7352('0x7')]},'endDate':{'type':Sequelize[_0x7352('0x7')]},'status':{'type':Sequelize[_0x7352('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x7352('0x3')](_0x7352('0x8'),_0x7352('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x7352('0xa')](0xb)[_0x7352('0xb')]},'reportType':{'type':Sequelize[_0x7352('0x2')]}}; \ No newline at end of file +var _0x7dbe=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x135b35,_0x47d562){var _0x59d690=function(_0x4f7f35){while(--_0x4f7f35){_0x135b35['push'](_0x135b35['shift']());}};_0x59d690(++_0x47d562);}(_0x7dbe,0xc7));var _0xe7db=function(_0x32d97c,_0xd5f165){_0x32d97c=_0x32d97c-0x0;var _0x35e602=_0x7dbe[_0x32d97c];return _0x35e602;};'use strict';var Sequelize=require(_0xe7db('0x0'));var moment=require(_0xe7db('0x1'));module[_0xe7db('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xe7db('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xe7db('0x4')](_0xe7db('0x5'),_0xe7db('0x6'),_0xe7db('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xe7db('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe7db('0x8')]},'endDate':{'type':Sequelize[_0xe7db('0x8')]},'status':{'type':Sequelize[_0xe7db('0x3')],'defaultValue':_0xe7db('0x9')},'type':{'type':Sequelize[_0xe7db('0x4')](_0xe7db('0xa'),_0xe7db('0xb')),'allowNull':![],'defaultValue':_0xe7db('0xa')},'reportId':{'type':Sequelize[_0xe7db('0xc')](0xb)[_0xe7db('0xd')]},'reportType':{'type':Sequelize[_0xe7db('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f091783..96567c0 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 _0xcd59=['findAll','show','params','options','find','create','body','role','user','get','ExtractedReports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','download','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','savename','format','%s.%s','toLowerCase','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xcd59,0x7b));var _0x9cd5=function(_0x12b830,_0xd66540){_0x12b830=_0x12b830-0x0;var _0x261dc4=_0xcd59[_0x12b830];return _0x261dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cd5('0x0'));var zipdir=require(_0x9cd5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9cd5('0x2'));var BPromise=require(_0x9cd5('0x3'));var Mustache=require(_0x9cd5('0x4'));var util=require('util');var path=require(_0x9cd5('0x5'));var sox=require(_0x9cd5('0x6'));var csv=require(_0x9cd5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cd5('0x8'));var _=require(_0x9cd5('0x9'));var squel=require(_0x9cd5('0xa'));var crypto=require(_0x9cd5('0xb'));var jsforce=require(_0x9cd5('0xc'));var deskjs=require(_0x9cd5('0xd'));var toCsv=require(_0x9cd5('0x7'));var querystring=require(_0x9cd5('0xe'));var Papa=require(_0x9cd5('0xf'));var Redis=require(_0x9cd5('0x10'));var authService=require(_0x9cd5('0x11'));var qs=require(_0x9cd5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cd5('0x13'));var logger=require(_0x9cd5('0x14'))(_0x9cd5('0x15'));var utils=require(_0x9cd5('0x16'));var config=require(_0x9cd5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cd5('0x18'))['db'];function respondWithStatusCode(_0x3e0f30,_0x5378ef){_0x5378ef=_0x5378ef||0xcc;return function(_0x259472){if(_0x259472){return _0x3e0f30[_0x9cd5('0x19')](_0x5378ef);}return _0x3e0f30['status'](_0x5378ef)[_0x9cd5('0x1a')]();};}function respondWithResult(_0x286f57,_0x35a102){_0x35a102=_0x35a102||0xc8;return function(_0x4a25d2){if(_0x4a25d2){return _0x286f57[_0x9cd5('0x1b')](_0x35a102)[_0x9cd5('0x1c')](_0x4a25d2);}};}function respondWithFilteredResult(_0x4b7976,_0x5c0da3){return function(_0x182bb5){if(_0x182bb5){var _0x372ecc=typeof _0x5c0da3[_0x9cd5('0x1d')]===_0x9cd5('0x1e')&&typeof _0x5c0da3[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x4efc10=_0x182bb5['count'];var _0x3f458f=_0x372ecc?0x0:_0x5c0da3[_0x9cd5('0x1d')];var _0x5dae19=_0x372ecc?_0x182bb5[_0x9cd5('0x20')]:_0x5c0da3[_0x9cd5('0x1d')]+_0x5c0da3[_0x9cd5('0x1f')];var _0x24bc7a;if(_0x5dae19>=_0x4efc10){_0x5dae19=_0x4efc10;_0x24bc7a=0xc8;}else{_0x24bc7a=0xce;}_0x4b7976[_0x9cd5('0x1b')](_0x24bc7a);return _0x4b7976[_0x9cd5('0x21')](_0x9cd5('0x22'),_0x3f458f+'-'+_0x5dae19+'/'+_0x4efc10)[_0x9cd5('0x1c')](_0x182bb5);}return null;};}function patchUpdates(_0x4937dc){return function(_0x2681f8){try{jsonpatch[_0x9cd5('0x23')](_0x2681f8,_0x4937dc,!![]);}catch(_0x47e229){return BPromise['reject'](_0x47e229);}return _0x2681f8[_0x9cd5('0x24')]();};}function saveUpdates(_0x2511f7,_0xfbaa19){return function(_0x3d0be0){if(_0x3d0be0){return _0x3d0be0[_0x9cd5('0x25')](_0x2511f7)[_0x9cd5('0x26')](function(_0x28ed21){return _0x28ed21;});}return null;};}function removeEntity(_0x5c125f,_0x2ca470){return function(_0x4e1d0f){if(_0x4e1d0f){return _0x4e1d0f[_0x9cd5('0x27')]()[_0x9cd5('0x26')](function(){var _0x3e1bf7=_0x4e1d0f['get']({'plain':!![]});var _0x468a64='ExtractedReports';return db[_0x9cd5('0x28')][_0x9cd5('0x27')]({'where':{'type':_0x468a64,'resourceId':_0x3e1bf7['id']}})[_0x9cd5('0x26')](function(){return _0x4e1d0f;});})[_0x9cd5('0x26')](function(){_0x5c125f[_0x9cd5('0x1b')](0xcc)[_0x9cd5('0x1a')]();});}};}function handleEntityNotFound(_0x2ad283,_0xfcdce4){return function(_0x4ff0f1){if(!_0x4ff0f1){_0x2ad283[_0x9cd5('0x19')](0x194);}return _0x4ff0f1;};}function handleError(_0x4b3bbc,_0xb1a923){_0xb1a923=_0xb1a923||0x1f4;return function(_0x44bb13){logger[_0x9cd5('0x29')](_0x44bb13[_0x9cd5('0x2a')]);if(_0x44bb13[_0x9cd5('0x2b')]){delete _0x44bb13['name'];}_0x4b3bbc[_0x9cd5('0x1b')](_0xb1a923)[_0x9cd5('0x2c')](_0x44bb13);};}exports[_0x9cd5('0x2d')]=function(_0x4b043e,_0x12c76b){var _0x5d4402={},_0x305ffe={},_0x2ed04f={'count':0x0,'rows':[]};var _0x520275=_[_0x9cd5('0x2e')](db[_0x9cd5('0x2f')][_0x9cd5('0x30')],function(_0x4d9387){return{'name':_0x4d9387[_0x9cd5('0x31')],'type':_0x4d9387[_0x9cd5('0x32')]['key']};});_0x305ffe[_0x9cd5('0x33')]=_['map'](_0x520275,_0x9cd5('0x2b'));_0x305ffe[_0x9cd5('0x34')]=_[_0x9cd5('0x35')](_0x4b043e['query']);_0x305ffe[_0x9cd5('0x36')]=_[_0x9cd5('0x37')](_0x305ffe['model'],_0x305ffe[_0x9cd5('0x34')]);_0x5d4402[_0x9cd5('0x38')]=_[_0x9cd5('0x37')](_0x305ffe[_0x9cd5('0x33')],qs[_0x9cd5('0x39')](_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x39')]));_0x5d4402['attributes']=_0x5d4402['attributes'][_0x9cd5('0x3a')]?_0x5d4402[_0x9cd5('0x38')]:_0x305ffe[_0x9cd5('0x33')];if(!_0x4b043e[_0x9cd5('0x34')]['hasOwnProperty'](_0x9cd5('0x3b'))){_0x5d4402[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5d4402[_0x9cd5('0x1d')]=qs[_0x9cd5('0x1d')](_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x1d')]);}_0x5d4402[_0x9cd5('0x3c')]=qs[_0x9cd5('0x3d')](_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x3d')]);_0x5d4402['where']=qs['filters'](_[_0x9cd5('0x3e')](_0x4b043e[_0x9cd5('0x34')],_0x305ffe[_0x9cd5('0x36')]),_0x520275);if(_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x3f')]){_0x5d4402[_0x9cd5('0x40')]=_[_0x9cd5('0x41')](_0x5d4402['where'],{'$or':_[_0x9cd5('0x2e')](_0x520275,function(_0x362c73){if(_0x362c73[_0x9cd5('0x32')]!==_0x9cd5('0x42')){var _0x2df700={};_0x2df700[_0x362c73[_0x9cd5('0x2b')]]={'$like':'%'+_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x3f')]+'%'};return _0x2df700;}})});}_0x5d4402=_[_0x9cd5('0x41')]({},_0x5d4402,_0x4b043e['options']);var _0x179e27={'where':_0x5d4402['where']};return db['AnalyticExtractedReport'][_0x9cd5('0x20')](_0x179e27)['then'](function(_0x1f3e91){_0x2ed04f[_0x9cd5('0x20')]=_0x1f3e91;if(_0x4b043e[_0x9cd5('0x34')][_0x9cd5('0x43')]){_0x5d4402[_0x9cd5('0x44')]=[{'all':!![]}];}return db[_0x9cd5('0x2f')][_0x9cd5('0x45')](_0x5d4402);})['then'](function(_0x280093){_0x2ed04f['rows']=_0x280093;return _0x2ed04f;})[_0x9cd5('0x26')](respondWithFilteredResult(_0x12c76b,_0x5d4402))['catch'](handleError(_0x12c76b,null));};exports[_0x9cd5('0x46')]=function(_0x29a960,_0x1c00bb){var _0x589aaf={'raw':!![],'where':{'id':_0x29a960[_0x9cd5('0x47')]['id']}},_0x1d2480={};_0x1d2480['model']=_[_0x9cd5('0x35')](db['AnalyticExtractedReport'][_0x9cd5('0x30')]);_0x1d2480[_0x9cd5('0x34')]=_[_0x9cd5('0x35')](_0x29a960[_0x9cd5('0x34')]);_0x1d2480[_0x9cd5('0x36')]=_[_0x9cd5('0x37')](_0x1d2480[_0x9cd5('0x33')],_0x1d2480['query']);_0x589aaf[_0x9cd5('0x38')]=_[_0x9cd5('0x37')](_0x1d2480[_0x9cd5('0x33')],qs[_0x9cd5('0x39')](_0x29a960[_0x9cd5('0x34')][_0x9cd5('0x39')]));_0x589aaf[_0x9cd5('0x38')]=_0x589aaf[_0x9cd5('0x38')][_0x9cd5('0x3a')]?_0x589aaf[_0x9cd5('0x38')]:_0x1d2480[_0x9cd5('0x33')];if(_0x29a960['query'][_0x9cd5('0x43')]){_0x589aaf['include']=[{'all':!![]}];}_0x589aaf=_[_0x9cd5('0x41')]({},_0x589aaf,_0x29a960[_0x9cd5('0x48')]);return db[_0x9cd5('0x2f')][_0x9cd5('0x49')](_0x589aaf)[_0x9cd5('0x26')](handleEntityNotFound(_0x1c00bb,null))['then'](respondWithResult(_0x1c00bb,null))['catch'](handleError(_0x1c00bb,null));};exports[_0x9cd5('0x4a')]=function(_0x10a292,_0x25502d){return db[_0x9cd5('0x2f')][_0x9cd5('0x4a')](_0x10a292[_0x9cd5('0x4b')],{})['then'](function(_0x89abbd){var _0x6d36bb=_0x10a292['user']['get']({'plain':!![]});if(!_0x6d36bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6d36bb[_0x9cd5('0x4c')]===_0x9cd5('0x4d')){var _0xea6b4=_0x89abbd[_0x9cd5('0x4e')]({'plain':!![]});var _0x448b7a=_0x9cd5('0x4f');return db['UserProfileSection'][_0x9cd5('0x49')]({'where':{'name':_0x448b7a,'userProfileId':_0x6d36bb[_0x9cd5('0x50')]},'raw':!![]})[_0x9cd5('0x26')](function(_0xf81099){if(_0xf81099&&_0xf81099['autoAssociation']===0x0){return db[_0x9cd5('0x28')][_0x9cd5('0x4a')]({'name':_0xea6b4[_0x9cd5('0x2b')],'resourceId':_0xea6b4['id'],'type':_0xf81099[_0x9cd5('0x2b')],'sectionId':_0xf81099['id']},{})[_0x9cd5('0x26')](function(){return _0x89abbd;});}else{return _0x89abbd;}})['catch'](function(_0x502ace){logger[_0x9cd5('0x29')](_0x9cd5('0x51'),_0x502ace);throw _0x502ace;});}return _0x89abbd;})[_0x9cd5('0x26')](respondWithResult(_0x25502d,0xc9))[_0x9cd5('0x52')](handleError(_0x25502d,null));};exports[_0x9cd5('0x25')]=function(_0x501ee3,_0x270375){if(_0x501ee3[_0x9cd5('0x4b')]['id']){delete _0x501ee3['body']['id'];}return db['AnalyticExtractedReport'][_0x9cd5('0x49')]({'where':{'id':_0x501ee3[_0x9cd5('0x47')]['id']}})[_0x9cd5('0x26')](handleEntityNotFound(_0x270375,null))[_0x9cd5('0x26')](saveUpdates(_0x501ee3['body'],null))['then'](respondWithResult(_0x270375,null))[_0x9cd5('0x52')](handleError(_0x270375,null));};exports[_0x9cd5('0x27')]=function(_0x5c9bcd,_0x3406de){return db[_0x9cd5('0x2f')][_0x9cd5('0x49')]({'where':{'id':_0x5c9bcd['params']['id']}})[_0x9cd5('0x26')](handleEntityNotFound(_0x3406de,null))[_0x9cd5('0x26')](removeEntity(_0x3406de,null))[_0x9cd5('0x52')](handleError(_0x3406de,null));};exports[_0x9cd5('0x53')]=function(_0x13a77b,_0x481536,_0x443597){return db[_0x9cd5('0x2f')][_0x9cd5('0x49')]({'where':{'id':_0x13a77b[_0x9cd5('0x47')]['id']},'attributes':[_0x9cd5('0x2b'),'basename','savename',_0x9cd5('0x54')],'raw':!![]})[_0x9cd5('0x26')](handleEntityNotFound(_0x481536,null))[_0x9cd5('0x26')](function(_0x4aa88e){if(_0x4aa88e){if(!fs['existsSync'](path[_0x9cd5('0x55')](config['root'],_0x9cd5('0x56'),_0x4aa88e['savename']))){throw new db[(_0x9cd5('0x57'))][(_0x9cd5('0x58'))](_0x9cd5('0x59'));}if(_0x13a77b[_0x9cd5('0x34')][_0x9cd5('0x5a')]){return _0x481536[_0x9cd5('0x19')](0xc8);}return _0x481536[_0x9cd5('0x53')](path[_0x9cd5('0x55')](config[_0x9cd5('0x5b')],_0x9cd5('0x56'),_0x4aa88e[_0x9cd5('0x5c')]),util[_0x9cd5('0x5d')](_0x9cd5('0x5e'),_0x4aa88e['basename']||_0x4aa88e[_0x9cd5('0x2b')],_0x4aa88e[_0x9cd5('0x54')][_0x9cd5('0x5f')]()));}})[_0x9cd5('0x52')](handleError(_0x481536,null));}; \ No newline at end of file +var _0x187f=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','show','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','autoAssociation','params','basename','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','output','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x235497,_0x80e756){var _0x5a1967=function(_0x20c5b1){while(--_0x20c5b1){_0x235497['push'](_0x235497['shift']());}};_0x5a1967(++_0x80e756);}(_0x187f,0xb7));var _0xf187=function(_0x5ae35f,_0x1300c3){_0x5ae35f=_0x5ae35f-0x0;var _0x4835ad=_0x187f[_0x5ae35f];return _0x4835ad;};'use strict';var emlformat=require(_0xf187('0x0'));var rimraf=require(_0xf187('0x1'));var zipdir=require(_0xf187('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf187('0x3'));var moment=require(_0xf187('0x4'));var BPromise=require(_0xf187('0x5'));var Mustache=require(_0xf187('0x6'));var util=require(_0xf187('0x7'));var path=require(_0xf187('0x8'));var sox=require('sox');var csv=require(_0xf187('0x9'));var ejs=require(_0xf187('0xa'));var fs=require('fs');var fs_extra=require(_0xf187('0xb'));var _=require(_0xf187('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf187('0xd'));var deskjs=require(_0xf187('0xe'));var toCsv=require(_0xf187('0x9'));var querystring=require('querystring');var Papa=require(_0xf187('0xf'));var Redis=require('ioredis');var authService=require(_0xf187('0x10'));var qs=require(_0xf187('0x11'));var as=require(_0xf187('0x12'));var hardwareService=require(_0xf187('0x13'));var logger=require(_0xf187('0x14'))(_0xf187('0x15'));var utils=require(_0xf187('0x16'));var config=require(_0xf187('0x17'));var licenseUtil=require(_0xf187('0x18'));var db=require(_0xf187('0x19'))['db'];function respondWithStatusCode(_0x12ff73,_0x48847f){_0x48847f=_0x48847f||0xcc;return function(_0x587e38){if(_0x587e38){return _0x12ff73[_0xf187('0x1a')](_0x48847f);}return _0x12ff73[_0xf187('0x1b')](_0x48847f)[_0xf187('0x1c')]();};}function respondWithResult(_0x112724,_0x40e1e7){_0x40e1e7=_0x40e1e7||0xc8;return function(_0xfe31cc){if(_0xfe31cc){return _0x112724['status'](_0x40e1e7)['json'](_0xfe31cc);}};}function respondWithFilteredResult(_0x4ba852,_0x34a809){return function(_0x59a5a3){if(_0x59a5a3){var _0x4d75f8=typeof _0x34a809[_0xf187('0x1d')]===_0xf187('0x1e')&&typeof _0x34a809[_0xf187('0x1f')]===_0xf187('0x1e');var _0x442b15=_0x59a5a3['count'];var _0x55e721=_0x4d75f8?0x0:_0x34a809[_0xf187('0x1d')];var _0x22f4bd=_0x4d75f8?_0x59a5a3[_0xf187('0x20')]:_0x34a809['offset']+_0x34a809[_0xf187('0x1f')];var _0x3a4f96;if(_0x22f4bd>=_0x442b15){_0x22f4bd=_0x442b15;_0x3a4f96=0xc8;}else{_0x3a4f96=0xce;}_0x4ba852[_0xf187('0x1b')](_0x3a4f96);return _0x4ba852[_0xf187('0x21')]('Content-Range',_0x55e721+'-'+_0x22f4bd+'/'+_0x442b15)[_0xf187('0x22')](_0x59a5a3);}return null;};}function patchUpdates(_0x2af176){return function(_0x3b7baf){try{jsonpatch[_0xf187('0x23')](_0x3b7baf,_0x2af176,!![]);}catch(_0x5c17e3){return BPromise[_0xf187('0x24')](_0x5c17e3);}return _0x3b7baf[_0xf187('0x25')]();};}function saveUpdates(_0x4b39c3,_0x3f3df0){return function(_0xbdd6f6){if(_0xbdd6f6){return _0xbdd6f6[_0xf187('0x26')](_0x4b39c3)[_0xf187('0x27')](function(_0x2f97a4){return _0x2f97a4;});}return null;};}function removeEntity(_0x34b907,_0x37585f){return function(_0x4ddae0){if(_0x4ddae0){return _0x4ddae0[_0xf187('0x28')]()['then'](function(){var _0x3ea0e0=_0x4ddae0[_0xf187('0x29')]({'plain':!![]});var _0xdbe279='ExtractedReports';return db['UserProfileResource'][_0xf187('0x28')]({'where':{'type':_0xdbe279,'resourceId':_0x3ea0e0['id']}})[_0xf187('0x27')](function(){return _0x4ddae0;});})[_0xf187('0x27')](function(){_0x34b907[_0xf187('0x1b')](0xcc)[_0xf187('0x1c')]();});}};}function handleEntityNotFound(_0x13e57b,_0x5175d3){return function(_0x141bcd){if(!_0x141bcd){_0x13e57b['sendStatus'](0x194);}return _0x141bcd;};}function handleError(_0x128923,_0x394e13){_0x394e13=_0x394e13||0x1f4;return function(_0x2a47a8){logger['error'](_0x2a47a8[_0xf187('0x2a')]);if(_0x2a47a8[_0xf187('0x2b')]){delete _0x2a47a8[_0xf187('0x2b')];}_0x128923[_0xf187('0x1b')](_0x394e13)['send'](_0x2a47a8);};}exports[_0xf187('0x2c')]=function(_0x4916f9,_0x242b6f){var _0x1d057e={},_0x2478b3={},_0x2935b0={'count':0x0,'rows':[]};var _0x326220=_[_0xf187('0x2d')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5f1eca){return{'name':_0x5f1eca[_0xf187('0x2e')],'type':_0x5f1eca[_0xf187('0x2f')][_0xf187('0x30')]};});_0x2478b3[_0xf187('0x31')]=_[_0xf187('0x2d')](_0x326220,_0xf187('0x2b'));_0x2478b3[_0xf187('0x32')]=_[_0xf187('0x33')](_0x4916f9[_0xf187('0x32')]);_0x2478b3[_0xf187('0x34')]=_[_0xf187('0x35')](_0x2478b3[_0xf187('0x31')],_0x2478b3[_0xf187('0x32')]);_0x1d057e[_0xf187('0x36')]=_[_0xf187('0x35')](_0x2478b3[_0xf187('0x31')],qs['fields'](_0x4916f9[_0xf187('0x32')][_0xf187('0x37')]));_0x1d057e[_0xf187('0x36')]=_0x1d057e[_0xf187('0x36')][_0xf187('0x38')]?_0x1d057e['attributes']:_0x2478b3[_0xf187('0x31')];if(!_0x4916f9[_0xf187('0x32')]['hasOwnProperty'](_0xf187('0x39'))){_0x1d057e['limit']=qs[_0xf187('0x1f')](_0x4916f9[_0xf187('0x32')]['limit']);_0x1d057e[_0xf187('0x1d')]=qs[_0xf187('0x1d')](_0x4916f9[_0xf187('0x32')][_0xf187('0x1d')]);}_0x1d057e[_0xf187('0x3a')]=qs[_0xf187('0x3b')](_0x4916f9[_0xf187('0x32')]['sort']);_0x1d057e[_0xf187('0x3c')]=qs[_0xf187('0x34')](_[_0xf187('0x3d')](_0x4916f9[_0xf187('0x32')],_0x2478b3[_0xf187('0x34')]),_0x326220);if(_0x4916f9[_0xf187('0x32')][_0xf187('0x3e')]){_0x1d057e['where']=_[_0xf187('0x3f')](_0x1d057e[_0xf187('0x3c')],{'$or':_[_0xf187('0x2d')](_0x326220,function(_0x2c482a){if(_0x2c482a[_0xf187('0x2f')]!=='VIRTUAL'){var _0x248097={};_0x248097[_0x2c482a[_0xf187('0x2b')]]={'$like':'%'+_0x4916f9['query'][_0xf187('0x3e')]+'%'};return _0x248097;}})});}_0x1d057e=_[_0xf187('0x3f')]({},_0x1d057e,_0x4916f9[_0xf187('0x40')]);var _0xbc6049={'where':_0x1d057e[_0xf187('0x3c')]};return db[_0xf187('0x41')][_0xf187('0x20')](_0xbc6049)[_0xf187('0x27')](function(_0x2341c9){_0x2935b0[_0xf187('0x20')]=_0x2341c9;if(_0x4916f9[_0xf187('0x32')][_0xf187('0x42')]){_0x1d057e[_0xf187('0x43')]=[{'all':!![]}];}return db[_0xf187('0x41')][_0xf187('0x44')](_0x1d057e);})['then'](function(_0x5d3875){_0x2935b0['rows']=_0x5d3875;return _0x2935b0;})[_0xf187('0x27')](respondWithFilteredResult(_0x242b6f,_0x1d057e))['catch'](handleError(_0x242b6f,null));};exports[_0xf187('0x45')]=function(_0x1222d8,_0x2b0366){var _0x49d58d={'raw':!![],'where':{'id':_0x1222d8['params']['id']}},_0x10086f={};_0x10086f[_0xf187('0x31')]=_[_0xf187('0x33')](db[_0xf187('0x41')][_0xf187('0x46')]);_0x10086f[_0xf187('0x32')]=_[_0xf187('0x33')](_0x1222d8[_0xf187('0x32')]);_0x10086f[_0xf187('0x34')]=_['intersection'](_0x10086f[_0xf187('0x31')],_0x10086f[_0xf187('0x32')]);_0x49d58d[_0xf187('0x36')]=_[_0xf187('0x35')](_0x10086f[_0xf187('0x31')],qs[_0xf187('0x37')](_0x1222d8[_0xf187('0x32')][_0xf187('0x37')]));_0x49d58d[_0xf187('0x36')]=_0x49d58d[_0xf187('0x36')]['length']?_0x49d58d[_0xf187('0x36')]:_0x10086f[_0xf187('0x31')];if(_0x1222d8[_0xf187('0x32')]['includeAll']){_0x49d58d[_0xf187('0x43')]=[{'all':!![]}];}_0x49d58d=_[_0xf187('0x3f')]({},_0x49d58d,_0x1222d8['options']);return db[_0xf187('0x41')][_0xf187('0x47')](_0x49d58d)[_0xf187('0x27')](handleEntityNotFound(_0x2b0366,null))['then'](respondWithResult(_0x2b0366,null))[_0xf187('0x48')](handleError(_0x2b0366,null));};exports[_0xf187('0x49')]=function(_0x2f12ed,_0x2927ce){return db['AnalyticExtractedReport'][_0xf187('0x49')](_0x2f12ed[_0xf187('0x4a')],{})[_0xf187('0x27')](function(_0xd7f0e7){var _0x37711e=_0x2f12ed['user'][_0xf187('0x29')]({'plain':!![]});if(!_0x37711e)throw new Error(_0xf187('0x4b'));if(_0x37711e[_0xf187('0x4c')]===_0xf187('0x4d')){var _0x373da1=_0xd7f0e7[_0xf187('0x29')]({'plain':!![]});var _0x5deac7=_0xf187('0x4e');return db['UserProfileSection'][_0xf187('0x47')]({'where':{'name':_0x5deac7,'userProfileId':_0x37711e['userProfileId']},'raw':!![]})[_0xf187('0x27')](function(_0x121390){if(_0x121390&&_0x121390[_0xf187('0x4f')]===0x0){return db['UserProfileResource'][_0xf187('0x49')]({'name':_0x373da1[_0xf187('0x2b')],'resourceId':_0x373da1['id'],'type':_0x121390[_0xf187('0x2b')],'sectionId':_0x121390['id']},{})[_0xf187('0x27')](function(){return _0xd7f0e7;});}else{return _0xd7f0e7;}})[_0xf187('0x48')](function(_0x5010b0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5010b0);throw _0x5010b0;});}return _0xd7f0e7;})['then'](respondWithResult(_0x2927ce,0xc9))['catch'](handleError(_0x2927ce,null));};exports[_0xf187('0x26')]=function(_0x5123ca,_0x1ec704){if(_0x5123ca[_0xf187('0x4a')]['id']){delete _0x5123ca['body']['id'];}return db[_0xf187('0x41')]['find']({'where':{'id':_0x5123ca['params']['id']}})[_0xf187('0x27')](handleEntityNotFound(_0x1ec704,null))[_0xf187('0x27')](saveUpdates(_0x5123ca[_0xf187('0x4a')],null))[_0xf187('0x27')](respondWithResult(_0x1ec704,null))['catch'](handleError(_0x1ec704,null));};exports['destroy']=function(_0x441f9f,_0x415eab){return db[_0xf187('0x41')][_0xf187('0x47')]({'where':{'id':_0x441f9f[_0xf187('0x50')]['id']}})[_0xf187('0x27')](handleEntityNotFound(_0x415eab,null))[_0xf187('0x27')](removeEntity(_0x415eab,null))[_0xf187('0x48')](handleError(_0x415eab,null));};exports['download']=function(_0xc23e09,_0x20f364,_0x541c7e){return db[_0xf187('0x41')][_0xf187('0x47')]({'where':{'id':_0xc23e09[_0xf187('0x50')]['id']},'attributes':[_0xf187('0x2b'),_0xf187('0x51'),'savename','output'],'raw':!![]})[_0xf187('0x27')](handleEntityNotFound(_0x20f364,null))[_0xf187('0x27')](function(_0x440420){if(_0x440420){if(!fs['existsSync'](path['join'](config[_0xf187('0x52')],_0xf187('0x53'),_0x440420[_0xf187('0x54')]))){throw new db[(_0xf187('0x55'))][(_0xf187('0x56'))](_0xf187('0x57'));}if(_0xc23e09[_0xf187('0x32')][_0xf187('0x58')]){return _0x20f364['sendStatus'](0xc8);}return _0x20f364[_0xf187('0x59')](path[_0xf187('0x5a')](config['root'],_0xf187('0x53'),_0x440420[_0xf187('0x54')]),util[_0xf187('0x5b')](_0xf187('0x5c'),_0x440420[_0xf187('0x51')]||_0x440420[_0xf187('0x2b')],_0x440420[_0xf187('0x5d')]['toLowerCase']()));}})['catch'](handleError(_0x20f364,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9e479c2..7a6c317 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 _0xd5f2=['util','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xd5f2,0x1f3));var _0x2d5f=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xd5f2[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x2d5f('0x0'));var util=require(_0x2d5f('0x1'));var logger=require('../../config/logger')(_0x2d5f('0x2'));var moment=require(_0x2d5f('0x3'));var BPromise=require(_0x2d5f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5f('0x5'));var rimraf=require('rimraf');var config=require(_0x2d5f('0x6'));var attributes=require(_0x2d5f('0x7'));module['exports']=function(_0x5c43d3,_0x3d25c1){return _0x5c43d3['define'](_0x2d5f('0x8'),attributes,{'tableName':_0x2d5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb97=['define','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xeb97,0x147));var _0x7eb9=function(_0xc6bd09,_0x5e7c1b){_0xc6bd09=_0xc6bd09-0x0;var _0x27afaa=_0xeb97[_0xc6bd09];return _0x27afaa;};'use strict';var _=require(_0x7eb9('0x0'));var util=require('util');var logger=require(_0x7eb9('0x1'))(_0x7eb9('0x2'));var moment=require(_0x7eb9('0x3'));var BPromise=require(_0x7eb9('0x4'));var rp=require(_0x7eb9('0x5'));var fs=require('fs');var path=require(_0x7eb9('0x6'));var rimraf=require(_0x7eb9('0x7'));var config=require(_0x7eb9('0x8'));var attributes=require(_0x7eb9('0x9'));module[_0x7eb9('0xa')]=function(_0x3257fb,_0x2dba32){return _0x3257fb[_0x7eb9('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x7eb9('0xc'),'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 72132c6..656654f 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 _0xa28a=['util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xabec85,_0x87a702){var _0x26a624=function(_0x4be093){while(--_0x4be093){_0xabec85['push'](_0xabec85['shift']());}};_0x26a624(++_0x87a702);}(_0xa28a,0x130));var _0xaa28=function(_0xd8e9f5,_0x29df60){_0xd8e9f5=_0xd8e9f5-0x0;var _0x4b915e=_0xa28a[_0xd8e9f5];return _0x4b915e;};'use strict';var _=require('lodash');var util=require(_0xaa28('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaa28('0x1'));var fs=require('fs');var Redis=require(_0xaa28('0x2'));var db=require(_0xaa28('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaa28('0x4'));var config=require(_0xaa28('0x5'));var jayson=require(_0xaa28('0x6'));var client=jayson['client'][_0xaa28('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c6fdd,_0x406265,_0x333fba){return new BPromise(function(_0x49a443,_0x483dfa){return client[_0xaa28('0x8')](_0x2c6fdd,_0x333fba)[_0xaa28('0x9')](function(_0x4eaf96){logger[_0xaa28('0xa')](_0xaa28('0xb'),_0x406265,_0xaa28('0xc'));logger['debug'](_0xaa28('0xd'),_0x406265,_0xaa28('0xc'),JSON['stringify'](_0x4eaf96));if(_0x4eaf96['error']){if(_0x4eaf96[_0xaa28('0xe')][_0xaa28('0xf')]===0x1f4){logger[_0xaa28('0xe')](_0xaa28('0xb'),_0x406265,_0x4eaf96[_0xaa28('0xe')][_0xaa28('0x10')]);return _0x483dfa(_0x4eaf96[_0xaa28('0xe')][_0xaa28('0x10')]);}logger[_0xaa28('0xe')](_0xaa28('0xb'),_0x406265,_0x4eaf96['error'][_0xaa28('0x10')]);return _0x49a443(_0x4eaf96['error'][_0xaa28('0x10')]);}else{logger[_0xaa28('0xa')](_0xaa28('0xb'),_0x406265,_0xaa28('0xc'));_0x49a443(_0x4eaf96[_0xaa28('0x11')][_0xaa28('0x10')]);}})[_0xaa28('0x12')](function(_0x328c6c){logger[_0xaa28('0xe')](_0xaa28('0xb'),_0x406265,_0x328c6c);_0x483dfa(_0x328c6c);});});} \ No newline at end of file +var _0x022b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird'];(function(_0x3e4bb1,_0x3e28ec){var _0x5677ed=function(_0x552544){while(--_0x552544){_0x3e4bb1['push'](_0x3e4bb1['shift']());}};_0x5677ed(++_0x3e28ec);}(_0x022b,0x1cb));var _0xb022=function(_0x3dcfed,_0x7366d0){_0x3dcfed=_0x3dcfed-0x0;var _0x11208a=_0x022b[_0x3dcfed];return _0x11208a;};'use strict';var _=require('lodash');var util=require(_0xb022('0x0'));var moment=require(_0xb022('0x1'));var BPromise=require(_0xb022('0x2'));var rs=require(_0xb022('0x3'));var fs=require('fs');var Redis=require(_0xb022('0x4'));var db=require(_0xb022('0x5'))['db'];var utils=require(_0xb022('0x6'));var logger=require(_0xb022('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb022('0x8'));var client=jayson[_0xb022('0x9')][_0xb022('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570f47,_0x3e10b4,_0x38a7fe){return new BPromise(function(_0x216672,_0x3c00e7){return client[_0xb022('0xb')](_0x570f47,_0x38a7fe)[_0xb022('0xc')](function(_0x24c0fd){logger['info'](_0xb022('0xd'),_0x3e10b4,'request\x20sent');logger['debug'](_0xb022('0xe'),_0x3e10b4,_0xb022('0xf'),JSON[_0xb022('0x10')](_0x24c0fd));if(_0x24c0fd['error']){if(_0x24c0fd[_0xb022('0x11')]['code']===0x1f4){logger[_0xb022('0x11')](_0xb022('0xd'),_0x3e10b4,_0x24c0fd['error'][_0xb022('0x12')]);return _0x3c00e7(_0x24c0fd[_0xb022('0x11')]['message']);}logger[_0xb022('0x11')](_0xb022('0xd'),_0x3e10b4,_0x24c0fd[_0xb022('0x11')][_0xb022('0x12')]);return _0x216672(_0x24c0fd['error'][_0xb022('0x12')]);}else{logger[_0xb022('0x13')](_0xb022('0xd'),_0x3e10b4,_0xb022('0xf'));_0x216672(_0x24c0fd[_0xb022('0x14')]['message']);}})['catch'](function(_0x584b49){logger[_0xb022('0x11')](_0xb022('0xd'),_0x3e10b4,_0x584b49);_0x3c00e7(_0x584b49);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b4c02d2..47bc4fe 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 _0x5e3b=['download','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','index','/:id','isAuthenticated','show','get','/:id/download'];(function(_0x90aedd,_0x58d687){var _0x3a574f=function(_0x4cdd0e){while(--_0x4cdd0e){_0x90aedd['push'](_0x90aedd['shift']());}};_0x3a574f(++_0x58d687);}(_0x5e3b,0xae));var _0xb5e3=function(_0x48bc12,_0x556fdd){_0x48bc12=_0x48bc12-0x0;var _0x453254=_0x5e3b[_0x48bc12];return _0x453254;};'use strict';var multer=require(_0xb5e3('0x0'));var util=require(_0xb5e3('0x1'));var path=require(_0xb5e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5e3('0x3'));var router=express[_0xb5e3('0x4')]();var fs_extra=require(_0xb5e3('0x5'));var auth=require(_0xb5e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb5e3('0x7'));var controller=require(_0xb5e3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb5e3('0x9')]);router['get'](_0xb5e3('0xa'),auth[_0xb5e3('0xb')](),controller[_0xb5e3('0xc')]);router[_0xb5e3('0xd')](_0xb5e3('0xe'),auth[_0xb5e3('0xb')](),controller[_0xb5e3('0xf')]);router['post']('/',auth[_0xb5e3('0xb')](),controller[_0xb5e3('0x10')]);router[_0xb5e3('0x11')](_0xb5e3('0xa'),auth[_0xb5e3('0xb')](),controller[_0xb5e3('0x12')]);router[_0xb5e3('0x13')](_0xb5e3('0xa'),auth['isAuthenticated'](),controller[_0xb5e3('0x14')]);module['exports']=router; \ No newline at end of file +var _0x33bd=['/:id','/:id/download','download','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x70841e,_0x1e002d){var _0x4f15a8=function(_0x3cc940){while(--_0x3cc940){_0x70841e['push'](_0x70841e['shift']());}};_0x4f15a8(++_0x1e002d);}(_0x33bd,0xa8));var _0xd33b=function(_0x266a87,_0xf35432){_0x266a87=_0x266a87-0x0;var _0x1d7b6b=_0x33bd[_0x266a87];return _0x1d7b6b;};'use strict';var multer=require(_0xd33b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd33b('0x1'));var express=require(_0xd33b('0x2'));var router=express[_0xd33b('0x3')]();var fs_extra=require(_0xd33b('0x4'));var auth=require(_0xd33b('0x5'));var interaction=require(_0xd33b('0x6'));var config=require(_0xd33b('0x7'));var controller=require(_0xd33b('0x8'));router[_0xd33b('0x9')]('/',auth[_0xd33b('0xa')](),controller[_0xd33b('0xb')]);router[_0xd33b('0x9')](_0xd33b('0xc'),auth[_0xd33b('0xa')](),controller['show']);router['get'](_0xd33b('0xd'),auth['isAuthenticated'](),controller[_0xd33b('0xe')]);router['post']('/',auth[_0xd33b('0xa')](),controller[_0xd33b('0xf')]);router[_0xd33b('0x10')](_0xd33b('0xc'),auth[_0xd33b('0xa')](),controller[_0xd33b('0x11')]);router[_0xd33b('0x12')](_0xd33b('0xc'),auth[_0xd33b('0xa')](),controller[_0xd33b('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f4edbe6..8cc2057 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 _0x8ca2=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x8ca2,0x10c));var _0x28ca=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x8ca2[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x28ca('0x0'));module[_0x28ca('0x1')]={'field':{'type':Sequelize[_0x28ca('0x2')]},'alias':{'type':Sequelize[_0x28ca('0x3')]},'function':{'type':Sequelize[_0x28ca('0x3')]},'format':{'type':Sequelize[_0x28ca('0x3')]},'groupBy':{'type':Sequelize[_0x28ca('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x28ca('0x3')]},'custom':{'type':Sequelize[_0x28ca('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x78e9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x26c812,_0x1ff16c){var _0x4c497d=function(_0x9628de){while(--_0x9628de){_0x26c812['push'](_0x26c812['shift']());}};_0x4c497d(++_0x1ff16c);}(_0x78e9,0xf6));var _0x978e=function(_0x24b231,_0x3a95da){_0x24b231=_0x24b231-0x0;var _0x1fdc5b=_0x78e9[_0x24b231];return _0x1fdc5b;};'use strict';var Sequelize=require(_0x978e('0x0'));module[_0x978e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x978e('0x2')]},'function':{'type':Sequelize[_0x978e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x978e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x978e('0x2')]},'custom':{'type':Sequelize[_0x978e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index e7f3902..adf6113 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 _0xf489=['addFields','AnalyticCustomReport','findOne','params','sequelize','CustomReportId','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','length','options','find','body','ids'];(function(_0x15b962,_0x4bd809){var _0xe4676b=function(_0x3b7e44){while(--_0x3b7e44){_0x15b962['push'](_0x15b962['shift']());}};_0xe4676b(++_0x4bd809);}(_0xf489,0x17e));var _0x9f48=function(_0xadf978,_0x1835dc){_0xadf978=_0xadf978-0x0;var _0x56bb0d=_0xf489[_0xadf978];return _0x56bb0d;};'use strict';var emlformat=require(_0x9f48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f48('0x1'));var jsonpatch=require(_0x9f48('0x2'));var rp=require(_0x9f48('0x3'));var moment=require('moment');var BPromise=require(_0x9f48('0x4'));var Mustache=require(_0x9f48('0x5'));var util=require(_0x9f48('0x6'));var path=require(_0x9f48('0x7'));var sox=require(_0x9f48('0x8'));var csv=require(_0x9f48('0x9'));var ejs=require(_0x9f48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f48('0xb'));var squel=require(_0x9f48('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f48('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f48('0xe'));var Redis=require(_0x9f48('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9f48('0x10'));var config=require(_0x9f48('0x11'));var licenseUtil=require(_0x9f48('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a6b41,_0x2c2f21){_0x2c2f21=_0x2c2f21||0xcc;return function(_0x21739a){if(_0x21739a){return _0x2a6b41[_0x9f48('0x13')](_0x2c2f21);}return _0x2a6b41[_0x9f48('0x14')](_0x2c2f21)[_0x9f48('0x15')]();};}function respondWithResult(_0x502308,_0x1ac4a0){_0x1ac4a0=_0x1ac4a0||0xc8;return function(_0x2492a2){if(_0x2492a2){return _0x502308[_0x9f48('0x14')](_0x1ac4a0)[_0x9f48('0x16')](_0x2492a2);}};}function respondWithFilteredResult(_0x17c1f2,_0x2947a0){return function(_0x36c483){if(_0x36c483){var _0x118777=typeof _0x2947a0[_0x9f48('0x17')]==='undefined'&&typeof _0x2947a0['limit']===_0x9f48('0x18');var _0x4a0c43=_0x36c483[_0x9f48('0x19')];var _0x49a00e=_0x118777?0x0:_0x2947a0[_0x9f48('0x17')];var _0x3d350c=_0x118777?_0x36c483[_0x9f48('0x19')]:_0x2947a0[_0x9f48('0x17')]+_0x2947a0[_0x9f48('0x1a')];var _0x5e34eb;if(_0x3d350c>=_0x4a0c43){_0x3d350c=_0x4a0c43;_0x5e34eb=0xc8;}else{_0x5e34eb=0xce;}_0x17c1f2[_0x9f48('0x14')](_0x5e34eb);return _0x17c1f2['set']('Content-Range',_0x49a00e+'-'+_0x3d350c+'/'+_0x4a0c43)[_0x9f48('0x16')](_0x36c483);}return null;};}function patchUpdates(_0x83d211){return function(_0xae480e){try{jsonpatch['apply'](_0xae480e,_0x83d211,!![]);}catch(_0x1bf920){return BPromise[_0x9f48('0x1b')](_0x1bf920);}return _0xae480e[_0x9f48('0x1c')]();};}function saveUpdates(_0x522b18,_0x454ae6){return function(_0x32af5b){if(_0x32af5b){return _0x32af5b[_0x9f48('0x1d')](_0x522b18)[_0x9f48('0x1e')](function(_0x5bf0c5){return _0x5bf0c5;});}return null;};}function removeEntity(_0x57116d,_0x2be76c){return function(_0x3c64de){if(_0x3c64de){return _0x3c64de[_0x9f48('0x1f')]()[_0x9f48('0x1e')](function(){_0x57116d['status'](0xcc)[_0x9f48('0x15')]();});}};}function handleEntityNotFound(_0x25862c,_0x453aa0){return function(_0xcd46d){if(!_0xcd46d){_0x25862c[_0x9f48('0x13')](0x194);}return _0xcd46d;};}function handleError(_0x5ca6b3,_0x5a803d){_0x5a803d=_0x5a803d||0x1f4;return function(_0x93f55f){logger[_0x9f48('0x20')](_0x93f55f[_0x9f48('0x21')]);if(_0x93f55f['name']){delete _0x93f55f[_0x9f48('0x22')];}_0x5ca6b3['status'](_0x5a803d)[_0x9f48('0x23')](_0x93f55f);};}exports['index']=function(_0x3b8fc9,_0x3977f5){var _0x1e41c9={},_0x811843={},_0xc707d8={'count':0x0,'rows':[]};var _0x5d211c=_[_0x9f48('0x24')](db[_0x9f48('0x25')][_0x9f48('0x26')],function(_0x466da2){return{'name':_0x466da2[_0x9f48('0x27')],'type':_0x466da2['type'][_0x9f48('0x28')]};});_0x811843[_0x9f48('0x29')]=_[_0x9f48('0x24')](_0x5d211c,_0x9f48('0x22'));_0x811843[_0x9f48('0x2a')]=_[_0x9f48('0x2b')](_0x3b8fc9[_0x9f48('0x2a')]);_0x811843['filters']=_[_0x9f48('0x2c')](_0x811843[_0x9f48('0x29')],_0x811843['query']);_0x1e41c9['attributes']=_[_0x9f48('0x2c')](_0x811843['model'],qs[_0x9f48('0x2d')](_0x3b8fc9[_0x9f48('0x2a')][_0x9f48('0x2d')]));_0x1e41c9['attributes']=_0x1e41c9['attributes']['length']?_0x1e41c9[_0x9f48('0x2e')]:_0x811843[_0x9f48('0x29')];if(!_0x3b8fc9[_0x9f48('0x2a')][_0x9f48('0x2f')]('nolimit')){_0x1e41c9[_0x9f48('0x1a')]=qs[_0x9f48('0x1a')](_0x3b8fc9['query']['limit']);_0x1e41c9['offset']=qs[_0x9f48('0x17')](_0x3b8fc9['query'][_0x9f48('0x17')]);}_0x1e41c9[_0x9f48('0x30')]=qs['sort'](_0x3b8fc9[_0x9f48('0x2a')][_0x9f48('0x31')]);_0x1e41c9[_0x9f48('0x32')]=qs[_0x9f48('0x33')](_[_0x9f48('0x34')](_0x3b8fc9['query'],_0x811843[_0x9f48('0x33')]),_0x5d211c);if(_0x3b8fc9[_0x9f48('0x2a')]['filter']){_0x1e41c9[_0x9f48('0x32')]=_[_0x9f48('0x35')](_0x1e41c9[_0x9f48('0x32')],{'$or':_[_0x9f48('0x24')](_0x5d211c,function(_0x58686d){if(_0x58686d[_0x9f48('0x36')]!==_0x9f48('0x37')){var _0x4b2b37={};_0x4b2b37[_0x58686d[_0x9f48('0x22')]]={'$like':'%'+_0x3b8fc9['query'][_0x9f48('0x38')]+'%'};return _0x4b2b37;}})});}_0x1e41c9=_['merge']({},_0x1e41c9,_0x3b8fc9['options']);var _0xfa5f5f={'where':_0x1e41c9[_0x9f48('0x32')]};return db[_0x9f48('0x25')][_0x9f48('0x19')](_0xfa5f5f)[_0x9f48('0x1e')](function(_0x54cd12){_0xc707d8[_0x9f48('0x19')]=_0x54cd12;if(_0x3b8fc9[_0x9f48('0x2a')][_0x9f48('0x39')]){_0x1e41c9[_0x9f48('0x3a')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9f48('0x3b')](_0x1e41c9);})[_0x9f48('0x1e')](function(_0x1fa5e2){_0xc707d8[_0x9f48('0x3c')]=_0x1fa5e2;return _0xc707d8;})[_0x9f48('0x1e')](respondWithFilteredResult(_0x3977f5,_0x1e41c9))[_0x9f48('0x3d')](handleError(_0x3977f5,null));};exports[_0x9f48('0x3e')]=function(_0x3737b0,_0x4a6026){var _0x149fb3={'raw':![],'where':{'id':_0x3737b0['params']['id']}},_0x11a575={};_0x11a575[_0x9f48('0x29')]=_['keys'](db['AnalyticFieldReport'][_0x9f48('0x26')]);_0x11a575[_0x9f48('0x2a')]=_[_0x9f48('0x2b')](_0x3737b0[_0x9f48('0x2a')]);_0x11a575['filters']=_[_0x9f48('0x2c')](_0x11a575['model'],_0x11a575[_0x9f48('0x2a')]);_0x149fb3[_0x9f48('0x2e')]=_[_0x9f48('0x2c')](_0x11a575[_0x9f48('0x29')],qs[_0x9f48('0x2d')](_0x3737b0[_0x9f48('0x2a')][_0x9f48('0x2d')]));_0x149fb3[_0x9f48('0x2e')]=_0x149fb3[_0x9f48('0x2e')][_0x9f48('0x3f')]?_0x149fb3[_0x9f48('0x2e')]:_0x11a575[_0x9f48('0x29')];if(_0x3737b0[_0x9f48('0x2a')]['includeAll']){_0x149fb3['include']=[{'all':!![]}];}_0x149fb3=_[_0x9f48('0x35')]({},_0x149fb3,_0x3737b0[_0x9f48('0x40')]);return db[_0x9f48('0x25')][_0x9f48('0x41')](_0x149fb3)[_0x9f48('0x1e')](handleEntityNotFound(_0x4a6026,null))['then'](respondWithResult(_0x4a6026,null))[_0x9f48('0x3d')](handleError(_0x4a6026,null));};exports['create']=function(_0x16d757,_0xb3cbb3){return db[_0x9f48('0x25')]['create'](_0x16d757[_0x9f48('0x42')],{})[_0x9f48('0x1e')](respondWithResult(_0xb3cbb3,0xc9))['catch'](handleError(_0xb3cbb3,null));};exports['bulkCreate']=function(_0x550d5e,_0x791d7c){return db[_0x9f48('0x25')]['bulkCreate'](_0x550d5e[_0x9f48('0x42')],{'raw':![],'individualHooks':!![]})[_0x9f48('0x1e')](respondWithResult(_0x791d7c,0xc9))[_0x9f48('0x3d')](handleError(_0x791d7c,null));};exports[_0x9f48('0x1d')]=function(_0x187d9c,_0x2d4018){if(_0x187d9c[_0x9f48('0x42')]['id']){delete _0x187d9c[_0x9f48('0x42')]['id'];}return db[_0x9f48('0x25')][_0x9f48('0x41')]({'where':{'id':_0x187d9c['params']['id']}})[_0x9f48('0x1e')](handleEntityNotFound(_0x2d4018,null))[_0x9f48('0x1e')](saveUpdates(_0x187d9c['body'],null))[_0x9f48('0x1e')](respondWithResult(_0x2d4018,null))[_0x9f48('0x3d')](handleError(_0x2d4018,null));};exports[_0x9f48('0x1f')]=function(_0x10d31d,_0x571c87){return db[_0x9f48('0x25')][_0x9f48('0x41')]({'where':{'id':_0x10d31d['params']['id']}})[_0x9f48('0x1e')](handleEntityNotFound(_0x571c87,null))[_0x9f48('0x1e')](removeEntity(_0x571c87,null))[_0x9f48('0x3d')](handleError(_0x571c87,null));};exports['bulkDestroy']=function(_0x566777,_0x31a802){return db[_0x9f48('0x25')][_0x9f48('0x1f')]({'where':{'id':_0x566777[_0x9f48('0x2a')][_0x9f48('0x43')]||[]},'raw':![],'individualHooks':!![]})[_0x9f48('0x1e')](respondWithResult(_0x31a802,0xcc))[_0x9f48('0x3d')](handleError(_0x31a802,null));};exports[_0x9f48('0x44')]=function(_0x2c79b7,_0x39c17a,_0x27f4a5){return db[_0x9f48('0x45')][_0x9f48('0x46')]({'where':{'id':_0x2c79b7[_0x9f48('0x47')]['id']}})[_0x9f48('0x1e')](handleEntityNotFound(_0x39c17a,null))[_0x9f48('0x1e')](function(_0x5253cd){if(_0x5253cd){return db[_0x9f48('0x48')]['transaction'](function(_0x77fab8){return db[_0x9f48('0x25')][_0x9f48('0x1f')]({'where':{'CustomReportId':_0x2c79b7[_0x9f48('0x47')]['id']},'transaction':_0x77fab8})[_0x9f48('0x1e')](function(_0x267197){var _0x5a8c99=_['map'](_0x2c79b7['body'],function(_0x2b3cfb){delete _0x2b3cfb['id'];_0x2b3cfb[_0x9f48('0x49')]=_0x2c79b7[_0x9f48('0x47')]['id'];return _0x2b3cfb;});return db[_0x9f48('0x25')][_0x9f48('0x4a')](_0x5a8c99,{'transaction':_0x77fab8});});})['then'](function(){return db[_0x9f48('0x25')][_0x9f48('0x3b')]({'where':{'CustomReportId':_0x2c79b7[_0x9f48('0x47')]['id']}});});}})[_0x9f48('0x1e')](respondWithResult(_0x39c17a,null))[_0x9f48('0x3d')](handleError(_0x39c17a,null));}; \ No newline at end of file +var _0xe50a=['../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','save','update','destroy','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','then','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','bulkDestroy','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x13d229,_0x1b97fd){var _0x400f61=function(_0x151373){while(--_0x151373){_0x13d229['push'](_0x13d229['shift']());}};_0x400f61(++_0x1b97fd);}(_0xe50a,0x1c2));var _0xae50=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xe50a[_0x37e886];return _0x57c5cd;};'use strict';var emlformat=require(_0xae50('0x0'));var rimraf=require(_0xae50('0x1'));var zipdir=require(_0xae50('0x2'));var jsonpatch=require(_0xae50('0x3'));var rp=require(_0xae50('0x4'));var moment=require(_0xae50('0x5'));var BPromise=require(_0xae50('0x6'));var Mustache=require(_0xae50('0x7'));var util=require(_0xae50('0x8'));var path=require('path');var sox=require(_0xae50('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae50('0xa'));var squel=require('squel');var crypto=require(_0xae50('0xb'));var jsforce=require(_0xae50('0xc'));var deskjs=require(_0xae50('0xd'));var toCsv=require(_0xae50('0xe'));var querystring=require('querystring');var Papa=require(_0xae50('0xf'));var Redis=require(_0xae50('0x10'));var authService=require(_0xae50('0x11'));var qs=require(_0xae50('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae50('0x13'));var logger=require(_0xae50('0x14'))(_0xae50('0x15'));var utils=require(_0xae50('0x16'));var config=require(_0xae50('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xae50('0x18'))['db'];function respondWithStatusCode(_0x112174,_0x3fb581){_0x3fb581=_0x3fb581||0xcc;return function(_0x7f95f8){if(_0x7f95f8){return _0x112174[_0xae50('0x19')](_0x3fb581);}return _0x112174[_0xae50('0x1a')](_0x3fb581)[_0xae50('0x1b')]();};}function respondWithResult(_0x1e596a,_0x52c460){_0x52c460=_0x52c460||0xc8;return function(_0x5e972e){if(_0x5e972e){return _0x1e596a[_0xae50('0x1a')](_0x52c460)['json'](_0x5e972e);}};}function respondWithFilteredResult(_0x156853,_0x2394f0){return function(_0x4cbcff){if(_0x4cbcff){var _0x5393e5=typeof _0x2394f0[_0xae50('0x1c')]==='undefined'&&typeof _0x2394f0[_0xae50('0x1d')]===_0xae50('0x1e');var _0x46fe66=_0x4cbcff[_0xae50('0x1f')];var _0x44b274=_0x5393e5?0x0:_0x2394f0[_0xae50('0x1c')];var _0x4f3555=_0x5393e5?_0x4cbcff[_0xae50('0x1f')]:_0x2394f0[_0xae50('0x1c')]+_0x2394f0[_0xae50('0x1d')];var _0x46eacd;if(_0x4f3555>=_0x46fe66){_0x4f3555=_0x46fe66;_0x46eacd=0xc8;}else{_0x46eacd=0xce;}_0x156853[_0xae50('0x1a')](_0x46eacd);return _0x156853['set']('Content-Range',_0x44b274+'-'+_0x4f3555+'/'+_0x46fe66)[_0xae50('0x20')](_0x4cbcff);}return null;};}function patchUpdates(_0x11e3f9){return function(_0x40326b){try{jsonpatch[_0xae50('0x21')](_0x40326b,_0x11e3f9,!![]);}catch(_0x4dca0a){return BPromise['reject'](_0x4dca0a);}return _0x40326b[_0xae50('0x22')]();};}function saveUpdates(_0x54020c,_0x337909){return function(_0xbebb6e){if(_0xbebb6e){return _0xbebb6e[_0xae50('0x23')](_0x54020c)['then'](function(_0x2ecb07){return _0x2ecb07;});}return null;};}function removeEntity(_0x50a889,_0x482737){return function(_0x4b1d03){if(_0x4b1d03){return _0x4b1d03[_0xae50('0x24')]()['then'](function(){_0x50a889['status'](0xcc)[_0xae50('0x1b')]();});}};}function handleEntityNotFound(_0x5a7c7e,_0x1f4a86){return function(_0x510198){if(!_0x510198){_0x5a7c7e['sendStatus'](0x194);}return _0x510198;};}function handleError(_0x4da521,_0x5aa9ff){_0x5aa9ff=_0x5aa9ff||0x1f4;return function(_0x4460df){logger['error'](_0x4460df[_0xae50('0x25')]);if(_0x4460df[_0xae50('0x26')]){delete _0x4460df['name'];}_0x4da521['status'](_0x5aa9ff)[_0xae50('0x27')](_0x4460df);};}exports['index']=function(_0x46282b,_0x123ca1){var _0x5c22e6={},_0x1f0d2a={},_0x185daf={'count':0x0,'rows':[]};var _0x2ea1b3=_[_0xae50('0x28')](db[_0xae50('0x29')][_0xae50('0x2a')],function(_0x361094){return{'name':_0x361094[_0xae50('0x2b')],'type':_0x361094[_0xae50('0x2c')][_0xae50('0x2d')]};});_0x1f0d2a['model']=_[_0xae50('0x28')](_0x2ea1b3,_0xae50('0x26'));_0x1f0d2a[_0xae50('0x2e')]=_['keys'](_0x46282b['query']);_0x1f0d2a[_0xae50('0x2f')]=_[_0xae50('0x30')](_0x1f0d2a[_0xae50('0x31')],_0x1f0d2a[_0xae50('0x2e')]);_0x5c22e6[_0xae50('0x32')]=_['intersection'](_0x1f0d2a['model'],qs[_0xae50('0x33')](_0x46282b[_0xae50('0x2e')][_0xae50('0x33')]));_0x5c22e6[_0xae50('0x32')]=_0x5c22e6['attributes'][_0xae50('0x34')]?_0x5c22e6[_0xae50('0x32')]:_0x1f0d2a[_0xae50('0x31')];if(!_0x46282b[_0xae50('0x2e')][_0xae50('0x35')](_0xae50('0x36'))){_0x5c22e6[_0xae50('0x1d')]=qs[_0xae50('0x1d')](_0x46282b['query'][_0xae50('0x1d')]);_0x5c22e6[_0xae50('0x1c')]=qs[_0xae50('0x1c')](_0x46282b[_0xae50('0x2e')][_0xae50('0x1c')]);}_0x5c22e6[_0xae50('0x37')]=qs[_0xae50('0x38')](_0x46282b[_0xae50('0x2e')][_0xae50('0x38')]);_0x5c22e6['where']=qs[_0xae50('0x2f')](_[_0xae50('0x39')](_0x46282b['query'],_0x1f0d2a['filters']),_0x2ea1b3);if(_0x46282b[_0xae50('0x2e')][_0xae50('0x3a')]){_0x5c22e6[_0xae50('0x3b')]=_[_0xae50('0x3c')](_0x5c22e6[_0xae50('0x3b')],{'$or':_[_0xae50('0x28')](_0x2ea1b3,function(_0x64cfb7){if(_0x64cfb7[_0xae50('0x2c')]!=='VIRTUAL'){var _0xb515b9={};_0xb515b9[_0x64cfb7[_0xae50('0x26')]]={'$like':'%'+_0x46282b['query'][_0xae50('0x3a')]+'%'};return _0xb515b9;}})});}_0x5c22e6=_['merge']({},_0x5c22e6,_0x46282b[_0xae50('0x3d')]);var _0x492a29={'where':_0x5c22e6[_0xae50('0x3b')]};return db[_0xae50('0x29')][_0xae50('0x1f')](_0x492a29)[_0xae50('0x3e')](function(_0x41bb26){_0x185daf[_0xae50('0x1f')]=_0x41bb26;if(_0x46282b[_0xae50('0x2e')][_0xae50('0x3f')]){_0x5c22e6['include']=[{'all':!![]}];}return db[_0xae50('0x29')][_0xae50('0x40')](_0x5c22e6);})[_0xae50('0x3e')](function(_0x37f61d){_0x185daf[_0xae50('0x41')]=_0x37f61d;return _0x185daf;})[_0xae50('0x3e')](respondWithFilteredResult(_0x123ca1,_0x5c22e6))[_0xae50('0x42')](handleError(_0x123ca1,null));};exports[_0xae50('0x43')]=function(_0x71c201,_0x1ceb2f){var _0x4135c3={'raw':![],'where':{'id':_0x71c201[_0xae50('0x44')]['id']}},_0x3aaf1f={};_0x3aaf1f['model']=_[_0xae50('0x45')](db[_0xae50('0x29')][_0xae50('0x2a')]);_0x3aaf1f[_0xae50('0x2e')]=_[_0xae50('0x45')](_0x71c201[_0xae50('0x2e')]);_0x3aaf1f[_0xae50('0x2f')]=_[_0xae50('0x30')](_0x3aaf1f['model'],_0x3aaf1f[_0xae50('0x2e')]);_0x4135c3[_0xae50('0x32')]=_[_0xae50('0x30')](_0x3aaf1f[_0xae50('0x31')],qs[_0xae50('0x33')](_0x71c201[_0xae50('0x2e')][_0xae50('0x33')]));_0x4135c3[_0xae50('0x32')]=_0x4135c3[_0xae50('0x32')][_0xae50('0x34')]?_0x4135c3['attributes']:_0x3aaf1f[_0xae50('0x31')];if(_0x71c201[_0xae50('0x2e')][_0xae50('0x3f')]){_0x4135c3[_0xae50('0x46')]=[{'all':!![]}];}_0x4135c3=_[_0xae50('0x3c')]({},_0x4135c3,_0x71c201['options']);return db['AnalyticFieldReport']['find'](_0x4135c3)[_0xae50('0x3e')](handleEntityNotFound(_0x1ceb2f,null))['then'](respondWithResult(_0x1ceb2f,null))[_0xae50('0x42')](handleError(_0x1ceb2f,null));};exports[_0xae50('0x47')]=function(_0x39f8c3,_0x5897d9){return db[_0xae50('0x29')][_0xae50('0x47')](_0x39f8c3[_0xae50('0x48')],{})[_0xae50('0x3e')](respondWithResult(_0x5897d9,0xc9))['catch'](handleError(_0x5897d9,null));};exports['bulkCreate']=function(_0x45dcfc,_0xa0966c){return db[_0xae50('0x29')]['bulkCreate'](_0x45dcfc[_0xae50('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xa0966c,0xc9))[_0xae50('0x42')](handleError(_0xa0966c,null));};exports[_0xae50('0x23')]=function(_0x2715b0,_0x298b58){if(_0x2715b0[_0xae50('0x48')]['id']){delete _0x2715b0['body']['id'];}return db[_0xae50('0x29')][_0xae50('0x49')]({'where':{'id':_0x2715b0[_0xae50('0x44')]['id']}})['then'](handleEntityNotFound(_0x298b58,null))['then'](saveUpdates(_0x2715b0['body'],null))[_0xae50('0x3e')](respondWithResult(_0x298b58,null))['catch'](handleError(_0x298b58,null));};exports[_0xae50('0x24')]=function(_0x1ba142,_0x309d8a){return db['AnalyticFieldReport'][_0xae50('0x49')]({'where':{'id':_0x1ba142[_0xae50('0x44')]['id']}})[_0xae50('0x3e')](handleEntityNotFound(_0x309d8a,null))['then'](removeEntity(_0x309d8a,null))[_0xae50('0x42')](handleError(_0x309d8a,null));};exports[_0xae50('0x4a')]=function(_0x525606,_0x10d03c){return db[_0xae50('0x29')][_0xae50('0x24')]({'where':{'id':_0x525606[_0xae50('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x10d03c,0xcc))['catch'](handleError(_0x10d03c,null));};exports['addFields']=function(_0x4eb21d,_0x7bea9f,_0x6e6436){return db['AnalyticCustomReport'][_0xae50('0x4b')]({'where':{'id':_0x4eb21d['params']['id']}})['then'](handleEntityNotFound(_0x7bea9f,null))['then'](function(_0x59fa35){if(_0x59fa35){return db[_0xae50('0x4c')][_0xae50('0x4d')](function(_0x408b13){return db[_0xae50('0x29')][_0xae50('0x24')]({'where':{'CustomReportId':_0x4eb21d[_0xae50('0x44')]['id']},'transaction':_0x408b13})['then'](function(_0x57d968){var _0x566bdb=_[_0xae50('0x28')](_0x4eb21d[_0xae50('0x48')],function(_0x5982d0){delete _0x5982d0['id'];_0x5982d0[_0xae50('0x4e')]=_0x4eb21d[_0xae50('0x44')]['id'];return _0x5982d0;});return db['AnalyticFieldReport']['bulkCreate'](_0x566bdb,{'transaction':_0x408b13});});})['then'](function(){return db[_0xae50('0x29')][_0xae50('0x40')]({'where':{'CustomReportId':_0x4eb21d[_0xae50('0x44')]['id']}});});}})[_0xae50('0x3e')](respondWithResult(_0x7bea9f,null))[_0xae50('0x42')](handleError(_0x7bea9f,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ac6b132..ef9e257 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 _0xcc81=['define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x1f4e23,_0x3115f8){var _0x402870=function(_0xfee0d8){while(--_0xfee0d8){_0x1f4e23['push'](_0x1f4e23['shift']());}};_0x402870(++_0x3115f8);}(_0xcc81,0x16b));var _0x1cc8=function(_0x17df16,_0x84c577){_0x17df16=_0x17df16-0x0;var _0x1ba549=_0xcc81[_0x17df16];return _0x1ba549;};'use strict';var _=require('lodash');var util=require(_0x1cc8('0x0'));var logger=require(_0x1cc8('0x1'))(_0x1cc8('0x2'));var moment=require(_0x1cc8('0x3'));var BPromise=require(_0x1cc8('0x4'));var rp=require(_0x1cc8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1cc8('0x6'));var config=require('../../config/environment');var attributes=require(_0x1cc8('0x7'));module[_0x1cc8('0x8')]=function(_0x4b20c1,_0x21e5fa){return _0x4b20c1[_0x1cc8('0x9')](_0x1cc8('0xa'),attributes,{'tableName':_0x1cc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4aa=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','analytics_report_fields'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb4aa,0x12c));var _0xab4a=function(_0x502642,_0x5988bb){_0x502642=_0x502642-0x0;var _0x109b0f=_0xb4aa[_0x502642];return _0x109b0f;};'use strict';var _=require(_0xab4a('0x0'));var util=require('util');var logger=require(_0xab4a('0x1'))(_0xab4a('0x2'));var moment=require('moment');var BPromise=require(_0xab4a('0x3'));var rp=require(_0xab4a('0x4'));var fs=require('fs');var path=require(_0xab4a('0x5'));var rimraf=require(_0xab4a('0x6'));var config=require(_0xab4a('0x7'));var attributes=require(_0xab4a('0x8'));module['exports']=function(_0x5d5d28,_0x1d42c7){return _0x5d5d28['define']('AnalyticFieldReport',attributes,{'tableName':_0xab4a('0x9'),'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 9659f11..90f382f 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 _0x42e5=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x42e5,0xa9));var _0x542e=function(_0x70a4e2,_0x1b833a){_0x70a4e2=_0x70a4e2-0x0;var _0x4d1d1e=_0x42e5[_0x70a4e2];return _0x4d1d1e;};'use strict';var _=require(_0x542e('0x0'));var util=require(_0x542e('0x1'));var moment=require(_0x542e('0x2'));var BPromise=require(_0x542e('0x3'));var rs=require(_0x542e('0x4'));var fs=require('fs');var Redis=require(_0x542e('0x5'));var db=require(_0x542e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x542e('0x7'))(_0x542e('0x8'));var config=require(_0x542e('0x9'));var jayson=require(_0x542e('0xa'));var client=jayson[_0x542e('0xb')][_0x542e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x517227,_0x4f334d,_0x43d194){return new BPromise(function(_0x360481,_0x71c894){return client[_0x542e('0xd')](_0x517227,_0x43d194)[_0x542e('0xe')](function(_0x29d13e){logger[_0x542e('0xf')](_0x542e('0x10'),_0x4f334d,'request\x20sent');logger[_0x542e('0x11')](_0x542e('0x12'),_0x4f334d,_0x542e('0x13'),JSON[_0x542e('0x14')](_0x29d13e));if(_0x29d13e['error']){if(_0x29d13e[_0x542e('0x15')]['code']===0x1f4){logger[_0x542e('0x15')](_0x542e('0x10'),_0x4f334d,_0x29d13e[_0x542e('0x15')][_0x542e('0x16')]);return _0x71c894(_0x29d13e['error'][_0x542e('0x16')]);}logger['error'](_0x542e('0x10'),_0x4f334d,_0x29d13e[_0x542e('0x15')][_0x542e('0x16')]);return _0x360481(_0x29d13e[_0x542e('0x15')][_0x542e('0x16')]);}else{logger[_0x542e('0xf')](_0x542e('0x10'),_0x4f334d,_0x542e('0x13'));_0x360481(_0x29d13e[_0x542e('0x17')][_0x542e('0x16')]);}})[_0x542e('0x18')](function(_0x229242){logger[_0x542e('0x15')](_0x542e('0x10'),_0x4f334d,_0x229242);_0x71c894(_0x229242);});});} \ No newline at end of file +var _0x71c0=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f53a6,_0x582ff5){var _0x30e4b7=function(_0x1aaf04){while(--_0x1aaf04){_0x4f53a6['push'](_0x4f53a6['shift']());}};_0x30e4b7(++_0x582ff5);}(_0x71c0,0x118));var _0x071c=function(_0x24abec,_0x30ff71){_0x24abec=_0x24abec-0x0;var _0x132716=_0x71c0[_0x24abec];return _0x132716;};'use strict';var _=require(_0x071c('0x0'));var util=require(_0x071c('0x1'));var moment=require(_0x071c('0x2'));var BPromise=require(_0x071c('0x3'));var rs=require(_0x071c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x071c('0x5'))['db'];var utils=require(_0x071c('0x6'));var logger=require(_0x071c('0x7'))(_0x071c('0x8'));var config=require(_0x071c('0x9'));var jayson=require(_0x071c('0xa'));var client=jayson['client'][_0x071c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12cf52,_0x4ccd7e,_0x522107){return new BPromise(function(_0x111f03,_0x41d46c){return client['request'](_0x12cf52,_0x522107)[_0x071c('0xc')](function(_0x134f12){logger[_0x071c('0xd')](_0x071c('0xe'),_0x4ccd7e,_0x071c('0xf'));logger[_0x071c('0x10')](_0x071c('0x11'),_0x4ccd7e,'request\x20sent',JSON[_0x071c('0x12')](_0x134f12));if(_0x134f12[_0x071c('0x13')]){if(_0x134f12['error'][_0x071c('0x14')]===0x1f4){logger[_0x071c('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ccd7e,_0x134f12[_0x071c('0x13')][_0x071c('0x15')]);return _0x41d46c(_0x134f12[_0x071c('0x13')][_0x071c('0x15')]);}logger[_0x071c('0x13')](_0x071c('0xe'),_0x4ccd7e,_0x134f12[_0x071c('0x13')][_0x071c('0x15')]);return _0x111f03(_0x134f12[_0x071c('0x13')]['message']);}else{logger['info'](_0x071c('0xe'),_0x4ccd7e,_0x071c('0xf'));_0x111f03(_0x134f12['result'][_0x071c('0x15')]);}})[_0x071c('0x16')](function(_0xdc5c4d){logger[_0x071c('0x13')](_0x071c('0xe'),_0x4ccd7e,_0xdc5c4d);_0x41d46c(_0xdc5c4d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 69a8ac5..bf9556e 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(_0x2aa05a,_0x3ed849){var _0x56e0a2=function(_0x556233){while(--_0x556233){_0x2aa05a['push'](_0x2aa05a['shift']());}};_0x56e0a2(++_0x3ed849);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x5aee33,_0x40d82e){var _0x1f35d4=function(_0x46f266){while(--_0x46f266){_0x5aee33['push'](_0x5aee33['shift']());}};_0x1f35d4(++_0x40d82e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var 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 1d5a911..b986f3d 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 _0x0427=['name','TEXT','STRING'];(function(_0x14faf6,_0x4ad659){var _0x5e34c0=function(_0x55f1e6){while(--_0x55f1e6){_0x14faf6['push'](_0x14faf6['shift']());}};_0x5e34c0(++_0x4ad659);}(_0x0427,0x137));var _0x7042=function(_0x1064b8,_0x32e8ac){_0x1064b8=_0x1064b8-0x0;var _0x4a53bd=_0x0427[_0x1064b8];return _0x4a53bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7042('0x0')],'allowNull':![],'unique':_0x7042('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7042('0x2')]},'description':{'type':Sequelize[_0x7042('0x0')]}}; \ No newline at end of file +var _0x9354=['exports','STRING','TEXT'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x9354,0x96));var _0x4935=function(_0x381d3c,_0x4bc7d0){_0x381d3c=_0x381d3c-0x0;var _0x12542e=_0x9354[_0x381d3c];return _0x12542e;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x4935('0x1')]},'metric':{'type':Sequelize[_0x4935('0x2')]},'description':{'type':Sequelize[_0x4935('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ca82f39..4ee9e3a 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x183d81,_0x571915){_0x183d81=_0x183d81-0x0;var _0x14963b=_0x1cb9[_0x183d81];return _0x14963b;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5a103c,_0x17693f){var _0x31a685=function(_0x3ac647){while(--_0x3ac647){_0x5a103c['push'](_0x5a103c['shift']());}};_0x31a685(++_0x17693f);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xa410cc,_0x4c49e2){_0xa410cc=_0xa410cc-0x0;var _0x2d615c=_0xdbf5[_0xa410cc];return _0x2d615c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 436d3a3..4a10732 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 _0xbd0a=['analytics_metrics','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xbd0a,0x1b9));var _0xabd0=function(_0xcc314d,_0x14c072){_0xcc314d=_0xcc314d-0x0;var _0x1e4ede=_0xbd0a[_0xcc314d];return _0x1e4ede;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var logger=require(_0xabd0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabd0('0x2'));var fs=require('fs');var path=require(_0xabd0('0x3'));var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x221368,_0xb41697){return _0x221368[_0xabd0('0x8')]('AnalyticMetric',attributes,{'tableName':_0xabd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3595=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e36e5,_0x5c2728){var _0x23cb91=function(_0x4740b5){while(--_0x4740b5){_0x4e36e5['push'](_0x4e36e5['shift']());}};_0x23cb91(++_0x5c2728);}(_0x3595,0x147));var _0x5359=function(_0x33501a,_0x110e40){_0x33501a=_0x33501a-0x0;var _0x3fb639=_0x3595[_0x33501a];return _0x3fb639;};'use strict';var _=require(_0x5359('0x0'));var util=require(_0x5359('0x1'));var logger=require(_0x5359('0x2'))('api');var moment=require(_0x5359('0x3'));var BPromise=require(_0x5359('0x4'));var rp=require(_0x5359('0x5'));var fs=require('fs');var path=require(_0x5359('0x6'));var rimraf=require(_0x5359('0x7'));var config=require(_0x5359('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x1cb891,_0x24545a){return _0x1cb891[_0x5359('0x9')](_0x5359('0xa'),attributes,{'tableName':_0x5359('0xb'),'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 e52c53a..ba9fc87 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 _0x1242=['../../config/environment','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5503a0,_0xf122bf){var _0x4b29ca=function(_0x2a35dd){while(--_0x2a35dd){_0x5503a0['push'](_0x5503a0['shift']());}};_0x4b29ca(++_0xf122bf);}(_0x1242,0x1c6));var _0x2124=function(_0x4f3dcf,_0x5326f4){_0x4f3dcf=_0x4f3dcf-0x0;var _0x13ed0c=_0x1242[_0x4f3dcf];return _0x13ed0c;};'use strict';var _=require(_0x2124('0x0'));var util=require('util');var moment=require(_0x2124('0x1'));var BPromise=require(_0x2124('0x2'));var rs=require(_0x2124('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2124('0x4'))['db'];var utils=require(_0x2124('0x5'));var logger=require(_0x2124('0x6'))(_0x2124('0x7'));var config=require(_0x2124('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38e23f,_0x319cbf,_0x50f442){return new BPromise(function(_0x48e3a7,_0x4c16ae){return client[_0x2124('0x9')](_0x38e23f,_0x50f442)[_0x2124('0xa')](function(_0x3b3e2e){logger[_0x2124('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x319cbf,_0x2124('0xc'));logger[_0x2124('0xd')](_0x2124('0xe'),_0x319cbf,_0x2124('0xc'),JSON[_0x2124('0xf')](_0x3b3e2e));if(_0x3b3e2e[_0x2124('0x10')]){if(_0x3b3e2e['error'][_0x2124('0x11')]===0x1f4){logger[_0x2124('0x10')](_0x2124('0x12'),_0x319cbf,_0x3b3e2e['error']['message']);return _0x4c16ae(_0x3b3e2e[_0x2124('0x10')][_0x2124('0x13')]);}logger[_0x2124('0x10')](_0x2124('0x12'),_0x319cbf,_0x3b3e2e['error']['message']);return _0x48e3a7(_0x3b3e2e[_0x2124('0x10')][_0x2124('0x13')]);}else{logger[_0x2124('0xb')](_0x2124('0x12'),_0x319cbf,_0x2124('0xc'));_0x48e3a7(_0x3b3e2e['result']['message']);}})[_0x2124('0x14')](function(_0x2df3e3){logger[_0x2124('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x319cbf,_0x2df3e3);_0x4c16ae(_0x2df3e3);});});} \ No newline at end of file +var _0xe42b=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticMetric,\x20%s,\x20%s','catch'];(function(_0x3cbd99,_0x2ac2c3){var _0x54de8d=function(_0x2cbaaf){while(--_0x2cbaaf){_0x3cbd99['push'](_0x3cbd99['shift']());}};_0x54de8d(++_0x2ac2c3);}(_0xe42b,0x12b));var _0xbe42=function(_0x1e21bc,_0x5a5e48){_0x1e21bc=_0x1e21bc-0x0;var _0x53d0df=_0xe42b[_0x1e21bc];return _0x53d0df;};'use strict';var _=require(_0xbe42('0x0'));var util=require(_0xbe42('0x1'));var moment=require(_0xbe42('0x2'));var BPromise=require(_0xbe42('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe42('0x4'));var db=require(_0xbe42('0x5'))['db'];var utils=require(_0xbe42('0x6'));var logger=require(_0xbe42('0x7'))(_0xbe42('0x8'));var config=require(_0xbe42('0x9'));var jayson=require(_0xbe42('0xa'));var client=jayson[_0xbe42('0xb')][_0xbe42('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x551ea8,_0x529aa8,_0x2099ce){return new BPromise(function(_0x30c133,_0x2fdd51){return client[_0xbe42('0xd')](_0x551ea8,_0x2099ce)['then'](function(_0x56b7d8){logger[_0xbe42('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x529aa8,_0xbe42('0xf'));logger['debug'](_0xbe42('0x10'),_0x529aa8,_0xbe42('0xf'),JSON[_0xbe42('0x11')](_0x56b7d8));if(_0x56b7d8['error']){if(_0x56b7d8['error'][_0xbe42('0x12')]===0x1f4){logger[_0xbe42('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x529aa8,_0x56b7d8[_0xbe42('0x13')][_0xbe42('0x14')]);return _0x2fdd51(_0x56b7d8[_0xbe42('0x13')]['message']);}logger['error'](_0xbe42('0x15'),_0x529aa8,_0x56b7d8[_0xbe42('0x13')][_0xbe42('0x14')]);return _0x30c133(_0x56b7d8['error']['message']);}else{logger[_0xbe42('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x529aa8,_0xbe42('0xf'));_0x30c133(_0x56b7d8['result']['message']);}})[_0xbe42('0x16')](function(_0x59751e){logger[_0xbe42('0x13')](_0xbe42('0x15'),_0x529aa8,_0x59751e);_0x2fdd51(_0x59751e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8f4da31..96356f1 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 _0x737d=['index','/:id','show','post','put','update','delete','destroy','multer','util','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x388a71,_0x425a15){var _0x28c528=function(_0x5f3d54){while(--_0x5f3d54){_0x388a71['push'](_0x388a71['shift']());}};_0x28c528(++_0x425a15);}(_0x737d,0xbc));var _0xd737=function(_0x207f01,_0x4b3b74){_0x207f01=_0x207f01-0x0;var _0x37ff88=_0x737d[_0x207f01];return _0x37ff88;};'use strict';var multer=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd737('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xd737('0x3'));var config=require('../../config/environment');var controller=require(_0xd737('0x4'));router[_0xd737('0x5')]('/',auth[_0xd737('0x6')](),controller[_0xd737('0x7')]);router[_0xd737('0x5')](_0xd737('0x8'),auth[_0xd737('0x6')](),controller[_0xd737('0x9')]);router[_0xd737('0xa')]('/',auth[_0xd737('0x6')](),controller['create']);router[_0xd737('0xb')](_0xd737('0x8'),auth['isAuthenticated'](),controller[_0xd737('0xc')]);router[_0xd737('0xd')]('/:id',auth[_0xd737('0x6')](),controller[_0xd737('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4813=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xd5f3e7,_0x10b90d){var _0x85fd74=function(_0x122e6d){while(--_0x122e6d){_0xd5f3e7['push'](_0xd5f3e7['shift']());}};_0x85fd74(++_0x10b90d);}(_0x4813,0x14e));var _0x3481=function(_0xafd2b1,_0x10daef){_0xafd2b1=_0xafd2b1-0x0;var _0x439546=_0x4813[_0xafd2b1];return _0x439546;};'use strict';var multer=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var path=require(_0x3481('0x2'));var timeout=require(_0x3481('0x3'));var express=require(_0x3481('0x4'));var router=express[_0x3481('0x5')]();var fs_extra=require(_0x3481('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3481('0x7'));var config=require(_0x3481('0x8'));var controller=require(_0x3481('0x9'));router[_0x3481('0xa')]('/',auth[_0x3481('0xb')](),controller['index']);router['get'](_0x3481('0xc'),auth['isAuthenticated'](),controller[_0x3481('0xd')]);router[_0x3481('0xe')]('/',auth[_0x3481('0xb')](),controller['create']);router['put']('/:id',auth[_0x3481('0xb')](),controller['update']);router['delete'](_0x3481('0xc'),auth[_0x3481('0xb')](),controller[_0x3481('0xf')]);module[_0x3481('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a031820..c576237 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 _0xae16=['exports','sequelize'];(function(_0x51bc14,_0x3ee2c6){var _0x469aa3=function(_0x43b32d){while(--_0x43b32d){_0x51bc14['push'](_0x51bc14['shift']());}};_0x469aa3(++_0x3ee2c6);}(_0xae16,0x1c5));var _0x6ae1=function(_0x416c00,_0x24d9f2){_0x416c00=_0x416c00-0x0;var _0x221442=_0xae16[_0x416c00];return _0x221442;};'use strict';var Sequelize=require(_0x6ae1('0x0'));module[_0x6ae1('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xdf63=['exports','TEXT'];(function(_0x39f291,_0x669b41){var _0xec9552=function(_0x1f9cd4){while(--_0x1f9cd4){_0x39f291['push'](_0x39f291['shift']());}};_0xec9552(++_0x669b41);}(_0xdf63,0x1ec));var _0x3df6=function(_0x2b68fc,_0x10362e){_0x2b68fc=_0x2b68fc-0x0;var _0x2e3490=_0xdf63[_0x2b68fc];return _0x2e3490;};'use strict';var Sequelize=require('sequelize');module[_0x3df6('0x0')]={'tree':{'type':Sequelize[_0x3df6('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 8e9c1f0..4262d64 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 _0xd7c4=['path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0xca1acb,_0x3963e8){var _0x1dded7=function(_0x17f78e){while(--_0x17f78e){_0xca1acb['push'](_0xca1acb['shift']());}};_0x1dded7(++_0x3963e8);}(_0xd7c4,0x91));var _0x4d7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4d7c('0x0'));var rimraf=require(_0x4d7c('0x1'));var zipdir=require(_0x4d7c('0x2'));var jsonpatch=require(_0x4d7c('0x3'));var rp=require(_0x4d7c('0x4'));var moment=require('moment');var BPromise=require(_0x4d7c('0x5'));var Mustache=require('mustache');var util=require(_0x4d7c('0x6'));var path=require(_0x4d7c('0x7'));var sox=require(_0x4d7c('0x8'));var csv=require(_0x4d7c('0x9'));var ejs=require(_0x4d7c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d7c('0xb'));var squel=require('squel');var crypto=require(_0x4d7c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d7c('0x9'));var querystring=require(_0x4d7c('0xd'));var Papa=require(_0x4d7c('0xe'));var Redis=require(_0x4d7c('0xf'));var authService=require(_0x4d7c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d7c('0x11'));var hardwareService=require(_0x4d7c('0x12'));var logger=require(_0x4d7c('0x13'))(_0x4d7c('0x14'));var utils=require(_0x4d7c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4d7c('0x16'));var db=require(_0x4d7c('0x17'))['db'];function respondWithStatusCode(_0x4a3da0,_0x262cbc){_0x262cbc=_0x262cbc||0xcc;return function(_0x20e08c){if(_0x20e08c){return _0x4a3da0[_0x4d7c('0x18')](_0x262cbc);}return _0x4a3da0[_0x4d7c('0x19')](_0x262cbc)[_0x4d7c('0x1a')]();};}function respondWithResult(_0xeb4116,_0x44d27e){_0x44d27e=_0x44d27e||0xc8;return function(_0x40cf40){if(_0x40cf40){return _0xeb4116[_0x4d7c('0x19')](_0x44d27e)[_0x4d7c('0x1b')](_0x40cf40);}};}function respondWithFilteredResult(_0x1962f4,_0x18cc06){return function(_0x51af15){if(_0x51af15){var _0x29c1e0=typeof _0x18cc06['offset']==='undefined'&&typeof _0x18cc06['limit']===_0x4d7c('0x1c');var _0x7a5fc8=_0x51af15[_0x4d7c('0x1d')];var _0x3cbed7=_0x29c1e0?0x0:_0x18cc06[_0x4d7c('0x1e')];var _0x5a418f=_0x29c1e0?_0x51af15[_0x4d7c('0x1d')]:_0x18cc06[_0x4d7c('0x1e')]+_0x18cc06[_0x4d7c('0x1f')];var _0x16d174;if(_0x5a418f>=_0x7a5fc8){_0x5a418f=_0x7a5fc8;_0x16d174=0xc8;}else{_0x16d174=0xce;}_0x1962f4[_0x4d7c('0x19')](_0x16d174);return _0x1962f4[_0x4d7c('0x20')](_0x4d7c('0x21'),_0x3cbed7+'-'+_0x5a418f+'/'+_0x7a5fc8)[_0x4d7c('0x1b')](_0x51af15);}return null;};}function patchUpdates(_0x151daf){return function(_0x354e25){try{jsonpatch[_0x4d7c('0x22')](_0x354e25,_0x151daf,!![]);}catch(_0x3d6fdc){return BPromise[_0x4d7c('0x23')](_0x3d6fdc);}return _0x354e25[_0x4d7c('0x24')]();};}function saveUpdates(_0x555bb2,_0x361e84){return function(_0x2be66e){if(_0x2be66e){return _0x2be66e[_0x4d7c('0x25')](_0x555bb2)[_0x4d7c('0x26')](function(_0x955c61){return _0x955c61;});}return null;};}function removeEntity(_0x40a55f,_0x522579){return function(_0x3ef888){if(_0x3ef888){return _0x3ef888[_0x4d7c('0x27')]()[_0x4d7c('0x26')](function(){_0x40a55f[_0x4d7c('0x19')](0xcc)[_0x4d7c('0x1a')]();});}};}function handleEntityNotFound(_0x13d47a,_0x4c05d7){return function(_0x4a7752){if(!_0x4a7752){_0x13d47a['sendStatus'](0x194);}return _0x4a7752;};}function handleError(_0x96a51c,_0x41dbaa){_0x41dbaa=_0x41dbaa||0x1f4;return function(_0x648163){logger['error'](_0x648163[_0x4d7c('0x28')]);if(_0x648163[_0x4d7c('0x29')]){delete _0x648163[_0x4d7c('0x29')];}_0x96a51c[_0x4d7c('0x19')](_0x41dbaa)[_0x4d7c('0x2a')](_0x648163);};}exports[_0x4d7c('0x2b')]=function(_0x252009,_0x4f4b07){var _0x15bb38={},_0x250c26={},_0x5ad024={'count':0x0,'rows':[]};var _0x328bdb=_[_0x4d7c('0x2c')](db[_0x4d7c('0x2d')][_0x4d7c('0x2e')],function(_0xbf727a){return{'name':_0xbf727a['fieldName'],'type':_0xbf727a[_0x4d7c('0x2f')][_0x4d7c('0x30')]};});_0x250c26[_0x4d7c('0x31')]=_[_0x4d7c('0x2c')](_0x328bdb,_0x4d7c('0x29'));_0x250c26['query']=_[_0x4d7c('0x32')](_0x252009[_0x4d7c('0x33')]);_0x250c26[_0x4d7c('0x34')]=_[_0x4d7c('0x35')](_0x250c26['model'],_0x250c26[_0x4d7c('0x33')]);_0x15bb38[_0x4d7c('0x36')]=_[_0x4d7c('0x35')](_0x250c26[_0x4d7c('0x31')],qs[_0x4d7c('0x37')](_0x252009['query'][_0x4d7c('0x37')]));_0x15bb38[_0x4d7c('0x36')]=_0x15bb38[_0x4d7c('0x36')][_0x4d7c('0x38')]?_0x15bb38['attributes']:_0x250c26['model'];if(!_0x252009[_0x4d7c('0x33')][_0x4d7c('0x39')](_0x4d7c('0x3a'))){_0x15bb38['limit']=qs[_0x4d7c('0x1f')](_0x252009[_0x4d7c('0x33')][_0x4d7c('0x1f')]);_0x15bb38[_0x4d7c('0x1e')]=qs[_0x4d7c('0x1e')](_0x252009['query']['offset']);}_0x15bb38[_0x4d7c('0x3b')]=qs['sort'](_0x252009[_0x4d7c('0x33')][_0x4d7c('0x3c')]);_0x15bb38[_0x4d7c('0x3d')]=qs['filters'](_[_0x4d7c('0x3e')](_0x252009[_0x4d7c('0x33')],_0x250c26[_0x4d7c('0x34')]),_0x328bdb);if(_0x252009[_0x4d7c('0x33')][_0x4d7c('0x3f')]){_0x15bb38['where']=_['merge'](_0x15bb38[_0x4d7c('0x3d')],{'$or':_[_0x4d7c('0x2c')](_0x328bdb,function(_0x2d2ada){if(_0x2d2ada[_0x4d7c('0x2f')]!==_0x4d7c('0x40')){var _0x4090d6={};_0x4090d6[_0x2d2ada[_0x4d7c('0x29')]]={'$like':'%'+_0x252009[_0x4d7c('0x33')][_0x4d7c('0x3f')]+'%'};return _0x4090d6;}})});}_0x15bb38=_[_0x4d7c('0x41')]({},_0x15bb38,_0x252009['options']);var _0x436f6a={'where':_0x15bb38[_0x4d7c('0x3d')]};return db[_0x4d7c('0x2d')][_0x4d7c('0x1d')](_0x436f6a)[_0x4d7c('0x26')](function(_0x217665){_0x5ad024[_0x4d7c('0x1d')]=_0x217665;if(_0x252009[_0x4d7c('0x33')][_0x4d7c('0x42')]){_0x15bb38[_0x4d7c('0x43')]=[{'all':!![]}];}return db[_0x4d7c('0x2d')][_0x4d7c('0x44')](_0x15bb38);})['then'](function(_0x4fa31a){_0x5ad024[_0x4d7c('0x45')]=_0x4fa31a;return _0x5ad024;})[_0x4d7c('0x26')](respondWithFilteredResult(_0x4f4b07,_0x15bb38))[_0x4d7c('0x46')](handleError(_0x4f4b07,null));};exports['show']=function(_0x5d6026,_0x54066e){var _0xe327ac={'raw':!![],'where':{'id':_0x5d6026[_0x4d7c('0x47')]['id']}},_0x3f494e={};_0x3f494e[_0x4d7c('0x31')]=_[_0x4d7c('0x32')](db[_0x4d7c('0x2d')][_0x4d7c('0x2e')]);_0x3f494e[_0x4d7c('0x33')]=_[_0x4d7c('0x32')](_0x5d6026[_0x4d7c('0x33')]);_0x3f494e['filters']=_['intersection'](_0x3f494e[_0x4d7c('0x31')],_0x3f494e[_0x4d7c('0x33')]);_0xe327ac[_0x4d7c('0x36')]=_['intersection'](_0x3f494e[_0x4d7c('0x31')],qs[_0x4d7c('0x37')](_0x5d6026['query'][_0x4d7c('0x37')]));_0xe327ac[_0x4d7c('0x36')]=_0xe327ac[_0x4d7c('0x36')][_0x4d7c('0x38')]?_0xe327ac[_0x4d7c('0x36')]:_0x3f494e[_0x4d7c('0x31')];if(_0x5d6026[_0x4d7c('0x33')]['includeAll']){_0xe327ac[_0x4d7c('0x43')]=[{'all':!![]}];}_0xe327ac=_[_0x4d7c('0x41')]({},_0xe327ac,_0x5d6026[_0x4d7c('0x48')]);return db[_0x4d7c('0x2d')][_0x4d7c('0x49')](_0xe327ac)[_0x4d7c('0x26')](handleEntityNotFound(_0x54066e,null))[_0x4d7c('0x26')](respondWithResult(_0x54066e,null))['catch'](handleError(_0x54066e,null));};exports[_0x4d7c('0x4a')]=function(_0xeff4b7,_0x402124){return db[_0x4d7c('0x2d')][_0x4d7c('0x4a')](_0xeff4b7[_0x4d7c('0x4b')],{})['then'](respondWithResult(_0x402124,0xc9))[_0x4d7c('0x46')](handleError(_0x402124,null));};exports[_0x4d7c('0x25')]=function(_0x5f4be7,_0xfd2560){if(_0x5f4be7['body']['id']){delete _0x5f4be7['body']['id'];}return db[_0x4d7c('0x2d')][_0x4d7c('0x49')]({'where':{'id':_0x5f4be7[_0x4d7c('0x47')]['id']}})['then'](handleEntityNotFound(_0xfd2560,null))[_0x4d7c('0x26')](saveUpdates(_0x5f4be7['body'],null))['then'](respondWithResult(_0xfd2560,null))['catch'](handleError(_0xfd2560,null));};exports['destroy']=function(_0x58175a,_0x37af7b){return db[_0x4d7c('0x2d')][_0x4d7c('0x49')]({'where':{'id':_0x58175a[_0x4d7c('0x47')]['id']}})[_0x4d7c('0x26')](handleEntityNotFound(_0x37af7b,null))[_0x4d7c('0x26')](removeEntity(_0x37af7b,null))[_0x4d7c('0x46')](handleError(_0x37af7b,null));}; \ No newline at end of file +var _0x8855=['then','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','count','limit','set','apply','reject','update','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8855,0x102));var _0x5885=function(_0xc7ad0b,_0x16e54e){_0xc7ad0b=_0xc7ad0b-0x0;var _0x51fe7e=_0x8855[_0xc7ad0b];return _0x51fe7e;};'use strict';var emlformat=require(_0x5885('0x0'));var rimraf=require(_0x5885('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5885('0x2'));var rp=require(_0x5885('0x3'));var moment=require(_0x5885('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5885('0x5'));var util=require(_0x5885('0x6'));var path=require(_0x5885('0x7'));var sox=require(_0x5885('0x8'));var csv=require(_0x5885('0x9'));var ejs=require(_0x5885('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5885('0xb'));var squel=require(_0x5885('0xc'));var crypto=require(_0x5885('0xd'));var jsforce=require(_0x5885('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5885('0x9'));var querystring=require(_0x5885('0xf'));var Papa=require(_0x5885('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5885('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5885('0x12'));var logger=require(_0x5885('0x13'))('api');var utils=require(_0x5885('0x14'));var config=require(_0x5885('0x15'));var licenseUtil=require(_0x5885('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf1d4,_0xa0b703){_0xa0b703=_0xa0b703||0xcc;return function(_0x9a8e69){if(_0x9a8e69){return _0x4bf1d4['sendStatus'](_0xa0b703);}return _0x4bf1d4[_0x5885('0x17')](_0xa0b703)[_0x5885('0x18')]();};}function respondWithResult(_0x265ac7,_0x29921d){_0x29921d=_0x29921d||0xc8;return function(_0x5a59c5){if(_0x5a59c5){return _0x265ac7[_0x5885('0x17')](_0x29921d)[_0x5885('0x19')](_0x5a59c5);}};}function respondWithFilteredResult(_0x3bd224,_0x49d078){return function(_0x595eb3){if(_0x595eb3){var _0x389427=typeof _0x49d078[_0x5885('0x1a')]==='undefined'&&typeof _0x49d078['limit']==='undefined';var _0x42f253=_0x595eb3[_0x5885('0x1b')];var _0x338f03=_0x389427?0x0:_0x49d078['offset'];var _0x46a627=_0x389427?_0x595eb3[_0x5885('0x1b')]:_0x49d078['offset']+_0x49d078[_0x5885('0x1c')];var _0xdf4150;if(_0x46a627>=_0x42f253){_0x46a627=_0x42f253;_0xdf4150=0xc8;}else{_0xdf4150=0xce;}_0x3bd224['status'](_0xdf4150);return _0x3bd224[_0x5885('0x1d')]('Content-Range',_0x338f03+'-'+_0x46a627+'/'+_0x42f253)[_0x5885('0x19')](_0x595eb3);}return null;};}function patchUpdates(_0x355978){return function(_0x1fd148){try{jsonpatch[_0x5885('0x1e')](_0x1fd148,_0x355978,!![]);}catch(_0x697421){return BPromise[_0x5885('0x1f')](_0x697421);}return _0x1fd148['save']();};}function saveUpdates(_0x4db3b9,_0x4ebc4e){return function(_0x5ed64f){if(_0x5ed64f){return _0x5ed64f[_0x5885('0x20')](_0x4db3b9)['then'](function(_0x4b8956){return _0x4b8956;});}return null;};}function removeEntity(_0x1c7c87,_0x15cc31){return function(_0x35f898){if(_0x35f898){return _0x35f898[_0x5885('0x21')]()[_0x5885('0x22')](function(){_0x1c7c87[_0x5885('0x17')](0xcc)[_0x5885('0x18')]();});}};}function handleEntityNotFound(_0x1542d7,_0x5333cd){return function(_0x496c5c){if(!_0x496c5c){_0x1542d7[_0x5885('0x23')](0x194);}return _0x496c5c;};}function handleError(_0x4e4ad6,_0x9983d0){_0x9983d0=_0x9983d0||0x1f4;return function(_0x45a58a){logger[_0x5885('0x24')](_0x45a58a[_0x5885('0x25')]);if(_0x45a58a[_0x5885('0x26')]){delete _0x45a58a[_0x5885('0x26')];}_0x4e4ad6[_0x5885('0x17')](_0x9983d0)[_0x5885('0x27')](_0x45a58a);};}exports[_0x5885('0x28')]=function(_0x1cdac7,_0x3ba7c3){var _0x10d990={},_0x255ea2={},_0x440c7b={'count':0x0,'rows':[]};var _0x137b83=_[_0x5885('0x29')](db[_0x5885('0x2a')][_0x5885('0x2b')],function(_0x4b944a){return{'name':_0x4b944a[_0x5885('0x2c')],'type':_0x4b944a[_0x5885('0x2d')][_0x5885('0x2e')]};});_0x255ea2[_0x5885('0x2f')]=_['map'](_0x137b83,_0x5885('0x26'));_0x255ea2[_0x5885('0x30')]=_[_0x5885('0x31')](_0x1cdac7[_0x5885('0x30')]);_0x255ea2[_0x5885('0x32')]=_[_0x5885('0x33')](_0x255ea2[_0x5885('0x2f')],_0x255ea2[_0x5885('0x30')]);_0x10d990[_0x5885('0x34')]=_[_0x5885('0x33')](_0x255ea2[_0x5885('0x2f')],qs[_0x5885('0x35')](_0x1cdac7[_0x5885('0x30')][_0x5885('0x35')]));_0x10d990[_0x5885('0x34')]=_0x10d990[_0x5885('0x34')][_0x5885('0x36')]?_0x10d990['attributes']:_0x255ea2[_0x5885('0x2f')];if(!_0x1cdac7[_0x5885('0x30')][_0x5885('0x37')]('nolimit')){_0x10d990[_0x5885('0x1c')]=qs['limit'](_0x1cdac7['query']['limit']);_0x10d990[_0x5885('0x1a')]=qs[_0x5885('0x1a')](_0x1cdac7['query'][_0x5885('0x1a')]);}_0x10d990[_0x5885('0x38')]=qs['sort'](_0x1cdac7[_0x5885('0x30')][_0x5885('0x39')]);_0x10d990[_0x5885('0x3a')]=qs['filters'](_[_0x5885('0x3b')](_0x1cdac7[_0x5885('0x30')],_0x255ea2[_0x5885('0x32')]),_0x137b83);if(_0x1cdac7[_0x5885('0x30')][_0x5885('0x3c')]){_0x10d990[_0x5885('0x3a')]=_[_0x5885('0x3d')](_0x10d990[_0x5885('0x3a')],{'$or':_['map'](_0x137b83,function(_0x301fc0){if(_0x301fc0['type']!==_0x5885('0x3e')){var _0x5bfd7f={};_0x5bfd7f[_0x301fc0[_0x5885('0x26')]]={'$like':'%'+_0x1cdac7[_0x5885('0x30')][_0x5885('0x3c')]+'%'};return _0x5bfd7f;}})});}_0x10d990=_[_0x5885('0x3d')]({},_0x10d990,_0x1cdac7[_0x5885('0x3f')]);var _0x3a5f87={'where':_0x10d990['where']};return db['AnalyticTreeReport']['count'](_0x3a5f87)[_0x5885('0x22')](function(_0x12e4db){_0x440c7b['count']=_0x12e4db;if(_0x1cdac7[_0x5885('0x30')][_0x5885('0x40')]){_0x10d990[_0x5885('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x10d990);})[_0x5885('0x22')](function(_0x353016){_0x440c7b[_0x5885('0x42')]=_0x353016;return _0x440c7b;})[_0x5885('0x22')](respondWithFilteredResult(_0x3ba7c3,_0x10d990))[_0x5885('0x43')](handleError(_0x3ba7c3,null));};exports[_0x5885('0x44')]=function(_0x2d187b,_0x506b7f){var _0x41712f={'raw':!![],'where':{'id':_0x2d187b['params']['id']}},_0x6f1b3c={};_0x6f1b3c[_0x5885('0x2f')]=_[_0x5885('0x31')](db[_0x5885('0x2a')]['rawAttributes']);_0x6f1b3c[_0x5885('0x30')]=_[_0x5885('0x31')](_0x2d187b[_0x5885('0x30')]);_0x6f1b3c[_0x5885('0x32')]=_[_0x5885('0x33')](_0x6f1b3c['model'],_0x6f1b3c[_0x5885('0x30')]);_0x41712f[_0x5885('0x34')]=_[_0x5885('0x33')](_0x6f1b3c[_0x5885('0x2f')],qs[_0x5885('0x35')](_0x2d187b[_0x5885('0x30')][_0x5885('0x35')]));_0x41712f[_0x5885('0x34')]=_0x41712f[_0x5885('0x34')][_0x5885('0x36')]?_0x41712f[_0x5885('0x34')]:_0x6f1b3c['model'];if(_0x2d187b[_0x5885('0x30')]['includeAll']){_0x41712f[_0x5885('0x41')]=[{'all':!![]}];}_0x41712f=_[_0x5885('0x3d')]({},_0x41712f,_0x2d187b[_0x5885('0x3f')]);return db[_0x5885('0x2a')][_0x5885('0x45')](_0x41712f)[_0x5885('0x22')](handleEntityNotFound(_0x506b7f,null))[_0x5885('0x22')](respondWithResult(_0x506b7f,null))[_0x5885('0x43')](handleError(_0x506b7f,null));};exports[_0x5885('0x46')]=function(_0x40fbb3,_0x4815b7){return db[_0x5885('0x2a')][_0x5885('0x46')](_0x40fbb3[_0x5885('0x47')],{})['then'](respondWithResult(_0x4815b7,0xc9))[_0x5885('0x43')](handleError(_0x4815b7,null));};exports[_0x5885('0x20')]=function(_0x2eb85a,_0x2c8d1e){if(_0x2eb85a[_0x5885('0x47')]['id']){delete _0x2eb85a['body']['id'];}return db['AnalyticTreeReport'][_0x5885('0x45')]({'where':{'id':_0x2eb85a[_0x5885('0x48')]['id']}})[_0x5885('0x22')](handleEntityNotFound(_0x2c8d1e,null))['then'](saveUpdates(_0x2eb85a['body'],null))['then'](respondWithResult(_0x2c8d1e,null))[_0x5885('0x43')](handleError(_0x2c8d1e,null));};exports[_0x5885('0x21')]=function(_0x721473,_0xf515a7){return db[_0x5885('0x2a')][_0x5885('0x45')]({'where':{'id':_0x721473[_0x5885('0x48')]['id']}})[_0x5885('0x22')](handleEntityNotFound(_0xf515a7,null))[_0x5885('0x22')](removeEntity(_0xf515a7,null))['catch'](handleError(_0xf515a7,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 687f75e..3395dbf 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 _0x1218=['define','AnalyticTreeReport','analytics_report_trees','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x1dec2b,_0x37c45e){var _0x3d6d2d=function(_0x16c2e0){while(--_0x16c2e0){_0x1dec2b['push'](_0x1dec2b['shift']());}};_0x3d6d2d(++_0x37c45e);}(_0x1218,0xea));var _0x8121=function(_0xb0f11f,_0x22ec3a){_0xb0f11f=_0xb0f11f-0x0;var _0x339748=_0x1218[_0xb0f11f];return _0x339748;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8121('0x0'));var moment=require(_0x8121('0x1'));var BPromise=require(_0x8121('0x2'));var rp=require(_0x8121('0x3'));var fs=require('fs');var path=require(_0x8121('0x4'));var rimraf=require(_0x8121('0x5'));var config=require(_0x8121('0x6'));var attributes=require(_0x8121('0x7'));module['exports']=function(_0x29e495,_0x5f291b){return _0x29e495[_0x8121('0x8')](_0x8121('0x9'),attributes,{'tableName':_0x8121('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x430d=['path','exports','define','lodash','moment','bluebird','request-promise'];(function(_0x215105,_0x5ed0cd){var _0x1beba1=function(_0x55380e){while(--_0x55380e){_0x215105['push'](_0x215105['shift']());}};_0x1beba1(++_0x5ed0cd);}(_0x430d,0x1ed));var _0xd430=function(_0x2cf94d,_0x224ff6){_0x2cf94d=_0x2cf94d-0x0;var _0xd8ac22=_0x430d[_0x2cf94d];return _0xd8ac22;};'use strict';var _=require(_0xd430('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd430('0x1'));var BPromise=require(_0xd430('0x2'));var rp=require(_0xd430('0x3'));var fs=require('fs');var path=require(_0xd430('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xd430('0x5')]=function(_0x3a77ce,_0x45d627){return _0x3a77ce[_0xd430('0x6')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 3daa5f5..3013a80 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(_0x4dcb59,_0x4de1f0){var _0x241074=function(_0x43e939){while(--_0x43e939){_0x4dcb59['push'](_0x4dcb59['shift']());}};_0x241074(++_0x4de1f0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2ca671,_0x316ea4){var _0x3d0348=function(_0x23cce0){while(--_0x23cce0){_0x2ca671['push'](_0x2ca671['shift']());}};_0x3d0348(++_0x316ea4);}(_0xdb28,0x106));var _0x8db2=function(_0x477906,_0x4ffa55){_0x477906=_0x477906-0x0;var _0x3ad34e=_0xdb28[_0x477906];return _0x3ad34e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 45818f6..93359c5 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 _0x32ad=['get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x4d0b5b,_0xf881c4){var _0x521856=function(_0x2e5d01){while(--_0x2e5d01){_0x4d0b5b['push'](_0x4d0b5b['shift']());}};_0x521856(++_0xf881c4);}(_0x32ad,0x1cd));var _0xd32a=function(_0x42fa1f,_0x1abc4b){_0x42fa1f=_0x42fa1f-0x0;var _0x1d70e6=_0x32ad[_0x42fa1f];return _0x1d70e6;};'use strict';var multer=require(_0xd32a('0x0'));var util=require('util');var path=require(_0xd32a('0x1'));var timeout=require(_0xd32a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd32a('0x3'));var interaction=require(_0xd32a('0x4'));var config=require(_0xd32a('0x5'));var controller=require(_0xd32a('0x6'));router[_0xd32a('0x7')]('/',auth[_0xd32a('0x8')](),controller[_0xd32a('0x9')]);router[_0xd32a('0x7')]('/:id',auth[_0xd32a('0x8')](),controller[_0xd32a('0xa')]);router[_0xd32a('0xb')]('/',auth[_0xd32a('0x8')](),controller[_0xd32a('0xc')]);router[_0xd32a('0xd')](_0xd32a('0xe'),auth[_0xd32a('0x8')](),controller[_0xd32a('0xf')]);router['delete'](_0xd32a('0xe'),auth[_0xd32a('0x8')](),controller[_0xd32a('0x10')]);module[_0xd32a('0x11')]=router; \ No newline at end of file +var _0x988a=['index','/:id','show','post','create','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x24dfb7,_0x2bf1bf){var _0x525851=function(_0xa8a946){while(--_0xa8a946){_0x24dfb7['push'](_0x24dfb7['shift']());}};_0x525851(++_0x2bf1bf);}(_0x988a,0x1ab));var _0xa988=function(_0x19a616,_0x4c5fba){_0x19a616=_0x19a616-0x0;var _0x3e92ee=_0x988a[_0x19a616];return _0x3e92ee;};'use strict';var multer=require(_0xa988('0x0'));var util=require('util');var path=require(_0xa988('0x1'));var timeout=require('connect-timeout');var express=require(_0xa988('0x2'));var router=express['Router']();var fs_extra=require(_0xa988('0x3'));var auth=require(_0xa988('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa988('0x5'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xa988('0x6')](),controller[_0xa988('0x7')]);router['get'](_0xa988('0x8'),auth['isAuthenticated'](),controller[_0xa988('0x9')]);router[_0xa988('0xa')]('/',auth['isAuthenticated'](),controller[_0xa988('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xa988('0x8'),auth[_0xa988('0x6')](),controller[_0xa988('0xc')]);module[_0xa988('0xd')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b33fb60..0ed3206 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 _0x86dd=['exports','STRING'];(function(_0x36f419,_0x3119dc){var _0x586722=function(_0xc58a17){while(--_0xc58a17){_0x36f419['push'](_0x36f419['shift']());}};_0x586722(++_0x3119dc);}(_0x86dd,0x1ee));var _0xd86d=function(_0x512adf,_0x2b206d){_0x512adf=_0x512adf-0x0;var _0x2f7646=_0x86dd[_0x512adf];return _0x2f7646;};'use strict';var Sequelize=require('sequelize');module[_0xd86d('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd86d('0x1')]},'type':{'type':Sequelize[_0xd86d('0x1')]}}; \ No newline at end of file +var _0x3098=['exports','STRING','sequelize'];(function(_0x163691,_0x3d10c4){var _0x543ae5=function(_0x4af2ea){while(--_0x4af2ea){_0x163691['push'](_0x163691['shift']());}};_0x543ae5(++_0x3d10c4);}(_0x3098,0x86));var _0x8309=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x3098[_0x400322];return _0xfdd597;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'name':{'type':Sequelize[_0x8309('0x2')]},'basename':{'type':Sequelize[_0x8309('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 9a9e26e..50dae33 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 _0x03dc=['server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','set','json','save','update','then','destroy','sendStatus','error','name','send','map','Attachment','fieldName','type','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','count','findAll','catch','params','rawAttributes','length','options','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03dc,0x1ee));var _0xc03d=function(_0x52dbd6,_0x4034f1){_0x52dbd6=_0x52dbd6-0x0;var _0x4d046d=_0x03dc[_0x52dbd6];return _0x4d046d;};'use strict';var emlformat=require(_0xc03d('0x0'));var rimraf=require(_0xc03d('0x1'));var zipdir=require(_0xc03d('0x2'));var jsonpatch=require(_0xc03d('0x3'));var rp=require('request-promise');var moment=require(_0xc03d('0x4'));var BPromise=require(_0xc03d('0x5'));var Mustache=require(_0xc03d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc03d('0x7'));var csv=require(_0xc03d('0x8'));var ejs=require(_0xc03d('0x9'));var fs=require('fs');var fs_extra=require(_0xc03d('0xa'));var _=require(_0xc03d('0xb'));var squel=require(_0xc03d('0xc'));var crypto=require(_0xc03d('0xd'));var jsforce=require(_0xc03d('0xe'));var deskjs=require(_0xc03d('0xf'));var toCsv=require(_0xc03d('0x8'));var querystring=require(_0xc03d('0x10'));var Papa=require(_0xc03d('0x11'));var Redis=require(_0xc03d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc03d('0x13'));var as=require(_0xc03d('0x14'));var hardwareService=require(_0xc03d('0x15'));var logger=require(_0xc03d('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc03d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc03d('0x18'))['db'];function respondWithStatusCode(_0x138bb2,_0x332ddc){_0x332ddc=_0x332ddc||0xcc;return function(_0x441bb1){if(_0x441bb1){return _0x138bb2['sendStatus'](_0x332ddc);}return _0x138bb2[_0xc03d('0x19')](_0x332ddc)[_0xc03d('0x1a')]();};}function respondWithResult(_0x4ec1f6,_0x50b69a){_0x50b69a=_0x50b69a||0xc8;return function(_0xf384f1){if(_0xf384f1){return _0x4ec1f6['status'](_0x50b69a)['json'](_0xf384f1);}};}function respondWithFilteredResult(_0x31db0a,_0x3f0da5){return function(_0x273dd5){if(_0x273dd5){var _0x344f90=typeof _0x3f0da5[_0xc03d('0x1b')]===_0xc03d('0x1c')&&typeof _0x3f0da5[_0xc03d('0x1d')]===_0xc03d('0x1c');var _0x23ad59=_0x273dd5['count'];var _0xe57ece=_0x344f90?0x0:_0x3f0da5[_0xc03d('0x1b')];var _0x4a4a9c=_0x344f90?_0x273dd5['count']:_0x3f0da5[_0xc03d('0x1b')]+_0x3f0da5[_0xc03d('0x1d')];var _0x4aa250;if(_0x4a4a9c>=_0x23ad59){_0x4a4a9c=_0x23ad59;_0x4aa250=0xc8;}else{_0x4aa250=0xce;}_0x31db0a[_0xc03d('0x19')](_0x4aa250);return _0x31db0a[_0xc03d('0x1e')]('Content-Range',_0xe57ece+'-'+_0x4a4a9c+'/'+_0x23ad59)[_0xc03d('0x1f')](_0x273dd5);}return null;};}function patchUpdates(_0x1b67d9){return function(_0x392eac){try{jsonpatch['apply'](_0x392eac,_0x1b67d9,!![]);}catch(_0x8c265){return BPromise['reject'](_0x8c265);}return _0x392eac[_0xc03d('0x20')]();};}function saveUpdates(_0x38ea15,_0x5d85ee){return function(_0x243321){if(_0x243321){return _0x243321[_0xc03d('0x21')](_0x38ea15)[_0xc03d('0x22')](function(_0x2a9629){return _0x2a9629;});}return null;};}function removeEntity(_0x5c2adf,_0xb6fb62){return function(_0x1b457c){if(_0x1b457c){return _0x1b457c[_0xc03d('0x23')]()[_0xc03d('0x22')](function(){_0x5c2adf['status'](0xcc)[_0xc03d('0x1a')]();});}};}function handleEntityNotFound(_0xc5e7ac,_0x355ec8){return function(_0x362d7c){if(!_0x362d7c){_0xc5e7ac[_0xc03d('0x24')](0x194);}return _0x362d7c;};}function handleError(_0x14c7ef,_0x43a899){_0x43a899=_0x43a899||0x1f4;return function(_0x3b4bbb){logger[_0xc03d('0x25')](_0x3b4bbb['stack']);if(_0x3b4bbb[_0xc03d('0x26')]){delete _0x3b4bbb['name'];}_0x14c7ef['status'](_0x43a899)[_0xc03d('0x27')](_0x3b4bbb);};}exports['index']=function(_0x18b558,_0x1371dd){var _0x3ca393={},_0x27a8f7={},_0x3cb37c={'count':0x0,'rows':[]};var _0x431a9d=_[_0xc03d('0x28')](db[_0xc03d('0x29')]['rawAttributes'],function(_0x3a78ef){return{'name':_0x3a78ef[_0xc03d('0x2a')],'type':_0x3a78ef[_0xc03d('0x2b')]['key']};});_0x27a8f7[_0xc03d('0x2c')]=_[_0xc03d('0x28')](_0x431a9d,_0xc03d('0x26'));_0x27a8f7['query']=_[_0xc03d('0x2d')](_0x18b558[_0xc03d('0x2e')]);_0x27a8f7[_0xc03d('0x2f')]=_['intersection'](_0x27a8f7['model'],_0x27a8f7[_0xc03d('0x2e')]);_0x3ca393[_0xc03d('0x30')]=_[_0xc03d('0x31')](_0x27a8f7['model'],qs[_0xc03d('0x32')](_0x18b558[_0xc03d('0x2e')]['fields']));_0x3ca393[_0xc03d('0x30')]=_0x3ca393[_0xc03d('0x30')]['length']?_0x3ca393[_0xc03d('0x30')]:_0x27a8f7[_0xc03d('0x2c')];if(!_0x18b558['query']['hasOwnProperty'](_0xc03d('0x33'))){_0x3ca393['limit']=qs['limit'](_0x18b558['query'][_0xc03d('0x1d')]);_0x3ca393['offset']=qs[_0xc03d('0x1b')](_0x18b558[_0xc03d('0x2e')][_0xc03d('0x1b')]);}_0x3ca393[_0xc03d('0x34')]=qs[_0xc03d('0x35')](_0x18b558[_0xc03d('0x2e')][_0xc03d('0x35')]);_0x3ca393['where']=qs[_0xc03d('0x2f')](_['pick'](_0x18b558[_0xc03d('0x2e')],_0x27a8f7['filters']),_0x431a9d);if(_0x18b558[_0xc03d('0x2e')][_0xc03d('0x36')]){_0x3ca393[_0xc03d('0x37')]=_[_0xc03d('0x38')](_0x3ca393[_0xc03d('0x37')],{'$or':_['map'](_0x431a9d,function(_0xd6d553){if(_0xd6d553['type']!=='VIRTUAL'){var _0x32e283={};_0x32e283[_0xd6d553[_0xc03d('0x26')]]={'$like':'%'+_0x18b558[_0xc03d('0x2e')][_0xc03d('0x36')]+'%'};return _0x32e283;}})});}_0x3ca393=_[_0xc03d('0x38')]({},_0x3ca393,_0x18b558['options']);var _0x437724={'where':_0x3ca393[_0xc03d('0x37')]};return db['Attachment'][_0xc03d('0x39')](_0x437724)[_0xc03d('0x22')](function(_0x37322a){_0x3cb37c['count']=_0x37322a;if(_0x18b558[_0xc03d('0x2e')]['includeAll']){_0x3ca393['include']=[{'all':!![]}];}return db[_0xc03d('0x29')][_0xc03d('0x3a')](_0x3ca393);})[_0xc03d('0x22')](function(_0x20e066){_0x3cb37c['rows']=_0x20e066;return _0x3cb37c;})[_0xc03d('0x22')](respondWithFilteredResult(_0x1371dd,_0x3ca393))[_0xc03d('0x3b')](handleError(_0x1371dd,null));};exports['show']=function(_0x3070a9,_0x2e7295){var _0x1ced1f={'raw':!![],'where':{'id':_0x3070a9[_0xc03d('0x3c')]['id']}},_0x3f8c4f={};_0x3f8c4f['model']=_[_0xc03d('0x2d')](db[_0xc03d('0x29')][_0xc03d('0x3d')]);_0x3f8c4f[_0xc03d('0x2e')]=_[_0xc03d('0x2d')](_0x3070a9[_0xc03d('0x2e')]);_0x3f8c4f[_0xc03d('0x2f')]=_[_0xc03d('0x31')](_0x3f8c4f['model'],_0x3f8c4f['query']);_0x1ced1f[_0xc03d('0x30')]=_[_0xc03d('0x31')](_0x3f8c4f[_0xc03d('0x2c')],qs[_0xc03d('0x32')](_0x3070a9[_0xc03d('0x2e')][_0xc03d('0x32')]));_0x1ced1f[_0xc03d('0x30')]=_0x1ced1f['attributes'][_0xc03d('0x3e')]?_0x1ced1f[_0xc03d('0x30')]:_0x3f8c4f[_0xc03d('0x2c')];if(_0x3070a9[_0xc03d('0x2e')]['includeAll']){_0x1ced1f['include']=[{'all':!![]}];}_0x1ced1f=_[_0xc03d('0x38')]({},_0x1ced1f,_0x3070a9[_0xc03d('0x3f')]);return db[_0xc03d('0x29')]['find'](_0x1ced1f)[_0xc03d('0x22')](handleEntityNotFound(_0x2e7295,null))['then'](respondWithResult(_0x2e7295,null))[_0xc03d('0x3b')](handleError(_0x2e7295,null));};exports['clone']=function(_0x2dfee3,_0x8c0e1c){var _0x1c237e={'where':{'id':_0x2dfee3[_0xc03d('0x3c')]['id']}},_0x4736c6={};_0x4736c6[_0xc03d('0x2c')]=_['keys'](db[_0xc03d('0x29')][_0xc03d('0x3d')]);_0x1c237e['attributes']=_[_0xc03d('0x31')](_0x4736c6['model'],qs[_0xc03d('0x32')](_0x2dfee3['query'][_0xc03d('0x32')]));_0x1c237e[_0xc03d('0x30')]=_0x1c237e['attributes'][_0xc03d('0x3e')]?_0x1c237e['attributes']:_0x4736c6['model'];if(_0x2dfee3[_0xc03d('0x2e')][_0xc03d('0x40')]){_0x1c237e[_0xc03d('0x41')]=[{'all':!![]}];}_0x1c237e=_[_0xc03d('0x38')]({},_0x1c237e,_0x2dfee3[_0xc03d('0x3f')]);return db[_0xc03d('0x29')][_0xc03d('0x42')](_0x1c237e)[_0xc03d('0x22')](handleEntityNotFound(_0x8c0e1c,null))['then'](function(_0x8e338){if(_0x8e338){var _0x1d8c49=_0x8e338[_0xc03d('0x43')]({'plain':!![]});_0x1d8c49=qs[_0xc03d('0x44')](_0x1d8c49,['id',_0xc03d('0x45'),_0xc03d('0x46')]);_0x2dfee3['body']=_[_0xc03d('0x44')](_0x2dfee3[_0xc03d('0x47')],['id',_0xc03d('0x45'),_0xc03d('0x46')]);return db[_0xc03d('0x29')][_0xc03d('0x48')](_[_0xc03d('0x38')](_0x1d8c49,_0x2dfee3['body']),{'include':_0x2dfee3[_0xc03d('0x2e')][_0xc03d('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x8c0e1c,0xc9))[_0xc03d('0x3b')](handleError(_0x8c0e1c,null));};exports[_0xc03d('0x21')]=function(_0x326270,_0x4101f6){if(_0x326270[_0xc03d('0x47')]['id']){delete _0x326270[_0xc03d('0x47')]['id'];}return db['Attachment']['find']({'where':{'id':_0x326270['params']['id']}})[_0xc03d('0x22')](handleEntityNotFound(_0x4101f6,null))[_0xc03d('0x22')](saveUpdates(_0x326270[_0xc03d('0x47')],null))['then'](respondWithResult(_0x4101f6,null))[_0xc03d('0x3b')](handleError(_0x4101f6,null));};exports['destroy']=function(_0x36bea9,_0x1cfa0d){return db[_0xc03d('0x29')][_0xc03d('0x42')]({'where':{'id':_0x36bea9[_0xc03d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1cfa0d,null))[_0xc03d('0x22')](removeEntity(_0x1cfa0d,null))['catch'](handleError(_0x1cfa0d,null));};exports[_0xc03d('0x48')]=function(_0x1f6eac,_0x1a1648,_0x3caf16){_0x1f6eac[_0xc03d('0x47')]['name']=_0x1f6eac['file'][_0xc03d('0x49')];_0x1f6eac[_0xc03d('0x47')][_0xc03d('0x4a')]=_0x1f6eac['file'][_0xc03d('0x4b')];_0x1f6eac[_0xc03d('0x47')][_0xc03d('0x2b')]=_0x1f6eac['file'][_0xc03d('0x4c')];return db[_0xc03d('0x29')][_0xc03d('0x48')](_0x1f6eac[_0xc03d('0x47')])[_0xc03d('0x22')](respondWithResult(_0x1a1648,0xc9))['catch'](handleError(_0x1a1648,null));};exports['download']=function(_0x425cd7,_0x3d4a6e,_0x2bdf97){return db[_0xc03d('0x29')]['findOne']({'where':{'id':_0x425cd7[_0xc03d('0x3c')]['id']},'raw':!![]})[_0xc03d('0x22')](handleEntityNotFound(_0x3d4a6e,null))['then'](function(_0x5966ff){if(_0x5966ff){var _0x438e2f=_0x5966ff[_0xc03d('0x4d')]!==null;var _0x82934d=path[_0xc03d('0x4e')](config[_0xc03d('0x4f')],_0xc03d('0x50'));if(_0x438e2f){_0x82934d=path[_0xc03d('0x4e')](_0x82934d,_0xc03d('0x51'));}var _0x24aa83=path[_0xc03d('0x4e')](_0x82934d,_0x5966ff[_0xc03d('0x4a')]);return _0x3d4a6e['download'](_0x24aa83);}})[_0xc03d('0x3b')](handleError(_0x3d4a6e,null));}; \ No newline at end of file +var _0xb635=['body','createdAt','create','destroy','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','params','get','omit','updatedAt'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xb635,0x115));var _0x5b63=function(_0x438523,_0x5da095){_0x438523=_0x438523-0x0;var _0x588edf=_0xb635[_0x438523];return _0x588edf;};'use strict';var emlformat=require(_0x5b63('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b63('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b63('0x2'));var BPromise=require(_0x5b63('0x3'));var Mustache=require('mustache');var util=require(_0x5b63('0x4'));var path=require(_0x5b63('0x5'));var sox=require(_0x5b63('0x6'));var csv=require(_0x5b63('0x7'));var ejs=require(_0x5b63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b63('0x9'));var deskjs=require(_0x5b63('0xa'));var toCsv=require(_0x5b63('0x7'));var querystring=require(_0x5b63('0xb'));var Papa=require(_0x5b63('0xc'));var Redis=require('ioredis');var authService=require(_0x5b63('0xd'));var qs=require(_0x5b63('0xe'));var as=require(_0x5b63('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5b63('0x10'));var config=require(_0x5b63('0x11'));var licenseUtil=require(_0x5b63('0x12'));var db=require(_0x5b63('0x13'))['db'];function respondWithStatusCode(_0x1074ee,_0x51a326){_0x51a326=_0x51a326||0xcc;return function(_0x1247cb){if(_0x1247cb){return _0x1074ee['sendStatus'](_0x51a326);}return _0x1074ee[_0x5b63('0x14')](_0x51a326)[_0x5b63('0x15')]();};}function respondWithResult(_0x51c062,_0x37bf83){_0x37bf83=_0x37bf83||0xc8;return function(_0x4e4f86){if(_0x4e4f86){return _0x51c062[_0x5b63('0x14')](_0x37bf83)['json'](_0x4e4f86);}};}function respondWithFilteredResult(_0x4bc095,_0x1c4087){return function(_0x2b0760){if(_0x2b0760){var _0x1a2aea=typeof _0x1c4087['offset']===_0x5b63('0x16')&&typeof _0x1c4087[_0x5b63('0x17')]==='undefined';var _0xe83b22=_0x2b0760[_0x5b63('0x18')];var _0x446ed3=_0x1a2aea?0x0:_0x1c4087['offset'];var _0x3fd823=_0x1a2aea?_0x2b0760[_0x5b63('0x18')]:_0x1c4087[_0x5b63('0x19')]+_0x1c4087[_0x5b63('0x17')];var _0x3adbf9;if(_0x3fd823>=_0xe83b22){_0x3fd823=_0xe83b22;_0x3adbf9=0xc8;}else{_0x3adbf9=0xce;}_0x4bc095[_0x5b63('0x14')](_0x3adbf9);return _0x4bc095[_0x5b63('0x1a')](_0x5b63('0x1b'),_0x446ed3+'-'+_0x3fd823+'/'+_0xe83b22)[_0x5b63('0x1c')](_0x2b0760);}return null;};}function patchUpdates(_0x946f3e){return function(_0x16806e){try{jsonpatch['apply'](_0x16806e,_0x946f3e,!![]);}catch(_0x165608){return BPromise['reject'](_0x165608);}return _0x16806e[_0x5b63('0x1d')]();};}function saveUpdates(_0x559bc3,_0x5ebe8a){return function(_0x2ed6f8){if(_0x2ed6f8){return _0x2ed6f8[_0x5b63('0x1e')](_0x559bc3)[_0x5b63('0x1f')](function(_0x4229dd){return _0x4229dd;});}return null;};}function removeEntity(_0x3ecdac,_0x558e9f){return function(_0x57b6b3){if(_0x57b6b3){return _0x57b6b3['destroy']()[_0x5b63('0x1f')](function(){_0x3ecdac[_0x5b63('0x14')](0xcc)[_0x5b63('0x15')]();});}};}function handleEntityNotFound(_0x185f66,_0x221e54){return function(_0x46f4d0){if(!_0x46f4d0){_0x185f66['sendStatus'](0x194);}return _0x46f4d0;};}function handleError(_0x2c9041,_0x347dcf){_0x347dcf=_0x347dcf||0x1f4;return function(_0x5bffc0){logger[_0x5b63('0x20')](_0x5bffc0[_0x5b63('0x21')]);if(_0x5bffc0[_0x5b63('0x22')]){delete _0x5bffc0[_0x5b63('0x22')];}_0x2c9041[_0x5b63('0x14')](_0x347dcf)[_0x5b63('0x23')](_0x5bffc0);};}exports[_0x5b63('0x24')]=function(_0x1f275d,_0x47118d){var _0x359ee6={},_0x5539c0={},_0x10041b={'count':0x0,'rows':[]};var _0x7c1419=_[_0x5b63('0x25')](db[_0x5b63('0x26')][_0x5b63('0x27')],function(_0x1af5cb){return{'name':_0x1af5cb[_0x5b63('0x28')],'type':_0x1af5cb[_0x5b63('0x29')][_0x5b63('0x2a')]};});_0x5539c0[_0x5b63('0x2b')]=_[_0x5b63('0x25')](_0x7c1419,_0x5b63('0x22'));_0x5539c0[_0x5b63('0x2c')]=_[_0x5b63('0x2d')](_0x1f275d[_0x5b63('0x2c')]);_0x5539c0[_0x5b63('0x2e')]=_[_0x5b63('0x2f')](_0x5539c0[_0x5b63('0x2b')],_0x5539c0[_0x5b63('0x2c')]);_0x359ee6['attributes']=_[_0x5b63('0x2f')](_0x5539c0['model'],qs['fields'](_0x1f275d['query'][_0x5b63('0x30')]));_0x359ee6[_0x5b63('0x31')]=_0x359ee6[_0x5b63('0x31')][_0x5b63('0x32')]?_0x359ee6[_0x5b63('0x31')]:_0x5539c0['model'];if(!_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x33')]('nolimit')){_0x359ee6[_0x5b63('0x17')]=qs[_0x5b63('0x17')](_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x17')]);_0x359ee6[_0x5b63('0x19')]=qs['offset'](_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x19')]);}_0x359ee6[_0x5b63('0x34')]=qs[_0x5b63('0x35')](_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x35')]);_0x359ee6[_0x5b63('0x36')]=qs[_0x5b63('0x2e')](_[_0x5b63('0x37')](_0x1f275d[_0x5b63('0x2c')],_0x5539c0[_0x5b63('0x2e')]),_0x7c1419);if(_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x38')]){_0x359ee6['where']=_[_0x5b63('0x39')](_0x359ee6[_0x5b63('0x36')],{'$or':_[_0x5b63('0x25')](_0x7c1419,function(_0x24beba){if(_0x24beba['type']!==_0x5b63('0x3a')){var _0x3d80dd={};_0x3d80dd[_0x24beba[_0x5b63('0x22')]]={'$like':'%'+_0x1f275d[_0x5b63('0x2c')][_0x5b63('0x38')]+'%'};return _0x3d80dd;}})});}_0x359ee6=_[_0x5b63('0x39')]({},_0x359ee6,_0x1f275d[_0x5b63('0x3b')]);var _0x196dc9={'where':_0x359ee6[_0x5b63('0x36')]};return db['Attachment'][_0x5b63('0x18')](_0x196dc9)['then'](function(_0x285c75){_0x10041b[_0x5b63('0x18')]=_0x285c75;if(_0x1f275d['query'][_0x5b63('0x3c')]){_0x359ee6[_0x5b63('0x3d')]=[{'all':!![]}];}return db[_0x5b63('0x26')][_0x5b63('0x3e')](_0x359ee6);})['then'](function(_0x50c0eb){_0x10041b[_0x5b63('0x3f')]=_0x50c0eb;return _0x10041b;})[_0x5b63('0x1f')](respondWithFilteredResult(_0x47118d,_0x359ee6))['catch'](handleError(_0x47118d,null));};exports[_0x5b63('0x40')]=function(_0x5f15d0,_0x4d9b2a){var _0x4c46be={'raw':!![],'where':{'id':_0x5f15d0['params']['id']}},_0x2eeaf5={};_0x2eeaf5['model']=_[_0x5b63('0x2d')](db[_0x5b63('0x26')][_0x5b63('0x27')]);_0x2eeaf5[_0x5b63('0x2c')]=_[_0x5b63('0x2d')](_0x5f15d0[_0x5b63('0x2c')]);_0x2eeaf5['filters']=_['intersection'](_0x2eeaf5['model'],_0x2eeaf5['query']);_0x4c46be[_0x5b63('0x31')]=_[_0x5b63('0x2f')](_0x2eeaf5[_0x5b63('0x2b')],qs[_0x5b63('0x30')](_0x5f15d0[_0x5b63('0x2c')][_0x5b63('0x30')]));_0x4c46be[_0x5b63('0x31')]=_0x4c46be[_0x5b63('0x31')][_0x5b63('0x32')]?_0x4c46be['attributes']:_0x2eeaf5['model'];if(_0x5f15d0['query'][_0x5b63('0x3c')]){_0x4c46be['include']=[{'all':!![]}];}_0x4c46be=_[_0x5b63('0x39')]({},_0x4c46be,_0x5f15d0['options']);return db[_0x5b63('0x26')][_0x5b63('0x41')](_0x4c46be)[_0x5b63('0x1f')](handleEntityNotFound(_0x4d9b2a,null))['then'](respondWithResult(_0x4d9b2a,null))[_0x5b63('0x42')](handleError(_0x4d9b2a,null));};exports['clone']=function(_0x41f819,_0xbb4a2d){var _0x594fa={'where':{'id':_0x41f819[_0x5b63('0x43')]['id']}},_0x2e5f6d={};_0x2e5f6d['model']=_[_0x5b63('0x2d')](db[_0x5b63('0x26')]['rawAttributes']);_0x594fa[_0x5b63('0x31')]=_[_0x5b63('0x2f')](_0x2e5f6d[_0x5b63('0x2b')],qs[_0x5b63('0x30')](_0x41f819[_0x5b63('0x2c')][_0x5b63('0x30')]));_0x594fa[_0x5b63('0x31')]=_0x594fa['attributes'][_0x5b63('0x32')]?_0x594fa[_0x5b63('0x31')]:_0x2e5f6d[_0x5b63('0x2b')];if(_0x41f819['query'][_0x5b63('0x3c')]){_0x594fa['include']=[{'all':!![]}];}_0x594fa=_[_0x5b63('0x39')]({},_0x594fa,_0x41f819[_0x5b63('0x3b')]);return db['Attachment'][_0x5b63('0x41')](_0x594fa)['then'](handleEntityNotFound(_0xbb4a2d,null))['then'](function(_0x279a04){if(_0x279a04){var _0x14892c=_0x279a04[_0x5b63('0x44')]({'plain':!![]});_0x14892c=qs[_0x5b63('0x45')](_0x14892c,['id','createdAt',_0x5b63('0x46')]);_0x41f819[_0x5b63('0x47')]=_[_0x5b63('0x45')](_0x41f819['body'],['id',_0x5b63('0x48'),_0x5b63('0x46')]);return db[_0x5b63('0x26')][_0x5b63('0x49')](_[_0x5b63('0x39')](_0x14892c,_0x41f819[_0x5b63('0x47')]),{'include':_0x41f819[_0x5b63('0x2c')][_0x5b63('0x3c')]?[{'all':!![]}]:undefined});}})[_0x5b63('0x1f')](respondWithResult(_0xbb4a2d,0xc9))[_0x5b63('0x42')](handleError(_0xbb4a2d,null));};exports[_0x5b63('0x1e')]=function(_0x1336b3,_0x433ace){if(_0x1336b3[_0x5b63('0x47')]['id']){delete _0x1336b3[_0x5b63('0x47')]['id'];}return db[_0x5b63('0x26')]['find']({'where':{'id':_0x1336b3[_0x5b63('0x43')]['id']}})['then'](handleEntityNotFound(_0x433ace,null))['then'](saveUpdates(_0x1336b3[_0x5b63('0x47')],null))[_0x5b63('0x1f')](respondWithResult(_0x433ace,null))[_0x5b63('0x42')](handleError(_0x433ace,null));};exports[_0x5b63('0x4a')]=function(_0x35c716,_0x487c7a){return db[_0x5b63('0x26')]['find']({'where':{'id':_0x35c716[_0x5b63('0x43')]['id']}})[_0x5b63('0x1f')](handleEntityNotFound(_0x487c7a,null))[_0x5b63('0x1f')](removeEntity(_0x487c7a,null))[_0x5b63('0x42')](handleError(_0x487c7a,null));};exports[_0x5b63('0x49')]=function(_0x2cdbfd,_0x16c0fe,_0x25c102){_0x2cdbfd[_0x5b63('0x47')]['name']=_0x2cdbfd['file'][_0x5b63('0x4b')];_0x2cdbfd[_0x5b63('0x47')][_0x5b63('0x4c')]=_0x2cdbfd[_0x5b63('0x4d')][_0x5b63('0x4e')];_0x2cdbfd[_0x5b63('0x47')][_0x5b63('0x29')]=_0x2cdbfd[_0x5b63('0x4d')][_0x5b63('0x4f')];return db[_0x5b63('0x26')][_0x5b63('0x49')](_0x2cdbfd[_0x5b63('0x47')])[_0x5b63('0x1f')](respondWithResult(_0x16c0fe,0xc9))[_0x5b63('0x42')](handleError(_0x16c0fe,null));};exports[_0x5b63('0x50')]=function(_0x3b4d1f,_0x1a0a07,_0x1f36f8){return db[_0x5b63('0x26')][_0x5b63('0x51')]({'where':{'id':_0x3b4d1f[_0x5b63('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1a0a07,null))[_0x5b63('0x1f')](function(_0x14386e){if(_0x14386e){var _0x1a33f5=_0x14386e[_0x5b63('0x52')]!==null;var _0x17e46a=path[_0x5b63('0x53')](config[_0x5b63('0x54')],_0x5b63('0x55'));if(_0x1a33f5){_0x17e46a=path[_0x5b63('0x53')](_0x17e46a,_0x5b63('0x56'));}var _0x1a3cf2=path[_0x5b63('0x53')](_0x17e46a,_0x14386e[_0x5b63('0x4c')]);return _0x1a0a07[_0x5b63('0x50')](_0x1a3cf2);}})[_0x5b63('0x42')](handleError(_0x1a0a07,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 8a924b8..037c66f 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 _0x3f3b=['exports','Attachment','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x30fea4,_0x166fde){var _0x428d17=function(_0x37bc52){while(--_0x37bc52){_0x30fea4['push'](_0x30fea4['shift']());}};_0x428d17(++_0x166fde);}(_0x3f3b,0x16a));var _0xb3f3=function(_0x1c351a,_0x5f4b94){_0x1c351a=_0x1c351a-0x0;var _0x88f4c5=_0x3f3b[_0x1c351a];return _0x88f4c5;};'use strict';var _=require(_0xb3f3('0x0'));var util=require('util');var logger=require(_0xb3f3('0x1'))('api');var moment=require(_0xb3f3('0x2'));var BPromise=require(_0xb3f3('0x3'));var rp=require(_0xb3f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb3f3('0x5'));var attributes=require(_0xb3f3('0x6'));module[_0xb3f3('0x7')]=function(_0x9fd66,_0x5bbd4c){return _0x9fd66['define'](_0xb3f3('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x721f=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x41a4a0,_0x5b750a){var _0x3ed060=function(_0x4a8d95){while(--_0x4a8d95){_0x41a4a0['push'](_0x41a4a0['shift']());}};_0x3ed060(++_0x5b750a);}(_0x721f,0x12a));var _0xf721=function(_0x2f094d,_0x32a89c){_0x2f094d=_0x2f094d-0x0;var _0x32478b=_0x721f[_0x2f094d];return _0x32478b;};'use strict';var _=require(_0xf721('0x0'));var util=require(_0xf721('0x1'));var logger=require(_0xf721('0x2'))(_0xf721('0x3'));var moment=require(_0xf721('0x4'));var BPromise=require(_0xf721('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf721('0x6'));var rimraf=require(_0xf721('0x7'));var config=require(_0xf721('0x8'));var attributes=require(_0xf721('0x9'));module[_0xf721('0xa')]=function(_0x3b008d,_0x537fa8){return _0x3b008d[_0xf721('0xb')](_0xf721('0xc'),attributes,{'tableName':_0xf721('0xd'),'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 25237ca..f8b5e5b 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 _0x2c54=['options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','create','body'];(function(_0x5f20e0,_0x179500){var _0x3ac112=function(_0x1ea44d){while(--_0x1ea44d){_0x5f20e0['push'](_0x5f20e0['shift']());}};_0x3ac112(++_0x179500);}(_0x2c54,0x136));var _0x42c5=function(_0x2ef57c,_0x32cfd6){_0x2ef57c=_0x2ef57c-0x0;var _0x3ce380=_0x2c54[_0x2ef57c];return _0x3ce380;};'use strict';var _=require(_0x42c5('0x0'));var util=require(_0x42c5('0x1'));var moment=require(_0x42c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x42c5('0x3'));var fs=require('fs');var Redis=require(_0x42c5('0x4'));var db=require(_0x42c5('0x5'))['db'];var utils=require(_0x42c5('0x6'));var logger=require(_0x42c5('0x7'))(_0x42c5('0x8'));var config=require('../../config/environment');var jayson=require(_0x42c5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1959c1,_0x44516e,_0x38d528){return new BPromise(function(_0x134cb6,_0x14538f){return client[_0x42c5('0xa')](_0x1959c1,_0x38d528)[_0x42c5('0xb')](function(_0x3ca4de){logger[_0x42c5('0xc')](_0x42c5('0xd'),_0x44516e,_0x42c5('0xe'));logger[_0x42c5('0xf')](_0x42c5('0x10'),_0x44516e,_0x42c5('0xe'),JSON[_0x42c5('0x11')](_0x3ca4de));if(_0x3ca4de[_0x42c5('0x12')]){if(_0x3ca4de[_0x42c5('0x12')][_0x42c5('0x13')]===0x1f4){logger[_0x42c5('0x12')](_0x42c5('0xd'),_0x44516e,_0x3ca4de[_0x42c5('0x12')][_0x42c5('0x14')]);return _0x14538f(_0x3ca4de['error']['message']);}logger[_0x42c5('0x12')](_0x42c5('0xd'),_0x44516e,_0x3ca4de[_0x42c5('0x12')][_0x42c5('0x14')]);return _0x134cb6(_0x3ca4de['error'][_0x42c5('0x14')]);}else{logger[_0x42c5('0xc')](_0x42c5('0xd'),_0x44516e,'request\x20sent');_0x134cb6(_0x3ca4de[_0x42c5('0x15')]['message']);}})['catch'](function(_0x466b47){logger['error']('Attachment,\x20%s,\x20%s',_0x44516e,_0x466b47);_0x14538f(_0x466b47);});});}exports[_0x42c5('0x16')]=function(_0x3a2115){var _0x10e31e=this;return new Promise(function(_0x3f4172,_0x431f4e){return db[_0x42c5('0x17')][_0x42c5('0x18')](_0x3a2115[_0x42c5('0x19')],{'raw':_0x3a2115[_0x42c5('0x1a')]?_0x3a2115[_0x42c5('0x1a')][_0x42c5('0x1b')]===undefined?!![]:![]:!![]})[_0x42c5('0xb')](function(_0x11c6e8){logger[_0x42c5('0xc')]('CreateAttachment',_0x3a2115);logger[_0x42c5('0xf')](_0x42c5('0x16'),_0x3a2115,JSON[_0x42c5('0x11')](_0x11c6e8));_0x3f4172(_0x11c6e8);})['catch'](function(_0x245e72){logger[_0x42c5('0x12')]('CreateAttachment',_0x245e72[_0x42c5('0x14')],_0x3a2115);_0x431f4e(_0x10e31e[_0x42c5('0x12')](0x1f4,_0x245e72[_0x42c5('0x14')]));});});}; \ No newline at end of file +var _0xf25a=['Attachment','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xf25a,0x195));var _0xaf25=function(_0x392e3d,_0x5cb742){_0x392e3d=_0x392e3d-0x0;var _0x24d2d9=_0xf25a[_0x392e3d];return _0x24d2d9;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var moment=require(_0xaf25('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf25('0x3'));var fs=require('fs');var Redis=require(_0xaf25('0x4'));var db=require(_0xaf25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf25('0x6'))(_0xaf25('0x7'));var config=require(_0xaf25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c6e6,_0x4b7258,_0x457ba5){return new BPromise(function(_0x41b3cd,_0x61e8d){return client['request'](_0x48c6e6,_0x457ba5)[_0xaf25('0xa')](function(_0x24ac0a){logger[_0xaf25('0xb')](_0xaf25('0xc'),_0x4b7258,_0xaf25('0xd'));logger['debug'](_0xaf25('0xe'),_0x4b7258,_0xaf25('0xd'),JSON[_0xaf25('0xf')](_0x24ac0a));if(_0x24ac0a[_0xaf25('0x10')]){if(_0x24ac0a['error']['code']===0x1f4){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);return _0x61e8d(_0x24ac0a[_0xaf25('0x10')]['message']);}logger['error'](_0xaf25('0xc'),_0x4b7258,_0x24ac0a['error'][_0xaf25('0x11')]);return _0x41b3cd(_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);}else{logger[_0xaf25('0xb')]('Attachment,\x20%s,\x20%s',_0x4b7258,_0xaf25('0xd'));_0x41b3cd(_0x24ac0a['result']['message']);}})[_0xaf25('0x12')](function(_0x4b396d){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x4b396d);_0x61e8d(_0x4b396d);});});}exports[_0xaf25('0x13')]=function(_0x2c815a){var _0x28bb0e=this;return new Promise(function(_0x10ed9a,_0x615537){return db[_0xaf25('0x14')][_0xaf25('0x15')](_0x2c815a[_0xaf25('0x16')],{'raw':_0x2c815a['options']?_0x2c815a[_0xaf25('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf25('0xa')](function(_0x396af4){logger[_0xaf25('0xb')](_0xaf25('0x13'),_0x2c815a);logger[_0xaf25('0x18')](_0xaf25('0x13'),_0x2c815a,JSON[_0xaf25('0xf')](_0x396af4));_0x10ed9a(_0x396af4);})[_0xaf25('0x12')](function(_0x2d8b66){logger[_0xaf25('0x10')](_0xaf25('0x13'),_0x2d8b66[_0xaf25('0x11')],_0x2c815a);_0x615537(_0x28bb0e[_0xaf25('0x10')](0x1f4,_0x2d8b66[_0xaf25('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2dd1215..58efbc5 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x225aa6,_0x20aee5){_0x225aa6=_0x225aa6-0x0;var _0x2ec135=_0xdb28[_0x225aa6];return _0x2ec135;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x2252fc,_0x1bab36){var _0x578bd8=function(_0x2f9025){while(--_0x2f9025){_0x2252fc['push'](_0x2252fc['shift']());}};_0x578bd8(++_0x1bab36);}(_0xadb5,0xad));var _0x5adb=function(_0x4880d6,_0x2aa208){_0x4880d6=_0x4880d6-0x0;var _0x5448fe=_0xadb5[_0x4880d6];return _0x5448fe;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 2b46f27..9739381 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 _0xf513=['send','message','login','role','signToken','json','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blockedAt','admin','agent','disabled','add','minutes','getLicense','catch','status'];(function(_0x588102,_0x238290){var _0x506043=function(_0x4117bd){while(--_0x4117bd){_0x588102['push'](_0x588102['shift']());}};_0x506043(++_0x238290);}(_0xf513,0x181));var _0x3f51=function(_0x4c9a33,_0xbb4131){_0x4c9a33=_0x4c9a33-0x0;var _0x410e91=_0xf513[_0x4c9a33];return _0x410e91;};'use strict';var passport=require(_0x3f51('0x0'));var LocalStrategy=require(_0x3f51('0x1'))[_0x3f51('0x2')];var moment=require(_0x3f51('0x3'));var ActiveDirectory=require(_0x3f51('0x4'));var BPromise=require(_0x3f51('0x5'));var util=require('util');var db=require(_0x3f51('0x6'))['db'];var authService=require(_0x3f51('0x7'));var utils=require(_0x3f51('0x8'));var config=require(_0x3f51('0x9'));var logger=require(_0x3f51('0xa'))('api');function isActiveDirectoryConfigured(_0xdc7974){var _0x39fcac=![];if(typeof _0xdc7974[_0x3f51('0xb')]!=='undefined'){_0x39fcac=_0xdc7974[_0x3f51('0xb')][_0x3f51('0xc')]&&_0xdc7974['activedirectory'][_0x3f51('0xd')]&&_0xdc7974[_0x3f51('0xb')][_0x3f51('0xe')];}return _0x39fcac;}function adAuthenticate(_0x47e8ff,_0x37ff17,_0x27e32b){return new BPromise(function(_0x56ffbd,_0x4087e1){try{var _0x3ea6d5=new ActiveDirectory(_0x47e8ff);_0x3ea6d5['authenticate'](_0x37ff17,_0x27e32b,function(_0x595072,_0x4d18b5){if(_0x595072){logger['error'](_0x3f51('0xf'),_0x37ff17,util[_0x3f51('0x10')](_0x595072,{'showHidden':![],'depth':null}));_0x4087e1(_0x3f51('0x11'));}else if(!_0x4d18b5){logger['error'](_0x3f51('0x12'),_0x37ff17);_0x4087e1(_0x3f51('0x11'));}else{_0x56ffbd(_0x4d18b5);}});}catch(_0x58551f){_0x4087e1(_0x58551f);}});}function ActiveDirectoryAuthenticate(_0x19f66f,_0x3a3f99,_0x390659,_0x433d16){var _0x465fc8,_0x402833;if(!isActiveDirectoryConfigured(config)){logger[_0x3f51('0x13')](_0x3f51('0x14'),_0x3a3f99);return _0x433d16(null,![],{'message':_0x3f51('0x11')});}return db['Setting'][_0x3f51('0x15')]({'where':{'id':0x1},'attributes':[_0x3f51('0x16'),_0x3f51('0x17')],'raw':!![]})[_0x3f51('0x18')](function(_0x5d7298){_0x465fc8=_0x5d7298;if(!_0x465fc8['adSsoEnabled']){logger['error'](_0x3f51('0x19'),_0x3a3f99);throw new Error(_0x3f51('0x11'));}return _0x19f66f[_0x3f51('0x15')]({'attributes':['id',_0x3f51('0x1a'),_0x3f51('0x1b'),_0x3f51('0x1c'),'role','disabled','blocked',_0x3f51('0x1d'),'online'],'where':{'name':_0x3a3f99,'role':{'$or':[_0x3f51('0x1e'),'user',_0x3f51('0x1f')]},'adSsoEnabled':!![]}});})[_0x3f51('0x18')](function(_0x36aefa){if(!_0x36aefa||_0x36aefa&&_0x36aefa[_0x3f51('0x1a')]!==_0x3a3f99){throw new Error(_0x3f51('0x11'));}_0x402833=_0x36aefa;var _0xcedb0d=_0x402833['name']+'@'+config[_0x3f51('0xb')]['domain'];return adAuthenticate(config[_0x3f51('0xb')],_0xcedb0d,_0x390659);})[_0x3f51('0x18')](function(_0x563232){if(_0x402833[_0x3f51('0x20')]){throw new Error(_0x3f51('0x11'));}if(_0x465fc8[_0x3f51('0x17')]>0x0){if(_0x402833['blocked']){if(moment(_0x402833[_0x3f51('0x1d')])[_0x3f51('0x21')](_0x465fc8['blockDuration'],_0x3f51('0x22'))>moment()){throw new Error(_0x3f51('0x11'));}return utils['clearBlockUser'](_0x402833,0x0,![],null)[_0x3f51('0x18')](function(){return utils[_0x3f51('0x23')](_0x402833);})['then'](function(){return _0x433d16(null,_0x402833);});}else{return utils[_0x3f51('0x23')](_0x402833)[_0x3f51('0x18')](function(){return _0x433d16(null,_0x402833);});}}else{return utils[_0x3f51('0x23')](_0x402833)[_0x3f51('0x18')](function(){return _0x433d16(null,_0x402833);});}})[_0x3f51('0x24')](function(_0x1b954f){return _0x433d16(null,![],_0x1b954f);});}function handleError(_0x2942c0,_0x4096b4,_0x3d0fee){return _0x2942c0[_0x3f51('0x25')](_0x4096b4||0x1f4)[_0x3f51('0x26')]({'message':_0x3d0fee?_0x3d0fee[_0x3f51('0x27')]||_0x3d0fee:''});}exports[_0x3f51('0x28')]=function(_0x51fd9f,_0x1c858d,_0x4b7ec4){passport['authenticate']('ad-login',function(_0x2ec8a8,_0x525ec1,_0x5ccf89){var _0x4a8654=_0x2ec8a8||_0x5ccf89;if(_0x4a8654){return handleError(_0x1c858d,0x191,_0x4a8654);}if(!_0x525ec1){return handleError(_0x1c858d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x298964={'payload':{'id':_0x525ec1['id'],'role':_0x525ec1[_0x3f51('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x3f51('0x2a')](_0x298964)[_0x3f51('0x18')](function(_0xe997d0){_0x1c858d[_0x3f51('0x2b')]({'id':_0x525ec1['id'],'token':_0xe997d0,'statusCall':'','isAlreadyLogged':_0x525ec1[_0x3f51('0x2c')]});});}})(_0x51fd9f,_0x1c858d,_0x4b7ec4);};passport[_0x3f51('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0x3f51('0x1a'),'passwordField':_0x3f51('0x1b')},function(_0x374aa2,_0x2cbfc5,_0x236e2a){return ActiveDirectoryAuthenticate(db[_0x3f51('0x2e')],_0x374aa2,_0x2cbfc5,_0x236e2a);})); \ No newline at end of file +var _0x8167=['ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','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','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','add','minutes','clearBlockUser','getLicense','status','login'];(function(_0x34941e,_0x22e889){var _0x43c927=function(_0x3e6489){while(--_0x3e6489){_0x34941e['push'](_0x34941e['shift']());}};_0x43c927(++_0x22e889);}(_0x8167,0x164));var _0x7816=function(_0x21e480,_0xe09b61){_0x21e480=_0x21e480-0x0;var _0x14528e=_0x8167[_0x21e480];return _0x14528e;};'use strict';var passport=require(_0x7816('0x0'));var LocalStrategy=require(_0x7816('0x1'))[_0x7816('0x2')];var moment=require(_0x7816('0x3'));var ActiveDirectory=require(_0x7816('0x4'));var BPromise=require('bluebird');var util=require(_0x7816('0x5'));var db=require(_0x7816('0x6'))['db'];var authService=require(_0x7816('0x7'));var utils=require(_0x7816('0x8'));var config=require(_0x7816('0x9'));var logger=require(_0x7816('0xa'))(_0x7816('0xb'));function isActiveDirectoryConfigured(_0x3fdee2){var _0x1ea627=![];if(typeof _0x3fdee2['activedirectory']!==_0x7816('0xc')){_0x1ea627=_0x3fdee2[_0x7816('0xd')][_0x7816('0xe')]&&_0x3fdee2[_0x7816('0xd')]['url']&&_0x3fdee2[_0x7816('0xd')][_0x7816('0xf')];}return _0x1ea627;}function adAuthenticate(_0xca2be6,_0x384544,_0x26891f){return new BPromise(function(_0x39df2d,_0x5df1bd){try{var _0x72a109=new ActiveDirectory(_0xca2be6);_0x72a109[_0x7816('0x10')](_0x384544,_0x26891f,function(_0xce8854,_0x100402){if(_0xce8854){logger[_0x7816('0x11')](_0x7816('0x12'),_0x384544,util[_0x7816('0x13')](_0xce8854,{'showHidden':![],'depth':null}));_0x5df1bd(_0x7816('0x14'));}else if(!_0x100402){logger[_0x7816('0x11')](_0x7816('0x15'),_0x384544);_0x5df1bd(_0x7816('0x14'));}else{_0x39df2d(_0x100402);}});}catch(_0x515a62){_0x5df1bd(_0x515a62);}});}function ActiveDirectoryAuthenticate(_0x4d08f4,_0x56d9c0,_0x2fdb20,_0x145a09){var _0x20df9f,_0x774ccd;if(!isActiveDirectoryConfigured(config)){logger[_0x7816('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x56d9c0);return _0x145a09(null,![],{'message':_0x7816('0x14')});}return db[_0x7816('0x16')][_0x7816('0x17')]({'where':{'id':0x1},'attributes':[_0x7816('0x18'),_0x7816('0x19')],'raw':!![]})[_0x7816('0x1a')](function(_0x13389b){_0x20df9f=_0x13389b;if(!_0x20df9f[_0x7816('0x18')]){logger[_0x7816('0x11')](_0x7816('0x1b'),_0x56d9c0);throw new Error(_0x7816('0x14'));}return _0x4d08f4[_0x7816('0x17')]({'attributes':['id',_0x7816('0x1c'),_0x7816('0x1d'),_0x7816('0x1e'),_0x7816('0x1f'),_0x7816('0x20'),_0x7816('0x21'),_0x7816('0x22'),_0x7816('0x23')],'where':{'name':_0x56d9c0,'role':{'$or':[_0x7816('0x24'),_0x7816('0x25'),'agent']},'adSsoEnabled':!![]}});})[_0x7816('0x1a')](function(_0x4c9340){if(!_0x4c9340||_0x4c9340&&_0x4c9340[_0x7816('0x1c')]!==_0x56d9c0){throw new Error(_0x7816('0x14'));}_0x774ccd=_0x4c9340;var _0x1ad25e=_0x774ccd[_0x7816('0x1c')]+'@'+config[_0x7816('0xd')][_0x7816('0xf')];return adAuthenticate(config[_0x7816('0xd')],_0x1ad25e,_0x2fdb20);})['then'](function(_0x13e09e){if(_0x774ccd['disabled']){throw new Error(_0x7816('0x14'));}if(_0x20df9f[_0x7816('0x19')]>0x0){if(_0x774ccd['blocked']){if(moment(_0x774ccd['blockedAt'])[_0x7816('0x26')](_0x20df9f[_0x7816('0x19')],_0x7816('0x27'))>moment()){throw new Error(_0x7816('0x14'));}return utils[_0x7816('0x28')](_0x774ccd,0x0,![],null)[_0x7816('0x1a')](function(){return utils['getLicense'](_0x774ccd);})['then'](function(){return _0x145a09(null,_0x774ccd);});}else{return utils['getLicense'](_0x774ccd)['then'](function(){return _0x145a09(null,_0x774ccd);});}}else{return utils[_0x7816('0x29')](_0x774ccd)[_0x7816('0x1a')](function(){return _0x145a09(null,_0x774ccd);});}})['catch'](function(_0x586f0b){return _0x145a09(null,![],_0x586f0b);});}function handleError(_0x513e0e,_0x2e9b4c,_0x97cf9a){return _0x513e0e[_0x7816('0x2a')](_0x2e9b4c||0x1f4)['send']({'message':_0x97cf9a?_0x97cf9a['message']||_0x97cf9a:''});}exports[_0x7816('0x2b')]=function(_0xcbe5a4,_0x49c042,_0x5184ea){passport[_0x7816('0x10')](_0x7816('0x2c'),function(_0x40e609,_0x57255c,_0x5093a3){var _0x3513a2=_0x40e609||_0x5093a3;if(_0x3513a2){return handleError(_0x49c042,0x191,_0x3513a2);}if(!_0x57255c){return handleError(_0x49c042,0x194,{'message':_0x7816('0x2d')});}else{var _0x190811={'payload':{'id':_0x57255c['id'],'role':_0x57255c['role']},'options':{'expiresIn':0x15180}};return authService[_0x7816('0x2e')](_0x190811)[_0x7816('0x1a')](function(_0x1cf2ac){_0x49c042[_0x7816('0x2f')]({'id':_0x57255c['id'],'token':_0x1cf2ac,'statusCall':'','isAlreadyLogged':_0x57255c[_0x7816('0x23')]});});}})(_0xcbe5a4,_0x49c042,_0x5184ea);};passport[_0x7816('0x30')](_0x7816('0x2c'),new LocalStrategy({'usernameField':_0x7816('0x1c'),'passwordField':_0x7816('0x1d')},function(_0x30cb43,_0x342f8a,_0x559238){return ActiveDirectoryAuthenticate(db[_0x7816('0x31')],_0x30cb43,_0x342f8a,_0x559238);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index ff53cac..0306a5d 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 _0x899a=['./authActiveDirectory.controller','login','exports','express','Router'];(function(_0x26b817,_0x4b84b8){var _0x1f1ad5=function(_0x5192dc){while(--_0x5192dc){_0x26b817['push'](_0x26b817['shift']());}};_0x1f1ad5(++_0x4b84b8);}(_0x899a,0x184));var _0xa899=function(_0x3a2255,_0x230b4d){_0x3a2255=_0x3a2255-0x0;var _0x291af5=_0x899a[_0x3a2255];return _0x291af5;};'use strict';var express=require(_0xa899('0x0'));var router=express[_0xa899('0x1')]();var controller=require(_0xa899('0x2'));router['post']('/',controller[_0xa899('0x3')]);module[_0xa899('0x4')]=router; \ No newline at end of file +var _0x167f=['post','login','exports','./authActiveDirectory.controller'];(function(_0xbce22a,_0x3b32f4){var _0x2e0203=function(_0x1b97bd){while(--_0x1b97bd){_0xbce22a['push'](_0xbce22a['shift']());}};_0x2e0203(++_0x3b32f4);}(_0x167f,0x1cb));var _0xf167=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x167f[_0x5b78e8];return _0xf2c321;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xf167('0x0'));router[_0xf167('0x1')]('/',controller[_0xf167('0x2')]);module[_0xf167('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 9a0a816..1039ed7 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4bbf24,_0x27bfec){var _0x3de35d=function(_0x115a42){while(--_0x115a42){_0x4bbf24['push'](_0x4bbf24['shift']());}};_0x3de35d(++_0x27bfec);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5b3b5c,_0x888ee5){var _0x56d39b=function(_0x2effc2){while(--_0x2effc2){_0x5b3b5c['push'](_0x5b3b5c['shift']());}};_0x56d39b(++_0x888ee5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 1593e19..b159939 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 _0xc4dd=['exports','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','setTokenCookie'];(function(_0x16151b,_0x1b89ff){var _0x285555=function(_0x432f56){while(--_0x432f56){_0x16151b['push'](_0x16151b['shift']());}};_0x285555(++_0x1b89ff);}(_0xc4dd,0x1cd));var _0xdc4d=function(_0x57d72f,_0xf27a3c){_0x57d72f=_0x57d72f-0x0;var _0x3c439e=_0xc4dd[_0x57d72f];return _0x3c439e;};'use strict';var express=require('express');var passport=require(_0xdc4d('0x0'));var router=express[_0xdc4d('0x1')]();var controller=require(_0xdc4d('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xdc4d('0x3'));router[_0xdc4d('0x4')]('/',controller[_0xdc4d('0x5')]);router[_0xdc4d('0x4')](_0xdc4d('0x6'),controller[_0xdc4d('0x7')],authService['isMiddleware'],userController['login'],authService[_0xdc4d('0x8')]);module[_0xdc4d('0x9')]=router; \ No newline at end of file +var _0x7698=['./authGoogle.controller','login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x7698,0x7b));var _0x8769=function(_0x4458f6,_0x3c0532){_0x4458f6=_0x4458f6-0x0;var _0x24432f=_0x7698[_0x4458f6];return _0x24432f;};'use strict';var express=require(_0x8769('0x0'));var passport=require(_0x8769('0x1'));var router=express[_0x8769('0x2')]();var controller=require(_0x8769('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x8769('0x4')]);router['get']('/callback',controller[_0x8769('0x5')],authService[_0x8769('0x6')],userController[_0x8769('0x4')],authService[_0x8769('0x7')]);module[_0x8769('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 04393e6..382506a 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 _0xd150=['request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','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','status','Reset\x20Email\x20sent!','catch','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','send','use','util','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','MailAccount','find','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>'];(function(_0x1b62b8,_0x3e78d9){var _0x47a5a0=function(_0x479a5b){while(--_0x479a5b){_0x1b62b8['push'](_0x1b62b8['shift']());}};_0x47a5a0(++_0x3e78d9);}(_0xd150,0xd6));var _0x0d15=function(_0x53f264,_0x1f69e8){_0x53f264=_0x53f264-0x0;var _0x18c742=_0xd150[_0x53f264];return _0x18c742;};'use strict';var util=require(_0x0d15('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x0d15('0x1')];var jayson=require(_0x0d15('0x2'));var _=require(_0x0d15('0x3'));var rs=require('randomstring');var moment=require(_0x0d15('0x4'));var db=require(_0x0d15('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0d15('0x6'));var client=jayson[_0x0d15('0x7')][_0x0d15('0x8')]({'port':0x232b});function localAuthenticate(_0x472ff9,_0x34c8fb,_0x264a75,_0xd9ab3a){var _0x1a2452,_0x2dc6a0;return db[_0x0d15('0x9')][_0x0d15('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0d15('0xb')],'raw':!![]})[_0x0d15('0xc')](function(_0x123767){_0x1a2452=_0x123767;return _0x472ff9[_0x0d15('0xa')]({'attributes':['id','name',_0x0d15('0xd'),'salt',_0x0d15('0xe'),_0x0d15('0xf'),_0x0d15('0x10'),_0x0d15('0x11'),_0x0d15('0x12')],'where':{'name':_0x34c8fb,'role':{'$or':[_0x0d15('0x13'),_0x0d15('0x14'),_0x0d15('0x15')]}}});})[_0x0d15('0xc')](function(_0x4cc1b5){if(!_0x4cc1b5||_0x4cc1b5&&_0x4cc1b5['name']!==_0x34c8fb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2dc6a0=_0x4cc1b5;return _0x2dc6a0;}})[_0x0d15('0xc')](function(){_0x2dc6a0[_0x0d15('0x16')](_0x264a75,function(_0x1011c0,_0x405223){var _0x80ff08=_0x2dc6a0['loginAttempts']+0x1;if(_0x1011c0){return _0xd9ab3a(_0x1011c0);}else if(!_0x405223){if(_0x2dc6a0['disabled']){return _0xd9ab3a(null,![],{'message':_0x0d15('0x17')});}else if(_0x1a2452[_0x0d15('0x18')]>0x0){if(_0x2dc6a0[_0x0d15('0x10')]){if(_0x1a2452['blockDuration']>0x0){if(moment(_0x2dc6a0[_0x0d15('0x11')])[_0x0d15('0x19')](_0x1a2452[_0x0d15('0xb')],'minutes')>moment()){return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0d15('0x1a')](_0x2dc6a0,_0x80ff08,![],null)[_0x0d15('0xc')](function(){return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x80ff08>=_0x1a2452[_0x0d15('0x18')]){return utils[_0x0d15('0x1a')](_0x2dc6a0,0x0,!![],moment())[_0x0d15('0xc')](function(){return _0xd9ab3a(null,![],{'message':_0x0d15('0x17')});});}else{return utils['clearBlockUser'](_0x2dc6a0,_0x80ff08,![],null)[_0x0d15('0xc')](function(){return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2dc6a0['disabled']){return _0xd9ab3a(null,![],{'message':_0x0d15('0x17')});}else if(_0x1a2452[_0x0d15('0x18')]>0x0){if(_0x2dc6a0[_0x0d15('0x10')]){if(_0x1a2452[_0x0d15('0xb')]>0x0){if(moment(_0x2dc6a0[_0x0d15('0x11')])[_0x0d15('0x19')](_0x1a2452[_0x0d15('0xb')],_0x0d15('0x1b'))>moment()){return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2dc6a0,0x0,![],null)[_0x0d15('0xc')](function(){return utils[_0x0d15('0x1c')](_0x2dc6a0);})[_0x0d15('0xc')](function(){return _0xd9ab3a(null,_0x2dc6a0);});}}else{return _0xd9ab3a(null,![],{'message':_0x0d15('0x17')});}}else{return utils['clearBlockUser'](_0x2dc6a0,0x0,![],null)['then'](function(){return utils[_0x0d15('0x1c')](_0x2dc6a0);})[_0x0d15('0xc')](function(){return _0xd9ab3a(null,_0x2dc6a0);})['catch'](function(_0x258b8e){return _0xd9ab3a(null,![],_0x258b8e);});}}else{if(_0x2dc6a0[_0x0d15('0x10')]){return _0xd9ab3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0d15('0x1c')](_0x2dc6a0)[_0x0d15('0xc')](function(){return _0xd9ab3a(null,_0x2dc6a0);});}}}});})['catch'](function(_0x3a3696){return _0xd9ab3a(null,![],_0x3a3696);});}function sendServiceMail(_0x280080){return db[_0x0d15('0x1d')][_0x0d15('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x0d15('0x1f'),_0x0d15('0x20')],'include':[{'model':db[_0x0d15('0x21')],'as':_0x0d15('0x22'),'include':[{'model':db[_0x0d15('0x23')],'as':_0x0d15('0x23')}]}]})[_0x0d15('0xc')](function(_0x20a856){if(!_0x20a856){throw new Error(_0x0d15('0x24'));}var _0x4d9c79=_0x20a856[_0x0d15('0x25')]();var _0x362401={'account':_0x4d9c79,'message':_[_0x0d15('0x26')]({'from':util[_0x0d15('0x27')](_0x0d15('0x28'),_0x20a856[_0x0d15('0x1f')],_0x20a856[_0x0d15('0x20')]||_0x20a856[_0x0d15('0x22')][_0x0d15('0x14')])},_0x280080)};return client[_0x0d15('0x29')]('SendMail',_0x362401);})[_0x0d15('0xc')](function(_0x5a3d07){if(_0x5a3d07[_0x0d15('0x2a')]){throw new Error(util[_0x0d15('0x27')](_0x0d15('0x2b'),_0x5a3d07[_0x0d15('0x2a')][_0x0d15('0x2c')]||JSON[_0x0d15('0x2d')](_0x5a3d07[_0x0d15('0x2a')])));}return!![];});}function handleError(_0x28c70f,_0x240040,_0x2deea4){return _0x28c70f['status'](_0x240040||0x1f4)['send']({'message':_0x2deea4?_0x2deea4[_0x0d15('0x2c')]||_0x2deea4:''});}exports[_0x0d15('0x2e')]=function(_0x49d55f,_0x5661d9,_0x3e1c42){passport['authenticate'](_0x0d15('0x2f'),function(_0x1d9a4d,_0x45218d,_0x3b4644){var _0x5dbe7b=_0x1d9a4d||_0x3b4644;if(_0x5dbe7b){return handleError(_0x5661d9,0x191,_0x5dbe7b);}if(!_0x45218d){return handleError(_0x5661d9,0x194,{'message':_0x0d15('0x30')});}else{var _0x30c388={'payload':{'id':_0x45218d['id'],'role':_0x45218d['role']},'options':{'expiresIn':0x15180}};return authService[_0x0d15('0x31')](_0x30c388)[_0x0d15('0xc')](function(_0x1c68f1){_0x5661d9[_0x0d15('0x32')]({'id':_0x45218d['id'],'token':_0x1c68f1,'statusCall':'','isAlreadyLogged':_0x45218d['online']});});}})(_0x49d55f,_0x5661d9,_0x3e1c42);};exports[_0x0d15('0x33')]=function(_0x355f21,_0x36fcec){if(!_0x355f21[_0x0d15('0x34')][_0x0d15('0x20')]){return handleError(_0x36fcec,0x1f4,{'message':_0x0d15('0x35')});}var _0x3578b4=rs['generate']();_0x355f21[_0x0d15('0x34')][_0x0d15('0x20')]=_0x355f21[_0x0d15('0x34')]['email'][_0x0d15('0x36')]()['toLowerCase']();var _0x1c4150;return db['Setting'][_0x0d15('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x0d15('0xc')](function(_0x2fc4c4){_0x1c4150=_0x2fc4c4;return db[_0x0d15('0x37')][_0x0d15('0x1e')]({'where':{'email':_0x355f21[_0x0d15('0x34')][_0x0d15('0x20')]}});})[_0x0d15('0xc')](function(_0x4a0b5c){if(!_0x4a0b5c){throw new Error(_0x0d15('0x38'));}if(_0x4a0b5c[_0x0d15('0xf')]){throw new Error(_0x0d15('0x39'));}if(_0x4a0b5c[_0x0d15('0x10')]){if(moment(_0x4a0b5c[_0x0d15('0x11')])[_0x0d15('0x19')](_0x1c4150[_0x0d15('0xb')],_0x0d15('0x1b'))>moment()){throw new Error(_0x0d15('0x3a'));}else{_0x4a0b5c[_0x0d15('0x10')]=![];_0x4a0b5c[_0x0d15('0x11')]=null;}}_0x4a0b5c['resetPasswordToken']=_0x3578b4;_0x4a0b5c[_0x0d15('0x3b')]=Date[_0x0d15('0x3c')]()+0x36ee80;return _0x4a0b5c[_0x0d15('0x3d')]();})[_0x0d15('0xc')](function(){return sendServiceMail({'to':_0x355f21[_0x0d15('0x34')][_0x0d15('0x20')],'subject':_0x0d15('0x3e'),'text':_0x0d15('0x3f')+_0x0d15('0x40')+_0x0d15('0x41')+_0x355f21['headers'][_0x0d15('0x42')]+_0x0d15('0x43')+_0x3578b4+'\x0a\x0a'+_0x0d15('0x44')});})[_0x0d15('0xc')](function(){_0x36fcec[_0x0d15('0x45')](0xc8)['send']({'message':_0x0d15('0x46')});})[_0x0d15('0x47')](function(_0x4cf1fc){return handleError(_0x36fcec,0x1f4,_0x4cf1fc);});};exports[_0x0d15('0x48')]=function(_0xbb6e1b,_0x4605b3){return db['User']['find']({'where':{'resetPasswordToken':_0xbb6e1b[_0x0d15('0x49')][_0x0d15('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x0d15('0x3c')]()}}})['then'](function(_0x387764){if(!_0x387764){throw new Error(_0x0d15('0x4b'));}return db[_0x0d15('0x9')][_0x0d15('0xa')]({'attributes':['id',_0x0d15('0x4c'),_0x0d15('0x4d'),'passwordHistoryLimit']})[_0x0d15('0xc')](function(_0x111e5f){if(_0x111e5f['securePassword'])authService[_0x0d15('0x4e')](_0xbb6e1b['body'][_0x0d15('0xd')]);if(!_0x111e5f[_0x0d15('0x4d')]||!_0x387764[_0x0d15('0x4f')])return _0x387764;authService[_0x0d15('0x50')](_0xbb6e1b['body'][_0x0d15('0xd')],_0x387764[_0x0d15('0x4f')],_0x111e5f[_0x0d15('0x51')]);return _0x387764;})['then'](function(){_0x387764['password']=_0xbb6e1b['body'][_0x0d15('0xd')];_0x387764[_0x0d15('0x52')]=null;_0x387764[_0x0d15('0x3b')]=null;return _0x387764[_0x0d15('0x3d')]();});})[_0x0d15('0xc')](function(){_0x4605b3[_0x0d15('0x45')](0xc8)[_0x0d15('0x53')]({'message':'Password\x20reset!'});})[_0x0d15('0x47')](function(_0x305b6c){return handleError(_0x4605b3,0x1f4,_0x305b6c);});};passport[_0x0d15('0x54')]('local-login',new LocalStrategy({'usernameField':_0x0d15('0x1f'),'passwordField':_0x0d15('0xd')},function(_0x2ddfbf,_0x3a0772,_0x402090){return localAuthenticate(db['User'],_0x2ddfbf,_0x3a0772,_0x402090);})); \ No newline at end of file +var _0x3c14=['merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','util','passport','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','then','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions'];(function(_0x4bdc6a,_0x50ffb7){var _0x3857ff=function(_0x18f64f){while(--_0x18f64f){_0x4bdc6a['push'](_0x4bdc6a['shift']());}};_0x3857ff(++_0x50ffb7);}(_0x3c14,0x1d6));var _0x43c1=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x3c14[_0x307d86];return _0x361745;};'use strict';var util=require(_0x43c1('0x0'));var passport=require(_0x43c1('0x1'));var LocalStrategy=require('passport-local')[_0x43c1('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x43c1('0x3'));var moment=require(_0x43c1('0x4'));var db=require(_0x43c1('0x5'))['db'];var authService=require(_0x43c1('0x6'));var utils=require(_0x43c1('0x7'));var client=jayson[_0x43c1('0x8')][_0x43c1('0x9')]({'port':0x232b});function localAuthenticate(_0x5d852b,_0x295bba,_0xd3ba6,_0x3e460e){var _0x2a4d65,_0x8499f6;return db[_0x43c1('0xa')][_0x43c1('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x43c1('0xc')](function(_0x44fac4){_0x2a4d65=_0x44fac4;return _0x5d852b[_0x43c1('0xb')]({'attributes':['id',_0x43c1('0xd'),'password',_0x43c1('0xe'),_0x43c1('0xf'),_0x43c1('0x10'),_0x43c1('0x11'),_0x43c1('0x12'),_0x43c1('0x13')],'where':{'name':_0x295bba,'role':{'$or':[_0x43c1('0x14'),_0x43c1('0x15'),_0x43c1('0x16')]}}});})[_0x43c1('0xc')](function(_0x57b582){if(!_0x57b582||_0x57b582&&_0x57b582[_0x43c1('0xd')]!==_0x295bba){throw new Error(_0x43c1('0x17'));}else{_0x8499f6=_0x57b582;return _0x8499f6;}})[_0x43c1('0xc')](function(){_0x8499f6[_0x43c1('0x18')](_0xd3ba6,function(_0x348f96,_0x2bb723){var _0x357c13=_0x8499f6[_0x43c1('0x13')]+0x1;if(_0x348f96){return _0x3e460e(_0x348f96);}else if(!_0x2bb723){if(_0x8499f6[_0x43c1('0x10')]){return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}else if(_0x2a4d65['allowedLoginAttempts']>0x0){if(_0x8499f6[_0x43c1('0x11')]){if(_0x2a4d65[_0x43c1('0x19')]>0x0){if(moment(_0x8499f6['blockedAt'])[_0x43c1('0x1a')](_0x2a4d65[_0x43c1('0x19')],_0x43c1('0x1b'))>moment()){return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}else{return utils[_0x43c1('0x1c')](_0x8499f6,_0x357c13,![],null)['then'](function(){return _0x3e460e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}}else{if(_0x357c13>=_0x2a4d65[_0x43c1('0x1d')]){return utils[_0x43c1('0x1c')](_0x8499f6,0x0,!![],moment())['then'](function(){return _0x3e460e(null,![],{'message':_0x43c1('0x17')});});}else{return utils[_0x43c1('0x1c')](_0x8499f6,_0x357c13,![],null)[_0x43c1('0xc')](function(){return _0x3e460e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}}else{if(_0x8499f6['disabled']){return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}else if(_0x2a4d65[_0x43c1('0x1d')]>0x0){if(_0x8499f6['blocked']){if(_0x2a4d65[_0x43c1('0x19')]>0x0){if(moment(_0x8499f6[_0x43c1('0x12')])[_0x43c1('0x1a')](_0x2a4d65[_0x43c1('0x19')],_0x43c1('0x1b'))>moment()){return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}else{return utils[_0x43c1('0x1c')](_0x8499f6,0x0,![],null)[_0x43c1('0xc')](function(){return utils[_0x43c1('0x1e')](_0x8499f6);})[_0x43c1('0xc')](function(){return _0x3e460e(null,_0x8499f6);});}}else{return _0x3e460e(null,![],{'message':_0x43c1('0x17')});}}else{return utils[_0x43c1('0x1c')](_0x8499f6,0x0,![],null)[_0x43c1('0xc')](function(){return utils[_0x43c1('0x1e')](_0x8499f6);})['then'](function(){return _0x3e460e(null,_0x8499f6);})[_0x43c1('0x1f')](function(_0x20f99b){return _0x3e460e(null,![],_0x20f99b);});}}else{if(_0x8499f6[_0x43c1('0x11')]){return _0x3e460e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x43c1('0x1e')](_0x8499f6)[_0x43c1('0xc')](function(){return _0x3e460e(null,_0x8499f6);});}}}});})[_0x43c1('0x1f')](function(_0x48a5e4){return _0x3e460e(null,![],_0x48a5e4);});}function sendServiceMail(_0x24287f){return db[_0x43c1('0x20')][_0x43c1('0x21')]({'where':{'service':!![]},'attributes':['id',_0x43c1('0xd'),_0x43c1('0x22')],'include':[{'model':db[_0x43c1('0x23')],'as':_0x43c1('0x24'),'include':[{'model':db[_0x43c1('0x25')],'as':_0x43c1('0x25')}]}]})['then'](function(_0x1aed29){if(!_0x1aed29){throw new Error(_0x43c1('0x26'));}var _0x2c647a=_0x1aed29[_0x43c1('0x27')]();var _0x110cc0={'account':_0x2c647a,'message':_[_0x43c1('0x28')]({'from':util[_0x43c1('0x29')](_0x43c1('0x2a'),_0x1aed29[_0x43c1('0xd')],_0x1aed29[_0x43c1('0x22')]||_0x1aed29[_0x43c1('0x24')][_0x43c1('0x15')])},_0x24287f)};return client[_0x43c1('0x2b')]('SendMail',_0x110cc0);})[_0x43c1('0xc')](function(_0x1b9f8b){if(_0x1b9f8b[_0x43c1('0x2c')]){throw new Error(util[_0x43c1('0x29')](_0x43c1('0x2d'),_0x1b9f8b['error'][_0x43c1('0x2e')]||JSON['stringify'](_0x1b9f8b[_0x43c1('0x2c')])));}return!![];});}function handleError(_0x1c3041,_0x5856ca,_0x5f0b0e){return _0x1c3041[_0x43c1('0x2f')](_0x5856ca||0x1f4)[_0x43c1('0x30')]({'message':_0x5f0b0e?_0x5f0b0e['message']||_0x5f0b0e:''});}exports[_0x43c1('0x31')]=function(_0x51ad9b,_0x1b23d4,_0x2b9e00){passport[_0x43c1('0x18')](_0x43c1('0x32'),function(_0x2a0e48,_0x54bb0e,_0x413dd9){var _0x131198=_0x2a0e48||_0x413dd9;if(_0x131198){return handleError(_0x1b23d4,0x191,_0x131198);}if(!_0x54bb0e){return handleError(_0x1b23d4,0x194,{'message':_0x43c1('0x33')});}else{var _0x51b4f6={'payload':{'id':_0x54bb0e['id'],'role':_0x54bb0e[_0x43c1('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x43c1('0x34')](_0x51b4f6)['then'](function(_0x40517c){_0x1b23d4[_0x43c1('0x35')]({'id':_0x54bb0e['id'],'token':_0x40517c,'statusCall':'','isAlreadyLogged':_0x54bb0e[_0x43c1('0x36')]});});}})(_0x51ad9b,_0x1b23d4,_0x2b9e00);};exports[_0x43c1('0x37')]=function(_0xa9ee48,_0x4ddf13){if(!_0xa9ee48[_0x43c1('0x38')]['email']){return handleError(_0x4ddf13,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3742fa=rs[_0x43c1('0x39')]();_0xa9ee48[_0x43c1('0x38')]['email']=_0xa9ee48[_0x43c1('0x38')]['email']['trim']()[_0x43c1('0x3a')]();var _0x5a4bd1;return db[_0x43c1('0xa')][_0x43c1('0xb')]({'where':{'id':0x1},'attributes':[_0x43c1('0x1d'),_0x43c1('0x19')],'raw':!![]})['then'](function(_0x2d5fa8){_0x5a4bd1=_0x2d5fa8;return db[_0x43c1('0x3b')][_0x43c1('0x21')]({'where':{'email':_0xa9ee48[_0x43c1('0x38')]['email']}});})['then'](function(_0xc0d5dc){if(!_0xc0d5dc){throw new Error(_0x43c1('0x3c'));}if(_0xc0d5dc[_0x43c1('0x10')]){throw new Error(_0x43c1('0x3d'));}if(_0xc0d5dc[_0x43c1('0x11')]){if(moment(_0xc0d5dc['blockedAt'])[_0x43c1('0x1a')](_0x5a4bd1[_0x43c1('0x19')],_0x43c1('0x1b'))>moment()){throw new Error(_0x43c1('0x3e'));}else{_0xc0d5dc['blocked']=![];_0xc0d5dc[_0x43c1('0x12')]=null;}}_0xc0d5dc[_0x43c1('0x3f')]=_0x3742fa;_0xc0d5dc[_0x43c1('0x40')]=Date['now']()+0x36ee80;return _0xc0d5dc[_0x43c1('0x41')]();})['then'](function(){return sendServiceMail({'to':_0xa9ee48[_0x43c1('0x38')][_0x43c1('0x22')],'subject':_0x43c1('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x43c1('0x43')+_0x43c1('0x44')+_0xa9ee48[_0x43c1('0x45')][_0x43c1('0x46')]+_0x43c1('0x47')+_0x3742fa+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x43c1('0xc')](function(){_0x4ddf13[_0x43c1('0x2f')](0xc8)[_0x43c1('0x30')]({'message':_0x43c1('0x48')});})[_0x43c1('0x1f')](function(_0x87fcca){return handleError(_0x4ddf13,0x1f4,_0x87fcca);});};exports['reset']=function(_0x19387d,_0x350587){return db[_0x43c1('0x3b')][_0x43c1('0x21')]({'where':{'resetPasswordToken':_0x19387d[_0x43c1('0x49')][_0x43c1('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x43c1('0x4b')]()}}})[_0x43c1('0xc')](function(_0x3f981b){if(!_0x3f981b){throw new Error(_0x43c1('0x4c'));}return db[_0x43c1('0xa')]['findOne']({'attributes':['id',_0x43c1('0x4d'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x43c1('0xc')](function(_0x313fea){if(_0x313fea[_0x43c1('0x4d')])authService[_0x43c1('0x4e')](_0x19387d[_0x43c1('0x38')][_0x43c1('0x4f')]);if(!_0x313fea[_0x43c1('0x50')]||!_0x3f981b[_0x43c1('0x51')])return _0x3f981b;authService[_0x43c1('0x52')](_0x19387d[_0x43c1('0x38')][_0x43c1('0x4f')],_0x3f981b[_0x43c1('0x51')],_0x313fea[_0x43c1('0x53')]);return _0x3f981b;})['then'](function(){_0x3f981b[_0x43c1('0x4f')]=_0x19387d[_0x43c1('0x38')][_0x43c1('0x4f')];_0x3f981b[_0x43c1('0x3f')]=null;_0x3f981b[_0x43c1('0x40')]=null;return _0x3f981b[_0x43c1('0x41')]();});})[_0x43c1('0xc')](function(){_0x350587[_0x43c1('0x2f')](0xc8)[_0x43c1('0x30')]({'message':'Password\x20reset!'});})['catch'](function(_0x4bf04d){return handleError(_0x350587,0x1f4,_0x4bf04d);});};passport[_0x43c1('0x54')](_0x43c1('0x32'),new LocalStrategy({'usernameField':_0x43c1('0xd'),'passwordField':_0x43c1('0x4f')},function(_0x331254,_0x4bd451,_0x5b3955){return localAuthenticate(db[_0x43c1('0x3b')],_0x331254,_0x4bd451,_0x5b3955);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6282f89..9af9b1f 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 _0x67db=['exports','express','Router','post','login','/forgot','forgot'];(function(_0xbacfad,_0x52a356){var _0x32c2f9=function(_0x4fabec){while(--_0x4fabec){_0xbacfad['push'](_0xbacfad['shift']());}};_0x32c2f9(++_0x52a356);}(_0x67db,0x8d));var _0xb67d=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x67db[_0x47aa64];return _0x549c7a;};'use strict';var express=require(_0xb67d('0x0'));var router=express[_0xb67d('0x1')]();var controller=require('./authLocal.controller');router[_0xb67d('0x2')]('/',controller[_0xb67d('0x3')]);router[_0xb67d('0x2')](_0xb67d('0x4'),controller[_0xb67d('0x5')]);router[_0xb67d('0x2')]('/reset/:token',controller['reset']);module[_0xb67d('0x6')]=router; \ No newline at end of file +var _0xbb11=['express','Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset','exports'];(function(_0x404b9a,_0xca0480){var _0x30ba61=function(_0x1cdde1){while(--_0x1cdde1){_0x404b9a['push'](_0x404b9a['shift']());}};_0x30ba61(++_0xca0480);}(_0xbb11,0x120));var _0x1bb1=function(_0x251d9c,_0x10858a){_0x251d9c=_0x251d9c-0x0;var _0x42f7c7=_0xbb11[_0x251d9c];return _0x42f7c7;};'use strict';var express=require(_0x1bb1('0x0'));var router=express[_0x1bb1('0x1')]();var controller=require(_0x1bb1('0x2'));router[_0x1bb1('0x3')]('/',controller[_0x1bb1('0x4')]);router[_0x1bb1('0x3')](_0x1bb1('0x5'),controller['forgot']);router[_0x1bb1('0x3')](_0x1bb1('0x6'),controller[_0x1bb1('0x7')]);module[_0x1bb1('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 579983e..4ddfd49 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 _0xcb7f=['sequelize','exports','STRING'];(function(_0x1da7f8,_0x3f70aa){var _0x1b11e3=function(_0x1f21e9){while(--_0x1f21e9){_0x1da7f8['push'](_0x1da7f8['shift']());}};_0x1b11e3(++_0x3f70aa);}(_0xcb7f,0x7b));var _0xfcb7=function(_0x5737df,_0x49e164){_0x5737df=_0x5737df-0x0;var _0x2456c6=_0xcb7f[_0x5737df];return _0x2456c6;};'use strict';var Sequelize=require(_0xfcb7('0x0'));module[_0xfcb7('0x1')]={'name':{'type':Sequelize[_0xfcb7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfcb7('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xec91=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x44380e,_0x317271){var _0x5ac419=function(_0x2005aa){while(--_0x2005aa){_0x44380e['push'](_0x44380e['shift']());}};_0x5ac419(++_0x317271);}(_0xec91,0xb0));var _0x1ec9=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xec91[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require('sequelize');module[_0x1ec9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1ec9('0x1')]},'description':{'type':Sequelize[_0x1ec9('0x1')]},'status':{'type':Sequelize[_0x1ec9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1ec9('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index d12e282..3c199dc 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 _0xba17=['count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Automation','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','body','find','addConditions','ids','omit','getConditions','Condition','nolimit','addActions','getActions','findOne','Action','options','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset'];(function(_0xa5013c,_0x120b02){var _0x22555a=function(_0x23a518){while(--_0x23a518){_0xa5013c['push'](_0xa5013c['shift']());}};_0x22555a(++_0x120b02);}(_0xba17,0x18b));var _0x7ba1=function(_0x3737ee,_0x28571e){_0x3737ee=_0x3737ee-0x0;var _0x19edba=_0xba17[_0x3737ee];return _0x19edba;};'use strict';var emlformat=require(_0x7ba1('0x0'));var rimraf=require(_0x7ba1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ba1('0x2'));var rp=require(_0x7ba1('0x3'));var moment=require(_0x7ba1('0x4'));var BPromise=require(_0x7ba1('0x5'));var Mustache=require(_0x7ba1('0x6'));var util=require(_0x7ba1('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ba1('0x8'));var fs=require('fs');var fs_extra=require(_0x7ba1('0x9'));var _=require('lodash');var squel=require(_0x7ba1('0xa'));var crypto=require(_0x7ba1('0xb'));var jsforce=require(_0x7ba1('0xc'));var deskjs=require(_0x7ba1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ba1('0xe'));var Redis=require(_0x7ba1('0xf'));var authService=require(_0x7ba1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7ba1('0x11'));var hardwareService=require(_0x7ba1('0x12'));var logger=require(_0x7ba1('0x13'))('api');var utils=require(_0x7ba1('0x14'));var config=require(_0x7ba1('0x15'));var licenseUtil=require(_0x7ba1('0x16'));var db=require(_0x7ba1('0x17'))['db'];function respondWithStatusCode(_0xbca935,_0x2ce06c){_0x2ce06c=_0x2ce06c||0xcc;return function(_0x364e66){if(_0x364e66){return _0xbca935[_0x7ba1('0x18')](_0x2ce06c);}return _0xbca935[_0x7ba1('0x19')](_0x2ce06c)['end']();};}function respondWithResult(_0x315ab1,_0x5aa13e){_0x5aa13e=_0x5aa13e||0xc8;return function(_0x2dfa8b){if(_0x2dfa8b){return _0x315ab1[_0x7ba1('0x19')](_0x5aa13e)[_0x7ba1('0x1a')](_0x2dfa8b);}};}function respondWithFilteredResult(_0x2a4ac5,_0x2eafd9){return function(_0x497869){if(_0x497869){var _0x2c6bbc=typeof _0x2eafd9['offset']===_0x7ba1('0x1b')&&typeof _0x2eafd9[_0x7ba1('0x1c')]===_0x7ba1('0x1b');var _0x296b7e=_0x497869['count'];var _0x1cdf86=_0x2c6bbc?0x0:_0x2eafd9[_0x7ba1('0x1d')];var _0x4afc36=_0x2c6bbc?_0x497869[_0x7ba1('0x1e')]:_0x2eafd9['offset']+_0x2eafd9[_0x7ba1('0x1c')];var _0x3974df;if(_0x4afc36>=_0x296b7e){_0x4afc36=_0x296b7e;_0x3974df=0xc8;}else{_0x3974df=0xce;}_0x2a4ac5[_0x7ba1('0x19')](_0x3974df);return _0x2a4ac5['set'](_0x7ba1('0x1f'),_0x1cdf86+'-'+_0x4afc36+'/'+_0x296b7e)[_0x7ba1('0x1a')](_0x497869);}return null;};}function patchUpdates(_0x295d31){return function(_0x305b0b){try{jsonpatch[_0x7ba1('0x20')](_0x305b0b,_0x295d31,!![]);}catch(_0x3569b9){return BPromise[_0x7ba1('0x21')](_0x3569b9);}return _0x305b0b[_0x7ba1('0x22')]();};}function saveUpdates(_0x4918b7,_0x34d328){return function(_0x4a88f4){if(_0x4a88f4){return _0x4a88f4[_0x7ba1('0x23')](_0x4918b7)[_0x7ba1('0x24')](function(_0x29df6c){return _0x29df6c;});}return null;};}function removeEntity(_0x21b0a0,_0x4be7a3){return function(_0x44ce0c){if(_0x44ce0c){return _0x44ce0c[_0x7ba1('0x25')]()[_0x7ba1('0x24')](function(){_0x21b0a0[_0x7ba1('0x19')](0xcc)[_0x7ba1('0x26')]();});}};}function handleEntityNotFound(_0x521f2a,_0x27b26a){return function(_0x374be3){if(!_0x374be3){_0x521f2a[_0x7ba1('0x18')](0x194);}return _0x374be3;};}function handleError(_0x4485f4,_0x45d480){_0x45d480=_0x45d480||0x1f4;return function(_0x3a9ebe){logger[_0x7ba1('0x27')](_0x3a9ebe[_0x7ba1('0x28')]);if(_0x3a9ebe[_0x7ba1('0x29')]){delete _0x3a9ebe[_0x7ba1('0x29')];}_0x4485f4[_0x7ba1('0x19')](_0x45d480)['send'](_0x3a9ebe);};}exports[_0x7ba1('0x2a')]=function(_0x295aa7,_0x1ce15b){var _0x3dcae4={},_0x3045d5={},_0x217ff5={'count':0x0,'rows':[]};var _0xb8e424=_[_0x7ba1('0x2b')](db[_0x7ba1('0x2c')]['rawAttributes'],function(_0x4fdead){return{'name':_0x4fdead[_0x7ba1('0x2d')],'type':_0x4fdead['type'][_0x7ba1('0x2e')]};});_0x3045d5[_0x7ba1('0x2f')]=_[_0x7ba1('0x2b')](_0xb8e424,_0x7ba1('0x29'));_0x3045d5[_0x7ba1('0x30')]=_['keys'](_0x295aa7[_0x7ba1('0x30')]);_0x3045d5[_0x7ba1('0x31')]=_[_0x7ba1('0x32')](_0x3045d5['model'],_0x3045d5[_0x7ba1('0x30')]);_0x3dcae4['attributes']=_[_0x7ba1('0x32')](_0x3045d5['model'],qs[_0x7ba1('0x33')](_0x295aa7[_0x7ba1('0x30')]['fields']));_0x3dcae4[_0x7ba1('0x34')]=_0x3dcae4[_0x7ba1('0x34')]['length']?_0x3dcae4[_0x7ba1('0x34')]:_0x3045d5[_0x7ba1('0x2f')];if(!_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x35')]('nolimit')){_0x3dcae4['limit']=qs[_0x7ba1('0x1c')](_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x1c')]);_0x3dcae4['offset']=qs[_0x7ba1('0x1d')](_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x1d')]);}_0x3dcae4[_0x7ba1('0x36')]=qs[_0x7ba1('0x37')](_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x37')]);_0x3dcae4[_0x7ba1('0x38')]=qs['filters'](_[_0x7ba1('0x39')](_0x295aa7['query'],_0x3045d5[_0x7ba1('0x31')]),_0xb8e424);if(_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x3a')]){_0x3dcae4[_0x7ba1('0x38')]=_[_0x7ba1('0x3b')](_0x3dcae4[_0x7ba1('0x38')],{'$or':_[_0x7ba1('0x2b')](_0xb8e424,function(_0x55e3a1){if(_0x55e3a1[_0x7ba1('0x3c')]!=='VIRTUAL'){var _0x276c08={};_0x276c08[_0x55e3a1['name']]={'$like':'%'+_0x295aa7['query'][_0x7ba1('0x3a')]+'%'};return _0x276c08;}})});}_0x3dcae4=_['merge']({},_0x3dcae4,_0x295aa7['options']);var _0x267b52={'where':_0x3dcae4[_0x7ba1('0x38')]};return db[_0x7ba1('0x2c')][_0x7ba1('0x1e')](_0x267b52)[_0x7ba1('0x24')](function(_0x195a31){_0x217ff5[_0x7ba1('0x1e')]=_0x195a31;if(_0x295aa7[_0x7ba1('0x30')][_0x7ba1('0x3d')]){_0x3dcae4[_0x7ba1('0x3e')]=[{'all':!![]}];}return db[_0x7ba1('0x2c')][_0x7ba1('0x3f')](_0x3dcae4);})[_0x7ba1('0x24')](function(_0xd701b7){_0x217ff5[_0x7ba1('0x40')]=_0xd701b7;return _0x217ff5;})[_0x7ba1('0x24')](respondWithFilteredResult(_0x1ce15b,_0x3dcae4))[_0x7ba1('0x41')](handleError(_0x1ce15b,null));};exports[_0x7ba1('0x42')]=function(_0x1abfce,_0x5c352c){var _0x29f16b={'raw':![],'where':{'id':_0x1abfce[_0x7ba1('0x43')]['id']}},_0x52e4be={};_0x52e4be[_0x7ba1('0x2f')]=_[_0x7ba1('0x44')](db[_0x7ba1('0x2c')][_0x7ba1('0x45')]);_0x52e4be[_0x7ba1('0x30')]=_[_0x7ba1('0x44')](_0x1abfce[_0x7ba1('0x30')]);_0x52e4be[_0x7ba1('0x31')]=_[_0x7ba1('0x32')](_0x52e4be['model'],_0x52e4be[_0x7ba1('0x30')]);_0x29f16b[_0x7ba1('0x34')]=_[_0x7ba1('0x32')](_0x52e4be[_0x7ba1('0x2f')],qs[_0x7ba1('0x33')](_0x1abfce[_0x7ba1('0x30')][_0x7ba1('0x33')]));_0x29f16b[_0x7ba1('0x34')]=_0x29f16b[_0x7ba1('0x34')][_0x7ba1('0x46')]?_0x29f16b['attributes']:_0x52e4be[_0x7ba1('0x2f')];if(_0x1abfce[_0x7ba1('0x30')]['includeAll']){_0x29f16b[_0x7ba1('0x3e')]=[{'all':!![]}];}_0x29f16b=_[_0x7ba1('0x3b')]({},_0x29f16b,_0x1abfce['options']);return db['Automation']['find'](_0x29f16b)['then'](handleEntityNotFound(_0x5c352c,null))[_0x7ba1('0x24')](respondWithResult(_0x5c352c,null))[_0x7ba1('0x41')](handleError(_0x5c352c,null));};exports['create']=function(_0x3851eb,_0x5143bb){return db['Automation'][_0x7ba1('0x47')](_0x3851eb[_0x7ba1('0x48')],{})[_0x7ba1('0x24')](respondWithResult(_0x5143bb,0xc9))[_0x7ba1('0x41')](handleError(_0x5143bb,null));};exports['update']=function(_0x415ed6,_0x3c80c5){if(_0x415ed6[_0x7ba1('0x48')]['id']){delete _0x415ed6[_0x7ba1('0x48')]['id'];}return db['Automation'][_0x7ba1('0x49')]({'where':{'id':_0x415ed6[_0x7ba1('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c80c5,null))[_0x7ba1('0x24')](saveUpdates(_0x415ed6['body'],null))[_0x7ba1('0x24')](respondWithResult(_0x3c80c5,null))['catch'](handleError(_0x3c80c5,null));};exports[_0x7ba1('0x25')]=function(_0x286db4,_0x1f426a){return db[_0x7ba1('0x2c')][_0x7ba1('0x49')]({'where':{'id':_0x286db4[_0x7ba1('0x43')]['id']}})[_0x7ba1('0x24')](handleEntityNotFound(_0x1f426a,null))['then'](removeEntity(_0x1f426a,null))['catch'](handleError(_0x1f426a,null));};exports[_0x7ba1('0x4a')]=function(_0x2d2a87,_0x1d44aa,_0x48c6c4){return db['Condition'][_0x7ba1('0x49')]({'where':{'id':_0x2d2a87[_0x7ba1('0x43')]['id']}})[_0x7ba1('0x24')](handleEntityNotFound(_0x1d44aa,null))[_0x7ba1('0x24')](function(_0xdd7a91){if(_0xdd7a91){return _0xdd7a91[_0x7ba1('0x4a')](_0x2d2a87[_0x7ba1('0x48')][_0x7ba1('0x4b')],_[_0x7ba1('0x4c')](_0x2d2a87['body'],[_0x7ba1('0x4b'),'id'])||{});}})[_0x7ba1('0x24')](respondWithResult(_0x1d44aa,null))[_0x7ba1('0x41')](handleError(_0x1d44aa,null));};exports[_0x7ba1('0x4d')]=function(_0x12c961,_0x3ef5d8,_0x59f585){var _0x384e89={};var _0x178ebc={};var _0x1dda8c;var _0xf1585f;return db['Automation']['findOne']({'where':{'id':_0x12c961[_0x7ba1('0x43')]['id']}})[_0x7ba1('0x24')](handleEntityNotFound(_0x3ef5d8,null))[_0x7ba1('0x24')](function(_0x59ca97){if(_0x59ca97){_0x1dda8c=_0x59ca97;_0x178ebc[_0x7ba1('0x2f')]=_[_0x7ba1('0x44')](db[_0x7ba1('0x4e')][_0x7ba1('0x45')]);_0x178ebc[_0x7ba1('0x30')]=_['keys'](_0x12c961['query']);_0x178ebc['filters']=_[_0x7ba1('0x32')](_0x178ebc[_0x7ba1('0x2f')],_0x178ebc['query']);_0x384e89[_0x7ba1('0x34')]=_[_0x7ba1('0x32')](_0x178ebc[_0x7ba1('0x2f')],qs[_0x7ba1('0x33')](_0x12c961[_0x7ba1('0x30')][_0x7ba1('0x33')]));_0x384e89[_0x7ba1('0x34')]=_0x384e89[_0x7ba1('0x34')][_0x7ba1('0x46')]?_0x384e89[_0x7ba1('0x34')]:_0x178ebc[_0x7ba1('0x2f')];_0x384e89[_0x7ba1('0x36')]=qs[_0x7ba1('0x37')](_0x12c961['query'][_0x7ba1('0x37')]);_0x384e89['where']=qs[_0x7ba1('0x31')](_[_0x7ba1('0x39')](_0x12c961[_0x7ba1('0x30')],_0x178ebc['filters']));if(_0x12c961[_0x7ba1('0x30')][_0x7ba1('0x3a')]){_0x384e89[_0x7ba1('0x38')]=_[_0x7ba1('0x3b')](_0x384e89[_0x7ba1('0x38')],{'$or':_['map'](_0x384e89[_0x7ba1('0x34')],function(_0x834f7a){var _0x40e0cf={};_0x40e0cf[_0x834f7a]={'$like':'%'+_0x12c961[_0x7ba1('0x30')][_0x7ba1('0x3a')]+'%'};return _0x40e0cf;})});}_0x384e89=_[_0x7ba1('0x3b')]({},_0x384e89,_0x12c961['options']);return _0x1dda8c['getConditions'](_0x384e89);}})['then'](function(_0x1a3a12){if(_0x1a3a12){_0xf1585f=_0x1a3a12[_0x7ba1('0x46')];if(!_0x12c961[_0x7ba1('0x30')]['hasOwnProperty'](_0x7ba1('0x4f'))){_0x384e89[_0x7ba1('0x1c')]=qs[_0x7ba1('0x1c')](_0x12c961[_0x7ba1('0x30')]['limit']);_0x384e89[_0x7ba1('0x1d')]=qs['offset'](_0x12c961[_0x7ba1('0x30')][_0x7ba1('0x1d')]);}return _0x1dda8c[_0x7ba1('0x4d')](_0x384e89);}})['then'](function(_0x41df6d){if(_0x41df6d){return _0x41df6d?{'count':_0xf1585f,'rows':_0x41df6d}:null;}})[_0x7ba1('0x24')](respondWithResult(_0x3ef5d8,null))['catch'](handleError(_0x3ef5d8,null));};exports[_0x7ba1('0x50')]=function(_0x2e9c07,_0x1f218b,_0x3dc6f8){return db['Action']['find']({'where':{'id':_0x2e9c07['params']['id']}})['then'](handleEntityNotFound(_0x1f218b,null))[_0x7ba1('0x24')](function(_0x21b049){if(_0x21b049){return _0x21b049[_0x7ba1('0x50')](_0x2e9c07['body'][_0x7ba1('0x4b')],_[_0x7ba1('0x4c')](_0x2e9c07[_0x7ba1('0x48')],['ids','id'])||{});}})[_0x7ba1('0x24')](respondWithResult(_0x1f218b,null))[_0x7ba1('0x41')](handleError(_0x1f218b,null));};exports[_0x7ba1('0x51')]=function(_0x545e32,_0x9fab0b,_0x387daa){var _0x25e9ff={};var _0x42e2f6={};var _0x112215;var _0x202d3b;return db['Automation'][_0x7ba1('0x52')]({'where':{'id':_0x545e32['params']['id']}})[_0x7ba1('0x24')](handleEntityNotFound(_0x9fab0b,null))[_0x7ba1('0x24')](function(_0x4083c1){if(_0x4083c1){_0x112215=_0x4083c1;_0x42e2f6[_0x7ba1('0x2f')]=_['keys'](db[_0x7ba1('0x53')][_0x7ba1('0x45')]);_0x42e2f6[_0x7ba1('0x30')]=_['keys'](_0x545e32[_0x7ba1('0x30')]);_0x42e2f6[_0x7ba1('0x31')]=_[_0x7ba1('0x32')](_0x42e2f6['model'],_0x42e2f6['query']);_0x25e9ff['attributes']=_[_0x7ba1('0x32')](_0x42e2f6[_0x7ba1('0x2f')],qs[_0x7ba1('0x33')](_0x545e32[_0x7ba1('0x30')][_0x7ba1('0x33')]));_0x25e9ff[_0x7ba1('0x34')]=_0x25e9ff[_0x7ba1('0x34')][_0x7ba1('0x46')]?_0x25e9ff[_0x7ba1('0x34')]:_0x42e2f6[_0x7ba1('0x2f')];_0x25e9ff['order']=qs[_0x7ba1('0x37')](_0x545e32[_0x7ba1('0x30')][_0x7ba1('0x37')]);_0x25e9ff[_0x7ba1('0x38')]=qs[_0x7ba1('0x31')](_[_0x7ba1('0x39')](_0x545e32[_0x7ba1('0x30')],_0x42e2f6['filters']));if(_0x545e32[_0x7ba1('0x30')][_0x7ba1('0x3a')]){_0x25e9ff['where']=_[_0x7ba1('0x3b')](_0x25e9ff[_0x7ba1('0x38')],{'$or':_['map'](_0x25e9ff[_0x7ba1('0x34')],function(_0x9700b2){var _0xc67df9={};_0xc67df9[_0x9700b2]={'$like':'%'+_0x545e32[_0x7ba1('0x30')]['filter']+'%'};return _0xc67df9;})});}_0x25e9ff=_['merge']({},_0x25e9ff,_0x545e32[_0x7ba1('0x54')]);return _0x112215[_0x7ba1('0x51')](_0x25e9ff);}})[_0x7ba1('0x24')](function(_0x293bf1){if(_0x293bf1){_0x202d3b=_0x293bf1[_0x7ba1('0x46')];if(!_0x545e32['query'][_0x7ba1('0x35')](_0x7ba1('0x4f'))){_0x25e9ff[_0x7ba1('0x1c')]=qs[_0x7ba1('0x1c')](_0x545e32['query'][_0x7ba1('0x1c')]);_0x25e9ff[_0x7ba1('0x1d')]=qs['offset'](_0x545e32[_0x7ba1('0x30')][_0x7ba1('0x1d')]);}return _0x112215[_0x7ba1('0x51')](_0x25e9ff);}})[_0x7ba1('0x24')](function(_0x42d74d){if(_0x42d74d){return _0x42d74d?{'count':_0x202d3b,'rows':_0x42d74d}:null;}})[_0x7ba1('0x24')](respondWithResult(_0x9fab0b,null))[_0x7ba1('0x41')](handleError(_0x9fab0b,null));}; \ No newline at end of file +var _0x3ac5=['fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','Automation','includeAll','options','create','body','update','find','Condition','addConditions','ids','omit','getConditions','findOne','filter','Action','getActions','rimraf','request-promise','moment','util','path','sox','ejs'];(function(_0x2c751b,_0xc274fc){var _0xfe04b8=function(_0x15c001){while(--_0x15c001){_0x2c751b['push'](_0x2c751b['shift']());}};_0xfe04b8(++_0xc274fc);}(_0x3ac5,0xf2));var _0x53ac=function(_0x53a2e9,_0x360496){_0x53a2e9=_0x53a2e9-0x0;var _0x42f6b2=_0x3ac5[_0x53a2e9];return _0x42f6b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53ac('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x53ac('0x1'));var moment=require(_0x53ac('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x53ac('0x3'));var path=require(_0x53ac('0x4'));var sox=require(_0x53ac('0x5'));var csv=require('to-csv');var ejs=require(_0x53ac('0x6'));var fs=require('fs');var fs_extra=require(_0x53ac('0x7'));var _=require('lodash');var squel=require(_0x53ac('0x8'));var crypto=require(_0x53ac('0x9'));var jsforce=require(_0x53ac('0xa'));var deskjs=require(_0x53ac('0xb'));var toCsv=require(_0x53ac('0xc'));var querystring=require(_0x53ac('0xd'));var Papa=require(_0x53ac('0xe'));var Redis=require('ioredis');var authService=require(_0x53ac('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x53ac('0x10'));var hardwareService=require(_0x53ac('0x11'));var logger=require(_0x53ac('0x12'))(_0x53ac('0x13'));var utils=require(_0x53ac('0x14'));var config=require(_0x53ac('0x15'));var licenseUtil=require(_0x53ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a714,_0x1ed0c3){_0x1ed0c3=_0x1ed0c3||0xcc;return function(_0x1b81b3){if(_0x1b81b3){return _0x32a714['sendStatus'](_0x1ed0c3);}return _0x32a714[_0x53ac('0x17')](_0x1ed0c3)[_0x53ac('0x18')]();};}function respondWithResult(_0x1ff8f3,_0x5a5c54){_0x5a5c54=_0x5a5c54||0xc8;return function(_0x579216){if(_0x579216){return _0x1ff8f3[_0x53ac('0x17')](_0x5a5c54)[_0x53ac('0x19')](_0x579216);}};}function respondWithFilteredResult(_0x5021ea,_0x3ae7be){return function(_0x92c422){if(_0x92c422){var _0x1b8bf4=typeof _0x3ae7be[_0x53ac('0x1a')]===_0x53ac('0x1b')&&typeof _0x3ae7be[_0x53ac('0x1c')]==='undefined';var _0x28303b=_0x92c422['count'];var _0x303c36=_0x1b8bf4?0x0:_0x3ae7be['offset'];var _0x1af8b8=_0x1b8bf4?_0x92c422[_0x53ac('0x1d')]:_0x3ae7be[_0x53ac('0x1a')]+_0x3ae7be[_0x53ac('0x1c')];var _0x42bc52;if(_0x1af8b8>=_0x28303b){_0x1af8b8=_0x28303b;_0x42bc52=0xc8;}else{_0x42bc52=0xce;}_0x5021ea[_0x53ac('0x17')](_0x42bc52);return _0x5021ea[_0x53ac('0x1e')](_0x53ac('0x1f'),_0x303c36+'-'+_0x1af8b8+'/'+_0x28303b)[_0x53ac('0x19')](_0x92c422);}return null;};}function patchUpdates(_0x345d06){return function(_0x516ca7){try{jsonpatch['apply'](_0x516ca7,_0x345d06,!![]);}catch(_0x8e1a5c){return BPromise[_0x53ac('0x20')](_0x8e1a5c);}return _0x516ca7['save']();};}function saveUpdates(_0x3cb12a,_0x118c26){return function(_0x577284){if(_0x577284){return _0x577284['update'](_0x3cb12a)[_0x53ac('0x21')](function(_0x218b81){return _0x218b81;});}return null;};}function removeEntity(_0x36f133,_0x5e026b){return function(_0x5be0b3){if(_0x5be0b3){return _0x5be0b3[_0x53ac('0x22')]()['then'](function(){_0x36f133[_0x53ac('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429e56,_0x129edf){return function(_0x5e187d){if(!_0x5e187d){_0x429e56[_0x53ac('0x23')](0x194);}return _0x5e187d;};}function handleError(_0x21e03f,_0x28a839){_0x28a839=_0x28a839||0x1f4;return function(_0xf21c43){logger[_0x53ac('0x24')](_0xf21c43[_0x53ac('0x25')]);if(_0xf21c43['name']){delete _0xf21c43[_0x53ac('0x26')];}_0x21e03f[_0x53ac('0x17')](_0x28a839)[_0x53ac('0x27')](_0xf21c43);};}exports[_0x53ac('0x28')]=function(_0x4afc84,_0x58e3cb){var _0x4a7042={},_0x2b9338={},_0x1e96a5={'count':0x0,'rows':[]};var _0x573490=_[_0x53ac('0x29')](db['Automation'][_0x53ac('0x2a')],function(_0x3341a9){return{'name':_0x3341a9[_0x53ac('0x2b')],'type':_0x3341a9[_0x53ac('0x2c')][_0x53ac('0x2d')]};});_0x2b9338[_0x53ac('0x2e')]=_[_0x53ac('0x29')](_0x573490,_0x53ac('0x26'));_0x2b9338['query']=_['keys'](_0x4afc84[_0x53ac('0x2f')]);_0x2b9338[_0x53ac('0x30')]=_[_0x53ac('0x31')](_0x2b9338['model'],_0x2b9338[_0x53ac('0x2f')]);_0x4a7042['attributes']=_['intersection'](_0x2b9338[_0x53ac('0x2e')],qs[_0x53ac('0x32')](_0x4afc84[_0x53ac('0x2f')][_0x53ac('0x32')]));_0x4a7042[_0x53ac('0x33')]=_0x4a7042[_0x53ac('0x33')][_0x53ac('0x34')]?_0x4a7042[_0x53ac('0x33')]:_0x2b9338[_0x53ac('0x2e')];if(!_0x4afc84[_0x53ac('0x2f')]['hasOwnProperty'](_0x53ac('0x35'))){_0x4a7042[_0x53ac('0x1c')]=qs[_0x53ac('0x1c')](_0x4afc84[_0x53ac('0x2f')][_0x53ac('0x1c')]);_0x4a7042[_0x53ac('0x1a')]=qs['offset'](_0x4afc84[_0x53ac('0x2f')]['offset']);}_0x4a7042[_0x53ac('0x36')]=qs[_0x53ac('0x37')](_0x4afc84['query'][_0x53ac('0x37')]);_0x4a7042[_0x53ac('0x38')]=qs[_0x53ac('0x30')](_[_0x53ac('0x39')](_0x4afc84['query'],_0x2b9338[_0x53ac('0x30')]),_0x573490);if(_0x4afc84['query']['filter']){_0x4a7042[_0x53ac('0x38')]=_['merge'](_0x4a7042['where'],{'$or':_[_0x53ac('0x29')](_0x573490,function(_0x15d890){if(_0x15d890['type']!==_0x53ac('0x3a')){var _0x150886={};_0x150886[_0x15d890[_0x53ac('0x26')]]={'$like':'%'+_0x4afc84[_0x53ac('0x2f')]['filter']+'%'};return _0x150886;}})});}_0x4a7042=_[_0x53ac('0x3b')]({},_0x4a7042,_0x4afc84['options']);var _0x49cac9={'where':_0x4a7042['where']};return db['Automation'][_0x53ac('0x1d')](_0x49cac9)['then'](function(_0x16d3a0){_0x1e96a5[_0x53ac('0x1d')]=_0x16d3a0;if(_0x4afc84[_0x53ac('0x2f')]['includeAll']){_0x4a7042[_0x53ac('0x3c')]=[{'all':!![]}];}return db['Automation'][_0x53ac('0x3d')](_0x4a7042);})['then'](function(_0x4a7502){_0x1e96a5[_0x53ac('0x3e')]=_0x4a7502;return _0x1e96a5;})[_0x53ac('0x21')](respondWithFilteredResult(_0x58e3cb,_0x4a7042))[_0x53ac('0x3f')](handleError(_0x58e3cb,null));};exports[_0x53ac('0x40')]=function(_0x39f8dd,_0x2cc091){var _0xc69c24={'raw':![],'where':{'id':_0x39f8dd[_0x53ac('0x41')]['id']}},_0x31612c={};_0x31612c[_0x53ac('0x2e')]=_[_0x53ac('0x42')](db[_0x53ac('0x43')][_0x53ac('0x2a')]);_0x31612c[_0x53ac('0x2f')]=_[_0x53ac('0x42')](_0x39f8dd[_0x53ac('0x2f')]);_0x31612c[_0x53ac('0x30')]=_[_0x53ac('0x31')](_0x31612c[_0x53ac('0x2e')],_0x31612c[_0x53ac('0x2f')]);_0xc69c24[_0x53ac('0x33')]=_[_0x53ac('0x31')](_0x31612c['model'],qs[_0x53ac('0x32')](_0x39f8dd[_0x53ac('0x2f')][_0x53ac('0x32')]));_0xc69c24[_0x53ac('0x33')]=_0xc69c24[_0x53ac('0x33')][_0x53ac('0x34')]?_0xc69c24[_0x53ac('0x33')]:_0x31612c[_0x53ac('0x2e')];if(_0x39f8dd[_0x53ac('0x2f')][_0x53ac('0x44')]){_0xc69c24[_0x53ac('0x3c')]=[{'all':!![]}];}_0xc69c24=_[_0x53ac('0x3b')]({},_0xc69c24,_0x39f8dd[_0x53ac('0x45')]);return db[_0x53ac('0x43')]['find'](_0xc69c24)[_0x53ac('0x21')](handleEntityNotFound(_0x2cc091,null))[_0x53ac('0x21')](respondWithResult(_0x2cc091,null))[_0x53ac('0x3f')](handleError(_0x2cc091,null));};exports['create']=function(_0x4ae90d,_0x5c4c23){return db[_0x53ac('0x43')][_0x53ac('0x46')](_0x4ae90d[_0x53ac('0x47')],{})[_0x53ac('0x21')](respondWithResult(_0x5c4c23,0xc9))[_0x53ac('0x3f')](handleError(_0x5c4c23,null));};exports[_0x53ac('0x48')]=function(_0x483e36,_0xe1a2d){if(_0x483e36[_0x53ac('0x47')]['id']){delete _0x483e36[_0x53ac('0x47')]['id'];}return db[_0x53ac('0x43')][_0x53ac('0x49')]({'where':{'id':_0x483e36[_0x53ac('0x41')]['id']}})[_0x53ac('0x21')](handleEntityNotFound(_0xe1a2d,null))[_0x53ac('0x21')](saveUpdates(_0x483e36['body'],null))['then'](respondWithResult(_0xe1a2d,null))[_0x53ac('0x3f')](handleError(_0xe1a2d,null));};exports[_0x53ac('0x22')]=function(_0x5db0a0,_0x34b114){return db[_0x53ac('0x43')][_0x53ac('0x49')]({'where':{'id':_0x5db0a0['params']['id']}})[_0x53ac('0x21')](handleEntityNotFound(_0x34b114,null))[_0x53ac('0x21')](removeEntity(_0x34b114,null))['catch'](handleError(_0x34b114,null));};exports['addConditions']=function(_0x201fc4,_0x5349f6,_0x172249){return db[_0x53ac('0x4a')][_0x53ac('0x49')]({'where':{'id':_0x201fc4[_0x53ac('0x41')]['id']}})['then'](handleEntityNotFound(_0x5349f6,null))['then'](function(_0x2e8c32){if(_0x2e8c32){return _0x2e8c32[_0x53ac('0x4b')](_0x201fc4[_0x53ac('0x47')][_0x53ac('0x4c')],_[_0x53ac('0x4d')](_0x201fc4[_0x53ac('0x47')],[_0x53ac('0x4c'),'id'])||{});}})[_0x53ac('0x21')](respondWithResult(_0x5349f6,null))[_0x53ac('0x3f')](handleError(_0x5349f6,null));};exports[_0x53ac('0x4e')]=function(_0x3b9035,_0x27b2a6,_0x379ed1){var _0x3eee76={};var _0x191fa3={};var _0x230882;var _0x2faf97;return db[_0x53ac('0x43')][_0x53ac('0x4f')]({'where':{'id':_0x3b9035[_0x53ac('0x41')]['id']}})[_0x53ac('0x21')](handleEntityNotFound(_0x27b2a6,null))[_0x53ac('0x21')](function(_0x540369){if(_0x540369){_0x230882=_0x540369;_0x191fa3[_0x53ac('0x2e')]=_['keys'](db[_0x53ac('0x4a')]['rawAttributes']);_0x191fa3[_0x53ac('0x2f')]=_['keys'](_0x3b9035[_0x53ac('0x2f')]);_0x191fa3[_0x53ac('0x30')]=_[_0x53ac('0x31')](_0x191fa3[_0x53ac('0x2e')],_0x191fa3[_0x53ac('0x2f')]);_0x3eee76[_0x53ac('0x33')]=_[_0x53ac('0x31')](_0x191fa3['model'],qs[_0x53ac('0x32')](_0x3b9035[_0x53ac('0x2f')][_0x53ac('0x32')]));_0x3eee76[_0x53ac('0x33')]=_0x3eee76[_0x53ac('0x33')][_0x53ac('0x34')]?_0x3eee76[_0x53ac('0x33')]:_0x191fa3[_0x53ac('0x2e')];_0x3eee76['order']=qs['sort'](_0x3b9035['query'][_0x53ac('0x37')]);_0x3eee76['where']=qs['filters'](_[_0x53ac('0x39')](_0x3b9035[_0x53ac('0x2f')],_0x191fa3[_0x53ac('0x30')]));if(_0x3b9035['query'][_0x53ac('0x50')]){_0x3eee76[_0x53ac('0x38')]=_[_0x53ac('0x3b')](_0x3eee76[_0x53ac('0x38')],{'$or':_[_0x53ac('0x29')](_0x3eee76[_0x53ac('0x33')],function(_0x1cec80){var _0x22442f={};_0x22442f[_0x1cec80]={'$like':'%'+_0x3b9035[_0x53ac('0x2f')][_0x53ac('0x50')]+'%'};return _0x22442f;})});}_0x3eee76=_[_0x53ac('0x3b')]({},_0x3eee76,_0x3b9035[_0x53ac('0x45')]);return _0x230882[_0x53ac('0x4e')](_0x3eee76);}})['then'](function(_0xeac279){if(_0xeac279){_0x2faf97=_0xeac279[_0x53ac('0x34')];if(!_0x3b9035[_0x53ac('0x2f')]['hasOwnProperty'](_0x53ac('0x35'))){_0x3eee76['limit']=qs[_0x53ac('0x1c')](_0x3b9035[_0x53ac('0x2f')]['limit']);_0x3eee76[_0x53ac('0x1a')]=qs[_0x53ac('0x1a')](_0x3b9035[_0x53ac('0x2f')][_0x53ac('0x1a')]);}return _0x230882[_0x53ac('0x4e')](_0x3eee76);}})['then'](function(_0x780ff5){if(_0x780ff5){return _0x780ff5?{'count':_0x2faf97,'rows':_0x780ff5}:null;}})[_0x53ac('0x21')](respondWithResult(_0x27b2a6,null))[_0x53ac('0x3f')](handleError(_0x27b2a6,null));};exports['addActions']=function(_0x4d69c8,_0x2d44da,_0x5d3373){return db[_0x53ac('0x51')][_0x53ac('0x49')]({'where':{'id':_0x4d69c8[_0x53ac('0x41')]['id']}})[_0x53ac('0x21')](handleEntityNotFound(_0x2d44da,null))['then'](function(_0x15b6c0){if(_0x15b6c0){return _0x15b6c0['addActions'](_0x4d69c8['body']['ids'],_['omit'](_0x4d69c8[_0x53ac('0x47')],[_0x53ac('0x4c'),'id'])||{});}})[_0x53ac('0x21')](respondWithResult(_0x2d44da,null))['catch'](handleError(_0x2d44da,null));};exports['getActions']=function(_0x1c4325,_0x102b06,_0x3d0c71){var _0x382e51={};var _0x50dc41={};var _0x45ce8d;var _0x1dc1dd;return db[_0x53ac('0x43')][_0x53ac('0x4f')]({'where':{'id':_0x1c4325[_0x53ac('0x41')]['id']}})[_0x53ac('0x21')](handleEntityNotFound(_0x102b06,null))[_0x53ac('0x21')](function(_0xa34d4f){if(_0xa34d4f){_0x45ce8d=_0xa34d4f;_0x50dc41[_0x53ac('0x2e')]=_[_0x53ac('0x42')](db[_0x53ac('0x51')][_0x53ac('0x2a')]);_0x50dc41[_0x53ac('0x2f')]=_['keys'](_0x1c4325[_0x53ac('0x2f')]);_0x50dc41[_0x53ac('0x30')]=_[_0x53ac('0x31')](_0x50dc41[_0x53ac('0x2e')],_0x50dc41['query']);_0x382e51[_0x53ac('0x33')]=_['intersection'](_0x50dc41[_0x53ac('0x2e')],qs[_0x53ac('0x32')](_0x1c4325[_0x53ac('0x2f')][_0x53ac('0x32')]));_0x382e51['attributes']=_0x382e51[_0x53ac('0x33')]['length']?_0x382e51[_0x53ac('0x33')]:_0x50dc41[_0x53ac('0x2e')];_0x382e51[_0x53ac('0x36')]=qs['sort'](_0x1c4325[_0x53ac('0x2f')][_0x53ac('0x37')]);_0x382e51[_0x53ac('0x38')]=qs[_0x53ac('0x30')](_['pick'](_0x1c4325[_0x53ac('0x2f')],_0x50dc41[_0x53ac('0x30')]));if(_0x1c4325['query'][_0x53ac('0x50')]){_0x382e51['where']=_[_0x53ac('0x3b')](_0x382e51['where'],{'$or':_['map'](_0x382e51[_0x53ac('0x33')],function(_0x47d6fb){var _0x8d2f7b={};_0x8d2f7b[_0x47d6fb]={'$like':'%'+_0x1c4325[_0x53ac('0x2f')][_0x53ac('0x50')]+'%'};return _0x8d2f7b;})});}_0x382e51=_[_0x53ac('0x3b')]({},_0x382e51,_0x1c4325[_0x53ac('0x45')]);return _0x45ce8d['getActions'](_0x382e51);}})[_0x53ac('0x21')](function(_0x9ad9ec){if(_0x9ad9ec){_0x1dc1dd=_0x9ad9ec[_0x53ac('0x34')];if(!_0x1c4325[_0x53ac('0x2f')]['hasOwnProperty'](_0x53ac('0x35'))){_0x382e51[_0x53ac('0x1c')]=qs['limit'](_0x1c4325[_0x53ac('0x2f')]['limit']);_0x382e51[_0x53ac('0x1a')]=qs['offset'](_0x1c4325[_0x53ac('0x2f')][_0x53ac('0x1a')]);}return _0x45ce8d[_0x53ac('0x52')](_0x382e51);}})[_0x53ac('0x21')](function(_0xc42434){if(_0xc42434){return _0xc42434?{'count':_0x1dc1dd,'rows':_0xc42434}:null;}})[_0x53ac('0x21')](respondWithResult(_0x102b06,null))['catch'](handleError(_0x102b06,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c4a7c6e..c08e188 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 _0x76da=['request-promise','path','rimraf','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b39bb,_0xc99414){var _0x1bf082=function(_0x9db8b3){while(--_0x9db8b3){_0x1b39bb['push'](_0x1b39bb['shift']());}};_0x1bf082(++_0xc99414);}(_0x76da,0x1b6));var _0xa76d=function(_0x38221a,_0x565fce){_0x38221a=_0x38221a-0x0;var _0x2a8a7a=_0x76da[_0x38221a];return _0x2a8a7a;};'use strict';var _=require(_0xa76d('0x0'));var util=require(_0xa76d('0x1'));var logger=require(_0xa76d('0x2'))(_0xa76d('0x3'));var moment=require(_0xa76d('0x4'));var BPromise=require(_0xa76d('0x5'));var rp=require(_0xa76d('0x6'));var fs=require('fs');var path=require(_0xa76d('0x7'));var rimraf=require(_0xa76d('0x8'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x2bf840,_0xbb83c1){return _0x2bf840[_0xa76d('0x9')](_0xa76d('0xa'),attributes,{'tableName':_0xa76d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce7e=['Automation','tools_automations','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x52a01f,_0x476c6a){var _0x37748f=function(_0x51ab39){while(--_0x51ab39){_0x52a01f['push'](_0x52a01f['shift']());}};_0x37748f(++_0x476c6a);}(_0xce7e,0x10a));var _0xece7=function(_0x494b57,_0x34c8e8){_0x494b57=_0x494b57-0x0;var _0x267d16=_0xce7e[_0x494b57];return _0x267d16;};'use strict';var _=require('lodash');var util=require(_0xece7('0x0'));var logger=require('../../config/logger')(_0xece7('0x1'));var moment=require(_0xece7('0x2'));var BPromise=require(_0xece7('0x3'));var rp=require(_0xece7('0x4'));var fs=require('fs');var path=require(_0xece7('0x5'));var rimraf=require(_0xece7('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xece7('0x7')]=function(_0x102118,_0x84ca6f){return _0x102118[_0xece7('0x8')](_0xece7('0x9'),attributes,{'tableName':_0xece7('0xa'),'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 6cdc69d..1b6dcc6 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 _0xaa5e=['stringify','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x351082,_0x5a4f8f){var _0x2b83bf=function(_0x3ffcf3){while(--_0x3ffcf3){_0x351082['push'](_0x351082['shift']());}};_0x2b83bf(++_0x5a4f8f);}(_0xaa5e,0xa5));var _0xeaa5=function(_0xa8131,_0x713286){_0xa8131=_0xa8131-0x0;var _0x566f86=_0xaa5e[_0xa8131];return _0x566f86;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});} \ No newline at end of file +var _0x689b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','lodash','moment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x689b,0x142));var _0xb689=function(_0x2e73ab,_0x4fbbdc){_0x2e73ab=_0x2e73ab-0x0;var _0x1756eb=_0x689b[_0x2e73ab];return _0x1756eb;};'use strict';var _=require(_0xb689('0x0'));var util=require('util');var moment=require(_0xb689('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb689('0x2'));var db=require(_0xb689('0x3'))['db'];var utils=require(_0xb689('0x4'));var logger=require(_0xb689('0x5'))(_0xb689('0x6'));var config=require(_0xb689('0x7'));var jayson=require(_0xb689('0x8'));var client=jayson['client'][_0xb689('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee263,_0x47752c,_0x56c6ba){return new BPromise(function(_0x6eaf58,_0x1cad3e){return client[_0xb689('0xa')](_0x5ee263,_0x56c6ba)['then'](function(_0x14ef33){logger['info']('Automation,\x20%s,\x20%s',_0x47752c,_0xb689('0xb'));logger['debug'](_0xb689('0xc'),_0x47752c,'request\x20sent',JSON[_0xb689('0xd')](_0x14ef33));if(_0x14ef33[_0xb689('0xe')]){if(_0x14ef33[_0xb689('0xe')][_0xb689('0xf')]===0x1f4){logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x1cad3e(_0x14ef33[_0xb689('0xe')]['message']);}logger[_0xb689('0xe')](_0xb689('0x10'),_0x47752c,_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);return _0x6eaf58(_0x14ef33[_0xb689('0xe')][_0xb689('0x11')]);}else{logger['info'](_0xb689('0x10'),_0x47752c,_0xb689('0xb'));_0x6eaf58(_0x14ef33['result'][_0xb689('0x11')]);}})['catch'](function(_0xf950eb){logger['error']('Automation,\x20%s,\x20%s',_0x47752c,_0xf950eb);_0x1cad3e(_0xf950eb);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f683e03..3a5f76a 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 _0x70e9=['/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x70e9,0x193));var _0x970e=function(_0x4246fd,_0x30d0c4){_0x4246fd=_0x4246fd-0x0;var _0x4e8971=_0x70e9[_0x4246fd];return _0x4e8971;};'use strict';var multer=require('multer');var util=require(_0x970e('0x0'));var path=require(_0x970e('0x1'));var timeout=require('connect-timeout');var express=require(_0x970e('0x2'));var router=express[_0x970e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x970e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x970e('0x5'));var controller=require(_0x970e('0x6'));router[_0x970e('0x7')]('/',auth[_0x970e('0x8')](),controller[_0x970e('0x9')]);router[_0x970e('0x7')](_0x970e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x970e('0x7')](_0x970e('0xb'),auth['isAuthenticated'](),controller[_0x970e('0xc')]);router[_0x970e('0x7')](_0x970e('0xd'),auth['isAuthenticated'](),controller[_0x970e('0xe')]);router[_0x970e('0xf')]('/',auth[_0x970e('0x8')](),controller[_0x970e('0x10')]);router[_0x970e('0xf')](_0x970e('0xb'),auth['isAuthenticated'](),controller[_0x970e('0x11')]);router[_0x970e('0xf')](_0x970e('0xd'),auth[_0x970e('0x8')](),controller[_0x970e('0x12')]);router[_0x970e('0x13')](_0x970e('0xa'),auth[_0x970e('0x8')](),controller['update']);router[_0x970e('0x14')](_0x970e('0xa'),auth['isAuthenticated'](),controller[_0x970e('0x15')]);module[_0x970e('0x16')]=router; \ No newline at end of file +var _0x8832=['addActions','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','show','getConditions','/:id/actions','post'];(function(_0x18972d,_0x4e867d){var _0x450f72=function(_0x521d7b){while(--_0x521d7b){_0x18972d['push'](_0x18972d['shift']());}};_0x450f72(++_0x4e867d);}(_0x8832,0x1f4));var _0x2883=function(_0x13bdfb,_0x41772f){_0x13bdfb=_0x13bdfb-0x0;var _0x10d3a7=_0x8832[_0x13bdfb];return _0x10d3a7;};'use strict';var multer=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2883('0x2'));var router=express[_0x2883('0x3')]();var fs_extra=require(_0x2883('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2883('0x5'));var config=require('../../config/environment');var controller=require(_0x2883('0x6'));router[_0x2883('0x7')]('/',auth[_0x2883('0x8')](),controller['index']);router[_0x2883('0x7')]('/:id',auth[_0x2883('0x8')](),controller[_0x2883('0x9')]);router['get']('/:id/conditions',auth[_0x2883('0x8')](),controller[_0x2883('0xa')]);router[_0x2883('0x7')](_0x2883('0xb'),auth[_0x2883('0x8')](),controller['getActions']);router['post']('/',auth[_0x2883('0x8')](),controller['create']);router['post']('/:id/conditions',auth[_0x2883('0x8')](),controller['addConditions']);router[_0x2883('0xc')](_0x2883('0xb'),auth[_0x2883('0x8')](),controller[_0x2883('0xd')]);router[_0x2883('0xe')](_0x2883('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x2883('0x10')](_0x2883('0xf'),auth['isAuthenticated'](),controller[_0x2883('0x11')]);module[_0x2883('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index ef066bc..882cf53 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 _0x3442=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3442,0x15a));var _0x2344=function(_0x2018c6,_0x2c7b8d){_0x2018c6=_0x2018c6-0x0;var _0x43c516=_0x3442[_0x2018c6];return _0x43c516;};'use strict';var Sequelize=require('sequelize');module[_0x2344('0x0')]={'name':{'type':Sequelize[_0x2344('0x1')],'unique':_0x2344('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2344('0x3')](_0x2344('0x4')),'allowNull':![],'defaultValue':_0x2344('0x4')},'description':{'type':Sequelize[_0x2344('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2344('0x5')},'limitCalls':{'type':Sequelize[_0x2344('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2344('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2344('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2344('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2344('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x3,'comment':_0x2344('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2344('0x6')](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2344('0xf')},'dialTimezone':{'type':Sequelize[_0x2344('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2344('0x1')],'defaultValue':_0x2344('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x2344('0x3')](_0x2344('0x11'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2344('0x6')](0x9)[_0x2344('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2344('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x2344('0x6')](0x9)[_0x2344('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2344('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2344('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2344('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x2344('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2344('0x6')](0x9)[_0x2344('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2344('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2344('0x6')](0x9)[_0x2344('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2344('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2344('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2344('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2344('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2344('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2344('0x1a'),_0x2344('0x1b')),'defaultValue':_0x2344('0x1a')},'dialPrefix':{'type':Sequelize[_0x2344('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x2344('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2344('0x1c')},'dialCutDigit':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2344('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x2344('0x6')](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2344('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2344('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2344('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2344('0x25')}}; \ No newline at end of file +var _0xff33=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x1c6920,_0x355c87){var _0x3007c8=function(_0x17986b){while(--_0x17986b){_0x1c6920['push'](_0x1c6920['shift']());}};_0x3007c8(++_0x355c87);}(_0xff33,0x17a));var _0x3ff3=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0xff33[_0x23a79e];return _0x3dab57;};'use strict';var Sequelize=require('sequelize');module[_0x3ff3('0x0')]={'name':{'type':Sequelize[_0x3ff3('0x1')],'unique':_0x3ff3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3ff3('0x3')),'allowNull':![],'defaultValue':_0x3ff3('0x3')},'description':{'type':Sequelize[_0x3ff3('0x1')]},'active':{'type':Sequelize[_0x3ff3('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x3ff3('0x5')](0x4)[_0x3ff3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3ff3('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3ff3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3ff3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)[_0x3ff3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)[_0x3ff3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)[_0x3ff3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ff3('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3ff3('0xc')},'dialTimezone':{'type':Sequelize[_0x3ff3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3ff3('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x3ff3('0xd')](_0x3ff3('0xe'),_0x3ff3('0xf'),'onlyIfOpen'),'defaultValue':_0x3ff3('0xe')},'dialAMDActive':{'type':Sequelize[_0x3ff3('0x4')],'defaultValue':0x0,'comment':_0x3ff3('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3ff3('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3ff3('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3ff3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ff3('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3ff3('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3ff3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3ff3('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3ff3('0x5')](0x9)[_0x3ff3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ff3('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3ff3('0xd')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ff3('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ff3('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ff3('0x1c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3ff3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ff3('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3ff3('0x5')](0x3)[_0x3ff3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ff3('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3ff3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ff3('0x20')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 136a70b..8c8c4c5 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 _0x4024=['rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','index','map','Campaign','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CmListId','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','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','eml-format'];(function(_0x10207b,_0x4b71fc){var _0x1f944d=function(_0x905f5c){while(--_0x905f5c){_0x10207b['push'](_0x10207b['shift']());}};_0x1f944d(++_0x4b71fc);}(_0x4024,0x89));var _0x4402=function(_0x5e33c6,_0x4611e0){_0x5e33c6=_0x5e33c6-0x0;var _0x23d965=_0x4024[_0x5e33c6];return _0x23d965;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['Campaign'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['Campaign'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['Campaign'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['clone']=function(_0xe8a8e9,_0x642ab4){var _0x3f45c3={'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}},_0x295c9b={};_0x295c9b[_0x4402('0x2b')]=_[_0x4402('0x2d')](db['Campaign']['rawAttributes']);_0x3f45c3[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x295c9b[_0x4402('0x2b')],qs['fields'](_0xe8a8e9['query'][_0x4402('0x30')]));_0x3f45c3[_0x4402('0x2f')]=_0x3f45c3[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f45c3[_0x4402('0x2f')]:_0x295c9b[_0x4402('0x2b')];if(_0xe8a8e9[_0x4402('0x2c')][_0x4402('0x40')]){_0x3f45c3[_0x4402('0x39')]=[{'all':!![]}];}_0x3f45c3=_[_0x4402('0x38')]({},_0x3f45c3,_0xe8a8e9[_0x4402('0x41')]);return db[_0x4402('0x28')][_0x4402('0x42')](_0x3f45c3)['then'](handleEntityNotFound(_0x642ab4,null))[_0x4402('0x1f')](function(_0x4b7057){if(_0x4b7057){var _0xe4530a=_0x4b7057['get']({'plain':!![]});_0xe4530a=qs[_0x4402('0x4a')](_0xe4530a,['id',_0x4402('0x4b'),_0x4402('0x4c')]);_0xe8a8e9[_0x4402('0x44')]=_[_0x4402('0x4a')](_0xe8a8e9[_0x4402('0x44')],['id','createdAt',_0x4402('0x4c')]);return db[_0x4402('0x28')][_0x4402('0x43')](_[_0x4402('0x38')](_0xe4530a,_0xe8a8e9[_0x4402('0x44')]),{'include':_0xe8a8e9['query'][_0x4402('0x40')]?[{'all':!![]}]:undefined})[_0x4402('0x1f')](function(_0x474b04){var _0xc15c0b=_0xe8a8e9[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0xc15c0b)throw new Error(_0x4402('0x46'));if(_0xc15c0b[_0x4402('0x4d')]==='user'){var _0x11c1b8=_0x474b04[_0x4402('0x21')]({'plain':!![]});var _0x53a9f3=_0x4402('0x22');return db[_0x4402('0x47')]['find']({'where':{'name':_0x53a9f3,'userProfileId':_0xc15c0b['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x1746c6){if(_0x1746c6&&_0x1746c6[_0x4402('0x48')]===0x0){return db['UserProfileResource'][_0x4402('0x43')]({'name':_0x11c1b8[_0x4402('0x25')],'resourceId':_0x11c1b8['id'],'type':_0x1746c6[_0x4402('0x25')],'sectionId':_0x1746c6['id']},{})['then'](function(){return _0x474b04;});}else{return _0x474b04;}})[_0x4402('0x3c')](function(_0x41a2c6){logger[_0x4402('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41a2c6);throw _0x41a2c6;});}return _0x474b04;});}})[_0x4402('0x1f')](respondWithResult(_0x642ab4,0xc9))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['update']=function(_0x5cef56,_0x40869c){if(_0x5cef56['body']['id']){delete _0x5cef56[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')]['find']({'where':{'id':_0x5cef56['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x40869c,null))[_0x4402('0x1f')](saveUpdates(_0x5cef56[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x40869c,null))['catch'](handleError(_0x40869c,null));};exports[_0x4402('0x20')]=function(_0x30e5d5,_0x22ed41){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x30e5d5[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x22ed41,null))['then'](removeEntity(_0x22ed41,null))[_0x4402('0x3c')](handleError(_0x22ed41,null));};exports[_0x4402('0x4e')]=function(_0x559d1c,_0x508111,_0x2bee9d){var _0x4aaa60={'raw':!![],'where':{}};var _0x30569e={};var _0x586689={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x559d1c[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x508111,null))[_0x4402('0x1f')](function(_0x1c1857){if(_0x1c1857){_0x30569e[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x50')][_0x4402('0x29')]);_0x30569e[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x559d1c[_0x4402('0x2c')]);_0x30569e[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x30569e[_0x4402('0x2b')],_0x30569e['query']);_0x4aaa60[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x30569e[_0x4402('0x2b')],qs['fields'](_0x559d1c[_0x4402('0x2c')]['fields']));_0x4aaa60[_0x4402('0x2f')]=_0x4aaa60[_0x4402('0x2f')][_0x4402('0x31')]?_0x4aaa60[_0x4402('0x2f')]:_0x30569e['model'];if(!_0x559d1c[_0x4402('0x2c')]['hasOwnProperty'](_0x4402('0x33'))){_0x4aaa60[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x559d1c['query'][_0x4402('0x19')]);_0x4aaa60['offset']=qs[_0x4402('0x17')](_0x559d1c[_0x4402('0x2c')][_0x4402('0x17')]);}_0x4aaa60[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x559d1c[_0x4402('0x2c')][_0x4402('0x34')]);_0x4aaa60[_0x4402('0x35')]=qs[_0x4402('0x2e')](_['pick'](_0x559d1c[_0x4402('0x2c')],_0x30569e[_0x4402('0x2e')]));_0x4aaa60[_0x4402('0x35')][_0x4402('0x52')]=_0x1c1857['id'];if(_0x559d1c[_0x4402('0x2c')][_0x4402('0x36')]){_0x4aaa60[_0x4402('0x35')]=_[_0x4402('0x38')](_0x4aaa60[_0x4402('0x35')],{'$or':_['map'](_0x4aaa60[_0x4402('0x2f')],function(_0x2a6dc1){var _0x2eae1c={};_0x2eae1c[_0x2a6dc1]={'$like':'%'+_0x559d1c['query'][_0x4402('0x36')]+'%'};return _0x2eae1c;})});}_0x4aaa60=_['merge']({},_0x4aaa60,_0x559d1c[_0x4402('0x41')]);return db['CmHopper'][_0x4402('0x1a')]({'where':_0x4aaa60[_0x4402('0x35')]})['then'](function(_0x43b4aa){_0x586689['count']=_0x43b4aa;if(_0x559d1c[_0x4402('0x2c')][_0x4402('0x40')]){_0x4aaa60['include']=[{'all':!![]}];}return db[_0x4402('0x50')][_0x4402('0x3a')](_0x4aaa60);})['then'](function(_0x189259){_0x586689[_0x4402('0x3b')]=_0x189259;return _0x586689;});}})['then'](respondWithFilteredResult(_0x508111,_0x4aaa60))[_0x4402('0x3c')](handleError(_0x508111,null));};exports[_0x4402('0x53')]=function(_0x1a9163,_0x12b834,_0x439e95){var _0x17b133={'raw':!![],'where':{}};var _0x7f28d3={};var _0x370493={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x1a9163[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x12b834,null))[_0x4402('0x1f')](function(_0x2dd4b7){if(_0x2dd4b7){_0x7f28d3['model']=_[_0x4402('0x2d')](db[_0x4402('0x54')]['rawAttributes']);_0x7f28d3[_0x4402('0x2c')]=_['keys'](_0x1a9163[_0x4402('0x2c')]);_0x7f28d3[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x7f28d3['model'],_0x7f28d3[_0x4402('0x2c')]);_0x17b133[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x7f28d3['model'],qs[_0x4402('0x30')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x30')]));_0x17b133[_0x4402('0x2f')]=_0x17b133['attributes'][_0x4402('0x31')]?_0x17b133[_0x4402('0x2f')]:_0x7f28d3[_0x4402('0x2b')];if(!_0x1a9163[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x17b133[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x19')]);_0x17b133[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x1a9163[_0x4402('0x2c')]['offset']);}_0x17b133[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x34')]);_0x17b133['where']=qs['filters'](_[_0x4402('0x55')](_0x1a9163[_0x4402('0x2c')],_0x7f28d3[_0x4402('0x2e')]));_0x17b133[_0x4402('0x35')]['CampaignId']=_0x2dd4b7['id'];if(_0x1a9163[_0x4402('0x2c')][_0x4402('0x36')]){_0x17b133['where']=_[_0x4402('0x38')](_0x17b133[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x17b133[_0x4402('0x2f')],function(_0x297884){var _0x5f5945={};_0x5f5945[_0x297884]={'$like':'%'+_0x1a9163[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x5f5945;})});}_0x17b133=_[_0x4402('0x38')]({},_0x17b133,_0x1a9163[_0x4402('0x41')]);return db[_0x4402('0x54')][_0x4402('0x1a')]({'where':_0x17b133[_0x4402('0x35')]})['then'](function(_0x218640){_0x370493[_0x4402('0x1a')]=_0x218640;if(_0x1a9163[_0x4402('0x2c')][_0x4402('0x40')]){_0x17b133[_0x4402('0x39')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4402('0x3a')](_0x17b133);})[_0x4402('0x1f')](function(_0x572e21){_0x370493[_0x4402('0x3b')]=_0x572e21;return _0x370493;});}})['then'](respondWithFilteredResult(_0x12b834,_0x17b133))['catch'](handleError(_0x12b834,null));};exports[_0x4402('0x56')]=function(_0x505a13,_0x32be98,_0x520907){var _0x51e85d={'raw':!![],'where':{}};var _0x16af14={};var _0x7adf6d={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x505a13[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x32be98,null))['then'](function(_0x596499){if(_0x596499){_0x16af14[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x57')]['rawAttributes']);_0x16af14['query']=_[_0x4402('0x2d')](_0x505a13['query']);_0x16af14[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x16af14[_0x4402('0x2b')],_0x16af14[_0x4402('0x2c')]);_0x51e85d[_0x4402('0x2f')]=_['intersection'](_0x16af14['model'],qs[_0x4402('0x30')](_0x505a13[_0x4402('0x2c')]['fields']));_0x51e85d[_0x4402('0x2f')]=_0x51e85d[_0x4402('0x2f')][_0x4402('0x31')]?_0x51e85d[_0x4402('0x2f')]:_0x16af14[_0x4402('0x2b')];if(!_0x505a13[_0x4402('0x2c')]['hasOwnProperty']('nolimit')){_0x51e85d[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x505a13[_0x4402('0x2c')][_0x4402('0x19')]);_0x51e85d[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x505a13['query'][_0x4402('0x17')]);}_0x51e85d[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x505a13[_0x4402('0x2c')][_0x4402('0x34')]);_0x51e85d['where']=qs[_0x4402('0x2e')](_[_0x4402('0x55')](_0x505a13[_0x4402('0x2c')],_0x16af14[_0x4402('0x2e')]));_0x51e85d[_0x4402('0x35')][_0x4402('0x52')]=_0x596499['id'];if(_0x505a13['query']['filter']){_0x51e85d[_0x4402('0x35')]=_['merge'](_0x51e85d[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x51e85d[_0x4402('0x2f')],function(_0x3eb7f0){var _0x3636e9={};_0x3636e9[_0x3eb7f0]={'$like':'%'+_0x505a13[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3636e9;})});}_0x51e85d=_[_0x4402('0x38')]({},_0x51e85d,_0x505a13[_0x4402('0x41')]);return db[_0x4402('0x57')][_0x4402('0x1a')]({'where':_0x51e85d[_0x4402('0x35')]})[_0x4402('0x1f')](function(_0x372c6e){_0x7adf6d[_0x4402('0x1a')]=_0x372c6e;if(_0x505a13[_0x4402('0x2c')][_0x4402('0x40')]){_0x51e85d[_0x4402('0x39')]=[{'all':!![]}];}return db[_0x4402('0x57')][_0x4402('0x3a')](_0x51e85d);})[_0x4402('0x1f')](function(_0x385b8e){_0x7adf6d[_0x4402('0x3b')]=_0x385b8e;return _0x7adf6d;});}})['then'](respondWithFilteredResult(_0x32be98,_0x51e85d))[_0x4402('0x3c')](handleError(_0x32be98,null));};exports[_0x4402('0x58')]=function(_0x3a3734,_0x2631bc,_0x98b130){var _0x3511f6={'raw':!![],'where':{}};var _0x5dfe53={};var _0x4ed2fa={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x3a3734[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2631bc,null))['then'](function(_0x54fee3){if(_0x54fee3){_0x5dfe53['model']=_[_0x4402('0x2d')](db[_0x4402('0x59')][_0x4402('0x29')]);_0x5dfe53['query']=_[_0x4402('0x2d')](_0x3a3734[_0x4402('0x2c')]);_0x5dfe53[_0x4402('0x2e')]=_['intersection'](_0x5dfe53[_0x4402('0x2b')],_0x5dfe53['query']);_0x3511f6[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x5dfe53[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x3a3734[_0x4402('0x2c')][_0x4402('0x30')]));_0x3511f6['attributes']=_0x3511f6[_0x4402('0x2f')][_0x4402('0x31')]?_0x3511f6[_0x4402('0x2f')]:_0x5dfe53['model'];if(!_0x3a3734[_0x4402('0x2c')]['hasOwnProperty'](_0x4402('0x33'))){_0x3511f6[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x3a3734[_0x4402('0x2c')]['limit']);_0x3511f6[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x3a3734[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3511f6[_0x4402('0x51')]=qs['sort'](_0x3a3734[_0x4402('0x2c')][_0x4402('0x34')]);_0x3511f6['where']=qs['filters'](_['pick'](_0x3a3734[_0x4402('0x2c')],_0x5dfe53[_0x4402('0x2e')]));_0x3511f6[_0x4402('0x35')][_0x4402('0x52')]=_0x54fee3['id'];if(_0x3a3734['query'][_0x4402('0x36')]){_0x3511f6[_0x4402('0x35')]=_[_0x4402('0x38')](_0x3511f6[_0x4402('0x35')],{'$or':_['map'](_0x3511f6[_0x4402('0x2f')],function(_0x2949ce){var _0x30f26a={};_0x30f26a[_0x2949ce]={'$like':'%'+_0x3a3734['query']['filter']+'%'};return _0x30f26a;})});}_0x3511f6=_['merge']({},_0x3511f6,_0x3a3734[_0x4402('0x41')]);return db['CmHopperBlack'][_0x4402('0x1a')]({'where':_0x3511f6[_0x4402('0x35')]})[_0x4402('0x1f')](function(_0x117911){_0x4ed2fa[_0x4402('0x1a')]=_0x117911;if(_0x3a3734[_0x4402('0x2c')][_0x4402('0x40')]){_0x3511f6[_0x4402('0x39')]=[{'all':!![]}];}return db[_0x4402('0x59')][_0x4402('0x3a')](_0x3511f6);})[_0x4402('0x1f')](function(_0x329b60){_0x4ed2fa[_0x4402('0x3b')]=_0x329b60;return _0x4ed2fa;});}})[_0x4402('0x1f')](respondWithFilteredResult(_0x2631bc,_0x3511f6))['catch'](handleError(_0x2631bc,null));};exports[_0x4402('0x5a')]=function(_0x26f5a9,_0x4cc170,_0x5563e6){var _0x57fd83={};var _0x1aacd7={};var _0x5a3ec8;var _0x47aa8b;return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x26f5a9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4cc170,null))[_0x4402('0x1f')](function(_0x541cd0){if(_0x541cd0){_0x5a3ec8=_0x541cd0;_0x1aacd7[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x5b')][_0x4402('0x29')]);_0x1aacd7[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x26f5a9[_0x4402('0x2c')]);_0x1aacd7[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1aacd7[_0x4402('0x2b')],_0x1aacd7[_0x4402('0x2c')]);_0x57fd83['attributes']=_[_0x4402('0x3f')](_0x1aacd7[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x26f5a9[_0x4402('0x2c')]['fields']));_0x57fd83[_0x4402('0x2f')]=_0x57fd83['attributes'][_0x4402('0x31')]?_0x57fd83[_0x4402('0x2f')]:_0x1aacd7['model'];_0x57fd83['order']=qs[_0x4402('0x34')](_0x26f5a9[_0x4402('0x2c')][_0x4402('0x34')]);_0x57fd83[_0x4402('0x35')]=qs[_0x4402('0x2e')](_[_0x4402('0x55')](_0x26f5a9['query'],_0x1aacd7['filters']));if(_0x26f5a9[_0x4402('0x2c')][_0x4402('0x36')]){_0x57fd83[_0x4402('0x35')]=_[_0x4402('0x38')](_0x57fd83[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x57fd83['attributes'],function(_0x28720c){var _0x3e00bf={};_0x3e00bf[_0x28720c]={'$like':'%'+_0x26f5a9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3e00bf;})});}_0x57fd83=_[_0x4402('0x38')]({},_0x57fd83,_0x26f5a9[_0x4402('0x41')]);return _0x5a3ec8['getLists'](_0x57fd83);}})['then'](function(_0x1a3393){if(_0x1a3393){_0x47aa8b=_0x1a3393['length'];if(!_0x26f5a9[_0x4402('0x2c')][_0x4402('0x32')]('nolimit')){_0x57fd83[_0x4402('0x19')]=qs['limit'](_0x26f5a9[_0x4402('0x2c')][_0x4402('0x19')]);_0x57fd83[_0x4402('0x17')]=qs['offset'](_0x26f5a9[_0x4402('0x2c')]['offset']);}return _0x5a3ec8[_0x4402('0x5a')](_0x57fd83);}})[_0x4402('0x1f')](function(_0x206058){if(_0x206058){return _0x206058?{'count':_0x47aa8b,'rows':_0x206058}:null;}})[_0x4402('0x1f')](respondWithResult(_0x4cc170,null))[_0x4402('0x3c')](handleError(_0x4cc170,null));};exports['addLists']=function(_0x4b999c,_0x135fac,_0x5c1e8e){var _0x2bc5a3,_0x38009f;var _0x559802=[];var _0x50d453=moment()[_0x4402('0x5c')](_0x4402('0x5d'));return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x4b999c[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x135fac,null))[_0x4402('0x1f')](function(_0x93b7b4){if(_0x93b7b4){_0x38009f=_0x93b7b4;return _0x93b7b4['addLists'](_0x4b999c['body'][_0x4402('0x5e')],_[_0x4402('0x4a')](_0x4b999c[_0x4402('0x44')],['ids','id'])||{});}return null;})[_0x4402('0x5f')](function(_0x5ef261){var _0x224182;var _0x1237a3;_0x2bc5a3=_0x5ef261||[];var _0x364423=[];if(_0x5ef261){for(var _0x4a0fd9=0x0;_0x4a0fd9<_0x5ef261[_0x4402('0x31')];_0x4a0fd9+=0x1){var _0x12569b=_0x5ef261[_0x4a0fd9]['get']({'plain':!![]});_0x38009f[_0x4402('0x60')]=_0x4b999c[_0x4402('0x44')][_0x4402('0x60')]?_0x4b999c[_0x4402('0x44')][_0x4402('0x60')]:_0x38009f[_0x4402('0x60')];switch(_0x38009f[_0x4402('0x60')]){case _0x4402('0x61'):_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x64'))[_0x4402('0x65')](['phone',_0x4402('0x66'),_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x6b'),'phone')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))['field']('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b['CmListId'][_0x4402('0x6d')](),_0x4402('0x68'))['field'](_0x4b999c['params']['id'][_0x4402('0x6d')](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))['field']('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))['from'](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))[_0x4402('0x35')](_0x4402('0x70'),_0x12569b['CmListId'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71'))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x73'))[_0x4402('0x74')](_0x4402('0x75'))[_0x4402('0x35')]('CampaignId\x20=\x20?',_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]()))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x76'))[_0x4402('0x74')](_0x4402('0x64'))[_0x4402('0x35')]('CampaignId\x20=\x20?',_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]())))[_0x4402('0x6d')]();break;case'onlyIfOpen':_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')]('cm_hopper')[_0x4402('0x65')]([_0x4402('0x6b'),_0x4402('0x66'),_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x6b'),'phone')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))['field'](_0x4b999c[_0x4402('0x3e')]['id']['toString'](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))[_0x4402('0x74')](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))['where'](_0x4402('0x70'),_0x12569b['CmListId'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71'))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()['field'](_0x4402('0x76'))['from'](_0x4402('0x64'))['where'](_0x4402('0x78'),_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]())))[_0x4402('0x6d')]();break;default:_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x64'))[_0x4402('0x65')]([_0x4402('0x6b'),'scheduledAt',_0x4402('0x67'),'ListId','CampaignId','createdAt',_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')]('phone',_0x4402('0x6b'))[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))[_0x4402('0x6a')](_0x4b999c['params']['id']['toString'](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))['from']('cm_contacts')[_0x4402('0x35')](_0x4402('0x6f'))[_0x4402('0x35')](_0x4402('0x70'),_0x12569b[_0x4402('0x77')][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71')))[_0x4402('0x6d')]();}_0x1237a3=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x79'))[_0x4402('0x65')]([_0x4402('0x7a'),_0x4402('0x66'),_0x4402('0x6b'),_0x4402('0x7b'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x7c'),'id')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('ci.item',_0x4402('0x6b'))[_0x4402('0x6a')](_0x4402('0x7d'),_0x4402('0x7b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))[_0x4402('0x74')]('cm_contact_has_items','ci')[_0x4402('0x7e')](_0x4402('0x64'),'h',_0x4402('0x7f'))[_0x4402('0x35')](_0x4402('0x80'),_0x12569b[_0x4402('0x77')][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x81'),_0x4b999c['params']['id'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x82'),_0x50d453))[_0x4402('0x6d')]();_0x364423[_0x4402('0x83')](db[_0x4402('0x84')][_0x4402('0x2c')](_0x224182));_0x559802['push'](db[_0x4402('0x84')][_0x4402('0x2c')](_0x1237a3));}return BPromise['all'](_0x364423);}})[_0x4402('0x1f')](function(){return BPromise[_0x4402('0x85')](_0x559802);})[_0x4402('0x1f')](function(){return _0x2bc5a3;})[_0x4402('0x1f')](respondWithResult(_0x135fac,null))[_0x4402('0x3c')](handleError(_0x135fac,null));};exports[_0x4402('0x86')]=function(_0x2433a1,_0x4069cf,_0x7be513){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x2433a1[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4069cf,null))[_0x4402('0x1f')](function(_0x1f2219){if(_0x1f2219){return _0x1f2219[_0x4402('0x86')](_0x2433a1[_0x4402('0x2c')][_0x4402('0x5e')]);}})[_0x4402('0x1f')](function(_0x2ecd1f){if(_0x2ecd1f){return db[_0x4402('0x50')][_0x4402('0x20')]({'where':{'ListId':_0x2433a1[_0x4402('0x2c')][_0x4402('0x5e')],'CampaignId':_0x2433a1[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](function(){return _0x2ecd1f;});}})[_0x4402('0x1f')](respondWithStatusCode(_0x4069cf,null))[_0x4402('0x3c')](handleError(_0x4069cf,null));};exports[_0x4402('0x87')]=function(_0x3f7f24,_0x24797a,_0x544a09){var _0x3ae530={};var _0x55efac={};var _0x53c06a;var _0x404464;return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x3f7f24[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x24797a,null))['then'](function(_0x2b5efe){if(_0x2b5efe){_0x53c06a=_0x2b5efe;_0x55efac[_0x4402('0x2b')]=_[_0x4402('0x2d')](db['CmList'][_0x4402('0x29')]);_0x55efac[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x3f7f24[_0x4402('0x2c')]);_0x55efac['filters']=_[_0x4402('0x3f')](_0x55efac[_0x4402('0x2b')],_0x55efac['query']);_0x3ae530['attributes']=_['intersection'](_0x55efac['model'],qs[_0x4402('0x30')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x30')]));_0x3ae530['attributes']=_0x3ae530[_0x4402('0x2f')][_0x4402('0x31')]?_0x3ae530[_0x4402('0x2f')]:_0x55efac['model'];_0x3ae530[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x34')]);_0x3ae530[_0x4402('0x35')]=qs[_0x4402('0x2e')](_['pick'](_0x3f7f24[_0x4402('0x2c')],_0x55efac[_0x4402('0x2e')]));if(_0x3f7f24[_0x4402('0x2c')][_0x4402('0x36')]){_0x3ae530['where']=_[_0x4402('0x38')](_0x3ae530['where'],{'$or':_[_0x4402('0x27')](_0x3ae530['attributes'],function(_0x57bce0){var _0x4331a9={};_0x4331a9[_0x57bce0]={'$like':'%'+_0x3f7f24[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x4331a9;})});}_0x3ae530=_[_0x4402('0x38')]({},_0x3ae530,_0x3f7f24[_0x4402('0x41')]);return _0x53c06a[_0x4402('0x87')](_0x3ae530);}})[_0x4402('0x1f')](function(_0x87e1c){if(_0x87e1c){_0x404464=_0x87e1c['length'];if(!_0x3f7f24[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3ae530[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x3f7f24['query'][_0x4402('0x19')]);_0x3ae530['offset']=qs[_0x4402('0x17')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x17')]);}return _0x53c06a['getBlackLists'](_0x3ae530);}})[_0x4402('0x1f')](function(_0x284292){if(_0x284292){return _0x284292?{'count':_0x404464,'rows':_0x284292}:null;}})['then'](respondWithResult(_0x24797a,null))[_0x4402('0x3c')](handleError(_0x24797a,null));};exports[_0x4402('0x88')]=function(_0x1ad7ff,_0x19993b,_0x241a20){var _0x460e17,_0x44b691;var _0xe8f398=[];var _0x1e625b=moment()[_0x4402('0x5c')](_0x4402('0x5d'));return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x1ad7ff[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x19993b,null))[_0x4402('0x1f')](function(_0x1223ad){if(_0x1223ad){_0x44b691=_0x1223ad;return _0x1223ad[_0x4402('0x88')](_0x1ad7ff[_0x4402('0x44')][_0x4402('0x5e')],_[_0x4402('0x4a')](_0x1ad7ff[_0x4402('0x44')],[_0x4402('0x5e'),'id'])||{});}return null;})['spread'](function(_0x319331){var _0x268d01;var _0x45080b;_0x460e17=_0x319331||[];var _0x4ff63e=[];if(_0x319331){for(var _0x48121f=0x0;_0x48121f<_0x319331[_0x4402('0x31')];_0x48121f+=0x1){var _0x114ee0=_0x319331[_0x48121f][_0x4402('0x21')]({'plain':!![]});_0x268d01=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x89'))['fromQuery'](['phone',_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel['select']()[_0x4402('0x6a')](_0x4402('0x6b'),_0x4402('0x6b'))['field']('id',_0x4402('0x67'))['field'](_0x114ee0[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))[_0x4402('0x6a')](_0x1ad7ff['params']['id'][_0x4402('0x6d')](),_0x4402('0x52'))[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x4b'))[_0x4402('0x6a')](_0x4402('0x6c'),'updatedAt')['from'](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))['where'](_0x4402('0x70'),_0x114ee0[_0x4402('0x77')][_0x4402('0x6d')]())['where'](_0x4402('0x71')))['toString']();_0x4ff63e[_0x4402('0x83')](db[_0x4402('0x84')][_0x4402('0x2c')](_0x268d01));}return BPromise['all'](_0x4ff63e);}})[_0x4402('0x1f')](function(){return _0x460e17;})[_0x4402('0x1f')](respondWithResult(_0x19993b,null))['catch'](handleError(_0x19993b,null));};exports['removeBlackLists']=function(_0x4bd840,_0x4b64a3,_0x1815d7){return db['Campaign']['find']({'where':{'id':_0x4bd840[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4b64a3,null))[_0x4402('0x1f')](function(_0x27c329){if(_0x27c329){return _0x27c329['removeBlackLists'](_0x4bd840[_0x4402('0x2c')][_0x4402('0x5e')]);}})[_0x4402('0x1f')](function(_0x5ebf6d){if(_0x5ebf6d){return db[_0x4402('0x59')]['destroy']({'where':{'ListId':_0x4bd840['query'][_0x4402('0x5e')],'CampaignId':_0x4bd840['params']['id']}})[_0x4402('0x1f')](function(){return _0x5ebf6d;});}})['then'](respondWithStatusCode(_0x4b64a3,null))[_0x4402('0x3c')](handleError(_0x4b64a3,null));}; \ No newline at end of file +var _0x3276=['hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','onlyIfOpen','ContactId','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ListId\x20=\x20?','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','error','stack','name','send','Campaign','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','where','map','type','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','getHoppers','findOne'];(function(_0x408758,_0x548c1f){var _0x2e25ae=function(_0x48ae5d){while(--_0x48ae5d){_0x408758['push'](_0x408758['shift']());}};_0x2e25ae(++_0x548c1f);}(_0x3276,0xc7));var _0x6327=function(_0x422f60,_0x377c70){_0x422f60=_0x422f60-0x0;var _0x141c68=_0x3276[_0x422f60];return _0x141c68;};'use strict';var emlformat=require(_0x6327('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6327('0x1'));var rp=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var BPromise=require(_0x6327('0x4'));var Mustache=require(_0x6327('0x5'));var util=require(_0x6327('0x6'));var path=require(_0x6327('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6327('0x8'));var fs=require('fs');var fs_extra=require(_0x6327('0x9'));var _=require(_0x6327('0xa'));var squel=require('squel');var crypto=require(_0x6327('0xb'));var jsforce=require(_0x6327('0xc'));var deskjs=require(_0x6327('0xd'));var toCsv=require(_0x6327('0xe'));var querystring=require('querystring');var Papa=require(_0x6327('0xf'));var Redis=require(_0x6327('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6327('0x11'));var as=require(_0x6327('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6327('0x13'))(_0x6327('0x14'));var utils=require(_0x6327('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6327('0x16'));var db=require(_0x6327('0x17'))['db'];function respondWithStatusCode(_0xb6de72,_0x32408c){_0x32408c=_0x32408c||0xcc;return function(_0x3ff61b){if(_0x3ff61b){return _0xb6de72[_0x6327('0x18')](_0x32408c);}return _0xb6de72[_0x6327('0x19')](_0x32408c)[_0x6327('0x1a')]();};}function respondWithResult(_0x576b1c,_0x306095){_0x306095=_0x306095||0xc8;return function(_0x48eb75){if(_0x48eb75){return _0x576b1c[_0x6327('0x19')](_0x306095)['json'](_0x48eb75);}};}function respondWithFilteredResult(_0x441ff9,_0x1e850c){return function(_0x43186f){if(_0x43186f){var _0x4e9741=typeof _0x1e850c[_0x6327('0x1b')]===_0x6327('0x1c')&&typeof _0x1e850c[_0x6327('0x1d')]===_0x6327('0x1c');var _0x3ea016=_0x43186f[_0x6327('0x1e')];var _0x341a51=_0x4e9741?0x0:_0x1e850c[_0x6327('0x1b')];var _0x287899=_0x4e9741?_0x43186f[_0x6327('0x1e')]:_0x1e850c[_0x6327('0x1b')]+_0x1e850c[_0x6327('0x1d')];var _0x55cf65;if(_0x287899>=_0x3ea016){_0x287899=_0x3ea016;_0x55cf65=0xc8;}else{_0x55cf65=0xce;}_0x441ff9[_0x6327('0x19')](_0x55cf65);return _0x441ff9[_0x6327('0x1f')](_0x6327('0x20'),_0x341a51+'-'+_0x287899+'/'+_0x3ea016)[_0x6327('0x21')](_0x43186f);}return null;};}function patchUpdates(_0x4cbc80){return function(_0x56249b){try{jsonpatch[_0x6327('0x22')](_0x56249b,_0x4cbc80,!![]);}catch(_0x700766){return BPromise[_0x6327('0x23')](_0x700766);}return _0x56249b[_0x6327('0x24')]();};}function saveUpdates(_0x3078c5,_0x76c718){return function(_0x5754e1){if(_0x5754e1){return _0x5754e1[_0x6327('0x25')](_0x3078c5)[_0x6327('0x26')](function(_0x2f153c){return _0x2f153c;});}return null;};}function removeEntity(_0x1c3d7f,_0x302b3f){return function(_0x254c2f){if(_0x254c2f){return _0x254c2f[_0x6327('0x27')]()[_0x6327('0x26')](function(){var _0x10e312=_0x254c2f['get']({'plain':!![]});var _0x51dbe9=_0x6327('0x28');return db['UserProfileResource'][_0x6327('0x27')]({'where':{'type':_0x51dbe9,'resourceId':_0x10e312['id']}})['then'](function(){return _0x254c2f;});})[_0x6327('0x26')](function(){_0x1c3d7f['status'](0xcc)[_0x6327('0x1a')]();});}};}function handleEntityNotFound(_0x1eae65,_0x486f8e){return function(_0x44caac){if(!_0x44caac){_0x1eae65[_0x6327('0x18')](0x194);}return _0x44caac;};}function handleError(_0x14b41b,_0x2540bf){_0x2540bf=_0x2540bf||0x1f4;return function(_0x894157){logger[_0x6327('0x29')](_0x894157[_0x6327('0x2a')]);if(_0x894157[_0x6327('0x2b')]){delete _0x894157['name'];}_0x14b41b[_0x6327('0x19')](_0x2540bf)[_0x6327('0x2c')](_0x894157);};}exports['index']=function(_0x269c33,_0x40e927){var _0x5e8ff5={},_0x43bcd0={},_0x41ecd5={'count':0x0,'rows':[]};var _0x330471=_['map'](db[_0x6327('0x2d')][_0x6327('0x2e')],function(_0x1066d9){return{'name':_0x1066d9[_0x6327('0x2f')],'type':_0x1066d9['type'][_0x6327('0x30')]};});_0x43bcd0['model']=_['map'](_0x330471,_0x6327('0x2b'));_0x43bcd0[_0x6327('0x31')]=_[_0x6327('0x32')](_0x269c33[_0x6327('0x31')]);_0x43bcd0['filters']=_[_0x6327('0x33')](_0x43bcd0[_0x6327('0x34')],_0x43bcd0[_0x6327('0x31')]);_0x5e8ff5[_0x6327('0x35')]=_['intersection'](_0x43bcd0[_0x6327('0x34')],qs[_0x6327('0x36')](_0x269c33[_0x6327('0x31')]['fields']));_0x5e8ff5[_0x6327('0x35')]=_0x5e8ff5[_0x6327('0x35')][_0x6327('0x37')]?_0x5e8ff5['attributes']:_0x43bcd0['model'];if(!_0x269c33[_0x6327('0x31')]['hasOwnProperty'](_0x6327('0x38'))){_0x5e8ff5['limit']=qs[_0x6327('0x1d')](_0x269c33[_0x6327('0x31')][_0x6327('0x1d')]);_0x5e8ff5[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x269c33[_0x6327('0x31')]['offset']);}_0x5e8ff5[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x269c33[_0x6327('0x31')][_0x6327('0x3a')]);_0x5e8ff5['where']=qs['filters'](_[_0x6327('0x3b')](_0x269c33[_0x6327('0x31')],_0x43bcd0[_0x6327('0x3c')]),_0x330471);if(_0x269c33[_0x6327('0x31')][_0x6327('0x3d')]){_0x5e8ff5['where']=_[_0x6327('0x3e')](_0x5e8ff5[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x330471,function(_0x10b988){if(_0x10b988[_0x6327('0x41')]!=='VIRTUAL'){var _0x49a887={};_0x49a887[_0x10b988[_0x6327('0x2b')]]={'$like':'%'+_0x269c33['query'][_0x6327('0x3d')]+'%'};return _0x49a887;}})});}_0x5e8ff5=_[_0x6327('0x3e')]({},_0x5e8ff5,_0x269c33[_0x6327('0x42')]);var _0x46b813={'where':_0x5e8ff5['where']};return db[_0x6327('0x2d')][_0x6327('0x1e')](_0x46b813)[_0x6327('0x26')](function(_0x592f0e){_0x41ecd5[_0x6327('0x1e')]=_0x592f0e;if(_0x269c33[_0x6327('0x31')]['includeAll']){_0x5e8ff5[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x2d')][_0x6327('0x44')](_0x5e8ff5);})[_0x6327('0x26')](function(_0xab88fb){_0x41ecd5[_0x6327('0x45')]=_0xab88fb;return _0x41ecd5;})[_0x6327('0x26')](respondWithFilteredResult(_0x40e927,_0x5e8ff5))[_0x6327('0x46')](handleError(_0x40e927,null));};exports[_0x6327('0x47')]=function(_0xc73e4a,_0x446f7c){var _0x3550c9={'raw':![],'where':{'id':_0xc73e4a[_0x6327('0x48')]['id']}},_0x115ed4={};_0x115ed4[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x2d')][_0x6327('0x2e')]);_0x115ed4['query']=_[_0x6327('0x32')](_0xc73e4a[_0x6327('0x31')]);_0x115ed4['filters']=_['intersection'](_0x115ed4['model'],_0x115ed4[_0x6327('0x31')]);_0x3550c9[_0x6327('0x35')]=_['intersection'](_0x115ed4[_0x6327('0x34')],qs[_0x6327('0x36')](_0xc73e4a[_0x6327('0x31')][_0x6327('0x36')]));_0x3550c9[_0x6327('0x35')]=_0x3550c9[_0x6327('0x35')][_0x6327('0x37')]?_0x3550c9[_0x6327('0x35')]:_0x115ed4[_0x6327('0x34')];if(_0xc73e4a['query'][_0x6327('0x49')]){_0x3550c9[_0x6327('0x43')]=[{'all':!![]}];}_0x3550c9=_[_0x6327('0x3e')]({},_0x3550c9,_0xc73e4a['options']);return db[_0x6327('0x2d')][_0x6327('0x4a')](_0x3550c9)[_0x6327('0x26')](handleEntityNotFound(_0x446f7c,null))[_0x6327('0x26')](respondWithResult(_0x446f7c,null))['catch'](handleError(_0x446f7c,null));};exports[_0x6327('0x4b')]=function(_0x317edf,_0x3fc622){return db[_0x6327('0x2d')][_0x6327('0x4b')](_0x317edf[_0x6327('0x4c')],{})[_0x6327('0x26')](function(_0x33e8d3){var _0x11030e=_0x317edf[_0x6327('0x4d')][_0x6327('0x4e')]({'plain':!![]});if(!_0x11030e)throw new Error(_0x6327('0x4f'));if(_0x11030e[_0x6327('0x50')]===_0x6327('0x4d')){var _0x5e664d=_0x33e8d3['get']({'plain':!![]});var _0x1f95b6=_0x6327('0x28');return db[_0x6327('0x51')][_0x6327('0x4a')]({'where':{'name':_0x1f95b6,'userProfileId':_0x11030e[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0xc07c32){if(_0xc07c32&&_0xc07c32[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')][_0x6327('0x4b')]({'name':_0x5e664d[_0x6327('0x2b')],'resourceId':_0x5e664d['id'],'type':_0xc07c32[_0x6327('0x2b')],'sectionId':_0xc07c32['id']},{})[_0x6327('0x26')](function(){return _0x33e8d3;});}else{return _0x33e8d3;}})[_0x6327('0x46')](function(_0x5daaed){logger[_0x6327('0x29')](_0x6327('0x55'),_0x5daaed);throw _0x5daaed;});}return _0x33e8d3;})[_0x6327('0x26')](respondWithResult(_0x3fc622,0xc9))[_0x6327('0x46')](handleError(_0x3fc622,null));};exports['clone']=function(_0x3e2b4f,_0x2ad46b){var _0x12862d={'where':{'id':_0x3e2b4f[_0x6327('0x48')]['id']}},_0x1bf90e={};_0x1bf90e['model']=_[_0x6327('0x32')](db['Campaign'][_0x6327('0x2e')]);_0x12862d[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1bf90e[_0x6327('0x34')],qs[_0x6327('0x36')](_0x3e2b4f[_0x6327('0x31')]['fields']));_0x12862d[_0x6327('0x35')]=_0x12862d[_0x6327('0x35')]['length']?_0x12862d[_0x6327('0x35')]:_0x1bf90e[_0x6327('0x34')];if(_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]){_0x12862d[_0x6327('0x43')]=[{'all':!![]}];}_0x12862d=_[_0x6327('0x3e')]({},_0x12862d,_0x3e2b4f[_0x6327('0x42')]);return db[_0x6327('0x2d')]['find'](_0x12862d)[_0x6327('0x26')](handleEntityNotFound(_0x2ad46b,null))[_0x6327('0x26')](function(_0x46c6bd){if(_0x46c6bd){var _0x2188c2=_0x46c6bd[_0x6327('0x4e')]({'plain':!![]});_0x2188c2=qs[_0x6327('0x56')](_0x2188c2,['id','createdAt',_0x6327('0x57')]);_0x3e2b4f['body']=_[_0x6327('0x56')](_0x3e2b4f[_0x6327('0x4c')],['id',_0x6327('0x58'),_0x6327('0x57')]);return db[_0x6327('0x2d')][_0x6327('0x4b')](_[_0x6327('0x3e')](_0x2188c2,_0x3e2b4f[_0x6327('0x4c')]),{'include':_0x3e2b4f[_0x6327('0x31')][_0x6327('0x49')]?[{'all':!![]}]:undefined})[_0x6327('0x26')](function(_0x36f28a){var _0x3f0115=_0x3e2b4f['user'][_0x6327('0x4e')]({'plain':!![]});if(!_0x3f0115)throw new Error(_0x6327('0x4f'));if(_0x3f0115[_0x6327('0x50')]==='user'){var _0xbf5d09=_0x36f28a[_0x6327('0x4e')]({'plain':!![]});var _0x57ca83='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x57ca83,'userProfileId':_0x3f0115[_0x6327('0x52')]},'raw':!![]})[_0x6327('0x26')](function(_0x36f8c2){if(_0x36f8c2&&_0x36f8c2[_0x6327('0x53')]===0x0){return db[_0x6327('0x54')]['create']({'name':_0xbf5d09['name'],'resourceId':_0xbf5d09['id'],'type':_0x36f8c2[_0x6327('0x2b')],'sectionId':_0x36f8c2['id']},{})[_0x6327('0x26')](function(){return _0x36f28a;});}else{return _0x36f28a;}})['catch'](function(_0x28f13e){logger[_0x6327('0x29')](_0x6327('0x55'),_0x28f13e);throw _0x28f13e;});}return _0x36f28a;});}})[_0x6327('0x26')](respondWithResult(_0x2ad46b,0xc9))[_0x6327('0x46')](handleError(_0x2ad46b,null));};exports[_0x6327('0x25')]=function(_0x4b4031,_0x5446db){if(_0x4b4031['body']['id']){delete _0x4b4031[_0x6327('0x4c')]['id'];}return db[_0x6327('0x2d')]['find']({'where':{'id':_0x4b4031['params']['id']}})['then'](handleEntityNotFound(_0x5446db,null))[_0x6327('0x26')](saveUpdates(_0x4b4031[_0x6327('0x4c')],null))[_0x6327('0x26')](respondWithResult(_0x5446db,null))[_0x6327('0x46')](handleError(_0x5446db,null));};exports['destroy']=function(_0x3e66b5,_0x276fe1){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x3e66b5['params']['id']}})['then'](handleEntityNotFound(_0x276fe1,null))[_0x6327('0x26')](removeEntity(_0x276fe1,null))[_0x6327('0x46')](handleError(_0x276fe1,null));};exports[_0x6327('0x59')]=function(_0x4c9e12,_0x513e06,_0x54326a){var _0x17b571={'raw':!![],'where':{}};var _0x5bbc4a={};var _0x1e2376={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x4c9e12[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x513e06,null))['then'](function(_0x4bdeab){if(_0x4bdeab){_0x5bbc4a[_0x6327('0x34')]=_[_0x6327('0x32')](db['CmHopper'][_0x6327('0x2e')]);_0x5bbc4a[_0x6327('0x31')]=_[_0x6327('0x32')](_0x4c9e12['query']);_0x5bbc4a[_0x6327('0x3c')]=_['intersection'](_0x5bbc4a[_0x6327('0x34')],_0x5bbc4a[_0x6327('0x31')]);_0x17b571[_0x6327('0x35')]=_[_0x6327('0x33')](_0x5bbc4a[_0x6327('0x34')],qs[_0x6327('0x36')](_0x4c9e12[_0x6327('0x31')][_0x6327('0x36')]));_0x17b571['attributes']=_0x17b571[_0x6327('0x35')][_0x6327('0x37')]?_0x17b571[_0x6327('0x35')]:_0x5bbc4a[_0x6327('0x34')];if(!_0x4c9e12['query'][_0x6327('0x5b')](_0x6327('0x38'))){_0x17b571[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x4c9e12['query'][_0x6327('0x1d')]);_0x17b571[_0x6327('0x1b')]=qs['offset'](_0x4c9e12[_0x6327('0x31')][_0x6327('0x1b')]);}_0x17b571['order']=qs[_0x6327('0x3a')](_0x4c9e12['query'][_0x6327('0x3a')]);_0x17b571[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_['pick'](_0x4c9e12[_0x6327('0x31')],_0x5bbc4a['filters']));_0x17b571['where'][_0x6327('0x5c')]=_0x4bdeab['id'];if(_0x4c9e12['query'][_0x6327('0x3d')]){_0x17b571[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x17b571[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x17b571[_0x6327('0x35')],function(_0x1b3a5e){var _0x29ee0f={};_0x29ee0f[_0x1b3a5e]={'$like':'%'+_0x4c9e12[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x29ee0f;})});}_0x17b571=_['merge']({},_0x17b571,_0x4c9e12[_0x6327('0x42')]);return db[_0x6327('0x5d')][_0x6327('0x1e')]({'where':_0x17b571['where']})['then'](function(_0x55645d){_0x1e2376['count']=_0x55645d;if(_0x4c9e12[_0x6327('0x31')][_0x6327('0x49')]){_0x17b571[_0x6327('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x17b571);})[_0x6327('0x26')](function(_0x45bc3d){_0x1e2376[_0x6327('0x45')]=_0x45bc3d;return _0x1e2376;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x513e06,_0x17b571))['catch'](handleError(_0x513e06,null));};exports[_0x6327('0x5e')]=function(_0x7d3f15,_0x4346b8,_0x3973dd){var _0x188557={'raw':!![],'where':{}};var _0x33b36f={};var _0x3ecb75={'count':0x0,'rows':[]};return db['Campaign'][_0x6327('0x5a')]({'where':{'id':_0x7d3f15['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x4346b8,null))[_0x6327('0x26')](function(_0x101a46){if(_0x101a46){_0x33b36f['model']=_[_0x6327('0x32')](db[_0x6327('0x5f')][_0x6327('0x2e')]);_0x33b36f[_0x6327('0x31')]=_[_0x6327('0x32')](_0x7d3f15['query']);_0x33b36f['filters']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],_0x33b36f[_0x6327('0x31')]);_0x188557['attributes']=_[_0x6327('0x33')](_0x33b36f[_0x6327('0x34')],qs[_0x6327('0x36')](_0x7d3f15[_0x6327('0x31')]['fields']));_0x188557['attributes']=_0x188557[_0x6327('0x35')][_0x6327('0x37')]?_0x188557['attributes']:_0x33b36f['model'];if(!_0x7d3f15[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x188557[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x7d3f15[_0x6327('0x31')][_0x6327('0x1d')]);_0x188557[_0x6327('0x1b')]=qs['offset'](_0x7d3f15['query'][_0x6327('0x1b')]);}_0x188557[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x7d3f15['query']['sort']);_0x188557['where']=qs[_0x6327('0x3c')](_['pick'](_0x7d3f15[_0x6327('0x31')],_0x33b36f['filters']));_0x188557['where']['CampaignId']=_0x101a46['id'];if(_0x7d3f15[_0x6327('0x31')]['filter']){_0x188557[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x188557[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x188557['attributes'],function(_0x2936da){var _0x5e721b={};_0x5e721b[_0x2936da]={'$like':'%'+_0x7d3f15[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x5e721b;})});}_0x188557=_[_0x6327('0x3e')]({},_0x188557,_0x7d3f15[_0x6327('0x42')]);return db[_0x6327('0x5f')][_0x6327('0x1e')]({'where':_0x188557[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x52b63f){_0x3ecb75['count']=_0x52b63f;if(_0x7d3f15[_0x6327('0x31')][_0x6327('0x49')]){_0x188557[_0x6327('0x43')]=[{'all':!![]}];}return db[_0x6327('0x5f')][_0x6327('0x44')](_0x188557);})[_0x6327('0x26')](function(_0x561b1a){_0x3ecb75[_0x6327('0x45')]=_0x561b1a;return _0x3ecb75;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x4346b8,_0x188557))[_0x6327('0x46')](handleError(_0x4346b8,null));};exports['getHopperFinals']=function(_0x59a5cc,_0x15a1dc,_0x424e54){var _0x35477c={'raw':!![],'where':{}};var _0x1193c5={};var _0x12726d={'count':0x0,'rows':[]};return db[_0x6327('0x2d')]['findOne']({'where':{'id':_0x59a5cc[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x15a1dc,null))[_0x6327('0x26')](function(_0x40019b){if(_0x40019b){_0x1193c5[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x60')]['rawAttributes']);_0x1193c5[_0x6327('0x31')]=_[_0x6327('0x32')](_0x59a5cc[_0x6327('0x31')]);_0x1193c5[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x1193c5['model'],_0x1193c5['query']);_0x35477c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1193c5[_0x6327('0x34')],qs[_0x6327('0x36')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x36')]));_0x35477c['attributes']=_0x35477c[_0x6327('0x35')][_0x6327('0x37')]?_0x35477c[_0x6327('0x35')]:_0x1193c5['model'];if(!_0x59a5cc[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x35477c[_0x6327('0x1d')]=qs['limit'](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1d')]);_0x35477c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x59a5cc[_0x6327('0x31')][_0x6327('0x1b')]);}_0x35477c[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x59a5cc[_0x6327('0x31')]['sort']);_0x35477c[_0x6327('0x3f')]=qs['filters'](_[_0x6327('0x3b')](_0x59a5cc[_0x6327('0x31')],_0x1193c5['filters']));_0x35477c[_0x6327('0x3f')]['CampaignId']=_0x40019b['id'];if(_0x59a5cc[_0x6327('0x31')]['filter']){_0x35477c[_0x6327('0x3f')]=_['merge'](_0x35477c[_0x6327('0x3f')],{'$or':_['map'](_0x35477c[_0x6327('0x35')],function(_0xb46760){var _0x173560={};_0x173560[_0xb46760]={'$like':'%'+_0x59a5cc['query']['filter']+'%'};return _0x173560;})});}_0x35477c=_[_0x6327('0x3e')]({},_0x35477c,_0x59a5cc[_0x6327('0x42')]);return db['CmHopperFinal'][_0x6327('0x1e')]({'where':_0x35477c[_0x6327('0x3f')]})[_0x6327('0x26')](function(_0x5d6a16){_0x12726d[_0x6327('0x1e')]=_0x5d6a16;if(_0x59a5cc[_0x6327('0x31')]['includeAll']){_0x35477c['include']=[{'all':!![]}];}return db[_0x6327('0x60')][_0x6327('0x44')](_0x35477c);})[_0x6327('0x26')](function(_0x3f23c4){_0x12726d['rows']=_0x3f23c4;return _0x12726d;});}})[_0x6327('0x26')](respondWithFilteredResult(_0x15a1dc,_0x35477c))[_0x6327('0x46')](handleError(_0x15a1dc,null));};exports[_0x6327('0x61')]=function(_0x48645b,_0xf25a85,_0x18cba6){var _0x6c8c4c={'raw':!![],'where':{}};var _0x1b6b96={};var _0x254fdc={'count':0x0,'rows':[]};return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x48645b[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0xf25a85,null))[_0x6327('0x26')](function(_0x43eae1){if(_0x43eae1){_0x1b6b96['model']=_[_0x6327('0x32')](db['CmHopperBlack'][_0x6327('0x2e')]);_0x1b6b96[_0x6327('0x31')]=_[_0x6327('0x32')](_0x48645b[_0x6327('0x31')]);_0x1b6b96[_0x6327('0x3c')]=_['intersection'](_0x1b6b96[_0x6327('0x34')],_0x1b6b96['query']);_0x6c8c4c[_0x6327('0x35')]=_[_0x6327('0x33')](_0x1b6b96[_0x6327('0x34')],qs[_0x6327('0x36')](_0x48645b[_0x6327('0x31')][_0x6327('0x36')]));_0x6c8c4c[_0x6327('0x35')]=_0x6c8c4c[_0x6327('0x35')][_0x6327('0x37')]?_0x6c8c4c[_0x6327('0x35')]:_0x1b6b96[_0x6327('0x34')];if(!_0x48645b[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x6c8c4c[_0x6327('0x1d')]=qs['limit'](_0x48645b['query'][_0x6327('0x1d')]);_0x6c8c4c[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x48645b[_0x6327('0x31')]['offset']);}_0x6c8c4c[_0x6327('0x39')]=qs['sort'](_0x48645b['query']['sort']);_0x6c8c4c['where']=qs[_0x6327('0x3c')](_['pick'](_0x48645b[_0x6327('0x31')],_0x1b6b96[_0x6327('0x3c')]));_0x6c8c4c[_0x6327('0x3f')]['CampaignId']=_0x43eae1['id'];if(_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]){_0x6c8c4c[_0x6327('0x3f')]=_['merge'](_0x6c8c4c[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x6c8c4c[_0x6327('0x35')],function(_0x267bdc){var _0x30e33c={};_0x30e33c[_0x267bdc]={'$like':'%'+_0x48645b[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30e33c;})});}_0x6c8c4c=_[_0x6327('0x3e')]({},_0x6c8c4c,_0x48645b[_0x6327('0x42')]);return db[_0x6327('0x62')][_0x6327('0x1e')]({'where':_0x6c8c4c['where']})['then'](function(_0x2a225b){_0x254fdc[_0x6327('0x1e')]=_0x2a225b;if(_0x48645b[_0x6327('0x31')]['includeAll']){_0x6c8c4c['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6327('0x44')](_0x6c8c4c);})['then'](function(_0x43381e){_0x254fdc[_0x6327('0x45')]=_0x43381e;return _0x254fdc;});}})['then'](respondWithFilteredResult(_0xf25a85,_0x6c8c4c))[_0x6327('0x46')](handleError(_0xf25a85,null));};exports[_0x6327('0x63')]=function(_0x2bb6e5,_0x59b7f0,_0x1c9921){var _0x3fed01={};var _0x345f6c={};var _0xd091e1;var _0x9f1c8d;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x2bb6e5['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x59b7f0,null))[_0x6327('0x26')](function(_0x27e847){if(_0x27e847){_0xd091e1=_0x27e847;_0x345f6c[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x345f6c['query']=_[_0x6327('0x32')](_0x2bb6e5[_0x6327('0x31')]);_0x345f6c[_0x6327('0x3c')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],_0x345f6c[_0x6327('0x31')]);_0x3fed01[_0x6327('0x35')]=_[_0x6327('0x33')](_0x345f6c[_0x6327('0x34')],qs[_0x6327('0x36')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x36')]));_0x3fed01[_0x6327('0x35')]=_0x3fed01['attributes']['length']?_0x3fed01[_0x6327('0x35')]:_0x345f6c[_0x6327('0x34')];_0x3fed01[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3a')]);_0x3fed01[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x2bb6e5[_0x6327('0x31')],_0x345f6c['filters']));if(_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]){_0x3fed01[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x3fed01[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x3fed01[_0x6327('0x35')],function(_0x13abc5){var _0x518315={};_0x518315[_0x13abc5]={'$like':'%'+_0x2bb6e5[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x518315;})});}_0x3fed01=_[_0x6327('0x3e')]({},_0x3fed01,_0x2bb6e5['options']);return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})[_0x6327('0x26')](function(_0x42d4ff){if(_0x42d4ff){_0x9f1c8d=_0x42d4ff[_0x6327('0x37')];if(!_0x2bb6e5[_0x6327('0x31')][_0x6327('0x5b')](_0x6327('0x38'))){_0x3fed01[_0x6327('0x1d')]=qs[_0x6327('0x1d')](_0x2bb6e5[_0x6327('0x31')]['limit']);_0x3fed01[_0x6327('0x1b')]=qs[_0x6327('0x1b')](_0x2bb6e5[_0x6327('0x31')][_0x6327('0x1b')]);}return _0xd091e1[_0x6327('0x63')](_0x3fed01);}})['then'](function(_0x48888c){if(_0x48888c){return _0x48888c?{'count':_0x9f1c8d,'rows':_0x48888c}:null;}})['then'](respondWithResult(_0x59b7f0,null))[_0x6327('0x46')](handleError(_0x59b7f0,null));};exports[_0x6327('0x65')]=function(_0x3f1526,_0x3cd50a,_0x718062){var _0x132990,_0x486571;var _0x56c2b0=[];var _0x364719=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x6327('0x4a')]({'where':{'id':_0x3f1526[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x3cd50a,null))[_0x6327('0x26')](function(_0x594fb3){if(_0x594fb3){_0x486571=_0x594fb3;return _0x594fb3[_0x6327('0x65')](_0x3f1526[_0x6327('0x4c')][_0x6327('0x67')],_[_0x6327('0x56')](_0x3f1526[_0x6327('0x4c')],[_0x6327('0x67'),'id'])||{});}return null;})[_0x6327('0x68')](function(_0x9e2e85){var _0x4174e4;var _0x4fa038;_0x132990=_0x9e2e85||[];var _0x570605=[];if(_0x9e2e85){for(var _0x1aa3ba=0x0;_0x1aa3ba<_0x9e2e85[_0x6327('0x37')];_0x1aa3ba+=0x1){var _0x3534a9=_0x9e2e85[_0x1aa3ba]['get']({'plain':!![]});_0x486571['dialCheckDuplicateType']=_0x3f1526[_0x6327('0x4c')]['dialCheckDuplicateType']?_0x3f1526[_0x6327('0x4c')][_0x6327('0x69')]:_0x486571[_0x6327('0x69')];switch(_0x486571[_0x6327('0x69')]){case _0x6327('0x6a'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),'ContactId',_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id','ContactId')[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),'ListId')[_0x6327('0x72')](_0x3f1526['params']['id'][_0x6327('0x75')](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78'))[_0x6327('0x3f')](_0x6327('0x79'),squel['select']()['field'](_0x6327('0x7a'))['from'](_0x6327('0x7b'))[_0x6327('0x3f')](_0x6327('0x7c'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]()))[_0x6327('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6327('0x7d')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6327('0x6d'))[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())))['toString']();break;case _0x6327('0x7e'):_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x6d'))[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x70'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel[_0x6327('0x7d')]()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))[_0x6327('0x72')]('NOW()',_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9[_0x6327('0x74')][_0x6327('0x75')](),_0x6327('0x71'))[_0x6327('0x72')](_0x3f1526[_0x6327('0x48')]['id']['toString'](),_0x6327('0x5c'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27','createdAt')[_0x6327('0x72')]('\x27'+_0x364719+'\x27','updatedAt')[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6327('0x3f')](_0x6327('0x79'),squel[_0x6327('0x7d')]()[_0x6327('0x72')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x6327('0x3f')]('CampaignId\x20=\x20?',_0x3f1526['params']['id'][_0x6327('0x75')]())))[_0x6327('0x75')]();break;default:_0x4174e4=squel[_0x6327('0x6b')]()[_0x6327('0x6c')]('cm_hopper')['fromQuery']([_0x6327('0x6f'),'scheduledAt',_0x6327('0x7f'),_0x6327('0x71'),'CampaignId',_0x6327('0x58'),'updatedAt'],squel[_0x6327('0x7d')]()['field'](_0x6327('0x6f'),'phone')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x70'))[_0x6327('0x72')]('id',_0x6327('0x7f'))[_0x6327('0x72')](_0x3534a9['CmListId'][_0x6327('0x75')](),_0x6327('0x71'))['field'](_0x3f1526['params']['id']['toString'](),_0x6327('0x5c'))['field']('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))['from']('cm_contacts')['where'](_0x6327('0x80'))[_0x6327('0x3f')]('ListId\x20=\x20?',_0x3534a9['CmListId'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))['toString']();}_0x4fa038=squel[_0x6327('0x6b')]()[_0x6327('0x6c')](_0x6327('0x81'))['fromQuery'](['cmHopperId',_0x6327('0x70'),_0x6327('0x6f'),_0x6327('0x82'),'createdAt','updatedAt'],squel[_0x6327('0x7d')]()[_0x6327('0x72')]('h.id','id')[_0x6327('0x72')](_0x6327('0x73'),'scheduledAt')[_0x6327('0x72')]('ci.item','phone')[_0x6327('0x72')](_0x6327('0x83'),_0x6327('0x82'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x58'))[_0x6327('0x72')]('\x27'+_0x364719+'\x27',_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x84'),'ci')[_0x6327('0x85')](_0x6327('0x6d'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6327('0x3f')](_0x6327('0x86'),_0x3534a9[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x87'),_0x3f1526[_0x6327('0x48')]['id'][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x88'),_0x364719))[_0x6327('0x75')]();_0x570605[_0x6327('0x89')](db[_0x6327('0x8a')]['query'](_0x4174e4));_0x56c2b0[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x4fa038));}return BPromise[_0x6327('0x8b')](_0x570605);}})['then'](function(){return BPromise[_0x6327('0x8b')](_0x56c2b0);})[_0x6327('0x26')](function(){return _0x132990;})[_0x6327('0x26')](respondWithResult(_0x3cd50a,null))[_0x6327('0x46')](handleError(_0x3cd50a,null));};exports[_0x6327('0x8c')]=function(_0x1a719a,_0x13a38c,_0x457343){return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x13a38c,null))[_0x6327('0x26')](function(_0xdad37e){if(_0xdad37e){return _0xdad37e[_0x6327('0x8c')](_0x1a719a[_0x6327('0x31')][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x1f4b95){if(_0x1f4b95){return db[_0x6327('0x5d')][_0x6327('0x27')]({'where':{'ListId':_0x1a719a[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x1a719a[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x1f4b95;});}})[_0x6327('0x26')](respondWithStatusCode(_0x13a38c,null))[_0x6327('0x46')](handleError(_0x13a38c,null));};exports[_0x6327('0x8d')]=function(_0x49975c,_0x6546a9,_0x526d09){var _0x26582e={};var _0x4f0579={};var _0x4ec482;var _0xf593bf;return db[_0x6327('0x2d')][_0x6327('0x5a')]({'where':{'id':_0x49975c[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x6546a9,null))[_0x6327('0x26')](function(_0xaee17e){if(_0xaee17e){_0x4ec482=_0xaee17e;_0x4f0579[_0x6327('0x34')]=_[_0x6327('0x32')](db[_0x6327('0x64')][_0x6327('0x2e')]);_0x4f0579[_0x6327('0x31')]=_[_0x6327('0x32')](_0x49975c[_0x6327('0x31')]);_0x4f0579['filters']=_[_0x6327('0x33')](_0x4f0579[_0x6327('0x34')],_0x4f0579[_0x6327('0x31')]);_0x26582e['attributes']=_['intersection'](_0x4f0579['model'],qs['fields'](_0x49975c[_0x6327('0x31')][_0x6327('0x36')]));_0x26582e[_0x6327('0x35')]=_0x26582e['attributes'][_0x6327('0x37')]?_0x26582e[_0x6327('0x35')]:_0x4f0579[_0x6327('0x34')];_0x26582e[_0x6327('0x39')]=qs[_0x6327('0x3a')](_0x49975c[_0x6327('0x31')][_0x6327('0x3a')]);_0x26582e[_0x6327('0x3f')]=qs[_0x6327('0x3c')](_[_0x6327('0x3b')](_0x49975c[_0x6327('0x31')],_0x4f0579[_0x6327('0x3c')]));if(_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]){_0x26582e[_0x6327('0x3f')]=_[_0x6327('0x3e')](_0x26582e[_0x6327('0x3f')],{'$or':_[_0x6327('0x40')](_0x26582e[_0x6327('0x35')],function(_0x3d7eea){var _0x30f233={};_0x30f233[_0x3d7eea]={'$like':'%'+_0x49975c[_0x6327('0x31')][_0x6327('0x3d')]+'%'};return _0x30f233;})});}_0x26582e=_[_0x6327('0x3e')]({},_0x26582e,_0x49975c[_0x6327('0x42')]);return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x21df66){if(_0x21df66){_0xf593bf=_0x21df66[_0x6327('0x37')];if(!_0x49975c[_0x6327('0x31')][_0x6327('0x5b')]('nolimit')){_0x26582e['limit']=qs[_0x6327('0x1d')](_0x49975c[_0x6327('0x31')]['limit']);_0x26582e[_0x6327('0x1b')]=qs['offset'](_0x49975c[_0x6327('0x31')]['offset']);}return _0x4ec482[_0x6327('0x8d')](_0x26582e);}})[_0x6327('0x26')](function(_0x52c67a){if(_0x52c67a){return _0x52c67a?{'count':_0xf593bf,'rows':_0x52c67a}:null;}})['then'](respondWithResult(_0x6546a9,null))[_0x6327('0x46')](handleError(_0x6546a9,null));};exports[_0x6327('0x8e')]=function(_0x4e7082,_0x497d7f,_0x3f5ddc){var _0x40047b,_0xf8d14c;var _0x431412=[];var _0x3f1690=moment()[_0x6327('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6327('0x2d')][_0x6327('0x4a')]({'where':{'id':_0x4e7082[_0x6327('0x48')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x497d7f,null))[_0x6327('0x26')](function(_0x4bf469){if(_0x4bf469){_0xf8d14c=_0x4bf469;return _0x4bf469['addBlackLists'](_0x4e7082['body'][_0x6327('0x67')],_['omit'](_0x4e7082[_0x6327('0x4c')],['ids','id'])||{});}return null;})[_0x6327('0x68')](function(_0x2e28c7){var _0x464324;var _0x86039;_0x40047b=_0x2e28c7||[];var _0x2980d1=[];if(_0x2e28c7){for(var _0x589d31=0x0;_0x589d31<_0x2e28c7[_0x6327('0x37')];_0x589d31+=0x1){var _0x2d6ed2=_0x2e28c7[_0x589d31][_0x6327('0x4e')]({'plain':!![]});_0x464324=squel[_0x6327('0x6b')]()['into']('cm_hopper_black')[_0x6327('0x6e')]([_0x6327('0x6f'),_0x6327('0x7f'),_0x6327('0x71'),_0x6327('0x5c'),_0x6327('0x58'),_0x6327('0x57')],squel['select']()[_0x6327('0x72')](_0x6327('0x6f'),_0x6327('0x6f'))['field']('id','ContactId')[_0x6327('0x72')](_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')](),'ListId')['field'](_0x4e7082[_0x6327('0x48')]['id'][_0x6327('0x75')](),'CampaignId')[_0x6327('0x72')](_0x6327('0x73'),'createdAt')[_0x6327('0x72')](_0x6327('0x73'),_0x6327('0x57'))[_0x6327('0x76')](_0x6327('0x77'))[_0x6327('0x3f')](_0x6327('0x80'))[_0x6327('0x3f')](_0x6327('0x8f'),_0x2d6ed2[_0x6327('0x74')][_0x6327('0x75')]())[_0x6327('0x3f')](_0x6327('0x78')))[_0x6327('0x75')]();_0x2980d1[_0x6327('0x89')](db[_0x6327('0x8a')][_0x6327('0x31')](_0x464324));}return BPromise[_0x6327('0x8b')](_0x2980d1);}})['then'](function(){return _0x40047b;})[_0x6327('0x26')](respondWithResult(_0x497d7f,null))['catch'](handleError(_0x497d7f,null));};exports['removeBlackLists']=function(_0x458d83,_0x440bb7,_0xb44077){return db[_0x6327('0x2d')]['find']({'where':{'id':_0x458d83['params']['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x440bb7,null))[_0x6327('0x26')](function(_0x1dc095){if(_0x1dc095){return _0x1dc095[_0x6327('0x90')](_0x458d83['query'][_0x6327('0x67')]);}})[_0x6327('0x26')](function(_0x593782){if(_0x593782){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x458d83[_0x6327('0x31')][_0x6327('0x67')],'CampaignId':_0x458d83[_0x6327('0x48')]['id']}})[_0x6327('0x26')](function(){return _0x593782;});}})[_0x6327('0x26')](respondWithStatusCode(_0x440bb7,null))[_0x6327('0x46')](handleError(_0x440bb7,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index fc3bd09..72ed81b 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x493030,_0x29ec7e){var _0x56f5e4=function(_0xb929a1){while(--_0xb929a1){_0x493030['push'](_0x493030['shift']());}};_0x56f5e4(++_0x29ec7e);}(_0x7a54,0x106));var _0x47a5=function(_0x885728,_0x55483b){_0x885728=_0x885728-0x0;var _0x26a1c6=_0x7a54[_0x885728];return _0x26a1c6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 9591368..ba19c48 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 _0x49e9=['raw','where','attributes','limit','map','model','include','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options'];(function(_0x3d9156,_0x51a71f){var _0x3e3b2e=function(_0xc2e17b){while(--_0xc2e17b){_0x3d9156['push'](_0x3d9156['shift']());}};_0x3e3b2e(++_0x51a71f);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('Campaign,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});}exports[_0x949e('0x16')]=function(_0x43498d){var _0x868913=this;return new Promise(function(_0x20333c,_0x5caac9){return db[_0x949e('0x17')][_0x949e('0x18')]({'raw':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1a')]===undefined?!![]:![]:!![],'where':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1b')]||null:null,'attributes':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1c')]||null:null,'limit':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1d')]||null:null,'include':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')]['include']?_[_0x949e('0x1e')](_0x43498d[_0x949e('0x19')]['include'],function(_0x48a1d1){return{'model':db[_0x48a1d1[_0x949e('0x1f')]],'as':_0x48a1d1['as'],'attributes':_0x48a1d1[_0x949e('0x1c')],'include':_0x48a1d1[_0x949e('0x20')]?_[_0x949e('0x1e')](_0x48a1d1[_0x949e('0x20')],function(_0x1185b3){return{'model':db[_0x1185b3[_0x949e('0x1f')]],'as':_0x1185b3['as'],'attributes':_0x1185b3[_0x949e('0x1c')],'include':_0x1185b3[_0x949e('0x20')]?_[_0x949e('0x1e')](_0x1185b3['include'],function(_0x212224){return{'model':db[_0x212224[_0x949e('0x1f')]],'as':_0x212224['as'],'attributes':_0x212224['attributes']};}):[]};}):[]};}):[]:[]})[_0x949e('0xa')](function(_0x20061d){logger['info'](_0x949e('0x16'),_0x43498d);logger[_0x949e('0xd')]('GetCampaign',_0x43498d,JSON[_0x949e('0xf')](_0x20061d));_0x20333c(_0x20061d);})['catch'](function(_0x5e6e34){logger[_0x949e('0x10')]('GetCampaign',_0x5e6e34['message'],_0x43498d);_0x5caac9(_0x868913[_0x949e('0x10')](0x1f4,_0x5e6e34[_0x949e('0x13')]));});});}; \ No newline at end of file +var _0x5cd8=['http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','include','map','model','attributes','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c5818,_0x427193){var _0x4e55fe=function(_0x2183f9){while(--_0x2183f9){_0x5c5818['push'](_0x5c5818['shift']());}};_0x4e55fe(++_0x427193);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x281d70,_0x4919ca){_0x281d70=_0x281d70-0x0;var _0x1bf726=_0x5cd8[_0x281d70];return _0x1bf726;};'use strict';var _=require(_0x85cd('0x0'));var util=require('util');var moment=require(_0x85cd('0x1'));var BPromise=require(_0x85cd('0x2'));var rs=require(_0x85cd('0x3'));var fs=require('fs');var Redis=require(_0x85cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x85cd('0x5'));var logger=require('../../config/logger')(_0x85cd('0x6'));var config=require(_0x85cd('0x7'));var jayson=require(_0x85cd('0x8'));var client=jayson[_0x85cd('0x9')][_0x85cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x598ab6,_0x1a8619,_0x1a69c4){return new BPromise(function(_0x5aa3c3,_0x1e002d){return client[_0x85cd('0xb')](_0x598ab6,_0x1a69c4)[_0x85cd('0xc')](function(_0x30204b){logger[_0x85cd('0xd')](_0x85cd('0xe'),_0x1a8619,_0x85cd('0xf'));logger[_0x85cd('0x10')](_0x85cd('0x11'),_0x1a8619,'request\x20sent',JSON['stringify'](_0x30204b));if(_0x30204b[_0x85cd('0x12')]){if(_0x30204b[_0x85cd('0x12')][_0x85cd('0x13')]===0x1f4){logger[_0x85cd('0x12')]('Campaign,\x20%s,\x20%s',_0x1a8619,_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);return _0x1e002d(_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);}logger[_0x85cd('0x12')](_0x85cd('0xe'),_0x1a8619,_0x30204b[_0x85cd('0x12')][_0x85cd('0x14')]);return _0x5aa3c3(_0x30204b['error'][_0x85cd('0x14')]);}else{logger[_0x85cd('0xd')](_0x85cd('0xe'),_0x1a8619,_0x85cd('0xf'));_0x5aa3c3(_0x30204b[_0x85cd('0x15')]['message']);}})[_0x85cd('0x16')](function(_0x5164e8){logger[_0x85cd('0x12')]('Campaign,\x20%s,\x20%s',_0x1a8619,_0x5164e8);_0x1e002d(_0x5164e8);});});}exports[_0x85cd('0x17')]=function(_0x4d9c64){var _0x40e2e5=this;return new Promise(function(_0x11292e,_0x238799){return db[_0x85cd('0x18')][_0x85cd('0x19')]({'raw':_0x4d9c64[_0x85cd('0x1a')]?_0x4d9c64[_0x85cd('0x1a')][_0x85cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d9c64['options']?_0x4d9c64[_0x85cd('0x1a')][_0x85cd('0x1c')]||null:null,'attributes':_0x4d9c64['options']?_0x4d9c64['options']['attributes']||null:null,'limit':_0x4d9c64['options']?_0x4d9c64[_0x85cd('0x1a')]['limit']||null:null,'include':_0x4d9c64[_0x85cd('0x1a')]?_0x4d9c64[_0x85cd('0x1a')][_0x85cd('0x1d')]?_[_0x85cd('0x1e')](_0x4d9c64['options'][_0x85cd('0x1d')],function(_0x2b00a8){return{'model':db[_0x2b00a8[_0x85cd('0x1f')]],'as':_0x2b00a8['as'],'attributes':_0x2b00a8[_0x85cd('0x20')],'include':_0x2b00a8[_0x85cd('0x1d')]?_[_0x85cd('0x1e')](_0x2b00a8['include'],function(_0xb3500f){return{'model':db[_0xb3500f[_0x85cd('0x1f')]],'as':_0xb3500f['as'],'attributes':_0xb3500f[_0x85cd('0x20')],'include':_0xb3500f[_0x85cd('0x1d')]?_['map'](_0xb3500f[_0x85cd('0x1d')],function(_0x43a062){return{'model':db[_0x43a062[_0x85cd('0x1f')]],'as':_0x43a062['as'],'attributes':_0x43a062['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ea68b){logger['info'](_0x85cd('0x17'),_0x4d9c64);logger[_0x85cd('0x10')](_0x85cd('0x17'),_0x4d9c64,JSON[_0x85cd('0x21')](_0x2ea68b));_0x11292e(_0x2ea68b);})['catch'](function(_0x225802){logger[_0x85cd('0x12')](_0x85cd('0x17'),_0x225802[_0x85cd('0x14')],_0x4d9c64);_0x238799(_0x40e2e5['error'](0x1f4,_0x225802[_0x85cd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index cb0272e..c507292 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 _0x1d50=['addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addLists'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x1d50,0x1c7));var _0x01d5=function(_0x1a4d23,_0x3e9f58){_0x1a4d23=_0x1a4d23-0x0;var _0x53e632=_0x1d50[_0x1a4d23];return _0x53e632;};'use strict';var multer=require(_0x01d5('0x0'));var util=require(_0x01d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x01d5('0x2'));var auth=require(_0x01d5('0x3'));var interaction=require(_0x01d5('0x4'));var config=require('../../config/environment');var controller=require(_0x01d5('0x5'));router[_0x01d5('0x6')]('/',auth[_0x01d5('0x7')](),controller[_0x01d5('0x8')]);router[_0x01d5('0x6')](_0x01d5('0x9'),auth['isAuthenticated'](),controller[_0x01d5('0xa')]);router[_0x01d5('0x6')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x01d5('0xb')]);router['get'](_0x01d5('0xc'),auth[_0x01d5('0x7')](),controller[_0x01d5('0xd')]);router['get'](_0x01d5('0xe'),auth[_0x01d5('0x7')](),controller[_0x01d5('0xf')]);router['get']('/:id/hopper_black',auth[_0x01d5('0x7')](),controller[_0x01d5('0x10')]);router[_0x01d5('0x6')](_0x01d5('0x11'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x12')]);router[_0x01d5('0x6')](_0x01d5('0x13'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x14')]);router['post']('/',auth[_0x01d5('0x7')](),controller[_0x01d5('0x15')]);router[_0x01d5('0x16')](_0x01d5('0x17'),auth['isAuthenticated'](),controller['clone']);router[_0x01d5('0x16')]('/:id/lists',auth[_0x01d5('0x7')](),controller[_0x01d5('0x18')]);router['post'](_0x01d5('0x13'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x19')]);router[_0x01d5('0x1a')](_0x01d5('0x9'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x1b')]);router[_0x01d5('0x1c')](_0x01d5('0x9'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x1d')]);router['delete'](_0x01d5('0x11'),auth[_0x01d5('0x7')](),controller[_0x01d5('0x1e')]);router[_0x01d5('0x1c')]('/:id/blacklists',auth[_0x01d5('0x7')](),controller['removeBlackLists']);module[_0x01d5('0x1f')]=router; \ No newline at end of file +var _0xd691=['removeLists','removeBlackLists','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete'];(function(_0x304993,_0x4b16eb){var _0x192983=function(_0x4bc97f){while(--_0x4bc97f){_0x304993['push'](_0x304993['shift']());}};_0x192983(++_0x4b16eb);}(_0xd691,0x182));var _0x1d69=function(_0xd6ab42,_0x4a76f8){_0xd6ab42=_0xd6ab42-0x0;var _0x445960=_0xd691[_0xd6ab42];return _0x445960;};'use strict';var multer=require('multer');var util=require(_0x1d69('0x0'));var path=require(_0x1d69('0x1'));var timeout=require(_0x1d69('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d69('0x3'));var interaction=require(_0x1d69('0x4'));var config=require(_0x1d69('0x5'));var controller=require(_0x1d69('0x6'));router[_0x1d69('0x7')]('/',auth['isAuthenticated'](),controller[_0x1d69('0x8')]);router['get'](_0x1d69('0x9'),auth[_0x1d69('0xa')](),controller['show']);router['get'](_0x1d69('0xb'),auth[_0x1d69('0xa')](),controller[_0x1d69('0xc')]);router[_0x1d69('0x7')](_0x1d69('0xd'),auth['isAuthenticated'](),controller[_0x1d69('0xe')]);router[_0x1d69('0x7')](_0x1d69('0xf'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x10')]);router[_0x1d69('0x7')](_0x1d69('0x11'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x12')]);router[_0x1d69('0x7')]('/:id/lists',auth[_0x1d69('0xa')](),controller[_0x1d69('0x13')]);router['get']('/:id/blacklists',auth[_0x1d69('0xa')](),controller[_0x1d69('0x14')]);router[_0x1d69('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1d69('0x16'),auth['isAuthenticated'](),controller[_0x1d69('0x17')]);router[_0x1d69('0x15')](_0x1d69('0x18'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x19')]);router[_0x1d69('0x15')](_0x1d69('0x1a'),auth['isAuthenticated'](),controller[_0x1d69('0x1b')]);router['put'](_0x1d69('0x9'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x1c')]);router[_0x1d69('0x1d')](_0x1d69('0x9'),auth[_0x1d69('0xa')](),controller['destroy']);router[_0x1d69('0x1d')](_0x1d69('0x18'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x1e')]);router[_0x1d69('0x1d')](_0x1d69('0x1a'),auth[_0x1d69('0xa')](),controller[_0x1d69('0x1f')]);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 5e39a84..79aedd9 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 _0x7ae0=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0x7ae0,0x1e3));var _0x07ae=function(_0x320d83,_0x1cdad3){_0x320d83=_0x320d83-0x0;var _0x5e8c27=_0x7ae0[_0x320d83];return _0x5e8c27;};'use strict';var Sequelize=require(_0x07ae('0x0'));module[_0x07ae('0x1')]={'key':{'type':Sequelize[_0x07ae('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x07ae('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x07ae('0x2')]},'name':{'type':Sequelize[_0x07ae('0x4')],'get':function(){return this[_0x07ae('0x5')](_0x07ae('0x6'));}}}; \ No newline at end of file +var _0x9669=['getDataValue','key','STRING','VIRTUAL'];(function(_0x42d54d,_0x142106){var _0x5ef4f2=function(_0x2e2a92){while(--_0x2e2a92){_0x42d54d['push'](_0x42d54d['shift']());}};_0x5ef4f2(++_0x142106);}(_0x9669,0x9a));var _0x9966=function(_0x47805f,_0x41097a){_0x47805f=_0x47805f-0x0;var _0x479c85=_0x9669[_0x47805f];return _0x479c85;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x9966('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x9966('0x0')]},'name':{'type':Sequelize[_0x9966('0x1')],'get':function(){return this[_0x9966('0x2')](_0x9966('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b18cc20..55f7eba 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 _0x0245=['../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','CannedAnswer','findAll','rows','catch','show','params','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x15b5a4,_0x12b5fc){var _0x487f43=function(_0x2e953e){while(--_0x2e953e){_0x15b5a4['push'](_0x15b5a4['shift']());}};_0x487f43(++_0x12b5fc);}(_0x0245,0xf6));var _0x5024=function(_0x4a1e65,_0x8deb5e){_0x4a1e65=_0x4a1e65-0x0;var _0x20c1f1=_0x0245[_0x4a1e65];return _0x20c1f1;};'use strict';var emlformat=require(_0x5024('0x0'));var rimraf=require(_0x5024('0x1'));var zipdir=require(_0x5024('0x2'));var jsonpatch=require(_0x5024('0x3'));var rp=require('request-promise');var moment=require(_0x5024('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5024('0x5'));var util=require('util');var path=require(_0x5024('0x6'));var sox=require(_0x5024('0x7'));var csv=require('to-csv');var ejs=require(_0x5024('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5024('0x9'));var squel=require(_0x5024('0xa'));var crypto=require(_0x5024('0xb'));var jsforce=require(_0x5024('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5024('0xd'));var querystring=require('querystring');var Papa=require(_0x5024('0xe'));var Redis=require(_0x5024('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5024('0x10'));var hardwareService=require(_0x5024('0x11'));var logger=require(_0x5024('0x12'))(_0x5024('0x13'));var utils=require(_0x5024('0x14'));var config=require(_0x5024('0x15'));var licenseUtil=require(_0x5024('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44a92f,_0x5782dd){_0x5782dd=_0x5782dd||0xcc;return function(_0x6762cf){if(_0x6762cf){return _0x44a92f[_0x5024('0x17')](_0x5782dd);}return _0x44a92f[_0x5024('0x18')](_0x5782dd)['end']();};}function respondWithResult(_0x35b802,_0x416c7d){_0x416c7d=_0x416c7d||0xc8;return function(_0x33144a){if(_0x33144a){return _0x35b802[_0x5024('0x18')](_0x416c7d)[_0x5024('0x19')](_0x33144a);}};}function respondWithFilteredResult(_0x24b39b,_0x2d1ddf){return function(_0x2c3faa){if(_0x2c3faa){var _0x34cfa9=typeof _0x2d1ddf[_0x5024('0x1a')]===_0x5024('0x1b')&&typeof _0x2d1ddf[_0x5024('0x1c')]==='undefined';var _0x543439=_0x2c3faa[_0x5024('0x1d')];var _0x28db94=_0x34cfa9?0x0:_0x2d1ddf[_0x5024('0x1a')];var _0x5bc0ed=_0x34cfa9?_0x2c3faa[_0x5024('0x1d')]:_0x2d1ddf[_0x5024('0x1a')]+_0x2d1ddf[_0x5024('0x1c')];var _0x41deff;if(_0x5bc0ed>=_0x543439){_0x5bc0ed=_0x543439;_0x41deff=0xc8;}else{_0x41deff=0xce;}_0x24b39b['status'](_0x41deff);return _0x24b39b[_0x5024('0x1e')](_0x5024('0x1f'),_0x28db94+'-'+_0x5bc0ed+'/'+_0x543439)['json'](_0x2c3faa);}return null;};}function patchUpdates(_0x40aac1){return function(_0x20a407){try{jsonpatch[_0x5024('0x20')](_0x20a407,_0x40aac1,!![]);}catch(_0x31d2c2){return BPromise['reject'](_0x31d2c2);}return _0x20a407[_0x5024('0x21')]();};}function saveUpdates(_0x140da3,_0x3445a7){return function(_0x2a1e63){if(_0x2a1e63){return _0x2a1e63[_0x5024('0x22')](_0x140da3)[_0x5024('0x23')](function(_0x2d90a1){return _0x2d90a1;});}return null;};}function removeEntity(_0xe92376,_0x345c9){return function(_0x4da102){if(_0x4da102){return _0x4da102[_0x5024('0x24')]()[_0x5024('0x23')](function(){var _0x17ff6b=_0x4da102[_0x5024('0x25')]({'plain':!![]});var _0x509de5=_0x5024('0x26');return db['UserProfileResource'][_0x5024('0x24')]({'where':{'type':_0x509de5,'resourceId':_0x17ff6b['id']}})[_0x5024('0x23')](function(){return _0x4da102;});})[_0x5024('0x23')](function(){_0xe92376['status'](0xcc)[_0x5024('0x27')]();});}};}function handleEntityNotFound(_0xfbd017,_0xe2c473){return function(_0x217fd9){if(!_0x217fd9){_0xfbd017[_0x5024('0x17')](0x194);}return _0x217fd9;};}function handleError(_0x5ea2d2,_0x10530c){_0x10530c=_0x10530c||0x1f4;return function(_0x50425c){logger[_0x5024('0x28')](_0x50425c[_0x5024('0x29')]);if(_0x50425c['name']){delete _0x50425c[_0x5024('0x2a')];}_0x5ea2d2[_0x5024('0x18')](_0x10530c)[_0x5024('0x2b')](_0x50425c);};}exports[_0x5024('0x2c')]=function(_0x3a3f57,_0xefd743){var _0x25c860={},_0x3ab1ce={},_0x1e66f4={'count':0x0,'rows':[]};var _0x34627b=_[_0x5024('0x2d')](db['CannedAnswer'][_0x5024('0x2e')],function(_0x2f33bb){return{'name':_0x2f33bb[_0x5024('0x2f')],'type':_0x2f33bb[_0x5024('0x30')]['key']};});_0x3ab1ce[_0x5024('0x31')]=_['map'](_0x34627b,_0x5024('0x2a'));_0x3ab1ce[_0x5024('0x32')]=_[_0x5024('0x33')](_0x3a3f57[_0x5024('0x32')]);_0x3ab1ce[_0x5024('0x34')]=_[_0x5024('0x35')](_0x3ab1ce[_0x5024('0x31')],_0x3ab1ce[_0x5024('0x32')]);_0x25c860[_0x5024('0x36')]=_[_0x5024('0x35')](_0x3ab1ce[_0x5024('0x31')],qs[_0x5024('0x37')](_0x3a3f57['query']['fields']));_0x25c860[_0x5024('0x36')]=_0x25c860[_0x5024('0x36')][_0x5024('0x38')]?_0x25c860['attributes']:_0x3ab1ce['model'];if(!_0x3a3f57[_0x5024('0x32')][_0x5024('0x39')](_0x5024('0x3a'))){_0x25c860[_0x5024('0x1c')]=qs['limit'](_0x3a3f57[_0x5024('0x32')][_0x5024('0x1c')]);_0x25c860[_0x5024('0x1a')]=qs['offset'](_0x3a3f57[_0x5024('0x32')][_0x5024('0x1a')]);}_0x25c860[_0x5024('0x3b')]=qs['sort'](_0x3a3f57[_0x5024('0x32')][_0x5024('0x3c')]);_0x25c860[_0x5024('0x3d')]=qs[_0x5024('0x34')](_['pick'](_0x3a3f57[_0x5024('0x32')],_0x3ab1ce['filters']),_0x34627b);if(_0x3a3f57[_0x5024('0x32')][_0x5024('0x3e')]){_0x25c860['where']=_['merge'](_0x25c860[_0x5024('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3a3f57[_0x5024('0x32')][_0x5024('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3a3f57[_0x5024('0x32')][_0x5024('0x3e')]+'%'}}]});}_0x25c860=_[_0x5024('0x3f')]({},_0x25c860,_0x3a3f57[_0x5024('0x40')]);var _0x29beb1={'where':_0x25c860[_0x5024('0x3d')]};return db['CannedAnswer'][_0x5024('0x1d')](_0x29beb1)[_0x5024('0x23')](function(_0x57c3c5){_0x1e66f4['count']=_0x57c3c5;if(_0x3a3f57['query'][_0x5024('0x41')]){_0x25c860['include']=[{'all':!![]}];}return db[_0x5024('0x42')][_0x5024('0x43')](_0x25c860);})['then'](function(_0x1ca648){_0x1e66f4[_0x5024('0x44')]=_0x1ca648;return _0x1e66f4;})[_0x5024('0x23')](respondWithFilteredResult(_0xefd743,_0x25c860))[_0x5024('0x45')](handleError(_0xefd743,null));};exports[_0x5024('0x46')]=function(_0x42bc04,_0x2659f4){var _0xcef566={'raw':!![],'where':{'id':_0x42bc04[_0x5024('0x47')]['id']}},_0x4247ce={};_0x4247ce['model']=_['keys'](db[_0x5024('0x42')][_0x5024('0x2e')]);_0x4247ce[_0x5024('0x32')]=_[_0x5024('0x33')](_0x42bc04[_0x5024('0x32')]);_0x4247ce[_0x5024('0x34')]=_[_0x5024('0x35')](_0x4247ce[_0x5024('0x31')],_0x4247ce['query']);_0xcef566['attributes']=_[_0x5024('0x35')](_0x4247ce['model'],qs[_0x5024('0x37')](_0x42bc04[_0x5024('0x32')][_0x5024('0x37')]));_0xcef566[_0x5024('0x36')]=_0xcef566[_0x5024('0x36')]['length']?_0xcef566[_0x5024('0x36')]:_0x4247ce['model'];if(_0x42bc04['query'][_0x5024('0x41')]){_0xcef566[_0x5024('0x48')]=[{'all':!![]}];}_0xcef566=_[_0x5024('0x3f')]({},_0xcef566,_0x42bc04[_0x5024('0x40')]);return db[_0x5024('0x42')][_0x5024('0x49')](_0xcef566)[_0x5024('0x23')](handleEntityNotFound(_0x2659f4,null))[_0x5024('0x23')](respondWithResult(_0x2659f4,null))[_0x5024('0x45')](handleError(_0x2659f4,null));};exports['update']=function(_0x507a4c,_0x5626df){if(_0x507a4c[_0x5024('0x4a')]['id']){delete _0x507a4c[_0x5024('0x4a')]['id'];}return db['CannedAnswer'][_0x5024('0x49')]({'where':{'id':_0x507a4c[_0x5024('0x47')]['id']}})[_0x5024('0x23')](handleEntityNotFound(_0x5626df,null))[_0x5024('0x23')](saveUpdates(_0x507a4c[_0x5024('0x4a')],null))[_0x5024('0x23')](respondWithResult(_0x5626df,null))['catch'](handleError(_0x5626df,null));};exports[_0x5024('0x24')]=function(_0x27f1b2,_0x2a0cff){return db['CannedAnswer'][_0x5024('0x49')]({'where':{'id':_0x27f1b2[_0x5024('0x47')]['id']}})[_0x5024('0x23')](handleEntityNotFound(_0x2a0cff,null))[_0x5024('0x23')](removeEntity(_0x2a0cff,null))[_0x5024('0x45')](handleError(_0x2a0cff,null));};exports[_0x5024('0x4b')]=function(_0x3798bf,_0x36f405){var _0x2d6115={'key':_0x3798bf[_0x5024('0x4a')][_0x5024('0x4c')]};if(_0x3798bf[_0x5024('0x4a')][_0x5024('0x4d')]){_0x2d6115[_0x5024('0x4d')]=_0x3798bf[_0x5024('0x4a')][_0x5024('0x4d')];}else if(_0x3798bf[_0x5024('0x4a')][_0x5024('0x4e')]){_0x2d6115[_0x5024('0x4e')]=_0x3798bf['body'][_0x5024('0x4e')];}else if(_0x3798bf['body'][_0x5024('0x4f')]){_0x2d6115[_0x5024('0x4f')]=_0x3798bf['body'][_0x5024('0x4f')];}else if(_0x3798bf[_0x5024('0x4a')][_0x5024('0x50')]){_0x2d6115[_0x5024('0x50')]=_0x3798bf[_0x5024('0x4a')]['ChatWebsiteId'];}return db[_0x5024('0x42')][_0x5024('0x49')]({'where':_0x2d6115})[_0x5024('0x23')](function(_0x297860){if(_0x297860){throw new db['Sequelize'][(_0x5024('0x51'))](_0x5024('0x52'));}return db[_0x5024('0x42')][_0x5024('0x4b')](_0x3798bf['body']);})[_0x5024('0x23')](function(_0x51df94){var _0x3e5c0f=_0x3798bf[_0x5024('0x53')][_0x5024('0x25')]({'plain':!![]});if(!_0x3e5c0f)throw new Error(_0x5024('0x54'));if(_0x3e5c0f[_0x5024('0x55')]===_0x5024('0x53')){var _0x21f3b7=_0x51df94['get']({'plain':!![]});return db['UserProfileSection'][_0x5024('0x49')]({'where':{'name':_0x5024('0x26'),'userProfileId':_0x3e5c0f[_0x5024('0x56')]},'raw':!![]})[_0x5024('0x23')](function(_0x521661){if(_0x521661&&_0x521661[_0x5024('0x57')]===0x0){return db['UserProfileResource'][_0x5024('0x4b')]({'name':_0x21f3b7[_0x5024('0x2a')],'resourceId':_0x21f3b7['id'],'type':_0x521661[_0x5024('0x2a')],'sectionId':_0x521661['id']},{})[_0x5024('0x23')](function(){return _0x51df94;});}else{return _0x51df94;}})['catch'](function(_0x238795){logger['error'](_0x5024('0x58'),_0x238795);throw _0x238795;});}return _0x51df94;})[_0x5024('0x23')](respondWithResult(_0x36f405,0xc9))[_0x5024('0x45')](handleError(_0x36f405,null));}; \ No newline at end of file +var _0x6c65=['limit','count','apply','reject','save','destroy','then','get','CannedAnswers','stack','name','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','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','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xb2881e,_0x49ef92){var _0x3abeda=function(_0x423bfa){while(--_0x423bfa){_0xb2881e['push'](_0xb2881e['shift']());}};_0x3abeda(++_0x49ef92);}(_0x6c65,0x8f));var _0x56c6=function(_0xef3c80,_0x36164f){_0xef3c80=_0xef3c80-0x0;var _0x27f054=_0x6c65[_0xef3c80];return _0x27f054;};'use strict';var emlformat=require(_0x56c6('0x0'));var rimraf=require(_0x56c6('0x1'));var zipdir=require(_0x56c6('0x2'));var jsonpatch=require(_0x56c6('0x3'));var rp=require(_0x56c6('0x4'));var moment=require(_0x56c6('0x5'));var BPromise=require(_0x56c6('0x6'));var Mustache=require(_0x56c6('0x7'));var util=require(_0x56c6('0x8'));var path=require(_0x56c6('0x9'));var sox=require(_0x56c6('0xa'));var csv=require(_0x56c6('0xb'));var ejs=require(_0x56c6('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x56c6('0xd'));var crypto=require('crypto');var jsforce=require(_0x56c6('0xe'));var deskjs=require(_0x56c6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x56c6('0x10'));var Papa=require(_0x56c6('0x11'));var Redis=require(_0x56c6('0x12'));var authService=require(_0x56c6('0x13'));var qs=require(_0x56c6('0x14'));var as=require(_0x56c6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56c6('0x16'))(_0x56c6('0x17'));var utils=require(_0x56c6('0x18'));var config=require(_0x56c6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x56c6('0x1a'))['db'];function respondWithStatusCode(_0x32f53b,_0x4f54ce){_0x4f54ce=_0x4f54ce||0xcc;return function(_0x55ed95){if(_0x55ed95){return _0x32f53b[_0x56c6('0x1b')](_0x4f54ce);}return _0x32f53b[_0x56c6('0x1c')](_0x4f54ce)[_0x56c6('0x1d')]();};}function respondWithResult(_0x577ee2,_0x12e0d6){_0x12e0d6=_0x12e0d6||0xc8;return function(_0x2155d2){if(_0x2155d2){return _0x577ee2[_0x56c6('0x1c')](_0x12e0d6)[_0x56c6('0x1e')](_0x2155d2);}};}function respondWithFilteredResult(_0x39f80f,_0x47bd65){return function(_0x37bf8b){if(_0x37bf8b){var _0x3da8f1=typeof _0x47bd65[_0x56c6('0x1f')]===_0x56c6('0x20')&&typeof _0x47bd65[_0x56c6('0x21')]==='undefined';var _0x242c41=_0x37bf8b[_0x56c6('0x22')];var _0x46b824=_0x3da8f1?0x0:_0x47bd65[_0x56c6('0x1f')];var _0x5ba445=_0x3da8f1?_0x37bf8b['count']:_0x47bd65[_0x56c6('0x1f')]+_0x47bd65[_0x56c6('0x21')];var _0x2bad22;if(_0x5ba445>=_0x242c41){_0x5ba445=_0x242c41;_0x2bad22=0xc8;}else{_0x2bad22=0xce;}_0x39f80f['status'](_0x2bad22);return _0x39f80f['set']('Content-Range',_0x46b824+'-'+_0x5ba445+'/'+_0x242c41)[_0x56c6('0x1e')](_0x37bf8b);}return null;};}function patchUpdates(_0x2c74ad){return function(_0x4331c2){try{jsonpatch[_0x56c6('0x23')](_0x4331c2,_0x2c74ad,!![]);}catch(_0x3df7a5){return BPromise[_0x56c6('0x24')](_0x3df7a5);}return _0x4331c2[_0x56c6('0x25')]();};}function saveUpdates(_0xd98c4a,_0x315ced){return function(_0x2e8023){if(_0x2e8023){return _0x2e8023['update'](_0xd98c4a)['then'](function(_0x10ae9f){return _0x10ae9f;});}return null;};}function removeEntity(_0x4fce6a,_0x4c1cb1){return function(_0xcde422){if(_0xcde422){return _0xcde422[_0x56c6('0x26')]()[_0x56c6('0x27')](function(){var _0x47bebc=_0xcde422[_0x56c6('0x28')]({'plain':!![]});var _0x42e326=_0x56c6('0x29');return db['UserProfileResource'][_0x56c6('0x26')]({'where':{'type':_0x42e326,'resourceId':_0x47bebc['id']}})['then'](function(){return _0xcde422;});})['then'](function(){_0x4fce6a[_0x56c6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44ca5d,_0x453ca3){return function(_0x2f5c8e){if(!_0x2f5c8e){_0x44ca5d['sendStatus'](0x194);}return _0x2f5c8e;};}function handleError(_0x518b53,_0x345838){_0x345838=_0x345838||0x1f4;return function(_0x1514ad){logger['error'](_0x1514ad[_0x56c6('0x2a')]);if(_0x1514ad[_0x56c6('0x2b')]){delete _0x1514ad['name'];}_0x518b53[_0x56c6('0x1c')](_0x345838)['send'](_0x1514ad);};}exports[_0x56c6('0x2c')]=function(_0x559f1d,_0x1f9d9e){var _0x5c9cb1={},_0x505470={},_0x26ec5e={'count':0x0,'rows':[]};var _0xc80393=_['map'](db[_0x56c6('0x2d')][_0x56c6('0x2e')],function(_0x13cfb){return{'name':_0x13cfb[_0x56c6('0x2f')],'type':_0x13cfb['type'][_0x56c6('0x30')]};});_0x505470[_0x56c6('0x31')]=_[_0x56c6('0x32')](_0xc80393,'name');_0x505470[_0x56c6('0x33')]=_['keys'](_0x559f1d['query']);_0x505470[_0x56c6('0x34')]=_[_0x56c6('0x35')](_0x505470[_0x56c6('0x31')],_0x505470[_0x56c6('0x33')]);_0x5c9cb1[_0x56c6('0x36')]=_[_0x56c6('0x35')](_0x505470[_0x56c6('0x31')],qs[_0x56c6('0x37')](_0x559f1d[_0x56c6('0x33')]['fields']));_0x5c9cb1[_0x56c6('0x36')]=_0x5c9cb1[_0x56c6('0x36')][_0x56c6('0x38')]?_0x5c9cb1['attributes']:_0x505470[_0x56c6('0x31')];if(!_0x559f1d[_0x56c6('0x33')][_0x56c6('0x39')]('nolimit')){_0x5c9cb1[_0x56c6('0x21')]=qs[_0x56c6('0x21')](_0x559f1d[_0x56c6('0x33')][_0x56c6('0x21')]);_0x5c9cb1[_0x56c6('0x1f')]=qs[_0x56c6('0x1f')](_0x559f1d[_0x56c6('0x33')][_0x56c6('0x1f')]);}_0x5c9cb1['order']=qs[_0x56c6('0x3a')](_0x559f1d[_0x56c6('0x33')]['sort']);_0x5c9cb1[_0x56c6('0x3b')]=qs[_0x56c6('0x34')](_['pick'](_0x559f1d['query'],_0x505470['filters']),_0xc80393);if(_0x559f1d['query'][_0x56c6('0x3c')]){_0x5c9cb1[_0x56c6('0x3b')]=_[_0x56c6('0x3d')](_0x5c9cb1[_0x56c6('0x3b')],{'$or':[{'key':{'$like':'%'+_0x559f1d[_0x56c6('0x33')][_0x56c6('0x3c')]+'%'}},{'value':{'$like':'%'+_0x559f1d[_0x56c6('0x33')]['filter']+'%'}}]});}_0x5c9cb1=_[_0x56c6('0x3d')]({},_0x5c9cb1,_0x559f1d['options']);var _0x5e8617={'where':_0x5c9cb1[_0x56c6('0x3b')]};return db[_0x56c6('0x2d')]['count'](_0x5e8617)[_0x56c6('0x27')](function(_0x40c31f){_0x26ec5e['count']=_0x40c31f;if(_0x559f1d[_0x56c6('0x33')][_0x56c6('0x3e')]){_0x5c9cb1[_0x56c6('0x3f')]=[{'all':!![]}];}return db[_0x56c6('0x2d')][_0x56c6('0x40')](_0x5c9cb1);})[_0x56c6('0x27')](function(_0x4724fc){_0x26ec5e[_0x56c6('0x41')]=_0x4724fc;return _0x26ec5e;})[_0x56c6('0x27')](respondWithFilteredResult(_0x1f9d9e,_0x5c9cb1))[_0x56c6('0x42')](handleError(_0x1f9d9e,null));};exports[_0x56c6('0x43')]=function(_0x383bcc,_0x608898){var _0x321162={'raw':!![],'where':{'id':_0x383bcc[_0x56c6('0x44')]['id']}},_0x263e9c={};_0x263e9c[_0x56c6('0x31')]=_['keys'](db[_0x56c6('0x2d')][_0x56c6('0x2e')]);_0x263e9c[_0x56c6('0x33')]=_[_0x56c6('0x45')](_0x383bcc[_0x56c6('0x33')]);_0x263e9c[_0x56c6('0x34')]=_[_0x56c6('0x35')](_0x263e9c['model'],_0x263e9c[_0x56c6('0x33')]);_0x321162[_0x56c6('0x36')]=_[_0x56c6('0x35')](_0x263e9c[_0x56c6('0x31')],qs[_0x56c6('0x37')](_0x383bcc[_0x56c6('0x33')][_0x56c6('0x37')]));_0x321162[_0x56c6('0x36')]=_0x321162[_0x56c6('0x36')][_0x56c6('0x38')]?_0x321162[_0x56c6('0x36')]:_0x263e9c['model'];if(_0x383bcc[_0x56c6('0x33')][_0x56c6('0x3e')]){_0x321162['include']=[{'all':!![]}];}_0x321162=_['merge']({},_0x321162,_0x383bcc[_0x56c6('0x46')]);return db[_0x56c6('0x2d')][_0x56c6('0x47')](_0x321162)[_0x56c6('0x27')](handleEntityNotFound(_0x608898,null))[_0x56c6('0x27')](respondWithResult(_0x608898,null))[_0x56c6('0x42')](handleError(_0x608898,null));};exports['update']=function(_0xacaa7b,_0x2859ef){if(_0xacaa7b[_0x56c6('0x48')]['id']){delete _0xacaa7b[_0x56c6('0x48')]['id'];}return db[_0x56c6('0x2d')][_0x56c6('0x47')]({'where':{'id':_0xacaa7b[_0x56c6('0x44')]['id']}})[_0x56c6('0x27')](handleEntityNotFound(_0x2859ef,null))['then'](saveUpdates(_0xacaa7b['body'],null))[_0x56c6('0x27')](respondWithResult(_0x2859ef,null))['catch'](handleError(_0x2859ef,null));};exports[_0x56c6('0x26')]=function(_0xcf4257,_0x2a7ef4){return db[_0x56c6('0x2d')][_0x56c6('0x47')]({'where':{'id':_0xcf4257[_0x56c6('0x44')]['id']}})[_0x56c6('0x27')](handleEntityNotFound(_0x2a7ef4,null))[_0x56c6('0x27')](removeEntity(_0x2a7ef4,null))[_0x56c6('0x42')](handleError(_0x2a7ef4,null));};exports[_0x56c6('0x49')]=function(_0x375453,_0x2fb378){var _0x226088={'key':_0x375453[_0x56c6('0x48')]['key']};if(_0x375453['body']['MailAccountId']){_0x226088[_0x56c6('0x4a')]=_0x375453['body'][_0x56c6('0x4a')];}else if(_0x375453[_0x56c6('0x48')][_0x56c6('0x4b')]){_0x226088[_0x56c6('0x4b')]=_0x375453[_0x56c6('0x48')][_0x56c6('0x4b')];}else if(_0x375453[_0x56c6('0x48')][_0x56c6('0x4c')]){_0x226088['OpenchannelAccountId']=_0x375453['body'][_0x56c6('0x4c')];}else if(_0x375453[_0x56c6('0x48')][_0x56c6('0x4d')]){_0x226088[_0x56c6('0x4d')]=_0x375453[_0x56c6('0x48')][_0x56c6('0x4d')];}return db[_0x56c6('0x2d')][_0x56c6('0x47')]({'where':_0x226088})[_0x56c6('0x27')](function(_0x507244){if(_0x507244){throw new db[(_0x56c6('0x4e'))]['ValidationError'](_0x56c6('0x4f'));}return db[_0x56c6('0x2d')][_0x56c6('0x49')](_0x375453['body']);})[_0x56c6('0x27')](function(_0x54febb){var _0x46e023=_0x375453['user'][_0x56c6('0x28')]({'plain':!![]});if(!_0x46e023)throw new Error(_0x56c6('0x50'));if(_0x46e023[_0x56c6('0x51')]===_0x56c6('0x52')){var _0x5e211d=_0x54febb[_0x56c6('0x28')]({'plain':!![]});return db[_0x56c6('0x53')][_0x56c6('0x47')]({'where':{'name':_0x56c6('0x29'),'userProfileId':_0x46e023[_0x56c6('0x54')]},'raw':!![]})[_0x56c6('0x27')](function(_0x4d32b6){if(_0x4d32b6&&_0x4d32b6[_0x56c6('0x55')]===0x0){return db['UserProfileResource'][_0x56c6('0x49')]({'name':_0x5e211d[_0x56c6('0x2b')],'resourceId':_0x5e211d['id'],'type':_0x4d32b6[_0x56c6('0x2b')],'sectionId':_0x4d32b6['id']},{})['then'](function(){return _0x54febb;});}else{return _0x54febb;}})[_0x56c6('0x42')](function(_0x59cedd){logger[_0x56c6('0x56')](_0x56c6('0x57'),_0x59cedd);throw _0x59cedd;});}return _0x54febb;})['then'](respondWithResult(_0x2fb378,0xc9))['catch'](handleError(_0x2fb378,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a2a1a41..ca40766 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 _0xe613=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','lodash','../../config/logger','api'];(function(_0x3516e3,_0x37061e){var _0x5054e0=function(_0xa3df88){while(--_0xa3df88){_0x3516e3['push'](_0x3516e3['shift']());}};_0x5054e0(++_0x37061e);}(_0xe613,0x128));var _0x3e61=function(_0x308881,_0x3d8420){_0x308881=_0x308881-0x0;var _0x5cade8=_0xe613[_0x308881];return _0x5cade8;};'use strict';var _=require(_0x3e61('0x0'));var util=require('util');var logger=require(_0x3e61('0x1'))(_0x3e61('0x2'));var moment=require(_0x3e61('0x3'));var BPromise=require(_0x3e61('0x4'));var rp=require(_0x3e61('0x5'));var fs=require('fs');var path=require(_0x3e61('0x6'));var rimraf=require(_0x3e61('0x7'));var config=require('../../config/environment');var attributes=require(_0x3e61('0x8'));module[_0x3e61('0x9')]=function(_0x5cb627,_0x2cd559){return _0x5cb627[_0x3e61('0xa')](_0x3e61('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e61('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8ec3=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x8ec3,0x19c));var _0x38ec=function(_0x221552,_0x5c88d2){_0x221552=_0x221552-0x0;var _0x8ce807=_0x8ec3[_0x221552];return _0x8ce807;};'use strict';var _=require(_0x38ec('0x0'));var util=require('util');var logger=require(_0x38ec('0x1'))(_0x38ec('0x2'));var moment=require(_0x38ec('0x3'));var BPromise=require(_0x38ec('0x4'));var rp=require(_0x38ec('0x5'));var fs=require('fs');var path=require(_0x38ec('0x6'));var rimraf=require('rimraf');var config=require(_0x38ec('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x38ec('0x8')]=function(_0x3cff07,_0x314dc2){return _0x3cff07[_0x38ec('0x9')](_0x38ec('0xa'),attributes,{'tableName':_0x38ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38ec('0xc'),'collate':_0x38ec('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7161788..9acc006 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(_0x2d168f,_0x3efb39){var _0x1c4b25=function(_0x442948){while(--_0x442948){_0x2d168f['push'](_0x2d168f['shift']());}};_0x1c4b25(++_0x3efb39);}(_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 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(_0x31b138,_0x2160c9){var _0x9cc8af=function(_0x397d25){while(--_0x397d25){_0x31b138['push'](_0x31b138['shift']());}};_0x9cc8af(++_0x2160c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 e48c252..85c04e1 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 _0x545b=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x5c31d1,_0x248ff7){var _0x3f1ab1=function(_0x400795){while(--_0x400795){_0x5c31d1['push'](_0x5c31d1['shift']());}};_0x3f1ab1(++_0x248ff7);}(_0x545b,0xd0));var _0xb545=function(_0x36115d,_0x4071a1){_0x36115d=_0x36115d-0x0;var _0x58cd1f=_0x545b[_0x36115d];return _0x58cd1f;};'use strict';var multer=require(_0xb545('0x0'));var util=require('util');var path=require(_0xb545('0x1'));var timeout=require(_0xb545('0x2'));var express=require(_0xb545('0x3'));var router=express[_0xb545('0x4')]();var fs_extra=require(_0xb545('0x5'));var auth=require(_0xb545('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb545('0x7'));var controller=require(_0xb545('0x8'));router[_0xb545('0x9')]('/',auth[_0xb545('0xa')](),controller[_0xb545('0xb')]);router[_0xb545('0x9')](_0xb545('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb545('0xd')]('/',auth[_0xb545('0xa')](),controller[_0xb545('0xe')]);router[_0xb545('0xf')](_0xb545('0xc'),auth['isAuthenticated'](),controller[_0xb545('0x10')]);router[_0xb545('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb545('0x12')]);module[_0xb545('0x13')]=router; \ No newline at end of file +var _0x8525=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x31520d,_0x50046a){var _0x4d0d26=function(_0x187fe0){while(--_0x187fe0){_0x31520d['push'](_0x31520d['shift']());}};_0x4d0d26(++_0x50046a);}(_0x8525,0x12b));var _0x5852=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8525[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x5852('0x0'));var util=require(_0x5852('0x1'));var path=require('path');var timeout=require(_0x5852('0x2'));var express=require(_0x5852('0x3'));var router=express[_0x5852('0x4')]();var fs_extra=require(_0x5852('0x5'));var auth=require(_0x5852('0x6'));var interaction=require(_0x5852('0x7'));var config=require(_0x5852('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x5852('0x9')](),controller[_0x5852('0xa')]);router[_0x5852('0xb')](_0x5852('0xc'),auth[_0x5852('0x9')](),controller['show']);router[_0x5852('0xd')]('/',auth[_0x5852('0x9')](),controller['create']);router[_0x5852('0xe')]('/:id',auth[_0x5852('0x9')](),controller['update']);router[_0x5852('0xf')](_0x5852('0xc'),auth[_0x5852('0x9')](),controller[_0x5852('0x10')]);module[_0x5852('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 99964d2..3990e9c 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 _0xbf04=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x401ec9,_0x77c73f){var _0x8ef3a1=function(_0x171c3c){while(--_0x171c3c){_0x401ec9['push'](_0x401ec9['shift']());}};_0x8ef3a1(++_0x77c73f);}(_0xbf04,0xc1));var _0x4bf0=function(_0x4140a6,_0x493bb2){_0x4140a6=_0x4140a6-0x0;var _0x202fee=_0xbf04[_0x4140a6];return _0x202fee;};'use strict';var Sequelize=require(_0x4bf0('0x0'));module[_0x4bf0('0x1')]={'calldate':{'type':Sequelize[_0x4bf0('0x2')],'allowNull':![],'defaultValue':_0x4bf0('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4bf0('0x4')]},'dst':{'type':Sequelize[_0x4bf0('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x4bf0('0x4')]},'lastapp':{'type':Sequelize[_0x4bf0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4bf0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4bf0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4bf0('0x4')]},'amaflags':{'type':Sequelize[_0x4bf0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4bf0('0x4')]},'uniqueid':{'type':Sequelize[_0x4bf0('0x4')]},'linkedid':{'type':Sequelize[_0x4bf0('0x4')]},'sequence':{'type':Sequelize[_0x4bf0('0x4')]},'peeraccount':{'type':Sequelize[_0x4bf0('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x4bf0('0x4')]}}; \ No newline at end of file +var _0xd85c=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x20f4ff,_0x1bbe89){var _0x17687b=function(_0x572d13){while(--_0x572d13){_0x20f4ff['push'](_0x20f4ff['shift']());}};_0x17687b(++_0x1bbe89);}(_0xd85c,0xb5));var _0xcd85=function(_0x3846dc,_0x3dd50f){_0x3846dc=_0x3846dc-0x0;var _0x3c2cae=_0xd85c[_0x3846dc];return _0x3c2cae;};'use strict';var Sequelize=require(_0xcd85('0x0'));module[_0xcd85('0x1')]={'calldate':{'type':Sequelize[_0xcd85('0x2')],'allowNull':![],'defaultValue':_0xcd85('0x3')},'clid':{'type':Sequelize[_0xcd85('0x4')]},'src':{'type':Sequelize[_0xcd85('0x4')]},'dst':{'type':Sequelize[_0xcd85('0x4')]},'dcontext':{'type':Sequelize[_0xcd85('0x4')]},'channel':{'type':Sequelize[_0xcd85('0x4')]},'dstchannel':{'type':Sequelize[_0xcd85('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xcd85('0x4')]},'duration':{'type':Sequelize[_0xcd85('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xcd85('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcd85('0x4')]},'amaflags':{'type':Sequelize[_0xcd85('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xcd85('0x4')]},'userfield':{'type':Sequelize[_0xcd85('0x4')]},'uniqueid':{'type':Sequelize[_0xcd85('0x4')]},'linkedid':{'type':Sequelize[_0xcd85('0x4')]},'sequence':{'type':Sequelize[_0xcd85('0x4')]},'peeraccount':{'type':Sequelize[_0xcd85('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xcd85('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 8e3b1fa..dbf1e64 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 _0x038b=['lodash','squel','crypto','querystring','../../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','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x038b,0x114));var _0xb038=function(_0x1f7276,_0x7f7dbe){_0x1f7276=_0x1f7276-0x0;var _0x4fef7a=_0x038b[_0x1f7276];return _0x4fef7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':!![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['Cdr']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['Cdr'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['describe']=function(_0x1f4997,_0x2f3622){return db[_0xb038('0x27')][_0xb038('0x46')]()[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));}; \ No newline at end of file +var _0xc21e=['length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','merge','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','save','update','destroy','then','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes'];(function(_0x3ee8d5,_0x3770b4){var _0x37a82d=function(_0x1a0523){while(--_0x1a0523){_0x3ee8d5['push'](_0x3ee8d5['shift']());}};_0x37a82d(++_0x3770b4);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec21('0x0'));var zipdir=require(_0xec21('0x1'));var jsonpatch=require(_0xec21('0x2'));var rp=require(_0xec21('0x3'));var moment=require(_0xec21('0x4'));var BPromise=require(_0xec21('0x5'));var Mustache=require('mustache');var util=require(_0xec21('0x6'));var path=require(_0xec21('0x7'));var sox=require(_0xec21('0x8'));var csv=require(_0xec21('0x9'));var ejs=require(_0xec21('0xa'));var fs=require('fs');var fs_extra=require(_0xec21('0xb'));var _=require(_0xec21('0xc'));var squel=require(_0xec21('0xd'));var crypto=require('crypto');var jsforce=require(_0xec21('0xe'));var deskjs=require(_0xec21('0xf'));var toCsv=require(_0xec21('0x9'));var querystring=require(_0xec21('0x10'));var Papa=require(_0xec21('0x11'));var Redis=require('ioredis');var authService=require(_0xec21('0x12'));var qs=require(_0xec21('0x13'));var as=require(_0xec21('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec21('0x15'));var utils=require(_0xec21('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec21('0x17'));var db=require(_0xec21('0x18'))['db'];function respondWithStatusCode(_0xd9232e,_0x3a6e6a){_0x3a6e6a=_0x3a6e6a||0xcc;return function(_0xc1cca0){if(_0xc1cca0){return _0xd9232e['sendStatus'](_0x3a6e6a);}return _0xd9232e[_0xec21('0x19')](_0x3a6e6a)['end']();};}function respondWithResult(_0x3ea83f,_0x1987f4){_0x1987f4=_0x1987f4||0xc8;return function(_0x34e6af){if(_0x34e6af){return _0x3ea83f['status'](_0x1987f4)[_0xec21('0x1a')](_0x34e6af);}};}function respondWithFilteredResult(_0x3ee6f7,_0x3838c3){return function(_0x2c3124){if(_0x2c3124){var _0x324853=typeof _0x3838c3[_0xec21('0x1b')]===_0xec21('0x1c')&&typeof _0x3838c3[_0xec21('0x1d')]==='undefined';var _0x398c29=_0x2c3124[_0xec21('0x1e')];var _0x2fcbcc=_0x324853?0x0:_0x3838c3[_0xec21('0x1b')];var _0x3ab226=_0x324853?_0x2c3124[_0xec21('0x1e')]:_0x3838c3[_0xec21('0x1b')]+_0x3838c3[_0xec21('0x1d')];var _0x3c790e;if(_0x3ab226>=_0x398c29){_0x3ab226=_0x398c29;_0x3c790e=0xc8;}else{_0x3c790e=0xce;}_0x3ee6f7[_0xec21('0x19')](_0x3c790e);return _0x3ee6f7['set']('Content-Range',_0x2fcbcc+'-'+_0x3ab226+'/'+_0x398c29)[_0xec21('0x1a')](_0x2c3124);}return null;};}function patchUpdates(_0x2f4ef9){return function(_0x5ab97e){try{jsonpatch['apply'](_0x5ab97e,_0x2f4ef9,!![]);}catch(_0x176b59){return BPromise[_0xec21('0x1f')](_0x176b59);}return _0x5ab97e[_0xec21('0x20')]();};}function saveUpdates(_0x5dff00,_0x17d1ac){return function(_0x1f86d2){if(_0x1f86d2){return _0x1f86d2[_0xec21('0x21')](_0x5dff00)['then'](function(_0x20ede9){return _0x20ede9;});}return null;};}function removeEntity(_0x454d31,_0x2d521a){return function(_0x46fd9e){if(_0x46fd9e){return _0x46fd9e[_0xec21('0x22')]()[_0xec21('0x23')](function(){_0x454d31['status'](0xcc)[_0xec21('0x24')]();});}};}function handleEntityNotFound(_0x26cdae,_0x4cd699){return function(_0x19b556){if(!_0x19b556){_0x26cdae['sendStatus'](0x194);}return _0x19b556;};}function handleError(_0x27e2d,_0x49fd27){_0x49fd27=_0x49fd27||0x1f4;return function(_0x4ef840){logger[_0xec21('0x25')](_0x4ef840[_0xec21('0x26')]);if(_0x4ef840[_0xec21('0x27')]){delete _0x4ef840[_0xec21('0x27')];}_0x27e2d[_0xec21('0x19')](_0x49fd27)['send'](_0x4ef840);};}exports[_0xec21('0x28')]=function(_0x592971,_0x343f4f){var _0x233bf9={},_0x116a23={},_0x35b2bf={'count':0x0,'rows':[]};var _0x4dd56b=_[_0xec21('0x29')](db[_0xec21('0x2a')][_0xec21('0x2b')],function(_0x233231){return{'name':_0x233231[_0xec21('0x2c')],'type':_0x233231[_0xec21('0x2d')][_0xec21('0x2e')]};});_0x116a23[_0xec21('0x2f')]=_[_0xec21('0x29')](_0x4dd56b,_0xec21('0x27'));_0x116a23[_0xec21('0x30')]=_['keys'](_0x592971[_0xec21('0x30')]);_0x116a23[_0xec21('0x31')]=_[_0xec21('0x32')](_0x116a23[_0xec21('0x2f')],_0x116a23[_0xec21('0x30')]);_0x233bf9['attributes']=_[_0xec21('0x32')](_0x116a23['model'],qs['fields'](_0x592971['query'][_0xec21('0x33')]));_0x233bf9[_0xec21('0x34')]=_0x233bf9[_0xec21('0x34')][_0xec21('0x35')]?_0x233bf9[_0xec21('0x34')]:_0x116a23[_0xec21('0x2f')];if(!_0x592971[_0xec21('0x30')][_0xec21('0x36')](_0xec21('0x37'))){_0x233bf9[_0xec21('0x1d')]=qs[_0xec21('0x1d')](_0x592971[_0xec21('0x30')]['limit']);_0x233bf9[_0xec21('0x1b')]=qs[_0xec21('0x1b')](_0x592971['query'][_0xec21('0x1b')]);}_0x233bf9['order']=qs['sort'](_0x592971[_0xec21('0x30')]['sort']);_0x233bf9[_0xec21('0x38')]=qs['filters'](_[_0xec21('0x39')](_0x592971[_0xec21('0x30')],_0x116a23['filters']),_0x4dd56b);if(_0x592971[_0xec21('0x30')][_0xec21('0x3a')]){_0x233bf9[_0xec21('0x38')]=_['merge'](_0x233bf9[_0xec21('0x38')],{'$or':_[_0xec21('0x29')](_0x4dd56b,function(_0xcce304){if(_0xcce304['type']!==_0xec21('0x3b')){var _0x2cf43b={};_0x2cf43b[_0xcce304[_0xec21('0x27')]]={'$like':'%'+_0x592971[_0xec21('0x30')][_0xec21('0x3a')]+'%'};return _0x2cf43b;}})});}_0x233bf9=_['merge']({},_0x233bf9,_0x592971[_0xec21('0x3c')]);var _0xc36cc2={'where':_0x233bf9['where']};return db[_0xec21('0x2a')]['count'](_0xc36cc2)[_0xec21('0x23')](function(_0x18e20d){_0x35b2bf[_0xec21('0x1e')]=_0x18e20d;if(_0x592971['query'][_0xec21('0x3d')]){_0x233bf9[_0xec21('0x3e')]=[{'all':!![]}];}return db[_0xec21('0x2a')][_0xec21('0x3f')](_0x233bf9);})['then'](function(_0x575e99){_0x35b2bf[_0xec21('0x40')]=_0x575e99;return _0x35b2bf;})['then'](respondWithFilteredResult(_0x343f4f,_0x233bf9))[_0xec21('0x41')](handleError(_0x343f4f,null));};exports['show']=function(_0x16a794,_0x52e024){var _0x46d4f4={'raw':!![],'where':{'id':_0x16a794['params']['id']}},_0x3510dd={};_0x3510dd[_0xec21('0x2f')]=_[_0xec21('0x42')](db['Cdr'][_0xec21('0x2b')]);_0x3510dd[_0xec21('0x30')]=_[_0xec21('0x42')](_0x16a794[_0xec21('0x30')]);_0x3510dd[_0xec21('0x31')]=_[_0xec21('0x32')](_0x3510dd[_0xec21('0x2f')],_0x3510dd[_0xec21('0x30')]);_0x46d4f4[_0xec21('0x34')]=_['intersection'](_0x3510dd['model'],qs[_0xec21('0x33')](_0x16a794[_0xec21('0x30')][_0xec21('0x33')]));_0x46d4f4['attributes']=_0x46d4f4[_0xec21('0x34')][_0xec21('0x35')]?_0x46d4f4[_0xec21('0x34')]:_0x3510dd['model'];if(_0x16a794['query']['includeAll']){_0x46d4f4[_0xec21('0x3e')]=[{'all':!![]}];}_0x46d4f4=_[_0xec21('0x43')]({},_0x46d4f4,_0x16a794[_0xec21('0x3c')]);return db[_0xec21('0x2a')][_0xec21('0x44')](_0x46d4f4)[_0xec21('0x23')](handleEntityNotFound(_0x52e024,null))[_0xec21('0x23')](respondWithResult(_0x52e024,null))['catch'](handleError(_0x52e024,null));};exports[_0xec21('0x45')]=function(_0x21fe90,_0x2edf34){return db[_0xec21('0x2a')][_0xec21('0x45')](_0x21fe90[_0xec21('0x46')],{})[_0xec21('0x23')](respondWithResult(_0x2edf34,0xc9))[_0xec21('0x41')](handleError(_0x2edf34,null));};exports['update']=function(_0x4204d7,_0x21e67f){if(_0x4204d7[_0xec21('0x46')]['id']){delete _0x4204d7['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x4204d7[_0xec21('0x47')]['id']}})[_0xec21('0x23')](handleEntityNotFound(_0x21e67f,null))['then'](saveUpdates(_0x4204d7[_0xec21('0x46')],null))[_0xec21('0x23')](respondWithResult(_0x21e67f,null))[_0xec21('0x41')](handleError(_0x21e67f,null));};exports['destroy']=function(_0x2d6426,_0x5e90eb){return db[_0xec21('0x2a')]['find']({'where':{'id':_0x2d6426[_0xec21('0x47')]['id']}})[_0xec21('0x23')](handleEntityNotFound(_0x5e90eb,null))[_0xec21('0x23')](removeEntity(_0x5e90eb,null))[_0xec21('0x41')](handleError(_0x5e90eb,null));};exports[_0xec21('0x48')]=function(_0x5c994d,_0x157d42){return db['Cdr'][_0xec21('0x48')]()['then'](respondWithResult(_0x157d42,null))[_0xec21('0x41')](handleError(_0x157d42,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 909038a..1798af1 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x12cd9b,_0x32e030){var _0x56891f=function(_0x1a7cdb){while(--_0x1a7cdb){_0x12cd9b['push'](_0x12cd9b['shift']());}};_0x56891f(++_0x32e030);}(_0x7a54,0x106));var _0x47a5=function(_0x49b3e0,_0x4d6d9c){_0x49b3e0=_0x49b3e0-0x0;var _0x4dfd4b=_0x7a54[_0x49b3e0];return _0x4dfd4b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1b305a,_0xbf1573){var _0x58292e=function(_0x133034){while(--_0x133034){_0x1b305a['push'](_0x1b305a['shift']());}};_0x58292e(++_0xbf1573);}(_0x7a54,0x106));var _0x47a5=function(_0xfba768,_0x298617){_0xfba768=_0xfba768-0x0;var _0x2b36de=_0x7a54[_0xfba768];return _0x2b36de;};'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 1c5c036..2df8120 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 _0x7731=['result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7731,0x120));var _0x1773=function(_0x3090e2,_0x3a1dbf){_0x3090e2=_0x3090e2-0x0;var _0x53fa59=_0x7731[_0x3090e2];return _0x53fa59;};'use strict';var _=require('lodash');var util=require(_0x1773('0x0'));var moment=require('moment');var BPromise=require(_0x1773('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1773('0x2'));var db=require(_0x1773('0x3'))['db'];var utils=require(_0x1773('0x4'));var logger=require('../../config/logger')(_0x1773('0x5'));var config=require(_0x1773('0x6'));var jayson=require(_0x1773('0x7'));var client=jayson[_0x1773('0x8')][_0x1773('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x67106c,_0x4e0487,_0x209515){return new BPromise(function(_0x18e4c4,_0x2434b5){return client[_0x1773('0xa')](_0x67106c,_0x209515)[_0x1773('0xb')](function(_0x91d79c){logger[_0x1773('0xc')](_0x1773('0xd'),_0x4e0487,_0x1773('0xe'));logger[_0x1773('0xf')](_0x1773('0x10'),_0x4e0487,_0x1773('0xe'),JSON[_0x1773('0x11')](_0x91d79c));if(_0x91d79c[_0x1773('0x12')]){if(_0x91d79c['error']['code']===0x1f4){logger[_0x1773('0x12')](_0x1773('0xd'),_0x4e0487,_0x91d79c['error'][_0x1773('0x13')]);return _0x2434b5(_0x91d79c[_0x1773('0x12')]['message']);}logger[_0x1773('0x12')](_0x1773('0xd'),_0x4e0487,_0x91d79c['error'][_0x1773('0x13')]);return _0x18e4c4(_0x91d79c['error'][_0x1773('0x13')]);}else{logger[_0x1773('0xc')](_0x1773('0xd'),_0x4e0487,_0x1773('0xe'));_0x18e4c4(_0x91d79c[_0x1773('0x14')][_0x1773('0x13')]);}})[_0x1773('0x15')](function(_0x28bf7d){logger[_0x1773('0x12')]('Cdr,\x20%s,\x20%s',_0x4e0487,_0x28bf7d);_0x2434b5(_0x28bf7d);});});} \ No newline at end of file +var _0xd440=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x495954,_0x40c155){var _0x70c551=function(_0xeb8f2d){while(--_0xeb8f2d){_0x495954['push'](_0x495954['shift']());}};_0x70c551(++_0x40c155);}(_0xd440,0x14b));var _0x0d44=function(_0x5ea956,_0x4ddb8a){_0x5ea956=_0x5ea956-0x0;var _0x24567e=_0xd440[_0x5ea956];return _0x24567e;};'use strict';var _=require(_0x0d44('0x0'));var util=require(_0x0d44('0x1'));var moment=require(_0x0d44('0x2'));var BPromise=require(_0x0d44('0x3'));var rs=require(_0x0d44('0x4'));var fs=require('fs');var Redis=require(_0x0d44('0x5'));var db=require(_0x0d44('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d44('0x7'))(_0x0d44('0x8'));var config=require(_0x0d44('0x9'));var jayson=require(_0x0d44('0xa'));var client=jayson['client'][_0x0d44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c6eb2,_0x509bf0,_0x25f9b5){return new BPromise(function(_0x338cb9,_0x25a2ab){return client[_0x0d44('0xc')](_0x1c6eb2,_0x25f9b5)[_0x0d44('0xd')](function(_0x376f40){logger[_0x0d44('0xe')](_0x0d44('0xf'),_0x509bf0,_0x0d44('0x10'));logger[_0x0d44('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x509bf0,_0x0d44('0x10'),JSON[_0x0d44('0x12')](_0x376f40));if(_0x376f40[_0x0d44('0x13')]){if(_0x376f40[_0x0d44('0x13')][_0x0d44('0x14')]===0x1f4){logger['error'](_0x0d44('0xf'),_0x509bf0,_0x376f40['error'][_0x0d44('0x15')]);return _0x25a2ab(_0x376f40[_0x0d44('0x13')][_0x0d44('0x15')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x509bf0,_0x376f40[_0x0d44('0x13')][_0x0d44('0x15')]);return _0x338cb9(_0x376f40[_0x0d44('0x13')]['message']);}else{logger[_0x0d44('0xe')](_0x0d44('0xf'),_0x509bf0,_0x0d44('0x10'));_0x338cb9(_0x376f40[_0x0d44('0x16')][_0x0d44('0x15')]);}})[_0x0d44('0x17')](function(_0x182850){logger[_0x0d44('0x13')](_0x0d44('0xf'),_0x509bf0,_0x182850);_0x25a2ab(_0x182850);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1bf1627..98428ef 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x92a313,_0x2e1397){var _0x37c946=function(_0xa8c4f2){while(--_0xa8c4f2){_0x92a313['push'](_0x92a313['shift']());}};_0x37c946(++_0x2e1397);}(_0xb10b,0x12a));var _0xbb10=function(_0x114adc,_0x1b1c55){_0x114adc=_0x114adc-0x0;var _0x19199a=_0xb10b[_0x114adc];return _0x19199a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 87bdb8b..b01642d 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 _0x2ed9=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2ed9,0x1de));var _0x92ed=function(_0x58b900,_0x4067f4){_0x58b900=_0x58b900-0x0;var _0x142565=_0x2ed9[_0x58b900];return _0x142565;};'use strict';var Sequelize=require(_0x92ed('0x0'));module[_0x92ed('0x1')]={'priority':{'type':Sequelize[_0x92ed('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x92ed('0x3')],'allowNull':![],'defaultValue':_0x92ed('0x4')},'appdata':{'type':Sequelize[_0x92ed('0x5')]()},'description':{'type':Sequelize[_0x92ed('0x3')]},'interval':{'type':Sequelize[_0x92ed('0x3')],'defaultValue':_0x92ed('0x6')}}; \ No newline at end of file +var _0x0b73=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b73,0xba));var _0x30b7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0b73[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x30b7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x30b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x30b7('0x2')],'allowNull':![],'defaultValue':_0x30b7('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x30b7('0x2')],'defaultValue':_0x30b7('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 98b67b6..9db0662 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 _0x657b=['save','update','then','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','options','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x5ae1e2,_0x29ee5c){var _0x2fc7f3=function(_0x318f2f){while(--_0x318f2f){_0x5ae1e2['push'](_0x5ae1e2['shift']());}};_0x2fc7f3(++_0x29ee5c);}(_0x657b,0x131));var _0xb657=function(_0x1065bc,_0x25b539){_0x1065bc=_0x1065bc-0x0;var _0x1525fa=_0x657b[_0x1065bc];return _0x1525fa;};'use strict';var emlformat=require(_0xb657('0x0'));var rimraf=require(_0xb657('0x1'));var zipdir=require(_0xb657('0x2'));var jsonpatch=require(_0xb657('0x3'));var rp=require(_0xb657('0x4'));var moment=require('moment');var BPromise=require(_0xb657('0x5'));var Mustache=require(_0xb657('0x6'));var util=require('util');var path=require(_0xb657('0x7'));var sox=require(_0xb657('0x8'));var csv=require(_0xb657('0x9'));var ejs=require(_0xb657('0xa'));var fs=require('fs');var fs_extra=require(_0xb657('0xb'));var _=require('lodash');var squel=require(_0xb657('0xc'));var crypto=require('crypto');var jsforce=require(_0xb657('0xd'));var deskjs=require(_0xb657('0xe'));var toCsv=require(_0xb657('0x9'));var querystring=require('querystring');var Papa=require(_0xb657('0xf'));var Redis=require('ioredis');var authService=require(_0xb657('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb657('0x11'));var hardwareService=require(_0xb657('0x12'));var logger=require(_0xb657('0x13'))('api');var utils=require(_0xb657('0x14'));var config=require(_0xb657('0x15'));var licenseUtil=require(_0xb657('0x16'));var db=require(_0xb657('0x17'))['db'];function respondWithStatusCode(_0x51228b,_0x3e1ea1){_0x3e1ea1=_0x3e1ea1||0xcc;return function(_0x3ebcc2){if(_0x3ebcc2){return _0x51228b['sendStatus'](_0x3e1ea1);}return _0x51228b[_0xb657('0x18')](_0x3e1ea1)[_0xb657('0x19')]();};}function respondWithResult(_0xf04de9,_0x3ca0b4){_0x3ca0b4=_0x3ca0b4||0xc8;return function(_0x4aedb7){if(_0x4aedb7){return _0xf04de9[_0xb657('0x18')](_0x3ca0b4)[_0xb657('0x1a')](_0x4aedb7);}};}function respondWithFilteredResult(_0x511057,_0x4d253b){return function(_0x144eaf){if(_0x144eaf){var _0xbde891=typeof _0x4d253b[_0xb657('0x1b')]===_0xb657('0x1c')&&typeof _0x4d253b[_0xb657('0x1d')]===_0xb657('0x1c');var _0x20919b=_0x144eaf[_0xb657('0x1e')];var _0x9e98be=_0xbde891?0x0:_0x4d253b[_0xb657('0x1b')];var _0x2f0ba0=_0xbde891?_0x144eaf['count']:_0x4d253b[_0xb657('0x1b')]+_0x4d253b[_0xb657('0x1d')];var _0x21474b;if(_0x2f0ba0>=_0x20919b){_0x2f0ba0=_0x20919b;_0x21474b=0xc8;}else{_0x21474b=0xce;}_0x511057[_0xb657('0x18')](_0x21474b);return _0x511057['set']('Content-Range',_0x9e98be+'-'+_0x2f0ba0+'/'+_0x20919b)[_0xb657('0x1a')](_0x144eaf);}return null;};}function patchUpdates(_0x926b57){return function(_0xee3c7e){try{jsonpatch['apply'](_0xee3c7e,_0x926b57,!![]);}catch(_0x19f1e9){return BPromise['reject'](_0x19f1e9);}return _0xee3c7e[_0xb657('0x1f')]();};}function saveUpdates(_0x466a42,_0x2895ab){return function(_0x12fd7d){if(_0x12fd7d){return _0x12fd7d[_0xb657('0x20')](_0x466a42)['then'](function(_0x3de4eb){return _0x3de4eb;});}return null;};}function removeEntity(_0x13cea8,_0x38b4a0){return function(_0xfdd680){if(_0xfdd680){return _0xfdd680['destroy']()[_0xb657('0x21')](function(){_0x13cea8['status'](0xcc)[_0xb657('0x19')]();});}};}function handleEntityNotFound(_0x4e8587,_0x221794){return function(_0x4fe1c5){if(!_0x4fe1c5){_0x4e8587[_0xb657('0x22')](0x194);}return _0x4fe1c5;};}function handleError(_0x154f83,_0x5d4b01){_0x5d4b01=_0x5d4b01||0x1f4;return function(_0x241301){logger[_0xb657('0x23')](_0x241301[_0xb657('0x24')]);if(_0x241301['name']){delete _0x241301[_0xb657('0x25')];}_0x154f83[_0xb657('0x18')](_0x5d4b01)[_0xb657('0x26')](_0x241301);};}exports[_0xb657('0x27')]=function(_0x37a5af,_0xba9c05){var _0x66d5af={'raw':!![],'where':{'id':_0x37a5af[_0xb657('0x28')]['id']}},_0x3be5de={};_0x3be5de[_0xb657('0x29')]=_[_0xb657('0x2a')](db[_0xb657('0x2b')][_0xb657('0x2c')]);_0x3be5de[_0xb657('0x2d')]=_[_0xb657('0x2a')](_0x37a5af[_0xb657('0x2d')]);_0x3be5de[_0xb657('0x2e')]=_['intersection'](_0x3be5de[_0xb657('0x29')],_0x3be5de['query']);_0x66d5af[_0xb657('0x2f')]=_[_0xb657('0x30')](_0x3be5de['model'],qs[_0xb657('0x31')](_0x37a5af[_0xb657('0x2d')][_0xb657('0x31')]));_0x66d5af[_0xb657('0x2f')]=_0x66d5af[_0xb657('0x2f')]['length']?_0x66d5af[_0xb657('0x2f')]:_0x3be5de[_0xb657('0x29')];if(_0x37a5af[_0xb657('0x2d')][_0xb657('0x32')]){_0x66d5af[_0xb657('0x33')]=[{'all':!![]}];}_0x66d5af=_['merge']({},_0x66d5af,_0x37a5af[_0xb657('0x34')]);return db[_0xb657('0x2b')][_0xb657('0x35')](_0x66d5af)['then'](handleEntityNotFound(_0xba9c05,null))[_0xb657('0x21')](respondWithResult(_0xba9c05,null))['catch'](handleError(_0xba9c05,null));};exports[_0xb657('0x20')]=function(_0x461f65,_0x14021f){if(_0x461f65[_0xb657('0x36')]['id']){delete _0x461f65[_0xb657('0x36')]['id'];}return db[_0xb657('0x2b')][_0xb657('0x35')]({'where':{'id':_0x461f65[_0xb657('0x28')]['id']}})[_0xb657('0x21')](handleEntityNotFound(_0x14021f,null))[_0xb657('0x21')](saveUpdates(_0x461f65[_0xb657('0x36')],null))['then'](respondWithResult(_0x14021f,null))['catch'](handleError(_0x14021f,null));};exports[_0xb657('0x37')]=function(_0x1878e5,_0x22f93b){return db[_0xb657('0x2b')][_0xb657('0x35')]({'where':{'id':_0x1878e5[_0xb657('0x28')]['id']}})['then'](handleEntityNotFound(_0x22f93b,null))[_0xb657('0x21')](removeEntity(_0x22f93b,null))['catch'](handleError(_0x22f93b,null));}; \ No newline at end of file +var _0x18e0=['moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','include','merge','options','find','catch','body','rimraf','fast-json-patch','request-promise'];(function(_0x59d9c3,_0x1cb588){var _0x152d4c=function(_0x24d68e){while(--_0x24d68e){_0x59d9c3['push'](_0x59d9c3['shift']());}};_0x152d4c(++_0x1cb588);}(_0x18e0,0xa2));var _0x018e=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x18e0[_0x56916d];return _0x2b7f1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x018e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x018e('0x1'));var rp=require(_0x018e('0x2'));var moment=require(_0x018e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x018e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x018e('0x5'));var csv=require(_0x018e('0x6'));var ejs=require(_0x018e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x018e('0x8'));var crypto=require(_0x018e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x018e('0xa'));var toCsv=require(_0x018e('0x6'));var querystring=require(_0x018e('0xb'));var Papa=require(_0x018e('0xc'));var Redis=require(_0x018e('0xd'));var authService=require(_0x018e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x018e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x018e('0x10'));var config=require(_0x018e('0x11'));var licenseUtil=require(_0x018e('0x12'));var db=require(_0x018e('0x13'))['db'];function respondWithStatusCode(_0x167572,_0xd16776){_0xd16776=_0xd16776||0xcc;return function(_0xc940bb){if(_0xc940bb){return _0x167572[_0x018e('0x14')](_0xd16776);}return _0x167572[_0x018e('0x15')](_0xd16776)['end']();};}function respondWithResult(_0xec531a,_0x3b1e5e){_0x3b1e5e=_0x3b1e5e||0xc8;return function(_0x2d6aa0){if(_0x2d6aa0){return _0xec531a[_0x018e('0x15')](_0x3b1e5e)[_0x018e('0x16')](_0x2d6aa0);}};}function respondWithFilteredResult(_0x5bfd6e,_0x275c21){return function(_0x142f1e){if(_0x142f1e){var _0x41cbd8=typeof _0x275c21[_0x018e('0x17')]==='undefined'&&typeof _0x275c21[_0x018e('0x18')]===_0x018e('0x19');var _0x4d46aa=_0x142f1e[_0x018e('0x1a')];var _0x237ba1=_0x41cbd8?0x0:_0x275c21[_0x018e('0x17')];var _0xdf15f8=_0x41cbd8?_0x142f1e[_0x018e('0x1a')]:_0x275c21['offset']+_0x275c21[_0x018e('0x18')];var _0x421942;if(_0xdf15f8>=_0x4d46aa){_0xdf15f8=_0x4d46aa;_0x421942=0xc8;}else{_0x421942=0xce;}_0x5bfd6e[_0x018e('0x15')](_0x421942);return _0x5bfd6e[_0x018e('0x1b')](_0x018e('0x1c'),_0x237ba1+'-'+_0xdf15f8+'/'+_0x4d46aa)[_0x018e('0x16')](_0x142f1e);}return null;};}function patchUpdates(_0x15c3fa){return function(_0x4f59e7){try{jsonpatch[_0x018e('0x1d')](_0x4f59e7,_0x15c3fa,!![]);}catch(_0x213989){return BPromise[_0x018e('0x1e')](_0x213989);}return _0x4f59e7[_0x018e('0x1f')]();};}function saveUpdates(_0x23ef86,_0x5d9fef){return function(_0x5cffe9){if(_0x5cffe9){return _0x5cffe9[_0x018e('0x20')](_0x23ef86)[_0x018e('0x21')](function(_0x2c813e){return _0x2c813e;});}return null;};}function removeEntity(_0x1e3106,_0x2ef801){return function(_0x198b0b){if(_0x198b0b){return _0x198b0b[_0x018e('0x22')]()[_0x018e('0x21')](function(){_0x1e3106[_0x018e('0x15')](0xcc)[_0x018e('0x23')]();});}};}function handleEntityNotFound(_0x35f9a3,_0x7596f4){return function(_0x4e7d9a){if(!_0x4e7d9a){_0x35f9a3[_0x018e('0x14')](0x194);}return _0x4e7d9a;};}function handleError(_0x289931,_0x176822){_0x176822=_0x176822||0x1f4;return function(_0x344e2b){logger[_0x018e('0x24')](_0x344e2b[_0x018e('0x25')]);if(_0x344e2b[_0x018e('0x26')]){delete _0x344e2b[_0x018e('0x26')];}_0x289931[_0x018e('0x15')](_0x176822)[_0x018e('0x27')](_0x344e2b);};}exports['show']=function(_0x29455a,_0x1a4726){var _0x4af339={'raw':!![],'where':{'id':_0x29455a[_0x018e('0x28')]['id']}},_0xac43bc={};_0xac43bc[_0x018e('0x29')]=_[_0x018e('0x2a')](db[_0x018e('0x2b')][_0x018e('0x2c')]);_0xac43bc['query']=_[_0x018e('0x2a')](_0x29455a[_0x018e('0x2d')]);_0xac43bc['filters']=_[_0x018e('0x2e')](_0xac43bc[_0x018e('0x29')],_0xac43bc[_0x018e('0x2d')]);_0x4af339[_0x018e('0x2f')]=_[_0x018e('0x2e')](_0xac43bc['model'],qs[_0x018e('0x30')](_0x29455a[_0x018e('0x2d')][_0x018e('0x30')]));_0x4af339['attributes']=_0x4af339[_0x018e('0x2f')]['length']?_0x4af339[_0x018e('0x2f')]:_0xac43bc[_0x018e('0x29')];if(_0x29455a['query']['includeAll']){_0x4af339[_0x018e('0x31')]=[{'all':!![]}];}_0x4af339=_[_0x018e('0x32')]({},_0x4af339,_0x29455a[_0x018e('0x33')]);return db[_0x018e('0x2b')][_0x018e('0x34')](_0x4af339)['then'](handleEntityNotFound(_0x1a4726,null))[_0x018e('0x21')](respondWithResult(_0x1a4726,null))[_0x018e('0x35')](handleError(_0x1a4726,null));};exports[_0x018e('0x20')]=function(_0x55dbda,_0x5a2741){if(_0x55dbda[_0x018e('0x36')]['id']){delete _0x55dbda[_0x018e('0x36')]['id'];}return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x55dbda[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x5a2741,null))['then'](saveUpdates(_0x55dbda[_0x018e('0x36')],null))[_0x018e('0x21')](respondWithResult(_0x5a2741,null))['catch'](handleError(_0x5a2741,null));};exports['destroy']=function(_0x5c34c9,_0x3b6e6a){return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x5c34c9[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x3b6e6a,null))['then'](removeEntity(_0x3b6e6a,null))[_0x018e('0x35')](handleError(_0x3b6e6a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b652cb7..72d5a35 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 _0x5078=['path','rimraf','./chatApplication.attributes','exports','ChatApplication','chat_applications','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0x5078,0x126));var _0x8507=function(_0x40042d,_0x3ce810){_0x40042d=_0x40042d-0x0;var _0x3889a1=_0x5078[_0x40042d];return _0x3889a1;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var logger=require(_0x8507('0x2'))('api');var moment=require(_0x8507('0x3'));var BPromise=require(_0x8507('0x4'));var rp=require(_0x8507('0x5'));var fs=require('fs');var path=require(_0x8507('0x6'));var rimraf=require(_0x8507('0x7'));var config=require('../../config/environment');var attributes=require(_0x8507('0x8'));module[_0x8507('0x9')]=function(_0x3b2e94,_0x2ba5c4){return _0x3b2e94['define'](_0x8507('0xa'),attributes,{'tableName':_0x8507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f96=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f96,0x75));var _0x65f9=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5f96[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var logger=require(_0x65f9('0x2'))(_0x65f9('0x3'));var moment=require(_0x65f9('0x4'));var BPromise=require(_0x65f9('0x5'));var rp=require(_0x65f9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65f9('0x8'));module[_0x65f9('0x9')]=function(_0x5607f5,_0x41efdb){return _0x5607f5[_0x65f9('0xa')]('ChatApplication',attributes,{'tableName':_0x65f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65f9('0xc'),'collate':_0x65f9('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 3034c33..10b0e63 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 _0x21ee=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x211b69,_0x310c1c){var _0x55b330=function(_0x5bad6c){while(--_0x5bad6c){_0x211b69['push'](_0x211b69['shift']());}};_0x55b330(++_0x310c1c);}(_0x21ee,0xb5));var _0xe21e=function(_0x3a8db5,_0x29cfa6){_0x3a8db5=_0x3a8db5-0x0;var _0x3169d1=_0x21ee[_0x3a8db5];return _0x3169d1;};'use strict';var _=require(_0xe21e('0x0'));var util=require(_0xe21e('0x1'));var moment=require(_0xe21e('0x2'));var BPromise=require(_0xe21e('0x3'));var rs=require(_0xe21e('0x4'));var fs=require('fs');var Redis=require(_0xe21e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe21e('0x6'));var logger=require('../../config/logger')(_0xe21e('0x7'));var config=require(_0xe21e('0x8'));var jayson=require(_0xe21e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x187c08,_0x18dfd4,_0x3fe2e9){return new BPromise(function(_0x4dfb22,_0x581e00){return client['request'](_0x187c08,_0x3fe2e9)[_0xe21e('0xa')](function(_0x4329b6){logger[_0xe21e('0xb')]('ChatApplication,\x20%s,\x20%s',_0x18dfd4,_0xe21e('0xc'));logger[_0xe21e('0xd')](_0xe21e('0xe'),_0x18dfd4,_0xe21e('0xc'),JSON[_0xe21e('0xf')](_0x4329b6));if(_0x4329b6[_0xe21e('0x10')]){if(_0x4329b6[_0xe21e('0x10')][_0xe21e('0x11')]===0x1f4){logger['error'](_0xe21e('0x12'),_0x18dfd4,_0x4329b6['error'][_0xe21e('0x13')]);return _0x581e00(_0x4329b6[_0xe21e('0x10')]['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x18dfd4,_0x4329b6[_0xe21e('0x10')]['message']);return _0x4dfb22(_0x4329b6[_0xe21e('0x10')]['message']);}else{logger['info'](_0xe21e('0x12'),_0x18dfd4,_0xe21e('0xc'));_0x4dfb22(_0x4329b6[_0xe21e('0x14')][_0xe21e('0x13')]);}})[_0xe21e('0x15')](function(_0x17371d){logger[_0xe21e('0x10')](_0xe21e('0x12'),_0x18dfd4,_0x17371d);_0x581e00(_0x17371d);});});} \ No newline at end of file +var _0x69e1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','result','catch'];(function(_0x3ba04b,_0x305c47){var _0x2e2597=function(_0x11e5c3){while(--_0x11e5c3){_0x3ba04b['push'](_0x3ba04b['shift']());}};_0x2e2597(++_0x305c47);}(_0x69e1,0x187));var _0x169e=function(_0x5412b7,_0x25b015){_0x5412b7=_0x5412b7-0x0;var _0x12215f=_0x69e1[_0x5412b7];return _0x12215f;};'use strict';var _=require(_0x169e('0x0'));var util=require(_0x169e('0x1'));var moment=require(_0x169e('0x2'));var BPromise=require(_0x169e('0x3'));var rs=require(_0x169e('0x4'));var fs=require('fs');var Redis=require(_0x169e('0x5'));var db=require(_0x169e('0x6'))['db'];var utils=require(_0x169e('0x7'));var logger=require(_0x169e('0x8'))(_0x169e('0x9'));var config=require(_0x169e('0xa'));var jayson=require(_0x169e('0xb'));var client=jayson[_0x169e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27f353,_0x202784,_0x3a8c47){return new BPromise(function(_0x43f5f1,_0x4e30c1){return client['request'](_0x27f353,_0x3a8c47)['then'](function(_0x1911bf){logger['info']('ChatApplication,\x20%s,\x20%s',_0x202784,_0x169e('0xd'));logger[_0x169e('0xe')](_0x169e('0xf'),_0x202784,_0x169e('0xd'),JSON[_0x169e('0x10')](_0x1911bf));if(_0x1911bf[_0x169e('0x11')]){if(_0x1911bf[_0x169e('0x11')]['code']===0x1f4){logger[_0x169e('0x11')](_0x169e('0x12'),_0x202784,_0x1911bf['error'][_0x169e('0x13')]);return _0x4e30c1(_0x1911bf[_0x169e('0x11')]['message']);}logger[_0x169e('0x11')]('ChatApplication,\x20%s,\x20%s',_0x202784,_0x1911bf[_0x169e('0x11')][_0x169e('0x13')]);return _0x43f5f1(_0x1911bf[_0x169e('0x11')][_0x169e('0x13')]);}else{logger[_0x169e('0x14')](_0x169e('0x12'),_0x202784,'request\x20sent');_0x43f5f1(_0x1911bf[_0x169e('0x15')][_0x169e('0x13')]);}})[_0x169e('0x16')](function(_0x2a4331){logger['error']('ChatApplication,\x20%s,\x20%s',_0x202784,_0x2a4331);_0x4e30c1(_0x2a4331);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2c1f4d5..398814a 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 _0xaf1f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','express','Router'];(function(_0x39377d,_0x12bd88){var _0x1d589f=function(_0x1b3c4d){while(--_0x1b3c4d){_0x39377d['push'](_0x39377d['shift']());}};_0x1d589f(++_0x12bd88);}(_0xaf1f,0x161));var _0xfaf1=function(_0x33ffb9,_0x57cfa7){_0x33ffb9=_0x33ffb9-0x0;var _0x39a3d8=_0xaf1f[_0x33ffb9];return _0x39a3d8;};'use strict';var multer=require(_0xfaf1('0x0'));var util=require('util');var path=require(_0xfaf1('0x1'));var timeout=require('connect-timeout');var express=require(_0xfaf1('0x2'));var router=express[_0xfaf1('0x3')]();var fs_extra=require(_0xfaf1('0x4'));var auth=require(_0xfaf1('0x5'));var interaction=require(_0xfaf1('0x6'));var config=require(_0xfaf1('0x7'));var controller=require(_0xfaf1('0x8'));router[_0xfaf1('0x9')](_0xfaf1('0xa'),auth[_0xfaf1('0xb')](),controller[_0xfaf1('0xc')]);router[_0xfaf1('0xd')](_0xfaf1('0xa'),auth['isAuthenticated'](),controller[_0xfaf1('0xe')]);router[_0xfaf1('0xf')](_0xfaf1('0xa'),auth[_0xfaf1('0xb')](),controller[_0xfaf1('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd5e5=['/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xd5e5,0x117));var _0x5d5e=function(_0x1df4a9,_0x52a221){_0x1df4a9=_0x1df4a9-0x0;var _0x77192d=_0xd5e5[_0x1df4a9];return _0x77192d;};'use strict';var multer=require(_0x5d5e('0x0'));var util=require('util');var path=require(_0x5d5e('0x1'));var timeout=require(_0x5d5e('0x2'));var express=require('express');var router=express[_0x5d5e('0x3')]();var fs_extra=require(_0x5d5e('0x4'));var auth=require(_0x5d5e('0x5'));var interaction=require(_0x5d5e('0x6'));var config=require(_0x5d5e('0x7'));var controller=require(_0x5d5e('0x8'));router['get'](_0x5d5e('0x9'),auth[_0x5d5e('0xa')](),controller[_0x5d5e('0xb')]);router[_0x5d5e('0xc')](_0x5d5e('0x9'),auth[_0x5d5e('0xa')](),controller[_0x5d5e('0xd')]);router[_0x5d5e('0xe')]('/:id',auth[_0x5d5e('0xa')](),controller[_0x5d5e('0xf')]);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 87f8b3b..6292fea 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 _0x51a8=['sequelize','STRING','BOOLEAN'];(function(_0x13a209,_0x25d901){var _0x367942=function(_0x470830){while(--_0x470830){_0x13a209['push'](_0x13a209['shift']());}};_0x367942(++_0x25d901);}(_0x51a8,0x186));var _0x851a=function(_0x9e9e24,_0x43f9e3){_0x9e9e24=_0x9e9e24-0x0;var _0x4b22ba=_0x51a8[_0x9e9e24];return _0x4b22ba;};'use strict';var Sequelize=require(_0x851a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x851a('0x1')]},'write':{'type':Sequelize[_0x851a('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6636=['BOOLEAN','sequelize','exports','STRING'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x6636,0x119));var _0x6663=function(_0x48716,_0x2aa61f){_0x48716=_0x48716-0x0;var _0x827e30=_0x6636[_0x48716];return _0x827e30;};'use strict';var Sequelize=require(_0x6663('0x0'));module[_0x6663('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6663('0x2')]},'write':{'type':Sequelize[_0x6663('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 ce6518a..86b4ce1 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 _0x6228=['catch','show','params','rawAttributes','keys','length','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6228,0x147));var _0x8622=function(_0x3a1535,_0x4d0d5a){_0x3a1535=_0x3a1535-0x0;var _0x3fa8f1=_0x6228[_0x3a1535];return _0x3fa8f1;};'use strict';var emlformat=require(_0x8622('0x0'));var rimraf=require(_0x8622('0x1'));var zipdir=require(_0x8622('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8622('0x3'));var moment=require(_0x8622('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8622('0x5'));var util=require(_0x8622('0x6'));var path=require(_0x8622('0x7'));var sox=require(_0x8622('0x8'));var csv=require(_0x8622('0x9'));var ejs=require(_0x8622('0xa'));var fs=require('fs');var fs_extra=require(_0x8622('0xb'));var _=require(_0x8622('0xc'));var squel=require(_0x8622('0xd'));var crypto=require(_0x8622('0xe'));var jsforce=require(_0x8622('0xf'));var deskjs=require(_0x8622('0x10'));var toCsv=require(_0x8622('0x9'));var querystring=require(_0x8622('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8622('0x12'));var qs=require(_0x8622('0x13'));var as=require(_0x8622('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8622('0x15'))(_0x8622('0x16'));var utils=require(_0x8622('0x17'));var config=require(_0x8622('0x18'));var licenseUtil=require(_0x8622('0x19'));var db=require('../../mysqldb')['db'];config[_0x8622('0x1a')]=_[_0x8622('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8622('0x1c'))(new Redis(config[_0x8622('0x1a')]));require(_0x8622('0x1d'))['register'](socket);function respondWithStatusCode(_0x449881,_0x93232e){_0x93232e=_0x93232e||0xcc;return function(_0x8a8434){if(_0x8a8434){return _0x449881[_0x8622('0x1e')](_0x93232e);}return _0x449881[_0x8622('0x1f')](_0x93232e)[_0x8622('0x20')]();};}function respondWithResult(_0x400ab7,_0x114eef){_0x114eef=_0x114eef||0xc8;return function(_0x17540e){if(_0x17540e){return _0x400ab7[_0x8622('0x1f')](_0x114eef)[_0x8622('0x21')](_0x17540e);}};}function respondWithFilteredResult(_0x585fbc,_0x449588){return function(_0x34028a){if(_0x34028a){var _0x5e2fc5=typeof _0x449588['offset']===_0x8622('0x22')&&typeof _0x449588[_0x8622('0x23')]==='undefined';var _0x4de237=_0x34028a[_0x8622('0x24')];var _0x16856d=_0x5e2fc5?0x0:_0x449588['offset'];var _0x37855e=_0x5e2fc5?_0x34028a[_0x8622('0x24')]:_0x449588[_0x8622('0x25')]+_0x449588[_0x8622('0x23')];var _0xc74f97;if(_0x37855e>=_0x4de237){_0x37855e=_0x4de237;_0xc74f97=0xc8;}else{_0xc74f97=0xce;}_0x585fbc[_0x8622('0x1f')](_0xc74f97);return _0x585fbc[_0x8622('0x26')](_0x8622('0x27'),_0x16856d+'-'+_0x37855e+'/'+_0x4de237)['json'](_0x34028a);}return null;};}function patchUpdates(_0x2ef05b){return function(_0x397038){try{jsonpatch[_0x8622('0x28')](_0x397038,_0x2ef05b,!![]);}catch(_0x420514){return BPromise[_0x8622('0x29')](_0x420514);}return _0x397038['save']();};}function saveUpdates(_0x418a10,_0x3fe258){return function(_0xf76ecd){if(_0xf76ecd){return _0xf76ecd[_0x8622('0x2a')](_0x418a10)[_0x8622('0x2b')](function(_0x1fe2c0){return _0x1fe2c0;});}return null;};}function removeEntity(_0x2887de,_0x292be7){return function(_0x3d7f3b){if(_0x3d7f3b){return _0x3d7f3b[_0x8622('0x2c')]()['then'](function(){_0x2887de[_0x8622('0x1f')](0xcc)[_0x8622('0x20')]();});}};}function handleEntityNotFound(_0x91608c,_0x2b6521){return function(_0x22c72d){if(!_0x22c72d){_0x91608c[_0x8622('0x1e')](0x194);}return _0x22c72d;};}function handleError(_0x512ad5,_0x174e73){_0x174e73=_0x174e73||0x1f4;return function(_0x30fbc3){logger[_0x8622('0x2d')](_0x30fbc3[_0x8622('0x2e')]);if(_0x30fbc3[_0x8622('0x2f')]){delete _0x30fbc3[_0x8622('0x2f')];}_0x512ad5[_0x8622('0x1f')](_0x174e73)[_0x8622('0x30')](_0x30fbc3);};}exports[_0x8622('0x31')]=function(_0xba2dd3,_0xe32bf){var _0x1d2c95={},_0x214972={},_0x3555e4={'count':0x0,'rows':[]};var _0x4e2dc6=_[_0x8622('0x32')](db[_0x8622('0x33')]['rawAttributes'],function(_0x1303c9){return{'name':_0x1303c9[_0x8622('0x34')],'type':_0x1303c9[_0x8622('0x35')][_0x8622('0x36')]};});_0x214972[_0x8622('0x37')]=_[_0x8622('0x32')](_0x4e2dc6,'name');_0x214972['query']=_['keys'](_0xba2dd3[_0x8622('0x38')]);_0x214972['filters']=_[_0x8622('0x39')](_0x214972[_0x8622('0x37')],_0x214972[_0x8622('0x38')]);_0x1d2c95[_0x8622('0x3a')]=_[_0x8622('0x39')](_0x214972[_0x8622('0x37')],qs['fields'](_0xba2dd3[_0x8622('0x38')][_0x8622('0x3b')]));_0x1d2c95[_0x8622('0x3a')]=_0x1d2c95[_0x8622('0x3a')]['length']?_0x1d2c95[_0x8622('0x3a')]:_0x214972[_0x8622('0x37')];if(!_0xba2dd3[_0x8622('0x38')][_0x8622('0x3c')](_0x8622('0x3d'))){_0x1d2c95[_0x8622('0x23')]=qs[_0x8622('0x23')](_0xba2dd3['query'][_0x8622('0x23')]);_0x1d2c95[_0x8622('0x25')]=qs[_0x8622('0x25')](_0xba2dd3[_0x8622('0x38')][_0x8622('0x25')]);}_0x1d2c95[_0x8622('0x3e')]=qs['sort'](_0xba2dd3[_0x8622('0x38')][_0x8622('0x3f')]);_0x1d2c95[_0x8622('0x40')]=qs[_0x8622('0x41')](_[_0x8622('0x42')](_0xba2dd3['query'],_0x214972['filters']),_0x4e2dc6);if(_0xba2dd3[_0x8622('0x38')][_0x8622('0x43')]){_0x1d2c95[_0x8622('0x40')]=_[_0x8622('0x44')](_0x1d2c95[_0x8622('0x40')],{'$or':_['map'](_0x4e2dc6,function(_0x1e0e01){if(_0x1e0e01[_0x8622('0x35')]!==_0x8622('0x45')){var _0x15b764={};_0x15b764[_0x1e0e01['name']]={'$like':'%'+_0xba2dd3[_0x8622('0x38')][_0x8622('0x43')]+'%'};return _0x15b764;}})});}_0x1d2c95=_[_0x8622('0x44')]({},_0x1d2c95,_0xba2dd3[_0x8622('0x46')]);var _0x808108={'where':_0x1d2c95['where']};return db[_0x8622('0x33')][_0x8622('0x24')](_0x808108)['then'](function(_0x4f145c){_0x3555e4[_0x8622('0x24')]=_0x4f145c;if(_0xba2dd3[_0x8622('0x38')]['includeAll']){_0x1d2c95['include']=[{'all':!![]}];}return db[_0x8622('0x33')][_0x8622('0x47')](_0x1d2c95);})[_0x8622('0x2b')](function(_0x4e8fae){_0x3555e4[_0x8622('0x48')]=_0x4e8fae;return _0x3555e4;})[_0x8622('0x2b')](respondWithFilteredResult(_0xe32bf,_0x1d2c95))[_0x8622('0x49')](handleError(_0xe32bf,null));};exports[_0x8622('0x4a')]=function(_0x2f3a13,_0x1b833b){var _0x180666={'raw':!![],'where':{'id':_0x2f3a13[_0x8622('0x4b')]['id']}},_0x3e13a0={};_0x3e13a0[_0x8622('0x37')]=_['keys'](db[_0x8622('0x33')][_0x8622('0x4c')]);_0x3e13a0[_0x8622('0x38')]=_[_0x8622('0x4d')](_0x2f3a13[_0x8622('0x38')]);_0x3e13a0[_0x8622('0x41')]=_[_0x8622('0x39')](_0x3e13a0[_0x8622('0x37')],_0x3e13a0[_0x8622('0x38')]);_0x180666[_0x8622('0x3a')]=_[_0x8622('0x39')](_0x3e13a0[_0x8622('0x37')],qs[_0x8622('0x3b')](_0x2f3a13[_0x8622('0x38')][_0x8622('0x3b')]));_0x180666[_0x8622('0x3a')]=_0x180666['attributes'][_0x8622('0x4e')]?_0x180666[_0x8622('0x3a')]:_0x3e13a0[_0x8622('0x37')];if(_0x2f3a13[_0x8622('0x38')][_0x8622('0x4f')]){_0x180666[_0x8622('0x50')]=[{'all':!![]}];}_0x180666=_[_0x8622('0x44')]({},_0x180666,_0x2f3a13[_0x8622('0x46')]);return db[_0x8622('0x33')][_0x8622('0x51')](_0x180666)[_0x8622('0x2b')](handleEntityNotFound(_0x1b833b,null))['then'](respondWithResult(_0x1b833b,null))[_0x8622('0x49')](handleError(_0x1b833b,null));};exports[_0x8622('0x52')]=function(_0xb61ab0,_0x28c0db){return db['ChatGroup'][_0x8622('0x52')](_0xb61ab0[_0x8622('0x53')],{})[_0x8622('0x2b')](respondWithResult(_0x28c0db,0xc9))['catch'](handleError(_0x28c0db,null));};exports[_0x8622('0x2a')]=function(_0x51d5f5,_0x3419ca){if(_0x51d5f5['body']['id']){delete _0x51d5f5[_0x8622('0x53')]['id'];}return db[_0x8622('0x33')][_0x8622('0x51')]({'where':{'id':_0x51d5f5[_0x8622('0x4b')]['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x3419ca,null))['then'](saveUpdates(_0x51d5f5['body'],null))[_0x8622('0x2b')](respondWithResult(_0x3419ca,null))[_0x8622('0x49')](handleError(_0x3419ca,null));};exports[_0x8622('0x2c')]=function(_0x5ec7f2,_0x4d5c16){return db[_0x8622('0x33')][_0x8622('0x51')]({'where':{'id':_0x5ec7f2[_0x8622('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4d5c16,null))['then'](removeEntity(_0x4d5c16,null))[_0x8622('0x49')](handleError(_0x4d5c16,null));};exports[_0x8622('0x54')]=function(_0x2688ae,_0x8f1d2){return db['ChatGroup'][_0x8622('0x54')]()['then'](respondWithResult(_0x8f1d2,null))[_0x8622('0x49')](handleError(_0x8f1d2,null));};exports[_0x8622('0x55')]=function(_0x48eeed,_0x4f491e,_0x24bd21){return db[_0x8622('0x56')][_0x8622('0x24')]({'where':{'ChatGroupId':_0x48eeed[_0x8622('0x4b')]['id'],'ToId':_0x48eeed[_0x8622('0x57')]['id'],'read':![]}})[_0x8622('0x2b')](function(_0x18b362){return{'id':_['toInteger'](_0x48eeed['params']['id']),'count':_0x18b362};})[_0x8622('0x2b')](respondWithResult(_0x4f491e,null))[_0x8622('0x49')](handleError(_0x4f491e,null));};exports[_0x8622('0x58')]=function(_0x1f39fa,_0x38b719,_0x47b31a){return db[_0x8622('0x33')][_0x8622('0x51')]({'where':{'id':_0x1f39fa[_0x8622('0x4b')]['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x38b719,null))[_0x8622('0x2b')](function(_0x504a4c){if(_0x504a4c){return _0x504a4c['addMembers'](_0x1f39fa[_0x8622('0x53')][_0x8622('0x59')],_[_0x8622('0x5a')](_0x1f39fa[_0x8622('0x53')],[_0x8622('0x59'),'id'])||{});}})['then'](respondWithResult(_0x38b719,null))[_0x8622('0x49')](handleError(_0x38b719,null));};exports[_0x8622('0x5b')]=function(_0x11d0e4,_0x3b3544,_0x1290e4){var _0x5d0516={};var _0x508ae4={};var _0x1ca6c4;var _0x5c5b81;return db[_0x8622('0x33')][_0x8622('0x5c')]({'where':{'id':_0x11d0e4[_0x8622('0x4b')]['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x3b3544,null))['then'](function(_0x7b67bf){if(_0x7b67bf){_0x1ca6c4=_0x7b67bf;_0x508ae4['model']=_['keys'](db[_0x8622('0x5d')][_0x8622('0x4c')]);_0x508ae4[_0x8622('0x38')]=_['keys'](_0x11d0e4[_0x8622('0x38')]);_0x508ae4[_0x8622('0x41')]=_['intersection'](_0x508ae4[_0x8622('0x37')],_0x508ae4[_0x8622('0x38')]);_0x5d0516[_0x8622('0x3a')]=_['intersection'](_0x508ae4[_0x8622('0x37')],qs[_0x8622('0x3b')](_0x11d0e4[_0x8622('0x38')][_0x8622('0x3b')]));_0x5d0516['attributes']=_0x5d0516[_0x8622('0x3a')][_0x8622('0x4e')]?_0x5d0516[_0x8622('0x3a')]:_0x508ae4[_0x8622('0x37')];_0x5d0516[_0x8622('0x3e')]=qs['sort'](_0x11d0e4[_0x8622('0x38')][_0x8622('0x3f')]);_0x5d0516[_0x8622('0x40')]=qs[_0x8622('0x41')](_[_0x8622('0x42')](_0x11d0e4[_0x8622('0x38')],_0x508ae4[_0x8622('0x41')]));if(_0x11d0e4[_0x8622('0x38')][_0x8622('0x43')]){_0x5d0516['where']=_[_0x8622('0x44')](_0x5d0516['where'],{'$or':_['map'](_0x5d0516[_0x8622('0x3a')],function(_0x31a44d){var _0x239ae1={};_0x239ae1[_0x31a44d]={'$like':'%'+_0x11d0e4[_0x8622('0x38')]['filter']+'%'};return _0x239ae1;})});}_0x5d0516=_[_0x8622('0x44')]({},_0x5d0516,_0x11d0e4[_0x8622('0x46')]);return _0x1ca6c4[_0x8622('0x5b')](_0x5d0516);}})[_0x8622('0x2b')](function(_0x2b2dac){if(_0x2b2dac){_0x5c5b81=_0x2b2dac[_0x8622('0x4e')];if(!_0x11d0e4[_0x8622('0x38')][_0x8622('0x3c')](_0x8622('0x3d'))){_0x5d0516[_0x8622('0x23')]=qs[_0x8622('0x23')](_0x11d0e4['query']['limit']);_0x5d0516[_0x8622('0x25')]=qs[_0x8622('0x25')](_0x11d0e4['query'][_0x8622('0x25')]);}return _0x1ca6c4[_0x8622('0x5b')](_0x5d0516);}})[_0x8622('0x2b')](function(_0x48fd34){if(_0x48fd34){return _0x48fd34?{'count':_0x5c5b81,'rows':_0x48fd34}:null;}})[_0x8622('0x2b')](respondWithResult(_0x3b3544,null))[_0x8622('0x49')](handleError(_0x3b3544,null));};exports['removeMembers']=function(_0x24cb18,_0x3f065d,_0x2558c5){return db[_0x8622('0x33')][_0x8622('0x51')]({'where':{'id':_0x24cb18[_0x8622('0x4b')]['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x3f065d,null))[_0x8622('0x2b')](function(_0x2d1da0){if(_0x2d1da0){return _0x2d1da0['removeMembers'](_0x24cb18[_0x8622('0x38')]['ids']);}})[_0x8622('0x2b')](respondWithStatusCode(_0x3f065d,null))[_0x8622('0x49')](handleError(_0x3f065d,null));};exports['addMessage']=function(_0x4f9172,_0x4ea215,_0x13ef19){if(_0x4f9172[_0x8622('0x53')]['id']){delete _0x4f9172['body']['id'];}return db[_0x8622('0x33')][_0x8622('0x51')]({'where':{'id':_0x4f9172['params']['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x4ea215,null))[_0x8622('0x2b')](function(_0x1d514b){if(_0x1d514b){_0x4f9172[_0x8622('0x53')][_0x8622('0x5e')]=_0x1d514b['id'];return db[_0x8622('0x56')][_0x8622('0x52')](_0x4f9172['body']);}})['then'](respondWithResult(_0x4ea215,null))['catch'](handleError(_0x4ea215,null));};exports['getMessages']=function(_0xfbbcda,_0x505d43,_0x50ba11){var _0x195996={};var _0x21c7fb={};var _0x42014f;var _0xa95130;return db[_0x8622('0x33')][_0x8622('0x5c')]({'where':{'id':_0xfbbcda[_0x8622('0x4b')]['id']}})[_0x8622('0x2b')](handleEntityNotFound(_0x505d43,null))[_0x8622('0x2b')](function(_0x4d4f15){if(_0x4d4f15){_0x42014f=_0x4d4f15;_0x21c7fb[_0x8622('0x37')]=_[_0x8622('0x4d')](db[_0x8622('0x56')]['rawAttributes']);_0x21c7fb[_0x8622('0x38')]=_[_0x8622('0x4d')](_0xfbbcda[_0x8622('0x38')]);_0x21c7fb['filters']=_['intersection'](_0x21c7fb[_0x8622('0x37')],_0x21c7fb[_0x8622('0x38')]);_0x195996[_0x8622('0x3a')]=_['intersection'](_0x21c7fb[_0x8622('0x37')],qs[_0x8622('0x3b')](_0xfbbcda['query'][_0x8622('0x3b')]));_0x195996[_0x8622('0x3a')]=_0x195996[_0x8622('0x3a')]['length']?_0x195996[_0x8622('0x3a')]:_0x21c7fb[_0x8622('0x37')];_0x195996[_0x8622('0x3e')]=qs['sort'](_0xfbbcda[_0x8622('0x38')]['sort']);_0x195996[_0x8622('0x40')]=qs['filters'](_[_0x8622('0x42')](_0xfbbcda['query'],_0x21c7fb[_0x8622('0x41')]));if(_0xfbbcda['query'][_0x8622('0x43')]){_0x195996['where']=_[_0x8622('0x44')](_0x195996[_0x8622('0x40')],{'$or':_['map'](_0x195996[_0x8622('0x3a')],function(_0xc65ce9){var _0x5f3cca={};_0x5f3cca[_0xc65ce9]={'$like':'%'+_0xfbbcda[_0x8622('0x38')][_0x8622('0x43')]+'%'};return _0x5f3cca;})});}if(_0xfbbcda[_0x8622('0x38')][_0x8622('0x5f')]){var _0x4772a3=_0xfbbcda['query'][_0x8622('0x5f')][_0x8622('0x60')](',');var _0x2ae055={};_0x2ae055[_0x4772a3[0x0]]={'$gte':moment(_0x4772a3[0x1])[_0x8622('0x61')](_0x8622('0x62'))};_0x195996[_0x8622('0x40')]=_[_0x8622('0x44')](_0x195996[_0x8622('0x40')],_0x2ae055);}_0x195996=_[_0x8622('0x44')]({},_0x195996,_0xfbbcda['options']);return _0x42014f[_0x8622('0x63')](_0x195996);}})['then'](function(_0x39eac9){if(_0x39eac9){_0xa95130=_0x39eac9[_0x8622('0x4e')];if(!_0xfbbcda[_0x8622('0x38')][_0x8622('0x3c')](_0x8622('0x3d'))){_0x195996[_0x8622('0x23')]=qs[_0x8622('0x23')](_0xfbbcda[_0x8622('0x38')][_0x8622('0x23')]);_0x195996[_0x8622('0x25')]=qs[_0x8622('0x25')](_0xfbbcda['query'][_0x8622('0x25')]);}return _0x42014f['getMessages'](_0x195996);}})[_0x8622('0x2b')](function(_0x521be2){if(_0x521be2){return _0x521be2?{'count':_0xa95130,'rows':_0x521be2}:null;}})[_0x8622('0x2b')](respondWithResult(_0x505d43,null))[_0x8622('0x49')](handleError(_0x505d43,null));}; \ No newline at end of file +var _0xc5ad=['Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch','params','find','body','describe','getUnread','toInteger','addMembers','ids','getMembers','findOne','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','create','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x41731e,_0x1bcb53){var _0x1140dd=function(_0x2298d9){while(--_0x2298d9){_0x41731e['push'](_0x41731e['shift']());}};_0x1140dd(++_0x1bcb53);}(_0xc5ad,0x15b));var _0xdc5a=function(_0x372bd7,_0xdf818b){_0x372bd7=_0x372bd7-0x0;var _0x296670=_0xc5ad[_0x372bd7];return _0x296670;};'use strict';var emlformat=require(_0xdc5a('0x0'));var rimraf=require(_0xdc5a('0x1'));var zipdir=require(_0xdc5a('0x2'));var jsonpatch=require(_0xdc5a('0x3'));var rp=require('request-promise');var moment=require(_0xdc5a('0x4'));var BPromise=require(_0xdc5a('0x5'));var Mustache=require(_0xdc5a('0x6'));var util=require(_0xdc5a('0x7'));var path=require(_0xdc5a('0x8'));var sox=require(_0xdc5a('0x9'));var csv=require(_0xdc5a('0xa'));var ejs=require(_0xdc5a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdc5a('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc5a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc5a('0xe'));var Papa=require(_0xdc5a('0xf'));var Redis=require(_0xdc5a('0x10'));var authService=require(_0xdc5a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdc5a('0x12'));var hardwareService=require(_0xdc5a('0x13'));var logger=require(_0xdc5a('0x14'))(_0xdc5a('0x15'));var utils=require('../../config/utils');var config=require(_0xdc5a('0x16'));var licenseUtil=require(_0xdc5a('0x17'));var db=require(_0xdc5a('0x18'))['db'];config[_0xdc5a('0x19')]=_[_0xdc5a('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdc5a('0x1b'))(new Redis(config[_0xdc5a('0x19')]));require(_0xdc5a('0x1c'))[_0xdc5a('0x1d')](socket);function respondWithStatusCode(_0x3ac9b5,_0x4f946e){_0x4f946e=_0x4f946e||0xcc;return function(_0x8b5e09){if(_0x8b5e09){return _0x3ac9b5[_0xdc5a('0x1e')](_0x4f946e);}return _0x3ac9b5[_0xdc5a('0x1f')](_0x4f946e)['end']();};}function respondWithResult(_0x19ecd1,_0x1f8223){_0x1f8223=_0x1f8223||0xc8;return function(_0x368e77){if(_0x368e77){return _0x19ecd1[_0xdc5a('0x1f')](_0x1f8223)['json'](_0x368e77);}};}function respondWithFilteredResult(_0x56308d,_0x1f70ad){return function(_0x5f269b){if(_0x5f269b){var _0x78fe50=typeof _0x1f70ad[_0xdc5a('0x20')]===_0xdc5a('0x21')&&typeof _0x1f70ad[_0xdc5a('0x22')]==='undefined';var _0x4ac4f5=_0x5f269b[_0xdc5a('0x23')];var _0x406098=_0x78fe50?0x0:_0x1f70ad[_0xdc5a('0x20')];var _0x59674=_0x78fe50?_0x5f269b['count']:_0x1f70ad[_0xdc5a('0x20')]+_0x1f70ad[_0xdc5a('0x22')];var _0x22032c;if(_0x59674>=_0x4ac4f5){_0x59674=_0x4ac4f5;_0x22032c=0xc8;}else{_0x22032c=0xce;}_0x56308d['status'](_0x22032c);return _0x56308d[_0xdc5a('0x24')](_0xdc5a('0x25'),_0x406098+'-'+_0x59674+'/'+_0x4ac4f5)['json'](_0x5f269b);}return null;};}function patchUpdates(_0x3677bd){return function(_0x1e578f){try{jsonpatch['apply'](_0x1e578f,_0x3677bd,!![]);}catch(_0x48ed8a){return BPromise[_0xdc5a('0x26')](_0x48ed8a);}return _0x1e578f[_0xdc5a('0x27')]();};}function saveUpdates(_0x56770b,_0x46a88a){return function(_0x30e7bd){if(_0x30e7bd){return _0x30e7bd[_0xdc5a('0x28')](_0x56770b)[_0xdc5a('0x29')](function(_0x1efa88){return _0x1efa88;});}return null;};}function removeEntity(_0x4c1641,_0x3bbadd){return function(_0x1dc4d7){if(_0x1dc4d7){return _0x1dc4d7[_0xdc5a('0x2a')]()[_0xdc5a('0x29')](function(){_0x4c1641['status'](0xcc)[_0xdc5a('0x2b')]();});}};}function handleEntityNotFound(_0x3db36d,_0x410de5){return function(_0x5aa8b8){if(!_0x5aa8b8){_0x3db36d[_0xdc5a('0x1e')](0x194);}return _0x5aa8b8;};}function handleError(_0x3e8c23,_0x1da42b){_0x1da42b=_0x1da42b||0x1f4;return function(_0x24f32d){logger[_0xdc5a('0x2c')](_0x24f32d[_0xdc5a('0x2d')]);if(_0x24f32d[_0xdc5a('0x2e')]){delete _0x24f32d[_0xdc5a('0x2e')];}_0x3e8c23[_0xdc5a('0x1f')](_0x1da42b)[_0xdc5a('0x2f')](_0x24f32d);};}exports['index']=function(_0x4ebc1b,_0x126d2d){var _0x80fa15={},_0x50a16d={},_0x41016c={'count':0x0,'rows':[]};var _0x238a55=_['map'](db['ChatGroup'][_0xdc5a('0x30')],function(_0x181d44){return{'name':_0x181d44['fieldName'],'type':_0x181d44[_0xdc5a('0x31')][_0xdc5a('0x32')]};});_0x50a16d[_0xdc5a('0x33')]=_[_0xdc5a('0x34')](_0x238a55,'name');_0x50a16d[_0xdc5a('0x35')]=_[_0xdc5a('0x36')](_0x4ebc1b[_0xdc5a('0x35')]);_0x50a16d['filters']=_[_0xdc5a('0x37')](_0x50a16d[_0xdc5a('0x33')],_0x50a16d[_0xdc5a('0x35')]);_0x80fa15['attributes']=_['intersection'](_0x50a16d[_0xdc5a('0x33')],qs[_0xdc5a('0x38')](_0x4ebc1b[_0xdc5a('0x35')][_0xdc5a('0x38')]));_0x80fa15['attributes']=_0x80fa15[_0xdc5a('0x39')][_0xdc5a('0x3a')]?_0x80fa15[_0xdc5a('0x39')]:_0x50a16d[_0xdc5a('0x33')];if(!_0x4ebc1b['query'][_0xdc5a('0x3b')](_0xdc5a('0x3c'))){_0x80fa15[_0xdc5a('0x22')]=qs[_0xdc5a('0x22')](_0x4ebc1b[_0xdc5a('0x35')]['limit']);_0x80fa15[_0xdc5a('0x20')]=qs[_0xdc5a('0x20')](_0x4ebc1b[_0xdc5a('0x35')][_0xdc5a('0x20')]);}_0x80fa15[_0xdc5a('0x3d')]=qs[_0xdc5a('0x3e')](_0x4ebc1b[_0xdc5a('0x35')][_0xdc5a('0x3e')]);_0x80fa15[_0xdc5a('0x3f')]=qs[_0xdc5a('0x40')](_[_0xdc5a('0x41')](_0x4ebc1b['query'],_0x50a16d[_0xdc5a('0x40')]),_0x238a55);if(_0x4ebc1b[_0xdc5a('0x35')][_0xdc5a('0x42')]){_0x80fa15[_0xdc5a('0x3f')]=_[_0xdc5a('0x43')](_0x80fa15[_0xdc5a('0x3f')],{'$or':_['map'](_0x238a55,function(_0x43a4c9){if(_0x43a4c9[_0xdc5a('0x31')]!==_0xdc5a('0x44')){var _0x5a802e={};_0x5a802e[_0x43a4c9[_0xdc5a('0x2e')]]={'$like':'%'+_0x4ebc1b[_0xdc5a('0x35')]['filter']+'%'};return _0x5a802e;}})});}_0x80fa15=_[_0xdc5a('0x43')]({},_0x80fa15,_0x4ebc1b[_0xdc5a('0x45')]);var _0x55b1e4={'where':_0x80fa15['where']};return db[_0xdc5a('0x46')]['count'](_0x55b1e4)[_0xdc5a('0x29')](function(_0x59b399){_0x41016c['count']=_0x59b399;if(_0x4ebc1b[_0xdc5a('0x35')][_0xdc5a('0x47')]){_0x80fa15[_0xdc5a('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0xdc5a('0x49')](_0x80fa15);})['then'](function(_0x1b1b3e){_0x41016c[_0xdc5a('0x4a')]=_0x1b1b3e;return _0x41016c;})['then'](respondWithFilteredResult(_0x126d2d,_0x80fa15))[_0xdc5a('0x4b')](handleError(_0x126d2d,null));};exports['show']=function(_0x5d9d08,_0x49ad58){var _0x19cc2a={'raw':!![],'where':{'id':_0x5d9d08[_0xdc5a('0x4c')]['id']}},_0x38e1e3={};_0x38e1e3[_0xdc5a('0x33')]=_[_0xdc5a('0x36')](db[_0xdc5a('0x46')][_0xdc5a('0x30')]);_0x38e1e3[_0xdc5a('0x35')]=_['keys'](_0x5d9d08[_0xdc5a('0x35')]);_0x38e1e3[_0xdc5a('0x40')]=_[_0xdc5a('0x37')](_0x38e1e3['model'],_0x38e1e3['query']);_0x19cc2a[_0xdc5a('0x39')]=_[_0xdc5a('0x37')](_0x38e1e3['model'],qs[_0xdc5a('0x38')](_0x5d9d08[_0xdc5a('0x35')][_0xdc5a('0x38')]));_0x19cc2a['attributes']=_0x19cc2a[_0xdc5a('0x39')][_0xdc5a('0x3a')]?_0x19cc2a['attributes']:_0x38e1e3[_0xdc5a('0x33')];if(_0x5d9d08[_0xdc5a('0x35')][_0xdc5a('0x47')]){_0x19cc2a[_0xdc5a('0x48')]=[{'all':!![]}];}_0x19cc2a=_[_0xdc5a('0x43')]({},_0x19cc2a,_0x5d9d08['options']);return db[_0xdc5a('0x46')][_0xdc5a('0x4d')](_0x19cc2a)[_0xdc5a('0x29')](handleEntityNotFound(_0x49ad58,null))['then'](respondWithResult(_0x49ad58,null))[_0xdc5a('0x4b')](handleError(_0x49ad58,null));};exports['create']=function(_0x549594,_0x9204ea){return db[_0xdc5a('0x46')]['create'](_0x549594[_0xdc5a('0x4e')],{})[_0xdc5a('0x29')](respondWithResult(_0x9204ea,0xc9))[_0xdc5a('0x4b')](handleError(_0x9204ea,null));};exports[_0xdc5a('0x28')]=function(_0x5494b3,_0x573547){if(_0x5494b3[_0xdc5a('0x4e')]['id']){delete _0x5494b3[_0xdc5a('0x4e')]['id'];}return db[_0xdc5a('0x46')][_0xdc5a('0x4d')]({'where':{'id':_0x5494b3[_0xdc5a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x573547,null))[_0xdc5a('0x29')](saveUpdates(_0x5494b3[_0xdc5a('0x4e')],null))[_0xdc5a('0x29')](respondWithResult(_0x573547,null))[_0xdc5a('0x4b')](handleError(_0x573547,null));};exports[_0xdc5a('0x2a')]=function(_0x20d278,_0x5c033d){return db[_0xdc5a('0x46')][_0xdc5a('0x4d')]({'where':{'id':_0x20d278[_0xdc5a('0x4c')]['id']}})[_0xdc5a('0x29')](handleEntityNotFound(_0x5c033d,null))[_0xdc5a('0x29')](removeEntity(_0x5c033d,null))['catch'](handleError(_0x5c033d,null));};exports[_0xdc5a('0x4f')]=function(_0xbf06b1,_0x5b66de){return db[_0xdc5a('0x46')][_0xdc5a('0x4f')]()['then'](respondWithResult(_0x5b66de,null))[_0xdc5a('0x4b')](handleError(_0x5b66de,null));};exports[_0xdc5a('0x50')]=function(_0x1a9664,_0x1f1579,_0x1e00ba){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x1a9664[_0xdc5a('0x4c')]['id'],'ToId':_0x1a9664['user']['id'],'read':![]}})[_0xdc5a('0x29')](function(_0x5ae618){return{'id':_[_0xdc5a('0x51')](_0x1a9664['params']['id']),'count':_0x5ae618};})['then'](respondWithResult(_0x1f1579,null))[_0xdc5a('0x4b')](handleError(_0x1f1579,null));};exports[_0xdc5a('0x52')]=function(_0x2fb19a,_0x141c98,_0x3d3226){return db[_0xdc5a('0x46')][_0xdc5a('0x4d')]({'where':{'id':_0x2fb19a[_0xdc5a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x141c98,null))[_0xdc5a('0x29')](function(_0x649085){if(_0x649085){return _0x649085[_0xdc5a('0x52')](_0x2fb19a[_0xdc5a('0x4e')][_0xdc5a('0x53')],_['omit'](_0x2fb19a[_0xdc5a('0x4e')],[_0xdc5a('0x53'),'id'])||{});}})[_0xdc5a('0x29')](respondWithResult(_0x141c98,null))[_0xdc5a('0x4b')](handleError(_0x141c98,null));};exports[_0xdc5a('0x54')]=function(_0x3974eb,_0x512930,_0xc62f3e){var _0x3c700c={};var _0x37445c={};var _0x324c44;var _0x470a8d;return db[_0xdc5a('0x46')][_0xdc5a('0x55')]({'where':{'id':_0x3974eb[_0xdc5a('0x4c')]['id']}})[_0xdc5a('0x29')](handleEntityNotFound(_0x512930,null))[_0xdc5a('0x29')](function(_0x37da87){if(_0x37da87){_0x324c44=_0x37da87;_0x37445c['model']=_[_0xdc5a('0x36')](db['User'][_0xdc5a('0x30')]);_0x37445c[_0xdc5a('0x35')]=_[_0xdc5a('0x36')](_0x3974eb[_0xdc5a('0x35')]);_0x37445c[_0xdc5a('0x40')]=_['intersection'](_0x37445c['model'],_0x37445c[_0xdc5a('0x35')]);_0x3c700c[_0xdc5a('0x39')]=_[_0xdc5a('0x37')](_0x37445c[_0xdc5a('0x33')],qs[_0xdc5a('0x38')](_0x3974eb[_0xdc5a('0x35')]['fields']));_0x3c700c[_0xdc5a('0x39')]=_0x3c700c[_0xdc5a('0x39')]['length']?_0x3c700c[_0xdc5a('0x39')]:_0x37445c[_0xdc5a('0x33')];_0x3c700c[_0xdc5a('0x3d')]=qs[_0xdc5a('0x3e')](_0x3974eb['query'][_0xdc5a('0x3e')]);_0x3c700c['where']=qs[_0xdc5a('0x40')](_[_0xdc5a('0x41')](_0x3974eb[_0xdc5a('0x35')],_0x37445c[_0xdc5a('0x40')]));if(_0x3974eb[_0xdc5a('0x35')]['filter']){_0x3c700c[_0xdc5a('0x3f')]=_[_0xdc5a('0x43')](_0x3c700c[_0xdc5a('0x3f')],{'$or':_[_0xdc5a('0x34')](_0x3c700c['attributes'],function(_0xc7f225){var _0x1e0f0c={};_0x1e0f0c[_0xc7f225]={'$like':'%'+_0x3974eb[_0xdc5a('0x35')][_0xdc5a('0x42')]+'%'};return _0x1e0f0c;})});}_0x3c700c=_[_0xdc5a('0x43')]({},_0x3c700c,_0x3974eb[_0xdc5a('0x45')]);return _0x324c44['getMembers'](_0x3c700c);}})['then'](function(_0x13a30b){if(_0x13a30b){_0x470a8d=_0x13a30b['length'];if(!_0x3974eb[_0xdc5a('0x35')][_0xdc5a('0x3b')](_0xdc5a('0x3c'))){_0x3c700c[_0xdc5a('0x22')]=qs[_0xdc5a('0x22')](_0x3974eb[_0xdc5a('0x35')]['limit']);_0x3c700c[_0xdc5a('0x20')]=qs['offset'](_0x3974eb[_0xdc5a('0x35')][_0xdc5a('0x20')]);}return _0x324c44[_0xdc5a('0x54')](_0x3c700c);}})[_0xdc5a('0x29')](function(_0x424401){if(_0x424401){return _0x424401?{'count':_0x470a8d,'rows':_0x424401}:null;}})[_0xdc5a('0x29')](respondWithResult(_0x512930,null))[_0xdc5a('0x4b')](handleError(_0x512930,null));};exports['removeMembers']=function(_0x978f88,_0x1703ee,_0x1655c2){return db[_0xdc5a('0x46')][_0xdc5a('0x4d')]({'where':{'id':_0x978f88[_0xdc5a('0x4c')]['id']}})[_0xdc5a('0x29')](handleEntityNotFound(_0x1703ee,null))[_0xdc5a('0x29')](function(_0x23802d){if(_0x23802d){return _0x23802d[_0xdc5a('0x56')](_0x978f88['query'][_0xdc5a('0x53')]);}})['then'](respondWithStatusCode(_0x1703ee,null))[_0xdc5a('0x4b')](handleError(_0x1703ee,null));};exports[_0xdc5a('0x57')]=function(_0x2c2d48,_0x57db90,_0xa12005){if(_0x2c2d48[_0xdc5a('0x4e')]['id']){delete _0x2c2d48[_0xdc5a('0x4e')]['id'];}return db['ChatGroup'][_0xdc5a('0x4d')]({'where':{'id':_0x2c2d48[_0xdc5a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57db90,null))['then'](function(_0x50acbd){if(_0x50acbd){_0x2c2d48[_0xdc5a('0x4e')][_0xdc5a('0x58')]=_0x50acbd['id'];return db[_0xdc5a('0x59')][_0xdc5a('0x5a')](_0x2c2d48[_0xdc5a('0x4e')]);}})[_0xdc5a('0x29')](respondWithResult(_0x57db90,null))['catch'](handleError(_0x57db90,null));};exports[_0xdc5a('0x5b')]=function(_0x34a3b1,_0x2d8faf,_0x2bfa7c){var _0x2aa673={};var _0x43c8b4={};var _0x1043d6;var _0x14b8eb;return db['ChatGroup'][_0xdc5a('0x55')]({'where':{'id':_0x34a3b1[_0xdc5a('0x4c')]['id']}})[_0xdc5a('0x29')](handleEntityNotFound(_0x2d8faf,null))[_0xdc5a('0x29')](function(_0x41b166){if(_0x41b166){_0x1043d6=_0x41b166;_0x43c8b4[_0xdc5a('0x33')]=_[_0xdc5a('0x36')](db[_0xdc5a('0x59')][_0xdc5a('0x30')]);_0x43c8b4['query']=_[_0xdc5a('0x36')](_0x34a3b1[_0xdc5a('0x35')]);_0x43c8b4[_0xdc5a('0x40')]=_[_0xdc5a('0x37')](_0x43c8b4[_0xdc5a('0x33')],_0x43c8b4[_0xdc5a('0x35')]);_0x2aa673[_0xdc5a('0x39')]=_[_0xdc5a('0x37')](_0x43c8b4[_0xdc5a('0x33')],qs[_0xdc5a('0x38')](_0x34a3b1[_0xdc5a('0x35')][_0xdc5a('0x38')]));_0x2aa673[_0xdc5a('0x39')]=_0x2aa673[_0xdc5a('0x39')][_0xdc5a('0x3a')]?_0x2aa673['attributes']:_0x43c8b4['model'];_0x2aa673[_0xdc5a('0x3d')]=qs[_0xdc5a('0x3e')](_0x34a3b1[_0xdc5a('0x35')][_0xdc5a('0x3e')]);_0x2aa673[_0xdc5a('0x3f')]=qs['filters'](_[_0xdc5a('0x41')](_0x34a3b1['query'],_0x43c8b4[_0xdc5a('0x40')]));if(_0x34a3b1[_0xdc5a('0x35')][_0xdc5a('0x42')]){_0x2aa673[_0xdc5a('0x3f')]=_[_0xdc5a('0x43')](_0x2aa673[_0xdc5a('0x3f')],{'$or':_[_0xdc5a('0x34')](_0x2aa673['attributes'],function(_0xfea31e){var _0x438354={};_0x438354[_0xfea31e]={'$like':'%'+_0x34a3b1[_0xdc5a('0x35')][_0xdc5a('0x42')]+'%'};return _0x438354;})});}if(_0x34a3b1['query'][_0xdc5a('0x5c')]){var _0x51e21f=_0x34a3b1[_0xdc5a('0x35')]['$gte'][_0xdc5a('0x5d')](',');var _0x1c6a88={};_0x1c6a88[_0x51e21f[0x0]]={'$gte':moment(_0x51e21f[0x1])[_0xdc5a('0x5e')](_0xdc5a('0x5f'))};_0x2aa673[_0xdc5a('0x3f')]=_['merge'](_0x2aa673['where'],_0x1c6a88);}_0x2aa673=_['merge']({},_0x2aa673,_0x34a3b1[_0xdc5a('0x45')]);return _0x1043d6[_0xdc5a('0x5b')](_0x2aa673);}})[_0xdc5a('0x29')](function(_0x1d6d70){if(_0x1d6d70){_0x14b8eb=_0x1d6d70[_0xdc5a('0x3a')];if(!_0x34a3b1[_0xdc5a('0x35')]['hasOwnProperty'](_0xdc5a('0x3c'))){_0x2aa673[_0xdc5a('0x22')]=qs[_0xdc5a('0x22')](_0x34a3b1['query'][_0xdc5a('0x22')]);_0x2aa673[_0xdc5a('0x20')]=qs[_0xdc5a('0x20')](_0x34a3b1[_0xdc5a('0x35')][_0xdc5a('0x20')]);}return _0x1043d6[_0xdc5a('0x5b')](_0x2aa673);}})[_0xdc5a('0x29')](function(_0x46b2a6){if(_0x46b2a6){return _0x46b2a6?{'count':_0x14b8eb,'rows':_0x46b2a6}:null;}})[_0xdc5a('0x29')](respondWithResult(_0x2d8faf,null))[_0xdc5a('0x4b')](handleError(_0x2d8faf,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index e8214ee..ebfbda9 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 _0x5078=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x46b793,_0x16f01d){var _0x4d471a=function(_0x28f651){while(--_0x28f651){_0x46b793['push'](_0x46b793['shift']());}};_0x4d471a(++_0x16f01d);}(_0x5078,0x148));var _0x8507=function(_0x352061,_0x176667){_0x352061=_0x352061-0x0;var _0x2cae8d=_0x5078[_0x352061];return _0x2cae8d;};'use strict';var EventEmitter=require(_0x8507('0x0'));var ChatGroup=require(_0x8507('0x1'))['db'][_0x8507('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8507('0x3')](0x0);var events={'afterCreate':_0x8507('0x4'),'afterUpdate':_0x8507('0x5'),'afterDestroy':_0x8507('0x6')};function emitEvent(_0x20608d){return function(_0x1a4930,_0x239a82,_0x2aa379){ChatGroupEvents[_0x8507('0x7')](_0x20608d+':'+_0x1a4930['id'],_0x1a4930);ChatGroupEvents[_0x8507('0x7')](_0x20608d,_0x1a4930);_0x2aa379(null);};}for(var e in events){if(events[_0x8507('0x8')](e)){var event=events[e];ChatGroup[_0x8507('0x9')](e,emitEvent(event));}}module[_0x8507('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0xa5c9=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','remove'];(function(_0x530c40,_0x2deb61){var _0x14e864=function(_0x82d44c){while(--_0x82d44c){_0x530c40['push'](_0x530c40['shift']());}};_0x14e864(++_0x2deb61);}(_0xa5c9,0x143));var _0x9a5c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa5c9[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require(_0x9a5c('0x0'));var ChatGroup=require(_0x9a5c('0x1'))['db'][_0x9a5c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9a5c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9a5c('0x4')};function emitEvent(_0x1d80b0){return function(_0x55bcf5,_0x5f1811,_0x54c477){ChatGroupEvents[_0x9a5c('0x5')](_0x1d80b0+':'+_0x55bcf5['id'],_0x55bcf5);ChatGroupEvents[_0x9a5c('0x5')](_0x1d80b0,_0x55bcf5);_0x54c477(null);};}for(var e in events){if(events[_0x9a5c('0x6')](e)){var event=events[e];ChatGroup[_0x9a5c('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e8ae3d3..47acaca 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 _0x6bb3=['request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x12c2ed,_0x40708b){var _0xc2ee5d=function(_0x1e014a){while(--_0x1e014a){_0x12c2ed['push'](_0x12c2ed['shift']());}};_0xc2ee5d(++_0x40708b);}(_0x6bb3,0xbe));var _0x36bb=function(_0x250bfb,_0x183c55){_0x250bfb=_0x250bfb-0x0;var _0x2fa5d0=_0x6bb3[_0x250bfb];return _0x2fa5d0;};'use strict';var _=require(_0x36bb('0x0'));var util=require(_0x36bb('0x1'));var logger=require(_0x36bb('0x2'))(_0x36bb('0x3'));var moment=require(_0x36bb('0x4'));var BPromise=require(_0x36bb('0x5'));var rp=require(_0x36bb('0x6'));var fs=require('fs');var path=require(_0x36bb('0x7'));var rimraf=require(_0x36bb('0x8'));var config=require('../../config/environment');var attributes=require(_0x36bb('0x9'));module[_0x36bb('0xa')]=function(_0x49635c,_0x55167a){return _0x49635c[_0x36bb('0xb')](_0x36bb('0xc'),attributes,{'tableName':_0x36bb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe447=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','lodash'];(function(_0x49ca6b,_0x3ba842){var _0x1d957f=function(_0x12ef94){while(--_0x12ef94){_0x49ca6b['push'](_0x49ca6b['shift']());}};_0x1d957f(++_0x3ba842);}(_0xe447,0x1d5));var _0x7e44=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xe447[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x7e44('0x0'));var util=require('util');var logger=require(_0x7e44('0x1'))(_0x7e44('0x2'));var moment=require(_0x7e44('0x3'));var BPromise=require(_0x7e44('0x4'));var rp=require(_0x7e44('0x5'));var fs=require('fs');var path=require(_0x7e44('0x6'));var rimraf=require(_0x7e44('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e44('0x8'));module['exports']=function(_0x38db02,_0xa5af13){return _0x38db02[_0x7e44('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','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 32ac637..9e685ff 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 _0x6873=['info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x6873,0xac));var _0x3687=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x6873[_0x5e2751];return _0x139a39;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3687('0x0'));var BPromise=require(_0x3687('0x1'));var rs=require(_0x3687('0x2'));var fs=require('fs');var Redis=require(_0x3687('0x3'));var db=require(_0x3687('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3687('0x5'))('rpc');var config=require(_0x3687('0x6'));var jayson=require(_0x3687('0x7'));var client=jayson['client'][_0x3687('0x8')]({'port':0x232a});config[_0x3687('0x9')]=_[_0x3687('0xa')](config[_0x3687('0x9')],{'host':_0x3687('0xb'),'port':0x18eb});var socket=require(_0x3687('0xc'))(new Redis(config[_0x3687('0x9')]));require(_0x3687('0xd'))[_0x3687('0xe')](socket);function respondWithRpcPromise(_0x4feba8,_0x32c490,_0x9d2c00){return new BPromise(function(_0x48e991,_0x3e81c1){return client[_0x3687('0xf')](_0x4feba8,_0x9d2c00)[_0x3687('0x10')](function(_0x3decbe){logger[_0x3687('0x11')]('ChatGroup,\x20%s,\x20%s',_0x32c490,_0x3687('0x12'));logger[_0x3687('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x32c490,_0x3687('0x12'),JSON[_0x3687('0x14')](_0x3decbe));if(_0x3decbe[_0x3687('0x15')]){if(_0x3decbe[_0x3687('0x15')][_0x3687('0x16')]===0x1f4){logger[_0x3687('0x15')](_0x3687('0x17'),_0x32c490,_0x3decbe[_0x3687('0x15')][_0x3687('0x18')]);return _0x3e81c1(_0x3decbe['error'][_0x3687('0x18')]);}logger[_0x3687('0x15')](_0x3687('0x17'),_0x32c490,_0x3decbe['error']['message']);return _0x48e991(_0x3decbe[_0x3687('0x15')][_0x3687('0x18')]);}else{logger[_0x3687('0x11')](_0x3687('0x17'),_0x32c490,_0x3687('0x12'));_0x48e991(_0x3decbe[_0x3687('0x19')]['message']);}})[_0x3687('0x1a')](function(_0x149320){logger[_0x3687('0x15')](_0x3687('0x17'),_0x32c490,_0x149320);_0x3e81c1(_0x149320);});});} \ No newline at end of file +var _0x45d1=['client','http','redis','defaults','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16adf1,_0x1273a5){var _0xc13362=function(_0x35e767){while(--_0x35e767){_0x16adf1['push'](_0x16adf1['shift']());}};_0xc13362(++_0x1273a5);}(_0x45d1,0x1cb));var _0x145d=function(_0x2b3478,_0x58afd7){_0x2b3478=_0x2b3478-0x0;var _0x1c106f=_0x45d1[_0x2b3478];return _0x1c106f;};'use strict';var _=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var moment=require('moment');var BPromise=require(_0x145d('0x2'));var rs=require(_0x145d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x145d('0x5'))(_0x145d('0x6'));var config=require(_0x145d('0x7'));var jayson=require(_0x145d('0x8'));var client=jayson[_0x145d('0x9')][_0x145d('0xa')]({'port':0x232a});config[_0x145d('0xb')]=_[_0x145d('0xc')](config[_0x145d('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x145d('0xd'))[_0x145d('0xe')](socket);function respondWithRpcPromise(_0xf4d6db,_0x583865,_0x94b991){return new BPromise(function(_0x5d2b97,_0x3543c3){return client[_0x145d('0xf')](_0xf4d6db,_0x94b991)[_0x145d('0x10')](function(_0x31dd6f){logger['info'](_0x145d('0x11'),_0x583865,_0x145d('0x12'));logger['debug'](_0x145d('0x13'),_0x583865,_0x145d('0x12'),JSON[_0x145d('0x14')](_0x31dd6f));if(_0x31dd6f[_0x145d('0x15')]){if(_0x31dd6f['error']['code']===0x1f4){logger[_0x145d('0x15')](_0x145d('0x11'),_0x583865,_0x31dd6f[_0x145d('0x15')]['message']);return _0x3543c3(_0x31dd6f[_0x145d('0x15')][_0x145d('0x16')]);}logger[_0x145d('0x15')](_0x145d('0x11'),_0x583865,_0x31dd6f[_0x145d('0x15')]['message']);return _0x5d2b97(_0x31dd6f[_0x145d('0x15')][_0x145d('0x16')]);}else{logger[_0x145d('0x17')]('ChatGroup,\x20%s,\x20%s',_0x583865,_0x145d('0x12'));_0x5d2b97(_0x31dd6f[_0x145d('0x18')][_0x145d('0x16')]);}})[_0x145d('0x19')](function(_0x49d27b){logger[_0x145d('0x15')](_0x145d('0x11'),_0x583865,_0x49d27b);_0x3543c3(_0x49d27b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 161b9c0..a880ad5 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 _0xc550=['./chatGroup.events','save','emit','removeListener','register','chatGroup:'];(function(_0x5ce34a,_0x57887e){var _0x309350=function(_0x52a947){while(--_0x52a947){_0x5ce34a['push'](_0x5ce34a['shift']());}};_0x309350(++_0x57887e);}(_0xc550,0xfc));var _0x0c55=function(_0x3c2666,_0x15fd23){_0x3c2666=_0x3c2666-0x0;var _0x10c814=_0xc550[_0x3c2666];return _0x10c814;};'use strict';var ChatGroupEvents=require(_0x0c55('0x0'));var events=[_0x0c55('0x1'),'remove','update'];function createListener(_0x110367,_0x16cedc){return function(_0x5225b2){_0x16cedc[_0x0c55('0x2')](_0x110367,_0x5225b2);};}function removeListener(_0x3122b9,_0x4d9866){return function(){ChatGroupEvents[_0x0c55('0x3')](_0x3122b9,_0x4d9866);};}exports[_0x0c55('0x4')]=function(_0x18548b){for(var _0x5ecb3c=0x0,_0x3d9a6b=events['length'];_0x5ecb3c<_0x3d9a6b;_0x5ecb3c++){var _0x10c449=events[_0x5ecb3c];var _0x159f0f=createListener(_0x0c55('0x5')+_0x10c449,_0x18548b);ChatGroupEvents['on'](_0x10c449,_0x159f0f);}}; \ No newline at end of file +var _0xfb07=['register','./chatGroup.events','save','emit','removeListener'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xfb07,0xa6));var _0x7fb0=function(_0x13ddaf,_0x2b8572){_0x13ddaf=_0x13ddaf-0x0;var _0x1d75ff=_0xfb07[_0x13ddaf];return _0x1d75ff;};'use strict';var ChatGroupEvents=require(_0x7fb0('0x0'));var events=[_0x7fb0('0x1'),'remove','update'];function createListener(_0x11b555,_0x3eba4e){return function(_0x4d7f29){_0x3eba4e[_0x7fb0('0x2')](_0x11b555,_0x4d7f29);};}function removeListener(_0x5241fe,_0x549223){return function(){ChatGroupEvents[_0x7fb0('0x3')](_0x5241fe,_0x549223);};}exports[_0x7fb0('0x4')]=function(_0x7317ff){for(var _0x317e9a=0x0,_0x101033=events['length'];_0x317e9a<_0x101033;_0x317e9a++){var _0x384417=events[_0x317e9a];var _0x376258=createListener('chatGroup:'+_0x384417,_0x7317ff);ChatGroupEvents['on'](_0x384417,_0x376258);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3c937a3..d81f864 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 _0xe2f1=['/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','update','/:id','destroy','delete','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','show','/:id/unread','getUnread'];(function(_0x208711,_0x344b5d){var _0x2f5c95=function(_0x339454){while(--_0x339454){_0x208711['push'](_0x208711['shift']());}};_0x2f5c95(++_0x344b5d);}(_0xe2f1,0x183));var _0x1e2f=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0xe2f1[_0x5a26f5];return _0x2e9ef7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e2f('0x0'));var timeout=require(_0x1e2f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e2f('0x2'));var auth=require(_0x1e2f('0x3'));var interaction=require(_0x1e2f('0x4'));var config=require(_0x1e2f('0x5'));var controller=require(_0x1e2f('0x6'));router[_0x1e2f('0x7')]('/',auth[_0x1e2f('0x8')](),controller['index']);router['get'](_0x1e2f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1e2f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1e2f('0xa')]);router['get'](_0x1e2f('0xb'),auth[_0x1e2f('0x8')](),controller[_0x1e2f('0xc')]);router[_0x1e2f('0x7')](_0x1e2f('0xd'),auth[_0x1e2f('0x8')](),controller[_0x1e2f('0xe')]);router[_0x1e2f('0x7')](_0x1e2f('0xf'),auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x10')]);router[_0x1e2f('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1e2f('0xd'),auth[_0x1e2f('0x8')](),controller['addMembers']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x1e2f('0x12')]);router[_0x1e2f('0x13')]('/:id',auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x14')]);router['delete'](_0x1e2f('0x15'),auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x16')]);router[_0x1e2f('0x17')](_0x1e2f('0xd'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x1e2f('0x18')]=router; \ No newline at end of file +var _0x1b65=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6aecf2,_0x242a26){var _0x550c47=function(_0x1f3d31){while(--_0x1f3d31){_0x6aecf2['push'](_0x6aecf2['shift']());}};_0x550c47(++_0x242a26);}(_0x1b65,0x165));var _0x51b6=function(_0x471669,_0x1198de){_0x471669=_0x471669-0x0;var _0x3ecc95=_0x1b65[_0x471669];return _0x3ecc95;};'use strict';var multer=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var path=require('path');var timeout=require(_0x51b6('0x2'));var express=require('express');var router=express[_0x51b6('0x3')]();var fs_extra=require(_0x51b6('0x4'));var auth=require(_0x51b6('0x5'));var interaction=require(_0x51b6('0x6'));var config=require(_0x51b6('0x7'));var controller=require('./chatGroup.controller');router[_0x51b6('0x8')]('/',auth[_0x51b6('0x9')](),controller[_0x51b6('0xa')]);router[_0x51b6('0x8')]('/describe',auth[_0x51b6('0x9')](),controller[_0x51b6('0xb')]);router['get'](_0x51b6('0xc'),auth[_0x51b6('0x9')](),controller[_0x51b6('0xd')]);router['get'](_0x51b6('0xe'),auth[_0x51b6('0x9')](),controller[_0x51b6('0xf')]);router[_0x51b6('0x8')](_0x51b6('0x10'),auth[_0x51b6('0x9')](),controller['getMembers']);router[_0x51b6('0x8')](_0x51b6('0x11'),auth[_0x51b6('0x9')](),controller[_0x51b6('0x12')]);router[_0x51b6('0x13')]('/',auth['isAuthenticated'](),controller[_0x51b6('0x14')]);router[_0x51b6('0x13')](_0x51b6('0x10'),auth['isAuthenticated'](),controller['addMembers']);router[_0x51b6('0x13')](_0x51b6('0x11'),auth[_0x51b6('0x9')](),controller[_0x51b6('0x15')]);router['put'](_0x51b6('0xc'),auth[_0x51b6('0x9')](),controller[_0x51b6('0x16')]);router[_0x51b6('0x17')]('/:id',auth[_0x51b6('0x9')](),controller[_0x51b6('0x18')]);router['delete']('/:id/members',auth[_0x51b6('0x9')](),controller[_0x51b6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index c3f200d..4c88647 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 _0x1752=['TEXT','STRING','DATE','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x170ca3,_0x8bd32d){var _0x11c4bf=function(_0x48f647){while(--_0x48f647){_0x170ca3['push'](_0x170ca3['shift']());}};_0x11c4bf(++_0x8bd32d);}(_0x1752,0xa5));var _0x2175=function(_0x577a0d,_0x394368){_0x577a0d=_0x577a0d-0x0;var _0x3ce9ee=_0x1752[_0x577a0d];return _0x3ce9ee;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'closed':{'type':Sequelize[_0x2175('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2175('0x2')]},'ratingType':{'type':Sequelize[_0x2175('0x3')](_0x2175('0x4'),_0x2175('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2175('0x6')]},'pathTranscript':{'type':Sequelize[_0x2175('0x6')]},'mailTranscript':{'type':Sequelize[_0x2175('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2175('0x8')]},'disposition':{'type':Sequelize[_0x2175('0x7')]},'secondDisposition':{'type':Sequelize[_0x2175('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2175('0x7')]},'note':{'type':Sequelize[_0x2175('0x7')]},'browserName':{'type':Sequelize[_0x2175('0x7')]},'browserVersion':{'type':Sequelize[_0x2175('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2175('0x7')]},'deviceModel':{'type':Sequelize[_0x2175('0x7')]},'deviceVendor':{'type':Sequelize[_0x2175('0x7')]},'deviceType':{'type':Sequelize[_0x2175('0x7')]},'referer':{'type':Sequelize[_0x2175('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x2175('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2175('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2175('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x8eba=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','star'];(function(_0x200a6e,_0x2ff002){var _0x41a89b=function(_0xb83f87){while(--_0xb83f87){_0x200a6e['push'](_0x200a6e['shift']());}};_0x41a89b(++_0x2ff002);}(_0x8eba,0xc3));var _0xa8eb=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x8eba[_0x421263];return _0x34e4b5;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xa8eb('0x2'),_0xa8eb('0x3')),'defaultValue':_0xa8eb('0x2')},'ratingMessage':{'type':Sequelize[_0xa8eb('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa8eb('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa8eb('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa8eb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa8eb('0x5')]},'browserName':{'type':Sequelize[_0xa8eb('0x5')]},'browserVersion':{'type':Sequelize[_0xa8eb('0x5')]},'osName':{'type':Sequelize[_0xa8eb('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa8eb('0x5')]},'deviceVendor':{'type':Sequelize[_0xa8eb('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xa8eb('0x4')]},'customerIp':{'type':Sequelize[_0xa8eb('0x5')]},'formData':{'type':Sequelize[_0xa8eb('0x4')](_0xa8eb('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa8eb('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa8eb('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa8eb('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xa8eb('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a24467e..5ba9bb8 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 _0xc744=['ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','ValidationError','closed','AbandonInteraction','attachmentUpload','file','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ContactId','length','format','System','customer','Visitor','agentIdentifier','website_alias','%s%d','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','pick','secret','includeAgent','push','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','read','Account','Owner','get','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','Contact','value','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','stack','name','send','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out'];(function(_0x4fb74e,_0x1a3a82){var _0x33da5d=function(_0x5d4705){while(--_0x5d4705){_0x4fb74e['push'](_0x4fb74e['shift']());}};_0x33da5d(++_0x1a3a82);}(_0xc744,0x6e));var _0x4c74=function(_0x3c8b68,_0x17c252){_0x3c8b68=_0x3c8b68-0x0;var _0x1f4482=_0xc744[_0x3c8b68];return _0x1f4482;};'use strict';var rimraf=require(_0x4c74('0x0'));var zipdir=require(_0x4c74('0x1'));var rp=require('request-promise');var moment=require(_0x4c74('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4c74('0x3'));var util=require(_0x4c74('0x4'));var path=require(_0x4c74('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c74('0x6'));var Redis=require(_0x4c74('0x7'));var interaction=require(_0x4c74('0x8'));var qs=require(_0x4c74('0x9'));var pdf=require(_0x4c74('0xa'));var logger=require('../../config/logger')(_0x4c74('0xb'));var config=require(_0x4c74('0xc'));var db=require(_0x4c74('0xd'))['db'];config[_0x4c74('0xe')]=_[_0x4c74('0xf')](config[_0x4c74('0xe')],{'host':_0x4c74('0x10'),'port':0x18eb});var socket=require(_0x4c74('0x11'))(new Redis(config['redis']));require(_0x4c74('0x12'))[_0x4c74('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4c74('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x4c74('0x14')][_0x4c74('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x89a9c9,_0x5a7376,_0x31fb11,_0x14ab4f){return new BPromise(function(_0x1acd04,_0x345257){var _0x18ac32=_0x14ab4f||client;return _0x18ac32['request'](_0x89a9c9,_0x31fb11)[_0x4c74('0x16')](function(_0x31b9e6){logger['info'](_0x4c74('0x17'),_0x5a7376,'request\x20sent');logger[_0x4c74('0x18')](_0x4c74('0x19'),_0x5a7376,_0x4c74('0x1a'),JSON[_0x4c74('0x1b')](_0x31b9e6));if(_0x31b9e6[_0x4c74('0x1c')]){if(_0x31b9e6[_0x4c74('0x1c')][_0x4c74('0x1d')]===0x1f4){logger['error'](_0x4c74('0x17'),_0x5a7376,_0x31b9e6['error']['message']);return _0x345257(_0x31b9e6['error'][_0x4c74('0x1e')]);}logger[_0x4c74('0x1c')](_0x4c74('0x17'),_0x5a7376,_0x31b9e6[_0x4c74('0x1c')][_0x4c74('0x1e')]);return _0x1acd04(_0x31b9e6[_0x4c74('0x1c')][_0x4c74('0x1e')]);}else{logger[_0x4c74('0x1f')](_0x4c74('0x17'),_0x5a7376,'request\x20sent');_0x1acd04(_0x31b9e6[_0x4c74('0x20')]['message']);}})[_0x4c74('0x21')](function(_0x3dccfb){logger['error'](_0x4c74('0x17'),_0x5a7376,_0x3dccfb);_0x345257(_0x3dccfb);});});}function respondWithStatusCode(_0x2d2ea8,_0x17028f){_0x17028f=_0x17028f||0xcc;return function(_0x230817){if(_0x230817){return _0x2d2ea8[_0x4c74('0x22')](_0x17028f);}return _0x2d2ea8[_0x4c74('0x23')](_0x17028f)['end']();};}function respondWithResult(_0xd250b2,_0x17979d){_0x17979d=_0x17979d||0xc8;return function(_0x35de6b){if(_0x35de6b){return _0xd250b2[_0x4c74('0x23')](_0x17979d)['json'](_0x35de6b);}};}function respondWithFilteredResult(_0x2c204b,_0x2fbef9){return function(_0x3b8f2c){if(_0x3b8f2c){var _0xc222e4=typeof _0x2fbef9[_0x4c74('0x24')]===_0x4c74('0x25')&&typeof _0x2fbef9[_0x4c74('0x26')]===_0x4c74('0x25');var _0xb00019=_0x3b8f2c[_0x4c74('0x27')];var _0x6e1bac=_0xc222e4?0x0:_0x2fbef9[_0x4c74('0x24')];var _0x55a6f0=_0xc222e4?_0x3b8f2c[_0x4c74('0x27')]:_0x2fbef9[_0x4c74('0x24')]+_0x2fbef9[_0x4c74('0x26')];var _0x5efd62;if(_0x55a6f0>=_0xb00019){_0x55a6f0=_0xb00019;_0x5efd62=0xc8;}else{_0x5efd62=0xce;}_0x2c204b['status'](_0x5efd62);return _0x2c204b[_0x4c74('0x28')](_0x4c74('0x29'),_0x6e1bac+'-'+_0x55a6f0+'/'+_0xb00019)[_0x4c74('0x2a')](_0x3b8f2c);}return null;};}function saveUpdates(_0x1f1e43){return function(_0x22ba1c){if(_0x22ba1c){return _0x22ba1c[_0x4c74('0x2b')](_0x1f1e43)[_0x4c74('0x16')](function(_0x134c68){return _0x134c68;});}return null;};}function removeEntity(_0x166fa8){return function(_0xd425f2){if(_0xd425f2){return _0xd425f2[_0x4c74('0x2c')]()['then'](function(){_0x166fa8[_0x4c74('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b9e57){return function(_0x13ce50){if(!_0x13ce50){_0x9b9e57['sendStatus'](0x194);}return _0x13ce50;};}function handleError(_0x2e2029,_0x3f7057){_0x3f7057=_0x3f7057||0x1f4;return function(_0x83d299){logger['error'](_0x83d299[_0x4c74('0x2d')]);if(_0x83d299[_0x4c74('0x2e')]){delete _0x83d299[_0x4c74('0x2e')];}_0x2e2029[_0x4c74('0x23')](_0x3f7057)[_0x4c74('0x2f')](_0x83d299);};}function getMustacheRender(_0x3bbb08,_0xa4d413){return Mustache['render'](_0x3bbb08,_[_0x4c74('0x30')](_0xa4d413[_0x4c74('0x31')],{'contact':_0xa4d413[_0x4c74('0x32')],'message':_0xa4d413['message'],'agent':_0xa4d413['agent'],'interaction':_0xa4d413[_0x4c74('0x33')],'account':_0xa4d413[_0x4c74('0x34')]}))||'';}exports[_0x4c74('0x35')]=function(_0x6e58c1,_0x25890a){var _0x4fb83e={};var _0x1272b1=_[_0x4c74('0x36')](db[_0x4c74('0x37')][_0x4c74('0x38')],function(_0x130a9b){return{'name':_0x130a9b[_0x4c74('0x39')],'type':_0x130a9b[_0x4c74('0x3a')][_0x4c74('0x3b')]};});_0x4fb83e=qs[_0x4c74('0x3c')](_0x1272b1,_0x6e58c1);return interaction[_0x4c74('0x3d')](_0x4c74('0x3e'),_0x6e58c1[_0x4c74('0x3f')],_0x6e58c1['user'],_0x4fb83e,_0x1272b1)[_0x4c74('0x16')](respondWithFilteredResult(_0x25890a,_0x4fb83e))[_0x4c74('0x21')](handleError(_0x25890a,null));};exports['show']=function(_0x542f80,_0x3dfc81){var _0xaec59={'raw':![],'where':{'id':_0x542f80[_0x4c74('0x40')]['id']}},_0x490482={};_0x490482[_0x4c74('0x41')]=_[_0x4c74('0x42')](db[_0x4c74('0x37')][_0x4c74('0x38')]);_0x490482[_0x4c74('0x3f')]=_[_0x4c74('0x42')](_0x542f80[_0x4c74('0x3f')]);_0x490482[_0x4c74('0x43')]=_[_0x4c74('0x44')](_0x490482[_0x4c74('0x41')],_0x490482[_0x4c74('0x3f')]);_0xaec59[_0x4c74('0x45')]=_[_0x4c74('0x44')](_0x490482[_0x4c74('0x41')],qs[_0x4c74('0x46')](_0x542f80[_0x4c74('0x3f')][_0x4c74('0x46')]));_0xaec59[_0x4c74('0x45')]=_0xaec59[_0x4c74('0x45')]['length']?_0xaec59[_0x4c74('0x45')]:_0x490482[_0x4c74('0x41')];if(_0x542f80[_0x4c74('0x3f')][_0x4c74('0x47')]){_0xaec59[_0x4c74('0x48')]=[{'all':!![]}];}_0xaec59=_['merge']({},_0xaec59,_0x542f80[_0x4c74('0x49')]);return db['ChatInteraction']['find'](_0xaec59)[_0x4c74('0x16')](handleEntityNotFound(_0x3dfc81,null))[_0x4c74('0x16')](respondWithResult(_0x3dfc81,null))[_0x4c74('0x21')](handleError(_0x3dfc81,null));};exports[_0x4c74('0x4a')]=function(_0x3d16c3,_0x1db5dc){return db['ChatInteraction'][_0x4c74('0x4a')](_0x3d16c3[_0x4c74('0x31')],{})[_0x4c74('0x16')](respondWithResult(_0x1db5dc,0xc9))['catch'](handleError(_0x1db5dc,null));};exports[_0x4c74('0x2b')]=function(_0x32b11d,_0x224593){if(_0x32b11d['body']['id']){delete _0x32b11d[_0x4c74('0x31')]['id'];}return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0x32b11d[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0x224593,null))[_0x4c74('0x16')](saveUpdates(_0x32b11d['body'],null))['then'](respondWithResult(_0x224593,null))['catch'](handleError(_0x224593,null));};exports['destroy']=function(_0xde8850,_0xed7c5f){return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0xde8850[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0xed7c5f,null))[_0x4c74('0x16')](removeEntity(_0xed7c5f,null))[_0x4c74('0x21')](handleError(_0xed7c5f,null));};exports[_0x4c74('0x4c')]=function(_0x4acb8e,_0x57b2d3){return db[_0x4c74('0x37')][_0x4c74('0x4c')]()[_0x4c74('0x16')](respondWithResult(_0x57b2d3,null))['catch'](handleError(_0x57b2d3,null));};exports[_0x4c74('0x4d')]=function(_0x417651,_0x46cc10){var _0x2dfb43=_0x417651[_0x4c74('0x40')]['id'];var _0x9ef80b;var _0x316b98;var _0x445a65;return db['ChatInteraction'][_0x4c74('0x4e')]({'where':{'id':_0x2dfb43}})['then'](function(_0x2e7a37){_0x9ef80b=_0x2e7a37;return db['ChatWebsite']['findOne']({'where':{'id':_0x2e7a37[_0x4c74('0x4f')]},'attributes':['id',_0x4c74('0x50'),_0x4c74('0x51'),_0x4c74('0x52'),_0x4c74('0x53'),_0x4c74('0x54')],'raw':!![]});})[_0x4c74('0x16')](function(_0x45c0e9){if(_0x45c0e9&&_0x45c0e9[_0x4c74('0x50')]&&_0x45c0e9['vidaooEscalation']){_0x316b98=_0x45c0e9;var _0x319115={'interaction':{'id':_0x2dfb43},'agent':{'id':_0x417651[_0x4c74('0x55')]['id'],'name':_0x417651[_0x4c74('0x55')]['name'],'fullname':_0x417651[_0x4c74('0x55')][_0x4c74('0x56')],'email':_0x417651[_0x4c74('0x55')][_0x4c74('0x57')]},'contact':_0x417651[_0x4c74('0x31')][_0x4c74('0x32')],'account':_0x417651[_0x4c74('0x31')][_0x4c74('0x34')]};var _0x719805={'rejectUnauthorized':![],'method':_0x4c74('0x58'),'url':_0x4c74('0x59'),'headers':{'X-APIKEY':_0x45c0e9[_0x4c74('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x417651['user'][_0x4c74('0x57')]],'buttons':null,'topic':_0x316b98[_0x4c74('0x52')],'note':_[_0x4c74('0x5a')](_0x316b98[_0x4c74('0x53')])?null:getMustacheRender(_0x316b98[_0x4c74('0x53')],_0x319115),'metadata':null},'redirect':_0x4c74('0x5b'),'json':!![]};try{if(!_[_0x4c74('0x5a')](_0x316b98[_0x4c74('0x54')])){var _0x2ad627=getMustacheRender(_0x316b98[_0x4c74('0x54')],_0x319115);var _0x3ec78e=JSON[_0x4c74('0x5c')](_0x2ad627);_0x719805[_0x4c74('0x31')]['metadata']=_0x3ec78e;}}catch(_0x5a7757){throw new db[(_0x4c74('0x5d'))]['ValidationError'](_0x4c74('0x5e'));}return rp(_0x719805);}else{throw new db[(_0x4c74('0x5d'))]['ValidationError'](_0x4c74('0x5f'));}})[_0x4c74('0x16')](function(_0x4e0038){_0x445a65=_0x4e0038;if(_0x445a65['id']){var _0x597b8e={'body':_0x445a65['join_url'],'ChatWebsiteId':_0x316b98['id'],'ChatInteractionId':_0x9ef80b['id'],'direction':_0x4c74('0x60'),'UserId':_0x417651[_0x4c74('0x55')]['id']};return db[_0x4c74('0x61')]['create'](_0x597b8e,{});}else{throw new db[(_0x4c74('0x5d'))]['ValidationError'](_0x4c74('0x62'));}})[_0x4c74('0x16')](function(){return _0x9ef80b[_0x4c74('0x63')]({'vidaooSessionId':_0x445a65['id']});})[_0x4c74('0x16')](respondWithResult(_0x46cc10,null))[_0x4c74('0x21')](handleError(_0x46cc10,null));};exports[_0x4c74('0x64')]=function(_0x59e41d,_0x2ede8f){if(_0x59e41d[_0x4c74('0x31')]['id']){delete _0x59e41d[_0x4c74('0x31')]['id'];}return db[_0x4c74('0x37')]['find']({'where':{'id':_0x59e41d[_0x4c74('0x40')]['id']},'include':[{'model':db[_0x4c74('0x65')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2ede8f,null))[_0x4c74('0x16')](saveUpdates(_0x59e41d['body'],null))[_0x4c74('0x16')](respondWithResult(_0x2ede8f,null))[_0x4c74('0x21')](handleError(_0x2ede8f,null));};exports['abandon']=function(_0x20870b,_0x52c09b){if(_0x20870b['body']['id']){delete _0x20870b[_0x4c74('0x31')]['id'];}return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0x20870b[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](function(_0x1042a6){if(!_0x1042a6){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4c74('0x66'),0x194,_0x4c74('0x67'));_0x52c09b[_0x4c74('0x22')](0x194);}else{if(_0x1042a6[_0x4c74('0x68')]){throw new db[(_0x4c74('0x5d'))][(_0x4c74('0x69'))]('Interaction\x20already\x20assigned');}}return _0x1042a6;})[_0x4c74('0x16')](function(_0x3a2633){if(_0x3a2633){return _0x3a2633[_0x4c74('0x2b')]({'closed':_0x20870b[_0x4c74('0x31')][_0x4c74('0x6a')],'disposition':_0x20870b[_0x4c74('0x31')]['disposition']})[_0x4c74('0x16')](function(_0x3e08fb){return _0x3e08fb;});}})['then'](function(){return respondWithRpcPromise(_0x4c74('0x6b'),_0x4c74('0x66'),_0x20870b['body'],client9004);})[_0x4c74('0x16')](respondWithResult(_0x52c09b,null))[_0x4c74('0x21')](handleError(_0x52c09b,null));};exports[_0x4c74('0x6c')]=function(_0x5ecbc3,_0x53b5de){_0x5ecbc3['body']['name']=_0x5ecbc3[_0x4c74('0x6d')]['originalname'];_0x5ecbc3[_0x4c74('0x31')]['basename']=_0x5ecbc3[_0x4c74('0x6d')][_0x4c74('0x6e')];_0x5ecbc3[_0x4c74('0x31')][_0x4c74('0x3a')]=_0x5ecbc3[_0x4c74('0x6d')]['mimetype'];return db[_0x4c74('0x6f')]['create'](_0x5ecbc3[_0x4c74('0x31')])[_0x4c74('0x16')](respondWithResult(_0x53b5de,0xc9))[_0x4c74('0x21')](handleError(_0x53b5de,null));};exports[_0x4c74('0x70')]=function(_0x19be80,_0x18cded){return db['ChatInteraction']['findOne']({'where':{'id':_0x19be80[_0x4c74('0x40')]['id']},'raw':!![]})[_0x4c74('0x16')](handleEntityNotFound(_0x18cded,null))['then'](function(_0x37e5fd){if(_0x37e5fd){if(_0x37e5fd[_0x4c74('0x6a')]){return _0x18cded[_0x4c74('0x23')](0x193)[_0x4c74('0x2a')]({'status':0x193,'message':'Unauthorized'});}return db[_0x4c74('0x6f')][_0x4c74('0x4e')]({'where':{'id':_0x19be80[_0x4c74('0x3f')][_0x4c74('0x71')]},'raw':!![]})[_0x4c74('0x16')](handleEntityNotFound(_0x18cded,null));}})[_0x4c74('0x16')](function(_0x339b27){if(_0x339b27){var _0x1c6232=_0x339b27[_0x4c74('0x72')]!==null;var _0x37b7b4=path['join'](config['root'],_0x4c74('0x73'));if(_0x1c6232){_0x37b7b4=path[_0x4c74('0x74')](_0x37b7b4,_0x4c74('0x75'));}var _0x5a41a9=path[_0x4c74('0x74')](_0x37b7b4,_0x339b27[_0x4c74('0x76')]);return _0x18cded[_0x4c74('0x77')](_0x5a41a9);}})[_0x4c74('0x21')](handleError(_0x18cded,null));};exports[_0x4c74('0x78')]=function(_0x89e0a6,_0xc1a229){var _0x4b5f18=null;var _0xe67d59=null;var _0xd2d7a3=null;if(_0x89e0a6[_0x4c74('0x31')]['id']){delete _0x89e0a6[_0x4c74('0x31')]['id'];}if(_0x89e0a6['body'][_0x4c74('0x79')]){_0xd2d7a3=path[_0x4c74('0x74')](config[_0x4c74('0x7a')],_0x4c74('0x7b'),util['format'](_0x4c74('0x7c'),Date[_0x4c74('0x7d')]()));_0x89e0a6[_0x4c74('0x31')][_0x4c74('0x7e')]=_0xd2d7a3;}return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0x89e0a6[_0x4c74('0x40')]['id']},'include':[{'model':db[_0x4c74('0x61')],'as':_0x4c74('0x7f'),'include':[{'model':db[_0x4c74('0x80')],'as':'User'}]}]})['then'](handleEntityNotFound(_0xc1a229,null))['then'](saveUpdates(_0x89e0a6[_0x4c74('0x31')],null))[_0x4c74('0x16')](function(_0x586e71){if(_0x586e71){_0x4b5f18=_0x586e71;return db[_0x4c74('0x81')][_0x4c74('0x4b')]({'where':{'id':_0x4b5f18[_0x4c74('0x4f')]}});}})[_0x4c74('0x16')](function(_0x2ecc8){if(_0x2ecc8){_0xe67d59=_0x2ecc8;return db[_0x4c74('0x65')][_0x4c74('0x4b')]({'where':{'id':_0x4b5f18[_0x4c74('0x82')]}});}})[_0x4c74('0x16')](function(_0x545a5e){if(_0x545a5e){if(_0xd2d7a3){var _0xa7f8c1=null;for(var _0x411dd2=0x1;_0x411dd2<_0x4b5f18[_0x4c74('0x7f')][_0x4c74('0x83')];++_0x411dd2){_0xa7f8c1=_0x4b5f18['Messages'][_0x411dd2];var _0x226069=_0xa7f8c1['UserId']?util[_0x4c74('0x84')]('%s%d',_0xe67d59['agentAlias'],_0xa7f8c1[_0x4c74('0x68')]):_0x4c74('0x85');var _0x98f00=_0x89e0a6[_0x4c74('0x31')][_0x4c74('0x86')]||util[_0x4c74('0x84')]('%s%d',_0x4c74('0x87'),_0xa7f8c1[_0x4c74('0x82')]);switch(_0xe67d59[_0x4c74('0x88')]){case _0x4c74('0x89'):_0x226069=_0xa7f8c1['UserId']?util['format'](_0x4c74('0x8a'),_0xe67d59['agentAlias'],_0xa7f8c1[_0x4c74('0x68')]):_0x4c74('0x85');break;case _0x4c74('0x8b'):_0x226069=_0xa7f8c1[_0x4c74('0x68')]?_0xa7f8c1[_0x4c74('0x80')][_0x4c74('0x8c')]||_0xa7f8c1['User'][_0x4c74('0x56')]:_0x4c74('0x85');break;case _0x4c74('0x8d'):_0x226069=_0xa7f8c1[_0x4c74('0x68')]?_0xa7f8c1['User'][_0x4c74('0x56')]:_0x4c74('0x85');break;default:_0x226069=_0xa7f8c1['UserId']?util[_0x4c74('0x84')]('%s%d',_0xe67d59['agentAlias'],_0xa7f8c1[_0x4c74('0x68')]):'System';}var _0x270170=util[_0x4c74('0x84')](_0x4c74('0x8e'),moment(_0xa7f8c1['createdAt'])[_0x4c74('0x84')]('MM/DD/YYYY\x20HH:mm:ss'),_0xa7f8c1[_0x4c74('0x8f')]==='in'?_0x98f00:_0x226069,_0xa7f8c1[_0x4c74('0x31')]);if(!_0xa7f8c1['secret']){fs[_0x4c74('0x90')](_0xd2d7a3,_0x270170);}}return db[_0x4c74('0x91')][_0x4c74('0x4e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4c74('0x92'),'raw':!![],'include':[{'model':db[_0x4c74('0x93')],'as':_0x4c74('0x93'),'raw':!![]}]}]});}}})[_0x4c74('0x16')](function(_0x29e147){if(!_0x29e147||!_0x29e147[_0x4c74('0x92')]||!_0x89e0a6['body'])return _0x4b5f18;var _0x179ab0=_0x29e147[_0x4c74('0x94')]();return respondWithRpcPromise(_0x4c74('0x95'),_0x4c74('0x96'),{'account':_0x179ab0,'message':{'from':util[_0x4c74('0x84')](_0x4c74('0x97'),_0x29e147[_0x4c74('0x2e')],_0x29e147[_0x4c74('0x57')]||_0x29e147[_0x4c74('0x92')]['user']),'to':_0x89e0a6[_0x4c74('0x31')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x4c74('0x84')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x89e0a6[_0x4c74('0x31')][_0x4c74('0x79')]),'attachments':[{'path':_0xd2d7a3}]}})[_0x4c74('0x16')](function(){return _0x4b5f18;})['catch'](function(_0x522904){logger['error'](_0x522904);});})['then'](respondWithStatusCode(_0xc1a229,0xc8))[_0x4c74('0x21')](handleError(_0xc1a229,null));};exports[_0x4c74('0x98')]=function(_0xad299b,_0x5e9836){return db[_0x4c74('0x61')]['find']({'where':{'id':_0xad299b[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0x5e9836,null))['then'](function(_0x139a6f){if(_0x139a6f){return _0x139a6f['addMessage'](_0xad299b[_0x4c74('0x31')][_0x4c74('0x99')],_[_0x4c74('0x9a')](_0xad299b[_0x4c74('0x31')],[_0x4c74('0x99'),'id'])||{});}})[_0x4c74('0x16')](respondWithResult(_0x5e9836,null))[_0x4c74('0x21')](handleError(_0x5e9836,null));};exports[_0x4c74('0x9b')]=function(_0x549974,_0x4417f7){var _0x2336a7={'raw':![],'where':{}};var _0x1d9b69={};var _0x1c35ff={'count':0x0,'rows':[]};return db[_0x4c74('0x37')]['findOne']({'where':{'id':_0x549974[_0x4c74('0x40')]['id']}})['then'](handleEntityNotFound(_0x4417f7,null))['then'](function(_0x51af22){if(_0x51af22){_0x1d9b69['model']=_[_0x4c74('0x42')](db[_0x4c74('0x61')]['rawAttributes']);_0x1d9b69[_0x4c74('0x3f')]=_[_0x4c74('0x42')](_0x549974[_0x4c74('0x3f')]);_0x1d9b69[_0x4c74('0x43')]=_[_0x4c74('0x44')](_0x1d9b69[_0x4c74('0x41')],_0x1d9b69[_0x4c74('0x3f')]);_0x2336a7[_0x4c74('0x45')]=_[_0x4c74('0x44')](_0x1d9b69['model'],qs['fields'](_0x549974[_0x4c74('0x3f')][_0x4c74('0x46')]));_0x2336a7['attributes']=_0x2336a7[_0x4c74('0x45')]['length']?_0x2336a7[_0x4c74('0x45')]:_0x1d9b69['model'];if(!_0x549974[_0x4c74('0x3f')][_0x4c74('0x9c')]('nolimit')){_0x2336a7[_0x4c74('0x26')]=qs[_0x4c74('0x26')](_0x549974[_0x4c74('0x3f')][_0x4c74('0x26')]);_0x2336a7[_0x4c74('0x24')]=qs[_0x4c74('0x24')](_0x549974[_0x4c74('0x3f')][_0x4c74('0x24')]);}_0x2336a7[_0x4c74('0x9d')]=qs['sort'](_0x549974[_0x4c74('0x3f')][_0x4c74('0x9e')]);_0x2336a7[_0x4c74('0x9f')]=qs['filters'](_['pick'](_0x549974[_0x4c74('0x3f')],_0x1d9b69[_0x4c74('0x43')]));_0x2336a7['where']['ChatInteractionId']=_0x51af22['id'];if(_0x549974['query'][_0x4c74('0xa0')]){_0x2336a7[_0x4c74('0x9f')]=_[_0x4c74('0x30')](_0x2336a7[_0x4c74('0x9f')],{'$or':_['map'](_0x2336a7[_0x4c74('0x45')],function(_0x5c8a5c){var _0x3692d5={};_0x3692d5[_0x5c8a5c]={'$like':'%'+_0x549974['query'][_0x4c74('0xa0')]+'%'};return _0x3692d5;})});}if(_0x549974[_0x4c74('0x3f')][_0x4c74('0xa1')]){var _0x4ff25e=_0x549974[_0x4c74('0x3f')][_0x4c74('0xa1')][_0x4c74('0xa2')](',');var _0x59171b={};_0x59171b[_0x4ff25e[0x0]]={'$gte':moment(_0x4ff25e[0x1])[_0x4c74('0x84')](_0x4c74('0xa3'))};_0x2336a7[_0x4c74('0x9f')]=_[_0x4c74('0x30')](_0x2336a7['where'],_0x59171b);}_0x2336a7=_[_0x4c74('0x30')]({},_0x2336a7,_0x549974[_0x4c74('0x49')]);return db['ChatMessage'][_0x4c74('0x27')]({'where':_0x2336a7[_0x4c74('0x9f')]})[_0x4c74('0x16')](function(_0x41cf4a){_0x1c35ff[_0x4c74('0x27')]=_0x41cf4a;if(_0x549974[_0x4c74('0x3f')][_0x4c74('0x47')]){_0x2336a7['include']=[{'all':!![]}];}return db[_0x4c74('0x61')][_0x4c74('0x3d')](_0x2336a7);})[_0x4c74('0x16')](function(_0x3a6fd1){_0x1c35ff[_0x4c74('0xa4')]=_0x3a6fd1;return _0x1c35ff;});}})['then'](respondWithFilteredResult(_0x4417f7,_0x2336a7))['catch'](handleError(_0x4417f7,null));};exports[_0x4c74('0xa5')]=function(_0x20d78d,_0x481c77){var _0x3d43b2={'where':{}},_0x26ecbd={},_0x4b6f58={'count':0x0,'rows':[]};return db[_0x4c74('0x37')][_0x4c74('0x4e')]({'where':{'id':_0x20d78d[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0x481c77,null))[_0x4c74('0x16')](function(_0xee2812){if(_0xee2812){_0x26ecbd[_0x4c74('0x41')]=_[_0x4c74('0x42')](db[_0x4c74('0x61')][_0x4c74('0x38')]);_0x26ecbd[_0x4c74('0x3f')]=_[_0x4c74('0x42')](_0x20d78d[_0x4c74('0x3f')]);_0x26ecbd[_0x4c74('0x43')]=_['intersection'](_0x26ecbd[_0x4c74('0x41')],_0x26ecbd[_0x4c74('0x3f')]);_0x3d43b2[_0x4c74('0x45')]=_['intersection'](_0x26ecbd[_0x4c74('0x41')],qs['fields'](_0x20d78d[_0x4c74('0x3f')][_0x4c74('0x46')]));_0x3d43b2['attributes']=_0x3d43b2[_0x4c74('0x45')][_0x4c74('0x83')]?_0x3d43b2[_0x4c74('0x45')]:_0x26ecbd[_0x4c74('0x41')];if(!_0x20d78d[_0x4c74('0x3f')][_0x4c74('0x9c')]('nolimit')){_0x3d43b2[_0x4c74('0x26')]=qs[_0x4c74('0x26')](_0x20d78d[_0x4c74('0x3f')][_0x4c74('0x26')]);_0x3d43b2[_0x4c74('0x24')]=qs[_0x4c74('0x24')](_0x20d78d['query'][_0x4c74('0x24')]);}_0x3d43b2[_0x4c74('0x9d')]=qs[_0x4c74('0x9e')](_0x20d78d[_0x4c74('0x3f')][_0x4c74('0x9e')]);_0x3d43b2[_0x4c74('0x9f')]=qs[_0x4c74('0x43')](_[_0x4c74('0xa6')](_0x20d78d[_0x4c74('0x3f')],_0x26ecbd['filters']));_0x3d43b2[_0x4c74('0x9f')]['ChatInteractionId']=_0xee2812['id'];if(_0x20d78d[_0x4c74('0x3f')][_0x4c74('0xa0')]){_0x3d43b2['where']=_['merge'](_0x3d43b2[_0x4c74('0x9f')],{'$or':_[_0x4c74('0x36')](_0x3d43b2[_0x4c74('0x45')],function(_0x31a071){var _0x13b33b={};_0x13b33b[_0x31a071]={'$like':'%'+_0x20d78d[_0x4c74('0x3f')][_0x4c74('0xa0')]+'%'};return _0x13b33b;})});}_0x3d43b2[_0x4c74('0x9f')][_0x4c74('0xa7')]=![];if(_0x20d78d[_0x4c74('0x3f')]['id']){_0x3d43b2[_0x4c74('0x9f')]['id']={'$gt':_0x20d78d[_0x4c74('0x3f')]['id']};}_0x3d43b2=_[_0x4c74('0x30')]({},_0x3d43b2,_0x20d78d[_0x4c74('0x49')]);return db['ChatMessage'][_0x4c74('0x27')]({'where':_0x3d43b2[_0x4c74('0x9f')]})[_0x4c74('0x16')](function(_0x184a31){_0x4b6f58[_0x4c74('0x27')]=_0x184a31;_0x3d43b2[_0x4c74('0x48')]=[];if(_0x20d78d[_0x4c74('0x3f')][_0x4c74('0xa8')]){_0x3d43b2[_0x4c74('0x48')][_0x4c74('0xa9')]({'model':db[_0x4c74('0x80')],'as':_0x4c74('0x80'),'attributes':['id',_0x4c74('0x56'),_0x4c74('0x8c')]});}if(_0x20d78d[_0x4c74('0x3f')][_0x4c74('0x47')]){_0x3d43b2[_0x4c74('0x48')]=[{'all':!![]}];}return db[_0x4c74('0x61')][_0x4c74('0x3d')](_0x3d43b2);})[_0x4c74('0x16')](function(_0x560307){_0x4b6f58['rows']=_0x560307;return _0x4b6f58;});}})['then'](respondWithFilteredResult(_0x481c77,_0x3d43b2))[_0x4c74('0x21')](handleError(_0x481c77,null));};exports[_0x4c74('0xaa')]=function(_0x3bdcfd,_0x685c11){return db[_0x4c74('0x37')]['find']({'where':{'id':_0x3bdcfd[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0x685c11,null))['then'](function(_0x1ae273){if(_0x1ae273){return _0x1ae273[_0x4c74('0xab')](_0x3bdcfd[_0x4c74('0x31')]['ids'],_[_0x4c74('0x9a')](_0x3bdcfd[_0x4c74('0x31')],[_0x4c74('0x99'),'id'])||{})[_0x4c74('0xac')](function(){return db[_0x4c74('0xad')][_0x4c74('0x3d')]({'attributes':['id',_0x4c74('0x2e'),_0x4c74('0xae')],'where':{'id':_0x3bdcfd['body']['ids']}});})['then'](function(_0x3d98da){socket['emit'](_0x4c74('0xaf'),{'id':Number(_0x3bdcfd[_0x4c74('0x40')]['id']),'tags':_0x3d98da||[]});return{'id':Number(_0x3bdcfd[_0x4c74('0x40')]['id']),'tags':_0x3d98da||[]};});}})[_0x4c74('0x16')](respondWithResult(_0x685c11,null))['catch'](handleError(_0x685c11,null));};exports[_0x4c74('0xb0')]=function(_0x674365,_0x43f99d){return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0x674365[_0x4c74('0x40')]['id']}})[_0x4c74('0x16')](handleEntityNotFound(_0x43f99d,null))[_0x4c74('0x16')](function(_0x49556c){if(_0x49556c){return _0x49556c[_0x4c74('0xb0')](_0x674365[_0x4c74('0x3f')][_0x4c74('0x99')]);}})['then'](respondWithStatusCode(_0x43f99d,null))[_0x4c74('0x21')](handleError(_0x43f99d,null));};exports['download']=function(_0x56ba93,_0x874866){var _0x321259=moment()['unix']()[_0x4c74('0xb1')]();var _0x534bee=path[_0x4c74('0x74')](config[_0x4c74('0x7a')],_0x4c74('0xb2'),_0x4c74('0xb3'),_0x4c74('0xb4'));var _0x58a048=path['join'](config['root'],_0x4c74('0xb2'),_0x4c74('0xb3'),_0x4c74('0xb5'));var _0x453c0d=path[_0x4c74('0x74')](_0x534bee,_0x321259);var _0x344f5e=util['format'](_0x4c74('0xb6'),_0x56ba93[_0x4c74('0x40')]['id'],_0x321259);var _0x43f710=path[_0x4c74('0x74')](_0x534bee,_0x344f5e);var _0x5a0e83=[];_0x5a0e83[_0x4c74('0xa9')]({'model':db[_0x4c74('0x80')],'as':_0x4c74('0x80'),'attributes':['id',_0x4c74('0x56')],'raw':!![]});_0x5a0e83[_0x4c74('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x4c74('0xb7'),_0x4c74('0xb8')],'raw':!![]});if(_0x56ba93[_0x4c74('0x3f')][_0x4c74('0xb5')]){_0x5a0e83[_0x4c74('0xa9')]({'model':db[_0x4c74('0x6f')],'as':_0x4c74('0x6f'),'raw':!![]});}var _0x40715a=[{'model':db[_0x4c74('0x61')],'as':_0x4c74('0x7f'),'attributes':['id',_0x4c74('0x31'),_0x4c74('0xb9'),_0x4c74('0x8f'),_0x4c74('0xa7'),_0x4c74('0xba')],'include':_0x5a0e83}];_0x40715a[_0x4c74('0xa9')]({'model':db[_0x4c74('0x81')],'as':_0x4c74('0xbb'),'attributes':['id',_0x4c74('0x2e')]});_0x40715a['push']({'model':db[_0x4c74('0x80')],'as':_0x4c74('0xbc'),'attributes':['id',_0x4c74('0x56')]});return db[_0x4c74('0x37')][_0x4c74('0x4b')]({'where':{'id':_0x56ba93[_0x4c74('0x40')]['id']},'include':_0x40715a})[_0x4c74('0x16')](handleEntityNotFound(_0x874866,null))[_0x4c74('0x16')](function(_0x429657){if(_0x429657){var _0x2d32da=_0x429657[_0x4c74('0xbd')]({'plain':!![]});fs['mkdirSync'](_0x453c0d);var _0x5579ec={'channel':'Chat','account':_0x2d32da[_0x4c74('0xbb')][_0x4c74('0x2e')],'agent':_0x2d32da['Owner']?_0x2d32da[_0x4c74('0xbc')][_0x4c74('0x56')]:_0x4c74('0xbe'),'createdAt':moment(_0x2d32da[_0x4c74('0xb9')])[_0x4c74('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4c74('0xb1')](),'closedAt':_0x2d32da['closed']?moment(_0x2d32da[_0x4c74('0xbf')])[_0x4c74('0x84')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4c74('0xb1')]():'','disposition':_0x2d32da['disposition'],'chatInfo':{'browser':_0x2d32da[_0x4c74('0xc0')],'os':_0x2d32da[_0x4c74('0xc1')],'referer':_0x2d32da['referer'],'customerIp':_0x2d32da[_0x4c74('0xc2')],'customerPort':_0x2d32da[_0x4c74('0xc3')]?_0x2d32da[_0x4c74('0xc3')]:'N.A.'},'messages':_(_0x2d32da['Messages'])[_0x4c74('0xc4')]()['filter']({'secret':![]})[_0x4c74('0x36')](function(_0x3661e9){if(_0x3661e9['Attachment']){var _0x57fd4e=path[_0x4c74('0x74')](_0x58a048,_0x3661e9[_0x4c74('0x6f')]['basename']);if(fs[_0x4c74('0xc5')](_0x57fd4e)){fs[_0x4c74('0xc6')](_0x57fd4e)['pipe'](fs['createWriteStream'](path['join'](_0x453c0d,_0x3661e9[_0x4c74('0x6f')][_0x4c74('0x76')])));}}return{'date':moment(_0x3661e9[_0x4c74('0xb9')])[_0x4c74('0x84')](_0x4c74('0xa3'))[_0x4c74('0xb1')](),'sender':_0x3661e9[_0x4c74('0x8f')]==='out'?_0x3661e9[_0x4c74('0x80')]?_0x3661e9[_0x4c74('0x80')][_0x4c74('0x56')]:'System':_0x3661e9[_0x4c74('0xc7')][_0x4c74('0xb7')]+(_0x3661e9['Contact'][_0x4c74('0xb8')]?'\x20'+_0x3661e9[_0x4c74('0xc7')][_0x4c74('0xb8')]:''),'body':_0x3661e9[_0x4c74('0x6f')]?_0x3661e9[_0x4c74('0x6f')][_0x4c74('0x76')]:_0x3661e9[_0x4c74('0x31')],'direction':_0x3661e9[_0x4c74('0x8f')]==='out'?'A':'C','secret':_0x3661e9[_0x4c74('0xa7')],'read':_0x3661e9[_0x4c74('0xba')],'attachment':_0x3661e9[_0x4c74('0x6f')]};})[_0x4c74('0xc8')]()};return ejs[_0x4c74('0xc9')](path[_0x4c74('0x74')](config[_0x4c74('0x7a')],_0x4c74('0xb2'),'views','downloadInteraction.ejs'),{'interaction':_0x5579ec})[_0x4c74('0x16')](function(_0x29868e){var _0xa1d7a3=path[_0x4c74('0x74')](_0x453c0d,_0x4c74('0xca')+_0x2d32da['id']+'-'+_0x321259+_0x4c74('0xcb'));var _0xdf2ee1={'path':_0xa1d7a3,'channel':'Chat','interactionId':_0x2d32da['id']};return pdf[_0x4c74('0xcc')](_0x29868e,_0xdf2ee1);})['then'](function(){return new Promise(function(_0x585e98,_0x390e8b){zipdir(_0x453c0d,{'saveTo':_0x43f710},function(_0x461bae,_0x26375b){if(_0x461bae)return _0x390e8b(_0x461bae);return _0x585e98(_0x26375b);});})['then'](function(){return new BPromise(function(_0x4e4c5f,_0x3605a1){rimraf(_0x453c0d,function(_0x562749){if(_0x562749)_0x3605a1(_0x562749);return _0x4e4c5f();});});})[_0x4c74('0x16')](function(){return _0x874866[_0x4c74('0x77')](_0x43f710,_0x344f5e,function(_0x1af125){if(_0x1af125){logger[_0x4c74('0x1c')](_0x4c74('0xcd'),_0x1af125);}else{fs[_0x4c74('0xce')](_0x43f710);}});});});}else{return _0x874866['sendStatus'](0xc8);}})[_0x4c74('0x21')](handleError(_0x874866,null));}; \ No newline at end of file +var _0x7b95=['name','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','type','key','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','abandon','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','Attachment','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','omit','hasOwnProperty','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','includeAgent','push','addTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','files','tmp','server','transcript-%d-%s.zip','firstName','attachments','read','Owner','get','mkdirSync','Account','N.A.','closedAt','osName','referer','customerIp','customerPort','existsSync','pipe','lastName','renderFile','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','destroy','stack'];(function(_0x2f0056,_0x3df793){var _0x40a158=function(_0xe870fe){while(--_0xe870fe){_0x2f0056['push'](_0x2f0056['shift']());}};_0x40a158(++_0x3df793);}(_0x7b95,0xa3));var _0x57b9=function(_0x47b971,_0x45e644){_0x47b971=_0x47b971-0x0;var _0x52b2bc=_0x7b95[_0x47b971];return _0x52b2bc;};'use strict';var rimraf=require(_0x57b9('0x0'));var zipdir=require('zip-dir');var rp=require(_0x57b9('0x1'));var moment=require(_0x57b9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x57b9('0x3'));var util=require(_0x57b9('0x4'));var path=require('path');var ejs=require(_0x57b9('0x5'));var fs=require('fs');var _=require(_0x57b9('0x6'));var Redis=require(_0x57b9('0x7'));var interaction=require(_0x57b9('0x8'));var qs=require(_0x57b9('0x9'));var pdf=require(_0x57b9('0xa'));var logger=require(_0x57b9('0xb'))(_0x57b9('0xc'));var config=require('../../config/environment');var db=require(_0x57b9('0xd'))['db'];config[_0x57b9('0xe')]=_['defaults'](config[_0x57b9('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x57b9('0xf'))(new Redis(config[_0x57b9('0xe')]));require(_0x57b9('0x10'))[_0x57b9('0x11')](socket);var jayson=require(_0x57b9('0x12'));var client=jayson[_0x57b9('0x13')][_0x57b9('0x14')]({'port':0x232b});var client9004=jayson[_0x57b9('0x13')][_0x57b9('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x309d73,_0x28c0fc,_0x30af43,_0x3cb12f){return new BPromise(function(_0x419cde,_0x2bd958){var _0x4ed184=_0x3cb12f||client;return _0x4ed184[_0x57b9('0x15')](_0x309d73,_0x30af43)[_0x57b9('0x16')](function(_0x38314e){logger[_0x57b9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x28c0fc,_0x57b9('0x18'));logger[_0x57b9('0x19')](_0x57b9('0x1a'),_0x28c0fc,_0x57b9('0x18'),JSON[_0x57b9('0x1b')](_0x38314e));if(_0x38314e['error']){if(_0x38314e[_0x57b9('0x1c')][_0x57b9('0x1d')]===0x1f4){logger[_0x57b9('0x1c')](_0x57b9('0x1e'),_0x28c0fc,_0x38314e['error'][_0x57b9('0x1f')]);return _0x2bd958(_0x38314e['error'][_0x57b9('0x1f')]);}logger[_0x57b9('0x1c')](_0x57b9('0x1e'),_0x28c0fc,_0x38314e[_0x57b9('0x1c')]['message']);return _0x419cde(_0x38314e[_0x57b9('0x1c')][_0x57b9('0x1f')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x28c0fc,_0x57b9('0x18'));_0x419cde(_0x38314e[_0x57b9('0x20')][_0x57b9('0x1f')]);}})[_0x57b9('0x21')](function(_0x4be8d1){logger[_0x57b9('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x28c0fc,_0x4be8d1);_0x2bd958(_0x4be8d1);});});}function respondWithStatusCode(_0x2a4cc3,_0x29cacd){_0x29cacd=_0x29cacd||0xcc;return function(_0x146219){if(_0x146219){return _0x2a4cc3[_0x57b9('0x22')](_0x29cacd);}return _0x2a4cc3[_0x57b9('0x23')](_0x29cacd)[_0x57b9('0x24')]();};}function respondWithResult(_0x390339,_0x2b37a9){_0x2b37a9=_0x2b37a9||0xc8;return function(_0x39a73a){if(_0x39a73a){return _0x390339['status'](_0x2b37a9)['json'](_0x39a73a);}};}function respondWithFilteredResult(_0x4d2aba,_0x39730e){return function(_0x396679){if(_0x396679){var _0x58c41f=typeof _0x39730e[_0x57b9('0x25')]==='undefined'&&typeof _0x39730e[_0x57b9('0x26')]==='undefined';var _0x375997=_0x396679[_0x57b9('0x27')];var _0x4afea3=_0x58c41f?0x0:_0x39730e[_0x57b9('0x25')];var _0x536e68=_0x58c41f?_0x396679[_0x57b9('0x27')]:_0x39730e[_0x57b9('0x25')]+_0x39730e[_0x57b9('0x26')];var _0x7a6572;if(_0x536e68>=_0x375997){_0x536e68=_0x375997;_0x7a6572=0xc8;}else{_0x7a6572=0xce;}_0x4d2aba[_0x57b9('0x23')](_0x7a6572);return _0x4d2aba[_0x57b9('0x28')](_0x57b9('0x29'),_0x4afea3+'-'+_0x536e68+'/'+_0x375997)['json'](_0x396679);}return null;};}function saveUpdates(_0x1755f7){return function(_0x531ec8){if(_0x531ec8){return _0x531ec8['update'](_0x1755f7)[_0x57b9('0x16')](function(_0x12d405){return _0x12d405;});}return null;};}function removeEntity(_0x57c087){return function(_0xb859f0){if(_0xb859f0){return _0xb859f0[_0x57b9('0x2a')]()['then'](function(){_0x57c087['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e152){return function(_0x52b437){if(!_0x52b437){_0x21e152[_0x57b9('0x22')](0x194);}return _0x52b437;};}function handleError(_0xfa2068,_0x3ac0ac){_0x3ac0ac=_0x3ac0ac||0x1f4;return function(_0x14f3b7){logger[_0x57b9('0x1c')](_0x14f3b7[_0x57b9('0x2b')]);if(_0x14f3b7[_0x57b9('0x2c')]){delete _0x14f3b7[_0x57b9('0x2c')];}_0xfa2068['status'](_0x3ac0ac)['send'](_0x14f3b7);};}function getMustacheRender(_0x2ddf8d,_0x53fa5d){return Mustache[_0x57b9('0x2d')](_0x2ddf8d,_[_0x57b9('0x2e')](_0x53fa5d[_0x57b9('0x2f')],{'contact':_0x53fa5d[_0x57b9('0x30')],'message':_0x53fa5d[_0x57b9('0x1f')],'agent':_0x53fa5d[_0x57b9('0x31')],'interaction':_0x53fa5d[_0x57b9('0x32')],'account':_0x53fa5d[_0x57b9('0x33')]}))||'';}exports[_0x57b9('0x34')]=function(_0x31ee16,_0x4d43df){var _0x660a80={};var _0xf33812=_[_0x57b9('0x35')](db['ChatInteraction'][_0x57b9('0x36')],function(_0x2ec6f6){return{'name':_0x2ec6f6['fieldName'],'type':_0x2ec6f6[_0x57b9('0x37')][_0x57b9('0x38')]};});_0x660a80=qs['getOptions'](_0xf33812,_0x31ee16);return interaction[_0x57b9('0x39')](_0x57b9('0x3a'),_0x31ee16[_0x57b9('0x3b')],_0x31ee16[_0x57b9('0x3c')],_0x660a80,_0xf33812)[_0x57b9('0x16')](respondWithFilteredResult(_0x4d43df,_0x660a80))['catch'](handleError(_0x4d43df,null));};exports[_0x57b9('0x3d')]=function(_0x149836,_0x12acd2){var _0x1b5b47={'raw':![],'where':{'id':_0x149836[_0x57b9('0x3e')]['id']}},_0x3d9d50={};_0x3d9d50[_0x57b9('0x3f')]=_[_0x57b9('0x40')](db[_0x57b9('0x41')][_0x57b9('0x36')]);_0x3d9d50[_0x57b9('0x3b')]=_[_0x57b9('0x40')](_0x149836[_0x57b9('0x3b')]);_0x3d9d50[_0x57b9('0x42')]=_[_0x57b9('0x43')](_0x3d9d50[_0x57b9('0x3f')],_0x3d9d50[_0x57b9('0x3b')]);_0x1b5b47[_0x57b9('0x44')]=_['intersection'](_0x3d9d50[_0x57b9('0x3f')],qs[_0x57b9('0x45')](_0x149836[_0x57b9('0x3b')]['fields']));_0x1b5b47[_0x57b9('0x44')]=_0x1b5b47[_0x57b9('0x44')][_0x57b9('0x46')]?_0x1b5b47[_0x57b9('0x44')]:_0x3d9d50[_0x57b9('0x3f')];if(_0x149836[_0x57b9('0x3b')][_0x57b9('0x47')]){_0x1b5b47['include']=[{'all':!![]}];}_0x1b5b47=_[_0x57b9('0x2e')]({},_0x1b5b47,_0x149836[_0x57b9('0x48')]);return db[_0x57b9('0x41')][_0x57b9('0x49')](_0x1b5b47)[_0x57b9('0x16')](handleEntityNotFound(_0x12acd2,null))['then'](respondWithResult(_0x12acd2,null))[_0x57b9('0x21')](handleError(_0x12acd2,null));};exports[_0x57b9('0x4a')]=function(_0x3b2db1,_0x2c7b41){return db[_0x57b9('0x41')]['create'](_0x3b2db1[_0x57b9('0x2f')],{})[_0x57b9('0x16')](respondWithResult(_0x2c7b41,0xc9))[_0x57b9('0x21')](handleError(_0x2c7b41,null));};exports[_0x57b9('0x4b')]=function(_0x269575,_0x1cc75c){if(_0x269575['body']['id']){delete _0x269575[_0x57b9('0x2f')]['id'];}return db[_0x57b9('0x41')][_0x57b9('0x49')]({'where':{'id':_0x269575['params']['id']}})['then'](handleEntityNotFound(_0x1cc75c,null))[_0x57b9('0x16')](saveUpdates(_0x269575[_0x57b9('0x2f')],null))[_0x57b9('0x16')](respondWithResult(_0x1cc75c,null))[_0x57b9('0x21')](handleError(_0x1cc75c,null));};exports['destroy']=function(_0xe004d0,_0x4a9fd1){return db[_0x57b9('0x41')][_0x57b9('0x49')]({'where':{'id':_0xe004d0[_0x57b9('0x3e')]['id']}})[_0x57b9('0x16')](handleEntityNotFound(_0x4a9fd1,null))[_0x57b9('0x16')](removeEntity(_0x4a9fd1,null))[_0x57b9('0x21')](handleError(_0x4a9fd1,null));};exports['describe']=function(_0x263c23,_0x285414){return db['ChatInteraction'][_0x57b9('0x4c')]()[_0x57b9('0x16')](respondWithResult(_0x285414,null))['catch'](handleError(_0x285414,null));};exports[_0x57b9('0x4d')]=function(_0x29cccc,_0x17ceaa){var _0x3a625d=_0x29cccc[_0x57b9('0x3e')]['id'];var _0x407dcc;var _0x16136c;var _0x2b33ea;return db[_0x57b9('0x41')]['findOne']({'where':{'id':_0x3a625d}})['then'](function(_0x1e1fc1){_0x407dcc=_0x1e1fc1;return db[_0x57b9('0x4e')][_0x57b9('0x4f')]({'where':{'id':_0x1e1fc1[_0x57b9('0x50')]},'attributes':['id','vidaooApiKey',_0x57b9('0x51'),_0x57b9('0x52'),_0x57b9('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x343563){if(_0x343563&&_0x343563[_0x57b9('0x54')]&&_0x343563[_0x57b9('0x51')]){_0x16136c=_0x343563;var _0x6939f5={'interaction':{'id':_0x3a625d},'agent':{'id':_0x29cccc[_0x57b9('0x3c')]['id'],'name':_0x29cccc[_0x57b9('0x3c')][_0x57b9('0x2c')],'fullname':_0x29cccc['user']['fullname'],'email':_0x29cccc[_0x57b9('0x3c')][_0x57b9('0x55')]},'contact':_0x29cccc[_0x57b9('0x2f')]['contact'],'account':_0x29cccc[_0x57b9('0x2f')][_0x57b9('0x33')]};var _0x276fce={'rejectUnauthorized':![],'method':_0x57b9('0x56'),'url':_0x57b9('0x57'),'headers':{'X-APIKEY':_0x343563['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29cccc[_0x57b9('0x3c')][_0x57b9('0x55')]],'buttons':null,'topic':_0x16136c[_0x57b9('0x52')],'note':_['isNull'](_0x16136c[_0x57b9('0x53')])?null:getMustacheRender(_0x16136c[_0x57b9('0x53')],_0x6939f5),'metadata':null},'redirect':_0x57b9('0x58'),'json':!![]};try{if(!_[_0x57b9('0x59')](_0x16136c[_0x57b9('0x5a')])){var _0x809849=getMustacheRender(_0x16136c[_0x57b9('0x5a')],_0x6939f5);var _0x482554=JSON[_0x57b9('0x5b')](_0x809849);_0x276fce['body'][_0x57b9('0x5c')]=_0x482554;}}catch(_0x694d4a){throw new db[(_0x57b9('0x5d'))][(_0x57b9('0x5e'))](_0x57b9('0x5f'));}return rp(_0x276fce);}else{throw new db[(_0x57b9('0x5d'))][(_0x57b9('0x5e'))](_0x57b9('0x60'));}})[_0x57b9('0x16')](function(_0x3c1fb5){_0x2b33ea=_0x3c1fb5;if(_0x2b33ea['id']){var _0x3bfc5b={'body':_0x2b33ea[_0x57b9('0x61')],'ChatWebsiteId':_0x16136c['id'],'ChatInteractionId':_0x407dcc['id'],'direction':_0x57b9('0x62'),'UserId':_0x29cccc[_0x57b9('0x3c')]['id']};return db['ChatMessage'][_0x57b9('0x4a')](_0x3bfc5b,{});}else{throw new db[(_0x57b9('0x5d'))][(_0x57b9('0x5e'))](_0x57b9('0x63'));}})[_0x57b9('0x16')](function(){return _0x407dcc[_0x57b9('0x64')]({'vidaooSessionId':_0x2b33ea['id']});})['then'](respondWithResult(_0x17ceaa,null))['catch'](handleError(_0x17ceaa,null));};exports['customUpdate']=function(_0x308bbc,_0x35082a){if(_0x308bbc[_0x57b9('0x2f')]['id']){delete _0x308bbc[_0x57b9('0x2f')]['id'];}return db[_0x57b9('0x41')][_0x57b9('0x49')]({'where':{'id':_0x308bbc[_0x57b9('0x3e')]['id']},'include':[{'model':db[_0x57b9('0x65')],'as':_0x57b9('0x66')}]})[_0x57b9('0x16')](handleEntityNotFound(_0x35082a,null))['then'](saveUpdates(_0x308bbc['body'],null))['then'](respondWithResult(_0x35082a,null))[_0x57b9('0x21')](handleError(_0x35082a,null));};exports['abandon']=function(_0x174e00,_0x317ff5){if(_0x174e00[_0x57b9('0x2f')]['id']){delete _0x174e00[_0x57b9('0x2f')]['id'];}return db[_0x57b9('0x41')][_0x57b9('0x49')]({'where':{'id':_0x174e00[_0x57b9('0x3e')]['id']}})[_0x57b9('0x16')](function(_0x31b845){if(!_0x31b845){logger[_0x57b9('0x1c')](_0x57b9('0x67'),'abandon',0x194,'entity\x20not\x20found');_0x317ff5[_0x57b9('0x22')](0x194);}else{if(_0x31b845[_0x57b9('0x68')]){throw new db['Sequelize'][(_0x57b9('0x5e'))](_0x57b9('0x69'));}}return _0x31b845;})[_0x57b9('0x16')](function(_0x4a552d){if(_0x4a552d){return _0x4a552d[_0x57b9('0x4b')]({'closed':_0x174e00[_0x57b9('0x2f')][_0x57b9('0x6a')],'disposition':_0x174e00['body']['disposition']})[_0x57b9('0x16')](function(_0x175c81){return _0x175c81;});}})[_0x57b9('0x16')](function(){return respondWithRpcPromise(_0x57b9('0x6b'),_0x57b9('0x6c'),_0x174e00[_0x57b9('0x2f')],client9004);})['then'](respondWithResult(_0x317ff5,null))[_0x57b9('0x21')](handleError(_0x317ff5,null));};exports[_0x57b9('0x6d')]=function(_0x22bba4,_0x487ce1){_0x22bba4[_0x57b9('0x2f')]['name']=_0x22bba4['file'][_0x57b9('0x6e')];_0x22bba4['body'][_0x57b9('0x6f')]=_0x22bba4[_0x57b9('0x70')][_0x57b9('0x71')];_0x22bba4[_0x57b9('0x2f')][_0x57b9('0x37')]=_0x22bba4[_0x57b9('0x70')][_0x57b9('0x72')];return db['Attachment']['create'](_0x22bba4[_0x57b9('0x2f')])[_0x57b9('0x16')](respondWithResult(_0x487ce1,0xc9))[_0x57b9('0x21')](handleError(_0x487ce1,null));};exports[_0x57b9('0x73')]=function(_0x68a26f,_0x56f9a2){return db[_0x57b9('0x41')][_0x57b9('0x4f')]({'where':{'id':_0x68a26f[_0x57b9('0x3e')]['id']},'raw':!![]})[_0x57b9('0x16')](handleEntityNotFound(_0x56f9a2,null))[_0x57b9('0x16')](function(_0x3dbbb3){if(_0x3dbbb3){if(_0x3dbbb3[_0x57b9('0x6a')]){return _0x56f9a2['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x57b9('0x74')][_0x57b9('0x4f')]({'where':{'id':_0x68a26f[_0x57b9('0x3b')]['attachId']},'raw':!![]})[_0x57b9('0x16')](handleEntityNotFound(_0x56f9a2,null));}})[_0x57b9('0x16')](function(_0x44b0be){if(_0x44b0be){var _0xa94129=_0x44b0be['ChatOfflineMessageId']!==null;var _0x252ce4=path[_0x57b9('0x75')](config[_0x57b9('0x76')],_0x57b9('0x77'));if(_0xa94129){_0x252ce4=path['join'](_0x252ce4,_0x57b9('0x78'));}var _0x309da1=path[_0x57b9('0x75')](_0x252ce4,_0x44b0be['basename']);return _0x56f9a2[_0x57b9('0x79')](_0x309da1);}})['catch'](handleError(_0x56f9a2,null));};exports[_0x57b9('0x7a')]=function(_0x489bb4,_0x95d0fc){var _0x1893c1=null;var _0x5e8dbc=null;var _0x216c39=null;if(_0x489bb4['body']['id']){delete _0x489bb4[_0x57b9('0x2f')]['id'];}if(_0x489bb4[_0x57b9('0x2f')][_0x57b9('0x7b')]){_0x216c39=path['join'](config[_0x57b9('0x76')],_0x57b9('0x7c'),util[_0x57b9('0x7d')](_0x57b9('0x7e'),Date[_0x57b9('0x7f')]()));_0x489bb4[_0x57b9('0x2f')][_0x57b9('0x80')]=_0x216c39;}return db[_0x57b9('0x41')][_0x57b9('0x49')]({'where':{'id':_0x489bb4[_0x57b9('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x57b9('0x81'),'include':[{'model':db[_0x57b9('0x82')],'as':_0x57b9('0x82')}]}]})['then'](handleEntityNotFound(_0x95d0fc,null))['then'](saveUpdates(_0x489bb4[_0x57b9('0x2f')],null))[_0x57b9('0x16')](function(_0x2cca5c){if(_0x2cca5c){_0x1893c1=_0x2cca5c;return db[_0x57b9('0x4e')][_0x57b9('0x49')]({'where':{'id':_0x1893c1[_0x57b9('0x50')]}});}})['then'](function(_0x42773a){if(_0x42773a){_0x5e8dbc=_0x42773a;return db[_0x57b9('0x65')][_0x57b9('0x49')]({'where':{'id':_0x1893c1[_0x57b9('0x83')]}});}})[_0x57b9('0x16')](function(_0x5f2671){if(_0x5f2671){if(_0x216c39){var _0xa64ee4=null;for(var _0x225ec0=0x1;_0x225ec0<_0x1893c1[_0x57b9('0x81')][_0x57b9('0x46')];++_0x225ec0){_0xa64ee4=_0x1893c1['Messages'][_0x225ec0];var _0x91dbd0=_0xa64ee4[_0x57b9('0x68')]?util[_0x57b9('0x7d')](_0x57b9('0x84'),_0x5e8dbc[_0x57b9('0x85')],_0xa64ee4[_0x57b9('0x68')]):_0x57b9('0x86');var _0x4f6629=_0x489bb4[_0x57b9('0x2f')][_0x57b9('0x87')]||util['format']('%s%d',_0x57b9('0x88'),_0xa64ee4[_0x57b9('0x83')]);switch(_0x5e8dbc['agentIdentifier']){case _0x57b9('0x89'):_0x91dbd0=_0xa64ee4['UserId']?util[_0x57b9('0x7d')]('%s%d',_0x5e8dbc['agentAlias'],_0xa64ee4[_0x57b9('0x68')]):_0x57b9('0x86');break;case _0x57b9('0x8a'):_0x91dbd0=_0xa64ee4['UserId']?_0xa64ee4[_0x57b9('0x82')][_0x57b9('0x8b')]||_0xa64ee4['User'][_0x57b9('0x8c')]:_0x57b9('0x86');break;case _0x57b9('0x8d'):_0x91dbd0=_0xa64ee4['UserId']?_0xa64ee4[_0x57b9('0x82')][_0x57b9('0x8c')]:_0x57b9('0x86');break;default:_0x91dbd0=_0xa64ee4['UserId']?util['format'](_0x57b9('0x84'),_0x5e8dbc[_0x57b9('0x85')],_0xa64ee4[_0x57b9('0x68')]):_0x57b9('0x86');}var _0x3289ff=util[_0x57b9('0x7d')](_0x57b9('0x8e'),moment(_0xa64ee4[_0x57b9('0x8f')])[_0x57b9('0x7d')](_0x57b9('0x90')),_0xa64ee4[_0x57b9('0x91')]==='in'?_0x4f6629:_0x91dbd0,_0xa64ee4[_0x57b9('0x2f')]);if(!_0xa64ee4[_0x57b9('0x92')]){fs['appendFileSync'](_0x216c39,_0x3289ff);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x57b9('0x93')],'as':_0x57b9('0x94'),'raw':!![],'include':[{'model':db[_0x57b9('0x95')],'as':_0x57b9('0x95'),'raw':!![]}]}]});}}})[_0x57b9('0x16')](function(_0x3c60d5){if(!_0x3c60d5||!_0x3c60d5[_0x57b9('0x94')]||!_0x489bb4[_0x57b9('0x2f')])return _0x1893c1;var _0xd9bbf2=_0x3c60d5[_0x57b9('0x96')]();return respondWithRpcPromise('SendMail',_0x57b9('0x97'),{'account':_0xd9bbf2,'message':{'from':util['format'](_0x57b9('0x98'),_0x3c60d5[_0x57b9('0x2c')],_0x3c60d5[_0x57b9('0x55')]||_0x3c60d5['Smtp'][_0x57b9('0x3c')]),'to':_0x489bb4[_0x57b9('0x2f')][_0x57b9('0x7b')],'subject':'Mail\x20Transcript','text':util[_0x57b9('0x7d')](_0x57b9('0x99'),_0x489bb4[_0x57b9('0x2f')][_0x57b9('0x7b')]),'attachments':[{'path':_0x216c39}]}})[_0x57b9('0x16')](function(){return _0x1893c1;})[_0x57b9('0x21')](function(_0x10da0f){logger['error'](_0x10da0f);});})[_0x57b9('0x16')](respondWithStatusCode(_0x95d0fc,0xc8))[_0x57b9('0x21')](handleError(_0x95d0fc,null));};exports[_0x57b9('0x9a')]=function(_0x77ee2e,_0x50dd47){return db[_0x57b9('0x9b')]['find']({'where':{'id':_0x77ee2e[_0x57b9('0x3e')]['id']}})[_0x57b9('0x16')](handleEntityNotFound(_0x50dd47,null))[_0x57b9('0x16')](function(_0x1924b9){if(_0x1924b9){return _0x1924b9[_0x57b9('0x9a')](_0x77ee2e['body'][_0x57b9('0x9c')],_[_0x57b9('0x9d')](_0x77ee2e['body'],[_0x57b9('0x9c'),'id'])||{});}})[_0x57b9('0x16')](respondWithResult(_0x50dd47,null))[_0x57b9('0x21')](handleError(_0x50dd47,null));};exports['getMessages']=function(_0x34add7,_0x532158){var _0x1cba97={'raw':![],'where':{}};var _0x12ba3f={};var _0x48ccc1={'count':0x0,'rows':[]};return db[_0x57b9('0x41')]['findOne']({'where':{'id':_0x34add7['params']['id']}})[_0x57b9('0x16')](handleEntityNotFound(_0x532158,null))[_0x57b9('0x16')](function(_0x265734){if(_0x265734){_0x12ba3f[_0x57b9('0x3f')]=_[_0x57b9('0x40')](db[_0x57b9('0x9b')]['rawAttributes']);_0x12ba3f[_0x57b9('0x3b')]=_[_0x57b9('0x40')](_0x34add7[_0x57b9('0x3b')]);_0x12ba3f[_0x57b9('0x42')]=_[_0x57b9('0x43')](_0x12ba3f['model'],_0x12ba3f[_0x57b9('0x3b')]);_0x1cba97['attributes']=_['intersection'](_0x12ba3f[_0x57b9('0x3f')],qs[_0x57b9('0x45')](_0x34add7[_0x57b9('0x3b')]['fields']));_0x1cba97['attributes']=_0x1cba97[_0x57b9('0x44')]['length']?_0x1cba97['attributes']:_0x12ba3f['model'];if(!_0x34add7[_0x57b9('0x3b')][_0x57b9('0x9e')]('nolimit')){_0x1cba97[_0x57b9('0x26')]=qs['limit'](_0x34add7['query']['limit']);_0x1cba97[_0x57b9('0x25')]=qs[_0x57b9('0x25')](_0x34add7[_0x57b9('0x3b')][_0x57b9('0x25')]);}_0x1cba97[_0x57b9('0x9f')]=qs[_0x57b9('0xa0')](_0x34add7[_0x57b9('0x3b')][_0x57b9('0xa0')]);_0x1cba97[_0x57b9('0xa1')]=qs[_0x57b9('0x42')](_[_0x57b9('0xa2')](_0x34add7[_0x57b9('0x3b')],_0x12ba3f['filters']));_0x1cba97[_0x57b9('0xa1')]['ChatInteractionId']=_0x265734['id'];if(_0x34add7[_0x57b9('0x3b')][_0x57b9('0xa3')]){_0x1cba97['where']=_[_0x57b9('0x2e')](_0x1cba97[_0x57b9('0xa1')],{'$or':_[_0x57b9('0x35')](_0x1cba97['attributes'],function(_0x227d84){var _0x59090d={};_0x59090d[_0x227d84]={'$like':'%'+_0x34add7['query'][_0x57b9('0xa3')]+'%'};return _0x59090d;})});}if(_0x34add7[_0x57b9('0x3b')][_0x57b9('0xa4')]){var _0x270904=_0x34add7[_0x57b9('0x3b')][_0x57b9('0xa4')][_0x57b9('0xa5')](',');var _0x15f5ee={};_0x15f5ee[_0x270904[0x0]]={'$gte':moment(_0x270904[0x1])[_0x57b9('0x7d')](_0x57b9('0xa6'))};_0x1cba97['where']=_['merge'](_0x1cba97['where'],_0x15f5ee);}_0x1cba97=_[_0x57b9('0x2e')]({},_0x1cba97,_0x34add7['options']);return db[_0x57b9('0x9b')][_0x57b9('0x27')]({'where':_0x1cba97['where']})['then'](function(_0x45340c){_0x48ccc1[_0x57b9('0x27')]=_0x45340c;if(_0x34add7[_0x57b9('0x3b')][_0x57b9('0x47')]){_0x1cba97[_0x57b9('0xa7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1cba97);})[_0x57b9('0x16')](function(_0x413306){_0x48ccc1[_0x57b9('0xa8')]=_0x413306;return _0x48ccc1;});}})[_0x57b9('0x16')](respondWithFilteredResult(_0x532158,_0x1cba97))['catch'](handleError(_0x532158,null));};exports[_0x57b9('0xa9')]=function(_0x48ed27,_0xebfdff){var _0x5d289f={'where':{}},_0x2e2ad7={},_0x1166d9={'count':0x0,'rows':[]};return db[_0x57b9('0x41')][_0x57b9('0x4f')]({'where':{'id':_0x48ed27['params']['id']}})['then'](handleEntityNotFound(_0xebfdff,null))[_0x57b9('0x16')](function(_0x270bef){if(_0x270bef){_0x2e2ad7[_0x57b9('0x3f')]=_[_0x57b9('0x40')](db[_0x57b9('0x9b')][_0x57b9('0x36')]);_0x2e2ad7[_0x57b9('0x3b')]=_[_0x57b9('0x40')](_0x48ed27[_0x57b9('0x3b')]);_0x2e2ad7[_0x57b9('0x42')]=_[_0x57b9('0x43')](_0x2e2ad7[_0x57b9('0x3f')],_0x2e2ad7[_0x57b9('0x3b')]);_0x5d289f['attributes']=_[_0x57b9('0x43')](_0x2e2ad7[_0x57b9('0x3f')],qs[_0x57b9('0x45')](_0x48ed27[_0x57b9('0x3b')][_0x57b9('0x45')]));_0x5d289f[_0x57b9('0x44')]=_0x5d289f['attributes'][_0x57b9('0x46')]?_0x5d289f[_0x57b9('0x44')]:_0x2e2ad7[_0x57b9('0x3f')];if(!_0x48ed27[_0x57b9('0x3b')][_0x57b9('0x9e')]('nolimit')){_0x5d289f[_0x57b9('0x26')]=qs[_0x57b9('0x26')](_0x48ed27[_0x57b9('0x3b')][_0x57b9('0x26')]);_0x5d289f[_0x57b9('0x25')]=qs[_0x57b9('0x25')](_0x48ed27['query'][_0x57b9('0x25')]);}_0x5d289f[_0x57b9('0x9f')]=qs[_0x57b9('0xa0')](_0x48ed27[_0x57b9('0x3b')][_0x57b9('0xa0')]);_0x5d289f['where']=qs[_0x57b9('0x42')](_[_0x57b9('0xa2')](_0x48ed27[_0x57b9('0x3b')],_0x2e2ad7[_0x57b9('0x42')]));_0x5d289f['where']['ChatInteractionId']=_0x270bef['id'];if(_0x48ed27[_0x57b9('0x3b')][_0x57b9('0xa3')]){_0x5d289f[_0x57b9('0xa1')]=_[_0x57b9('0x2e')](_0x5d289f[_0x57b9('0xa1')],{'$or':_[_0x57b9('0x35')](_0x5d289f['attributes'],function(_0x3d87a9){var _0x3f7830={};_0x3f7830[_0x3d87a9]={'$like':'%'+_0x48ed27[_0x57b9('0x3b')][_0x57b9('0xa3')]+'%'};return _0x3f7830;})});}_0x5d289f[_0x57b9('0xa1')][_0x57b9('0x92')]=![];if(_0x48ed27['query']['id']){_0x5d289f[_0x57b9('0xa1')]['id']={'$gt':_0x48ed27[_0x57b9('0x3b')]['id']};}_0x5d289f=_[_0x57b9('0x2e')]({},_0x5d289f,_0x48ed27[_0x57b9('0x48')]);return db['ChatMessage'][_0x57b9('0x27')]({'where':_0x5d289f[_0x57b9('0xa1')]})[_0x57b9('0x16')](function(_0xa94f0b){_0x1166d9[_0x57b9('0x27')]=_0xa94f0b;_0x5d289f[_0x57b9('0xa7')]=[];if(_0x48ed27['query'][_0x57b9('0xaa')]){_0x5d289f[_0x57b9('0xa7')][_0x57b9('0xab')]({'model':db[_0x57b9('0x82')],'as':_0x57b9('0x82'),'attributes':['id',_0x57b9('0x8c'),_0x57b9('0x8b')]});}if(_0x48ed27['query'][_0x57b9('0x47')]){_0x5d289f[_0x57b9('0xa7')]=[{'all':!![]}];}return db[_0x57b9('0x9b')]['findAll'](_0x5d289f);})[_0x57b9('0x16')](function(_0x5d4784){_0x1166d9[_0x57b9('0xa8')]=_0x5d4784;return _0x1166d9;});}})[_0x57b9('0x16')](respondWithFilteredResult(_0xebfdff,_0x5d289f))[_0x57b9('0x21')](handleError(_0xebfdff,null));};exports[_0x57b9('0xac')]=function(_0x1628ea,_0x53a267){return db['ChatInteraction'][_0x57b9('0x49')]({'where':{'id':_0x1628ea['params']['id']}})['then'](handleEntityNotFound(_0x53a267,null))[_0x57b9('0x16')](function(_0x46be87){if(_0x46be87){return _0x46be87['setTags'](_0x1628ea['body'][_0x57b9('0x9c')],_['omit'](_0x1628ea[_0x57b9('0x2f')],[_0x57b9('0x9c'),'id'])||{})['spread'](function(){return db[_0x57b9('0xad')][_0x57b9('0x39')]({'attributes':['id',_0x57b9('0x2c'),_0x57b9('0xae')],'where':{'id':_0x1628ea[_0x57b9('0x2f')][_0x57b9('0x9c')]}});})[_0x57b9('0x16')](function(_0x2d31f3){socket[_0x57b9('0xaf')](_0x57b9('0xb0'),{'id':Number(_0x1628ea[_0x57b9('0x3e')]['id']),'tags':_0x2d31f3||[]});return{'id':Number(_0x1628ea[_0x57b9('0x3e')]['id']),'tags':_0x2d31f3||[]};});}})['then'](respondWithResult(_0x53a267,null))[_0x57b9('0x21')](handleError(_0x53a267,null));};exports[_0x57b9('0xb1')]=function(_0x254d3d,_0x373a54){return db['ChatInteraction'][_0x57b9('0x49')]({'where':{'id':_0x254d3d[_0x57b9('0x3e')]['id']}})[_0x57b9('0x16')](handleEntityNotFound(_0x373a54,null))[_0x57b9('0x16')](function(_0x594773){if(_0x594773){return _0x594773['removeTags'](_0x254d3d[_0x57b9('0x3b')][_0x57b9('0x9c')]);}})[_0x57b9('0x16')](respondWithStatusCode(_0x373a54,null))[_0x57b9('0x21')](handleError(_0x373a54,null));};exports[_0x57b9('0x79')]=function(_0xeea04e,_0x70bed7){var _0x5d2548=moment()[_0x57b9('0xb2')]()[_0x57b9('0xb3')]();var _0x48bd2c=path[_0x57b9('0x75')](config['root'],'server',_0x57b9('0xb4'),_0x57b9('0xb5'));var _0x192ad0=path['join'](config[_0x57b9('0x76')],_0x57b9('0xb6'),'files','attachments');var _0x1ec351=path['join'](_0x48bd2c,_0x5d2548);var _0x15778f=util[_0x57b9('0x7d')](_0x57b9('0xb7'),_0xeea04e['params']['id'],_0x5d2548);var _0x287b24=path['join'](_0x48bd2c,_0x15778f);var _0x54165b=[];_0x54165b[_0x57b9('0xab')]({'model':db[_0x57b9('0x82')],'as':'User','attributes':['id',_0x57b9('0x8c')],'raw':!![]});_0x54165b[_0x57b9('0xab')]({'model':db[_0x57b9('0x65')],'as':_0x57b9('0x66'),'attributes':['id',_0x57b9('0xb8'),'lastName'],'raw':!![]});if(_0xeea04e['query'][_0x57b9('0xb9')]){_0x54165b['push']({'model':db[_0x57b9('0x74')],'as':_0x57b9('0x74'),'raw':!![]});}var _0xda3a9f=[{'model':db[_0x57b9('0x9b')],'as':_0x57b9('0x81'),'attributes':['id',_0x57b9('0x2f'),'createdAt','direction',_0x57b9('0x92'),_0x57b9('0xba')],'include':_0x54165b}];_0xda3a9f[_0x57b9('0xab')]({'model':db[_0x57b9('0x4e')],'as':'Account','attributes':['id',_0x57b9('0x2c')]});_0xda3a9f[_0x57b9('0xab')]({'model':db['User'],'as':_0x57b9('0xbb'),'attributes':['id',_0x57b9('0x8c')]});return db['ChatInteraction']['find']({'where':{'id':_0xeea04e[_0x57b9('0x3e')]['id']},'include':_0xda3a9f})[_0x57b9('0x16')](handleEntityNotFound(_0x70bed7,null))[_0x57b9('0x16')](function(_0x1db8b1){if(_0x1db8b1){var _0x26f3fd=_0x1db8b1[_0x57b9('0xbc')]({'plain':!![]});fs[_0x57b9('0xbd')](_0x1ec351);var _0x4180ae={'channel':'Chat','account':_0x26f3fd[_0x57b9('0xbe')]['name'],'agent':_0x26f3fd[_0x57b9('0xbb')]?_0x26f3fd[_0x57b9('0xbb')][_0x57b9('0x8c')]:_0x57b9('0xbf'),'createdAt':moment(_0x26f3fd[_0x57b9('0x8f')])['format'](_0x57b9('0xa6'))[_0x57b9('0xb3')](),'closedAt':_0x26f3fd[_0x57b9('0x6a')]?moment(_0x26f3fd[_0x57b9('0xc0')])['format'](_0x57b9('0xa6'))['toString']():'','disposition':_0x26f3fd['disposition'],'chatInfo':{'browser':_0x26f3fd['browserName'],'os':_0x26f3fd[_0x57b9('0xc1')],'referer':_0x26f3fd[_0x57b9('0xc2')],'customerIp':_0x26f3fd[_0x57b9('0xc3')],'customerPort':_0x26f3fd[_0x57b9('0xc4')]?_0x26f3fd[_0x57b9('0xc4')]:_0x57b9('0xbf')},'messages':_(_0x26f3fd['Messages'])['tail']()[_0x57b9('0xa3')]({'secret':![]})[_0x57b9('0x35')](function(_0x55009d){if(_0x55009d['Attachment']){var _0xbe5ec1=path['join'](_0x192ad0,_0x55009d[_0x57b9('0x74')][_0x57b9('0x6f')]);if(fs[_0x57b9('0xc5')](_0xbe5ec1)){fs['createReadStream'](_0xbe5ec1)[_0x57b9('0xc6')](fs['createWriteStream'](path[_0x57b9('0x75')](_0x1ec351,_0x55009d[_0x57b9('0x74')]['basename'])));}}return{'date':moment(_0x55009d['createdAt'])[_0x57b9('0x7d')](_0x57b9('0xa6'))[_0x57b9('0xb3')](),'sender':_0x55009d[_0x57b9('0x91')]===_0x57b9('0x62')?_0x55009d[_0x57b9('0x82')]?_0x55009d['User'][_0x57b9('0x8c')]:_0x57b9('0x86'):_0x55009d[_0x57b9('0x66')][_0x57b9('0xb8')]+(_0x55009d[_0x57b9('0x66')][_0x57b9('0xc7')]?'\x20'+_0x55009d[_0x57b9('0x66')][_0x57b9('0xc7')]:''),'body':_0x55009d['Attachment']?_0x55009d[_0x57b9('0x74')][_0x57b9('0x6f')]:_0x55009d['body'],'direction':_0x55009d[_0x57b9('0x91')]===_0x57b9('0x62')?'A':'C','secret':_0x55009d[_0x57b9('0x92')],'read':_0x55009d[_0x57b9('0xba')],'attachment':_0x55009d[_0x57b9('0x74')]};})['value']()};return ejs[_0x57b9('0xc8')](path['join'](config[_0x57b9('0x76')],_0x57b9('0xb6'),'views','downloadInteraction.ejs'),{'interaction':_0x4180ae})['then'](function(_0x16ddcf){var _0x523af6=path[_0x57b9('0x75')](_0x1ec351,_0x57b9('0xc9')+_0x26f3fd['id']+'-'+_0x5d2548+_0x57b9('0xca'));var _0x5cfcbb={'path':_0x523af6,'channel':_0x57b9('0xcb'),'interactionId':_0x26f3fd['id']};return pdf[_0x57b9('0xcc')](_0x16ddcf,_0x5cfcbb);})[_0x57b9('0x16')](function(){return new Promise(function(_0xf0eaf7,_0x441de8){zipdir(_0x1ec351,{'saveTo':_0x287b24},function(_0x1e33f3,_0x3a5577){if(_0x1e33f3)return _0x441de8(_0x1e33f3);return _0xf0eaf7(_0x3a5577);});})[_0x57b9('0x16')](function(){return new BPromise(function(_0x1f2e02,_0x30ac50){rimraf(_0x1ec351,function(_0x211f1b){if(_0x211f1b)_0x30ac50(_0x211f1b);return _0x1f2e02();});});})[_0x57b9('0x16')](function(){return _0x70bed7['download'](_0x287b24,_0x15778f,function(_0x37d42f){if(_0x37d42f){logger[_0x57b9('0x1c')](_0x57b9('0xcd'),_0x37d42f);}else{fs[_0x57b9('0xce')](_0x287b24);}});});});}else{return _0x70bed7[_0x57b9('0x22')](0xc8);}})[_0x57b9('0x21')](handleError(_0x70bed7,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index b2545cf..26379e0 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 _0x7b43=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x42b030,_0x252cb6){var _0x112303=function(_0x261838){while(--_0x261838){_0x42b030['push'](_0x42b030['shift']());}};_0x112303(++_0x252cb6);}(_0x7b43,0x1ea));var _0x37b4=function(_0xf0884,_0x436054){_0xf0884=_0xf0884-0x0;var _0x1be9a8=_0x7b43[_0xf0884];return _0x1be9a8;};'use strict';var EventEmitter=require(_0x37b4('0x0'));var ChatInteraction=require(_0x37b4('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x37b4('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x37b4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x37b4('0x3'),'afterDestroy':_0x37b4('0x4')};function emitEvent(_0x2167b2){return function(_0x513005,_0x4b08b7,_0x5767e2){_0x513005[_0x37b4('0x5')]({'attributes':['id'],'raw':!![]})[_0x37b4('0x6')](function(_0x3f238f){_0x513005[_0x37b4('0x7')](_0x37b4('0x8'),_0x3f238f[_0x37b4('0x9')](function(_0x5b2ce4){return{'id':_0x5b2ce4['id']};}));return ChatMessage[_0x37b4('0xa')]({'where':{'ChatInteractionId':_0x513005['id'],'direction':'in','read':![]},'raw':!![]});})[_0x37b4('0x6')](function(_0x2e2e1e){_0x513005['setDataValue'](_0x37b4('0xb'),_0x2e2e1e[_0x37b4('0xc')]);ChatInteractionEvents['emit'](_0x2167b2+':'+_0x513005['id'],_0x513005);ChatInteractionEvents[_0x37b4('0xd')](_0x2167b2,_0x513005);_0x5767e2(null);})[_0x37b4('0xe')](_0x5767e2(null));};}for(var e in events){if(events[_0x37b4('0xf')](e)){var event=events[e];ChatInteraction[_0x37b4('0x10')](e,emitEvent(event));}}module[_0x37b4('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x1948=['update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x1948,0x17a));var _0x8194=function(_0xb7334f,_0x1daeef){_0xb7334f=_0xb7334f-0x0;var _0x20b2ae=_0x1948[_0xb7334f];return _0x20b2ae;};'use strict';var EventEmitter=require(_0x8194('0x0'));var ChatInteraction=require(_0x8194('0x1'))['db'][_0x8194('0x2')];var ChatMessage=require(_0x8194('0x1'))['db'][_0x8194('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8194('0x4')](0x0);var events={'afterCreate':_0x8194('0x5'),'afterUpdate':_0x8194('0x6'),'afterDestroy':_0x8194('0x7')};function emitEvent(_0x4660bc){return function(_0xeef6eb,_0x5980e2,_0x30236b){_0xeef6eb[_0x8194('0x8')]({'attributes':['id'],'raw':!![]})[_0x8194('0x9')](function(_0x2b95cf){_0xeef6eb[_0x8194('0xa')](_0x8194('0xb'),_0x2b95cf[_0x8194('0xc')](function(_0x355a25){return{'id':_0x355a25['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xeef6eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8194('0x9')](function(_0x489a41){_0xeef6eb['setDataValue'](_0x8194('0xd'),_0x489a41['length']);ChatInteractionEvents['emit'](_0x4660bc+':'+_0xeef6eb['id'],_0xeef6eb);ChatInteractionEvents[_0x8194('0xe')](_0x4660bc,_0xeef6eb);_0x30236b(null);})[_0x8194('0xf')](_0x30236b(null));};}for(var e in events){if(events['hasOwnProperty'](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 ac49887..e8c63c5 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 _0xe971=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe971,0x197));var _0x1e97=function(_0x1eb357,_0x1d140a){_0x1eb357=_0x1eb357-0x0;var _0xf94da=_0xe971[_0x1eb357];return _0xf94da;};'use strict';var _=require('lodash');var util=require(_0x1e97('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1e97('0x1'));var BPromise=require(_0x1e97('0x2'));var rp=require(_0x1e97('0x3'));var fs=require('fs');var path=require(_0x1e97('0x4'));var rimraf=require(_0x1e97('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e97('0x6'));module[_0x1e97('0x7')]=function(_0x39a150,_0x4fc255){return _0x39a150[_0x1e97('0x8')](_0x1e97('0x9'),attributes,{'tableName':_0x1e97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e1e6e,_0x4fb987,_0x202c32){if(_0x4e1e6e['changed'](_0x1e97('0xb'))){_0x4e1e6e['closedAt']=moment()[_0x1e97('0xc')](_0x1e97('0xd'));}_0x202c32(null,_0x4e1e6e);}},'charset':'utf8mb4','collate':_0x1e97('0xe')});}; \ No newline at end of file +var _0x5206=['chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x5206,0xb9));var _0x6520=function(_0x368b57,_0x4a1b39){_0x368b57=_0x368b57-0x0;var _0x4e480c=_0x5206[_0x368b57];return _0x4e480c;};'use strict';var _=require(_0x6520('0x0'));var util=require(_0x6520('0x1'));var logger=require(_0x6520('0x2'))(_0x6520('0x3'));var moment=require(_0x6520('0x4'));var BPromise=require(_0x6520('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6520('0x6'));var rimraf=require(_0x6520('0x7'));var config=require(_0x6520('0x8'));var attributes=require(_0x6520('0x9'));module[_0x6520('0xa')]=function(_0x2a52d3,_0x400f72){return _0x2a52d3['define']('ChatInteraction',attributes,{'tableName':_0x6520('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x546d7d,_0xdc74bd,_0xc998e){if(_0x546d7d['changed'](_0x6520('0xc'))){_0x546d7d['closedAt']=moment()['format'](_0x6520('0xd'));}_0xc998e(null,_0x546d7d);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e78de79..695ad26 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 _0x0b76=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find'];(function(_0x28689b,_0x2cbbcf){var _0x104f1c=function(_0x25279a){while(--_0x25279a){_0x28689b['push'](_0x28689b['shift']());}};_0x104f1c(++_0x2cbbcf);}(_0x0b76,0x7c));var _0x60b7=function(_0x645a1f,_0x1443fe){_0x645a1f=_0x645a1f-0x0;var _0xb3e120=_0x0b76[_0x645a1f];return _0xb3e120;};'use strict';var _=require(_0x60b7('0x0'));var util=require(_0x60b7('0x1'));var moment=require(_0x60b7('0x2'));var BPromise=require(_0x60b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x60b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x60b7('0x6'));var client=jayson[_0x60b7('0x7')][_0x60b7('0x8')]({'port':0x232a});config[_0x60b7('0x9')]=_[_0x60b7('0xa')](config[_0x60b7('0x9')],{'host':_0x60b7('0xb'),'port':0x18eb});var socket=require(_0x60b7('0xc'))(new Redis(config[_0x60b7('0x9')]));require('./chatInteraction.socket')[_0x60b7('0xd')](socket);function respondWithRpcPromise(_0x5093fc,_0x3b91ed,_0x40009c){return new BPromise(function(_0x4896a0,_0x35f93b){return client[_0x60b7('0xe')](_0x5093fc,_0x40009c)[_0x60b7('0xf')](function(_0x544681){logger[_0x60b7('0x10')](_0x60b7('0x11'),_0x3b91ed,_0x60b7('0x12'));logger[_0x60b7('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3b91ed,_0x60b7('0x12'),JSON[_0x60b7('0x14')](_0x544681));if(_0x544681[_0x60b7('0x15')]){if(_0x544681[_0x60b7('0x15')][_0x60b7('0x16')]===0x1f4){logger[_0x60b7('0x15')](_0x60b7('0x11'),_0x3b91ed,_0x544681[_0x60b7('0x15')][_0x60b7('0x17')]);return _0x35f93b(_0x544681[_0x60b7('0x15')][_0x60b7('0x17')]);}logger[_0x60b7('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3b91ed,_0x544681[_0x60b7('0x15')][_0x60b7('0x17')]);return _0x4896a0(_0x544681['error'][_0x60b7('0x17')]);}else{logger[_0x60b7('0x10')](_0x60b7('0x11'),_0x3b91ed,'request\x20sent');_0x4896a0(_0x544681[_0x60b7('0x18')][_0x60b7('0x17')]);}})[_0x60b7('0x19')](function(_0x47f50b){logger[_0x60b7('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3b91ed,_0x47f50b);_0x35f93b(_0x47f50b);});});}exports[_0x60b7('0x1a')]=function(_0x42aeed){var _0x108777=this;return new Promise(function(_0x315d50,_0x56da52){return db[_0x60b7('0x1b')]['update'](_0x42aeed[_0x60b7('0x1c')],{'raw':_0x42aeed[_0x60b7('0x1d')]?_0x42aeed[_0x60b7('0x1d')][_0x60b7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42aeed['options']?_0x42aeed[_0x60b7('0x1d')][_0x60b7('0x1f')]||null:null,'attributes':_0x42aeed[_0x60b7('0x1d')]?_0x42aeed[_0x60b7('0x1d')][_0x60b7('0x20')]||null:null,'limit':_0x42aeed[_0x60b7('0x1d')]?_0x42aeed['options'][_0x60b7('0x21')]||null:null})[_0x60b7('0xf')](function(_0x1db8bf){logger[_0x60b7('0x10')](_0x60b7('0x1a'),_0x42aeed);logger[_0x60b7('0x13')](_0x60b7('0x1a'),_0x42aeed,JSON[_0x60b7('0x14')](_0x1db8bf));_0x315d50(_0x1db8bf);})[_0x60b7('0x19')](function(_0x66cd3c){logger[_0x60b7('0x15')]('UpdateChatInteraction',_0x66cd3c[_0x60b7('0x17')],_0x42aeed);_0x56da52(_0x108777[_0x60b7('0x15')](0x1f4,_0x66cd3c['message']));});});};exports[_0x60b7('0x22')]=function(_0x424c01){return new Promise(function(_0x353619,_0x5ebf01){return db['ChatInteraction'][_0x60b7('0x23')]({'where':_0x424c01[_0x60b7('0x1d')]?_0x424c01['options']['where']||null:null})[_0x60b7('0xf')](function(_0x320748){if(_0x320748){return _0x320748[_0x60b7('0x24')](_0x424c01[_0x60b7('0x1c')][_0x60b7('0x25')],_['omit'](_0x424c01[_0x60b7('0x1c')],['ids','id'])||{});}})[_0x60b7('0x26')](function(_0x50abd6){logger[_0x60b7('0x10')](_0x60b7('0x27'),_0x424c01);logger[_0x60b7('0x13')](_0x60b7('0x27'),_0x424c01,JSON[_0x60b7('0x14')](_0x50abd6));_0x353619(_0x50abd6);})['catch'](function(_0x4abf0b){logger[_0x60b7('0x15')](_0x60b7('0x27'),_0x4abf0b[_0x60b7('0x17')],_0x424c01);_0x5ebf01(_this[_0x60b7('0x15')](0x1f4,_0x4abf0b['message']));});});}; \ No newline at end of file +var _0x2add=['../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34d917,_0x5332ea){var _0x220cf5=function(_0x41b60b){while(--_0x41b60b){_0x34d917['push'](_0x34d917['shift']());}};_0x220cf5(++_0x5332ea);}(_0x2add,0x132));var _0xd2ad=function(_0x313675,_0x23c8b2){_0x313675=_0x313675-0x0;var _0x4051fd=_0x2add[_0x313675];return _0x4051fd;};'use strict';var _=require(_0xd2ad('0x0'));var util=require(_0xd2ad('0x1'));var moment=require(_0xd2ad('0x2'));var BPromise=require(_0xd2ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2ad('0x4'));var db=require(_0xd2ad('0x5'))['db'];var utils=require(_0xd2ad('0x6'));var logger=require(_0xd2ad('0x7'))(_0xd2ad('0x8'));var config=require(_0xd2ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd2ad('0xa')][_0xd2ad('0xb')]({'port':0x232a});config[_0xd2ad('0xc')]=_['defaults'](config[_0xd2ad('0xc')],{'host':_0xd2ad('0xd'),'port':0x18eb});var socket=require(_0xd2ad('0xe'))(new Redis(config[_0xd2ad('0xc')]));require(_0xd2ad('0xf'))[_0xd2ad('0x10')](socket);function respondWithRpcPromise(_0x55d349,_0x40bdf9,_0x43b1fc){return new BPromise(function(_0x14faec,_0x23f4fd){return client[_0xd2ad('0x11')](_0x55d349,_0x43b1fc)[_0xd2ad('0x12')](function(_0x3adf9c){logger[_0xd2ad('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x40bdf9,_0xd2ad('0x14'));logger[_0xd2ad('0x15')](_0xd2ad('0x16'),_0x40bdf9,_0xd2ad('0x14'),JSON[_0xd2ad('0x17')](_0x3adf9c));if(_0x3adf9c[_0xd2ad('0x18')]){if(_0x3adf9c[_0xd2ad('0x18')][_0xd2ad('0x19')]===0x1f4){logger['error'](_0xd2ad('0x1a'),_0x40bdf9,_0x3adf9c[_0xd2ad('0x18')][_0xd2ad('0x1b')]);return _0x23f4fd(_0x3adf9c['error']['message']);}logger[_0xd2ad('0x18')](_0xd2ad('0x1a'),_0x40bdf9,_0x3adf9c['error'][_0xd2ad('0x1b')]);return _0x14faec(_0x3adf9c[_0xd2ad('0x18')][_0xd2ad('0x1b')]);}else{logger[_0xd2ad('0x13')](_0xd2ad('0x1a'),_0x40bdf9,_0xd2ad('0x14'));_0x14faec(_0x3adf9c['result'][_0xd2ad('0x1b')]);}})[_0xd2ad('0x1c')](function(_0x57f325){logger['error'](_0xd2ad('0x1a'),_0x40bdf9,_0x57f325);_0x23f4fd(_0x57f325);});});}exports[_0xd2ad('0x1d')]=function(_0x3d9002){var _0x55a48b=this;return new Promise(function(_0x29b544,_0x4f790c){return db[_0xd2ad('0x1e')][_0xd2ad('0x1f')](_0x3d9002[_0xd2ad('0x20')],{'raw':_0x3d9002[_0xd2ad('0x21')]?_0x3d9002[_0xd2ad('0x21')][_0xd2ad('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d9002['options']?_0x3d9002[_0xd2ad('0x21')][_0xd2ad('0x23')]||null:null,'attributes':_0x3d9002[_0xd2ad('0x21')]?_0x3d9002[_0xd2ad('0x21')][_0xd2ad('0x24')]||null:null,'limit':_0x3d9002[_0xd2ad('0x21')]?_0x3d9002[_0xd2ad('0x21')][_0xd2ad('0x25')]||null:null})['then'](function(_0xd71759){logger['info'](_0xd2ad('0x1d'),_0x3d9002);logger[_0xd2ad('0x15')](_0xd2ad('0x1d'),_0x3d9002,JSON[_0xd2ad('0x17')](_0xd71759));_0x29b544(_0xd71759);})[_0xd2ad('0x1c')](function(_0x2e610c){logger[_0xd2ad('0x18')](_0xd2ad('0x1d'),_0x2e610c[_0xd2ad('0x1b')],_0x3d9002);_0x4f790c(_0x55a48b['error'](0x1f4,_0x2e610c[_0xd2ad('0x1b')]));});});};exports[_0xd2ad('0x26')]=function(_0x31421e){return new Promise(function(_0x9592b1,_0x7e57b6){return db[_0xd2ad('0x1e')][_0xd2ad('0x27')]({'where':_0x31421e[_0xd2ad('0x21')]?_0x31421e[_0xd2ad('0x21')]['where']||null:null})[_0xd2ad('0x12')](function(_0x364f45){if(_0x364f45){return _0x364f45[_0xd2ad('0x28')](_0x31421e[_0xd2ad('0x20')][_0xd2ad('0x29')],_[_0xd2ad('0x2a')](_0x31421e['body'],[_0xd2ad('0x29'),'id'])||{});}})[_0xd2ad('0x2b')](function(_0x5d4a9c){logger[_0xd2ad('0x13')](_0xd2ad('0x2c'),_0x31421e);logger[_0xd2ad('0x15')]('AddTags',_0x31421e,JSON['stringify'](_0x5d4a9c));_0x9592b1(_0x5d4a9c);})['catch'](function(_0x10fc70){logger[_0xd2ad('0x18')](_0xd2ad('0x2c'),_0x10fc70['message'],_0x31421e);_0x7e57b6(_this[_0xd2ad('0x18')](0x1f4,_0x10fc70['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 37c1407..bff6550 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 _0x7056=['chatInteraction:','remove','emit','removeListener','register','length'];(function(_0x518c55,_0x133a5c){var _0x11c781=function(_0x123faf){while(--_0x123faf){_0x518c55['push'](_0x518c55['shift']());}};_0x11c781(++_0x133a5c);}(_0x7056,0x1f3));var _0x6705=function(_0x376761,_0xda556b){_0x376761=_0x376761-0x0;var _0xb883bf=_0x7056[_0x376761];return _0xb883bf;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x6705('0x0'),'update'];function createListener(_0x197327,_0xbd2009){return function(_0x14f496){_0xbd2009[_0x6705('0x1')](_0x197327,_0x14f496);};}function removeListener(_0x2c3ff8,_0x4f22a8){return function(){ChatInteractionEvents[_0x6705('0x2')](_0x2c3ff8,_0x4f22a8);};}exports[_0x6705('0x3')]=function(_0x1fca84){for(var _0x5d898e=0x0,_0x214ae2=events[_0x6705('0x4')];_0x5d898e<_0x214ae2;_0x5d898e++){var _0xa862b1=events[_0x5d898e];var _0xd0ae8e=createListener(_0x6705('0x5')+_0xa862b1,_0x1fca84);ChatInteractionEvents['on'](_0xa862b1,_0xd0ae8e);}}; \ No newline at end of file +var _0x2c8e=['save','remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x5abcef,_0x3d6067){var _0x425b2c=function(_0x356225){while(--_0x356225){_0x5abcef['push'](_0x5abcef['shift']());}};_0x425b2c(++_0x3d6067);}(_0x2c8e,0x1a7));var _0xe2c8=function(_0x2dfbf2,_0x5d3380){_0x2dfbf2=_0x2dfbf2-0x0;var _0x175e67=_0x2c8e[_0x2dfbf2];return _0x175e67;};'use strict';var ChatInteractionEvents=require(_0xe2c8('0x0'));var events=[_0xe2c8('0x1'),_0xe2c8('0x2'),_0xe2c8('0x3')];function createListener(_0x35ebbd,_0x3a0e3a){return function(_0x49758c){_0x3a0e3a[_0xe2c8('0x4')](_0x35ebbd,_0x49758c);};}function removeListener(_0x210587,_0x35c735){return function(){ChatInteractionEvents[_0xe2c8('0x5')](_0x210587,_0x35c735);};}exports['register']=function(_0x42a4e3){for(var _0x257206=0x0,_0x275add=events[_0xe2c8('0x6')];_0x257206<_0x275add;_0x257206++){var _0x3530bb=events[_0x257206];var _0x4eaef1=createListener(_0xe2c8('0x7')+_0x3530bb,_0x42a4e3);ChatInteractionEvents['on'](_0x3530bb,_0x4eaef1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 66caa55..c5e7a3c 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 _0xa7d8=['/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','%s-%s','originalname','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0x44776f,_0x198ac7){var _0x379bbd=function(_0x523ffb){while(--_0x523ffb){_0x44776f['push'](_0x44776f['shift']());}};_0x379bbd(++_0x198ac7);}(_0xa7d8,0xaf));var _0x8a7d=function(_0x521aa7,_0x38a57a){_0x521aa7=_0x521aa7-0x0;var _0x3c0b72=_0xa7d8[_0x521aa7];return _0x3c0b72;};'use strict';var multer=require(_0x8a7d('0x0'));var util=require(_0x8a7d('0x1'));var path=require(_0x8a7d('0x2'));var timeout=require(_0x8a7d('0x3'));var express=require(_0x8a7d('0x4'));var router=express[_0x8a7d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a7d('0x6'));var config=require(_0x8a7d('0x7'));var controller=require(_0x8a7d('0x8'));router['get']('/',auth[_0x8a7d('0x9')](),controller[_0x8a7d('0xa')]);router['get']('/describe',auth[_0x8a7d('0x9')](),controller[_0x8a7d('0xb')]);router[_0x8a7d('0xc')](_0x8a7d('0xd'),auth[_0x8a7d('0xe')](),controller[_0x8a7d('0xf')]);router['get'](_0x8a7d('0x10'),auth[_0x8a7d('0xe')](),controller['attachmentDownload']);router[_0x8a7d('0xc')](_0x8a7d('0x11'),auth[_0x8a7d('0x9')](),controller[_0x8a7d('0x12')]);router['get'](_0x8a7d('0x13'),auth[_0x8a7d('0xe')](),controller[_0x8a7d('0x14')]);router[_0x8a7d('0xc')](_0x8a7d('0x15'),auth['isAuthenticated'](),controller[_0x8a7d('0x16')]);router[_0x8a7d('0x17')]('/',auth[_0x8a7d('0x9')](),controller[_0x8a7d('0x18')]);router[_0x8a7d('0x17')](_0x8a7d('0x19'),auth['isAuthenticated'](),controller[_0x8a7d('0x1a')]);var upload=multer({'storage':multer[_0x8a7d('0x1b')]({'destination':function(_0x248ad6,_0x5c9abe,_0x4a91ec){_0x4a91ec(null,path[_0x8a7d('0x1c')](config['root'],'server/files/attachments/'));},'filename':function(_0x3c9f8a,_0x18f4eb,_0x5b2cb3){_0x5b2cb3(null,util['format'](_0x8a7d('0x1d'),Date['now'](),_0x18f4eb[_0x8a7d('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8a7d('0x17')]('/:id/attachment_upload',upload['single'](_0x8a7d('0x1f')),controller['attachmentUpload']);router[_0x8a7d('0x17')](_0x8a7d('0x11'),auth[_0x8a7d('0xe')](),controller[_0x8a7d('0x20')]);router[_0x8a7d('0x17')](_0x8a7d('0x21'),auth[_0x8a7d('0x9')](),interaction[_0x8a7d('0x22')](_0x8a7d('0x23'),_0x8a7d('0x24')),controller['addTags']);router[_0x8a7d('0x25')](_0x8a7d('0xd'),auth[_0x8a7d('0x9')](),interaction[_0x8a7d('0x22')](_0x8a7d('0x23'),'chatinteraction:update'),controller[_0x8a7d('0x26')]);router[_0x8a7d('0x25')](_0x8a7d('0x27'),controller[_0x8a7d('0x28')]);router['put'](_0x8a7d('0x29'),auth[_0x8a7d('0xe')](),controller[_0x8a7d('0x2a')]);router[_0x8a7d('0x25')](_0x8a7d('0x2b'),controller['close']);router[_0x8a7d('0x2c')]('/:id',auth[_0x8a7d('0x9')](),interaction['tracked'](_0x8a7d('0x23'),_0x8a7d('0x2d')),controller[_0x8a7d('0x2e')]);router[_0x8a7d('0x2c')](_0x8a7d('0x21'),auth[_0x8a7d('0x9')](),controller[_0x8a7d('0x2f')]);module[_0x8a7d('0x30')]=router; \ No newline at end of file +var _0xfd3b=['chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','put'];(function(_0x152c9e,_0x50f7de){var _0x14b99c=function(_0x428e9d){while(--_0x428e9d){_0x152c9e['push'](_0x152c9e['shift']());}};_0x14b99c(++_0x50f7de);}(_0xfd3b,0xff));var _0xbfd3=function(_0x303701,_0x4289fc){_0x303701=_0x303701-0x0;var _0x27e60b=_0xfd3b[_0x303701];return _0x27e60b;};'use strict';var multer=require(_0xbfd3('0x0'));var util=require(_0xbfd3('0x1'));var path=require('path');var timeout=require(_0xbfd3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbfd3('0x3'));var interaction=require(_0xbfd3('0x4'));var config=require(_0xbfd3('0x5'));var controller=require(_0xbfd3('0x6'));router['get']('/',auth[_0xbfd3('0x7')](),controller[_0xbfd3('0x8')]);router[_0xbfd3('0x9')](_0xbfd3('0xa'),auth[_0xbfd3('0x7')](),controller[_0xbfd3('0xb')]);router[_0xbfd3('0x9')](_0xbfd3('0xc'),auth[_0xbfd3('0xd')](),controller[_0xbfd3('0xe')]);router[_0xbfd3('0x9')](_0xbfd3('0xf'),auth[_0xbfd3('0xd')](),controller[_0xbfd3('0x10')]);router['get'](_0xbfd3('0x11'),auth[_0xbfd3('0x7')](),controller[_0xbfd3('0x12')]);router[_0xbfd3('0x9')](_0xbfd3('0x13'),auth[_0xbfd3('0xd')](),controller[_0xbfd3('0x14')]);router[_0xbfd3('0x9')]('/:id/download',auth[_0xbfd3('0x7')](),controller[_0xbfd3('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbfd3('0x16')]);router[_0xbfd3('0x17')](_0xbfd3('0x18'),auth[_0xbfd3('0x7')](),controller[_0xbfd3('0x19')]);var upload=multer({'storage':multer[_0xbfd3('0x1a')]({'destination':function(_0x31ca22,_0x36f76f,_0x18a462){_0x18a462(null,path[_0xbfd3('0x1b')](config[_0xbfd3('0x1c')],_0xbfd3('0x1d')));},'filename':function(_0x3b4b31,_0x5e5d69,_0x4b95ab){_0x4b95ab(null,util['format'](_0xbfd3('0x1e'),Date['now'](),_0x5e5d69['originalname'][_0xbfd3('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbfd3('0x17')](_0xbfd3('0x20'),upload['single'](_0xbfd3('0x21')),controller['attachmentUpload']);router[_0xbfd3('0x17')]('/:id/messages',auth[_0xbfd3('0xd')](),controller[_0xbfd3('0x22')]);router[_0xbfd3('0x17')](_0xbfd3('0x23'),auth[_0xbfd3('0x7')](),interaction[_0xbfd3('0x24')](_0xbfd3('0x25'),'chatinteraction:addtags'),controller['addTags']);router[_0xbfd3('0x26')](_0xbfd3('0xc'),auth[_0xbfd3('0x7')](),interaction['tracked'](_0xbfd3('0x25'),_0xbfd3('0x27')),controller['update']);router[_0xbfd3('0x26')](_0xbfd3('0x28'),controller[_0xbfd3('0x29')]);router[_0xbfd3('0x26')](_0xbfd3('0x2a'),auth[_0xbfd3('0xd')](),controller[_0xbfd3('0x2b')]);router[_0xbfd3('0x26')]('/:id/close',controller[_0xbfd3('0x2c')]);router[_0xbfd3('0x2d')]('/:id',auth['isAuthenticated'](),interaction[_0xbfd3('0x24')](_0xbfd3('0x25'),_0xbfd3('0x2e')),controller[_0xbfd3('0x2f')]);router[_0xbfd3('0x2d')](_0xbfd3('0x23'),auth['isAuthenticated'](),controller['removeTags']);module[_0xbfd3('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 0ffb3cf..c765325 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 _0xd7a2=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3d73bb,_0x533136){var _0x1345f6=function(_0x4d91c3){while(--_0x4d91c3){_0x3d73bb['push'](_0x3d73bb['shift']());}};_0x1345f6(++_0x533136);}(_0xd7a2,0x12d));var _0x2d7a=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0xd7a2[_0x24b852];return _0x180ad2;};'use strict';var Sequelize=require(_0x2d7a('0x0'));module[_0x2d7a('0x1')]={'body':{'type':Sequelize[_0x2d7a('0x2')](_0x2d7a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2d7a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2d7a('0x5')]}}; \ No newline at end of file +var _0x4bcc=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x4bcc,0x1e5));var _0xc4bc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4bcc[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xc4bc('0x0'));module[_0xc4bc('0x1')]={'body':{'type':Sequelize[_0xc4bc('0x2')](_0xc4bc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc4bc('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b9b19e6..8ee7625 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 _0xca78=['socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','describe','get','messages','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','isEmpty','role','length','push','FromId','ToId','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x11b3fd,_0x296963){var _0x27e29c=function(_0x4678ec){while(--_0x4678ec){_0x11b3fd['push'](_0x11b3fd['shift']());}};_0x27e29c(++_0x296963);}(_0xca78,0xbf));var _0x8ca7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xca78[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x8ca7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ca7('0x1'));var jsonpatch=require(_0x8ca7('0x2'));var rp=require(_0x8ca7('0x3'));var moment=require('moment');var BPromise=require(_0x8ca7('0x4'));var Mustache=require(_0x8ca7('0x5'));var util=require(_0x8ca7('0x6'));var path=require(_0x8ca7('0x7'));var sox=require(_0x8ca7('0x8'));var csv=require(_0x8ca7('0x9'));var ejs=require(_0x8ca7('0xa'));var fs=require('fs');var fs_extra=require(_0x8ca7('0xb'));var _=require(_0x8ca7('0xc'));var squel=require(_0x8ca7('0xd'));var crypto=require(_0x8ca7('0xe'));var jsforce=require(_0x8ca7('0xf'));var deskjs=require(_0x8ca7('0x10'));var toCsv=require(_0x8ca7('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8ca7('0x11'));var authService=require(_0x8ca7('0x12'));var qs=require(_0x8ca7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ca7('0x14'));var logger=require(_0x8ca7('0x15'))(_0x8ca7('0x16'));var utils=require(_0x8ca7('0x17'));var config=require(_0x8ca7('0x18'));var licenseUtil=require(_0x8ca7('0x19'));var db=require(_0x8ca7('0x1a'))['db'];config[_0x8ca7('0x1b')]=_['defaults'](config[_0x8ca7('0x1b')],{'host':_0x8ca7('0x1c'),'port':0x18eb});var socket=require(_0x8ca7('0x1d'))(new Redis(config['redis']));require(_0x8ca7('0x1e'))[_0x8ca7('0x1f')](socket);function respondWithStatusCode(_0x4643ef,_0x429872){_0x429872=_0x429872||0xcc;return function(_0x5a669d){if(_0x5a669d){return _0x4643ef[_0x8ca7('0x20')](_0x429872);}return _0x4643ef[_0x8ca7('0x21')](_0x429872)[_0x8ca7('0x22')]();};}function respondWithResult(_0x7c8ffb,_0x5aa2b6){_0x5aa2b6=_0x5aa2b6||0xc8;return function(_0x3cf3b6){if(_0x3cf3b6){return _0x7c8ffb[_0x8ca7('0x21')](_0x5aa2b6)[_0x8ca7('0x23')](_0x3cf3b6);}};}function respondWithFilteredResult(_0x3c3c56,_0x2c7714){return function(_0x31ed37){if(_0x31ed37){var _0x180fab=typeof _0x2c7714[_0x8ca7('0x24')]===_0x8ca7('0x25')&&typeof _0x2c7714[_0x8ca7('0x26')]==='undefined';var _0x171979=_0x31ed37[_0x8ca7('0x27')];var _0x587f58=_0x180fab?0x0:_0x2c7714['offset'];var _0x64e02f=_0x180fab?_0x31ed37[_0x8ca7('0x27')]:_0x2c7714[_0x8ca7('0x24')]+_0x2c7714[_0x8ca7('0x26')];var _0x3d4395;if(_0x64e02f>=_0x171979){_0x64e02f=_0x171979;_0x3d4395=0xc8;}else{_0x3d4395=0xce;}_0x3c3c56[_0x8ca7('0x21')](_0x3d4395);return _0x3c3c56[_0x8ca7('0x28')](_0x8ca7('0x29'),_0x587f58+'-'+_0x64e02f+'/'+_0x171979)[_0x8ca7('0x23')](_0x31ed37);}return null;};}function patchUpdates(_0x39666c){return function(_0x1e4f60){try{jsonpatch[_0x8ca7('0x2a')](_0x1e4f60,_0x39666c,!![]);}catch(_0x2e451c){return BPromise['reject'](_0x2e451c);}return _0x1e4f60['save']();};}function saveUpdates(_0x2e1cb0,_0x43c51e){return function(_0x313da5){if(_0x313da5){return _0x313da5[_0x8ca7('0x2b')](_0x2e1cb0)[_0x8ca7('0x2c')](function(_0x292fe2){return _0x292fe2;});}return null;};}function removeEntity(_0x3d2319,_0x5835b5){return function(_0x3c608a){if(_0x3c608a){return _0x3c608a[_0x8ca7('0x2d')]()[_0x8ca7('0x2c')](function(){_0x3d2319[_0x8ca7('0x21')](0xcc)[_0x8ca7('0x22')]();});}};}function handleEntityNotFound(_0x3f0d8d,_0x6d88da){return function(_0x35eb24){if(!_0x35eb24){_0x3f0d8d[_0x8ca7('0x20')](0x194);}return _0x35eb24;};}function handleError(_0x30e2f4,_0x1bb7bb){_0x1bb7bb=_0x1bb7bb||0x1f4;return function(_0xba8944){logger['error'](_0xba8944[_0x8ca7('0x2e')]);if(_0xba8944[_0x8ca7('0x2f')]){delete _0xba8944[_0x8ca7('0x2f')];}_0x30e2f4['status'](_0x1bb7bb)[_0x8ca7('0x30')](_0xba8944);};}exports[_0x8ca7('0x31')]=function(_0x15f10f,_0x53cc0b){var _0x36112f={},_0x164222={},_0x5dffd6={'count':0x0,'rows':[]};var _0x1d6af5=_['map'](db[_0x8ca7('0x32')][_0x8ca7('0x33')],function(_0x2abd4d){return{'name':_0x2abd4d[_0x8ca7('0x34')],'type':_0x2abd4d[_0x8ca7('0x35')][_0x8ca7('0x36')]};});_0x164222[_0x8ca7('0x37')]=_['map'](_0x1d6af5,_0x8ca7('0x2f'));_0x164222[_0x8ca7('0x38')]=_[_0x8ca7('0x39')](_0x15f10f[_0x8ca7('0x38')]);_0x164222[_0x8ca7('0x3a')]=_[_0x8ca7('0x3b')](_0x164222['model'],_0x164222[_0x8ca7('0x38')]);_0x36112f[_0x8ca7('0x3c')]=_['intersection'](_0x164222[_0x8ca7('0x37')],qs[_0x8ca7('0x3d')](_0x15f10f['query']['fields']));_0x36112f[_0x8ca7('0x3c')]=_0x36112f['attributes']['length']?_0x36112f[_0x8ca7('0x3c')]:_0x164222[_0x8ca7('0x37')];if(!_0x15f10f['query'][_0x8ca7('0x3e')](_0x8ca7('0x3f'))){_0x36112f[_0x8ca7('0x26')]=qs[_0x8ca7('0x26')](_0x15f10f[_0x8ca7('0x38')][_0x8ca7('0x26')]);_0x36112f[_0x8ca7('0x24')]=qs[_0x8ca7('0x24')](_0x15f10f[_0x8ca7('0x38')]['offset']);}_0x36112f[_0x8ca7('0x40')]=qs['sort'](_0x15f10f[_0x8ca7('0x38')][_0x8ca7('0x41')]);_0x36112f[_0x8ca7('0x42')]=qs[_0x8ca7('0x3a')](_[_0x8ca7('0x43')](_0x15f10f[_0x8ca7('0x38')],_0x164222['filters']),_0x1d6af5);if(_0x15f10f['query'][_0x8ca7('0x44')]){_0x36112f['where']=_[_0x8ca7('0x45')](_0x36112f[_0x8ca7('0x42')],{'$or':_[_0x8ca7('0x46')](_0x1d6af5,function(_0x53906f){if(_0x53906f[_0x8ca7('0x35')]!==_0x8ca7('0x47')){var _0x1a2537={};_0x1a2537[_0x53906f[_0x8ca7('0x2f')]]={'$like':'%'+_0x15f10f[_0x8ca7('0x38')][_0x8ca7('0x44')]+'%'};return _0x1a2537;}})});}_0x36112f=_[_0x8ca7('0x45')]({},_0x36112f,_0x15f10f['options']);var _0x10e926={'where':_0x36112f[_0x8ca7('0x42')]};return db[_0x8ca7('0x32')][_0x8ca7('0x27')](_0x10e926)[_0x8ca7('0x2c')](function(_0x164959){_0x5dffd6[_0x8ca7('0x27')]=_0x164959;if(_0x15f10f[_0x8ca7('0x38')][_0x8ca7('0x48')]){_0x36112f[_0x8ca7('0x49')]=[{'all':!![]}];}return db[_0x8ca7('0x32')][_0x8ca7('0x4a')](_0x36112f);})[_0x8ca7('0x2c')](function(_0x925ad9){_0x5dffd6['rows']=_0x925ad9;return _0x5dffd6;})['then'](respondWithFilteredResult(_0x53cc0b,_0x36112f))[_0x8ca7('0x4b')](handleError(_0x53cc0b,null));};exports[_0x8ca7('0x4c')]=function(_0x45d170,_0x1aff88){var _0x4e0591={'raw':!![],'where':{'id':_0x45d170[_0x8ca7('0x4d')]['id']}},_0x2fbdfa={};_0x2fbdfa['model']=_[_0x8ca7('0x39')](db['ChatInternalMessage'][_0x8ca7('0x33')]);_0x2fbdfa['query']=_['keys'](_0x45d170[_0x8ca7('0x38')]);_0x2fbdfa[_0x8ca7('0x3a')]=_['intersection'](_0x2fbdfa[_0x8ca7('0x37')],_0x2fbdfa[_0x8ca7('0x38')]);_0x4e0591[_0x8ca7('0x3c')]=_[_0x8ca7('0x3b')](_0x2fbdfa[_0x8ca7('0x37')],qs[_0x8ca7('0x3d')](_0x45d170['query']['fields']));_0x4e0591[_0x8ca7('0x3c')]=_0x4e0591[_0x8ca7('0x3c')]['length']?_0x4e0591[_0x8ca7('0x3c')]:_0x2fbdfa['model'];if(_0x45d170['query'][_0x8ca7('0x48')]){_0x4e0591['include']=[{'all':!![]}];}_0x4e0591=_[_0x8ca7('0x45')]({},_0x4e0591,_0x45d170['options']);return db['ChatInternalMessage'][_0x8ca7('0x4e')](_0x4e0591)[_0x8ca7('0x2c')](handleEntityNotFound(_0x1aff88,null))[_0x8ca7('0x2c')](respondWithResult(_0x1aff88,null))[_0x8ca7('0x4b')](handleError(_0x1aff88,null));};exports[_0x8ca7('0x4f')]=function(_0x5d6063,_0x2efe62){return db[_0x8ca7('0x32')][_0x8ca7('0x4f')](_0x5d6063[_0x8ca7('0x50')],{})[_0x8ca7('0x2c')](respondWithResult(_0x2efe62,0xc9))[_0x8ca7('0x4b')](handleError(_0x2efe62,null));};exports[_0x8ca7('0x2b')]=function(_0x1e7219,_0x5ce6f4){if(_0x1e7219[_0x8ca7('0x50')]['id']){delete _0x1e7219['body']['id'];}return db[_0x8ca7('0x32')][_0x8ca7('0x4e')]({'where':{'id':_0x1e7219[_0x8ca7('0x4d')]['id']}})[_0x8ca7('0x2c')](handleEntityNotFound(_0x5ce6f4,null))[_0x8ca7('0x2c')](saveUpdates(_0x1e7219['body'],null))[_0x8ca7('0x2c')](respondWithResult(_0x5ce6f4,null))[_0x8ca7('0x4b')](handleError(_0x5ce6f4,null));};exports['destroy']=function(_0xe9e1d3,_0x4ad208){return db[_0x8ca7('0x32')][_0x8ca7('0x4e')]({'where':{'id':_0xe9e1d3[_0x8ca7('0x4d')]['id']}})[_0x8ca7('0x2c')](handleEntityNotFound(_0x4ad208,null))[_0x8ca7('0x2c')](removeEntity(_0x4ad208,null))[_0x8ca7('0x4b')](handleError(_0x4ad208,null));};exports[_0x8ca7('0x51')]=function(_0x26eb9c,_0x5526a4){return db['ChatInternalMessage'][_0x8ca7('0x51')]()['then'](respondWithResult(_0x5526a4,null))[_0x8ca7('0x4b')](handleError(_0x5526a4,null));};function wrapUser(_0x24f6b3){return function(_0x158e96){var _0x38c563=_0x24f6b3[_0x8ca7('0x52')]({'plain':!![]});_0x38c563[_0x8ca7('0x53')]=[];if(_0x158e96){_0x38c563['lastMessageAt']=_0x158e96[_0x8ca7('0x54')];_0x38c563[_0x8ca7('0x55')]=_0x158e96;}else{_0x38c563['lastMessageAt']=moment(0x0)['format'](_0x8ca7('0x56'));_0x38c563[_0x8ca7('0x55')]={};}return _0x38c563;};}exports[_0x8ca7('0x57')]=function(_0x5a6f29,_0x2a6ba5,_0x204b27){var _0x418b05=[];return db[_0x8ca7('0x58')]['findAll']({'where':{'role':[_0x8ca7('0x59'),_0x8ca7('0x5a'),'user']},'attributes':['id',_0x8ca7('0x5b'),_0x8ca7('0x2f'),'role',_0x8ca7('0x5c'),'internal','online',_0x8ca7('0x5d'),'allowmessenger',_0x8ca7('0x5e')],'order':qs['sort'](_0x8ca7('0x5f')),'include':[{'model':db[_0x8ca7('0x60')],'as':_0x8ca7('0x61'),'attributes':['id',_0x8ca7('0x2f'),_0x8ca7('0x35')],'through':{'attributes':[]}}]})['then'](function(_0x2603ec){if(_0x2603ec){var _0x2c526c=_0x5a6f29['user'][_0x8ca7('0x52')]({'plain':!![]});if(!_0x2c526c)throw new Error(_0x8ca7('0x62'));if(_0x2c526c['role']===_0x8ca7('0x63')){return db[_0x8ca7('0x64')][_0x8ca7('0x4e')]({'where':{'name':'Agents','userProfileId':_0x2c526c['userProfileId']},'raw':!![]})[_0x8ca7('0x2c')](function(_0x1ad706){if(_0x1ad706){if(_0x1ad706[_0x8ca7('0x65')]===0x0){return db[_0x8ca7('0x66')][_0x8ca7('0x4a')]({'where':{'sectionId':_0x1ad706['id']},'raw':!![]})[_0x8ca7('0x2c')](function(_0x4761b6){var _0x4beb1e=[];if(_[_0x8ca7('0x67')](_0x4761b6)){_0x4beb1e=_[_0x8ca7('0x44')](_0x2603ec,function(_0x475024){if(_0x475024[_0x8ca7('0x68')]!==_0x8ca7('0x59')){return _0x475024;}});return _0x4beb1e;}else{for(var _0x174929=0x0;_0x174929<_0x2603ec[_0x8ca7('0x69')];_0x174929++){var _0x101c7e=_0x2603ec[_0x174929];if(_0x101c7e['role']===_0x8ca7('0x59')){var _0x1f30d4=_[_0x8ca7('0x4e')](_0x4761b6,function(_0xf65857){return _0xf65857['resourceId']===_0x101c7e['id'];});if(_0x1f30d4)_0x4beb1e['push'](_0x101c7e);}else{_0x4beb1e[_0x8ca7('0x6a')](_0x101c7e);}}return _0x4beb1e;}});}else{return _0x2603ec;}}else{var _0x593b34=_[_0x8ca7('0x44')](_0x2603ec,function(_0x146c53){if(_0x146c53[_0x8ca7('0x68')]!==_0x8ca7('0x59')){return _0x146c53;}});return _0x593b34;}});}else{return _0x2603ec;}}})[_0x8ca7('0x2c')](function(_0x20522d){var _0x3c55f8=[];if(_0x20522d){_0x418b05=_0x20522d;for(var _0x3a4286=0x0;_0x3a4286<_0x20522d[_0x8ca7('0x69')];_0x3a4286+=0x1){_0x418b05[_0x3a4286][_0x8ca7('0x53')]=[];_0x3c55f8[_0x8ca7('0x6a')](db['ChatInternalMessage'][_0x8ca7('0x4e')]({'where':{'FromId':[_0x5a6f29[_0x8ca7('0x63')]['id'],_0x20522d[_0x3a4286]['id']],'ToId':[_0x5a6f29['user']['id'],_0x20522d[_0x3a4286]['id']],'ChatGroupId':null},'attributes':['id',_0x8ca7('0x54'),_0x8ca7('0x6b'),_0x8ca7('0x6c'),'read',_0x8ca7('0x50')],'order':qs[_0x8ca7('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8ca7('0x2c')](wrapUser(_0x20522d[_0x3a4286])));}return BPromise[_0x8ca7('0x6d')](_0x3c55f8);}return[];})[_0x8ca7('0x2c')](function(_0xba5843){return{'rows':_0xba5843,'count':_0xba5843[_0x8ca7('0x69')]};})[_0x8ca7('0x2c')](respondWithResult(_0x2a6ba5,null))[_0x8ca7('0x4b')](handleError(_0x2a6ba5,null));}; \ No newline at end of file +var _0x7b33=['User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','-createdAt','eml-format','rimraf','zip-dir','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','ChatInternalMessage','include','rows','catch','show','params','keys','create','body','find','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x7b33,0x16e));var _0x37b3=function(_0x50ea94,_0x4cc586){_0x50ea94=_0x50ea94-0x0;var _0x5ca25e=_0x7b33[_0x50ea94];return _0x5ca25e;};'use strict';var emlformat=require(_0x37b3('0x0'));var rimraf=require(_0x37b3('0x1'));var zipdir=require(_0x37b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x37b3('0x3'));var BPromise=require(_0x37b3('0x4'));var Mustache=require(_0x37b3('0x5'));var util=require(_0x37b3('0x6'));var path=require(_0x37b3('0x7'));var sox=require(_0x37b3('0x8'));var csv=require(_0x37b3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37b3('0xa'));var _=require(_0x37b3('0xb'));var squel=require(_0x37b3('0xc'));var crypto=require('crypto');var jsforce=require(_0x37b3('0xd'));var deskjs=require(_0x37b3('0xe'));var toCsv=require(_0x37b3('0x9'));var querystring=require(_0x37b3('0xf'));var Papa=require(_0x37b3('0x10'));var Redis=require(_0x37b3('0x11'));var authService=require(_0x37b3('0x12'));var qs=require(_0x37b3('0x13'));var as=require(_0x37b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37b3('0x15'))(_0x37b3('0x16'));var utils=require(_0x37b3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x37b3('0x18'));var db=require(_0x37b3('0x19'))['db'];config[_0x37b3('0x1a')]=_[_0x37b3('0x1b')](config['redis'],{'host':_0x37b3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37b3('0x1a')]));require('./chatInternalMessage.socket')[_0x37b3('0x1d')](socket);function respondWithStatusCode(_0xaf18c7,_0x5573be){_0x5573be=_0x5573be||0xcc;return function(_0x3bda54){if(_0x3bda54){return _0xaf18c7[_0x37b3('0x1e')](_0x5573be);}return _0xaf18c7[_0x37b3('0x1f')](_0x5573be)[_0x37b3('0x20')]();};}function respondWithResult(_0x14d6bb,_0x10a102){_0x10a102=_0x10a102||0xc8;return function(_0x2d87ed){if(_0x2d87ed){return _0x14d6bb[_0x37b3('0x1f')](_0x10a102)[_0x37b3('0x21')](_0x2d87ed);}};}function respondWithFilteredResult(_0x7ffb72,_0x14e4e2){return function(_0x592a97){if(_0x592a97){var _0x278c2a=typeof _0x14e4e2['offset']==='undefined'&&typeof _0x14e4e2[_0x37b3('0x22')]===_0x37b3('0x23');var _0x233376=_0x592a97['count'];var _0x635776=_0x278c2a?0x0:_0x14e4e2[_0x37b3('0x24')];var _0x40ed82=_0x278c2a?_0x592a97[_0x37b3('0x25')]:_0x14e4e2[_0x37b3('0x24')]+_0x14e4e2[_0x37b3('0x22')];var _0xbcbcca;if(_0x40ed82>=_0x233376){_0x40ed82=_0x233376;_0xbcbcca=0xc8;}else{_0xbcbcca=0xce;}_0x7ffb72[_0x37b3('0x1f')](_0xbcbcca);return _0x7ffb72[_0x37b3('0x26')](_0x37b3('0x27'),_0x635776+'-'+_0x40ed82+'/'+_0x233376)[_0x37b3('0x21')](_0x592a97);}return null;};}function patchUpdates(_0x44f73f){return function(_0x34683f){try{jsonpatch[_0x37b3('0x28')](_0x34683f,_0x44f73f,!![]);}catch(_0x179503){return BPromise[_0x37b3('0x29')](_0x179503);}return _0x34683f[_0x37b3('0x2a')]();};}function saveUpdates(_0x53d7ab,_0x3eccc2){return function(_0x1b8b59){if(_0x1b8b59){return _0x1b8b59[_0x37b3('0x2b')](_0x53d7ab)[_0x37b3('0x2c')](function(_0x5218a5){return _0x5218a5;});}return null;};}function removeEntity(_0x2c5f39,_0x434335){return function(_0x54bf19){if(_0x54bf19){return _0x54bf19[_0x37b3('0x2d')]()[_0x37b3('0x2c')](function(){_0x2c5f39[_0x37b3('0x1f')](0xcc)[_0x37b3('0x20')]();});}};}function handleEntityNotFound(_0x30e11f,_0x571195){return function(_0x4efb02){if(!_0x4efb02){_0x30e11f[_0x37b3('0x1e')](0x194);}return _0x4efb02;};}function handleError(_0x43bfc8,_0x5c9126){_0x5c9126=_0x5c9126||0x1f4;return function(_0x4a7d44){logger[_0x37b3('0x2e')](_0x4a7d44[_0x37b3('0x2f')]);if(_0x4a7d44[_0x37b3('0x30')]){delete _0x4a7d44[_0x37b3('0x30')];}_0x43bfc8[_0x37b3('0x1f')](_0x5c9126)[_0x37b3('0x31')](_0x4a7d44);};}exports['index']=function(_0x806ffb,_0x270fdd){var _0x30fa3e={},_0x327d5e={},_0x2a837a={'count':0x0,'rows':[]};var _0x470366=_[_0x37b3('0x32')](db['ChatInternalMessage'][_0x37b3('0x33')],function(_0x1b4936){return{'name':_0x1b4936[_0x37b3('0x34')],'type':_0x1b4936['type']['key']};});_0x327d5e['model']=_[_0x37b3('0x32')](_0x470366,_0x37b3('0x30'));_0x327d5e[_0x37b3('0x35')]=_['keys'](_0x806ffb[_0x37b3('0x35')]);_0x327d5e[_0x37b3('0x36')]=_[_0x37b3('0x37')](_0x327d5e['model'],_0x327d5e[_0x37b3('0x35')]);_0x30fa3e[_0x37b3('0x38')]=_['intersection'](_0x327d5e[_0x37b3('0x39')],qs['fields'](_0x806ffb[_0x37b3('0x35')][_0x37b3('0x3a')]));_0x30fa3e[_0x37b3('0x38')]=_0x30fa3e[_0x37b3('0x38')][_0x37b3('0x3b')]?_0x30fa3e[_0x37b3('0x38')]:_0x327d5e[_0x37b3('0x39')];if(!_0x806ffb[_0x37b3('0x35')][_0x37b3('0x3c')]('nolimit')){_0x30fa3e[_0x37b3('0x22')]=qs[_0x37b3('0x22')](_0x806ffb[_0x37b3('0x35')]['limit']);_0x30fa3e['offset']=qs[_0x37b3('0x24')](_0x806ffb[_0x37b3('0x35')]['offset']);}_0x30fa3e[_0x37b3('0x3d')]=qs[_0x37b3('0x3e')](_0x806ffb[_0x37b3('0x35')][_0x37b3('0x3e')]);_0x30fa3e[_0x37b3('0x3f')]=qs[_0x37b3('0x36')](_[_0x37b3('0x40')](_0x806ffb[_0x37b3('0x35')],_0x327d5e[_0x37b3('0x36')]),_0x470366);if(_0x806ffb[_0x37b3('0x35')]['filter']){_0x30fa3e['where']=_[_0x37b3('0x41')](_0x30fa3e[_0x37b3('0x3f')],{'$or':_[_0x37b3('0x32')](_0x470366,function(_0x3dcedf){if(_0x3dcedf[_0x37b3('0x42')]!=='VIRTUAL'){var _0x3feca7={};_0x3feca7[_0x3dcedf[_0x37b3('0x30')]]={'$like':'%'+_0x806ffb[_0x37b3('0x35')][_0x37b3('0x43')]+'%'};return _0x3feca7;}})});}_0x30fa3e=_[_0x37b3('0x41')]({},_0x30fa3e,_0x806ffb[_0x37b3('0x44')]);var _0x4e9585={'where':_0x30fa3e[_0x37b3('0x3f')]};return db[_0x37b3('0x45')]['count'](_0x4e9585)[_0x37b3('0x2c')](function(_0x418d01){_0x2a837a['count']=_0x418d01;if(_0x806ffb[_0x37b3('0x35')]['includeAll']){_0x30fa3e[_0x37b3('0x46')]=[{'all':!![]}];}return db[_0x37b3('0x45')]['findAll'](_0x30fa3e);})[_0x37b3('0x2c')](function(_0x431304){_0x2a837a[_0x37b3('0x47')]=_0x431304;return _0x2a837a;})[_0x37b3('0x2c')](respondWithFilteredResult(_0x270fdd,_0x30fa3e))[_0x37b3('0x48')](handleError(_0x270fdd,null));};exports[_0x37b3('0x49')]=function(_0x58a3f2,_0x2204ce){var _0x508230={'raw':!![],'where':{'id':_0x58a3f2[_0x37b3('0x4a')]['id']}},_0x4df74d={};_0x4df74d[_0x37b3('0x39')]=_[_0x37b3('0x4b')](db[_0x37b3('0x45')][_0x37b3('0x33')]);_0x4df74d[_0x37b3('0x35')]=_[_0x37b3('0x4b')](_0x58a3f2[_0x37b3('0x35')]);_0x4df74d[_0x37b3('0x36')]=_[_0x37b3('0x37')](_0x4df74d[_0x37b3('0x39')],_0x4df74d[_0x37b3('0x35')]);_0x508230[_0x37b3('0x38')]=_[_0x37b3('0x37')](_0x4df74d[_0x37b3('0x39')],qs['fields'](_0x58a3f2[_0x37b3('0x35')]['fields']));_0x508230[_0x37b3('0x38')]=_0x508230[_0x37b3('0x38')][_0x37b3('0x3b')]?_0x508230[_0x37b3('0x38')]:_0x4df74d[_0x37b3('0x39')];if(_0x58a3f2[_0x37b3('0x35')]['includeAll']){_0x508230['include']=[{'all':!![]}];}_0x508230=_[_0x37b3('0x41')]({},_0x508230,_0x58a3f2['options']);return db[_0x37b3('0x45')]['find'](_0x508230)[_0x37b3('0x2c')](handleEntityNotFound(_0x2204ce,null))[_0x37b3('0x2c')](respondWithResult(_0x2204ce,null))['catch'](handleError(_0x2204ce,null));};exports[_0x37b3('0x4c')]=function(_0x14f05b,_0x31ad34){return db['ChatInternalMessage'][_0x37b3('0x4c')](_0x14f05b[_0x37b3('0x4d')],{})[_0x37b3('0x2c')](respondWithResult(_0x31ad34,0xc9))[_0x37b3('0x48')](handleError(_0x31ad34,null));};exports['update']=function(_0xc07757,_0x1ea3fe){if(_0xc07757[_0x37b3('0x4d')]['id']){delete _0xc07757['body']['id'];}return db[_0x37b3('0x45')][_0x37b3('0x4e')]({'where':{'id':_0xc07757[_0x37b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ea3fe,null))['then'](saveUpdates(_0xc07757[_0x37b3('0x4d')],null))[_0x37b3('0x2c')](respondWithResult(_0x1ea3fe,null))[_0x37b3('0x48')](handleError(_0x1ea3fe,null));};exports[_0x37b3('0x2d')]=function(_0x52bdd7,_0x5b5d34){return db[_0x37b3('0x45')][_0x37b3('0x4e')]({'where':{'id':_0x52bdd7[_0x37b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b5d34,null))[_0x37b3('0x2c')](removeEntity(_0x5b5d34,null))['catch'](handleError(_0x5b5d34,null));};exports['describe']=function(_0x3b6453,_0x30eed8){return db[_0x37b3('0x45')]['describe']()[_0x37b3('0x2c')](respondWithResult(_0x30eed8,null))[_0x37b3('0x48')](handleError(_0x30eed8,null));};function wrapUser(_0x33b9ab){return function(_0x5013bb){var _0x444e14=_0x33b9ab[_0x37b3('0x4f')]({'plain':!![]});_0x444e14['messages']=[];if(_0x5013bb){_0x444e14[_0x37b3('0x50')]=_0x5013bb[_0x37b3('0x51')];_0x444e14[_0x37b3('0x52')]=_0x5013bb;}else{_0x444e14['lastMessageAt']=moment(0x0)[_0x37b3('0x53')](_0x37b3('0x54'));_0x444e14['lastMessage']={};}return _0x444e14;};}exports[_0x37b3('0x55')]=function(_0xfa622,_0x5cafa4,_0x2633f6){var _0x2ccbb2=[];return db[_0x37b3('0x56')][_0x37b3('0x57')]({'where':{'role':[_0x37b3('0x58'),_0x37b3('0x59'),_0x37b3('0x5a')]},'attributes':['id',_0x37b3('0x5b'),'name',_0x37b3('0x5c'),_0x37b3('0x5d'),_0x37b3('0x5e'),_0x37b3('0x5f'),_0x37b3('0x60'),_0x37b3('0x61'),_0x37b3('0x62')],'order':qs[_0x37b3('0x3e')](_0x37b3('0x63')),'include':[{'model':db[_0x37b3('0x64')],'as':_0x37b3('0x65'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x3b0457){if(_0x3b0457){var _0x4bf146=_0xfa622[_0x37b3('0x5a')][_0x37b3('0x4f')]({'plain':!![]});if(!_0x4bf146)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bf146[_0x37b3('0x5c')]==='user'){return db[_0x37b3('0x66')]['find']({'where':{'name':_0x37b3('0x67'),'userProfileId':_0x4bf146[_0x37b3('0x68')]},'raw':!![]})[_0x37b3('0x2c')](function(_0x33152c){if(_0x33152c){if(_0x33152c[_0x37b3('0x69')]===0x0){return db[_0x37b3('0x6a')][_0x37b3('0x57')]({'where':{'sectionId':_0x33152c['id']},'raw':!![]})['then'](function(_0x1da0db){var _0x18040c=[];if(_[_0x37b3('0x6b')](_0x1da0db)){_0x18040c=_['filter'](_0x3b0457,function(_0x32f710){if(_0x32f710[_0x37b3('0x5c')]!=='agent'){return _0x32f710;}});return _0x18040c;}else{for(var _0x1e0e30=0x0;_0x1e0e30<_0x3b0457[_0x37b3('0x3b')];_0x1e0e30++){var _0x4650b7=_0x3b0457[_0x1e0e30];if(_0x4650b7['role']===_0x37b3('0x58')){var _0x5951ad=_[_0x37b3('0x4e')](_0x1da0db,function(_0x279c11){return _0x279c11[_0x37b3('0x6c')]===_0x4650b7['id'];});if(_0x5951ad)_0x18040c[_0x37b3('0x6d')](_0x4650b7);}else{_0x18040c['push'](_0x4650b7);}}return _0x18040c;}});}else{return _0x3b0457;}}else{var _0x45070f=_['filter'](_0x3b0457,function(_0x1e6dc8){if(_0x1e6dc8[_0x37b3('0x5c')]!==_0x37b3('0x58')){return _0x1e6dc8;}});return _0x45070f;}});}else{return _0x3b0457;}}})[_0x37b3('0x2c')](function(_0x46073c){var _0x38dfc5=[];if(_0x46073c){_0x2ccbb2=_0x46073c;for(var _0x4de8e4=0x0;_0x4de8e4<_0x46073c[_0x37b3('0x3b')];_0x4de8e4+=0x1){_0x2ccbb2[_0x4de8e4][_0x37b3('0x6e')]=[];_0x38dfc5[_0x37b3('0x6d')](db[_0x37b3('0x45')][_0x37b3('0x4e')]({'where':{'FromId':[_0xfa622[_0x37b3('0x5a')]['id'],_0x46073c[_0x4de8e4]['id']],'ToId':[_0xfa622[_0x37b3('0x5a')]['id'],_0x46073c[_0x4de8e4]['id']],'ChatGroupId':null},'attributes':['id',_0x37b3('0x51'),_0x37b3('0x6f'),'ToId','read',_0x37b3('0x4d')],'order':qs[_0x37b3('0x3e')](_0x37b3('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x37b3('0x2c')](wrapUser(_0x46073c[_0x4de8e4])));}return BPromise['all'](_0x38dfc5);}return[];})['then'](function(_0x499bbb){return{'rows':_0x499bbb,'count':_0x499bbb[_0x37b3('0x3b')]};})[_0x37b3('0x2c')](respondWithResult(_0x5cafa4,null))[_0x37b3('0x48')](handleError(_0x5cafa4,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 099d88e..1817e30 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 _0x13c4=['exports','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x13c4,0x121));var _0x413c=function(_0x43c92a,_0x1c4901){_0x43c92a=_0x43c92a-0x0;var _0x5ebfe9=_0x13c4[_0x43c92a];return _0x5ebfe9;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x413c('0x0'))['db'][_0x413c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x413c('0x2'),'afterUpdate':_0x413c('0x3'),'afterDestroy':_0x413c('0x4')};function emitEvent(_0x194db4){return function(_0x5492e4,_0xd3c2f2,_0x124738){ChatInternalMessageEvents[_0x413c('0x5')](_0x194db4+':'+_0x5492e4['id'],_0x5492e4);ChatInternalMessageEvents[_0x413c('0x5')](_0x194db4,_0x5492e4);_0x124738(null);};}for(var e in events){if(events[_0x413c('0x6')](e)){var event=events[e];ChatInternalMessage[_0x413c('0x7')](e,emitEvent(event));}}module[_0x413c('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x4477=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x448c2e,_0x3d1d3a){var _0x68f4d4=function(_0x3ed7c0){while(--_0x3ed7c0){_0x448c2e['push'](_0x448c2e['shift']());}};_0x68f4d4(++_0x3d1d3a);}(_0x4477,0xb1));var _0x7447=function(_0x7507b3,_0x4cad44){_0x7507b3=_0x7507b3-0x0;var _0xad7bd3=_0x4477[_0x7507b3];return _0xad7bd3;};'use strict';var EventEmitter=require(_0x7447('0x0'));var ChatInternalMessage=require(_0x7447('0x1'))['db'][_0x7447('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7447('0x3')](0x0);var events={'afterCreate':_0x7447('0x4'),'afterUpdate':_0x7447('0x5'),'afterDestroy':_0x7447('0x6')};function emitEvent(_0x2c0145){return function(_0x170034,_0x4cb560,_0xd1146c){ChatInternalMessageEvents[_0x7447('0x7')](_0x2c0145+':'+_0x170034['id'],_0x170034);ChatInternalMessageEvents[_0x7447('0x7')](_0x2c0145,_0x170034);_0xd1146c(null);};}for(var e in events){if(events[_0x7447('0x8')](e)){var event=events[e];ChatInternalMessage[_0x7447('0x9')](e,emitEvent(event));}}module[_0x7447('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2fe02c7..455770c 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 _0x29a3=['request-promise','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1a9b87,_0x4b9987){var _0x3e5a50=function(_0x488ffa){while(--_0x488ffa){_0x1a9b87['push'](_0x1a9b87['shift']());}};_0x3e5a50(++_0x4b9987);}(_0x29a3,0xa3));var _0x329a=function(_0x18c58e,_0x12e86e){_0x18c58e=_0x18c58e-0x0;var _0x5ec2e9=_0x29a3[_0x18c58e];return _0x5ec2e9;};'use strict';var _=require(_0x329a('0x0'));var util=require(_0x329a('0x1'));var logger=require(_0x329a('0x2'))(_0x329a('0x3'));var moment=require(_0x329a('0x4'));var BPromise=require('bluebird');var rp=require(_0x329a('0x5'));var fs=require('fs');var path=require(_0x329a('0x6'));var rimraf=require(_0x329a('0x7'));var config=require('../../config/environment');var attributes=require(_0x329a('0x8'));module[_0x329a('0x9')]=function(_0x146b18,_0x445b99){return _0x146b18['define'](_0x329a('0xa'),attributes,{'tableName':_0x329a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x329a('0xc'),'collate':_0x329a('0xd')});}; \ No newline at end of file +var _0x2edc=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x2edc,0x83));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2ed('0x0'));var util=require(_0xc2ed('0x1'));var logger=require(_0xc2ed('0x2'))(_0xc2ed('0x3'));var moment=require(_0xc2ed('0x4'));var BPromise=require(_0xc2ed('0x5'));var rp=require(_0xc2ed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2ed('0x7'));var config=require('../../config/environment');var attributes=require(_0xc2ed('0x8'));module[_0xc2ed('0x9')]=function(_0x53ee81,_0x25401b){return _0x53ee81[_0xc2ed('0xa')](_0xc2ed('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2ed('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f3a2b5f..8c623f0 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 _0x1cc7=['result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1cc7,0x15a));var _0x71cc=function(_0x26396e,_0x39b837){_0x26396e=_0x26396e-0x0;var _0x1c237b=_0x1cc7[_0x26396e];return _0x1c237b;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var moment=require(_0x71cc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71cc('0x3'))['db'];var utils=require(_0x71cc('0x4'));var logger=require(_0x71cc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71cc('0x6')]['http']({'port':0x232a});config[_0x71cc('0x7')]=_[_0x71cc('0x8')](config[_0x71cc('0x7')],{'host':_0x71cc('0x9'),'port':0x18eb});var socket=require(_0x71cc('0xa'))(new Redis(config['redis']));require(_0x71cc('0xb'))[_0x71cc('0xc')](socket);function respondWithRpcPromise(_0x47759a,_0x5ae8e7,_0x554044){return new BPromise(function(_0x50a7b7,_0x4b7514){return client[_0x71cc('0xd')](_0x47759a,_0x554044)[_0x71cc('0xe')](function(_0x37e34b){logger['info'](_0x71cc('0xf'),_0x5ae8e7,'request\x20sent');logger[_0x71cc('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5ae8e7,_0x71cc('0x11'),JSON['stringify'](_0x37e34b));if(_0x37e34b[_0x71cc('0x12')]){if(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x13')]===0x1f4){logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b['error'][_0x71cc('0x14')]);return _0x4b7514(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);}logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);return _0x50a7b7(_0x37e34b['error'][_0x71cc('0x14')]);}else{logger[_0x71cc('0x15')](_0x71cc('0xf'),_0x5ae8e7,_0x71cc('0x11'));_0x50a7b7(_0x37e34b[_0x71cc('0x16')][_0x71cc('0x14')]);}})['catch'](function(_0x366690){logger[_0x71cc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x5ae8e7,_0x366690);_0x4b7514(_0x366690);});});} \ No newline at end of file +var _0x2657=['jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x392346,_0x20be0d){var _0x194cad=function(_0x114201){while(--_0x114201){_0x392346['push'](_0x392346['shift']());}};_0x194cad(++_0x20be0d);}(_0x2657,0x103));var _0x7265=function(_0x198e84,_0x369f60){_0x198e84=_0x198e84-0x0;var _0x4e4a19=_0x2657[_0x198e84];return _0x4e4a19;};'use strict';var _=require(_0x7265('0x0'));var util=require(_0x7265('0x1'));var moment=require(_0x7265('0x2'));var BPromise=require(_0x7265('0x3'));var rs=require(_0x7265('0x4'));var fs=require('fs');var Redis=require(_0x7265('0x5'));var db=require(_0x7265('0x6'))['db'];var utils=require(_0x7265('0x7'));var logger=require(_0x7265('0x8'))(_0x7265('0x9'));var config=require(_0x7265('0xa'));var jayson=require(_0x7265('0xb'));var client=jayson[_0x7265('0xc')][_0x7265('0xd')]({'port':0x232a});config[_0x7265('0xe')]=_[_0x7265('0xf')](config[_0x7265('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x7265('0x10'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe63c4b,_0x4f5dc0,_0x3bf3b6){return new BPromise(function(_0x146a3c,_0x767ea1){return client[_0x7265('0x11')](_0xe63c4b,_0x3bf3b6)[_0x7265('0x12')](function(_0x20b253){logger[_0x7265('0x13')](_0x7265('0x14'),_0x4f5dc0,_0x7265('0x15'));logger[_0x7265('0x16')](_0x7265('0x17'),_0x4f5dc0,_0x7265('0x15'),JSON[_0x7265('0x18')](_0x20b253));if(_0x20b253[_0x7265('0x19')]){if(_0x20b253[_0x7265('0x19')][_0x7265('0x1a')]===0x1f4){logger[_0x7265('0x19')](_0x7265('0x14'),_0x4f5dc0,_0x20b253['error']['message']);return _0x767ea1(_0x20b253[_0x7265('0x19')][_0x7265('0x1b')]);}logger[_0x7265('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4f5dc0,_0x20b253['error'][_0x7265('0x1b')]);return _0x146a3c(_0x20b253['error'][_0x7265('0x1b')]);}else{logger['info'](_0x7265('0x14'),_0x4f5dc0,'request\x20sent');_0x146a3c(_0x20b253[_0x7265('0x1c')][_0x7265('0x1b')]);}})[_0x7265('0x1d')](function(_0x2c852b){logger[_0x7265('0x19')](_0x7265('0x14'),_0x4f5dc0,_0x2c852b);_0x767ea1(_0x2c852b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index e2a5e6e..8c1d6d3 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 _0xe0ae=['save','remove','emit','removeListener','length','chatInternalMessage:'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe0ae,0x174));var _0xee0a=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xe0ae[_0x43aee5];return _0x76d1d0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xee0a('0x0'),_0xee0a('0x1'),'update'];function createListener(_0x540c67,_0x38c5fb){return function(_0x592b37){_0x38c5fb[_0xee0a('0x2')](_0x540c67,_0x592b37);};}function removeListener(_0x22dbb2,_0x20b2b7){return function(){ChatInternalMessageEvents[_0xee0a('0x3')](_0x22dbb2,_0x20b2b7);};}exports['register']=function(_0x4180aa){for(var _0x402528=0x0,_0x1df3f3=events[_0xee0a('0x4')];_0x402528<_0x1df3f3;_0x402528++){var _0x2e3836=events[_0x402528];var _0x338fb2=createListener(_0xee0a('0x5')+_0x2e3836,_0x4180aa);ChatInternalMessageEvents['on'](_0x2e3836,_0x338fb2);}}; \ No newline at end of file +var _0x17ef=['length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x24d56e,_0x390aa9){var _0x2e1318=function(_0x2c09ba){while(--_0x2c09ba){_0x24d56e['push'](_0x24d56e['shift']());}};_0x2e1318(++_0x390aa9);}(_0x17ef,0x1d0));var _0xf17e=function(_0x300433,_0x449f10){_0x300433=_0x300433-0x0;var _0x59699f=_0x17ef[_0x300433];return _0x59699f;};'use strict';var ChatInternalMessageEvents=require(_0xf17e('0x0'));var events=[_0xf17e('0x1'),'remove',_0xf17e('0x2')];function createListener(_0x22b021,_0x5c25d5){return function(_0x4a10ce){_0x5c25d5[_0xf17e('0x3')](_0x22b021,_0x4a10ce);};}function removeListener(_0x34a076,_0x4db343){return function(){ChatInternalMessageEvents[_0xf17e('0x4')](_0x34a076,_0x4db343);};}exports['register']=function(_0x34a97a){for(var _0x1cb107=0x0,_0x3669d4=events[_0xf17e('0x5')];_0x1cb107<_0x3669d4;_0x1cb107++){var _0x8e5655=events[_0x1cb107];var _0x2a760f=createListener(_0xf17e('0x6')+_0x8e5655,_0x34a97a);ChatInternalMessageEvents['on'](_0x8e5655,_0x2a760f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 74d0d80..ba935cc 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 _0xd7bf=['/describe','describe','getUsers','/:id','show','create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get'];(function(_0x1cb71d,_0x2a1e34){var _0x2ec379=function(_0x2dc9f2){while(--_0x2dc9f2){_0x1cb71d['push'](_0x1cb71d['shift']());}};_0x2ec379(++_0x2a1e34);}(_0xd7bf,0xba));var _0xfd7b=function(_0x3ba97b,_0x1dadac){_0x3ba97b=_0x3ba97b-0x0;var _0x15b712=_0xd7bf[_0x3ba97b];return _0x15b712;};'use strict';var multer=require(_0xfd7b('0x0'));var util=require(_0xfd7b('0x1'));var path=require(_0xfd7b('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd7b('0x3'));var router=express['Router']();var fs_extra=require(_0xfd7b('0x4'));var auth=require(_0xfd7b('0x5'));var interaction=require(_0xfd7b('0x6'));var config=require(_0xfd7b('0x7'));var controller=require(_0xfd7b('0x8'));router['get']('/',auth[_0xfd7b('0x9')](),controller[_0xfd7b('0xa')]);router[_0xfd7b('0xb')](_0xfd7b('0xc'),auth[_0xfd7b('0x9')](),controller[_0xfd7b('0xd')]);router[_0xfd7b('0xb')]('/users',auth[_0xfd7b('0x9')](),controller[_0xfd7b('0xe')]);router[_0xfd7b('0xb')](_0xfd7b('0xf'),auth['isAuthenticated'](),controller[_0xfd7b('0x10')]);router['post']('/',auth[_0xfd7b('0x9')](),controller[_0xfd7b('0x11')]);router['put'](_0xfd7b('0xf'),controller[_0xfd7b('0x12')]);router[_0xfd7b('0x13')](_0xfd7b('0xf'),auth[_0xfd7b('0x9')](),controller[_0xfd7b('0x14')]);module[_0xfd7b('0x15')]=router; \ No newline at end of file +var _0xcbb7=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','/describe','describe','get','getUsers','create','put','/:id','update','destroy','exports'];(function(_0x19da85,_0x3d9414){var _0x4bf105=function(_0x45b5a4){while(--_0x45b5a4){_0x19da85['push'](_0x19da85['shift']());}};_0x4bf105(++_0x3d9414);}(_0xcbb7,0x11e));var _0x7cbb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcbb7[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var path=require(_0x7cbb('0x2'));var timeout=require(_0x7cbb('0x3'));var express=require(_0x7cbb('0x4'));var router=express[_0x7cbb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7cbb('0x6'));var interaction=require(_0x7cbb('0x7'));var config=require(_0x7cbb('0x8'));var controller=require(_0x7cbb('0x9'));router['get']('/',auth[_0x7cbb('0xa')](),controller[_0x7cbb('0xb')]);router['get'](_0x7cbb('0xc'),auth[_0x7cbb('0xa')](),controller[_0x7cbb('0xd')]);router[_0x7cbb('0xe')]('/users',auth[_0x7cbb('0xa')](),controller[_0x7cbb('0xf')]);router[_0x7cbb('0xe')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7cbb('0xa')](),controller[_0x7cbb('0x10')]);router[_0x7cbb('0x11')](_0x7cbb('0x12'),controller[_0x7cbb('0x13')]);router['delete'](_0x7cbb('0x12'),auth['isAuthenticated'](),controller[_0x7cbb('0x14')]);module[_0x7cbb('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 8095227..4ae8f2e 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 _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x3ff6c1,_0x1cf211){var _0x4c4d19=function(_0x205718){while(--_0x205718){_0x3ff6c1['push'](_0x3ff6c1['shift']());}};_0x4c4d19(++_0x1cf211);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}}; \ No newline at end of file +var _0x9a2d=['out','DATE','STRING','TEXT','BOOLEAN','ENUM'];(function(_0xf13ffb,_0xfa33a){var _0x403925=function(_0x132d66){while(--_0x132d66){_0xf13ffb['push'](_0xf13ffb['shift']());}};_0x403925(++_0xfa33a);}(_0x9a2d,0x123));var _0xd9a2=function(_0xfc367,_0xb9daa5){_0xfc367=_0xfc367-0x0;var _0x5224f6=_0x9a2d[_0xfc367];return _0x5224f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd9a2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9a2('0x2')]('in',_0xd9a2('0x3')),'defaultValue':_0xd9a2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9a2('0x4')]},'providerName':{'type':Sequelize[_0xd9a2('0x5')]},'providerResponse':{'type':Sequelize[_0xd9a2('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 8724192..fc4d437 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 _0x3789=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','ChatMessage','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','read','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','RejectMessage','rejectMessage','contact','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x1c5202,_0x5bc415){var _0xae684b=function(_0x3b2c80){while(--_0x3b2c80){_0x1c5202['push'](_0x1c5202['shift']());}};_0xae684b(++_0x5bc415);}(_0x3789,0x7a));var _0x9378=function(_0x1b2594,_0x2cc023){_0x1b2594=_0x1b2594-0x0;var _0x3c2509=_0x3789[_0x1b2594];return _0x3c2509;};'use strict';var emlformat=require(_0x9378('0x0'));var rimraf=require(_0x9378('0x1'));var zipdir=require(_0x9378('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9378('0x3'));var path=require(_0x9378('0x4'));var sox=require(_0x9378('0x5'));var csv=require('to-csv');var ejs=require(_0x9378('0x6'));var fs=require('fs');var fs_extra=require(_0x9378('0x7'));var _=require(_0x9378('0x8'));var squel=require(_0x9378('0x9'));var crypto=require(_0x9378('0xa'));var jsforce=require(_0x9378('0xb'));var deskjs=require(_0x9378('0xc'));var toCsv=require(_0x9378('0xd'));var querystring=require(_0x9378('0xe'));var Papa=require(_0x9378('0xf'));var Redis=require(_0x9378('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9378('0x11'));var as=require(_0x9378('0x12'));var hardwareService=require(_0x9378('0x13'));var logger=require(_0x9378('0x14'))(_0x9378('0x15'));var utils=require(_0x9378('0x16'));var config=require(_0x9378('0x17'));var licenseUtil=require(_0x9378('0x18'));var db=require('../../mysqldb')['db'];config[_0x9378('0x19')]=_[_0x9378('0x1a')](config[_0x9378('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9378('0x1b'))(new Redis(config[_0x9378('0x19')]));require('./chatMessage.socket')[_0x9378('0x1c')](socket);var jayson=require(_0x9378('0x1d'));var client=jayson[_0x9378('0x1e')][_0x9378('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x9378('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2d6af4,_0x39f451,_0x484deb,_0x1d24ff){return new BPromise(function(_0x289b1f,_0x51a8ca){var _0x2c42f0=_0x1d24ff||client;return _0x2c42f0[_0x9378('0x20')](_0x2d6af4,_0x484deb)['then'](function(_0x2f2931){logger[_0x9378('0x21')](_0x9378('0x22'),_0x39f451,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x39f451,_0x9378('0x23'),JSON[_0x9378('0x24')](_0x2f2931));if(_0x2f2931[_0x9378('0x25')]){if(_0x2f2931[_0x9378('0x25')]['code']===0x1f4){logger[_0x9378('0x25')](_0x9378('0x22'),_0x39f451,_0x2f2931[_0x9378('0x25')][_0x9378('0x26')]);return _0x51a8ca(_0x2f2931['error'][_0x9378('0x26')]);}logger[_0x9378('0x25')]('ChatMessage,\x20%s,\x20%s',_0x39f451,_0x2f2931[_0x9378('0x25')]['message']);return _0x289b1f(_0x2f2931[_0x9378('0x25')][_0x9378('0x26')]);}else{logger['info'](_0x9378('0x22'),_0x39f451,'request\x20sent');_0x289b1f(_0x2f2931[_0x9378('0x27')]['message']);}})[_0x9378('0x28')](function(_0x3221ba){logger[_0x9378('0x25')](_0x9378('0x22'),_0x39f451,_0x3221ba);_0x51a8ca(_0x3221ba);});});}function respondWithStatusCode(_0x3fafdd,_0x1c1bcb){_0x1c1bcb=_0x1c1bcb||0xcc;return function(_0x35288b){if(_0x35288b){return _0x3fafdd[_0x9378('0x29')](_0x1c1bcb);}return _0x3fafdd['status'](_0x1c1bcb)[_0x9378('0x2a')]();};}function respondWithResult(_0x393e8b,_0x34e037){_0x34e037=_0x34e037||0xc8;return function(_0x139380){if(_0x139380){return _0x393e8b[_0x9378('0x2b')](_0x34e037)[_0x9378('0x2c')](_0x139380);}};}function respondWithFilteredResult(_0xdbec54,_0x40dec1){return function(_0x3731c1){if(_0x3731c1){var _0x540559=typeof _0x40dec1[_0x9378('0x2d')]==='undefined'&&typeof _0x40dec1[_0x9378('0x2e')]===_0x9378('0x2f');var _0x173841=_0x3731c1[_0x9378('0x30')];var _0xfbe322=_0x540559?0x0:_0x40dec1[_0x9378('0x2d')];var _0x1eb513=_0x540559?_0x3731c1[_0x9378('0x30')]:_0x40dec1[_0x9378('0x2d')]+_0x40dec1[_0x9378('0x2e')];var _0x5bc112;if(_0x1eb513>=_0x173841){_0x1eb513=_0x173841;_0x5bc112=0xc8;}else{_0x5bc112=0xce;}_0xdbec54[_0x9378('0x2b')](_0x5bc112);return _0xdbec54['set'](_0x9378('0x31'),_0xfbe322+'-'+_0x1eb513+'/'+_0x173841)[_0x9378('0x2c')](_0x3731c1);}return null;};}function patchUpdates(_0x20e056){return function(_0x28f6cc){try{jsonpatch[_0x9378('0x32')](_0x28f6cc,_0x20e056,!![]);}catch(_0x3c6e49){return BPromise[_0x9378('0x33')](_0x3c6e49);}return _0x28f6cc[_0x9378('0x34')]();};}function saveUpdates(_0x4181cd,_0x152848){return function(_0x40f551){if(_0x40f551){return _0x40f551[_0x9378('0x35')](_0x4181cd)[_0x9378('0x36')](function(_0x52da8a){return _0x52da8a;});}return null;};}function removeEntity(_0x5c933b,_0x42a0c7){return function(_0x48e0c4){if(_0x48e0c4){return _0x48e0c4[_0x9378('0x37')]()[_0x9378('0x36')](function(){_0x5c933b[_0x9378('0x2b')](0xcc)[_0x9378('0x2a')]();});}};}function handleEntityNotFound(_0x1920bf,_0x4f7b56){return function(_0x581487){if(!_0x581487){_0x1920bf[_0x9378('0x29')](0x194);}return _0x581487;};}function handleError(_0x20f688,_0xa0ad27){_0xa0ad27=_0xa0ad27||0x1f4;return function(_0x16d6af){logger[_0x9378('0x25')](_0x16d6af[_0x9378('0x38')]);if(_0x16d6af[_0x9378('0x39')]){delete _0x16d6af['name'];}_0x20f688['status'](_0xa0ad27)['send'](_0x16d6af);};}exports[_0x9378('0x3a')]=function(_0xd4f63,_0x1d3771){var _0x1ec6ff={},_0xcb4d2f={},_0x5c8946={'count':0x0,'rows':[]};var _0x5badf7=_['map'](db[_0x9378('0x3b')][_0x9378('0x3c')],function(_0x3e17d3){return{'name':_0x3e17d3['fieldName'],'type':_0x3e17d3['type'][_0x9378('0x3d')]};});_0xcb4d2f[_0x9378('0x3e')]=_[_0x9378('0x3f')](_0x5badf7,_0x9378('0x39'));_0xcb4d2f[_0x9378('0x40')]=_[_0x9378('0x41')](_0xd4f63[_0x9378('0x40')]);_0xcb4d2f[_0x9378('0x42')]=_[_0x9378('0x43')](_0xcb4d2f['model'],_0xcb4d2f[_0x9378('0x40')]);_0x1ec6ff[_0x9378('0x44')]=_[_0x9378('0x43')](_0xcb4d2f[_0x9378('0x3e')],qs[_0x9378('0x45')](_0xd4f63['query'][_0x9378('0x45')]));_0x1ec6ff['attributes']=_0x1ec6ff[_0x9378('0x44')][_0x9378('0x46')]?_0x1ec6ff[_0x9378('0x44')]:_0xcb4d2f['model'];if(!_0xd4f63[_0x9378('0x40')][_0x9378('0x47')](_0x9378('0x48'))){_0x1ec6ff[_0x9378('0x2e')]=qs[_0x9378('0x2e')](_0xd4f63[_0x9378('0x40')][_0x9378('0x2e')]);_0x1ec6ff[_0x9378('0x2d')]=qs[_0x9378('0x2d')](_0xd4f63[_0x9378('0x40')][_0x9378('0x2d')]);}_0x1ec6ff[_0x9378('0x49')]=qs[_0x9378('0x4a')](_0xd4f63[_0x9378('0x40')][_0x9378('0x4a')]);_0x1ec6ff[_0x9378('0x4b')]=qs['filters'](_[_0x9378('0x4c')](_0xd4f63[_0x9378('0x40')],_0xcb4d2f[_0x9378('0x42')]),_0x5badf7);if(_0xd4f63[_0x9378('0x40')][_0x9378('0x4d')]){_0x1ec6ff[_0x9378('0x4b')]=_[_0x9378('0x4e')](_0x1ec6ff[_0x9378('0x4b')],{'$or':_[_0x9378('0x3f')](_0x5badf7,function(_0x496b87){if(_0x496b87[_0x9378('0x4f')]!==_0x9378('0x50')){var _0x2f7940={};_0x2f7940[_0x496b87['name']]={'$like':'%'+_0xd4f63[_0x9378('0x40')][_0x9378('0x4d')]+'%'};return _0x2f7940;}})});}_0x1ec6ff=_[_0x9378('0x4e')]({},_0x1ec6ff,_0xd4f63[_0x9378('0x51')]);var _0x109e30={'where':_0x1ec6ff[_0x9378('0x4b')]};return db[_0x9378('0x3b')][_0x9378('0x30')](_0x109e30)[_0x9378('0x36')](function(_0x295515){_0x5c8946[_0x9378('0x30')]=_0x295515;if(_0xd4f63[_0x9378('0x40')][_0x9378('0x52')]){_0x1ec6ff[_0x9378('0x53')]=[{'all':!![]}];}return db[_0x9378('0x3b')][_0x9378('0x54')](_0x1ec6ff);})[_0x9378('0x36')](function(_0x4219d0){_0x5c8946[_0x9378('0x55')]=_0x4219d0;return _0x5c8946;})[_0x9378('0x36')](respondWithFilteredResult(_0x1d3771,_0x1ec6ff))['catch'](handleError(_0x1d3771,null));};exports[_0x9378('0x56')]=function(_0xc14be8,_0x3f48a3){var _0x28150d={'raw':!![],'where':{'id':_0xc14be8[_0x9378('0x57')]['id']}},_0x413898={};_0x413898['model']=_[_0x9378('0x41')](db['ChatMessage'][_0x9378('0x3c')]);_0x413898['query']=_[_0x9378('0x41')](_0xc14be8[_0x9378('0x40')]);_0x413898[_0x9378('0x42')]=_[_0x9378('0x43')](_0x413898['model'],_0x413898['query']);_0x28150d['attributes']=_['intersection'](_0x413898[_0x9378('0x3e')],qs[_0x9378('0x45')](_0xc14be8['query']['fields']));_0x28150d[_0x9378('0x44')]=_0x28150d[_0x9378('0x44')][_0x9378('0x46')]?_0x28150d[_0x9378('0x44')]:_0x413898[_0x9378('0x3e')];if(_0xc14be8[_0x9378('0x40')][_0x9378('0x52')]){_0x28150d[_0x9378('0x53')]=[{'all':!![]}];}_0x28150d=_['merge']({},_0x28150d,_0xc14be8[_0x9378('0x51')]);return db[_0x9378('0x3b')][_0x9378('0x58')](_0x28150d)[_0x9378('0x36')](handleEntityNotFound(_0x3f48a3,null))[_0x9378('0x36')](respondWithResult(_0x3f48a3,null))[_0x9378('0x28')](handleError(_0x3f48a3,null));};exports['create']=function(_0x36c436,_0x33ff1f){return db[_0x9378('0x3b')][_0x9378('0x59')](_0x36c436[_0x9378('0x5a')],{})[_0x9378('0x36')](respondWithResult(_0x33ff1f,0xc9))[_0x9378('0x28')](handleError(_0x33ff1f,null));};exports[_0x9378('0x35')]=function(_0x593a09,_0x3b31c3){if(_0x593a09[_0x9378('0x5a')]['id']){delete _0x593a09[_0x9378('0x5a')]['id'];}return db['ChatMessage'][_0x9378('0x58')]({'where':{'id':_0x593a09['params']['id']}})[_0x9378('0x36')](handleEntityNotFound(_0x3b31c3,null))[_0x9378('0x36')](saveUpdates(_0x593a09[_0x9378('0x5a')],null))['then'](respondWithResult(_0x3b31c3,null))[_0x9378('0x28')](handleError(_0x3b31c3,null));};exports[_0x9378('0x37')]=function(_0x4d7464,_0x4b6bd3){return db[_0x9378('0x3b')]['find']({'where':{'id':_0x4d7464[_0x9378('0x57')]['id']}})[_0x9378('0x36')](handleEntityNotFound(_0x4b6bd3,null))['then'](removeEntity(_0x4b6bd3,null))[_0x9378('0x28')](handleError(_0x4b6bd3,null));};exports['describe']=function(_0x31c578,_0x3835ad){return db[_0x9378('0x3b')][_0x9378('0x5b')]()[_0x9378('0x36')](respondWithResult(_0x3835ad,null))[_0x9378('0x28')](handleError(_0x3835ad,null));};var interaction_log=require(_0x9378('0x14'))(_0x9378('0x5c'));exports[_0x9378('0x5d')]=function(_0x773679,_0x5e8130,_0x31c61f){var _0x20563f={'agent':{},'channel':_0x9378('0x5e')};if(_0x773679[_0x9378('0x5a')]['id']){delete _0x773679['body']['id'];}_0x773679['body'][_0x9378('0x5f')]=!![];_0x773679['body']['readAt']=moment()[_0x9378('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x773679['body']['UserId']=_0x773679[_0x9378('0x5a')][_0x9378('0x61')]||_0x773679[_0x9378('0x62')]['id'];_0x20563f[_0x9378('0x63')]['id']=_0x773679[_0x9378('0x5a')][_0x9378('0x61')];return db[_0x9378('0x3b')]['find']({'where':{'id':_0x773679[_0x9378('0x57')]['id'],'UserId':null}})[_0x9378('0x36')](handleEntityNotFound(_0x5e8130,null))['then'](saveUpdates(_0x773679[_0x9378('0x5a')],null))[_0x9378('0x36')](function(_0x201a70){if(_0x201a70){_0x20563f['message']=_0x201a70[_0x9378('0x64')]({'plain':!![]});return db[_0x9378('0x65')][_0x9378('0x58')]({'where':{'id':_0x201a70[_0x9378('0x66')]}});}return null;})[_0x9378('0x36')](handleEntityNotFound(_0x5e8130,null))[_0x9378('0x36')](function(_0x46f4cd){if(_0x46f4cd){return _0x46f4cd[_0x9378('0x35')]({'UserId':_0x773679[_0x9378('0x5a')][_0x9378('0x61')],'read1stAt':_['isNil'](_0x46f4cd[_0x9378('0x67')])?moment()[_0x9378('0x60')](_0x9378('0x68')):undefined});}return null;})[_0x9378('0x36')](function(_0x470adc){if(_0x470adc){_0x20563f[_0x9378('0x69')]=_0x470adc['get']({'plain':!![]});interaction_log[_0x9378('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x773679['user']['id'],_0x773679[_0x9378('0x62')][_0x9378('0x39')],_0x773679[_0x9378('0x62')][_0x9378('0x6a')],_0x20563f[_0x9378('0x69')]['id'],_0x773679[_0x9378('0x5a')]?JSON[_0x9378('0x24')](_0x773679[_0x9378('0x5a')]):_0x9378('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x9378('0x6c'),_0x20563f);}return null;})[_0x9378('0x36')](function(_0x36e5f4){var _0x41be97=_0x9378('0x6d')+_0x36e5f4['message'][_0x9378('0x6e')];return db[_0x9378('0x6f')][_0x9378('0x40')](_0x41be97,{'type':db[_0x9378('0x70')][_0x9378('0x71')][_0x9378('0x72')],'raw':!![]})[_0x9378('0x36')](function(_0x27d20a){return _0x27d20a;});})[_0x9378('0x36')](function(_0x1222e0){if(_0x1222e0){_0x20563f[_0x9378('0x26')]['contact']=_0x1222e0[0x0];if(!_0x773679[_0x9378('0x5a')][_0x9378('0x61')])return;return db[_0x9378('0x73')][_0x9378('0x58')]({'where':{'id':_0x773679[_0x9378('0x5a')]['UserId'],'role':_0x9378('0x63')},'attributes':['id',_0x9378('0x39'),_0x9378('0x74'),_0x9378('0x75'),_0x9378('0x76')],'raw':!![]});}return null;})[_0x9378('0x36')](function(_0x5e3289){if(!_0x5e3289)return null;_0x20563f['message'][_0x9378('0x63')]=_0x5e3289;return _0x20563f;})[_0x9378('0x36')](function(_0x250921){if(_0x250921){if(_0x773679[_0x9378('0x5a')]['manual']){_0x20563f[_0x9378('0x26')][_0x9378('0x77')]=util['format']('SIP/%s',_0x773679[_0x9378('0x62')]['name']);_0x20563f[_0x9378('0x26')][_0x9378('0x78')]=_0x20563f['channel'];_0x20563f[_0x9378('0x26')][_0x9378('0x79')]=_0x20563f[_0x9378('0x78')];_0x20563f['message'][_0x9378('0x7a')]='accept';return respondWithRpcPromise(_0x9378('0x7b'),_0x9378('0x7b'),{'event':_0x9378('0x7c'),'message':_['merge'](_0x20563f[_0x9378('0x26')],JSON[_0x9378('0x7d')](_0x20563f[_0x9378('0x69')][_0x9378('0x7e')]))},client9002)['then'](function(){return _0x20563f;});}return _0x20563f;}return null;})[_0x9378('0x36')](respondWithResult(_0x5e8130,null))[_0x9378('0x28')](handleError(_0x5e8130,null));};var interaction_log=require(_0x9378('0x14'))(_0x9378('0x5c'));exports[_0x9378('0x33')]=function(_0x53b851,_0x52712b,_0x2b0904){var _0x22c93c={'agent':{},'channel':_0x9378('0x5e')};if(_0x53b851[_0x9378('0x5a')]['id']){delete _0x53b851['body']['id'];}_0x53b851[_0x9378('0x5a')][_0x9378('0x61')]=_0x53b851[_0x9378('0x5a')][_0x9378('0x61')]||_0x53b851['user']['id'];_0x22c93c[_0x9378('0x63')]['id']=_0x53b851[_0x9378('0x5a')][_0x9378('0x61')];return db[_0x9378('0x3b')][_0x9378('0x58')]({'where':{'id':_0x53b851[_0x9378('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52712b,null))[_0x9378('0x36')](function(_0x1952d4){if(_0x1952d4){_0x22c93c[_0x9378('0x26')]=_0x1952d4[_0x9378('0x64')]({'plain':!![]});return db[_0x9378('0x65')][_0x9378('0x58')]({'where':{'id':_0x1952d4['ChatInteractionId']}});}return null;})[_0x9378('0x36')](handleEntityNotFound(_0x52712b,null))[_0x9378('0x36')](function(_0x1d842c){if(_0x1d842c){_0x22c93c[_0x9378('0x69')]=_0x1d842c[_0x9378('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53b851[_0x9378('0x62')]['id'],_0x53b851['user'][_0x9378('0x39')],_0x53b851[_0x9378('0x62')][_0x9378('0x6a')],_0x22c93c['interaction']['id'],_0x53b851[_0x9378('0x5a')]?JSON[_0x9378('0x24')](_0x53b851[_0x9378('0x5a')]):_0x9378('0x6b'));return respondWithRpcPromise(_0x9378('0x7f'),_0x9378('0x80'),_0x22c93c);}return null;})[_0x9378('0x36')](function(_0x1e545f){var _0x5d37b1=_0x9378('0x6d')+_0x1e545f[_0x9378('0x26')]['ContactId'];return db['sequelize']['query'](_0x5d37b1,{'type':db[_0x9378('0x70')][_0x9378('0x71')][_0x9378('0x72')],'raw':!![]})[_0x9378('0x36')](function(_0x3b9f2e){return _0x3b9f2e;});})[_0x9378('0x36')](function(_0x404dd8){if(_0x404dd8){_0x22c93c['message'][_0x9378('0x81')]=_0x404dd8[0x0];if(!_0x53b851[_0x9378('0x5a')][_0x9378('0x61')])return;return db['User'][_0x9378('0x58')]({'where':{'id':_0x53b851[_0x9378('0x5a')][_0x9378('0x61')],'role':_0x9378('0x63')},'attributes':['id',_0x9378('0x39'),_0x9378('0x74'),'email',_0x9378('0x76')],'raw':!![]});}return null;})[_0x9378('0x36')](function(_0x315997){if(!_0x315997)return null;_0x22c93c[_0x9378('0x26')][_0x9378('0x63')]=_0x315997;return _0x22c93c;})[_0x9378('0x36')](function(_0x64a2bf){if(_0x64a2bf){_0x64a2bf['message'][_0x9378('0x77')]=util[_0x9378('0x60')](_0x9378('0x82'),_0x53b851[_0x9378('0x62')]['name']);_0x64a2bf[_0x9378('0x26')]['channel']=_0x22c93c[_0x9378('0x78')];_0x64a2bf['message'][_0x9378('0x79')]=_0x22c93c['channel'];_0x64a2bf[_0x9378('0x26')][_0x9378('0x7a')]=_0x9378('0x33');respondWithRpcPromise(_0x9378('0x7b'),'EventManager',{'event':_0x9378('0x83'),'message':_[_0x9378('0x4e')](_0x22c93c[_0x9378('0x26')],JSON[_0x9378('0x7d')](_0x22c93c['interaction'][_0x9378('0x7e')]))},client9002);return _0x22c93c;}return null;})[_0x9378('0x36')](respondWithResult(_0x52712b,null))[_0x9378('0x28')](handleError(_0x52712b,null));}; \ No newline at end of file +var _0x9674=['set','apply','save','update','end','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','find','create','body','destroy','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','internal','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','parse','../../config/logger','chat','interaction','null','RejectMessage','rejectMessage','SELECT','contact','email','SIP/%s','reject','rejectmessage','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','sendStatus','json','offset','limit','status'];(function(_0x44a518,_0x413a2d){var _0x4a3cdf=function(_0x268625){while(--_0x268625){_0x44a518['push'](_0x44a518['shift']());}};_0x4a3cdf(++_0x413a2d);}(_0x9674,0xde));var _0x4967=function(_0x41bbd7,_0x3041f8){_0x41bbd7=_0x41bbd7-0x0;var _0x116b13=_0x9674[_0x41bbd7];return _0x116b13;};'use strict';var emlformat=require(_0x4967('0x0'));var rimraf=require(_0x4967('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4967('0x2'));var rp=require(_0x4967('0x3'));var moment=require(_0x4967('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4967('0x5'));var path=require(_0x4967('0x6'));var sox=require(_0x4967('0x7'));var csv=require(_0x4967('0x8'));var ejs=require(_0x4967('0x9'));var fs=require('fs');var fs_extra=require(_0x4967('0xa'));var _=require(_0x4967('0xb'));var squel=require(_0x4967('0xc'));var crypto=require(_0x4967('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4967('0x8'));var querystring=require(_0x4967('0xe'));var Papa=require(_0x4967('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4967('0x10'));var as=require(_0x4967('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4967('0x12'));var utils=require(_0x4967('0x13'));var config=require(_0x4967('0x14'));var licenseUtil=require(_0x4967('0x15'));var db=require(_0x4967('0x16'))['db'];config[_0x4967('0x17')]=_[_0x4967('0x18')](config['redis'],{'host':_0x4967('0x19'),'port':0x18eb});var socket=require(_0x4967('0x1a'))(new Redis(config[_0x4967('0x17')]));require(_0x4967('0x1b'))['register'](socket);var jayson=require(_0x4967('0x1c'));var client=jayson['client'][_0x4967('0x1d')]({'port':0x232c});var client9002=jayson[_0x4967('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d96d,_0x2f8831,_0x3fc540,_0x1fad16){return new BPromise(function(_0x1a5a1c,_0x6fd354){var _0x5a3966=_0x1fad16||client;return _0x5a3966[_0x4967('0x1f')](_0x35d96d,_0x3fc540)[_0x4967('0x20')](function(_0x3d1460){logger[_0x4967('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2f8831,_0x4967('0x22'));logger[_0x4967('0x23')](_0x4967('0x24'),_0x2f8831,_0x4967('0x22'),JSON[_0x4967('0x25')](_0x3d1460));if(_0x3d1460[_0x4967('0x26')]){if(_0x3d1460[_0x4967('0x26')][_0x4967('0x27')]===0x1f4){logger[_0x4967('0x26')](_0x4967('0x28'),_0x2f8831,_0x3d1460[_0x4967('0x26')][_0x4967('0x29')]);return _0x6fd354(_0x3d1460[_0x4967('0x26')][_0x4967('0x29')]);}logger[_0x4967('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2f8831,_0x3d1460[_0x4967('0x26')][_0x4967('0x29')]);return _0x1a5a1c(_0x3d1460['error'][_0x4967('0x29')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f8831,_0x4967('0x22'));_0x1a5a1c(_0x3d1460['result'][_0x4967('0x29')]);}})[_0x4967('0x2a')](function(_0x586bc2){logger[_0x4967('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2f8831,_0x586bc2);_0x6fd354(_0x586bc2);});});}function respondWithStatusCode(_0xccc50c,_0x23610f){_0x23610f=_0x23610f||0xcc;return function(_0x33ad0b){if(_0x33ad0b){return _0xccc50c[_0x4967('0x2b')](_0x23610f);}return _0xccc50c['status'](_0x23610f)['end']();};}function respondWithResult(_0xa07ea7,_0x2b8b46){_0x2b8b46=_0x2b8b46||0xc8;return function(_0x2caf1d){if(_0x2caf1d){return _0xa07ea7['status'](_0x2b8b46)[_0x4967('0x2c')](_0x2caf1d);}};}function respondWithFilteredResult(_0x5d9e1d,_0x5e817b){return function(_0x29503d){if(_0x29503d){var _0x5711e2=typeof _0x5e817b[_0x4967('0x2d')]==='undefined'&&typeof _0x5e817b['limit']==='undefined';var _0x369311=_0x29503d['count'];var _0x590b92=_0x5711e2?0x0:_0x5e817b[_0x4967('0x2d')];var _0x10e084=_0x5711e2?_0x29503d['count']:_0x5e817b[_0x4967('0x2d')]+_0x5e817b[_0x4967('0x2e')];var _0x4d7fa8;if(_0x10e084>=_0x369311){_0x10e084=_0x369311;_0x4d7fa8=0xc8;}else{_0x4d7fa8=0xce;}_0x5d9e1d[_0x4967('0x2f')](_0x4d7fa8);return _0x5d9e1d[_0x4967('0x30')]('Content-Range',_0x590b92+'-'+_0x10e084+'/'+_0x369311)[_0x4967('0x2c')](_0x29503d);}return null;};}function patchUpdates(_0x22d71d){return function(_0x31600c){try{jsonpatch[_0x4967('0x31')](_0x31600c,_0x22d71d,!![]);}catch(_0x351bc3){return BPromise['reject'](_0x351bc3);}return _0x31600c[_0x4967('0x32')]();};}function saveUpdates(_0x6fa9be,_0xc4b792){return function(_0xb5df7){if(_0xb5df7){return _0xb5df7[_0x4967('0x33')](_0x6fa9be)[_0x4967('0x20')](function(_0xff9887){return _0xff9887;});}return null;};}function removeEntity(_0xa192bc,_0x5e9ec9){return function(_0xda9b0a){if(_0xda9b0a){return _0xda9b0a['destroy']()[_0x4967('0x20')](function(){_0xa192bc[_0x4967('0x2f')](0xcc)[_0x4967('0x34')]();});}};}function handleEntityNotFound(_0x6e06f,_0xa61e73){return function(_0x5df43c){if(!_0x5df43c){_0x6e06f['sendStatus'](0x194);}return _0x5df43c;};}function handleError(_0x13c507,_0x1b114a){_0x1b114a=_0x1b114a||0x1f4;return function(_0x37af17){logger[_0x4967('0x26')](_0x37af17['stack']);if(_0x37af17[_0x4967('0x35')]){delete _0x37af17[_0x4967('0x35')];}_0x13c507[_0x4967('0x2f')](_0x1b114a)[_0x4967('0x36')](_0x37af17);};}exports[_0x4967('0x37')]=function(_0x5ab5a8,_0x53baa3){var _0x327111={},_0x1543f6={},_0x2cd652={'count':0x0,'rows':[]};var _0x1da636=_['map'](db[_0x4967('0x38')][_0x4967('0x39')],function(_0x5be442){return{'name':_0x5be442[_0x4967('0x3a')],'type':_0x5be442[_0x4967('0x3b')][_0x4967('0x3c')]};});_0x1543f6[_0x4967('0x3d')]=_['map'](_0x1da636,_0x4967('0x35'));_0x1543f6[_0x4967('0x3e')]=_['keys'](_0x5ab5a8[_0x4967('0x3e')]);_0x1543f6[_0x4967('0x3f')]=_[_0x4967('0x40')](_0x1543f6['model'],_0x1543f6[_0x4967('0x3e')]);_0x327111['attributes']=_['intersection'](_0x1543f6[_0x4967('0x3d')],qs[_0x4967('0x41')](_0x5ab5a8[_0x4967('0x3e')][_0x4967('0x41')]));_0x327111[_0x4967('0x42')]=_0x327111[_0x4967('0x42')][_0x4967('0x43')]?_0x327111['attributes']:_0x1543f6['model'];if(!_0x5ab5a8[_0x4967('0x3e')]['hasOwnProperty'](_0x4967('0x44'))){_0x327111[_0x4967('0x2e')]=qs[_0x4967('0x2e')](_0x5ab5a8[_0x4967('0x3e')][_0x4967('0x2e')]);_0x327111[_0x4967('0x2d')]=qs[_0x4967('0x2d')](_0x5ab5a8[_0x4967('0x3e')][_0x4967('0x2d')]);}_0x327111[_0x4967('0x45')]=qs[_0x4967('0x46')](_0x5ab5a8[_0x4967('0x3e')]['sort']);_0x327111[_0x4967('0x47')]=qs[_0x4967('0x3f')](_['pick'](_0x5ab5a8[_0x4967('0x3e')],_0x1543f6[_0x4967('0x3f')]),_0x1da636);if(_0x5ab5a8['query'][_0x4967('0x48')]){_0x327111[_0x4967('0x47')]=_[_0x4967('0x49')](_0x327111[_0x4967('0x47')],{'$or':_[_0x4967('0x4a')](_0x1da636,function(_0x2c962f){if(_0x2c962f[_0x4967('0x3b')]!==_0x4967('0x4b')){var _0x22979f={};_0x22979f[_0x2c962f[_0x4967('0x35')]]={'$like':'%'+_0x5ab5a8[_0x4967('0x3e')]['filter']+'%'};return _0x22979f;}})});}_0x327111=_[_0x4967('0x49')]({},_0x327111,_0x5ab5a8[_0x4967('0x4c')]);var _0x18e706={'where':_0x327111[_0x4967('0x47')]};return db['ChatMessage'][_0x4967('0x4d')](_0x18e706)[_0x4967('0x20')](function(_0x55c761){_0x2cd652[_0x4967('0x4d')]=_0x55c761;if(_0x5ab5a8[_0x4967('0x3e')][_0x4967('0x4e')]){_0x327111[_0x4967('0x4f')]=[{'all':!![]}];}return db[_0x4967('0x38')]['findAll'](_0x327111);})['then'](function(_0x2c925c){_0x2cd652[_0x4967('0x50')]=_0x2c925c;return _0x2cd652;})['then'](respondWithFilteredResult(_0x53baa3,_0x327111))[_0x4967('0x2a')](handleError(_0x53baa3,null));};exports[_0x4967('0x51')]=function(_0x13ce4e,_0x589a9e){var _0x2d1498={'raw':!![],'where':{'id':_0x13ce4e[_0x4967('0x52')]['id']}},_0x1a3ec9={};_0x1a3ec9[_0x4967('0x3d')]=_[_0x4967('0x53')](db['ChatMessage'][_0x4967('0x39')]);_0x1a3ec9[_0x4967('0x3e')]=_[_0x4967('0x53')](_0x13ce4e[_0x4967('0x3e')]);_0x1a3ec9['filters']=_[_0x4967('0x40')](_0x1a3ec9[_0x4967('0x3d')],_0x1a3ec9[_0x4967('0x3e')]);_0x2d1498[_0x4967('0x42')]=_[_0x4967('0x40')](_0x1a3ec9[_0x4967('0x3d')],qs[_0x4967('0x41')](_0x13ce4e['query'][_0x4967('0x41')]));_0x2d1498[_0x4967('0x42')]=_0x2d1498[_0x4967('0x42')][_0x4967('0x43')]?_0x2d1498['attributes']:_0x1a3ec9[_0x4967('0x3d')];if(_0x13ce4e[_0x4967('0x3e')][_0x4967('0x4e')]){_0x2d1498[_0x4967('0x4f')]=[{'all':!![]}];}_0x2d1498=_[_0x4967('0x49')]({},_0x2d1498,_0x13ce4e[_0x4967('0x4c')]);return db[_0x4967('0x38')][_0x4967('0x54')](_0x2d1498)['then'](handleEntityNotFound(_0x589a9e,null))[_0x4967('0x20')](respondWithResult(_0x589a9e,null))[_0x4967('0x2a')](handleError(_0x589a9e,null));};exports[_0x4967('0x55')]=function(_0x1b86fe,_0x224dec){return db['ChatMessage']['create'](_0x1b86fe[_0x4967('0x56')],{})[_0x4967('0x20')](respondWithResult(_0x224dec,0xc9))[_0x4967('0x2a')](handleError(_0x224dec,null));};exports['update']=function(_0x19298c,_0x2df84f){if(_0x19298c[_0x4967('0x56')]['id']){delete _0x19298c['body']['id'];}return db['ChatMessage'][_0x4967('0x54')]({'where':{'id':_0x19298c[_0x4967('0x52')]['id']}})['then'](handleEntityNotFound(_0x2df84f,null))[_0x4967('0x20')](saveUpdates(_0x19298c[_0x4967('0x56')],null))['then'](respondWithResult(_0x2df84f,null))[_0x4967('0x2a')](handleError(_0x2df84f,null));};exports[_0x4967('0x57')]=function(_0x560309,_0x3b7176){return db['ChatMessage'][_0x4967('0x54')]({'where':{'id':_0x560309[_0x4967('0x52')]['id']}})[_0x4967('0x20')](handleEntityNotFound(_0x3b7176,null))[_0x4967('0x20')](removeEntity(_0x3b7176,null))['catch'](handleError(_0x3b7176,null));};exports[_0x4967('0x58')]=function(_0x55e1e8,_0x2a7c63){return db['ChatMessage'][_0x4967('0x58')]()[_0x4967('0x20')](respondWithResult(_0x2a7c63,null))[_0x4967('0x2a')](handleError(_0x2a7c63,null));};var interaction_log=require('../../config/logger')(_0x4967('0x59'));exports[_0x4967('0x5a')]=function(_0x4563a4,_0x56fb37,_0x328648){var _0x519b3a={'agent':{},'channel':'chat'};if(_0x4563a4[_0x4967('0x56')]['id']){delete _0x4563a4[_0x4967('0x56')]['id'];}_0x4563a4[_0x4967('0x56')][_0x4967('0x5b')]=!![];_0x4563a4['body'][_0x4967('0x5c')]=moment()[_0x4967('0x5d')](_0x4967('0x5e'));_0x4563a4[_0x4967('0x56')]['UserId']=_0x4563a4['body']['UserId']||_0x4563a4[_0x4967('0x5f')]['id'];_0x519b3a[_0x4967('0x60')]['id']=_0x4563a4[_0x4967('0x56')][_0x4967('0x61')];return db[_0x4967('0x38')][_0x4967('0x54')]({'where':{'id':_0x4563a4['params']['id'],'UserId':null}})[_0x4967('0x20')](handleEntityNotFound(_0x56fb37,null))[_0x4967('0x20')](saveUpdates(_0x4563a4['body'],null))[_0x4967('0x20')](function(_0x1ff13e){if(_0x1ff13e){_0x519b3a['message']=_0x1ff13e[_0x4967('0x62')]({'plain':!![]});return db[_0x4967('0x63')][_0x4967('0x54')]({'where':{'id':_0x1ff13e[_0x4967('0x64')]}});}return null;})[_0x4967('0x20')](handleEntityNotFound(_0x56fb37,null))[_0x4967('0x20')](function(_0x26aadd){if(_0x26aadd){return _0x26aadd[_0x4967('0x33')]({'UserId':_0x4563a4['body'][_0x4967('0x61')],'read1stAt':_[_0x4967('0x65')](_0x26aadd[_0x4967('0x66')])?moment()['format'](_0x4967('0x5e')):undefined});}return null;})[_0x4967('0x20')](function(_0x5377e4){if(_0x5377e4){_0x519b3a['interaction']=_0x5377e4[_0x4967('0x62')]({'plain':!![]});interaction_log[_0x4967('0x21')](_0x4967('0x67'),_0x4563a4[_0x4967('0x5f')]['id'],_0x4563a4[_0x4967('0x5f')][_0x4967('0x35')],_0x4563a4[_0x4967('0x5f')][_0x4967('0x68')],_0x519b3a['interaction']['id'],_0x4563a4[_0x4967('0x56')]?JSON['stringify'](_0x4563a4['body']):'null');return respondWithRpcPromise(_0x4967('0x69'),'acceptMessage',_0x519b3a);}return null;})[_0x4967('0x20')](function(_0x17f79a){var _0x4b49e9=_0x4967('0x6a')+_0x17f79a['message'][_0x4967('0x6b')];return db[_0x4967('0x6c')][_0x4967('0x3e')](_0x4b49e9,{'type':db[_0x4967('0x6d')][_0x4967('0x6e')]['SELECT'],'raw':!![]})[_0x4967('0x20')](function(_0x574491){return _0x574491;});})['then'](function(_0x1cd021){if(_0x1cd021){_0x519b3a[_0x4967('0x29')]['contact']=_0x1cd021[0x0];if(!_0x4563a4['body'][_0x4967('0x61')])return;return db[_0x4967('0x6f')][_0x4967('0x54')]({'where':{'id':_0x4563a4[_0x4967('0x56')][_0x4967('0x61')],'role':_0x4967('0x60')},'attributes':['id',_0x4967('0x35'),_0x4967('0x70'),'email',_0x4967('0x71')],'raw':!![]});}return null;})[_0x4967('0x20')](function(_0x1e5d78){if(!_0x1e5d78)return null;_0x519b3a[_0x4967('0x29')][_0x4967('0x60')]=_0x1e5d78;return _0x519b3a;})['then'](function(_0x52154b){if(_0x52154b){if(_0x4563a4['body'][_0x4967('0x72')]){_0x519b3a[_0x4967('0x29')][_0x4967('0x73')]=util[_0x4967('0x5d')]('SIP/%s',_0x4563a4[_0x4967('0x5f')][_0x4967('0x35')]);_0x519b3a['message']['channel']=_0x519b3a['channel'];_0x519b3a['message'][_0x4967('0x74')]=_0x519b3a[_0x4967('0x75')];_0x519b3a[_0x4967('0x29')][_0x4967('0x76')]='accept';return respondWithRpcPromise(_0x4967('0x77'),_0x4967('0x77'),{'event':_0x4967('0x78'),'message':_[_0x4967('0x49')](_0x519b3a[_0x4967('0x29')],JSON[_0x4967('0x79')](_0x519b3a['interaction']['formData']))},client9002)[_0x4967('0x20')](function(){return _0x519b3a;});}return _0x519b3a;}return null;})[_0x4967('0x20')](respondWithResult(_0x56fb37,null))[_0x4967('0x2a')](handleError(_0x56fb37,null));};var interaction_log=require(_0x4967('0x7a'))(_0x4967('0x59'));exports['reject']=function(_0x5d4ac5,_0x7b0920,_0x23645e){var _0x8926dd={'agent':{},'channel':_0x4967('0x7b')};if(_0x5d4ac5[_0x4967('0x56')]['id']){delete _0x5d4ac5[_0x4967('0x56')]['id'];}_0x5d4ac5[_0x4967('0x56')][_0x4967('0x61')]=_0x5d4ac5[_0x4967('0x56')][_0x4967('0x61')]||_0x5d4ac5[_0x4967('0x5f')]['id'];_0x8926dd[_0x4967('0x60')]['id']=_0x5d4ac5[_0x4967('0x56')][_0x4967('0x61')];return db[_0x4967('0x38')][_0x4967('0x54')]({'where':{'id':_0x5d4ac5[_0x4967('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7b0920,null))[_0x4967('0x20')](function(_0x2b17da){if(_0x2b17da){_0x8926dd['message']=_0x2b17da['get']({'plain':!![]});return db['ChatInteraction'][_0x4967('0x54')]({'where':{'id':_0x2b17da[_0x4967('0x64')]}});}return null;})[_0x4967('0x20')](handleEntityNotFound(_0x7b0920,null))['then'](function(_0x1d4f69){if(_0x1d4f69){_0x8926dd[_0x4967('0x7c')]=_0x1d4f69[_0x4967('0x62')]({'plain':!![]});interaction_log[_0x4967('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d4ac5[_0x4967('0x5f')]['id'],_0x5d4ac5['user'][_0x4967('0x35')],_0x5d4ac5[_0x4967('0x5f')][_0x4967('0x68')],_0x8926dd['interaction']['id'],_0x5d4ac5[_0x4967('0x56')]?JSON[_0x4967('0x25')](_0x5d4ac5[_0x4967('0x56')]):_0x4967('0x7d'));return respondWithRpcPromise(_0x4967('0x7e'),_0x4967('0x7f'),_0x8926dd);}return null;})['then'](function(_0x538298){var _0x2e61cf=_0x4967('0x6a')+_0x538298[_0x4967('0x29')][_0x4967('0x6b')];return db[_0x4967('0x6c')][_0x4967('0x3e')](_0x2e61cf,{'type':db[_0x4967('0x6d')]['QueryTypes'][_0x4967('0x80')],'raw':!![]})['then'](function(_0x1c4fb8){return _0x1c4fb8;});})[_0x4967('0x20')](function(_0x35c2f0){if(_0x35c2f0){_0x8926dd['message'][_0x4967('0x81')]=_0x35c2f0[0x0];if(!_0x5d4ac5[_0x4967('0x56')]['UserId'])return;return db[_0x4967('0x6f')][_0x4967('0x54')]({'where':{'id':_0x5d4ac5[_0x4967('0x56')][_0x4967('0x61')],'role':_0x4967('0x60')},'attributes':['id',_0x4967('0x35'),_0x4967('0x70'),_0x4967('0x82'),_0x4967('0x71')],'raw':!![]});}return null;})[_0x4967('0x20')](function(_0xa4ee65){if(!_0xa4ee65)return null;_0x8926dd[_0x4967('0x29')]['agent']=_0xa4ee65;return _0x8926dd;})[_0x4967('0x20')](function(_0x872709){if(_0x872709){_0x872709[_0x4967('0x29')][_0x4967('0x73')]=util[_0x4967('0x5d')](_0x4967('0x83'),_0x5d4ac5[_0x4967('0x5f')]['name']);_0x872709['message'][_0x4967('0x75')]=_0x8926dd[_0x4967('0x75')];_0x872709[_0x4967('0x29')][_0x4967('0x74')]=_0x8926dd['channel'];_0x872709['message'][_0x4967('0x76')]=_0x4967('0x84');respondWithRpcPromise('EventManager','EventManager',{'event':_0x4967('0x85'),'message':_[_0x4967('0x49')](_0x8926dd[_0x4967('0x29')],JSON['parse'](_0x8926dd[_0x4967('0x7c')][_0x4967('0x86')]))},client9002);return _0x8926dd;}return null;})[_0x4967('0x20')](respondWithResult(_0x7b0920,null))['catch'](handleError(_0x7b0920,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 9ff5b3c..298d6c9 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 _0x933a=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x2c4d31,_0x21f3a8){var _0x3a9785=function(_0x1fb5b8){while(--_0x1fb5b8){_0x2c4d31['push'](_0x2c4d31['shift']());}};_0x3a9785(++_0x21f3a8);}(_0x933a,0x10e));var _0xa933=function(_0x57e0ca,_0x596976){_0x57e0ca=_0x57e0ca-0x0;var _0x310a0a=_0x933a[_0x57e0ca];return _0x310a0a;};'use strict';var EventEmitter=require(_0xa933('0x0'));var ChatMessage=require(_0xa933('0x1'))['db'][_0xa933('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa933('0x3')](0x0);var events={'afterCreate':_0xa933('0x4'),'afterUpdate':_0xa933('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1bd700){return function(_0x2f2870,_0x19634e,_0x3eda65){ChatMessageEvents[_0xa933('0x6')](_0x1bd700+':'+_0x2f2870['id'],_0x2f2870);ChatMessageEvents[_0xa933('0x6')](_0x1bd700,_0x2f2870);_0x3eda65(null);};}for(var e in events){if(events[_0xa933('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xa933('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xb2b7=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2b7,0x139));var _0x7b2b=function(_0x31d512,_0x1eede5){_0x31d512=_0x31d512-0x0;var _0x30b8d7=_0xb2b7[_0x31d512];return _0x30b8d7;};'use strict';var EventEmitter=require(_0x7b2b('0x0'));var ChatMessage=require(_0x7b2b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7b2b('0x2')](0x0);var events={'afterCreate':_0x7b2b('0x3'),'afterUpdate':'update','afterDestroy':_0x7b2b('0x4')};function emitEvent(_0x4d66dc){return function(_0xc34c0f,_0x41c7bb,_0x36f509){ChatMessageEvents[_0x7b2b('0x5')](_0x4d66dc+':'+_0xc34c0f['id'],_0xc34c0f);ChatMessageEvents['emit'](_0x4d66dc,_0xc34c0f);_0x36f509(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7b2b('0x6')](e,emitEvent(event));}}module[_0x7b2b('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 51ccb15..c1a6dd0 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 _0xd3fe=['findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0xe8c105,_0x2ed540){var _0x27f9ab=function(_0x1199b0){while(--_0x1199b0){_0xe8c105['push'](_0xe8c105['shift']());}};_0x27f9ab(++_0x2ed540);}(_0xd3fe,0xb2));var _0xed3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xed3f('0x0'));var logger=require(_0xed3f('0x1'))(_0xed3f('0x2'));var moment=require(_0xed3f('0x3'));var BPromise=require(_0xed3f('0x4'));var rp=require(_0xed3f('0x5'));var fs=require('fs');var path=require(_0xed3f('0x6'));var rimraf=require(_0xed3f('0x7'));var config=require(_0xed3f('0x8'));var attributes=require(_0xed3f('0x9'));module[_0xed3f('0xa')]=function(_0xe6f2d6,_0x5b42ee){return _0xe6f2d6[_0xed3f('0xb')](_0xed3f('0xc'),attributes,{'tableName':_0xed3f('0xd'),'paranoid':![],'indexes':[{'name':_0xed3f('0xe'),'fields':[_0xed3f('0xf')],'type':_0xed3f('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bfa6c,_0x71e089,_0x3989e8){var _0x29e571=_0xe6f2d6[_0xed3f('0x11')];var _0xcc1f13=_0x1bfa6c[_0xed3f('0x12')]({'plain':!![]});if(_0xcc1f13[_0xed3f('0x13')][_0xed3f('0x14')]()==='in'||_0xcc1f13[_0xed3f('0x13')][_0xed3f('0x14')]()===_0xed3f('0x15')&&!_0xcc1f13[_0xed3f('0x16')]&&!_[_0xed3f('0x17')](_0xcc1f13[_0xed3f('0x18')])){_0x29e571[_0xed3f('0x19')][_0xed3f('0x1a')]({'where':{'id':_0xcc1f13[_0xed3f('0x1b')]}})[_0xed3f('0x1c')](function(_0x3fbe29){if(_0x3fbe29){_0x3fbe29['update']({'lastMsgAt':_0xcc1f13[_0xed3f('0x1d')],'lastMsgDirection':_0xcc1f13[_0xed3f('0x13')][_0xed3f('0x14')]()});}})[_0xed3f('0x1e')](function(_0xa2ec97){console[_0xed3f('0x1f')](_0xa2ec97);});}_0x3989e8();}},'charset':_0xed3f('0x20'),'collate':_0xed3f('0x21')});}; \ No newline at end of file +var _0x1d88=['utf8mb4_unicode_ci','lodash','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0x1d88,0x65));var _0x81d8=function(_0x12c271,_0x5dc611){_0x12c271=_0x12c271-0x0;var _0x202a3b=_0x1d88[_0x12c271];return _0x202a3b;};'use strict';var _=require(_0x81d8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x81d8('0x1'));var BPromise=require('bluebird');var rp=require(_0x81d8('0x2'));var fs=require('fs');var path=require(_0x81d8('0x3'));var rimraf=require(_0x81d8('0x4'));var config=require(_0x81d8('0x5'));var attributes=require(_0x81d8('0x6'));module['exports']=function(_0x402af,_0x54335f){return _0x402af['define'](_0x81d8('0x7'),attributes,{'tableName':_0x81d8('0x8'),'paranoid':![],'indexes':[{'name':_0x81d8('0x9'),'fields':[_0x81d8('0xa')],'type':_0x81d8('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5533df,_0x2bae1d,_0x29d9a7){var _0xf20338=_0x402af[_0x81d8('0xc')];var _0xf78d5f=_0x5533df['get']({'plain':!![]});if(_0xf78d5f[_0x81d8('0xd')][_0x81d8('0xe')]()==='in'||_0xf78d5f[_0x81d8('0xd')]['toLowerCase']()==='out'&&!_0xf78d5f['secret']&&!_[_0x81d8('0xf')](_0xf78d5f[_0x81d8('0x10')])){_0xf20338[_0x81d8('0x11')][_0x81d8('0x12')]({'where':{'id':_0xf78d5f[_0x81d8('0x13')]}})[_0x81d8('0x14')](function(_0x2fdd83){if(_0x2fdd83){_0x2fdd83[_0x81d8('0x15')]({'lastMsgAt':_0xf78d5f['createdAt'],'lastMsgDirection':_0xf78d5f[_0x81d8('0xd')]['toLowerCase']()});}})[_0x81d8('0x16')](function(_0x2ef405){console['error'](_0x2ef405);});}_0x29d9a7();}},'charset':_0x81d8('0x17'),'collate':_0x81d8('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 759c8d5..74fe174 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 _0xc6a7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatMessage.socket','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','body','options','raw','then','moment'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xc6a7,0x192));var _0x7c6a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xc6a7[_0x47fd36];return _0x21a0fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c6a('0x0'));var BPromise=require(_0x7c6a('0x1'));var rs=require(_0x7c6a('0x2'));var fs=require('fs');var Redis=require(_0x7c6a('0x3'));var db=require(_0x7c6a('0x4'))['db'];var utils=require(_0x7c6a('0x5'));var logger=require(_0x7c6a('0x6'))(_0x7c6a('0x7'));var config=require(_0x7c6a('0x8'));var jayson=require(_0x7c6a('0x9'));var client=jayson[_0x7c6a('0xa')][_0x7c6a('0xb')]({'port':0x232a});config[_0x7c6a('0xc')]=_['defaults'](config[_0x7c6a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c6a('0xc')]));require(_0x7c6a('0xd'))['register'](socket);function respondWithRpcPromise(_0xc2ec8a,_0x275baf,_0x56255d){return new BPromise(function(_0x50ea36,_0x4c9376){return client[_0x7c6a('0xe')](_0xc2ec8a,_0x56255d)['then'](function(_0x411fde){logger[_0x7c6a('0xf')]('ChatMessage,\x20%s,\x20%s',_0x275baf,_0x7c6a('0x10'));logger[_0x7c6a('0x11')](_0x7c6a('0x12'),_0x275baf,_0x7c6a('0x10'),JSON[_0x7c6a('0x13')](_0x411fde));if(_0x411fde['error']){if(_0x411fde[_0x7c6a('0x14')][_0x7c6a('0x15')]===0x1f4){logger[_0x7c6a('0x14')](_0x7c6a('0x16'),_0x275baf,_0x411fde[_0x7c6a('0x14')][_0x7c6a('0x17')]);return _0x4c9376(_0x411fde[_0x7c6a('0x14')]['message']);}logger['error'](_0x7c6a('0x16'),_0x275baf,_0x411fde[_0x7c6a('0x14')][_0x7c6a('0x17')]);return _0x50ea36(_0x411fde[_0x7c6a('0x14')][_0x7c6a('0x17')]);}else{logger[_0x7c6a('0xf')](_0x7c6a('0x16'),_0x275baf,_0x7c6a('0x10'));_0x50ea36(_0x411fde['result'][_0x7c6a('0x17')]);}})[_0x7c6a('0x18')](function(_0x3bad64){logger['error'](_0x7c6a('0x16'),_0x275baf,_0x3bad64);_0x4c9376(_0x3bad64);});});}exports[_0x7c6a('0x19')]=function(_0x292502){var _0x340fad=this;return new Promise(function(_0x32ce51,_0x506555){return db[_0x7c6a('0x1a')]['create'](_0x292502[_0x7c6a('0x1b')],{'raw':_0x292502['options']?_0x292502[_0x7c6a('0x1c')][_0x7c6a('0x1d')]===undefined?!![]:![]:!![]})[_0x7c6a('0x1e')](function(_0x43865a){logger[_0x7c6a('0xf')](_0x7c6a('0x19'),_0x292502);logger[_0x7c6a('0x11')]('CreateChatMessage',_0x292502,JSON['stringify'](_0x43865a));_0x32ce51(_0x43865a);})['catch'](function(_0x33f4fb){logger[_0x7c6a('0x14')](_0x7c6a('0x19'),_0x33f4fb[_0x7c6a('0x17')],_0x292502);_0x506555(_0x340fad[_0x7c6a('0x14')](0x1f4,_0x33f4fb[_0x7c6a('0x17')]));});});}; \ No newline at end of file +var _0x5c79=['client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x33801e,_0x1dfcaf){var _0x4b8a03=function(_0xe7cfe0){while(--_0xe7cfe0){_0x33801e['push'](_0x33801e['shift']());}};_0x4b8a03(++_0x1dfcaf);}(_0x5c79,0x18c));var _0x95c7=function(_0xdaf736,_0xd8c667){_0xdaf736=_0xdaf736-0x0;var _0x1090b3=_0x5c79[_0xdaf736];return _0x1090b3;};'use strict';var _=require('lodash');var util=require(_0x95c7('0x0'));var moment=require(_0x95c7('0x1'));var BPromise=require(_0x95c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x95c7('0x4'));var config=require(_0x95c7('0x5'));var jayson=require(_0x95c7('0x6'));var client=jayson[_0x95c7('0x7')]['http']({'port':0x232a});config[_0x95c7('0x8')]=_[_0x95c7('0x9')](config[_0x95c7('0x8')],{'host':_0x95c7('0xa'),'port':0x18eb});var socket=require(_0x95c7('0xb'))(new Redis(config[_0x95c7('0x8')]));require(_0x95c7('0xc'))[_0x95c7('0xd')](socket);function respondWithRpcPromise(_0x5e205c,_0x18a8a1,_0x107c87){return new BPromise(function(_0x4c758d,_0x4670da){return client[_0x95c7('0xe')](_0x5e205c,_0x107c87)[_0x95c7('0xf')](function(_0x5b266f){logger[_0x95c7('0x10')](_0x95c7('0x11'),_0x18a8a1,'request\x20sent');logger[_0x95c7('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x18a8a1,'request\x20sent',JSON[_0x95c7('0x13')](_0x5b266f));if(_0x5b266f[_0x95c7('0x14')]){if(_0x5b266f[_0x95c7('0x14')][_0x95c7('0x15')]===0x1f4){logger['error'](_0x95c7('0x11'),_0x18a8a1,_0x5b266f[_0x95c7('0x14')][_0x95c7('0x16')]);return _0x4670da(_0x5b266f[_0x95c7('0x14')][_0x95c7('0x16')]);}logger['error'](_0x95c7('0x11'),_0x18a8a1,_0x5b266f['error'][_0x95c7('0x16')]);return _0x4c758d(_0x5b266f[_0x95c7('0x14')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x18a8a1,'request\x20sent');_0x4c758d(_0x5b266f[_0x95c7('0x17')][_0x95c7('0x16')]);}})['catch'](function(_0x4d65e1){logger[_0x95c7('0x14')](_0x95c7('0x11'),_0x18a8a1,_0x4d65e1);_0x4670da(_0x4d65e1);});});}exports[_0x95c7('0x18')]=function(_0x163818){var _0x57806a=this;return new Promise(function(_0x816b19,_0x15e838){return db[_0x95c7('0x19')][_0x95c7('0x1a')](_0x163818[_0x95c7('0x1b')],{'raw':_0x163818[_0x95c7('0x1c')]?_0x163818[_0x95c7('0x1c')][_0x95c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x50a9e7){logger[_0x95c7('0x10')]('CreateChatMessage',_0x163818);logger[_0x95c7('0x12')](_0x95c7('0x18'),_0x163818,JSON[_0x95c7('0x13')](_0x50a9e7));_0x816b19(_0x50a9e7);})[_0x95c7('0x1e')](function(_0x3afb25){logger[_0x95c7('0x14')](_0x95c7('0x18'),_0x3afb25[_0x95c7('0x16')],_0x163818);_0x15e838(_0x57806a[_0x95c7('0x14')](0x1f4,_0x3afb25[_0x95c7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4270184..21e0887 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 _0x7a08=['emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x256ad1,_0x397d6e){var _0x3348d5=function(_0x4c6f9b){while(--_0x4c6f9b){_0x256ad1['push'](_0x256ad1['shift']());}};_0x3348d5(++_0x397d6e);}(_0x7a08,0x11e));var _0x87a0=function(_0x16765f,_0x3dd736){_0x16765f=_0x16765f-0x0;var _0x1326d4=_0x7a08[_0x16765f];return _0x1326d4;};'use strict';var ChatMessageEvents=require(_0x87a0('0x0'));var events=[_0x87a0('0x1'),'remove','update'];function createListener(_0x305211,_0x5e6791){return function(_0x1b3e4d){_0x5e6791[_0x87a0('0x2')](_0x305211,_0x1b3e4d);};}function removeListener(_0x28c28f,_0x122d33){return function(){ChatMessageEvents[_0x87a0('0x3')](_0x28c28f,_0x122d33);};}exports[_0x87a0('0x4')]=function(_0x1b384a){for(var _0xf9199b=0x0,_0xde806e=events['length'];_0xf9199b<_0xde806e;_0xf9199b++){var _0x27736f=events[_0xf9199b];var _0x1bb04b=createListener(_0x87a0('0x5')+_0x27736f,_0x1b384a);ChatMessageEvents['on'](_0x27736f,_0x1bb04b);}}; \ No newline at end of file +var _0xcca7=['save','remove','update','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xcca7,0x1aa));var _0x7cca=function(_0x5ad7f8,_0x165de6){_0x5ad7f8=_0x5ad7f8-0x0;var _0x1d56d8=_0xcca7[_0x5ad7f8];return _0x1d56d8;};'use strict';var ChatMessageEvents=require(_0x7cca('0x0'));var events=[_0x7cca('0x1'),_0x7cca('0x2'),_0x7cca('0x3')];function createListener(_0x5cfce5,_0x4c311e){return function(_0x30823f){_0x4c311e['emit'](_0x5cfce5,_0x30823f);};}function removeListener(_0x3b86a4,_0x9523f7){return function(){ChatMessageEvents[_0x7cca('0x4')](_0x3b86a4,_0x9523f7);};}exports[_0x7cca('0x5')]=function(_0x1c6c95){for(var _0xe70805=0x0,_0x5aec51=events['length'];_0xe70805<_0x5aec51;_0xe70805++){var _0x937fad=events[_0xe70805];var _0xd7a28d=createListener(_0x7cca('0x6')+_0x937fad,_0x1c6c95);ChatMessageEvents['on'](_0x937fad,_0xd7a28d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e106ab4..80239c7 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 _0xb7b2=['update','/:id/accept','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb7b2,0x73));var _0x2b7b=function(_0x49aaf4,_0x294ae3){_0x49aaf4=_0x49aaf4-0x0;var _0x21db9c=_0xb7b2[_0x49aaf4];return _0x21db9c;};'use strict';var multer=require(_0x2b7b('0x0'));var util=require(_0x2b7b('0x1'));var path=require(_0x2b7b('0x2'));var timeout=require(_0x2b7b('0x3'));var express=require(_0x2b7b('0x4'));var router=express[_0x2b7b('0x5')]();var fs_extra=require(_0x2b7b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b7b('0x7'));router[_0x2b7b('0x8')]('/',auth[_0x2b7b('0x9')](),controller['index']);router[_0x2b7b('0x8')](_0x2b7b('0xa'),auth[_0x2b7b('0x9')](),controller[_0x2b7b('0xb')]);router[_0x2b7b('0x8')](_0x2b7b('0xc'),auth[_0x2b7b('0x9')](),controller[_0x2b7b('0xd')]);router[_0x2b7b('0xe')]('/',auth['isAuthenticated'](),interaction[_0x2b7b('0xf')]('chat','chatmessage:create'),controller['create']);router[_0x2b7b('0x10')](_0x2b7b('0xc'),controller[_0x2b7b('0x11')]);router[_0x2b7b('0x10')](_0x2b7b('0x12'),auth[_0x2b7b('0x9')](),controller['accept']);router['put']('/:id/reject',auth[_0x2b7b('0x9')](),controller[_0x2b7b('0x13')]);router[_0x2b7b('0x14')](_0x2b7b('0xc'),auth[_0x2b7b('0x9')](),controller[_0x2b7b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xab5b=['isAuthenticated','/describe','/:id','tracked','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get'];(function(_0x10165c,_0x5ad2b4){var _0x454073=function(_0x3ca33c){while(--_0x3ca33c){_0x10165c['push'](_0x10165c['shift']());}};_0x454073(++_0x5ad2b4);}(_0xab5b,0x140));var _0xbab5=function(_0x4a04c8,_0x3a1a75){_0x4a04c8=_0x4a04c8-0x0;var _0x2940e5=_0xab5b[_0x4a04c8];return _0x2940e5;};'use strict';var multer=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var path=require(_0xbab5('0x2'));var timeout=require(_0xbab5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbab5('0x4'));var auth=require(_0xbab5('0x5'));var interaction=require(_0xbab5('0x6'));var config=require(_0xbab5('0x7'));var controller=require(_0xbab5('0x8'));router[_0xbab5('0x9')]('/',auth[_0xbab5('0xa')](),controller['index']);router['get'](_0xbab5('0xb'),auth[_0xbab5('0xa')](),controller['describe']);router[_0xbab5('0x9')](_0xbab5('0xc'),auth[_0xbab5('0xa')](),controller['show']);router['post']('/',auth[_0xbab5('0xa')](),interaction[_0xbab5('0xd')]('chat',_0xbab5('0xe')),controller['create']);router[_0xbab5('0xf')]('/:id',controller['update']);router[_0xbab5('0xf')](_0xbab5('0x10'),auth[_0xbab5('0xa')](),controller[_0xbab5('0x11')]);router['put'](_0xbab5('0x12'),auth[_0xbab5('0xa')](),controller[_0xbab5('0x13')]);router['delete'](_0xbab5('0xc'),auth[_0xbab5('0xa')](),controller[_0xbab5('0x14')]);module[_0xbab5('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 1315c79..8018da8 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 _0xadb5=['medium','TEXT','exports'];(function(_0x792c70,_0x529c8a){var _0x3ed360=function(_0x3aba36){while(--_0x3aba36){_0x792c70['push'](_0x792c70['shift']());}};_0x3ed360(++_0x529c8a);}(_0xadb5,0xad));var _0x5adb=function(_0x3088bb,_0x36b664){_0x3088bb=_0x3088bb-0x0;var _0x4c1933=_0xadb5[_0x3088bb];return _0x4c1933;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x757a=['exports','TEXT'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x757a,0xde));var _0xa757=function(_0x60e968,_0x456166){_0x60e968=_0x60e968-0x0;var _0x4b74bf=_0x757a[_0x60e968];return _0x4b74bf;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index eefae5b..80926bc 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(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x7a54,0x106));var _0x47a5=function(_0x3bdd4e,_0xf68595){_0x3bdd4e=_0x3bdd4e-0x0;var _0x4b75ad=_0x7a54[_0x3bdd4e];return _0x4b75ad;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x7a54,0x106));var _0x47a5=function(_0x52bef4,_0xd6d415){_0x52bef4=_0x52bef4-0x0;var _0xc0f3ba=_0x7a54[_0x52bef4];return _0xc0f3ba;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 3ee4d00..caf4789 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 _0xde7f=['remove','emit','hasOwnProperty','hook','setMaxListeners','save'];(function(_0x43ff14,_0x15b402){var _0x18925e=function(_0x471299){while(--_0x471299){_0x43ff14['push'](_0x43ff14['shift']());}};_0x18925e(++_0x15b402);}(_0xde7f,0x1f0));var _0xfde7=function(_0x600be6,_0x303ba9){_0x600be6=_0x600be6-0x0;var _0x2e3879=_0xde7f[_0x600be6];return _0x2e3879;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xfde7('0x0')](0x0);var events={'afterCreate':_0xfde7('0x1'),'afterUpdate':'update','afterDestroy':_0xfde7('0x2')};function emitEvent(_0x56cf2f){return function(_0x56bb08,_0x505273,_0x5749bc){ChatOfflineMessageEvents['emit'](_0x56cf2f+':'+_0x56bb08['id'],_0x56bb08);ChatOfflineMessageEvents[_0xfde7('0x3')](_0x56cf2f,_0x56bb08);_0x5749bc(null);};}for(var e in events){if(events[_0xfde7('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xfde7('0x5')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xac1b=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xac1b,0x10e));var _0xbac1=function(_0x231c21,_0x4d9f60){_0x231c21=_0x231c21-0x0;var _0x5120a5=_0xac1b[_0x231c21];return _0x5120a5;};'use strict';var EventEmitter=require(_0xbac1('0x0'));var ChatOfflineMessage=require(_0xbac1('0x1'))['db'][_0xbac1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xbac1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbac1('0x4'),'afterDestroy':_0xbac1('0x5')};function emitEvent(_0x1d9d38){return function(_0x423663,_0x299439,_0x30d2f4){ChatOfflineMessageEvents['emit'](_0x1d9d38+':'+_0x423663['id'],_0x423663);ChatOfflineMessageEvents[_0xbac1('0x6')](_0x1d9d38,_0x423663);_0x30d2f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xbac1('0x7')](e,emitEvent(event));}}module[_0xbac1('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 56b757f..d88c046 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 _0x354e=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x31180d,_0x5cfd35){var _0x538978=function(_0x2e2205){while(--_0x2e2205){_0x31180d['push'](_0x31180d['shift']());}};_0x538978(++_0x5cfd35);}(_0x354e,0x116));var _0xe354=function(_0xccd93b,_0x10a53d){_0xccd93b=_0xccd93b-0x0;var _0x54e149=_0x354e[_0xccd93b];return _0x54e149;};'use strict';var attributes=require(_0xe354('0x0'));module[_0xe354('0x1')]=function(_0x50a323){return _0x50a323[_0xe354('0x2')](_0xe354('0x3'),attributes,{'tableName':_0xe354('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe354('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8dc9=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x15ddc9,_0x209223){var _0x2fc9e8=function(_0x2d5e5f){while(--_0x2d5e5f){_0x15ddc9['push'](_0x15ddc9['shift']());}};_0x2fc9e8(++_0x209223);}(_0x8dc9,0x9f));var _0x98dc=function(_0x141322,_0x4a2018){_0x141322=_0x141322-0x0;var _0x434829=_0x8dc9[_0x141322];return _0x434829;};'use strict';var attributes=require(_0x98dc('0x0'));module[_0x98dc('0x1')]=function(_0x540181){return _0x540181[_0x98dc('0x2')](_0x98dc('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98dc('0x4'),'collate':_0x98dc('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 089347b..a6443c1 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 _0xa220=['message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2774a7,_0x370440){var _0x5aadbf=function(_0x275ebc){while(--_0x275ebc){_0x2774a7['push'](_0x2774a7['shift']());}};_0x5aadbf(++_0x370440);}(_0xa220,0x100));var _0x0a22=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa220[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0a22('0x0'));var util=require(_0x0a22('0x1'));var moment=require(_0x0a22('0x2'));var BPromise=require(_0x0a22('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a22('0x4'))['db'];var utils=require(_0x0a22('0x5'));var logger=require(_0x0a22('0x6'))(_0x0a22('0x7'));var config=require(_0x0a22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a22('0x9')][_0x0a22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1583a9,_0x18249b,_0x4609b6){return new BPromise(function(_0x3822fd,_0x63a927){return client[_0x0a22('0xb')](_0x1583a9,_0x4609b6)[_0x0a22('0xc')](function(_0x409b3c){logger['info'](_0x0a22('0xd'),_0x18249b,_0x0a22('0xe'));logger[_0x0a22('0xf')](_0x0a22('0x10'),_0x18249b,_0x0a22('0xe'),JSON[_0x0a22('0x11')](_0x409b3c));if(_0x409b3c[_0x0a22('0x12')]){if(_0x409b3c[_0x0a22('0x12')][_0x0a22('0x13')]===0x1f4){logger[_0x0a22('0x12')](_0x0a22('0xd'),_0x18249b,_0x409b3c['error']['message']);return _0x63a927(_0x409b3c[_0x0a22('0x12')][_0x0a22('0x14')]);}logger[_0x0a22('0x12')](_0x0a22('0xd'),_0x18249b,_0x409b3c[_0x0a22('0x12')][_0x0a22('0x14')]);return _0x3822fd(_0x409b3c[_0x0a22('0x12')][_0x0a22('0x14')]);}else{logger[_0x0a22('0x15')](_0x0a22('0xd'),_0x18249b,_0x0a22('0xe'));_0x3822fd(_0x409b3c[_0x0a22('0x16')][_0x0a22('0x14')]);}})['catch'](function(_0x1fb5dc){logger[_0x0a22('0x12')](_0x0a22('0xd'),_0x18249b,_0x1fb5dc);_0x63a927(_0x1fb5dc);});});} \ No newline at end of file +var _0xc19f=['jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1c72b8,_0x104b7e){var _0x191114=function(_0x5d76da){while(--_0x5d76da){_0x1c72b8['push'](_0x1c72b8['shift']());}};_0x191114(++_0x104b7e);}(_0xc19f,0xbc));var _0xfc19=function(_0x44d6bb,_0x43f171){_0x44d6bb=_0x44d6bb-0x0;var _0x167b7e=_0xc19f[_0x44d6bb];return _0x167b7e;};'use strict';var _=require(_0xfc19('0x0'));var util=require('util');var moment=require(_0xfc19('0x1'));var BPromise=require(_0xfc19('0x2'));var rs=require(_0xfc19('0x3'));var fs=require('fs');var Redis=require(_0xfc19('0x4'));var db=require(_0xfc19('0x5'))['db'];var utils=require(_0xfc19('0x6'));var logger=require(_0xfc19('0x7'))(_0xfc19('0x8'));var config=require(_0xfc19('0x9'));var jayson=require(_0xfc19('0xa'));var client=jayson[_0xfc19('0xb')][_0xfc19('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10528d,_0x52cc63,_0x1e74ea){return new BPromise(function(_0x2ee390,_0x4fb397){return client[_0xfc19('0xd')](_0x10528d,_0x1e74ea)['then'](function(_0x3892f8){logger[_0xfc19('0xe')](_0xfc19('0xf'),_0x52cc63,_0xfc19('0x10'));logger['debug'](_0xfc19('0x11'),_0x52cc63,'request\x20sent',JSON[_0xfc19('0x12')](_0x3892f8));if(_0x3892f8['error']){if(_0x3892f8['error']['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x52cc63,_0x3892f8[_0xfc19('0x13')][_0xfc19('0x14')]);return _0x4fb397(_0x3892f8[_0xfc19('0x13')][_0xfc19('0x14')]);}logger[_0xfc19('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52cc63,_0x3892f8[_0xfc19('0x13')][_0xfc19('0x14')]);return _0x2ee390(_0x3892f8['error'][_0xfc19('0x14')]);}else{logger[_0xfc19('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52cc63,'request\x20sent');_0x2ee390(_0x3892f8[_0xfc19('0x15')][_0xfc19('0x14')]);}})['catch'](function(_0x458525){logger[_0xfc19('0x13')](_0xfc19('0xf'),_0x52cc63,_0x458525);_0x4fb397(_0x458525);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e885107..9d6f5bd 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 _0x7532=['/describe','describe','get','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index'];(function(_0xb2dbed,_0x4ab5f3){var _0x50a42e=function(_0x25298d){while(--_0x25298d){_0xb2dbed['push'](_0xb2dbed['shift']());}};_0x50a42e(++_0x4ab5f3);}(_0x7532,0x1c2));var _0x2753=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x7532[_0x2ac5f8];return _0x3b8229;};'use strict';var multer=require(_0x2753('0x0'));var util=require(_0x2753('0x1'));var path=require(_0x2753('0x2'));var timeout=require(_0x2753('0x3'));var express=require('express');var router=express[_0x2753('0x4')]();var fs_extra=require(_0x2753('0x5'));var auth=require(_0x2753('0x6'));var interaction=require(_0x2753('0x7'));var config=require(_0x2753('0x8'));var controller=require(_0x2753('0x9'));router['get']('/',auth[_0x2753('0xa')](),controller[_0x2753('0xb')]);router['get'](_0x2753('0xc'),auth[_0x2753('0xa')](),controller[_0x2753('0xd')]);router[_0x2753('0xe')](_0x2753('0xf'),auth[_0x2753('0xa')](),controller[_0x2753('0x10')]);router['post']('/',auth[_0x2753('0xa')](),controller[_0x2753('0x11')]);router['put'](_0x2753('0xf'),auth['isAuthenticated'](),controller[_0x2753('0x12')]);router[_0x2753('0x13')](_0x2753('0xf'),auth['isAuthenticated'](),controller[_0x2753('0x14')]);module[_0x2753('0x15')]=router; \ No newline at end of file +var _0x343f=['/describe','describe','/:id','isAuthenticated','show','create','put','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x27fb22,_0xab9f66){var _0x2046fc=function(_0x1a692c){while(--_0x1a692c){_0x27fb22['push'](_0x27fb22['shift']());}};_0x2046fc(++_0xab9f66);}(_0x343f,0x13a));var _0xf343=function(_0x40b2ca,_0x478f0e){_0x40b2ca=_0x40b2ca-0x0;var _0x4fd998=_0x343f[_0x40b2ca];return _0x4fd998;};'use strict';var multer=require('multer');var util=require(_0xf343('0x0'));var path=require(_0xf343('0x1'));var timeout=require(_0xf343('0x2'));var express=require(_0xf343('0x3'));var router=express['Router']();var fs_extra=require(_0xf343('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf343('0x5'));var config=require(_0xf343('0x6'));var controller=require(_0xf343('0x7'));router[_0xf343('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf343('0x8')](_0xf343('0x9'),auth['isAuthenticated'](),controller[_0xf343('0xa')]);router[_0xf343('0x8')](_0xf343('0xb'),auth[_0xf343('0xc')](),controller[_0xf343('0xd')]);router['post']('/',auth[_0xf343('0xc')](),controller[_0xf343('0xe')]);router[_0xf343('0xf')]('/:id',auth[_0xf343('0xc')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf343('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f0ea763..d37b6c5 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 _0xadb2=['ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x13d757,_0xb9e660){var _0x1766f9=function(_0x153028){while(--_0x153028){_0x13d757['push'](_0x13d757['shift']());}};_0x1766f9(++_0xb9e660);}(_0xadb2,0x152));var _0x2adb=function(_0x3ea8c1,_0x330ece){_0x3ea8c1=_0x3ea8c1-0x0;var _0x280b69=_0xadb2[_0x3ea8c1];return _0x280b69;};'use strict';var Sequelize=require(_0x2adb('0x0'));module[_0x2adb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2adb('0x2')](_0x2adb('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2adb('0x4')]}}; \ No newline at end of file +var _0x4c62=['sequelize','exports','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x3b9cf7,_0x2d1288){var _0x5ece02=function(_0x25821b){while(--_0x25821b){_0x3b9cf7['push'](_0x3b9cf7['shift']());}};_0x5ece02(++_0x2d1288);}(_0x4c62,0x1b2));var _0x24c6=function(_0x305693,_0x4abb0f){_0x305693=_0x305693-0x0;var _0x46a81a=_0x4c62[_0x305693];return _0x46a81a;};'use strict';var Sequelize=require(_0x24c6('0x0'));module[_0x24c6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x24c6('0x2')](_0x24c6('0x3'),_0x24c6('0x4')),'defaultValue':_0x24c6('0x3')},'selector':{'type':Sequelize[_0x24c6('0x5')]},'timeout':{'type':Sequelize[_0x24c6('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1988d9d..ad15788 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 _0xdbf5=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x224e85,_0x11665b){var _0x3ed819=function(_0x297aa1){while(--_0x297aa1){_0x224e85['push'](_0x224e85['shift']());}};_0x3ed819(++_0x11665b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5d1c67,_0x240ebe){_0x5d1c67=_0x5d1c67-0x0;var _0x452ef4=_0xdbf5[_0x5d1c67];return _0x452ef4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={'raw':!![],'where':{'id':_0x471027[_0x5dbf('0x28')]['id']}},_0x2f71eb={};_0x2f71eb[_0x5dbf('0x29')]=_[_0x5dbf('0x2a')](db[_0x5dbf('0x2b')][_0x5dbf('0x2c')]);_0x2f71eb[_0x5dbf('0x2d')]=_[_0x5dbf('0x2a')](_0x471027[_0x5dbf('0x2d')]);_0x2f71eb[_0x5dbf('0x2e')]=_[_0x5dbf('0x2f')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x30')]=_[_0x5dbf('0x2f')](_0x2f71eb[_0x5dbf('0x29')],qs[_0x5dbf('0x31')](_0x471027[_0x5dbf('0x2d')]['fields']));_0x5768b7['attributes']=_0x5768b7[_0x5dbf('0x30')][_0x5dbf('0x32')]?_0x5768b7['attributes']:_0x2f71eb[_0x5dbf('0x29')];if(_0x471027[_0x5dbf('0x2d')][_0x5dbf('0x33')]){_0x5768b7[_0x5dbf('0x34')]=[{'all':!![]}];}_0x5768b7=_[_0x5dbf('0x35')]({},_0x5768b7,_0x471027['options']);return db[_0x5dbf('0x2b')][_0x5dbf('0x36')](_0x5768b7)[_0x5dbf('0x20')](handleEntityNotFound(_0x21cd00,null))[_0x5dbf('0x20')](respondWithResult(_0x21cd00,null))[_0x5dbf('0x37')](handleError(_0x21cd00,null));};exports['create']=function(_0x252d54,_0x7dc2da){return db[_0x5dbf('0x2b')][_0x5dbf('0x38')](_0x252d54['body'],{})[_0x5dbf('0x20')](respondWithResult(_0x7dc2da,0xc9))[_0x5dbf('0x37')](handleError(_0x7dc2da,null));};exports[_0x5dbf('0x1f')]=function(_0x3439da,_0x3e309a){if(_0x3439da[_0x5dbf('0x39')]['id']){delete _0x3439da[_0x5dbf('0x39')]['id'];}return db[_0x5dbf('0x2b')][_0x5dbf('0x36')]({'where':{'id':_0x3439da[_0x5dbf('0x28')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x3e309a,null))['then'](saveUpdates(_0x3439da[_0x5dbf('0x39')],null))[_0x5dbf('0x20')](respondWithResult(_0x3e309a,null))[_0x5dbf('0x37')](handleError(_0x3e309a,null));};exports['destroy']=function(_0x31de38,_0x43954b){return db[_0x5dbf('0x2b')]['find']({'where':{'id':_0x31de38[_0x5dbf('0x28')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x43954b,null))[_0x5dbf('0x20')](removeEntity(_0x43954b,null))['catch'](handleError(_0x43954b,null));}; \ No newline at end of file +var _0xa631=['query','intersection','fields','attributes','length','merge','ChatProactiveAction','create','body','catch','find','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','rawAttributes'];(function(_0xe046bb,_0x8cf545){var _0x1e047a=function(_0x2066c8){while(--_0x2066c8){_0xe046bb['push'](_0xe046bb['shift']());}};_0x1e047a(++_0x8cf545);}(_0xa631,0xe4));var _0x1a63=function(_0x3f7a4b,_0x12c78e){_0x3f7a4b=_0x3f7a4b-0x0;var _0x2f92fb=_0xa631[_0x3f7a4b];return _0x2f92fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a63('0x0'));var zipdir=require(_0x1a63('0x1'));var jsonpatch=require(_0x1a63('0x2'));var rp=require('request-promise');var moment=require(_0x1a63('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a63('0x4'));var path=require(_0x1a63('0x5'));var sox=require(_0x1a63('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a63('0x7'));var crypto=require(_0x1a63('0x8'));var jsforce=require(_0x1a63('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a63('0xa'));var Papa=require(_0x1a63('0xb'));var Redis=require(_0x1a63('0xc'));var authService=require(_0x1a63('0xd'));var qs=require(_0x1a63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a63('0xf'));var logger=require(_0x1a63('0x10'))(_0x1a63('0x11'));var utils=require(_0x1a63('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1a63('0x13'));var db=require(_0x1a63('0x14'))['db'];function respondWithStatusCode(_0x32269d,_0x55307f){_0x55307f=_0x55307f||0xcc;return function(_0xd7e70c){if(_0xd7e70c){return _0x32269d['sendStatus'](_0x55307f);}return _0x32269d[_0x1a63('0x15')](_0x55307f)[_0x1a63('0x16')]();};}function respondWithResult(_0x44bf20,_0x5301b6){_0x5301b6=_0x5301b6||0xc8;return function(_0x5b4ab8){if(_0x5b4ab8){return _0x44bf20[_0x1a63('0x15')](_0x5301b6)[_0x1a63('0x17')](_0x5b4ab8);}};}function respondWithFilteredResult(_0x436623,_0x3756e2){return function(_0x1c1e8c){if(_0x1c1e8c){var _0x4d66d4=typeof _0x3756e2[_0x1a63('0x18')]==='undefined'&&typeof _0x3756e2[_0x1a63('0x19')]===_0x1a63('0x1a');var _0x6a72c1=_0x1c1e8c[_0x1a63('0x1b')];var _0x52fdd1=_0x4d66d4?0x0:_0x3756e2[_0x1a63('0x18')];var _0x365ab8=_0x4d66d4?_0x1c1e8c[_0x1a63('0x1b')]:_0x3756e2[_0x1a63('0x18')]+_0x3756e2[_0x1a63('0x19')];var _0x491c8a;if(_0x365ab8>=_0x6a72c1){_0x365ab8=_0x6a72c1;_0x491c8a=0xc8;}else{_0x491c8a=0xce;}_0x436623[_0x1a63('0x15')](_0x491c8a);return _0x436623[_0x1a63('0x1c')]('Content-Range',_0x52fdd1+'-'+_0x365ab8+'/'+_0x6a72c1)[_0x1a63('0x17')](_0x1c1e8c);}return null;};}function patchUpdates(_0x444406){return function(_0x1e15a3){try{jsonpatch[_0x1a63('0x1d')](_0x1e15a3,_0x444406,!![]);}catch(_0x24646d){return BPromise[_0x1a63('0x1e')](_0x24646d);}return _0x1e15a3[_0x1a63('0x1f')]();};}function saveUpdates(_0x547d78,_0x3e4b57){return function(_0x524469){if(_0x524469){return _0x524469[_0x1a63('0x20')](_0x547d78)[_0x1a63('0x21')](function(_0x529be7){return _0x529be7;});}return null;};}function removeEntity(_0x564f9a,_0x58ff2){return function(_0x2c1a1f){if(_0x2c1a1f){return _0x2c1a1f[_0x1a63('0x22')]()[_0x1a63('0x21')](function(){_0x564f9a[_0x1a63('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233b12,_0x22b4e1){return function(_0x3b551f){if(!_0x3b551f){_0x233b12['sendStatus'](0x194);}return _0x3b551f;};}function handleError(_0x471f63,_0x41e05e){_0x41e05e=_0x41e05e||0x1f4;return function(_0x81548f){logger[_0x1a63('0x23')](_0x81548f['stack']);if(_0x81548f['name']){delete _0x81548f[_0x1a63('0x24')];}_0x471f63[_0x1a63('0x15')](_0x41e05e)[_0x1a63('0x25')](_0x81548f);};}exports[_0x1a63('0x26')]=function(_0xa125b3,_0x399570){var _0x5e6eee={'raw':!![],'where':{'id':_0xa125b3['params']['id']}},_0x177171={};_0x177171[_0x1a63('0x27')]=_[_0x1a63('0x28')](db['ChatProactiveAction'][_0x1a63('0x29')]);_0x177171[_0x1a63('0x2a')]=_[_0x1a63('0x28')](_0xa125b3[_0x1a63('0x2a')]);_0x177171['filters']=_['intersection'](_0x177171[_0x1a63('0x27')],_0x177171[_0x1a63('0x2a')]);_0x5e6eee['attributes']=_[_0x1a63('0x2b')](_0x177171[_0x1a63('0x27')],qs[_0x1a63('0x2c')](_0xa125b3[_0x1a63('0x2a')][_0x1a63('0x2c')]));_0x5e6eee[_0x1a63('0x2d')]=_0x5e6eee['attributes'][_0x1a63('0x2e')]?_0x5e6eee[_0x1a63('0x2d')]:_0x177171[_0x1a63('0x27')];if(_0xa125b3[_0x1a63('0x2a')]['includeAll']){_0x5e6eee['include']=[{'all':!![]}];}_0x5e6eee=_[_0x1a63('0x2f')]({},_0x5e6eee,_0xa125b3['options']);return db[_0x1a63('0x30')]['find'](_0x5e6eee)[_0x1a63('0x21')](handleEntityNotFound(_0x399570,null))[_0x1a63('0x21')](respondWithResult(_0x399570,null))['catch'](handleError(_0x399570,null));};exports[_0x1a63('0x31')]=function(_0x1cb941,_0x20b129){return db[_0x1a63('0x30')]['create'](_0x1cb941[_0x1a63('0x32')],{})[_0x1a63('0x21')](respondWithResult(_0x20b129,0xc9))[_0x1a63('0x33')](handleError(_0x20b129,null));};exports[_0x1a63('0x20')]=function(_0x3954a6,_0xbe34e1){if(_0x3954a6['body']['id']){delete _0x3954a6['body']['id'];}return db[_0x1a63('0x30')][_0x1a63('0x34')]({'where':{'id':_0x3954a6[_0x1a63('0x35')]['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0xbe34e1,null))[_0x1a63('0x21')](saveUpdates(_0x3954a6[_0x1a63('0x32')],null))['then'](respondWithResult(_0xbe34e1,null))[_0x1a63('0x33')](handleError(_0xbe34e1,null));};exports['destroy']=function(_0x59f1bc,_0x4c0f37){return db['ChatProactiveAction'][_0x1a63('0x34')]({'where':{'id':_0x59f1bc['params']['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0x4c0f37,null))['then'](removeEntity(_0x4c0f37,null))[_0x1a63('0x33')](handleError(_0x4c0f37,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 8f10ae7..684bfdc 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 _0xd9df=['path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4f6993,_0x372975){var _0x1e5f82=function(_0x81115e){while(--_0x81115e){_0x4f6993['push'](_0x4f6993['shift']());}};_0x1e5f82(++_0x372975);}(_0xd9df,0x15a));var _0xfd9d=function(_0x2b8ade,_0xffc2e){_0x2b8ade=_0x2b8ade-0x0;var _0x5dc3dc=_0xd9df[_0x2b8ade];return _0x5dc3dc;};'use strict';var _=require(_0xfd9d('0x0'));var util=require(_0xfd9d('0x1'));var logger=require('../../config/logger')(_0xfd9d('0x2'));var moment=require(_0xfd9d('0x3'));var BPromise=require(_0xfd9d('0x4'));var rp=require(_0xfd9d('0x5'));var fs=require('fs');var path=require(_0xfd9d('0x6'));var rimraf=require('rimraf');var config=require(_0xfd9d('0x7'));var attributes=require(_0xfd9d('0x8'));module[_0xfd9d('0x9')]=function(_0x54f01a,_0x177738){return _0x54f01a['define'](_0xfd9d('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d0a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger'];(function(_0x108d2a,_0x261e03){var _0xb786b3=function(_0x317c6c){while(--_0x317c6c){_0x108d2a['push'](_0x108d2a['shift']());}};_0xb786b3(++_0x261e03);}(_0x5d0a,0x166));var _0xa5d0=function(_0xa46ce1,_0x555872){_0xa46ce1=_0xa46ce1-0x0;var _0x3d2de9=_0x5d0a[_0xa46ce1];return _0x3d2de9;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var logger=require(_0xa5d0('0x1'))(_0xa5d0('0x2'));var moment=require(_0xa5d0('0x3'));var BPromise=require(_0xa5d0('0x4'));var rp=require(_0xa5d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var attributes=require(_0xa5d0('0x8'));module['exports']=function(_0xaafd51,_0x26aff2){return _0xaafd51[_0xa5d0('0x9')](_0xa5d0('0xa'),attributes,{'tableName':_0xa5d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 6767927..0345f92 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 _0x05b0=['../../config/environment','jayson/promise','client','http','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatProactiveAction,\x20%s,\x20%s','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x05b0,0x1db));var _0x005b=function(_0x50ab36,_0x4417d8){_0x50ab36=_0x50ab36-0x0;var _0x54988f=_0x05b0[_0x50ab36];return _0x54988f;};'use strict';var _=require(_0x005b('0x0'));var util=require(_0x005b('0x1'));var moment=require('moment');var BPromise=require(_0x005b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x005b('0x3'));var db=require(_0x005b('0x4'))['db'];var utils=require(_0x005b('0x5'));var logger=require(_0x005b('0x6'))(_0x005b('0x7'));var config=require(_0x005b('0x8'));var jayson=require(_0x005b('0x9'));var client=jayson[_0x005b('0xa')][_0x005b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40f9ff,_0x2d29a8,_0x33dc00){return new BPromise(function(_0x538f2b,_0x33d53e){return client['request'](_0x40f9ff,_0x33dc00)['then'](function(_0x2f5145){logger[_0x005b('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d29a8,'request\x20sent');logger[_0x005b('0xd')](_0x005b('0xe'),_0x2d29a8,_0x005b('0xf'),JSON[_0x005b('0x10')](_0x2f5145));if(_0x2f5145['error']){if(_0x2f5145['error'][_0x005b('0x11')]===0x1f4){logger[_0x005b('0x12')](_0x005b('0x13'),_0x2d29a8,_0x2f5145['error'][_0x005b('0x14')]);return _0x33d53e(_0x2f5145[_0x005b('0x12')][_0x005b('0x14')]);}logger[_0x005b('0x12')](_0x005b('0x13'),_0x2d29a8,_0x2f5145[_0x005b('0x12')][_0x005b('0x14')]);return _0x538f2b(_0x2f5145[_0x005b('0x12')]['message']);}else{logger[_0x005b('0xc')](_0x005b('0x13'),_0x2d29a8,_0x005b('0xf'));_0x538f2b(_0x2f5145['result'][_0x005b('0x14')]);}})['catch'](function(_0x256812){logger[_0x005b('0x12')](_0x005b('0x13'),_0x2d29a8,_0x256812);_0x33d53e(_0x256812);});});} \ No newline at end of file +var _0x0918=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x38d504,_0x477414){var _0x3a89d4=function(_0x5e459f){while(--_0x5e459f){_0x38d504['push'](_0x38d504['shift']());}};_0x3a89d4(++_0x477414);}(_0x0918,0x186));var _0x8091=function(_0x20114e,_0x22b501){_0x20114e=_0x20114e-0x0;var _0x3401af=_0x0918[_0x20114e];return _0x3401af;};'use strict';var _=require(_0x8091('0x0'));var util=require(_0x8091('0x1'));var moment=require(_0x8091('0x2'));var BPromise=require(_0x8091('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8091('0x4'));var db=require(_0x8091('0x5'))['db'];var utils=require(_0x8091('0x6'));var logger=require(_0x8091('0x7'))(_0x8091('0x8'));var config=require('../../config/environment');var jayson=require(_0x8091('0x9'));var client=jayson[_0x8091('0xa')][_0x8091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1de51b,_0x1842ea,_0x4a6714){return new BPromise(function(_0x36b9f3,_0x413020){return client[_0x8091('0xc')](_0x1de51b,_0x4a6714)[_0x8091('0xd')](function(_0x17bda3){logger[_0x8091('0xe')](_0x8091('0xf'),_0x1842ea,_0x8091('0x10'));logger[_0x8091('0x11')](_0x8091('0x12'),_0x1842ea,_0x8091('0x10'),JSON[_0x8091('0x13')](_0x17bda3));if(_0x17bda3['error']){if(_0x17bda3[_0x8091('0x14')][_0x8091('0x15')]===0x1f4){logger[_0x8091('0x14')](_0x8091('0xf'),_0x1842ea,_0x17bda3[_0x8091('0x14')][_0x8091('0x16')]);return _0x413020(_0x17bda3['error']['message']);}logger[_0x8091('0x14')](_0x8091('0xf'),_0x1842ea,_0x17bda3[_0x8091('0x14')][_0x8091('0x16')]);return _0x36b9f3(_0x17bda3[_0x8091('0x14')][_0x8091('0x16')]);}else{logger[_0x8091('0xe')](_0x8091('0xf'),_0x1842ea,_0x8091('0x10'));_0x36b9f3(_0x17bda3['result']['message']);}})[_0x8091('0x17')](function(_0x16a89a){logger[_0x8091('0x14')](_0x8091('0xf'),_0x1842ea,_0x16a89a);_0x413020(_0x16a89a);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 9af0d6d..b5c6a7c 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 _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x5b6158,_0x5945f3){var _0x3b997b=function(_0x3546a5){while(--_0x3546a5){_0x5b6158['push'](_0x5b6158['shift']());}};_0x3b997b(++_0x5945f3);}(_0xee14,0x13a));var _0x4ee1=function(_0x2663d7,_0x52e530){_0x2663d7=_0x2663d7-0x0;var _0x1e196b=_0xee14[_0x2663d7];return _0x1e196b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router; \ No newline at end of file +var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x426cad,_0x45810d){var _0x50c00f=function(_0x470ff6){while(--_0x470ff6){_0x426cad['push'](_0x426cad['shift']());}};_0x50c00f(++_0x45810d);}(_0xae24,0x182));var _0x4ae2=function(_0x61cfa6,_0x304f3b){_0x61cfa6=_0x61cfa6-0x0;var _0x422ba0=_0xae24[_0x61cfa6];return _0x422ba0;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 9fc3172..76c0a07 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 _0xa767=['roundrobin','sequelize','exports','name','INTEGER','ENUM','beepall'];(function(_0x4e2ed7,_0x30c7e8){var _0x1e96a6=function(_0x22f860){while(--_0x22f860){_0x4e2ed7['push'](_0x4e2ed7['shift']());}};_0x1e96a6(++_0x30c7e8);}(_0xa767,0xef));var _0x7a76=function(_0x186020,_0x1fc7f9){_0x186020=_0x186020-0x0;var _0x30380a=_0xa767[_0x186020];return _0x30380a;};'use strict';var Sequelize=require(_0x7a76('0x0'));module[_0x7a76('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7a76('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7a76('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7a76('0x4')]('rrmemory',_0x7a76('0x5'),_0x7a76('0x6'))}}; \ No newline at end of file +var _0x189e=['ENUM','rrmemory','beepall','exports','STRING','name','INTEGER'];(function(_0xa95a73,_0x1a75a4){var _0x386dbf=function(_0x214591){while(--_0x214591){_0xa95a73['push'](_0xa95a73['shift']());}};_0x386dbf(++_0x1a75a4);}(_0x189e,0xf8));var _0xe189=function(_0x47a573,_0x5677f5){_0x47a573=_0x47a573-0x0;var _0x69abbf=_0x189e[_0x47a573];return _0x69abbf;};'use strict';var Sequelize=require('sequelize');module[_0xe189('0x0')]={'name':{'type':Sequelize[_0xe189('0x1')],'unique':_0xe189('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe189('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe189('0x4')](_0xe189('0x5'),_0xe189('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 505bd15..b9301d4 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 _0xa7b6=['online','interface','flatMap','sequelize','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','find','describe','ChatQueueId','findAll','User','UserId','agent','updatedAt','format','SIP','chatPause','createdAt','Team','getTeams','ids','Agents'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa7b6,0x1e2));var _0x6a7b=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0xa7b6[_0x46d87a];return _0x115296;};'use strict';var emlformat=require(_0x6a7b('0x0'));var rimraf=require(_0x6a7b('0x1'));var zipdir=require(_0x6a7b('0x2'));var jsonpatch=require(_0x6a7b('0x3'));var rp=require(_0x6a7b('0x4'));var moment=require('moment');var BPromise=require(_0x6a7b('0x5'));var Mustache=require(_0x6a7b('0x6'));var util=require(_0x6a7b('0x7'));var path=require(_0x6a7b('0x8'));var sox=require(_0x6a7b('0x9'));var csv=require(_0x6a7b('0xa'));var ejs=require(_0x6a7b('0xb'));var fs=require('fs');var fs_extra=require(_0x6a7b('0xc'));var _=require('lodash');var squel=require(_0x6a7b('0xd'));var crypto=require(_0x6a7b('0xe'));var jsforce=require(_0x6a7b('0xf'));var deskjs=require(_0x6a7b('0x10'));var toCsv=require(_0x6a7b('0xa'));var querystring=require(_0x6a7b('0x11'));var Papa=require(_0x6a7b('0x12'));var Redis=require('ioredis');var authService=require(_0x6a7b('0x13'));var qs=require(_0x6a7b('0x14'));var as=require(_0x6a7b('0x15'));var hardwareService=require(_0x6a7b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x6a7b('0x17'));var config=require(_0x6a7b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7b('0x19'))['db'];config[_0x6a7b('0x1a')]=_[_0x6a7b('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a7b('0x1a')]));require(_0x6a7b('0x1c'))[_0x6a7b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6a7b('0x1e')][_0x6a7b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x10fd3d,_0x364445,_0x81b666,_0x2f382c){return new BPromise(function(_0x1a0df4,_0x384ba5){var _0x2ca0f1=_0x2f382c||client;return _0x2ca0f1['request'](_0x10fd3d,_0x81b666)[_0x6a7b('0x20')](function(_0x2dc884){logger[_0x6a7b('0x21')](_0x6a7b('0x22'),_0x364445,_0x6a7b('0x23'));logger[_0x6a7b('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x364445,'request\x20sent',JSON['stringify'](_0x2dc884));if(_0x2dc884[_0x6a7b('0x25')]){if(_0x2dc884[_0x6a7b('0x25')][_0x6a7b('0x26')]===0x1f4){logger[_0x6a7b('0x25')](_0x6a7b('0x22'),_0x364445,_0x2dc884['error']['message']);return _0x384ba5(_0x2dc884[_0x6a7b('0x25')][_0x6a7b('0x27')]);}logger[_0x6a7b('0x25')](_0x6a7b('0x22'),_0x364445,_0x2dc884['error'][_0x6a7b('0x27')]);return _0x1a0df4(_0x2dc884[_0x6a7b('0x25')][_0x6a7b('0x27')]);}else{logger['info'](_0x6a7b('0x22'),_0x364445,_0x6a7b('0x23'));_0x1a0df4(_0x2dc884[_0x6a7b('0x28')][_0x6a7b('0x27')]);}})[_0x6a7b('0x29')](function(_0x5e4f96){logger[_0x6a7b('0x25')]('ChatQueue,\x20%s,\x20%s',_0x364445,_0x5e4f96);_0x384ba5(_0x5e4f96);});});}function respondWithStatusCode(_0x358ec7,_0x379b59){_0x379b59=_0x379b59||0xcc;return function(_0x3818a9){if(_0x3818a9){return _0x358ec7[_0x6a7b('0x2a')](_0x379b59);}return _0x358ec7[_0x6a7b('0x2b')](_0x379b59)['end']();};}function respondWithResult(_0x42198c,_0x5076ff){_0x5076ff=_0x5076ff||0xc8;return function(_0x363125){if(_0x363125){return _0x42198c[_0x6a7b('0x2b')](_0x5076ff)[_0x6a7b('0x2c')](_0x363125);}};}function respondWithFilteredResult(_0x2f006c,_0x54e3fa){return function(_0x15c09a){if(_0x15c09a){var _0x11141f=typeof _0x54e3fa[_0x6a7b('0x2d')]==='undefined'&&typeof _0x54e3fa[_0x6a7b('0x2e')]===_0x6a7b('0x2f');var _0x494cd8=_0x15c09a[_0x6a7b('0x30')];var _0x1c6d15=_0x11141f?0x0:_0x54e3fa[_0x6a7b('0x2d')];var _0x3cd9be=_0x11141f?_0x15c09a[_0x6a7b('0x30')]:_0x54e3fa[_0x6a7b('0x2d')]+_0x54e3fa[_0x6a7b('0x2e')];var _0x499b8d;if(_0x3cd9be>=_0x494cd8){_0x3cd9be=_0x494cd8;_0x499b8d=0xc8;}else{_0x499b8d=0xce;}_0x2f006c[_0x6a7b('0x2b')](_0x499b8d);return _0x2f006c[_0x6a7b('0x31')](_0x6a7b('0x32'),_0x1c6d15+'-'+_0x3cd9be+'/'+_0x494cd8)[_0x6a7b('0x2c')](_0x15c09a);}return null;};}function patchUpdates(_0x1624d7){return function(_0x5544d1){try{jsonpatch[_0x6a7b('0x33')](_0x5544d1,_0x1624d7,!![]);}catch(_0x453171){return BPromise[_0x6a7b('0x34')](_0x453171);}return _0x5544d1[_0x6a7b('0x35')]();};}function saveUpdates(_0x4a7cfa,_0x2e9bfd){return function(_0x122a8b){if(_0x122a8b){return _0x122a8b[_0x6a7b('0x36')](_0x4a7cfa)[_0x6a7b('0x20')](function(_0x2513fd){return _0x2513fd;});}return null;};}function removeEntity(_0x2da23c,_0x1ffb70){return function(_0x9c9233){if(_0x9c9233){return _0x9c9233[_0x6a7b('0x37')]()[_0x6a7b('0x20')](function(){var _0x117e8c=_0x9c9233[_0x6a7b('0x38')]({'plain':!![]});var _0x545a22=_0x6a7b('0x39');return db[_0x6a7b('0x3a')][_0x6a7b('0x37')]({'where':{'type':_0x545a22,'resourceId':_0x117e8c['id']}})['then'](function(){return _0x9c9233;});})[_0x6a7b('0x20')](function(){_0x2da23c['status'](0xcc)[_0x6a7b('0x3b')]();});}};}function handleEntityNotFound(_0x4eb242,_0x3eeeea){return function(_0x5366e5){if(!_0x5366e5){_0x4eb242['sendStatus'](0x194);}return _0x5366e5;};}function handleError(_0x36ca41,_0x56610f){_0x56610f=_0x56610f||0x1f4;return function(_0x59c3ca){logger[_0x6a7b('0x25')](_0x59c3ca[_0x6a7b('0x3c')]);if(_0x59c3ca[_0x6a7b('0x3d')]){delete _0x59c3ca[_0x6a7b('0x3d')];}_0x36ca41[_0x6a7b('0x2b')](_0x56610f)[_0x6a7b('0x3e')](_0x59c3ca);};}exports['index']=function(_0x56c3d0,_0x686c40){var _0x480af9={},_0x46edd6={},_0x353dbf={'count':0x0,'rows':[]};var _0x548d97=_['map'](db[_0x6a7b('0x3f')][_0x6a7b('0x40')],function(_0x1b05fc){return{'name':_0x1b05fc[_0x6a7b('0x41')],'type':_0x1b05fc[_0x6a7b('0x42')][_0x6a7b('0x43')]};});_0x46edd6[_0x6a7b('0x44')]=_[_0x6a7b('0x45')](_0x548d97,_0x6a7b('0x3d'));_0x46edd6[_0x6a7b('0x46')]=_[_0x6a7b('0x47')](_0x56c3d0[_0x6a7b('0x46')]);_0x46edd6['filters']=_[_0x6a7b('0x48')](_0x46edd6[_0x6a7b('0x44')],_0x46edd6['query']);_0x480af9[_0x6a7b('0x49')]=_['intersection'](_0x46edd6[_0x6a7b('0x44')],qs[_0x6a7b('0x4a')](_0x56c3d0[_0x6a7b('0x46')][_0x6a7b('0x4a')]));_0x480af9[_0x6a7b('0x49')]=_0x480af9[_0x6a7b('0x49')]['length']?_0x480af9['attributes']:_0x46edd6[_0x6a7b('0x44')];if(!_0x56c3d0[_0x6a7b('0x46')][_0x6a7b('0x4b')](_0x6a7b('0x4c'))){_0x480af9[_0x6a7b('0x2e')]=qs[_0x6a7b('0x2e')](_0x56c3d0[_0x6a7b('0x46')][_0x6a7b('0x2e')]);_0x480af9['offset']=qs[_0x6a7b('0x2d')](_0x56c3d0[_0x6a7b('0x46')][_0x6a7b('0x2d')]);}_0x480af9[_0x6a7b('0x4d')]=qs[_0x6a7b('0x4e')](_0x56c3d0['query'][_0x6a7b('0x4e')]);_0x480af9[_0x6a7b('0x4f')]=qs[_0x6a7b('0x50')](_[_0x6a7b('0x51')](_0x56c3d0[_0x6a7b('0x46')],_0x46edd6[_0x6a7b('0x50')]),_0x548d97);if(_0x56c3d0['query'][_0x6a7b('0x52')]){_0x480af9[_0x6a7b('0x4f')]=_[_0x6a7b('0x53')](_0x480af9[_0x6a7b('0x4f')],{'$or':_[_0x6a7b('0x45')](_0x548d97,function(_0x4af59a){if(_0x4af59a[_0x6a7b('0x42')]!=='VIRTUAL'){var _0x10db57={};_0x10db57[_0x4af59a[_0x6a7b('0x3d')]]={'$like':'%'+_0x56c3d0[_0x6a7b('0x46')][_0x6a7b('0x52')]+'%'};return _0x10db57;}})});}_0x480af9=_[_0x6a7b('0x53')]({},_0x480af9,_0x56c3d0[_0x6a7b('0x54')]);var _0x424b8a={'where':_0x480af9['where']};return db['ChatQueue'][_0x6a7b('0x30')](_0x424b8a)[_0x6a7b('0x20')](function(_0x378d6d){_0x353dbf['count']=_0x378d6d;if(_0x56c3d0['query'][_0x6a7b('0x55')]){_0x480af9[_0x6a7b('0x56')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x480af9);})[_0x6a7b('0x20')](function(_0x559a7a){_0x353dbf[_0x6a7b('0x57')]=_0x559a7a;return _0x353dbf;})['then'](respondWithFilteredResult(_0x686c40,_0x480af9))['catch'](handleError(_0x686c40,null));};exports[_0x6a7b('0x58')]=function(_0x1f57e3,_0x15431d){var _0x43cf79={'raw':!![],'where':{'id':_0x1f57e3[_0x6a7b('0x59')]['id']}},_0xd5e09={};_0xd5e09[_0x6a7b('0x44')]=_['keys'](db[_0x6a7b('0x3f')][_0x6a7b('0x40')]);_0xd5e09[_0x6a7b('0x46')]=_['keys'](_0x1f57e3[_0x6a7b('0x46')]);_0xd5e09[_0x6a7b('0x50')]=_[_0x6a7b('0x48')](_0xd5e09[_0x6a7b('0x44')],_0xd5e09[_0x6a7b('0x46')]);_0x43cf79[_0x6a7b('0x49')]=_[_0x6a7b('0x48')](_0xd5e09[_0x6a7b('0x44')],qs[_0x6a7b('0x4a')](_0x1f57e3[_0x6a7b('0x46')][_0x6a7b('0x4a')]));_0x43cf79[_0x6a7b('0x49')]=_0x43cf79[_0x6a7b('0x49')][_0x6a7b('0x5a')]?_0x43cf79[_0x6a7b('0x49')]:_0xd5e09[_0x6a7b('0x44')];if(_0x1f57e3['query'][_0x6a7b('0x55')]){_0x43cf79[_0x6a7b('0x56')]=[{'all':!![]}];}_0x43cf79=_[_0x6a7b('0x53')]({},_0x43cf79,_0x1f57e3[_0x6a7b('0x54')]);return db[_0x6a7b('0x3f')]['find'](_0x43cf79)[_0x6a7b('0x20')](handleEntityNotFound(_0x15431d,null))['then'](respondWithResult(_0x15431d,null))[_0x6a7b('0x29')](handleError(_0x15431d,null));};exports[_0x6a7b('0x5b')]=function(_0x140f11,_0x3fbbeb){return db[_0x6a7b('0x3f')][_0x6a7b('0x5b')](_0x140f11[_0x6a7b('0x5c')],{})[_0x6a7b('0x20')](function(_0x11ace1){var _0x3a3135=_0x140f11[_0x6a7b('0x5d')]['get']({'plain':!![]});if(!_0x3a3135)throw new Error(_0x6a7b('0x5e'));if(_0x3a3135['role']===_0x6a7b('0x5d')){var _0x59f2f7=_0x11ace1[_0x6a7b('0x38')]({'plain':!![]});var _0x4715ab=_0x6a7b('0x39');return db[_0x6a7b('0x5f')]['find']({'where':{'name':_0x4715ab,'userProfileId':_0x3a3135[_0x6a7b('0x60')]},'raw':!![]})['then'](function(_0x4d8319){if(_0x4d8319&&_0x4d8319[_0x6a7b('0x61')]===0x0){return db[_0x6a7b('0x3a')]['create']({'name':_0x59f2f7[_0x6a7b('0x3d')],'resourceId':_0x59f2f7['id'],'type':_0x4d8319['name'],'sectionId':_0x4d8319['id']},{})[_0x6a7b('0x20')](function(){return _0x11ace1;});}else{return _0x11ace1;}})[_0x6a7b('0x29')](function(_0x4ba35c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba35c);throw _0x4ba35c;});}return _0x11ace1;})[_0x6a7b('0x20')](respondWithResult(_0x3fbbeb,0xc9))['catch'](handleError(_0x3fbbeb,null));};exports[_0x6a7b('0x36')]=function(_0x19549e,_0x429c84){if(_0x19549e['body']['id']){delete _0x19549e[_0x6a7b('0x5c')]['id'];}return db['ChatQueue'][_0x6a7b('0x62')]({'where':{'id':_0x19549e['params']['id']}})['then'](handleEntityNotFound(_0x429c84,null))[_0x6a7b('0x20')](saveUpdates(_0x19549e[_0x6a7b('0x5c')],null))[_0x6a7b('0x20')](respondWithResult(_0x429c84,null))['catch'](handleError(_0x429c84,null));};exports[_0x6a7b('0x37')]=function(_0x1ba501,_0x4f6287){return db[_0x6a7b('0x3f')][_0x6a7b('0x62')]({'where':{'id':_0x1ba501[_0x6a7b('0x59')]['id']}})[_0x6a7b('0x20')](handleEntityNotFound(_0x4f6287,null))[_0x6a7b('0x20')](removeEntity(_0x4f6287,null))['catch'](handleError(_0x4f6287,null));};exports[_0x6a7b('0x63')]=function(_0x549757,_0x11967b){return db[_0x6a7b('0x3f')]['describe']()['then'](respondWithResult(_0x11967b,null))[_0x6a7b('0x29')](handleError(_0x11967b,null));};exports['getMembers']=function(_0x512e1a,_0x4ed941,_0x184479){var _0x124f50={'raw':!![],'where':{}},_0x3a7e11={},_0x46925e;return db[_0x6a7b('0x3f')]['findOne']({'where':{'id':_0x512e1a[_0x6a7b('0x59')]['id']}})[_0x6a7b('0x20')](handleEntityNotFound(_0x4ed941,null))[_0x6a7b('0x20')](function(_0x4b804f){if(_0x4b804f){_0x46925e=_0x4b804f[_0x6a7b('0x38')]({'plain':!![]});_0x3a7e11[_0x6a7b('0x44')]=_[_0x6a7b('0x47')](db['UserChatQueue']['rawAttributes']);_0x3a7e11[_0x6a7b('0x46')]=_[_0x6a7b('0x47')](_0x512e1a[_0x6a7b('0x46')]);_0x3a7e11[_0x6a7b('0x50')]=_['intersection'](_0x3a7e11[_0x6a7b('0x44')],_0x3a7e11['query']);_0x124f50[_0x6a7b('0x49')]=_[_0x6a7b('0x48')](_0x3a7e11[_0x6a7b('0x44')],qs['fields'](_0x512e1a[_0x6a7b('0x46')][_0x6a7b('0x4a')]));_0x124f50['attributes']=_0x124f50[_0x6a7b('0x49')][_0x6a7b('0x5a')]?_0x124f50[_0x6a7b('0x49')]:_0x3a7e11[_0x6a7b('0x44')];if(!_0x512e1a['query'][_0x6a7b('0x4b')](_0x6a7b('0x4c'))){_0x124f50['limit']=qs[_0x6a7b('0x2e')](_0x512e1a[_0x6a7b('0x46')]['limit']);_0x124f50['offset']=qs[_0x6a7b('0x2d')](_0x512e1a[_0x6a7b('0x46')][_0x6a7b('0x2d')]);}_0x124f50[_0x6a7b('0x4d')]=qs['sort'](_0x512e1a[_0x6a7b('0x46')][_0x6a7b('0x4e')]);_0x124f50[_0x6a7b('0x4f')]=qs[_0x6a7b('0x50')](_[_0x6a7b('0x51')](_0x512e1a[_0x6a7b('0x46')],_0x3a7e11[_0x6a7b('0x50')]));_0x124f50[_0x6a7b('0x4f')][_0x6a7b('0x64')]=_0x4b804f['id'];if(_0x512e1a[_0x6a7b('0x46')][_0x6a7b('0x52')]){_0x124f50[_0x6a7b('0x4f')]=_[_0x6a7b('0x53')](_0x124f50[_0x6a7b('0x4f')],{'$or':_[_0x6a7b('0x45')](_0x124f50[_0x6a7b('0x49')],function(_0x18499f){var _0x4e518a={};_0x4e518a[_0x18499f]={'$like':'%'+_0x512e1a[_0x6a7b('0x46')]['filter']+'%'};return _0x4e518a;})});}_0x124f50=_[_0x6a7b('0x53')]({},_0x124f50,_0x512e1a[_0x6a7b('0x54')]);return db['UserChatQueue'][_0x6a7b('0x65')](_0x124f50);}})[_0x6a7b('0x20')](function(_0x26514c){if(_0x26514c){return db[_0x6a7b('0x66')]['findAndCountAll']({'where':{'id':_[_0x6a7b('0x45')](_0x26514c,_0x6a7b('0x67')),'role':_0x6a7b('0x68')},'attributes':['id',_0x6a7b('0x3d'),'chatPause',_0x6a7b('0x69'),'createdAt']});}})[_0x6a7b('0x20')](function(_0x49e0cb){if(_0x49e0cb){return{'count':_0x49e0cb[_0x6a7b('0x30')],'rows':_[_0x6a7b('0x45')](_0x49e0cb['rows'],function(_0x46bddf){return{'membername':_0x46bddf[_0x6a7b('0x3d')],'UserId':_0x46bddf['id'],'queue_name':_0x46925e[_0x6a7b('0x3d')],'ChatQueueId':_0x46925e['id'],'interface':util[_0x6a7b('0x6a')]('%s/%s',_0x6a7b('0x6b'),_0x46bddf[_0x6a7b('0x3d')]),'penalty':0x0,'paused':_0x46bddf[_0x6a7b('0x6c')],'createdAt':_0x46bddf[_0x6a7b('0x6d')],'updatedAt':_0x46bddf[_0x6a7b('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a7b('0x20')](respondWithFilteredResult(_0x4ed941,_0x124f50))[_0x6a7b('0x29')](handleError(_0x4ed941,null));};exports['getTeams']=function(_0x3e628f,_0x2ac6c6,_0x3e3552){var _0x3166ed={};var _0x5147c6={};var _0x189395;var _0x53fd07;return db[_0x6a7b('0x3f')]['findOne']({'where':{'id':_0x3e628f[_0x6a7b('0x59')]['id']}})[_0x6a7b('0x20')](handleEntityNotFound(_0x2ac6c6,null))[_0x6a7b('0x20')](function(_0x188916){if(_0x188916){_0x189395=_0x188916;_0x5147c6[_0x6a7b('0x44')]=_['keys'](db[_0x6a7b('0x6e')][_0x6a7b('0x40')]);_0x5147c6[_0x6a7b('0x46')]=_['keys'](_0x3e628f[_0x6a7b('0x46')]);_0x5147c6[_0x6a7b('0x50')]=_['intersection'](_0x5147c6[_0x6a7b('0x44')],_0x5147c6[_0x6a7b('0x46')]);_0x3166ed['attributes']=_[_0x6a7b('0x48')](_0x5147c6['model'],qs[_0x6a7b('0x4a')](_0x3e628f[_0x6a7b('0x46')][_0x6a7b('0x4a')]));_0x3166ed[_0x6a7b('0x49')]=_0x3166ed['attributes'][_0x6a7b('0x5a')]?_0x3166ed[_0x6a7b('0x49')]:_0x5147c6[_0x6a7b('0x44')];_0x3166ed[_0x6a7b('0x4d')]=qs[_0x6a7b('0x4e')](_0x3e628f['query']['sort']);_0x3166ed[_0x6a7b('0x4f')]=qs[_0x6a7b('0x50')](_[_0x6a7b('0x51')](_0x3e628f[_0x6a7b('0x46')],_0x5147c6['filters']));if(_0x3e628f['query']['filter']){_0x3166ed[_0x6a7b('0x4f')]=_[_0x6a7b('0x53')](_0x3166ed['where'],{'$or':_['map'](_0x3166ed['attributes'],function(_0x14f942){var _0x29055f={};_0x29055f[_0x14f942]={'$like':'%'+_0x3e628f['query'][_0x6a7b('0x52')]+'%'};return _0x29055f;})});}_0x3166ed=_[_0x6a7b('0x53')]({},_0x3166ed,_0x3e628f[_0x6a7b('0x54')]);return _0x189395[_0x6a7b('0x6f')](_0x3166ed);}})[_0x6a7b('0x20')](function(_0x426179){if(_0x426179){_0x53fd07=_0x426179[_0x6a7b('0x5a')];if(!_0x3e628f[_0x6a7b('0x46')]['hasOwnProperty'](_0x6a7b('0x4c'))){_0x3166ed[_0x6a7b('0x2e')]=qs['limit'](_0x3e628f[_0x6a7b('0x46')]['limit']);_0x3166ed[_0x6a7b('0x2d')]=qs[_0x6a7b('0x2d')](_0x3e628f[_0x6a7b('0x46')][_0x6a7b('0x2d')]);}return _0x189395[_0x6a7b('0x6f')](_0x3166ed);}})[_0x6a7b('0x20')](function(_0x4a5712){if(_0x4a5712){return _0x4a5712?{'count':_0x53fd07,'rows':_0x4a5712}:null;}})['then'](respondWithResult(_0x2ac6c6,null))[_0x6a7b('0x29')](handleError(_0x2ac6c6,null));};exports['addTeams']=function(_0x326e4b,_0x1708b6,_0x552dea){var _0x157931=_0x326e4b[_0x6a7b('0x5c')][_0x6a7b('0x70')];return db[_0x6a7b('0x6e')][_0x6a7b('0x65')]({'where':{'id':_0x157931},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6a7b('0x71'),'attributes':['id',_0x6a7b('0x3d'),_0x6a7b('0x72'),'voicePause',_0x6a7b('0x73')],'raw':!![]}]})[_0x6a7b('0x20')](function(_0x23149d){if(_0x23149d){var _0x137031=_[_0x6a7b('0x74')](_0x23149d,function(_0x2def2d){var _0x176f77=_0x2def2d[_0x6a7b('0x38')]({'plain':!![]});return _0x176f77[_0x6a7b('0x71')];});return db['ChatQueue'][_0x6a7b('0x62')]({'where':{'id':_0x326e4b[_0x6a7b('0x59')]['id']}})[_0x6a7b('0x20')](function(_0x266d60){return db[_0x6a7b('0x75')]['transaction'](function(_0x104288){return _0x266d60['addTeams'](_0x157931,{'transaction':_0x104288})[_0x6a7b('0x20')](function(){return BPromise['each'](_0x137031,function(_0x4b69a8){return db['UserChatQueue'][_0x6a7b('0x76')]({'where':{'UserId':_0x4b69a8['id'],'ChatQueueId':_0x326e4b[_0x6a7b('0x59')]['id']},'transaction':_0x104288});});})[_0x6a7b('0x20')](function(){_0x137031[_0x6a7b('0x77')](function(_0x1f661b){socket[_0x6a7b('0x78')](_0x6a7b('0x79'),{'UserId':_0x1f661b['id'],'ChatQueueId':_0x266d60['id']});});});});});}})[_0x6a7b('0x20')](respondWithStatusCode(_0x1708b6,null))[_0x6a7b('0x29')](handleError(_0x1708b6,null));};exports[_0x6a7b('0x7a')]=function(_0xd4a74b,_0x3fd10e,_0x2196da){return db[_0x6a7b('0x6e')]['findAll']({'where':{'id':_0xd4a74b[_0x6a7b('0x46')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6a7b('0x66')],'as':_0x6a7b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6a7b('0x20')](handleEntityNotFound(_0x3fd10e,null))[_0x6a7b('0x20')](function(_0x17579c){var _0x3cb02d=_[_0x6a7b('0x45')](_0x17579c,'id');var _0x3af817=[];var _0xb64bc5=[];var _0x5e5113=squel[_0x6a7b('0x7b')]();_0x5e5113[_0x6a7b('0x7c')](_0x6a7b('0x7d'))['from'](_0x6a7b('0x7e'),'tq')[_0x6a7b('0x7f')](_0x6a7b('0x80'),'ut',_0x6a7b('0x81'))['where']('ChatQueueId\x20=\x20?',_0xd4a74b['params']['id']);for(var _0x3f22a5=0x0;_0x3f22a5<_0x17579c[_0x6a7b('0x5a')];_0x3f22a5+=0x1){let _0x80b7be=_0x17579c[_0x3f22a5];for(var _0x46f90f=0x0;_0x46f90f<_0x80b7be['Agents'][_0x6a7b('0x5a')];_0x46f90f+=0x1){let _0xd74527=_0x80b7be[_0x6a7b('0x71')][_0x46f90f];var _0xe949cd=_0x5e5113[_0x6a7b('0x82')]();_0xe949cd[_0x6a7b('0x4f')](_0x6a7b('0x83'),_0xd74527['id']);_0xb64bc5[_0x6a7b('0x84')](db[_0x6a7b('0x75')][_0x6a7b('0x46')](_0xe949cd[_0x6a7b('0x85')](),{'type':db[_0x6a7b('0x75')][_0x6a7b('0x86')][_0x6a7b('0x87')]})[_0x6a7b('0x20')](function(_0x5c57ce){if(_0x5c57ce[_0x6a7b('0x5a')]===0x1){return _0xd74527['id'];}else{var _0x1878f9=_[_0x6a7b('0x88')](_[_0x6a7b('0x45')](_0x5c57ce,_0x6a7b('0x89')),function(_0x3964d7){return _[_0x6a7b('0x8a')](_0x3cb02d,_0x3964d7);});if(_0x1878f9){return _0xd74527['id'];}}}));}}return BPromise['all'](_0xb64bc5)['then'](function(_0x1c4927){_0x3af817=_(_0x3af817)['union'](_0x1c4927)['compact']()[_0x6a7b('0x8b')]();return db['ChatQueue'][_0x6a7b('0x62')]({'where':{'id':_0xd4a74b[_0x6a7b('0x59')]['id']}})['then'](function(_0x44656c){return db[_0x6a7b('0x75')][_0x6a7b('0x8c')](function(_0x4e0297){return _0x44656c[_0x6a7b('0x7a')](_0xd4a74b[_0x6a7b('0x46')][_0x6a7b('0x70')],{'transaction':_0x4e0297})[_0x6a7b('0x20')](function(){if(!_[_0x6a7b('0x8d')](_0x3af817)){return _0x44656c[_0x6a7b('0x8e')](_0x3af817,{'transaction':_0x4e0297});}})[_0x6a7b('0x20')](function(){_0x3af817[_0x6a7b('0x77')](function(_0x5cbe0d){socket[_0x6a7b('0x78')]('userChatQueue:remove',{'UserId':_0x5cbe0d,'ChatQueueId':_0x44656c['id']});});});});});});})['then'](respondWithStatusCode(_0x3fd10e,null))[_0x6a7b('0x29')](handleError(_0x3fd10e,null));};exports[_0x6a7b('0x8f')]=function(_0x5cf49d,_0x855f2a,_0x71d4ec){return db[_0x6a7b('0x3f')]['find']({'where':{'id':_0x5cf49d[_0x6a7b('0x59')]['id']}})[_0x6a7b('0x20')](handleEntityNotFound(_0x855f2a,null))[_0x6a7b('0x20')](function(_0x4a202b){if(_0x4a202b){return _0x4a202b[_0x6a7b('0x8f')](_0x5cf49d[_0x6a7b('0x5c')][_0x6a7b('0x70')],_[_0x6a7b('0x90')](_0x5cf49d[_0x6a7b('0x5c')],[_0x6a7b('0x70'),'id'])||{})[_0x6a7b('0x91')](function(_0x5c854f){for(var _0x28737c=0x0;_0x28737c<_0x5cf49d[_0x6a7b('0x5c')][_0x6a7b('0x70')][_0x6a7b('0x5a')];_0x28737c+=0x1){socket[_0x6a7b('0x78')](_0x6a7b('0x79'),{'UserId':Number(_0x5cf49d['body'][_0x6a7b('0x70')][_0x28737c]),'ChatQueueId':Number(_0x5cf49d[_0x6a7b('0x59')]['id'])});}return _0x5c854f;});}})[_0x6a7b('0x20')](respondWithResult(_0x855f2a,null))[_0x6a7b('0x29')](handleError(_0x855f2a,null));};exports[_0x6a7b('0x8e')]=function(_0xfd7fbd,_0x19d2e0,_0x17d78c){return db[_0x6a7b('0x3f')]['find']({'where':{'id':_0xfd7fbd[_0x6a7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x19d2e0,null))[_0x6a7b('0x20')](function(_0x11d215){if(_0x11d215){return _0x11d215[_0x6a7b('0x8e')](_0xfd7fbd[_0x6a7b('0x46')]['ids'])[_0x6a7b('0x20')](function(){if(_['isArray'](_0xfd7fbd[_0x6a7b('0x46')]['ids'])){for(var _0x3ea18f=0x0;_0x3ea18f<_0xfd7fbd[_0x6a7b('0x46')]['ids'][_0x6a7b('0x5a')];_0x3ea18f+=0x1){socket[_0x6a7b('0x78')](_0x6a7b('0x92'),{'UserId':Number(_0xfd7fbd[_0x6a7b('0x46')][_0x6a7b('0x70')][_0x3ea18f]),'ChatQueueId':Number(_0xfd7fbd[_0x6a7b('0x59')]['id'])});}}else{socket[_0x6a7b('0x78')]('userChatQueue:remove',{'UserId':Number(_0xfd7fbd[_0x6a7b('0x46')][_0x6a7b('0x70')]),'ChatQueueId':Number(_0xfd7fbd[_0x6a7b('0x59')]['id'])});}});}})[_0x6a7b('0x20')](respondWithStatusCode(_0x19d2e0,null))[_0x6a7b('0x29')](handleError(_0x19d2e0,null));};exports['getAgents']=function(_0x4ec632,_0x433430,_0x47a119){var _0x2ff3d0={};var _0x2416f7={};var _0x316dd2;var _0x2bd7d9;return db[_0x6a7b('0x3f')][_0x6a7b('0x93')]({'where':{'id':_0x4ec632[_0x6a7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x433430,null))[_0x6a7b('0x20')](function(_0x1d84ec){if(_0x1d84ec){_0x316dd2=_0x1d84ec;_0x2416f7[_0x6a7b('0x44')]=_['keys'](db[_0x6a7b('0x66')][_0x6a7b('0x40')]);_0x2416f7['query']=_[_0x6a7b('0x47')](_0x4ec632[_0x6a7b('0x46')]);_0x2416f7[_0x6a7b('0x50')]=_['intersection'](_0x2416f7[_0x6a7b('0x44')],_0x2416f7[_0x6a7b('0x46')]);_0x2ff3d0[_0x6a7b('0x49')]=_['intersection'](_0x2416f7[_0x6a7b('0x44')],qs[_0x6a7b('0x4a')](_0x4ec632[_0x6a7b('0x46')]['fields']));_0x2ff3d0[_0x6a7b('0x49')]=_0x2ff3d0[_0x6a7b('0x49')][_0x6a7b('0x5a')]?_0x2ff3d0[_0x6a7b('0x49')]:_0x2416f7[_0x6a7b('0x44')];_0x2ff3d0[_0x6a7b('0x4d')]=qs['sort'](_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x4e')]);_0x2ff3d0[_0x6a7b('0x4f')]=qs[_0x6a7b('0x50')](_[_0x6a7b('0x51')](_0x4ec632['query'],_0x2416f7[_0x6a7b('0x50')]));if(_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x52')]){_0x2ff3d0[_0x6a7b('0x4f')]=_['merge'](_0x2ff3d0[_0x6a7b('0x4f')],{'$or':_[_0x6a7b('0x45')](_0x2ff3d0[_0x6a7b('0x49')],function(_0x4a92fd){var _0x22b918={};_0x22b918[_0x4a92fd]={'$like':'%'+_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x52')]+'%'};return _0x22b918;})});}_0x2ff3d0=_['merge']({},_0x2ff3d0,_0x4ec632[_0x6a7b('0x54')]);return _0x316dd2[_0x6a7b('0x94')](_0x2ff3d0);}})[_0x6a7b('0x20')](function(_0x478b60){if(_0x478b60){_0x2bd7d9=_0x478b60[_0x6a7b('0x5a')];if(!_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x4b')](_0x6a7b('0x4c'))){_0x2ff3d0[_0x6a7b('0x2e')]=qs['limit'](_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x2e')]);_0x2ff3d0['offset']=qs['offset'](_0x4ec632[_0x6a7b('0x46')][_0x6a7b('0x2d')]);}return _0x316dd2['getAgents'](_0x2ff3d0);}})[_0x6a7b('0x20')](function(_0x1b191c){if(_0x1b191c){return _0x1b191c?{'count':_0x2bd7d9,'rows':_0x1b191c}:null;}})[_0x6a7b('0x20')](respondWithResult(_0x433430,null))[_0x6a7b('0x29')](handleError(_0x433430,null));}; \ No newline at end of file +var _0xb788=['value','transaction','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','findAll','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','findAndCountAll','agent','chatPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','Team','ids','User','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact'];(function(_0x2b0e4d,_0x12dc85){var _0x45c7f2=function(_0x49f80c){while(--_0x49f80c){_0x2b0e4d['push'](_0x2b0e4d['shift']());}};_0x45c7f2(++_0x12dc85);}(_0xb788,0x9b));var _0x8b78=function(_0x38d8e2,_0x48603c){_0x38d8e2=_0x38d8e2-0x0;var _0x5afbee=_0xb788[_0x38d8e2];return _0x5afbee;};'use strict';var emlformat=require(_0x8b78('0x0'));var rimraf=require(_0x8b78('0x1'));var zipdir=require(_0x8b78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b78('0x3'));var Mustache=require(_0x8b78('0x4'));var util=require('util');var path=require(_0x8b78('0x5'));var sox=require(_0x8b78('0x6'));var csv=require(_0x8b78('0x7'));var ejs=require(_0x8b78('0x8'));var fs=require('fs');var fs_extra=require(_0x8b78('0x9'));var _=require(_0x8b78('0xa'));var squel=require('squel');var crypto=require(_0x8b78('0xb'));var jsforce=require(_0x8b78('0xc'));var deskjs=require(_0x8b78('0xd'));var toCsv=require(_0x8b78('0x7'));var querystring=require(_0x8b78('0xe'));var Papa=require(_0x8b78('0xf'));var Redis=require(_0x8b78('0x10'));var authService=require(_0x8b78('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b78('0x12'));var hardwareService=require(_0x8b78('0x13'));var logger=require('../../config/logger')(_0x8b78('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b78('0x15'))['db'];config[_0x8b78('0x16')]=_['defaults'](config[_0x8b78('0x16')],{'host':_0x8b78('0x17'),'port':0x18eb});var socket=require(_0x8b78('0x18'))(new Redis(config[_0x8b78('0x16')]));require('./chatQueue.socket')[_0x8b78('0x19')](socket);var jayson=require(_0x8b78('0x1a'));var client=jayson['client'][_0x8b78('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5c9053,_0x5d9ad5,_0x490ec6,_0x224376){return new BPromise(function(_0x2262f7,_0x303e95){var _0x544b53=_0x224376||client;return _0x544b53[_0x8b78('0x1c')](_0x5c9053,_0x490ec6)[_0x8b78('0x1d')](function(_0x324888){logger[_0x8b78('0x1e')](_0x8b78('0x1f'),_0x5d9ad5,_0x8b78('0x20'));logger[_0x8b78('0x21')](_0x8b78('0x22'),_0x5d9ad5,_0x8b78('0x20'),JSON[_0x8b78('0x23')](_0x324888));if(_0x324888[_0x8b78('0x24')]){if(_0x324888[_0x8b78('0x24')][_0x8b78('0x25')]===0x1f4){logger['error'](_0x8b78('0x1f'),_0x5d9ad5,_0x324888[_0x8b78('0x24')]['message']);return _0x303e95(_0x324888[_0x8b78('0x24')]['message']);}logger[_0x8b78('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5d9ad5,_0x324888[_0x8b78('0x24')][_0x8b78('0x26')]);return _0x2262f7(_0x324888[_0x8b78('0x24')][_0x8b78('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d9ad5,_0x8b78('0x20'));_0x2262f7(_0x324888[_0x8b78('0x27')][_0x8b78('0x26')]);}})[_0x8b78('0x28')](function(_0x4057d6){logger[_0x8b78('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5d9ad5,_0x4057d6);_0x303e95(_0x4057d6);});});}function respondWithStatusCode(_0x26e356,_0xb3332f){_0xb3332f=_0xb3332f||0xcc;return function(_0x86f2aa){if(_0x86f2aa){return _0x26e356[_0x8b78('0x29')](_0xb3332f);}return _0x26e356[_0x8b78('0x2a')](_0xb3332f)[_0x8b78('0x2b')]();};}function respondWithResult(_0x5e1cc5,_0x3be426){_0x3be426=_0x3be426||0xc8;return function(_0x5f3b79){if(_0x5f3b79){return _0x5e1cc5[_0x8b78('0x2a')](_0x3be426)[_0x8b78('0x2c')](_0x5f3b79);}};}function respondWithFilteredResult(_0x4bbdc4,_0x30d8b3){return function(_0xe8f54f){if(_0xe8f54f){var _0x10f287=typeof _0x30d8b3[_0x8b78('0x2d')]===_0x8b78('0x2e')&&typeof _0x30d8b3['limit']==='undefined';var _0x1bf3d0=_0xe8f54f[_0x8b78('0x2f')];var _0x46801c=_0x10f287?0x0:_0x30d8b3[_0x8b78('0x2d')];var _0x38dd5e=_0x10f287?_0xe8f54f[_0x8b78('0x2f')]:_0x30d8b3['offset']+_0x30d8b3[_0x8b78('0x30')];var _0x4853f0;if(_0x38dd5e>=_0x1bf3d0){_0x38dd5e=_0x1bf3d0;_0x4853f0=0xc8;}else{_0x4853f0=0xce;}_0x4bbdc4[_0x8b78('0x2a')](_0x4853f0);return _0x4bbdc4['set'](_0x8b78('0x31'),_0x46801c+'-'+_0x38dd5e+'/'+_0x1bf3d0)['json'](_0xe8f54f);}return null;};}function patchUpdates(_0x263ff9){return function(_0x4dd614){try{jsonpatch['apply'](_0x4dd614,_0x263ff9,!![]);}catch(_0x43737b){return BPromise[_0x8b78('0x32')](_0x43737b);}return _0x4dd614[_0x8b78('0x33')]();};}function saveUpdates(_0x561aba,_0x452cb1){return function(_0x20461c){if(_0x20461c){return _0x20461c['update'](_0x561aba)['then'](function(_0x27b759){return _0x27b759;});}return null;};}function removeEntity(_0x113c37,_0x9d5a01){return function(_0x4c3297){if(_0x4c3297){return _0x4c3297[_0x8b78('0x34')]()[_0x8b78('0x1d')](function(){var _0x5d63b0=_0x4c3297[_0x8b78('0x35')]({'plain':!![]});var _0x560634='ChatQueues';return db[_0x8b78('0x36')]['destroy']({'where':{'type':_0x560634,'resourceId':_0x5d63b0['id']}})[_0x8b78('0x1d')](function(){return _0x4c3297;});})[_0x8b78('0x1d')](function(){_0x113c37[_0x8b78('0x2a')](0xcc)[_0x8b78('0x2b')]();});}};}function handleEntityNotFound(_0x3c327b,_0x5ca366){return function(_0x49cfd9){if(!_0x49cfd9){_0x3c327b[_0x8b78('0x29')](0x194);}return _0x49cfd9;};}function handleError(_0x4c7c05,_0x490cca){_0x490cca=_0x490cca||0x1f4;return function(_0x458f85){logger[_0x8b78('0x24')](_0x458f85[_0x8b78('0x37')]);if(_0x458f85[_0x8b78('0x38')]){delete _0x458f85[_0x8b78('0x38')];}_0x4c7c05[_0x8b78('0x2a')](_0x490cca)[_0x8b78('0x39')](_0x458f85);};}exports[_0x8b78('0x3a')]=function(_0x1bf4a4,_0x49691d){var _0xb0a59b={},_0x28679c={},_0x8899cd={'count':0x0,'rows':[]};var _0x4ae016=_[_0x8b78('0x3b')](db['ChatQueue'][_0x8b78('0x3c')],function(_0x2a8694){return{'name':_0x2a8694[_0x8b78('0x3d')],'type':_0x2a8694[_0x8b78('0x3e')][_0x8b78('0x3f')]};});_0x28679c[_0x8b78('0x40')]=_[_0x8b78('0x3b')](_0x4ae016,'name');_0x28679c[_0x8b78('0x41')]=_[_0x8b78('0x42')](_0x1bf4a4['query']);_0x28679c[_0x8b78('0x43')]=_['intersection'](_0x28679c[_0x8b78('0x40')],_0x28679c[_0x8b78('0x41')]);_0xb0a59b['attributes']=_[_0x8b78('0x44')](_0x28679c[_0x8b78('0x40')],qs[_0x8b78('0x45')](_0x1bf4a4[_0x8b78('0x41')][_0x8b78('0x45')]));_0xb0a59b[_0x8b78('0x46')]=_0xb0a59b[_0x8b78('0x46')][_0x8b78('0x47')]?_0xb0a59b[_0x8b78('0x46')]:_0x28679c[_0x8b78('0x40')];if(!_0x1bf4a4[_0x8b78('0x41')][_0x8b78('0x48')]('nolimit')){_0xb0a59b[_0x8b78('0x30')]=qs[_0x8b78('0x30')](_0x1bf4a4[_0x8b78('0x41')][_0x8b78('0x30')]);_0xb0a59b['offset']=qs[_0x8b78('0x2d')](_0x1bf4a4['query'][_0x8b78('0x2d')]);}_0xb0a59b['order']=qs[_0x8b78('0x49')](_0x1bf4a4[_0x8b78('0x41')][_0x8b78('0x49')]);_0xb0a59b[_0x8b78('0x4a')]=qs['filters'](_[_0x8b78('0x4b')](_0x1bf4a4[_0x8b78('0x41')],_0x28679c[_0x8b78('0x43')]),_0x4ae016);if(_0x1bf4a4['query'][_0x8b78('0x4c')]){_0xb0a59b[_0x8b78('0x4a')]=_[_0x8b78('0x4d')](_0xb0a59b[_0x8b78('0x4a')],{'$or':_[_0x8b78('0x3b')](_0x4ae016,function(_0x5e3a66){if(_0x5e3a66['type']!==_0x8b78('0x4e')){var _0x5400fb={};_0x5400fb[_0x5e3a66[_0x8b78('0x38')]]={'$like':'%'+_0x1bf4a4['query']['filter']+'%'};return _0x5400fb;}})});}_0xb0a59b=_[_0x8b78('0x4d')]({},_0xb0a59b,_0x1bf4a4['options']);var _0x29ae2a={'where':_0xb0a59b[_0x8b78('0x4a')]};return db[_0x8b78('0x4f')][_0x8b78('0x2f')](_0x29ae2a)[_0x8b78('0x1d')](function(_0x38e8db){_0x8899cd[_0x8b78('0x2f')]=_0x38e8db;if(_0x1bf4a4[_0x8b78('0x41')][_0x8b78('0x50')]){_0xb0a59b[_0x8b78('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0x8b78('0x52')](_0xb0a59b);})[_0x8b78('0x1d')](function(_0x5b97c2){_0x8899cd['rows']=_0x5b97c2;return _0x8899cd;})[_0x8b78('0x1d')](respondWithFilteredResult(_0x49691d,_0xb0a59b))[_0x8b78('0x28')](handleError(_0x49691d,null));};exports['show']=function(_0x45cbee,_0x2f94b1){var _0x5b5396={'raw':!![],'where':{'id':_0x45cbee[_0x8b78('0x53')]['id']}},_0x9042d8={};_0x9042d8[_0x8b78('0x40')]=_[_0x8b78('0x42')](db[_0x8b78('0x4f')]['rawAttributes']);_0x9042d8[_0x8b78('0x41')]=_[_0x8b78('0x42')](_0x45cbee[_0x8b78('0x41')]);_0x9042d8[_0x8b78('0x43')]=_[_0x8b78('0x44')](_0x9042d8[_0x8b78('0x40')],_0x9042d8[_0x8b78('0x41')]);_0x5b5396[_0x8b78('0x46')]=_[_0x8b78('0x44')](_0x9042d8[_0x8b78('0x40')],qs[_0x8b78('0x45')](_0x45cbee[_0x8b78('0x41')][_0x8b78('0x45')]));_0x5b5396[_0x8b78('0x46')]=_0x5b5396['attributes']['length']?_0x5b5396[_0x8b78('0x46')]:_0x9042d8[_0x8b78('0x40')];if(_0x45cbee['query']['includeAll']){_0x5b5396[_0x8b78('0x51')]=[{'all':!![]}];}_0x5b5396=_[_0x8b78('0x4d')]({},_0x5b5396,_0x45cbee[_0x8b78('0x54')]);return db[_0x8b78('0x4f')][_0x8b78('0x55')](_0x5b5396)[_0x8b78('0x1d')](handleEntityNotFound(_0x2f94b1,null))[_0x8b78('0x1d')](respondWithResult(_0x2f94b1,null))['catch'](handleError(_0x2f94b1,null));};exports['create']=function(_0x3b3597,_0x5eb7c2){return db[_0x8b78('0x4f')][_0x8b78('0x56')](_0x3b3597[_0x8b78('0x57')],{})['then'](function(_0x5c34c2){var _0x86f566=_0x3b3597[_0x8b78('0x58')][_0x8b78('0x35')]({'plain':!![]});if(!_0x86f566)throw new Error(_0x8b78('0x59'));if(_0x86f566['role']===_0x8b78('0x58')){var _0x3b12de=_0x5c34c2[_0x8b78('0x35')]({'plain':!![]});var _0x394d77='ChatQueues';return db[_0x8b78('0x5a')][_0x8b78('0x55')]({'where':{'name':_0x394d77,'userProfileId':_0x86f566[_0x8b78('0x5b')]},'raw':!![]})[_0x8b78('0x1d')](function(_0xf5b6f2){if(_0xf5b6f2&&_0xf5b6f2['autoAssociation']===0x0){return db['UserProfileResource'][_0x8b78('0x56')]({'name':_0x3b12de['name'],'resourceId':_0x3b12de['id'],'type':_0xf5b6f2[_0x8b78('0x38')],'sectionId':_0xf5b6f2['id']},{})[_0x8b78('0x1d')](function(){return _0x5c34c2;});}else{return _0x5c34c2;}})[_0x8b78('0x28')](function(_0xb64bc7){logger[_0x8b78('0x24')](_0x8b78('0x5c'),_0xb64bc7);throw _0xb64bc7;});}return _0x5c34c2;})[_0x8b78('0x1d')](respondWithResult(_0x5eb7c2,0xc9))[_0x8b78('0x28')](handleError(_0x5eb7c2,null));};exports['update']=function(_0x1a95a8,_0x2e58de){if(_0x1a95a8[_0x8b78('0x57')]['id']){delete _0x1a95a8[_0x8b78('0x57')]['id'];}return db[_0x8b78('0x4f')][_0x8b78('0x55')]({'where':{'id':_0x1a95a8[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0x2e58de,null))[_0x8b78('0x1d')](saveUpdates(_0x1a95a8[_0x8b78('0x57')],null))[_0x8b78('0x1d')](respondWithResult(_0x2e58de,null))[_0x8b78('0x28')](handleError(_0x2e58de,null));};exports['destroy']=function(_0xb3b6bb,_0x2616b0){return db['ChatQueue'][_0x8b78('0x55')]({'where':{'id':_0xb3b6bb[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0x2616b0,null))[_0x8b78('0x1d')](removeEntity(_0x2616b0,null))['catch'](handleError(_0x2616b0,null));};exports[_0x8b78('0x5d')]=function(_0x2ac370,_0x5c01d2){return db[_0x8b78('0x4f')][_0x8b78('0x5d')]()[_0x8b78('0x1d')](respondWithResult(_0x5c01d2,null))['catch'](handleError(_0x5c01d2,null));};exports[_0x8b78('0x5e')]=function(_0x7bd5c6,_0x1a10b7,_0x40ee9a){var _0x4785f6={'raw':!![],'where':{}},_0x5774c1={},_0x5e95b7;return db[_0x8b78('0x4f')][_0x8b78('0x5f')]({'where':{'id':_0x7bd5c6['params']['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0x1a10b7,null))['then'](function(_0x224c53){if(_0x224c53){_0x5e95b7=_0x224c53['get']({'plain':!![]});_0x5774c1[_0x8b78('0x40')]=_[_0x8b78('0x42')](db[_0x8b78('0x60')]['rawAttributes']);_0x5774c1[_0x8b78('0x41')]=_[_0x8b78('0x42')](_0x7bd5c6[_0x8b78('0x41')]);_0x5774c1[_0x8b78('0x43')]=_[_0x8b78('0x44')](_0x5774c1[_0x8b78('0x40')],_0x5774c1[_0x8b78('0x41')]);_0x4785f6['attributes']=_[_0x8b78('0x44')](_0x5774c1[_0x8b78('0x40')],qs['fields'](_0x7bd5c6[_0x8b78('0x41')][_0x8b78('0x45')]));_0x4785f6['attributes']=_0x4785f6[_0x8b78('0x46')][_0x8b78('0x47')]?_0x4785f6['attributes']:_0x5774c1[_0x8b78('0x40')];if(!_0x7bd5c6[_0x8b78('0x41')][_0x8b78('0x48')](_0x8b78('0x61'))){_0x4785f6[_0x8b78('0x30')]=qs[_0x8b78('0x30')](_0x7bd5c6[_0x8b78('0x41')]['limit']);_0x4785f6[_0x8b78('0x2d')]=qs[_0x8b78('0x2d')](_0x7bd5c6['query'][_0x8b78('0x2d')]);}_0x4785f6[_0x8b78('0x62')]=qs[_0x8b78('0x49')](_0x7bd5c6[_0x8b78('0x41')][_0x8b78('0x49')]);_0x4785f6[_0x8b78('0x4a')]=qs[_0x8b78('0x43')](_['pick'](_0x7bd5c6['query'],_0x5774c1[_0x8b78('0x43')]));_0x4785f6[_0x8b78('0x4a')]['ChatQueueId']=_0x224c53['id'];if(_0x7bd5c6[_0x8b78('0x41')]['filter']){_0x4785f6[_0x8b78('0x4a')]=_[_0x8b78('0x4d')](_0x4785f6[_0x8b78('0x4a')],{'$or':_['map'](_0x4785f6['attributes'],function(_0x477851){var _0x57c211={};_0x57c211[_0x477851]={'$like':'%'+_0x7bd5c6[_0x8b78('0x41')][_0x8b78('0x4c')]+'%'};return _0x57c211;})});}_0x4785f6=_['merge']({},_0x4785f6,_0x7bd5c6['options']);return db['UserChatQueue'][_0x8b78('0x52')](_0x4785f6);}})[_0x8b78('0x1d')](function(_0x5241bb){if(_0x5241bb){return db['User'][_0x8b78('0x63')]({'where':{'id':_[_0x8b78('0x3b')](_0x5241bb,'UserId'),'role':_0x8b78('0x64')},'attributes':['id',_0x8b78('0x38'),_0x8b78('0x65'),'updatedAt',_0x8b78('0x66')]});}})['then'](function(_0x3ad741){if(_0x3ad741){return{'count':_0x3ad741[_0x8b78('0x2f')],'rows':_['map'](_0x3ad741[_0x8b78('0x67')],function(_0x4e80f5){return{'membername':_0x4e80f5[_0x8b78('0x38')],'UserId':_0x4e80f5['id'],'queue_name':_0x5e95b7['name'],'ChatQueueId':_0x5e95b7['id'],'interface':util['format'](_0x8b78('0x68'),_0x8b78('0x69'),_0x4e80f5[_0x8b78('0x38')]),'penalty':0x0,'paused':_0x4e80f5[_0x8b78('0x65')],'createdAt':_0x4e80f5[_0x8b78('0x66')],'updatedAt':_0x4e80f5[_0x8b78('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8b78('0x1d')](respondWithFilteredResult(_0x1a10b7,_0x4785f6))[_0x8b78('0x28')](handleError(_0x1a10b7,null));};exports[_0x8b78('0x6b')]=function(_0x49fdc2,_0x369773,_0x270895){var _0x1d5e77={};var _0x13b097={};var _0x17f7d9;var _0x4491b2;return db[_0x8b78('0x4f')]['findOne']({'where':{'id':_0x49fdc2[_0x8b78('0x53')]['id']}})['then'](handleEntityNotFound(_0x369773,null))[_0x8b78('0x1d')](function(_0x5d6b92){if(_0x5d6b92){_0x17f7d9=_0x5d6b92;_0x13b097[_0x8b78('0x40')]=_[_0x8b78('0x42')](db[_0x8b78('0x6c')][_0x8b78('0x3c')]);_0x13b097[_0x8b78('0x41')]=_[_0x8b78('0x42')](_0x49fdc2[_0x8b78('0x41')]);_0x13b097[_0x8b78('0x43')]=_['intersection'](_0x13b097[_0x8b78('0x40')],_0x13b097['query']);_0x1d5e77[_0x8b78('0x46')]=_[_0x8b78('0x44')](_0x13b097[_0x8b78('0x40')],qs['fields'](_0x49fdc2[_0x8b78('0x41')][_0x8b78('0x45')]));_0x1d5e77[_0x8b78('0x46')]=_0x1d5e77[_0x8b78('0x46')][_0x8b78('0x47')]?_0x1d5e77['attributes']:_0x13b097[_0x8b78('0x40')];_0x1d5e77[_0x8b78('0x62')]=qs['sort'](_0x49fdc2[_0x8b78('0x41')]['sort']);_0x1d5e77[_0x8b78('0x4a')]=qs['filters'](_[_0x8b78('0x4b')](_0x49fdc2[_0x8b78('0x41')],_0x13b097[_0x8b78('0x43')]));if(_0x49fdc2['query'][_0x8b78('0x4c')]){_0x1d5e77[_0x8b78('0x4a')]=_[_0x8b78('0x4d')](_0x1d5e77[_0x8b78('0x4a')],{'$or':_[_0x8b78('0x3b')](_0x1d5e77[_0x8b78('0x46')],function(_0x264ee8){var _0x41aebc={};_0x41aebc[_0x264ee8]={'$like':'%'+_0x49fdc2['query'][_0x8b78('0x4c')]+'%'};return _0x41aebc;})});}_0x1d5e77=_[_0x8b78('0x4d')]({},_0x1d5e77,_0x49fdc2['options']);return _0x17f7d9[_0x8b78('0x6b')](_0x1d5e77);}})[_0x8b78('0x1d')](function(_0x44dc01){if(_0x44dc01){_0x4491b2=_0x44dc01[_0x8b78('0x47')];if(!_0x49fdc2[_0x8b78('0x41')][_0x8b78('0x48')](_0x8b78('0x61'))){_0x1d5e77[_0x8b78('0x30')]=qs[_0x8b78('0x30')](_0x49fdc2['query'][_0x8b78('0x30')]);_0x1d5e77['offset']=qs[_0x8b78('0x2d')](_0x49fdc2[_0x8b78('0x41')][_0x8b78('0x2d')]);}return _0x17f7d9[_0x8b78('0x6b')](_0x1d5e77);}})['then'](function(_0x229dc2){if(_0x229dc2){return _0x229dc2?{'count':_0x4491b2,'rows':_0x229dc2}:null;}})[_0x8b78('0x1d')](respondWithResult(_0x369773,null))[_0x8b78('0x28')](handleError(_0x369773,null));};exports['addTeams']=function(_0x1ddba1,_0x189203,_0x519d0d){var _0x7035fd=_0x1ddba1[_0x8b78('0x57')][_0x8b78('0x6d')];return db[_0x8b78('0x6c')][_0x8b78('0x52')]({'where':{'id':_0x7035fd},'attributes':['id'],'include':[{'model':db[_0x8b78('0x6e')],'as':_0x8b78('0x6f'),'attributes':['id',_0x8b78('0x38'),_0x8b78('0x70'),_0x8b78('0x71'),_0x8b78('0x72')],'raw':!![]}]})[_0x8b78('0x1d')](function(_0x39a3b8){if(_0x39a3b8){var _0x52f6da=_['flatMap'](_0x39a3b8,function(_0x3d1cba){var _0x3e137d=_0x3d1cba[_0x8b78('0x35')]({'plain':!![]});return _0x3e137d[_0x8b78('0x6f')];});return db[_0x8b78('0x4f')]['find']({'where':{'id':_0x1ddba1[_0x8b78('0x53')]['id']}})['then'](function(_0x3695d4){return db[_0x8b78('0x73')]['transaction'](function(_0x418508){return _0x3695d4['addTeams'](_0x7035fd,{'transaction':_0x418508})['then'](function(){return BPromise[_0x8b78('0x74')](_0x52f6da,function(_0x51d7eb){return db[_0x8b78('0x60')][_0x8b78('0x75')]({'where':{'UserId':_0x51d7eb['id'],'ChatQueueId':_0x1ddba1[_0x8b78('0x53')]['id']},'transaction':_0x418508});});})[_0x8b78('0x1d')](function(){_0x52f6da[_0x8b78('0x76')](function(_0x4603c7){socket[_0x8b78('0x77')](_0x8b78('0x78'),{'UserId':_0x4603c7['id'],'ChatQueueId':_0x3695d4['id']});});});});});}})['then'](respondWithStatusCode(_0x189203,null))[_0x8b78('0x28')](handleError(_0x189203,null));};exports[_0x8b78('0x79')]=function(_0x262540,_0x51adc6,_0x470ffb){return db[_0x8b78('0x6c')][_0x8b78('0x52')]({'where':{'id':_0x262540['query'][_0x8b78('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x8b78('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8b78('0x1d')](handleEntityNotFound(_0x51adc6,null))[_0x8b78('0x1d')](function(_0xf78bb2){var _0x108dab=_[_0x8b78('0x3b')](_0xf78bb2,'id');var _0x1dab86=[];var _0x25156c=[];var _0x4307ee=squel[_0x8b78('0x7a')]();_0x4307ee['field'](_0x8b78('0x7b'))[_0x8b78('0x7c')](_0x8b78('0x7d'),'tq')[_0x8b78('0x7e')](_0x8b78('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8b78('0x4a')](_0x8b78('0x80'),_0x262540['params']['id']);for(var _0x5b0e5f=0x0;_0x5b0e5f<_0xf78bb2[_0x8b78('0x47')];_0x5b0e5f+=0x1){let _0x14cadb=_0xf78bb2[_0x5b0e5f];for(var _0x1e26c=0x0;_0x1e26c<_0x14cadb[_0x8b78('0x6f')][_0x8b78('0x47')];_0x1e26c+=0x1){let _0x4a113e=_0x14cadb[_0x8b78('0x6f')][_0x1e26c];var _0x5b2036=_0x4307ee[_0x8b78('0x81')]();_0x5b2036[_0x8b78('0x4a')](_0x8b78('0x82'),_0x4a113e['id']);_0x25156c[_0x8b78('0x83')](db['sequelize']['query'](_0x5b2036[_0x8b78('0x84')](),{'type':db[_0x8b78('0x73')][_0x8b78('0x85')][_0x8b78('0x86')]})[_0x8b78('0x1d')](function(_0x22dfac){if(_0x22dfac[_0x8b78('0x47')]===0x1){return _0x4a113e['id'];}else{var _0x411131=_['every'](_[_0x8b78('0x3b')](_0x22dfac,_0x8b78('0x87')),function(_0x5a1c43){return _[_0x8b78('0x88')](_0x108dab,_0x5a1c43);});if(_0x411131){return _0x4a113e['id'];}}}));}}return BPromise[_0x8b78('0x89')](_0x25156c)[_0x8b78('0x1d')](function(_0x253c66){_0x1dab86=_(_0x1dab86)['union'](_0x253c66)[_0x8b78('0x8a')]()[_0x8b78('0x8b')]();return db['ChatQueue'][_0x8b78('0x55')]({'where':{'id':_0x262540[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](function(_0x4cd633){return db[_0x8b78('0x73')][_0x8b78('0x8c')](function(_0xe7e026){return _0x4cd633['removeTeams'](_0x262540['query']['ids'],{'transaction':_0xe7e026})[_0x8b78('0x1d')](function(){if(!_['isEmpty'](_0x1dab86)){return _0x4cd633[_0x8b78('0x8d')](_0x1dab86,{'transaction':_0xe7e026});}})[_0x8b78('0x1d')](function(){_0x1dab86[_0x8b78('0x76')](function(_0x30f683){socket[_0x8b78('0x77')](_0x8b78('0x8e'),{'UserId':_0x30f683,'ChatQueueId':_0x4cd633['id']});});});});});});})[_0x8b78('0x1d')](respondWithStatusCode(_0x51adc6,null))[_0x8b78('0x28')](handleError(_0x51adc6,null));};exports[_0x8b78('0x8f')]=function(_0x73f62a,_0x4368a9,_0x365d55){return db[_0x8b78('0x4f')][_0x8b78('0x55')]({'where':{'id':_0x73f62a[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0x4368a9,null))[_0x8b78('0x1d')](function(_0x419e80){if(_0x419e80){return _0x419e80['addAgents'](_0x73f62a[_0x8b78('0x57')][_0x8b78('0x6d')],_['omit'](_0x73f62a[_0x8b78('0x57')],[_0x8b78('0x6d'),'id'])||{})[_0x8b78('0x90')](function(_0xc11fdc){for(var _0x180163=0x0;_0x180163<_0x73f62a[_0x8b78('0x57')][_0x8b78('0x6d')]['length'];_0x180163+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x73f62a[_0x8b78('0x57')][_0x8b78('0x6d')][_0x180163]),'ChatQueueId':Number(_0x73f62a[_0x8b78('0x53')]['id'])});}return _0xc11fdc;});}})[_0x8b78('0x1d')](respondWithResult(_0x4368a9,null))['catch'](handleError(_0x4368a9,null));};exports['removeAgents']=function(_0x3a4c4a,_0xc72923,_0x2ec143){return db['ChatQueue']['find']({'where':{'id':_0x3a4c4a[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0xc72923,null))[_0x8b78('0x1d')](function(_0x32882b){if(_0x32882b){return _0x32882b[_0x8b78('0x8d')](_0x3a4c4a[_0x8b78('0x41')][_0x8b78('0x6d')])[_0x8b78('0x1d')](function(){if(_[_0x8b78('0x91')](_0x3a4c4a['query']['ids'])){for(var _0x20a589=0x0;_0x20a589<_0x3a4c4a[_0x8b78('0x41')]['ids'][_0x8b78('0x47')];_0x20a589+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x3a4c4a['query'][_0x8b78('0x6d')][_0x20a589]),'ChatQueueId':Number(_0x3a4c4a[_0x8b78('0x53')]['id'])});}}else{socket[_0x8b78('0x77')](_0x8b78('0x8e'),{'UserId':Number(_0x3a4c4a['query'][_0x8b78('0x6d')]),'ChatQueueId':Number(_0x3a4c4a[_0x8b78('0x53')]['id'])});}});}})[_0x8b78('0x1d')](respondWithStatusCode(_0xc72923,null))[_0x8b78('0x28')](handleError(_0xc72923,null));};exports[_0x8b78('0x92')]=function(_0x3ac34d,_0x223cc9,_0x48c93d){var _0x29e3c9={};var _0x1be58b={};var _0x445116;var _0x412e84;return db[_0x8b78('0x4f')][_0x8b78('0x5f')]({'where':{'id':_0x3ac34d[_0x8b78('0x53')]['id']}})[_0x8b78('0x1d')](handleEntityNotFound(_0x223cc9,null))[_0x8b78('0x1d')](function(_0x4aab96){if(_0x4aab96){_0x445116=_0x4aab96;_0x1be58b[_0x8b78('0x40')]=_[_0x8b78('0x42')](db['User'][_0x8b78('0x3c')]);_0x1be58b[_0x8b78('0x41')]=_[_0x8b78('0x42')](_0x3ac34d[_0x8b78('0x41')]);_0x1be58b['filters']=_[_0x8b78('0x44')](_0x1be58b[_0x8b78('0x40')],_0x1be58b[_0x8b78('0x41')]);_0x29e3c9[_0x8b78('0x46')]=_[_0x8b78('0x44')](_0x1be58b[_0x8b78('0x40')],qs[_0x8b78('0x45')](_0x3ac34d['query'][_0x8b78('0x45')]));_0x29e3c9[_0x8b78('0x46')]=_0x29e3c9['attributes'][_0x8b78('0x47')]?_0x29e3c9['attributes']:_0x1be58b[_0x8b78('0x40')];_0x29e3c9['order']=qs[_0x8b78('0x49')](_0x3ac34d['query']['sort']);_0x29e3c9[_0x8b78('0x4a')]=qs[_0x8b78('0x43')](_[_0x8b78('0x4b')](_0x3ac34d['query'],_0x1be58b[_0x8b78('0x43')]));if(_0x3ac34d[_0x8b78('0x41')][_0x8b78('0x4c')]){_0x29e3c9['where']=_[_0x8b78('0x4d')](_0x29e3c9[_0x8b78('0x4a')],{'$or':_['map'](_0x29e3c9[_0x8b78('0x46')],function(_0x311f5d){var _0x10aac3={};_0x10aac3[_0x311f5d]={'$like':'%'+_0x3ac34d[_0x8b78('0x41')]['filter']+'%'};return _0x10aac3;})});}_0x29e3c9=_[_0x8b78('0x4d')]({},_0x29e3c9,_0x3ac34d[_0x8b78('0x54')]);return _0x445116[_0x8b78('0x92')](_0x29e3c9);}})[_0x8b78('0x1d')](function(_0x6eb639){if(_0x6eb639){_0x412e84=_0x6eb639['length'];if(!_0x3ac34d['query'][_0x8b78('0x48')]('nolimit')){_0x29e3c9[_0x8b78('0x30')]=qs['limit'](_0x3ac34d[_0x8b78('0x41')][_0x8b78('0x30')]);_0x29e3c9['offset']=qs[_0x8b78('0x2d')](_0x3ac34d['query'][_0x8b78('0x2d')]);}return _0x445116[_0x8b78('0x92')](_0x29e3c9);}})[_0x8b78('0x1d')](function(_0x3b5c37){if(_0x3b5c37){return _0x3b5c37?{'count':_0x412e84,'rows':_0x3b5c37}:null;}})['then'](respondWithResult(_0x223cc9,null))[_0x8b78('0x28')](handleError(_0x223cc9,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index c7401b6..f1e8151 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 _0xd846=['../../mysqldb','ChatQueue','update','emit','hook','exports','events'];(function(_0x2d1a6d,_0xedb0){var _0x5bd1fc=function(_0x2cf26f){while(--_0x2cf26f){_0x2d1a6d['push'](_0x2d1a6d['shift']());}};_0x5bd1fc(++_0xedb0);}(_0xd846,0x195));var _0x6d84=function(_0x2e85ac,_0x1bf732){_0x2e85ac=_0x2e85ac-0x0;var _0x31e4ad=_0xd846[_0x2e85ac];return _0x31e4ad;};'use strict';var EventEmitter=require(_0x6d84('0x0'));var ChatQueue=require(_0x6d84('0x1'))['db'][_0x6d84('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d84('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47e90f){return function(_0x15fb0c,_0xa19796,_0x5c2176){ChatQueueEvents[_0x6d84('0x4')](_0x47e90f+':'+_0x15fb0c['id'],_0x15fb0c);ChatQueueEvents['emit'](_0x47e90f,_0x15fb0c);_0x5c2176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6d84('0x5')](e,emitEvent(event));}}module[_0x6d84('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xeea2=['save','update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x55097e,_0x2a44f9){var _0x55e811=function(_0x20483b){while(--_0x20483b){_0x55097e['push'](_0x55097e['shift']());}};_0x55e811(++_0x2a44f9);}(_0xeea2,0xce));var _0x2eea=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xeea2[_0x31a371];return _0x2a5bd6;};'use strict';var EventEmitter=require(_0x2eea('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2eea('0x1')](0x0);var events={'afterCreate':_0x2eea('0x2'),'afterUpdate':_0x2eea('0x3'),'afterDestroy':_0x2eea('0x4')};function emitEvent(_0x5f5a27){return function(_0x76302e,_0x21746c,_0x2f78c9){ChatQueueEvents[_0x2eea('0x5')](_0x5f5a27+':'+_0x76302e['id'],_0x76302e);ChatQueueEvents[_0x2eea('0x5')](_0x5f5a27,_0x76302e);_0x2f78c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x2eea('0x6')](e,emitEvent(event));}}module[_0x2eea('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1fbcfc2..afb1ac3 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 _0xc711=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x5093a4,_0x2818d3){var _0x11a221=function(_0x2ef5a0){while(--_0x2ef5a0){_0x5093a4['push'](_0x5093a4['shift']());}};_0x11a221(++_0x2818d3);}(_0xc711,0x19f));var _0x1c71=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xc711[_0x211fef];return _0x5447bf;};'use strict';var _=require('lodash');var util=require(_0x1c71('0x0'));var logger=require(_0x1c71('0x1'))(_0x1c71('0x2'));var moment=require(_0x1c71('0x3'));var BPromise=require(_0x1c71('0x4'));var rp=require(_0x1c71('0x5'));var fs=require('fs');var path=require(_0x1c71('0x6'));var rimraf=require(_0x1c71('0x7'));var config=require(_0x1c71('0x8'));var attributes=require(_0x1c71('0x9'));module[_0x1c71('0xa')]=function(_0x459d69,_0x714ca0){return _0x459d69['define'](_0x1c71('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e25=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e97ef,_0x5ca35c){var _0x297ed6=function(_0x5596c1){while(--_0x5596c1){_0x1e97ef['push'](_0x1e97ef['shift']());}};_0x297ed6(++_0x5ca35c);}(_0x7e25,0x159));var _0x57e2=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x7e25[_0x3b2369];return _0x5a1367;};'use strict';var _=require(_0x57e2('0x0'));var util=require(_0x57e2('0x1'));var logger=require(_0x57e2('0x2'))(_0x57e2('0x3'));var moment=require(_0x57e2('0x4'));var BPromise=require(_0x57e2('0x5'));var rp=require(_0x57e2('0x6'));var fs=require('fs');var path=require(_0x57e2('0x7'));var rimraf=require('rimraf');var config=require(_0x57e2('0x8'));var attributes=require(_0x57e2('0x9'));module[_0x57e2('0xa')]=function(_0x38f7f0,_0x366ffa){return _0x38f7f0['define'](_0x57e2('0xb'),attributes,{'tableName':_0x57e2('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 2b3d19d..7c4680b 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 _0x2b50=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','where','limit','map','include','attributes','model','ShowChatQueue','lodash'];(function(_0x2c0546,_0x316d34){var _0x391857=function(_0x3904a6){while(--_0x3904a6){_0x2c0546['push'](_0x2c0546['shift']());}};_0x391857(++_0x316d34);}(_0x2b50,0x68));var _0x02b5=function(_0x4dd284,_0x1d349a){_0x4dd284=_0x4dd284-0x0;var _0x422fec=_0x2b50[_0x4dd284];return _0x422fec;};'use strict';var _=require(_0x02b5('0x0'));var util=require('util');var moment=require(_0x02b5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02b5('0x2'))['db'];var utils=require(_0x02b5('0x3'));var logger=require(_0x02b5('0x4'))(_0x02b5('0x5'));var config=require('../../config/environment');var jayson=require(_0x02b5('0x6'));var client=jayson[_0x02b5('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x02b5('0x8')],{'host':_0x02b5('0x9'),'port':0x18eb});var socket=require(_0x02b5('0xa'))(new Redis(config[_0x02b5('0x8')]));require(_0x02b5('0xb'))[_0x02b5('0xc')](socket);function respondWithRpcPromise(_0x21ec08,_0x92c740,_0x3b6547){return new BPromise(function(_0x25d9d2,_0x3ee4da){return client[_0x02b5('0xd')](_0x21ec08,_0x3b6547)[_0x02b5('0xe')](function(_0x306838){logger[_0x02b5('0xf')](_0x02b5('0x10'),_0x92c740,_0x02b5('0x11'));logger[_0x02b5('0x12')](_0x02b5('0x13'),_0x92c740,_0x02b5('0x11'),JSON[_0x02b5('0x14')](_0x306838));if(_0x306838[_0x02b5('0x15')]){if(_0x306838[_0x02b5('0x15')]['code']===0x1f4){logger['error'](_0x02b5('0x10'),_0x92c740,_0x306838[_0x02b5('0x15')]['message']);return _0x3ee4da(_0x306838[_0x02b5('0x15')][_0x02b5('0x16')]);}logger[_0x02b5('0x15')](_0x02b5('0x10'),_0x92c740,_0x306838[_0x02b5('0x15')][_0x02b5('0x16')]);return _0x25d9d2(_0x306838[_0x02b5('0x15')][_0x02b5('0x16')]);}else{logger[_0x02b5('0xf')]('ChatQueue,\x20%s,\x20%s',_0x92c740,_0x02b5('0x11'));_0x25d9d2(_0x306838[_0x02b5('0x17')]['message']);}})[_0x02b5('0x18')](function(_0x40fcfe){logger['error'](_0x02b5('0x10'),_0x92c740,_0x40fcfe);_0x3ee4da(_0x40fcfe);});});}exports[_0x02b5('0x19')]=function(_0x24703c){var _0x31df71=this;return new Promise(function(_0x98fe5a,_0x5d9b67){return db['ChatQueue'][_0x02b5('0x1a')]({'raw':_0x24703c['options']?_0x24703c['options']['raw']===undefined?!![]:![]:!![],'where':_0x24703c[_0x02b5('0x1b')]?_0x24703c[_0x02b5('0x1b')][_0x02b5('0x1c')]||null:null,'attributes':_0x24703c[_0x02b5('0x1b')]?_0x24703c[_0x02b5('0x1b')]['attributes']||null:null,'limit':_0x24703c[_0x02b5('0x1b')]?_0x24703c[_0x02b5('0x1b')][_0x02b5('0x1d')]||null:null,'include':_0x24703c[_0x02b5('0x1b')]?_0x24703c[_0x02b5('0x1b')]['include']?_[_0x02b5('0x1e')](_0x24703c[_0x02b5('0x1b')][_0x02b5('0x1f')],function(_0x3383ef){return{'model':db[_0x3383ef['model']],'as':_0x3383ef['as'],'attributes':_0x3383ef[_0x02b5('0x20')],'include':_0x3383ef[_0x02b5('0x1f')]?_[_0x02b5('0x1e')](_0x3383ef[_0x02b5('0x1f')],function(_0x2c2522){return{'model':db[_0x2c2522['model']],'as':_0x2c2522['as'],'attributes':_0x2c2522[_0x02b5('0x20')],'include':_0x2c2522['include']?_[_0x02b5('0x1e')](_0x2c2522['include'],function(_0x5dc17e){return{'model':db[_0x5dc17e[_0x02b5('0x21')]],'as':_0x5dc17e['as'],'attributes':_0x5dc17e[_0x02b5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x535bda){logger[_0x02b5('0xf')](_0x02b5('0x19'),_0x24703c);logger[_0x02b5('0x12')](_0x02b5('0x19'),_0x24703c,JSON[_0x02b5('0x14')](_0x535bda));_0x98fe5a(_0x535bda);})['catch'](function(_0x28c0e3){logger[_0x02b5('0x15')]('GetChatQueue',_0x28c0e3[_0x02b5('0x16')],_0x24703c);_0x5d9b67(_0x31df71['error'](0x1f4,_0x28c0e3['message']));});});};exports[_0x02b5('0x22')]=function(_0x21dee5){var _0x35c5b3=this;return new Promise(function(_0x5e320f,_0x29362a){return db['ChatQueue']['find']({'raw':_0x21dee5['options']?_0x21dee5[_0x02b5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21dee5[_0x02b5('0x1b')]?_0x21dee5[_0x02b5('0x1b')][_0x02b5('0x1c')]||null:null,'attributes':_0x21dee5[_0x02b5('0x1b')]?_0x21dee5[_0x02b5('0x1b')][_0x02b5('0x20')]||null:null,'include':_0x21dee5[_0x02b5('0x1b')]?_0x21dee5['options']['include']?_['map'](_0x21dee5[_0x02b5('0x1b')]['include'],function(_0x367caa){return{'model':db[_0x367caa[_0x02b5('0x21')]],'as':_0x367caa['as'],'attributes':_0x367caa['attributes'],'include':_0x367caa[_0x02b5('0x1f')]?_[_0x02b5('0x1e')](_0x367caa['include'],function(_0x330be6){return{'model':db[_0x330be6['model']],'as':_0x330be6['as'],'attributes':_0x330be6['attributes'],'include':_0x330be6[_0x02b5('0x1f')]?_[_0x02b5('0x1e')](_0x330be6['include'],function(_0x1e4536){return{'model':db[_0x1e4536[_0x02b5('0x21')]],'as':_0x1e4536['as'],'attributes':_0x1e4536[_0x02b5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x02b5('0xe')](function(_0x3a6d9b){logger[_0x02b5('0xf')](_0x02b5('0x22'),_0x21dee5);logger['debug'](_0x02b5('0x22'),_0x21dee5,JSON[_0x02b5('0x14')](_0x3a6d9b));_0x5e320f(_0x3a6d9b);})[_0x02b5('0x18')](function(_0x411feb){logger[_0x02b5('0x15')](_0x02b5('0x22'),_0x411feb[_0x02b5('0x16')],_0x21dee5);_0x29362a(_0x35c5b3[_0x02b5('0x15')](0x1f4,_0x411feb['message']));});});}; \ No newline at end of file +var _0xd914=['ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','attributes','limit','include','model','map','then','stringify','find','raw','where','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xd914,0x17f));var _0x4d91=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0xd914[_0x154cb5];return _0x3f574f;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});config[_0x4d91('0xb')]=_[_0x4d91('0xc')](config[_0x4d91('0xb')],{'host':_0x4d91('0xd'),'port':0x18eb});var socket=require(_0x4d91('0xe'))(new Redis(config[_0x4d91('0xb')]));require('./chatQueue.socket')[_0x4d91('0xf')](socket);function respondWithRpcPromise(_0xa4bb25,_0xc07c64,_0x278648){return new BPromise(function(_0xb234d2,_0x266b31){return client['request'](_0xa4bb25,_0x278648)['then'](function(_0x2ccd08){logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));logger[_0x4d91('0x13')](_0x4d91('0x14'),_0xc07c64,'request\x20sent',JSON['stringify'](_0x2ccd08));if(_0x2ccd08[_0x4d91('0x15')]){if(_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x16')]===0x1f4){logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0x266b31(_0x2ccd08['error'][_0x4d91('0x17')]);}logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0xb234d2(_0x2ccd08['error'][_0x4d91('0x17')]);}else{logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));_0xb234d2(_0x2ccd08['result'][_0x4d91('0x17')]);}})[_0x4d91('0x18')](function(_0x13254c){logger['error'](_0x4d91('0x11'),_0xc07c64,_0x13254c);_0x266b31(_0x13254c);});});}exports[_0x4d91('0x19')]=function(_0x351388){var _0xd59fe=this;return new Promise(function(_0x10b767,_0x40cde4){return db[_0x4d91('0x1a')][_0x4d91('0x1b')]({'raw':_0x351388[_0x4d91('0x1c')]?_0x351388[_0x4d91('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x351388[_0x4d91('0x1c')]?_0x351388['options']['where']||null:null,'attributes':_0x351388[_0x4d91('0x1c')]?_0x351388[_0x4d91('0x1c')][_0x4d91('0x1d')]||null:null,'limit':_0x351388[_0x4d91('0x1c')]?_0x351388[_0x4d91('0x1c')][_0x4d91('0x1e')]||null:null,'include':_0x351388[_0x4d91('0x1c')]?_0x351388[_0x4d91('0x1c')]['include']?_['map'](_0x351388[_0x4d91('0x1c')][_0x4d91('0x1f')],function(_0x3bed98){return{'model':db[_0x3bed98[_0x4d91('0x20')]],'as':_0x3bed98['as'],'attributes':_0x3bed98[_0x4d91('0x1d')],'include':_0x3bed98[_0x4d91('0x1f')]?_[_0x4d91('0x21')](_0x3bed98['include'],function(_0x3dc353){return{'model':db[_0x3dc353[_0x4d91('0x20')]],'as':_0x3dc353['as'],'attributes':_0x3dc353[_0x4d91('0x1d')],'include':_0x3dc353['include']?_['map'](_0x3dc353[_0x4d91('0x1f')],function(_0x470079){return{'model':db[_0x470079['model']],'as':_0x470079['as'],'attributes':_0x470079['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d91('0x22')](function(_0x2d6981){logger[_0x4d91('0x10')](_0x4d91('0x19'),_0x351388);logger['debug'](_0x4d91('0x19'),_0x351388,JSON[_0x4d91('0x23')](_0x2d6981));_0x10b767(_0x2d6981);})[_0x4d91('0x18')](function(_0xee7535){logger[_0x4d91('0x15')](_0x4d91('0x19'),_0xee7535[_0x4d91('0x17')],_0x351388);_0x40cde4(_0xd59fe['error'](0x1f4,_0xee7535[_0x4d91('0x17')]));});});};exports['ShowChatQueue']=function(_0x4ad7bf){var _0x292808=this;return new Promise(function(_0x3a2780,_0x4f95f0){return db[_0x4d91('0x1a')][_0x4d91('0x24')]({'raw':_0x4ad7bf[_0x4d91('0x1c')]?_0x4ad7bf[_0x4d91('0x1c')][_0x4d91('0x25')]===undefined?!![]:![]:!![],'where':_0x4ad7bf['options']?_0x4ad7bf[_0x4d91('0x1c')][_0x4d91('0x26')]||null:null,'attributes':_0x4ad7bf[_0x4d91('0x1c')]?_0x4ad7bf[_0x4d91('0x1c')][_0x4d91('0x1d')]||null:null,'include':_0x4ad7bf[_0x4d91('0x1c')]?_0x4ad7bf['options'][_0x4d91('0x1f')]?_[_0x4d91('0x21')](_0x4ad7bf['options'][_0x4d91('0x1f')],function(_0x35869a){return{'model':db[_0x35869a[_0x4d91('0x20')]],'as':_0x35869a['as'],'attributes':_0x35869a['attributes'],'include':_0x35869a[_0x4d91('0x1f')]?_[_0x4d91('0x21')](_0x35869a[_0x4d91('0x1f')],function(_0x1237db){return{'model':db[_0x1237db['model']],'as':_0x1237db['as'],'attributes':_0x1237db[_0x4d91('0x1d')],'include':_0x1237db[_0x4d91('0x1f')]?_[_0x4d91('0x21')](_0x1237db[_0x4d91('0x1f')],function(_0x5f3862){return{'model':db[_0x5f3862['model']],'as':_0x5f3862['as'],'attributes':_0x5f3862[_0x4d91('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4d91('0x22')](function(_0x524052){logger[_0x4d91('0x10')](_0x4d91('0x27'),_0x4ad7bf);logger[_0x4d91('0x13')](_0x4d91('0x27'),_0x4ad7bf,JSON['stringify'](_0x524052));_0x3a2780(_0x524052);})[_0x4d91('0x18')](function(_0x2a1106){logger['error'](_0x4d91('0x27'),_0x2a1106['message'],_0x4ad7bf);_0x4f95f0(_0x292808[_0x4d91('0x15')](0x1f4,_0x2a1106['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3192b40..1477b90 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 _0x04de=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x04de,0x107));var _0xe04d=function(_0x337194,_0x17405f){_0x337194=_0x337194-0x0;var _0x1c075e=_0x04de[_0x337194];return _0x1c075e;};'use strict';var ChatQueueEvents=require(_0xe04d('0x0'));var events=[_0xe04d('0x1'),_0xe04d('0x2'),_0xe04d('0x3')];function createListener(_0x1e650d,_0x28f63f){return function(_0x1113af){_0x28f63f[_0xe04d('0x4')](_0x1e650d,_0x1113af);};}function removeListener(_0x2593a4,_0x70ead0){return function(){ChatQueueEvents[_0xe04d('0x5')](_0x2593a4,_0x70ead0);};}exports['register']=function(_0x4bb925){for(var _0x4f7637=0x0,_0x531688=events[_0xe04d('0x6')];_0x4f7637<_0x531688;_0x4f7637++){var _0x210e93=events[_0x4f7637];var _0x72b1ce=createListener(_0xe04d('0x7')+_0x210e93,_0x4bb925);ChatQueueEvents['on'](_0x210e93,_0x72b1ce);}}; \ No newline at end of file +var _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x2735d1,_0x13b40f){var _0x2f8fa3=function(_0xcc548b){while(--_0xcc548b){_0x2735d1['push'](_0x2735d1['shift']());}};_0x2f8fa3(++_0x13b40f);}(_0xa37e,0x97));var _0xea37=function(_0x472479,_0x2429d2){_0x472479=_0x472479-0x0;var _0x1c38e9=_0xa37e[_0x472479];return _0x1c38e9;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d195077..a58bb8f 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e8583,_0x5181c3){var _0xba5bb0=function(_0x5b79bc){while(--_0x5b79bc){_0x1e8583['push'](_0x1e8583['shift']());}};_0xba5bb0(++_0x5181c3);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'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['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=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(_0x21e3af,_0x26127a){var _0x1a6048=function(_0x4ff693){while(--_0x4ff693){_0x21e3af['push'](_0x21e3af['shift']());}};_0x1a6048(++_0x26127a);}(_0x55ca,0x126));var _0xa55c=function(_0x3d5371,_0x24ebd7){_0x3d5371=_0x3d5371-0x0;var _0x4631e3=_0x55ca[_0x3d5371];return _0x4631e3;};'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 5063350..00f8ed5 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 _0xe157=['DATE','moment','sequelize','exports','STRING'];(function(_0x15dcaf,_0x2ad551){var _0x1d4665=function(_0x5305ae){while(--_0x5305ae){_0x15dcaf['push'](_0x15dcaf['shift']());}};_0x1d4665(++_0x2ad551);}(_0xe157,0x13c));var _0x7e15=function(_0x5118d6,_0x204fca){_0x5118d6=_0x5118d6-0x0;var _0x5ab55b=_0xe157[_0x5118d6];return _0x5ab55b;};'use strict';var moment=require(_0x7e15('0x0'));var Sequelize=require(_0x7e15('0x1'));module[_0x7e15('0x2')]={'uniqueid':{'type':Sequelize[_0x7e15('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7e15('0x4')]},'exitAt':{'type':Sequelize[_0x7e15('0x4')]},'reason':{'type':Sequelize[_0x7e15('0x3')]}}; \ No newline at end of file +var _0x268b=['STRING','DATE','moment','sequelize','exports'];(function(_0x494203,_0x2621c5){var _0x15e427=function(_0x554756){while(--_0x554756){_0x494203['push'](_0x494203['shift']());}};_0x15e427(++_0x2621c5);}(_0x268b,0xca));var _0xb268=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x268b[_0x2fbd0e];return _0x481c9f;};'use strict';var moment=require(_0xb268('0x0'));var Sequelize=require(_0xb268('0x1'));module[_0xb268('0x2')]={'uniqueid':{'type':Sequelize[_0xb268('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb268('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb268('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb268('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0be659e..c4e34aa 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 _0x720b=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','send','index','rawAttributes','type','model','map','name','query','keys','intersection','fields','attributes','length'];(function(_0x47edea,_0xdfb9f){var _0x54208b=function(_0x3d703e){while(--_0x3d703e){_0x47edea['push'](_0x47edea['shift']());}};_0x54208b(++_0xdfb9f);}(_0x720b,0x1d8));var _0xb720=function(_0x4741a1,_0x35563f){_0x4741a1=_0x4741a1-0x0;var _0xaea39f=_0x720b[_0x4741a1];return _0xaea39f;};'use strict';var emlformat=require(_0xb720('0x0'));var rimraf=require(_0xb720('0x1'));var zipdir=require(_0xb720('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb720('0x3'));var moment=require(_0xb720('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb720('0x5'));var util=require(_0xb720('0x6'));var path=require(_0xb720('0x7'));var sox=require('sox');var csv=require(_0xb720('0x8'));var ejs=require(_0xb720('0x9'));var fs=require('fs');var fs_extra=require(_0xb720('0xa'));var _=require(_0xb720('0xb'));var squel=require(_0xb720('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb720('0xd'));var toCsv=require(_0xb720('0x8'));var querystring=require(_0xb720('0xe'));var Papa=require(_0xb720('0xf'));var Redis=require(_0xb720('0x10'));var authService=require(_0xb720('0x11'));var qs=require(_0xb720('0x12'));var as=require(_0xb720('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb720('0x14'))(_0xb720('0x15'));var utils=require('../../config/utils');var config=require(_0xb720('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb720('0x17'))['db'];function respondWithStatusCode(_0x4ab352,_0x62de2b){_0x62de2b=_0x62de2b||0xcc;return function(_0x12781c){if(_0x12781c){return _0x4ab352[_0xb720('0x18')](_0x62de2b);}return _0x4ab352[_0xb720('0x19')](_0x62de2b)[_0xb720('0x1a')]();};}function respondWithResult(_0x30a5dd,_0x1d29ce){_0x1d29ce=_0x1d29ce||0xc8;return function(_0x414216){if(_0x414216){return _0x30a5dd['status'](_0x1d29ce)[_0xb720('0x1b')](_0x414216);}};}function respondWithFilteredResult(_0x2749fd,_0x3e7e22){return function(_0x5a675d){if(_0x5a675d){var _0x4edde2=typeof _0x3e7e22[_0xb720('0x1c')]===_0xb720('0x1d')&&typeof _0x3e7e22[_0xb720('0x1e')]==='undefined';var _0x1bda26=_0x5a675d[_0xb720('0x1f')];var _0x453c43=_0x4edde2?0x0:_0x3e7e22[_0xb720('0x1c')];var _0x395d6a=_0x4edde2?_0x5a675d[_0xb720('0x1f')]:_0x3e7e22[_0xb720('0x1c')]+_0x3e7e22[_0xb720('0x1e')];var _0x3d8fa4;if(_0x395d6a>=_0x1bda26){_0x395d6a=_0x1bda26;_0x3d8fa4=0xc8;}else{_0x3d8fa4=0xce;}_0x2749fd[_0xb720('0x19')](_0x3d8fa4);return _0x2749fd[_0xb720('0x20')](_0xb720('0x21'),_0x453c43+'-'+_0x395d6a+'/'+_0x1bda26)[_0xb720('0x1b')](_0x5a675d);}return null;};}function patchUpdates(_0x3bcca2){return function(_0x38f815){try{jsonpatch[_0xb720('0x22')](_0x38f815,_0x3bcca2,!![]);}catch(_0x25acb4){return BPromise[_0xb720('0x23')](_0x25acb4);}return _0x38f815[_0xb720('0x24')]();};}function saveUpdates(_0x8b19ea,_0x4e366a){return function(_0x5359b5){if(_0x5359b5){return _0x5359b5['update'](_0x8b19ea)[_0xb720('0x25')](function(_0x5f47d5){return _0x5f47d5;});}return null;};}function removeEntity(_0x27d3cb,_0x20bec1){return function(_0x3b4f61){if(_0x3b4f61){return _0x3b4f61[_0xb720('0x26')]()[_0xb720('0x25')](function(){_0x27d3cb[_0xb720('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498860,_0x5cb6aa){return function(_0x298cce){if(!_0x298cce){_0x498860[_0xb720('0x18')](0x194);}return _0x298cce;};}function handleError(_0x5f1e03,_0x508eb8){_0x508eb8=_0x508eb8||0x1f4;return function(_0x1c3805){logger['error'](_0x1c3805[_0xb720('0x27')]);if(_0x1c3805['name']){delete _0x1c3805['name'];}_0x5f1e03[_0xb720('0x19')](_0x508eb8)[_0xb720('0x28')](_0x1c3805);};}exports[_0xb720('0x29')]=function(_0x416161,_0x466405){var _0xd25825={},_0x732423={},_0x17faec={'count':0x0,'rows':[]};var _0x575738=_['map'](db['ChatQueueReport'][_0xb720('0x2a')],function(_0x70faef){return{'name':_0x70faef['fieldName'],'type':_0x70faef[_0xb720('0x2b')]['key']};});_0x732423[_0xb720('0x2c')]=_[_0xb720('0x2d')](_0x575738,_0xb720('0x2e'));_0x732423[_0xb720('0x2f')]=_[_0xb720('0x30')](_0x416161[_0xb720('0x2f')]);_0x732423['filters']=_[_0xb720('0x31')](_0x732423[_0xb720('0x2c')],_0x732423[_0xb720('0x2f')]);_0xd25825['attributes']=_[_0xb720('0x31')](_0x732423[_0xb720('0x2c')],qs['fields'](_0x416161['query'][_0xb720('0x32')]));_0xd25825['attributes']=_0xd25825[_0xb720('0x33')][_0xb720('0x34')]?_0xd25825[_0xb720('0x33')]:_0x732423[_0xb720('0x2c')];if(!_0x416161['query']['hasOwnProperty'](_0xb720('0x35'))){_0xd25825[_0xb720('0x1e')]=qs[_0xb720('0x1e')](_0x416161[_0xb720('0x2f')][_0xb720('0x1e')]);_0xd25825['offset']=qs['offset'](_0x416161[_0xb720('0x2f')][_0xb720('0x1c')]);}_0xd25825[_0xb720('0x36')]=qs[_0xb720('0x37')](_0x416161[_0xb720('0x2f')][_0xb720('0x37')]);_0xd25825[_0xb720('0x38')]=qs[_0xb720('0x39')](_[_0xb720('0x3a')](_0x416161['query'],_0x732423['filters']),_0x575738);if(_0x416161[_0xb720('0x2f')][_0xb720('0x3b')]){_0xd25825[_0xb720('0x38')]=_[_0xb720('0x3c')](_0xd25825[_0xb720('0x38')],{'$or':_[_0xb720('0x2d')](_0x575738,function(_0x1e8bc2){if(_0x1e8bc2[_0xb720('0x2b')]!==_0xb720('0x3d')){var _0x4aaa5f={};_0x4aaa5f[_0x1e8bc2[_0xb720('0x2e')]]={'$like':'%'+_0x416161[_0xb720('0x2f')][_0xb720('0x3b')]+'%'};return _0x4aaa5f;}})});}_0xd25825=_[_0xb720('0x3c')]({},_0xd25825,_0x416161['options']);var _0xb50cec={'where':_0xd25825[_0xb720('0x38')]};return db[_0xb720('0x3e')][_0xb720('0x1f')](_0xb50cec)[_0xb720('0x25')](function(_0x2ebd44){_0x17faec[_0xb720('0x1f')]=_0x2ebd44;if(_0x416161[_0xb720('0x2f')][_0xb720('0x3f')]){_0xd25825[_0xb720('0x40')]=[{'all':!![]}];}return db[_0xb720('0x3e')][_0xb720('0x41')](_0xd25825);})[_0xb720('0x25')](function(_0x48ab46){_0x17faec[_0xb720('0x42')]=_0x48ab46;return _0x17faec;})[_0xb720('0x25')](respondWithFilteredResult(_0x466405,_0xd25825))[_0xb720('0x43')](handleError(_0x466405,null));};exports['show']=function(_0xddf177,_0x5f1d85){var _0x4d0201={'raw':!![],'where':{'id':_0xddf177[_0xb720('0x44')]['id']}},_0x466a98={};_0x466a98[_0xb720('0x2c')]=_[_0xb720('0x30')](db['ChatQueueReport'][_0xb720('0x2a')]);_0x466a98[_0xb720('0x2f')]=_['keys'](_0xddf177[_0xb720('0x2f')]);_0x466a98[_0xb720('0x39')]=_[_0xb720('0x31')](_0x466a98[_0xb720('0x2c')],_0x466a98[_0xb720('0x2f')]);_0x4d0201[_0xb720('0x33')]=_[_0xb720('0x31')](_0x466a98[_0xb720('0x2c')],qs['fields'](_0xddf177[_0xb720('0x2f')][_0xb720('0x32')]));_0x4d0201['attributes']=_0x4d0201[_0xb720('0x33')]['length']?_0x4d0201[_0xb720('0x33')]:_0x466a98[_0xb720('0x2c')];if(_0xddf177[_0xb720('0x2f')][_0xb720('0x3f')]){_0x4d0201[_0xb720('0x40')]=[{'all':!![]}];}_0x4d0201=_[_0xb720('0x3c')]({},_0x4d0201,_0xddf177[_0xb720('0x45')]);return db['ChatQueueReport'][_0xb720('0x46')](_0x4d0201)['then'](handleEntityNotFound(_0x5f1d85,null))[_0xb720('0x25')](respondWithResult(_0x5f1d85,null))['catch'](handleError(_0x5f1d85,null));};exports[_0xb720('0x47')]=function(_0x10ff3f,_0x428f40){return db[_0xb720('0x3e')][_0xb720('0x47')](_0x10ff3f[_0xb720('0x48')],{})[_0xb720('0x25')](respondWithResult(_0x428f40,0xc9))[_0xb720('0x43')](handleError(_0x428f40,null));};exports[_0xb720('0x49')]=function(_0x4bd743,_0x5565c9){if(_0x4bd743[_0xb720('0x48')]['id']){delete _0x4bd743[_0xb720('0x48')]['id'];}return db[_0xb720('0x3e')][_0xb720('0x46')]({'where':{'id':_0x4bd743['params']['id']}})[_0xb720('0x25')](handleEntityNotFound(_0x5565c9,null))[_0xb720('0x25')](saveUpdates(_0x4bd743['body'],null))[_0xb720('0x25')](respondWithResult(_0x5565c9,null))[_0xb720('0x43')](handleError(_0x5565c9,null));};exports['destroy']=function(_0x3652ef,_0x4e6bce){return db['ChatQueueReport'][_0xb720('0x46')]({'where':{'id':_0x3652ef[_0xb720('0x44')]['id']}})[_0xb720('0x25')](handleEntityNotFound(_0x4e6bce,null))[_0xb720('0x25')](removeEntity(_0x4e6bce,null))[_0xb720('0x43')](handleError(_0x4e6bce,null));};exports[_0xb720('0x4a')]=function(_0x10938a,_0x3eefc1){return db[_0xb720('0x3e')][_0xb720('0x4a')]()[_0xb720('0x25')](respondWithResult(_0x3eefc1,null))[_0xb720('0x43')](handleError(_0x3eefc1,null));}; \ No newline at end of file +var _0x4253=['name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','catch','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack'];(function(_0x5923a9,_0x1f6d7c){var _0x205c15=function(_0x37ea91){while(--_0x37ea91){_0x5923a9['push'](_0x5923a9['shift']());}};_0x205c15(++_0x1f6d7c);}(_0x4253,0x14c));var _0x3425=function(_0x3efab6,_0x4c6126){_0x3efab6=_0x3efab6-0x0;var _0x3358d2=_0x4253[_0x3efab6];return _0x3358d2;};'use strict';var emlformat=require(_0x3425('0x0'));var rimraf=require(_0x3425('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3425('0x2'));var rp=require('request-promise');var moment=require(_0x3425('0x3'));var BPromise=require(_0x3425('0x4'));var Mustache=require(_0x3425('0x5'));var util=require(_0x3425('0x6'));var path=require(_0x3425('0x7'));var sox=require(_0x3425('0x8'));var csv=require(_0x3425('0x9'));var ejs=require(_0x3425('0xa'));var fs=require('fs');var fs_extra=require(_0x3425('0xb'));var _=require('lodash');var squel=require(_0x3425('0xc'));var crypto=require(_0x3425('0xd'));var jsforce=require(_0x3425('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3425('0x9'));var querystring=require(_0x3425('0xf'));var Papa=require('papaparse');var Redis=require(_0x3425('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3425('0x11'));var logger=require(_0x3425('0x12'))(_0x3425('0x13'));var utils=require('../../config/utils');var config=require(_0x3425('0x14'));var licenseUtil=require(_0x3425('0x15'));var db=require(_0x3425('0x16'))['db'];function respondWithStatusCode(_0x5a5cd2,_0xb19960){_0xb19960=_0xb19960||0xcc;return function(_0x31afd8){if(_0x31afd8){return _0x5a5cd2[_0x3425('0x17')](_0xb19960);}return _0x5a5cd2[_0x3425('0x18')](_0xb19960)[_0x3425('0x19')]();};}function respondWithResult(_0x440cc1,_0x42e226){_0x42e226=_0x42e226||0xc8;return function(_0x4ded18){if(_0x4ded18){return _0x440cc1[_0x3425('0x18')](_0x42e226)['json'](_0x4ded18);}};}function respondWithFilteredResult(_0x3c77e6,_0x23aac7){return function(_0x534aed){if(_0x534aed){var _0x169458=typeof _0x23aac7[_0x3425('0x1a')]==='undefined'&&typeof _0x23aac7[_0x3425('0x1b')]==='undefined';var _0xd43449=_0x534aed[_0x3425('0x1c')];var _0x1565c8=_0x169458?0x0:_0x23aac7[_0x3425('0x1a')];var _0x4d5933=_0x169458?_0x534aed[_0x3425('0x1c')]:_0x23aac7['offset']+_0x23aac7[_0x3425('0x1b')];var _0xe4b66e;if(_0x4d5933>=_0xd43449){_0x4d5933=_0xd43449;_0xe4b66e=0xc8;}else{_0xe4b66e=0xce;}_0x3c77e6[_0x3425('0x18')](_0xe4b66e);return _0x3c77e6[_0x3425('0x1d')](_0x3425('0x1e'),_0x1565c8+'-'+_0x4d5933+'/'+_0xd43449)[_0x3425('0x1f')](_0x534aed);}return null;};}function patchUpdates(_0x1e12bb){return function(_0x264d65){try{jsonpatch['apply'](_0x264d65,_0x1e12bb,!![]);}catch(_0x4a6131){return BPromise[_0x3425('0x20')](_0x4a6131);}return _0x264d65['save']();};}function saveUpdates(_0x1ef660,_0x26710c){return function(_0x11705a){if(_0x11705a){return _0x11705a[_0x3425('0x21')](_0x1ef660)[_0x3425('0x22')](function(_0x2f9881){return _0x2f9881;});}return null;};}function removeEntity(_0x520aba,_0x38b577){return function(_0x34617c){if(_0x34617c){return _0x34617c[_0x3425('0x23')]()[_0x3425('0x22')](function(){_0x520aba['status'](0xcc)[_0x3425('0x19')]();});}};}function handleEntityNotFound(_0x31d4d5,_0x2a2162){return function(_0x407a76){if(!_0x407a76){_0x31d4d5[_0x3425('0x17')](0x194);}return _0x407a76;};}function handleError(_0x3322be,_0x3f2e34){_0x3f2e34=_0x3f2e34||0x1f4;return function(_0x2638b5){logger[_0x3425('0x24')](_0x2638b5[_0x3425('0x25')]);if(_0x2638b5[_0x3425('0x26')]){delete _0x2638b5[_0x3425('0x26')];}_0x3322be[_0x3425('0x18')](_0x3f2e34)[_0x3425('0x27')](_0x2638b5);};}exports['index']=function(_0x1ae04f,_0x453914){var _0x3ca2b7={},_0x27f416={},_0x1452b6={'count':0x0,'rows':[]};var _0x1b732a=_[_0x3425('0x28')](db[_0x3425('0x29')][_0x3425('0x2a')],function(_0x15aca6){return{'name':_0x15aca6[_0x3425('0x2b')],'type':_0x15aca6[_0x3425('0x2c')][_0x3425('0x2d')]};});_0x27f416[_0x3425('0x2e')]=_[_0x3425('0x28')](_0x1b732a,_0x3425('0x26'));_0x27f416[_0x3425('0x2f')]=_[_0x3425('0x30')](_0x1ae04f['query']);_0x27f416[_0x3425('0x31')]=_[_0x3425('0x32')](_0x27f416[_0x3425('0x2e')],_0x27f416['query']);_0x3ca2b7[_0x3425('0x33')]=_[_0x3425('0x32')](_0x27f416[_0x3425('0x2e')],qs[_0x3425('0x34')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x34')]));_0x3ca2b7[_0x3425('0x33')]=_0x3ca2b7[_0x3425('0x33')][_0x3425('0x35')]?_0x3ca2b7[_0x3425('0x33')]:_0x27f416[_0x3425('0x2e')];if(!_0x1ae04f[_0x3425('0x2f')]['hasOwnProperty'](_0x3425('0x36'))){_0x3ca2b7[_0x3425('0x1b')]=qs[_0x3425('0x1b')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x1b')]);_0x3ca2b7[_0x3425('0x1a')]=qs[_0x3425('0x1a')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x1a')]);}_0x3ca2b7[_0x3425('0x37')]=qs[_0x3425('0x38')](_0x1ae04f[_0x3425('0x2f')]['sort']);_0x3ca2b7[_0x3425('0x39')]=qs[_0x3425('0x31')](_[_0x3425('0x3a')](_0x1ae04f[_0x3425('0x2f')],_0x27f416[_0x3425('0x31')]),_0x1b732a);if(_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3b')]){_0x3ca2b7[_0x3425('0x39')]=_[_0x3425('0x3c')](_0x3ca2b7[_0x3425('0x39')],{'$or':_[_0x3425('0x28')](_0x1b732a,function(_0x48f5dc){if(_0x48f5dc[_0x3425('0x2c')]!==_0x3425('0x3d')){var _0x526c3b={};_0x526c3b[_0x48f5dc[_0x3425('0x26')]]={'$like':'%'+_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3b')]+'%'};return _0x526c3b;}})});}_0x3ca2b7=_[_0x3425('0x3c')]({},_0x3ca2b7,_0x1ae04f['options']);var _0x23733e={'where':_0x3ca2b7[_0x3425('0x39')]};return db[_0x3425('0x29')]['count'](_0x23733e)['then'](function(_0x40a959){_0x1452b6[_0x3425('0x1c')]=_0x40a959;if(_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3e')]){_0x3ca2b7['include']=[{'all':!![]}];}return db[_0x3425('0x29')][_0x3425('0x3f')](_0x3ca2b7);})[_0x3425('0x22')](function(_0x175084){_0x1452b6[_0x3425('0x40')]=_0x175084;return _0x1452b6;})[_0x3425('0x22')](respondWithFilteredResult(_0x453914,_0x3ca2b7))['catch'](handleError(_0x453914,null));};exports[_0x3425('0x41')]=function(_0xfa49c0,_0x56348d){var _0x4a5fb1={'raw':!![],'where':{'id':_0xfa49c0['params']['id']}},_0x1b8633={};_0x1b8633[_0x3425('0x2e')]=_[_0x3425('0x30')](db[_0x3425('0x29')][_0x3425('0x2a')]);_0x1b8633[_0x3425('0x2f')]=_[_0x3425('0x30')](_0xfa49c0[_0x3425('0x2f')]);_0x1b8633['filters']=_['intersection'](_0x1b8633[_0x3425('0x2e')],_0x1b8633[_0x3425('0x2f')]);_0x4a5fb1[_0x3425('0x33')]=_[_0x3425('0x32')](_0x1b8633[_0x3425('0x2e')],qs[_0x3425('0x34')](_0xfa49c0['query'][_0x3425('0x34')]));_0x4a5fb1[_0x3425('0x33')]=_0x4a5fb1[_0x3425('0x33')][_0x3425('0x35')]?_0x4a5fb1[_0x3425('0x33')]:_0x1b8633[_0x3425('0x2e')];if(_0xfa49c0['query'][_0x3425('0x3e')]){_0x4a5fb1[_0x3425('0x42')]=[{'all':!![]}];}_0x4a5fb1=_['merge']({},_0x4a5fb1,_0xfa49c0[_0x3425('0x43')]);return db['ChatQueueReport']['find'](_0x4a5fb1)[_0x3425('0x22')](handleEntityNotFound(_0x56348d,null))[_0x3425('0x22')](respondWithResult(_0x56348d,null))[_0x3425('0x44')](handleError(_0x56348d,null));};exports['create']=function(_0x11715f,_0x4cb1f5){return db[_0x3425('0x29')][_0x3425('0x45')](_0x11715f['body'],{})[_0x3425('0x22')](respondWithResult(_0x4cb1f5,0xc9))[_0x3425('0x44')](handleError(_0x4cb1f5,null));};exports[_0x3425('0x21')]=function(_0x17626f,_0x357312){if(_0x17626f[_0x3425('0x46')]['id']){delete _0x17626f[_0x3425('0x46')]['id'];}return db[_0x3425('0x29')][_0x3425('0x47')]({'where':{'id':_0x17626f[_0x3425('0x48')]['id']}})[_0x3425('0x22')](handleEntityNotFound(_0x357312,null))['then'](saveUpdates(_0x17626f[_0x3425('0x46')],null))[_0x3425('0x22')](respondWithResult(_0x357312,null))['catch'](handleError(_0x357312,null));};exports[_0x3425('0x23')]=function(_0x397727,_0x4b2a9a){return db['ChatQueueReport'][_0x3425('0x47')]({'where':{'id':_0x397727[_0x3425('0x48')]['id']}})[_0x3425('0x22')](handleEntityNotFound(_0x4b2a9a,null))['then'](removeEntity(_0x4b2a9a,null))[_0x3425('0x44')](handleError(_0x4b2a9a,null));};exports[_0x3425('0x49')]=function(_0x3d4dff,_0x5eab7a){return db['ChatQueueReport'][_0x3425('0x49')]()[_0x3425('0x22')](respondWithResult(_0x5eab7a,null))[_0x3425('0x44')](handleError(_0x5eab7a,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3ea9348..0bba155 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(_0x1a4165,_0x116f6c){var _0x54e31f=function(_0x31fe06){while(--_0x31fe06){_0x1a4165['push'](_0x1a4165['shift']());}};_0x54e31f(++_0x116f6c);}(_0x757a,0xde));var _0xa757=function(_0x23dd5b,_0x246bd0){_0x23dd5b=_0x23dd5b-0x0;var _0x35fcb4=_0x757a[_0x23dd5b];return _0x35fcb4;};'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(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0xb10b,0x12a));var _0xbb10=function(_0x294cf1,_0x5d6a40){_0x294cf1=_0x294cf1-0x0;var _0x334402=_0xb10b[_0x294cf1];return _0x334402;};'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 2b879e1..efa523d 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 _0xad03=['options','raw','debug','UpdateChatQueueReport','body','where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x250053,_0x36dad1){var _0x40851a=function(_0x3da7a4){while(--_0x3da7a4){_0x250053['push'](_0x250053['shift']());}};_0x40851a(++_0x36dad1);}(_0xad03,0x1e3));var _0x3ad0=function(_0x2ca718,_0x5239ed){_0x2ca718=_0x2ca718-0x0;var _0x4e2242=_0xad03[_0x2ca718];return _0x4e2242;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ad0('0x0'));var BPromise=require(_0x3ad0('0x1'));var rs=require(_0x3ad0('0x2'));var fs=require('fs');var Redis=require(_0x3ad0('0x3'));var db=require(_0x3ad0('0x4'))['db'];var utils=require(_0x3ad0('0x5'));var logger=require(_0x3ad0('0x6'))(_0x3ad0('0x7'));var config=require('../../config/environment');var jayson=require(_0x3ad0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc92e,_0x5a7401,_0xfe9877){return new BPromise(function(_0x1da13b,_0x1139ac){return client['request'](_0x5cc92e,_0xfe9877)[_0x3ad0('0x9')](function(_0x353473){logger[_0x3ad0('0xa')](_0x3ad0('0xb'),_0x5a7401,_0x3ad0('0xc'));logger['debug'](_0x3ad0('0xd'),_0x5a7401,_0x3ad0('0xc'),JSON[_0x3ad0('0xe')](_0x353473));if(_0x353473['error']){if(_0x353473[_0x3ad0('0xf')]['code']===0x1f4){logger['error'](_0x3ad0('0xb'),_0x5a7401,_0x353473[_0x3ad0('0xf')]['message']);return _0x1139ac(_0x353473[_0x3ad0('0xf')][_0x3ad0('0x10')]);}logger[_0x3ad0('0xf')](_0x3ad0('0xb'),_0x5a7401,_0x353473[_0x3ad0('0xf')][_0x3ad0('0x10')]);return _0x1da13b(_0x353473[_0x3ad0('0xf')][_0x3ad0('0x10')]);}else{logger['info'](_0x3ad0('0xb'),_0x5a7401,_0x3ad0('0xc'));_0x1da13b(_0x353473[_0x3ad0('0x11')]['message']);}})[_0x3ad0('0x12')](function(_0x461fa6){logger[_0x3ad0('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5a7401,_0x461fa6);_0x1139ac(_0x461fa6);});});}exports[_0x3ad0('0x13')]=function(_0x31b56a){var _0x2f1a59=this;return new Promise(function(_0x1e0569,_0x2750a3){return db[_0x3ad0('0x14')]['create'](_0x31b56a['body'],{'raw':_0x31b56a[_0x3ad0('0x15')]?_0x31b56a[_0x3ad0('0x15')][_0x3ad0('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1062b7){logger[_0x3ad0('0xa')](_0x3ad0('0x13'),_0x31b56a);logger[_0x3ad0('0x17')](_0x3ad0('0x13'),_0x31b56a,JSON[_0x3ad0('0xe')](_0x1062b7));_0x1e0569(_0x1062b7);})[_0x3ad0('0x12')](function(_0x1abe28){logger[_0x3ad0('0xf')](_0x3ad0('0x13'),_0x1abe28[_0x3ad0('0x10')],_0x31b56a);_0x2750a3(_0x2f1a59[_0x3ad0('0xf')](0x1f4,_0x1abe28[_0x3ad0('0x10')]));});});};exports[_0x3ad0('0x18')]=function(_0x2f5fc1){var _0x5672f1=this;return new Promise(function(_0xe72ec6,_0x9b865a){return db[_0x3ad0('0x14')]['update'](_0x2f5fc1[_0x3ad0('0x19')],{'raw':_0x2f5fc1[_0x3ad0('0x15')]?_0x2f5fc1[_0x3ad0('0x15')][_0x3ad0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f5fc1['options']?_0x2f5fc1[_0x3ad0('0x15')][_0x3ad0('0x1a')]||null:null,'attributes':_0x2f5fc1['options']?_0x2f5fc1[_0x3ad0('0x15')]['attributes']||null:null,'limit':_0x2f5fc1['options']?_0x2f5fc1['options'][_0x3ad0('0x1b')]||null:null})['then'](function(_0x55a006){logger['info'](_0x3ad0('0x18'),_0x2f5fc1);logger[_0x3ad0('0x17')](_0x3ad0('0x18'),_0x2f5fc1,JSON['stringify'](_0x55a006));_0xe72ec6(_0x55a006);})['catch'](function(_0x19299b){logger[_0x3ad0('0xf')](_0x3ad0('0x18'),_0x19299b[_0x3ad0('0x10')],_0x2f5fc1);_0x9b865a(_0x5672f1[_0x3ad0('0xf')](0x1f4,_0x19299b[_0x3ad0('0x10')]));});});}; \ No newline at end of file +var _0xff47=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','create','options','raw','UpdateChatQueueReport','ChatQueueReport','update','body','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x52f498,_0xeec0c3){var _0x2a97cb=function(_0x43ad5d){while(--_0x43ad5d){_0x52f498['push'](_0x52f498['shift']());}};_0x2a97cb(++_0xeec0c3);}(_0xff47,0x15c));var _0x7ff4=function(_0x2335ae,_0x1c53d5){_0x2335ae=_0x2335ae-0x0;var _0x34d016=_0xff47[_0x2335ae];return _0x34d016;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ff4('0x0'));var BPromise=require(_0x7ff4('0x1'));var rs=require(_0x7ff4('0x2'));var fs=require('fs');var Redis=require(_0x7ff4('0x3'));var db=require(_0x7ff4('0x4'))['db'];var utils=require(_0x7ff4('0x5'));var logger=require(_0x7ff4('0x6'))('rpc');var config=require(_0x7ff4('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50b498,_0x4c7814,_0x7771a8){return new BPromise(function(_0x87f712,_0xcebb83){return client[_0x7ff4('0x8')](_0x50b498,_0x7771a8)[_0x7ff4('0x9')](function(_0x30ae46){logger[_0x7ff4('0xa')](_0x7ff4('0xb'),_0x4c7814,_0x7ff4('0xc'));logger[_0x7ff4('0xd')](_0x7ff4('0xe'),_0x4c7814,_0x7ff4('0xc'),JSON[_0x7ff4('0xf')](_0x30ae46));if(_0x30ae46[_0x7ff4('0x10')]){if(_0x30ae46[_0x7ff4('0x10')]['code']===0x1f4){logger[_0x7ff4('0x10')](_0x7ff4('0xb'),_0x4c7814,_0x30ae46[_0x7ff4('0x10')][_0x7ff4('0x11')]);return _0xcebb83(_0x30ae46[_0x7ff4('0x10')][_0x7ff4('0x11')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4c7814,_0x30ae46[_0x7ff4('0x10')][_0x7ff4('0x11')]);return _0x87f712(_0x30ae46[_0x7ff4('0x10')][_0x7ff4('0x11')]);}else{logger[_0x7ff4('0xa')](_0x7ff4('0xb'),_0x4c7814,_0x7ff4('0xc'));_0x87f712(_0x30ae46[_0x7ff4('0x12')][_0x7ff4('0x11')]);}})[_0x7ff4('0x13')](function(_0x41b58d){logger['error'](_0x7ff4('0xb'),_0x4c7814,_0x41b58d);_0xcebb83(_0x41b58d);});});}exports[_0x7ff4('0x14')]=function(_0x4e025f){var _0x48e33b=this;return new Promise(function(_0x14bb52,_0x3f7588){return db['ChatQueueReport'][_0x7ff4('0x15')](_0x4e025f['body'],{'raw':_0x4e025f[_0x7ff4('0x16')]?_0x4e025f[_0x7ff4('0x16')][_0x7ff4('0x17')]===undefined?!![]:![]:!![]})[_0x7ff4('0x9')](function(_0x4ad58f){logger[_0x7ff4('0xa')](_0x7ff4('0x14'),_0x4e025f);logger[_0x7ff4('0xd')](_0x7ff4('0x14'),_0x4e025f,JSON[_0x7ff4('0xf')](_0x4ad58f));_0x14bb52(_0x4ad58f);})['catch'](function(_0x224ab7){logger[_0x7ff4('0x10')](_0x7ff4('0x14'),_0x224ab7['message'],_0x4e025f);_0x3f7588(_0x48e33b['error'](0x1f4,_0x224ab7[_0x7ff4('0x11')]));});});};exports[_0x7ff4('0x18')]=function(_0x52cc10){var _0x4df6c2=this;return new Promise(function(_0x35ed0c,_0x465829){return db[_0x7ff4('0x19')][_0x7ff4('0x1a')](_0x52cc10[_0x7ff4('0x1b')],{'raw':_0x52cc10[_0x7ff4('0x16')]?_0x52cc10[_0x7ff4('0x16')][_0x7ff4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52cc10[_0x7ff4('0x16')]?_0x52cc10[_0x7ff4('0x16')]['where']||null:null,'attributes':_0x52cc10[_0x7ff4('0x16')]?_0x52cc10[_0x7ff4('0x16')][_0x7ff4('0x1c')]||null:null,'limit':_0x52cc10[_0x7ff4('0x16')]?_0x52cc10['options'][_0x7ff4('0x1d')]||null:null})[_0x7ff4('0x9')](function(_0x497d0e){logger[_0x7ff4('0xa')](_0x7ff4('0x18'),_0x52cc10);logger['debug'](_0x7ff4('0x18'),_0x52cc10,JSON['stringify'](_0x497d0e));_0x35ed0c(_0x497d0e);})[_0x7ff4('0x13')](function(_0x3f9839){logger['error']('UpdateChatQueueReport',_0x3f9839[_0x7ff4('0x11')],_0x52cc10);_0x465829(_0x4df6c2[_0x7ff4('0x10')](0x1f4,_0x3f9839[_0x7ff4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 7bab161..6f3f5aa 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 _0x78dd=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','show','post','update','/:id','destroy','util','path','connect-timeout'];(function(_0x1b52e0,_0x1f0a88){var _0x581d36=function(_0x588aca){while(--_0x588aca){_0x1b52e0['push'](_0x1b52e0['shift']());}};_0x581d36(++_0x1f0a88);}(_0x78dd,0x1dd));var _0xd78d=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x78dd[_0x548627];return _0x844a84;};'use strict';var multer=require('multer');var util=require(_0xd78d('0x0'));var path=require(_0xd78d('0x1'));var timeout=require(_0xd78d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd78d('0x3'));var auth=require(_0xd78d('0x4'));var interaction=require(_0xd78d('0x5'));var config=require('../../config/environment');var controller=require(_0xd78d('0x6'));router['get']('/',auth[_0xd78d('0x7')](),controller[_0xd78d('0x8')]);router[_0xd78d('0x9')](_0xd78d('0xa'),auth[_0xd78d('0x7')](),controller['describe']);router[_0xd78d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd78d('0xb')]);router[_0xd78d('0xc')]('/',auth[_0xd78d('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd78d('0xd')]);router['delete'](_0xd78d('0xe'),auth[_0xd78d('0x7')](),controller[_0xd78d('0xf')]);module['exports']=router; \ No newline at end of file +var _0xaa50=['/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xaa50,0x142));var _0x0aa5=function(_0x9b163,_0x5d8c8f){_0x9b163=_0x9b163-0x0;var _0x824910=_0xaa50[_0x9b163];return _0x824910;};'use strict';var multer=require('multer');var util=require(_0x0aa5('0x0'));var path=require('path');var timeout=require(_0x0aa5('0x1'));var express=require(_0x0aa5('0x2'));var router=express[_0x0aa5('0x3')]();var fs_extra=require(_0x0aa5('0x4'));var auth=require(_0x0aa5('0x5'));var interaction=require(_0x0aa5('0x6'));var config=require(_0x0aa5('0x7'));var controller=require(_0x0aa5('0x8'));router[_0x0aa5('0x9')]('/',auth[_0x0aa5('0xa')](),controller[_0x0aa5('0xb')]);router['get'](_0x0aa5('0xc'),auth[_0x0aa5('0xa')](),controller[_0x0aa5('0xd')]);router[_0x0aa5('0x9')](_0x0aa5('0xe'),auth[_0x0aa5('0xa')](),controller[_0x0aa5('0xf')]);router[_0x0aa5('0x10')]('/',auth[_0x0aa5('0xa')](),controller[_0x0aa5('0x11')]);router[_0x0aa5('0x12')](_0x0aa5('0xe'),auth[_0x0aa5('0xa')](),controller['update']);router['delete'](_0x0aa5('0xe'),auth[_0x0aa5('0xa')](),controller[_0x0aa5('0x13')]);module[_0x0aa5('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6205e0d..cf7ae42 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2bb825,_0x1da979){var _0x52e9f0=function(_0x2d51e2){while(--_0x2d51e2){_0x2bb825['push'](_0x2bb825['shift']());}};_0x52e9f0(++_0x1da979);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x34e8,0x12c));var _0x834e=function(_0x2be0c6,_0x53dfd6){_0x2be0c6=_0x2be0c6-0x0;var _0x4262a0=_0x34e8[_0x2be0c6];return _0x4262a0;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1cc9776..ac7a0a2 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 _0x034e=['include','findAll','rows','catch','find','create','body','params','describe','eml-format','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','json','apply','reject','update','destroy','then','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x526b9f,_0x5c2efb){var _0xe8dd51=function(_0x2f0e1f){while(--_0x2f0e1f){_0x526b9f['push'](_0x526b9f['shift']());}};_0xe8dd51(++_0x5c2efb);}(_0x034e,0x16c));var _0xe034=function(_0x3277dc,_0x1a8604){_0x3277dc=_0x3277dc-0x0;var _0x68c39=_0x034e[_0x3277dc];return _0x68c39;};'use strict';var emlformat=require(_0xe034('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe034('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe034('0x2'));var util=require(_0xe034('0x3'));var path=require(_0xe034('0x4'));var sox=require(_0xe034('0x5'));var csv=require('to-csv');var ejs=require(_0xe034('0x6'));var fs=require('fs');var fs_extra=require(_0xe034('0x7'));var _=require(_0xe034('0x8'));var squel=require(_0xe034('0x9'));var crypto=require(_0xe034('0xa'));var jsforce=require(_0xe034('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe034('0xc'));var querystring=require(_0xe034('0xd'));var Papa=require('papaparse');var Redis=require(_0xe034('0xe'));var authService=require(_0xe034('0xf'));var qs=require(_0xe034('0x10'));var as=require(_0xe034('0x11'));var hardwareService=require(_0xe034('0x12'));var logger=require(_0xe034('0x13'))(_0xe034('0x14'));var utils=require('../../config/utils');var config=require(_0xe034('0x15'));var licenseUtil=require(_0xe034('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x411bc9,_0x428d27){_0x428d27=_0x428d27||0xcc;return function(_0x347d1f){if(_0x347d1f){return _0x411bc9[_0xe034('0x17')](_0x428d27);}return _0x411bc9[_0xe034('0x18')](_0x428d27)[_0xe034('0x19')]();};}function respondWithResult(_0x5d0f07,_0x3ac78a){_0x3ac78a=_0x3ac78a||0xc8;return function(_0x5a60e){if(_0x5a60e){return _0x5d0f07[_0xe034('0x18')](_0x3ac78a)['json'](_0x5a60e);}};}function respondWithFilteredResult(_0x33c3a1,_0x3a85d5){return function(_0x359132){if(_0x359132){var _0x1b728a=typeof _0x3a85d5['offset']==='undefined'&&typeof _0x3a85d5[_0xe034('0x1a')]===_0xe034('0x1b');var _0x1cb7da=_0x359132[_0xe034('0x1c')];var _0x14f8f5=_0x1b728a?0x0:_0x3a85d5['offset'];var _0x3b0ee7=_0x1b728a?_0x359132[_0xe034('0x1c')]:_0x3a85d5[_0xe034('0x1d')]+_0x3a85d5['limit'];var _0x2481f9;if(_0x3b0ee7>=_0x1cb7da){_0x3b0ee7=_0x1cb7da;_0x2481f9=0xc8;}else{_0x2481f9=0xce;}_0x33c3a1[_0xe034('0x18')](_0x2481f9);return _0x33c3a1['set']('Content-Range',_0x14f8f5+'-'+_0x3b0ee7+'/'+_0x1cb7da)[_0xe034('0x1e')](_0x359132);}return null;};}function patchUpdates(_0x2e53e6){return function(_0x5a3e88){try{jsonpatch[_0xe034('0x1f')](_0x5a3e88,_0x2e53e6,!![]);}catch(_0xf2d3d4){return BPromise[_0xe034('0x20')](_0xf2d3d4);}return _0x5a3e88['save']();};}function saveUpdates(_0x23df40,_0x497580){return function(_0x59baef){if(_0x59baef){return _0x59baef[_0xe034('0x21')](_0x23df40)['then'](function(_0x3cfe4e){return _0x3cfe4e;});}return null;};}function removeEntity(_0x500098,_0x5d16b6){return function(_0x1a1102){if(_0x1a1102){return _0x1a1102[_0xe034('0x22')]()[_0xe034('0x23')](function(){_0x500098[_0xe034('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3356e,_0x14689a){return function(_0x3b86af){if(!_0x3b86af){_0x3356e[_0xe034('0x17')](0x194);}return _0x3b86af;};}function handleError(_0x453627,_0x3cd0cb){_0x3cd0cb=_0x3cd0cb||0x1f4;return function(_0x2814ad){logger[_0xe034('0x24')](_0x2814ad['stack']);if(_0x2814ad[_0xe034('0x25')]){delete _0x2814ad[_0xe034('0x25')];}_0x453627[_0xe034('0x18')](_0x3cd0cb)[_0xe034('0x26')](_0x2814ad);};}exports[_0xe034('0x27')]=function(_0x45288e,_0x41f136){var _0x60c2ed={},_0x6b6026={},_0x503f0f={'count':0x0,'rows':[]};var _0xd0d01f=_[_0xe034('0x28')](db[_0xe034('0x29')][_0xe034('0x2a')],function(_0x4ab0a3){return{'name':_0x4ab0a3[_0xe034('0x2b')],'type':_0x4ab0a3[_0xe034('0x2c')][_0xe034('0x2d')]};});_0x6b6026[_0xe034('0x2e')]=_[_0xe034('0x28')](_0xd0d01f,_0xe034('0x25'));_0x6b6026['query']=_[_0xe034('0x2f')](_0x45288e[_0xe034('0x30')]);_0x6b6026['filters']=_[_0xe034('0x31')](_0x6b6026[_0xe034('0x2e')],_0x6b6026['query']);_0x60c2ed[_0xe034('0x32')]=_[_0xe034('0x31')](_0x6b6026['model'],qs[_0xe034('0x33')](_0x45288e['query'][_0xe034('0x33')]));_0x60c2ed[_0xe034('0x32')]=_0x60c2ed['attributes'][_0xe034('0x34')]?_0x60c2ed[_0xe034('0x32')]:_0x6b6026[_0xe034('0x2e')];if(!_0x45288e[_0xe034('0x30')]['hasOwnProperty']('nolimit')){_0x60c2ed[_0xe034('0x1a')]=qs[_0xe034('0x1a')](_0x45288e[_0xe034('0x30')]['limit']);_0x60c2ed[_0xe034('0x1d')]=qs[_0xe034('0x1d')](_0x45288e[_0xe034('0x30')][_0xe034('0x1d')]);}_0x60c2ed['order']=qs[_0xe034('0x35')](_0x45288e[_0xe034('0x30')][_0xe034('0x35')]);_0x60c2ed['where']=qs[_0xe034('0x36')](_[_0xe034('0x37')](_0x45288e[_0xe034('0x30')],_0x6b6026[_0xe034('0x36')]),_0xd0d01f);if(_0x45288e['query'][_0xe034('0x38')]){_0x60c2ed[_0xe034('0x39')]=_[_0xe034('0x3a')](_0x60c2ed[_0xe034('0x39')],{'$or':_[_0xe034('0x28')](_0xd0d01f,function(_0x7abefb){if(_0x7abefb[_0xe034('0x2c')]!==_0xe034('0x3b')){var _0x1e5d60={};_0x1e5d60[_0x7abefb[_0xe034('0x25')]]={'$like':'%'+_0x45288e[_0xe034('0x30')]['filter']+'%'};return _0x1e5d60;}})});}_0x60c2ed=_['merge']({},_0x60c2ed,_0x45288e[_0xe034('0x3c')]);var _0x507ce6={'where':_0x60c2ed[_0xe034('0x39')]};return db['ChatTransferReport'][_0xe034('0x1c')](_0x507ce6)[_0xe034('0x23')](function(_0x255c5c){_0x503f0f['count']=_0x255c5c;if(_0x45288e[_0xe034('0x30')][_0xe034('0x3d')]){_0x60c2ed[_0xe034('0x3e')]=[{'all':!![]}];}return db[_0xe034('0x29')][_0xe034('0x3f')](_0x60c2ed);})[_0xe034('0x23')](function(_0x2ad97b){_0x503f0f[_0xe034('0x40')]=_0x2ad97b;return _0x503f0f;})[_0xe034('0x23')](respondWithFilteredResult(_0x41f136,_0x60c2ed))[_0xe034('0x41')](handleError(_0x41f136,null));};exports['show']=function(_0xd7f0c0,_0x46ffb7){var _0x378026={'raw':!![],'where':{'id':_0xd7f0c0['params']['id']}},_0x1f3d78={};_0x1f3d78['model']=_[_0xe034('0x2f')](db['ChatTransferReport']['rawAttributes']);_0x1f3d78[_0xe034('0x30')]=_[_0xe034('0x2f')](_0xd7f0c0[_0xe034('0x30')]);_0x1f3d78[_0xe034('0x36')]=_['intersection'](_0x1f3d78[_0xe034('0x2e')],_0x1f3d78[_0xe034('0x30')]);_0x378026[_0xe034('0x32')]=_[_0xe034('0x31')](_0x1f3d78[_0xe034('0x2e')],qs[_0xe034('0x33')](_0xd7f0c0[_0xe034('0x30')][_0xe034('0x33')]));_0x378026['attributes']=_0x378026[_0xe034('0x32')]['length']?_0x378026[_0xe034('0x32')]:_0x1f3d78['model'];if(_0xd7f0c0[_0xe034('0x30')][_0xe034('0x3d')]){_0x378026[_0xe034('0x3e')]=[{'all':!![]}];}_0x378026=_[_0xe034('0x3a')]({},_0x378026,_0xd7f0c0['options']);return db[_0xe034('0x29')][_0xe034('0x42')](_0x378026)[_0xe034('0x23')](handleEntityNotFound(_0x46ffb7,null))[_0xe034('0x23')](respondWithResult(_0x46ffb7,null))[_0xe034('0x41')](handleError(_0x46ffb7,null));};exports[_0xe034('0x43')]=function(_0x33d162,_0x19b6a3){return db[_0xe034('0x29')]['create'](_0x33d162['body'],{})[_0xe034('0x23')](respondWithResult(_0x19b6a3,0xc9))['catch'](handleError(_0x19b6a3,null));};exports[_0xe034('0x21')]=function(_0x318ec0,_0x55c770){if(_0x318ec0[_0xe034('0x44')]['id']){delete _0x318ec0[_0xe034('0x44')]['id'];}return db['ChatTransferReport'][_0xe034('0x42')]({'where':{'id':_0x318ec0[_0xe034('0x45')]['id']}})[_0xe034('0x23')](handleEntityNotFound(_0x55c770,null))['then'](saveUpdates(_0x318ec0[_0xe034('0x44')],null))[_0xe034('0x23')](respondWithResult(_0x55c770,null))[_0xe034('0x41')](handleError(_0x55c770,null));};exports[_0xe034('0x22')]=function(_0x28f4ae,_0xe3105e){return db[_0xe034('0x29')][_0xe034('0x42')]({'where':{'id':_0x28f4ae[_0xe034('0x45')]['id']}})['then'](handleEntityNotFound(_0xe3105e,null))[_0xe034('0x23')](removeEntity(_0xe3105e,null))[_0xe034('0x41')](handleError(_0xe3105e,null));};exports[_0xe034('0x46')]=function(_0x519bb7,_0xea1d54){return db['ChatTransferReport'][_0xe034('0x46')]()['then'](respondWithResult(_0xea1d54,null))[_0xe034('0x41')](handleError(_0xea1d54,null));}; \ No newline at end of file +var _0xab51=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','model','fields','attributes','length','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','ChatTransferReport','intersection','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x476774,_0x30d446){var _0x3d5d6a=function(_0x49f59d){while(--_0x49f59d){_0x476774['push'](_0x476774['shift']());}};_0x3d5d6a(++_0x30d446);}(_0xab51,0x85));var _0x1ab5=function(_0x325375,_0x5d6c12){_0x325375=_0x325375-0x0;var _0x215e5a=_0xab51[_0x325375];return _0x215e5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ab5('0x0'));var zipdir=require(_0x1ab5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ab5('0x2'));var moment=require(_0x1ab5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1ab5('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1ab5('0x5'));var ejs=require(_0x1ab5('0x6'));var fs=require('fs');var fs_extra=require(_0x1ab5('0x7'));var _=require(_0x1ab5('0x8'));var squel=require(_0x1ab5('0x9'));var crypto=require(_0x1ab5('0xa'));var jsforce=require(_0x1ab5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1ab5('0x5'));var querystring=require('querystring');var Papa=require(_0x1ab5('0xc'));var Redis=require(_0x1ab5('0xd'));var authService=require(_0x1ab5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1ab5('0xf'));var hardwareService=require(_0x1ab5('0x10'));var logger=require(_0x1ab5('0x11'))(_0x1ab5('0x12'));var utils=require(_0x1ab5('0x13'));var config=require(_0x1ab5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ab5('0x15'))['db'];function respondWithStatusCode(_0x3ad626,_0x5174a3){_0x5174a3=_0x5174a3||0xcc;return function(_0x533712){if(_0x533712){return _0x3ad626[_0x1ab5('0x16')](_0x5174a3);}return _0x3ad626['status'](_0x5174a3)[_0x1ab5('0x17')]();};}function respondWithResult(_0x119a87,_0x5da070){_0x5da070=_0x5da070||0xc8;return function(_0x4fbedf){if(_0x4fbedf){return _0x119a87[_0x1ab5('0x18')](_0x5da070)['json'](_0x4fbedf);}};}function respondWithFilteredResult(_0x4ffde8,_0x27f119){return function(_0x237969){if(_0x237969){var _0x7be81=typeof _0x27f119[_0x1ab5('0x19')]===_0x1ab5('0x1a')&&typeof _0x27f119[_0x1ab5('0x1b')]===_0x1ab5('0x1a');var _0x2149e3=_0x237969[_0x1ab5('0x1c')];var _0xc0e98a=_0x7be81?0x0:_0x27f119['offset'];var _0x25c864=_0x7be81?_0x237969[_0x1ab5('0x1c')]:_0x27f119[_0x1ab5('0x19')]+_0x27f119[_0x1ab5('0x1b')];var _0x5c4432;if(_0x25c864>=_0x2149e3){_0x25c864=_0x2149e3;_0x5c4432=0xc8;}else{_0x5c4432=0xce;}_0x4ffde8[_0x1ab5('0x18')](_0x5c4432);return _0x4ffde8[_0x1ab5('0x1d')](_0x1ab5('0x1e'),_0xc0e98a+'-'+_0x25c864+'/'+_0x2149e3)[_0x1ab5('0x1f')](_0x237969);}return null;};}function patchUpdates(_0x44855){return function(_0x3d5668){try{jsonpatch[_0x1ab5('0x20')](_0x3d5668,_0x44855,!![]);}catch(_0x18ac7f){return BPromise['reject'](_0x18ac7f);}return _0x3d5668[_0x1ab5('0x21')]();};}function saveUpdates(_0x1c89fc,_0x2f1a7b){return function(_0x6c11c4){if(_0x6c11c4){return _0x6c11c4['update'](_0x1c89fc)[_0x1ab5('0x22')](function(_0x2a1a61){return _0x2a1a61;});}return null;};}function removeEntity(_0x1f2ca1,_0x2e9b17){return function(_0xb3dae6){if(_0xb3dae6){return _0xb3dae6[_0x1ab5('0x23')]()[_0x1ab5('0x22')](function(){_0x1f2ca1[_0x1ab5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4422,_0x69b67d){return function(_0x70d1ec){if(!_0x70d1ec){_0x3a4422[_0x1ab5('0x16')](0x194);}return _0x70d1ec;};}function handleError(_0x433c2c,_0x2f66e0){_0x2f66e0=_0x2f66e0||0x1f4;return function(_0x3fc4f6){logger[_0x1ab5('0x24')](_0x3fc4f6[_0x1ab5('0x25')]);if(_0x3fc4f6[_0x1ab5('0x26')]){delete _0x3fc4f6[_0x1ab5('0x26')];}_0x433c2c[_0x1ab5('0x18')](_0x2f66e0)[_0x1ab5('0x27')](_0x3fc4f6);};}exports[_0x1ab5('0x28')]=function(_0x3ec162,_0x31e067){var _0x596fe2={},_0x47af4a={},_0x4758b0={'count':0x0,'rows':[]};var _0x18319e=_[_0x1ab5('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x42a855){return{'name':_0x42a855[_0x1ab5('0x2a')],'type':_0x42a855[_0x1ab5('0x2b')][_0x1ab5('0x2c')]};});_0x47af4a['model']=_[_0x1ab5('0x29')](_0x18319e,'name');_0x47af4a[_0x1ab5('0x2d')]=_[_0x1ab5('0x2e')](_0x3ec162['query']);_0x47af4a['filters']=_['intersection'](_0x47af4a[_0x1ab5('0x2f')],_0x47af4a[_0x1ab5('0x2d')]);_0x596fe2['attributes']=_['intersection'](_0x47af4a[_0x1ab5('0x2f')],qs[_0x1ab5('0x30')](_0x3ec162[_0x1ab5('0x2d')][_0x1ab5('0x30')]));_0x596fe2[_0x1ab5('0x31')]=_0x596fe2[_0x1ab5('0x31')][_0x1ab5('0x32')]?_0x596fe2[_0x1ab5('0x31')]:_0x47af4a[_0x1ab5('0x2f')];if(!_0x3ec162[_0x1ab5('0x2d')]['hasOwnProperty'](_0x1ab5('0x33'))){_0x596fe2[_0x1ab5('0x1b')]=qs[_0x1ab5('0x1b')](_0x3ec162['query'][_0x1ab5('0x1b')]);_0x596fe2['offset']=qs[_0x1ab5('0x19')](_0x3ec162['query'][_0x1ab5('0x19')]);}_0x596fe2['order']=qs[_0x1ab5('0x34')](_0x3ec162[_0x1ab5('0x2d')][_0x1ab5('0x34')]);_0x596fe2['where']=qs[_0x1ab5('0x35')](_[_0x1ab5('0x36')](_0x3ec162[_0x1ab5('0x2d')],_0x47af4a[_0x1ab5('0x35')]),_0x18319e);if(_0x3ec162[_0x1ab5('0x2d')][_0x1ab5('0x37')]){_0x596fe2[_0x1ab5('0x38')]=_[_0x1ab5('0x39')](_0x596fe2[_0x1ab5('0x38')],{'$or':_[_0x1ab5('0x29')](_0x18319e,function(_0x128f00){if(_0x128f00[_0x1ab5('0x2b')]!==_0x1ab5('0x3a')){var _0x9d907e={};_0x9d907e[_0x128f00['name']]={'$like':'%'+_0x3ec162[_0x1ab5('0x2d')]['filter']+'%'};return _0x9d907e;}})});}_0x596fe2=_[_0x1ab5('0x39')]({},_0x596fe2,_0x3ec162[_0x1ab5('0x3b')]);var _0x20af3c={'where':_0x596fe2[_0x1ab5('0x38')]};return db['ChatTransferReport'][_0x1ab5('0x1c')](_0x20af3c)[_0x1ab5('0x22')](function(_0x152d3b){_0x4758b0[_0x1ab5('0x1c')]=_0x152d3b;if(_0x3ec162[_0x1ab5('0x2d')][_0x1ab5('0x3c')]){_0x596fe2[_0x1ab5('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x1ab5('0x3e')](_0x596fe2);})['then'](function(_0x5d5188){_0x4758b0[_0x1ab5('0x3f')]=_0x5d5188;return _0x4758b0;})['then'](respondWithFilteredResult(_0x31e067,_0x596fe2))['catch'](handleError(_0x31e067,null));};exports['show']=function(_0xef7cb5,_0x5f0490){var _0x414ac6={'raw':!![],'where':{'id':_0xef7cb5[_0x1ab5('0x40')]['id']}},_0x35ea34={};_0x35ea34[_0x1ab5('0x2f')]=_[_0x1ab5('0x2e')](db[_0x1ab5('0x41')]['rawAttributes']);_0x35ea34[_0x1ab5('0x2d')]=_['keys'](_0xef7cb5[_0x1ab5('0x2d')]);_0x35ea34[_0x1ab5('0x35')]=_['intersection'](_0x35ea34[_0x1ab5('0x2f')],_0x35ea34[_0x1ab5('0x2d')]);_0x414ac6[_0x1ab5('0x31')]=_[_0x1ab5('0x42')](_0x35ea34['model'],qs['fields'](_0xef7cb5['query'][_0x1ab5('0x30')]));_0x414ac6['attributes']=_0x414ac6['attributes'][_0x1ab5('0x32')]?_0x414ac6[_0x1ab5('0x31')]:_0x35ea34[_0x1ab5('0x2f')];if(_0xef7cb5['query']['includeAll']){_0x414ac6[_0x1ab5('0x3d')]=[{'all':!![]}];}_0x414ac6=_['merge']({},_0x414ac6,_0xef7cb5['options']);return db['ChatTransferReport'][_0x1ab5('0x43')](_0x414ac6)[_0x1ab5('0x22')](handleEntityNotFound(_0x5f0490,null))[_0x1ab5('0x22')](respondWithResult(_0x5f0490,null))[_0x1ab5('0x44')](handleError(_0x5f0490,null));};exports[_0x1ab5('0x45')]=function(_0xf6fcdc,_0x414b24){return db[_0x1ab5('0x41')]['create'](_0xf6fcdc[_0x1ab5('0x46')],{})[_0x1ab5('0x22')](respondWithResult(_0x414b24,0xc9))[_0x1ab5('0x44')](handleError(_0x414b24,null));};exports['update']=function(_0x258e70,_0x25df81){if(_0x258e70[_0x1ab5('0x46')]['id']){delete _0x258e70[_0x1ab5('0x46')]['id'];}return db[_0x1ab5('0x41')][_0x1ab5('0x43')]({'where':{'id':_0x258e70[_0x1ab5('0x40')]['id']}})[_0x1ab5('0x22')](handleEntityNotFound(_0x25df81,null))[_0x1ab5('0x22')](saveUpdates(_0x258e70['body'],null))[_0x1ab5('0x22')](respondWithResult(_0x25df81,null))[_0x1ab5('0x44')](handleError(_0x25df81,null));};exports['destroy']=function(_0x2a7225,_0xe2c2c4){return db[_0x1ab5('0x41')][_0x1ab5('0x43')]({'where':{'id':_0x2a7225[_0x1ab5('0x40')]['id']}})[_0x1ab5('0x22')](handleEntityNotFound(_0xe2c2c4,null))['then'](removeEntity(_0xe2c2c4,null))['catch'](handleError(_0xe2c2c4,null));};exports['describe']=function(_0x520703,_0x2b43a6){return db['ChatTransferReport'][_0x1ab5('0x47')]()[_0x1ab5('0x22')](respondWithResult(_0x2b43a6,null))['catch'](handleError(_0x2b43a6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 896fc0d..dc60c73 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 _0x12dd=['ChatTransferReport','uniqueid','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x12dd,0x65));var _0xd12d=function(_0x2b92d2,_0x4e8ded){_0x2b92d2=_0x2b92d2-0x0;var _0x133446=_0x12dd[_0x2b92d2];return _0x133446;};'use strict';var _=require(_0xd12d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd12d('0x1'));var moment=require('moment');var BPromise=require(_0xd12d('0x2'));var rp=require(_0xd12d('0x3'));var fs=require('fs');var path=require(_0xd12d('0x4'));var rimraf=require(_0xd12d('0x5'));var config=require(_0xd12d('0x6'));var attributes=require(_0xd12d('0x7'));module['exports']=function(_0x5d1637,_0x2058d5){return _0x5d1637[_0xd12d('0x8')](_0xd12d('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xd12d('0xa'),'fields':[_0xd12d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe8=['report_chat_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport'];(function(_0x5bc3c6,_0x2aad62){var _0xc258a1=function(_0x55fc7e){while(--_0x55fc7e){_0x5bc3c6['push'](_0x5bc3c6['shift']());}};_0xc258a1(++_0x2aad62);}(_0x2fe8,0x6a));var _0x82fe=function(_0x4dfd70,_0x35e8d2){_0x4dfd70=_0x4dfd70-0x0;var _0x48d818=_0x2fe8[_0x4dfd70];return _0x48d818;};'use strict';var _=require('lodash');var util=require(_0x82fe('0x0'));var logger=require(_0x82fe('0x1'))(_0x82fe('0x2'));var moment=require(_0x82fe('0x3'));var BPromise=require('bluebird');var rp=require(_0x82fe('0x4'));var fs=require('fs');var path=require(_0x82fe('0x5'));var rimraf=require(_0x82fe('0x6'));var config=require(_0x82fe('0x7'));var attributes=require(_0x82fe('0x8'));module[_0x82fe('0x9')]=function(_0x15b250,_0x22c48e){return _0x15b250['define'](_0x82fe('0xa'),attributes,{'tableName':_0x82fe('0xb'),'paranoid':![],'indexes':[{'name':_0x82fe('0xc'),'fields':[_0x82fe('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index bdff5a6..05578c3 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 _0x9b72=['error','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x453b90,_0x57cacd){var _0x14f996=function(_0x29f16d){while(--_0x29f16d){_0x453b90['push'](_0x453b90['shift']());}};_0x14f996(++_0x57cacd);}(_0x9b72,0xe8));var _0x29b7=function(_0xfca82a,_0x44cd04){_0xfca82a=_0xfca82a-0x0;var _0x4aa91d=_0x9b72[_0xfca82a];return _0x4aa91d;};'use strict';var _=require(_0x29b7('0x0'));var util=require(_0x29b7('0x1'));var moment=require('moment');var BPromise=require(_0x29b7('0x2'));var rs=require(_0x29b7('0x3'));var fs=require('fs');var Redis=require(_0x29b7('0x4'));var db=require(_0x29b7('0x5'))['db'];var utils=require(_0x29b7('0x6'));var logger=require(_0x29b7('0x7'))('rpc');var config=require(_0x29b7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x282317,_0x48bcc1,_0x3069c0){return new BPromise(function(_0x302d10,_0x2a4c4f){return client['request'](_0x282317,_0x3069c0)[_0x29b7('0xa')](function(_0xa1ca03){logger[_0x29b7('0xb')](_0x29b7('0xc'),_0x48bcc1,'request\x20sent');logger[_0x29b7('0xd')](_0x29b7('0xe'),_0x48bcc1,'request\x20sent',JSON['stringify'](_0xa1ca03));if(_0xa1ca03[_0x29b7('0xf')]){if(_0xa1ca03['error']['code']===0x1f4){logger[_0x29b7('0xf')](_0x29b7('0xc'),_0x48bcc1,_0xa1ca03[_0x29b7('0xf')]['message']);return _0x2a4c4f(_0xa1ca03[_0x29b7('0xf')][_0x29b7('0x10')]);}logger[_0x29b7('0xf')](_0x29b7('0xc'),_0x48bcc1,_0xa1ca03[_0x29b7('0xf')]['message']);return _0x302d10(_0xa1ca03[_0x29b7('0xf')][_0x29b7('0x10')]);}else{logger['info'](_0x29b7('0xc'),_0x48bcc1,_0x29b7('0x11'));_0x302d10(_0xa1ca03[_0x29b7('0x12')][_0x29b7('0x10')]);}})['catch'](function(_0x930a20){logger[_0x29b7('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x48bcc1,_0x930a20);_0x2a4c4f(_0x930a20);});});} \ No newline at end of file +var _0x2ac7=['code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x2a8929,_0x422bc6){var _0x2e11d5=function(_0x263d16){while(--_0x263d16){_0x2a8929['push'](_0x2a8929['shift']());}};_0x2e11d5(++_0x422bc6);}(_0x2ac7,0x75));var _0x72ac=function(_0x370e80,_0x4239ac){_0x370e80=_0x370e80-0x0;var _0x3cdd57=_0x2ac7[_0x370e80];return _0x3cdd57;};'use strict';var _=require(_0x72ac('0x0'));var util=require(_0x72ac('0x1'));var moment=require(_0x72ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x72ac('0x3'));var fs=require('fs');var Redis=require(_0x72ac('0x4'));var db=require(_0x72ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72ac('0x6'));var config=require(_0x72ac('0x7'));var jayson=require(_0x72ac('0x8'));var client=jayson['client'][_0x72ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11657e,_0x3e7e9a,_0x3be995){return new BPromise(function(_0x47abd0,_0x139a6f){return client['request'](_0x11657e,_0x3be995)[_0x72ac('0xa')](function(_0x353bea){logger[_0x72ac('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3e7e9a,_0x72ac('0xc'));logger[_0x72ac('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3e7e9a,_0x72ac('0xc'),JSON[_0x72ac('0xe')](_0x353bea));if(_0x353bea['error']){if(_0x353bea[_0x72ac('0xf')][_0x72ac('0x10')]===0x1f4){logger[_0x72ac('0xf')](_0x72ac('0x11'),_0x3e7e9a,_0x353bea['error']['message']);return _0x139a6f(_0x353bea[_0x72ac('0xf')]['message']);}logger[_0x72ac('0xf')](_0x72ac('0x11'),_0x3e7e9a,_0x353bea[_0x72ac('0xf')]['message']);return _0x47abd0(_0x353bea[_0x72ac('0xf')][_0x72ac('0x12')]);}else{logger[_0x72ac('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3e7e9a,'request\x20sent');_0x47abd0(_0x353bea['result'][_0x72ac('0x12')]);}})['catch'](function(_0x3aee72){logger[_0x72ac('0xf')](_0x72ac('0x11'),_0x3e7e9a,_0x3aee72);_0x139a6f(_0x3aee72);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b34980c..55bbfbf 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 _0xbedb=['describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x26a84c,_0x5724a7){var _0xa7793f=function(_0x34b8e2){while(--_0x34b8e2){_0x26a84c['push'](_0x26a84c['shift']());}};_0xa7793f(++_0x5724a7);}(_0xbedb,0x105));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbbed('0x0'));var util=require(_0xbbed('0x1'));var path=require('path');var timeout=require(_0xbbed('0x2'));var express=require('express');var router=express[_0xbbed('0x3')]();var fs_extra=require(_0xbbed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbbed('0x5'));var config=require(_0xbbed('0x6'));var controller=require(_0xbbed('0x7'));router['get']('/',auth[_0xbbed('0x8')](),controller[_0xbbed('0x9')]);router[_0xbbed('0xa')](_0xbbed('0xb'),auth[_0xbbed('0x8')](),controller[_0xbbed('0xc')]);router[_0xbbed('0xa')](_0xbbed('0xd'),auth[_0xbbed('0x8')](),controller[_0xbbed('0xe')]);router[_0xbbed('0xf')]('/',auth[_0xbbed('0x8')](),controller[_0xbbed('0x10')]);router[_0xbbed('0x11')](_0xbbed('0xd'),auth[_0xbbed('0x8')](),controller[_0xbbed('0x12')]);router[_0xbbed('0x13')](_0xbbed('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbbed('0x14')]=router; \ No newline at end of file +var _0xf894=['describe','/:id','show','post','create','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x4c6c87,_0x271a11){var _0x1a9c5c=function(_0x4a8f62){while(--_0x4a8f62){_0x4c6c87['push'](_0x4c6c87['shift']());}};_0x1a9c5c(++_0x271a11);}(_0xf894,0x183));var _0x4f89=function(_0x2d9c2f,_0x2c8598){_0x2d9c2f=_0x2d9c2f-0x0;var _0x17cf8c=_0xf894[_0x2d9c2f];return _0x17cf8c;};'use strict';var multer=require(_0x4f89('0x0'));var util=require('util');var path=require(_0x4f89('0x1'));var timeout=require(_0x4f89('0x2'));var express=require(_0x4f89('0x3'));var router=express[_0x4f89('0x4')]();var fs_extra=require(_0x4f89('0x5'));var auth=require(_0x4f89('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f89('0x7'));var controller=require(_0x4f89('0x8'));router[_0x4f89('0x9')]('/',auth['isAuthenticated'](),controller[_0x4f89('0xa')]);router['get'](_0x4f89('0xb'),auth[_0x4f89('0xc')](),controller[_0x4f89('0xd')]);router[_0x4f89('0x9')](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller[_0x4f89('0xf')]);router[_0x4f89('0x10')]('/',auth[_0x4f89('0xc')](),controller[_0x4f89('0x11')]);router['put'](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller['update']);router[_0x4f89('0x12')](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller['destroy']);module[_0x4f89('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 2d21397..b5726c6 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 _0x54ef=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x3cef4a,_0x29891c){var _0x348a0d=function(_0x3d64bf){while(--_0x3d64bf){_0x3cef4a['push'](_0x3cef4a['shift']());}};_0x348a0d(++_0x29891c);}(_0x54ef,0x112));var _0xf54e=function(_0x6f6600,_0x2c18d4){_0x6f6600=_0x6f6600-0x0;var _0x325b47=_0x54ef[_0x6f6600];return _0x325b47;};'use strict';var Sequelize=require(_0xf54e('0x0'));var rs=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'unique':_0xf54e('0x4')},'description':{'type':Sequelize[_0xf54e('0x3')]},'mapKey':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x6')},'customerAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf54e('0x3')]},'animation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf54e('0xa'),_0xf54e('0xb')),'defaultValue':_0xf54e('0xa')},'header_online':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0xc')},'header_offline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xd')},'download_transcript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf54e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x12')},'placeholderMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x13')},'closingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x14')},'closingMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'skipMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'conditionAgreement':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x16')},'ratingType':{'type':Sequelize[_0xf54e('0x17')](_0xf54e('0x18'),_0xf54e('0x19')),'defaultValue':_0xf54e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':_0xf54e('0x1b'),'variable':null,'config':{'placeholder':_0xf54e('0x1c'),'type':_0xf54e('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xf54e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf54e('0x5'),'type':_0xf54e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x1f'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')](_0xf54e('0x1f'))):{};},'set':function(_0x43488d){return this[_0xf54e('0x21')](_0xf54e('0x1f'),JSON[_0xf54e('0x1a')](_0x43488d));}},'offlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':'input','props':{'title':_0xf54e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf54e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf54e('0x22')},'props':{'title':_0xf54e('0x22'),'helpText':_0xf54e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x24'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')]('offlineForm')):{};},'set':function(_0x4b3c73){return this[_0xf54e('0x21')](_0xf54e('0x24'),JSON[_0xf54e('0x1a')](_0x4b3c73));}},'token':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return rs[_0xf54e('0x25')]();}},'autoclose':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf54e('0x3')]},'forwardOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x26')},'waitingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x27')},'offlineMessageBody':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return _0xf54e('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2d')},'defaultTitle':{'type':Sequelize[_0xf54e('0x3')]},'customerAvatar':{'type':Sequelize[_0xf54e('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf54e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2f')},'systemAvatar':{'type':Sequelize[_0xf54e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf54e('0x8')],'comment':_0xf54e('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'comment':_0xf54e('0x31'),'set':function(_0x2087b3){if(!_0x2087b3)this[_0xf54e('0x21')](_0xf54e('0x32'),null);this[_0xf54e('0x21')](_0xf54e('0x33'),_0x2087b3);}},'vidaooEscalation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return _0xf54e('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf54e('0xf')]}}; \ No newline at end of file +var _0x4483=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','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','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Send','website_alias','bottom_right','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address'];(function(_0x546891,_0x483cb7){var _0x5a3e45=function(_0xe2bc26){while(--_0xe2bc26){_0x546891['push'](_0x546891['shift']());}};_0x5a3e45(++_0x483cb7);}(_0x4483,0x1a3));var _0x3448=function(_0x5ff2fd,_0xef7e59){_0x5ff2fd=_0x5ff2fd-0x0;var _0x30e855=_0x4483[_0x5ff2fd];return _0x30e855;};'use strict';var Sequelize=require(_0x3448('0x0'));var rs=require(_0x3448('0x1'));module[_0x3448('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'unique':_0x3448('0x4')},'description':{'type':Sequelize[_0x3448('0x3')]},'mapKey':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x5')},'key':{'type':Sequelize[_0x3448('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x6')},'customerAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3448('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3448('0x3')]},'animation':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3448('0xb')](_0x3448('0xc'),_0x3448('0xd')),'defaultValue':_0x3448('0xc')},'header_online':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0xe')},'offline_chat_button':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0xf')},'download_transcript':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3448('0x11')]},'closingQuestion':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x14')},'noteTitle':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x15')},'placeholderMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x16')},'closingMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x17')},'ratingType':{'type':Sequelize[_0x3448('0xb')](_0x3448('0x18'),_0x3448('0x19')),'defaultValue':_0x3448('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3448('0x1a'),'variable':null,'config':{'placeholder':_0x3448('0x1b'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3448('0x1a'),'props':{'title':_0x3448('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3448('0x5'),'type':_0x3448('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3448('0x1c')]('onlineForm')?JSON[_0x3448('0x1d')](this[_0x3448('0x1c')](_0x3448('0x1e'))):{};},'set':function(_0x2088de){return this[_0x3448('0x1f')]('onlineForm',JSON[_0x3448('0x20')](_0x2088de));}},'offlineForm':{'type':Sequelize[_0x3448('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3448('0x1a'),'props':{'title':_0x3448('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3448('0x5'),'type':_0x3448('0x5')},'variable':null},{'type':_0x3448('0x21'),'config':{'placeholder':_0x3448('0x22')},'props':{'title':_0x3448('0x22'),'helpText':_0x3448('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x3448('0x24'))?JSON[_0x3448('0x1d')](this[_0x3448('0x1c')]('offlineForm')):{};},'set':function(_0x1b8dbb){return this['setDataValue']('offlineForm',JSON['stringify'](_0x1b8dbb));}},'token':{'type':Sequelize[_0x3448('0x3')],'defaultValue':function(){return rs[_0x3448('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3448('0x3')]},'forwardOffline':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3448('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x26')},'waitingMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x28')},'offlineMessageBody':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x2b')},'enableCustomerAttachment':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3448('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3448('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3448('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3448('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2d')},'verticalAlignment':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x3448('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3448('0x3')]},'customerAvatar':{'type':Sequelize[_0x3448('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3448('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3448('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3448('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3448('0x3')],'defaultValue':_0x3448('0x2f')},'systemAvatar':{'type':Sequelize[_0x3448('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3448('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![],'comment':_0x3448('0x30'),'set':function(_0x322b46){if(!_0x322b46)this[_0x3448('0x1f')](_0x3448('0x31'),null);this['setDataValue'](_0x3448('0x32'),_0x322b46);}},'vidaooEscalation':{'type':Sequelize[_0x3448('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3448('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3448('0x3')],'allowNull':![],'defaultValue':_0x3448('0x33')},'vidaooNote':{'type':Sequelize[_0x3448('0x3')],'defaultValue':function(){return _0x3448('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x3448('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3448('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c878a7d..8c3a4f3 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 _0x2918=['UserProfileResource','name','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','pick','rows','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','join','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','existsSync','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','CompanyId','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','interaction','spread','firstName','messageId','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','from\x20is\x20mandatory','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','utf8','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','hideWhenOffline','transaction','ISOLATION_LEVELS','ChatApplication','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites'];(function(_0x1a54c2,_0xca7365){var _0x72d724=function(_0x423c3e){while(--_0x423c3e){_0x1a54c2['push'](_0x1a54c2['shift']());}};_0x72d724(++_0xca7365);}(_0x2918,0xf7));var _0x8291=function(_0x1a30ce,_0x4f7b65){_0x1a30ce=_0x1a30ce-0x0;var _0x2b42e8=_0x2918[_0x1a30ce];return _0x2b42e8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x8291('0x0'));var util=require(_0x8291('0x1'));var path=require('path');var ejs=require(_0x8291('0x2'));var fs=require('fs');var fs_extra=require(_0x8291('0x3'));var _=require(_0x8291('0x4'));var querystring=require(_0x8291('0x5'));var Redis=require(_0x8291('0x6'));var qs=require(_0x8291('0x7'));var logger=require(_0x8291('0x8'))('api');var config=require(_0x8291('0x9'));var db=require('../../mysqldb')['db'];config[_0x8291('0xa')]=_[_0x8291('0xb')](config[_0x8291('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8291('0xc'))(new Redis(config['redis']));require(_0x8291('0xd'))[_0x8291('0xe')](socket);var htmlToText=require(_0x8291('0xf'));var jayson=require(_0x8291('0x10'));var client=jayson[_0x8291('0x11')][_0x8291('0x12')]({'port':0x232c});var client9002=jayson[_0x8291('0x11')][_0x8291('0x12')]({'port':0x232a});var client9003=jayson[_0x8291('0x11')][_0x8291('0x12')]({'port':0x232b});var client9001=jayson[_0x8291('0x11')][_0x8291('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x3780f0,_0x3e87fa,_0xf6339a,_0x58ecfe){return new BPromise(function(_0x16a8cf,_0x115f85){var _0x17bf54=_0x58ecfe||client;return _0x17bf54[_0x8291('0x13')](_0x3780f0,_0xf6339a)[_0x8291('0x14')](function(_0x317036){logger[_0x8291('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3e87fa,'request\x20sent');logger[_0x8291('0x16')](_0x8291('0x17'),_0x3e87fa,_0x8291('0x18'),JSON[_0x8291('0x19')](_0x317036));if(_0x317036[_0x8291('0x1a')]){if(_0x317036[_0x8291('0x1a')]['code']===0x1f4){logger['error'](_0x8291('0x1b'),_0x3e87fa,_0x317036[_0x8291('0x1a')][_0x8291('0x1c')]);return _0x115f85(_0x317036[_0x8291('0x1a')][_0x8291('0x1c')]);}logger['error'](_0x8291('0x1b'),_0x3e87fa,_0x317036[_0x8291('0x1a')][_0x8291('0x1c')]);return _0x16a8cf(_0x317036['error'][_0x8291('0x1c')]);}else{logger['info'](_0x8291('0x1b'),_0x3e87fa,_0x8291('0x18'));_0x16a8cf(_0x317036[_0x8291('0x1d')][_0x8291('0x1c')]);}})[_0x8291('0x1e')](function(_0x189b9f){logger['error'](_0x8291('0x1b'),_0x3e87fa,_0x189b9f);_0x115f85(_0x189b9f);});});}function respondWithStatusCode(_0x47146c,_0xd0e730){_0xd0e730=_0xd0e730||0xcc;return function(_0x51938a){if(_0x51938a){return _0x47146c[_0x8291('0x1f')](_0xd0e730);}return _0x47146c[_0x8291('0x20')](_0xd0e730)[_0x8291('0x21')]();};}function respondWithResult(_0x4e1fe8,_0x52ce0a){_0x52ce0a=_0x52ce0a||0xc8;return function(_0x2f3ce4){if(_0x2f3ce4){return _0x4e1fe8[_0x8291('0x20')](_0x52ce0a)[_0x8291('0x22')](_0x2f3ce4);}};}function respondWithFilteredResult(_0x2290dd,_0xd1b269){return function(_0x3dd3e3){if(_0x3dd3e3){var _0xd13709=typeof _0xd1b269[_0x8291('0x23')]===_0x8291('0x24')&&typeof _0xd1b269[_0x8291('0x25')]===_0x8291('0x24');var _0x1f49a4=_0x3dd3e3[_0x8291('0x26')];var _0x4f0293=_0xd13709?0x0:_0xd1b269[_0x8291('0x23')];var _0x10568d=_0xd13709?_0x3dd3e3[_0x8291('0x26')]:_0xd1b269[_0x8291('0x23')]+_0xd1b269[_0x8291('0x25')];var _0x5d0ae8;if(_0x10568d>=_0x1f49a4){_0x10568d=_0x1f49a4;_0x5d0ae8=0xc8;}else{_0x5d0ae8=0xce;}_0x2290dd[_0x8291('0x20')](_0x5d0ae8);return _0x2290dd[_0x8291('0x27')](_0x8291('0x28'),_0x4f0293+'-'+_0x10568d+'/'+_0x1f49a4)[_0x8291('0x22')](_0x3dd3e3);}return null;};}function saveUpdates(_0x3b01a3){return function(_0x5eb002){if(_0x5eb002){return _0x5eb002[_0x8291('0x29')](_0x3b01a3)[_0x8291('0x14')](function(_0x4894a3){return _0x4894a3;});}return null;};}function removeEntity(_0x2b949e){return function(_0x50210b){if(_0x50210b){return _0x50210b[_0x8291('0x2a')]()[_0x8291('0x14')](function(){var _0x39a213=_0x50210b[_0x8291('0x2b')]({'plain':!![]});var _0x22c33f=_0x8291('0x2c');return db[_0x8291('0x2d')][_0x8291('0x2a')]({'where':{'type':_0x22c33f,'resourceId':_0x39a213['id']}})['then'](function(){return _0x50210b;});})[_0x8291('0x14')](function(){_0x2b949e['status'](0xcc)[_0x8291('0x21')]();});}};}function handleEntityNotFound(_0x476ec9){return function(_0x3f6375){if(!_0x3f6375){_0x476ec9[_0x8291('0x1f')](0x194);}return _0x3f6375;};}function handleError(_0x56ad68,_0x4b9b14){_0x4b9b14=_0x4b9b14||0x1f4;return function(_0x4a4377){logger['error'](_0x4a4377['stack']);if(_0x4a4377[_0x8291('0x2e')]){delete _0x4a4377[_0x8291('0x2e')];}_0x56ad68[_0x8291('0x20')](_0x4b9b14)['send'](_0x4a4377);};}exports['index']=function(_0x32caeb,_0x4ae6cd){var _0x364c1e={'include':[{'model':db[_0x8291('0x2f')],'as':_0x8291('0x30')}]},_0x31bf68={},_0x1256f3={'count':0x0,'rows':[]};var _0x40fd8c=_[_0x8291('0x31')](db[_0x8291('0x32')]['rawAttributes'],function(_0x533664){return{'name':_0x533664[_0x8291('0x33')],'type':_0x533664[_0x8291('0x34')][_0x8291('0x35')]};});_0x31bf68[_0x8291('0x36')]=_[_0x8291('0x31')](_0x40fd8c,_0x8291('0x2e'));_0x31bf68[_0x8291('0x37')]=_[_0x8291('0x38')](_0x32caeb[_0x8291('0x37')]);_0x31bf68[_0x8291('0x39')]=_[_0x8291('0x3a')](_0x31bf68['model'],_0x31bf68[_0x8291('0x37')]);_0x364c1e[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x31bf68['model'],qs[_0x8291('0x3c')](_0x32caeb[_0x8291('0x37')][_0x8291('0x3c')]));_0x364c1e[_0x8291('0x3b')]=_0x364c1e[_0x8291('0x3b')][_0x8291('0x3d')]?_0x364c1e[_0x8291('0x3b')]:_0x31bf68['model'];if(!_0x32caeb[_0x8291('0x37')][_0x8291('0x3e')](_0x8291('0x3f'))){_0x364c1e['limit']=qs['limit'](_0x32caeb[_0x8291('0x37')]['limit']);_0x364c1e[_0x8291('0x23')]=qs[_0x8291('0x23')](_0x32caeb['query'][_0x8291('0x23')]);}_0x364c1e[_0x8291('0x40')]=qs['sort'](_0x32caeb[_0x8291('0x37')][_0x8291('0x41')]);_0x364c1e[_0x8291('0x42')]=qs[_0x8291('0x39')](_['pick'](_0x32caeb[_0x8291('0x37')],_0x31bf68[_0x8291('0x39')]),_0x40fd8c);if(_0x32caeb[_0x8291('0x37')][_0x8291('0x43')]){_0x364c1e['where']=_[_0x8291('0x44')](_0x364c1e[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0x40fd8c,function(_0x2d081d){if(_0x2d081d[_0x8291('0x34')]!==_0x8291('0x45')){var _0x256c3f={};_0x256c3f[_0x2d081d[_0x8291('0x2e')]]={'$like':'%'+_0x32caeb[_0x8291('0x37')][_0x8291('0x43')]+'%'};return _0x256c3f;}})});}_0x364c1e=_[_0x8291('0x44')]({},_0x364c1e,_0x32caeb[_0x8291('0x46')]);var _0x154ca8={'where':_0x364c1e['where']};return db['ChatWebsite'][_0x8291('0x26')](_0x154ca8)[_0x8291('0x14')](function(_0x281f8b){_0x1256f3['count']=_0x281f8b;if(_0x32caeb['query'][_0x8291('0x47')]){_0x364c1e[_0x8291('0x48')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8291('0x49')](_0x364c1e);})[_0x8291('0x14')](function(_0x4e3218){_0x1256f3['rows']=_0x4e3218;return _0x1256f3;})[_0x8291('0x14')](respondWithFilteredResult(_0x4ae6cd,_0x364c1e))['catch'](handleError(_0x4ae6cd,null));};exports[_0x8291('0x4a')]=function(_0x1f8f41,_0x39248f){var _0x32822a={'raw':![],'where':{'id':_0x1f8f41[_0x8291('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x8291('0x30')}]},_0x44c23e={};_0x44c23e[_0x8291('0x36')]=_[_0x8291('0x38')](db[_0x8291('0x32')]['rawAttributes']);_0x44c23e[_0x8291('0x37')]=_[_0x8291('0x38')](_0x1f8f41[_0x8291('0x37')]);_0x44c23e['filters']=_[_0x8291('0x3a')](_0x44c23e[_0x8291('0x36')],_0x44c23e['query']);_0x32822a[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x44c23e['model'],qs[_0x8291('0x3c')](_0x1f8f41[_0x8291('0x37')]['fields']));_0x32822a[_0x8291('0x3b')]=_0x32822a[_0x8291('0x3b')][_0x8291('0x3d')]?_0x32822a[_0x8291('0x3b')]:_0x44c23e[_0x8291('0x36')];if(_0x1f8f41[_0x8291('0x37')][_0x8291('0x47')]){_0x32822a[_0x8291('0x48')]=[{'all':!![]}];}_0x32822a=_[_0x8291('0x44')]({},_0x32822a,_0x1f8f41[_0x8291('0x46')]);return db[_0x8291('0x32')][_0x8291('0x4c')](_0x32822a)['then'](handleEntityNotFound(_0x39248f,null))[_0x8291('0x14')](respondWithResult(_0x39248f,null))[_0x8291('0x1e')](handleError(_0x39248f,null));};exports['create']=function(_0x5d7f4e,_0x5e09ac){return db[_0x8291('0x32')]['create'](_0x5d7f4e[_0x8291('0x4d')],{})[_0x8291('0x14')](function(_0x46f3d3){var _0x1ff2f9=_0x5d7f4e['user']['get']({'plain':!![]});if(!_0x1ff2f9)throw new Error(_0x8291('0x4e'));if(_0x1ff2f9[_0x8291('0x4f')]==='user'){var _0x1c7087=_0x46f3d3[_0x8291('0x2b')]({'plain':!![]});var _0x4e260f='ChatWebsites';return db[_0x8291('0x50')][_0x8291('0x4c')]({'where':{'name':_0x4e260f,'userProfileId':_0x1ff2f9[_0x8291('0x51')]},'raw':!![]})[_0x8291('0x14')](function(_0x506a47){if(_0x506a47&&_0x506a47[_0x8291('0x52')]===0x0){return db['UserProfileResource'][_0x8291('0x53')]({'name':_0x1c7087['name'],'resourceId':_0x1c7087['id'],'type':_0x506a47[_0x8291('0x2e')],'sectionId':_0x506a47['id']},{})[_0x8291('0x14')](function(){return _0x46f3d3;});}else{return _0x46f3d3;}})[_0x8291('0x1e')](function(_0x403402){logger[_0x8291('0x1a')](_0x8291('0x54'),_0x403402);throw _0x403402;});}return _0x46f3d3;})[_0x8291('0x14')](respondWithResult(_0x5e09ac,0xc9))['catch'](handleError(_0x5e09ac,null));};exports['update']=function(_0x2c9a70,_0x1cf8f2){if(_0x2c9a70[_0x8291('0x4d')]['id']){delete _0x2c9a70['body']['id'];}return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x2c9a70[_0x8291('0x4b')]['id']},'include':[{'model':db[_0x8291('0x2f')],'as':_0x8291('0x30')}]})['then'](handleEntityNotFound(_0x1cf8f2,null))[_0x8291('0x14')](saveUpdates(_0x2c9a70['body'],null))[_0x8291('0x14')](respondWithResult(_0x1cf8f2,null))[_0x8291('0x1e')](handleError(_0x1cf8f2,null));};exports['destroy']=function(_0x111f13,_0x19a6ff){return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x111f13[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x19a6ff,null))[_0x8291('0x14')](removeEntity(_0x19a6ff,null))[_0x8291('0x1e')](handleError(_0x19a6ff,null));};exports[_0x8291('0x55')]=function(_0x4d7946,_0x574f2f){return db[_0x8291('0x32')][_0x8291('0x55')]()[_0x8291('0x14')](respondWithResult(_0x574f2f,null))[_0x8291('0x1e')](handleError(_0x574f2f,null));};exports[_0x8291('0x56')]=function(_0x14cd72,_0xba95be){if(_0x14cd72[_0x8291('0x4d')]['id']){delete _0x14cd72[_0x8291('0x4d')]['id'];}return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x14cd72[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0xba95be,null))[_0x8291('0x14')](function(_0x28beb9){if(_0x28beb9){_0x14cd72[_0x8291('0x4d')]['ChatWebsiteId']=_0x28beb9['id'];return db[_0x8291('0x57')]['create'](_0x14cd72[_0x8291('0x4d')]);}})[_0x8291('0x14')](respondWithResult(_0xba95be,null))[_0x8291('0x1e')](handleError(_0xba95be,null));};exports[_0x8291('0x58')]=function(_0x79e921,_0x5b76df){var _0x4a9a12={'raw':![],'where':{}};var _0x986a96={};var _0x4fd2cb={'count':0x0,'rows':[]};return db[_0x8291('0x32')][_0x8291('0x59')]({'where':{'id':_0x79e921[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x5b76df,null))[_0x8291('0x14')](function(_0x25fb32){if(_0x25fb32){_0x986a96[_0x8291('0x36')]=_[_0x8291('0x38')](db['Disposition'][_0x8291('0x5a')]);_0x986a96[_0x8291('0x37')]=_['keys'](_0x79e921[_0x8291('0x37')]);_0x986a96[_0x8291('0x39')]=_['intersection'](_0x986a96[_0x8291('0x36')],_0x986a96[_0x8291('0x37')]);_0x4a9a12[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x986a96[_0x8291('0x36')],qs[_0x8291('0x3c')](_0x79e921[_0x8291('0x37')][_0x8291('0x3c')]));_0x4a9a12[_0x8291('0x3b')]=_0x4a9a12['attributes']['length']?_0x4a9a12[_0x8291('0x3b')]:_0x986a96[_0x8291('0x36')];if(!_0x79e921[_0x8291('0x37')][_0x8291('0x3e')](_0x8291('0x3f'))){_0x4a9a12[_0x8291('0x25')]=qs[_0x8291('0x25')](_0x79e921['query']['limit']);_0x4a9a12[_0x8291('0x23')]=qs[_0x8291('0x23')](_0x79e921[_0x8291('0x37')][_0x8291('0x23')]);}_0x4a9a12[_0x8291('0x40')]=qs[_0x8291('0x41')](_0x79e921[_0x8291('0x37')][_0x8291('0x41')]);_0x4a9a12[_0x8291('0x42')]=qs[_0x8291('0x39')](_['pick'](_0x79e921[_0x8291('0x37')],_0x986a96[_0x8291('0x39')]));_0x4a9a12[_0x8291('0x42')][_0x8291('0x5b')]=_0x25fb32['id'];if(_0x79e921['query']['filter']){_0x4a9a12[_0x8291('0x42')]=_[_0x8291('0x44')](_0x4a9a12['where'],{'$or':_[_0x8291('0x31')](_0x4a9a12[_0x8291('0x3b')],function(_0x20b14f){var _0x30d3a5={};_0x30d3a5[_0x20b14f]={'$like':'%'+_0x79e921[_0x8291('0x37')]['filter']+'%'};return _0x30d3a5;})});}_0x4a9a12=_[_0x8291('0x44')]({},_0x4a9a12,_0x79e921[_0x8291('0x46')]);return db[_0x8291('0x57')][_0x8291('0x26')]({'where':_0x4a9a12[_0x8291('0x42')]})[_0x8291('0x14')](function(_0x385482){_0x4fd2cb['count']=_0x385482;if(_0x79e921[_0x8291('0x37')][_0x8291('0x47')]){_0x4a9a12[_0x8291('0x48')]=[{'all':!![]}];}return db[_0x8291('0x57')]['findAll'](_0x4a9a12);})[_0x8291('0x14')](function(_0x414da2){_0x4fd2cb['rows']=_0x414da2;return _0x4fd2cb;});}})[_0x8291('0x14')](respondWithFilteredResult(_0x5b76df,_0x4a9a12))['catch'](handleError(_0x5b76df,null));};exports[_0x8291('0x5c')]=function(_0x580686,_0x410cab){return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x580686['params']['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x410cab,null))[_0x8291('0x14')](function(_0x282b06){if(_0x282b06){return _0x282b06['removeDispositions'](_0x580686['query'][_0x8291('0x5d')]);}})[_0x8291('0x14')](respondWithStatusCode(_0x410cab,null))[_0x8291('0x1e')](handleError(_0x410cab,null));};exports[_0x8291('0x5e')]=function(_0x52b3d6,_0x33acef){if(_0x52b3d6['body']['id']){delete _0x52b3d6[_0x8291('0x4d')]['id'];}return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x52b3d6[_0x8291('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33acef,null))[_0x8291('0x14')](function(_0x3faf1a){if(_0x3faf1a){_0x52b3d6[_0x8291('0x4d')][_0x8291('0x5b')]=_0x3faf1a['id'];return db[_0x8291('0x5f')][_0x8291('0x53')](_0x52b3d6[_0x8291('0x4d')]);}})[_0x8291('0x14')](respondWithResult(_0x33acef,null))[_0x8291('0x1e')](handleError(_0x33acef,null));};exports['getAnswers']=function(_0xb0a848,_0x134bd4){var _0xea405={'raw':![],'where':{}};var _0x1abd21={};var _0x3c8d34={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8291('0x59')]({'where':{'id':_0xb0a848[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x134bd4,null))[_0x8291('0x14')](function(_0x4cff7a){if(_0x4cff7a){_0x1abd21['model']=_[_0x8291('0x38')](db[_0x8291('0x5f')][_0x8291('0x5a')]);_0x1abd21[_0x8291('0x37')]=_[_0x8291('0x38')](_0xb0a848[_0x8291('0x37')]);_0x1abd21[_0x8291('0x39')]=_['intersection'](_0x1abd21[_0x8291('0x36')],_0x1abd21[_0x8291('0x37')]);_0xea405['attributes']=_[_0x8291('0x3a')](_0x1abd21['model'],qs['fields'](_0xb0a848[_0x8291('0x37')][_0x8291('0x3c')]));_0xea405['attributes']=_0xea405['attributes'][_0x8291('0x3d')]?_0xea405[_0x8291('0x3b')]:_0x1abd21[_0x8291('0x36')];if(!_0xb0a848[_0x8291('0x37')]['hasOwnProperty']('nolimit')){_0xea405[_0x8291('0x25')]=qs[_0x8291('0x25')](_0xb0a848[_0x8291('0x37')][_0x8291('0x25')]);_0xea405[_0x8291('0x23')]=qs['offset'](_0xb0a848['query']['offset']);}_0xea405[_0x8291('0x40')]=qs[_0x8291('0x41')](_0xb0a848[_0x8291('0x37')][_0x8291('0x41')]);_0xea405['where']=qs['filters'](_[_0x8291('0x60')](_0xb0a848['query'],_0x1abd21['filters']));_0xea405[_0x8291('0x42')][_0x8291('0x5b')]=_0x4cff7a['id'];if(_0xb0a848[_0x8291('0x37')][_0x8291('0x43')]){_0xea405[_0x8291('0x42')]=_['merge'](_0xea405[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0xea405[_0x8291('0x3b')],function(_0x28c091){var _0x1104a4={};_0x1104a4[_0x28c091]={'$like':'%'+_0xb0a848['query'][_0x8291('0x43')]+'%'};return _0x1104a4;})});}_0xea405=_[_0x8291('0x44')]({},_0xea405,_0xb0a848[_0x8291('0x46')]);return db[_0x8291('0x5f')]['count']({'where':_0xea405['where']})[_0x8291('0x14')](function(_0x3d0636){_0x3c8d34[_0x8291('0x26')]=_0x3d0636;if(_0xb0a848['query'][_0x8291('0x47')]){_0xea405['include']=[{'all':!![]}];}return db[_0x8291('0x5f')][_0x8291('0x49')](_0xea405);})['then'](function(_0x77e82){_0x3c8d34[_0x8291('0x61')]=_0x77e82;return _0x3c8d34;});}})[_0x8291('0x14')](respondWithFilteredResult(_0x134bd4,_0xea405))[_0x8291('0x1e')](handleError(_0x134bd4,null));};exports[_0x8291('0x62')]=function(_0x4f7cb4,_0x2ac9b0){return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x4f7cb4[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x2ac9b0,null))[_0x8291('0x14')](function(_0x5c1b5f){if(_0x5c1b5f){return _0x5c1b5f['removeAnswers'](_0x4f7cb4[_0x8291('0x37')][_0x8291('0x5d')]);}})[_0x8291('0x14')](respondWithStatusCode(_0x2ac9b0,null))[_0x8291('0x1e')](handleError(_0x2ac9b0,null));};exports[_0x8291('0x63')]=function(_0x39953f,_0x596c4a){_0x39953f[_0x8291('0x4d')][_0x8291('0x64')]=_0x39953f[_0x8291('0x65')]['filename'];return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x39953f['params']['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x596c4a,null))['then'](saveUpdates(_0x39953f['body'],null))['then'](respondWithResult(_0x596c4a,null))['catch'](handleError(_0x596c4a,null));};exports[_0x8291('0x66')]=function(_0x3265b0,_0x3a1199){_0x3265b0['body'][_0x8291('0x67')]=_0x3265b0['file'][_0x8291('0x68')];return db[_0x8291('0x32')]['find']({'where':{'id':_0x3265b0[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x3a1199,null))[_0x8291('0x14')](saveUpdates(_0x3265b0[_0x8291('0x4d')],null))[_0x8291('0x14')](respondWithResult(_0x3a1199,null))[_0x8291('0x1e')](handleError(_0x3a1199,null));};exports[_0x8291('0x69')]=function(_0xb5739d,_0x325f90){_0xb5739d[_0x8291('0x4d')][_0x8291('0x6a')]=_0xb5739d[_0x8291('0x65')][_0x8291('0x68')];return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0xb5739d[_0x8291('0x4b')]['id']}})['then'](handleEntityNotFound(_0x325f90,null))[_0x8291('0x14')](saveUpdates(_0xb5739d['body'],null))['then'](respondWithResult(_0x325f90,null))[_0x8291('0x1e')](handleError(_0x325f90,null));};exports[_0x8291('0x6b')]=function(_0x331bd5,_0xe83597){_0x331bd5[_0x8291('0x4d')][_0x8291('0x6c')]=_0x331bd5['file']['filename'];return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x331bd5[_0x8291('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe83597,null))[_0x8291('0x14')](saveUpdates(_0x331bd5[_0x8291('0x4d')],null))[_0x8291('0x14')](respondWithResult(_0xe83597,null))[_0x8291('0x1e')](handleError(_0xe83597,null));};exports[_0x8291('0x6d')]=function(_0x5782c8,_0x164808){var _0x4293c4=path['join'](config[_0x8291('0x6e')],'server/files/images/logos/default_logo.svg');var _0x45d910={'where':{'id':_0x5782c8[_0x8291('0x4b')]['id']},'attributes':['id',_0x8291('0x64')],'raw':!![]};var _0x39096d=![];return require(_0x8291('0x6f'))[_0x8291('0x70')]()[_0x8291('0x14')](function(_0x306108){if(_0x306108){_0x39096d=_0x306108[_0x8291('0x71')];}})[_0x8291('0x14')](function(){return db[_0x8291('0x32')][_0x8291('0x4c')](_0x45d910);})[_0x8291('0x14')](handleEntityNotFound(_0x164808,null))['then'](function(_0x1c2dd1){if(_0x1c2dd1){if(!_[_0x8291('0x72')](_0x1c2dd1[_0x8291('0x64')])){if(fs['existsSync'](path['join'](config[_0x8291('0x6e')],'server/files/images/logos/',_0x1c2dd1['sitepic']))&&_0x39096d){_0x4293c4=path[_0x8291('0x73')](config['root'],'server/files/images/logos/',_0x1c2dd1[_0x8291('0x64')]);}}return _0x164808[_0x8291('0x74')](_0x4293c4);}})[_0x8291('0x1e')](handleError(_0x164808,null));};exports[_0x8291('0x75')]=function(_0xd67700,_0x1f2431){var _0x3d767c=path['join'](config['root'],_0x8291('0x76'));var _0x26bda4={'where':{'id':_0xd67700[_0x8291('0x4b')]['id']},'attributes':['id',_0x8291('0x67')],'raw':!![]};return db[_0x8291('0x32')][_0x8291('0x4c')](_0x26bda4)['then'](handleEntityNotFound(_0x1f2431,null))[_0x8291('0x14')](function(_0x1273d4){if(_0x1273d4){if(!_[_0x8291('0x72')](_0x1273d4[_0x8291('0x67')])){if(fs['existsSync'](path[_0x8291('0x73')](config['root'],_0x8291('0x77'),_0x1273d4[_0x8291('0x67')]))){_0x3d767c=path[_0x8291('0x73')](config[_0x8291('0x6e')],'server/files/images/avatars/',_0x1273d4[_0x8291('0x67')]);}}return _0x1f2431['download'](_0x3d767c);}})[_0x8291('0x1e')](handleError(_0x1f2431,null));};exports[_0x8291('0x78')]=function(_0x4cab75,_0x4a2ea0){var _0x398374=path[_0x8291('0x73')](config[_0x8291('0x6e')],'server/files/images/avatars/customer_avatar.png');var _0x15809a={'where':{'id':_0x4cab75['params']['id']},'attributes':['id',_0x8291('0x6a'),_0x8291('0x79')],'raw':!![]};return db[_0x8291('0x32')][_0x8291('0x4c')](_0x15809a)['then'](handleEntityNotFound(_0x4a2ea0,null))[_0x8291('0x14')](function(_0x402d75){if(_0x402d75){if(!_[_0x8291('0x72')](_0x402d75['customerAvatar'])){if(fs[_0x8291('0x7a')](path[_0x8291('0x73')](config[_0x8291('0x6e')],_0x8291('0x77'),_0x402d75[_0x8291('0x6a')]))&&_0x402d75[_0x8291('0x79')]){_0x398374=path['join'](config[_0x8291('0x6e')],_0x8291('0x77'),_0x402d75['customerAvatar']);}}return _0x4a2ea0['download'](_0x398374);}})[_0x8291('0x1e')](handleError(_0x4a2ea0,null));};exports['getSystemAvatar']=function(_0x492126,_0x16217e){var _0x5a6515=path[_0x8291('0x73')](config['root'],_0x8291('0x7b'));var _0x46f7c9={'where':{'id':_0x492126[_0x8291('0x4b')]['id']},'attributes':['id',_0x8291('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x8291('0x4c')](_0x46f7c9)['then'](handleEntityNotFound(_0x16217e,null))[_0x8291('0x14')](function(_0x25b571){if(_0x25b571){if(!_[_0x8291('0x72')](_0x25b571['systemAvatar'])){if(fs[_0x8291('0x7a')](path[_0x8291('0x73')](config[_0x8291('0x6e')],'server/files/images/avatars/',_0x25b571['systemAvatar']))){_0x5a6515=path[_0x8291('0x73')](config['root'],_0x8291('0x77'),_0x25b571['systemAvatar']);}}return _0x16217e['download'](_0x5a6515);}})[_0x8291('0x1e')](handleError(_0x16217e,null));};exports[_0x8291('0x7c')]=function(_0x330f42,_0x1edb00){var _0x39d4e6=require(_0x8291('0x7d'));var _0x48877=new _0x39d4e6();var _0x336967=_0x48877[_0x8291('0x7e')](_0x330f42[_0x8291('0x7f')][_0x8291('0x80')])['getResult']();var _0x4d6867={'body':_0x330f42[_0x8291('0x4d')],'channel':_0x8291('0x81')};var _0x40d973=[];var _0x576506=[];var _0x909d0c={};var _0x277b27=![];return db[_0x8291('0x82')][_0x8291('0x55')]()['then'](function(_0x5b681c){if(!_0x5b681c){throw new db[(_0x8291('0x83'))][(_0x8291('0x84'))](_0x8291('0x85'));}_0x40d973=_['difference'](_[_0x8291('0x38')](_0x5b681c),[_0x8291('0x86'),'updatedAt']);_0x576506=_['difference'](_['keys'](_0x5b681c),[_0x8291('0x86'),'updatedAt',_0x8291('0x87'),'ListId']);if(_0x330f42[_0x8291('0x4d')]['id']){delete _0x330f42[_0x8291('0x4d')]['id'];}if(_[_0x8291('0x72')](_0x330f42['body'][_0x8291('0x88')])){throw new db[(_0x8291('0x83'))][(_0x8291('0x84'))]('from\x20is\x20mandatory');}if(_[_0x8291('0x72')](_0x330f42[_0x8291('0x4d')]['body'])||_0x330f42[_0x8291('0x4d')]['body']===''){throw new db[(_0x8291('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8291('0x72')](_0x330f42[_0x8291('0x4d')][_0x8291('0x89')])){throw new db['Sequelize'][(_0x8291('0x84'))](_0x8291('0x8a')+_0x576506);}if(!_[_0x8291('0x8b')](_0x576506,_0x330f42['body']['mapKey'])){throw new db[(_0x8291('0x83'))][(_0x8291('0x84'))](_0x8291('0x8c')+_0x576506);}_0x909d0c[_0x330f42[_0x8291('0x4d')][_0x8291('0x89')]]=_0x330f42['body'][_0x8291('0x88')];})[_0x8291('0x14')](function(){return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x330f42[_0x8291('0x4b')]['id']},'include':[{'model':db[_0x8291('0x8d')],'as':_0x8291('0x8e'),'include':[{'model':db[_0x8291('0x82')],'as':_0x8291('0x8f'),'where':_0x909d0c,'limit':0x1,'order':[['updatedAt',_0x8291('0x90')]]}]},{'model':db['ChatApplication'],'as':_0x8291('0x91')}]});})['then'](handleEntityNotFound(_0x1edb00,null))[_0x8291('0x14')](function(_0x70483c){if(_0x70483c&&_0x70483c[_0x8291('0x8e')]){_0x4d6867[_0x8291('0x92')]=_0x70483c;_0x4d6867[_0x8291('0x93')]=_0x70483c[_0x8291('0x91')];_0x4d6867['list']=_0x70483c[_0x8291('0x8e')];_0x4d6867[_0x8291('0x93')]=_[_0x8291('0x94')](_0x4d6867['applications'],[_0x8291('0x95')],[_0x8291('0x96')]);if(_0x4d6867[_0x8291('0x92')]['Applications']){delete _0x4d6867['account'][_0x8291('0x91')];}if(_0x4d6867['account'][_0x8291('0x8e')]&&_0x4d6867[_0x8291('0x92')]['List'][_0x8291('0x8f')][_0x8291('0x3d')]){return _0x4d6867[_0x8291('0x92')][_0x8291('0x8e')]['Contacts'][0x0];}var _0x494bae=_[_0x8291('0xb')](_0x330f42[_0x8291('0x4d')],{'firstName':_0x330f42[_0x8291('0x4d')][_0x8291('0x88')],'ListId':_0x70483c['ListId']});_0x494bae[_0x330f42[_0x8291('0x4d')]['mapKey']]=_0x330f42[_0x8291('0x4d')][_0x8291('0x88')];return db['CmContact']['create'](_0x494bae,{'fields':_0x40d973,'raw':!![]});}})['then'](handleEntityNotFound(_0x1edb00,null))[_0x8291('0x14')](function(_0x19fd96){_0x4d6867[_0x8291('0x97')]=_0x19fd96;var _0x1f985e=_0x330f42[_0x8291('0x4d')][_0x8291('0x98')];if(_0x330f42[_0x8291('0x7f')][_0x8291('0x99')]){_0x1f985e=_0x330f42[_0x8291('0x7f')][_0x8291('0x99')];}else if(_0x330f42['headers'][_0x8291('0x9a')]){_0x1f985e=_['first'](_0x330f42['headers'][_0x8291('0x9a')][_0x8291('0x9b')](','));}if(_0x19fd96){var _0x2765c7={'ContactId':_0x19fd96['id'],'ChatWebsiteId':_0x330f42['params']['id'],'from':(_0x19fd96['firstName']||'')+'\x20'+(_0x19fd96[_0x8291('0x9c')]||''),'customerIp':_0x1f985e,'customerPort':_0x330f42[_0x8291('0x7f')][_0x8291('0x9d')]?_0x330f42[_0x8291('0x7f')][_0x8291('0x9d')]:null,'referer':_0x330f42[_0x8291('0x4d')]['referer'],'browserName':_0x336967[_0x8291('0x9e')][_0x8291('0x2e')]&&_0x336967[_0x8291('0x9e')][_0x8291('0x9f')]?util[_0x8291('0xa0')](_0x8291('0xa1'),_0x336967[_0x8291('0x9e')][_0x8291('0x2e')],_0x336967[_0x8291('0x9e')][_0x8291('0x9f')]):_0x8291('0xa2'),'browserVersion':_0x336967[_0x8291('0x9e')][_0x8291('0x9f')]||_0x8291('0xa2'),'osName':util['format'](_0x8291('0xa1'),_0x336967['os'][_0x8291('0x2e')],_0x336967['os']['version']),'osVersion':_0x336967['os'][_0x8291('0x9f')],'deviceModel':_0x336967[_0x8291('0xa3')][_0x8291('0x36')]&&_0x336967[_0x8291('0xa3')][_0x8291('0xa4')]?util[_0x8291('0xa0')]('%s\x20%s\x20%s',_0x336967[_0x8291('0xa3')][_0x8291('0x36')],_0x336967[_0x8291('0xa3')]['vendor'],_0x336967['device'][_0x8291('0x34')]):null,'deviceVendor':_0x336967[_0x8291('0xa3')][_0x8291('0xa4')],'deviceType':_0x336967['device'][_0x8291('0x34')],'formData':JSON['stringify'](_0x330f42[_0x8291('0x4d')])};var _0x149f1a={'ChatWebsiteId':_0x330f42['params']['id'],'closed':![]};if(_0x330f42[_0x8291('0x4d')][_0x8291('0xa5')]){_0x149f1a[_0x8291('0xa5')]=_0x330f42[_0x8291('0x4d')]['threadId'];return db['ChatInteraction'][_0x8291('0x4c')]({'where':_0x149f1a})[_0x8291('0x14')](function(_0x2c5b8b){if(_0x2c5b8b){return[_0x2c5b8b,![]];}_0x2765c7['threadId']=_0x330f42['body'][_0x8291('0xa5')];_0x2765c7[_0x8291('0xa6')]=_0x330f42[_0x8291('0x4d')]['externalUrl'];return db[_0x8291('0xa7')][_0x8291('0x53')](_0x2765c7)[_0x8291('0x14')](function(_0x5b6adb){return[_0x5b6adb,!![]];});});}_0x149f1a['ContactId']=_0x19fd96['id'];if(_0x330f42[_0x8291('0x4d')][_0x8291('0xa8')]&&_0x330f42[_0x8291('0x4d')][_0x8291('0xa8')]['id']){_0x149f1a['id']=_0x330f42[_0x8291('0x4d')][_0x8291('0xa8')]['id'];return db[_0x8291('0xa7')][_0x8291('0x4c')]({'where':_0x149f1a})['then'](function(_0x2b7aa7){if(_0x2b7aa7){return[_0x2b7aa7,![]];}return db['ChatInteraction']['create'](_0x2765c7)[_0x8291('0x14')](function(_0x1cb4e4){return[_0x1cb4e4,!![]];});});}return db[_0x8291('0xa7')][_0x8291('0x53')](_0x2765c7)[_0x8291('0x14')](function(_0x38bc00){return[_0x38bc00,!![]];});}})[_0x8291('0xa9')](function(_0x1d1b47,_0x5e3b5b){if(_0x1d1b47){_0x277b27=_0x5e3b5b;if(!_0x5e3b5b){var _0x356f27={'from':(_0x4d6867['contact'][_0x8291('0xaa')]||'')+'\x20'+(_0x4d6867['contact'][_0x8291('0x9c')]||'')};if(_0x330f42[_0x8291('0x4d')][_0x8291('0xa5')]&&_0x330f42[_0x8291('0x4d')][_0x8291('0xab')]&&_0x330f42[_0x8291('0x4d')][_0x8291('0xa5')]!=_0x330f42['body']['messageId']){_0x356f27[_0x8291('0xa5')]=_0x330f42[_0x8291('0x4d')][_0x8291('0xab')];}return _0x1d1b47[_0x8291('0x29')](_0x356f27);}else{return _0x1d1b47;}}})[_0x8291('0x14')](function(_0x776cd5){_0x4d6867['interaction']=_0x776cd5[_0x8291('0x2b')]({'plain':!![]});_0x4d6867[_0x8291('0xa8')][_0x8291('0xac')]=_0x277b27;if(_0x4d6867[_0x8291('0xa8')][_0x8291('0xac')]){if(_0x4d6867[_0x8291('0x92')][_0x8291('0xad')]){_0x4d6867[_0x8291('0x93')][_0x8291('0xae')]({'id':0x0,'priority':_0x4d6867[_0x8291('0x93')][_0x8291('0x3d')]+0x1,'app':_0x8291('0xaf'),'appdata':'unmanaged','interval':_0x8291('0xb0')});}}return db['ChatMessage'][_0x8291('0x53')]({'body':_0x330f42['body'][_0x8291('0x4d')],'ChatWebsiteId':_0x330f42[_0x8291('0x4b')]['id'],'ChatInteractionId':_0x776cd5['id'],'direction':'in','ContactId':_0x4d6867[_0x8291('0x97')]['id'],'AttachmentId':_0x330f42['body'][_0x8291('0xb1')]});})[_0x8291('0x14')](function(_0x549f45){_0x4d6867[_0x8291('0x1c')]=_0x549f45;if(_0x4d6867[_0x8291('0xa8')][_0x8291('0xb2')]){return db[_0x8291('0xb3')][_0x8291('0x4c')]({'attributes':['id',_0x8291('0x2e')],'where':{'id':_0x4d6867[_0x8291('0xa8')]['UserId']}})['then'](function(_0x203aea){if(_0x203aea){_0x4d6867[_0x8291('0x93')][_0x8291('0xb4')]({'id':0x0,'priority':0x0,'app':_0x8291('0xb5'),'appdata':_0x203aea['name']+','+(_0x4d6867[_0x8291('0x92')][_0x8291('0xb6')]||0xa),'interval':_0x8291('0xb0')});_0x4d6867[_0x8291('0xb7')]=!![];}return respondWithRpcPromise(_0x8291('0xb8'),_0x8291('0xb9'),_0x4d6867);});}return respondWithRpcPromise('Start',_0x8291('0xb9'),_0x4d6867);})['then'](function(_0x505d70){respondWithRpcPromise(_0x8291('0xba'),_0x8291('0xba'),{'event':_0x8291('0x7c'),'message':_0x505d70},client9002);return _0x505d70;})[_0x8291('0x14')](respondWithResult(_0x1edb00,null))['catch'](handleError(_0x1edb00,null));};exports[_0x8291('0xbb')]=function(_0x1a6651,_0x30a2cf){var _0x592d62,_0x324c23,_0x2c96fd;var _0x48767a=[];var _0x5ebb29={};var _0x1e7e63=_0x1a6651[_0x8291('0xbc')]||[];var _0x1e0995=[];var _0x547a07;return db['CmContact']['describe']()['then'](function(_0x3cc485){if(!_0x3cc485){throw new db[(_0x8291('0x83'))][(_0x8291('0x84'))](_0x8291('0x85'));}_0x48767a=_[_0x8291('0xbd')](_[_0x8291('0x38')](_0x3cc485),[_0x8291('0x86'),'updatedAt',_0x8291('0x87'),'ListId']);if(_0x1a6651[_0x8291('0x4d')]['id']){delete _0x1a6651[_0x8291('0x4d')]['id'];}if(_[_0x8291('0x72')](_0x1a6651[_0x8291('0x4d')]['from'])){throw _0x30a2cf[_0x8291('0x20')](0x1f4)['send'](new db[(_0x8291('0x83'))][(_0x8291('0x84'))](_0x8291('0xbe')));}if(_[_0x8291('0x72')](_0x1a6651[_0x8291('0x4d')][_0x8291('0x4d')])||_0x1a6651[_0x8291('0x4d')][_0x8291('0x4d')]===''){throw _0x30a2cf[_0x8291('0x20')](0x1f4)[_0x8291('0xbf')](new db[(_0x8291('0x83'))]['ValidationError'](_0x8291('0xc0')));}if(_[_0x8291('0x72')](_0x1a6651['body'][_0x8291('0xc1')])){throw _0x30a2cf['status'](0x1f4)[_0x8291('0xbf')](new db['Sequelize'][(_0x8291('0x84'))](_0x8291('0xc2')+_0x48767a));}if(!_[_0x8291('0x8b')](_0x48767a,_0x1a6651['body']['mapKeyOffline'])){throw _0x30a2cf[_0x8291('0x20')](0x1f4)[_0x8291('0xbf')](new db[(_0x8291('0x83'))][(_0x8291('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48767a));}_0x5ebb29[_0x1a6651[_0x8291('0x4d')][_0x8291('0xc1')]]=_0x1a6651['body'][_0x8291('0x88')];})[_0x8291('0x14')](function(){return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x1a6651[_0x8291('0x4b')]['id']},'include':[{'model':db[_0x8291('0x8d')],'as':'List'},{'model':db['MailAccount'],'as':_0x8291('0xc3')}]});})[_0x8291('0x14')](handleEntityNotFound(_0x30a2cf,null))['then'](function(_0x2d3c11){if(_0x2d3c11&&_0x2d3c11[_0x8291('0x8e')]){_0x324c23=_0x2d3c11;var _0xfc57f8=_[_0x8291('0xb')](_0x1a6651[_0x8291('0x4d')],{'firstName':_0x1a6651[_0x8291('0x4d')][_0x8291('0x88')],'phone':_0x1a6651[_0x8291('0x4d')][_0x8291('0x88')],'ListId':_0x2d3c11[_0x8291('0xc4')]});_0xfc57f8[_0x1a6651['body'][_0x8291('0xc1')]]=_0x1a6651[_0x8291('0x4d')][_0x8291('0x88')];return db[_0x8291('0x82')][_0x8291('0xc5')]({'where':_0x5ebb29,'defaults':_0xfc57f8});}})['spread'](function(_0x5d01fd){if(_0x5d01fd){_0x2c96fd=_0x5d01fd;var _0xdfe5f8=fs['readFileSync'](path[_0x8291('0x73')](config[_0x8291('0x6e')],_0x8291('0xc6')),'utf8');var _0x224acc=ejs[_0x8291('0xc7')](_0xdfe5f8,{'body':_[_0x8291('0xc8')](_0x1a6651['body']['body']),'bodyTitle':_0x324c23[_0x8291('0xc9')]});return db[_0x8291('0xca')][_0x8291('0x53')]({'body':_0x224acc,'plainBody':htmlToText[_0x8291('0xcb')](_0x224acc),'ContactId':_0x5d01fd['id'],'ChatWebsiteId':_0x324c23['id']});}})[_0x8291('0x14')](function(_0x31d071){_0x547a07=_0x31d071;if(_0x1e7e63['length']){var _0x355f4b=_0x1e7e63[_0x8291('0x31')](function(_0xd42789){return{'name':_0xd42789[_0x8291('0xcc')],'basename':_0xd42789[_0x8291('0x68')],'type':_0xd42789['mimetype'],'ChatOfflineMessageId':_0x31d071['id']};});_0x1e0995=_0x355f4b[_0x8291('0x31')](_0x2b7327=>{var _0x21a57a={'filename':_0x2b7327[_0x8291('0x2e')],'path':path[_0x8291('0x73')](config[_0x8291('0x6e')],_0x8291('0xcd'),_0x8291('0xbc'),'attachments',_0x8291('0xce'),_0x2b7327[_0x8291('0xcf')])};return _0x21a57a;});if(!_0x324c23[_0x8291('0xd0')]){return db[_0x8291('0xd1')]['transaction'](function(_0x3208cf){return db[_0x8291('0xd2')][_0x8291('0xd3')](_0x355f4b,{'transaction':_0x3208cf});});}}})[_0x8291('0x14')](function(){if(_0x547a07){_0x592d62=_0x547a07;return db['MailAccount'][_0x8291('0x59')]({'where':{'service':!![]},'include':[{'model':db[_0x8291('0xd4')],'as':_0x8291('0xd5'),'raw':!![],'include':[{'model':db[_0x8291('0xd6')],'as':_0x8291('0xd6'),'raw':!![]}]}]});}})[_0x8291('0x14')](function(_0x5cfb00){if(_0x5cfb00&&_0x5cfb00['Smtp']&&_0x324c23[_0x8291('0xd7')]&&_0x324c23[_0x8291('0xd8')]){var _0xb8685c=_0x5cfb00[_0x8291('0xd9')]();return respondWithRpcPromise(_0x8291('0xda'),_0x8291('0xdb'),{'account':_0xb8685c,'message':{'from':util[_0x8291('0xa0')](_0x8291('0xdc'),_0x5cfb00[_0x8291('0x2e')],_0x5cfb00[_0x8291('0xdd')]||_0x5cfb00['Smtp'][_0x8291('0xde')]),'to':_0x324c23['forwardOfflineAddress'],'subject':_0x324c23['offlineMessageSubject'],'html':_0x592d62['body'],'attachments':_0x1e0995}},client9003)[_0x8291('0x14')](function(){return _0x592d62;})[_0x8291('0x1e')](function(_0x465b7a){logger['error'](_0x465b7a);});}})[_0x8291('0x14')](function(){if(_0x324c23&&_0x324c23[_0x8291('0xd0')]&&_0x324c23[_0x8291('0xdf')]){var _0x536421=[];if(_0x1e7e63[_0x8291('0x3d')]){_0x536421=_0x1e7e63[_0x8291('0x31')](function(_0x7cb79d){return{'name':_0x7cb79d[_0x8291('0xcc')],'basename':_0x7cb79d[_0x8291('0x68')],'type':_0x7cb79d['mimetype'],'ChatOfflineMessageId':_0x547a07['id']};});}var _0x4ba89a;if(!_[_0x8291('0x72')](_0x324c23[_0x8291('0xe0')])){var _0x49c4c1=_['map'](_0x1a6651[_0x8291('0x4d')],function(_0x2cc03d){return _0x2cc03d;});var _0x47820b=_[_0x8291('0xe1')](_0x49c4c1)[0x0];var _0x921bb2=_['mapValues'](_0x47820b,function(_0x2807dd){return _0x2807dd;});_0x4ba89a=_0x921bb2[0x1][_0x324c23[_0x8291('0xe0')]];}var _0x6ad477={'from':_0x2c96fd[_0x8291('0xdd')],'firstName':_0x2c96fd[_0x8291('0xaa')],'lastName':_0x2c96fd[_0x8291('0x9c')],'mapKey':'email','message':{'from':_0x2c96fd[_0x8291('0xdd')],'to':_0x324c23[_0x8291('0xc3')][_0x8291('0xdd')],'cc':'','subject':_[_0x8291('0x72')](_0x4ba89a)?_0x324c23[_0x8291('0xe2')]:_0x4ba89a,'messageId':'','sentAt':new Date(),'attach':_0x536421[_0x8291('0x3d')],'attachments':_0x536421,'originChannel':_0x8291('0xe3'),'ChatWebsiteId':_0x324c23['id'],'ChatOfflineMessageId':_0x592d62['id'],'originTo':_0x324c23[_0x8291('0xc3')][_0x8291('0xdd')]},'body':_0x592d62[_0x8291('0x4d')]};var _0x30f278={'account':{'id':_0x324c23[_0x8291('0xdf')]},'body':_0x6ad477,'log':_0x8291('0xe4')};return respondWithRpcPromise(_0x8291('0xe4'),_0x8291('0xe5'),_0x30f278,client9001)[_0x8291('0x14')](function(){return _0x592d62;})['catch'](function(_0x4aa20b){logger[_0x8291('0x1a')](_0x4aa20b);});}return;})['then'](function(){if(_0x592d62){return _0x592d62;}})['then'](respondWithResult(_0x30a2cf,null))[_0x8291('0x1e')](function(_0x48b521){logger[_0x8291('0x1a')](_0x8291('0x1e'),_0x48b521);for(var _0x249a40 of _0x1e7e63){var _0x3adb84=path[_0x8291('0x73')](config['root'],_0x8291('0xcd'),_0x8291('0xbc'),_0x8291('0xe6'),_0x8291('0xce'),_0x249a40[_0x8291('0x68')]);fs_extra['remove'](_0x3adb84)[_0x8291('0x1e')](function(_0x1b2f2f){logger[_0x8291('0x1a')](_0x8291('0xe7'),_0x3adb84,_0x1b2f2f);});}});};exports[_0x8291('0xe8')]=function(_0x56f387,_0x48e217){return db[_0x8291('0xa7')]['find']({'where':{'id':_0x56f387['params']['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x48e217,null))[_0x8291('0x14')](function(_0x3a4de9){if(_0x3a4de9){return _0x3a4de9[_0x8291('0xe8')](_0x56f387[_0x8291('0x4d')]['ids'],_[_0x8291('0xe9')](_0x56f387['body'],[_0x8291('0x5d'),'id'])||{});}})[_0x8291('0x14')](respondWithResult(_0x48e217,null))['catch'](handleError(_0x48e217,null));};exports[_0x8291('0xea')]=function(_0x4c46d0,_0x2ddd02){var _0x232543={'raw':![],'where':{}};var _0x3d420d={};var _0x1c4b87={'count':0x0,'rows':[]};return db[_0x8291('0x32')][_0x8291('0x59')]({'where':{'id':_0x4c46d0[_0x8291('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ddd02,null))[_0x8291('0x14')](function(_0x296b93){if(_0x296b93){_0x3d420d['model']=_['keys'](db[_0x8291('0xa7')][_0x8291('0x5a')]);_0x3d420d[_0x8291('0x37')]=_[_0x8291('0x38')](_0x4c46d0[_0x8291('0x37')]);_0x3d420d[_0x8291('0x39')]=_[_0x8291('0x3a')](_0x3d420d[_0x8291('0x36')],_0x3d420d[_0x8291('0x37')]);_0x232543[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x3d420d[_0x8291('0x36')],qs['fields'](_0x4c46d0[_0x8291('0x37')][_0x8291('0x3c')]));_0x232543[_0x8291('0x3b')]=_0x232543[_0x8291('0x3b')][_0x8291('0x3d')]?_0x232543['attributes']:_0x3d420d[_0x8291('0x36')];if(!_0x4c46d0['query'][_0x8291('0x3e')](_0x8291('0x3f'))){_0x232543['limit']=qs[_0x8291('0x25')](_0x4c46d0[_0x8291('0x37')][_0x8291('0x25')]);_0x232543['offset']=qs[_0x8291('0x23')](_0x4c46d0['query'][_0x8291('0x23')]);}_0x232543['order']=qs[_0x8291('0x41')](_0x4c46d0['query']['sort']);_0x232543[_0x8291('0x42')]=qs[_0x8291('0x39')](_[_0x8291('0x60')](_0x4c46d0[_0x8291('0x37')],_0x3d420d[_0x8291('0x39')]));_0x232543['where'][_0x8291('0x5b')]=_0x296b93['id'];if(_0x4c46d0[_0x8291('0x37')][_0x8291('0x43')]){_0x232543[_0x8291('0x42')]=_[_0x8291('0x44')](_0x232543[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0x232543[_0x8291('0x3b')],function(_0x41d8ef){var _0x3b71a8={};_0x3b71a8[_0x41d8ef]={'$like':'%'+_0x4c46d0['query'][_0x8291('0x43')]+'%'};return _0x3b71a8;})});}_0x232543=_[_0x8291('0x44')]({},_0x232543,_0x4c46d0['options']);return db['ChatInteraction'][_0x8291('0x26')]({'where':_0x232543['where']})[_0x8291('0x14')](function(_0x218d42){_0x1c4b87['count']=_0x218d42;if(_0x4c46d0['query'][_0x8291('0x47')]){_0x232543['include']=[{'model':db[_0x8291('0x82')],'as':_0x8291('0xeb'),'required':![]},{'model':db[_0x8291('0xb3')],'as':_0x8291('0xec'),'attributes':[_0x8291('0x2e'),_0x8291('0xed'),_0x8291('0xee')],'required':![]},{'model':db['Tag'],'as':_0x8291('0xef'),'attributes':['id',_0x8291('0x2e'),_0x8291('0xf0')],'where':_0x4c46d0[_0x8291('0x37')]['tag']?{'id':_0x4c46d0[_0x8291('0x37')]['tag']}:undefined,'required':_0x4c46d0[_0x8291('0x37')]['tag']?!![]:![]}];}return db[_0x8291('0xa7')]['findAll'](_0x232543);})['then'](function(_0x1779ec){_0x1c4b87[_0x8291('0x61')]=_0x1779ec;return _0x1c4b87;});}})['then'](respondWithFilteredResult(_0x2ddd02,_0x232543))[_0x8291('0x1e')](handleError(_0x2ddd02,null));};function iftimePromise(_0x34b78e,_0x4a7a74){return respondWithRpcPromise(_0x8291('0xf1'),_0x8291('0xf2'),{'command':_0x4a7a74[_0x8291('0xf3')]?util[_0x8291('0xa0')]('iftime\x20%s,%s',_0x34b78e[_0x8291('0xf4')],_0x4a7a74[_0x8291('0xf3')]):util['format'](_0x8291('0xf5'),_0x34b78e[_0x8291('0xf4')])},client9002)['then'](function(_0x187162){var _0x2767b4=_0x187162&&_0x187162[_0x8291('0xf6')](_0x8291('0xf7'))>=0x0?!![]:![];logger['info'](_0x8291('0xf8'),_0x4a7a74['id'],_0x34b78e['id'],_0x34b78e[_0x8291('0xf4')],_0x2767b4?_0x8291('0xf9'):_0x8291('0xfa'),_0x4a7a74[_0x8291('0xf3')]?_0x4a7a74[_0x8291('0xf3')]:_0x8291('0xfb'));return _0x2767b4;})[_0x8291('0x1e')](function(_0x4ef242){logger[_0x8291('0x1a')](_0x8291('0xf8'),_0x4a7a74['id'],_0x34b78e['id'],_0x34b78e[_0x8291('0xf4')],util[_0x8291('0xfc')](_0x4ef242,{'showHidden':![],'depth':null}),_0x4a7a74['timezone']?_0x4a7a74[_0x8291('0xf3')]:_0x8291('0xfb'));return![];});}exports[_0x8291('0xf2')]=function(_0x378616,_0xe0a5a4){var _0x38500f=0x0;var _0x552dfd=0x0;var _0x3b94d=![];var _0x75d824;var _0x5b394a;return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x378616['params']['id']},'include':[{'model':db[_0x8291('0xfd')],'as':_0x8291('0xfd'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0xe0a5a4,null))['then'](function(_0x5ab6a4){if(_0x5ab6a4){_0x75d824=_0x5ab6a4;return _0x5ab6a4[_0x8291('0xfe')]({'raw':!![]});}})[_0x8291('0x14')](function(_0x391966){if(_0x75d824){if(_0x391966){_0x5b394a=_0x391966;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x323f8c){if(_0x323f8c){_0x552dfd=_0x323f8c[_0x8291('0xff')];_0x3b94d=_0x323f8c[_0x8291('0x71')];}})['then'](function(){return db[_0x8291('0xa7')][_0x8291('0x26')]({'where':{'closed':![]}});})[_0x8291('0x14')](function(_0x15116f){_0x38500f=_0x15116f;if(_0x552dfd&&_0x15116f>_0x552dfd){return db[_0x8291('0x100')][_0x8291('0x59')]({'where':{'id':0x1}})['then'](function(_0x13c66b){if(_0x13c66b){_0x13c66b[_0x8291('0x101')](_0x8291('0x102'));}});}})['then'](function(){if(_0x75d824[_0x8291('0xfd')]&&_0x75d824[_0x8291('0xfd')]['Intervals']){var _0xcff983=[];for(var _0x2a5840=0x0;_0x2a5840<_0x75d824[_0x8291('0xfd')][_0x8291('0x103')][_0x8291('0x3d')];_0x2a5840++){var _0x3b31f9=_0x75d824[_0x8291('0xfd')]['Intervals'][_0x2a5840][_0x8291('0x2b')]({'plain':!![]});_0xcff983[_0x8291('0xae')](iftimePromise(_0x3b31f9,_0x75d824));}return BPromise['all'](_0xcff983)['then'](function(_0x22b86e){return _['some'](_0x22b86e);});}else{return!![];}})[_0x8291('0x14')](function(_0x59c1fd){var _0x1d3bbe=fs['readFileSync'](path[_0x8291('0x73')](config[_0x8291('0x6e')],'server/files/chat/iframe.ejs'),_0x8291('0x104'));var _0x5d2feb={'remote':_0x75d824['remote'],'query':querystring[_0x8291('0x19')](_['merge'](_0x75d824[_0x8291('0x2b')]({'plain':!![]}),{'customerIp':_0x378616[_0x8291('0x7f')][_0x8291('0x9a')]||_0x378616[_0x8291('0x7f')][_0x8291('0x105')]||_0x378616[_0x8291('0x106')][_0x8291('0x107')]||_0x378616['ip'],'referer':_0x378616['headers']['referer'],'openedInteractions':_0x38500f,'maxInteractions':_0x552dfd,'virtual':_0x3b94d['virtual'],'online':_0x59c1fd,'custom':_0x3b94d}))[_0x8291('0x108')](/'/g,'\x5c\x27')};_0xe0a5a4[_0x8291('0xbf')](ejs[_0x8291('0xc7')](Mustache[_0x8291('0xc7')](_0x1d3bbe,_0x5d2feb),{'proactiveActions':_0x5b394a,'alignment':_0x75d824[_0x8291('0x109')],'verticalAlignment':_0x75d824[_0x8291('0x10a')],'div_color':_0x75d824['color'],'labelText':_0x75d824[_0x8291('0x10b')],'text_color':_0x75d824[_0x8291('0x10c')],'text_button_color':_0x75d824[_0x8291('0x10d')],'button_color':_0x75d824['color_button'],'background_color':_0x75d824['backgroundColor'],'hideWhenOffline':_0x75d824[_0x8291('0x10e')],'interval':_0x75d824['IntervalId']}));})['catch'](handleError(_0xe0a5a4,null));};exports['addApplications']=function(_0x280e20,_0x17f890){var _0x4d6de7=_0x280e20[_0x8291('0x4b')]['id'];var _0x559e3c=_0x280e20[_0x8291('0x4d')];var _0x20f149=0xc8;var _0xb393e3=null;return db['sequelize'][_0x8291('0x10f')]({'isolationLevel':db['sequelize']['Transaction'][_0x8291('0x110')]['READ_COMMITTED']},function(_0x3d319b){return db[_0x8291('0x32')]['findOne']({'where':{'id':_0x4d6de7},'transaction':_0x3d319b})[_0x8291('0x14')](function(_0x308690){if(_0x308690){return db['ChatApplication'][_0x8291('0x2a')]({'where':{'ChatWebsiteId':_0x4d6de7},'transaction':_0x3d319b})['then'](function(){var _0x179318=_['map'](_0x559e3c,function(_0x2d6a63){_0x2d6a63[_0x8291('0x5b')]=_0x4d6de7;return _0x2d6a63;});return db[_0x8291('0x111')][_0x8291('0xd3')](_0x179318,{'transaction':_0x3d319b});});}else{_0x20f149=0x194;_0xb393e3=[];}});})['then'](function(){if(_0x20f149!==0x194){return db[_0x8291('0x111')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4d6de7},'order':_0x8291('0x95')})[_0x8291('0x14')](function(_0x1b26ca){_0xb393e3=_0x1b26ca;});}})[_0x8291('0x1e')](function(_0x506537){_0x20f149=0x1f4;logger[_0x8291('0x1a')](_0x506537[_0x8291('0x112')]);if(_0x506537[_0x8291('0x2e')]){delete _0x506537[_0x8291('0x2e')];}_0xb393e3=_0x506537;})['finally'](function(){if(_0xb393e3===null){_0x17f890[_0x8291('0x1f')](_0x20f149);}else{if(_0x20f149===0x1f4){_0x17f890['status'](_0x20f149)[_0x8291('0xbf')](_0xb393e3);}else{_0x17f890['status'](_0x20f149)[_0x8291('0x22')](_0xb393e3);}}});};exports[_0x8291('0x113')]=function(_0x5c8e85,_0x904fa5){var _0x2918ef={};var _0x4219c7={};var _0x5ef593;var _0x211051;return db[_0x8291('0x32')][_0x8291('0x59')]({'where':{'id':_0x5c8e85[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x904fa5,null))['then'](function(_0x35607a){if(_0x35607a){_0x5ef593=_0x35607a;_0x4219c7[_0x8291('0x36')]=_[_0x8291('0x38')](db[_0x8291('0x111')]['rawAttributes']);_0x4219c7[_0x8291('0x37')]=_[_0x8291('0x38')](_0x5c8e85[_0x8291('0x37')]);_0x4219c7[_0x8291('0x39')]=_[_0x8291('0x3a')](_0x4219c7[_0x8291('0x36')],_0x4219c7[_0x8291('0x37')]);_0x2918ef[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x4219c7['model'],qs[_0x8291('0x3c')](_0x5c8e85[_0x8291('0x37')]['fields']));_0x2918ef[_0x8291('0x3b')]=_0x2918ef[_0x8291('0x3b')][_0x8291('0x3d')]?_0x2918ef[_0x8291('0x3b')]:_0x4219c7[_0x8291('0x36')];_0x2918ef['order']=qs[_0x8291('0x41')](_0x5c8e85[_0x8291('0x37')][_0x8291('0x41')]);_0x2918ef[_0x8291('0x42')]=qs[_0x8291('0x39')](_[_0x8291('0x60')](_0x5c8e85[_0x8291('0x37')],_0x4219c7['filters']));if(_0x5c8e85[_0x8291('0x37')][_0x8291('0x43')]){_0x2918ef[_0x8291('0x42')]=_['merge'](_0x2918ef[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0x2918ef['attributes'],function(_0x171792){var _0x4df97d={};_0x4df97d[_0x171792]={'$like':'%'+_0x5c8e85['query'][_0x8291('0x43')]+'%'};return _0x4df97d;})});}_0x2918ef=_[_0x8291('0x44')]({},_0x2918ef,_0x5c8e85[_0x8291('0x46')]);return _0x5ef593[_0x8291('0x113')](_0x2918ef);}})[_0x8291('0x14')](function(_0x18276b){if(_0x18276b){_0x211051=_0x18276b[_0x8291('0x3d')];if(!_0x5c8e85[_0x8291('0x37')][_0x8291('0x3e')]('nolimit')){_0x2918ef[_0x8291('0x25')]=qs[_0x8291('0x25')](_0x5c8e85['query'][_0x8291('0x25')]);_0x2918ef[_0x8291('0x23')]=qs[_0x8291('0x23')](_0x5c8e85[_0x8291('0x37')][_0x8291('0x23')]);}return _0x5ef593[_0x8291('0x113')](_0x2918ef);}})[_0x8291('0x14')](function(_0x5bba97){if(_0x5bba97){return _0x5bba97?{'count':_0x211051,'rows':_0x5bba97}:null;}})[_0x8291('0x14')](respondWithResult(_0x904fa5,null))['catch'](handleError(_0x904fa5,null));};exports[_0x8291('0x114')]=function(_0x4b70d6,_0x5f1d1d){return db['chatProactiveAction'][_0x8291('0x4c')]({'where':{'id':_0x4b70d6[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x5f1d1d,null))[_0x8291('0x14')](function(_0x6f1c45){if(_0x6f1c45){return _0x6f1c45[_0x8291('0x114')](_0x4b70d6[_0x8291('0x4d')][_0x8291('0x5d')],_[_0x8291('0xe9')](_0x4b70d6[_0x8291('0x4d')],[_0x8291('0x5d'),'id'])||{});}})[_0x8291('0x14')](respondWithResult(_0x5f1d1d,null))[_0x8291('0x1e')](handleError(_0x5f1d1d,null));};exports[_0x8291('0xfe')]=function(_0x12fa8b,_0x38b9ae){var _0x394953={};var _0x38cc75={};var _0x2e68f5;var _0x1a21bb;return db[_0x8291('0x32')]['findOne']({'where':{'id':_0x12fa8b['params']['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x38b9ae,null))['then'](function(_0x1cb4c6){if(_0x1cb4c6){_0x2e68f5=_0x1cb4c6;_0x38cc75[_0x8291('0x36')]=_[_0x8291('0x38')](db[_0x8291('0x115')]['rawAttributes']);_0x38cc75[_0x8291('0x37')]=_[_0x8291('0x38')](_0x12fa8b['query']);_0x38cc75[_0x8291('0x39')]=_[_0x8291('0x3a')](_0x38cc75[_0x8291('0x36')],_0x38cc75[_0x8291('0x37')]);_0x394953['attributes']=_[_0x8291('0x3a')](_0x38cc75[_0x8291('0x36')],qs[_0x8291('0x3c')](_0x12fa8b[_0x8291('0x37')]['fields']));_0x394953['attributes']=_0x394953[_0x8291('0x3b')][_0x8291('0x3d')]?_0x394953[_0x8291('0x3b')]:_0x38cc75['model'];_0x394953['order']=qs[_0x8291('0x41')](_0x12fa8b[_0x8291('0x37')]['sort']);_0x394953[_0x8291('0x42')]=qs['filters'](_[_0x8291('0x60')](_0x12fa8b[_0x8291('0x37')],_0x38cc75['filters']));if(_0x12fa8b[_0x8291('0x37')]['filter']){_0x394953['where']=_[_0x8291('0x44')](_0x394953['where'],{'$or':_['map'](_0x394953[_0x8291('0x3b')],function(_0x570fa4){var _0x3ae8c9={};_0x3ae8c9[_0x570fa4]={'$like':'%'+_0x12fa8b['query'][_0x8291('0x43')]+'%'};return _0x3ae8c9;})});}_0x394953=_['merge']({},_0x394953,_0x12fa8b[_0x8291('0x46')]);return _0x2e68f5[_0x8291('0xfe')](_0x394953);}})[_0x8291('0x14')](function(_0x12aa67){if(_0x12aa67){_0x1a21bb=_0x12aa67[_0x8291('0x3d')];if(!_0x12fa8b[_0x8291('0x37')][_0x8291('0x3e')](_0x8291('0x3f'))){_0x394953[_0x8291('0x25')]=qs[_0x8291('0x25')](_0x12fa8b[_0x8291('0x37')]['limit']);_0x394953[_0x8291('0x23')]=qs[_0x8291('0x23')](_0x12fa8b[_0x8291('0x37')][_0x8291('0x23')]);}return _0x2e68f5[_0x8291('0xfe')](_0x394953);}})[_0x8291('0x14')](function(_0x23e089){if(_0x23e089){return _0x23e089?{'count':_0x1a21bb,'rows':_0x23e089}:null;}})[_0x8291('0x14')](respondWithResult(_0x38b9ae,null))['catch'](handleError(_0x38b9ae,null));};exports[_0x8291('0x116')]=function(_0x4380a3,_0x7b21ce){var _0x9aae4e=_0x4380a3['query'][_0x8291('0x117')]===_0x8291('0x118')?_0x8291('0x119'):_0x8291('0x11a');return db[_0x8291('0x32')]['find']({'attributes':['id',_0x9aae4e],'where':{'id':_0x4380a3[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x7b21ce,null))[_0x8291('0x14')](function(_0x4c8755){if(_0x4c8755){var _0x5c26f8=_0x4c8755[_0x9aae4e];var _0x24b82f=_0x5c26f8&&_0x5c26f8['items']?_0x5c26f8[_0x8291('0x11b')]:[];_0x7b21ce['send']({'fromKey':_[_0x8291('0x72')](_0x5c26f8['fromKey'])?undefined:_0x5c26f8['fromKey'],'count':_0x24b82f[_0x8291('0x3d')],'rows':_0x24b82f});}})[_0x8291('0x1e')](handleError(_0x7b21ce,null));};exports[_0x8291('0x11c')]=function(_0x108d97,_0x359136){var _0x535543={'raw':![],'where':{}};var _0x8b966c={};var _0x2c8e8a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x108d97['params']['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x359136,null))['then'](function(_0x440b18){if(_0x440b18){_0x8b966c['model']=_['keys'](db[_0x8291('0xca')]['rawAttributes']);_0x8b966c[_0x8291('0x37')]=_[_0x8291('0x38')](_0x108d97[_0x8291('0x37')]);_0x8b966c['filters']=_[_0x8291('0x3a')](_0x8b966c['model'],_0x8b966c[_0x8291('0x37')]);_0x535543[_0x8291('0x3b')]=_[_0x8291('0x3a')](_0x8b966c[_0x8291('0x36')],qs[_0x8291('0x3c')](_0x108d97[_0x8291('0x37')]['fields']));_0x535543['attributes']=_0x535543[_0x8291('0x3b')][_0x8291('0x3d')]?_0x535543[_0x8291('0x3b')]:_0x8b966c['model'];if(!_0x108d97[_0x8291('0x37')][_0x8291('0x3e')](_0x8291('0x3f'))){_0x535543[_0x8291('0x25')]=qs[_0x8291('0x25')](_0x108d97[_0x8291('0x37')][_0x8291('0x25')]);_0x535543[_0x8291('0x23')]=qs['offset'](_0x108d97[_0x8291('0x37')][_0x8291('0x23')]);}_0x535543['order']=qs[_0x8291('0x41')](_0x108d97[_0x8291('0x37')][_0x8291('0x41')]);_0x535543['where']=qs[_0x8291('0x39')](_[_0x8291('0x60')](_0x108d97[_0x8291('0x37')],_0x8b966c[_0x8291('0x39')]));_0x535543[_0x8291('0x42')][_0x8291('0x5b')]=_0x440b18['id'];if(_0x108d97[_0x8291('0x37')][_0x8291('0x43')]){_0x535543[_0x8291('0x42')]=_[_0x8291('0x44')](_0x535543[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0x535543[_0x8291('0x3b')],function(_0x42ce4d){var _0x4fd0e2={};_0x4fd0e2[_0x42ce4d]={'$like':'%'+_0x108d97[_0x8291('0x37')][_0x8291('0x43')]+'%'};return _0x4fd0e2;})});}_0x535543=_[_0x8291('0x44')]({},_0x535543,_0x108d97['options']);return db[_0x8291('0xca')][_0x8291('0x26')]({'where':_0x535543['where']})[_0x8291('0x14')](function(_0x56872f){_0x2c8e8a['count']=_0x56872f;if(_0x108d97[_0x8291('0x37')][_0x8291('0x47')]){_0x535543['include']=[{'all':!![]}];}else{_0x535543[_0x8291('0x48')]=[{'model':db[_0x8291('0x82')],'as':'Contact','required':![]},{'model':db[_0x8291('0xd2')],'as':'Attachments','required':![]}];}return db[_0x8291('0xca')][_0x8291('0x49')](_0x535543);})['then'](function(_0x54d9fd){_0x2c8e8a[_0x8291('0x61')]=_0x54d9fd;return _0x2c8e8a;});}})['then'](respondWithFilteredResult(_0x359136,_0x535543))[_0x8291('0x1e')](handleError(_0x359136,null));};exports[_0x8291('0x11d')]=function(_0x1043fc,_0x1b1e3a){return db[_0x8291('0x32')][_0x8291('0x4c')]({'where':{'id':_0x1043fc[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x1b1e3a,null))[_0x8291('0x14')](function(_0x53c265){if(_0x53c265){return _0x53c265[_0x8291('0x11d')](_0x1043fc['body'][_0x8291('0x5d')],_[_0x8291('0xe9')](_0x1043fc[_0x8291('0x4d')],['ids','id'])||{})['spread'](function(_0x2677fd){for(var _0x4475d9=0x0;_0x4475d9<_0x1043fc[_0x8291('0x4d')][_0x8291('0x5d')][_0x8291('0x3d')];_0x4475d9+=0x1){socket[_0x8291('0x11e')](_0x8291('0x11f'),{'UserId':Number(_0x1043fc[_0x8291('0x4d')][_0x8291('0x5d')][_0x4475d9]),'ChatWebsiteId':Number(_0x1043fc[_0x8291('0x4b')]['id'])});}return _0x2677fd;});}})['then'](respondWithResult(_0x1b1e3a,null))[_0x8291('0x1e')](handleError(_0x1b1e3a,null));};exports['removeAgents']=function(_0x3a34ad,_0x2fdc06){return db['ChatWebsite'][_0x8291('0x4c')]({'where':{'id':_0x3a34ad[_0x8291('0x4b')]['id']}})[_0x8291('0x14')](handleEntityNotFound(_0x2fdc06,null))[_0x8291('0x14')](function(_0x5c1c1c){if(_0x5c1c1c){return _0x5c1c1c[_0x8291('0x120')](_0x3a34ad['query'][_0x8291('0x5d')])[_0x8291('0x14')](function(){if(_[_0x8291('0x121')](_0x3a34ad[_0x8291('0x37')]['ids'])){for(var _0x513199=0x0;_0x513199<_0x3a34ad['query'][_0x8291('0x5d')][_0x8291('0x3d')];_0x513199+=0x1){socket[_0x8291('0x11e')](_0x8291('0x122'),{'UserId':Number(_0x3a34ad['query']['ids'][_0x513199]),'ChatWebsiteId':Number(_0x3a34ad[_0x8291('0x4b')]['id'])});}}else{socket[_0x8291('0x11e')](_0x8291('0x122'),{'UserId':Number(_0x3a34ad['query'][_0x8291('0x5d')]),'ChatWebsiteId':Number(_0x3a34ad[_0x8291('0x4b')]['id'])});}});}})[_0x8291('0x14')](respondWithStatusCode(_0x2fdc06,null))['catch'](handleError(_0x2fdc06,null));};exports[_0x8291('0x123')]=function(_0x597b53,_0x4f7b9c){var _0x3cc806={};var _0x4be0e5={};var _0x4f0acc;var _0x3af515;return db[_0x8291('0x32')][_0x8291('0x59')]({'where':{'id':_0x597b53[_0x8291('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f7b9c,null))[_0x8291('0x14')](function(_0x318f3f){if(_0x318f3f){_0x4f0acc=_0x318f3f;_0x4be0e5['model']=_[_0x8291('0x38')](db[_0x8291('0xb3')]['rawAttributes']);_0x4be0e5[_0x8291('0x37')]=_['keys'](_0x597b53[_0x8291('0x37')]);_0x4be0e5['filters']=_[_0x8291('0x3a')](_0x4be0e5[_0x8291('0x36')],_0x4be0e5['query']);_0x3cc806['attributes']=_[_0x8291('0x3a')](_0x4be0e5['model'],qs[_0x8291('0x3c')](_0x597b53[_0x8291('0x37')][_0x8291('0x3c')]));_0x3cc806[_0x8291('0x3b')]=_0x3cc806[_0x8291('0x3b')][_0x8291('0x3d')]?_0x3cc806['attributes']:_0x4be0e5[_0x8291('0x36')];_0x3cc806[_0x8291('0x40')]=qs[_0x8291('0x41')](_0x597b53[_0x8291('0x37')][_0x8291('0x41')]);_0x3cc806['where']=qs[_0x8291('0x39')](_['pick'](_0x597b53[_0x8291('0x37')],_0x4be0e5[_0x8291('0x39')]));if(_0x597b53[_0x8291('0x37')][_0x8291('0x43')]){_0x3cc806[_0x8291('0x42')]=_[_0x8291('0x44')](_0x3cc806[_0x8291('0x42')],{'$or':_[_0x8291('0x31')](_0x3cc806[_0x8291('0x3b')],function(_0x2dc164){var _0x1fdb4e={};_0x1fdb4e[_0x2dc164]={'$like':'%'+_0x597b53[_0x8291('0x37')][_0x8291('0x43')]+'%'};return _0x1fdb4e;})});}_0x3cc806=_[_0x8291('0x44')]({},_0x3cc806,_0x597b53['options']);return _0x4f0acc['getAgents'](_0x3cc806);}})[_0x8291('0x14')](function(_0x2caa9e){if(_0x2caa9e){_0x3af515=_0x2caa9e[_0x8291('0x3d')];if(!_0x597b53[_0x8291('0x37')]['hasOwnProperty'](_0x8291('0x3f'))){_0x3cc806[_0x8291('0x25')]=qs[_0x8291('0x25')](_0x597b53[_0x8291('0x37')]['limit']);_0x3cc806['offset']=qs['offset'](_0x597b53[_0x8291('0x37')][_0x8291('0x23')]);}return _0x4f0acc[_0x8291('0x123')](_0x3cc806);}})[_0x8291('0x14')](function(_0x1edd5c){if(_0x1edd5c){return _0x1edd5c?{'count':_0x3af515,'rows':_0x1edd5c}:null;}})['then'](respondWithResult(_0x4f7b9c,null))[_0x8291('0x1e')](handleError(_0x4f7b9c,null));}; \ No newline at end of file +var _0xee48=['custom','isNil','existsSync','join','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','x-real-port','browser','version','%s\x20%s','unknown','device','vendor','format','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','lastName','messageId','update','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','originalname','subjectOffline','Chat','MailAccountId','NotifyMailAccount','files','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','remoteAddress','referer','replace','alignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./chatWebsite.socket','html-to-text','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xee48,0x1e5));var _0x8ee4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xee48[_0x5f09c5];return _0x426ad9;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x8ee4('0x0'));var util=require(_0x8ee4('0x1'));var path=require(_0x8ee4('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ee4('0x3'));var querystring=require('querystring');var Redis=require(_0x8ee4('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x8ee4('0x5'))('api');var config=require(_0x8ee4('0x6'));var db=require(_0x8ee4('0x7'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8ee4('0x8'),'port':0x18eb});var socket=require(_0x8ee4('0x9'))(new Redis(config[_0x8ee4('0xa')]));require(_0x8ee4('0xb'))['register'](socket);var htmlToText=require(_0x8ee4('0xc'));var jayson=require(_0x8ee4('0xd'));var client=jayson['client'][_0x8ee4('0xe')]({'port':0x232c});var client9002=jayson[_0x8ee4('0xf')][_0x8ee4('0xe')]({'port':0x232a});var client9003=jayson[_0x8ee4('0xf')][_0x8ee4('0xe')]({'port':0x232b});var client9001=jayson[_0x8ee4('0xf')][_0x8ee4('0xe')]({'port':0x2329});function respondWithRpcPromise(_0x2e1070,_0x2f0cfb,_0x4d4876,_0x4fcefb){return new BPromise(function(_0x304ede,_0xdf10af){var _0x2f0d9c=_0x4fcefb||client;return _0x2f0d9c[_0x8ee4('0x10')](_0x2e1070,_0x4d4876)[_0x8ee4('0x11')](function(_0x2ba84c){logger['info'](_0x8ee4('0x12'),_0x2f0cfb,_0x8ee4('0x13'));logger[_0x8ee4('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2f0cfb,'request\x20sent',JSON['stringify'](_0x2ba84c));if(_0x2ba84c[_0x8ee4('0x15')]){if(_0x2ba84c[_0x8ee4('0x15')]['code']===0x1f4){logger['error'](_0x8ee4('0x12'),_0x2f0cfb,_0x2ba84c[_0x8ee4('0x15')][_0x8ee4('0x16')]);return _0xdf10af(_0x2ba84c[_0x8ee4('0x15')][_0x8ee4('0x16')]);}logger[_0x8ee4('0x15')](_0x8ee4('0x12'),_0x2f0cfb,_0x2ba84c[_0x8ee4('0x15')][_0x8ee4('0x16')]);return _0x304ede(_0x2ba84c[_0x8ee4('0x15')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2f0cfb,_0x8ee4('0x13'));_0x304ede(_0x2ba84c[_0x8ee4('0x17')][_0x8ee4('0x16')]);}})['catch'](function(_0x1dd938){logger[_0x8ee4('0x15')](_0x8ee4('0x12'),_0x2f0cfb,_0x1dd938);_0xdf10af(_0x1dd938);});});}function respondWithStatusCode(_0x4c5964,_0x5b4042){_0x5b4042=_0x5b4042||0xcc;return function(_0xdcaf91){if(_0xdcaf91){return _0x4c5964[_0x8ee4('0x18')](_0x5b4042);}return _0x4c5964[_0x8ee4('0x19')](_0x5b4042)[_0x8ee4('0x1a')]();};}function respondWithResult(_0x5dce9d,_0x3e4598){_0x3e4598=_0x3e4598||0xc8;return function(_0xaeb63b){if(_0xaeb63b){return _0x5dce9d[_0x8ee4('0x19')](_0x3e4598)[_0x8ee4('0x1b')](_0xaeb63b);}};}function respondWithFilteredResult(_0x1952ea,_0x57910c){return function(_0x327781){if(_0x327781){var _0x137368=typeof _0x57910c[_0x8ee4('0x1c')]==='undefined'&&typeof _0x57910c[_0x8ee4('0x1d')]===_0x8ee4('0x1e');var _0x3bf3ad=_0x327781[_0x8ee4('0x1f')];var _0x13304c=_0x137368?0x0:_0x57910c[_0x8ee4('0x1c')];var _0x14aa72=_0x137368?_0x327781['count']:_0x57910c[_0x8ee4('0x1c')]+_0x57910c[_0x8ee4('0x1d')];var _0x567d4e;if(_0x14aa72>=_0x3bf3ad){_0x14aa72=_0x3bf3ad;_0x567d4e=0xc8;}else{_0x567d4e=0xce;}_0x1952ea['status'](_0x567d4e);return _0x1952ea['set'](_0x8ee4('0x20'),_0x13304c+'-'+_0x14aa72+'/'+_0x3bf3ad)[_0x8ee4('0x1b')](_0x327781);}return null;};}function saveUpdates(_0x47a3aa){return function(_0x50c9ad){if(_0x50c9ad){return _0x50c9ad['update'](_0x47a3aa)[_0x8ee4('0x11')](function(_0x39abf5){return _0x39abf5;});}return null;};}function removeEntity(_0x52a162){return function(_0x47acd6){if(_0x47acd6){return _0x47acd6[_0x8ee4('0x21')]()['then'](function(){var _0x2728f4=_0x47acd6[_0x8ee4('0x22')]({'plain':!![]});var _0x259e84=_0x8ee4('0x23');return db[_0x8ee4('0x24')][_0x8ee4('0x21')]({'where':{'type':_0x259e84,'resourceId':_0x2728f4['id']}})['then'](function(){return _0x47acd6;});})[_0x8ee4('0x11')](function(){_0x52a162[_0x8ee4('0x19')](0xcc)[_0x8ee4('0x1a')]();});}};}function handleEntityNotFound(_0x18e2c6){return function(_0x182774){if(!_0x182774){_0x18e2c6['sendStatus'](0x194);}return _0x182774;};}function handleError(_0x23d712,_0x1d5cf2){_0x1d5cf2=_0x1d5cf2||0x1f4;return function(_0x429c7b){logger['error'](_0x429c7b[_0x8ee4('0x25')]);if(_0x429c7b[_0x8ee4('0x26')]){delete _0x429c7b[_0x8ee4('0x26')];}_0x23d712[_0x8ee4('0x19')](_0x1d5cf2)[_0x8ee4('0x27')](_0x429c7b);};}exports['index']=function(_0x2b21ee,_0x1c2f03){var _0x33e869={'include':[{'model':db[_0x8ee4('0x28')],'as':_0x8ee4('0x29')}]},_0x1b4f0d={},_0xc07607={'count':0x0,'rows':[]};var _0x4b1173=_[_0x8ee4('0x2a')](db[_0x8ee4('0x2b')][_0x8ee4('0x2c')],function(_0x227890){return{'name':_0x227890['fieldName'],'type':_0x227890[_0x8ee4('0x2d')][_0x8ee4('0x2e')]};});_0x1b4f0d[_0x8ee4('0x2f')]=_[_0x8ee4('0x2a')](_0x4b1173,_0x8ee4('0x26'));_0x1b4f0d[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x2b21ee[_0x8ee4('0x30')]);_0x1b4f0d[_0x8ee4('0x32')]=_['intersection'](_0x1b4f0d['model'],_0x1b4f0d[_0x8ee4('0x30')]);_0x33e869['attributes']=_[_0x8ee4('0x33')](_0x1b4f0d[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x2b21ee[_0x8ee4('0x30')]['fields']));_0x33e869[_0x8ee4('0x35')]=_0x33e869[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0x33e869[_0x8ee4('0x35')]:_0x1b4f0d[_0x8ee4('0x2f')];if(!_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x37')](_0x8ee4('0x38'))){_0x33e869[_0x8ee4('0x1d')]=qs[_0x8ee4('0x1d')](_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x1d')]);_0x33e869[_0x8ee4('0x1c')]=qs[_0x8ee4('0x1c')](_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x1c')]);}_0x33e869[_0x8ee4('0x39')]=qs[_0x8ee4('0x3a')](_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x3a')]);_0x33e869[_0x8ee4('0x3b')]=qs[_0x8ee4('0x32')](_[_0x8ee4('0x3c')](_0x2b21ee[_0x8ee4('0x30')],_0x1b4f0d[_0x8ee4('0x32')]),_0x4b1173);if(_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0x33e869[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0x33e869[_0x8ee4('0x3b')],{'$or':_[_0x8ee4('0x2a')](_0x4b1173,function(_0x2837db){if(_0x2837db['type']!=='VIRTUAL'){var _0x188515={};_0x188515[_0x2837db[_0x8ee4('0x26')]]={'$like':'%'+_0x2b21ee[_0x8ee4('0x30')][_0x8ee4('0x3d')]+'%'};return _0x188515;}})});}_0x33e869=_[_0x8ee4('0x3e')]({},_0x33e869,_0x2b21ee[_0x8ee4('0x3f')]);var _0x597923={'where':_0x33e869[_0x8ee4('0x3b')]};return db[_0x8ee4('0x2b')]['count'](_0x597923)[_0x8ee4('0x11')](function(_0x3d24fe){_0xc07607[_0x8ee4('0x1f')]=_0x3d24fe;if(_0x2b21ee['query'][_0x8ee4('0x40')]){_0x33e869[_0x8ee4('0x41')]=[{'all':!![]}];}return db[_0x8ee4('0x2b')]['findAll'](_0x33e869);})[_0x8ee4('0x11')](function(_0x44a4d7){_0xc07607[_0x8ee4('0x42')]=_0x44a4d7;return _0xc07607;})[_0x8ee4('0x11')](respondWithFilteredResult(_0x1c2f03,_0x33e869))[_0x8ee4('0x43')](handleError(_0x1c2f03,null));};exports['show']=function(_0x39ae4d,_0x5dd3a3){var _0x15bbb3={'raw':![],'where':{'id':_0x39ae4d[_0x8ee4('0x44')]['id']},'include':[{'model':db[_0x8ee4('0x28')],'as':_0x8ee4('0x29')}]},_0x1632f4={};_0x1632f4[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0x2b')][_0x8ee4('0x2c')]);_0x1632f4[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x39ae4d[_0x8ee4('0x30')]);_0x1632f4[_0x8ee4('0x32')]=_['intersection'](_0x1632f4[_0x8ee4('0x2f')],_0x1632f4[_0x8ee4('0x30')]);_0x15bbb3[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x1632f4[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x39ae4d['query'][_0x8ee4('0x34')]));_0x15bbb3[_0x8ee4('0x35')]=_0x15bbb3[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0x15bbb3[_0x8ee4('0x35')]:_0x1632f4[_0x8ee4('0x2f')];if(_0x39ae4d[_0x8ee4('0x30')][_0x8ee4('0x40')]){_0x15bbb3['include']=[{'all':!![]}];}_0x15bbb3=_[_0x8ee4('0x3e')]({},_0x15bbb3,_0x39ae4d[_0x8ee4('0x3f')]);return db[_0x8ee4('0x2b')][_0x8ee4('0x45')](_0x15bbb3)[_0x8ee4('0x11')](handleEntityNotFound(_0x5dd3a3,null))['then'](respondWithResult(_0x5dd3a3,null))[_0x8ee4('0x43')](handleError(_0x5dd3a3,null));};exports[_0x8ee4('0x46')]=function(_0x1ac8a7,_0x1ce543){return db['ChatWebsite'][_0x8ee4('0x46')](_0x1ac8a7['body'],{})['then'](function(_0x28024c){var _0x49eb69=_0x1ac8a7[_0x8ee4('0x47')]['get']({'plain':!![]});if(!_0x49eb69)throw new Error(_0x8ee4('0x48'));if(_0x49eb69[_0x8ee4('0x49')]===_0x8ee4('0x47')){var _0x4311f9=_0x28024c['get']({'plain':!![]});var _0x12608c=_0x8ee4('0x23');return db[_0x8ee4('0x4a')][_0x8ee4('0x45')]({'where':{'name':_0x12608c,'userProfileId':_0x49eb69[_0x8ee4('0x4b')]},'raw':!![]})[_0x8ee4('0x11')](function(_0x413057){if(_0x413057&&_0x413057[_0x8ee4('0x4c')]===0x0){return db[_0x8ee4('0x24')][_0x8ee4('0x46')]({'name':_0x4311f9[_0x8ee4('0x26')],'resourceId':_0x4311f9['id'],'type':_0x413057[_0x8ee4('0x26')],'sectionId':_0x413057['id']},{})[_0x8ee4('0x11')](function(){return _0x28024c;});}else{return _0x28024c;}})[_0x8ee4('0x43')](function(_0x7d27b1){logger['error'](_0x8ee4('0x4d'),_0x7d27b1);throw _0x7d27b1;});}return _0x28024c;})[_0x8ee4('0x11')](respondWithResult(_0x1ce543,0xc9))[_0x8ee4('0x43')](handleError(_0x1ce543,null));};exports['update']=function(_0x329a15,_0x9b14fe){if(_0x329a15[_0x8ee4('0x4e')]['id']){delete _0x329a15[_0x8ee4('0x4e')]['id'];}return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x329a15[_0x8ee4('0x44')]['id']},'include':[{'model':db[_0x8ee4('0x28')],'as':_0x8ee4('0x29')}]})['then'](handleEntityNotFound(_0x9b14fe,null))[_0x8ee4('0x11')](saveUpdates(_0x329a15[_0x8ee4('0x4e')],null))[_0x8ee4('0x11')](respondWithResult(_0x9b14fe,null))['catch'](handleError(_0x9b14fe,null));};exports[_0x8ee4('0x21')]=function(_0x4ad609,_0x240dfc){return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x4ad609['params']['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x240dfc,null))['then'](removeEntity(_0x240dfc,null))[_0x8ee4('0x43')](handleError(_0x240dfc,null));};exports[_0x8ee4('0x4f')]=function(_0x152451,_0x2fbc41){return db[_0x8ee4('0x2b')]['describe']()['then'](respondWithResult(_0x2fbc41,null))['catch'](handleError(_0x2fbc41,null));};exports[_0x8ee4('0x50')]=function(_0x17175a,_0x1aa862){if(_0x17175a[_0x8ee4('0x4e')]['id']){delete _0x17175a[_0x8ee4('0x4e')]['id'];}return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x17175a[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1aa862,null))['then'](function(_0x138444){if(_0x138444){_0x17175a[_0x8ee4('0x4e')][_0x8ee4('0x51')]=_0x138444['id'];return db[_0x8ee4('0x52')][_0x8ee4('0x46')](_0x17175a[_0x8ee4('0x4e')]);}})[_0x8ee4('0x11')](respondWithResult(_0x1aa862,null))[_0x8ee4('0x43')](handleError(_0x1aa862,null));};exports['getDispositions']=function(_0x5e12f2,_0x12361d){var _0x5e73a4={'raw':![],'where':{}};var _0x45200e={};var _0x31932f={'count':0x0,'rows':[]};return db[_0x8ee4('0x2b')][_0x8ee4('0x53')]({'where':{'id':_0x5e12f2[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x12361d,null))[_0x8ee4('0x11')](function(_0x5685e5){if(_0x5685e5){_0x45200e[_0x8ee4('0x2f')]=_['keys'](db['Disposition'][_0x8ee4('0x2c')]);_0x45200e[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x5e12f2['query']);_0x45200e[_0x8ee4('0x32')]=_['intersection'](_0x45200e[_0x8ee4('0x2f')],_0x45200e[_0x8ee4('0x30')]);_0x5e73a4[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x45200e['model'],qs[_0x8ee4('0x34')](_0x5e12f2['query'][_0x8ee4('0x34')]));_0x5e73a4['attributes']=_0x5e73a4[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0x5e73a4[_0x8ee4('0x35')]:_0x45200e[_0x8ee4('0x2f')];if(!_0x5e12f2[_0x8ee4('0x30')]['hasOwnProperty']('nolimit')){_0x5e73a4[_0x8ee4('0x1d')]=qs[_0x8ee4('0x1d')](_0x5e12f2[_0x8ee4('0x30')][_0x8ee4('0x1d')]);_0x5e73a4[_0x8ee4('0x1c')]=qs[_0x8ee4('0x1c')](_0x5e12f2['query'][_0x8ee4('0x1c')]);}_0x5e73a4[_0x8ee4('0x39')]=qs['sort'](_0x5e12f2['query'][_0x8ee4('0x3a')]);_0x5e73a4[_0x8ee4('0x3b')]=qs['filters'](_['pick'](_0x5e12f2[_0x8ee4('0x30')],_0x45200e['filters']));_0x5e73a4['where'][_0x8ee4('0x51')]=_0x5685e5['id'];if(_0x5e12f2[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0x5e73a4['where']=_[_0x8ee4('0x3e')](_0x5e73a4[_0x8ee4('0x3b')],{'$or':_[_0x8ee4('0x2a')](_0x5e73a4['attributes'],function(_0x1723e9){var _0x3d8992={};_0x3d8992[_0x1723e9]={'$like':'%'+_0x5e12f2[_0x8ee4('0x30')]['filter']+'%'};return _0x3d8992;})});}_0x5e73a4=_[_0x8ee4('0x3e')]({},_0x5e73a4,_0x5e12f2[_0x8ee4('0x3f')]);return db[_0x8ee4('0x52')][_0x8ee4('0x1f')]({'where':_0x5e73a4[_0x8ee4('0x3b')]})['then'](function(_0x431a65){_0x31932f['count']=_0x431a65;if(_0x5e12f2[_0x8ee4('0x30')][_0x8ee4('0x40')]){_0x5e73a4['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5e73a4);})[_0x8ee4('0x11')](function(_0x2a663c){_0x31932f['rows']=_0x2a663c;return _0x31932f;});}})[_0x8ee4('0x11')](respondWithFilteredResult(_0x12361d,_0x5e73a4))[_0x8ee4('0x43')](handleError(_0x12361d,null));};exports['removeDispositions']=function(_0x3751f8,_0xf98d1d){return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x3751f8[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0xf98d1d,null))[_0x8ee4('0x11')](function(_0x3c4e53){if(_0x3c4e53){return _0x3c4e53[_0x8ee4('0x54')](_0x3751f8[_0x8ee4('0x30')][_0x8ee4('0x55')]);}})[_0x8ee4('0x11')](respondWithStatusCode(_0xf98d1d,null))[_0x8ee4('0x43')](handleError(_0xf98d1d,null));};exports[_0x8ee4('0x56')]=function(_0x3e7872,_0x502d1b){if(_0x3e7872[_0x8ee4('0x4e')]['id']){delete _0x3e7872[_0x8ee4('0x4e')]['id'];}return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x3e7872[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x502d1b,null))[_0x8ee4('0x11')](function(_0x2e2c95){if(_0x2e2c95){_0x3e7872['body']['ChatWebsiteId']=_0x2e2c95['id'];return db['CannedAnswer'][_0x8ee4('0x46')](_0x3e7872[_0x8ee4('0x4e')]);}})['then'](respondWithResult(_0x502d1b,null))[_0x8ee4('0x43')](handleError(_0x502d1b,null));};exports[_0x8ee4('0x57')]=function(_0x156957,_0xf21684){var _0x1dba19={'raw':![],'where':{}};var _0xdaae87={};var _0x5c37d9={'count':0x0,'rows':[]};return db[_0x8ee4('0x2b')]['findOne']({'where':{'id':_0x156957['params']['id']}})['then'](handleEntityNotFound(_0xf21684,null))['then'](function(_0x258f15){if(_0x258f15){_0xdaae87[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0x58')][_0x8ee4('0x2c')]);_0xdaae87[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x156957[_0x8ee4('0x30')]);_0xdaae87[_0x8ee4('0x32')]=_['intersection'](_0xdaae87[_0x8ee4('0x2f')],_0xdaae87[_0x8ee4('0x30')]);_0x1dba19[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0xdaae87['model'],qs[_0x8ee4('0x34')](_0x156957[_0x8ee4('0x30')]['fields']));_0x1dba19[_0x8ee4('0x35')]=_0x1dba19['attributes'][_0x8ee4('0x36')]?_0x1dba19[_0x8ee4('0x35')]:_0xdaae87[_0x8ee4('0x2f')];if(!_0x156957[_0x8ee4('0x30')][_0x8ee4('0x37')]('nolimit')){_0x1dba19[_0x8ee4('0x1d')]=qs[_0x8ee4('0x1d')](_0x156957[_0x8ee4('0x30')]['limit']);_0x1dba19[_0x8ee4('0x1c')]=qs['offset'](_0x156957['query'][_0x8ee4('0x1c')]);}_0x1dba19[_0x8ee4('0x39')]=qs[_0x8ee4('0x3a')](_0x156957[_0x8ee4('0x30')][_0x8ee4('0x3a')]);_0x1dba19[_0x8ee4('0x3b')]=qs[_0x8ee4('0x32')](_[_0x8ee4('0x3c')](_0x156957[_0x8ee4('0x30')],_0xdaae87['filters']));_0x1dba19[_0x8ee4('0x3b')][_0x8ee4('0x51')]=_0x258f15['id'];if(_0x156957[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0x1dba19[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0x1dba19['where'],{'$or':_[_0x8ee4('0x2a')](_0x1dba19[_0x8ee4('0x35')],function(_0x5efc17){var _0x4f156d={};_0x4f156d[_0x5efc17]={'$like':'%'+_0x156957[_0x8ee4('0x30')][_0x8ee4('0x3d')]+'%'};return _0x4f156d;})});}_0x1dba19=_['merge']({},_0x1dba19,_0x156957[_0x8ee4('0x3f')]);return db[_0x8ee4('0x58')][_0x8ee4('0x1f')]({'where':_0x1dba19[_0x8ee4('0x3b')]})[_0x8ee4('0x11')](function(_0x5c9e09){_0x5c37d9['count']=_0x5c9e09;if(_0x156957[_0x8ee4('0x30')][_0x8ee4('0x40')]){_0x1dba19['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8ee4('0x59')](_0x1dba19);})['then'](function(_0xda907d){_0x5c37d9[_0x8ee4('0x42')]=_0xda907d;return _0x5c37d9;});}})['then'](respondWithFilteredResult(_0xf21684,_0x1dba19))[_0x8ee4('0x43')](handleError(_0xf21684,null));};exports[_0x8ee4('0x5a')]=function(_0x1d7eb2,_0x5f565e){return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x1d7eb2['params']['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x5f565e,null))['then'](function(_0x4df52f){if(_0x4df52f){return _0x4df52f[_0x8ee4('0x5a')](_0x1d7eb2[_0x8ee4('0x30')]['ids']);}})[_0x8ee4('0x11')](respondWithStatusCode(_0x5f565e,null))[_0x8ee4('0x43')](handleError(_0x5f565e,null));};exports[_0x8ee4('0x5b')]=function(_0x4355e5,_0x4c1f15){_0x4355e5['body'][_0x8ee4('0x5c')]=_0x4355e5[_0x8ee4('0x5d')][_0x8ee4('0x5e')];return db['ChatWebsite'][_0x8ee4('0x45')]({'where':{'id':_0x4355e5[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x4c1f15,null))[_0x8ee4('0x11')](saveUpdates(_0x4355e5['body'],null))[_0x8ee4('0x11')](respondWithResult(_0x4c1f15,null))[_0x8ee4('0x43')](handleError(_0x4c1f15,null));};exports[_0x8ee4('0x5f')]=function(_0x1a4395,_0x5ca2b1){_0x1a4395[_0x8ee4('0x4e')]['agentAvatar']=_0x1a4395['file'][_0x8ee4('0x5e')];return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x1a4395['params']['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x5ca2b1,null))['then'](saveUpdates(_0x1a4395[_0x8ee4('0x4e')],null))[_0x8ee4('0x11')](respondWithResult(_0x5ca2b1,null))[_0x8ee4('0x43')](handleError(_0x5ca2b1,null));};exports[_0x8ee4('0x60')]=function(_0x5842ec,_0x160302){_0x5842ec['body'][_0x8ee4('0x61')]=_0x5842ec[_0x8ee4('0x5d')][_0x8ee4('0x5e')];return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x5842ec[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x160302,null))[_0x8ee4('0x11')](saveUpdates(_0x5842ec[_0x8ee4('0x4e')],null))[_0x8ee4('0x11')](respondWithResult(_0x160302,null))[_0x8ee4('0x43')](handleError(_0x160302,null));};exports[_0x8ee4('0x62')]=function(_0x2138f2,_0x2be1db){_0x2138f2[_0x8ee4('0x4e')][_0x8ee4('0x63')]=_0x2138f2[_0x8ee4('0x5d')][_0x8ee4('0x5e')];return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x2138f2['params']['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x2be1db,null))[_0x8ee4('0x11')](saveUpdates(_0x2138f2['body'],null))['then'](respondWithResult(_0x2be1db,null))[_0x8ee4('0x43')](handleError(_0x2be1db,null));};exports[_0x8ee4('0x64')]=function(_0x4c361b,_0x3c155c){var _0x1c6ec7=path['join'](config[_0x8ee4('0x65')],_0x8ee4('0x66'));var _0xfe036f={'where':{'id':_0x4c361b[_0x8ee4('0x44')]['id']},'attributes':['id',_0x8ee4('0x5c')],'raw':!![]};var _0x161e8e=![];return require(_0x8ee4('0x67'))[_0x8ee4('0x68')]()['then'](function(_0x598cf9){if(_0x598cf9){_0x161e8e=_0x598cf9[_0x8ee4('0x69')];}})[_0x8ee4('0x11')](function(){return db[_0x8ee4('0x2b')][_0x8ee4('0x45')](_0xfe036f);})[_0x8ee4('0x11')](handleEntityNotFound(_0x3c155c,null))[_0x8ee4('0x11')](function(_0x47e59d){if(_0x47e59d){if(!_[_0x8ee4('0x6a')](_0x47e59d['sitepic'])){if(fs[_0x8ee4('0x6b')](path[_0x8ee4('0x6c')](config['root'],_0x8ee4('0x6d'),_0x47e59d[_0x8ee4('0x5c')]))&&_0x161e8e){_0x1c6ec7=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x6d'),_0x47e59d[_0x8ee4('0x5c')]);}}return _0x3c155c['download'](_0x1c6ec7);}})[_0x8ee4('0x43')](handleError(_0x3c155c,null));};exports['getAvatar']=function(_0x385fbd,_0x4ef750){var _0x48a320=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x6e'));var _0xc5bf2b={'where':{'id':_0x385fbd[_0x8ee4('0x44')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x8ee4('0x2b')][_0x8ee4('0x45')](_0xc5bf2b)[_0x8ee4('0x11')](handleEntityNotFound(_0x4ef750,null))['then'](function(_0x34bb56){if(_0x34bb56){if(!_[_0x8ee4('0x6a')](_0x34bb56[_0x8ee4('0x6f')])){if(fs['existsSync'](path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x70'),_0x34bb56['agentAvatar']))){_0x48a320=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x70'),_0x34bb56[_0x8ee4('0x6f')]);}}return _0x4ef750[_0x8ee4('0x71')](_0x48a320);}})[_0x8ee4('0x43')](handleError(_0x4ef750,null));};exports[_0x8ee4('0x72')]=function(_0x25af3f,_0x30c7b8){var _0x365b5d=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x73'));var _0x43181d={'where':{'id':_0x25af3f[_0x8ee4('0x44')]['id']},'attributes':['id',_0x8ee4('0x61'),_0x8ee4('0x74')],'raw':!![]};return db[_0x8ee4('0x2b')][_0x8ee4('0x45')](_0x43181d)[_0x8ee4('0x11')](handleEntityNotFound(_0x30c7b8,null))[_0x8ee4('0x11')](function(_0x3dcbac){if(_0x3dcbac){if(!_[_0x8ee4('0x6a')](_0x3dcbac[_0x8ee4('0x61')])){if(fs['existsSync'](path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x70'),_0x3dcbac[_0x8ee4('0x61')]))&&_0x3dcbac[_0x8ee4('0x74')]){_0x365b5d=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],'server/files/images/avatars/',_0x3dcbac[_0x8ee4('0x61')]);}}return _0x30c7b8[_0x8ee4('0x71')](_0x365b5d);}})[_0x8ee4('0x43')](handleError(_0x30c7b8,null));};exports[_0x8ee4('0x75')]=function(_0x10f08a,_0x249295){var _0x4fee8e=path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],'server/files/images/avatars/system_avatar.png');var _0xea23d4={'where':{'id':_0x10f08a[_0x8ee4('0x44')]['id']},'attributes':['id',_0x8ee4('0x63')],'raw':!![]};return db['ChatWebsite'][_0x8ee4('0x45')](_0xea23d4)['then'](handleEntityNotFound(_0x249295,null))[_0x8ee4('0x11')](function(_0x49eee5){if(_0x49eee5){if(!_[_0x8ee4('0x6a')](_0x49eee5['systemAvatar'])){if(fs['existsSync'](path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x70'),_0x49eee5['systemAvatar']))){_0x4fee8e=path[_0x8ee4('0x6c')](config['root'],'server/files/images/avatars/',_0x49eee5['systemAvatar']);}}return _0x249295['download'](_0x4fee8e);}})[_0x8ee4('0x43')](handleError(_0x249295,null));};exports['notify']=function(_0x33ea0a,_0x4176a2){var _0x4772d7=require(_0x8ee4('0x76'));var _0x394d65=new _0x4772d7();var _0x3c979c=_0x394d65[_0x8ee4('0x77')](_0x33ea0a[_0x8ee4('0x78')][_0x8ee4('0x79')])['getResult']();var _0x3de76f={'body':_0x33ea0a[_0x8ee4('0x4e')],'channel':_0x8ee4('0x7a')};var _0x339c9a=[];var _0x3ccb03=[];var _0x6eaa4c={};var _0x64c178=![];return db[_0x8ee4('0x7b')]['describe']()['then'](function(_0x2bc992){if(!_0x2bc992){throw new db[(_0x8ee4('0x7c'))][(_0x8ee4('0x7d'))](_0x8ee4('0x7e'));}_0x339c9a=_[_0x8ee4('0x7f')](_['keys'](_0x2bc992),[_0x8ee4('0x80'),_0x8ee4('0x81')]);_0x3ccb03=_[_0x8ee4('0x7f')](_[_0x8ee4('0x31')](_0x2bc992),[_0x8ee4('0x80'),_0x8ee4('0x81'),'CompanyId',_0x8ee4('0x82')]);if(_0x33ea0a[_0x8ee4('0x4e')]['id']){delete _0x33ea0a[_0x8ee4('0x4e')]['id'];}if(_[_0x8ee4('0x6a')](_0x33ea0a['body'][_0x8ee4('0x83')])){throw new db[(_0x8ee4('0x7c'))][(_0x8ee4('0x7d'))](_0x8ee4('0x84'));}if(_[_0x8ee4('0x6a')](_0x33ea0a['body'][_0x8ee4('0x4e')])||_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x4e')]===''){throw new db[(_0x8ee4('0x7c'))]['ValidationError'](_0x8ee4('0x85'));}if(_['isNil'](_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x86')])){throw new db['Sequelize']['ValidationError'](_0x8ee4('0x87')+_0x3ccb03);}if(!_[_0x8ee4('0x88')](_0x3ccb03,_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x86')])){throw new db[(_0x8ee4('0x7c'))]['ValidationError'](_0x8ee4('0x89')+_0x3ccb03);}_0x6eaa4c[_0x33ea0a['body'][_0x8ee4('0x86')]]=_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x83')];})[_0x8ee4('0x11')](function(){return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x33ea0a['params']['id']},'include':[{'model':db[_0x8ee4('0x8a')],'as':'List','include':[{'model':db[_0x8ee4('0x7b')],'as':_0x8ee4('0x8b'),'where':_0x6eaa4c,'limit':0x1,'order':[[_0x8ee4('0x81'),_0x8ee4('0x8c')]]}]},{'model':db[_0x8ee4('0x8d')],'as':_0x8ee4('0x8e')}]});})['then'](handleEntityNotFound(_0x4176a2,null))[_0x8ee4('0x11')](function(_0x579263){if(_0x579263&&_0x579263[_0x8ee4('0x8f')]){_0x3de76f[_0x8ee4('0x90')]=_0x579263;_0x3de76f[_0x8ee4('0x91')]=_0x579263[_0x8ee4('0x8e')];_0x3de76f[_0x8ee4('0x92')]=_0x579263[_0x8ee4('0x8f')];_0x3de76f['applications']=_[_0x8ee4('0x93')](_0x3de76f['applications'],['priority'],['asc']);if(_0x3de76f['account'][_0x8ee4('0x8e')]){delete _0x3de76f[_0x8ee4('0x90')][_0x8ee4('0x8e')];}if(_0x3de76f[_0x8ee4('0x90')][_0x8ee4('0x8f')]&&_0x3de76f[_0x8ee4('0x90')]['List'][_0x8ee4('0x8b')][_0x8ee4('0x36')]){return _0x3de76f[_0x8ee4('0x90')][_0x8ee4('0x8f')][_0x8ee4('0x8b')][0x0];}var _0x438824=_['defaults'](_0x33ea0a[_0x8ee4('0x4e')],{'firstName':_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x83')],'ListId':_0x579263[_0x8ee4('0x82')]});_0x438824[_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x86')]]=_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x83')];return db['CmContact'][_0x8ee4('0x46')](_0x438824,{'fields':_0x339c9a,'raw':!![]});}})[_0x8ee4('0x11')](handleEntityNotFound(_0x4176a2,null))[_0x8ee4('0x11')](function(_0x1d0cac){_0x3de76f['contact']=_0x1d0cac;var _0x5ba901=_0x33ea0a['body'][_0x8ee4('0x94')];if(_0x33ea0a[_0x8ee4('0x78')][_0x8ee4('0x95')]){_0x5ba901=_0x33ea0a[_0x8ee4('0x78')][_0x8ee4('0x95')];}else if(_0x33ea0a[_0x8ee4('0x78')]['x-forwarded-for']){_0x5ba901=_[_0x8ee4('0x96')](_0x33ea0a[_0x8ee4('0x78')][_0x8ee4('0x97')]['split'](','));}if(_0x1d0cac){var _0x32751a={'ContactId':_0x1d0cac['id'],'ChatWebsiteId':_0x33ea0a['params']['id'],'from':(_0x1d0cac[_0x8ee4('0x98')]||'')+'\x20'+(_0x1d0cac['lastName']||''),'customerIp':_0x5ba901,'customerPort':_0x33ea0a[_0x8ee4('0x78')]['x-real-port']?_0x33ea0a[_0x8ee4('0x78')][_0x8ee4('0x99')]:null,'referer':_0x33ea0a['body']['referer'],'browserName':_0x3c979c['browser'][_0x8ee4('0x26')]&&_0x3c979c[_0x8ee4('0x9a')][_0x8ee4('0x9b')]?util['format'](_0x8ee4('0x9c'),_0x3c979c['browser'][_0x8ee4('0x26')],_0x3c979c[_0x8ee4('0x9a')][_0x8ee4('0x9b')]):_0x8ee4('0x9d'),'browserVersion':_0x3c979c[_0x8ee4('0x9a')][_0x8ee4('0x9b')]||_0x8ee4('0x9d'),'osName':util['format'](_0x8ee4('0x9c'),_0x3c979c['os'][_0x8ee4('0x26')],_0x3c979c['os'][_0x8ee4('0x9b')]),'osVersion':_0x3c979c['os'][_0x8ee4('0x9b')],'deviceModel':_0x3c979c[_0x8ee4('0x9e')][_0x8ee4('0x2f')]&&_0x3c979c['device'][_0x8ee4('0x9f')]?util[_0x8ee4('0xa0')](_0x8ee4('0xa1'),_0x3c979c[_0x8ee4('0x9e')][_0x8ee4('0x2f')],_0x3c979c['device']['vendor'],_0x3c979c[_0x8ee4('0x9e')][_0x8ee4('0x2d')]):null,'deviceVendor':_0x3c979c[_0x8ee4('0x9e')][_0x8ee4('0x9f')],'deviceType':_0x3c979c[_0x8ee4('0x9e')][_0x8ee4('0x2d')],'formData':JSON['stringify'](_0x33ea0a[_0x8ee4('0x4e')])};var _0x1104c5={'ChatWebsiteId':_0x33ea0a[_0x8ee4('0x44')]['id'],'closed':![]};if(_0x33ea0a[_0x8ee4('0x4e')]['threadId']){_0x1104c5[_0x8ee4('0xa2')]=_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xa2')];return db['ChatInteraction']['find']({'where':_0x1104c5})[_0x8ee4('0x11')](function(_0x3044af){if(_0x3044af){return[_0x3044af,![]];}_0x32751a[_0x8ee4('0xa2')]=_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xa2')];_0x32751a[_0x8ee4('0xa3')]=_0x33ea0a[_0x8ee4('0x4e')]['externalUrl'];return db[_0x8ee4('0xa4')][_0x8ee4('0x46')](_0x32751a)[_0x8ee4('0x11')](function(_0x518a2c){return[_0x518a2c,!![]];});});}_0x1104c5[_0x8ee4('0xa5')]=_0x1d0cac['id'];if(_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xa6')]&&_0x33ea0a['body']['interaction']['id']){_0x1104c5['id']=_0x33ea0a['body']['interaction']['id'];return db[_0x8ee4('0xa4')][_0x8ee4('0x45')]({'where':_0x1104c5})[_0x8ee4('0x11')](function(_0x5ea975){if(_0x5ea975){return[_0x5ea975,![]];}return db[_0x8ee4('0xa4')][_0x8ee4('0x46')](_0x32751a)[_0x8ee4('0x11')](function(_0x385fe1){return[_0x385fe1,!![]];});});}return db[_0x8ee4('0xa4')][_0x8ee4('0x46')](_0x32751a)[_0x8ee4('0x11')](function(_0x4ac963){return[_0x4ac963,!![]];});}})[_0x8ee4('0xa7')](function(_0x2180b2,_0x5ae721){if(_0x2180b2){_0x64c178=_0x5ae721;if(!_0x5ae721){var _0x53f8ce={'from':(_0x3de76f[_0x8ee4('0xa8')][_0x8ee4('0x98')]||'')+'\x20'+(_0x3de76f['contact'][_0x8ee4('0xa9')]||'')};if(_0x33ea0a[_0x8ee4('0x4e')]['threadId']&&_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xaa')]&&_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xa2')]!=_0x33ea0a[_0x8ee4('0x4e')]['messageId']){_0x53f8ce[_0x8ee4('0xa2')]=_0x33ea0a[_0x8ee4('0x4e')]['messageId'];}return _0x2180b2[_0x8ee4('0xab')](_0x53f8ce);}else{return _0x2180b2;}}})[_0x8ee4('0x11')](function(_0x502a56){_0x3de76f[_0x8ee4('0xa6')]=_0x502a56[_0x8ee4('0x22')]({'plain':!![]});_0x3de76f['interaction']['created']=_0x64c178;if(_0x3de76f[_0x8ee4('0xa6')]['created']){if(_0x3de76f['account'][_0x8ee4('0xac')]){_0x3de76f['applications'][_0x8ee4('0xad')]({'id':0x0,'priority':_0x3de76f[_0x8ee4('0x91')][_0x8ee4('0x36')]+0x1,'app':_0x8ee4('0xae'),'appdata':_0x8ee4('0xaf'),'interval':_0x8ee4('0xb0')});}}return db[_0x8ee4('0xb1')][_0x8ee4('0x46')]({'body':_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0x4e')],'ChatWebsiteId':_0x33ea0a[_0x8ee4('0x44')]['id'],'ChatInteractionId':_0x502a56['id'],'direction':'in','ContactId':_0x3de76f['contact']['id'],'AttachmentId':_0x33ea0a[_0x8ee4('0x4e')][_0x8ee4('0xb2')]});})[_0x8ee4('0x11')](function(_0x3aca1e){_0x3de76f[_0x8ee4('0x16')]=_0x3aca1e;if(_0x3de76f[_0x8ee4('0xa6')][_0x8ee4('0xb3')]){return db[_0x8ee4('0xb4')][_0x8ee4('0x45')]({'attributes':['id',_0x8ee4('0x26')],'where':{'id':_0x3de76f['interaction']['UserId']}})[_0x8ee4('0x11')](function(_0x5008be){if(_0x5008be){_0x3de76f[_0x8ee4('0x91')][_0x8ee4('0xb5')]({'id':0x0,'priority':0x0,'app':_0x8ee4('0xb6'),'appdata':_0x5008be[_0x8ee4('0x26')]+','+(_0x3de76f[_0x8ee4('0x90')]['waitForTheAssignedAgent']||0xa),'interval':_0x8ee4('0xb0')});_0x3de76f[_0x8ee4('0xb7')]=!![];}return respondWithRpcPromise(_0x8ee4('0xb8'),_0x8ee4('0xb9'),_0x3de76f);});}return respondWithRpcPromise('Start','startRouting',_0x3de76f);})[_0x8ee4('0x11')](function(_0x133403){respondWithRpcPromise(_0x8ee4('0xba'),_0x8ee4('0xba'),{'event':_0x8ee4('0xbb'),'message':_0x133403},client9002);return _0x133403;})[_0x8ee4('0x11')](respondWithResult(_0x4176a2,null))[_0x8ee4('0x43')](handleError(_0x4176a2,null));};exports[_0x8ee4('0xbc')]=function(_0x3f1999,_0x586bc6){var _0x4d856b,_0x52a32c,_0x2d0f75;var _0x50c6ed=[];var _0x27537b={};var _0x502f5c=_0x3f1999['files']||[];var _0x4fa2d6=[];var _0x489d77;return db[_0x8ee4('0x7b')]['describe']()[_0x8ee4('0x11')](function(_0x1cabc8){if(!_0x1cabc8){throw new db[(_0x8ee4('0x7c'))][(_0x8ee4('0x7d'))](_0x8ee4('0x7e'));}_0x50c6ed=_[_0x8ee4('0x7f')](_[_0x8ee4('0x31')](_0x1cabc8),['createdAt',_0x8ee4('0x81'),_0x8ee4('0xbd'),_0x8ee4('0x82')]);if(_0x3f1999[_0x8ee4('0x4e')]['id']){delete _0x3f1999[_0x8ee4('0x4e')]['id'];}if(_[_0x8ee4('0x6a')](_0x3f1999['body'][_0x8ee4('0x83')])){throw _0x586bc6[_0x8ee4('0x19')](0x1f4)[_0x8ee4('0x27')](new db[(_0x8ee4('0x7c'))][(_0x8ee4('0x7d'))](_0x8ee4('0x84')));}if(_[_0x8ee4('0x6a')](_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0x4e')])||_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0x4e')]===''){throw _0x586bc6[_0x8ee4('0x19')](0x1f4)[_0x8ee4('0x27')](new db['Sequelize'][(_0x8ee4('0x7d'))](_0x8ee4('0x85')));}if(_['isNil'](_0x3f1999['body'][_0x8ee4('0xbe')])){throw _0x586bc6['status'](0x1f4)[_0x8ee4('0x27')](new db['Sequelize'][(_0x8ee4('0x7d'))](_0x8ee4('0xbf')+_0x50c6ed));}if(!_[_0x8ee4('0x88')](_0x50c6ed,_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0xbe')])){throw _0x586bc6[_0x8ee4('0x19')](0x1f4)[_0x8ee4('0x27')](new db[(_0x8ee4('0x7c'))]['ValidationError'](_0x8ee4('0xc0')+_0x50c6ed));}_0x27537b[_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0xbe')]]=_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0x83')];})['then'](function(){return db[_0x8ee4('0x2b')]['find']({'where':{'id':_0x3f1999[_0x8ee4('0x44')]['id']},'include':[{'model':db[_0x8ee4('0x8a')],'as':_0x8ee4('0x8f')},{'model':db['MailAccount'],'as':_0x8ee4('0xc1')}]});})[_0x8ee4('0x11')](handleEntityNotFound(_0x586bc6,null))['then'](function(_0x3ba835){if(_0x3ba835&&_0x3ba835['List']){_0x52a32c=_0x3ba835;var _0x14ad0a=_[_0x8ee4('0xc2')](_0x3f1999['body'],{'firstName':_0x3f1999['body'][_0x8ee4('0x83')],'phone':_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0x83')],'ListId':_0x3ba835[_0x8ee4('0x82')]});_0x14ad0a[_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0xbe')]]=_0x3f1999[_0x8ee4('0x4e')]['from'];return db[_0x8ee4('0x7b')][_0x8ee4('0xc3')]({'where':_0x27537b,'defaults':_0x14ad0a});}})['spread'](function(_0x2611d4){if(_0x2611d4){_0x2d0f75=_0x2611d4;var _0x14f8e6=fs[_0x8ee4('0xc4')](path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0xc5')),'utf8');var _0x4340f6=ejs[_0x8ee4('0xc6')](_0x14f8e6,{'body':_[_0x8ee4('0xc7')](_0x3f1999[_0x8ee4('0x4e')][_0x8ee4('0x4e')]),'bodyTitle':_0x52a32c[_0x8ee4('0xc8')]});return db[_0x8ee4('0xc9')][_0x8ee4('0x46')]({'body':_0x4340f6,'plainBody':htmlToText[_0x8ee4('0xca')](_0x4340f6),'ContactId':_0x2611d4['id'],'ChatWebsiteId':_0x52a32c['id']});}})[_0x8ee4('0x11')](function(_0x26aa28){_0x489d77=_0x26aa28;if(_0x502f5c['length']){var _0x573502=_0x502f5c['map'](function(_0x54ebe2){return{'name':_0x54ebe2['originalname'],'basename':_0x54ebe2[_0x8ee4('0x5e')],'type':_0x54ebe2[_0x8ee4('0xcb')],'ChatOfflineMessageId':_0x26aa28['id']};});_0x4fa2d6=_0x573502[_0x8ee4('0x2a')](_0x5f4739=>{var _0x58e3d3={'filename':_0x5f4739[_0x8ee4('0x26')],'path':path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0xcc'),'files',_0x8ee4('0xcd'),_0x8ee4('0xce'),_0x5f4739[_0x8ee4('0xcf')])};return _0x58e3d3;});if(!_0x52a32c[_0x8ee4('0xd0')]){return db['sequelize'][_0x8ee4('0xd1')](function(_0x55a343){return db[_0x8ee4('0xd2')][_0x8ee4('0xd3')](_0x573502,{'transaction':_0x55a343});});}}})[_0x8ee4('0x11')](function(){if(_0x489d77){_0x4d856b=_0x489d77;return db[_0x8ee4('0xc1')][_0x8ee4('0x53')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8ee4('0xd4')],'as':_0x8ee4('0xd4'),'raw':!![]}]}]});}})[_0x8ee4('0x11')](function(_0x94faa2){if(_0x94faa2&&_0x94faa2[_0x8ee4('0xd5')]&&_0x52a32c[_0x8ee4('0xd6')]&&_0x52a32c[_0x8ee4('0xd7')]){var _0x351991=_0x94faa2[_0x8ee4('0xd8')]();return respondWithRpcPromise(_0x8ee4('0xd9'),_0x8ee4('0xda'),{'account':_0x351991,'message':{'from':util[_0x8ee4('0xa0')](_0x8ee4('0xdb'),_0x94faa2[_0x8ee4('0x26')],_0x94faa2[_0x8ee4('0xdc')]||_0x94faa2['Smtp'][_0x8ee4('0x47')]),'to':_0x52a32c[_0x8ee4('0xd7')],'subject':_0x52a32c[_0x8ee4('0xdd')],'html':_0x4d856b['body'],'attachments':_0x4fa2d6}},client9003)[_0x8ee4('0x11')](function(){return _0x4d856b;})['catch'](function(_0x1ff5f2){logger[_0x8ee4('0x15')](_0x1ff5f2);});}})[_0x8ee4('0x11')](function(){if(_0x52a32c&&_0x52a32c[_0x8ee4('0xd0')]&&_0x52a32c['MailAccountId']){var _0x8fbf73=[];if(_0x502f5c[_0x8ee4('0x36')]){_0x8fbf73=_0x502f5c[_0x8ee4('0x2a')](function(_0x1bc2db){return{'name':_0x1bc2db[_0x8ee4('0xde')],'basename':_0x1bc2db[_0x8ee4('0x5e')],'type':_0x1bc2db[_0x8ee4('0xcb')],'ChatOfflineMessageId':_0x489d77['id']};});}var _0x4e0f80;if(!_[_0x8ee4('0x6a')](_0x52a32c['subjectOffline'])){var _0x4030c8=_['map'](_0x3f1999[_0x8ee4('0x4e')],function(_0x4f70f5){return _0x4f70f5;});var _0x41edff=_['toPairsIn'](_0x4030c8)[0x0];var _0x4c8e3c=_['mapValues'](_0x41edff,function(_0x144537){return _0x144537;});_0x4e0f80=_0x4c8e3c[0x1][_0x52a32c[_0x8ee4('0xdf')]];}var _0x1a1996={'from':_0x2d0f75[_0x8ee4('0xdc')],'firstName':_0x2d0f75[_0x8ee4('0x98')],'lastName':_0x2d0f75[_0x8ee4('0xa9')],'mapKey':'email','message':{'from':_0x2d0f75[_0x8ee4('0xdc')],'to':_0x52a32c[_0x8ee4('0xc1')][_0x8ee4('0xdc')],'cc':'','subject':_[_0x8ee4('0x6a')](_0x4e0f80)?_0x52a32c[_0x8ee4('0xdd')]:_0x4e0f80,'messageId':'','sentAt':new Date(),'attach':_0x8fbf73[_0x8ee4('0x36')],'attachments':_0x8fbf73,'originChannel':_0x8ee4('0xe0'),'ChatWebsiteId':_0x52a32c['id'],'ChatOfflineMessageId':_0x4d856b['id'],'originTo':_0x52a32c[_0x8ee4('0xc1')][_0x8ee4('0xdc')]},'body':_0x4d856b[_0x8ee4('0x4e')]};var _0x556158={'account':{'id':_0x52a32c[_0x8ee4('0xe1')]},'body':_0x1a1996,'log':_0x8ee4('0xe2')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x556158,client9001)[_0x8ee4('0x11')](function(){return _0x4d856b;})[_0x8ee4('0x43')](function(_0x5047e8){logger[_0x8ee4('0x15')](_0x5047e8);});}return;})[_0x8ee4('0x11')](function(){if(_0x4d856b){return _0x4d856b;}})[_0x8ee4('0x11')](respondWithResult(_0x586bc6,null))[_0x8ee4('0x43')](function(_0x2e6f67){logger[_0x8ee4('0x15')](_0x8ee4('0x43'),_0x2e6f67);for(var _0x5b2571 of _0x502f5c){var _0x3b7d39=path[_0x8ee4('0x6c')](config['root'],_0x8ee4('0xcc'),_0x8ee4('0xe3'),_0x8ee4('0xcd'),'offline-chat',_0x5b2571[_0x8ee4('0x5e')]);fs_extra[_0x8ee4('0xe4')](_0x3b7d39)['catch'](function(_0x1bedc1){logger[_0x8ee4('0x15')]('Could\x20not\x20remove\x20attachment\x20file',_0x3b7d39,_0x1bedc1);});}});};exports[_0x8ee4('0xe5')]=function(_0x6e614a,_0x41d1b1){return db[_0x8ee4('0xa4')][_0x8ee4('0x45')]({'where':{'id':_0x6e614a[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x41d1b1,null))[_0x8ee4('0x11')](function(_0x5a33cc){if(_0x5a33cc){return _0x5a33cc[_0x8ee4('0xe5')](_0x6e614a['body']['ids'],_[_0x8ee4('0xe6')](_0x6e614a['body'],['ids','id'])||{});}})[_0x8ee4('0x11')](respondWithResult(_0x41d1b1,null))[_0x8ee4('0x43')](handleError(_0x41d1b1,null));};exports[_0x8ee4('0xe7')]=function(_0x480d8c,_0x4b0723){var _0x3f8696={'raw':![],'where':{}};var _0x31db13={};var _0x2e4df4={'count':0x0,'rows':[]};return db[_0x8ee4('0x2b')][_0x8ee4('0x53')]({'where':{'id':_0x480d8c[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x4b0723,null))[_0x8ee4('0x11')](function(_0x30e8a8){if(_0x30e8a8){_0x31db13[_0x8ee4('0x2f')]=_['keys'](db[_0x8ee4('0xa4')]['rawAttributes']);_0x31db13[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x480d8c['query']);_0x31db13[_0x8ee4('0x32')]=_[_0x8ee4('0x33')](_0x31db13[_0x8ee4('0x2f')],_0x31db13['query']);_0x3f8696[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x31db13[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x480d8c['query']['fields']));_0x3f8696[_0x8ee4('0x35')]=_0x3f8696['attributes'][_0x8ee4('0x36')]?_0x3f8696['attributes']:_0x31db13['model'];if(!_0x480d8c[_0x8ee4('0x30')]['hasOwnProperty'](_0x8ee4('0x38'))){_0x3f8696['limit']=qs['limit'](_0x480d8c[_0x8ee4('0x30')]['limit']);_0x3f8696['offset']=qs[_0x8ee4('0x1c')](_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0x1c')]);}_0x3f8696[_0x8ee4('0x39')]=qs[_0x8ee4('0x3a')](_0x480d8c[_0x8ee4('0x30')]['sort']);_0x3f8696[_0x8ee4('0x3b')]=qs[_0x8ee4('0x32')](_[_0x8ee4('0x3c')](_0x480d8c[_0x8ee4('0x30')],_0x31db13['filters']));_0x3f8696[_0x8ee4('0x3b')][_0x8ee4('0x51')]=_0x30e8a8['id'];if(_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0x3f8696[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0x3f8696[_0x8ee4('0x3b')],{'$or':_[_0x8ee4('0x2a')](_0x3f8696['attributes'],function(_0x2c3397){var _0x59e3ee={};_0x59e3ee[_0x2c3397]={'$like':'%'+_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0x3d')]+'%'};return _0x59e3ee;})});}_0x3f8696=_['merge']({},_0x3f8696,_0x480d8c[_0x8ee4('0x3f')]);return db['ChatInteraction'][_0x8ee4('0x1f')]({'where':_0x3f8696['where']})['then'](function(_0x570315){_0x2e4df4['count']=_0x570315;if(_0x480d8c[_0x8ee4('0x30')]['includeAll']){_0x3f8696['include']=[{'model':db[_0x8ee4('0x7b')],'as':_0x8ee4('0xe8'),'required':![]},{'model':db[_0x8ee4('0xb4')],'as':_0x8ee4('0xe9'),'attributes':['name',_0x8ee4('0xea'),_0x8ee4('0xeb')],'required':![]},{'model':db[_0x8ee4('0xec')],'as':'Tags','attributes':['id','name',_0x8ee4('0xed')],'where':_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0xee')]?{'id':_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0xee')]}:undefined,'required':_0x480d8c[_0x8ee4('0x30')][_0x8ee4('0xee')]?!![]:![]}];}return db[_0x8ee4('0xa4')]['findAll'](_0x3f8696);})[_0x8ee4('0x11')](function(_0x411f06){_0x2e4df4[_0x8ee4('0x42')]=_0x411f06;return _0x2e4df4;});}})[_0x8ee4('0x11')](respondWithFilteredResult(_0x4b0723,_0x3f8696))[_0x8ee4('0x43')](handleError(_0x4b0723,null));};function iftimePromise(_0x507987,_0x819021){return respondWithRpcPromise(_0x8ee4('0xef'),_0x8ee4('0xf0'),{'command':_0x819021[_0x8ee4('0xf1')]?util[_0x8ee4('0xa0')](_0x8ee4('0xf2'),_0x507987['interval'],_0x819021['timezone']):util[_0x8ee4('0xa0')](_0x8ee4('0xf3'),_0x507987[_0x8ee4('0xf4')])},client9002)['then'](function(_0x165da4){var _0x2d8dc3=_0x165da4&&_0x165da4[_0x8ee4('0xf5')]('true')>=0x0?!![]:![];logger[_0x8ee4('0xf6')](_0x8ee4('0xf7'),_0x819021['id'],_0x507987['id'],_0x507987['interval'],_0x2d8dc3?_0x8ee4('0xf8'):'OFFLINE',_0x819021[_0x8ee4('0xf1')]?_0x819021[_0x8ee4('0xf1')]:_0x8ee4('0xf9'));return _0x2d8dc3;})['catch'](function(_0x468e34){logger['error'](_0x8ee4('0xf7'),_0x819021['id'],_0x507987['id'],_0x507987[_0x8ee4('0xf4')],util[_0x8ee4('0xfa')](_0x468e34,{'showHidden':![],'depth':null}),_0x819021[_0x8ee4('0xf1')]?_0x819021[_0x8ee4('0xf1')]:_0x8ee4('0xf9'));return![];});}exports['getSnippet']=function(_0x514723,_0x3f8a2f){var _0x29a246=0x0;var _0x544562=0x0;var _0x569f20=![];var _0x4bcdf3;var _0x2aa386;return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x514723[_0x8ee4('0x44')]['id']},'include':[{'model':db[_0x8ee4('0xfb')],'as':_0x8ee4('0xfb'),'include':[{'model':db[_0x8ee4('0xfb')],'as':_0x8ee4('0xfc'),'attributes':['id',_0x8ee4('0xf4')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3f8a2f,null))[_0x8ee4('0x11')](function(_0xec2789){if(_0xec2789){_0x4bcdf3=_0xec2789;return _0xec2789[_0x8ee4('0xfd')]({'raw':!![]});}})[_0x8ee4('0x11')](function(_0x45865d){if(_0x4bcdf3){if(_0x45865d){_0x2aa386=_0x45865d;}}return require(_0x8ee4('0x67'))[_0x8ee4('0x68')]();})[_0x8ee4('0x11')](function(_0x1175cf){if(_0x1175cf){_0x544562=_0x1175cf['virtual'];_0x569f20=_0x1175cf[_0x8ee4('0x69')];}})[_0x8ee4('0x11')](function(){return db[_0x8ee4('0xa4')]['count']({'where':{'closed':![]}});})['then'](function(_0x283144){_0x29a246=_0x283144;if(_0x544562&&_0x283144>_0x544562){return db[_0x8ee4('0xfe')][_0x8ee4('0x53')]({'where':{'id':0x1}})[_0x8ee4('0x11')](function(_0xbf9457){if(_0xbf9457){_0xbf9457[_0x8ee4('0xff')](_0x8ee4('0x100'));}});}})[_0x8ee4('0x11')](function(){if(_0x4bcdf3[_0x8ee4('0xfb')]&&_0x4bcdf3[_0x8ee4('0xfb')]['Intervals']){var _0x132bcc=[];for(var _0x428bac=0x0;_0x428bac<_0x4bcdf3[_0x8ee4('0xfb')][_0x8ee4('0xfc')]['length'];_0x428bac++){var _0x35e1d6=_0x4bcdf3['Interval'][_0x8ee4('0xfc')][_0x428bac][_0x8ee4('0x22')]({'plain':!![]});_0x132bcc[_0x8ee4('0xad')](iftimePromise(_0x35e1d6,_0x4bcdf3));}return BPromise[_0x8ee4('0x101')](_0x132bcc)['then'](function(_0x2abb7b){return _['some'](_0x2abb7b);});}else{return!![];}})[_0x8ee4('0x11')](function(_0x52023d){var _0x3b9258=fs[_0x8ee4('0xc4')](path[_0x8ee4('0x6c')](config[_0x8ee4('0x65')],_0x8ee4('0x102')),_0x8ee4('0x103'));var _0x4a751e={'remote':_0x4bcdf3[_0x8ee4('0x104')],'query':querystring['stringify'](_[_0x8ee4('0x3e')](_0x4bcdf3[_0x8ee4('0x22')]({'plain':!![]}),{'customerIp':_0x514723[_0x8ee4('0x78')]['x-forwarded-for']||_0x514723[_0x8ee4('0x78')][_0x8ee4('0x105')]||_0x514723['connection'][_0x8ee4('0x106')]||_0x514723['ip'],'referer':_0x514723[_0x8ee4('0x78')][_0x8ee4('0x107')],'openedInteractions':_0x29a246,'maxInteractions':_0x544562,'virtual':_0x569f20['virtual'],'online':_0x52023d,'custom':_0x569f20}))[_0x8ee4('0x108')](/'/g,'\x5c\x27')};_0x3f8a2f[_0x8ee4('0x27')](ejs[_0x8ee4('0xc6')](Mustache[_0x8ee4('0xc6')](_0x3b9258,_0x4a751e),{'proactiveActions':_0x2aa386,'alignment':_0x4bcdf3[_0x8ee4('0x109')],'verticalAlignment':_0x4bcdf3['verticalAlignment'],'div_color':_0x4bcdf3[_0x8ee4('0xed')],'labelText':_0x4bcdf3[_0x8ee4('0x10a')],'text_color':_0x4bcdf3[_0x8ee4('0x10b')],'text_button_color':_0x4bcdf3[_0x8ee4('0x10c')],'button_color':_0x4bcdf3[_0x8ee4('0x10d')],'background_color':_0x4bcdf3['backgroundColor'],'hideWhenOffline':_0x4bcdf3[_0x8ee4('0x10e')],'interval':_0x4bcdf3[_0x8ee4('0x10f')]}));})[_0x8ee4('0x43')](handleError(_0x3f8a2f,null));};exports[_0x8ee4('0x110')]=function(_0x573fb7,_0x374c18){var _0x519623=_0x573fb7['params']['id'];var _0x545781=_0x573fb7[_0x8ee4('0x4e')];var _0x4fff70=0xc8;var _0x5b89f1=null;return db[_0x8ee4('0x111')][_0x8ee4('0xd1')]({'isolationLevel':db[_0x8ee4('0x111')][_0x8ee4('0x112')][_0x8ee4('0x113')]['READ_COMMITTED']},function(_0x4ef1e2){return db[_0x8ee4('0x2b')]['findOne']({'where':{'id':_0x519623},'transaction':_0x4ef1e2})['then'](function(_0x55be69){if(_0x55be69){return db[_0x8ee4('0x8d')][_0x8ee4('0x21')]({'where':{'ChatWebsiteId':_0x519623},'transaction':_0x4ef1e2})[_0x8ee4('0x11')](function(){var _0x17891c=_[_0x8ee4('0x2a')](_0x545781,function(_0x13467b){_0x13467b['ChatWebsiteId']=_0x519623;return _0x13467b;});return db[_0x8ee4('0x8d')][_0x8ee4('0xd3')](_0x17891c,{'transaction':_0x4ef1e2});});}else{_0x4fff70=0x194;_0x5b89f1=[];}});})[_0x8ee4('0x11')](function(){if(_0x4fff70!==0x194){return db[_0x8ee4('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x519623},'order':_0x8ee4('0x114')})[_0x8ee4('0x11')](function(_0x16310a){_0x5b89f1=_0x16310a;});}})[_0x8ee4('0x43')](function(_0x1706e4){_0x4fff70=0x1f4;logger['error'](_0x1706e4[_0x8ee4('0x25')]);if(_0x1706e4[_0x8ee4('0x26')]){delete _0x1706e4[_0x8ee4('0x26')];}_0x5b89f1=_0x1706e4;})[_0x8ee4('0x115')](function(){if(_0x5b89f1===null){_0x374c18[_0x8ee4('0x18')](_0x4fff70);}else{if(_0x4fff70===0x1f4){_0x374c18[_0x8ee4('0x19')](_0x4fff70)[_0x8ee4('0x27')](_0x5b89f1);}else{_0x374c18[_0x8ee4('0x19')](_0x4fff70)[_0x8ee4('0x1b')](_0x5b89f1);}}});};exports[_0x8ee4('0x116')]=function(_0x2f44ff,_0x47f00e){var _0xa20bb5={};var _0x1728d7={};var _0x32ae31;var _0x2b521f;return db[_0x8ee4('0x2b')]['findOne']({'where':{'id':_0x2f44ff[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x47f00e,null))[_0x8ee4('0x11')](function(_0x5165e2){if(_0x5165e2){_0x32ae31=_0x5165e2;_0x1728d7[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0x8d')][_0x8ee4('0x2c')]);_0x1728d7[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x2f44ff['query']);_0x1728d7[_0x8ee4('0x32')]=_[_0x8ee4('0x33')](_0x1728d7[_0x8ee4('0x2f')],_0x1728d7[_0x8ee4('0x30')]);_0xa20bb5[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x1728d7[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x2f44ff[_0x8ee4('0x30')][_0x8ee4('0x34')]));_0xa20bb5[_0x8ee4('0x35')]=_0xa20bb5[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0xa20bb5['attributes']:_0x1728d7['model'];_0xa20bb5[_0x8ee4('0x39')]=qs[_0x8ee4('0x3a')](_0x2f44ff[_0x8ee4('0x30')][_0x8ee4('0x3a')]);_0xa20bb5[_0x8ee4('0x3b')]=qs[_0x8ee4('0x32')](_['pick'](_0x2f44ff['query'],_0x1728d7[_0x8ee4('0x32')]));if(_0x2f44ff[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0xa20bb5[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0xa20bb5[_0x8ee4('0x3b')],{'$or':_[_0x8ee4('0x2a')](_0xa20bb5['attributes'],function(_0x376da0){var _0x260e94={};_0x260e94[_0x376da0]={'$like':'%'+_0x2f44ff['query']['filter']+'%'};return _0x260e94;})});}_0xa20bb5=_[_0x8ee4('0x3e')]({},_0xa20bb5,_0x2f44ff[_0x8ee4('0x3f')]);return _0x32ae31[_0x8ee4('0x116')](_0xa20bb5);}})[_0x8ee4('0x11')](function(_0x93e10c){if(_0x93e10c){_0x2b521f=_0x93e10c[_0x8ee4('0x36')];if(!_0x2f44ff['query'][_0x8ee4('0x37')](_0x8ee4('0x38'))){_0xa20bb5['limit']=qs[_0x8ee4('0x1d')](_0x2f44ff[_0x8ee4('0x30')][_0x8ee4('0x1d')]);_0xa20bb5[_0x8ee4('0x1c')]=qs[_0x8ee4('0x1c')](_0x2f44ff[_0x8ee4('0x30')][_0x8ee4('0x1c')]);}return _0x32ae31[_0x8ee4('0x116')](_0xa20bb5);}})[_0x8ee4('0x11')](function(_0x2d928b){if(_0x2d928b){return _0x2d928b?{'count':_0x2b521f,'rows':_0x2d928b}:null;}})[_0x8ee4('0x11')](respondWithResult(_0x47f00e,null))[_0x8ee4('0x43')](handleError(_0x47f00e,null));};exports[_0x8ee4('0x117')]=function(_0x1581f4,_0x151cd9){return db[_0x8ee4('0x118')][_0x8ee4('0x45')]({'where':{'id':_0x1581f4[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x151cd9,null))['then'](function(_0x48712d){if(_0x48712d){return _0x48712d['addProactiveActions'](_0x1581f4[_0x8ee4('0x4e')][_0x8ee4('0x55')],_['omit'](_0x1581f4['body'],[_0x8ee4('0x55'),'id'])||{});}})[_0x8ee4('0x11')](respondWithResult(_0x151cd9,null))[_0x8ee4('0x43')](handleError(_0x151cd9,null));};exports[_0x8ee4('0xfd')]=function(_0x16b387,_0x511750){var _0x520069={};var _0x275b26={};var _0x39ec32;var _0xb56829;return db['ChatWebsite'][_0x8ee4('0x53')]({'where':{'id':_0x16b387[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x511750,null))['then'](function(_0x554903){if(_0x554903){_0x39ec32=_0x554903;_0x275b26[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0x119')]['rawAttributes']);_0x275b26['query']=_[_0x8ee4('0x31')](_0x16b387[_0x8ee4('0x30')]);_0x275b26['filters']=_[_0x8ee4('0x33')](_0x275b26[_0x8ee4('0x2f')],_0x275b26[_0x8ee4('0x30')]);_0x520069[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x275b26[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x16b387[_0x8ee4('0x30')]['fields']));_0x520069[_0x8ee4('0x35')]=_0x520069[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0x520069[_0x8ee4('0x35')]:_0x275b26[_0x8ee4('0x2f')];_0x520069[_0x8ee4('0x39')]=qs[_0x8ee4('0x3a')](_0x16b387[_0x8ee4('0x30')]['sort']);_0x520069['where']=qs['filters'](_['pick'](_0x16b387[_0x8ee4('0x30')],_0x275b26['filters']));if(_0x16b387['query'][_0x8ee4('0x3d')]){_0x520069['where']=_[_0x8ee4('0x3e')](_0x520069['where'],{'$or':_[_0x8ee4('0x2a')](_0x520069['attributes'],function(_0x130880){var _0x690154={};_0x690154[_0x130880]={'$like':'%'+_0x16b387[_0x8ee4('0x30')][_0x8ee4('0x3d')]+'%'};return _0x690154;})});}_0x520069=_['merge']({},_0x520069,_0x16b387[_0x8ee4('0x3f')]);return _0x39ec32[_0x8ee4('0xfd')](_0x520069);}})['then'](function(_0x1c83a5){if(_0x1c83a5){_0xb56829=_0x1c83a5[_0x8ee4('0x36')];if(!_0x16b387[_0x8ee4('0x30')][_0x8ee4('0x37')](_0x8ee4('0x38'))){_0x520069[_0x8ee4('0x1d')]=qs['limit'](_0x16b387[_0x8ee4('0x30')][_0x8ee4('0x1d')]);_0x520069['offset']=qs['offset'](_0x16b387[_0x8ee4('0x30')]['offset']);}return _0x39ec32[_0x8ee4('0xfd')](_0x520069);}})[_0x8ee4('0x11')](function(_0x3d8ee9){if(_0x3d8ee9){return _0x3d8ee9?{'count':_0xb56829,'rows':_0x3d8ee9}:null;}})['then'](respondWithResult(_0x511750,null))[_0x8ee4('0x43')](handleError(_0x511750,null));};exports[_0x8ee4('0x11a')]=function(_0x254257,_0x872cff){var _0x3b2395=_0x254257[_0x8ee4('0x30')]['online']===_0x8ee4('0x11b')?_0x8ee4('0x11c'):_0x8ee4('0x11d');return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'attributes':['id',_0x3b2395],'where':{'id':_0x254257[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x872cff,null))[_0x8ee4('0x11')](function(_0x51688b){if(_0x51688b){var _0x5460f8=_0x51688b[_0x3b2395];var _0x4095e8=_0x5460f8&&_0x5460f8['items']?_0x5460f8['items']:[];_0x872cff['send']({'fromKey':_['isNil'](_0x5460f8['fromKey'])?undefined:_0x5460f8['fromKey'],'count':_0x4095e8[_0x8ee4('0x36')],'rows':_0x4095e8});}})[_0x8ee4('0x43')](handleError(_0x872cff,null));};exports[_0x8ee4('0x11e')]=function(_0x3dc2bf,_0x30fd70){var _0x257024={'raw':![],'where':{}};var _0x30da63={};var _0xc45370={'count':0x0,'rows':[]};return db[_0x8ee4('0x2b')][_0x8ee4('0x53')]({'where':{'id':_0x3dc2bf[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x30fd70,null))['then'](function(_0x1a2226){if(_0x1a2226){_0x30da63[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0xc9')][_0x8ee4('0x2c')]);_0x30da63[_0x8ee4('0x30')]=_['keys'](_0x3dc2bf[_0x8ee4('0x30')]);_0x30da63['filters']=_[_0x8ee4('0x33')](_0x30da63[_0x8ee4('0x2f')],_0x30da63[_0x8ee4('0x30')]);_0x257024[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x30da63[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x3dc2bf[_0x8ee4('0x30')][_0x8ee4('0x34')]));_0x257024['attributes']=_0x257024[_0x8ee4('0x35')][_0x8ee4('0x36')]?_0x257024[_0x8ee4('0x35')]:_0x30da63[_0x8ee4('0x2f')];if(!_0x3dc2bf['query'][_0x8ee4('0x37')]('nolimit')){_0x257024[_0x8ee4('0x1d')]=qs['limit'](_0x3dc2bf['query'][_0x8ee4('0x1d')]);_0x257024['offset']=qs[_0x8ee4('0x1c')](_0x3dc2bf[_0x8ee4('0x30')][_0x8ee4('0x1c')]);}_0x257024['order']=qs[_0x8ee4('0x3a')](_0x3dc2bf[_0x8ee4('0x30')][_0x8ee4('0x3a')]);_0x257024[_0x8ee4('0x3b')]=qs[_0x8ee4('0x32')](_[_0x8ee4('0x3c')](_0x3dc2bf[_0x8ee4('0x30')],_0x30da63[_0x8ee4('0x32')]));_0x257024['where']['ChatWebsiteId']=_0x1a2226['id'];if(_0x3dc2bf[_0x8ee4('0x30')]['filter']){_0x257024[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0x257024[_0x8ee4('0x3b')],{'$or':_['map'](_0x257024[_0x8ee4('0x35')],function(_0x7da231){var _0x4db18e={};_0x4db18e[_0x7da231]={'$like':'%'+_0x3dc2bf['query'][_0x8ee4('0x3d')]+'%'};return _0x4db18e;})});}_0x257024=_['merge']({},_0x257024,_0x3dc2bf[_0x8ee4('0x3f')]);return db['ChatOfflineMessage'][_0x8ee4('0x1f')]({'where':_0x257024[_0x8ee4('0x3b')]})[_0x8ee4('0x11')](function(_0x5e8827){_0xc45370['count']=_0x5e8827;if(_0x3dc2bf[_0x8ee4('0x30')][_0x8ee4('0x40')]){_0x257024[_0x8ee4('0x41')]=[{'all':!![]}];}else{_0x257024[_0x8ee4('0x41')]=[{'model':db[_0x8ee4('0x7b')],'as':_0x8ee4('0xe8'),'required':![]},{'model':db[_0x8ee4('0xd2')],'as':_0x8ee4('0x11f'),'required':![]}];}return db[_0x8ee4('0xc9')][_0x8ee4('0x59')](_0x257024);})[_0x8ee4('0x11')](function(_0x41c067){_0xc45370[_0x8ee4('0x42')]=_0x41c067;return _0xc45370;});}})['then'](respondWithFilteredResult(_0x30fd70,_0x257024))[_0x8ee4('0x43')](handleError(_0x30fd70,null));};exports['addAgents']=function(_0x144380,_0x5d02d7){return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x144380[_0x8ee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d02d7,null))[_0x8ee4('0x11')](function(_0x5c7b8f){if(_0x5c7b8f){return _0x5c7b8f[_0x8ee4('0x120')](_0x144380[_0x8ee4('0x4e')][_0x8ee4('0x55')],_[_0x8ee4('0xe6')](_0x144380[_0x8ee4('0x4e')],[_0x8ee4('0x55'),'id'])||{})[_0x8ee4('0xa7')](function(_0x1dbf2a){for(var _0x44e522=0x0;_0x44e522<_0x144380[_0x8ee4('0x4e')][_0x8ee4('0x55')]['length'];_0x44e522+=0x1){socket[_0x8ee4('0x121')](_0x8ee4('0x122'),{'UserId':Number(_0x144380['body'][_0x8ee4('0x55')][_0x44e522]),'ChatWebsiteId':Number(_0x144380[_0x8ee4('0x44')]['id'])});}return _0x1dbf2a;});}})[_0x8ee4('0x11')](respondWithResult(_0x5d02d7,null))[_0x8ee4('0x43')](handleError(_0x5d02d7,null));};exports[_0x8ee4('0x123')]=function(_0x1203a6,_0x34998b){return db[_0x8ee4('0x2b')][_0x8ee4('0x45')]({'where':{'id':_0x1203a6['params']['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x34998b,null))['then'](function(_0x18fc27){if(_0x18fc27){return _0x18fc27['removeAgents'](_0x1203a6[_0x8ee4('0x30')][_0x8ee4('0x55')])[_0x8ee4('0x11')](function(){if(_[_0x8ee4('0x124')](_0x1203a6['query'][_0x8ee4('0x55')])){for(var _0x33fb2d=0x0;_0x33fb2d<_0x1203a6['query'][_0x8ee4('0x55')]['length'];_0x33fb2d+=0x1){socket[_0x8ee4('0x121')](_0x8ee4('0x125'),{'UserId':Number(_0x1203a6['query'][_0x8ee4('0x55')][_0x33fb2d]),'ChatWebsiteId':Number(_0x1203a6[_0x8ee4('0x44')]['id'])});}}else{socket['emit'](_0x8ee4('0x125'),{'UserId':Number(_0x1203a6[_0x8ee4('0x30')][_0x8ee4('0x55')]),'ChatWebsiteId':Number(_0x1203a6[_0x8ee4('0x44')]['id'])});}});}})[_0x8ee4('0x11')](respondWithStatusCode(_0x34998b,null))[_0x8ee4('0x43')](handleError(_0x34998b,null));};exports[_0x8ee4('0x126')]=function(_0x1e7660,_0x1722d0){var _0x1b7250={};var _0x4d2217={};var _0x34bdb2;var _0x195e86;return db[_0x8ee4('0x2b')][_0x8ee4('0x53')]({'where':{'id':_0x1e7660[_0x8ee4('0x44')]['id']}})[_0x8ee4('0x11')](handleEntityNotFound(_0x1722d0,null))['then'](function(_0x28e2d9){if(_0x28e2d9){_0x34bdb2=_0x28e2d9;_0x4d2217[_0x8ee4('0x2f')]=_[_0x8ee4('0x31')](db[_0x8ee4('0xb4')][_0x8ee4('0x2c')]);_0x4d2217[_0x8ee4('0x30')]=_[_0x8ee4('0x31')](_0x1e7660[_0x8ee4('0x30')]);_0x4d2217[_0x8ee4('0x32')]=_[_0x8ee4('0x33')](_0x4d2217[_0x8ee4('0x2f')],_0x4d2217[_0x8ee4('0x30')]);_0x1b7250[_0x8ee4('0x35')]=_[_0x8ee4('0x33')](_0x4d2217[_0x8ee4('0x2f')],qs[_0x8ee4('0x34')](_0x1e7660[_0x8ee4('0x30')]['fields']));_0x1b7250[_0x8ee4('0x35')]=_0x1b7250['attributes'][_0x8ee4('0x36')]?_0x1b7250[_0x8ee4('0x35')]:_0x4d2217['model'];_0x1b7250['order']=qs[_0x8ee4('0x3a')](_0x1e7660[_0x8ee4('0x30')][_0x8ee4('0x3a')]);_0x1b7250[_0x8ee4('0x3b')]=qs['filters'](_[_0x8ee4('0x3c')](_0x1e7660['query'],_0x4d2217[_0x8ee4('0x32')]));if(_0x1e7660[_0x8ee4('0x30')][_0x8ee4('0x3d')]){_0x1b7250[_0x8ee4('0x3b')]=_[_0x8ee4('0x3e')](_0x1b7250['where'],{'$or':_[_0x8ee4('0x2a')](_0x1b7250[_0x8ee4('0x35')],function(_0x2ef78e){var _0x46e124={};_0x46e124[_0x2ef78e]={'$like':'%'+_0x1e7660['query'][_0x8ee4('0x3d')]+'%'};return _0x46e124;})});}_0x1b7250=_[_0x8ee4('0x3e')]({},_0x1b7250,_0x1e7660[_0x8ee4('0x3f')]);return _0x34bdb2[_0x8ee4('0x126')](_0x1b7250);}})['then'](function(_0x5bb621){if(_0x5bb621){_0x195e86=_0x5bb621['length'];if(!_0x1e7660[_0x8ee4('0x30')][_0x8ee4('0x37')](_0x8ee4('0x38'))){_0x1b7250[_0x8ee4('0x1d')]=qs[_0x8ee4('0x1d')](_0x1e7660[_0x8ee4('0x30')]['limit']);_0x1b7250[_0x8ee4('0x1c')]=qs['offset'](_0x1e7660[_0x8ee4('0x30')][_0x8ee4('0x1c')]);}return _0x34bdb2['getAgents'](_0x1b7250);}})[_0x8ee4('0x11')](function(_0x50cf3c){if(_0x50cf3c){return _0x50cf3c?{'count':_0x195e86,'rows':_0x50cf3c}:null;}})[_0x8ee4('0x11')](respondWithResult(_0x1722d0,null))[_0x8ee4('0x43')](handleError(_0x1722d0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7067203..853585d 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 _0xb13b=['ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xb13b,0x1de));var _0xbb13=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb13b[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xbb13('0x0'));var ChatWebsite=require(_0xbb13('0x1'))['db'][_0xbb13('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbb13('0x3')](0x0);var events={'afterCreate':_0xbb13('0x4'),'afterUpdate':'update','afterDestroy':_0xbb13('0x5')};function emitEvent(_0x38600f){return function(_0x50898d,_0x9eab1b,_0x23a522){ChatWebsiteEvents[_0xbb13('0x6')](_0x38600f+':'+_0x50898d['id'],_0x50898d);ChatWebsiteEvents[_0xbb13('0x6')](_0x38600f,_0x50898d);_0x23a522(null);};}for(var e in events){if(events[_0xbb13('0x7')](e)){var event=events[e];ChatWebsite[_0xbb13('0x8')](e,emitEvent(event));}}module[_0xbb13('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5fd1=['save','emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners'];(function(_0x2044aa,_0xee9022){var _0x1a346e=function(_0x2e4194){while(--_0x2e4194){_0x2044aa['push'](_0x2044aa['shift']());}};_0x1a346e(++_0xee9022);}(_0x5fd1,0x155));var _0x15fd=function(_0xf14230,_0x251fbc){_0xf14230=_0xf14230-0x0;var _0x1acae1=_0x5fd1[_0xf14230];return _0x1acae1;};'use strict';var EventEmitter=require(_0x15fd('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x15fd('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x15fd('0x2')](0x0);var events={'afterCreate':_0x15fd('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x370d34){return function(_0x3138f3,_0x411b0e,_0x5e1d7e){ChatWebsiteEvents[_0x15fd('0x4')](_0x370d34+':'+_0x3138f3['id'],_0x3138f3);ChatWebsiteEvents[_0x15fd('0x4')](_0x370d34,_0x3138f3);_0x5e1d7e(null);};}for(var e in events){if(events[_0x15fd('0x5')](e)){var event=events[e];ChatWebsite[_0x15fd('0x6')](e,emitEvent(event));}}module[_0x15fd('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 d6669b9..eb57f33 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 _0x4e72=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','path'];(function(_0x470615,_0x1c7aaa){var _0x189c81=function(_0x398e12){while(--_0x398e12){_0x470615['push'](_0x470615['shift']());}};_0x189c81(++_0x1c7aaa);}(_0x4e72,0xc7));var _0x24e7=function(_0x173b7f,_0x12b928){_0x173b7f=_0x173b7f-0x0;var _0x2e0d96=_0x4e72[_0x173b7f];return _0x2e0d96;};'use strict';var _=require('lodash');var util=require(_0x24e7('0x0'));var logger=require(_0x24e7('0x1'))(_0x24e7('0x2'));var moment=require(_0x24e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x24e7('0x4'));var rimraf=require(_0x24e7('0x5'));var config=require(_0x24e7('0x6'));var attributes=require(_0x24e7('0x7'));module[_0x24e7('0x8')]=function(_0x2a3894,_0x595418){return _0x2a3894[_0x24e7('0x9')](_0x24e7('0xa'),attributes,{'tableName':_0x24e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x283d=['rimraf','../../config/environment','chat_websites','lodash','util','api','bluebird','request-promise'];(function(_0x29af87,_0x1bec48){var _0x5d887c=function(_0x642310){while(--_0x642310){_0x29af87['push'](_0x29af87['shift']());}};_0x5d887c(++_0x1bec48);}(_0x283d,0x15b));var _0xd283=function(_0x534bbc,_0x5d40fc){_0x534bbc=_0x534bbc-0x0;var _0x41117d=_0x283d[_0x534bbc];return _0x41117d;};'use strict';var _=require(_0xd283('0x0'));var util=require(_0xd283('0x1'));var logger=require('../../config/logger')(_0xd283('0x2'));var moment=require('moment');var BPromise=require(_0xd283('0x3'));var rp=require(_0xd283('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd283('0x5'));var config=require(_0xd283('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x43c84e,_0x480648){return _0x43c84e['define']('ChatWebsite',attributes,{'tableName':_0xd283('0x7'),'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 3c8f55c..61c3945 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 _0xe58a=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe58a,0x135));var _0xae58=function(_0x32e190,_0x5a1f71){_0x32e190=_0x32e190-0x0;var _0x3ff8fa=_0xe58a[_0x32e190];return _0x3ff8fa;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var moment=require(_0xae58('0x2'));var BPromise=require(_0xae58('0x3'));var rs=require(_0xae58('0x4'));var fs=require('fs');var Redis=require(_0xae58('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xae58('0x6'));var logger=require('../../config/logger')(_0xae58('0x7'));var config=require(_0xae58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xae58('0x9')][_0xae58('0xa')]({'port':0x232a});config[_0xae58('0xb')]=_[_0xae58('0xc')](config[_0xae58('0xb')],{'host':_0xae58('0xd'),'port':0x18eb});var socket=require(_0xae58('0xe'))(new Redis(config[_0xae58('0xb')]));require('./chatWebsite.socket')[_0xae58('0xf')](socket);function respondWithRpcPromise(_0x6468a7,_0x231799,_0x1d7d46){return new BPromise(function(_0x5eee47,_0x45cd17){return client[_0xae58('0x10')](_0x6468a7,_0x1d7d46)[_0xae58('0x11')](function(_0x3535d4){logger[_0xae58('0x12')](_0xae58('0x13'),_0x231799,_0xae58('0x14'));logger[_0xae58('0x15')](_0xae58('0x16'),_0x231799,_0xae58('0x14'),JSON[_0xae58('0x17')](_0x3535d4));if(_0x3535d4[_0xae58('0x18')]){if(_0x3535d4[_0xae58('0x18')][_0xae58('0x19')]===0x1f4){logger[_0xae58('0x18')](_0xae58('0x13'),_0x231799,_0x3535d4['error'][_0xae58('0x1a')]);return _0x45cd17(_0x3535d4['error'][_0xae58('0x1a')]);}logger[_0xae58('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x231799,_0x3535d4[_0xae58('0x18')]['message']);return _0x5eee47(_0x3535d4[_0xae58('0x18')][_0xae58('0x1a')]);}else{logger[_0xae58('0x12')](_0xae58('0x13'),_0x231799,'request\x20sent');_0x5eee47(_0x3535d4[_0xae58('0x1b')][_0xae58('0x1a')]);}})[_0xae58('0x1c')](function(_0x59be19){logger[_0xae58('0x18')](_0xae58('0x13'),_0x231799,_0x59be19);_0x45cd17(_0x59be19);});});} \ No newline at end of file +var _0x36f6=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x36f6,0x146));var _0x636f=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0x36f6[_0x591cfd];return _0x4d0100;};'use strict';var _=require(_0x636f('0x0'));var util=require(_0x636f('0x1'));var moment=require('moment');var BPromise=require(_0x636f('0x2'));var rs=require(_0x636f('0x3'));var fs=require('fs');var Redis=require(_0x636f('0x4'));var db=require(_0x636f('0x5'))['db'];var utils=require(_0x636f('0x6'));var logger=require(_0x636f('0x7'))('rpc');var config=require(_0x636f('0x8'));var jayson=require(_0x636f('0x9'));var client=jayson[_0x636f('0xa')]['http']({'port':0x232a});config[_0x636f('0xb')]=_[_0x636f('0xc')](config[_0x636f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x636f('0xd'))(new Redis(config[_0x636f('0xb')]));require('./chatWebsite.socket')[_0x636f('0xe')](socket);function respondWithRpcPromise(_0x41ee4d,_0x273e71,_0x50f969){return new BPromise(function(_0x50cdc0,_0x172a64){return client['request'](_0x41ee4d,_0x50f969)[_0x636f('0xf')](function(_0x56ec8e){logger[_0x636f('0x10')](_0x636f('0x11'),_0x273e71,'request\x20sent');logger[_0x636f('0x12')](_0x636f('0x13'),_0x273e71,'request\x20sent',JSON[_0x636f('0x14')](_0x56ec8e));if(_0x56ec8e[_0x636f('0x15')]){if(_0x56ec8e[_0x636f('0x15')][_0x636f('0x16')]===0x1f4){logger[_0x636f('0x15')](_0x636f('0x11'),_0x273e71,_0x56ec8e[_0x636f('0x15')][_0x636f('0x17')]);return _0x172a64(_0x56ec8e['error'][_0x636f('0x17')]);}logger[_0x636f('0x15')](_0x636f('0x11'),_0x273e71,_0x56ec8e[_0x636f('0x15')][_0x636f('0x17')]);return _0x50cdc0(_0x56ec8e[_0x636f('0x15')][_0x636f('0x17')]);}else{logger['info'](_0x636f('0x11'),_0x273e71,_0x636f('0x18'));_0x50cdc0(_0x56ec8e[_0x636f('0x19')][_0x636f('0x17')]);}})[_0x636f('0x1a')](function(_0x33e8b9){logger['error'](_0x636f('0x11'),_0x273e71,_0x33e8b9);_0x172a64(_0x33e8b9);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 74b250f..9e6c560 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 _0x4506=['./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x55c611,_0x3a7225){var _0x571068=function(_0x1a6f7a){while(--_0x1a6f7a){_0x55c611['push'](_0x55c611['shift']());}};_0x571068(++_0x3a7225);}(_0x4506,0x1ea));var _0x6450=function(_0x49fbff,_0x34dc46){_0x49fbff=_0x49fbff-0x0;var _0x2ca2fb=_0x4506[_0x49fbff];return _0x2ca2fb;};'use strict';var ChatWebsiteEvents=require(_0x6450('0x0'));var events=[_0x6450('0x1'),_0x6450('0x2'),_0x6450('0x3')];function createListener(_0x4b6325,_0x17e2d4){return function(_0x4f0f9e){_0x17e2d4[_0x6450('0x4')](_0x4b6325,_0x4f0f9e);};}function removeListener(_0x5a5099,_0x5acd73){return function(){ChatWebsiteEvents[_0x6450('0x5')](_0x5a5099,_0x5acd73);};}exports[_0x6450('0x6')]=function(_0x368027){for(var _0x15e119=0x0,_0x122b68=events['length'];_0x15e119<_0x122b68;_0x15e119++){var _0x475ca1=events[_0x15e119];var _0x426986=createListener('chatWebsite:'+_0x475ca1,_0x368027);ChatWebsiteEvents['on'](_0x475ca1,_0x426986);}}; \ No newline at end of file +var _0x5357=['length','chatWebsite:','save','remove','update','emit','register'];(function(_0x5a0c2d,_0xa01e7f){var _0x979d1e=function(_0x3311f7){while(--_0x3311f7){_0x5a0c2d['push'](_0x5a0c2d['shift']());}};_0x979d1e(++_0xa01e7f);}(_0x5357,0x12f));var _0x7535=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x5357[_0x2555d0];return _0x3bb486;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7535('0x0'),_0x7535('0x1'),_0x7535('0x2')];function createListener(_0x361d51,_0x2f6fbe){return function(_0x2e65ef){_0x2f6fbe[_0x7535('0x3')](_0x361d51,_0x2e65ef);};}function removeListener(_0x371ab9,_0x5af073){return function(){ChatWebsiteEvents['removeListener'](_0x371ab9,_0x5af073);};}exports[_0x7535('0x4')]=function(_0x4ebf3b){for(var _0x4fc4a6=0x0,_0x192036=events[_0x7535('0x5')];_0x4fc4a6<_0x192036;_0x4fc4a6++){var _0x5ec1bd=events[_0x4fc4a6];var _0x488561=createListener(_0x7535('0x6')+_0x5ec1bd,_0x4ebf3b);ChatWebsiteEvents['on'](_0x5ec1bd,_0x488561);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 86f7348..056b624 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 _0xf0ba=['%s-%s','now','originalname','/:id/logo','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','destroy','delete','removeDispositions','removeAgents','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x5aed17,_0x10274f){var _0x327c2c=function(_0x449d5d){while(--_0x449d5d){_0x5aed17['push'](_0x5aed17['shift']());}};_0x327c2c(++_0x10274f);}(_0xf0ba,0x15f));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var path=require('path');var timeout=require(_0xaf0b('0x2'));var express=require(_0xaf0b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf0b('0x4'));var config=require(_0xaf0b('0x5'));var controller=require(_0xaf0b('0x6'));router[_0xaf0b('0x7')]('/',auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x9')]);router[_0xaf0b('0x7')](_0xaf0b('0xa'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0xb')]);router[_0xaf0b('0x7')](_0xaf0b('0xc'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0xd')]);router[_0xaf0b('0x7')]('/:id/dispositions',auth[_0xaf0b('0x8')](),controller[_0xaf0b('0xe')]);router[_0xaf0b('0x7')](_0xaf0b('0xf'),auth[_0xaf0b('0x8')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0xaf0b('0x7')]('/:id/avatar',controller[_0xaf0b('0x10')]);router[_0xaf0b('0x7')](_0xaf0b('0x11'),controller['getCustomerAvatar']);router[_0xaf0b('0x7')](_0xaf0b('0x12'),controller[_0xaf0b('0x13')]);router[_0xaf0b('0x7')](_0xaf0b('0x14'),auth['isAuthenticated'](),controller[_0xaf0b('0x15')]);router[_0xaf0b('0x7')](_0xaf0b('0x16'),controller[_0xaf0b('0x17')]);router[_0xaf0b('0x7')](_0xaf0b('0x18'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x19')]);router['get']('/:id/proactive_actions',auth[_0xaf0b('0x8')](),controller['getProactiveActions']);router[_0xaf0b('0x7')]('/:id/fields',controller['getFields']);router[_0xaf0b('0x7')](_0xaf0b('0x1a'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x1b')]);router[_0xaf0b('0x7')](_0xaf0b('0x1c'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x1d')]);router[_0xaf0b('0x1e')]('/',auth['isAuthenticated'](),controller[_0xaf0b('0x1f')]);router[_0xaf0b('0x1e')](_0xaf0b('0x20'),auth[_0xaf0b('0x8')](),controller['addDisposition']);router[_0xaf0b('0x1e')](_0xaf0b('0xf'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x21')]);var upload=multer({'storage':multer[_0xaf0b('0x22')]({'destination':function(_0x58c65c,_0x37d935,_0x116b4b){_0x116b4b(null,path[_0xaf0b('0x23')](config[_0xaf0b('0x24')],_0xaf0b('0x25')));},'filename':function(_0x3322ed,_0x2ef217,_0x2e6490){_0x2e6490(null,util[_0xaf0b('0x26')](_0xaf0b('0x27'),Date[_0xaf0b('0x28')](),_0x2ef217[_0xaf0b('0x29')]));}})});router['post'](_0xaf0b('0x2a'),upload[_0xaf0b('0x2b')]('file'),controller[_0xaf0b('0x2c')]);var upload=multer({'storage':multer[_0xaf0b('0x22')]({'destination':function(_0x49774b,_0x5aff30,_0xbb140d){_0xbb140d(null,path[_0xaf0b('0x23')](config['root'],_0xaf0b('0x2d')));},'filename':function(_0x942e23,_0x3d7ca3,_0x42a7e1){_0x42a7e1(null,util[_0xaf0b('0x26')]('%s-%s',Date[_0xaf0b('0x28')](),_0x3d7ca3[_0xaf0b('0x29')]));}})});router[_0xaf0b('0x1e')]('/:id/avatar',upload[_0xaf0b('0x2b')](_0xaf0b('0x2e')),controller[_0xaf0b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28d336,_0x3a52ad,_0x521644){_0x521644(null,path[_0xaf0b('0x23')](config[_0xaf0b('0x24')],_0xaf0b('0x2d')));},'filename':function(_0x39a2b3,_0x40eb32,_0x1c960e){_0x1c960e(null,util[_0xaf0b('0x26')](_0xaf0b('0x27'),Date[_0xaf0b('0x28')](),_0x40eb32[_0xaf0b('0x29')]));}})});router[_0xaf0b('0x1e')](_0xaf0b('0x11'),upload[_0xaf0b('0x2b')](_0xaf0b('0x2e')),controller[_0xaf0b('0x30')]);var upload=multer({'storage':multer[_0xaf0b('0x22')]({'destination':function(_0x8f65e7,_0x2d45f1,_0x282856){_0x282856(null,path[_0xaf0b('0x23')](config[_0xaf0b('0x24')],'server/files/images/avatars/'));},'filename':function(_0x3dd0e9,_0x59fdaf,_0x1c4ece){_0x1c4ece(null,util['format'](_0xaf0b('0x27'),Date[_0xaf0b('0x28')](),_0x59fdaf[_0xaf0b('0x29')]));}})});router['post']('/:id/system_avatar',upload[_0xaf0b('0x2b')](_0xaf0b('0x2e')),controller[_0xaf0b('0x31')]);router[_0xaf0b('0x1e')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x4ba134,_0x3b8990,_0x4363fb){const _0x362074=path['join'](config[_0xaf0b('0x24')],_0xaf0b('0x32'),_0xaf0b('0x33'),_0xaf0b('0x34'));fs_extra['ensureDir'](_0x362074,function(){_0x4363fb(null,_0x362074);});},'filename':function(_0x34a661,_0xd22ca7,_0x50dc8c){const _0x5610e1=_0xd22ca7[_0xaf0b('0x29')][_0xaf0b('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3b7735=path[_0xaf0b('0x36')](_0x5610e1);const _0x2e59cc=Date[_0xaf0b('0x28')]()+'-'+_0x5610e1['replace'](_0x3b7735,'')+_0x3b7735;_0x50dc8c(null,_0x2e59cc);}})});router['post'](_0xaf0b('0x37'),offlineUploadMulter[_0xaf0b('0x38')](),controller[_0xaf0b('0x39')]);router[_0xaf0b('0x1e')]('/:id/interactions',auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x3a')]);router[_0xaf0b('0x1e')]('/:id/applications',auth[_0xaf0b('0x8')](),controller['addApplications']);router[_0xaf0b('0x1e')]('/:id/proactive_actions',auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x3b')]);router[_0xaf0b('0x1e')](_0xaf0b('0x1c'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x3c')]);router['put'](_0xaf0b('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xaf0b('0xc'),auth['isAuthenticated'](),controller[_0xaf0b('0x3d')]);router[_0xaf0b('0x3e')]('/:id/dispositions',auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x3f')]);router[_0xaf0b('0x3e')](_0xaf0b('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xaf0b('0x3e')](_0xaf0b('0x1c'),auth[_0xaf0b('0x8')](),controller[_0xaf0b('0x40')]);module['exports']=router; \ No newline at end of file +var _0x0790=['file','addLogo','root','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','create','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single'];(function(_0x7e95c8,_0x31df04){var _0x22c029=function(_0x39e784){while(--_0x39e784){_0x7e95c8['push'](_0x7e95c8['shift']());}};_0x22c029(++_0x31df04);}(_0x0790,0xac));var _0x0079=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x0790[_0x37756b];return _0x46efec;};'use strict';var multer=require('multer');var util=require(_0x0079('0x0'));var path=require(_0x0079('0x1'));var timeout=require(_0x0079('0x2'));var express=require('express');var router=express[_0x0079('0x3')]();var fs_extra=require(_0x0079('0x4'));var auth=require(_0x0079('0x5'));var interaction=require(_0x0079('0x6'));var config=require(_0x0079('0x7'));var controller=require(_0x0079('0x8'));router[_0x0079('0x9')]('/',auth[_0x0079('0xa')](),controller[_0x0079('0xb')]);router['get'](_0x0079('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x0079('0xd'),auth[_0x0079('0xa')](),controller[_0x0079('0xe')]);router['get'](_0x0079('0xf'),auth['isAuthenticated'](),controller[_0x0079('0x10')]);router['get'](_0x0079('0x11'),auth[_0x0079('0xa')](),controller['getAnswers']);router[_0x0079('0x9')](_0x0079('0x12'),controller['getLogo']);router[_0x0079('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x0079('0x13'),controller[_0x0079('0x14')]);router[_0x0079('0x9')]('/:id/system_avatar',controller[_0x0079('0x15')]);router[_0x0079('0x9')](_0x0079('0x16'),auth[_0x0079('0xa')](),controller[_0x0079('0x17')]);router['get'](_0x0079('0x18'),controller['getSnippet']);router[_0x0079('0x9')](_0x0079('0x19'),auth[_0x0079('0xa')](),controller[_0x0079('0x1a')]);router[_0x0079('0x9')](_0x0079('0x1b'),auth[_0x0079('0xa')](),controller[_0x0079('0x1c')]);router[_0x0079('0x9')](_0x0079('0x1d'),controller['getFields']);router[_0x0079('0x9')](_0x0079('0x1e'),auth[_0x0079('0xa')](),controller[_0x0079('0x1f')]);router[_0x0079('0x9')]('/:id/users',auth[_0x0079('0xa')](),controller['getAgents']);router['post']('/',auth[_0x0079('0xa')](),controller[_0x0079('0x20')]);router[_0x0079('0x21')](_0x0079('0xf'),auth[_0x0079('0xa')](),controller[_0x0079('0x22')]);router[_0x0079('0x21')](_0x0079('0x11'),auth[_0x0079('0xa')](),controller[_0x0079('0x23')]);var upload=multer({'storage':multer[_0x0079('0x24')]({'destination':function(_0xbe46fb,_0x3704d1,_0x2bc10d){_0x2bc10d(null,path[_0x0079('0x25')](config['root'],_0x0079('0x26')));},'filename':function(_0x1339a3,_0x3da9f3,_0x466292){_0x466292(null,util[_0x0079('0x27')](_0x0079('0x28'),Date[_0x0079('0x29')](),_0x3da9f3[_0x0079('0x2a')]));}})});router[_0x0079('0x21')](_0x0079('0x12'),upload[_0x0079('0x2b')](_0x0079('0x2c')),controller[_0x0079('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x426949,_0x2b052f,_0x77cd9b){_0x77cd9b(null,path[_0x0079('0x25')](config[_0x0079('0x2e')],_0x0079('0x2f')));},'filename':function(_0x496a2f,_0xffb28b,_0x2d4d53){_0x2d4d53(null,util[_0x0079('0x27')](_0x0079('0x28'),Date[_0x0079('0x29')](),_0xffb28b['originalname']));}})});router[_0x0079('0x21')](_0x0079('0x30'),upload[_0x0079('0x2b')](_0x0079('0x2c')),controller[_0x0079('0x31')]);var upload=multer({'storage':multer[_0x0079('0x24')]({'destination':function(_0x598dbb,_0x1001bd,_0x426565){_0x426565(null,path[_0x0079('0x25')](config[_0x0079('0x2e')],_0x0079('0x2f')));},'filename':function(_0x237b84,_0xb7f91c,_0x544fde){_0x544fde(null,util[_0x0079('0x27')](_0x0079('0x28'),Date['now'](),_0xb7f91c[_0x0079('0x2a')]));}})});router[_0x0079('0x21')](_0x0079('0x13'),upload[_0x0079('0x2b')](_0x0079('0x2c')),controller[_0x0079('0x32')]);var upload=multer({'storage':multer[_0x0079('0x24')]({'destination':function(_0x2128ba,_0xa608de,_0x1b238c){_0x1b238c(null,path[_0x0079('0x25')](config[_0x0079('0x2e')],_0x0079('0x2f')));},'filename':function(_0x58c4ca,_0x4dbdfd,_0x35ebf5){_0x35ebf5(null,util['format'](_0x0079('0x28'),Date[_0x0079('0x29')](),_0x4dbdfd[_0x0079('0x2a')]));}})});router[_0x0079('0x21')]('/:id/system_avatar',upload[_0x0079('0x2b')](_0x0079('0x2c')),controller[_0x0079('0x33')]);router[_0x0079('0x21')]('/:id/notify',controller[_0x0079('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1a699a,_0x2f9ebd,_0x23ea0d){const _0x10a395=path[_0x0079('0x25')](config['root'],_0x0079('0x35'),_0x0079('0x36'),_0x0079('0x37'));fs_extra[_0x0079('0x38')](_0x10a395,function(){_0x23ea0d(null,_0x10a395);});},'filename':function(_0x3dd79f,_0x1e0e13,_0x11ff3e){const _0x503d4e=_0x1e0e13[_0x0079('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f813a=path[_0x0079('0x39')](_0x503d4e);const _0x139e6e=Date[_0x0079('0x29')]()+'-'+_0x503d4e[_0x0079('0x3a')](_0x4f813a,'')+_0x4f813a;_0x11ff3e(null,_0x139e6e);}})});router[_0x0079('0x21')](_0x0079('0x3b'),offlineUploadMulter[_0x0079('0x3c')](),controller[_0x0079('0x3d')]);router[_0x0079('0x21')](_0x0079('0x16'),auth[_0x0079('0xa')](),controller['addInteraction']);router[_0x0079('0x21')](_0x0079('0x19'),auth[_0x0079('0xa')](),controller[_0x0079('0x3e')]);router[_0x0079('0x21')](_0x0079('0x1b'),auth[_0x0079('0xa')](),controller[_0x0079('0x3f')]);router[_0x0079('0x21')]('/:id/users',auth[_0x0079('0xa')](),controller[_0x0079('0x40')]);router[_0x0079('0x41')](_0x0079('0xd'),auth[_0x0079('0xa')](),controller[_0x0079('0x42')]);router[_0x0079('0x43')](_0x0079('0xd'),auth[_0x0079('0xa')](),controller[_0x0079('0x44')]);router[_0x0079('0x43')](_0x0079('0xf'),auth[_0x0079('0xa')](),controller['removeDispositions']);router[_0x0079('0x43')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0079('0x45')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x0079('0x46')]);module[_0x0079('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 4b566af..beabbf9 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 _0xfdf8=['express','../components/auth/service','../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x49c42f,_0x2c5628){var _0x4b9972=function(_0x2a92da){while(--_0x2a92da){_0x49c42f['push'](_0x49c42f['shift']());}};_0x4b9972(++_0x2c5628);}(_0xfdf8,0x1ec));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8fdf('0x0'));var auth=require(_0x8fdf('0x1'));var config=require(_0x8fdf('0x2'));var router=express[_0x8fdf('0x3')]();var isProduction=config[_0x8fdf('0x4')]===_0x8fdf('0x5')||![];function clientSideLogs(_0x19a5c9,_0x45e635,_0x5e8df6){var _0x102c3b=_0x19a5c9[_0x8fdf('0x6')]['get']('client-side-logger');if(!_0x102c3b){throw new Error(_0x8fdf('0x7'));}return beaverLogger[_0x8fdf('0x8')]({'uri':_0x8fdf('0x9'),'logger':_0x102c3b,'enableCors':!isProduction})(_0x19a5c9,_0x45e635,_0x5e8df6);}router[_0x8fdf('0xa')](auth[_0x8fdf('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xdda1=['../config/environment','Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x674941,_0x43e51e){var _0x1420e9=function(_0x3f065d){while(--_0x3f065d){_0x674941['push'](_0x674941['shift']());}};_0x1420e9(++_0x43e51e);}(_0xdda1,0x1dd));var _0x1dda=function(_0x48b00c,_0x512b4f){_0x48b00c=_0x48b00c-0x0;var _0x350a08=_0xdda1[_0x48b00c];return _0x350a08;};var beaverLogger=require(_0x1dda('0x0'));var express=require(_0x1dda('0x1'));var auth=require(_0x1dda('0x2'));var config=require(_0x1dda('0x3'));var router=express[_0x1dda('0x4')]();var isProduction=config[_0x1dda('0x5')]===_0x1dda('0x6')||![];function clientSideLogs(_0x131d4c,_0x5bc5a1,_0x1a6a33){var _0x25a324=_0x131d4c[_0x1dda('0x7')][_0x1dda('0x8')]('client-side-logger');if(!_0x25a324){throw new Error(_0x1dda('0x9'));}return beaverLogger[_0x1dda('0xa')]({'uri':_0x1dda('0xb'),'logger':_0x25a324,'enableCors':!isProduction})(_0x131d4c,_0x5bc5a1,_0x1a6a33);}router[_0x1dda('0xc')](auth[_0x1dda('0xd')](),clientSideLogs);module[_0x1dda('0xe')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index a04ef6c..e2ddb19 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 _0xa08c=['Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x47578f,_0xc85bd8){var _0x191e91=function(_0x339c74){while(--_0x339c74){_0x47578f['push'](_0x47578f['shift']());}};_0x191e91(++_0xc85bd8);}(_0xa08c,0x77));var _0xca08=function(_0x212a74,_0x45f93c){_0x212a74=_0x212a74-0x0;var _0x5dc1fe=_0xa08c[_0x212a74];return _0x5dc1fe;};'use strict';var Sequelize=require(_0xca08('0x0'));module[_0xca08('0x1')]={'name':{'type':Sequelize[_0xca08('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xca08('0x3'),_0xca08('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xca08('0x5')](_0xca08('0x6'),_0xca08('0x7'))},'data1':{'type':Sequelize[_0xca08('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xca08('0x2')],'comment':_0xca08('0x8')},'data3':{'type':Sequelize[_0xca08('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xca08('0x2')],'comment':_0xca08('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0xca08('0xa')},'data6':{'type':Sequelize[_0xca08('0xb')],'comment':_0xca08('0xc')},'data7':{'type':Sequelize[_0xca08('0xb')],'comment':_0xca08('0xd')}}; \ No newline at end of file +var _0xb6a6=['exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize'];(function(_0x3d131a,_0x2ee691){var _0x44c22d=function(_0xa7a9fe){while(--_0xa7a9fe){_0x3d131a['push'](_0x3d131a['shift']());}};_0x44c22d(++_0x2ee691);}(_0xb6a6,0xe0));var _0x6b6a=function(_0xb2a658,_0x148944){_0xb2a658=_0xb2a658-0x0;var _0x1268ca=_0xb6a6[_0xb2a658];return _0x1268ca;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'name':{'type':Sequelize[_0x6b6a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x6b6a('0x3'),_0x6b6a('0x4'),_0x6b6a('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6b6a('0x6')](_0x6b6a('0x7'),_0x6b6a('0x8'))},'data1':{'type':Sequelize[_0x6b6a('0x2')],'comment':_0x6b6a('0x9')},'data2':{'type':Sequelize[_0x6b6a('0x2')],'comment':_0x6b6a('0xa')},'data3':{'type':Sequelize[_0x6b6a('0x2')],'comment':_0x6b6a('0xb')},'data4':{'type':Sequelize[_0x6b6a('0x2')],'comment':_0x6b6a('0xc')},'data5':{'type':Sequelize[_0x6b6a('0xd')],'comment':_0x6b6a('0xe')},'data6':{'type':Sequelize[_0x6b6a('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x6b6a('0xd')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 2872ad5..c75e73c 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 _0x278b=['del','code','access_token','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','destroy','error','stack','name','send','padEnd','map','CloudProvider','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','service','decryptString','data3','show','params','rawAttributes','MicrosoftAzure','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','find','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','id_token','oauth2Claims'];(function(_0xd86b18,_0x16e22d){var _0x496606=function(_0x4d881b){while(--_0x4d881b){_0xd86b18['push'](_0xd86b18['shift']());}};_0x496606(++_0x16e22d);}(_0x278b,0x183));var _0xb278=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x278b[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xb278('0x0'));var Redis=require(_0xb278('0x1'));var qs=require(_0xb278('0x2'));var encryptor=require(_0xb278('0x3'));var config=require(_0xb278('0x4'));var logger=require(_0xb278('0x5'))('api');var db=require(_0xb278('0x6'))['db'];var oauth=require(_0xb278('0x7'));config[_0xb278('0x8')]=_[_0xb278('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb278('0xa'))(new Redis(config[_0xb278('0x8')]));var redis=new Redis(config[_0xb278('0x8')]);function respondWithStatusCode(_0xc314b5,_0x19e61e){_0x19e61e=_0x19e61e||0xcc;return function(_0x2b2f2c){if(_0x2b2f2c){return _0xc314b5[_0xb278('0xb')](_0x19e61e);}return _0xc314b5[_0xb278('0xc')](_0x19e61e)[_0xb278('0xd')]();};}function respondWithResult(_0x27f857,_0x1041a4){_0x1041a4=_0x1041a4||0xc8;return function(_0x426ff1){if(_0x426ff1){return _0x27f857['status'](_0x1041a4)[_0xb278('0xe')](_0x426ff1);}};}function respondWithFilteredResult(_0x2a39c9,_0x454ff1){return function(_0x13bf2b){if(_0x13bf2b){var _0x7bdf01=typeof _0x454ff1['offset']===_0xb278('0xf')&&typeof _0x454ff1[_0xb278('0x10')]===_0xb278('0xf');var _0x31c68b=_0x13bf2b[_0xb278('0x11')];var _0x2a5864=_0x7bdf01?0x0:_0x454ff1['offset'];var _0x20d34a=_0x7bdf01?_0x13bf2b['count']:_0x454ff1[_0xb278('0x12')]+_0x454ff1[_0xb278('0x10')];var _0x508fb2;if(_0x20d34a>=_0x31c68b){_0x20d34a=_0x31c68b;_0x508fb2=0xc8;}else{_0x508fb2=0xce;}_0x2a39c9[_0xb278('0xc')](_0x508fb2);return _0x2a39c9['set'](_0xb278('0x13'),_0x2a5864+'-'+_0x20d34a+'/'+_0x31c68b)[_0xb278('0xe')](_0x13bf2b);}return null;};}function saveUpdates(_0x99605f){return function(_0x3070f7){if(_0x3070f7){return _0x3070f7[_0xb278('0x14')](_0x99605f)[_0xb278('0x15')](function(_0x5f5376){return _0x5f5376;});}return null;};}function removeEntity(_0xfc900e){return function(_0x1d32e6){if(_0x1d32e6){return _0x1d32e6[_0xb278('0x16')]()[_0xb278('0x15')](function(){_0xfc900e['status'](0xcc)[_0xb278('0xd')]();});}};}function handleEntityNotFound(_0x3aa98d){return function(_0x2c161a){if(!_0x2c161a){_0x3aa98d[_0xb278('0xb')](0x194);}return _0x2c161a;};}function handleError(_0x1bbd7c,_0x3f8c0e){_0x3f8c0e=_0x3f8c0e||0x1f4;return function(_0x3c64b4){logger[_0xb278('0x17')](_0x3c64b4[_0xb278('0x18')]);if(_0x3c64b4[_0xb278('0x19')]){delete _0x3c64b4[_0xb278('0x19')];}_0x1bbd7c[_0xb278('0xc')](_0x3f8c0e)[_0xb278('0x1a')](_0x3c64b4);};}function maskClientSecret(_0x339365){return _[_0xb278('0x1b')](_0x339365['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x11f3ca,_0x4ac881){var _0x52d11c={},_0x3e6c0d={},_0x4d0e84={'count':0x0,'rows':[]};var _0x1b56e7=_[_0xb278('0x1c')](db[_0xb278('0x1d')]['rawAttributes'],function(_0x202055){return{'name':_0x202055[_0xb278('0x1e')],'type':_0x202055[_0xb278('0x1f')][_0xb278('0x20')]};});_0x3e6c0d['model']=_['map'](_0x1b56e7,_0xb278('0x19'));_0x3e6c0d[_0xb278('0x21')]=_[_0xb278('0x22')](_0x11f3ca[_0xb278('0x21')]);_0x3e6c0d['filters']=_[_0xb278('0x23')](_0x3e6c0d[_0xb278('0x24')],_0x3e6c0d[_0xb278('0x21')]);_0x52d11c[_0xb278('0x25')]=_[_0xb278('0x23')](_0x3e6c0d[_0xb278('0x24')],qs['fields'](_0x11f3ca[_0xb278('0x21')][_0xb278('0x26')]));_0x52d11c[_0xb278('0x25')]=_0x52d11c[_0xb278('0x25')][_0xb278('0x27')]?_0x52d11c['attributes']:_0x3e6c0d[_0xb278('0x24')];if(!_0x11f3ca[_0xb278('0x21')][_0xb278('0x28')]('nolimit')){_0x52d11c[_0xb278('0x10')]=qs['limit'](_0x11f3ca[_0xb278('0x21')][_0xb278('0x10')]);_0x52d11c['offset']=qs[_0xb278('0x12')](_0x11f3ca['query']['offset']);}_0x52d11c[_0xb278('0x29')]=qs['sort'](_0x11f3ca['query'][_0xb278('0x2a')]);_0x52d11c[_0xb278('0x2b')]=qs[_0xb278('0x2c')](_[_0xb278('0x2d')](_0x11f3ca[_0xb278('0x21')],_0x3e6c0d[_0xb278('0x2c')]),_0x1b56e7);if(_0x11f3ca[_0xb278('0x21')]['filter']){_0x52d11c[_0xb278('0x2b')]=_[_0xb278('0x2e')](_0x52d11c[_0xb278('0x2b')],{'$or':_[_0xb278('0x1c')](_0x1b56e7,function(_0x2d3a2f){if(_0x2d3a2f[_0xb278('0x1f')]!==_0xb278('0x2f')){var _0xc76d89={};_0xc76d89[_0x2d3a2f['name']]={'$like':'%'+_0x11f3ca[_0xb278('0x21')][_0xb278('0x30')]+'%'};return _0xc76d89;}})});}_0x52d11c=_[_0xb278('0x2e')]({},_0x52d11c,_0x11f3ca[_0xb278('0x31')]);var _0x349942={'where':_0x52d11c[_0xb278('0x2b')]};return db[_0xb278('0x1d')][_0xb278('0x11')](_0x349942)[_0xb278('0x15')](function(_0x53f28b){_0x4d0e84['count']=_0x53f28b;if(_0x11f3ca['query'][_0xb278('0x32')]){_0x52d11c[_0xb278('0x33')]=[{'all':!![]}];}return db[_0xb278('0x1d')][_0xb278('0x34')](_0x52d11c);})[_0xb278('0x15')](function(_0x576d40){_0x4d0e84['rows']=_[_0xb278('0x1c')](_0x576d40,function(_0x44d906){if(_0x44d906[_0xb278('0x35')]==='MicrosoftAzure'){var _0x55a246=encryptor[_0xb278('0x36')](_0x44d906[_0xb278('0x37')]);_0x44d906['data3']=maskClientSecret(_0x55a246);}return _0x44d906;});return _0x4d0e84;})['then'](respondWithFilteredResult(_0x4ac881,_0x52d11c))['catch'](handleError(_0x4ac881,null));};exports[_0xb278('0x38')]=function(_0x314b8b,_0x5203fd){var _0x210209={'raw':!![],'where':{'id':_0x314b8b[_0xb278('0x39')]['id']}},_0x49e18a={};_0x49e18a['model']=_[_0xb278('0x22')](db[_0xb278('0x1d')][_0xb278('0x3a')]);_0x49e18a[_0xb278('0x21')]=_['keys'](_0x314b8b['query']);_0x49e18a[_0xb278('0x2c')]=_['intersection'](_0x49e18a[_0xb278('0x24')],_0x49e18a[_0xb278('0x21')]);_0x210209[_0xb278('0x25')]=_[_0xb278('0x23')](_0x49e18a[_0xb278('0x24')],qs[_0xb278('0x26')](_0x314b8b[_0xb278('0x21')][_0xb278('0x26')]));_0x210209['attributes']=_0x210209[_0xb278('0x25')][_0xb278('0x27')]?_0x210209[_0xb278('0x25')]:_0x49e18a['model'];if(_0x314b8b[_0xb278('0x21')][_0xb278('0x32')]){_0x210209[_0xb278('0x33')]=[{'all':!![]}];}_0x210209=_[_0xb278('0x2e')]({},_0x210209,_0x314b8b[_0xb278('0x31')]);return db[_0xb278('0x1d')]['find'](_0x210209)[_0xb278('0x15')](handleEntityNotFound(_0x5203fd,null))[_0xb278('0x15')](function(_0x333bf0){if(_0x333bf0[_0xb278('0x35')]===_0xb278('0x3b')){var _0x2e4328=encryptor[_0xb278('0x36')](_0x333bf0[_0xb278('0x37')]);_0x333bf0['data3']=maskClientSecret(_0x2e4328);}return _0x333bf0;})[_0xb278('0x15')](respondWithResult(_0x5203fd,null))[_0xb278('0x3c')](handleError(_0x5203fd,null));};exports[_0xb278('0x3d')]=function(_0x76768,_0x3fcd14){if(!_0x76768[_0xb278('0x3e')][_0xb278('0x19')])throw new Error(_0xb278('0x3f'));if(!_0x76768[_0xb278('0x3e')][_0xb278('0x35')])throw new Error(_0xb278('0x40'));var _0x50ddd5=db[_0xb278('0x1d')]['rawAttributes'][_0xb278('0x35')][_0xb278('0x41')];if(!_0x50ddd5[_0xb278('0x42')](_0x76768[_0xb278('0x3e')][_0xb278('0x35')]))throw new Error(_0xb278('0x43')+_0x50ddd5[_0xb278('0x44')](',\x20'));if(_0x76768[_0xb278('0x3e')][_0xb278('0x35')]===_0xb278('0x3b')&&_0x76768[_0xb278('0x3e')]['data3']){_0x76768[_0xb278('0x3e')][_0xb278('0x37')]=encryptor['encryptString'](_0x76768[_0xb278('0x3e')][_0xb278('0x37')]);}return db[_0xb278('0x1d')]['create'](_0x76768[_0xb278('0x3e')],{})[_0xb278('0x15')](respondWithResult(_0x3fcd14,0xc9))['catch'](handleError(_0x3fcd14,null));};exports[_0xb278('0x14')]=function(_0x17b475,_0x436019){if(_0x17b475[_0xb278('0x3e')]['id']){delete _0x17b475[_0xb278('0x3e')]['id'];}return db['CloudProvider'][_0xb278('0x45')]({'where':{'id':_0x17b475[_0xb278('0x39')]['id']}})['then'](handleEntityNotFound(_0x436019,null))[_0xb278('0x15')](function(_0x3f2301){if(_0x3f2301['service']==='MicrosoftAzure'&&_0x17b475[_0xb278('0x3e')][_0xb278('0x37')]){_0x17b475[_0xb278('0x3e')][_0xb278('0x37')]=encryptor[_0xb278('0x46')](_0x17b475[_0xb278('0x3e')][_0xb278('0x37')]);}return _0x3f2301;})[_0xb278('0x15')](saveUpdates(_0x17b475[_0xb278('0x3e')],null))['then'](respondWithResult(_0x436019,null))[_0xb278('0x3c')](handleError(_0x436019,null));};exports[_0xb278('0x16')]=function(_0xd3ec6d,_0x3a8731){return db[_0xb278('0x1d')][_0xb278('0x45')]({'where':{'id':_0xd3ec6d[_0xb278('0x39')]['id']}})[_0xb278('0x15')](handleEntityNotFound(_0x3a8731,null))[_0xb278('0x15')](removeEntity(_0x3a8731,null))['catch'](handleError(_0x3a8731,null));};exports[_0xb278('0x47')]=function(_0xd587dd,_0x1196c9){return db[_0xb278('0x1d')]['findOne']({'where':{'id':_0xd587dd[_0xb278('0x39')]['id']},'raw':!![]})[_0xb278('0x15')](function(_0x23b2d2){if(!_0x23b2d2)return _0x1196c9[_0xb278('0xb')](0x194);return{'url':oauth[_0xb278('0x48')](_0x23b2d2,_0xd587dd['user']['id'])};})[_0xb278('0x15')](respondWithResult(_0x1196c9,null))[_0xb278('0x3c')](handleError(_0x1196c9,null));};exports[_0xb278('0x49')]=function(_0x57536f,_0xbfa766){var _0xc8793a=_0x57536f[_0xb278('0x3e')];var _0x362093;var _0xde85e3;if(_0xc8793a[_0xb278('0x17')])throw _0xc8793a;redis[_0xb278('0x4a')](_0xc8793a[_0xb278('0x4b')])[_0xb278('0x15')](function(_0x457403){if(!_0x457403)throw new Error('Invalid\x20state\x20parameter');_0x362093=JSON['parse'](_0x457403);var _0x1b99a9=Buffer[_0xb278('0x4c')](_0xc8793a[_0xb278('0x4b')],_0xb278('0x4d'))[_0xb278('0x4e')](_0xb278('0x4f'));_0xde85e3=JSON[_0xb278('0x50')](_0x1b99a9);if(!oauth['isValidIdToken'](_0xc8793a[_0xb278('0x51')],_0x362093[_0xb278('0x52')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb278('0x53')](_0xc8793a[_0xb278('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0xc8793a[_0xb278('0x54')],_0x362093);})['then'](function(_0x2eccae){_0x362093['data5']=_0x2eccae[_0xb278('0x55')];_0x362093['data6']=_0x2eccae[_0xb278('0x56')];return db['CloudProvider'][_0xb278('0x14')]({'data5':_0x362093['data5'],'data6':_0x362093['data6']},{'where':{'id':_0x362093['id']}});})[_0xb278('0x15')](function(){oauth['startRefreshInterval'](_0x362093);socket['emit'](_0xb278('0x57'),{'id':_0xde85e3['id']});return;})['then'](respondWithStatusCode(_0xbfa766,null))['catch'](function(_0x54552f){if(_0xde85e3){socket[_0xb278('0x58')](_0xb278('0x59'),{'id':_0xde85e3['id']});}if(!_0x362093){logger['error'](_0xb278('0x5a'),_0x54552f);return _0xbfa766[_0xb278('0xc')](0x1f4)[_0xb278('0x1a')](_0x54552f[_0xb278('0x5b')]);}logger['error'](_0xb278('0x5c'),_0x362093['id'],JSON[_0xb278('0x5d')](_0x54552f));});}; \ No newline at end of file +var _0x2f6f=['values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','localhost','status','end','offset','limit','undefined','count','set','Content-Range','then','sendStatus','error','stack','name','padEnd','slice','index','CloudProvider','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified'];(function(_0x4d76cd,_0x223936){var _0x47c6ca=function(_0x40418a){while(--_0x40418a){_0x4d76cd['push'](_0x4d76cd['shift']());}};_0x47c6ca(++_0x223936);}(_0x2f6f,0xdf));var _0xf2f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f6f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf2f6('0x0'));var Redis=require(_0xf2f6('0x1'));var qs=require(_0xf2f6('0x2'));var encryptor=require(_0xf2f6('0x3'));var config=require(_0xf2f6('0x4'));var logger=require(_0xf2f6('0x5'))(_0xf2f6('0x6'));var db=require(_0xf2f6('0x7'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xf2f6('0x8')](config[_0xf2f6('0x9')],{'host':_0xf2f6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2f6('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x553571,_0x379a48){_0x379a48=_0x379a48||0xcc;return function(_0x30bef7){if(_0x30bef7){return _0x553571['sendStatus'](_0x379a48);}return _0x553571[_0xf2f6('0xb')](_0x379a48)[_0xf2f6('0xc')]();};}function respondWithResult(_0x1b60d8,_0xfdc2cb){_0xfdc2cb=_0xfdc2cb||0xc8;return function(_0x23b3a5){if(_0x23b3a5){return _0x1b60d8['status'](_0xfdc2cb)['json'](_0x23b3a5);}};}function respondWithFilteredResult(_0x2c3d4c,_0x287cc0){return function(_0x5ae1c6){if(_0x5ae1c6){var _0xa70782=typeof _0x287cc0[_0xf2f6('0xd')]==='undefined'&&typeof _0x287cc0[_0xf2f6('0xe')]===_0xf2f6('0xf');var _0x55ceee=_0x5ae1c6[_0xf2f6('0x10')];var _0x50c33f=_0xa70782?0x0:_0x287cc0[_0xf2f6('0xd')];var _0x39b105=_0xa70782?_0x5ae1c6['count']:_0x287cc0[_0xf2f6('0xd')]+_0x287cc0[_0xf2f6('0xe')];var _0x411d9f;if(_0x39b105>=_0x55ceee){_0x39b105=_0x55ceee;_0x411d9f=0xc8;}else{_0x411d9f=0xce;}_0x2c3d4c[_0xf2f6('0xb')](_0x411d9f);return _0x2c3d4c[_0xf2f6('0x11')](_0xf2f6('0x12'),_0x50c33f+'-'+_0x39b105+'/'+_0x55ceee)['json'](_0x5ae1c6);}return null;};}function saveUpdates(_0x4204e0){return function(_0xdb8ba9){if(_0xdb8ba9){return _0xdb8ba9['update'](_0x4204e0)[_0xf2f6('0x13')](function(_0x4dfe58){return _0x4dfe58;});}return null;};}function removeEntity(_0x34050e){return function(_0x10e26a){if(_0x10e26a){return _0x10e26a['destroy']()[_0xf2f6('0x13')](function(){_0x34050e[_0xf2f6('0xb')](0xcc)[_0xf2f6('0xc')]();});}};}function handleEntityNotFound(_0x45d32b){return function(_0x1278a8){if(!_0x1278a8){_0x45d32b[_0xf2f6('0x14')](0x194);}return _0x1278a8;};}function handleError(_0x3fd631,_0x401fa9){_0x401fa9=_0x401fa9||0x1f4;return function(_0x17331a){logger[_0xf2f6('0x15')](_0x17331a[_0xf2f6('0x16')]);if(_0x17331a[_0xf2f6('0x17')]){delete _0x17331a['name'];}_0x3fd631['status'](_0x401fa9)['send'](_0x17331a);};}function maskClientSecret(_0x231f6a){return _[_0xf2f6('0x18')](_0x231f6a[_0xf2f6('0x19')](0x0,0x3),0x14,'*');}exports[_0xf2f6('0x1a')]=function(_0x51a27c,_0x214143){var _0x4f352f={},_0x509fce={},_0x30a464={'count':0x0,'rows':[]};var _0x149c0a=_['map'](db[_0xf2f6('0x1b')][_0xf2f6('0x1c')],function(_0x38f014){return{'name':_0x38f014['fieldName'],'type':_0x38f014[_0xf2f6('0x1d')][_0xf2f6('0x1e')]};});_0x509fce[_0xf2f6('0x1f')]=_['map'](_0x149c0a,_0xf2f6('0x17'));_0x509fce[_0xf2f6('0x20')]=_[_0xf2f6('0x21')](_0x51a27c[_0xf2f6('0x20')]);_0x509fce[_0xf2f6('0x22')]=_['intersection'](_0x509fce['model'],_0x509fce[_0xf2f6('0x20')]);_0x4f352f[_0xf2f6('0x23')]=_[_0xf2f6('0x24')](_0x509fce['model'],qs[_0xf2f6('0x25')](_0x51a27c[_0xf2f6('0x20')][_0xf2f6('0x25')]));_0x4f352f[_0xf2f6('0x23')]=_0x4f352f[_0xf2f6('0x23')][_0xf2f6('0x26')]?_0x4f352f[_0xf2f6('0x23')]:_0x509fce[_0xf2f6('0x1f')];if(!_0x51a27c[_0xf2f6('0x20')]['hasOwnProperty'](_0xf2f6('0x27'))){_0x4f352f[_0xf2f6('0xe')]=qs['limit'](_0x51a27c[_0xf2f6('0x20')][_0xf2f6('0xe')]);_0x4f352f[_0xf2f6('0xd')]=qs[_0xf2f6('0xd')](_0x51a27c[_0xf2f6('0x20')][_0xf2f6('0xd')]);}_0x4f352f[_0xf2f6('0x28')]=qs['sort'](_0x51a27c['query'][_0xf2f6('0x29')]);_0x4f352f[_0xf2f6('0x2a')]=qs[_0xf2f6('0x22')](_[_0xf2f6('0x2b')](_0x51a27c[_0xf2f6('0x20')],_0x509fce[_0xf2f6('0x22')]),_0x149c0a);if(_0x51a27c[_0xf2f6('0x20')]['filter']){_0x4f352f[_0xf2f6('0x2a')]=_[_0xf2f6('0x2c')](_0x4f352f[_0xf2f6('0x2a')],{'$or':_[_0xf2f6('0x2d')](_0x149c0a,function(_0x5a8953){if(_0x5a8953[_0xf2f6('0x1d')]!=='VIRTUAL'){var _0x8d57be={};_0x8d57be[_0x5a8953[_0xf2f6('0x17')]]={'$like':'%'+_0x51a27c[_0xf2f6('0x20')][_0xf2f6('0x2e')]+'%'};return _0x8d57be;}})});}_0x4f352f=_[_0xf2f6('0x2c')]({},_0x4f352f,_0x51a27c[_0xf2f6('0x2f')]);var _0x22e652={'where':_0x4f352f[_0xf2f6('0x2a')]};return db[_0xf2f6('0x1b')]['count'](_0x22e652)[_0xf2f6('0x13')](function(_0x4ae262){_0x30a464[_0xf2f6('0x10')]=_0x4ae262;if(_0x51a27c[_0xf2f6('0x20')][_0xf2f6('0x30')]){_0x4f352f['include']=[{'all':!![]}];}return db[_0xf2f6('0x1b')][_0xf2f6('0x31')](_0x4f352f);})[_0xf2f6('0x13')](function(_0x597fdd){_0x30a464[_0xf2f6('0x32')]=_[_0xf2f6('0x2d')](_0x597fdd,function(_0x439789){if(_0x439789[_0xf2f6('0x33')]===_0xf2f6('0x34')){var _0x1b8ab7=encryptor[_0xf2f6('0x35')](_0x439789[_0xf2f6('0x36')]);_0x439789['data3']=maskClientSecret(_0x1b8ab7);}return _0x439789;});return _0x30a464;})[_0xf2f6('0x13')](respondWithFilteredResult(_0x214143,_0x4f352f))[_0xf2f6('0x37')](handleError(_0x214143,null));};exports[_0xf2f6('0x38')]=function(_0x3b5bd4,_0x55e6df){var _0x4c8767={'raw':!![],'where':{'id':_0x3b5bd4[_0xf2f6('0x39')]['id']}},_0x2cf545={};_0x2cf545['model']=_['keys'](db[_0xf2f6('0x1b')]['rawAttributes']);_0x2cf545[_0xf2f6('0x20')]=_[_0xf2f6('0x21')](_0x3b5bd4[_0xf2f6('0x20')]);_0x2cf545[_0xf2f6('0x22')]=_[_0xf2f6('0x24')](_0x2cf545[_0xf2f6('0x1f')],_0x2cf545[_0xf2f6('0x20')]);_0x4c8767[_0xf2f6('0x23')]=_[_0xf2f6('0x24')](_0x2cf545[_0xf2f6('0x1f')],qs[_0xf2f6('0x25')](_0x3b5bd4[_0xf2f6('0x20')][_0xf2f6('0x25')]));_0x4c8767[_0xf2f6('0x23')]=_0x4c8767['attributes'][_0xf2f6('0x26')]?_0x4c8767[_0xf2f6('0x23')]:_0x2cf545[_0xf2f6('0x1f')];if(_0x3b5bd4[_0xf2f6('0x20')][_0xf2f6('0x30')]){_0x4c8767['include']=[{'all':!![]}];}_0x4c8767=_['merge']({},_0x4c8767,_0x3b5bd4[_0xf2f6('0x2f')]);return db[_0xf2f6('0x1b')][_0xf2f6('0x3a')](_0x4c8767)[_0xf2f6('0x13')](handleEntityNotFound(_0x55e6df,null))[_0xf2f6('0x13')](function(_0x4fb59a){if(_0x4fb59a[_0xf2f6('0x33')]===_0xf2f6('0x34')){var _0x2da56e=encryptor[_0xf2f6('0x35')](_0x4fb59a[_0xf2f6('0x36')]);_0x4fb59a[_0xf2f6('0x36')]=maskClientSecret(_0x2da56e);}return _0x4fb59a;})[_0xf2f6('0x13')](respondWithResult(_0x55e6df,null))[_0xf2f6('0x37')](handleError(_0x55e6df,null));};exports[_0xf2f6('0x3b')]=function(_0xf12fbe,_0x2270f7){if(!_0xf12fbe[_0xf2f6('0x3c')]['name'])throw new Error(_0xf2f6('0x3d'));if(!_0xf12fbe[_0xf2f6('0x3c')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5242f6=db[_0xf2f6('0x1b')]['rawAttributes'][_0xf2f6('0x33')][_0xf2f6('0x3e')];if(!_0x5242f6[_0xf2f6('0x3f')](_0xf12fbe[_0xf2f6('0x3c')][_0xf2f6('0x33')]))throw new Error(_0xf2f6('0x40')+_0x5242f6[_0xf2f6('0x41')](',\x20'));if(_0xf12fbe[_0xf2f6('0x3c')][_0xf2f6('0x33')]==='MicrosoftAzure'&&_0xf12fbe[_0xf2f6('0x3c')][_0xf2f6('0x36')]){_0xf12fbe['body'][_0xf2f6('0x36')]=encryptor[_0xf2f6('0x42')](_0xf12fbe[_0xf2f6('0x3c')][_0xf2f6('0x36')]);}return db[_0xf2f6('0x1b')][_0xf2f6('0x3b')](_0xf12fbe[_0xf2f6('0x3c')],{})[_0xf2f6('0x13')](respondWithResult(_0x2270f7,0xc9))[_0xf2f6('0x37')](handleError(_0x2270f7,null));};exports[_0xf2f6('0x43')]=function(_0x571cf5,_0x171ad0){if(_0x571cf5['body']['id']){delete _0x571cf5[_0xf2f6('0x3c')]['id'];}return db['CloudProvider'][_0xf2f6('0x3a')]({'where':{'id':_0x571cf5[_0xf2f6('0x39')]['id']}})['then'](handleEntityNotFound(_0x171ad0,null))[_0xf2f6('0x13')](function(_0x160b7){if(_0x160b7[_0xf2f6('0x33')]===_0xf2f6('0x34')&&_0x571cf5[_0xf2f6('0x3c')][_0xf2f6('0x36')]){_0x571cf5[_0xf2f6('0x3c')][_0xf2f6('0x36')]=encryptor['encryptString'](_0x571cf5[_0xf2f6('0x3c')][_0xf2f6('0x36')]);}return _0x160b7;})[_0xf2f6('0x13')](saveUpdates(_0x571cf5[_0xf2f6('0x3c')],null))['then'](respondWithResult(_0x171ad0,null))[_0xf2f6('0x37')](handleError(_0x171ad0,null));};exports[_0xf2f6('0x44')]=function(_0x3e7939,_0x28eec6){return db[_0xf2f6('0x1b')][_0xf2f6('0x3a')]({'where':{'id':_0x3e7939[_0xf2f6('0x39')]['id']}})['then'](handleEntityNotFound(_0x28eec6,null))['then'](removeEntity(_0x28eec6,null))[_0xf2f6('0x37')](handleError(_0x28eec6,null));};exports[_0xf2f6('0x45')]=function(_0x4e032c,_0x221815){return db[_0xf2f6('0x1b')][_0xf2f6('0x46')]({'where':{'id':_0x4e032c[_0xf2f6('0x39')]['id']},'raw':!![]})[_0xf2f6('0x13')](function(_0xd7e810){if(!_0xd7e810)return _0x221815['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xd7e810,_0x4e032c[_0xf2f6('0x47')]['id'])};})[_0xf2f6('0x13')](respondWithResult(_0x221815,null))[_0xf2f6('0x37')](handleError(_0x221815,null));};exports['oauth2MicrosoftCallback']=function(_0xa2010f,_0xa8c6e6){var _0xbcee62=_0xa2010f[_0xf2f6('0x3c')];var _0x4081a2;var _0x53f308;if(_0xbcee62['error'])throw _0xbcee62;redis[_0xf2f6('0x48')](_0xbcee62[_0xf2f6('0x49')])[_0xf2f6('0x13')](function(_0x556fbc){if(!_0x556fbc)throw new Error(_0xf2f6('0x4a'));_0x4081a2=JSON['parse'](_0x556fbc);var _0xccda81=Buffer[_0xf2f6('0x4b')](_0xbcee62[_0xf2f6('0x49')],_0xf2f6('0x4c'))[_0xf2f6('0x4d')]('ascii');_0x53f308=JSON[_0xf2f6('0x4e')](_0xccda81);if(!oauth['isValidIdToken'](_0xbcee62[_0xf2f6('0x4f')],_0x4081a2[_0xf2f6('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0xbcee62[_0xf2f6('0x49')]);return oauth[_0xf2f6('0x51')](_0xbcee62[_0xf2f6('0x52')],_0x4081a2);})[_0xf2f6('0x13')](function(_0x2edae2){_0x4081a2['data5']=_0x2edae2[_0xf2f6('0x53')];_0x4081a2[_0xf2f6('0x54')]=_0x2edae2[_0xf2f6('0x55')];return db[_0xf2f6('0x1b')][_0xf2f6('0x43')]({'data5':_0x4081a2[_0xf2f6('0x56')],'data6':_0x4081a2[_0xf2f6('0x54')]},{'where':{'id':_0x4081a2['id']}});})[_0xf2f6('0x13')](function(){oauth[_0xf2f6('0x57')](_0x4081a2);socket[_0xf2f6('0x58')](_0xf2f6('0x59'),{'id':_0x53f308['id']});return;})[_0xf2f6('0x13')](respondWithStatusCode(_0xa8c6e6,null))[_0xf2f6('0x37')](function(_0x1dfbec){if(_0x53f308){socket[_0xf2f6('0x58')](_0xf2f6('0x5a'),{'id':_0x53f308['id']});}if(!_0x4081a2){logger['error'](_0xf2f6('0x5b'),_0x1dfbec);return _0xa8c6e6[_0xf2f6('0xb')](0x1f4)['send'](_0x1dfbec[_0xf2f6('0x5c')]);}logger['error'](_0xf2f6('0x5d'),_0x4081a2['id'],JSON[_0xf2f6('0x5e')](_0x1dfbec));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f8b19fd..7b96d7e 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 _0xe4e8=['bluebird','request-promise','path','../../config/environment','define','cloud_providers','lodash','util','../../config/logger','moment'];(function(_0x24559c,_0x4f52f7){var _0xdb1e01=function(_0x14d647){while(--_0x14d647){_0x24559c['push'](_0x24559c['shift']());}};_0xdb1e01(++_0x4f52f7);}(_0xe4e8,0x10a));var _0x8e4e=function(_0xab21d1,_0x4ea754){_0xab21d1=_0xab21d1-0x0;var _0x29c22e=_0xe4e8[_0xab21d1];return _0x29c22e;};'use strict';var _=require(_0x8e4e('0x0'));var util=require(_0x8e4e('0x1'));var logger=require(_0x8e4e('0x2'))('api');var moment=require(_0x8e4e('0x3'));var BPromise=require(_0x8e4e('0x4'));var rp=require(_0x8e4e('0x5'));var fs=require('fs');var path=require(_0x8e4e('0x6'));var rimraf=require('rimraf');var config=require(_0x8e4e('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x155570,_0x318291){return _0x155570[_0x8e4e('0x8')]('CloudProvider',attributes,{'tableName':_0x8e4e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdec6=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdec6,0xa2));var _0x6dec=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xdec6[_0x166d93];return _0xba708;};'use strict';var _=require(_0x6dec('0x0'));var util=require(_0x6dec('0x1'));var logger=require(_0x6dec('0x2'))(_0x6dec('0x3'));var moment=require(_0x6dec('0x4'));var BPromise=require('bluebird');var rp=require(_0x6dec('0x5'));var fs=require('fs');var path=require(_0x6dec('0x6'));var rimraf=require('rimraf');var config=require(_0x6dec('0x7'));var attributes=require(_0x6dec('0x8'));module[_0x6dec('0x9')]=function(_0x7b62b8,_0x30316b){return _0x7b62b8[_0x6dec('0xa')](_0x6dec('0xb'),attributes,{'tableName':_0x6dec('0xc'),'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 cf1f0c1..321c515 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 _0xcb0b=['decryptString','POST','data5','access_token','update','error','intervals','bind','map','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','push','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','nonce','prompt','login','key','value','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6'];(function(_0x181cba,_0x434762){var _0x1ffade=function(_0x2a994d){while(--_0x2a994d){_0x181cba['push'](_0x181cba['shift']());}};_0x1ffade(++_0x434762);}(_0xcb0b,0x199));var _0xbcb0=function(_0x1582b6,_0x3ecb05){_0x1582b6=_0x1582b6-0x0;var _0x1dbbe4=_0xcb0b[_0x1582b6];return _0x1dbbe4;};'use strict';var _=require('lodash');var crypto=require(_0xbcb0('0x0'));var jwt=require(_0xbcb0('0x1'));var moment=require('moment');var Redis=require(_0xbcb0('0x2'));var rp=require(_0xbcb0('0x3'));var util=require(_0xbcb0('0x4'));var encryptor=require(_0xbcb0('0x5'));var config=require(_0xbcb0('0x6'));var logger=require(_0xbcb0('0x7'))('api');var schedule=require(_0xbcb0('0x8'));var db=require(_0xbcb0('0x9'))['db'];config[_0xbcb0('0xa')]=_['defaults'](config[_0xbcb0('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xbcb0('0xa')]);var MICROSOFT_AUTH_URL=_0xbcb0('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbcb0('0xc'),_0xbcb0('0xd'),_0xbcb0('0xe'),_0xbcb0('0xf'),_0xbcb0('0x10'),_0xbcb0('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbcb0('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4ed5f3){var _0x26447c=_['map'](AZURE_AUTH_SCOPES[_0x4ed5f3[_0xbcb0('0x13')]]);if(_0x4ed5f3[_0xbcb0('0x13')]==='Dynamics365')_0x26447c[_0xbcb0('0x14')](_0x4ed5f3[_0xbcb0('0x15')]+_0xbcb0('0x16'));return _0x26447c[_0xbcb0('0x17')]('\x20');}function getAccessTokenScope(_0x4027ca){if(_0x4027ca[_0xbcb0('0x13')]===_0xbcb0('0x18'))return _0xbcb0('0x10');if(_0x4027ca[_0xbcb0('0x13')]===_0xbcb0('0x19'))return _0x4027ca[_0xbcb0('0x15')]+_0xbcb0('0x16');}function generateMicrosoftAuthorizationUrl(_0x19119a,_0x1ad0bb){var _0x3fd1b7=MICROSOFT_AUTH_URL[_0xbcb0('0x1a')](_0xbcb0('0x1b'),_0x19119a[_0xbcb0('0x1c')]);var _0x1624bb=[_0xbcb0('0x1d'),_0xbcb0('0x1e')];var _0xbf1ba7=Buffer[_0xbcb0('0x1f')](JSON[_0xbcb0('0x20')]({'id':_0x1ad0bb}))[_0xbcb0('0x21')](_0xbcb0('0x22'));var _0x19eb8e=crypto[_0xbcb0('0x23')](0x10)[_0xbcb0('0x21')](_0xbcb0('0x24'));var _0x22af41=getAuthorizationScopes(_0x19119a);var _0xea234=[{'key':_0xbcb0('0x25'),'value':_0x19119a[_0xbcb0('0x26')]},{'key':_0xbcb0('0x27'),'value':encodeURIComponent(_0x1624bb['join']('\x20'))},{'key':_0xbcb0('0x28'),'value':_0x19119a[_0xbcb0('0x29')]},{'key':_0xbcb0('0x2a'),'value':'form_post'},{'key':_0xbcb0('0x2b'),'value':encodeURIComponent(_0x22af41)},{'key':'state','value':_0xbf1ba7},{'key':_0xbcb0('0x2c'),'value':_0x19eb8e},{'key':_0xbcb0('0x2d'),'value':_0xbcb0('0x2e')}];var _0x51f054=_0x3fd1b7+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xea234,function(_0x423788){return _0x423788[_0xbcb0('0x2f')]+'='+_0x423788[_0xbcb0('0x30')];})[_0xbcb0('0x17')]('&');_0x19119a['oauth2Claims']={'issuer':_0x3fd1b7['replace'](_0xbcb0('0x31'),''),'audience':_0x19119a[_0xbcb0('0x26')],'state':_0xbf1ba7,'nonce':_0x19eb8e};redis['set'](_0xbf1ba7,JSON[_0xbcb0('0x20')](_0x19119a));return _0x51f054;}function isValidIdToken(_0x2ad6d5,_0xeb9651){try{var _0x127fe6=jwt[_0xbcb0('0x32')](_0x2ad6d5,{'complete':!![]});var _0x5ef996=_0x127fe6[_0xbcb0('0x33')];if(_0x5ef996[_0xbcb0('0x34')]!==_0xeb9651[_0xbcb0('0x35')])return![];if(_0x5ef996[_0xbcb0('0x36')]!==_0xeb9651[_0xbcb0('0x37')])return![];if(_0x5ef996[_0xbcb0('0x2c')]!==_0xeb9651[_0xbcb0('0x2c')])return![];if(moment()[_0xbcb0('0x38')](moment[_0xbcb0('0x39')](_0x5ef996[_0xbcb0('0x3a')])))return![];return!![];}catch(_0x210e41){throw _0x210e41;}}function refreshOauth2MicrosoftAccessToken(_0x30a470){return Promise[_0xbcb0('0x3b')]()[_0xbcb0('0x3c')](function(){if(_0x30a470[_0xbcb0('0x3d')])return _0x30a470;return db[_0xbcb0('0x3e')]['findOne']({'where':{'id':_0x30a470['id']},'raw':!![]});})['then'](function(_0x27cf49){var _0x4d2fff={'grant_type':_0xbcb0('0x3f'),'refresh_token':_0x27cf49[_0xbcb0('0x40')],'scope':getAccessTokenScope(_0x27cf49),'redirect_uri':_0x27cf49[_0xbcb0('0x29')],'client_id':_0x27cf49[_0xbcb0('0x26')],'client_secret':encryptor[_0xbcb0('0x41')](_0x27cf49['data3'])};var _0x1424a0={'method':_0xbcb0('0x42'),'uri':MICROSOFT_AUTH_URL['replace'](_0xbcb0('0x1b'),_0x27cf49[_0xbcb0('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d2fff,'json':!![]};return rp(_0x1424a0);})[_0xbcb0('0x3c')](function(_0x39cd5a){_0x30a470[_0xbcb0('0x43')]=_0x39cd5a[_0xbcb0('0x44')];_0x30a470['data6']=_0x39cd5a[_0xbcb0('0x3f')];return db[_0xbcb0('0x3e')][_0xbcb0('0x45')]({'data5':_0x30a470[_0xbcb0('0x43')],'data6':_0x30a470[_0xbcb0('0x40')]},{'where':{'id':_0x30a470['id']}});})[_0xbcb0('0x3c')](function(){return _0x30a470;})['catch'](function(_0x5edcdc){logger[_0xbcb0('0x46')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x30a470['id'],_0x5edcdc);});}function getOauth2MicrosoftAccessToken(_0x5d7794,_0x4f18f2){var _0x124ed3={'grant_type':'authorization_code','code':_0x5d7794,'scope':getAccessTokenScope(_0x4f18f2),'redirect_uri':_0x4f18f2[_0xbcb0('0x29')],'client_id':_0x4f18f2[_0xbcb0('0x26')],'client_secret':encryptor['decryptString'](_0x4f18f2[_0xbcb0('0x3d')])};var _0x1f9e7e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xbcb0('0x1a')]('{TENANT_ID}',_0x4f18f2['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x124ed3,'json':!![]};return rp(_0x1f9e7e);}function startRefreshInterval(_0x31d0c3){var _0x564f41=schedule[_0xbcb0('0x47')];if(_0x564f41[_0x31d0c3['id']])clearInterval(_0x564f41[_0x31d0c3['id']]);_0x564f41[_0x31d0c3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbcb0('0x48')](this,{'id':_0x31d0c3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xbcb0('0x47')]=_0x564f41;}function startAllRefreshIntervals(){return db[_0xbcb0('0x3e')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xbcb0('0x3c')](function(_0x505418){var _0x21d891=_0x505418[_0xbcb0('0x49')](function(_0x5a476a){return refreshOauth2MicrosoftAccessToken(_0x5a476a)[_0xbcb0('0x3c')](function(_0x1401a0){startRefreshInterval(_0x1401a0);});});return Promise[_0xbcb0('0x4a')](_0x21d891);})[_0xbcb0('0x4b')](function(_0x22a2f6){var _0x2f38a9=_0x22a2f6?util[_0xbcb0('0x4c')](_0x22a2f6,{'showHidden':![],'depth':null}):'';logger[_0xbcb0('0x46')](_0xbcb0('0x4d'),_0x2f38a9);});}module[_0xbcb0('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1253=['Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','push','data7','join','/.default','{TENANT_ID}','data2','code','id_token','from','base64','toString','client_id','response_type','redirect_uri','data4','response_mode','state','nonce','prompt','login','replace','oauth2/','data1','set','stringify','decode','payload','issuer','aud','unix','exp','resolve','then','data3','findOne','data6','decryptString','data5','access_token','refresh_token','update','catch','error'];(function(_0x351532,_0x5d199a){var _0x34837a=function(_0x386672){while(--_0x386672){_0x351532['push'](_0x351532['shift']());}};_0x34837a(++_0x5d199a);}(_0x1253,0xa1));var _0x3125=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1253[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x3125('0x0'));var crypto=require('crypto');var jwt=require(_0x3125('0x1'));var moment=require(_0x3125('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x3125('0x3'));var config=require('../../config/environment');var logger=require(_0x3125('0x4'))(_0x3125('0x5'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x3125('0x6'))['db'];config[_0x3125('0x7')]=_[_0x3125('0x8')](config[_0x3125('0x7')],{'host':_0x3125('0x9'),'port':0x18eb});var redis=new Redis(config[_0x3125('0x7')]);var MICROSOFT_AUTH_URL=_0x3125('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x3125('0xb'),_0x3125('0xc'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x3125('0xd'),_0x3125('0xe')],'Dynamics365':[_0x3125('0xf'),_0x3125('0xc')]};var MICROSOFT_AUTH_ENDPOINT=_0x3125('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x3125('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4339d4){var _0x155f7f=_[_0x3125('0x12')](AZURE_AUTH_SCOPES[_0x4339d4[_0x3125('0x13')]]);if(_0x4339d4[_0x3125('0x13')]===_0x3125('0x14'))_0x155f7f[_0x3125('0x15')](_0x4339d4[_0x3125('0x16')]+'/.default');return _0x155f7f[_0x3125('0x17')]('\x20');}function getAccessTokenScope(_0x10549c){if(_0x10549c['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x10549c[_0x3125('0x13')]==='Dynamics365')return _0x10549c['data7']+_0x3125('0x18');}function generateMicrosoftAuthorizationUrl(_0x3edd29,_0x17be6a){var _0x250e9a=MICROSOFT_AUTH_URL['replace'](_0x3125('0x19'),_0x3edd29[_0x3125('0x1a')]);var _0x52367a=[_0x3125('0x1b'),_0x3125('0x1c')];var _0x524358=Buffer[_0x3125('0x1d')](JSON['stringify']({'id':_0x17be6a}))['toString'](_0x3125('0x1e'));var _0x16b235=crypto['randomBytes'](0x10)[_0x3125('0x1f')]('hex');var _0xb736ce=getAuthorizationScopes(_0x3edd29);var _0x2e45a3=[{'key':_0x3125('0x20'),'value':_0x3edd29['data1']},{'key':_0x3125('0x21'),'value':encodeURIComponent(_0x52367a[_0x3125('0x17')]('\x20'))},{'key':_0x3125('0x22'),'value':_0x3edd29[_0x3125('0x23')]},{'key':_0x3125('0x24'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0xb736ce)},{'key':_0x3125('0x25'),'value':_0x524358},{'key':_0x3125('0x26'),'value':_0x16b235},{'key':_0x3125('0x27'),'value':_0x3125('0x28')}];var _0x4b9b20=_0x250e9a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3125('0x12')](_0x2e45a3,function(_0x5e0c6f){return _0x5e0c6f['key']+'='+_0x5e0c6f['value'];})[_0x3125('0x17')]('&');_0x3edd29['oauth2Claims']={'issuer':_0x250e9a[_0x3125('0x29')](_0x3125('0x2a'),''),'audience':_0x3edd29[_0x3125('0x2b')],'state':_0x524358,'nonce':_0x16b235};redis[_0x3125('0x2c')](_0x524358,JSON[_0x3125('0x2d')](_0x3edd29));return _0x4b9b20;}function isValidIdToken(_0x136b7d,_0x336b19){try{var _0x4ffd41=jwt[_0x3125('0x2e')](_0x136b7d,{'complete':!![]});var _0x1edd2e=_0x4ffd41[_0x3125('0x2f')];if(_0x1edd2e['iss']!==_0x336b19[_0x3125('0x30')])return![];if(_0x1edd2e[_0x3125('0x31')]!==_0x336b19['audience'])return![];if(_0x1edd2e[_0x3125('0x26')]!==_0x336b19[_0x3125('0x26')])return![];if(moment()['isAfter'](moment[_0x3125('0x32')](_0x1edd2e[_0x3125('0x33')])))return![];return!![];}catch(_0x1db356){throw _0x1db356;}}function refreshOauth2MicrosoftAccessToken(_0x135d81){return Promise[_0x3125('0x34')]()[_0x3125('0x35')](function(){if(_0x135d81[_0x3125('0x36')])return _0x135d81;return db['CloudProvider'][_0x3125('0x37')]({'where':{'id':_0x135d81['id']},'raw':!![]});})[_0x3125('0x35')](function(_0xf04fd8){var _0x5bccd1={'grant_type':'refresh_token','refresh_token':_0xf04fd8[_0x3125('0x38')],'scope':getAccessTokenScope(_0xf04fd8),'redirect_uri':_0xf04fd8[_0x3125('0x23')],'client_id':_0xf04fd8[_0x3125('0x2b')],'client_secret':encryptor[_0x3125('0x39')](_0xf04fd8[_0x3125('0x36')])};var _0x2c2293={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x3125('0x29')](_0x3125('0x19'),_0xf04fd8['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5bccd1,'json':!![]};return rp(_0x2c2293);})[_0x3125('0x35')](function(_0x1fe5f5){_0x135d81[_0x3125('0x3a')]=_0x1fe5f5[_0x3125('0x3b')];_0x135d81[_0x3125('0x38')]=_0x1fe5f5[_0x3125('0x3c')];return db['CloudProvider'][_0x3125('0x3d')]({'data5':_0x135d81[_0x3125('0x3a')],'data6':_0x135d81['data6']},{'where':{'id':_0x135d81['id']}});})[_0x3125('0x35')](function(){return _0x135d81;})[_0x3125('0x3e')](function(_0x33a0f4){logger[_0x3125('0x3f')](_0x3125('0x40'),_0x135d81['id'],_0x33a0f4);});}function getOauth2MicrosoftAccessToken(_0x317e20,_0x809a83){var _0x165757={'grant_type':_0x3125('0x41'),'code':_0x317e20,'scope':getAccessTokenScope(_0x809a83),'redirect_uri':_0x809a83[_0x3125('0x23')],'client_id':_0x809a83['data1'],'client_secret':encryptor[_0x3125('0x39')](_0x809a83[_0x3125('0x36')])};var _0x252abc={'method':_0x3125('0x42'),'uri':MICROSOFT_AUTH_URL[_0x3125('0x29')](_0x3125('0x19'),_0x809a83['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x165757,'json':!![]};return rp(_0x252abc);}function startRefreshInterval(_0x20590e){var _0x191e0a=schedule[_0x3125('0x43')];if(_0x191e0a[_0x20590e['id']])clearInterval(_0x191e0a[_0x20590e['id']]);_0x191e0a[_0x20590e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3125('0x44')](this,{'id':_0x20590e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3125('0x43')]=_0x191e0a;}function startAllRefreshIntervals(){return db[_0x3125('0x45')][_0x3125('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3125('0x35')](function(_0x401e15){var _0x57db14=_0x401e15[_0x3125('0x12')](function(_0x55daf7){return refreshOauth2MicrosoftAccessToken(_0x55daf7)[_0x3125('0x35')](function(_0x2cd55b){startRefreshInterval(_0x2cd55b);});});return Promise[_0x3125('0x47')](_0x57db14);})[_0x3125('0x3e')](function(_0x4212b6){var _0x43c2b2=_0x4212b6?util[_0x3125('0x48')](_0x4212b6,{'showHidden':![],'depth':null}):'';logger[_0x3125('0x3f')](_0x3125('0x49'),_0x43c2b2);});}module[_0x3125('0x4a')]={'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 ac8119c..e0ac618 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 _0x6a0b=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message'];(function(_0x342041,_0x1819d1){var _0x1c696b=function(_0x3fea1c){while(--_0x3fea1c){_0x342041['push'](_0x342041['shift']());}};_0x1c696b(++_0x1819d1);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x5f9f89,_0x18c1ac){_0x5f9f89=_0x5f9f89-0x0;var _0x241ea9=_0x6a0b[_0x5f9f89];return _0x241ea9;};'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']('CloudProvider,\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 +var _0xe5fc=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b2ac8,_0x3819fe){var _0x3574f2=function(_0x4d5752){while(--_0x4d5752){_0x3b2ac8['push'](_0x3b2ac8['shift']());}};_0x3574f2(++_0x3819fe);}(_0xe5fc,0x109));var _0xce5f=function(_0x510b0f,_0x286731){_0x510b0f=_0x510b0f-0x0;var _0x34cb08=_0xe5fc[_0x510b0f];return _0x34cb08;};'use strict';var _=require(_0xce5f('0x0'));var util=require('util');var moment=require(_0xce5f('0x1'));var BPromise=require(_0xce5f('0x2'));var rs=require(_0xce5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce5f('0x4'))('rpc');var config=require(_0xce5f('0x5'));var jayson=require(_0xce5f('0x6'));var client=jayson[_0xce5f('0x7')][_0xce5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b77ef,_0x30a150,_0x2b64dc){return new BPromise(function(_0x3451af,_0x4fa651){return client[_0xce5f('0x9')](_0x3b77ef,_0x2b64dc)[_0xce5f('0xa')](function(_0x29a7bf){logger[_0xce5f('0xb')](_0xce5f('0xc'),_0x30a150,_0xce5f('0xd'));logger[_0xce5f('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x30a150,_0xce5f('0xd'),JSON[_0xce5f('0xf')](_0x29a7bf));if(_0x29a7bf[_0xce5f('0x10')]){if(_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x11')]===0x1f4){logger[_0xce5f('0x10')](_0xce5f('0xc'),_0x30a150,_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x12')]);return _0x4fa651(_0x29a7bf['error']['message']);}logger['error'](_0xce5f('0xc'),_0x30a150,_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x12')]);return _0x3451af(_0x29a7bf[_0xce5f('0x10')]['message']);}else{logger[_0xce5f('0xb')](_0xce5f('0xc'),_0x30a150,_0xce5f('0xd'));_0x3451af(_0x29a7bf[_0xce5f('0x13')][_0xce5f('0x12')]);}})[_0xce5f('0x14')](function(_0x1544ba){logger[_0xce5f('0x10')](_0xce5f('0xc'),_0x30a150,_0x1544ba);_0x4fa651(_0x1544ba);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 72ce6ad..4a01c65 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x1261,0x144));var _0x1126=function(_0x2e6ab8,_0x4ea85c){_0x2e6ab8=_0x2e6ab8-0x0;var _0x16cba0=_0x1261[_0x2e6ab8];return _0x16cba0;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0xbf6b28,_0x31ee18){var _0x5b9530=function(_0x48bb70){while(--_0x48bb70){_0xbf6b28['push'](_0xbf6b28['shift']());}};_0x5b9530(++_0x31ee18);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 257293c..e725772 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 _0x03fc=['name','sequelize','exports','STRING'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x03fc,0xb9));var _0xc03f=function(_0x33210d,_0xb42117){_0x33210d=_0x33210d-0x0;var _0x3d30f1=_0x03fc[_0x33210d];return _0x3d30f1;};'use strict';var Sequelize=require(_0xc03f('0x0'));module[_0xc03f('0x1')]={'name':{'type':Sequelize[_0xc03f('0x2')],'unique':_0xc03f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xc03f('0x2')]},'website':{'type':Sequelize[_0xc03f('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc03f('0x2')]},'type':{'type':Sequelize[_0xc03f('0x2')]},'street':{'type':Sequelize[_0xc03f('0x2')]},'postalCode':{'type':Sequelize[_0xc03f('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc03f('0x2')]},'email':{'type':Sequelize[_0xc03f('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc03f('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc03f('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xc03f('0x2')]},'description':{'type':Sequelize[_0xc03f('0x2')]}}; \ No newline at end of file +var _0xcf4c=['sequelize','STRING'];(function(_0x52edd0,_0x7319dc){var _0x42b12a=function(_0x11235e){while(--_0x11235e){_0x52edd0['push'](_0x52edd0['shift']());}};_0x42b12a(++_0x7319dc);}(_0xcf4c,0xbc));var _0xccf4=function(_0x597bc4,_0xaf9638){_0x597bc4=_0x597bc4-0x0;var _0xdf2137=_0xcf4c[_0x597bc4];return _0xdf2137;};'use strict';var Sequelize=require(_0xccf4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xccf4('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xccf4('0x1')]},'phone':{'type':Sequelize[_0xccf4('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xccf4('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xccf4('0x1')]},'city':{'type':Sequelize[_0xccf4('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xccf4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xccf4('0x1')]},'sPostalCode':{'type':Sequelize[_0xccf4('0x1')]},'sCity':{'type':Sequelize[_0xccf4('0x1')]},'sCountry':{'type':Sequelize[_0xccf4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 02d57a3..a4a1151 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 _0xf526=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','omit','ids','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','save','then','destroy','get','stack','name','send','index','CmCompany','describe','model','keys','query'];(function(_0x499eaf,_0x560a5a){var _0x2fa121=function(_0x286a7b){while(--_0x286a7b){_0x499eaf['push'](_0x499eaf['shift']());}};_0x2fa121(++_0x560a5a);}(_0xf526,0x17e));var _0x6f52=function(_0x2d0db8,_0x57d377){_0x2d0db8=_0x2d0db8-0x0;var _0xfd14dc=_0xf526[_0x2d0db8];return _0xfd14dc;};'use strict';var emlformat=require(_0x6f52('0x0'));var rimraf=require(_0x6f52('0x1'));var zipdir=require(_0x6f52('0x2'));var jsonpatch=require(_0x6f52('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f52('0x4'));var Mustache=require(_0x6f52('0x5'));var util=require(_0x6f52('0x6'));var path=require(_0x6f52('0x7'));var sox=require(_0x6f52('0x8'));var csv=require(_0x6f52('0x9'));var ejs=require(_0x6f52('0xa'));var fs=require('fs');var fs_extra=require(_0x6f52('0xb'));var _=require(_0x6f52('0xc'));var squel=require(_0x6f52('0xd'));var crypto=require('crypto');var jsforce=require(_0x6f52('0xe'));var deskjs=require(_0x6f52('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6f52('0x10'));var Redis=require(_0x6f52('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6f52('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6f52('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x330eb9,_0x8e589e){_0x8e589e=_0x8e589e||0xcc;return function(_0x2ee423){if(_0x2ee423){return _0x330eb9[_0x6f52('0x15')](_0x8e589e);}return _0x330eb9[_0x6f52('0x16')](_0x8e589e)[_0x6f52('0x17')]();};}function respondWithResult(_0x1af977,_0x4ded51){_0x4ded51=_0x4ded51||0xc8;return function(_0x49857c){if(_0x49857c){return _0x1af977[_0x6f52('0x16')](_0x4ded51)[_0x6f52('0x18')](_0x49857c);}};}function respondWithFilteredResult(_0x47ac57,_0x182786){return function(_0x456852){if(_0x456852){var _0x490bbf=typeof _0x182786[_0x6f52('0x19')]===_0x6f52('0x1a')&&typeof _0x182786['limit']==='undefined';var _0x56b0ca=_0x456852[_0x6f52('0x1b')];var _0x2e4aa5=_0x490bbf?0x0:_0x182786['offset'];var _0x2dbf2e=_0x490bbf?_0x456852['count']:_0x182786[_0x6f52('0x19')]+_0x182786[_0x6f52('0x1c')];var _0x2d4b3b;if(_0x2dbf2e>=_0x56b0ca){_0x2dbf2e=_0x56b0ca;_0x2d4b3b=0xc8;}else{_0x2d4b3b=0xce;}_0x47ac57[_0x6f52('0x16')](_0x2d4b3b);return _0x47ac57[_0x6f52('0x1d')]('Content-Range',_0x2e4aa5+'-'+_0x2dbf2e+'/'+_0x56b0ca)['json'](_0x456852);}return null;};}function patchUpdates(_0x579571){return function(_0x181758){try{jsonpatch['apply'](_0x181758,_0x579571,!![]);}catch(_0x124376){return BPromise['reject'](_0x124376);}return _0x181758[_0x6f52('0x1e')]();};}function saveUpdates(_0x3ae22c,_0x2701c9){return function(_0x2ea381){if(_0x2ea381){return _0x2ea381['update'](_0x3ae22c)[_0x6f52('0x1f')](function(_0xff84f7){return _0xff84f7;});}return null;};}function removeEntity(_0x43b93a,_0x39ee89){return function(_0xc146d2){if(_0xc146d2){return _0xc146d2[_0x6f52('0x20')]()['then'](function(){var _0x47f7d3=_0xc146d2[_0x6f52('0x21')]({'plain':!![]});var _0x36b72f='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0x36b72f,'resourceId':_0x47f7d3['id']}})[_0x6f52('0x1f')](function(){return _0xc146d2;});})[_0x6f52('0x1f')](function(){_0x43b93a[_0x6f52('0x16')](0xcc)[_0x6f52('0x17')]();});}};}function handleEntityNotFound(_0x3a6e08,_0x5bd20a){return function(_0x1909db){if(!_0x1909db){_0x3a6e08['sendStatus'](0x194);}return _0x1909db;};}function handleError(_0x2731af,_0x2521dc){_0x2521dc=_0x2521dc||0x1f4;return function(_0x40807a){logger['error'](_0x40807a[_0x6f52('0x22')]);if(_0x40807a[_0x6f52('0x23')]){delete _0x40807a[_0x6f52('0x23')];}_0x2731af['status'](_0x2521dc)[_0x6f52('0x24')](_0x40807a);};}exports[_0x6f52('0x25')]=function(_0x6bddc,_0x13d8c4){var _0x458860={},_0x17cfca={},_0x232a77={'count':0x0,'rows':[]};return db[_0x6f52('0x26')][_0x6f52('0x27')]()['then'](function(_0x56dac1){_0x17cfca[_0x6f52('0x28')]=_[_0x6f52('0x29')](_0x56dac1);_0x17cfca[_0x6f52('0x2a')]=_[_0x6f52('0x29')](_0x6bddc[_0x6f52('0x2a')]);_0x17cfca[_0x6f52('0x2b')]=_[_0x6f52('0x2c')](_0x17cfca[_0x6f52('0x28')],_0x17cfca[_0x6f52('0x2a')]);_0x458860[_0x6f52('0x2d')]=_[_0x6f52('0x2c')](_0x17cfca[_0x6f52('0x28')],qs['fields'](_0x6bddc[_0x6f52('0x2a')][_0x6f52('0x2e')]));_0x458860[_0x6f52('0x2d')]=_0x458860['attributes'][_0x6f52('0x2f')]?_0x458860[_0x6f52('0x2d')]:_0x17cfca['model'];if(!_0x6bddc[_0x6f52('0x2a')][_0x6f52('0x30')](_0x6f52('0x31'))){_0x458860[_0x6f52('0x1c')]=qs[_0x6f52('0x1c')](_0x6bddc['query'][_0x6f52('0x1c')]);_0x458860[_0x6f52('0x19')]=qs[_0x6f52('0x19')](_0x6bddc[_0x6f52('0x2a')]['offset']);}_0x458860[_0x6f52('0x32')]=qs[_0x6f52('0x33')](_0x6bddc[_0x6f52('0x2a')][_0x6f52('0x33')]);_0x458860['where']=qs[_0x6f52('0x2b')](_[_0x6f52('0x34')](_0x6bddc[_0x6f52('0x2a')],_0x17cfca[_0x6f52('0x2b')]),_0x56dac1);if(_0x6bddc[_0x6f52('0x2a')]['filter']){_0x458860['where']=_[_0x6f52('0x35')](_0x458860[_0x6f52('0x36')],{'$or':_['map'](_0x458860['attributes'],function(_0x17750e){var _0x5ef582={};_0x5ef582[_0x17750e]={'$like':'%'+_0x6bddc[_0x6f52('0x2a')][_0x6f52('0x37')]+'%'};return _0x5ef582;})});}_0x458860=_[_0x6f52('0x35')]({},_0x458860,_0x6bddc[_0x6f52('0x38')]);var _0x185a9b={'where':_0x458860['where']};return db['CmCompany'][_0x6f52('0x1b')](_0x185a9b)[_0x6f52('0x1f')](function(_0x470824){_0x232a77[_0x6f52('0x1b')]=_0x470824;if(_0x6bddc[_0x6f52('0x2a')][_0x6f52('0x39')]){_0x458860[_0x6f52('0x3a')]=[{'all':!![]}];}return db['CmCompany'][_0x6f52('0x3b')](_0x458860);})[_0x6f52('0x1f')](function(_0x7cf4f){_0x232a77[_0x6f52('0x3c')]=_0x7cf4f;return _0x232a77;})[_0x6f52('0x1f')](respondWithFilteredResult(_0x13d8c4,_0x458860))[_0x6f52('0x3d')](handleError(_0x13d8c4,null));})[_0x6f52('0x3d')](handleError(_0x13d8c4,null));};exports[_0x6f52('0x3e')]=function(_0x1190ea,_0x5efdca){var _0x1b638c={'raw':![],'where':{'id':_0x1190ea[_0x6f52('0x3f')]['id']}},_0x39697c={};_0x39697c[_0x6f52('0x28')]=_[_0x6f52('0x29')](db[_0x6f52('0x26')]['rawAttributes']);_0x39697c['query']=_[_0x6f52('0x29')](_0x1190ea[_0x6f52('0x2a')]);_0x39697c['filters']=_['intersection'](_0x39697c[_0x6f52('0x28')],_0x39697c['query']);_0x1b638c[_0x6f52('0x2d')]=_['intersection'](_0x39697c[_0x6f52('0x28')],qs[_0x6f52('0x2e')](_0x1190ea[_0x6f52('0x2a')]['fields']));_0x1b638c[_0x6f52('0x2d')]=_0x1b638c['attributes'][_0x6f52('0x2f')]?_0x1b638c[_0x6f52('0x2d')]:_0x39697c[_0x6f52('0x28')];if(_0x1190ea['query']['includeAll']){_0x1b638c[_0x6f52('0x3a')]=[{'all':!![]}];}_0x1b638c=_[_0x6f52('0x35')]({},_0x1b638c,_0x1190ea['options']);return db[_0x6f52('0x26')]['find'](_0x1b638c)[_0x6f52('0x1f')](handleEntityNotFound(_0x5efdca,null))[_0x6f52('0x1f')](respondWithResult(_0x5efdca,null))['catch'](handleError(_0x5efdca,null));};exports[_0x6f52('0x40')]=function(_0x15969c,_0x337687){return db[_0x6f52('0x26')][_0x6f52('0x40')](_0x15969c[_0x6f52('0x41')],{})['then'](function(_0x1430b4){var _0xe7b5ce=_0x15969c['user'][_0x6f52('0x21')]({'plain':!![]});if(!_0xe7b5ce)throw new Error(_0x6f52('0x42'));if(_0xe7b5ce[_0x6f52('0x43')]===_0x6f52('0x44')){var _0x27cbf3=_0x1430b4[_0x6f52('0x21')]({'plain':!![]});var _0xd03ca4=_0x6f52('0x45');return db[_0x6f52('0x46')][_0x6f52('0x47')]({'where':{'name':_0xd03ca4,'userProfileId':_0xe7b5ce[_0x6f52('0x48')]},'raw':!![]})[_0x6f52('0x1f')](function(_0x1df7dd){if(_0x1df7dd&&_0x1df7dd[_0x6f52('0x49')]===0x0){return db[_0x6f52('0x4a')]['create']({'name':_0x27cbf3['name'],'resourceId':_0x27cbf3['id'],'type':_0x1df7dd[_0x6f52('0x23')],'sectionId':_0x1df7dd['id']},{})[_0x6f52('0x1f')](function(){return _0x1430b4;});}else{return _0x1430b4;}})[_0x6f52('0x3d')](function(_0x469b1d){logger[_0x6f52('0x4b')](_0x6f52('0x4c'),_0x469b1d);throw _0x469b1d;});}return _0x1430b4;})[_0x6f52('0x1f')](respondWithResult(_0x337687,0xc9))[_0x6f52('0x3d')](handleError(_0x337687,null));};exports[_0x6f52('0x4d')]=function(_0x4e001b,_0x5bf2df){if(_0x4e001b[_0x6f52('0x41')]['id']){delete _0x4e001b['body']['id'];}return db[_0x6f52('0x26')]['find']({'where':{'id':_0x4e001b['params']['id']}})[_0x6f52('0x1f')](handleEntityNotFound(_0x5bf2df,null))[_0x6f52('0x1f')](saveUpdates(_0x4e001b[_0x6f52('0x41')],null))['then'](respondWithResult(_0x5bf2df,null))[_0x6f52('0x3d')](handleError(_0x5bf2df,null));};exports[_0x6f52('0x20')]=function(_0x419525,_0x4298bd){return db[_0x6f52('0x26')][_0x6f52('0x47')]({'where':{'id':_0x419525[_0x6f52('0x3f')]['id']}})[_0x6f52('0x1f')](handleEntityNotFound(_0x4298bd,null))['then'](removeEntity(_0x4298bd,null))[_0x6f52('0x3d')](handleError(_0x4298bd,null));};exports[_0x6f52('0x27')]=function(_0x59c701,_0x301ca8){return db[_0x6f52('0x26')]['describe']()[_0x6f52('0x1f')](respondWithResult(_0x301ca8,null))[_0x6f52('0x3d')](handleError(_0x301ca8,null));};exports['addContacts']=function(_0x49a6d6,_0x1d02ae,_0x525ce3){return db[_0x6f52('0x4e')][_0x6f52('0x47')]({'where':{'id':_0x49a6d6[_0x6f52('0x3f')]['id']}})[_0x6f52('0x1f')](handleEntityNotFound(_0x1d02ae,null))[_0x6f52('0x1f')](function(_0x345d8f){if(_0x345d8f){return _0x345d8f[_0x6f52('0x4f')](_0x49a6d6[_0x6f52('0x41')]['ids'],_[_0x6f52('0x50')](_0x49a6d6[_0x6f52('0x41')],[_0x6f52('0x51'),'id'])||{});}})['then'](respondWithResult(_0x1d02ae,null))[_0x6f52('0x3d')](handleError(_0x1d02ae,null));};exports[_0x6f52('0x52')]=function(_0x31614c,_0x456674,_0x2a9712){var _0x5178d6={};var _0x44a3cd={};var _0x59eb9d;var _0x5ae47d;return db['CmCompany'][_0x6f52('0x53')]({'where':{'id':_0x31614c[_0x6f52('0x3f')]['id']}})[_0x6f52('0x1f')](handleEntityNotFound(_0x456674,null))[_0x6f52('0x1f')](function(_0x2fd1c9){if(_0x2fd1c9){_0x59eb9d=_0x2fd1c9;_0x44a3cd['model']=_[_0x6f52('0x29')](db[_0x6f52('0x4e')][_0x6f52('0x54')]);_0x44a3cd['query']=_[_0x6f52('0x29')](_0x31614c['query']);_0x44a3cd[_0x6f52('0x2b')]=_[_0x6f52('0x2c')](_0x44a3cd['model'],_0x44a3cd[_0x6f52('0x2a')]);_0x5178d6[_0x6f52('0x2d')]=_[_0x6f52('0x2c')](_0x44a3cd[_0x6f52('0x28')],qs[_0x6f52('0x2e')](_0x31614c[_0x6f52('0x2a')][_0x6f52('0x2e')]));_0x5178d6[_0x6f52('0x2d')]=_0x5178d6[_0x6f52('0x2d')][_0x6f52('0x2f')]?_0x5178d6[_0x6f52('0x2d')]:_0x44a3cd[_0x6f52('0x28')];_0x5178d6['order']=qs[_0x6f52('0x33')](_0x31614c[_0x6f52('0x2a')]['sort']);_0x5178d6[_0x6f52('0x36')]=qs[_0x6f52('0x2b')](_[_0x6f52('0x34')](_0x31614c[_0x6f52('0x2a')],_0x44a3cd['filters']));if(_0x31614c[_0x6f52('0x2a')][_0x6f52('0x37')]){_0x5178d6[_0x6f52('0x36')]=_['merge'](_0x5178d6['where'],{'$or':_['map'](_0x5178d6['attributes'],function(_0x3c1d59){var _0x2b9402={};_0x2b9402[_0x3c1d59]={'$like':'%'+_0x31614c[_0x6f52('0x2a')][_0x6f52('0x37')]+'%'};return _0x2b9402;})});}_0x5178d6=_['merge']({},_0x5178d6,_0x31614c[_0x6f52('0x38')]);return _0x59eb9d['getContacts'](_0x5178d6);}})[_0x6f52('0x1f')](function(_0xeea434){if(_0xeea434){_0x5ae47d=_0xeea434[_0x6f52('0x2f')];if(!_0x31614c[_0x6f52('0x2a')][_0x6f52('0x30')](_0x6f52('0x31'))){_0x5178d6['limit']=qs[_0x6f52('0x1c')](_0x31614c[_0x6f52('0x2a')][_0x6f52('0x1c')]);_0x5178d6[_0x6f52('0x19')]=qs[_0x6f52('0x19')](_0x31614c[_0x6f52('0x2a')]['offset']);}return _0x59eb9d[_0x6f52('0x52')](_0x5178d6);}})[_0x6f52('0x1f')](function(_0x2094aa){if(_0x2094aa){return _0x2094aa?{'count':_0x5ae47d,'rows':_0x2094aa}:null;}})[_0x6f52('0x1f')](respondWithResult(_0x456674,null))[_0x6f52('0x3d')](handleError(_0x456674,null));}; \ No newline at end of file +var _0x8ee7=['attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','rawAttributes','length','order','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','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','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','update','then','get','Companies','UserProfileResource','destroy','end','error','stack','name','index','CmCompany','describe','keys','query','filters','model'];(function(_0x539ed8,_0x140b31){var _0x2dd25d=function(_0x24fa8a){while(--_0x24fa8a){_0x539ed8['push'](_0x539ed8['shift']());}};_0x2dd25d(++_0x140b31);}(_0x8ee7,0x17d));var _0x78ee=function(_0xcb7400,_0x5ee236){_0xcb7400=_0xcb7400-0x0;var _0x123a40=_0x8ee7[_0xcb7400];return _0x123a40;};'use strict';var emlformat=require(_0x78ee('0x0'));var rimraf=require(_0x78ee('0x1'));var zipdir=require(_0x78ee('0x2'));var jsonpatch=require(_0x78ee('0x3'));var rp=require('request-promise');var moment=require(_0x78ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78ee('0x5'));var util=require(_0x78ee('0x6'));var path=require(_0x78ee('0x7'));var sox=require(_0x78ee('0x8'));var csv=require('to-csv');var ejs=require(_0x78ee('0x9'));var fs=require('fs');var fs_extra=require(_0x78ee('0xa'));var _=require(_0x78ee('0xb'));var squel=require(_0x78ee('0xc'));var crypto=require(_0x78ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x78ee('0xe'));var toCsv=require('to-csv');var querystring=require(_0x78ee('0xf'));var Papa=require(_0x78ee('0x10'));var Redis=require(_0x78ee('0x11'));var authService=require(_0x78ee('0x12'));var qs=require(_0x78ee('0x13'));var as=require(_0x78ee('0x14'));var hardwareService=require(_0x78ee('0x15'));var logger=require(_0x78ee('0x16'))(_0x78ee('0x17'));var utils=require(_0x78ee('0x18'));var config=require(_0x78ee('0x19'));var licenseUtil=require(_0x78ee('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a3a7a,_0x3cfa51){_0x3cfa51=_0x3cfa51||0xcc;return function(_0x5de0c9){if(_0x5de0c9){return _0x5a3a7a['sendStatus'](_0x3cfa51);}return _0x5a3a7a['status'](_0x3cfa51)['end']();};}function respondWithResult(_0x2e3e15,_0x6c920e){_0x6c920e=_0x6c920e||0xc8;return function(_0xd4d8f5){if(_0xd4d8f5){return _0x2e3e15['status'](_0x6c920e)[_0x78ee('0x1b')](_0xd4d8f5);}};}function respondWithFilteredResult(_0x1bba98,_0x4989d5){return function(_0x3e06a2){if(_0x3e06a2){var _0x46ab1d=typeof _0x4989d5['offset']===_0x78ee('0x1c')&&typeof _0x4989d5['limit']===_0x78ee('0x1c');var _0x105d25=_0x3e06a2[_0x78ee('0x1d')];var _0x53a717=_0x46ab1d?0x0:_0x4989d5[_0x78ee('0x1e')];var _0x4c27e9=_0x46ab1d?_0x3e06a2[_0x78ee('0x1d')]:_0x4989d5[_0x78ee('0x1e')]+_0x4989d5[_0x78ee('0x1f')];var _0x3f2c9d;if(_0x4c27e9>=_0x105d25){_0x4c27e9=_0x105d25;_0x3f2c9d=0xc8;}else{_0x3f2c9d=0xce;}_0x1bba98[_0x78ee('0x20')](_0x3f2c9d);return _0x1bba98[_0x78ee('0x21')](_0x78ee('0x22'),_0x53a717+'-'+_0x4c27e9+'/'+_0x105d25)[_0x78ee('0x1b')](_0x3e06a2);}return null;};}function patchUpdates(_0x65cf42){return function(_0x105e85){try{jsonpatch[_0x78ee('0x23')](_0x105e85,_0x65cf42,!![]);}catch(_0x4b549d){return BPromise[_0x78ee('0x24')](_0x4b549d);}return _0x105e85['save']();};}function saveUpdates(_0x278075,_0xda482e){return function(_0x20bf04){if(_0x20bf04){return _0x20bf04[_0x78ee('0x25')](_0x278075)[_0x78ee('0x26')](function(_0x4ba13c){return _0x4ba13c;});}return null;};}function removeEntity(_0x40d190,_0x5cb53f){return function(_0x41cf9a){if(_0x41cf9a){return _0x41cf9a['destroy']()[_0x78ee('0x26')](function(){var _0xb5f7cd=_0x41cf9a[_0x78ee('0x27')]({'plain':!![]});var _0xc3dc24=_0x78ee('0x28');return db[_0x78ee('0x29')][_0x78ee('0x2a')]({'where':{'type':_0xc3dc24,'resourceId':_0xb5f7cd['id']}})[_0x78ee('0x26')](function(){return _0x41cf9a;});})[_0x78ee('0x26')](function(){_0x40d190[_0x78ee('0x20')](0xcc)[_0x78ee('0x2b')]();});}};}function handleEntityNotFound(_0x1090c2,_0x297533){return function(_0x53c7ce){if(!_0x53c7ce){_0x1090c2['sendStatus'](0x194);}return _0x53c7ce;};}function handleError(_0x1e59a2,_0x259477){_0x259477=_0x259477||0x1f4;return function(_0x136409){logger[_0x78ee('0x2c')](_0x136409[_0x78ee('0x2d')]);if(_0x136409[_0x78ee('0x2e')]){delete _0x136409[_0x78ee('0x2e')];}_0x1e59a2[_0x78ee('0x20')](_0x259477)['send'](_0x136409);};}exports[_0x78ee('0x2f')]=function(_0xcc69bb,_0x51fec4){var _0x1fa040={},_0x1744c0={},_0x4d57b9={'count':0x0,'rows':[]};return db[_0x78ee('0x30')][_0x78ee('0x31')]()[_0x78ee('0x26')](function(_0x3996a4){_0x1744c0['model']=_['keys'](_0x3996a4);_0x1744c0['query']=_[_0x78ee('0x32')](_0xcc69bb[_0x78ee('0x33')]);_0x1744c0[_0x78ee('0x34')]=_['intersection'](_0x1744c0[_0x78ee('0x35')],_0x1744c0[_0x78ee('0x33')]);_0x1fa040[_0x78ee('0x36')]=_[_0x78ee('0x37')](_0x1744c0['model'],qs[_0x78ee('0x38')](_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x38')]));_0x1fa040['attributes']=_0x1fa040[_0x78ee('0x36')]['length']?_0x1fa040[_0x78ee('0x36')]:_0x1744c0[_0x78ee('0x35')];if(!_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x39')](_0x78ee('0x3a'))){_0x1fa040[_0x78ee('0x1f')]=qs[_0x78ee('0x1f')](_0xcc69bb[_0x78ee('0x33')]['limit']);_0x1fa040[_0x78ee('0x1e')]=qs['offset'](_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x1e')]);}_0x1fa040['order']=qs['sort'](_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x3b')]);_0x1fa040[_0x78ee('0x3c')]=qs['filters'](_[_0x78ee('0x3d')](_0xcc69bb['query'],_0x1744c0[_0x78ee('0x34')]),_0x3996a4);if(_0xcc69bb['query'][_0x78ee('0x3e')]){_0x1fa040[_0x78ee('0x3c')]=_[_0x78ee('0x3f')](_0x1fa040[_0x78ee('0x3c')],{'$or':_['map'](_0x1fa040[_0x78ee('0x36')],function(_0x2a74a0){var _0x5c5c90={};_0x5c5c90[_0x2a74a0]={'$like':'%'+_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x3e')]+'%'};return _0x5c5c90;})});}_0x1fa040=_['merge']({},_0x1fa040,_0xcc69bb['options']);var _0x40a823={'where':_0x1fa040[_0x78ee('0x3c')]};return db[_0x78ee('0x30')][_0x78ee('0x1d')](_0x40a823)[_0x78ee('0x26')](function(_0xe6756c){_0x4d57b9[_0x78ee('0x1d')]=_0xe6756c;if(_0xcc69bb[_0x78ee('0x33')][_0x78ee('0x40')]){_0x1fa040[_0x78ee('0x41')]=[{'all':!![]}];}return db[_0x78ee('0x30')]['findAll'](_0x1fa040);})[_0x78ee('0x26')](function(_0x2fcee7){_0x4d57b9['rows']=_0x2fcee7;return _0x4d57b9;})[_0x78ee('0x26')](respondWithFilteredResult(_0x51fec4,_0x1fa040))['catch'](handleError(_0x51fec4,null));})[_0x78ee('0x42')](handleError(_0x51fec4,null));};exports[_0x78ee('0x43')]=function(_0x5477f7,_0x406fbc){var _0x344a1a={'raw':![],'where':{'id':_0x5477f7[_0x78ee('0x44')]['id']}},_0xc84ff5={};_0xc84ff5[_0x78ee('0x35')]=_['keys'](db[_0x78ee('0x30')]['rawAttributes']);_0xc84ff5['query']=_[_0x78ee('0x32')](_0x5477f7[_0x78ee('0x33')]);_0xc84ff5[_0x78ee('0x34')]=_[_0x78ee('0x37')](_0xc84ff5[_0x78ee('0x35')],_0xc84ff5[_0x78ee('0x33')]);_0x344a1a[_0x78ee('0x36')]=_[_0x78ee('0x37')](_0xc84ff5[_0x78ee('0x35')],qs[_0x78ee('0x38')](_0x5477f7['query'][_0x78ee('0x38')]));_0x344a1a[_0x78ee('0x36')]=_0x344a1a[_0x78ee('0x36')]['length']?_0x344a1a[_0x78ee('0x36')]:_0xc84ff5[_0x78ee('0x35')];if(_0x5477f7[_0x78ee('0x33')]['includeAll']){_0x344a1a[_0x78ee('0x41')]=[{'all':!![]}];}_0x344a1a=_['merge']({},_0x344a1a,_0x5477f7[_0x78ee('0x45')]);return db[_0x78ee('0x30')]['find'](_0x344a1a)[_0x78ee('0x26')](handleEntityNotFound(_0x406fbc,null))[_0x78ee('0x26')](respondWithResult(_0x406fbc,null))[_0x78ee('0x42')](handleError(_0x406fbc,null));};exports['create']=function(_0x234073,_0x56a406){return db[_0x78ee('0x30')][_0x78ee('0x46')](_0x234073[_0x78ee('0x47')],{})['then'](function(_0x5efa9c){var _0x2dd875=_0x234073[_0x78ee('0x48')][_0x78ee('0x27')]({'plain':!![]});if(!_0x2dd875)throw new Error(_0x78ee('0x49'));if(_0x2dd875[_0x78ee('0x4a')]===_0x78ee('0x48')){var _0x4fb429=_0x5efa9c[_0x78ee('0x27')]({'plain':!![]});var _0x59809d='Companies';return db[_0x78ee('0x4b')][_0x78ee('0x4c')]({'where':{'name':_0x59809d,'userProfileId':_0x2dd875['userProfileId']},'raw':!![]})[_0x78ee('0x26')](function(_0x71c362){if(_0x71c362&&_0x71c362[_0x78ee('0x4d')]===0x0){return db[_0x78ee('0x29')][_0x78ee('0x46')]({'name':_0x4fb429[_0x78ee('0x2e')],'resourceId':_0x4fb429['id'],'type':_0x71c362[_0x78ee('0x2e')],'sectionId':_0x71c362['id']},{})['then'](function(){return _0x5efa9c;});}else{return _0x5efa9c;}})[_0x78ee('0x42')](function(_0x28aa71){logger[_0x78ee('0x2c')](_0x78ee('0x4e'),_0x28aa71);throw _0x28aa71;});}return _0x5efa9c;})['then'](respondWithResult(_0x56a406,0xc9))[_0x78ee('0x42')](handleError(_0x56a406,null));};exports[_0x78ee('0x25')]=function(_0x52ba8c,_0x1ffd9e){if(_0x52ba8c[_0x78ee('0x47')]['id']){delete _0x52ba8c[_0x78ee('0x47')]['id'];}return db[_0x78ee('0x30')]['find']({'where':{'id':_0x52ba8c[_0x78ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ffd9e,null))[_0x78ee('0x26')](saveUpdates(_0x52ba8c[_0x78ee('0x47')],null))[_0x78ee('0x26')](respondWithResult(_0x1ffd9e,null))['catch'](handleError(_0x1ffd9e,null));};exports['destroy']=function(_0x33b9de,_0x3ef4cc){return db['CmCompany'][_0x78ee('0x4c')]({'where':{'id':_0x33b9de[_0x78ee('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ef4cc,null))[_0x78ee('0x26')](removeEntity(_0x3ef4cc,null))[_0x78ee('0x42')](handleError(_0x3ef4cc,null));};exports[_0x78ee('0x31')]=function(_0xa4a79f,_0x5e7d42){return db[_0x78ee('0x30')][_0x78ee('0x31')]()[_0x78ee('0x26')](respondWithResult(_0x5e7d42,null))['catch'](handleError(_0x5e7d42,null));};exports[_0x78ee('0x4f')]=function(_0x1c2aee,_0x35f810,_0x3200b9){return db[_0x78ee('0x50')]['find']({'where':{'id':_0x1c2aee[_0x78ee('0x44')]['id']}})[_0x78ee('0x26')](handleEntityNotFound(_0x35f810,null))[_0x78ee('0x26')](function(_0x2fd0d5){if(_0x2fd0d5){return _0x2fd0d5['addContacts'](_0x1c2aee[_0x78ee('0x47')]['ids'],_[_0x78ee('0x51')](_0x1c2aee[_0x78ee('0x47')],[_0x78ee('0x52'),'id'])||{});}})['then'](respondWithResult(_0x35f810,null))[_0x78ee('0x42')](handleError(_0x35f810,null));};exports['getContacts']=function(_0x282d40,_0x2b9c18,_0x450723){var _0x50bbbc={};var _0x52b966={};var _0x26d556;var _0xec5f05;return db[_0x78ee('0x30')]['findOne']({'where':{'id':_0x282d40[_0x78ee('0x44')]['id']}})[_0x78ee('0x26')](handleEntityNotFound(_0x2b9c18,null))[_0x78ee('0x26')](function(_0x45c3db){if(_0x45c3db){_0x26d556=_0x45c3db;_0x52b966[_0x78ee('0x35')]=_[_0x78ee('0x32')](db[_0x78ee('0x50')][_0x78ee('0x53')]);_0x52b966[_0x78ee('0x33')]=_['keys'](_0x282d40[_0x78ee('0x33')]);_0x52b966[_0x78ee('0x34')]=_[_0x78ee('0x37')](_0x52b966[_0x78ee('0x35')],_0x52b966['query']);_0x50bbbc['attributes']=_[_0x78ee('0x37')](_0x52b966[_0x78ee('0x35')],qs[_0x78ee('0x38')](_0x282d40[_0x78ee('0x33')][_0x78ee('0x38')]));_0x50bbbc[_0x78ee('0x36')]=_0x50bbbc['attributes'][_0x78ee('0x54')]?_0x50bbbc[_0x78ee('0x36')]:_0x52b966['model'];_0x50bbbc[_0x78ee('0x55')]=qs[_0x78ee('0x3b')](_0x282d40[_0x78ee('0x33')]['sort']);_0x50bbbc[_0x78ee('0x3c')]=qs[_0x78ee('0x34')](_[_0x78ee('0x3d')](_0x282d40[_0x78ee('0x33')],_0x52b966['filters']));if(_0x282d40[_0x78ee('0x33')][_0x78ee('0x3e')]){_0x50bbbc[_0x78ee('0x3c')]=_[_0x78ee('0x3f')](_0x50bbbc['where'],{'$or':_['map'](_0x50bbbc[_0x78ee('0x36')],function(_0x1bafce){var _0x23a315={};_0x23a315[_0x1bafce]={'$like':'%'+_0x282d40[_0x78ee('0x33')]['filter']+'%'};return _0x23a315;})});}_0x50bbbc=_['merge']({},_0x50bbbc,_0x282d40['options']);return _0x26d556[_0x78ee('0x56')](_0x50bbbc);}})[_0x78ee('0x26')](function(_0x18498d){if(_0x18498d){_0xec5f05=_0x18498d[_0x78ee('0x54')];if(!_0x282d40['query']['hasOwnProperty']('nolimit')){_0x50bbbc[_0x78ee('0x1f')]=qs[_0x78ee('0x1f')](_0x282d40['query'][_0x78ee('0x1f')]);_0x50bbbc['offset']=qs[_0x78ee('0x1e')](_0x282d40['query'][_0x78ee('0x1e')]);}return _0x26d556[_0x78ee('0x56')](_0x50bbbc);}})[_0x78ee('0x26')](function(_0x14ea72){if(_0x14ea72){return _0x14ea72?{'count':_0xec5f05,'rows':_0x14ea72}:null;}})[_0x78ee('0x26')](respondWithResult(_0x2b9c18,null))[_0x78ee('0x42')](handleError(_0x2b9c18,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5737cec..c0a541e 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 _0xa3dc=['../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3dc,0x1d9));var _0xca3d=function(_0x1dbc22,_0x5dd20f){_0x1dbc22=_0x1dbc22-0x0;var _0x16f498=_0xa3dc[_0x1dbc22];return _0x16f498;};'use strict';var _=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var logger=require(_0xca3d('0x2'))(_0xca3d('0x3'));var moment=require('moment');var BPromise=require(_0xca3d('0x4'));var rp=require(_0xca3d('0x5'));var fs=require('fs');var path=require(_0xca3d('0x6'));var rimraf=require(_0xca3d('0x7'));var config=require(_0xca3d('0x8'));var attributes=require('./cmCompany.attributes');module[_0xca3d('0x9')]=function(_0x56da60,_0x1266c){return _0x56da60[_0xca3d('0xa')](_0xca3d('0xb'),attributes,{'tableName':_0xca3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9b=['define','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0xd3940f,_0x51f17){var _0x4e3275=function(_0x4271d9){while(--_0x4271d9){_0xd3940f['push'](_0xd3940f['shift']());}};_0x4e3275(++_0x51f17);}(_0x2a9b,0xf3));var _0xb2a9=function(_0x5857d5,_0x37753c){_0x5857d5=_0x5857d5-0x0;var _0x19919e=_0x2a9b[_0x5857d5];return _0x19919e;};'use strict';var _=require(_0xb2a9('0x0'));var util=require(_0xb2a9('0x1'));var logger=require(_0xb2a9('0x2'))(_0xb2a9('0x3'));var moment=require(_0xb2a9('0x4'));var BPromise=require(_0xb2a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2a9('0x6'));var config=require(_0xb2a9('0x7'));var attributes=require(_0xb2a9('0x8'));module[_0xb2a9('0x9')]=function(_0x31ecc5,_0x3641eb){return _0x31ecc5[_0xb2a9('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index bebb35b..830a89c 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 _0xc37d=['client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x17eb80,_0x5ad17e){var _0x4af452=function(_0x59d82f){while(--_0x59d82f){_0x17eb80['push'](_0x17eb80['shift']());}};_0x4af452(++_0x5ad17e);}(_0xc37d,0x8a));var _0xdc37=function(_0x198984,_0x3c2baa){_0x198984=_0x198984-0x0;var _0x2861b9=_0xc37d[_0x198984];return _0x2861b9;};'use strict';var _=require(_0xdc37('0x0'));var util=require(_0xdc37('0x1'));var moment=require(_0xdc37('0x2'));var BPromise=require(_0xdc37('0x3'));var rs=require(_0xdc37('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc37('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc37('0x6'))(_0xdc37('0x7'));var config=require('../../config/environment');var jayson=require(_0xdc37('0x8'));var client=jayson[_0xdc37('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb4c0,_0x42845c,_0x71a089){return new BPromise(function(_0x2c8bde,_0x3e1aae){return client[_0xdc37('0xa')](_0x4bb4c0,_0x71a089)[_0xdc37('0xb')](function(_0x3d66e5){logger[_0xdc37('0xc')]('CmCompany,\x20%s,\x20%s',_0x42845c,_0xdc37('0xd'));logger[_0xdc37('0xe')](_0xdc37('0xf'),_0x42845c,_0xdc37('0xd'),JSON[_0xdc37('0x10')](_0x3d66e5));if(_0x3d66e5['error']){if(_0x3d66e5['error']['code']===0x1f4){logger[_0xdc37('0x11')](_0xdc37('0x12'),_0x42845c,_0x3d66e5[_0xdc37('0x11')][_0xdc37('0x13')]);return _0x3e1aae(_0x3d66e5[_0xdc37('0x11')]['message']);}logger[_0xdc37('0x11')](_0xdc37('0x12'),_0x42845c,_0x3d66e5['error']['message']);return _0x2c8bde(_0x3d66e5[_0xdc37('0x11')][_0xdc37('0x13')]);}else{logger['info'](_0xdc37('0x12'),_0x42845c,'request\x20sent');_0x2c8bde(_0x3d66e5['result'][_0xdc37('0x13')]);}})[_0xdc37('0x14')](function(_0x162fd6){logger[_0xdc37('0x11')]('CmCompany,\x20%s,\x20%s',_0x42845c,_0x162fd6);_0x3e1aae(_0x162fd6);});});} \ No newline at end of file +var _0x821b=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ceb6f,_0x28522e){var _0x5aa54f=function(_0x92f843){while(--_0x92f843){_0x5ceb6f['push'](_0x5ceb6f['shift']());}};_0x5aa54f(++_0x28522e);}(_0x821b,0x10a));var _0xb821=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x821b[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xb821('0x0'));var util=require('util');var moment=require(_0xb821('0x1'));var BPromise=require(_0xb821('0x2'));var rs=require(_0xb821('0x3'));var fs=require('fs');var Redis=require(_0xb821('0x4'));var db=require(_0xb821('0x5'))['db'];var utils=require(_0xb821('0x6'));var logger=require('../../config/logger')(_0xb821('0x7'));var config=require(_0xb821('0x8'));var jayson=require(_0xb821('0x9'));var client=jayson[_0xb821('0xa')][_0xb821('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x599867,_0x584943,_0x20cd86){return new BPromise(function(_0x7e30a2,_0x3af142){return client[_0xb821('0xc')](_0x599867,_0x20cd86)[_0xb821('0xd')](function(_0x2861b4){logger[_0xb821('0xe')](_0xb821('0xf'),_0x584943,_0xb821('0x10'));logger['debug'](_0xb821('0x11'),_0x584943,_0xb821('0x10'),JSON[_0xb821('0x12')](_0x2861b4));if(_0x2861b4[_0xb821('0x13')]){if(_0x2861b4[_0xb821('0x13')][_0xb821('0x14')]===0x1f4){logger[_0xb821('0x13')](_0xb821('0xf'),_0x584943,_0x2861b4[_0xb821('0x13')]['message']);return _0x3af142(_0x2861b4['error']['message']);}logger[_0xb821('0x13')](_0xb821('0xf'),_0x584943,_0x2861b4[_0xb821('0x13')][_0xb821('0x15')]);return _0x7e30a2(_0x2861b4[_0xb821('0x13')]['message']);}else{logger[_0xb821('0xe')]('CmCompany,\x20%s,\x20%s',_0x584943,'request\x20sent');_0x7e30a2(_0x2861b4[_0xb821('0x16')][_0xb821('0x15')]);}})[_0xb821('0x17')](function(_0x51b80c){logger[_0xb821('0x13')](_0xb821('0xf'),_0x584943,_0x51b80c);_0x3af142(_0x51b80c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 135b9b2..fa5a5fa 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 _0xfcf4=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show','/:id/contacts','getContacts','post','addContacts','put','/:id','delete','destroy'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xfcf4,0x1cd));var _0x4fcf=function(_0x4fbf5a,_0x68559f){_0x4fbf5a=_0x4fbf5a-0x0;var _0x2bf64e=_0xfcf4[_0x4fbf5a];return _0x2bf64e;};'use strict';var multer=require(_0x4fcf('0x0'));var util=require('util');var path=require(_0x4fcf('0x1'));var timeout=require(_0x4fcf('0x2'));var express=require(_0x4fcf('0x3'));var router=express[_0x4fcf('0x4')]();var fs_extra=require(_0x4fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fcf('0x6'));var config=require(_0x4fcf('0x7'));var controller=require(_0x4fcf('0x8'));router[_0x4fcf('0x9')]('/',auth[_0x4fcf('0xa')](),controller[_0x4fcf('0xb')]);router[_0x4fcf('0x9')](_0x4fcf('0xc'),auth[_0x4fcf('0xa')](),controller['describe']);router['get']('/:id',auth[_0x4fcf('0xa')](),controller[_0x4fcf('0xd')]);router[_0x4fcf('0x9')](_0x4fcf('0xe'),auth['isAuthenticated'](),controller[_0x4fcf('0xf')]);router[_0x4fcf('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4fcf('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4fcf('0x11')]);router[_0x4fcf('0x12')](_0x4fcf('0x13'),auth[_0x4fcf('0xa')](),controller['update']);router[_0x4fcf('0x14')](_0x4fcf('0x13'),auth[_0x4fcf('0xa')](),controller[_0x4fcf('0x15')]);module[_0x4fcf('0x16')]=router; \ No newline at end of file +var _0x016e=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','exports','multer','util','connect-timeout'];(function(_0x48826f,_0x5ddf95){var _0x54940d=function(_0x1531d9){while(--_0x1531d9){_0x48826f['push'](_0x48826f['shift']());}};_0x54940d(++_0x5ddf95);}(_0x016e,0x1b5));var _0xe016=function(_0x33aeec,_0x4f358b){_0x33aeec=_0x33aeec-0x0;var _0xba3855=_0x016e[_0x33aeec];return _0xba3855;};'use strict';var multer=require(_0xe016('0x0'));var util=require(_0xe016('0x1'));var path=require('path');var timeout=require(_0xe016('0x2'));var express=require(_0xe016('0x3'));var router=express[_0xe016('0x4')]();var fs_extra=require(_0xe016('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe016('0x6'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xe016('0x7')]('/',auth[_0xe016('0x8')](),controller[_0xe016('0x9')]);router[_0xe016('0x7')](_0xe016('0xa'),auth[_0xe016('0x8')](),controller[_0xe016('0xb')]);router['get']('/:id',auth[_0xe016('0x8')](),controller[_0xe016('0xc')]);router[_0xe016('0x7')](_0xe016('0xd'),auth[_0xe016('0x8')](),controller[_0xe016('0xe')]);router[_0xe016('0xf')]('/',auth[_0xe016('0x8')](),controller[_0xe016('0x10')]);router[_0xe016('0xf')](_0xe016('0xd'),auth['isAuthenticated'](),controller[_0xe016('0x11')]);router[_0xe016('0x12')](_0xe016('0x13'),auth[_0xe016('0x8')](),controller[_0xe016('0x14')]);router['delete'](_0xe016('0x13'),auth[_0xe016('0x8')](),controller['destroy']);module[_0xe016('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d64d5c4..9837adc 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 _0xa7a8=['NOW','lodash','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xa7a8,0x1f2));var _0x8a7a=function(_0x5f79aa,_0x561ce0){_0x5f79aa=_0x5f79aa-0x0;var _0x27e4a6=_0xa7a8[_0x5f79aa];return _0x27e4a6;};'use strict';var _=require(_0x8a7a('0x0'));var Sequelize=require(_0x8a7a('0x1'));module[_0x8a7a('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8a7a('0x3')]},'street':{'type':Sequelize[_0x8a7a('0x3')]},'postalCode':{'type':Sequelize[_0x8a7a('0x3')]},'city':{'type':Sequelize[_0x8a7a('0x3')]},'country':{'type':Sequelize[_0x8a7a('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8a7a('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8a7a('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8a7a('0x3')]},'email':{'type':Sequelize[_0x8a7a('0x3')]},'url':{'type':Sequelize[_0x8a7a('0x3')]},'facebook':{'type':Sequelize[_0x8a7a('0x3')]},'fb_data':{'type':Sequelize[_0x8a7a('0x3')]},'twitter':{'type':Sequelize[_0x8a7a('0x3')]},'skype':{'type':Sequelize[_0x8a7a('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x8a7a('0x3')]},'wechat':{'type':Sequelize[_0x8a7a('0x3')]},'telegram':{'type':Sequelize[_0x8a7a('0x3')]},'UserId':{'type':Sequelize[_0x8a7a('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8a7a('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8a7a('0x5')],'defaultValue':Sequelize[_0x8a7a('0x6')]},'dialTimezone':{'type':Sequelize[_0x8a7a('0x3')]},'utcOffset':{'type':Sequelize[_0x8a7a('0x4')]}}; \ No newline at end of file +var _0xa54c=['STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x5379c4,_0x5686ff){var _0x535152=function(_0x27644d){while(--_0x27644d){_0x5379c4['push'](_0x5379c4['shift']());}};_0x535152(++_0x5686ff);}(_0xa54c,0x125));var _0xca54=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa54c[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xca54('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xca54('0x1')]},'street':{'type':Sequelize[_0xca54('0x1')]},'postalCode':{'type':Sequelize[_0xca54('0x1')]},'city':{'type':Sequelize[_0xca54('0x1')]},'country':{'type':Sequelize[_0xca54('0x1')]},'dateOfBirth':{'type':Sequelize[_0xca54('0x1')]},'description':{'type':Sequelize[_0xca54('0x2')]},'phone':{'type':Sequelize[_0xca54('0x1')]},'mobile':{'type':Sequelize[_0xca54('0x1')]},'fax':{'type':Sequelize[_0xca54('0x1')]},'email':{'type':Sequelize[_0xca54('0x1')]},'url':{'type':Sequelize[_0xca54('0x1')]},'facebook':{'type':Sequelize[_0xca54('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xca54('0x1')]},'teams':{'type':Sequelize[_0xca54('0x1')]},'viber':{'type':Sequelize[_0xca54('0x1')]},'line':{'type':Sequelize[_0xca54('0x1')]},'wechat':{'type':Sequelize[_0xca54('0x1')]},'telegram':{'type':Sequelize[_0xca54('0x1')]},'UserId':{'type':Sequelize[_0xca54('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xca54('0x1')]},'priority':{'type':Sequelize[_0xca54('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xca54('0x4')],'defaultValue':Sequelize[_0xca54('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xca54('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4e0def4..a162bb5 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 36e797c..96b7a0f 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 _0x3832=['exports','events','../../mysqldb','CmContact','remove','emit','hook'];(function(_0x24fc97,_0x4778ae){var _0x496ddf=function(_0x438c67){while(--_0x438c67){_0x24fc97['push'](_0x24fc97['shift']());}};_0x496ddf(++_0x4778ae);}(_0x3832,0x10b));var _0x2383=function(_0x287809,_0x1a105e){_0x287809=_0x287809-0x0;var _0xb6942e=_0x3832[_0x287809];return _0xb6942e;};'use strict';var EventEmitter=require(_0x2383('0x0'));var CmContact=require(_0x2383('0x1'))['db'][_0x2383('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2383('0x3')};function emitEvent(_0x4c86d4){return function(_0x3d7dc3,_0x44f930,_0x495fe1){CmContactEvents[_0x2383('0x4')](_0x4c86d4+':'+_0x3d7dc3['id'],_0x3d7dc3);CmContactEvents[_0x2383('0x4')](_0x4c86d4,_0x3d7dc3);_0x495fe1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x2383('0x5')](e,emitEvent(event));}}module[_0x2383('0x6')]=CmContactEvents; \ No newline at end of file +var _0xe36b=['exports','events','../../mysqldb','CmContact','update','remove','emit','hasOwnProperty'];(function(_0xc393db,_0x1bed1a){var _0x36aed6=function(_0x4a6428){while(--_0x4a6428){_0xc393db['push'](_0xc393db['shift']());}};_0x36aed6(++_0x1bed1a);}(_0xe36b,0xb1));var _0xbe36=function(_0x16415e,_0x3a459c){_0x16415e=_0x16415e-0x0;var _0x2eac70=_0xe36b[_0x16415e];return _0x2eac70;};'use strict';var EventEmitter=require(_0xbe36('0x0'));var CmContact=require(_0xbe36('0x1'))['db'][_0xbe36('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe36('0x3'),'afterDestroy':_0xbe36('0x4')};function emitEvent(_0xea9673){return function(_0x58183f,_0x582cf4,_0x3fe78c){CmContactEvents[_0xbe36('0x5')](_0xea9673+':'+_0x58183f['id'],_0x58183f);CmContactEvents[_0xbe36('0x5')](_0xea9673,_0x58183f);_0x3fe78c(null);};}for(var e in events){if(events[_0xbe36('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xbe36('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 2be8f46..9b7248e 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 _0x951c=['api','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','utcOffset','add','minutes','then','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','dialCheckDuplicateType','Lists','always','onlyIfOpen','CmList','BlackLists','length','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','ContactId','CampaignId','push','info','lodash','util','../../config/logger'];(function(_0x53b418,_0x1fc172){var _0x1d69f6=function(_0x30e5e4){while(--_0x30e5e4){_0x53b418['push'](_0x53b418['shift']());}};_0x1d69f6(++_0x1fc172);}(_0x951c,0x1a1));var _0xc951=function(_0x5abed7,_0x185e43){_0x5abed7=_0x5abed7-0x0;var _0x3b446b=_0x951c[_0x5abed7];return _0x3b446b;};'use strict';var _=require(_0xc951('0x0'));var util=require(_0xc951('0x1'));var logger=require(_0xc951('0x2'))(_0xc951('0x3'));var moment=require('moment');var BPromise=require(_0xc951('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc951('0x5'));var rimraf=require(_0xc951('0x6'));var config=require(_0xc951('0x7'));var shared=require(_0xc951('0x8'));var attributes=require(_0xc951('0x9'));module[_0xc951('0xa')]=function(_0x1e2d0f,_0x33b3b7){return _0x1e2d0f[_0xc951('0xb')](_0xc951('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xc951('0xd'),'fields':[_0xc951('0xd')]},{'name':'fti_cm_contacts','fields':[_0xc951('0xe'),_0xc951('0xf'),_0xc951('0xd'),_0xc951('0x10'),_0xc951('0x11'),_0xc951('0x12')],'type':_0xc951('0x13')}],'timestamps':!![],'charset':_0xc951('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0xc1eee9,_0x11033e,_0xc66585){var _0x276177=_0x1e2d0f[_0xc951('0x15')];var _0xa87e64=_0xc1eee9[_0xc951('0x16')]({'plain':!![]});function _0x15bd49(){return function(_0x21c0fb){logger[_0xc951('0x17')](_0xc951('0x18'),_0xc951('0x19'),util[_0xc951('0x1a')](_0x21c0fb,{'showHidden':![],'depth':null}));};}function _0x43a52b(_0x58e29a,_0x376bd1){var _0x4210aa=_0x376bd1['scheduledat']?_0x376bd1[_0xc951('0x1b')]:moment()[_0xc951('0x1c')](_0xc951('0x1d'));return new BPromise(function(_0x27313e,_0x2daa7c){if(_[_0xc951('0x1e')](_0x376bd1[_0xc951('0x1f')])){_0x27313e({'ret':_0x4210aa});}else{_0x276177[_0xc951('0x20')][_0xc951('0x21')]({'where':{'id':_0x58e29a['id']}})['then'](function(_0x25d423){if(!_[_0xc951('0x1e')](_0x25d423)){var _0x8106ac=_0x25d423[_0xc951('0x1f')];if(!_[_0xc951('0x1e')](_0x8106ac)){var _0x509e92=shared['timezones'];var _0x4f0db8=_0x509e92[_0x8106ac];var _0x52af89=_0x509e92[_0x376bd1[_0xc951('0x1f')]];if(!_[_0xc951('0x1e')](_0x4f0db8)&&!_['isNil'](_0x52af89)){var _0x2bbd53=_0x4f0db8[_0xc951('0x22')]-_0x52af89[_0xc951('0x22')];_0x4210aa=_0x376bd1[_0xc951('0x1b')]?_0x376bd1['scheduledat']:moment();var _0x5860a6=moment(_0x4210aa)[_0xc951('0x23')](_0x2bbd53,_0xc951('0x24'));_0x27313e({'ret':_0x5860a6['format'](_0xc951('0x1d'))});}else _0x27313e({'ret':_0x4210aa});}else _0x27313e({'ret':_0x4210aa});}else{_0x27313e({'ret':_0x4210aa});}});}});return 0xa;}var _0x3e7f7b=function(_0x3273bf){return new BPromise(function(_0x13b15f,_0x3ce08f){_0x43a52b(_0x3273bf,_0xa87e64)[_0xc951('0x25')](function(_0x34ad10){_0xa87e64[_0xc951('0x1b')]=_0x34ad10[_0xc951('0x26')];_0x276177[_0xc951('0x27')]['findOne']({'where':{'phone':_0xa87e64[_0xc951('0xd')],'VoiceQueueId':_0x3273bf['id']}})[_0xc951('0x25')](function(_0x193fa0){if(!_['isNil'](_0x193fa0)){throw new Error(_0xc951('0x28')+_0xa87e64['phone']+_0xc951('0x29')+_0x3273bf['id']);}return _0x276177[_0xc951('0x27')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64[_0xc951('0x2b')],'priority':_0xa87e64[_0xc951('0x2c')]?_0xa87e64[_0xc951('0x2c')]:0x2,'scheduledat':_0xa87e64[_0xc951('0x1b')]?_0xa87e64[_0xc951('0x1b')]:moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xa87e64['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')](_0xc951('0x1d')):undefined,'VoiceQueueId':_0x3273bf['id']});})[_0xc951('0x2e')](function(_0x4b2c0d){_0x3ce08f(_0x4b2c0d);});});});};var _0x16aac4=function(_0x4ea9f8){return new BPromise(function(_0x259fdf,_0x5c154f){_0x43a52b(_0x4ea9f8,_0xa87e64)['then'](function(_0x3ac887){_0xa87e64['scheduledat']=_0x3ac887[_0xc951('0x26')];_0x276177[_0xc951('0x27')][_0xc951('0x21')]({'where':{'phone':_0xa87e64[_0xc951('0xd')],'VoiceQueueId':_0x4ea9f8['id']}})[_0xc951('0x25')](function(_0x269fa6){if(!_[_0xc951('0x1e')](_0x269fa6)){throw new Error(_0xc951('0x28')+_0xa87e64[_0xc951('0xd')]+_0xc951('0x2f')+_0x4ea9f8['id']);}return _0x276177[_0xc951('0x30')][_0xc951('0x21')]({'where':{'calleridnum':_0xa87e64[_0xc951('0xd')],'VoiceQueueId':_0x4ea9f8['id']}});})[_0xc951('0x25')](function(_0x12f724){if(!_[_0xc951('0x1e')](_0x12f724)){throw new Error(_0xc951('0x31')+_0xa87e64['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x4ea9f8['id']);}return _0x276177[_0xc951('0x27')]['create']({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64['ListId'],'priority':_0xa87e64[_0xc951('0x2c')]?_0xa87e64['priority']:0x2,'scheduledat':_0xa87e64[_0xc951('0x1b')]?_0xa87e64[_0xc951('0x1b')]:moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xa87e64[_0xc951('0x2d')]?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')](_0xc951('0x1d')):undefined,'VoiceQueueId':_0x4ea9f8['id']});})[_0xc951('0x2e')](function(_0x23faf3){_0x5c154f(_0x23faf3);});});});};function _0x4f353e(){return function(_0x128466){logger[_0xc951('0x17')](_0xc951('0x18'),_0xc951('0x19'),util[_0xc951('0x1a')](_0x128466,{'showHidden':![],'depth':null}));};}function _0x4b3a90(_0x22601f,_0x281bab){var _0x144066=_0x281bab['scheduledat']?_0x281bab[_0xc951('0x1b')]:moment()[_0xc951('0x1c')](_0xc951('0x1d'));return new BPromise(function(_0x55aae3,_0x3fe0f6){if(_['isNil'](_0x281bab[_0xc951('0x1f')])){_0x55aae3({'ret':_0x144066});}else{_0x276177[_0xc951('0x32')][_0xc951('0x21')]({'where':{'id':_0x22601f['id']}})[_0xc951('0x25')](function(_0x304db0){if(!_['isNil'](_0x304db0)){var _0x552431=_0x304db0[_0xc951('0x1f')];if(!_[_0xc951('0x1e')](_0x552431)){var _0x4ed53b=shared[_0xc951('0x33')];var _0x2dd4fa=_0x4ed53b[_0x552431];var _0x20d700=_0x4ed53b[_0x281bab[_0xc951('0x1f')]];if(!_[_0xc951('0x1e')](_0x2dd4fa)&&!_[_0xc951('0x1e')](_0x20d700)){var _0x48eed3=_0x2dd4fa['utcOffset']-_0x20d700[_0xc951('0x22')];_0x144066=_0x281bab[_0xc951('0x1b')]?_0x281bab[_0xc951('0x1b')]:moment();var _0x521f3e=moment(_0x144066)[_0xc951('0x23')](_0x48eed3,_0xc951('0x24'));_0x55aae3({'ret':_0x521f3e[_0xc951('0x1c')](_0xc951('0x1d'))});}else _0x55aae3({'ret':_0x144066});}else _0x55aae3({'ret':_0x144066});}else{_0x55aae3({'ret':_0x144066});}});}});return 0xa;}var _0x464573=function(_0x40056a){return new BPromise(function(_0x22a89e,_0x22ac67){_0x4b3a90(_0x40056a,_0xa87e64)[_0xc951('0x25')](function(_0x59fbff){_0xa87e64['scheduledat']=_0x59fbff[_0xc951('0x26')];_0x276177['CmHopper'][_0xc951('0x21')]({'where':{'phone':_0xa87e64[_0xc951('0xd')],'CampaignId':_0x40056a['id']}})[_0xc951('0x25')](function(_0x18f17e){if(!_['isNil'](_0x18f17e)){throw new Error(_0xc951('0x28')+_0xa87e64[_0xc951('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x40056a['id']);}return _0x276177[_0xc951('0x27')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64['ListId'],'priority':_0xa87e64['priority']?_0xa87e64[_0xc951('0x2c')]:0x2,'scheduledat':_0xa87e64[_0xc951('0x1b')]?_0xa87e64['scheduledat']:moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xa87e64[_0xc951('0x2d')]?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x40056a['id']});})['catch'](function(_0x23a3fa){_0x22ac67(_0x23a3fa);});});});};var _0x5bb2a1=function(_0x22b712){return new BPromise(function(_0x25f341,_0x7e7d6){_0x4b3a90(_0x22b712,_0xa87e64)[_0xc951('0x25')](function(_0x45da7b){_0xa87e64[_0xc951('0x1b')]=_0x45da7b['ret'];_0x276177[_0xc951('0x27')][_0xc951('0x21')]({'where':{'phone':_0xa87e64[_0xc951('0xd')],'CampaignId':_0x22b712['id']}})['then'](function(_0x6cdc85){if(!_[_0xc951('0x1e')](_0x6cdc85)){throw new Error('cmContact,\x20afterCreate\x20'+_0xa87e64[_0xc951('0xd')]+_0xc951('0x34')+_0x22b712['id']);}return _0x276177[_0xc951('0x30')]['findOne']({'where':{'calleridnum':_0xa87e64['phone'],'CampaignId':_0x22b712['id']}});})[_0xc951('0x25')](function(_0x2c6223){if(!_[_0xc951('0x1e')](_0x2c6223)){throw new Error(_0xc951('0x31')+_0xa87e64[_0xc951('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x22b712['id']);}return _0x276177[_0xc951('0x27')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64[_0xc951('0x2b')],'priority':_0xa87e64['priority']?_0xa87e64[_0xc951('0x2c')]:0x2,'scheduledat':_0xa87e64[_0xc951('0x1b')]?_0xa87e64['scheduledat']:moment()[_0xc951('0x1c')](_0xc951('0x1d')),'callback':_0xa87e64['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x22b712['id']});})[_0xc951('0x2e')](function(_0x5b70c1){_0x7e7d6(_0x5b70c1);});});});};if(_0xa87e64[_0xc951('0x2b')]){_0x276177['VoiceQueue'][_0xc951('0x35')]({'where':{'type':'outbound'},'attributes':['id',_0xc951('0x36'),_0xc951('0x1f')],'include':[{'model':_0x276177['CmList'],'as':_0xc951('0x37'),'where':{'id':_0xa87e64[_0xc951('0x2b')]}}]})[_0xc951('0x25')](function(_0x10b140){if(_0x10b140){var _0x1959c9=[];for(var _0x50c0e5=0x0,_0x35c4e3;_0x50c0e5<_0x10b140['length'];_0x50c0e5+=0x1){_0x35c4e3=_0x10b140[_0x50c0e5][_0xc951('0x16')]({'plain':!![]});switch(_0x35c4e3[_0xc951('0x36')]){case _0xc951('0x38'):_0x16aac4(_0x35c4e3)[_0xc951('0x2e')](_0x15bd49());break;case _0xc951('0x39'):_0x3e7f7b(_0x35c4e3)[_0xc951('0x2e')](_0x15bd49());break;default:_0x4b3a90(_0x35c4e3,_0xa87e64)[_0xc951('0x25')](function(_0x868e4b){_0xa87e64[_0xc951('0x1b')]=_0x868e4b['ret'];_0x276177['CmHopper'][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64['ListId'],'scheduledat':_0xa87e64[_0xc951('0x1b')]?_0xa87e64['scheduledat']:moment()[_0xc951('0x1c')](_0xc951('0x1d')),'priority':_0xa87e64['priority']?_0xa87e64[_0xc951('0x2c')]:0x2,'callback':_0xa87e64[_0xc951('0x2d')]?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x35c4e3['id']})[_0xc951('0x2e')](_0x15bd49());});}}}})[_0xc951('0x25')](function(){return _0x276177[_0xc951('0x20')][_0xc951('0x35')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x276177[_0xc951('0x3a')],'as':_0xc951('0x3b'),'where':{'id':_0xa87e64['ListId']}}]})['then'](function(_0x458075){if(_0x458075){var _0x5d3896=[];for(var _0xbe364=0x0,_0xf24f20;_0xbe364<_0x458075[_0xc951('0x3c')];_0xbe364+=0x1){_0xf24f20=_0x458075[_0xbe364][_0xc951('0x16')]({'plain':!![]});_0x276177[_0xc951('0x3d')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64[_0xc951('0x2b')],'VoiceQueueId':_0xf24f20['id']})[_0xc951('0x2e')](function(_0x47a56f){logger['error']('cmContact,\x20%s,\x20%s',_0xc951('0x19'),_0x47a56f[_0xc951('0x3e')]);});}}});})[_0xc951('0x25')](function(){return _0x276177[_0xc951('0x32')]['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x276177['CmList'],'as':_0xc951('0x37'),'where':{'id':_0xa87e64[_0xc951('0x2b')]}}]})[_0xc951('0x25')](function(_0x26d522){if(_0x26d522){var _0x4fb186=[];for(var _0x481348=0x0,_0x18371b;_0x481348<_0x26d522[_0xc951('0x3c')];_0x481348+=0x1){_0x18371b=_0x26d522[_0x481348][_0xc951('0x16')]({'plain':!![]});switch(_0x18371b[_0xc951('0x36')]){case _0xc951('0x38'):_0x5bb2a1(_0x18371b)[_0xc951('0x2e')](_0x4f353e());break;case _0xc951('0x39'):_0x464573(_0x18371b)[_0xc951('0x2e')](_0x4f353e());break;default:_0x276177[_0xc951('0x27')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64[_0xc951('0x2b')],'scheduledat':_0xa87e64['scheduledat']?_0xa87e64[_0xc951('0x1b')]:moment()[_0xc951('0x1c')](_0xc951('0x1d')),'priority':_0xa87e64[_0xc951('0x2c')]?_0xa87e64[_0xc951('0x2c')]:0x2,'callback':_0xa87e64[_0xc951('0x2d')]?!![]:![],'callbackuniqueid':_0xa87e64[_0xc951('0x2d')]?_0xa87e64['callbackUniqueid']:undefined,'callbackat':_0xa87e64[_0xc951('0x2d')]?moment()[_0xc951('0x1c')](_0xc951('0x1d')):undefined,'CampaignId':_0x18371b['id']})[_0xc951('0x2e')](_0x4f353e());}}}});})['then'](function(){return _0x276177[_0xc951('0x32')][_0xc951('0x35')]({'attributes':['id'],'include':[{'model':_0x276177[_0xc951('0x3a')],'as':_0xc951('0x3b'),'where':{'id':_0xa87e64[_0xc951('0x2b')]}}]})[_0xc951('0x25')](function(_0x599e24){if(_0x599e24){var _0x1a547b=[];for(var _0x5b344b=0x0,_0x1ff7cf;_0x5b344b<_0x599e24[_0xc951('0x3c')];_0x5b344b+=0x1){_0x1ff7cf=_0x599e24[_0x5b344b]['get']({'plain':!![]});_0x276177[_0xc951('0x3d')][_0xc951('0x2a')]({'phone':_0xa87e64[_0xc951('0xd')],'ContactId':_0xa87e64['id'],'ListId':_0xa87e64[_0xc951('0x2b')],'CampaignId':_0x1ff7cf['id']})[_0xc951('0x2e')](function(_0x399e38){logger[_0xc951('0x17')](_0xc951('0x3f'),_0xc951('0x19'),_0x399e38['message']);});}}});})[_0xc951('0x25')](function(){_0xc66585();})['catch'](function(_0x291e1f){logger['error']('cmContact,\x20%s,\x20%s',_0xc951('0x19'),_0x291e1f[_0xc951('0x3e')]);_0xc66585(_0x291e1f);});}else{_0xc66585(new Error(_0xc951('0x40')));}},'afterDestroy':function(_0x5422a6,_0x3a5278,_0x221eb7){var _0x218ff7=_0x1e2d0f[_0xc951('0x15')];var _0xdf8663=_0x5422a6['get']({'plain':!![]});return _0x218ff7[_0xc951('0x27')][_0xc951('0x35')]({'raw':!![],'where':{'ListId':_0xdf8663[_0xc951('0x2b')],'ContactId':_0xdf8663['id']}})['then'](function(_0x5bd8e2){if(!_[_0xc951('0x41')](_0x5bd8e2)){var _0x1902c3=[];for(var _0x542948=0x0;_0x542948<_0x5bd8e2[_0xc951('0x3c')];_0x542948+=0x1){var _0x865550=_0x218ff7[_0xc951('0x27')]['destroy']({'where':{'ListId':_0x5bd8e2[_0x542948][_0xc951('0x2b')],'ContactId':_0x5bd8e2[_0x542948][_0xc951('0x42')],'VoiceQueueId':_0x5bd8e2[_0x542948]['VoiceQueueId'],'CampaignId':_0x5bd8e2[_0x542948][_0xc951('0x43')]}});_0x1902c3[_0xc951('0x44')](_0x865550);}return BPromise['all'](_0x1902c3);}})[_0xc951('0x25')](function(_0x538d2c){logger[_0xc951('0x45')]('[CmContact][afterDestroy][Succesfull]',util[_0xc951('0x1a')](_0x538d2c,{'showHidden':![],'depth':null}));_0x221eb7();})[_0xc951('0x2e')](function(_0x23b28a){logger[_0xc951('0x17')]('[CmContact][afterDestroy][Error]',util[_0xc951('0x1a')](_0x23b28a,{'showHidden':![],'depth':null}));_0x221eb7(_0x23b28a);});}}});}; \ No newline at end of file +var _0x9bd7=['models','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','timezones','utcOffset','add','minutes','format','ret','findOne','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','dialTimezone','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','get','always','CmList','message','Campaign','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','cm_contacts','fti_cm_contacts','lastName','phone','mobile','fax','email','FULLTEXT','utf8mb4'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0x9bd7,0x1b7));var _0x79bd=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9bd7[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var logger=require(_0x79bd('0x2'))(_0x79bd('0x3'));var moment=require(_0x79bd('0x4'));var BPromise=require(_0x79bd('0x5'));var rp=require(_0x79bd('0x6'));var fs=require('fs');var path=require(_0x79bd('0x7'));var rimraf=require(_0x79bd('0x8'));var config=require(_0x79bd('0x9'));var shared=require(_0x79bd('0xa'));var attributes=require('./cmContact.attributes');module[_0x79bd('0xb')]=function(_0x5a3c10,_0x496580){return _0x5a3c10[_0x79bd('0xc')](_0x79bd('0xd'),attributes,{'tableName':_0x79bd('0xe'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x79bd('0xf'),'fields':['firstName',_0x79bd('0x10'),_0x79bd('0x11'),_0x79bd('0x12'),_0x79bd('0x13'),_0x79bd('0x14')],'type':_0x79bd('0x15')}],'timestamps':!![],'charset':_0x79bd('0x16'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x496a6b,_0x23a6a5,_0x1cea18){var _0x229e2a=_0x5a3c10[_0x79bd('0x17')];var _0x310e7f=_0x496a6b['get']({'plain':!![]});function _0x240349(){return function(_0x29b969){logger[_0x79bd('0x18')](_0x79bd('0x19'),_0x79bd('0x1a'),util[_0x79bd('0x1b')](_0x29b969,{'showHidden':![],'depth':null}));};}function _0x38f849(_0x3cb597,_0x25dfa0){var _0x3bd9eb=_0x25dfa0[_0x79bd('0x1c')]?_0x25dfa0[_0x79bd('0x1c')]:moment()['format'](_0x79bd('0x1d'));return new BPromise(function(_0x4aff0f,_0x4b99aa){if(_[_0x79bd('0x1e')](_0x25dfa0['dialTimezone'])){_0x4aff0f({'ret':_0x3bd9eb});}else{_0x229e2a[_0x79bd('0x1f')]['findOne']({'where':{'id':_0x3cb597['id']}})[_0x79bd('0x20')](function(_0x2bd1a2){if(!_['isNil'](_0x2bd1a2)){var _0x70e77f=_0x2bd1a2['dialTimezone'];if(!_[_0x79bd('0x1e')](_0x70e77f)){var _0x266766=shared[_0x79bd('0x21')];var _0x1405bd=_0x266766[_0x70e77f];var _0x20be06=_0x266766[_0x25dfa0['dialTimezone']];if(!_['isNil'](_0x1405bd)&&!_['isNil'](_0x20be06)){var _0x3c954c=_0x1405bd[_0x79bd('0x22')]-_0x20be06['utcOffset'];_0x3bd9eb=_0x25dfa0[_0x79bd('0x1c')]?_0x25dfa0[_0x79bd('0x1c')]:moment();var _0x5514d7=moment(_0x3bd9eb)[_0x79bd('0x23')](_0x3c954c,_0x79bd('0x24'));_0x4aff0f({'ret':_0x5514d7[_0x79bd('0x25')](_0x79bd('0x1d'))});}else _0x4aff0f({'ret':_0x3bd9eb});}else _0x4aff0f({'ret':_0x3bd9eb});}else{_0x4aff0f({'ret':_0x3bd9eb});}});}});return 0xa;}var _0x621054=function(_0xa19e3f){return new BPromise(function(_0x29ae15,_0x58fbb4){_0x38f849(_0xa19e3f,_0x310e7f)[_0x79bd('0x20')](function(_0x324edb){_0x310e7f[_0x79bd('0x1c')]=_0x324edb[_0x79bd('0x26')];_0x229e2a['CmHopper'][_0x79bd('0x27')]({'where':{'phone':_0x310e7f[_0x79bd('0x11')],'VoiceQueueId':_0xa19e3f['id']}})[_0x79bd('0x20')](function(_0x2cce1f){if(!_[_0x79bd('0x1e')](_0x2cce1f)){throw new Error(_0x79bd('0x28')+_0x310e7f[_0x79bd('0x11')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0xa19e3f['id']);}return _0x229e2a[_0x79bd('0x29')][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f['priority']:0x2,'scheduledat':_0x310e7f[_0x79bd('0x1c')]?_0x310e7f[_0x79bd('0x1c')]:moment()[_0x79bd('0x25')](_0x79bd('0x1d')),'callback':_0x310e7f[_0x79bd('0x2d')]?!![]:![],'callbackuniqueid':_0x310e7f[_0x79bd('0x2d')]?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f['callbackUniqueid']?moment()['format'](_0x79bd('0x1d')):undefined,'VoiceQueueId':_0xa19e3f['id']});})[_0x79bd('0x2e')](function(_0x39cbc1){_0x58fbb4(_0x39cbc1);});});});};var _0x57ae30=function(_0x5c8898){return new BPromise(function(_0x3368c8,_0x2c3f81){_0x38f849(_0x5c8898,_0x310e7f)[_0x79bd('0x20')](function(_0x21eac2){_0x310e7f[_0x79bd('0x1c')]=_0x21eac2['ret'];_0x229e2a[_0x79bd('0x29')][_0x79bd('0x27')]({'where':{'phone':_0x310e7f['phone'],'VoiceQueueId':_0x5c8898['id']}})[_0x79bd('0x20')](function(_0xefa6a7){if(!_[_0x79bd('0x1e')](_0xefa6a7)){throw new Error(_0x79bd('0x28')+_0x310e7f['phone']+_0x79bd('0x2f')+_0x5c8898['id']);}return _0x229e2a[_0x79bd('0x30')][_0x79bd('0x27')]({'where':{'calleridnum':_0x310e7f[_0x79bd('0x11')],'VoiceQueueId':_0x5c8898['id']}});})[_0x79bd('0x20')](function(_0x4df138){if(!_['isNil'](_0x4df138)){throw new Error(_0x79bd('0x31')+_0x310e7f[_0x79bd('0x11')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5c8898['id']);}return _0x229e2a[_0x79bd('0x29')][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f[_0x79bd('0x2c')]:0x2,'scheduledat':_0x310e7f[_0x79bd('0x1c')]?_0x310e7f[_0x79bd('0x1c')]:moment()['format'](_0x79bd('0x1d')),'callback':_0x310e7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x310e7f['callbackUniqueid']?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f[_0x79bd('0x2d')]?moment()['format'](_0x79bd('0x1d')):undefined,'VoiceQueueId':_0x5c8898['id']});})[_0x79bd('0x2e')](function(_0x30f99f){_0x2c3f81(_0x30f99f);});});});};function _0x2bfe71(){return function(_0x970553){logger[_0x79bd('0x18')](_0x79bd('0x19'),_0x79bd('0x1a'),util['inspect'](_0x970553,{'showHidden':![],'depth':null}));};}function _0x1a1f3f(_0x559dab,_0x47cf19){var _0x55c886=_0x47cf19[_0x79bd('0x1c')]?_0x47cf19[_0x79bd('0x1c')]:moment()[_0x79bd('0x25')](_0x79bd('0x1d'));return new BPromise(function(_0xc0f073,_0x2a57c9){if(_[_0x79bd('0x1e')](_0x47cf19['dialTimezone'])){_0xc0f073({'ret':_0x55c886});}else{_0x229e2a['Campaign']['findOne']({'where':{'id':_0x559dab['id']}})['then'](function(_0x2b291e){if(!_[_0x79bd('0x1e')](_0x2b291e)){var _0x39ec19=_0x2b291e['dialTimezone'];if(!_[_0x79bd('0x1e')](_0x39ec19)){var _0xe11560=shared[_0x79bd('0x21')];var _0xe83483=_0xe11560[_0x39ec19];var _0x20a8a6=_0xe11560[_0x47cf19[_0x79bd('0x32')]];if(!_[_0x79bd('0x1e')](_0xe83483)&&!_[_0x79bd('0x1e')](_0x20a8a6)){var _0x2d34fc=_0xe83483['utcOffset']-_0x20a8a6['utcOffset'];_0x55c886=_0x47cf19[_0x79bd('0x1c')]?_0x47cf19[_0x79bd('0x1c')]:moment();var _0x418fb0=moment(_0x55c886)[_0x79bd('0x23')](_0x2d34fc,'minutes');_0xc0f073({'ret':_0x418fb0['format'](_0x79bd('0x1d'))});}else _0xc0f073({'ret':_0x55c886});}else _0xc0f073({'ret':_0x55c886});}else{_0xc0f073({'ret':_0x55c886});}});}});return 0xa;}var _0x2de4c1=function(_0x3cac0a){return new BPromise(function(_0x242252,_0x159c31){_0x1a1f3f(_0x3cac0a,_0x310e7f)[_0x79bd('0x20')](function(_0x247f0e){_0x310e7f[_0x79bd('0x1c')]=_0x247f0e[_0x79bd('0x26')];_0x229e2a[_0x79bd('0x29')]['findOne']({'where':{'phone':_0x310e7f[_0x79bd('0x11')],'CampaignId':_0x3cac0a['id']}})[_0x79bd('0x20')](function(_0x5eccc7){if(!_['isNil'](_0x5eccc7)){throw new Error(_0x79bd('0x28')+_0x310e7f[_0x79bd('0x11')]+_0x79bd('0x33')+_0x3cac0a['id']);}return _0x229e2a[_0x79bd('0x29')][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f[_0x79bd('0x2c')]:0x2,'scheduledat':_0x310e7f['scheduledat']?_0x310e7f[_0x79bd('0x1c')]:moment()['format'](_0x79bd('0x1d')),'callback':_0x310e7f[_0x79bd('0x2d')]?!![]:![],'callbackuniqueid':_0x310e7f[_0x79bd('0x2d')]?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f[_0x79bd('0x2d')]?moment()[_0x79bd('0x25')](_0x79bd('0x1d')):undefined,'CampaignId':_0x3cac0a['id']});})[_0x79bd('0x2e')](function(_0x4be4da){_0x159c31(_0x4be4da);});});});};var _0x52b57c=function(_0x4ee13e){return new BPromise(function(_0x5a28ad,_0x3fc185){_0x1a1f3f(_0x4ee13e,_0x310e7f)[_0x79bd('0x20')](function(_0x233021){_0x310e7f[_0x79bd('0x1c')]=_0x233021[_0x79bd('0x26')];_0x229e2a['CmHopper'][_0x79bd('0x27')]({'where':{'phone':_0x310e7f[_0x79bd('0x11')],'CampaignId':_0x4ee13e['id']}})[_0x79bd('0x20')](function(_0xee43aa){if(!_[_0x79bd('0x1e')](_0xee43aa)){throw new Error(_0x79bd('0x28')+_0x310e7f[_0x79bd('0x11')]+_0x79bd('0x34')+_0x4ee13e['id']);}return _0x229e2a[_0x79bd('0x30')][_0x79bd('0x27')]({'where':{'calleridnum':_0x310e7f[_0x79bd('0x11')],'CampaignId':_0x4ee13e['id']}});})[_0x79bd('0x20')](function(_0x2b4aa8){if(!_['isNil'](_0x2b4aa8)){throw new Error(_0x79bd('0x31')+_0x310e7f[_0x79bd('0x11')]+_0x79bd('0x35')+_0x4ee13e['id']);}return _0x229e2a[_0x79bd('0x29')][_0x79bd('0x2a')]({'phone':_0x310e7f['phone'],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f[_0x79bd('0x2c')]:0x2,'scheduledat':_0x310e7f[_0x79bd('0x1c')]?_0x310e7f['scheduledat']:moment()[_0x79bd('0x25')](_0x79bd('0x1d')),'callback':_0x310e7f[_0x79bd('0x2d')]?!![]:![],'callbackuniqueid':_0x310e7f['callbackUniqueid']?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f[_0x79bd('0x2d')]?moment()[_0x79bd('0x25')](_0x79bd('0x1d')):undefined,'CampaignId':_0x4ee13e['id']});})[_0x79bd('0x2e')](function(_0x5df277){_0x3fc185(_0x5df277);});});});};if(_0x310e7f[_0x79bd('0x2b')]){_0x229e2a[_0x79bd('0x1f')][_0x79bd('0x36')]({'where':{'type':_0x79bd('0x37')},'attributes':['id',_0x79bd('0x38'),_0x79bd('0x32')],'include':[{'model':_0x229e2a['CmList'],'as':_0x79bd('0x39'),'where':{'id':_0x310e7f['ListId']}}]})[_0x79bd('0x20')](function(_0x38da65){if(_0x38da65){var _0x5678a1=[];for(var _0x3ae55e=0x0,_0xd021cd;_0x3ae55e<_0x38da65[_0x79bd('0x3a')];_0x3ae55e+=0x1){_0xd021cd=_0x38da65[_0x3ae55e][_0x79bd('0x3b')]({'plain':!![]});switch(_0xd021cd[_0x79bd('0x38')]){case _0x79bd('0x3c'):_0x57ae30(_0xd021cd)[_0x79bd('0x2e')](_0x240349());break;case'onlyIfOpen':_0x621054(_0xd021cd)['catch'](_0x240349());break;default:_0x1a1f3f(_0xd021cd,_0x310e7f)[_0x79bd('0x20')](function(_0x200507){_0x310e7f[_0x79bd('0x1c')]=_0x200507['ret'];_0x229e2a[_0x79bd('0x29')]['create']({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f['ListId'],'scheduledat':_0x310e7f['scheduledat']?_0x310e7f[_0x79bd('0x1c')]:moment()[_0x79bd('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f[_0x79bd('0x2c')]:0x2,'callback':_0x310e7f[_0x79bd('0x2d')]?!![]:![],'callbackuniqueid':_0x310e7f[_0x79bd('0x2d')]?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f[_0x79bd('0x2d')]?moment()[_0x79bd('0x25')](_0x79bd('0x1d')):undefined,'VoiceQueueId':_0xd021cd['id']})['catch'](_0x240349());});}}}})['then'](function(){return _0x229e2a[_0x79bd('0x1f')][_0x79bd('0x36')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x229e2a[_0x79bd('0x3d')],'as':'BlackLists','where':{'id':_0x310e7f[_0x79bd('0x2b')]}}]})['then'](function(_0x8b9458){if(_0x8b9458){var _0x4e4335=[];for(var _0x372276=0x0,_0x919819;_0x372276<_0x8b9458[_0x79bd('0x3a')];_0x372276+=0x1){_0x919819=_0x8b9458[_0x372276][_0x79bd('0x3b')]({'plain':!![]});_0x229e2a['CmHopperBlack'][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'VoiceQueueId':_0x919819['id']})[_0x79bd('0x2e')](function(_0x3bb1d7){logger[_0x79bd('0x18')]('cmContact,\x20%s,\x20%s','afterCreate',_0x3bb1d7[_0x79bd('0x3e')]);});}}});})[_0x79bd('0x20')](function(){return _0x229e2a[_0x79bd('0x3f')][_0x79bd('0x36')]({'attributes':['id',_0x79bd('0x38'),_0x79bd('0x32')],'include':[{'model':_0x229e2a[_0x79bd('0x3d')],'as':'Lists','where':{'id':_0x310e7f[_0x79bd('0x2b')]}}]})[_0x79bd('0x20')](function(_0x19b76c){if(_0x19b76c){var _0x12cf7d=[];for(var _0xb204c3=0x0,_0x33fabe;_0xb204c3<_0x19b76c[_0x79bd('0x3a')];_0xb204c3+=0x1){_0x33fabe=_0x19b76c[_0xb204c3][_0x79bd('0x3b')]({'plain':!![]});switch(_0x33fabe[_0x79bd('0x38')]){case _0x79bd('0x3c'):_0x52b57c(_0x33fabe)['catch'](_0x2bfe71());break;case'onlyIfOpen':_0x2de4c1(_0x33fabe)[_0x79bd('0x2e')](_0x2bfe71());break;default:_0x229e2a[_0x79bd('0x29')][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f[_0x79bd('0x2b')],'scheduledat':_0x310e7f[_0x79bd('0x1c')]?_0x310e7f[_0x79bd('0x1c')]:moment()[_0x79bd('0x25')](_0x79bd('0x1d')),'priority':_0x310e7f[_0x79bd('0x2c')]?_0x310e7f[_0x79bd('0x2c')]:0x2,'callback':_0x310e7f[_0x79bd('0x2d')]?!![]:![],'callbackuniqueid':_0x310e7f[_0x79bd('0x2d')]?_0x310e7f[_0x79bd('0x2d')]:undefined,'callbackat':_0x310e7f['callbackUniqueid']?moment()[_0x79bd('0x25')](_0x79bd('0x1d')):undefined,'CampaignId':_0x33fabe['id']})[_0x79bd('0x2e')](_0x2bfe71());}}}});})[_0x79bd('0x20')](function(){return _0x229e2a['Campaign'][_0x79bd('0x36')]({'attributes':['id'],'include':[{'model':_0x229e2a[_0x79bd('0x3d')],'as':_0x79bd('0x40'),'where':{'id':_0x310e7f['ListId']}}]})[_0x79bd('0x20')](function(_0x22192c){if(_0x22192c){var _0x5e2ee6=[];for(var _0x16a917=0x0,_0xa4ad0e;_0x16a917<_0x22192c[_0x79bd('0x3a')];_0x16a917+=0x1){_0xa4ad0e=_0x22192c[_0x16a917]['get']({'plain':!![]});_0x229e2a[_0x79bd('0x41')][_0x79bd('0x2a')]({'phone':_0x310e7f[_0x79bd('0x11')],'ContactId':_0x310e7f['id'],'ListId':_0x310e7f['ListId'],'CampaignId':_0xa4ad0e['id']})[_0x79bd('0x2e')](function(_0x5cafc7){logger[_0x79bd('0x18')](_0x79bd('0x42'),_0x79bd('0x1a'),_0x5cafc7[_0x79bd('0x3e')]);});}}});})[_0x79bd('0x20')](function(){_0x1cea18();})['catch'](function(_0x5dc4d7){logger[_0x79bd('0x18')]('cmContact,\x20%s,\x20%s',_0x79bd('0x1a'),_0x5dc4d7[_0x79bd('0x3e')]);_0x1cea18(_0x5dc4d7);});}else{_0x1cea18(new Error(_0x79bd('0x43')));}},'afterDestroy':function(_0x5a235b,_0x41051a,_0x1a53a3){var _0x21b375=_0x5a3c10[_0x79bd('0x17')];var _0xdb643f=_0x5a235b['get']({'plain':!![]});return _0x21b375[_0x79bd('0x29')][_0x79bd('0x36')]({'raw':!![],'where':{'ListId':_0xdb643f['ListId'],'ContactId':_0xdb643f['id']}})[_0x79bd('0x20')](function(_0x32f430){if(!_[_0x79bd('0x44')](_0x32f430)){var _0x1f5497=[];for(var _0x96bb8c=0x0;_0x96bb8c<_0x32f430[_0x79bd('0x3a')];_0x96bb8c+=0x1){var _0x16ffbb=_0x21b375['CmHopper'][_0x79bd('0x45')]({'where':{'ListId':_0x32f430[_0x96bb8c]['ListId'],'ContactId':_0x32f430[_0x96bb8c][_0x79bd('0x46')],'VoiceQueueId':_0x32f430[_0x96bb8c][_0x79bd('0x47')],'CampaignId':_0x32f430[_0x96bb8c][_0x79bd('0x48')]}});_0x1f5497[_0x79bd('0x49')](_0x16ffbb);}return BPromise[_0x79bd('0x4a')](_0x1f5497);}})['then'](function(_0x48a2de){logger[_0x79bd('0x4b')](_0x79bd('0x4c'),util[_0x79bd('0x1b')](_0x48a2de,{'showHidden':![],'depth':null}));_0x1a53a3();})[_0x79bd('0x2e')](function(_0x2e7d6a){logger[_0x79bd('0x18')]('[CmContact][afterDestroy][Error]',util[_0x79bd('0x1b')](_0x2e7d6a,{'showHidden':![],'depth':null}));_0x1a53a3(_0x2e7d6a);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 820ea73..bd3c4cf 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x4c66c2,_0x424e3e){var _0x5f29e3=function(_0x34d661){while(--_0x34d661){_0x4c66c2['push'](_0x4c66c2['shift']());}};_0x5f29e3(++_0x424e3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 7c6d796..8c7e450 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 _0x0eaa=['STRING','sequelize','exports','INTEGER'];(function(_0x52251f,_0x5d02f3){var _0xd91ce0=function(_0x124489){while(--_0x124489){_0x52251f['push'](_0x52251f['shift']());}};_0xd91ce0(++_0x5d02f3);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x52f906,_0x23ffee){_0x52f906=_0x52f906-0x0;var _0x453ce6=_0x0eaa[_0x52f906];return _0x453ce6;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa0ea('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xa0ea('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xa0ea('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xa0ea('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x342e=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0x342e,0xde));var _0xe342=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x342e[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require(_0xe342('0x0'));module[_0xe342('0x1')]={'CmContactId':{'type':Sequelize[_0xe342('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe342('0x3')],'defaultValue':_0xe342('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index b1441be..7c67daa 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 _0x29af=['includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29af,0x10f));var _0xf29a=function(_0x22ec53,_0x5a5549){_0x22ec53=_0x22ec53-0x0;var _0x45d6ae=_0x29af[_0x22ec53];return _0x45d6ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf29a('0x0'));var zipdir=require(_0xf29a('0x1'));var jsonpatch=require(_0xf29a('0x2'));var rp=require(_0xf29a('0x3'));var moment=require(_0xf29a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf29a('0x5'));var util=require(_0xf29a('0x6'));var path=require(_0xf29a('0x7'));var sox=require(_0xf29a('0x8'));var csv=require(_0xf29a('0x9'));var ejs=require(_0xf29a('0xa'));var fs=require('fs');var fs_extra=require(_0xf29a('0xb'));var _=require('lodash');var squel=require(_0xf29a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf29a('0xd'));var deskjs=require(_0xf29a('0xe'));var toCsv=require(_0xf29a('0x9'));var querystring=require(_0xf29a('0xf'));var Papa=require(_0xf29a('0x10'));var Redis=require(_0xf29a('0x11'));var authService=require(_0xf29a('0x12'));var qs=require(_0xf29a('0x13'));var as=require(_0xf29a('0x14'));var hardwareService=require(_0xf29a('0x15'));var logger=require(_0xf29a('0x16'))(_0xf29a('0x17'));var utils=require(_0xf29a('0x18'));var config=require(_0xf29a('0x19'));var licenseUtil=require(_0xf29a('0x1a'));var db=require(_0xf29a('0x1b'))['db'];function respondWithStatusCode(_0x11de32,_0x335c87){_0x335c87=_0x335c87||0xcc;return function(_0x32d8da){if(_0x32d8da){return _0x11de32['sendStatus'](_0x335c87);}return _0x11de32[_0xf29a('0x1c')](_0x335c87)[_0xf29a('0x1d')]();};}function respondWithResult(_0x936bd7,_0x2e610){_0x2e610=_0x2e610||0xc8;return function(_0x587803){if(_0x587803){return _0x936bd7[_0xf29a('0x1c')](_0x2e610)[_0xf29a('0x1e')](_0x587803);}};}function respondWithFilteredResult(_0x5cb0e3,_0x1f21af){return function(_0x2ae6f0){if(_0x2ae6f0){var _0x53e87f=typeof _0x1f21af[_0xf29a('0x1f')]===_0xf29a('0x20')&&typeof _0x1f21af[_0xf29a('0x21')]===_0xf29a('0x20');var _0x1f4ee2=_0x2ae6f0[_0xf29a('0x22')];var _0x4c1278=_0x53e87f?0x0:_0x1f21af['offset'];var _0x30011d=_0x53e87f?_0x2ae6f0['count']:_0x1f21af[_0xf29a('0x1f')]+_0x1f21af[_0xf29a('0x21')];var _0x28ce77;if(_0x30011d>=_0x1f4ee2){_0x30011d=_0x1f4ee2;_0x28ce77=0xc8;}else{_0x28ce77=0xce;}_0x5cb0e3[_0xf29a('0x1c')](_0x28ce77);return _0x5cb0e3[_0xf29a('0x23')](_0xf29a('0x24'),_0x4c1278+'-'+_0x30011d+'/'+_0x1f4ee2)[_0xf29a('0x1e')](_0x2ae6f0);}return null;};}function patchUpdates(_0x416c49){return function(_0x436465){try{jsonpatch[_0xf29a('0x25')](_0x436465,_0x416c49,!![]);}catch(_0x5e93d2){return BPromise['reject'](_0x5e93d2);}return _0x436465['save']();};}function saveUpdates(_0x10c4a6,_0x272794){return function(_0x14463e){if(_0x14463e){return _0x14463e[_0xf29a('0x26')](_0x10c4a6)[_0xf29a('0x27')](function(_0x148e20){return _0x148e20;});}return null;};}function removeEntity(_0x5ddfca,_0x2879a3){return function(_0x52279b){if(_0x52279b){return _0x52279b[_0xf29a('0x28')]()[_0xf29a('0x27')](function(){var _0x2ee68c=_0x52279b['get']({'plain':!![]});var _0x49afa9=_0xf29a('0x29');return db[_0xf29a('0x2a')][_0xf29a('0x28')]({'where':{'type':_0x49afa9,'resourceId':_0x2ee68c['id']}})[_0xf29a('0x27')](function(){return _0x52279b;});})['then'](function(){_0x5ddfca[_0xf29a('0x1c')](0xcc)[_0xf29a('0x1d')]();});}};}function handleEntityNotFound(_0x4d857e,_0x22e93e){return function(_0x44721c){if(!_0x44721c){_0x4d857e[_0xf29a('0x2b')](0x194);}return _0x44721c;};}function handleError(_0xbf55d0,_0x1d143b){_0x1d143b=_0x1d143b||0x1f4;return function(_0x5751cd){logger[_0xf29a('0x2c')](_0x5751cd[_0xf29a('0x2d')]);if(_0x5751cd[_0xf29a('0x2e')]){delete _0x5751cd[_0xf29a('0x2e')];}_0xbf55d0['status'](_0x1d143b)[_0xf29a('0x2f')](_0x5751cd);};}exports[_0xf29a('0x30')]=function(_0x5dc676,_0x239894){var _0x1f93f9={},_0x37246f={},_0x2f55b5={'count':0x0,'rows':[]};var _0x3747e8=_[_0xf29a('0x31')](db[_0xf29a('0x32')][_0xf29a('0x33')],function(_0x5a0877){return{'name':_0x5a0877[_0xf29a('0x34')],'type':_0x5a0877[_0xf29a('0x35')][_0xf29a('0x36')]};});_0x37246f['model']=_[_0xf29a('0x31')](_0x3747e8,'name');_0x37246f[_0xf29a('0x37')]=_['keys'](_0x5dc676['query']);_0x37246f[_0xf29a('0x38')]=_[_0xf29a('0x39')](_0x37246f['model'],_0x37246f['query']);_0x1f93f9[_0xf29a('0x3a')]=_['intersection'](_0x37246f[_0xf29a('0x3b')],qs[_0xf29a('0x3c')](_0x5dc676[_0xf29a('0x37')][_0xf29a('0x3c')]));_0x1f93f9[_0xf29a('0x3a')]=_0x1f93f9[_0xf29a('0x3a')][_0xf29a('0x3d')]?_0x1f93f9[_0xf29a('0x3a')]:_0x37246f[_0xf29a('0x3b')];if(!_0x5dc676[_0xf29a('0x37')][_0xf29a('0x3e')]('nolimit')){_0x1f93f9[_0xf29a('0x21')]=qs[_0xf29a('0x21')](_0x5dc676[_0xf29a('0x37')][_0xf29a('0x21')]);_0x1f93f9[_0xf29a('0x1f')]=qs[_0xf29a('0x1f')](_0x5dc676['query']['offset']);}_0x1f93f9['order']=qs[_0xf29a('0x3f')](_0x5dc676[_0xf29a('0x37')][_0xf29a('0x3f')]);_0x1f93f9['where']=qs[_0xf29a('0x38')](_[_0xf29a('0x40')](_0x5dc676['query'],_0x37246f[_0xf29a('0x38')]),_0x3747e8);if(_0x5dc676[_0xf29a('0x37')][_0xf29a('0x41')]){_0x1f93f9[_0xf29a('0x42')]=_[_0xf29a('0x43')](_0x1f93f9[_0xf29a('0x42')],{'$or':_[_0xf29a('0x31')](_0x3747e8,function(_0x4a25b6){if(_0x4a25b6[_0xf29a('0x35')]!=='VIRTUAL'){var _0x49c85c={};_0x49c85c[_0x4a25b6[_0xf29a('0x2e')]]={'$like':'%'+_0x5dc676[_0xf29a('0x37')]['filter']+'%'};return _0x49c85c;}})});}_0x1f93f9=_[_0xf29a('0x43')]({},_0x1f93f9,_0x5dc676[_0xf29a('0x44')]);var _0x1b6999={'where':_0x1f93f9[_0xf29a('0x42')]};return db['CmContactHasItem'][_0xf29a('0x22')](_0x1b6999)[_0xf29a('0x27')](function(_0x34aaf3){_0x2f55b5[_0xf29a('0x22')]=_0x34aaf3;if(_0x5dc676[_0xf29a('0x37')][_0xf29a('0x45')]){_0x1f93f9[_0xf29a('0x46')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xf29a('0x47')](_0x1f93f9);})[_0xf29a('0x27')](function(_0x5610cf){_0x2f55b5[_0xf29a('0x48')]=_0x5610cf;return _0x2f55b5;})[_0xf29a('0x27')](respondWithFilteredResult(_0x239894,_0x1f93f9))[_0xf29a('0x49')](handleError(_0x239894,null));};exports[_0xf29a('0x4a')]=function(_0x2133de,_0x3500ea){var _0x3e22e6={'raw':!![],'where':{'id':_0x2133de[_0xf29a('0x4b')]['id']}},_0x2a28ce={};_0x2a28ce['model']=_['keys'](db[_0xf29a('0x32')][_0xf29a('0x33')]);_0x2a28ce['query']=_[_0xf29a('0x4c')](_0x2133de[_0xf29a('0x37')]);_0x2a28ce[_0xf29a('0x38')]=_[_0xf29a('0x39')](_0x2a28ce['model'],_0x2a28ce[_0xf29a('0x37')]);_0x3e22e6[_0xf29a('0x3a')]=_[_0xf29a('0x39')](_0x2a28ce['model'],qs[_0xf29a('0x3c')](_0x2133de[_0xf29a('0x37')][_0xf29a('0x3c')]));_0x3e22e6[_0xf29a('0x3a')]=_0x3e22e6['attributes'][_0xf29a('0x3d')]?_0x3e22e6[_0xf29a('0x3a')]:_0x2a28ce[_0xf29a('0x3b')];if(_0x2133de[_0xf29a('0x37')]['includeAll']){_0x3e22e6[_0xf29a('0x46')]=[{'all':!![]}];}_0x3e22e6=_[_0xf29a('0x43')]({},_0x3e22e6,_0x2133de['options']);return db['CmContactHasItem'][_0xf29a('0x4d')](_0x3e22e6)[_0xf29a('0x27')](handleEntityNotFound(_0x3500ea,null))[_0xf29a('0x27')](respondWithResult(_0x3500ea,null))[_0xf29a('0x49')](handleError(_0x3500ea,null));};exports[_0xf29a('0x4e')]=function(_0x1c40c0,_0x529dc8){return db[_0xf29a('0x32')][_0xf29a('0x4e')](_0x1c40c0['body'],{})[_0xf29a('0x27')](function(_0x476f1b){var _0x29b167=_0x1c40c0[_0xf29a('0x4f')][_0xf29a('0x50')]({'plain':!![]});if(!_0x29b167)throw new Error(_0xf29a('0x51'));if(_0x29b167['role']===_0xf29a('0x4f')){var _0x55c00f=_0x476f1b[_0xf29a('0x50')]({'plain':!![]});var _0x105c20=_0xf29a('0x29');return db[_0xf29a('0x52')][_0xf29a('0x4d')]({'where':{'name':_0x105c20,'userProfileId':_0x29b167['userProfileId']},'raw':!![]})[_0xf29a('0x27')](function(_0x25cc80){if(_0x25cc80&&_0x25cc80['autoAssociation']===0x0){return db['UserProfileResource'][_0xf29a('0x4e')]({'name':_0x55c00f[_0xf29a('0x2e')],'resourceId':_0x55c00f['id'],'type':_0x25cc80['name'],'sectionId':_0x25cc80['id']},{})[_0xf29a('0x27')](function(){return _0x476f1b;});}else{return _0x476f1b;}})[_0xf29a('0x49')](function(_0x46b42c){logger[_0xf29a('0x2c')](_0xf29a('0x53'),_0x46b42c);throw _0x46b42c;});}return _0x476f1b;})['then'](respondWithResult(_0x529dc8,0xc9))[_0xf29a('0x49')](handleError(_0x529dc8,null));};exports[_0xf29a('0x26')]=function(_0x18330c,_0x4ecce8){if(_0x18330c[_0xf29a('0x54')]['id']){delete _0x18330c[_0xf29a('0x54')]['id'];}return db[_0xf29a('0x32')]['find']({'where':{'id':_0x18330c[_0xf29a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ecce8,null))[_0xf29a('0x27')](saveUpdates(_0x18330c[_0xf29a('0x54')],null))[_0xf29a('0x27')](respondWithResult(_0x4ecce8,null))[_0xf29a('0x49')](handleError(_0x4ecce8,null));};exports[_0xf29a('0x28')]=function(_0x7ebb88,_0x2efef7){return db[_0xf29a('0x32')][_0xf29a('0x4d')]({'where':{'id':_0x7ebb88[_0xf29a('0x4b')]['id']}})[_0xf29a('0x27')](handleEntityNotFound(_0x2efef7,null))[_0xf29a('0x27')](removeEntity(_0x2efef7,null))[_0xf29a('0x49')](handleError(_0x2efef7,null));}; \ No newline at end of file +var _0xcf07=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','update','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xcf07,0x134));var _0x7cf0=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0xcf07[_0x218994];return _0x3f350b;};'use strict';var emlformat=require(_0x7cf0('0x0'));var rimraf=require(_0x7cf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cf0('0x2'));var rp=require(_0x7cf0('0x3'));var moment=require(_0x7cf0('0x4'));var BPromise=require(_0x7cf0('0x5'));var Mustache=require(_0x7cf0('0x6'));var util=require(_0x7cf0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7cf0('0x8'));var ejs=require(_0x7cf0('0x9'));var fs=require('fs');var fs_extra=require(_0x7cf0('0xa'));var _=require(_0x7cf0('0xb'));var squel=require(_0x7cf0('0xc'));var crypto=require('crypto');var jsforce=require(_0x7cf0('0xd'));var deskjs=require(_0x7cf0('0xe'));var toCsv=require(_0x7cf0('0x8'));var querystring=require(_0x7cf0('0xf'));var Papa=require(_0x7cf0('0x10'));var Redis=require(_0x7cf0('0x11'));var authService=require(_0x7cf0('0x12'));var qs=require(_0x7cf0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cf0('0x14'))('api');var utils=require(_0x7cf0('0x15'));var config=require(_0x7cf0('0x16'));var licenseUtil=require(_0x7cf0('0x17'));var db=require(_0x7cf0('0x18'))['db'];function respondWithStatusCode(_0x447a81,_0x5d4332){_0x5d4332=_0x5d4332||0xcc;return function(_0x1c95e5){if(_0x1c95e5){return _0x447a81['sendStatus'](_0x5d4332);}return _0x447a81[_0x7cf0('0x19')](_0x5d4332)[_0x7cf0('0x1a')]();};}function respondWithResult(_0x37bebf,_0x4cd222){_0x4cd222=_0x4cd222||0xc8;return function(_0x544593){if(_0x544593){return _0x37bebf[_0x7cf0('0x19')](_0x4cd222)['json'](_0x544593);}};}function respondWithFilteredResult(_0x35b7a7,_0x1044b1){return function(_0x2b2de3){if(_0x2b2de3){var _0x4bdd4e=typeof _0x1044b1[_0x7cf0('0x1b')]===_0x7cf0('0x1c')&&typeof _0x1044b1[_0x7cf0('0x1d')]===_0x7cf0('0x1c');var _0xd003ac=_0x2b2de3[_0x7cf0('0x1e')];var _0x5e3f11=_0x4bdd4e?0x0:_0x1044b1[_0x7cf0('0x1b')];var _0x2d1419=_0x4bdd4e?_0x2b2de3['count']:_0x1044b1['offset']+_0x1044b1[_0x7cf0('0x1d')];var _0xe63ca9;if(_0x2d1419>=_0xd003ac){_0x2d1419=_0xd003ac;_0xe63ca9=0xc8;}else{_0xe63ca9=0xce;}_0x35b7a7[_0x7cf0('0x19')](_0xe63ca9);return _0x35b7a7[_0x7cf0('0x1f')]('Content-Range',_0x5e3f11+'-'+_0x2d1419+'/'+_0xd003ac)[_0x7cf0('0x20')](_0x2b2de3);}return null;};}function patchUpdates(_0x17b3cc){return function(_0x5ad149){try{jsonpatch[_0x7cf0('0x21')](_0x5ad149,_0x17b3cc,!![]);}catch(_0x4b6e52){return BPromise['reject'](_0x4b6e52);}return _0x5ad149['save']();};}function saveUpdates(_0x3e8ba3,_0x76af3d){return function(_0x160d59){if(_0x160d59){return _0x160d59[_0x7cf0('0x22')](_0x3e8ba3)['then'](function(_0x3666f3){return _0x3666f3;});}return null;};}function removeEntity(_0x4b34d1,_0x166316){return function(_0x1ccd8b){if(_0x1ccd8b){return _0x1ccd8b[_0x7cf0('0x23')]()[_0x7cf0('0x24')](function(){var _0x2259fb=_0x1ccd8b[_0x7cf0('0x25')]({'plain':!![]});var _0x1ab08e=_0x7cf0('0x26');return db[_0x7cf0('0x27')][_0x7cf0('0x23')]({'where':{'type':_0x1ab08e,'resourceId':_0x2259fb['id']}})[_0x7cf0('0x24')](function(){return _0x1ccd8b;});})[_0x7cf0('0x24')](function(){_0x4b34d1[_0x7cf0('0x19')](0xcc)[_0x7cf0('0x1a')]();});}};}function handleEntityNotFound(_0x5b28c4,_0x151943){return function(_0x12e11a){if(!_0x12e11a){_0x5b28c4['sendStatus'](0x194);}return _0x12e11a;};}function handleError(_0x47d9ea,_0x4c55d8){_0x4c55d8=_0x4c55d8||0x1f4;return function(_0x671696){logger[_0x7cf0('0x28')](_0x671696[_0x7cf0('0x29')]);if(_0x671696[_0x7cf0('0x2a')]){delete _0x671696[_0x7cf0('0x2a')];}_0x47d9ea['status'](_0x4c55d8)[_0x7cf0('0x2b')](_0x671696);};}exports[_0x7cf0('0x2c')]=function(_0xcbaf5d,_0x268fb6){var _0x49935f={},_0x3bc7e6={},_0x4933d9={'count':0x0,'rows':[]};var _0x45df82=_[_0x7cf0('0x2d')](db[_0x7cf0('0x2e')][_0x7cf0('0x2f')],function(_0x428c11){return{'name':_0x428c11[_0x7cf0('0x30')],'type':_0x428c11[_0x7cf0('0x31')][_0x7cf0('0x32')]};});_0x3bc7e6[_0x7cf0('0x33')]=_[_0x7cf0('0x2d')](_0x45df82,_0x7cf0('0x2a'));_0x3bc7e6[_0x7cf0('0x34')]=_[_0x7cf0('0x35')](_0xcbaf5d[_0x7cf0('0x34')]);_0x3bc7e6[_0x7cf0('0x36')]=_[_0x7cf0('0x37')](_0x3bc7e6[_0x7cf0('0x33')],_0x3bc7e6[_0x7cf0('0x34')]);_0x49935f[_0x7cf0('0x38')]=_[_0x7cf0('0x37')](_0x3bc7e6[_0x7cf0('0x33')],qs[_0x7cf0('0x39')](_0xcbaf5d['query'][_0x7cf0('0x39')]));_0x49935f[_0x7cf0('0x38')]=_0x49935f['attributes'][_0x7cf0('0x3a')]?_0x49935f[_0x7cf0('0x38')]:_0x3bc7e6[_0x7cf0('0x33')];if(!_0xcbaf5d[_0x7cf0('0x34')]['hasOwnProperty'](_0x7cf0('0x3b'))){_0x49935f[_0x7cf0('0x1d')]=qs[_0x7cf0('0x1d')](_0xcbaf5d[_0x7cf0('0x34')][_0x7cf0('0x1d')]);_0x49935f[_0x7cf0('0x1b')]=qs[_0x7cf0('0x1b')](_0xcbaf5d[_0x7cf0('0x34')][_0x7cf0('0x1b')]);}_0x49935f[_0x7cf0('0x3c')]=qs[_0x7cf0('0x3d')](_0xcbaf5d['query']['sort']);_0x49935f[_0x7cf0('0x3e')]=qs[_0x7cf0('0x36')](_[_0x7cf0('0x3f')](_0xcbaf5d[_0x7cf0('0x34')],_0x3bc7e6[_0x7cf0('0x36')]),_0x45df82);if(_0xcbaf5d['query']['filter']){_0x49935f[_0x7cf0('0x3e')]=_[_0x7cf0('0x40')](_0x49935f[_0x7cf0('0x3e')],{'$or':_[_0x7cf0('0x2d')](_0x45df82,function(_0x4e5760){if(_0x4e5760[_0x7cf0('0x31')]!==_0x7cf0('0x41')){var _0x3f4ea6={};_0x3f4ea6[_0x4e5760[_0x7cf0('0x2a')]]={'$like':'%'+_0xcbaf5d[_0x7cf0('0x34')]['filter']+'%'};return _0x3f4ea6;}})});}_0x49935f=_[_0x7cf0('0x40')]({},_0x49935f,_0xcbaf5d[_0x7cf0('0x42')]);var _0x2cdd9b={'where':_0x49935f[_0x7cf0('0x3e')]};return db[_0x7cf0('0x2e')][_0x7cf0('0x1e')](_0x2cdd9b)[_0x7cf0('0x24')](function(_0x4c8345){_0x4933d9[_0x7cf0('0x1e')]=_0x4c8345;if(_0xcbaf5d[_0x7cf0('0x34')]['includeAll']){_0x49935f[_0x7cf0('0x43')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x7cf0('0x44')](_0x49935f);})[_0x7cf0('0x24')](function(_0x49bd38){_0x4933d9[_0x7cf0('0x45')]=_0x49bd38;return _0x4933d9;})[_0x7cf0('0x24')](respondWithFilteredResult(_0x268fb6,_0x49935f))[_0x7cf0('0x46')](handleError(_0x268fb6,null));};exports[_0x7cf0('0x47')]=function(_0x48f590,_0x3ea374){var _0x5cdbf0={'raw':!![],'where':{'id':_0x48f590[_0x7cf0('0x48')]['id']}},_0x7abe28={};_0x7abe28['model']=_[_0x7cf0('0x35')](db[_0x7cf0('0x2e')]['rawAttributes']);_0x7abe28[_0x7cf0('0x34')]=_['keys'](_0x48f590[_0x7cf0('0x34')]);_0x7abe28['filters']=_[_0x7cf0('0x37')](_0x7abe28[_0x7cf0('0x33')],_0x7abe28['query']);_0x5cdbf0[_0x7cf0('0x38')]=_[_0x7cf0('0x37')](_0x7abe28[_0x7cf0('0x33')],qs[_0x7cf0('0x39')](_0x48f590[_0x7cf0('0x34')][_0x7cf0('0x39')]));_0x5cdbf0['attributes']=_0x5cdbf0[_0x7cf0('0x38')]['length']?_0x5cdbf0[_0x7cf0('0x38')]:_0x7abe28[_0x7cf0('0x33')];if(_0x48f590[_0x7cf0('0x34')][_0x7cf0('0x49')]){_0x5cdbf0['include']=[{'all':!![]}];}_0x5cdbf0=_['merge']({},_0x5cdbf0,_0x48f590[_0x7cf0('0x42')]);return db[_0x7cf0('0x2e')][_0x7cf0('0x4a')](_0x5cdbf0)[_0x7cf0('0x24')](handleEntityNotFound(_0x3ea374,null))['then'](respondWithResult(_0x3ea374,null))[_0x7cf0('0x46')](handleError(_0x3ea374,null));};exports['create']=function(_0x42f0e6,_0xf95e23){return db[_0x7cf0('0x2e')]['create'](_0x42f0e6['body'],{})[_0x7cf0('0x24')](function(_0x459ba6){var _0x1bfe51=_0x42f0e6['user'][_0x7cf0('0x25')]({'plain':!![]});if(!_0x1bfe51)throw new Error(_0x7cf0('0x4b'));if(_0x1bfe51[_0x7cf0('0x4c')]===_0x7cf0('0x4d')){var _0x35512d=_0x459ba6[_0x7cf0('0x25')]({'plain':!![]});var _0x2578b8='CmContactHasItems';return db['UserProfileSection'][_0x7cf0('0x4a')]({'where':{'name':_0x2578b8,'userProfileId':_0x1bfe51['userProfileId']},'raw':!![]})[_0x7cf0('0x24')](function(_0x4de628){if(_0x4de628&&_0x4de628[_0x7cf0('0x4e')]===0x0){return db[_0x7cf0('0x27')][_0x7cf0('0x4f')]({'name':_0x35512d[_0x7cf0('0x2a')],'resourceId':_0x35512d['id'],'type':_0x4de628['name'],'sectionId':_0x4de628['id']},{})['then'](function(){return _0x459ba6;});}else{return _0x459ba6;}})['catch'](function(_0x3e43f1){logger[_0x7cf0('0x28')](_0x7cf0('0x50'),_0x3e43f1);throw _0x3e43f1;});}return _0x459ba6;})[_0x7cf0('0x24')](respondWithResult(_0xf95e23,0xc9))[_0x7cf0('0x46')](handleError(_0xf95e23,null));};exports[_0x7cf0('0x22')]=function(_0x16fc80,_0x1f42a2){if(_0x16fc80[_0x7cf0('0x51')]['id']){delete _0x16fc80['body']['id'];}return db[_0x7cf0('0x2e')][_0x7cf0('0x4a')]({'where':{'id':_0x16fc80['params']['id']}})['then'](handleEntityNotFound(_0x1f42a2,null))[_0x7cf0('0x24')](saveUpdates(_0x16fc80[_0x7cf0('0x51')],null))[_0x7cf0('0x24')](respondWithResult(_0x1f42a2,null))['catch'](handleError(_0x1f42a2,null));};exports['destroy']=function(_0x1aeaca,_0x291630){return db[_0x7cf0('0x2e')][_0x7cf0('0x4a')]({'where':{'id':_0x1aeaca[_0x7cf0('0x48')]['id']}})[_0x7cf0('0x24')](handleEntityNotFound(_0x291630,null))[_0x7cf0('0x24')](removeEntity(_0x291630,null))[_0x7cf0('0x46')](handleError(_0x291630,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 7e51638..0015ebb 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 _0xb648=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util'];(function(_0x525519,_0x91a8da){var _0x29276a=function(_0x1ea6f5){while(--_0x1ea6f5){_0x525519['push'](_0x525519['shift']());}};_0x29276a(++_0x91a8da);}(_0xb648,0x140));var _0x8b64=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xb648[_0x2f57b2];return _0x5ace77;};'use strict';var _=require(_0x8b64('0x0'));var util=require(_0x8b64('0x1'));var logger=require(_0x8b64('0x2'))(_0x8b64('0x3'));var moment=require(_0x8b64('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b64('0x5'));var fs=require('fs');var path=require(_0x8b64('0x6'));var rimraf=require(_0x8b64('0x7'));var config=require(_0x8b64('0x8'));var attributes=require(_0x8b64('0x9'));module[_0x8b64('0xa')]=function(_0x58f21b,_0x5dc441){return _0x58f21b[_0x8b64('0xb')](_0x8b64('0xc'),attributes,{'tableName':_0x8b64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65c5=['bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment'];(function(_0x1fa1e6,_0x2ad5f5){var _0x2e25a1=function(_0x5bda14){while(--_0x5bda14){_0x1fa1e6['push'](_0x1fa1e6['shift']());}};_0x2e25a1(++_0x2ad5f5);}(_0x65c5,0x159));var _0x565c=function(_0x540e74,_0x592027){_0x540e74=_0x540e74-0x0;var _0x11e10f=_0x65c5[_0x540e74];return _0x11e10f;};'use strict';var _=require(_0x565c('0x0'));var util=require(_0x565c('0x1'));var logger=require(_0x565c('0x2'))(_0x565c('0x3'));var moment=require(_0x565c('0x4'));var BPromise=require(_0x565c('0x5'));var rp=require(_0x565c('0x6'));var fs=require('fs');var path=require(_0x565c('0x7'));var rimraf=require(_0x565c('0x8'));var config=require('../../config/environment');var attributes=require(_0x565c('0x9'));module[_0x565c('0xa')]=function(_0x387bd5,_0x21afb8){return _0x387bd5[_0x565c('0xb')](_0x565c('0xc'),attributes,{'tableName':_0x565c('0xd'),'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 06bbb56..5332794 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 _0x8f20=['jayson/promise','http','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x39f5c7,_0x392fdf){var _0x182793=function(_0x3e09c6){while(--_0x3e09c6){_0x39f5c7['push'](_0x39f5c7['shift']());}};_0x182793(++_0x392fdf);}(_0x8f20,0x1b0));var _0x08f2=function(_0x299e1e,_0x20eab5){_0x299e1e=_0x299e1e-0x0;var _0x3757dc=_0x8f20[_0x299e1e];return _0x3757dc;};'use strict';var _=require(_0x08f2('0x0'));var util=require('util');var moment=require(_0x08f2('0x1'));var BPromise=require(_0x08f2('0x2'));var rs=require(_0x08f2('0x3'));var fs=require('fs');var Redis=require(_0x08f2('0x4'));var db=require(_0x08f2('0x5'))['db'];var utils=require(_0x08f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x08f2('0x7'));var jayson=require(_0x08f2('0x8'));var client=jayson['client'][_0x08f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e5951,_0x1543c8,_0x32cd9e){return new BPromise(function(_0x4329fd,_0x47a405){return client['request'](_0x3e5951,_0x32cd9e)['then'](function(_0x4093f6){logger['info'](_0x08f2('0xa'),_0x1543c8,_0x08f2('0xb'));logger[_0x08f2('0xc')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x1543c8,_0x08f2('0xb'),JSON[_0x08f2('0xd')](_0x4093f6));if(_0x4093f6['error']){if(_0x4093f6[_0x08f2('0xe')][_0x08f2('0xf')]===0x1f4){logger['error'](_0x08f2('0xa'),_0x1543c8,_0x4093f6[_0x08f2('0xe')]['message']);return _0x47a405(_0x4093f6[_0x08f2('0xe')][_0x08f2('0x10')]);}logger[_0x08f2('0xe')](_0x08f2('0xa'),_0x1543c8,_0x4093f6['error'][_0x08f2('0x10')]);return _0x4329fd(_0x4093f6[_0x08f2('0xe')]['message']);}else{logger[_0x08f2('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1543c8,_0x08f2('0xb'));_0x4329fd(_0x4093f6[_0x08f2('0x12')][_0x08f2('0x10')]);}})[_0x08f2('0x13')](function(_0x282f85){logger[_0x08f2('0xe')](_0x08f2('0xa'),_0x1543c8,_0x282f85);_0x47a405(_0x282f85);});});} \ No newline at end of file +var _0x4819=['request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','CmContactHasItem,\x20%s,\x20%s'];(function(_0x3d91dc,_0x593b3c){var _0x23f89a=function(_0x5b9ecd){while(--_0x5b9ecd){_0x3d91dc['push'](_0x3d91dc['shift']());}};_0x23f89a(++_0x593b3c);}(_0x4819,0x171));var _0x9481=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x4819[_0xf44d98];return _0x5ebb04;};'use strict';var _=require(_0x9481('0x0'));var util=require(_0x9481('0x1'));var moment=require('moment');var BPromise=require(_0x9481('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9481('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9481('0x4'));var config=require(_0x9481('0x5'));var jayson=require(_0x9481('0x6'));var client=jayson[_0x9481('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb697d,_0x44f3a1,_0x136763){return new BPromise(function(_0x25b094,_0x42b5a4){return client['request'](_0xcb697d,_0x136763)[_0x9481('0x8')](function(_0x3e0053){logger[_0x9481('0x9')](_0x9481('0xa'),_0x44f3a1,_0x9481('0xb'));logger[_0x9481('0xc')](_0x9481('0xd'),_0x44f3a1,_0x9481('0xb'),JSON[_0x9481('0xe')](_0x3e0053));if(_0x3e0053[_0x9481('0xf')]){if(_0x3e0053[_0x9481('0xf')][_0x9481('0x10')]===0x1f4){logger[_0x9481('0xf')](_0x9481('0xa'),_0x44f3a1,_0x3e0053['error'][_0x9481('0x11')]);return _0x42b5a4(_0x3e0053[_0x9481('0xf')][_0x9481('0x11')]);}logger[_0x9481('0xf')](_0x9481('0xa'),_0x44f3a1,_0x3e0053[_0x9481('0xf')][_0x9481('0x11')]);return _0x25b094(_0x3e0053[_0x9481('0xf')][_0x9481('0x11')]);}else{logger[_0x9481('0x9')](_0x9481('0xa'),_0x44f3a1,_0x9481('0xb'));_0x25b094(_0x3e0053[_0x9481('0x12')][_0x9481('0x11')]);}})[_0x9481('0x13')](function(_0x5cbd5a){logger[_0x9481('0xf')](_0x9481('0xa'),_0x44f3a1,_0x5cbd5a);_0x42b5a4(_0x5cbd5a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 884dd63..f2f1299 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 _0x40fb=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x40fb,0xb1));var _0xb40f=function(_0x4df17c,_0x2d2b61){_0x4df17c=_0x4df17c-0x0;var _0x4e79b5=_0x40fb[_0x4df17c];return _0x4e79b5;};'use strict';var multer=require(_0xb40f('0x0'));var util=require(_0xb40f('0x1'));var path=require('path');var timeout=require(_0xb40f('0x2'));var express=require(_0xb40f('0x3'));var router=express[_0xb40f('0x4')]();var fs_extra=require(_0xb40f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb40f('0x6'));var config=require('../../config/environment');var controller=require(_0xb40f('0x7'));router[_0xb40f('0x8')]('/',auth[_0xb40f('0x9')](),controller[_0xb40f('0xa')]);router[_0xb40f('0x8')](_0xb40f('0xb'),auth[_0xb40f('0x9')](),controller[_0xb40f('0xc')]);router[_0xb40f('0xd')]('/',auth['isAuthenticated'](),controller[_0xb40f('0xe')]);router['put'](_0xb40f('0xb'),auth[_0xb40f('0x9')](),controller[_0xb40f('0xf')]);router[_0xb40f('0x10')]('/:id',auth[_0xb40f('0x9')](),controller[_0xb40f('0x11')]);module[_0xb40f('0x12')]=router; \ No newline at end of file +var _0x96fb=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96fb,0x65));var _0xb96f=function(_0x5a0eff,_0xae1172){_0x5a0eff=_0x5a0eff-0x0;var _0x151368=_0x96fb[_0x5a0eff];return _0x151368;};'use strict';var multer=require(_0xb96f('0x0'));var util=require(_0xb96f('0x1'));var path=require(_0xb96f('0x2'));var timeout=require(_0xb96f('0x3'));var express=require(_0xb96f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb96f('0x5'));var interaction=require(_0xb96f('0x6'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0xb96f('0x7')]('/',auth[_0xb96f('0x8')](),controller[_0xb96f('0x9')]);router['get'](_0xb96f('0xa'),auth[_0xb96f('0x8')](),controller[_0xb96f('0xb')]);router[_0xb96f('0xc')]('/',auth[_0xb96f('0x8')](),controller['create']);router[_0xb96f('0xd')](_0xb96f('0xa'),auth[_0xb96f('0x8')](),controller[_0xb96f('0xe')]);router[_0xb96f('0xf')]('/:id',auth[_0xb96f('0x8')](),controller[_0xb96f('0x10')]);module[_0xb96f('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 c30b9cc..63f5409 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 _0x05be=['alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x42fae4,_0x28954e){var _0x4f6ba5=function(_0x478b2f){while(--_0x478b2f){_0x42fae4['push'](_0x42fae4['shift']());}};_0x4f6ba5(++_0x28954e);}(_0x05be,0x14f));var _0xe05b=function(_0x45ecbe,_0x2324d0){_0x45ecbe=_0x45ecbe-0x0;var _0x162c6a=_0x05be[_0x45ecbe];return _0x162c6a;};'use strict';var Sequelize=require(_0xe05b('0x0'));var _=require(_0xe05b('0x1'));module[_0xe05b('0x2')]={'name':{'type':Sequelize[_0xe05b('0x3')],'get':function(_0x4ec92f){return this[_0xe05b('0x4')](_0xe05b('0x5'));}},'alias':{'type':Sequelize[_0xe05b('0x6')],'allowNull':![],'set':function(_0x29a97b){this[_0xe05b('0x7')](_0xe05b('0x5'),_0x29a97b?_0x29a97b:this[_0xe05b('0x4')](_0xe05b('0x8')));}},'type':{'type':Sequelize[_0xe05b('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xe05b('0x9')](_0xe05b('0xa')),'get':function(){if(this[_0xe05b('0x4')](_0xe05b('0xb'))===_0xe05b('0xc')){return JSON[_0xe05b('0xd')](this[_0xe05b('0x4')](_0xe05b('0xe')));}else{return this[_0xe05b('0x4')]('values');}},'set':function(_0x4eb38f){if(Array[_0xe05b('0xf')](_0x4eb38f)){this[_0xe05b('0x7')](_0xe05b('0xe'),JSON[_0xe05b('0x10')](_0x4eb38f));}else{this[_0xe05b('0x7')](_0xe05b('0xe'),_0x4eb38f);}}},'required':{'type':Sequelize[_0xe05b('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe05b('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe05b('0x12')](_0xe05b('0x13'))}}; \ No newline at end of file +var _0x86e6=['voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','type','parse','isArray','values','stringify','setDataValue','BOOLEAN','ENUM'];(function(_0x2710da,_0x1c9393){var _0x21a94a=function(_0x28d286){while(--_0x28d286){_0x2710da['push'](_0x2710da['shift']());}};_0x21a94a(++_0x1c9393);}(_0x86e6,0x17b));var _0x686e=function(_0x4220da,_0x506384){_0x4220da=_0x4220da-0x0;var _0x1d4cc9=_0x86e6[_0x4220da];return _0x1d4cc9;};'use strict';var Sequelize=require(_0x686e('0x0'));var _=require(_0x686e('0x1'));module[_0x686e('0x2')]={'name':{'type':Sequelize[_0x686e('0x3')],'get':function(_0x1fe09c){return this[_0x686e('0x4')](_0x686e('0x5'));}},'alias':{'type':Sequelize[_0x686e('0x6')],'allowNull':![],'set':function(_0x14db22){this['setDataValue'](_0x686e('0x5'),_0x14db22?_0x14db22:this['getDataValue'](_0x686e('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x686e('0x8')]('long'),'get':function(){if(this['getDataValue'](_0x686e('0x9'))==='select'){return JSON[_0x686e('0xa')](this['getDataValue']('values'));}else{return this[_0x686e('0x4')]('values');}},'set':function(_0x33198a){if(Array[_0x686e('0xb')](_0x33198a)){this['setDataValue'](_0x686e('0xc'),JSON[_0x686e('0xd')](_0x33198a));}else{this[_0x686e('0xe')](_0x686e('0xc'),_0x33198a);}}},'required':{'type':Sequelize[_0x686e('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x686e('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x686e('0x10')](_0x686e('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9ea6d27..745a8bd 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 _0x56d1=['rows','catch','show','params','includeAll','body','find','create','sequelize','TEXT','Sequelize','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll'];(function(_0x514e4c,_0x57af85){var _0xdeb7ad=function(_0x3cbaef){while(--_0x3cbaef){_0x514e4c['push'](_0x514e4c['shift']());}};_0xdeb7ad(++_0x57af85);}(_0x56d1,0x1d8));var _0x156d=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x56d1[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0x156d('0x0'));var rimraf=require(_0x156d('0x1'));var zipdir=require(_0x156d('0x2'));var jsonpatch=require(_0x156d('0x3'));var rp=require(_0x156d('0x4'));var moment=require(_0x156d('0x5'));var BPromise=require(_0x156d('0x6'));var Mustache=require('mustache');var util=require(_0x156d('0x7'));var path=require(_0x156d('0x8'));var sox=require(_0x156d('0x9'));var csv=require('to-csv');var ejs=require(_0x156d('0xa'));var fs=require('fs');var fs_extra=require(_0x156d('0xb'));var _=require('lodash');var squel=require(_0x156d('0xc'));var crypto=require(_0x156d('0xd'));var jsforce=require(_0x156d('0xe'));var deskjs=require(_0x156d('0xf'));var toCsv=require(_0x156d('0x10'));var querystring=require(_0x156d('0x11'));var Papa=require(_0x156d('0x12'));var Redis=require(_0x156d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x156d('0x14'));var hardwareService=require(_0x156d('0x15'));var logger=require('../../config/logger')(_0x156d('0x16'));var utils=require(_0x156d('0x17'));var config=require(_0x156d('0x18'));var licenseUtil=require(_0x156d('0x19'));var db=require(_0x156d('0x1a'))['db'];function respondWithStatusCode(_0x4d5475,_0x58a63c){_0x58a63c=_0x58a63c||0xcc;return function(_0x19be61){if(_0x19be61){return _0x4d5475[_0x156d('0x1b')](_0x58a63c);}return _0x4d5475['status'](_0x58a63c)[_0x156d('0x1c')]();};}function respondWithResult(_0x368ba6,_0x4da2a8){_0x4da2a8=_0x4da2a8||0xc8;return function(_0xaafb10){if(_0xaafb10){return _0x368ba6[_0x156d('0x1d')](_0x4da2a8)[_0x156d('0x1e')](_0xaafb10);}};}function respondWithFilteredResult(_0x47e3ee,_0x365a19){return function(_0x40cc21){if(_0x40cc21){var _0x59e569=typeof _0x365a19[_0x156d('0x1f')]===_0x156d('0x20')&&typeof _0x365a19[_0x156d('0x21')]==='undefined';var _0x5a7390=_0x40cc21['count'];var _0x3cf6b5=_0x59e569?0x0:_0x365a19[_0x156d('0x1f')];var _0x54bab8=_0x59e569?_0x40cc21[_0x156d('0x22')]:_0x365a19['offset']+_0x365a19['limit'];var _0x3b4918;if(_0x54bab8>=_0x5a7390){_0x54bab8=_0x5a7390;_0x3b4918=0xc8;}else{_0x3b4918=0xce;}_0x47e3ee[_0x156d('0x1d')](_0x3b4918);return _0x47e3ee[_0x156d('0x23')](_0x156d('0x24'),_0x3cf6b5+'-'+_0x54bab8+'/'+_0x5a7390)[_0x156d('0x1e')](_0x40cc21);}return null;};}function patchUpdates(_0x11c0b8){return function(_0x2ec8de){try{jsonpatch[_0x156d('0x25')](_0x2ec8de,_0x11c0b8,!![]);}catch(_0x1eef87){return BPromise['reject'](_0x1eef87);}return _0x2ec8de[_0x156d('0x26')]();};}function saveUpdates(_0x36ca0f,_0x49d53d){return function(_0xc8954){if(_0xc8954){return _0xc8954[_0x156d('0x27')](_0x36ca0f)['then'](function(_0x4a1f52){return _0x4a1f52;});}return null;};}function removeEntity(_0x5d1e93,_0xb083b4){return function(_0x5635a4){if(_0x5635a4){return _0x5635a4[_0x156d('0x28')]()[_0x156d('0x29')](function(){_0x5d1e93[_0x156d('0x1d')](0xcc)[_0x156d('0x1c')]();});}};}function handleEntityNotFound(_0x89b9c3,_0x378c57){return function(_0x282f5b){if(!_0x282f5b){_0x89b9c3['sendStatus'](0x194);}return _0x282f5b;};}function handleError(_0x3fa09a,_0x2ffe34){_0x2ffe34=_0x2ffe34||0x1f4;return function(_0x30d962){logger[_0x156d('0x2a')](_0x30d962[_0x156d('0x2b')]);if(_0x30d962[_0x156d('0x2c')]){delete _0x30d962['name'];}_0x3fa09a[_0x156d('0x1d')](_0x2ffe34)[_0x156d('0x2d')](_0x30d962);};}exports[_0x156d('0x2e')]=function(_0x108841,_0x210391){var _0x536695={},_0x150fba={},_0x25fc2c={'count':0x0,'rows':[]};var _0x49aee5=_[_0x156d('0x2f')](db[_0x156d('0x30')][_0x156d('0x31')],function(_0x2112f3){return{'name':_0x2112f3[_0x156d('0x32')],'type':_0x2112f3['type'][_0x156d('0x33')]};});_0x150fba[_0x156d('0x34')]=_[_0x156d('0x35')](_['map'](_0x49aee5,_0x156d('0x2c')),[_0x156d('0x2c')]);_0x150fba['query']=_[_0x156d('0x36')](_0x108841[_0x156d('0x37')]);_0x150fba[_0x156d('0x38')]=_[_0x156d('0x39')](_0x150fba[_0x156d('0x34')],_0x150fba['query']);_0x536695['attributes']=_['intersection'](_0x150fba['model'],qs[_0x156d('0x3a')](_0x108841[_0x156d('0x37')][_0x156d('0x3a')]));_0x536695[_0x156d('0x3b')]=_0x536695[_0x156d('0x3b')][_0x156d('0x3c')]?_0x536695[_0x156d('0x3b')]:_0x150fba['model'];if(!_0x108841['query'][_0x156d('0x3d')](_0x156d('0x3e'))){_0x536695[_0x156d('0x21')]=qs[_0x156d('0x21')](_0x108841['query'][_0x156d('0x21')]);_0x536695[_0x156d('0x1f')]=qs[_0x156d('0x1f')](_0x108841[_0x156d('0x37')][_0x156d('0x1f')]);}_0x536695[_0x156d('0x3f')]=qs[_0x156d('0x40')](_0x108841[_0x156d('0x37')]['sort']);_0x536695['where']=qs[_0x156d('0x38')](_[_0x156d('0x41')](_0x108841[_0x156d('0x37')],_0x150fba[_0x156d('0x38')]),_0x49aee5);if(_0x108841[_0x156d('0x37')][_0x156d('0x42')]){_0x536695[_0x156d('0x43')]=_[_0x156d('0x44')](_0x536695[_0x156d('0x43')],{'$or':_[_0x156d('0x2f')](_0x49aee5,function(_0x46ff1f){if(_0x46ff1f[_0x156d('0x45')]!==_0x156d('0x46')){var _0x391aaa={};_0x391aaa[_0x46ff1f[_0x156d('0x2c')]]={'$like':'%'+_0x108841[_0x156d('0x37')]['filter']+'%'};return _0x391aaa;}})});}_0x536695=_['merge']({},_0x536695,_0x108841[_0x156d('0x47')]);var _0x23cfc4={'where':_0x536695[_0x156d('0x43')]};return db['CmCustomField'][_0x156d('0x22')](_0x23cfc4)[_0x156d('0x29')](function(_0x17ed92){_0x25fc2c[_0x156d('0x22')]=_0x17ed92;if(_0x108841['query']['includeAll']){_0x536695[_0x156d('0x48')]=[{'all':!![]}];}return db['CmCustomField'][_0x156d('0x49')](_0x536695);})[_0x156d('0x29')](function(_0xb63f22){_0x25fc2c[_0x156d('0x4a')]=_0xb63f22;return _0x25fc2c;})['then'](respondWithFilteredResult(_0x210391,_0x536695))[_0x156d('0x4b')](handleError(_0x210391,null));};exports[_0x156d('0x4c')]=function(_0x626689,_0x3caea8){var _0x293c62={'raw':!![],'where':{'id':_0x626689[_0x156d('0x4d')]['id']}},_0x16fef7={};_0x16fef7[_0x156d('0x34')]=_['keys'](db[_0x156d('0x30')][_0x156d('0x31')]);_0x16fef7[_0x156d('0x37')]=_[_0x156d('0x36')](_0x626689[_0x156d('0x37')]);_0x16fef7[_0x156d('0x38')]=_['intersection'](_0x16fef7['model'],_0x16fef7[_0x156d('0x37')]);_0x293c62[_0x156d('0x3b')]=_[_0x156d('0x39')](_0x16fef7[_0x156d('0x34')],qs[_0x156d('0x3a')](_0x626689['query'][_0x156d('0x3a')]));_0x293c62[_0x156d('0x3b')]=_0x293c62['attributes'][_0x156d('0x3c')]?_0x293c62[_0x156d('0x3b')]:_0x16fef7[_0x156d('0x34')];if(_0x626689[_0x156d('0x37')][_0x156d('0x4e')]){_0x293c62[_0x156d('0x48')]=[{'all':!![]}];}_0x293c62=_[_0x156d('0x44')]({},_0x293c62,_0x626689[_0x156d('0x47')]);return db['CmCustomField']['find'](_0x293c62)[_0x156d('0x29')](handleEntityNotFound(_0x3caea8,null))[_0x156d('0x29')](respondWithResult(_0x3caea8,null))[_0x156d('0x4b')](handleError(_0x3caea8,null));};exports['update']=function(_0x51da4a,_0x37cd76){if(_0x51da4a[_0x156d('0x4f')]['id']){delete _0x51da4a[_0x156d('0x4f')]['id'];}return db[_0x156d('0x30')][_0x156d('0x50')]({'where':{'id':_0x51da4a['params']['id']}})[_0x156d('0x29')](handleEntityNotFound(_0x37cd76,null))[_0x156d('0x29')](saveUpdates(_0x51da4a[_0x156d('0x4f')],null))[_0x156d('0x29')](respondWithResult(_0x37cd76,null))['catch'](handleError(_0x37cd76,null));};exports[_0x156d('0x28')]=function(_0x21099e,_0x3082ca){return db[_0x156d('0x30')][_0x156d('0x50')]({'where':{'id':_0x21099e[_0x156d('0x4d')]['id']}})[_0x156d('0x29')](handleEntityNotFound(_0x3082ca,null))[_0x156d('0x29')](removeEntity(_0x3082ca,null))[_0x156d('0x4b')](handleError(_0x3082ca,null));};exports[_0x156d('0x51')]=function(_0x10f571,_0x558f9a){var _0x4068c1;return db[_0x156d('0x52')]['transaction'](function(_0x152d33){return db[_0x156d('0x30')][_0x156d('0x51')](_0x10f571['body'],{'transaction':_0x152d33})[_0x156d('0x29')](function(_0xf2c155){_0x4068c1=_0xf2c155;var _0x13df99={'type':db['Sequelize'][_0x156d('0x53')],'transaction':_0x152d33};switch(_0x10f571[_0x156d('0x4f')][_0x156d('0x45')]){case'text':_0x13df99[_0x156d('0x45')]=db[_0x156d('0x54')][_0x156d('0x53')];break;case'number':_0x13df99['type']=db[_0x156d('0x54')][_0x156d('0x55')];break;case'switch':_0x13df99[_0x156d('0x45')]=db[_0x156d('0x54')][_0x156d('0x56')];_0x13df99[_0x156d('0x57')]=![];break;default:}return db[_0x156d('0x52')][_0x156d('0x58')][_0x156d('0x59')]('cm_contacts',util['format'](_0x156d('0x5a'),_0x4068c1['id']),_0x13df99);})[_0x156d('0x29')](function(){return _0x4068c1;});})[_0x156d('0x29')](respondWithResult(_0x558f9a,0xc9))['catch'](handleError(_0x558f9a,null));}; \ No newline at end of file +var _0x20c7=['sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','name','send','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','destroy','create','sequelize','Sequelize','TEXT','number','switch','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','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'];(function(_0x4ff0f9,_0x186026){var _0x544e03=function(_0x28f9d3){while(--_0x28f9d3){_0x4ff0f9['push'](_0x4ff0f9['shift']());}};_0x544e03(++_0x186026);}(_0x20c7,0x18a));var _0x720c=function(_0x1b90ac,_0x2810b8){_0x1b90ac=_0x1b90ac-0x0;var _0x3f9132=_0x20c7[_0x1b90ac];return _0x3f9132;};'use strict';var emlformat=require(_0x720c('0x0'));var rimraf=require(_0x720c('0x1'));var zipdir=require(_0x720c('0x2'));var jsonpatch=require(_0x720c('0x3'));var rp=require(_0x720c('0x4'));var moment=require('moment');var BPromise=require(_0x720c('0x5'));var Mustache=require('mustache');var util=require(_0x720c('0x6'));var path=require(_0x720c('0x7'));var sox=require('sox');var csv=require(_0x720c('0x8'));var ejs=require(_0x720c('0x9'));var fs=require('fs');var fs_extra=require(_0x720c('0xa'));var _=require(_0x720c('0xb'));var squel=require(_0x720c('0xc'));var crypto=require(_0x720c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x720c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x720c('0xf'));var Papa=require(_0x720c('0x10'));var Redis=require(_0x720c('0x11'));var authService=require(_0x720c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x720c('0x13'));var hardwareService=require(_0x720c('0x14'));var logger=require(_0x720c('0x15'))(_0x720c('0x16'));var utils=require(_0x720c('0x17'));var config=require(_0x720c('0x18'));var licenseUtil=require(_0x720c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c880b,_0x96e17c){_0x96e17c=_0x96e17c||0xcc;return function(_0x22660b){if(_0x22660b){return _0x5c880b[_0x720c('0x1a')](_0x96e17c);}return _0x5c880b[_0x720c('0x1b')](_0x96e17c)[_0x720c('0x1c')]();};}function respondWithResult(_0x2aeb00,_0x53a15d){_0x53a15d=_0x53a15d||0xc8;return function(_0x4372c1){if(_0x4372c1){return _0x2aeb00['status'](_0x53a15d)['json'](_0x4372c1);}};}function respondWithFilteredResult(_0x476aa6,_0x3e884d){return function(_0x2d74e0){if(_0x2d74e0){var _0x868004=typeof _0x3e884d[_0x720c('0x1d')]==='undefined'&&typeof _0x3e884d['limit']===_0x720c('0x1e');var _0x88db9e=_0x2d74e0[_0x720c('0x1f')];var _0x28734b=_0x868004?0x0:_0x3e884d['offset'];var _0x5c0175=_0x868004?_0x2d74e0[_0x720c('0x1f')]:_0x3e884d[_0x720c('0x1d')]+_0x3e884d[_0x720c('0x20')];var _0x597d2f;if(_0x5c0175>=_0x88db9e){_0x5c0175=_0x88db9e;_0x597d2f=0xc8;}else{_0x597d2f=0xce;}_0x476aa6[_0x720c('0x1b')](_0x597d2f);return _0x476aa6[_0x720c('0x21')](_0x720c('0x22'),_0x28734b+'-'+_0x5c0175+'/'+_0x88db9e)[_0x720c('0x23')](_0x2d74e0);}return null;};}function patchUpdates(_0x48948a){return function(_0x3ec436){try{jsonpatch[_0x720c('0x24')](_0x3ec436,_0x48948a,!![]);}catch(_0x3ab94a){return BPromise['reject'](_0x3ab94a);}return _0x3ec436[_0x720c('0x25')]();};}function saveUpdates(_0xca7476,_0x4c0061){return function(_0x30a7e3){if(_0x30a7e3){return _0x30a7e3[_0x720c('0x26')](_0xca7476)['then'](function(_0x2fba76){return _0x2fba76;});}return null;};}function removeEntity(_0x241766,_0x5569dd){return function(_0x674740){if(_0x674740){return _0x674740['destroy']()[_0x720c('0x27')](function(){_0x241766[_0x720c('0x1b')](0xcc)[_0x720c('0x1c')]();});}};}function handleEntityNotFound(_0x4b94f9,_0x41061c){return function(_0x122124){if(!_0x122124){_0x4b94f9[_0x720c('0x1a')](0x194);}return _0x122124;};}function handleError(_0x10ce18,_0x2f48ce){_0x2f48ce=_0x2f48ce||0x1f4;return function(_0x2fa7f2){logger['error'](_0x2fa7f2['stack']);if(_0x2fa7f2['name']){delete _0x2fa7f2[_0x720c('0x28')];}_0x10ce18[_0x720c('0x1b')](_0x2f48ce)[_0x720c('0x29')](_0x2fa7f2);};}exports['index']=function(_0x1c6e1b,_0x42d072){var _0x2f7b80={},_0x726af6={},_0x52a810={'count':0x0,'rows':[]};var _0x35868f=_[_0x720c('0x2a')](db[_0x720c('0x2b')][_0x720c('0x2c')],function(_0x55f162){return{'name':_0x55f162['fieldName'],'type':_0x55f162[_0x720c('0x2d')][_0x720c('0x2e')]};});_0x726af6[_0x720c('0x2f')]=_[_0x720c('0x30')](_[_0x720c('0x2a')](_0x35868f,_0x720c('0x28')),[_0x720c('0x28')]);_0x726af6[_0x720c('0x31')]=_[_0x720c('0x32')](_0x1c6e1b[_0x720c('0x31')]);_0x726af6[_0x720c('0x33')]=_[_0x720c('0x34')](_0x726af6[_0x720c('0x2f')],_0x726af6[_0x720c('0x31')]);_0x2f7b80[_0x720c('0x35')]=_['intersection'](_0x726af6[_0x720c('0x2f')],qs['fields'](_0x1c6e1b[_0x720c('0x31')][_0x720c('0x36')]));_0x2f7b80[_0x720c('0x35')]=_0x2f7b80[_0x720c('0x35')][_0x720c('0x37')]?_0x2f7b80[_0x720c('0x35')]:_0x726af6[_0x720c('0x2f')];if(!_0x1c6e1b[_0x720c('0x31')][_0x720c('0x38')](_0x720c('0x39'))){_0x2f7b80['limit']=qs[_0x720c('0x20')](_0x1c6e1b[_0x720c('0x31')][_0x720c('0x20')]);_0x2f7b80[_0x720c('0x1d')]=qs['offset'](_0x1c6e1b['query'][_0x720c('0x1d')]);}_0x2f7b80[_0x720c('0x3a')]=qs[_0x720c('0x3b')](_0x1c6e1b[_0x720c('0x31')]['sort']);_0x2f7b80[_0x720c('0x3c')]=qs[_0x720c('0x33')](_[_0x720c('0x3d')](_0x1c6e1b[_0x720c('0x31')],_0x726af6[_0x720c('0x33')]),_0x35868f);if(_0x1c6e1b[_0x720c('0x31')][_0x720c('0x3e')]){_0x2f7b80[_0x720c('0x3c')]=_[_0x720c('0x3f')](_0x2f7b80['where'],{'$or':_['map'](_0x35868f,function(_0x55d5ad){if(_0x55d5ad['type']!=='VIRTUAL'){var _0x2ca517={};_0x2ca517[_0x55d5ad['name']]={'$like':'%'+_0x1c6e1b[_0x720c('0x31')][_0x720c('0x3e')]+'%'};return _0x2ca517;}})});}_0x2f7b80=_[_0x720c('0x3f')]({},_0x2f7b80,_0x1c6e1b[_0x720c('0x40')]);var _0x544da8={'where':_0x2f7b80[_0x720c('0x3c')]};return db[_0x720c('0x2b')][_0x720c('0x1f')](_0x544da8)[_0x720c('0x27')](function(_0x37edfb){_0x52a810[_0x720c('0x1f')]=_0x37edfb;if(_0x1c6e1b[_0x720c('0x31')]['includeAll']){_0x2f7b80[_0x720c('0x41')]=[{'all':!![]}];}return db[_0x720c('0x2b')][_0x720c('0x42')](_0x2f7b80);})[_0x720c('0x27')](function(_0x5c431c){_0x52a810[_0x720c('0x43')]=_0x5c431c;return _0x52a810;})[_0x720c('0x27')](respondWithFilteredResult(_0x42d072,_0x2f7b80))[_0x720c('0x44')](handleError(_0x42d072,null));};exports[_0x720c('0x45')]=function(_0x1acbbd,_0x4559a9){var _0x3d343f={'raw':!![],'where':{'id':_0x1acbbd[_0x720c('0x46')]['id']}},_0x57221a={};_0x57221a[_0x720c('0x2f')]=_[_0x720c('0x32')](db[_0x720c('0x2b')][_0x720c('0x2c')]);_0x57221a[_0x720c('0x31')]=_[_0x720c('0x32')](_0x1acbbd[_0x720c('0x31')]);_0x57221a[_0x720c('0x33')]=_[_0x720c('0x34')](_0x57221a['model'],_0x57221a['query']);_0x3d343f['attributes']=_[_0x720c('0x34')](_0x57221a[_0x720c('0x2f')],qs['fields'](_0x1acbbd[_0x720c('0x31')][_0x720c('0x36')]));_0x3d343f['attributes']=_0x3d343f['attributes'][_0x720c('0x37')]?_0x3d343f[_0x720c('0x35')]:_0x57221a[_0x720c('0x2f')];if(_0x1acbbd[_0x720c('0x31')][_0x720c('0x47')]){_0x3d343f[_0x720c('0x41')]=[{'all':!![]}];}_0x3d343f=_[_0x720c('0x3f')]({},_0x3d343f,_0x1acbbd[_0x720c('0x40')]);return db['CmCustomField'][_0x720c('0x48')](_0x3d343f)[_0x720c('0x27')](handleEntityNotFound(_0x4559a9,null))[_0x720c('0x27')](respondWithResult(_0x4559a9,null))[_0x720c('0x44')](handleError(_0x4559a9,null));};exports['update']=function(_0x4c0426,_0x5bf13f){if(_0x4c0426[_0x720c('0x49')]['id']){delete _0x4c0426[_0x720c('0x49')]['id'];}return db[_0x720c('0x2b')][_0x720c('0x48')]({'where':{'id':_0x4c0426[_0x720c('0x46')]['id']}})[_0x720c('0x27')](handleEntityNotFound(_0x5bf13f,null))['then'](saveUpdates(_0x4c0426[_0x720c('0x49')],null))[_0x720c('0x27')](respondWithResult(_0x5bf13f,null))[_0x720c('0x44')](handleError(_0x5bf13f,null));};exports[_0x720c('0x4a')]=function(_0x1471a5,_0x34bbdc){return db[_0x720c('0x2b')][_0x720c('0x48')]({'where':{'id':_0x1471a5[_0x720c('0x46')]['id']}})[_0x720c('0x27')](handleEntityNotFound(_0x34bbdc,null))[_0x720c('0x27')](removeEntity(_0x34bbdc,null))[_0x720c('0x44')](handleError(_0x34bbdc,null));};exports[_0x720c('0x4b')]=function(_0x3a66e4,_0x2403ef){var _0x3ce1cd;return db[_0x720c('0x4c')]['transaction'](function(_0xfa334e){return db['CmCustomField'][_0x720c('0x4b')](_0x3a66e4[_0x720c('0x49')],{'transaction':_0xfa334e})[_0x720c('0x27')](function(_0x28dfa7){_0x3ce1cd=_0x28dfa7;var _0x2a06bf={'type':db[_0x720c('0x4d')][_0x720c('0x4e')],'transaction':_0xfa334e};switch(_0x3a66e4[_0x720c('0x49')][_0x720c('0x2d')]){case'text':_0x2a06bf[_0x720c('0x2d')]=db[_0x720c('0x4d')][_0x720c('0x4e')];break;case _0x720c('0x4f'):_0x2a06bf[_0x720c('0x2d')]=db['Sequelize']['INTEGER'];break;case _0x720c('0x50'):_0x2a06bf[_0x720c('0x2d')]=db[_0x720c('0x4d')]['BOOLEAN'];_0x2a06bf['defaultValue']=![];break;default:}return db[_0x720c('0x4c')][_0x720c('0x51')][_0x720c('0x52')](_0x720c('0x53'),util['format']('cf_%d',_0x3ce1cd['id']),_0x2a06bf);})[_0x720c('0x27')](function(){return _0x3ce1cd;});})['then'](respondWithResult(_0x2403ef,0xc9))['catch'](handleError(_0x2403ef,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a7a52f2..677e865 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 _0x399f=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0x399f,0x1e5));var _0xf399=function(_0x2b0d29,_0x3e3d2d){_0x2b0d29=_0x2b0d29-0x0;var _0x54b7ce=_0x399f[_0x2b0d29];return _0x54b7ce;};'use strict';var _=require(_0xf399('0x0'));var util=require(_0xf399('0x1'));var logger=require(_0xf399('0x2'))(_0xf399('0x3'));var moment=require(_0xf399('0x4'));var BPromise=require(_0xf399('0x5'));var rp=require(_0xf399('0x6'));var fs=require('fs');var path=require(_0xf399('0x7'));var rimraf=require(_0xf399('0x8'));var config=require(_0xf399('0x9'));var attributes=require(_0xf399('0xa'));module[_0xf399('0xb')]=function(_0x5743ef,_0x43e454){return _0x5743ef['define'](_0xf399('0xc'),attributes,{'tableName':_0xf399('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9527=['rimraf','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9527,0x1a9));var _0x7952=function(_0x5d4563,_0xec92c4){_0x5d4563=_0x5d4563-0x0;var _0x5e6c3=_0x9527[_0x5d4563];return _0x5e6c3;};'use strict';var _=require(_0x7952('0x0'));var util=require('util');var logger=require(_0x7952('0x1'))(_0x7952('0x2'));var moment=require(_0x7952('0x3'));var BPromise=require(_0x7952('0x4'));var rp=require(_0x7952('0x5'));var fs=require('fs');var path=require(_0x7952('0x6'));var rimraf=require(_0x7952('0x7'));var config=require('../../config/environment');var attributes=require(_0x7952('0x8'));module[_0x7952('0x9')]=function(_0x27d75b,_0x42f06b){return _0x27d75b['define'](_0x7952('0xa'),attributes,{'tableName':_0x7952('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 28a92f0..e06e6d6 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 _0xea5e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xea5e,0x1f0));var _0xeea5=function(_0x5bcdcb,_0x2cb82b){_0x5bcdcb=_0x5bcdcb-0x0;var _0x2fe7df=_0xea5e[_0x5bcdcb];return _0x2fe7df;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xeea5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeea5('0x1'));var db=require(_0xeea5('0x2'))['db'];var utils=require(_0xeea5('0x3'));var logger=require(_0xeea5('0x4'))(_0xeea5('0x5'));var config=require(_0xeea5('0x6'));var jayson=require(_0xeea5('0x7'));var client=jayson['client'][_0xeea5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24b437,_0xe95f54,_0x506f3e){return new BPromise(function(_0x58c680,_0x34fbe8){return client[_0xeea5('0x9')](_0x24b437,_0x506f3e)[_0xeea5('0xa')](function(_0x4fa816){logger[_0xeea5('0xb')](_0xeea5('0xc'),_0xe95f54,_0xeea5('0xd'));logger[_0xeea5('0xe')](_0xeea5('0xf'),_0xe95f54,_0xeea5('0xd'),JSON[_0xeea5('0x10')](_0x4fa816));if(_0x4fa816[_0xeea5('0x11')]){if(_0x4fa816[_0xeea5('0x11')]['code']===0x1f4){logger['error'](_0xeea5('0xc'),_0xe95f54,_0x4fa816[_0xeea5('0x11')][_0xeea5('0x12')]);return _0x34fbe8(_0x4fa816[_0xeea5('0x11')]['message']);}logger['error'](_0xeea5('0xc'),_0xe95f54,_0x4fa816[_0xeea5('0x11')][_0xeea5('0x12')]);return _0x58c680(_0x4fa816[_0xeea5('0x11')]['message']);}else{logger[_0xeea5('0xb')]('CmCustomField,\x20%s,\x20%s',_0xe95f54,_0xeea5('0xd'));_0x58c680(_0x4fa816[_0xeea5('0x13')][_0xeea5('0x12')]);}})['catch'](function(_0x2974fa){logger['error']('CmCustomField,\x20%s,\x20%s',_0xe95f54,_0x2974fa);_0x34fbe8(_0x2974fa);});});} \ No newline at end of file +var _0x6339=['jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6339,0x81));var _0x9633=function(_0x451bf6,_0xdd878b){_0x451bf6=_0x451bf6-0x0;var _0x34b251=_0x6339[_0x451bf6];return _0x34b251;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9633('0x0'));var BPromise=require(_0x9633('0x1'));var rs=require(_0x9633('0x2'));var fs=require('fs');var Redis=require(_0x9633('0x3'));var db=require(_0x9633('0x4'))['db'];var utils=require(_0x9633('0x5'));var logger=require(_0x9633('0x6'))(_0x9633('0x7'));var config=require(_0x9633('0x8'));var jayson=require(_0x9633('0x9'));var client=jayson[_0x9633('0xa')][_0x9633('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6ed6,_0x4134a0,_0x4bb925){return new BPromise(function(_0x488e01,_0x3cbe0a){return client[_0x9633('0xc')](_0x4a6ed6,_0x4bb925)['then'](function(_0x13c309){logger[_0x9633('0xd')](_0x9633('0xe'),_0x4134a0,_0x9633('0xf'));logger[_0x9633('0x10')](_0x9633('0x11'),_0x4134a0,_0x9633('0xf'),JSON[_0x9633('0x12')](_0x13c309));if(_0x13c309[_0x9633('0x13')]){if(_0x13c309[_0x9633('0x13')][_0x9633('0x14')]===0x1f4){logger['error'](_0x9633('0xe'),_0x4134a0,_0x13c309[_0x9633('0x13')][_0x9633('0x15')]);return _0x3cbe0a(_0x13c309[_0x9633('0x13')][_0x9633('0x15')]);}logger[_0x9633('0x13')](_0x9633('0xe'),_0x4134a0,_0x13c309['error'][_0x9633('0x15')]);return _0x488e01(_0x13c309[_0x9633('0x13')][_0x9633('0x15')]);}else{logger[_0x9633('0xd')](_0x9633('0xe'),_0x4134a0,_0x9633('0xf'));_0x488e01(_0x13c309['result'][_0x9633('0x15')]);}})[_0x9633('0x16')](function(_0x3ef793){logger[_0x9633('0x13')](_0x9633('0xe'),_0x4134a0,_0x3ef793);_0x3cbe0a(_0x3ef793);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3e2e001..a62a046 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 _0x0ec6=['put','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create'];(function(_0x382ef9,_0xcb6efe){var _0x5121fc=function(_0x1a2faf){while(--_0x1a2faf){_0x382ef9['push'](_0x382ef9['shift']());}};_0x5121fc(++_0xcb6efe);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x40039d,_0xb74f0){_0x40039d=_0x40039d-0x0;var _0x59ccb7=_0x0ec6[_0x40039d];return _0x59ccb7;};'use strict';var multer=require(_0x60ec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x60ec('0x1'));var express=require(_0x60ec('0x2'));var router=express[_0x60ec('0x3')]();var fs_extra=require(_0x60ec('0x4'));var auth=require(_0x60ec('0x5'));var interaction=require(_0x60ec('0x6'));var config=require(_0x60ec('0x7'));var controller=require('./cmCustomField.controller');router[_0x60ec('0x8')]('/',auth[_0x60ec('0x9')](),controller[_0x60ec('0xa')]);router[_0x60ec('0x8')]('/:id',auth[_0x60ec('0x9')](),controller['show']);router[_0x60ec('0xb')]('/',auth[_0x60ec('0x9')](),controller[_0x60ec('0xc')]);router[_0x60ec('0xd')](_0x60ec('0xe'),auth[_0x60ec('0x9')](),controller['update']);router['delete'](_0x60ec('0xe'),auth[_0x60ec('0x9')](),controller[_0x60ec('0xf')]);module[_0x60ec('0x10')]=router; \ No newline at end of file +var _0x04f1=['get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','index'];(function(_0x4f14bd,_0x28b9db){var _0x515b8b=function(_0x523703){while(--_0x523703){_0x4f14bd['push'](_0x4f14bd['shift']());}};_0x515b8b(++_0x28b9db);}(_0x04f1,0x92));var _0x104f=function(_0x289ce3,_0x7b336){_0x289ce3=_0x289ce3-0x0;var _0x3c3f56=_0x04f1[_0x289ce3];return _0x3c3f56;};'use strict';var multer=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var path=require(_0x104f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x104f('0x3')]();var fs_extra=require(_0x104f('0x4'));var auth=require(_0x104f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x104f('0x6')]);router[_0x104f('0x7')](_0x104f('0x8'),auth[_0x104f('0x9')](),controller['show']);router[_0x104f('0xa')]('/',auth[_0x104f('0x9')](),controller[_0x104f('0xb')]);router[_0x104f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x104f('0xd')]);router[_0x104f('0xe')](_0x104f('0x8'),auth[_0x104f('0x9')](),controller[_0x104f('0xf')]);module[_0x104f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 0605100..3ebdd78 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 _0x24e1=['UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING'];(function(_0x43f692,_0x3a06d2){var _0x365fd9=function(_0x10c6dc){while(--_0x10c6dc){_0x43f692['push'](_0x43f692['shift']());}};_0x365fd9(++_0x3a06d2);}(_0x24e1,0x136));var _0x124e=function(_0x448431,_0x5256d6){_0x448431=_0x448431-0x0;var _0x37f204=_0x24e1[_0x448431];return _0x37f204;};'use strict';var moment=require(_0x124e('0x0'));var Sequelize=require(_0x124e('0x1'));module[_0x124e('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x124e('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x124e('0x4')],'defaultValue':moment()[_0x124e('0x5')](_0x124e('0x6'))},'countbusyretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x124e('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x124e('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x124e('0x4')]},'priority':{'type':Sequelize[_0x124e('0x7')](0x2)[_0x124e('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x124e('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x124e('0x7')],'unique':_0x124e('0xa')},'ListId':{'type':Sequelize[_0x124e('0x7')],'unique':_0x124e('0xa')},'UserId':{'type':Sequelize[_0x124e('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x124e('0x7')],'unique':_0x124e('0xa')},'CampaignId':{'type':Sequelize[_0x124e('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x124e('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x124e('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x124e('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0x124e('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x15a1=['contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x15a1,0x160));var _0x115a=function(_0x55def0,_0x40878f){_0x55def0=_0x55def0-0x0;var _0xf6a4a8=_0x15a1[_0x55def0];return _0xf6a4a8;};'use strict';var moment=require(_0x115a('0x0'));var Sequelize=require('sequelize');module[_0x115a('0x1')]={'phone':{'type':Sequelize[_0x115a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x115a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x115a('0x4')],'defaultValue':moment()[_0x115a('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x115a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x115a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x115a('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x115a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x115a('0x6')],'unique':_0x115a('0x8')},'ListId':{'type':Sequelize[_0x115a('0x6')],'unique':_0x115a('0x8')},'UserId':{'type':Sequelize[_0x115a('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x115a('0x8')},'CampaignId':{'type':Sequelize[_0x115a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x115a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x115a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x115a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x115a('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x115a('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x115a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 76d1003..71d2399 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 _0xafdd=['status','json','undefined','limit','count','offset','set','Content-Range','update','then','sendStatus','error','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','concat','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','length','options','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','firstName','lastName','isNil','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','prev','hopperIds','priority','ASC','scheduledAt','literal','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','Company','List','Queue','dialActive','getPreviewRecall','UPDATE','CmCompany','CmList','getOpenContacts','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x59df7f,_0x3deaea){var _0x5977c3=function(_0x86a68e){while(--_0x86a68e){_0x59df7f['push'](_0x59df7f['shift']());}};_0x5977c3(++_0x3deaea);}(_0xafdd,0x19a));var _0xdafd=function(_0x3e2dfc,_0x5454c0){_0x3e2dfc=_0x3e2dfc-0x0;var _0x733b21=_0xafdd[_0x3e2dfc];return _0x733b21;};'use strict';var moment=require(_0xdafd('0x0'));var _=require(_0xdafd('0x1'));var qs=require(_0xdafd('0x2'));var logger=require(_0xdafd('0x3'))(_0xdafd('0x4'));var shared=require(_0xdafd('0x5'));var db=require(_0xdafd('0x6'))['db'];function respondWithResult(_0x2b0752,_0x5624f6){_0x5624f6=_0x5624f6||0xc8;return function(_0x283ab1){if(_0x283ab1){return _0x2b0752[_0xdafd('0x7')](_0x5624f6)[_0xdafd('0x8')](_0x283ab1);}};}function respondWithFilteredResult(_0x37f05a,_0xfa4ad6){return function(_0x57cfee){if(_0x57cfee){var _0x2ed8ea=typeof _0xfa4ad6['offset']===_0xdafd('0x9')&&typeof _0xfa4ad6[_0xdafd('0xa')]===_0xdafd('0x9');var _0x48000b=_0x57cfee[_0xdafd('0xb')];var _0x413d23=_0x2ed8ea?0x0:_0xfa4ad6[_0xdafd('0xc')];var _0x2f3bb3=_0x2ed8ea?_0x57cfee['count']:_0xfa4ad6[_0xdafd('0xc')]+_0xfa4ad6[_0xdafd('0xa')];var _0x3ee1e9;if(_0x2f3bb3>=_0x48000b){_0x2f3bb3=_0x48000b;_0x3ee1e9=0xc8;}else{_0x3ee1e9=0xce;}_0x37f05a[_0xdafd('0x7')](_0x3ee1e9);return _0x37f05a[_0xdafd('0xd')](_0xdafd('0xe'),_0x413d23+'-'+_0x2f3bb3+'/'+_0x48000b)['json'](_0x57cfee);}return null;};}function saveUpdates(_0x166176,_0x594f47){return function(_0x553508){if(_0x553508){return _0x553508[_0xdafd('0xf')](_0x166176)[_0xdafd('0x10')](function(_0x55b05a){return _0x55b05a;});}return null;};}function handleEntityNotFound(_0x43a716,_0x490382){return function(_0x4b09da){if(!_0x4b09da){_0x43a716[_0xdafd('0x11')](0x194);}return _0x4b09da;};}function handleError(_0x14b895,_0x583b1d){_0x583b1d=_0x583b1d||0x1f4;return function(_0x267bfc){logger[_0xdafd('0x12')](_0x267bfc['stack']);if(_0x267bfc[_0xdafd('0x13')]){delete _0x267bfc[_0xdafd('0x13')];}_0x14b895[_0xdafd('0x7')](_0x583b1d)['send'](_0x267bfc);};}exports[_0xdafd('0x14')]=function(_0x15beca,_0x4fc3a4){var _0x4e6ccc={},_0x2569b2={},_0x5acc78={'count':0x0,'rows':[]};var _0x3556da=_[_0xdafd('0x15')](db[_0xdafd('0x16')][_0xdafd('0x17')],function(_0x1c2029){return{'name':_0x1c2029[_0xdafd('0x18')],'type':_0x1c2029[_0xdafd('0x19')][_0xdafd('0x1a')]};});_0x2569b2[_0xdafd('0x1b')]=_[_0xdafd('0x15')](_0x3556da,_0xdafd('0x13'));_0x2569b2[_0xdafd('0x1c')]=_[_0xdafd('0x1d')](_0x15beca[_0xdafd('0x1c')]);_0x2569b2['filters']=_[_0xdafd('0x1e')](_0x2569b2['model'],_0x2569b2[_0xdafd('0x1c')]);_0x2569b2['filters']=_[_0xdafd('0x1f')](_0x2569b2[_0xdafd('0x20')],[_0xdafd('0x21'),_0xdafd('0x22'),_0xdafd('0x23'),_0xdafd('0x24'),_0xdafd('0x25'),_0xdafd('0x26'),_0xdafd('0x27'),'$eq',_0xdafd('0x28'),_0xdafd('0x29'),_0xdafd('0x2a'),_0xdafd('0x2b'),_0xdafd('0x2c'),_0xdafd('0x2d'),_0xdafd('0x2e'),_0xdafd('0x2f'),_0xdafd('0x30'),_0xdafd('0x2d'),'$overlap',_0xdafd('0x31'),_0xdafd('0x32'),_0xdafd('0x33')]);_0x4e6ccc[_0xdafd('0x34')]=_[_0xdafd('0x1e')](_0x2569b2[_0xdafd('0x1b')],qs['fields'](_0x15beca['query']['fields']));_0x4e6ccc[_0xdafd('0x34')]=_0x4e6ccc[_0xdafd('0x34')]['length']?_0x4e6ccc['attributes']:_0x2569b2[_0xdafd('0x1b')];if(!_0x15beca[_0xdafd('0x1c')][_0xdafd('0x35')](_0xdafd('0x36'))){_0x4e6ccc[_0xdafd('0xa')]=qs[_0xdafd('0xa')](_0x15beca[_0xdafd('0x1c')]['limit']);_0x4e6ccc[_0xdafd('0xc')]=qs[_0xdafd('0xc')](_0x15beca[_0xdafd('0x1c')]['offset']);}_0x4e6ccc[_0xdafd('0x37')]=qs[_0xdafd('0x38')](_0x15beca['query'][_0xdafd('0x38')]);_0x4e6ccc[_0xdafd('0x39')]=qs[_0xdafd('0x20')](_['pick'](_0x15beca[_0xdafd('0x1c')],_0x2569b2[_0xdafd('0x20')]),_0x3556da);if(_0x15beca[_0xdafd('0x1c')][_0xdafd('0x3a')]){_0x4e6ccc[_0xdafd('0x39')]=_[_0xdafd('0x3b')](_0x4e6ccc[_0xdafd('0x39')],{'$or':_['map'](_0x3556da,function(_0x3d904a){if(_0x3d904a[_0xdafd('0x19')]!==_0xdafd('0x3c')){var _0x161d15={};_0x161d15[_0x3d904a[_0xdafd('0x13')]]={'$like':'%'+_0x15beca['query'][_0xdafd('0x3a')]+'%'};return _0x161d15;}})});}_0x4e6ccc=_[_0xdafd('0x3b')]({},_0x4e6ccc,_0x15beca['options']);var _0x3dbdb1={'where':_0x4e6ccc[_0xdafd('0x39')]};return db[_0xdafd('0x16')][_0xdafd('0xb')](_0x3dbdb1)[_0xdafd('0x10')](function(_0x1611f0){_0x5acc78[_0xdafd('0xb')]=_0x1611f0;if(_0x15beca[_0xdafd('0x1c')][_0xdafd('0x3d')]){_0x4e6ccc[_0xdafd('0x3e')]=[{'all':!![]}];}return db[_0xdafd('0x16')][_0xdafd('0x3f')](_0x4e6ccc);})[_0xdafd('0x10')](function(_0x3c446d){_0x5acc78[_0xdafd('0x40')]=_0x3c446d;return _0x5acc78;})[_0xdafd('0x10')](respondWithFilteredResult(_0x4fc3a4,_0x4e6ccc))[_0xdafd('0x41')](handleError(_0x4fc3a4,null));};exports[_0xdafd('0x42')]=function(_0x31dd01,_0x1d4be4){var _0x3f25c2={'raw':!![],'where':{'id':_0x31dd01[_0xdafd('0x43')]['id']}},_0x2605d2={};_0x2605d2[_0xdafd('0x1b')]=_[_0xdafd('0x1d')](db[_0xdafd('0x16')]['rawAttributes']);_0x2605d2['query']=_[_0xdafd('0x1d')](_0x31dd01['query']);_0x2605d2[_0xdafd('0x20')]=_[_0xdafd('0x1e')](_0x2605d2['model'],_0x2605d2['query']);_0x3f25c2[_0xdafd('0x34')]=_[_0xdafd('0x1e')](_0x2605d2[_0xdafd('0x1b')],qs[_0xdafd('0x44')](_0x31dd01[_0xdafd('0x1c')][_0xdafd('0x44')]));_0x3f25c2[_0xdafd('0x34')]=_0x3f25c2[_0xdafd('0x34')][_0xdafd('0x45')]?_0x3f25c2['attributes']:_0x2605d2['model'];if(_0x31dd01[_0xdafd('0x1c')][_0xdafd('0x3d')]){_0x3f25c2[_0xdafd('0x3e')]=[{'all':!![]}];}_0x3f25c2=_[_0xdafd('0x3b')]({},_0x3f25c2,_0x31dd01[_0xdafd('0x46')]);return db[_0xdafd('0x16')][_0xdafd('0x47')](_0x3f25c2)[_0xdafd('0x10')](handleEntityNotFound(_0x1d4be4,null))[_0xdafd('0x10')](respondWithResult(_0x1d4be4,null))[_0xdafd('0x41')](handleError(_0x1d4be4,null));};exports[_0xdafd('0x48')]=function(_0x3a9505,_0x2dee16){return db['CmHopper'][_0xdafd('0x48')](_0x3a9505['body'],{})[_0xdafd('0x10')](respondWithResult(_0x2dee16,0xc9))['catch'](handleError(_0x2dee16,null));};exports[_0xdafd('0xf')]=function(_0x4240b1,_0x4464f2){if(_0x4240b1[_0xdafd('0x49')]['id']){delete _0x4240b1[_0xdafd('0x49')]['id'];}return db[_0xdafd('0x16')]['find']({'where':{'id':_0x4240b1[_0xdafd('0x43')]['id']}})[_0xdafd('0x10')](handleEntityNotFound(_0x4464f2,null))[_0xdafd('0x10')](saveUpdates(_0x4240b1[_0xdafd('0x49')],null))[_0xdafd('0x10')](respondWithResult(_0x4464f2,null))['catch'](handleError(_0x4464f2,null));};exports['describe']=function(_0x189d61,_0x44b71a){return db[_0xdafd('0x16')][_0xdafd('0x4a')]()[_0xdafd('0x10')](respondWithResult(_0x44b71a,null))[_0xdafd('0x41')](handleError(_0x44b71a,null));};exports[_0xdafd('0x4b')]=function(_0x2f5e4c,_0x2ae4cd){var _0x5058b1;var _0x6f2f39=_0x2f5e4c[_0xdafd('0x43')]['id'];return db[_0xdafd('0x16')][_0xdafd('0x47')]({'where':{'id':_0x2f5e4c['params']['id']}})[_0xdafd('0x10')](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x10')](function(_0x254824){if(_0x254824){return _0x254824[_0xdafd('0x4b')]()[_0xdafd('0x10')](function(_0x4b6fbb){return _0x4b6fbb;});}})['then'](function(_0xc1dadb){_0x5058b1=_0xc1dadb;if(_0xc1dadb){if(_0xc1dadb[_0xdafd('0x4c')]||_0xc1dadb['CampaignId']){return db[_0xc1dadb['VoiceQueueId']?_0xdafd('0x4d'):_0xdafd('0x4e')]['find']({'where':{'id':_0xc1dadb[_0xdafd('0x4c')]?_0xc1dadb[_0xdafd('0x4c')]:_0xc1dadb[_0xdafd('0x4f')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x2feff8){var _0x38662d={};if(_0x2feff8){_['merge'](_0x38662d,_[_0xdafd('0x50')](_0x5058b1['dataValues'],['createdAt',_0xdafd('0x51'),'id']));_0x38662d[_0xdafd('0x52')]=0x15;_0x38662d[_0xdafd('0x53')]=_0xdafd('0x54');_0x38662d[_0xdafd('0x55')]=_0x2feff8[_0xdafd('0x13')];_0x38662d[_0xdafd('0x56')]=_0x2f5e4c[_0xdafd('0x57')]['name'];_0x38662d[_0xdafd('0x58')]=_0x2f5e4c[_0xdafd('0x57')]['id'];_0x38662d['deleted']=!![];_0x38662d[_0xdafd('0x59')]=moment()[_0xdafd('0x5a')](_0xdafd('0x5b'));_0x38662d[_0xdafd('0x5c')]=_0x5058b1[_0xdafd('0x5d')];_0x38662d['campaigntype']=_0x5058b1[_0xdafd('0x4c')]?_0xdafd('0x5e'):_0xdafd('0x5f');return db[_0xdafd('0x60')][_0xdafd('0x47')]({'where':{'id':_0x38662d['ContactId']},'attributes':[_0xdafd('0x61'),_0xdafd('0x62')]})['then'](function(_0x4f3059){if(!_[_0xdafd('0x63')](_0x2ae4cd)&&!_['isNil'](_0x4f3059[_0xdafd('0x61')])){_0x38662d['calleridname']=_0x4f3059[_0xdafd('0x61')];if(!_[_0xdafd('0x63')](_0x4f3059[_0xdafd('0x62')])){_0x38662d['calleridname']+='\x20'+_0x4f3059[_0xdafd('0x62')];}}})['finally'](function(){return db[_0xdafd('0x64')][_0xdafd('0x48')](_0x38662d);});}})['then'](function(_0xd9231){return db[_0xdafd('0x65')][_0xdafd('0x4b')]({'where':{'CmHopperId':_0x6f2f39}});})[_0xdafd('0x10')](function(){return _0x2ae4cd[_0xdafd('0x7')](0xcc)['end']();})[_0xdafd('0x41')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x66')]=function(_0x4e1714,_0x316699){var _0x46b3fb=[];return db[_0xdafd('0x60')][_0xdafd('0x4a')]()[_0xdafd('0x10')](function(_0x4d0667){_0x46b3fb=_[_0xdafd('0x1d')](_0x4d0667);return _0x4e1714['user']['getVoiceQueues']({'where':{'type':_0xdafd('0x67'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xdafd('0x68'),_0xdafd('0x69')],'raw':!![]});})[_0xdafd('0x10')](function(_0x46564e){if(_0x46564e&&_0x46564e['length']){return db[_0xdafd('0x6a')][_0xdafd('0x6b')](function(_0x3f080b){var _0x4049f8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xdafd('0x5a')](_0xdafd('0x5b'))},'VoiceQueueId':{'$in':_[_0xdafd('0x15')](_0x46564e,'id')},'$or':[{'UserId':null},{'UserId':_0x4e1714[_0xdafd('0x57')]['id']}]};var _0x3a6bc1={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x46564e)[_0xdafd('0x3a')]([_0xdafd('0x69'),0x0])[_0xdafd('0x15')]('id')[_0xdafd('0x6c')]()},'$or':[{'UserId':null},{'UserId':_0x4e1714[_0xdafd('0x57')]['id']}]};var _0x40f9fa={'$or':[_0x4049f8,_0x3a6bc1]};var _0x339c9e=[];if(_0x4e1714[_0xdafd('0x49')]['direction']&&_0x4e1714[_0xdafd('0x49')]['direction']===_0xdafd('0x6d')){if(!_['isEmpty'](_0x4e1714[_0xdafd('0x49')][_0xdafd('0x6e')])){_0x40f9fa['id']={'$in':_0x4e1714['body']['hopperIds']};}_0x339c9e=[[_0xdafd('0x6f'),_0xdafd('0x70')],[_0xdafd('0x71'),_0x46564e[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':_0xdafd('0x70')],db['sequelize'][_0xdafd('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xdafd('0x73')]];}else{if(!_[_0xdafd('0x74')](_0x4e1714[_0xdafd('0x49')][_0xdafd('0x6e')])){_0x40f9fa['id']={'$notIn':_0x4e1714[_0xdafd('0x49')]['hopperIds']};}_0x339c9e=[['priority',_0xdafd('0x73')],['scheduledAt',_0x46564e[0x0][_0xdafd('0x68')]],db[_0xdafd('0x6a')]['literal'](_0xdafd('0x75')),['id',_0xdafd('0x70')]];}return db[_0xdafd('0x16')][_0xdafd('0x76')]({'attributes':['id',_0xdafd('0x77'),_0xdafd('0x5d'),_0xdafd('0x78')],'where':_0x40f9fa,'order':_0x339c9e,'transaction':_0x3f080b,'lock':_0x3f080b[_0xdafd('0x79')]['UPDATE'],'include':[{'model':db[_0xdafd('0x60')],'as':_0xdafd('0x7a'),'attributes':_0x46b3fb,'include':[{'model':db['CmCompany'],'as':_0xdafd('0x7b'),'attributes':['id',_0xdafd('0x13')]}]},{'model':db['CmList'],'as':_0xdafd('0x7c'),'attributes':['id',_0xdafd('0x13')]},{'model':db['VoiceQueue'],'as':_0xdafd('0x7d'),'attributes':['id',_0xdafd('0x13'),_0xdafd('0x7e')]}]})['then'](function(_0x1a0f40){if(_0x1a0f40){return _0x1a0f40[_0xdafd('0xf')]({'UserId':_0x4e1714[_0xdafd('0x57')]['id']},{'transaction':_0x3f080b});}});});}})[_0xdafd('0x10')](handleEntityNotFound(_0x316699,null))['then'](respondWithResult(_0x316699,null))['catch'](handleError(_0x316699,null));};exports[_0xdafd('0x7f')]=function(_0x1acd79,_0x5e1bef,_0x3bbf21){var _0x3d3862=[];var _0x6f3fec=_0x1acd79[_0xdafd('0x43')]['id'];var _0x221377=_0x1acd79[_0xdafd('0x57')]['id'];return db['CmContact'][_0xdafd('0x4a')]()[_0xdafd('0x10')](function(_0x5a2359){_0x3d3862=_[_0xdafd('0x1d')](_0x5a2359);return db[_0xdafd('0x6a')][_0xdafd('0x6b')](function(_0x4c09eb){const _0xdadb19={'id':_0x6f3fec};return db[_0xdafd('0x16')][_0xdafd('0x76')]({'attributes':['id',_0xdafd('0x77'),_0xdafd('0x78')],'where':_0xdadb19,'transaction':_0x4c09eb,'lock':_0x4c09eb[_0xdafd('0x79')][_0xdafd('0x80')],'include':[{'model':db['CmContact'],'as':_0xdafd('0x7a'),'attributes':_0x3d3862,'include':[{'model':db[_0xdafd('0x81')],'as':_0xdafd('0x7b'),'attributes':['id',_0xdafd('0x13')]}]},{'model':db[_0xdafd('0x82')],'as':_0xdafd('0x7c'),'attributes':['id',_0xdafd('0x13')]},{'model':db[_0xdafd('0x4d')],'as':_0xdafd('0x7d'),'attributes':['id',_0xdafd('0x13'),_0xdafd('0x7e')]}]})['then'](function(_0x174594){if(_0x174594){return _0x174594[_0xdafd('0xf')]({'UserId':_0x221377},{'transaction':_0x4c09eb});}});});})['then'](handleEntityNotFound(_0x5e1bef,null))[_0xdafd('0x10')](respondWithResult(_0x5e1bef,null))[_0xdafd('0x41')](handleError(_0x5e1bef,null));};exports[_0xdafd('0x83')]=function(_0x53e68a,_0x153578){return _0x53e68a['user'][_0xdafd('0x84')]({'where':{'type':_0xdafd('0x67'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xdafd('0x10')](function(_0x1f8091){if(_0x1f8091&&_0x1f8091[_0xdafd('0x45')]){return db[_0xdafd('0x16')][_0xdafd('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xdafd('0x5a')](_0xdafd('0x5b'))},'VoiceQueueId':{'$in':_[_0xdafd('0x15')](_0x1f8091,'id')},'$or':[{'UserId':null},{'UserId':_0x53e68a[_0xdafd('0x57')]['id']}]}});}return 0x0;})[_0xdafd('0x10')](function(_0x37b2eb){if(!_[_0xdafd('0x63')](_0x37b2eb)&&_['isNumber'](_0x37b2eb)){return _0x153578['status'](0xc8)[_0xdafd('0x8')]({'contacts':_0x37b2eb});}else{logger[_0xdafd('0x12')](_0xdafd('0x85'),_0xdafd('0x83'),0x194,_0xdafd('0x86'));_0x153578[_0xdafd('0x11')](0x194);}})[_0xdafd('0x41')](handleError(_0x153578,null));};exports[_0xdafd('0x87')]=function(_0x538449,_0x705220){var _0x368142=shared[_0xdafd('0x88')];var _0xed9bfb=[];_['map'](_0x368142,function(_0x5e6114){_0xed9bfb['push']({'id':_0x5e6114[_0xdafd('0x13')],'name':_0x5e6114['name'],'utcOffset':_0x5e6114[_0xdafd('0x89')]});});return _0x705220[_0xdafd('0x7')](0xc8)[_0xdafd('0x8')]({'tz':_0xed9bfb});};exports[_0xdafd('0x8a')]=function(_0x4ff7d5,_0xed0633){var _0x16172d=shared[_0xdafd('0x88')];var _0x1243e5={};if(!_[_0xdafd('0x63')](_0x16172d[_0x4ff7d5['body']['id']]))_0x1243e5=_0x16172d[_0x4ff7d5[_0xdafd('0x49')]['id']];return _0xed0633['status'](0xc8)[_0xdafd('0x8')](_0x1243e5);}; \ No newline at end of file +var _0xf725=['offset','undefined','count','limit','status','set','Content-Range','update','then','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','$and','$or','$gt','$lt','$lte','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','updatedAt','state','statedesc','campaign','membername','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','user','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','getPreviewRecall','scheduledat','dialActive','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','push','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json'];(function(_0x5a72af,_0x4643f9){var _0x342723=function(_0x2d9511){while(--_0x2d9511){_0x5a72af['push'](_0x5a72af['shift']());}};_0x342723(++_0x4643f9);}(_0xf725,0x7e));var _0x5f72=function(_0x383dba,_0x36ca18){_0x383dba=_0x383dba-0x0;var _0x232eeb=_0xf725[_0x383dba];return _0x232eeb;};'use strict';var moment=require(_0x5f72('0x0'));var _=require(_0x5f72('0x1'));var qs=require(_0x5f72('0x2'));var logger=require(_0x5f72('0x3'))(_0x5f72('0x4'));var shared=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];function respondWithResult(_0x172588,_0x4200ff){_0x4200ff=_0x4200ff||0xc8;return function(_0x17a5bc){if(_0x17a5bc){return _0x172588['status'](_0x4200ff)[_0x5f72('0x7')](_0x17a5bc);}};}function respondWithFilteredResult(_0x14a92d,_0x3f2ca7){return function(_0x193393){if(_0x193393){var _0x148af8=typeof _0x3f2ca7[_0x5f72('0x8')]===_0x5f72('0x9')&&typeof _0x3f2ca7['limit']==='undefined';var _0x16de9b=_0x193393[_0x5f72('0xa')];var _0x5b74cf=_0x148af8?0x0:_0x3f2ca7[_0x5f72('0x8')];var _0x4735f6=_0x148af8?_0x193393['count']:_0x3f2ca7[_0x5f72('0x8')]+_0x3f2ca7[_0x5f72('0xb')];var _0x115372;if(_0x4735f6>=_0x16de9b){_0x4735f6=_0x16de9b;_0x115372=0xc8;}else{_0x115372=0xce;}_0x14a92d[_0x5f72('0xc')](_0x115372);return _0x14a92d[_0x5f72('0xd')](_0x5f72('0xe'),_0x5b74cf+'-'+_0x4735f6+'/'+_0x16de9b)[_0x5f72('0x7')](_0x193393);}return null;};}function saveUpdates(_0x537d7d,_0x1ac591){return function(_0x3307ed){if(_0x3307ed){return _0x3307ed[_0x5f72('0xf')](_0x537d7d)[_0x5f72('0x10')](function(_0x333d9a){return _0x333d9a;});}return null;};}function handleEntityNotFound(_0x57007a,_0x43d1fd){return function(_0x4f81e9){if(!_0x4f81e9){_0x57007a['sendStatus'](0x194);}return _0x4f81e9;};}function handleError(_0x1665be,_0x5a036c){_0x5a036c=_0x5a036c||0x1f4;return function(_0x3267a){logger['error'](_0x3267a[_0x5f72('0x11')]);if(_0x3267a['name']){delete _0x3267a[_0x5f72('0x12')];}_0x1665be[_0x5f72('0xc')](_0x5a036c)['send'](_0x3267a);};}exports[_0x5f72('0x13')]=function(_0x276323,_0x1497d4){var _0x4af7d3={},_0x490d14={},_0x4b62e1={'count':0x0,'rows':[]};var _0x29c8b8=_[_0x5f72('0x14')](db[_0x5f72('0x15')][_0x5f72('0x16')],function(_0x3428a6){return{'name':_0x3428a6[_0x5f72('0x17')],'type':_0x3428a6[_0x5f72('0x18')]['key']};});_0x490d14[_0x5f72('0x19')]=_[_0x5f72('0x14')](_0x29c8b8,_0x5f72('0x12'));_0x490d14[_0x5f72('0x1a')]=_[_0x5f72('0x1b')](_0x276323[_0x5f72('0x1a')]);_0x490d14[_0x5f72('0x1c')]=_[_0x5f72('0x1d')](_0x490d14[_0x5f72('0x19')],_0x490d14[_0x5f72('0x1a')]);_0x490d14[_0x5f72('0x1c')]=_['concat'](_0x490d14[_0x5f72('0x1c')],[_0x5f72('0x1e'),_0x5f72('0x1f'),_0x5f72('0x20'),'$gte',_0x5f72('0x21'),_0x5f72('0x22'),'$ne',_0x5f72('0x23'),_0x5f72('0x24'),_0x5f72('0x25'),'$notBetween','$in',_0x5f72('0x26'),_0x5f72('0x27'),_0x5f72('0x28'),_0x5f72('0x29'),_0x5f72('0x2a'),_0x5f72('0x27'),_0x5f72('0x2b'),'$contains',_0x5f72('0x2c'),'$any']);_0x4af7d3[_0x5f72('0x2d')]=_[_0x5f72('0x1d')](_0x490d14[_0x5f72('0x19')],qs[_0x5f72('0x2e')](_0x276323[_0x5f72('0x1a')]['fields']));_0x4af7d3['attributes']=_0x4af7d3[_0x5f72('0x2d')][_0x5f72('0x2f')]?_0x4af7d3[_0x5f72('0x2d')]:_0x490d14[_0x5f72('0x19')];if(!_0x276323[_0x5f72('0x1a')][_0x5f72('0x30')](_0x5f72('0x31'))){_0x4af7d3['limit']=qs[_0x5f72('0xb')](_0x276323[_0x5f72('0x1a')][_0x5f72('0xb')]);_0x4af7d3[_0x5f72('0x8')]=qs[_0x5f72('0x8')](_0x276323['query'][_0x5f72('0x8')]);}_0x4af7d3[_0x5f72('0x32')]=qs[_0x5f72('0x33')](_0x276323[_0x5f72('0x1a')][_0x5f72('0x33')]);_0x4af7d3[_0x5f72('0x34')]=qs['filters'](_['pick'](_0x276323[_0x5f72('0x1a')],_0x490d14[_0x5f72('0x1c')]),_0x29c8b8);if(_0x276323['query'][_0x5f72('0x35')]){_0x4af7d3[_0x5f72('0x34')]=_[_0x5f72('0x36')](_0x4af7d3[_0x5f72('0x34')],{'$or':_[_0x5f72('0x14')](_0x29c8b8,function(_0x2ca2ff){if(_0x2ca2ff[_0x5f72('0x18')]!==_0x5f72('0x37')){var _0x2e6b77={};_0x2e6b77[_0x2ca2ff[_0x5f72('0x12')]]={'$like':'%'+_0x276323[_0x5f72('0x1a')][_0x5f72('0x35')]+'%'};return _0x2e6b77;}})});}_0x4af7d3=_[_0x5f72('0x36')]({},_0x4af7d3,_0x276323[_0x5f72('0x38')]);var _0x52fab3={'where':_0x4af7d3[_0x5f72('0x34')]};return db['CmHopper']['count'](_0x52fab3)[_0x5f72('0x10')](function(_0x19b4fa){_0x4b62e1[_0x5f72('0xa')]=_0x19b4fa;if(_0x276323[_0x5f72('0x1a')][_0x5f72('0x39')]){_0x4af7d3[_0x5f72('0x3a')]=[{'all':!![]}];}return db['CmHopper'][_0x5f72('0x3b')](_0x4af7d3);})[_0x5f72('0x10')](function(_0x46f4ce){_0x4b62e1[_0x5f72('0x3c')]=_0x46f4ce;return _0x4b62e1;})[_0x5f72('0x10')](respondWithFilteredResult(_0x1497d4,_0x4af7d3))[_0x5f72('0x3d')](handleError(_0x1497d4,null));};exports[_0x5f72('0x3e')]=function(_0xc742c7,_0x2ef034){var _0x2b8549={'raw':!![],'where':{'id':_0xc742c7[_0x5f72('0x3f')]['id']}},_0x39c2af={};_0x39c2af[_0x5f72('0x19')]=_[_0x5f72('0x1b')](db[_0x5f72('0x15')]['rawAttributes']);_0x39c2af['query']=_[_0x5f72('0x1b')](_0xc742c7['query']);_0x39c2af['filters']=_[_0x5f72('0x1d')](_0x39c2af[_0x5f72('0x19')],_0x39c2af['query']);_0x2b8549[_0x5f72('0x2d')]=_[_0x5f72('0x1d')](_0x39c2af['model'],qs[_0x5f72('0x2e')](_0xc742c7[_0x5f72('0x1a')][_0x5f72('0x2e')]));_0x2b8549[_0x5f72('0x2d')]=_0x2b8549['attributes']['length']?_0x2b8549[_0x5f72('0x2d')]:_0x39c2af[_0x5f72('0x19')];if(_0xc742c7[_0x5f72('0x1a')][_0x5f72('0x39')]){_0x2b8549[_0x5f72('0x3a')]=[{'all':!![]}];}_0x2b8549=_[_0x5f72('0x36')]({},_0x2b8549,_0xc742c7[_0x5f72('0x38')]);return db['CmHopper'][_0x5f72('0x40')](_0x2b8549)[_0x5f72('0x10')](handleEntityNotFound(_0x2ef034,null))[_0x5f72('0x10')](respondWithResult(_0x2ef034,null))[_0x5f72('0x3d')](handleError(_0x2ef034,null));};exports['create']=function(_0x28e912,_0x357e5e){return db[_0x5f72('0x15')][_0x5f72('0x41')](_0x28e912['body'],{})[_0x5f72('0x10')](respondWithResult(_0x357e5e,0xc9))[_0x5f72('0x3d')](handleError(_0x357e5e,null));};exports[_0x5f72('0xf')]=function(_0xd38e5,_0x537287){if(_0xd38e5[_0x5f72('0x42')]['id']){delete _0xd38e5[_0x5f72('0x42')]['id'];}return db['CmHopper'][_0x5f72('0x40')]({'where':{'id':_0xd38e5[_0x5f72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x537287,null))[_0x5f72('0x10')](saveUpdates(_0xd38e5[_0x5f72('0x42')],null))[_0x5f72('0x10')](respondWithResult(_0x537287,null))['catch'](handleError(_0x537287,null));};exports[_0x5f72('0x43')]=function(_0x5efa48,_0x30a9b6){return db[_0x5f72('0x15')]['describe']()[_0x5f72('0x10')](respondWithResult(_0x30a9b6,null))[_0x5f72('0x3d')](handleError(_0x30a9b6,null));};exports[_0x5f72('0x44')]=function(_0x302fff,_0x506774){var _0x41319a;var _0xff5cb5=_0x302fff[_0x5f72('0x3f')]['id'];return db[_0x5f72('0x15')]['find']({'where':{'id':_0x302fff[_0x5f72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x506774,null))[_0x5f72('0x10')](function(_0x7dd3){if(_0x7dd3){return _0x7dd3[_0x5f72('0x44')]()[_0x5f72('0x10')](function(_0x142089){return _0x142089;});}})[_0x5f72('0x10')](function(_0x28008c){_0x41319a=_0x28008c;if(_0x28008c){if(_0x28008c[_0x5f72('0x45')]||_0x28008c[_0x5f72('0x46')]){return db[_0x28008c[_0x5f72('0x45')]?'VoiceQueue':_0x5f72('0x47')][_0x5f72('0x40')]({'where':{'id':_0x28008c[_0x5f72('0x45')]?_0x28008c[_0x5f72('0x45')]:_0x28008c[_0x5f72('0x46')]},'attributes':['id','name'],'raw':!![]});}}})[_0x5f72('0x10')](function(_0x6f9638){var _0x198609={};if(_0x6f9638){_[_0x5f72('0x36')](_0x198609,_[_0x5f72('0x48')](_0x41319a['dataValues'],['createdAt',_0x5f72('0x49'),'id']));_0x198609[_0x5f72('0x4a')]=0x15;_0x198609[_0x5f72('0x4b')]='deleted';_0x198609[_0x5f72('0x4c')]=_0x6f9638[_0x5f72('0x12')];_0x198609[_0x5f72('0x4d')]=_0x302fff['user'][_0x5f72('0x12')];_0x198609[_0x5f72('0x4e')]=_0x302fff['user']['id'];_0x198609['deleted']=!![];_0x198609[_0x5f72('0x4f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x198609[_0x5f72('0x50')]=_0x41319a[_0x5f72('0x51')];_0x198609[_0x5f72('0x52')]=_0x41319a[_0x5f72('0x45')]?_0x5f72('0x53'):_0x5f72('0x54');return db[_0x5f72('0x55')]['find']({'where':{'id':_0x198609[_0x5f72('0x56')]},'attributes':['firstName',_0x5f72('0x57')]})[_0x5f72('0x10')](function(_0x48651e){if(!_[_0x5f72('0x58')](_0x506774)&&!_[_0x5f72('0x58')](_0x48651e[_0x5f72('0x59')])){_0x198609[_0x5f72('0x5a')]=_0x48651e[_0x5f72('0x59')];if(!_['isNil'](_0x48651e[_0x5f72('0x57')])){_0x198609[_0x5f72('0x5a')]+='\x20'+_0x48651e[_0x5f72('0x57')];}}})['finally'](function(){return db[_0x5f72('0x5b')][_0x5f72('0x41')](_0x198609);});}})[_0x5f72('0x10')](function(_0xb1e925){return db[_0x5f72('0x5c')][_0x5f72('0x44')]({'where':{'CmHopperId':_0xff5cb5}});})[_0x5f72('0x10')](function(){return _0x506774[_0x5f72('0xc')](0xcc)[_0x5f72('0x5d')]();})[_0x5f72('0x3d')](handleError(_0x506774,null));};exports[_0x5f72('0x5e')]=function(_0x554dcf,_0x56bfa2){var _0x2545fd=[];return db[_0x5f72('0x55')][_0x5f72('0x43')]()[_0x5f72('0x10')](function(_0xf1d356){_0x2545fd=_[_0x5f72('0x1b')](_0xf1d356);return _0x554dcf['user'][_0x5f72('0x5f')]({'where':{'type':_0x5f72('0x60'),'dialActive':!![],'dialMethod':_0x5f72('0x61')},'attributes':['id',_0x5f72('0x62'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x5f72('0x10')](function(_0x5b119c){if(_0x5b119c&&_0x5b119c[_0x5f72('0x2f')]){return db[_0x5f72('0x63')][_0x5f72('0x64')](function(_0x6b865d){var _0x58b330={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f72('0x65')](_0x5f72('0x66'))},'VoiceQueueId':{'$in':_[_0x5f72('0x14')](_0x5b119c,'id')},'$or':[{'UserId':null},{'UserId':_0x554dcf[_0x5f72('0x67')]['id']}]};var _0x59af10={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5b119c)['filter']([_0x5f72('0x68'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x554dcf[_0x5f72('0x67')]['id']}]};var _0x1ed9b1={'$or':[_0x58b330,_0x59af10]};var _0x2a5dcb=[];if(_0x554dcf['body'][_0x5f72('0x69')]&&_0x554dcf[_0x5f72('0x42')][_0x5f72('0x69')]===_0x5f72('0x6a')){if(!_[_0x5f72('0x6b')](_0x554dcf[_0x5f72('0x42')][_0x5f72('0x6c')])){_0x1ed9b1['id']={'$in':_0x554dcf[_0x5f72('0x42')][_0x5f72('0x6c')]};}_0x2a5dcb=[[_0x5f72('0x6d'),_0x5f72('0x6e')],[_0x5f72('0x6f'),_0x5b119c[0x0][_0x5f72('0x62')]==='ASC'?_0x5f72('0x70'):_0x5f72('0x6e')],db[_0x5f72('0x63')]['literal'](_0x5f72('0x71')),['id','DESC']];}else{if(!_['isEmpty'](_0x554dcf['body']['hopperIds'])){_0x1ed9b1['id']={'$notIn':_0x554dcf['body'][_0x5f72('0x6c')]};}_0x2a5dcb=[['priority','DESC'],[_0x5f72('0x6f'),_0x5b119c[0x0][_0x5f72('0x62')]],db[_0x5f72('0x63')][_0x5f72('0x72')](_0x5f72('0x73')),['id',_0x5f72('0x6e')]];}return db[_0x5f72('0x15')][_0x5f72('0x74')]({'attributes':['id','scheduledat',_0x5f72('0x51'),_0x5f72('0x75')],'where':_0x1ed9b1,'order':_0x2a5dcb,'transaction':_0x6b865d,'lock':_0x6b865d[_0x5f72('0x76')][_0x5f72('0x77')],'include':[{'model':db[_0x5f72('0x55')],'as':_0x5f72('0x78'),'attributes':_0x2545fd,'include':[{'model':db[_0x5f72('0x79')],'as':_0x5f72('0x7a'),'attributes':['id',_0x5f72('0x12')]}]},{'model':db[_0x5f72('0x7b')],'as':_0x5f72('0x7c'),'attributes':['id',_0x5f72('0x12')]},{'model':db[_0x5f72('0x7d')],'as':_0x5f72('0x7e'),'attributes':['id',_0x5f72('0x12'),'dialActive']}]})[_0x5f72('0x10')](function(_0x34ac8f){if(_0x34ac8f){return _0x34ac8f[_0x5f72('0xf')]({'UserId':_0x554dcf['user']['id']},{'transaction':_0x6b865d});}});});}})[_0x5f72('0x10')](handleEntityNotFound(_0x56bfa2,null))['then'](respondWithResult(_0x56bfa2,null))[_0x5f72('0x3d')](handleError(_0x56bfa2,null));};exports[_0x5f72('0x7f')]=function(_0x43cfc0,_0x4281b7,_0x4ee2f6){var _0x8886b4=[];var _0x1145a1=_0x43cfc0['params']['id'];var _0x32c4e3=_0x43cfc0[_0x5f72('0x67')]['id'];return db[_0x5f72('0x55')][_0x5f72('0x43')]()[_0x5f72('0x10')](function(_0x358ecb){_0x8886b4=_[_0x5f72('0x1b')](_0x358ecb);return db[_0x5f72('0x63')]['transaction'](function(_0x71d3c6){const _0x653bd0={'id':_0x1145a1};return db[_0x5f72('0x15')][_0x5f72('0x74')]({'attributes':['id',_0x5f72('0x80'),_0x5f72('0x75')],'where':_0x653bd0,'transaction':_0x71d3c6,'lock':_0x71d3c6[_0x5f72('0x76')][_0x5f72('0x77')],'include':[{'model':db['CmContact'],'as':_0x5f72('0x78'),'attributes':_0x8886b4,'include':[{'model':db[_0x5f72('0x79')],'as':_0x5f72('0x7a'),'attributes':['id','name']}]},{'model':db[_0x5f72('0x7b')],'as':_0x5f72('0x7c'),'attributes':['id',_0x5f72('0x12')]},{'model':db['VoiceQueue'],'as':_0x5f72('0x7e'),'attributes':['id',_0x5f72('0x12'),_0x5f72('0x81')]}]})[_0x5f72('0x10')](function(_0xc929da){if(_0xc929da){return _0xc929da[_0x5f72('0xf')]({'UserId':_0x32c4e3},{'transaction':_0x71d3c6});}});});})[_0x5f72('0x10')](handleEntityNotFound(_0x4281b7,null))['then'](respondWithResult(_0x4281b7,null))['catch'](handleError(_0x4281b7,null));};exports['getOpenContacts']=function(_0x4d2539,_0x4dd4f9){return _0x4d2539[_0x5f72('0x67')]['getVoiceQueues']({'where':{'type':_0x5f72('0x60'),'dialActive':!![],'dialMethod':_0x5f72('0x61')},'attributes':['id'],'raw':!![]})[_0x5f72('0x10')](function(_0x38a654){if(_0x38a654&&_0x38a654[_0x5f72('0x2f')]){return db[_0x5f72('0x15')][_0x5f72('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f72('0x65')](_0x5f72('0x66'))},'VoiceQueueId':{'$in':_[_0x5f72('0x14')](_0x38a654,'id')},'$or':[{'UserId':null},{'UserId':_0x4d2539[_0x5f72('0x67')]['id']}]}});}return 0x0;})['then'](function(_0x1cccd9){if(!_[_0x5f72('0x58')](_0x1cccd9)&&_[_0x5f72('0x82')](_0x1cccd9)){return _0x4dd4f9[_0x5f72('0xc')](0xc8)['json']({'contacts':_0x1cccd9});}else{logger[_0x5f72('0x83')](_0x5f72('0x84'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x4dd4f9['sendStatus'](0x194);}})[_0x5f72('0x3d')](handleError(_0x4dd4f9,null));};exports['getTimezones']=function(_0x5bde79,_0x5cd8dc){var _0x170c22=shared['timezones'];var _0x2b25e9=[];_['map'](_0x170c22,function(_0x39eaf8){_0x2b25e9[_0x5f72('0x85')]({'id':_0x39eaf8['name'],'name':_0x39eaf8[_0x5f72('0x12')],'utcOffset':_0x39eaf8['utcOffset']});});return _0x5cd8dc['status'](0xc8)[_0x5f72('0x7')]({'tz':_0x2b25e9});};exports['getTimezone']=function(_0x39e996,_0x5666eb){var _0x5b1a94=shared['timezones'];var _0x3572e3={};if(!_['isNil'](_0x5b1a94[_0x39e996['body']['id']]))_0x3572e3=_0x5b1a94[_0x39e996['body']['id']];return _0x5666eb['status'](0xc8)[_0x5f72('0x7')](_0x3572e3);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 24d74ce..f49965e 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 _0x01d9=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x579681,_0x181f3f){var _0x3054e0=function(_0x3c57ac){while(--_0x3c57ac){_0x579681['push'](_0x579681['shift']());}};_0x3054e0(++_0x181f3f);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x5e709a,_0x56673c){var _0x21aa70=function(_0x4bb534){while(--_0x4bb534){_0x5e709a['push'](_0x5e709a['shift']());}};_0x21aa70(++_0x56673c);}(_0xeff8,0x186));var _0x8eff=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xeff8[_0x1da04e];return _0xdd8c41;};'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'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 2102113..9d3761c 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 _0x3a25=['rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','message','error','ShowCmHopper','find','debug','create','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','User','Agent','name','length','UserId','push','update','all','dataValues','ContactId','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','lodash','util','moment','bluebird','../../config/logger'];(function(_0x12af15,_0x82cf34){var _0x45da2a=function(_0x158c1d){while(--_0x158c1d){_0x12af15['push'](_0x12af15['shift']());}};_0x45da2a(++_0x82cf34);}(_0x3a25,0x1c9));var _0x53a2=function(_0x9a7a34,_0x1147cd){_0x9a7a34=_0x9a7a34-0x0;var _0x55e54d=_0x3a25[_0x9a7a34];return _0x55e54d;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x53a2('0x4'))(_0x53a2('0x5'));exports[_0x53a2('0x6')]=function(_0x3e2a87){var _0x230463=this;return new Promise(function(_0x600c73,_0x167516){return db[_0x53a2('0x7')][_0x53a2('0x8')]({'raw':_0x3e2a87[_0x53a2('0x9')]?_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'where':_0x3e2a87[_0x53a2('0x9')]?_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0x3e2a87[_0x53a2('0x9')]?_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xc')]||null:null,'limit':_0x3e2a87[_0x53a2('0x9')]?_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xd')]||null:null,'include':_0x3e2a87[_0x53a2('0x9')]?_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x3e2a87[_0x53a2('0x9')][_0x53a2('0xe')],function(_0x287e16){return{'model':db[_0x287e16[_0x53a2('0x10')]],'as':_0x287e16['as'],'attributes':_0x287e16[_0x53a2('0xc')],'include':_0x287e16['include']?_[_0x53a2('0xf')](_0x287e16[_0x53a2('0xe')],function(_0x2a0e93){return{'model':db[_0x2a0e93[_0x53a2('0x10')]],'as':_0x2a0e93['as'],'attributes':_0x2a0e93[_0x53a2('0xc')],'include':_0x2a0e93[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x2a0e93['include'],function(_0x11ce75){return{'model':db[_0x11ce75[_0x53a2('0x10')]],'as':_0x11ce75['as'],'attributes':_0x11ce75[_0x53a2('0xc')]};}):[]};}):[]};}):[]:[]})[_0x53a2('0x11')](function(_0x4bc578){logger[_0x53a2('0x12')](_0x53a2('0x6'),_0x3e2a87);logger['debug'](_0x53a2('0x6'),_0x3e2a87,JSON[_0x53a2('0x13')](_0x4bc578));_0x600c73(_0x4bc578);})[_0x53a2('0x14')](function(_0x924cd){logger['error'](_0x53a2('0x6'),_0x924cd[_0x53a2('0x15')],_0x3e2a87);_0x167516(_0x230463[_0x53a2('0x16')](0x1f4,_0x924cd[_0x53a2('0x15')]));});});};exports[_0x53a2('0x17')]=function(_0xaa0809){var _0x549156=this;return new Promise(function(_0x375186,_0x38d98c){return db['CmHopper'][_0x53a2('0x18')]({'raw':_0xaa0809[_0x53a2('0x9')]?_0xaa0809[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'where':_0xaa0809[_0x53a2('0x9')]?_0xaa0809[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0xaa0809['options']?_0xaa0809['options'][_0x53a2('0xc')]||null:null,'include':_0xaa0809['options']?_0xaa0809[_0x53a2('0x9')][_0x53a2('0xe')]?_['map'](_0xaa0809[_0x53a2('0x9')][_0x53a2('0xe')],function(_0x2a6481){return{'model':db[_0x2a6481[_0x53a2('0x10')]],'as':_0x2a6481['as'],'attributes':_0x2a6481[_0x53a2('0xc')],'include':_0x2a6481[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x2a6481[_0x53a2('0xe')],function(_0x27062b){return{'model':db[_0x27062b[_0x53a2('0x10')]],'as':_0x27062b['as'],'attributes':_0x27062b[_0x53a2('0xc')],'include':_0x27062b[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x27062b[_0x53a2('0xe')],function(_0x8a144e){return{'model':db[_0x8a144e[_0x53a2('0x10')]],'as':_0x8a144e['as'],'attributes':_0x8a144e[_0x53a2('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x70bac2){logger['info'](_0x53a2('0x17'),_0xaa0809);logger[_0x53a2('0x19')](_0x53a2('0x17'),_0xaa0809,JSON[_0x53a2('0x13')](_0x70bac2));_0x375186(_0x70bac2);})['catch'](function(_0xc3f792){logger[_0x53a2('0x16')]('ShowCmHopper',_0xc3f792['message'],_0xaa0809);_0x38d98c(_0x549156[_0x53a2('0x16')](0x1f4,_0xc3f792[_0x53a2('0x15')]));});});};exports['CreateCmHopper']=function(_0xebf839){var _0x4acb5b=this;return new Promise(function(_0x209c2b,_0x2bb963){return db[_0x53a2('0x7')][_0x53a2('0x1a')](_0xebf839[_0x53a2('0x1b')],{'raw':_0xebf839[_0x53a2('0x9')]?_0xebf839[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![]})[_0x53a2('0x11')](function(_0x20cf71){logger[_0x53a2('0x12')](_0x53a2('0x1c'),_0xebf839);logger[_0x53a2('0x19')](_0x53a2('0x1c'),_0xebf839,JSON[_0x53a2('0x13')](_0x20cf71));_0x209c2b(_0x20cf71);})['catch'](function(_0x4f6380){logger['error'](_0x53a2('0x1c'),_0x4f6380['message'],_0xebf839);_0x2bb963(_0x4acb5b[_0x53a2('0x16')](0x1f4,_0x4f6380[_0x53a2('0x15')]));});});};exports[_0x53a2('0x1d')]=function(_0x2f63e3){var _0x2d73e0=this;return new Promise(function(_0x1f334,_0x448873){return db[_0x53a2('0x7')]['update'](_0x2f63e3['body'],{'raw':_0x2f63e3[_0x53a2('0x9')]?_0x2f63e3[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f63e3[_0x53a2('0x9')]?_0x2f63e3[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0x2f63e3[_0x53a2('0x9')]?_0x2f63e3[_0x53a2('0x9')][_0x53a2('0xc')]||null:null,'limit':_0x2f63e3[_0x53a2('0x9')]?_0x2f63e3[_0x53a2('0x9')][_0x53a2('0xd')]||null:null})['then'](function(_0x35c010){logger[_0x53a2('0x12')](_0x53a2('0x1d'),_0x2f63e3);logger[_0x53a2('0x12')](_0x53a2('0x1e'),JSON[_0x53a2('0x13')](_0x2f63e3[_0x53a2('0x9')]['where']),_0x2f63e3['body'][_0x53a2('0x1f')]);logger[_0x53a2('0x19')]('UpdateCmHopper',_0x2f63e3,JSON[_0x53a2('0x13')](_0x35c010));_0x1f334(_0x35c010);})[_0x53a2('0x14')](function(_0x3cf06d){logger[_0x53a2('0x16')](_0x53a2('0x1d'),_0x3cf06d['message'],_0x2f63e3);_0x448873(_0x2d73e0[_0x53a2('0x16')](0x1f4,_0x3cf06d[_0x53a2('0x15')]));});});};exports[_0x53a2('0x20')]=function(_0x504750){var _0x39f296=this;return new Promise(function(_0xfc6dc7,_0x2ff3d3){return db['CmHopper'][_0x53a2('0x21')]({'where':_0x504750[_0x53a2('0x9')]?_0x504750[_0x53a2('0x9')]['where']||null:null})[_0x53a2('0x11')](function(_0x17f578){logger[_0x53a2('0x12')](_0x53a2('0x20'),_0x504750);logger[_0x53a2('0x19')](_0x53a2('0x20'),_0x504750,JSON[_0x53a2('0x13')](_0x17f578));_0xfc6dc7(_0x17f578);})[_0x53a2('0x14')](function(_0x17717c){logger[_0x53a2('0x16')](_0x53a2('0x20'),_0x17717c['message'],_0x504750);_0x2ff3d3(_0x39f296[_0x53a2('0x16')](0x1f4,_0x17717c[_0x53a2('0x15')]));});});};exports[_0x53a2('0x22')]=function(_0x402cb6){var _0x29c049=this;return new Promise(function(_0xd6e95e,_0x2ae612){return db[_0x53a2('0x23')][_0x53a2('0x24')]()['then'](function(_0x204678){return db[_0x53a2('0x25')][_0x53a2('0x26')](function(_0x4382b8){return db[_0x53a2('0x7')][_0x53a2('0x8')]({'where':_0x402cb6[_0x53a2('0x9')]?_0x402cb6[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0x402cb6[_0x53a2('0x9')]?_0x402cb6[_0x53a2('0x9')][_0x53a2('0xc')]||null:null,'limit':_0x402cb6[_0x53a2('0x9')]?_0x402cb6[_0x53a2('0x9')]['limit']||null:null,'order':_0x402cb6[_0x53a2('0x9')]?_0x402cb6['options'][_0x53a2('0x27')]||null:null,'transaction':_0x4382b8,'lock':_0x4382b8[_0x53a2('0x28')][_0x53a2('0x29')],'include':[{'model':db[_0x53a2('0x23')],'as':_0x53a2('0x2a'),'attributes':_['keys'](_0x204678)},{'model':db[_0x53a2('0x2b')],'as':_0x53a2('0x2c'),'attributes':['id',_0x53a2('0x2d'),'voicePause']}]})[_0x53a2('0x11')](function(_0x5449ee){var _0x45a412=[];var _0xe77603=[];for(var _0x123348=0x0;_0x123348<_0x5449ee[_0x53a2('0x2e')];_0x123348+=0x1){var _0x419aef=_0x5449ee[_0x123348][_0x53a2('0x2f')];if(_0x419aef===null){_0x45a412[_0x53a2('0x30')](_0x5449ee[_0x123348]['update'](_0x402cb6['body'],{'transaction':_0x4382b8}));}else if(!_0xe77603['includes'](_0x419aef)){_0xe77603[_0x53a2('0x30')](_0x419aef);_0x45a412[_0x53a2('0x30')](_0x5449ee[_0x123348][_0x53a2('0x31')](_0x402cb6[_0x53a2('0x1b')],{'transaction':_0x4382b8}));}}return BPromise[_0x53a2('0x32')](_0x45a412);});})[_0x53a2('0x11')](function(_0x4e4245){logger[_0x53a2('0x12')](_0x53a2('0x22'),_0x402cb6);if(_0x4e4245[_0x53a2('0x2e')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x4e4245[0x0]['dataValues']['id'],_0x4e4245[0x0][_0x53a2('0x33')][_0x53a2('0x34')],_0x4e4245[0x0][_0x53a2('0x33')]['active']);}logger[_0x53a2('0x19')](_0x53a2('0x22'),_0x402cb6,JSON['stringify'](_0x4e4245));_0xd6e95e(_0x4e4245);})[_0x53a2('0x14')](function(_0x12f900){logger['error']('GetContactDialer',_0x12f900[_0x53a2('0x15')],_0x402cb6);_0x2ae612(_0x29c049['error'](0x1f4,_0x12f900[_0x53a2('0x15')]));});});});};exports[_0x53a2('0x35')]=function(_0xb83970){var _0x38d944=this;return new Promise(function(_0x41b714,_0x5ac612){return db['sequelize'][_0x53a2('0x26')](function(_0x6854aa){return db['CmHopperFinal'][_0x53a2('0x1a')](_0xb83970[_0x53a2('0x1b')],{'raw':_0xb83970[_0x53a2('0x9')]?_0xb83970[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'transaction':_0x6854aa})[_0x53a2('0x11')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x53a2('0x13')](_0xb83970[_0x53a2('0x9')][_0x53a2('0xb')]),_0xb83970['options']['where'][_0x53a2('0x1f')]);return db[_0x53a2('0x7')][_0x53a2('0x21')]({'where':_0xb83970[_0x53a2('0x9')]?_0xb83970['options'][_0x53a2('0xb')]||null:null,'transaction':_0x6854aa});});})[_0x53a2('0x11')](function(_0x289b55){logger[_0x53a2('0x12')](_0x53a2('0x35'),_0xb83970);logger['debug'](_0x53a2('0x35'),_0xb83970,JSON[_0x53a2('0x13')](_0x289b55));_0x41b714(_0x289b55);})[_0x53a2('0x14')](function(_0x5a2809){logger['error'](_0x53a2('0x35'),_0x5a2809[_0x53a2('0x15')],_0xb83970);_0x5ac612(_0x38d944[_0x53a2('0x16')](0x1f4,_0x5a2809['message']));});});};exports['CountReScheduled']=function(_0x302ad5){var _0x5c6649=this;return new Promise(function(_0x3934c4,_0x1cecfe){return db[_0x53a2('0x7')][_0x53a2('0x8')]({'raw':_0x302ad5[_0x53a2('0x9')]?_0x302ad5[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'where':_0x302ad5[_0x53a2('0x9')]?_0x302ad5['options'][_0x53a2('0xb')]||null:null,'attributes':[[db[_0x53a2('0x25')]['fn'](_0x53a2('0x36'),db[_0x53a2('0x25')]['fn']('IF',db[_0x53a2('0x25')][_0x53a2('0x37')](_0x53a2('0x38')+util[_0x53a2('0x39')]('\x22%s\x22',moment()['format'](_0x53a2('0x3a')))+_0x53a2('0x3b')))),_0x53a2('0x3c')]]})['then'](function(_0x533977){logger[_0x53a2('0x12')]('CountReScheduled',_0x302ad5);logger[_0x53a2('0x19')](_0x53a2('0x3d'),_0x302ad5,JSON[_0x53a2('0x13')](_0x533977));_0x3934c4(_0x533977);})[_0x53a2('0x14')](function(_0x1291bc){logger['error'](_0x53a2('0x3d'),_0x1291bc['message'],_0x302ad5);_0x1cecfe(_0x5c6649[_0x53a2('0x16')](0x1f4,_0x1291bc[_0x53a2('0x15')]));});});};exports[_0x53a2('0x3e')]=function(_0x19d3d1){var _0xffaf50=this;return new Promise(function(_0x190eaf,_0xc719a5){return db[_0x53a2('0x23')][_0x53a2('0x24')]()[_0x53a2('0x11')](function(){return db[_0x53a2('0x25')][_0x53a2('0x26')](function(_0x54a385){return db[_0x53a2('0x7')]['findAll']({'where':_0x19d3d1[_0x53a2('0x9')]?_0x19d3d1[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0x19d3d1[_0x53a2('0x9')]?_0x19d3d1[_0x53a2('0x9')][_0x53a2('0xc')]||null:null,'limit':0x1,'order':_0x19d3d1[_0x53a2('0x9')]?_0x19d3d1[_0x53a2('0x9')]['order']||null:null,'group':db[_0x53a2('0x7')]['UserId'],'transaction':_0x54a385,'lock':_0x54a385[_0x53a2('0x28')][_0x53a2('0x29')],'include':_0x19d3d1[_0x53a2('0x9')]?_0x19d3d1[_0x53a2('0x9')]['include']?_[_0x53a2('0xf')](_0x19d3d1[_0x53a2('0x9')][_0x53a2('0xe')],function(_0x1260aa){return{'model':db[_0x1260aa[_0x53a2('0x10')]],'as':_0x1260aa['as'],'attributes':_0x1260aa[_0x53a2('0xc')],'include':_0x1260aa[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x1260aa[_0x53a2('0xe')],function(_0x247381){return{'model':db[_0x247381[_0x53a2('0x10')]],'as':_0x247381['as'],'attributes':_0x247381[_0x53a2('0xc')],'include':_0x247381[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x247381[_0x53a2('0xe')],function(_0x1039eb){return{'model':db[_0x1039eb[_0x53a2('0x10')]],'as':_0x1039eb['as'],'attributes':_0x1039eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x53a2('0x11')](function(_0x4c1b70){var _0x39a9dc=[];for(var _0x53b458=0x0;_0x53b458<_0x4c1b70[_0x53a2('0x2e')];_0x53b458+=0x1){_0x39a9dc['push'](_0x4c1b70[_0x53b458]['update'](_0x19d3d1['body'],{'transaction':_0x54a385}));}return BPromise[_0x53a2('0x32')](_0x39a9dc);});})[_0x53a2('0x11')](function(_0x4ed8c4){logger['info']('GetContactRecallMe',_0x19d3d1);logger[_0x53a2('0x19')](_0x53a2('0x3e'),_0x19d3d1,JSON[_0x53a2('0x13')](_0x4ed8c4));_0x190eaf(_0x4ed8c4);})[_0x53a2('0x14')](function(_0x589451){logger['error'](_0x53a2('0x3e'),_0x589451['message'],_0x19d3d1);_0xc719a5(_0xffaf50[_0x53a2('0x16')](0x1f4,_0x589451['message']));});});});};exports[_0x53a2('0x3f')]=function(_0x3f6016){var _0x37ee8f=this;return new Promise(function(_0x2da86d,_0x4e5e80){db[_0x53a2('0x23')][_0x53a2('0x24')]()[_0x53a2('0x11')](function(_0x3630e5){return db[_0x53a2('0x7')][_0x53a2('0x8')]({'raw':_0x3f6016['options']?_0x3f6016[_0x53a2('0x9')][_0x53a2('0xa')]===undefined?!![]:![]:!![],'where':_0x3f6016[_0x53a2('0x9')]?_0x3f6016[_0x53a2('0x9')][_0x53a2('0xb')]||null:null,'attributes':_0x3f6016[_0x53a2('0x9')]?_0x3f6016[_0x53a2('0x9')][_0x53a2('0xc')]||null:null,'limit':_0x3f6016['options']?_0x3f6016[_0x53a2('0x9')][_0x53a2('0xd')]||null:null,'include':_0x3f6016[_0x53a2('0x9')]?_0x3f6016[_0x53a2('0x9')][_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x3f6016[_0x53a2('0x9')][_0x53a2('0xe')],function(_0xbe4334){return{'model':db[_0xbe4334[_0x53a2('0x10')]],'as':_0xbe4334['as'],'attributes':_0xbe4334['as']===_0x53a2('0x2a')?_[_0x53a2('0x40')](_0x3630e5):_0xbe4334['attributes'],'include':_0xbe4334[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0xbe4334['include'],function(_0x2e619b){return{'model':db[_0x2e619b['model']],'as':_0x2e619b['as'],'attributes':_0x2e619b[_0x53a2('0xc')],'include':_0x2e619b[_0x53a2('0xe')]?_[_0x53a2('0xf')](_0x2e619b[_0x53a2('0xe')],function(_0x50686e){return{'model':db[_0x50686e['model']],'as':_0x50686e['as'],'attributes':_0x50686e['attributes']};}):[]};}):[]};}):[]:[]})[_0x53a2('0x11')](function(_0x58fd96){logger[_0x53a2('0x12')](_0x53a2('0x6'),_0x3f6016);logger[_0x53a2('0x19')](_0x53a2('0x6'),_0x3f6016,JSON['stringify'](_0x58fd96));_0x2da86d(_0x58fd96);})['catch'](function(_0x17695f){logger['error'](_0x53a2('0x6'),_0x17695f['message'],_0x3f6016);_0x4e5e80(_0x37ee8f[_0x53a2('0x16')](0x1f4,_0x17695f['message']));});});});};exports[_0x53a2('0x41')]=function(_0x144f2b){var _0x2ef536=this;return new Promise(function(_0x34ac2b,_0x519ea8){return db[_0x53a2('0x23')]['findOne']({'raw':!![],'where':{'phone':_0x144f2b[_0x53a2('0x9')]['where'][_0x53a2('0x42')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x53a2('0x11')](function(_0x6eb76e){logger[_0x53a2('0x12')](_0x53a2('0x43'),_0x144f2b);logger[_0x53a2('0x19')]('getContactByPhone',_0x144f2b,JSON[_0x53a2('0x13')](_0x6eb76e));_0x34ac2b(_0x6eb76e);})['catch'](function(_0xfaa84c){logger[_0x53a2('0x16')](_0x53a2('0x43'),_0xfaa84c[_0x53a2('0x15')],_0x144f2b);_0x519ea8(_0x2ef536[_0x53a2('0x16')](0x1f4,_0xfaa84c[_0x53a2('0x15')]));});});};exports[_0x53a2('0x44')]=function(_0x5ba853){var _0x2508ea=this;return new Promise(function(_0x422279,_0x5b82dd){return db['sequelize'][_0x53a2('0x26')](function(_0x3f3669){var _0x106f16=_0x5ba853[_0x53a2('0x9')]&&_0x5ba853[_0x53a2('0x9')][_0x53a2('0xb')]?_0x5ba853[_0x53a2('0x9')]['where']:{};return db[_0x53a2('0x7')]['update'](_0x5ba853[_0x53a2('0x1b')],{'where':_0x106f16,'transaction':_0x3f3669})[_0x53a2('0x11')](function(_0x4b90c8){logger[_0x53a2('0x12')](_0x53a2('0x44'),_0x5ba853);logger[_0x53a2('0x19')](_0x53a2('0x44'),_0x5ba853,JSON['stringify'](_0x4b90c8));_0x422279(_0x4b90c8);})[_0x53a2('0x14')](function(_0x566808){logger[_0x53a2('0x16')](_0x53a2('0x44'),_0x566808[_0x53a2('0x15')],_0x5ba853);_0x5b82dd(_0x2508ea[_0x53a2('0x16')](0x1f4,_0x566808[_0x53a2('0x15')]));});});});};exports[_0x53a2('0x45')]=function(_0xb2132c){var _0x279b64=this;var _0x119f29=_0xb2132c['body']['where'][_0x53a2('0x46')];var _0x140017=_0xb2132c['body']['where'][_0x53a2('0x47')];var _0x360939=_0xb2132c['body']['where']['availableAgentsIds'];return new Promise(function(_0x38d4d3,_0x3e86df){return db['CmHopper'][_0x53a2('0x8')]({'where':{'voiceQueueId':{'$in':_0x119f29},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0x53a2('0x48')+_0x140017+_0x53a2('0x49')),'$gt':db[_0x53a2('0x25')][_0x53a2('0x37')]('NOW()')}},'UserId':{'$in':_0x360939}},'include':[{'model':db[_0x53a2('0x23')],'as':'Contact'},{'model':db[_0x53a2('0x2b')],'as':'Agent','attributes':['id',_0x53a2('0x2d'),'voicePause']},{'model':db[_0x53a2('0x4a')],'as':_0x53a2('0x4b')}]})[_0x53a2('0x11')](function(_0x37d016){if(_0x37d016[_0x53a2('0x2e')]>0x0){return db[_0x53a2('0x25')]['transaction'](function(_0x1207e7){return db[_0x53a2('0x7')][_0x53a2('0x31')]({'recallmeNotifiedDate':db['sequelize'][_0x53a2('0x37')](_0x53a2('0x4c'))},{'where':{'id':{'$in':_['map'](_0x37d016,'id')}},'transaction':_0x1207e7})[_0x53a2('0x11')](function(){_0x38d4d3(_0x37d016);})[_0x53a2('0x14')](function(_0x1abe6f){logger[_0x53a2('0x16')](_0x53a2('0x45'),_0x1abe6f['message'],_0xb2132c);_0x3e86df(_0x279b64['error'](0x1f4,_0x1abe6f[_0x53a2('0x15')]));});})[_0x53a2('0x14')](function(_0x19810c){logger[_0x53a2('0x16')](_0x53a2('0x45'),_0x19810c['message'],_0xb2132c);_0x3e86df(_0x279b64[_0x53a2('0x16')](0x1f4,_0x19810c['message']));});}else{_0x38d4d3(_0x37d016);}});});}; \ No newline at end of file +var _0x83af=['debug','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','include','map','attributes','ShowCmHopper','model','CreateCmHopper','create','body','UpdateCmHopper','update','where','limit','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','UPDATE','Contact','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','User','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent'];(function(_0x407876,_0x57c417){var _0x1b8213=function(_0x2ef473){while(--_0x2ef473){_0x407876['push'](_0x407876['shift']());}};_0x1b8213(++_0x57c417);}(_0x83af,0xfc));var _0xf83a=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x83af[_0x2de020];return _0x182b7c;};'use strict';var _=require(_0xf83a('0x0'));var util=require(_0xf83a('0x1'));var moment=require(_0xf83a('0x2'));var BPromise=require(_0xf83a('0x3'));var db=require(_0xf83a('0x4'))['db'];var logger=require(_0xf83a('0x5'))(_0xf83a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf83a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42be92,_0x32de33,_0x5f4b2a){return new BPromise(function(_0x6cc287,_0x3eb8f8){return client['request'](_0x42be92,_0x5f4b2a)[_0xf83a('0x8')](function(_0x4e6a06){logger[_0xf83a('0x9')](_0xf83a('0xa'),_0x32de33,_0xf83a('0xb'));logger[_0xf83a('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x32de33,_0xf83a('0xb'),JSON[_0xf83a('0xd')](_0x4e6a06));if(_0x4e6a06[_0xf83a('0xe')]){if(_0x4e6a06[_0xf83a('0xe')][_0xf83a('0xf')]===0x1f4){logger[_0xf83a('0xe')](_0xf83a('0xa'),_0x32de33,_0x4e6a06[_0xf83a('0xe')][_0xf83a('0x10')]);return _0x3eb8f8(_0x4e6a06[_0xf83a('0xe')][_0xf83a('0x10')]);}logger[_0xf83a('0xe')]('CmHopper,\x20%s,\x20%s',_0x32de33,_0x4e6a06[_0xf83a('0xe')][_0xf83a('0x10')]);return _0x6cc287(_0x4e6a06[_0xf83a('0xe')][_0xf83a('0x10')]);}else{logger['info'](_0xf83a('0xa'),_0x32de33,'request\x20sent');_0x6cc287(_0x4e6a06[_0xf83a('0x11')][_0xf83a('0x10')]);}})[_0xf83a('0x12')](function(_0x20e218){logger['error'](_0xf83a('0xa'),_0x32de33,_0x20e218);_0x3eb8f8(_0x20e218);});});}exports[_0xf83a('0x13')]=function(_0x596f67){var _0x232365=this;return new Promise(function(_0x1f0547,_0x513c27){return db[_0xf83a('0x14')][_0xf83a('0x15')]({'raw':_0x596f67['options']?_0x596f67[_0xf83a('0x16')][_0xf83a('0x17')]===undefined?!![]:![]:!![],'where':_0x596f67[_0xf83a('0x16')]?_0x596f67[_0xf83a('0x16')]['where']||null:null,'attributes':_0x596f67[_0xf83a('0x16')]?_0x596f67[_0xf83a('0x16')]['attributes']||null:null,'limit':_0x596f67[_0xf83a('0x16')]?_0x596f67[_0xf83a('0x16')]['limit']||null:null,'include':_0x596f67['options']?_0x596f67[_0xf83a('0x16')][_0xf83a('0x18')]?_[_0xf83a('0x19')](_0x596f67[_0xf83a('0x16')]['include'],function(_0x1d4dd4){return{'model':db[_0x1d4dd4['model']],'as':_0x1d4dd4['as'],'attributes':_0x1d4dd4[_0xf83a('0x1a')],'include':_0x1d4dd4[_0xf83a('0x18')]?_[_0xf83a('0x19')](_0x1d4dd4[_0xf83a('0x18')],function(_0x48d1f6){return{'model':db[_0x48d1f6['model']],'as':_0x48d1f6['as'],'attributes':_0x48d1f6['attributes'],'include':_0x48d1f6[_0xf83a('0x18')]?_['map'](_0x48d1f6[_0xf83a('0x18')],function(_0x581541){return{'model':db[_0x581541['model']],'as':_0x581541['as'],'attributes':_0x581541[_0xf83a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af349){logger[_0xf83a('0x9')](_0xf83a('0x13'),_0x596f67);logger[_0xf83a('0xc')](_0xf83a('0x13'),_0x596f67,JSON[_0xf83a('0xd')](_0x1af349));_0x1f0547(_0x1af349);})[_0xf83a('0x12')](function(_0x1ba384){logger[_0xf83a('0xe')](_0xf83a('0x13'),_0x1ba384[_0xf83a('0x10')],_0x596f67);_0x513c27(_0x232365[_0xf83a('0xe')](0x1f4,_0x1ba384[_0xf83a('0x10')]));});});};exports[_0xf83a('0x1b')]=function(_0x3ff1be){var _0x1bc9e5=this;return new Promise(function(_0x459e83,_0x2e984b){return db[_0xf83a('0x14')]['find']({'raw':_0x3ff1be['options']?_0x3ff1be['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ff1be[_0xf83a('0x16')]?_0x3ff1be['options']['where']||null:null,'attributes':_0x3ff1be[_0xf83a('0x16')]?_0x3ff1be[_0xf83a('0x16')][_0xf83a('0x1a')]||null:null,'include':_0x3ff1be[_0xf83a('0x16')]?_0x3ff1be[_0xf83a('0x16')]['include']?_[_0xf83a('0x19')](_0x3ff1be[_0xf83a('0x16')][_0xf83a('0x18')],function(_0x234267){return{'model':db[_0x234267[_0xf83a('0x1c')]],'as':_0x234267['as'],'attributes':_0x234267['attributes'],'include':_0x234267[_0xf83a('0x18')]?_[_0xf83a('0x19')](_0x234267['include'],function(_0x24ebc3){return{'model':db[_0x24ebc3[_0xf83a('0x1c')]],'as':_0x24ebc3['as'],'attributes':_0x24ebc3['attributes'],'include':_0x24ebc3['include']?_['map'](_0x24ebc3[_0xf83a('0x18')],function(_0x28e59d){return{'model':db[_0x28e59d[_0xf83a('0x1c')]],'as':_0x28e59d['as'],'attributes':_0x28e59d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3074ac){logger[_0xf83a('0x9')](_0xf83a('0x1b'),_0x3ff1be);logger['debug']('ShowCmHopper',_0x3ff1be,JSON[_0xf83a('0xd')](_0x3074ac));_0x459e83(_0x3074ac);})[_0xf83a('0x12')](function(_0xe7a19){logger[_0xf83a('0xe')](_0xf83a('0x1b'),_0xe7a19['message'],_0x3ff1be);_0x2e984b(_0x1bc9e5[_0xf83a('0xe')](0x1f4,_0xe7a19[_0xf83a('0x10')]));});});};exports[_0xf83a('0x1d')]=function(_0x82949b){var _0x1835e6=this;return new Promise(function(_0x4360a2,_0x17e44b){return db[_0xf83a('0x14')][_0xf83a('0x1e')](_0x82949b[_0xf83a('0x1f')],{'raw':_0x82949b[_0xf83a('0x16')]?_0x82949b[_0xf83a('0x16')][_0xf83a('0x17')]===undefined?!![]:![]:!![]})[_0xf83a('0x8')](function(_0xec24eb){logger['info']('CreateCmHopper',_0x82949b);logger[_0xf83a('0xc')]('CreateCmHopper',_0x82949b,JSON[_0xf83a('0xd')](_0xec24eb));_0x4360a2(_0xec24eb);})[_0xf83a('0x12')](function(_0x45b993){logger[_0xf83a('0xe')](_0xf83a('0x1d'),_0x45b993[_0xf83a('0x10')],_0x82949b);_0x17e44b(_0x1835e6['error'](0x1f4,_0x45b993[_0xf83a('0x10')]));});});};exports[_0xf83a('0x20')]=function(_0x27580d){var _0x26f925=this;return new Promise(function(_0x334139,_0x2b23ab){return db[_0xf83a('0x14')][_0xf83a('0x21')](_0x27580d[_0xf83a('0x1f')],{'raw':_0x27580d[_0xf83a('0x16')]?_0x27580d[_0xf83a('0x16')][_0xf83a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27580d['options']?_0x27580d[_0xf83a('0x16')][_0xf83a('0x22')]||null:null,'attributes':_0x27580d['options']?_0x27580d[_0xf83a('0x16')][_0xf83a('0x1a')]||null:null,'limit':_0x27580d[_0xf83a('0x16')]?_0x27580d['options'][_0xf83a('0x23')]||null:null})[_0xf83a('0x8')](function(_0x103cf7){logger[_0xf83a('0x9')](_0xf83a('0x20'),_0x27580d);logger[_0xf83a('0x9')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x27580d['options'][_0xf83a('0x22')]),_0x27580d['body'][_0xf83a('0x24')]);logger[_0xf83a('0xc')](_0xf83a('0x20'),_0x27580d,JSON['stringify'](_0x103cf7));_0x334139(_0x103cf7);})[_0xf83a('0x12')](function(_0x35565a){logger['error']('UpdateCmHopper',_0x35565a[_0xf83a('0x10')],_0x27580d);_0x2b23ab(_0x26f925['error'](0x1f4,_0x35565a[_0xf83a('0x10')]));});});};exports[_0xf83a('0x25')]=function(_0x5d5552){var _0x1b8a94=this;return new Promise(function(_0x1d7bfd,_0x2aa893){return db[_0xf83a('0x14')][_0xf83a('0x26')]({'where':_0x5d5552[_0xf83a('0x16')]?_0x5d5552[_0xf83a('0x16')]['where']||null:null})[_0xf83a('0x8')](function(_0x288dee){logger[_0xf83a('0x9')](_0xf83a('0x25'),_0x5d5552);logger[_0xf83a('0xc')](_0xf83a('0x25'),_0x5d5552,JSON['stringify'](_0x288dee));_0x1d7bfd(_0x288dee);})['catch'](function(_0x3ca9c5){logger[_0xf83a('0xe')](_0xf83a('0x25'),_0x3ca9c5['message'],_0x5d5552);_0x2aa893(_0x1b8a94['error'](0x1f4,_0x3ca9c5['message']));});});};exports[_0xf83a('0x27')]=function(_0x23eab2){var _0xdaac3d=this;return new Promise(function(_0x5b072a,_0x364dc4){return db[_0xf83a('0x28')][_0xf83a('0x29')]()[_0xf83a('0x8')](function(_0x278e03){return db['sequelize'][_0xf83a('0x2a')](function(_0x4f7fff){return db['CmHopper'][_0xf83a('0x15')]({'where':_0x23eab2[_0xf83a('0x16')]?_0x23eab2[_0xf83a('0x16')][_0xf83a('0x22')]||null:null,'attributes':_0x23eab2['options']?_0x23eab2[_0xf83a('0x16')][_0xf83a('0x1a')]||null:null,'limit':_0x23eab2[_0xf83a('0x16')]?_0x23eab2['options']['limit']||null:null,'order':_0x23eab2['options']?_0x23eab2['options'][_0xf83a('0x2b')]||null:null,'transaction':_0x4f7fff,'lock':_0x4f7fff['LOCK'][_0xf83a('0x2c')],'include':[{'model':db[_0xf83a('0x28')],'as':_0xf83a('0x2d'),'attributes':_['keys'](_0x278e03)},{'model':db['User'],'as':_0xf83a('0x2e'),'attributes':['id',_0xf83a('0x2f'),_0xf83a('0x30')]}]})[_0xf83a('0x8')](function(_0x3ebdde){var _0x12d4dd=[];var _0x175394=[];for(var _0x35d360=0x0;_0x35d360<_0x3ebdde[_0xf83a('0x31')];_0x35d360+=0x1){var _0x3ab5fe=_0x3ebdde[_0x35d360][_0xf83a('0x32')];if(_0x3ab5fe===null){_0x12d4dd[_0xf83a('0x33')](_0x3ebdde[_0x35d360][_0xf83a('0x21')](_0x23eab2['body'],{'transaction':_0x4f7fff}));}else if(!_0x175394[_0xf83a('0x34')](_0x3ab5fe)){_0x175394[_0xf83a('0x33')](_0x3ab5fe);_0x12d4dd[_0xf83a('0x33')](_0x3ebdde[_0x35d360][_0xf83a('0x21')](_0x23eab2[_0xf83a('0x1f')],{'transaction':_0x4f7fff}));}}return BPromise[_0xf83a('0x35')](_0x12d4dd);});})[_0xf83a('0x8')](function(_0x43f63d){logger[_0xf83a('0x9')](_0xf83a('0x27'),_0x23eab2);if(_0x43f63d[_0xf83a('0x31')]>0x0){logger[_0xf83a('0x9')](_0xf83a('0x36'),_0x43f63d[0x0][_0xf83a('0x37')]['id'],_0x43f63d[0x0][_0xf83a('0x37')][_0xf83a('0x38')],_0x43f63d[0x0][_0xf83a('0x37')][_0xf83a('0x24')]);}logger[_0xf83a('0xc')](_0xf83a('0x27'),_0x23eab2,JSON['stringify'](_0x43f63d));_0x5b072a(_0x43f63d);})[_0xf83a('0x12')](function(_0x64f53a){logger['error'](_0xf83a('0x27'),_0x64f53a[_0xf83a('0x10')],_0x23eab2);_0x364dc4(_0xdaac3d[_0xf83a('0xe')](0x1f4,_0x64f53a[_0xf83a('0x10')]));});});});};exports[_0xf83a('0x39')]=function(_0x5512c9){var _0x261e53=this;return new Promise(function(_0x3349a1,_0x5e84cf){return db[_0xf83a('0x3a')][_0xf83a('0x2a')](function(_0x5596df){return db['CmHopperFinal'][_0xf83a('0x1e')](_0x5512c9[_0xf83a('0x1f')],{'raw':_0x5512c9[_0xf83a('0x16')]?_0x5512c9[_0xf83a('0x16')][_0xf83a('0x17')]===undefined?!![]:![]:!![],'transaction':_0x5596df})[_0xf83a('0x8')](function(){logger[_0xf83a('0x9')](_0xf83a('0x3b'),JSON[_0xf83a('0xd')](_0x5512c9[_0xf83a('0x16')][_0xf83a('0x22')]),_0x5512c9[_0xf83a('0x16')][_0xf83a('0x22')][_0xf83a('0x24')]);return db[_0xf83a('0x14')][_0xf83a('0x26')]({'where':_0x5512c9[_0xf83a('0x16')]?_0x5512c9['options'][_0xf83a('0x22')]||null:null,'transaction':_0x5596df});});})[_0xf83a('0x8')](function(_0x1d4e46){logger['info'](_0xf83a('0x39'),_0x5512c9);logger[_0xf83a('0xc')](_0xf83a('0x39'),_0x5512c9,JSON[_0xf83a('0xd')](_0x1d4e46));_0x3349a1(_0x1d4e46);})[_0xf83a('0x12')](function(_0x599b21){logger[_0xf83a('0xe')](_0xf83a('0x39'),_0x599b21['message'],_0x5512c9);_0x5e84cf(_0x261e53[_0xf83a('0xe')](0x1f4,_0x599b21[_0xf83a('0x10')]));});});};exports[_0xf83a('0x3c')]=function(_0xa16435){var _0x34d852=this;return new Promise(function(_0xad1eb3,_0x50185a){return db[_0xf83a('0x14')]['findAll']({'raw':_0xa16435[_0xf83a('0x16')]?_0xa16435['options'][_0xf83a('0x17')]===undefined?!![]:![]:!![],'where':_0xa16435[_0xf83a('0x16')]?_0xa16435[_0xf83a('0x16')][_0xf83a('0x22')]||null:null,'attributes':[[db[_0xf83a('0x3a')]['fn'](_0xf83a('0x3d'),db[_0xf83a('0x3a')]['fn']('IF',db['sequelize']['literal'](_0xf83a('0x3e')+util[_0xf83a('0x3f')](_0xf83a('0x40'),moment()['format'](_0xf83a('0x41')))+_0xf83a('0x42')))),_0xf83a('0x43')]]})[_0xf83a('0x8')](function(_0x1090ce){logger[_0xf83a('0x9')]('CountReScheduled',_0xa16435);logger[_0xf83a('0xc')](_0xf83a('0x3c'),_0xa16435,JSON[_0xf83a('0xd')](_0x1090ce));_0xad1eb3(_0x1090ce);})[_0xf83a('0x12')](function(_0x48b04f){logger[_0xf83a('0xe')](_0xf83a('0x3c'),_0x48b04f[_0xf83a('0x10')],_0xa16435);_0x50185a(_0x34d852[_0xf83a('0xe')](0x1f4,_0x48b04f['message']));});});};exports[_0xf83a('0x44')]=function(_0xd951f6){var _0x5c4de7=this;return new Promise(function(_0x3f7f9c,_0xb3f5ff){return db[_0xf83a('0x28')]['describe']()[_0xf83a('0x8')](function(_0x48e933){return db['sequelize']['transaction'](function(_0x561f27){return db['CmHopper'][_0xf83a('0x15')]({'where':_0xd951f6[_0xf83a('0x16')]?_0xd951f6['options'][_0xf83a('0x22')]||null:null,'attributes':_0xd951f6[_0xf83a('0x16')]?_0xd951f6[_0xf83a('0x16')][_0xf83a('0x1a')]||null:null,'limit':0x1,'order':_0xd951f6[_0xf83a('0x16')]?_0xd951f6[_0xf83a('0x16')][_0xf83a('0x2b')]||null:null,'group':db[_0xf83a('0x14')][_0xf83a('0x32')],'transaction':_0x561f27,'lock':_0x561f27[_0xf83a('0x45')]['UPDATE'],'include':_0xd951f6[_0xf83a('0x16')]?_0xd951f6[_0xf83a('0x16')][_0xf83a('0x18')]?_[_0xf83a('0x19')](_0xd951f6['options']['include'],function(_0x4b5bd9){return{'model':db[_0x4b5bd9['model']],'as':_0x4b5bd9['as'],'attributes':_0x4b5bd9[_0xf83a('0x1a')],'include':_0x4b5bd9[_0xf83a('0x18')]?_['map'](_0x4b5bd9[_0xf83a('0x18')],function(_0x3a8189){return{'model':db[_0x3a8189['model']],'as':_0x3a8189['as'],'attributes':_0x3a8189[_0xf83a('0x1a')],'include':_0x3a8189[_0xf83a('0x18')]?_[_0xf83a('0x19')](_0x3a8189['include'],function(_0x3b6797){return{'model':db[_0x3b6797[_0xf83a('0x1c')]],'as':_0x3b6797['as'],'attributes':_0x3b6797[_0xf83a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf83a('0x8')](function(_0x5b7637){var _0x10e8c1=[];for(var _0x556c19=0x0;_0x556c19<_0x5b7637['length'];_0x556c19+=0x1){_0x10e8c1['push'](_0x5b7637[_0x556c19][_0xf83a('0x21')](_0xd951f6['body'],{'transaction':_0x561f27}));}return BPromise[_0xf83a('0x35')](_0x10e8c1);});})[_0xf83a('0x8')](function(_0x171cdc){logger[_0xf83a('0x9')](_0xf83a('0x44'),_0xd951f6);logger[_0xf83a('0xc')](_0xf83a('0x44'),_0xd951f6,JSON[_0xf83a('0xd')](_0x171cdc));_0x3f7f9c(_0x171cdc);})[_0xf83a('0x12')](function(_0x19998f){logger['error'](_0xf83a('0x44'),_0x19998f[_0xf83a('0x10')],_0xd951f6);_0xb3f5ff(_0x5c4de7[_0xf83a('0xe')](0x1f4,_0x19998f[_0xf83a('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x9dcdcd){var _0x2f5de5=this;return new Promise(function(_0x13ca9c,_0x43fe37){db['CmContact'][_0xf83a('0x29')]()[_0xf83a('0x8')](function(_0x3ef9ea){return db[_0xf83a('0x14')]['findAll']({'raw':_0x9dcdcd['options']?_0x9dcdcd['options'][_0xf83a('0x17')]===undefined?!![]:![]:!![],'where':_0x9dcdcd[_0xf83a('0x16')]?_0x9dcdcd[_0xf83a('0x16')][_0xf83a('0x22')]||null:null,'attributes':_0x9dcdcd['options']?_0x9dcdcd[_0xf83a('0x16')][_0xf83a('0x1a')]||null:null,'limit':_0x9dcdcd['options']?_0x9dcdcd[_0xf83a('0x16')][_0xf83a('0x23')]||null:null,'include':_0x9dcdcd[_0xf83a('0x16')]?_0x9dcdcd[_0xf83a('0x16')][_0xf83a('0x18')]?_['map'](_0x9dcdcd[_0xf83a('0x16')]['include'],function(_0xcc216f){return{'model':db[_0xcc216f['model']],'as':_0xcc216f['as'],'attributes':_0xcc216f['as']==='Contact'?_['keys'](_0x3ef9ea):_0xcc216f[_0xf83a('0x1a')],'include':_0xcc216f[_0xf83a('0x18')]?_['map'](_0xcc216f[_0xf83a('0x18')],function(_0x8af725){return{'model':db[_0x8af725[_0xf83a('0x1c')]],'as':_0x8af725['as'],'attributes':_0x8af725['attributes'],'include':_0x8af725[_0xf83a('0x18')]?_[_0xf83a('0x19')](_0x8af725['include'],function(_0x48e4bc){return{'model':db[_0x48e4bc[_0xf83a('0x1c')]],'as':_0x48e4bc['as'],'attributes':_0x48e4bc[_0xf83a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf83a('0x8')](function(_0x9d2a18){logger[_0xf83a('0x9')](_0xf83a('0x13'),_0x9dcdcd);logger['debug'](_0xf83a('0x13'),_0x9dcdcd,JSON[_0xf83a('0xd')](_0x9d2a18));_0x13ca9c(_0x9d2a18);})[_0xf83a('0x12')](function(_0x194b1f){logger[_0xf83a('0xe')]('GetCmHopper',_0x194b1f[_0xf83a('0x10')],_0x9dcdcd);_0x43fe37(_0x2f5de5['error'](0x1f4,_0x194b1f[_0xf83a('0x10')]));});});});};exports[_0xf83a('0x46')]=function(_0x366b6b){var _0x467f1d=this;return new Promise(function(_0x15e09a,_0x1d47cf){return db[_0xf83a('0x28')][_0xf83a('0x47')]({'raw':!![],'where':{'phone':_0x366b6b[_0xf83a('0x16')][_0xf83a('0x22')][_0xf83a('0x48')]},'attributes':['id',_0xf83a('0x49')],'order':[['id',_0xf83a('0x4a')]]})['then'](function(_0x4f4e4c){logger[_0xf83a('0x9')](_0xf83a('0x4b'),_0x366b6b);logger[_0xf83a('0xc')]('getContactByPhone',_0x366b6b,JSON[_0xf83a('0xd')](_0x4f4e4c));_0x15e09a(_0x4f4e4c);})['catch'](function(_0x153300){logger[_0xf83a('0xe')](_0xf83a('0x4b'),_0x153300[_0xf83a('0x10')],_0x366b6b);_0x1d47cf(_0x467f1d[_0xf83a('0xe')](0x1f4,_0x153300['message']));});});};exports[_0xf83a('0x4c')]=function(_0x5aba67){var _0x176d1f=this;return new Promise(function(_0x26e7f3,_0x3b2b46){return db['sequelize']['transaction'](function(_0x5dd029){return db[_0xf83a('0x14')][_0xf83a('0x21')](_0x5aba67['body'],{'where':{},'transaction':_0x5dd029})[_0xf83a('0x8')](function(_0x2ad761){logger[_0xf83a('0x9')](_0xf83a('0x4c'),_0x5aba67);logger['debug'](_0xf83a('0x4c'),_0x5aba67,JSON[_0xf83a('0xd')](_0x2ad761));_0x26e7f3(_0x2ad761);})[_0xf83a('0x12')](function(_0x3ccce0){logger[_0xf83a('0xe')](_0xf83a('0x4c'),_0x3ccce0['message'],_0x5aba67);_0x3b2b46(_0x176d1f[_0xf83a('0xe')](0x1f4,_0x3ccce0['message']));});});});};exports[_0xf83a('0x4d')]=function(_0x256a75){var _0x4470c6=this;var _0x54b25c=_0x256a75[_0xf83a('0x1f')][_0xf83a('0x22')][_0xf83a('0x4e')];var _0x16ab44=_0x256a75[_0xf83a('0x1f')]['where'][_0xf83a('0x4f')];var _0x4782ec=_0x256a75[_0xf83a('0x1f')]['where'][_0xf83a('0x50')];return new Promise(function(_0x561d12,_0x503f54){return db[_0xf83a('0x14')][_0xf83a('0x15')]({'where':{'voiceQueueId':{'$in':_0x54b25c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf83a('0x3a')]['literal'](_0xf83a('0x51')+_0x16ab44+_0xf83a('0x52')),'$gt':db[_0xf83a('0x3a')][_0xf83a('0x53')](_0xf83a('0x54'))}},'UserId':{'$in':_0x4782ec}},'include':[{'model':db[_0xf83a('0x28')],'as':_0xf83a('0x2d')},{'model':db[_0xf83a('0x55')],'as':_0xf83a('0x2e'),'attributes':['id',_0xf83a('0x2f'),_0xf83a('0x30')]},{'model':db[_0xf83a('0x56')],'as':_0xf83a('0x57')}]})[_0xf83a('0x8')](function(_0xa27183){if(_0xa27183[_0xf83a('0x31')]>0x0){return db[_0xf83a('0x3a')][_0xf83a('0x2a')](function(_0x159149){return db[_0xf83a('0x14')][_0xf83a('0x21')]({'recallmeNotifiedDate':db['sequelize'][_0xf83a('0x53')](_0xf83a('0x54'))},{'where':{'id':{'$in':_[_0xf83a('0x19')](_0xa27183,'id')}},'transaction':_0x159149})[_0xf83a('0x8')](function(){_0x561d12(_0xa27183);})[_0xf83a('0x12')](function(_0x17fb45){logger[_0xf83a('0xe')](_0xf83a('0x4d'),_0x17fb45[_0xf83a('0x10')],_0x256a75);_0x503f54(_0x4470c6[_0xf83a('0xe')](0x1f4,_0x17fb45[_0xf83a('0x10')]));});})['catch'](function(_0xb07444){logger[_0xf83a('0xe')](_0xf83a('0x4d'),_0xb07444['message'],_0x256a75);_0x503f54(_0x4470c6[_0xf83a('0xe')](0x1f4,_0xb07444[_0xf83a('0x10')]));});}else{_0x561d12(_0xa27183);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8628d73..d608d05 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 _0x9b9f=['/:id','/:id/previewrecall','post','/preview','getPreview','destroy','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','getTimezones'];(function(_0x3db285,_0x2ce3dc){var _0x287478=function(_0x146324){while(--_0x146324){_0x3db285['push'](_0x3db285['shift']());}};_0x287478(++_0x2ce3dc);}(_0x9b9f,0x17d));var _0xf9b9=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x9b9f[_0xcf581b];return _0x4f454d;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xf9b9('0x0'));router[_0xf9b9('0x1')]('/',auth[_0xf9b9('0x2')](),controller[_0xf9b9('0x3')]);router['get'](_0xf9b9('0x4'),auth[_0xf9b9('0x2')](),controller[_0xf9b9('0x5')]);router['get'](_0xf9b9('0x6'),auth[_0xf9b9('0x2')](),controller[_0xf9b9('0x7')]);router[_0xf9b9('0x1')]('/timezones',auth[_0xf9b9('0x2')](),controller[_0xf9b9('0x8')]);router['get'](_0xf9b9('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf9b9('0xa'),auth[_0xf9b9('0x2')](),controller['getPreviewRecall']);router[_0xf9b9('0xb')]('/',auth[_0xf9b9('0x2')](),controller['create']);router[_0xf9b9('0xb')](_0xf9b9('0xc'),auth[_0xf9b9('0x2')](),controller[_0xf9b9('0xd')]);router[_0xf9b9('0xb')]('/timezone',auth[_0xf9b9('0x2')](),controller['getTimezone']);router['put'](_0xf9b9('0x9'),auth[_0xf9b9('0x2')](),controller['update']);router['delete'](_0xf9b9('0x9'),auth['isAuthenticated'](),controller[_0xf9b9('0xe')]);module['exports']=router; \ No newline at end of file +var _0xbc34=['post','/preview','getPreview','/timezone','delete','destroy','exports','Router','get','isAuthenticated','index','describe','getOpenContacts','/:id','show','/:id/previewrecall','getPreviewRecall','create'];(function(_0x1b9c18,_0x44e5ee){var _0x4ccca7=function(_0x183636){while(--_0x183636){_0x1b9c18['push'](_0x1b9c18['shift']());}};_0x4ccca7(++_0x44e5ee);}(_0xbc34,0x73));var _0x4bc3=function(_0x1a1257,_0x43a38a){_0x1a1257=_0x1a1257-0x0;var _0x2d2db2=_0xbc34[_0x1a1257];return _0x2d2db2;};'use strict';var express=require('express');var router=express[_0x4bc3('0x0')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x4bc3('0x1')]('/',auth[_0x4bc3('0x2')](),controller[_0x4bc3('0x3')]);router[_0x4bc3('0x1')]('/describe',auth['isAuthenticated'](),controller[_0x4bc3('0x4')]);router[_0x4bc3('0x1')]('/opencontacts',auth['isAuthenticated'](),controller[_0x4bc3('0x5')]);router[_0x4bc3('0x1')]('/timezones',auth['isAuthenticated'](),controller['getTimezones']);router[_0x4bc3('0x1')](_0x4bc3('0x6'),auth['isAuthenticated'](),controller[_0x4bc3('0x7')]);router[_0x4bc3('0x1')](_0x4bc3('0x8'),auth['isAuthenticated'](),controller[_0x4bc3('0x9')]);router['post']('/',auth[_0x4bc3('0x2')](),controller[_0x4bc3('0xa')]);router[_0x4bc3('0xb')](_0x4bc3('0xc'),auth[_0x4bc3('0x2')](),controller[_0x4bc3('0xd')]);router['post'](_0x4bc3('0xe'),auth[_0x4bc3('0x2')](),controller['getTimezone']);router['put'](_0x4bc3('0x6'),auth[_0x4bc3('0x2')](),controller['update']);router[_0x4bc3('0xf')](_0x4bc3('0x6'),auth['isAuthenticated'](),controller[_0x4bc3('0x10')]);module[_0x4bc3('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 8d06698..a3bac38 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 _0x6e04=['DATE','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x6e04,0xb1));var _0x46e0=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x6e04[_0x18d631];return _0x50d708;};'use strict';var moment=require(_0x46e0('0x0'));var Sequelize=require(_0x46e0('0x1'));module[_0x46e0('0x2')]={'CmHopperId':{'type':Sequelize[_0x46e0('0x3')]},'phone':{'type':Sequelize[_0x46e0('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x46e0('0x5')],'defaultValue':moment()['format'](_0x46e0('0x6'))},'countbusyretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x46e0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9a2=['sequelize','exports','INTEGER','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x4f7987,_0x3af1f3){var _0x1becb2=function(_0x541562){while(--_0x541562){_0x4f7987['push'](_0x4f7987['shift']());}};_0x1becb2(++_0x3af1f3);}(_0xb9a2,0x117));var _0x2b9a=function(_0x25cc6f,_0x3c3778){_0x25cc6f=_0x25cc6f-0x0;var _0x492ad8=_0xb9a2[_0x25cc6f];return _0x492ad8;};'use strict';var moment=require(_0x2b9a('0x0'));var Sequelize=require(_0x2b9a('0x1'));module[_0x2b9a('0x2')]={'CmHopperId':{'type':Sequelize[_0x2b9a('0x3')]},'phone':{'type':Sequelize[_0x2b9a('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2b9a('0x5')],'defaultValue':moment()['format'](_0x2b9a('0x6'))},'countbusyretry':{'type':Sequelize[_0x2b9a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2b9a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2b9a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2b9a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 46895c6..723136d 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 _0x36a8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x36a8,0x1a7));var _0x836a=function(_0x38d92b,_0x1be181){_0x38d92b=_0x38d92b-0x0;var _0x56c746=_0x36a8[_0x38d92b];return _0x56c746;};'use strict';var emlformat=require(_0x836a('0x0'));var rimraf=require(_0x836a('0x1'));var zipdir=require(_0x836a('0x2'));var jsonpatch=require(_0x836a('0x3'));var rp=require('request-promise');var moment=require(_0x836a('0x4'));var BPromise=require(_0x836a('0x5'));var Mustache=require('mustache');var util=require(_0x836a('0x6'));var path=require(_0x836a('0x7'));var sox=require(_0x836a('0x8'));var csv=require(_0x836a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x836a('0xa'));var _=require(_0x836a('0xb'));var squel=require('squel');var crypto=require(_0x836a('0xc'));var jsforce=require(_0x836a('0xd'));var deskjs=require(_0x836a('0xe'));var toCsv=require(_0x836a('0x9'));var querystring=require(_0x836a('0xf'));var Papa=require(_0x836a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x836a('0x11'));var as=require(_0x836a('0x12'));var hardwareService=require(_0x836a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x836a('0x14'));var config=require(_0x836a('0x15'));var licenseUtil=require(_0x836a('0x16'));var db=require(_0x836a('0x17'))['db'];function respondWithStatusCode(_0x3f9b74,_0x570707){_0x570707=_0x570707||0xcc;return function(_0x51a7a5){if(_0x51a7a5){return _0x3f9b74[_0x836a('0x18')](_0x570707);}return _0x3f9b74[_0x836a('0x19')](_0x570707)['end']();};}function respondWithResult(_0x59953d,_0x265c25){_0x265c25=_0x265c25||0xc8;return function(_0x469335){if(_0x469335){return _0x59953d[_0x836a('0x19')](_0x265c25)[_0x836a('0x1a')](_0x469335);}};}function respondWithFilteredResult(_0x4c43be,_0x57afcf){return function(_0x4f69a4){if(_0x4f69a4){var _0x39528a=typeof _0x57afcf[_0x836a('0x1b')]===_0x836a('0x1c')&&typeof _0x57afcf['limit']===_0x836a('0x1c');var _0x23d8c5=_0x4f69a4[_0x836a('0x1d')];var _0x5ae84f=_0x39528a?0x0:_0x57afcf['offset'];var _0x110a80=_0x39528a?_0x4f69a4['count']:_0x57afcf['offset']+_0x57afcf[_0x836a('0x1e')];var _0x46269e;if(_0x110a80>=_0x23d8c5){_0x110a80=_0x23d8c5;_0x46269e=0xc8;}else{_0x46269e=0xce;}_0x4c43be[_0x836a('0x19')](_0x46269e);return _0x4c43be[_0x836a('0x1f')](_0x836a('0x20'),_0x5ae84f+'-'+_0x110a80+'/'+_0x23d8c5)['json'](_0x4f69a4);}return null;};}function patchUpdates(_0x1bca83){return function(_0x225642){try{jsonpatch[_0x836a('0x21')](_0x225642,_0x1bca83,!![]);}catch(_0x115806){return BPromise[_0x836a('0x22')](_0x115806);}return _0x225642[_0x836a('0x23')]();};}function saveUpdates(_0x4502e4,_0x51972f){return function(_0x55b397){if(_0x55b397){return _0x55b397[_0x836a('0x24')](_0x4502e4)['then'](function(_0x597db9){return _0x597db9;});}return null;};}function removeEntity(_0x1738b6,_0x5a3ed4){return function(_0x442aab){if(_0x442aab){return _0x442aab[_0x836a('0x25')]()['then'](function(){var _0x42307b=_0x442aab[_0x836a('0x26')]({'plain':!![]});var _0x2b7d7e='CmHopperAdditionalPhones';return db[_0x836a('0x27')][_0x836a('0x25')]({'where':{'type':_0x2b7d7e,'resourceId':_0x42307b['id']}})[_0x836a('0x28')](function(){return _0x442aab;});})['then'](function(){_0x1738b6[_0x836a('0x19')](0xcc)[_0x836a('0x29')]();});}};}function handleEntityNotFound(_0x51f62d,_0x2bd885){return function(_0x91f173){if(!_0x91f173){_0x51f62d[_0x836a('0x18')](0x194);}return _0x91f173;};}function handleError(_0x102731,_0x407065){_0x407065=_0x407065||0x1f4;return function(_0x3dd5db){logger[_0x836a('0x2a')](_0x3dd5db[_0x836a('0x2b')]);if(_0x3dd5db['name']){delete _0x3dd5db[_0x836a('0x2c')];}_0x102731[_0x836a('0x19')](_0x407065)[_0x836a('0x2d')](_0x3dd5db);};}exports[_0x836a('0x2e')]=function(_0x30ae16,_0x57f9c7){var _0x2dbe31={},_0x52e256={},_0x488513={'count':0x0,'rows':[]};var _0x43de48=_['map'](db[_0x836a('0x2f')][_0x836a('0x30')],function(_0x365078){return{'name':_0x365078[_0x836a('0x31')],'type':_0x365078[_0x836a('0x32')][_0x836a('0x33')]};});_0x52e256[_0x836a('0x34')]=_[_0x836a('0x35')](_0x43de48,_0x836a('0x2c'));_0x52e256[_0x836a('0x36')]=_['keys'](_0x30ae16[_0x836a('0x36')]);_0x52e256[_0x836a('0x37')]=_[_0x836a('0x38')](_0x52e256[_0x836a('0x34')],_0x52e256[_0x836a('0x36')]);_0x2dbe31['attributes']=_[_0x836a('0x38')](_0x52e256[_0x836a('0x34')],qs['fields'](_0x30ae16['query'][_0x836a('0x39')]));_0x2dbe31[_0x836a('0x3a')]=_0x2dbe31['attributes'][_0x836a('0x3b')]?_0x2dbe31['attributes']:_0x52e256[_0x836a('0x34')];if(!_0x30ae16[_0x836a('0x36')][_0x836a('0x3c')](_0x836a('0x3d'))){_0x2dbe31['limit']=qs[_0x836a('0x1e')](_0x30ae16[_0x836a('0x36')][_0x836a('0x1e')]);_0x2dbe31[_0x836a('0x1b')]=qs[_0x836a('0x1b')](_0x30ae16['query'][_0x836a('0x1b')]);}_0x2dbe31[_0x836a('0x3e')]=qs[_0x836a('0x3f')](_0x30ae16[_0x836a('0x36')][_0x836a('0x3f')]);_0x2dbe31['where']=qs[_0x836a('0x37')](_[_0x836a('0x40')](_0x30ae16[_0x836a('0x36')],_0x52e256[_0x836a('0x37')]),_0x43de48);if(_0x30ae16[_0x836a('0x36')][_0x836a('0x41')]){_0x2dbe31[_0x836a('0x42')]=_[_0x836a('0x43')](_0x2dbe31[_0x836a('0x42')],{'$or':_[_0x836a('0x35')](_0x43de48,function(_0xb05b8d){if(_0xb05b8d['type']!==_0x836a('0x44')){var _0xbf4349={};_0xbf4349[_0xb05b8d['name']]={'$like':'%'+_0x30ae16[_0x836a('0x36')][_0x836a('0x41')]+'%'};return _0xbf4349;}})});}_0x2dbe31=_[_0x836a('0x43')]({},_0x2dbe31,_0x30ae16[_0x836a('0x45')]);var _0x12ccec={'where':_0x2dbe31['where']};return db['CmHopperAdditionalPhone'][_0x836a('0x1d')](_0x12ccec)['then'](function(_0x3b913f){_0x488513[_0x836a('0x1d')]=_0x3b913f;if(_0x30ae16['query'][_0x836a('0x46')]){_0x2dbe31[_0x836a('0x47')]=[{'all':!![]}];}return db[_0x836a('0x2f')][_0x836a('0x48')](_0x2dbe31);})[_0x836a('0x28')](function(_0x2d6de8){_0x488513['rows']=_0x2d6de8;return _0x488513;})['then'](respondWithFilteredResult(_0x57f9c7,_0x2dbe31))[_0x836a('0x49')](handleError(_0x57f9c7,null));};exports[_0x836a('0x4a')]=function(_0x1847c1,_0xa99a08){var _0x23674f={'raw':!![],'where':{'id':_0x1847c1[_0x836a('0x4b')]['id']}},_0x30543e={};_0x30543e[_0x836a('0x34')]=_[_0x836a('0x4c')](db[_0x836a('0x2f')][_0x836a('0x30')]);_0x30543e[_0x836a('0x36')]=_[_0x836a('0x4c')](_0x1847c1[_0x836a('0x36')]);_0x30543e['filters']=_[_0x836a('0x38')](_0x30543e[_0x836a('0x34')],_0x30543e[_0x836a('0x36')]);_0x23674f[_0x836a('0x3a')]=_[_0x836a('0x38')](_0x30543e[_0x836a('0x34')],qs[_0x836a('0x39')](_0x1847c1[_0x836a('0x36')]['fields']));_0x23674f[_0x836a('0x3a')]=_0x23674f['attributes'][_0x836a('0x3b')]?_0x23674f[_0x836a('0x3a')]:_0x30543e[_0x836a('0x34')];if(_0x1847c1[_0x836a('0x36')][_0x836a('0x46')]){_0x23674f[_0x836a('0x47')]=[{'all':!![]}];}_0x23674f=_[_0x836a('0x43')]({},_0x23674f,_0x1847c1[_0x836a('0x45')]);return db[_0x836a('0x2f')][_0x836a('0x4d')](_0x23674f)[_0x836a('0x28')](handleEntityNotFound(_0xa99a08,null))[_0x836a('0x28')](respondWithResult(_0xa99a08,null))[_0x836a('0x49')](handleError(_0xa99a08,null));};exports['create']=function(_0x4b6d8a,_0x131836){return db[_0x836a('0x2f')][_0x836a('0x4e')](_0x4b6d8a[_0x836a('0x4f')],{})[_0x836a('0x28')](function(_0x2774ca){var _0x2a8bfc=_0x4b6d8a[_0x836a('0x50')][_0x836a('0x26')]({'plain':!![]});if(!_0x2a8bfc)throw new Error(_0x836a('0x51'));if(_0x2a8bfc[_0x836a('0x52')]===_0x836a('0x50')){var _0x1cb1a0=_0x2774ca['get']({'plain':!![]});var _0x51f9fe=_0x836a('0x53');return db[_0x836a('0x54')][_0x836a('0x4d')]({'where':{'name':_0x51f9fe,'userProfileId':_0x2a8bfc[_0x836a('0x55')]},'raw':!![]})['then'](function(_0x16ef89){if(_0x16ef89&&_0x16ef89[_0x836a('0x56')]===0x0){return db['UserProfileResource'][_0x836a('0x4e')]({'name':_0x1cb1a0[_0x836a('0x2c')],'resourceId':_0x1cb1a0['id'],'type':_0x16ef89[_0x836a('0x2c')],'sectionId':_0x16ef89['id']},{})['then'](function(){return _0x2774ca;});}else{return _0x2774ca;}})[_0x836a('0x49')](function(_0x15a824){logger[_0x836a('0x2a')](_0x836a('0x57'),_0x15a824);throw _0x15a824;});}return _0x2774ca;})[_0x836a('0x28')](respondWithResult(_0x131836,0xc9))[_0x836a('0x49')](handleError(_0x131836,null));};exports['update']=function(_0x1b415e,_0x538db6){if(_0x1b415e[_0x836a('0x4f')]['id']){delete _0x1b415e[_0x836a('0x4f')]['id'];}return db['CmHopperAdditionalPhone'][_0x836a('0x4d')]({'where':{'id':_0x1b415e[_0x836a('0x4b')]['id']}})[_0x836a('0x28')](handleEntityNotFound(_0x538db6,null))[_0x836a('0x28')](saveUpdates(_0x1b415e[_0x836a('0x4f')],null))['then'](respondWithResult(_0x538db6,null))[_0x836a('0x49')](handleError(_0x538db6,null));};exports[_0x836a('0x25')]=function(_0x294e16,_0x398d3e){return db[_0x836a('0x2f')]['find']({'where':{'id':_0x294e16[_0x836a('0x4b')]['id']}})[_0x836a('0x28')](handleEntityNotFound(_0x398d3e,null))[_0x836a('0x28')](removeEntity(_0x398d3e,null))[_0x836a('0x49')](handleError(_0x398d3e,null));}; \ No newline at end of file +var _0x0248=['intersection','fields','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','show','params','length','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes'];(function(_0x45df95,_0x127435){var _0x283992=function(_0x1df4b1){while(--_0x1df4b1){_0x45df95['push'](_0x45df95['shift']());}};_0x283992(++_0x127435);}(_0x0248,0x10f));var _0x8024=function(_0x13bc9b,_0x3df78f){_0x13bc9b=_0x13bc9b-0x0;var _0x592837=_0x0248[_0x13bc9b];return _0x592837;};'use strict';var emlformat=require(_0x8024('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8024('0x1'));var jsonpatch=require(_0x8024('0x2'));var rp=require('request-promise');var moment=require(_0x8024('0x3'));var BPromise=require(_0x8024('0x4'));var Mustache=require(_0x8024('0x5'));var util=require(_0x8024('0x6'));var path=require(_0x8024('0x7'));var sox=require(_0x8024('0x8'));var csv=require('to-csv');var ejs=require(_0x8024('0x9'));var fs=require('fs');var fs_extra=require(_0x8024('0xa'));var _=require('lodash');var squel=require(_0x8024('0xb'));var crypto=require(_0x8024('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8024('0xd'));var Papa=require('papaparse');var Redis=require(_0x8024('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8024('0xf'));var as=require(_0x8024('0x10'));var hardwareService=require(_0x8024('0x11'));var logger=require(_0x8024('0x12'))(_0x8024('0x13'));var utils=require(_0x8024('0x14'));var config=require(_0x8024('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8024('0x16'))['db'];function respondWithStatusCode(_0x25e907,_0x416b21){_0x416b21=_0x416b21||0xcc;return function(_0x33de4d){if(_0x33de4d){return _0x25e907[_0x8024('0x17')](_0x416b21);}return _0x25e907[_0x8024('0x18')](_0x416b21)[_0x8024('0x19')]();};}function respondWithResult(_0x1e275b,_0x34fe53){_0x34fe53=_0x34fe53||0xc8;return function(_0x5e2cba){if(_0x5e2cba){return _0x1e275b['status'](_0x34fe53)[_0x8024('0x1a')](_0x5e2cba);}};}function respondWithFilteredResult(_0x10a2fa,_0x15ebea){return function(_0x3fdde4){if(_0x3fdde4){var _0x8a8d0a=typeof _0x15ebea[_0x8024('0x1b')]===_0x8024('0x1c')&&typeof _0x15ebea['limit']==='undefined';var _0x254651=_0x3fdde4[_0x8024('0x1d')];var _0x3f07e4=_0x8a8d0a?0x0:_0x15ebea[_0x8024('0x1b')];var _0x9d4cf3=_0x8a8d0a?_0x3fdde4[_0x8024('0x1d')]:_0x15ebea['offset']+_0x15ebea['limit'];var _0x269bb3;if(_0x9d4cf3>=_0x254651){_0x9d4cf3=_0x254651;_0x269bb3=0xc8;}else{_0x269bb3=0xce;}_0x10a2fa['status'](_0x269bb3);return _0x10a2fa[_0x8024('0x1e')](_0x8024('0x1f'),_0x3f07e4+'-'+_0x9d4cf3+'/'+_0x254651)['json'](_0x3fdde4);}return null;};}function patchUpdates(_0xf669f5){return function(_0x3e5723){try{jsonpatch['apply'](_0x3e5723,_0xf669f5,!![]);}catch(_0x1f94ae){return BPromise['reject'](_0x1f94ae);}return _0x3e5723[_0x8024('0x20')]();};}function saveUpdates(_0x101b89,_0x449a23){return function(_0x4c2a26){if(_0x4c2a26){return _0x4c2a26[_0x8024('0x21')](_0x101b89)[_0x8024('0x22')](function(_0x59472b){return _0x59472b;});}return null;};}function removeEntity(_0x992412,_0x17044f){return function(_0x59ab2f){if(_0x59ab2f){return _0x59ab2f[_0x8024('0x23')]()['then'](function(){var _0x296d05=_0x59ab2f[_0x8024('0x24')]({'plain':!![]});var _0x31cbf4='CmHopperAdditionalPhones';return db['UserProfileResource'][_0x8024('0x23')]({'where':{'type':_0x31cbf4,'resourceId':_0x296d05['id']}})[_0x8024('0x22')](function(){return _0x59ab2f;});})['then'](function(){_0x992412[_0x8024('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x547f08,_0x9dbe7f){return function(_0x5a7029){if(!_0x5a7029){_0x547f08[_0x8024('0x17')](0x194);}return _0x5a7029;};}function handleError(_0x1a047b,_0x2366a6){_0x2366a6=_0x2366a6||0x1f4;return function(_0x206e35){logger['error'](_0x206e35[_0x8024('0x25')]);if(_0x206e35[_0x8024('0x26')]){delete _0x206e35['name'];}_0x1a047b['status'](_0x2366a6)['send'](_0x206e35);};}exports[_0x8024('0x27')]=function(_0x48bd68,_0x2cc329){var _0x25cd0f={},_0x2e0393={},_0x368c40={'count':0x0,'rows':[]};var _0x410544=_[_0x8024('0x28')](db['CmHopperAdditionalPhone'][_0x8024('0x29')],function(_0x5bb806){return{'name':_0x5bb806[_0x8024('0x2a')],'type':_0x5bb806['type'][_0x8024('0x2b')]};});_0x2e0393[_0x8024('0x2c')]=_[_0x8024('0x28')](_0x410544,_0x8024('0x26'));_0x2e0393['query']=_[_0x8024('0x2d')](_0x48bd68[_0x8024('0x2e')]);_0x2e0393[_0x8024('0x2f')]=_['intersection'](_0x2e0393[_0x8024('0x2c')],_0x2e0393[_0x8024('0x2e')]);_0x25cd0f[_0x8024('0x30')]=_[_0x8024('0x31')](_0x2e0393['model'],qs[_0x8024('0x32')](_0x48bd68[_0x8024('0x2e')][_0x8024('0x32')]));_0x25cd0f[_0x8024('0x30')]=_0x25cd0f[_0x8024('0x30')]['length']?_0x25cd0f[_0x8024('0x30')]:_0x2e0393[_0x8024('0x2c')];if(!_0x48bd68[_0x8024('0x2e')][_0x8024('0x33')]('nolimit')){_0x25cd0f[_0x8024('0x34')]=qs[_0x8024('0x34')](_0x48bd68['query'][_0x8024('0x34')]);_0x25cd0f[_0x8024('0x1b')]=qs['offset'](_0x48bd68[_0x8024('0x2e')]['offset']);}_0x25cd0f[_0x8024('0x35')]=qs[_0x8024('0x36')](_0x48bd68[_0x8024('0x2e')][_0x8024('0x36')]);_0x25cd0f['where']=qs['filters'](_[_0x8024('0x37')](_0x48bd68[_0x8024('0x2e')],_0x2e0393[_0x8024('0x2f')]),_0x410544);if(_0x48bd68[_0x8024('0x2e')]['filter']){_0x25cd0f[_0x8024('0x38')]=_[_0x8024('0x39')](_0x25cd0f[_0x8024('0x38')],{'$or':_[_0x8024('0x28')](_0x410544,function(_0x3a2395){if(_0x3a2395['type']!==_0x8024('0x3a')){var _0x104bb3={};_0x104bb3[_0x3a2395[_0x8024('0x26')]]={'$like':'%'+_0x48bd68[_0x8024('0x2e')][_0x8024('0x3b')]+'%'};return _0x104bb3;}})});}_0x25cd0f=_[_0x8024('0x39')]({},_0x25cd0f,_0x48bd68[_0x8024('0x3c')]);var _0x56f719={'where':_0x25cd0f['where']};return db[_0x8024('0x3d')][_0x8024('0x1d')](_0x56f719)['then'](function(_0x1f610b){_0x368c40[_0x8024('0x1d')]=_0x1f610b;if(_0x48bd68[_0x8024('0x2e')][_0x8024('0x3e')]){_0x25cd0f[_0x8024('0x3f')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x8024('0x40')](_0x25cd0f);})[_0x8024('0x22')](function(_0x10eaf1){_0x368c40[_0x8024('0x41')]=_0x10eaf1;return _0x368c40;})[_0x8024('0x22')](respondWithFilteredResult(_0x2cc329,_0x25cd0f))['catch'](handleError(_0x2cc329,null));};exports[_0x8024('0x42')]=function(_0x582e95,_0xdb5257){var _0xaf985c={'raw':!![],'where':{'id':_0x582e95[_0x8024('0x43')]['id']}},_0x346bdb={};_0x346bdb[_0x8024('0x2c')]=_[_0x8024('0x2d')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x346bdb[_0x8024('0x2e')]=_[_0x8024('0x2d')](_0x582e95[_0x8024('0x2e')]);_0x346bdb['filters']=_[_0x8024('0x31')](_0x346bdb[_0x8024('0x2c')],_0x346bdb['query']);_0xaf985c['attributes']=_['intersection'](_0x346bdb[_0x8024('0x2c')],qs[_0x8024('0x32')](_0x582e95['query'][_0x8024('0x32')]));_0xaf985c[_0x8024('0x30')]=_0xaf985c[_0x8024('0x30')][_0x8024('0x44')]?_0xaf985c[_0x8024('0x30')]:_0x346bdb[_0x8024('0x2c')];if(_0x582e95['query'][_0x8024('0x3e')]){_0xaf985c[_0x8024('0x3f')]=[{'all':!![]}];}_0xaf985c=_['merge']({},_0xaf985c,_0x582e95[_0x8024('0x3c')]);return db[_0x8024('0x3d')][_0x8024('0x45')](_0xaf985c)['then'](handleEntityNotFound(_0xdb5257,null))[_0x8024('0x22')](respondWithResult(_0xdb5257,null))[_0x8024('0x46')](handleError(_0xdb5257,null));};exports['create']=function(_0x230d7c,_0x260dec){return db[_0x8024('0x3d')]['create'](_0x230d7c[_0x8024('0x47')],{})[_0x8024('0x22')](function(_0x34cece){var _0x5ac057=_0x230d7c[_0x8024('0x48')]['get']({'plain':!![]});if(!_0x5ac057)throw new Error(_0x8024('0x49'));if(_0x5ac057['role']===_0x8024('0x48')){var _0x370d55=_0x34cece[_0x8024('0x24')]({'plain':!![]});var _0x502cc9=_0x8024('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x502cc9,'userProfileId':_0x5ac057[_0x8024('0x4b')]},'raw':!![]})[_0x8024('0x22')](function(_0xc125c2){if(_0xc125c2&&_0xc125c2[_0x8024('0x4c')]===0x0){return db[_0x8024('0x4d')]['create']({'name':_0x370d55[_0x8024('0x26')],'resourceId':_0x370d55['id'],'type':_0xc125c2[_0x8024('0x26')],'sectionId':_0xc125c2['id']},{})[_0x8024('0x22')](function(){return _0x34cece;});}else{return _0x34cece;}})[_0x8024('0x46')](function(_0x173139){logger[_0x8024('0x4e')](_0x8024('0x4f'),_0x173139);throw _0x173139;});}return _0x34cece;})[_0x8024('0x22')](respondWithResult(_0x260dec,0xc9))[_0x8024('0x46')](handleError(_0x260dec,null));};exports['update']=function(_0x49ad4a,_0x276607){if(_0x49ad4a['body']['id']){delete _0x49ad4a[_0x8024('0x47')]['id'];}return db[_0x8024('0x3d')][_0x8024('0x45')]({'where':{'id':_0x49ad4a[_0x8024('0x43')]['id']}})['then'](handleEntityNotFound(_0x276607,null))['then'](saveUpdates(_0x49ad4a[_0x8024('0x47')],null))[_0x8024('0x22')](respondWithResult(_0x276607,null))[_0x8024('0x46')](handleError(_0x276607,null));};exports[_0x8024('0x23')]=function(_0xb013f9,_0x50bdbd){return db['CmHopperAdditionalPhone'][_0x8024('0x45')]({'where':{'id':_0xb013f9[_0x8024('0x43')]['id']}})[_0x8024('0x22')](handleEntityNotFound(_0x50bdbd,null))[_0x8024('0x22')](removeEntity(_0x50bdbd,null))[_0x8024('0x46')](handleError(_0x50bdbd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 38ffc14..5e13ad6 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 _0x4369=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','lodash','util','api','moment','request-promise','rimraf'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0x4369,0x108));var _0x9436=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x4369[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0x9436('0x0'));var util=require(_0x9436('0x1'));var logger=require('../../config/logger')(_0x9436('0x2'));var moment=require(_0x9436('0x3'));var BPromise=require('bluebird');var rp=require(_0x9436('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9436('0x5'));var config=require(_0x9436('0x6'));var attributes=require(_0x9436('0x7'));module[_0x9436('0x8')]=function(_0x2a5744,_0x430d5c){return _0x2a5744['define'](_0x9436('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x285f=['cm_hopper_additional_phones','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','CmHopperAdditionalPhone'];(function(_0x5a9fb9,_0xb126c4){var _0x110430=function(_0x5112a1){while(--_0x5112a1){_0x5a9fb9['push'](_0x5a9fb9['shift']());}};_0x110430(++_0xb126c4);}(_0x285f,0x18d));var _0xf285=function(_0x537ba2,_0xa2f4c3){_0x537ba2=_0x537ba2-0x0;var _0x5d567e=_0x285f[_0x537ba2];return _0x5d567e;};'use strict';var _=require(_0xf285('0x0'));var util=require(_0xf285('0x1'));var logger=require(_0xf285('0x2'))('api');var moment=require(_0xf285('0x3'));var BPromise=require(_0xf285('0x4'));var rp=require(_0xf285('0x5'));var fs=require('fs');var path=require(_0xf285('0x6'));var rimraf=require(_0xf285('0x7'));var config=require(_0xf285('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0xb5ec91,_0x3fa241){return _0xb5ec91['define'](_0xf285('0x9'),attributes,{'tableName':_0xf285('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 f803ff6..d8e93ea 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 _0x6379=['duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','countabandonedretry','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','catch','SwapAdditionalPhones','VoiceQueueId'];(function(_0x1254ad,_0x15f0d6){var _0x10f41f=function(_0x2e1739){while(--_0x2e1739){_0x1254ad['push'](_0x1254ad['shift']());}};_0x10f41f(++_0x15f0d6);}(_0x6379,0x19d));var _0x9637=function(_0x4ffab6,_0x303961){_0x4ffab6=_0x4ffab6-0x0;var _0x507dc7=_0x6379[_0x4ffab6];return _0x507dc7;};'use strict';var _=require(_0x9637('0x0'));var util=require('util');var moment=require(_0x9637('0x1'));var BPromise=require(_0x9637('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9637('0x3'));var db=require(_0x9637('0x4'))['db'];var utils=require(_0x9637('0x5'));var logger=require(_0x9637('0x6'))('rpc');var config=require(_0x9637('0x7'));var jayson=require(_0x9637('0x8'));var client=jayson[_0x9637('0x9')][_0x9637('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52d009,_0x55978b,_0x587140){return new BPromise(function(_0x17d9dc,_0x49683c){return client[_0x9637('0xb')](_0x52d009,_0x587140)[_0x9637('0xc')](function(_0x2bd7bf){logger[_0x9637('0xd')](_0x9637('0xe'),_0x55978b,'request\x20sent');logger[_0x9637('0xf')](_0x9637('0x10'),_0x55978b,_0x9637('0x11'),JSON[_0x9637('0x12')](_0x2bd7bf));if(_0x2bd7bf[_0x9637('0x13')]){if(_0x2bd7bf[_0x9637('0x13')]['code']===0x1f4){logger['error'](_0x9637('0xe'),_0x55978b,_0x2bd7bf['error'][_0x9637('0x14')]);return _0x49683c(_0x2bd7bf[_0x9637('0x13')][_0x9637('0x14')]);}logger[_0x9637('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x55978b,_0x2bd7bf[_0x9637('0x13')][_0x9637('0x14')]);return _0x17d9dc(_0x2bd7bf[_0x9637('0x13')][_0x9637('0x14')]);}else{logger[_0x9637('0xd')](_0x9637('0xe'),_0x55978b,_0x9637('0x11'));_0x17d9dc(_0x2bd7bf[_0x9637('0x15')][_0x9637('0x14')]);}})['catch'](function(_0x50a153){logger[_0x9637('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x55978b,_0x50a153);_0x49683c(_0x50a153);});});}exports[_0x9637('0x16')]=function(_0xe812e7){var _0x500729=this;return new Promise(function(_0x5c403b,_0x1e17f2){return db[_0x9637('0x17')][_0x9637('0x18')]({'raw':!![],'where':{'ContactId':_0xe812e7[_0x9637('0x19')][_0x9637('0x1a')],'ListId':_0xe812e7[_0x9637('0x19')]['ListId'],'VoiceQueueId':_0xe812e7['body']['VoiceQueueId']===undefined?null:_0xe812e7[_0x9637('0x19')]['VoiceQueueId'],'CampaignId':_0xe812e7[_0x9637('0x19')][_0x9637('0x1b')]===undefined?null:_0xe812e7[_0x9637('0x19')][_0x9637('0x1b')]}})[_0x9637('0xc')](function(_0x5b81f4){if(_0x5b81f4!=null){return db[_0x9637('0x1c')][_0x9637('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5b81f4['id'],'OrderBy':{'$gt':_0x5b81f4[_0x9637('0x1d')]}},'order':[[_0x9637('0x1d'),'ASC']]})['then'](function(_0x267ff1){var _0xc780d=0x0;if(_0x267ff1){if(_0x267ff1[_0x9637('0x1e')]+_0x267ff1[_0x9637('0x1f')]+_0x267ff1[_0x9637('0x20')]+_0x267ff1[_0x9637('0x21')]+_0x267ff1[_0x9637('0x22')]+_0x267ff1['countabandonedretry']+_0x267ff1[_0x9637('0x23')]+_0x267ff1[_0x9637('0x24')]<_0xe812e7[_0x9637('0x25')][_0x9637('0x26')])_0xc780d=0x1;_0x5c403b({'additional':_0xc780d});}else{return db[_0x9637('0x1c')][_0x9637('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5b81f4['id']},'order':[[_0x9637('0x1d'),_0x9637('0x27')]]})['then'](function(_0x2ef454){var _0x3086ec=0x0;if(_0x2ef454){if(_0x2ef454['countbusyretry']+_0x2ef454[_0x9637('0x1f')]+_0x2ef454[_0x9637('0x20')]+_0x2ef454[_0x9637('0x21')]+_0x2ef454[_0x9637('0x22')]+_0x2ef454['countabandonedretry']+_0x2ef454[_0x9637('0x23')]+_0x2ef454[_0x9637('0x24')]<_0xe812e7[_0x9637('0x25')][_0x9637('0x26')])_0x3086ec=0x1;_0x5c403b({'additional':_0x3086ec});}else{_0x5c403b({'additional':0x0});}})[_0x9637('0x28')](function(_0x3d7566){logger[_0x9637('0x13')](_0x9637('0x16'),_0x3d7566[_0x9637('0x14')]);_0x1e17f2(_0x500729[_0x9637('0x13')](0x1f4,_0x3d7566[_0x9637('0x14')]));});}})[_0x9637('0x28')](function(_0x22839e){logger['error'](_0x9637('0x16'),_0x22839e[_0x9637('0x14')]);_0x1e17f2(_0x500729[_0x9637('0x13')](0x1f4,_0x22839e['message']));});}else _0x5c403b({'additional':0x0});});});};exports[_0x9637('0x29')]=function(_0x3f6802){var _0x4fa1f9=this;return new Promise(function(_0x21e021,_0x163f6c){return db[_0x9637('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x3f6802['body'][_0x9637('0x1a')],'ListId':_0x3f6802[_0x9637('0x19')]['ListId'],'VoiceQueueId':_0x3f6802[_0x9637('0x19')][_0x9637('0x2a')]===undefined?null:_0x3f6802['body'][_0x9637('0x2a')],'CampaignId':_0x3f6802['body'][_0x9637('0x1b')]===undefined?null:_0x3f6802[_0x9637('0x19')][_0x9637('0x1b')]}})[_0x9637('0xc')](function(_0x3dacd3){if(_0x3dacd3!=null){return db[_0x9637('0x1c')][_0x9637('0x18')]({'raw':!![],'where':{'CmHopperId':_0x3dacd3['id'],'OrderBy':{'$gte':_0x3dacd3[_0x9637('0x1d')]}},'order':[[_0x9637('0x1d'),_0x9637('0x27')]]})['then'](function(_0x244ce3){if(_0x244ce3)return activateAdditionalPhone(_0x3dacd3,_0x3f6802[_0x9637('0x19')],_0x244ce3,_0x3f6802[_0x9637('0x2b')],_0x3f6802[_0x9637('0x2c')])[_0x9637('0xc')](function(_0x5866e3){_0x21e021(_0x5866e3);});else{return db[_0x9637('0x1c')][_0x9637('0x18')]({'raw':!![],'where':{'CmHopperId':_0x3dacd3['id']},'order':[['OrderBy','ASC']]})[_0x9637('0xc')](function(_0x16a8f1){if(_0x16a8f1)return activateAdditionalPhone(_0x3dacd3,_0x3f6802['body'],_0x16a8f1,_0x3f6802[_0x9637('0x2b')],_0x3f6802['waitTime'])['then'](function(_0x52c0b7){_0x21e021(_0x52c0b7);});else{_0x21e021({'id':_0x3dacd3['id'],'phone':''});}})[_0x9637('0x28')](function(_0x24c36f){logger[_0x9637('0x13')](_0x9637('0x16'),_0x24c36f[_0x9637('0x14')]);_0x163f6c(_0x4fa1f9[_0x9637('0x13')](0x1f4,_0x24c36f['message']));});}})['catch'](function(_0x406a49){logger[_0x9637('0x13')](_0x9637('0x16'),_0x406a49['message']);_0x163f6c(_0x4fa1f9[_0x9637('0x13')](0x1f4,_0x406a49['message']));});}else _0x21e021(0x1);});});};function activateAdditionalPhone(_0x25cb44,_0x17d814,_0x389fb9,_0x17f2bc,_0x483b8b){return new Promise(function(_0x115f91,_0x25d835){var _0x2f59ee;if(_[_0x9637('0x2d')](_0x389fb9['scheduledat'])){_0x389fb9[_0x9637('0x2e')]=moment();}if(moment()>moment(_0x389fb9[_0x9637('0x2e')])){_0x2f59ee=moment()[_0x9637('0x2f')](_0x483b8b||0x3,_0x9637('0x30'));}else{if(_0x389fb9['OrderBy']==0x0){_0x2f59ee=moment(_0x389fb9[_0x9637('0x2e')]);}else{_0x2f59ee=moment()[_0x9637('0x2f')](_0x483b8b||0x3,_0x9637('0x30'));}}if(_[_0x9637('0x2d')](_0x2f59ee)){_0x2f59ee=moment()[_0x9637('0x2f')](_0x483b8b||0x3,_0x9637('0x30'));}var _0x30be4a={'phone':_0x25cb44[_0x9637('0x31')],'active':0x0,'OrderBy':_[_0x9637('0x2d')](_0x25cb44[_0x9637('0x1d')])?0x0:_0x25cb44['OrderBy'],'scheduledat':moment()[_0x9637('0x2f')](_0x17f2bc||0x1,_0x9637('0x30')),'countbusyretry':_0x17d814[_0x9637('0x1e')],'countcongestionretry':_0x17d814['countcongestionretry'],'countnoanswerretry':_0x17d814[_0x9637('0x20')],'countnosuchnumberretry':_0x17d814[_0x9637('0x21')],'countdropretry':_0x17d814[_0x9637('0x22')],'countabandonedretry':_0x17d814['countabandonedretry'],'countmachineretry':_0x17d814[_0x9637('0x23')],'countagentrejectretry':_0x17d814[_0x9637('0x24')],'createdAt':_0x17d814['createdAt'],'updatedAt':_0x17d814[_0x9637('0x32')]};var _0x1d7846={'CmHopperId':_0x25cb44['id'],'phone':_0x389fb9['phone'],'active':0x0,'OrderBy':_['isNil'](_0x389fb9[_0x9637('0x1d')])?0x0:_0x389fb9['OrderBy'],'scheduledat':_0x2f59ee,'countbusyretry':_0x389fb9[_0x9637('0x1e')],'countcongestionretry':_0x389fb9[_0x9637('0x1f')],'countnoanswerretry':_0x389fb9[_0x9637('0x20')],'countnosuchnumberretry':_0x389fb9[_0x9637('0x21')],'countdropretry':_0x389fb9[_0x9637('0x22')],'countabandonedretry':_0x389fb9[_0x9637('0x33')],'countmachineretry':_0x389fb9['countmachineretry'],'countagentrejectretry':_0x389fb9[_0x9637('0x24')],'createdAt':_0x389fb9['createdAt'],'updatedAt':_0x389fb9[_0x9637('0x32')]};return db[_0x9637('0x34')][_0x9637('0x35')](function(_0x5a581c){return db[_0x9637('0x1c')][_0x9637('0x36')](_0x30be4a,{'where':{'id':_0x389fb9['id']}},{'transaction':_0x5a581c})[_0x9637('0xc')](function(){return db['CmHopper'][_0x9637('0x36')](_0x1d7846,{'where':{'id':_0x25cb44['id']}},{'transaction':_0x5a581c});});})[_0x9637('0xc')](function(_0x1f293a){_0x115f91({'id':_0x25cb44['id'],'phone':_0x389fb9[_0x9637('0x31')]});})[_0x9637('0x28')](function(_0x16321a){logger[_0x9637('0x13')]('activateAdditionalPhone',_0x16321a[_0x9637('0x14')]);_0x25d835({'error':_0x16321a['message']});});});}exports[_0x9637('0x37')]=function(_0x290bfa){var _0x180480=this;return new Promise(function(_0x1fd082,_0xac3fff){return db[_0x9637('0x17')][_0x9637('0x36')](_0x290bfa[_0x9637('0x19')][_0x9637('0x38')],{'where':{'id':_0x290bfa[_0x9637('0x19')]['id']}})['then'](function(_0x9bae16){_0x1fd082(_0x9bae16);})['catch'](function(_0x35c7d8){logger[_0x9637('0x13')]('IncrementPreviewCounters',_0x35c7d8['message']);_0xac3fff(_0x180480['error'](0x1f4,_0x35c7d8[_0x9637('0x14')]));});});}; \ No newline at end of file +var _0x8977=['scheduledat','add','minutes','isNil','createdAt','updatedAt','phone','sequelize','transaction','update','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countbusyretry','entity','SwapAdditionalPhones','CampaignId','duration','waitTime'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8977,0x132));var _0x7897=function(_0x292eda,_0x18d043){_0x292eda=_0x292eda-0x0;var _0x34627a=_0x8977[_0x292eda];return _0x34627a;};'use strict';var _=require(_0x7897('0x0'));var util=require(_0x7897('0x1'));var moment=require('moment');var BPromise=require(_0x7897('0x2'));var rs=require(_0x7897('0x3'));var fs=require('fs');var Redis=require(_0x7897('0x4'));var db=require(_0x7897('0x5'))['db'];var utils=require(_0x7897('0x6'));var logger=require('../../config/logger')(_0x7897('0x7'));var config=require(_0x7897('0x8'));var jayson=require(_0x7897('0x9'));var client=jayson[_0x7897('0xa')][_0x7897('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5ce9,_0x16d5b4,_0x51b6e6){return new BPromise(function(_0x326d97,_0x1df93a){return client[_0x7897('0xc')](_0x5a5ce9,_0x51b6e6)[_0x7897('0xd')](function(_0x26649a){logger[_0x7897('0xe')](_0x7897('0xf'),_0x16d5b4,'request\x20sent');logger[_0x7897('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x16d5b4,_0x7897('0x11'),JSON[_0x7897('0x12')](_0x26649a));if(_0x26649a[_0x7897('0x13')]){if(_0x26649a[_0x7897('0x13')][_0x7897('0x14')]===0x1f4){logger[_0x7897('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x16d5b4,_0x26649a[_0x7897('0x13')][_0x7897('0x15')]);return _0x1df93a(_0x26649a['error'][_0x7897('0x15')]);}logger[_0x7897('0x13')](_0x7897('0xf'),_0x16d5b4,_0x26649a[_0x7897('0x13')][_0x7897('0x15')]);return _0x326d97(_0x26649a[_0x7897('0x13')]['message']);}else{logger[_0x7897('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x16d5b4,_0x7897('0x11'));_0x326d97(_0x26649a[_0x7897('0x16')]['message']);}})[_0x7897('0x17')](function(_0x99fdb3){logger[_0x7897('0x13')](_0x7897('0xf'),_0x16d5b4,_0x99fdb3);_0x1df93a(_0x99fdb3);});});}exports[_0x7897('0x18')]=function(_0x3748c5){var _0x51ba15=this;return new Promise(function(_0x58c958,_0x256737){return db[_0x7897('0x19')][_0x7897('0x1a')]({'raw':!![],'where':{'ContactId':_0x3748c5[_0x7897('0x1b')][_0x7897('0x1c')],'ListId':_0x3748c5['body'][_0x7897('0x1d')],'VoiceQueueId':_0x3748c5[_0x7897('0x1b')][_0x7897('0x1e')]===undefined?null:_0x3748c5[_0x7897('0x1b')]['VoiceQueueId'],'CampaignId':_0x3748c5['body']['CampaignId']===undefined?null:_0x3748c5[_0x7897('0x1b')]['CampaignId']}})[_0x7897('0xd')](function(_0x2fffab){if(_0x2fffab!=null){return db[_0x7897('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2fffab['id'],'OrderBy':{'$gt':_0x2fffab[_0x7897('0x20')]}},'order':[[_0x7897('0x20'),_0x7897('0x21')]]})['then'](function(_0x1894f0){var _0x109fa5=0x0;if(_0x1894f0){if(_0x1894f0['countbusyretry']+_0x1894f0[_0x7897('0x22')]+_0x1894f0[_0x7897('0x23')]+_0x1894f0[_0x7897('0x24')]+_0x1894f0[_0x7897('0x25')]+_0x1894f0[_0x7897('0x26')]+_0x1894f0[_0x7897('0x27')]+_0x1894f0[_0x7897('0x28')]<_0x3748c5['entity'][_0x7897('0x29')])_0x109fa5=0x1;_0x58c958({'additional':_0x109fa5});}else{return db[_0x7897('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2fffab['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x13819a){var _0x4dfe9f=0x0;if(_0x13819a){if(_0x13819a[_0x7897('0x2a')]+_0x13819a['countcongestionretry']+_0x13819a[_0x7897('0x23')]+_0x13819a[_0x7897('0x24')]+_0x13819a[_0x7897('0x25')]+_0x13819a[_0x7897('0x26')]+_0x13819a[_0x7897('0x27')]+_0x13819a[_0x7897('0x28')]<_0x3748c5[_0x7897('0x2b')][_0x7897('0x29')])_0x4dfe9f=0x1;_0x58c958({'additional':_0x4dfe9f});}else{_0x58c958({'additional':0x0});}})[_0x7897('0x17')](function(_0x524630){logger['error'](_0x7897('0x18'),_0x524630[_0x7897('0x15')]);_0x256737(_0x51ba15['error'](0x1f4,_0x524630[_0x7897('0x15')]));});}})[_0x7897('0x17')](function(_0x403e61){logger[_0x7897('0x13')](_0x7897('0x18'),_0x403e61[_0x7897('0x15')]);_0x256737(_0x51ba15[_0x7897('0x13')](0x1f4,_0x403e61[_0x7897('0x15')]));});}else _0x58c958({'additional':0x0});});});};exports[_0x7897('0x2c')]=function(_0x51aee8){var _0x28df52=this;return new Promise(function(_0x2424af,_0x4d1414){return db['CmHopper'][_0x7897('0x1a')]({'raw':!![],'where':{'ContactId':_0x51aee8[_0x7897('0x1b')][_0x7897('0x1c')],'ListId':_0x51aee8[_0x7897('0x1b')]['ListId'],'VoiceQueueId':_0x51aee8[_0x7897('0x1b')][_0x7897('0x1e')]===undefined?null:_0x51aee8[_0x7897('0x1b')][_0x7897('0x1e')],'CampaignId':_0x51aee8[_0x7897('0x1b')][_0x7897('0x2d')]===undefined?null:_0x51aee8[_0x7897('0x1b')]['CampaignId']}})[_0x7897('0xd')](function(_0x4e4c8f){if(_0x4e4c8f!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4e4c8f['id'],'OrderBy':{'$gte':_0x4e4c8f['OrderBy']}},'order':[[_0x7897('0x20'),_0x7897('0x21')]]})[_0x7897('0xd')](function(_0x1fb416){if(_0x1fb416)return activateAdditionalPhone(_0x4e4c8f,_0x51aee8[_0x7897('0x1b')],_0x1fb416,_0x51aee8[_0x7897('0x2e')],_0x51aee8[_0x7897('0x2f')])[_0x7897('0xd')](function(_0xf68a0b){_0x2424af(_0xf68a0b);});else{return db[_0x7897('0x1f')][_0x7897('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x4e4c8f['id']},'order':[['OrderBy','ASC']]})[_0x7897('0xd')](function(_0x48c4fa){if(_0x48c4fa)return activateAdditionalPhone(_0x4e4c8f,_0x51aee8[_0x7897('0x1b')],_0x48c4fa,_0x51aee8[_0x7897('0x2e')],_0x51aee8[_0x7897('0x2f')])[_0x7897('0xd')](function(_0x2cc570){_0x2424af(_0x2cc570);});else{_0x2424af({'id':_0x4e4c8f['id'],'phone':''});}})['catch'](function(_0x3ee7ca){logger['error'](_0x7897('0x18'),_0x3ee7ca[_0x7897('0x15')]);_0x4d1414(_0x28df52[_0x7897('0x13')](0x1f4,_0x3ee7ca[_0x7897('0x15')]));});}})[_0x7897('0x17')](function(_0xf51205){logger[_0x7897('0x13')](_0x7897('0x18'),_0xf51205['message']);_0x4d1414(_0x28df52[_0x7897('0x13')](0x1f4,_0xf51205[_0x7897('0x15')]));});}else _0x2424af(0x1);});});};function activateAdditionalPhone(_0x588451,_0x21e342,_0x5a992d,_0x4704e1,_0x26b161){return new Promise(function(_0x335a41,_0x1af0b6){var _0x291c06;if(_['isNil'](_0x5a992d[_0x7897('0x30')])){_0x5a992d['scheduledat']=moment();}if(moment()>moment(_0x5a992d[_0x7897('0x30')])){_0x291c06=moment()[_0x7897('0x31')](_0x26b161||0x3,_0x7897('0x32'));}else{if(_0x5a992d[_0x7897('0x20')]==0x0){_0x291c06=moment(_0x5a992d[_0x7897('0x30')]);}else{_0x291c06=moment()[_0x7897('0x31')](_0x26b161||0x3,'minutes');}}if(_[_0x7897('0x33')](_0x291c06)){_0x291c06=moment()[_0x7897('0x31')](_0x26b161||0x3,_0x7897('0x32'));}var _0x3e4c96={'phone':_0x588451['phone'],'active':0x0,'OrderBy':_[_0x7897('0x33')](_0x588451[_0x7897('0x20')])?0x0:_0x588451['OrderBy'],'scheduledat':moment()[_0x7897('0x31')](_0x4704e1||0x1,_0x7897('0x32')),'countbusyretry':_0x21e342[_0x7897('0x2a')],'countcongestionretry':_0x21e342[_0x7897('0x22')],'countnoanswerretry':_0x21e342[_0x7897('0x23')],'countnosuchnumberretry':_0x21e342[_0x7897('0x24')],'countdropretry':_0x21e342[_0x7897('0x25')],'countabandonedretry':_0x21e342[_0x7897('0x26')],'countmachineretry':_0x21e342[_0x7897('0x27')],'countagentrejectretry':_0x21e342[_0x7897('0x28')],'createdAt':_0x21e342[_0x7897('0x34')],'updatedAt':_0x21e342[_0x7897('0x35')]};var _0xe0f851={'CmHopperId':_0x588451['id'],'phone':_0x5a992d[_0x7897('0x36')],'active':0x0,'OrderBy':_[_0x7897('0x33')](_0x5a992d['OrderBy'])?0x0:_0x5a992d[_0x7897('0x20')],'scheduledat':_0x291c06,'countbusyretry':_0x5a992d[_0x7897('0x2a')],'countcongestionretry':_0x5a992d[_0x7897('0x22')],'countnoanswerretry':_0x5a992d[_0x7897('0x23')],'countnosuchnumberretry':_0x5a992d[_0x7897('0x24')],'countdropretry':_0x5a992d[_0x7897('0x25')],'countabandonedretry':_0x5a992d[_0x7897('0x26')],'countmachineretry':_0x5a992d[_0x7897('0x27')],'countagentrejectretry':_0x5a992d[_0x7897('0x28')],'createdAt':_0x5a992d[_0x7897('0x34')],'updatedAt':_0x5a992d[_0x7897('0x35')]};return db[_0x7897('0x37')][_0x7897('0x38')](function(_0x17d2c9){return db[_0x7897('0x1f')][_0x7897('0x39')](_0x3e4c96,{'where':{'id':_0x5a992d['id']}},{'transaction':_0x17d2c9})[_0x7897('0xd')](function(){return db[_0x7897('0x19')]['update'](_0xe0f851,{'where':{'id':_0x588451['id']}},{'transaction':_0x17d2c9});});})[_0x7897('0xd')](function(_0x2d5761){_0x335a41({'id':_0x588451['id'],'phone':_0x5a992d[_0x7897('0x36')]});})[_0x7897('0x17')](function(_0x45ab73){logger[_0x7897('0x13')]('activateAdditionalPhone',_0x45ab73['message']);_0x1af0b6({'error':_0x45ab73['message']});});});}exports[_0x7897('0x3a')]=function(_0x830ab4){var _0x3c1b18=this;return new Promise(function(_0x51876c,_0x17d196){return db['CmHopper'][_0x7897('0x39')](_0x830ab4[_0x7897('0x1b')]['field'],{'where':{'id':_0x830ab4['body']['id']}})[_0x7897('0xd')](function(_0x28fe10){_0x51876c(_0x28fe10);})[_0x7897('0x17')](function(_0x5a03b8){logger[_0x7897('0x13')](_0x7897('0x3a'),_0x5a03b8[_0x7897('0x15')]);_0x17d196(_0x3c1b18[_0x7897('0x13')](0x1f4,_0x5a03b8[_0x7897('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 06f2f60..c04b9a0 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 _0xbc5e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x10153f,_0x165bd6){var _0x42b00d=function(_0x40fca0){while(--_0x40fca0){_0x10153f['push'](_0x10153f['shift']());}};_0x42b00d(++_0x165bd6);}(_0xbc5e,0x7d));var _0xebc5=function(_0x26cb84,_0x59462a){_0x26cb84=_0x26cb84-0x0;var _0x4d54fa=_0xbc5e[_0x26cb84];return _0x4d54fa;};'use strict';var multer=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var path=require(_0xebc5('0x2'));var timeout=require(_0xebc5('0x3'));var express=require(_0xebc5('0x4'));var router=express[_0xebc5('0x5')]();var fs_extra=require(_0xebc5('0x6'));var auth=require(_0xebc5('0x7'));var interaction=require(_0xebc5('0x8'));var config=require('../../config/environment');var controller=require(_0xebc5('0x9'));router[_0xebc5('0xa')]('/',auth[_0xebc5('0xb')](),controller[_0xebc5('0xc')]);router[_0xebc5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xebc5('0xd')]);router[_0xebc5('0xe')]('/',auth[_0xebc5('0xb')](),controller[_0xebc5('0xf')]);router['put'](_0xebc5('0x10'),auth['isAuthenticated'](),controller[_0xebc5('0x11')]);router[_0xebc5('0x12')]('/:id',auth[_0xebc5('0xb')](),controller[_0xebc5('0x13')]);module[_0xebc5('0x14')]=router; \ No newline at end of file +var _0xc175=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc175,0x196));var _0x5c17=function(_0x256550,_0x305f89){_0x256550=_0x256550-0x0;var _0x27066c=_0xc175[_0x256550];return _0x27066c;};'use strict';var multer=require(_0x5c17('0x0'));var util=require(_0x5c17('0x1'));var path=require(_0x5c17('0x2'));var timeout=require(_0x5c17('0x3'));var express=require(_0x5c17('0x4'));var router=express[_0x5c17('0x5')]();var fs_extra=require(_0x5c17('0x6'));var auth=require(_0x5c17('0x7'));var interaction=require(_0x5c17('0x8'));var config=require(_0x5c17('0x9'));var controller=require(_0x5c17('0xa'));router[_0x5c17('0xb')]('/',auth[_0x5c17('0xc')](),controller['index']);router[_0x5c17('0xb')](_0x5c17('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5c17('0xe')]('/',auth[_0x5c17('0xc')](),controller[_0x5c17('0xf')]);router[_0x5c17('0x10')](_0x5c17('0xd'),auth[_0x5c17('0xc')](),controller[_0x5c17('0x11')]);router[_0x5c17('0x12')](_0x5c17('0xd'),auth[_0x5c17('0xc')](),controller[_0x5c17('0x13')]);module[_0x5c17('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 91dbf08..e90cae4 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 _0x84cb=['moment','exports','INTEGER','contactListQueue'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x84cb,0xf8));var _0xb84c=function(_0x22bf60,_0x21611c){_0x22bf60=_0x22bf60-0x0;var _0x42ed96=_0x84cb[_0x22bf60];return _0x42ed96;};'use strict';var moment=require(_0xb84c('0x0'));var Sequelize=require('sequelize');module[_0xb84c('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb84c('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb84c('0x2')],'unique':_0xb84c('0x3')},'VoiceQueueId':{'type':Sequelize[_0xb84c('0x2')],'unique':_0xb84c('0x3')}}; \ No newline at end of file +var _0xe57d=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x3361db,_0x4b4f9e){var _0x3f4a8b=function(_0x18f24b){while(--_0x18f24b){_0x3361db['push'](_0x3361db['shift']());}};_0x3f4a8b(++_0x4b4f9e);}(_0xe57d,0xd7));var _0xde57=function(_0x463dfd,_0x4d92a3){_0x463dfd=_0x463dfd-0x0;var _0xc434ee=_0xe57d[_0x463dfd];return _0xc434ee;};'use strict';var moment=require(_0xde57('0x0'));var Sequelize=require('sequelize');module[_0xde57('0x1')]={'phone':{'type':Sequelize[_0xde57('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xde57('0x3')],'unique':_0xde57('0x4')},'VoiceQueueId':{'type':Sequelize[_0xde57('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 239d98c..6ee128b 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 _0x8544=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','CmHopperBlack','fieldName','key','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','model','find','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x482686,_0x24b099){var _0x401d43=function(_0x54000e){while(--_0x54000e){_0x482686['push'](_0x482686['shift']());}};_0x401d43(++_0x24b099);}(_0x8544,0x11c));var _0x4854=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x8544[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0x4854('0x0'));var rimraf=require(_0x4854('0x1'));var zipdir=require(_0x4854('0x2'));var jsonpatch=require(_0x4854('0x3'));var rp=require('request-promise');var moment=require(_0x4854('0x4'));var BPromise=require(_0x4854('0x5'));var Mustache=require(_0x4854('0x6'));var util=require(_0x4854('0x7'));var path=require(_0x4854('0x8'));var sox=require(_0x4854('0x9'));var csv=require(_0x4854('0xa'));var ejs=require(_0x4854('0xb'));var fs=require('fs');var fs_extra=require(_0x4854('0xc'));var _=require(_0x4854('0xd'));var squel=require(_0x4854('0xe'));var crypto=require(_0x4854('0xf'));var jsforce=require(_0x4854('0x10'));var deskjs=require(_0x4854('0x11'));var toCsv=require(_0x4854('0xa'));var querystring=require(_0x4854('0x12'));var Papa=require('papaparse');var Redis=require(_0x4854('0x13'));var authService=require(_0x4854('0x14'));var qs=require(_0x4854('0x15'));var as=require(_0x4854('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4854('0x17'))(_0x4854('0x18'));var utils=require(_0x4854('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4854('0x1a'));var db=require(_0x4854('0x1b'))['db'];function respondWithStatusCode(_0x26dbfd,_0x1f9c2b){_0x1f9c2b=_0x1f9c2b||0xcc;return function(_0x132796){if(_0x132796){return _0x26dbfd[_0x4854('0x1c')](_0x1f9c2b);}return _0x26dbfd[_0x4854('0x1d')](_0x1f9c2b)[_0x4854('0x1e')]();};}function respondWithResult(_0x59ecac,_0x383580){_0x383580=_0x383580||0xc8;return function(_0xd43a02){if(_0xd43a02){return _0x59ecac[_0x4854('0x1d')](_0x383580)['json'](_0xd43a02);}};}function respondWithFilteredResult(_0x4d25e1,_0x5aeafe){return function(_0x5efaed){if(_0x5efaed){var _0x3b80cf=typeof _0x5aeafe[_0x4854('0x1f')]===_0x4854('0x20')&&typeof _0x5aeafe[_0x4854('0x21')]===_0x4854('0x20');var _0x514b32=_0x5efaed[_0x4854('0x22')];var _0x10fbd2=_0x3b80cf?0x0:_0x5aeafe[_0x4854('0x1f')];var _0x2e7ecd=_0x3b80cf?_0x5efaed[_0x4854('0x22')]:_0x5aeafe[_0x4854('0x1f')]+_0x5aeafe[_0x4854('0x21')];var _0xe93230;if(_0x2e7ecd>=_0x514b32){_0x2e7ecd=_0x514b32;_0xe93230=0xc8;}else{_0xe93230=0xce;}_0x4d25e1[_0x4854('0x1d')](_0xe93230);return _0x4d25e1[_0x4854('0x23')](_0x4854('0x24'),_0x10fbd2+'-'+_0x2e7ecd+'/'+_0x514b32)['json'](_0x5efaed);}return null;};}function patchUpdates(_0x4eb4ea){return function(_0x2c27f1){try{jsonpatch[_0x4854('0x25')](_0x2c27f1,_0x4eb4ea,!![]);}catch(_0x2c1dc5){return BPromise[_0x4854('0x26')](_0x2c1dc5);}return _0x2c27f1[_0x4854('0x27')]();};}function saveUpdates(_0x5026f5,_0x101803){return function(_0x3ad899){if(_0x3ad899){return _0x3ad899['update'](_0x5026f5)[_0x4854('0x28')](function(_0x4d29f4){return _0x4d29f4;});}return null;};}function removeEntity(_0x549456,_0x337d67){return function(_0x24336b){if(_0x24336b){return _0x24336b[_0x4854('0x29')]()[_0x4854('0x28')](function(){_0x549456[_0x4854('0x1d')](0xcc)[_0x4854('0x1e')]();});}};}function handleEntityNotFound(_0x1f1df2,_0x1f275d){return function(_0x4a5e08){if(!_0x4a5e08){_0x1f1df2[_0x4854('0x1c')](0x194);}return _0x4a5e08;};}function handleError(_0x40205b,_0x249c10){_0x249c10=_0x249c10||0x1f4;return function(_0xc2335){logger[_0x4854('0x2a')](_0xc2335[_0x4854('0x2b')]);if(_0xc2335[_0x4854('0x2c')]){delete _0xc2335[_0x4854('0x2c')];}_0x40205b[_0x4854('0x1d')](_0x249c10)[_0x4854('0x2d')](_0xc2335);};}exports[_0x4854('0x2e')]=function(_0x1f401e,_0x586cf4){var _0x1ebf15={},_0x139444={},_0x4ab15b={'count':0x0,'rows':[]};var _0x40a655=_['map'](db[_0x4854('0x2f')]['rawAttributes'],function(_0x17c82a){return{'name':_0x17c82a[_0x4854('0x30')],'type':_0x17c82a['type'][_0x4854('0x31')]};});_0x139444['model']=_[_0x4854('0x32')](_0x40a655,_0x4854('0x2c'));_0x139444['query']=_[_0x4854('0x33')](_0x1f401e[_0x4854('0x34')]);_0x139444[_0x4854('0x35')]=_[_0x4854('0x36')](_0x139444['model'],_0x139444[_0x4854('0x34')]);_0x1ebf15[_0x4854('0x37')]=_['intersection'](_0x139444['model'],qs[_0x4854('0x38')](_0x1f401e['query'][_0x4854('0x38')]));_0x1ebf15[_0x4854('0x37')]=_0x1ebf15[_0x4854('0x37')][_0x4854('0x39')]?_0x1ebf15['attributes']:_0x139444['model'];if(!_0x1f401e[_0x4854('0x34')][_0x4854('0x3a')](_0x4854('0x3b'))){_0x1ebf15[_0x4854('0x21')]=qs[_0x4854('0x21')](_0x1f401e[_0x4854('0x34')][_0x4854('0x21')]);_0x1ebf15[_0x4854('0x1f')]=qs[_0x4854('0x1f')](_0x1f401e['query'][_0x4854('0x1f')]);}_0x1ebf15['order']=qs[_0x4854('0x3c')](_0x1f401e[_0x4854('0x34')][_0x4854('0x3c')]);_0x1ebf15[_0x4854('0x3d')]=qs[_0x4854('0x35')](_[_0x4854('0x3e')](_0x1f401e[_0x4854('0x34')],_0x139444[_0x4854('0x35')]),_0x40a655);if(_0x1f401e[_0x4854('0x34')][_0x4854('0x3f')]){_0x1ebf15[_0x4854('0x3d')]=_[_0x4854('0x40')](_0x1ebf15[_0x4854('0x3d')],{'$or':_[_0x4854('0x32')](_0x40a655,function(_0x1b1975){if(_0x1b1975[_0x4854('0x41')]!==_0x4854('0x42')){var _0xf9fbb3={};_0xf9fbb3[_0x1b1975[_0x4854('0x2c')]]={'$like':'%'+_0x1f401e['query']['filter']+'%'};return _0xf9fbb3;}})});}_0x1ebf15=_[_0x4854('0x40')]({},_0x1ebf15,_0x1f401e[_0x4854('0x43')]);var _0x433e7f={'where':_0x1ebf15[_0x4854('0x3d')]};return db[_0x4854('0x2f')][_0x4854('0x22')](_0x433e7f)[_0x4854('0x28')](function(_0x1b18ec){_0x4ab15b['count']=_0x1b18ec;if(_0x1f401e[_0x4854('0x34')][_0x4854('0x44')]){_0x1ebf15[_0x4854('0x45')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1ebf15);})[_0x4854('0x28')](function(_0x3c5969){_0x4ab15b[_0x4854('0x46')]=_0x3c5969;return _0x4ab15b;})[_0x4854('0x28')](respondWithFilteredResult(_0x586cf4,_0x1ebf15))[_0x4854('0x47')](handleError(_0x586cf4,null));};exports[_0x4854('0x48')]=function(_0x4e5c9d,_0x44e881){var _0x36204d={'raw':!![],'where':{'id':_0x4e5c9d['params']['id']}},_0x213039={};_0x213039[_0x4854('0x49')]=_[_0x4854('0x33')](db[_0x4854('0x2f')]['rawAttributes']);_0x213039[_0x4854('0x34')]=_[_0x4854('0x33')](_0x4e5c9d['query']);_0x213039[_0x4854('0x35')]=_[_0x4854('0x36')](_0x213039['model'],_0x213039['query']);_0x36204d['attributes']=_[_0x4854('0x36')](_0x213039['model'],qs[_0x4854('0x38')](_0x4e5c9d[_0x4854('0x34')][_0x4854('0x38')]));_0x36204d[_0x4854('0x37')]=_0x36204d[_0x4854('0x37')][_0x4854('0x39')]?_0x36204d['attributes']:_0x213039['model'];if(_0x4e5c9d['query'][_0x4854('0x44')]){_0x36204d[_0x4854('0x45')]=[{'all':!![]}];}_0x36204d=_[_0x4854('0x40')]({},_0x36204d,_0x4e5c9d['options']);return db['CmHopperBlack'][_0x4854('0x4a')](_0x36204d)[_0x4854('0x28')](handleEntityNotFound(_0x44e881,null))[_0x4854('0x28')](respondWithResult(_0x44e881,null))[_0x4854('0x47')](handleError(_0x44e881,null));};exports[_0x4854('0x4b')]=function(_0x478d9e,_0x17530d){if(_0x478d9e['body']['id']){delete _0x478d9e['body']['id'];}return db[_0x4854('0x2f')][_0x4854('0x4a')]({'where':{'id':_0x478d9e[_0x4854('0x4c')]['id']}})[_0x4854('0x28')](handleEntityNotFound(_0x17530d,null))[_0x4854('0x28')](saveUpdates(_0x478d9e['body'],null))[_0x4854('0x28')](respondWithResult(_0x17530d,null))[_0x4854('0x47')](handleError(_0x17530d,null));};exports[_0x4854('0x29')]=function(_0x4c1e54,_0x23138e){return db[_0x4854('0x2f')]['find']({'where':{'id':_0x4c1e54['params']['id']}})[_0x4854('0x28')](handleEntityNotFound(_0x23138e,null))[_0x4854('0x28')](removeEntity(_0x23138e,null))[_0x4854('0x47')](handleError(_0x23138e,null));};exports[_0x4854('0x4d')]=function(_0x2056fd,_0x4a3727){return db[_0x4854('0x2f')][_0x4854('0x4d')]()[_0x4854('0x28')](respondWithResult(_0x4a3727,null))[_0x4854('0x47')](handleError(_0x4a3727,null));}; \ No newline at end of file +var _0x80f0=['fieldName','type','key','map','query','filters','model','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','CmHopperBlack','rawAttributes'];(function(_0x12a0a3,_0x2652d1){var _0x1c47c4=function(_0x22261b){while(--_0x22261b){_0x12a0a3['push'](_0x12a0a3['shift']());}};_0x1c47c4(++_0x2652d1);}(_0x80f0,0xfe));var _0x080f=function(_0x4f436c,_0x32f0da){_0x4f436c=_0x4f436c-0x0;var _0x39dea0=_0x80f0[_0x4f436c];return _0x39dea0;};'use strict';var emlformat=require(_0x080f('0x0'));var rimraf=require(_0x080f('0x1'));var zipdir=require(_0x080f('0x2'));var jsonpatch=require(_0x080f('0x3'));var rp=require(_0x080f('0x4'));var moment=require('moment');var BPromise=require(_0x080f('0x5'));var Mustache=require(_0x080f('0x6'));var util=require('util');var path=require(_0x080f('0x7'));var sox=require(_0x080f('0x8'));var csv=require(_0x080f('0x9'));var ejs=require(_0x080f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x080f('0xb'));var squel=require('squel');var crypto=require(_0x080f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x080f('0xd'));var toCsv=require(_0x080f('0x9'));var querystring=require(_0x080f('0xe'));var Papa=require(_0x080f('0xf'));var Redis=require(_0x080f('0x10'));var authService=require(_0x080f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x080f('0x12'));var logger=require(_0x080f('0x13'))(_0x080f('0x14'));var utils=require(_0x080f('0x15'));var config=require(_0x080f('0x16'));var licenseUtil=require(_0x080f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x317107,_0x38d9dd){_0x38d9dd=_0x38d9dd||0xcc;return function(_0x36a752){if(_0x36a752){return _0x317107['sendStatus'](_0x38d9dd);}return _0x317107[_0x080f('0x18')](_0x38d9dd)[_0x080f('0x19')]();};}function respondWithResult(_0x2ed0ea,_0x1dbdf8){_0x1dbdf8=_0x1dbdf8||0xc8;return function(_0x1bac1e){if(_0x1bac1e){return _0x2ed0ea[_0x080f('0x18')](_0x1dbdf8)[_0x080f('0x1a')](_0x1bac1e);}};}function respondWithFilteredResult(_0x442d54,_0xd08c71){return function(_0x732893){if(_0x732893){var _0x5a8969=typeof _0xd08c71[_0x080f('0x1b')]===_0x080f('0x1c')&&typeof _0xd08c71[_0x080f('0x1d')]===_0x080f('0x1c');var _0x344256=_0x732893[_0x080f('0x1e')];var _0x37e57c=_0x5a8969?0x0:_0xd08c71[_0x080f('0x1b')];var _0x2fdd91=_0x5a8969?_0x732893[_0x080f('0x1e')]:_0xd08c71[_0x080f('0x1b')]+_0xd08c71[_0x080f('0x1d')];var _0x4326cc;if(_0x2fdd91>=_0x344256){_0x2fdd91=_0x344256;_0x4326cc=0xc8;}else{_0x4326cc=0xce;}_0x442d54[_0x080f('0x18')](_0x4326cc);return _0x442d54[_0x080f('0x1f')](_0x080f('0x20'),_0x37e57c+'-'+_0x2fdd91+'/'+_0x344256)[_0x080f('0x1a')](_0x732893);}return null;};}function patchUpdates(_0x7ea4c2){return function(_0x1903f8){try{jsonpatch[_0x080f('0x21')](_0x1903f8,_0x7ea4c2,!![]);}catch(_0x2acabf){return BPromise[_0x080f('0x22')](_0x2acabf);}return _0x1903f8[_0x080f('0x23')]();};}function saveUpdates(_0x35a2ad,_0x4b274b){return function(_0x183cc7){if(_0x183cc7){return _0x183cc7[_0x080f('0x24')](_0x35a2ad)[_0x080f('0x25')](function(_0x1a180d){return _0x1a180d;});}return null;};}function removeEntity(_0x31d940,_0x1b06f1){return function(_0x19f27f){if(_0x19f27f){return _0x19f27f[_0x080f('0x26')]()['then'](function(){_0x31d940[_0x080f('0x18')](0xcc)[_0x080f('0x19')]();});}};}function handleEntityNotFound(_0xa2841e,_0x39816c){return function(_0x427ba0){if(!_0x427ba0){_0xa2841e[_0x080f('0x27')](0x194);}return _0x427ba0;};}function handleError(_0x256363,_0x5e32eb){_0x5e32eb=_0x5e32eb||0x1f4;return function(_0x3dfc4c){logger[_0x080f('0x28')](_0x3dfc4c['stack']);if(_0x3dfc4c[_0x080f('0x29')]){delete _0x3dfc4c['name'];}_0x256363['status'](_0x5e32eb)[_0x080f('0x2a')](_0x3dfc4c);};}exports[_0x080f('0x2b')]=function(_0x54a5ad,_0x243ba4){var _0x137b7f={},_0x5440cb={},_0x408745={'count':0x0,'rows':[]};var _0x17ee74=_['map'](db[_0x080f('0x2c')][_0x080f('0x2d')],function(_0x3c9d76){return{'name':_0x3c9d76[_0x080f('0x2e')],'type':_0x3c9d76[_0x080f('0x2f')][_0x080f('0x30')]};});_0x5440cb['model']=_[_0x080f('0x31')](_0x17ee74,_0x080f('0x29'));_0x5440cb[_0x080f('0x32')]=_['keys'](_0x54a5ad['query']);_0x5440cb[_0x080f('0x33')]=_['intersection'](_0x5440cb[_0x080f('0x34')],_0x5440cb[_0x080f('0x32')]);_0x137b7f['attributes']=_[_0x080f('0x35')](_0x5440cb['model'],qs[_0x080f('0x36')](_0x54a5ad[_0x080f('0x32')][_0x080f('0x36')]));_0x137b7f['attributes']=_0x137b7f['attributes'][_0x080f('0x37')]?_0x137b7f[_0x080f('0x38')]:_0x5440cb[_0x080f('0x34')];if(!_0x54a5ad[_0x080f('0x32')][_0x080f('0x39')]('nolimit')){_0x137b7f[_0x080f('0x1d')]=qs['limit'](_0x54a5ad[_0x080f('0x32')][_0x080f('0x1d')]);_0x137b7f[_0x080f('0x1b')]=qs['offset'](_0x54a5ad[_0x080f('0x32')][_0x080f('0x1b')]);}_0x137b7f[_0x080f('0x3a')]=qs[_0x080f('0x3b')](_0x54a5ad[_0x080f('0x32')][_0x080f('0x3b')]);_0x137b7f[_0x080f('0x3c')]=qs[_0x080f('0x33')](_[_0x080f('0x3d')](_0x54a5ad[_0x080f('0x32')],_0x5440cb[_0x080f('0x33')]),_0x17ee74);if(_0x54a5ad['query']['filter']){_0x137b7f[_0x080f('0x3c')]=_[_0x080f('0x3e')](_0x137b7f[_0x080f('0x3c')],{'$or':_[_0x080f('0x31')](_0x17ee74,function(_0x309c92){if(_0x309c92['type']!=='VIRTUAL'){var _0x24d973={};_0x24d973[_0x309c92[_0x080f('0x29')]]={'$like':'%'+_0x54a5ad[_0x080f('0x32')][_0x080f('0x3f')]+'%'};return _0x24d973;}})});}_0x137b7f=_[_0x080f('0x3e')]({},_0x137b7f,_0x54a5ad[_0x080f('0x40')]);var _0x5ef1da={'where':_0x137b7f['where']};return db[_0x080f('0x2c')][_0x080f('0x1e')](_0x5ef1da)[_0x080f('0x25')](function(_0x390673){_0x408745['count']=_0x390673;if(_0x54a5ad['query'][_0x080f('0x41')]){_0x137b7f[_0x080f('0x42')]=[{'all':!![]}];}return db[_0x080f('0x2c')][_0x080f('0x43')](_0x137b7f);})[_0x080f('0x25')](function(_0x310211){_0x408745[_0x080f('0x44')]=_0x310211;return _0x408745;})[_0x080f('0x25')](respondWithFilteredResult(_0x243ba4,_0x137b7f))[_0x080f('0x45')](handleError(_0x243ba4,null));};exports['show']=function(_0x192f29,_0x35ecff){var _0x79d9f4={'raw':!![],'where':{'id':_0x192f29[_0x080f('0x46')]['id']}},_0x4b1587={};_0x4b1587['model']=_[_0x080f('0x47')](db[_0x080f('0x2c')]['rawAttributes']);_0x4b1587['query']=_[_0x080f('0x47')](_0x192f29[_0x080f('0x32')]);_0x4b1587[_0x080f('0x33')]=_[_0x080f('0x35')](_0x4b1587[_0x080f('0x34')],_0x4b1587[_0x080f('0x32')]);_0x79d9f4[_0x080f('0x38')]=_[_0x080f('0x35')](_0x4b1587['model'],qs[_0x080f('0x36')](_0x192f29[_0x080f('0x32')][_0x080f('0x36')]));_0x79d9f4[_0x080f('0x38')]=_0x79d9f4[_0x080f('0x38')][_0x080f('0x37')]?_0x79d9f4[_0x080f('0x38')]:_0x4b1587[_0x080f('0x34')];if(_0x192f29[_0x080f('0x32')][_0x080f('0x41')]){_0x79d9f4['include']=[{'all':!![]}];}_0x79d9f4=_[_0x080f('0x3e')]({},_0x79d9f4,_0x192f29[_0x080f('0x40')]);return db[_0x080f('0x2c')][_0x080f('0x48')](_0x79d9f4)[_0x080f('0x25')](handleEntityNotFound(_0x35ecff,null))[_0x080f('0x25')](respondWithResult(_0x35ecff,null))[_0x080f('0x45')](handleError(_0x35ecff,null));};exports[_0x080f('0x24')]=function(_0x4b6035,_0x5d7f90){if(_0x4b6035[_0x080f('0x49')]['id']){delete _0x4b6035[_0x080f('0x49')]['id'];}return db['CmHopperBlack'][_0x080f('0x48')]({'where':{'id':_0x4b6035['params']['id']}})[_0x080f('0x25')](handleEntityNotFound(_0x5d7f90,null))[_0x080f('0x25')](saveUpdates(_0x4b6035[_0x080f('0x49')],null))[_0x080f('0x25')](respondWithResult(_0x5d7f90,null))[_0x080f('0x45')](handleError(_0x5d7f90,null));};exports[_0x080f('0x26')]=function(_0x12d73b,_0x2eb3d3){return db['CmHopperBlack'][_0x080f('0x48')]({'where':{'id':_0x12d73b['params']['id']}})[_0x080f('0x25')](handleEntityNotFound(_0x2eb3d3,null))[_0x080f('0x25')](removeEntity(_0x2eb3d3,null))['catch'](handleError(_0x2eb3d3,null));};exports[_0x080f('0x4a')]=function(_0x7d80ab,_0x3af273){return db[_0x080f('0x2c')][_0x080f('0x4a')]()['then'](respondWithResult(_0x3af273,null))['catch'](handleError(_0x3af273,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 2f1ac9f..33635a9 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 _0x0913=['./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x18dc32,_0x26d38e){var _0x2adfaf=function(_0x59f994){while(--_0x59f994){_0x18dc32['push'](_0x18dc32['shift']());}};_0x2adfaf(++_0x26d38e);}(_0x0913,0x7d));var _0x3091=function(_0x3738d7,_0x5e5fac){_0x3738d7=_0x3738d7-0x0;var _0x4315d9=_0x0913[_0x3738d7];return _0x4315d9;};'use strict';var _=require('lodash');var util=require(_0x3091('0x0'));var logger=require(_0x3091('0x1'))(_0x3091('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3091('0x3'));var fs=require('fs');var path=require(_0x3091('0x4'));var rimraf=require(_0x3091('0x5'));var config=require(_0x3091('0x6'));var attributes=require(_0x3091('0x7'));module['exports']=function(_0x4dd438,_0x259349){return _0x4dd438[_0x3091('0x8')](_0x3091('0x9'),attributes,{'tableName':_0x3091('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61a4=['define','cm_hopper_black','lodash','util','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x3c99ef,_0x50b107){var _0x17550c=function(_0x4ff16b){while(--_0x4ff16b){_0x3c99ef['push'](_0x3c99ef['shift']());}};_0x17550c(++_0x50b107);}(_0x61a4,0x12e));var _0x461a=function(_0x24c856,_0x3f863d){_0x24c856=_0x24c856-0x0;var _0x180327=_0x61a4[_0x24c856];return _0x180327;};'use strict';var _=require(_0x461a('0x0'));var util=require(_0x461a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x461a('0x2'));var BPromise=require('bluebird');var rp=require(_0x461a('0x3'));var fs=require('fs');var path=require(_0x461a('0x4'));var rimraf=require('rimraf');var config=require(_0x461a('0x5'));var attributes=require(_0x461a('0x6'));module[_0x461a('0x7')]=function(_0x39305f,_0x4b10ba){return _0x39305f[_0x461a('0x8')]('CmHopperBlack',attributes,{'tableName':_0x461a('0x9'),'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 a67a363..1e1b586 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 _0xd9c9=['error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','attributes','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd9c9,0xb5));var _0x9d9c=function(_0x224ad0,_0x2482bd){_0x224ad0=_0x224ad0-0x0;var _0x2e04fc=_0xd9c9[_0x224ad0];return _0x2e04fc;};'use strict';var _=require(_0x9d9c('0x0'));var util=require(_0x9d9c('0x1'));var moment=require(_0x9d9c('0x2'));var BPromise=require(_0x9d9c('0x3'));var rs=require(_0x9d9c('0x4'));var fs=require('fs');var Redis=require(_0x9d9c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d9c('0x6'));var logger=require(_0x9d9c('0x7'))(_0x9d9c('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d9c('0x9'));var client=jayson[_0x9d9c('0xa')][_0x9d9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x174238,_0x5b7dcb,_0x291355){return new BPromise(function(_0x407b3b,_0x5a7f06){return client[_0x9d9c('0xc')](_0x174238,_0x291355)[_0x9d9c('0xd')](function(_0x4e8632){logger[_0x9d9c('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x5b7dcb,_0x9d9c('0xf'));logger[_0x9d9c('0x10')](_0x9d9c('0x11'),_0x5b7dcb,_0x9d9c('0xf'),JSON[_0x9d9c('0x12')](_0x4e8632));if(_0x4e8632[_0x9d9c('0x13')]){if(_0x4e8632['error'][_0x9d9c('0x14')]===0x1f4){logger['error'](_0x9d9c('0x15'),_0x5b7dcb,_0x4e8632[_0x9d9c('0x13')][_0x9d9c('0x16')]);return _0x5a7f06(_0x4e8632[_0x9d9c('0x13')][_0x9d9c('0x16')]);}logger[_0x9d9c('0x13')](_0x9d9c('0x15'),_0x5b7dcb,_0x4e8632['error'][_0x9d9c('0x16')]);return _0x407b3b(_0x4e8632[_0x9d9c('0x13')][_0x9d9c('0x16')]);}else{logger['info'](_0x9d9c('0x15'),_0x5b7dcb,_0x9d9c('0xf'));_0x407b3b(_0x4e8632['result'][_0x9d9c('0x16')]);}})[_0x9d9c('0x17')](function(_0x5f1612){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5b7dcb,_0x5f1612);_0x5a7f06(_0x5f1612);});});}exports[_0x9d9c('0x18')]=function(_0x3799fa){var _0x4312d1=this;return new Promise(function(_0x5131f2,_0x14c22c){return db[_0x9d9c('0x19')][_0x9d9c('0x1a')]({'raw':_0x3799fa['options']?_0x3799fa[_0x9d9c('0x1b')][_0x9d9c('0x1c')]===undefined?!![]:![]:!![],'where':_0x3799fa[_0x9d9c('0x1b')]?_0x3799fa[_0x9d9c('0x1b')][_0x9d9c('0x1d')]||null:null,'attributes':_0x3799fa[_0x9d9c('0x1b')]?_0x3799fa['options']['attributes']||null:null,'limit':_0x3799fa[_0x9d9c('0x1b')]?_0x3799fa['options'][_0x9d9c('0x1e')]||null:null,'include':_0x3799fa[_0x9d9c('0x1b')]?_0x3799fa[_0x9d9c('0x1b')][_0x9d9c('0x1f')]?_[_0x9d9c('0x20')](_0x3799fa[_0x9d9c('0x1b')][_0x9d9c('0x1f')],function(_0x3ea50c){return{'model':db[_0x3ea50c['model']],'as':_0x3ea50c['as'],'attributes':_0x3ea50c[_0x9d9c('0x21')],'include':_0x3ea50c[_0x9d9c('0x1f')]?_[_0x9d9c('0x20')](_0x3ea50c[_0x9d9c('0x1f')],function(_0x38598e){return{'model':db[_0x38598e[_0x9d9c('0x22')]],'as':_0x38598e['as'],'attributes':_0x38598e[_0x9d9c('0x21')],'include':_0x38598e[_0x9d9c('0x1f')]?_[_0x9d9c('0x20')](_0x38598e['include'],function(_0x4b2881){return{'model':db[_0x4b2881[_0x9d9c('0x22')]],'as':_0x4b2881['as'],'attributes':_0x4b2881[_0x9d9c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9d9c('0xd')](function(_0x1b9711){logger[_0x9d9c('0xe')](_0x9d9c('0x18'),_0x3799fa);logger[_0x9d9c('0x10')](_0x9d9c('0x18'),_0x3799fa,JSON[_0x9d9c('0x12')](_0x1b9711));_0x5131f2(_0x1b9711);})[_0x9d9c('0x17')](function(_0x3ee25b){logger[_0x9d9c('0x13')](_0x9d9c('0x18'),_0x3ee25b[_0x9d9c('0x16')],_0x3799fa);_0x14c22c(_0x4312d1[_0x9d9c('0x13')](0x1f4,_0x3ee25b[_0x9d9c('0x16')]));});});};exports[_0x9d9c('0x23')]=function(_0x45d76e){var _0x545e3d=this;return new Promise(function(_0x4ab2a0,_0x24354f){return db[_0x9d9c('0x19')][_0x9d9c('0x24')](_0x45d76e[_0x9d9c('0x25')],{'raw':_0x45d76e['options']?_0x45d76e[_0x9d9c('0x1b')][_0x9d9c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45d76e[_0x9d9c('0x1b')]?_0x45d76e[_0x9d9c('0x1b')][_0x9d9c('0x1d')]||null:null,'attributes':_0x45d76e[_0x9d9c('0x1b')]?_0x45d76e[_0x9d9c('0x1b')][_0x9d9c('0x21')]||null:null,'limit':_0x45d76e[_0x9d9c('0x1b')]?_0x45d76e[_0x9d9c('0x1b')][_0x9d9c('0x1e')]||null:null})[_0x9d9c('0xd')](function(_0x297da5){logger['info'](_0x9d9c('0x23'),_0x45d76e);logger[_0x9d9c('0x10')]('UpdateCmHopperBlack',_0x45d76e,JSON[_0x9d9c('0x12')](_0x297da5));_0x4ab2a0(_0x297da5);})['catch'](function(_0x434ba0){logger[_0x9d9c('0x13')](_0x9d9c('0x23'),_0x434ba0[_0x9d9c('0x16')],_0x45d76e);_0x24354f(_0x545e3d['error'](0x1f4,_0x434ba0['message']));});});};exports[_0x9d9c('0x26')]=function(_0x33da8a){var _0x260aa8=this;return new Promise(function(_0x5d45f4,_0x226783){return db[_0x9d9c('0x19')][_0x9d9c('0x27')]({'where':_0x33da8a['options']?_0x33da8a[_0x9d9c('0x1b')][_0x9d9c('0x1d')]||null:null})[_0x9d9c('0xd')](function(_0x5e9b50){logger['info']('DestroyCmHopperBlack',_0x33da8a);logger[_0x9d9c('0x10')](_0x9d9c('0x26'),_0x33da8a,JSON[_0x9d9c('0x12')](_0x5e9b50));_0x5d45f4(_0x5e9b50);})[_0x9d9c('0x17')](function(_0x551da1){logger[_0x9d9c('0x13')]('DestroyCmHopperBlack',_0x551da1[_0x9d9c('0x16')],_0x33da8a);_0x226783(_0x260aa8['error'](0x1f4,_0x551da1[_0x9d9c('0x16')]));});});}; \ No newline at end of file +var _0x6339=['GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','info','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6339,0x165));var _0x9633=function(_0x11d354,_0x2e1f9c){_0x11d354=_0x11d354-0x0;var _0xc3f646=_0x6339[_0x11d354];return _0xc3f646;};'use strict';var _=require(_0x9633('0x0'));var util=require(_0x9633('0x1'));var moment=require('moment');var BPromise=require(_0x9633('0x2'));var rs=require(_0x9633('0x3'));var fs=require('fs');var Redis=require(_0x9633('0x4'));var db=require(_0x9633('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9633('0x6'))(_0x9633('0x7'));var config=require(_0x9633('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9633('0x9')][_0x9633('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ff995,_0x56dfd6,_0x29b71e){return new BPromise(function(_0x132202,_0x647808){return client[_0x9633('0xb')](_0x3ff995,_0x29b71e)[_0x9633('0xc')](function(_0x4851e2){logger['info'](_0x9633('0xd'),_0x56dfd6,'request\x20sent');logger[_0x9633('0xe')](_0x9633('0xf'),_0x56dfd6,_0x9633('0x10'),JSON[_0x9633('0x11')](_0x4851e2));if(_0x4851e2['error']){if(_0x4851e2[_0x9633('0x12')][_0x9633('0x13')]===0x1f4){logger[_0x9633('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x56dfd6,_0x4851e2[_0x9633('0x12')]['message']);return _0x647808(_0x4851e2[_0x9633('0x12')]['message']);}logger[_0x9633('0x12')](_0x9633('0xd'),_0x56dfd6,_0x4851e2['error'][_0x9633('0x14')]);return _0x132202(_0x4851e2['error']['message']);}else{logger['info'](_0x9633('0xd'),_0x56dfd6,_0x9633('0x10'));_0x132202(_0x4851e2[_0x9633('0x15')][_0x9633('0x14')]);}})[_0x9633('0x16')](function(_0x3a811b){logger[_0x9633('0x12')](_0x9633('0xd'),_0x56dfd6,_0x3a811b);_0x647808(_0x3a811b);});});}exports[_0x9633('0x17')]=function(_0x12a44b){var _0x48ff5d=this;return new Promise(function(_0x4ca72d,_0x4b081e){return db[_0x9633('0x18')]['findAll']({'raw':_0x12a44b['options']?_0x12a44b[_0x9633('0x19')][_0x9633('0x1a')]===undefined?!![]:![]:!![],'where':_0x12a44b[_0x9633('0x19')]?_0x12a44b[_0x9633('0x19')][_0x9633('0x1b')]||null:null,'attributes':_0x12a44b[_0x9633('0x19')]?_0x12a44b[_0x9633('0x19')][_0x9633('0x1c')]||null:null,'limit':_0x12a44b[_0x9633('0x19')]?_0x12a44b['options'][_0x9633('0x1d')]||null:null,'include':_0x12a44b[_0x9633('0x19')]?_0x12a44b[_0x9633('0x19')][_0x9633('0x1e')]?_[_0x9633('0x1f')](_0x12a44b[_0x9633('0x19')][_0x9633('0x1e')],function(_0x5a6782){return{'model':db[_0x5a6782[_0x9633('0x20')]],'as':_0x5a6782['as'],'attributes':_0x5a6782[_0x9633('0x1c')],'include':_0x5a6782[_0x9633('0x1e')]?_[_0x9633('0x1f')](_0x5a6782[_0x9633('0x1e')],function(_0x5fd89c){return{'model':db[_0x5fd89c[_0x9633('0x20')]],'as':_0x5fd89c['as'],'attributes':_0x5fd89c[_0x9633('0x1c')],'include':_0x5fd89c[_0x9633('0x1e')]?_[_0x9633('0x1f')](_0x5fd89c[_0x9633('0x1e')],function(_0x2e83bb){return{'model':db[_0x2e83bb[_0x9633('0x20')]],'as':_0x2e83bb['as'],'attributes':_0x2e83bb[_0x9633('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35e2d5){logger[_0x9633('0x21')]('GetCmHopperBlack',_0x12a44b);logger[_0x9633('0xe')]('GetCmHopperBlack',_0x12a44b,JSON[_0x9633('0x11')](_0x35e2d5));_0x4ca72d(_0x35e2d5);})[_0x9633('0x16')](function(_0x549d79){logger['error']('GetCmHopperBlack',_0x549d79[_0x9633('0x14')],_0x12a44b);_0x4b081e(_0x48ff5d[_0x9633('0x12')](0x1f4,_0x549d79['message']));});});};exports[_0x9633('0x22')]=function(_0xcd772e){var _0x28f34d=this;return new Promise(function(_0x2a0798,_0xfd5f9c){return db[_0x9633('0x18')][_0x9633('0x23')](_0xcd772e['body'],{'raw':_0xcd772e[_0x9633('0x19')]?_0xcd772e[_0x9633('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcd772e[_0x9633('0x19')]?_0xcd772e[_0x9633('0x19')][_0x9633('0x1b')]||null:null,'attributes':_0xcd772e[_0x9633('0x19')]?_0xcd772e[_0x9633('0x19')][_0x9633('0x1c')]||null:null,'limit':_0xcd772e[_0x9633('0x19')]?_0xcd772e[_0x9633('0x19')]['limit']||null:null})[_0x9633('0xc')](function(_0x32e2f3){logger[_0x9633('0x21')](_0x9633('0x22'),_0xcd772e);logger[_0x9633('0xe')]('UpdateCmHopperBlack',_0xcd772e,JSON[_0x9633('0x11')](_0x32e2f3));_0x2a0798(_0x32e2f3);})[_0x9633('0x16')](function(_0x14a088){logger[_0x9633('0x12')](_0x9633('0x22'),_0x14a088[_0x9633('0x14')],_0xcd772e);_0xfd5f9c(_0x28f34d[_0x9633('0x12')](0x1f4,_0x14a088[_0x9633('0x14')]));});});};exports[_0x9633('0x24')]=function(_0x5a8590){var _0x3a7012=this;return new Promise(function(_0x2a1e89,_0x10411d){return db[_0x9633('0x18')][_0x9633('0x25')]({'where':_0x5a8590['options']?_0x5a8590[_0x9633('0x19')][_0x9633('0x1b')]||null:null})[_0x9633('0xc')](function(_0x3d18a9){logger['info'](_0x9633('0x24'),_0x5a8590);logger[_0x9633('0xe')](_0x9633('0x24'),_0x5a8590,JSON[_0x9633('0x11')](_0x3d18a9));_0x2a1e89(_0x3d18a9);})['catch'](function(_0x5649f1){logger[_0x9633('0x12')](_0x9633('0x24'),_0x5649f1[_0x9633('0x14')],_0x5a8590);_0x10411d(_0x3a7012['error'](0x1f4,_0x5649f1['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index f0b9539..a6fee4a 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 _0xed1c=['describe','/:id','show','put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x42f7a2,_0xd5200d){var _0x588cc8=function(_0x58b167){while(--_0x58b167){_0x42f7a2['push'](_0x42f7a2['shift']());}};_0x588cc8(++_0xd5200d);}(_0xed1c,0xe4));var _0xced1=function(_0x4ca17a,_0x2423aa){_0x4ca17a=_0x4ca17a-0x0;var _0x1fc70d=_0xed1c[_0x4ca17a];return _0x1fc70d;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/:id',auth[_0xced1('0x7')](),controller['update']);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);module[_0xced1('0x10')]=router; \ No newline at end of file +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(_0x10564a,_0x320e0e){var _0x44d1a1=function(_0x17d664){while(--_0x17d664){_0x10564a['push'](_0x10564a['shift']());}};_0x44d1a1(++_0x320e0e);}(_0xabce,0x103));var _0xeabc=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xabce[_0x173d7e];return _0x2220d6;};'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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index e08a096..146bb15 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 _0x8213=['sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN'];(function(_0x3fa6ab,_0x3181e2){var _0x310f2c=function(_0x5a70dc){while(--_0x5a70dc){_0x3fa6ab['push'](_0x3fa6ab['shift']());}};_0x310f2c(++_0x3181e2);}(_0x8213,0x1b8));var _0x3821=function(_0x2c82d9,_0x17271f){_0x2c82d9=_0x2c82d9-0x0;var _0x37782e=_0x8213[_0x2c82d9];return _0x37782e;};'use strict';var Sequelize=require(_0x3821('0x0'));var moment=require('moment');module[_0x3821('0x1')]={'state':{'type':Sequelize[_0x3821('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3821('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x3821('0x3')]},'originatecalleridname':{'type':Sequelize[_0x3821('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3821('0x4')]},'responsetime':{'type':Sequelize[_0x3821('0x4')]},'answertime':{'type':Sequelize[_0x3821('0x4')]},'droptime':{'type':Sequelize[_0x3821('0x4')]},'endtime':{'type':Sequelize[_0x3821('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3821('0x3')]},'campaigntype':{'type':Sequelize[_0x3821('0x3')]},'membername':{'type':Sequelize[_0x3821('0x3')]},'reason':{'type':Sequelize[_0x3821('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3821('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3821('0x3')]},'dispositionat':{'type':Sequelize[_0x3821('0x4')],'set':function(_0x435dbd){var _0x351fa8=this[_0x3821('0x5')](_0x3821('0x6'));if(_0x351fa8&&_0x435dbd){this[_0x3821('0x7')]('followuptime',moment(_0x435dbd)[_0x3821('0x8')](moment(_0x351fa8),_0x3821('0x9')));}}},'amd':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3821('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3821('0x4')]},'deleted':{'type':Sequelize[_0x3821('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3821('0x4')]},'recallme':{'type':Sequelize[_0x3821('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3821('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3821('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xac18=['sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','BOOLEAN'];(function(_0x1578fb,_0x4798b6){var _0x87a9c1=function(_0x26ec67){while(--_0x26ec67){_0x1578fb['push'](_0x1578fb['shift']());}};_0x87a9c1(++_0x4798b6);}(_0xac18,0x64));var _0x8ac1=function(_0x552c10,_0xdbc90b){_0x552c10=_0x552c10-0x0;var _0x39c749=_0xac18[_0x552c10];return _0x39c749;};'use strict';var Sequelize=require(_0x8ac1('0x0'));var moment=require(_0x8ac1('0x1'));module['exports']={'state':{'type':Sequelize[_0x8ac1('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8ac1('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8ac1('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8ac1('0x3')]},'calleridname':{'type':Sequelize[_0x8ac1('0x3')]},'starttime':{'type':Sequelize[_0x8ac1('0x4')]},'responsetime':{'type':Sequelize[_0x8ac1('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8ac1('0x4')]},'endtime':{'type':Sequelize[_0x8ac1('0x4')]},'ringtime':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8ac1('0x3')]},'campaign':{'type':Sequelize[_0x8ac1('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8ac1('0x3')]},'disposition':{'type':Sequelize[_0x8ac1('0x3')]},'secondDisposition':{'type':Sequelize[_0x8ac1('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4f4cd9){var _0x443dc2=this[_0x8ac1('0x5')](_0x8ac1('0x6'));if(_0x443dc2&&_0x4f4cd9){this[_0x8ac1('0x7')](_0x8ac1('0x8'),moment(_0x4f4cd9)['diff'](moment(_0x443dc2),'seconds'));}}},'amd':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8ac1('0x4')]},'callback':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8ac1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8ac1('0x4')]},'deleted':{'type':Sequelize[_0x8ac1('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8ac1('0x4')]},'recallme':{'type':Sequelize[_0x8ac1('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8ac1('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8ac1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 8ba8cc8..9a37404 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 _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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'];(function(_0x42ab91,_0x2a0179){var _0x259d35=function(_0x2d48bf){while(--_0x2d48bf){_0x42ab91['push'](_0x42ab91['shift']());}};_0x259d35(++_0x2a0179);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x300e96,_0x329b01){_0x300e96=_0x300e96-0x0;var _0x3a4fe6=_0xfdbd[_0x300e96];return _0x3a4fe6;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file +var _0x4888=['ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','find','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','CmHopperFinal','includeAll','include','rows','catch','params','options','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ContactId'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x4888,0x198));var _0x8488=function(_0x32e77f,_0x14464d){_0x32e77f=_0x32e77f-0x0;var _0x47e651=_0x4888[_0x32e77f];return _0x47e651;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')]()[_0x8488('0x21')](respondWithResult(_0x1f0516,null))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x42')]=function(_0x886a9e,_0x299d8e){if(_0x886a9e[_0x8488('0x43')][_0x8488('0x44')]){delete _0x886a9e[_0x8488('0x43')][_0x8488('0x44')];}return db[_0x8488('0x3a')]['find']({'where':{'uniqueid':_0x886a9e['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x299d8e,null))[_0x8488('0x21')](saveUpdates(_0x886a9e[_0x8488('0x43')],null))[_0x8488('0x21')](respondWithResult(_0x299d8e,null))[_0x8488('0x3e')](handleError(_0x299d8e,null));};exports[_0x8488('0x45')]=function(_0x25f2dc,_0x27dfd2,_0x24fa20){return db['CmHopperFinal'][_0x8488('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x25f2dc[_0x8488('0x3f')]['id']},'attributes':[[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),_0x8488('0x4c')],[db['sequelize']['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x8488('0x4d')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x4f')))),'dropContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x52')))),_0x8488('0x53')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x27dfd2,null))[_0x8488('0x21')](respondWithResult(_0x27dfd2,null))[_0x8488('0x3e')](handleError(_0x27dfd2,null));};exports[_0x8488('0x55')]=function(_0x1971f3,_0x24ba2d,_0x4facfb){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x1971f3[_0x8488('0x3f')]['id']},'attributes':[[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x56')))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x57')))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8488('0x58')],[db[_0x8488('0x48')]['fn']('COUNT',db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x24ba2d,null))['then'](respondWithResult(_0x24ba2d,null))[_0x8488('0x3e')](handleError(_0x24ba2d,null));};exports[_0x8488('0x59')]=function(_0x44a50b,_0x5815cb,_0xbee86e){return db[_0x8488('0x5a')]['find']({'where':{'id':_0x44a50b['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x5815cb,null))[_0x8488('0x21')](function(_0xfedfd2){var _0x3ab1b6;if(_0xfedfd2){_0x3ab1b6=squel[_0x8488('0x5b')]()[_0x8488('0x5c')](_0x8488('0x5d'))[_0x8488('0x5e')]([_0x8488('0x5f'),_0x8488('0x60'),'ContactId',_0x8488('0x61'),'VoiceQueueId',_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')]('ANY_VALUE(calleridnum)',_0x8488('0x5f'))[_0x8488('0x65')]('NOW()',_0x8488('0x60'))['field'](_0x8488('0x66'),_0x8488('0x67'))[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x69'),_0x8488('0x6a'))['field'](_0x8488('0x6b'),'createdAt')['field'](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']())[_0x8488('0x35')](_0x8488('0x6e'),_0x44a50b[_0x8488('0x43')][_0x8488('0x6f')][_0x8488('0x70')]())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8488('0x35')](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x72'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x73')))[_0x8488('0x74')]('ContactId'))[_0x8488('0x70')]();return db['sequelize'][_0x8488('0x2c')](_0x3ab1b6);}return[];})['then'](respondWithResult(_0x5815cb,null))[_0x8488('0x3e')](handleError(_0x5815cb,null));};exports[_0x8488('0x75')]=function(_0x267401,_0x1e635a,_0x31ab35){return db[_0x8488('0x76')][_0x8488('0x77')]({'where':{'id':_0x267401[_0x8488('0x3f')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x1e635a,null))[_0x8488('0x21')](function(_0xce1d1a){var _0xc9c221;if(_0xce1d1a){_0xc9c221=squel[_0x8488('0x5b')]()[_0x8488('0x5c')]('cm_hopper')[_0x8488('0x5e')]([_0x8488('0x5f'),'scheduledAt',_0x8488('0x67'),_0x8488('0x61'),_0x8488('0x78'),_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x79'),_0x8488('0x5f'))[_0x8488('0x65')](_0x8488('0x6b'),'scheduledAt')[_0x8488('0x65')](_0x8488('0x66'),'ContactId')[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x7a'),'CampaignId')['field'](_0x8488('0x6b'),_0x8488('0x62'))[_0x8488('0x65')](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')](_0x8488('0x7b'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x6e'),_0x267401[_0x8488('0x43')][_0x8488('0x6f')]['toString']())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x72'))[_0x8488('0x6c')](_0x8488('0x7b'))['where'](_0x8488('0x7c'),_0x267401['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')]('state\x20=\x204'))['group'](_0x8488('0x67')))[_0x8488('0x70')]();return db[_0x8488('0x48')][_0x8488('0x2c')](_0xc9c221);}return[];})[_0x8488('0x21')](respondWithResult(_0x1e635a,null))['catch'](handleError(_0x1e635a,null));};exports[_0x8488('0x7d')]=function(_0x19c5c6,_0x50f773,_0x52c750){return db[_0x8488('0x7e')][_0x8488('0x7f')]({'where':{'VoiceQueueId':_0x19c5c6[_0x8488('0x43')]['VoiceQueueId'],'CampaignId':_0x19c5c6['body'][_0x8488('0x78')],'ContactId':_0x19c5c6[_0x8488('0x43')][_0x8488('0x67')]}})['then'](handleEntityNotFound(_0x50f773,null))[_0x8488('0x21')](function(_0x1e4e51){if(_0x1e4e51){return _0x1e4e51;}return null;})[_0x8488('0x21')](respondWithResult(_0x50f773,null))[_0x8488('0x3e')](handleError(_0x50f773,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index aed7cd2..29809f7 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 _0x8fef=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','lodash','util'];(function(_0x4a2130,_0x453445){var _0x3e7809=function(_0xf2f1c9){while(--_0xf2f1c9){_0x4a2130['push'](_0x4a2130['shift']());}};_0x3e7809(++_0x453445);}(_0x8fef,0x66));var _0xf8fe=function(_0x4eba43,_0x32d832){_0x4eba43=_0x4eba43-0x0;var _0x130567=_0x8fef[_0x4eba43];return _0x130567;};'use strict';var _=require(_0xf8fe('0x0'));var util=require(_0xf8fe('0x1'));var logger=require(_0xf8fe('0x2'))(_0xf8fe('0x3'));var moment=require(_0xf8fe('0x4'));var BPromise=require(_0xf8fe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf8fe('0x6'));var config=require(_0xf8fe('0x7'));var attributes=require(_0xf8fe('0x8'));module[_0xf8fe('0x9')]=function(_0x4c4ec4,_0x3d04cb){return _0x4c4ec4['define'](_0xf8fe('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xf8fe('0xb'),'fields':[_0xf8fe('0xb')]},{'name':_0xf8fe('0xc'),'fields':[_0xf8fe('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc35a=['cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x1b06e8,_0x103b87){var _0x57585d=function(_0x2c6b4b){while(--_0x2c6b4b){_0x1b06e8['push'](_0x1b06e8['shift']());}};_0x57585d(++_0x103b87);}(_0xc35a,0xbe));var _0xac35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc35a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac35('0x0'));var util=require(_0xac35('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xac35('0x2'));var BPromise=require('bluebird');var rp=require(_0xac35('0x3'));var fs=require('fs');var path=require(_0xac35('0x4'));var rimraf=require('rimraf');var config=require(_0xac35('0x5'));var attributes=require(_0xac35('0x6'));module[_0xac35('0x7')]=function(_0x397f02,_0x249368){return _0x397f02['define']('CmHopperFinal',attributes,{'tableName':_0xac35('0x8'),'paranoid':![],'indexes':[{'name':_0xac35('0x9'),'fields':[_0xac35('0x9')]},{'name':_0xac35('0xa'),'fields':[_0xac35('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 c6682c5..27a5485 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x256e22,_0x44a67f){var _0x12265a=function(_0xc301ec){while(--_0xc301ec){_0x256e22['push'](_0x256e22['shift']());}};_0x12265a(++_0x44a67f);}(_0xb10b,0x12a));var _0xbb10=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0xb10b[_0x20fdc1];return _0x25397c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x422803,_0x2bf8ac){var _0x3c0393=function(_0x58353e){while(--_0x58353e){_0x422803['push'](_0x422803['shift']());}};_0x3c0393(++_0x2bf8ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x166acc,_0x111e4e){_0x166acc=_0x166acc-0x0;var _0x209f4d=_0xb10b[_0x166acc];return _0x209f4d;};'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 f6fb92e..c71f9b5 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 _0x95ef=['moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0x95ef,0x119));var _0xf95e=function(_0x4c7701,_0x1c79be){_0x4c7701=_0x4c7701-0x0;var _0x4f89eb=_0x95ef[_0x4c7701];return _0x4f89eb;};'use strict';var multer=require(_0xf95e('0x0'));var util=require('util');var path=require(_0xf95e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf95e('0x2'));var router=express[_0xf95e('0x3')]();var fs_extra=require(_0xf95e('0x4'));var auth=require(_0xf95e('0x5'));var interaction=require(_0xf95e('0x6'));var config=require(_0xf95e('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xf95e('0x8')]('/',auth[_0xf95e('0x9')](),controller['index']);router['get'](_0xf95e('0xa'),auth['isAuthenticated'](),controller[_0xf95e('0xb')]);router[_0xf95e('0x8')](_0xf95e('0xc'),auth[_0xf95e('0x9')](),controller['show']);router[_0xf95e('0x8')]('/voice/queue/countAttributes/:id',auth[_0xf95e('0x9')](),controller[_0xf95e('0xd')]);router[_0xf95e('0x8')](_0xf95e('0xe'),auth[_0xf95e('0x9')](),controller[_0xf95e('0xf')]);router['post'](_0xf95e('0x10'),auth['isAuthenticated'](),controller[_0xf95e('0x11')]);router['post'](_0xf95e('0x12'),auth['isAuthenticated'](),controller[_0xf95e('0x13')]);router[_0xf95e('0x14')](_0xf95e('0x15'),auth['isAuthenticated'](),controller['checkContactHopper']);router[_0xf95e('0x16')](_0xf95e('0xc'),auth[_0xf95e('0x9')](),controller[_0xf95e('0x17')]);module[_0xf95e('0x18')]=router; \ No newline at end of file +var _0x4b74=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','describe','/:id','show','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','post','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer'];(function(_0x375760,_0x4af4d9){var _0x4d2c6a=function(_0x46635b){while(--_0x46635b){_0x375760['push'](_0x375760['shift']());}};_0x4d2c6a(++_0x4af4d9);}(_0x4b74,0x103));var _0x44b7=function(_0x5ddc25,_0x5ade7c){_0x5ddc25=_0x5ddc25-0x0;var _0x228a66=_0x4b74[_0x5ddc25];return _0x228a66;};'use strict';var multer=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var path=require(_0x44b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x44b7('0x3'));var router=express[_0x44b7('0x4')]();var fs_extra=require(_0x44b7('0x5'));var auth=require(_0x44b7('0x6'));var interaction=require(_0x44b7('0x7'));var config=require(_0x44b7('0x8'));var controller=require(_0x44b7('0x9'));router[_0x44b7('0xa')]('/',auth['isAuthenticated'](),controller[_0x44b7('0xb')]);router[_0x44b7('0xa')](_0x44b7('0xc'),auth['isAuthenticated'](),controller[_0x44b7('0xd')]);router[_0x44b7('0xa')](_0x44b7('0xe'),auth['isAuthenticated'](),controller[_0x44b7('0xf')]);router[_0x44b7('0xa')]('/voice/queue/countAttributes/:id',auth[_0x44b7('0x10')](),controller[_0x44b7('0x11')]);router['get'](_0x44b7('0x12'),auth[_0x44b7('0x10')](),controller[_0x44b7('0x13')]);router['post'](_0x44b7('0x14'),auth[_0x44b7('0x10')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x44b7('0x15')]('/voice/campaign/moveContacts/:id',auth[_0x44b7('0x10')](),controller[_0x44b7('0x16')]);router[_0x44b7('0x15')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x44b7('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x44b7('0x18')]);module[_0x44b7('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 12beaca..96f512b 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 _0xdf13=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x2f4e46,_0x58ed62){var _0x35380b=function(_0x321c45){while(--_0x321c45){_0x2f4e46['push'](_0x2f4e46['shift']());}};_0x35380b(++_0x58ed62);}(_0xdf13,0x171));var _0x3df1=function(_0x3b3947,_0x1c5e57){_0x3b3947=_0x3b3947-0x0;var _0x4113d7=_0xdf13[_0x3b3947];return _0x4113d7;};'use strict';var Sequelize=require('sequelize');module[_0x3df1('0x0')]={'state':{'type':Sequelize[_0x3df1('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3df1('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3df1('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3df1('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3df1('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3df1('0x2')]},'starttime':{'type':Sequelize[_0x3df1('0x3')]},'responsetime':{'type':Sequelize[_0x3df1('0x3')]},'answertime':{'type':Sequelize[_0x3df1('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3df1('0x3')]},'ringtime':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3df1('0x2')]},'campaign':{'type':Sequelize[_0x3df1('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3df1('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x3df1('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3df1('0x3')]},'recallme':{'type':Sequelize[_0x3df1('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3df1('0x3')]},'edited':{'type':Sequelize[_0x3df1('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3df1('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3df1('0x2')]}}; \ No newline at end of file +var _0xf5a6=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0xf5a6,0x7f));var _0x6f5a=function(_0x579429,_0xfc03a4){_0x579429=_0x579429-0x0;var _0x3c1a27=_0xf5a6[_0x579429];return _0x3c1a27;};'use strict';var Sequelize=require(_0x6f5a('0x0'));module[_0x6f5a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6f5a('0x2')]},'scheduledat':{'type':Sequelize[_0x6f5a('0x3')]},'countbusyretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6f5a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x6f5a('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6f5a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6f5a('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x6f5a('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6f5a('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6f5a('0x2')]},'membername':{'type':Sequelize[_0x6f5a('0x2')]},'reason':{'type':Sequelize[_0x6f5a('0x2')]},'amd':{'type':Sequelize[_0x6f5a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6f5a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6f5a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f5a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f5a('0x3')]},'recallme':{'type':Sequelize[_0x6f5a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6f5a('0x3')]},'edited':{'type':Sequelize[_0x6f5a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f5a('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 0512333..113aded 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 _0x78c9=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','update','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','Content-Range','apply','then','end','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query'];(function(_0x5ae2ff,_0x26b2e8){var _0xc6a1ef=function(_0x15bc6b){while(--_0x15bc6b){_0x5ae2ff['push'](_0x5ae2ff['shift']());}};_0xc6a1ef(++_0x26b2e8);}(_0x78c9,0x182));var _0x978c=function(_0x27fd11,_0x54b502){_0x27fd11=_0x27fd11-0x0;var _0x102e71=_0x78c9[_0x27fd11];return _0x102e71;};'use strict';var emlformat=require(_0x978c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x978c('0x1'));var jsonpatch=require(_0x978c('0x2'));var rp=require(_0x978c('0x3'));var moment=require(_0x978c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x978c('0x5'));var util=require(_0x978c('0x6'));var path=require(_0x978c('0x7'));var sox=require(_0x978c('0x8'));var csv=require(_0x978c('0x9'));var ejs=require(_0x978c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x978c('0xb'));var crypto=require('crypto');var jsforce=require(_0x978c('0xc'));var deskjs=require(_0x978c('0xd'));var toCsv=require(_0x978c('0x9'));var querystring=require(_0x978c('0xe'));var Papa=require(_0x978c('0xf'));var Redis=require('ioredis');var authService=require(_0x978c('0x10'));var qs=require(_0x978c('0x11'));var as=require(_0x978c('0x12'));var hardwareService=require(_0x978c('0x13'));var logger=require(_0x978c('0x14'))(_0x978c('0x15'));var utils=require(_0x978c('0x16'));var config=require(_0x978c('0x17'));var licenseUtil=require(_0x978c('0x18'));var db=require(_0x978c('0x19'))['db'];function respondWithStatusCode(_0x39b2c7,_0x4371ab){_0x4371ab=_0x4371ab||0xcc;return function(_0x53ff71){if(_0x53ff71){return _0x39b2c7['sendStatus'](_0x4371ab);}return _0x39b2c7[_0x978c('0x1a')](_0x4371ab)['end']();};}function respondWithResult(_0x52dc6e,_0x4c924b){_0x4c924b=_0x4c924b||0xc8;return function(_0x45f521){if(_0x45f521){return _0x52dc6e[_0x978c('0x1a')](_0x4c924b)['json'](_0x45f521);}};}function respondWithFilteredResult(_0x2c3006,_0x740164){return function(_0x2924ad){if(_0x2924ad){var _0x4f73a8=typeof _0x740164['offset']===_0x978c('0x1b')&&typeof _0x740164[_0x978c('0x1c')]===_0x978c('0x1b');var _0x4135ec=_0x2924ad[_0x978c('0x1d')];var _0xe96afe=_0x4f73a8?0x0:_0x740164[_0x978c('0x1e')];var _0x3adffc=_0x4f73a8?_0x2924ad['count']:_0x740164[_0x978c('0x1e')]+_0x740164[_0x978c('0x1c')];var _0x36fa51;if(_0x3adffc>=_0x4135ec){_0x3adffc=_0x4135ec;_0x36fa51=0xc8;}else{_0x36fa51=0xce;}_0x2c3006[_0x978c('0x1a')](_0x36fa51);return _0x2c3006['set'](_0x978c('0x1f'),_0xe96afe+'-'+_0x3adffc+'/'+_0x4135ec)['json'](_0x2924ad);}return null;};}function patchUpdates(_0x22993b){return function(_0x507583){try{jsonpatch[_0x978c('0x20')](_0x507583,_0x22993b,!![]);}catch(_0x337f78){return BPromise['reject'](_0x337f78);}return _0x507583['save']();};}function saveUpdates(_0x270b72,_0x1a8bee){return function(_0x421067){if(_0x421067){return _0x421067['update'](_0x270b72)[_0x978c('0x21')](function(_0x51f322){return _0x51f322;});}return null;};}function removeEntity(_0x54cc09,_0x5145dc){return function(_0x191bf7){if(_0x191bf7){return _0x191bf7['destroy']()[_0x978c('0x21')](function(){_0x54cc09[_0x978c('0x1a')](0xcc)[_0x978c('0x22')]();});}};}function handleEntityNotFound(_0x6c2d3b,_0x4c5945){return function(_0x34f2b6){if(!_0x34f2b6){_0x6c2d3b['sendStatus'](0x194);}return _0x34f2b6;};}function handleError(_0x25ceba,_0x56a8ca){_0x56a8ca=_0x56a8ca||0x1f4;return function(_0x1c4895){logger['error'](_0x1c4895[_0x978c('0x23')]);if(_0x1c4895['name']){delete _0x1c4895[_0x978c('0x24')];}_0x25ceba[_0x978c('0x1a')](_0x56a8ca)[_0x978c('0x25')](_0x1c4895);};}exports[_0x978c('0x26')]=function(_0x3947e3,_0x497921){var _0x163a7b={},_0xe3b0ea={},_0x34cce5={'count':0x0,'rows':[]};var _0x19ce67=_[_0x978c('0x27')](db[_0x978c('0x28')]['rawAttributes'],function(_0x576b08){return{'name':_0x576b08[_0x978c('0x29')],'type':_0x576b08[_0x978c('0x2a')][_0x978c('0x2b')]};});_0xe3b0ea[_0x978c('0x2c')]=_['map'](_0x19ce67,_0x978c('0x24'));_0xe3b0ea[_0x978c('0x2d')]=_['keys'](_0x3947e3[_0x978c('0x2d')]);_0xe3b0ea[_0x978c('0x2e')]=_[_0x978c('0x2f')](_0xe3b0ea[_0x978c('0x2c')],_0xe3b0ea['query']);_0x163a7b[_0x978c('0x30')]=_[_0x978c('0x2f')](_0xe3b0ea['model'],qs['fields'](_0x3947e3[_0x978c('0x2d')][_0x978c('0x31')]));_0x163a7b[_0x978c('0x30')]=_0x163a7b[_0x978c('0x30')][_0x978c('0x32')]?_0x163a7b[_0x978c('0x30')]:_0xe3b0ea[_0x978c('0x2c')];if(!_0x3947e3[_0x978c('0x2d')][_0x978c('0x33')]('nolimit')){_0x163a7b[_0x978c('0x1c')]=qs[_0x978c('0x1c')](_0x3947e3[_0x978c('0x2d')]['limit']);_0x163a7b[_0x978c('0x1e')]=qs[_0x978c('0x1e')](_0x3947e3[_0x978c('0x2d')][_0x978c('0x1e')]);}_0x163a7b[_0x978c('0x34')]=qs['sort'](_0x3947e3[_0x978c('0x2d')][_0x978c('0x35')]);_0x163a7b[_0x978c('0x36')]=qs[_0x978c('0x2e')](_[_0x978c('0x37')](_0x3947e3[_0x978c('0x2d')],_0xe3b0ea['filters']),_0x19ce67);if(_0x3947e3['query']['filter']){_0x163a7b[_0x978c('0x36')]=_[_0x978c('0x38')](_0x163a7b['where'],{'$or':_[_0x978c('0x27')](_0x19ce67,function(_0x519e16){if(_0x519e16[_0x978c('0x2a')]!==_0x978c('0x39')){var _0x456889={};_0x456889[_0x519e16['name']]={'$like':'%'+_0x3947e3[_0x978c('0x2d')][_0x978c('0x3a')]+'%'};return _0x456889;}})});}_0x163a7b=_['merge']({},_0x163a7b,_0x3947e3[_0x978c('0x3b')]);var _0x2d1a01={'where':_0x163a7b[_0x978c('0x36')]};return db[_0x978c('0x28')][_0x978c('0x1d')](_0x2d1a01)[_0x978c('0x21')](function(_0x4c8daf){_0x34cce5[_0x978c('0x1d')]=_0x4c8daf;if(_0x3947e3[_0x978c('0x2d')]['includeAll']){_0x163a7b[_0x978c('0x3c')]=[{'all':!![]}];}return db[_0x978c('0x28')][_0x978c('0x3d')](_0x163a7b);})[_0x978c('0x21')](function(_0x1cd03d){_0x34cce5[_0x978c('0x3e')]=_0x1cd03d;return _0x34cce5;})[_0x978c('0x21')](respondWithFilteredResult(_0x497921,_0x163a7b))[_0x978c('0x3f')](handleError(_0x497921,null));};exports['show']=function(_0xf9827f,_0x5dc8f2){var _0x51bfaa={'raw':!![],'where':{'id':_0xf9827f[_0x978c('0x40')]['id']}},_0x309e71={};_0x309e71[_0x978c('0x2c')]=_['keys'](db[_0x978c('0x28')][_0x978c('0x41')]);_0x309e71[_0x978c('0x2d')]=_['keys'](_0xf9827f[_0x978c('0x2d')]);_0x309e71[_0x978c('0x2e')]=_[_0x978c('0x2f')](_0x309e71[_0x978c('0x2c')],_0x309e71['query']);_0x51bfaa[_0x978c('0x30')]=_[_0x978c('0x2f')](_0x309e71['model'],qs[_0x978c('0x31')](_0xf9827f[_0x978c('0x2d')][_0x978c('0x31')]));_0x51bfaa[_0x978c('0x30')]=_0x51bfaa['attributes'][_0x978c('0x32')]?_0x51bfaa[_0x978c('0x30')]:_0x309e71[_0x978c('0x2c')];if(_0xf9827f[_0x978c('0x2d')][_0x978c('0x42')]){_0x51bfaa['include']=[{'all':!![]}];}_0x51bfaa=_[_0x978c('0x38')]({},_0x51bfaa,_0xf9827f[_0x978c('0x3b')]);return db['CmHopperHistory'][_0x978c('0x43')](_0x51bfaa)[_0x978c('0x21')](handleEntityNotFound(_0x5dc8f2,null))[_0x978c('0x21')](respondWithResult(_0x5dc8f2,null))[_0x978c('0x3f')](handleError(_0x5dc8f2,null));};exports[_0x978c('0x44')]=function(_0x3e5fa4,_0x1d3530){return db[_0x978c('0x28')]['create'](_0x3e5fa4[_0x978c('0x45')],{})['then'](respondWithResult(_0x1d3530,0xc9))[_0x978c('0x3f')](handleError(_0x1d3530,null));};exports['describe']=function(_0x2fb386,_0x34dfe2){return db['CmHopperHistory']['describe']()[_0x978c('0x21')](respondWithResult(_0x34dfe2,null))[_0x978c('0x3f')](handleError(_0x34dfe2,null));};exports[_0x978c('0x46')]=function(_0x2e976c,_0x35d001){if(_0x2e976c[_0x978c('0x45')][_0x978c('0x47')]){delete _0x2e976c[_0x978c('0x45')][_0x978c('0x47')];}return db[_0x978c('0x28')]['find']({'where':{'uniqueid':_0x2e976c[_0x978c('0x40')]['id']}})['then'](handleEntityNotFound(_0x35d001,null))[_0x978c('0x21')](saveUpdates(_0x2e976c[_0x978c('0x45')],null))[_0x978c('0x21')](respondWithResult(_0x35d001,null))[_0x978c('0x3f')](handleError(_0x35d001,null));}; \ No newline at end of file +var _0x8ded=['attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','length','find','create','body','describe','catch','uniqueid','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x573332,_0x18ac4e){var _0x118a07=function(_0x120097){while(--_0x120097){_0x573332['push'](_0x573332['shift']());}};_0x118a07(++_0x18ac4e);}(_0x8ded,0xb0));var _0xd8de=function(_0x3412f1,_0x41a179){_0x3412f1=_0x3412f1-0x0;var _0xe28c10=_0x8ded[_0x3412f1];return _0xe28c10;};'use strict';var emlformat=require(_0xd8de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8de('0x1'));var jsonpatch=require(_0xd8de('0x2'));var rp=require(_0xd8de('0x3'));var moment=require(_0xd8de('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd8de('0x5'));var path=require(_0xd8de('0x6'));var sox=require(_0xd8de('0x7'));var csv=require(_0xd8de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8de('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd8de('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd8de('0xb'));var toCsv=require(_0xd8de('0x8'));var querystring=require(_0xd8de('0xc'));var Papa=require(_0xd8de('0xd'));var Redis=require(_0xd8de('0xe'));var authService=require(_0xd8de('0xf'));var qs=require(_0xd8de('0x10'));var as=require(_0xd8de('0x11'));var hardwareService=require(_0xd8de('0x12'));var logger=require(_0xd8de('0x13'))(_0xd8de('0x14'));var utils=require(_0xd8de('0x15'));var config=require(_0xd8de('0x16'));var licenseUtil=require(_0xd8de('0x17'));var db=require(_0xd8de('0x18'))['db'];function respondWithStatusCode(_0x4071eb,_0x202026){_0x202026=_0x202026||0xcc;return function(_0x1ef6cf){if(_0x1ef6cf){return _0x4071eb[_0xd8de('0x19')](_0x202026);}return _0x4071eb[_0xd8de('0x1a')](_0x202026)[_0xd8de('0x1b')]();};}function respondWithResult(_0x4896be,_0x4facac){_0x4facac=_0x4facac||0xc8;return function(_0x2b496a){if(_0x2b496a){return _0x4896be['status'](_0x4facac)[_0xd8de('0x1c')](_0x2b496a);}};}function respondWithFilteredResult(_0x45894f,_0x1bfe51){return function(_0x2bace7){if(_0x2bace7){var _0xd13d=typeof _0x1bfe51['offset']===_0xd8de('0x1d')&&typeof _0x1bfe51['limit']===_0xd8de('0x1d');var _0x963a3c=_0x2bace7[_0xd8de('0x1e')];var _0x49118e=_0xd13d?0x0:_0x1bfe51['offset'];var _0x37c322=_0xd13d?_0x2bace7[_0xd8de('0x1e')]:_0x1bfe51[_0xd8de('0x1f')]+_0x1bfe51[_0xd8de('0x20')];var _0x557330;if(_0x37c322>=_0x963a3c){_0x37c322=_0x963a3c;_0x557330=0xc8;}else{_0x557330=0xce;}_0x45894f[_0xd8de('0x1a')](_0x557330);return _0x45894f[_0xd8de('0x21')](_0xd8de('0x22'),_0x49118e+'-'+_0x37c322+'/'+_0x963a3c)['json'](_0x2bace7);}return null;};}function patchUpdates(_0x497ac2){return function(_0x372647){try{jsonpatch['apply'](_0x372647,_0x497ac2,!![]);}catch(_0x2fc6fd){return BPromise[_0xd8de('0x23')](_0x2fc6fd);}return _0x372647[_0xd8de('0x24')]();};}function saveUpdates(_0x4bebe4,_0x432945){return function(_0x1c9945){if(_0x1c9945){return _0x1c9945[_0xd8de('0x25')](_0x4bebe4)[_0xd8de('0x26')](function(_0x5038b8){return _0x5038b8;});}return null;};}function removeEntity(_0x5d140f,_0x15f378){return function(_0x544936){if(_0x544936){return _0x544936[_0xd8de('0x27')]()['then'](function(){_0x5d140f[_0xd8de('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf967,_0x1e46e4){return function(_0x3ef1cb){if(!_0x3ef1cb){_0x5bf967[_0xd8de('0x19')](0x194);}return _0x3ef1cb;};}function handleError(_0xe46861,_0x1d1260){_0x1d1260=_0x1d1260||0x1f4;return function(_0x5b8838){logger[_0xd8de('0x28')](_0x5b8838[_0xd8de('0x29')]);if(_0x5b8838[_0xd8de('0x2a')]){delete _0x5b8838['name'];}_0xe46861[_0xd8de('0x1a')](_0x1d1260)['send'](_0x5b8838);};}exports[_0xd8de('0x2b')]=function(_0x5e6ea5,_0x50ef01){var _0x34e033={},_0x592957={},_0x46f42b={'count':0x0,'rows':[]};var _0x1c9dad=_[_0xd8de('0x2c')](db[_0xd8de('0x2d')][_0xd8de('0x2e')],function(_0x399f07){return{'name':_0x399f07[_0xd8de('0x2f')],'type':_0x399f07[_0xd8de('0x30')][_0xd8de('0x31')]};});_0x592957[_0xd8de('0x32')]=_[_0xd8de('0x2c')](_0x1c9dad,'name');_0x592957['query']=_[_0xd8de('0x33')](_0x5e6ea5[_0xd8de('0x34')]);_0x592957[_0xd8de('0x35')]=_[_0xd8de('0x36')](_0x592957[_0xd8de('0x32')],_0x592957['query']);_0x34e033[_0xd8de('0x37')]=_[_0xd8de('0x36')](_0x592957['model'],qs['fields'](_0x5e6ea5[_0xd8de('0x34')][_0xd8de('0x38')]));_0x34e033[_0xd8de('0x37')]=_0x34e033[_0xd8de('0x37')]['length']?_0x34e033[_0xd8de('0x37')]:_0x592957[_0xd8de('0x32')];if(!_0x5e6ea5[_0xd8de('0x34')][_0xd8de('0x39')]('nolimit')){_0x34e033[_0xd8de('0x20')]=qs[_0xd8de('0x20')](_0x5e6ea5[_0xd8de('0x34')]['limit']);_0x34e033['offset']=qs[_0xd8de('0x1f')](_0x5e6ea5[_0xd8de('0x34')]['offset']);}_0x34e033[_0xd8de('0x3a')]=qs[_0xd8de('0x3b')](_0x5e6ea5[_0xd8de('0x34')][_0xd8de('0x3b')]);_0x34e033[_0xd8de('0x3c')]=qs['filters'](_['pick'](_0x5e6ea5[_0xd8de('0x34')],_0x592957[_0xd8de('0x35')]),_0x1c9dad);if(_0x5e6ea5[_0xd8de('0x34')]['filter']){_0x34e033[_0xd8de('0x3c')]=_[_0xd8de('0x3d')](_0x34e033[_0xd8de('0x3c')],{'$or':_[_0xd8de('0x2c')](_0x1c9dad,function(_0x47e54d){if(_0x47e54d[_0xd8de('0x30')]!==_0xd8de('0x3e')){var _0x5b1258={};_0x5b1258[_0x47e54d[_0xd8de('0x2a')]]={'$like':'%'+_0x5e6ea5[_0xd8de('0x34')][_0xd8de('0x3f')]+'%'};return _0x5b1258;}})});}_0x34e033=_[_0xd8de('0x3d')]({},_0x34e033,_0x5e6ea5[_0xd8de('0x40')]);var _0x150e6c={'where':_0x34e033[_0xd8de('0x3c')]};return db[_0xd8de('0x2d')][_0xd8de('0x1e')](_0x150e6c)[_0xd8de('0x26')](function(_0x4c2301){_0x46f42b[_0xd8de('0x1e')]=_0x4c2301;if(_0x5e6ea5[_0xd8de('0x34')][_0xd8de('0x41')]){_0x34e033[_0xd8de('0x42')]=[{'all':!![]}];}return db[_0xd8de('0x2d')][_0xd8de('0x43')](_0x34e033);})[_0xd8de('0x26')](function(_0x379bbb){_0x46f42b[_0xd8de('0x44')]=_0x379bbb;return _0x46f42b;})['then'](respondWithFilteredResult(_0x50ef01,_0x34e033))['catch'](handleError(_0x50ef01,null));};exports['show']=function(_0x1ee35c,_0x20ded1){var _0x809d48={'raw':!![],'where':{'id':_0x1ee35c['params']['id']}},_0x1905ae={};_0x1905ae[_0xd8de('0x32')]=_['keys'](db[_0xd8de('0x2d')][_0xd8de('0x2e')]);_0x1905ae[_0xd8de('0x34')]=_[_0xd8de('0x33')](_0x1ee35c[_0xd8de('0x34')]);_0x1905ae[_0xd8de('0x35')]=_[_0xd8de('0x36')](_0x1905ae['model'],_0x1905ae['query']);_0x809d48[_0xd8de('0x37')]=_['intersection'](_0x1905ae[_0xd8de('0x32')],qs[_0xd8de('0x38')](_0x1ee35c[_0xd8de('0x34')]['fields']));_0x809d48[_0xd8de('0x37')]=_0x809d48[_0xd8de('0x37')][_0xd8de('0x45')]?_0x809d48[_0xd8de('0x37')]:_0x1905ae[_0xd8de('0x32')];if(_0x1ee35c['query'][_0xd8de('0x41')]){_0x809d48['include']=[{'all':!![]}];}_0x809d48=_[_0xd8de('0x3d')]({},_0x809d48,_0x1ee35c[_0xd8de('0x40')]);return db[_0xd8de('0x2d')][_0xd8de('0x46')](_0x809d48)[_0xd8de('0x26')](handleEntityNotFound(_0x20ded1,null))[_0xd8de('0x26')](respondWithResult(_0x20ded1,null))['catch'](handleError(_0x20ded1,null));};exports[_0xd8de('0x47')]=function(_0x45ea55,_0x27a1ec){return db[_0xd8de('0x2d')][_0xd8de('0x47')](_0x45ea55[_0xd8de('0x48')],{})[_0xd8de('0x26')](respondWithResult(_0x27a1ec,0xc9))['catch'](handleError(_0x27a1ec,null));};exports[_0xd8de('0x49')]=function(_0x3d013e,_0x3b0ccc){return db[_0xd8de('0x2d')][_0xd8de('0x49')]()[_0xd8de('0x26')](respondWithResult(_0x3b0ccc,null))[_0xd8de('0x4a')](handleError(_0x3b0ccc,null));};exports[_0xd8de('0x25')]=function(_0x36a2aa,_0x336b06){if(_0x36a2aa[_0xd8de('0x48')]['uniqueid']){delete _0x36a2aa[_0xd8de('0x48')][_0xd8de('0x4b')];}return db[_0xd8de('0x2d')][_0xd8de('0x46')]({'where':{'uniqueid':_0x36a2aa[_0xd8de('0x4c')]['id']}})['then'](handleEntityNotFound(_0x336b06,null))['then'](saveUpdates(_0x36a2aa[_0xd8de('0x48')],null))[_0xd8de('0x26')](respondWithResult(_0x336b06,null))[_0xd8de('0x4a')](handleError(_0x336b06,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index d3918d4..27af4a9 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 _0x762e=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','api','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x148816,_0x37e211){var _0x30584e=function(_0x2bb597){while(--_0x2bb597){_0x148816['push'](_0x148816['shift']());}};_0x30584e(++_0x37e211);}(_0x762e,0xea));var _0xe762=function(_0x54dea4,_0x1b5109){_0x54dea4=_0x54dea4-0x0;var _0x3a2d64=_0x762e[_0x54dea4];return _0x3a2d64;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe762('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe762('0x2'));var fs=require('fs');var path=require(_0xe762('0x3'));var rimraf=require(_0xe762('0x4'));var config=require('../../config/environment');var attributes=require(_0xe762('0x5'));module[_0xe762('0x6')]=function(_0x48995a,_0x4abeb6){return _0x48995a[_0xe762('0x7')](_0xe762('0x8'),attributes,{'tableName':_0xe762('0x9'),'paranoid':![],'indexes':[{'name':_0xe762('0xa'),'fields':[_0xe762('0xa')]},{'name':_0xe762('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bc1=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x25e3a5,_0x4a8715){var _0x3b5751=function(_0xba0ec8){while(--_0xba0ec8){_0x25e3a5['push'](_0x25e3a5['shift']());}};_0x3b5751(++_0x4a8715);}(_0x5bc1,0xb5));var _0x15bc=function(_0x20ba6d,_0x256177){_0x20ba6d=_0x20ba6d-0x0;var _0x338188=_0x5bc1[_0x20ba6d];return _0x338188;};'use strict';var _=require('lodash');var util=require(_0x15bc('0x0'));var logger=require(_0x15bc('0x1'))(_0x15bc('0x2'));var moment=require(_0x15bc('0x3'));var BPromise=require(_0x15bc('0x4'));var rp=require(_0x15bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15bc('0x6'));var attributes=require(_0x15bc('0x7'));module[_0x15bc('0x8')]=function(_0x52766f,_0x109031){return _0x52766f['define'](_0x15bc('0x9'),attributes,{'tableName':_0x15bc('0xa'),'paranoid':![],'indexes':[{'name':_0x15bc('0xb'),'fields':[_0x15bc('0xb')]},{'name':_0x15bc('0xc'),'fields':[_0x15bc('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 81488ea..bce9d51 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 _0x795a=['create','body','raw','AvgHandleTime','findAll','options','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateCmHopperHistory','CmHopperHistory'];(function(_0x5026ee,_0x40159f){var _0x282909=function(_0x1ad403){while(--_0x1ad403){_0x5026ee['push'](_0x5026ee['shift']());}};_0x282909(++_0x40159f);}(_0x795a,0xeb));var _0xa795=function(_0x4b8887,_0x235d6f){_0x4b8887=_0x4b8887-0x0;var _0x578987=_0x795a[_0x4b8887];return _0x578987;};'use strict';var _=require('lodash');var util=require(_0xa795('0x0'));var moment=require(_0xa795('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa795('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa795('0x3'));var logger=require(_0xa795('0x4'))(_0xa795('0x5'));var config=require(_0xa795('0x6'));var jayson=require(_0xa795('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39e56e,_0x364200,_0x2fa091){return new BPromise(function(_0x467fa1,_0x227d7d){return client[_0xa795('0x8')](_0x39e56e,_0x2fa091)[_0xa795('0x9')](function(_0x41bec1){logger[_0xa795('0xa')](_0xa795('0xb'),_0x364200,_0xa795('0xc'));logger[_0xa795('0xd')](_0xa795('0xe'),_0x364200,_0xa795('0xc'),JSON[_0xa795('0xf')](_0x41bec1));if(_0x41bec1[_0xa795('0x10')]){if(_0x41bec1[_0xa795('0x10')]['code']===0x1f4){logger[_0xa795('0x10')](_0xa795('0xb'),_0x364200,_0x41bec1[_0xa795('0x10')][_0xa795('0x11')]);return _0x227d7d(_0x41bec1[_0xa795('0x10')]['message']);}logger[_0xa795('0x10')](_0xa795('0xb'),_0x364200,_0x41bec1[_0xa795('0x10')]['message']);return _0x467fa1(_0x41bec1[_0xa795('0x10')][_0xa795('0x11')]);}else{logger[_0xa795('0xa')](_0xa795('0xb'),_0x364200,_0xa795('0xc'));_0x467fa1(_0x41bec1['result'][_0xa795('0x11')]);}})[_0xa795('0x12')](function(_0x3577e4){logger[_0xa795('0x10')](_0xa795('0xb'),_0x364200,_0x3577e4);_0x227d7d(_0x3577e4);});});}exports[_0xa795('0x13')]=function(_0x45a9bf){var _0xf103f0=this;return new Promise(function(_0x44e9bd,_0x1ebf4b){return db[_0xa795('0x14')][_0xa795('0x15')](_0x45a9bf[_0xa795('0x16')],{'raw':_0x45a9bf['options']?_0x45a9bf['options'][_0xa795('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x583af7){logger[_0xa795('0xa')](_0xa795('0x13'),_0x45a9bf);logger['debug']('CreateCmHopperHistory',_0x45a9bf,JSON[_0xa795('0xf')](_0x583af7));_0x44e9bd(_0x583af7);})['catch'](function(_0x36c96d){logger[_0xa795('0x10')](_0xa795('0x13'),_0x36c96d['message'],_0x45a9bf);_0x1ebf4b(_0xf103f0[_0xa795('0x10')](0x1f4,_0x36c96d[_0xa795('0x11')]));});});};exports[_0xa795('0x18')]=function(_0x2b7446){var _0x5527a6=this;return new Promise(function(_0x52b1af,_0x40c2b4){return db[_0xa795('0x14')][_0xa795('0x19')]({'raw':_0x2b7446['options']?_0x2b7446['options'][_0xa795('0x17')]===undefined?!![]:![]:!![],'where':_0x2b7446['options']?_0x2b7446[_0xa795('0x1a')]['where']||null:null,'attributes':[[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')][_0xa795('0x1d')]('id')),_0xa795('0x1e')],[db['sequelize']['fn']('COUNT',db[_0xa795('0x1b')]['fn']('IF',db['sequelize'][_0xa795('0x1f')](_0xa795('0x20')))),_0xa795('0x21')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x22')))),_0xa795('0x23')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')]('`state`\x20=\x2011,\x201,\x20null'))),_0xa795('0x24')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x25'),db['sequelize']['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x26')))),'predictiveIntervalAvgHoldtime'],[db[_0xa795('0x1b')]['fn']('AVG',db[_0xa795('0x1b')]['fn']('IF',db['sequelize'][_0xa795('0x1f')](_0xa795('0x27')))),_0xa795('0x28')]]})[_0xa795('0x9')](function(_0x1ad9dd){logger[_0xa795('0xa')](_0xa795('0x18'),_0x2b7446);logger['debug'](_0xa795('0x18'),_0x2b7446,JSON['stringify'](_0x1ad9dd));_0x52b1af(_0x1ad9dd);})[_0xa795('0x12')](function(_0x9b9f18){logger[_0xa795('0x10')]('AvgHandleTime',_0x9b9f18['message'],_0x2b7446);_0x40c2b4(_0x5527a6['error'](0x1f4,_0x9b9f18[_0xa795('0x11')]));});});};exports[_0xa795('0x29')]=function(_0x1b810d){var _0x194ddf=this;return new Promise(function(_0x20316f,_0x2cf4e0){return db[_0xa795('0x14')][_0xa795('0x19')]({'raw':_0x1b810d[_0xa795('0x1a')]?_0x1b810d[_0xa795('0x1a')][_0xa795('0x17')]===undefined?!![]:![]:!![],'where':_0x1b810d[_0xa795('0x1a')]?_0x1b810d['options']['where']||null:null,'attributes':[[_0xa795('0x2a'),_0xa795('0x2b')],[db[_0xa795('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa795('0x1b')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xa795('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x2c')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xa795('0x1c'),db['sequelize']['fn']('IF',db[_0xa795('0x1b')]['literal'](_0xa795('0x20')))),_0xa795('0x2d')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0xa795('0x2e')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')]['literal'](_0xa795('0x2f')))),_0xa795('0x30')],[db[_0xa795('0x1b')]['fn']('COUNT',db[_0xa795('0x1b')]['fn']('IF',db['sequelize'][_0xa795('0x1f')](_0xa795('0x31')))),_0xa795('0x32')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db['sequelize'][_0xa795('0x1f')](_0xa795('0x33')))),'outboundDropCallsDayCallersExit'],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x34')))),'outboundUnknownCallsDay'],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x35')))),_0xa795('0x36')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x37')))),_0xa795('0x38')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0xa795('0x39')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa795('0x3a')],[db['sequelize']['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')][_0xa795('0x1f')](_0xa795('0x3b')))),_0xa795('0x39')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')]['literal'](_0xa795('0x3c')))),'outboundReCallsDay']],'group':[_0xa795('0x2a')]})[_0xa795('0x9')](function(_0x2af625){logger[_0xa795('0xa')](_0xa795('0x29'),_0x1b810d);logger[_0xa795('0xd')](_0xa795('0x29'),_0x1b810d,JSON[_0xa795('0xf')](_0x2af625));_0x20316f(_0x2af625);})[_0xa795('0x12')](function(_0x39d5a1){logger[_0xa795('0x10')](_0xa795('0x29'),_0x39d5a1[_0xa795('0x11')],_0x1b810d);_0x2cf4e0(_0x194ddf[_0xa795('0x10')](0x1f4,_0x39d5a1['message']));});});};exports[_0xa795('0x3d')]=function(_0x5c92b5){var _0xae99e6=this;return new Promise(function(_0x7cbd86,_0x7ea1d8){return db[_0xa795('0x14')]['findAll']({'raw':_0x5c92b5[_0xa795('0x1a')]?_0x5c92b5[_0xa795('0x1a')][_0xa795('0x17')]===undefined?!![]:![]:!![],'where':_0x5c92b5[_0xa795('0x1a')]?_0x5c92b5[_0xa795('0x1a')]['where']||null:null,'attributes':[['campaign',_0xa795('0x2b')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')][_0xa795('0x1d')]('id')),_0xa795('0x3e')],[db[_0xa795('0x1b')]['fn'](_0xa795('0x1c'),db[_0xa795('0x1b')]['fn']('IF',db[_0xa795('0x1b')]['literal'](_0xa795('0x20')))),_0xa795('0x3f')]],'group':[_0xa795('0x2a')]})[_0xa795('0x9')](function(_0x40b630){logger[_0xa795('0xa')](_0xa795('0x3d'),_0x5c92b5);logger[_0xa795('0xd')](_0xa795('0x3d'),_0x5c92b5,JSON['stringify'](_0x40b630));_0x7cbd86(_0x40b630);})[_0xa795('0x12')](function(_0x2bcbaa){logger['error'](_0xa795('0x3d'),_0x2bcbaa[_0xa795('0x11')],_0x5c92b5);_0x7ea1d8(_0xae99e6['error'](0x1f4,_0x2bcbaa[_0xa795('0x11')]));});});}; \ No newline at end of file +var _0x5bb7=['options','debug','stringify','AvgHandleTime','raw','where','sequelize','col','COUNT','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x563095,_0x196a74){var _0x237406=function(_0x7da569){while(--_0x7da569){_0x563095['push'](_0x563095['shift']());}};_0x237406(++_0x196a74);}(_0x5bb7,0x104));var _0x75bb=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x5bb7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x75bb('0x0'));var util=require('util');var moment=require(_0x75bb('0x1'));var BPromise=require(_0x75bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75bb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x75bb('0x4'))(_0x75bb('0x5'));var config=require(_0x75bb('0x6'));var jayson=require(_0x75bb('0x7'));var client=jayson[_0x75bb('0x8')][_0x75bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4144d6,_0x4a1030,_0xa8897b){return new BPromise(function(_0x674de,_0x104bf0){return client[_0x75bb('0xa')](_0x4144d6,_0xa8897b)[_0x75bb('0xb')](function(_0x2887b2){logger[_0x75bb('0xc')](_0x75bb('0xd'),_0x4a1030,_0x75bb('0xe'));logger['debug'](_0x75bb('0xf'),_0x4a1030,_0x75bb('0xe'),JSON['stringify'](_0x2887b2));if(_0x2887b2[_0x75bb('0x10')]){if(_0x2887b2[_0x75bb('0x10')][_0x75bb('0x11')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4a1030,_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);return _0x104bf0(_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4a1030,_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);return _0x674de(_0x2887b2['error'][_0x75bb('0x12')]);}else{logger['info'](_0x75bb('0xd'),_0x4a1030,'request\x20sent');_0x674de(_0x2887b2[_0x75bb('0x13')][_0x75bb('0x12')]);}})['catch'](function(_0x1b56e1){logger[_0x75bb('0x10')](_0x75bb('0xd'),_0x4a1030,_0x1b56e1);_0x104bf0(_0x1b56e1);});});}exports[_0x75bb('0x14')]=function(_0x2f9499){var _0x2aa895=this;return new Promise(function(_0x1f9658,_0x3d5de5){return db[_0x75bb('0x15')][_0x75bb('0x16')](_0x2f9499[_0x75bb('0x17')],{'raw':_0x2f9499[_0x75bb('0x18')]?_0x2f9499[_0x75bb('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x75bb('0xb')](function(_0x4f145a){logger['info']('CreateCmHopperHistory',_0x2f9499);logger[_0x75bb('0x19')]('CreateCmHopperHistory',_0x2f9499,JSON[_0x75bb('0x1a')](_0x4f145a));_0x1f9658(_0x4f145a);})['catch'](function(_0x395c4b){logger['error'](_0x75bb('0x14'),_0x395c4b[_0x75bb('0x12')],_0x2f9499);_0x3d5de5(_0x2aa895[_0x75bb('0x10')](0x1f4,_0x395c4b[_0x75bb('0x12')]));});});};exports[_0x75bb('0x1b')]=function(_0x4ca494){var _0x17e60c=this;return new Promise(function(_0x4a8db4,_0x391f54){return db[_0x75bb('0x15')]['findAll']({'raw':_0x4ca494[_0x75bb('0x18')]?_0x4ca494[_0x75bb('0x18')][_0x75bb('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ca494[_0x75bb('0x18')]?_0x4ca494['options'][_0x75bb('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x75bb('0x1e')][_0x75bb('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x75bb('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x75bb('0x1e')]['fn']('COUNT',db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x22')))),_0x75bb('0x23')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0x75bb('0x21')](_0x75bb('0x25')))),_0x75bb('0x26')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x24'),db['sequelize']['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x27')))),_0x75bb('0x28')]]})[_0x75bb('0xb')](function(_0x52c7ff){logger[_0x75bb('0xc')]('AvgHandleTime',_0x4ca494);logger[_0x75bb('0x19')]('AvgHandleTime',_0x4ca494,JSON['stringify'](_0x52c7ff));_0x4a8db4(_0x52c7ff);})['catch'](function(_0x3b2142){logger[_0x75bb('0x10')]('AvgHandleTime',_0x3b2142['message'],_0x4ca494);_0x391f54(_0x17e60c[_0x75bb('0x10')](0x1f4,_0x3b2142['message']));});});};exports[_0x75bb('0x29')]=function(_0x2a22bf){var _0x5267f6=this;return new Promise(function(_0x3b0fcd,_0x18f7bb){return db[_0x75bb('0x15')][_0x75bb('0x2a')]({'raw':_0x2a22bf[_0x75bb('0x18')]?_0x2a22bf[_0x75bb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a22bf[_0x75bb('0x18')]?_0x2a22bf[_0x75bb('0x18')][_0x75bb('0x1d')]||null:null,'attributes':[[_0x75bb('0x2b'),_0x75bb('0x2c')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x75bb('0x2d')))),_0x75bb('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x2f')))),_0x75bb('0x30')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')]['literal'](_0x75bb('0x31')))),_0x75bb('0x32')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x75bb('0x33')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db['sequelize'][_0x75bb('0x21')](_0x75bb('0x34')))),_0x75bb('0x35')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x37')))),_0x75bb('0x38')],[db['sequelize']['fn'](_0x75bb('0x20'),db['sequelize']['fn']('IF',db[_0x75bb('0x1e')]['literal'](_0x75bb('0x39')))),'outboundUnknownCallsDay'],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db['sequelize']['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x3a')))),_0x75bb('0x3b')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x75bb('0x3c')))),_0x75bb('0x3d')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x75bb('0x21')](_0x75bb('0x3e')))),_0x75bb('0x3f')],[db['sequelize']['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db['sequelize'][_0x75bb('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x75bb('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x75bb('0x1e')]['literal'](_0x75bb('0x41')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db[_0x75bb('0x1e')][_0x75bb('0x21')](_0x75bb('0x42')))),_0x75bb('0x43')]],'group':[_0x75bb('0x2b')]})[_0x75bb('0xb')](function(_0x15472d){logger[_0x75bb('0xc')](_0x75bb('0x29'),_0x2a22bf);logger[_0x75bb('0x19')](_0x75bb('0x29'),_0x2a22bf,JSON[_0x75bb('0x1a')](_0x15472d));_0x3b0fcd(_0x15472d);})['catch'](function(_0x13d016){logger[_0x75bb('0x10')](_0x75bb('0x29'),_0x13d016['message'],_0x2a22bf);_0x18f7bb(_0x5267f6['error'](0x1f4,_0x13d016[_0x75bb('0x12')]));});});};exports[_0x75bb('0x44')]=function(_0x57b8f3){var _0x11de64=this;return new Promise(function(_0x4e13b3,_0x311fb6){return db[_0x75bb('0x15')]['findAll']({'raw':_0x57b8f3['options']?_0x57b8f3['options'][_0x75bb('0x1c')]===undefined?!![]:![]:!![],'where':_0x57b8f3[_0x75bb('0x18')]?_0x57b8f3['options']['where']||null:null,'attributes':[[_0x75bb('0x2b'),_0x75bb('0x2c')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')][_0x75bb('0x1f')]('id')),_0x75bb('0x45')],[db[_0x75bb('0x1e')]['fn'](_0x75bb('0x20'),db[_0x75bb('0x1e')]['fn']('IF',db['sequelize'][_0x75bb('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x75bb('0x46')]],'group':[_0x75bb('0x2b')]})['then'](function(_0x2b5d65){logger[_0x75bb('0xc')](_0x75bb('0x44'),_0x57b8f3);logger[_0x75bb('0x19')](_0x75bb('0x44'),_0x57b8f3,JSON[_0x75bb('0x1a')](_0x2b5d65));_0x4e13b3(_0x2b5d65);})['catch'](function(_0x3d463e){logger[_0x75bb('0x10')](_0x75bb('0x44'),_0x3d463e[_0x75bb('0x12')],_0x57b8f3);_0x311fb6(_0x11de64[_0x75bb('0x10')](0x1f4,_0x3d463e[_0x75bb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index adef571..7c080c4 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 _0xea43=['create','put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xea43,0x147));var _0x3ea4=function(_0x27e369,_0x113dca){_0x27e369=_0x27e369-0x0;var _0x4824ea=_0xea43[_0x27e369];return _0x4824ea;};'use strict';var multer=require('multer');var util=require(_0x3ea4('0x0'));var path=require(_0x3ea4('0x1'));var timeout=require(_0x3ea4('0x2'));var express=require('express');var router=express[_0x3ea4('0x3')]();var fs_extra=require(_0x3ea4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ea4('0x5'));var config=require(_0x3ea4('0x6'));var controller=require(_0x3ea4('0x7'));router[_0x3ea4('0x8')]('/',auth[_0x3ea4('0x9')](),controller[_0x3ea4('0xa')]);router[_0x3ea4('0x8')](_0x3ea4('0xb'),auth['isAuthenticated'](),controller[_0x3ea4('0xc')]);router[_0x3ea4('0x8')](_0x3ea4('0xd'),auth[_0x3ea4('0x9')](),controller['show']);router[_0x3ea4('0xe')]('/',auth[_0x3ea4('0x9')](),controller[_0x3ea4('0xf')]);router[_0x3ea4('0x10')](_0x3ea4('0xd'),auth[_0x3ea4('0x9')](),controller[_0x3ea4('0x11')]);module[_0x3ea4('0x12')]=router; \ No newline at end of file +var _0xd7d2=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x34c947,_0x224f5c){var _0x507866=function(_0x3da048){while(--_0x3da048){_0x34c947['push'](_0x34c947['shift']());}};_0x507866(++_0x224f5c);}(_0xd7d2,0x19b));var _0x2d7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd7d2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x2d7d('0x0'));var path=require(_0x2d7d('0x1'));var timeout=require(_0x2d7d('0x2'));var express=require('express');var router=express[_0x2d7d('0x3')]();var fs_extra=require(_0x2d7d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d7d('0x5'));var config=require(_0x2d7d('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x2d7d('0x7')]('/',auth[_0x2d7d('0x8')](),controller[_0x2d7d('0x9')]);router[_0x2d7d('0x7')](_0x2d7d('0xa'),auth[_0x2d7d('0x8')](),controller[_0x2d7d('0xb')]);router[_0x2d7d('0x7')](_0x2d7d('0xc'),auth[_0x2d7d('0x8')](),controller[_0x2d7d('0xd')]);router['post']('/',auth[_0x2d7d('0x8')](),controller['create']);router[_0x2d7d('0xe')](_0x2d7d('0xc'),auth[_0x2d7d('0x8')](),controller['update']);module[_0x2d7d('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3bb1cd1..6691d05 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 _0xe799=['sequelize','STRING'];(function(_0x8e3ad8,_0x5d5edd){var _0x1e347d=function(_0x159ccc){while(--_0x159ccc){_0x8e3ad8['push'](_0x8e3ad8['shift']());}};_0x1e347d(++_0x5d5edd);}(_0xe799,0x170));var _0x9e79=function(_0x5d5234,_0x99d06){_0x5d5234=_0x5d5234-0x0;var _0x9c194f=_0xe799[_0x5d5234];return _0x9c194f;};'use strict';var Sequelize=require(_0x9e79('0x0'));module['exports']={'name':{'type':Sequelize[_0x9e79('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9e79('0x1')]},'dialPrefix':{'type':Sequelize[_0x9e79('0x1')]}}; \ No newline at end of file +var _0x1e19=['name','sequelize','exports','STRING'];(function(_0x59796e,_0x1f60b3){var _0x43ea90=function(_0x32e189){while(--_0x32e189){_0x59796e['push'](_0x59796e['shift']());}};_0x43ea90(++_0x1f60b3);}(_0x1e19,0x1c9));var _0x91e1=function(_0x39414d,_0x26b932){_0x39414d=_0x39414d-0x0;var _0x5e2c82=_0x1e19[_0x39414d];return _0x5e2c82;};'use strict';var Sequelize=require(_0x91e1('0x0'));module[_0x91e1('0x1')]={'name':{'type':Sequelize[_0x91e1('0x2')],'unique':_0x91e1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x91e1('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 3b04ab2..21b8166 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 _0x6066=['destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','fields','attributes','length','query','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','CmList','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','findAll','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','ListId','push','each','omit','success','dataValues','errors','getContacts','CmCustomField','CustomFields','format','cf_%d','nolimit','raw','getContactsCsv','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','isEmpty','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','transaction','TEXT','text','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','info','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Lists','UserProfileResource'];(function(_0x214c5e,_0x49db2c){var _0x4ca795=function(_0x3e4328){while(--_0x3e4328){_0x214c5e['push'](_0x214c5e['shift']());}};_0x4ca795(++_0x49db2c);}(_0x6066,0x1c6));var _0x6606=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x6066[_0x999b85];return _0x1d7124;};'use strict';var emlformat=require(_0x6606('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6606('0x1'));var jsonpatch=require(_0x6606('0x2'));var rp=require(_0x6606('0x3'));var moment=require(_0x6606('0x4'));var BPromise=require(_0x6606('0x5'));var Mustache=require(_0x6606('0x6'));var util=require(_0x6606('0x7'));var path=require(_0x6606('0x8'));var sox=require(_0x6606('0x9'));var csv=require(_0x6606('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6606('0xb'));var _=require(_0x6606('0xc'));var squel=require(_0x6606('0xd'));var crypto=require(_0x6606('0xe'));var jsforce=require(_0x6606('0xf'));var deskjs=require(_0x6606('0x10'));var toCsv=require(_0x6606('0xa'));var querystring=require(_0x6606('0x11'));var Papa=require(_0x6606('0x12'));var Redis=require('ioredis');var authService=require(_0x6606('0x13'));var qs=require(_0x6606('0x14'));var as=require(_0x6606('0x15'));var hardwareService=require(_0x6606('0x16'));var logger=require(_0x6606('0x17'))(_0x6606('0x18'));var utils=require(_0x6606('0x19'));var config=require(_0x6606('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0x6606('0x1b')]=_[_0x6606('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6606('0x1d'))(new Redis(config['redis']));require('./cmList.socket')[_0x6606('0x1e')](socket);function respondWithStatusCode(_0x25d333,_0x2fc696){_0x2fc696=_0x2fc696||0xcc;return function(_0x24481c){if(_0x24481c){return _0x25d333['sendStatus'](_0x2fc696);}return _0x25d333[_0x6606('0x1f')](_0x2fc696)[_0x6606('0x20')]();};}function respondWithResult(_0x3dcf03,_0x39c571){_0x39c571=_0x39c571||0xc8;return function(_0x58de81){if(_0x58de81){return _0x3dcf03[_0x6606('0x1f')](_0x39c571)[_0x6606('0x21')](_0x58de81);}};}function respondWithFilteredResult(_0x198414,_0x54ba4f){return function(_0xf460ed){if(_0xf460ed){var _0x14e012=typeof _0x54ba4f[_0x6606('0x22')]===_0x6606('0x23')&&typeof _0x54ba4f[_0x6606('0x24')]===_0x6606('0x23');var _0x13bd1b=_0xf460ed[_0x6606('0x25')];var _0x22bb78=_0x14e012?0x0:_0x54ba4f[_0x6606('0x22')];var _0x575267=_0x14e012?_0xf460ed[_0x6606('0x25')]:_0x54ba4f[_0x6606('0x22')]+_0x54ba4f['limit'];var _0x2c53b3;if(_0x575267>=_0x13bd1b){_0x575267=_0x13bd1b;_0x2c53b3=0xc8;}else{_0x2c53b3=0xce;}_0x198414[_0x6606('0x1f')](_0x2c53b3);return _0x198414[_0x6606('0x26')]('Content-Range',_0x22bb78+'-'+_0x575267+'/'+_0x13bd1b)['json'](_0xf460ed);}return null;};}function patchUpdates(_0x5c5046){return function(_0x1adeeb){try{jsonpatch[_0x6606('0x27')](_0x1adeeb,_0x5c5046,!![]);}catch(_0x1a97aa){return BPromise[_0x6606('0x28')](_0x1a97aa);}return _0x1adeeb[_0x6606('0x29')]();};}function saveUpdates(_0x6be95a,_0x5ce07c){return function(_0x5ef224){if(_0x5ef224){return _0x5ef224[_0x6606('0x2a')](_0x6be95a)[_0x6606('0x2b')](function(_0x306f4c){return _0x306f4c;});}return null;};}function removeEntity(_0x2b3fa0,_0x4693b2){return function(_0x2c151e){if(_0x2c151e){return _0x2c151e['destroy']()[_0x6606('0x2b')](function(){var _0x5a3bbc=_0x2c151e[_0x6606('0x2c')]({'plain':!![]});var _0x4866b3=_0x6606('0x2d');return db[_0x6606('0x2e')][_0x6606('0x2f')]({'where':{'type':_0x4866b3,'resourceId':_0x5a3bbc['id']}})['then'](function(){return _0x2c151e;});})[_0x6606('0x2b')](function(){_0x2b3fa0[_0x6606('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38133c,_0x22b6e9){return function(_0x79a283){if(!_0x79a283){_0x38133c[_0x6606('0x30')](0x194);}return _0x79a283;};}function handleError(_0x5d9039,_0x2c3c1f){_0x2c3c1f=_0x2c3c1f||0x1f4;return function(_0x46deca){logger[_0x6606('0x31')](_0x46deca[_0x6606('0x32')]);if(_0x46deca[_0x6606('0x33')]){delete _0x46deca[_0x6606('0x33')];}_0x5d9039[_0x6606('0x1f')](_0x2c3c1f)[_0x6606('0x34')](_0x46deca);};}exports[_0x6606('0x35')]=function(_0x119499,_0x589e06){var _0x77fb9d={},_0x1e4849={},_0x2cd252={'count':0x0,'rows':[]};var _0x9fd3da=_[_0x6606('0x36')](db['CmList'][_0x6606('0x37')],function(_0x18dfee){return{'name':_0x18dfee[_0x6606('0x38')],'type':_0x18dfee[_0x6606('0x39')][_0x6606('0x3a')]};});_0x1e4849[_0x6606('0x3b')]=_[_0x6606('0x36')](_0x9fd3da,_0x6606('0x33'));_0x1e4849['query']=_[_0x6606('0x3c')](_0x119499['query']);_0x1e4849['filters']=_['intersection'](_0x1e4849[_0x6606('0x3b')],_0x1e4849['query']);_0x77fb9d['attributes']=_[_0x6606('0x3d')](_0x1e4849[_0x6606('0x3b')],qs['fields'](_0x119499['query'][_0x6606('0x3e')]));_0x77fb9d[_0x6606('0x3f')]=_0x77fb9d[_0x6606('0x3f')][_0x6606('0x40')]?_0x77fb9d[_0x6606('0x3f')]:_0x1e4849[_0x6606('0x3b')];if(!_0x119499['query']['hasOwnProperty']('nolimit')){_0x77fb9d[_0x6606('0x24')]=qs[_0x6606('0x24')](_0x119499['query']['limit']);_0x77fb9d[_0x6606('0x22')]=qs['offset'](_0x119499[_0x6606('0x41')]['offset']);}_0x77fb9d[_0x6606('0x42')]=qs[_0x6606('0x43')](_0x119499['query'][_0x6606('0x43')]);_0x77fb9d[_0x6606('0x44')]=qs[_0x6606('0x45')](_[_0x6606('0x46')](_0x119499['query'],_0x1e4849[_0x6606('0x45')]),_0x9fd3da);if(_0x119499['query'][_0x6606('0x47')]){_0x77fb9d[_0x6606('0x44')]=_['merge'](_0x77fb9d[_0x6606('0x44')],{'$or':_[_0x6606('0x36')](_0x9fd3da,function(_0x90291b){if(_0x90291b[_0x6606('0x39')]!==_0x6606('0x48')){var _0x112c51={};_0x112c51[_0x90291b['name']]={'$like':'%'+_0x119499[_0x6606('0x41')][_0x6606('0x47')]+'%'};return _0x112c51;}})});}_0x77fb9d=_[_0x6606('0x49')]({},_0x77fb9d,_0x119499[_0x6606('0x4a')]);var _0x29ba95={'where':_0x77fb9d[_0x6606('0x44')]};return db['CmList'][_0x6606('0x25')](_0x29ba95)[_0x6606('0x2b')](function(_0x4b8a1e){_0x2cd252[_0x6606('0x25')]=_0x4b8a1e;if(_0x119499['query'][_0x6606('0x4b')]){_0x77fb9d['include']=[{'all':!![]}];}return db[_0x6606('0x4c')]['findAll'](_0x77fb9d);})[_0x6606('0x2b')](function(_0x4878d8){_0x2cd252['rows']=_0x4878d8;return _0x2cd252;})[_0x6606('0x2b')](respondWithFilteredResult(_0x589e06,_0x77fb9d))[_0x6606('0x4d')](handleError(_0x589e06,null));};exports[_0x6606('0x4e')]=function(_0x5a47c0,_0x59f445){var _0x49b5e8={'raw':![],'where':{'id':_0x5a47c0[_0x6606('0x4f')]['id']}},_0x49052d={};_0x49052d[_0x6606('0x3b')]=_[_0x6606('0x3c')](db[_0x6606('0x4c')][_0x6606('0x37')]);_0x49052d['query']=_[_0x6606('0x3c')](_0x5a47c0['query']);_0x49052d[_0x6606('0x45')]=_[_0x6606('0x3d')](_0x49052d[_0x6606('0x3b')],_0x49052d[_0x6606('0x41')]);_0x49b5e8[_0x6606('0x3f')]=_[_0x6606('0x3d')](_0x49052d[_0x6606('0x3b')],qs[_0x6606('0x3e')](_0x5a47c0[_0x6606('0x41')][_0x6606('0x3e')]));_0x49b5e8[_0x6606('0x3f')]=_0x49b5e8[_0x6606('0x3f')]['length']?_0x49b5e8[_0x6606('0x3f')]:_0x49052d['model'];if(_0x5a47c0[_0x6606('0x41')][_0x6606('0x4b')]){_0x49b5e8[_0x6606('0x50')]=[{'all':!![]}];}_0x49b5e8=_[_0x6606('0x49')]({},_0x49b5e8,_0x5a47c0[_0x6606('0x4a')]);return db[_0x6606('0x4c')][_0x6606('0x51')](_0x49b5e8)[_0x6606('0x2b')](handleEntityNotFound(_0x59f445,null))[_0x6606('0x2b')](respondWithResult(_0x59f445,null))[_0x6606('0x4d')](handleError(_0x59f445,null));};exports['create']=function(_0x5d653b,_0x23f4b3){return db[_0x6606('0x4c')][_0x6606('0x52')](_0x5d653b[_0x6606('0x53')],{})[_0x6606('0x2b')](function(_0x4d0766){var _0x4849d3=_0x5d653b['user'][_0x6606('0x2c')]({'plain':!![]});if(!_0x4849d3)throw new Error(_0x6606('0x54'));if(_0x4849d3[_0x6606('0x55')]===_0x6606('0x56')){var _0x550829=_0x4d0766[_0x6606('0x2c')]({'plain':!![]});var _0x3f4d5e=_0x6606('0x2d');return db[_0x6606('0x57')][_0x6606('0x51')]({'where':{'name':_0x3f4d5e,'userProfileId':_0x4849d3[_0x6606('0x58')]},'raw':!![]})[_0x6606('0x2b')](function(_0xbf5155){if(_0xbf5155&&_0xbf5155[_0x6606('0x59')]===0x0){return db[_0x6606('0x2e')][_0x6606('0x52')]({'name':_0x550829[_0x6606('0x33')],'resourceId':_0x550829['id'],'type':_0xbf5155[_0x6606('0x33')],'sectionId':_0xbf5155['id']},{})[_0x6606('0x2b')](function(){return _0x4d0766;});}else{return _0x4d0766;}})['catch'](function(_0x3b4ec1){logger[_0x6606('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b4ec1);throw _0x3b4ec1;});}return _0x4d0766;})['then'](respondWithResult(_0x23f4b3,0xc9))[_0x6606('0x4d')](handleError(_0x23f4b3,null));};exports['update']=function(_0x41cacd,_0x3717df){if(_0x41cacd[_0x6606('0x53')]['id']){delete _0x41cacd[_0x6606('0x53')]['id'];}return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0x41cacd['params']['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x3717df,null))[_0x6606('0x2b')](saveUpdates(_0x41cacd[_0x6606('0x53')],null))[_0x6606('0x2b')](respondWithResult(_0x3717df,null))[_0x6606('0x4d')](handleError(_0x3717df,null));};exports[_0x6606('0x2f')]=function(_0x3f8f55,_0x13bd7c){return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0x3f8f55[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x13bd7c,null))[_0x6606('0x2b')](removeEntity(_0x13bd7c,null))[_0x6606('0x4d')](handleError(_0x13bd7c,null));};exports['describe']=function(_0xd053f2,_0x1399fb){return db[_0x6606('0x4c')][_0x6606('0x5a')]()[_0x6606('0x2b')](respondWithResult(_0x1399fb,null))[_0x6606('0x4d')](handleError(_0x1399fb,null));};exports[_0x6606('0x5b')]=function(_0x1fe643,_0x3e3401,_0x2bd25a){if(_0x1fe643['body']['id']){delete _0x1fe643[_0x6606('0x53')]['id'];}return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0x1fe643[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x3e3401,null))[_0x6606('0x2b')](function(_0x38e691){if(_0x38e691){_0x1fe643['body']['ListId']=_0x38e691['id'];return db[_0x6606('0x5c')][_0x6606('0x52')](_0x1fe643[_0x6606('0x53')]);}})[_0x6606('0x2b')](respondWithResult(_0x3e3401,null))[_0x6606('0x4d')](handleError(_0x3e3401,null));};exports[_0x6606('0x5d')]=function(_0x235190,_0x2fea0c,_0x393ff1){var _0x11f658={'raw':![],'where':{}};var _0x46324e={};var _0x2116f0={'count':0x0,'rows':[]};return db[_0x6606('0x4c')]['findOne']({'where':{'id':_0x235190[_0x6606('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2fea0c,null))[_0x6606('0x2b')](function(_0x2cefa7){if(_0x2cefa7){_0x46324e[_0x6606('0x3b')]=_[_0x6606('0x3c')](db[_0x6606('0x5c')][_0x6606('0x37')]);_0x46324e[_0x6606('0x41')]=_['keys'](_0x235190['query']);_0x46324e['filters']=_['intersection'](_0x46324e[_0x6606('0x3b')],_0x46324e[_0x6606('0x41')]);_0x11f658[_0x6606('0x3f')]=_[_0x6606('0x3d')](_0x46324e[_0x6606('0x3b')],qs[_0x6606('0x3e')](_0x235190[_0x6606('0x41')][_0x6606('0x3e')]));_0x11f658['attributes']=_0x11f658[_0x6606('0x3f')][_0x6606('0x40')]?_0x11f658['attributes']:_0x46324e[_0x6606('0x3b')];if(!_0x235190[_0x6606('0x41')][_0x6606('0x5e')]('nolimit')){_0x11f658[_0x6606('0x24')]=qs[_0x6606('0x24')](_0x235190['query'][_0x6606('0x24')]);_0x11f658[_0x6606('0x22')]=qs[_0x6606('0x22')](_0x235190[_0x6606('0x41')][_0x6606('0x22')]);}_0x11f658[_0x6606('0x42')]=qs[_0x6606('0x43')](_0x235190[_0x6606('0x41')][_0x6606('0x43')]);_0x11f658['where']=qs[_0x6606('0x45')](_[_0x6606('0x46')](_0x235190['query'],_0x46324e[_0x6606('0x45')]));_0x11f658[_0x6606('0x44')]['ListId']=_0x2cefa7['id'];if(_0x235190['query'][_0x6606('0x47')]){_0x11f658[_0x6606('0x44')]=_[_0x6606('0x49')](_0x11f658[_0x6606('0x44')],{'$or':_[_0x6606('0x36')](_0x11f658[_0x6606('0x3f')],function(_0x5cece8){var _0x3a2ed5={};_0x3a2ed5[_0x5cece8]={'$like':'%'+_0x235190['query'][_0x6606('0x47')]+'%'};return _0x3a2ed5;})});}_0x11f658=_[_0x6606('0x49')]({},_0x11f658,_0x235190['options']);return db[_0x6606('0x5c')][_0x6606('0x25')]({'where':_0x11f658['where']})[_0x6606('0x2b')](function(_0x16a3cd){_0x2116f0[_0x6606('0x25')]=_0x16a3cd;if(_0x235190[_0x6606('0x41')][_0x6606('0x4b')]){_0x11f658[_0x6606('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x6606('0x5f')](_0x11f658);})[_0x6606('0x2b')](function(_0x41dbd4){_0x2116f0[_0x6606('0x60')]=_0x41dbd4;return _0x2116f0;});}})[_0x6606('0x2b')](respondWithFilteredResult(_0x2fea0c,_0x11f658))[_0x6606('0x4d')](handleError(_0x2fea0c,null));};exports[_0x6606('0x61')]=function(_0x11a8d3,_0xea5d88,_0x49ac29){return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0x11a8d3[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0xea5d88,null))[_0x6606('0x2b')](function(_0x4d243b){if(_0x4d243b){return _0x4d243b[_0x6606('0x61')](_0x11a8d3['query'][_0x6606('0x62')]);}})[_0x6606('0x2b')](respondWithStatusCode(_0xea5d88,null))[_0x6606('0x4d')](handleError(_0xea5d88,null));};exports[_0x6606('0x63')]=function(_0x5a8ddf,_0x4e3eb1,_0x16b5ba){return db[_0x6606('0x4c')]['find']({'where':{'id':_0x5a8ddf[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x4e3eb1,null))[_0x6606('0x2b')](function(_0x1074c0){if(_0x1074c0){var _0x1b96ed=[];var _0x48adbb={'success':[],'errors':[]};return db[_0x6606('0x64')][_0x6606('0x5a')]()[_0x6606('0x2b')](function(_0x11d8d5){if(_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')]&&_[_0x6606('0x66')](_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')])){if(_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')][_0x6606('0x40')]){_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')]=_0x5a8ddf[_0x6606('0x53')]['tags'][_0x6606('0x67')](';')+';';}else{_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')]=null;}}else{_0x5a8ddf[_0x6606('0x53')][_0x6606('0x65')]=null;}if(_0x5a8ddf[_0x6606('0x53')]&&_[_0x6606('0x66')](_0x5a8ddf['body'])){for(var _0x2a4d57=0x0;_0x2a4d57<_0x5a8ddf[_0x6606('0x53')][_0x6606('0x40')];_0x2a4d57+=0x1){_0x5a8ddf[_0x6606('0x53')][_0x2a4d57][_0x6606('0x68')]=_0x5a8ddf[_0x6606('0x4f')]['id'];_0x1b96ed[_0x6606('0x69')](_0x5a8ddf[_0x6606('0x53')][_0x2a4d57]);}return BPromise[_0x6606('0x6a')](_0x1b96ed,function(_0x28bfb3){return db[_0x6606('0x64')][_0x6606('0x52')](_[_0x6606('0x6b')](_0x28bfb3,[_0x6606('0x62'),'id'])||{},{'fields':_['keys'](_0x11d8d5),'raw':!![]})[_0x6606('0x2b')](function(_0x5dfc12){_0x48adbb[_0x6606('0x6c')][_0x6606('0x69')](_0x5dfc12[_0x6606('0x6d')]);})[_0x6606('0x4d')](function(_0x4a9cb5){_0x48adbb[_0x6606('0x6e')][_0x6606('0x69')]({'data':_0x28bfb3,'error':_0x4a9cb5['message']});});})[_0x6606('0x2b')](function(_0x466860){return _0x48adbb;})[_0x6606('0x4d')](function(_0x1ddd0b){return _0x1ddd0b;});}else{_0x4e3eb1[_0x6606('0x1f')](0x190)[_0x6606('0x21')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6606('0x2b')](respondWithResult(_0x4e3eb1,null))['catch'](handleError(_0x4e3eb1,null));};exports[_0x6606('0x6f')]=function(_0x56535f,_0x4c210e,_0xf6c684){var _0x5d6963;return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0x56535f['params']['id']},'include':[{'model':db[_0x6606('0x70')],'as':_0x6606('0x71')}]})['then'](handleEntityNotFound(_0x4c210e,null))[_0x6606('0x2b')](function(_0x4def2a){if(_0x4def2a){_0x5d6963=_0x4def2a;return db[_0x6606('0x64')]['rawAttributes'];}})[_0x6606('0x2b')](function(_0x1bfbcd){if(_0x1bfbcd){var _0x5a6033={};var _0x116a90={};_0x116a90[_0x6606('0x3b')]=_['concat'](_[_0x6606('0x3c')](_0x1bfbcd),_[_0x6606('0x36')](_0x5d6963[_0x6606('0x71')],function(_0x357382){return util[_0x6606('0x72')](_0x6606('0x73'),_0x357382['id']);}));_0x116a90[_0x6606('0x41')]=_[_0x6606('0x3c')](_0x56535f['query']);_0x116a90[_0x6606('0x45')]=_[_0x6606('0x3d')](_0x116a90[_0x6606('0x3b')],_0x116a90[_0x6606('0x41')]);_0x5a6033[_0x6606('0x3f')]=_[_0x6606('0x3d')](_0x116a90['model'],qs['fields'](_0x56535f[_0x6606('0x41')][_0x6606('0x3e')]));_0x5a6033[_0x6606('0x3f')]=_0x5a6033['attributes'][_0x6606('0x40')]?_0x5a6033[_0x6606('0x3f')]:_0x116a90[_0x6606('0x3b')];if(!_0x56535f[_0x6606('0x41')][_0x6606('0x5e')](_0x6606('0x74'))){_0x5a6033[_0x6606('0x24')]=qs['limit'](_0x56535f[_0x6606('0x41')][_0x6606('0x24')]);_0x5a6033[_0x6606('0x22')]=qs[_0x6606('0x22')](_0x56535f['query'][_0x6606('0x22')]);}_0x5a6033[_0x6606('0x42')]=qs[_0x6606('0x43')](_0x56535f[_0x6606('0x41')][_0x6606('0x43')]);_0x5a6033[_0x6606('0x44')]=qs['filters'](_[_0x6606('0x46')](_0x56535f[_0x6606('0x41')],_0x116a90[_0x6606('0x45')]));_0x5a6033[_0x6606('0x75')]=!![];if(_0x56535f[_0x6606('0x41')][_0x6606('0x47')]){_0x5a6033[_0x6606('0x44')]=_['merge'](_0x5a6033[_0x6606('0x44')],{'$or':_[_0x6606('0x36')](_0x5a6033[_0x6606('0x3f')],function(_0x18f0c8){var _0x32a864={};_0x32a864[_0x18f0c8]={'$like':'%'+_0x56535f['query'][_0x6606('0x47')]+'%'};return _0x32a864;})});}_0x5a6033=_[_0x6606('0x49')]({},_0x5a6033,_0x56535f[_0x6606('0x4a')]);return _0x5d6963[_0x6606('0x6f')](_0x5a6033);}})[_0x6606('0x2b')](respondWithResult(_0x4c210e,null))[_0x6606('0x4d')](handleError(_0x4c210e,null));};exports[_0x6606('0x76')]=function(_0x54ab1c,_0x18fee1,_0x262b50){var _0x56323c;var _0x1f7037;var _0x49f162;var _0x267131=_0x54ab1c[_0x6606('0x4f')]['id'];csv_results=[];return db['ContactItemType'][_0x6606('0x5f')]({'attributes':['id',_0x6606('0x33')],'raw':!![],'order':['OrderBy']})[_0x6606('0x2b')](function(_0x48bf23){_0x56323c=_0x48bf23;var _0x20e802=_['keys'](db['CmContact'][_0x6606('0x37')]);return db[_0x6606('0x70')][_0x6606('0x5f')]({'raw':!![],'attributes':['id',_0x6606('0x77')]})[_0x6606('0x2b')](function(_0x399e9b){_0x1f7037=_0x399e9b;var _0x220670=squel[_0x6606('0x78')]()[_0x6606('0x3e')](_0x20e802)[_0x6606('0x79')]('cm_contacts','c')[_0x6606('0x44')](_0x6606('0x7a'),_0x267131)[_0x6606('0x44')](_0x6606('0x7b'))[_0x6606('0x7c')]();for(var _0x34074b=0x0;_0x34074b<_0x1f7037['length'];_0x34074b++){_0x220670['field'](_0x6606('0x7d')+_0x1f7037[_0x34074b]['id'],_0x6606('0x7e')+_0x1f7037[_0x34074b][_0x6606('0x77')]);}for(var _0x34074b=0x0;_0x34074b<_0x56323c['length'];_0x34074b++){_0x220670[_0x6606('0x7f')](squel[_0x6606('0x78')]()['field'](_0x6606('0x80'))['from'](_0x6606('0x81'))[_0x6606('0x44')](_0x6606('0x82'),_0x56323c[_0x34074b]['id'])['where'](_0x6606('0x83')),_0x6606('0x84')+_0x56323c[_0x34074b]['name']);_0x220670[_0x6606('0x7f')](squel[_0x6606('0x78')]()[_0x6606('0x7f')](_0x6606('0x85'))[_0x6606('0x79')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x56323c[_0x34074b]['id'])[_0x6606('0x44')](_0x6606('0x83')),_0x6606('0x86')+_0x56323c[_0x34074b][_0x6606('0x33')]);}var _0x5b1941=[];_0x5b1941[_0x6606('0x69')](_0x220670['toString']());BPromise[_0x6606('0x6a')](_0x5b1941,handleQuery)['then'](function(_0xc0d394){handleQuery(_0x220670['toString']());var _0x2afa23=csv_results[0x0];if(!_[_0x6606('0x87')](_0x2afa23)){var _0x5e022c=toCsv(_0x2afa23);var _0x12e64f=Date[_0x6606('0x88')]();fs[_0x6606('0x89')](util[_0x6606('0x72')]('/tmp/list_%d_%s.csv',_0x267131,_0x12e64f),_0x5e022c);_0x18fee1[_0x6606('0x8a')](_0x6606('0x8b'),'attachment;\x20filename='+util[_0x6606('0x72')](_0x6606('0x8c'),_0x267131,_0x12e64f));_0x18fee1[_0x6606('0x8a')]('Content-type','text/csv');return _0x18fee1['download'](util[_0x6606('0x72')](_0x6606('0x8d'),_0x267131,_0x12e64f));}else{return _0x18fee1[_0x6606('0x30')](0xcc);}});});});};exports[_0x6606('0x8e')]=function(_0x4ef882,_0x22ad86,_0x8358e2){var _0x17399b;delete _0x4ef882[_0x6606('0x53')]['id'];return db[_0x6606('0x4c')][_0x6606('0x8f')]({'where':{'id':_0x4ef882['params']['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x22ad86,null))[_0x6606('0x2b')](function(_0x1785bc){if(_0x1785bc){return db[_0x6606('0x90')][_0x6606('0x91')](function(_0x296512){return db[_0x6606('0x70')][_0x6606('0x52')](_0x4ef882[_0x6606('0x53')],{'transaction':_0x296512})[_0x6606('0x2b')](function(_0x22fa1f){_0x17399b=_0x22fa1f;return _0x1785bc['addCustomFields'](_0x22fa1f,{'transaction':_0x296512});})[_0x6606('0x2b')](function(){var _0x563172={'type':db['Sequelize'][_0x6606('0x92')],'transaction':_0x296512};switch(_0x4ef882[_0x6606('0x53')]['type']){case _0x6606('0x93'):_0x563172[_0x6606('0x39')]=db[_0x6606('0x94')][_0x6606('0x92')];break;case _0x6606('0x95'):_0x563172[_0x6606('0x39')]=db[_0x6606('0x94')]['INTEGER'];break;case _0x6606('0x96'):_0x563172[_0x6606('0x39')]=db[_0x6606('0x94')][_0x6606('0x97')];_0x563172[_0x6606('0x98')]=![];break;default:}return db['sequelize'][_0x6606('0x99')][_0x6606('0x9a')](_0x6606('0x9b'),util[_0x6606('0x72')](_0x6606('0x9c'),_0x17399b['id']),_0x563172);})['then'](function(){return _0x17399b;});});}})[_0x6606('0x2b')](respondWithResult(_0x22ad86,null))['catch'](handleError(_0x22ad86,null));};exports[_0x6606('0x9d')]=function(_0x1c7db7,_0xb28bc7,_0x158f6e){var _0x253777={};var _0x4f820c={};var _0x3db858;var _0x26bc2e;return db['CmList'][_0x6606('0x8f')]({'where':{'id':_0x1c7db7['params']['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0xb28bc7,null))['then'](function(_0x392e47){if(_0x392e47){_0x3db858=_0x392e47;_0x4f820c[_0x6606('0x3b')]=_[_0x6606('0x3c')](db[_0x6606('0x70')][_0x6606('0x37')]);_0x4f820c['query']=_[_0x6606('0x3c')](_0x1c7db7[_0x6606('0x41')]);_0x4f820c['filters']=_[_0x6606('0x3d')](_0x4f820c[_0x6606('0x3b')],_0x4f820c['query']);_0x253777[_0x6606('0x3f')]=_['intersection'](_0x4f820c[_0x6606('0x3b')],qs[_0x6606('0x3e')](_0x1c7db7[_0x6606('0x41')][_0x6606('0x3e')]));_0x253777['attributes']=_0x253777['attributes'][_0x6606('0x40')]?_0x253777[_0x6606('0x3f')]:_0x4f820c[_0x6606('0x3b')];_0x253777[_0x6606('0x42')]=qs[_0x6606('0x43')](_0x1c7db7[_0x6606('0x41')]['sort']);_0x253777[_0x6606('0x44')]=qs[_0x6606('0x45')](_[_0x6606('0x46')](_0x1c7db7[_0x6606('0x41')],_0x4f820c['filters']));_0x253777[_0x6606('0x44')]=_[_0x6606('0x49')](_0x253777[_0x6606('0x44')],{'$or':[{'ListId':_0x392e47['id']},{'ListId':null}]});if(_0x1c7db7[_0x6606('0x41')][_0x6606('0x47')]){_0x253777[_0x6606('0x44')]=_['merge'](_0x253777[_0x6606('0x44')],{'$or':_[_0x6606('0x36')](_0x253777[_0x6606('0x3f')],function(_0x44fdfa){var _0x290527={};_0x290527[_0x44fdfa]={'$like':'%'+_0x1c7db7[_0x6606('0x41')][_0x6606('0x47')]+'%'};return _0x290527;})});}_0x253777=_[_0x6606('0x49')]({},_0x253777,_0x1c7db7[_0x6606('0x4a')]);return db['CmCustomField'][_0x6606('0x9e')](_0x253777);}})['then'](respondWithResult(_0xb28bc7,null))[_0x6606('0x4d')](handleError(_0xb28bc7,null));};exports['getGlobalCustomFields']=function(_0x55d8be,_0x7df043){return db[_0x6606('0x70')]['findAndCountAll']({'where':{'ListId':null}})[_0x6606('0x2b')](handleEntityNotFound(_0x7df043,null))[_0x6606('0x2b')](function(_0x41eeca){return _0x41eeca;})[_0x6606('0x2b')](respondWithResult(_0x7df043,null))['catch'](handleError(_0x7df043,null));};exports[_0x6606('0x9f')]=function(_0x43db13,_0x5d0177,_0x3e0146){return db[_0x6606('0x4c')]['find']({'where':{'id':_0x43db13[_0x6606('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5d0177,null))[_0x6606('0x2b')](function(_0x248ad7){if(_0x248ad7){return _0x248ad7[_0x6606('0x9f')](_0x43db13[_0x6606('0x53')][_0x6606('0x62')],_[_0x6606('0x6b')](_0x43db13[_0x6606('0x53')],[_0x6606('0x62'),'id'])||{})[_0x6606('0xa0')](function(_0x3ff652){for(var _0x5f3030=0x0;_0x5f3030<_0x43db13[_0x6606('0x53')][_0x6606('0x62')][_0x6606('0x40')];_0x5f3030+=0x1){socket[_0x6606('0xa1')](_0x6606('0xa2'),{'UserId':Number(_0x43db13[_0x6606('0x53')][_0x6606('0x62')][_0x5f3030]),'CmListId':Number(_0x43db13[_0x6606('0x4f')]['id'])});}return _0x3ff652;});}})['then'](respondWithResult(_0x5d0177,null))[_0x6606('0x4d')](handleError(_0x5d0177,null));};exports[_0x6606('0xa3')]=function(_0xe5db79,_0x44e406,_0x2de9b6){return db[_0x6606('0x4c')][_0x6606('0x51')]({'where':{'id':_0xe5db79[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x44e406,null))[_0x6606('0x2b')](function(_0x52dfd4){if(_0x52dfd4){return _0x52dfd4[_0x6606('0xa3')](_0xe5db79['query'][_0x6606('0x62')])[_0x6606('0x2b')](function(){if(_[_0x6606('0x66')](_0xe5db79['query']['ids'])){for(var _0x3df7ab=0x0;_0x3df7ab<_0xe5db79['query'][_0x6606('0x62')][_0x6606('0x40')];_0x3df7ab+=0x1){socket[_0x6606('0xa1')](_0x6606('0xa4'),{'UserId':Number(_0xe5db79[_0x6606('0x41')]['ids'][_0x3df7ab]),'CmListId':Number(_0xe5db79[_0x6606('0x4f')]['id'])});}}else{socket[_0x6606('0xa1')](_0x6606('0xa4'),{'UserId':Number(_0xe5db79[_0x6606('0x41')][_0x6606('0x62')]),'CmListId':Number(_0xe5db79['params']['id'])});}});}})['then'](respondWithStatusCode(_0x44e406,null))[_0x6606('0x4d')](handleError(_0x44e406,null));};exports['getAgents']=function(_0x45abd1,_0x529185,_0x362a3d){var _0x1d281d={};var _0x4d7f62={};var _0x21125b;var _0x3b3546;return db[_0x6606('0x4c')][_0x6606('0x8f')]({'where':{'id':_0x45abd1[_0x6606('0x4f')]['id']}})[_0x6606('0x2b')](handleEntityNotFound(_0x529185,null))[_0x6606('0x2b')](function(_0xf4a850){if(_0xf4a850){_0x21125b=_0xf4a850;_0x4d7f62[_0x6606('0x3b')]=_[_0x6606('0x3c')](db[_0x6606('0xa5')][_0x6606('0x37')]);_0x4d7f62['query']=_[_0x6606('0x3c')](_0x45abd1['query']);_0x4d7f62[_0x6606('0x45')]=_['intersection'](_0x4d7f62[_0x6606('0x3b')],_0x4d7f62[_0x6606('0x41')]);_0x1d281d[_0x6606('0x3f')]=_[_0x6606('0x3d')](_0x4d7f62[_0x6606('0x3b')],qs[_0x6606('0x3e')](_0x45abd1['query'][_0x6606('0x3e')]));_0x1d281d[_0x6606('0x3f')]=_0x1d281d['attributes']['length']?_0x1d281d['attributes']:_0x4d7f62[_0x6606('0x3b')];_0x1d281d[_0x6606('0x42')]=qs[_0x6606('0x43')](_0x45abd1[_0x6606('0x41')][_0x6606('0x43')]);_0x1d281d[_0x6606('0x44')]=qs[_0x6606('0x45')](_[_0x6606('0x46')](_0x45abd1['query'],_0x4d7f62[_0x6606('0x45')]));if(_0x45abd1[_0x6606('0x41')]['filter']){_0x1d281d[_0x6606('0x44')]=_[_0x6606('0x49')](_0x1d281d['where'],{'$or':_['map'](_0x1d281d[_0x6606('0x3f')],function(_0x2c0bf3){var _0x5b75a2={};_0x5b75a2[_0x2c0bf3]={'$like':'%'+_0x45abd1['query'][_0x6606('0x47')]+'%'};return _0x5b75a2;})});}_0x1d281d=_[_0x6606('0x49')]({},_0x1d281d,_0x45abd1[_0x6606('0x4a')]);return _0x21125b['getAgents'](_0x1d281d);}})['then'](function(_0x2bff4c){if(_0x2bff4c){_0x3b3546=_0x2bff4c[_0x6606('0x40')];if(!_0x45abd1[_0x6606('0x41')][_0x6606('0x5e')]('nolimit')){_0x1d281d[_0x6606('0x24')]=qs[_0x6606('0x24')](_0x45abd1[_0x6606('0x41')][_0x6606('0x24')]);_0x1d281d[_0x6606('0x22')]=qs['offset'](_0x45abd1['query'][_0x6606('0x22')]);}return _0x21125b['getAgents'](_0x1d281d);}})[_0x6606('0x2b')](function(_0x3846ee){if(_0x3846ee){return _0x3846ee?{'count':_0x3b3546,'rows':_0x3846ee}:null;}})['then'](respondWithResult(_0x529185,null))[_0x6606('0x4d')](handleError(_0x529185,null));};function handleQuery(_0x31fdc8){logger[_0x6606('0xa6')](_0x31fdc8);return db[_0x6606('0x90')][_0x6606('0x41')](_0x31fdc8)[_0x6606('0xa0')](function(_0x54fb05){csv_results[_0x6606('0x69')](_0x54fb05);})['catch'](function(_0x168845){logger[_0x6606('0x31')](_0x168845['message']);});} \ No newline at end of file +var _0x5072=['addAgents','emit','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','Lists','error','stack','name','send','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','ListId','Disposition','findOne','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','alias','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','type','text','TEXT','number','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','findAndCountAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5072,0xab));var _0x2507=function(_0x33925f,_0x2d786c){_0x33925f=_0x33925f-0x0;var _0x18a94e=_0x5072[_0x33925f];return _0x18a94e;};'use strict';var emlformat=require(_0x2507('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2507('0x1'));var jsonpatch=require(_0x2507('0x2'));var rp=require(_0x2507('0x3'));var moment=require('moment');var BPromise=require(_0x2507('0x4'));var Mustache=require(_0x2507('0x5'));var util=require(_0x2507('0x6'));var path=require(_0x2507('0x7'));var sox=require(_0x2507('0x8'));var csv=require('to-csv');var ejs=require(_0x2507('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2507('0xa'));var squel=require(_0x2507('0xb'));var crypto=require(_0x2507('0xc'));var jsforce=require(_0x2507('0xd'));var deskjs=require(_0x2507('0xe'));var toCsv=require(_0x2507('0xf'));var querystring=require(_0x2507('0x10'));var Papa=require(_0x2507('0x11'));var Redis=require(_0x2507('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2507('0x13'));var hardwareService=require(_0x2507('0x14'));var logger=require(_0x2507('0x15'))(_0x2507('0x16'));var utils=require(_0x2507('0x17'));var config=require(_0x2507('0x18'));var licenseUtil=require(_0x2507('0x19'));var db=require(_0x2507('0x1a'))['db'];var csv_results;config['redis']=_[_0x2507('0x1b')](config[_0x2507('0x1c')],{'host':_0x2507('0x1d'),'port':0x18eb});var socket=require(_0x2507('0x1e'))(new Redis(config['redis']));require(_0x2507('0x1f'))['register'](socket);function respondWithStatusCode(_0x46fab4,_0x26d7b3){_0x26d7b3=_0x26d7b3||0xcc;return function(_0xf94cae){if(_0xf94cae){return _0x46fab4[_0x2507('0x20')](_0x26d7b3);}return _0x46fab4['status'](_0x26d7b3)[_0x2507('0x21')]();};}function respondWithResult(_0x124bae,_0x12719d){_0x12719d=_0x12719d||0xc8;return function(_0x5de3af){if(_0x5de3af){return _0x124bae[_0x2507('0x22')](_0x12719d)['json'](_0x5de3af);}};}function respondWithFilteredResult(_0x563e1,_0x3898b8){return function(_0x6780c5){if(_0x6780c5){var _0x548b4e=typeof _0x3898b8[_0x2507('0x23')]===_0x2507('0x24')&&typeof _0x3898b8['limit']===_0x2507('0x24');var _0x346836=_0x6780c5[_0x2507('0x25')];var _0x4a1a20=_0x548b4e?0x0:_0x3898b8['offset'];var _0x3a1163=_0x548b4e?_0x6780c5[_0x2507('0x25')]:_0x3898b8[_0x2507('0x23')]+_0x3898b8[_0x2507('0x26')];var _0x2a3681;if(_0x3a1163>=_0x346836){_0x3a1163=_0x346836;_0x2a3681=0xc8;}else{_0x2a3681=0xce;}_0x563e1[_0x2507('0x22')](_0x2a3681);return _0x563e1[_0x2507('0x27')](_0x2507('0x28'),_0x4a1a20+'-'+_0x3a1163+'/'+_0x346836)[_0x2507('0x29')](_0x6780c5);}return null;};}function patchUpdates(_0x1282c4){return function(_0x30483b){try{jsonpatch[_0x2507('0x2a')](_0x30483b,_0x1282c4,!![]);}catch(_0x5e6ed0){return BPromise['reject'](_0x5e6ed0);}return _0x30483b[_0x2507('0x2b')]();};}function saveUpdates(_0x4ad4e7,_0x4dea62){return function(_0x390818){if(_0x390818){return _0x390818[_0x2507('0x2c')](_0x4ad4e7)[_0x2507('0x2d')](function(_0x2e5668){return _0x2e5668;});}return null;};}function removeEntity(_0x39451a,_0x76302d){return function(_0x13dee5){if(_0x13dee5){return _0x13dee5[_0x2507('0x2e')]()[_0x2507('0x2d')](function(){var _0x1fc2fe=_0x13dee5[_0x2507('0x2f')]({'plain':!![]});var _0x34a3fa=_0x2507('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x34a3fa,'resourceId':_0x1fc2fe['id']}})[_0x2507('0x2d')](function(){return _0x13dee5;});})[_0x2507('0x2d')](function(){_0x39451a['status'](0xcc)[_0x2507('0x21')]();});}};}function handleEntityNotFound(_0x4154fa,_0x22cc0d){return function(_0x1f044c){if(!_0x1f044c){_0x4154fa[_0x2507('0x20')](0x194);}return _0x1f044c;};}function handleError(_0x5e4513,_0x58409d){_0x58409d=_0x58409d||0x1f4;return function(_0x47f1f4){logger[_0x2507('0x31')](_0x47f1f4[_0x2507('0x32')]);if(_0x47f1f4[_0x2507('0x33')]){delete _0x47f1f4['name'];}_0x5e4513[_0x2507('0x22')](_0x58409d)[_0x2507('0x34')](_0x47f1f4);};}exports['index']=function(_0x663524,_0x553960){var _0x8e6160={},_0x33d593={},_0x128a81={'count':0x0,'rows':[]};var _0x3e528b=_[_0x2507('0x35')](db[_0x2507('0x36')][_0x2507('0x37')],function(_0x3b5dfe){return{'name':_0x3b5dfe[_0x2507('0x38')],'type':_0x3b5dfe['type'][_0x2507('0x39')]};});_0x33d593[_0x2507('0x3a')]=_[_0x2507('0x35')](_0x3e528b,_0x2507('0x33'));_0x33d593[_0x2507('0x3b')]=_[_0x2507('0x3c')](_0x663524[_0x2507('0x3b')]);_0x33d593[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x33d593[_0x2507('0x3a')],_0x33d593[_0x2507('0x3b')]);_0x8e6160[_0x2507('0x3f')]=_[_0x2507('0x3e')](_0x33d593[_0x2507('0x3a')],qs['fields'](_0x663524[_0x2507('0x3b')]['fields']));_0x8e6160[_0x2507('0x3f')]=_0x8e6160[_0x2507('0x3f')][_0x2507('0x40')]?_0x8e6160[_0x2507('0x3f')]:_0x33d593[_0x2507('0x3a')];if(!_0x663524[_0x2507('0x3b')][_0x2507('0x41')](_0x2507('0x42'))){_0x8e6160['limit']=qs[_0x2507('0x26')](_0x663524[_0x2507('0x3b')]['limit']);_0x8e6160['offset']=qs[_0x2507('0x23')](_0x663524[_0x2507('0x3b')][_0x2507('0x23')]);}_0x8e6160[_0x2507('0x43')]=qs[_0x2507('0x44')](_0x663524[_0x2507('0x3b')]['sort']);_0x8e6160[_0x2507('0x45')]=qs['filters'](_[_0x2507('0x46')](_0x663524[_0x2507('0x3b')],_0x33d593[_0x2507('0x3d')]),_0x3e528b);if(_0x663524['query'][_0x2507('0x47')]){_0x8e6160[_0x2507('0x45')]=_[_0x2507('0x48')](_0x8e6160[_0x2507('0x45')],{'$or':_[_0x2507('0x35')](_0x3e528b,function(_0x6326a3){if(_0x6326a3['type']!=='VIRTUAL'){var _0x5c0af3={};_0x5c0af3[_0x6326a3[_0x2507('0x33')]]={'$like':'%'+_0x663524['query'][_0x2507('0x47')]+'%'};return _0x5c0af3;}})});}_0x8e6160=_[_0x2507('0x48')]({},_0x8e6160,_0x663524[_0x2507('0x49')]);var _0x13985a={'where':_0x8e6160[_0x2507('0x45')]};return db['CmList'][_0x2507('0x25')](_0x13985a)[_0x2507('0x2d')](function(_0x5733ea){_0x128a81['count']=_0x5733ea;if(_0x663524[_0x2507('0x3b')][_0x2507('0x4a')]){_0x8e6160[_0x2507('0x4b')]=[{'all':!![]}];}return db[_0x2507('0x36')]['findAll'](_0x8e6160);})[_0x2507('0x2d')](function(_0x59f5e1){_0x128a81[_0x2507('0x4c')]=_0x59f5e1;return _0x128a81;})['then'](respondWithFilteredResult(_0x553960,_0x8e6160))[_0x2507('0x4d')](handleError(_0x553960,null));};exports[_0x2507('0x4e')]=function(_0x429d2e,_0x376289){var _0x53608b={'raw':![],'where':{'id':_0x429d2e[_0x2507('0x4f')]['id']}},_0x1e6c61={};_0x1e6c61['model']=_['keys'](db[_0x2507('0x36')][_0x2507('0x37')]);_0x1e6c61['query']=_['keys'](_0x429d2e[_0x2507('0x3b')]);_0x1e6c61[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x1e6c61[_0x2507('0x3a')],_0x1e6c61[_0x2507('0x3b')]);_0x53608b[_0x2507('0x3f')]=_[_0x2507('0x3e')](_0x1e6c61[_0x2507('0x3a')],qs[_0x2507('0x50')](_0x429d2e[_0x2507('0x3b')][_0x2507('0x50')]));_0x53608b[_0x2507('0x3f')]=_0x53608b[_0x2507('0x3f')][_0x2507('0x40')]?_0x53608b[_0x2507('0x3f')]:_0x1e6c61[_0x2507('0x3a')];if(_0x429d2e[_0x2507('0x3b')][_0x2507('0x4a')]){_0x53608b['include']=[{'all':!![]}];}_0x53608b=_[_0x2507('0x48')]({},_0x53608b,_0x429d2e['options']);return db[_0x2507('0x36')]['find'](_0x53608b)[_0x2507('0x2d')](handleEntityNotFound(_0x376289,null))[_0x2507('0x2d')](respondWithResult(_0x376289,null))['catch'](handleError(_0x376289,null));};exports['create']=function(_0x2fc7d9,_0x13dd9e){return db['CmList'][_0x2507('0x51')](_0x2fc7d9[_0x2507('0x52')],{})['then'](function(_0x525fb1){var _0x522761=_0x2fc7d9[_0x2507('0x53')][_0x2507('0x2f')]({'plain':!![]});if(!_0x522761)throw new Error(_0x2507('0x54'));if(_0x522761[_0x2507('0x55')]===_0x2507('0x53')){var _0x43ef0f=_0x525fb1[_0x2507('0x2f')]({'plain':!![]});var _0x51b029=_0x2507('0x30');return db['UserProfileSection'][_0x2507('0x56')]({'where':{'name':_0x51b029,'userProfileId':_0x522761[_0x2507('0x57')]},'raw':!![]})['then'](function(_0x315ca0){if(_0x315ca0&&_0x315ca0[_0x2507('0x58')]===0x0){return db[_0x2507('0x59')][_0x2507('0x51')]({'name':_0x43ef0f['name'],'resourceId':_0x43ef0f['id'],'type':_0x315ca0[_0x2507('0x33')],'sectionId':_0x315ca0['id']},{})['then'](function(){return _0x525fb1;});}else{return _0x525fb1;}})[_0x2507('0x4d')](function(_0x20acc2){logger[_0x2507('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20acc2);throw _0x20acc2;});}return _0x525fb1;})['then'](respondWithResult(_0x13dd9e,0xc9))[_0x2507('0x4d')](handleError(_0x13dd9e,null));};exports[_0x2507('0x2c')]=function(_0x4eaf94,_0x29db40){if(_0x4eaf94[_0x2507('0x52')]['id']){delete _0x4eaf94[_0x2507('0x52')]['id'];}return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x4eaf94[_0x2507('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29db40,null))['then'](saveUpdates(_0x4eaf94[_0x2507('0x52')],null))[_0x2507('0x2d')](respondWithResult(_0x29db40,null))[_0x2507('0x4d')](handleError(_0x29db40,null));};exports[_0x2507('0x2e')]=function(_0x1118e2,_0xc16a4f){return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x1118e2[_0x2507('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc16a4f,null))[_0x2507('0x2d')](removeEntity(_0xc16a4f,null))[_0x2507('0x4d')](handleError(_0xc16a4f,null));};exports[_0x2507('0x5a')]=function(_0x3c4b0e,_0xce3c83){return db['CmList']['describe']()[_0x2507('0x2d')](respondWithResult(_0xce3c83,null))['catch'](handleError(_0xce3c83,null));};exports[_0x2507('0x5b')]=function(_0x3d27c3,_0x4aac4b,_0x4d07f3){if(_0x3d27c3[_0x2507('0x52')]['id']){delete _0x3d27c3[_0x2507('0x52')]['id'];}return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x3d27c3[_0x2507('0x4f')]['id']}})[_0x2507('0x2d')](handleEntityNotFound(_0x4aac4b,null))['then'](function(_0x1637d2){if(_0x1637d2){_0x3d27c3[_0x2507('0x52')][_0x2507('0x5c')]=_0x1637d2['id'];return db[_0x2507('0x5d')]['create'](_0x3d27c3[_0x2507('0x52')]);}})[_0x2507('0x2d')](respondWithResult(_0x4aac4b,null))[_0x2507('0x4d')](handleError(_0x4aac4b,null));};exports['getDispositions']=function(_0x8f034f,_0x1644e8,_0x30f8fb){var _0x11616f={'raw':![],'where':{}};var _0x91d530={};var _0x39704f={'count':0x0,'rows':[]};return db[_0x2507('0x36')][_0x2507('0x5e')]({'where':{'id':_0x8f034f[_0x2507('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1644e8,null))[_0x2507('0x2d')](function(_0x20031d){if(_0x20031d){_0x91d530[_0x2507('0x3a')]=_[_0x2507('0x3c')](db[_0x2507('0x5d')]['rawAttributes']);_0x91d530[_0x2507('0x3b')]=_['keys'](_0x8f034f[_0x2507('0x3b')]);_0x91d530[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x91d530[_0x2507('0x3a')],_0x91d530['query']);_0x11616f[_0x2507('0x3f')]=_['intersection'](_0x91d530[_0x2507('0x3a')],qs[_0x2507('0x50')](_0x8f034f[_0x2507('0x3b')][_0x2507('0x50')]));_0x11616f[_0x2507('0x3f')]=_0x11616f['attributes'][_0x2507('0x40')]?_0x11616f[_0x2507('0x3f')]:_0x91d530[_0x2507('0x3a')];if(!_0x8f034f[_0x2507('0x3b')]['hasOwnProperty'](_0x2507('0x42'))){_0x11616f[_0x2507('0x26')]=qs[_0x2507('0x26')](_0x8f034f[_0x2507('0x3b')][_0x2507('0x26')]);_0x11616f[_0x2507('0x23')]=qs['offset'](_0x8f034f[_0x2507('0x3b')][_0x2507('0x23')]);}_0x11616f[_0x2507('0x43')]=qs['sort'](_0x8f034f[_0x2507('0x3b')][_0x2507('0x44')]);_0x11616f[_0x2507('0x45')]=qs[_0x2507('0x3d')](_['pick'](_0x8f034f[_0x2507('0x3b')],_0x91d530[_0x2507('0x3d')]));_0x11616f[_0x2507('0x45')][_0x2507('0x5c')]=_0x20031d['id'];if(_0x8f034f[_0x2507('0x3b')][_0x2507('0x47')]){_0x11616f['where']=_['merge'](_0x11616f[_0x2507('0x45')],{'$or':_[_0x2507('0x35')](_0x11616f[_0x2507('0x3f')],function(_0x1d8e7f){var _0x58cd64={};_0x58cd64[_0x1d8e7f]={'$like':'%'+_0x8f034f[_0x2507('0x3b')][_0x2507('0x47')]+'%'};return _0x58cd64;})});}_0x11616f=_[_0x2507('0x48')]({},_0x11616f,_0x8f034f[_0x2507('0x49')]);return db[_0x2507('0x5d')]['count']({'where':_0x11616f[_0x2507('0x45')]})['then'](function(_0x18d933){_0x39704f[_0x2507('0x25')]=_0x18d933;if(_0x8f034f[_0x2507('0x3b')][_0x2507('0x4a')]){_0x11616f[_0x2507('0x4b')]=[{'all':!![]}];}return db[_0x2507('0x5d')][_0x2507('0x5f')](_0x11616f);})[_0x2507('0x2d')](function(_0x43d2f9){_0x39704f[_0x2507('0x4c')]=_0x43d2f9;return _0x39704f;});}})[_0x2507('0x2d')](respondWithFilteredResult(_0x1644e8,_0x11616f))[_0x2507('0x4d')](handleError(_0x1644e8,null));};exports[_0x2507('0x60')]=function(_0x66b4fa,_0x4d44de,_0x4b7cfe){return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x66b4fa['params']['id']}})['then'](handleEntityNotFound(_0x4d44de,null))[_0x2507('0x2d')](function(_0x48fc26){if(_0x48fc26){return _0x48fc26[_0x2507('0x60')](_0x66b4fa[_0x2507('0x3b')][_0x2507('0x61')]);}})[_0x2507('0x2d')](respondWithStatusCode(_0x4d44de,null))[_0x2507('0x4d')](handleError(_0x4d44de,null));};exports[_0x2507('0x62')]=function(_0x543b57,_0x31cd4d,_0x1d4cdc){return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x543b57['params']['id']}})['then'](handleEntityNotFound(_0x31cd4d,null))[_0x2507('0x2d')](function(_0x5507bf){if(_0x5507bf){var _0x51da1c=[];var _0x2efa38={'success':[],'errors':[]};return db[_0x2507('0x63')][_0x2507('0x5a')]()[_0x2507('0x2d')](function(_0x526878){if(_0x543b57[_0x2507('0x52')][_0x2507('0x64')]&&_[_0x2507('0x65')](_0x543b57[_0x2507('0x52')][_0x2507('0x64')])){if(_0x543b57['body'][_0x2507('0x64')][_0x2507('0x40')]){_0x543b57[_0x2507('0x52')]['tags']=_0x543b57[_0x2507('0x52')]['tags'][_0x2507('0x66')](';')+';';}else{_0x543b57[_0x2507('0x52')]['tags']=null;}}else{_0x543b57[_0x2507('0x52')]['tags']=null;}if(_0x543b57[_0x2507('0x52')]&&_[_0x2507('0x65')](_0x543b57[_0x2507('0x52')])){for(var _0x55eeeb=0x0;_0x55eeeb<_0x543b57[_0x2507('0x52')][_0x2507('0x40')];_0x55eeeb+=0x1){_0x543b57[_0x2507('0x52')][_0x55eeeb][_0x2507('0x5c')]=_0x543b57[_0x2507('0x4f')]['id'];_0x51da1c[_0x2507('0x67')](_0x543b57[_0x2507('0x52')][_0x55eeeb]);}return BPromise[_0x2507('0x68')](_0x51da1c,function(_0x43ffde){return db[_0x2507('0x63')][_0x2507('0x51')](_[_0x2507('0x69')](_0x43ffde,[_0x2507('0x61'),'id'])||{},{'fields':_[_0x2507('0x3c')](_0x526878),'raw':!![]})[_0x2507('0x2d')](function(_0x4323c9){_0x2efa38['success'][_0x2507('0x67')](_0x4323c9[_0x2507('0x6a')]);})[_0x2507('0x4d')](function(_0x1b0c3d){_0x2efa38[_0x2507('0x6b')][_0x2507('0x67')]({'data':_0x43ffde,'error':_0x1b0c3d['message']});});})['then'](function(_0x229d3f){return _0x2efa38;})[_0x2507('0x4d')](function(_0x492691){return _0x492691;});}else{_0x31cd4d[_0x2507('0x22')](0x190)[_0x2507('0x29')]({'message':_0x2507('0x6c')});}});}})[_0x2507('0x2d')](respondWithResult(_0x31cd4d,null))[_0x2507('0x4d')](handleError(_0x31cd4d,null));};exports[_0x2507('0x6d')]=function(_0x26e18b,_0x30493f,_0x21a13){var _0x5ee9d4;return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x26e18b['params']['id']},'include':[{'model':db[_0x2507('0x6e')],'as':_0x2507('0x6f')}]})[_0x2507('0x2d')](handleEntityNotFound(_0x30493f,null))[_0x2507('0x2d')](function(_0x3df800){if(_0x3df800){_0x5ee9d4=_0x3df800;return db[_0x2507('0x63')][_0x2507('0x37')];}})[_0x2507('0x2d')](function(_0x25400a){if(_0x25400a){var _0x1d3069={};var _0x3378b8={};_0x3378b8[_0x2507('0x3a')]=_[_0x2507('0x70')](_[_0x2507('0x3c')](_0x25400a),_['map'](_0x5ee9d4[_0x2507('0x6f')],function(_0xbc2f2e){return util['format'](_0x2507('0x71'),_0xbc2f2e['id']);}));_0x3378b8[_0x2507('0x3b')]=_[_0x2507('0x3c')](_0x26e18b['query']);_0x3378b8[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x3378b8[_0x2507('0x3a')],_0x3378b8[_0x2507('0x3b')]);_0x1d3069[_0x2507('0x3f')]=_['intersection'](_0x3378b8[_0x2507('0x3a')],qs[_0x2507('0x50')](_0x26e18b[_0x2507('0x3b')][_0x2507('0x50')]));_0x1d3069['attributes']=_0x1d3069[_0x2507('0x3f')][_0x2507('0x40')]?_0x1d3069['attributes']:_0x3378b8['model'];if(!_0x26e18b[_0x2507('0x3b')]['hasOwnProperty'](_0x2507('0x42'))){_0x1d3069[_0x2507('0x26')]=qs[_0x2507('0x26')](_0x26e18b[_0x2507('0x3b')][_0x2507('0x26')]);_0x1d3069[_0x2507('0x23')]=qs[_0x2507('0x23')](_0x26e18b[_0x2507('0x3b')][_0x2507('0x23')]);}_0x1d3069[_0x2507('0x43')]=qs['sort'](_0x26e18b[_0x2507('0x3b')][_0x2507('0x44')]);_0x1d3069[_0x2507('0x45')]=qs['filters'](_[_0x2507('0x46')](_0x26e18b['query'],_0x3378b8[_0x2507('0x3d')]));_0x1d3069['raw']=!![];if(_0x26e18b[_0x2507('0x3b')][_0x2507('0x47')]){_0x1d3069[_0x2507('0x45')]=_[_0x2507('0x48')](_0x1d3069[_0x2507('0x45')],{'$or':_[_0x2507('0x35')](_0x1d3069[_0x2507('0x3f')],function(_0x199343){var _0x5c0c87={};_0x5c0c87[_0x199343]={'$like':'%'+_0x26e18b[_0x2507('0x3b')][_0x2507('0x47')]+'%'};return _0x5c0c87;})});}_0x1d3069=_[_0x2507('0x48')]({},_0x1d3069,_0x26e18b[_0x2507('0x49')]);return _0x5ee9d4[_0x2507('0x6d')](_0x1d3069);}})['then'](respondWithResult(_0x30493f,null))[_0x2507('0x4d')](handleError(_0x30493f,null));};exports['getContactsCsv']=function(_0x502cae,_0x489642,_0x4dc79f){var _0x571058;var _0x563c26;var _0x391764;var _0x41642f=_0x502cae['params']['id'];csv_results=[];return db['ContactItemType'][_0x2507('0x5f')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x2507('0x2d')](function(_0x507215){_0x571058=_0x507215;var _0x198aaa=_[_0x2507('0x3c')](db['CmContact'][_0x2507('0x37')]);return db[_0x2507('0x6e')][_0x2507('0x5f')]({'raw':!![],'attributes':['id',_0x2507('0x72')]})[_0x2507('0x2d')](function(_0xf50b45){_0x563c26=_0xf50b45;var _0x2b7e51=squel['select']()[_0x2507('0x50')](_0x198aaa)[_0x2507('0x73')]('cm_contacts','c')[_0x2507('0x45')](_0x2507('0x74'),_0x41642f)[_0x2507('0x45')](_0x2507('0x75'))[_0x2507('0x76')]();for(var _0x248720=0x0;_0x248720<_0x563c26[_0x2507('0x40')];_0x248720++){_0x2b7e51['field'](_0x2507('0x77')+_0x563c26[_0x248720]['id'],'customField_'+_0x563c26[_0x248720]['alias']);}for(var _0x248720=0x0;_0x248720<_0x571058['length'];_0x248720++){_0x2b7e51[_0x2507('0x78')](squel[_0x2507('0x79')]()[_0x2507('0x78')](_0x2507('0x7a'))[_0x2507('0x73')](_0x2507('0x7b'))[_0x2507('0x45')]('ItemTypeId\x20=\x20?',_0x571058[_0x248720]['id'])[_0x2507('0x45')](_0x2507('0x7c')),'additionalPhone_'+_0x571058[_0x248720][_0x2507('0x33')]);_0x2b7e51[_0x2507('0x78')](squel[_0x2507('0x79')]()[_0x2507('0x78')](_0x2507('0x7d'))[_0x2507('0x73')](_0x2507('0x7b'))['where'](_0x2507('0x7e'),_0x571058[_0x248720]['id'])['where'](_0x2507('0x7c')),_0x2507('0x7f')+_0x571058[_0x248720][_0x2507('0x33')]);}var _0x173724=[];_0x173724['push'](_0x2b7e51[_0x2507('0x80')]());BPromise['each'](_0x173724,handleQuery)[_0x2507('0x2d')](function(_0x2c5c18){handleQuery(_0x2b7e51[_0x2507('0x80')]());var _0x1c4e27=csv_results[0x0];if(!_['isEmpty'](_0x1c4e27)){var _0x3ff620=toCsv(_0x1c4e27);var _0xf7199d=Date[_0x2507('0x81')]();fs['writeFileSync'](util[_0x2507('0x82')](_0x2507('0x83'),_0x41642f,_0xf7199d),_0x3ff620);_0x489642[_0x2507('0x84')](_0x2507('0x85'),_0x2507('0x86')+util['format'](_0x2507('0x87'),_0x41642f,_0xf7199d));_0x489642[_0x2507('0x84')](_0x2507('0x88'),_0x2507('0x89'));return _0x489642[_0x2507('0x8a')](util['format'](_0x2507('0x83'),_0x41642f,_0xf7199d));}else{return _0x489642[_0x2507('0x20')](0xcc);}});});});};exports[_0x2507('0x8b')]=function(_0x255fbd,_0x559357,_0x4c7cce){var _0x5da19a;delete _0x255fbd[_0x2507('0x52')]['id'];return db['CmList'][_0x2507('0x5e')]({'where':{'id':_0x255fbd[_0x2507('0x4f')]['id']}})[_0x2507('0x2d')](handleEntityNotFound(_0x559357,null))['then'](function(_0x3e349c){if(_0x3e349c){return db[_0x2507('0x8c')][_0x2507('0x8d')](function(_0x4bd573){return db[_0x2507('0x6e')][_0x2507('0x51')](_0x255fbd[_0x2507('0x52')],{'transaction':_0x4bd573})[_0x2507('0x2d')](function(_0x44df4c){_0x5da19a=_0x44df4c;return _0x3e349c[_0x2507('0x8e')](_0x44df4c,{'transaction':_0x4bd573});})['then'](function(){var _0x214078={'type':db[_0x2507('0x8f')]['TEXT'],'transaction':_0x4bd573};switch(_0x255fbd[_0x2507('0x52')][_0x2507('0x90')]){case _0x2507('0x91'):_0x214078[_0x2507('0x90')]=db['Sequelize'][_0x2507('0x92')];break;case _0x2507('0x93'):_0x214078['type']=db[_0x2507('0x8f')]['INTEGER'];break;case _0x2507('0x94'):_0x214078['type']=db['Sequelize'][_0x2507('0x95')];_0x214078[_0x2507('0x96')]=![];break;default:}return db[_0x2507('0x8c')]['queryInterface'][_0x2507('0x97')](_0x2507('0x98'),util[_0x2507('0x82')](_0x2507('0x99'),_0x5da19a['id']),_0x214078);})[_0x2507('0x2d')](function(){return _0x5da19a;});});}})[_0x2507('0x2d')](respondWithResult(_0x559357,null))['catch'](handleError(_0x559357,null));};exports['getCustomFields']=function(_0x38bf99,_0x212007,_0x31d117){var _0x3df139={};var _0x520c75={};var _0x11470c;var _0x1bddcb;return db[_0x2507('0x36')][_0x2507('0x5e')]({'where':{'id':_0x38bf99[_0x2507('0x4f')]['id']}})[_0x2507('0x2d')](handleEntityNotFound(_0x212007,null))['then'](function(_0xd9c0f0){if(_0xd9c0f0){_0x11470c=_0xd9c0f0;_0x520c75['model']=_['keys'](db[_0x2507('0x6e')][_0x2507('0x37')]);_0x520c75[_0x2507('0x3b')]=_[_0x2507('0x3c')](_0x38bf99[_0x2507('0x3b')]);_0x520c75[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x520c75[_0x2507('0x3a')],_0x520c75[_0x2507('0x3b')]);_0x3df139[_0x2507('0x3f')]=_[_0x2507('0x3e')](_0x520c75[_0x2507('0x3a')],qs[_0x2507('0x50')](_0x38bf99[_0x2507('0x3b')]['fields']));_0x3df139[_0x2507('0x3f')]=_0x3df139[_0x2507('0x3f')][_0x2507('0x40')]?_0x3df139[_0x2507('0x3f')]:_0x520c75[_0x2507('0x3a')];_0x3df139[_0x2507('0x43')]=qs['sort'](_0x38bf99[_0x2507('0x3b')][_0x2507('0x44')]);_0x3df139[_0x2507('0x45')]=qs['filters'](_['pick'](_0x38bf99['query'],_0x520c75[_0x2507('0x3d')]));_0x3df139[_0x2507('0x45')]=_['merge'](_0x3df139[_0x2507('0x45')],{'$or':[{'ListId':_0xd9c0f0['id']},{'ListId':null}]});if(_0x38bf99[_0x2507('0x3b')][_0x2507('0x47')]){_0x3df139[_0x2507('0x45')]=_[_0x2507('0x48')](_0x3df139[_0x2507('0x45')],{'$or':_[_0x2507('0x35')](_0x3df139[_0x2507('0x3f')],function(_0x34d276){var _0x20f570={};_0x20f570[_0x34d276]={'$like':'%'+_0x38bf99[_0x2507('0x3b')][_0x2507('0x47')]+'%'};return _0x20f570;})});}_0x3df139=_[_0x2507('0x48')]({},_0x3df139,_0x38bf99['options']);return db['CmCustomField']['findAndCountAll'](_0x3df139);}})[_0x2507('0x2d')](respondWithResult(_0x212007,null))['catch'](handleError(_0x212007,null));};exports['getGlobalCustomFields']=function(_0x3142f3,_0x3ddccc){return db[_0x2507('0x6e')][_0x2507('0x9a')]({'where':{'ListId':null}})[_0x2507('0x2d')](handleEntityNotFound(_0x3ddccc,null))[_0x2507('0x2d')](function(_0x199e73){return _0x199e73;})[_0x2507('0x2d')](respondWithResult(_0x3ddccc,null))[_0x2507('0x4d')](handleError(_0x3ddccc,null));};exports['addAgents']=function(_0x35ca92,_0x394ac7,_0xa19f46){return db[_0x2507('0x36')][_0x2507('0x56')]({'where':{'id':_0x35ca92[_0x2507('0x4f')]['id']}})['then'](handleEntityNotFound(_0x394ac7,null))['then'](function(_0x435771){if(_0x435771){return _0x435771[_0x2507('0x9b')](_0x35ca92[_0x2507('0x52')][_0x2507('0x61')],_['omit'](_0x35ca92['body'],[_0x2507('0x61'),'id'])||{})['spread'](function(_0x4dc50b){for(var _0x100c52=0x0;_0x100c52<_0x35ca92[_0x2507('0x52')][_0x2507('0x61')][_0x2507('0x40')];_0x100c52+=0x1){socket[_0x2507('0x9c')]('userCmList:save',{'UserId':Number(_0x35ca92['body'][_0x2507('0x61')][_0x100c52]),'CmListId':Number(_0x35ca92['params']['id'])});}return _0x4dc50b;});}})[_0x2507('0x2d')](respondWithResult(_0x394ac7,null))['catch'](handleError(_0x394ac7,null));};exports[_0x2507('0x9d')]=function(_0xd86083,_0x2fedba,_0x29013b){return db[_0x2507('0x36')]['find']({'where':{'id':_0xd86083['params']['id']}})[_0x2507('0x2d')](handleEntityNotFound(_0x2fedba,null))['then'](function(_0x3ea24f){if(_0x3ea24f){return _0x3ea24f[_0x2507('0x9d')](_0xd86083['query']['ids'])['then'](function(){if(_[_0x2507('0x65')](_0xd86083[_0x2507('0x3b')][_0x2507('0x61')])){for(var _0x4cee95=0x0;_0x4cee95<_0xd86083[_0x2507('0x3b')][_0x2507('0x61')][_0x2507('0x40')];_0x4cee95+=0x1){socket[_0x2507('0x9c')]('userCmList:remove',{'UserId':Number(_0xd86083[_0x2507('0x3b')][_0x2507('0x61')][_0x4cee95]),'CmListId':Number(_0xd86083[_0x2507('0x4f')]['id'])});}}else{socket[_0x2507('0x9c')](_0x2507('0x9e'),{'UserId':Number(_0xd86083[_0x2507('0x3b')]['ids']),'CmListId':Number(_0xd86083[_0x2507('0x4f')]['id'])});}});}})[_0x2507('0x2d')](respondWithStatusCode(_0x2fedba,null))['catch'](handleError(_0x2fedba,null));};exports[_0x2507('0x9f')]=function(_0xeef7da,_0x54a088,_0x1e3aae){var _0x2b9672={};var _0x52f836={};var _0xd1a80c;var _0x2181e0;return db['CmList'][_0x2507('0x5e')]({'where':{'id':_0xeef7da[_0x2507('0x4f')]['id']}})[_0x2507('0x2d')](handleEntityNotFound(_0x54a088,null))['then'](function(_0x373a8b){if(_0x373a8b){_0xd1a80c=_0x373a8b;_0x52f836['model']=_[_0x2507('0x3c')](db[_0x2507('0xa0')][_0x2507('0x37')]);_0x52f836[_0x2507('0x3b')]=_[_0x2507('0x3c')](_0xeef7da['query']);_0x52f836[_0x2507('0x3d')]=_[_0x2507('0x3e')](_0x52f836['model'],_0x52f836['query']);_0x2b9672[_0x2507('0x3f')]=_[_0x2507('0x3e')](_0x52f836[_0x2507('0x3a')],qs[_0x2507('0x50')](_0xeef7da['query']['fields']));_0x2b9672[_0x2507('0x3f')]=_0x2b9672[_0x2507('0x3f')]['length']?_0x2b9672[_0x2507('0x3f')]:_0x52f836[_0x2507('0x3a')];_0x2b9672[_0x2507('0x43')]=qs[_0x2507('0x44')](_0xeef7da[_0x2507('0x3b')][_0x2507('0x44')]);_0x2b9672[_0x2507('0x45')]=qs[_0x2507('0x3d')](_['pick'](_0xeef7da['query'],_0x52f836[_0x2507('0x3d')]));if(_0xeef7da[_0x2507('0x3b')][_0x2507('0x47')]){_0x2b9672[_0x2507('0x45')]=_[_0x2507('0x48')](_0x2b9672[_0x2507('0x45')],{'$or':_[_0x2507('0x35')](_0x2b9672['attributes'],function(_0x3e1c19){var _0x13d269={};_0x13d269[_0x3e1c19]={'$like':'%'+_0xeef7da[_0x2507('0x3b')][_0x2507('0x47')]+'%'};return _0x13d269;})});}_0x2b9672=_[_0x2507('0x48')]({},_0x2b9672,_0xeef7da[_0x2507('0x49')]);return _0xd1a80c['getAgents'](_0x2b9672);}})[_0x2507('0x2d')](function(_0x5d31ee){if(_0x5d31ee){_0x2181e0=_0x5d31ee['length'];if(!_0xeef7da[_0x2507('0x3b')][_0x2507('0x41')]('nolimit')){_0x2b9672[_0x2507('0x26')]=qs[_0x2507('0x26')](_0xeef7da[_0x2507('0x3b')][_0x2507('0x26')]);_0x2b9672['offset']=qs['offset'](_0xeef7da['query'][_0x2507('0x23')]);}return _0xd1a80c['getAgents'](_0x2b9672);}})['then'](function(_0x172048){if(_0x172048){return _0x172048?{'count':_0x2181e0,'rows':_0x172048}:null;}})[_0x2507('0x2d')](respondWithResult(_0x54a088,null))[_0x2507('0x4d')](handleError(_0x54a088,null));};function handleQuery(_0x2c9775){logger[_0x2507('0xa1')](_0x2c9775);return db[_0x2507('0x8c')]['query'](_0x2c9775)['spread'](function(_0x2faae6){csv_results[_0x2507('0x67')](_0x2faae6);})[_0x2507('0x4d')](function(_0x27b5c8){logger[_0x2507('0x31')](_0x27b5c8[_0x2507('0xa2')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 9a5339e..9e1dbb7 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x23496e,_0x5c2620){var _0xd5128e=function(_0x503fdc){while(--_0x503fdc){_0x23496e['push'](_0x23496e['shift']());}};_0xd5128e(++_0x5c2620);}(_0x814b,0x1a2));var _0xb814=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x814b[_0x2d4661];return _0x42ed1e;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1b69a4,_0x3e9f5f){var _0x4ab6a6=function(_0x33697){while(--_0x33697){_0x1b69a4['push'](_0x1b69a4['shift']());}};_0x4ab6a6(++_0x3e9f5f);}(_0x814b,0x1a2));var _0xb814=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x814b[_0x2a56ad];return _0x425175;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 815380f..dd9bc0b 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 _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x56f694,_0x107ec3){var _0x5b46b1=function(_0x2bd644){while(--_0x2bd644){_0x56f694['push'](_0x56f694['shift']());}};_0x5b46b1(++_0x107ec3);}(_0x6c76,0x184));var _0x66c7=function(_0x4b58e4,_0x42e0ce){_0x4b58e4=_0x4b58e4-0x0;var _0x4f3958=_0x6c76[_0x4b58e4];return _0x4f3958;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./cmList.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4483=['define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x31a55d,_0x225b4a){var _0x15143e=function(_0x3f66c8){while(--_0x3f66c8){_0x31a55d['push'](_0x31a55d['shift']());}};_0x15143e(++_0x225b4a);}(_0x4483,0x1a3));var _0x3448=function(_0x5a854e,_0x279b86){_0x5a854e=_0x5a854e-0x0;var _0x30e739=_0x4483[_0x5a854e];return _0x30e739;};'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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 87c9642..44cc589 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 _0x27c4=['defaults','localhost','socket.io-emitter','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27c4,0x1c3));var _0x427c=function(_0x4119cb,_0x2afccf){_0x4119cb=_0x4119cb-0x0;var _0x4dc1be=_0x27c4[_0x4119cb];return _0x4dc1be;};'use strict';var _=require(_0x427c('0x0'));var util=require(_0x427c('0x1'));var moment=require(_0x427c('0x2'));var BPromise=require(_0x427c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x427c('0x4'));var db=require(_0x427c('0x5'))['db'];var utils=require(_0x427c('0x6'));var logger=require(_0x427c('0x7'))(_0x427c('0x8'));var config=require(_0x427c('0x9'));var jayson=require(_0x427c('0xa'));var client=jayson[_0x427c('0xb')][_0x427c('0xc')]({'port':0x232a});config[_0x427c('0xd')]=_[_0x427c('0xe')](config[_0x427c('0xd')],{'host':_0x427c('0xf'),'port':0x18eb});var socket=require(_0x427c('0x10'))(new Redis(config[_0x427c('0xd')]));require('./cmList.socket')[_0x427c('0x11')](socket);function respondWithRpcPromise(_0x397bf8,_0xb3ca7b,_0x5e8e79){return new BPromise(function(_0xe050e2,_0x35d46c){return client[_0x427c('0x12')](_0x397bf8,_0x5e8e79)[_0x427c('0x13')](function(_0x4c3ebc){logger['info'](_0x427c('0x14'),_0xb3ca7b,_0x427c('0x15'));logger[_0x427c('0x16')](_0x427c('0x17'),_0xb3ca7b,_0x427c('0x15'),JSON[_0x427c('0x18')](_0x4c3ebc));if(_0x4c3ebc[_0x427c('0x19')]){if(_0x4c3ebc['error'][_0x427c('0x1a')]===0x1f4){logger[_0x427c('0x19')](_0x427c('0x14'),_0xb3ca7b,_0x4c3ebc[_0x427c('0x19')][_0x427c('0x1b')]);return _0x35d46c(_0x4c3ebc['error'][_0x427c('0x1b')]);}logger[_0x427c('0x19')](_0x427c('0x14'),_0xb3ca7b,_0x4c3ebc[_0x427c('0x19')]['message']);return _0xe050e2(_0x4c3ebc[_0x427c('0x19')][_0x427c('0x1b')]);}else{logger[_0x427c('0x1c')](_0x427c('0x14'),_0xb3ca7b,'request\x20sent');_0xe050e2(_0x4c3ebc[_0x427c('0x1d')][_0x427c('0x1b')]);}})[_0x427c('0x1e')](function(_0xc7870){logger[_0x427c('0x19')](_0x427c('0x14'),_0xb3ca7b,_0xc7870);_0x35d46c(_0xc7870);});});} \ No newline at end of file +var _0xee5b=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','request\x20sent','debug','stringify','error','message','result','CmList,\x20%s,\x20%s','lodash'];(function(_0x2f8e73,_0xd4ca8d){var _0x14c227=function(_0x263b17){while(--_0x263b17){_0x2f8e73['push'](_0x2f8e73['shift']());}};_0x14c227(++_0xd4ca8d);}(_0xee5b,0x151));var _0xbee5=function(_0x4b29a1,_0x7aac26){_0x4b29a1=_0x4b29a1-0x0;var _0x14d08d=_0xee5b[_0x4b29a1];return _0x14d08d;};'use strict';var _=require(_0xbee5('0x0'));var util=require(_0xbee5('0x1'));var moment=require('moment');var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbee5('0x4'));var logger=require(_0xbee5('0x5'))(_0xbee5('0x6'));var config=require(_0xbee5('0x7'));var jayson=require(_0xbee5('0x8'));var client=jayson[_0xbee5('0x9')][_0xbee5('0xa')]({'port':0x232a});config[_0xbee5('0xb')]=_[_0xbee5('0xc')](config[_0xbee5('0xb')],{'host':_0xbee5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbee5('0xb')]));require(_0xbee5('0xe'))[_0xbee5('0xf')](socket);function respondWithRpcPromise(_0x1e63d8,_0x1a5e1c,_0x30412c){return new BPromise(function(_0x3be684,_0x23aa83){return client[_0xbee5('0x10')](_0x1e63d8,_0x30412c)[_0xbee5('0x11')](function(_0x15827f){logger[_0xbee5('0x12')]('CmList,\x20%s,\x20%s',_0x1a5e1c,_0xbee5('0x13'));logger[_0xbee5('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x1a5e1c,_0xbee5('0x13'),JSON[_0xbee5('0x15')](_0x15827f));if(_0x15827f[_0xbee5('0x16')]){if(_0x15827f[_0xbee5('0x16')]['code']===0x1f4){logger[_0xbee5('0x16')]('CmList,\x20%s,\x20%s',_0x1a5e1c,_0x15827f[_0xbee5('0x16')][_0xbee5('0x17')]);return _0x23aa83(_0x15827f['error'][_0xbee5('0x17')]);}logger[_0xbee5('0x16')]('CmList,\x20%s,\x20%s',_0x1a5e1c,_0x15827f[_0xbee5('0x16')][_0xbee5('0x17')]);return _0x3be684(_0x15827f[_0xbee5('0x16')][_0xbee5('0x17')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x1a5e1c,_0xbee5('0x13'));_0x3be684(_0x15827f[_0xbee5('0x18')][_0xbee5('0x17')]);}})['catch'](function(_0x305d62){logger[_0xbee5('0x16')](_0xbee5('0x19'),_0x1a5e1c,_0x305d62);_0x23aa83(_0x305d62);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4408393..8f13bb3 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 _0xd190=['update','emit','removeListener','cmList:','save','remove'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0xd190,0x8e));var _0x0d19=function(_0x34d470,_0x4140a6){_0x34d470=_0x34d470-0x0;var _0x54295a=_0xd190[_0x34d470];return _0x54295a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x0d19('0x0'),_0x0d19('0x1'),_0x0d19('0x2')];function createListener(_0x404183,_0x5558ef){return function(_0x5da48c){_0x5558ef[_0x0d19('0x3')](_0x404183,_0x5da48c);};}function removeListener(_0x1bc0dc,_0x4bb027){return function(){CmListEvents[_0x0d19('0x4')](_0x1bc0dc,_0x4bb027);};}exports['register']=function(_0x224399){for(var _0x4974aa=0x0,_0x501f2f=events['length'];_0x4974aa<_0x501f2f;_0x4974aa++){var _0x4fd309=events[_0x4974aa];var _0x5656a3=createListener(_0x0d19('0x5')+_0x4fd309,_0x224399);CmListEvents['on'](_0x4fd309,_0x5656a3);}}; \ No newline at end of file +var _0xed52=['removeListener','cmList:','save','emit'];(function(_0x37103c,_0x52bbc6){var _0x390741=function(_0x45e2f9){while(--_0x45e2f9){_0x37103c['push'](_0x37103c['shift']());}};_0x390741(++_0x52bbc6);}(_0xed52,0x16e));var _0x2ed5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xed52[_0x56482c];return _0x5aae7a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x2ed5('0x0'),'remove','update'];function createListener(_0x22d6ff,_0x5c25dc){return function(_0x100d00){_0x5c25dc[_0x2ed5('0x1')](_0x22d6ff,_0x100d00);};}function removeListener(_0x45224e,_0x1e8349){return function(){CmListEvents[_0x2ed5('0x2')](_0x45224e,_0x1e8349);};}exports['register']=function(_0x254856){for(var _0x4b157f=0x0,_0x7e3abc=events['length'];_0x4b157f<_0x7e3abc;_0x4b157f++){var _0x17b22d=events[_0x4b157f];var _0x5ce7a1=createListener(_0x2ed5('0x3')+_0x17b22d,_0x254856);CmListEvents['on'](_0x17b22d,_0x5ce7a1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6e67bfa..39f173a 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 _0x0773=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','/:id','update','delete','destroy','exports','multer','util'];(function(_0x3d30d4,_0x3976d9){var _0x5ece03=function(_0x2aab4f){while(--_0x2aab4f){_0x3d30d4['push'](_0x3d30d4['shift']());}};_0x5ece03(++_0x3976d9);}(_0x0773,0x1da));var _0x3077=function(_0x42d475,_0x249623){_0x42d475=_0x42d475-0x0;var _0xc2dd9e=_0x0773[_0x42d475];return _0xc2dd9e;};'use strict';var multer=require(_0x3077('0x0'));var util=require(_0x3077('0x1'));var path=require(_0x3077('0x2'));var timeout=require(_0x3077('0x3'));var express=require(_0x3077('0x4'));var router=express[_0x3077('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3077('0x6'));var interaction=require(_0x3077('0x7'));var config=require(_0x3077('0x8'));var controller=require(_0x3077('0x9'));router[_0x3077('0xa')]('/',auth[_0x3077('0xb')](),controller['index']);router[_0x3077('0xa')]('/describe',auth[_0x3077('0xb')](),controller[_0x3077('0xc')]);router[_0x3077('0xa')]('/global_fields',auth[_0x3077('0xb')](),controller[_0x3077('0xd')]);router[_0x3077('0xa')]('/:id',auth[_0x3077('0xb')](),controller[_0x3077('0xe')]);router[_0x3077('0xa')](_0x3077('0xf'),auth['isAuthenticated'](),controller[_0x3077('0x10')]);router[_0x3077('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x3077('0xa')](_0x3077('0x11'),auth['isAuthenticated'](),controller[_0x3077('0x12')]);router['get'](_0x3077('0x13'),auth['isAuthenticated'](),controller[_0x3077('0x14')]);router[_0x3077('0xa')](_0x3077('0x15'),auth[_0x3077('0xb')](),controller[_0x3077('0x16')]);router[_0x3077('0x17')]('/',auth[_0x3077('0xb')](),controller[_0x3077('0x18')]);router[_0x3077('0x17')](_0x3077('0xf'),auth[_0x3077('0xb')](),controller[_0x3077('0x19')]);router['post']('/:id/contacts',auth[_0x3077('0xb')](),controller[_0x3077('0x1a')]);router[_0x3077('0x17')](_0x3077('0x13'),auth[_0x3077('0xb')](),controller[_0x3077('0x1b')]);router[_0x3077('0x17')](_0x3077('0x15'),auth[_0x3077('0xb')](),controller[_0x3077('0x1c')]);router['put'](_0x3077('0x1d'),auth[_0x3077('0xb')](),controller[_0x3077('0x1e')]);router[_0x3077('0x1f')](_0x3077('0x1d'),auth[_0x3077('0xb')](),controller[_0x3077('0x20')]);router[_0x3077('0x1f')](_0x3077('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x3077('0x1f')](_0x3077('0x15'),auth[_0x3077('0xb')](),controller['removeAgents']);module[_0x3077('0x21')]=router; \ No newline at end of file +var _0xa85e=['addContacts','addCustomField','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','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','getDispositions','getContacts','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/contacts'];(function(_0x537d33,_0x4cd981){var _0x48aeeb=function(_0x5618f0){while(--_0x5618f0){_0x537d33['push'](_0x537d33['shift']());}};_0x48aeeb(++_0x4cd981);}(_0xa85e,0x141));var _0xea85=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xa85e[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0xea85('0x0'));var util=require(_0xea85('0x1'));var path=require(_0xea85('0x2'));var timeout=require(_0xea85('0x3'));var express=require(_0xea85('0x4'));var router=express['Router']();var fs_extra=require(_0xea85('0x5'));var auth=require(_0xea85('0x6'));var interaction=require(_0xea85('0x7'));var config=require(_0xea85('0x8'));var controller=require(_0xea85('0x9'));router['get']('/',auth[_0xea85('0xa')](),controller[_0xea85('0xb')]);router[_0xea85('0xc')](_0xea85('0xd'),auth['isAuthenticated'](),controller[_0xea85('0xe')]);router[_0xea85('0xc')](_0xea85('0xf'),auth[_0xea85('0xa')](),controller[_0xea85('0x10')]);router[_0xea85('0xc')](_0xea85('0x11'),auth['isAuthenticated'](),controller[_0xea85('0x12')]);router[_0xea85('0xc')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xea85('0x13')]);router[_0xea85('0xc')]('/:id/contacts',auth[_0xea85('0xa')](),controller[_0xea85('0x14')]);router[_0xea85('0xc')]('/:id/contacts/csv',auth[_0xea85('0xa')](),controller[_0xea85('0x15')]);router[_0xea85('0xc')](_0xea85('0x16'),auth['isAuthenticated'](),controller['getCustomFields']);router['get'](_0xea85('0x17'),auth[_0xea85('0xa')](),controller[_0xea85('0x18')]);router[_0xea85('0x19')]('/',auth[_0xea85('0xa')](),controller[_0xea85('0x1a')]);router['post'](_0xea85('0x1b'),auth[_0xea85('0xa')](),controller[_0xea85('0x1c')]);router[_0xea85('0x19')](_0xea85('0x1d'),auth[_0xea85('0xa')](),controller[_0xea85('0x1e')]);router[_0xea85('0x19')](_0xea85('0x16'),auth['isAuthenticated'](),controller[_0xea85('0x1f')]);router['post'](_0xea85('0x17'),auth['isAuthenticated'](),controller['addAgents']);router[_0xea85('0x20')](_0xea85('0x11'),auth[_0xea85('0xa')](),controller[_0xea85('0x21')]);router[_0xea85('0x22')]('/:id',auth[_0xea85('0xa')](),controller[_0xea85('0x23')]);router[_0xea85('0x22')]('/:id/dispositions',auth[_0xea85('0xa')](),controller[_0xea85('0x24')]);router['delete'](_0xea85('0x17'),auth[_0xea85('0xa')](),controller[_0xea85('0x25')]);module[_0xea85('0x26')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d02fdd9..1d2ab08 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 _0x0197=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x0197,0x164));var _0x7019=function(_0x3b71ae,_0x26399e){_0x3b71ae=_0x3b71ae-0x0;var _0xdc2506=_0x0197[_0x3b71ae];return _0xdc2506;};'use strict';var Sequelize=require(_0x7019('0x0'));module[_0x7019('0x1')]={'name':{'type':Sequelize[_0x7019('0x2')],'get':function(_0x5f35be){return this['getDataValue'](_0x7019('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x7019('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7019('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x705d=['field','sequelize','exports','getDataValue'];(function(_0x3f6426,_0x12cbf9){var _0x25d790=function(_0x3c6756){while(--_0x3c6756){_0x3f6426['push'](_0x3f6426['shift']());}};_0x25d790(++_0x12cbf9);}(_0x705d,0xed));var _0xd705=function(_0x2f19c8,_0x18582f){_0x2f19c8=_0x2f19c8-0x0;var _0x1610db=_0x705d[_0x2f19c8];return _0x1610db;};'use strict';var Sequelize=require(_0xd705('0x0'));module[_0xd705('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x390ff1){return this[_0xd705('0x2')](_0xd705('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'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 08a3cf1..42c8f2e 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5d0824,_0x145168){var _0x833953=function(_0x2660ed){while(--_0x2660ed){_0x5d0824['push'](_0x5d0824['shift']());}};_0x833953(++_0x145168);}(_0x7a54,0x106));var _0x47a5=function(_0x2b30dc,_0xf6d743){_0x2b30dc=_0x2b30dc-0x0;var _0x4c83e0=_0x7a54[_0x2b30dc];return _0x4c83e0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x187351,_0x43362e){var _0x3c626d=function(_0x25e8ed){while(--_0x25e8ed){_0x187351['push'](_0x187351['shift']());}};_0x3c626d(++_0x43362e);}(_0x7a54,0x106));var _0x47a5=function(_0x9afbf7,_0x5412cd){_0x9afbf7=_0x9afbf7-0x0;var _0x3ab667=_0x7a54[_0x9afbf7];return _0x3ab667;};'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 19ec528..6bf83b3 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 _0x3fdf=['tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x3fdf,0xa6));var _0xf3fd=function(_0x1f17ba,_0xe65e8d){_0x1f17ba=_0x1f17ba-0x0;var _0x521392=_0x3fdf[_0x1f17ba];return _0x521392;};'use strict';var _=require(_0xf3fd('0x0'));var util=require(_0xf3fd('0x1'));var logger=require(_0xf3fd('0x2'))(_0xf3fd('0x3'));var moment=require(_0xf3fd('0x4'));var BPromise=require(_0xf3fd('0x5'));var rp=require(_0xf3fd('0x6'));var fs=require('fs');var path=require(_0xf3fd('0x7'));var rimraf=require('rimraf');var config=require(_0xf3fd('0x8'));var attributes=require(_0xf3fd('0x9'));module['exports']=function(_0x327168,_0x2ee5e0){return _0x327168['define']('Condition',attributes,{'tableName':_0xf3fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe8=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2fe8,0x111));var _0x82fe=function(_0x6b2276,_0x52dde4){_0x6b2276=_0x6b2276-0x0;var _0x521bf3=_0x2fe8[_0x6b2276];return _0x521bf3;};'use strict';var _=require(_0x82fe('0x0'));var util=require(_0x82fe('0x1'));var logger=require(_0x82fe('0x2'))(_0x82fe('0x3'));var moment=require('moment');var BPromise=require(_0x82fe('0x4'));var rp=require(_0x82fe('0x5'));var fs=require('fs');var path=require(_0x82fe('0x6'));var rimraf=require(_0x82fe('0x7'));var config=require(_0x82fe('0x8'));var attributes=require(_0x82fe('0x9'));module[_0x82fe('0xa')]=function(_0x168ad4,_0x39fcac){return _0x168ad4[_0x82fe('0xb')](_0x82fe('0xc'),attributes,{'tableName':_0x82fe('0xd'),'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 935ddc6..a773f6a 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 _0x87fe=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x238c75,_0x250f7f){var _0x49d0bc=function(_0x4ea9ce){while(--_0x4ea9ce){_0x238c75['push'](_0x238c75['shift']());}};_0x49d0bc(++_0x250f7f);}(_0x87fe,0x183));var _0xe87f=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x87fe[_0x22ee0f];return _0x204696;};'use strict';var _=require(_0xe87f('0x0'));var util=require('util');var moment=require(_0xe87f('0x1'));var BPromise=require(_0xe87f('0x2'));var rs=require(_0xe87f('0x3'));var fs=require('fs');var Redis=require(_0xe87f('0x4'));var db=require(_0xe87f('0x5'))['db'];var utils=require(_0xe87f('0x6'));var logger=require(_0xe87f('0x7'))('rpc');var config=require(_0xe87f('0x8'));var jayson=require(_0xe87f('0x9'));var client=jayson['client'][_0xe87f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x440383,_0x4e9199,_0x38e3f6){return new BPromise(function(_0x34ff9f,_0x3cbe27){return client[_0xe87f('0xb')](_0x440383,_0x38e3f6)[_0xe87f('0xc')](function(_0x2a7206){logger[_0xe87f('0xd')](_0xe87f('0xe'),_0x4e9199,'request\x20sent');logger[_0xe87f('0xf')](_0xe87f('0x10'),_0x4e9199,_0xe87f('0x11'),JSON[_0xe87f('0x12')](_0x2a7206));if(_0x2a7206['error']){if(_0x2a7206[_0xe87f('0x13')][_0xe87f('0x14')]===0x1f4){logger[_0xe87f('0x13')](_0xe87f('0xe'),_0x4e9199,_0x2a7206[_0xe87f('0x13')][_0xe87f('0x15')]);return _0x3cbe27(_0x2a7206[_0xe87f('0x13')][_0xe87f('0x15')]);}logger[_0xe87f('0x13')]('Condition,\x20%s,\x20%s',_0x4e9199,_0x2a7206[_0xe87f('0x13')][_0xe87f('0x15')]);return _0x34ff9f(_0x2a7206['error'][_0xe87f('0x15')]);}else{logger['info'](_0xe87f('0xe'),_0x4e9199,_0xe87f('0x11'));_0x34ff9f(_0x2a7206[_0xe87f('0x16')][_0xe87f('0x15')]);}})['catch'](function(_0x28819c){logger[_0xe87f('0x13')](_0xe87f('0xe'),_0x4e9199,_0x28819c);_0x3cbe27(_0x28819c);});});} \ No newline at end of file +var _0x1ccc=['info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x50c9de,_0x2d7ae4){var _0x4002b1=function(_0x1b74b8){while(--_0x1b74b8){_0x50c9de['push'](_0x50c9de['shift']());}};_0x4002b1(++_0x2d7ae4);}(_0x1ccc,0x1ea));var _0xc1cc=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x1ccc[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0xc1cc('0x0'));var util=require('util');var moment=require(_0xc1cc('0x1'));var BPromise=require(_0xc1cc('0x2'));var rs=require(_0xc1cc('0x3'));var fs=require('fs');var Redis=require(_0xc1cc('0x4'));var db=require(_0xc1cc('0x5'))['db'];var utils=require(_0xc1cc('0x6'));var logger=require(_0xc1cc('0x7'))(_0xc1cc('0x8'));var config=require(_0xc1cc('0x9'));var jayson=require(_0xc1cc('0xa'));var client=jayson[_0xc1cc('0xb')][_0xc1cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17e95f,_0x3116f3,_0xf12c70){return new BPromise(function(_0x59b7d4,_0x1f45c6){return client[_0xc1cc('0xd')](_0x17e95f,_0xf12c70)['then'](function(_0x5d6cd4){logger[_0xc1cc('0xe')](_0xc1cc('0xf'),_0x3116f3,'request\x20sent');logger[_0xc1cc('0x10')](_0xc1cc('0x11'),_0x3116f3,_0xc1cc('0x12'),JSON['stringify'](_0x5d6cd4));if(_0x5d6cd4[_0xc1cc('0x13')]){if(_0x5d6cd4[_0xc1cc('0x13')][_0xc1cc('0x14')]===0x1f4){logger['error'](_0xc1cc('0xf'),_0x3116f3,_0x5d6cd4[_0xc1cc('0x13')]['message']);return _0x1f45c6(_0x5d6cd4[_0xc1cc('0x13')][_0xc1cc('0x15')]);}logger[_0xc1cc('0x13')]('Condition,\x20%s,\x20%s',_0x3116f3,_0x5d6cd4[_0xc1cc('0x13')]['message']);return _0x59b7d4(_0x5d6cd4[_0xc1cc('0x13')][_0xc1cc('0x15')]);}else{logger[_0xc1cc('0xe')](_0xc1cc('0xf'),_0x3116f3,_0xc1cc('0x12'));_0x59b7d4(_0x5d6cd4[_0xc1cc('0x16')][_0xc1cc('0x15')]);}})[_0xc1cc('0x17')](function(_0x3ba272){logger[_0xc1cc('0x13')]('Condition,\x20%s,\x20%s',_0x3116f3,_0x3ba272);_0x1f45c6(_0x3ba272);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8128621..256cac1 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 _0x9a46=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy'];(function(_0x411d94,_0x1aaa33){var _0x4d5eef=function(_0x54f339){while(--_0x54f339){_0x411d94['push'](_0x411d94['shift']());}};_0x4d5eef(++_0x1aaa33);}(_0x9a46,0xa6));var _0x69a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9a46[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x69a4('0x0'));var path=require(_0x69a4('0x1'));var timeout=require(_0x69a4('0x2'));var express=require(_0x69a4('0x3'));var router=express[_0x69a4('0x4')]();var fs_extra=require(_0x69a4('0x5'));var auth=require(_0x69a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x69a4('0x7'));var controller=require(_0x69a4('0x8'));router[_0x69a4('0x9')](_0x69a4('0xa'),auth[_0x69a4('0xb')](),controller['update']);router[_0x69a4('0xc')]('/:id',auth[_0x69a4('0xb')](),controller[_0x69a4('0xd')]);module[_0x69a4('0xe')]=router; \ No newline at end of file +var _0x091e=['../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4be706,_0x31c6f6){var _0x402b6b=function(_0x19ba1d){while(--_0x19ba1d){_0x4be706['push'](_0x4be706['shift']());}};_0x402b6b(++_0x31c6f6);}(_0x091e,0x1d4));var _0xe091=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x091e[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0xe091('0x0'));var path=require(_0xe091('0x1'));var timeout=require(_0xe091('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe091('0x3'));var auth=require(_0xe091('0x4'));var interaction=require(_0xe091('0x5'));var config=require(_0xe091('0x6'));var controller=require(_0xe091('0x7'));router['put'](_0xe091('0x8'),auth[_0xe091('0x9')](),controller['update']);router['delete'](_0xe091('0x8'),auth[_0xe091('0x9')](),controller['destroy']);module[_0xe091('0xa')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 0618bee..5ca8301 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 _0xb035=['exports','STRING','name','INTEGER','sequelize'];(function(_0x1af273,_0x4582c1){var _0x3ebc02=function(_0xe95912){while(--_0xe95912){_0x1af273['push'](_0x1af273['shift']());}};_0x3ebc02(++_0x4582c1);}(_0xb035,0x1e9));var _0x5b03=function(_0x253804,_0x4101e2){_0x253804=_0x253804-0x0;var _0x26cb31=_0xb035[_0x253804];return _0x26cb31;};'use strict';var Sequelize=require(_0x5b03('0x0'));module[_0x5b03('0x1')]={'name':{'type':Sequelize[_0x5b03('0x2')],'allowNull':![],'unique':_0x5b03('0x3')},'OrderBy':{'type':Sequelize[_0x5b03('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4253=['STRING','name','INTEGER','sequelize','exports'];(function(_0x5d3907,_0x1138ba){var _0x8ad5b2=function(_0x479c41){while(--_0x479c41){_0x5d3907['push'](_0x5d3907['shift']());}};_0x8ad5b2(++_0x1138ba);}(_0x4253,0xcb));var _0x3425=function(_0x16fcfe,_0x26392e){_0x16fcfe=_0x16fcfe-0x0;var _0xa05f71=_0x4253[_0x16fcfe];return _0xa05f71;};'use strict';var Sequelize=require(_0x3425('0x0'));module[_0x3425('0x1')]={'name':{'type':Sequelize[_0x3425('0x2')],'allowNull':![],'unique':_0x3425('0x3')},'OrderBy':{'type':Sequelize[_0x3425('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x3425('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 b53899f..35e9a16 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 _0xb78e=['find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','CmContactHasItem','eml-format','rimraf','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','json','apply','reject','save','destroy','ContactItemTypes','UserProfileResource','then','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x1dbe5d,_0x2ac119){var _0x567c54=function(_0x40e44c){while(--_0x40e44c){_0x1dbe5d['push'](_0x1dbe5d['shift']());}};_0x567c54(++_0x2ac119);}(_0xb78e,0x1c9));var _0xeb78=function(_0x4d9583,_0x1f6b06){_0x4d9583=_0x4d9583-0x0;var _0x4b64ad=_0xb78e[_0x4d9583];return _0x4b64ad;};'use strict';var emlformat=require(_0xeb78('0x0'));var rimraf=require(_0xeb78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb78('0x2'));var rp=require(_0xeb78('0x3'));var moment=require(_0xeb78('0x4'));var BPromise=require(_0xeb78('0x5'));var Mustache=require(_0xeb78('0x6'));var util=require(_0xeb78('0x7'));var path=require(_0xeb78('0x8'));var sox=require(_0xeb78('0x9'));var csv=require('to-csv');var ejs=require(_0xeb78('0xa'));var fs=require('fs');var fs_extra=require(_0xeb78('0xb'));var _=require(_0xeb78('0xc'));var squel=require(_0xeb78('0xd'));var crypto=require(_0xeb78('0xe'));var jsforce=require(_0xeb78('0xf'));var deskjs=require(_0xeb78('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeb78('0x11'));var Papa=require(_0xeb78('0x12'));var Redis=require(_0xeb78('0x13'));var authService=require(_0xeb78('0x14'));var qs=require(_0xeb78('0x15'));var as=require(_0xeb78('0x16'));var hardwareService=require(_0xeb78('0x17'));var logger=require(_0xeb78('0x18'))(_0xeb78('0x19'));var utils=require('../../config/utils');var config=require(_0xeb78('0x1a'));var licenseUtil=require(_0xeb78('0x1b'));var db=require(_0xeb78('0x1c'))['db'];function respondWithStatusCode(_0x259df2,_0x9dbe51){_0x9dbe51=_0x9dbe51||0xcc;return function(_0x28c58c){if(_0x28c58c){return _0x259df2[_0xeb78('0x1d')](_0x9dbe51);}return _0x259df2[_0xeb78('0x1e')](_0x9dbe51)[_0xeb78('0x1f')]();};}function respondWithResult(_0x9bcc79,_0x5d50cf){_0x5d50cf=_0x5d50cf||0xc8;return function(_0x315914){if(_0x315914){return _0x9bcc79[_0xeb78('0x1e')](_0x5d50cf)['json'](_0x315914);}};}function respondWithFilteredResult(_0x538485,_0x53be89){return function(_0x23a0d0){if(_0x23a0d0){var _0x50ebae=typeof _0x53be89[_0xeb78('0x20')]===_0xeb78('0x21')&&typeof _0x53be89['limit']===_0xeb78('0x21');var _0x53c811=_0x23a0d0[_0xeb78('0x22')];var _0x92e410=_0x50ebae?0x0:_0x53be89['offset'];var _0x45176e=_0x50ebae?_0x23a0d0[_0xeb78('0x22')]:_0x53be89[_0xeb78('0x20')]+_0x53be89['limit'];var _0x24d845;if(_0x45176e>=_0x53c811){_0x45176e=_0x53c811;_0x24d845=0xc8;}else{_0x24d845=0xce;}_0x538485[_0xeb78('0x1e')](_0x24d845);return _0x538485['set']('Content-Range',_0x92e410+'-'+_0x45176e+'/'+_0x53c811)[_0xeb78('0x23')](_0x23a0d0);}return null;};}function patchUpdates(_0x106c5d){return function(_0x42eacb){try{jsonpatch[_0xeb78('0x24')](_0x42eacb,_0x106c5d,!![]);}catch(_0x432b18){return BPromise[_0xeb78('0x25')](_0x432b18);}return _0x42eacb[_0xeb78('0x26')]();};}function saveUpdates(_0x3ea071,_0x18f08d){return function(_0x52b8c1){if(_0x52b8c1){return _0x52b8c1['update'](_0x3ea071)['then'](function(_0x5c9e0d){return _0x5c9e0d;});}return null;};}function removeEntity(_0x3c8e66,_0x5b15d8){return function(_0x2159c1){if(_0x2159c1){return _0x2159c1[_0xeb78('0x27')]()['then'](function(){var _0x777ca3=_0x2159c1['get']({'plain':!![]});var _0x9a00b=_0xeb78('0x28');return db[_0xeb78('0x29')][_0xeb78('0x27')]({'where':{'type':_0x9a00b,'resourceId':_0x777ca3['id']}})['then'](function(){return _0x2159c1;});})[_0xeb78('0x2a')](function(){_0x3c8e66['status'](0xcc)[_0xeb78('0x1f')]();});}};}function handleEntityNotFound(_0x23295a,_0x4493bb){return function(_0x5263fc){if(!_0x5263fc){_0x23295a[_0xeb78('0x1d')](0x194);}return _0x5263fc;};}function handleError(_0x1e7d56,_0x1c04dd){_0x1c04dd=_0x1c04dd||0x1f4;return function(_0x381b2f){logger[_0xeb78('0x2b')](_0x381b2f[_0xeb78('0x2c')]);if(_0x381b2f[_0xeb78('0x2d')]){delete _0x381b2f[_0xeb78('0x2d')];}_0x1e7d56[_0xeb78('0x1e')](_0x1c04dd)[_0xeb78('0x2e')](_0x381b2f);};}exports[_0xeb78('0x2f')]=function(_0x505468,_0x555d89){var _0x4d12a3={},_0xb3a935={},_0x4253ea={'count':0x0,'rows':[]};var _0x15327f=_['map'](db[_0xeb78('0x30')][_0xeb78('0x31')],function(_0x3de59f){return{'name':_0x3de59f[_0xeb78('0x32')],'type':_0x3de59f[_0xeb78('0x33')][_0xeb78('0x34')]};});_0xb3a935[_0xeb78('0x35')]=_[_0xeb78('0x36')](_0x15327f,_0xeb78('0x2d'));_0xb3a935['query']=_[_0xeb78('0x37')](_0x505468['query']);_0xb3a935[_0xeb78('0x38')]=_[_0xeb78('0x39')](_0xb3a935[_0xeb78('0x35')],_0xb3a935[_0xeb78('0x3a')]);_0x4d12a3[_0xeb78('0x3b')]=_[_0xeb78('0x39')](_0xb3a935['model'],qs['fields'](_0x505468[_0xeb78('0x3a')][_0xeb78('0x3c')]));_0x4d12a3[_0xeb78('0x3b')]=_0x4d12a3[_0xeb78('0x3b')][_0xeb78('0x3d')]?_0x4d12a3['attributes']:_0xb3a935[_0xeb78('0x35')];if(!_0x505468[_0xeb78('0x3a')][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x4d12a3[_0xeb78('0x40')]=qs[_0xeb78('0x40')](_0x505468['query']['limit']);_0x4d12a3['offset']=qs['offset'](_0x505468[_0xeb78('0x3a')][_0xeb78('0x20')]);}_0x4d12a3[_0xeb78('0x41')]=qs['sort'](_0x505468[_0xeb78('0x3a')][_0xeb78('0x42')]);_0x4d12a3['where']=qs['filters'](_['pick'](_0x505468[_0xeb78('0x3a')],_0xb3a935[_0xeb78('0x38')]),_0x15327f);if(_0x505468[_0xeb78('0x3a')]['filter']){_0x4d12a3[_0xeb78('0x43')]=_[_0xeb78('0x44')](_0x4d12a3[_0xeb78('0x43')],{'$or':_['map'](_0x15327f,function(_0xf0f13c){if(_0xf0f13c[_0xeb78('0x33')]!==_0xeb78('0x45')){var _0x437590={};_0x437590[_0xf0f13c['name']]={'$like':'%'+_0x505468['query'][_0xeb78('0x46')]+'%'};return _0x437590;}})});}_0x4d12a3=_[_0xeb78('0x44')]({},_0x4d12a3,_0x505468[_0xeb78('0x47')]);var _0x183095={'where':_0x4d12a3[_0xeb78('0x43')]};return db[_0xeb78('0x30')][_0xeb78('0x22')](_0x183095)[_0xeb78('0x2a')](function(_0x47567d){_0x4253ea['count']=_0x47567d;if(_0x505468[_0xeb78('0x3a')][_0xeb78('0x48')]){_0x4d12a3[_0xeb78('0x49')]=[{'all':!![]}];}return db['ContactItemType'][_0xeb78('0x4a')](_0x4d12a3);})['then'](function(_0x21f81b){_0x4253ea[_0xeb78('0x4b')]=_0x21f81b;return _0x4253ea;})[_0xeb78('0x2a')](respondWithFilteredResult(_0x555d89,_0x4d12a3))['catch'](handleError(_0x555d89,null));};exports[_0xeb78('0x4c')]=function(_0x3ab487,_0x390051){var _0x2944d8={'raw':!![],'where':{'id':_0x3ab487['params']['id']}},_0x2dc9f7={};_0x2dc9f7[_0xeb78('0x35')]=_[_0xeb78('0x37')](db['ContactItemType'][_0xeb78('0x31')]);_0x2dc9f7[_0xeb78('0x3a')]=_[_0xeb78('0x37')](_0x3ab487['query']);_0x2dc9f7[_0xeb78('0x38')]=_[_0xeb78('0x39')](_0x2dc9f7[_0xeb78('0x35')],_0x2dc9f7[_0xeb78('0x3a')]);_0x2944d8[_0xeb78('0x3b')]=_[_0xeb78('0x39')](_0x2dc9f7['model'],qs['fields'](_0x3ab487[_0xeb78('0x3a')][_0xeb78('0x3c')]));_0x2944d8['attributes']=_0x2944d8[_0xeb78('0x3b')][_0xeb78('0x3d')]?_0x2944d8[_0xeb78('0x3b')]:_0x2dc9f7[_0xeb78('0x35')];if(_0x3ab487[_0xeb78('0x3a')][_0xeb78('0x48')]){_0x2944d8[_0xeb78('0x49')]=[{'all':!![]}];}_0x2944d8=_[_0xeb78('0x44')]({},_0x2944d8,_0x3ab487[_0xeb78('0x47')]);return db[_0xeb78('0x30')][_0xeb78('0x4d')](_0x2944d8)[_0xeb78('0x2a')](handleEntityNotFound(_0x390051,null))[_0xeb78('0x2a')](respondWithResult(_0x390051,null))[_0xeb78('0x4e')](handleError(_0x390051,null));};exports[_0xeb78('0x4f')]=function(_0x58e361,_0x2c4616){return db[_0xeb78('0x30')][_0xeb78('0x4f')](_0x58e361[_0xeb78('0x50')],{})['then'](function(_0x35cedb){var _0x135106=_0x58e361[_0xeb78('0x51')][_0xeb78('0x52')]({'plain':!![]});if(!_0x135106)throw new Error(_0xeb78('0x53'));if(_0x135106['role']==='user'){var _0x553f6d=_0x35cedb[_0xeb78('0x52')]({'plain':!![]});var _0x21ee21='ContactItemTypes';return db[_0xeb78('0x54')][_0xeb78('0x4d')]({'where':{'name':_0x21ee21,'userProfileId':_0x135106[_0xeb78('0x55')]},'raw':!![]})['then'](function(_0x4d6a21){if(_0x4d6a21&&_0x4d6a21[_0xeb78('0x56')]===0x0){return db[_0xeb78('0x29')][_0xeb78('0x4f')]({'name':_0x553f6d['name'],'resourceId':_0x553f6d['id'],'type':_0x4d6a21[_0xeb78('0x2d')],'sectionId':_0x4d6a21['id']},{})[_0xeb78('0x2a')](function(){return _0x35cedb;});}else{return _0x35cedb;}})[_0xeb78('0x4e')](function(_0x4a3c91){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a3c91);throw _0x4a3c91;});}return _0x35cedb;})[_0xeb78('0x2a')](respondWithResult(_0x2c4616,0xc9))[_0xeb78('0x4e')](handleError(_0x2c4616,null));};exports['update']=function(_0x2b42f6,_0x31eb10){if(_0x2b42f6[_0xeb78('0x50')]['id']){delete _0x2b42f6['body']['id'];}return db[_0xeb78('0x30')]['find']({'where':{'id':_0x2b42f6[_0xeb78('0x57')]['id']}})[_0xeb78('0x2a')](handleEntityNotFound(_0x31eb10,null))[_0xeb78('0x2a')](saveUpdates(_0x2b42f6['body'],null))['then'](respondWithResult(_0x31eb10,null))['catch'](handleError(_0x31eb10,null));};exports['destroy']=function(_0x3238e9,_0x51f51f){return db[_0xeb78('0x30')][_0xeb78('0x4d')]({'where':{'id':_0x3238e9[_0xeb78('0x57')]['id']}})[_0xeb78('0x2a')](handleEntityNotFound(_0x51f51f,null))[_0xeb78('0x2a')](db[_0xeb78('0x58')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3238e9['params']['id']}}))[_0xeb78('0x2a')](removeEntity(_0x51f51f,null))[_0xeb78('0x4e')](handleError(_0x51f51f,null));}; \ No newline at end of file +var _0x4888=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ContactItemType','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x4888,0x198));var _0x8488=function(_0x3d309c,_0x242f4c){_0x3d309c=_0x3d309c-0x0;var _0x241187=_0x4888[_0x3d309c];return _0x241187;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){var _0x5b8885=_0x290b33['get']({'plain':!![]});var _0x472624='ContactItemTypes';return db['UserProfileResource'][_0x8488('0x22')]({'where':{'type':_0x472624,'resourceId':_0x5b8885['id']}})[_0x8488('0x21')](function(){return _0x290b33;});})[_0x8488('0x21')](function(){_0x140b0b[_0x8488('0x17')](0xcc)[_0x8488('0x23')]();});}};}function handleEntityNotFound(_0x503b83,_0x1b0519){return function(_0x38c137){if(!_0x38c137){_0x503b83[_0x8488('0x24')](0x194);}return _0x38c137;};}function handleError(_0x3df1f9,_0x460001){_0x460001=_0x460001||0x1f4;return function(_0x27f5cf){logger[_0x8488('0x25')](_0x27f5cf[_0x8488('0x26')]);if(_0x27f5cf[_0x8488('0x27')]){delete _0x27f5cf[_0x8488('0x27')];}_0x3df1f9[_0x8488('0x17')](_0x460001)['send'](_0x27f5cf);};}exports['index']=function(_0x4e3fe2,_0x292fe8){var _0x408c36={},_0x19cf42={},_0x121dcc={'count':0x0,'rows':[]};var _0x117321=_[_0x8488('0x28')](db['ContactItemType'][_0x8488('0x29')],function(_0x14f378){return{'name':_0x14f378[_0x8488('0x2a')],'type':_0x14f378[_0x8488('0x2b')][_0x8488('0x2c')]};});_0x19cf42['model']=_[_0x8488('0x28')](_0x117321,_0x8488('0x27'));_0x19cf42['query']=_[_0x8488('0x2d')](_0x4e3fe2[_0x8488('0x2e')]);_0x19cf42[_0x8488('0x2f')]=_[_0x8488('0x30')](_0x19cf42[_0x8488('0x31')],_0x19cf42['query']);_0x408c36[_0x8488('0x32')]=_[_0x8488('0x30')](_0x19cf42[_0x8488('0x31')],qs['fields'](_0x4e3fe2[_0x8488('0x2e')]['fields']));_0x408c36[_0x8488('0x32')]=_0x408c36[_0x8488('0x32')][_0x8488('0x33')]?_0x408c36[_0x8488('0x32')]:_0x19cf42['model'];if(!_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x34')](_0x8488('0x35'))){_0x408c36['limit']=qs[_0x8488('0x1a')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x1a')]);_0x408c36[_0x8488('0x19')]=qs[_0x8488('0x19')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x19')]);}_0x408c36[_0x8488('0x36')]=qs[_0x8488('0x37')](_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x37')]);_0x408c36['where']=qs['filters'](_[_0x8488('0x38')](_0x4e3fe2[_0x8488('0x2e')],_0x19cf42[_0x8488('0x2f')]),_0x117321);if(_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x39')]){_0x408c36[_0x8488('0x3a')]=_[_0x8488('0x3b')](_0x408c36[_0x8488('0x3a')],{'$or':_[_0x8488('0x28')](_0x117321,function(_0x5f561c){if(_0x5f561c[_0x8488('0x2b')]!==_0x8488('0x3c')){var _0x11a258={};_0x11a258[_0x5f561c['name']]={'$like':'%'+_0x4e3fe2[_0x8488('0x2e')][_0x8488('0x39')]+'%'};return _0x11a258;}})});}_0x408c36=_[_0x8488('0x3b')]({},_0x408c36,_0x4e3fe2[_0x8488('0x3d')]);var _0x44d5f2={'where':_0x408c36[_0x8488('0x3a')]};return db[_0x8488('0x3e')]['count'](_0x44d5f2)[_0x8488('0x21')](function(_0x1c33a1){_0x121dcc[_0x8488('0x1c')]=_0x1c33a1;if(_0x4e3fe2['query'][_0x8488('0x3f')]){_0x408c36['include']=[{'all':!![]}];}return db[_0x8488('0x3e')][_0x8488('0x40')](_0x408c36);})['then'](function(_0x22a3f3){_0x121dcc[_0x8488('0x41')]=_0x22a3f3;return _0x121dcc;})[_0x8488('0x21')](respondWithFilteredResult(_0x292fe8,_0x408c36))[_0x8488('0x42')](handleError(_0x292fe8,null));};exports[_0x8488('0x43')]=function(_0x4e5c83,_0x3724be){var _0x50c31d={'raw':!![],'where':{'id':_0x4e5c83[_0x8488('0x44')]['id']}},_0x3440ae={};_0x3440ae[_0x8488('0x31')]=_[_0x8488('0x2d')](db[_0x8488('0x3e')][_0x8488('0x29')]);_0x3440ae[_0x8488('0x2e')]=_[_0x8488('0x2d')](_0x4e5c83[_0x8488('0x2e')]);_0x3440ae[_0x8488('0x2f')]=_[_0x8488('0x30')](_0x3440ae[_0x8488('0x31')],_0x3440ae[_0x8488('0x2e')]);_0x50c31d[_0x8488('0x32')]=_[_0x8488('0x30')](_0x3440ae[_0x8488('0x31')],qs[_0x8488('0x45')](_0x4e5c83['query'][_0x8488('0x45')]));_0x50c31d[_0x8488('0x32')]=_0x50c31d[_0x8488('0x32')][_0x8488('0x33')]?_0x50c31d['attributes']:_0x3440ae[_0x8488('0x31')];if(_0x4e5c83[_0x8488('0x2e')][_0x8488('0x3f')]){_0x50c31d[_0x8488('0x46')]=[{'all':!![]}];}_0x50c31d=_['merge']({},_0x50c31d,_0x4e5c83[_0x8488('0x3d')]);return db[_0x8488('0x3e')][_0x8488('0x47')](_0x50c31d)[_0x8488('0x21')](handleEntityNotFound(_0x3724be,null))[_0x8488('0x21')](respondWithResult(_0x3724be,null))[_0x8488('0x42')](handleError(_0x3724be,null));};exports[_0x8488('0x48')]=function(_0x299d8e,_0x1bc2e1){return db[_0x8488('0x3e')][_0x8488('0x48')](_0x299d8e[_0x8488('0x49')],{})[_0x8488('0x21')](function(_0x58b319){var _0x56bc65=_0x299d8e[_0x8488('0x4a')][_0x8488('0x4b')]({'plain':!![]});if(!_0x56bc65)throw new Error(_0x8488('0x4c'));if(_0x56bc65[_0x8488('0x4d')]===_0x8488('0x4a')){var _0x22d22c=_0x58b319[_0x8488('0x4b')]({'plain':!![]});var _0x27dfd2=_0x8488('0x4e');return db['UserProfileSection'][_0x8488('0x47')]({'where':{'name':_0x27dfd2,'userProfileId':_0x56bc65[_0x8488('0x4f')]},'raw':!![]})['then'](function(_0x35e08a){if(_0x35e08a&&_0x35e08a[_0x8488('0x50')]===0x0){return db[_0x8488('0x51')][_0x8488('0x48')]({'name':_0x22d22c['name'],'resourceId':_0x22d22c['id'],'type':_0x35e08a[_0x8488('0x27')],'sectionId':_0x35e08a['id']},{})[_0x8488('0x21')](function(){return _0x58b319;});}else{return _0x58b319;}})[_0x8488('0x42')](function(_0x5c55bf){logger[_0x8488('0x25')](_0x8488('0x52'),_0x5c55bf);throw _0x5c55bf;});}return _0x58b319;})[_0x8488('0x21')](respondWithResult(_0x1bc2e1,0xc9))[_0x8488('0x42')](handleError(_0x1bc2e1,null));};exports['update']=function(_0x2eff23,_0x574bf1){if(_0x2eff23['body']['id']){delete _0x2eff23[_0x8488('0x49')]['id'];}return db['ContactItemType'][_0x8488('0x47')]({'where':{'id':_0x2eff23[_0x8488('0x44')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x574bf1,null))[_0x8488('0x21')](saveUpdates(_0x2eff23[_0x8488('0x49')],null))[_0x8488('0x21')](respondWithResult(_0x574bf1,null))['catch'](handleError(_0x574bf1,null));};exports[_0x8488('0x22')]=function(_0x693741,_0x21765b){return db[_0x8488('0x3e')][_0x8488('0x47')]({'where':{'id':_0x693741['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x21765b,null))['then'](db[_0x8488('0x53')][_0x8488('0x54')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x693741['params']['id']}}))[_0x8488('0x21')](removeEntity(_0x21765b,null))[_0x8488('0x42')](handleError(_0x21765b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 1b22c88..620da01 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 _0xcde1=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types'];(function(_0x5930bf,_0x47e575){var _0x3d33f2=function(_0x50e1dc){while(--_0x50e1dc){_0x5930bf['push'](_0x5930bf['shift']());}};_0x3d33f2(++_0x47e575);}(_0xcde1,0xf2));var _0x1cde=function(_0x526763,_0x3acf0e){_0x526763=_0x526763-0x0;var _0x4f3727=_0xcde1[_0x526763];return _0x4f3727;};'use strict';var _=require(_0x1cde('0x0'));var util=require('util');var logger=require(_0x1cde('0x1'))(_0x1cde('0x2'));var moment=require(_0x1cde('0x3'));var BPromise=require(_0x1cde('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cde('0x5'));var rimraf=require('rimraf');var config=require(_0x1cde('0x6'));var attributes=require(_0x1cde('0x7'));module['exports']=function(_0x6d0376,_0x2c92b5){return _0x6d0376[_0x1cde('0x8')](_0x1cde('0x9'),attributes,{'tableName':_0x1cde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x843f=['tools_contact_item_types','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define'];(function(_0x26a490,_0x1d54cf){var _0x4f14c1=function(_0x47922f){while(--_0x47922f){_0x26a490['push'](_0x26a490['shift']());}};_0x4f14c1(++_0x1d54cf);}(_0x843f,0x135));var _0xf843=function(_0x11a6bd,_0xb539d2){_0x11a6bd=_0x11a6bd-0x0;var _0x77416=_0x843f[_0x11a6bd];return _0x77416;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf843('0x0'))('api');var moment=require(_0xf843('0x1'));var BPromise=require(_0xf843('0x2'));var rp=require(_0xf843('0x3'));var fs=require('fs');var path=require(_0xf843('0x4'));var rimraf=require(_0xf843('0x5'));var config=require(_0xf843('0x6'));var attributes=require(_0xf843('0x7'));module[_0xf843('0x8')]=function(_0x3a2d14,_0x124442){return _0x3a2d14[_0xf843('0x9')]('ContactItemType',attributes,{'tableName':_0xf843('0xa'),'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 ddf4a43..842e5a2 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 _0xdeab=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','error','message','lodash','util'];(function(_0x295899,_0x4bab11){var _0x516480=function(_0x5f4865){while(--_0x5f4865){_0x295899['push'](_0x295899['shift']());}};_0x516480(++_0x4bab11);}(_0xdeab,0x154));var _0xbdea=function(_0x5ddc90,_0x1a9989){_0x5ddc90=_0x5ddc90-0x0;var _0x1f2b57=_0xdeab[_0x5ddc90];return _0x1f2b57;};'use strict';var _=require(_0xbdea('0x0'));var util=require(_0xbdea('0x1'));var moment=require(_0xbdea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdea('0x3'))['db'];var utils=require(_0xbdea('0x4'));var logger=require(_0xbdea('0x5'))(_0xbdea('0x6'));var config=require(_0xbdea('0x7'));var jayson=require(_0xbdea('0x8'));var client=jayson[_0xbdea('0x9')][_0xbdea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215449,_0x1ec8a9,_0x127f18){return new BPromise(function(_0x3a93e6,_0x2e9b91){return client['request'](_0x215449,_0x127f18)[_0xbdea('0xb')](function(_0x41e88c){logger[_0xbdea('0xc')](_0xbdea('0xd'),_0x1ec8a9,_0xbdea('0xe'));logger['debug'](_0xbdea('0xf'),_0x1ec8a9,'request\x20sent',JSON['stringify'](_0x41e88c));if(_0x41e88c['error']){if(_0x41e88c[_0xbdea('0x10')]['code']===0x1f4){logger[_0xbdea('0x10')](_0xbdea('0xd'),_0x1ec8a9,_0x41e88c[_0xbdea('0x10')][_0xbdea('0x11')]);return _0x2e9b91(_0x41e88c['error'][_0xbdea('0x11')]);}logger[_0xbdea('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1ec8a9,_0x41e88c[_0xbdea('0x10')][_0xbdea('0x11')]);return _0x3a93e6(_0x41e88c[_0xbdea('0x10')][_0xbdea('0x11')]);}else{logger[_0xbdea('0xc')]('ContactItemType,\x20%s,\x20%s',_0x1ec8a9,_0xbdea('0xe'));_0x3a93e6(_0x41e88c['result'][_0xbdea('0x11')]);}})['catch'](function(_0xed447c){logger[_0xbdea('0x10')](_0xbdea('0xd'),_0x1ec8a9,_0xed447c);_0x2e9b91(_0xed447c);});});} \ No newline at end of file +var _0xc175=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x576444,_0x574e95){var _0x1763be=function(_0x211804){while(--_0x211804){_0x576444['push'](_0x576444['shift']());}};_0x1763be(++_0x574e95);}(_0xc175,0x196));var _0x5c17=function(_0x2f94e6,_0x21bde0){_0x2f94e6=_0x2f94e6-0x0;var _0x249048=_0xc175[_0x2f94e6];return _0x249048;};'use strict';var _=require(_0x5c17('0x0'));var util=require(_0x5c17('0x1'));var moment=require(_0x5c17('0x2'));var BPromise=require(_0x5c17('0x3'));var rs=require(_0x5c17('0x4'));var fs=require('fs');var Redis=require(_0x5c17('0x5'));var db=require(_0x5c17('0x6'))['db'];var utils=require(_0x5c17('0x7'));var logger=require(_0x5c17('0x8'))(_0x5c17('0x9'));var config=require(_0x5c17('0xa'));var jayson=require(_0x5c17('0xb'));var client=jayson[_0x5c17('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156319,_0x240f4e,_0x5d3139){return new BPromise(function(_0x4a35b3,_0x194a37){return client[_0x5c17('0xd')](_0x156319,_0x5d3139)[_0x5c17('0xe')](function(_0x34446a){logger[_0x5c17('0xf')](_0x5c17('0x10'),_0x240f4e,_0x5c17('0x11'));logger[_0x5c17('0x12')](_0x5c17('0x13'),_0x240f4e,_0x5c17('0x11'),JSON[_0x5c17('0x14')](_0x34446a));if(_0x34446a[_0x5c17('0x15')]){if(_0x34446a['error']['code']===0x1f4){logger[_0x5c17('0x15')](_0x5c17('0x10'),_0x240f4e,_0x34446a[_0x5c17('0x15')][_0x5c17('0x16')]);return _0x194a37(_0x34446a['error'][_0x5c17('0x16')]);}logger[_0x5c17('0x15')](_0x5c17('0x10'),_0x240f4e,_0x34446a[_0x5c17('0x15')][_0x5c17('0x16')]);return _0x4a35b3(_0x34446a[_0x5c17('0x15')]['message']);}else{logger['info'](_0x5c17('0x10'),_0x240f4e,_0x5c17('0x11'));_0x4a35b3(_0x34446a['result']['message']);}})[_0x5c17('0x17')](function(_0x4ca250){logger[_0x5c17('0x15')](_0x5c17('0x10'),_0x240f4e,_0x4ca250);_0x194a37(_0x4ca250);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 1e12913..1858d94 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 _0x4441=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x472f84,_0x2956f4){var _0x30927e=function(_0x3dd607){while(--_0x3dd607){_0x472f84['push'](_0x472f84['shift']());}};_0x30927e(++_0x2956f4);}(_0x4441,0x18f));var _0x1444=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4441[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x1444('0x0'));var path=require(_0x1444('0x1'));var timeout=require(_0x1444('0x2'));var express=require(_0x1444('0x3'));var router=express[_0x1444('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1444('0x5'));var interaction=require(_0x1444('0x6'));var config=require(_0x1444('0x7'));var controller=require(_0x1444('0x8'));router[_0x1444('0x9')]('/',auth[_0x1444('0xa')](),controller['index']);router[_0x1444('0x9')](_0x1444('0xb'),auth['isAuthenticated'](),controller[_0x1444('0xc')]);router[_0x1444('0xd')]('/',auth[_0x1444('0xa')](),controller[_0x1444('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe4c3=['post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id'];(function(_0x25dea5,_0x440b95){var _0x5cc4af=function(_0x22ad08){while(--_0x22ad08){_0x25dea5['push'](_0x25dea5['shift']());}};_0x5cc4af(++_0x440b95);}(_0xe4c3,0x14a));var _0x3e4c=function(_0x3f70dc,_0x4beb5e){_0x3f70dc=_0x3f70dc-0x0;var _0x524f81=_0xe4c3[_0x3f70dc];return _0x524f81;};'use strict';var multer=require(_0x3e4c('0x0'));var util=require(_0x3e4c('0x1'));var path=require(_0x3e4c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e4c('0x3'));var router=express['Router']();var fs_extra=require(_0x3e4c('0x4'));var auth=require(_0x3e4c('0x5'));var interaction=require(_0x3e4c('0x6'));var config=require(_0x3e4c('0x7'));var controller=require(_0x3e4c('0x8'));router[_0x3e4c('0x9')]('/',auth[_0x3e4c('0xa')](),controller['index']);router['get'](_0x3e4c('0xb'),auth[_0x3e4c('0xa')](),controller['show']);router[_0x3e4c('0xc')]('/',auth[_0x3e4c('0xa')](),controller[_0x3e4c('0xd')]);router[_0x3e4c('0xe')](_0x3e4c('0xb'),auth['isAuthenticated'](),controller[_0x3e4c('0xf')]);router['delete'](_0x3e4c('0xb'),auth['isAuthenticated'](),controller[_0x3e4c('0x10')]);module[_0x3e4c('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 3cf920e..5dd90b0 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 _0x2032=['name','exports','STRING'];(function(_0xc157b0,_0x1fcd03){var _0xf137d9=function(_0x59c46b){while(--_0x59c46b){_0xc157b0['push'](_0xc157b0['shift']());}};_0xf137d9(++_0x1fcd03);}(_0x2032,0xd9));var _0x2203=function(_0x400390,_0x3aa80f){_0x400390=_0x400390-0x0;var _0x592bb4=_0x2032[_0x400390];return _0x592bb4;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 9b3f2b4..cc69f02 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 _0x411a=['updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrFaxAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomDashboards','end','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','Dashboard','findAll','fields','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','clone','params','omit','createdAt'];(function(_0x3df388,_0x2efa37){var _0x4c60a2=function(_0x5b4011){while(--_0x5b4011){_0x3df388['push'](_0x3df388['shift']());}};_0x4c60a2(++_0x2efa37);}(_0x411a,0x19c));var _0xa411=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0x411a[_0x3a0863];return _0x85c557;};'use strict';var emlformat=require(_0xa411('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa411('0x1'));var moment=require(_0xa411('0x2'));var BPromise=require(_0xa411('0x3'));var Mustache=require(_0xa411('0x4'));var util=require(_0xa411('0x5'));var path=require('path');var sox=require(_0xa411('0x6'));var csv=require(_0xa411('0x7'));var ejs=require(_0xa411('0x8'));var fs=require('fs');var fs_extra=require(_0xa411('0x9'));var _=require(_0xa411('0xa'));var squel=require(_0xa411('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa411('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa411('0xd'));var Papa=require(_0xa411('0xe'));var Redis=require(_0xa411('0xf'));var authService=require(_0xa411('0x10'));var qs=require(_0xa411('0x11'));var as=require(_0xa411('0x12'));var hardwareService=require(_0xa411('0x13'));var logger=require('../../config/logger')(_0xa411('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa411('0x15'));var db=require(_0xa411('0x16'))['db'];config[_0xa411('0x17')]=_['defaults'](config['redis'],{'host':_0xa411('0x18'),'port':0x18eb});var socket=require(_0xa411('0x19'))(new Redis(config[_0xa411('0x17')]));require(_0xa411('0x1a'))[_0xa411('0x1b')](socket);function respondWithStatusCode(_0x5f122e,_0x3dcb25){_0x3dcb25=_0x3dcb25||0xcc;return function(_0x11390f){if(_0x11390f){return _0x5f122e['sendStatus'](_0x3dcb25);}return _0x5f122e[_0xa411('0x1c')](_0x3dcb25)['end']();};}function respondWithResult(_0x26a3c9,_0x4e1c74){_0x4e1c74=_0x4e1c74||0xc8;return function(_0x3cb787){if(_0x3cb787){return _0x26a3c9[_0xa411('0x1c')](_0x4e1c74)['json'](_0x3cb787);}};}function respondWithFilteredResult(_0x28398e,_0x4b8ce2){return function(_0x6899dd){if(_0x6899dd){var _0x16843c=typeof _0x4b8ce2['offset']===_0xa411('0x1d')&&typeof _0x4b8ce2[_0xa411('0x1e')]==='undefined';var _0x36c3a5=_0x6899dd[_0xa411('0x1f')];var _0x5966e0=_0x16843c?0x0:_0x4b8ce2[_0xa411('0x20')];var _0x59728a=_0x16843c?_0x6899dd[_0xa411('0x1f')]:_0x4b8ce2['offset']+_0x4b8ce2[_0xa411('0x1e')];var _0x465b5f;if(_0x59728a>=_0x36c3a5){_0x59728a=_0x36c3a5;_0x465b5f=0xc8;}else{_0x465b5f=0xce;}_0x28398e['status'](_0x465b5f);return _0x28398e['set'](_0xa411('0x21'),_0x5966e0+'-'+_0x59728a+'/'+_0x36c3a5)[_0xa411('0x22')](_0x6899dd);}return null;};}function patchUpdates(_0x3b9b07){return function(_0x503e08){try{jsonpatch[_0xa411('0x23')](_0x503e08,_0x3b9b07,!![]);}catch(_0x5a020c){return BPromise[_0xa411('0x24')](_0x5a020c);}return _0x503e08[_0xa411('0x25')]();};}function saveUpdates(_0x4873e4,_0x589c76){return function(_0x3ef59f){if(_0x3ef59f){return _0x3ef59f[_0xa411('0x26')](_0x4873e4)[_0xa411('0x27')](function(_0x3399e1){return _0x3399e1;});}return null;};}function removeEntity(_0x41ecfe,_0x4e7913){return function(_0x2ffe69){if(_0x2ffe69){return _0x2ffe69[_0xa411('0x28')]()['then'](function(){var _0x28c277=_0x2ffe69[_0xa411('0x29')]({'plain':!![]});var _0x4d856b=_0xa411('0x2a');return db['UserProfileResource'][_0xa411('0x28')]({'where':{'type':_0x4d856b,'resourceId':_0x28c277['id']}})[_0xa411('0x27')](function(){return _0x2ffe69;});})[_0xa411('0x27')](function(){_0x41ecfe['status'](0xcc)[_0xa411('0x2b')]();});}};}function handleEntityNotFound(_0x1324e5,_0x4847cb){return function(_0x5179f6){if(!_0x5179f6){_0x1324e5['sendStatus'](0x194);}return _0x5179f6;};}function handleError(_0x5ace8f,_0x31a4bb){_0x31a4bb=_0x31a4bb||0x1f4;return function(_0x98f599){logger[_0xa411('0x2c')](_0x98f599[_0xa411('0x2d')]);if(_0x98f599[_0xa411('0x2e')]){delete _0x98f599[_0xa411('0x2e')];}_0x5ace8f['status'](_0x31a4bb)[_0xa411('0x2f')](_0x98f599);};}exports[_0xa411('0x30')]=function(_0x58b3cf,_0x41a05a){var _0x511e71={},_0x515123={},_0x5826a3={'count':0x0,'rows':[]};var _0x431703=_[_0xa411('0x31')](db['Dashboard'][_0xa411('0x32')],function(_0x1654cb){return{'name':_0x1654cb['fieldName'],'type':_0x1654cb[_0xa411('0x33')][_0xa411('0x34')]};});_0x515123['model']=_['map'](_0x431703,_0xa411('0x2e'));_0x515123[_0xa411('0x35')]=_[_0xa411('0x36')](_0x58b3cf['query']);_0x515123['filters']=_['intersection'](_0x515123[_0xa411('0x37')],_0x515123['query']);_0x511e71[_0xa411('0x38')]=_[_0xa411('0x39')](_0x515123[_0xa411('0x37')],qs['fields'](_0x58b3cf[_0xa411('0x35')]['fields']));_0x511e71['attributes']=_0x511e71[_0xa411('0x38')][_0xa411('0x3a')]?_0x511e71[_0xa411('0x38')]:_0x515123[_0xa411('0x37')];if(!_0x58b3cf[_0xa411('0x35')][_0xa411('0x3b')](_0xa411('0x3c'))){_0x511e71[_0xa411('0x1e')]=qs[_0xa411('0x1e')](_0x58b3cf[_0xa411('0x35')]['limit']);_0x511e71[_0xa411('0x20')]=qs[_0xa411('0x20')](_0x58b3cf['query']['offset']);}_0x511e71[_0xa411('0x3d')]=qs[_0xa411('0x3e')](_0x58b3cf[_0xa411('0x35')][_0xa411('0x3e')]);_0x511e71[_0xa411('0x3f')]=qs[_0xa411('0x40')](_['pick'](_0x58b3cf['query'],_0x515123[_0xa411('0x40')]),_0x431703);if(_0x58b3cf[_0xa411('0x35')][_0xa411('0x41')]){_0x511e71[_0xa411('0x3f')]=_['merge'](_0x511e71[_0xa411('0x3f')],{'$or':_[_0xa411('0x31')](_0x431703,function(_0x4f2939){if(_0x4f2939[_0xa411('0x33')]!==_0xa411('0x42')){var _0x327e0b={};_0x327e0b[_0x4f2939[_0xa411('0x2e')]]={'$like':'%'+_0x58b3cf['query'][_0xa411('0x41')]+'%'};return _0x327e0b;}})});}_0x511e71=_[_0xa411('0x43')]({},_0x511e71,_0x58b3cf[_0xa411('0x44')]);var _0x417a4c={'where':_0x511e71[_0xa411('0x3f')]};return db['Dashboard'][_0xa411('0x1f')](_0x417a4c)[_0xa411('0x27')](function(_0x15c47f){_0x5826a3[_0xa411('0x1f')]=_0x15c47f;if(_0x58b3cf['query'][_0xa411('0x45')]){_0x511e71[_0xa411('0x46')]=[{'all':!![]}];}return db[_0xa411('0x47')][_0xa411('0x48')](_0x511e71);})['then'](function(_0x2b0e74){_0x5826a3['rows']=_0x2b0e74;return _0x5826a3;})[_0xa411('0x27')](respondWithFilteredResult(_0x41a05a,_0x511e71))['catch'](handleError(_0x41a05a,null));};exports['show']=function(_0x1a7045,_0x584a24){var _0x2678c5={'raw':![],'where':{'id':_0x1a7045['params']['id']}},_0x7b5d14={};_0x7b5d14[_0xa411('0x37')]=_['keys'](db[_0xa411('0x47')][_0xa411('0x32')]);_0x7b5d14[_0xa411('0x35')]=_[_0xa411('0x36')](_0x1a7045[_0xa411('0x35')]);_0x7b5d14[_0xa411('0x40')]=_[_0xa411('0x39')](_0x7b5d14[_0xa411('0x37')],_0x7b5d14['query']);_0x2678c5[_0xa411('0x38')]=_[_0xa411('0x39')](_0x7b5d14[_0xa411('0x37')],qs[_0xa411('0x49')](_0x1a7045[_0xa411('0x35')][_0xa411('0x49')]));_0x2678c5[_0xa411('0x38')]=_0x2678c5[_0xa411('0x38')][_0xa411('0x3a')]?_0x2678c5[_0xa411('0x38')]:_0x7b5d14['model'];if(_0x1a7045['query'][_0xa411('0x45')]){_0x2678c5[_0xa411('0x46')]=[{'all':!![]}];}_0x2678c5=_[_0xa411('0x43')]({},_0x2678c5,_0x1a7045['options']);return db[_0xa411('0x47')][_0xa411('0x4a')](_0x2678c5)['then'](handleEntityNotFound(_0x584a24,null))[_0xa411('0x27')](respondWithResult(_0x584a24,null))[_0xa411('0x4b')](handleError(_0x584a24,null));};exports[_0xa411('0x4c')]=function(_0x2fa934,_0x449375){return db[_0xa411('0x47')][_0xa411('0x4c')](_0x2fa934[_0xa411('0x4d')],{})['then'](function(_0x4c87ec){var _0x588f9c=_0x2fa934['user'][_0xa411('0x29')]({'plain':!![]});if(!_0x588f9c)throw new Error(_0xa411('0x4e'));if(_0x588f9c[_0xa411('0x4f')]===_0xa411('0x50')){var _0x2f4f1c=_0x4c87ec[_0xa411('0x29')]({'plain':!![]});var _0x2ec65b='CustomDashboards';return db[_0xa411('0x51')][_0xa411('0x4a')]({'where':{'name':_0x2ec65b,'userProfileId':_0x588f9c[_0xa411('0x52')]},'raw':!![]})[_0xa411('0x27')](function(_0x242ec1){if(_0x242ec1&&_0x242ec1['autoAssociation']===0x0){return db[_0xa411('0x53')][_0xa411('0x4c')]({'name':_0x2f4f1c[_0xa411('0x2e')],'resourceId':_0x2f4f1c['id'],'type':_0x242ec1['name'],'sectionId':_0x242ec1['id']},{})[_0xa411('0x27')](function(){return _0x4c87ec;});}else{return _0x4c87ec;}})['catch'](function(_0x59ee91){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59ee91);throw _0x59ee91;});}return _0x4c87ec;})[_0xa411('0x27')](respondWithResult(_0x449375,0xc9))['catch'](handleError(_0x449375,null));};exports[_0xa411('0x54')]=function(_0x22f396,_0x45948e){var _0x4bef1d={'where':{'id':_0x22f396[_0xa411('0x55')]['id']}},_0x170250={};_0x170250[_0xa411('0x37')]=_[_0xa411('0x36')](db['Dashboard'][_0xa411('0x32')]);_0x4bef1d['attributes']=_['intersection'](_0x170250[_0xa411('0x37')],qs[_0xa411('0x49')](_0x22f396[_0xa411('0x35')][_0xa411('0x49')]));_0x4bef1d[_0xa411('0x38')]=_0x4bef1d[_0xa411('0x38')][_0xa411('0x3a')]?_0x4bef1d['attributes']:_0x170250[_0xa411('0x37')];if(_0x22f396[_0xa411('0x35')][_0xa411('0x45')]){_0x4bef1d[_0xa411('0x46')]=[{'all':!![]}];}_0x4bef1d=_[_0xa411('0x43')]({},_0x4bef1d,_0x22f396[_0xa411('0x44')]);return db[_0xa411('0x47')]['find'](_0x4bef1d)['then'](handleEntityNotFound(_0x45948e,null))[_0xa411('0x27')](function(_0x217711){if(_0x217711){var _0x382511=_0x217711['get']({'plain':!![]});_0x382511=qs[_0xa411('0x56')](_0x382511,['id',_0xa411('0x57'),_0xa411('0x58')]);_0x22f396[_0xa411('0x4d')]=_['omit'](_0x22f396['body'],['id','createdAt','updatedAt']);return db[_0xa411('0x47')]['create'](_['merge'](_0x382511,_0x22f396[_0xa411('0x4d')]),{'include':_0x22f396[_0xa411('0x35')][_0xa411('0x45')]?[{'all':!![]}]:undefined})[_0xa411('0x27')](function(_0x22899c){var _0x216c5f=_0x22f396[_0xa411('0x50')][_0xa411('0x29')]({'plain':!![]});if(!_0x216c5f)throw new Error(_0xa411('0x4e'));if(_0x216c5f[_0xa411('0x4f')]===_0xa411('0x50')){var _0x50b1ae=_0x22899c['get']({'plain':!![]});var _0x6d0056=_0xa411('0x2a');return db['UserProfileSection'][_0xa411('0x4a')]({'where':{'name':_0x6d0056,'userProfileId':_0x216c5f[_0xa411('0x52')]},'raw':!![]})[_0xa411('0x27')](function(_0x30a25d){if(_0x30a25d&&_0x30a25d[_0xa411('0x59')]===0x0){return db[_0xa411('0x53')][_0xa411('0x4c')]({'name':_0x50b1ae[_0xa411('0x2e')],'resourceId':_0x50b1ae['id'],'type':_0x30a25d[_0xa411('0x2e')],'sectionId':_0x30a25d['id']},{})[_0xa411('0x27')](function(){return _0x22899c;});}else{return _0x22899c;}})['catch'](function(_0x2e710e){logger['error'](_0xa411('0x5a'),_0x2e710e);throw _0x2e710e;});}return _0x22899c;});}})['then'](respondWithResult(_0x45948e,0xc9))[_0xa411('0x4b')](handleError(_0x45948e,null));};exports[_0xa411('0x26')]=function(_0x48fa66,_0x1b6b69){if(_0x48fa66[_0xa411('0x4d')]['id']){delete _0x48fa66[_0xa411('0x4d')]['id'];}return db[_0xa411('0x47')]['find']({'where':{'id':_0x48fa66[_0xa411('0x55')]['id']}})[_0xa411('0x27')](handleEntityNotFound(_0x1b6b69,null))[_0xa411('0x27')](saveUpdates(_0x48fa66[_0xa411('0x4d')],null))[_0xa411('0x27')](respondWithResult(_0x1b6b69,null))[_0xa411('0x4b')](handleError(_0x1b6b69,null));};exports[_0xa411('0x28')]=function(_0x2462e1,_0x17baff){return db[_0xa411('0x47')][_0xa411('0x4a')]({'where':{'id':_0x2462e1[_0xa411('0x55')]['id']}})['then'](handleEntityNotFound(_0x17baff,null))[_0xa411('0x27')](removeEntity(_0x17baff,null))['catch'](handleError(_0x17baff,null));};function widgetAttributes(_0x160e65){try{switch(_0x160e65['type']){case _0xa411('0x5b'):return[{'name':_0xa411('0x5c'),'value':_0x160e65[_0xa411('0x5c')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65['attrs'][0x0][_0xa411('0x5e')]:undefined)||'https://'}];case'custom':return[{'name':_0xa411('0x5f'),'value':_0x160e65[_0xa411('0x5f')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0][_0xa411('0x5e')]:undefined)||''}];case _0xa411('0x60'):return[{'name':_0xa411('0x61'),'value':_0x160e65[_0xa411('0x61')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0][_0xa411('0x5e')]:undefined)||_0xa411('0x62')},{'name':'attrTimezone','value':_0x160e65[_0xa411('0x63')]||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x1]?_0x160e65[_0xa411('0x5d')][0x1][_0xa411('0x5e')]:undefined)||'0.00'},{'name':_0xa411('0x64'),'value':_0x160e65['attrFontSize']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65['attrs'][0x2]?_0x160e65[_0xa411('0x5d')][0x2]['value']:undefined)||0xc}];case _0xa411('0x65'):return[{'name':'attrMetric','value':_0x160e65[_0xa411('0x66')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0][_0xa411('0x5e')]:undefined)||_0xa411('0x67')},{'name':'attrVoiceQueues','value':_0x160e65['attrVoiceQueues']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65['attrs'][0x1]?_0x160e65['attrs'][0x1]['value']:undefined)||[]},{'name':_0xa411('0x64'),'value':_0x160e65[_0xa411('0x64')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65['attrs'][0x2]?_0x160e65[_0xa411('0x5d')][0x2][_0xa411('0x5e')]:undefined)||0x14},{'name':'attrChannel','value':_0x160e65[_0xa411('0x68')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65['attrs'][0x3]?_0x160e65[_0xa411('0x5d')][0x3][_0xa411('0x5e')]:undefined)||_0xa411('0x69')},{'name':_0xa411('0x6a'),'value':_0x160e65[_0xa411('0x6a')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x4]?_0x160e65['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x160e65['attrFaxAccounts']||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x5]?_0x160e65[_0xa411('0x5d')][0x5][_0xa411('0x5e')]:undefined)||''},{'name':_0xa411('0x6b'),'value':_0x160e65[_0xa411('0x6b')]||(_0x160e65['attrs']&&_0x160e65['attrs'][0x6]?_0x160e65[_0xa411('0x5d')][0x6][_0xa411('0x5e')]:undefined)||''},{'name':_0xa411('0x6c'),'value':_0x160e65['attrOpenchannelAccounts']||(_0x160e65['attrs']&&_0x160e65['attrs'][0x7]?_0x160e65['attrs'][0x7][_0xa411('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x160e65['attrWhatsappAccounts']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x8]?_0x160e65[_0xa411('0x5d')][0x8][_0xa411('0x5e')]:undefined)||''},{'name':_0xa411('0x6d'),'value':_0x160e65[_0xa411('0x6d')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x9]?_0x160e65[_0xa411('0x5d')][0x9][_0xa411('0x5e')]:undefined)||''}];case _0xa411('0x6e'):case _0xa411('0x6f'):return[{'name':_0xa411('0x70'),'value':_0x160e65[_0xa411('0x70')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0][_0xa411('0x5e')]:undefined)||'total'},{'name':_0xa411('0x71'),'value':_0x160e65[_0xa411('0x71')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x1]?_0x160e65[_0xa411('0x5d')][0x1]['value']:undefined)||null},{'name':_0xa411('0x72'),'value':_0x160e65[_0xa411('0x72')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x2]?_0x160e65['attrs'][0x2]['value']:undefined)||null},{'name':_0xa411('0x73'),'value':_0x160e65[_0xa411('0x73')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x3]?_0x160e65['attrs'][0x3][_0xa411('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x160e65[_0xa411('0x68')]||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x4]?_0x160e65[_0xa411('0x5d')][0x4][_0xa411('0x5e')]:undefined)||'voice'},{'name':_0xa411('0x6a'),'value':_0x160e65[_0xa411('0x6a')]||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x5]?_0x160e65['attrs'][0x5][_0xa411('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x160e65[_0xa411('0x74')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x6]?_0x160e65[_0xa411('0x5d')][0x6][_0xa411('0x5e')]:undefined)||''},{'name':_0xa411('0x6b'),'value':_0x160e65[_0xa411('0x6b')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x7]?_0x160e65[_0xa411('0x5d')][0x7]['value']:undefined)||''},{'name':_0xa411('0x6c'),'value':_0x160e65[_0xa411('0x6c')]||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x8]?_0x160e65[_0xa411('0x5d')][0x8][_0xa411('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x160e65['attrWhatsappAccounts']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x9]?_0x160e65[_0xa411('0x5d')][0x9][_0xa411('0x5e')]:undefined)||''},{'name':_0xa411('0x6d'),'value':_0x160e65[_0xa411('0x6d')]||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0xa]?_0x160e65[_0xa411('0x5d')][0xa][_0xa411('0x5e')]:undefined)||''}];case'web-report':return[{'name':_0xa411('0x75'),'type':_0x160e65['reportType']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0][_0xa411('0x33')]:undefined)||null,'value':_0x160e65['attrReport']||(_0x160e65[_0xa411('0x5d')]&&_0x160e65[_0xa411('0x5d')][0x0]?_0x160e65[_0xa411('0x5d')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x160e65[_0xa411('0x76')]||(_0x160e65['attrs']&&_0x160e65[_0xa411('0x5d')][0x1]?_0x160e65[_0xa411('0x5d')][0x1][_0xa411('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x100e58){logger[_0xa411('0x2c')](_0xa411('0x77'),JSON['stringify'](_0x100e58));return[];}}exports[_0xa411('0x78')]=function(_0x1d46c5,_0x5a02f5,_0x596aea){if(_0x1d46c5[_0xa411('0x4d')]['id']){delete _0x1d46c5[_0xa411('0x4d')]['id'];}return db[_0xa411('0x47')][_0xa411('0x4a')]({'where':{'id':_0x1d46c5[_0xa411('0x55')]['id']}})[_0xa411('0x27')](handleEntityNotFound(_0x5a02f5,null))[_0xa411('0x27')](function(_0x6cc04e){if(_0x6cc04e){_0x1d46c5[_0xa411('0x4d')][_0xa411('0x79')]=_0x6cc04e['id'];_0x1d46c5['body']['attrs']=widgetAttributes(_0x1d46c5['body']);return db[_0xa411('0x7a')][_0xa411('0x4c')](_0x1d46c5[_0xa411('0x4d')]);}})[_0xa411('0x27')](respondWithResult(_0x5a02f5,null))[_0xa411('0x4b')](handleError(_0x5a02f5,null));};exports[_0xa411('0x7b')]=function(_0x193c06,_0x32345d,_0x1e2b4d){var _0x49edcf={};var _0x1fe0df={};var _0x218d66;var _0xaca921;return db['Dashboard'][_0xa411('0x7c')]({'where':{'id':_0x193c06['params']['id']}})[_0xa411('0x27')](handleEntityNotFound(_0x32345d,null))[_0xa411('0x27')](function(_0x52c031){if(_0x52c031){_0x218d66=_0x52c031;_0x1fe0df['model']=_[_0xa411('0x36')](db[_0xa411('0x7a')][_0xa411('0x32')]);_0x1fe0df['query']=_['keys'](_0x193c06[_0xa411('0x35')]);_0x1fe0df[_0xa411('0x40')]=_['intersection'](_0x1fe0df[_0xa411('0x37')],_0x1fe0df[_0xa411('0x35')]);_0x49edcf[_0xa411('0x38')]=_[_0xa411('0x39')](_0x1fe0df[_0xa411('0x37')],qs[_0xa411('0x49')](_0x193c06[_0xa411('0x35')][_0xa411('0x49')]));_0x49edcf[_0xa411('0x38')]=_0x49edcf['attributes'][_0xa411('0x3a')]?_0x49edcf[_0xa411('0x38')]:_0x1fe0df['model'];_0x49edcf[_0xa411('0x3d')]=qs[_0xa411('0x3e')](_0x193c06[_0xa411('0x35')][_0xa411('0x3e')]);_0x49edcf[_0xa411('0x3f')]=qs['filters'](_['pick'](_0x193c06[_0xa411('0x35')],_0x1fe0df['filters']));if(_0x193c06[_0xa411('0x35')]['filter']){_0x49edcf['where']=_[_0xa411('0x43')](_0x49edcf[_0xa411('0x3f')],{'$or':_[_0xa411('0x31')](_0x49edcf[_0xa411('0x38')],function(_0x170e75){var _0x484f91={};_0x484f91[_0x170e75]={'$like':'%'+_0x193c06[_0xa411('0x35')][_0xa411('0x41')]+'%'};return _0x484f91;})});}_0x49edcf=_[_0xa411('0x43')]({},_0x49edcf,_0x193c06['options']);return _0x218d66['getItems'](_0x49edcf);}})[_0xa411('0x27')](function(_0x134dc7){if(_0x134dc7){_0xaca921=_0x134dc7[_0xa411('0x3a')];if(!_0x193c06[_0xa411('0x35')][_0xa411('0x3b')](_0xa411('0x3c'))){_0x49edcf['limit']=qs['limit'](_0x193c06[_0xa411('0x35')][_0xa411('0x1e')]);_0x49edcf['offset']=qs[_0xa411('0x20')](_0x193c06['query'][_0xa411('0x20')]);}return _0x218d66[_0xa411('0x7b')](_0x49edcf);}})[_0xa411('0x27')](function(_0x2d5a89){if(_0x2d5a89){return _0x2d5a89?{'count':_0xaca921,'rows':_0x2d5a89}:null;}})[_0xa411('0x27')](respondWithResult(_0x32345d,null))[_0xa411('0x4b')](handleError(_0x32345d,null));}; \ No newline at end of file +var _0xed54=['reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','map','Dashboard','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','find','omit','createdAt','updatedAt','create','CustomDashboards','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','rawAttributes','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xed54,0xd7));var _0x4ed5=function(_0x5f02b5,_0x8424c0){_0x5f02b5=_0x5f02b5-0x0;var _0xa62457=_0xed54[_0x5f02b5];return _0xa62457;};'use strict';var emlformat=require(_0x4ed5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ed5('0x1'));var jsonpatch=require(_0x4ed5('0x2'));var rp=require(_0x4ed5('0x3'));var moment=require(_0x4ed5('0x4'));var BPromise=require(_0x4ed5('0x5'));var Mustache=require(_0x4ed5('0x6'));var util=require(_0x4ed5('0x7'));var path=require('path');var sox=require(_0x4ed5('0x8'));var csv=require(_0x4ed5('0x9'));var ejs=require(_0x4ed5('0xa'));var fs=require('fs');var fs_extra=require(_0x4ed5('0xb'));var _=require('lodash');var squel=require(_0x4ed5('0xc'));var crypto=require(_0x4ed5('0xd'));var jsforce=require(_0x4ed5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ed5('0x9'));var querystring=require('querystring');var Papa=require(_0x4ed5('0xf'));var Redis=require(_0x4ed5('0x10'));var authService=require(_0x4ed5('0x11'));var qs=require(_0x4ed5('0x12'));var as=require(_0x4ed5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4ed5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4ed5('0x15'));var db=require('../../mysqldb')['db'];config[_0x4ed5('0x16')]=_[_0x4ed5('0x17')](config[_0x4ed5('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ed5('0x18'))(new Redis(config[_0x4ed5('0x16')]));require(_0x4ed5('0x19'))[_0x4ed5('0x1a')](socket);function respondWithStatusCode(_0xe59831,_0x1d59e4){_0x1d59e4=_0x1d59e4||0xcc;return function(_0x35f7f7){if(_0x35f7f7){return _0xe59831[_0x4ed5('0x1b')](_0x1d59e4);}return _0xe59831[_0x4ed5('0x1c')](_0x1d59e4)['end']();};}function respondWithResult(_0x5a7c3c,_0x126651){_0x126651=_0x126651||0xc8;return function(_0x18d289){if(_0x18d289){return _0x5a7c3c[_0x4ed5('0x1c')](_0x126651)[_0x4ed5('0x1d')](_0x18d289);}};}function respondWithFilteredResult(_0x476c17,_0xb85450){return function(_0x39fafd){if(_0x39fafd){var _0x2770ef=typeof _0xb85450[_0x4ed5('0x1e')]===_0x4ed5('0x1f')&&typeof _0xb85450['limit']===_0x4ed5('0x1f');var _0x5bf560=_0x39fafd['count'];var _0x509719=_0x2770ef?0x0:_0xb85450[_0x4ed5('0x1e')];var _0x32fe11=_0x2770ef?_0x39fafd[_0x4ed5('0x20')]:_0xb85450['offset']+_0xb85450[_0x4ed5('0x21')];var _0x4c0c7e;if(_0x32fe11>=_0x5bf560){_0x32fe11=_0x5bf560;_0x4c0c7e=0xc8;}else{_0x4c0c7e=0xce;}_0x476c17[_0x4ed5('0x1c')](_0x4c0c7e);return _0x476c17[_0x4ed5('0x22')](_0x4ed5('0x23'),_0x509719+'-'+_0x32fe11+'/'+_0x5bf560)['json'](_0x39fafd);}return null;};}function patchUpdates(_0x21f7e2){return function(_0x23ba52){try{jsonpatch[_0x4ed5('0x24')](_0x23ba52,_0x21f7e2,!![]);}catch(_0x3209c9){return BPromise[_0x4ed5('0x25')](_0x3209c9);}return _0x23ba52[_0x4ed5('0x26')]();};}function saveUpdates(_0x2b51c1,_0x17472e){return function(_0x3d11ae){if(_0x3d11ae){return _0x3d11ae[_0x4ed5('0x27')](_0x2b51c1)[_0x4ed5('0x28')](function(_0x4689ae){return _0x4689ae;});}return null;};}function removeEntity(_0x483cf1,_0x1b2806){return function(_0x2eb1d1){if(_0x2eb1d1){return _0x2eb1d1[_0x4ed5('0x29')]()[_0x4ed5('0x28')](function(){var _0x1c593b=_0x2eb1d1['get']({'plain':!![]});var _0x6dd5cd='CustomDashboards';return db[_0x4ed5('0x2a')][_0x4ed5('0x29')]({'where':{'type':_0x6dd5cd,'resourceId':_0x1c593b['id']}})[_0x4ed5('0x28')](function(){return _0x2eb1d1;});})[_0x4ed5('0x28')](function(){_0x483cf1[_0x4ed5('0x1c')](0xcc)[_0x4ed5('0x2b')]();});}};}function handleEntityNotFound(_0x2cca9f,_0xb9fc63){return function(_0x154dfc){if(!_0x154dfc){_0x2cca9f['sendStatus'](0x194);}return _0x154dfc;};}function handleError(_0x36235a,_0x28b7d5){_0x28b7d5=_0x28b7d5||0x1f4;return function(_0x2f4b18){logger[_0x4ed5('0x2c')](_0x2f4b18[_0x4ed5('0x2d')]);if(_0x2f4b18[_0x4ed5('0x2e')]){delete _0x2f4b18['name'];}_0x36235a[_0x4ed5('0x1c')](_0x28b7d5)[_0x4ed5('0x2f')](_0x2f4b18);};}exports['index']=function(_0x302cba,_0xcff0ba){var _0x520786={},_0x56c75b={},_0x2101b1={'count':0x0,'rows':[]};var _0x13de49=_[_0x4ed5('0x30')](db[_0x4ed5('0x31')]['rawAttributes'],function(_0x2dfa9f){return{'name':_0x2dfa9f[_0x4ed5('0x32')],'type':_0x2dfa9f[_0x4ed5('0x33')][_0x4ed5('0x34')]};});_0x56c75b[_0x4ed5('0x35')]=_['map'](_0x13de49,_0x4ed5('0x2e'));_0x56c75b[_0x4ed5('0x36')]=_[_0x4ed5('0x37')](_0x302cba[_0x4ed5('0x36')]);_0x56c75b[_0x4ed5('0x38')]=_['intersection'](_0x56c75b[_0x4ed5('0x35')],_0x56c75b[_0x4ed5('0x36')]);_0x520786[_0x4ed5('0x39')]=_[_0x4ed5('0x3a')](_0x56c75b['model'],qs[_0x4ed5('0x3b')](_0x302cba[_0x4ed5('0x36')]['fields']));_0x520786[_0x4ed5('0x39')]=_0x520786[_0x4ed5('0x39')]['length']?_0x520786[_0x4ed5('0x39')]:_0x56c75b[_0x4ed5('0x35')];if(!_0x302cba[_0x4ed5('0x36')][_0x4ed5('0x3c')](_0x4ed5('0x3d'))){_0x520786[_0x4ed5('0x21')]=qs[_0x4ed5('0x21')](_0x302cba[_0x4ed5('0x36')][_0x4ed5('0x21')]);_0x520786[_0x4ed5('0x1e')]=qs[_0x4ed5('0x1e')](_0x302cba[_0x4ed5('0x36')]['offset']);}_0x520786['order']=qs[_0x4ed5('0x3e')](_0x302cba[_0x4ed5('0x36')][_0x4ed5('0x3e')]);_0x520786[_0x4ed5('0x3f')]=qs[_0x4ed5('0x38')](_[_0x4ed5('0x40')](_0x302cba['query'],_0x56c75b['filters']),_0x13de49);if(_0x302cba['query']['filter']){_0x520786['where']=_[_0x4ed5('0x41')](_0x520786[_0x4ed5('0x3f')],{'$or':_[_0x4ed5('0x30')](_0x13de49,function(_0x1e344d){if(_0x1e344d[_0x4ed5('0x33')]!=='VIRTUAL'){var _0xc002a1={};_0xc002a1[_0x1e344d['name']]={'$like':'%'+_0x302cba[_0x4ed5('0x36')]['filter']+'%'};return _0xc002a1;}})});}_0x520786=_[_0x4ed5('0x41')]({},_0x520786,_0x302cba[_0x4ed5('0x42')]);var _0x12df78={'where':_0x520786[_0x4ed5('0x3f')]};return db[_0x4ed5('0x31')]['count'](_0x12df78)[_0x4ed5('0x28')](function(_0x488d8a){_0x2101b1[_0x4ed5('0x20')]=_0x488d8a;if(_0x302cba['query'][_0x4ed5('0x43')]){_0x520786[_0x4ed5('0x44')]=[{'all':!![]}];}return db[_0x4ed5('0x31')][_0x4ed5('0x45')](_0x520786);})[_0x4ed5('0x28')](function(_0x546c38){_0x2101b1[_0x4ed5('0x46')]=_0x546c38;return _0x2101b1;})['then'](respondWithFilteredResult(_0xcff0ba,_0x520786))[_0x4ed5('0x47')](handleError(_0xcff0ba,null));};exports['show']=function(_0xb0382d,_0x15c875){var _0x3603ea={'raw':![],'where':{'id':_0xb0382d[_0x4ed5('0x48')]['id']}},_0x186865={};_0x186865[_0x4ed5('0x35')]=_[_0x4ed5('0x37')](db[_0x4ed5('0x31')]['rawAttributes']);_0x186865[_0x4ed5('0x36')]=_[_0x4ed5('0x37')](_0xb0382d[_0x4ed5('0x36')]);_0x186865['filters']=_[_0x4ed5('0x3a')](_0x186865[_0x4ed5('0x35')],_0x186865[_0x4ed5('0x36')]);_0x3603ea[_0x4ed5('0x39')]=_['intersection'](_0x186865['model'],qs['fields'](_0xb0382d[_0x4ed5('0x36')][_0x4ed5('0x3b')]));_0x3603ea[_0x4ed5('0x39')]=_0x3603ea['attributes']['length']?_0x3603ea[_0x4ed5('0x39')]:_0x186865[_0x4ed5('0x35')];if(_0xb0382d[_0x4ed5('0x36')]['includeAll']){_0x3603ea[_0x4ed5('0x44')]=[{'all':!![]}];}_0x3603ea=_[_0x4ed5('0x41')]({},_0x3603ea,_0xb0382d[_0x4ed5('0x42')]);return db[_0x4ed5('0x31')]['find'](_0x3603ea)[_0x4ed5('0x28')](handleEntityNotFound(_0x15c875,null))[_0x4ed5('0x28')](respondWithResult(_0x15c875,null))[_0x4ed5('0x47')](handleError(_0x15c875,null));};exports['create']=function(_0x34b68f,_0x2af2c){return db[_0x4ed5('0x31')]['create'](_0x34b68f[_0x4ed5('0x49')],{})[_0x4ed5('0x28')](function(_0x3aa8dd){var _0x54023e=_0x34b68f[_0x4ed5('0x4a')]['get']({'plain':!![]});if(!_0x54023e)throw new Error(_0x4ed5('0x4b'));if(_0x54023e[_0x4ed5('0x4c')]===_0x4ed5('0x4a')){var _0x230c22=_0x3aa8dd[_0x4ed5('0x4d')]({'plain':!![]});var _0x36201b='CustomDashboards';return db[_0x4ed5('0x4e')]['find']({'where':{'name':_0x36201b,'userProfileId':_0x54023e['userProfileId']},'raw':!![]})[_0x4ed5('0x28')](function(_0x20824e){if(_0x20824e&&_0x20824e[_0x4ed5('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x230c22[_0x4ed5('0x2e')],'resourceId':_0x230c22['id'],'type':_0x20824e[_0x4ed5('0x2e')],'sectionId':_0x20824e['id']},{})[_0x4ed5('0x28')](function(){return _0x3aa8dd;});}else{return _0x3aa8dd;}})[_0x4ed5('0x47')](function(_0x5a4be1){logger[_0x4ed5('0x2c')](_0x4ed5('0x50'),_0x5a4be1);throw _0x5a4be1;});}return _0x3aa8dd;})[_0x4ed5('0x28')](respondWithResult(_0x2af2c,0xc9))['catch'](handleError(_0x2af2c,null));};exports['clone']=function(_0x460d62,_0x50b294){var _0x6d83f={'where':{'id':_0x460d62[_0x4ed5('0x48')]['id']}},_0x11a539={};_0x11a539[_0x4ed5('0x35')]=_[_0x4ed5('0x37')](db['Dashboard']['rawAttributes']);_0x6d83f[_0x4ed5('0x39')]=_[_0x4ed5('0x3a')](_0x11a539[_0x4ed5('0x35')],qs[_0x4ed5('0x3b')](_0x460d62[_0x4ed5('0x36')][_0x4ed5('0x3b')]));_0x6d83f[_0x4ed5('0x39')]=_0x6d83f['attributes'][_0x4ed5('0x51')]?_0x6d83f[_0x4ed5('0x39')]:_0x11a539[_0x4ed5('0x35')];if(_0x460d62[_0x4ed5('0x36')][_0x4ed5('0x43')]){_0x6d83f[_0x4ed5('0x44')]=[{'all':!![]}];}_0x6d83f=_['merge']({},_0x6d83f,_0x460d62['options']);return db[_0x4ed5('0x31')][_0x4ed5('0x52')](_0x6d83f)[_0x4ed5('0x28')](handleEntityNotFound(_0x50b294,null))[_0x4ed5('0x28')](function(_0x36c299){if(_0x36c299){var _0x262f91=_0x36c299['get']({'plain':!![]});_0x262f91=qs[_0x4ed5('0x53')](_0x262f91,['id',_0x4ed5('0x54'),'updatedAt']);_0x460d62[_0x4ed5('0x49')]=_['omit'](_0x460d62['body'],['id',_0x4ed5('0x54'),_0x4ed5('0x55')]);return db[_0x4ed5('0x31')][_0x4ed5('0x56')](_[_0x4ed5('0x41')](_0x262f91,_0x460d62[_0x4ed5('0x49')]),{'include':_0x460d62[_0x4ed5('0x36')][_0x4ed5('0x43')]?[{'all':!![]}]:undefined})[_0x4ed5('0x28')](function(_0x12ac64){var _0x6b1246=_0x460d62[_0x4ed5('0x4a')][_0x4ed5('0x4d')]({'plain':!![]});if(!_0x6b1246)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b1246['role']===_0x4ed5('0x4a')){var _0x59aeb0=_0x12ac64['get']({'plain':!![]});var _0x404849=_0x4ed5('0x57');return db[_0x4ed5('0x4e')][_0x4ed5('0x52')]({'where':{'name':_0x404849,'userProfileId':_0x6b1246['userProfileId']},'raw':!![]})['then'](function(_0x120886){if(_0x120886&&_0x120886[_0x4ed5('0x4f')]===0x0){return db[_0x4ed5('0x2a')][_0x4ed5('0x56')]({'name':_0x59aeb0[_0x4ed5('0x2e')],'resourceId':_0x59aeb0['id'],'type':_0x120886[_0x4ed5('0x2e')],'sectionId':_0x120886['id']},{})['then'](function(){return _0x12ac64;});}else{return _0x12ac64;}})[_0x4ed5('0x47')](function(_0x37388e){logger[_0x4ed5('0x2c')](_0x4ed5('0x50'),_0x37388e);throw _0x37388e;});}return _0x12ac64;});}})[_0x4ed5('0x28')](respondWithResult(_0x50b294,0xc9))[_0x4ed5('0x47')](handleError(_0x50b294,null));};exports[_0x4ed5('0x27')]=function(_0x578733,_0x1fb8bb){if(_0x578733[_0x4ed5('0x49')]['id']){delete _0x578733[_0x4ed5('0x49')]['id'];}return db[_0x4ed5('0x31')][_0x4ed5('0x52')]({'where':{'id':_0x578733[_0x4ed5('0x48')]['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x1fb8bb,null))['then'](saveUpdates(_0x578733[_0x4ed5('0x49')],null))[_0x4ed5('0x28')](respondWithResult(_0x1fb8bb,null))[_0x4ed5('0x47')](handleError(_0x1fb8bb,null));};exports['destroy']=function(_0x45b9a8,_0x5c6bde){return db[_0x4ed5('0x31')][_0x4ed5('0x52')]({'where':{'id':_0x45b9a8[_0x4ed5('0x48')]['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x5c6bde,null))[_0x4ed5('0x28')](removeEntity(_0x5c6bde,null))[_0x4ed5('0x47')](handleError(_0x5c6bde,null));};function widgetAttributes(_0x67c0a1){try{switch(_0x67c0a1[_0x4ed5('0x33')]){case _0x4ed5('0x58'):return[{'name':_0x4ed5('0x59'),'value':_0x67c0a1['attrUrl']||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1[_0x4ed5('0x5a')][0x0]['value']:undefined)||_0x4ed5('0x5b')}];case _0x4ed5('0x5c'):return[{'name':_0x4ed5('0x5d'),'value':_0x67c0a1[_0x4ed5('0x5d')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1['attrs'][0x0]['value']:undefined)||''}];case _0x4ed5('0x5e'):return[{'name':_0x4ed5('0x5f'),'value':_0x67c0a1[_0x4ed5('0x5f')]||(_0x67c0a1['attrs']&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1[_0x4ed5('0x5a')][0x0][_0x4ed5('0x60')]:undefined)||_0x4ed5('0x61')},{'name':_0x4ed5('0x62'),'value':_0x67c0a1['attrTimezone']||(_0x67c0a1['attrs']&&_0x67c0a1[_0x4ed5('0x5a')][0x1]?_0x67c0a1[_0x4ed5('0x5a')][0x1][_0x4ed5('0x60')]:undefined)||_0x4ed5('0x63')},{'name':'attrFontSize','value':_0x67c0a1[_0x4ed5('0x64')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x2]?_0x67c0a1[_0x4ed5('0x5a')][0x2][_0x4ed5('0x60')]:undefined)||0xc}];case _0x4ed5('0x65'):return[{'name':_0x4ed5('0x66'),'value':_0x67c0a1[_0x4ed5('0x66')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1[_0x4ed5('0x5a')][0x0][_0x4ed5('0x60')]:undefined)||_0x4ed5('0x67')},{'name':_0x4ed5('0x68'),'value':_0x67c0a1[_0x4ed5('0x68')]||(_0x67c0a1['attrs']&&_0x67c0a1[_0x4ed5('0x5a')][0x1]?_0x67c0a1[_0x4ed5('0x5a')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x67c0a1[_0x4ed5('0x64')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x2]?_0x67c0a1[_0x4ed5('0x5a')][0x2][_0x4ed5('0x60')]:undefined)||0x14},{'name':_0x4ed5('0x69'),'value':_0x67c0a1[_0x4ed5('0x69')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1['attrs'][0x3]?_0x67c0a1['attrs'][0x3][_0x4ed5('0x60')]:undefined)||'voice'},{'name':_0x4ed5('0x6a'),'value':_0x67c0a1[_0x4ed5('0x6a')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x4]?_0x67c0a1[_0x4ed5('0x5a')][0x4][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6b'),'value':_0x67c0a1[_0x4ed5('0x6b')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x5]?_0x67c0a1['attrs'][0x5][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6c'),'value':_0x67c0a1[_0x4ed5('0x6c')]||(_0x67c0a1['attrs']&&_0x67c0a1[_0x4ed5('0x5a')][0x6]?_0x67c0a1[_0x4ed5('0x5a')][0x6][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6d'),'value':_0x67c0a1[_0x4ed5('0x6d')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x7]?_0x67c0a1['attrs'][0x7]['value']:undefined)||''},{'name':_0x4ed5('0x6e'),'value':_0x67c0a1[_0x4ed5('0x6e')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1['attrs'][0x8]?_0x67c0a1[_0x4ed5('0x5a')][0x8][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6f'),'value':_0x67c0a1['attrChatWebsites']||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1['attrs'][0x9]?_0x67c0a1['attrs'][0x9][_0x4ed5('0x60')]:undefined)||''}];case _0x4ed5('0x70'):case _0x4ed5('0x71'):return[{'name':_0x4ed5('0x72'),'value':_0x67c0a1[_0x4ed5('0x72')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1['attrs'][0x0][_0x4ed5('0x60')]:undefined)||_0x4ed5('0x67')},{'name':_0x4ed5('0x73'),'value':_0x67c0a1['attrSerie2']||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x1]?_0x67c0a1[_0x4ed5('0x5a')][0x1][_0x4ed5('0x60')]:undefined)||null},{'name':_0x4ed5('0x74'),'value':_0x67c0a1[_0x4ed5('0x74')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x2]?_0x67c0a1[_0x4ed5('0x5a')][0x2][_0x4ed5('0x60')]:undefined)||null},{'name':_0x4ed5('0x68'),'value':_0x67c0a1[_0x4ed5('0x68')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x3]?_0x67c0a1[_0x4ed5('0x5a')][0x3]['value']:undefined)||[]},{'name':_0x4ed5('0x69'),'value':_0x67c0a1[_0x4ed5('0x69')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x4]?_0x67c0a1[_0x4ed5('0x5a')][0x4][_0x4ed5('0x60')]:undefined)||_0x4ed5('0x75')},{'name':'attrEmailAccounts','value':_0x67c0a1[_0x4ed5('0x6a')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x5]?_0x67c0a1[_0x4ed5('0x5a')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x67c0a1['attrFaxAccounts']||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x6]?_0x67c0a1['attrs'][0x6][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6c'),'value':_0x67c0a1[_0x4ed5('0x6c')]||(_0x67c0a1['attrs']&&_0x67c0a1[_0x4ed5('0x5a')][0x7]?_0x67c0a1['attrs'][0x7][_0x4ed5('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x67c0a1[_0x4ed5('0x6d')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x8]?_0x67c0a1[_0x4ed5('0x5a')][0x8][_0x4ed5('0x60')]:undefined)||''},{'name':_0x4ed5('0x6e'),'value':_0x67c0a1[_0x4ed5('0x6e')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x9]?_0x67c0a1[_0x4ed5('0x5a')][0x9][_0x4ed5('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x67c0a1[_0x4ed5('0x6f')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0xa]?_0x67c0a1['attrs'][0xa][_0x4ed5('0x60')]:undefined)||''}];case'web-report':return[{'name':_0x4ed5('0x76'),'type':_0x67c0a1['reportType']||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x0]?_0x67c0a1[_0x4ed5('0x5a')][0x0]['type']:undefined)||null,'value':_0x67c0a1[_0x4ed5('0x76')]||(_0x67c0a1['attrs']&&_0x67c0a1['attrs'][0x0]?_0x67c0a1[_0x4ed5('0x5a')][0x0][_0x4ed5('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x67c0a1[_0x4ed5('0x77')]||(_0x67c0a1[_0x4ed5('0x5a')]&&_0x67c0a1[_0x4ed5('0x5a')][0x1]?_0x67c0a1['attrs'][0x1][_0x4ed5('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x1433b2){logger[_0x4ed5('0x2c')](_0x4ed5('0x78'),JSON['stringify'](_0x1433b2));return[];}}exports[_0x4ed5('0x79')]=function(_0x33c65e,_0x407b62,_0x4979c1){if(_0x33c65e[_0x4ed5('0x49')]['id']){delete _0x33c65e[_0x4ed5('0x49')]['id'];}return db[_0x4ed5('0x31')][_0x4ed5('0x52')]({'where':{'id':_0x33c65e[_0x4ed5('0x48')]['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x407b62,null))[_0x4ed5('0x28')](function(_0x2a7a07){if(_0x2a7a07){_0x33c65e[_0x4ed5('0x49')]['DashboardId']=_0x2a7a07['id'];_0x33c65e[_0x4ed5('0x49')][_0x4ed5('0x5a')]=widgetAttributes(_0x33c65e[_0x4ed5('0x49')]);return db[_0x4ed5('0x7a')][_0x4ed5('0x56')](_0x33c65e[_0x4ed5('0x49')]);}})[_0x4ed5('0x28')](respondWithResult(_0x407b62,null))[_0x4ed5('0x47')](handleError(_0x407b62,null));};exports[_0x4ed5('0x7b')]=function(_0x2ae439,_0x39cae3,_0x9db0a9){var _0x49a455={};var _0x4c10c3={};var _0x175573;var _0x23eef3;return db[_0x4ed5('0x31')]['findOne']({'where':{'id':_0x2ae439[_0x4ed5('0x48')]['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x39cae3,null))[_0x4ed5('0x28')](function(_0x4a04d8){if(_0x4a04d8){_0x175573=_0x4a04d8;_0x4c10c3[_0x4ed5('0x35')]=_['keys'](db['DashboardItem'][_0x4ed5('0x7c')]);_0x4c10c3[_0x4ed5('0x36')]=_[_0x4ed5('0x37')](_0x2ae439['query']);_0x4c10c3[_0x4ed5('0x38')]=_['intersection'](_0x4c10c3[_0x4ed5('0x35')],_0x4c10c3['query']);_0x49a455[_0x4ed5('0x39')]=_[_0x4ed5('0x3a')](_0x4c10c3[_0x4ed5('0x35')],qs[_0x4ed5('0x3b')](_0x2ae439['query'][_0x4ed5('0x3b')]));_0x49a455[_0x4ed5('0x39')]=_0x49a455[_0x4ed5('0x39')][_0x4ed5('0x51')]?_0x49a455[_0x4ed5('0x39')]:_0x4c10c3['model'];_0x49a455['order']=qs[_0x4ed5('0x3e')](_0x2ae439[_0x4ed5('0x36')][_0x4ed5('0x3e')]);_0x49a455[_0x4ed5('0x3f')]=qs[_0x4ed5('0x38')](_[_0x4ed5('0x40')](_0x2ae439[_0x4ed5('0x36')],_0x4c10c3[_0x4ed5('0x38')]));if(_0x2ae439[_0x4ed5('0x36')][_0x4ed5('0x7d')]){_0x49a455['where']=_['merge'](_0x49a455[_0x4ed5('0x3f')],{'$or':_[_0x4ed5('0x30')](_0x49a455[_0x4ed5('0x39')],function(_0x4cd407){var _0x4186f6={};_0x4186f6[_0x4cd407]={'$like':'%'+_0x2ae439[_0x4ed5('0x36')][_0x4ed5('0x7d')]+'%'};return _0x4186f6;})});}_0x49a455=_[_0x4ed5('0x41')]({},_0x49a455,_0x2ae439[_0x4ed5('0x42')]);return _0x175573[_0x4ed5('0x7b')](_0x49a455);}})['then'](function(_0x2ced92){if(_0x2ced92){_0x23eef3=_0x2ced92[_0x4ed5('0x51')];if(!_0x2ae439[_0x4ed5('0x36')][_0x4ed5('0x3c')]('nolimit')){_0x49a455[_0x4ed5('0x21')]=qs['limit'](_0x2ae439[_0x4ed5('0x36')][_0x4ed5('0x21')]);_0x49a455[_0x4ed5('0x1e')]=qs[_0x4ed5('0x1e')](_0x2ae439['query'][_0x4ed5('0x1e')]);}return _0x175573[_0x4ed5('0x7b')](_0x49a455);}})['then'](function(_0x4aca73){if(_0x4aca73){return _0x4aca73?{'count':_0x23eef3,'rows':_0x4aca73}:null;}})[_0x4ed5('0x28')](respondWithResult(_0x39cae3,null))[_0x4ed5('0x47')](handleError(_0x39cae3,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1699570..901b472 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 _0xa2e7=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa2e7,0x95));var _0x7a2e=function(_0x107cae,_0x224bd8){_0x107cae=_0x107cae-0x0;var _0x22ce35=_0xa2e7[_0x107cae];return _0x22ce35;};'use strict';var EventEmitter=require(_0x7a2e('0x0'));var Dashboard=require(_0x7a2e('0x1'))['db'][_0x7a2e('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7a2e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7a2e('0x4')};function emitEvent(_0x461b67){return function(_0x52a351,_0x41c762,_0x459aa2){DashboardEvents[_0x7a2e('0x5')](_0x461b67+':'+_0x52a351['id'],_0x52a351);DashboardEvents[_0x7a2e('0x5')](_0x461b67,_0x52a351);_0x459aa2(null);};}for(var e in events){if(events[_0x7a2e('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x7a2e('0x7')]=DashboardEvents; \ No newline at end of file +var _0x8b17=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','../../mysqldb','Dashboard'];(function(_0x11b8f8,_0x3281f7){var _0x6bcdde=function(_0xa84e5a){while(--_0xa84e5a){_0x11b8f8['push'](_0x11b8f8['shift']());}};_0x6bcdde(++_0x3281f7);}(_0x8b17,0xbe));var _0x78b1=function(_0x5d8623,_0x23828e){_0x5d8623=_0x5d8623-0x0;var _0x350815=_0x8b17[_0x5d8623];return _0x350815;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x78b1('0x0'))['db'][_0x78b1('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x78b1('0x2')](0x0);var events={'afterCreate':_0x78b1('0x3'),'afterUpdate':'update','afterDestroy':_0x78b1('0x4')};function emitEvent(_0x1f5561){return function(_0x5f61f9,_0x1ebf3c,_0x4f12c0){DashboardEvents['emit'](_0x1f5561+':'+_0x5f61f9['id'],_0x5f61f9);DashboardEvents[_0x78b1('0x5')](_0x1f5561,_0x5f61f9);_0x4f12c0(null);};}for(var e in events){if(events[_0x78b1('0x6')](e)){var event=events[e];Dashboard[_0x78b1('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 57001ae..558e954 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 _0x54af=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Dashboard','dashboards','../../config/logger','api'];(function(_0x53e04e,_0x176808){var _0x24728a=function(_0x364339){while(--_0x364339){_0x53e04e['push'](_0x53e04e['shift']());}};_0x24728a(++_0x176808);}(_0x54af,0xb9));var _0xf54a=function(_0x5de63d,_0x481ec4){_0x5de63d=_0x5de63d-0x0;var _0x112bbf=_0x54af[_0x5de63d];return _0x112bbf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf54a('0x0'))(_0xf54a('0x1'));var moment=require(_0xf54a('0x2'));var BPromise=require(_0xf54a('0x3'));var rp=require(_0xf54a('0x4'));var fs=require('fs');var path=require(_0xf54a('0x5'));var rimraf=require(_0xf54a('0x6'));var config=require(_0xf54a('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x16ca4b,_0x452730){return _0x16ca4b[_0xf54a('0x8')](_0xf54a('0x9'),attributes,{'tableName':_0xf54a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6833=['api','moment','bluebird','request-promise','../../config/environment','./dashboard.attributes','define','dashboards','lodash','util'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x6833,0x12a));var _0x3683=function(_0x2abdca,_0x22fd17){_0x2abdca=_0x2abdca-0x0;var _0x9ca6d4=_0x6833[_0x2abdca];return _0x9ca6d4;};'use strict';var _=require(_0x3683('0x0'));var util=require(_0x3683('0x1'));var logger=require('../../config/logger')(_0x3683('0x2'));var moment=require(_0x3683('0x3'));var BPromise=require(_0x3683('0x4'));var rp=require(_0x3683('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3683('0x6'));var attributes=require(_0x3683('0x7'));module['exports']=function(_0x73a71d,_0x526ec8){return _0x73a71d[_0x3683('0x8')]('Dashboard',attributes,{'tableName':_0x3683('0x9'),'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 ad640d4..1bef129 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 _0x1a0c=['info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x581d7c,_0x2d46bd){var _0x33fd9c=function(_0x180e3a){while(--_0x180e3a){_0x581d7c['push'](_0x581d7c['shift']());}};_0x33fd9c(++_0x2d46bd);}(_0x1a0c,0x9a));var _0xc1a0=function(_0xf4ff8e,_0x454801){_0xf4ff8e=_0xf4ff8e-0x0;var _0x5e2e6a=_0x1a0c[_0xf4ff8e];return _0x5e2e6a;};'use strict';var _=require(_0xc1a0('0x0'));var util=require(_0xc1a0('0x1'));var moment=require('moment');var BPromise=require(_0xc1a0('0x2'));var rs=require(_0xc1a0('0x3'));var fs=require('fs');var Redis=require(_0xc1a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1a0('0x5'));var logger=require('../../config/logger')(_0xc1a0('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1a0('0x7'));var client=jayson[_0xc1a0('0x8')]['http']({'port':0x232a});config[_0xc1a0('0x9')]=_[_0xc1a0('0xa')](config[_0xc1a0('0x9')],{'host':_0xc1a0('0xb'),'port':0x18eb});var socket=require(_0xc1a0('0xc'))(new Redis(config[_0xc1a0('0x9')]));require('./dashboard.socket')[_0xc1a0('0xd')](socket);function respondWithRpcPromise(_0x2dc095,_0x2598e5,_0x5b0bb4){return new BPromise(function(_0x2012e0,_0x2bbd62){return client['request'](_0x2dc095,_0x5b0bb4)['then'](function(_0x34967d){logger[_0xc1a0('0xe')]('Dashboard,\x20%s,\x20%s',_0x2598e5,_0xc1a0('0xf'));logger['debug'](_0xc1a0('0x10'),_0x2598e5,_0xc1a0('0xf'),JSON[_0xc1a0('0x11')](_0x34967d));if(_0x34967d[_0xc1a0('0x12')]){if(_0x34967d[_0xc1a0('0x12')][_0xc1a0('0x13')]===0x1f4){logger[_0xc1a0('0x12')]('Dashboard,\x20%s,\x20%s',_0x2598e5,_0x34967d[_0xc1a0('0x12')][_0xc1a0('0x14')]);return _0x2bbd62(_0x34967d[_0xc1a0('0x12')][_0xc1a0('0x14')]);}logger[_0xc1a0('0x12')](_0xc1a0('0x15'),_0x2598e5,_0x34967d[_0xc1a0('0x12')]['message']);return _0x2012e0(_0x34967d[_0xc1a0('0x12')]['message']);}else{logger[_0xc1a0('0xe')](_0xc1a0('0x15'),_0x2598e5,_0xc1a0('0xf'));_0x2012e0(_0x34967d[_0xc1a0('0x16')][_0xc1a0('0x14')]);}})[_0xc1a0('0x17')](function(_0x1fa747){logger[_0xc1a0('0x12')](_0xc1a0('0x15'),_0x2598e5,_0x1fa747);_0x2bbd62(_0x1fa747);});});} \ No newline at end of file +var _0xb3eb=['redis','localhost','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','defaults'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xb3eb,0x87));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb3e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbb3e('0x1'));var rs=require(_0xbb3e('0x2'));var fs=require('fs');var Redis=require(_0xbb3e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbb3e('0x4'))(_0xbb3e('0x5'));var config=require(_0xbb3e('0x6'));var jayson=require(_0xbb3e('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xbb3e('0x8')](config[_0xbb3e('0x9')],{'host':_0xbb3e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb3e('0x9')]));require(_0xbb3e('0xb'))[_0xbb3e('0xc')](socket);function respondWithRpcPromise(_0x4f6488,_0x3c4b68,_0x53b288){return new BPromise(function(_0x3c976e,_0x3205cf){return client[_0xbb3e('0xd')](_0x4f6488,_0x53b288)[_0xbb3e('0xe')](function(_0x6d89a9){logger[_0xbb3e('0xf')]('Dashboard,\x20%s,\x20%s',_0x3c4b68,_0xbb3e('0x10'));logger[_0xbb3e('0x11')](_0xbb3e('0x12'),_0x3c4b68,'request\x20sent',JSON['stringify'](_0x6d89a9));if(_0x6d89a9[_0xbb3e('0x13')]){if(_0x6d89a9[_0xbb3e('0x13')][_0xbb3e('0x14')]===0x1f4){logger[_0xbb3e('0x13')](_0xbb3e('0x15'),_0x3c4b68,_0x6d89a9[_0xbb3e('0x13')][_0xbb3e('0x16')]);return _0x3205cf(_0x6d89a9['error']['message']);}logger[_0xbb3e('0x13')](_0xbb3e('0x15'),_0x3c4b68,_0x6d89a9['error'][_0xbb3e('0x16')]);return _0x3c976e(_0x6d89a9['error'][_0xbb3e('0x16')]);}else{logger[_0xbb3e('0xf')](_0xbb3e('0x15'),_0x3c4b68,_0xbb3e('0x10'));_0x3c976e(_0x6d89a9['result'][_0xbb3e('0x16')]);}})[_0xbb3e('0x17')](function(_0x4388d7){logger[_0xbb3e('0x13')](_0xbb3e('0x15'),_0x3c4b68,_0x4388d7);_0x3205cf(_0x4388d7);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index d0f38f7..82f1a9c 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 _0x7a6c=['emit','removeListener','register','length','dashboard:','./dashboard.events','update'];(function(_0x15033e,_0x247d9b){var _0x5bd24b=function(_0x30a086){while(--_0x30a086){_0x15033e['push'](_0x15033e['shift']());}};_0x5bd24b(++_0x247d9b);}(_0x7a6c,0xc9));var _0xc7a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a6c[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0xc7a6('0x0'));var events=['save','remove',_0xc7a6('0x1')];function createListener(_0x5a358b,_0x303d1b){return function(_0x2c80f4){_0x303d1b[_0xc7a6('0x2')](_0x5a358b,_0x2c80f4);};}function removeListener(_0x2db365,_0xb40667){return function(){DashboardEvents[_0xc7a6('0x3')](_0x2db365,_0xb40667);};}exports[_0xc7a6('0x4')]=function(_0x31c8a1){for(var _0x15dd51=0x0,_0x23500d=events[_0xc7a6('0x5')];_0x15dd51<_0x23500d;_0x15dd51++){var _0x1f9236=events[_0x15dd51];var _0x7c6273=createListener(_0xc7a6('0x6')+_0x1f9236,_0x31c8a1);DashboardEvents['on'](_0x1f9236,_0x7c6273);}}; \ No newline at end of file +var _0x208a=['save','remove','update','removeListener','register','length','dashboard:'];(function(_0x2399f9,_0x48c157){var _0x7c9480=function(_0x152ae2){while(--_0x152ae2){_0x2399f9['push'](_0x2399f9['shift']());}};_0x7c9480(++_0x48c157);}(_0x208a,0x149));var _0xa208=function(_0x4cee81,_0x27a466){_0x4cee81=_0x4cee81-0x0;var _0x2956b8=_0x208a[_0x4cee81];return _0x2956b8;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa208('0x0'),_0xa208('0x1'),_0xa208('0x2')];function createListener(_0x2f2c3e,_0x3a80c3){return function(_0x351364){_0x3a80c3['emit'](_0x2f2c3e,_0x351364);};}function removeListener(_0x26df3f,_0x50d150){return function(){DashboardEvents[_0xa208('0x3')](_0x26df3f,_0x50d150);};}exports[_0xa208('0x4')]=function(_0x6d2142){for(var _0x4b9e18=0x0,_0xb52c38=events[_0xa208('0x5')];_0x4b9e18<_0xb52c38;_0x4b9e18++){var _0x26312e=events[_0x4b9e18];var _0x5b965a=createListener(_0xa208('0x6')+_0x26312e,_0x6d2142);DashboardEvents['on'](_0x26312e,_0x5b965a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index a2b11f2..2cb2c34 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 _0xbb27=['/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index'];(function(_0x27505f,_0x13f04c){var _0x4fc3a8=function(_0x455d05){while(--_0x455d05){_0x27505f['push'](_0x27505f['shift']());}};_0x4fc3a8(++_0x13f04c);}(_0xbb27,0x136));var _0x7bb2=function(_0x18d29b,_0x3034d2){_0x18d29b=_0x18d29b-0x0;var _0x3c354f=_0xbb27[_0x18d29b];return _0x3c354f;};'use strict';var multer=require('multer');var util=require(_0x7bb2('0x0'));var path=require(_0x7bb2('0x1'));var timeout=require(_0x7bb2('0x2'));var express=require(_0x7bb2('0x3'));var router=express[_0x7bb2('0x4')]();var fs_extra=require(_0x7bb2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7bb2('0x6'));var config=require(_0x7bb2('0x7'));var controller=require(_0x7bb2('0x8'));router[_0x7bb2('0x9')]('/',auth[_0x7bb2('0xa')](),controller[_0x7bb2('0xb')]);router[_0x7bb2('0x9')](_0x7bb2('0xc'),auth[_0x7bb2('0xa')](),controller[_0x7bb2('0xd')]);router['get'](_0x7bb2('0xe'),auth[_0x7bb2('0xa')](),controller[_0x7bb2('0xf')]);router[_0x7bb2('0x10')]('/',auth['isAuthenticated'](),controller[_0x7bb2('0x11')]);router['post'](_0x7bb2('0x12'),auth[_0x7bb2('0xa')](),controller[_0x7bb2('0x13')]);router[_0x7bb2('0x10')](_0x7bb2('0xe'),auth[_0x7bb2('0xa')](),controller['addItem']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7bb2('0x14')](_0x7bb2('0xc'),auth[_0x7bb2('0xa')](),controller[_0x7bb2('0x15')]);module[_0x7bb2('0x16')]=router; \ No newline at end of file +var _0x7e56=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','delete','destroy'];(function(_0x395d4b,_0x3b6bc2){var _0x168978=function(_0x5ba3ab){while(--_0x5ba3ab){_0x395d4b['push'](_0x395d4b['shift']());}};_0x168978(++_0x3b6bc2);}(_0x7e56,0x1cd));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x67e5('0x0'));var util=require('util');var path=require(_0x67e5('0x1'));var timeout=require(_0x67e5('0x2'));var express=require(_0x67e5('0x3'));var router=express['Router']();var fs_extra=require(_0x67e5('0x4'));var auth=require(_0x67e5('0x5'));var interaction=require(_0x67e5('0x6'));var config=require(_0x67e5('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x67e5('0x8')](),controller['index']);router['get'](_0x67e5('0x9'),auth['isAuthenticated'](),controller[_0x67e5('0xa')]);router[_0x67e5('0xb')]('/:id/items',auth[_0x67e5('0x8')](),controller[_0x67e5('0xc')]);router[_0x67e5('0xd')]('/',auth[_0x67e5('0x8')](),controller[_0x67e5('0xe')]);router[_0x67e5('0xd')](_0x67e5('0xf'),auth[_0x67e5('0x8')](),controller[_0x67e5('0x10')]);router[_0x67e5('0xd')](_0x67e5('0x11'),auth[_0x67e5('0x8')](),controller[_0x67e5('0x12')]);router[_0x67e5('0x13')](_0x67e5('0x9'),auth[_0x67e5('0x8')](),controller['update']);router[_0x67e5('0x14')](_0x67e5('0x9'),auth[_0x67e5('0x8')](),controller[_0x67e5('0x15')]);module[_0x67e5('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2126fa7..0f43722 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 _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x1bac80,_0x535b9e){var _0x4e95ff=function(_0x4e5b18){while(--_0x4e5b18){_0x1bac80['push'](_0x1bac80['shift']());}};_0x4e95ff(++_0x535b9e);}(_0xafc4,0x69));var _0x4afc=function(_0x4d75aa,_0x4d4373){_0x4d75aa=_0x4d75aa-0x0;var _0x5b6ee2=_0xafc4[_0x4d75aa];return _0x5b6ee2;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0xda19=['TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','STRING'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xda19,0xd5));var _0x9da1=function(_0x39e280,_0x5bc190){_0x39e280=_0x39e280-0x0;var _0x78b7f2=_0xda19[_0x39e280];return _0x78b7f2;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));module['exports']={'title':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9da1('0x3')]('long'),'get':function(){try{return JSON[_0x9da1('0x4')](this[_0x9da1('0x5')](_0x9da1('0x6')));}catch(_0x470043){return[];}},'set':function(_0x156faf){try{this[_0x9da1('0x7')](_0x9da1('0x6'),JSON[_0x9da1('0x8')](_0x156faf));}catch(_0x1c24e6){this[_0x9da1('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9da1('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9da1('0x9')]},'background':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9da1('0x2')]},'titleFontSize':{'type':Sequelize[_0x9da1('0x9')],'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 cb4fd6a..92c5a31 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 _0x687b=['clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','total','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','merge','find','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath'];(function(_0x551fdb,_0x4f24a9){var _0x54e6a2=function(_0x328979){while(--_0x328979){_0x551fdb['push'](_0x551fdb['shift']());}};_0x54e6a2(++_0x4f24a9);}(_0x687b,0x14a));var _0xb687=function(_0x1c101f,_0x52141d){_0x1c101f=_0x1c101f-0x0;var _0xe02ee4=_0x687b[_0x1c101f];return _0xe02ee4;};'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'];config[_0xb687('0x1c')]=_['defaults'](config['redis'],{'host':_0xb687('0x1d'),'port':0x18eb});var socket=require(_0xb687('0x1e'))(new Redis(config['redis']));require(_0xb687('0x1f'))[_0xb687('0x20')](socket);function respondWithStatusCode(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xcc;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x21')](_0x30d502);}return _0x1f1f35[_0xb687('0x22')](_0x30d502)[_0xb687('0x23')]();};}function respondWithResult(_0x263085,_0x2c7a18){_0x2c7a18=_0x2c7a18||0xc8;return function(_0x25124a){if(_0x25124a){return _0x263085[_0xb687('0x22')](_0x2c7a18)['json'](_0x25124a);}};}function respondWithFilteredResult(_0x214b06,_0x328301){return function(_0x30d370){if(_0x30d370){var _0x5eb9b9=typeof _0x328301['offset']===_0xb687('0x24')&&typeof _0x328301[_0xb687('0x25')]===_0xb687('0x24');var _0x4b593b=_0x30d370[_0xb687('0x26')];var _0x481f1d=_0x5eb9b9?0x0:_0x328301[_0xb687('0x27')];var _0x243236=_0x5eb9b9?_0x30d370[_0xb687('0x26')]:_0x328301[_0xb687('0x27')]+_0x328301['limit'];var _0x3a73d5;if(_0x243236>=_0x4b593b){_0x243236=_0x4b593b;_0x3a73d5=0xc8;}else{_0x3a73d5=0xce;}_0x214b06['status'](_0x3a73d5);return _0x214b06[_0xb687('0x28')](_0xb687('0x29'),_0x481f1d+'-'+_0x243236+'/'+_0x4b593b)[_0xb687('0x2a')](_0x30d370);}return null;};}function patchUpdates(_0x546fde){return function(_0x1dc06b){try{jsonpatch[_0xb687('0x2b')](_0x1dc06b,_0x546fde,!![]);}catch(_0xa95e91){return BPromise[_0xb687('0x2c')](_0xa95e91);}return _0x1dc06b[_0xb687('0x2d')]();};}function saveUpdates(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['update'](_0x38866c)[_0xb687('0x2e')](function(_0x129347){return _0x129347;});}return null;};}function removeEntity(_0x1c1585,_0x1a0261){return function(_0x290cf7){if(_0x290cf7){return _0x290cf7[_0xb687('0x2f')]()[_0xb687('0x2e')](function(){_0x1c1585[_0xb687('0x22')](0xcc)[_0xb687('0x23')]();});}};}function handleEntityNotFound(_0x2e6185,_0x4a61ec){return function(_0x3712cf){if(!_0x3712cf){_0x2e6185[_0xb687('0x21')](0x194);}return _0x3712cf;};}function handleError(_0x392721,_0x265a4b){_0x265a4b=_0x265a4b||0x1f4;return function(_0x2e5c8d){logger[_0xb687('0x30')](_0x2e5c8d['stack']);if(_0x2e5c8d[_0xb687('0x31')]){delete _0x2e5c8d['name'];}_0x392721[_0xb687('0x22')](_0x265a4b)[_0xb687('0x32')](_0x2e5c8d);};}exports[_0xb687('0x33')]=function(_0x245db1,_0x1ad3ef){var _0x43d20d={'raw':![],'where':{'id':_0x245db1['params']['id']}},_0xf1f0dd={};_0xf1f0dd[_0xb687('0x34')]=_[_0xb687('0x35')](db[_0xb687('0x36')][_0xb687('0x37')]);_0xf1f0dd[_0xb687('0x38')]=_[_0xb687('0x35')](_0x245db1[_0xb687('0x38')]);_0xf1f0dd[_0xb687('0x39')]=_[_0xb687('0x3a')](_0xf1f0dd[_0xb687('0x34')],_0xf1f0dd[_0xb687('0x38')]);_0x43d20d['attributes']=_['intersection'](_0xf1f0dd[_0xb687('0x34')],qs[_0xb687('0x3b')](_0x245db1[_0xb687('0x38')][_0xb687('0x3b')]));_0x43d20d['attributes']=_0x43d20d['attributes'][_0xb687('0x3c')]?_0x43d20d[_0xb687('0x3d')]:_0xf1f0dd['model'];if(_0x245db1[_0xb687('0x38')][_0xb687('0x3e')]){_0x43d20d['include']=[{'all':!![]}];}_0x43d20d=_[_0xb687('0x3f')]({},_0x43d20d,_0x245db1['options']);return db[_0xb687('0x36')][_0xb687('0x40')](_0x43d20d)[_0xb687('0x2e')](handleEntityNotFound(_0x1ad3ef,null))[_0xb687('0x2e')](respondWithResult(_0x1ad3ef,null))[_0xb687('0x41')](handleError(_0x1ad3ef,null));};exports[_0xb687('0x2f')]=function(_0x5f59d0,_0x529b1a){return db[_0xb687('0x36')][_0xb687('0x40')]({'where':{'id':_0x5f59d0[_0xb687('0x42')]['id']}})['then'](handleEntityNotFound(_0x529b1a,null))[_0xb687('0x2e')](removeEntity(_0x529b1a,null))[_0xb687('0x41')](handleError(_0x529b1a,null));};function widgetAttributes(_0x1f1c88){try{switch(_0x1f1c88[_0xb687('0x43')]){case _0xb687('0x44'):return[{'name':'attrUrl','value':_0x1f1c88[_0xb687('0x45')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x0]?_0x1f1c88[_0xb687('0x46')][0x0][_0xb687('0x47')]:undefined)||_0xb687('0x48')}];case'custom':return[{'name':'attrPath','value':_0x1f1c88[_0xb687('0x49')]||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x0]?_0x1f1c88[_0xb687('0x46')][0x0]['value']:undefined)||''}];case _0xb687('0x4a'):return[{'name':_0xb687('0x4b'),'value':_0x1f1c88['attrHourFormat']||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x0]?_0x1f1c88[_0xb687('0x46')][0x0]['value']:undefined)||_0xb687('0x4c')},{'name':_0xb687('0x4d'),'value':_0x1f1c88[_0xb687('0x4d')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x1]?_0x1f1c88[_0xb687('0x46')][0x1][_0xb687('0x47')]:undefined)||'0.00'},{'name':_0xb687('0x4e'),'value':_0x1f1c88['attrFontSize']||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x2]?_0x1f1c88[_0xb687('0x46')][0x2]['value']:undefined)||0xc}];case _0xb687('0x4f'):return[{'name':'attrMetric','value':_0x1f1c88[_0xb687('0x50')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88['attrs'][0x0]?_0x1f1c88[_0xb687('0x46')][0x0][_0xb687('0x47')]:undefined)||'total'},{'name':_0xb687('0x51'),'value':_0x1f1c88[_0xb687('0x51')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x1]?_0x1f1c88[_0xb687('0x46')][0x1][_0xb687('0x47')]:undefined)||[]},{'name':_0xb687('0x4e'),'value':_0x1f1c88[_0xb687('0x4e')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x2]?_0x1f1c88[_0xb687('0x46')][0x2][_0xb687('0x47')]:undefined)||0x14},{'name':'attrChannel','value':_0x1f1c88[_0xb687('0x52')]||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x3]?_0x1f1c88[_0xb687('0x46')][0x3][_0xb687('0x47')]:undefined)||_0xb687('0x53')},{'name':_0xb687('0x54'),'value':_0x1f1c88[_0xb687('0x54')]||(_0x1f1c88['attrs']&&_0x1f1c88['attrs'][0x4]?_0x1f1c88[_0xb687('0x46')][0x4][_0xb687('0x47')]:undefined)||''},{'name':_0xb687('0x55'),'value':_0x1f1c88[_0xb687('0x55')]||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x5]?_0x1f1c88[_0xb687('0x46')][0x5][_0xb687('0x47')]:undefined)||''},{'name':_0xb687('0x56'),'value':_0x1f1c88['attrSmsAccounts']||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x6]?_0x1f1c88[_0xb687('0x46')][0x6][_0xb687('0x47')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1f1c88['attrOpenchannelAccounts']||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x7]?_0x1f1c88[_0xb687('0x46')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1f1c88[_0xb687('0x57')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x8]?_0x1f1c88[_0xb687('0x46')][0x8][_0xb687('0x47')]:undefined)||''},{'name':_0xb687('0x58'),'value':_0x1f1c88[_0xb687('0x58')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88['attrs'][0x9]?_0x1f1c88[_0xb687('0x46')][0x9][_0xb687('0x47')]:undefined)||''}];case _0xb687('0x59'):case'pie-chart':return[{'name':'attrSerie1','value':_0x1f1c88['attrSerie1']||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x0]?_0x1f1c88[_0xb687('0x46')][0x0][_0xb687('0x47')]:undefined)||_0xb687('0x5a')},{'name':_0xb687('0x5b'),'value':_0x1f1c88[_0xb687('0x5b')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x1]?_0x1f1c88[_0xb687('0x46')][0x1][_0xb687('0x47')]:undefined)||null},{'name':_0xb687('0x5c'),'value':_0x1f1c88[_0xb687('0x5c')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x2]?_0x1f1c88[_0xb687('0x46')][0x2][_0xb687('0x47')]:undefined)||null},{'name':_0xb687('0x51'),'value':_0x1f1c88['attrVoiceQueues']||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x3]?_0x1f1c88[_0xb687('0x46')][0x3][_0xb687('0x47')]:undefined)||[]},{'name':_0xb687('0x52'),'value':_0x1f1c88['attrChannel']||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x4]?_0x1f1c88['attrs'][0x4][_0xb687('0x47')]:undefined)||'voice'},{'name':_0xb687('0x54'),'value':_0x1f1c88[_0xb687('0x54')]||(_0x1f1c88['attrs']&&_0x1f1c88['attrs'][0x5]?_0x1f1c88[_0xb687('0x46')][0x5][_0xb687('0x47')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1f1c88[_0xb687('0x55')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x6]?_0x1f1c88['attrs'][0x6][_0xb687('0x47')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1f1c88[_0xb687('0x56')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x7]?_0x1f1c88[_0xb687('0x46')][0x7][_0xb687('0x47')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1f1c88['attrOpenchannelAccounts']||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88['attrs'][0x8]?_0x1f1c88['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1f1c88[_0xb687('0x57')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x9]?_0x1f1c88[_0xb687('0x46')][0x9][_0xb687('0x47')]:undefined)||''},{'name':_0xb687('0x58'),'value':_0x1f1c88[_0xb687('0x58')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0xa]?_0x1f1c88[_0xb687('0x46')][0xa][_0xb687('0x47')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x1f1c88[_0xb687('0x5d')]||(_0x1f1c88['attrs']&&_0x1f1c88[_0xb687('0x46')][0x0]?_0x1f1c88[_0xb687('0x46')][0x0][_0xb687('0x43')]:undefined)||null,'value':_0x1f1c88[_0xb687('0x5e')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88['attrs'][0x0]?_0x1f1c88[_0xb687('0x46')][0x0]['value']:undefined)||null},{'name':_0xb687('0x5f'),'value':_0x1f1c88[_0xb687('0x5f')]||(_0x1f1c88[_0xb687('0x46')]&&_0x1f1c88[_0xb687('0x46')][0x1]?_0x1f1c88[_0xb687('0x46')][0x1][_0xb687('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x2c0737){logger['error'](_0xb687('0x60'),JSON[_0xb687('0x61')](_0x2c0737));return[];}}exports[_0xb687('0x62')]=function(_0x36bb4b,_0x258caf){if(_0x36bb4b['body']){_0x36bb4b[_0xb687('0x63')][_0xb687('0x46')]=widgetAttributes(_0x36bb4b[_0xb687('0x63')]);}return db[_0xb687('0x36')][_0xb687('0x62')](_0x36bb4b[_0xb687('0x63')],{})[_0xb687('0x2e')](respondWithResult(_0x258caf,0xc9))[_0xb687('0x41')](handleError(_0x258caf,null));};exports[_0xb687('0x64')]=function(_0x249d39,_0x1c167c){if(_0x249d39['body']['id']){delete _0x249d39[_0xb687('0x63')]['id'];}_0x249d39[_0xb687('0x63')][_0xb687('0x46')]=widgetAttributes(_0x249d39[_0xb687('0x63')]);return db['DashboardItem'][_0xb687('0x40')]({'where':{'id':_0x249d39[_0xb687('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c167c,null))[_0xb687('0x2e')](saveUpdates(_0x249d39[_0xb687('0x63')],null))[_0xb687('0x2e')](respondWithResult(_0x1c167c,null))['catch'](handleError(_0x1c167c,null));}; \ No newline at end of file +var _0xaafc=['crypto','jsforce','to-csv','papaparse','../../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','./dashboardItem.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','params','model','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','find','destroy','catch','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrFaxAccounts','web-report','attrReport','type','attrRefresh','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel'];(function(_0x4a310d,_0x33322d){var _0x5eaf36=function(_0x233014){while(--_0x233014){_0x4a310d['push'](_0x4a310d['shift']());}};_0x5eaf36(++_0x33322d);}(_0xaafc,0x176));var _0xcaaf=function(_0x430cf9,_0x1701a7){_0x430cf9=_0x430cf9-0x0;var _0x181808=_0xaafc[_0x430cf9];return _0x181808;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaaf('0x0'));var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require(_0xcaaf('0x2'));var rp=require(_0xcaaf('0x3'));var moment=require('moment');var BPromise=require(_0xcaaf('0x4'));var Mustache=require(_0xcaaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcaaf('0x6'));var csv=require('to-csv');var ejs=require(_0xcaaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaaf('0x8'));var squel=require(_0xcaaf('0x9'));var crypto=require(_0xcaaf('0xa'));var jsforce=require(_0xcaaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcaaf('0xc'));var querystring=require('querystring');var Papa=require(_0xcaaf('0xd'));var Redis=require('ioredis');var authService=require(_0xcaaf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaaf('0xf'));var hardwareService=require(_0xcaaf('0x10'));var logger=require(_0xcaaf('0x11'))(_0xcaaf('0x12'));var utils=require(_0xcaaf('0x13'));var config=require(_0xcaaf('0x14'));var licenseUtil=require(_0xcaaf('0x15'));var db=require(_0xcaaf('0x16'))['db'];config[_0xcaaf('0x17')]=_['defaults'](config[_0xcaaf('0x17')],{'host':_0xcaaf('0x18'),'port':0x18eb});var socket=require(_0xcaaf('0x19'))(new Redis(config[_0xcaaf('0x17')]));require(_0xcaaf('0x1a'))[_0xcaaf('0x1b')](socket);function respondWithStatusCode(_0x6afc3,_0x439c40){_0x439c40=_0x439c40||0xcc;return function(_0x42861d){if(_0x42861d){return _0x6afc3[_0xcaaf('0x1c')](_0x439c40);}return _0x6afc3[_0xcaaf('0x1d')](_0x439c40)['end']();};}function respondWithResult(_0x301344,_0xb8532b){_0xb8532b=_0xb8532b||0xc8;return function(_0x7f23fb){if(_0x7f23fb){return _0x301344[_0xcaaf('0x1d')](_0xb8532b)[_0xcaaf('0x1e')](_0x7f23fb);}};}function respondWithFilteredResult(_0x360078,_0x4b55e3){return function(_0xf8e303){if(_0xf8e303){var _0x10ad54=typeof _0x4b55e3['offset']===_0xcaaf('0x1f')&&typeof _0x4b55e3[_0xcaaf('0x20')]===_0xcaaf('0x1f');var _0x43631b=_0xf8e303[_0xcaaf('0x21')];var _0x535eb8=_0x10ad54?0x0:_0x4b55e3[_0xcaaf('0x22')];var _0x731e33=_0x10ad54?_0xf8e303[_0xcaaf('0x21')]:_0x4b55e3[_0xcaaf('0x22')]+_0x4b55e3[_0xcaaf('0x20')];var _0x5bdc7a;if(_0x731e33>=_0x43631b){_0x731e33=_0x43631b;_0x5bdc7a=0xc8;}else{_0x5bdc7a=0xce;}_0x360078[_0xcaaf('0x1d')](_0x5bdc7a);return _0x360078[_0xcaaf('0x23')](_0xcaaf('0x24'),_0x535eb8+'-'+_0x731e33+'/'+_0x43631b)[_0xcaaf('0x1e')](_0xf8e303);}return null;};}function patchUpdates(_0x359339){return function(_0x16f83d){try{jsonpatch[_0xcaaf('0x25')](_0x16f83d,_0x359339,!![]);}catch(_0x5e0463){return BPromise[_0xcaaf('0x26')](_0x5e0463);}return _0x16f83d[_0xcaaf('0x27')]();};}function saveUpdates(_0x3f62c8,_0x4c1dcd){return function(_0x34f878){if(_0x34f878){return _0x34f878[_0xcaaf('0x28')](_0x3f62c8)[_0xcaaf('0x29')](function(_0x3dac7d){return _0x3dac7d;});}return null;};}function removeEntity(_0x2a6d15,_0x4346e2){return function(_0x1cc1fb){if(_0x1cc1fb){return _0x1cc1fb['destroy']()[_0xcaaf('0x29')](function(){_0x2a6d15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x548b1d,_0x30d68a){return function(_0x85b4a){if(!_0x85b4a){_0x548b1d[_0xcaaf('0x1c')](0x194);}return _0x85b4a;};}function handleError(_0x84f284,_0xc98ce4){_0xc98ce4=_0xc98ce4||0x1f4;return function(_0x35e500){logger[_0xcaaf('0x2a')](_0x35e500[_0xcaaf('0x2b')]);if(_0x35e500[_0xcaaf('0x2c')]){delete _0x35e500['name'];}_0x84f284['status'](_0xc98ce4)[_0xcaaf('0x2d')](_0x35e500);};}exports['show']=function(_0x4429e3,_0x58c170){var _0x343cd5={'raw':![],'where':{'id':_0x4429e3[_0xcaaf('0x2e')]['id']}},_0x10fec3={};_0x10fec3[_0xcaaf('0x2f')]=_['keys'](db[_0xcaaf('0x30')][_0xcaaf('0x31')]);_0x10fec3[_0xcaaf('0x32')]=_['keys'](_0x4429e3['query']);_0x10fec3[_0xcaaf('0x33')]=_[_0xcaaf('0x34')](_0x10fec3['model'],_0x10fec3[_0xcaaf('0x32')]);_0x343cd5[_0xcaaf('0x35')]=_[_0xcaaf('0x34')](_0x10fec3[_0xcaaf('0x2f')],qs[_0xcaaf('0x36')](_0x4429e3[_0xcaaf('0x32')][_0xcaaf('0x36')]));_0x343cd5[_0xcaaf('0x35')]=_0x343cd5[_0xcaaf('0x35')]['length']?_0x343cd5['attributes']:_0x10fec3[_0xcaaf('0x2f')];if(_0x4429e3['query'][_0xcaaf('0x37')]){_0x343cd5[_0xcaaf('0x38')]=[{'all':!![]}];}_0x343cd5=_[_0xcaaf('0x39')]({},_0x343cd5,_0x4429e3['options']);return db['DashboardItem'][_0xcaaf('0x3a')](_0x343cd5)[_0xcaaf('0x29')](handleEntityNotFound(_0x58c170,null))['then'](respondWithResult(_0x58c170,null))['catch'](handleError(_0x58c170,null));};exports[_0xcaaf('0x3b')]=function(_0x12a4fc,_0x3573b3){return db['DashboardItem'][_0xcaaf('0x3a')]({'where':{'id':_0x12a4fc['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3573b3,null))['then'](removeEntity(_0x3573b3,null))[_0xcaaf('0x3c')](handleError(_0x3573b3,null));};function widgetAttributes(_0x44abfd){try{switch(_0x44abfd['type']){case'iframe':return[{'name':_0xcaaf('0x3d'),'value':_0x44abfd[_0xcaaf('0x3d')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x3f')}];case'custom':return[{'name':_0xcaaf('0x40'),'value':_0x44abfd[_0xcaaf('0x40')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||''}];case _0xcaaf('0x42'):return[{'name':_0xcaaf('0x43'),'value':_0x44abfd[_0xcaaf('0x43')]||(_0x44abfd['attrs']&&_0x44abfd['attrs'][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x44')},{'name':'attrTimezone','value':_0x44abfd[_0xcaaf('0x45')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd[_0xcaaf('0x3e')][0x1]['value']:undefined)||_0xcaaf('0x46')},{'name':_0xcaaf('0x47'),'value':_0x44abfd['attrFontSize']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd[_0xcaaf('0x3e')][0x2][_0xcaaf('0x41')]:undefined)||0xc}];case _0xcaaf('0x48'):return[{'name':_0xcaaf('0x49'),'value':_0x44abfd[_0xcaaf('0x49')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4a')},{'name':_0xcaaf('0x4b'),'value':_0x44abfd[_0xcaaf('0x4b')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x44abfd['attrFontSize']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd[_0xcaaf('0x3e')][0x2][_0xcaaf('0x41')]:undefined)||0x14},{'name':'attrChannel','value':_0x44abfd['attrChannel']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x3]?_0x44abfd[_0xcaaf('0x3e')][0x3][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4c')},{'name':_0xcaaf('0x4d'),'value':_0x44abfd[_0xcaaf('0x4d')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x4]?_0x44abfd[_0xcaaf('0x3e')][0x4][_0xcaaf('0x41')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x44abfd['attrFaxAccounts']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x5]?_0x44abfd[_0xcaaf('0x3e')][0x5]['value']:undefined)||''},{'name':_0xcaaf('0x4e'),'value':_0x44abfd['attrSmsAccounts']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x6]?_0x44abfd[_0xcaaf('0x3e')][0x6][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x4f'),'value':_0x44abfd[_0xcaaf('0x4f')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x7]?_0x44abfd['attrs'][0x7][_0xcaaf('0x41')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x44abfd[_0xcaaf('0x50')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x8]?_0x44abfd[_0xcaaf('0x3e')][0x8]['value']:undefined)||''},{'name':_0xcaaf('0x51'),'value':_0x44abfd['attrChatWebsites']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x9]?_0x44abfd[_0xcaaf('0x3e')][0x9][_0xcaaf('0x41')]:undefined)||''}];case _0xcaaf('0x52'):case _0xcaaf('0x53'):return[{'name':_0xcaaf('0x54'),'value':_0x44abfd[_0xcaaf('0x54')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x4a')},{'name':'attrSerie2','value':_0x44abfd[_0xcaaf('0x55')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x1]?_0x44abfd[_0xcaaf('0x3e')][0x1][_0xcaaf('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x44abfd[_0xcaaf('0x56')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd['attrs'][0x2][_0xcaaf('0x41')]:undefined)||null},{'name':_0xcaaf('0x4b'),'value':_0x44abfd[_0xcaaf('0x4b')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x3]?_0x44abfd[_0xcaaf('0x3e')][0x3][_0xcaaf('0x41')]:undefined)||[]},{'name':_0xcaaf('0x57'),'value':_0x44abfd[_0xcaaf('0x57')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x4]?_0x44abfd['attrs'][0x4][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4c')},{'name':_0xcaaf('0x4d'),'value':_0x44abfd[_0xcaaf('0x4d')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x5]?_0x44abfd[_0xcaaf('0x3e')][0x5][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x58'),'value':_0x44abfd[_0xcaaf('0x58')]||(_0x44abfd['attrs']&&_0x44abfd['attrs'][0x6]?_0x44abfd[_0xcaaf('0x3e')][0x6][_0xcaaf('0x41')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x44abfd[_0xcaaf('0x4e')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x7]?_0x44abfd[_0xcaaf('0x3e')][0x7][_0xcaaf('0x41')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x44abfd[_0xcaaf('0x4f')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x8]?_0x44abfd['attrs'][0x8][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x50'),'value':_0x44abfd[_0xcaaf('0x50')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x9]?_0x44abfd[_0xcaaf('0x3e')][0x9][_0xcaaf('0x41')]:undefined)||''},{'name':'attrChatWebsites','value':_0x44abfd['attrChatWebsites']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0xa]?_0x44abfd[_0xcaaf('0x3e')][0xa]['value']:undefined)||''}];case _0xcaaf('0x59'):return[{'name':_0xcaaf('0x5a'),'type':_0x44abfd['reportType']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x5b')]:undefined)||null,'value':_0x44abfd[_0xcaaf('0x5a')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||null},{'name':_0xcaaf('0x5c'),'value':_0x44abfd[_0xcaaf('0x5c')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd['attrs'][0x1][_0xcaaf('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x50ddfc){logger[_0xcaaf('0x2a')]('widgetAttributes:\x20%s',JSON[_0xcaaf('0x5d')](_0x50ddfc));return[];}}exports[_0xcaaf('0x5e')]=function(_0x21b3bc,_0x28c1b8){if(_0x21b3bc[_0xcaaf('0x5f')]){_0x21b3bc[_0xcaaf('0x5f')]['attrs']=widgetAttributes(_0x21b3bc[_0xcaaf('0x5f')]);}return db[_0xcaaf('0x30')][_0xcaaf('0x5e')](_0x21b3bc[_0xcaaf('0x5f')],{})[_0xcaaf('0x29')](respondWithResult(_0x28c1b8,0xc9))[_0xcaaf('0x3c')](handleError(_0x28c1b8,null));};exports[_0xcaaf('0x28')]=function(_0xc56e47,_0x3ff275){if(_0xc56e47[_0xcaaf('0x5f')]['id']){delete _0xc56e47['body']['id'];}_0xc56e47[_0xcaaf('0x5f')]['attrs']=widgetAttributes(_0xc56e47[_0xcaaf('0x5f')]);return db[_0xcaaf('0x30')][_0xcaaf('0x3a')]({'where':{'id':_0xc56e47[_0xcaaf('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3ff275,null))[_0xcaaf('0x29')](saveUpdates(_0xc56e47[_0xcaaf('0x5f')],null))[_0xcaaf('0x29')](respondWithResult(_0x3ff275,null))[_0xcaaf('0x3c')](handleError(_0x3ff275,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9648b82..51b7886 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 _0x62f1=['remove','emit','hasOwnProperty','hook','events','DashboardItem','setMaxListeners','save','update'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x62f1,0x112));var _0x162f=function(_0x565059,_0x5acaac){_0x565059=_0x565059-0x0;var _0x45856d=_0x62f1[_0x565059];return _0x45856d;};'use strict';var EventEmitter=require(_0x162f('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x162f('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x162f('0x2')](0x0);var events={'afterCreate':_0x162f('0x3'),'afterUpdate':_0x162f('0x4'),'afterDestroy':_0x162f('0x5')};function emitEvent(_0x364694){return function(_0x36ed0f,_0x223f35,_0xfc0863){DashboardItemEvents[_0x162f('0x6')](_0x364694+':'+_0x36ed0f['id'],_0x36ed0f);DashboardItemEvents['emit'](_0x364694,_0x36ed0f);_0xfc0863(null);};}for(var e in events){if(events[_0x162f('0x7')](e)){var event=events[e];DashboardItem[_0x162f('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xf037=['events','../../mysqldb','DashboardItem','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x6ac456,_0x1ef692){var _0x41db4c=function(_0x35e597){while(--_0x35e597){_0x6ac456['push'](_0x6ac456['shift']());}};_0x41db4c(++_0x1ef692);}(_0xf037,0x129));var _0x7f03=function(_0x3108d9,_0xf08d6){_0x3108d9=_0x3108d9-0x0;var _0x1455e6=_0xf037[_0x3108d9];return _0x1455e6;};'use strict';var EventEmitter=require(_0x7f03('0x0'));var DashboardItem=require(_0x7f03('0x1'))['db'][_0x7f03('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7f03('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f03('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23b4e9){return function(_0x3bde45,_0x5e2c5c,_0xec0b8e){DashboardItemEvents['emit'](_0x23b4e9+':'+_0x3bde45['id'],_0x3bde45);DashboardItemEvents[_0x7f03('0x5')](_0x23b4e9,_0x3bde45);_0xec0b8e(null);};}for(var e in events){if(events[_0x7f03('0x6')](e)){var event=events[e];DashboardItem[_0x7f03('0x7')](e,emitEvent(event));}}module[_0x7f03('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index c1c3841..0d5d455 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 _0x531e=['define','DashboardItem','dashboard_items','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x12c10a,_0x24db3c){var _0xe1de68=function(_0x58ee9a){while(--_0x58ee9a){_0x12c10a['push'](_0x12c10a['shift']());}};_0xe1de68(++_0x24db3c);}(_0x531e,0x93));var _0xe531=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x531e[_0x3ab353];return _0x1e2285;};'use strict';var _=require('lodash');var util=require(_0xe531('0x0'));var logger=require('../../config/logger')(_0xe531('0x1'));var moment=require(_0xe531('0x2'));var BPromise=require(_0xe531('0x3'));var rp=require(_0xe531('0x4'));var fs=require('fs');var path=require(_0xe531('0x5'));var rimraf=require(_0xe531('0x6'));var config=require(_0xe531('0x7'));var attributes=require(_0xe531('0x8'));module['exports']=function(_0x10ade0,_0x4056ec){return _0x10ade0[_0xe531('0x9')](_0xe531('0xa'),attributes,{'tableName':_0xe531('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1fc=['./dashboardItem.attributes','define','dashboard_items','lodash','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x53bd82,_0x3d2c92){var _0x5b546c=function(_0x45e777){while(--_0x45e777){_0x53bd82['push'](_0x53bd82['shift']());}};_0x5b546c(++_0x3d2c92);}(_0xb1fc,0x78));var _0xcb1f=function(_0x3de72d,_0x2fe647){_0x3de72d=_0x3de72d-0x0;var _0x29d3ec=_0xb1fc[_0x3de72d];return _0x29d3ec;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcb1f('0x1'));var BPromise=require(_0xcb1f('0x2'));var rp=require(_0xcb1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb1f('0x4'));var config=require(_0xcb1f('0x5'));var attributes=require(_0xcb1f('0x6'));module['exports']=function(_0x58f32c,_0x2d450b){return _0x58f32c[_0xcb1f('0x7')]('DashboardItem',attributes,{'tableName':_0xcb1f('0x8'),'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 810fa85..1952fc9 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 _0x8fdc=['jayson/promise','client','defaults','redis','localhost','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8fdc,0x19a));var _0xc8fd=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8fdc[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require(_0xc8fd('0x0'));var moment=require(_0xc8fd('0x1'));var BPromise=require(_0xc8fd('0x2'));var rs=require(_0xc8fd('0x3'));var fs=require('fs');var Redis=require(_0xc8fd('0x4'));var db=require(_0xc8fd('0x5'))['db'];var utils=require(_0xc8fd('0x6'));var logger=require(_0xc8fd('0x7'))(_0xc8fd('0x8'));var config=require(_0xc8fd('0x9'));var jayson=require(_0xc8fd('0xa'));var client=jayson[_0xc8fd('0xb')]['http']({'port':0x232a});config['redis']=_[_0xc8fd('0xc')](config[_0xc8fd('0xd')],{'host':_0xc8fd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc8fd('0xf'))['register'](socket);function respondWithRpcPromise(_0x4ee4fe,_0x18012a,_0x455dec){return new BPromise(function(_0x166c73,_0x31ed24){return client[_0xc8fd('0x10')](_0x4ee4fe,_0x455dec)[_0xc8fd('0x11')](function(_0x148a48){logger['info'](_0xc8fd('0x12'),_0x18012a,_0xc8fd('0x13'));logger[_0xc8fd('0x14')](_0xc8fd('0x15'),_0x18012a,'request\x20sent',JSON[_0xc8fd('0x16')](_0x148a48));if(_0x148a48['error']){if(_0x148a48[_0xc8fd('0x17')]['code']===0x1f4){logger[_0xc8fd('0x17')](_0xc8fd('0x12'),_0x18012a,_0x148a48['error']['message']);return _0x31ed24(_0x148a48[_0xc8fd('0x17')][_0xc8fd('0x18')]);}logger[_0xc8fd('0x17')](_0xc8fd('0x12'),_0x18012a,_0x148a48[_0xc8fd('0x17')]['message']);return _0x166c73(_0x148a48[_0xc8fd('0x17')][_0xc8fd('0x18')]);}else{logger[_0xc8fd('0x19')]('DashboardItem,\x20%s,\x20%s',_0x18012a,'request\x20sent');_0x166c73(_0x148a48[_0xc8fd('0x1a')][_0xc8fd('0x18')]);}})[_0xc8fd('0x1b')](function(_0xec1ebe){logger[_0xc8fd('0x17')](_0xc8fd('0x12'),_0x18012a,_0xec1ebe);_0x31ed24(_0xec1ebe);});});} \ No newline at end of file +var _0x5e72=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0x5e72,0x167));var _0x25e7=function(_0x2cf4b3,_0x3d8c66){_0x2cf4b3=_0x2cf4b3-0x0;var _0x4b72a8=_0x5e72[_0x2cf4b3];return _0x4b72a8;};'use strict';var _=require(_0x25e7('0x0'));var util=require(_0x25e7('0x1'));var moment=require('moment');var BPromise=require(_0x25e7('0x2'));var rs=require(_0x25e7('0x3'));var fs=require('fs');var Redis=require(_0x25e7('0x4'));var db=require(_0x25e7('0x5'))['db'];var utils=require(_0x25e7('0x6'));var logger=require(_0x25e7('0x7'))(_0x25e7('0x8'));var config=require(_0x25e7('0x9'));var jayson=require(_0x25e7('0xa'));var client=jayson[_0x25e7('0xb')][_0x25e7('0xc')]({'port':0x232a});config['redis']=_[_0x25e7('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25e7('0xe')]));require(_0x25e7('0xf'))[_0x25e7('0x10')](socket);function respondWithRpcPromise(_0x50ab28,_0x67768d,_0x9a0bea){return new BPromise(function(_0x3a459a,_0x19a587){return client['request'](_0x50ab28,_0x9a0bea)[_0x25e7('0x11')](function(_0x3d073c){logger[_0x25e7('0x12')]('DashboardItem,\x20%s,\x20%s',_0x67768d,_0x25e7('0x13'));logger[_0x25e7('0x14')](_0x25e7('0x15'),_0x67768d,_0x25e7('0x13'),JSON[_0x25e7('0x16')](_0x3d073c));if(_0x3d073c['error']){if(_0x3d073c[_0x25e7('0x17')][_0x25e7('0x18')]===0x1f4){logger[_0x25e7('0x17')](_0x25e7('0x19'),_0x67768d,_0x3d073c[_0x25e7('0x17')][_0x25e7('0x1a')]);return _0x19a587(_0x3d073c[_0x25e7('0x17')][_0x25e7('0x1a')]);}logger[_0x25e7('0x17')](_0x25e7('0x19'),_0x67768d,_0x3d073c['error'][_0x25e7('0x1a')]);return _0x3a459a(_0x3d073c[_0x25e7('0x17')]['message']);}else{logger[_0x25e7('0x12')](_0x25e7('0x19'),_0x67768d,_0x25e7('0x13'));_0x3a459a(_0x3d073c[_0x25e7('0x1b')][_0x25e7('0x1a')]);}})['catch'](function(_0x10e9a7){logger['error'](_0x25e7('0x19'),_0x67768d,_0x10e9a7);_0x19a587(_0x10e9a7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index dfcdd01..4c38ba6 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 _0x55ce=['emit','register','length','remove'];(function(_0x35af53,_0x5966b1){var _0x6bbbce=function(_0x3a79c0){while(--_0x3a79c0){_0x35af53['push'](_0x35af53['shift']());}};_0x6bbbce(++_0x5966b1);}(_0x55ce,0x14f));var _0xe55c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x55ce[_0xa464c9];return _0x3d73c4;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xe55c('0x0'),'update'];function createListener(_0x5bf01b,_0x14f8cd){return function(_0xb95179){_0x14f8cd[_0xe55c('0x1')](_0x5bf01b,_0xb95179);};}function removeListener(_0x33bb53,_0x4b938d){return function(){DashboardItemEvents['removeListener'](_0x33bb53,_0x4b938d);};}exports[_0xe55c('0x2')]=function(_0x50d7a4){for(var _0x51b5e2=0x0,_0xf7e6ce=events[_0xe55c('0x3')];_0x51b5e2<_0xf7e6ce;_0x51b5e2++){var _0x43325a=events[_0x51b5e2];var _0xf6085=createListener('dashboardItem:'+_0x43325a,_0x50d7a4);DashboardItemEvents['on'](_0x43325a,_0xf6085);}}; \ No newline at end of file +var _0x42f2=['dashboardItem:','./dashboardItem.events','save','remove','update','removeListener','register','length'];(function(_0xa21498,_0x2dd7b1){var _0x22428a=function(_0x4b94cc){while(--_0x4b94cc){_0xa21498['push'](_0xa21498['shift']());}};_0x22428a(++_0x2dd7b1);}(_0x42f2,0x81));var _0x242f=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x42f2[_0x46a3ff];return _0x404bc2;};'use strict';var DashboardItemEvents=require(_0x242f('0x0'));var events=[_0x242f('0x1'),_0x242f('0x2'),_0x242f('0x3')];function createListener(_0x97e80e,_0x542dce){return function(_0xdc68c5){_0x542dce['emit'](_0x97e80e,_0xdc68c5);};}function removeListener(_0x2d84ef,_0x3b395b){return function(){DashboardItemEvents[_0x242f('0x4')](_0x2d84ef,_0x3b395b);};}exports[_0x242f('0x5')]=function(_0x51bfde){for(var _0x455aed=0x0,_0x6c1789=events[_0x242f('0x6')];_0x455aed<_0x6c1789;_0x455aed++){var _0x105d0b=events[_0x455aed];var _0x1c4ee7=createListener(_0x242f('0x7')+_0x105d0b,_0x51bfde);DashboardItemEvents['on'](_0x105d0b,_0x1c4ee7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 9a553da..6dcb8db 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 _0xb006=['show','post','create','update','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated'];(function(_0x358eeb,_0x32e5d3){var _0x32e71d=function(_0x479615){while(--_0x479615){_0x358eeb['push'](_0x358eeb['shift']());}};_0x32e71d(++_0x32e5d3);}(_0xb006,0x122));var _0x6b00=function(_0x40c62b,_0x2c2efe){_0x40c62b=_0x40c62b-0x0;var _0x568cf0=_0xb006[_0x40c62b];return _0x568cf0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6b00('0x0'));var timeout=require(_0x6b00('0x1'));var express=require('express');var router=express[_0x6b00('0x2')]();var fs_extra=require(_0x6b00('0x3'));var auth=require(_0x6b00('0x4'));var interaction=require(_0x6b00('0x5'));var config=require('../../config/environment');var controller=require(_0x6b00('0x6'));router[_0x6b00('0x7')](_0x6b00('0x8'),auth[_0x6b00('0x9')](),controller[_0x6b00('0xa')]);router[_0x6b00('0xb')]('/',auth[_0x6b00('0x9')](),controller[_0x6b00('0xc')]);router['put'](_0x6b00('0x8'),auth[_0x6b00('0x9')](),controller[_0x6b00('0xd')]);router[_0x6b00('0xe')]('/:id',auth[_0x6b00('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5bf4=['create','put','update','delete','/:id','multer','path','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post'];(function(_0x1ae095,_0x1be75){var _0x30eb2b=function(_0x41b94a){while(--_0x41b94a){_0x1ae095['push'](_0x1ae095['shift']());}};_0x30eb2b(++_0x1be75);}(_0x5bf4,0x140));var _0x45bf=function(_0x2f7ac6,_0x3d4ec5){_0x2f7ac6=_0x2f7ac6-0x0;var _0x512c0d=_0x5bf4[_0x2f7ac6];return _0x512c0d;};'use strict';var multer=require(_0x45bf('0x0'));var util=require('util');var path=require(_0x45bf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x45bf('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x45bf('0x3'));var config=require(_0x45bf('0x4'));var controller=require(_0x45bf('0x5'));router[_0x45bf('0x6')]('/:id',auth[_0x45bf('0x7')](),controller[_0x45bf('0x8')]);router[_0x45bf('0x9')]('/',auth[_0x45bf('0x7')](),controller[_0x45bf('0xa')]);router[_0x45bf('0xb')]('/:id',auth[_0x45bf('0x7')](),controller[_0x45bf('0xc')]);router[_0x45bf('0xd')](_0x45bf('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5a2a8dc..e547cc1 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 _0xcc76=['sequelize','exports','STRING','ENUM','first','second'];(function(_0xf4fd01,_0x40de62){var _0x321f94=function(_0x546f27){while(--_0x546f27){_0xf4fd01['push'](_0xf4fd01['shift']());}};_0x321f94(++_0x40de62);}(_0xcc76,0x108));var _0x6cc7=function(_0x444dfa,_0x6ed07c){_0x444dfa=_0x444dfa-0x0;var _0x3fcfc7=_0xcc76[_0x444dfa];return _0x3fcfc7;};'use strict';var Sequelize=require(_0x6cc7('0x0'));module[_0x6cc7('0x1')]={'name':{'type':Sequelize[_0x6cc7('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x6cc7('0x3')](_0x6cc7('0x4'),_0x6cc7('0x5'),'third'),'allowNull':![],'defaultValue':_0x6cc7('0x4')},'description':{'type':Sequelize[_0x6cc7('0x2')]}}; \ No newline at end of file +var _0x752b=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x59dd8f,_0x28fc38){var _0x29fac0=function(_0x55bd81){while(--_0x55bd81){_0x59dd8f['push'](_0x59dd8f['shift']());}};_0x29fac0(++_0x28fc38);}(_0x752b,0xe1));var _0xb752=function(_0x4dc6c5,_0x401b39){_0x4dc6c5=_0x4dc6c5-0x0;var _0x54695d=_0x752b[_0x4dc6c5];return _0x54695d;};'use strict';var Sequelize=require(_0xb752('0x0'));module[_0xb752('0x1')]={'name':{'type':Sequelize[_0xb752('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xb752('0x3')](_0xb752('0x4'),_0xb752('0x5'),_0xb752('0x6')),'allowNull':![],'defaultValue':_0xb752('0x4')},'description':{'type':Sequelize[_0xb752('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 338b7ca..03eb18c 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 _0x3b61=['options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','save','update','then','get','Dispositions','UserProfileResource','destroy','stack','name','send','index','map','Disposition','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL'];(function(_0x29184b,_0xb55b72){var _0x2fefd9=function(_0x598549){while(--_0x598549){_0x29184b['push'](_0x29184b['shift']());}};_0x2fefd9(++_0xb55b72);}(_0x3b61,0x67));var _0x13b6=function(_0x22cdb9,_0x869d6b){_0x22cdb9=_0x22cdb9-0x0;var _0x2ff544=_0x3b61[_0x22cdb9];return _0x2ff544;};'use strict';var emlformat=require(_0x13b6('0x0'));var rimraf=require(_0x13b6('0x1'));var zipdir=require(_0x13b6('0x2'));var jsonpatch=require(_0x13b6('0x3'));var rp=require(_0x13b6('0x4'));var moment=require(_0x13b6('0x5'));var BPromise=require(_0x13b6('0x6'));var Mustache=require(_0x13b6('0x7'));var util=require('util');var path=require(_0x13b6('0x8'));var sox=require(_0x13b6('0x9'));var csv=require(_0x13b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13b6('0xb'));var _=require(_0x13b6('0xc'));var squel=require(_0x13b6('0xd'));var crypto=require(_0x13b6('0xe'));var jsforce=require(_0x13b6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x13b6('0xa'));var querystring=require(_0x13b6('0x10'));var Papa=require(_0x13b6('0x11'));var Redis=require(_0x13b6('0x12'));var authService=require(_0x13b6('0x13'));var qs=require(_0x13b6('0x14'));var as=require(_0x13b6('0x15'));var hardwareService=require(_0x13b6('0x16'));var logger=require(_0x13b6('0x17'))(_0x13b6('0x18'));var utils=require(_0x13b6('0x19'));var config=require(_0x13b6('0x1a'));var licenseUtil=require(_0x13b6('0x1b'));var db=require(_0x13b6('0x1c'))['db'];function respondWithStatusCode(_0xa9c2d5,_0x51bfc9){_0x51bfc9=_0x51bfc9||0xcc;return function(_0x56e051){if(_0x56e051){return _0xa9c2d5[_0x13b6('0x1d')](_0x51bfc9);}return _0xa9c2d5[_0x13b6('0x1e')](_0x51bfc9)[_0x13b6('0x1f')]();};}function respondWithResult(_0x8425d4,_0xb6b2c3){_0xb6b2c3=_0xb6b2c3||0xc8;return function(_0x1770a5){if(_0x1770a5){return _0x8425d4[_0x13b6('0x1e')](_0xb6b2c3)[_0x13b6('0x20')](_0x1770a5);}};}function respondWithFilteredResult(_0x58326e,_0x556a01){return function(_0x3e7acb){if(_0x3e7acb){var _0x194d58=typeof _0x556a01[_0x13b6('0x21')]===_0x13b6('0x22')&&typeof _0x556a01['limit']===_0x13b6('0x22');var _0x24dbfb=_0x3e7acb['count'];var _0x3ac9b2=_0x194d58?0x0:_0x556a01[_0x13b6('0x21')];var _0x41bfc8=_0x194d58?_0x3e7acb['count']:_0x556a01[_0x13b6('0x21')]+_0x556a01['limit'];var _0xac6905;if(_0x41bfc8>=_0x24dbfb){_0x41bfc8=_0x24dbfb;_0xac6905=0xc8;}else{_0xac6905=0xce;}_0x58326e['status'](_0xac6905);return _0x58326e[_0x13b6('0x23')](_0x13b6('0x24'),_0x3ac9b2+'-'+_0x41bfc8+'/'+_0x24dbfb)['json'](_0x3e7acb);}return null;};}function patchUpdates(_0x3d077d){return function(_0x393cc3){try{jsonpatch[_0x13b6('0x25')](_0x393cc3,_0x3d077d,!![]);}catch(_0x4090d5){return BPromise['reject'](_0x4090d5);}return _0x393cc3[_0x13b6('0x26')]();};}function saveUpdates(_0xc91e2e,_0x1239c7){return function(_0xb38191){if(_0xb38191){return _0xb38191[_0x13b6('0x27')](_0xc91e2e)[_0x13b6('0x28')](function(_0x450caf){return _0x450caf;});}return null;};}function removeEntity(_0xc5e484,_0x3090d7){return function(_0x16471b){if(_0x16471b){return _0x16471b['destroy']()[_0x13b6('0x28')](function(){var _0x54aa3b=_0x16471b[_0x13b6('0x29')]({'plain':!![]});var _0x2ca6ec=_0x13b6('0x2a');return db[_0x13b6('0x2b')][_0x13b6('0x2c')]({'where':{'type':_0x2ca6ec,'resourceId':_0x54aa3b['id']}})[_0x13b6('0x28')](function(){return _0x16471b;});})[_0x13b6('0x28')](function(){_0xc5e484[_0x13b6('0x1e')](0xcc)[_0x13b6('0x1f')]();});}};}function handleEntityNotFound(_0x47a27a,_0x11d669){return function(_0x258f12){if(!_0x258f12){_0x47a27a[_0x13b6('0x1d')](0x194);}return _0x258f12;};}function handleError(_0x26f59b,_0x171acd){_0x171acd=_0x171acd||0x1f4;return function(_0x3a5b75){logger['error'](_0x3a5b75[_0x13b6('0x2d')]);if(_0x3a5b75[_0x13b6('0x2e')]){delete _0x3a5b75[_0x13b6('0x2e')];}_0x26f59b['status'](_0x171acd)[_0x13b6('0x2f')](_0x3a5b75);};}exports[_0x13b6('0x30')]=function(_0x23c6b7,_0xd40925){var _0x35d95a={},_0x5703c3={},_0x2fe151={'count':0x0,'rows':[]};var _0x39d9d0=_[_0x13b6('0x31')](db[_0x13b6('0x32')]['rawAttributes'],function(_0x3a5d8c){return{'name':_0x3a5d8c['fieldName'],'type':_0x3a5d8c['type']['key']};});_0x5703c3[_0x13b6('0x33')]=_[_0x13b6('0x31')](_0x39d9d0,_0x13b6('0x2e'));_0x5703c3[_0x13b6('0x34')]=_[_0x13b6('0x35')](_0x23c6b7['query']);_0x5703c3['filters']=_[_0x13b6('0x36')](_0x5703c3[_0x13b6('0x33')],_0x5703c3[_0x13b6('0x34')]);_0x35d95a['attributes']=_[_0x13b6('0x36')](_0x5703c3[_0x13b6('0x33')],qs['fields'](_0x23c6b7['query'][_0x13b6('0x37')]));_0x35d95a[_0x13b6('0x38')]=_0x35d95a['attributes']['length']?_0x35d95a[_0x13b6('0x38')]:_0x5703c3['model'];if(!_0x23c6b7['query'][_0x13b6('0x39')](_0x13b6('0x3a'))){_0x35d95a[_0x13b6('0x3b')]=qs[_0x13b6('0x3b')](_0x23c6b7[_0x13b6('0x34')]['limit']);_0x35d95a[_0x13b6('0x21')]=qs[_0x13b6('0x21')](_0x23c6b7['query']['offset']);}_0x35d95a[_0x13b6('0x3c')]=qs[_0x13b6('0x3d')](_0x23c6b7[_0x13b6('0x34')][_0x13b6('0x3d')]);_0x35d95a[_0x13b6('0x3e')]=qs[_0x13b6('0x3f')](_[_0x13b6('0x40')](_0x23c6b7[_0x13b6('0x34')],_0x5703c3[_0x13b6('0x3f')]),_0x39d9d0);if(_0x23c6b7['query'][_0x13b6('0x41')]){_0x35d95a['where']=_[_0x13b6('0x42')](_0x35d95a[_0x13b6('0x3e')],{'$or':_['map'](_0x39d9d0,function(_0x1324fb){if(_0x1324fb[_0x13b6('0x43')]!==_0x13b6('0x44')){var _0x34eac6={};_0x34eac6[_0x1324fb['name']]={'$like':'%'+_0x23c6b7['query'][_0x13b6('0x41')]+'%'};return _0x34eac6;}})});}_0x35d95a=_[_0x13b6('0x42')]({},_0x35d95a,_0x23c6b7[_0x13b6('0x45')]);var _0xff0419={'where':_0x35d95a[_0x13b6('0x3e')]};return db[_0x13b6('0x32')][_0x13b6('0x46')](_0xff0419)['then'](function(_0x4cfb40){_0x2fe151['count']=_0x4cfb40;if(_0x23c6b7['query'][_0x13b6('0x47')]){_0x35d95a[_0x13b6('0x48')]=[{'all':!![]}];}return db['Disposition'][_0x13b6('0x49')](_0x35d95a);})[_0x13b6('0x28')](function(_0x18c36b){_0x2fe151[_0x13b6('0x4a')]=_0x18c36b;return _0x2fe151;})[_0x13b6('0x28')](respondWithFilteredResult(_0xd40925,_0x35d95a))[_0x13b6('0x4b')](handleError(_0xd40925,null));};exports['show']=function(_0x18c3b1,_0x3675c8){var _0x1051d2={'raw':!![],'where':{'id':_0x18c3b1[_0x13b6('0x4c')]['id']}},_0x23c341={};_0x23c341[_0x13b6('0x33')]=_[_0x13b6('0x35')](db[_0x13b6('0x32')][_0x13b6('0x4d')]);_0x23c341[_0x13b6('0x34')]=_[_0x13b6('0x35')](_0x18c3b1[_0x13b6('0x34')]);_0x23c341[_0x13b6('0x3f')]=_[_0x13b6('0x36')](_0x23c341[_0x13b6('0x33')],_0x23c341[_0x13b6('0x34')]);_0x1051d2[_0x13b6('0x38')]=_['intersection'](_0x23c341[_0x13b6('0x33')],qs['fields'](_0x18c3b1[_0x13b6('0x34')]['fields']));_0x1051d2['attributes']=_0x1051d2['attributes']['length']?_0x1051d2['attributes']:_0x23c341[_0x13b6('0x33')];if(_0x18c3b1[_0x13b6('0x34')][_0x13b6('0x47')]){_0x1051d2['include']=[{'all':!![]}];}_0x1051d2=_[_0x13b6('0x42')]({},_0x1051d2,_0x18c3b1[_0x13b6('0x45')]);return db['Disposition'][_0x13b6('0x4e')](_0x1051d2)[_0x13b6('0x28')](handleEntityNotFound(_0x3675c8,null))[_0x13b6('0x28')](respondWithResult(_0x3675c8,null))[_0x13b6('0x4b')](handleError(_0x3675c8,null));};exports['create']=function(_0x277def,_0x576d97){return db[_0x13b6('0x32')]['create'](_0x277def['body'],{})[_0x13b6('0x28')](function(_0x1954e1){var _0x29ea9d=_0x277def['user'][_0x13b6('0x29')]({'plain':!![]});if(!_0x29ea9d)throw new Error(_0x13b6('0x4f'));if(_0x29ea9d[_0x13b6('0x50')]===_0x13b6('0x51')){var _0x467b10=_0x1954e1[_0x13b6('0x29')]({'plain':!![]});var _0x3ef113=_0x13b6('0x2a');return db[_0x13b6('0x52')][_0x13b6('0x4e')]({'where':{'name':_0x3ef113,'userProfileId':_0x29ea9d[_0x13b6('0x53')]},'raw':!![]})[_0x13b6('0x28')](function(_0x2125fb){if(_0x2125fb&&_0x2125fb[_0x13b6('0x54')]===0x0){return db[_0x13b6('0x2b')]['create']({'name':_0x467b10[_0x13b6('0x2e')],'resourceId':_0x467b10['id'],'type':_0x2125fb[_0x13b6('0x2e')],'sectionId':_0x2125fb['id']},{})[_0x13b6('0x28')](function(){return _0x1954e1;});}else{return _0x1954e1;}})[_0x13b6('0x4b')](function(_0x33ec2c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33ec2c);throw _0x33ec2c;});}return _0x1954e1;})['then'](respondWithResult(_0x576d97,0xc9))[_0x13b6('0x4b')](handleError(_0x576d97,null));};exports[_0x13b6('0x27')]=function(_0x5b7a3d,_0x107cdd){if(_0x5b7a3d[_0x13b6('0x55')]['id']){delete _0x5b7a3d['body']['id'];}return db[_0x13b6('0x32')][_0x13b6('0x4e')]({'where':{'id':_0x5b7a3d[_0x13b6('0x4c')]['id']}})[_0x13b6('0x28')](handleEntityNotFound(_0x107cdd,null))[_0x13b6('0x28')](saveUpdates(_0x5b7a3d[_0x13b6('0x55')],null))[_0x13b6('0x28')](respondWithResult(_0x107cdd,null))[_0x13b6('0x4b')](handleError(_0x107cdd,null));};exports[_0x13b6('0x2c')]=function(_0x6af2b4,_0xb45d83){return db[_0x13b6('0x32')][_0x13b6('0x4e')]({'where':{'id':_0x6af2b4['params']['id']}})[_0x13b6('0x28')](handleEntityNotFound(_0xb45d83,null))[_0x13b6('0x28')](removeEntity(_0xb45d83,null))[_0x13b6('0x4b')](handleError(_0xb45d83,null));}; \ No newline at end of file +var _0x1d54=['user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','get','Dispositions','destroy','error','name','send','index','Disposition','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','include','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x1d54,0x100));var _0x41d5=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x1d54[_0x1df7b8];return _0x29d911;};'use strict';var emlformat=require(_0x41d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41d5('0x1'));var jsonpatch=require(_0x41d5('0x2'));var rp=require(_0x41d5('0x3'));var moment=require(_0x41d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x41d5('0x5'));var util=require(_0x41d5('0x6'));var path=require('path');var sox=require(_0x41d5('0x7'));var csv=require(_0x41d5('0x8'));var ejs=require(_0x41d5('0x9'));var fs=require('fs');var fs_extra=require(_0x41d5('0xa'));var _=require('lodash');var squel=require(_0x41d5('0xb'));var crypto=require(_0x41d5('0xc'));var jsforce=require(_0x41d5('0xd'));var deskjs=require(_0x41d5('0xe'));var toCsv=require(_0x41d5('0x8'));var querystring=require(_0x41d5('0xf'));var Papa=require(_0x41d5('0x10'));var Redis=require(_0x41d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x41d5('0x12'));var as=require(_0x41d5('0x13'));var hardwareService=require(_0x41d5('0x14'));var logger=require(_0x41d5('0x15'))(_0x41d5('0x16'));var utils=require(_0x41d5('0x17'));var config=require(_0x41d5('0x18'));var licenseUtil=require(_0x41d5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4566c2,_0x44cbd4){_0x44cbd4=_0x44cbd4||0xcc;return function(_0x1cbf48){if(_0x1cbf48){return _0x4566c2[_0x41d5('0x1a')](_0x44cbd4);}return _0x4566c2[_0x41d5('0x1b')](_0x44cbd4)[_0x41d5('0x1c')]();};}function respondWithResult(_0x53ff41,_0x2332fe){_0x2332fe=_0x2332fe||0xc8;return function(_0x4d48fe){if(_0x4d48fe){return _0x53ff41[_0x41d5('0x1b')](_0x2332fe)[_0x41d5('0x1d')](_0x4d48fe);}};}function respondWithFilteredResult(_0x2d89d9,_0x3409e3){return function(_0x2e2b91){if(_0x2e2b91){var _0x19c456=typeof _0x3409e3['offset']===_0x41d5('0x1e')&&typeof _0x3409e3[_0x41d5('0x1f')]===_0x41d5('0x1e');var _0x4578ea=_0x2e2b91[_0x41d5('0x20')];var _0x815e8=_0x19c456?0x0:_0x3409e3[_0x41d5('0x21')];var _0x3ce11a=_0x19c456?_0x2e2b91['count']:_0x3409e3[_0x41d5('0x21')]+_0x3409e3[_0x41d5('0x1f')];var _0x1e5a5b;if(_0x3ce11a>=_0x4578ea){_0x3ce11a=_0x4578ea;_0x1e5a5b=0xc8;}else{_0x1e5a5b=0xce;}_0x2d89d9[_0x41d5('0x1b')](_0x1e5a5b);return _0x2d89d9[_0x41d5('0x22')]('Content-Range',_0x815e8+'-'+_0x3ce11a+'/'+_0x4578ea)[_0x41d5('0x1d')](_0x2e2b91);}return null;};}function patchUpdates(_0x2b0adf){return function(_0x2e906b){try{jsonpatch[_0x41d5('0x23')](_0x2e906b,_0x2b0adf,!![]);}catch(_0x59ae4b){return BPromise[_0x41d5('0x24')](_0x59ae4b);}return _0x2e906b['save']();};}function saveUpdates(_0x47582a,_0x58e7db){return function(_0x66874){if(_0x66874){return _0x66874[_0x41d5('0x25')](_0x47582a)[_0x41d5('0x26')](function(_0x6aab78){return _0x6aab78;});}return null;};}function removeEntity(_0x1c73bb,_0x3196b5){return function(_0x517879){if(_0x517879){return _0x517879['destroy']()[_0x41d5('0x26')](function(){var _0x874583=_0x517879[_0x41d5('0x27')]({'plain':!![]});var _0x549934=_0x41d5('0x28');return db['UserProfileResource'][_0x41d5('0x29')]({'where':{'type':_0x549934,'resourceId':_0x874583['id']}})[_0x41d5('0x26')](function(){return _0x517879;});})[_0x41d5('0x26')](function(){_0x1c73bb['status'](0xcc)[_0x41d5('0x1c')]();});}};}function handleEntityNotFound(_0x2f9028,_0x3841df){return function(_0x4c44dc){if(!_0x4c44dc){_0x2f9028[_0x41d5('0x1a')](0x194);}return _0x4c44dc;};}function handleError(_0x28210b,_0x5e4cf4){_0x5e4cf4=_0x5e4cf4||0x1f4;return function(_0x272ddd){logger[_0x41d5('0x2a')](_0x272ddd['stack']);if(_0x272ddd[_0x41d5('0x2b')]){delete _0x272ddd[_0x41d5('0x2b')];}_0x28210b[_0x41d5('0x1b')](_0x5e4cf4)[_0x41d5('0x2c')](_0x272ddd);};}exports[_0x41d5('0x2d')]=function(_0x22cef3,_0x5338b3){var _0x555a6d={},_0xa435ab={},_0x2a832a={'count':0x0,'rows':[]};var _0x2f6e45=_['map'](db[_0x41d5('0x2e')]['rawAttributes'],function(_0x97dc98){return{'name':_0x97dc98[_0x41d5('0x2f')],'type':_0x97dc98[_0x41d5('0x30')][_0x41d5('0x31')]};});_0xa435ab[_0x41d5('0x32')]=_[_0x41d5('0x33')](_0x2f6e45,_0x41d5('0x2b'));_0xa435ab[_0x41d5('0x34')]=_[_0x41d5('0x35')](_0x22cef3[_0x41d5('0x34')]);_0xa435ab['filters']=_[_0x41d5('0x36')](_0xa435ab[_0x41d5('0x32')],_0xa435ab['query']);_0x555a6d[_0x41d5('0x37')]=_['intersection'](_0xa435ab['model'],qs[_0x41d5('0x38')](_0x22cef3[_0x41d5('0x34')][_0x41d5('0x38')]));_0x555a6d[_0x41d5('0x37')]=_0x555a6d['attributes'][_0x41d5('0x39')]?_0x555a6d[_0x41d5('0x37')]:_0xa435ab[_0x41d5('0x32')];if(!_0x22cef3[_0x41d5('0x34')][_0x41d5('0x3a')]('nolimit')){_0x555a6d[_0x41d5('0x1f')]=qs[_0x41d5('0x1f')](_0x22cef3[_0x41d5('0x34')]['limit']);_0x555a6d['offset']=qs[_0x41d5('0x21')](_0x22cef3['query'][_0x41d5('0x21')]);}_0x555a6d['order']=qs[_0x41d5('0x3b')](_0x22cef3['query'][_0x41d5('0x3b')]);_0x555a6d[_0x41d5('0x3c')]=qs[_0x41d5('0x3d')](_[_0x41d5('0x3e')](_0x22cef3[_0x41d5('0x34')],_0xa435ab['filters']),_0x2f6e45);if(_0x22cef3[_0x41d5('0x34')][_0x41d5('0x3f')]){_0x555a6d[_0x41d5('0x3c')]=_['merge'](_0x555a6d['where'],{'$or':_[_0x41d5('0x33')](_0x2f6e45,function(_0x4433df){if(_0x4433df[_0x41d5('0x30')]!==_0x41d5('0x40')){var _0x49b322={};_0x49b322[_0x4433df[_0x41d5('0x2b')]]={'$like':'%'+_0x22cef3[_0x41d5('0x34')][_0x41d5('0x3f')]+'%'};return _0x49b322;}})});}_0x555a6d=_['merge']({},_0x555a6d,_0x22cef3[_0x41d5('0x41')]);var _0x63a3f8={'where':_0x555a6d[_0x41d5('0x3c')]};return db[_0x41d5('0x2e')][_0x41d5('0x20')](_0x63a3f8)['then'](function(_0x19b5c4){_0x2a832a[_0x41d5('0x20')]=_0x19b5c4;if(_0x22cef3[_0x41d5('0x34')][_0x41d5('0x42')]){_0x555a6d['include']=[{'all':!![]}];}return db[_0x41d5('0x2e')][_0x41d5('0x43')](_0x555a6d);})[_0x41d5('0x26')](function(_0xec2490){_0x2a832a['rows']=_0xec2490;return _0x2a832a;})['then'](respondWithFilteredResult(_0x5338b3,_0x555a6d))[_0x41d5('0x44')](handleError(_0x5338b3,null));};exports[_0x41d5('0x45')]=function(_0x16aebf,_0x5be1e0){var _0x4c5a69={'raw':!![],'where':{'id':_0x16aebf['params']['id']}},_0x3d5c7b={};_0x3d5c7b[_0x41d5('0x32')]=_['keys'](db[_0x41d5('0x2e')]['rawAttributes']);_0x3d5c7b['query']=_[_0x41d5('0x35')](_0x16aebf[_0x41d5('0x34')]);_0x3d5c7b[_0x41d5('0x3d')]=_[_0x41d5('0x36')](_0x3d5c7b[_0x41d5('0x32')],_0x3d5c7b[_0x41d5('0x34')]);_0x4c5a69['attributes']=_[_0x41d5('0x36')](_0x3d5c7b[_0x41d5('0x32')],qs[_0x41d5('0x38')](_0x16aebf[_0x41d5('0x34')][_0x41d5('0x38')]));_0x4c5a69[_0x41d5('0x37')]=_0x4c5a69[_0x41d5('0x37')][_0x41d5('0x39')]?_0x4c5a69[_0x41d5('0x37')]:_0x3d5c7b[_0x41d5('0x32')];if(_0x16aebf[_0x41d5('0x34')][_0x41d5('0x42')]){_0x4c5a69[_0x41d5('0x46')]=[{'all':!![]}];}_0x4c5a69=_[_0x41d5('0x47')]({},_0x4c5a69,_0x16aebf[_0x41d5('0x41')]);return db[_0x41d5('0x2e')][_0x41d5('0x48')](_0x4c5a69)[_0x41d5('0x26')](handleEntityNotFound(_0x5be1e0,null))[_0x41d5('0x26')](respondWithResult(_0x5be1e0,null))[_0x41d5('0x44')](handleError(_0x5be1e0,null));};exports[_0x41d5('0x49')]=function(_0x5d8eed,_0x24fdfe){return db[_0x41d5('0x2e')][_0x41d5('0x49')](_0x5d8eed['body'],{})[_0x41d5('0x26')](function(_0x37cc06){var _0x1315cd=_0x5d8eed['user'][_0x41d5('0x27')]({'plain':!![]});if(!_0x1315cd)throw new Error(_0x41d5('0x4a'));if(_0x1315cd[_0x41d5('0x4b')]===_0x41d5('0x4c')){var _0x44402b=_0x37cc06['get']({'plain':!![]});var _0x448ca0='Dispositions';return db[_0x41d5('0x4d')][_0x41d5('0x48')]({'where':{'name':_0x448ca0,'userProfileId':_0x1315cd['userProfileId']},'raw':!![]})[_0x41d5('0x26')](function(_0x156980){if(_0x156980&&_0x156980[_0x41d5('0x4e')]===0x0){return db[_0x41d5('0x4f')][_0x41d5('0x49')]({'name':_0x44402b[_0x41d5('0x2b')],'resourceId':_0x44402b['id'],'type':_0x156980[_0x41d5('0x2b')],'sectionId':_0x156980['id']},{})[_0x41d5('0x26')](function(){return _0x37cc06;});}else{return _0x37cc06;}})['catch'](function(_0x582b8d){logger[_0x41d5('0x2a')](_0x41d5('0x50'),_0x582b8d);throw _0x582b8d;});}return _0x37cc06;})[_0x41d5('0x26')](respondWithResult(_0x24fdfe,0xc9))['catch'](handleError(_0x24fdfe,null));};exports[_0x41d5('0x25')]=function(_0x8a45c7,_0x4f8717){if(_0x8a45c7[_0x41d5('0x51')]['id']){delete _0x8a45c7[_0x41d5('0x51')]['id'];}return db[_0x41d5('0x2e')][_0x41d5('0x48')]({'where':{'id':_0x8a45c7[_0x41d5('0x52')]['id']}})['then'](handleEntityNotFound(_0x4f8717,null))[_0x41d5('0x26')](saveUpdates(_0x8a45c7['body'],null))[_0x41d5('0x26')](respondWithResult(_0x4f8717,null))[_0x41d5('0x44')](handleError(_0x4f8717,null));};exports[_0x41d5('0x29')]=function(_0x2af063,_0x40199a){return db[_0x41d5('0x2e')]['find']({'where':{'id':_0x2af063[_0x41d5('0x52')]['id']}})[_0x41d5('0x26')](handleEntityNotFound(_0x40199a,null))[_0x41d5('0x26')](removeEntity(_0x40199a,null))['catch'](handleError(_0x40199a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d2fa9a0..31c3479 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 _0xacc1=['path','rimraf','./disposition.attributes','exports','define','tools_dispositions','name','ListId','name_chat','name_mail','MailAccountId','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','request-promise'];(function(_0x50696d,_0x274c7a){var _0x74d5c8=function(_0x377dc6){while(--_0x377dc6){_0x50696d['push'](_0x50696d['shift']());}};_0x74d5c8(++_0x274c7a);}(_0xacc1,0x187));var _0x1acc=function(_0x312bd5,_0xbed416){_0x312bd5=_0x312bd5-0x0;var _0x5c43bc=_0xacc1[_0x312bd5];return _0x5c43bc;};'use strict';var _=require(_0x1acc('0x0'));var util=require(_0x1acc('0x1'));var logger=require(_0x1acc('0x2'))(_0x1acc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1acc('0x4'));var fs=require('fs');var path=require(_0x1acc('0x5'));var rimraf=require(_0x1acc('0x6'));var config=require('../../config/environment');var attributes=require(_0x1acc('0x7'));module[_0x1acc('0x8')]=function(_0x5899c0,_0x2bf33c){return _0x5899c0[_0x1acc('0x9')]('Disposition',attributes,{'tableName':_0x1acc('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x1acc('0xb'),_0x1acc('0xc')]},{'unique':!![],'name':_0x1acc('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x1acc('0xe'),'fields':['name',_0x1acc('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x1acc('0xb'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x1acc('0xb'),_0x1acc('0x10')]},{'unique':!![],'name':_0x1acc('0x11'),'fields':[_0x1acc('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x88f3=['name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','moment','bluebird','request-promise','path','./disposition.attributes','exports','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x88f3,0x70));var _0x388f=function(_0x4ab358,_0x2345b3){_0x4ab358=_0x4ab358-0x0;var _0x367aec=_0x88f3[_0x4ab358];return _0x367aec;};'use strict';var _=require('lodash');var util=require(_0x388f('0x0'));var logger=require(_0x388f('0x1'))('api');var moment=require(_0x388f('0x2'));var BPromise=require(_0x388f('0x3'));var rp=require(_0x388f('0x4'));var fs=require('fs');var path=require(_0x388f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x388f('0x6'));module[_0x388f('0x7')]=function(_0x565aed,_0x387fc2){return _0x565aed['define'](_0x388f('0x8'),attributes,{'tableName':_0x388f('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x388f('0xa'),_0x388f('0xb')]},{'unique':!![],'name':_0x388f('0xc'),'fields':[_0x388f('0xa'),_0x388f('0xd')]},{'unique':!![],'name':_0x388f('0xe'),'fields':['name','MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x388f('0xa'),_0x388f('0xf')]},{'unique':!![],'name':_0x388f('0x10'),'fields':[_0x388f('0xa'),_0x388f('0x11')]},{'unique':!![],'name':_0x388f('0x12'),'fields':[_0x388f('0xa'),'OpenchannelAccountId']},{'unique':!![],'name':_0x388f('0x13'),'fields':['name',_0x388f('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index af0edc7..957c8ed 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(_0xf7f355,_0x497a8c){var _0x1faa66=function(_0x799954){while(--_0x799954){_0xf7f355['push'](_0xf7f355['shift']());}};_0x1faa66(++_0x497a8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x214a05,_0x3d7e96){var _0x475918=function(_0x4d1041){while(--_0x4d1041){_0x214a05['push'](_0x214a05['shift']());}};_0x475918(++_0x3d7e96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 5d3bc9e..5f71264 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 _0xc844=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0xc844,0x1d0));var _0x4c84=function(_0x167370,_0x457858){_0x167370=_0x167370-0x0;var _0x4ac979=_0xc844[_0x167370];return _0x4ac979;};'use strict';var multer=require(_0x4c84('0x0'));var util=require('util');var path=require(_0x4c84('0x1'));var timeout=require(_0x4c84('0x2'));var express=require(_0x4c84('0x3'));var router=express['Router']();var fs_extra=require(_0x4c84('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4c84('0x5'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x4c84('0x6')]('/',auth[_0x4c84('0x7')](),controller[_0x4c84('0x8')]);router[_0x4c84('0x6')](_0x4c84('0x9'),auth[_0x4c84('0x7')](),controller[_0x4c84('0xa')]);router[_0x4c84('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c84('0xc')]('/:id',auth[_0x4c84('0x7')](),controller[_0x4c84('0xd')]);router[_0x4c84('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4c84('0xf')]);module[_0x4c84('0x10')]=router; \ No newline at end of file +var _0x5106=['delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','isAuthenticated','get','post','put','/:id'];(function(_0x3fd58b,_0x8364d3){var _0x2eadbf=function(_0x453a39){while(--_0x453a39){_0x3fd58b['push'](_0x3fd58b['shift']());}};_0x2eadbf(++_0x8364d3);}(_0x5106,0xa7));var _0x6510=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5106[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6510('0x0'));var util=require('util');var path=require(_0x6510('0x1'));var timeout=require('connect-timeout');var express=require(_0x6510('0x2'));var router=express[_0x6510('0x3')]();var fs_extra=require(_0x6510('0x4'));var auth=require(_0x6510('0x5'));var interaction=require(_0x6510('0x6'));var config=require('../../config/environment');var controller=require(_0x6510('0x7'));router['get']('/',auth[_0x6510('0x8')](),controller['index']);router[_0x6510('0x9')]('/:id',auth[_0x6510('0x8')](),controller['show']);router[_0x6510('0xa')]('/',auth[_0x6510('0x8')](),controller['create']);router[_0x6510('0xb')](_0x6510('0xc'),auth[_0x6510('0x8')](),controller['update']);router[_0x6510('0xd')](_0x6510('0xc'),auth[_0x6510('0x8')](),controller['destroy']);module[_0x6510('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 03e87f1..0c17988 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 _0xe322=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','9600','12000','14400','4800','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x4f14b7,_0xed057d){var _0x1b03f0=function(_0x5f366c){while(--_0x5f366c){_0x4f14b7['push'](_0x4f14b7['shift']());}};_0x1b03f0(++_0xed057d);}(_0xe322,0xc6));var _0x2e32=function(_0x6ad15d,_0x24cb0b){_0x6ad15d=_0x6ad15d-0x0;var _0x24b9cb=_0xe322[_0x6ad15d];return _0x24b9cb;};'use strict';var Sequelize=require(_0x2e32('0x0'));module[_0x2e32('0x1')]={'name':{'type':Sequelize[_0x2e32('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2e32('0x2')]},'ecm':{'type':Sequelize[_0x2e32('0x3')](_0x2e32('0x4'),'no'),'defaultValue':_0x2e32('0x4')},'headerinfo':{'type':Sequelize[_0x2e32('0x2')],'defaultValue':_0x2e32('0x5')},'localstationid':{'type':Sequelize[_0x2e32('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x2e32('0x3')](_0x2e32('0x6'),'4800','7200',_0x2e32('0x7'),_0x2e32('0x8'),_0x2e32('0x9')),'defaultValue':_0x2e32('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x2e32('0x6'),_0x2e32('0xa'),_0x2e32('0xb'),'9600',_0x2e32('0x8'),_0x2e32('0x9')),'defaultValue':_0x2e32('0x9')},'modem':{'type':Sequelize[_0x2e32('0x2')],'defaultValue':_0x2e32('0xc')},'gateway':{'type':Sequelize[_0x2e32('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2e32('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2e32('0x3')](_0x2e32('0xe'),_0x2e32('0xf'),_0x2e32('0x10'),_0x2e32('0x11')),'defaultValue':_0x2e32('0xe')},'key':{'type':Sequelize[_0x2e32('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2e32('0x12')],'defaultValue':function(){return _0x2e32('0x13');}},'notificationSound':{'type':Sequelize[_0x2e32('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e32('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e32('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e32('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e32('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e32('0xd')],'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[_0x2e32('0x14')],'defaultValue':![],'comment':_0x2e32('0x15'),'set':function(_0x5e318a){if(!_0x5e318a)this[_0x2e32('0x16')](_0x2e32('0x17'),null);this[_0x2e32('0x16')](_0x2e32('0x18'),_0x5e318a);}}}; \ No newline at end of file +var _0x6dc6=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x2c1c7a,_0x2706f6){var _0x412314=function(_0x4f14ff){while(--_0x4f14ff){_0x2c1c7a['push'](_0x2c1c7a['shift']());}};_0x412314(++_0x2706f6);}(_0x6dc6,0x14a));var _0x66dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6dc6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x66dc('0x0'));module[_0x66dc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x66dc('0x2')](_0x66dc('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x66dc('0x4')],'defaultValue':_0x66dc('0x5')},'localstationid':{'type':Sequelize[_0x66dc('0x4')],'unique':_0x66dc('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x66dc('0x7'),_0x66dc('0x8'),_0x66dc('0x9'),_0x66dc('0xa'),_0x66dc('0xb'),_0x66dc('0xc')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x66dc('0x2')](_0x66dc('0x7'),_0x66dc('0x8'),_0x66dc('0x9'),_0x66dc('0xa'),_0x66dc('0xb'),'14400'),'defaultValue':_0x66dc('0xc')},'modem':{'type':Sequelize[_0x66dc('0x4')],'defaultValue':_0x66dc('0xd')},'gateway':{'type':Sequelize[_0x66dc('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x66dc('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x66dc('0x2')]('SIP','IAX',_0x66dc('0xf'),_0x66dc('0x10')),'defaultValue':_0x66dc('0x11')},'key':{'type':Sequelize[_0x66dc('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x66dc('0x12')],'defaultValue':function(){return _0x66dc('0x13');}},'notificationSound':{'type':Sequelize[_0x66dc('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x66dc('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x66dc('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x66dc('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x66dc('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x66dc('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x66dc('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x66dc('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x66dc('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4860be){if(!_0x4860be)this[_0x66dc('0x16')](_0x66dc('0x17'),null);this[_0x66dc('0x16')](_0x66dc('0x18'),_0x4860be);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 1d3e454..8f95089 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 _0x9e4d=['Content-Range','apply','destroy','FaxAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','keys','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','ecm','headerinfo','maxrate','minrate','modem','t38timeout','Set','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','update','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','limit','undefined','count'];(function(_0x2c9148,_0x578953){var _0x1b77b9=function(_0x163367){while(--_0x163367){_0x2c9148['push'](_0x2c9148['shift']());}};_0x1b77b9(++_0x578953);}(_0x9e4d,0x90));var _0xd9e4=function(_0x3c9c4a,_0x28100d){_0x3c9c4a=_0x3c9c4a-0x0;var _0x1e7991=_0x9e4d[_0x3c9c4a];return _0x1e7991;};'use strict';var emlformat=require(_0xd9e4('0x0'));var rimraf=require(_0xd9e4('0x1'));var zipdir=require(_0xd9e4('0x2'));var jsonpatch=require(_0xd9e4('0x3'));var rp=require(_0xd9e4('0x4'));var moment=require('moment');var BPromise=require(_0xd9e4('0x5'));var Mustache=require(_0xd9e4('0x6'));var util=require(_0xd9e4('0x7'));var path=require(_0xd9e4('0x8'));var sox=require('sox');var csv=require(_0xd9e4('0x9'));var ejs=require(_0xd9e4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9e4('0xb'));var crypto=require(_0xd9e4('0xc'));var jsforce=require(_0xd9e4('0xd'));var deskjs=require(_0xd9e4('0xe'));var toCsv=require(_0xd9e4('0x9'));var querystring=require(_0xd9e4('0xf'));var Papa=require(_0xd9e4('0x10'));var Redis=require(_0xd9e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd9e4('0x12'));var as=require(_0xd9e4('0x13'));var hardwareService=require(_0xd9e4('0x14'));var logger=require(_0xd9e4('0x15'))(_0xd9e4('0x16'));var utils=require(_0xd9e4('0x17'));var config=require(_0xd9e4('0x18'));var licenseUtil=require(_0xd9e4('0x19'));var db=require(_0xd9e4('0x1a'))['db'];config['redis']=_[_0xd9e4('0x1b')](config[_0xd9e4('0x1c')],{'host':_0xd9e4('0x1d'),'port':0x18eb});var socket=require(_0xd9e4('0x1e'))(new Redis(config['redis']));require(_0xd9e4('0x1f'))[_0xd9e4('0x20')](socket);var jayson=require(_0xd9e4('0x21'));var client=jayson[_0xd9e4('0x22')][_0xd9e4('0x23')]({'port':0x232c});var client9002=jayson[_0xd9e4('0x22')][_0xd9e4('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1ab66b,_0x3947a5,_0x361e94,_0x4e6693){return new BPromise(function(_0x5f91cb,_0x4a664c){var _0x40edd3=_0x4e6693||client;return _0x40edd3[_0xd9e4('0x24')](_0x1ab66b,_0x361e94)[_0xd9e4('0x25')](function(_0x303b6a){logger[_0xd9e4('0x26')](_0xd9e4('0x27'),_0x3947a5,_0xd9e4('0x28'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3947a5,'request\x20sent',JSON[_0xd9e4('0x29')](_0x303b6a));if(_0x303b6a[_0xd9e4('0x2a')]){if(_0x303b6a[_0xd9e4('0x2a')]['code']===0x1f4){logger[_0xd9e4('0x2a')](_0xd9e4('0x27'),_0x3947a5,_0x303b6a[_0xd9e4('0x2a')]['message']);return _0x4a664c(_0x303b6a['error']['message']);}logger[_0xd9e4('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x3947a5,_0x303b6a[_0xd9e4('0x2a')][_0xd9e4('0x2b')]);return _0x5f91cb(_0x303b6a[_0xd9e4('0x2a')][_0xd9e4('0x2b')]);}else{logger[_0xd9e4('0x26')](_0xd9e4('0x27'),_0x3947a5,_0xd9e4('0x28'));_0x5f91cb(_0x303b6a[_0xd9e4('0x2c')][_0xd9e4('0x2b')]);}})[_0xd9e4('0x2d')](function(_0x36f8ce){logger['error'](_0xd9e4('0x27'),_0x3947a5,_0x36f8ce);_0x4a664c(_0x36f8ce);});});}function respondWithStatusCode(_0x4499c4,_0x3af606){_0x3af606=_0x3af606||0xcc;return function(_0x49777d){if(_0x49777d){return _0x4499c4['sendStatus'](_0x3af606);}return _0x4499c4['status'](_0x3af606)[_0xd9e4('0x2e')]();};}function respondWithResult(_0x47bbe1,_0x281bd5){_0x281bd5=_0x281bd5||0xc8;return function(_0xf792e3){if(_0xf792e3){return _0x47bbe1[_0xd9e4('0x2f')](_0x281bd5)[_0xd9e4('0x30')](_0xf792e3);}};}function respondWithFilteredResult(_0x49e1d4,_0x527481){return function(_0x37c82e){if(_0x37c82e){var _0x515876=typeof _0x527481[_0xd9e4('0x31')]==='undefined'&&typeof _0x527481[_0xd9e4('0x32')]===_0xd9e4('0x33');var _0x542ad0=_0x37c82e[_0xd9e4('0x34')];var _0x5ab96b=_0x515876?0x0:_0x527481['offset'];var _0x35b41f=_0x515876?_0x37c82e[_0xd9e4('0x34')]:_0x527481[_0xd9e4('0x31')]+_0x527481[_0xd9e4('0x32')];var _0x45511c;if(_0x35b41f>=_0x542ad0){_0x35b41f=_0x542ad0;_0x45511c=0xc8;}else{_0x45511c=0xce;}_0x49e1d4[_0xd9e4('0x2f')](_0x45511c);return _0x49e1d4['set'](_0xd9e4('0x35'),_0x5ab96b+'-'+_0x35b41f+'/'+_0x542ad0)[_0xd9e4('0x30')](_0x37c82e);}return null;};}function patchUpdates(_0x2e34b7){return function(_0x201ddc){try{jsonpatch[_0xd9e4('0x36')](_0x201ddc,_0x2e34b7,!![]);}catch(_0x2563b5){return BPromise['reject'](_0x2563b5);}return _0x201ddc['save']();};}function saveUpdates(_0x4a34e6,_0x44118d){return function(_0x12002a){if(_0x12002a){return _0x12002a['update'](_0x4a34e6)[_0xd9e4('0x25')](function(_0x4889b7){return _0x4889b7;});}return null;};}function removeEntity(_0x368a04,_0x17bda0){return function(_0x31c78a){if(_0x31c78a){return _0x31c78a[_0xd9e4('0x37')]()[_0xd9e4('0x25')](function(){var _0x481d5e=_0x31c78a['get']({'plain':!![]});var _0x2cebd9=_0xd9e4('0x38');return db['UserProfileResource'][_0xd9e4('0x37')]({'where':{'type':_0x2cebd9,'resourceId':_0x481d5e['id']}})['then'](function(){return _0x31c78a;});})[_0xd9e4('0x25')](function(){_0x368a04[_0xd9e4('0x2f')](0xcc)[_0xd9e4('0x2e')]();});}};}function handleEntityNotFound(_0x405ff8,_0xa2f9a){return function(_0x4be136){if(!_0x4be136){_0x405ff8[_0xd9e4('0x39')](0x194);}return _0x4be136;};}function handleError(_0x1f6388,_0xe7b166){_0xe7b166=_0xe7b166||0x1f4;return function(_0x8179a6){logger[_0xd9e4('0x2a')](_0x8179a6[_0xd9e4('0x3a')]);if(_0x8179a6['name']){delete _0x8179a6[_0xd9e4('0x3b')];}_0x1f6388[_0xd9e4('0x2f')](_0xe7b166)[_0xd9e4('0x3c')](_0x8179a6);};}exports[_0xd9e4('0x3d')]=function(_0x4b303b,_0x30f441){var _0x4d795c={'include':[{'model':db[_0xd9e4('0x3e')],'as':_0xd9e4('0x3f')}]},_0x45fd06={},_0x54c09d={'count':0x0,'rows':[]};var _0x17821d=_[_0xd9e4('0x40')](db[_0xd9e4('0x41')][_0xd9e4('0x42')],function(_0x30dbe7){return{'name':_0x30dbe7[_0xd9e4('0x43')],'type':_0x30dbe7[_0xd9e4('0x44')][_0xd9e4('0x45')]};});_0x45fd06[_0xd9e4('0x46')]=_['map'](_0x17821d,'name');_0x45fd06[_0xd9e4('0x47')]=_['keys'](_0x4b303b['query']);_0x45fd06['filters']=_[_0xd9e4('0x48')](_0x45fd06[_0xd9e4('0x46')],_0x45fd06['query']);_0x4d795c[_0xd9e4('0x49')]=_['intersection'](_0x45fd06[_0xd9e4('0x46')],qs[_0xd9e4('0x4a')](_0x4b303b['query'][_0xd9e4('0x4a')]));_0x4d795c[_0xd9e4('0x49')]=_0x4d795c['attributes'][_0xd9e4('0x4b')]?_0x4d795c[_0xd9e4('0x49')]:_0x45fd06['model'];if(!_0x4b303b[_0xd9e4('0x47')]['hasOwnProperty'](_0xd9e4('0x4c'))){_0x4d795c[_0xd9e4('0x32')]=qs[_0xd9e4('0x32')](_0x4b303b[_0xd9e4('0x47')][_0xd9e4('0x32')]);_0x4d795c[_0xd9e4('0x31')]=qs[_0xd9e4('0x31')](_0x4b303b[_0xd9e4('0x47')][_0xd9e4('0x31')]);}_0x4d795c[_0xd9e4('0x4d')]=qs['sort'](_0x4b303b[_0xd9e4('0x47')][_0xd9e4('0x4e')]);_0x4d795c[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_[_0xd9e4('0x51')](_0x4b303b[_0xd9e4('0x47')],_0x45fd06[_0xd9e4('0x50')]),_0x17821d);if(_0x4b303b[_0xd9e4('0x47')][_0xd9e4('0x52')]){_0x4d795c[_0xd9e4('0x4f')]=_['merge'](_0x4d795c[_0xd9e4('0x4f')],{'$or':_[_0xd9e4('0x40')](_0x17821d,function(_0x548830){if(_0x548830[_0xd9e4('0x44')]!=='VIRTUAL'){var _0x348974={};_0x348974[_0x548830[_0xd9e4('0x3b')]]={'$like':'%'+_0x4b303b['query'][_0xd9e4('0x52')]+'%'};return _0x348974;}})});}_0x4d795c=_[_0xd9e4('0x53')]({},_0x4d795c,_0x4b303b['options']);var _0x3dbc86={'where':_0x4d795c[_0xd9e4('0x4f')]};return db[_0xd9e4('0x41')]['count'](_0x3dbc86)[_0xd9e4('0x25')](function(_0x6306dc){_0x54c09d['count']=_0x6306dc;if(_0x4b303b[_0xd9e4('0x47')][_0xd9e4('0x54')]){_0x4d795c[_0xd9e4('0x55')]=[{'all':!![]}];}return db[_0xd9e4('0x41')][_0xd9e4('0x56')](_0x4d795c);})[_0xd9e4('0x25')](function(_0x22166d){_0x54c09d[_0xd9e4('0x57')]=_0x22166d;return _0x54c09d;})[_0xd9e4('0x25')](respondWithFilteredResult(_0x30f441,_0x4d795c))[_0xd9e4('0x2d')](handleError(_0x30f441,null));};exports['show']=function(_0x2da533,_0x12932a){var _0x172b07={'raw':![],'where':{'id':_0x2da533['params']['id']},'include':[{'model':db[_0xd9e4('0x3e')],'as':_0xd9e4('0x3f')}]},_0x3e7db5={};_0x3e7db5[_0xd9e4('0x46')]=_[_0xd9e4('0x58')](db['FaxAccount'][_0xd9e4('0x42')]);_0x3e7db5['query']=_[_0xd9e4('0x58')](_0x2da533['query']);_0x3e7db5[_0xd9e4('0x50')]=_['intersection'](_0x3e7db5[_0xd9e4('0x46')],_0x3e7db5[_0xd9e4('0x47')]);_0x172b07[_0xd9e4('0x49')]=_['intersection'](_0x3e7db5['model'],qs[_0xd9e4('0x4a')](_0x2da533['query'][_0xd9e4('0x4a')]));_0x172b07[_0xd9e4('0x49')]=_0x172b07[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x172b07[_0xd9e4('0x49')]:_0x3e7db5[_0xd9e4('0x46')];if(_0x2da533['query'][_0xd9e4('0x54')]){_0x172b07[_0xd9e4('0x55')]=[{'all':!![]}];}_0x172b07=_['merge']({},_0x172b07,_0x2da533[_0xd9e4('0x59')]);return db[_0xd9e4('0x41')][_0xd9e4('0x5a')](_0x172b07)[_0xd9e4('0x25')](handleEntityNotFound(_0x12932a,null))['then'](respondWithResult(_0x12932a,null))['catch'](handleError(_0x12932a,null));};exports[_0xd9e4('0x5b')]=function(_0x4b06a7,_0xeb0ac7){return db[_0xd9e4('0x41')][_0xd9e4('0x5b')](_0x4b06a7['body'],{})[_0xd9e4('0x25')](function(_0x3be21c){var _0x202a51=_0x4b06a7['user'][_0xd9e4('0x5c')]({'plain':!![]});if(!_0x202a51)throw new Error(_0xd9e4('0x5d'));if(_0x202a51['role']==='user'){var _0x430ac0=_0x3be21c['get']({'plain':!![]});var _0x22aef9=_0xd9e4('0x38');return db[_0xd9e4('0x5e')][_0xd9e4('0x5a')]({'where':{'name':_0x22aef9,'userProfileId':_0x202a51['userProfileId']},'raw':!![]})[_0xd9e4('0x25')](function(_0x4b8ec9){if(_0x4b8ec9&&_0x4b8ec9[_0xd9e4('0x5f')]===0x0){return db[_0xd9e4('0x60')][_0xd9e4('0x5b')]({'name':_0x430ac0[_0xd9e4('0x3b')],'resourceId':_0x430ac0['id'],'type':_0x4b8ec9[_0xd9e4('0x3b')],'sectionId':_0x4b8ec9['id']},{})[_0xd9e4('0x25')](function(){return _0x3be21c;});}else{return _0x3be21c;}})[_0xd9e4('0x2d')](function(_0xb1b984){logger[_0xd9e4('0x2a')](_0xd9e4('0x61'),_0xb1b984);throw _0xb1b984;});}return _0x3be21c;})[_0xd9e4('0x25')](respondWithResult(_0xeb0ac7,0xc9))['catch'](handleError(_0xeb0ac7,null));};exports['update']=function(_0xb9eefb,_0x2f9d7d){if(_0xb9eefb[_0xd9e4('0x62')]['id']){delete _0xb9eefb[_0xd9e4('0x62')]['id'];}return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0xb9eefb[_0xd9e4('0x63')]['id']},'include':[{'model':db[_0xd9e4('0x3e')],'as':_0xd9e4('0x3f')}]})[_0xd9e4('0x25')](handleEntityNotFound(_0x2f9d7d,null))[_0xd9e4('0x25')](saveUpdates(_0xb9eefb['body'],null))[_0xd9e4('0x25')](respondWithResult(_0x2f9d7d,null))[_0xd9e4('0x2d')](handleError(_0x2f9d7d,null));};exports[_0xd9e4('0x37')]=function(_0x29a7c5,_0x76c38b){return db['FaxAccount'][_0xd9e4('0x5a')]({'where':{'id':_0x29a7c5['params']['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x76c38b,null))[_0xd9e4('0x25')](removeEntity(_0x76c38b,null))[_0xd9e4('0x2d')](handleError(_0x76c38b,null));};exports[_0xd9e4('0x64')]=function(_0x57ab37,_0x5030a4){return db[_0xd9e4('0x41')][_0xd9e4('0x64')]()[_0xd9e4('0x25')](respondWithResult(_0x5030a4,null))['catch'](handleError(_0x5030a4,null));};exports['addDisposition']=function(_0x52e3d0,_0x4e254e,_0x4ad278){if(_0x52e3d0['body']['id']){delete _0x52e3d0[_0xd9e4('0x62')]['id'];}return db['FaxAccount'][_0xd9e4('0x5a')]({'where':{'id':_0x52e3d0[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x4e254e,null))[_0xd9e4('0x25')](function(_0xa25ed3){if(_0xa25ed3){_0x52e3d0[_0xd9e4('0x62')][_0xd9e4('0x65')]=_0xa25ed3['id'];return db[_0xd9e4('0x66')][_0xd9e4('0x5b')](_0x52e3d0[_0xd9e4('0x62')]);}})[_0xd9e4('0x25')](respondWithResult(_0x4e254e,null))[_0xd9e4('0x2d')](handleError(_0x4e254e,null));};exports[_0xd9e4('0x67')]=function(_0x1634bb,_0x351129,_0x13876a){var _0x366b07={'raw':![],'where':{}};var _0x131d8d={};var _0x22eb4f={'count':0x0,'rows':[]};return db[_0xd9e4('0x41')][_0xd9e4('0x68')]({'where':{'id':_0x1634bb['params']['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x351129,null))[_0xd9e4('0x25')](function(_0x4ccb19){if(_0x4ccb19){_0x131d8d['model']=_[_0xd9e4('0x58')](db[_0xd9e4('0x66')]['rawAttributes']);_0x131d8d[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x1634bb[_0xd9e4('0x47')]);_0x131d8d[_0xd9e4('0x50')]=_[_0xd9e4('0x48')](_0x131d8d[_0xd9e4('0x46')],_0x131d8d[_0xd9e4('0x47')]);_0x366b07[_0xd9e4('0x49')]=_[_0xd9e4('0x48')](_0x131d8d[_0xd9e4('0x46')],qs['fields'](_0x1634bb['query'][_0xd9e4('0x4a')]));_0x366b07['attributes']=_0x366b07[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x366b07[_0xd9e4('0x49')]:_0x131d8d[_0xd9e4('0x46')];if(!_0x1634bb[_0xd9e4('0x47')][_0xd9e4('0x69')](_0xd9e4('0x4c'))){_0x366b07[_0xd9e4('0x32')]=qs['limit'](_0x1634bb[_0xd9e4('0x47')][_0xd9e4('0x32')]);_0x366b07['offset']=qs[_0xd9e4('0x31')](_0x1634bb[_0xd9e4('0x47')][_0xd9e4('0x31')]);}_0x366b07['order']=qs[_0xd9e4('0x4e')](_0x1634bb['query']['sort']);_0x366b07[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_['pick'](_0x1634bb[_0xd9e4('0x47')],_0x131d8d[_0xd9e4('0x50')]));_0x366b07[_0xd9e4('0x4f')][_0xd9e4('0x65')]=_0x4ccb19['id'];if(_0x1634bb[_0xd9e4('0x47')][_0xd9e4('0x52')]){_0x366b07[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x366b07[_0xd9e4('0x4f')],{'$or':_[_0xd9e4('0x40')](_0x366b07[_0xd9e4('0x49')],function(_0x1b8c37){var _0x151f19={};_0x151f19[_0x1b8c37]={'$like':'%'+_0x1634bb[_0xd9e4('0x47')]['filter']+'%'};return _0x151f19;})});}_0x366b07=_[_0xd9e4('0x53')]({},_0x366b07,_0x1634bb[_0xd9e4('0x59')]);return db[_0xd9e4('0x66')][_0xd9e4('0x34')]({'where':_0x366b07[_0xd9e4('0x4f')]})[_0xd9e4('0x25')](function(_0x5eb601){_0x22eb4f['count']=_0x5eb601;if(_0x1634bb[_0xd9e4('0x47')][_0xd9e4('0x54')]){_0x366b07[_0xd9e4('0x55')]=[{'all':!![]}];}return db[_0xd9e4('0x66')][_0xd9e4('0x56')](_0x366b07);})[_0xd9e4('0x25')](function(_0x508144){_0x22eb4f[_0xd9e4('0x57')]=_0x508144;return _0x22eb4f;});}})[_0xd9e4('0x25')](respondWithFilteredResult(_0x351129,_0x366b07))[_0xd9e4('0x2d')](handleError(_0x351129,null));};exports[_0xd9e4('0x6a')]=function(_0x29ab97,_0x1e1d28,_0x63812a){return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x29ab97[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x1e1d28,null))[_0xd9e4('0x25')](function(_0x4b99b8){if(_0x4b99b8){return _0x4b99b8[_0xd9e4('0x6a')](_0x29ab97['query'][_0xd9e4('0x6b')]);}})[_0xd9e4('0x25')](respondWithStatusCode(_0x1e1d28,null))[_0xd9e4('0x2d')](handleError(_0x1e1d28,null));};exports['addAnswer']=function(_0x48a50a,_0x190f6f,_0x19c292){if(_0x48a50a[_0xd9e4('0x62')]['id']){delete _0x48a50a['body']['id'];}return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x48a50a['params']['id']}})['then'](handleEntityNotFound(_0x190f6f,null))[_0xd9e4('0x25')](function(_0x5f5adb){if(_0x5f5adb){_0x48a50a['body'][_0xd9e4('0x65')]=_0x5f5adb['id'];return db[_0xd9e4('0x6c')]['create'](_0x48a50a[_0xd9e4('0x62')]);}})[_0xd9e4('0x25')](respondWithResult(_0x190f6f,null))[_0xd9e4('0x2d')](handleError(_0x190f6f,null));};exports[_0xd9e4('0x6d')]=function(_0x481027,_0x544029,_0x3d35ff){var _0x1c662d={'raw':![],'where':{}};var _0x356ada={};var _0x22e29e={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x481027[_0xd9e4('0x63')]['id']}})['then'](handleEntityNotFound(_0x544029,null))[_0xd9e4('0x25')](function(_0x15b389){if(_0x15b389){_0x356ada['model']=_[_0xd9e4('0x58')](db[_0xd9e4('0x6c')][_0xd9e4('0x42')]);_0x356ada[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x481027[_0xd9e4('0x47')]);_0x356ada['filters']=_[_0xd9e4('0x48')](_0x356ada['model'],_0x356ada[_0xd9e4('0x47')]);_0x1c662d[_0xd9e4('0x49')]=_[_0xd9e4('0x48')](_0x356ada['model'],qs[_0xd9e4('0x4a')](_0x481027[_0xd9e4('0x47')]['fields']));_0x1c662d[_0xd9e4('0x49')]=_0x1c662d['attributes'][_0xd9e4('0x4b')]?_0x1c662d[_0xd9e4('0x49')]:_0x356ada[_0xd9e4('0x46')];if(!_0x481027[_0xd9e4('0x47')]['hasOwnProperty']('nolimit')){_0x1c662d[_0xd9e4('0x32')]=qs[_0xd9e4('0x32')](_0x481027[_0xd9e4('0x47')][_0xd9e4('0x32')]);_0x1c662d[_0xd9e4('0x31')]=qs[_0xd9e4('0x31')](_0x481027[_0xd9e4('0x47')][_0xd9e4('0x31')]);}_0x1c662d[_0xd9e4('0x4d')]=qs[_0xd9e4('0x4e')](_0x481027[_0xd9e4('0x47')]['sort']);_0x1c662d[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_[_0xd9e4('0x51')](_0x481027[_0xd9e4('0x47')],_0x356ada['filters']));_0x1c662d[_0xd9e4('0x4f')]['FaxAccountId']=_0x15b389['id'];if(_0x481027['query'][_0xd9e4('0x52')]){_0x1c662d[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x1c662d[_0xd9e4('0x4f')],{'$or':_[_0xd9e4('0x40')](_0x1c662d[_0xd9e4('0x49')],function(_0x35dcfe){var _0x182301={};_0x182301[_0x35dcfe]={'$like':'%'+_0x481027['query'][_0xd9e4('0x52')]+'%'};return _0x182301;})});}_0x1c662d=_['merge']({},_0x1c662d,_0x481027[_0xd9e4('0x59')]);return db[_0xd9e4('0x6c')][_0xd9e4('0x34')]({'where':_0x1c662d[_0xd9e4('0x4f')]})[_0xd9e4('0x25')](function(_0x313374){_0x22e29e[_0xd9e4('0x34')]=_0x313374;if(_0x481027[_0xd9e4('0x47')][_0xd9e4('0x54')]){_0x1c662d[_0xd9e4('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd9e4('0x56')](_0x1c662d);})[_0xd9e4('0x25')](function(_0x13b303){_0x22e29e[_0xd9e4('0x57')]=_0x13b303;return _0x22e29e;});}})[_0xd9e4('0x25')](respondWithFilteredResult(_0x544029,_0x1c662d))[_0xd9e4('0x2d')](handleError(_0x544029,null));};exports[_0xd9e4('0x6e')]=function(_0x10f1a9,_0x504082,_0x1f16ae){return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x10f1a9[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x504082,null))['then'](function(_0x44e274){if(_0x44e274){return _0x44e274[_0xd9e4('0x6e')](_0x10f1a9[_0xd9e4('0x47')][_0xd9e4('0x6b')]);}})[_0xd9e4('0x25')](respondWithStatusCode(_0x504082,null))[_0xd9e4('0x2d')](handleError(_0x504082,null));};exports[_0xd9e4('0x6f')]=function(_0xa3f22f,_0x310a40,_0x4f87c8){return db[_0xd9e4('0x70')][_0xd9e4('0x5a')]({'where':{'id':_0xa3f22f['params']['id']}})['then'](handleEntityNotFound(_0x310a40,null))[_0xd9e4('0x25')](function(_0x1d3c53){if(_0x1d3c53){return _0x1d3c53['addInteraction'](_0xa3f22f[_0xd9e4('0x62')]['ids'],_[_0xd9e4('0x71')](_0xa3f22f[_0xd9e4('0x62')],['ids','id'])||{});}})[_0xd9e4('0x25')](respondWithResult(_0x310a40,null))[_0xd9e4('0x2d')](handleError(_0x310a40,null));};exports[_0xd9e4('0x72')]=function(_0x648cb,_0x4c6c8f,_0x3596ee){var _0x319074={'raw':![],'where':{}};var _0x3363f2={};var _0x1454fa={'count':0x0,'rows':[]};return db[_0xd9e4('0x41')]['findOne']({'where':{'id':_0x648cb[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x4c6c8f,null))['then'](function(_0xa8ecd7){if(_0xa8ecd7){_0x3363f2[_0xd9e4('0x46')]=_[_0xd9e4('0x58')](db[_0xd9e4('0x70')][_0xd9e4('0x42')]);_0x3363f2[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x648cb['query']);_0x3363f2[_0xd9e4('0x50')]=_['intersection'](_0x3363f2[_0xd9e4('0x46')],_0x3363f2[_0xd9e4('0x47')]);_0x319074[_0xd9e4('0x49')]=_[_0xd9e4('0x48')](_0x3363f2[_0xd9e4('0x46')],qs[_0xd9e4('0x4a')](_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x4a')]));_0x319074['attributes']=_0x319074[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x319074[_0xd9e4('0x49')]:_0x3363f2['model'];if(!_0x648cb['query'][_0xd9e4('0x69')]('nolimit')){_0x319074[_0xd9e4('0x32')]=qs[_0xd9e4('0x32')](_0x648cb['query']['limit']);_0x319074['offset']=qs['offset'](_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x31')]);}_0x319074['order']=qs[_0xd9e4('0x4e')](_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x4e')]);_0x319074[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_['pick'](_0x648cb[_0xd9e4('0x47')],_0x3363f2[_0xd9e4('0x50')]));_0x319074[_0xd9e4('0x4f')][_0xd9e4('0x65')]=_0xa8ecd7['id'];if(_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x52')]){_0x319074[_0xd9e4('0x4f')]=_['merge'](_0x319074['where'],{'$or':_[_0xd9e4('0x40')](_0x319074[_0xd9e4('0x49')],function(_0x25eb1b){var _0x392b71={};_0x392b71[_0x25eb1b]={'$like':'%'+_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x52')]+'%'};return _0x392b71;})});}_0x319074=_[_0xd9e4('0x53')]({},_0x319074,_0x648cb[_0xd9e4('0x59')]);return db[_0xd9e4('0x70')][_0xd9e4('0x34')]({'where':_0x319074['where']})[_0xd9e4('0x25')](function(_0x482b52){_0x1454fa[_0xd9e4('0x34')]=_0x482b52;if(_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x54')]){_0x319074[_0xd9e4('0x55')]=[{'model':db[_0xd9e4('0x73')],'as':_0xd9e4('0x74'),'required':![]},{'model':db['User'],'as':_0xd9e4('0x75'),'attributes':[_0xd9e4('0x3b'),_0xd9e4('0x76'),_0xd9e4('0x77')],'required':![]},{'model':db['Tag'],'as':_0xd9e4('0x78'),'attributes':['id','name','color'],'where':_0x648cb['query'][_0xd9e4('0x79')]?{'id':_0x648cb[_0xd9e4('0x47')][_0xd9e4('0x79')]}:undefined,'required':_0x648cb[_0xd9e4('0x47')]['tag']?!![]:![]}];}return db[_0xd9e4('0x70')][_0xd9e4('0x56')](_0x319074);})[_0xd9e4('0x25')](function(_0x5e7cef){_0x1454fa[_0xd9e4('0x57')]=_0x5e7cef;return _0x1454fa;});}})['then'](respondWithFilteredResult(_0x4c6c8f,_0x319074))[_0xd9e4('0x2d')](handleError(_0x4c6c8f,null));};exports['addApplications']=function(_0x2b009f,_0x3e885f){var _0x879a28=_0x2b009f[_0xd9e4('0x63')]['id'];var _0x4de41e=_0x2b009f['body'];var _0x47a2f5=0xc8;var _0x38d152=null;return db[_0xd9e4('0x7a')][_0xd9e4('0x7b')]({'isolationLevel':db[_0xd9e4('0x7a')][_0xd9e4('0x7c')][_0xd9e4('0x7d')][_0xd9e4('0x7e')]},function(_0x45adcc){return db['FaxAccount'][_0xd9e4('0x68')]({'where':{'id':_0x879a28},'transaction':_0x45adcc})[_0xd9e4('0x25')](function(_0x52a0bf){if(_0x52a0bf){return db[_0xd9e4('0x7f')][_0xd9e4('0x37')]({'where':{'FaxAccountId':_0x879a28},'transaction':_0x45adcc})['then'](function(){var _0x5c1fc7=_[_0xd9e4('0x40')](_0x4de41e,function(_0x588b16){_0x588b16['FaxAccountId']=_0x879a28;return _0x588b16;});return db[_0xd9e4('0x7f')]['bulkCreate'](_0x5c1fc7,{'transaction':_0x45adcc});});}else{_0x47a2f5=0x194;_0x38d152=[];}});})[_0xd9e4('0x25')](function(){if(_0x47a2f5!==0x194){return db[_0xd9e4('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x879a28},'order':'priority'})[_0xd9e4('0x25')](function(_0x4c969c){_0x38d152=_0x4c969c;});}})[_0xd9e4('0x2d')](function(_0x510d0d){_0x47a2f5=0x1f4;logger['error'](_0x510d0d['stack']);if(_0x510d0d['name']){delete _0x510d0d[_0xd9e4('0x3b')];}_0x38d152=_0x510d0d;})['finally'](function(){if(_0x38d152===null){_0x3e885f[_0xd9e4('0x39')](_0x47a2f5);}else{if(_0x47a2f5===0x1f4){_0x3e885f[_0xd9e4('0x2f')](_0x47a2f5)[_0xd9e4('0x3c')](_0x38d152);}else{_0x3e885f[_0xd9e4('0x2f')](_0x47a2f5)[_0xd9e4('0x30')](_0x38d152);}}});};exports[_0xd9e4('0x80')]=function(_0x5b12bb,_0x31d4e2,_0x24d5e0){var _0x5d5ac8={};var _0x1b60ef={};var _0x5546fb;var _0x5db3d0;return db[_0xd9e4('0x41')][_0xd9e4('0x68')]({'where':{'id':_0x5b12bb[_0xd9e4('0x63')]['id']}})['then'](handleEntityNotFound(_0x31d4e2,null))[_0xd9e4('0x25')](function(_0x44cacb){if(_0x44cacb){_0x5546fb=_0x44cacb;_0x1b60ef[_0xd9e4('0x46')]=_['keys'](db['FaxApplication'][_0xd9e4('0x42')]);_0x1b60ef[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x5b12bb['query']);_0x1b60ef[_0xd9e4('0x50')]=_[_0xd9e4('0x48')](_0x1b60ef[_0xd9e4('0x46')],_0x1b60ef[_0xd9e4('0x47')]);_0x5d5ac8[_0xd9e4('0x49')]=_['intersection'](_0x1b60ef[_0xd9e4('0x46')],qs[_0xd9e4('0x4a')](_0x5b12bb[_0xd9e4('0x47')][_0xd9e4('0x4a')]));_0x5d5ac8[_0xd9e4('0x49')]=_0x5d5ac8[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x5d5ac8[_0xd9e4('0x49')]:_0x1b60ef['model'];_0x5d5ac8[_0xd9e4('0x4d')]=qs[_0xd9e4('0x4e')](_0x5b12bb[_0xd9e4('0x47')][_0xd9e4('0x4e')]);_0x5d5ac8[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_[_0xd9e4('0x51')](_0x5b12bb['query'],_0x1b60ef[_0xd9e4('0x50')]));if(_0x5b12bb['query'][_0xd9e4('0x52')]){_0x5d5ac8[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x5d5ac8[_0xd9e4('0x4f')],{'$or':_[_0xd9e4('0x40')](_0x5d5ac8[_0xd9e4('0x49')],function(_0x440507){var _0x441110={};_0x441110[_0x440507]={'$like':'%'+_0x5b12bb['query'][_0xd9e4('0x52')]+'%'};return _0x441110;})});}_0x5d5ac8=_['merge']({},_0x5d5ac8,_0x5b12bb[_0xd9e4('0x59')]);return _0x5546fb[_0xd9e4('0x80')](_0x5d5ac8);}})[_0xd9e4('0x25')](function(_0xb668b8){if(_0xb668b8){_0x5db3d0=_0xb668b8[_0xd9e4('0x4b')];if(!_0x5b12bb[_0xd9e4('0x47')][_0xd9e4('0x69')](_0xd9e4('0x4c'))){_0x5d5ac8[_0xd9e4('0x32')]=qs[_0xd9e4('0x32')](_0x5b12bb[_0xd9e4('0x47')]['limit']);_0x5d5ac8[_0xd9e4('0x31')]=qs[_0xd9e4('0x31')](_0x5b12bb[_0xd9e4('0x47')][_0xd9e4('0x31')]);}return _0x5546fb[_0xd9e4('0x80')](_0x5d5ac8);}})[_0xd9e4('0x25')](function(_0x201710){if(_0x201710){return _0x201710?{'count':_0x5db3d0,'rows':_0x201710}:null;}})['then'](respondWithResult(_0x31d4e2,null))['catch'](handleError(_0x31d4e2,null));};function Extension(_0x4ae17b,_0x346925,_0x22f882,_0x5d6d86){this[_0xd9e4('0x81')]=_0xd9e4('0x82');this[_0xd9e4('0x83')]=_0x4ae17b[_0xd9e4('0x84')];this[_0xd9e4('0x85')]=_0x5d6d86;this[_0xd9e4('0x44')]=_0xd9e4('0x86');this[_0xd9e4('0x87')]=_0xd9e4('0x88');this[_0xd9e4('0x65')]=_0x4ae17b['id'];this[_0xd9e4('0x89')]=_0x346925;this[_0xd9e4('0x8a')]=_0x22f882;}function createExtensionsReciveFax(_0x46cf26){var _0x17d153=0x1;var _0x1cb3dd=[];_0x1cb3dd[_0xd9e4('0x8b')](new Extension(_0x46cf26,_0x17d153,'',_0xd9e4('0x8c')));_0x17d153+=0x1;_0x1cb3dd[_0xd9e4('0x8b')](new Extension(_0x46cf26,_0x17d153,_0xd9e4('0x8d'),'Set'));_0x17d153+=0x1;for(var _0x409eb8 in _0x46cf26){if(_0x46cf26[_0xd9e4('0x69')](_0x409eb8)&&(_0x409eb8===_0xd9e4('0x8e')||_0x409eb8===_0xd9e4('0x84')||_0x409eb8==='gateway'||_0x409eb8==='faxdetect'||_0x409eb8===_0xd9e4('0x8f')||_0x409eb8===_0xd9e4('0x90')||_0x409eb8===_0xd9e4('0x91')||_0x409eb8===_0xd9e4('0x92')||_0x409eb8===_0xd9e4('0x93'))){_0x1cb3dd[_0xd9e4('0x8b')](new Extension(_0x46cf26,_0x17d153,'FAXOPT('+_0x409eb8+')='+_0x46cf26[_0x409eb8],_0xd9e4('0x94')));_0x17d153+=0x1;}}_0x1cb3dd['push'](new Extension(_0x46cf26,_0x17d153,'6','Wait'));_0x17d153+=0x1;_0x1cb3dd[_0xd9e4('0x8b')](new Extension(_0x46cf26,_0x17d153,'/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',_0xd9e4('0x95')));_0x17d153=0x0;return _0x1cb3dd;}exports[_0xd9e4('0x96')]=function(_0xd3ed19,_0x1e9118,_0x372507){var _0x594aaa;return db[_0xd9e4('0x7a')][_0xd9e4('0x7b')](function(_0x313418){return db['FaxAccount']['create'](_0xd3ed19[_0xd9e4('0x62')],{'transaction':_0x313418})[_0xd9e4('0x25')](function(_0x2c35ef){_0x594aaa=_0x2c35ef['get']({'plain':!![]});return db['VoiceExtension'][_0xd9e4('0x97')](createExtensionsReciveFax(_0x594aaa),{'transaction':_0x313418});});})['then'](function(){return _0x594aaa;})[_0xd9e4('0x25')](respondWithResult(_0x1e9118,null))[_0xd9e4('0x2d')](handleError(_0x1e9118,null));};exports[_0xd9e4('0x98')]=function(_0x5e166a,_0xfff59b,_0x346bff){var _0x38e2c1;return db[_0xd9e4('0x7a')][_0xd9e4('0x7b')](function(_0x32b56d){return db['FaxAccount'][_0xd9e4('0x99')](_0x5e166a['body'],{'where':{'id':_0x5e166a[_0xd9e4('0x62')]['id']},'transaction':_0x32b56d})['then'](function(_0x482b4c){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x5e166a['body']['id']},'transaction':_0x32b56d})[_0xd9e4('0x25')](function(_0x46f887){return db['VoiceExtension'][_0xd9e4('0x97')](createExtensionsReciveFax(_[_0xd9e4('0x71')](_0x5e166a['body'],[_0xd9e4('0x9a'),_0xd9e4('0x45'),_0xd9e4('0x9b'),_0xd9e4('0x9c'),_0xd9e4('0x9d'),_0xd9e4('0x9e')])),{'transaction':_0x32b56d});});});})[_0xd9e4('0x25')](function(){return db[_0xd9e4('0x41')][_0xd9e4('0x9f')](_0x5e166a[_0xd9e4('0x62')]['id']);})[_0xd9e4('0x25')](respondWithResult(_0xfff59b,null))['catch'](handleError(_0xfff59b,null));};exports['getMessages']=function(_0x539f6f,_0x3c6633,_0x50dfc6){var _0x46d38d={'raw':!![],'where':{}};var _0x14b828={};var _0x1c1299={'count':0x0,'rows':[]};return db[_0xd9e4('0x41')][_0xd9e4('0x68')]({'where':{'id':_0x539f6f['params']['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x3c6633,null))[_0xd9e4('0x25')](function(_0x2f228d){if(_0x2f228d){_0x14b828[_0xd9e4('0x46')]=_[_0xd9e4('0x58')](db[_0xd9e4('0xa0')][_0xd9e4('0x42')]);_0x14b828[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x539f6f[_0xd9e4('0x47')]);_0x14b828['filters']=_[_0xd9e4('0x48')](_0x14b828[_0xd9e4('0x46')],_0x14b828[_0xd9e4('0x47')]);_0x46d38d[_0xd9e4('0x49')]=_[_0xd9e4('0x48')](_0x14b828[_0xd9e4('0x46')],qs[_0xd9e4('0x4a')](_0x539f6f['query'][_0xd9e4('0x4a')]));_0x46d38d['attributes']=_0x46d38d[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x46d38d[_0xd9e4('0x49')]:_0x14b828[_0xd9e4('0x46')];if(!_0x539f6f[_0xd9e4('0x47')][_0xd9e4('0x69')](_0xd9e4('0x4c'))){_0x46d38d[_0xd9e4('0x32')]=qs['limit'](_0x539f6f[_0xd9e4('0x47')][_0xd9e4('0x32')]);_0x46d38d[_0xd9e4('0x31')]=qs[_0xd9e4('0x31')](_0x539f6f[_0xd9e4('0x47')][_0xd9e4('0x31')]);}_0x46d38d['order']=qs[_0xd9e4('0x4e')](_0x539f6f['query'][_0xd9e4('0x4e')]);_0x46d38d['where']=qs[_0xd9e4('0x50')](_['pick'](_0x539f6f[_0xd9e4('0x47')],_0x14b828['filters']));_0x46d38d['where'][_0xd9e4('0x65')]=_0x2f228d['id'];if(_0x539f6f[_0xd9e4('0x47')][_0xd9e4('0x52')]){_0x46d38d[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x46d38d['where'],{'$or':_['map'](_0x46d38d['attributes'],function(_0x50636f){var _0x4e70fb={};_0x4e70fb[_0x50636f]={'$like':'%'+_0x539f6f['query'][_0xd9e4('0x52')]+'%'};return _0x4e70fb;})});}if(_0x539f6f['query'][_0xd9e4('0xa1')]){var _0x5426d8=_0x539f6f[_0xd9e4('0x47')]['$gte'][_0xd9e4('0xa2')](',');var _0x36fcec={};_0x36fcec[_0x5426d8[0x0]]={'$gte':moment(_0x5426d8[0x1])[_0xd9e4('0xa3')](_0xd9e4('0xa4'))};_0x46d38d[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x46d38d[_0xd9e4('0x4f')],_0x36fcec);}_0x46d38d=_['merge']({},_0x46d38d,_0x539f6f[_0xd9e4('0x59')]);return db['FaxMessage'][_0xd9e4('0x34')]({'where':_0x46d38d[_0xd9e4('0x4f')]})[_0xd9e4('0x25')](function(_0x2a52a2){_0x1c1299[_0xd9e4('0x34')]=_0x2a52a2;if(_0x539f6f['query'][_0xd9e4('0x54')]){_0x46d38d[_0xd9e4('0x55')]=[{'all':!![]}];}return db[_0xd9e4('0xa0')][_0xd9e4('0x56')](_0x46d38d);})[_0xd9e4('0x25')](function(_0x342bf2){_0x1c1299['rows']=_0x342bf2;return _0x1c1299;});}})[_0xd9e4('0x25')](respondWithFilteredResult(_0x3c6633,_0x46d38d))[_0xd9e4('0x2d')](handleError(_0x3c6633,null));};exports['send']=function(_0x44ccef,_0x54f2f9,_0x3a5080){var _0x5b4746,_0x2e7d57={},_0x484bbe;if(_0x44ccef['body']['to']){_0x484bbe=_0x44ccef['body']['to'][0x0];}return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x44ccef['params']['id']},'include':[{'model':db[_0xd9e4('0xa5')],'as':_0xd9e4('0xa6'),'include':[{'model':db[_0xd9e4('0x73')],'as':_0xd9e4('0xa7'),'where':{'fax':_0x484bbe},'limit':0x1,'order':[[_0xd9e4('0x9c'),'DESC']]}]}]})[_0xd9e4('0x25')](handleEntityNotFound(_0x54f2f9,null))['then'](function(_0x6443){_0x5b4746=_0x6443;if(_0x44ccef[_0xd9e4('0x62')]['attachments']&&_0x44ccef[_0xd9e4('0x62')]['attachments'][_0xd9e4('0x4b')]){for(var _0x3fe962=0x0;_0x3fe962<_0x44ccef[_0xd9e4('0x62')]['attachments'][_0xd9e4('0x4b')];_0x3fe962+=0x1){_0x44ccef['body'][_0xd9e4('0xa8')][_0x3fe962]={'filename':_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][_0x3fe962][_0xd9e4('0x3b')],'id':_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][_0x3fe962]['id'],'path':path[_0xd9e4('0xa9')](config[_0xd9e4('0xaa')],_0xd9e4('0xab'),_0x44ccef[_0xd9e4('0x62')]['attachments'][_0x3fe962][_0xd9e4('0xac')])};}}return respondWithRpcPromise(_0xd9e4('0xad'),_0xd9e4('0xad'),{'FaxAccountId':_[_0xd9e4('0xae')](_0x44ccef['params']['id'])?undefined:_0x44ccef[_0xd9e4('0x63')]['id'],'path':_[_0xd9e4('0xae')](_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0][_0xd9e4('0x8')])?undefined:_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0][_0xd9e4('0x8')],'fax':_[_0xd9e4('0xae')](_0x44ccef[_0xd9e4('0x62')]['to'][0x0])?undefined:_0x44ccef[_0xd9e4('0x62')]['to'][0x0]},client9002);})[_0xd9e4('0x25')](function(){if(_0x5b4746){if(_[_0xd9e4('0xae')](_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xaf')])){_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xaf')]=util['format'](_0xd9e4('0xb0'),_0x5b4746[_0xd9e4('0x3b')],_0x5b4746[_0xd9e4('0xb1')]);}if(_0x5b4746['List']){if(_0x5b4746[_0xd9e4('0xa6')][_0xd9e4('0xa7')]['length']){return _0x5b4746[_0xd9e4('0xa6')][_0xd9e4('0xa7')][0x0];}else{return db[_0xd9e4('0x73')][_0xd9e4('0x5b')](_['defaults'](_0x44ccef[_0xd9e4('0x62')],{'firstName':_0x44ccef['body']['to'][0x0],'phone':_0x44ccef[_0xd9e4('0x62')]['to'][0x0],'fax':_0x44ccef[_0xd9e4('0x62')]['to'][0x0],'ListId':_0x5b4746['ListId']}));}}else{throw new Error(_0xd9e4('0xb2'));}}else{throw new Error(_0xd9e4('0xb3'));}})[_0xd9e4('0x25')](function(_0x104703){if(_0x104703){return db[_0xd9e4('0x70')][_0xd9e4('0x5a')]({'where':{'ContactId':_0x104703['id'],'closed':![],'FaxAccountId':_0x5b4746['id']}})[_0xd9e4('0x25')](function(_0x2b8fdc){if(_0x2b8fdc){return[_0x2b8fdc,![]];}return db[_0xd9e4('0x70')][_0xd9e4('0x5b')]({'UserId':_0x44ccef[_0xd9e4('0xb4')]['id'],'ContactId':_0x104703['id'],'FaxAccountId':_0x5b4746['id'],'fax':_0x44ccef['body']['to'][0x0],'firstMsgDirection':_0xd9e4('0xb5'),'Messages':[_[_0xd9e4('0x53')](_0x44ccef['body'],{'read':![],'body':_0x44ccef['body'][_0xd9e4('0xa8')][0x0][_0xd9e4('0xb6')],'FaxAccountId':_0x5b4746['id'],'UserId':_0x44ccef[_0xd9e4('0xb4')]['id'],'ContactId':_0x104703['id'],'AttachmentId':_0x44ccef['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd9e4('0xa0')],'as':_0xd9e4('0xb7')}]})[_0xd9e4('0x25')](function(_0x38f282){return[_0x38f282,!![]];});});}else{throw new Error(_0xd9e4('0xb8'));}})[_0xd9e4('0xb9')](function(_0x40b56d,_0x1f94c7){if(_0x1f94c7){return _0x40b56d;}return db[_0xd9e4('0xa0')][_0xd9e4('0x5b')]({'direction':_0xd9e4('0xb5'),'read':![],'body':_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0][_0xd9e4('0xb6')],'FaxAccountId':_0x5b4746['id'],'FaxInteractionId':_0x40b56d['id'],'UserId':_0x44ccef[_0xd9e4('0xb4')]['id'],'ContactId':_0x40b56d[_0xd9e4('0xba')],'AttachmentId':_0x44ccef['body']['attachments'][0x0]['id']})['then'](function(_0x28f571){_0x40b56d[_0xd9e4('0xbb')][_0xd9e4('0xb7')]=[];_0x40b56d[_0xd9e4('0xbb')]['Messages']['push'](_0x28f571['dataValues']);return _0x40b56d;});})['then'](function(_0x5b8e27){respondWithRpcPromise(_0xd9e4('0xbc'),_0xd9e4('0xbc'),{'FaxAccountId':_[_0xd9e4('0xae')](_0x44ccef['params']['id'])?undefined:_0x44ccef[_0xd9e4('0x63')]['id'],'path':_[_0xd9e4('0xae')](_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0][_0xd9e4('0x8')])?undefined:_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0][_0xd9e4('0x8')],'fax':_[_0xd9e4('0xae')](_0x44ccef[_0xd9e4('0x62')]['to'][0x0])?undefined:_0x44ccef[_0xd9e4('0x62')]['to'][0x0],'AttachmentId':_0x44ccef[_0xd9e4('0x62')][_0xd9e4('0xa8')][0x0]['id']},client9002)[_0xd9e4('0x25')](function(_0x2bd865){logger[_0xd9e4('0x26')](_0xd9e4('0xbd'),_0x2bd865);})['catch'](function(_0x51eef1){logger[_0xd9e4('0x26')]('SendFaxRpc,\x20%s',_0x51eef1);});return _0x5b8e27;})['then'](respondWithResult(_0x54f2f9,null))[_0xd9e4('0x2d')](handleError(_0x54f2f9,null));};exports[_0xd9e4('0xbe')]=function(_0x1a1ebc,_0x487970,_0x21f870){return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x1a1ebc[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x487970,null))[_0xd9e4('0x25')](function(_0x57ecb8){if(_0x57ecb8){return _0x57ecb8[_0xd9e4('0xbe')](_0x1a1ebc[_0xd9e4('0x62')][_0xd9e4('0x6b')],_[_0xd9e4('0x71')](_0x1a1ebc['body'],[_0xd9e4('0x6b'),'id'])||{})[_0xd9e4('0xb9')](function(_0x3f42dd){for(var _0x3b2d48=0x0;_0x3b2d48<_0x1a1ebc[_0xd9e4('0x62')]['ids'][_0xd9e4('0x4b')];_0x3b2d48+=0x1){socket[_0xd9e4('0xbf')](_0xd9e4('0xc0'),{'UserId':Number(_0x1a1ebc[_0xd9e4('0x62')][_0xd9e4('0x6b')][_0x3b2d48]),'FaxAccountId':Number(_0x1a1ebc[_0xd9e4('0x63')]['id'])});}return _0x3f42dd;});}})[_0xd9e4('0x25')](respondWithResult(_0x487970,null))['catch'](handleError(_0x487970,null));};exports['removeAgents']=function(_0x1c5070,_0xa3adde,_0x58b0b2){return db[_0xd9e4('0x41')][_0xd9e4('0x5a')]({'where':{'id':_0x1c5070['params']['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0xa3adde,null))[_0xd9e4('0x25')](function(_0x93f80f){if(_0x93f80f){return _0x93f80f[_0xd9e4('0xc1')](_0x1c5070['query']['ids'])['then'](function(){if(_['isArray'](_0x1c5070[_0xd9e4('0x47')][_0xd9e4('0x6b')])){for(var _0x5803d3=0x0;_0x5803d3<_0x1c5070[_0xd9e4('0x47')][_0xd9e4('0x6b')][_0xd9e4('0x4b')];_0x5803d3+=0x1){socket[_0xd9e4('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x1c5070[_0xd9e4('0x47')][_0xd9e4('0x6b')][_0x5803d3]),'FaxAccountId':Number(_0x1c5070[_0xd9e4('0x63')]['id'])});}}else{socket[_0xd9e4('0xbf')](_0xd9e4('0xc2'),{'UserId':Number(_0x1c5070[_0xd9e4('0x47')][_0xd9e4('0x6b')]),'FaxAccountId':Number(_0x1c5070[_0xd9e4('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0xa3adde,null))[_0xd9e4('0x2d')](handleError(_0xa3adde,null));};exports[_0xd9e4('0xc3')]=function(_0x21943c,_0x99a6fa,_0x1a1206){var _0x248c42={};var _0x217583={};var _0x433f51;var _0x2bad4b;return db[_0xd9e4('0x41')]['findOne']({'where':{'id':_0x21943c[_0xd9e4('0x63')]['id']}})[_0xd9e4('0x25')](handleEntityNotFound(_0x99a6fa,null))['then'](function(_0x288f21){if(_0x288f21){_0x433f51=_0x288f21;_0x217583['model']=_[_0xd9e4('0x58')](db[_0xd9e4('0xc4')][_0xd9e4('0x42')]);_0x217583[_0xd9e4('0x47')]=_[_0xd9e4('0x58')](_0x21943c['query']);_0x217583[_0xd9e4('0x50')]=_['intersection'](_0x217583[_0xd9e4('0x46')],_0x217583[_0xd9e4('0x47')]);_0x248c42[_0xd9e4('0x49')]=_['intersection'](_0x217583['model'],qs[_0xd9e4('0x4a')](_0x21943c['query'][_0xd9e4('0x4a')]));_0x248c42['attributes']=_0x248c42[_0xd9e4('0x49')][_0xd9e4('0x4b')]?_0x248c42[_0xd9e4('0x49')]:_0x217583[_0xd9e4('0x46')];_0x248c42[_0xd9e4('0x4d')]=qs[_0xd9e4('0x4e')](_0x21943c[_0xd9e4('0x47')][_0xd9e4('0x4e')]);_0x248c42[_0xd9e4('0x4f')]=qs[_0xd9e4('0x50')](_[_0xd9e4('0x51')](_0x21943c[_0xd9e4('0x47')],_0x217583[_0xd9e4('0x50')]));if(_0x21943c[_0xd9e4('0x47')][_0xd9e4('0x52')]){_0x248c42[_0xd9e4('0x4f')]=_[_0xd9e4('0x53')](_0x248c42['where'],{'$or':_[_0xd9e4('0x40')](_0x248c42['attributes'],function(_0x2bfd34){var _0x543640={};_0x543640[_0x2bfd34]={'$like':'%'+_0x21943c[_0xd9e4('0x47')][_0xd9e4('0x52')]+'%'};return _0x543640;})});}_0x248c42=_[_0xd9e4('0x53')]({},_0x248c42,_0x21943c[_0xd9e4('0x59')]);return _0x433f51['getAgents'](_0x248c42);}})['then'](function(_0x2f3633){if(_0x2f3633){_0x2bad4b=_0x2f3633['length'];if(!_0x21943c[_0xd9e4('0x47')][_0xd9e4('0x69')](_0xd9e4('0x4c'))){_0x248c42['limit']=qs['limit'](_0x21943c['query'][_0xd9e4('0x32')]);_0x248c42[_0xd9e4('0x31')]=qs['offset'](_0x21943c['query']['offset']);}return _0x433f51[_0xd9e4('0xc3')](_0x248c42);}})[_0xd9e4('0x25')](function(_0x2fa880){if(_0x2fa880){return _0x2fa880?{'count':_0x2bad4b,'rows':_0x2fa880}:null;}})[_0xd9e4('0x25')](respondWithResult(_0x99a6fa,null))[_0xd9e4('0x2d')](handleError(_0x99a6fa,null));}; \ No newline at end of file +var _0x68c1=['emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','priority','getApplications','context','from-voip-provider','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','TrunkId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','Contacts','updatedAt','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents'];(function(_0x27b4db,_0x4a8c6c){var _0xe54abf=function(_0x1129dc){while(--_0x1129dc){_0x27b4db['push'](_0x27b4db['shift']());}};_0xe54abf(++_0x4a8c6c);}(_0x68c1,0x18c));var _0x168c=function(_0xa261f5,_0x37ed4e){_0xa261f5=_0xa261f5-0x0;var _0x4a889b=_0x68c1[_0xa261f5];return _0x4a889b;};'use strict';var emlformat=require(_0x168c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x168c('0x1'));var jsonpatch=require(_0x168c('0x2'));var rp=require('request-promise');var moment=require(_0x168c('0x3'));var BPromise=require(_0x168c('0x4'));var Mustache=require(_0x168c('0x5'));var util=require(_0x168c('0x6'));var path=require(_0x168c('0x7'));var sox=require('sox');var csv=require(_0x168c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x168c('0x9'));var _=require(_0x168c('0xa'));var squel=require(_0x168c('0xb'));var crypto=require(_0x168c('0xc'));var jsforce=require(_0x168c('0xd'));var deskjs=require(_0x168c('0xe'));var toCsv=require(_0x168c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x168c('0xf'));var qs=require(_0x168c('0x10'));var as=require(_0x168c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x168c('0x12'))(_0x168c('0x13'));var utils=require(_0x168c('0x14'));var config=require(_0x168c('0x15'));var licenseUtil=require(_0x168c('0x16'));var db=require(_0x168c('0x17'))['db'];config[_0x168c('0x18')]=_[_0x168c('0x19')](config[_0x168c('0x18')],{'host':_0x168c('0x1a'),'port':0x18eb});var socket=require(_0x168c('0x1b'))(new Redis(config[_0x168c('0x18')]));require(_0x168c('0x1c'))['register'](socket);var jayson=require(_0x168c('0x1d'));var client=jayson[_0x168c('0x1e')][_0x168c('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x168c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4c5ea3,_0x494e5e,_0x1806e2,_0x19b483){return new BPromise(function(_0x2ad4d2,_0x2e153c){var _0x2f29d9=_0x19b483||client;return _0x2f29d9['request'](_0x4c5ea3,_0x1806e2)[_0x168c('0x20')](function(_0x2ed9c0){logger['info'](_0x168c('0x21'),_0x494e5e,_0x168c('0x22'));logger['debug'](_0x168c('0x23'),_0x494e5e,'request\x20sent',JSON[_0x168c('0x24')](_0x2ed9c0));if(_0x2ed9c0['error']){if(_0x2ed9c0[_0x168c('0x25')][_0x168c('0x26')]===0x1f4){logger[_0x168c('0x25')]('FaxAccount,\x20%s,\x20%s',_0x494e5e,_0x2ed9c0[_0x168c('0x25')]['message']);return _0x2e153c(_0x2ed9c0[_0x168c('0x25')][_0x168c('0x27')]);}logger[_0x168c('0x25')](_0x168c('0x21'),_0x494e5e,_0x2ed9c0[_0x168c('0x25')][_0x168c('0x27')]);return _0x2ad4d2(_0x2ed9c0[_0x168c('0x25')][_0x168c('0x27')]);}else{logger[_0x168c('0x28')](_0x168c('0x21'),_0x494e5e,_0x168c('0x22'));_0x2ad4d2(_0x2ed9c0[_0x168c('0x29')][_0x168c('0x27')]);}})[_0x168c('0x2a')](function(_0x51d13e){logger[_0x168c('0x25')](_0x168c('0x21'),_0x494e5e,_0x51d13e);_0x2e153c(_0x51d13e);});});}function respondWithStatusCode(_0x2c1595,_0x4bb26b){_0x4bb26b=_0x4bb26b||0xcc;return function(_0x57a7b3){if(_0x57a7b3){return _0x2c1595[_0x168c('0x2b')](_0x4bb26b);}return _0x2c1595[_0x168c('0x2c')](_0x4bb26b)[_0x168c('0x2d')]();};}function respondWithResult(_0x500dbf,_0x271348){_0x271348=_0x271348||0xc8;return function(_0x5df298){if(_0x5df298){return _0x500dbf[_0x168c('0x2c')](_0x271348)[_0x168c('0x2e')](_0x5df298);}};}function respondWithFilteredResult(_0x5ad610,_0x336514){return function(_0x36272b){if(_0x36272b){var _0x535b1d=typeof _0x336514[_0x168c('0x2f')]===_0x168c('0x30')&&typeof _0x336514[_0x168c('0x31')]===_0x168c('0x30');var _0x1c31b6=_0x36272b[_0x168c('0x32')];var _0x19e3a1=_0x535b1d?0x0:_0x336514[_0x168c('0x2f')];var _0x437b94=_0x535b1d?_0x36272b[_0x168c('0x32')]:_0x336514['offset']+_0x336514['limit'];var _0x3b15fb;if(_0x437b94>=_0x1c31b6){_0x437b94=_0x1c31b6;_0x3b15fb=0xc8;}else{_0x3b15fb=0xce;}_0x5ad610[_0x168c('0x2c')](_0x3b15fb);return _0x5ad610[_0x168c('0x33')](_0x168c('0x34'),_0x19e3a1+'-'+_0x437b94+'/'+_0x1c31b6)[_0x168c('0x2e')](_0x36272b);}return null;};}function patchUpdates(_0x27ffdb){return function(_0x49c1fe){try{jsonpatch[_0x168c('0x35')](_0x49c1fe,_0x27ffdb,!![]);}catch(_0xd865b9){return BPromise['reject'](_0xd865b9);}return _0x49c1fe['save']();};}function saveUpdates(_0x29c292,_0x2a9e96){return function(_0x511644){if(_0x511644){return _0x511644[_0x168c('0x36')](_0x29c292)['then'](function(_0x3b8795){return _0x3b8795;});}return null;};}function removeEntity(_0x50f498,_0x11f279){return function(_0x51bdaf){if(_0x51bdaf){return _0x51bdaf[_0x168c('0x37')]()['then'](function(){var _0x5ee461=_0x51bdaf[_0x168c('0x38')]({'plain':!![]});var _0x27566d=_0x168c('0x39');return db[_0x168c('0x3a')][_0x168c('0x37')]({'where':{'type':_0x27566d,'resourceId':_0x5ee461['id']}})[_0x168c('0x20')](function(){return _0x51bdaf;});})[_0x168c('0x20')](function(){_0x50f498[_0x168c('0x2c')](0xcc)[_0x168c('0x2d')]();});}};}function handleEntityNotFound(_0x18f5f7,_0x124ad0){return function(_0xd3d152){if(!_0xd3d152){_0x18f5f7[_0x168c('0x2b')](0x194);}return _0xd3d152;};}function handleError(_0x396ff9,_0x4a27f6){_0x4a27f6=_0x4a27f6||0x1f4;return function(_0x300901){logger[_0x168c('0x25')](_0x300901[_0x168c('0x3b')]);if(_0x300901[_0x168c('0x3c')]){delete _0x300901['name'];}_0x396ff9['status'](_0x4a27f6)[_0x168c('0x3d')](_0x300901);};}exports[_0x168c('0x3e')]=function(_0x1b10a0,_0x18053f){var _0x228f44={'include':[{'model':db[_0x168c('0x3f')],'as':_0x168c('0x40')}]},_0x155a3d={},_0x15cede={'count':0x0,'rows':[]};var _0x2c6dbc=_[_0x168c('0x41')](db[_0x168c('0x42')][_0x168c('0x43')],function(_0xf7bde6){return{'name':_0xf7bde6[_0x168c('0x44')],'type':_0xf7bde6[_0x168c('0x45')]['key']};});_0x155a3d[_0x168c('0x46')]=_[_0x168c('0x41')](_0x2c6dbc,_0x168c('0x3c'));_0x155a3d[_0x168c('0x47')]=_[_0x168c('0x48')](_0x1b10a0[_0x168c('0x47')]);_0x155a3d[_0x168c('0x49')]=_['intersection'](_0x155a3d[_0x168c('0x46')],_0x155a3d[_0x168c('0x47')]);_0x228f44['attributes']=_[_0x168c('0x4a')](_0x155a3d[_0x168c('0x46')],qs[_0x168c('0x4b')](_0x1b10a0[_0x168c('0x47')][_0x168c('0x4b')]));_0x228f44[_0x168c('0x4c')]=_0x228f44[_0x168c('0x4c')]['length']?_0x228f44[_0x168c('0x4c')]:_0x155a3d[_0x168c('0x46')];if(!_0x1b10a0['query'][_0x168c('0x4d')](_0x168c('0x4e'))){_0x228f44[_0x168c('0x31')]=qs[_0x168c('0x31')](_0x1b10a0[_0x168c('0x47')]['limit']);_0x228f44[_0x168c('0x2f')]=qs[_0x168c('0x2f')](_0x1b10a0['query'][_0x168c('0x2f')]);}_0x228f44[_0x168c('0x4f')]=qs['sort'](_0x1b10a0[_0x168c('0x47')][_0x168c('0x50')]);_0x228f44[_0x168c('0x51')]=qs[_0x168c('0x49')](_[_0x168c('0x52')](_0x1b10a0[_0x168c('0x47')],_0x155a3d[_0x168c('0x49')]),_0x2c6dbc);if(_0x1b10a0[_0x168c('0x47')][_0x168c('0x53')]){_0x228f44[_0x168c('0x51')]=_[_0x168c('0x54')](_0x228f44[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0x2c6dbc,function(_0x164c1c){if(_0x164c1c['type']!==_0x168c('0x55')){var _0x5e10d2={};_0x5e10d2[_0x164c1c[_0x168c('0x3c')]]={'$like':'%'+_0x1b10a0[_0x168c('0x47')][_0x168c('0x53')]+'%'};return _0x5e10d2;}})});}_0x228f44=_[_0x168c('0x54')]({},_0x228f44,_0x1b10a0['options']);var _0x5038ed={'where':_0x228f44[_0x168c('0x51')]};return db['FaxAccount'][_0x168c('0x32')](_0x5038ed)[_0x168c('0x20')](function(_0x3b09db){_0x15cede[_0x168c('0x32')]=_0x3b09db;if(_0x1b10a0[_0x168c('0x47')][_0x168c('0x56')]){_0x228f44['include']=[{'all':!![]}];}return db['FaxAccount'][_0x168c('0x57')](_0x228f44);})[_0x168c('0x20')](function(_0x5063ff){_0x15cede[_0x168c('0x58')]=_0x5063ff;return _0x15cede;})[_0x168c('0x20')](respondWithFilteredResult(_0x18053f,_0x228f44))['catch'](handleError(_0x18053f,null));};exports['show']=function(_0xe60c59,_0x3f6a6c){var _0x4204c2={'raw':![],'where':{'id':_0xe60c59['params']['id']},'include':[{'model':db[_0x168c('0x3f')],'as':_0x168c('0x40')}]},_0x1f1065={};_0x1f1065[_0x168c('0x46')]=_['keys'](db[_0x168c('0x42')][_0x168c('0x43')]);_0x1f1065[_0x168c('0x47')]=_[_0x168c('0x48')](_0xe60c59[_0x168c('0x47')]);_0x1f1065[_0x168c('0x49')]=_[_0x168c('0x4a')](_0x1f1065[_0x168c('0x46')],_0x1f1065[_0x168c('0x47')]);_0x4204c2[_0x168c('0x4c')]=_['intersection'](_0x1f1065['model'],qs[_0x168c('0x4b')](_0xe60c59[_0x168c('0x47')][_0x168c('0x4b')]));_0x4204c2[_0x168c('0x4c')]=_0x4204c2['attributes'][_0x168c('0x59')]?_0x4204c2['attributes']:_0x1f1065[_0x168c('0x46')];if(_0xe60c59['query'][_0x168c('0x56')]){_0x4204c2[_0x168c('0x5a')]=[{'all':!![]}];}_0x4204c2=_[_0x168c('0x54')]({},_0x4204c2,_0xe60c59[_0x168c('0x5b')]);return db[_0x168c('0x42')][_0x168c('0x5c')](_0x4204c2)[_0x168c('0x20')](handleEntityNotFound(_0x3f6a6c,null))[_0x168c('0x20')](respondWithResult(_0x3f6a6c,null))['catch'](handleError(_0x3f6a6c,null));};exports[_0x168c('0x5d')]=function(_0x243109,_0x3ba010){return db[_0x168c('0x42')]['create'](_0x243109[_0x168c('0x5e')],{})[_0x168c('0x20')](function(_0x500dcf){var _0x1810bd=_0x243109[_0x168c('0x5f')][_0x168c('0x38')]({'plain':!![]});if(!_0x1810bd)throw new Error(_0x168c('0x60'));if(_0x1810bd[_0x168c('0x61')]===_0x168c('0x5f')){var _0x354149=_0x500dcf[_0x168c('0x38')]({'plain':!![]});var _0x4b49da=_0x168c('0x39');return db[_0x168c('0x62')][_0x168c('0x5c')]({'where':{'name':_0x4b49da,'userProfileId':_0x1810bd[_0x168c('0x63')]},'raw':!![]})[_0x168c('0x20')](function(_0x1f4db8){if(_0x1f4db8&&_0x1f4db8[_0x168c('0x64')]===0x0){return db[_0x168c('0x3a')][_0x168c('0x5d')]({'name':_0x354149[_0x168c('0x3c')],'resourceId':_0x354149['id'],'type':_0x1f4db8[_0x168c('0x3c')],'sectionId':_0x1f4db8['id']},{})['then'](function(){return _0x500dcf;});}else{return _0x500dcf;}})[_0x168c('0x2a')](function(_0x3eb02d){logger[_0x168c('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eb02d);throw _0x3eb02d;});}return _0x500dcf;})[_0x168c('0x20')](respondWithResult(_0x3ba010,0xc9))[_0x168c('0x2a')](handleError(_0x3ba010,null));};exports[_0x168c('0x36')]=function(_0x5edbe1,_0x3e4b40){if(_0x5edbe1[_0x168c('0x5e')]['id']){delete _0x5edbe1[_0x168c('0x5e')]['id'];}return db[_0x168c('0x42')][_0x168c('0x5c')]({'where':{'id':_0x5edbe1[_0x168c('0x65')]['id']},'include':[{'model':db[_0x168c('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x168c('0x20')](handleEntityNotFound(_0x3e4b40,null))[_0x168c('0x20')](saveUpdates(_0x5edbe1[_0x168c('0x5e')],null))[_0x168c('0x20')](respondWithResult(_0x3e4b40,null))[_0x168c('0x2a')](handleError(_0x3e4b40,null));};exports['destroy']=function(_0x2ab78b,_0x528383){return db[_0x168c('0x42')]['find']({'where':{'id':_0x2ab78b[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x528383,null))['then'](removeEntity(_0x528383,null))[_0x168c('0x2a')](handleError(_0x528383,null));};exports[_0x168c('0x66')]=function(_0x3e2ffd,_0x3e15b7){return db[_0x168c('0x42')][_0x168c('0x66')]()[_0x168c('0x20')](respondWithResult(_0x3e15b7,null))[_0x168c('0x2a')](handleError(_0x3e15b7,null));};exports['addDisposition']=function(_0x1bf5aa,_0x142b87,_0x277f0b){if(_0x1bf5aa[_0x168c('0x5e')]['id']){delete _0x1bf5aa['body']['id'];}return db[_0x168c('0x42')][_0x168c('0x5c')]({'where':{'id':_0x1bf5aa[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x142b87,null))[_0x168c('0x20')](function(_0x23c911){if(_0x23c911){_0x1bf5aa[_0x168c('0x5e')][_0x168c('0x67')]=_0x23c911['id'];return db[_0x168c('0x68')][_0x168c('0x5d')](_0x1bf5aa[_0x168c('0x5e')]);}})[_0x168c('0x20')](respondWithResult(_0x142b87,null))['catch'](handleError(_0x142b87,null));};exports[_0x168c('0x69')]=function(_0x3c2ee5,_0x5741d2,_0xd5b100){var _0x1ac656={'raw':![],'where':{}};var _0x1c2544={};var _0x3b4e5e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x168c('0x6a')]({'where':{'id':_0x3c2ee5[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x5741d2,null))[_0x168c('0x20')](function(_0x11b4f3){if(_0x11b4f3){_0x1c2544[_0x168c('0x46')]=_[_0x168c('0x48')](db[_0x168c('0x68')]['rawAttributes']);_0x1c2544[_0x168c('0x47')]=_[_0x168c('0x48')](_0x3c2ee5['query']);_0x1c2544[_0x168c('0x49')]=_[_0x168c('0x4a')](_0x1c2544[_0x168c('0x46')],_0x1c2544['query']);_0x1ac656[_0x168c('0x4c')]=_[_0x168c('0x4a')](_0x1c2544[_0x168c('0x46')],qs[_0x168c('0x4b')](_0x3c2ee5[_0x168c('0x47')][_0x168c('0x4b')]));_0x1ac656[_0x168c('0x4c')]=_0x1ac656[_0x168c('0x4c')]['length']?_0x1ac656[_0x168c('0x4c')]:_0x1c2544[_0x168c('0x46')];if(!_0x3c2ee5[_0x168c('0x47')][_0x168c('0x4d')](_0x168c('0x4e'))){_0x1ac656[_0x168c('0x31')]=qs[_0x168c('0x31')](_0x3c2ee5[_0x168c('0x47')][_0x168c('0x31')]);_0x1ac656[_0x168c('0x2f')]=qs[_0x168c('0x2f')](_0x3c2ee5[_0x168c('0x47')][_0x168c('0x2f')]);}_0x1ac656[_0x168c('0x4f')]=qs[_0x168c('0x50')](_0x3c2ee5['query'][_0x168c('0x50')]);_0x1ac656['where']=qs[_0x168c('0x49')](_[_0x168c('0x52')](_0x3c2ee5['query'],_0x1c2544[_0x168c('0x49')]));_0x1ac656[_0x168c('0x51')][_0x168c('0x67')]=_0x11b4f3['id'];if(_0x3c2ee5[_0x168c('0x47')][_0x168c('0x53')]){_0x1ac656[_0x168c('0x51')]=_[_0x168c('0x54')](_0x1ac656[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0x1ac656[_0x168c('0x4c')],function(_0x3b24dd){var _0x40b3ef={};_0x40b3ef[_0x3b24dd]={'$like':'%'+_0x3c2ee5[_0x168c('0x47')][_0x168c('0x53')]+'%'};return _0x40b3ef;})});}_0x1ac656=_[_0x168c('0x54')]({},_0x1ac656,_0x3c2ee5['options']);return db[_0x168c('0x68')]['count']({'where':_0x1ac656[_0x168c('0x51')]})[_0x168c('0x20')](function(_0x19a489){_0x3b4e5e[_0x168c('0x32')]=_0x19a489;if(_0x3c2ee5[_0x168c('0x47')]['includeAll']){_0x1ac656['include']=[{'all':!![]}];}return db[_0x168c('0x68')][_0x168c('0x57')](_0x1ac656);})[_0x168c('0x20')](function(_0x196fbf){_0x3b4e5e[_0x168c('0x58')]=_0x196fbf;return _0x3b4e5e;});}})[_0x168c('0x20')](respondWithFilteredResult(_0x5741d2,_0x1ac656))['catch'](handleError(_0x5741d2,null));};exports[_0x168c('0x6b')]=function(_0x2c058e,_0x38f787,_0x17ddb3){return db[_0x168c('0x42')][_0x168c('0x5c')]({'where':{'id':_0x2c058e[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x38f787,null))['then'](function(_0x4ab36a){if(_0x4ab36a){return _0x4ab36a[_0x168c('0x6b')](_0x2c058e['query']['ids']);}})['then'](respondWithStatusCode(_0x38f787,null))[_0x168c('0x2a')](handleError(_0x38f787,null));};exports[_0x168c('0x6c')]=function(_0x115a0c,_0xe36657,_0x1193c7){if(_0x115a0c['body']['id']){delete _0x115a0c[_0x168c('0x5e')]['id'];}return db['FaxAccount'][_0x168c('0x5c')]({'where':{'id':_0x115a0c['params']['id']}})[_0x168c('0x20')](handleEntityNotFound(_0xe36657,null))[_0x168c('0x20')](function(_0x2172f6){if(_0x2172f6){_0x115a0c[_0x168c('0x5e')][_0x168c('0x67')]=_0x2172f6['id'];return db['CannedAnswer']['create'](_0x115a0c[_0x168c('0x5e')]);}})[_0x168c('0x20')](respondWithResult(_0xe36657,null))[_0x168c('0x2a')](handleError(_0xe36657,null));};exports[_0x168c('0x6d')]=function(_0x4d584b,_0x251e61,_0x27323d){var _0x2b7d20={'raw':![],'where':{}};var _0x1a2ec2={};var _0x209797={'count':0x0,'rows':[]};return db['FaxAccount'][_0x168c('0x6a')]({'where':{'id':_0x4d584b[_0x168c('0x65')]['id']}})['then'](handleEntityNotFound(_0x251e61,null))['then'](function(_0x17b62d){if(_0x17b62d){_0x1a2ec2[_0x168c('0x46')]=_[_0x168c('0x48')](db[_0x168c('0x6e')][_0x168c('0x43')]);_0x1a2ec2[_0x168c('0x47')]=_[_0x168c('0x48')](_0x4d584b[_0x168c('0x47')]);_0x1a2ec2['filters']=_[_0x168c('0x4a')](_0x1a2ec2[_0x168c('0x46')],_0x1a2ec2[_0x168c('0x47')]);_0x2b7d20[_0x168c('0x4c')]=_[_0x168c('0x4a')](_0x1a2ec2[_0x168c('0x46')],qs[_0x168c('0x4b')](_0x4d584b[_0x168c('0x47')][_0x168c('0x4b')]));_0x2b7d20[_0x168c('0x4c')]=_0x2b7d20[_0x168c('0x4c')][_0x168c('0x59')]?_0x2b7d20[_0x168c('0x4c')]:_0x1a2ec2[_0x168c('0x46')];if(!_0x4d584b['query']['hasOwnProperty'](_0x168c('0x4e'))){_0x2b7d20['limit']=qs[_0x168c('0x31')](_0x4d584b[_0x168c('0x47')][_0x168c('0x31')]);_0x2b7d20[_0x168c('0x2f')]=qs[_0x168c('0x2f')](_0x4d584b[_0x168c('0x47')][_0x168c('0x2f')]);}_0x2b7d20['order']=qs[_0x168c('0x50')](_0x4d584b[_0x168c('0x47')]['sort']);_0x2b7d20['where']=qs['filters'](_['pick'](_0x4d584b[_0x168c('0x47')],_0x1a2ec2[_0x168c('0x49')]));_0x2b7d20[_0x168c('0x51')][_0x168c('0x67')]=_0x17b62d['id'];if(_0x4d584b[_0x168c('0x47')][_0x168c('0x53')]){_0x2b7d20[_0x168c('0x51')]=_[_0x168c('0x54')](_0x2b7d20[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0x2b7d20[_0x168c('0x4c')],function(_0x4730ae){var _0x5243dc={};_0x5243dc[_0x4730ae]={'$like':'%'+_0x4d584b['query'][_0x168c('0x53')]+'%'};return _0x5243dc;})});}_0x2b7d20=_[_0x168c('0x54')]({},_0x2b7d20,_0x4d584b[_0x168c('0x5b')]);return db[_0x168c('0x6e')][_0x168c('0x32')]({'where':_0x2b7d20[_0x168c('0x51')]})['then'](function(_0x5b7b68){_0x209797['count']=_0x5b7b68;if(_0x4d584b[_0x168c('0x47')][_0x168c('0x56')]){_0x2b7d20['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x168c('0x57')](_0x2b7d20);})[_0x168c('0x20')](function(_0x26be20){_0x209797[_0x168c('0x58')]=_0x26be20;return _0x209797;});}})['then'](respondWithFilteredResult(_0x251e61,_0x2b7d20))[_0x168c('0x2a')](handleError(_0x251e61,null));};exports[_0x168c('0x6f')]=function(_0xef92,_0x55969f,_0x46c202){return db['FaxAccount']['find']({'where':{'id':_0xef92[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x55969f,null))[_0x168c('0x20')](function(_0x3bc1cf){if(_0x3bc1cf){return _0x3bc1cf[_0x168c('0x6f')](_0xef92['query'][_0x168c('0x70')]);}})['then'](respondWithStatusCode(_0x55969f,null))[_0x168c('0x2a')](handleError(_0x55969f,null));};exports[_0x168c('0x71')]=function(_0x238b77,_0x1d9e0e,_0xfc9c89){return db[_0x168c('0x72')][_0x168c('0x5c')]({'where':{'id':_0x238b77[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x1d9e0e,null))['then'](function(_0xb9fb4c){if(_0xb9fb4c){return _0xb9fb4c['addInteraction'](_0x238b77[_0x168c('0x5e')]['ids'],_[_0x168c('0x73')](_0x238b77['body'],[_0x168c('0x70'),'id'])||{});}})['then'](respondWithResult(_0x1d9e0e,null))[_0x168c('0x2a')](handleError(_0x1d9e0e,null));};exports[_0x168c('0x74')]=function(_0x105088,_0x1815f4,_0x5da4d5){var _0xb6ba92={'raw':![],'where':{}};var _0x455816={};var _0x610062={'count':0x0,'rows':[]};return db[_0x168c('0x42')][_0x168c('0x6a')]({'where':{'id':_0x105088[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x1815f4,null))[_0x168c('0x20')](function(_0x58a476){if(_0x58a476){_0x455816['model']=_[_0x168c('0x48')](db[_0x168c('0x72')][_0x168c('0x43')]);_0x455816[_0x168c('0x47')]=_[_0x168c('0x48')](_0x105088['query']);_0x455816[_0x168c('0x49')]=_[_0x168c('0x4a')](_0x455816[_0x168c('0x46')],_0x455816[_0x168c('0x47')]);_0xb6ba92[_0x168c('0x4c')]=_[_0x168c('0x4a')](_0x455816['model'],qs[_0x168c('0x4b')](_0x105088[_0x168c('0x47')][_0x168c('0x4b')]));_0xb6ba92[_0x168c('0x4c')]=_0xb6ba92['attributes'][_0x168c('0x59')]?_0xb6ba92[_0x168c('0x4c')]:_0x455816[_0x168c('0x46')];if(!_0x105088[_0x168c('0x47')][_0x168c('0x4d')](_0x168c('0x4e'))){_0xb6ba92[_0x168c('0x31')]=qs[_0x168c('0x31')](_0x105088[_0x168c('0x47')][_0x168c('0x31')]);_0xb6ba92[_0x168c('0x2f')]=qs[_0x168c('0x2f')](_0x105088[_0x168c('0x47')][_0x168c('0x2f')]);}_0xb6ba92[_0x168c('0x4f')]=qs[_0x168c('0x50')](_0x105088['query'][_0x168c('0x50')]);_0xb6ba92[_0x168c('0x51')]=qs[_0x168c('0x49')](_[_0x168c('0x52')](_0x105088[_0x168c('0x47')],_0x455816[_0x168c('0x49')]));_0xb6ba92[_0x168c('0x51')][_0x168c('0x67')]=_0x58a476['id'];if(_0x105088[_0x168c('0x47')]['filter']){_0xb6ba92['where']=_['merge'](_0xb6ba92[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0xb6ba92[_0x168c('0x4c')],function(_0x1266b3){var _0x45d955={};_0x45d955[_0x1266b3]={'$like':'%'+_0x105088[_0x168c('0x47')][_0x168c('0x53')]+'%'};return _0x45d955;})});}_0xb6ba92=_[_0x168c('0x54')]({},_0xb6ba92,_0x105088[_0x168c('0x5b')]);return db[_0x168c('0x72')]['count']({'where':_0xb6ba92[_0x168c('0x51')]})['then'](function(_0x3b6d64){_0x610062['count']=_0x3b6d64;if(_0x105088['query']['includeAll']){_0xb6ba92[_0x168c('0x5a')]=[{'model':db[_0x168c('0x75')],'as':_0x168c('0x76'),'required':![]},{'model':db[_0x168c('0x77')],'as':_0x168c('0x78'),'attributes':[_0x168c('0x3c'),_0x168c('0x79'),_0x168c('0x7a')],'required':![]},{'model':db[_0x168c('0x7b')],'as':_0x168c('0x7c'),'attributes':['id',_0x168c('0x3c'),_0x168c('0x7d')],'where':_0x105088[_0x168c('0x47')][_0x168c('0x7e')]?{'id':_0x105088[_0x168c('0x47')][_0x168c('0x7e')]}:undefined,'required':_0x105088[_0x168c('0x47')]['tag']?!![]:![]}];}return db[_0x168c('0x72')][_0x168c('0x57')](_0xb6ba92);})['then'](function(_0x49aca3){_0x610062[_0x168c('0x58')]=_0x49aca3;return _0x610062;});}})[_0x168c('0x20')](respondWithFilteredResult(_0x1815f4,_0xb6ba92))['catch'](handleError(_0x1815f4,null));};exports[_0x168c('0x7f')]=function(_0x9d1187,_0xf03830){var _0x4b398b=_0x9d1187['params']['id'];var _0x1db23e=_0x9d1187[_0x168c('0x5e')];var _0x55def6=0xc8;var _0x5beaa6=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x168c('0x80')][_0x168c('0x81')][_0x168c('0x82')]['READ_COMMITTED']},function(_0x1882af){return db[_0x168c('0x42')]['findOne']({'where':{'id':_0x4b398b},'transaction':_0x1882af})['then'](function(_0x5787fb){if(_0x5787fb){return db[_0x168c('0x83')][_0x168c('0x37')]({'where':{'FaxAccountId':_0x4b398b},'transaction':_0x1882af})[_0x168c('0x20')](function(){var _0x32973b=_['map'](_0x1db23e,function(_0x2e9038){_0x2e9038[_0x168c('0x67')]=_0x4b398b;return _0x2e9038;});return db['FaxApplication']['bulkCreate'](_0x32973b,{'transaction':_0x1882af});});}else{_0x55def6=0x194;_0x5beaa6=[];}});})[_0x168c('0x20')](function(){if(_0x55def6!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x4b398b},'order':_0x168c('0x84')})['then'](function(_0x284f5d){_0x5beaa6=_0x284f5d;});}})[_0x168c('0x2a')](function(_0x2ede33){_0x55def6=0x1f4;logger[_0x168c('0x25')](_0x2ede33[_0x168c('0x3b')]);if(_0x2ede33['name']){delete _0x2ede33[_0x168c('0x3c')];}_0x5beaa6=_0x2ede33;})['finally'](function(){if(_0x5beaa6===null){_0xf03830['sendStatus'](_0x55def6);}else{if(_0x55def6===0x1f4){_0xf03830[_0x168c('0x2c')](_0x55def6)[_0x168c('0x3d')](_0x5beaa6);}else{_0xf03830[_0x168c('0x2c')](_0x55def6)[_0x168c('0x2e')](_0x5beaa6);}}});};exports[_0x168c('0x85')]=function(_0x363b2f,_0x741e6b,_0x1cf273){var _0x268267={};var _0x176224={};var _0x4e9214;var _0x376588;return db[_0x168c('0x42')][_0x168c('0x6a')]({'where':{'id':_0x363b2f[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x741e6b,null))[_0x168c('0x20')](function(_0x5ec049){if(_0x5ec049){_0x4e9214=_0x5ec049;_0x176224['model']=_[_0x168c('0x48')](db['FaxApplication'][_0x168c('0x43')]);_0x176224[_0x168c('0x47')]=_[_0x168c('0x48')](_0x363b2f[_0x168c('0x47')]);_0x176224[_0x168c('0x49')]=_[_0x168c('0x4a')](_0x176224['model'],_0x176224[_0x168c('0x47')]);_0x268267[_0x168c('0x4c')]=_[_0x168c('0x4a')](_0x176224[_0x168c('0x46')],qs[_0x168c('0x4b')](_0x363b2f[_0x168c('0x47')][_0x168c('0x4b')]));_0x268267[_0x168c('0x4c')]=_0x268267[_0x168c('0x4c')][_0x168c('0x59')]?_0x268267[_0x168c('0x4c')]:_0x176224[_0x168c('0x46')];_0x268267[_0x168c('0x4f')]=qs[_0x168c('0x50')](_0x363b2f[_0x168c('0x47')][_0x168c('0x50')]);_0x268267[_0x168c('0x51')]=qs[_0x168c('0x49')](_[_0x168c('0x52')](_0x363b2f[_0x168c('0x47')],_0x176224['filters']));if(_0x363b2f[_0x168c('0x47')]['filter']){_0x268267[_0x168c('0x51')]=_[_0x168c('0x54')](_0x268267['where'],{'$or':_[_0x168c('0x41')](_0x268267['attributes'],function(_0xdf6c85){var _0x39cf62={};_0x39cf62[_0xdf6c85]={'$like':'%'+_0x363b2f[_0x168c('0x47')][_0x168c('0x53')]+'%'};return _0x39cf62;})});}_0x268267=_[_0x168c('0x54')]({},_0x268267,_0x363b2f[_0x168c('0x5b')]);return _0x4e9214[_0x168c('0x85')](_0x268267);}})[_0x168c('0x20')](function(_0x2ec60a){if(_0x2ec60a){_0x376588=_0x2ec60a['length'];if(!_0x363b2f[_0x168c('0x47')][_0x168c('0x4d')](_0x168c('0x4e'))){_0x268267[_0x168c('0x31')]=qs[_0x168c('0x31')](_0x363b2f[_0x168c('0x47')][_0x168c('0x31')]);_0x268267['offset']=qs[_0x168c('0x2f')](_0x363b2f['query'][_0x168c('0x2f')]);}return _0x4e9214['getApplications'](_0x268267);}})[_0x168c('0x20')](function(_0x24f075){if(_0x24f075){return _0x24f075?{'count':_0x376588,'rows':_0x24f075}:null;}})[_0x168c('0x20')](respondWithResult(_0x741e6b,null))[_0x168c('0x2a')](handleError(_0x741e6b,null));};function Extension(_0x59d8ca,_0x444ed0,_0x4228a7,_0x582978){this[_0x168c('0x86')]=_0x168c('0x87');this['exten']=_0x59d8ca['localstationid'];this[_0x168c('0x88')]=_0x582978;this[_0x168c('0x45')]=_0x168c('0x89');this[_0x168c('0x8a')]='Fax\x20Extension';this[_0x168c('0x67')]=_0x59d8ca['id'];this[_0x168c('0x84')]=_0x444ed0;this[_0x168c('0x8b')]=_0x4228a7;}function createExtensionsReciveFax(_0x80ba91){var _0xb5945b=0x1;var _0xce767=[];_0xce767[_0x168c('0x8c')](new Extension(_0x80ba91,_0xb5945b,'',_0x168c('0x8d')));_0xb5945b+=0x1;_0xce767[_0x168c('0x8c')](new Extension(_0x80ba91,_0xb5945b,_0x168c('0x8e'),_0x168c('0x8f')));_0xb5945b+=0x1;for(var _0x5bc178 in _0x80ba91){if(_0x80ba91['hasOwnProperty'](_0x5bc178)&&(_0x5bc178==='ecm'||_0x5bc178===_0x168c('0x90')||_0x5bc178===_0x168c('0x91')||_0x5bc178===_0x168c('0x92')||_0x5bc178===_0x168c('0x93')||_0x5bc178===_0x168c('0x94')||_0x5bc178===_0x168c('0x95')||_0x5bc178===_0x168c('0x96')||_0x5bc178===_0x168c('0x97'))){_0xce767[_0x168c('0x8c')](new Extension(_0x80ba91,_0xb5945b,_0x168c('0x98')+_0x5bc178+')='+_0x80ba91[_0x5bc178],_0x168c('0x8f')));_0xb5945b+=0x1;}}_0xce767[_0x168c('0x8c')](new Extension(_0x80ba91,_0xb5945b,'6','Wait'));_0xb5945b+=0x1;_0xce767[_0x168c('0x8c')](new Extension(_0x80ba91,_0xb5945b,_0x168c('0x99'),'ReceiveFax'));_0xb5945b=0x0;return _0xce767;}exports[_0x168c('0x9a')]=function(_0x345bab,_0x125dc3,_0xdb8077){var _0x3f838c;return db[_0x168c('0x80')][_0x168c('0x9b')](function(_0xfd0850){return db['FaxAccount'][_0x168c('0x5d')](_0x345bab[_0x168c('0x5e')],{'transaction':_0xfd0850})[_0x168c('0x20')](function(_0x27e61f){_0x3f838c=_0x27e61f[_0x168c('0x38')]({'plain':!![]});return db[_0x168c('0x9c')][_0x168c('0x9d')](createExtensionsReciveFax(_0x3f838c),{'transaction':_0xfd0850});});})[_0x168c('0x20')](function(){return _0x3f838c;})[_0x168c('0x20')](respondWithResult(_0x125dc3,null))[_0x168c('0x2a')](handleError(_0x125dc3,null));};exports[_0x168c('0x9e')]=function(_0x21d98e,_0x35af9a,_0xde92c2){var _0x35b9eb;return db['sequelize']['transaction'](function(_0x3e6398){return db[_0x168c('0x42')]['update'](_0x21d98e[_0x168c('0x5e')],{'where':{'id':_0x21d98e[_0x168c('0x5e')]['id']},'transaction':_0x3e6398})[_0x168c('0x20')](function(_0x16341d){return db[_0x168c('0x9c')][_0x168c('0x37')]({'where':{'FaxAccountId':_0x21d98e['body']['id']},'transaction':_0x3e6398})[_0x168c('0x20')](function(_0x44abf6){return db['VoiceExtension'][_0x168c('0x9d')](createExtensionsReciveFax(_[_0x168c('0x73')](_0x21d98e[_0x168c('0x5e')],[_0x168c('0x9f'),'key',_0x168c('0xa0'),'updatedAt',_0x168c('0xa1'),'ListId'])),{'transaction':_0x3e6398});});});})[_0x168c('0x20')](function(){return db[_0x168c('0x42')]['findById'](_0x21d98e[_0x168c('0x5e')]['id']);})[_0x168c('0x20')](respondWithResult(_0x35af9a,null))[_0x168c('0x2a')](handleError(_0x35af9a,null));};exports[_0x168c('0xa2')]=function(_0xe8a426,_0x4e8a66,_0x99332e){var _0x50b325={'raw':!![],'where':{}};var _0x4d8e76={};var _0x58dc08={'count':0x0,'rows':[]};return db[_0x168c('0x42')]['findOne']({'where':{'id':_0xe8a426[_0x168c('0x65')]['id']}})['then'](handleEntityNotFound(_0x4e8a66,null))['then'](function(_0x1d370b){if(_0x1d370b){_0x4d8e76[_0x168c('0x46')]=_['keys'](db[_0x168c('0xa3')]['rawAttributes']);_0x4d8e76['query']=_[_0x168c('0x48')](_0xe8a426['query']);_0x4d8e76['filters']=_[_0x168c('0x4a')](_0x4d8e76['model'],_0x4d8e76[_0x168c('0x47')]);_0x50b325['attributes']=_[_0x168c('0x4a')](_0x4d8e76[_0x168c('0x46')],qs['fields'](_0xe8a426['query'][_0x168c('0x4b')]));_0x50b325[_0x168c('0x4c')]=_0x50b325[_0x168c('0x4c')][_0x168c('0x59')]?_0x50b325[_0x168c('0x4c')]:_0x4d8e76[_0x168c('0x46')];if(!_0xe8a426['query']['hasOwnProperty'](_0x168c('0x4e'))){_0x50b325['limit']=qs['limit'](_0xe8a426[_0x168c('0x47')][_0x168c('0x31')]);_0x50b325[_0x168c('0x2f')]=qs[_0x168c('0x2f')](_0xe8a426[_0x168c('0x47')][_0x168c('0x2f')]);}_0x50b325['order']=qs[_0x168c('0x50')](_0xe8a426[_0x168c('0x47')][_0x168c('0x50')]);_0x50b325[_0x168c('0x51')]=qs['filters'](_[_0x168c('0x52')](_0xe8a426['query'],_0x4d8e76[_0x168c('0x49')]));_0x50b325[_0x168c('0x51')][_0x168c('0x67')]=_0x1d370b['id'];if(_0xe8a426[_0x168c('0x47')][_0x168c('0x53')]){_0x50b325[_0x168c('0x51')]=_[_0x168c('0x54')](_0x50b325[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0x50b325[_0x168c('0x4c')],function(_0x2f3ecf){var _0x1a4204={};_0x1a4204[_0x2f3ecf]={'$like':'%'+_0xe8a426[_0x168c('0x47')]['filter']+'%'};return _0x1a4204;})});}if(_0xe8a426[_0x168c('0x47')]['$gte']){var _0x12fb7a=_0xe8a426[_0x168c('0x47')][_0x168c('0xa4')][_0x168c('0xa5')](',');var _0x33e221={};_0x33e221[_0x12fb7a[0x0]]={'$gte':moment(_0x12fb7a[0x1])['format'](_0x168c('0xa6'))};_0x50b325[_0x168c('0x51')]=_[_0x168c('0x54')](_0x50b325[_0x168c('0x51')],_0x33e221);}_0x50b325=_[_0x168c('0x54')]({},_0x50b325,_0xe8a426[_0x168c('0x5b')]);return db['FaxMessage'][_0x168c('0x32')]({'where':_0x50b325[_0x168c('0x51')]})[_0x168c('0x20')](function(_0x40c7c7){_0x58dc08[_0x168c('0x32')]=_0x40c7c7;if(_0xe8a426['query']['includeAll']){_0x50b325[_0x168c('0x5a')]=[{'all':!![]}];}return db[_0x168c('0xa3')]['findAll'](_0x50b325);})[_0x168c('0x20')](function(_0x13f8a6){_0x58dc08[_0x168c('0x58')]=_0x13f8a6;return _0x58dc08;});}})[_0x168c('0x20')](respondWithFilteredResult(_0x4e8a66,_0x50b325))['catch'](handleError(_0x4e8a66,null));};exports['send']=function(_0x52321a,_0x4c6f6f,_0xb65ab6){var _0x37197f,_0x170cf2={},_0x29f46a;if(_0x52321a[_0x168c('0x5e')]['to']){_0x29f46a=_0x52321a[_0x168c('0x5e')]['to'][0x0];}return db[_0x168c('0x42')][_0x168c('0x5c')]({'where':{'id':_0x52321a[_0x168c('0x65')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x168c('0x75')],'as':_0x168c('0xa7'),'where':{'fax':_0x29f46a},'limit':0x1,'order':[[_0x168c('0xa8'),'DESC']]}]}]})[_0x168c('0x20')](handleEntityNotFound(_0x4c6f6f,null))['then'](function(_0x385e5f){_0x37197f=_0x385e5f;if(_0x52321a[_0x168c('0x5e')]['attachments']&&_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][_0x168c('0x59')]){for(var _0x1e8632=0x0;_0x1e8632<_0x52321a['body'][_0x168c('0xa9')][_0x168c('0x59')];_0x1e8632+=0x1){_0x52321a['body'][_0x168c('0xa9')][_0x1e8632]={'filename':_0x52321a['body'][_0x168c('0xa9')][_0x1e8632]['name'],'id':_0x52321a['body']['attachments'][_0x1e8632]['id'],'path':path['join'](config['root'],_0x168c('0xaa'),_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][_0x1e8632][_0x168c('0xab')])};}}return respondWithRpcPromise(_0x168c('0xac'),_0x168c('0xac'),{'FaxAccountId':_['isNil'](_0x52321a[_0x168c('0x65')]['id'])?undefined:_0x52321a[_0x168c('0x65')]['id'],'path':_[_0x168c('0xad')](_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][0x0][_0x168c('0x7')])?undefined:_0x52321a['body'][_0x168c('0xa9')][0x0][_0x168c('0x7')],'fax':_[_0x168c('0xad')](_0x52321a[_0x168c('0x5e')]['to'][0x0])?undefined:_0x52321a[_0x168c('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x37197f){if(_[_0x168c('0xad')](_0x52321a[_0x168c('0x5e')][_0x168c('0xae')])){_0x52321a[_0x168c('0x5e')]['from']=util['format'](_0x168c('0xaf'),_0x37197f[_0x168c('0x3c')],_0x37197f[_0x168c('0xb0')]);}if(_0x37197f[_0x168c('0xb1')]){if(_0x37197f[_0x168c('0xb1')][_0x168c('0xa7')][_0x168c('0x59')]){return _0x37197f[_0x168c('0xb1')][_0x168c('0xa7')][0x0];}else{return db[_0x168c('0x75')][_0x168c('0x5d')](_['defaults'](_0x52321a['body'],{'firstName':_0x52321a[_0x168c('0x5e')]['to'][0x0],'phone':_0x52321a[_0x168c('0x5e')]['to'][0x0],'fax':_0x52321a[_0x168c('0x5e')]['to'][0x0],'ListId':_0x37197f['ListId']}));}}else{throw new Error(_0x168c('0xb2'));}}else{throw new Error(_0x168c('0xb3'));}})[_0x168c('0x20')](function(_0x5e7529){if(_0x5e7529){return db[_0x168c('0x72')][_0x168c('0x5c')]({'where':{'ContactId':_0x5e7529['id'],'closed':![],'FaxAccountId':_0x37197f['id']}})[_0x168c('0x20')](function(_0x4f9095){if(_0x4f9095){return[_0x4f9095,![]];}return db['FaxInteraction'][_0x168c('0x5d')]({'UserId':_0x52321a[_0x168c('0x5f')]['id'],'ContactId':_0x5e7529['id'],'FaxAccountId':_0x37197f['id'],'fax':_0x52321a[_0x168c('0x5e')]['to'][0x0],'firstMsgDirection':_0x168c('0xb4'),'Messages':[_[_0x168c('0x54')](_0x52321a[_0x168c('0x5e')],{'read':![],'body':_0x52321a[_0x168c('0x5e')]['attachments'][0x0][_0x168c('0xb5')],'FaxAccountId':_0x37197f['id'],'UserId':_0x52321a[_0x168c('0x5f')]['id'],'ContactId':_0x5e7529['id'],'AttachmentId':_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x168c('0xa3')],'as':_0x168c('0xb6')}]})[_0x168c('0x20')](function(_0x1b298f){return[_0x1b298f,!![]];});});}else{throw new Error(_0x168c('0xb7'));}})[_0x168c('0xb8')](function(_0x120f3e,_0xaf8ed4){if(_0xaf8ed4){return _0x120f3e;}return db[_0x168c('0xa3')][_0x168c('0x5d')]({'direction':_0x168c('0xb4'),'read':![],'body':_0x52321a[_0x168c('0x5e')]['attachments'][0x0][_0x168c('0xb5')],'FaxAccountId':_0x37197f['id'],'FaxInteractionId':_0x120f3e['id'],'UserId':_0x52321a['user']['id'],'ContactId':_0x120f3e['ContactId'],'AttachmentId':_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][0x0]['id']})[_0x168c('0x20')](function(_0x3c220e){_0x120f3e[_0x168c('0xb9')][_0x168c('0xb6')]=[];_0x120f3e[_0x168c('0xb9')][_0x168c('0xb6')]['push'](_0x3c220e[_0x168c('0xb9')]);return _0x120f3e;});})['then'](function(_0x205bd5){respondWithRpcPromise(_0x168c('0xba'),_0x168c('0xba'),{'FaxAccountId':_[_0x168c('0xad')](_0x52321a[_0x168c('0x65')]['id'])?undefined:_0x52321a[_0x168c('0x65')]['id'],'path':_[_0x168c('0xad')](_0x52321a[_0x168c('0x5e')][_0x168c('0xa9')][0x0][_0x168c('0x7')])?undefined:_0x52321a['body'][_0x168c('0xa9')][0x0]['path'],'fax':_[_0x168c('0xad')](_0x52321a[_0x168c('0x5e')]['to'][0x0])?undefined:_0x52321a['body']['to'][0x0],'AttachmentId':_0x52321a['body'][_0x168c('0xa9')][0x0]['id']},client9002)[_0x168c('0x20')](function(_0x390c38){logger[_0x168c('0x28')](_0x168c('0xbb'),_0x390c38);})['catch'](function(_0x81f542){logger[_0x168c('0x28')](_0x168c('0xbb'),_0x81f542);});return _0x205bd5;})[_0x168c('0x20')](respondWithResult(_0x4c6f6f,null))['catch'](handleError(_0x4c6f6f,null));};exports[_0x168c('0xbc')]=function(_0x24b198,_0x4fcb1f,_0x542230){return db[_0x168c('0x42')]['find']({'where':{'id':_0x24b198[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x4fcb1f,null))[_0x168c('0x20')](function(_0x3ea614){if(_0x3ea614){return _0x3ea614[_0x168c('0xbc')](_0x24b198[_0x168c('0x5e')][_0x168c('0x70')],_[_0x168c('0x73')](_0x24b198['body'],[_0x168c('0x70'),'id'])||{})[_0x168c('0xb8')](function(_0x3af72f){for(var _0x297428=0x0;_0x297428<_0x24b198[_0x168c('0x5e')][_0x168c('0x70')][_0x168c('0x59')];_0x297428+=0x1){socket[_0x168c('0xbd')](_0x168c('0xbe'),{'UserId':Number(_0x24b198['body'][_0x168c('0x70')][_0x297428]),'FaxAccountId':Number(_0x24b198['params']['id'])});}return _0x3af72f;});}})[_0x168c('0x20')](respondWithResult(_0x4fcb1f,null))[_0x168c('0x2a')](handleError(_0x4fcb1f,null));};exports[_0x168c('0xbf')]=function(_0x3fdc52,_0xcbe5f5,_0x48f867){return db['FaxAccount'][_0x168c('0x5c')]({'where':{'id':_0x3fdc52[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0xcbe5f5,null))[_0x168c('0x20')](function(_0x5a22c7){if(_0x5a22c7){return _0x5a22c7[_0x168c('0xbf')](_0x3fdc52[_0x168c('0x47')][_0x168c('0x70')])[_0x168c('0x20')](function(){if(_[_0x168c('0xc0')](_0x3fdc52[_0x168c('0x47')][_0x168c('0x70')])){for(var _0x4bb336=0x0;_0x4bb336<_0x3fdc52[_0x168c('0x47')]['ids']['length'];_0x4bb336+=0x1){socket[_0x168c('0xbd')](_0x168c('0xc1'),{'UserId':Number(_0x3fdc52[_0x168c('0x47')]['ids'][_0x4bb336]),'FaxAccountId':Number(_0x3fdc52[_0x168c('0x65')]['id'])});}}else{socket[_0x168c('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x3fdc52[_0x168c('0x47')]['ids']),'FaxAccountId':Number(_0x3fdc52[_0x168c('0x65')]['id'])});}});}})[_0x168c('0x20')](respondWithStatusCode(_0xcbe5f5,null))[_0x168c('0x2a')](handleError(_0xcbe5f5,null));};exports['getAgents']=function(_0x522074,_0x740aac,_0x50e7b7){var _0x2e975a={};var _0x4e8474={};var _0x521ee5;var _0x4b915a;return db['FaxAccount']['findOne']({'where':{'id':_0x522074[_0x168c('0x65')]['id']}})[_0x168c('0x20')](handleEntityNotFound(_0x740aac,null))[_0x168c('0x20')](function(_0x5e84cc){if(_0x5e84cc){_0x521ee5=_0x5e84cc;_0x4e8474[_0x168c('0x46')]=_[_0x168c('0x48')](db[_0x168c('0x77')][_0x168c('0x43')]);_0x4e8474[_0x168c('0x47')]=_[_0x168c('0x48')](_0x522074['query']);_0x4e8474[_0x168c('0x49')]=_[_0x168c('0x4a')](_0x4e8474[_0x168c('0x46')],_0x4e8474[_0x168c('0x47')]);_0x2e975a['attributes']=_[_0x168c('0x4a')](_0x4e8474[_0x168c('0x46')],qs['fields'](_0x522074[_0x168c('0x47')][_0x168c('0x4b')]));_0x2e975a[_0x168c('0x4c')]=_0x2e975a[_0x168c('0x4c')][_0x168c('0x59')]?_0x2e975a[_0x168c('0x4c')]:_0x4e8474[_0x168c('0x46')];_0x2e975a['order']=qs['sort'](_0x522074[_0x168c('0x47')][_0x168c('0x50')]);_0x2e975a[_0x168c('0x51')]=qs[_0x168c('0x49')](_[_0x168c('0x52')](_0x522074[_0x168c('0x47')],_0x4e8474[_0x168c('0x49')]));if(_0x522074[_0x168c('0x47')]['filter']){_0x2e975a[_0x168c('0x51')]=_[_0x168c('0x54')](_0x2e975a[_0x168c('0x51')],{'$or':_[_0x168c('0x41')](_0x2e975a[_0x168c('0x4c')],function(_0x22c367){var _0x3b6c70={};_0x3b6c70[_0x22c367]={'$like':'%'+_0x522074[_0x168c('0x47')][_0x168c('0x53')]+'%'};return _0x3b6c70;})});}_0x2e975a=_[_0x168c('0x54')]({},_0x2e975a,_0x522074['options']);return _0x521ee5[_0x168c('0xc2')](_0x2e975a);}})[_0x168c('0x20')](function(_0x34ce83){if(_0x34ce83){_0x4b915a=_0x34ce83['length'];if(!_0x522074['query'][_0x168c('0x4d')]('nolimit')){_0x2e975a[_0x168c('0x31')]=qs[_0x168c('0x31')](_0x522074[_0x168c('0x47')][_0x168c('0x31')]);_0x2e975a['offset']=qs['offset'](_0x522074['query']['offset']);}return _0x521ee5[_0x168c('0xc2')](_0x2e975a);}})[_0x168c('0x20')](function(_0x4d690c){if(_0x4d690c){return _0x4d690c?{'count':_0x4b915a,'rows':_0x4d690c}:null;}})[_0x168c('0x20')](respondWithResult(_0x740aac,null))['catch'](handleError(_0x740aac,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ec04f62..eafb35d 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 _0x8eb7=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0x8eb7,0xfb));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x78eb('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x78eb('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x78eb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78eb('0x3'),'afterDestroy':_0x78eb('0x4')};function emitEvent(_0x2bafd3){return function(_0x5143a0,_0x545373,_0x3122af){FaxAccountEvents[_0x78eb('0x5')](_0x2bafd3+':'+_0x5143a0['id'],_0x5143a0);FaxAccountEvents[_0x78eb('0x5')](_0x2bafd3,_0x5143a0);_0x3122af(null);};}for(var e in events){if(events[_0x78eb('0x6')](e)){var event=events[e];FaxAccount[_0x78eb('0x7')](e,emitEvent(event));}}module[_0x78eb('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x8398=['../../mysqldb','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x4cf007,_0x42b861){var _0x360dad=function(_0x514cf6){while(--_0x514cf6){_0x4cf007['push'](_0x4cf007['shift']());}};_0x360dad(++_0x42b861);}(_0x8398,0x170));var _0x8839=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8398[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x8839('0x0'));var FaxAccount=require(_0x8839('0x1'))['db'][_0x8839('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8839('0x3')](0x0);var events={'afterCreate':_0x8839('0x4'),'afterUpdate':'update','afterDestroy':_0x8839('0x5')};function emitEvent(_0x428eb5){return function(_0x390480,_0x3130c5,_0x471214){FaxAccountEvents[_0x8839('0x6')](_0x428eb5+':'+_0x390480['id'],_0x390480);FaxAccountEvents[_0x8839('0x6')](_0x428eb5,_0x390480);_0x471214(null);};}for(var e in events){if(events[_0x8839('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x8839('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 91059e7..ecb6265 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 _0x2fc6=['bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x110ae1,_0x551598){var _0xf1f963=function(_0x3c75d3){while(--_0x3c75d3){_0x110ae1['push'](_0x110ae1['shift']());}};_0xf1f963(++_0x551598);}(_0x2fc6,0xcb));var _0x62fc=function(_0x29c2c3,_0x798c57){_0x29c2c3=_0x29c2c3-0x0;var _0x2fdc13=_0x2fc6[_0x29c2c3];return _0x2fdc13;};'use strict';var _=require(_0x62fc('0x0'));var util=require(_0x62fc('0x1'));var logger=require(_0x62fc('0x2'))(_0x62fc('0x3'));var moment=require(_0x62fc('0x4'));var BPromise=require(_0x62fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62fc('0x6'));var rimraf=require(_0x62fc('0x7'));var config=require(_0x62fc('0x8'));var attributes=require(_0x62fc('0x9'));module[_0x62fc('0xa')]=function(_0x4583ae,_0x37123f){return _0x4583ae['define'](_0x62fc('0xb'),attributes,{'tableName':_0x62fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb09e=['rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','request-promise','path'];(function(_0x25b92e,_0x59e7d2){var _0x493b10=function(_0xca2749){while(--_0xca2749){_0x25b92e['push'](_0x25b92e['shift']());}};_0x493b10(++_0x59e7d2);}(_0xb09e,0x157));var _0xeb09=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0xb09e[_0x1d426f];return _0x17f71a;};'use strict';var _=require(_0xeb09('0x0'));var util=require('util');var logger=require(_0xeb09('0x1'))(_0xeb09('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb09('0x3'));var fs=require('fs');var path=require(_0xeb09('0x4'));var rimraf=require(_0xeb09('0x5'));var config=require(_0xeb09('0x6'));var attributes=require(_0xeb09('0x7'));module[_0xeb09('0x8')]=function(_0x389956,_0x1ecba0){return _0x389956[_0xeb09('0x9')](_0xeb09('0xa'),attributes,{'tableName':_0xeb09('0xb'),'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 b2eec33..5aca4e2 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 _0x112c=['result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','include','model','map','NotifyFaxAccount','body','fax','describe','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','create','contact','FaxInteraction','spread','autoclose','length','close','unmanaged','*,*,*,*','created','FaxMessage','interaction','User','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0x112c,0xf5));var _0xc112=function(_0x37aabf,_0x44cc10){_0x37aabf=_0x37aabf-0x0;var _0x881478=_0x112c[_0x37aabf];return _0x881478;};'use strict';var _=require(_0xc112('0x0'));var util=require(_0xc112('0x1'));var moment=require(_0xc112('0x2'));var BPromise=require(_0xc112('0x3'));var rs=require(_0xc112('0x4'));var fs=require('fs');var Redis=require(_0xc112('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc112('0x6'));var logger=require(_0xc112('0x7'))(_0xc112('0x8'));var config=require(_0xc112('0x9'));var jayson=require(_0xc112('0xa'));var client=jayson[_0xc112('0xb')][_0xc112('0xc')]({'port':0x232c});config[_0xc112('0xd')]=_[_0xc112('0xe')](config['redis'],{'host':_0xc112('0xf'),'port':0x18eb});var socket=require(_0xc112('0x10'))(new Redis(config['redis']));require(_0xc112('0x11'))[_0xc112('0x12')](socket);function respondWithRpcPromise(_0xc763e2,_0x5acf3f,_0x4c05ea){return new BPromise(function(_0x5f148f,_0x39e168){return client[_0xc112('0x13')](_0xc763e2,_0x4c05ea)[_0xc112('0x14')](function(_0x423277){logger[_0xc112('0x15')](_0xc112('0x16'),_0x5acf3f,_0xc112('0x17'));logger[_0xc112('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5acf3f,_0xc112('0x17'),JSON[_0xc112('0x19')](_0x423277));if(_0x423277['error']){if(_0x423277[_0xc112('0x1a')]['code']===0x1f4){logger[_0xc112('0x1a')](_0xc112('0x16'),_0x5acf3f,_0x423277['error'][_0xc112('0x1b')]);return _0x39e168(_0x423277['error'][_0xc112('0x1b')]);}logger[_0xc112('0x1a')](_0xc112('0x16'),_0x5acf3f,_0x423277[_0xc112('0x1a')][_0xc112('0x1b')]);return _0x5f148f(_0x423277[_0xc112('0x1a')][_0xc112('0x1b')]);}else{logger[_0xc112('0x15')]('FaxAccount,\x20%s,\x20%s',_0x5acf3f,_0xc112('0x17'));_0x5f148f(_0x423277[_0xc112('0x1c')][_0xc112('0x1b')]);}})[_0xc112('0x1d')](function(_0x136a89){logger[_0xc112('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x5acf3f,_0x136a89);_0x39e168(_0x136a89);});});}exports[_0xc112('0x1e')]=function(_0x322bea){var _0xf916b8=this;return new Promise(function(_0x13987a,_0x78e5be){return db[_0xc112('0x1f')][_0xc112('0x20')]({'raw':_0x322bea['options']?_0x322bea[_0xc112('0x21')][_0xc112('0x22')]===undefined?!![]:![]:!![],'where':_0x322bea[_0xc112('0x21')]?_0x322bea[_0xc112('0x21')]['where']||null:null,'attributes':_0x322bea[_0xc112('0x21')]?_0x322bea[_0xc112('0x21')][_0xc112('0x23')]||null:null,'limit':_0x322bea[_0xc112('0x21')]?_0x322bea[_0xc112('0x21')]['limit']||null:null,'include':_0x322bea['options']?_0x322bea[_0xc112('0x21')]['include']?_['map'](_0x322bea[_0xc112('0x21')][_0xc112('0x24')],function(_0x5dfb3f){return{'model':db[_0x5dfb3f[_0xc112('0x25')]],'as':_0x5dfb3f['as'],'attributes':_0x5dfb3f['attributes'],'include':_0x5dfb3f['include']?_['map'](_0x5dfb3f[_0xc112('0x24')],function(_0x24acca){return{'model':db[_0x24acca['model']],'as':_0x24acca['as'],'attributes':_0x24acca[_0xc112('0x23')],'include':_0x24acca[_0xc112('0x24')]?_[_0xc112('0x26')](_0x24acca[_0xc112('0x24')],function(_0x3a9be7){return{'model':db[_0x3a9be7['model']],'as':_0x3a9be7['as'],'attributes':_0x3a9be7[_0xc112('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597f64){logger[_0xc112('0x15')](_0xc112('0x1e'),_0x322bea);logger[_0xc112('0x18')]('GetFaxAccount',_0x322bea,JSON[_0xc112('0x19')](_0x597f64));_0x13987a(_0x597f64);})[_0xc112('0x1d')](function(_0x3f401d){logger[_0xc112('0x1a')]('GetFaxAccount',_0x3f401d[_0xc112('0x1b')],_0x322bea);_0x78e5be(_0xf916b8[_0xc112('0x1a')](0x1f4,_0x3f401d[_0xc112('0x1b')]));});});};exports[_0xc112('0x27')]=function(_0x24988a,_0x541caf,_0x314766){var _0x18648b=this;return new Promise(function(_0x17bb4e,_0x2197cd){var _0x17a11c={'body':_0x24988a[_0xc112('0x28')],'channel':_0xc112('0x29')};var _0x1b8e29=[];var _0x57e8f7=[];var _0x55b3a9={};return db['CmContact'][_0xc112('0x2a')]()[_0xc112('0x14')](function(_0x225d25){if(!_0x225d25){throw new db[(_0xc112('0x2b'))]['ValidationError']('no\x20available\x20attributes');}_0x1b8e29=_[_0xc112('0x2c')](_[_0xc112('0x2d')](_0x225d25),[_0xc112('0x2e'),_0xc112('0x2f')]);_0x57e8f7=_['difference'](_[_0xc112('0x2d')](_0x225d25),[_0xc112('0x2e'),'updatedAt',_0xc112('0x30'),_0xc112('0x31')]);if(_0x24988a[_0xc112('0x28')]['id']){delete _0x24988a['body']['id'];}if(_[_0xc112('0x32')](_0x24988a[_0xc112('0x28')][_0xc112('0x33')])){throw new db[(_0xc112('0x2b'))][(_0xc112('0x34'))]('from\x20is\x20mandatory');}if(_[_0xc112('0x32')](_0x24988a[_0xc112('0x28')][_0xc112('0x28')])||_0x24988a[_0xc112('0x28')][_0xc112('0x28')]===''){throw new db[(_0xc112('0x2b'))]['ValidationError'](_0xc112('0x35'));}if(_['isNil'](_0x24988a[_0xc112('0x28')][_0xc112('0x36')])){throw new db[(_0xc112('0x2b'))]['ValidationError'](_0xc112('0x37')+_0x57e8f7);}if(!_[_0xc112('0x38')](_0x57e8f7,_0x24988a['body'][_0xc112('0x36')])){throw new db[(_0xc112('0x2b'))][(_0xc112('0x34'))](_0xc112('0x39')+_0x57e8f7);}_0x55b3a9[_0x24988a['body'][_0xc112('0x36')]]=_0x24988a[_0xc112('0x28')][_0xc112('0x33')];})[_0xc112('0x14')](function(){return db[_0xc112('0x1f')][_0xc112('0x3a')]({'where':{'id':_0x24988a[_0xc112('0x3b')]['id']},'include':[{'model':db[_0xc112('0x3c')],'as':_0xc112('0x3d'),'include':[{'model':db[_0xc112('0x3e')],'as':_0xc112('0x3f'),'where':_0x55b3a9,'limit':0x1,'order':[['updatedAt',_0xc112('0x40')]]}]},{'model':db[_0xc112('0x41')],'as':_0xc112('0x42')}]});})[_0xc112('0x14')](function(_0x20c9cb){if(_0x20c9cb&&_0x20c9cb[_0xc112('0x3d')]){var _0x3a9e41=_0x20c9cb[_0xc112('0x43')]({'plain':!![]});_0x17a11c[_0xc112('0x3b')]=_0x3a9e41;_0x17a11c[_0xc112('0x44')]=_0x3a9e41[_0xc112('0x42')];_0x17a11c[_0xc112('0x45')]=_0x3a9e41[_0xc112('0x3d')];_0x17a11c[_0xc112('0x44')]=_[_0xc112('0x46')](_0x17a11c['applications'],[_0xc112('0x47')],['asc']);if(_0x17a11c['account']['Applications']){delete _0x17a11c[_0xc112('0x3b')]['Applications'];}if(_0x17a11c[_0xc112('0x3b')][_0xc112('0x3d')]&&_0x17a11c['account'][_0xc112('0x3d')][_0xc112('0x3f')]['length']){return _0x17a11c[_0xc112('0x3b')][_0xc112('0x3d')][_0xc112('0x3f')][0x0];}var _0x55705d=_[_0xc112('0xe')](_0x24988a[_0xc112('0x28')],{'firstName':_0x24988a[_0xc112('0x28')]['from'],'ListId':_0x3a9e41[_0xc112('0x31')]});_0x55705d[_0x24988a[_0xc112('0x28')][_0xc112('0x36')]]=_0x24988a[_0xc112('0x28')][_0xc112('0x33')];return db[_0xc112('0x3e')][_0xc112('0x48')](_0x55705d,{'fields':_0x1b8e29,'raw':!![]});}})[_0xc112('0x14')](function(_0x4ac125){_0x17a11c[_0xc112('0x49')]=_0x4ac125;if(_0x4ac125){var _0x5cdce4={'ContactId':_0x4ac125['id'],'FaxAccountId':_0x24988a[_0xc112('0x3b')]['id'],'fax':_0x4ac125[_0xc112('0x29')]};return db[_0xc112('0x4a')][_0xc112('0x3a')]({'where':{'ContactId':_0x4ac125['id'],'closed':![],'FaxAccountId':_0x24988a[_0xc112('0x3b')]['id']}})['then'](function(_0x5527ea){if(_0x5527ea){return[_0x5527ea,![]];}return db['FaxInteraction'][_0xc112('0x48')](_0x5cdce4)[_0xc112('0x14')](function(_0x3720f1){return[_0x3720f1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc112('0x4b')](function(_0x24f42c,_0x4fa344){var _0x1de9e3=_0x24f42c[_0xc112('0x43')]({'plain':!![]});if(_0x4fa344){if(_0x17a11c[_0xc112('0x3b')][_0xc112('0x4c')]){_0x17a11c[_0xc112('0x44')]['push']({'id':0x0,'priority':_0x17a11c[_0xc112('0x44')][_0xc112('0x4d')]+0x1,'app':_0xc112('0x4e'),'appdata':_0xc112('0x4f'),'interval':_0xc112('0x50')});}_0x1de9e3[_0xc112('0x51')]=!![];}else{_0x1de9e3['created']=![];}_0x17a11c['interaction']=_0x1de9e3;return db[_0xc112('0x52')][_0xc112('0x48')]({'body':_0x24988a[_0xc112('0x28')]['body'],'FaxAccountId':_0x24988a[_0xc112('0x3b')]['id'],'FaxInteractionId':_0x24f42c['id'],'direction':'in','ContactId':_0x24f42c['ContactId'],'AttachmentId':_0x24988a[_0xc112('0x28')]['AttachmentId']});})[_0xc112('0x14')](function(_0x4c2891){_0x17a11c[_0xc112('0x1b')]=_0x4c2891;if(_0x17a11c[_0xc112('0x53')]['UserId']){return db[_0xc112('0x54')][_0xc112('0x3a')]({'attributes':['id',_0xc112('0x55')],'where':{'id':_0x17a11c[_0xc112('0x53')][_0xc112('0x56')]}})['then'](function(_0xaa9487){if(_0xaa9487){_0x17a11c[_0xc112('0x44')][_0xc112('0x57')]({'id':0x0,'priority':0x0,'app':_0xc112('0x58'),'appdata':_0xaa9487['name']+','+(_0x17a11c[_0xc112('0x3b')][_0xc112('0x59')]||0xa),'interval':_0xc112('0x50')});}return respondWithRpcPromise('Start',_0xc112('0x5a'),_0x17a11c);});}return respondWithRpcPromise('Start',_0xc112('0x5a'),_0x17a11c);})['then'](function(_0x427686){_0x17bb4e(_0x427686);})[_0xc112('0x1d')](function(_0x1cb115){_0x2197cd(_0x18648b[_0xc112('0x1a')](0x1f4,_0x1cb115[_0xc112('0x1b')]));});});}; \ No newline at end of file +var _0x1cec=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','map','include','model','then','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','FaxApplication','Applications','List','get','account','applications','orderBy','priority','asc','length','ListId','CmContact','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3cd6f4,_0x3a7e55){var _0x335c5d=function(_0x26f8c3){while(--_0x26f8c3){_0x3cd6f4['push'](_0x3cd6f4['shift']());}};_0x335c5d(++_0x3a7e55);}(_0x1cec,0xae));var _0xc1ce=function(_0x39628c,_0x2eb8c4){_0x39628c=_0x39628c-0x0;var _0x2b0532=_0x1cec[_0x39628c];return _0x2b0532;};'use strict';var _=require(_0xc1ce('0x0'));var util=require('util');var moment=require(_0xc1ce('0x1'));var BPromise=require(_0xc1ce('0x2'));var rs=require(_0xc1ce('0x3'));var fs=require('fs');var Redis=require(_0xc1ce('0x4'));var db=require(_0xc1ce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1ce('0x6'))(_0xc1ce('0x7'));var config=require(_0xc1ce('0x8'));var jayson=require(_0xc1ce('0x9'));var client=jayson[_0xc1ce('0xa')][_0xc1ce('0xb')]({'port':0x232c});config['redis']=_[_0xc1ce('0xc')](config[_0xc1ce('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1ce('0xe'))(new Redis(config[_0xc1ce('0xd')]));require(_0xc1ce('0xf'))[_0xc1ce('0x10')](socket);function respondWithRpcPromise(_0x39ab48,_0x5f566e,_0x8559b2){return new BPromise(function(_0x5183c3,_0x4abd62){return client[_0xc1ce('0x11')](_0x39ab48,_0x8559b2)['then'](function(_0x1af1bf){logger[_0xc1ce('0x12')](_0xc1ce('0x13'),_0x5f566e,_0xc1ce('0x14'));logger[_0xc1ce('0x15')](_0xc1ce('0x16'),_0x5f566e,_0xc1ce('0x14'),JSON[_0xc1ce('0x17')](_0x1af1bf));if(_0x1af1bf[_0xc1ce('0x18')]){if(_0x1af1bf[_0xc1ce('0x18')][_0xc1ce('0x19')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5f566e,_0x1af1bf[_0xc1ce('0x18')][_0xc1ce('0x1a')]);return _0x4abd62(_0x1af1bf[_0xc1ce('0x18')]['message']);}logger[_0xc1ce('0x18')](_0xc1ce('0x13'),_0x5f566e,_0x1af1bf[_0xc1ce('0x18')][_0xc1ce('0x1a')]);return _0x5183c3(_0x1af1bf[_0xc1ce('0x18')][_0xc1ce('0x1a')]);}else{logger[_0xc1ce('0x12')](_0xc1ce('0x13'),_0x5f566e,_0xc1ce('0x14'));_0x5183c3(_0x1af1bf['result'][_0xc1ce('0x1a')]);}})[_0xc1ce('0x1b')](function(_0x49d774){logger[_0xc1ce('0x18')](_0xc1ce('0x13'),_0x5f566e,_0x49d774);_0x4abd62(_0x49d774);});});}exports[_0xc1ce('0x1c')]=function(_0xef9f2d){var _0x314f10=this;return new Promise(function(_0xd6c9f2,_0x3c007b){return db[_0xc1ce('0x1d')][_0xc1ce('0x1e')]({'raw':_0xef9f2d[_0xc1ce('0x1f')]?_0xef9f2d[_0xc1ce('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xef9f2d[_0xc1ce('0x1f')]?_0xef9f2d[_0xc1ce('0x1f')][_0xc1ce('0x20')]||null:null,'attributes':_0xef9f2d[_0xc1ce('0x1f')]?_0xef9f2d['options'][_0xc1ce('0x21')]||null:null,'limit':_0xef9f2d[_0xc1ce('0x1f')]?_0xef9f2d['options'][_0xc1ce('0x22')]||null:null,'include':_0xef9f2d[_0xc1ce('0x1f')]?_0xef9f2d[_0xc1ce('0x1f')]['include']?_[_0xc1ce('0x23')](_0xef9f2d['options'][_0xc1ce('0x24')],function(_0x3f37e0){return{'model':db[_0x3f37e0[_0xc1ce('0x25')]],'as':_0x3f37e0['as'],'attributes':_0x3f37e0['attributes'],'include':_0x3f37e0[_0xc1ce('0x24')]?_[_0xc1ce('0x23')](_0x3f37e0['include'],function(_0x31cf60){return{'model':db[_0x31cf60[_0xc1ce('0x25')]],'as':_0x31cf60['as'],'attributes':_0x31cf60[_0xc1ce('0x21')],'include':_0x31cf60['include']?_[_0xc1ce('0x23')](_0x31cf60[_0xc1ce('0x24')],function(_0x5eddec){return{'model':db[_0x5eddec[_0xc1ce('0x25')]],'as':_0x5eddec['as'],'attributes':_0x5eddec[_0xc1ce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1ce('0x26')](function(_0xb891f8){logger[_0xc1ce('0x12')](_0xc1ce('0x1c'),_0xef9f2d);logger[_0xc1ce('0x15')](_0xc1ce('0x1c'),_0xef9f2d,JSON['stringify'](_0xb891f8));_0xd6c9f2(_0xb891f8);})[_0xc1ce('0x1b')](function(_0x48b086){logger[_0xc1ce('0x18')](_0xc1ce('0x1c'),_0x48b086[_0xc1ce('0x1a')],_0xef9f2d);_0x3c007b(_0x314f10[_0xc1ce('0x18')](0x1f4,_0x48b086[_0xc1ce('0x1a')]));});});};exports[_0xc1ce('0x27')]=function(_0x305f8a,_0x2be844,_0x58ac8c){var _0x16e2ec=this;return new Promise(function(_0x3decba,_0x3569b7){var _0x28be42={'body':_0x305f8a[_0xc1ce('0x28')],'channel':_0xc1ce('0x29')};var _0x4fc14d=[];var _0x2c395f=[];var _0x1a4517={};return db['CmContact'][_0xc1ce('0x2a')]()[_0xc1ce('0x26')](function(_0x5efc64){if(!_0x5efc64){throw new db[(_0xc1ce('0x2b'))][(_0xc1ce('0x2c'))](_0xc1ce('0x2d'));}_0x4fc14d=_[_0xc1ce('0x2e')](_[_0xc1ce('0x2f')](_0x5efc64),['createdAt',_0xc1ce('0x30')]);_0x2c395f=_[_0xc1ce('0x2e')](_[_0xc1ce('0x2f')](_0x5efc64),['createdAt',_0xc1ce('0x30'),'CompanyId','ListId']);if(_0x305f8a[_0xc1ce('0x28')]['id']){delete _0x305f8a[_0xc1ce('0x28')]['id'];}if(_[_0xc1ce('0x31')](_0x305f8a['body'][_0xc1ce('0x32')])){throw new db[(_0xc1ce('0x2b'))][(_0xc1ce('0x2c'))](_0xc1ce('0x33'));}if(_[_0xc1ce('0x31')](_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x28')])||_0x305f8a['body'][_0xc1ce('0x28')]===''){throw new db[(_0xc1ce('0x2b'))]['ValidationError'](_0xc1ce('0x34'));}if(_[_0xc1ce('0x31')](_0x305f8a[_0xc1ce('0x28')]['mapKey'])){throw new db['Sequelize'][(_0xc1ce('0x2c'))](_0xc1ce('0x35')+_0x2c395f);}if(!_['includes'](_0x2c395f,_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x36')])){throw new db[(_0xc1ce('0x2b'))][(_0xc1ce('0x2c'))](_0xc1ce('0x37')+_0x2c395f);}_0x1a4517[_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x36')]]=_0x305f8a[_0xc1ce('0x28')]['from'];})[_0xc1ce('0x26')](function(){return db[_0xc1ce('0x1d')]['find']({'where':{'id':_0x305f8a['account']['id']},'include':[{'model':db[_0xc1ce('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc1ce('0x39'),'where':_0x1a4517,'limit':0x1,'order':[[_0xc1ce('0x30'),'DESC']]}]},{'model':db[_0xc1ce('0x3a')],'as':_0xc1ce('0x3b')}]});})[_0xc1ce('0x26')](function(_0x756db7){if(_0x756db7&&_0x756db7[_0xc1ce('0x3c')]){var _0x5831b1=_0x756db7[_0xc1ce('0x3d')]({'plain':!![]});_0x28be42[_0xc1ce('0x3e')]=_0x5831b1;_0x28be42[_0xc1ce('0x3f')]=_0x5831b1['Applications'];_0x28be42['list']=_0x5831b1[_0xc1ce('0x3c')];_0x28be42['applications']=_[_0xc1ce('0x40')](_0x28be42[_0xc1ce('0x3f')],[_0xc1ce('0x41')],[_0xc1ce('0x42')]);if(_0x28be42[_0xc1ce('0x3e')][_0xc1ce('0x3b')]){delete _0x28be42[_0xc1ce('0x3e')]['Applications'];}if(_0x28be42['account']['List']&&_0x28be42[_0xc1ce('0x3e')][_0xc1ce('0x3c')][_0xc1ce('0x39')][_0xc1ce('0x43')]){return _0x28be42[_0xc1ce('0x3e')]['List']['Contacts'][0x0];}var _0x2b342d=_[_0xc1ce('0xc')](_0x305f8a[_0xc1ce('0x28')],{'firstName':_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x32')],'ListId':_0x5831b1[_0xc1ce('0x44')]});_0x2b342d[_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x36')]]=_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x32')];return db[_0xc1ce('0x45')][_0xc1ce('0x46')](_0x2b342d,{'fields':_0x4fc14d,'raw':!![]});}})[_0xc1ce('0x26')](function(_0x34a03f){_0x28be42[_0xc1ce('0x47')]=_0x34a03f;if(_0x34a03f){var _0x3ea269={'ContactId':_0x34a03f['id'],'FaxAccountId':_0x305f8a['account']['id'],'fax':_0x34a03f[_0xc1ce('0x29')]};return db[_0xc1ce('0x48')][_0xc1ce('0x49')]({'where':{'ContactId':_0x34a03f['id'],'closed':![],'FaxAccountId':_0x305f8a[_0xc1ce('0x3e')]['id']}})[_0xc1ce('0x26')](function(_0xab9619){if(_0xab9619){return[_0xab9619,![]];}return db[_0xc1ce('0x48')][_0xc1ce('0x46')](_0x3ea269)['then'](function(_0x5c94a0){return[_0x5c94a0,!![]];});});}else{throw new Error(_0xc1ce('0x4a'));}})[_0xc1ce('0x4b')](function(_0x356ecf,_0x1cb824){var _0x433b66=_0x356ecf[_0xc1ce('0x3d')]({'plain':!![]});if(_0x1cb824){if(_0x28be42[_0xc1ce('0x3e')][_0xc1ce('0x4c')]){_0x28be42[_0xc1ce('0x3f')][_0xc1ce('0x4d')]({'id':0x0,'priority':_0x28be42[_0xc1ce('0x3f')][_0xc1ce('0x43')]+0x1,'app':_0xc1ce('0x4e'),'appdata':_0xc1ce('0x4f'),'interval':_0xc1ce('0x50')});}_0x433b66[_0xc1ce('0x51')]=!![];}else{_0x433b66[_0xc1ce('0x51')]=![];}_0x28be42[_0xc1ce('0x52')]=_0x433b66;return db[_0xc1ce('0x53')][_0xc1ce('0x46')]({'body':_0x305f8a[_0xc1ce('0x28')][_0xc1ce('0x28')],'FaxAccountId':_0x305f8a[_0xc1ce('0x3e')]['id'],'FaxInteractionId':_0x356ecf['id'],'direction':'in','ContactId':_0x356ecf[_0xc1ce('0x54')],'AttachmentId':_0x305f8a[_0xc1ce('0x28')]['AttachmentId']});})[_0xc1ce('0x26')](function(_0x329590){_0x28be42['message']=_0x329590;if(_0x28be42[_0xc1ce('0x52')][_0xc1ce('0x55')]){return db['User'][_0xc1ce('0x49')]({'attributes':['id',_0xc1ce('0x56')],'where':{'id':_0x28be42[_0xc1ce('0x52')]['UserId']}})['then'](function(_0x1d9381){if(_0x1d9381){_0x28be42[_0xc1ce('0x3f')][_0xc1ce('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1d9381[_0xc1ce('0x56')]+','+(_0x28be42[_0xc1ce('0x3e')][_0xc1ce('0x58')]||0xa),'interval':_0xc1ce('0x50')});}return respondWithRpcPromise(_0xc1ce('0x59'),'startRouting',_0x28be42);});}return respondWithRpcPromise(_0xc1ce('0x59'),_0xc1ce('0x5a'),_0x28be42);})[_0xc1ce('0x26')](function(_0x4e7dbe){_0x3decba(_0x4e7dbe);})[_0xc1ce('0x1b')](function(_0x392c48){_0x3569b7(_0x16e2ec[_0xc1ce('0x18')](0x1f4,_0x392c48[_0xc1ce('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 46dad88..fd06756 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 _0x8220=['length','./faxAccount.events','save','removeListener'];(function(_0x456f45,_0x1c53a5){var _0x2ddc34=function(_0x5d42c5){while(--_0x5d42c5){_0x456f45['push'](_0x456f45['shift']());}};_0x2ddc34(++_0x1c53a5);}(_0x8220,0x99));var _0x0822=function(_0x2ea183,_0x3cff11){_0x2ea183=_0x2ea183-0x0;var _0x47c16c=_0x8220[_0x2ea183];return _0x47c16c;};'use strict';var FaxAccountEvents=require(_0x0822('0x0'));var events=[_0x0822('0x1'),'remove','update'];function createListener(_0x2efbe0,_0x49b1bd){return function(_0x2ef8b9){_0x49b1bd['emit'](_0x2efbe0,_0x2ef8b9);};}function removeListener(_0xffdceb,_0x2fc244){return function(){FaxAccountEvents[_0x0822('0x2')](_0xffdceb,_0x2fc244);};}exports['register']=function(_0x329568){for(var _0x504016=0x0,_0x3814ab=events[_0x0822('0x3')];_0x504016<_0x3814ab;_0x504016++){var _0x413335=events[_0x504016];var _0xe48074=createListener('faxAccount:'+_0x413335,_0x329568);FaxAccountEvents['on'](_0x413335,_0xe48074);}}; \ No newline at end of file +var _0x24f4=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x57a449,_0x36099d){var _0x3ea42c=function(_0x251cd0){while(--_0x251cd0){_0x57a449['push'](_0x57a449['shift']());}};_0x3ea42c(++_0x36099d);}(_0x24f4,0x98));var _0x424f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24f4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0x424f('0x0'));var events=[_0x424f('0x1'),_0x424f('0x2'),_0x424f('0x3')];function createListener(_0x3b8995,_0x32be08){return function(_0x1821fa){_0x32be08[_0x424f('0x4')](_0x3b8995,_0x1821fa);};}function removeListener(_0xd87ec3,_0x3440cb){return function(){FaxAccountEvents[_0x424f('0x5')](_0xd87ec3,_0x3440cb);};}exports[_0x424f('0x6')]=function(_0x3d734c){for(var _0x2ce2d3=0x0,_0x3b24b6=events[_0x424f('0x7')];_0x2ce2d3<_0x3b24b6;_0x2ce2d3++){var _0x3af36f=events[_0x2ce2d3];var _0x31b5af=createListener(_0x424f('0x8')+_0x3af36f,_0x3d734c);FaxAccountEvents['on'](_0x3af36f,_0x31b5af);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index aae0b9d..7c6bce6 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(_0x54793c,_0x2fd39a){var _0x45ccf4=function(_0x265bdc){while(--_0x265bdc){_0x54793c['push'](_0x54793c['shift']());}};_0x45ccf4(++_0x2fd39a);}(_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('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(_0xbf3852,_0x4077dc){var _0x3000c5=function(_0x233ce6){while(--_0x233ce6){_0xbf3852['push'](_0xbf3852['shift']());}};_0x3000c5(++_0x4077dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 071d3b9..fd38bf9 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 _0xf10e=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x304e3a,_0x249170){var _0x2f51b3=function(_0x4f635c){while(--_0x4f635c){_0x304e3a['push'](_0x304e3a['shift']());}};_0x2f51b3(++_0x249170);}(_0xf10e,0x194));var _0xef10=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xf10e[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require('sequelize');module[_0xef10('0x0')]={'priority':{'type':Sequelize[_0xef10('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xef10('0x2')],'allowNull':![],'defaultValue':_0xef10('0x3')},'appdata':{'type':Sequelize[_0xef10('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xef10('0x2')],'defaultValue':_0xef10('0x5')}}; \ No newline at end of file +var _0xcdee=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x12f484,_0x4526d4){var _0x45ef1e=function(_0x36934c){while(--_0x36934c){_0x12f484['push'](_0x12f484['shift']());}};_0x45ef1e(++_0x4526d4);}(_0xcdee,0x187));var _0xecde=function(_0x168f72,_0x132a3a){_0x168f72=_0x168f72-0x0;var _0x59f906=_0xcdee[_0x168f72];return _0x59f906;};'use strict';var Sequelize=require(_0xecde('0x0'));module[_0xecde('0x1')]={'priority':{'type':Sequelize[_0xecde('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xecde('0x3')],'allowNull':![],'defaultValue':_0xecde('0x4')},'appdata':{'type':Sequelize[_0xecde('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xecde('0x3')],'defaultValue':_0xecde('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d890acb..b39de20 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 _0x2037=['offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','VIRTUAL','merge','FaxApplication','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xbbaf87,_0x43b64f){var _0x454b4f=function(_0x25936f){while(--_0x25936f){_0xbbaf87['push'](_0xbbaf87['shift']());}};_0x454b4f(++_0x43b64f);}(_0x2037,0x77));var _0x7203=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0x2037[_0x34b821];return _0x5e00a0;};'use strict';var emlformat=require(_0x7203('0x0'));var rimraf=require(_0x7203('0x1'));var zipdir=require(_0x7203('0x2'));var jsonpatch=require(_0x7203('0x3'));var rp=require(_0x7203('0x4'));var moment=require(_0x7203('0x5'));var BPromise=require(_0x7203('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7203('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7203('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7203('0x9'));var jsforce=require(_0x7203('0xa'));var deskjs=require(_0x7203('0xb'));var toCsv=require(_0x7203('0x7'));var querystring=require(_0x7203('0xc'));var Papa=require(_0x7203('0xd'));var Redis=require(_0x7203('0xe'));var authService=require(_0x7203('0xf'));var qs=require(_0x7203('0x10'));var as=require(_0x7203('0x11'));var hardwareService=require(_0x7203('0x12'));var logger=require(_0x7203('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7203('0x14'));var licenseUtil=require(_0x7203('0x15'));var db=require(_0x7203('0x16'))['db'];function respondWithStatusCode(_0x52c36d,_0x1bfd7c){_0x1bfd7c=_0x1bfd7c||0xcc;return function(_0x315805){if(_0x315805){return _0x52c36d[_0x7203('0x17')](_0x1bfd7c);}return _0x52c36d[_0x7203('0x18')](_0x1bfd7c)[_0x7203('0x19')]();};}function respondWithResult(_0x3250a9,_0x2341eb){_0x2341eb=_0x2341eb||0xc8;return function(_0x185e79){if(_0x185e79){return _0x3250a9[_0x7203('0x18')](_0x2341eb)[_0x7203('0x1a')](_0x185e79);}};}function respondWithFilteredResult(_0x5b49fb,_0x3d3f1f){return function(_0x351a97){if(_0x351a97){var _0x4bed49=typeof _0x3d3f1f[_0x7203('0x1b')]===_0x7203('0x1c')&&typeof _0x3d3f1f['limit']===_0x7203('0x1c');var _0x7a9ce8=_0x351a97[_0x7203('0x1d')];var _0x4fd6c5=_0x4bed49?0x0:_0x3d3f1f[_0x7203('0x1b')];var _0x523c98=_0x4bed49?_0x351a97[_0x7203('0x1d')]:_0x3d3f1f[_0x7203('0x1b')]+_0x3d3f1f['limit'];var _0x55e9f1;if(_0x523c98>=_0x7a9ce8){_0x523c98=_0x7a9ce8;_0x55e9f1=0xc8;}else{_0x55e9f1=0xce;}_0x5b49fb[_0x7203('0x18')](_0x55e9f1);return _0x5b49fb[_0x7203('0x1e')](_0x7203('0x1f'),_0x4fd6c5+'-'+_0x523c98+'/'+_0x7a9ce8)[_0x7203('0x1a')](_0x351a97);}return null;};}function patchUpdates(_0x1e4aa2){return function(_0x35628f){try{jsonpatch[_0x7203('0x20')](_0x35628f,_0x1e4aa2,!![]);}catch(_0x276215){return BPromise[_0x7203('0x21')](_0x276215);}return _0x35628f[_0x7203('0x22')]();};}function saveUpdates(_0x4ab47c,_0x47cc60){return function(_0x572556){if(_0x572556){return _0x572556['update'](_0x4ab47c)['then'](function(_0x5b15bb){return _0x5b15bb;});}return null;};}function removeEntity(_0x27e769,_0x547ed5){return function(_0x4232d4){if(_0x4232d4){return _0x4232d4[_0x7203('0x23')]()[_0x7203('0x24')](function(){_0x27e769[_0x7203('0x18')](0xcc)[_0x7203('0x19')]();});}};}function handleEntityNotFound(_0x4d221b,_0x358d3d){return function(_0x5989bc){if(!_0x5989bc){_0x4d221b['sendStatus'](0x194);}return _0x5989bc;};}function handleError(_0x4a9aef,_0xf7509){_0xf7509=_0xf7509||0x1f4;return function(_0x3244b){logger[_0x7203('0x25')](_0x3244b[_0x7203('0x26')]);if(_0x3244b[_0x7203('0x27')]){delete _0x3244b[_0x7203('0x27')];}_0x4a9aef['status'](_0xf7509)['send'](_0x3244b);};}exports[_0x7203('0x28')]=function(_0x231c41,_0x119513){var _0x1a4fd9={},_0x5aaf10={},_0x480b8f={'count':0x0,'rows':[]};var _0x5617eb=_[_0x7203('0x29')](db['FaxApplication'][_0x7203('0x2a')],function(_0x3c8e65){return{'name':_0x3c8e65['fieldName'],'type':_0x3c8e65[_0x7203('0x2b')][_0x7203('0x2c')]};});_0x5aaf10[_0x7203('0x2d')]=_[_0x7203('0x29')](_0x5617eb,_0x7203('0x27'));_0x5aaf10[_0x7203('0x2e')]=_[_0x7203('0x2f')](_0x231c41[_0x7203('0x2e')]);_0x5aaf10[_0x7203('0x30')]=_[_0x7203('0x31')](_0x5aaf10[_0x7203('0x2d')],_0x5aaf10['query']);_0x1a4fd9[_0x7203('0x32')]=_[_0x7203('0x31')](_0x5aaf10[_0x7203('0x2d')],qs[_0x7203('0x33')](_0x231c41[_0x7203('0x2e')][_0x7203('0x33')]));_0x1a4fd9[_0x7203('0x32')]=_0x1a4fd9['attributes']['length']?_0x1a4fd9[_0x7203('0x32')]:_0x5aaf10[_0x7203('0x2d')];if(!_0x231c41[_0x7203('0x2e')][_0x7203('0x34')](_0x7203('0x35'))){_0x1a4fd9[_0x7203('0x36')]=qs[_0x7203('0x36')](_0x231c41['query']['limit']);_0x1a4fd9[_0x7203('0x1b')]=qs[_0x7203('0x1b')](_0x231c41[_0x7203('0x2e')]['offset']);}_0x1a4fd9[_0x7203('0x37')]=qs[_0x7203('0x38')](_0x231c41[_0x7203('0x2e')]['sort']);_0x1a4fd9['where']=qs[_0x7203('0x30')](_['pick'](_0x231c41[_0x7203('0x2e')],_0x5aaf10[_0x7203('0x30')]),_0x5617eb);if(_0x231c41[_0x7203('0x2e')][_0x7203('0x39')]){_0x1a4fd9['where']=_['merge'](_0x1a4fd9['where'],{'$or':_['map'](_0x5617eb,function(_0x36b609){if(_0x36b609[_0x7203('0x2b')]!==_0x7203('0x3a')){var _0xa37e2c={};_0xa37e2c[_0x36b609[_0x7203('0x27')]]={'$like':'%'+_0x231c41[_0x7203('0x2e')][_0x7203('0x39')]+'%'};return _0xa37e2c;}})});}_0x1a4fd9=_[_0x7203('0x3b')]({},_0x1a4fd9,_0x231c41['options']);var _0x7bad93={'where':_0x1a4fd9['where']};return db[_0x7203('0x3c')][_0x7203('0x1d')](_0x7bad93)['then'](function(_0x27d062){_0x480b8f[_0x7203('0x1d')]=_0x27d062;if(_0x231c41[_0x7203('0x2e')][_0x7203('0x3d')]){_0x1a4fd9[_0x7203('0x3e')]=[{'all':!![]}];}return db[_0x7203('0x3c')][_0x7203('0x3f')](_0x1a4fd9);})[_0x7203('0x24')](function(_0x266fe8){_0x480b8f[_0x7203('0x40')]=_0x266fe8;return _0x480b8f;})[_0x7203('0x24')](respondWithFilteredResult(_0x119513,_0x1a4fd9))[_0x7203('0x41')](handleError(_0x119513,null));};exports['show']=function(_0x2aadc3,_0xfabe22){var _0x37cafd={'raw':!![],'where':{'id':_0x2aadc3[_0x7203('0x42')]['id']}},_0x6fba03={};_0x6fba03[_0x7203('0x2d')]=_[_0x7203('0x2f')](db[_0x7203('0x3c')]['rawAttributes']);_0x6fba03[_0x7203('0x2e')]=_[_0x7203('0x2f')](_0x2aadc3[_0x7203('0x2e')]);_0x6fba03[_0x7203('0x30')]=_[_0x7203('0x31')](_0x6fba03[_0x7203('0x2d')],_0x6fba03[_0x7203('0x2e')]);_0x37cafd[_0x7203('0x32')]=_[_0x7203('0x31')](_0x6fba03[_0x7203('0x2d')],qs['fields'](_0x2aadc3[_0x7203('0x2e')]['fields']));_0x37cafd[_0x7203('0x32')]=_0x37cafd[_0x7203('0x32')][_0x7203('0x43')]?_0x37cafd[_0x7203('0x32')]:_0x6fba03[_0x7203('0x2d')];if(_0x2aadc3['query'][_0x7203('0x3d')]){_0x37cafd[_0x7203('0x3e')]=[{'all':!![]}];}_0x37cafd=_[_0x7203('0x3b')]({},_0x37cafd,_0x2aadc3[_0x7203('0x44')]);return db[_0x7203('0x3c')][_0x7203('0x45')](_0x37cafd)[_0x7203('0x24')](handleEntityNotFound(_0xfabe22,null))[_0x7203('0x24')](respondWithResult(_0xfabe22,null))[_0x7203('0x41')](handleError(_0xfabe22,null));};exports[_0x7203('0x46')]=function(_0x426b68,_0xb68898){return db[_0x7203('0x3c')][_0x7203('0x46')](_0x426b68[_0x7203('0x47')],{})[_0x7203('0x24')](respondWithResult(_0xb68898,0xc9))[_0x7203('0x41')](handleError(_0xb68898,null));};exports[_0x7203('0x48')]=function(_0x409032,_0x2a5929){if(_0x409032['body']['id']){delete _0x409032[_0x7203('0x47')]['id'];}return db[_0x7203('0x3c')][_0x7203('0x45')]({'where':{'id':_0x409032[_0x7203('0x42')]['id']}})[_0x7203('0x24')](handleEntityNotFound(_0x2a5929,null))[_0x7203('0x24')](saveUpdates(_0x409032[_0x7203('0x47')],null))['then'](respondWithResult(_0x2a5929,null))[_0x7203('0x41')](handleError(_0x2a5929,null));};exports[_0x7203('0x23')]=function(_0x767ba4,_0x1b927e){return db['FaxApplication'][_0x7203('0x45')]({'where':{'id':_0x767ba4[_0x7203('0x42')]['id']}})[_0x7203('0x24')](handleEntityNotFound(_0x1b927e,null))[_0x7203('0x24')](removeEntity(_0x1b927e,null))[_0x7203('0x41')](handleError(_0x1b927e,null));}; \ No newline at end of file +var _0x5b73=['rows','catch','show','rawAttributes','find','create','body','params','zip-dir','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','FaxApplication','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include'];(function(_0x2b9d5a,_0x422662){var _0x46bcea=function(_0x497c99){while(--_0x497c99){_0x2b9d5a['push'](_0x2b9d5a['shift']());}};_0x46bcea(++_0x422662);}(_0x5b73,0x8e));var _0x35b7=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x5b73[_0x53afa6];return _0x51f86a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x35b7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x35b7('0x1'));var BPromise=require(_0x35b7('0x2'));var Mustache=require(_0x35b7('0x3'));var util=require('util');var path=require(_0x35b7('0x4'));var sox=require('sox');var csv=require(_0x35b7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35b7('0x6'));var squel=require(_0x35b7('0x7'));var crypto=require(_0x35b7('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x35b7('0x9'));var toCsv=require(_0x35b7('0x5'));var querystring=require('querystring');var Papa=require(_0x35b7('0xa'));var Redis=require(_0x35b7('0xb'));var authService=require(_0x35b7('0xc'));var qs=require(_0x35b7('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35b7('0xe'));var logger=require('../../config/logger')(_0x35b7('0xf'));var utils=require(_0x35b7('0x10'));var config=require(_0x35b7('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x35b7('0x12'))['db'];function respondWithStatusCode(_0x1af25c,_0x31dab7){_0x31dab7=_0x31dab7||0xcc;return function(_0x243ace){if(_0x243ace){return _0x1af25c[_0x35b7('0x13')](_0x31dab7);}return _0x1af25c[_0x35b7('0x14')](_0x31dab7)[_0x35b7('0x15')]();};}function respondWithResult(_0x3f546d,_0x151682){_0x151682=_0x151682||0xc8;return function(_0x36b8af){if(_0x36b8af){return _0x3f546d[_0x35b7('0x14')](_0x151682)['json'](_0x36b8af);}};}function respondWithFilteredResult(_0x160926,_0x556d1a){return function(_0x26585f){if(_0x26585f){var _0x410b21=typeof _0x556d1a[_0x35b7('0x16')]==='undefined'&&typeof _0x556d1a[_0x35b7('0x17')]===_0x35b7('0x18');var _0x585a8f=_0x26585f[_0x35b7('0x19')];var _0xfa9739=_0x410b21?0x0:_0x556d1a['offset'];var _0x17746d=_0x410b21?_0x26585f['count']:_0x556d1a['offset']+_0x556d1a[_0x35b7('0x17')];var _0x137e4a;if(_0x17746d>=_0x585a8f){_0x17746d=_0x585a8f;_0x137e4a=0xc8;}else{_0x137e4a=0xce;}_0x160926[_0x35b7('0x14')](_0x137e4a);return _0x160926[_0x35b7('0x1a')](_0x35b7('0x1b'),_0xfa9739+'-'+_0x17746d+'/'+_0x585a8f)['json'](_0x26585f);}return null;};}function patchUpdates(_0x3d9a04){return function(_0x19398b){try{jsonpatch['apply'](_0x19398b,_0x3d9a04,!![]);}catch(_0x5a0f8d){return BPromise[_0x35b7('0x1c')](_0x5a0f8d);}return _0x19398b['save']();};}function saveUpdates(_0x42573c,_0x7a7fb8){return function(_0x2cd07c){if(_0x2cd07c){return _0x2cd07c[_0x35b7('0x1d')](_0x42573c)[_0x35b7('0x1e')](function(_0x1b0c18){return _0x1b0c18;});}return null;};}function removeEntity(_0x515f65,_0x474933){return function(_0x14393c){if(_0x14393c){return _0x14393c[_0x35b7('0x1f')]()[_0x35b7('0x1e')](function(){_0x515f65[_0x35b7('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389617,_0x360b59){return function(_0x5cb8d1){if(!_0x5cb8d1){_0x389617[_0x35b7('0x13')](0x194);}return _0x5cb8d1;};}function handleError(_0x5764bf,_0x198210){_0x198210=_0x198210||0x1f4;return function(_0xf1d9cd){logger[_0x35b7('0x20')](_0xf1d9cd['stack']);if(_0xf1d9cd[_0x35b7('0x21')]){delete _0xf1d9cd[_0x35b7('0x21')];}_0x5764bf['status'](_0x198210)[_0x35b7('0x22')](_0xf1d9cd);};}exports[_0x35b7('0x23')]=function(_0x5eac43,_0x27c372){var _0x2e5705={},_0x2c6538={},_0x3925b9={'count':0x0,'rows':[]};var _0x105823=_[_0x35b7('0x24')](db[_0x35b7('0x25')]['rawAttributes'],function(_0x2bbc66){return{'name':_0x2bbc66[_0x35b7('0x26')],'type':_0x2bbc66['type']['key']};});_0x2c6538[_0x35b7('0x27')]=_[_0x35b7('0x24')](_0x105823,'name');_0x2c6538[_0x35b7('0x28')]=_[_0x35b7('0x29')](_0x5eac43[_0x35b7('0x28')]);_0x2c6538[_0x35b7('0x2a')]=_[_0x35b7('0x2b')](_0x2c6538[_0x35b7('0x27')],_0x2c6538[_0x35b7('0x28')]);_0x2e5705['attributes']=_[_0x35b7('0x2b')](_0x2c6538[_0x35b7('0x27')],qs[_0x35b7('0x2c')](_0x5eac43[_0x35b7('0x28')][_0x35b7('0x2c')]));_0x2e5705[_0x35b7('0x2d')]=_0x2e5705[_0x35b7('0x2d')][_0x35b7('0x2e')]?_0x2e5705[_0x35b7('0x2d')]:_0x2c6538[_0x35b7('0x27')];if(!_0x5eac43[_0x35b7('0x28')][_0x35b7('0x2f')](_0x35b7('0x30'))){_0x2e5705['limit']=qs[_0x35b7('0x17')](_0x5eac43[_0x35b7('0x28')][_0x35b7('0x17')]);_0x2e5705['offset']=qs[_0x35b7('0x16')](_0x5eac43[_0x35b7('0x28')][_0x35b7('0x16')]);}_0x2e5705[_0x35b7('0x31')]=qs[_0x35b7('0x32')](_0x5eac43[_0x35b7('0x28')][_0x35b7('0x32')]);_0x2e5705[_0x35b7('0x33')]=qs[_0x35b7('0x2a')](_[_0x35b7('0x34')](_0x5eac43['query'],_0x2c6538[_0x35b7('0x2a')]),_0x105823);if(_0x5eac43[_0x35b7('0x28')][_0x35b7('0x35')]){_0x2e5705[_0x35b7('0x33')]=_[_0x35b7('0x36')](_0x2e5705['where'],{'$or':_[_0x35b7('0x24')](_0x105823,function(_0x5b22fb){if(_0x5b22fb[_0x35b7('0x37')]!=='VIRTUAL'){var _0x394781={};_0x394781[_0x5b22fb[_0x35b7('0x21')]]={'$like':'%'+_0x5eac43['query']['filter']+'%'};return _0x394781;}})});}_0x2e5705=_['merge']({},_0x2e5705,_0x5eac43[_0x35b7('0x38')]);var _0x3d1e12={'where':_0x2e5705[_0x35b7('0x33')]};return db['FaxApplication'][_0x35b7('0x19')](_0x3d1e12)[_0x35b7('0x1e')](function(_0x41fb0c){_0x3925b9[_0x35b7('0x19')]=_0x41fb0c;if(_0x5eac43[_0x35b7('0x28')][_0x35b7('0x39')]){_0x2e5705[_0x35b7('0x3a')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x2e5705);})['then'](function(_0x5c9001){_0x3925b9[_0x35b7('0x3b')]=_0x5c9001;return _0x3925b9;})[_0x35b7('0x1e')](respondWithFilteredResult(_0x27c372,_0x2e5705))[_0x35b7('0x3c')](handleError(_0x27c372,null));};exports[_0x35b7('0x3d')]=function(_0x444e19,_0x2f9bc9){var _0x2b3f58={'raw':!![],'where':{'id':_0x444e19['params']['id']}},_0x5e3643={};_0x5e3643[_0x35b7('0x27')]=_[_0x35b7('0x29')](db[_0x35b7('0x25')][_0x35b7('0x3e')]);_0x5e3643['query']=_[_0x35b7('0x29')](_0x444e19[_0x35b7('0x28')]);_0x5e3643[_0x35b7('0x2a')]=_[_0x35b7('0x2b')](_0x5e3643[_0x35b7('0x27')],_0x5e3643[_0x35b7('0x28')]);_0x2b3f58[_0x35b7('0x2d')]=_[_0x35b7('0x2b')](_0x5e3643[_0x35b7('0x27')],qs['fields'](_0x444e19['query'][_0x35b7('0x2c')]));_0x2b3f58[_0x35b7('0x2d')]=_0x2b3f58['attributes'][_0x35b7('0x2e')]?_0x2b3f58[_0x35b7('0x2d')]:_0x5e3643[_0x35b7('0x27')];if(_0x444e19[_0x35b7('0x28')][_0x35b7('0x39')]){_0x2b3f58[_0x35b7('0x3a')]=[{'all':!![]}];}_0x2b3f58=_[_0x35b7('0x36')]({},_0x2b3f58,_0x444e19[_0x35b7('0x38')]);return db['FaxApplication'][_0x35b7('0x3f')](_0x2b3f58)[_0x35b7('0x1e')](handleEntityNotFound(_0x2f9bc9,null))['then'](respondWithResult(_0x2f9bc9,null))[_0x35b7('0x3c')](handleError(_0x2f9bc9,null));};exports[_0x35b7('0x40')]=function(_0x236608,_0x7594c8){return db['FaxApplication']['create'](_0x236608[_0x35b7('0x41')],{})[_0x35b7('0x1e')](respondWithResult(_0x7594c8,0xc9))[_0x35b7('0x3c')](handleError(_0x7594c8,null));};exports[_0x35b7('0x1d')]=function(_0x3fe673,_0x2dfdee){if(_0x3fe673['body']['id']){delete _0x3fe673[_0x35b7('0x41')]['id'];}return db[_0x35b7('0x25')][_0x35b7('0x3f')]({'where':{'id':_0x3fe673[_0x35b7('0x42')]['id']}})[_0x35b7('0x1e')](handleEntityNotFound(_0x2dfdee,null))[_0x35b7('0x1e')](saveUpdates(_0x3fe673[_0x35b7('0x41')],null))['then'](respondWithResult(_0x2dfdee,null))[_0x35b7('0x3c')](handleError(_0x2dfdee,null));};exports[_0x35b7('0x1f')]=function(_0x23d768,_0x206dd8){return db['FaxApplication'][_0x35b7('0x3f')]({'where':{'id':_0x23d768['params']['id']}})[_0x35b7('0x1e')](handleEntityNotFound(_0x206dd8,null))['then'](removeEntity(_0x206dd8,null))[_0x35b7('0x3c')](handleError(_0x206dd8,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 3d804bf..f0d24da 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 _0x37cc=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x12bfd2,_0x2079b6){var _0x2c6a25=function(_0x1ed3ee){while(--_0x1ed3ee){_0x12bfd2['push'](_0x12bfd2['shift']());}};_0x2c6a25(++_0x2079b6);}(_0x37cc,0xf6));var _0xc37c=function(_0x567793,_0x270c72){_0x567793=_0x567793-0x0;var _0x1d7cc9=_0x37cc[_0x567793];return _0x1d7cc9;};'use strict';var _=require('lodash');var util=require(_0xc37c('0x0'));var logger=require(_0xc37c('0x1'))('api');var moment=require(_0xc37c('0x2'));var BPromise=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var fs=require('fs');var path=require(_0xc37c('0x5'));var rimraf=require(_0xc37c('0x6'));var config=require('../../config/environment');var attributes=require(_0xc37c('0x7'));module[_0xc37c('0x8')]=function(_0x33b49b,_0x56522a){return _0x33b49b[_0xc37c('0x9')]('FaxApplication',attributes,{'tableName':_0xc37c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc37c('0xb'),'collate':_0xc37c('0xc')});}; \ No newline at end of file +var _0x30c7=['rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','api','moment','request-promise','path'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x30c7,0xcc));var _0x730c=function(_0x69cf6b,_0x4b8de9){_0x69cf6b=_0x69cf6b-0x0;var _0x3a2188=_0x30c7[_0x69cf6b];return _0x3a2188;};'use strict';var _=require('lodash');var util=require(_0x730c('0x0'));var logger=require('../../config/logger')(_0x730c('0x1'));var moment=require(_0x730c('0x2'));var BPromise=require('bluebird');var rp=require(_0x730c('0x3'));var fs=require('fs');var path=require(_0x730c('0x4'));var rimraf=require(_0x730c('0x5'));var config=require(_0x730c('0x6'));var attributes=require('./faxApplication.attributes');module[_0x730c('0x7')]=function(_0x2dd6f4,_0x11eb71){return _0x2dd6f4['define'](_0x730c('0x8'),attributes,{'tableName':_0x730c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x730c('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7beedb8..93c5aea 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 _0x7b3a=['code','message','result','UpdateFaxApplication','update','body','options','attributes','limit','info','debug','catch','lodash','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x35665d,_0x30573a){var _0x25d130=function(_0x4a29a6){while(--_0x4a29a6){_0x35665d['push'](_0x35665d['shift']());}};_0x25d130(++_0x30573a);}(_0x7b3a,0x93));var _0xa7b3=function(_0x395cd1,_0x29b587){_0x395cd1=_0x395cd1-0x0;var _0x3a92c2=_0x7b3a[_0x395cd1];return _0x3a92c2;};'use strict';var _=require(_0xa7b3('0x0'));var util=require('util');var moment=require(_0xa7b3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7b3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa7b3('0x3'))(_0xa7b3('0x4'));var config=require(_0xa7b3('0x5'));var jayson=require(_0xa7b3('0x6'));var client=jayson['client'][_0xa7b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x175ce0,_0x1b97ee,_0x3e4294){return new BPromise(function(_0x4c5d54,_0x1b14cf){return client[_0xa7b3('0x8')](_0x175ce0,_0x3e4294)[_0xa7b3('0x9')](function(_0x41e1ab){logger['info'](_0xa7b3('0xa'),_0x1b97ee,'request\x20sent');logger['debug'](_0xa7b3('0xb'),_0x1b97ee,_0xa7b3('0xc'),JSON[_0xa7b3('0xd')](_0x41e1ab));if(_0x41e1ab[_0xa7b3('0xe')]){if(_0x41e1ab['error'][_0xa7b3('0xf')]===0x1f4){logger[_0xa7b3('0xe')](_0xa7b3('0xa'),_0x1b97ee,_0x41e1ab[_0xa7b3('0xe')][_0xa7b3('0x10')]);return _0x1b14cf(_0x41e1ab[_0xa7b3('0xe')]['message']);}logger[_0xa7b3('0xe')](_0xa7b3('0xa'),_0x1b97ee,_0x41e1ab[_0xa7b3('0xe')][_0xa7b3('0x10')]);return _0x4c5d54(_0x41e1ab[_0xa7b3('0xe')]['message']);}else{logger['info'](_0xa7b3('0xa'),_0x1b97ee,'request\x20sent');_0x4c5d54(_0x41e1ab[_0xa7b3('0x11')][_0xa7b3('0x10')]);}})['catch'](function(_0xd6ef97){logger[_0xa7b3('0xe')](_0xa7b3('0xa'),_0x1b97ee,_0xd6ef97);_0x1b14cf(_0xd6ef97);});});}exports[_0xa7b3('0x12')]=function(_0xfa06){var _0x141422=this;return new Promise(function(_0x31778a,_0x1edfdd){return db['FaxApplication'][_0xa7b3('0x13')](_0xfa06[_0xa7b3('0x14')],{'raw':_0xfa06['options']?_0xfa06[_0xa7b3('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa06['options']?_0xfa06[_0xa7b3('0x15')]['where']||null:null,'attributes':_0xfa06['options']?_0xfa06[_0xa7b3('0x15')][_0xa7b3('0x16')]||null:null,'limit':_0xfa06[_0xa7b3('0x15')]?_0xfa06[_0xa7b3('0x15')][_0xa7b3('0x17')]||null:null})[_0xa7b3('0x9')](function(_0x3eee32){logger[_0xa7b3('0x18')](_0xa7b3('0x12'),_0xfa06);logger[_0xa7b3('0x19')](_0xa7b3('0x12'),_0xfa06,JSON[_0xa7b3('0xd')](_0x3eee32));_0x31778a(_0x3eee32);})[_0xa7b3('0x1a')](function(_0x54782b){logger[_0xa7b3('0xe')]('UpdateFaxApplication',_0x54782b[_0xa7b3('0x10')],_0xfa06);_0x1edfdd(_0x141422[_0xa7b3('0xe')](0x1f4,_0x54782b[_0xa7b3('0x10')]));});});}; \ No newline at end of file +var _0x2751=['attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw'];(function(_0x161104,_0x4e30b0){var _0x1fb30e=function(_0x2c9534){while(--_0x2c9534){_0x161104['push'](_0x161104['shift']());}};_0x1fb30e(++_0x4e30b0);}(_0x2751,0xbe));var _0x1275=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2751[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1275('0x0'));var util=require(_0x1275('0x1'));var moment=require(_0x1275('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1275('0x3'));var db=require(_0x1275('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1275('0x5'))(_0x1275('0x6'));var config=require(_0x1275('0x7'));var jayson=require(_0x1275('0x8'));var client=jayson[_0x1275('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca81ac,_0x5d2d44,_0x5855d7){return new BPromise(function(_0x56f837,_0x525e95){return client[_0x1275('0xa')](_0xca81ac,_0x5855d7)[_0x1275('0xb')](function(_0x5b423c){logger[_0x1275('0xc')](_0x1275('0xd'),_0x5d2d44,_0x1275('0xe'));logger[_0x1275('0xf')](_0x1275('0x10'),_0x5d2d44,'request\x20sent',JSON['stringify'](_0x5b423c));if(_0x5b423c['error']){if(_0x5b423c['error']['code']===0x1f4){logger[_0x1275('0x11')]('FaxApplication,\x20%s,\x20%s',_0x5d2d44,_0x5b423c[_0x1275('0x11')]['message']);return _0x525e95(_0x5b423c[_0x1275('0x11')][_0x1275('0x12')]);}logger[_0x1275('0x11')]('FaxApplication,\x20%s,\x20%s',_0x5d2d44,_0x5b423c[_0x1275('0x11')][_0x1275('0x12')]);return _0x56f837(_0x5b423c['error']['message']);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x5d2d44,_0x1275('0xe'));_0x56f837(_0x5b423c[_0x1275('0x13')][_0x1275('0x12')]);}})[_0x1275('0x14')](function(_0x38af8f){logger['error'](_0x1275('0xd'),_0x5d2d44,_0x38af8f);_0x525e95(_0x38af8f);});});}exports[_0x1275('0x15')]=function(_0x361a0f){var _0xc3f6cf=this;return new Promise(function(_0x59d829,_0x4a8977){return db[_0x1275('0x16')]['update'](_0x361a0f[_0x1275('0x17')],{'raw':_0x361a0f[_0x1275('0x18')]?_0x361a0f[_0x1275('0x18')][_0x1275('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x361a0f['options']?_0x361a0f['options']['where']||null:null,'attributes':_0x361a0f[_0x1275('0x18')]?_0x361a0f['options'][_0x1275('0x1a')]||null:null,'limit':_0x361a0f['options']?_0x361a0f[_0x1275('0x18')]['limit']||null:null})['then'](function(_0x482063){logger[_0x1275('0xc')](_0x1275('0x15'),_0x361a0f);logger[_0x1275('0xf')](_0x1275('0x15'),_0x361a0f,JSON['stringify'](_0x482063));_0x59d829(_0x482063);})[_0x1275('0x14')](function(_0x5c54c4){logger[_0x1275('0x11')](_0x1275('0x15'),_0x5c54c4[_0x1275('0x12')],_0x361a0f);_0x4a8977(_0xc3f6cf['error'](0x1f4,_0x5c54c4['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d6a608e..90fc13d 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 _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(_0x14e247,_0x517da7){var _0x24e0f7=function(_0x4b0f0c){while(--_0x4b0f0c){_0x14e247['push'](_0x14e247['shift']());}};_0x24e0f7(++_0x517da7);}(_0x5c00,0x17e));var _0x05c0=function(_0x26601e,_0x139a4c){_0x26601e=_0x26601e-0x0;var _0x116282=_0x5c00[_0x26601e];return _0x116282;};'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 +var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0x132a83,_0x2e780c){var _0x31e588=function(_0x50559e){while(--_0x50559e){_0x132a83['push'](_0x132a83['shift']());}};_0x31e588(++_0x2e780c);}(_0x14a0,0x8e));var _0x014a=function(_0x536b37,_0x5c69dc){_0x536b37=_0x536b37-0x0;var _0x57898f=_0x14a0[_0x536b37];return _0x57898f;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 3da9f24..61e76fe 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 _0x2f4b=['STRING','DATE','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x7d4dc8,_0x14d70e){var _0x20b216=function(_0x3575b0){while(--_0x3575b0){_0x7d4dc8['push'](_0x7d4dc8['shift']());}};_0x20b216(++_0x14d70e);}(_0x2f4b,0x1ee));var _0xb2f4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2f4b[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xb2f4('0x0'));module[_0xb2f4('0x1')]={'closed':{'type':Sequelize[_0xb2f4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb2f4('0x3')]},'secondDisposition':{'type':Sequelize[_0xb2f4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb2f4('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb2f4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb2f4('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb2f4('0x6')]('in',_0xb2f4('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x932f=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x4e2b1e,_0x2c7ab7){var _0x1b6be4=function(_0x235c06){while(--_0x235c06){_0x4e2b1e['push'](_0x4e2b1e['shift']());}};_0x1b6be4(++_0x2c7ab7);}(_0x932f,0x129));var _0xf932=function(_0x588945,_0x3f4046){_0x588945=_0x588945-0x0;var _0x46a5ed=_0x932f[_0x588945];return _0x46a5ed;};'use strict';var Sequelize=require(_0xf932('0x0'));module[_0xf932('0x1')]={'closed':{'type':Sequelize[_0xf932('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf932('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf932('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf932('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xf932('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf932('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf932('0x6')),'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 b9f686c..af9d3ff 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 _0x2ec7=['offset','undefined','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','FaxInteraction','type','key','getOptions','fax','query','user','model','rawAttributes','keys','filters','intersection','fields','attributes','length','merge','options','find','catch','create','body','params','destroy','describe','addMessage','FaxMessage','omit','getMessages','findOne','hasOwnProperty','limit','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','addTags','setTags','ids','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','./faxInteraction.socket','register','status','end','json'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x2ec7,0x131));var _0x72ec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ec7[_0x321bb2];return _0x9c12ed;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x72ec('0x0'));var BPromise=require('bluebird');var util=require(_0x72ec('0x1'));var path=require(_0x72ec('0x2'));var fs=require('fs');var _=require(_0x72ec('0x3'));var Redis=require(_0x72ec('0x4'));var interaction=require(_0x72ec('0x5'));var qs=require(_0x72ec('0x6'));var logger=require('../../config/logger')(_0x72ec('0x7'));var config=require('../../config/environment');var db=require(_0x72ec('0x8'))['db'];config[_0x72ec('0x9')]=_[_0x72ec('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72ec('0x9')]));require(_0x72ec('0xb'))[_0x72ec('0xc')](socket);function respondWithStatusCode(_0x57115a,_0x7b148c){_0x7b148c=_0x7b148c||0xcc;return function(_0x1cedd1){if(_0x1cedd1){return _0x57115a['sendStatus'](_0x7b148c);}return _0x57115a[_0x72ec('0xd')](_0x7b148c)[_0x72ec('0xe')]();};}function respondWithResult(_0x434c6d,_0x1d9299){_0x1d9299=_0x1d9299||0xc8;return function(_0x48b74e){if(_0x48b74e){return _0x434c6d[_0x72ec('0xd')](_0x1d9299)[_0x72ec('0xf')](_0x48b74e);}};}function respondWithFilteredResult(_0x46c4af,_0x2606fe){return function(_0x2ea79d){if(_0x2ea79d){var _0x1f3f14=typeof _0x2606fe[_0x72ec('0x10')]===_0x72ec('0x11')&&typeof _0x2606fe['limit']===_0x72ec('0x11');var _0x799783=_0x2ea79d[_0x72ec('0x12')];var _0x45f9f2=_0x1f3f14?0x0:_0x2606fe[_0x72ec('0x10')];var _0x4ad5a5=_0x1f3f14?_0x2ea79d[_0x72ec('0x12')]:_0x2606fe['offset']+_0x2606fe['limit'];var _0x395f11;if(_0x4ad5a5>=_0x799783){_0x4ad5a5=_0x799783;_0x395f11=0xc8;}else{_0x395f11=0xce;}_0x46c4af[_0x72ec('0xd')](_0x395f11);return _0x46c4af[_0x72ec('0x13')](_0x72ec('0x14'),_0x45f9f2+'-'+_0x4ad5a5+'/'+_0x799783)['json'](_0x2ea79d);}return null;};}function saveUpdates(_0x2bcc83){return function(_0x355477){if(_0x355477){return _0x355477[_0x72ec('0x15')](_0x2bcc83)['then'](function(_0xaaaead){return _0xaaaead;});}return null;};}function removeEntity(_0x534e9d){return function(_0x46c6e4){if(_0x46c6e4){return _0x46c6e4['destroy']()[_0x72ec('0x16')](function(){_0x534e9d[_0x72ec('0xd')](0xcc)[_0x72ec('0xe')]();});}};}function handleEntityNotFound(_0x661aba){return function(_0x307252){if(!_0x307252){_0x661aba[_0x72ec('0x17')](0x194);}return _0x307252;};}function handleError(_0x8c2265,_0x2745b2){_0x2745b2=_0x2745b2||0x1f4;return function(_0x2f5626){logger[_0x72ec('0x18')](_0x2f5626[_0x72ec('0x19')]);if(_0x2f5626[_0x72ec('0x1a')]){delete _0x2f5626[_0x72ec('0x1a')];}_0x8c2265[_0x72ec('0xd')](_0x2745b2)[_0x72ec('0x1b')](_0x2f5626);};}exports[_0x72ec('0x1c')]=function(_0x22a748,_0x281da2){var _0x4f4500={};var _0x285f8f=_[_0x72ec('0x1d')](db[_0x72ec('0x1e')]['rawAttributes'],function(_0x8192e2){return{'name':_0x8192e2['fieldName'],'type':_0x8192e2[_0x72ec('0x1f')][_0x72ec('0x20')]};});_0x4f4500=qs[_0x72ec('0x21')](_0x285f8f,_0x22a748);return interaction['findAll'](_0x72ec('0x22'),_0x22a748[_0x72ec('0x23')],_0x22a748[_0x72ec('0x24')],_0x4f4500,_0x285f8f)['then'](respondWithFilteredResult(_0x281da2,_0x4f4500))['catch'](handleError(_0x281da2,null));};exports['show']=function(_0x308d47,_0x4b0564){var _0x3e5adc={'raw':![],'where':{'id':_0x308d47['params']['id']}},_0x201ab6={};_0x201ab6[_0x72ec('0x25')]=_['keys'](db[_0x72ec('0x1e')][_0x72ec('0x26')]);_0x201ab6['query']=_[_0x72ec('0x27')](_0x308d47[_0x72ec('0x23')]);_0x201ab6[_0x72ec('0x28')]=_['intersection'](_0x201ab6[_0x72ec('0x25')],_0x201ab6[_0x72ec('0x23')]);_0x3e5adc['attributes']=_[_0x72ec('0x29')](_0x201ab6[_0x72ec('0x25')],qs[_0x72ec('0x2a')](_0x308d47[_0x72ec('0x23')][_0x72ec('0x2a')]));_0x3e5adc[_0x72ec('0x2b')]=_0x3e5adc[_0x72ec('0x2b')][_0x72ec('0x2c')]?_0x3e5adc[_0x72ec('0x2b')]:_0x201ab6['model'];if(_0x308d47['query']['includeAll']){_0x3e5adc['include']=[{'all':!![]}];}_0x3e5adc=_[_0x72ec('0x2d')]({},_0x3e5adc,_0x308d47[_0x72ec('0x2e')]);return db[_0x72ec('0x1e')][_0x72ec('0x2f')](_0x3e5adc)[_0x72ec('0x16')](handleEntityNotFound(_0x4b0564,null))['then'](respondWithResult(_0x4b0564,null))[_0x72ec('0x30')](handleError(_0x4b0564,null));};exports[_0x72ec('0x31')]=function(_0x41b481,_0x11d759){return db['FaxInteraction'][_0x72ec('0x31')](_0x41b481[_0x72ec('0x32')],{})['then'](respondWithResult(_0x11d759,0xc9))[_0x72ec('0x30')](handleError(_0x11d759,null));};exports[_0x72ec('0x15')]=function(_0x513ef4,_0x2e50e2){if(_0x513ef4['body']['id']){delete _0x513ef4[_0x72ec('0x32')]['id'];}return db[_0x72ec('0x1e')][_0x72ec('0x2f')]({'where':{'id':_0x513ef4[_0x72ec('0x33')]['id']}})['then'](handleEntityNotFound(_0x2e50e2,null))[_0x72ec('0x16')](saveUpdates(_0x513ef4[_0x72ec('0x32')],null))['then'](respondWithResult(_0x2e50e2,null))[_0x72ec('0x30')](handleError(_0x2e50e2,null));};exports[_0x72ec('0x34')]=function(_0x1cbaaf,_0x3efb4c){return db[_0x72ec('0x1e')]['find']({'where':{'id':_0x1cbaaf['params']['id']}})[_0x72ec('0x16')](handleEntityNotFound(_0x3efb4c,null))['then'](removeEntity(_0x3efb4c,null))[_0x72ec('0x30')](handleError(_0x3efb4c,null));};exports['describe']=function(_0x13f517,_0x2480b3){return db[_0x72ec('0x1e')][_0x72ec('0x35')]()[_0x72ec('0x16')](respondWithResult(_0x2480b3,null))[_0x72ec('0x30')](handleError(_0x2480b3,null));};exports[_0x72ec('0x36')]=function(_0x458c5e,_0x11ea8c){return db[_0x72ec('0x37')][_0x72ec('0x2f')]({'where':{'id':_0x458c5e['params']['id']}})[_0x72ec('0x16')](handleEntityNotFound(_0x11ea8c,null))[_0x72ec('0x16')](function(_0x35daf4){if(_0x35daf4){return _0x35daf4[_0x72ec('0x36')](_0x458c5e[_0x72ec('0x32')]['ids'],_[_0x72ec('0x38')](_0x458c5e['body'],['ids','id'])||{});}})[_0x72ec('0x16')](respondWithResult(_0x11ea8c,null))[_0x72ec('0x30')](handleError(_0x11ea8c,null));};exports[_0x72ec('0x39')]=function(_0x4deddc,_0x146794){var _0xa22839={'raw':![],'where':{}};var _0x422365={};var _0x4de112={'count':0x0,'rows':[]};return db[_0x72ec('0x1e')][_0x72ec('0x3a')]({'where':{'id':_0x4deddc['params']['id']}})[_0x72ec('0x16')](handleEntityNotFound(_0x146794,null))['then'](function(_0x352065){if(_0x352065){_0x422365[_0x72ec('0x25')]=_['keys'](db[_0x72ec('0x37')][_0x72ec('0x26')]);_0x422365[_0x72ec('0x23')]=_[_0x72ec('0x27')](_0x4deddc[_0x72ec('0x23')]);_0x422365[_0x72ec('0x28')]=_[_0x72ec('0x29')](_0x422365[_0x72ec('0x25')],_0x422365['query']);_0xa22839['attributes']=_['intersection'](_0x422365[_0x72ec('0x25')],qs['fields'](_0x4deddc[_0x72ec('0x23')][_0x72ec('0x2a')]));_0xa22839[_0x72ec('0x2b')]=_0xa22839[_0x72ec('0x2b')][_0x72ec('0x2c')]?_0xa22839[_0x72ec('0x2b')]:_0x422365['model'];if(!_0x4deddc[_0x72ec('0x23')][_0x72ec('0x3b')]('nolimit')){_0xa22839[_0x72ec('0x3c')]=qs[_0x72ec('0x3c')](_0x4deddc['query'][_0x72ec('0x3c')]);_0xa22839[_0x72ec('0x10')]=qs[_0x72ec('0x10')](_0x4deddc[_0x72ec('0x23')][_0x72ec('0x10')]);}_0xa22839[_0x72ec('0x3d')]=qs[_0x72ec('0x3e')](_0x4deddc['query'][_0x72ec('0x3e')]);_0xa22839[_0x72ec('0x3f')]=qs['filters'](_['pick'](_0x4deddc[_0x72ec('0x23')],_0x422365[_0x72ec('0x28')]));_0xa22839[_0x72ec('0x3f')][_0x72ec('0x40')]=_0x352065['id'];if(_0x4deddc[_0x72ec('0x23')][_0x72ec('0x41')]){_0xa22839['where']=_[_0x72ec('0x2d')](_0xa22839[_0x72ec('0x3f')],{'$or':_['map'](_0xa22839[_0x72ec('0x2b')],function(_0x59d791){var _0x22fe64={};_0x22fe64[_0x59d791]={'$like':'%'+_0x4deddc[_0x72ec('0x23')][_0x72ec('0x41')]+'%'};return _0x22fe64;})});}if(_0x4deddc['query'][_0x72ec('0x42')]){var _0x3dab3b=_0x4deddc[_0x72ec('0x23')][_0x72ec('0x42')][_0x72ec('0x43')](',');var _0x2bfc1a={};_0x2bfc1a[_0x3dab3b[0x0]]={'$gte':moment(_0x3dab3b[0x1])[_0x72ec('0x44')](_0x72ec('0x45'))};_0xa22839[_0x72ec('0x3f')]=_['merge'](_0xa22839[_0x72ec('0x3f')],_0x2bfc1a);}_0xa22839=_[_0x72ec('0x2d')]({},_0xa22839,_0x4deddc[_0x72ec('0x2e')]);return db[_0x72ec('0x37')][_0x72ec('0x12')]({'where':_0xa22839['where']})[_0x72ec('0x16')](function(_0x3f60d1){_0x4de112[_0x72ec('0x12')]=_0x3f60d1;if(_0x4deddc[_0x72ec('0x23')][_0x72ec('0x46')]){_0xa22839[_0x72ec('0x47')]=[{'all':!![]}];}return db[_0x72ec('0x37')][_0x72ec('0x48')](_0xa22839);})[_0x72ec('0x16')](function(_0x3d559b){_0x4de112[_0x72ec('0x49')]=_0x3d559b;return _0x4de112;});}})['then'](respondWithFilteredResult(_0x146794,_0xa22839))['catch'](handleError(_0x146794,null));};exports[_0x72ec('0x4a')]=function(_0x5830ff,_0x2e29e1){return db['FaxInteraction'][_0x72ec('0x2f')]({'where':{'id':_0x5830ff[_0x72ec('0x33')]['id']}})[_0x72ec('0x16')](handleEntityNotFound(_0x2e29e1,null))['then'](function(_0x3648ea){if(_0x3648ea){return _0x3648ea[_0x72ec('0x4b')](_0x5830ff[_0x72ec('0x32')][_0x72ec('0x4c')],_[_0x72ec('0x38')](_0x5830ff[_0x72ec('0x32')],['ids','id'])||{})[_0x72ec('0x4d')](function(){return db[_0x72ec('0x4e')][_0x72ec('0x48')]({'attributes':['id','name',_0x72ec('0x4f')],'where':{'id':_0x5830ff['body'][_0x72ec('0x4c')]}});})[_0x72ec('0x16')](function(_0x5c0828){socket[_0x72ec('0x50')](_0x72ec('0x51'),{'id':Number(_0x5830ff[_0x72ec('0x33')]['id']),'tags':_0x5c0828||[]});return{'id':Number(_0x5830ff[_0x72ec('0x33')]['id']),'tags':_0x5c0828||[]};});}})[_0x72ec('0x16')](respondWithResult(_0x2e29e1,null))[_0x72ec('0x30')](handleError(_0x2e29e1,null));};exports[_0x72ec('0x52')]=function(_0x343722,_0x3b3431){return db[_0x72ec('0x1e')]['find']({'where':{'id':_0x343722[_0x72ec('0x33')]['id']}})[_0x72ec('0x16')](handleEntityNotFound(_0x3b3431,null))[_0x72ec('0x16')](function(_0x40f90a){if(_0x40f90a){return _0x40f90a[_0x72ec('0x52')](_0x343722['query'][_0x72ec('0x4c')]);}})[_0x72ec('0x16')](respondWithStatusCode(_0x3b3431,null))[_0x72ec('0x30')](handleError(_0x3b3431,null));};exports[_0x72ec('0x53')]=function(_0x7b4e32,_0x2b391c){var _0x3b7597=moment()[_0x72ec('0x54')]()[_0x72ec('0x55')]();var _0x3e93c0=path[_0x72ec('0x56')](config['root'],_0x72ec('0x57'),_0x72ec('0x58'),_0x72ec('0x59'));var _0x372239=path[_0x72ec('0x56')](config[_0x72ec('0x5a')],_0x72ec('0x57'),_0x72ec('0x58'),_0x72ec('0x5b'));var _0x4b9e56=path['join'](_0x3e93c0,_0x3b7597);var _0x4d3e59=util[_0x72ec('0x44')]('transcript-%d-%s.zip',_0x7b4e32[_0x72ec('0x33')]['id'],_0x3b7597);var _0x24a586=path[_0x72ec('0x56')](_0x3e93c0,_0x4d3e59);var _0x1791ad=[];_0x1791ad[_0x72ec('0x5c')]({'model':db[_0x72ec('0x5d')],'as':_0x72ec('0x5d'),'raw':!![]});var _0x2c64f1=[{'model':db[_0x72ec('0x37')],'as':_0x72ec('0x5e'),'attributes':['id',_0x72ec('0x32'),_0x72ec('0x5f')],'include':_0x1791ad}];return db['FaxInteraction']['find']({'where':{'id':_0x7b4e32[_0x72ec('0x33')]['id']},'include':_0x2c64f1})[_0x72ec('0x16')](handleEntityNotFound(_0x2b391c,null))[_0x72ec('0x16')](function(_0x3897f2){if(_0x3897f2&&_0x3897f2[_0x72ec('0x5e')]){var _0x3e62c0=_0x3897f2[_0x72ec('0x60')]({'plain':!![]});fs[_0x72ec('0x61')](_0x4b9e56);for(var _0x5781e9=0x0;_0x5781e9<_0x3e62c0[_0x72ec('0x5e')][_0x72ec('0x2c')];_0x5781e9++){var _0x1d537f=_0x3e62c0['Messages'][_0x5781e9][_0x72ec('0x5d')];if(_0x1d537f){var _0x19864c=path['join'](_0x372239,_0x1d537f[_0x72ec('0x62')]);if(fs[_0x72ec('0x63')](_0x19864c)){fs[_0x72ec('0x64')](_0x19864c)[_0x72ec('0x65')](fs[_0x72ec('0x66')](path[_0x72ec('0x56')](_0x4b9e56,_0x1d537f[_0x72ec('0x62')])));}}}return BPromise[_0x72ec('0x67')]()[_0x72ec('0x16')](function(){return new BPromise(function(_0x34f428,_0x4fa4ee){zipdir(_0x4b9e56,{'saveTo':_0x24a586},function(_0x463612,_0x5c622e){if(_0x463612)return _0x4fa4ee(_0x463612);return _0x34f428(_0x5c622e);});})['then'](function(){return new BPromise(function(_0x234fdc,_0x4768d8){rimraf(_0x4b9e56,function(_0x473109){if(_0x473109)_0x4768d8(_0x473109);return _0x234fdc();});});})[_0x72ec('0x16')](function(){return _0x2b391c[_0x72ec('0x53')](_0x24a586,_0x4d3e59,function(_0x5a5c1a){if(_0x5a5c1a){console[_0x72ec('0x68')](_0x72ec('0x69'),_0x5a5c1a);}else{fs[_0x72ec('0x6a')](_0x24a586);}});});});}else{return _0x2b391c[_0x72ec('0x17')](0xc8);}})[_0x72ec('0x30')](handleError(_0x2b391c,null));}; \ No newline at end of file +var _0xbdc6=['addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','FaxInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','color','emit','faxInteractionTags:save','removeTags','toString','join','root','server','files','tmp','attachments','push','Attachment','Messages','createdAt','mkdirSync','createReadStream','pipe','createWriteStream','basename','resolve','download','log','unlinkSync','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','findAll','fax','query','user','catch','show','params','FaxInteraction','keys','filters','intersection','fields','length','attributes','model','includeAll','include','options','create','body','find','describe'];(function(_0x462458,_0x43d2fa){var _0x326351=function(_0x123bb1){while(--_0x123bb1){_0x462458['push'](_0x462458['shift']());}};_0x326351(++_0x43d2fa);}(_0xbdc6,0x1d0));var _0x6bdc=function(_0x3257bf,_0x470e59){_0x3257bf=_0x3257bf-0x0;var _0x56f23f=_0xbdc6[_0x3257bf];return _0x56f23f;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6bdc('0x0'));var moment=require(_0x6bdc('0x1'));var BPromise=require(_0x6bdc('0x2'));var util=require(_0x6bdc('0x3'));var path=require(_0x6bdc('0x4'));var fs=require('fs');var _=require(_0x6bdc('0x5'));var Redis=require(_0x6bdc('0x6'));var interaction=require(_0x6bdc('0x7'));var qs=require(_0x6bdc('0x8'));var logger=require(_0x6bdc('0x9'))(_0x6bdc('0xa'));var config=require(_0x6bdc('0xb'));var db=require(_0x6bdc('0xc'))['db'];config[_0x6bdc('0xd')]=_[_0x6bdc('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6bdc('0xf'))(new Redis(config[_0x6bdc('0xd')]));require(_0x6bdc('0x10'))[_0x6bdc('0x11')](socket);function respondWithStatusCode(_0x242b2f,_0x2d98e2){_0x2d98e2=_0x2d98e2||0xcc;return function(_0x39562c){if(_0x39562c){return _0x242b2f[_0x6bdc('0x12')](_0x2d98e2);}return _0x242b2f[_0x6bdc('0x13')](_0x2d98e2)[_0x6bdc('0x14')]();};}function respondWithResult(_0x31a632,_0x18c15e){_0x18c15e=_0x18c15e||0xc8;return function(_0x196dd7){if(_0x196dd7){return _0x31a632[_0x6bdc('0x13')](_0x18c15e)[_0x6bdc('0x15')](_0x196dd7);}};}function respondWithFilteredResult(_0xc6638a,_0x58970d){return function(_0x167184){if(_0x167184){var _0x1364eb=typeof _0x58970d['offset']===_0x6bdc('0x16')&&typeof _0x58970d['limit']===_0x6bdc('0x16');var _0x4468c0=_0x167184[_0x6bdc('0x17')];var _0x2225b6=_0x1364eb?0x0:_0x58970d[_0x6bdc('0x18')];var _0x2443e9=_0x1364eb?_0x167184[_0x6bdc('0x17')]:_0x58970d[_0x6bdc('0x18')]+_0x58970d[_0x6bdc('0x19')];var _0x4a0529;if(_0x2443e9>=_0x4468c0){_0x2443e9=_0x4468c0;_0x4a0529=0xc8;}else{_0x4a0529=0xce;}_0xc6638a[_0x6bdc('0x13')](_0x4a0529);return _0xc6638a['set'](_0x6bdc('0x1a'),_0x2225b6+'-'+_0x2443e9+'/'+_0x4468c0)['json'](_0x167184);}return null;};}function saveUpdates(_0x3bfa78){return function(_0x2ba12e){if(_0x2ba12e){return _0x2ba12e[_0x6bdc('0x1b')](_0x3bfa78)[_0x6bdc('0x1c')](function(_0x355282){return _0x355282;});}return null;};}function removeEntity(_0x2d95b9){return function(_0x30025c){if(_0x30025c){return _0x30025c[_0x6bdc('0x1d')]()['then'](function(){_0x2d95b9[_0x6bdc('0x13')](0xcc)[_0x6bdc('0x14')]();});}};}function handleEntityNotFound(_0x359e9b){return function(_0x597b01){if(!_0x597b01){_0x359e9b[_0x6bdc('0x12')](0x194);}return _0x597b01;};}function handleError(_0x3ff211,_0x31d5d9){_0x31d5d9=_0x31d5d9||0x1f4;return function(_0x5436a4){logger[_0x6bdc('0x1e')](_0x5436a4[_0x6bdc('0x1f')]);if(_0x5436a4['name']){delete _0x5436a4[_0x6bdc('0x20')];}_0x3ff211[_0x6bdc('0x13')](_0x31d5d9)[_0x6bdc('0x21')](_0x5436a4);};}exports[_0x6bdc('0x22')]=function(_0x52113a,_0x231293){var _0x111597={};var _0xb9d78f=_[_0x6bdc('0x23')](db['FaxInteraction'][_0x6bdc('0x24')],function(_0x2a55ac){return{'name':_0x2a55ac[_0x6bdc('0x25')],'type':_0x2a55ac['type'][_0x6bdc('0x26')]};});_0x111597=qs['getOptions'](_0xb9d78f,_0x52113a);return interaction[_0x6bdc('0x27')](_0x6bdc('0x28'),_0x52113a[_0x6bdc('0x29')],_0x52113a[_0x6bdc('0x2a')],_0x111597,_0xb9d78f)['then'](respondWithFilteredResult(_0x231293,_0x111597))[_0x6bdc('0x2b')](handleError(_0x231293,null));};exports[_0x6bdc('0x2c')]=function(_0x352510,_0x14436c){var _0x3632c3={'raw':![],'where':{'id':_0x352510[_0x6bdc('0x2d')]['id']}},_0x571afa={};_0x571afa['model']=_['keys'](db[_0x6bdc('0x2e')][_0x6bdc('0x24')]);_0x571afa[_0x6bdc('0x29')]=_[_0x6bdc('0x2f')](_0x352510['query']);_0x571afa[_0x6bdc('0x30')]=_[_0x6bdc('0x31')](_0x571afa['model'],_0x571afa['query']);_0x3632c3['attributes']=_[_0x6bdc('0x31')](_0x571afa['model'],qs['fields'](_0x352510[_0x6bdc('0x29')][_0x6bdc('0x32')]));_0x3632c3['attributes']=_0x3632c3['attributes'][_0x6bdc('0x33')]?_0x3632c3[_0x6bdc('0x34')]:_0x571afa[_0x6bdc('0x35')];if(_0x352510[_0x6bdc('0x29')][_0x6bdc('0x36')]){_0x3632c3[_0x6bdc('0x37')]=[{'all':!![]}];}_0x3632c3=_['merge']({},_0x3632c3,_0x352510[_0x6bdc('0x38')]);return db[_0x6bdc('0x2e')]['find'](_0x3632c3)['then'](handleEntityNotFound(_0x14436c,null))['then'](respondWithResult(_0x14436c,null))['catch'](handleError(_0x14436c,null));};exports['create']=function(_0x428c5a,_0x1ceb60){return db[_0x6bdc('0x2e')][_0x6bdc('0x39')](_0x428c5a[_0x6bdc('0x3a')],{})[_0x6bdc('0x1c')](respondWithResult(_0x1ceb60,0xc9))[_0x6bdc('0x2b')](handleError(_0x1ceb60,null));};exports[_0x6bdc('0x1b')]=function(_0x167d36,_0x3cfca6){if(_0x167d36[_0x6bdc('0x3a')]['id']){delete _0x167d36['body']['id'];}return db[_0x6bdc('0x2e')][_0x6bdc('0x3b')]({'where':{'id':_0x167d36[_0x6bdc('0x2d')]['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x3cfca6,null))['then'](saveUpdates(_0x167d36[_0x6bdc('0x3a')],null))[_0x6bdc('0x1c')](respondWithResult(_0x3cfca6,null))[_0x6bdc('0x2b')](handleError(_0x3cfca6,null));};exports['destroy']=function(_0x222465,_0x46a2cf){return db[_0x6bdc('0x2e')][_0x6bdc('0x3b')]({'where':{'id':_0x222465[_0x6bdc('0x2d')]['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x46a2cf,null))[_0x6bdc('0x1c')](removeEntity(_0x46a2cf,null))[_0x6bdc('0x2b')](handleError(_0x46a2cf,null));};exports['describe']=function(_0x510e29,_0x3b31b1){return db[_0x6bdc('0x2e')][_0x6bdc('0x3c')]()['then'](respondWithResult(_0x3b31b1,null))['catch'](handleError(_0x3b31b1,null));};exports[_0x6bdc('0x3d')]=function(_0x2bbf84,_0x7e9d19){return db[_0x6bdc('0x3e')]['find']({'where':{'id':_0x2bbf84[_0x6bdc('0x2d')]['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x7e9d19,null))[_0x6bdc('0x1c')](function(_0x3a910c){if(_0x3a910c){return _0x3a910c['addMessage'](_0x2bbf84[_0x6bdc('0x3a')][_0x6bdc('0x3f')],_[_0x6bdc('0x40')](_0x2bbf84['body'],[_0x6bdc('0x3f'),'id'])||{});}})[_0x6bdc('0x1c')](respondWithResult(_0x7e9d19,null))[_0x6bdc('0x2b')](handleError(_0x7e9d19,null));};exports[_0x6bdc('0x41')]=function(_0x35b22f,_0x26f69a){var _0x21a488={'raw':![],'where':{}};var _0x2d8ecb={};var _0x3e047b={'count':0x0,'rows':[]};return db[_0x6bdc('0x2e')][_0x6bdc('0x42')]({'where':{'id':_0x35b22f['params']['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x26f69a,null))[_0x6bdc('0x1c')](function(_0x56403a){if(_0x56403a){_0x2d8ecb[_0x6bdc('0x35')]=_[_0x6bdc('0x2f')](db[_0x6bdc('0x3e')][_0x6bdc('0x24')]);_0x2d8ecb[_0x6bdc('0x29')]=_[_0x6bdc('0x2f')](_0x35b22f[_0x6bdc('0x29')]);_0x2d8ecb[_0x6bdc('0x30')]=_[_0x6bdc('0x31')](_0x2d8ecb[_0x6bdc('0x35')],_0x2d8ecb[_0x6bdc('0x29')]);_0x21a488[_0x6bdc('0x34')]=_['intersection'](_0x2d8ecb[_0x6bdc('0x35')],qs[_0x6bdc('0x32')](_0x35b22f['query'][_0x6bdc('0x32')]));_0x21a488[_0x6bdc('0x34')]=_0x21a488['attributes'][_0x6bdc('0x33')]?_0x21a488[_0x6bdc('0x34')]:_0x2d8ecb[_0x6bdc('0x35')];if(!_0x35b22f[_0x6bdc('0x29')]['hasOwnProperty'](_0x6bdc('0x43'))){_0x21a488[_0x6bdc('0x19')]=qs[_0x6bdc('0x19')](_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x19')]);_0x21a488['offset']=qs[_0x6bdc('0x18')](_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x18')]);}_0x21a488[_0x6bdc('0x44')]=qs[_0x6bdc('0x45')](_0x35b22f['query'][_0x6bdc('0x45')]);_0x21a488[_0x6bdc('0x46')]=qs['filters'](_[_0x6bdc('0x47')](_0x35b22f[_0x6bdc('0x29')],_0x2d8ecb[_0x6bdc('0x30')]));_0x21a488[_0x6bdc('0x46')][_0x6bdc('0x48')]=_0x56403a['id'];if(_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x49')]){_0x21a488[_0x6bdc('0x46')]=_[_0x6bdc('0x4a')](_0x21a488[_0x6bdc('0x46')],{'$or':_[_0x6bdc('0x23')](_0x21a488[_0x6bdc('0x34')],function(_0x4977d1){var _0x582326={};_0x582326[_0x4977d1]={'$like':'%'+_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x49')]+'%'};return _0x582326;})});}if(_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x4b')]){var _0x3ff799=_0x35b22f['query'][_0x6bdc('0x4b')][_0x6bdc('0x4c')](',');var _0x554cc8={};_0x554cc8[_0x3ff799[0x0]]={'$gte':moment(_0x3ff799[0x1])['format'](_0x6bdc('0x4d'))};_0x21a488[_0x6bdc('0x46')]=_[_0x6bdc('0x4a')](_0x21a488[_0x6bdc('0x46')],_0x554cc8);}_0x21a488=_['merge']({},_0x21a488,_0x35b22f[_0x6bdc('0x38')]);return db[_0x6bdc('0x3e')][_0x6bdc('0x17')]({'where':_0x21a488[_0x6bdc('0x46')]})[_0x6bdc('0x1c')](function(_0x2a7909){_0x3e047b[_0x6bdc('0x17')]=_0x2a7909;if(_0x35b22f[_0x6bdc('0x29')][_0x6bdc('0x36')]){_0x21a488[_0x6bdc('0x37')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x21a488);})[_0x6bdc('0x1c')](function(_0x5b2c43){_0x3e047b[_0x6bdc('0x4e')]=_0x5b2c43;return _0x3e047b;});}})[_0x6bdc('0x1c')](respondWithFilteredResult(_0x26f69a,_0x21a488))[_0x6bdc('0x2b')](handleError(_0x26f69a,null));};exports['addTags']=function(_0xf0f335,_0x420c6f){return db[_0x6bdc('0x2e')]['find']({'where':{'id':_0xf0f335[_0x6bdc('0x2d')]['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x420c6f,null))[_0x6bdc('0x1c')](function(_0x57f95c){if(_0x57f95c){return _0x57f95c[_0x6bdc('0x4f')](_0xf0f335[_0x6bdc('0x3a')]['ids'],_[_0x6bdc('0x40')](_0xf0f335[_0x6bdc('0x3a')],['ids','id'])||{})[_0x6bdc('0x50')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x6bdc('0x51')],'where':{'id':_0xf0f335[_0x6bdc('0x3a')][_0x6bdc('0x3f')]}});})[_0x6bdc('0x1c')](function(_0x535405){socket[_0x6bdc('0x52')](_0x6bdc('0x53'),{'id':Number(_0xf0f335['params']['id']),'tags':_0x535405||[]});return{'id':Number(_0xf0f335[_0x6bdc('0x2d')]['id']),'tags':_0x535405||[]};});}})[_0x6bdc('0x1c')](respondWithResult(_0x420c6f,null))[_0x6bdc('0x2b')](handleError(_0x420c6f,null));};exports['removeTags']=function(_0x20d20a,_0x2fd2b0){return db[_0x6bdc('0x2e')][_0x6bdc('0x3b')]({'where':{'id':_0x20d20a[_0x6bdc('0x2d')]['id']}})[_0x6bdc('0x1c')](handleEntityNotFound(_0x2fd2b0,null))[_0x6bdc('0x1c')](function(_0x47af22){if(_0x47af22){return _0x47af22[_0x6bdc('0x54')](_0x20d20a['query'][_0x6bdc('0x3f')]);}})['then'](respondWithStatusCode(_0x2fd2b0,null))[_0x6bdc('0x2b')](handleError(_0x2fd2b0,null));};exports['download']=function(_0x19efd7,_0x15bd72){var _0x1bedd2=moment()['unix']()[_0x6bdc('0x55')]();var _0x21ccba=path[_0x6bdc('0x56')](config[_0x6bdc('0x57')],_0x6bdc('0x58'),_0x6bdc('0x59'),_0x6bdc('0x5a'));var _0xb4ac9=path[_0x6bdc('0x56')](config[_0x6bdc('0x57')],_0x6bdc('0x58'),_0x6bdc('0x59'),_0x6bdc('0x5b'));var _0x5b538a=path[_0x6bdc('0x56')](_0x21ccba,_0x1bedd2);var _0x5b37ba=util['format']('transcript-%d-%s.zip',_0x19efd7['params']['id'],_0x1bedd2);var _0x13f01a=path[_0x6bdc('0x56')](_0x21ccba,_0x5b37ba);var _0x4a9341=[];_0x4a9341[_0x6bdc('0x5c')]({'model':db[_0x6bdc('0x5d')],'as':'Attachment','raw':!![]});var _0x27850d=[{'model':db[_0x6bdc('0x3e')],'as':_0x6bdc('0x5e'),'attributes':['id','body',_0x6bdc('0x5f')],'include':_0x4a9341}];return db[_0x6bdc('0x2e')][_0x6bdc('0x3b')]({'where':{'id':_0x19efd7['params']['id']},'include':_0x27850d})['then'](handleEntityNotFound(_0x15bd72,null))[_0x6bdc('0x1c')](function(_0x12e687){if(_0x12e687&&_0x12e687[_0x6bdc('0x5e')]){var _0x26aa99=_0x12e687['get']({'plain':!![]});fs[_0x6bdc('0x60')](_0x5b538a);for(var _0x158438=0x0;_0x158438<_0x26aa99[_0x6bdc('0x5e')][_0x6bdc('0x33')];_0x158438++){var _0x4db5a5=_0x26aa99['Messages'][_0x158438][_0x6bdc('0x5d')];if(_0x4db5a5){var _0x2f92a3=path[_0x6bdc('0x56')](_0xb4ac9,_0x4db5a5['basename']);if(fs['existsSync'](_0x2f92a3)){fs[_0x6bdc('0x61')](_0x2f92a3)[_0x6bdc('0x62')](fs[_0x6bdc('0x63')](path[_0x6bdc('0x56')](_0x5b538a,_0x4db5a5[_0x6bdc('0x64')])));}}}return BPromise[_0x6bdc('0x65')]()[_0x6bdc('0x1c')](function(){return new BPromise(function(_0x55c832,_0x2c69a5){zipdir(_0x5b538a,{'saveTo':_0x13f01a},function(_0x38300c,_0x5d8eeb){if(_0x38300c)return _0x2c69a5(_0x38300c);return _0x55c832(_0x5d8eeb);});})[_0x6bdc('0x1c')](function(){return new BPromise(function(_0x495330,_0x56b9b5){rimraf(_0x5b538a,function(_0x3a4e1d){if(_0x3a4e1d)_0x56b9b5(_0x3a4e1d);return _0x495330();});});})[_0x6bdc('0x1c')](function(){return _0x15bd72[_0x6bdc('0x66')](_0x13f01a,_0x5b37ba,function(_0x14f302){if(_0x14f302){console[_0x6bdc('0x67')]('err',_0x14f302);}else{fs[_0x6bdc('0x68')](_0x13f01a);}});});});}else{return _0x15bd72[_0x6bdc('0x12')](0xc8);}})[_0x6bdc('0x2b')](handleError(_0x15bd72,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4a74b00..d149f92 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 _0xeac9=['FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','length','emit','hook','events','FaxInteraction'];(function(_0x5fae11,_0x812d2a){var _0x22695b=function(_0xae0edd){while(--_0xae0edd){_0x5fae11['push'](_0x5fae11['shift']());}};_0x22695b(++_0x812d2a);}(_0xeac9,0x1c0));var _0x9eac=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xeac9[_0x55abd9];return _0x3e5669;};'use strict';var EventEmitter=require(_0x9eac('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x9eac('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x9eac('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9eac('0x3')](0x0);var events={'afterCreate':_0x9eac('0x4'),'afterUpdate':_0x9eac('0x5'),'afterDestroy':'remove'};function emitEvent(_0x207b25){return function(_0xd05c93,_0x3a7e1c,_0x541037){_0xd05c93[_0x9eac('0x6')]({'attributes':['id'],'raw':!![]})[_0x9eac('0x7')](function(_0x273b7a){_0xd05c93[_0x9eac('0x8')](_0x9eac('0x9'),_0x273b7a[_0x9eac('0xa')](function(_0x4424a0){return{'id':_0x4424a0['id']};}));return FaxMessage[_0x9eac('0xb')]({'where':{'FaxInteractionId':_0xd05c93['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a59b7){_0xd05c93[_0x9eac('0x8')]('unreadMessages',_0x1a59b7[_0x9eac('0xc')]);FaxInteractionEvents[_0x9eac('0xd')](_0x207b25+':'+_0xd05c93['id'],_0xd05c93);FaxInteractionEvents[_0x9eac('0xd')](_0x207b25,_0xd05c93);_0x541037(null);})['catch'](_0x541037(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x9eac('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xaa56=['exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x3a1842,_0x264780){var _0x517676=function(_0x4b2b9a){while(--_0x4b2b9a){_0x3a1842['push'](_0x3a1842['shift']());}};_0x517676(++_0x264780);}(_0xaa56,0xc7));var _0x6aa5=function(_0x4d9341,_0x883ba4){_0x4d9341=_0x4d9341-0x0;var _0x269f85=_0xaa56[_0x4d9341];return _0x269f85;};'use strict';var EventEmitter=require(_0x6aa5('0x0'));var FaxInteraction=require(_0x6aa5('0x1'))['db'][_0x6aa5('0x2')];var FaxMessage=require(_0x6aa5('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6aa5('0x3')](0x0);var events={'afterCreate':_0x6aa5('0x4'),'afterUpdate':_0x6aa5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36244f){return function(_0x50cb88,_0x59e432,_0x3710e7){_0x50cb88[_0x6aa5('0x6')]({'attributes':['id'],'raw':!![]})[_0x6aa5('0x7')](function(_0x310bd2){_0x50cb88[_0x6aa5('0x8')](_0x6aa5('0x9'),_0x310bd2[_0x6aa5('0xa')](function(_0x55ad73){return{'id':_0x55ad73['id']};}));return FaxMessage[_0x6aa5('0xb')]({'where':{'FaxInteractionId':_0x50cb88['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6aa5('0x7')](function(_0x3bd5cb){_0x50cb88[_0x6aa5('0x8')](_0x6aa5('0xc'),_0x3bd5cb['length']);FaxInteractionEvents[_0x6aa5('0xd')](_0x36244f+':'+_0x50cb88['id'],_0x50cb88);FaxInteractionEvents['emit'](_0x36244f,_0x50cb88);_0x3710e7(null);})[_0x6aa5('0xe')](_0x3710e7(null));};}for(var e in events){if(events[_0x6aa5('0xf')](e)){var event=events[e];FaxInteraction[_0x6aa5('0x10')](e,emitEvent(event));}}module[_0x6aa5('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 64c2fe4..54c9d3f 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 _0xb2e6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2e6,0x1da));var _0x6b2e=function(_0x5c7273,_0x74ad7b){_0x5c7273=_0x5c7273-0x0;var _0x1f5fdf=_0xb2e6[_0x5c7273];return _0x1f5fdf;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var logger=require('../../config/logger')(_0x6b2e('0x2'));var moment=require(_0x6b2e('0x3'));var BPromise=require(_0x6b2e('0x4'));var rp=require(_0x6b2e('0x5'));var fs=require('fs');var path=require(_0x6b2e('0x6'));var rimraf=require(_0x6b2e('0x7'));var config=require(_0x6b2e('0x8'));var attributes=require(_0x6b2e('0x9'));module[_0x6b2e('0xa')]=function(_0x28b0c5,_0x2dda6b){return _0x28b0c5[_0x6b2e('0xb')](_0x6b2e('0xc'),attributes,{'tableName':_0x6b2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1045bc,_0x4b535f,_0x484e96){if(_0x1045bc[_0x6b2e('0xe')](_0x6b2e('0xf'))){_0x1045bc[_0x6b2e('0x10')]=moment()[_0x6b2e('0x11')](_0x6b2e('0x12'));}_0x484e96(null,_0x1045bc);}}});}; \ No newline at end of file +var _0xebae=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x56d5e1,_0x1a6f5c){var _0x8978e9=function(_0x2b6acb){while(--_0x2b6acb){_0x56d5e1['push'](_0x56d5e1['shift']());}};_0x8978e9(++_0x1a6f5c);}(_0xebae,0x83));var _0xeeba=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0xebae[_0x95ac8b];return _0x5b0792;};'use strict';var _=require(_0xeeba('0x0'));var util=require(_0xeeba('0x1'));var logger=require(_0xeeba('0x2'))(_0xeeba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeeba('0x4'));var fs=require('fs');var path=require(_0xeeba('0x5'));var rimraf=require(_0xeeba('0x6'));var config=require(_0xeeba('0x7'));var attributes=require(_0xeeba('0x8'));module[_0xeeba('0x9')]=function(_0x2fcb68,_0x377182){return _0x2fcb68[_0xeeba('0xa')](_0xeeba('0xb'),attributes,{'tableName':_0xeeba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x121cb8,_0x4374a5,_0x4a7f0a){if(_0x121cb8[_0xeeba('0xd')](_0xeeba('0xe'))){_0x121cb8[_0xeeba('0xf')]=moment()[_0xeeba('0x10')](_0xeeba('0x11'));}_0x4a7f0a(null,_0x121cb8);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index bb309d3..463ca89 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 _0x5c29=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','update','body','options','raw','attributes','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5c29,0x141));var _0x95c2=function(_0x2e4408,_0x3cae6e){_0x2e4408=_0x2e4408-0x0;var _0x52c5ce=_0x5c29[_0x2e4408];return _0x52c5ce;};'use strict';var _=require(_0x95c2('0x0'));var util=require('util');var moment=require(_0x95c2('0x1'));var BPromise=require('bluebird');var rs=require(_0x95c2('0x2'));var fs=require('fs');var Redis=require(_0x95c2('0x3'));var db=require(_0x95c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x95c2('0x5'))(_0x95c2('0x6'));var config=require(_0x95c2('0x7'));var jayson=require(_0x95c2('0x8'));var client=jayson[_0x95c2('0x9')][_0x95c2('0xa')]({'port':0x232a});config['redis']=_[_0x95c2('0xb')](config[_0x95c2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x95c2('0xd'))(new Redis(config[_0x95c2('0xc')]));require('./faxInteraction.socket')[_0x95c2('0xe')](socket);function respondWithRpcPromise(_0x3d312a,_0x34534c,_0x4c6532){return new BPromise(function(_0x4d6a1e,_0x449d3c){return client[_0x95c2('0xf')](_0x3d312a,_0x4c6532)[_0x95c2('0x10')](function(_0x3afd36){logger[_0x95c2('0x11')](_0x95c2('0x12'),_0x34534c,_0x95c2('0x13'));logger[_0x95c2('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x34534c,_0x95c2('0x13'),JSON[_0x95c2('0x15')](_0x3afd36));if(_0x3afd36[_0x95c2('0x16')]){if(_0x3afd36[_0x95c2('0x16')][_0x95c2('0x17')]===0x1f4){logger[_0x95c2('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x34534c,_0x3afd36[_0x95c2('0x16')][_0x95c2('0x18')]);return _0x449d3c(_0x3afd36[_0x95c2('0x16')][_0x95c2('0x18')]);}logger[_0x95c2('0x16')](_0x95c2('0x12'),_0x34534c,_0x3afd36['error']['message']);return _0x4d6a1e(_0x3afd36[_0x95c2('0x16')][_0x95c2('0x18')]);}else{logger['info'](_0x95c2('0x12'),_0x34534c,_0x95c2('0x13'));_0x4d6a1e(_0x3afd36[_0x95c2('0x19')][_0x95c2('0x18')]);}})[_0x95c2('0x1a')](function(_0x3727c8){logger[_0x95c2('0x16')](_0x95c2('0x12'),_0x34534c,_0x3727c8);_0x449d3c(_0x3727c8);});});}exports['UpdateFaxInteraction']=function(_0x3dec2d){var _0x1a321a=this;return new Promise(function(_0x50ff9d,_0x431c46){return db['FaxInteraction'][_0x95c2('0x1b')](_0x3dec2d[_0x95c2('0x1c')],{'raw':_0x3dec2d[_0x95c2('0x1d')]?_0x3dec2d[_0x95c2('0x1d')][_0x95c2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dec2d[_0x95c2('0x1d')]?_0x3dec2d['options']['where']||null:null,'attributes':_0x3dec2d[_0x95c2('0x1d')]?_0x3dec2d[_0x95c2('0x1d')][_0x95c2('0x1f')]||null:null,'limit':_0x3dec2d[_0x95c2('0x1d')]?_0x3dec2d[_0x95c2('0x1d')]['limit']||null:null})[_0x95c2('0x10')](function(_0x55aa36){logger['info'](_0x95c2('0x20'),_0x3dec2d);logger[_0x95c2('0x14')](_0x95c2('0x20'),_0x3dec2d,JSON[_0x95c2('0x15')](_0x55aa36));_0x50ff9d(_0x55aa36);})[_0x95c2('0x1a')](function(_0xd777e7){logger[_0x95c2('0x16')]('UpdateFaxInteraction',_0xd777e7['message'],_0x3dec2d);_0x431c46(_0x1a321a[_0x95c2('0x16')](0x1f4,_0xd777e7['message']));});});};exports[_0x95c2('0x21')]=function(_0x23c228){return new Promise(function(_0x15a55f,_0x5e2b1b){return db[_0x95c2('0x22')][_0x95c2('0x23')]({'where':_0x23c228[_0x95c2('0x1d')]?_0x23c228['options'][_0x95c2('0x24')]||null:null})[_0x95c2('0x10')](function(_0x615951){if(_0x615951){return _0x615951[_0x95c2('0x25')](_0x23c228[_0x95c2('0x1c')][_0x95c2('0x26')],_[_0x95c2('0x27')](_0x23c228['body'],[_0x95c2('0x26'),'id'])||{});}})['spread'](function(_0x43083e){logger[_0x95c2('0x11')](_0x95c2('0x28'),_0x23c228);logger[_0x95c2('0x14')](_0x95c2('0x28'),_0x23c228,JSON[_0x95c2('0x15')](_0x43083e));_0x15a55f(_0x43083e);})[_0x95c2('0x1a')](function(_0x84b20d){logger[_0x95c2('0x16')]('AddTags',_0x84b20d[_0x95c2('0x18')],_0x23c228);_0x5e2b1b(_this[_0x95c2('0x16')](0x1f4,_0x84b20d[_0x95c2('0x18')]));});});}; \ No newline at end of file +var _0xdfc8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','attributes','limit','info','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','body','ids','spread','debug','AddTags','lodash','moment'];(function(_0x741ae3,_0x511156){var _0x47bea0=function(_0x4e16f4){while(--_0x4e16f4){_0x741ae3['push'](_0x741ae3['shift']());}};_0x47bea0(++_0x511156);}(_0xdfc8,0xda));var _0x8dfc=function(_0x10cca7,_0x178d7c){_0x10cca7=_0x10cca7-0x0;var _0xcb6ad6=_0xdfc8[_0x10cca7];return _0xcb6ad6;};'use strict';var _=require(_0x8dfc('0x0'));var util=require('util');var moment=require(_0x8dfc('0x1'));var BPromise=require('bluebird');var rs=require(_0x8dfc('0x2'));var fs=require('fs');var Redis=require(_0x8dfc('0x3'));var db=require(_0x8dfc('0x4'))['db'];var utils=require(_0x8dfc('0x5'));var logger=require(_0x8dfc('0x6'))(_0x8dfc('0x7'));var config=require(_0x8dfc('0x8'));var jayson=require(_0x8dfc('0x9'));var client=jayson[_0x8dfc('0xa')]['http']({'port':0x232a});config[_0x8dfc('0xb')]=_[_0x8dfc('0xc')](config[_0x8dfc('0xb')],{'host':_0x8dfc('0xd'),'port':0x18eb});var socket=require(_0x8dfc('0xe'))(new Redis(config[_0x8dfc('0xb')]));require(_0x8dfc('0xf'))[_0x8dfc('0x10')](socket);function respondWithRpcPromise(_0x301b61,_0x58691b,_0x1074e7){return new BPromise(function(_0x46bacc,_0x15be1c){return client[_0x8dfc('0x11')](_0x301b61,_0x1074e7)[_0x8dfc('0x12')](function(_0x3f5bed){logger['info'](_0x8dfc('0x13'),_0x58691b,_0x8dfc('0x14'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x58691b,'request\x20sent',JSON[_0x8dfc('0x15')](_0x3f5bed));if(_0x3f5bed[_0x8dfc('0x16')]){if(_0x3f5bed[_0x8dfc('0x16')][_0x8dfc('0x17')]===0x1f4){logger[_0x8dfc('0x16')](_0x8dfc('0x13'),_0x58691b,_0x3f5bed['error']['message']);return _0x15be1c(_0x3f5bed[_0x8dfc('0x16')][_0x8dfc('0x18')]);}logger[_0x8dfc('0x16')](_0x8dfc('0x13'),_0x58691b,_0x3f5bed[_0x8dfc('0x16')][_0x8dfc('0x18')]);return _0x46bacc(_0x3f5bed['error'][_0x8dfc('0x18')]);}else{logger['info'](_0x8dfc('0x13'),_0x58691b,'request\x20sent');_0x46bacc(_0x3f5bed[_0x8dfc('0x19')][_0x8dfc('0x18')]);}})[_0x8dfc('0x1a')](function(_0x1309e2){logger[_0x8dfc('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x58691b,_0x1309e2);_0x15be1c(_0x1309e2);});});}exports[_0x8dfc('0x1b')]=function(_0x1707fb){var _0x43fc51=this;return new Promise(function(_0x590782,_0x4dc725){return db['FaxInteraction'][_0x8dfc('0x1c')](_0x1707fb['body'],{'raw':_0x1707fb[_0x8dfc('0x1d')]?_0x1707fb[_0x8dfc('0x1d')][_0x8dfc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1707fb[_0x8dfc('0x1d')]?_0x1707fb['options']['where']||null:null,'attributes':_0x1707fb[_0x8dfc('0x1d')]?_0x1707fb['options'][_0x8dfc('0x1f')]||null:null,'limit':_0x1707fb[_0x8dfc('0x1d')]?_0x1707fb[_0x8dfc('0x1d')][_0x8dfc('0x20')]||null:null})[_0x8dfc('0x12')](function(_0x1abadc){logger[_0x8dfc('0x21')](_0x8dfc('0x1b'),_0x1707fb);logger['debug'](_0x8dfc('0x1b'),_0x1707fb,JSON[_0x8dfc('0x15')](_0x1abadc));_0x590782(_0x1abadc);})['catch'](function(_0x16659d){logger[_0x8dfc('0x16')]('UpdateFaxInteraction',_0x16659d[_0x8dfc('0x18')],_0x1707fb);_0x4dc725(_0x43fc51[_0x8dfc('0x16')](0x1f4,_0x16659d[_0x8dfc('0x18')]));});});};exports[_0x8dfc('0x22')]=function(_0x4d22bc){return new Promise(function(_0xfb44f4,_0x5e3c1c){return db[_0x8dfc('0x23')][_0x8dfc('0x24')]({'where':_0x4d22bc[_0x8dfc('0x1d')]?_0x4d22bc[_0x8dfc('0x1d')][_0x8dfc('0x25')]||null:null})[_0x8dfc('0x12')](function(_0x71e0fa){if(_0x71e0fa){return _0x71e0fa[_0x8dfc('0x26')](_0x4d22bc[_0x8dfc('0x27')]['ids'],_['omit'](_0x4d22bc[_0x8dfc('0x27')],[_0x8dfc('0x28'),'id'])||{});}})[_0x8dfc('0x29')](function(_0x3731d5){logger[_0x8dfc('0x21')]('AddTags',_0x4d22bc);logger[_0x8dfc('0x2a')](_0x8dfc('0x2b'),_0x4d22bc,JSON[_0x8dfc('0x15')](_0x3731d5));_0xfb44f4(_0x3731d5);})[_0x8dfc('0x1a')](function(_0x54436f){logger['error'](_0x8dfc('0x2b'),_0x54436f[_0x8dfc('0x18')],_0x4d22bc);_0x5e3c1c(_this[_0x8dfc('0x16')](0x1f4,_0x54436f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 7cc9925..a7daa62 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 _0x4966=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x184cb6,_0x1ae06c){var _0x2e2c5d=function(_0x15c29f){while(--_0x15c29f){_0x184cb6['push'](_0x184cb6['shift']());}};_0x2e2c5d(++_0x1ae06c);}(_0x4966,0x93));var _0x6496=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0x4966[_0x4fa738];return _0x55bf55;};'use strict';var FaxInteractionEvents=require(_0x6496('0x0'));var events=[_0x6496('0x1'),_0x6496('0x2'),_0x6496('0x3')];function createListener(_0x1642c3,_0x3d71a8){return function(_0x589647){_0x3d71a8[_0x6496('0x4')](_0x1642c3,_0x589647);};}function removeListener(_0x4b68da,_0x3d0d9c){return function(){FaxInteractionEvents[_0x6496('0x5')](_0x4b68da,_0x3d0d9c);};}exports[_0x6496('0x6')]=function(_0x4aefc2){for(var _0x49417b=0x0,_0x1b9a33=events[_0x6496('0x7')];_0x49417b<_0x1b9a33;_0x49417b++){var _0xf2bc58=events[_0x49417b];var _0x3b8b92=createListener(_0x6496('0x8')+_0xf2bc58,_0x4aefc2);FaxInteractionEvents['on'](_0xf2bc58,_0x3b8b92);}}; \ No newline at end of file +var _0xf7a0=['register','length','faxInteraction:','./faxInteraction.events','remove','update','removeListener'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xf7a0,0xea));var _0x0f7a=function(_0x18e14d,_0x4743e3){_0x18e14d=_0x18e14d-0x0;var _0x97111d=_0xf7a0[_0x18e14d];return _0x97111d;};'use strict';var FaxInteractionEvents=require(_0x0f7a('0x0'));var events=['save',_0x0f7a('0x1'),_0x0f7a('0x2')];function createListener(_0x5a1855,_0x1f493a){return function(_0x3f1be7){_0x1f493a['emit'](_0x5a1855,_0x3f1be7);};}function removeListener(_0x417c80,_0x5738d0){return function(){FaxInteractionEvents[_0x0f7a('0x3')](_0x417c80,_0x5738d0);};}exports[_0x0f7a('0x4')]=function(_0x13b822){for(var _0xb1949c=0x0,_0x316855=events[_0x0f7a('0x5')];_0xb1949c<_0x316855;_0xb1949c++){var _0x2a41a5=events[_0xb1949c];var _0x595d48=createListener(_0x0f7a('0x6')+_0x2a41a5,_0x13b822);FaxInteractionEvents['on'](_0x2a41a5,_0x595d48);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a1136cb..996bc7a 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 _0xf541=['/describe','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','/:id','faxinteraction:update','delete','faxinteraction:destroy','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index'];(function(_0x41ed9b,_0x34783e){var _0xcfc90f=function(_0x1ed307){while(--_0x1ed307){_0x41ed9b['push'](_0x41ed9b['shift']());}};_0xcfc90f(++_0x34783e);}(_0xf541,0x1f4));var _0x1f54=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0xf541[_0x5b740b];return _0x6f8f4e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f54('0x0'));var timeout=require('connect-timeout');var express=require(_0x1f54('0x1'));var router=express[_0x1f54('0x2')]();var fs_extra=require(_0x1f54('0x3'));var auth=require(_0x1f54('0x4'));var interaction=require(_0x1f54('0x5'));var config=require(_0x1f54('0x6'));var controller=require(_0x1f54('0x7'));router[_0x1f54('0x8')]('/',auth['isAuthenticated'](),controller[_0x1f54('0x9')]);router[_0x1f54('0x8')](_0x1f54('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x1f54('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1f54('0x8')](_0x1f54('0xb'),auth[_0x1f54('0xc')](),controller[_0x1f54('0xd')]);router[_0x1f54('0x8')](_0x1f54('0xe'),auth[_0x1f54('0xc')](),controller[_0x1f54('0xf')]);router[_0x1f54('0x10')]('/',auth['isAuthenticated'](),controller[_0x1f54('0x11')]);router[_0x1f54('0x10')](_0x1f54('0xb'),auth[_0x1f54('0xc')](),controller[_0x1f54('0x12')]);router[_0x1f54('0x10')](_0x1f54('0x13'),auth['isAuthenticated'](),interaction[_0x1f54('0x14')](_0x1f54('0x15'),_0x1f54('0x16')),controller['addTags']);router[_0x1f54('0x17')](_0x1f54('0x18'),auth[_0x1f54('0xc')](),interaction[_0x1f54('0x14')](_0x1f54('0x15'),_0x1f54('0x19')),controller['update']);router[_0x1f54('0x1a')](_0x1f54('0x18'),auth[_0x1f54('0xc')](),interaction[_0x1f54('0x14')](_0x1f54('0x15'),_0x1f54('0x1b')),controller[_0x1f54('0x1c')]);router[_0x1f54('0x1a')]('/:id/tags',auth[_0x1f54('0xc')](),controller['removeTags']);module[_0x1f54('0x1d')]=router; \ No newline at end of file +var _0x4c88=['faxinteraction:update','faxinteraction:destroy','destroy','delete','/:id/tags','removeTags','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','faxinteraction:addtags','put','fax'];(function(_0x5cdbd6,_0x56292d){var _0x1173f8=function(_0x74a775){while(--_0x74a775){_0x5cdbd6['push'](_0x5cdbd6['shift']());}};_0x1173f8(++_0x56292d);}(_0x4c88,0x1c6));var _0x84c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4c88[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x84c8('0x0'));var util=require(_0x84c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x84c8('0x2'));var router=express[_0x84c8('0x3')]();var fs_extra=require(_0x84c8('0x4'));var auth=require(_0x84c8('0x5'));var interaction=require(_0x84c8('0x6'));var config=require(_0x84c8('0x7'));var controller=require('./faxInteraction.controller');router[_0x84c8('0x8')]('/',auth[_0x84c8('0x9')](),controller[_0x84c8('0xa')]);router[_0x84c8('0x8')](_0x84c8('0xb'),auth['isAuthenticated'](),controller[_0x84c8('0xc')]);router['get'](_0x84c8('0xd'),auth[_0x84c8('0x9')](),controller[_0x84c8('0xe')]);router[_0x84c8('0x8')](_0x84c8('0xf'),auth[_0x84c8('0x9')](),controller[_0x84c8('0x10')]);router[_0x84c8('0x8')](_0x84c8('0x11'),auth[_0x84c8('0x9')](),controller[_0x84c8('0x12')]);router[_0x84c8('0x13')]('/',auth[_0x84c8('0x9')](),controller[_0x84c8('0x14')]);router[_0x84c8('0x13')](_0x84c8('0xf'),auth[_0x84c8('0x9')](),controller[_0x84c8('0x15')]);router['post']('/:id/tags',auth[_0x84c8('0x9')](),interaction[_0x84c8('0x16')]('fax',_0x84c8('0x17')),controller['addTags']);router[_0x84c8('0x18')](_0x84c8('0xd'),auth[_0x84c8('0x9')](),interaction[_0x84c8('0x16')](_0x84c8('0x19'),_0x84c8('0x1a')),controller['update']);router['delete'](_0x84c8('0xd'),auth[_0x84c8('0x9')](),interaction[_0x84c8('0x16')]('fax',_0x84c8('0x1b')),controller[_0x84c8('0x1c')]);router[_0x84c8('0x1d')](_0x84c8('0x1e'),auth[_0x84c8('0x9')](),controller[_0x84c8('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 034cd93..0bb5f2e 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 _0xa41a=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x4b4e2d,_0x1480c5){var _0x1ce3cf=function(_0x317e03){while(--_0x317e03){_0x4b4e2d['push'](_0x4b4e2d['shift']());}};_0x1ce3cf(++_0x1480c5);}(_0xa41a,0x6b));var _0xaa41=function(_0x36c3fa,_0x38497b){_0x36c3fa=_0x36c3fa-0x0;var _0x4b40b0=_0xa41a[_0x36c3fa];return _0x4b40b0;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaa41('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa41('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa41('0x4')]('in',_0xaa41('0x5')),'defaultValue':_0xaa41('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xaa41('0x7')]}}; \ No newline at end of file +var _0xa1fd=['sequelize','exports','TEXT','medium','ENUM','out','DATE'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x4aca28,_0x4ab42c){_0x4aca28=_0x4aca28-0x0;var _0x1946a0=_0xa1fd[_0x4aca28];return _0x1946a0;};'use strict';var Sequelize=require(_0xda1f('0x0'));module[_0xda1f('0x1')]={'body':{'type':Sequelize[_0xda1f('0x2')](_0xda1f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xda1f('0x4')]('in',_0xda1f('0x5')),'defaultValue':_0xda1f('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xda1f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xda1f('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 598865f..4d4964a 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 _0x0eb7=['format','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','fax','get','info','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','motionChannel','event','rejectmessage','create','CmContact','findOne','Attachment','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','files','attachments','basename','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','sendStatus','stack','send','index','map','FaxMessage','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','show','params','rawAttributes','options','find','update','body','destroy','describe','fax-interactions','accept','read','readAt'];(function(_0x4b7d2a,_0x41a4ba){var _0x4d2f32=function(_0x7b066){while(--_0x7b066){_0x4b7d2a['push'](_0x4b7d2a['shift']());}};_0x4d2f32(++_0x41a4ba);}(_0x0eb7,0x1f3));var _0x70eb=function(_0x22adac,_0x4f8462){_0x22adac=_0x22adac-0x0;var _0x410db7=_0x0eb7[_0x22adac];return _0x410db7;};'use strict';var emlformat=require(_0x70eb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x70eb('0x1'));var rp=require(_0x70eb('0x2'));var moment=require(_0x70eb('0x3'));var BPromise=require(_0x70eb('0x4'));var Mustache=require('mustache');var util=require(_0x70eb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x70eb('0x6'));var ejs=require(_0x70eb('0x7'));var fs=require('fs');var fs_extra=require(_0x70eb('0x8'));var _=require(_0x70eb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x70eb('0xa'));var toCsv=require(_0x70eb('0x6'));var querystring=require('querystring');var Papa=require(_0x70eb('0xb'));var Redis=require('ioredis');var authService=require(_0x70eb('0xc'));var qs=require(_0x70eb('0xd'));var as=require(_0x70eb('0xe'));var hardwareService=require(_0x70eb('0xf'));var logger=require(_0x70eb('0x10'))(_0x70eb('0x11'));var utils=require(_0x70eb('0x12'));var config=require(_0x70eb('0x13'));var licenseUtil=require(_0x70eb('0x14'));var db=require(_0x70eb('0x15'))['db'];config[_0x70eb('0x16')]=_[_0x70eb('0x17')](config[_0x70eb('0x16')],{'host':_0x70eb('0x18'),'port':0x18eb});var socket=require(_0x70eb('0x19'))(new Redis(config[_0x70eb('0x16')]));require(_0x70eb('0x1a'))[_0x70eb('0x1b')](socket);var jayson=require(_0x70eb('0x1c'));var client=jayson[_0x70eb('0x1d')][_0x70eb('0x1e')]({'port':0x232c});var client9002=jayson[_0x70eb('0x1d')][_0x70eb('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5d0e23,_0x125d79,_0x4296d0,_0x71c42e){return new BPromise(function(_0x768a22,_0x2b4daf){var _0x2dd8f8=_0x71c42e||client;return _0x2dd8f8[_0x70eb('0x1f')](_0x5d0e23,_0x4296d0)[_0x70eb('0x20')](function(_0x383b50){logger['info'](_0x70eb('0x21'),_0x125d79,_0x70eb('0x22'));logger[_0x70eb('0x23')](_0x70eb('0x24'),_0x125d79,'request\x20sent',JSON['stringify'](_0x383b50));if(_0x383b50[_0x70eb('0x25')]){if(_0x383b50[_0x70eb('0x25')][_0x70eb('0x26')]===0x1f4){logger[_0x70eb('0x25')]('FaxMessage,\x20%s,\x20%s',_0x125d79,_0x383b50[_0x70eb('0x25')][_0x70eb('0x27')]);return _0x2b4daf(_0x383b50[_0x70eb('0x25')][_0x70eb('0x27')]);}logger['error'](_0x70eb('0x21'),_0x125d79,_0x383b50[_0x70eb('0x25')][_0x70eb('0x27')]);return _0x768a22(_0x383b50[_0x70eb('0x25')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x125d79,_0x70eb('0x22'));_0x768a22(_0x383b50['result']['message']);}})[_0x70eb('0x28')](function(_0x206ff8){logger[_0x70eb('0x25')](_0x70eb('0x21'),_0x125d79,_0x206ff8);_0x2b4daf(_0x206ff8);});});}function respondWithStatusCode(_0x424241,_0x5e0909){_0x5e0909=_0x5e0909||0xcc;return function(_0x1b362b){if(_0x1b362b){return _0x424241['sendStatus'](_0x5e0909);}return _0x424241[_0x70eb('0x29')](_0x5e0909)[_0x70eb('0x2a')]();};}function respondWithResult(_0x3913a4,_0x308a49){_0x308a49=_0x308a49||0xc8;return function(_0x67130b){if(_0x67130b){return _0x3913a4[_0x70eb('0x29')](_0x308a49)[_0x70eb('0x2b')](_0x67130b);}};}function respondWithFilteredResult(_0x23466a,_0x2c53c3){return function(_0x25b84e){if(_0x25b84e){var _0x56138b=typeof _0x2c53c3[_0x70eb('0x2c')]==='undefined'&&typeof _0x2c53c3[_0x70eb('0x2d')]===_0x70eb('0x2e');var _0x564653=_0x25b84e[_0x70eb('0x2f')];var _0x1a6168=_0x56138b?0x0:_0x2c53c3[_0x70eb('0x2c')];var _0x523f83=_0x56138b?_0x25b84e['count']:_0x2c53c3[_0x70eb('0x2c')]+_0x2c53c3[_0x70eb('0x2d')];var _0x42b08c;if(_0x523f83>=_0x564653){_0x523f83=_0x564653;_0x42b08c=0xc8;}else{_0x42b08c=0xce;}_0x23466a[_0x70eb('0x29')](_0x42b08c);return _0x23466a[_0x70eb('0x30')](_0x70eb('0x31'),_0x1a6168+'-'+_0x523f83+'/'+_0x564653)[_0x70eb('0x2b')](_0x25b84e);}return null;};}function patchUpdates(_0x133169){return function(_0x56c716){try{jsonpatch['apply'](_0x56c716,_0x133169,!![]);}catch(_0x2b8f3d){return BPromise[_0x70eb('0x32')](_0x2b8f3d);}return _0x56c716[_0x70eb('0x33')]();};}function saveUpdates(_0x516a1e,_0xa73669){return function(_0x418618){if(_0x418618){return _0x418618['update'](_0x516a1e)['then'](function(_0x1d0900){return _0x1d0900;});}return null;};}function removeEntity(_0x50d806,_0x3c17df){return function(_0x39b787){if(_0x39b787){return _0x39b787['destroy']()[_0x70eb('0x20')](function(){_0x50d806[_0x70eb('0x29')](0xcc)[_0x70eb('0x2a')]();});}};}function handleEntityNotFound(_0xa01702,_0x487beb){return function(_0x53fb9e){if(!_0x53fb9e){_0xa01702[_0x70eb('0x34')](0x194);}return _0x53fb9e;};}function handleError(_0x15e576,_0x42c86c){_0x42c86c=_0x42c86c||0x1f4;return function(_0x5a831b){logger[_0x70eb('0x25')](_0x5a831b[_0x70eb('0x35')]);if(_0x5a831b['name']){delete _0x5a831b['name'];}_0x15e576['status'](_0x42c86c)[_0x70eb('0x36')](_0x5a831b);};}exports[_0x70eb('0x37')]=function(_0x1b55c2,_0x297d63){var _0x1bd3f5={},_0x22cc11={},_0x2e9cd5={'count':0x0,'rows':[]};var _0x6be411=_[_0x70eb('0x38')](db[_0x70eb('0x39')]['rawAttributes'],function(_0x3f1403){return{'name':_0x3f1403[_0x70eb('0x3a')],'type':_0x3f1403['type'][_0x70eb('0x3b')]};});_0x22cc11[_0x70eb('0x3c')]=_['map'](_0x6be411,_0x70eb('0x3d'));_0x22cc11[_0x70eb('0x3e')]=_[_0x70eb('0x3f')](_0x1b55c2[_0x70eb('0x3e')]);_0x22cc11[_0x70eb('0x40')]=_[_0x70eb('0x41')](_0x22cc11[_0x70eb('0x3c')],_0x22cc11[_0x70eb('0x3e')]);_0x1bd3f5[_0x70eb('0x42')]=_['intersection'](_0x22cc11[_0x70eb('0x3c')],qs['fields'](_0x1b55c2['query'][_0x70eb('0x43')]));_0x1bd3f5['attributes']=_0x1bd3f5[_0x70eb('0x42')][_0x70eb('0x44')]?_0x1bd3f5[_0x70eb('0x42')]:_0x22cc11[_0x70eb('0x3c')];if(!_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x45')](_0x70eb('0x46'))){_0x1bd3f5[_0x70eb('0x2d')]=qs[_0x70eb('0x2d')](_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x2d')]);_0x1bd3f5[_0x70eb('0x2c')]=qs[_0x70eb('0x2c')](_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x2c')]);}_0x1bd3f5['order']=qs[_0x70eb('0x47')](_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x47')]);_0x1bd3f5[_0x70eb('0x48')]=qs[_0x70eb('0x40')](_[_0x70eb('0x49')](_0x1b55c2[_0x70eb('0x3e')],_0x22cc11[_0x70eb('0x40')]),_0x6be411);if(_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x4a')]){_0x1bd3f5['where']=_[_0x70eb('0x4b')](_0x1bd3f5[_0x70eb('0x48')],{'$or':_[_0x70eb('0x38')](_0x6be411,function(_0x40d519){if(_0x40d519[_0x70eb('0x4c')]!=='VIRTUAL'){var _0x40df6c={};_0x40df6c[_0x40d519[_0x70eb('0x3d')]]={'$like':'%'+_0x1b55c2[_0x70eb('0x3e')]['filter']+'%'};return _0x40df6c;}})});}_0x1bd3f5=_[_0x70eb('0x4b')]({},_0x1bd3f5,_0x1b55c2['options']);var _0x3557a4={'where':_0x1bd3f5[_0x70eb('0x48')]};return db[_0x70eb('0x39')][_0x70eb('0x2f')](_0x3557a4)[_0x70eb('0x20')](function(_0xf0aea7){_0x2e9cd5['count']=_0xf0aea7;if(_0x1b55c2[_0x70eb('0x3e')][_0x70eb('0x4d')]){_0x1bd3f5[_0x70eb('0x4e')]=[{'all':!![]}];}return db[_0x70eb('0x39')][_0x70eb('0x4f')](_0x1bd3f5);})[_0x70eb('0x20')](function(_0x3d7a49){_0x2e9cd5['rows']=_0x3d7a49;return _0x2e9cd5;})[_0x70eb('0x20')](respondWithFilteredResult(_0x297d63,_0x1bd3f5))[_0x70eb('0x28')](handleError(_0x297d63,null));};exports[_0x70eb('0x50')]=function(_0x507e30,_0x4419e8){var _0x7e44d={'raw':!![],'where':{'id':_0x507e30[_0x70eb('0x51')]['id']}},_0x6ba9b5={};_0x6ba9b5[_0x70eb('0x3c')]=_['keys'](db[_0x70eb('0x39')][_0x70eb('0x52')]);_0x6ba9b5[_0x70eb('0x3e')]=_[_0x70eb('0x3f')](_0x507e30['query']);_0x6ba9b5['filters']=_[_0x70eb('0x41')](_0x6ba9b5['model'],_0x6ba9b5[_0x70eb('0x3e')]);_0x7e44d[_0x70eb('0x42')]=_[_0x70eb('0x41')](_0x6ba9b5[_0x70eb('0x3c')],qs[_0x70eb('0x43')](_0x507e30['query'][_0x70eb('0x43')]));_0x7e44d[_0x70eb('0x42')]=_0x7e44d[_0x70eb('0x42')][_0x70eb('0x44')]?_0x7e44d['attributes']:_0x6ba9b5[_0x70eb('0x3c')];if(_0x507e30[_0x70eb('0x3e')][_0x70eb('0x4d')]){_0x7e44d[_0x70eb('0x4e')]=[{'all':!![]}];}_0x7e44d=_[_0x70eb('0x4b')]({},_0x7e44d,_0x507e30[_0x70eb('0x53')]);return db[_0x70eb('0x39')][_0x70eb('0x54')](_0x7e44d)[_0x70eb('0x20')](handleEntityNotFound(_0x4419e8,null))[_0x70eb('0x20')](respondWithResult(_0x4419e8,null))[_0x70eb('0x28')](handleError(_0x4419e8,null));};exports[_0x70eb('0x55')]=function(_0x172218,_0x54b479){if(_0x172218[_0x70eb('0x56')]['id']){delete _0x172218[_0x70eb('0x56')]['id'];}return db['FaxMessage'][_0x70eb('0x54')]({'where':{'id':_0x172218[_0x70eb('0x51')]['id']}})['then'](handleEntityNotFound(_0x54b479,null))[_0x70eb('0x20')](saveUpdates(_0x172218[_0x70eb('0x56')],null))[_0x70eb('0x20')](respondWithResult(_0x54b479,null))[_0x70eb('0x28')](handleError(_0x54b479,null));};exports[_0x70eb('0x57')]=function(_0x58074e,_0x234688){return db['FaxMessage'][_0x70eb('0x54')]({'where':{'id':_0x58074e[_0x70eb('0x51')]['id']}})[_0x70eb('0x20')](handleEntityNotFound(_0x234688,null))['then'](removeEntity(_0x234688,null))[_0x70eb('0x28')](handleError(_0x234688,null));};exports['describe']=function(_0x36e1b7,_0x5bb9dd){return db['FaxMessage'][_0x70eb('0x58')]()[_0x70eb('0x20')](respondWithResult(_0x5bb9dd,null))[_0x70eb('0x28')](handleError(_0x5bb9dd,null));};var interaction_log=require('../../config/logger')(_0x70eb('0x59'));exports[_0x70eb('0x5a')]=function(_0x2237a1,_0x35b80d,_0x3291dc){var _0x292ea3={'agent':{},'channel':'fax'};if(_0x2237a1[_0x70eb('0x56')]['id']){delete _0x2237a1[_0x70eb('0x56')]['id'];}_0x2237a1[_0x70eb('0x56')][_0x70eb('0x5b')]=!![];_0x2237a1[_0x70eb('0x56')][_0x70eb('0x5c')]=moment()[_0x70eb('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2237a1[_0x70eb('0x56')][_0x70eb('0x5e')]=_0x2237a1[_0x70eb('0x56')]['UserId']||_0x2237a1[_0x70eb('0x5f')]['id'];_0x292ea3['agent']['id']=_0x2237a1[_0x70eb('0x56')][_0x70eb('0x5e')];return db[_0x70eb('0x39')][_0x70eb('0x54')]({'where':{'id':_0x2237a1['params']['id'],'UserId':null}})[_0x70eb('0x20')](handleEntityNotFound(_0x35b80d,null))[_0x70eb('0x20')](saveUpdates(_0x2237a1[_0x70eb('0x56')],null))[_0x70eb('0x20')](function(_0x557c58){if(_0x557c58){_0x292ea3[_0x70eb('0x27')]=_0x557c58['get']({'plain':!![]});return db[_0x70eb('0x60')][_0x70eb('0x54')]({'where':{'id':_0x557c58[_0x70eb('0x61')]}});}return null;})[_0x70eb('0x20')](handleEntityNotFound(_0x35b80d,null))[_0x70eb('0x20')](function(_0xe8d886){if(_0xe8d886){return _0xe8d886[_0x70eb('0x55')]({'UserId':_0x2237a1[_0x70eb('0x56')]['UserId'],'read1stAt':_[_0x70eb('0x62')](_0xe8d886[_0x70eb('0x63')])?moment()[_0x70eb('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x70eb('0x20')](function(_0x1901be){if(_0x1901be){_0x292ea3[_0x70eb('0x64')]=_0x1901be['get']({'plain':!![]});interaction_log['info'](_0x70eb('0x65'),_0x2237a1['user']['id'],_0x2237a1[_0x70eb('0x5f')][_0x70eb('0x3d')],_0x2237a1[_0x70eb('0x5f')][_0x70eb('0x66')],_0x292ea3['interaction']['id'],_0x2237a1[_0x70eb('0x56')]?JSON[_0x70eb('0x67')](_0x2237a1[_0x70eb('0x56')]):_0x70eb('0x68'));return respondWithRpcPromise(_0x70eb('0x69'),_0x70eb('0x6a'),_0x292ea3);}return null;})[_0x70eb('0x20')](function(_0x3f67d8){var _0x37e634=_0x70eb('0x6b')+_0x3f67d8[_0x70eb('0x27')][_0x70eb('0x6c')];return db[_0x70eb('0x6d')][_0x70eb('0x3e')](_0x37e634,{'type':db[_0x70eb('0x6e')][_0x70eb('0x6f')]['SELECT'],'raw':!![]})[_0x70eb('0x20')](function(_0xb9c062){return _0xb9c062;});})[_0x70eb('0x20')](function(_0x27562b){if(_0x27562b){_0x292ea3[_0x70eb('0x27')][_0x70eb('0x70')]=_0x27562b[0x0];if(!_0x2237a1[_0x70eb('0x56')][_0x70eb('0x5e')])return;return db[_0x70eb('0x71')][_0x70eb('0x54')]({'where':{'id':_0x2237a1['body'][_0x70eb('0x5e')],'role':_0x70eb('0x72')},'attributes':['id','name',_0x70eb('0x73'),_0x70eb('0x74'),_0x70eb('0x75')],'raw':!![]});}return null;})[_0x70eb('0x20')](function(_0x298b78){if(!_0x298b78)return null;_0x292ea3[_0x70eb('0x27')]['agent']=_0x298b78;return _0x292ea3;})['then'](function(_0x7b0272){if(_0x7b0272){if(_0x2237a1['body'][_0x70eb('0x76')]){_0x292ea3[_0x70eb('0x27')][_0x70eb('0x77')]=util[_0x70eb('0x5d')](_0x70eb('0x78'),_0x2237a1[_0x70eb('0x5f')][_0x70eb('0x3d')]);_0x292ea3[_0x70eb('0x27')][_0x70eb('0x79')]=_0x292ea3[_0x70eb('0x79')];_0x292ea3[_0x70eb('0x27')]['motionChannel']=_0x292ea3[_0x70eb('0x79')];_0x292ea3['message']['event']=_0x70eb('0x5a');return respondWithRpcPromise('EventManager',_0x70eb('0x7a'),{'event':_0x70eb('0x7b'),'message':_0x292ea3['message']},client9002)[_0x70eb('0x20')](function(){return _0x292ea3;});}return _0x292ea3;}return null;})[_0x70eb('0x20')](respondWithResult(_0x35b80d,null))[_0x70eb('0x28')](handleError(_0x35b80d,null));};var interaction_log=require(_0x70eb('0x10'))(_0x70eb('0x59'));exports[_0x70eb('0x32')]=function(_0x319b24,_0x4c5c72,_0x1888e9){var _0x4306c9={'agent':{},'channel':_0x70eb('0x7c')};if(_0x319b24[_0x70eb('0x56')]['id']){delete _0x319b24[_0x70eb('0x56')]['id'];}_0x319b24[_0x70eb('0x56')]['UserId']=_0x319b24[_0x70eb('0x56')]['UserId']||_0x319b24[_0x70eb('0x5f')]['id'];_0x4306c9[_0x70eb('0x72')]['id']=_0x319b24[_0x70eb('0x56')]['UserId'];return db[_0x70eb('0x39')][_0x70eb('0x54')]({'where':{'id':_0x319b24[_0x70eb('0x51')]['id'],'UserId':null}})[_0x70eb('0x20')](handleEntityNotFound(_0x4c5c72,null))[_0x70eb('0x20')](function(_0x1c3684){if(_0x1c3684){_0x4306c9[_0x70eb('0x27')]=_0x1c3684[_0x70eb('0x7d')]({'plain':!![]});return db[_0x70eb('0x60')][_0x70eb('0x54')]({'where':{'id':_0x1c3684[_0x70eb('0x61')]}});}return null;})[_0x70eb('0x20')](handleEntityNotFound(_0x4c5c72,null))[_0x70eb('0x20')](function(_0x1ca96c){if(_0x1ca96c){_0x4306c9[_0x70eb('0x64')]=_0x1ca96c[_0x70eb('0x7d')]({'plain':!![]});interaction_log[_0x70eb('0x7e')](_0x70eb('0x7f'),_0x319b24['user']['id'],_0x319b24['user'][_0x70eb('0x3d')],_0x319b24[_0x70eb('0x5f')][_0x70eb('0x66')],_0x4306c9[_0x70eb('0x64')]['id'],_0x319b24['body']?JSON[_0x70eb('0x67')](_0x319b24['body']):'null');return respondWithRpcPromise(_0x70eb('0x80'),_0x70eb('0x81'),_0x4306c9);}return null;})[_0x70eb('0x20')](function(_0xbe71e8){var _0xc2ece2=_0x70eb('0x6b')+_0xbe71e8[_0x70eb('0x27')]['ContactId'];return db[_0x70eb('0x6d')][_0x70eb('0x3e')](_0xc2ece2,{'type':db[_0x70eb('0x6e')]['QueryTypes'][_0x70eb('0x82')],'raw':!![]})[_0x70eb('0x20')](function(_0x47738c){return _0x47738c;});})[_0x70eb('0x20')](function(_0x12188e){if(_0x12188e){_0x4306c9[_0x70eb('0x27')][_0x70eb('0x70')]=_0x12188e[0x0];if(!_0x319b24[_0x70eb('0x56')]['UserId'])return;return db[_0x70eb('0x71')][_0x70eb('0x54')]({'where':{'id':_0x319b24[_0x70eb('0x56')][_0x70eb('0x5e')],'role':'agent'},'attributes':['id',_0x70eb('0x3d'),'fullname',_0x70eb('0x74'),'internal'],'raw':!![]});}return null;})[_0x70eb('0x20')](function(_0x12184a){if(!_0x12184a)return null;_0x4306c9['message']['agent']=_0x12184a;return _0x4306c9;})[_0x70eb('0x20')](function(_0x103f24){if(_0x103f24){_0x103f24[_0x70eb('0x27')]['interface']=util['format'](_0x70eb('0x78'),_0x319b24[_0x70eb('0x5f')][_0x70eb('0x3d')]);_0x103f24[_0x70eb('0x27')]['channel']=_0x4306c9[_0x70eb('0x79')];_0x103f24['message'][_0x70eb('0x83')]=_0x4306c9[_0x70eb('0x79')];_0x103f24[_0x70eb('0x27')][_0x70eb('0x84')]=_0x70eb('0x32');respondWithRpcPromise('EventManager',_0x70eb('0x7a'),{'event':_0x70eb('0x85'),'message':_0x103f24['message']},client9002);return _0x4306c9;}return null;})[_0x70eb('0x20')](respondWithResult(_0x4c5c72,null))[_0x70eb('0x28')](handleError(_0x4c5c72,null));};exports[_0x70eb('0x86')]=function(_0x49f8a8,_0x1a841a){var _0x47e22c;return db[_0x70eb('0x39')][_0x70eb('0x86')](_0x49f8a8[_0x70eb('0x56')],{})[_0x70eb('0x20')](function(_0x26ec35){_0x47e22c=_0x26ec35;return db[_0x70eb('0x87')][_0x70eb('0x88')]({'where':{'id':_0x47e22c[_0x70eb('0x6c')]}});})[_0x70eb('0x20')](function(_0x2ed54f){if(_['isNil'](_0x2ed54f)){return;}else{_0x47e22c['fax']=_0x2ed54f[_0x70eb('0x7c')];return db[_0x70eb('0x89')][_0x70eb('0x88')]({'where':{'id':_0x47e22c['AttachmentId']}});}})['then'](function(_0x39db0d){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x70eb('0x62')](_0x49f8a8[_0x70eb('0x56')])?undefined:_0x49f8a8['body'][_0x70eb('0x8a')],'path':_[_0x70eb('0x62')](_0x39db0d)?undefined:util[_0x70eb('0x5d')](_0x70eb('0x8b'),_0x39db0d['basename']),'fax':_[_0x70eb('0x62')](_0x47e22c[_0x70eb('0x7c')])?undefined:_0x47e22c[_0x70eb('0x7c')],'AttachmentId':_0x47e22c[_0x70eb('0x8c')]},client9002);})[_0x70eb('0x20')](respondWithResult(_0x1a841a,0xc9))[_0x70eb('0x28')](handleError(_0x1a841a,null));};exports[_0x70eb('0x8d')]=function(_0x5f2bfa,_0x18d85d){var _0x3afe6e=path[_0x70eb('0x8e')](config[_0x70eb('0x8f')],_0x70eb('0x90'),_0x70eb('0x91'),_0x70eb('0x92'));return db['FaxMessage'][_0x70eb('0x54')]({'where':{'id':_0x5f2bfa['params']['id']},'include':[{'model':db['Attachment'],'as':_0x70eb('0x89')}]})['then'](handleEntityNotFound(_0x18d85d,null))[_0x70eb('0x20')](function(_0x40be07){if(_0x40be07){return _0x18d85d[_0x70eb('0x8d')](path[_0x70eb('0x8e')](_0x3afe6e,_0x40be07[_0x70eb('0x89')][_0x70eb('0x93')]));}})['catch'](handleError(_0x18d85d,null));}; \ No newline at end of file +var _0x6410=['join','server','files','attachments','basename','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','jayson/promise','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','FaxMessage','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','fax-interactions','accept','readAt','format','UserId','user','agent','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download'];(function(_0x848c89,_0x223971){var _0x1364d7=function(_0x1ac668){while(--_0x1ac668){_0x848c89['push'](_0x848c89['shift']());}};_0x1364d7(++_0x223971);}(_0x6410,0x1af));var _0x0641=function(_0x1938a6,_0x23fc6d){_0x1938a6=_0x1938a6-0x0;var _0xdca1c6=_0x6410[_0x1938a6];return _0xdca1c6;};'use strict';var emlformat=require(_0x0641('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0641('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0641('0x2'));var moment=require(_0x0641('0x3'));var BPromise=require(_0x0641('0x4'));var Mustache=require(_0x0641('0x5'));var util=require(_0x0641('0x6'));var path=require('path');var sox=require(_0x0641('0x7'));var csv=require(_0x0641('0x8'));var ejs=require(_0x0641('0x9'));var fs=require('fs');var fs_extra=require(_0x0641('0xa'));var _=require('lodash');var squel=require(_0x0641('0xb'));var crypto=require(_0x0641('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0641('0xd'));var toCsv=require(_0x0641('0x8'));var querystring=require(_0x0641('0xe'));var Papa=require('papaparse');var Redis=require(_0x0641('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0641('0x10'));var as=require(_0x0641('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0641('0x12'))(_0x0641('0x13'));var utils=require('../../config/utils');var config=require(_0x0641('0x14'));var licenseUtil=require(_0x0641('0x15'));var db=require(_0x0641('0x16'))['db'];config[_0x0641('0x17')]=_[_0x0641('0x18')](config[_0x0641('0x17')],{'host':_0x0641('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0641('0x1a'))['register'](socket);var jayson=require(_0x0641('0x1b'));var client=jayson[_0x0641('0x1c')][_0x0641('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x0641('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x332f54,_0x5b3c64,_0x4a2a08,_0x3a4b44){return new BPromise(function(_0x8eca3,_0x279108){var _0x3fb7ee=_0x3a4b44||client;return _0x3fb7ee['request'](_0x332f54,_0x4a2a08)[_0x0641('0x1e')](function(_0x163e51){logger['info'](_0x0641('0x1f'),_0x5b3c64,_0x0641('0x20'));logger[_0x0641('0x21')](_0x0641('0x22'),_0x5b3c64,_0x0641('0x20'),JSON[_0x0641('0x23')](_0x163e51));if(_0x163e51[_0x0641('0x24')]){if(_0x163e51[_0x0641('0x24')][_0x0641('0x25')]===0x1f4){logger[_0x0641('0x24')](_0x0641('0x1f'),_0x5b3c64,_0x163e51['error'][_0x0641('0x26')]);return _0x279108(_0x163e51[_0x0641('0x24')]['message']);}logger[_0x0641('0x24')](_0x0641('0x1f'),_0x5b3c64,_0x163e51[_0x0641('0x24')][_0x0641('0x26')]);return _0x8eca3(_0x163e51[_0x0641('0x24')]['message']);}else{logger[_0x0641('0x27')]('FaxMessage,\x20%s,\x20%s',_0x5b3c64,_0x0641('0x20'));_0x8eca3(_0x163e51[_0x0641('0x28')][_0x0641('0x26')]);}})['catch'](function(_0x4ea59c){logger[_0x0641('0x24')](_0x0641('0x1f'),_0x5b3c64,_0x4ea59c);_0x279108(_0x4ea59c);});});}function respondWithStatusCode(_0x5d23e4,_0x2642f1){_0x2642f1=_0x2642f1||0xcc;return function(_0x45eddc){if(_0x45eddc){return _0x5d23e4[_0x0641('0x29')](_0x2642f1);}return _0x5d23e4[_0x0641('0x2a')](_0x2642f1)['end']();};}function respondWithResult(_0x4e2338,_0x1deb27){_0x1deb27=_0x1deb27||0xc8;return function(_0x42a5fe){if(_0x42a5fe){return _0x4e2338[_0x0641('0x2a')](_0x1deb27)[_0x0641('0x2b')](_0x42a5fe);}};}function respondWithFilteredResult(_0x4e5382,_0x288997){return function(_0x167a97){if(_0x167a97){var _0x5452ad=typeof _0x288997['offset']==='undefined'&&typeof _0x288997[_0x0641('0x2c')]===_0x0641('0x2d');var _0x549805=_0x167a97[_0x0641('0x2e')];var _0x4dc62d=_0x5452ad?0x0:_0x288997[_0x0641('0x2f')];var _0x43a6d0=_0x5452ad?_0x167a97[_0x0641('0x2e')]:_0x288997['offset']+_0x288997['limit'];var _0x1753bd;if(_0x43a6d0>=_0x549805){_0x43a6d0=_0x549805;_0x1753bd=0xc8;}else{_0x1753bd=0xce;}_0x4e5382[_0x0641('0x2a')](_0x1753bd);return _0x4e5382[_0x0641('0x30')](_0x0641('0x31'),_0x4dc62d+'-'+_0x43a6d0+'/'+_0x549805)[_0x0641('0x2b')](_0x167a97);}return null;};}function patchUpdates(_0x2aeb29){return function(_0x1b34a3){try{jsonpatch[_0x0641('0x32')](_0x1b34a3,_0x2aeb29,!![]);}catch(_0x3dc742){return BPromise[_0x0641('0x33')](_0x3dc742);}return _0x1b34a3[_0x0641('0x34')]();};}function saveUpdates(_0x5e225a,_0x595049){return function(_0x311380){if(_0x311380){return _0x311380[_0x0641('0x35')](_0x5e225a)[_0x0641('0x1e')](function(_0x365797){return _0x365797;});}return null;};}function removeEntity(_0x2d9097,_0x19648c){return function(_0x519821){if(_0x519821){return _0x519821[_0x0641('0x36')]()['then'](function(){_0x2d9097[_0x0641('0x2a')](0xcc)[_0x0641('0x37')]();});}};}function handleEntityNotFound(_0x191f2e,_0x8c599b){return function(_0xdc4cab){if(!_0xdc4cab){_0x191f2e[_0x0641('0x29')](0x194);}return _0xdc4cab;};}function handleError(_0x82d33c,_0x2b1a18){_0x2b1a18=_0x2b1a18||0x1f4;return function(_0x20980c){logger[_0x0641('0x24')](_0x20980c[_0x0641('0x38')]);if(_0x20980c[_0x0641('0x39')]){delete _0x20980c[_0x0641('0x39')];}_0x82d33c['status'](_0x2b1a18)['send'](_0x20980c);};}exports[_0x0641('0x3a')]=function(_0x3549cf,_0x27f3b4){var _0x5c5043={},_0x59697d={},_0x11ac52={'count':0x0,'rows':[]};var _0x58a9a2=_['map'](db[_0x0641('0x3b')][_0x0641('0x3c')],function(_0x140d2c){return{'name':_0x140d2c['fieldName'],'type':_0x140d2c[_0x0641('0x3d')]['key']};});_0x59697d['model']=_[_0x0641('0x3e')](_0x58a9a2,_0x0641('0x39'));_0x59697d[_0x0641('0x3f')]=_[_0x0641('0x40')](_0x3549cf['query']);_0x59697d[_0x0641('0x41')]=_[_0x0641('0x42')](_0x59697d[_0x0641('0x43')],_0x59697d['query']);_0x5c5043[_0x0641('0x44')]=_[_0x0641('0x42')](_0x59697d[_0x0641('0x43')],qs['fields'](_0x3549cf[_0x0641('0x3f')][_0x0641('0x45')]));_0x5c5043[_0x0641('0x44')]=_0x5c5043[_0x0641('0x44')][_0x0641('0x46')]?_0x5c5043[_0x0641('0x44')]:_0x59697d['model'];if(!_0x3549cf['query'][_0x0641('0x47')](_0x0641('0x48'))){_0x5c5043['limit']=qs['limit'](_0x3549cf[_0x0641('0x3f')]['limit']);_0x5c5043[_0x0641('0x2f')]=qs[_0x0641('0x2f')](_0x3549cf['query'][_0x0641('0x2f')]);}_0x5c5043[_0x0641('0x49')]=qs['sort'](_0x3549cf['query'][_0x0641('0x4a')]);_0x5c5043['where']=qs[_0x0641('0x41')](_[_0x0641('0x4b')](_0x3549cf['query'],_0x59697d[_0x0641('0x41')]),_0x58a9a2);if(_0x3549cf['query'][_0x0641('0x4c')]){_0x5c5043[_0x0641('0x4d')]=_[_0x0641('0x4e')](_0x5c5043['where'],{'$or':_[_0x0641('0x3e')](_0x58a9a2,function(_0x3ea371){if(_0x3ea371['type']!==_0x0641('0x4f')){var _0x28c0b6={};_0x28c0b6[_0x3ea371[_0x0641('0x39')]]={'$like':'%'+_0x3549cf[_0x0641('0x3f')]['filter']+'%'};return _0x28c0b6;}})});}_0x5c5043=_[_0x0641('0x4e')]({},_0x5c5043,_0x3549cf[_0x0641('0x50')]);var _0x3ea8a5={'where':_0x5c5043['where']};return db['FaxMessage'][_0x0641('0x2e')](_0x3ea8a5)[_0x0641('0x1e')](function(_0x3cc5c7){_0x11ac52[_0x0641('0x2e')]=_0x3cc5c7;if(_0x3549cf[_0x0641('0x3f')][_0x0641('0x51')]){_0x5c5043[_0x0641('0x52')]=[{'all':!![]}];}return db[_0x0641('0x3b')][_0x0641('0x53')](_0x5c5043);})['then'](function(_0x344bed){_0x11ac52[_0x0641('0x54')]=_0x344bed;return _0x11ac52;})['then'](respondWithFilteredResult(_0x27f3b4,_0x5c5043))[_0x0641('0x55')](handleError(_0x27f3b4,null));};exports[_0x0641('0x56')]=function(_0x54368a,_0x5be47e){var _0x27a88d={'raw':!![],'where':{'id':_0x54368a[_0x0641('0x57')]['id']}},_0x6f3037={};_0x6f3037[_0x0641('0x43')]=_['keys'](db[_0x0641('0x3b')]['rawAttributes']);_0x6f3037[_0x0641('0x3f')]=_['keys'](_0x54368a['query']);_0x6f3037[_0x0641('0x41')]=_[_0x0641('0x42')](_0x6f3037['model'],_0x6f3037[_0x0641('0x3f')]);_0x27a88d[_0x0641('0x44')]=_['intersection'](_0x6f3037[_0x0641('0x43')],qs[_0x0641('0x45')](_0x54368a[_0x0641('0x3f')][_0x0641('0x45')]));_0x27a88d['attributes']=_0x27a88d[_0x0641('0x44')][_0x0641('0x46')]?_0x27a88d[_0x0641('0x44')]:_0x6f3037[_0x0641('0x43')];if(_0x54368a[_0x0641('0x3f')][_0x0641('0x51')]){_0x27a88d[_0x0641('0x52')]=[{'all':!![]}];}_0x27a88d=_['merge']({},_0x27a88d,_0x54368a['options']);return db[_0x0641('0x3b')][_0x0641('0x58')](_0x27a88d)[_0x0641('0x1e')](handleEntityNotFound(_0x5be47e,null))[_0x0641('0x1e')](respondWithResult(_0x5be47e,null))['catch'](handleError(_0x5be47e,null));};exports[_0x0641('0x35')]=function(_0x2878fb,_0x1e8aa9){if(_0x2878fb[_0x0641('0x59')]['id']){delete _0x2878fb[_0x0641('0x59')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x2878fb[_0x0641('0x57')]['id']}})[_0x0641('0x1e')](handleEntityNotFound(_0x1e8aa9,null))[_0x0641('0x1e')](saveUpdates(_0x2878fb[_0x0641('0x59')],null))[_0x0641('0x1e')](respondWithResult(_0x1e8aa9,null))[_0x0641('0x55')](handleError(_0x1e8aa9,null));};exports[_0x0641('0x36')]=function(_0x517a31,_0x50e805){return db[_0x0641('0x3b')][_0x0641('0x58')]({'where':{'id':_0x517a31[_0x0641('0x57')]['id']}})[_0x0641('0x1e')](handleEntityNotFound(_0x50e805,null))[_0x0641('0x1e')](removeEntity(_0x50e805,null))[_0x0641('0x55')](handleError(_0x50e805,null));};exports[_0x0641('0x5a')]=function(_0x202b48,_0x2f70d1){return db['FaxMessage']['describe']()[_0x0641('0x1e')](respondWithResult(_0x2f70d1,null))['catch'](handleError(_0x2f70d1,null));};var interaction_log=require(_0x0641('0x12'))(_0x0641('0x5b'));exports[_0x0641('0x5c')]=function(_0x456180,_0x448485,_0x2d60a1){var _0x3eb0f7={'agent':{},'channel':'fax'};if(_0x456180[_0x0641('0x59')]['id']){delete _0x456180[_0x0641('0x59')]['id'];}_0x456180[_0x0641('0x59')]['read']=!![];_0x456180[_0x0641('0x59')][_0x0641('0x5d')]=moment()[_0x0641('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x456180['body']['UserId']=_0x456180['body'][_0x0641('0x5f')]||_0x456180[_0x0641('0x60')]['id'];_0x3eb0f7[_0x0641('0x61')]['id']=_0x456180[_0x0641('0x59')][_0x0641('0x5f')];return db[_0x0641('0x3b')][_0x0641('0x58')]({'where':{'id':_0x456180['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x448485,null))[_0x0641('0x1e')](saveUpdates(_0x456180[_0x0641('0x59')],null))[_0x0641('0x1e')](function(_0x21f1c8){if(_0x21f1c8){_0x3eb0f7['message']=_0x21f1c8['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x21f1c8[_0x0641('0x62')]}});}return null;})[_0x0641('0x1e')](handleEntityNotFound(_0x448485,null))[_0x0641('0x1e')](function(_0x3b8114){if(_0x3b8114){return _0x3b8114[_0x0641('0x35')]({'UserId':_0x456180['body']['UserId'],'read1stAt':_[_0x0641('0x63')](_0x3b8114['read1stAt'])?moment()[_0x0641('0x5e')](_0x0641('0x64')):undefined});}return null;})[_0x0641('0x1e')](function(_0x5ac186){if(_0x5ac186){_0x3eb0f7[_0x0641('0x65')]=_0x5ac186[_0x0641('0x66')]({'plain':!![]});interaction_log[_0x0641('0x27')](_0x0641('0x67'),_0x456180[_0x0641('0x60')]['id'],_0x456180[_0x0641('0x60')][_0x0641('0x39')],_0x456180[_0x0641('0x60')]['role'],_0x3eb0f7[_0x0641('0x65')]['id'],_0x456180[_0x0641('0x59')]?JSON[_0x0641('0x23')](_0x456180[_0x0641('0x59')]):'null');return respondWithRpcPromise(_0x0641('0x68'),_0x0641('0x69'),_0x3eb0f7);}return null;})[_0x0641('0x1e')](function(_0x1b5945){var _0x38d440=_0x0641('0x6a')+_0x1b5945[_0x0641('0x26')][_0x0641('0x6b')];return db[_0x0641('0x6c')]['query'](_0x38d440,{'type':db['Sequelize'][_0x0641('0x6d')]['SELECT'],'raw':!![]})[_0x0641('0x1e')](function(_0x50e4ee){return _0x50e4ee;});})[_0x0641('0x1e')](function(_0x306ea1){if(_0x306ea1){_0x3eb0f7[_0x0641('0x26')]['contact']=_0x306ea1[0x0];if(!_0x456180['body'][_0x0641('0x5f')])return;return db[_0x0641('0x6e')][_0x0641('0x58')]({'where':{'id':_0x456180['body'][_0x0641('0x5f')],'role':_0x0641('0x61')},'attributes':['id',_0x0641('0x39'),_0x0641('0x6f'),_0x0641('0x70'),_0x0641('0x71')],'raw':!![]});}return null;})[_0x0641('0x1e')](function(_0x5b5e24){if(!_0x5b5e24)return null;_0x3eb0f7[_0x0641('0x26')][_0x0641('0x61')]=_0x5b5e24;return _0x3eb0f7;})['then'](function(_0x46deb5){if(_0x46deb5){if(_0x456180['body']['manual']){_0x3eb0f7['message'][_0x0641('0x72')]=util[_0x0641('0x5e')]('SIP/%s',_0x456180[_0x0641('0x60')][_0x0641('0x39')]);_0x3eb0f7[_0x0641('0x26')][_0x0641('0x73')]=_0x3eb0f7[_0x0641('0x73')];_0x3eb0f7['message'][_0x0641('0x74')]=_0x3eb0f7['channel'];_0x3eb0f7[_0x0641('0x26')][_0x0641('0x75')]='accept';return respondWithRpcPromise('EventManager',_0x0641('0x76'),{'event':_0x0641('0x77'),'message':_0x3eb0f7[_0x0641('0x26')]},client9002)[_0x0641('0x1e')](function(){return _0x3eb0f7;});}return _0x3eb0f7;}return null;})['then'](respondWithResult(_0x448485,null))[_0x0641('0x55')](handleError(_0x448485,null));};var interaction_log=require(_0x0641('0x12'))(_0x0641('0x5b'));exports[_0x0641('0x33')]=function(_0x1ba810,_0x9b1bcc,_0x4ffa32){var _0x3ffede={'agent':{},'channel':_0x0641('0x78')};if(_0x1ba810[_0x0641('0x59')]['id']){delete _0x1ba810['body']['id'];}_0x1ba810[_0x0641('0x59')][_0x0641('0x5f')]=_0x1ba810[_0x0641('0x59')][_0x0641('0x5f')]||_0x1ba810['user']['id'];_0x3ffede['agent']['id']=_0x1ba810[_0x0641('0x59')][_0x0641('0x5f')];return db['FaxMessage'][_0x0641('0x58')]({'where':{'id':_0x1ba810['params']['id'],'UserId':null}})[_0x0641('0x1e')](handleEntityNotFound(_0x9b1bcc,null))[_0x0641('0x1e')](function(_0x17b6c8){if(_0x17b6c8){_0x3ffede['message']=_0x17b6c8[_0x0641('0x66')]({'plain':!![]});return db[_0x0641('0x79')][_0x0641('0x58')]({'where':{'id':_0x17b6c8[_0x0641('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x9b1bcc,null))['then'](function(_0x244c85){if(_0x244c85){_0x3ffede[_0x0641('0x65')]=_0x244c85['get']({'plain':!![]});interaction_log['info'](_0x0641('0x7a'),_0x1ba810[_0x0641('0x60')]['id'],_0x1ba810[_0x0641('0x60')][_0x0641('0x39')],_0x1ba810['user'][_0x0641('0x7b')],_0x3ffede['interaction']['id'],_0x1ba810[_0x0641('0x59')]?JSON[_0x0641('0x23')](_0x1ba810[_0x0641('0x59')]):_0x0641('0x7c'));return respondWithRpcPromise(_0x0641('0x7d'),_0x0641('0x7e'),_0x3ffede);}return null;})[_0x0641('0x1e')](function(_0x2fad48){var _0xda3694=_0x0641('0x6a')+_0x2fad48[_0x0641('0x26')][_0x0641('0x6b')];return db[_0x0641('0x6c')]['query'](_0xda3694,{'type':db['Sequelize']['QueryTypes'][_0x0641('0x7f')],'raw':!![]})[_0x0641('0x1e')](function(_0x51f9d0){return _0x51f9d0;});})[_0x0641('0x1e')](function(_0x4c0596){if(_0x4c0596){_0x3ffede[_0x0641('0x26')]['contact']=_0x4c0596[0x0];if(!_0x1ba810[_0x0641('0x59')][_0x0641('0x5f')])return;return db[_0x0641('0x6e')]['find']({'where':{'id':_0x1ba810[_0x0641('0x59')][_0x0641('0x5f')],'role':_0x0641('0x61')},'attributes':['id',_0x0641('0x39'),'fullname','email',_0x0641('0x71')],'raw':!![]});}return null;})['then'](function(_0x57d232){if(!_0x57d232)return null;_0x3ffede['message'][_0x0641('0x61')]=_0x57d232;return _0x3ffede;})[_0x0641('0x1e')](function(_0x1c6bf4){if(_0x1c6bf4){_0x1c6bf4[_0x0641('0x26')][_0x0641('0x72')]=util['format']('SIP/%s',_0x1ba810[_0x0641('0x60')][_0x0641('0x39')]);_0x1c6bf4[_0x0641('0x26')][_0x0641('0x73')]=_0x3ffede[_0x0641('0x73')];_0x1c6bf4[_0x0641('0x26')][_0x0641('0x74')]=_0x3ffede['channel'];_0x1c6bf4[_0x0641('0x26')]['event']='reject';respondWithRpcPromise(_0x0641('0x76'),_0x0641('0x76'),{'event':_0x0641('0x80'),'message':_0x1c6bf4['message']},client9002);return _0x3ffede;}return null;})['then'](respondWithResult(_0x9b1bcc,null))[_0x0641('0x55')](handleError(_0x9b1bcc,null));};exports[_0x0641('0x81')]=function(_0x5755f4,_0x17e628){var _0xc73473;return db[_0x0641('0x3b')][_0x0641('0x81')](_0x5755f4[_0x0641('0x59')],{})['then'](function(_0xcfb9a6){_0xc73473=_0xcfb9a6;return db['CmContact'][_0x0641('0x82')]({'where':{'id':_0xc73473[_0x0641('0x6b')]}});})['then'](function(_0x39fe05){if(_[_0x0641('0x63')](_0x39fe05)){return;}else{_0xc73473[_0x0641('0x78')]=_0x39fe05[_0x0641('0x78')];return db[_0x0641('0x83')][_0x0641('0x82')]({'where':{'id':_0xc73473[_0x0641('0x84')]}});}})[_0x0641('0x1e')](function(_0x90457b){return respondWithRpcPromise(_0x0641('0x85'),_0x0641('0x85'),{'FaxAccountId':_[_0x0641('0x63')](_0x5755f4['body'])?undefined:_0x5755f4[_0x0641('0x59')][_0x0641('0x86')],'path':_['isNil'](_0x90457b)?undefined:util[_0x0641('0x5e')](_0x0641('0x87'),_0x90457b['basename']),'fax':_[_0x0641('0x63')](_0xc73473[_0x0641('0x78')])?undefined:_0xc73473[_0x0641('0x78')],'AttachmentId':_0xc73473[_0x0641('0x84')]},client9002);})['then'](respondWithResult(_0x17e628,0xc9))[_0x0641('0x55')](handleError(_0x17e628,null));};exports[_0x0641('0x88')]=function(_0x1fa312,_0x1264c8){var _0x106cdf=path[_0x0641('0x89')](config['root'],_0x0641('0x8a'),_0x0641('0x8b'),_0x0641('0x8c'));return db[_0x0641('0x3b')][_0x0641('0x58')]({'where':{'id':_0x1fa312[_0x0641('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x1264c8,null))[_0x0641('0x1e')](function(_0x49773f){if(_0x49773f){return _0x1264c8[_0x0641('0x88')](path[_0x0641('0x89')](_0x106cdf,_0x49773f[_0x0641('0x83')][_0x0641('0x8d')]));}})[_0x0641('0x55')](handleError(_0x1264c8,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index fb732f6..fe49553 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 _0x1059=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x1b32b4,_0x286da1){var _0x35866e=function(_0x2e127f){while(--_0x2e127f){_0x1b32b4['push'](_0x1b32b4['shift']());}};_0x35866e(++_0x286da1);}(_0x1059,0x176));var _0x9105=function(_0x5f2870,_0x184054){_0x5f2870=_0x5f2870-0x0;var _0x51b9b0=_0x1059[_0x5f2870];return _0x51b9b0;};'use strict';var EventEmitter=require(_0x9105('0x0'));var FaxMessage=require(_0x9105('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9105('0x2')](0x0);var events={'afterCreate':_0x9105('0x3'),'afterUpdate':_0x9105('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3565b3){return function(_0x59b3db,_0x44878b,_0x219176){FaxMessageEvents['emit'](_0x3565b3+':'+_0x59b3db['id'],_0x59b3db);FaxMessageEvents[_0x9105('0x5')](_0x3565b3,_0x59b3db);_0x219176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x9105('0x6')](e,emitEvent(event));}}module[_0x9105('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xd98a=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5212bf,_0x51d007){var _0x1c426c=function(_0x1dc20d){while(--_0x1dc20d){_0x5212bf['push'](_0x5212bf['shift']());}};_0x1c426c(++_0x51d007);}(_0xd98a,0xfc));var _0xad98=function(_0x27fb9f,_0x33e520){_0x27fb9f=_0x27fb9f-0x0;var _0x5b768c=_0xd98a[_0x27fb9f];return _0x5b768c;};'use strict';var EventEmitter=require(_0xad98('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xad98('0x1')](0x0);var events={'afterCreate':_0xad98('0x2'),'afterUpdate':_0xad98('0x3'),'afterDestroy':_0xad98('0x4')};function emitEvent(_0x245d98){return function(_0x1ab3f6,_0x5b14d4,_0x4bd4cf){FaxMessageEvents[_0xad98('0x5')](_0x245d98+':'+_0x1ab3f6['id'],_0x1ab3f6);FaxMessageEvents[_0xad98('0x5')](_0x245d98,_0x1ab3f6);_0x4bd4cf(null);};}for(var e in events){if(events[_0xad98('0x6')](e)){var event=events[e];FaxMessage[_0xad98('0x7')](e,emitEvent(event));}}module[_0xad98('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 2eaade4..c5079a2 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 _0x33d5=['toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction'];(function(_0x4620fa,_0x6cd23d){var _0x15e179=function(_0x3af884){while(--_0x3af884){_0x4620fa['push'](_0x4620fa['shift']());}};_0x15e179(++_0x6cd23d);}(_0x33d5,0x157));var _0x533d=function(_0x4a2c5d,_0x1cfe0e){_0x4a2c5d=_0x4a2c5d-0x0;var _0x40bde1=_0x33d5[_0x4a2c5d];return _0x40bde1;};'use strict';var _=require(_0x533d('0x0'));var util=require(_0x533d('0x1'));var logger=require('../../config/logger')(_0x533d('0x2'));var moment=require(_0x533d('0x3'));var BPromise=require(_0x533d('0x4'));var rp=require(_0x533d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x533d('0x6'));var config=require(_0x533d('0x7'));var attributes=require(_0x533d('0x8'));module['exports']=function(_0x491598,_0x545a56){return _0x491598[_0x533d('0x9')](_0x533d('0xa'),attributes,{'tableName':_0x533d('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x533d('0xc')],'type':_0x533d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a1b0e,_0x4c905c,_0x2eaa00){var _0x1f2b7e=_0x491598[_0x533d('0xe')];var _0x57f5b2=_0x3a1b0e[_0x533d('0xf')]({'plain':!![]});if(_0x57f5b2[_0x533d('0x10')][_0x533d('0x11')]()==='in'||_0x57f5b2[_0x533d('0x10')][_0x533d('0x11')]()===_0x533d('0x12')&&!_0x57f5b2[_0x533d('0x13')]&&!_[_0x533d('0x14')](_0x57f5b2[_0x533d('0x15')])){_0x1f2b7e[_0x533d('0x16')][_0x533d('0x17')]({'where':{'id':_0x57f5b2[_0x533d('0x18')]}})['then'](function(_0x41a4d4){if(_0x41a4d4){_0x41a4d4[_0x533d('0x19')]({'lastMsgAt':_0x57f5b2[_0x533d('0x1a')],'lastMsgDirection':_0x57f5b2['direction']['toLowerCase']()});}})[_0x533d('0x1b')](function(_0x49b209){console[_0x533d('0x1c')](_0x49b209);});}_0x2eaa00();}},'charset':'utf8mb4','collate':_0x533d('0x1d')});}; \ No newline at end of file +var _0xc443=['../../config/logger','api','request-promise','path','rimraf','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','get','toLowerCase','direction','out','UserId','FaxInteraction','findOne','then','update','createdAt','error','utf8mb4','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc443,0xbe));var _0x3c44=function(_0x23c54f,_0x5f20e2){_0x23c54f=_0x23c54f-0x0;var _0x3bf22a=_0xc443[_0x23c54f];return _0x3bf22a;};'use strict';var _=require(_0x3c44('0x0'));var util=require(_0x3c44('0x1'));var logger=require(_0x3c44('0x2'))(_0x3c44('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c44('0x4'));var fs=require('fs');var path=require(_0x3c44('0x5'));var rimraf=require(_0x3c44('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c44('0x7'));module[_0x3c44('0x8')]=function(_0x3d7ce5,_0xd7f1a9){return _0x3d7ce5['define']('FaxMessage',attributes,{'tableName':_0x3c44('0x9'),'paranoid':![],'indexes':[{'name':_0x3c44('0xa'),'fields':[_0x3c44('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28e38a,_0xd04193,_0xabf3b8){var _0x273635=_0x3d7ce5['models'];var _0x4602df=_0x28e38a[_0x3c44('0xc')]({'plain':!![]});if(_0x4602df['direction'][_0x3c44('0xd')]()==='in'||_0x4602df[_0x3c44('0xe')]['toLowerCase']()===_0x3c44('0xf')&&!_0x4602df['secret']&&!_['isNil'](_0x4602df[_0x3c44('0x10')])){_0x273635[_0x3c44('0x11')][_0x3c44('0x12')]({'where':{'id':_0x4602df['FaxInteractionId']}})[_0x3c44('0x13')](function(_0x1c06da){if(_0x1c06da){_0x1c06da[_0x3c44('0x14')]({'lastMsgAt':_0x4602df[_0x3c44('0x15')],'lastMsgDirection':_0x4602df[_0x3c44('0xe')][_0x3c44('0xd')]()});}})['catch'](function(_0x2a9dc6){console[_0x3c44('0x16')](_0x2a9dc6);});}_0xabf3b8();}},'charset':_0x3c44('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ec568f3..a4e60c3 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 _0x5636=['error','code','message','result','CreateFaxMessage','FaxMessage','body','options','then','UpdateFaxMessage','update','where','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d007f,_0x52f761){var _0x341999=function(_0x414676){while(--_0x414676){_0x3d007f['push'](_0x3d007f['shift']());}};_0x341999(++_0x52f761);}(_0x5636,0x102));var _0x6563=function(_0x3b3ffc,_0x170aed){_0x3b3ffc=_0x3b3ffc-0x0;var _0x37c0c7=_0x5636[_0x3b3ffc];return _0x37c0c7;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}exports[_0x6563('0x1a')]=function(_0xf8b544){var _0x10811d=this;return new Promise(function(_0x37ba3,_0x93a45){return db[_0x6563('0x1b')]['create'](_0xf8b544[_0x6563('0x1c')],{'raw':_0xf8b544[_0x6563('0x1d')]?_0xf8b544[_0x6563('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6563('0x1e')](function(_0x5c37bb){logger[_0x6563('0x10')](_0x6563('0x1a'),_0xf8b544);logger['debug']('CreateFaxMessage',_0xf8b544,JSON[_0x6563('0x15')](_0x5c37bb));_0x37ba3(_0x5c37bb);})['catch'](function(_0x1097d0){logger[_0x6563('0x16')](_0x6563('0x1a'),_0x1097d0['message'],_0xf8b544);_0x93a45(_0x10811d[_0x6563('0x16')](0x1f4,_0x1097d0['message']));});});};exports[_0x6563('0x1f')]=function(_0x1590e6){var _0x5e5aeb=this;return new Promise(function(_0x365b16,_0x28252d){return db['FaxMessage'][_0x6563('0x20')](_0x1590e6['body'],{'raw':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')][_0x6563('0x21')]||null:null,'attributes':_0x1590e6[_0x6563('0x1d')]?_0x1590e6[_0x6563('0x1d')]['attributes']||null:null,'limit':_0x1590e6[_0x6563('0x1d')]?_0x1590e6['options']['limit']||null:null})[_0x6563('0x1e')](function(_0x35af37){logger[_0x6563('0x10')](_0x6563('0x1f'),_0x1590e6);logger[_0x6563('0x13')](_0x6563('0x1f'),_0x1590e6,JSON[_0x6563('0x15')](_0x35af37));_0x365b16(_0x35af37);})[_0x6563('0x22')](function(_0x101b24){logger[_0x6563('0x16')]('UpdateFaxMessage',_0x101b24[_0x6563('0x18')],_0x1590e6);_0x28252d(_0x5e5aeb[_0x6563('0x16')](0x1f4,_0x101b24[_0x6563('0x18')]));});});}; \ No newline at end of file +var _0x8d0e=['http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x269432,_0x1a5fdf){var _0x40a8cb=function(_0x35cc59){while(--_0x35cc59){_0x269432['push'](_0x269432['shift']());}};_0x40a8cb(++_0x1a5fdf);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x252d38,_0x1b74e6){_0x252d38=_0x252d38-0x0;var _0x51355d=_0x8d0e[_0x252d38];return _0x51355d;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('FaxMessage,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});}exports[_0xe8d0('0x1a')]=function(_0x12ebf4){var _0x524b00=this;return new Promise(function(_0x5ce284,_0x554402){return db[_0xe8d0('0x1b')][_0xe8d0('0x1c')](_0x12ebf4[_0xe8d0('0x1d')],{'raw':_0x12ebf4[_0xe8d0('0x1e')]?_0x12ebf4[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![]})[_0xe8d0('0x11')](function(_0x28a6b5){logger[_0xe8d0('0x12')]('CreateFaxMessage',_0x12ebf4);logger[_0xe8d0('0x20')](_0xe8d0('0x1a'),_0x12ebf4,JSON['stringify'](_0x28a6b5));_0x5ce284(_0x28a6b5);})[_0xe8d0('0x19')](function(_0x2e69d1){logger[_0xe8d0('0x16')](_0xe8d0('0x1a'),_0x2e69d1[_0xe8d0('0x17')],_0x12ebf4);_0x554402(_0x524b00[_0xe8d0('0x16')](0x1f4,_0x2e69d1[_0xe8d0('0x17')]));});});};exports[_0xe8d0('0x21')]=function(_0xfa3527){var _0x2dee67=this;return new Promise(function(_0x264de4,_0x539548){return db[_0xe8d0('0x1b')][_0xe8d0('0x22')](_0xfa3527[_0xe8d0('0x1d')],{'raw':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x23')]||null:null,'attributes':_0xfa3527[_0xe8d0('0x1e')]?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x24')]||null:null,'limit':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')]['limit']||null:null})['then'](function(_0x50ad3c){logger[_0xe8d0('0x12')](_0xe8d0('0x21'),_0xfa3527);logger[_0xe8d0('0x20')]('UpdateFaxMessage',_0xfa3527,JSON['stringify'](_0x50ad3c));_0x264de4(_0x50ad3c);})[_0xe8d0('0x19')](function(_0x551999){logger[_0xe8d0('0x16')](_0xe8d0('0x21'),_0x551999[_0xe8d0('0x17')],_0xfa3527);_0x539548(_0x2dee67[_0xe8d0('0x16')](0x1f4,_0x551999[_0xe8d0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 040acdd..f1ec48c 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 _0x55b9=['remove','emit','removeListener','faxMessage:','./faxMessage.events','save'];(function(_0xf396af,_0x9f3cd5){var _0x53da40=function(_0x457870){while(--_0x457870){_0xf396af['push'](_0xf396af['shift']());}};_0x53da40(++_0x9f3cd5);}(_0x55b9,0x16c));var _0x955b=function(_0x31d372,_0x142ec6){_0x31d372=_0x31d372-0x0;var _0xa25f53=_0x55b9[_0x31d372];return _0xa25f53;};'use strict';var FaxMessageEvents=require(_0x955b('0x0'));var events=[_0x955b('0x1'),_0x955b('0x2'),'update'];function createListener(_0xc478b0,_0x44cdd8){return function(_0x395705){_0x44cdd8[_0x955b('0x3')](_0xc478b0,_0x395705);};}function removeListener(_0x4a6af3,_0x352ddd){return function(){FaxMessageEvents[_0x955b('0x4')](_0x4a6af3,_0x352ddd);};}exports['register']=function(_0x50164d){for(var _0x3991ee=0x0,_0x392ac2=events['length'];_0x3991ee<_0x392ac2;_0x3991ee++){var _0x499d9b=events[_0x3991ee];var _0x12606b=createListener(_0x955b('0x5')+_0x499d9b,_0x50164d);FaxMessageEvents['on'](_0x499d9b,_0x12606b);}}; \ No newline at end of file +var _0x32e3=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x3b16b2,_0x35fbab){var _0x4e79bb=function(_0x1e4559){while(--_0x1e4559){_0x3b16b2['push'](_0x3b16b2['shift']());}};_0x4e79bb(++_0x35fbab);}(_0x32e3,0x102));var _0x332e=function(_0x15fae9,_0x574f6e){_0x15fae9=_0x15fae9-0x0;var _0x359c26=_0x32e3[_0x15fae9];return _0x359c26;};'use strict';var FaxMessageEvents=require(_0x332e('0x0'));var events=['save','remove',_0x332e('0x1')];function createListener(_0x2ea6da,_0x5b3e35){return function(_0x372f4b){_0x5b3e35[_0x332e('0x2')](_0x2ea6da,_0x372f4b);};}function removeListener(_0x44d1c4,_0x38adcf){return function(){FaxMessageEvents[_0x332e('0x3')](_0x44d1c4,_0x38adcf);};}exports[_0x332e('0x4')]=function(_0x2997a4){for(var _0xe31bd8=0x0,_0x38b6e7=events[_0x332e('0x5')];_0xe31bd8<_0x38b6e7;_0xe31bd8++){var _0x2d9ee8=events[_0xe31bd8];var _0x49914d=createListener(_0x332e('0x6')+_0x2d9ee8,_0x2997a4);FaxMessageEvents['on'](_0x2d9ee8,_0x49914d);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9a8c041..084310e 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 _0x5ec6=['express','fs-extra','../../components/interaction/service','./faxMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x3abdf0,_0x1984eb){var _0x78ba4e=function(_0x42ef4c){while(--_0x42ef4c){_0x3abdf0['push'](_0x3abdf0['shift']());}};_0x78ba4e(++_0x1984eb);}(_0x5ec6,0x7f));var _0x65ec=function(_0x135551,_0x4a0223){_0x135551=_0x135551-0x0;var _0x353ef3=_0x5ec6[_0x135551];return _0x353ef3;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['describe']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['show']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),interaction[_0x65ec('0xf')](_0x65ec('0x10'),'faxmessage:create'),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')]('/:id',auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);router[_0x65ec('0x12')](_0x65ec('0x14'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x15')]);router[_0x65ec('0x12')](_0x65ec('0x16'),auth['isAuthenticated'](),controller[_0x65ec('0x17')]);router[_0x65ec('0x18')](_0x65ec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x65ec('0x19')]=router; \ No newline at end of file +var _0xae60=['/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','/:id/accept'];(function(_0x3c4618,_0x15b792){var _0xf27a90=function(_0x1c435b){while(--_0x1c435b){_0x3c4618['push'](_0x3c4618['shift']());}};_0xf27a90(++_0x15b792);}(_0xae60,0x1c7));var _0x0ae6=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xae60[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./faxMessage.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/:id',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x10')]('/',auth[_0x0ae6('0x9')](),interaction[_0x0ae6('0x11')](_0x0ae6('0x12'),_0x0ae6('0x13')),controller[_0x0ae6('0x14')]);router[_0x0ae6('0x15')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x17')]);router[_0x0ae6('0x15')](_0x0ae6('0x18'),auth[_0x0ae6('0x9')](),controller['accept']);router[_0x0ae6('0x15')](_0x0ae6('0x19'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1a')]);router[_0x0ae6('0x1b')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1c')]);module[_0x0ae6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 87c37f6..739550e 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 _0x5b53=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x213ef2,_0x4062dd){var _0x427409=function(_0x5cec32){while(--_0x5cec32){_0x213ef2['push'](_0x213ef2['shift']());}};_0x427409(++_0x4062dd);}(_0x5b53,0x1b1));var _0x35b5=function(_0x842858,_0x3a3ca0){_0x842858=_0x842858-0x0;var _0x46c2a2=_0x5b53[_0x842858];return _0x46c2a2;};'use strict';var Sequelize=require(_0x35b5('0x0'));module['exports']={'name':{'type':Sequelize[_0x35b5('0x1')],'unique':_0x35b5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x35b5('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x35b5('0x4')](_0x35b5('0x5'),'beepall',_0x35b5('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x35b5('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1173=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x380ed0,_0x32f72a){var _0x1a33ec=function(_0x3fba84){while(--_0x3fba84){_0x380ed0['push'](_0x380ed0['shift']());}};_0x1a33ec(++_0x32f72a);}(_0x1173,0x138));var _0x3117=function(_0x5c5b4d,_0x3b4781){_0x5c5b4d=_0x5c5b4d-0x0;var _0x448a9e=_0x1173[_0x5c5b4d];return _0x448a9e;};'use strict';var Sequelize=require('sequelize');module[_0x3117('0x0')]={'name':{'type':Sequelize[_0x3117('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3117('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3117('0x3')](_0x3117('0x4'),'beepall',_0x3117('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3117('0x2')],'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 494277e..8eeef34 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 _0xb863=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','nolimit','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','User','interface','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','Agents','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact','isEmpty','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','get','FaxQueues','then','error','name','send','map','FaxQueue','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x55bb70,_0x2decbc){var _0x186400=function(_0x409778){while(--_0x409778){_0x55bb70['push'](_0x55bb70['shift']());}};_0x186400(++_0x2decbc);}(_0xb863,0x1c9));var _0x3b86=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb863[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b86('0x0'));var jsonpatch=require(_0x3b86('0x1'));var rp=require(_0x3b86('0x2'));var moment=require('moment');var BPromise=require(_0x3b86('0x3'));var Mustache=require('mustache');var util=require(_0x3b86('0x4'));var path=require(_0x3b86('0x5'));var sox=require(_0x3b86('0x6'));var csv=require(_0x3b86('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b86('0x8'));var _=require(_0x3b86('0x9'));var squel=require(_0x3b86('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3b86('0x7'));var querystring=require(_0x3b86('0xb'));var Papa=require('papaparse');var Redis=require(_0x3b86('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3b86('0xd'));var as=require(_0x3b86('0xe'));var hardwareService=require(_0x3b86('0xf'));var logger=require('../../config/logger')(_0x3b86('0x10'));var utils=require(_0x3b86('0x11'));var config=require(_0x3b86('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b86('0x13'))['db'];config[_0x3b86('0x14')]=_[_0x3b86('0x15')](config['redis'],{'host':_0x3b86('0x16'),'port':0x18eb});var socket=require(_0x3b86('0x17'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x3b86('0x18')](socket);function respondWithStatusCode(_0x45acef,_0x9811f2){_0x9811f2=_0x9811f2||0xcc;return function(_0x5d71f4){if(_0x5d71f4){return _0x45acef['sendStatus'](_0x9811f2);}return _0x45acef[_0x3b86('0x19')](_0x9811f2)['end']();};}function respondWithResult(_0x5ede9e,_0x226970){_0x226970=_0x226970||0xc8;return function(_0x407d93){if(_0x407d93){return _0x5ede9e[_0x3b86('0x19')](_0x226970)['json'](_0x407d93);}};}function respondWithFilteredResult(_0x46b05c,_0x2382e8){return function(_0x4f5e61){if(_0x4f5e61){var _0x459d2e=typeof _0x2382e8[_0x3b86('0x1a')]===_0x3b86('0x1b')&&typeof _0x2382e8['limit']===_0x3b86('0x1b');var _0x475e9e=_0x4f5e61[_0x3b86('0x1c')];var _0xe0a03=_0x459d2e?0x0:_0x2382e8['offset'];var _0x2e5901=_0x459d2e?_0x4f5e61[_0x3b86('0x1c')]:_0x2382e8['offset']+_0x2382e8[_0x3b86('0x1d')];var _0x559400;if(_0x2e5901>=_0x475e9e){_0x2e5901=_0x475e9e;_0x559400=0xc8;}else{_0x559400=0xce;}_0x46b05c[_0x3b86('0x19')](_0x559400);return _0x46b05c[_0x3b86('0x1e')](_0x3b86('0x1f'),_0xe0a03+'-'+_0x2e5901+'/'+_0x475e9e)['json'](_0x4f5e61);}return null;};}function patchUpdates(_0x3d4ca4){return function(_0x411eee){try{jsonpatch[_0x3b86('0x20')](_0x411eee,_0x3d4ca4,!![]);}catch(_0x4b2068){return BPromise[_0x3b86('0x21')](_0x4b2068);}return _0x411eee['save']();};}function saveUpdates(_0x462ebd,_0x5367ae){return function(_0x41f418){if(_0x41f418){return _0x41f418['update'](_0x462ebd)['then'](function(_0x5e0f0c){return _0x5e0f0c;});}return null;};}function removeEntity(_0x539651,_0x43a698){return function(_0x500d8a){if(_0x500d8a){return _0x500d8a[_0x3b86('0x22')]()['then'](function(){var _0x2a0efc=_0x500d8a[_0x3b86('0x23')]({'plain':!![]});var _0x12b69d=_0x3b86('0x24');return db['UserProfileResource'][_0x3b86('0x22')]({'where':{'type':_0x12b69d,'resourceId':_0x2a0efc['id']}})['then'](function(){return _0x500d8a;});})[_0x3b86('0x25')](function(){_0x539651['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x294d01,_0x56b1b8){return function(_0x5ef7ed){if(!_0x5ef7ed){_0x294d01['sendStatus'](0x194);}return _0x5ef7ed;};}function handleError(_0x2f6975,_0x39c0aa){_0x39c0aa=_0x39c0aa||0x1f4;return function(_0x152308){logger[_0x3b86('0x26')](_0x152308['stack']);if(_0x152308[_0x3b86('0x27')]){delete _0x152308[_0x3b86('0x27')];}_0x2f6975[_0x3b86('0x19')](_0x39c0aa)[_0x3b86('0x28')](_0x152308);};}exports['index']=function(_0x280a0f,_0x2f89d8){var _0x5d15ab={},_0xe71451={},_0x337ef3={'count':0x0,'rows':[]};var _0x20201c=_[_0x3b86('0x29')](db[_0x3b86('0x2a')][_0x3b86('0x2b')],function(_0xdc0168){return{'name':_0xdc0168['fieldName'],'type':_0xdc0168[_0x3b86('0x2c')]['key']};});_0xe71451[_0x3b86('0x2d')]=_[_0x3b86('0x29')](_0x20201c,_0x3b86('0x27'));_0xe71451[_0x3b86('0x2e')]=_[_0x3b86('0x2f')](_0x280a0f[_0x3b86('0x2e')]);_0xe71451[_0x3b86('0x30')]=_[_0x3b86('0x31')](_0xe71451[_0x3b86('0x2d')],_0xe71451[_0x3b86('0x2e')]);_0x5d15ab['attributes']=_[_0x3b86('0x31')](_0xe71451['model'],qs[_0x3b86('0x32')](_0x280a0f[_0x3b86('0x2e')][_0x3b86('0x32')]));_0x5d15ab[_0x3b86('0x33')]=_0x5d15ab[_0x3b86('0x33')][_0x3b86('0x34')]?_0x5d15ab[_0x3b86('0x33')]:_0xe71451[_0x3b86('0x2d')];if(!_0x280a0f[_0x3b86('0x2e')][_0x3b86('0x35')]('nolimit')){_0x5d15ab[_0x3b86('0x1d')]=qs['limit'](_0x280a0f[_0x3b86('0x2e')][_0x3b86('0x1d')]);_0x5d15ab[_0x3b86('0x1a')]=qs[_0x3b86('0x1a')](_0x280a0f['query'][_0x3b86('0x1a')]);}_0x5d15ab[_0x3b86('0x36')]=qs[_0x3b86('0x37')](_0x280a0f[_0x3b86('0x2e')]['sort']);_0x5d15ab[_0x3b86('0x38')]=qs[_0x3b86('0x30')](_[_0x3b86('0x39')](_0x280a0f['query'],_0xe71451[_0x3b86('0x30')]),_0x20201c);if(_0x280a0f['query'][_0x3b86('0x3a')]){_0x5d15ab[_0x3b86('0x38')]=_['merge'](_0x5d15ab[_0x3b86('0x38')],{'$or':_[_0x3b86('0x29')](_0x20201c,function(_0x4643d9){if(_0x4643d9[_0x3b86('0x2c')]!==_0x3b86('0x3b')){var _0x2d7b65={};_0x2d7b65[_0x4643d9[_0x3b86('0x27')]]={'$like':'%'+_0x280a0f['query']['filter']+'%'};return _0x2d7b65;}})});}_0x5d15ab=_['merge']({},_0x5d15ab,_0x280a0f[_0x3b86('0x3c')]);var _0x2577f9={'where':_0x5d15ab[_0x3b86('0x38')]};return db[_0x3b86('0x2a')][_0x3b86('0x1c')](_0x2577f9)['then'](function(_0x23ed37){_0x337ef3[_0x3b86('0x1c')]=_0x23ed37;if(_0x280a0f[_0x3b86('0x2e')][_0x3b86('0x3d')]){_0x5d15ab[_0x3b86('0x3e')]=[{'all':!![]}];}return db['FaxQueue'][_0x3b86('0x3f')](_0x5d15ab);})[_0x3b86('0x25')](function(_0x2b2c3f){_0x337ef3[_0x3b86('0x40')]=_0x2b2c3f;return _0x337ef3;})[_0x3b86('0x25')](respondWithFilteredResult(_0x2f89d8,_0x5d15ab))[_0x3b86('0x41')](handleError(_0x2f89d8,null));};exports['show']=function(_0x58c6dc,_0x5db6f4){var _0x43ed0b={'raw':!![],'where':{'id':_0x58c6dc[_0x3b86('0x42')]['id']}},_0xbb8769={};_0xbb8769[_0x3b86('0x2d')]=_[_0x3b86('0x2f')](db[_0x3b86('0x2a')]['rawAttributes']);_0xbb8769[_0x3b86('0x2e')]=_[_0x3b86('0x2f')](_0x58c6dc[_0x3b86('0x2e')]);_0xbb8769[_0x3b86('0x30')]=_['intersection'](_0xbb8769[_0x3b86('0x2d')],_0xbb8769[_0x3b86('0x2e')]);_0x43ed0b[_0x3b86('0x33')]=_['intersection'](_0xbb8769[_0x3b86('0x2d')],qs['fields'](_0x58c6dc[_0x3b86('0x2e')][_0x3b86('0x32')]));_0x43ed0b[_0x3b86('0x33')]=_0x43ed0b['attributes'][_0x3b86('0x34')]?_0x43ed0b[_0x3b86('0x33')]:_0xbb8769[_0x3b86('0x2d')];if(_0x58c6dc['query'][_0x3b86('0x3d')]){_0x43ed0b[_0x3b86('0x3e')]=[{'all':!![]}];}_0x43ed0b=_[_0x3b86('0x43')]({},_0x43ed0b,_0x58c6dc[_0x3b86('0x3c')]);return db[_0x3b86('0x2a')][_0x3b86('0x44')](_0x43ed0b)[_0x3b86('0x25')](handleEntityNotFound(_0x5db6f4,null))[_0x3b86('0x25')](respondWithResult(_0x5db6f4,null))[_0x3b86('0x41')](handleError(_0x5db6f4,null));};exports[_0x3b86('0x45')]=function(_0x53a04b,_0x444e30){return db[_0x3b86('0x2a')]['create'](_0x53a04b[_0x3b86('0x46')],{})[_0x3b86('0x25')](function(_0x845b13){var _0x3d110f=_0x53a04b[_0x3b86('0x47')]['get']({'plain':!![]});if(!_0x3d110f)throw new Error(_0x3b86('0x48'));if(_0x3d110f[_0x3b86('0x49')]===_0x3b86('0x47')){var _0x419961=_0x845b13[_0x3b86('0x23')]({'plain':!![]});var _0x5e444a=_0x3b86('0x24');return db[_0x3b86('0x4a')][_0x3b86('0x44')]({'where':{'name':_0x5e444a,'userProfileId':_0x3d110f[_0x3b86('0x4b')]},'raw':!![]})['then'](function(_0x23201f){if(_0x23201f&&_0x23201f['autoAssociation']===0x0){return db[_0x3b86('0x4c')][_0x3b86('0x45')]({'name':_0x419961[_0x3b86('0x27')],'resourceId':_0x419961['id'],'type':_0x23201f[_0x3b86('0x27')],'sectionId':_0x23201f['id']},{})['then'](function(){return _0x845b13;});}else{return _0x845b13;}})[_0x3b86('0x41')](function(_0x2150bf){logger[_0x3b86('0x26')](_0x3b86('0x4d'),_0x2150bf);throw _0x2150bf;});}return _0x845b13;})['then'](respondWithResult(_0x444e30,0xc9))[_0x3b86('0x41')](handleError(_0x444e30,null));};exports[_0x3b86('0x4e')]=function(_0x9c8828,_0x1c465d){if(_0x9c8828[_0x3b86('0x46')]['id']){delete _0x9c8828[_0x3b86('0x46')]['id'];}return db[_0x3b86('0x2a')][_0x3b86('0x44')]({'where':{'id':_0x9c8828[_0x3b86('0x42')]['id']}})[_0x3b86('0x25')](handleEntityNotFound(_0x1c465d,null))['then'](saveUpdates(_0x9c8828[_0x3b86('0x46')],null))[_0x3b86('0x25')](respondWithResult(_0x1c465d,null))[_0x3b86('0x41')](handleError(_0x1c465d,null));};exports[_0x3b86('0x22')]=function(_0x80f27a,_0x80a9c3){return db[_0x3b86('0x2a')][_0x3b86('0x44')]({'where':{'id':_0x80f27a[_0x3b86('0x42')]['id']}})[_0x3b86('0x25')](handleEntityNotFound(_0x80a9c3,null))[_0x3b86('0x25')](removeEntity(_0x80a9c3,null))['catch'](handleError(_0x80a9c3,null));};exports[_0x3b86('0x4f')]=function(_0x1e5a56,_0x55cfa2){return db[_0x3b86('0x2a')][_0x3b86('0x4f')]()[_0x3b86('0x25')](respondWithResult(_0x55cfa2,null))[_0x3b86('0x41')](handleError(_0x55cfa2,null));};exports[_0x3b86('0x50')]=function(_0x39e5e8,_0x20508b,_0x2c30fb){var _0x24603a={'raw':!![],'where':{}},_0x1f1bec={},_0x1c9a75;return db['FaxQueue'][_0x3b86('0x51')]({'where':{'id':_0x39e5e8['params']['id']}})[_0x3b86('0x25')](handleEntityNotFound(_0x20508b,null))[_0x3b86('0x25')](function(_0x266c5f){if(_0x266c5f){_0x1c9a75=_0x266c5f['get']({'plain':!![]});_0x1f1bec[_0x3b86('0x2d')]=_['keys'](db['UserFaxQueue'][_0x3b86('0x2b')]);_0x1f1bec[_0x3b86('0x2e')]=_['keys'](_0x39e5e8[_0x3b86('0x2e')]);_0x1f1bec[_0x3b86('0x30')]=_[_0x3b86('0x31')](_0x1f1bec[_0x3b86('0x2d')],_0x1f1bec['query']);_0x24603a['attributes']=_[_0x3b86('0x31')](_0x1f1bec[_0x3b86('0x2d')],qs['fields'](_0x39e5e8[_0x3b86('0x2e')][_0x3b86('0x32')]));_0x24603a[_0x3b86('0x33')]=_0x24603a[_0x3b86('0x33')][_0x3b86('0x34')]?_0x24603a[_0x3b86('0x33')]:_0x1f1bec[_0x3b86('0x2d')];if(!_0x39e5e8[_0x3b86('0x2e')]['hasOwnProperty'](_0x3b86('0x52'))){_0x24603a['limit']=qs['limit'](_0x39e5e8[_0x3b86('0x2e')][_0x3b86('0x1d')]);_0x24603a[_0x3b86('0x1a')]=qs[_0x3b86('0x1a')](_0x39e5e8[_0x3b86('0x2e')]['offset']);}_0x24603a[_0x3b86('0x36')]=qs[_0x3b86('0x37')](_0x39e5e8[_0x3b86('0x2e')][_0x3b86('0x37')]);_0x24603a[_0x3b86('0x38')]=qs[_0x3b86('0x30')](_['pick'](_0x39e5e8[_0x3b86('0x2e')],_0x1f1bec[_0x3b86('0x30')]));_0x24603a['where']['FaxQueueId']=_0x266c5f['id'];if(_0x39e5e8[_0x3b86('0x2e')][_0x3b86('0x3a')]){_0x24603a[_0x3b86('0x38')]=_['merge'](_0x24603a[_0x3b86('0x38')],{'$or':_[_0x3b86('0x29')](_0x24603a[_0x3b86('0x33')],function(_0x2191df){var _0x489d87={};_0x489d87[_0x2191df]={'$like':'%'+_0x39e5e8[_0x3b86('0x2e')][_0x3b86('0x3a')]+'%'};return _0x489d87;})});}_0x24603a=_[_0x3b86('0x43')]({},_0x24603a,_0x39e5e8[_0x3b86('0x3c')]);return db[_0x3b86('0x53')]['findAll'](_0x24603a);}})[_0x3b86('0x25')](function(_0x1eabcd){if(_0x1eabcd){return db['User'][_0x3b86('0x54')]({'where':{'id':_['map'](_0x1eabcd,_0x3b86('0x55')),'role':_0x3b86('0x56')},'attributes':['id',_0x3b86('0x27'),_0x3b86('0x57'),_0x3b86('0x58'),_0x3b86('0x59')]});}})[_0x3b86('0x25')](function(_0x34a7c2){if(_0x34a7c2){return{'count':_0x34a7c2[_0x3b86('0x1c')],'rows':_[_0x3b86('0x29')](_0x34a7c2[_0x3b86('0x40')],function(_0x27ee96){return{'membername':_0x27ee96[_0x3b86('0x27')],'UserId':_0x27ee96['id'],'queue_name':_0x1c9a75[_0x3b86('0x27')],'FaxQueueId':_0x1c9a75['id'],'interface':util[_0x3b86('0x5a')](_0x3b86('0x5b'),_0x3b86('0x5c'),_0x27ee96[_0x3b86('0x27')]),'penalty':0x0,'paused':_0x27ee96[_0x3b86('0x57')],'createdAt':_0x27ee96[_0x3b86('0x59')],'updatedAt':_0x27ee96[_0x3b86('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b86('0x25')](respondWithFilteredResult(_0x20508b,_0x24603a))[_0x3b86('0x41')](handleError(_0x20508b,null));};exports['getTeams']=function(_0x1a1ec2,_0x542e82,_0x5d2852){var _0x876485={};var _0x599150={};var _0x4fa281;var _0xc1f001;return db['FaxQueue'][_0x3b86('0x51')]({'where':{'id':_0x1a1ec2[_0x3b86('0x42')]['id']}})[_0x3b86('0x25')](handleEntityNotFound(_0x542e82,null))['then'](function(_0x47f801){if(_0x47f801){_0x4fa281=_0x47f801;_0x599150[_0x3b86('0x2d')]=_['keys'](db['Team'][_0x3b86('0x2b')]);_0x599150[_0x3b86('0x2e')]=_['keys'](_0x1a1ec2[_0x3b86('0x2e')]);_0x599150[_0x3b86('0x30')]=_['intersection'](_0x599150[_0x3b86('0x2d')],_0x599150[_0x3b86('0x2e')]);_0x876485['attributes']=_[_0x3b86('0x31')](_0x599150[_0x3b86('0x2d')],qs['fields'](_0x1a1ec2[_0x3b86('0x2e')]['fields']));_0x876485['attributes']=_0x876485['attributes']['length']?_0x876485[_0x3b86('0x33')]:_0x599150['model'];_0x876485[_0x3b86('0x36')]=qs[_0x3b86('0x37')](_0x1a1ec2[_0x3b86('0x2e')][_0x3b86('0x37')]);_0x876485['where']=qs[_0x3b86('0x30')](_[_0x3b86('0x39')](_0x1a1ec2[_0x3b86('0x2e')],_0x599150[_0x3b86('0x30')]));if(_0x1a1ec2[_0x3b86('0x2e')][_0x3b86('0x3a')]){_0x876485[_0x3b86('0x38')]=_['merge'](_0x876485[_0x3b86('0x38')],{'$or':_[_0x3b86('0x29')](_0x876485[_0x3b86('0x33')],function(_0x226886){var _0x3d8e8b={};_0x3d8e8b[_0x226886]={'$like':'%'+_0x1a1ec2['query'][_0x3b86('0x3a')]+'%'};return _0x3d8e8b;})});}_0x876485=_['merge']({},_0x876485,_0x1a1ec2['options']);return _0x4fa281[_0x3b86('0x5d')](_0x876485);}})[_0x3b86('0x25')](function(_0x586613){if(_0x586613){_0xc1f001=_0x586613['length'];if(!_0x1a1ec2[_0x3b86('0x2e')][_0x3b86('0x35')](_0x3b86('0x52'))){_0x876485[_0x3b86('0x1d')]=qs[_0x3b86('0x1d')](_0x1a1ec2['query'][_0x3b86('0x1d')]);_0x876485[_0x3b86('0x1a')]=qs[_0x3b86('0x1a')](_0x1a1ec2[_0x3b86('0x2e')]['offset']);}return _0x4fa281[_0x3b86('0x5d')](_0x876485);}})[_0x3b86('0x25')](function(_0x947c76){if(_0x947c76){return _0x947c76?{'count':_0xc1f001,'rows':_0x947c76}:null;}})[_0x3b86('0x25')](respondWithResult(_0x542e82,null))[_0x3b86('0x41')](handleError(_0x542e82,null));};exports[_0x3b86('0x5e')]=function(_0x3484f9,_0xd97501,_0x5de966){var _0x2ec85c=_0x3484f9['body']['ids'];return db[_0x3b86('0x5f')][_0x3b86('0x3f')]({'where':{'id':_0x2ec85c},'attributes':['id'],'include':[{'model':db[_0x3b86('0x60')],'as':'Agents','attributes':['id',_0x3b86('0x27'),'online','voicePause',_0x3b86('0x61')],'raw':!![]}]})[_0x3b86('0x25')](function(_0x12633a){if(_0x12633a){var _0x28ed2e=_['flatMap'](_0x12633a,function(_0x2948ac){var _0xdd40af=_0x2948ac[_0x3b86('0x23')]({'plain':!![]});return _0xdd40af['Agents'];});return db[_0x3b86('0x2a')][_0x3b86('0x44')]({'where':{'id':_0x3484f9[_0x3b86('0x42')]['id']}})[_0x3b86('0x25')](function(_0x482c1a){return db[_0x3b86('0x62')][_0x3b86('0x63')](function(_0x4a93f7){return _0x482c1a[_0x3b86('0x5e')](_0x2ec85c,{'transaction':_0x4a93f7})['then'](function(){return BPromise[_0x3b86('0x64')](_0x28ed2e,function(_0x5a0d53){return db[_0x3b86('0x53')][_0x3b86('0x65')]({'where':{'UserId':_0x5a0d53['id'],'FaxQueueId':_0x3484f9[_0x3b86('0x42')]['id']},'transaction':_0x4a93f7});});})['then'](function(){_0x28ed2e['forEach'](function(_0x191675){socket[_0x3b86('0x66')](_0x3b86('0x67'),{'UserId':_0x191675['id'],'FaxQueueId':_0x482c1a['id']});});});});});}})[_0x3b86('0x25')](respondWithStatusCode(_0xd97501,null))[_0x3b86('0x41')](handleError(_0xd97501,null));};exports[_0x3b86('0x68')]=function(_0x4a5050,_0x1c1fc9,_0x1f2ca8){return db['Team'][_0x3b86('0x3f')]({'where':{'id':_0x4a5050[_0x3b86('0x2e')][_0x3b86('0x69')]},'attributes':['id'],'include':[{'model':db[_0x3b86('0x60')],'as':_0x3b86('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x3b86('0x25')](handleEntityNotFound(_0x1c1fc9,null))[_0x3b86('0x25')](function(_0x6ac1a2){var _0x5aaa24=_[_0x3b86('0x29')](_0x6ac1a2,'id');var _0x228152=[];var _0x2bc77d=[];var _0x3c8f19=squel[_0x3b86('0x6b')]();_0x3c8f19[_0x3b86('0x6c')]('tq.TeamId')[_0x3b86('0x6d')](_0x3b86('0x6e'),'tq')['join'](_0x3b86('0x6f'),'ut',_0x3b86('0x70'))['where'](_0x3b86('0x71'),_0x4a5050[_0x3b86('0x42')]['id']);for(var _0x35b6c0=0x0;_0x35b6c0<_0x6ac1a2['length'];_0x35b6c0+=0x1){let _0x83a30a=_0x6ac1a2[_0x35b6c0];for(var _0x7d2af6=0x0;_0x7d2af6<_0x83a30a[_0x3b86('0x6a')]['length'];_0x7d2af6+=0x1){let _0x24018a=_0x83a30a['Agents'][_0x7d2af6];var _0x4a7968=_0x3c8f19['clone']();_0x4a7968['where']('ut.UserId\x20=\x20?',_0x24018a['id']);_0x2bc77d[_0x3b86('0x72')](db[_0x3b86('0x62')][_0x3b86('0x2e')](_0x4a7968[_0x3b86('0x73')](),{'type':db[_0x3b86('0x62')][_0x3b86('0x74')]['SELECT']})[_0x3b86('0x25')](function(_0x296747){if(_0x296747[_0x3b86('0x34')]===0x1){return _0x24018a['id'];}else{var _0x26d4b9=_[_0x3b86('0x75')](_[_0x3b86('0x29')](_0x296747,'TeamId'),function(_0x48fd34){return _[_0x3b86('0x76')](_0x5aaa24,_0x48fd34);});if(_0x26d4b9){return _0x24018a['id'];}}}));}}return BPromise['all'](_0x2bc77d)[_0x3b86('0x25')](function(_0x24d789){_0x228152=_(_0x228152)[_0x3b86('0x77')](_0x24d789)[_0x3b86('0x78')]()['value']();return db[_0x3b86('0x2a')]['find']({'where':{'id':_0x4a5050[_0x3b86('0x42')]['id']}})['then'](function(_0x39021a){return db['sequelize'][_0x3b86('0x63')](function(_0x389377){return _0x39021a['removeTeams'](_0x4a5050[_0x3b86('0x2e')][_0x3b86('0x69')],{'transaction':_0x389377})[_0x3b86('0x25')](function(){if(!_[_0x3b86('0x79')](_0x228152)){return _0x39021a[_0x3b86('0x7a')](_0x228152,{'transaction':_0x389377});}})[_0x3b86('0x25')](function(){_0x228152['forEach'](function(_0x54be0b){socket['emit']('userFaxQueue:remove',{'UserId':_0x54be0b,'FaxQueueId':_0x39021a['id']});});});});});});})[_0x3b86('0x25')](respondWithStatusCode(_0x1c1fc9,null))[_0x3b86('0x41')](handleError(_0x1c1fc9,null));};exports[_0x3b86('0x7b')]=function(_0x3161a2,_0x2fee36,_0x2e99fe){return db[_0x3b86('0x2a')][_0x3b86('0x44')]({'where':{'id':_0x3161a2[_0x3b86('0x42')]['id']}})[_0x3b86('0x25')](handleEntityNotFound(_0x2fee36,null))[_0x3b86('0x25')](function(_0x11d2c3){if(_0x11d2c3){return _0x11d2c3[_0x3b86('0x7b')](_0x3161a2['body'][_0x3b86('0x69')],_[_0x3b86('0x7c')](_0x3161a2[_0x3b86('0x46')],[_0x3b86('0x69'),'id'])||{})[_0x3b86('0x7d')](function(_0x222e71){for(var _0x2a9230=0x0;_0x2a9230<_0x3161a2[_0x3b86('0x46')][_0x3b86('0x69')][_0x3b86('0x34')];_0x2a9230+=0x1){socket[_0x3b86('0x66')](_0x3b86('0x67'),{'UserId':Number(_0x3161a2['body']['ids'][_0x2a9230]),'FaxQueueId':Number(_0x3161a2[_0x3b86('0x42')]['id'])});}return _0x222e71;});}})['then'](respondWithResult(_0x2fee36,null))[_0x3b86('0x41')](handleError(_0x2fee36,null));};exports['removeAgents']=function(_0x48a88c,_0x2c06d0,_0x1d1fa3){return db[_0x3b86('0x2a')][_0x3b86('0x44')]({'where':{'id':_0x48a88c['params']['id']}})['then'](handleEntityNotFound(_0x2c06d0,null))[_0x3b86('0x25')](function(_0x1f16e1){if(_0x1f16e1){return _0x1f16e1[_0x3b86('0x7a')](_0x48a88c[_0x3b86('0x2e')][_0x3b86('0x69')])['then'](function(){if(_[_0x3b86('0x7e')](_0x48a88c[_0x3b86('0x2e')][_0x3b86('0x69')])){for(var _0x22d140=0x0;_0x22d140<_0x48a88c[_0x3b86('0x2e')][_0x3b86('0x69')]['length'];_0x22d140+=0x1){socket[_0x3b86('0x66')](_0x3b86('0x7f'),{'UserId':Number(_0x48a88c['query']['ids'][_0x22d140]),'FaxQueueId':Number(_0x48a88c[_0x3b86('0x42')]['id'])});}}else{socket['emit'](_0x3b86('0x7f'),{'UserId':Number(_0x48a88c['query'][_0x3b86('0x69')]),'FaxQueueId':Number(_0x48a88c[_0x3b86('0x42')]['id'])});}});}})[_0x3b86('0x25')](respondWithStatusCode(_0x2c06d0,null))[_0x3b86('0x41')](handleError(_0x2c06d0,null));};exports[_0x3b86('0x80')]=function(_0x374289,_0x328eba,_0x242d0d){var _0x2f5bc4={};var _0x5aa118={};var _0x5a01a2;var _0x5bdb6c;return db[_0x3b86('0x2a')]['findOne']({'where':{'id':_0x374289[_0x3b86('0x42')]['id']}})['then'](handleEntityNotFound(_0x328eba,null))[_0x3b86('0x25')](function(_0x2740ad){if(_0x2740ad){_0x5a01a2=_0x2740ad;_0x5aa118[_0x3b86('0x2d')]=_['keys'](db['User'][_0x3b86('0x2b')]);_0x5aa118[_0x3b86('0x2e')]=_[_0x3b86('0x2f')](_0x374289['query']);_0x5aa118['filters']=_[_0x3b86('0x31')](_0x5aa118[_0x3b86('0x2d')],_0x5aa118[_0x3b86('0x2e')]);_0x2f5bc4[_0x3b86('0x33')]=_[_0x3b86('0x31')](_0x5aa118[_0x3b86('0x2d')],qs[_0x3b86('0x32')](_0x374289['query'][_0x3b86('0x32')]));_0x2f5bc4['attributes']=_0x2f5bc4['attributes'][_0x3b86('0x34')]?_0x2f5bc4[_0x3b86('0x33')]:_0x5aa118[_0x3b86('0x2d')];_0x2f5bc4[_0x3b86('0x36')]=qs[_0x3b86('0x37')](_0x374289['query'][_0x3b86('0x37')]);_0x2f5bc4[_0x3b86('0x38')]=qs[_0x3b86('0x30')](_[_0x3b86('0x39')](_0x374289[_0x3b86('0x2e')],_0x5aa118[_0x3b86('0x30')]));if(_0x374289['query']['filter']){_0x2f5bc4[_0x3b86('0x38')]=_['merge'](_0x2f5bc4[_0x3b86('0x38')],{'$or':_[_0x3b86('0x29')](_0x2f5bc4[_0x3b86('0x33')],function(_0x3e7dd2){var _0xde3171={};_0xde3171[_0x3e7dd2]={'$like':'%'+_0x374289[_0x3b86('0x2e')][_0x3b86('0x3a')]+'%'};return _0xde3171;})});}_0x2f5bc4=_[_0x3b86('0x43')]({},_0x2f5bc4,_0x374289['options']);return _0x5a01a2[_0x3b86('0x80')](_0x2f5bc4);}})[_0x3b86('0x25')](function(_0x187de6){if(_0x187de6){_0x5bdb6c=_0x187de6[_0x3b86('0x34')];if(!_0x374289['query'][_0x3b86('0x35')](_0x3b86('0x52'))){_0x2f5bc4[_0x3b86('0x1d')]=qs[_0x3b86('0x1d')](_0x374289['query'][_0x3b86('0x1d')]);_0x2f5bc4['offset']=qs[_0x3b86('0x1a')](_0x374289[_0x3b86('0x2e')][_0x3b86('0x1a')]);}return _0x5a01a2[_0x3b86('0x80')](_0x2f5bc4);}})['then'](function(_0x5155f4){if(_0x5155f4){return _0x5155f4?{'count':_0x5bdb6c,'rows':_0x5155f4}:null;}})[_0x3b86('0x25')](respondWithResult(_0x328eba,null))[_0x3b86('0x41')](handleError(_0x328eba,null));}; \ No newline at end of file +var _0xf1b7=['fields','length','hasOwnProperty','nolimit','where','filters','merge','VIRTUAL','filter','includeAll','FaxQueue','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserFaxQueue','order','sort','pick','FaxQueueId','findAll','User','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','createdAt','getTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','Team','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xf1b7,0x168));var _0x7f1b=function(_0x538ed3,_0x458b45){_0x538ed3=_0x538ed3-0x0;var _0xc74828=_0xf1b7[_0x538ed3];return _0xc74828;};'use strict';var emlformat=require(_0x7f1b('0x0'));var rimraf=require(_0x7f1b('0x1'));var zipdir=require(_0x7f1b('0x2'));var jsonpatch=require(_0x7f1b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7f1b('0x4'));var Mustache=require(_0x7f1b('0x5'));var util=require(_0x7f1b('0x6'));var path=require(_0x7f1b('0x7'));var sox=require(_0x7f1b('0x8'));var csv=require(_0x7f1b('0x9'));var ejs=require(_0x7f1b('0xa'));var fs=require('fs');var fs_extra=require(_0x7f1b('0xb'));var _=require(_0x7f1b('0xc'));var squel=require(_0x7f1b('0xd'));var crypto=require(_0x7f1b('0xe'));var jsforce=require(_0x7f1b('0xf'));var deskjs=require(_0x7f1b('0x10'));var toCsv=require(_0x7f1b('0x9'));var querystring=require(_0x7f1b('0x11'));var Papa=require(_0x7f1b('0x12'));var Redis=require(_0x7f1b('0x13'));var authService=require(_0x7f1b('0x14'));var qs=require(_0x7f1b('0x15'));var as=require(_0x7f1b('0x16'));var hardwareService=require(_0x7f1b('0x17'));var logger=require(_0x7f1b('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x7f1b('0x19'));var licenseUtil=require(_0x7f1b('0x1a'));var db=require('../../mysqldb')['db'];config[_0x7f1b('0x1b')]=_[_0x7f1b('0x1c')](config['redis'],{'host':_0x7f1b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f1b('0x1b')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x3bbc9c,_0x2d7c71){_0x2d7c71=_0x2d7c71||0xcc;return function(_0x170d6b){if(_0x170d6b){return _0x3bbc9c['sendStatus'](_0x2d7c71);}return _0x3bbc9c['status'](_0x2d7c71)[_0x7f1b('0x1e')]();};}function respondWithResult(_0x32fa53,_0x3e6da8){_0x3e6da8=_0x3e6da8||0xc8;return function(_0x450065){if(_0x450065){return _0x32fa53[_0x7f1b('0x1f')](_0x3e6da8)[_0x7f1b('0x20')](_0x450065);}};}function respondWithFilteredResult(_0x194c8b,_0x3fe174){return function(_0x15d290){if(_0x15d290){var _0x3f890a=typeof _0x3fe174[_0x7f1b('0x21')]===_0x7f1b('0x22')&&typeof _0x3fe174[_0x7f1b('0x23')]===_0x7f1b('0x22');var _0x5251f7=_0x15d290[_0x7f1b('0x24')];var _0x508eb1=_0x3f890a?0x0:_0x3fe174['offset'];var _0x53b5d7=_0x3f890a?_0x15d290[_0x7f1b('0x24')]:_0x3fe174[_0x7f1b('0x21')]+_0x3fe174['limit'];var _0x2ac04f;if(_0x53b5d7>=_0x5251f7){_0x53b5d7=_0x5251f7;_0x2ac04f=0xc8;}else{_0x2ac04f=0xce;}_0x194c8b[_0x7f1b('0x1f')](_0x2ac04f);return _0x194c8b[_0x7f1b('0x25')]('Content-Range',_0x508eb1+'-'+_0x53b5d7+'/'+_0x5251f7)[_0x7f1b('0x20')](_0x15d290);}return null;};}function patchUpdates(_0x3ed658){return function(_0x2168e6){try{jsonpatch[_0x7f1b('0x26')](_0x2168e6,_0x3ed658,!![]);}catch(_0x2a1788){return BPromise[_0x7f1b('0x27')](_0x2a1788);}return _0x2168e6[_0x7f1b('0x28')]();};}function saveUpdates(_0x2b6406,_0x2cedf0){return function(_0x12368c){if(_0x12368c){return _0x12368c[_0x7f1b('0x29')](_0x2b6406)['then'](function(_0x506ea9){return _0x506ea9;});}return null;};}function removeEntity(_0x436cc4,_0x4d96fb){return function(_0x12bf2e){if(_0x12bf2e){return _0x12bf2e[_0x7f1b('0x2a')]()[_0x7f1b('0x2b')](function(){var _0x305e69=_0x12bf2e[_0x7f1b('0x2c')]({'plain':!![]});var _0x4fabc1=_0x7f1b('0x2d');return db[_0x7f1b('0x2e')][_0x7f1b('0x2a')]({'where':{'type':_0x4fabc1,'resourceId':_0x305e69['id']}})[_0x7f1b('0x2b')](function(){return _0x12bf2e;});})[_0x7f1b('0x2b')](function(){_0x436cc4[_0x7f1b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218600,_0xc15d1b){return function(_0x2a48bd){if(!_0x2a48bd){_0x218600[_0x7f1b('0x2f')](0x194);}return _0x2a48bd;};}function handleError(_0x1f7b5f,_0x195d52){_0x195d52=_0x195d52||0x1f4;return function(_0x25dc96){logger[_0x7f1b('0x30')](_0x25dc96[_0x7f1b('0x31')]);if(_0x25dc96[_0x7f1b('0x32')]){delete _0x25dc96[_0x7f1b('0x32')];}_0x1f7b5f[_0x7f1b('0x1f')](_0x195d52)[_0x7f1b('0x33')](_0x25dc96);};}exports[_0x7f1b('0x34')]=function(_0x26b581,_0x1bcd2c){var _0x2fb7bc={},_0x31c309={},_0x48dc6b={'count':0x0,'rows':[]};var _0x4f4754=_[_0x7f1b('0x35')](db['FaxQueue'][_0x7f1b('0x36')],function(_0x513140){return{'name':_0x513140[_0x7f1b('0x37')],'type':_0x513140[_0x7f1b('0x38')][_0x7f1b('0x39')]};});_0x31c309[_0x7f1b('0x3a')]=_[_0x7f1b('0x35')](_0x4f4754,_0x7f1b('0x32'));_0x31c309['query']=_[_0x7f1b('0x3b')](_0x26b581[_0x7f1b('0x3c')]);_0x31c309['filters']=_[_0x7f1b('0x3d')](_0x31c309[_0x7f1b('0x3a')],_0x31c309[_0x7f1b('0x3c')]);_0x2fb7bc[_0x7f1b('0x3e')]=_[_0x7f1b('0x3d')](_0x31c309[_0x7f1b('0x3a')],qs[_0x7f1b('0x3f')](_0x26b581[_0x7f1b('0x3c')][_0x7f1b('0x3f')]));_0x2fb7bc[_0x7f1b('0x3e')]=_0x2fb7bc[_0x7f1b('0x3e')][_0x7f1b('0x40')]?_0x2fb7bc[_0x7f1b('0x3e')]:_0x31c309[_0x7f1b('0x3a')];if(!_0x26b581['query'][_0x7f1b('0x41')](_0x7f1b('0x42'))){_0x2fb7bc['limit']=qs[_0x7f1b('0x23')](_0x26b581['query'][_0x7f1b('0x23')]);_0x2fb7bc[_0x7f1b('0x21')]=qs[_0x7f1b('0x21')](_0x26b581[_0x7f1b('0x3c')][_0x7f1b('0x21')]);}_0x2fb7bc['order']=qs['sort'](_0x26b581[_0x7f1b('0x3c')]['sort']);_0x2fb7bc[_0x7f1b('0x43')]=qs[_0x7f1b('0x44')](_['pick'](_0x26b581['query'],_0x31c309[_0x7f1b('0x44')]),_0x4f4754);if(_0x26b581['query']['filter']){_0x2fb7bc[_0x7f1b('0x43')]=_[_0x7f1b('0x45')](_0x2fb7bc[_0x7f1b('0x43')],{'$or':_[_0x7f1b('0x35')](_0x4f4754,function(_0x318a7d){if(_0x318a7d[_0x7f1b('0x38')]!==_0x7f1b('0x46')){var _0x161fab={};_0x161fab[_0x318a7d[_0x7f1b('0x32')]]={'$like':'%'+_0x26b581['query'][_0x7f1b('0x47')]+'%'};return _0x161fab;}})});}_0x2fb7bc=_[_0x7f1b('0x45')]({},_0x2fb7bc,_0x26b581['options']);var _0x5a15db={'where':_0x2fb7bc[_0x7f1b('0x43')]};return db['FaxQueue'][_0x7f1b('0x24')](_0x5a15db)[_0x7f1b('0x2b')](function(_0x38c549){_0x48dc6b['count']=_0x38c549;if(_0x26b581[_0x7f1b('0x3c')][_0x7f1b('0x48')]){_0x2fb7bc['include']=[{'all':!![]}];}return db[_0x7f1b('0x49')]['findAll'](_0x2fb7bc);})['then'](function(_0x5a7d4e){_0x48dc6b[_0x7f1b('0x4a')]=_0x5a7d4e;return _0x48dc6b;})[_0x7f1b('0x2b')](respondWithFilteredResult(_0x1bcd2c,_0x2fb7bc))[_0x7f1b('0x4b')](handleError(_0x1bcd2c,null));};exports[_0x7f1b('0x4c')]=function(_0x33a12f,_0x2573d2){var _0xb21708={'raw':!![],'where':{'id':_0x33a12f[_0x7f1b('0x4d')]['id']}},_0x456cfe={};_0x456cfe[_0x7f1b('0x3a')]=_['keys'](db[_0x7f1b('0x49')][_0x7f1b('0x36')]);_0x456cfe[_0x7f1b('0x3c')]=_[_0x7f1b('0x3b')](_0x33a12f['query']);_0x456cfe[_0x7f1b('0x44')]=_[_0x7f1b('0x3d')](_0x456cfe[_0x7f1b('0x3a')],_0x456cfe[_0x7f1b('0x3c')]);_0xb21708[_0x7f1b('0x3e')]=_[_0x7f1b('0x3d')](_0x456cfe[_0x7f1b('0x3a')],qs[_0x7f1b('0x3f')](_0x33a12f[_0x7f1b('0x3c')][_0x7f1b('0x3f')]));_0xb21708[_0x7f1b('0x3e')]=_0xb21708[_0x7f1b('0x3e')][_0x7f1b('0x40')]?_0xb21708[_0x7f1b('0x3e')]:_0x456cfe['model'];if(_0x33a12f['query']['includeAll']){_0xb21708[_0x7f1b('0x4e')]=[{'all':!![]}];}_0xb21708=_[_0x7f1b('0x45')]({},_0xb21708,_0x33a12f[_0x7f1b('0x4f')]);return db[_0x7f1b('0x49')][_0x7f1b('0x50')](_0xb21708)[_0x7f1b('0x2b')](handleEntityNotFound(_0x2573d2,null))['then'](respondWithResult(_0x2573d2,null))[_0x7f1b('0x4b')](handleError(_0x2573d2,null));};exports['create']=function(_0x44cfef,_0x39c795){return db[_0x7f1b('0x49')][_0x7f1b('0x51')](_0x44cfef[_0x7f1b('0x52')],{})[_0x7f1b('0x2b')](function(_0x4d078c){var _0xf43428=_0x44cfef[_0x7f1b('0x53')][_0x7f1b('0x2c')]({'plain':!![]});if(!_0xf43428)throw new Error(_0x7f1b('0x54'));if(_0xf43428['role']===_0x7f1b('0x53')){var _0x5cc729=_0x4d078c['get']({'plain':!![]});var _0x58569b=_0x7f1b('0x2d');return db['UserProfileSection'][_0x7f1b('0x50')]({'where':{'name':_0x58569b,'userProfileId':_0xf43428[_0x7f1b('0x55')]},'raw':!![]})['then'](function(_0x1ad492){if(_0x1ad492&&_0x1ad492[_0x7f1b('0x56')]===0x0){return db[_0x7f1b('0x2e')][_0x7f1b('0x51')]({'name':_0x5cc729['name'],'resourceId':_0x5cc729['id'],'type':_0x1ad492[_0x7f1b('0x32')],'sectionId':_0x1ad492['id']},{})['then'](function(){return _0x4d078c;});}else{return _0x4d078c;}})[_0x7f1b('0x4b')](function(_0x2265c9){logger[_0x7f1b('0x30')](_0x7f1b('0x57'),_0x2265c9);throw _0x2265c9;});}return _0x4d078c;})['then'](respondWithResult(_0x39c795,0xc9))[_0x7f1b('0x4b')](handleError(_0x39c795,null));};exports[_0x7f1b('0x29')]=function(_0xe6c338,_0x26a58f){if(_0xe6c338[_0x7f1b('0x52')]['id']){delete _0xe6c338['body']['id'];}return db['FaxQueue'][_0x7f1b('0x50')]({'where':{'id':_0xe6c338[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x26a58f,null))[_0x7f1b('0x2b')](saveUpdates(_0xe6c338[_0x7f1b('0x52')],null))['then'](respondWithResult(_0x26a58f,null))[_0x7f1b('0x4b')](handleError(_0x26a58f,null));};exports[_0x7f1b('0x2a')]=function(_0x33bf1b,_0x512bf5){return db[_0x7f1b('0x49')][_0x7f1b('0x50')]({'where':{'id':_0x33bf1b[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x512bf5,null))['then'](removeEntity(_0x512bf5,null))['catch'](handleError(_0x512bf5,null));};exports['describe']=function(_0x3e3eb3,_0x20e718){return db['FaxQueue']['describe']()[_0x7f1b('0x2b')](respondWithResult(_0x20e718,null))['catch'](handleError(_0x20e718,null));};exports[_0x7f1b('0x58')]=function(_0x12fe84,_0x3fb839,_0x215da7){var _0x107fab={'raw':!![],'where':{}},_0x328ed9={},_0x45e645;return db[_0x7f1b('0x49')][_0x7f1b('0x59')]({'where':{'id':_0x12fe84[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x3fb839,null))[_0x7f1b('0x2b')](function(_0x3b32f7){if(_0x3b32f7){_0x45e645=_0x3b32f7[_0x7f1b('0x2c')]({'plain':!![]});_0x328ed9[_0x7f1b('0x3a')]=_[_0x7f1b('0x3b')](db[_0x7f1b('0x5a')]['rawAttributes']);_0x328ed9['query']=_[_0x7f1b('0x3b')](_0x12fe84[_0x7f1b('0x3c')]);_0x328ed9['filters']=_['intersection'](_0x328ed9[_0x7f1b('0x3a')],_0x328ed9[_0x7f1b('0x3c')]);_0x107fab[_0x7f1b('0x3e')]=_[_0x7f1b('0x3d')](_0x328ed9[_0x7f1b('0x3a')],qs[_0x7f1b('0x3f')](_0x12fe84[_0x7f1b('0x3c')][_0x7f1b('0x3f')]));_0x107fab[_0x7f1b('0x3e')]=_0x107fab[_0x7f1b('0x3e')][_0x7f1b('0x40')]?_0x107fab['attributes']:_0x328ed9[_0x7f1b('0x3a')];if(!_0x12fe84[_0x7f1b('0x3c')][_0x7f1b('0x41')]('nolimit')){_0x107fab['limit']=qs[_0x7f1b('0x23')](_0x12fe84[_0x7f1b('0x3c')]['limit']);_0x107fab['offset']=qs[_0x7f1b('0x21')](_0x12fe84['query'][_0x7f1b('0x21')]);}_0x107fab[_0x7f1b('0x5b')]=qs[_0x7f1b('0x5c')](_0x12fe84[_0x7f1b('0x3c')][_0x7f1b('0x5c')]);_0x107fab[_0x7f1b('0x43')]=qs[_0x7f1b('0x44')](_[_0x7f1b('0x5d')](_0x12fe84[_0x7f1b('0x3c')],_0x328ed9[_0x7f1b('0x44')]));_0x107fab[_0x7f1b('0x43')][_0x7f1b('0x5e')]=_0x3b32f7['id'];if(_0x12fe84[_0x7f1b('0x3c')][_0x7f1b('0x47')]){_0x107fab['where']=_[_0x7f1b('0x45')](_0x107fab[_0x7f1b('0x43')],{'$or':_[_0x7f1b('0x35')](_0x107fab[_0x7f1b('0x3e')],function(_0x373df3){var _0x168673={};_0x168673[_0x373df3]={'$like':'%'+_0x12fe84[_0x7f1b('0x3c')][_0x7f1b('0x47')]+'%'};return _0x168673;})});}_0x107fab=_[_0x7f1b('0x45')]({},_0x107fab,_0x12fe84[_0x7f1b('0x4f')]);return db[_0x7f1b('0x5a')][_0x7f1b('0x5f')](_0x107fab);}})[_0x7f1b('0x2b')](function(_0x11a8ca){if(_0x11a8ca){return db[_0x7f1b('0x60')][_0x7f1b('0x61')]({'where':{'id':_[_0x7f1b('0x35')](_0x11a8ca,'UserId'),'role':_0x7f1b('0x62')},'attributes':['id','name',_0x7f1b('0x63'),_0x7f1b('0x64'),'createdAt']});}})[_0x7f1b('0x2b')](function(_0x352ff5){if(_0x352ff5){return{'count':_0x352ff5[_0x7f1b('0x24')],'rows':_[_0x7f1b('0x35')](_0x352ff5[_0x7f1b('0x4a')],function(_0xe1c03a){return{'membername':_0xe1c03a[_0x7f1b('0x32')],'UserId':_0xe1c03a['id'],'queue_name':_0x45e645['name'],'FaxQueueId':_0x45e645['id'],'interface':util[_0x7f1b('0x65')](_0x7f1b('0x66'),'SIP',_0xe1c03a[_0x7f1b('0x32')]),'penalty':0x0,'paused':_0xe1c03a[_0x7f1b('0x63')],'createdAt':_0xe1c03a[_0x7f1b('0x67')],'updatedAt':_0xe1c03a[_0x7f1b('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3fb839,_0x107fab))[_0x7f1b('0x4b')](handleError(_0x3fb839,null));};exports['getTeams']=function(_0x200d2b,_0x429ba7,_0x21164f){var _0xfe87ff={};var _0x30f1dd={};var _0x157f15;var _0x1588ff;return db[_0x7f1b('0x49')][_0x7f1b('0x59')]({'where':{'id':_0x200d2b[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x429ba7,null))[_0x7f1b('0x2b')](function(_0xaeb5a1){if(_0xaeb5a1){_0x157f15=_0xaeb5a1;_0x30f1dd[_0x7f1b('0x3a')]=_[_0x7f1b('0x3b')](db['Team'][_0x7f1b('0x36')]);_0x30f1dd[_0x7f1b('0x3c')]=_['keys'](_0x200d2b['query']);_0x30f1dd[_0x7f1b('0x44')]=_[_0x7f1b('0x3d')](_0x30f1dd[_0x7f1b('0x3a')],_0x30f1dd[_0x7f1b('0x3c')]);_0xfe87ff[_0x7f1b('0x3e')]=_[_0x7f1b('0x3d')](_0x30f1dd['model'],qs[_0x7f1b('0x3f')](_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x3f')]));_0xfe87ff['attributes']=_0xfe87ff[_0x7f1b('0x3e')][_0x7f1b('0x40')]?_0xfe87ff['attributes']:_0x30f1dd['model'];_0xfe87ff['order']=qs[_0x7f1b('0x5c')](_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x5c')]);_0xfe87ff[_0x7f1b('0x43')]=qs[_0x7f1b('0x44')](_[_0x7f1b('0x5d')](_0x200d2b[_0x7f1b('0x3c')],_0x30f1dd['filters']));if(_0x200d2b[_0x7f1b('0x3c')]['filter']){_0xfe87ff[_0x7f1b('0x43')]=_[_0x7f1b('0x45')](_0xfe87ff[_0x7f1b('0x43')],{'$or':_[_0x7f1b('0x35')](_0xfe87ff[_0x7f1b('0x3e')],function(_0x1db13a){var _0x4f1153={};_0x4f1153[_0x1db13a]={'$like':'%'+_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x47')]+'%'};return _0x4f1153;})});}_0xfe87ff=_['merge']({},_0xfe87ff,_0x200d2b[_0x7f1b('0x4f')]);return _0x157f15[_0x7f1b('0x68')](_0xfe87ff);}})['then'](function(_0x1cb53d){if(_0x1cb53d){_0x1588ff=_0x1cb53d['length'];if(!_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x41')](_0x7f1b('0x42'))){_0xfe87ff['limit']=qs[_0x7f1b('0x23')](_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x23')]);_0xfe87ff[_0x7f1b('0x21')]=qs[_0x7f1b('0x21')](_0x200d2b[_0x7f1b('0x3c')][_0x7f1b('0x21')]);}return _0x157f15[_0x7f1b('0x68')](_0xfe87ff);}})[_0x7f1b('0x2b')](function(_0x1cfd8f){if(_0x1cfd8f){return _0x1cfd8f?{'count':_0x1588ff,'rows':_0x1cfd8f}:null;}})['then'](respondWithResult(_0x429ba7,null))['catch'](handleError(_0x429ba7,null));};exports['addTeams']=function(_0x4e3c49,_0x4c6f88,_0x4b05af){var _0x2d12cb=_0x4e3c49['body'][_0x7f1b('0x69')];return db['Team'][_0x7f1b('0x5f')]({'where':{'id':_0x2d12cb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7f1b('0x6a'),'attributes':['id',_0x7f1b('0x32'),_0x7f1b('0x6b'),_0x7f1b('0x6c'),'interface'],'raw':!![]}]})[_0x7f1b('0x2b')](function(_0x1e9f1b){if(_0x1e9f1b){var _0x56449a=_[_0x7f1b('0x6d')](_0x1e9f1b,function(_0x3f448b){var _0x2d4f89=_0x3f448b[_0x7f1b('0x2c')]({'plain':!![]});return _0x2d4f89[_0x7f1b('0x6a')];});return db[_0x7f1b('0x49')][_0x7f1b('0x50')]({'where':{'id':_0x4e3c49[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](function(_0x258fb5){return db[_0x7f1b('0x6e')][_0x7f1b('0x6f')](function(_0x30c50c){return _0x258fb5['addTeams'](_0x2d12cb,{'transaction':_0x30c50c})[_0x7f1b('0x2b')](function(){return BPromise[_0x7f1b('0x70')](_0x56449a,function(_0x4f9736){return db[_0x7f1b('0x5a')][_0x7f1b('0x71')]({'where':{'UserId':_0x4f9736['id'],'FaxQueueId':_0x4e3c49[_0x7f1b('0x4d')]['id']},'transaction':_0x30c50c});});})['then'](function(){_0x56449a['forEach'](function(_0x1a5b47){socket[_0x7f1b('0x72')](_0x7f1b('0x73'),{'UserId':_0x1a5b47['id'],'FaxQueueId':_0x258fb5['id']});});});});});}})[_0x7f1b('0x2b')](respondWithStatusCode(_0x4c6f88,null))[_0x7f1b('0x4b')](handleError(_0x4c6f88,null));};exports[_0x7f1b('0x74')]=function(_0x3c7bee,_0x55ee92,_0x20ab55){return db[_0x7f1b('0x75')][_0x7f1b('0x5f')]({'where':{'id':_0x3c7bee[_0x7f1b('0x3c')][_0x7f1b('0x69')]},'attributes':['id'],'include':[{'model':db[_0x7f1b('0x60')],'as':_0x7f1b('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x55ee92,null))[_0x7f1b('0x2b')](function(_0x30594c){var _0x12a413=_[_0x7f1b('0x35')](_0x30594c,'id');var _0x31e7e6=[];var _0x4c4287=[];var _0x2e4470=squel[_0x7f1b('0x76')]();_0x2e4470[_0x7f1b('0x77')](_0x7f1b('0x78'))['from'](_0x7f1b('0x79'),'tq')[_0x7f1b('0x7a')](_0x7f1b('0x7b'),'ut',_0x7f1b('0x7c'))[_0x7f1b('0x43')](_0x7f1b('0x7d'),_0x3c7bee['params']['id']);for(var _0x1d337e=0x0;_0x1d337e<_0x30594c[_0x7f1b('0x40')];_0x1d337e+=0x1){let _0xb3604c=_0x30594c[_0x1d337e];for(var _0xa601ed=0x0;_0xa601ed<_0xb3604c[_0x7f1b('0x6a')][_0x7f1b('0x40')];_0xa601ed+=0x1){let _0x14e0f=_0xb3604c['Agents'][_0xa601ed];var _0x237729=_0x2e4470['clone']();_0x237729['where'](_0x7f1b('0x7e'),_0x14e0f['id']);_0x4c4287[_0x7f1b('0x7f')](db[_0x7f1b('0x6e')][_0x7f1b('0x3c')](_0x237729[_0x7f1b('0x80')](),{'type':db['sequelize'][_0x7f1b('0x81')][_0x7f1b('0x82')]})[_0x7f1b('0x2b')](function(_0x320722){if(_0x320722[_0x7f1b('0x40')]===0x1){return _0x14e0f['id'];}else{var _0x10bfbb=_['every'](_[_0x7f1b('0x35')](_0x320722,'TeamId'),function(_0x29e0bf){return _[_0x7f1b('0x83')](_0x12a413,_0x29e0bf);});if(_0x10bfbb){return _0x14e0f['id'];}}}));}}return BPromise['all'](_0x4c4287)[_0x7f1b('0x2b')](function(_0x4af7fc){_0x31e7e6=_(_0x31e7e6)['union'](_0x4af7fc)['compact']()['value']();return db['FaxQueue'][_0x7f1b('0x50')]({'where':{'id':_0x3c7bee[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](function(_0x42c888){return db[_0x7f1b('0x6e')][_0x7f1b('0x6f')](function(_0x1343a4){return _0x42c888[_0x7f1b('0x74')](_0x3c7bee[_0x7f1b('0x3c')][_0x7f1b('0x69')],{'transaction':_0x1343a4})[_0x7f1b('0x2b')](function(){if(!_[_0x7f1b('0x84')](_0x31e7e6)){return _0x42c888[_0x7f1b('0x85')](_0x31e7e6,{'transaction':_0x1343a4});}})[_0x7f1b('0x2b')](function(){_0x31e7e6[_0x7f1b('0x86')](function(_0x21510e){socket[_0x7f1b('0x72')](_0x7f1b('0x87'),{'UserId':_0x21510e,'FaxQueueId':_0x42c888['id']});});});});});});})[_0x7f1b('0x2b')](respondWithStatusCode(_0x55ee92,null))[_0x7f1b('0x4b')](handleError(_0x55ee92,null));};exports[_0x7f1b('0x88')]=function(_0x8a97db,_0x10b9fd,_0x56282b){return db[_0x7f1b('0x49')][_0x7f1b('0x50')]({'where':{'id':_0x8a97db[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x10b9fd,null))[_0x7f1b('0x2b')](function(_0xd5da48){if(_0xd5da48){return _0xd5da48['addAgents'](_0x8a97db[_0x7f1b('0x52')][_0x7f1b('0x69')],_[_0x7f1b('0x89')](_0x8a97db['body'],['ids','id'])||{})[_0x7f1b('0x8a')](function(_0x814ce6){for(var _0x37e838=0x0;_0x37e838<_0x8a97db['body'][_0x7f1b('0x69')][_0x7f1b('0x40')];_0x37e838+=0x1){socket[_0x7f1b('0x72')](_0x7f1b('0x73'),{'UserId':Number(_0x8a97db[_0x7f1b('0x52')][_0x7f1b('0x69')][_0x37e838]),'FaxQueueId':Number(_0x8a97db[_0x7f1b('0x4d')]['id'])});}return _0x814ce6;});}})[_0x7f1b('0x2b')](respondWithResult(_0x10b9fd,null))[_0x7f1b('0x4b')](handleError(_0x10b9fd,null));};exports[_0x7f1b('0x85')]=function(_0x5ed12d,_0x25b5b4,_0x441df1){return db[_0x7f1b('0x49')][_0x7f1b('0x50')]({'where':{'id':_0x5ed12d[_0x7f1b('0x4d')]['id']}})[_0x7f1b('0x2b')](handleEntityNotFound(_0x25b5b4,null))[_0x7f1b('0x2b')](function(_0x251f3f){if(_0x251f3f){return _0x251f3f['removeAgents'](_0x5ed12d['query'][_0x7f1b('0x69')])[_0x7f1b('0x2b')](function(){if(_[_0x7f1b('0x8b')](_0x5ed12d[_0x7f1b('0x3c')][_0x7f1b('0x69')])){for(var _0xf77c17=0x0;_0xf77c17<_0x5ed12d[_0x7f1b('0x3c')][_0x7f1b('0x69')][_0x7f1b('0x40')];_0xf77c17+=0x1){socket[_0x7f1b('0x72')](_0x7f1b('0x87'),{'UserId':Number(_0x5ed12d[_0x7f1b('0x3c')]['ids'][_0xf77c17]),'FaxQueueId':Number(_0x5ed12d['params']['id'])});}}else{socket[_0x7f1b('0x72')](_0x7f1b('0x87'),{'UserId':Number(_0x5ed12d['query']['ids']),'FaxQueueId':Number(_0x5ed12d[_0x7f1b('0x4d')]['id'])});}});}})[_0x7f1b('0x2b')](respondWithStatusCode(_0x25b5b4,null))[_0x7f1b('0x4b')](handleError(_0x25b5b4,null));};exports['getAgents']=function(_0x20e1a6,_0x2c17cc,_0x1681fe){var _0x549e00={};var _0x2019c9={};var _0x17ce28;var _0x53f79b;return db[_0x7f1b('0x49')]['findOne']({'where':{'id':_0x20e1a6[_0x7f1b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c17cc,null))['then'](function(_0x5d8317){if(_0x5d8317){_0x17ce28=_0x5d8317;_0x2019c9[_0x7f1b('0x3a')]=_['keys'](db[_0x7f1b('0x60')][_0x7f1b('0x36')]);_0x2019c9['query']=_['keys'](_0x20e1a6[_0x7f1b('0x3c')]);_0x2019c9[_0x7f1b('0x44')]=_[_0x7f1b('0x3d')](_0x2019c9['model'],_0x2019c9['query']);_0x549e00[_0x7f1b('0x3e')]=_[_0x7f1b('0x3d')](_0x2019c9[_0x7f1b('0x3a')],qs[_0x7f1b('0x3f')](_0x20e1a6[_0x7f1b('0x3c')][_0x7f1b('0x3f')]));_0x549e00['attributes']=_0x549e00[_0x7f1b('0x3e')][_0x7f1b('0x40')]?_0x549e00['attributes']:_0x2019c9[_0x7f1b('0x3a')];_0x549e00[_0x7f1b('0x5b')]=qs[_0x7f1b('0x5c')](_0x20e1a6['query'][_0x7f1b('0x5c')]);_0x549e00[_0x7f1b('0x43')]=qs['filters'](_['pick'](_0x20e1a6['query'],_0x2019c9[_0x7f1b('0x44')]));if(_0x20e1a6[_0x7f1b('0x3c')]['filter']){_0x549e00[_0x7f1b('0x43')]=_[_0x7f1b('0x45')](_0x549e00[_0x7f1b('0x43')],{'$or':_['map'](_0x549e00[_0x7f1b('0x3e')],function(_0x17501b){var _0x520f15={};_0x520f15[_0x17501b]={'$like':'%'+_0x20e1a6[_0x7f1b('0x3c')][_0x7f1b('0x47')]+'%'};return _0x520f15;})});}_0x549e00=_['merge']({},_0x549e00,_0x20e1a6[_0x7f1b('0x4f')]);return _0x17ce28[_0x7f1b('0x8c')](_0x549e00);}})['then'](function(_0x1024e9){if(_0x1024e9){_0x53f79b=_0x1024e9[_0x7f1b('0x40')];if(!_0x20e1a6['query'][_0x7f1b('0x41')](_0x7f1b('0x42'))){_0x549e00[_0x7f1b('0x23')]=qs[_0x7f1b('0x23')](_0x20e1a6[_0x7f1b('0x3c')][_0x7f1b('0x23')]);_0x549e00['offset']=qs['offset'](_0x20e1a6[_0x7f1b('0x3c')][_0x7f1b('0x21')]);}return _0x17ce28[_0x7f1b('0x8c')](_0x549e00);}})[_0x7f1b('0x2b')](function(_0x4ff26f){if(_0x4ff26f){return _0x4ff26f?{'count':_0x53f79b,'rows':_0x4ff26f}:null;}})[_0x7f1b('0x2b')](respondWithResult(_0x2c17cc,null))[_0x7f1b('0x4b')](handleError(_0x2c17cc,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8c08fc3..a7b01fc 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 _0x762c=['emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x762c,0xb7));var _0xc762=function(_0x24081f,_0x28a2b4){_0x24081f=_0x24081f-0x0;var _0xb567e4=_0x762c[_0x24081f];return _0xb567e4;};'use strict';var EventEmitter=require(_0xc762('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc762('0x1')](0x0);var events={'afterCreate':_0xc762('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xd14f3d){return function(_0x36d0c0,_0x2f333d,_0x2eaa58){FaxQueueEvents[_0xc762('0x3')](_0xd14f3d+':'+_0x36d0c0['id'],_0x36d0c0);FaxQueueEvents[_0xc762('0x3')](_0xd14f3d,_0x36d0c0);_0x2eaa58(null);};}for(var e in events){if(events[_0xc762('0x4')](e)){var event=events[e];FaxQueue[_0xc762('0x5')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x3feb=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','save'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x3feb,0x193));var _0xb3fe=function(_0x362e39,_0xc0c269){_0x362e39=_0x362e39-0x0;var _0x3526ee=_0x3feb[_0x362e39];return _0x3526ee;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xb3fe('0x0'))['db'][_0xb3fe('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3fe('0x2'),'afterUpdate':_0xb3fe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3098f4){return function(_0x3dd66f,_0x3e2bc5,_0x488c51){FaxQueueEvents['emit'](_0x3098f4+':'+_0x3dd66f['id'],_0x3dd66f);FaxQueueEvents[_0xb3fe('0x4')](_0x3098f4,_0x3dd66f);_0x488c51(null);};}for(var e in events){if(events[_0xb3fe('0x5')](e)){var event=events[e];FaxQueue[_0xb3fe('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 678bee7..6f4da8c 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 _0xf417=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues'];(function(_0xb3999f,_0x7a3a3a){var _0x45fc7e=function(_0x20a863){while(--_0x20a863){_0xb3999f['push'](_0xb3999f['shift']());}};_0x45fc7e(++_0x7a3a3a);}(_0xf417,0x78));var _0x7f41=function(_0x229059,_0x324ab9){_0x229059=_0x229059-0x0;var _0x98067d=_0xf417[_0x229059];return _0x98067d;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var logger=require(_0x7f41('0x1'))(_0x7f41('0x2'));var moment=require(_0x7f41('0x3'));var BPromise=require(_0x7f41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f41('0x5'));var rimraf=require(_0x7f41('0x6'));var config=require(_0x7f41('0x7'));var attributes=require(_0x7f41('0x8'));module['exports']=function(_0x66654e,_0x2e4fc8){return _0x66654e[_0x7f41('0x9')](_0x7f41('0xa'),attributes,{'tableName':_0x7f41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0363=['api','moment','bluebird','path','rimraf','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0x39e740,_0x3a3084){var _0x49d5fc=function(_0x344959){while(--_0x344959){_0x39e740['push'](_0x39e740['shift']());}};_0x49d5fc(++_0x3a3084);}(_0x0363,0x1cb));var _0x3036=function(_0x21a064,_0x6ec93){_0x21a064=_0x21a064-0x0;var _0x14a150=_0x0363[_0x21a064];return _0x14a150;};'use strict';var _=require(_0x3036('0x0'));var util=require(_0x3036('0x1'));var logger=require(_0x3036('0x2'))(_0x3036('0x3'));var moment=require(_0x3036('0x4'));var BPromise=require(_0x3036('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3036('0x6'));var rimraf=require(_0x3036('0x7'));var config=require('../../config/environment');var attributes=require(_0x3036('0x8'));module['exports']=function(_0x2ef8be,_0x3ddbf5){return _0x2ef8be['define'](_0x3036('0x9'),attributes,{'tableName':_0x3036('0xa'),'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 6316df2..45e2f86 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 _0x5370=['FaxQueue','findAll','options','raw','where','attributes','include','model','map','then','ShowFaxQueue','util','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFaxQueue'];(function(_0x6474ce,_0x1af163){var _0x30be84=function(_0xf26348){while(--_0xf26348){_0x6474ce['push'](_0x6474ce['shift']());}};_0x30be84(++_0x1af163);}(_0x5370,0xd1));var _0x0537=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5370[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0537('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0537('0x1'));var fs=require('fs');var Redis=require(_0x0537('0x2'));var db=require(_0x0537('0x3'))['db'];var utils=require(_0x0537('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0537('0x5'));var client=jayson[_0x0537('0x6')]['http']({'port':0x232a});config[_0x0537('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0537('0x8'))(new Redis(config['redis']));require(_0x0537('0x9'))[_0x0537('0xa')](socket);function respondWithRpcPromise(_0x50cb62,_0xb95327,_0x128e11){return new BPromise(function(_0x3dcb81,_0xf2a9b){return client[_0x0537('0xb')](_0x50cb62,_0x128e11)['then'](function(_0x255e44){logger[_0x0537('0xc')](_0x0537('0xd'),_0xb95327,_0x0537('0xe'));logger[_0x0537('0xf')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0xb95327,_0x0537('0xe'),JSON[_0x0537('0x10')](_0x255e44));if(_0x255e44[_0x0537('0x11')]){if(_0x255e44[_0x0537('0x11')][_0x0537('0x12')]===0x1f4){logger[_0x0537('0x11')](_0x0537('0xd'),_0xb95327,_0x255e44[_0x0537('0x11')][_0x0537('0x13')]);return _0xf2a9b(_0x255e44[_0x0537('0x11')][_0x0537('0x13')]);}logger[_0x0537('0x11')](_0x0537('0xd'),_0xb95327,_0x255e44['error'][_0x0537('0x13')]);return _0x3dcb81(_0x255e44[_0x0537('0x11')][_0x0537('0x13')]);}else{logger[_0x0537('0xc')]('FaxQueue,\x20%s,\x20%s',_0xb95327,_0x0537('0xe'));_0x3dcb81(_0x255e44['result']['message']);}})[_0x0537('0x14')](function(_0x2c934b){logger[_0x0537('0x11')](_0x0537('0xd'),_0xb95327,_0x2c934b);_0xf2a9b(_0x2c934b);});});}exports[_0x0537('0x15')]=function(_0x31b414){var _0x1df77b=this;return new Promise(function(_0xfe4dad,_0x3aa916){return db[_0x0537('0x16')][_0x0537('0x17')]({'raw':_0x31b414[_0x0537('0x18')]?_0x31b414[_0x0537('0x18')][_0x0537('0x19')]===undefined?!![]:![]:!![],'where':_0x31b414[_0x0537('0x18')]?_0x31b414['options'][_0x0537('0x1a')]||null:null,'attributes':_0x31b414[_0x0537('0x18')]?_0x31b414['options'][_0x0537('0x1b')]||null:null,'limit':_0x31b414[_0x0537('0x18')]?_0x31b414[_0x0537('0x18')]['limit']||null:null,'include':_0x31b414[_0x0537('0x18')]?_0x31b414['options']['include']?_['map'](_0x31b414[_0x0537('0x18')][_0x0537('0x1c')],function(_0x542acb){return{'model':db[_0x542acb[_0x0537('0x1d')]],'as':_0x542acb['as'],'attributes':_0x542acb[_0x0537('0x1b')],'include':_0x542acb[_0x0537('0x1c')]?_['map'](_0x542acb['include'],function(_0x244c4e){return{'model':db[_0x244c4e['model']],'as':_0x244c4e['as'],'attributes':_0x244c4e['attributes'],'include':_0x244c4e[_0x0537('0x1c')]?_[_0x0537('0x1e')](_0x244c4e[_0x0537('0x1c')],function(_0x5ef791){return{'model':db[_0x5ef791['model']],'as':_0x5ef791['as'],'attributes':_0x5ef791[_0x0537('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0537('0x1f')](function(_0x19a7ce){logger['info']('GetFaxQueue',_0x31b414);logger['debug'](_0x0537('0x15'),_0x31b414,JSON['stringify'](_0x19a7ce));_0xfe4dad(_0x19a7ce);})[_0x0537('0x14')](function(_0x408a63){logger[_0x0537('0x11')]('GetFaxQueue',_0x408a63[_0x0537('0x13')],_0x31b414);_0x3aa916(_0x1df77b[_0x0537('0x11')](0x1f4,_0x408a63['message']));});});};exports[_0x0537('0x20')]=function(_0xfef84a){var _0x241816=this;return new Promise(function(_0x5742f8,_0x1ebeb8){return db[_0x0537('0x16')]['find']({'raw':_0xfef84a[_0x0537('0x18')]?_0xfef84a[_0x0537('0x18')][_0x0537('0x19')]===undefined?!![]:![]:!![],'where':_0xfef84a[_0x0537('0x18')]?_0xfef84a[_0x0537('0x18')][_0x0537('0x1a')]||null:null,'attributes':_0xfef84a[_0x0537('0x18')]?_0xfef84a[_0x0537('0x18')]['attributes']||null:null,'include':_0xfef84a[_0x0537('0x18')]?_0xfef84a[_0x0537('0x18')]['include']?_[_0x0537('0x1e')](_0xfef84a[_0x0537('0x18')][_0x0537('0x1c')],function(_0x372f48){return{'model':db[_0x372f48[_0x0537('0x1d')]],'as':_0x372f48['as'],'attributes':_0x372f48['attributes'],'include':_0x372f48[_0x0537('0x1c')]?_[_0x0537('0x1e')](_0x372f48[_0x0537('0x1c')],function(_0x2593bb){return{'model':db[_0x2593bb[_0x0537('0x1d')]],'as':_0x2593bb['as'],'attributes':_0x2593bb[_0x0537('0x1b')],'include':_0x2593bb[_0x0537('0x1c')]?_['map'](_0x2593bb[_0x0537('0x1c')],function(_0x1bdbd3){return{'model':db[_0x1bdbd3['model']],'as':_0x1bdbd3['as'],'attributes':_0x1bdbd3[_0x0537('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0537('0x1f')](function(_0xd5957c){logger[_0x0537('0xc')]('ShowFaxQueue',_0xfef84a);logger[_0x0537('0xf')](_0x0537('0x20'),_0xfef84a,JSON[_0x0537('0x10')](_0xd5957c));_0x5742f8(_0xd5957c);})[_0x0537('0x14')](function(_0x172e5f){logger[_0x0537('0x11')](_0x0537('0x20'),_0x172e5f[_0x0537('0x13')],_0xfef84a);_0x1ebeb8(_0x241816[_0x0537('0x11')](0x1f4,_0x172e5f[_0x0537('0x13')]));});});}; \ No newline at end of file +var _0xe133=['model','GetFaxQueue','catch','ShowFaxQueue','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxQueue','findAll','options','where','attributes','limit','include','map'];(function(_0x251f7d,_0x50ac61){var _0x57160d=function(_0x33f3e3){while(--_0x33f3e3){_0x251f7d['push'](_0x251f7d['shift']());}};_0x57160d(++_0x50ac61);}(_0xe133,0x83));var _0x3e13=function(_0x2eaca2,_0x465bcf){_0x2eaca2=_0x2eaca2-0x0;var _0x47fd26=_0xe133[_0x2eaca2];return _0x47fd26;};'use strict';var _=require(_0x3e13('0x0'));var util=require(_0x3e13('0x1'));var moment=require('moment');var BPromise=require(_0x3e13('0x2'));var rs=require(_0x3e13('0x3'));var fs=require('fs');var Redis=require(_0x3e13('0x4'));var db=require(_0x3e13('0x5'))['db'];var utils=require(_0x3e13('0x6'));var logger=require(_0x3e13('0x7'))(_0x3e13('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e13('0x9'));var client=jayson['client'][_0x3e13('0xa')]({'port':0x232a});config['redis']=_[_0x3e13('0xb')](config[_0x3e13('0xc')],{'host':_0x3e13('0xd'),'port':0x18eb});var socket=require(_0x3e13('0xe'))(new Redis(config['redis']));require(_0x3e13('0xf'))[_0x3e13('0x10')](socket);function respondWithRpcPromise(_0x1bdad0,_0x3a5576,_0x104382){return new BPromise(function(_0x1680f3,_0x4bc2e4){return client[_0x3e13('0x11')](_0x1bdad0,_0x104382)[_0x3e13('0x12')](function(_0x2a8f0b){logger['info'](_0x3e13('0x13'),_0x3a5576,_0x3e13('0x14'));logger[_0x3e13('0x15')](_0x3e13('0x16'),_0x3a5576,_0x3e13('0x14'),JSON[_0x3e13('0x17')](_0x2a8f0b));if(_0x2a8f0b[_0x3e13('0x18')]){if(_0x2a8f0b[_0x3e13('0x18')][_0x3e13('0x19')]===0x1f4){logger[_0x3e13('0x18')]('FaxQueue,\x20%s,\x20%s',_0x3a5576,_0x2a8f0b['error'][_0x3e13('0x1a')]);return _0x4bc2e4(_0x2a8f0b[_0x3e13('0x18')][_0x3e13('0x1a')]);}logger['error'](_0x3e13('0x13'),_0x3a5576,_0x2a8f0b[_0x3e13('0x18')][_0x3e13('0x1a')]);return _0x1680f3(_0x2a8f0b[_0x3e13('0x18')][_0x3e13('0x1a')]);}else{logger[_0x3e13('0x1b')]('FaxQueue,\x20%s,\x20%s',_0x3a5576,'request\x20sent');_0x1680f3(_0x2a8f0b[_0x3e13('0x1c')]['message']);}})['catch'](function(_0x273e8d){logger[_0x3e13('0x18')](_0x3e13('0x13'),_0x3a5576,_0x273e8d);_0x4bc2e4(_0x273e8d);});});}exports['GetFaxQueue']=function(_0x42aadb){var _0x12cc71=this;return new Promise(function(_0x176233,_0x2f0004){return db[_0x3e13('0x1d')][_0x3e13('0x1e')]({'raw':_0x42aadb[_0x3e13('0x1f')]?_0x42aadb['options']['raw']===undefined?!![]:![]:!![],'where':_0x42aadb[_0x3e13('0x1f')]?_0x42aadb['options'][_0x3e13('0x20')]||null:null,'attributes':_0x42aadb[_0x3e13('0x1f')]?_0x42aadb[_0x3e13('0x1f')][_0x3e13('0x21')]||null:null,'limit':_0x42aadb['options']?_0x42aadb[_0x3e13('0x1f')][_0x3e13('0x22')]||null:null,'include':_0x42aadb[_0x3e13('0x1f')]?_0x42aadb['options'][_0x3e13('0x23')]?_[_0x3e13('0x24')](_0x42aadb[_0x3e13('0x1f')][_0x3e13('0x23')],function(_0x2ccf73){return{'model':db[_0x2ccf73['model']],'as':_0x2ccf73['as'],'attributes':_0x2ccf73[_0x3e13('0x21')],'include':_0x2ccf73[_0x3e13('0x23')]?_['map'](_0x2ccf73[_0x3e13('0x23')],function(_0x1719c2){return{'model':db[_0x1719c2[_0x3e13('0x25')]],'as':_0x1719c2['as'],'attributes':_0x1719c2[_0x3e13('0x21')],'include':_0x1719c2[_0x3e13('0x23')]?_['map'](_0x1719c2[_0x3e13('0x23')],function(_0x49ea49){return{'model':db[_0x49ea49[_0x3e13('0x25')]],'as':_0x49ea49['as'],'attributes':_0x49ea49[_0x3e13('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e13('0x12')](function(_0x3fccaf){logger[_0x3e13('0x1b')](_0x3e13('0x26'),_0x42aadb);logger[_0x3e13('0x15')](_0x3e13('0x26'),_0x42aadb,JSON[_0x3e13('0x17')](_0x3fccaf));_0x176233(_0x3fccaf);})[_0x3e13('0x27')](function(_0x154a20){logger[_0x3e13('0x18')]('GetFaxQueue',_0x154a20['message'],_0x42aadb);_0x2f0004(_0x12cc71[_0x3e13('0x18')](0x1f4,_0x154a20['message']));});});};exports[_0x3e13('0x28')]=function(_0x170b57){var _0x22346d=this;return new Promise(function(_0x4182b7,_0x469858){return db[_0x3e13('0x1d')]['find']({'raw':_0x170b57[_0x3e13('0x1f')]?_0x170b57[_0x3e13('0x1f')][_0x3e13('0x29')]===undefined?!![]:![]:!![],'where':_0x170b57[_0x3e13('0x1f')]?_0x170b57[_0x3e13('0x1f')][_0x3e13('0x20')]||null:null,'attributes':_0x170b57[_0x3e13('0x1f')]?_0x170b57[_0x3e13('0x1f')][_0x3e13('0x21')]||null:null,'include':_0x170b57[_0x3e13('0x1f')]?_0x170b57[_0x3e13('0x1f')][_0x3e13('0x23')]?_[_0x3e13('0x24')](_0x170b57['options'][_0x3e13('0x23')],function(_0x28ac58){return{'model':db[_0x28ac58[_0x3e13('0x25')]],'as':_0x28ac58['as'],'attributes':_0x28ac58[_0x3e13('0x21')],'include':_0x28ac58[_0x3e13('0x23')]?_[_0x3e13('0x24')](_0x28ac58['include'],function(_0x323f04){return{'model':db[_0x323f04[_0x3e13('0x25')]],'as':_0x323f04['as'],'attributes':_0x323f04[_0x3e13('0x21')],'include':_0x323f04[_0x3e13('0x23')]?_['map'](_0x323f04[_0x3e13('0x23')],function(_0x99b82){return{'model':db[_0x99b82[_0x3e13('0x25')]],'as':_0x99b82['as'],'attributes':_0x99b82[_0x3e13('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e13('0x12')](function(_0x27c22b){logger[_0x3e13('0x1b')](_0x3e13('0x28'),_0x170b57);logger[_0x3e13('0x15')](_0x3e13('0x28'),_0x170b57,JSON['stringify'](_0x27c22b));_0x4182b7(_0x27c22b);})[_0x3e13('0x27')](function(_0x152755){logger['error'](_0x3e13('0x28'),_0x152755[_0x3e13('0x1a')],_0x170b57);_0x469858(_0x22346d[_0x3e13('0x18')](0x1f4,_0x152755['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 6db2730..3610841 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 _0x0b5b=['update','emit','register','length','faxQueue:','save','remove'];(function(_0x20029d,_0x4890cb){var _0x242b96=function(_0x1cb19b){while(--_0x1cb19b){_0x20029d['push'](_0x20029d['shift']());}};_0x242b96(++_0x4890cb);}(_0x0b5b,0x147));var _0xb0b5=function(_0x35171f,_0x3a35f6){_0x35171f=_0x35171f-0x0;var _0x1af363=_0x0b5b[_0x35171f];return _0x1af363;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xb0b5('0x0'),_0xb0b5('0x1'),_0xb0b5('0x2')];function createListener(_0x393c1a,_0x1571eb){return function(_0x3ecd7c){_0x1571eb[_0xb0b5('0x3')](_0x393c1a,_0x3ecd7c);};}function removeListener(_0x358f31,_0x42ff09){return function(){FaxQueueEvents['removeListener'](_0x358f31,_0x42ff09);};}exports[_0xb0b5('0x4')]=function(_0xbc2de4){for(var _0x2e716d=0x0,_0x2d7f52=events[_0xb0b5('0x5')];_0x2e716d<_0x2d7f52;_0x2e716d++){var _0x55020b=events[_0x2e716d];var _0xba58ce=createListener(_0xb0b5('0x6')+_0x55020b,_0xbc2de4);FaxQueueEvents['on'](_0x55020b,_0xba58ce);}}; \ No newline at end of file +var _0xfead=['./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5420f9,_0x150c87){var _0x2d3acd=function(_0x5ded56){while(--_0x5ded56){_0x5420f9['push'](_0x5420f9['shift']());}};_0x2d3acd(++_0x150c87);}(_0xfead,0x1d8));var _0xdfea=function(_0x292ba0,_0x462451){_0x292ba0=_0x292ba0-0x0;var _0x290352=_0xfead[_0x292ba0];return _0x290352;};'use strict';var FaxQueueEvents=require(_0xdfea('0x0'));var events=[_0xdfea('0x1'),_0xdfea('0x2'),_0xdfea('0x3')];function createListener(_0x403ff1,_0x14fa92){return function(_0x307eac){_0x14fa92[_0xdfea('0x4')](_0x403ff1,_0x307eac);};}function removeListener(_0xb667f1,_0x5318da){return function(){FaxQueueEvents[_0xdfea('0x5')](_0xb667f1,_0x5318da);};}exports[_0xdfea('0x6')]=function(_0x590098){for(var _0x187859=0x0,_0x5a4c7a=events[_0xdfea('0x7')];_0x187859<_0x5a4c7a;_0x187859++){var _0x3235ae=events[_0x187859];var _0x201463=createListener('faxQueue:'+_0x3235ae,_0x590098);FaxQueueEvents['on'](_0x3235ae,_0x201463);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 97f69c8..3df3098 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 _0xdf55=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams'];(function(_0x29edb3,_0x510265){var _0x28ca00=function(_0x1fb6bd){while(--_0x1fb6bd){_0x29edb3['push'](_0x29edb3['shift']());}};_0x28ca00(++_0x510265);}(_0xdf55,0x83));var _0x5df5=function(_0x27a7d3,_0x24ca5b){_0x27a7d3=_0x27a7d3-0x0;var _0x107ab8=_0xdf55[_0x27a7d3];return _0x107ab8;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['get']('/:id/members',auth[_0x5df5('0x9')](),controller['getMembers']);router[_0x5df5('0x8')](_0x5df5('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x5df5('0x8')](_0x5df5('0x10'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x11')]);router[_0x5df5('0x12')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0x13')]);router[_0x5df5('0x12')](_0x5df5('0xf'),auth[_0x5df5('0x9')](),controller['addTeams']);router[_0x5df5('0x12')]('/:id/users',auth[_0x5df5('0x9')](),controller[_0x5df5('0x14')]);router[_0x5df5('0x15')](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0x16')](_0x5df5('0xd'),auth['isAuthenticated'](),controller[_0x5df5('0x17')]);router[_0x5df5('0x16')](_0x5df5('0xf'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x18')]);router['delete']('/:id/users',auth[_0x5df5('0x9')](),controller['removeAgents']);module[_0x5df5('0x19')]=router; \ No newline at end of file +var _0x1a37=['/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x17454e,_0x3b3845){var _0x2441cf=function(_0x4360f1){while(--_0x4360f1){_0x17454e['push'](_0x17454e['shift']());}};_0x2441cf(++_0x3b3845);}(_0x1a37,0xb4));var _0x71a3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x1a37[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./faxQueue.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getTeams']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0x13')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x13')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x15')]);router[_0x71a3('0x13')](_0x71a3('0x16'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x71a3('0x19')]);router[_0x71a3('0x1a')](_0x71a3('0x1b'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1c')]);router[_0x71a3('0x1a')]('/:id/teams',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1d')]);router['delete']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);module[_0x71a3('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 54d6d39..69c31bd 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 _0x9b56=['DATE','sequelize','STRING'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9b56,0xac));var _0x69b5=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x9b56[_0x421196];return _0x2738af;};'use strict';var moment=require('moment');var Sequelize=require(_0x69b5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x69b5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x69b5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x69b5('0x2')]},'acceptAt':{'type':Sequelize[_0x69b5('0x2')]},'exitAt':{'type':Sequelize[_0x69b5('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a29=['STRING','DATE','moment'];(function(_0x4666a7,_0x1135c4){var _0x18d3b7=function(_0x1cb01e){while(--_0x1cb01e){_0x4666a7['push'](_0x4666a7['shift']());}};_0x18d3b7(++_0x1135c4);}(_0x3a29,0x101));var _0x93a2=function(_0x516224,_0x23bca8){_0x516224=_0x516224-0x0;var _0x28ca54=_0x3a29[_0x516224];return _0x28ca54;};'use strict';var moment=require(_0x93a2('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x93a2('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x93a2('0x1')]},'joinAt':{'type':Sequelize[_0x93a2('0x2')]},'leaveAt':{'type':Sequelize[_0x93a2('0x2')]},'acceptAt':{'type':Sequelize[_0x93a2('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x93a2('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b2d6640..ee203a3 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 _0x1152=['key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','show','keys','include','merge','create','body','catch','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','FaxQueueReport','rawAttributes'];(function(_0x5f364a,_0x523e4a){var _0x59b906=function(_0x47fe06){while(--_0x47fe06){_0x5f364a['push'](_0x5f364a['shift']());}};_0x59b906(++_0x523e4a);}(_0x1152,0x182));var _0x2115=function(_0x3fccbb,_0x473396){_0x3fccbb=_0x3fccbb-0x0;var _0x11df6e=_0x1152[_0x3fccbb];return _0x11df6e;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require(_0x2115('0x1'));var zipdir=require(_0x2115('0x2'));var jsonpatch=require(_0x2115('0x3'));var rp=require(_0x2115('0x4'));var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require('util');var path=require(_0x2115('0x8'));var sox=require('sox');var csv=require(_0x2115('0x9'));var ejs=require(_0x2115('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0x9'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2115('0xe'));var hardwareService=require(_0x2115('0xf'));var logger=require(_0x2115('0x10'))('api');var utils=require(_0x2115('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2115('0x12'));var db=require(_0x2115('0x13'))['db'];function respondWithStatusCode(_0x2bb885,_0x33d38b){_0x33d38b=_0x33d38b||0xcc;return function(_0x22475e){if(_0x22475e){return _0x2bb885['sendStatus'](_0x33d38b);}return _0x2bb885[_0x2115('0x14')](_0x33d38b)['end']();};}function respondWithResult(_0x3727a3,_0x38e406){_0x38e406=_0x38e406||0xc8;return function(_0x17028e){if(_0x17028e){return _0x3727a3[_0x2115('0x14')](_0x38e406)[_0x2115('0x15')](_0x17028e);}};}function respondWithFilteredResult(_0x113ce2,_0x350969){return function(_0x5e8f81){if(_0x5e8f81){var _0xdf3e24=typeof _0x350969[_0x2115('0x16')]===_0x2115('0x17')&&typeof _0x350969[_0x2115('0x18')]===_0x2115('0x17');var _0x1bdef9=_0x5e8f81[_0x2115('0x19')];var _0x77e2c6=_0xdf3e24?0x0:_0x350969['offset'];var _0x154f69=_0xdf3e24?_0x5e8f81[_0x2115('0x19')]:_0x350969[_0x2115('0x16')]+_0x350969['limit'];var _0x2dfb3c;if(_0x154f69>=_0x1bdef9){_0x154f69=_0x1bdef9;_0x2dfb3c=0xc8;}else{_0x2dfb3c=0xce;}_0x113ce2[_0x2115('0x14')](_0x2dfb3c);return _0x113ce2[_0x2115('0x1a')](_0x2115('0x1b'),_0x77e2c6+'-'+_0x154f69+'/'+_0x1bdef9)[_0x2115('0x15')](_0x5e8f81);}return null;};}function patchUpdates(_0xcc2d7b){return function(_0x21d079){try{jsonpatch[_0x2115('0x1c')](_0x21d079,_0xcc2d7b,!![]);}catch(_0x464af4){return BPromise[_0x2115('0x1d')](_0x464af4);}return _0x21d079[_0x2115('0x1e')]();};}function saveUpdates(_0x8b7304,_0x8e37c){return function(_0x13fde1){if(_0x13fde1){return _0x13fde1['update'](_0x8b7304)[_0x2115('0x1f')](function(_0x340c42){return _0x340c42;});}return null;};}function removeEntity(_0x40d19f,_0x4ac436){return function(_0x27c2f5){if(_0x27c2f5){return _0x27c2f5[_0x2115('0x20')]()['then'](function(){_0x40d19f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x201c94,_0x5e9d07){return function(_0x1a2ec3){if(!_0x1a2ec3){_0x201c94['sendStatus'](0x194);}return _0x1a2ec3;};}function handleError(_0x1283ec,_0x115800){_0x115800=_0x115800||0x1f4;return function(_0x1b7f47){logger[_0x2115('0x21')](_0x1b7f47[_0x2115('0x22')]);if(_0x1b7f47['name']){delete _0x1b7f47[_0x2115('0x23')];}_0x1283ec[_0x2115('0x14')](_0x115800)['send'](_0x1b7f47);};}exports[_0x2115('0x24')]=function(_0x33d81c,_0x26eff7){var _0x1262e7={},_0x59ca70={},_0x19c595={'count':0x0,'rows':[]};var _0x15229e=_[_0x2115('0x25')](db[_0x2115('0x26')][_0x2115('0x27')],function(_0x27969d){return{'name':_0x27969d['fieldName'],'type':_0x27969d['type'][_0x2115('0x28')]};});_0x59ca70[_0x2115('0x29')]=_[_0x2115('0x25')](_0x15229e,_0x2115('0x23'));_0x59ca70[_0x2115('0x2a')]=_['keys'](_0x33d81c[_0x2115('0x2a')]);_0x59ca70[_0x2115('0x2b')]=_[_0x2115('0x2c')](_0x59ca70['model'],_0x59ca70[_0x2115('0x2a')]);_0x1262e7['attributes']=_[_0x2115('0x2c')](_0x59ca70['model'],qs[_0x2115('0x2d')](_0x33d81c[_0x2115('0x2a')][_0x2115('0x2d')]));_0x1262e7['attributes']=_0x1262e7['attributes'][_0x2115('0x2e')]?_0x1262e7[_0x2115('0x2f')]:_0x59ca70['model'];if(!_0x33d81c[_0x2115('0x2a')][_0x2115('0x30')](_0x2115('0x31'))){_0x1262e7[_0x2115('0x18')]=qs['limit'](_0x33d81c[_0x2115('0x2a')][_0x2115('0x18')]);_0x1262e7[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x33d81c['query'][_0x2115('0x16')]);}_0x1262e7[_0x2115('0x32')]=qs[_0x2115('0x33')](_0x33d81c[_0x2115('0x2a')][_0x2115('0x33')]);_0x1262e7[_0x2115('0x34')]=qs['filters'](_[_0x2115('0x35')](_0x33d81c[_0x2115('0x2a')],_0x59ca70[_0x2115('0x2b')]),_0x15229e);if(_0x33d81c[_0x2115('0x2a')][_0x2115('0x36')]){_0x1262e7[_0x2115('0x34')]=_['merge'](_0x1262e7[_0x2115('0x34')],{'$or':_['map'](_0x15229e,function(_0x59b531){if(_0x59b531[_0x2115('0x37')]!==_0x2115('0x38')){var _0x4572f3={};_0x4572f3[_0x59b531[_0x2115('0x23')]]={'$like':'%'+_0x33d81c[_0x2115('0x2a')][_0x2115('0x36')]+'%'};return _0x4572f3;}})});}_0x1262e7=_['merge']({},_0x1262e7,_0x33d81c[_0x2115('0x39')]);var _0x1c2508={'where':_0x1262e7[_0x2115('0x34')]};return db[_0x2115('0x26')][_0x2115('0x19')](_0x1c2508)[_0x2115('0x1f')](function(_0x1aa165){_0x19c595[_0x2115('0x19')]=_0x1aa165;if(_0x33d81c[_0x2115('0x2a')][_0x2115('0x3a')]){_0x1262e7['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x2115('0x3b')](_0x1262e7);})['then'](function(_0xa652de){_0x19c595['rows']=_0xa652de;return _0x19c595;})['then'](respondWithFilteredResult(_0x26eff7,_0x1262e7))['catch'](handleError(_0x26eff7,null));};exports[_0x2115('0x3c')]=function(_0x40d5d6,_0x11b840){var _0x96847d={'raw':!![],'where':{'id':_0x40d5d6['params']['id']}},_0x16f022={};_0x16f022[_0x2115('0x29')]=_['keys'](db[_0x2115('0x26')][_0x2115('0x27')]);_0x16f022['query']=_[_0x2115('0x3d')](_0x40d5d6[_0x2115('0x2a')]);_0x16f022['filters']=_['intersection'](_0x16f022[_0x2115('0x29')],_0x16f022[_0x2115('0x2a')]);_0x96847d['attributes']=_['intersection'](_0x16f022[_0x2115('0x29')],qs[_0x2115('0x2d')](_0x40d5d6['query']['fields']));_0x96847d[_0x2115('0x2f')]=_0x96847d[_0x2115('0x2f')][_0x2115('0x2e')]?_0x96847d['attributes']:_0x16f022[_0x2115('0x29')];if(_0x40d5d6['query'][_0x2115('0x3a')]){_0x96847d[_0x2115('0x3e')]=[{'all':!![]}];}_0x96847d=_[_0x2115('0x3f')]({},_0x96847d,_0x40d5d6[_0x2115('0x39')]);return db[_0x2115('0x26')]['find'](_0x96847d)[_0x2115('0x1f')](handleEntityNotFound(_0x11b840,null))['then'](respondWithResult(_0x11b840,null))['catch'](handleError(_0x11b840,null));};exports[_0x2115('0x40')]=function(_0xa67937,_0x583575){return db[_0x2115('0x26')][_0x2115('0x40')](_0xa67937[_0x2115('0x41')],{})[_0x2115('0x1f')](respondWithResult(_0x583575,0xc9))[_0x2115('0x42')](handleError(_0x583575,null));};exports[_0x2115('0x43')]=function(_0x41d1a4,_0x347f16){if(_0x41d1a4[_0x2115('0x41')]['id']){delete _0x41d1a4['body']['id'];}return db[_0x2115('0x26')][_0x2115('0x44')]({'where':{'id':_0x41d1a4[_0x2115('0x45')]['id']}})['then'](handleEntityNotFound(_0x347f16,null))[_0x2115('0x1f')](saveUpdates(_0x41d1a4['body'],null))['then'](respondWithResult(_0x347f16,null))['catch'](handleError(_0x347f16,null));};exports[_0x2115('0x20')]=function(_0x24d601,_0x4820c7){return db['FaxQueueReport'][_0x2115('0x44')]({'where':{'id':_0x24d601[_0x2115('0x45')]['id']}})[_0x2115('0x1f')](handleEntityNotFound(_0x4820c7,null))[_0x2115('0x1f')](removeEntity(_0x4820c7,null))[_0x2115('0x42')](handleError(_0x4820c7,null));};exports[_0x2115('0x46')]=function(_0x3b8586,_0x9539e2){return db['FaxQueueReport'][_0x2115('0x46')]()[_0x2115('0x1f')](respondWithResult(_0x9539e2,null))['catch'](handleError(_0x9539e2,null));}; \ No newline at end of file +var _0x0439=['intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x522738,_0x26c67d){var _0x4af3e0=function(_0x244d3a){while(--_0x244d3a){_0x522738['push'](_0x522738['shift']());}};_0x4af3e0(++_0x26c67d);}(_0x0439,0xdd));var _0x9043=function(_0x3ae1a9,_0x3f6243){_0x3ae1a9=_0x3ae1a9-0x0;var _0x36b7e4=_0x0439[_0x3ae1a9];return _0x36b7e4;};'use strict';var emlformat=require(_0x9043('0x0'));var rimraf=require(_0x9043('0x1'));var zipdir=require(_0x9043('0x2'));var jsonpatch=require(_0x9043('0x3'));var rp=require(_0x9043('0x4'));var moment=require(_0x9043('0x5'));var BPromise=require(_0x9043('0x6'));var Mustache=require('mustache');var util=require(_0x9043('0x7'));var path=require(_0x9043('0x8'));var sox=require(_0x9043('0x9'));var csv=require('to-csv');var ejs=require(_0x9043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9043('0xb'));var crypto=require(_0x9043('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9043('0xe'));var Papa=require(_0x9043('0xf'));var Redis=require('ioredis');var authService=require(_0x9043('0x10'));var qs=require(_0x9043('0x11'));var as=require(_0x9043('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9043('0x13'));var utils=require(_0x9043('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9043('0x15'));var db=require(_0x9043('0x16'))['db'];function respondWithStatusCode(_0x3d8d67,_0x2bf58d){_0x2bf58d=_0x2bf58d||0xcc;return function(_0xcd2bf1){if(_0xcd2bf1){return _0x3d8d67[_0x9043('0x17')](_0x2bf58d);}return _0x3d8d67['status'](_0x2bf58d)[_0x9043('0x18')]();};}function respondWithResult(_0xf3f958,_0x48b142){_0x48b142=_0x48b142||0xc8;return function(_0x18f916){if(_0x18f916){return _0xf3f958[_0x9043('0x19')](_0x48b142)['json'](_0x18f916);}};}function respondWithFilteredResult(_0x37eca8,_0x1c2473){return function(_0x3aaee1){if(_0x3aaee1){var _0x2b3c2d=typeof _0x1c2473[_0x9043('0x1a')]===_0x9043('0x1b')&&typeof _0x1c2473[_0x9043('0x1c')]===_0x9043('0x1b');var _0x21f330=_0x3aaee1[_0x9043('0x1d')];var _0x51823a=_0x2b3c2d?0x0:_0x1c2473['offset'];var _0x47fbdc=_0x2b3c2d?_0x3aaee1[_0x9043('0x1d')]:_0x1c2473[_0x9043('0x1a')]+_0x1c2473[_0x9043('0x1c')];var _0x43bbd4;if(_0x47fbdc>=_0x21f330){_0x47fbdc=_0x21f330;_0x43bbd4=0xc8;}else{_0x43bbd4=0xce;}_0x37eca8['status'](_0x43bbd4);return _0x37eca8[_0x9043('0x1e')]('Content-Range',_0x51823a+'-'+_0x47fbdc+'/'+_0x21f330)['json'](_0x3aaee1);}return null;};}function patchUpdates(_0x161511){return function(_0x3572d5){try{jsonpatch[_0x9043('0x1f')](_0x3572d5,_0x161511,!![]);}catch(_0x820f8c){return BPromise[_0x9043('0x20')](_0x820f8c);}return _0x3572d5[_0x9043('0x21')]();};}function saveUpdates(_0x3a82b4,_0x366695){return function(_0x5a3f7a){if(_0x5a3f7a){return _0x5a3f7a[_0x9043('0x22')](_0x3a82b4)[_0x9043('0x23')](function(_0x30930c){return _0x30930c;});}return null;};}function removeEntity(_0x5506bf,_0x18727f){return function(_0x3c4fa4){if(_0x3c4fa4){return _0x3c4fa4[_0x9043('0x24')]()[_0x9043('0x23')](function(){_0x5506bf[_0x9043('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16caf2,_0xca0bb1){return function(_0x6d23af){if(!_0x6d23af){_0x16caf2[_0x9043('0x17')](0x194);}return _0x6d23af;};}function handleError(_0x2003c3,_0x13e8dd){_0x13e8dd=_0x13e8dd||0x1f4;return function(_0x5f4975){logger[_0x9043('0x25')](_0x5f4975['stack']);if(_0x5f4975[_0x9043('0x26')]){delete _0x5f4975[_0x9043('0x26')];}_0x2003c3[_0x9043('0x19')](_0x13e8dd)[_0x9043('0x27')](_0x5f4975);};}exports['index']=function(_0xc92d75,_0x2e12b1){var _0x14cf80={},_0x228d7f={},_0x37ecc2={'count':0x0,'rows':[]};var _0x590357=_[_0x9043('0x28')](db[_0x9043('0x29')][_0x9043('0x2a')],function(_0x4e4363){return{'name':_0x4e4363[_0x9043('0x2b')],'type':_0x4e4363[_0x9043('0x2c')]['key']};});_0x228d7f[_0x9043('0x2d')]=_[_0x9043('0x28')](_0x590357,'name');_0x228d7f[_0x9043('0x2e')]=_[_0x9043('0x2f')](_0xc92d75[_0x9043('0x2e')]);_0x228d7f[_0x9043('0x30')]=_['intersection'](_0x228d7f[_0x9043('0x2d')],_0x228d7f[_0x9043('0x2e')]);_0x14cf80['attributes']=_['intersection'](_0x228d7f[_0x9043('0x2d')],qs[_0x9043('0x31')](_0xc92d75[_0x9043('0x2e')][_0x9043('0x31')]));_0x14cf80[_0x9043('0x32')]=_0x14cf80[_0x9043('0x32')]['length']?_0x14cf80['attributes']:_0x228d7f[_0x9043('0x2d')];if(!_0xc92d75[_0x9043('0x2e')][_0x9043('0x33')](_0x9043('0x34'))){_0x14cf80[_0x9043('0x1c')]=qs[_0x9043('0x1c')](_0xc92d75[_0x9043('0x2e')]['limit']);_0x14cf80[_0x9043('0x1a')]=qs['offset'](_0xc92d75[_0x9043('0x2e')]['offset']);}_0x14cf80[_0x9043('0x35')]=qs[_0x9043('0x36')](_0xc92d75['query']['sort']);_0x14cf80[_0x9043('0x37')]=qs[_0x9043('0x30')](_[_0x9043('0x38')](_0xc92d75[_0x9043('0x2e')],_0x228d7f[_0x9043('0x30')]),_0x590357);if(_0xc92d75[_0x9043('0x2e')][_0x9043('0x39')]){_0x14cf80[_0x9043('0x37')]=_[_0x9043('0x3a')](_0x14cf80[_0x9043('0x37')],{'$or':_[_0x9043('0x28')](_0x590357,function(_0x19b858){if(_0x19b858['type']!==_0x9043('0x3b')){var _0x5187bf={};_0x5187bf[_0x19b858[_0x9043('0x26')]]={'$like':'%'+_0xc92d75[_0x9043('0x2e')]['filter']+'%'};return _0x5187bf;}})});}_0x14cf80=_[_0x9043('0x3a')]({},_0x14cf80,_0xc92d75[_0x9043('0x3c')]);var _0x1dc9cf={'where':_0x14cf80['where']};return db[_0x9043('0x29')][_0x9043('0x1d')](_0x1dc9cf)[_0x9043('0x23')](function(_0x3cdaf9){_0x37ecc2[_0x9043('0x1d')]=_0x3cdaf9;if(_0xc92d75[_0x9043('0x2e')][_0x9043('0x3d')]){_0x14cf80[_0x9043('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x9043('0x3f')](_0x14cf80);})['then'](function(_0x56a084){_0x37ecc2[_0x9043('0x40')]=_0x56a084;return _0x37ecc2;})['then'](respondWithFilteredResult(_0x2e12b1,_0x14cf80))[_0x9043('0x41')](handleError(_0x2e12b1,null));};exports['show']=function(_0x392551,_0x3a75e0){var _0x2c479d={'raw':!![],'where':{'id':_0x392551[_0x9043('0x42')]['id']}},_0x38028b={};_0x38028b[_0x9043('0x2d')]=_['keys'](db[_0x9043('0x29')][_0x9043('0x2a')]);_0x38028b[_0x9043('0x2e')]=_['keys'](_0x392551[_0x9043('0x2e')]);_0x38028b[_0x9043('0x30')]=_['intersection'](_0x38028b[_0x9043('0x2d')],_0x38028b['query']);_0x2c479d[_0x9043('0x32')]=_[_0x9043('0x43')](_0x38028b['model'],qs['fields'](_0x392551[_0x9043('0x2e')][_0x9043('0x31')]));_0x2c479d[_0x9043('0x32')]=_0x2c479d[_0x9043('0x32')]['length']?_0x2c479d[_0x9043('0x32')]:_0x38028b[_0x9043('0x2d')];if(_0x392551['query']['includeAll']){_0x2c479d[_0x9043('0x3e')]=[{'all':!![]}];}_0x2c479d=_[_0x9043('0x3a')]({},_0x2c479d,_0x392551['options']);return db[_0x9043('0x29')][_0x9043('0x44')](_0x2c479d)[_0x9043('0x23')](handleEntityNotFound(_0x3a75e0,null))[_0x9043('0x23')](respondWithResult(_0x3a75e0,null))['catch'](handleError(_0x3a75e0,null));};exports[_0x9043('0x45')]=function(_0x172872,_0x5d7e24){return db[_0x9043('0x29')][_0x9043('0x45')](_0x172872[_0x9043('0x46')],{})[_0x9043('0x23')](respondWithResult(_0x5d7e24,0xc9))[_0x9043('0x41')](handleError(_0x5d7e24,null));};exports[_0x9043('0x22')]=function(_0x6f909a,_0x370821){if(_0x6f909a[_0x9043('0x46')]['id']){delete _0x6f909a[_0x9043('0x46')]['id'];}return db[_0x9043('0x29')][_0x9043('0x44')]({'where':{'id':_0x6f909a[_0x9043('0x42')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x370821,null))['then'](saveUpdates(_0x6f909a[_0x9043('0x46')],null))[_0x9043('0x23')](respondWithResult(_0x370821,null))['catch'](handleError(_0x370821,null));};exports[_0x9043('0x24')]=function(_0x188695,_0x385fb6){return db['FaxQueueReport']['find']({'where':{'id':_0x188695[_0x9043('0x42')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x385fb6,null))[_0x9043('0x23')](removeEntity(_0x385fb6,null))[_0x9043('0x41')](handleError(_0x385fb6,null));};exports['describe']=function(_0x13127e,_0x425205){return db[_0x9043('0x29')][_0x9043('0x47')]()['then'](respondWithResult(_0x425205,null))[_0x9043('0x41')](handleError(_0x425205,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 484d138..cb59d89 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x3f441c,_0x43bf79){var _0x165313=function(_0x303dbb){while(--_0x303dbb){_0x3f441c['push'](_0x3f441c['shift']());}};_0x165313(++_0x43bf79);}(_0x5fab,0x177));var _0xb5fa=function(_0x2def85,_0x39b650){_0x2def85=_0x2def85-0x0;var _0x12ce04=_0x5fab[_0x2def85];return _0x12ce04;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x552be6,_0x412fe9){var _0x408bd2=function(_0x3c4982){while(--_0x3c4982){_0x552be6['push'](_0x552be6['shift']());}};_0x408bd2(++_0x412fe9);}(_0x1261,0x144));var _0x1126=function(_0x20d290,_0x40fc11){_0x20d290=_0x20d290-0x0;var _0x2bfa8f=_0x1261[_0x20d290];return _0x2bfa8f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 48a1cef..b03ca90 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 _0x4457=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','create','options','info','UpdateFaxQueueReport','FaxQueueReport','update','body','where','attributes','lodash'];(function(_0xb0bfd6,_0xc3164f){var _0x59e733=function(_0x5ee6a1){while(--_0x5ee6a1){_0xb0bfd6['push'](_0xb0bfd6['shift']());}};_0x59e733(++_0xc3164f);}(_0x4457,0xc5));var _0x7445=function(_0xc2f54d,_0x242f6f){_0xc2f54d=_0xc2f54d-0x0;var _0x85900c=_0x4457[_0xc2f54d];return _0x85900c;};'use strict';var _=require(_0x7445('0x0'));var util=require('util');var moment=require(_0x7445('0x1'));var BPromise=require(_0x7445('0x2'));var rs=require(_0x7445('0x3'));var fs=require('fs');var Redis=require(_0x7445('0x4'));var db=require(_0x7445('0x5'))['db'];var utils=require(_0x7445('0x6'));var logger=require(_0x7445('0x7'))(_0x7445('0x8'));var config=require(_0x7445('0x9'));var jayson=require(_0x7445('0xa'));var client=jayson[_0x7445('0xb')][_0x7445('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20f563,_0x382f77,_0xe39c11){return new BPromise(function(_0x8f0e85,_0x1c2a87){return client[_0x7445('0xd')](_0x20f563,_0xe39c11)['then'](function(_0x3c28b9){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x382f77,_0x7445('0xe'));logger[_0x7445('0xf')](_0x7445('0x10'),_0x382f77,_0x7445('0xe'),JSON['stringify'](_0x3c28b9));if(_0x3c28b9[_0x7445('0x11')]){if(_0x3c28b9[_0x7445('0x11')][_0x7445('0x12')]===0x1f4){logger[_0x7445('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x382f77,_0x3c28b9[_0x7445('0x11')]['message']);return _0x1c2a87(_0x3c28b9['error'][_0x7445('0x13')]);}logger['error'](_0x7445('0x14'),_0x382f77,_0x3c28b9['error'][_0x7445('0x13')]);return _0x8f0e85(_0x3c28b9[_0x7445('0x11')]['message']);}else{logger['info'](_0x7445('0x14'),_0x382f77,'request\x20sent');_0x8f0e85(_0x3c28b9[_0x7445('0x15')][_0x7445('0x13')]);}})[_0x7445('0x16')](function(_0x1d726e){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x382f77,_0x1d726e);_0x1c2a87(_0x1d726e);});});}exports[_0x7445('0x17')]=function(_0x1eba1c){var _0x45aaec=this;return new Promise(function(_0x50ca4b,_0x2e3193){return db['FaxQueueReport'][_0x7445('0x18')](_0x1eba1c['body'],{'raw':_0x1eba1c[_0x7445('0x19')]?_0x1eba1c[_0x7445('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4a1674){logger[_0x7445('0x1a')](_0x7445('0x17'),_0x1eba1c);logger[_0x7445('0xf')]('CreateFaxQueueReport',_0x1eba1c,JSON['stringify'](_0x4a1674));_0x50ca4b(_0x4a1674);})[_0x7445('0x16')](function(_0x152f42){logger['error'](_0x7445('0x17'),_0x152f42['message'],_0x1eba1c);_0x2e3193(_0x45aaec[_0x7445('0x11')](0x1f4,_0x152f42[_0x7445('0x13')]));});});};exports[_0x7445('0x1b')]=function(_0xe8fdb1){var _0x52965c=this;return new Promise(function(_0x315089,_0x340a1b){return db[_0x7445('0x1c')][_0x7445('0x1d')](_0xe8fdb1[_0x7445('0x1e')],{'raw':_0xe8fdb1[_0x7445('0x19')]?_0xe8fdb1[_0x7445('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe8fdb1['options']?_0xe8fdb1[_0x7445('0x19')][_0x7445('0x1f')]||null:null,'attributes':_0xe8fdb1['options']?_0xe8fdb1[_0x7445('0x19')][_0x7445('0x20')]||null:null,'limit':_0xe8fdb1[_0x7445('0x19')]?_0xe8fdb1[_0x7445('0x19')]['limit']||null:null})['then'](function(_0x5b685d){logger[_0x7445('0x1a')]('UpdateFaxQueueReport',_0xe8fdb1);logger[_0x7445('0xf')]('UpdateFaxQueueReport',_0xe8fdb1,JSON['stringify'](_0x5b685d));_0x315089(_0x5b685d);})[_0x7445('0x16')](function(_0x348ea1){logger[_0x7445('0x11')](_0x7445('0x1b'),_0x348ea1[_0x7445('0x13')],_0xe8fdb1);_0x340a1b(_0x52965c[_0x7445('0x11')](0x1f4,_0x348ea1[_0x7445('0x13')]));});});}; \ No newline at end of file +var _0xfeae=['update','body','raw','where','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','options','UpdateFaxQueueReport','FaxQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfeae,0x6c));var _0xefea=function(_0x48df93,_0x97635e){_0x48df93=_0x48df93-0x0;var _0x54c28d=_0xfeae[_0x48df93];return _0x54c28d;};'use strict';var _=require(_0xefea('0x0'));var util=require(_0xefea('0x1'));var moment=require(_0xefea('0x2'));var BPromise=require(_0xefea('0x3'));var rs=require(_0xefea('0x4'));var fs=require('fs');var Redis=require(_0xefea('0x5'));var db=require(_0xefea('0x6'))['db'];var utils=require(_0xefea('0x7'));var logger=require(_0xefea('0x8'))('rpc');var config=require(_0xefea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xefea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232f8f,_0x4e6af8,_0x4eddb0){return new BPromise(function(_0x5a3311,_0xde7b1e){return client[_0xefea('0xb')](_0x232f8f,_0x4eddb0)['then'](function(_0x3faace){logger[_0xefea('0xc')](_0xefea('0xd'),_0x4e6af8,_0xefea('0xe'));logger[_0xefea('0xf')](_0xefea('0x10'),_0x4e6af8,_0xefea('0xe'),JSON[_0xefea('0x11')](_0x3faace));if(_0x3faace[_0xefea('0x12')]){if(_0x3faace[_0xefea('0x12')][_0xefea('0x13')]===0x1f4){logger[_0xefea('0x12')](_0xefea('0xd'),_0x4e6af8,_0x3faace[_0xefea('0x12')][_0xefea('0x14')]);return _0xde7b1e(_0x3faace['error'][_0xefea('0x14')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x4e6af8,_0x3faace[_0xefea('0x12')]['message']);return _0x5a3311(_0x3faace[_0xefea('0x12')][_0xefea('0x14')]);}else{logger[_0xefea('0xc')](_0xefea('0xd'),_0x4e6af8,'request\x20sent');_0x5a3311(_0x3faace[_0xefea('0x15')][_0xefea('0x14')]);}})[_0xefea('0x16')](function(_0xf7e018){logger[_0xefea('0x12')](_0xefea('0xd'),_0x4e6af8,_0xf7e018);_0xde7b1e(_0xf7e018);});});}exports[_0xefea('0x17')]=function(_0x5b3186){var _0x13380c=this;return new Promise(function(_0x209e8d,_0x4cc6a9){return db['FaxQueueReport'][_0xefea('0x18')](_0x5b3186['body'],{'raw':_0x5b3186['options']?_0x5b3186[_0xefea('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x409f13){logger['info'](_0xefea('0x17'),_0x5b3186);logger[_0xefea('0xf')](_0xefea('0x17'),_0x5b3186,JSON[_0xefea('0x11')](_0x409f13));_0x209e8d(_0x409f13);})['catch'](function(_0x4c67cf){logger[_0xefea('0x12')](_0xefea('0x17'),_0x4c67cf[_0xefea('0x14')],_0x5b3186);_0x4cc6a9(_0x13380c['error'](0x1f4,_0x4c67cf[_0xefea('0x14')]));});});};exports[_0xefea('0x1a')]=function(_0x58330e){var _0x1157f7=this;return new Promise(function(_0x5098d0,_0xc6dd49){return db[_0xefea('0x1b')][_0xefea('0x1c')](_0x58330e[_0xefea('0x1d')],{'raw':_0x58330e[_0xefea('0x19')]?_0x58330e[_0xefea('0x19')][_0xefea('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58330e['options']?_0x58330e[_0xefea('0x19')][_0xefea('0x1f')]||null:null,'attributes':_0x58330e[_0xefea('0x19')]?_0x58330e['options']['attributes']||null:null,'limit':_0x58330e['options']?_0x58330e[_0xefea('0x19')][_0xefea('0x20')]||null:null})[_0xefea('0x21')](function(_0x124c2c){logger['info'](_0xefea('0x1a'),_0x58330e);logger[_0xefea('0xf')](_0xefea('0x1a'),_0x58330e,JSON['stringify'](_0x124c2c));_0x5098d0(_0x124c2c);})[_0xefea('0x16')](function(_0x115b98){logger[_0xefea('0x12')](_0xefea('0x1a'),_0x115b98[_0xefea('0x14')],_0x58330e);_0xc6dd49(_0x1157f7['error'](0x1f4,_0x115b98[_0xefea('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c12da74..3b0e2f9 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 _0x551a=['../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe3dc82,_0x51412c){var _0xa81f3e=function(_0x324d64){while(--_0x324d64){_0xe3dc82['push'](_0xe3dc82['shift']());}};_0xa81f3e(++_0x51412c);}(_0x551a,0x110));var _0xa551=function(_0x2bd268,_0x3a9500){_0x2bd268=_0x2bd268-0x0;var _0xa21fae=_0x551a[_0x2bd268];return _0xa21fae;};'use strict';var multer=require(_0xa551('0x0'));var util=require(_0xa551('0x1'));var path=require(_0xa551('0x2'));var timeout=require(_0xa551('0x3'));var express=require(_0xa551('0x4'));var router=express['Router']();var fs_extra=require(_0xa551('0x5'));var auth=require(_0xa551('0x6'));var interaction=require(_0xa551('0x7'));var config=require(_0xa551('0x8'));var controller=require(_0xa551('0x9'));router[_0xa551('0xa')]('/',auth['isAuthenticated'](),controller[_0xa551('0xb')]);router[_0xa551('0xa')](_0xa551('0xc'),auth[_0xa551('0xd')](),controller[_0xa551('0xe')]);router[_0xa551('0xa')](_0xa551('0xf'),auth[_0xa551('0xd')](),controller['show']);router[_0xa551('0x10')]('/',auth[_0xa551('0xd')](),controller['create']);router[_0xa551('0x11')](_0xa551('0xf'),auth[_0xa551('0xd')](),controller[_0xa551('0x12')]);router['delete']('/:id',auth[_0xa551('0xd')](),controller[_0xa551('0x13')]);module['exports']=router; \ No newline at end of file +var _0xed22=['/:id','show','post','create','update','destroy','exports','multer','util','fs-extra','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index'];(function(_0x259b5f,_0x49503e){var _0x565522=function(_0x2a2845){while(--_0x2a2845){_0x259b5f['push'](_0x259b5f['shift']());}};_0x565522(++_0x49503e);}(_0xed22,0x133));var _0x2ed2=function(_0x17fcfe,_0x5adb02){_0x17fcfe=_0x17fcfe-0x0;var _0x3e3fc5=_0xed22[_0x17fcfe];return _0x3e3fc5;};'use strict';var multer=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ed2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2ed2('0x3'));var config=require('../../config/environment');var controller=require(_0x2ed2('0x4'));router[_0x2ed2('0x5')]('/',auth[_0x2ed2('0x6')](),controller[_0x2ed2('0x7')]);router[_0x2ed2('0x5')]('/describe',auth[_0x2ed2('0x6')](),controller['describe']);router[_0x2ed2('0x5')](_0x2ed2('0x8'),auth['isAuthenticated'](),controller[_0x2ed2('0x9')]);router[_0x2ed2('0xa')]('/',auth[_0x2ed2('0x6')](),controller[_0x2ed2('0xb')]);router['put'](_0x2ed2('0x8'),auth['isAuthenticated'](),controller[_0x2ed2('0xc')]);router['delete'](_0x2ed2('0x8'),auth[_0x2ed2('0x6')](),controller[_0x2ed2('0xd')]);module[_0x2ed2('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d316ae8..3c664ac 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2d21cc,_0x27ef2a){var _0x7ab87e=function(_0xa7b1f0){while(--_0xa7b1f0){_0x2d21cc['push'](_0x2d21cc['shift']());}};_0x7ab87e(++_0x27ef2a);}(_0x54ef,0x112));var _0xf54e=function(_0x837988,_0x3639da){_0x837988=_0x837988-0x0;var _0x5b4999=_0x54ef[_0x837988];return _0x5b4999;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1fa1e2,_0x4e40a7){_0x1fa1e2=_0x1fa1e2-0x0;var _0x3c0331=_0x9bde[_0x1fa1e2];return _0x3c0331;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d95440e..98350ad 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 _0x2ed1=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','rows','catch','show','params','keys','length','FaxTransferReport','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','../../mysqldb','status','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0xd45224,_0x112a37){var _0x35f162=function(_0x52f0d8){while(--_0x52f0d8){_0xd45224['push'](_0xd45224['shift']());}};_0x35f162(++_0x112a37);}(_0x2ed1,0x100));var _0x12ed=function(_0x117cdf,_0x5360f2){_0x117cdf=_0x117cdf-0x0;var _0x1a3ef4=_0x2ed1[_0x117cdf];return _0x1a3ef4;};'use strict';var emlformat=require(_0x12ed('0x0'));var rimraf=require(_0x12ed('0x1'));var zipdir=require(_0x12ed('0x2'));var jsonpatch=require(_0x12ed('0x3'));var rp=require(_0x12ed('0x4'));var moment=require('moment');var BPromise=require(_0x12ed('0x5'));var Mustache=require(_0x12ed('0x6'));var util=require(_0x12ed('0x7'));var path=require(_0x12ed('0x8'));var sox=require(_0x12ed('0x9'));var csv=require(_0x12ed('0xa'));var ejs=require(_0x12ed('0xb'));var fs=require('fs');var fs_extra=require(_0x12ed('0xc'));var _=require(_0x12ed('0xd'));var squel=require(_0x12ed('0xe'));var crypto=require(_0x12ed('0xf'));var jsforce=require(_0x12ed('0x10'));var deskjs=require(_0x12ed('0x11'));var toCsv=require(_0x12ed('0xa'));var querystring=require(_0x12ed('0x12'));var Papa=require(_0x12ed('0x13'));var Redis=require(_0x12ed('0x14'));var authService=require(_0x12ed('0x15'));var qs=require(_0x12ed('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12ed('0x17'));var logger=require(_0x12ed('0x18'))(_0x12ed('0x19'));var utils=require(_0x12ed('0x1a'));var config=require(_0x12ed('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x12ed('0x1c'))['db'];function respondWithStatusCode(_0x336253,_0x796849){_0x796849=_0x796849||0xcc;return function(_0x56b919){if(_0x56b919){return _0x336253['sendStatus'](_0x796849);}return _0x336253[_0x12ed('0x1d')](_0x796849)['end']();};}function respondWithResult(_0x782e0f,_0x4a63c6){_0x4a63c6=_0x4a63c6||0xc8;return function(_0x2037ce){if(_0x2037ce){return _0x782e0f['status'](_0x4a63c6)['json'](_0x2037ce);}};}function respondWithFilteredResult(_0x42c65b,_0x29c9cd){return function(_0xc8bbb8){if(_0xc8bbb8){var _0x3e6511=typeof _0x29c9cd['offset']===_0x12ed('0x1e')&&typeof _0x29c9cd[_0x12ed('0x1f')]===_0x12ed('0x1e');var _0x1b2f04=_0xc8bbb8['count'];var _0x27999f=_0x3e6511?0x0:_0x29c9cd[_0x12ed('0x20')];var _0xba3d61=_0x3e6511?_0xc8bbb8[_0x12ed('0x21')]:_0x29c9cd[_0x12ed('0x20')]+_0x29c9cd[_0x12ed('0x1f')];var _0x2862f3;if(_0xba3d61>=_0x1b2f04){_0xba3d61=_0x1b2f04;_0x2862f3=0xc8;}else{_0x2862f3=0xce;}_0x42c65b[_0x12ed('0x1d')](_0x2862f3);return _0x42c65b[_0x12ed('0x22')](_0x12ed('0x23'),_0x27999f+'-'+_0xba3d61+'/'+_0x1b2f04)['json'](_0xc8bbb8);}return null;};}function patchUpdates(_0x359333){return function(_0x9225ed){try{jsonpatch[_0x12ed('0x24')](_0x9225ed,_0x359333,!![]);}catch(_0x43190c){return BPromise[_0x12ed('0x25')](_0x43190c);}return _0x9225ed['save']();};}function saveUpdates(_0x3f92f6,_0x544ea0){return function(_0x45c8df){if(_0x45c8df){return _0x45c8df[_0x12ed('0x26')](_0x3f92f6)['then'](function(_0x59b1b4){return _0x59b1b4;});}return null;};}function removeEntity(_0x4d3c96,_0x420440){return function(_0x4fbbf4){if(_0x4fbbf4){return _0x4fbbf4[_0x12ed('0x27')]()['then'](function(){_0x4d3c96['status'](0xcc)[_0x12ed('0x28')]();});}};}function handleEntityNotFound(_0x2618cd,_0x419055){return function(_0x50ca9a){if(!_0x50ca9a){_0x2618cd['sendStatus'](0x194);}return _0x50ca9a;};}function handleError(_0xc27f15,_0x5de74d){_0x5de74d=_0x5de74d||0x1f4;return function(_0x2eaea5){logger[_0x12ed('0x29')](_0x2eaea5[_0x12ed('0x2a')]);if(_0x2eaea5['name']){delete _0x2eaea5[_0x12ed('0x2b')];}_0xc27f15[_0x12ed('0x1d')](_0x5de74d)['send'](_0x2eaea5);};}exports[_0x12ed('0x2c')]=function(_0x5a677a,_0x40fc83){var _0x5979b3={},_0x247233={},_0x5ad204={'count':0x0,'rows':[]};var _0x4f840a=_['map'](db['FaxTransferReport'][_0x12ed('0x2d')],function(_0x3d99df){return{'name':_0x3d99df[_0x12ed('0x2e')],'type':_0x3d99df[_0x12ed('0x2f')]['key']};});_0x247233[_0x12ed('0x30')]=_[_0x12ed('0x31')](_0x4f840a,_0x12ed('0x2b'));_0x247233[_0x12ed('0x32')]=_['keys'](_0x5a677a[_0x12ed('0x32')]);_0x247233[_0x12ed('0x33')]=_[_0x12ed('0x34')](_0x247233[_0x12ed('0x30')],_0x247233[_0x12ed('0x32')]);_0x5979b3[_0x12ed('0x35')]=_[_0x12ed('0x34')](_0x247233[_0x12ed('0x30')],qs[_0x12ed('0x36')](_0x5a677a[_0x12ed('0x32')][_0x12ed('0x36')]));_0x5979b3[_0x12ed('0x35')]=_0x5979b3[_0x12ed('0x35')]['length']?_0x5979b3[_0x12ed('0x35')]:_0x247233[_0x12ed('0x30')];if(!_0x5a677a[_0x12ed('0x32')][_0x12ed('0x37')](_0x12ed('0x38'))){_0x5979b3[_0x12ed('0x1f')]=qs[_0x12ed('0x1f')](_0x5a677a[_0x12ed('0x32')][_0x12ed('0x1f')]);_0x5979b3[_0x12ed('0x20')]=qs[_0x12ed('0x20')](_0x5a677a[_0x12ed('0x32')][_0x12ed('0x20')]);}_0x5979b3[_0x12ed('0x39')]=qs[_0x12ed('0x3a')](_0x5a677a[_0x12ed('0x32')][_0x12ed('0x3a')]);_0x5979b3['where']=qs['filters'](_[_0x12ed('0x3b')](_0x5a677a[_0x12ed('0x32')],_0x247233[_0x12ed('0x33')]),_0x4f840a);if(_0x5a677a[_0x12ed('0x32')][_0x12ed('0x3c')]){_0x5979b3[_0x12ed('0x3d')]=_[_0x12ed('0x3e')](_0x5979b3[_0x12ed('0x3d')],{'$or':_[_0x12ed('0x31')](_0x4f840a,function(_0x33e830){if(_0x33e830['type']!==_0x12ed('0x3f')){var _0x2d8073={};_0x2d8073[_0x33e830['name']]={'$like':'%'+_0x5a677a['query'][_0x12ed('0x3c')]+'%'};return _0x2d8073;}})});}_0x5979b3=_[_0x12ed('0x3e')]({},_0x5979b3,_0x5a677a[_0x12ed('0x40')]);var _0x5e5076={'where':_0x5979b3[_0x12ed('0x3d')]};return db['FaxTransferReport']['count'](_0x5e5076)[_0x12ed('0x41')](function(_0x1bbc16){_0x5ad204[_0x12ed('0x21')]=_0x1bbc16;if(_0x5a677a[_0x12ed('0x32')][_0x12ed('0x42')]){_0x5979b3['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x5979b3);})[_0x12ed('0x41')](function(_0x400538){_0x5ad204[_0x12ed('0x43')]=_0x400538;return _0x5ad204;})[_0x12ed('0x41')](respondWithFilteredResult(_0x40fc83,_0x5979b3))[_0x12ed('0x44')](handleError(_0x40fc83,null));};exports[_0x12ed('0x45')]=function(_0x1686c7,_0x4d5788){var _0x222b09={'raw':!![],'where':{'id':_0x1686c7[_0x12ed('0x46')]['id']}},_0x42eee5={};_0x42eee5[_0x12ed('0x30')]=_[_0x12ed('0x47')](db['FaxTransferReport'][_0x12ed('0x2d')]);_0x42eee5[_0x12ed('0x32')]=_[_0x12ed('0x47')](_0x1686c7[_0x12ed('0x32')]);_0x42eee5['filters']=_[_0x12ed('0x34')](_0x42eee5[_0x12ed('0x30')],_0x42eee5[_0x12ed('0x32')]);_0x222b09[_0x12ed('0x35')]=_[_0x12ed('0x34')](_0x42eee5[_0x12ed('0x30')],qs[_0x12ed('0x36')](_0x1686c7[_0x12ed('0x32')][_0x12ed('0x36')]));_0x222b09[_0x12ed('0x35')]=_0x222b09[_0x12ed('0x35')][_0x12ed('0x48')]?_0x222b09[_0x12ed('0x35')]:_0x42eee5[_0x12ed('0x30')];if(_0x1686c7[_0x12ed('0x32')]['includeAll']){_0x222b09['include']=[{'all':!![]}];}_0x222b09=_[_0x12ed('0x3e')]({},_0x222b09,_0x1686c7[_0x12ed('0x40')]);return db[_0x12ed('0x49')][_0x12ed('0x4a')](_0x222b09)['then'](handleEntityNotFound(_0x4d5788,null))[_0x12ed('0x41')](respondWithResult(_0x4d5788,null))[_0x12ed('0x44')](handleError(_0x4d5788,null));};exports[_0x12ed('0x4b')]=function(_0x4b2a2b,_0x248e12){return db[_0x12ed('0x49')][_0x12ed('0x4b')](_0x4b2a2b[_0x12ed('0x4c')],{})[_0x12ed('0x41')](respondWithResult(_0x248e12,0xc9))[_0x12ed('0x44')](handleError(_0x248e12,null));};exports[_0x12ed('0x26')]=function(_0x4c6cd2,_0x3752e1){if(_0x4c6cd2['body']['id']){delete _0x4c6cd2[_0x12ed('0x4c')]['id'];}return db[_0x12ed('0x49')]['find']({'where':{'id':_0x4c6cd2[_0x12ed('0x46')]['id']}})[_0x12ed('0x41')](handleEntityNotFound(_0x3752e1,null))[_0x12ed('0x41')](saveUpdates(_0x4c6cd2['body'],null))[_0x12ed('0x41')](respondWithResult(_0x3752e1,null))['catch'](handleError(_0x3752e1,null));};exports[_0x12ed('0x27')]=function(_0x155237,_0x29e290){return db['FaxTransferReport'][_0x12ed('0x4a')]({'where':{'id':_0x155237[_0x12ed('0x46')]['id']}})[_0x12ed('0x41')](handleEntityNotFound(_0x29e290,null))['then'](removeEntity(_0x29e290,null))[_0x12ed('0x44')](handleError(_0x29e290,null));};exports['describe']=function(_0x4904a9,_0x1831ef){return db['FaxTransferReport'][_0x12ed('0x4d')]()[_0x12ed('0x41')](respondWithResult(_0x1831ef,null))['catch'](handleError(_0x1831ef,null));}; \ No newline at end of file +var _0x39e5=['set','Content-Range','apply','save','then','destroy','end','sendStatus','error','name','send','map','FaxTransferReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','params','include','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count','offset'];(function(_0x44ce4e,_0x367ec9){var _0x1677b0=function(_0x5a5da4){while(--_0x5a5da4){_0x44ce4e['push'](_0x44ce4e['shift']());}};_0x1677b0(++_0x367ec9);}(_0x39e5,0x72));var _0x539e=function(_0x192503,_0x199634){_0x192503=_0x192503-0x0;var _0x4745af=_0x39e5[_0x192503];return _0x4745af;};'use strict';var emlformat=require(_0x539e('0x0'));var rimraf=require(_0x539e('0x1'));var zipdir=require(_0x539e('0x2'));var jsonpatch=require(_0x539e('0x3'));var rp=require(_0x539e('0x4'));var moment=require(_0x539e('0x5'));var BPromise=require(_0x539e('0x6'));var Mustache=require(_0x539e('0x7'));var util=require(_0x539e('0x8'));var path=require(_0x539e('0x9'));var sox=require(_0x539e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x539e('0xb'));var _=require(_0x539e('0xc'));var squel=require(_0x539e('0xd'));var crypto=require(_0x539e('0xe'));var jsforce=require(_0x539e('0xf'));var deskjs=require(_0x539e('0x10'));var toCsv=require(_0x539e('0x11'));var querystring=require(_0x539e('0x12'));var Papa=require(_0x539e('0x13'));var Redis=require(_0x539e('0x14'));var authService=require(_0x539e('0x15'));var qs=require(_0x539e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x539e('0x17'));var logger=require(_0x539e('0x18'))(_0x539e('0x19'));var utils=require(_0x539e('0x1a'));var config=require(_0x539e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3efb67,_0x43b8d8){_0x43b8d8=_0x43b8d8||0xcc;return function(_0x52a92c){if(_0x52a92c){return _0x3efb67['sendStatus'](_0x43b8d8);}return _0x3efb67[_0x539e('0x1c')](_0x43b8d8)['end']();};}function respondWithResult(_0xe07704,_0x2243df){_0x2243df=_0x2243df||0xc8;return function(_0x3a1aa2){if(_0x3a1aa2){return _0xe07704[_0x539e('0x1c')](_0x2243df)[_0x539e('0x1d')](_0x3a1aa2);}};}function respondWithFilteredResult(_0x3d5aea,_0x8b87e7){return function(_0x14f1b6){if(_0x14f1b6){var _0x120372=typeof _0x8b87e7['offset']===_0x539e('0x1e')&&typeof _0x8b87e7[_0x539e('0x1f')]===_0x539e('0x1e');var _0x40ad5c=_0x14f1b6[_0x539e('0x20')];var _0x44bf4d=_0x120372?0x0:_0x8b87e7[_0x539e('0x21')];var _0x173a2c=_0x120372?_0x14f1b6[_0x539e('0x20')]:_0x8b87e7['offset']+_0x8b87e7['limit'];var _0x2f4336;if(_0x173a2c>=_0x40ad5c){_0x173a2c=_0x40ad5c;_0x2f4336=0xc8;}else{_0x2f4336=0xce;}_0x3d5aea[_0x539e('0x1c')](_0x2f4336);return _0x3d5aea[_0x539e('0x22')](_0x539e('0x23'),_0x44bf4d+'-'+_0x173a2c+'/'+_0x40ad5c)[_0x539e('0x1d')](_0x14f1b6);}return null;};}function patchUpdates(_0x2f3f00){return function(_0x1f6c20){try{jsonpatch[_0x539e('0x24')](_0x1f6c20,_0x2f3f00,!![]);}catch(_0x2abf93){return BPromise['reject'](_0x2abf93);}return _0x1f6c20[_0x539e('0x25')]();};}function saveUpdates(_0x27ab5f,_0x3cc501){return function(_0x109ec5){if(_0x109ec5){return _0x109ec5['update'](_0x27ab5f)[_0x539e('0x26')](function(_0x37998f){return _0x37998f;});}return null;};}function removeEntity(_0x5e59fc,_0x2b123e){return function(_0x5efdf4){if(_0x5efdf4){return _0x5efdf4[_0x539e('0x27')]()[_0x539e('0x26')](function(){_0x5e59fc[_0x539e('0x1c')](0xcc)[_0x539e('0x28')]();});}};}function handleEntityNotFound(_0x3e46e9,_0x511c44){return function(_0xb13a1c){if(!_0xb13a1c){_0x3e46e9[_0x539e('0x29')](0x194);}return _0xb13a1c;};}function handleError(_0x4797c3,_0x7bc595){_0x7bc595=_0x7bc595||0x1f4;return function(_0x2b860d){logger[_0x539e('0x2a')](_0x2b860d['stack']);if(_0x2b860d[_0x539e('0x2b')]){delete _0x2b860d[_0x539e('0x2b')];}_0x4797c3[_0x539e('0x1c')](_0x7bc595)[_0x539e('0x2c')](_0x2b860d);};}exports['index']=function(_0x58b6ed,_0x36e1ea){var _0x4af956={},_0x363860={},_0x420124={'count':0x0,'rows':[]};var _0x49ffb4=_[_0x539e('0x2d')](db[_0x539e('0x2e')][_0x539e('0x2f')],function(_0x58d45e){return{'name':_0x58d45e['fieldName'],'type':_0x58d45e['type']['key']};});_0x363860[_0x539e('0x30')]=_[_0x539e('0x2d')](_0x49ffb4,_0x539e('0x2b'));_0x363860[_0x539e('0x31')]=_[_0x539e('0x32')](_0x58b6ed[_0x539e('0x31')]);_0x363860[_0x539e('0x33')]=_['intersection'](_0x363860[_0x539e('0x30')],_0x363860['query']);_0x4af956[_0x539e('0x34')]=_[_0x539e('0x35')](_0x363860['model'],qs[_0x539e('0x36')](_0x58b6ed[_0x539e('0x31')]['fields']));_0x4af956['attributes']=_0x4af956[_0x539e('0x34')][_0x539e('0x37')]?_0x4af956['attributes']:_0x363860['model'];if(!_0x58b6ed[_0x539e('0x31')][_0x539e('0x38')]('nolimit')){_0x4af956[_0x539e('0x1f')]=qs[_0x539e('0x1f')](_0x58b6ed[_0x539e('0x31')][_0x539e('0x1f')]);_0x4af956['offset']=qs['offset'](_0x58b6ed[_0x539e('0x31')][_0x539e('0x21')]);}_0x4af956[_0x539e('0x39')]=qs['sort'](_0x58b6ed[_0x539e('0x31')][_0x539e('0x3a')]);_0x4af956[_0x539e('0x3b')]=qs[_0x539e('0x33')](_[_0x539e('0x3c')](_0x58b6ed['query'],_0x363860[_0x539e('0x33')]),_0x49ffb4);if(_0x58b6ed[_0x539e('0x31')][_0x539e('0x3d')]){_0x4af956[_0x539e('0x3b')]=_['merge'](_0x4af956[_0x539e('0x3b')],{'$or':_[_0x539e('0x2d')](_0x49ffb4,function(_0x5e02ca){if(_0x5e02ca['type']!==_0x539e('0x3e')){var _0x539fa9={};_0x539fa9[_0x5e02ca[_0x539e('0x2b')]]={'$like':'%'+_0x58b6ed[_0x539e('0x31')]['filter']+'%'};return _0x539fa9;}})});}_0x4af956=_['merge']({},_0x4af956,_0x58b6ed[_0x539e('0x3f')]);var _0x15fb94={'where':_0x4af956[_0x539e('0x3b')]};return db[_0x539e('0x2e')][_0x539e('0x20')](_0x15fb94)[_0x539e('0x26')](function(_0x480346){_0x420124[_0x539e('0x20')]=_0x480346;if(_0x58b6ed[_0x539e('0x31')][_0x539e('0x40')]){_0x4af956['include']=[{'all':!![]}];}return db[_0x539e('0x2e')]['findAll'](_0x4af956);})['then'](function(_0x27250c){_0x420124[_0x539e('0x41')]=_0x27250c;return _0x420124;})['then'](respondWithFilteredResult(_0x36e1ea,_0x4af956))[_0x539e('0x42')](handleError(_0x36e1ea,null));};exports['show']=function(_0x2647e1,_0x4488a0){var _0x19f1d2={'raw':!![],'where':{'id':_0x2647e1[_0x539e('0x43')]['id']}},_0x374190={};_0x374190[_0x539e('0x30')]=_[_0x539e('0x32')](db['FaxTransferReport'][_0x539e('0x2f')]);_0x374190['query']=_[_0x539e('0x32')](_0x2647e1['query']);_0x374190[_0x539e('0x33')]=_[_0x539e('0x35')](_0x374190[_0x539e('0x30')],_0x374190['query']);_0x19f1d2[_0x539e('0x34')]=_[_0x539e('0x35')](_0x374190['model'],qs[_0x539e('0x36')](_0x2647e1['query'][_0x539e('0x36')]));_0x19f1d2['attributes']=_0x19f1d2[_0x539e('0x34')]['length']?_0x19f1d2[_0x539e('0x34')]:_0x374190[_0x539e('0x30')];if(_0x2647e1[_0x539e('0x31')][_0x539e('0x40')]){_0x19f1d2[_0x539e('0x44')]=[{'all':!![]}];}_0x19f1d2=_[_0x539e('0x45')]({},_0x19f1d2,_0x2647e1[_0x539e('0x3f')]);return db[_0x539e('0x2e')][_0x539e('0x46')](_0x19f1d2)['then'](handleEntityNotFound(_0x4488a0,null))[_0x539e('0x26')](respondWithResult(_0x4488a0,null))['catch'](handleError(_0x4488a0,null));};exports[_0x539e('0x47')]=function(_0x199de4,_0x31e4e8){return db[_0x539e('0x2e')][_0x539e('0x47')](_0x199de4[_0x539e('0x48')],{})[_0x539e('0x26')](respondWithResult(_0x31e4e8,0xc9))[_0x539e('0x42')](handleError(_0x31e4e8,null));};exports['update']=function(_0x4a08da,_0x560557){if(_0x4a08da[_0x539e('0x48')]['id']){delete _0x4a08da['body']['id'];}return db['FaxTransferReport'][_0x539e('0x46')]({'where':{'id':_0x4a08da['params']['id']}})[_0x539e('0x26')](handleEntityNotFound(_0x560557,null))[_0x539e('0x26')](saveUpdates(_0x4a08da[_0x539e('0x48')],null))[_0x539e('0x26')](respondWithResult(_0x560557,null))[_0x539e('0x42')](handleError(_0x560557,null));};exports[_0x539e('0x27')]=function(_0x28a621,_0x2a7153){return db[_0x539e('0x2e')][_0x539e('0x46')]({'where':{'id':_0x28a621[_0x539e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a7153,null))[_0x539e('0x26')](removeEntity(_0x2a7153,null))[_0x539e('0x42')](handleError(_0x2a7153,null));};exports[_0x539e('0x49')]=function(_0x5544eb,_0x7d8d56){return db['FaxTransferReport'][_0x539e('0x49')]()[_0x539e('0x26')](respondWithResult(_0x7d8d56,null))[_0x539e('0x42')](handleError(_0x7d8d56,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 306cb41..1af4be7 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 _0x5e9a=['path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5e9a,0x72));var _0xa5e9=function(_0x426df2,_0x1df2dd){_0x426df2=_0x426df2-0x0;var _0x5ab5bd=_0x5e9a[_0x426df2];return _0x5ab5bd;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var logger=require(_0xa5e9('0x1'))(_0xa5e9('0x2'));var moment=require(_0xa5e9('0x3'));var BPromise=require(_0xa5e9('0x4'));var rp=require(_0xa5e9('0x5'));var fs=require('fs');var path=require(_0xa5e9('0x6'));var rimraf=require(_0xa5e9('0x7'));var config=require(_0xa5e9('0x8'));var attributes=require(_0xa5e9('0x9'));module[_0xa5e9('0xa')]=function(_0x2e8d81,_0x29ae50){return _0x2e8d81[_0xa5e9('0xb')](_0xa5e9('0xc'),attributes,{'tableName':_0xa5e9('0xd'),'paranoid':![],'indexes':[{'name':_0xa5e9('0xe'),'fields':[_0xa5e9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd23a=['define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3bd3d2,_0x413068){var _0x569624=function(_0x117a96){while(--_0x117a96){_0x3bd3d2['push'](_0x3bd3d2['shift']());}};_0x569624(++_0x413068);}(_0xd23a,0xe7));var _0xad23=function(_0x290043,_0x1a34f9){_0x290043=_0x290043-0x0;var _0x52997a=_0xd23a[_0x290043];return _0x52997a;};'use strict';var _=require(_0xad23('0x0'));var util=require('util');var logger=require(_0xad23('0x1'))(_0xad23('0x2'));var moment=require(_0xad23('0x3'));var BPromise=require(_0xad23('0x4'));var rp=require(_0xad23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad23('0x6'));var config=require(_0xad23('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0xad23('0x8')]=function(_0x1246b7,_0x46c3e2){return _0x1246b7[_0xad23('0x9')]('FaxTransferReport',attributes,{'tableName':_0xad23('0xa'),'paranoid':![],'indexes':[{'name':_0xad23('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 3af08b1..49ae5f0 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 _0x7ab5=['../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x83ee0a,_0x44947d){var _0x5dc29f=function(_0x3e1433){while(--_0x3e1433){_0x83ee0a['push'](_0x83ee0a['shift']());}};_0x5dc29f(++_0x44947d);}(_0x7ab5,0xea));var _0x57ab=function(_0x219172,_0x1a6385){_0x219172=_0x219172-0x0;var _0x4f8f38=_0x7ab5[_0x219172];return _0x4f8f38;};'use strict';var _=require('lodash');var util=require(_0x57ab('0x0'));var moment=require(_0x57ab('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57ab('0x2'))['db'];var utils=require(_0x57ab('0x3'));var logger=require(_0x57ab('0x4'))(_0x57ab('0x5'));var config=require(_0x57ab('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x57ab('0x7')][_0x57ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ca78a,_0x213b8b,_0x485969){return new BPromise(function(_0x4e4d11,_0x4ef6d8){return client[_0x57ab('0x9')](_0x3ca78a,_0x485969)[_0x57ab('0xa')](function(_0x16274f){logger[_0x57ab('0xb')](_0x57ab('0xc'),_0x213b8b,'request\x20sent');logger[_0x57ab('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x213b8b,_0x57ab('0xe'),JSON[_0x57ab('0xf')](_0x16274f));if(_0x16274f[_0x57ab('0x10')]){if(_0x16274f['error']['code']===0x1f4){logger[_0x57ab('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x213b8b,_0x16274f[_0x57ab('0x10')][_0x57ab('0x11')]);return _0x4ef6d8(_0x16274f[_0x57ab('0x10')][_0x57ab('0x11')]);}logger[_0x57ab('0x10')](_0x57ab('0xc'),_0x213b8b,_0x16274f['error'][_0x57ab('0x11')]);return _0x4e4d11(_0x16274f[_0x57ab('0x10')][_0x57ab('0x11')]);}else{logger[_0x57ab('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x213b8b,_0x57ab('0xe'));_0x4e4d11(_0x16274f[_0x57ab('0x12')]['message']);}})[_0x57ab('0x13')](function(_0x5f463f){logger[_0x57ab('0x10')](_0x57ab('0xc'),_0x213b8b,_0x5f463f);_0x4ef6d8(_0x5f463f);});});} \ No newline at end of file +var _0x6f0f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment'];(function(_0x2c8c76,_0x39246c){var _0x4b9d32=function(_0x299c26){while(--_0x299c26){_0x2c8c76['push'](_0x2c8c76['shift']());}};_0x4b9d32(++_0x39246c);}(_0x6f0f,0x14e));var _0xf6f0=function(_0x1bdfb6,_0x2dd242){_0x1bdfb6=_0x1bdfb6-0x0;var _0x5c124d=_0x6f0f[_0x1bdfb6];return _0x5c124d;};'use strict';var _=require(_0xf6f0('0x0'));var util=require('util');var moment=require(_0xf6f0('0x1'));var BPromise=require(_0xf6f0('0x2'));var rs=require(_0xf6f0('0x3'));var fs=require('fs');var Redis=require(_0xf6f0('0x4'));var db=require(_0xf6f0('0x5'))['db'];var utils=require(_0xf6f0('0x6'));var logger=require(_0xf6f0('0x7'))(_0xf6f0('0x8'));var config=require('../../config/environment');var jayson=require(_0xf6f0('0x9'));var client=jayson[_0xf6f0('0xa')][_0xf6f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a4c9e,_0x1fcfac,_0xb5ac1){return new BPromise(function(_0xa03039,_0x4d7948){return client[_0xf6f0('0xc')](_0x1a4c9e,_0xb5ac1)[_0xf6f0('0xd')](function(_0x4a3328){logger[_0xf6f0('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x1fcfac,'request\x20sent');logger['debug'](_0xf6f0('0xf'),_0x1fcfac,'request\x20sent',JSON[_0xf6f0('0x10')](_0x4a3328));if(_0x4a3328[_0xf6f0('0x11')]){if(_0x4a3328[_0xf6f0('0x11')][_0xf6f0('0x12')]===0x1f4){logger[_0xf6f0('0x11')](_0xf6f0('0x13'),_0x1fcfac,_0x4a3328[_0xf6f0('0x11')][_0xf6f0('0x14')]);return _0x4d7948(_0x4a3328[_0xf6f0('0x11')]['message']);}logger[_0xf6f0('0x11')](_0xf6f0('0x13'),_0x1fcfac,_0x4a3328[_0xf6f0('0x11')][_0xf6f0('0x14')]);return _0xa03039(_0x4a3328['error']['message']);}else{logger[_0xf6f0('0xe')](_0xf6f0('0x13'),_0x1fcfac,_0xf6f0('0x15'));_0xa03039(_0x4a3328[_0xf6f0('0x16')][_0xf6f0('0x14')]);}})[_0xf6f0('0x17')](function(_0x780a97){logger[_0xf6f0('0x11')](_0xf6f0('0x13'),_0x1fcfac,_0x780a97);_0x4d7948(_0x780a97);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b7565b6..baad9dd 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 _0xad2f=['multer','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','put','delete','/:id','destroy','exports'];(function(_0x531ea5,_0x3b4ad9){var _0x1f0228=function(_0x35d990){while(--_0x35d990){_0x531ea5['push'](_0x531ea5['shift']());}};_0x1f0228(++_0x3b4ad9);}(_0xad2f,0x132));var _0xfad2=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xad2f[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0xfad2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfad2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfad2('0x2'));var auth=require(_0xfad2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfad2('0x4'));var controller=require(_0xfad2('0x5'));router[_0xfad2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfad2('0x6')](_0xfad2('0x7'),auth[_0xfad2('0x8')](),controller[_0xfad2('0x9')]);router[_0xfad2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xfad2('0xa')]);router[_0xfad2('0xb')]('/',auth[_0xfad2('0x8')](),controller['create']);router[_0xfad2('0xc')]('/:id',auth[_0xfad2('0x8')](),controller['update']);router[_0xfad2('0xd')](_0xfad2('0xe'),auth[_0xfad2('0x8')](),controller[_0xfad2('0xf')]);module[_0xfad2('0x10')]=router; \ No newline at end of file +var _0xa513=['describe','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xa513,0x1ee));var _0x3a51=function(_0x2eb225,_0xc56bb0){_0x2eb225=_0x2eb225-0x0;var _0xce297b=_0xa513[_0x2eb225];return _0xce297b;};'use strict';var multer=require(_0x3a51('0x0'));var util=require('util');var path=require(_0x3a51('0x1'));var timeout=require(_0x3a51('0x2'));var express=require(_0x3a51('0x3'));var router=express[_0x3a51('0x4')]();var fs_extra=require(_0x3a51('0x5'));var auth=require(_0x3a51('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x3a51('0x7')]('/',auth[_0x3a51('0x8')](),controller[_0x3a51('0x9')]);router[_0x3a51('0x7')]('/describe',auth[_0x3a51('0x8')](),controller[_0x3a51('0xa')]);router[_0x3a51('0x7')](_0x3a51('0xb'),auth[_0x3a51('0x8')](),controller[_0x3a51('0xc')]);router[_0x3a51('0xd')]('/',auth[_0x3a51('0x8')](),controller[_0x3a51('0xe')]);router[_0x3a51('0xf')](_0x3a51('0xb'),auth[_0x3a51('0x8')](),controller[_0x3a51('0x10')]);router[_0x3a51('0x11')]('/:id',auth[_0x3a51('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 01cbcf5..2b4c363 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 _0x592d=['delete','destroy','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','put','/:id','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x592d,0x1cd));var _0xd592=function(_0x54861d,_0x2325db){_0x54861d=_0x54861d-0x0;var _0x3d0afd=_0x592d[_0x54861d];return _0x3d0afd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd592('0x0'));var router=express[_0xd592('0x1')]();var fs_extra=require(_0xd592('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd592('0x3'));var controller=require(_0xd592('0x4'));router[_0xd592('0x5')]('/',auth[_0xd592('0x6')](),controller[_0xd592('0x7')]);router[_0xd592('0x5')]('/:id',auth[_0xd592('0x6')](),controller[_0xd592('0x8')]);router['get'](_0xd592('0x9'),auth[_0xd592('0x6')](),controller['getConfigurations']);router[_0xd592('0x5')](_0xd592('0xa'),auth[_0xd592('0x6')](),controller[_0xd592('0xb')]);router['post']('/',auth[_0xd592('0x6')](),controller['create']);router['post'](_0xd592('0x9'),auth[_0xd592('0x6')](),controller['addConfiguration']);router[_0xd592('0xc')](_0xd592('0xd'),auth['isAuthenticated'](),controller[_0xd592('0xe')]);router[_0xd592('0xf')](_0xd592('0xd'),auth[_0xd592('0x6')](),controller[_0xd592('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe779=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','exports','path','connect-timeout','express'];(function(_0x34d544,_0x3c7820){var _0x4e5afb=function(_0x33cb28){while(--_0x33cb28){_0x34d544['push'](_0x34d544['shift']());}};_0x4e5afb(++_0x3c7820);}(_0xe779,0x7b));var _0x9e77=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe779[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e77('0x0'));var timeout=require(_0x9e77('0x1'));var express=require(_0x9e77('0x2'));var router=express[_0x9e77('0x3')]();var fs_extra=require(_0x9e77('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e77('0x5'));var config=require(_0x9e77('0x6'));var controller=require(_0x9e77('0x7'));router[_0x9e77('0x8')]('/',auth['isAuthenticated'](),controller[_0x9e77('0x9')]);router[_0x9e77('0x8')](_0x9e77('0xa'),auth[_0x9e77('0xb')](),controller[_0x9e77('0xc')]);router[_0x9e77('0x8')](_0x9e77('0xd'),auth['isAuthenticated'](),controller[_0x9e77('0xe')]);router[_0x9e77('0x8')]('/:id/fields',auth[_0x9e77('0xb')](),controller[_0x9e77('0xf')]);router[_0x9e77('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e77('0x10')](_0x9e77('0xd'),auth[_0x9e77('0xb')](),controller[_0x9e77('0x11')]);router[_0x9e77('0x12')](_0x9e77('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9e77('0x13')](_0x9e77('0xa'),auth[_0x9e77('0xb')](),controller['destroy']);module[_0x9e77('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 f734661..5cd1bbc 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 _0x17bf=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x5e0f88,_0x524f02){var _0x211f1b=function(_0x421ce0){while(--_0x421ce0){_0x5e0f88['push'](_0x5e0f88['shift']());}};_0x211f1b(++_0x524f02);}(_0x17bf,0x13b));var _0xf17b=function(_0x28195f,_0x51a295){_0x28195f=_0x28195f-0x0;var _0x546ae1=_0x17bf[_0x28195f];return _0x546ae1;};'use strict';var Sequelize=require(_0xf17b('0x0'));module[_0xf17b('0x1')]={'name':{'type':Sequelize[_0xf17b('0x2')]},'description':{'type':Sequelize[_0xf17b('0x2')]},'username':{'type':Sequelize[_0xf17b('0x2')]},'remoteUri':{'type':Sequelize[_0xf17b('0x2')]},'authType':{'type':Sequelize[_0xf17b('0x3')](_0xf17b('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xf17b('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf17b('0x2')]},'tokenSecret':{'type':Sequelize[_0xf17b('0x2')]},'serverUrl':{'type':Sequelize[_0xf17b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf17b('0x3')](_0xf17b('0x5'),'newTab'),'defaultValue':_0xf17b('0x5')}}; \ No newline at end of file +var _0xb0cb=['exports','STRING','ENUM','basic','integrationTab'];(function(_0x2c53bc,_0x5edba0){var _0x37886c=function(_0x4cb3b7){while(--_0x4cb3b7){_0x2c53bc['push'](_0x2c53bc['shift']());}};_0x37886c(++_0x5edba0);}(_0xb0cb,0x127));var _0xbb0c=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xb0cb[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require('sequelize');module[_0xbb0c('0x0')]={'name':{'type':Sequelize[_0xbb0c('0x1')]},'description':{'type':Sequelize[_0xbb0c('0x1')]},'username':{'type':Sequelize[_0xbb0c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xbb0c('0x2')](_0xbb0c('0x3')),'defaultValue':_0xbb0c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xbb0c('0x1')]},'consumerSecret':{'type':Sequelize[_0xbb0c('0x1')]},'token':{'type':Sequelize[_0xbb0c('0x1')]},'tokenSecret':{'type':Sequelize[_0xbb0c('0x1')]},'serverUrl':{'type':Sequelize[_0xbb0c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbb0c('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 49b3a4c..f896512 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 _0xd693=['substring','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','username','toString','base64','_embedded','entries','active','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','zip-dir','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','DeskAccount','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','params','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','findOne','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x53c493,_0x425909){var _0x1478ab=function(_0x411efa){while(--_0x411efa){_0x53c493['push'](_0x53c493['shift']());}};_0x1478ab(++_0x425909);}(_0xd693,0x82));var _0x3d69=function(_0x169098,_0x55fa34){_0x169098=_0x169098-0x0;var _0x43d9b2=_0xd693[_0x169098];return _0x43d9b2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d69('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3d69('0x1'));var BPromise=require(_0x3d69('0x2'));var Mustache=require(_0x3d69('0x3'));var util=require('util');var path=require('path');var sox=require(_0x3d69('0x4'));var csv=require(_0x3d69('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d69('0x6'));var _=require(_0x3d69('0x7'));var squel=require('squel');var crypto=require(_0x3d69('0x8'));var jsforce=require(_0x3d69('0x9'));var deskjs=require(_0x3d69('0xa'));var toCsv=require(_0x3d69('0x5'));var querystring=require(_0x3d69('0xb'));var Papa=require(_0x3d69('0xc'));var Redis=require(_0x3d69('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3d69('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d69('0xf'));var logger=require(_0x3d69('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x3d69('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d69('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c35e8,_0x133925){_0x133925=_0x133925||0xcc;return function(_0x5afd01){if(_0x5afd01){return _0x4c35e8[_0x3d69('0x13')](_0x133925);}return _0x4c35e8['status'](_0x133925)[_0x3d69('0x14')]();};}function respondWithResult(_0x1aa460,_0x3291af){_0x3291af=_0x3291af||0xc8;return function(_0x2e04a5){if(_0x2e04a5){return _0x1aa460[_0x3d69('0x15')](_0x3291af)[_0x3d69('0x16')](_0x2e04a5);}};}function respondWithFilteredResult(_0x1b0979,_0x4af1d8){return function(_0x5b0d5a){if(_0x5b0d5a){var _0x3327f9=typeof _0x4af1d8['offset']===_0x3d69('0x17')&&typeof _0x4af1d8[_0x3d69('0x18')]===_0x3d69('0x17');var _0x556b07=_0x5b0d5a[_0x3d69('0x19')];var _0x599484=_0x3327f9?0x0:_0x4af1d8[_0x3d69('0x1a')];var _0x2094ae=_0x3327f9?_0x5b0d5a[_0x3d69('0x19')]:_0x4af1d8['offset']+_0x4af1d8[_0x3d69('0x18')];var _0x228c6a;if(_0x2094ae>=_0x556b07){_0x2094ae=_0x556b07;_0x228c6a=0xc8;}else{_0x228c6a=0xce;}_0x1b0979[_0x3d69('0x15')](_0x228c6a);return _0x1b0979[_0x3d69('0x1b')](_0x3d69('0x1c'),_0x599484+'-'+_0x2094ae+'/'+_0x556b07)[_0x3d69('0x16')](_0x5b0d5a);}return null;};}function patchUpdates(_0x5ca2af){return function(_0x4645e9){try{jsonpatch[_0x3d69('0x1d')](_0x4645e9,_0x5ca2af,!![]);}catch(_0x353254){return BPromise['reject'](_0x353254);}return _0x4645e9['save']();};}function saveUpdates(_0x4fdf33,_0x3862ed){return function(_0x2aaa3d){if(_0x2aaa3d){return _0x2aaa3d[_0x3d69('0x1e')](_0x4fdf33)[_0x3d69('0x1f')](function(_0x2a96a1){return _0x2a96a1;});}return null;};}function removeEntity(_0x142c96,_0x1f4798){return function(_0xb4523f){if(_0xb4523f){return _0xb4523f[_0x3d69('0x20')]()[_0x3d69('0x1f')](function(){_0x142c96[_0x3d69('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f74d4,_0xe61c3f){return function(_0x259310){if(!_0x259310){_0x2f74d4[_0x3d69('0x13')](0x194);}return _0x259310;};}function handleError(_0x39fa03,_0x32a188){_0x32a188=_0x32a188||0x1f4;return function(_0x38330a){logger[_0x3d69('0x21')](_0x38330a[_0x3d69('0x22')]);if(_0x38330a[_0x3d69('0x23')]){delete _0x38330a[_0x3d69('0x23')];}_0x39fa03[_0x3d69('0x15')](_0x32a188)[_0x3d69('0x24')](_0x38330a);};}exports[_0x3d69('0x25')]=function(_0x17bef1,_0x2a4cf0){var _0x22a022={},_0x584adb={},_0x51e627={'count':0x0,'rows':[]};var _0x489103=_['map'](db['DeskAccount'][_0x3d69('0x26')],function(_0x39f006){return{'name':_0x39f006[_0x3d69('0x27')],'type':_0x39f006[_0x3d69('0x28')][_0x3d69('0x29')]};});_0x584adb[_0x3d69('0x2a')]=_[_0x3d69('0x2b')](_0x489103,'name');_0x584adb[_0x3d69('0x2c')]=_[_0x3d69('0x2d')](_0x17bef1[_0x3d69('0x2c')]);_0x584adb[_0x3d69('0x2e')]=_['intersection'](_0x584adb['model'],_0x584adb['query']);_0x22a022['attributes']=_['intersection'](_0x584adb[_0x3d69('0x2a')],qs[_0x3d69('0x2f')](_0x17bef1[_0x3d69('0x2c')][_0x3d69('0x2f')]));_0x22a022[_0x3d69('0x30')]=_0x22a022['attributes'][_0x3d69('0x31')]?_0x22a022[_0x3d69('0x30')]:_0x584adb[_0x3d69('0x2a')];if(!_0x17bef1[_0x3d69('0x2c')]['hasOwnProperty'](_0x3d69('0x32'))){_0x22a022[_0x3d69('0x18')]=qs[_0x3d69('0x18')](_0x17bef1[_0x3d69('0x2c')][_0x3d69('0x18')]);_0x22a022[_0x3d69('0x1a')]=qs['offset'](_0x17bef1[_0x3d69('0x2c')][_0x3d69('0x1a')]);}_0x22a022['order']=qs[_0x3d69('0x33')](_0x17bef1[_0x3d69('0x2c')][_0x3d69('0x33')]);_0x22a022[_0x3d69('0x34')]=qs[_0x3d69('0x2e')](_[_0x3d69('0x35')](_0x17bef1[_0x3d69('0x2c')],_0x584adb[_0x3d69('0x2e')]),_0x489103);if(_0x17bef1[_0x3d69('0x2c')]['filter']){_0x22a022[_0x3d69('0x34')]=_[_0x3d69('0x36')](_0x22a022[_0x3d69('0x34')],{'$or':_[_0x3d69('0x2b')](_0x489103,function(_0x5487ec){if(_0x5487ec['type']!==_0x3d69('0x37')){var _0x244d31={};_0x244d31[_0x5487ec['name']]={'$like':'%'+_0x17bef1[_0x3d69('0x2c')][_0x3d69('0x38')]+'%'};return _0x244d31;}})});}_0x22a022=_[_0x3d69('0x36')]({},_0x22a022,_0x17bef1[_0x3d69('0x39')]);var _0x1d42b7={'where':_0x22a022['where']};return db[_0x3d69('0x3a')]['count'](_0x1d42b7)[_0x3d69('0x1f')](function(_0x1fb76b){_0x51e627[_0x3d69('0x19')]=_0x1fb76b;if(_0x17bef1['query'][_0x3d69('0x3b')]){_0x22a022['include']=[{'all':!![]}];}return db[_0x3d69('0x3a')][_0x3d69('0x3c')](_0x22a022);})[_0x3d69('0x1f')](function(_0x31fdbd){_0x51e627[_0x3d69('0x3d')]=_0x31fdbd;return _0x51e627;})[_0x3d69('0x1f')](respondWithFilteredResult(_0x2a4cf0,_0x22a022))[_0x3d69('0x3e')](handleError(_0x2a4cf0,null));};exports[_0x3d69('0x3f')]=function(_0x51ff4e,_0x1f13ad){var _0x5aa74e={'raw':![],'where':{'id':_0x51ff4e['params']['id']}},_0xa055ea={};_0xa055ea[_0x3d69('0x2a')]=_[_0x3d69('0x2d')](db[_0x3d69('0x3a')]['rawAttributes']);_0xa055ea[_0x3d69('0x2c')]=_['keys'](_0x51ff4e['query']);_0xa055ea[_0x3d69('0x2e')]=_[_0x3d69('0x40')](_0xa055ea[_0x3d69('0x2a')],_0xa055ea[_0x3d69('0x2c')]);_0x5aa74e[_0x3d69('0x30')]=_[_0x3d69('0x40')](_0xa055ea[_0x3d69('0x2a')],qs[_0x3d69('0x2f')](_0x51ff4e[_0x3d69('0x2c')][_0x3d69('0x2f')]));_0x5aa74e[_0x3d69('0x30')]=_0x5aa74e['attributes'][_0x3d69('0x31')]?_0x5aa74e[_0x3d69('0x30')]:_0xa055ea[_0x3d69('0x2a')];if(_0x51ff4e[_0x3d69('0x2c')][_0x3d69('0x3b')]){_0x5aa74e[_0x3d69('0x41')]=[{'all':!![]}];}_0x5aa74e=_[_0x3d69('0x36')]({},_0x5aa74e,_0x51ff4e['options']);return db['DeskAccount'][_0x3d69('0x42')](_0x5aa74e)[_0x3d69('0x1f')](handleEntityNotFound(_0x1f13ad,null))['then'](respondWithResult(_0x1f13ad,null))['catch'](handleError(_0x1f13ad,null));};exports[_0x3d69('0x43')]=function(_0x836d33,_0x27ae42){return db[_0x3d69('0x3a')]['create'](_0x836d33['body'],{})[_0x3d69('0x1f')](respondWithResult(_0x27ae42,0xc9))[_0x3d69('0x3e')](handleError(_0x27ae42,null));};exports['update']=function(_0xc8cc55,_0x3eeeb5){if(_0xc8cc55[_0x3d69('0x44')]['id']){delete _0xc8cc55[_0x3d69('0x44')]['id'];}return db[_0x3d69('0x3a')]['find']({'where':{'id':_0xc8cc55[_0x3d69('0x45')]['id']}})[_0x3d69('0x1f')](handleEntityNotFound(_0x3eeeb5,null))[_0x3d69('0x1f')](saveUpdates(_0xc8cc55['body'],null))['then'](respondWithResult(_0x3eeeb5,null))[_0x3d69('0x3e')](handleError(_0x3eeeb5,null));};exports[_0x3d69('0x20')]=function(_0x9a79f4,_0x21b323){return db[_0x3d69('0x3a')]['find']({'where':{'id':_0x9a79f4[_0x3d69('0x45')]['id']}})['then'](handleEntityNotFound(_0x21b323,null))[_0x3d69('0x1f')](removeEntity(_0x21b323,null))[_0x3d69('0x3e')](handleError(_0x21b323,null));};exports['getConfigurations']=function(_0x112fe1,_0x1cff01,_0x6a2da0){var _0x2fbf2c={};var _0x547456={};var _0x34fb51;var _0x57d88b;return db['DeskAccount']['findOne']({'where':{'id':_0x112fe1['params']['id']}})[_0x3d69('0x1f')](handleEntityNotFound(_0x1cff01,null))['then'](function(_0x2a6a29){if(_0x2a6a29){_0x34fb51=_0x2a6a29;_0x547456[_0x3d69('0x2a')]=_['keys'](db['DeskConfiguration'][_0x3d69('0x26')]);_0x547456['query']=_['keys'](_0x112fe1[_0x3d69('0x2c')]);_0x547456[_0x3d69('0x2e')]=_['intersection'](_0x547456[_0x3d69('0x2a')],_0x547456[_0x3d69('0x2c')]);_0x2fbf2c[_0x3d69('0x30')]=_['intersection'](_0x547456[_0x3d69('0x2a')],qs[_0x3d69('0x2f')](_0x112fe1['query'][_0x3d69('0x2f')]));_0x2fbf2c['attributes']=_0x2fbf2c[_0x3d69('0x30')][_0x3d69('0x31')]?_0x2fbf2c['attributes']:_0x547456[_0x3d69('0x2a')];_0x2fbf2c['order']=qs[_0x3d69('0x33')](_0x112fe1[_0x3d69('0x2c')][_0x3d69('0x33')]);_0x2fbf2c[_0x3d69('0x34')]=qs['filters'](_[_0x3d69('0x35')](_0x112fe1[_0x3d69('0x2c')],_0x547456['filters']));if(_0x112fe1[_0x3d69('0x2c')][_0x3d69('0x38')]){_0x2fbf2c[_0x3d69('0x34')]=_[_0x3d69('0x36')](_0x2fbf2c[_0x3d69('0x34')],{'$or':_[_0x3d69('0x2b')](_0x2fbf2c['attributes'],function(_0x49b2ca){var _0x14d324={};_0x14d324[_0x49b2ca]={'$like':'%'+_0x112fe1[_0x3d69('0x2c')][_0x3d69('0x38')]+'%'};return _0x14d324;})});}_0x2fbf2c=_['merge']({},_0x2fbf2c,_0x112fe1[_0x3d69('0x39')]);return _0x34fb51[_0x3d69('0x46')](_0x2fbf2c);}})[_0x3d69('0x1f')](function(_0x1cf4b8){if(_0x1cf4b8){_0x57d88b=_0x1cf4b8[_0x3d69('0x31')];if(!_0x112fe1['query'][_0x3d69('0x47')]('nolimit')){_0x2fbf2c[_0x3d69('0x18')]=qs[_0x3d69('0x18')](_0x112fe1[_0x3d69('0x2c')][_0x3d69('0x18')]);_0x2fbf2c[_0x3d69('0x1a')]=qs[_0x3d69('0x1a')](_0x112fe1['query']['offset']);}return _0x34fb51[_0x3d69('0x46')](_0x2fbf2c);}})[_0x3d69('0x1f')](function(_0x560d24){if(_0x560d24){return _0x560d24?{'count':_0x57d88b,'rows':_0x560d24}:null;}})[_0x3d69('0x1f')](respondWithResult(_0x1cff01,null))[_0x3d69('0x3e')](handleError(_0x1cff01,null));};exports[_0x3d69('0x48')]=function(_0x5b83b4,_0x58715a,_0x3a2e0e){if(_0x5b83b4[_0x3d69('0x44')]['id']){delete _0x5b83b4['body']['id'];}return db[_0x3d69('0x3a')]['findOne']({'where':{'id':_0x5b83b4['params']['id']}})['then'](handleEntityNotFound(_0x58715a,null))[_0x3d69('0x1f')](function(_0x490111){if(_0x490111){_0x5b83b4['body'][_0x3d69('0x49')]=_0x490111['id'];_0x5b83b4[_0x3d69('0x44')][_0x3d69('0x4a')]=integrations[_0x3d69('0x4b')](_0x5b83b4[_0x3d69('0x44')]['channel'],_0x5b83b4[_0x3d69('0x44')][_0x3d69('0x28')]);_0x5b83b4[_0x3d69('0x44')][_0x3d69('0x4c')]=integrations[_0x3d69('0x4d')](_0x5b83b4[_0x3d69('0x44')][_0x3d69('0x4e')],_0x5b83b4[_0x3d69('0x44')][_0x3d69('0x28')]);return db['DeskConfiguration'][_0x3d69('0x43')](_0x5b83b4[_0x3d69('0x44')],{'include':[{'model':db[_0x3d69('0x4f')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x3d69('0x4c')}]});}return null;})[_0x3d69('0x1f')](respondWithResult(_0x58715a,null))[_0x3d69('0x3e')](handleError(_0x58715a,null));};exports[_0x3d69('0x50')]=function(_0x4bd6c8,_0xc86459,_0x5a1f14){var _0x1378a8=[{'name':_0x3d69('0x51'),'label':_0x3d69('0x51'),'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 _0x546456='';return db[_0x3d69('0x3a')][_0x3d69('0x52')]({'where':{'id':_0x4bd6c8[_0x3d69('0x45')]['id']},'attributes':['id',_0x3d69('0x53'),_0x3d69('0x54'),'username',_0x3d69('0x55'),_0x3d69('0x56'),_0x3d69('0x57'),_0x3d69('0x58'),_0x3d69('0x59')]})['then'](handleEntityNotFound(_0xc86459,null))[_0x3d69('0x1f')](function(_0x3bd68e){if(_0x3bd68e){_0x546456=_0x3bd68e[_0x3d69('0x53')];var _0x48a3e8=_0x546456['slice'](-0x1);if(_0x48a3e8==='/'){_0x546456=_0x546456[_0x3d69('0x5a')](0x0,_0x546456['lastIndexOf'](_0x48a3e8));}var _0x138435={'method':_0x3d69('0x5b'),'uri':util[_0x3d69('0x5c')](_0x3d69('0x5d'),_0x546456),'headers':{'Content-Type':_0x3d69('0x5e'),'Accept':_0x3d69('0x5e')},'json':!![]};if(_0x3bd68e[_0x3d69('0x54')]===_0x3d69('0x5f')){_0x138435[_0x3d69('0x60')]['Authorization']=util[_0x3d69('0x5c')](_0x3d69('0x61'),new Buffer(util[_0x3d69('0x5c')](_0x3d69('0x62'),_0x3bd68e[_0x3d69('0x63')],_0x3bd68e[_0x3d69('0x55')]))[_0x3d69('0x64')](_0x3d69('0x65')));}return rp(_0x138435)['then'](function(_0x212c7f){return _0x1378a8['concat'](_['map'](_0x212c7f[_0x3d69('0x66')][_0x3d69('0x67')],function(_0x4c74b6){return{'id':_0x4c74b6['name'],'name':_0x4c74b6['name'],'type':_0x4c74b6['type'],'active':_0x4c74b6[_0x3d69('0x68')],'label':_0x4c74b6['label'],'custom':!![]};}));});}})[_0x3d69('0x1f')](function(_0x20f23a){return{'count':_0x20f23a['length'],'rows':_0x20f23a};})[_0x3d69('0x1f')](respondWithResult(_0xc86459,null))[_0x3d69('0x3e')](function(_0x518177){var _0x42888e=_0x4bd6c8[_0x3d69('0x2c')][_0x3d69('0x69')]?0x1f4:_0x518177['statusCode']||0x1f4;logger[_0x3d69('0x21')](_0x3d69('0x6a'),_0x3d69('0x50'),_0x42888e,JSON[_0x3d69('0x6b')](_0x518177));delete _0x518177[_0x3d69('0x23')];if(_0x42888e===0x191){_0x42888e=0x190;}_0xc86459[_0x3d69('0x15')](_0x42888e)[_0x3d69('0x24')](_0x4bd6c8[_0x3d69('0x2c')][_0x3d69('0x69')]?{'message':_0x3d69('0x6c'),'statusCode':_0x518177[_0x3d69('0x6d')]}:_0x518177);});}; \ No newline at end of file +var _0xe671=['Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','reject','update','then','destroy','error','stack','name','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers'];(function(_0x1e2d4e,_0xea6aea){var _0x4dd019=function(_0x4c390e){while(--_0x4c390e){_0x1e2d4e['push'](_0x1e2d4e['shift']());}};_0x4dd019(++_0xea6aea);}(_0xe671,0xf1));var _0x1e67=function(_0x5a811b,_0x183d38){_0x5a811b=_0x5a811b-0x0;var _0x3ea72e=_0xe671[_0x5a811b];return _0x3ea72e;};'use strict';var emlformat=require(_0x1e67('0x0'));var rimraf=require(_0x1e67('0x1'));var zipdir=require(_0x1e67('0x2'));var jsonpatch=require(_0x1e67('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e67('0x4'));var Mustache=require(_0x1e67('0x5'));var util=require(_0x1e67('0x6'));var path=require(_0x1e67('0x7'));var sox=require(_0x1e67('0x8'));var csv=require(_0x1e67('0x9'));var ejs=require(_0x1e67('0xa'));var fs=require('fs');var fs_extra=require(_0x1e67('0xb'));var _=require(_0x1e67('0xc'));var squel=require(_0x1e67('0xd'));var crypto=require(_0x1e67('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1e67('0xf'));var toCsv=require(_0x1e67('0x9'));var querystring=require(_0x1e67('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e67('0x11'));var authService=require(_0x1e67('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1e67('0x13'));var hardwareService=require(_0x1e67('0x14'));var logger=require(_0x1e67('0x15'))(_0x1e67('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1e67('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4da707,_0x4eb061){_0x4eb061=_0x4eb061||0xcc;return function(_0x45ffdd){if(_0x45ffdd){return _0x4da707[_0x1e67('0x18')](_0x4eb061);}return _0x4da707[_0x1e67('0x19')](_0x4eb061)[_0x1e67('0x1a')]();};}function respondWithResult(_0x573e59,_0x1569e5){_0x1569e5=_0x1569e5||0xc8;return function(_0x12a20a){if(_0x12a20a){return _0x573e59['status'](_0x1569e5)[_0x1e67('0x1b')](_0x12a20a);}};}function respondWithFilteredResult(_0x4d11c0,_0x2f51ce){return function(_0x8d7d16){if(_0x8d7d16){var _0xcf0ea8=typeof _0x2f51ce[_0x1e67('0x1c')]===_0x1e67('0x1d')&&typeof _0x2f51ce['limit']===_0x1e67('0x1d');var _0x5d664a=_0x8d7d16[_0x1e67('0x1e')];var _0x3bfe16=_0xcf0ea8?0x0:_0x2f51ce['offset'];var _0x49ec5d=_0xcf0ea8?_0x8d7d16['count']:_0x2f51ce[_0x1e67('0x1c')]+_0x2f51ce[_0x1e67('0x1f')];var _0x15168f;if(_0x49ec5d>=_0x5d664a){_0x49ec5d=_0x5d664a;_0x15168f=0xc8;}else{_0x15168f=0xce;}_0x4d11c0[_0x1e67('0x19')](_0x15168f);return _0x4d11c0['set']('Content-Range',_0x3bfe16+'-'+_0x49ec5d+'/'+_0x5d664a)[_0x1e67('0x1b')](_0x8d7d16);}return null;};}function patchUpdates(_0xe285d9){return function(_0x300f43){try{jsonpatch['apply'](_0x300f43,_0xe285d9,!![]);}catch(_0x6ac7f3){return BPromise[_0x1e67('0x20')](_0x6ac7f3);}return _0x300f43['save']();};}function saveUpdates(_0x16f797,_0x32dfa0){return function(_0x15b369){if(_0x15b369){return _0x15b369[_0x1e67('0x21')](_0x16f797)[_0x1e67('0x22')](function(_0x547906){return _0x547906;});}return null;};}function removeEntity(_0x606b2e,_0x86ba3b){return function(_0x15a32e){if(_0x15a32e){return _0x15a32e[_0x1e67('0x23')]()['then'](function(){_0x606b2e['status'](0xcc)[_0x1e67('0x1a')]();});}};}function handleEntityNotFound(_0x29d880,_0x3d9c03){return function(_0x3a17a6){if(!_0x3a17a6){_0x29d880[_0x1e67('0x18')](0x194);}return _0x3a17a6;};}function handleError(_0xcfd625,_0x1671f8){_0x1671f8=_0x1671f8||0x1f4;return function(_0x1b3229){logger[_0x1e67('0x24')](_0x1b3229[_0x1e67('0x25')]);if(_0x1b3229[_0x1e67('0x26')]){delete _0x1b3229[_0x1e67('0x26')];}_0xcfd625['status'](_0x1671f8)['send'](_0x1b3229);};}exports[_0x1e67('0x27')]=function(_0x4ec803,_0x206f6b){var _0x3ec45={},_0x29f625={},_0x56637e={'count':0x0,'rows':[]};var _0x2154a3=_[_0x1e67('0x28')](db[_0x1e67('0x29')]['rawAttributes'],function(_0x1cc43d){return{'name':_0x1cc43d[_0x1e67('0x2a')],'type':_0x1cc43d[_0x1e67('0x2b')][_0x1e67('0x2c')]};});_0x29f625[_0x1e67('0x2d')]=_['map'](_0x2154a3,'name');_0x29f625[_0x1e67('0x2e')]=_[_0x1e67('0x2f')](_0x4ec803['query']);_0x29f625[_0x1e67('0x30')]=_[_0x1e67('0x31')](_0x29f625[_0x1e67('0x2d')],_0x29f625[_0x1e67('0x2e')]);_0x3ec45[_0x1e67('0x32')]=_[_0x1e67('0x31')](_0x29f625[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x4ec803['query'][_0x1e67('0x33')]));_0x3ec45['attributes']=_0x3ec45[_0x1e67('0x32')][_0x1e67('0x34')]?_0x3ec45['attributes']:_0x29f625[_0x1e67('0x2d')];if(!_0x4ec803[_0x1e67('0x2e')][_0x1e67('0x35')](_0x1e67('0x36'))){_0x3ec45['limit']=qs[_0x1e67('0x1f')](_0x4ec803[_0x1e67('0x2e')]['limit']);_0x3ec45[_0x1e67('0x1c')]=qs['offset'](_0x4ec803[_0x1e67('0x2e')]['offset']);}_0x3ec45[_0x1e67('0x37')]=qs[_0x1e67('0x38')](_0x4ec803[_0x1e67('0x2e')][_0x1e67('0x38')]);_0x3ec45[_0x1e67('0x39')]=qs[_0x1e67('0x30')](_[_0x1e67('0x3a')](_0x4ec803[_0x1e67('0x2e')],_0x29f625[_0x1e67('0x30')]),_0x2154a3);if(_0x4ec803[_0x1e67('0x2e')]['filter']){_0x3ec45[_0x1e67('0x39')]=_[_0x1e67('0x3b')](_0x3ec45[_0x1e67('0x39')],{'$or':_['map'](_0x2154a3,function(_0x2046a6){if(_0x2046a6[_0x1e67('0x2b')]!==_0x1e67('0x3c')){var _0x1d4be7={};_0x1d4be7[_0x2046a6[_0x1e67('0x26')]]={'$like':'%'+_0x4ec803[_0x1e67('0x2e')][_0x1e67('0x3d')]+'%'};return _0x1d4be7;}})});}_0x3ec45=_[_0x1e67('0x3b')]({},_0x3ec45,_0x4ec803[_0x1e67('0x3e')]);var _0x383d8e={'where':_0x3ec45[_0x1e67('0x39')]};return db[_0x1e67('0x29')][_0x1e67('0x1e')](_0x383d8e)[_0x1e67('0x22')](function(_0x44af0b){_0x56637e[_0x1e67('0x1e')]=_0x44af0b;if(_0x4ec803[_0x1e67('0x2e')][_0x1e67('0x3f')]){_0x3ec45['include']=[{'all':!![]}];}return db['DeskAccount'][_0x1e67('0x40')](_0x3ec45);})['then'](function(_0x3bf01a){_0x56637e[_0x1e67('0x41')]=_0x3bf01a;return _0x56637e;})[_0x1e67('0x22')](respondWithFilteredResult(_0x206f6b,_0x3ec45))[_0x1e67('0x42')](handleError(_0x206f6b,null));};exports['show']=function(_0x51ff9a,_0x45079e){var _0xc144af={'raw':![],'where':{'id':_0x51ff9a[_0x1e67('0x43')]['id']}},_0x5b9585={};_0x5b9585[_0x1e67('0x2d')]=_[_0x1e67('0x2f')](db[_0x1e67('0x29')][_0x1e67('0x44')]);_0x5b9585[_0x1e67('0x2e')]=_['keys'](_0x51ff9a[_0x1e67('0x2e')]);_0x5b9585['filters']=_[_0x1e67('0x31')](_0x5b9585['model'],_0x5b9585[_0x1e67('0x2e')]);_0xc144af['attributes']=_[_0x1e67('0x31')](_0x5b9585[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x51ff9a['query'][_0x1e67('0x33')]));_0xc144af[_0x1e67('0x32')]=_0xc144af[_0x1e67('0x32')]['length']?_0xc144af[_0x1e67('0x32')]:_0x5b9585[_0x1e67('0x2d')];if(_0x51ff9a[_0x1e67('0x2e')]['includeAll']){_0xc144af[_0x1e67('0x45')]=[{'all':!![]}];}_0xc144af=_['merge']({},_0xc144af,_0x51ff9a['options']);return db[_0x1e67('0x29')][_0x1e67('0x46')](_0xc144af)[_0x1e67('0x22')](handleEntityNotFound(_0x45079e,null))['then'](respondWithResult(_0x45079e,null))[_0x1e67('0x42')](handleError(_0x45079e,null));};exports[_0x1e67('0x47')]=function(_0x470aeb,_0x544840){return db['DeskAccount']['create'](_0x470aeb[_0x1e67('0x48')],{})[_0x1e67('0x22')](respondWithResult(_0x544840,0xc9))['catch'](handleError(_0x544840,null));};exports[_0x1e67('0x21')]=function(_0x33090d,_0x42b99b){if(_0x33090d[_0x1e67('0x48')]['id']){delete _0x33090d[_0x1e67('0x48')]['id'];}return db[_0x1e67('0x29')][_0x1e67('0x46')]({'where':{'id':_0x33090d[_0x1e67('0x43')]['id']}})[_0x1e67('0x22')](handleEntityNotFound(_0x42b99b,null))[_0x1e67('0x22')](saveUpdates(_0x33090d[_0x1e67('0x48')],null))[_0x1e67('0x22')](respondWithResult(_0x42b99b,null))[_0x1e67('0x42')](handleError(_0x42b99b,null));};exports[_0x1e67('0x23')]=function(_0x39b193,_0x13c35f){return db[_0x1e67('0x29')][_0x1e67('0x46')]({'where':{'id':_0x39b193[_0x1e67('0x43')]['id']}})[_0x1e67('0x22')](handleEntityNotFound(_0x13c35f,null))[_0x1e67('0x22')](removeEntity(_0x13c35f,null))[_0x1e67('0x42')](handleError(_0x13c35f,null));};exports[_0x1e67('0x49')]=function(_0x34b137,_0x2c12f0,_0x6ad3ea){var _0x3585f8={};var _0x3bc309={};var _0x339e24;var _0x4100bb;return db[_0x1e67('0x29')][_0x1e67('0x4a')]({'where':{'id':_0x34b137['params']['id']}})[_0x1e67('0x22')](handleEntityNotFound(_0x2c12f0,null))[_0x1e67('0x22')](function(_0x41467a){if(_0x41467a){_0x339e24=_0x41467a;_0x3bc309['model']=_[_0x1e67('0x2f')](db[_0x1e67('0x4b')][_0x1e67('0x44')]);_0x3bc309['query']=_[_0x1e67('0x2f')](_0x34b137[_0x1e67('0x2e')]);_0x3bc309[_0x1e67('0x30')]=_['intersection'](_0x3bc309[_0x1e67('0x2d')],_0x3bc309[_0x1e67('0x2e')]);_0x3585f8[_0x1e67('0x32')]=_[_0x1e67('0x31')](_0x3bc309[_0x1e67('0x2d')],qs['fields'](_0x34b137[_0x1e67('0x2e')][_0x1e67('0x33')]));_0x3585f8[_0x1e67('0x32')]=_0x3585f8[_0x1e67('0x32')][_0x1e67('0x34')]?_0x3585f8[_0x1e67('0x32')]:_0x3bc309[_0x1e67('0x2d')];_0x3585f8[_0x1e67('0x37')]=qs[_0x1e67('0x38')](_0x34b137[_0x1e67('0x2e')][_0x1e67('0x38')]);_0x3585f8[_0x1e67('0x39')]=qs[_0x1e67('0x30')](_[_0x1e67('0x3a')](_0x34b137[_0x1e67('0x2e')],_0x3bc309[_0x1e67('0x30')]));if(_0x34b137[_0x1e67('0x2e')][_0x1e67('0x3d')]){_0x3585f8[_0x1e67('0x39')]=_[_0x1e67('0x3b')](_0x3585f8[_0x1e67('0x39')],{'$or':_[_0x1e67('0x28')](_0x3585f8['attributes'],function(_0x505363){var _0x3b75d9={};_0x3b75d9[_0x505363]={'$like':'%'+_0x34b137[_0x1e67('0x2e')][_0x1e67('0x3d')]+'%'};return _0x3b75d9;})});}_0x3585f8=_['merge']({},_0x3585f8,_0x34b137[_0x1e67('0x3e')]);return _0x339e24[_0x1e67('0x49')](_0x3585f8);}})[_0x1e67('0x22')](function(_0x4758ac){if(_0x4758ac){_0x4100bb=_0x4758ac[_0x1e67('0x34')];if(!_0x34b137[_0x1e67('0x2e')][_0x1e67('0x35')]('nolimit')){_0x3585f8[_0x1e67('0x1f')]=qs[_0x1e67('0x1f')](_0x34b137[_0x1e67('0x2e')][_0x1e67('0x1f')]);_0x3585f8['offset']=qs['offset'](_0x34b137[_0x1e67('0x2e')]['offset']);}return _0x339e24[_0x1e67('0x49')](_0x3585f8);}})[_0x1e67('0x22')](function(_0x225019){if(_0x225019){return _0x225019?{'count':_0x4100bb,'rows':_0x225019}:null;}})['then'](respondWithResult(_0x2c12f0,null))[_0x1e67('0x42')](handleError(_0x2c12f0,null));};exports[_0x1e67('0x4c')]=function(_0x5cd417,_0x1bbad5,_0x4c2423){if(_0x5cd417[_0x1e67('0x48')]['id']){delete _0x5cd417['body']['id'];}return db[_0x1e67('0x29')]['findOne']({'where':{'id':_0x5cd417['params']['id']}})[_0x1e67('0x22')](handleEntityNotFound(_0x1bbad5,null))[_0x1e67('0x22')](function(_0x13ead9){if(_0x13ead9){_0x5cd417['body'][_0x1e67('0x4d')]=_0x13ead9['id'];_0x5cd417[_0x1e67('0x48')][_0x1e67('0x4e')]=integrations[_0x1e67('0x4f')](_0x5cd417[_0x1e67('0x48')][_0x1e67('0x50')],_0x5cd417[_0x1e67('0x48')][_0x1e67('0x2b')]);_0x5cd417[_0x1e67('0x48')][_0x1e67('0x51')]=integrations['getDescriptions'](_0x5cd417[_0x1e67('0x48')][_0x1e67('0x50')],_0x5cd417[_0x1e67('0x48')][_0x1e67('0x2b')]);return db['DeskConfiguration'][_0x1e67('0x47')](_0x5cd417['body'],{'include':[{'model':db['DeskField'],'as':_0x1e67('0x4e')},{'model':db[_0x1e67('0x52')],'as':_0x1e67('0x51')}]});}return null;})[_0x1e67('0x22')](respondWithResult(_0x1bbad5,null))[_0x1e67('0x42')](handleError(_0x1bbad5,null));};exports[_0x1e67('0x53')]=function(_0x4ff775,_0x456d84,_0x95b6da){var _0x5e5061=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4d7135='';return db[_0x1e67('0x29')][_0x1e67('0x4a')]({'where':{'id':_0x4ff775[_0x1e67('0x43')]['id']},'attributes':['id',_0x1e67('0x54'),_0x1e67('0x55'),_0x1e67('0x56'),_0x1e67('0x57'),_0x1e67('0x58'),_0x1e67('0x59'),_0x1e67('0x5a'),_0x1e67('0x5b')]})[_0x1e67('0x22')](handleEntityNotFound(_0x456d84,null))[_0x1e67('0x22')](function(_0x15ce5b){if(_0x15ce5b){_0x4d7135=_0x15ce5b[_0x1e67('0x54')];var _0x2e7bf6=_0x4d7135[_0x1e67('0x5c')](-0x1);if(_0x2e7bf6==='/'){_0x4d7135=_0x4d7135[_0x1e67('0x5d')](0x0,_0x4d7135[_0x1e67('0x5e')](_0x2e7bf6));}var _0x4cdf58={'method':_0x1e67('0x5f'),'uri':util[_0x1e67('0x60')](_0x1e67('0x61'),_0x4d7135),'headers':{'Content-Type':'application/json','Accept':_0x1e67('0x62')},'json':!![]};if(_0x15ce5b[_0x1e67('0x55')]===_0x1e67('0x63')){_0x4cdf58[_0x1e67('0x64')]['Authorization']=util[_0x1e67('0x60')](_0x1e67('0x65'),new Buffer(util[_0x1e67('0x60')](_0x1e67('0x66'),_0x15ce5b[_0x1e67('0x56')],_0x15ce5b['password']))[_0x1e67('0x67')](_0x1e67('0x68')));}return rp(_0x4cdf58)[_0x1e67('0x22')](function(_0x27636a){return _0x5e5061[_0x1e67('0x69')](_[_0x1e67('0x28')](_0x27636a[_0x1e67('0x6a')][_0x1e67('0x6b')],function(_0x484b5e){return{'id':_0x484b5e[_0x1e67('0x26')],'name':_0x484b5e[_0x1e67('0x26')],'type':_0x484b5e['type'],'active':_0x484b5e[_0x1e67('0x6c')],'label':_0x484b5e[_0x1e67('0x6d')],'custom':!![]};}));});}})[_0x1e67('0x22')](function(_0x5f36e0){return{'count':_0x5f36e0[_0x1e67('0x34')],'rows':_0x5f36e0};})[_0x1e67('0x22')](respondWithResult(_0x456d84,null))[_0x1e67('0x42')](function(_0x27b446){var _0x337ff2=_0x4ff775[_0x1e67('0x2e')][_0x1e67('0x6e')]?0x1f4:_0x27b446[_0x1e67('0x6f')]||0x1f4;logger[_0x1e67('0x24')](_0x1e67('0x70'),_0x1e67('0x53'),_0x337ff2,JSON[_0x1e67('0x71')](_0x27b446));delete _0x27b446['name'];if(_0x337ff2===0x191){_0x337ff2=0x190;}_0x456d84['status'](_0x337ff2)['send'](_0x4ff775[_0x1e67('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x27b446[_0x1e67('0x6f')]}:_0x27b446);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 78098dc..99fce40 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 _0xf308=['path','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf308,0x141));var _0x8f30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf308[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x8f30('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8f30('0x1'));var rp=require(_0x8f30('0x2'));var fs=require('fs');var path=require(_0x8f30('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f30('0x4'));var integrations=require(_0x8f30('0x5'));module[_0x8f30('0x6')]=function(_0x6ba4c3,_0x3ef25e){return _0x6ba4c3[_0x8f30('0x7')]('DeskAccount',attributes,{'tableName':_0x8f30('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x088a=['define','DeskAccount','lodash','util','../../config/logger','api','moment','path','rimraf','./intDeskAccount.attributes','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x088a,0x1ba));var _0xa088=function(_0x3eaf1d,_0x3c0d2a){_0x3eaf1d=_0x3eaf1d-0x0;var _0x35b471=_0x088a[_0x3eaf1d];return _0x35b471;};'use strict';var _=require(_0xa088('0x0'));var util=require(_0xa088('0x1'));var logger=require(_0xa088('0x2'))(_0xa088('0x3'));var moment=require(_0xa088('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa088('0x5'));var rimraf=require(_0xa088('0x6'));var config=require('../../config/environment');var attributes=require(_0xa088('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xa088('0x8')]=function(_0x23294d,_0x5f8e64){return _0x23294d[_0xa088('0x9')](_0xa088('0xa'),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 2e9f4ca..f602231 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 _0x47ac=['GetDeskAccount','stringify','catch','ShowDeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x90f6cf,_0x579861){var _0x3029ff=function(_0x37fccc){while(--_0x37fccc){_0x90f6cf['push'](_0x90f6cf['shift']());}};_0x3029ff(++_0x579861);}(_0x47ac,0x70));var _0xc47a=function(_0x290d65,_0x32ef9c){_0x290d65=_0x290d65-0x0;var _0x1aa903=_0x47ac[_0x290d65];return _0x1aa903;};'use strict';var _=require(_0xc47a('0x0'));var util=require(_0xc47a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc47a('0x2'));var fs=require('fs');var Redis=require(_0xc47a('0x3'));var db=require(_0xc47a('0x4'))['db'];var utils=require(_0xc47a('0x5'));var logger=require('../../config/logger')(_0xc47a('0x6'));var config=require(_0xc47a('0x7'));var jayson=require(_0xc47a('0x8'));var client=jayson[_0xc47a('0x9')][_0xc47a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f78cc,_0x57ca54,_0x17a82b){return new BPromise(function(_0x1aee5e,_0xa7e243){return client[_0xc47a('0xb')](_0x1f78cc,_0x17a82b)[_0xc47a('0xc')](function(_0x397a4c){logger[_0xc47a('0xd')](_0xc47a('0xe'),_0x57ca54,_0xc47a('0xf'));logger[_0xc47a('0x10')](_0xc47a('0x11'),_0x57ca54,_0xc47a('0xf'),JSON['stringify'](_0x397a4c));if(_0x397a4c[_0xc47a('0x12')]){if(_0x397a4c[_0xc47a('0x12')][_0xc47a('0x13')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x57ca54,_0x397a4c[_0xc47a('0x12')][_0xc47a('0x14')]);return _0xa7e243(_0x397a4c['error']['message']);}logger['error'](_0xc47a('0xe'),_0x57ca54,_0x397a4c[_0xc47a('0x12')][_0xc47a('0x14')]);return _0x1aee5e(_0x397a4c[_0xc47a('0x12')][_0xc47a('0x14')]);}else{logger[_0xc47a('0xd')](_0xc47a('0xe'),_0x57ca54,_0xc47a('0xf'));_0x1aee5e(_0x397a4c[_0xc47a('0x15')][_0xc47a('0x14')]);}})['catch'](function(_0x25cfef){logger[_0xc47a('0x12')](_0xc47a('0xe'),_0x57ca54,_0x25cfef);_0xa7e243(_0x25cfef);});});}exports['GetDeskAccount']=function(_0x34dc34){var _0x1415e2=this;return new Promise(function(_0x5c557e,_0x302638){return db[_0xc47a('0x16')][_0xc47a('0x17')]({'raw':_0x34dc34[_0xc47a('0x18')]?_0x34dc34['options'][_0xc47a('0x19')]===undefined?!![]:![]:!![],'where':_0x34dc34[_0xc47a('0x18')]?_0x34dc34['options'][_0xc47a('0x1a')]||null:null,'attributes':_0x34dc34[_0xc47a('0x18')]?_0x34dc34[_0xc47a('0x18')][_0xc47a('0x1b')]||null:null,'limit':_0x34dc34['options']?_0x34dc34[_0xc47a('0x18')][_0xc47a('0x1c')]||null:null,'include':_0x34dc34[_0xc47a('0x18')]?_0x34dc34[_0xc47a('0x18')]['include']?_['map'](_0x34dc34[_0xc47a('0x18')]['include'],function(_0x54a5eb){return{'model':db[_0x54a5eb['model']],'as':_0x54a5eb['as'],'attributes':_0x54a5eb['attributes'],'include':_0x54a5eb[_0xc47a('0x1d')]?_[_0xc47a('0x1e')](_0x54a5eb['include'],function(_0x20450b){return{'model':db[_0x20450b[_0xc47a('0x1f')]],'as':_0x20450b['as'],'attributes':_0x20450b[_0xc47a('0x1b')],'include':_0x20450b[_0xc47a('0x1d')]?_[_0xc47a('0x1e')](_0x20450b[_0xc47a('0x1d')],function(_0x46c04e){return{'model':db[_0x46c04e[_0xc47a('0x1f')]],'as':_0x46c04e['as'],'attributes':_0x46c04e[_0xc47a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc47a('0xc')](function(_0x34aff4){logger['info'](_0xc47a('0x20'),_0x34dc34);logger['debug']('GetDeskAccount',_0x34dc34,JSON[_0xc47a('0x21')](_0x34aff4));_0x5c557e(_0x34aff4);})[_0xc47a('0x22')](function(_0x5011b7){logger[_0xc47a('0x12')](_0xc47a('0x20'),_0x5011b7[_0xc47a('0x14')],_0x34dc34);_0x302638(_0x1415e2[_0xc47a('0x12')](0x1f4,_0x5011b7[_0xc47a('0x14')]));});});};exports[_0xc47a('0x23')]=function(_0x59a729){var _0x53f08b=this;return new Promise(function(_0x3a8fe1,_0x2767d8){return db['DeskAccount']['find']({'raw':_0x59a729[_0xc47a('0x18')]?_0x59a729[_0xc47a('0x18')][_0xc47a('0x19')]===undefined?!![]:![]:!![],'where':_0x59a729['options']?_0x59a729[_0xc47a('0x18')][_0xc47a('0x1a')]||null:null,'attributes':_0x59a729[_0xc47a('0x18')]?_0x59a729[_0xc47a('0x18')]['attributes']||null:null,'include':_0x59a729[_0xc47a('0x18')]?_0x59a729['options'][_0xc47a('0x1d')]?_[_0xc47a('0x1e')](_0x59a729[_0xc47a('0x18')][_0xc47a('0x1d')],function(_0x35efb5){return{'model':db[_0x35efb5[_0xc47a('0x1f')]],'as':_0x35efb5['as'],'attributes':_0x35efb5[_0xc47a('0x1b')],'include':_0x35efb5[_0xc47a('0x1d')]?_[_0xc47a('0x1e')](_0x35efb5[_0xc47a('0x1d')],function(_0x4e07ed){return{'model':db[_0x4e07ed['model']],'as':_0x4e07ed['as'],'attributes':_0x4e07ed[_0xc47a('0x1b')],'include':_0x4e07ed[_0xc47a('0x1d')]?_['map'](_0x4e07ed[_0xc47a('0x1d')],function(_0x3ed07e){return{'model':db[_0x3ed07e['model']],'as':_0x3ed07e['as'],'attributes':_0x3ed07e[_0xc47a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc47a('0xc')](function(_0x24990e){logger[_0xc47a('0xd')]('ShowDeskAccount',_0x59a729);logger[_0xc47a('0x10')]('ShowDeskAccount',_0x59a729,JSON[_0xc47a('0x21')](_0x24990e));_0x3a8fe1(_0x24990e);})[_0xc47a('0x22')](function(_0x4ac008){logger[_0xc47a('0x12')](_0xc47a('0x23'),_0x4ac008[_0xc47a('0x14')],_0x59a729);_0x2767d8(_0x53f08b[_0xc47a('0x12')](0x1f4,_0x4ac008[_0xc47a('0x14')]));});});}; \ No newline at end of file +var _0xfc43=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','request\x20sent','result','GetDeskAccount','DeskAccount','findAll','options','raw','limit','map','include','attributes','catch','where','model','ShowDeskAccount','lodash'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0xfc43,0xa9));var _0x3fc4=function(_0x6a55c9,_0x93f7d6){_0x6a55c9=_0x6a55c9-0x0;var _0x27ae83=_0xfc43[_0x6a55c9];return _0x27ae83;};'use strict';var _=require(_0x3fc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3fc4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc4('0x2'));var db=require(_0x3fc4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fc4('0x4'))(_0x3fc4('0x5'));var config=require(_0x3fc4('0x6'));var jayson=require(_0x3fc4('0x7'));var client=jayson['client'][_0x3fc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d7087,_0x3760e3,_0x518c59){return new BPromise(function(_0x59e3a7,_0x5d05a4){return client[_0x3fc4('0x9')](_0x1d7087,_0x518c59)[_0x3fc4('0xa')](function(_0x2e04db){logger[_0x3fc4('0xb')]('DeskAccount,\x20%s,\x20%s',_0x3760e3,'request\x20sent');logger[_0x3fc4('0xc')](_0x3fc4('0xd'),_0x3760e3,'request\x20sent',JSON[_0x3fc4('0xe')](_0x2e04db));if(_0x2e04db[_0x3fc4('0xf')]){if(_0x2e04db[_0x3fc4('0xf')][_0x3fc4('0x10')]===0x1f4){logger[_0x3fc4('0xf')](_0x3fc4('0x11'),_0x3760e3,_0x2e04db[_0x3fc4('0xf')][_0x3fc4('0x12')]);return _0x5d05a4(_0x2e04db[_0x3fc4('0xf')][_0x3fc4('0x12')]);}logger[_0x3fc4('0xf')](_0x3fc4('0x11'),_0x3760e3,_0x2e04db[_0x3fc4('0xf')][_0x3fc4('0x12')]);return _0x59e3a7(_0x2e04db[_0x3fc4('0xf')][_0x3fc4('0x12')]);}else{logger['info'](_0x3fc4('0x11'),_0x3760e3,_0x3fc4('0x13'));_0x59e3a7(_0x2e04db[_0x3fc4('0x14')]['message']);}})['catch'](function(_0x4a01c9){logger[_0x3fc4('0xf')](_0x3fc4('0x11'),_0x3760e3,_0x4a01c9);_0x5d05a4(_0x4a01c9);});});}exports[_0x3fc4('0x15')]=function(_0x268e75){var _0x5432b8=this;return new Promise(function(_0x381275,_0xf5c0d2){return db[_0x3fc4('0x16')][_0x3fc4('0x17')]({'raw':_0x268e75[_0x3fc4('0x18')]?_0x268e75[_0x3fc4('0x18')][_0x3fc4('0x19')]===undefined?!![]:![]:!![],'where':_0x268e75[_0x3fc4('0x18')]?_0x268e75['options']['where']||null:null,'attributes':_0x268e75[_0x3fc4('0x18')]?_0x268e75['options']['attributes']||null:null,'limit':_0x268e75[_0x3fc4('0x18')]?_0x268e75['options'][_0x3fc4('0x1a')]||null:null,'include':_0x268e75['options']?_0x268e75['options']['include']?_[_0x3fc4('0x1b')](_0x268e75[_0x3fc4('0x18')][_0x3fc4('0x1c')],function(_0x433786){return{'model':db[_0x433786['model']],'as':_0x433786['as'],'attributes':_0x433786[_0x3fc4('0x1d')],'include':_0x433786[_0x3fc4('0x1c')]?_[_0x3fc4('0x1b')](_0x433786[_0x3fc4('0x1c')],function(_0x5f5d1f){return{'model':db[_0x5f5d1f['model']],'as':_0x5f5d1f['as'],'attributes':_0x5f5d1f[_0x3fc4('0x1d')],'include':_0x5f5d1f[_0x3fc4('0x1c')]?_[_0x3fc4('0x1b')](_0x5f5d1f['include'],function(_0x543127){return{'model':db[_0x543127['model']],'as':_0x543127['as'],'attributes':_0x543127['attributes']};}):[]};}):[]};}):[]:[]})[_0x3fc4('0xa')](function(_0x27a930){logger[_0x3fc4('0xb')](_0x3fc4('0x15'),_0x268e75);logger[_0x3fc4('0xc')](_0x3fc4('0x15'),_0x268e75,JSON['stringify'](_0x27a930));_0x381275(_0x27a930);})[_0x3fc4('0x1e')](function(_0x3b2942){logger[_0x3fc4('0xf')](_0x3fc4('0x15'),_0x3b2942[_0x3fc4('0x12')],_0x268e75);_0xf5c0d2(_0x5432b8[_0x3fc4('0xf')](0x1f4,_0x3b2942[_0x3fc4('0x12')]));});});};exports['ShowDeskAccount']=function(_0x558810){var _0x24c2a3=this;return new Promise(function(_0x2826ba,_0x4796d9){return db[_0x3fc4('0x16')]['find']({'raw':_0x558810[_0x3fc4('0x18')]?_0x558810['options'][_0x3fc4('0x19')]===undefined?!![]:![]:!![],'where':_0x558810[_0x3fc4('0x18')]?_0x558810[_0x3fc4('0x18')][_0x3fc4('0x1f')]||null:null,'attributes':_0x558810[_0x3fc4('0x18')]?_0x558810[_0x3fc4('0x18')][_0x3fc4('0x1d')]||null:null,'include':_0x558810[_0x3fc4('0x18')]?_0x558810[_0x3fc4('0x18')][_0x3fc4('0x1c')]?_['map'](_0x558810[_0x3fc4('0x18')][_0x3fc4('0x1c')],function(_0x286b6f){return{'model':db[_0x286b6f[_0x3fc4('0x20')]],'as':_0x286b6f['as'],'attributes':_0x286b6f[_0x3fc4('0x1d')],'include':_0x286b6f[_0x3fc4('0x1c')]?_['map'](_0x286b6f['include'],function(_0x3bd99e){return{'model':db[_0x3bd99e[_0x3fc4('0x20')]],'as':_0x3bd99e['as'],'attributes':_0x3bd99e[_0x3fc4('0x1d')],'include':_0x3bd99e[_0x3fc4('0x1c')]?_[_0x3fc4('0x1b')](_0x3bd99e[_0x3fc4('0x1c')],function(_0x11e19c){return{'model':db[_0x11e19c[_0x3fc4('0x20')]],'as':_0x11e19c['as'],'attributes':_0x11e19c[_0x3fc4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xda294f){logger[_0x3fc4('0xb')](_0x3fc4('0x21'),_0x558810);logger[_0x3fc4('0xc')](_0x3fc4('0x21'),_0x558810,JSON[_0x3fc4('0xe')](_0xda294f));_0x2826ba(_0xda294f);})['catch'](function(_0x7a984e){logger['error'](_0x3fc4('0x21'),_0x7a984e[_0x3fc4('0x12')],_0x558810);_0x4796d9(_0x24c2a3[_0x3fc4('0xf')](0x1f4,_0x7a984e[_0x3fc4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 03165b7..ea68673 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5a8167,_0x3da992){var _0x236a3b=function(_0x34aa47){while(--_0x34aa47){_0x5a8167['push'](_0x5a8167['shift']());}};_0x236a3b(++_0x3da992);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x4b9779,_0x73d01f){var _0x2507da=function(_0x5cade2){while(--_0x5cade2){_0x4b9779['push'](_0x4b9779['shift']());}};_0x2507da(++_0x73d01f);}(_0xedd9,0xfc));var _0x9edd=function(_0x260397,_0x1ad905){_0x260397=_0x260397-0x0;var _0x1bf4d4=_0xedd9[_0x260397];return _0x1bf4d4;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4210883..eaf56aa 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 _0xc19d=['STRING','sequelize','exports'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xc19d,0xd9));var _0xdc19=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0xc19d[_0x12a554];return _0x244ba0;};'use strict';var Sequelize=require(_0xdc19('0x0'));module[_0xdc19('0x1')]={'name':{'type':Sequelize[_0xdc19('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb853=['sequelize','exports','STRING'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xb853,0x162));var _0x3b85=function(_0x364a1b,_0x3c7bcf){_0x364a1b=_0x364a1b-0x0;var _0x19a755=_0xb853[_0x364a1b];return _0x19a755;};'use strict';var Sequelize=require(_0x3b85('0x0'));module[_0x3b85('0x1')]={'name':{'type':Sequelize[_0x3b85('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index a68c807..bbe7112 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 _0xb809=['count','offset','status','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','find','create','body','order','pick','nolimit','getFields','getSubjects','findOne','DeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','sendStatus','end','json','undefined','limit'];(function(_0x13ba9d,_0x539071){var _0x21c954=function(_0x38479e){while(--_0x38479e){_0x13ba9d['push'](_0x13ba9d['shift']());}};_0x21c954(++_0x539071);}(_0xb809,0x1d5));var _0x9b80=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xb809[_0x4347ec];return _0x4c8314;};'use strict';var emlformat=require(_0x9b80('0x0'));var rimraf=require(_0x9b80('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b80('0x2'));var rp=require(_0x9b80('0x3'));var moment=require(_0x9b80('0x4'));var BPromise=require(_0x9b80('0x5'));var Mustache=require(_0x9b80('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9b80('0x7'));var csv=require(_0x9b80('0x8'));var ejs=require(_0x9b80('0x9'));var fs=require('fs');var fs_extra=require(_0x9b80('0xa'));var _=require(_0x9b80('0xb'));var squel=require(_0x9b80('0xc'));var crypto=require('crypto');var jsforce=require(_0x9b80('0xd'));var deskjs=require(_0x9b80('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9b80('0xf'));var Papa=require(_0x9b80('0x10'));var Redis=require(_0x9b80('0x11'));var authService=require(_0x9b80('0x12'));var qs=require(_0x9b80('0x13'));var as=require(_0x9b80('0x14'));var hardwareService=require(_0x9b80('0x15'));var logger=require('../../config/logger')(_0x9b80('0x16'));var utils=require('../../config/utils');var config=require(_0x9b80('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27cae2,_0x4e0772){_0x4e0772=_0x4e0772||0xcc;return function(_0xab86b9){if(_0xab86b9){return _0x27cae2[_0x9b80('0x18')](_0x4e0772);}return _0x27cae2['status'](_0x4e0772)[_0x9b80('0x19')]();};}function respondWithResult(_0x7124ba,_0x31fd30){_0x31fd30=_0x31fd30||0xc8;return function(_0x52911e){if(_0x52911e){return _0x7124ba['status'](_0x31fd30)[_0x9b80('0x1a')](_0x52911e);}};}function respondWithFilteredResult(_0x13ffbc,_0x11362b){return function(_0x5a90cd){if(_0x5a90cd){var _0x1db8f8=typeof _0x11362b['offset']===_0x9b80('0x1b')&&typeof _0x11362b[_0x9b80('0x1c')]===_0x9b80('0x1b');var _0x25babe=_0x5a90cd[_0x9b80('0x1d')];var _0x49386b=_0x1db8f8?0x0:_0x11362b[_0x9b80('0x1e')];var _0x57eb24=_0x1db8f8?_0x5a90cd['count']:_0x11362b[_0x9b80('0x1e')]+_0x11362b[_0x9b80('0x1c')];var _0xf2de93;if(_0x57eb24>=_0x25babe){_0x57eb24=_0x25babe;_0xf2de93=0xc8;}else{_0xf2de93=0xce;}_0x13ffbc[_0x9b80('0x1f')](_0xf2de93);return _0x13ffbc['set']('Content-Range',_0x49386b+'-'+_0x57eb24+'/'+_0x25babe)[_0x9b80('0x1a')](_0x5a90cd);}return null;};}function patchUpdates(_0x590b78){return function(_0x551c79){try{jsonpatch[_0x9b80('0x20')](_0x551c79,_0x590b78,!![]);}catch(_0x2359d0){return BPromise[_0x9b80('0x21')](_0x2359d0);}return _0x551c79[_0x9b80('0x22')]();};}function saveUpdates(_0x48490b,_0x5ce6a3){return function(_0x1a2cb2){if(_0x1a2cb2){return _0x1a2cb2[_0x9b80('0x23')](_0x48490b)['then'](function(_0x1241d5){return _0x1241d5;});}return null;};}function removeEntity(_0x5ea356,_0x24ff4b){return function(_0x56078d){if(_0x56078d){return _0x56078d[_0x9b80('0x24')]()[_0x9b80('0x25')](function(){_0x5ea356[_0x9b80('0x1f')](0xcc)[_0x9b80('0x19')]();});}};}function handleEntityNotFound(_0xe6b777,_0x1e1537){return function(_0x53e700){if(!_0x53e700){_0xe6b777[_0x9b80('0x18')](0x194);}return _0x53e700;};}function handleError(_0x322dfc,_0x2a80af){_0x2a80af=_0x2a80af||0x1f4;return function(_0x241584){logger[_0x9b80('0x26')](_0x241584[_0x9b80('0x27')]);if(_0x241584[_0x9b80('0x28')]){delete _0x241584[_0x9b80('0x28')];}_0x322dfc['status'](_0x2a80af)[_0x9b80('0x29')](_0x241584);};}exports[_0x9b80('0x2a')]=function(_0x6b50fe,_0x5bf429){var _0x1994d7={},_0x2e6939={},_0x6a09dd={'count':0x0,'rows':[]};var _0x481ea2=_[_0x9b80('0x2b')](db[_0x9b80('0x2c')][_0x9b80('0x2d')],function(_0x2b14e1){return{'name':_0x2b14e1[_0x9b80('0x2e')],'type':_0x2b14e1[_0x9b80('0x2f')][_0x9b80('0x30')]};});_0x2e6939['model']=_[_0x9b80('0x2b')](_0x481ea2,_0x9b80('0x28'));_0x2e6939[_0x9b80('0x31')]=_[_0x9b80('0x32')](_0x6b50fe[_0x9b80('0x31')]);_0x2e6939[_0x9b80('0x33')]=_[_0x9b80('0x34')](_0x2e6939[_0x9b80('0x35')],_0x2e6939[_0x9b80('0x31')]);_0x1994d7[_0x9b80('0x36')]=_[_0x9b80('0x34')](_0x2e6939[_0x9b80('0x35')],qs[_0x9b80('0x37')](_0x6b50fe['query'][_0x9b80('0x37')]));_0x1994d7[_0x9b80('0x36')]=_0x1994d7[_0x9b80('0x36')]['length']?_0x1994d7[_0x9b80('0x36')]:_0x2e6939[_0x9b80('0x35')];if(!_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x38')]('nolimit')){_0x1994d7[_0x9b80('0x1c')]=qs['limit'](_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x1c')]);_0x1994d7[_0x9b80('0x1e')]=qs[_0x9b80('0x1e')](_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x1e')]);}_0x1994d7['order']=qs[_0x9b80('0x39')](_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x39')]);_0x1994d7[_0x9b80('0x3a')]=qs[_0x9b80('0x33')](_['pick'](_0x6b50fe[_0x9b80('0x31')],_0x2e6939['filters']),_0x481ea2);if(_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x3b')]){_0x1994d7['where']=_[_0x9b80('0x3c')](_0x1994d7[_0x9b80('0x3a')],{'$or':_['map'](_0x481ea2,function(_0x3a5ae1){if(_0x3a5ae1[_0x9b80('0x2f')]!==_0x9b80('0x3d')){var _0x45eea5={};_0x45eea5[_0x3a5ae1['name']]={'$like':'%'+_0x6b50fe[_0x9b80('0x31')][_0x9b80('0x3b')]+'%'};return _0x45eea5;}})});}_0x1994d7=_[_0x9b80('0x3c')]({},_0x1994d7,_0x6b50fe[_0x9b80('0x3e')]);var _0x285a79={'where':_0x1994d7['where']};return db[_0x9b80('0x2c')]['count'](_0x285a79)[_0x9b80('0x25')](function(_0x206e92){_0x6a09dd[_0x9b80('0x1d')]=_0x206e92;if(_0x6b50fe['query'][_0x9b80('0x3f')]){_0x1994d7[_0x9b80('0x40')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x1994d7);})['then'](function(_0x12a902){_0x6a09dd['rows']=_0x12a902;return _0x6a09dd;})[_0x9b80('0x25')](respondWithFilteredResult(_0x5bf429,_0x1994d7))[_0x9b80('0x41')](handleError(_0x5bf429,null));};exports[_0x9b80('0x42')]=function(_0x397b36,_0x2a2002){var _0x527483={'raw':![],'where':{'id':_0x397b36[_0x9b80('0x43')]['id']}},_0x440d41={};_0x440d41[_0x9b80('0x35')]=_[_0x9b80('0x32')](db['DeskConfiguration'][_0x9b80('0x2d')]);_0x440d41[_0x9b80('0x31')]=_['keys'](_0x397b36[_0x9b80('0x31')]);_0x440d41['filters']=_[_0x9b80('0x34')](_0x440d41['model'],_0x440d41[_0x9b80('0x31')]);_0x527483[_0x9b80('0x36')]=_[_0x9b80('0x34')](_0x440d41[_0x9b80('0x35')],qs[_0x9b80('0x37')](_0x397b36[_0x9b80('0x31')][_0x9b80('0x37')]));_0x527483['attributes']=_0x527483[_0x9b80('0x36')][_0x9b80('0x44')]?_0x527483[_0x9b80('0x36')]:_0x440d41['model'];if(_0x397b36[_0x9b80('0x31')]['includeAll']){_0x527483[_0x9b80('0x40')]=[{'all':!![]}];}_0x527483=_[_0x9b80('0x3c')]({},_0x527483,_0x397b36[_0x9b80('0x3e')]);return db['DeskConfiguration'][_0x9b80('0x45')](_0x527483)[_0x9b80('0x25')](handleEntityNotFound(_0x2a2002,null))[_0x9b80('0x25')](respondWithResult(_0x2a2002,null))[_0x9b80('0x41')](handleError(_0x2a2002,null));};exports[_0x9b80('0x46')]=function(_0x42f327,_0x1f4a9f){return db[_0x9b80('0x2c')][_0x9b80('0x46')](_0x42f327[_0x9b80('0x47')],{})[_0x9b80('0x25')](respondWithResult(_0x1f4a9f,0xc9))[_0x9b80('0x41')](handleError(_0x1f4a9f,null));};exports[_0x9b80('0x23')]=function(_0xc2c330,_0x5770d9){if(_0xc2c330['body']['id']){delete _0xc2c330['body']['id'];}return db[_0x9b80('0x2c')][_0x9b80('0x45')]({'where':{'id':_0xc2c330['params']['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x5770d9,null))[_0x9b80('0x25')](saveUpdates(_0xc2c330[_0x9b80('0x47')],null))[_0x9b80('0x25')](respondWithResult(_0x5770d9,null))[_0x9b80('0x41')](handleError(_0x5770d9,null));};exports[_0x9b80('0x24')]=function(_0x506cba,_0x48ffc6){return db['DeskConfiguration'][_0x9b80('0x45')]({'where':{'id':_0x506cba[_0x9b80('0x43')]['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x48ffc6,null))['then'](removeEntity(_0x48ffc6,null))[_0x9b80('0x41')](handleError(_0x48ffc6,null));};exports['getFields']=function(_0x4afb65,_0x153332,_0x1c412c){var _0x589a33={};var _0x2115f2={};var _0x343f5a;var _0x32d207;return db[_0x9b80('0x2c')]['findOne']({'where':{'id':_0x4afb65[_0x9b80('0x43')]['id']}})['then'](handleEntityNotFound(_0x153332,null))[_0x9b80('0x25')](function(_0x4c67a0){if(_0x4c67a0){_0x343f5a=_0x4c67a0;_0x2115f2[_0x9b80('0x35')]=_[_0x9b80('0x32')](db['DeskField']['rawAttributes']);_0x2115f2[_0x9b80('0x31')]=_['keys'](_0x4afb65[_0x9b80('0x31')]);_0x2115f2[_0x9b80('0x33')]=_['intersection'](_0x2115f2[_0x9b80('0x35')],_0x2115f2[_0x9b80('0x31')]);_0x589a33[_0x9b80('0x36')]=_['intersection'](_0x2115f2[_0x9b80('0x35')],qs[_0x9b80('0x37')](_0x4afb65['query']['fields']));_0x589a33['attributes']=_0x589a33[_0x9b80('0x36')]['length']?_0x589a33['attributes']:_0x2115f2['model'];_0x589a33[_0x9b80('0x48')]=qs[_0x9b80('0x39')](_0x4afb65[_0x9b80('0x31')][_0x9b80('0x39')]);_0x589a33[_0x9b80('0x3a')]=qs['filters'](_[_0x9b80('0x49')](_0x4afb65[_0x9b80('0x31')],_0x2115f2[_0x9b80('0x33')]));if(_0x4afb65[_0x9b80('0x31')][_0x9b80('0x3b')]){_0x589a33['where']=_['merge'](_0x589a33[_0x9b80('0x3a')],{'$or':_[_0x9b80('0x2b')](_0x589a33[_0x9b80('0x36')],function(_0x439b89){var _0x1c22bd={};_0x1c22bd[_0x439b89]={'$like':'%'+_0x4afb65[_0x9b80('0x31')]['filter']+'%'};return _0x1c22bd;})});}_0x589a33=_[_0x9b80('0x3c')]({},_0x589a33,_0x4afb65['options']);return _0x343f5a['getFields'](_0x589a33);}})[_0x9b80('0x25')](function(_0x32733f){if(_0x32733f){_0x32d207=_0x32733f[_0x9b80('0x44')];if(!_0x4afb65['query'][_0x9b80('0x38')](_0x9b80('0x4a'))){_0x589a33[_0x9b80('0x1c')]=qs[_0x9b80('0x1c')](_0x4afb65[_0x9b80('0x31')]['limit']);_0x589a33[_0x9b80('0x1e')]=qs[_0x9b80('0x1e')](_0x4afb65[_0x9b80('0x31')][_0x9b80('0x1e')]);}return _0x343f5a[_0x9b80('0x4b')](_0x589a33);}})[_0x9b80('0x25')](function(_0x8ed529){if(_0x8ed529){return _0x8ed529?{'count':_0x32d207,'rows':_0x8ed529}:null;}})['then'](respondWithResult(_0x153332,null))[_0x9b80('0x41')](handleError(_0x153332,null));};exports[_0x9b80('0x4c')]=function(_0x306a0a,_0x3772c3,_0x469b54){var _0x5558e5={};var _0xd841f0={};var _0x477a37;var _0x4d1f51;return db[_0x9b80('0x2c')][_0x9b80('0x4d')]({'where':{'id':_0x306a0a[_0x9b80('0x43')]['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x3772c3,null))['then'](function(_0x2c787d){if(_0x2c787d){_0x477a37=_0x2c787d;_0xd841f0[_0x9b80('0x35')]=_[_0x9b80('0x32')](db[_0x9b80('0x4e')][_0x9b80('0x2d')]);_0xd841f0[_0x9b80('0x31')]=_[_0x9b80('0x32')](_0x306a0a[_0x9b80('0x31')]);_0xd841f0[_0x9b80('0x33')]=_['intersection'](_0xd841f0['model'],_0xd841f0[_0x9b80('0x31')]);_0x5558e5[_0x9b80('0x36')]=_[_0x9b80('0x34')](_0xd841f0[_0x9b80('0x35')],qs[_0x9b80('0x37')](_0x306a0a[_0x9b80('0x31')]['fields']));_0x5558e5[_0x9b80('0x36')]=_0x5558e5[_0x9b80('0x36')][_0x9b80('0x44')]?_0x5558e5['attributes']:_0xd841f0[_0x9b80('0x35')];_0x5558e5[_0x9b80('0x48')]=qs['sort'](_0x306a0a[_0x9b80('0x31')][_0x9b80('0x39')]);_0x5558e5[_0x9b80('0x3a')]=qs[_0x9b80('0x33')](_[_0x9b80('0x49')](_0x306a0a['query'],_0xd841f0['filters']));if(_0x306a0a[_0x9b80('0x31')][_0x9b80('0x3b')]){_0x5558e5[_0x9b80('0x3a')]=_[_0x9b80('0x3c')](_0x5558e5['where'],{'$or':_['map'](_0x5558e5[_0x9b80('0x36')],function(_0x37aeb1){var _0x46b85f={};_0x46b85f[_0x37aeb1]={'$like':'%'+_0x306a0a['query'][_0x9b80('0x3b')]+'%'};return _0x46b85f;})});}_0x5558e5=_[_0x9b80('0x3c')]({},_0x5558e5,_0x306a0a['options']);return _0x477a37[_0x9b80('0x4c')](_0x5558e5);}})[_0x9b80('0x25')](function(_0x29d55e){if(_0x29d55e){_0x4d1f51=_0x29d55e['length'];if(!_0x306a0a[_0x9b80('0x31')][_0x9b80('0x38')](_0x9b80('0x4a'))){_0x5558e5[_0x9b80('0x1c')]=qs['limit'](_0x306a0a['query'][_0x9b80('0x1c')]);_0x5558e5['offset']=qs[_0x9b80('0x1e')](_0x306a0a[_0x9b80('0x31')]['offset']);}return _0x477a37[_0x9b80('0x4c')](_0x5558e5);}})[_0x9b80('0x25')](function(_0x52ad2c){if(_0x52ad2c){return _0x52ad2c?{'count':_0x4d1f51,'rows':_0x52ad2c}:null;}})['then'](respondWithResult(_0x3772c3,null))[_0x9b80('0x41')](handleError(_0x3772c3,null));};exports[_0x9b80('0x4f')]=function(_0x27d3cc,_0x24eb4f,_0x150474){var _0x9f4999={};var _0x5489b6={};var _0x33ceeb;var _0x46d6ce;return db['DeskConfiguration'][_0x9b80('0x4d')]({'where':{'id':_0x27d3cc['params']['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x24eb4f,null))['then'](function(_0x3d933f){if(_0x3d933f){_0x33ceeb=_0x3d933f;_0x5489b6['model']=_[_0x9b80('0x32')](db['DeskField'][_0x9b80('0x2d')]);_0x5489b6[_0x9b80('0x31')]=_[_0x9b80('0x32')](_0x27d3cc[_0x9b80('0x31')]);_0x5489b6[_0x9b80('0x33')]=_[_0x9b80('0x34')](_0x5489b6[_0x9b80('0x35')],_0x5489b6[_0x9b80('0x31')]);_0x9f4999[_0x9b80('0x36')]=_[_0x9b80('0x34')](_0x5489b6[_0x9b80('0x35')],qs[_0x9b80('0x37')](_0x27d3cc[_0x9b80('0x31')]['fields']));_0x9f4999['attributes']=_0x9f4999[_0x9b80('0x36')][_0x9b80('0x44')]?_0x9f4999[_0x9b80('0x36')]:_0x5489b6[_0x9b80('0x35')];_0x9f4999[_0x9b80('0x48')]=qs[_0x9b80('0x39')](_0x27d3cc[_0x9b80('0x31')][_0x9b80('0x39')]);_0x9f4999[_0x9b80('0x3a')]=qs[_0x9b80('0x33')](_['pick'](_0x27d3cc[_0x9b80('0x31')],_0x5489b6['filters']));if(_0x27d3cc['query'][_0x9b80('0x3b')]){_0x9f4999[_0x9b80('0x3a')]=_[_0x9b80('0x3c')](_0x9f4999[_0x9b80('0x3a')],{'$or':_[_0x9b80('0x2b')](_0x9f4999[_0x9b80('0x36')],function(_0x19f71d){var _0xdf58f5={};_0xdf58f5[_0x19f71d]={'$like':'%'+_0x27d3cc[_0x9b80('0x31')][_0x9b80('0x3b')]+'%'};return _0xdf58f5;})});}_0x9f4999=_[_0x9b80('0x3c')]({},_0x9f4999,_0x27d3cc[_0x9b80('0x3e')]);return _0x33ceeb['getDescriptions'](_0x9f4999);}})[_0x9b80('0x25')](function(_0x56431f){if(_0x56431f){_0x46d6ce=_0x56431f[_0x9b80('0x44')];if(!_0x27d3cc[_0x9b80('0x31')]['hasOwnProperty'](_0x9b80('0x4a'))){_0x9f4999['limit']=qs['limit'](_0x27d3cc[_0x9b80('0x31')][_0x9b80('0x1c')]);_0x9f4999[_0x9b80('0x1e')]=qs[_0x9b80('0x1e')](_0x27d3cc[_0x9b80('0x31')]['offset']);}return _0x33ceeb[_0x9b80('0x4f')](_0x9f4999);}})[_0x9b80('0x25')](function(_0xb9ff){if(_0xb9ff){return _0xb9ff?{'count':_0x46d6ce,'rows':_0xb9ff}:null;}})['then'](respondWithResult(_0x24eb4f,null))[_0x9b80('0x41')](handleError(_0x24eb4f,null));};exports[_0x9b80('0x50')]=function(_0x4e3f8a,_0x57f203,_0xa0c9e){var _0xcca657={};var _0x2f306a={};var _0x53dad7;var _0x50a1b3;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4e3f8a['params']['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x57f203,null))['then'](function(_0x1a81ed){if(_0x1a81ed){_0x53dad7=_0x1a81ed;_0x2f306a[_0x9b80('0x35')]=_[_0x9b80('0x32')](db['Tag'][_0x9b80('0x2d')]);_0x2f306a[_0x9b80('0x31')]=_[_0x9b80('0x32')](_0x4e3f8a[_0x9b80('0x31')]);_0x2f306a[_0x9b80('0x33')]=_[_0x9b80('0x34')](_0x2f306a[_0x9b80('0x35')],_0x2f306a[_0x9b80('0x31')]);_0xcca657[_0x9b80('0x36')]=_['intersection'](_0x2f306a[_0x9b80('0x35')],qs['fields'](_0x4e3f8a[_0x9b80('0x31')][_0x9b80('0x37')]));_0xcca657[_0x9b80('0x36')]=_0xcca657['attributes'][_0x9b80('0x44')]?_0xcca657['attributes']:_0x2f306a[_0x9b80('0x35')];_0xcca657[_0x9b80('0x48')]=qs[_0x9b80('0x39')](_0x4e3f8a[_0x9b80('0x31')][_0x9b80('0x39')]);_0xcca657[_0x9b80('0x3a')]=qs[_0x9b80('0x33')](_['pick'](_0x4e3f8a[_0x9b80('0x31')],_0x2f306a[_0x9b80('0x33')]));if(_0x4e3f8a['query'][_0x9b80('0x3b')]){_0xcca657[_0x9b80('0x3a')]=_[_0x9b80('0x3c')](_0xcca657[_0x9b80('0x3a')],{'$or':_[_0x9b80('0x2b')](_0xcca657[_0x9b80('0x36')],function(_0x59ff78){var _0x3693dd={};_0x3693dd[_0x59ff78]={'$like':'%'+_0x4e3f8a[_0x9b80('0x31')]['filter']+'%'};return _0x3693dd;})});}_0xcca657=_[_0x9b80('0x3c')]({},_0xcca657,_0x4e3f8a[_0x9b80('0x3e')]);return _0x53dad7[_0x9b80('0x50')](_0xcca657);}})[_0x9b80('0x25')](function(_0x212343){if(_0x212343){_0x50a1b3=_0x212343[_0x9b80('0x44')];if(!_0x4e3f8a[_0x9b80('0x31')][_0x9b80('0x38')](_0x9b80('0x4a'))){_0xcca657['limit']=qs['limit'](_0x4e3f8a[_0x9b80('0x31')][_0x9b80('0x1c')]);_0xcca657[_0x9b80('0x1e')]=qs[_0x9b80('0x1e')](_0x4e3f8a['query'][_0x9b80('0x1e')]);}return _0x53dad7[_0x9b80('0x50')](_0xcca657);}})['then'](function(_0x50862b){if(_0x50862b){return _0x50862b?{'count':_0x50a1b3,'rows':_0x50862b}:null;}})['then'](respondWithResult(_0x57f203,null))[_0x9b80('0x41')](handleError(_0x57f203,null));};exports['setTags']=function(_0x539fe7,_0x5cb7f8,_0x44e20d){if(_0x539fe7[_0x9b80('0x47')]['id']){delete _0x539fe7[_0x9b80('0x47')]['id'];}return db[_0x9b80('0x2c')][_0x9b80('0x4d')]({'where':{'id':_0x539fe7[_0x9b80('0x43')]['id']}})[_0x9b80('0x25')](handleEntityNotFound(_0x5cb7f8,null))[_0x9b80('0x25')](function(_0x4318fe){if(_0x4318fe){return _0x4318fe[_0x9b80('0x51')](_0x539fe7['body'][_0x9b80('0x52')]||[]);}return null;})['then'](respondWithResult(_0x5cb7f8,null))[_0x9b80('0x41')](handleError(_0x5cb7f8,null));}; \ No newline at end of file +var _0x30c4=['findAll','rows','show','params','rawAttributes','includeAll','find','create','body','catch','destroy','getFields','findOne','length','options','getSubjects','DeskField','getDescriptions','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','DeskConfiguration','include'];(function(_0x471273,_0x1587f1){var _0x56c63e=function(_0x4464f0){while(--_0x4464f0){_0x471273['push'](_0x471273['shift']());}};_0x56c63e(++_0x1587f1);}(_0x30c4,0x113));var _0x430c=function(_0x5c803b,_0x247405){_0x5c803b=_0x5c803b-0x0;var _0x16b3e7=_0x30c4[_0x5c803b];return _0x16b3e7;};'use strict';var emlformat=require(_0x430c('0x0'));var rimraf=require(_0x430c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x430c('0x2'));var rp=require(_0x430c('0x3'));var moment=require(_0x430c('0x4'));var BPromise=require(_0x430c('0x5'));var Mustache=require('mustache');var util=require(_0x430c('0x6'));var path=require('path');var sox=require(_0x430c('0x7'));var csv=require(_0x430c('0x8'));var ejs=require(_0x430c('0x9'));var fs=require('fs');var fs_extra=require(_0x430c('0xa'));var _=require(_0x430c('0xb'));var squel=require(_0x430c('0xc'));var crypto=require('crypto');var jsforce=require(_0x430c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x430c('0x8'));var querystring=require('querystring');var Papa=require(_0x430c('0xe'));var Redis=require(_0x430c('0xf'));var authService=require(_0x430c('0x10'));var qs=require(_0x430c('0x11'));var as=require(_0x430c('0x12'));var hardwareService=require(_0x430c('0x13'));var logger=require(_0x430c('0x14'))(_0x430c('0x15'));var utils=require(_0x430c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x430c('0x17'));var db=require(_0x430c('0x18'))['db'];function respondWithStatusCode(_0x34fdbc,_0x299e1e){_0x299e1e=_0x299e1e||0xcc;return function(_0x30bb91){if(_0x30bb91){return _0x34fdbc[_0x430c('0x19')](_0x299e1e);}return _0x34fdbc[_0x430c('0x1a')](_0x299e1e)[_0x430c('0x1b')]();};}function respondWithResult(_0xc65b3d,_0x3f4fcc){_0x3f4fcc=_0x3f4fcc||0xc8;return function(_0x5a1fdc){if(_0x5a1fdc){return _0xc65b3d[_0x430c('0x1a')](_0x3f4fcc)['json'](_0x5a1fdc);}};}function respondWithFilteredResult(_0x403891,_0x1eae56){return function(_0x3f23d7){if(_0x3f23d7){var _0xaeeeab=typeof _0x1eae56[_0x430c('0x1c')]===_0x430c('0x1d')&&typeof _0x1eae56['limit']==='undefined';var _0x48961b=_0x3f23d7['count'];var _0x3a9ce0=_0xaeeeab?0x0:_0x1eae56[_0x430c('0x1c')];var _0x20f03e=_0xaeeeab?_0x3f23d7[_0x430c('0x1e')]:_0x1eae56['offset']+_0x1eae56[_0x430c('0x1f')];var _0x36ff00;if(_0x20f03e>=_0x48961b){_0x20f03e=_0x48961b;_0x36ff00=0xc8;}else{_0x36ff00=0xce;}_0x403891[_0x430c('0x1a')](_0x36ff00);return _0x403891[_0x430c('0x20')](_0x430c('0x21'),_0x3a9ce0+'-'+_0x20f03e+'/'+_0x48961b)[_0x430c('0x22')](_0x3f23d7);}return null;};}function patchUpdates(_0x216ff9){return function(_0x30f309){try{jsonpatch[_0x430c('0x23')](_0x30f309,_0x216ff9,!![]);}catch(_0x161dd6){return BPromise[_0x430c('0x24')](_0x161dd6);}return _0x30f309['save']();};}function saveUpdates(_0x5835fc,_0x28bdaf){return function(_0x152e96){if(_0x152e96){return _0x152e96[_0x430c('0x25')](_0x5835fc)[_0x430c('0x26')](function(_0x1174c7){return _0x1174c7;});}return null;};}function removeEntity(_0x3db7cb,_0x117200){return function(_0x3e06ca){if(_0x3e06ca){return _0x3e06ca['destroy']()[_0x430c('0x26')](function(){_0x3db7cb['status'](0xcc)[_0x430c('0x1b')]();});}};}function handleEntityNotFound(_0x58adbe,_0x5b3db1){return function(_0x5812f8){if(!_0x5812f8){_0x58adbe[_0x430c('0x19')](0x194);}return _0x5812f8;};}function handleError(_0x1d2295,_0x59c170){_0x59c170=_0x59c170||0x1f4;return function(_0xb68c04){logger[_0x430c('0x27')](_0xb68c04['stack']);if(_0xb68c04[_0x430c('0x28')]){delete _0xb68c04[_0x430c('0x28')];}_0x1d2295[_0x430c('0x1a')](_0x59c170)[_0x430c('0x29')](_0xb68c04);};}exports[_0x430c('0x2a')]=function(_0x3abe53,_0x3ce468){var _0x4199b0={},_0x5a848b={},_0x2c13e4={'count':0x0,'rows':[]};var _0x2ab9ce=_[_0x430c('0x2b')](db['DeskConfiguration']['rawAttributes'],function(_0x1714a5){return{'name':_0x1714a5[_0x430c('0x2c')],'type':_0x1714a5[_0x430c('0x2d')][_0x430c('0x2e')]};});_0x5a848b[_0x430c('0x2f')]=_[_0x430c('0x2b')](_0x2ab9ce,'name');_0x5a848b[_0x430c('0x30')]=_[_0x430c('0x31')](_0x3abe53['query']);_0x5a848b['filters']=_[_0x430c('0x32')](_0x5a848b[_0x430c('0x2f')],_0x5a848b['query']);_0x4199b0['attributes']=_[_0x430c('0x32')](_0x5a848b[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x3abe53[_0x430c('0x30')][_0x430c('0x33')]));_0x4199b0[_0x430c('0x34')]=_0x4199b0['attributes']['length']?_0x4199b0[_0x430c('0x34')]:_0x5a848b[_0x430c('0x2f')];if(!_0x3abe53[_0x430c('0x30')][_0x430c('0x35')](_0x430c('0x36'))){_0x4199b0[_0x430c('0x1f')]=qs[_0x430c('0x1f')](_0x3abe53[_0x430c('0x30')][_0x430c('0x1f')]);_0x4199b0[_0x430c('0x1c')]=qs['offset'](_0x3abe53[_0x430c('0x30')][_0x430c('0x1c')]);}_0x4199b0[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x3abe53[_0x430c('0x30')]['sort']);_0x4199b0[_0x430c('0x39')]=qs[_0x430c('0x3a')](_[_0x430c('0x3b')](_0x3abe53['query'],_0x5a848b[_0x430c('0x3a')]),_0x2ab9ce);if(_0x3abe53[_0x430c('0x30')][_0x430c('0x3c')]){_0x4199b0[_0x430c('0x39')]=_['merge'](_0x4199b0[_0x430c('0x39')],{'$or':_[_0x430c('0x2b')](_0x2ab9ce,function(_0x576ad4){if(_0x576ad4[_0x430c('0x2d')]!==_0x430c('0x3d')){var _0x581d8d={};_0x581d8d[_0x576ad4[_0x430c('0x28')]]={'$like':'%'+_0x3abe53[_0x430c('0x30')]['filter']+'%'};return _0x581d8d;}})});}_0x4199b0=_[_0x430c('0x3e')]({},_0x4199b0,_0x3abe53['options']);var _0x3e3694={'where':_0x4199b0[_0x430c('0x39')]};return db[_0x430c('0x3f')]['count'](_0x3e3694)['then'](function(_0x2d6771){_0x2c13e4[_0x430c('0x1e')]=_0x2d6771;if(_0x3abe53[_0x430c('0x30')]['includeAll']){_0x4199b0[_0x430c('0x40')]=[{'all':!![]}];}return db[_0x430c('0x3f')][_0x430c('0x41')](_0x4199b0);})[_0x430c('0x26')](function(_0x58ef68){_0x2c13e4[_0x430c('0x42')]=_0x58ef68;return _0x2c13e4;})[_0x430c('0x26')](respondWithFilteredResult(_0x3ce468,_0x4199b0))['catch'](handleError(_0x3ce468,null));};exports[_0x430c('0x43')]=function(_0x2da227,_0x213197){var _0x7144a={'raw':![],'where':{'id':_0x2da227[_0x430c('0x44')]['id']}},_0x1c71a8={};_0x1c71a8['model']=_['keys'](db[_0x430c('0x3f')][_0x430c('0x45')]);_0x1c71a8[_0x430c('0x30')]=_[_0x430c('0x31')](_0x2da227[_0x430c('0x30')]);_0x1c71a8[_0x430c('0x3a')]=_[_0x430c('0x32')](_0x1c71a8[_0x430c('0x2f')],_0x1c71a8[_0x430c('0x30')]);_0x7144a[_0x430c('0x34')]=_[_0x430c('0x32')](_0x1c71a8[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x2da227[_0x430c('0x30')]['fields']));_0x7144a['attributes']=_0x7144a['attributes']['length']?_0x7144a[_0x430c('0x34')]:_0x1c71a8['model'];if(_0x2da227[_0x430c('0x30')][_0x430c('0x46')]){_0x7144a['include']=[{'all':!![]}];}_0x7144a=_[_0x430c('0x3e')]({},_0x7144a,_0x2da227['options']);return db[_0x430c('0x3f')][_0x430c('0x47')](_0x7144a)['then'](handleEntityNotFound(_0x213197,null))['then'](respondWithResult(_0x213197,null))['catch'](handleError(_0x213197,null));};exports['create']=function(_0x18f4e2,_0x4ea6bf){return db[_0x430c('0x3f')][_0x430c('0x48')](_0x18f4e2[_0x430c('0x49')],{})[_0x430c('0x26')](respondWithResult(_0x4ea6bf,0xc9))['catch'](handleError(_0x4ea6bf,null));};exports[_0x430c('0x25')]=function(_0xa09451,_0x568c4f){if(_0xa09451[_0x430c('0x49')]['id']){delete _0xa09451['body']['id'];}return db[_0x430c('0x3f')][_0x430c('0x47')]({'where':{'id':_0xa09451[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x568c4f,null))[_0x430c('0x26')](saveUpdates(_0xa09451[_0x430c('0x49')],null))['then'](respondWithResult(_0x568c4f,null))[_0x430c('0x4a')](handleError(_0x568c4f,null));};exports[_0x430c('0x4b')]=function(_0x426415,_0x2e4962){return db[_0x430c('0x3f')]['find']({'where':{'id':_0x426415['params']['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x2e4962,null))['then'](removeEntity(_0x2e4962,null))[_0x430c('0x4a')](handleError(_0x2e4962,null));};exports[_0x430c('0x4c')]=function(_0x15bd85,_0x1040c0,_0x56946d){var _0x188653={};var _0x11eb8e={};var _0x514990;var _0x4b1c56;return db[_0x430c('0x3f')][_0x430c('0x4d')]({'where':{'id':_0x15bd85[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x1040c0,null))[_0x430c('0x26')](function(_0x5e86a1){if(_0x5e86a1){_0x514990=_0x5e86a1;_0x11eb8e[_0x430c('0x2f')]=_[_0x430c('0x31')](db['DeskField'][_0x430c('0x45')]);_0x11eb8e[_0x430c('0x30')]=_[_0x430c('0x31')](_0x15bd85[_0x430c('0x30')]);_0x11eb8e[_0x430c('0x3a')]=_[_0x430c('0x32')](_0x11eb8e[_0x430c('0x2f')],_0x11eb8e[_0x430c('0x30')]);_0x188653[_0x430c('0x34')]=_[_0x430c('0x32')](_0x11eb8e[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x15bd85[_0x430c('0x30')]['fields']));_0x188653[_0x430c('0x34')]=_0x188653['attributes'][_0x430c('0x4e')]?_0x188653[_0x430c('0x34')]:_0x11eb8e[_0x430c('0x2f')];_0x188653[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x15bd85['query'][_0x430c('0x38')]);_0x188653['where']=qs[_0x430c('0x3a')](_[_0x430c('0x3b')](_0x15bd85['query'],_0x11eb8e[_0x430c('0x3a')]));if(_0x15bd85[_0x430c('0x30')][_0x430c('0x3c')]){_0x188653[_0x430c('0x39')]=_['merge'](_0x188653[_0x430c('0x39')],{'$or':_[_0x430c('0x2b')](_0x188653[_0x430c('0x34')],function(_0x46c964){var _0x591922={};_0x591922[_0x46c964]={'$like':'%'+_0x15bd85[_0x430c('0x30')]['filter']+'%'};return _0x591922;})});}_0x188653=_['merge']({},_0x188653,_0x15bd85[_0x430c('0x4f')]);return _0x514990[_0x430c('0x4c')](_0x188653);}})[_0x430c('0x26')](function(_0x1216ec){if(_0x1216ec){_0x4b1c56=_0x1216ec[_0x430c('0x4e')];if(!_0x15bd85[_0x430c('0x30')][_0x430c('0x35')]('nolimit')){_0x188653[_0x430c('0x1f')]=qs[_0x430c('0x1f')](_0x15bd85[_0x430c('0x30')]['limit']);_0x188653[_0x430c('0x1c')]=qs[_0x430c('0x1c')](_0x15bd85[_0x430c('0x30')][_0x430c('0x1c')]);}return _0x514990['getFields'](_0x188653);}})[_0x430c('0x26')](function(_0x3f6ef9){if(_0x3f6ef9){return _0x3f6ef9?{'count':_0x4b1c56,'rows':_0x3f6ef9}:null;}})['then'](respondWithResult(_0x1040c0,null))[_0x430c('0x4a')](handleError(_0x1040c0,null));};exports[_0x430c('0x50')]=function(_0x598a3d,_0x19f902,_0x1bfc3b){var _0xe037b2={};var _0x4989cc={};var _0x5b316e;var _0x11de51;return db[_0x430c('0x3f')]['findOne']({'where':{'id':_0x598a3d[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x19f902,null))[_0x430c('0x26')](function(_0x2cf921){if(_0x2cf921){_0x5b316e=_0x2cf921;_0x4989cc[_0x430c('0x2f')]=_['keys'](db[_0x430c('0x51')][_0x430c('0x45')]);_0x4989cc[_0x430c('0x30')]=_[_0x430c('0x31')](_0x598a3d[_0x430c('0x30')]);_0x4989cc['filters']=_['intersection'](_0x4989cc['model'],_0x4989cc[_0x430c('0x30')]);_0xe037b2[_0x430c('0x34')]=_[_0x430c('0x32')](_0x4989cc[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x598a3d['query'][_0x430c('0x33')]));_0xe037b2['attributes']=_0xe037b2[_0x430c('0x34')]['length']?_0xe037b2[_0x430c('0x34')]:_0x4989cc[_0x430c('0x2f')];_0xe037b2[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x598a3d['query'][_0x430c('0x38')]);_0xe037b2['where']=qs['filters'](_[_0x430c('0x3b')](_0x598a3d[_0x430c('0x30')],_0x4989cc['filters']));if(_0x598a3d['query'][_0x430c('0x3c')]){_0xe037b2[_0x430c('0x39')]=_[_0x430c('0x3e')](_0xe037b2[_0x430c('0x39')],{'$or':_[_0x430c('0x2b')](_0xe037b2[_0x430c('0x34')],function(_0x1bf76e){var _0x2344c9={};_0x2344c9[_0x1bf76e]={'$like':'%'+_0x598a3d[_0x430c('0x30')][_0x430c('0x3c')]+'%'};return _0x2344c9;})});}_0xe037b2=_[_0x430c('0x3e')]({},_0xe037b2,_0x598a3d[_0x430c('0x4f')]);return _0x5b316e[_0x430c('0x50')](_0xe037b2);}})[_0x430c('0x26')](function(_0x47b0bc){if(_0x47b0bc){_0x11de51=_0x47b0bc['length'];if(!_0x598a3d[_0x430c('0x30')][_0x430c('0x35')](_0x430c('0x36'))){_0xe037b2['limit']=qs['limit'](_0x598a3d['query']['limit']);_0xe037b2[_0x430c('0x1c')]=qs[_0x430c('0x1c')](_0x598a3d[_0x430c('0x30')]['offset']);}return _0x5b316e[_0x430c('0x50')](_0xe037b2);}})[_0x430c('0x26')](function(_0x56addb){if(_0x56addb){return _0x56addb?{'count':_0x11de51,'rows':_0x56addb}:null;}})[_0x430c('0x26')](respondWithResult(_0x19f902,null))[_0x430c('0x4a')](handleError(_0x19f902,null));};exports[_0x430c('0x52')]=function(_0x531c5e,_0x2e12a6,_0xdfbd4d){var _0x12c6d5={};var _0x471cfd={};var _0x610dfd;var _0xb4f3ed;return db['DeskConfiguration'][_0x430c('0x4d')]({'where':{'id':_0x531c5e[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x2e12a6,null))[_0x430c('0x26')](function(_0x3fb524){if(_0x3fb524){_0x610dfd=_0x3fb524;_0x471cfd[_0x430c('0x2f')]=_[_0x430c('0x31')](db[_0x430c('0x51')][_0x430c('0x45')]);_0x471cfd['query']=_[_0x430c('0x31')](_0x531c5e['query']);_0x471cfd['filters']=_['intersection'](_0x471cfd[_0x430c('0x2f')],_0x471cfd[_0x430c('0x30')]);_0x12c6d5[_0x430c('0x34')]=_[_0x430c('0x32')](_0x471cfd[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x531c5e[_0x430c('0x30')][_0x430c('0x33')]));_0x12c6d5[_0x430c('0x34')]=_0x12c6d5[_0x430c('0x34')][_0x430c('0x4e')]?_0x12c6d5['attributes']:_0x471cfd[_0x430c('0x2f')];_0x12c6d5[_0x430c('0x37')]=qs['sort'](_0x531c5e[_0x430c('0x30')][_0x430c('0x38')]);_0x12c6d5[_0x430c('0x39')]=qs[_0x430c('0x3a')](_[_0x430c('0x3b')](_0x531c5e[_0x430c('0x30')],_0x471cfd[_0x430c('0x3a')]));if(_0x531c5e[_0x430c('0x30')][_0x430c('0x3c')]){_0x12c6d5[_0x430c('0x39')]=_[_0x430c('0x3e')](_0x12c6d5[_0x430c('0x39')],{'$or':_[_0x430c('0x2b')](_0x12c6d5['attributes'],function(_0x3df8f8){var _0xee468e={};_0xee468e[_0x3df8f8]={'$like':'%'+_0x531c5e[_0x430c('0x30')]['filter']+'%'};return _0xee468e;})});}_0x12c6d5=_[_0x430c('0x3e')]({},_0x12c6d5,_0x531c5e[_0x430c('0x4f')]);return _0x610dfd['getDescriptions'](_0x12c6d5);}})[_0x430c('0x26')](function(_0x22c5d5){if(_0x22c5d5){_0xb4f3ed=_0x22c5d5[_0x430c('0x4e')];if(!_0x531c5e['query'][_0x430c('0x35')]('nolimit')){_0x12c6d5[_0x430c('0x1f')]=qs['limit'](_0x531c5e[_0x430c('0x30')]['limit']);_0x12c6d5[_0x430c('0x1c')]=qs[_0x430c('0x1c')](_0x531c5e[_0x430c('0x30')]['offset']);}return _0x610dfd['getDescriptions'](_0x12c6d5);}})[_0x430c('0x26')](function(_0x2dbed2){if(_0x2dbed2){return _0x2dbed2?{'count':_0xb4f3ed,'rows':_0x2dbed2}:null;}})[_0x430c('0x26')](respondWithResult(_0x2e12a6,null))[_0x430c('0x4a')](handleError(_0x2e12a6,null));};exports['getTags']=function(_0x37b06c,_0x3433a8,_0x4b9a72){var _0x51ab3a={};var _0x1f6e6e={};var _0x402b8d;var _0x3d3fc4;return db[_0x430c('0x3f')][_0x430c('0x4d')]({'where':{'id':_0x37b06c[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x3433a8,null))[_0x430c('0x26')](function(_0x322c95){if(_0x322c95){_0x402b8d=_0x322c95;_0x1f6e6e[_0x430c('0x2f')]=_[_0x430c('0x31')](db['Tag'][_0x430c('0x45')]);_0x1f6e6e['query']=_['keys'](_0x37b06c['query']);_0x1f6e6e[_0x430c('0x3a')]=_[_0x430c('0x32')](_0x1f6e6e[_0x430c('0x2f')],_0x1f6e6e[_0x430c('0x30')]);_0x51ab3a['attributes']=_[_0x430c('0x32')](_0x1f6e6e[_0x430c('0x2f')],qs[_0x430c('0x33')](_0x37b06c[_0x430c('0x30')][_0x430c('0x33')]));_0x51ab3a[_0x430c('0x34')]=_0x51ab3a['attributes'][_0x430c('0x4e')]?_0x51ab3a[_0x430c('0x34')]:_0x1f6e6e[_0x430c('0x2f')];_0x51ab3a[_0x430c('0x37')]=qs[_0x430c('0x38')](_0x37b06c['query']['sort']);_0x51ab3a[_0x430c('0x39')]=qs[_0x430c('0x3a')](_[_0x430c('0x3b')](_0x37b06c[_0x430c('0x30')],_0x1f6e6e[_0x430c('0x3a')]));if(_0x37b06c[_0x430c('0x30')][_0x430c('0x3c')]){_0x51ab3a[_0x430c('0x39')]=_[_0x430c('0x3e')](_0x51ab3a[_0x430c('0x39')],{'$or':_[_0x430c('0x2b')](_0x51ab3a[_0x430c('0x34')],function(_0x402de7){var _0xe06448={};_0xe06448[_0x402de7]={'$like':'%'+_0x37b06c[_0x430c('0x30')][_0x430c('0x3c')]+'%'};return _0xe06448;})});}_0x51ab3a=_[_0x430c('0x3e')]({},_0x51ab3a,_0x37b06c[_0x430c('0x4f')]);return _0x402b8d['getTags'](_0x51ab3a);}})[_0x430c('0x26')](function(_0x35cfa7){if(_0x35cfa7){_0x3d3fc4=_0x35cfa7[_0x430c('0x4e')];if(!_0x37b06c[_0x430c('0x30')][_0x430c('0x35')](_0x430c('0x36'))){_0x51ab3a[_0x430c('0x1f')]=qs['limit'](_0x37b06c[_0x430c('0x30')][_0x430c('0x1f')]);_0x51ab3a[_0x430c('0x1c')]=qs[_0x430c('0x1c')](_0x37b06c[_0x430c('0x30')][_0x430c('0x1c')]);}return _0x402b8d['getTags'](_0x51ab3a);}})['then'](function(_0x3d483e){if(_0x3d483e){return _0x3d483e?{'count':_0x3d3fc4,'rows':_0x3d483e}:null;}})[_0x430c('0x26')](respondWithResult(_0x3433a8,null))[_0x430c('0x4a')](handleError(_0x3433a8,null));};exports[_0x430c('0x53')]=function(_0x583af4,_0x1ed8ba,_0x35a28d){if(_0x583af4[_0x430c('0x49')]['id']){delete _0x583af4['body']['id'];}return db[_0x430c('0x3f')][_0x430c('0x4d')]({'where':{'id':_0x583af4[_0x430c('0x44')]['id']}})[_0x430c('0x26')](handleEntityNotFound(_0x1ed8ba,null))['then'](function(_0x5dfb39){if(_0x5dfb39){return _0x5dfb39[_0x430c('0x53')](_0x583af4[_0x430c('0x49')][_0x430c('0x54')]||[]);}return null;})['then'](respondWithResult(_0x1ed8ba,null))[_0x430c('0x4a')](handleError(_0x1ed8ba,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 265dd90..5380f86 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 _0x71e2=['../../config/logger','api','moment','request-promise','path','rimraf','exports','define','DeskConfiguration','int_desk_configurations','util'];(function(_0x335986,_0x2225b0){var _0x4520af=function(_0x58046d){while(--_0x58046d){_0x335986['push'](_0x335986['shift']());}};_0x4520af(++_0x2225b0);}(_0x71e2,0x99));var _0x271e=function(_0x239804,_0x5adcea){_0x239804=_0x239804-0x0;var _0x5ab826=_0x71e2[_0x239804];return _0x5ab826;};'use strict';var _=require('lodash');var util=require(_0x271e('0x0'));var logger=require(_0x271e('0x1'))(_0x271e('0x2'));var moment=require(_0x271e('0x3'));var BPromise=require('bluebird');var rp=require(_0x271e('0x4'));var fs=require('fs');var path=require(_0x271e('0x5'));var rimraf=require(_0x271e('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x271e('0x7')]=function(_0x48dc14,_0x7fa8cb){return _0x48dc14[_0x271e('0x8')](_0x271e('0x9'),attributes,{'tableName':_0x271e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8127=['./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1efae0,_0x5534cd){var _0x8d8a5b=function(_0x4b9872){while(--_0x4b9872){_0x1efae0['push'](_0x1efae0['shift']());}};_0x8d8a5b(++_0x5534cd);}(_0x8127,0x1d1));var _0x7812=function(_0x3ce7cf,_0x32159a){_0x3ce7cf=_0x3ce7cf-0x0;var _0x49abd6=_0x8127[_0x3ce7cf];return _0x49abd6;};'use strict';var _=require('lodash');var util=require(_0x7812('0x0'));var logger=require(_0x7812('0x1'))(_0x7812('0x2'));var moment=require(_0x7812('0x3'));var BPromise=require(_0x7812('0x4'));var rp=require(_0x7812('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7812('0x6'));var config=require(_0x7812('0x7'));var attributes=require(_0x7812('0x8'));module['exports']=function(_0x5c4305,_0x2392f5){return _0x5c4305['define'](_0x7812('0x9'),attributes,{'tableName':_0x7812('0xa'),'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 f500376..57027f0 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 _0x552c=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x13b2a7,_0x3fc11a){var _0x282bff=function(_0x517dfd){while(--_0x517dfd){_0x13b2a7['push'](_0x13b2a7['shift']());}};_0x282bff(++_0x3fc11a);}(_0x552c,0xa0));var _0xc552=function(_0x5d2f0c,_0x2d0172){_0x5d2f0c=_0x5d2f0c-0x0;var _0xa5f33f=_0x552c[_0x5d2f0c];return _0xa5f33f;};'use strict';var _=require('lodash');var util=require(_0xc552('0x0'));var moment=require(_0xc552('0x1'));var BPromise=require(_0xc552('0x2'));var rs=require(_0xc552('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(_0xc552('0x4'));var jayson=require(_0xc552('0x5'));var client=jayson[_0xc552('0x6')][_0xc552('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c383d,_0x1e52ea,_0xea3322){return new BPromise(function(_0x3cb4d3,_0x568306){return client[_0xc552('0x8')](_0x1c383d,_0xea3322)['then'](function(_0x437317){logger['info'](_0xc552('0x9'),_0x1e52ea,_0xc552('0xa'));logger[_0xc552('0xb')](_0xc552('0xc'),_0x1e52ea,'request\x20sent',JSON[_0xc552('0xd')](_0x437317));if(_0x437317[_0xc552('0xe')]){if(_0x437317[_0xc552('0xe')][_0xc552('0xf')]===0x1f4){logger['error'](_0xc552('0x9'),_0x1e52ea,_0x437317[_0xc552('0xe')][_0xc552('0x10')]);return _0x568306(_0x437317[_0xc552('0xe')][_0xc552('0x10')]);}logger['error'](_0xc552('0x9'),_0x1e52ea,_0x437317[_0xc552('0xe')][_0xc552('0x10')]);return _0x3cb4d3(_0x437317['error'][_0xc552('0x10')]);}else{logger['info'](_0xc552('0x9'),_0x1e52ea,'request\x20sent');_0x3cb4d3(_0x437317[_0xc552('0x11')][_0xc552('0x10')]);}})[_0xc552('0x12')](function(_0x26ae4e){logger[_0xc552('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x1e52ea,_0x26ae4e);_0x568306(_0x26ae4e);});});} \ No newline at end of file +var _0xb2ca=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x4739d3,_0x58e591){var _0x49cfed=function(_0x334cb6){while(--_0x334cb6){_0x4739d3['push'](_0x4739d3['shift']());}};_0x49cfed(++_0x58e591);}(_0xb2ca,0x1a8));var _0xab2c=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb2ca[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var moment=require('moment');var BPromise=require(_0xab2c('0x2'));var rs=require(_0xab2c('0x3'));var fs=require('fs');var Redis=require(_0xab2c('0x4'));var db=require(_0xab2c('0x5'))['db'];var utils=require(_0xab2c('0x6'));var logger=require(_0xab2c('0x7'))(_0xab2c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab2c('0x9')][_0xab2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2632f8,_0x4eb3c0,_0x33adc7){return new BPromise(function(_0x1ed705,_0x2bff20){return client[_0xab2c('0xb')](_0x2632f8,_0x33adc7)[_0xab2c('0xc')](function(_0x1b86a0){logger['info'](_0xab2c('0xd'),_0x4eb3c0,_0xab2c('0xe'));logger[_0xab2c('0xf')](_0xab2c('0x10'),_0x4eb3c0,_0xab2c('0xe'),JSON[_0xab2c('0x11')](_0x1b86a0));if(_0x1b86a0[_0xab2c('0x12')]){if(_0x1b86a0[_0xab2c('0x12')][_0xab2c('0x13')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4eb3c0,_0x1b86a0[_0xab2c('0x12')][_0xab2c('0x14')]);return _0x2bff20(_0x1b86a0[_0xab2c('0x12')][_0xab2c('0x14')]);}logger[_0xab2c('0x12')](_0xab2c('0xd'),_0x4eb3c0,_0x1b86a0['error'][_0xab2c('0x14')]);return _0x1ed705(_0x1b86a0[_0xab2c('0x12')][_0xab2c('0x14')]);}else{logger[_0xab2c('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x4eb3c0,'request\x20sent');_0x1ed705(_0x1b86a0['result'][_0xab2c('0x14')]);}})[_0xab2c('0x16')](function(_0x2b4703){logger[_0xab2c('0x12')](_0xab2c('0xd'),_0x4eb3c0,_0x2b4703);_0x2bff20(_0x2b4703);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index fc979be..193d845 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 _0xb2ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x101713,_0x5fd5cd){var _0x22dab7=function(_0x319850){while(--_0x319850){_0x101713['push'](_0x101713['shift']());}};_0x22dab7(++_0x5fd5cd);}(_0xb2ed,0x86));var _0xdb2e=function(_0x3d9176,_0x399d6f){_0x3d9176=_0x3d9176-0x0;var _0x12adc5=_0xb2ed[_0x3d9176];return _0x12adc5;};'use strict';var multer=require(_0xdb2e('0x0'));var util=require(_0xdb2e('0x1'));var path=require('path');var timeout=require(_0xdb2e('0x2'));var express=require(_0xdb2e('0x3'));var router=express[_0xdb2e('0x4')]();var fs_extra=require(_0xdb2e('0x5'));var auth=require(_0xdb2e('0x6'));var interaction=require(_0xdb2e('0x7'));var config=require(_0xdb2e('0x8'));var controller=require(_0xdb2e('0x9'));router['get']('/',auth[_0xdb2e('0xa')](),controller[_0xdb2e('0xb')]);router[_0xdb2e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xdb2e('0xd')]);router[_0xdb2e('0xe')]('/',auth['isAuthenticated'](),controller[_0xdb2e('0xf')]);router[_0xdb2e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xdb2e('0x11')]);router[_0xdb2e('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdb2e('0x13')]=router; \ No newline at end of file +var _0x4f8f=['fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','util','express'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x4f8f,0x175));var _0xf4f8=function(_0x277097,_0x13c132){_0x277097=_0x277097-0x0;var _0x296d83=_0x4f8f[_0x277097];return _0x296d83;};'use strict';var multer=require('multer');var util=require(_0xf4f8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4f8('0x1'));var router=express['Router']();var fs_extra=require(_0xf4f8('0x2'));var auth=require(_0xf4f8('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf4f8('0x4'));router['get']('/',auth[_0xf4f8('0x5')](),controller[_0xf4f8('0x6')]);router[_0xf4f8('0x7')](_0xf4f8('0x8'),auth[_0xf4f8('0x5')](),controller[_0xf4f8('0x9')]);router['post']('/',auth[_0xf4f8('0x5')](),controller[_0xf4f8('0xa')]);router[_0xf4f8('0xb')](_0xf4f8('0x8'),auth[_0xf4f8('0x5')](),controller[_0xf4f8('0xc')]);router[_0xf4f8('0xd')](_0xf4f8('0x8'),auth[_0xf4f8('0x5')](),controller[_0xf4f8('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index fc774a4..189c67a 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 _0x3ea5=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports','string'];(function(_0xd64ea1,_0x5a40d9){var _0x11a857=function(_0x32b046){while(--_0x32b046){_0xd64ea1['push'](_0xd64ea1['shift']());}};_0x11a857(++_0x5a40d9);}(_0x3ea5,0xe5));var _0x53ea=function(_0x3efbc0,_0x3d627c){_0x3efbc0=_0x3efbc0-0x0;var _0x19b805=_0x3ea5[_0x3efbc0];return _0x19b805;};'use strict';var Sequelize=require(_0x53ea('0x0'));module[_0x53ea('0x1')]={'type':{'type':Sequelize['ENUM'](_0x53ea('0x2'),_0x53ea('0x3'),_0x53ea('0x4'),_0x53ea('0x5'),'picklist'),'defaultValue':_0x53ea('0x2')},'content':{'type':Sequelize[_0x53ea('0x6')]},'key':{'type':Sequelize[_0x53ea('0x6')]},'keyType':{'type':Sequelize[_0x53ea('0x7')](_0x53ea('0x2'),_0x53ea('0x3'),_0x53ea('0x4'))},'keyContent':{'type':Sequelize[_0x53ea('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x53ea('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x53ea('0x6')]}}; \ No newline at end of file +var _0x2849=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x1628e0,_0x54f893){var _0x2101e3=function(_0x1f6598){while(--_0x1f6598){_0x1628e0['push'](_0x1628e0['shift']());}};_0x2101e3(++_0x54f893);}(_0x2849,0x1af));var _0x9284=function(_0x46c328,_0x588845){_0x46c328=_0x46c328-0x0;var _0x41450a=_0x2849[_0x46c328];return _0x41450a;};'use strict';var Sequelize=require(_0x9284('0x0'));module['exports']={'type':{'type':Sequelize[_0x9284('0x1')](_0x9284('0x2'),_0x9284('0x3'),_0x9284('0x4'),_0x9284('0x5'),_0x9284('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9284('0x7')]},'keyType':{'type':Sequelize[_0x9284('0x1')](_0x9284('0x2'),_0x9284('0x3'),_0x9284('0x4'))},'keyContent':{'type':Sequelize[_0x9284('0x7')]},'idField':{'type':Sequelize[_0x9284('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9284('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index adb527f..2c0ada0 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 _0x7919=['nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','include','show','rawAttributes','includeAll','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','name','map','DeskField','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x1745df,_0x44077b){var _0x39e1d5=function(_0x1fb197){while(--_0x1fb197){_0x1745df['push'](_0x1745df['shift']());}};_0x39e1d5(++_0x44077b);}(_0x7919,0xeb));var _0x9791=function(_0x221e05,_0x15b733){_0x221e05=_0x221e05-0x0;var _0x27770c=_0x7919[_0x221e05];return _0x27770c;};'use strict';var emlformat=require(_0x9791('0x0'));var rimraf=require(_0x9791('0x1'));var zipdir=require(_0x9791('0x2'));var jsonpatch=require(_0x9791('0x3'));var rp=require(_0x9791('0x4'));var moment=require(_0x9791('0x5'));var BPromise=require(_0x9791('0x6'));var Mustache=require('mustache');var util=require(_0x9791('0x7'));var path=require(_0x9791('0x8'));var sox=require('sox');var csv=require(_0x9791('0x9'));var ejs=require(_0x9791('0xa'));var fs=require('fs');var fs_extra=require(_0x9791('0xb'));var _=require(_0x9791('0xc'));var squel=require(_0x9791('0xd'));var crypto=require('crypto');var jsforce=require(_0x9791('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9791('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9791('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9791('0x10'));var as=require(_0x9791('0x11'));var hardwareService=require(_0x9791('0x12'));var logger=require(_0x9791('0x13'))(_0x9791('0x14'));var utils=require(_0x9791('0x15'));var config=require(_0x9791('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9791('0x17'))['db'];function respondWithStatusCode(_0x54b75d,_0xa2d583){_0xa2d583=_0xa2d583||0xcc;return function(_0x3dc66b){if(_0x3dc66b){return _0x54b75d['sendStatus'](_0xa2d583);}return _0x54b75d[_0x9791('0x18')](_0xa2d583)['end']();};}function respondWithResult(_0x197e83,_0x4602fc){_0x4602fc=_0x4602fc||0xc8;return function(_0x1e05a2){if(_0x1e05a2){return _0x197e83[_0x9791('0x18')](_0x4602fc)[_0x9791('0x19')](_0x1e05a2);}};}function respondWithFilteredResult(_0x1672d9,_0x2bd7a6){return function(_0x3e1eca){if(_0x3e1eca){var _0x1b3626=typeof _0x2bd7a6[_0x9791('0x1a')]===_0x9791('0x1b')&&typeof _0x2bd7a6[_0x9791('0x1c')]===_0x9791('0x1b');var _0x566a69=_0x3e1eca[_0x9791('0x1d')];var _0x402c83=_0x1b3626?0x0:_0x2bd7a6[_0x9791('0x1a')];var _0x2962ae=_0x1b3626?_0x3e1eca[_0x9791('0x1d')]:_0x2bd7a6['offset']+_0x2bd7a6[_0x9791('0x1c')];var _0x6d90c9;if(_0x2962ae>=_0x566a69){_0x2962ae=_0x566a69;_0x6d90c9=0xc8;}else{_0x6d90c9=0xce;}_0x1672d9[_0x9791('0x18')](_0x6d90c9);return _0x1672d9[_0x9791('0x1e')](_0x9791('0x1f'),_0x402c83+'-'+_0x2962ae+'/'+_0x566a69)[_0x9791('0x19')](_0x3e1eca);}return null;};}function patchUpdates(_0x36e5f7){return function(_0x377ec9){try{jsonpatch[_0x9791('0x20')](_0x377ec9,_0x36e5f7,!![]);}catch(_0x27a5e4){return BPromise[_0x9791('0x21')](_0x27a5e4);}return _0x377ec9['save']();};}function saveUpdates(_0x2d29f8,_0x4ec262){return function(_0x4fe98f){if(_0x4fe98f){return _0x4fe98f[_0x9791('0x22')](_0x2d29f8)[_0x9791('0x23')](function(_0x557e2b){return _0x557e2b;});}return null;};}function removeEntity(_0x189251,_0x72e127){return function(_0x7f08c8){if(_0x7f08c8){return _0x7f08c8['destroy']()[_0x9791('0x23')](function(){_0x189251[_0x9791('0x18')](0xcc)[_0x9791('0x24')]();});}};}function handleEntityNotFound(_0x4c3c00,_0x1c188b){return function(_0x5264b6){if(!_0x5264b6){_0x4c3c00[_0x9791('0x25')](0x194);}return _0x5264b6;};}function handleError(_0x15beb8,_0x50760e){_0x50760e=_0x50760e||0x1f4;return function(_0x852e59){logger['error'](_0x852e59[_0x9791('0x26')]);if(_0x852e59['name']){delete _0x852e59[_0x9791('0x27')];}_0x15beb8[_0x9791('0x18')](_0x50760e)['send'](_0x852e59);};}exports['index']=function(_0x55614a,_0x339932){var _0x228703={},_0x24bb84={},_0xf84fe3={'count':0x0,'rows':[]};var _0x52a5d7=_[_0x9791('0x28')](db[_0x9791('0x29')]['rawAttributes'],function(_0x1814fa){return{'name':_0x1814fa[_0x9791('0x2a')],'type':_0x1814fa[_0x9791('0x2b')][_0x9791('0x2c')]};});_0x24bb84[_0x9791('0x2d')]=_[_0x9791('0x28')](_0x52a5d7,'name');_0x24bb84[_0x9791('0x2e')]=_[_0x9791('0x2f')](_0x55614a[_0x9791('0x2e')]);_0x24bb84['filters']=_[_0x9791('0x30')](_0x24bb84['model'],_0x24bb84[_0x9791('0x2e')]);_0x228703['attributes']=_['intersection'](_0x24bb84[_0x9791('0x2d')],qs['fields'](_0x55614a[_0x9791('0x2e')][_0x9791('0x31')]));_0x228703['attributes']=_0x228703[_0x9791('0x32')][_0x9791('0x33')]?_0x228703[_0x9791('0x32')]:_0x24bb84['model'];if(!_0x55614a[_0x9791('0x2e')][_0x9791('0x34')](_0x9791('0x35'))){_0x228703['limit']=qs[_0x9791('0x1c')](_0x55614a['query'][_0x9791('0x1c')]);_0x228703['offset']=qs[_0x9791('0x1a')](_0x55614a[_0x9791('0x2e')]['offset']);}_0x228703[_0x9791('0x36')]=qs[_0x9791('0x37')](_0x55614a[_0x9791('0x2e')][_0x9791('0x37')]);_0x228703[_0x9791('0x38')]=qs['filters'](_[_0x9791('0x39')](_0x55614a[_0x9791('0x2e')],_0x24bb84[_0x9791('0x3a')]),_0x52a5d7);if(_0x55614a[_0x9791('0x2e')][_0x9791('0x3b')]){_0x228703[_0x9791('0x38')]=_[_0x9791('0x3c')](_0x228703['where'],{'$or':_[_0x9791('0x28')](_0x52a5d7,function(_0x36aaef){if(_0x36aaef['type']!==_0x9791('0x3d')){var _0x5ae670={};_0x5ae670[_0x36aaef[_0x9791('0x27')]]={'$like':'%'+_0x55614a[_0x9791('0x2e')]['filter']+'%'};return _0x5ae670;}})});}_0x228703=_[_0x9791('0x3c')]({},_0x228703,_0x55614a['options']);var _0x205471={'where':_0x228703['where']};return db[_0x9791('0x29')]['count'](_0x205471)['then'](function(_0xa96c90){_0xf84fe3[_0x9791('0x1d')]=_0xa96c90;if(_0x55614a['query']['includeAll']){_0x228703[_0x9791('0x3e')]=[{'all':!![]}];}return db[_0x9791('0x29')]['findAll'](_0x228703);})[_0x9791('0x23')](function(_0x4497de){_0xf84fe3['rows']=_0x4497de;return _0xf84fe3;})[_0x9791('0x23')](respondWithFilteredResult(_0x339932,_0x228703))['catch'](handleError(_0x339932,null));};exports[_0x9791('0x3f')]=function(_0x54383c,_0x5e2604){var _0x3c8073={'raw':!![],'where':{'id':_0x54383c['params']['id']}},_0x291d96={};_0x291d96['model']=_[_0x9791('0x2f')](db[_0x9791('0x29')][_0x9791('0x40')]);_0x291d96[_0x9791('0x2e')]=_[_0x9791('0x2f')](_0x54383c[_0x9791('0x2e')]);_0x291d96[_0x9791('0x3a')]=_[_0x9791('0x30')](_0x291d96[_0x9791('0x2d')],_0x291d96['query']);_0x3c8073[_0x9791('0x32')]=_[_0x9791('0x30')](_0x291d96[_0x9791('0x2d')],qs[_0x9791('0x31')](_0x54383c[_0x9791('0x2e')][_0x9791('0x31')]));_0x3c8073[_0x9791('0x32')]=_0x3c8073['attributes'][_0x9791('0x33')]?_0x3c8073[_0x9791('0x32')]:_0x291d96[_0x9791('0x2d')];if(_0x54383c[_0x9791('0x2e')][_0x9791('0x41')]){_0x3c8073[_0x9791('0x3e')]=[{'all':!![]}];}_0x3c8073=_[_0x9791('0x3c')]({},_0x3c8073,_0x54383c[_0x9791('0x42')]);return db['DeskField'][_0x9791('0x43')](_0x3c8073)[_0x9791('0x23')](handleEntityNotFound(_0x5e2604,null))[_0x9791('0x23')](respondWithResult(_0x5e2604,null))[_0x9791('0x44')](handleError(_0x5e2604,null));};exports['create']=function(_0x3df77c,_0x152245){return db[_0x9791('0x29')][_0x9791('0x45')](_0x3df77c[_0x9791('0x46')],{})['then'](respondWithResult(_0x152245,0xc9))[_0x9791('0x44')](handleError(_0x152245,null));};exports['update']=function(_0x23678e,_0xd3c149){if(_0x23678e[_0x9791('0x46')]['id']){delete _0x23678e[_0x9791('0x46')]['id'];}return db[_0x9791('0x29')][_0x9791('0x43')]({'where':{'id':_0x23678e['params']['id']}})[_0x9791('0x23')](handleEntityNotFound(_0xd3c149,null))[_0x9791('0x23')](saveUpdates(_0x23678e['body'],null))[_0x9791('0x23')](respondWithResult(_0xd3c149,null))['catch'](handleError(_0xd3c149,null));};exports['destroy']=function(_0x2997be,_0x1fd2ac){return db[_0x9791('0x29')][_0x9791('0x43')]({'where':{'id':_0x2997be[_0x9791('0x47')]['id']}})[_0x9791('0x23')](handleEntityNotFound(_0x1fd2ac,null))[_0x9791('0x23')](removeEntity(_0x1fd2ac,null))[_0x9791('0x44')](handleError(_0x1fd2ac,null));}; \ No newline at end of file +var _0x494e=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskField','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','merge','find','catch','create','body','params','eml-format','zip-dir','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x494e,0xd6));var _0xe494=function(_0x34e8a2,_0x23809d){_0x34e8a2=_0x34e8a2-0x0;var _0x4b59af=_0x494e[_0x34e8a2];return _0x4b59af;};'use strict';var emlformat=require(_0xe494('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe494('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe494('0x2'));var BPromise=require(_0xe494('0x3'));var Mustache=require(_0xe494('0x4'));var util=require(_0xe494('0x5'));var path=require(_0xe494('0x6'));var sox=require(_0xe494('0x7'));var csv=require(_0xe494('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe494('0x9'));var squel=require(_0xe494('0xa'));var crypto=require(_0xe494('0xb'));var jsforce=require(_0xe494('0xc'));var deskjs=require(_0xe494('0xd'));var toCsv=require(_0xe494('0x8'));var querystring=require(_0xe494('0xe'));var Papa=require('papaparse');var Redis=require(_0xe494('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe494('0x10'));var hardwareService=require(_0xe494('0x11'));var logger=require(_0xe494('0x12'))(_0xe494('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe494('0x14'))['db'];function respondWithStatusCode(_0xbd223f,_0x43c3be){_0x43c3be=_0x43c3be||0xcc;return function(_0x51f733){if(_0x51f733){return _0xbd223f[_0xe494('0x15')](_0x43c3be);}return _0xbd223f[_0xe494('0x16')](_0x43c3be)[_0xe494('0x17')]();};}function respondWithResult(_0x2fa579,_0x57afbf){_0x57afbf=_0x57afbf||0xc8;return function(_0x1d6a4c){if(_0x1d6a4c){return _0x2fa579['status'](_0x57afbf)['json'](_0x1d6a4c);}};}function respondWithFilteredResult(_0x1158ec,_0xa43ef2){return function(_0x317c23){if(_0x317c23){var _0x34744a=typeof _0xa43ef2['offset']===_0xe494('0x18')&&typeof _0xa43ef2[_0xe494('0x19')]===_0xe494('0x18');var _0x524ec2=_0x317c23[_0xe494('0x1a')];var _0x5737b8=_0x34744a?0x0:_0xa43ef2['offset'];var _0x411dba=_0x34744a?_0x317c23[_0xe494('0x1a')]:_0xa43ef2[_0xe494('0x1b')]+_0xa43ef2[_0xe494('0x19')];var _0x4465e1;if(_0x411dba>=_0x524ec2){_0x411dba=_0x524ec2;_0x4465e1=0xc8;}else{_0x4465e1=0xce;}_0x1158ec[_0xe494('0x16')](_0x4465e1);return _0x1158ec[_0xe494('0x1c')]('Content-Range',_0x5737b8+'-'+_0x411dba+'/'+_0x524ec2)[_0xe494('0x1d')](_0x317c23);}return null;};}function patchUpdates(_0x3bc181){return function(_0xa3dd6a){try{jsonpatch[_0xe494('0x1e')](_0xa3dd6a,_0x3bc181,!![]);}catch(_0x3bb951){return BPromise[_0xe494('0x1f')](_0x3bb951);}return _0xa3dd6a[_0xe494('0x20')]();};}function saveUpdates(_0x12454d,_0x44ddda){return function(_0x3ea711){if(_0x3ea711){return _0x3ea711[_0xe494('0x21')](_0x12454d)[_0xe494('0x22')](function(_0x39b02a){return _0x39b02a;});}return null;};}function removeEntity(_0x4cbb2a,_0x22267d){return function(_0x1847ca){if(_0x1847ca){return _0x1847ca[_0xe494('0x23')]()['then'](function(){_0x4cbb2a[_0xe494('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8447e8,_0x58c4ce){return function(_0x540d67){if(!_0x540d67){_0x8447e8[_0xe494('0x15')](0x194);}return _0x540d67;};}function handleError(_0x7277a,_0x49b3b2){_0x49b3b2=_0x49b3b2||0x1f4;return function(_0x3390bd){logger[_0xe494('0x24')](_0x3390bd[_0xe494('0x25')]);if(_0x3390bd['name']){delete _0x3390bd[_0xe494('0x26')];}_0x7277a[_0xe494('0x16')](_0x49b3b2)[_0xe494('0x27')](_0x3390bd);};}exports['index']=function(_0x191de7,_0x2571ef){var _0x4fc686={},_0x58d3f9={},_0x4940ca={'count':0x0,'rows':[]};var _0x4f693f=_[_0xe494('0x28')](db[_0xe494('0x29')]['rawAttributes'],function(_0x49fb81){return{'name':_0x49fb81[_0xe494('0x2a')],'type':_0x49fb81['type'][_0xe494('0x2b')]};});_0x58d3f9['model']=_[_0xe494('0x28')](_0x4f693f,'name');_0x58d3f9[_0xe494('0x2c')]=_['keys'](_0x191de7[_0xe494('0x2c')]);_0x58d3f9[_0xe494('0x2d')]=_[_0xe494('0x2e')](_0x58d3f9[_0xe494('0x2f')],_0x58d3f9['query']);_0x4fc686[_0xe494('0x30')]=_[_0xe494('0x2e')](_0x58d3f9[_0xe494('0x2f')],qs[_0xe494('0x31')](_0x191de7[_0xe494('0x2c')][_0xe494('0x31')]));_0x4fc686[_0xe494('0x30')]=_0x4fc686[_0xe494('0x30')][_0xe494('0x32')]?_0x4fc686[_0xe494('0x30')]:_0x58d3f9['model'];if(!_0x191de7['query'][_0xe494('0x33')](_0xe494('0x34'))){_0x4fc686[_0xe494('0x19')]=qs['limit'](_0x191de7['query'][_0xe494('0x19')]);_0x4fc686['offset']=qs[_0xe494('0x1b')](_0x191de7[_0xe494('0x2c')]['offset']);}_0x4fc686['order']=qs['sort'](_0x191de7[_0xe494('0x2c')][_0xe494('0x35')]);_0x4fc686[_0xe494('0x36')]=qs['filters'](_[_0xe494('0x37')](_0x191de7['query'],_0x58d3f9[_0xe494('0x2d')]),_0x4f693f);if(_0x191de7['query'][_0xe494('0x38')]){_0x4fc686['where']=_['merge'](_0x4fc686['where'],{'$or':_[_0xe494('0x28')](_0x4f693f,function(_0x256864){if(_0x256864[_0xe494('0x39')]!==_0xe494('0x3a')){var _0x4af235={};_0x4af235[_0x256864[_0xe494('0x26')]]={'$like':'%'+_0x191de7[_0xe494('0x2c')][_0xe494('0x38')]+'%'};return _0x4af235;}})});}_0x4fc686=_['merge']({},_0x4fc686,_0x191de7[_0xe494('0x3b')]);var _0x3327ca={'where':_0x4fc686[_0xe494('0x36')]};return db[_0xe494('0x29')][_0xe494('0x1a')](_0x3327ca)['then'](function(_0x3a9fa0){_0x4940ca[_0xe494('0x1a')]=_0x3a9fa0;if(_0x191de7['query']['includeAll']){_0x4fc686[_0xe494('0x3c')]=[{'all':!![]}];}return db[_0xe494('0x29')][_0xe494('0x3d')](_0x4fc686);})[_0xe494('0x22')](function(_0x2d7bb2){_0x4940ca[_0xe494('0x3e')]=_0x2d7bb2;return _0x4940ca;})[_0xe494('0x22')](respondWithFilteredResult(_0x2571ef,_0x4fc686))['catch'](handleError(_0x2571ef,null));};exports[_0xe494('0x3f')]=function(_0x164075,_0x28b6e7){var _0x34f3d6={'raw':!![],'where':{'id':_0x164075['params']['id']}},_0x464dd4={};_0x464dd4['model']=_[_0xe494('0x40')](db[_0xe494('0x29')][_0xe494('0x41')]);_0x464dd4[_0xe494('0x2c')]=_[_0xe494('0x40')](_0x164075[_0xe494('0x2c')]);_0x464dd4[_0xe494('0x2d')]=_[_0xe494('0x2e')](_0x464dd4[_0xe494('0x2f')],_0x464dd4['query']);_0x34f3d6[_0xe494('0x30')]=_['intersection'](_0x464dd4['model'],qs[_0xe494('0x31')](_0x164075['query'][_0xe494('0x31')]));_0x34f3d6[_0xe494('0x30')]=_0x34f3d6[_0xe494('0x30')]['length']?_0x34f3d6['attributes']:_0x464dd4[_0xe494('0x2f')];if(_0x164075[_0xe494('0x2c')][_0xe494('0x42')]){_0x34f3d6['include']=[{'all':!![]}];}_0x34f3d6=_[_0xe494('0x43')]({},_0x34f3d6,_0x164075[_0xe494('0x3b')]);return db[_0xe494('0x29')][_0xe494('0x44')](_0x34f3d6)[_0xe494('0x22')](handleEntityNotFound(_0x28b6e7,null))['then'](respondWithResult(_0x28b6e7,null))[_0xe494('0x45')](handleError(_0x28b6e7,null));};exports[_0xe494('0x46')]=function(_0x488f10,_0x9be151){return db[_0xe494('0x29')][_0xe494('0x46')](_0x488f10[_0xe494('0x47')],{})[_0xe494('0x22')](respondWithResult(_0x9be151,0xc9))['catch'](handleError(_0x9be151,null));};exports[_0xe494('0x21')]=function(_0x506d15,_0x2a0271){if(_0x506d15[_0xe494('0x47')]['id']){delete _0x506d15[_0xe494('0x47')]['id'];}return db[_0xe494('0x29')][_0xe494('0x44')]({'where':{'id':_0x506d15[_0xe494('0x48')]['id']}})[_0xe494('0x22')](handleEntityNotFound(_0x2a0271,null))['then'](saveUpdates(_0x506d15[_0xe494('0x47')],null))[_0xe494('0x22')](respondWithResult(_0x2a0271,null))[_0xe494('0x45')](handleError(_0x2a0271,null));};exports[_0xe494('0x23')]=function(_0x56b86a,_0x54f619){return db['DeskField'][_0xe494('0x44')]({'where':{'id':_0x56b86a[_0xe494('0x48')]['id']}})[_0xe494('0x22')](handleEntityNotFound(_0x54f619,null))[_0xe494('0x22')](removeEntity(_0x54f619,null))['catch'](handleError(_0x54f619,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 93f3169..2f7661a 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 _0x0cf1=['idField','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','desk_unique_index'];(function(_0x4100ba,_0xa2460e){var _0x57a4f3=function(_0x528887){while(--_0x528887){_0x4100ba['push'](_0x4100ba['shift']());}};_0x57a4f3(++_0xa2460e);}(_0x0cf1,0x69));var _0x10cf=function(_0x272ac6,_0x2e1cb2){_0x272ac6=_0x272ac6-0x0;var _0xc969ff=_0x0cf1[_0x272ac6];return _0xc969ff;};'use strict';var _=require('lodash');var util=require(_0x10cf('0x0'));var logger=require(_0x10cf('0x1'))(_0x10cf('0x2'));var moment=require(_0x10cf('0x3'));var BPromise=require(_0x10cf('0x4'));var rp=require(_0x10cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10cf('0x6'));var config=require(_0x10cf('0x7'));var attributes=require(_0x10cf('0x8'));module[_0x10cf('0x9')]=function(_0x2d095c,_0x16e9ab){return _0x2d095c[_0x10cf('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x10cf('0xb'),'fields':[_0x10cf('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7f9=['util','api','request-promise','path','rimraf','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField'];(function(_0x1ee0a2,_0x403df7){var _0x20dae2=function(_0x4b58c8){while(--_0x4b58c8){_0x1ee0a2['push'](_0x1ee0a2['shift']());}};_0x20dae2(++_0x403df7);}(_0xe7f9,0x79));var _0x9e7f=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xe7f9[_0x35e75a];return _0xb23c7f;};'use strict';var _=require('lodash');var util=require(_0x9e7f('0x0'));var logger=require('../../config/logger')(_0x9e7f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9e7f('0x2'));var fs=require('fs');var path=require(_0x9e7f('0x3'));var rimraf=require(_0x9e7f('0x4'));var config=require('../../config/environment');var attributes=require(_0x9e7f('0x5'));module[_0x9e7f('0x6')]=function(_0x43a336,_0x2d002a){return _0x43a336[_0x9e7f('0x7')]('DeskField',attributes,{'tableName':_0x9e7f('0x8'),'paranoid':![],'indexes':[{'name':_0x9e7f('0x9'),'fields':[_0x9e7f('0xa'),'FieldId'],'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 6adf363..2473b5d 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 _0x8b64=['moment','ioredis','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x44608c,_0x55fcff){var _0x4ffaf2=function(_0x4e28a8){while(--_0x4e28a8){_0x44608c['push'](_0x44608c['shift']());}};_0x4ffaf2(++_0x55fcff);}(_0x8b64,0x18a));var _0x48b6=function(_0x468a75,_0x3ef4ab){_0x468a75=_0x468a75-0x0;var _0x3bbcb3=_0x8b64[_0x468a75];return _0x3bbcb3;};'use strict';var _=require(_0x48b6('0x0'));var util=require(_0x48b6('0x1'));var moment=require(_0x48b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x48b6('0x4'));var jayson=require(_0x48b6('0x5'));var client=jayson[_0x48b6('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf22014,_0x1a6cab,_0x1660a2){return new BPromise(function(_0x45307a,_0x49b9c9){return client[_0x48b6('0x7')](_0xf22014,_0x1660a2)['then'](function(_0x5f35b5){logger[_0x48b6('0x8')](_0x48b6('0x9'),_0x1a6cab,_0x48b6('0xa'));logger[_0x48b6('0xb')](_0x48b6('0xc'),_0x1a6cab,_0x48b6('0xa'),JSON[_0x48b6('0xd')](_0x5f35b5));if(_0x5f35b5[_0x48b6('0xe')]){if(_0x5f35b5[_0x48b6('0xe')][_0x48b6('0xf')]===0x1f4){logger['error'](_0x48b6('0x9'),_0x1a6cab,_0x5f35b5[_0x48b6('0xe')]['message']);return _0x49b9c9(_0x5f35b5[_0x48b6('0xe')]['message']);}logger[_0x48b6('0xe')](_0x48b6('0x9'),_0x1a6cab,_0x5f35b5['error'][_0x48b6('0x10')]);return _0x45307a(_0x5f35b5['error']['message']);}else{logger['info'](_0x48b6('0x9'),_0x1a6cab,_0x48b6('0xa'));_0x45307a(_0x5f35b5[_0x48b6('0x11')][_0x48b6('0x10')]);}})['catch'](function(_0x2f0dec){logger['error']('DeskField,\x20%s,\x20%s',_0x1a6cab,_0x2f0dec);_0x49b9c9(_0x2f0dec);});});} \ No newline at end of file +var _0xb85a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2d2184,_0x4f1ae4){var _0x2f1f61=function(_0x4f9f5b){while(--_0x4f9f5b){_0x2d2184['push'](_0x2d2184['shift']());}};_0x2f1f61(++_0x4f1ae4);}(_0xb85a,0xec));var _0xab85=function(_0x59e5df,_0x307565){_0x59e5df=_0x59e5df-0x0;var _0xbdb69e=_0xb85a[_0x59e5df];return _0xbdb69e;};'use strict';var _=require(_0xab85('0x0'));var util=require(_0xab85('0x1'));var moment=require(_0xab85('0x2'));var BPromise=require(_0xab85('0x3'));var rs=require(_0xab85('0x4'));var fs=require('fs');var Redis=require(_0xab85('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab85('0x6'));var logger=require('../../config/logger')(_0xab85('0x7'));var config=require(_0xab85('0x8'));var jayson=require(_0xab85('0x9'));var client=jayson[_0xab85('0xa')][_0xab85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39ddde,_0x4bc1ee,_0x48d28d){return new BPromise(function(_0x11729b,_0x17db9e){return client[_0xab85('0xc')](_0x39ddde,_0x48d28d)['then'](function(_0x2b6365){logger[_0xab85('0xd')](_0xab85('0xe'),_0x4bc1ee,'request\x20sent');logger['debug'](_0xab85('0xf'),_0x4bc1ee,_0xab85('0x10'),JSON[_0xab85('0x11')](_0x2b6365));if(_0x2b6365[_0xab85('0x12')]){if(_0x2b6365['error']['code']===0x1f4){logger[_0xab85('0x12')](_0xab85('0xe'),_0x4bc1ee,_0x2b6365[_0xab85('0x12')][_0xab85('0x13')]);return _0x17db9e(_0x2b6365[_0xab85('0x12')][_0xab85('0x13')]);}logger['error'](_0xab85('0xe'),_0x4bc1ee,_0x2b6365[_0xab85('0x12')]['message']);return _0x11729b(_0x2b6365['error'][_0xab85('0x13')]);}else{logger[_0xab85('0xd')](_0xab85('0xe'),_0x4bc1ee,'request\x20sent');_0x11729b(_0x2b6365[_0xab85('0x14')][_0xab85('0x13')]);}})[_0xab85('0x15')](function(_0x1d92a3){logger['error'](_0xab85('0xe'),_0x4bc1ee,_0x1d92a3);_0x17db9e(_0x1d92a3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c9dd6aa..a2e8b5a 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 _0xd813=['util','path','connect-timeout','express','Router','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer'];(function(_0x3b0697,_0x2e17bb){var _0xabb05=function(_0x2bcef7){while(--_0x2bcef7){_0x3b0697['push'](_0x3b0697['shift']());}};_0xabb05(++_0x2e17bb);}(_0xd813,0x168));var _0x3d81=function(_0x3f3a92,_0xb232c){_0x3f3a92=_0x3f3a92-0x0;var _0x52727a=_0xd813[_0x3f3a92];return _0x52727a;};'use strict';var multer=require(_0x3d81('0x0'));var util=require(_0x3d81('0x1'));var path=require(_0x3d81('0x2'));var timeout=require(_0x3d81('0x3'));var express=require(_0x3d81('0x4'));var router=express[_0x3d81('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x3d81('0x6')]('/',auth[_0x3d81('0x7')](),controller['index']);router[_0x3d81('0x6')](_0x3d81('0x8'),auth[_0x3d81('0x7')](),controller[_0x3d81('0x9')]);router[_0x3d81('0x6')](_0x3d81('0xa'),auth[_0x3d81('0x7')](),controller[_0x3d81('0xb')]);router[_0x3d81('0x6')](_0x3d81('0xc'),auth[_0x3d81('0x7')](),controller[_0x3d81('0xd')]);router[_0x3d81('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d81('0xe')]('/:id/configurations',auth[_0x3d81('0x7')](),controller[_0x3d81('0xf')]);router[_0x3d81('0x10')](_0x3d81('0x8'),auth[_0x3d81('0x7')](),controller['update']);router[_0x3d81('0x11')](_0x3d81('0x8'),auth[_0x3d81('0x7')](),controller[_0x3d81('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6954=['/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x6954,0xf9));var _0x4695=function(_0x113b20,_0x109ef1){_0x113b20=_0x113b20-0x0;var _0x145bc1=_0x6954[_0x113b20];return _0x145bc1;};'use strict';var multer=require(_0x4695('0x0'));var util=require(_0x4695('0x1'));var path=require(_0x4695('0x2'));var timeout=require('connect-timeout');var express=require(_0x4695('0x3'));var router=express[_0x4695('0x4')]();var fs_extra=require(_0x4695('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4695('0x6'));var config=require('../../config/environment');var controller=require(_0x4695('0x7'));router[_0x4695('0x8')]('/',auth[_0x4695('0x9')](),controller[_0x4695('0xa')]);router[_0x4695('0x8')](_0x4695('0xb'),auth[_0x4695('0x9')](),controller[_0x4695('0xc')]);router[_0x4695('0x8')](_0x4695('0xd'),auth[_0x4695('0x9')](),controller[_0x4695('0xe')]);router['get'](_0x4695('0xf'),auth[_0x4695('0x9')](),controller['getFields']);router[_0x4695('0x10')]('/',auth[_0x4695('0x9')](),controller[_0x4695('0x11')]);router[_0x4695('0x10')]('/:id/configurations',auth[_0x4695('0x9')](),controller[_0x4695('0x12')]);router[_0x4695('0x13')]('/:id',auth[_0x4695('0x9')](),controller[_0x4695('0x14')]);router[_0x4695('0x15')](_0x4695('0xb'),auth[_0x4695('0x9')](),controller[_0x4695('0x16')]);module[_0x4695('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 90359d8..33f41d3 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 _0x8784=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5e28cc,_0x4a5cd4){var _0x23ec61=function(_0xeb3e15){while(--_0xeb3e15){_0x5e28cc['push'](_0x5e28cc['shift']());}};_0x23ec61(++_0x4a5cd4);}(_0x8784,0x172));var _0x4878=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x8784[_0x1db481];return _0x3db95b;};'use strict';var Sequelize=require(_0x4878('0x0'));module[_0x4878('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4878('0x2')]},'password':{'type':Sequelize[_0x4878('0x2')]},'remoteUri':{'type':Sequelize[_0x4878('0x2')]},'tenantId':{'type':Sequelize[_0x4878('0x2')]},'clientId':{'type':Sequelize[_0x4878('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4878('0x2')]},'modernAuthentication':{'type':Sequelize[_0x4878('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd7c3=['sequelize','exports','STRING'];(function(_0x371655,_0x4cd20f){var _0x3a4c99=function(_0x56ef70){while(--_0x56ef70){_0x371655['push'](_0x371655['shift']());}};_0x3a4c99(++_0x4cd20f);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0xf13e62,_0x327687){_0xf13e62=_0xf13e62-0x0;var _0x296408=_0xd7c3[_0xf13e62];return _0x296408;};'use strict';var Sequelize=require(_0x3d7c('0x0'));module[_0x3d7c('0x1')]={'name':{'type':Sequelize[_0x3d7c('0x2')]},'username':{'type':Sequelize[_0x3d7c('0x2')]},'password':{'type':Sequelize[_0x3d7c('0x2')]},'remoteUri':{'type':Sequelize[_0x3d7c('0x2')]},'tenantId':{'type':Sequelize[_0x3d7c('0x2')]},'clientId':{'type':Sequelize[_0x3d7c('0x2')]},'clientSecret':{'type':Sequelize[_0x3d7c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3d7c('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 54b0d10..ddafa3f 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 _0xc28f=['StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Attributes(','FalseOption','false','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','length','addConfiguration','Subjects','channel','Descriptions','substring','format','%s/api/data/v9.0/','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientId','clientSecret','CloudProvider','data5','modernAuthentication','access_token','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(','Attributes','remove','includes','@odata.type','lastIndexOf','PicklistAttributeMetadata','MetadataId','all','forEach','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata'];(function(_0x4b2649,_0x197797){var _0x7e0664=function(_0x3683cf){while(--_0x3683cf){_0x4b2649['push'](_0x4b2649['shift']());}};_0x7e0664(++_0x197797);}(_0xc28f,0xcf));var _0xfc28=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xc28f[_0x24237f];return _0x48298e;};'use strict';var rp=require(_0xfc28('0x0'));var util=require(_0xfc28('0x1'));var _=require(_0xfc28('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xfc28('0x3'))(_0xfc28('0x4'));var db=require(_0xfc28('0x5'))['db'];var integrations=require(_0xfc28('0x6'));function respondWithResult(_0x538f49,_0x5aa0ff){_0x5aa0ff=_0x5aa0ff||0xc8;return function(_0xff562a){if(_0xff562a){return _0x538f49[_0xfc28('0x7')](_0x5aa0ff)[_0xfc28('0x8')](_0xff562a);}};}function respondWithFilteredResult(_0x3d5fe0,_0x40adec){return function(_0x1d306c){if(_0x1d306c){var _0x1cdee6=typeof _0x40adec[_0xfc28('0x9')]===_0xfc28('0xa')&&typeof _0x40adec[_0xfc28('0xb')]===_0xfc28('0xa');var _0x307ee2=_0x1d306c[_0xfc28('0xc')];var _0x27db34=_0x1cdee6?0x0:_0x40adec[_0xfc28('0x9')];var _0x33ba33=_0x1cdee6?_0x1d306c[_0xfc28('0xc')]:_0x40adec[_0xfc28('0x9')]+_0x40adec[_0xfc28('0xb')];var _0x3add79;if(_0x33ba33>=_0x307ee2){_0x33ba33=_0x307ee2;_0x3add79=0xc8;}else{_0x3add79=0xce;}_0x3d5fe0['status'](_0x3add79);return _0x3d5fe0[_0xfc28('0xd')](_0xfc28('0xe'),_0x27db34+'-'+_0x33ba33+'/'+_0x307ee2)[_0xfc28('0x8')](_0x1d306c);}return null;};}function saveUpdates(_0x34cc6a){return function(_0x1ef19e){if(_0x1ef19e){return _0x1ef19e[_0xfc28('0xf')](_0x34cc6a)[_0xfc28('0x10')](function(_0x4c8227){return _0x4c8227;});}return null;};}function removeEntity(_0x58e668){return function(_0x2972a9){if(_0x2972a9){return _0x2972a9[_0xfc28('0x11')]()[_0xfc28('0x10')](function(){_0x58e668[_0xfc28('0x7')](0xcc)[_0xfc28('0x12')]();});}};}function handleEntityNotFound(_0x3863f5){return function(_0x33180c){if(!_0x33180c){_0x3863f5[_0xfc28('0x13')](0x194);}return _0x33180c;};}function handleError(_0x10ff6a,_0x1fa2a9){_0x1fa2a9=_0x1fa2a9||0x1f4;return function(_0x2ed89c){logger[_0xfc28('0x14')](_0x2ed89c[_0xfc28('0x15')]);if(_0x2ed89c[_0xfc28('0x16')]){delete _0x2ed89c[_0xfc28('0x16')];}_0x10ff6a['status'](_0x1fa2a9)[_0xfc28('0x17')](_0x2ed89c);};}exports[_0xfc28('0x18')]=function(_0x12f264,_0x875231){var _0x3c0506={},_0x3e64d4={},_0x3f71b9={'count':0x0,'rows':[]};var _0x510b35=_['map'](db[_0xfc28('0x19')]['rawAttributes'],function(_0x31020e){return{'name':_0x31020e['fieldName'],'type':_0x31020e['type'][_0xfc28('0x1a')]};});_0x3e64d4[_0xfc28('0x1b')]=_[_0xfc28('0x1c')](_0x510b35,_0xfc28('0x16'));_0x3e64d4[_0xfc28('0x1d')]=_[_0xfc28('0x1e')](_0x12f264[_0xfc28('0x1d')]);_0x3e64d4[_0xfc28('0x1f')]=_[_0xfc28('0x20')](_0x3e64d4[_0xfc28('0x1b')],_0x3e64d4[_0xfc28('0x1d')]);_0x3c0506[_0xfc28('0x21')]=_[_0xfc28('0x20')](_0x3e64d4[_0xfc28('0x1b')],qs[_0xfc28('0x22')](_0x12f264['query']['fields']));_0x3c0506['attributes']=_0x3c0506['attributes']['length']?_0x3c0506[_0xfc28('0x21')]:_0x3e64d4[_0xfc28('0x1b')];if(!_0x12f264[_0xfc28('0x1d')][_0xfc28('0x23')]('nolimit')){_0x3c0506[_0xfc28('0xb')]=qs[_0xfc28('0xb')](_0x12f264[_0xfc28('0x1d')][_0xfc28('0xb')]);_0x3c0506[_0xfc28('0x9')]=qs['offset'](_0x12f264[_0xfc28('0x1d')][_0xfc28('0x9')]);}_0x3c0506[_0xfc28('0x24')]=qs[_0xfc28('0x25')](_0x12f264[_0xfc28('0x1d')]['sort']);_0x3c0506['where']=qs[_0xfc28('0x1f')](_[_0xfc28('0x26')](_0x12f264['query'],_0x3e64d4['filters']),_0x510b35);if(_0x12f264[_0xfc28('0x1d')]['filter']){_0x3c0506[_0xfc28('0x27')]=_[_0xfc28('0x28')](_0x3c0506[_0xfc28('0x27')],{'$or':_[_0xfc28('0x1c')](_0x510b35,function(_0x41bd3f){if(_0x41bd3f[_0xfc28('0x29')]!==_0xfc28('0x2a')){var _0x485514={};_0x485514[_0x41bd3f['name']]={'$like':'%'+_0x12f264[_0xfc28('0x1d')][_0xfc28('0x2b')]+'%'};return _0x485514;}})});}_0x3c0506=_[_0xfc28('0x28')]({},_0x3c0506,_0x12f264[_0xfc28('0x2c')]);var _0x164b0b={'where':_0x3c0506[_0xfc28('0x27')]};return db[_0xfc28('0x19')][_0xfc28('0xc')](_0x164b0b)[_0xfc28('0x10')](function(_0x2deedb){_0x3f71b9[_0xfc28('0xc')]=_0x2deedb;if(_0x12f264['query'][_0xfc28('0x2d')]){_0x3c0506['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0xfc28('0x2e')](_0x3c0506);})['then'](function(_0x5e1fc9){_0x3f71b9[_0xfc28('0x2f')]=_0x5e1fc9;return _0x3f71b9;})[_0xfc28('0x10')](respondWithFilteredResult(_0x875231,_0x3c0506))[_0xfc28('0x30')](handleError(_0x875231,null));};exports[_0xfc28('0x31')]=function(_0x270676,_0x53853a){var _0xd99819={'raw':![],'where':{'id':_0x270676['params']['id']}},_0x4a66e9={};_0x4a66e9['model']=_[_0xfc28('0x1e')](db[_0xfc28('0x19')][_0xfc28('0x32')]);_0x4a66e9[_0xfc28('0x1d')]=_['keys'](_0x270676[_0xfc28('0x1d')]);_0x4a66e9['filters']=_[_0xfc28('0x20')](_0x4a66e9['model'],_0x4a66e9[_0xfc28('0x1d')]);_0xd99819[_0xfc28('0x21')]=_[_0xfc28('0x20')](_0x4a66e9[_0xfc28('0x1b')],qs[_0xfc28('0x22')](_0x270676[_0xfc28('0x1d')][_0xfc28('0x22')]));_0xd99819[_0xfc28('0x21')]=_0xd99819[_0xfc28('0x21')]['length']?_0xd99819['attributes']:_0x4a66e9[_0xfc28('0x1b')];if(_0x270676[_0xfc28('0x1d')][_0xfc28('0x2d')]){_0xd99819[_0xfc28('0x33')]=[{'all':!![]}];}_0xd99819=_[_0xfc28('0x28')]({},_0xd99819,_0x270676[_0xfc28('0x2c')]);return db[_0xfc28('0x19')][_0xfc28('0x34')](_0xd99819)[_0xfc28('0x10')](handleEntityNotFound(_0x53853a,null))[_0xfc28('0x10')](respondWithResult(_0x53853a,null))[_0xfc28('0x30')](handleError(_0x53853a,null));};exports[_0xfc28('0x35')]=function(_0x2d8076,_0x2b6c4f){return db[_0xfc28('0x19')]['create'](_0x2d8076['body'],{})[_0xfc28('0x10')](respondWithResult(_0x2b6c4f,0xc9))[_0xfc28('0x30')](handleError(_0x2b6c4f,null));};exports[_0xfc28('0xf')]=function(_0x208f4a,_0x1dc3a8){if(_0x208f4a['body']['id']){delete _0x208f4a[_0xfc28('0x36')]['id'];}return db[_0xfc28('0x19')][_0xfc28('0x34')]({'where':{'id':_0x208f4a[_0xfc28('0x37')]['id']}})[_0xfc28('0x10')](handleEntityNotFound(_0x1dc3a8,null))[_0xfc28('0x10')](saveUpdates(_0x208f4a[_0xfc28('0x36')],null))[_0xfc28('0x10')](respondWithResult(_0x1dc3a8,null))[_0xfc28('0x30')](handleError(_0x1dc3a8,null));};exports['destroy']=function(_0x3c3021,_0x2f59ed){return db[_0xfc28('0x19')][_0xfc28('0x34')]({'where':{'id':_0x3c3021[_0xfc28('0x37')]['id']}})[_0xfc28('0x10')](handleEntityNotFound(_0x2f59ed,null))[_0xfc28('0x10')](removeEntity(_0x2f59ed,null))[_0xfc28('0x30')](handleError(_0x2f59ed,null));};exports[_0xfc28('0x38')]=function(_0x2634b6,_0x3282a8){var _0x899c58={};var _0x2017c9={};var _0x23f561;var _0x27b6b1;return db[_0xfc28('0x19')][_0xfc28('0x39')]({'where':{'id':_0x2634b6[_0xfc28('0x37')]['id']}})[_0xfc28('0x10')](handleEntityNotFound(_0x3282a8,null))[_0xfc28('0x10')](function(_0x5d8eb0){if(_0x5d8eb0){_0x23f561=_0x5d8eb0;_0x2017c9[_0xfc28('0x1b')]=_[_0xfc28('0x1e')](db[_0xfc28('0x3a')][_0xfc28('0x32')]);_0x2017c9['query']=_[_0xfc28('0x1e')](_0x2634b6[_0xfc28('0x1d')]);_0x2017c9[_0xfc28('0x1f')]=_[_0xfc28('0x20')](_0x2017c9[_0xfc28('0x1b')],_0x2017c9[_0xfc28('0x1d')]);_0x899c58['attributes']=_[_0xfc28('0x20')](_0x2017c9['model'],qs[_0xfc28('0x22')](_0x2634b6[_0xfc28('0x1d')][_0xfc28('0x22')]));_0x899c58[_0xfc28('0x21')]=_0x899c58[_0xfc28('0x21')][_0xfc28('0x3b')]?_0x899c58[_0xfc28('0x21')]:_0x2017c9[_0xfc28('0x1b')];_0x899c58[_0xfc28('0x24')]=qs[_0xfc28('0x25')](_0x2634b6[_0xfc28('0x1d')][_0xfc28('0x25')]);_0x899c58[_0xfc28('0x27')]=qs['filters'](_[_0xfc28('0x26')](_0x2634b6[_0xfc28('0x1d')],_0x2017c9['filters']));if(_0x2634b6[_0xfc28('0x1d')]['filter']){_0x899c58[_0xfc28('0x27')]=_[_0xfc28('0x28')](_0x899c58['where'],{'$or':_[_0xfc28('0x1c')](_0x899c58[_0xfc28('0x21')],function(_0x36c729){var _0x26c56a={};_0x26c56a[_0x36c729]={'$like':'%'+_0x2634b6['query']['filter']+'%'};return _0x26c56a;})});}_0x899c58=_[_0xfc28('0x28')]({},_0x899c58,_0x2634b6[_0xfc28('0x2c')]);return _0x23f561['getConfigurations'](_0x899c58);}})[_0xfc28('0x10')](function(_0x130ebf){if(_0x130ebf){_0x27b6b1=_0x130ebf[_0xfc28('0x3b')];if(!_0x2634b6[_0xfc28('0x1d')][_0xfc28('0x23')]('nolimit')){_0x899c58[_0xfc28('0xb')]=qs[_0xfc28('0xb')](_0x2634b6['query'][_0xfc28('0xb')]);_0x899c58['offset']=qs[_0xfc28('0x9')](_0x2634b6[_0xfc28('0x1d')][_0xfc28('0x9')]);}return _0x23f561[_0xfc28('0x38')](_0x899c58);}})[_0xfc28('0x10')](function(_0x52cb35){if(_0x52cb35){return _0x52cb35?{'count':_0x27b6b1,'rows':_0x52cb35}:null;}})['then'](respondWithResult(_0x3282a8,null))[_0xfc28('0x30')](handleError(_0x3282a8,null));};exports[_0xfc28('0x3c')]=function(_0x159240,_0x5a375b){if(_0x159240['body']['id']){delete _0x159240['body']['id'];}return db['Dynamics365Account'][_0xfc28('0x39')]({'where':{'id':_0x159240[_0xfc28('0x37')]['id']}})[_0xfc28('0x10')](handleEntityNotFound(_0x5a375b,null))[_0xfc28('0x10')](function(_0x5bbf12){if(_0x5bbf12){_0x159240[_0xfc28('0x36')]['AccountId']=_0x5bbf12['id'];_0x159240[_0xfc28('0x36')][_0xfc28('0x3d')]=integrations['getSubjects'](_0x159240[_0xfc28('0x36')][_0xfc28('0x3e')],_0x159240[_0xfc28('0x36')][_0xfc28('0x29')]);_0x159240[_0xfc28('0x36')][_0xfc28('0x3f')]=integrations['getDescriptions'](_0x159240[_0xfc28('0x36')][_0xfc28('0x3e')],_0x159240[_0xfc28('0x36')][_0xfc28('0x29')]);return db[_0xfc28('0x3a')][_0xfc28('0x35')](_0x159240[_0xfc28('0x36')],{'include':[{'model':db['Dynamics365Field'],'as':_0xfc28('0x3d')},{'model':db['Dynamics365Field'],'as':_0xfc28('0x3f')}]});}return null;})[_0xfc28('0x10')](respondWithResult(_0x5a375b,null))[_0xfc28('0x30')](handleError(_0x5a375b,null));};function sanitizeRemoteUri(_0x5ce3e5){var _0x4a33d2=_0x5ce3e5['slice'](-0x1);if(_0x4a33d2==='/')return _0x5ce3e5[_0xfc28('0x40')](0x0,_0x5ce3e5['lastIndexOf'](_0x4a33d2));return _0x5ce3e5;}function getWebApiUrl(_0x33193e){return util[_0xfc28('0x41')](_0xfc28('0x42'),_0x33193e);}exports['getFields']=function(_0x49e595,_0x142b02){var _0x2179f8=_0x49e595[_0xfc28('0x1d')]['ticketType'];var _0x3389e4=_0x2179f8===_0xfc28('0x43')?_0xfc28('0x44'):_0xfc28('0x45');var _0x592e1c='';var _0x4cab39='';var _0x44a541='';var _0x2f28e5='';var _0x1d697f='';var _0x52b27d='';var _0x1f19ab='';var _0x3c1c5c='';var _0x9712b1=[_0xfc28('0x46'),_0xfc28('0x47'),'customerid',_0xfc28('0x48'),_0xfc28('0x49'),_0xfc28('0x4a'),_0xfc28('0x4b'),_0xfc28('0x4c'),_0xfc28('0x4d'),_0xfc28('0x4e')];var _0x3c1a56=[_0xfc28('0x4f'),_0xfc28('0x50'),_0xfc28('0x51'),_0xfc28('0x52'),_0xfc28('0x53'),_0xfc28('0x54'),'contractdetailidname',_0xfc28('0x55'),_0xfc28('0x56'),_0xfc28('0x57'),_0xfc28('0x58'),_0xfc28('0x59'),_0xfc28('0x5a'),_0xfc28('0x5b'),_0xfc28('0x5c'),_0xfc28('0x5d'),_0xfc28('0x5e'),_0xfc28('0x5f'),_0xfc28('0x60'),_0xfc28('0x61'),_0xfc28('0x62'),_0xfc28('0x63'),_0xfc28('0x64'),'exchangerate',_0xfc28('0x65'),_0xfc28('0x66'),_0xfc28('0x67'),_0xfc28('0x68'),_0xfc28('0x69'),_0xfc28('0x6a'),_0xfc28('0x6b'),'modifiedbyexternalpartyname',_0xfc28('0x6c'),'modifiedbyname','modifiedbyyominame',_0xfc28('0x6d'),_0xfc28('0x6e'),_0xfc28('0x6f'),_0xfc28('0x70'),_0xfc28('0x71'),'numberofchildincidents','onholdtime',_0xfc28('0x72'),_0xfc28('0x73'),_0xfc28('0x74'),_0xfc28('0x75'),_0xfc28('0x76'),_0xfc28('0x77'),_0xfc28('0x78'),_0xfc28('0x79'),_0xfc28('0x7a'),_0xfc28('0x7b'),_0xfc28('0x7c'),'resolvebykpiidname',_0xfc28('0x7d'),'responsiblecontactidname',_0xfc28('0x7e'),_0xfc28('0x7f'),_0xfc28('0x80'),_0xfc28('0x81'),_0xfc28('0x82'),_0xfc28('0x83'),_0xfc28('0x84'),'subjectidname',_0xfc28('0x85'),'timezoneruleversionnumber',_0xfc28('0x86'),_0xfc28('0x87'),_0xfc28('0x88'),_0xfc28('0x89')];var _0x1f677a=_0x9712b1['concat'](_0x3c1a56);return db[_0xfc28('0x19')][_0xfc28('0x39')]({'where':{'id':_0x49e595[_0xfc28('0x37')]['id']},'attributes':['id',_0xfc28('0x8a'),_0xfc28('0x8b'),_0xfc28('0x8c'),'tenantId',_0xfc28('0x8d'),_0xfc28('0x8e'),'modernAuthentication'],'include':[{'model':db[_0xfc28('0x8f')],'as':_0xfc28('0x8f'),'attributes':['id',_0xfc28('0x90'),'data7']}]})[_0xfc28('0x10')](handleEntityNotFound(_0x142b02,null))[_0xfc28('0x10')](function(_0x37a008){if(_0x37a008){if(_0x37a008[_0xfc28('0x91')]){_0x37a008[_0xfc28('0x92')]=_0x37a008['CloudProvider']['data5'];_0x3c1c5c=sanitizeRemoteUri(_0x37a008[_0xfc28('0x8f')][_0xfc28('0x93')]);_0x1f19ab=getWebApiUrl(_0x3c1c5c);return _0x37a008;}_0x3c1c5c=sanitizeRemoteUri(_0x37a008['remoteUri']);_0x1f19ab=getWebApiUrl(_0x3c1c5c);var _0x5dde9a={'method':_0xfc28('0x94'),'uri':_0xfc28('0x95')+_0x37a008[_0xfc28('0x96')]+_0xfc28('0x97'),'form':{'client_id':_0x37a008[_0xfc28('0x8d')],'resource':_0x3c1c5c,'username':_0x37a008[_0xfc28('0x8a')],'password':_0x37a008[_0xfc28('0x8b')],'grant_type':_0xfc28('0x8b'),'client_secret':_0x37a008[_0xfc28('0x8e')]},'json':!![]};return rp(_0x5dde9a);}})[_0xfc28('0x10')](function(_0x2c8aaf){_0x52b27d=_0x2c8aaf[_0xfc28('0x92')];var _0x2186c3={'method':_0xfc28('0x98'),'uri':encodeURI(_0x1f19ab+_0xfc28('0x99')+_0x3389e4+'\x27'),'headers':{'Authorization':_0xfc28('0x9a')+_0x52b27d,'If-None-Match':null,'OData-Version':_0xfc28('0x9b')},'json':!![]};return rp(_0x2186c3);})[_0xfc28('0x10')](function(_0x4a79a6){var _0x450004=_0x4a79a6['value'][0x0];var _0x36a29c=_0x450004['MetadataId'];var _0x1734fd={'method':_0xfc28('0x98'),'uri':_0x1f19ab+_0xfc28('0x9c')+_0x36a29c+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xfc28('0x9a')+_0x52b27d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1734fd);})[_0xfc28('0x10')](function(_0x5b0448){_0x592e1c=_0x5b0448;_0x4cab39=_0x592e1c[_0xfc28('0x9d')];_0x4cab39=_[_0xfc28('0x9e')](_0x4cab39,function(_0x1f9304){return!_0x1f677a[_0xfc28('0x9f')](_0x1f9304['LogicalName']);});var _0x548f3d=[];var _0x188868=[];_0x4cab39['forEach'](function(_0x4059ae){if(_0x4059ae[_0xfc28('0xa0')]){var _0x46514c=_0x4059ae[_0xfc28('0xa0')][_0xfc28('0x40')](_0x4059ae[_0xfc28('0xa0')][_0xfc28('0xa1')]('.')+0x1);if(_0x46514c===_0xfc28('0xa2')){_0x548f3d['push'](getSelectList(_0x1f19ab,_0x2179f8,_0x188868,_0x592e1c[_0xfc28('0xa3')],_0x4059ae[_0xfc28('0xa3')],_0x52b27d));}}});return Promise[_0xfc28('0xa4')](_0x548f3d);})[_0xfc28('0x10')](function(_0x204cb1){_0x44a541=_0x204cb1[0x0];var _0x26c2f1=[];var _0x207c21=[];_0x4cab39[_0xfc28('0xa5')](function(_0x4f2880){if(!_['isNil'](_0x4f2880['@odata.type'])){var _0x1843ec=_0x4f2880[_0xfc28('0xa0')][_0xfc28('0x40')](_0x4f2880[_0xfc28('0xa0')][_0xfc28('0xa1')]('.')+0x1);if(_0x1843ec===_0xfc28('0xa6')){_0x26c2f1[_0xfc28('0xa7')](getBooleanList(_0x1f19ab,_0x2179f8,_0x207c21,_0x592e1c[_0xfc28('0xa3')],_0x4f2880['MetadataId'],_0x52b27d));}}});return Promise[_0xfc28('0xa4')](_0x26c2f1);})['then'](function(_0x21ad0a){_0x2f28e5=_0x21ad0a[0x0];var _0x160370=[];var _0x4bfdd9=[];_0x4cab39[_0xfc28('0xa5')](function(_0x2aa2d7){if(_0x2aa2d7['@odata.type']){var _0x1ca45b=_0x2aa2d7[_0xfc28('0xa0')][_0xfc28('0x40')](_0x2aa2d7[_0xfc28('0xa0')][_0xfc28('0xa1')]('.')+0x1);if(_0x1ca45b==='StringAttributeMetadata'||_0x1ca45b===_0xfc28('0xa8')||_0x1ca45b===_0xfc28('0xa9')||_0x1ca45b===_0xfc28('0xaa')||_0x1ca45b===_0xfc28('0xab')||_0x1ca45b===_0xfc28('0xac')||_0x1ca45b===_0xfc28('0xad')||_0x1ca45b===_0xfc28('0xae')||_0x1ca45b==='StateAttributeMetadata'||_0x1ca45b===_0xfc28('0xaf')){_0x160370[_0xfc28('0xa7')](getInputList(_0x1f19ab,_0x2179f8,_0x1ca45b,_0x4bfdd9,_0x592e1c[_0xfc28('0xa3')],_0x2aa2d7['MetadataId'],_0x52b27d));}}});return Promise[_0xfc28('0xa4')](_0x160370);})[_0xfc28('0x10')](function(_0x1602c0){_0x1d697f=_0x1602c0[0x0];var _0x3b75f1=_0x44a541[_0xfc28('0xb0')](_0x2f28e5)['concat'](_0x1d697f);var _0x432bbe={'count':_0x3b75f1[_0xfc28('0x3b')],'rows':_0x3b75f1};return _0x432bbe;})[_0xfc28('0x10')](respondWithResult(_0x142b02,null))['catch'](function(_0x20f127){var _0x26ef13=_0x49e595[_0xfc28('0x1d')][_0xfc28('0xb1')]?0x1f4:_0x20f127[_0xfc28('0xb2')]||0x1f4;logger[_0xfc28('0x14')](_0x20f127[_0xfc28('0x15')]);delete _0x20f127[_0xfc28('0x16')];if(_0x26ef13===0x191){_0x26ef13=0x190;}_0x142b02['status'](_0x26ef13)[_0xfc28('0x17')](_0x49e595['query'][_0xfc28('0xb1')]?{'message':'Wrong\x20credentials','statusCode':_0x20f127[_0xfc28('0xb2')]}:_0x20f127);});};function getSelectList(_0x407eba,_0x3fd996,_0x48e38b,_0x45feb1,_0x65c28f,_0x5218bb){var _0x18268f={'method':'GET','uri':_0x407eba+'EntityDefinitions('+_0x45feb1+')/Attributes('+_0x65c28f+_0xfc28('0xb3')+_0xfc28('0xb4'),'headers':{'Authorization':_0xfc28('0x9a')+_0x5218bb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x18268f)[_0xfc28('0x10')](function(_0x53c8bb){var _0x49320b=[];var _0xf907b=_0x53c8bb[_0xfc28('0xb5')]['Options'];_0xf907b['forEach'](function(_0x3538f0){_0x49320b[_0xfc28('0xa7')]({'name':_0x3538f0[_0xfc28('0xb6')][_0xfc28('0xb7')]['Label'],'value':String(_0x3538f0[_0xfc28('0xb8')])});});var _0x3db369={'id':_0x3fd996+'_'+_0x53c8bb[_0xfc28('0xb9')],'name':_0x53c8bb[_0xfc28('0xba')][_0xfc28('0xb7')]['Label'],'custom':![],'options':_0x49320b};_0x48e38b['push'](_0x3db369);return _0x48e38b;});}function getBooleanList(_0x56d65d,_0x3233f4,_0x48c69b,_0x53ee6f,_0x500e7e,_0x3bdca1){var _0x2d1edb={'method':_0xfc28('0x98'),'uri':_0x56d65d+_0xfc28('0x9c')+_0x53ee6f+_0xfc28('0xbb')+_0x500e7e+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xfc28('0x9a')+_0x3bdca1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2d1edb)['then'](function(_0x41445c){var _0x44b734=[];_0x44b734[_0xfc28('0xa7')]({'name':_0x41445c['OptionSet']['TrueOption']['Label'][_0xfc28('0xb7')][_0xfc28('0xb6')],'value':'true'},{'name':_0x41445c[_0xfc28('0xb5')][_0xfc28('0xbc')][_0xfc28('0xb6')]['UserLocalizedLabel'][_0xfc28('0xb6')],'value':_0xfc28('0xbd')});var _0xdf368b={'id':_0x3233f4+'_'+_0x41445c[_0xfc28('0xb9')],'name':_0x41445c['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x44b734};_0x48c69b[_0xfc28('0xa7')](_0xdf368b);return _0x48c69b;});}function getInputList(_0x16c38d,_0x1c2497,_0x117f11,_0x473f3c,_0x318420,_0x7314ef,_0x42c65a){var _0x2eaa5c={'method':_0xfc28('0x98'),'uri':_0x16c38d+_0xfc28('0x9c')+_0x318420+')/Attributes('+_0x7314ef+')/Microsoft.Dynamics.CRM.'+_0x117f11+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xfc28('0x9a')+_0x42c65a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2eaa5c)[_0xfc28('0x10')](function(_0x29ed1e){var _0x3ff5c0={'id':_0x1c2497+'_'+_0x29ed1e[_0xfc28('0xb9')],'name':_0x29ed1e[_0xfc28('0xba')][_0xfc28('0xb7')]?_0x29ed1e[_0xfc28('0xba')]['UserLocalizedLabel'][_0xfc28('0xb6')]:_0x29ed1e[_0xfc28('0xb9')],'custom':![],'options':[]};_0x473f3c['push'](_0x3ff5c0);return _0x473f3c;});} \ No newline at end of file +var _0xb779=['clientId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','substring','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','error','stack','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','sendStatus','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','followupby','importsequencenumber','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','username','password','remoteUri','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb779,0xeb));var _0x9b77=function(_0x142a5b,_0x5de5b4){_0x142a5b=_0x142a5b-0x0;var _0x24c596=_0xb779[_0x142a5b];return _0x24c596;};'use strict';var rp=require(_0x9b77('0x0'));var util=require('util');var _=require(_0x9b77('0x1'));var qs=require(_0x9b77('0x2'));var logger=require(_0x9b77('0x3'))(_0x9b77('0x4'));var db=require(_0x9b77('0x5'))['db'];var integrations=require(_0x9b77('0x6'));function respondWithResult(_0x13f1c4,_0x26895d){_0x26895d=_0x26895d||0xc8;return function(_0x34750c){if(_0x34750c){return _0x13f1c4[_0x9b77('0x7')](_0x26895d)[_0x9b77('0x8')](_0x34750c);}};}function respondWithFilteredResult(_0x5a5164,_0x333769){return function(_0x5d9540){if(_0x5d9540){var _0x2128a8=typeof _0x333769[_0x9b77('0x9')]===_0x9b77('0xa')&&typeof _0x333769[_0x9b77('0xb')]===_0x9b77('0xa');var _0x2f212e=_0x5d9540[_0x9b77('0xc')];var _0x224483=_0x2128a8?0x0:_0x333769['offset'];var _0x4e25b2=_0x2128a8?_0x5d9540[_0x9b77('0xc')]:_0x333769[_0x9b77('0x9')]+_0x333769[_0x9b77('0xb')];var _0x29ff1d;if(_0x4e25b2>=_0x2f212e){_0x4e25b2=_0x2f212e;_0x29ff1d=0xc8;}else{_0x29ff1d=0xce;}_0x5a5164[_0x9b77('0x7')](_0x29ff1d);return _0x5a5164['set'](_0x9b77('0xd'),_0x224483+'-'+_0x4e25b2+'/'+_0x2f212e)['json'](_0x5d9540);}return null;};}function saveUpdates(_0x75db26){return function(_0x3f88e6){if(_0x3f88e6){return _0x3f88e6[_0x9b77('0xe')](_0x75db26)['then'](function(_0x3a4fb4){return _0x3a4fb4;});}return null;};}function removeEntity(_0x592a02){return function(_0x19fbef){if(_0x19fbef){return _0x19fbef[_0x9b77('0xf')]()[_0x9b77('0x10')](function(){_0x592a02[_0x9b77('0x7')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f9dfd){return function(_0x5adc6e){if(!_0x5adc6e){_0x6f9dfd[_0x9b77('0x11')](0x194);}return _0x5adc6e;};}function handleError(_0x377c83,_0x5b708d){_0x5b708d=_0x5b708d||0x1f4;return function(_0x40b98e){logger['error'](_0x40b98e['stack']);if(_0x40b98e[_0x9b77('0x12')]){delete _0x40b98e['name'];}_0x377c83['status'](_0x5b708d)[_0x9b77('0x13')](_0x40b98e);};}exports[_0x9b77('0x14')]=function(_0x58c2f4,_0x357b56){var _0x350bc5={},_0x537f4c={},_0x3cbf2b={'count':0x0,'rows':[]};var _0x4d336c=_[_0x9b77('0x15')](db[_0x9b77('0x16')][_0x9b77('0x17')],function(_0x5f3249){return{'name':_0x5f3249['fieldName'],'type':_0x5f3249[_0x9b77('0x18')][_0x9b77('0x19')]};});_0x537f4c[_0x9b77('0x1a')]=_['map'](_0x4d336c,_0x9b77('0x12'));_0x537f4c[_0x9b77('0x1b')]=_[_0x9b77('0x1c')](_0x58c2f4[_0x9b77('0x1b')]);_0x537f4c[_0x9b77('0x1d')]=_[_0x9b77('0x1e')](_0x537f4c[_0x9b77('0x1a')],_0x537f4c['query']);_0x350bc5[_0x9b77('0x1f')]=_[_0x9b77('0x1e')](_0x537f4c[_0x9b77('0x1a')],qs['fields'](_0x58c2f4['query'][_0x9b77('0x20')]));_0x350bc5['attributes']=_0x350bc5[_0x9b77('0x1f')][_0x9b77('0x21')]?_0x350bc5[_0x9b77('0x1f')]:_0x537f4c['model'];if(!_0x58c2f4[_0x9b77('0x1b')][_0x9b77('0x22')]('nolimit')){_0x350bc5[_0x9b77('0xb')]=qs['limit'](_0x58c2f4[_0x9b77('0x1b')][_0x9b77('0xb')]);_0x350bc5[_0x9b77('0x9')]=qs[_0x9b77('0x9')](_0x58c2f4[_0x9b77('0x1b')]['offset']);}_0x350bc5[_0x9b77('0x23')]=qs[_0x9b77('0x24')](_0x58c2f4['query']['sort']);_0x350bc5[_0x9b77('0x25')]=qs[_0x9b77('0x1d')](_[_0x9b77('0x26')](_0x58c2f4[_0x9b77('0x1b')],_0x537f4c[_0x9b77('0x1d')]),_0x4d336c);if(_0x58c2f4['query'][_0x9b77('0x27')]){_0x350bc5[_0x9b77('0x25')]=_[_0x9b77('0x28')](_0x350bc5[_0x9b77('0x25')],{'$or':_['map'](_0x4d336c,function(_0x45520a){if(_0x45520a[_0x9b77('0x18')]!==_0x9b77('0x29')){var _0x48875d={};_0x48875d[_0x45520a[_0x9b77('0x12')]]={'$like':'%'+_0x58c2f4['query'][_0x9b77('0x27')]+'%'};return _0x48875d;}})});}_0x350bc5=_['merge']({},_0x350bc5,_0x58c2f4[_0x9b77('0x2a')]);var _0x59b674={'where':_0x350bc5[_0x9b77('0x25')]};return db['Dynamics365Account'][_0x9b77('0xc')](_0x59b674)[_0x9b77('0x10')](function(_0x1b40f3){_0x3cbf2b[_0x9b77('0xc')]=_0x1b40f3;if(_0x58c2f4[_0x9b77('0x1b')][_0x9b77('0x2b')]){_0x350bc5[_0x9b77('0x2c')]=[{'all':!![]}];}return db[_0x9b77('0x16')]['findAll'](_0x350bc5);})['then'](function(_0x3cb142){_0x3cbf2b[_0x9b77('0x2d')]=_0x3cb142;return _0x3cbf2b;})[_0x9b77('0x10')](respondWithFilteredResult(_0x357b56,_0x350bc5))['catch'](handleError(_0x357b56,null));};exports[_0x9b77('0x2e')]=function(_0x5d0350,_0x4b577e){var _0x4cccc0={'raw':![],'where':{'id':_0x5d0350[_0x9b77('0x2f')]['id']}},_0x2d3cfb={};_0x2d3cfb['model']=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x2d3cfb['query']=_[_0x9b77('0x1c')](_0x5d0350[_0x9b77('0x1b')]);_0x2d3cfb[_0x9b77('0x1d')]=_[_0x9b77('0x1e')](_0x2d3cfb['model'],_0x2d3cfb['query']);_0x4cccc0[_0x9b77('0x1f')]=_[_0x9b77('0x1e')](_0x2d3cfb[_0x9b77('0x1a')],qs[_0x9b77('0x20')](_0x5d0350['query'][_0x9b77('0x20')]));_0x4cccc0[_0x9b77('0x1f')]=_0x4cccc0[_0x9b77('0x1f')][_0x9b77('0x21')]?_0x4cccc0[_0x9b77('0x1f')]:_0x2d3cfb['model'];if(_0x5d0350['query'][_0x9b77('0x2b')]){_0x4cccc0[_0x9b77('0x2c')]=[{'all':!![]}];}_0x4cccc0=_['merge']({},_0x4cccc0,_0x5d0350[_0x9b77('0x2a')]);return db[_0x9b77('0x16')][_0x9b77('0x30')](_0x4cccc0)[_0x9b77('0x10')](handleEntityNotFound(_0x4b577e,null))[_0x9b77('0x10')](respondWithResult(_0x4b577e,null))[_0x9b77('0x31')](handleError(_0x4b577e,null));};exports[_0x9b77('0x32')]=function(_0x3bd232,_0x58fc7e){return db[_0x9b77('0x16')]['create'](_0x3bd232[_0x9b77('0x33')],{})[_0x9b77('0x10')](respondWithResult(_0x58fc7e,0xc9))[_0x9b77('0x31')](handleError(_0x58fc7e,null));};exports[_0x9b77('0xe')]=function(_0x30307e,_0x4512f2){if(_0x30307e[_0x9b77('0x33')]['id']){delete _0x30307e['body']['id'];}return db[_0x9b77('0x16')]['find']({'where':{'id':_0x30307e[_0x9b77('0x2f')]['id']}})[_0x9b77('0x10')](handleEntityNotFound(_0x4512f2,null))[_0x9b77('0x10')](saveUpdates(_0x30307e[_0x9b77('0x33')],null))[_0x9b77('0x10')](respondWithResult(_0x4512f2,null))[_0x9b77('0x31')](handleError(_0x4512f2,null));};exports[_0x9b77('0xf')]=function(_0x58351d,_0x1e827e){return db['Dynamics365Account'][_0x9b77('0x30')]({'where':{'id':_0x58351d[_0x9b77('0x2f')]['id']}})[_0x9b77('0x10')](handleEntityNotFound(_0x1e827e,null))[_0x9b77('0x10')](removeEntity(_0x1e827e,null))[_0x9b77('0x31')](handleError(_0x1e827e,null));};exports['getConfigurations']=function(_0xdc4e59,_0x566503){var _0x4b7285={};var _0x4b8454={};var _0x2277ea;var _0x59b88b;return db['Dynamics365Account'][_0x9b77('0x34')]({'where':{'id':_0xdc4e59[_0x9b77('0x2f')]['id']}})[_0x9b77('0x10')](handleEntityNotFound(_0x566503,null))['then'](function(_0x4a5404){if(_0x4a5404){_0x2277ea=_0x4a5404;_0x4b8454['model']=_['keys'](db['Dynamics365Configuration'][_0x9b77('0x17')]);_0x4b8454[_0x9b77('0x1b')]=_[_0x9b77('0x1c')](_0xdc4e59[_0x9b77('0x1b')]);_0x4b8454['filters']=_[_0x9b77('0x1e')](_0x4b8454[_0x9b77('0x1a')],_0x4b8454[_0x9b77('0x1b')]);_0x4b7285[_0x9b77('0x1f')]=_[_0x9b77('0x1e')](_0x4b8454[_0x9b77('0x1a')],qs[_0x9b77('0x20')](_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x20')]));_0x4b7285[_0x9b77('0x1f')]=_0x4b7285[_0x9b77('0x1f')][_0x9b77('0x21')]?_0x4b7285[_0x9b77('0x1f')]:_0x4b8454[_0x9b77('0x1a')];_0x4b7285['order']=qs['sort'](_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x24')]);_0x4b7285[_0x9b77('0x25')]=qs['filters'](_[_0x9b77('0x26')](_0xdc4e59['query'],_0x4b8454[_0x9b77('0x1d')]));if(_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x27')]){_0x4b7285[_0x9b77('0x25')]=_[_0x9b77('0x28')](_0x4b7285[_0x9b77('0x25')],{'$or':_[_0x9b77('0x15')](_0x4b7285[_0x9b77('0x1f')],function(_0x296931){var _0x297742={};_0x297742[_0x296931]={'$like':'%'+_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x27')]+'%'};return _0x297742;})});}_0x4b7285=_[_0x9b77('0x28')]({},_0x4b7285,_0xdc4e59[_0x9b77('0x2a')]);return _0x2277ea[_0x9b77('0x35')](_0x4b7285);}})['then'](function(_0x5b4daa){if(_0x5b4daa){_0x59b88b=_0x5b4daa[_0x9b77('0x21')];if(!_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x22')](_0x9b77('0x36'))){_0x4b7285[_0x9b77('0xb')]=qs[_0x9b77('0xb')](_0xdc4e59['query'][_0x9b77('0xb')]);_0x4b7285[_0x9b77('0x9')]=qs[_0x9b77('0x9')](_0xdc4e59[_0x9b77('0x1b')][_0x9b77('0x9')]);}return _0x2277ea[_0x9b77('0x35')](_0x4b7285);}})[_0x9b77('0x10')](function(_0x50c8da){if(_0x50c8da){return _0x50c8da?{'count':_0x59b88b,'rows':_0x50c8da}:null;}})[_0x9b77('0x10')](respondWithResult(_0x566503,null))[_0x9b77('0x31')](handleError(_0x566503,null));};exports[_0x9b77('0x37')]=function(_0x1e1291,_0x529338){if(_0x1e1291[_0x9b77('0x33')]['id']){delete _0x1e1291[_0x9b77('0x33')]['id'];}return db[_0x9b77('0x16')][_0x9b77('0x34')]({'where':{'id':_0x1e1291[_0x9b77('0x2f')]['id']}})[_0x9b77('0x10')](handleEntityNotFound(_0x529338,null))[_0x9b77('0x10')](function(_0x4e7a92){if(_0x4e7a92){_0x1e1291[_0x9b77('0x33')][_0x9b77('0x38')]=_0x4e7a92['id'];_0x1e1291[_0x9b77('0x33')][_0x9b77('0x39')]=integrations[_0x9b77('0x3a')](_0x1e1291[_0x9b77('0x33')][_0x9b77('0x3b')],_0x1e1291[_0x9b77('0x33')][_0x9b77('0x18')]);_0x1e1291[_0x9b77('0x33')][_0x9b77('0x3c')]=integrations[_0x9b77('0x3d')](_0x1e1291[_0x9b77('0x33')][_0x9b77('0x3b')],_0x1e1291['body']['type']);return db[_0x9b77('0x3e')][_0x9b77('0x32')](_0x1e1291[_0x9b77('0x33')],{'include':[{'model':db[_0x9b77('0x3f')],'as':_0x9b77('0x39')},{'model':db['Dynamics365Field'],'as':_0x9b77('0x3c')}]});}return null;})['then'](respondWithResult(_0x529338,null))[_0x9b77('0x31')](handleError(_0x529338,null));};function sanitizeRemoteUri(_0x58de65){var _0x1dd2f0=_0x58de65[_0x9b77('0x40')](-0x1);if(_0x1dd2f0==='/')return _0x58de65['substring'](0x0,_0x58de65[_0x9b77('0x41')](_0x1dd2f0));return _0x58de65;}function getWebApiUrl(_0x598251){return util['format']('%s/api/data/v9.0/',_0x598251);}exports['getFields']=function(_0x28c2fd,_0xd3264c){var _0x223fb2=_0x28c2fd[_0x9b77('0x1b')]['ticketType'];var _0x1bc2a2=_0x223fb2===_0x9b77('0x42')?'Incident':_0x9b77('0x43');var _0x21779e='';var _0x146b3d='';var _0x1169aa='';var _0x1c0892='';var _0x29aeb2='';var _0x2f783e='';var _0x27eb14='';var _0x2de331='';var _0x59ab2d=['title',_0x9b77('0x44'),'customerid',_0x9b77('0x45'),_0x9b77('0x46'),'subject',_0x9b77('0x47'),_0x9b77('0x48'),_0x9b77('0x49'),_0x9b77('0x4a')];var _0x60c712=[_0x9b77('0x4b'),_0x9b77('0x4c'),_0x9b77('0x4d'),_0x9b77('0x4e'),_0x9b77('0x4f'),_0x9b77('0x50'),_0x9b77('0x51'),_0x9b77('0x52'),_0x9b77('0x53'),'createdbyexternalpartyyominame',_0x9b77('0x54'),_0x9b77('0x55'),_0x9b77('0x56'),_0x9b77('0x57'),_0x9b77('0x58'),_0x9b77('0x59'),'customeridtype',_0x9b77('0x5a'),_0x9b77('0x5b'),'entitlementidname',_0x9b77('0x5c'),'entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname',_0x9b77('0x5d'),_0x9b77('0x5e'),'influencescore',_0x9b77('0x5f'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x9b77('0x60'),_0x9b77('0x61'),_0x9b77('0x62'),'modifiedon',_0x9b77('0x63'),'modifiedonbehalfbyyominame',_0x9b77('0x64'),_0x9b77('0x65'),_0x9b77('0x66'),'onholdtime',_0x9b77('0x67'),'owneridname',_0x9b77('0x68'),_0x9b77('0x69'),_0x9b77('0x6a'),_0x9b77('0x6b'),_0x9b77('0x6c'),'prioritycodename',_0x9b77('0x6d'),_0x9b77('0x6e'),'resolveby',_0x9b77('0x6f'),_0x9b77('0x70'),'responsiblecontactidname',_0x9b77('0x71'),_0x9b77('0x72'),'slainvokedidname','slaname',_0x9b77('0x73'),'statecode',_0x9b77('0x74'),_0x9b77('0x75'),_0x9b77('0x76'),'timezoneruleversionnumber',_0x9b77('0x77'),_0x9b77('0x78'),'utcconversiontimezonecode',_0x9b77('0x79')];var _0x1c0e15=_0x59ab2d['concat'](_0x60c712);return db['Dynamics365Account'][_0x9b77('0x34')]({'where':{'id':_0x28c2fd[_0x9b77('0x2f')]['id']},'attributes':['id',_0x9b77('0x7a'),_0x9b77('0x7b'),_0x9b77('0x7c'),'tenantId','clientId',_0x9b77('0x7d'),_0x9b77('0x7e')],'include':[{'model':db['CloudProvider'],'as':_0x9b77('0x7f'),'attributes':['id',_0x9b77('0x80'),'data7']}]})[_0x9b77('0x10')](handleEntityNotFound(_0xd3264c,null))[_0x9b77('0x10')](function(_0x2408fe){if(_0x2408fe){if(_0x2408fe[_0x9b77('0x7e')]){_0x2408fe[_0x9b77('0x81')]=_0x2408fe[_0x9b77('0x7f')][_0x9b77('0x80')];_0x2de331=sanitizeRemoteUri(_0x2408fe[_0x9b77('0x7f')][_0x9b77('0x82')]);_0x27eb14=getWebApiUrl(_0x2de331);return _0x2408fe;}_0x2de331=sanitizeRemoteUri(_0x2408fe[_0x9b77('0x7c')]);_0x27eb14=getWebApiUrl(_0x2de331);var _0x2b2ac9={'method':_0x9b77('0x83'),'uri':_0x9b77('0x84')+_0x2408fe[_0x9b77('0x85')]+_0x9b77('0x86'),'form':{'client_id':_0x2408fe[_0x9b77('0x87')],'resource':_0x2de331,'username':_0x2408fe[_0x9b77('0x7a')],'password':_0x2408fe['password'],'grant_type':'password','client_secret':_0x2408fe[_0x9b77('0x7d')]},'json':!![]};return rp(_0x2b2ac9);}})['then'](function(_0x3c454b){_0x2f783e=_0x3c454b[_0x9b77('0x81')];var _0x44c518={'method':'GET','uri':encodeURI(_0x27eb14+_0x9b77('0x88')+_0x1bc2a2+'\x27'),'headers':{'Authorization':_0x9b77('0x89')+_0x2f783e,'If-None-Match':null,'OData-Version':_0x9b77('0x8a')},'json':!![]};return rp(_0x44c518);})['then'](function(_0x5cca1f){var _0x506098=_0x5cca1f[_0x9b77('0x8b')][0x0];var _0x2fa956=_0x506098[_0x9b77('0x8c')];var _0x12a46d={'method':_0x9b77('0x8d'),'uri':_0x27eb14+_0x9b77('0x8e')+_0x2fa956+_0x9b77('0x8f'),'headers':{'Authorization':'Bearer\x20'+_0x2f783e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x12a46d);})[_0x9b77('0x10')](function(_0x156d8e){_0x21779e=_0x156d8e;_0x146b3d=_0x21779e[_0x9b77('0x90')];_0x146b3d=_['remove'](_0x146b3d,function(_0x468aee){return!_0x1c0e15['includes'](_0x468aee[_0x9b77('0x91')]);});var _0x4bdd8d=[];var _0x538b35=[];_0x146b3d[_0x9b77('0x92')](function(_0x3ffb6d){if(_0x3ffb6d['@odata.type']){var _0x4e66fa=_0x3ffb6d[_0x9b77('0x93')]['substring'](_0x3ffb6d['@odata.type'][_0x9b77('0x41')]('.')+0x1);if(_0x4e66fa===_0x9b77('0x94')){_0x4bdd8d[_0x9b77('0x95')](getSelectList(_0x27eb14,_0x223fb2,_0x538b35,_0x21779e[_0x9b77('0x8c')],_0x3ffb6d[_0x9b77('0x8c')],_0x2f783e));}}});return Promise[_0x9b77('0x96')](_0x4bdd8d);})[_0x9b77('0x10')](function(_0x5c1cdf){_0x1169aa=_0x5c1cdf[0x0];var _0x51386c=[];var _0x5832b4=[];_0x146b3d[_0x9b77('0x92')](function(_0x4953f6){if(!_['isNil'](_0x4953f6[_0x9b77('0x93')])){var _0x3fc40e=_0x4953f6[_0x9b77('0x93')][_0x9b77('0x97')](_0x4953f6[_0x9b77('0x93')][_0x9b77('0x41')]('.')+0x1);if(_0x3fc40e===_0x9b77('0x98')){_0x51386c[_0x9b77('0x95')](getBooleanList(_0x27eb14,_0x223fb2,_0x5832b4,_0x21779e['MetadataId'],_0x4953f6[_0x9b77('0x8c')],_0x2f783e));}}});return Promise[_0x9b77('0x96')](_0x51386c);})[_0x9b77('0x10')](function(_0x55ad57){_0x1c0892=_0x55ad57[0x0];var _0x52b25f=[];var _0x25d67a=[];_0x146b3d[_0x9b77('0x92')](function(_0xb8414e){if(_0xb8414e['@odata.type']){var _0x36fd32=_0xb8414e[_0x9b77('0x93')][_0x9b77('0x97')](_0xb8414e[_0x9b77('0x93')][_0x9b77('0x41')]('.')+0x1);if(_0x36fd32===_0x9b77('0x99')||_0x36fd32===_0x9b77('0x9a')||_0x36fd32===_0x9b77('0x9b')||_0x36fd32===_0x9b77('0x9c')||_0x36fd32===_0x9b77('0x9d')||_0x36fd32===_0x9b77('0x9e')||_0x36fd32===_0x9b77('0x9f')||_0x36fd32===_0x9b77('0xa0')||_0x36fd32===_0x9b77('0xa1')||_0x36fd32===_0x9b77('0xa2')){_0x52b25f['push'](getInputList(_0x27eb14,_0x223fb2,_0x36fd32,_0x25d67a,_0x21779e[_0x9b77('0x8c')],_0xb8414e['MetadataId'],_0x2f783e));}}});return Promise[_0x9b77('0x96')](_0x52b25f);})[_0x9b77('0x10')](function(_0xeb0d52){_0x29aeb2=_0xeb0d52[0x0];var _0x11b08a=_0x1169aa[_0x9b77('0xa3')](_0x1c0892)['concat'](_0x29aeb2);var _0x583f96={'count':_0x11b08a['length'],'rows':_0x11b08a};return _0x583f96;})[_0x9b77('0x10')](respondWithResult(_0xd3264c,null))['catch'](function(_0x22e74d){var _0x469ae5=_0x28c2fd[_0x9b77('0x1b')]['test']?0x1f4:_0x22e74d['statusCode']||0x1f4;logger[_0x9b77('0xa4')](_0x22e74d[_0x9b77('0xa5')]);delete _0x22e74d['name'];if(_0x469ae5===0x191){_0x469ae5=0x190;}_0xd3264c[_0x9b77('0x7')](_0x469ae5)[_0x9b77('0x13')](_0x28c2fd[_0x9b77('0x1b')][_0x9b77('0xa6')]?{'message':_0x9b77('0xa7'),'statusCode':_0x22e74d[_0x9b77('0xa8')]}:_0x22e74d);});};function getSelectList(_0x3f48e0,_0x47e775,_0x20731a,_0x31690e,_0x45f987,_0x21c19c){var _0x31cb7e={'method':_0x9b77('0x8d'),'uri':_0x3f48e0+_0x9b77('0x8e')+_0x31690e+_0x9b77('0xa9')+_0x45f987+_0x9b77('0xaa')+_0x9b77('0xab'),'headers':{'Authorization':_0x9b77('0x89')+_0x21c19c,'If-None-Match':null,'OData-Version':_0x9b77('0x8a')},'json':!![]};return rp(_0x31cb7e)[_0x9b77('0x10')](function(_0x247bc7){var _0x39c3a7=[];var _0x1e70f5=_0x247bc7[_0x9b77('0xac')][_0x9b77('0xad')];_0x1e70f5['forEach'](function(_0x387c53){_0x39c3a7['push']({'name':_0x387c53[_0x9b77('0xae')][_0x9b77('0xaf')]['Label'],'value':String(_0x387c53[_0x9b77('0xb0')])});});var _0xf538f9={'id':_0x47e775+'_'+_0x247bc7['LogicalName'],'name':_0x247bc7[_0x9b77('0xb1')]['UserLocalizedLabel'][_0x9b77('0xae')],'custom':![],'options':_0x39c3a7};_0x20731a['push'](_0xf538f9);return _0x20731a;});}function getBooleanList(_0x2e9515,_0x265db1,_0xdbe5a0,_0x5076c0,_0x944fb9,_0x50dda4){var _0xb62ade={'method':_0x9b77('0x8d'),'uri':_0x2e9515+_0x9b77('0x8e')+_0x5076c0+_0x9b77('0xa9')+_0x944fb9+_0x9b77('0xb2'),'headers':{'Authorization':_0x9b77('0x89')+_0x50dda4,'If-None-Match':null,'OData-Version':_0x9b77('0x8a')},'json':!![]};return rp(_0xb62ade)[_0x9b77('0x10')](function(_0x1bb2ed){var _0x1f9c07=[];_0x1f9c07[_0x9b77('0x95')]({'name':_0x1bb2ed[_0x9b77('0xac')][_0x9b77('0xb3')][_0x9b77('0xae')][_0x9b77('0xaf')][_0x9b77('0xae')],'value':_0x9b77('0xb4')},{'name':_0x1bb2ed[_0x9b77('0xac')][_0x9b77('0xb5')]['Label'][_0x9b77('0xaf')][_0x9b77('0xae')],'value':_0x9b77('0xb6')});var _0x24e9a3={'id':_0x265db1+'_'+_0x1bb2ed[_0x9b77('0x91')],'name':_0x1bb2ed[_0x9b77('0xb1')][_0x9b77('0xaf')][_0x9b77('0xae')],'custom':![],'options':_0x1f9c07};_0xdbe5a0[_0x9b77('0x95')](_0x24e9a3);return _0xdbe5a0;});}function getInputList(_0x257d66,_0x2f0685,_0x408bb,_0x5c98a7,_0xe0e45e,_0x8fa52d,_0x5d43e0){var _0x2b51dc={'method':_0x9b77('0x8d'),'uri':_0x257d66+_0x9b77('0x8e')+_0xe0e45e+_0x9b77('0xa9')+_0x8fa52d+_0x9b77('0xb7')+_0x408bb+_0x9b77('0xb8'),'headers':{'Authorization':_0x9b77('0x89')+_0x5d43e0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b51dc)[_0x9b77('0x10')](function(_0x11cdbc){var _0x5cf333={'id':_0x2f0685+'_'+_0x11cdbc[_0x9b77('0x91')],'name':_0x11cdbc[_0x9b77('0xb1')][_0x9b77('0xaf')]?_0x11cdbc[_0x9b77('0xb1')]['UserLocalizedLabel'][_0x9b77('0xae')]:_0x11cdbc['LogicalName'],'custom':![],'options':[]};_0x5c98a7[_0x9b77('0x95')](_0x5cf333);return _0x5c98a7;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 40f4444..898c0e0 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x576cf9,_0x8687e3){var _0x4db907=function(_0x376dc7){while(--_0x376dc7){_0x576cf9['push'](_0x576cf9['shift']());}};_0x4db907(++_0x8687e3);}(_0x757a,0xde));var _0xa757=function(_0x4385b7,_0x287738){_0x4385b7=_0x4385b7-0x0;var _0x4b6bb0=_0x757a[_0x4385b7];return _0x4b6bb0;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56d297,_0x13cc79){var _0xda61a=function(_0x58683d){while(--_0x58683d){_0x56d297['push'](_0x56d297['shift']());}};_0xda61a(++_0x13cc79);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c86642a..fe173b4 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 _0x026c=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','findAll','options','attributes','limit','include','model','map','then','GetDynamics365Account','catch','ShowDynamics365Account','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x026c,0x1ad));var _0xc026=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x026c[_0x5c7a85];return _0x35290f;};'use strict';var _=require(_0xc026('0x0'));var util=require(_0xc026('0x1'));var moment=require('moment');var BPromise=require(_0xc026('0x2'));var rs=require(_0xc026('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc026('0x4'))['db'];var utils=require(_0xc026('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc026('0x6'));var jayson=require(_0xc026('0x7'));var client=jayson['client'][_0xc026('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1aecaf,_0x123ea2,_0x1906cc){return new BPromise(function(_0x238ae5,_0x3ddcca){return client[_0xc026('0x9')](_0x1aecaf,_0x1906cc)['then'](function(_0x20f15b){logger[_0xc026('0xa')](_0xc026('0xb'),_0x123ea2,_0xc026('0xc'));logger[_0xc026('0xd')](_0xc026('0xe'),_0x123ea2,_0xc026('0xc'),JSON[_0xc026('0xf')](_0x20f15b));if(_0x20f15b[_0xc026('0x10')]){if(_0x20f15b[_0xc026('0x10')][_0xc026('0x11')]===0x1f4){logger[_0xc026('0x10')](_0xc026('0xb'),_0x123ea2,_0x20f15b[_0xc026('0x10')][_0xc026('0x12')]);return _0x3ddcca(_0x20f15b[_0xc026('0x10')][_0xc026('0x12')]);}logger['error'](_0xc026('0xb'),_0x123ea2,_0x20f15b[_0xc026('0x10')][_0xc026('0x12')]);return _0x238ae5(_0x20f15b['error'][_0xc026('0x12')]);}else{logger[_0xc026('0xa')](_0xc026('0xb'),_0x123ea2,'request\x20sent');_0x238ae5(_0x20f15b[_0xc026('0x13')]['message']);}})['catch'](function(_0x5e248a){logger[_0xc026('0x10')](_0xc026('0xb'),_0x123ea2,_0x5e248a);_0x3ddcca(_0x5e248a);});});}exports['GetDynamics365Account']=function(_0x1e9de7){var _0xd112d2=this;return new Promise(function(_0x4c0ba4,_0xaab1d3){return db[_0xc026('0x14')][_0xc026('0x15')]({'raw':_0x1e9de7[_0xc026('0x16')]?_0x1e9de7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e9de7[_0xc026('0x16')]?_0x1e9de7[_0xc026('0x16')]['where']||null:null,'attributes':_0x1e9de7[_0xc026('0x16')]?_0x1e9de7[_0xc026('0x16')][_0xc026('0x17')]||null:null,'limit':_0x1e9de7['options']?_0x1e9de7[_0xc026('0x16')][_0xc026('0x18')]||null:null,'include':_0x1e9de7[_0xc026('0x16')]?_0x1e9de7[_0xc026('0x16')][_0xc026('0x19')]?_['map'](_0x1e9de7[_0xc026('0x16')]['include'],function(_0x5ca4f8){return{'model':db[_0x5ca4f8[_0xc026('0x1a')]],'as':_0x5ca4f8['as'],'attributes':_0x5ca4f8[_0xc026('0x17')],'include':_0x5ca4f8[_0xc026('0x19')]?_[_0xc026('0x1b')](_0x5ca4f8[_0xc026('0x19')],function(_0x326ab7){return{'model':db[_0x326ab7[_0xc026('0x1a')]],'as':_0x326ab7['as'],'attributes':_0x326ab7['attributes'],'include':_0x326ab7[_0xc026('0x19')]?_['map'](_0x326ab7[_0xc026('0x19')],function(_0xa0a3c){return{'model':db[_0xa0a3c['model']],'as':_0xa0a3c['as'],'attributes':_0xa0a3c[_0xc026('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc026('0x1c')](function(_0x29a295){logger['info'](_0xc026('0x1d'),_0x1e9de7);logger['debug'](_0xc026('0x1d'),_0x1e9de7,JSON[_0xc026('0xf')](_0x29a295));_0x4c0ba4(_0x29a295);})[_0xc026('0x1e')](function(_0x233dc3){logger[_0xc026('0x10')]('GetDynamics365Account',_0x233dc3[_0xc026('0x12')],_0x1e9de7);_0xaab1d3(_0xd112d2[_0xc026('0x10')](0x1f4,_0x233dc3[_0xc026('0x12')]));});});};exports[_0xc026('0x1f')]=function(_0x117a84){var _0x1d5c7f=this;return new Promise(function(_0x186892,_0xf67f90){return db[_0xc026('0x14')][_0xc026('0x20')]({'raw':_0x117a84[_0xc026('0x16')]?_0x117a84[_0xc026('0x16')][_0xc026('0x21')]===undefined?!![]:![]:!![],'where':_0x117a84[_0xc026('0x16')]?_0x117a84[_0xc026('0x16')]['where']||null:null,'attributes':_0x117a84[_0xc026('0x16')]?_0x117a84['options'][_0xc026('0x17')]||null:null,'include':_0x117a84[_0xc026('0x16')]?_0x117a84[_0xc026('0x16')]['include']?_[_0xc026('0x1b')](_0x117a84[_0xc026('0x16')]['include'],function(_0x325950){return{'model':db[_0x325950['model']],'as':_0x325950['as'],'attributes':_0x325950[_0xc026('0x17')],'include':_0x325950[_0xc026('0x19')]?_[_0xc026('0x1b')](_0x325950['include'],function(_0x2b51ad){return{'model':db[_0x2b51ad[_0xc026('0x1a')]],'as':_0x2b51ad['as'],'attributes':_0x2b51ad[_0xc026('0x17')],'include':_0x2b51ad['include']?_[_0xc026('0x1b')](_0x2b51ad['include'],function(_0x24d88d){return{'model':db[_0x24d88d[_0xc026('0x1a')]],'as':_0x24d88d['as'],'attributes':_0x24d88d[_0xc026('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc026('0x1c')](function(_0x60b831){logger[_0xc026('0xa')](_0xc026('0x1f'),_0x117a84);logger['debug']('ShowDynamics365Account',_0x117a84,JSON[_0xc026('0xf')](_0x60b831));_0x186892(_0x60b831);})[_0xc026('0x1e')](function(_0x420f1d){logger['error'](_0xc026('0x1f'),_0x420f1d['message'],_0x117a84);_0xf67f90(_0x1d5c7f[_0xc026('0x10')](0x1f4,_0x420f1d[_0xc026('0x12')]));});});}; \ No newline at end of file +var _0x3cad=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','catch','findAll','options','raw','attributes','limit','map','include','model','GetDynamics365Account','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x3cad,0xc4));var _0xd3ca=function(_0x489e08,_0xfc35c3){_0x489e08=_0x489e08-0x0;var _0x457180=_0x3cad[_0x489e08];return _0x457180;};'use strict';var _=require(_0xd3ca('0x0'));var util=require(_0xd3ca('0x1'));var moment=require(_0xd3ca('0x2'));var BPromise=require(_0xd3ca('0x3'));var rs=require(_0xd3ca('0x4'));var fs=require('fs');var Redis=require(_0xd3ca('0x5'));var db=require(_0xd3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd3ca('0x7'));var jayson=require(_0xd3ca('0x8'));var client=jayson[_0xd3ca('0x9')][_0xd3ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4099d7,_0x302fca,_0x52b9c4){return new BPromise(function(_0x2f4463,_0x4ad465){return client[_0xd3ca('0xb')](_0x4099d7,_0x52b9c4)[_0xd3ca('0xc')](function(_0x3027d1){logger[_0xd3ca('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x302fca,_0xd3ca('0xe'));logger[_0xd3ca('0xf')](_0xd3ca('0x10'),_0x302fca,_0xd3ca('0xe'),JSON[_0xd3ca('0x11')](_0x3027d1));if(_0x3027d1[_0xd3ca('0x12')]){if(_0x3027d1['error'][_0xd3ca('0x13')]===0x1f4){logger[_0xd3ca('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x302fca,_0x3027d1[_0xd3ca('0x12')][_0xd3ca('0x14')]);return _0x4ad465(_0x3027d1[_0xd3ca('0x12')][_0xd3ca('0x14')]);}logger[_0xd3ca('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x302fca,_0x3027d1[_0xd3ca('0x12')][_0xd3ca('0x14')]);return _0x2f4463(_0x3027d1[_0xd3ca('0x12')][_0xd3ca('0x14')]);}else{logger[_0xd3ca('0xd')](_0xd3ca('0x15'),_0x302fca,_0xd3ca('0xe'));_0x2f4463(_0x3027d1['result'][_0xd3ca('0x14')]);}})[_0xd3ca('0x16')](function(_0x4e15b9){logger[_0xd3ca('0x12')](_0xd3ca('0x15'),_0x302fca,_0x4e15b9);_0x4ad465(_0x4e15b9);});});}exports['GetDynamics365Account']=function(_0x37f07b){var _0x241c50=this;return new Promise(function(_0xdccaa6,_0x10185b){return db['Dynamics365Account'][_0xd3ca('0x17')]({'raw':_0x37f07b[_0xd3ca('0x18')]?_0x37f07b[_0xd3ca('0x18')][_0xd3ca('0x19')]===undefined?!![]:![]:!![],'where':_0x37f07b[_0xd3ca('0x18')]?_0x37f07b['options']['where']||null:null,'attributes':_0x37f07b[_0xd3ca('0x18')]?_0x37f07b[_0xd3ca('0x18')][_0xd3ca('0x1a')]||null:null,'limit':_0x37f07b[_0xd3ca('0x18')]?_0x37f07b['options'][_0xd3ca('0x1b')]||null:null,'include':_0x37f07b[_0xd3ca('0x18')]?_0x37f07b['options']['include']?_[_0xd3ca('0x1c')](_0x37f07b[_0xd3ca('0x18')][_0xd3ca('0x1d')],function(_0x611138){return{'model':db[_0x611138[_0xd3ca('0x1e')]],'as':_0x611138['as'],'attributes':_0x611138[_0xd3ca('0x1a')],'include':_0x611138[_0xd3ca('0x1d')]?_[_0xd3ca('0x1c')](_0x611138[_0xd3ca('0x1d')],function(_0x312d27){return{'model':db[_0x312d27[_0xd3ca('0x1e')]],'as':_0x312d27['as'],'attributes':_0x312d27[_0xd3ca('0x1a')],'include':_0x312d27['include']?_[_0xd3ca('0x1c')](_0x312d27['include'],function(_0x27c78d){return{'model':db[_0x27c78d['model']],'as':_0x27c78d['as'],'attributes':_0x27c78d[_0xd3ca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd3ca('0xc')](function(_0xa9ecf3){logger['info']('GetDynamics365Account',_0x37f07b);logger[_0xd3ca('0xf')](_0xd3ca('0x1f'),_0x37f07b,JSON['stringify'](_0xa9ecf3));_0xdccaa6(_0xa9ecf3);})[_0xd3ca('0x16')](function(_0x580169){logger[_0xd3ca('0x12')](_0xd3ca('0x1f'),_0x580169[_0xd3ca('0x14')],_0x37f07b);_0x10185b(_0x241c50[_0xd3ca('0x12')](0x1f4,_0x580169[_0xd3ca('0x14')]));});});};exports[_0xd3ca('0x20')]=function(_0x48b73a){var _0x20bd11=this;return new Promise(function(_0x59a76b,_0x4bf3f4){return db['Dynamics365Account'][_0xd3ca('0x21')]({'raw':_0x48b73a[_0xd3ca('0x18')]?_0x48b73a['options'][_0xd3ca('0x19')]===undefined?!![]:![]:!![],'where':_0x48b73a[_0xd3ca('0x18')]?_0x48b73a[_0xd3ca('0x18')]['where']||null:null,'attributes':_0x48b73a[_0xd3ca('0x18')]?_0x48b73a[_0xd3ca('0x18')][_0xd3ca('0x1a')]||null:null,'include':_0x48b73a['options']?_0x48b73a[_0xd3ca('0x18')][_0xd3ca('0x1d')]?_['map'](_0x48b73a['options'][_0xd3ca('0x1d')],function(_0x4a4a40){return{'model':db[_0x4a4a40['model']],'as':_0x4a4a40['as'],'attributes':_0x4a4a40[_0xd3ca('0x1a')],'include':_0x4a4a40['include']?_[_0xd3ca('0x1c')](_0x4a4a40[_0xd3ca('0x1d')],function(_0x4545af){return{'model':db[_0x4545af[_0xd3ca('0x1e')]],'as':_0x4545af['as'],'attributes':_0x4545af['attributes'],'include':_0x4545af[_0xd3ca('0x1d')]?_[_0xd3ca('0x1c')](_0x4545af['include'],function(_0x1baec6){return{'model':db[_0x1baec6[_0xd3ca('0x1e')]],'as':_0x1baec6['as'],'attributes':_0x1baec6['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3ca('0xc')](function(_0x37fd05){logger[_0xd3ca('0xd')](_0xd3ca('0x20'),_0x48b73a);logger[_0xd3ca('0xf')](_0xd3ca('0x20'),_0x48b73a,JSON['stringify'](_0x37fd05));_0x59a76b(_0x37fd05);})[_0xd3ca('0x16')](function(_0x1b2f7d){logger[_0xd3ca('0x12')]('ShowDynamics365Account',_0x1b2f7d[_0xd3ca('0x14')],_0x48b73a);_0x4bf3f4(_0x20bd11[_0xd3ca('0x12')](0x1f4,_0x1b2f7d[_0xd3ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ae6e77d..7f9c328 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 _0xd276=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','post','create','put','/:id','update','exports','multer'];(function(_0x4cfff8,_0x37aa0a){var _0x3617d7=function(_0x20ce32){while(--_0x20ce32){_0x4cfff8['push'](_0x4cfff8['shift']());}};_0x3617d7(++_0x37aa0a);}(_0xd276,0xfc));var _0x6d27=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0xd276[_0x18b5e8];return _0x25baed;};'use strict';var multer=require(_0x6d27('0x0'));var util=require(_0x6d27('0x1'));var path=require(_0x6d27('0x2'));var timeout=require(_0x6d27('0x3'));var express=require('express');var router=express[_0x6d27('0x4')]();var fs_extra=require(_0x6d27('0x5'));var auth=require(_0x6d27('0x6'));var interaction=require(_0x6d27('0x7'));var config=require('../../config/environment');var controller=require(_0x6d27('0x8'));router[_0x6d27('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d27('0xa')]);router[_0x6d27('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6d27('0xb')]);router[_0x6d27('0x9')](_0x6d27('0xc'),auth[_0x6d27('0xd')](),controller[_0x6d27('0xe')]);router[_0x6d27('0x9')](_0x6d27('0xf'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x10')]);router[_0x6d27('0x9')]('/:id/descriptions',auth[_0x6d27('0xd')](),controller['getDescriptions']);router[_0x6d27('0x11')]('/',auth[_0x6d27('0xd')](),controller[_0x6d27('0x12')]);router[_0x6d27('0x13')](_0x6d27('0x14'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x15')]);router['delete']('/:id',auth[_0x6d27('0xd')](),controller['destroy']);module[_0x6d27('0x16')]=router; \ No newline at end of file +var _0x0f49=['update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x309e68,_0x461c73){var _0x4f86b1=function(_0x17f4f0){while(--_0x17f4f0){_0x309e68['push'](_0x309e68['shift']());}};_0x4f86b1(++_0x461c73);}(_0x0f49,0x8e));var _0x90f4=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x0f49[_0xa28b1a];return _0x4c9b78;};'use strict';var multer=require('multer');var util=require(_0x90f4('0x0'));var path=require(_0x90f4('0x1'));var timeout=require(_0x90f4('0x2'));var express=require(_0x90f4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90f4('0x4'));var interaction=require(_0x90f4('0x5'));var config=require(_0x90f4('0x6'));var controller=require(_0x90f4('0x7'));router[_0x90f4('0x8')]('/',auth[_0x90f4('0x9')](),controller[_0x90f4('0xa')]);router[_0x90f4('0x8')](_0x90f4('0xb'),auth['isAuthenticated'](),controller[_0x90f4('0xc')]);router[_0x90f4('0x8')](_0x90f4('0xd'),auth[_0x90f4('0x9')](),controller['getFields']);router[_0x90f4('0x8')](_0x90f4('0xe'),auth[_0x90f4('0x9')](),controller['getSubjects']);router[_0x90f4('0x8')](_0x90f4('0xf'),auth[_0x90f4('0x9')](),controller[_0x90f4('0x10')]);router[_0x90f4('0x11')]('/',auth[_0x90f4('0x9')](),controller['create']);router[_0x90f4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x90f4('0x13')]);router[_0x90f4('0x14')]('/:id',auth[_0x90f4('0x9')](),controller[_0x90f4('0x15')]);module[_0x90f4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cd82447..5d78da3 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 _0x8849=['sequelize','STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8849,0x100));var _0x9884=function(_0x6fc601,_0xb5fcfb){_0x6fc601=_0x6fc601-0x0;var _0x47041d=_0x8849[_0x6fc601];return _0x47041d;};'use strict';var Sequelize=require(_0x9884('0x0'));module['exports']={'name':{'type':Sequelize[_0x9884('0x1')]},'description':{'type':Sequelize[_0x9884('0x1')]},'ticketType':{'type':Sequelize[_0x9884('0x2')](_0x9884('0x3'),_0x9884('0x4')),'defaultValue':_0x9884('0x3')},'moduleCreate':{'type':Sequelize[_0x9884('0x2')](_0x9884('0x5'),_0x9884('0x6')),'defaultValue':_0x9884('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9884('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9884('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd80=['nothing','BOOLEAN','sequelize','STRING','incident','phonecall','ENUM','contact'];(function(_0x39d6a8,_0xc9c91a){var _0x93f3db=function(_0x953b09){while(--_0x953b09){_0x39d6a8['push'](_0x39d6a8['shift']());}};_0x93f3db(++_0xc9c91a);}(_0xfd80,0x1ea));var _0x0fd8=function(_0x1437c9,_0x3d048d){_0x1437c9=_0x1437c9-0x0;var _0x59418b=_0xfd80[_0x1437c9];return _0x59418b;};'use strict';var Sequelize=require(_0x0fd8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fd8('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x0fd8('0x2'),_0x0fd8('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x0fd8('0x4')](_0x0fd8('0x5'),_0x0fd8('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x0fd8('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index dd6b598..f0a19c0 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 _0xdb42=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','rows','catch','find','create','body','destroy','getFields','findOne','params','Dynamics365Field','filter','getSubjects','pick','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x376de5,_0x1b44a9){var _0x58d8f7=function(_0x2f3480){while(--_0x2f3480){_0x376de5['push'](_0x376de5['shift']());}};_0x58d8f7(++_0x1b44a9);}(_0xdb42,0xfa));var _0x2db4=function(_0x29675d,_0x207e7d){_0x29675d=_0x29675d-0x0;var _0x376fa3=_0xdb42[_0x29675d];return _0x376fa3;};'use strict';var emlformat=require(_0x2db4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2db4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2db4('0x2'));var moment=require(_0x2db4('0x3'));var BPromise=require(_0x2db4('0x4'));var Mustache=require(_0x2db4('0x5'));var util=require(_0x2db4('0x6'));var path=require(_0x2db4('0x7'));var sox=require(_0x2db4('0x8'));var csv=require(_0x2db4('0x9'));var ejs=require(_0x2db4('0xa'));var fs=require('fs');var fs_extra=require(_0x2db4('0xb'));var _=require(_0x2db4('0xc'));var squel=require(_0x2db4('0xd'));var crypto=require(_0x2db4('0xe'));var jsforce=require(_0x2db4('0xf'));var deskjs=require(_0x2db4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2db4('0x11'));var Papa=require(_0x2db4('0x12'));var Redis=require(_0x2db4('0x13'));var authService=require(_0x2db4('0x14'));var qs=require(_0x2db4('0x15'));var as=require(_0x2db4('0x16'));var hardwareService=require(_0x2db4('0x17'));var logger=require(_0x2db4('0x18'))(_0x2db4('0x19'));var utils=require(_0x2db4('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2db4('0x1b'))['db'];function respondWithStatusCode(_0x1f34cb,_0x152e20){_0x152e20=_0x152e20||0xcc;return function(_0x4802cf){if(_0x4802cf){return _0x1f34cb[_0x2db4('0x1c')](_0x152e20);}return _0x1f34cb[_0x2db4('0x1d')](_0x152e20)[_0x2db4('0x1e')]();};}function respondWithResult(_0x380b90,_0x56f333){_0x56f333=_0x56f333||0xc8;return function(_0x1b522e){if(_0x1b522e){return _0x380b90[_0x2db4('0x1d')](_0x56f333)[_0x2db4('0x1f')](_0x1b522e);}};}function respondWithFilteredResult(_0x4032fa,_0x4faa62){return function(_0x8483ca){if(_0x8483ca){var _0x96e3b=typeof _0x4faa62['offset']===_0x2db4('0x20')&&typeof _0x4faa62[_0x2db4('0x21')]==='undefined';var _0xf7542=_0x8483ca[_0x2db4('0x22')];var _0x4f319d=_0x96e3b?0x0:_0x4faa62[_0x2db4('0x23')];var _0x436aea=_0x96e3b?_0x8483ca[_0x2db4('0x22')]:_0x4faa62['offset']+_0x4faa62[_0x2db4('0x21')];var _0x11d4ee;if(_0x436aea>=_0xf7542){_0x436aea=_0xf7542;_0x11d4ee=0xc8;}else{_0x11d4ee=0xce;}_0x4032fa[_0x2db4('0x1d')](_0x11d4ee);return _0x4032fa[_0x2db4('0x24')](_0x2db4('0x25'),_0x4f319d+'-'+_0x436aea+'/'+_0xf7542)[_0x2db4('0x1f')](_0x8483ca);}return null;};}function patchUpdates(_0x442c9a){return function(_0x1c1199){try{jsonpatch[_0x2db4('0x26')](_0x1c1199,_0x442c9a,!![]);}catch(_0x130813){return BPromise[_0x2db4('0x27')](_0x130813);}return _0x1c1199[_0x2db4('0x28')]();};}function saveUpdates(_0x297ae6,_0x21a670){return function(_0x3b9711){if(_0x3b9711){return _0x3b9711[_0x2db4('0x29')](_0x297ae6)[_0x2db4('0x2a')](function(_0x1bf8bd){return _0x1bf8bd;});}return null;};}function removeEntity(_0x114542,_0x4fc7a9){return function(_0x53082a){if(_0x53082a){return _0x53082a['destroy']()['then'](function(){_0x114542[_0x2db4('0x1d')](0xcc)[_0x2db4('0x1e')]();});}};}function handleEntityNotFound(_0x51ceaf,_0x55c0c0){return function(_0x41f968){if(!_0x41f968){_0x51ceaf[_0x2db4('0x1c')](0x194);}return _0x41f968;};}function handleError(_0x277fee,_0x202d38){_0x202d38=_0x202d38||0x1f4;return function(_0xd6f695){logger[_0x2db4('0x2b')](_0xd6f695['stack']);if(_0xd6f695[_0x2db4('0x2c')]){delete _0xd6f695[_0x2db4('0x2c')];}_0x277fee[_0x2db4('0x1d')](_0x202d38)[_0x2db4('0x2d')](_0xd6f695);};}exports[_0x2db4('0x2e')]=function(_0x58b92d,_0x488d72){var _0x4a1450={},_0x5c1643={},_0x1bf9a0={'count':0x0,'rows':[]};var _0x22b419=_[_0x2db4('0x2f')](db['Dynamics365Configuration'][_0x2db4('0x30')],function(_0xd40ee){return{'name':_0xd40ee[_0x2db4('0x31')],'type':_0xd40ee[_0x2db4('0x32')][_0x2db4('0x33')]};});_0x5c1643[_0x2db4('0x34')]=_[_0x2db4('0x2f')](_0x22b419,'name');_0x5c1643[_0x2db4('0x35')]=_[_0x2db4('0x36')](_0x58b92d[_0x2db4('0x35')]);_0x5c1643[_0x2db4('0x37')]=_[_0x2db4('0x38')](_0x5c1643[_0x2db4('0x34')],_0x5c1643[_0x2db4('0x35')]);_0x4a1450[_0x2db4('0x39')]=_[_0x2db4('0x38')](_0x5c1643['model'],qs[_0x2db4('0x3a')](_0x58b92d['query'][_0x2db4('0x3a')]));_0x4a1450[_0x2db4('0x39')]=_0x4a1450['attributes'][_0x2db4('0x3b')]?_0x4a1450['attributes']:_0x5c1643['model'];if(!_0x58b92d[_0x2db4('0x35')][_0x2db4('0x3c')](_0x2db4('0x3d'))){_0x4a1450[_0x2db4('0x21')]=qs['limit'](_0x58b92d[_0x2db4('0x35')][_0x2db4('0x21')]);_0x4a1450[_0x2db4('0x23')]=qs['offset'](_0x58b92d[_0x2db4('0x35')][_0x2db4('0x23')]);}_0x4a1450[_0x2db4('0x3e')]=qs[_0x2db4('0x3f')](_0x58b92d[_0x2db4('0x35')][_0x2db4('0x3f')]);_0x4a1450[_0x2db4('0x40')]=qs[_0x2db4('0x37')](_['pick'](_0x58b92d[_0x2db4('0x35')],_0x5c1643[_0x2db4('0x37')]),_0x22b419);if(_0x58b92d[_0x2db4('0x35')]['filter']){_0x4a1450[_0x2db4('0x40')]=_[_0x2db4('0x41')](_0x4a1450[_0x2db4('0x40')],{'$or':_[_0x2db4('0x2f')](_0x22b419,function(_0x139305){if(_0x139305[_0x2db4('0x32')]!==_0x2db4('0x42')){var _0x130536={};_0x130536[_0x139305[_0x2db4('0x2c')]]={'$like':'%'+_0x58b92d[_0x2db4('0x35')]['filter']+'%'};return _0x130536;}})});}_0x4a1450=_[_0x2db4('0x41')]({},_0x4a1450,_0x58b92d[_0x2db4('0x43')]);var _0x513a13={'where':_0x4a1450[_0x2db4('0x40')]};return db[_0x2db4('0x44')][_0x2db4('0x22')](_0x513a13)[_0x2db4('0x2a')](function(_0x3b6852){_0x1bf9a0[_0x2db4('0x22')]=_0x3b6852;if(_0x58b92d[_0x2db4('0x35')][_0x2db4('0x45')]){_0x4a1450[_0x2db4('0x46')]=[{'all':!![]}];}return db[_0x2db4('0x44')]['findAll'](_0x4a1450);})[_0x2db4('0x2a')](function(_0x2c44ab){_0x1bf9a0[_0x2db4('0x47')]=_0x2c44ab;return _0x1bf9a0;})[_0x2db4('0x2a')](respondWithFilteredResult(_0x488d72,_0x4a1450))[_0x2db4('0x48')](handleError(_0x488d72,null));};exports['show']=function(_0xfeca9a,_0x35891e){var _0x52570e={'raw':![],'where':{'id':_0xfeca9a['params']['id']}},_0xcd7e56={};_0xcd7e56[_0x2db4('0x34')]=_[_0x2db4('0x36')](db['Dynamics365Configuration'][_0x2db4('0x30')]);_0xcd7e56[_0x2db4('0x35')]=_[_0x2db4('0x36')](_0xfeca9a[_0x2db4('0x35')]);_0xcd7e56[_0x2db4('0x37')]=_[_0x2db4('0x38')](_0xcd7e56[_0x2db4('0x34')],_0xcd7e56[_0x2db4('0x35')]);_0x52570e[_0x2db4('0x39')]=_[_0x2db4('0x38')](_0xcd7e56['model'],qs[_0x2db4('0x3a')](_0xfeca9a[_0x2db4('0x35')][_0x2db4('0x3a')]));_0x52570e['attributes']=_0x52570e[_0x2db4('0x39')]['length']?_0x52570e[_0x2db4('0x39')]:_0xcd7e56['model'];if(_0xfeca9a[_0x2db4('0x35')][_0x2db4('0x45')]){_0x52570e[_0x2db4('0x46')]=[{'all':!![]}];}_0x52570e=_[_0x2db4('0x41')]({},_0x52570e,_0xfeca9a['options']);return db[_0x2db4('0x44')][_0x2db4('0x49')](_0x52570e)[_0x2db4('0x2a')](handleEntityNotFound(_0x35891e,null))[_0x2db4('0x2a')](respondWithResult(_0x35891e,null))[_0x2db4('0x48')](handleError(_0x35891e,null));};exports[_0x2db4('0x4a')]=function(_0x2b68eb,_0x42a5f1){return db['Dynamics365Configuration'][_0x2db4('0x4a')](_0x2b68eb['body'],{})[_0x2db4('0x2a')](respondWithResult(_0x42a5f1,0xc9))['catch'](handleError(_0x42a5f1,null));};exports[_0x2db4('0x29')]=function(_0x5be200,_0x2824a9){if(_0x5be200[_0x2db4('0x4b')]['id']){delete _0x5be200[_0x2db4('0x4b')]['id'];}return db[_0x2db4('0x44')][_0x2db4('0x49')]({'where':{'id':_0x5be200['params']['id']}})['then'](handleEntityNotFound(_0x2824a9,null))[_0x2db4('0x2a')](saveUpdates(_0x5be200[_0x2db4('0x4b')],null))[_0x2db4('0x2a')](respondWithResult(_0x2824a9,null))[_0x2db4('0x48')](handleError(_0x2824a9,null));};exports[_0x2db4('0x4c')]=function(_0x5de01a,_0x24ccf1){return db[_0x2db4('0x44')][_0x2db4('0x49')]({'where':{'id':_0x5de01a['params']['id']}})[_0x2db4('0x2a')](handleEntityNotFound(_0x24ccf1,null))[_0x2db4('0x2a')](removeEntity(_0x24ccf1,null))[_0x2db4('0x48')](handleError(_0x24ccf1,null));};exports[_0x2db4('0x4d')]=function(_0x141e03,_0x2c0718,_0x474f8a){var _0x5cbaa9={};var _0x11eed1={};var _0x4790c9;var _0x105e7e;return db[_0x2db4('0x44')][_0x2db4('0x4e')]({'where':{'id':_0x141e03[_0x2db4('0x4f')]['id']}})[_0x2db4('0x2a')](handleEntityNotFound(_0x2c0718,null))[_0x2db4('0x2a')](function(_0x3fa039){if(_0x3fa039){_0x4790c9=_0x3fa039;_0x11eed1[_0x2db4('0x34')]=_['keys'](db[_0x2db4('0x50')][_0x2db4('0x30')]);_0x11eed1[_0x2db4('0x35')]=_[_0x2db4('0x36')](_0x141e03[_0x2db4('0x35')]);_0x11eed1['filters']=_[_0x2db4('0x38')](_0x11eed1[_0x2db4('0x34')],_0x11eed1['query']);_0x5cbaa9['attributes']=_[_0x2db4('0x38')](_0x11eed1[_0x2db4('0x34')],qs[_0x2db4('0x3a')](_0x141e03[_0x2db4('0x35')][_0x2db4('0x3a')]));_0x5cbaa9['attributes']=_0x5cbaa9['attributes'][_0x2db4('0x3b')]?_0x5cbaa9[_0x2db4('0x39')]:_0x11eed1[_0x2db4('0x34')];_0x5cbaa9[_0x2db4('0x3e')]=qs['sort'](_0x141e03[_0x2db4('0x35')]['sort']);_0x5cbaa9[_0x2db4('0x40')]=qs['filters'](_['pick'](_0x141e03[_0x2db4('0x35')],_0x11eed1[_0x2db4('0x37')]));if(_0x141e03[_0x2db4('0x35')][_0x2db4('0x51')]){_0x5cbaa9[_0x2db4('0x40')]=_[_0x2db4('0x41')](_0x5cbaa9['where'],{'$or':_['map'](_0x5cbaa9[_0x2db4('0x39')],function(_0x6fadff){var _0x3d2de7={};_0x3d2de7[_0x6fadff]={'$like':'%'+_0x141e03['query'][_0x2db4('0x51')]+'%'};return _0x3d2de7;})});}_0x5cbaa9=_['merge']({},_0x5cbaa9,_0x141e03['options']);return _0x4790c9['getFields'](_0x5cbaa9);}})['then'](function(_0xb037fb){if(_0xb037fb){_0x105e7e=_0xb037fb[_0x2db4('0x3b')];if(!_0x141e03[_0x2db4('0x35')][_0x2db4('0x3c')]('nolimit')){_0x5cbaa9[_0x2db4('0x21')]=qs['limit'](_0x141e03['query'][_0x2db4('0x21')]);_0x5cbaa9[_0x2db4('0x23')]=qs['offset'](_0x141e03[_0x2db4('0x35')][_0x2db4('0x23')]);}return _0x4790c9[_0x2db4('0x4d')](_0x5cbaa9);}})['then'](function(_0x26fc81){if(_0x26fc81){return _0x26fc81?{'count':_0x105e7e,'rows':_0x26fc81}:null;}})[_0x2db4('0x2a')](respondWithResult(_0x2c0718,null))[_0x2db4('0x48')](handleError(_0x2c0718,null));};exports[_0x2db4('0x52')]=function(_0x4bf3c6,_0x2e931d,_0x3ebc89){var _0x38f5fa={};var _0x598243={};var _0x1308a9;var _0x2efd34;return db[_0x2db4('0x44')][_0x2db4('0x4e')]({'where':{'id':_0x4bf3c6[_0x2db4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2e931d,null))['then'](function(_0x5cfa41){if(_0x5cfa41){_0x1308a9=_0x5cfa41;_0x598243[_0x2db4('0x34')]=_[_0x2db4('0x36')](db[_0x2db4('0x50')][_0x2db4('0x30')]);_0x598243[_0x2db4('0x35')]=_[_0x2db4('0x36')](_0x4bf3c6[_0x2db4('0x35')]);_0x598243[_0x2db4('0x37')]=_[_0x2db4('0x38')](_0x598243[_0x2db4('0x34')],_0x598243[_0x2db4('0x35')]);_0x38f5fa[_0x2db4('0x39')]=_[_0x2db4('0x38')](_0x598243[_0x2db4('0x34')],qs['fields'](_0x4bf3c6[_0x2db4('0x35')][_0x2db4('0x3a')]));_0x38f5fa['attributes']=_0x38f5fa[_0x2db4('0x39')][_0x2db4('0x3b')]?_0x38f5fa['attributes']:_0x598243['model'];_0x38f5fa['order']=qs['sort'](_0x4bf3c6[_0x2db4('0x35')][_0x2db4('0x3f')]);_0x38f5fa['where']=qs[_0x2db4('0x37')](_[_0x2db4('0x53')](_0x4bf3c6[_0x2db4('0x35')],_0x598243[_0x2db4('0x37')]));if(_0x4bf3c6['query']['filter']){_0x38f5fa['where']=_['merge'](_0x38f5fa[_0x2db4('0x40')],{'$or':_[_0x2db4('0x2f')](_0x38f5fa[_0x2db4('0x39')],function(_0x1d1e5e){var _0x15f4b6={};_0x15f4b6[_0x1d1e5e]={'$like':'%'+_0x4bf3c6[_0x2db4('0x35')]['filter']+'%'};return _0x15f4b6;})});}_0x38f5fa=_['merge']({},_0x38f5fa,_0x4bf3c6[_0x2db4('0x43')]);return _0x1308a9['getSubjects'](_0x38f5fa);}})[_0x2db4('0x2a')](function(_0x2766d8){if(_0x2766d8){_0x2efd34=_0x2766d8['length'];if(!_0x4bf3c6[_0x2db4('0x35')][_0x2db4('0x3c')](_0x2db4('0x3d'))){_0x38f5fa[_0x2db4('0x21')]=qs[_0x2db4('0x21')](_0x4bf3c6[_0x2db4('0x35')]['limit']);_0x38f5fa['offset']=qs[_0x2db4('0x23')](_0x4bf3c6['query']['offset']);}return _0x1308a9['getSubjects'](_0x38f5fa);}})['then'](function(_0x5bc7e7){if(_0x5bc7e7){return _0x5bc7e7?{'count':_0x2efd34,'rows':_0x5bc7e7}:null;}})[_0x2db4('0x2a')](respondWithResult(_0x2e931d,null))[_0x2db4('0x48')](handleError(_0x2e931d,null));};exports[_0x2db4('0x54')]=function(_0x3d2d92,_0x166c4f,_0x59664e){var _0x35f8c8={};var _0x27a1b4={};var _0x41817a;var _0x434667;return db[_0x2db4('0x44')][_0x2db4('0x4e')]({'where':{'id':_0x3d2d92[_0x2db4('0x4f')]['id']}})[_0x2db4('0x2a')](handleEntityNotFound(_0x166c4f,null))[_0x2db4('0x2a')](function(_0x2f8cd0){if(_0x2f8cd0){_0x41817a=_0x2f8cd0;_0x27a1b4[_0x2db4('0x34')]=_[_0x2db4('0x36')](db[_0x2db4('0x50')][_0x2db4('0x30')]);_0x27a1b4[_0x2db4('0x35')]=_[_0x2db4('0x36')](_0x3d2d92[_0x2db4('0x35')]);_0x27a1b4[_0x2db4('0x37')]=_[_0x2db4('0x38')](_0x27a1b4[_0x2db4('0x34')],_0x27a1b4[_0x2db4('0x35')]);_0x35f8c8[_0x2db4('0x39')]=_[_0x2db4('0x38')](_0x27a1b4[_0x2db4('0x34')],qs[_0x2db4('0x3a')](_0x3d2d92[_0x2db4('0x35')]['fields']));_0x35f8c8['attributes']=_0x35f8c8['attributes'][_0x2db4('0x3b')]?_0x35f8c8[_0x2db4('0x39')]:_0x27a1b4[_0x2db4('0x34')];_0x35f8c8[_0x2db4('0x3e')]=qs[_0x2db4('0x3f')](_0x3d2d92[_0x2db4('0x35')][_0x2db4('0x3f')]);_0x35f8c8['where']=qs[_0x2db4('0x37')](_['pick'](_0x3d2d92['query'],_0x27a1b4[_0x2db4('0x37')]));if(_0x3d2d92[_0x2db4('0x35')]['filter']){_0x35f8c8['where']=_[_0x2db4('0x41')](_0x35f8c8[_0x2db4('0x40')],{'$or':_[_0x2db4('0x2f')](_0x35f8c8[_0x2db4('0x39')],function(_0x12da9e){var _0x298cb0={};_0x298cb0[_0x12da9e]={'$like':'%'+_0x3d2d92['query'][_0x2db4('0x51')]+'%'};return _0x298cb0;})});}_0x35f8c8=_[_0x2db4('0x41')]({},_0x35f8c8,_0x3d2d92[_0x2db4('0x43')]);return _0x41817a[_0x2db4('0x54')](_0x35f8c8);}})[_0x2db4('0x2a')](function(_0x1c08a5){if(_0x1c08a5){_0x434667=_0x1c08a5[_0x2db4('0x3b')];if(!_0x3d2d92[_0x2db4('0x35')][_0x2db4('0x3c')](_0x2db4('0x3d'))){_0x35f8c8[_0x2db4('0x21')]=qs[_0x2db4('0x21')](_0x3d2d92[_0x2db4('0x35')]['limit']);_0x35f8c8['offset']=qs[_0x2db4('0x23')](_0x3d2d92['query'][_0x2db4('0x23')]);}return _0x41817a[_0x2db4('0x54')](_0x35f8c8);}})[_0x2db4('0x2a')](function(_0x59986b){if(_0x59986b){return _0x59986b?{'count':_0x434667,'rows':_0x59986b}:null;}})[_0x2db4('0x2a')](respondWithResult(_0x166c4f,null))[_0x2db4('0x48')](handleError(_0x166c4f,null));}; \ No newline at end of file +var _0xefe1=['VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xefe1,0x1f1));var _0x1efe=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xefe1[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x1efe('0x0'));var rimraf=require(_0x1efe('0x1'));var zipdir=require(_0x1efe('0x2'));var jsonpatch=require(_0x1efe('0x3'));var rp=require(_0x1efe('0x4'));var moment=require(_0x1efe('0x5'));var BPromise=require(_0x1efe('0x6'));var Mustache=require(_0x1efe('0x7'));var util=require(_0x1efe('0x8'));var path=require('path');var sox=require(_0x1efe('0x9'));var csv=require('to-csv');var ejs=require(_0x1efe('0xa'));var fs=require('fs');var fs_extra=require(_0x1efe('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1efe('0xc'));var jsforce=require(_0x1efe('0xd'));var deskjs=require(_0x1efe('0xe'));var toCsv=require(_0x1efe('0xf'));var querystring=require(_0x1efe('0x10'));var Papa=require('papaparse');var Redis=require(_0x1efe('0x11'));var authService=require(_0x1efe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1efe('0x13'));var hardwareService=require(_0x1efe('0x14'));var logger=require(_0x1efe('0x15'))(_0x1efe('0x16'));var utils=require('../../config/utils');var config=require(_0x1efe('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1efe('0x18'))['db'];function respondWithStatusCode(_0x49cb44,_0xa29688){_0xa29688=_0xa29688||0xcc;return function(_0x27a94f){if(_0x27a94f){return _0x49cb44['sendStatus'](_0xa29688);}return _0x49cb44[_0x1efe('0x19')](_0xa29688)[_0x1efe('0x1a')]();};}function respondWithResult(_0x1c47d9,_0x5361e2){_0x5361e2=_0x5361e2||0xc8;return function(_0x3ce134){if(_0x3ce134){return _0x1c47d9[_0x1efe('0x19')](_0x5361e2)[_0x1efe('0x1b')](_0x3ce134);}};}function respondWithFilteredResult(_0x414ae9,_0x3650dd){return function(_0xc15332){if(_0xc15332){var _0x48bc57=typeof _0x3650dd[_0x1efe('0x1c')]===_0x1efe('0x1d')&&typeof _0x3650dd[_0x1efe('0x1e')]===_0x1efe('0x1d');var _0xaefb95=_0xc15332[_0x1efe('0x1f')];var _0xb7b847=_0x48bc57?0x0:_0x3650dd[_0x1efe('0x1c')];var _0x5519da=_0x48bc57?_0xc15332[_0x1efe('0x1f')]:_0x3650dd[_0x1efe('0x1c')]+_0x3650dd[_0x1efe('0x1e')];var _0x775063;if(_0x5519da>=_0xaefb95){_0x5519da=_0xaefb95;_0x775063=0xc8;}else{_0x775063=0xce;}_0x414ae9['status'](_0x775063);return _0x414ae9['set'](_0x1efe('0x20'),_0xb7b847+'-'+_0x5519da+'/'+_0xaefb95)['json'](_0xc15332);}return null;};}function patchUpdates(_0x3132f9){return function(_0x31fd70){try{jsonpatch[_0x1efe('0x21')](_0x31fd70,_0x3132f9,!![]);}catch(_0x3b3465){return BPromise[_0x1efe('0x22')](_0x3b3465);}return _0x31fd70[_0x1efe('0x23')]();};}function saveUpdates(_0x2ad27d,_0x1f316f){return function(_0x5d9708){if(_0x5d9708){return _0x5d9708[_0x1efe('0x24')](_0x2ad27d)[_0x1efe('0x25')](function(_0x385711){return _0x385711;});}return null;};}function removeEntity(_0x470794,_0x47de31){return function(_0x22e69d){if(_0x22e69d){return _0x22e69d[_0x1efe('0x26')]()[_0x1efe('0x25')](function(){_0x470794['status'](0xcc)[_0x1efe('0x1a')]();});}};}function handleEntityNotFound(_0x2cefc0,_0x2a4f80){return function(_0x108db3){if(!_0x108db3){_0x2cefc0['sendStatus'](0x194);}return _0x108db3;};}function handleError(_0x3b6e91,_0x269f1b){_0x269f1b=_0x269f1b||0x1f4;return function(_0x10986f){logger['error'](_0x10986f[_0x1efe('0x27')]);if(_0x10986f[_0x1efe('0x28')]){delete _0x10986f[_0x1efe('0x28')];}_0x3b6e91[_0x1efe('0x19')](_0x269f1b)[_0x1efe('0x29')](_0x10986f);};}exports['index']=function(_0xa46f96,_0x2a2189){var _0x1a479d={},_0x5db7b5={},_0x35f055={'count':0x0,'rows':[]};var _0x15ad4c=_[_0x1efe('0x2a')](db[_0x1efe('0x2b')][_0x1efe('0x2c')],function(_0x55eca1){return{'name':_0x55eca1[_0x1efe('0x2d')],'type':_0x55eca1[_0x1efe('0x2e')][_0x1efe('0x2f')]};});_0x5db7b5[_0x1efe('0x30')]=_['map'](_0x15ad4c,_0x1efe('0x28'));_0x5db7b5[_0x1efe('0x31')]=_[_0x1efe('0x32')](_0xa46f96[_0x1efe('0x31')]);_0x5db7b5[_0x1efe('0x33')]=_['intersection'](_0x5db7b5[_0x1efe('0x30')],_0x5db7b5[_0x1efe('0x31')]);_0x1a479d['attributes']=_[_0x1efe('0x34')](_0x5db7b5[_0x1efe('0x30')],qs[_0x1efe('0x35')](_0xa46f96[_0x1efe('0x31')][_0x1efe('0x35')]));_0x1a479d['attributes']=_0x1a479d[_0x1efe('0x36')][_0x1efe('0x37')]?_0x1a479d[_0x1efe('0x36')]:_0x5db7b5['model'];if(!_0xa46f96[_0x1efe('0x31')]['hasOwnProperty'](_0x1efe('0x38'))){_0x1a479d[_0x1efe('0x1e')]=qs['limit'](_0xa46f96['query'][_0x1efe('0x1e')]);_0x1a479d[_0x1efe('0x1c')]=qs[_0x1efe('0x1c')](_0xa46f96['query'][_0x1efe('0x1c')]);}_0x1a479d[_0x1efe('0x39')]=qs[_0x1efe('0x3a')](_0xa46f96[_0x1efe('0x31')][_0x1efe('0x3a')]);_0x1a479d[_0x1efe('0x3b')]=qs['filters'](_[_0x1efe('0x3c')](_0xa46f96['query'],_0x5db7b5['filters']),_0x15ad4c);if(_0xa46f96[_0x1efe('0x31')][_0x1efe('0x3d')]){_0x1a479d['where']=_[_0x1efe('0x3e')](_0x1a479d[_0x1efe('0x3b')],{'$or':_[_0x1efe('0x2a')](_0x15ad4c,function(_0x56652f){if(_0x56652f[_0x1efe('0x2e')]!==_0x1efe('0x3f')){var _0x2dc7fa={};_0x2dc7fa[_0x56652f[_0x1efe('0x28')]]={'$like':'%'+_0xa46f96[_0x1efe('0x31')][_0x1efe('0x3d')]+'%'};return _0x2dc7fa;}})});}_0x1a479d=_[_0x1efe('0x3e')]({},_0x1a479d,_0xa46f96[_0x1efe('0x40')]);var _0x30731f={'where':_0x1a479d[_0x1efe('0x3b')]};return db['Dynamics365Configuration'][_0x1efe('0x1f')](_0x30731f)[_0x1efe('0x25')](function(_0x32978e){_0x35f055[_0x1efe('0x1f')]=_0x32978e;if(_0xa46f96[_0x1efe('0x31')][_0x1efe('0x41')]){_0x1a479d[_0x1efe('0x42')]=[{'all':!![]}];}return db[_0x1efe('0x2b')]['findAll'](_0x1a479d);})['then'](function(_0x3164bd){_0x35f055[_0x1efe('0x43')]=_0x3164bd;return _0x35f055;})[_0x1efe('0x25')](respondWithFilteredResult(_0x2a2189,_0x1a479d))[_0x1efe('0x44')](handleError(_0x2a2189,null));};exports[_0x1efe('0x45')]=function(_0x317c16,_0x29017f){var _0x447ef9={'raw':![],'where':{'id':_0x317c16[_0x1efe('0x46')]['id']}},_0x808e55={};_0x808e55[_0x1efe('0x30')]=_[_0x1efe('0x32')](db[_0x1efe('0x2b')][_0x1efe('0x2c')]);_0x808e55['query']=_[_0x1efe('0x32')](_0x317c16['query']);_0x808e55[_0x1efe('0x33')]=_[_0x1efe('0x34')](_0x808e55['model'],_0x808e55['query']);_0x447ef9[_0x1efe('0x36')]=_['intersection'](_0x808e55[_0x1efe('0x30')],qs[_0x1efe('0x35')](_0x317c16[_0x1efe('0x31')][_0x1efe('0x35')]));_0x447ef9[_0x1efe('0x36')]=_0x447ef9[_0x1efe('0x36')][_0x1efe('0x37')]?_0x447ef9['attributes']:_0x808e55[_0x1efe('0x30')];if(_0x317c16[_0x1efe('0x31')][_0x1efe('0x41')]){_0x447ef9[_0x1efe('0x42')]=[{'all':!![]}];}_0x447ef9=_['merge']({},_0x447ef9,_0x317c16[_0x1efe('0x40')]);return db[_0x1efe('0x2b')][_0x1efe('0x47')](_0x447ef9)[_0x1efe('0x25')](handleEntityNotFound(_0x29017f,null))['then'](respondWithResult(_0x29017f,null))[_0x1efe('0x44')](handleError(_0x29017f,null));};exports['create']=function(_0x488ae2,_0x4ff160){return db[_0x1efe('0x2b')][_0x1efe('0x48')](_0x488ae2['body'],{})[_0x1efe('0x25')](respondWithResult(_0x4ff160,0xc9))[_0x1efe('0x44')](handleError(_0x4ff160,null));};exports['update']=function(_0x38f3cc,_0x68653b){if(_0x38f3cc['body']['id']){delete _0x38f3cc[_0x1efe('0x49')]['id'];}return db['Dynamics365Configuration'][_0x1efe('0x47')]({'where':{'id':_0x38f3cc[_0x1efe('0x46')]['id']}})[_0x1efe('0x25')](handleEntityNotFound(_0x68653b,null))[_0x1efe('0x25')](saveUpdates(_0x38f3cc[_0x1efe('0x49')],null))[_0x1efe('0x25')](respondWithResult(_0x68653b,null))[_0x1efe('0x44')](handleError(_0x68653b,null));};exports[_0x1efe('0x26')]=function(_0x58a8f8,_0x5b9951){return db[_0x1efe('0x2b')]['find']({'where':{'id':_0x58a8f8[_0x1efe('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b9951,null))['then'](removeEntity(_0x5b9951,null))[_0x1efe('0x44')](handleError(_0x5b9951,null));};exports[_0x1efe('0x4a')]=function(_0x52d6ab,_0x460927,_0x618983){var _0xa4aea4={};var _0x3da24d={};var _0x37e362;var _0x4278b8;return db[_0x1efe('0x2b')][_0x1efe('0x4b')]({'where':{'id':_0x52d6ab[_0x1efe('0x46')]['id']}})['then'](handleEntityNotFound(_0x460927,null))[_0x1efe('0x25')](function(_0x528308){if(_0x528308){_0x37e362=_0x528308;_0x3da24d['model']=_[_0x1efe('0x32')](db[_0x1efe('0x4c')][_0x1efe('0x2c')]);_0x3da24d[_0x1efe('0x31')]=_[_0x1efe('0x32')](_0x52d6ab[_0x1efe('0x31')]);_0x3da24d[_0x1efe('0x33')]=_[_0x1efe('0x34')](_0x3da24d[_0x1efe('0x30')],_0x3da24d['query']);_0xa4aea4[_0x1efe('0x36')]=_[_0x1efe('0x34')](_0x3da24d['model'],qs['fields'](_0x52d6ab['query'][_0x1efe('0x35')]));_0xa4aea4[_0x1efe('0x36')]=_0xa4aea4[_0x1efe('0x36')]['length']?_0xa4aea4[_0x1efe('0x36')]:_0x3da24d[_0x1efe('0x30')];_0xa4aea4[_0x1efe('0x39')]=qs[_0x1efe('0x3a')](_0x52d6ab[_0x1efe('0x31')][_0x1efe('0x3a')]);_0xa4aea4[_0x1efe('0x3b')]=qs[_0x1efe('0x33')](_[_0x1efe('0x3c')](_0x52d6ab[_0x1efe('0x31')],_0x3da24d['filters']));if(_0x52d6ab['query'][_0x1efe('0x3d')]){_0xa4aea4[_0x1efe('0x3b')]=_[_0x1efe('0x3e')](_0xa4aea4[_0x1efe('0x3b')],{'$or':_['map'](_0xa4aea4[_0x1efe('0x36')],function(_0x2776cb){var _0x2be1d5={};_0x2be1d5[_0x2776cb]={'$like':'%'+_0x52d6ab['query']['filter']+'%'};return _0x2be1d5;})});}_0xa4aea4=_['merge']({},_0xa4aea4,_0x52d6ab['options']);return _0x37e362[_0x1efe('0x4a')](_0xa4aea4);}})[_0x1efe('0x25')](function(_0x241266){if(_0x241266){_0x4278b8=_0x241266[_0x1efe('0x37')];if(!_0x52d6ab['query'][_0x1efe('0x4d')]('nolimit')){_0xa4aea4[_0x1efe('0x1e')]=qs['limit'](_0x52d6ab[_0x1efe('0x31')]['limit']);_0xa4aea4['offset']=qs[_0x1efe('0x1c')](_0x52d6ab['query'][_0x1efe('0x1c')]);}return _0x37e362[_0x1efe('0x4a')](_0xa4aea4);}})['then'](function(_0x17958d){if(_0x17958d){return _0x17958d?{'count':_0x4278b8,'rows':_0x17958d}:null;}})[_0x1efe('0x25')](respondWithResult(_0x460927,null))[_0x1efe('0x44')](handleError(_0x460927,null));};exports[_0x1efe('0x4e')]=function(_0x5453fc,_0x1ea69e,_0x329707){var _0x5a5bb3={};var _0x3d48d8={};var _0x4278c6;var _0x383348;return db[_0x1efe('0x2b')][_0x1efe('0x4b')]({'where':{'id':_0x5453fc['params']['id']}})[_0x1efe('0x25')](handleEntityNotFound(_0x1ea69e,null))[_0x1efe('0x25')](function(_0x20c27f){if(_0x20c27f){_0x4278c6=_0x20c27f;_0x3d48d8[_0x1efe('0x30')]=_[_0x1efe('0x32')](db['Dynamics365Field'][_0x1efe('0x2c')]);_0x3d48d8['query']=_[_0x1efe('0x32')](_0x5453fc[_0x1efe('0x31')]);_0x3d48d8['filters']=_[_0x1efe('0x34')](_0x3d48d8[_0x1efe('0x30')],_0x3d48d8[_0x1efe('0x31')]);_0x5a5bb3[_0x1efe('0x36')]=_[_0x1efe('0x34')](_0x3d48d8[_0x1efe('0x30')],qs[_0x1efe('0x35')](_0x5453fc[_0x1efe('0x31')]['fields']));_0x5a5bb3[_0x1efe('0x36')]=_0x5a5bb3['attributes'][_0x1efe('0x37')]?_0x5a5bb3['attributes']:_0x3d48d8[_0x1efe('0x30')];_0x5a5bb3[_0x1efe('0x39')]=qs['sort'](_0x5453fc[_0x1efe('0x31')][_0x1efe('0x3a')]);_0x5a5bb3['where']=qs['filters'](_[_0x1efe('0x3c')](_0x5453fc[_0x1efe('0x31')],_0x3d48d8[_0x1efe('0x33')]));if(_0x5453fc['query'][_0x1efe('0x3d')]){_0x5a5bb3[_0x1efe('0x3b')]=_[_0x1efe('0x3e')](_0x5a5bb3[_0x1efe('0x3b')],{'$or':_[_0x1efe('0x2a')](_0x5a5bb3[_0x1efe('0x36')],function(_0x43693d){var _0x5a8e20={};_0x5a8e20[_0x43693d]={'$like':'%'+_0x5453fc[_0x1efe('0x31')][_0x1efe('0x3d')]+'%'};return _0x5a8e20;})});}_0x5a5bb3=_[_0x1efe('0x3e')]({},_0x5a5bb3,_0x5453fc['options']);return _0x4278c6[_0x1efe('0x4e')](_0x5a5bb3);}})['then'](function(_0x178358){if(_0x178358){_0x383348=_0x178358[_0x1efe('0x37')];if(!_0x5453fc['query'][_0x1efe('0x4d')](_0x1efe('0x38'))){_0x5a5bb3[_0x1efe('0x1e')]=qs[_0x1efe('0x1e')](_0x5453fc['query'][_0x1efe('0x1e')]);_0x5a5bb3[_0x1efe('0x1c')]=qs['offset'](_0x5453fc[_0x1efe('0x31')][_0x1efe('0x1c')]);}return _0x4278c6[_0x1efe('0x4e')](_0x5a5bb3);}})[_0x1efe('0x25')](function(_0x649997){if(_0x649997){return _0x649997?{'count':_0x383348,'rows':_0x649997}:null;}})['then'](respondWithResult(_0x1ea69e,null))['catch'](handleError(_0x1ea69e,null));};exports[_0x1efe('0x4f')]=function(_0x143c71,_0x4314cb,_0x2a9fd9){var _0x17efa4={};var _0x5bd4ec={};var _0x3cea29;var _0x364b59;return db[_0x1efe('0x2b')][_0x1efe('0x4b')]({'where':{'id':_0x143c71['params']['id']}})[_0x1efe('0x25')](handleEntityNotFound(_0x4314cb,null))[_0x1efe('0x25')](function(_0x4afaa6){if(_0x4afaa6){_0x3cea29=_0x4afaa6;_0x5bd4ec['model']=_[_0x1efe('0x32')](db['Dynamics365Field']['rawAttributes']);_0x5bd4ec[_0x1efe('0x31')]=_['keys'](_0x143c71[_0x1efe('0x31')]);_0x5bd4ec[_0x1efe('0x33')]=_[_0x1efe('0x34')](_0x5bd4ec[_0x1efe('0x30')],_0x5bd4ec[_0x1efe('0x31')]);_0x17efa4[_0x1efe('0x36')]=_[_0x1efe('0x34')](_0x5bd4ec[_0x1efe('0x30')],qs['fields'](_0x143c71[_0x1efe('0x31')][_0x1efe('0x35')]));_0x17efa4[_0x1efe('0x36')]=_0x17efa4['attributes'][_0x1efe('0x37')]?_0x17efa4[_0x1efe('0x36')]:_0x5bd4ec[_0x1efe('0x30')];_0x17efa4[_0x1efe('0x39')]=qs[_0x1efe('0x3a')](_0x143c71[_0x1efe('0x31')][_0x1efe('0x3a')]);_0x17efa4[_0x1efe('0x3b')]=qs[_0x1efe('0x33')](_[_0x1efe('0x3c')](_0x143c71[_0x1efe('0x31')],_0x5bd4ec[_0x1efe('0x33')]));if(_0x143c71[_0x1efe('0x31')][_0x1efe('0x3d')]){_0x17efa4[_0x1efe('0x3b')]=_[_0x1efe('0x3e')](_0x17efa4[_0x1efe('0x3b')],{'$or':_[_0x1efe('0x2a')](_0x17efa4['attributes'],function(_0x50734d){var _0x41a75f={};_0x41a75f[_0x50734d]={'$like':'%'+_0x143c71[_0x1efe('0x31')][_0x1efe('0x3d')]+'%'};return _0x41a75f;})});}_0x17efa4=_[_0x1efe('0x3e')]({},_0x17efa4,_0x143c71[_0x1efe('0x40')]);return _0x3cea29[_0x1efe('0x4f')](_0x17efa4);}})['then'](function(_0x21917b){if(_0x21917b){_0x364b59=_0x21917b[_0x1efe('0x37')];if(!_0x143c71['query']['hasOwnProperty']('nolimit')){_0x17efa4[_0x1efe('0x1e')]=qs[_0x1efe('0x1e')](_0x143c71['query']['limit']);_0x17efa4[_0x1efe('0x1c')]=qs[_0x1efe('0x1c')](_0x143c71[_0x1efe('0x31')][_0x1efe('0x1c')]);}return _0x3cea29[_0x1efe('0x4f')](_0x17efa4);}})['then'](function(_0x3edf93){if(_0x3edf93){return _0x3edf93?{'count':_0x364b59,'rows':_0x3edf93}:null;}})[_0x1efe('0x25')](respondWithResult(_0x4314cb,null))[_0x1efe('0x44')](handleError(_0x4314cb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d3f36ca..721f3de 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x1056d3,_0x8190a3){var _0x59188c=function(_0x33506f){while(--_0x33506f){_0x1056d3['push'](_0x1056d3['shift']());}};_0x59188c(++_0x8190a3);}(_0x9f62,0x154));var _0x29f6=function(_0x2e9910,_0x21b45b){_0x2e9910=_0x2e9910-0x0;var _0x321796=_0x9f62[_0x2e9910];return _0x321796;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'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(_0x1075a2,_0xb2f371){var _0x43f5f9=function(_0x2f7760){while(--_0x2f7760){_0x1075a2['push'](_0x1075a2['shift']());}};_0x43f5f9(++_0xb2f371);}(_0x008c,0x188));var _0xc008=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x008c[_0x25df80];return _0x17b6d0;};'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 c6d3922..4203464 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 _0x7387=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7387,0xa7));var _0x7738=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7387[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x7738('0x0'));var util=require(_0x7738('0x1'));var moment=require('moment');var BPromise=require(_0x7738('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7738('0x3'))['db'];var utils=require(_0x7738('0x4'));var logger=require(_0x7738('0x5'))(_0x7738('0x6'));var config=require(_0x7738('0x7'));var jayson=require(_0x7738('0x8'));var client=jayson[_0x7738('0x9')][_0x7738('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa0b8f4,_0x21bc1c,_0x3a1b53){return new BPromise(function(_0x2f44e4,_0x20529d){return client[_0x7738('0xb')](_0xa0b8f4,_0x3a1b53)[_0x7738('0xc')](function(_0x38af89){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x21bc1c,_0x7738('0xd'));logger['debug'](_0x7738('0xe'),_0x21bc1c,_0x7738('0xd'),JSON['stringify'](_0x38af89));if(_0x38af89[_0x7738('0xf')]){if(_0x38af89['error'][_0x7738('0x10')]===0x1f4){logger[_0x7738('0xf')](_0x7738('0x11'),_0x21bc1c,_0x38af89[_0x7738('0xf')][_0x7738('0x12')]);return _0x20529d(_0x38af89['error'][_0x7738('0x12')]);}logger[_0x7738('0xf')](_0x7738('0x11'),_0x21bc1c,_0x38af89[_0x7738('0xf')][_0x7738('0x12')]);return _0x2f44e4(_0x38af89[_0x7738('0xf')][_0x7738('0x12')]);}else{logger[_0x7738('0x13')](_0x7738('0x11'),_0x21bc1c,_0x7738('0xd'));_0x2f44e4(_0x38af89[_0x7738('0x14')][_0x7738('0x12')]);}})['catch'](function(_0x517eda){logger[_0x7738('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x21bc1c,_0x517eda);_0x20529d(_0x517eda);});});} \ No newline at end of file +var _0xfac1=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','util','moment'];(function(_0x5602b6,_0x1aef68){var _0x546966=function(_0x42af79){while(--_0x42af79){_0x5602b6['push'](_0x5602b6['shift']());}};_0x546966(++_0x1aef68);}(_0xfac1,0xe2));var _0x1fac=function(_0x504691,_0x2d34f4){_0x504691=_0x504691-0x0;var _0x24364c=_0xfac1[_0x504691];return _0x24364c;};'use strict';var _=require('lodash');var util=require(_0x1fac('0x0'));var moment=require(_0x1fac('0x1'));var BPromise=require(_0x1fac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fac('0x4'));var logger=require('../../config/logger')(_0x1fac('0x5'));var config=require(_0x1fac('0x6'));var jayson=require(_0x1fac('0x7'));var client=jayson[_0x1fac('0x8')][_0x1fac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x525d27,_0x14674f,_0x2c5857){return new BPromise(function(_0xeee8e3,_0x3b9b45){return client[_0x1fac('0xa')](_0x525d27,_0x2c5857)[_0x1fac('0xb')](function(_0x592003){logger[_0x1fac('0xc')](_0x1fac('0xd'),_0x14674f,_0x1fac('0xe'));logger['debug'](_0x1fac('0xf'),_0x14674f,_0x1fac('0xe'),JSON['stringify'](_0x592003));if(_0x592003['error']){if(_0x592003[_0x1fac('0x10')]['code']===0x1f4){logger[_0x1fac('0x10')](_0x1fac('0xd'),_0x14674f,_0x592003[_0x1fac('0x10')][_0x1fac('0x11')]);return _0x3b9b45(_0x592003[_0x1fac('0x10')][_0x1fac('0x11')]);}logger[_0x1fac('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x14674f,_0x592003[_0x1fac('0x10')][_0x1fac('0x11')]);return _0xeee8e3(_0x592003['error']['message']);}else{logger[_0x1fac('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x14674f,'request\x20sent');_0xeee8e3(_0x592003[_0x1fac('0x12')]['message']);}})['catch'](function(_0x4a59fd){logger[_0x1fac('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x14674f,_0x4a59fd);_0x3b9b45(_0x4a59fd);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b21a5ca..faec3b9 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 _0xa399=['update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x4e7490,_0x4b26ae){var _0x3622d0=function(_0x40a2bb){while(--_0x40a2bb){_0x4e7490['push'](_0x4e7490['shift']());}};_0x3622d0(++_0x4b26ae);}(_0xa399,0xe1));var _0x9a39=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xa399[_0x5834bc];return _0x3e183a;};'use strict';var multer=require(_0x9a39('0x0'));var util=require(_0x9a39('0x1'));var path=require('path');var timeout=require(_0x9a39('0x2'));var express=require(_0x9a39('0x3'));var router=express[_0x9a39('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a39('0x6'));var controller=require(_0x9a39('0x7'));router[_0x9a39('0x8')]('/',auth[_0x9a39('0x9')](),controller[_0x9a39('0xa')]);router[_0x9a39('0x8')]('/:id',auth[_0x9a39('0x9')](),controller[_0x9a39('0xb')]);router[_0x9a39('0xc')]('/',auth[_0x9a39('0x9')](),controller[_0x9a39('0xd')]);router[_0x9a39('0xe')]('/:id',auth[_0x9a39('0x9')](),controller[_0x9a39('0xf')]);router[_0x9a39('0x10')](_0x9a39('0x11'),auth[_0x9a39('0x9')](),controller[_0x9a39('0x12')]);module[_0x9a39('0x13')]=router; \ No newline at end of file +var _0xc1f2=['destroy','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1f2,0x1cd));var _0x2c1f=function(_0x10b94b,_0x39d2e1){_0x10b94b=_0x10b94b-0x0;var _0x57ebed=_0xc1f2[_0x10b94b];return _0x57ebed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c1f('0x0'));var timeout=require('connect-timeout');var express=require(_0x2c1f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2c1f('0x2'));var interaction=require(_0x2c1f('0x3'));var config=require(_0x2c1f('0x4'));var controller=require(_0x2c1f('0x5'));router['get']('/',auth[_0x2c1f('0x6')](),controller[_0x2c1f('0x7')]);router[_0x2c1f('0x8')](_0x2c1f('0x9'),auth[_0x2c1f('0x6')](),controller['show']);router[_0x2c1f('0xa')]('/',auth[_0x2c1f('0x6')](),controller[_0x2c1f('0xb')]);router[_0x2c1f('0xc')](_0x2c1f('0x9'),auth[_0x2c1f('0x6')](),controller[_0x2c1f('0xd')]);router[_0x2c1f('0xe')](_0x2c1f('0x9'),auth[_0x2c1f('0x6')](),controller[_0x2c1f('0xf')]);module[_0x2c1f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 59eca14..f0403c7 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 _0x634a=['STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x634a,0x1e3));var _0xa634=function(_0x463417,_0x1e29af){_0x463417=_0x463417-0x0;var _0x4a5241=_0x634a[_0x463417];return _0x4a5241;};'use strict';var Sequelize=require(_0xa634('0x0'));module[_0xa634('0x1')]={'type':{'type':Sequelize[_0xa634('0x2')]('string',_0xa634('0x3'),'customVariable',_0xa634('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa634('0x5')]},'keyType':{'type':Sequelize[_0xa634('0x2')](_0xa634('0x6'),_0xa634('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa634('0x5')]},'nameField':{'type':Sequelize[_0xa634('0x5')]},'customField':{'type':Sequelize[_0xa634('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa634('0x5')]}}; \ No newline at end of file +var _0xf920=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0xd2d207,_0x20f439){var _0x382db4=function(_0x44a615){while(--_0x44a615){_0xd2d207['push'](_0xd2d207['shift']());}};_0x382db4(++_0x20f439);}(_0xf920,0x77));var _0x0f92=function(_0x544700,_0x37f134){_0x544700=_0x544700-0x0;var _0x39260b=_0xf920[_0x544700];return _0x39260b;};'use strict';var Sequelize=require(_0x0f92('0x0'));module[_0x0f92('0x1')]={'type':{'type':Sequelize[_0x0f92('0x2')](_0x0f92('0x3'),_0x0f92('0x4'),'customVariable',_0x0f92('0x5'),_0x0f92('0x6')),'defaultValue':_0x0f92('0x3')},'content':{'type':Sequelize[_0x0f92('0x7')]},'key':{'type':Sequelize[_0x0f92('0x7')]},'keyType':{'type':Sequelize[_0x0f92('0x2')](_0x0f92('0x3'),_0x0f92('0x4'),_0x0f92('0x8'))},'keyContent':{'type':Sequelize[_0x0f92('0x7')]},'idField':{'type':Sequelize[_0x0f92('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f92('0x9')],'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 287ceeb..08ab3ea 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 _0xcb68=['query','fields','attributes','nolimit','order','sort','where','pick','filters','filter','merge','options','Dynamics365Field','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','intersection','model'];(function(_0x459d95,_0x5cd3e2){var _0x49659a=function(_0x14b0d3){while(--_0x14b0d3){_0x459d95['push'](_0x459d95['shift']());}};_0x49659a(++_0x5cd3e2);}(_0xcb68,0x19a));var _0x8cb6=function(_0x576c23,_0x126114){_0x576c23=_0x576c23-0x0;var _0x3d7a0d=_0xcb68[_0x576c23];return _0x3d7a0d;};'use strict';var emlformat=require(_0x8cb6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cb6('0x1'));var jsonpatch=require(_0x8cb6('0x2'));var rp=require(_0x8cb6('0x3'));var moment=require(_0x8cb6('0x4'));var BPromise=require(_0x8cb6('0x5'));var Mustache=require(_0x8cb6('0x6'));var util=require('util');var path=require(_0x8cb6('0x7'));var sox=require(_0x8cb6('0x8'));var csv=require(_0x8cb6('0x9'));var ejs=require(_0x8cb6('0xa'));var fs=require('fs');var fs_extra=require(_0x8cb6('0xb'));var _=require(_0x8cb6('0xc'));var squel=require(_0x8cb6('0xd'));var crypto=require(_0x8cb6('0xe'));var jsforce=require(_0x8cb6('0xf'));var deskjs=require(_0x8cb6('0x10'));var toCsv=require(_0x8cb6('0x9'));var querystring=require(_0x8cb6('0x11'));var Papa=require(_0x8cb6('0x12'));var Redis=require(_0x8cb6('0x13'));var authService=require(_0x8cb6('0x14'));var qs=require(_0x8cb6('0x15'));var as=require(_0x8cb6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8cb6('0x17'));var utils=require(_0x8cb6('0x18'));var config=require(_0x8cb6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cb6('0x1a'))['db'];function respondWithStatusCode(_0x482f1d,_0x43c413){_0x43c413=_0x43c413||0xcc;return function(_0x211751){if(_0x211751){return _0x482f1d[_0x8cb6('0x1b')](_0x43c413);}return _0x482f1d[_0x8cb6('0x1c')](_0x43c413)[_0x8cb6('0x1d')]();};}function respondWithResult(_0x34129b,_0x2e3510){_0x2e3510=_0x2e3510||0xc8;return function(_0x259591){if(_0x259591){return _0x34129b[_0x8cb6('0x1c')](_0x2e3510)['json'](_0x259591);}};}function respondWithFilteredResult(_0x6e2861,_0x5be066){return function(_0x175dcc){if(_0x175dcc){var _0x251f9d=typeof _0x5be066[_0x8cb6('0x1e')]==='undefined'&&typeof _0x5be066[_0x8cb6('0x1f')]===_0x8cb6('0x20');var _0x441622=_0x175dcc[_0x8cb6('0x21')];var _0x5409a1=_0x251f9d?0x0:_0x5be066['offset'];var _0x477235=_0x251f9d?_0x175dcc[_0x8cb6('0x21')]:_0x5be066[_0x8cb6('0x1e')]+_0x5be066[_0x8cb6('0x1f')];var _0x27dc0e;if(_0x477235>=_0x441622){_0x477235=_0x441622;_0x27dc0e=0xc8;}else{_0x27dc0e=0xce;}_0x6e2861[_0x8cb6('0x1c')](_0x27dc0e);return _0x6e2861[_0x8cb6('0x22')]('Content-Range',_0x5409a1+'-'+_0x477235+'/'+_0x441622)[_0x8cb6('0x23')](_0x175dcc);}return null;};}function patchUpdates(_0x329bd3){return function(_0x4eb939){try{jsonpatch[_0x8cb6('0x24')](_0x4eb939,_0x329bd3,!![]);}catch(_0x2157ff){return BPromise['reject'](_0x2157ff);}return _0x4eb939[_0x8cb6('0x25')]();};}function saveUpdates(_0x37f962,_0x4bdcaa){return function(_0xeae573){if(_0xeae573){return _0xeae573[_0x8cb6('0x26')](_0x37f962)[_0x8cb6('0x27')](function(_0x417438){return _0x417438;});}return null;};}function removeEntity(_0x2cdfe6,_0x1485d4){return function(_0x4f13a7){if(_0x4f13a7){return _0x4f13a7[_0x8cb6('0x28')]()['then'](function(){_0x2cdfe6[_0x8cb6('0x1c')](0xcc)[_0x8cb6('0x1d')]();});}};}function handleEntityNotFound(_0x2ba964,_0x166192){return function(_0x4166cf){if(!_0x4166cf){_0x2ba964[_0x8cb6('0x1b')](0x194);}return _0x4166cf;};}function handleError(_0x244eb1,_0x1d14de){_0x1d14de=_0x1d14de||0x1f4;return function(_0x2abe4c){logger[_0x8cb6('0x29')](_0x2abe4c[_0x8cb6('0x2a')]);if(_0x2abe4c[_0x8cb6('0x2b')]){delete _0x2abe4c[_0x8cb6('0x2b')];}_0x244eb1['status'](_0x1d14de)[_0x8cb6('0x2c')](_0x2abe4c);};}exports[_0x8cb6('0x2d')]=function(_0x1efb62,_0x968dcb){var _0xf965c5={},_0x906fde={},_0x4b6c1f={'count':0x0,'rows':[]};var _0x26cf66=_[_0x8cb6('0x2e')](db['Dynamics365Field'][_0x8cb6('0x2f')],function(_0x454daf){return{'name':_0x454daf['fieldName'],'type':_0x454daf[_0x8cb6('0x30')][_0x8cb6('0x31')]};});_0x906fde['model']=_['map'](_0x26cf66,'name');_0x906fde['query']=_['keys'](_0x1efb62['query']);_0x906fde['filters']=_[_0x8cb6('0x32')](_0x906fde[_0x8cb6('0x33')],_0x906fde[_0x8cb6('0x34')]);_0xf965c5['attributes']=_['intersection'](_0x906fde[_0x8cb6('0x33')],qs[_0x8cb6('0x35')](_0x1efb62[_0x8cb6('0x34')][_0x8cb6('0x35')]));_0xf965c5[_0x8cb6('0x36')]=_0xf965c5[_0x8cb6('0x36')]['length']?_0xf965c5[_0x8cb6('0x36')]:_0x906fde[_0x8cb6('0x33')];if(!_0x1efb62[_0x8cb6('0x34')]['hasOwnProperty'](_0x8cb6('0x37'))){_0xf965c5[_0x8cb6('0x1f')]=qs[_0x8cb6('0x1f')](_0x1efb62[_0x8cb6('0x34')]['limit']);_0xf965c5[_0x8cb6('0x1e')]=qs[_0x8cb6('0x1e')](_0x1efb62[_0x8cb6('0x34')][_0x8cb6('0x1e')]);}_0xf965c5[_0x8cb6('0x38')]=qs[_0x8cb6('0x39')](_0x1efb62[_0x8cb6('0x34')]['sort']);_0xf965c5[_0x8cb6('0x3a')]=qs['filters'](_[_0x8cb6('0x3b')](_0x1efb62[_0x8cb6('0x34')],_0x906fde[_0x8cb6('0x3c')]),_0x26cf66);if(_0x1efb62[_0x8cb6('0x34')][_0x8cb6('0x3d')]){_0xf965c5[_0x8cb6('0x3a')]=_['merge'](_0xf965c5[_0x8cb6('0x3a')],{'$or':_[_0x8cb6('0x2e')](_0x26cf66,function(_0x137024){if(_0x137024[_0x8cb6('0x30')]!=='VIRTUAL'){var _0x2d0407={};_0x2d0407[_0x137024[_0x8cb6('0x2b')]]={'$like':'%'+_0x1efb62[_0x8cb6('0x34')][_0x8cb6('0x3d')]+'%'};return _0x2d0407;}})});}_0xf965c5=_[_0x8cb6('0x3e')]({},_0xf965c5,_0x1efb62[_0x8cb6('0x3f')]);var _0x2436c4={'where':_0xf965c5[_0x8cb6('0x3a')]};return db[_0x8cb6('0x40')]['count'](_0x2436c4)[_0x8cb6('0x27')](function(_0x37aef0){_0x4b6c1f[_0x8cb6('0x21')]=_0x37aef0;if(_0x1efb62[_0x8cb6('0x34')][_0x8cb6('0x41')]){_0xf965c5[_0x8cb6('0x42')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x8cb6('0x43')](_0xf965c5);})[_0x8cb6('0x27')](function(_0x22ee44){_0x4b6c1f[_0x8cb6('0x44')]=_0x22ee44;return _0x4b6c1f;})['then'](respondWithFilteredResult(_0x968dcb,_0xf965c5))['catch'](handleError(_0x968dcb,null));};exports[_0x8cb6('0x45')]=function(_0xdf5e17,_0x57a981){var _0x44a228={'raw':!![],'where':{'id':_0xdf5e17[_0x8cb6('0x46')]['id']}},_0x356862={};_0x356862[_0x8cb6('0x33')]=_[_0x8cb6('0x47')](db[_0x8cb6('0x40')][_0x8cb6('0x2f')]);_0x356862[_0x8cb6('0x34')]=_['keys'](_0xdf5e17[_0x8cb6('0x34')]);_0x356862[_0x8cb6('0x3c')]=_[_0x8cb6('0x32')](_0x356862[_0x8cb6('0x33')],_0x356862[_0x8cb6('0x34')]);_0x44a228[_0x8cb6('0x36')]=_[_0x8cb6('0x32')](_0x356862[_0x8cb6('0x33')],qs[_0x8cb6('0x35')](_0xdf5e17[_0x8cb6('0x34')]['fields']));_0x44a228[_0x8cb6('0x36')]=_0x44a228[_0x8cb6('0x36')][_0x8cb6('0x48')]?_0x44a228[_0x8cb6('0x36')]:_0x356862[_0x8cb6('0x33')];if(_0xdf5e17['query'][_0x8cb6('0x41')]){_0x44a228[_0x8cb6('0x42')]=[{'all':!![]}];}_0x44a228=_[_0x8cb6('0x3e')]({},_0x44a228,_0xdf5e17['options']);return db[_0x8cb6('0x40')][_0x8cb6('0x49')](_0x44a228)[_0x8cb6('0x27')](handleEntityNotFound(_0x57a981,null))[_0x8cb6('0x27')](respondWithResult(_0x57a981,null))[_0x8cb6('0x4a')](handleError(_0x57a981,null));};exports[_0x8cb6('0x4b')]=function(_0x3b153a,_0xa9bd91){return db[_0x8cb6('0x40')][_0x8cb6('0x4b')](_0x3b153a[_0x8cb6('0x4c')],{})[_0x8cb6('0x27')](respondWithResult(_0xa9bd91,0xc9))[_0x8cb6('0x4a')](handleError(_0xa9bd91,null));};exports[_0x8cb6('0x26')]=function(_0x3ac5ea,_0x127f05){if(_0x3ac5ea['body']['id']){delete _0x3ac5ea[_0x8cb6('0x4c')]['id'];}return db[_0x8cb6('0x40')][_0x8cb6('0x49')]({'where':{'id':_0x3ac5ea['params']['id']}})[_0x8cb6('0x27')](handleEntityNotFound(_0x127f05,null))['then'](saveUpdates(_0x3ac5ea[_0x8cb6('0x4c')],null))[_0x8cb6('0x27')](respondWithResult(_0x127f05,null))[_0x8cb6('0x4a')](handleError(_0x127f05,null));};exports[_0x8cb6('0x28')]=function(_0x242238,_0x39c21e){return db[_0x8cb6('0x40')]['find']({'where':{'id':_0x242238['params']['id']}})[_0x8cb6('0x27')](handleEntityNotFound(_0x39c21e,null))[_0x8cb6('0x27')](removeEntity(_0x39c21e,null))[_0x8cb6('0x4a')](handleError(_0x39c21e,null));}; \ No newline at end of file +var _0x0696=['apply','reject','save','then','destroy','error','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','map','name','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x5a37e1,_0x2d0ca2){var _0x350bcf=function(_0x312b67){while(--_0x312b67){_0x5a37e1['push'](_0x5a37e1['shift']());}};_0x350bcf(++_0x2d0ca2);}(_0x0696,0x118));var _0x6069=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0696[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6069('0x0'));var zipdir=require(_0x6069('0x1'));var jsonpatch=require(_0x6069('0x2'));var rp=require(_0x6069('0x3'));var moment=require(_0x6069('0x4'));var BPromise=require(_0x6069('0x5'));var Mustache=require('mustache');var util=require(_0x6069('0x6'));var path=require('path');var sox=require(_0x6069('0x7'));var csv=require(_0x6069('0x8'));var ejs=require(_0x6069('0x9'));var fs=require('fs');var fs_extra=require(_0x6069('0xa'));var _=require(_0x6069('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6069('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6069('0xd'));var Papa=require(_0x6069('0xe'));var Redis=require(_0x6069('0xf'));var authService=require(_0x6069('0x10'));var qs=require(_0x6069('0x11'));var as=require(_0x6069('0x12'));var hardwareService=require(_0x6069('0x13'));var logger=require(_0x6069('0x14'))(_0x6069('0x15'));var utils=require(_0x6069('0x16'));var config=require(_0x6069('0x17'));var licenseUtil=require(_0x6069('0x18'));var db=require(_0x6069('0x19'))['db'];function respondWithStatusCode(_0x19a9d7,_0x112b63){_0x112b63=_0x112b63||0xcc;return function(_0x972214){if(_0x972214){return _0x19a9d7[_0x6069('0x1a')](_0x112b63);}return _0x19a9d7[_0x6069('0x1b')](_0x112b63)[_0x6069('0x1c')]();};}function respondWithResult(_0x3077ae,_0x20a168){_0x20a168=_0x20a168||0xc8;return function(_0x38ce1b){if(_0x38ce1b){return _0x3077ae[_0x6069('0x1b')](_0x20a168)[_0x6069('0x1d')](_0x38ce1b);}};}function respondWithFilteredResult(_0x1db8fd,_0x3364ef){return function(_0x1f9032){if(_0x1f9032){var _0x373477=typeof _0x3364ef['offset']===_0x6069('0x1e')&&typeof _0x3364ef[_0x6069('0x1f')]===_0x6069('0x1e');var _0x4b7067=_0x1f9032[_0x6069('0x20')];var _0x1ff555=_0x373477?0x0:_0x3364ef[_0x6069('0x21')];var _0x6b5d3d=_0x373477?_0x1f9032[_0x6069('0x20')]:_0x3364ef[_0x6069('0x21')]+_0x3364ef[_0x6069('0x1f')];var _0x4db3a1;if(_0x6b5d3d>=_0x4b7067){_0x6b5d3d=_0x4b7067;_0x4db3a1=0xc8;}else{_0x4db3a1=0xce;}_0x1db8fd[_0x6069('0x1b')](_0x4db3a1);return _0x1db8fd[_0x6069('0x22')](_0x6069('0x23'),_0x1ff555+'-'+_0x6b5d3d+'/'+_0x4b7067)[_0x6069('0x1d')](_0x1f9032);}return null;};}function patchUpdates(_0x5e5aab){return function(_0x12e55a){try{jsonpatch[_0x6069('0x24')](_0x12e55a,_0x5e5aab,!![]);}catch(_0x498251){return BPromise[_0x6069('0x25')](_0x498251);}return _0x12e55a[_0x6069('0x26')]();};}function saveUpdates(_0x26ee09,_0x28a785){return function(_0x5ef83d){if(_0x5ef83d){return _0x5ef83d['update'](_0x26ee09)[_0x6069('0x27')](function(_0x568da4){return _0x568da4;});}return null;};}function removeEntity(_0x21d186,_0x4f4f90){return function(_0x3cf786){if(_0x3cf786){return _0x3cf786[_0x6069('0x28')]()[_0x6069('0x27')](function(){_0x21d186['status'](0xcc)[_0x6069('0x1c')]();});}};}function handleEntityNotFound(_0x336387,_0x2e6919){return function(_0x9bcbb4){if(!_0x9bcbb4){_0x336387[_0x6069('0x1a')](0x194);}return _0x9bcbb4;};}function handleError(_0x462936,_0x4230da){_0x4230da=_0x4230da||0x1f4;return function(_0x3cc19a){logger[_0x6069('0x29')](_0x3cc19a['stack']);if(_0x3cc19a['name']){delete _0x3cc19a['name'];}_0x462936[_0x6069('0x1b')](_0x4230da)[_0x6069('0x2a')](_0x3cc19a);};}exports[_0x6069('0x2b')]=function(_0x94e3ee,_0x5ad425){var _0x24de49={},_0x1d9dac={},_0x4e83bf={'count':0x0,'rows':[]};var _0x16a660=_['map'](db[_0x6069('0x2c')][_0x6069('0x2d')],function(_0x50dcae){return{'name':_0x50dcae[_0x6069('0x2e')],'type':_0x50dcae[_0x6069('0x2f')][_0x6069('0x30')]};});_0x1d9dac['model']=_[_0x6069('0x31')](_0x16a660,_0x6069('0x32'));_0x1d9dac['query']=_[_0x6069('0x33')](_0x94e3ee[_0x6069('0x34')]);_0x1d9dac[_0x6069('0x35')]=_[_0x6069('0x36')](_0x1d9dac['model'],_0x1d9dac['query']);_0x24de49[_0x6069('0x37')]=_['intersection'](_0x1d9dac[_0x6069('0x38')],qs[_0x6069('0x39')](_0x94e3ee['query'][_0x6069('0x39')]));_0x24de49[_0x6069('0x37')]=_0x24de49[_0x6069('0x37')][_0x6069('0x3a')]?_0x24de49['attributes']:_0x1d9dac[_0x6069('0x38')];if(!_0x94e3ee['query']['hasOwnProperty'](_0x6069('0x3b'))){_0x24de49[_0x6069('0x1f')]=qs['limit'](_0x94e3ee[_0x6069('0x34')][_0x6069('0x1f')]);_0x24de49[_0x6069('0x21')]=qs['offset'](_0x94e3ee[_0x6069('0x34')][_0x6069('0x21')]);}_0x24de49[_0x6069('0x3c')]=qs[_0x6069('0x3d')](_0x94e3ee[_0x6069('0x34')][_0x6069('0x3d')]);_0x24de49[_0x6069('0x3e')]=qs[_0x6069('0x35')](_[_0x6069('0x3f')](_0x94e3ee[_0x6069('0x34')],_0x1d9dac['filters']),_0x16a660);if(_0x94e3ee['query'][_0x6069('0x40')]){_0x24de49[_0x6069('0x3e')]=_[_0x6069('0x41')](_0x24de49[_0x6069('0x3e')],{'$or':_[_0x6069('0x31')](_0x16a660,function(_0x3adde6){if(_0x3adde6[_0x6069('0x2f')]!==_0x6069('0x42')){var _0x12cc4d={};_0x12cc4d[_0x3adde6[_0x6069('0x32')]]={'$like':'%'+_0x94e3ee[_0x6069('0x34')][_0x6069('0x40')]+'%'};return _0x12cc4d;}})});}_0x24de49=_['merge']({},_0x24de49,_0x94e3ee[_0x6069('0x43')]);var _0x2e541b={'where':_0x24de49[_0x6069('0x3e')]};return db[_0x6069('0x2c')]['count'](_0x2e541b)[_0x6069('0x27')](function(_0x71a569){_0x4e83bf[_0x6069('0x20')]=_0x71a569;if(_0x94e3ee[_0x6069('0x34')][_0x6069('0x44')]){_0x24de49[_0x6069('0x45')]=[{'all':!![]}];}return db[_0x6069('0x2c')][_0x6069('0x46')](_0x24de49);})['then'](function(_0xa20088){_0x4e83bf[_0x6069('0x47')]=_0xa20088;return _0x4e83bf;})[_0x6069('0x27')](respondWithFilteredResult(_0x5ad425,_0x24de49))[_0x6069('0x48')](handleError(_0x5ad425,null));};exports[_0x6069('0x49')]=function(_0x30821c,_0x542d1e){var _0x2dba28={'raw':!![],'where':{'id':_0x30821c[_0x6069('0x4a')]['id']}},_0x21b47c={};_0x21b47c['model']=_[_0x6069('0x33')](db[_0x6069('0x2c')][_0x6069('0x2d')]);_0x21b47c[_0x6069('0x34')]=_[_0x6069('0x33')](_0x30821c[_0x6069('0x34')]);_0x21b47c['filters']=_[_0x6069('0x36')](_0x21b47c[_0x6069('0x38')],_0x21b47c[_0x6069('0x34')]);_0x2dba28[_0x6069('0x37')]=_[_0x6069('0x36')](_0x21b47c[_0x6069('0x38')],qs[_0x6069('0x39')](_0x30821c[_0x6069('0x34')][_0x6069('0x39')]));_0x2dba28[_0x6069('0x37')]=_0x2dba28[_0x6069('0x37')][_0x6069('0x3a')]?_0x2dba28['attributes']:_0x21b47c[_0x6069('0x38')];if(_0x30821c[_0x6069('0x34')][_0x6069('0x44')]){_0x2dba28['include']=[{'all':!![]}];}_0x2dba28=_[_0x6069('0x41')]({},_0x2dba28,_0x30821c[_0x6069('0x43')]);return db[_0x6069('0x2c')][_0x6069('0x4b')](_0x2dba28)['then'](handleEntityNotFound(_0x542d1e,null))[_0x6069('0x27')](respondWithResult(_0x542d1e,null))[_0x6069('0x48')](handleError(_0x542d1e,null));};exports[_0x6069('0x4c')]=function(_0x374844,_0x22dda5){return db[_0x6069('0x2c')][_0x6069('0x4c')](_0x374844[_0x6069('0x4d')],{})[_0x6069('0x27')](respondWithResult(_0x22dda5,0xc9))[_0x6069('0x48')](handleError(_0x22dda5,null));};exports[_0x6069('0x4e')]=function(_0x315c58,_0xe613a6){if(_0x315c58['body']['id']){delete _0x315c58[_0x6069('0x4d')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x315c58[_0x6069('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe613a6,null))[_0x6069('0x27')](saveUpdates(_0x315c58[_0x6069('0x4d')],null))[_0x6069('0x27')](respondWithResult(_0xe613a6,null))['catch'](handleError(_0xe613a6,null));};exports['destroy']=function(_0x18213e,_0x12e4f0){return db[_0x6069('0x2c')][_0x6069('0x4b')]({'where':{'id':_0x18213e[_0x6069('0x4a')]['id']}})[_0x6069('0x27')](handleEntityNotFound(_0x12e4f0,null))['then'](removeEntity(_0x12e4f0,null))[_0x6069('0x48')](handleError(_0x12e4f0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9c3d945..dfd4eea 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 _0xfd4f=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0xc7394,_0x3f3d5b){var _0x4344f9=function(_0x1812e7){while(--_0x1812e7){_0xc7394['push'](_0xc7394['shift']());}};_0x4344f9(++_0x3f3d5b);}(_0xfd4f,0x125));var _0xffd4=function(_0x44fc36,_0x2c1c0a){_0x44fc36=_0x44fc36-0x0;var _0x3c40f2=_0xfd4f[_0x44fc36];return _0x3c40f2;};'use strict';var _=require(_0xffd4('0x0'));var util=require('util');var logger=require(_0xffd4('0x1'))(_0xffd4('0x2'));var moment=require('moment');var BPromise=require(_0xffd4('0x3'));var rp=require(_0xffd4('0x4'));var fs=require('fs');var path=require(_0xffd4('0x5'));var rimraf=require('rimraf');var config=require(_0xffd4('0x6'));var attributes=require(_0xffd4('0x7'));module[_0xffd4('0x8')]=function(_0x4cd5d2,_0x1054a3){return _0x4cd5d2[_0xffd4('0x9')](_0xffd4('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xffd4('0xb'),'fields':['idField',_0xffd4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3dc4=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3334b9,_0x5235d5){var _0x82336b=function(_0x569cce){while(--_0x569cce){_0x3334b9['push'](_0x3334b9['shift']());}};_0x82336b(++_0x5235d5);}(_0x3dc4,0x12f));var _0x43dc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3dc4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43dc('0x0'));var util=require('util');var logger=require(_0x43dc('0x1'))('api');var moment=require(_0x43dc('0x2'));var BPromise=require(_0x43dc('0x3'));var rp=require(_0x43dc('0x4'));var fs=require('fs');var path=require(_0x43dc('0x5'));var rimraf=require(_0x43dc('0x6'));var config=require(_0x43dc('0x7'));var attributes=require(_0x43dc('0x8'));module['exports']=function(_0x511e89,_0x1b3b7e){return _0x511e89[_0x43dc('0x9')](_0x43dc('0xa'),attributes,{'tableName':_0x43dc('0xb'),'paranoid':![],'indexes':[{'name':_0x43dc('0xc'),'fields':[_0x43dc('0xd'),'FieldId'],'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 e564d45..ff4cca8 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 _0xeec4=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0xada46d,_0x44fc56){var _0x3b04ef=function(_0x1675ef){while(--_0x1675ef){_0xada46d['push'](_0xada46d['shift']());}};_0x3b04ef(++_0x44fc56);}(_0xeec4,0x9e));var _0x4eec=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xeec4[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0x4eec('0x0'));var util=require('util');var moment=require(_0x4eec('0x1'));var BPromise=require(_0x4eec('0x2'));var rs=require(_0x4eec('0x3'));var fs=require('fs');var Redis=require(_0x4eec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4eec('0x5'));var logger=require(_0x4eec('0x6'))(_0x4eec('0x7'));var config=require('../../config/environment');var jayson=require(_0x4eec('0x8'));var client=jayson[_0x4eec('0x9')][_0x4eec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e48f8,_0x59cd90,_0x50d171){return new BPromise(function(_0x19855b,_0x2ebd2b){return client['request'](_0x4e48f8,_0x50d171)[_0x4eec('0xb')](function(_0x472bf5){logger[_0x4eec('0xc')](_0x4eec('0xd'),_0x59cd90,'request\x20sent');logger[_0x4eec('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x59cd90,_0x4eec('0xf'),JSON[_0x4eec('0x10')](_0x472bf5));if(_0x472bf5[_0x4eec('0x11')]){if(_0x472bf5[_0x4eec('0x11')][_0x4eec('0x12')]===0x1f4){logger[_0x4eec('0x11')](_0x4eec('0xd'),_0x59cd90,_0x472bf5[_0x4eec('0x11')][_0x4eec('0x13')]);return _0x2ebd2b(_0x472bf5[_0x4eec('0x11')]['message']);}logger[_0x4eec('0x11')](_0x4eec('0xd'),_0x59cd90,_0x472bf5[_0x4eec('0x11')][_0x4eec('0x13')]);return _0x19855b(_0x472bf5[_0x4eec('0x11')][_0x4eec('0x13')]);}else{logger[_0x4eec('0xc')](_0x4eec('0xd'),_0x59cd90,_0x4eec('0xf'));_0x19855b(_0x472bf5[_0x4eec('0x14')][_0x4eec('0x13')]);}})[_0x4eec('0x15')](function(_0x43bde9){logger[_0x4eec('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x59cd90,_0x43bde9);_0x2ebd2b(_0x43bde9);});});} \ No newline at end of file +var _0x5666=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f2efb,_0x320e80){var _0xa1a895=function(_0x345328){while(--_0x345328){_0x2f2efb['push'](_0x2f2efb['shift']());}};_0xa1a895(++_0x320e80);}(_0x5666,0x111));var _0x6566=function(_0x26ad45,_0x447b3b){_0x26ad45=_0x26ad45-0x0;var _0x4339cd=_0x5666[_0x26ad45];return _0x4339cd;};'use strict';var _=require(_0x6566('0x0'));var util=require(_0x6566('0x1'));var moment=require('moment');var BPromise=require(_0x6566('0x2'));var rs=require(_0x6566('0x3'));var fs=require('fs');var Redis=require(_0x6566('0x4'));var db=require(_0x6566('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6566('0x6'));var jayson=require(_0x6566('0x7'));var client=jayson[_0x6566('0x8')][_0x6566('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e0d4,_0x1bad6d,_0x1f3c69){return new BPromise(function(_0x256f64,_0xa9fff2){return client[_0x6566('0xa')](_0x11e0d4,_0x1f3c69)[_0x6566('0xb')](function(_0x38e306){logger[_0x6566('0xc')](_0x6566('0xd'),_0x1bad6d,_0x6566('0xe'));logger[_0x6566('0xf')](_0x6566('0x10'),_0x1bad6d,_0x6566('0xe'),JSON['stringify'](_0x38e306));if(_0x38e306[_0x6566('0x11')]){if(_0x38e306[_0x6566('0x11')][_0x6566('0x12')]===0x1f4){logger[_0x6566('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1bad6d,_0x38e306[_0x6566('0x11')]['message']);return _0xa9fff2(_0x38e306['error'][_0x6566('0x13')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1bad6d,_0x38e306[_0x6566('0x11')][_0x6566('0x13')]);return _0x256f64(_0x38e306[_0x6566('0x11')][_0x6566('0x13')]);}else{logger[_0x6566('0xc')](_0x6566('0xd'),_0x1bad6d,_0x6566('0xe'));_0x256f64(_0x38e306[_0x6566('0x14')][_0x6566('0x13')]);}})[_0x6566('0x15')](function(_0x5c4267){logger[_0x6566('0x11')](_0x6566('0xd'),_0x1bad6d,_0x5c4267);_0xa9fff2(_0x5c4267);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b5e897b..7fa80ec 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 _0x45e1=['post','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x46e73f,_0x34fa36){var _0x4cdaf4=function(_0x1da265){while(--_0x1da265){_0x46e73f['push'](_0x46e73f['shift']());}};_0x4cdaf4(++_0x34fa36);}(_0x45e1,0x150));var _0x145e=function(_0x2ca970,_0x32fe25){_0x2ca970=_0x2ca970-0x0;var _0x45f6e8=_0x45e1[_0x2ca970];return _0x45f6e8;};'use strict';var multer=require(_0x145e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x145e('0x1'));var router=express['Router']();var fs_extra=require(_0x145e('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x145e('0x3'));var config=require(_0x145e('0x4'));var controller=require(_0x145e('0x5'));router[_0x145e('0x6')]('/',auth[_0x145e('0x7')](),controller[_0x145e('0x8')]);router[_0x145e('0x6')](_0x145e('0x9'),auth[_0x145e('0x7')](),controller[_0x145e('0xa')]);router['get'](_0x145e('0xb'),auth[_0x145e('0x7')](),controller[_0x145e('0xc')]);router[_0x145e('0x6')](_0x145e('0xd'),auth['isAuthenticated'](),controller[_0x145e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x145e('0xf')]);router[_0x145e('0x10')](_0x145e('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x145e('0x11')](_0x145e('0x9'),auth[_0x145e('0x7')](),controller[_0x145e('0x12')]);router[_0x145e('0x13')](_0x145e('0x9'),auth[_0x145e('0x7')](),controller[_0x145e('0x14')]);module[_0x145e('0x15')]=router; \ No newline at end of file +var _0xe73a=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','update','delete'];(function(_0x1f032f,_0x45710c){var _0xa665c0=function(_0x5e7faa){while(--_0x5e7faa){_0x1f032f['push'](_0x1f032f['shift']());}};_0xa665c0(++_0x45710c);}(_0xe73a,0xdd));var _0xae73=function(_0x2fcd90,_0x4780cc){_0x2fcd90=_0x2fcd90-0x0;var _0x55b596=_0xe73a[_0x2fcd90];return _0x55b596;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae73('0x0'));var timeout=require('connect-timeout');var express=require(_0xae73('0x1'));var router=express[_0xae73('0x2')]();var fs_extra=require(_0xae73('0x3'));var auth=require(_0xae73('0x4'));var interaction=require(_0xae73('0x5'));var config=require(_0xae73('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0xae73('0x7')]('/',auth['isAuthenticated'](),controller[_0xae73('0x8')]);router[_0xae73('0x7')](_0xae73('0x9'),auth[_0xae73('0xa')](),controller['show']);router['get'](_0xae73('0xb'),auth[_0xae73('0xa')](),controller['getConfigurations']);router[_0xae73('0x7')](_0xae73('0xc'),auth[_0xae73('0xa')](),controller[_0xae73('0xd')]);router['post']('/',auth[_0xae73('0xa')](),controller[_0xae73('0xe')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xae73('0xf')]);router[_0xae73('0x10')](_0xae73('0x9'),auth[_0xae73('0xa')](),controller[_0xae73('0x11')]);router[_0xae73('0x12')](_0xae73('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xae73('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 f2841c4..1c3d121 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 _0x25e7=['sequelize','exports','STRING','username','remoteUri'];(function(_0x2bdecd,_0x21805f){var _0x56116e=function(_0x297d20){while(--_0x297d20){_0x2bdecd['push'](_0x2bdecd['shift']());}};_0x56116e(++_0x21805f);}(_0x25e7,0x1d6));var _0x725e=function(_0x405541,_0x2945cc){_0x405541=_0x405541-0x0;var _0x194a1e=_0x25e7[_0x405541];return _0x194a1e;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'name':{'type':Sequelize[_0x725e('0x2')]},'description':{'type':Sequelize[_0x725e('0x2')]},'username':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x3')},'apiKey':{'type':Sequelize[_0x725e('0x2')]},'remoteUri':{'type':Sequelize[_0x725e('0x2')],'unique':_0x725e('0x4')},'serverUrl':{'type':Sequelize[_0x725e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x33ef5c,_0x50d6df){var _0x12945f=function(_0x4e7a10){while(--_0x4e7a10){_0x33ef5c['push'](_0x33ef5c['shift']());}};_0x12945f(++_0x50d6df);}(_0xe5af,0x9c));var _0xfe5a=function(_0x3ea5c1,_0x22a76a){_0x3ea5c1=_0x3ea5c1-0x0;var _0x3f0c15=_0xe5af[_0x3ea5c1];return _0x3f0c15;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 3b2ee68..03266fc 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 _0xd9dc=['../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','FreshdeskAccount','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','getConfigurations','FreshdeskConfiguration','length','pick','hasOwnProperty','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','%s/%s','format','Basic\x20%s','%s:X','toString','base64','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','util','path','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'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x57dd90,_0x58ddc4){_0x57dd90=_0x57dd90-0x0;var _0x34abca=_0xd9dc[_0x57dd90];return _0x34abca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd9d('0x0'));var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9d('0x2'));var moment=require(_0xcd9d('0x3'));var BPromise=require(_0xcd9d('0x4'));var Mustache=require('mustache');var util=require(_0xcd9d('0x5'));var path=require(_0xcd9d('0x6'));var sox=require(_0xcd9d('0x7'));var csv=require(_0xcd9d('0x8'));var ejs=require(_0xcd9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9d('0xa'));var squel=require(_0xcd9d('0xb'));var crypto=require(_0xcd9d('0xc'));var jsforce=require(_0xcd9d('0xd'));var deskjs=require(_0xcd9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd9d('0xf'));var Papa=require(_0xcd9d('0x10'));var Redis=require(_0xcd9d('0x11'));var authService=require(_0xcd9d('0x12'));var qs=require(_0xcd9d('0x13'));var as=require(_0xcd9d('0x14'));var hardwareService=require(_0xcd9d('0x15'));var logger=require(_0xcd9d('0x16'))('api');var utils=require(_0xcd9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9d('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcd9d('0x19'));function respondWithStatusCode(_0x3ab0af,_0x2fa1d0){_0x2fa1d0=_0x2fa1d0||0xcc;return function(_0x49028e){if(_0x49028e){return _0x3ab0af[_0xcd9d('0x1a')](_0x2fa1d0);}return _0x3ab0af['status'](_0x2fa1d0)[_0xcd9d('0x1b')]();};}function respondWithResult(_0x957089,_0x31ddbb){_0x31ddbb=_0x31ddbb||0xc8;return function(_0x582a92){if(_0x582a92){return _0x957089[_0xcd9d('0x1c')](_0x31ddbb)[_0xcd9d('0x1d')](_0x582a92);}};}function respondWithFilteredResult(_0x50f14d,_0x40d5aa){return function(_0x5a7248){if(_0x5a7248){var _0x3ea72c=typeof _0x40d5aa['offset']===_0xcd9d('0x1e')&&typeof _0x40d5aa[_0xcd9d('0x1f')]===_0xcd9d('0x1e');var _0xf82796=_0x5a7248[_0xcd9d('0x20')];var _0x4381e2=_0x3ea72c?0x0:_0x40d5aa[_0xcd9d('0x21')];var _0x3c544d=_0x3ea72c?_0x5a7248[_0xcd9d('0x20')]:_0x40d5aa[_0xcd9d('0x21')]+_0x40d5aa[_0xcd9d('0x1f')];var _0x497425;if(_0x3c544d>=_0xf82796){_0x3c544d=_0xf82796;_0x497425=0xc8;}else{_0x497425=0xce;}_0x50f14d[_0xcd9d('0x1c')](_0x497425);return _0x50f14d[_0xcd9d('0x22')](_0xcd9d('0x23'),_0x4381e2+'-'+_0x3c544d+'/'+_0xf82796)['json'](_0x5a7248);}return null;};}function patchUpdates(_0x2a5848){return function(_0xe04bb8){try{jsonpatch[_0xcd9d('0x24')](_0xe04bb8,_0x2a5848,!![]);}catch(_0x851388){return BPromise[_0xcd9d('0x25')](_0x851388);}return _0xe04bb8[_0xcd9d('0x26')]();};}function saveUpdates(_0x1e7d4d,_0x12e585){return function(_0x4ad511){if(_0x4ad511){return _0x4ad511['update'](_0x1e7d4d)[_0xcd9d('0x27')](function(_0x222afe){return _0x222afe;});}return null;};}function removeEntity(_0x2560fd,_0x474bb4){return function(_0x58b632){if(_0x58b632){return _0x58b632[_0xcd9d('0x28')]()[_0xcd9d('0x27')](function(){_0x2560fd[_0xcd9d('0x1c')](0xcc)[_0xcd9d('0x1b')]();});}};}function handleEntityNotFound(_0x32686a,_0x5ed51f){return function(_0x33aca7){if(!_0x33aca7){_0x32686a[_0xcd9d('0x1a')](0x194);}return _0x33aca7;};}function handleError(_0xf21e2,_0x4ce785){_0x4ce785=_0x4ce785||0x1f4;return function(_0x14a5e9){logger[_0xcd9d('0x29')](_0x14a5e9[_0xcd9d('0x2a')]);if(_0x14a5e9['name']){delete _0x14a5e9[_0xcd9d('0x2b')];}_0xf21e2[_0xcd9d('0x1c')](_0x4ce785)['send'](_0x14a5e9);};}exports['index']=function(_0xf84e80,_0x124da9){var _0x5b1fd6={},_0xcf8b36={},_0x2d3347={'count':0x0,'rows':[]};var _0x3c70de=_[_0xcd9d('0x2c')](db[_0xcd9d('0x2d')]['rawAttributes'],function(_0x4bd53d){return{'name':_0x4bd53d[_0xcd9d('0x2e')],'type':_0x4bd53d[_0xcd9d('0x2f')]['key']};});_0xcf8b36[_0xcd9d('0x30')]=_[_0xcd9d('0x2c')](_0x3c70de,_0xcd9d('0x2b'));_0xcf8b36['query']=_[_0xcd9d('0x31')](_0xf84e80[_0xcd9d('0x32')]);_0xcf8b36[_0xcd9d('0x33')]=_[_0xcd9d('0x34')](_0xcf8b36['model'],_0xcf8b36['query']);_0x5b1fd6[_0xcd9d('0x35')]=_['intersection'](_0xcf8b36['model'],qs[_0xcd9d('0x36')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x5b1fd6[_0xcd9d('0x35')]=_0x5b1fd6['attributes']['length']?_0x5b1fd6[_0xcd9d('0x35')]:_0xcf8b36[_0xcd9d('0x30')];if(!_0xf84e80[_0xcd9d('0x32')]['hasOwnProperty'](_0xcd9d('0x37'))){_0x5b1fd6[_0xcd9d('0x1f')]=qs[_0xcd9d('0x1f')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x1f')]);_0x5b1fd6[_0xcd9d('0x21')]=qs[_0xcd9d('0x21')](_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x21')]);}_0x5b1fd6[_0xcd9d('0x38')]=qs[_0xcd9d('0x39')](_0xf84e80[_0xcd9d('0x32')]['sort']);_0x5b1fd6[_0xcd9d('0x3a')]=qs[_0xcd9d('0x33')](_['pick'](_0xf84e80['query'],_0xcf8b36[_0xcd9d('0x33')]),_0x3c70de);if(_0xf84e80['query']['filter']){_0x5b1fd6[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x5b1fd6[_0xcd9d('0x3a')],{'$or':_[_0xcd9d('0x2c')](_0x3c70de,function(_0x49b83d){if(_0x49b83d[_0xcd9d('0x2f')]!==_0xcd9d('0x3c')){var _0x532174={};_0x532174[_0x49b83d[_0xcd9d('0x2b')]]={'$like':'%'+_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x3d')]+'%'};return _0x532174;}})});}_0x5b1fd6=_[_0xcd9d('0x3b')]({},_0x5b1fd6,_0xf84e80['options']);var _0x4f06e6={'where':_0x5b1fd6[_0xcd9d('0x3a')]};return db['FreshdeskAccount'][_0xcd9d('0x20')](_0x4f06e6)[_0xcd9d('0x27')](function(_0x10c35a){_0x2d3347['count']=_0x10c35a;if(_0xf84e80[_0xcd9d('0x32')][_0xcd9d('0x3e')]){_0x5b1fd6[_0xcd9d('0x3f')]=[{'all':!![]}];}return db[_0xcd9d('0x2d')][_0xcd9d('0x40')](_0x5b1fd6);})[_0xcd9d('0x27')](function(_0x23065b){_0x2d3347[_0xcd9d('0x41')]=_0x23065b;return _0x2d3347;})[_0xcd9d('0x27')](respondWithFilteredResult(_0x124da9,_0x5b1fd6))[_0xcd9d('0x42')](handleError(_0x124da9,null));};exports[_0xcd9d('0x43')]=function(_0x5e8223,_0x4a2dec){var _0x52b882={'raw':![],'where':{'id':_0x5e8223[_0xcd9d('0x44')]['id']}},_0x2b4584={};_0x2b4584[_0xcd9d('0x30')]=_['keys'](db[_0xcd9d('0x2d')][_0xcd9d('0x45')]);_0x2b4584['query']=_[_0xcd9d('0x31')](_0x5e8223['query']);_0x2b4584[_0xcd9d('0x33')]=_[_0xcd9d('0x34')](_0x2b4584['model'],_0x2b4584['query']);_0x52b882[_0xcd9d('0x35')]=_[_0xcd9d('0x34')](_0x2b4584[_0xcd9d('0x30')],qs[_0xcd9d('0x36')](_0x5e8223[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x52b882['attributes']=_0x52b882['attributes']['length']?_0x52b882[_0xcd9d('0x35')]:_0x2b4584[_0xcd9d('0x30')];if(_0x5e8223['query'][_0xcd9d('0x3e')]){_0x52b882[_0xcd9d('0x3f')]=[{'all':!![]}];}_0x52b882=_[_0xcd9d('0x3b')]({},_0x52b882,_0x5e8223[_0xcd9d('0x46')]);return db[_0xcd9d('0x2d')][_0xcd9d('0x47')](_0x52b882)[_0xcd9d('0x27')](handleEntityNotFound(_0x4a2dec,null))[_0xcd9d('0x27')](respondWithResult(_0x4a2dec,null))[_0xcd9d('0x42')](handleError(_0x4a2dec,null));};exports[_0xcd9d('0x48')]=function(_0x55c374,_0x28b724){return db[_0xcd9d('0x2d')][_0xcd9d('0x48')](_0x55c374[_0xcd9d('0x49')],{})[_0xcd9d('0x27')](respondWithResult(_0x28b724,0xc9))[_0xcd9d('0x42')](handleError(_0x28b724,null));};exports[_0xcd9d('0x4a')]=function(_0x3234ea,_0x5a1c79){if(_0x3234ea[_0xcd9d('0x49')]['id']){delete _0x3234ea[_0xcd9d('0x49')]['id'];}return db[_0xcd9d('0x2d')]['find']({'where':{'id':_0x3234ea[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x5a1c79,null))[_0xcd9d('0x27')](saveUpdates(_0x3234ea[_0xcd9d('0x49')],null))[_0xcd9d('0x27')](respondWithResult(_0x5a1c79,null))[_0xcd9d('0x42')](handleError(_0x5a1c79,null));};exports[_0xcd9d('0x28')]=function(_0x346776,_0x5c541e){return db[_0xcd9d('0x2d')][_0xcd9d('0x47')]({'where':{'id':_0x346776[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x5c541e,null))['then'](removeEntity(_0x5c541e,null))[_0xcd9d('0x42')](handleError(_0x5c541e,null));};exports[_0xcd9d('0x4b')]=function(_0x26b475,_0x10fb9f,_0x5bdcfd){var _0x27a363={};var _0x3e6754={};var _0x1bf893;var _0x425e86;return db[_0xcd9d('0x2d')]['findOne']({'where':{'id':_0x26b475[_0xcd9d('0x44')]['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x10fb9f,null))['then'](function(_0x2c2782){if(_0x2c2782){_0x1bf893=_0x2c2782;_0x3e6754[_0xcd9d('0x30')]=_['keys'](db[_0xcd9d('0x4c')][_0xcd9d('0x45')]);_0x3e6754[_0xcd9d('0x32')]=_[_0xcd9d('0x31')](_0x26b475[_0xcd9d('0x32')]);_0x3e6754[_0xcd9d('0x33')]=_['intersection'](_0x3e6754['model'],_0x3e6754['query']);_0x27a363[_0xcd9d('0x35')]=_[_0xcd9d('0x34')](_0x3e6754[_0xcd9d('0x30')],qs['fields'](_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x36')]));_0x27a363['attributes']=_0x27a363[_0xcd9d('0x35')][_0xcd9d('0x4d')]?_0x27a363[_0xcd9d('0x35')]:_0x3e6754['model'];_0x27a363[_0xcd9d('0x38')]=qs[_0xcd9d('0x39')](_0x26b475['query'][_0xcd9d('0x39')]);_0x27a363['where']=qs[_0xcd9d('0x33')](_[_0xcd9d('0x4e')](_0x26b475[_0xcd9d('0x32')],_0x3e6754['filters']));if(_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x3d')]){_0x27a363[_0xcd9d('0x3a')]=_[_0xcd9d('0x3b')](_0x27a363[_0xcd9d('0x3a')],{'$or':_[_0xcd9d('0x2c')](_0x27a363[_0xcd9d('0x35')],function(_0x288d3e){var _0xf9b506={};_0xf9b506[_0x288d3e]={'$like':'%'+_0x26b475['query'][_0xcd9d('0x3d')]+'%'};return _0xf9b506;})});}_0x27a363=_[_0xcd9d('0x3b')]({},_0x27a363,_0x26b475[_0xcd9d('0x46')]);return _0x1bf893['getConfigurations'](_0x27a363);}})[_0xcd9d('0x27')](function(_0x282048){if(_0x282048){_0x425e86=_0x282048[_0xcd9d('0x4d')];if(!_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x4f')](_0xcd9d('0x37'))){_0x27a363['limit']=qs['limit'](_0x26b475[_0xcd9d('0x32')][_0xcd9d('0x1f')]);_0x27a363[_0xcd9d('0x21')]=qs[_0xcd9d('0x21')](_0x26b475[_0xcd9d('0x32')]['offset']);}return _0x1bf893[_0xcd9d('0x4b')](_0x27a363);}})['then'](function(_0xe4aace){if(_0xe4aace){return _0xe4aace?{'count':_0x425e86,'rows':_0xe4aace}:null;}})['then'](respondWithResult(_0x10fb9f,null))[_0xcd9d('0x42')](handleError(_0x10fb9f,null));};exports['addConfiguration']=function(_0x380e8b,_0x32fd7e,_0x5608f1){if(_0x380e8b[_0xcd9d('0x49')]['id']){delete _0x380e8b['body']['id'];}return db[_0xcd9d('0x2d')][_0xcd9d('0x50')]({'where':{'id':_0x380e8b['params']['id']}})[_0xcd9d('0x27')](handleEntityNotFound(_0x32fd7e,null))[_0xcd9d('0x27')](function(_0x23998d){if(_0x23998d){_0x380e8b['body'][_0xcd9d('0x51')]=_0x23998d['id'];_0x380e8b['body']['Subjects']=integrations[_0xcd9d('0x52')](_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x53')],_0x380e8b['body'][_0xcd9d('0x2f')]);_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x54')]=integrations[_0xcd9d('0x55')](_0x380e8b[_0xcd9d('0x49')][_0xcd9d('0x53')],_0x380e8b['body'][_0xcd9d('0x2f')]);return db[_0xcd9d('0x4c')]['create'](_0x380e8b[_0xcd9d('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0xcd9d('0x56')},{'model':db[_0xcd9d('0x57')],'as':_0xcd9d('0x54')}]});}return null;})[_0xcd9d('0x27')](respondWithResult(_0x32fd7e,null))[_0xcd9d('0x42')](handleError(_0x32fd7e,null));};exports[_0xcd9d('0x58')]=function(_0xf8932c,_0xb62b90,_0x2e7eef){var _0x4a16f8='';return db[_0xcd9d('0x2d')]['findOne']({'where':{'id':_0xf8932c[_0xcd9d('0x44')]['id']},'attributes':['id',_0xcd9d('0x59'),_0xcd9d('0x5a')]})[_0xcd9d('0x27')](handleEntityNotFound(_0xb62b90,null))[_0xcd9d('0x27')](function(_0x5587cf){if(_0x5587cf){_0x4a16f8=_0x5587cf[_0xcd9d('0x59')];var _0x6fe93a=_0x4a16f8[_0xcd9d('0x5b')](-0x1);if(_0x6fe93a==='/'){_0x4a16f8=_0x4a16f8[_0xcd9d('0x5c')](0x0,_0x4a16f8[_0xcd9d('0x5d')](_0x6fe93a));}return rp({'method':'GET','uri':util['format'](_0xcd9d('0x5e'),_0x4a16f8,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xcd9d('0x5f')](_0xcd9d('0x60'),new Buffer(util['format'](_0xcd9d('0x61'),_0x5587cf[_0xcd9d('0x5a')]))[_0xcd9d('0x62')](_0xcd9d('0x63')))},'json':!![]});}})['then'](function(_0x52b1bc){if(_0x52b1bc){var _0x565ee7=['requester','subject',_0xcd9d('0x64'),'description',_0xcd9d('0x1c'),_0xcd9d('0x65'),_0xcd9d('0x66'),_0xcd9d('0x67'),_0xcd9d('0x68'),_0xcd9d('0x66'),'company'];_[_0xcd9d('0x69')](_0x52b1bc,function(_0x470a1d){return _0x565ee7[_0xcd9d('0x6a')](_0x470a1d['name'])||!_0x470a1d[_0xcd9d('0x6b')]&&_0x470a1d[_0xcd9d('0x2f')]!==_0xcd9d('0x6c')&&_0x470a1d['type']!==_0xcd9d('0x6d');});return{'count':_0x52b1bc['length'],'rows':_[_0xcd9d('0x2c')](_0x52b1bc,function(_0x2fbeee){return{'id':_0x2fbeee[_0xcd9d('0x2b')],'name':_0x2fbeee[_0xcd9d('0x6e')],'custom':!_0x2fbeee[_0xcd9d('0x6b')],'options':_0x2fbeee[_0xcd9d('0x6f')]?_[_0xcd9d('0x2c')](_0x2fbeee[_0xcd9d('0x6f')],function(_0x32ad9c){return{'name':_[_0xcd9d('0x70')](_0x32ad9c),'value':_0x32ad9c};}):[]};})};}})['then'](respondWithResult(_0xb62b90,null))['catch'](function(_0xa4ae71){var _0x14b11a=_0xf8932c[_0xcd9d('0x32')][_0xcd9d('0x71')]?0x1f4:_0xa4ae71['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xcd9d('0x58'),_0x14b11a,JSON['stringify'](_0xa4ae71));delete _0xa4ae71[_0xcd9d('0x2b')];if(_0x14b11a===0x191){_0x14b11a=0x190;}_0xb62b90[_0xcd9d('0x1c')](_0x14b11a)[_0xcd9d('0x72')](_0xf8932c[_0xcd9d('0x32')][_0xcd9d('0x71')]?{'message':_0xcd9d('0x73'),'statusCode':_0xa4ae71[_0xcd9d('0x74')]}:_0xa4ae71);});}; \ No newline at end of file +var _0xa3b9=['includeAll','include','rows','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','filter','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','custom_text','label','default','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','options'];(function(_0x551dc7,_0x395b19){var _0x1df540=function(_0x5a96a3){while(--_0x5a96a3){_0x551dc7['push'](_0x551dc7['shift']());}};_0x1df540(++_0x395b19);}(_0xa3b9,0x112));var _0x9a3b=function(_0x2c8f06,_0x43e52c){_0x2c8f06=_0x2c8f06-0x0;var _0xfcb7d5=_0xa3b9[_0x2c8f06];return _0xfcb7d5;};'use strict';var emlformat=require(_0x9a3b('0x0'));var rimraf=require(_0x9a3b('0x1'));var zipdir=require(_0x9a3b('0x2'));var jsonpatch=require(_0x9a3b('0x3'));var rp=require(_0x9a3b('0x4'));var moment=require(_0x9a3b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a3b('0x6'));var util=require(_0x9a3b('0x7'));var path=require(_0x9a3b('0x8'));var sox=require(_0x9a3b('0x9'));var csv=require(_0x9a3b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a3b('0xb'));var squel=require(_0x9a3b('0xc'));var crypto=require(_0x9a3b('0xd'));var jsforce=require(_0x9a3b('0xe'));var deskjs=require(_0x9a3b('0xf'));var toCsv=require(_0x9a3b('0xa'));var querystring=require(_0x9a3b('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a3b('0x11'));var authService=require(_0x9a3b('0x12'));var qs=require(_0x9a3b('0x13'));var as=require(_0x9a3b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a3b('0x15'))(_0x9a3b('0x16'));var utils=require(_0x9a3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a3b('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x57fd21,_0x86116e){_0x86116e=_0x86116e||0xcc;return function(_0x212779){if(_0x212779){return _0x57fd21['sendStatus'](_0x86116e);}return _0x57fd21[_0x9a3b('0x19')](_0x86116e)['end']();};}function respondWithResult(_0x1d5aef,_0x16ff58){_0x16ff58=_0x16ff58||0xc8;return function(_0x302a1e){if(_0x302a1e){return _0x1d5aef['status'](_0x16ff58)['json'](_0x302a1e);}};}function respondWithFilteredResult(_0x703e57,_0x594395){return function(_0x2b6474){if(_0x2b6474){var _0x25dcf5=typeof _0x594395[_0x9a3b('0x1a')]===_0x9a3b('0x1b')&&typeof _0x594395[_0x9a3b('0x1c')]==='undefined';var _0x50ffe3=_0x2b6474[_0x9a3b('0x1d')];var _0x2dbf3b=_0x25dcf5?0x0:_0x594395['offset'];var _0x22cbbb=_0x25dcf5?_0x2b6474[_0x9a3b('0x1d')]:_0x594395[_0x9a3b('0x1a')]+_0x594395['limit'];var _0x582dd6;if(_0x22cbbb>=_0x50ffe3){_0x22cbbb=_0x50ffe3;_0x582dd6=0xc8;}else{_0x582dd6=0xce;}_0x703e57[_0x9a3b('0x19')](_0x582dd6);return _0x703e57['set']('Content-Range',_0x2dbf3b+'-'+_0x22cbbb+'/'+_0x50ffe3)[_0x9a3b('0x1e')](_0x2b6474);}return null;};}function patchUpdates(_0x6bd3af){return function(_0x12154a){try{jsonpatch[_0x9a3b('0x1f')](_0x12154a,_0x6bd3af,!![]);}catch(_0x28a590){return BPromise[_0x9a3b('0x20')](_0x28a590);}return _0x12154a['save']();};}function saveUpdates(_0x448324,_0x1cb2c0){return function(_0x2b6be4){if(_0x2b6be4){return _0x2b6be4[_0x9a3b('0x21')](_0x448324)[_0x9a3b('0x22')](function(_0x2d44b1){return _0x2d44b1;});}return null;};}function removeEntity(_0x3b32d8,_0x375804){return function(_0x5cc2be){if(_0x5cc2be){return _0x5cc2be[_0x9a3b('0x23')]()[_0x9a3b('0x22')](function(){_0x3b32d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a01c,_0x23f0e2){return function(_0x441095){if(!_0x441095){_0x28a01c[_0x9a3b('0x24')](0x194);}return _0x441095;};}function handleError(_0x4a6876,_0x895da0){_0x895da0=_0x895da0||0x1f4;return function(_0x21c712){logger[_0x9a3b('0x25')](_0x21c712[_0x9a3b('0x26')]);if(_0x21c712[_0x9a3b('0x27')]){delete _0x21c712[_0x9a3b('0x27')];}_0x4a6876['status'](_0x895da0)[_0x9a3b('0x28')](_0x21c712);};}exports[_0x9a3b('0x29')]=function(_0x432f23,_0xcc06f){var _0x31d542={},_0x504b44={},_0x1b70e8={'count':0x0,'rows':[]};var _0x2aa9c2=_[_0x9a3b('0x2a')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')],function(_0x38a10b){return{'name':_0x38a10b['fieldName'],'type':_0x38a10b['type'][_0x9a3b('0x2d')]};});_0x504b44[_0x9a3b('0x2e')]=_[_0x9a3b('0x2a')](_0x2aa9c2,_0x9a3b('0x27'));_0x504b44[_0x9a3b('0x2f')]=_['keys'](_0x432f23['query']);_0x504b44['filters']=_[_0x9a3b('0x30')](_0x504b44[_0x9a3b('0x2e')],_0x504b44['query']);_0x31d542[_0x9a3b('0x31')]=_[_0x9a3b('0x30')](_0x504b44[_0x9a3b('0x2e')],qs['fields'](_0x432f23['query'][_0x9a3b('0x32')]));_0x31d542['attributes']=_0x31d542[_0x9a3b('0x31')]['length']?_0x31d542[_0x9a3b('0x31')]:_0x504b44['model'];if(!_0x432f23[_0x9a3b('0x2f')][_0x9a3b('0x33')](_0x9a3b('0x34'))){_0x31d542[_0x9a3b('0x1c')]=qs[_0x9a3b('0x1c')](_0x432f23['query'][_0x9a3b('0x1c')]);_0x31d542['offset']=qs[_0x9a3b('0x1a')](_0x432f23[_0x9a3b('0x2f')][_0x9a3b('0x1a')]);}_0x31d542[_0x9a3b('0x35')]=qs[_0x9a3b('0x36')](_0x432f23[_0x9a3b('0x2f')]['sort']);_0x31d542['where']=qs[_0x9a3b('0x37')](_[_0x9a3b('0x38')](_0x432f23[_0x9a3b('0x2f')],_0x504b44['filters']),_0x2aa9c2);if(_0x432f23[_0x9a3b('0x2f')]['filter']){_0x31d542[_0x9a3b('0x39')]=_[_0x9a3b('0x3a')](_0x31d542[_0x9a3b('0x39')],{'$or':_['map'](_0x2aa9c2,function(_0x35d73b){if(_0x35d73b[_0x9a3b('0x3b')]!==_0x9a3b('0x3c')){var _0x2c4313={};_0x2c4313[_0x35d73b[_0x9a3b('0x27')]]={'$like':'%'+_0x432f23[_0x9a3b('0x2f')]['filter']+'%'};return _0x2c4313;}})});}_0x31d542=_[_0x9a3b('0x3a')]({},_0x31d542,_0x432f23[_0x9a3b('0x3d')]);var _0x3ba059={'where':_0x31d542['where']};return db[_0x9a3b('0x2b')][_0x9a3b('0x1d')](_0x3ba059)[_0x9a3b('0x22')](function(_0x32f6ad){_0x1b70e8[_0x9a3b('0x1d')]=_0x32f6ad;if(_0x432f23[_0x9a3b('0x2f')][_0x9a3b('0x3e')]){_0x31d542[_0x9a3b('0x3f')]=[{'all':!![]}];}return db[_0x9a3b('0x2b')]['findAll'](_0x31d542);})[_0x9a3b('0x22')](function(_0x18b3d2){_0x1b70e8[_0x9a3b('0x40')]=_0x18b3d2;return _0x1b70e8;})[_0x9a3b('0x22')](respondWithFilteredResult(_0xcc06f,_0x31d542))[_0x9a3b('0x41')](handleError(_0xcc06f,null));};exports[_0x9a3b('0x42')]=function(_0x53ee3e,_0x129bbb){var _0x2872b1={'raw':![],'where':{'id':_0x53ee3e[_0x9a3b('0x43')]['id']}},_0x2722bb={};_0x2722bb[_0x9a3b('0x2e')]=_[_0x9a3b('0x44')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')]);_0x2722bb[_0x9a3b('0x2f')]=_[_0x9a3b('0x44')](_0x53ee3e[_0x9a3b('0x2f')]);_0x2722bb[_0x9a3b('0x37')]=_[_0x9a3b('0x30')](_0x2722bb['model'],_0x2722bb[_0x9a3b('0x2f')]);_0x2872b1[_0x9a3b('0x31')]=_[_0x9a3b('0x30')](_0x2722bb[_0x9a3b('0x2e')],qs[_0x9a3b('0x32')](_0x53ee3e[_0x9a3b('0x2f')][_0x9a3b('0x32')]));_0x2872b1[_0x9a3b('0x31')]=_0x2872b1[_0x9a3b('0x31')][_0x9a3b('0x45')]?_0x2872b1[_0x9a3b('0x31')]:_0x2722bb[_0x9a3b('0x2e')];if(_0x53ee3e[_0x9a3b('0x2f')]['includeAll']){_0x2872b1[_0x9a3b('0x3f')]=[{'all':!![]}];}_0x2872b1=_[_0x9a3b('0x3a')]({},_0x2872b1,_0x53ee3e[_0x9a3b('0x3d')]);return db[_0x9a3b('0x2b')][_0x9a3b('0x46')](_0x2872b1)[_0x9a3b('0x22')](handleEntityNotFound(_0x129bbb,null))['then'](respondWithResult(_0x129bbb,null))['catch'](handleError(_0x129bbb,null));};exports[_0x9a3b('0x47')]=function(_0x51a2c7,_0x1c43fe){return db[_0x9a3b('0x2b')][_0x9a3b('0x47')](_0x51a2c7[_0x9a3b('0x48')],{})[_0x9a3b('0x22')](respondWithResult(_0x1c43fe,0xc9))[_0x9a3b('0x41')](handleError(_0x1c43fe,null));};exports[_0x9a3b('0x21')]=function(_0x41389e,_0x2c6021){if(_0x41389e[_0x9a3b('0x48')]['id']){delete _0x41389e[_0x9a3b('0x48')]['id'];}return db[_0x9a3b('0x2b')][_0x9a3b('0x46')]({'where':{'id':_0x41389e[_0x9a3b('0x43')]['id']}})[_0x9a3b('0x22')](handleEntityNotFound(_0x2c6021,null))['then'](saveUpdates(_0x41389e[_0x9a3b('0x48')],null))[_0x9a3b('0x22')](respondWithResult(_0x2c6021,null))[_0x9a3b('0x41')](handleError(_0x2c6021,null));};exports['destroy']=function(_0x20c9f3,_0x464c7e){return db['FreshdeskAccount'][_0x9a3b('0x46')]({'where':{'id':_0x20c9f3[_0x9a3b('0x43')]['id']}})[_0x9a3b('0x22')](handleEntityNotFound(_0x464c7e,null))[_0x9a3b('0x22')](removeEntity(_0x464c7e,null))[_0x9a3b('0x41')](handleError(_0x464c7e,null));};exports[_0x9a3b('0x49')]=function(_0xfa2703,_0x329294,_0x32566d){var _0x405af1={};var _0xecc304={};var _0x159e43;var _0x1576d7;return db[_0x9a3b('0x2b')][_0x9a3b('0x4a')]({'where':{'id':_0xfa2703[_0x9a3b('0x43')]['id']}})[_0x9a3b('0x22')](handleEntityNotFound(_0x329294,null))[_0x9a3b('0x22')](function(_0x1293b6){if(_0x1293b6){_0x159e43=_0x1293b6;_0xecc304['model']=_['keys'](db[_0x9a3b('0x4b')][_0x9a3b('0x2c')]);_0xecc304[_0x9a3b('0x2f')]=_[_0x9a3b('0x44')](_0xfa2703['query']);_0xecc304[_0x9a3b('0x37')]=_[_0x9a3b('0x30')](_0xecc304['model'],_0xecc304[_0x9a3b('0x2f')]);_0x405af1[_0x9a3b('0x31')]=_['intersection'](_0xecc304['model'],qs['fields'](_0xfa2703['query']['fields']));_0x405af1['attributes']=_0x405af1[_0x9a3b('0x31')][_0x9a3b('0x45')]?_0x405af1[_0x9a3b('0x31')]:_0xecc304['model'];_0x405af1[_0x9a3b('0x35')]=qs[_0x9a3b('0x36')](_0xfa2703[_0x9a3b('0x2f')][_0x9a3b('0x36')]);_0x405af1[_0x9a3b('0x39')]=qs[_0x9a3b('0x37')](_['pick'](_0xfa2703['query'],_0xecc304[_0x9a3b('0x37')]));if(_0xfa2703[_0x9a3b('0x2f')][_0x9a3b('0x4c')]){_0x405af1[_0x9a3b('0x39')]=_['merge'](_0x405af1['where'],{'$or':_[_0x9a3b('0x2a')](_0x405af1['attributes'],function(_0x24b63d){var _0x19898f={};_0x19898f[_0x24b63d]={'$like':'%'+_0xfa2703[_0x9a3b('0x2f')][_0x9a3b('0x4c')]+'%'};return _0x19898f;})});}_0x405af1=_[_0x9a3b('0x3a')]({},_0x405af1,_0xfa2703[_0x9a3b('0x3d')]);return _0x159e43[_0x9a3b('0x49')](_0x405af1);}})[_0x9a3b('0x22')](function(_0x1d0a94){if(_0x1d0a94){_0x1576d7=_0x1d0a94[_0x9a3b('0x45')];if(!_0xfa2703[_0x9a3b('0x2f')]['hasOwnProperty'](_0x9a3b('0x34'))){_0x405af1['limit']=qs[_0x9a3b('0x1c')](_0xfa2703[_0x9a3b('0x2f')][_0x9a3b('0x1c')]);_0x405af1[_0x9a3b('0x1a')]=qs[_0x9a3b('0x1a')](_0xfa2703[_0x9a3b('0x2f')]['offset']);}return _0x159e43[_0x9a3b('0x49')](_0x405af1);}})[_0x9a3b('0x22')](function(_0x4be1d1){if(_0x4be1d1){return _0x4be1d1?{'count':_0x1576d7,'rows':_0x4be1d1}:null;}})['then'](respondWithResult(_0x329294,null))[_0x9a3b('0x41')](handleError(_0x329294,null));};exports['addConfiguration']=function(_0x3a06e7,_0x115f55,_0x49f4ea){if(_0x3a06e7[_0x9a3b('0x48')]['id']){delete _0x3a06e7[_0x9a3b('0x48')]['id'];}return db[_0x9a3b('0x2b')]['findOne']({'where':{'id':_0x3a06e7[_0x9a3b('0x43')]['id']}})['then'](handleEntityNotFound(_0x115f55,null))[_0x9a3b('0x22')](function(_0x1b4b04){if(_0x1b4b04){_0x3a06e7['body']['AccountId']=_0x1b4b04['id'];_0x3a06e7[_0x9a3b('0x48')][_0x9a3b('0x4d')]=integrations[_0x9a3b('0x4e')](_0x3a06e7['body'][_0x9a3b('0x4f')],_0x3a06e7[_0x9a3b('0x48')]['type']);_0x3a06e7[_0x9a3b('0x48')][_0x9a3b('0x50')]=integrations[_0x9a3b('0x51')](_0x3a06e7['body']['channel'],_0x3a06e7['body']['type']);return db[_0x9a3b('0x4b')][_0x9a3b('0x47')](_0x3a06e7[_0x9a3b('0x48')],{'include':[{'model':db[_0x9a3b('0x52')],'as':_0x9a3b('0x4d')},{'model':db[_0x9a3b('0x52')],'as':_0x9a3b('0x50')}]});}return null;})[_0x9a3b('0x22')](respondWithResult(_0x115f55,null))[_0x9a3b('0x41')](handleError(_0x115f55,null));};exports[_0x9a3b('0x53')]=function(_0x181cda,_0x43706f,_0x4011d7){var _0x26ba43='';return db['FreshdeskAccount'][_0x9a3b('0x4a')]({'where':{'id':_0x181cda[_0x9a3b('0x43')]['id']},'attributes':['id',_0x9a3b('0x54'),'apiKey']})['then'](handleEntityNotFound(_0x43706f,null))['then'](function(_0xe9acb2){if(_0xe9acb2){_0x26ba43=_0xe9acb2[_0x9a3b('0x54')];var _0x4578a9=_0x26ba43[_0x9a3b('0x55')](-0x1);if(_0x4578a9==='/'){_0x26ba43=_0x26ba43['substring'](0x0,_0x26ba43[_0x9a3b('0x56')](_0x4578a9));}return rp({'method':'GET','uri':util[_0x9a3b('0x57')](_0x9a3b('0x58'),_0x26ba43,_0x9a3b('0x59')),'headers':{'Authorization':util[_0x9a3b('0x57')](_0x9a3b('0x5a'),new Buffer(util[_0x9a3b('0x57')](_0x9a3b('0x5b'),_0xe9acb2[_0x9a3b('0x5c')]))['toString'](_0x9a3b('0x5d')))},'json':!![]});}})[_0x9a3b('0x22')](function(_0x5ad314){if(_0x5ad314){var _0x168dff=[_0x9a3b('0x5e'),_0x9a3b('0x5f'),_0x9a3b('0x60'),_0x9a3b('0x61'),'status','priority',_0x9a3b('0x62'),_0x9a3b('0x63'),_0x9a3b('0x64'),'group',_0x9a3b('0x65')];_[_0x9a3b('0x66')](_0x5ad314,function(_0x5d5ded){return _0x168dff['includes'](_0x5d5ded['name'])||!_0x5d5ded['default']&&_0x5d5ded[_0x9a3b('0x3b')]!==_0x9a3b('0x67')&&_0x5d5ded['type']!=='custom_dropdown';});return{'count':_0x5ad314[_0x9a3b('0x45')],'rows':_['map'](_0x5ad314,function(_0x519ab3){return{'id':_0x519ab3['name'],'name':_0x519ab3[_0x9a3b('0x68')],'custom':!_0x519ab3[_0x9a3b('0x69')],'options':_0x519ab3[_0x9a3b('0x6a')]?_[_0x9a3b('0x2a')](_0x519ab3[_0x9a3b('0x6a')],function(_0x4d6acd){return{'name':_['capitalize'](_0x4d6acd),'value':_0x4d6acd};}):[]};})};}})[_0x9a3b('0x22')](respondWithResult(_0x43706f,null))[_0x9a3b('0x41')](function(_0x47b60e){var _0x4d8bac=_0x181cda[_0x9a3b('0x2f')]['test']?0x1f4:_0x47b60e[_0x9a3b('0x6b')]||0x1f4;logger[_0x9a3b('0x25')](_0x9a3b('0x6c'),_0x9a3b('0x53'),_0x4d8bac,JSON[_0x9a3b('0x6d')](_0x47b60e));delete _0x47b60e[_0x9a3b('0x27')];if(_0x4d8bac===0x191){_0x4d8bac=0x190;}_0x43706f[_0x9a3b('0x19')](_0x4d8bac)['send'](_0x181cda[_0x9a3b('0x2f')][_0x9a3b('0x6e')]?{'message':_0x9a3b('0x6f'),'statusCode':_0x47b60e['statusCode']}:_0x47b60e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 131495d..8daec11 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 _0x43b1=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','api','moment','rimraf'];(function(_0x30d644,_0x2ec12){var _0x4e99f4=function(_0x5d3c46){while(--_0x5d3c46){_0x30d644['push'](_0x30d644['shift']());}};_0x4e99f4(++_0x2ec12);}(_0x43b1,0x159));var _0x143b=function(_0x1d1360,_0x6ec181){_0x1d1360=_0x1d1360-0x0;var _0x37b739=_0x43b1[_0x1d1360];return _0x37b739;};'use strict';var _=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var logger=require('../../config/logger')(_0x143b('0x2'));var moment=require(_0x143b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x143b('0x4'));var config=require(_0x143b('0x5'));var attributes=require(_0x143b('0x6'));var integrations=require(_0x143b('0x7'));module[_0x143b('0x8')]=function(_0x404a6c,_0x5aa8bb){return _0x404a6c[_0x143b('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc0=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15ef7f,_0x4fb36d){var _0x5a6459=function(_0x5d7484){while(--_0x5d7484){_0x15ef7f['push'](_0x15ef7f['shift']());}};_0x5a6459(++_0x4fb36d);}(_0xafc0,0x166));var _0x0afc=function(_0x299312,_0x42f5fe){_0x299312=_0x299312-0x0;var _0x7d4d37=_0xafc0[_0x299312];return _0x7d4d37;};'use strict';var _=require(_0x0afc('0x0'));var util=require('util');var logger=require(_0x0afc('0x1'))(_0x0afc('0x2'));var moment=require(_0x0afc('0x3'));var BPromise=require(_0x0afc('0x4'));var rp=require(_0x0afc('0x5'));var fs=require('fs');var path=require(_0x0afc('0x6'));var rimraf=require(_0x0afc('0x7'));var config=require(_0x0afc('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0afc('0x9'));module[_0x0afc('0xa')]=function(_0x57d4b1,_0x17ecea){return _0x57d4b1[_0x0afc('0xb')](_0x0afc('0xc'),attributes,{'tableName':_0x0afc('0xd'),'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 072458a..1d01a82 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 _0xaccf=['../../config/logger','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','raw','options','attributes','map','include','model','ShowFreshdeskAccount','find','where','info','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4ed8f3,_0x3807ad){var _0x316395=function(_0x186459){while(--_0x186459){_0x4ed8f3['push'](_0x4ed8f3['shift']());}};_0x316395(++_0x3807ad);}(_0xaccf,0x182));var _0xfacc=function(_0x4f116c,_0x44f323){_0x4f116c=_0x4f116c-0x0;var _0xfeea8b=_0xaccf[_0x4f116c];return _0xfeea8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfacc('0x0'));var BPromise=require(_0xfacc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfacc('0x2'));var db=require(_0xfacc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfacc('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfacc('0x5'));var client=jayson[_0xfacc('0x6')][_0xfacc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x87058c,_0x133f38,_0x25bcf9){return new BPromise(function(_0xe6690,_0x1f9195){return client[_0xfacc('0x8')](_0x87058c,_0x25bcf9)[_0xfacc('0x9')](function(_0x1349dc){logger['info'](_0xfacc('0xa'),_0x133f38,_0xfacc('0xb'));logger[_0xfacc('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x133f38,_0xfacc('0xb'),JSON[_0xfacc('0xd')](_0x1349dc));if(_0x1349dc[_0xfacc('0xe')]){if(_0x1349dc[_0xfacc('0xe')][_0xfacc('0xf')]===0x1f4){logger['error'](_0xfacc('0xa'),_0x133f38,_0x1349dc[_0xfacc('0xe')]['message']);return _0x1f9195(_0x1349dc[_0xfacc('0xe')][_0xfacc('0x10')]);}logger[_0xfacc('0xe')](_0xfacc('0xa'),_0x133f38,_0x1349dc[_0xfacc('0xe')][_0xfacc('0x10')]);return _0xe6690(_0x1349dc[_0xfacc('0xe')][_0xfacc('0x10')]);}else{logger['info'](_0xfacc('0xa'),_0x133f38,_0xfacc('0xb'));_0xe6690(_0x1349dc['result'][_0xfacc('0x10')]);}})[_0xfacc('0x11')](function(_0x19845b){logger[_0xfacc('0xe')](_0xfacc('0xa'),_0x133f38,_0x19845b);_0x1f9195(_0x19845b);});});}exports[_0xfacc('0x12')]=function(_0x19b094){var _0x3807e8=this;return new Promise(function(_0x583f51,_0x5d82bd){return db[_0xfacc('0x13')]['findAll']({'raw':_0x19b094['options']?_0x19b094['options'][_0xfacc('0x14')]===undefined?!![]:![]:!![],'where':_0x19b094[_0xfacc('0x15')]?_0x19b094[_0xfacc('0x15')]['where']||null:null,'attributes':_0x19b094['options']?_0x19b094[_0xfacc('0x15')][_0xfacc('0x16')]||null:null,'limit':_0x19b094['options']?_0x19b094[_0xfacc('0x15')]['limit']||null:null,'include':_0x19b094[_0xfacc('0x15')]?_0x19b094['options']['include']?_[_0xfacc('0x17')](_0x19b094[_0xfacc('0x15')][_0xfacc('0x18')],function(_0x529282){return{'model':db[_0x529282[_0xfacc('0x19')]],'as':_0x529282['as'],'attributes':_0x529282[_0xfacc('0x16')],'include':_0x529282[_0xfacc('0x18')]?_[_0xfacc('0x17')](_0x529282[_0xfacc('0x18')],function(_0x59dd4d){return{'model':db[_0x59dd4d[_0xfacc('0x19')]],'as':_0x59dd4d['as'],'attributes':_0x59dd4d[_0xfacc('0x16')],'include':_0x59dd4d[_0xfacc('0x18')]?_['map'](_0x59dd4d[_0xfacc('0x18')],function(_0xa7bd52){return{'model':db[_0xa7bd52['model']],'as':_0xa7bd52['as'],'attributes':_0xa7bd52[_0xfacc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfacc('0x9')](function(_0x1f1111){logger['info'](_0xfacc('0x12'),_0x19b094);logger[_0xfacc('0xc')](_0xfacc('0x12'),_0x19b094,JSON[_0xfacc('0xd')](_0x1f1111));_0x583f51(_0x1f1111);})[_0xfacc('0x11')](function(_0x173f25){logger['error']('GetFreshdeskAccount',_0x173f25['message'],_0x19b094);_0x5d82bd(_0x3807e8['error'](0x1f4,_0x173f25[_0xfacc('0x10')]));});});};exports[_0xfacc('0x1a')]=function(_0x3ca79d){var _0x36739a=this;return new Promise(function(_0x12c47a,_0x33bf9){return db[_0xfacc('0x13')][_0xfacc('0x1b')]({'raw':_0x3ca79d[_0xfacc('0x15')]?_0x3ca79d[_0xfacc('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3ca79d[_0xfacc('0x15')]?_0x3ca79d[_0xfacc('0x15')][_0xfacc('0x1c')]||null:null,'attributes':_0x3ca79d[_0xfacc('0x15')]?_0x3ca79d[_0xfacc('0x15')][_0xfacc('0x16')]||null:null,'include':_0x3ca79d[_0xfacc('0x15')]?_0x3ca79d[_0xfacc('0x15')][_0xfacc('0x18')]?_['map'](_0x3ca79d[_0xfacc('0x15')][_0xfacc('0x18')],function(_0x15753c){return{'model':db[_0x15753c[_0xfacc('0x19')]],'as':_0x15753c['as'],'attributes':_0x15753c[_0xfacc('0x16')],'include':_0x15753c[_0xfacc('0x18')]?_[_0xfacc('0x17')](_0x15753c[_0xfacc('0x18')],function(_0x484427){return{'model':db[_0x484427['model']],'as':_0x484427['as'],'attributes':_0x484427[_0xfacc('0x16')],'include':_0x484427[_0xfacc('0x18')]?_[_0xfacc('0x17')](_0x484427[_0xfacc('0x18')],function(_0x1225bf){return{'model':db[_0x1225bf[_0xfacc('0x19')]],'as':_0x1225bf['as'],'attributes':_0x1225bf[_0xfacc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfacc('0x9')](function(_0x51f0a2){logger[_0xfacc('0x1d')](_0xfacc('0x1a'),_0x3ca79d);logger[_0xfacc('0xc')](_0xfacc('0x1a'),_0x3ca79d,JSON[_0xfacc('0xd')](_0x51f0a2));_0x12c47a(_0x51f0a2);})['catch'](function(_0x18ee1b){logger['error']('ShowFreshdeskAccount',_0x18ee1b[_0xfacc('0x10')],_0x3ca79d);_0x33bf9(_0x36739a[_0xfacc('0xe')](0x1f4,_0x18ee1b[_0xfacc('0x10')]));});});}; \ No newline at end of file +var _0x33bf=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','then','ShowFreshdeskAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent'];(function(_0x588783,_0x550af0){var _0x146ed6=function(_0x27ffe9){while(--_0x27ffe9){_0x588783['push'](_0x588783['shift']());}};_0x146ed6(++_0x550af0);}(_0x33bf,0x125));var _0xf33b=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x33bf[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0xf33b('0x0'));var util=require(_0xf33b('0x1'));var moment=require(_0xf33b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf33b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf33b('0x4'))['db'];var utils=require(_0xf33b('0x5'));var logger=require('../../config/logger')(_0xf33b('0x6'));var config=require(_0xf33b('0x7'));var jayson=require(_0xf33b('0x8'));var client=jayson[_0xf33b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1afed3,_0x140a99,_0x45dab3){return new BPromise(function(_0x243806,_0x25c259){return client[_0xf33b('0xa')](_0x1afed3,_0x45dab3)['then'](function(_0x47a1de){logger[_0xf33b('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x140a99,_0xf33b('0xc'));logger[_0xf33b('0xd')](_0xf33b('0xe'),_0x140a99,_0xf33b('0xc'),JSON[_0xf33b('0xf')](_0x47a1de));if(_0x47a1de[_0xf33b('0x10')]){if(_0x47a1de['error'][_0xf33b('0x11')]===0x1f4){logger[_0xf33b('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x140a99,_0x47a1de[_0xf33b('0x10')][_0xf33b('0x12')]);return _0x25c259(_0x47a1de[_0xf33b('0x10')][_0xf33b('0x12')]);}logger[_0xf33b('0x10')](_0xf33b('0x13'),_0x140a99,_0x47a1de[_0xf33b('0x10')]['message']);return _0x243806(_0x47a1de[_0xf33b('0x10')]['message']);}else{logger['info'](_0xf33b('0x13'),_0x140a99,'request\x20sent');_0x243806(_0x47a1de[_0xf33b('0x14')][_0xf33b('0x12')]);}})[_0xf33b('0x15')](function(_0x36d5b1){logger[_0xf33b('0x10')](_0xf33b('0x13'),_0x140a99,_0x36d5b1);_0x25c259(_0x36d5b1);});});}exports[_0xf33b('0x16')]=function(_0x2c3459){var _0x5164cc=this;return new Promise(function(_0x6cf33e,_0x546762){return db[_0xf33b('0x17')][_0xf33b('0x18')]({'raw':_0x2c3459[_0xf33b('0x19')]?_0x2c3459['options'][_0xf33b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c3459[_0xf33b('0x19')]?_0x2c3459[_0xf33b('0x19')][_0xf33b('0x1b')]||null:null,'attributes':_0x2c3459['options']?_0x2c3459[_0xf33b('0x19')]['attributes']||null:null,'limit':_0x2c3459[_0xf33b('0x19')]?_0x2c3459[_0xf33b('0x19')]['limit']||null:null,'include':_0x2c3459[_0xf33b('0x19')]?_0x2c3459['options'][_0xf33b('0x1c')]?_[_0xf33b('0x1d')](_0x2c3459[_0xf33b('0x19')][_0xf33b('0x1c')],function(_0x597a41){return{'model':db[_0x597a41[_0xf33b('0x1e')]],'as':_0x597a41['as'],'attributes':_0x597a41[_0xf33b('0x1f')],'include':_0x597a41[_0xf33b('0x1c')]?_[_0xf33b('0x1d')](_0x597a41[_0xf33b('0x1c')],function(_0x39f5ff){return{'model':db[_0x39f5ff[_0xf33b('0x1e')]],'as':_0x39f5ff['as'],'attributes':_0x39f5ff[_0xf33b('0x1f')],'include':_0x39f5ff[_0xf33b('0x1c')]?_[_0xf33b('0x1d')](_0x39f5ff[_0xf33b('0x1c')],function(_0x1c0c40){return{'model':db[_0x1c0c40[_0xf33b('0x1e')]],'as':_0x1c0c40['as'],'attributes':_0x1c0c40['attributes']};}):[]};}):[]};}):[]:[]})[_0xf33b('0x20')](function(_0x3e2aa9){logger[_0xf33b('0xb')](_0xf33b('0x16'),_0x2c3459);logger[_0xf33b('0xd')](_0xf33b('0x16'),_0x2c3459,JSON[_0xf33b('0xf')](_0x3e2aa9));_0x6cf33e(_0x3e2aa9);})['catch'](function(_0x311ae8){logger[_0xf33b('0x10')]('GetFreshdeskAccount',_0x311ae8[_0xf33b('0x12')],_0x2c3459);_0x546762(_0x5164cc[_0xf33b('0x10')](0x1f4,_0x311ae8['message']));});});};exports[_0xf33b('0x21')]=function(_0xbbe959){var _0x3a2946=this;return new Promise(function(_0xbb0217,_0x1de2eb){return db[_0xf33b('0x17')]['find']({'raw':_0xbbe959['options']?_0xbbe959[_0xf33b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xbbe959['options']?_0xbbe959['options'][_0xf33b('0x1b')]||null:null,'attributes':_0xbbe959[_0xf33b('0x19')]?_0xbbe959[_0xf33b('0x19')]['attributes']||null:null,'include':_0xbbe959[_0xf33b('0x19')]?_0xbbe959[_0xf33b('0x19')]['include']?_[_0xf33b('0x1d')](_0xbbe959[_0xf33b('0x19')][_0xf33b('0x1c')],function(_0x1e3ee0){return{'model':db[_0x1e3ee0[_0xf33b('0x1e')]],'as':_0x1e3ee0['as'],'attributes':_0x1e3ee0[_0xf33b('0x1f')],'include':_0x1e3ee0[_0xf33b('0x1c')]?_[_0xf33b('0x1d')](_0x1e3ee0['include'],function(_0x365da1){return{'model':db[_0x365da1[_0xf33b('0x1e')]],'as':_0x365da1['as'],'attributes':_0x365da1[_0xf33b('0x1f')],'include':_0x365da1['include']?_['map'](_0x365da1[_0xf33b('0x1c')],function(_0x3f3497){return{'model':db[_0x3f3497['model']],'as':_0x3f3497['as'],'attributes':_0x3f3497['attributes']};}):[]};}):[]};}):[]:[]})[_0xf33b('0x20')](function(_0x37368f){logger[_0xf33b('0xb')](_0xf33b('0x21'),_0xbbe959);logger[_0xf33b('0xd')](_0xf33b('0x21'),_0xbbe959,JSON[_0xf33b('0xf')](_0x37368f));_0xbb0217(_0x37368f);})[_0xf33b('0x15')](function(_0x2d69bc){logger[_0xf33b('0x10')](_0xf33b('0x21'),_0x2d69bc['message'],_0xbbe959);_0x1de2eb(_0x3a2946[_0xf33b('0x10')](0x1f4,_0x2d69bc['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index dac364a..885a10e 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 _0x5e4c=['util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports'];(function(_0x45b1fc,_0x8c36e6){var _0x2467c3=function(_0x26e3ca){while(--_0x26e3ca){_0x45b1fc['push'](_0x45b1fc['shift']());}};_0x2467c3(++_0x8c36e6);}(_0x5e4c,0x1db));var _0xc5e4=function(_0x15cf2f,_0xa8d67d){_0x15cf2f=_0x15cf2f-0x0;var _0x2b9687=_0x5e4c[_0x15cf2f];return _0x2b9687;};'use strict';var multer=require('multer');var util=require(_0xc5e4('0x0'));var path=require(_0xc5e4('0x1'));var timeout=require(_0xc5e4('0x2'));var express=require(_0xc5e4('0x3'));var router=express['Router']();var fs_extra=require(_0xc5e4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc5e4('0x5'));var controller=require(_0xc5e4('0x6'));router['get']('/',auth[_0xc5e4('0x7')](),controller[_0xc5e4('0x8')]);router[_0xc5e4('0x9')](_0xc5e4('0xa'),auth['isAuthenticated'](),controller[_0xc5e4('0xb')]);router[_0xc5e4('0x9')](_0xc5e4('0xc'),auth[_0xc5e4('0x7')](),controller[_0xc5e4('0xd')]);router[_0xc5e4('0x9')]('/:id/subjects',auth[_0xc5e4('0x7')](),controller['getSubjects']);router['get'](_0xc5e4('0xe'),auth[_0xc5e4('0x7')](),controller['getDescriptions']);router[_0xc5e4('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc5e4('0xf')]);router[_0xc5e4('0x10')]('/',auth[_0xc5e4('0x7')](),controller[_0xc5e4('0x11')]);router[_0xc5e4('0x10')](_0xc5e4('0x12'),auth[_0xc5e4('0x7')](),controller[_0xc5e4('0x13')]);router[_0xc5e4('0x14')]('/:id',auth[_0xc5e4('0x7')](),controller[_0xc5e4('0x15')]);router[_0xc5e4('0x16')](_0xc5e4('0xa'),auth[_0xc5e4('0x7')](),controller[_0xc5e4('0x17')]);module[_0xc5e4('0x18')]=router; \ No newline at end of file +var _0xea18=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer'];(function(_0x33cfca,_0x4440c2){var _0x49375a=function(_0x433fc3){while(--_0x433fc3){_0x33cfca['push'](_0x33cfca['shift']());}};_0x49375a(++_0x4440c2);}(_0xea18,0x81));var _0x8ea1=function(_0x307b96,_0x3e1ddb){_0x307b96=_0x307b96-0x0;var _0x44a1a6=_0xea18[_0x307b96];return _0x44a1a6;};'use strict';var multer=require(_0x8ea1('0x0'));var util=require(_0x8ea1('0x1'));var path=require('path');var timeout=require(_0x8ea1('0x2'));var express=require(_0x8ea1('0x3'));var router=express[_0x8ea1('0x4')]();var fs_extra=require(_0x8ea1('0x5'));var auth=require(_0x8ea1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea1('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x8ea1('0x8')](),controller['index']);router[_0x8ea1('0x9')](_0x8ea1('0xa'),auth['isAuthenticated'](),controller[_0x8ea1('0xb')]);router[_0x8ea1('0x9')](_0x8ea1('0xc'),auth['isAuthenticated'](),controller[_0x8ea1('0xd')]);router['get'](_0x8ea1('0xe'),auth[_0x8ea1('0x8')](),controller['getSubjects']);router[_0x8ea1('0x9')](_0x8ea1('0xf'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x10')]);router[_0x8ea1('0x9')](_0x8ea1('0x11'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x12')]);router[_0x8ea1('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8ea1('0x13')]('/:id/tags',auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x14')]);router[_0x8ea1('0x15')](_0x8ea1('0xa'),auth['isAuthenticated'](),controller[_0x8ea1('0x16')]);router[_0x8ea1('0x17')](_0x8ea1('0xa'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x18')]);module[_0x8ea1('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 14eba44..e501f6c 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 _0x145a=['sequelize','exports','STRING'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x145a,0xf9));var _0xa145=function(_0x43c0fe,_0x4bd7ee){_0x43c0fe=_0x43c0fe-0x0;var _0x2b52fe=_0x145a[_0x43c0fe];return _0x2b52fe;};'use strict';var Sequelize=require(_0xa145('0x0'));module[_0xa145('0x1')]={'name':{'type':Sequelize[_0xa145('0x2')]},'description':{'type':Sequelize[_0xa145('0x2')]}}; \ No newline at end of file +var _0xabb0=['exports','STRING','sequelize'];(function(_0x158507,_0x41b1a1){var _0x36bbd8=function(_0x486aa9){while(--_0x486aa9){_0x158507['push'](_0x158507['shift']());}};_0x36bbd8(++_0x41b1a1);}(_0xabb0,0xd1));var _0x0abb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xabb0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x0abb('0x0'));module[_0x0abb('0x1')]={'name':{'type':Sequelize[_0x0abb('0x2')]},'description':{'type':Sequelize[_0x0abb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 76ccb90..cdd89da 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 _0xe5ae=['save','update','then','end','error','stack','name','send','FreshdeskConfiguration','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','order','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject'];(function(_0x102b00,_0x305e2d){var _0x40e551=function(_0x2354b8){while(--_0x2354b8){_0x102b00['push'](_0x102b00['shift']());}};_0x40e551(++_0x305e2d);}(_0xe5ae,0x13e));var _0xee5a=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0xe5ae[_0x5f12fd];return _0x58bd80;};'use strict';var emlformat=require(_0xee5a('0x0'));var rimraf=require(_0xee5a('0x1'));var zipdir=require(_0xee5a('0x2'));var jsonpatch=require(_0xee5a('0x3'));var rp=require('request-promise');var moment=require(_0xee5a('0x4'));var BPromise=require(_0xee5a('0x5'));var Mustache=require(_0xee5a('0x6'));var util=require('util');var path=require(_0xee5a('0x7'));var sox=require(_0xee5a('0x8'));var csv=require(_0xee5a('0x9'));var ejs=require(_0xee5a('0xa'));var fs=require('fs');var fs_extra=require(_0xee5a('0xb'));var _=require(_0xee5a('0xc'));var squel=require(_0xee5a('0xd'));var crypto=require(_0xee5a('0xe'));var jsforce=require(_0xee5a('0xf'));var deskjs=require(_0xee5a('0x10'));var toCsv=require(_0xee5a('0x9'));var querystring=require('querystring');var Papa=require(_0xee5a('0x11'));var Redis=require(_0xee5a('0x12'));var authService=require(_0xee5a('0x13'));var qs=require(_0xee5a('0x14'));var as=require(_0xee5a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee5a('0x16'))(_0xee5a('0x17'));var utils=require('../../config/utils');var config=require(_0xee5a('0x18'));var licenseUtil=require(_0xee5a('0x19'));var db=require(_0xee5a('0x1a'))['db'];function respondWithStatusCode(_0x4f38b8,_0x696e95){_0x696e95=_0x696e95||0xcc;return function(_0x28559c){if(_0x28559c){return _0x4f38b8[_0xee5a('0x1b')](_0x696e95);}return _0x4f38b8['status'](_0x696e95)['end']();};}function respondWithResult(_0x55b62f,_0x202ee0){_0x202ee0=_0x202ee0||0xc8;return function(_0xce2d70){if(_0xce2d70){return _0x55b62f['status'](_0x202ee0)[_0xee5a('0x1c')](_0xce2d70);}};}function respondWithFilteredResult(_0x3bd669,_0x5d2e30){return function(_0x5cf061){if(_0x5cf061){var _0x266800=typeof _0x5d2e30['offset']===_0xee5a('0x1d')&&typeof _0x5d2e30[_0xee5a('0x1e')]===_0xee5a('0x1d');var _0x17dc13=_0x5cf061['count'];var _0x36118a=_0x266800?0x0:_0x5d2e30[_0xee5a('0x1f')];var _0x57339b=_0x266800?_0x5cf061[_0xee5a('0x20')]:_0x5d2e30[_0xee5a('0x1f')]+_0x5d2e30[_0xee5a('0x1e')];var _0x20983d;if(_0x57339b>=_0x17dc13){_0x57339b=_0x17dc13;_0x20983d=0xc8;}else{_0x20983d=0xce;}_0x3bd669[_0xee5a('0x21')](_0x20983d);return _0x3bd669[_0xee5a('0x22')](_0xee5a('0x23'),_0x36118a+'-'+_0x57339b+'/'+_0x17dc13)['json'](_0x5cf061);}return null;};}function patchUpdates(_0x3a5cb9){return function(_0x3cc587){try{jsonpatch[_0xee5a('0x24')](_0x3cc587,_0x3a5cb9,!![]);}catch(_0x18ae71){return BPromise[_0xee5a('0x25')](_0x18ae71);}return _0x3cc587[_0xee5a('0x26')]();};}function saveUpdates(_0x36b2b0,_0x4cc512){return function(_0x254d0e){if(_0x254d0e){return _0x254d0e[_0xee5a('0x27')](_0x36b2b0)[_0xee5a('0x28')](function(_0x52bfa1){return _0x52bfa1;});}return null;};}function removeEntity(_0x1c9af2,_0x373b29){return function(_0x3df044){if(_0x3df044){return _0x3df044['destroy']()['then'](function(){_0x1c9af2[_0xee5a('0x21')](0xcc)[_0xee5a('0x29')]();});}};}function handleEntityNotFound(_0x4e069f,_0x365ed3){return function(_0x11b62d){if(!_0x11b62d){_0x4e069f[_0xee5a('0x1b')](0x194);}return _0x11b62d;};}function handleError(_0x70a5f,_0xac130a){_0xac130a=_0xac130a||0x1f4;return function(_0x426732){logger[_0xee5a('0x2a')](_0x426732[_0xee5a('0x2b')]);if(_0x426732['name']){delete _0x426732[_0xee5a('0x2c')];}_0x70a5f['status'](_0xac130a)[_0xee5a('0x2d')](_0x426732);};}exports['index']=function(_0xe91d1a,_0x5539cd){var _0x2492b5={},_0x460f00={},_0x501f7c={'count':0x0,'rows':[]};var _0x56b054=_['map'](db[_0xee5a('0x2e')]['rawAttributes'],function(_0x202e49){return{'name':_0x202e49[_0xee5a('0x2f')],'type':_0x202e49[_0xee5a('0x30')][_0xee5a('0x31')]};});_0x460f00[_0xee5a('0x32')]=_[_0xee5a('0x33')](_0x56b054,'name');_0x460f00['query']=_[_0xee5a('0x34')](_0xe91d1a[_0xee5a('0x35')]);_0x460f00['filters']=_[_0xee5a('0x36')](_0x460f00[_0xee5a('0x32')],_0x460f00[_0xee5a('0x35')]);_0x2492b5['attributes']=_['intersection'](_0x460f00['model'],qs[_0xee5a('0x37')](_0xe91d1a[_0xee5a('0x35')]['fields']));_0x2492b5[_0xee5a('0x38')]=_0x2492b5[_0xee5a('0x38')][_0xee5a('0x39')]?_0x2492b5['attributes']:_0x460f00['model'];if(!_0xe91d1a[_0xee5a('0x35')][_0xee5a('0x3a')](_0xee5a('0x3b'))){_0x2492b5[_0xee5a('0x1e')]=qs[_0xee5a('0x1e')](_0xe91d1a['query'][_0xee5a('0x1e')]);_0x2492b5['offset']=qs[_0xee5a('0x1f')](_0xe91d1a[_0xee5a('0x35')]['offset']);}_0x2492b5['order']=qs['sort'](_0xe91d1a[_0xee5a('0x35')][_0xee5a('0x3c')]);_0x2492b5[_0xee5a('0x3d')]=qs[_0xee5a('0x3e')](_[_0xee5a('0x3f')](_0xe91d1a[_0xee5a('0x35')],_0x460f00[_0xee5a('0x3e')]),_0x56b054);if(_0xe91d1a['query'][_0xee5a('0x40')]){_0x2492b5[_0xee5a('0x3d')]=_[_0xee5a('0x41')](_0x2492b5['where'],{'$or':_[_0xee5a('0x33')](_0x56b054,function(_0x26f13b){if(_0x26f13b[_0xee5a('0x30')]!==_0xee5a('0x42')){var _0x4bc0a1={};_0x4bc0a1[_0x26f13b[_0xee5a('0x2c')]]={'$like':'%'+_0xe91d1a['query'][_0xee5a('0x40')]+'%'};return _0x4bc0a1;}})});}_0x2492b5=_[_0xee5a('0x41')]({},_0x2492b5,_0xe91d1a[_0xee5a('0x43')]);var _0x108b63={'where':_0x2492b5[_0xee5a('0x3d')]};return db['FreshdeskConfiguration']['count'](_0x108b63)[_0xee5a('0x28')](function(_0xbd5901){_0x501f7c[_0xee5a('0x20')]=_0xbd5901;if(_0xe91d1a[_0xee5a('0x35')][_0xee5a('0x44')]){_0x2492b5[_0xee5a('0x45')]=[{'all':!![]}];}return db[_0xee5a('0x2e')][_0xee5a('0x46')](_0x2492b5);})[_0xee5a('0x28')](function(_0xcb6a82){_0x501f7c[_0xee5a('0x47')]=_0xcb6a82;return _0x501f7c;})[_0xee5a('0x28')](respondWithFilteredResult(_0x5539cd,_0x2492b5))['catch'](handleError(_0x5539cd,null));};exports[_0xee5a('0x48')]=function(_0x3402a4,_0x244e40){var _0x30371f={'raw':![],'where':{'id':_0x3402a4[_0xee5a('0x49')]['id']}},_0x4d0042={};_0x4d0042[_0xee5a('0x32')]=_['keys'](db[_0xee5a('0x2e')][_0xee5a('0x4a')]);_0x4d0042[_0xee5a('0x35')]=_[_0xee5a('0x34')](_0x3402a4[_0xee5a('0x35')]);_0x4d0042[_0xee5a('0x3e')]=_[_0xee5a('0x36')](_0x4d0042['model'],_0x4d0042[_0xee5a('0x35')]);_0x30371f[_0xee5a('0x38')]=_[_0xee5a('0x36')](_0x4d0042['model'],qs[_0xee5a('0x37')](_0x3402a4[_0xee5a('0x35')][_0xee5a('0x37')]));_0x30371f[_0xee5a('0x38')]=_0x30371f[_0xee5a('0x38')][_0xee5a('0x39')]?_0x30371f[_0xee5a('0x38')]:_0x4d0042[_0xee5a('0x32')];if(_0x3402a4[_0xee5a('0x35')][_0xee5a('0x44')]){_0x30371f['include']=[{'all':!![]}];}_0x30371f=_[_0xee5a('0x41')]({},_0x30371f,_0x3402a4[_0xee5a('0x43')]);return db[_0xee5a('0x2e')][_0xee5a('0x4b')](_0x30371f)[_0xee5a('0x28')](handleEntityNotFound(_0x244e40,null))[_0xee5a('0x28')](respondWithResult(_0x244e40,null))[_0xee5a('0x4c')](handleError(_0x244e40,null));};exports[_0xee5a('0x4d')]=function(_0x54f9af,_0x307617){return db[_0xee5a('0x2e')][_0xee5a('0x4d')](_0x54f9af['body'],{})[_0xee5a('0x28')](respondWithResult(_0x307617,0xc9))[_0xee5a('0x4c')](handleError(_0x307617,null));};exports[_0xee5a('0x27')]=function(_0x41e48a,_0x49552e){if(_0x41e48a[_0xee5a('0x4e')]['id']){delete _0x41e48a['body']['id'];}return db[_0xee5a('0x2e')][_0xee5a('0x4b')]({'where':{'id':_0x41e48a[_0xee5a('0x49')]['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x49552e,null))[_0xee5a('0x28')](saveUpdates(_0x41e48a[_0xee5a('0x4e')],null))[_0xee5a('0x28')](respondWithResult(_0x49552e,null))[_0xee5a('0x4c')](handleError(_0x49552e,null));};exports[_0xee5a('0x4f')]=function(_0x3afa99,_0x2d9274){return db[_0xee5a('0x2e')]['find']({'where':{'id':_0x3afa99['params']['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x2d9274,null))[_0xee5a('0x28')](removeEntity(_0x2d9274,null))['catch'](handleError(_0x2d9274,null));};exports['getFields']=function(_0x2c816b,_0x4dc0d4,_0x3778e7){var _0x25189e={};var _0xaf2ff2={};var _0x14e4d1;var _0x2e1464;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2c816b[_0xee5a('0x49')]['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x4dc0d4,null))[_0xee5a('0x28')](function(_0x567a1d){if(_0x567a1d){_0x14e4d1=_0x567a1d;_0xaf2ff2['model']=_[_0xee5a('0x34')](db['FreshdeskField'][_0xee5a('0x4a')]);_0xaf2ff2['query']=_[_0xee5a('0x34')](_0x2c816b[_0xee5a('0x35')]);_0xaf2ff2[_0xee5a('0x3e')]=_[_0xee5a('0x36')](_0xaf2ff2[_0xee5a('0x32')],_0xaf2ff2['query']);_0x25189e[_0xee5a('0x38')]=_[_0xee5a('0x36')](_0xaf2ff2[_0xee5a('0x32')],qs[_0xee5a('0x37')](_0x2c816b[_0xee5a('0x35')][_0xee5a('0x37')]));_0x25189e[_0xee5a('0x38')]=_0x25189e['attributes'][_0xee5a('0x39')]?_0x25189e[_0xee5a('0x38')]:_0xaf2ff2['model'];_0x25189e[_0xee5a('0x50')]=qs[_0xee5a('0x3c')](_0x2c816b[_0xee5a('0x35')][_0xee5a('0x3c')]);_0x25189e[_0xee5a('0x3d')]=qs[_0xee5a('0x3e')](_[_0xee5a('0x3f')](_0x2c816b[_0xee5a('0x35')],_0xaf2ff2[_0xee5a('0x3e')]));if(_0x2c816b[_0xee5a('0x35')]['filter']){_0x25189e[_0xee5a('0x3d')]=_[_0xee5a('0x41')](_0x25189e[_0xee5a('0x3d')],{'$or':_['map'](_0x25189e[_0xee5a('0x38')],function(_0x1bb543){var _0x51cc10={};_0x51cc10[_0x1bb543]={'$like':'%'+_0x2c816b[_0xee5a('0x35')]['filter']+'%'};return _0x51cc10;})});}_0x25189e=_[_0xee5a('0x41')]({},_0x25189e,_0x2c816b[_0xee5a('0x43')]);return _0x14e4d1[_0xee5a('0x51')](_0x25189e);}})[_0xee5a('0x28')](function(_0x348db3){if(_0x348db3){_0x2e1464=_0x348db3[_0xee5a('0x39')];if(!_0x2c816b[_0xee5a('0x35')][_0xee5a('0x3a')]('nolimit')){_0x25189e[_0xee5a('0x1e')]=qs[_0xee5a('0x1e')](_0x2c816b[_0xee5a('0x35')][_0xee5a('0x1e')]);_0x25189e[_0xee5a('0x1f')]=qs[_0xee5a('0x1f')](_0x2c816b[_0xee5a('0x35')][_0xee5a('0x1f')]);}return _0x14e4d1[_0xee5a('0x51')](_0x25189e);}})[_0xee5a('0x28')](function(_0x3a45c8){if(_0x3a45c8){return _0x3a45c8?{'count':_0x2e1464,'rows':_0x3a45c8}:null;}})[_0xee5a('0x28')](respondWithResult(_0x4dc0d4,null))['catch'](handleError(_0x4dc0d4,null));};exports['getSubjects']=function(_0x39a35a,_0x74c58f,_0x1a096f){var _0x50b1f4={};var _0x482136={};var _0x387ecb;var _0x25b519;return db[_0xee5a('0x2e')][_0xee5a('0x52')]({'where':{'id':_0x39a35a['params']['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x74c58f,null))['then'](function(_0x137f09){if(_0x137f09){_0x387ecb=_0x137f09;_0x482136[_0xee5a('0x32')]=_['keys'](db[_0xee5a('0x53')][_0xee5a('0x4a')]);_0x482136['query']=_['keys'](_0x39a35a[_0xee5a('0x35')]);_0x482136[_0xee5a('0x3e')]=_[_0xee5a('0x36')](_0x482136[_0xee5a('0x32')],_0x482136['query']);_0x50b1f4[_0xee5a('0x38')]=_[_0xee5a('0x36')](_0x482136[_0xee5a('0x32')],qs['fields'](_0x39a35a[_0xee5a('0x35')]['fields']));_0x50b1f4[_0xee5a('0x38')]=_0x50b1f4[_0xee5a('0x38')][_0xee5a('0x39')]?_0x50b1f4[_0xee5a('0x38')]:_0x482136[_0xee5a('0x32')];_0x50b1f4[_0xee5a('0x50')]=qs['sort'](_0x39a35a[_0xee5a('0x35')][_0xee5a('0x3c')]);_0x50b1f4[_0xee5a('0x3d')]=qs[_0xee5a('0x3e')](_[_0xee5a('0x3f')](_0x39a35a[_0xee5a('0x35')],_0x482136[_0xee5a('0x3e')]));if(_0x39a35a['query']['filter']){_0x50b1f4[_0xee5a('0x3d')]=_['merge'](_0x50b1f4[_0xee5a('0x3d')],{'$or':_[_0xee5a('0x33')](_0x50b1f4[_0xee5a('0x38')],function(_0x215ba7){var _0x21a587={};_0x21a587[_0x215ba7]={'$like':'%'+_0x39a35a['query'][_0xee5a('0x40')]+'%'};return _0x21a587;})});}_0x50b1f4=_[_0xee5a('0x41')]({},_0x50b1f4,_0x39a35a[_0xee5a('0x43')]);return _0x387ecb[_0xee5a('0x54')](_0x50b1f4);}})[_0xee5a('0x28')](function(_0x4d8385){if(_0x4d8385){_0x25b519=_0x4d8385[_0xee5a('0x39')];if(!_0x39a35a[_0xee5a('0x35')][_0xee5a('0x3a')](_0xee5a('0x3b'))){_0x50b1f4[_0xee5a('0x1e')]=qs[_0xee5a('0x1e')](_0x39a35a['query'][_0xee5a('0x1e')]);_0x50b1f4['offset']=qs[_0xee5a('0x1f')](_0x39a35a[_0xee5a('0x35')]['offset']);}return _0x387ecb[_0xee5a('0x54')](_0x50b1f4);}})[_0xee5a('0x28')](function(_0x1bab40){if(_0x1bab40){return _0x1bab40?{'count':_0x25b519,'rows':_0x1bab40}:null;}})['then'](respondWithResult(_0x74c58f,null))[_0xee5a('0x4c')](handleError(_0x74c58f,null));};exports['getDescriptions']=function(_0xfc13f4,_0x4325ba,_0x181807){var _0x4f0648={};var _0x452476={};var _0x5acae7;var _0x520a72;return db[_0xee5a('0x2e')][_0xee5a('0x52')]({'where':{'id':_0xfc13f4[_0xee5a('0x49')]['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x4325ba,null))[_0xee5a('0x28')](function(_0x15b6cc){if(_0x15b6cc){_0x5acae7=_0x15b6cc;_0x452476[_0xee5a('0x32')]=_['keys'](db[_0xee5a('0x53')][_0xee5a('0x4a')]);_0x452476['query']=_['keys'](_0xfc13f4[_0xee5a('0x35')]);_0x452476[_0xee5a('0x3e')]=_[_0xee5a('0x36')](_0x452476[_0xee5a('0x32')],_0x452476[_0xee5a('0x35')]);_0x4f0648[_0xee5a('0x38')]=_['intersection'](_0x452476[_0xee5a('0x32')],qs[_0xee5a('0x37')](_0xfc13f4[_0xee5a('0x35')][_0xee5a('0x37')]));_0x4f0648[_0xee5a('0x38')]=_0x4f0648[_0xee5a('0x38')][_0xee5a('0x39')]?_0x4f0648['attributes']:_0x452476[_0xee5a('0x32')];_0x4f0648[_0xee5a('0x50')]=qs[_0xee5a('0x3c')](_0xfc13f4['query'][_0xee5a('0x3c')]);_0x4f0648[_0xee5a('0x3d')]=qs['filters'](_[_0xee5a('0x3f')](_0xfc13f4[_0xee5a('0x35')],_0x452476['filters']));if(_0xfc13f4['query'][_0xee5a('0x40')]){_0x4f0648[_0xee5a('0x3d')]=_[_0xee5a('0x41')](_0x4f0648[_0xee5a('0x3d')],{'$or':_[_0xee5a('0x33')](_0x4f0648[_0xee5a('0x38')],function(_0x11d478){var _0xf67b7a={};_0xf67b7a[_0x11d478]={'$like':'%'+_0xfc13f4['query']['filter']+'%'};return _0xf67b7a;})});}_0x4f0648=_[_0xee5a('0x41')]({},_0x4f0648,_0xfc13f4[_0xee5a('0x43')]);return _0x5acae7[_0xee5a('0x55')](_0x4f0648);}})[_0xee5a('0x28')](function(_0x48bc6f){if(_0x48bc6f){_0x520a72=_0x48bc6f['length'];if(!_0xfc13f4['query'][_0xee5a('0x3a')](_0xee5a('0x3b'))){_0x4f0648[_0xee5a('0x1e')]=qs[_0xee5a('0x1e')](_0xfc13f4[_0xee5a('0x35')][_0xee5a('0x1e')]);_0x4f0648[_0xee5a('0x1f')]=qs[_0xee5a('0x1f')](_0xfc13f4[_0xee5a('0x35')]['offset']);}return _0x5acae7[_0xee5a('0x55')](_0x4f0648);}})[_0xee5a('0x28')](function(_0x2a7594){if(_0x2a7594){return _0x2a7594?{'count':_0x520a72,'rows':_0x2a7594}:null;}})['then'](respondWithResult(_0x4325ba,null))[_0xee5a('0x4c')](handleError(_0x4325ba,null));};exports[_0xee5a('0x56')]=function(_0xec76b7,_0x316ac2,_0x203856){var _0x13c3c7={};var _0x2bbc01={};var _0x22ce67;var _0x192bc2;return db[_0xee5a('0x2e')][_0xee5a('0x52')]({'where':{'id':_0xec76b7[_0xee5a('0x49')]['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x316ac2,null))['then'](function(_0x4bd0ee){if(_0x4bd0ee){_0x22ce67=_0x4bd0ee;_0x2bbc01['model']=_[_0xee5a('0x34')](db[_0xee5a('0x57')][_0xee5a('0x4a')]);_0x2bbc01[_0xee5a('0x35')]=_['keys'](_0xec76b7[_0xee5a('0x35')]);_0x2bbc01[_0xee5a('0x3e')]=_[_0xee5a('0x36')](_0x2bbc01[_0xee5a('0x32')],_0x2bbc01[_0xee5a('0x35')]);_0x13c3c7[_0xee5a('0x38')]=_[_0xee5a('0x36')](_0x2bbc01[_0xee5a('0x32')],qs[_0xee5a('0x37')](_0xec76b7[_0xee5a('0x35')][_0xee5a('0x37')]));_0x13c3c7['attributes']=_0x13c3c7['attributes'][_0xee5a('0x39')]?_0x13c3c7[_0xee5a('0x38')]:_0x2bbc01['model'];_0x13c3c7[_0xee5a('0x50')]=qs[_0xee5a('0x3c')](_0xec76b7[_0xee5a('0x35')]['sort']);_0x13c3c7[_0xee5a('0x3d')]=qs['filters'](_['pick'](_0xec76b7['query'],_0x2bbc01[_0xee5a('0x3e')]));if(_0xec76b7[_0xee5a('0x35')]['filter']){_0x13c3c7[_0xee5a('0x3d')]=_[_0xee5a('0x41')](_0x13c3c7[_0xee5a('0x3d')],{'$or':_['map'](_0x13c3c7['attributes'],function(_0x3a505d){var _0x242cef={};_0x242cef[_0x3a505d]={'$like':'%'+_0xec76b7['query'][_0xee5a('0x40')]+'%'};return _0x242cef;})});}_0x13c3c7=_['merge']({},_0x13c3c7,_0xec76b7[_0xee5a('0x43')]);return _0x22ce67['getTags'](_0x13c3c7);}})[_0xee5a('0x28')](function(_0x3c3a42){if(_0x3c3a42){_0x192bc2=_0x3c3a42[_0xee5a('0x39')];if(!_0xec76b7[_0xee5a('0x35')][_0xee5a('0x3a')](_0xee5a('0x3b'))){_0x13c3c7[_0xee5a('0x1e')]=qs[_0xee5a('0x1e')](_0xec76b7[_0xee5a('0x35')][_0xee5a('0x1e')]);_0x13c3c7[_0xee5a('0x1f')]=qs[_0xee5a('0x1f')](_0xec76b7['query']['offset']);}return _0x22ce67[_0xee5a('0x56')](_0x13c3c7);}})[_0xee5a('0x28')](function(_0xa787cd){if(_0xa787cd){return _0xa787cd?{'count':_0x192bc2,'rows':_0xa787cd}:null;}})['then'](respondWithResult(_0x316ac2,null))['catch'](handleError(_0x316ac2,null));};exports['setTags']=function(_0x4f8858,_0x330797,_0x4ec185){if(_0x4f8858[_0xee5a('0x4e')]['id']){delete _0x4f8858[_0xee5a('0x4e')]['id'];}return db[_0xee5a('0x2e')][_0xee5a('0x52')]({'where':{'id':_0x4f8858[_0xee5a('0x49')]['id']}})[_0xee5a('0x28')](handleEntityNotFound(_0x330797,null))[_0xee5a('0x28')](function(_0x1e1db5){if(_0x1e1db5){return _0x1e1db5['setTags'](_0x4f8858[_0xee5a('0x4e')][_0xee5a('0x58')]||[]);}return null;})['then'](respondWithResult(_0x330797,null))[_0xee5a('0x4c')](handleError(_0x330797,null));}; \ No newline at end of file +var _0xc99f=['offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','map','FreshdeskConfiguration','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','nolimit','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc99f,0x12f));var _0xfc99=function(_0x45e647,_0x2c482c){_0x45e647=_0x45e647-0x0;var _0x2deace=_0xc99f[_0x45e647];return _0x2deace;};'use strict';var emlformat=require(_0xfc99('0x0'));var rimraf=require(_0xfc99('0x1'));var zipdir=require(_0xfc99('0x2'));var jsonpatch=require(_0xfc99('0x3'));var rp=require(_0xfc99('0x4'));var moment=require(_0xfc99('0x5'));var BPromise=require(_0xfc99('0x6'));var Mustache=require(_0xfc99('0x7'));var util=require('util');var path=require(_0xfc99('0x8'));var sox=require('sox');var csv=require(_0xfc99('0x9'));var ejs=require(_0xfc99('0xa'));var fs=require('fs');var fs_extra=require(_0xfc99('0xb'));var _=require(_0xfc99('0xc'));var squel=require(_0xfc99('0xd'));var crypto=require('crypto');var jsforce=require(_0xfc99('0xe'));var deskjs=require(_0xfc99('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfc99('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc99('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfc99('0x12'));var as=require(_0xfc99('0x13'));var hardwareService=require(_0xfc99('0x14'));var logger=require(_0xfc99('0x15'))(_0xfc99('0x16'));var utils=require('../../config/utils');var config=require(_0xfc99('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfc99('0x18'))['db'];function respondWithStatusCode(_0x50e8ae,_0x4fb66a){_0x4fb66a=_0x4fb66a||0xcc;return function(_0x5723a5){if(_0x5723a5){return _0x50e8ae[_0xfc99('0x19')](_0x4fb66a);}return _0x50e8ae[_0xfc99('0x1a')](_0x4fb66a)[_0xfc99('0x1b')]();};}function respondWithResult(_0x3e1cca,_0x41d628){_0x41d628=_0x41d628||0xc8;return function(_0x36c516){if(_0x36c516){return _0x3e1cca[_0xfc99('0x1a')](_0x41d628)[_0xfc99('0x1c')](_0x36c516);}};}function respondWithFilteredResult(_0x1c89e5,_0x5dd10c){return function(_0x22696c){if(_0x22696c){var _0x5af2bc=typeof _0x5dd10c[_0xfc99('0x1d')]===_0xfc99('0x1e')&&typeof _0x5dd10c[_0xfc99('0x1f')]==='undefined';var _0x1779f2=_0x22696c[_0xfc99('0x20')];var _0x4acd75=_0x5af2bc?0x0:_0x5dd10c[_0xfc99('0x1d')];var _0x2beecb=_0x5af2bc?_0x22696c[_0xfc99('0x20')]:_0x5dd10c['offset']+_0x5dd10c[_0xfc99('0x1f')];var _0x27713c;if(_0x2beecb>=_0x1779f2){_0x2beecb=_0x1779f2;_0x27713c=0xc8;}else{_0x27713c=0xce;}_0x1c89e5[_0xfc99('0x1a')](_0x27713c);return _0x1c89e5[_0xfc99('0x21')](_0xfc99('0x22'),_0x4acd75+'-'+_0x2beecb+'/'+_0x1779f2)[_0xfc99('0x1c')](_0x22696c);}return null;};}function patchUpdates(_0x26e3ed){return function(_0x3c7fea){try{jsonpatch['apply'](_0x3c7fea,_0x26e3ed,!![]);}catch(_0x4c5bc7){return BPromise[_0xfc99('0x23')](_0x4c5bc7);}return _0x3c7fea['save']();};}function saveUpdates(_0x19c576,_0x31084f){return function(_0x183f5f){if(_0x183f5f){return _0x183f5f[_0xfc99('0x24')](_0x19c576)['then'](function(_0x157d3d){return _0x157d3d;});}return null;};}function removeEntity(_0x141fde,_0xc63de7){return function(_0x43dc2e){if(_0x43dc2e){return _0x43dc2e[_0xfc99('0x25')]()[_0xfc99('0x26')](function(){_0x141fde[_0xfc99('0x1a')](0xcc)[_0xfc99('0x1b')]();});}};}function handleEntityNotFound(_0x10f6e8,_0x58a211){return function(_0x5b419d){if(!_0x5b419d){_0x10f6e8[_0xfc99('0x19')](0x194);}return _0x5b419d;};}function handleError(_0x421d99,_0x1fb832){_0x1fb832=_0x1fb832||0x1f4;return function(_0x587805){logger[_0xfc99('0x27')](_0x587805[_0xfc99('0x28')]);if(_0x587805[_0xfc99('0x29')]){delete _0x587805['name'];}_0x421d99['status'](_0x1fb832)['send'](_0x587805);};}exports['index']=function(_0x4d5ff8,_0x3c6d25){var _0x3f6a2c={},_0x4bb916={},_0x3f46f9={'count':0x0,'rows':[]};var _0x447c5c=_[_0xfc99('0x2a')](db[_0xfc99('0x2b')][_0xfc99('0x2c')],function(_0x2e95a5){return{'name':_0x2e95a5['fieldName'],'type':_0x2e95a5['type'][_0xfc99('0x2d')]};});_0x4bb916['model']=_[_0xfc99('0x2a')](_0x447c5c,_0xfc99('0x29'));_0x4bb916[_0xfc99('0x2e')]=_[_0xfc99('0x2f')](_0x4d5ff8[_0xfc99('0x2e')]);_0x4bb916['filters']=_['intersection'](_0x4bb916[_0xfc99('0x30')],_0x4bb916[_0xfc99('0x2e')]);_0x3f6a2c['attributes']=_[_0xfc99('0x31')](_0x4bb916[_0xfc99('0x30')],qs[_0xfc99('0x32')](_0x4d5ff8[_0xfc99('0x2e')][_0xfc99('0x32')]));_0x3f6a2c[_0xfc99('0x33')]=_0x3f6a2c[_0xfc99('0x33')][_0xfc99('0x34')]?_0x3f6a2c['attributes']:_0x4bb916[_0xfc99('0x30')];if(!_0x4d5ff8[_0xfc99('0x2e')][_0xfc99('0x35')]('nolimit')){_0x3f6a2c['limit']=qs['limit'](_0x4d5ff8[_0xfc99('0x2e')]['limit']);_0x3f6a2c['offset']=qs[_0xfc99('0x1d')](_0x4d5ff8['query'][_0xfc99('0x1d')]);}_0x3f6a2c[_0xfc99('0x36')]=qs[_0xfc99('0x37')](_0x4d5ff8[_0xfc99('0x2e')]['sort']);_0x3f6a2c[_0xfc99('0x38')]=qs[_0xfc99('0x39')](_[_0xfc99('0x3a')](_0x4d5ff8[_0xfc99('0x2e')],_0x4bb916[_0xfc99('0x39')]),_0x447c5c);if(_0x4d5ff8[_0xfc99('0x2e')][_0xfc99('0x3b')]){_0x3f6a2c['where']=_[_0xfc99('0x3c')](_0x3f6a2c[_0xfc99('0x38')],{'$or':_['map'](_0x447c5c,function(_0x4415eb){if(_0x4415eb[_0xfc99('0x3d')]!==_0xfc99('0x3e')){var _0x5e2e7b={};_0x5e2e7b[_0x4415eb[_0xfc99('0x29')]]={'$like':'%'+_0x4d5ff8[_0xfc99('0x2e')][_0xfc99('0x3b')]+'%'};return _0x5e2e7b;}})});}_0x3f6a2c=_[_0xfc99('0x3c')]({},_0x3f6a2c,_0x4d5ff8[_0xfc99('0x3f')]);var _0xc5e0da={'where':_0x3f6a2c['where']};return db['FreshdeskConfiguration'][_0xfc99('0x20')](_0xc5e0da)['then'](function(_0x270609){_0x3f46f9[_0xfc99('0x20')]=_0x270609;if(_0x4d5ff8[_0xfc99('0x2e')][_0xfc99('0x40')]){_0x3f6a2c[_0xfc99('0x41')]=[{'all':!![]}];}return db[_0xfc99('0x2b')][_0xfc99('0x42')](_0x3f6a2c);})[_0xfc99('0x26')](function(_0xe3ada5){_0x3f46f9['rows']=_0xe3ada5;return _0x3f46f9;})[_0xfc99('0x26')](respondWithFilteredResult(_0x3c6d25,_0x3f6a2c))[_0xfc99('0x43')](handleError(_0x3c6d25,null));};exports[_0xfc99('0x44')]=function(_0x1ab298,_0x5c7cec){var _0x1c1cb1={'raw':![],'where':{'id':_0x1ab298[_0xfc99('0x45')]['id']}},_0x44d87a={};_0x44d87a[_0xfc99('0x30')]=_[_0xfc99('0x2f')](db[_0xfc99('0x2b')]['rawAttributes']);_0x44d87a['query']=_[_0xfc99('0x2f')](_0x1ab298[_0xfc99('0x2e')]);_0x44d87a[_0xfc99('0x39')]=_['intersection'](_0x44d87a[_0xfc99('0x30')],_0x44d87a[_0xfc99('0x2e')]);_0x1c1cb1[_0xfc99('0x33')]=_[_0xfc99('0x31')](_0x44d87a['model'],qs['fields'](_0x1ab298[_0xfc99('0x2e')][_0xfc99('0x32')]));_0x1c1cb1['attributes']=_0x1c1cb1[_0xfc99('0x33')]['length']?_0x1c1cb1[_0xfc99('0x33')]:_0x44d87a[_0xfc99('0x30')];if(_0x1ab298[_0xfc99('0x2e')][_0xfc99('0x40')]){_0x1c1cb1['include']=[{'all':!![]}];}_0x1c1cb1=_[_0xfc99('0x3c')]({},_0x1c1cb1,_0x1ab298[_0xfc99('0x3f')]);return db[_0xfc99('0x2b')][_0xfc99('0x46')](_0x1c1cb1)['then'](handleEntityNotFound(_0x5c7cec,null))[_0xfc99('0x26')](respondWithResult(_0x5c7cec,null))[_0xfc99('0x43')](handleError(_0x5c7cec,null));};exports[_0xfc99('0x47')]=function(_0x45c2a9,_0x337162){return db[_0xfc99('0x2b')][_0xfc99('0x47')](_0x45c2a9[_0xfc99('0x48')],{})[_0xfc99('0x26')](respondWithResult(_0x337162,0xc9))[_0xfc99('0x43')](handleError(_0x337162,null));};exports['update']=function(_0x2701a3,_0x54cdad){if(_0x2701a3['body']['id']){delete _0x2701a3[_0xfc99('0x48')]['id'];}return db[_0xfc99('0x2b')]['find']({'where':{'id':_0x2701a3['params']['id']}})['then'](handleEntityNotFound(_0x54cdad,null))[_0xfc99('0x26')](saveUpdates(_0x2701a3[_0xfc99('0x48')],null))[_0xfc99('0x26')](respondWithResult(_0x54cdad,null))[_0xfc99('0x43')](handleError(_0x54cdad,null));};exports['destroy']=function(_0x5f4d7a,_0x31b8e9){return db[_0xfc99('0x2b')][_0xfc99('0x46')]({'where':{'id':_0x5f4d7a['params']['id']}})[_0xfc99('0x26')](handleEntityNotFound(_0x31b8e9,null))['then'](removeEntity(_0x31b8e9,null))[_0xfc99('0x43')](handleError(_0x31b8e9,null));};exports[_0xfc99('0x49')]=function(_0x18eeed,_0x23a405,_0x4892c8){var _0x167f37={};var _0x498210={};var _0xf0136c;var _0x4b9f4f;return db['FreshdeskConfiguration'][_0xfc99('0x4a')]({'where':{'id':_0x18eeed[_0xfc99('0x45')]['id']}})[_0xfc99('0x26')](handleEntityNotFound(_0x23a405,null))['then'](function(_0x15602f){if(_0x15602f){_0xf0136c=_0x15602f;_0x498210[_0xfc99('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x498210[_0xfc99('0x2e')]=_['keys'](_0x18eeed['query']);_0x498210[_0xfc99('0x39')]=_[_0xfc99('0x31')](_0x498210[_0xfc99('0x30')],_0x498210[_0xfc99('0x2e')]);_0x167f37[_0xfc99('0x33')]=_['intersection'](_0x498210['model'],qs['fields'](_0x18eeed[_0xfc99('0x2e')][_0xfc99('0x32')]));_0x167f37[_0xfc99('0x33')]=_0x167f37[_0xfc99('0x33')][_0xfc99('0x34')]?_0x167f37[_0xfc99('0x33')]:_0x498210[_0xfc99('0x30')];_0x167f37['order']=qs[_0xfc99('0x37')](_0x18eeed['query'][_0xfc99('0x37')]);_0x167f37['where']=qs[_0xfc99('0x39')](_[_0xfc99('0x3a')](_0x18eeed[_0xfc99('0x2e')],_0x498210[_0xfc99('0x39')]));if(_0x18eeed[_0xfc99('0x2e')][_0xfc99('0x3b')]){_0x167f37[_0xfc99('0x38')]=_[_0xfc99('0x3c')](_0x167f37['where'],{'$or':_[_0xfc99('0x2a')](_0x167f37['attributes'],function(_0xf19c62){var _0x2de4c8={};_0x2de4c8[_0xf19c62]={'$like':'%'+_0x18eeed[_0xfc99('0x2e')]['filter']+'%'};return _0x2de4c8;})});}_0x167f37=_[_0xfc99('0x3c')]({},_0x167f37,_0x18eeed['options']);return _0xf0136c[_0xfc99('0x49')](_0x167f37);}})['then'](function(_0x1edf47){if(_0x1edf47){_0x4b9f4f=_0x1edf47['length'];if(!_0x18eeed[_0xfc99('0x2e')][_0xfc99('0x35')](_0xfc99('0x4b'))){_0x167f37[_0xfc99('0x1f')]=qs[_0xfc99('0x1f')](_0x18eeed[_0xfc99('0x2e')][_0xfc99('0x1f')]);_0x167f37['offset']=qs[_0xfc99('0x1d')](_0x18eeed['query'][_0xfc99('0x1d')]);}return _0xf0136c[_0xfc99('0x49')](_0x167f37);}})[_0xfc99('0x26')](function(_0x44d46c){if(_0x44d46c){return _0x44d46c?{'count':_0x4b9f4f,'rows':_0x44d46c}:null;}})[_0xfc99('0x26')](respondWithResult(_0x23a405,null))[_0xfc99('0x43')](handleError(_0x23a405,null));};exports[_0xfc99('0x4c')]=function(_0x4d4f0f,_0x1a8048,_0x181802){var _0x42d561={};var _0xc447d={};var _0x3265e8;var _0xc7999c;return db[_0xfc99('0x2b')][_0xfc99('0x4a')]({'where':{'id':_0x4d4f0f[_0xfc99('0x45')]['id']}})[_0xfc99('0x26')](handleEntityNotFound(_0x1a8048,null))['then'](function(_0x4c0269){if(_0x4c0269){_0x3265e8=_0x4c0269;_0xc447d[_0xfc99('0x30')]=_[_0xfc99('0x2f')](db[_0xfc99('0x4d')][_0xfc99('0x2c')]);_0xc447d[_0xfc99('0x2e')]=_[_0xfc99('0x2f')](_0x4d4f0f[_0xfc99('0x2e')]);_0xc447d[_0xfc99('0x39')]=_['intersection'](_0xc447d[_0xfc99('0x30')],_0xc447d[_0xfc99('0x2e')]);_0x42d561[_0xfc99('0x33')]=_['intersection'](_0xc447d[_0xfc99('0x30')],qs[_0xfc99('0x32')](_0x4d4f0f[_0xfc99('0x2e')]['fields']));_0x42d561[_0xfc99('0x33')]=_0x42d561[_0xfc99('0x33')][_0xfc99('0x34')]?_0x42d561['attributes']:_0xc447d[_0xfc99('0x30')];_0x42d561[_0xfc99('0x36')]=qs[_0xfc99('0x37')](_0x4d4f0f[_0xfc99('0x2e')][_0xfc99('0x37')]);_0x42d561[_0xfc99('0x38')]=qs[_0xfc99('0x39')](_['pick'](_0x4d4f0f['query'],_0xc447d[_0xfc99('0x39')]));if(_0x4d4f0f[_0xfc99('0x2e')][_0xfc99('0x3b')]){_0x42d561[_0xfc99('0x38')]=_['merge'](_0x42d561['where'],{'$or':_['map'](_0x42d561['attributes'],function(_0x59d777){var _0x362337={};_0x362337[_0x59d777]={'$like':'%'+_0x4d4f0f[_0xfc99('0x2e')][_0xfc99('0x3b')]+'%'};return _0x362337;})});}_0x42d561=_[_0xfc99('0x3c')]({},_0x42d561,_0x4d4f0f[_0xfc99('0x3f')]);return _0x3265e8[_0xfc99('0x4c')](_0x42d561);}})['then'](function(_0xd88fdf){if(_0xd88fdf){_0xc7999c=_0xd88fdf['length'];if(!_0x4d4f0f[_0xfc99('0x2e')][_0xfc99('0x35')]('nolimit')){_0x42d561[_0xfc99('0x1f')]=qs['limit'](_0x4d4f0f['query']['limit']);_0x42d561['offset']=qs[_0xfc99('0x1d')](_0x4d4f0f[_0xfc99('0x2e')]['offset']);}return _0x3265e8['getSubjects'](_0x42d561);}})[_0xfc99('0x26')](function(_0x33a609){if(_0x33a609){return _0x33a609?{'count':_0xc7999c,'rows':_0x33a609}:null;}})[_0xfc99('0x26')](respondWithResult(_0x1a8048,null))['catch'](handleError(_0x1a8048,null));};exports[_0xfc99('0x4e')]=function(_0x339ea9,_0x435d50,_0x59546a){var _0x34ab7d={};var _0x2610c6={};var _0x31efb9;var _0x2242a2;return db[_0xfc99('0x2b')][_0xfc99('0x4a')]({'where':{'id':_0x339ea9[_0xfc99('0x45')]['id']}})['then'](handleEntityNotFound(_0x435d50,null))[_0xfc99('0x26')](function(_0x4cd182){if(_0x4cd182){_0x31efb9=_0x4cd182;_0x2610c6[_0xfc99('0x30')]=_[_0xfc99('0x2f')](db['FreshdeskField'][_0xfc99('0x2c')]);_0x2610c6[_0xfc99('0x2e')]=_[_0xfc99('0x2f')](_0x339ea9[_0xfc99('0x2e')]);_0x2610c6[_0xfc99('0x39')]=_['intersection'](_0x2610c6['model'],_0x2610c6[_0xfc99('0x2e')]);_0x34ab7d[_0xfc99('0x33')]=_[_0xfc99('0x31')](_0x2610c6['model'],qs[_0xfc99('0x32')](_0x339ea9[_0xfc99('0x2e')]['fields']));_0x34ab7d[_0xfc99('0x33')]=_0x34ab7d[_0xfc99('0x33')]['length']?_0x34ab7d['attributes']:_0x2610c6[_0xfc99('0x30')];_0x34ab7d[_0xfc99('0x36')]=qs[_0xfc99('0x37')](_0x339ea9['query']['sort']);_0x34ab7d['where']=qs[_0xfc99('0x39')](_[_0xfc99('0x3a')](_0x339ea9[_0xfc99('0x2e')],_0x2610c6[_0xfc99('0x39')]));if(_0x339ea9[_0xfc99('0x2e')]['filter']){_0x34ab7d[_0xfc99('0x38')]=_['merge'](_0x34ab7d[_0xfc99('0x38')],{'$or':_['map'](_0x34ab7d[_0xfc99('0x33')],function(_0x408e3d){var _0x3cafda={};_0x3cafda[_0x408e3d]={'$like':'%'+_0x339ea9['query'][_0xfc99('0x3b')]+'%'};return _0x3cafda;})});}_0x34ab7d=_[_0xfc99('0x3c')]({},_0x34ab7d,_0x339ea9[_0xfc99('0x3f')]);return _0x31efb9[_0xfc99('0x4e')](_0x34ab7d);}})[_0xfc99('0x26')](function(_0x2a728a){if(_0x2a728a){_0x2242a2=_0x2a728a[_0xfc99('0x34')];if(!_0x339ea9[_0xfc99('0x2e')][_0xfc99('0x35')](_0xfc99('0x4b'))){_0x34ab7d[_0xfc99('0x1f')]=qs[_0xfc99('0x1f')](_0x339ea9[_0xfc99('0x2e')][_0xfc99('0x1f')]);_0x34ab7d[_0xfc99('0x1d')]=qs[_0xfc99('0x1d')](_0x339ea9[_0xfc99('0x2e')]['offset']);}return _0x31efb9['getDescriptions'](_0x34ab7d);}})[_0xfc99('0x26')](function(_0x5a253e){if(_0x5a253e){return _0x5a253e?{'count':_0x2242a2,'rows':_0x5a253e}:null;}})[_0xfc99('0x26')](respondWithResult(_0x435d50,null))[_0xfc99('0x43')](handleError(_0x435d50,null));};exports[_0xfc99('0x4f')]=function(_0x136df1,_0xe18da9,_0x3a4471){var _0x46c477={};var _0x2f2606={};var _0x42a046;var _0x34fdf5;return db[_0xfc99('0x2b')][_0xfc99('0x4a')]({'where':{'id':_0x136df1['params']['id']}})[_0xfc99('0x26')](handleEntityNotFound(_0xe18da9,null))['then'](function(_0x3bad45){if(_0x3bad45){_0x42a046=_0x3bad45;_0x2f2606[_0xfc99('0x30')]=_['keys'](db[_0xfc99('0x50')][_0xfc99('0x2c')]);_0x2f2606[_0xfc99('0x2e')]=_['keys'](_0x136df1[_0xfc99('0x2e')]);_0x2f2606[_0xfc99('0x39')]=_[_0xfc99('0x31')](_0x2f2606[_0xfc99('0x30')],_0x2f2606['query']);_0x46c477[_0xfc99('0x33')]=_[_0xfc99('0x31')](_0x2f2606[_0xfc99('0x30')],qs[_0xfc99('0x32')](_0x136df1[_0xfc99('0x2e')][_0xfc99('0x32')]));_0x46c477[_0xfc99('0x33')]=_0x46c477[_0xfc99('0x33')][_0xfc99('0x34')]?_0x46c477[_0xfc99('0x33')]:_0x2f2606[_0xfc99('0x30')];_0x46c477[_0xfc99('0x36')]=qs[_0xfc99('0x37')](_0x136df1[_0xfc99('0x2e')][_0xfc99('0x37')]);_0x46c477[_0xfc99('0x38')]=qs[_0xfc99('0x39')](_[_0xfc99('0x3a')](_0x136df1[_0xfc99('0x2e')],_0x2f2606[_0xfc99('0x39')]));if(_0x136df1['query']['filter']){_0x46c477[_0xfc99('0x38')]=_[_0xfc99('0x3c')](_0x46c477['where'],{'$or':_[_0xfc99('0x2a')](_0x46c477[_0xfc99('0x33')],function(_0xcce0e2){var _0x4f44a7={};_0x4f44a7[_0xcce0e2]={'$like':'%'+_0x136df1[_0xfc99('0x2e')][_0xfc99('0x3b')]+'%'};return _0x4f44a7;})});}_0x46c477=_[_0xfc99('0x3c')]({},_0x46c477,_0x136df1[_0xfc99('0x3f')]);return _0x42a046['getTags'](_0x46c477);}})['then'](function(_0x44eae8){if(_0x44eae8){_0x34fdf5=_0x44eae8[_0xfc99('0x34')];if(!_0x136df1[_0xfc99('0x2e')][_0xfc99('0x35')](_0xfc99('0x4b'))){_0x46c477[_0xfc99('0x1f')]=qs['limit'](_0x136df1['query'][_0xfc99('0x1f')]);_0x46c477[_0xfc99('0x1d')]=qs[_0xfc99('0x1d')](_0x136df1['query'][_0xfc99('0x1d')]);}return _0x42a046[_0xfc99('0x4f')](_0x46c477);}})[_0xfc99('0x26')](function(_0x4ac223){if(_0x4ac223){return _0x4ac223?{'count':_0x34fdf5,'rows':_0x4ac223}:null;}})['then'](respondWithResult(_0xe18da9,null))['catch'](handleError(_0xe18da9,null));};exports['setTags']=function(_0x5b666c,_0x11ac30,_0x46b0c0){if(_0x5b666c[_0xfc99('0x48')]['id']){delete _0x5b666c[_0xfc99('0x48')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5b666c[_0xfc99('0x45')]['id']}})[_0xfc99('0x26')](handleEntityNotFound(_0x11ac30,null))['then'](function(_0x26cb07){if(_0x26cb07){return _0x26cb07[_0xfc99('0x51')](_0x5b666c[_0xfc99('0x48')][_0xfc99('0x52')]||[]);}return null;})['then'](respondWithResult(_0x11ac30,null))[_0xfc99('0x43')](handleError(_0x11ac30,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0dfcbf1..79ee8a6 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 _0x925e=['request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','moment'];(function(_0x2c196f,_0xb47e50){var _0x378683=function(_0x4a1498){while(--_0x4a1498){_0x2c196f['push'](_0x2c196f['shift']());}};_0x378683(++_0xb47e50);}(_0x925e,0xfa));var _0xe925=function(_0x505a1d,_0x1136e8){_0x505a1d=_0x505a1d-0x0;var _0x114138=_0x925e[_0x505a1d];return _0x114138;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe925('0x0'))('api');var moment=require(_0xe925('0x1'));var BPromise=require('bluebird');var rp=require(_0xe925('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe925('0x3'));var attributes=require(_0xe925('0x4'));module[_0xe925('0x5')]=function(_0x1b5a2d,_0x26a3a0){return _0x1b5a2d[_0xe925('0x6')](_0xe925('0x7'),attributes,{'tableName':_0xe925('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb99c=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x190d08,_0x2d9f48){var _0x4ba4cf=function(_0x4e4b33){while(--_0x4e4b33){_0x190d08['push'](_0x190d08['shift']());}};_0x4ba4cf(++_0x2d9f48);}(_0xb99c,0x1cb));var _0xcb99=function(_0x3fc0c7,_0x1ef857){_0x3fc0c7=_0x3fc0c7-0x0;var _0x101d86=_0xb99c[_0x3fc0c7];return _0x101d86;};'use strict';var _=require('lodash');var util=require(_0xcb99('0x0'));var logger=require(_0xcb99('0x1'))(_0xcb99('0x2'));var moment=require(_0xcb99('0x3'));var BPromise=require(_0xcb99('0x4'));var rp=require(_0xcb99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb99('0x6'));var config=require(_0xcb99('0x7'));var attributes=require(_0xcb99('0x8'));module[_0xcb99('0x9')]=function(_0x50a71c,_0x4e6af6){return _0x50a71c[_0xcb99('0xa')](_0xcb99('0xb'),attributes,{'tableName':_0xcb99('0xc'),'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 c1a45ee..a0ff727 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 _0xf37c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0xf37c,0x13c));var _0xcf37=function(_0x43c211,_0x86ae16){_0x43c211=_0x43c211-0x0;var _0x5f3e83=_0xf37c[_0x43c211];return _0x5f3e83;};'use strict';var _=require(_0xcf37('0x0'));var util=require(_0xcf37('0x1'));var moment=require(_0xcf37('0x2'));var BPromise=require(_0xcf37('0x3'));var rs=require(_0xcf37('0x4'));var fs=require('fs');var Redis=require(_0xcf37('0x5'));var db=require(_0xcf37('0x6'))['db'];var utils=require(_0xcf37('0x7'));var logger=require(_0xcf37('0x8'))(_0xcf37('0x9'));var config=require('../../config/environment');var jayson=require(_0xcf37('0xa'));var client=jayson[_0xcf37('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b93af,_0x9dfb04,_0x33837f){return new BPromise(function(_0x2ecce2,_0x4dd0f1){return client[_0xcf37('0xc')](_0x1b93af,_0x33837f)['then'](function(_0x5c59e7){logger['info'](_0xcf37('0xd'),_0x9dfb04,_0xcf37('0xe'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x9dfb04,'request\x20sent',JSON[_0xcf37('0xf')](_0x5c59e7));if(_0x5c59e7[_0xcf37('0x10')]){if(_0x5c59e7[_0xcf37('0x10')][_0xcf37('0x11')]===0x1f4){logger['error'](_0xcf37('0xd'),_0x9dfb04,_0x5c59e7[_0xcf37('0x10')]['message']);return _0x4dd0f1(_0x5c59e7[_0xcf37('0x10')][_0xcf37('0x12')]);}logger[_0xcf37('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x9dfb04,_0x5c59e7[_0xcf37('0x10')][_0xcf37('0x12')]);return _0x2ecce2(_0x5c59e7['error'][_0xcf37('0x12')]);}else{logger[_0xcf37('0x13')](_0xcf37('0xd'),_0x9dfb04,_0xcf37('0xe'));_0x2ecce2(_0x5c59e7['result'][_0xcf37('0x12')]);}})['catch'](function(_0xdcf322){logger[_0xcf37('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x9dfb04,_0xdcf322);_0x4dd0f1(_0xdcf322);});});} \ No newline at end of file +var _0x1749=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x3d8af7,_0x34bab2){var _0x224c2b=function(_0xfac096){while(--_0xfac096){_0x3d8af7['push'](_0x3d8af7['shift']());}};_0x224c2b(++_0x34bab2);}(_0x1749,0x82));var _0x9174=function(_0x4b1877,_0xa2b404){_0x4b1877=_0x4b1877-0x0;var _0xe6cca2=_0x1749[_0x4b1877];return _0xe6cca2;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var moment=require(_0x9174('0x2'));var BPromise=require(_0x9174('0x3'));var rs=require(_0x9174('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9174('0x5'));var logger=require(_0x9174('0x6'))(_0x9174('0x7'));var config=require(_0x9174('0x8'));var jayson=require(_0x9174('0x9'));var client=jayson[_0x9174('0xa')][_0x9174('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f3592,_0x3b2365,_0x7d8a63){return new BPromise(function(_0x54944d,_0x4788f5){return client['request'](_0x2f3592,_0x7d8a63)[_0x9174('0xc')](function(_0x198f36){logger[_0x9174('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3b2365,_0x9174('0xe'));logger[_0x9174('0xf')](_0x9174('0x10'),_0x3b2365,_0x9174('0xe'),JSON['stringify'](_0x198f36));if(_0x198f36[_0x9174('0x11')]){if(_0x198f36[_0x9174('0x11')]['code']===0x1f4){logger[_0x9174('0x11')](_0x9174('0x12'),_0x3b2365,_0x198f36[_0x9174('0x11')][_0x9174('0x13')]);return _0x4788f5(_0x198f36[_0x9174('0x11')][_0x9174('0x13')]);}logger[_0x9174('0x11')](_0x9174('0x12'),_0x3b2365,_0x198f36[_0x9174('0x11')][_0x9174('0x13')]);return _0x54944d(_0x198f36[_0x9174('0x11')]['message']);}else{logger['info'](_0x9174('0x12'),_0x3b2365,'request\x20sent');_0x54944d(_0x198f36[_0x9174('0x14')][_0x9174('0x13')]);}})[_0x9174('0x15')](function(_0x12f8c8){logger['error'](_0x9174('0x12'),_0x3b2365,_0x12f8c8);_0x4788f5(_0x12f8c8);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 866a18b..1ae705f 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 _0xce6e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2c2e54,_0x55ff9e){var _0x3b067=function(_0xfc31f9){while(--_0xfc31f9){_0x2c2e54['push'](_0x2c2e54['shift']());}};_0x3b067(++_0x55ff9e);}(_0xce6e,0xfd));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xece6('0x0'));var util=require(_0xece6('0x1'));var path=require(_0xece6('0x2'));var timeout=require(_0xece6('0x3'));var express=require(_0xece6('0x4'));var router=express[_0xece6('0x5')]();var fs_extra=require(_0xece6('0x6'));var auth=require(_0xece6('0x7'));var interaction=require(_0xece6('0x8'));var config=require(_0xece6('0x9'));var controller=require(_0xece6('0xa'));router[_0xece6('0xb')]('/',auth[_0xece6('0xc')](),controller[_0xece6('0xd')]);router[_0xece6('0xb')](_0xece6('0xe'),auth[_0xece6('0xc')](),controller[_0xece6('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xece6('0x10')]);router[_0xece6('0x11')](_0xece6('0xe'),auth[_0xece6('0xc')](),controller['update']);router['delete'](_0xece6('0xe'),auth['isAuthenticated'](),controller[_0xece6('0x12')]);module[_0xece6('0x13')]=router; \ No newline at end of file +var _0xa52a=['./intFreshdeskField.controller','get','isAuthenticated','post','create','put','delete','/:id','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x492e91,_0x4935d8){var _0x497572=function(_0xff4312){while(--_0xff4312){_0x492e91['push'](_0x492e91['shift']());}};_0x497572(++_0x4935d8);}(_0xa52a,0x78));var _0xaa52=function(_0x3d5d16,_0x4cf444){_0x3d5d16=_0x3d5d16-0x0;var _0x442a4d=_0xa52a[_0x3d5d16];return _0x442a4d;};'use strict';var multer=require(_0xaa52('0x0'));var util=require('util');var path=require(_0xaa52('0x1'));var timeout=require(_0xaa52('0x2'));var express=require('express');var router=express[_0xaa52('0x3')]();var fs_extra=require(_0xaa52('0x4'));var auth=require(_0xaa52('0x5'));var interaction=require(_0xaa52('0x6'));var config=require(_0xaa52('0x7'));var controller=require(_0xaa52('0x8'));router[_0xaa52('0x9')]('/',auth[_0xaa52('0xa')](),controller['index']);router[_0xaa52('0x9')]('/:id',auth[_0xaa52('0xa')](),controller['show']);router[_0xaa52('0xb')]('/',auth[_0xaa52('0xa')](),controller[_0xaa52('0xc')]);router[_0xaa52('0xd')]('/:id',auth[_0xaa52('0xa')](),controller['update']);router[_0xaa52('0xe')](_0xaa52('0xf'),auth[_0xaa52('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index a0f9812..f23af69 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 _0xb037=['sequelize','string','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x24bd83,_0x1830c4){var _0x3a047e=function(_0x5d8bc4){while(--_0x5d8bc4){_0x24bd83['push'](_0x24bd83['shift']());}};_0x3a047e(++_0x1830c4);}(_0xb037,0x165));var _0x7b03=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xb037[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x7b03('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7b03('0x1'),'variable','customVariable',_0x7b03('0x2'),_0x7b03('0x3')),'defaultValue':_0x7b03('0x1')},'content':{'type':Sequelize[_0x7b03('0x4')]},'key':{'type':Sequelize[_0x7b03('0x4')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x7b03('0x5'))},'keyContent':{'type':Sequelize[_0x7b03('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b03('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27ec=['exports','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x516fd8,_0x408f64){var _0x43d92d=function(_0x5de3c7){while(--_0x5de3c7){_0x516fd8['push'](_0x516fd8['shift']());}};_0x43d92d(++_0x408f64);}(_0x27ec,0x1ea));var _0xc27e=function(_0x2d481c,_0xa7eb93){_0x2d481c=_0x2d481c-0x0;var _0x519de5=_0x27ec[_0x2d481c];return _0x519de5;};'use strict';var Sequelize=require('sequelize');module[_0xc27e('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xc27e('0x1'),_0xc27e('0x2'),_0xc27e('0x3')),'defaultValue':_0xc27e('0x4')},'content':{'type':Sequelize[_0xc27e('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc27e('0x6')](_0xc27e('0x4'),'variable',_0xc27e('0x1'))},'keyContent':{'type':Sequelize[_0xc27e('0x5')]},'idField':{'type':Sequelize[_0xc27e('0x5')]},'nameField':{'type':Sequelize[_0xc27e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc27e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index b50e354..f56dfa8 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 _0x9c5e=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x4c7c4a,_0x520920){_0x4c7c4a=_0x4c7c4a-0x0;var _0x4d78ae=_0x9c5e[_0x4c7c4a];return _0x4d78ae;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={},_0x46d253={},_0x334f5a={'count':0x0,'rows':[]};var _0x37cfa5=_[_0xe9c5('0x2c')](db['FreshdeskField'][_0xe9c5('0x2d')],function(_0x4fcabd){return{'name':_0x4fcabd[_0xe9c5('0x2e')],'type':_0x4fcabd['type'][_0xe9c5('0x2f')]};});_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x2c')](_0x37cfa5,_0xe9c5('0x2a'));_0x46d253[_0xe9c5('0x31')]=_['keys'](_0x2112a6[_0xe9c5('0x31')]);_0x46d253[_0xe9c5('0x32')]=_[_0xe9c5('0x33')](_0x46d253[_0xe9c5('0x30')],_0x46d253[_0xe9c5('0x31')]);_0x36d145['attributes']=_['intersection'](_0x46d253[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x35')]=_0x36d145[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x36d145[_0xe9c5('0x35')]:_0x46d253['model'];if(!_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x37')]('nolimit')){_0x36d145[_0xe9c5('0x1d')]=qs['limit'](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1d')]);_0x36d145[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1f')]);}_0x36d145[_0xe9c5('0x38')]=qs[_0xe9c5('0x39')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x39')]);_0x36d145[_0xe9c5('0x3a')]=qs[_0xe9c5('0x32')](_[_0xe9c5('0x3b')](_0x2112a6[_0xe9c5('0x31')],_0x46d253[_0xe9c5('0x32')]),_0x37cfa5);if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x3c')]){_0x36d145[_0xe9c5('0x3a')]=_[_0xe9c5('0x3d')](_0x36d145['where'],{'$or':_[_0xe9c5('0x2c')](_0x37cfa5,function(_0x2e3f15){if(_0x2e3f15[_0xe9c5('0x3e')]!==_0xe9c5('0x3f')){var _0x204b53={};_0x204b53[_0x2e3f15[_0xe9c5('0x2a')]]={'$like':'%'+_0x2112a6['query'][_0xe9c5('0x3c')]+'%'};return _0x204b53;}})});}_0x36d145=_[_0xe9c5('0x3d')]({},_0x36d145,_0x2112a6[_0xe9c5('0x40')]);var _0x480b83={'where':_0x36d145[_0xe9c5('0x3a')]};return db[_0xe9c5('0x41')][_0xe9c5('0x1e')](_0x480b83)[_0xe9c5('0x26')](function(_0x2c1615){_0x334f5a[_0xe9c5('0x1e')]=_0x2c1615;if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x36d145[_0xe9c5('0x43')]=[{'all':!![]}];}return db[_0xe9c5('0x41')][_0xe9c5('0x44')](_0x36d145);})['then'](function(_0x51dd18){_0x334f5a[_0xe9c5('0x45')]=_0x51dd18;return _0x334f5a;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x52d008,_0x36d145))[_0xe9c5('0x46')](handleError(_0x52d008,null));};exports[_0xe9c5('0x47')]=function(_0x4ca4b0,_0x4a3fc5){var _0x382405={'raw':!![],'where':{'id':_0x4ca4b0['params']['id']}},_0x144e85={};_0x144e85[_0xe9c5('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x144e85[_0xe9c5('0x31')]=_[_0xe9c5('0x48')](_0x4ca4b0[_0xe9c5('0x31')]);_0x144e85[_0xe9c5('0x32')]=_['intersection'](_0x144e85[_0xe9c5('0x30')],_0x144e85[_0xe9c5('0x31')]);_0x382405[_0xe9c5('0x35')]=_[_0xe9c5('0x33')](_0x144e85[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x382405['attributes']=_0x382405[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x382405[_0xe9c5('0x35')]:_0x144e85[_0xe9c5('0x30')];if(_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x382405['include']=[{'all':!![]}];}_0x382405=_['merge']({},_0x382405,_0x4ca4b0['options']);return db['FreshdeskField'][_0xe9c5('0x49')](_0x382405)[_0xe9c5('0x26')](handleEntityNotFound(_0x4a3fc5,null))[_0xe9c5('0x26')](respondWithResult(_0x4a3fc5,null))['catch'](handleError(_0x4a3fc5,null));};exports[_0xe9c5('0x4a')]=function(_0x520248,_0x1ed99e){return db[_0xe9c5('0x41')][_0xe9c5('0x4a')](_0x520248[_0xe9c5('0x4b')],{})['then'](respondWithResult(_0x1ed99e,0xc9))[_0xe9c5('0x46')](handleError(_0x1ed99e,null));};exports[_0xe9c5('0x25')]=function(_0x1da6a3,_0x249940){if(_0x1da6a3['body']['id']){delete _0x1da6a3[_0xe9c5('0x4b')]['id'];}return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x1da6a3[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x249940,null))[_0xe9c5('0x26')](saveUpdates(_0x1da6a3['body'],null))[_0xe9c5('0x26')](respondWithResult(_0x249940,null))[_0xe9c5('0x46')](handleError(_0x249940,null));};exports[_0xe9c5('0x27')]=function(_0x9d0154,_0x5e7c24){return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x9d0154[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x5e7c24,null))[_0xe9c5('0x26')](removeEntity(_0x5e7c24,null))[_0xe9c5('0x46')](handleError(_0x5e7c24,null));}; \ No newline at end of file +var _0x6b24=['rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','findAll','rows','catch','include','merge','find','create','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','FreshdeskField'];(function(_0x55b97b,_0x32708d){var _0x4e646e=function(_0xd57646){while(--_0xd57646){_0x55b97b['push'](_0x55b97b['shift']());}};_0x4e646e(++_0x32708d);}(_0x6b24,0x1ce));var _0x46b2=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x6b24[_0xa8883];return _0x479426;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46b2('0x0'));var zipdir=require(_0x46b2('0x1'));var jsonpatch=require(_0x46b2('0x2'));var rp=require(_0x46b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46b2('0x4'));var path=require('path');var sox=require(_0x46b2('0x5'));var csv=require('to-csv');var ejs=require(_0x46b2('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46b2('0x7'));var crypto=require(_0x46b2('0x8'));var jsforce=require(_0x46b2('0x9'));var deskjs=require(_0x46b2('0xa'));var toCsv=require(_0x46b2('0xb'));var querystring=require(_0x46b2('0xc'));var Papa=require(_0x46b2('0xd'));var Redis=require(_0x46b2('0xe'));var authService=require(_0x46b2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46b2('0x10'));var logger=require(_0x46b2('0x11'))(_0x46b2('0x12'));var utils=require('../../config/utils');var config=require(_0x46b2('0x13'));var licenseUtil=require(_0x46b2('0x14'));var db=require(_0x46b2('0x15'))['db'];function respondWithStatusCode(_0x5343fc,_0x468ae9){_0x468ae9=_0x468ae9||0xcc;return function(_0x886e41){if(_0x886e41){return _0x5343fc[_0x46b2('0x16')](_0x468ae9);}return _0x5343fc[_0x46b2('0x17')](_0x468ae9)[_0x46b2('0x18')]();};}function respondWithResult(_0x1cf0f0,_0x3ff25d){_0x3ff25d=_0x3ff25d||0xc8;return function(_0x228261){if(_0x228261){return _0x1cf0f0[_0x46b2('0x17')](_0x3ff25d)[_0x46b2('0x19')](_0x228261);}};}function respondWithFilteredResult(_0x563b05,_0x43e0d9){return function(_0x5b49da){if(_0x5b49da){var _0x49479c=typeof _0x43e0d9[_0x46b2('0x1a')]===_0x46b2('0x1b')&&typeof _0x43e0d9[_0x46b2('0x1c')]===_0x46b2('0x1b');var _0x373c49=_0x5b49da[_0x46b2('0x1d')];var _0x226ab5=_0x49479c?0x0:_0x43e0d9['offset'];var _0x316c39=_0x49479c?_0x5b49da['count']:_0x43e0d9[_0x46b2('0x1a')]+_0x43e0d9[_0x46b2('0x1c')];var _0x9b4723;if(_0x316c39>=_0x373c49){_0x316c39=_0x373c49;_0x9b4723=0xc8;}else{_0x9b4723=0xce;}_0x563b05['status'](_0x9b4723);return _0x563b05[_0x46b2('0x1e')](_0x46b2('0x1f'),_0x226ab5+'-'+_0x316c39+'/'+_0x373c49)[_0x46b2('0x19')](_0x5b49da);}return null;};}function patchUpdates(_0x1e5c35){return function(_0x350f85){try{jsonpatch[_0x46b2('0x20')](_0x350f85,_0x1e5c35,!![]);}catch(_0x3a0ea5){return BPromise[_0x46b2('0x21')](_0x3a0ea5);}return _0x350f85[_0x46b2('0x22')]();};}function saveUpdates(_0x259f2f,_0x29ade9){return function(_0x1b5fbe){if(_0x1b5fbe){return _0x1b5fbe[_0x46b2('0x23')](_0x259f2f)[_0x46b2('0x24')](function(_0x1caa77){return _0x1caa77;});}return null;};}function removeEntity(_0x50011b,_0x209519){return function(_0x4c2983){if(_0x4c2983){return _0x4c2983['destroy']()[_0x46b2('0x24')](function(){_0x50011b[_0x46b2('0x17')](0xcc)[_0x46b2('0x18')]();});}};}function handleEntityNotFound(_0x134526,_0x16f646){return function(_0x58069e){if(!_0x58069e){_0x134526[_0x46b2('0x16')](0x194);}return _0x58069e;};}function handleError(_0x138f6c,_0x5ca1c7){_0x5ca1c7=_0x5ca1c7||0x1f4;return function(_0x3c5997){logger['error'](_0x3c5997[_0x46b2('0x25')]);if(_0x3c5997[_0x46b2('0x26')]){delete _0x3c5997[_0x46b2('0x26')];}_0x138f6c[_0x46b2('0x17')](_0x5ca1c7)[_0x46b2('0x27')](_0x3c5997);};}exports[_0x46b2('0x28')]=function(_0x74615,_0x1a6caf){var _0x429496={},_0x20ccb2={},_0x5421d9={'count':0x0,'rows':[]};var _0x4e2a9b=_['map'](db[_0x46b2('0x29')][_0x46b2('0x2a')],function(_0x2a2f8d){return{'name':_0x2a2f8d['fieldName'],'type':_0x2a2f8d[_0x46b2('0x2b')][_0x46b2('0x2c')]};});_0x20ccb2['model']=_[_0x46b2('0x2d')](_0x4e2a9b,_0x46b2('0x26'));_0x20ccb2[_0x46b2('0x2e')]=_[_0x46b2('0x2f')](_0x74615[_0x46b2('0x2e')]);_0x20ccb2[_0x46b2('0x30')]=_[_0x46b2('0x31')](_0x20ccb2[_0x46b2('0x32')],_0x20ccb2[_0x46b2('0x2e')]);_0x429496['attributes']=_[_0x46b2('0x31')](_0x20ccb2[_0x46b2('0x32')],qs[_0x46b2('0x33')](_0x74615['query'][_0x46b2('0x33')]));_0x429496[_0x46b2('0x34')]=_0x429496[_0x46b2('0x34')][_0x46b2('0x35')]?_0x429496['attributes']:_0x20ccb2[_0x46b2('0x32')];if(!_0x74615['query'][_0x46b2('0x36')](_0x46b2('0x37'))){_0x429496[_0x46b2('0x1c')]=qs[_0x46b2('0x1c')](_0x74615[_0x46b2('0x2e')][_0x46b2('0x1c')]);_0x429496[_0x46b2('0x1a')]=qs['offset'](_0x74615[_0x46b2('0x2e')][_0x46b2('0x1a')]);}_0x429496[_0x46b2('0x38')]=qs[_0x46b2('0x39')](_0x74615[_0x46b2('0x2e')][_0x46b2('0x39')]);_0x429496[_0x46b2('0x3a')]=qs['filters'](_['pick'](_0x74615['query'],_0x20ccb2[_0x46b2('0x30')]),_0x4e2a9b);if(_0x74615[_0x46b2('0x2e')]['filter']){_0x429496[_0x46b2('0x3a')]=_['merge'](_0x429496['where'],{'$or':_[_0x46b2('0x2d')](_0x4e2a9b,function(_0x1716a3){if(_0x1716a3[_0x46b2('0x2b')]!==_0x46b2('0x3b')){var _0x4dcd03={};_0x4dcd03[_0x1716a3[_0x46b2('0x26')]]={'$like':'%'+_0x74615['query']['filter']+'%'};return _0x4dcd03;}})});}_0x429496=_['merge']({},_0x429496,_0x74615[_0x46b2('0x3c')]);var _0x1599fa={'where':_0x429496[_0x46b2('0x3a')]};return db['FreshdeskField'][_0x46b2('0x1d')](_0x1599fa)['then'](function(_0x30afdb){_0x5421d9[_0x46b2('0x1d')]=_0x30afdb;if(_0x74615['query'][_0x46b2('0x3d')]){_0x429496['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x46b2('0x3e')](_0x429496);})['then'](function(_0x22c896){_0x5421d9[_0x46b2('0x3f')]=_0x22c896;return _0x5421d9;})[_0x46b2('0x24')](respondWithFilteredResult(_0x1a6caf,_0x429496))[_0x46b2('0x40')](handleError(_0x1a6caf,null));};exports['show']=function(_0x15451a,_0x13343e){var _0x205027={'raw':!![],'where':{'id':_0x15451a['params']['id']}},_0x4fdfeb={};_0x4fdfeb[_0x46b2('0x32')]=_[_0x46b2('0x2f')](db[_0x46b2('0x29')][_0x46b2('0x2a')]);_0x4fdfeb['query']=_['keys'](_0x15451a[_0x46b2('0x2e')]);_0x4fdfeb[_0x46b2('0x30')]=_[_0x46b2('0x31')](_0x4fdfeb[_0x46b2('0x32')],_0x4fdfeb[_0x46b2('0x2e')]);_0x205027[_0x46b2('0x34')]=_['intersection'](_0x4fdfeb['model'],qs[_0x46b2('0x33')](_0x15451a[_0x46b2('0x2e')][_0x46b2('0x33')]));_0x205027[_0x46b2('0x34')]=_0x205027['attributes'][_0x46b2('0x35')]?_0x205027[_0x46b2('0x34')]:_0x4fdfeb[_0x46b2('0x32')];if(_0x15451a[_0x46b2('0x2e')]['includeAll']){_0x205027[_0x46b2('0x41')]=[{'all':!![]}];}_0x205027=_[_0x46b2('0x42')]({},_0x205027,_0x15451a[_0x46b2('0x3c')]);return db[_0x46b2('0x29')][_0x46b2('0x43')](_0x205027)[_0x46b2('0x24')](handleEntityNotFound(_0x13343e,null))[_0x46b2('0x24')](respondWithResult(_0x13343e,null))['catch'](handleError(_0x13343e,null));};exports[_0x46b2('0x44')]=function(_0x14cdc9,_0x55c0aa){return db[_0x46b2('0x29')]['create'](_0x14cdc9[_0x46b2('0x45')],{})['then'](respondWithResult(_0x55c0aa,0xc9))[_0x46b2('0x40')](handleError(_0x55c0aa,null));};exports[_0x46b2('0x23')]=function(_0x4f8bd6,_0x301c64){if(_0x4f8bd6[_0x46b2('0x45')]['id']){delete _0x4f8bd6['body']['id'];}return db['FreshdeskField'][_0x46b2('0x43')]({'where':{'id':_0x4f8bd6['params']['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x301c64,null))['then'](saveUpdates(_0x4f8bd6[_0x46b2('0x45')],null))[_0x46b2('0x24')](respondWithResult(_0x301c64,null))[_0x46b2('0x40')](handleError(_0x301c64,null));};exports[_0x46b2('0x46')]=function(_0x27a9cf,_0x251c28){return db[_0x46b2('0x29')][_0x46b2('0x43')]({'where':{'id':_0x27a9cf[_0x46b2('0x47')]['id']}})[_0x46b2('0x24')](handleEntityNotFound(_0x251c28,null))[_0x46b2('0x24')](removeEntity(_0x251c28,null))[_0x46b2('0x40')](handleError(_0x251c28,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ceb539e..67971c9 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 _0xfb1f=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40c96d,_0x388bd6){var _0x5b61f7=function(_0x364c43){while(--_0x364c43){_0x40c96d['push'](_0x40c96d['shift']());}};_0x5b61f7(++_0x388bd6);}(_0xfb1f,0x6a));var _0xffb1=function(_0x52f3a4,_0x5afa6c){_0x52f3a4=_0x52f3a4-0x0;var _0x49f39d=_0xfb1f[_0x52f3a4];return _0x49f39d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xffb1('0x0'))(_0xffb1('0x1'));var moment=require(_0xffb1('0x2'));var BPromise=require(_0xffb1('0x3'));var rp=require(_0xffb1('0x4'));var fs=require('fs');var path=require(_0xffb1('0x5'));var rimraf=require(_0xffb1('0x6'));var config=require(_0xffb1('0x7'));var attributes=require(_0xffb1('0x8'));module[_0xffb1('0x9')]=function(_0x3239ef,_0x46aadf){return _0x3239ef[_0xffb1('0xa')](_0xffb1('0xb'),attributes,{'tableName':_0xffb1('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xffb1('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0fd5=['exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x4e1a81,_0x4c3697){var _0x52ea72=function(_0x4cda82){while(--_0x4cda82){_0x4e1a81['push'](_0x4e1a81['shift']());}};_0x52ea72(++_0x4c3697);}(_0x0fd5,0x1e6));var _0x50fd=function(_0x393fdb,_0x4d9004){_0x393fdb=_0x393fdb-0x0;var _0x199318=_0x0fd5[_0x393fdb];return _0x199318;};'use strict';var _=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var logger=require(_0x50fd('0x2'))(_0x50fd('0x3'));var moment=require(_0x50fd('0x4'));var BPromise=require(_0x50fd('0x5'));var rp=require(_0x50fd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50fd('0x7'));var config=require(_0x50fd('0x8'));var attributes=require(_0x50fd('0x9'));module[_0x50fd('0xa')]=function(_0x2b19e9,_0x2fd5be){return _0x2b19e9[_0x50fd('0xb')]('FreshdeskField',attributes,{'tableName':_0x50fd('0xc'),'paranoid':![],'indexes':[{'name':_0x50fd('0xd'),'fields':[_0x50fd('0xe'),_0x50fd('0xf')],'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 e77b466..c946383 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 _0x94bf=['http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2569f6,_0x2436f0){var _0x33b771=function(_0x290370){while(--_0x290370){_0x2569f6['push'](_0x2569f6['shift']());}};_0x33b771(++_0x2436f0);}(_0x94bf,0x1c2));var _0xf94b=function(_0x32948f,_0x110256){_0x32948f=_0x32948f-0x0;var _0x59bd64=_0x94bf[_0x32948f];return _0x59bd64;};'use strict';var _=require('lodash');var util=require(_0xf94b('0x0'));var moment=require('moment');var BPromise=require(_0xf94b('0x1'));var rs=require(_0xf94b('0x2'));var fs=require('fs');var Redis=require(_0xf94b('0x3'));var db=require(_0xf94b('0x4'))['db'];var utils=require(_0xf94b('0x5'));var logger=require(_0xf94b('0x6'))(_0xf94b('0x7'));var config=require(_0xf94b('0x8'));var jayson=require(_0xf94b('0x9'));var client=jayson['client'][_0xf94b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9a8ae7,_0x13e671,_0x5643b6){return new BPromise(function(_0x5cb253,_0x3a4ad7){return client[_0xf94b('0xb')](_0x9a8ae7,_0x5643b6)[_0xf94b('0xc')](function(_0x5afaa3){logger[_0xf94b('0xd')](_0xf94b('0xe'),_0x13e671,_0xf94b('0xf'));logger[_0xf94b('0x10')](_0xf94b('0x11'),_0x13e671,'request\x20sent',JSON[_0xf94b('0x12')](_0x5afaa3));if(_0x5afaa3[_0xf94b('0x13')]){if(_0x5afaa3[_0xf94b('0x13')]['code']===0x1f4){logger[_0xf94b('0x13')](_0xf94b('0xe'),_0x13e671,_0x5afaa3[_0xf94b('0x13')][_0xf94b('0x14')]);return _0x3a4ad7(_0x5afaa3[_0xf94b('0x13')][_0xf94b('0x14')]);}logger[_0xf94b('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x13e671,_0x5afaa3[_0xf94b('0x13')][_0xf94b('0x14')]);return _0x5cb253(_0x5afaa3[_0xf94b('0x13')][_0xf94b('0x14')]);}else{logger[_0xf94b('0xd')](_0xf94b('0xe'),_0x13e671,_0xf94b('0xf'));_0x5cb253(_0x5afaa3[_0xf94b('0x15')][_0xf94b('0x14')]);}})[_0xf94b('0x16')](function(_0xe5a61b){logger['error'](_0xf94b('0xe'),_0x13e671,_0xe5a61b);_0x3a4ad7(_0xe5a61b);});});} \ No newline at end of file +var _0xe2a5=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20df9c,_0x588faf){var _0xfa5e2c=function(_0x1cbc9a){while(--_0x1cbc9a){_0x20df9c['push'](_0x20df9c['shift']());}};_0xfa5e2c(++_0x588faf);}(_0xe2a5,0x1a9));var _0x5e2a=function(_0x152ced,_0x2d14dd){_0x152ced=_0x152ced-0x0;var _0x1b0eaf=_0xe2a5[_0x152ced];return _0x1b0eaf;};'use strict';var _=require('lodash');var util=require(_0x5e2a('0x0'));var moment=require(_0x5e2a('0x1'));var BPromise=require(_0x5e2a('0x2'));var rs=require(_0x5e2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e2a('0x4'))['db'];var utils=require(_0x5e2a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5e2a('0x6'));var jayson=require(_0x5e2a('0x7'));var client=jayson[_0x5e2a('0x8')][_0x5e2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x501726,_0x5f0633,_0x21f492){return new BPromise(function(_0x185cbe,_0x41efb7){return client['request'](_0x501726,_0x21f492)[_0x5e2a('0xa')](function(_0x4726b4){logger[_0x5e2a('0xb')](_0x5e2a('0xc'),_0x5f0633,_0x5e2a('0xd'));logger[_0x5e2a('0xe')](_0x5e2a('0xf'),_0x5f0633,_0x5e2a('0xd'),JSON[_0x5e2a('0x10')](_0x4726b4));if(_0x4726b4[_0x5e2a('0x11')]){if(_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x12')]===0x1f4){logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x13')]);return _0x41efb7(_0x4726b4[_0x5e2a('0x11')]['message']);}logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x4726b4[_0x5e2a('0x11')]['message']);return _0x185cbe(_0x4726b4[_0x5e2a('0x11')][_0x5e2a('0x13')]);}else{logger['info'](_0x5e2a('0xc'),_0x5f0633,_0x5e2a('0xd'));_0x185cbe(_0x4726b4[_0x5e2a('0x14')][_0x5e2a('0x13')]);}})[_0x5e2a('0x15')](function(_0x2f113b){logger[_0x5e2a('0x11')](_0x5e2a('0xc'),_0x5f0633,_0x2f113b);_0x41efb7(_0x2f113b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 31a4e68..96fb445 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 _0xa74f=['post','create','/:id/configurations','put','update','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields'];(function(_0x53263b,_0x299c08){var _0x3fd94b=function(_0x489939){while(--_0x489939){_0x53263b['push'](_0x53263b['shift']());}};_0x3fd94b(++_0x299c08);}(_0xa74f,0x9a));var _0xfa74=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xa74f[_0x5519a9];return _0x32f2cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id/configurations',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0x7')](_0xfa74('0xc'),auth['isAuthenticated'](),controller[_0xfa74('0xd')]);router[_0xfa74('0xe')]('/',auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0xe')](_0xfa74('0x10'),auth[_0xfa74('0x9')](),controller['addConfiguration']);router[_0xfa74('0x11')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x12')]);router['delete'](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x13')]);module[_0xfa74('0x14')]=router; \ No newline at end of file +var _0x087b=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f5f47,_0x13d29d){var _0x3a3e20=function(_0x348600){while(--_0x348600){_0x1f5f47['push'](_0x1f5f47['shift']());}};_0x3a3e20(++_0x13d29d);}(_0x087b,0x11a));var _0xb087=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x087b[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/fields',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x10')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x10')](_0xb087('0xd'),auth['isAuthenticated'](),controller[_0xb087('0x12')]);router[_0xb087('0x13')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x15')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);module[_0xb087('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9bf1883..1437ed1 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 _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x8d692,_0x16d6a2){var _0x22b7be=function(_0x5cb4f0){while(--_0x5cb4f0){_0x8d692['push'](_0x8d692['shift']());}};_0x22b7be(++_0x16d6a2);}(_0x5464,0x15d));var _0x4546=function(_0x33321b,_0x46df65){_0x33321b=_0x33321b-0x0;var _0x471461=_0x5464[_0x33321b];return _0x471461;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb145=['STRING','username','remoteUri','exports'];(function(_0x315b61,_0x4bb11e){var _0x3521e8=function(_0x5e6389){while(--_0x5e6389){_0x315b61['push'](_0x315b61['shift']());}};_0x3521e8(++_0x4bb11e);}(_0xb145,0xa3));var _0x5b14=function(_0x411d44,_0x13c595){_0x411d44=_0x411d44-0x0;var _0x240a2e=_0xb145[_0x411d44];return _0x240a2e;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 8b587b7..67fd68a 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 _0x7da8=['set','Content-Range','json','apply','reject','update','then','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','slice','lastIndexOf','GET','format','%s%s','Token\x20token=','apiKey','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../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','undefined','limit','count'];(function(_0x448663,_0xdb8798){var _0x4c5d71=function(_0x6a2234){while(--_0x6a2234){_0x448663['push'](_0x448663['shift']());}};_0x4c5d71(++_0xdb8798);}(_0x7da8,0x17e));var _0x87da=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7da8[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87da('0x0'));var zipdir=require(_0x87da('0x1'));var jsonpatch=require(_0x87da('0x2'));var rp=require(_0x87da('0x3'));var moment=require(_0x87da('0x4'));var BPromise=require(_0x87da('0x5'));var Mustache=require(_0x87da('0x6'));var util=require(_0x87da('0x7'));var path=require('path');var sox=require(_0x87da('0x8'));var csv=require(_0x87da('0x9'));var ejs=require(_0x87da('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87da('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x87da('0xc'));var deskjs=require(_0x87da('0xd'));var toCsv=require(_0x87da('0x9'));var querystring=require(_0x87da('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x87da('0xf'));var qs=require(_0x87da('0x10'));var as=require(_0x87da('0x11'));var hardwareService=require(_0x87da('0x12'));var logger=require(_0x87da('0x13'))(_0x87da('0x14'));var utils=require(_0x87da('0x15'));var config=require(_0x87da('0x16'));var licenseUtil=require(_0x87da('0x17'));var db=require(_0x87da('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4f7a61,_0x5eeaf7){_0x5eeaf7=_0x5eeaf7||0xcc;return function(_0xb6d377){if(_0xb6d377){return _0x4f7a61[_0x87da('0x19')](_0x5eeaf7);}return _0x4f7a61[_0x87da('0x1a')](_0x5eeaf7)['end']();};}function respondWithResult(_0x32035d,_0x4876d6){_0x4876d6=_0x4876d6||0xc8;return function(_0x332e56){if(_0x332e56){return _0x32035d[_0x87da('0x1a')](_0x4876d6)['json'](_0x332e56);}};}function respondWithFilteredResult(_0x225bff,_0x3bff6e){return function(_0x562435){if(_0x562435){var _0x2ef1ef=typeof _0x3bff6e['offset']===_0x87da('0x1b')&&typeof _0x3bff6e[_0x87da('0x1c')]==='undefined';var _0x1be26b=_0x562435[_0x87da('0x1d')];var _0x1ae754=_0x2ef1ef?0x0:_0x3bff6e['offset'];var _0x3d2194=_0x2ef1ef?_0x562435['count']:_0x3bff6e['offset']+_0x3bff6e['limit'];var _0x2e385e;if(_0x3d2194>=_0x1be26b){_0x3d2194=_0x1be26b;_0x2e385e=0xc8;}else{_0x2e385e=0xce;}_0x225bff[_0x87da('0x1a')](_0x2e385e);return _0x225bff[_0x87da('0x1e')](_0x87da('0x1f'),_0x1ae754+'-'+_0x3d2194+'/'+_0x1be26b)[_0x87da('0x20')](_0x562435);}return null;};}function patchUpdates(_0x3174c5){return function(_0x2087db){try{jsonpatch[_0x87da('0x21')](_0x2087db,_0x3174c5,!![]);}catch(_0x3488a3){return BPromise[_0x87da('0x22')](_0x3488a3);}return _0x2087db['save']();};}function saveUpdates(_0x53abd2,_0x26284d){return function(_0x349410){if(_0x349410){return _0x349410[_0x87da('0x23')](_0x53abd2)['then'](function(_0x5ad228){return _0x5ad228;});}return null;};}function removeEntity(_0x325c2f,_0xdfb423){return function(_0x49cf71){if(_0x49cf71){return _0x49cf71['destroy']()[_0x87da('0x24')](function(){_0x325c2f[_0x87da('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7934dd,_0x2e4f0d){return function(_0x3cd779){if(!_0x3cd779){_0x7934dd[_0x87da('0x19')](0x194);}return _0x3cd779;};}function handleError(_0xda5f14,_0x493e39){_0x493e39=_0x493e39||0x1f4;return function(_0x407792){logger[_0x87da('0x25')](_0x407792[_0x87da('0x26')]);if(_0x407792['name']){delete _0x407792[_0x87da('0x27')];}_0xda5f14['status'](_0x493e39)['send'](_0x407792);};}exports[_0x87da('0x28')]=function(_0x50ff7c,_0x559281){var _0x462f19={},_0x48e032={},_0x1c16df={'count':0x0,'rows':[]};var _0x43c5be=_[_0x87da('0x29')](db[_0x87da('0x2a')][_0x87da('0x2b')],function(_0x3e8385){return{'name':_0x3e8385[_0x87da('0x2c')],'type':_0x3e8385['type'][_0x87da('0x2d')]};});_0x48e032[_0x87da('0x2e')]=_[_0x87da('0x29')](_0x43c5be,_0x87da('0x27'));_0x48e032[_0x87da('0x2f')]=_[_0x87da('0x30')](_0x50ff7c[_0x87da('0x2f')]);_0x48e032[_0x87da('0x31')]=_[_0x87da('0x32')](_0x48e032[_0x87da('0x2e')],_0x48e032[_0x87da('0x2f')]);_0x462f19['attributes']=_[_0x87da('0x32')](_0x48e032['model'],qs[_0x87da('0x33')](_0x50ff7c[_0x87da('0x2f')]['fields']));_0x462f19[_0x87da('0x34')]=_0x462f19['attributes'][_0x87da('0x35')]?_0x462f19[_0x87da('0x34')]:_0x48e032[_0x87da('0x2e')];if(!_0x50ff7c['query'][_0x87da('0x36')](_0x87da('0x37'))){_0x462f19[_0x87da('0x1c')]=qs[_0x87da('0x1c')](_0x50ff7c['query']['limit']);_0x462f19['offset']=qs[_0x87da('0x38')](_0x50ff7c[_0x87da('0x2f')][_0x87da('0x38')]);}_0x462f19['order']=qs['sort'](_0x50ff7c[_0x87da('0x2f')][_0x87da('0x39')]);_0x462f19[_0x87da('0x3a')]=qs['filters'](_[_0x87da('0x3b')](_0x50ff7c[_0x87da('0x2f')],_0x48e032[_0x87da('0x31')]),_0x43c5be);if(_0x50ff7c[_0x87da('0x2f')]['filter']){_0x462f19[_0x87da('0x3a')]=_[_0x87da('0x3c')](_0x462f19['where'],{'$or':_[_0x87da('0x29')](_0x43c5be,function(_0x339ad4){if(_0x339ad4[_0x87da('0x3d')]!==_0x87da('0x3e')){var _0x5bf612={};_0x5bf612[_0x339ad4[_0x87da('0x27')]]={'$like':'%'+_0x50ff7c[_0x87da('0x2f')][_0x87da('0x3f')]+'%'};return _0x5bf612;}})});}_0x462f19=_[_0x87da('0x3c')]({},_0x462f19,_0x50ff7c[_0x87da('0x40')]);var _0x260d8a={'where':_0x462f19[_0x87da('0x3a')]};return db[_0x87da('0x2a')][_0x87da('0x1d')](_0x260d8a)[_0x87da('0x24')](function(_0x4bf0d5){_0x1c16df[_0x87da('0x1d')]=_0x4bf0d5;if(_0x50ff7c[_0x87da('0x2f')][_0x87da('0x41')]){_0x462f19[_0x87da('0x42')]=[{'all':!![]}];}return db[_0x87da('0x2a')]['findAll'](_0x462f19);})[_0x87da('0x24')](function(_0xa7f1c8){_0x1c16df[_0x87da('0x43')]=_0xa7f1c8;return _0x1c16df;})[_0x87da('0x24')](respondWithFilteredResult(_0x559281,_0x462f19))['catch'](handleError(_0x559281,null));};exports[_0x87da('0x44')]=function(_0x121d0c,_0x375867){var _0x454786={'raw':![],'where':{'id':_0x121d0c[_0x87da('0x45')]['id']}},_0x500a22={};_0x500a22[_0x87da('0x2e')]=_[_0x87da('0x30')](db[_0x87da('0x2a')][_0x87da('0x2b')]);_0x500a22['query']=_['keys'](_0x121d0c[_0x87da('0x2f')]);_0x500a22[_0x87da('0x31')]=_['intersection'](_0x500a22[_0x87da('0x2e')],_0x500a22['query']);_0x454786['attributes']=_['intersection'](_0x500a22[_0x87da('0x2e')],qs['fields'](_0x121d0c[_0x87da('0x2f')][_0x87da('0x33')]));_0x454786[_0x87da('0x34')]=_0x454786[_0x87da('0x34')]['length']?_0x454786[_0x87da('0x34')]:_0x500a22[_0x87da('0x2e')];if(_0x121d0c[_0x87da('0x2f')][_0x87da('0x41')]){_0x454786['include']=[{'all':!![]}];}_0x454786=_[_0x87da('0x3c')]({},_0x454786,_0x121d0c[_0x87da('0x40')]);return db[_0x87da('0x2a')][_0x87da('0x46')](_0x454786)[_0x87da('0x24')](handleEntityNotFound(_0x375867,null))[_0x87da('0x24')](respondWithResult(_0x375867,null))[_0x87da('0x47')](handleError(_0x375867,null));};exports[_0x87da('0x48')]=function(_0x177e1d,_0x22d6c1){return db['FreshsalesAccount'][_0x87da('0x48')](_0x177e1d[_0x87da('0x49')],{})[_0x87da('0x24')](respondWithResult(_0x22d6c1,0xc9))[_0x87da('0x47')](handleError(_0x22d6c1,null));};exports['update']=function(_0x48ed75,_0x2cb639){if(_0x48ed75[_0x87da('0x49')]['id']){delete _0x48ed75[_0x87da('0x49')]['id'];}return db[_0x87da('0x2a')][_0x87da('0x46')]({'where':{'id':_0x48ed75[_0x87da('0x45')]['id']}})[_0x87da('0x24')](handleEntityNotFound(_0x2cb639,null))[_0x87da('0x24')](saveUpdates(_0x48ed75[_0x87da('0x49')],null))[_0x87da('0x24')](respondWithResult(_0x2cb639,null))['catch'](handleError(_0x2cb639,null));};exports[_0x87da('0x4a')]=function(_0x4d7aa5,_0x4f9935){return db[_0x87da('0x2a')][_0x87da('0x46')]({'where':{'id':_0x4d7aa5[_0x87da('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f9935,null))[_0x87da('0x24')](removeEntity(_0x4f9935,null))[_0x87da('0x47')](handleError(_0x4f9935,null));};exports['getConfigurations']=function(_0x2381b9,_0x1aa3b3,_0xcb3ffb){var _0x482f65={};var _0x1d8a67={};var _0x1146ee;var _0x5e130;return db['FreshsalesAccount'][_0x87da('0x4b')]({'where':{'id':_0x2381b9[_0x87da('0x45')]['id']}})['then'](handleEntityNotFound(_0x1aa3b3,null))[_0x87da('0x24')](function(_0x5aa27d){if(_0x5aa27d){_0x1146ee=_0x5aa27d;_0x1d8a67['model']=_[_0x87da('0x30')](db['FreshsalesConfiguration'][_0x87da('0x2b')]);_0x1d8a67[_0x87da('0x2f')]=_[_0x87da('0x30')](_0x2381b9['query']);_0x1d8a67['filters']=_[_0x87da('0x32')](_0x1d8a67[_0x87da('0x2e')],_0x1d8a67['query']);_0x482f65[_0x87da('0x34')]=_[_0x87da('0x32')](_0x1d8a67[_0x87da('0x2e')],qs['fields'](_0x2381b9[_0x87da('0x2f')][_0x87da('0x33')]));_0x482f65[_0x87da('0x34')]=_0x482f65[_0x87da('0x34')][_0x87da('0x35')]?_0x482f65[_0x87da('0x34')]:_0x1d8a67[_0x87da('0x2e')];_0x482f65['order']=qs[_0x87da('0x39')](_0x2381b9['query'][_0x87da('0x39')]);_0x482f65['where']=qs[_0x87da('0x31')](_[_0x87da('0x3b')](_0x2381b9[_0x87da('0x2f')],_0x1d8a67[_0x87da('0x31')]));if(_0x2381b9[_0x87da('0x2f')][_0x87da('0x3f')]){_0x482f65[_0x87da('0x3a')]=_[_0x87da('0x3c')](_0x482f65[_0x87da('0x3a')],{'$or':_[_0x87da('0x29')](_0x482f65[_0x87da('0x34')],function(_0x52420c){var _0x2e65db={};_0x2e65db[_0x52420c]={'$like':'%'+_0x2381b9[_0x87da('0x2f')][_0x87da('0x3f')]+'%'};return _0x2e65db;})});}_0x482f65=_[_0x87da('0x3c')]({},_0x482f65,_0x2381b9[_0x87da('0x40')]);return _0x1146ee['getConfigurations'](_0x482f65);}})[_0x87da('0x24')](function(_0x3b0ac9){if(_0x3b0ac9){_0x5e130=_0x3b0ac9[_0x87da('0x35')];if(!_0x2381b9[_0x87da('0x2f')][_0x87da('0x36')](_0x87da('0x37'))){_0x482f65['limit']=qs['limit'](_0x2381b9[_0x87da('0x2f')][_0x87da('0x1c')]);_0x482f65[_0x87da('0x38')]=qs['offset'](_0x2381b9[_0x87da('0x2f')][_0x87da('0x38')]);}return _0x1146ee[_0x87da('0x4c')](_0x482f65);}})[_0x87da('0x24')](function(_0x54bf88){if(_0x54bf88){return _0x54bf88?{'count':_0x5e130,'rows':_0x54bf88}:null;}})[_0x87da('0x24')](respondWithResult(_0x1aa3b3,null))['catch'](handleError(_0x1aa3b3,null));};exports[_0x87da('0x4d')]=function(_0x30640f,_0x3a3149,_0x44cd30){if(_0x30640f[_0x87da('0x49')]['id']){delete _0x30640f[_0x87da('0x49')]['id'];}return db[_0x87da('0x2a')][_0x87da('0x4b')]({'where':{'id':_0x30640f[_0x87da('0x45')]['id']}})[_0x87da('0x24')](handleEntityNotFound(_0x3a3149,null))[_0x87da('0x24')](function(_0x4cbd7b){if(_0x4cbd7b){_0x30640f['body'][_0x87da('0x4e')]=_0x4cbd7b['id'];_0x30640f[_0x87da('0x49')][_0x87da('0x4f')]=integrations[_0x87da('0x50')](_0x30640f[_0x87da('0x49')][_0x87da('0x51')],_0x30640f[_0x87da('0x49')][_0x87da('0x3d')]);_0x30640f['body'][_0x87da('0x52')]=integrations[_0x87da('0x53')](_0x30640f[_0x87da('0x49')]['channel'],_0x30640f['body'][_0x87da('0x3d')]);return db[_0x87da('0x54')][_0x87da('0x48')](_0x30640f[_0x87da('0x49')],{'include':[{'model':db[_0x87da('0x55')],'as':_0x87da('0x4f')},{'model':db[_0x87da('0x55')],'as':_0x87da('0x52')}]});}return null;})[_0x87da('0x24')](respondWithResult(_0x3a3149,null))[_0x87da('0x47')](handleError(_0x3a3149,null));};exports[_0x87da('0x56')]=function(_0x54e7ac,_0x528929,_0xfb7043){var _0x32d197='';var _0x1e7a38='';return db[_0x87da('0x2a')][_0x87da('0x4b')]({'where':{'id':_0x54e7ac[_0x87da('0x45')]['id']},'attributes':['id',_0x87da('0x57'),_0x87da('0x58'),'apiKey']})['then'](handleEntityNotFound(_0x528929,null))['then'](function(_0x351642){if(_0x351642){_0x1e7a38=_0x351642[_0x87da('0x57')];_0x32d197=_0x351642[_0x87da('0x58')];var _0x549fab=_0x351642['remoteUri'][_0x87da('0x59')](-0x1);if(_0x549fab==='/'){_0x32d197=_0x32d197['substring'](0x0,_0x32d197[_0x87da('0x5a')](_0x549fab));}return rp({'method':_0x87da('0x5b'),'uri':util[_0x87da('0x5c')](_0x87da('0x5d'),_0x32d197,'/api/selector/owners'),'headers':{'Authorization':_0x87da('0x5e')+_0x351642[_0x87da('0x5f')]},'json':!![]});}})[_0x87da('0x24')](function(_0x10b36b){if(_0x10b36b){var _0x1445a0=_0x10b36b['users'];var _0x2b17d5=![];var _0x53b1cf=null;for(_0x53b1cf=0x0;_0x53b1cf<_0x1445a0[_0x87da('0x35')];_0x53b1cf++){if(_0x1445a0[_0x53b1cf][_0x87da('0x60')]===_0x1e7a38){_0x2b17d5=!![];}}if(_0x2b17d5){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x528929,null))['catch'](function(_0x7bf0ac){var _0x23cd13=_0x54e7ac['query'][_0x87da('0x61')]?0x1f4:_0x7bf0ac[_0x87da('0x62')]||0x1f4;logger[_0x87da('0x25')](_0x87da('0x63'),_0x87da('0x56'),_0x23cd13,JSON[_0x87da('0x64')](_0x7bf0ac));delete _0x7bf0ac[_0x87da('0x27')];if(_0x23cd13===0x191){_0x23cd13=0x190;}_0x528929[_0x87da('0x1a')](_0x23cd13)[_0x87da('0x65')](_0x54e7ac[_0x87da('0x2f')][_0x87da('0x61')]?{'message':_0x87da('0x66'),'statusCode':_0x7bf0ac[_0x87da('0x62')]}:_0x7bf0ac);});}; \ No newline at end of file +var _0x368f=['params','rawAttributes','find','create','body','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','FreshsalesField','username','remoteUri','apiKey','lastIndexOf','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x597afc,_0x1940cd){var _0x19c0e2=function(_0x48fc8c){while(--_0x48fc8c){_0x597afc['push'](_0x597afc['shift']());}};_0x19c0e2(++_0x1940cd);}(_0x368f,0x1bd));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf368('0x0'));var rimraf=require(_0xf368('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf368('0x2'));var rp=require(_0xf368('0x3'));var moment=require(_0xf368('0x4'));var BPromise=require(_0xf368('0x5'));var Mustache=require('mustache');var util=require(_0xf368('0x6'));var path=require('path');var sox=require(_0xf368('0x7'));var csv=require(_0xf368('0x8'));var ejs=require(_0xf368('0x9'));var fs=require('fs');var fs_extra=require(_0xf368('0xa'));var _=require(_0xf368('0xb'));var squel=require(_0xf368('0xc'));var crypto=require(_0xf368('0xd'));var jsforce=require(_0xf368('0xe'));var deskjs=require(_0xf368('0xf'));var toCsv=require(_0xf368('0x8'));var querystring=require(_0xf368('0x10'));var Papa=require(_0xf368('0x11'));var Redis=require(_0xf368('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf368('0x13'));var as=require(_0xf368('0x14'));var hardwareService=require(_0xf368('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf368('0x16'));var config=require(_0xf368('0x17'));var licenseUtil=require(_0xf368('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf368('0x19'));function respondWithStatusCode(_0x1c0e4e,_0x45ffeb){_0x45ffeb=_0x45ffeb||0xcc;return function(_0x5984ca){if(_0x5984ca){return _0x1c0e4e[_0xf368('0x1a')](_0x45ffeb);}return _0x1c0e4e[_0xf368('0x1b')](_0x45ffeb)[_0xf368('0x1c')]();};}function respondWithResult(_0x337153,_0x3f04f9){_0x3f04f9=_0x3f04f9||0xc8;return function(_0x4d6b48){if(_0x4d6b48){return _0x337153[_0xf368('0x1b')](_0x3f04f9)[_0xf368('0x1d')](_0x4d6b48);}};}function respondWithFilteredResult(_0x4d17e0,_0x2ea411){return function(_0x310f23){if(_0x310f23){var _0x30c87d=typeof _0x2ea411[_0xf368('0x1e')]===_0xf368('0x1f')&&typeof _0x2ea411['limit']==='undefined';var _0xe711bd=_0x310f23[_0xf368('0x20')];var _0x57cedf=_0x30c87d?0x0:_0x2ea411['offset'];var _0x42ff07=_0x30c87d?_0x310f23[_0xf368('0x20')]:_0x2ea411[_0xf368('0x1e')]+_0x2ea411['limit'];var _0x58091d;if(_0x42ff07>=_0xe711bd){_0x42ff07=_0xe711bd;_0x58091d=0xc8;}else{_0x58091d=0xce;}_0x4d17e0[_0xf368('0x1b')](_0x58091d);return _0x4d17e0[_0xf368('0x21')](_0xf368('0x22'),_0x57cedf+'-'+_0x42ff07+'/'+_0xe711bd)[_0xf368('0x1d')](_0x310f23);}return null;};}function patchUpdates(_0x2fc3cf){return function(_0x5447a9){try{jsonpatch[_0xf368('0x23')](_0x5447a9,_0x2fc3cf,!![]);}catch(_0xf93d03){return BPromise[_0xf368('0x24')](_0xf93d03);}return _0x5447a9[_0xf368('0x25')]();};}function saveUpdates(_0x45c0a9,_0x2cbf2d){return function(_0x475987){if(_0x475987){return _0x475987[_0xf368('0x26')](_0x45c0a9)[_0xf368('0x27')](function(_0x4714e9){return _0x4714e9;});}return null;};}function removeEntity(_0x56a7f1,_0x252b08){return function(_0x3b673a){if(_0x3b673a){return _0x3b673a[_0xf368('0x28')]()['then'](function(){_0x56a7f1[_0xf368('0x1b')](0xcc)[_0xf368('0x1c')]();});}};}function handleEntityNotFound(_0x2b7c61,_0x36a72e){return function(_0x160e3d){if(!_0x160e3d){_0x2b7c61[_0xf368('0x1a')](0x194);}return _0x160e3d;};}function handleError(_0x255c0b,_0x4e4786){_0x4e4786=_0x4e4786||0x1f4;return function(_0xd43021){logger[_0xf368('0x29')](_0xd43021[_0xf368('0x2a')]);if(_0xd43021[_0xf368('0x2b')]){delete _0xd43021['name'];}_0x255c0b[_0xf368('0x1b')](_0x4e4786)[_0xf368('0x2c')](_0xd43021);};}exports[_0xf368('0x2d')]=function(_0x10de13,_0x3c7a59){var _0x1d6f9a={},_0x368b67={},_0x183e54={'count':0x0,'rows':[]};var _0x33663e=_[_0xf368('0x2e')](db[_0xf368('0x2f')]['rawAttributes'],function(_0x519f87){return{'name':_0x519f87[_0xf368('0x30')],'type':_0x519f87[_0xf368('0x31')][_0xf368('0x32')]};});_0x368b67[_0xf368('0x33')]=_['map'](_0x33663e,'name');_0x368b67[_0xf368('0x34')]=_[_0xf368('0x35')](_0x10de13[_0xf368('0x34')]);_0x368b67['filters']=_[_0xf368('0x36')](_0x368b67[_0xf368('0x33')],_0x368b67[_0xf368('0x34')]);_0x1d6f9a[_0xf368('0x37')]=_[_0xf368('0x36')](_0x368b67[_0xf368('0x33')],qs[_0xf368('0x38')](_0x10de13[_0xf368('0x34')][_0xf368('0x38')]));_0x1d6f9a['attributes']=_0x1d6f9a[_0xf368('0x37')][_0xf368('0x39')]?_0x1d6f9a['attributes']:_0x368b67['model'];if(!_0x10de13[_0xf368('0x34')][_0xf368('0x3a')](_0xf368('0x3b'))){_0x1d6f9a[_0xf368('0x3c')]=qs[_0xf368('0x3c')](_0x10de13['query'][_0xf368('0x3c')]);_0x1d6f9a['offset']=qs['offset'](_0x10de13[_0xf368('0x34')][_0xf368('0x1e')]);}_0x1d6f9a[_0xf368('0x3d')]=qs[_0xf368('0x3e')](_0x10de13[_0xf368('0x34')]['sort']);_0x1d6f9a[_0xf368('0x3f')]=qs[_0xf368('0x40')](_[_0xf368('0x41')](_0x10de13['query'],_0x368b67[_0xf368('0x40')]),_0x33663e);if(_0x10de13[_0xf368('0x34')][_0xf368('0x42')]){_0x1d6f9a[_0xf368('0x3f')]=_[_0xf368('0x43')](_0x1d6f9a[_0xf368('0x3f')],{'$or':_[_0xf368('0x2e')](_0x33663e,function(_0x26dac3){if(_0x26dac3[_0xf368('0x31')]!==_0xf368('0x44')){var _0x2e0481={};_0x2e0481[_0x26dac3[_0xf368('0x2b')]]={'$like':'%'+_0x10de13[_0xf368('0x34')][_0xf368('0x42')]+'%'};return _0x2e0481;}})});}_0x1d6f9a=_[_0xf368('0x43')]({},_0x1d6f9a,_0x10de13[_0xf368('0x45')]);var _0x45dd4d={'where':_0x1d6f9a['where']};return db[_0xf368('0x2f')][_0xf368('0x20')](_0x45dd4d)['then'](function(_0x522d61){_0x183e54[_0xf368('0x20')]=_0x522d61;if(_0x10de13[_0xf368('0x34')][_0xf368('0x46')]){_0x1d6f9a['include']=[{'all':!![]}];}return db[_0xf368('0x2f')][_0xf368('0x47')](_0x1d6f9a);})[_0xf368('0x27')](function(_0x59dd8b){_0x183e54[_0xf368('0x48')]=_0x59dd8b;return _0x183e54;})[_0xf368('0x27')](respondWithFilteredResult(_0x3c7a59,_0x1d6f9a))[_0xf368('0x49')](handleError(_0x3c7a59,null));};exports[_0xf368('0x4a')]=function(_0x5edc87,_0x4ecfb6){var _0x3e7f20={'raw':![],'where':{'id':_0x5edc87[_0xf368('0x4b')]['id']}},_0x146899={};_0x146899['model']=_['keys'](db[_0xf368('0x2f')][_0xf368('0x4c')]);_0x146899[_0xf368('0x34')]=_['keys'](_0x5edc87['query']);_0x146899['filters']=_[_0xf368('0x36')](_0x146899[_0xf368('0x33')],_0x146899[_0xf368('0x34')]);_0x3e7f20[_0xf368('0x37')]=_[_0xf368('0x36')](_0x146899[_0xf368('0x33')],qs['fields'](_0x5edc87[_0xf368('0x34')][_0xf368('0x38')]));_0x3e7f20['attributes']=_0x3e7f20[_0xf368('0x37')]['length']?_0x3e7f20['attributes']:_0x146899[_0xf368('0x33')];if(_0x5edc87['query'][_0xf368('0x46')]){_0x3e7f20['include']=[{'all':!![]}];}_0x3e7f20=_[_0xf368('0x43')]({},_0x3e7f20,_0x5edc87['options']);return db['FreshsalesAccount'][_0xf368('0x4d')](_0x3e7f20)[_0xf368('0x27')](handleEntityNotFound(_0x4ecfb6,null))[_0xf368('0x27')](respondWithResult(_0x4ecfb6,null))[_0xf368('0x49')](handleError(_0x4ecfb6,null));};exports['create']=function(_0x56d70b,_0x4c48fd){return db[_0xf368('0x2f')][_0xf368('0x4e')](_0x56d70b[_0xf368('0x4f')],{})[_0xf368('0x27')](respondWithResult(_0x4c48fd,0xc9))[_0xf368('0x49')](handleError(_0x4c48fd,null));};exports['update']=function(_0x714df1,_0x3affa7){if(_0x714df1[_0xf368('0x4f')]['id']){delete _0x714df1['body']['id'];}return db['FreshsalesAccount'][_0xf368('0x4d')]({'where':{'id':_0x714df1[_0xf368('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3affa7,null))['then'](saveUpdates(_0x714df1[_0xf368('0x4f')],null))['then'](respondWithResult(_0x3affa7,null))['catch'](handleError(_0x3affa7,null));};exports[_0xf368('0x28')]=function(_0x3c9765,_0xdaa35a){return db[_0xf368('0x2f')]['find']({'where':{'id':_0x3c9765['params']['id']}})[_0xf368('0x27')](handleEntityNotFound(_0xdaa35a,null))['then'](removeEntity(_0xdaa35a,null))[_0xf368('0x49')](handleError(_0xdaa35a,null));};exports[_0xf368('0x50')]=function(_0xfb1b89,_0x509e57,_0x5696a8){var _0x19c35d={};var _0x540657={};var _0x9c708f;var _0x5a5803;return db[_0xf368('0x2f')]['findOne']({'where':{'id':_0xfb1b89[_0xf368('0x4b')]['id']}})[_0xf368('0x27')](handleEntityNotFound(_0x509e57,null))[_0xf368('0x27')](function(_0x54e445){if(_0x54e445){_0x9c708f=_0x54e445;_0x540657[_0xf368('0x33')]=_[_0xf368('0x35')](db[_0xf368('0x51')]['rawAttributes']);_0x540657[_0xf368('0x34')]=_[_0xf368('0x35')](_0xfb1b89[_0xf368('0x34')]);_0x540657[_0xf368('0x40')]=_['intersection'](_0x540657[_0xf368('0x33')],_0x540657['query']);_0x19c35d[_0xf368('0x37')]=_[_0xf368('0x36')](_0x540657['model'],qs[_0xf368('0x38')](_0xfb1b89[_0xf368('0x34')][_0xf368('0x38')]));_0x19c35d[_0xf368('0x37')]=_0x19c35d['attributes'][_0xf368('0x39')]?_0x19c35d[_0xf368('0x37')]:_0x540657[_0xf368('0x33')];_0x19c35d['order']=qs[_0xf368('0x3e')](_0xfb1b89[_0xf368('0x34')][_0xf368('0x3e')]);_0x19c35d['where']=qs['filters'](_[_0xf368('0x41')](_0xfb1b89[_0xf368('0x34')],_0x540657[_0xf368('0x40')]));if(_0xfb1b89[_0xf368('0x34')][_0xf368('0x42')]){_0x19c35d[_0xf368('0x3f')]=_[_0xf368('0x43')](_0x19c35d['where'],{'$or':_[_0xf368('0x2e')](_0x19c35d['attributes'],function(_0x6e309f){var _0x4b5596={};_0x4b5596[_0x6e309f]={'$like':'%'+_0xfb1b89['query'][_0xf368('0x42')]+'%'};return _0x4b5596;})});}_0x19c35d=_[_0xf368('0x43')]({},_0x19c35d,_0xfb1b89['options']);return _0x9c708f[_0xf368('0x50')](_0x19c35d);}})[_0xf368('0x27')](function(_0x2579f4){if(_0x2579f4){_0x5a5803=_0x2579f4['length'];if(!_0xfb1b89['query'][_0xf368('0x3a')](_0xf368('0x3b'))){_0x19c35d[_0xf368('0x3c')]=qs['limit'](_0xfb1b89[_0xf368('0x34')][_0xf368('0x3c')]);_0x19c35d[_0xf368('0x1e')]=qs[_0xf368('0x1e')](_0xfb1b89[_0xf368('0x34')]['offset']);}return _0x9c708f['getConfigurations'](_0x19c35d);}})[_0xf368('0x27')](function(_0x556bb3){if(_0x556bb3){return _0x556bb3?{'count':_0x5a5803,'rows':_0x556bb3}:null;}})[_0xf368('0x27')](respondWithResult(_0x509e57,null))[_0xf368('0x49')](handleError(_0x509e57,null));};exports[_0xf368('0x52')]=function(_0x2879a0,_0x4cb8b0,_0x24d289){if(_0x2879a0[_0xf368('0x4f')]['id']){delete _0x2879a0[_0xf368('0x4f')]['id'];}return db[_0xf368('0x2f')][_0xf368('0x53')]({'where':{'id':_0x2879a0[_0xf368('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4cb8b0,null))['then'](function(_0x43f112){if(_0x43f112){_0x2879a0['body'][_0xf368('0x54')]=_0x43f112['id'];_0x2879a0['body'][_0xf368('0x55')]=integrations['getSubjects'](_0x2879a0[_0xf368('0x4f')][_0xf368('0x56')],_0x2879a0[_0xf368('0x4f')][_0xf368('0x31')]);_0x2879a0[_0xf368('0x4f')][_0xf368('0x57')]=integrations['getDescriptions'](_0x2879a0[_0xf368('0x4f')][_0xf368('0x56')],_0x2879a0[_0xf368('0x4f')][_0xf368('0x31')]);return db[_0xf368('0x51')]['create'](_0x2879a0['body'],{'include':[{'model':db[_0xf368('0x58')],'as':'Subjects'},{'model':db[_0xf368('0x58')],'as':_0xf368('0x57')}]});}return null;})[_0xf368('0x27')](respondWithResult(_0x4cb8b0,null))[_0xf368('0x49')](handleError(_0x4cb8b0,null));};exports['getFields']=function(_0x44f0a1,_0x2a4961,_0x3372bd){var _0x288f69='';var _0xb504f='';return db[_0xf368('0x2f')][_0xf368('0x53')]({'where':{'id':_0x44f0a1['params']['id']},'attributes':['id',_0xf368('0x59'),_0xf368('0x5a'),_0xf368('0x5b')]})[_0xf368('0x27')](handleEntityNotFound(_0x2a4961,null))[_0xf368('0x27')](function(_0x365b43){if(_0x365b43){_0xb504f=_0x365b43[_0xf368('0x59')];_0x288f69=_0x365b43[_0xf368('0x5a')];var _0x3a6073=_0x365b43[_0xf368('0x5a')]['slice'](-0x1);if(_0x3a6073==='/'){_0x288f69=_0x288f69['substring'](0x0,_0x288f69[_0xf368('0x5c')](_0x3a6073));}return rp({'method':'GET','uri':util[_0xf368('0x5d')](_0xf368('0x5e'),_0x288f69,_0xf368('0x5f')),'headers':{'Authorization':'Token\x20token='+_0x365b43[_0xf368('0x5b')]},'json':!![]});}})[_0xf368('0x27')](function(_0x10f5de){if(_0x10f5de){var _0xecbd66=_0x10f5de['users'];var _0x31ab96=![];var _0x387e0d=null;for(_0x387e0d=0x0;_0x387e0d<_0xecbd66[_0xf368('0x39')];_0x387e0d++){if(_0xecbd66[_0x387e0d][_0xf368('0x60')]===_0xb504f){_0x31ab96=!![];}}if(_0x31ab96){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf368('0x61')});}}})['then'](respondWithResult(_0x2a4961,null))[_0xf368('0x49')](function(_0x4ade2c){var _0xf23053=_0x44f0a1[_0xf368('0x34')][_0xf368('0x62')]?0x1f4:_0x4ade2c[_0xf368('0x63')]||0x1f4;logger[_0xf368('0x29')](_0xf368('0x64'),_0xf368('0x65'),_0xf23053,JSON[_0xf368('0x66')](_0x4ade2c));delete _0x4ade2c[_0xf368('0x2b')];if(_0xf23053===0x191){_0xf23053=0x190;}_0x2a4961['status'](_0xf23053)[_0xf368('0x2c')](_0x44f0a1[_0xf368('0x34')][_0xf368('0x62')]?{'message':_0xf368('0x67'),'statusCode':_0x4ade2c[_0xf368('0x63')]}:_0x4ade2c);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5a1fb00..48ea704 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 _0x8ace=['request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x8ace,0x1bc));var _0xe8ac=function(_0xc069,_0x3005d6){_0xc069=_0xc069-0x0;var _0x3f143c=_0x8ace[_0xc069];return _0x3f143c;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));var integrations=require(_0xe8ac('0xb'));module[_0xe8ac('0xc')]=function(_0x2b48ec,_0x4eb087){return _0x2b48ec[_0xe8ac('0xd')](_0xe8ac('0xe'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaf2=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xcaf2,0x8a));var _0x2caf=function(_0x19a2eb,_0x2df439){_0x19a2eb=_0x19a2eb-0x0;var _0x3c8514=_0xcaf2[_0x19a2eb];return _0x3c8514;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));var integrations=require(_0x2caf('0x7'));module[_0x2caf('0x8')]=function(_0x599ce7,_0xc44e4e){return _0x599ce7[_0x2caf('0x9')](_0x2caf('0xa'),attributes,{'tableName':_0x2caf('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 3a95077..823f461 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 _0x7096=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','map','model','find','ShowFreshsalesAccount','util','bluebird','ioredis','../../mysqldb'];(function(_0xaa8c2c,_0x36d94f){var _0x18f841=function(_0x332014){while(--_0x332014){_0xaa8c2c['push'](_0xaa8c2c['shift']());}};_0x18f841(++_0x36d94f);}(_0x7096,0x10c));var _0x6709=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7096[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['findAll']({'raw':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x235a54[_0x6709('0x18')]?_0x235a54['options'][_0x6709('0x1a')]||null:null,'attributes':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1b')]||null:null,'limit':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1c')]||null:null,'include':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x235a54[_0x6709('0x18')]['include'],function(_0x29f25f){return{'model':db[_0x29f25f[_0x6709('0x1f')]],'as':_0x29f25f['as'],'attributes':_0x29f25f[_0x6709('0x1b')],'include':_0x29f25f['include']?_[_0x6709('0x1e')](_0x29f25f[_0x6709('0x1d')],function(_0x20a347){return{'model':db[_0x20a347[_0x6709('0x1f')]],'as':_0x20a347['as'],'attributes':_0x20a347['attributes'],'include':_0x20a347[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x20a347['include'],function(_0x585073){return{'model':db[_0x585073[_0x6709('0x1f')]],'as':_0x585073['as'],'attributes':_0x585073['attributes']};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x2499a2){logger['info'](_0x6709('0x16'),_0x235a54);logger['debug'](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x2499a2));_0x9c1fd8(_0x2499a2);})['catch'](function(_0x137137){logger['error'](_0x6709('0x16'),_0x137137[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e['error'](0x1f4,_0x137137[_0x6709('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x138318){var _0x135f46=this;return new Promise(function(_0x4b93b2,_0x564dcb){return db[_0x6709('0x17')][_0x6709('0x20')]({'raw':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1a')]||null:null,'attributes':_0x138318[_0x6709('0x18')]?_0x138318['options'][_0x6709('0x1b')]||null:null,'include':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1d')]?_['map'](_0x138318[_0x6709('0x18')][_0x6709('0x1d')],function(_0x124e01){return{'model':db[_0x124e01[_0x6709('0x1f')]],'as':_0x124e01['as'],'attributes':_0x124e01['attributes'],'include':_0x124e01[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x124e01['include'],function(_0x8952f1){return{'model':db[_0x8952f1[_0x6709('0x1f')]],'as':_0x8952f1['as'],'attributes':_0x8952f1['attributes'],'include':_0x8952f1[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x8952f1[_0x6709('0x1d')],function(_0xf30c4c){return{'model':db[_0xf30c4c[_0x6709('0x1f')]],'as':_0xf30c4c['as'],'attributes':_0xf30c4c[_0x6709('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x4bfed4){logger[_0x6709('0xc')](_0x6709('0x21'),_0x138318);logger['debug'](_0x6709('0x21'),_0x138318,JSON[_0x6709('0x10')](_0x4bfed4));_0x4b93b2(_0x4bfed4);})[_0x6709('0x15')](function(_0x2bb89c){logger[_0x6709('0x11')](_0x6709('0x21'),_0x2bb89c['message'],_0x138318);_0x564dcb(_0x135f46[_0x6709('0x11')](0x1f4,_0x2bb89c['message']));});});}; \ No newline at end of file +var _0x0295=['find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount'];(function(_0x3e6af6,_0x4b62bd){var _0x24a984=function(_0x2b4a49){while(--_0x2b4a49){_0x3e6af6['push'](_0x3e6af6['shift']());}};_0x24a984(++_0x4b62bd);}(_0x0295,0x1f0));var _0x5029=function(_0x9a51b3,_0x34ac18){_0x9a51b3=_0x9a51b3-0x0;var _0x4ca7b1=_0x0295[_0x9a51b3];return _0x4ca7b1;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['GetFreshsalesAccount']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')]({'raw':_0x1ed567[_0x5029('0x17')]?_0x1ed567['options'][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')]['attributes']||null:null,'limit':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')]['limit']||null:null,'include':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')],function(_0x125c26){return{'model':db[_0x125c26[_0x5029('0x1c')]],'as':_0x125c26['as'],'attributes':_0x125c26[_0x5029('0x1d')],'include':_0x125c26['include']?_['map'](_0x125c26['include'],function(_0x588d90){return{'model':db[_0x588d90[_0x5029('0x1c')]],'as':_0x588d90['as'],'attributes':_0x588d90['attributes'],'include':_0x588d90['include']?_[_0x5029('0x1b')](_0x588d90[_0x5029('0x1a')],function(_0x36d810){return{'model':db[_0x36d810['model']],'as':_0x36d810['as'],'attributes':_0x36d810[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x5e45c4){logger[_0x5029('0xb')](_0x5029('0x1e'),_0x1ed567);logger[_0x5029('0xd')]('GetFreshsalesAccount',_0x1ed567,JSON[_0x5029('0xf')](_0x5e45c4));_0x35de81(_0x5e45c4);})[_0x5029('0x14')](function(_0xe5313e){logger['error'](_0x5029('0x1e'),_0xe5313e[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155['error'](0x1f4,_0xe5313e[_0x5029('0x12')]));});});};exports[_0x5029('0x1f')]=function(_0x4434ff){var _0x1c3dd9=this;return new Promise(function(_0x196830,_0x2a1ed6){return db[_0x5029('0x15')][_0x5029('0x20')]({'raw':_0x4434ff[_0x5029('0x17')]?_0x4434ff[_0x5029('0x17')][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x4434ff[_0x5029('0x17')]?_0x4434ff['options'][_0x5029('0x19')]||null:null,'attributes':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')]['attributes']||null:null,'include':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x4434ff['options'][_0x5029('0x1a')],function(_0x15d882){return{'model':db[_0x15d882[_0x5029('0x1c')]],'as':_0x15d882['as'],'attributes':_0x15d882[_0x5029('0x1d')],'include':_0x15d882[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x15d882[_0x5029('0x1a')],function(_0x22205e){return{'model':db[_0x22205e[_0x5029('0x1c')]],'as':_0x22205e['as'],'attributes':_0x22205e['attributes'],'include':_0x22205e[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x22205e[_0x5029('0x1a')],function(_0x1b3817){return{'model':db[_0x1b3817['model']],'as':_0x1b3817['as'],'attributes':_0x1b3817[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x3e2d88){logger['info']('ShowFreshsalesAccount',_0x4434ff);logger[_0x5029('0xd')](_0x5029('0x1f'),_0x4434ff,JSON['stringify'](_0x3e2d88));_0x196830(_0x3e2d88);})['catch'](function(_0x9656f2){logger[_0x5029('0x10')](_0x5029('0x1f'),_0x9656f2[_0x5029('0x12')],_0x4434ff);_0x2a1ed6(_0x1c3dd9[_0x5029('0x10')](0x1f4,_0x9656f2[_0x5029('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6baf8f9..3c932a4 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 _0x2b5a=['getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0xb3a08a,_0x16324e){var _0x163346=function(_0x6c2337){while(--_0x6c2337){_0xb3a08a['push'](_0xb3a08a['shift']());}};_0x163346(++_0x16324e);}(_0x2b5a,0xc0));var _0xa2b5=function(_0x2a8238,_0x1e5d8){_0x2a8238=_0x2a8238-0x0;var _0x3c3a88=_0x2b5a[_0x2a8238];return _0x3c3a88;};'use strict';var multer=require(_0xa2b5('0x0'));var util=require(_0xa2b5('0x1'));var path=require(_0xa2b5('0x2'));var timeout=require(_0xa2b5('0x3'));var express=require('express');var router=express[_0xa2b5('0x4')]();var fs_extra=require(_0xa2b5('0x5'));var auth=require(_0xa2b5('0x6'));var interaction=require(_0xa2b5('0x7'));var config=require(_0xa2b5('0x8'));var controller=require(_0xa2b5('0x9'));router[_0xa2b5('0xa')]('/',auth[_0xa2b5('0xb')](),controller[_0xa2b5('0xc')]);router[_0xa2b5('0xa')](_0xa2b5('0xd'),auth['isAuthenticated'](),controller[_0xa2b5('0xe')]);router[_0xa2b5('0xa')](_0xa2b5('0xf'),auth[_0xa2b5('0xb')](),controller[_0xa2b5('0x10')]);router[_0xa2b5('0xa')](_0xa2b5('0x11'),auth[_0xa2b5('0xb')](),controller[_0xa2b5('0x12')]);router[_0xa2b5('0xa')](_0xa2b5('0x13'),auth[_0xa2b5('0xb')](),controller[_0xa2b5('0x14')]);router['post']('/',auth[_0xa2b5('0xb')](),controller['create']);router[_0xa2b5('0x15')](_0xa2b5('0xd'),auth[_0xa2b5('0xb')](),controller[_0xa2b5('0x16')]);router[_0xa2b5('0x17')](_0xa2b5('0xd'),auth['isAuthenticated'](),controller[_0xa2b5('0x18')]);module[_0xa2b5('0x19')]=router; \ No newline at end of file +var _0x3a13=['create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post'];(function(_0x2e08e3,_0xf61e9e){var _0x28edad=function(_0x4e7a9){while(--_0x4e7a9){_0x2e08e3['push'](_0x2e08e3['shift']());}};_0x28edad(++_0xf61e9e);}(_0x3a13,0x1ae));var _0x33a1=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x3a13[_0x2df507];return _0x1f7167;};'use strict';var multer=require('multer');var util=require(_0x33a1('0x0'));var path=require(_0x33a1('0x1'));var timeout=require(_0x33a1('0x2'));var express=require(_0x33a1('0x3'));var router=express[_0x33a1('0x4')]();var fs_extra=require(_0x33a1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x33a1('0x6'));var controller=require(_0x33a1('0x7'));router[_0x33a1('0x8')]('/',auth['isAuthenticated'](),controller[_0x33a1('0x9')]);router[_0x33a1('0x8')](_0x33a1('0xa'),auth[_0x33a1('0xb')](),controller[_0x33a1('0xc')]);router[_0x33a1('0x8')](_0x33a1('0xd'),auth[_0x33a1('0xb')](),controller[_0x33a1('0xe')]);router[_0x33a1('0x8')](_0x33a1('0xf'),auth['isAuthenticated'](),controller[_0x33a1('0x10')]);router[_0x33a1('0x8')](_0x33a1('0x11'),auth[_0x33a1('0xb')](),controller[_0x33a1('0x12')]);router[_0x33a1('0x13')]('/',auth[_0x33a1('0xb')](),controller[_0x33a1('0x14')]);router[_0x33a1('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x33a1('0x16')]);router[_0x33a1('0x17')](_0x33a1('0xa'),auth[_0x33a1('0xb')](),controller[_0x33a1('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 37d8a13..e60e23a 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 _0x04a9=['exports','STRING','sequelize'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x04a9,0x16d));var _0x904a=function(_0xcd59b2,_0x1f5c43){_0xcd59b2=_0xcd59b2-0x0;var _0x44837d=_0x04a9[_0xcd59b2];return _0x44837d;};'use strict';var Sequelize=require(_0x904a('0x0'));module[_0x904a('0x1')]={'name':{'type':Sequelize[_0x904a('0x2')]},'description':{'type':Sequelize[_0x904a('0x2')]}}; \ No newline at end of file +var _0xce4c=['sequelize','STRING'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0xce4c,0x154));var _0xcce4=function(_0x54682c,_0x2d26a8){_0x54682c=_0x54682c-0x0;var _0x440548=_0xce4c[_0x54682c];return _0x440548;};'use strict';var Sequelize=require(_0xcce4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcce4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ed1eb1c..c4c21c0 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 _0xcf9c=['include','findAll','rows','catch','params','includeAll','create','body','find','getSubjects','findOne','FreshsalesField','order','options','getDescriptions','getFields','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf9c,0x1de));var _0xccf9=function(_0x2ac056,_0x2e138){_0x2ac056=_0x2ac056-0x0;var _0x2e40b3=_0xcf9c[_0x2ac056];return _0x2e40b3;};'use strict';var emlformat=require(_0xccf9('0x0'));var rimraf=require(_0xccf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xccf9('0x2'));var moment=require(_0xccf9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xccf9('0x4'));var util=require('util');var path=require(_0xccf9('0x5'));var sox=require(_0xccf9('0x6'));var csv=require(_0xccf9('0x7'));var ejs=require(_0xccf9('0x8'));var fs=require('fs');var fs_extra=require(_0xccf9('0x9'));var _=require('lodash');var squel=require(_0xccf9('0xa'));var crypto=require(_0xccf9('0xb'));var jsforce=require(_0xccf9('0xc'));var deskjs=require(_0xccf9('0xd'));var toCsv=require(_0xccf9('0x7'));var querystring=require('querystring');var Papa=require(_0xccf9('0xe'));var Redis=require(_0xccf9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xccf9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccf9('0x11'));var logger=require(_0xccf9('0x12'))('api');var utils=require(_0xccf9('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xccf9('0x14'));var db=require(_0xccf9('0x15'))['db'];function respondWithStatusCode(_0x5ab10d,_0x25ffd8){_0x25ffd8=_0x25ffd8||0xcc;return function(_0x14bf58){if(_0x14bf58){return _0x5ab10d[_0xccf9('0x16')](_0x25ffd8);}return _0x5ab10d[_0xccf9('0x17')](_0x25ffd8)[_0xccf9('0x18')]();};}function respondWithResult(_0x46a9f2,_0x20cfdc){_0x20cfdc=_0x20cfdc||0xc8;return function(_0x49acea){if(_0x49acea){return _0x46a9f2[_0xccf9('0x17')](_0x20cfdc)[_0xccf9('0x19')](_0x49acea);}};}function respondWithFilteredResult(_0x2ebf88,_0x1f7088){return function(_0x1af10a){if(_0x1af10a){var _0x4f80b7=typeof _0x1f7088[_0xccf9('0x1a')]==='undefined'&&typeof _0x1f7088[_0xccf9('0x1b')]==='undefined';var _0xaa1c0=_0x1af10a[_0xccf9('0x1c')];var _0x2547c4=_0x4f80b7?0x0:_0x1f7088[_0xccf9('0x1a')];var _0x311425=_0x4f80b7?_0x1af10a[_0xccf9('0x1c')]:_0x1f7088['offset']+_0x1f7088[_0xccf9('0x1b')];var _0x5ddfd5;if(_0x311425>=_0xaa1c0){_0x311425=_0xaa1c0;_0x5ddfd5=0xc8;}else{_0x5ddfd5=0xce;}_0x2ebf88[_0xccf9('0x17')](_0x5ddfd5);return _0x2ebf88[_0xccf9('0x1d')](_0xccf9('0x1e'),_0x2547c4+'-'+_0x311425+'/'+_0xaa1c0)['json'](_0x1af10a);}return null;};}function patchUpdates(_0x55469f){return function(_0x45d52c){try{jsonpatch[_0xccf9('0x1f')](_0x45d52c,_0x55469f,!![]);}catch(_0x5eebbd){return BPromise[_0xccf9('0x20')](_0x5eebbd);}return _0x45d52c[_0xccf9('0x21')]();};}function saveUpdates(_0x26bdda,_0x30e70d){return function(_0x1d3f1b){if(_0x1d3f1b){return _0x1d3f1b[_0xccf9('0x22')](_0x26bdda)[_0xccf9('0x23')](function(_0x45652a){return _0x45652a;});}return null;};}function removeEntity(_0x4c3350,_0x453e2c){return function(_0x39f19e){if(_0x39f19e){return _0x39f19e[_0xccf9('0x24')]()[_0xccf9('0x23')](function(){_0x4c3350[_0xccf9('0x17')](0xcc)[_0xccf9('0x18')]();});}};}function handleEntityNotFound(_0x5174c7,_0xf22447){return function(_0x59a358){if(!_0x59a358){_0x5174c7[_0xccf9('0x16')](0x194);}return _0x59a358;};}function handleError(_0x44185e,_0x5f0221){_0x5f0221=_0x5f0221||0x1f4;return function(_0x147fb5){logger['error'](_0x147fb5[_0xccf9('0x25')]);if(_0x147fb5[_0xccf9('0x26')]){delete _0x147fb5['name'];}_0x44185e[_0xccf9('0x17')](_0x5f0221)['send'](_0x147fb5);};}exports[_0xccf9('0x27')]=function(_0x2b8212,_0x279f9a){var _0x5a99ba={},_0x444f2f={},_0x392cef={'count':0x0,'rows':[]};var _0x1b6c71=_[_0xccf9('0x28')](db[_0xccf9('0x29')][_0xccf9('0x2a')],function(_0x4e7e5d){return{'name':_0x4e7e5d[_0xccf9('0x2b')],'type':_0x4e7e5d[_0xccf9('0x2c')]['key']};});_0x444f2f['model']=_[_0xccf9('0x28')](_0x1b6c71,'name');_0x444f2f['query']=_[_0xccf9('0x2d')](_0x2b8212[_0xccf9('0x2e')]);_0x444f2f[_0xccf9('0x2f')]=_[_0xccf9('0x30')](_0x444f2f['model'],_0x444f2f[_0xccf9('0x2e')]);_0x5a99ba['attributes']=_['intersection'](_0x444f2f[_0xccf9('0x31')],qs['fields'](_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x32')]));_0x5a99ba[_0xccf9('0x33')]=_0x5a99ba['attributes'][_0xccf9('0x34')]?_0x5a99ba[_0xccf9('0x33')]:_0x444f2f[_0xccf9('0x31')];if(!_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x35')](_0xccf9('0x36'))){_0x5a99ba[_0xccf9('0x1b')]=qs[_0xccf9('0x1b')](_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x1b')]);_0x5a99ba[_0xccf9('0x1a')]=qs[_0xccf9('0x1a')](_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x1a')]);}_0x5a99ba['order']=qs['sort'](_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x37')]);_0x5a99ba[_0xccf9('0x38')]=qs[_0xccf9('0x2f')](_[_0xccf9('0x39')](_0x2b8212[_0xccf9('0x2e')],_0x444f2f['filters']),_0x1b6c71);if(_0x2b8212['query']['filter']){_0x5a99ba[_0xccf9('0x38')]=_['merge'](_0x5a99ba[_0xccf9('0x38')],{'$or':_[_0xccf9('0x28')](_0x1b6c71,function(_0x571670){if(_0x571670['type']!==_0xccf9('0x3a')){var _0x13ebda={};_0x13ebda[_0x571670[_0xccf9('0x26')]]={'$like':'%'+_0x2b8212[_0xccf9('0x2e')][_0xccf9('0x3b')]+'%'};return _0x13ebda;}})});}_0x5a99ba=_[_0xccf9('0x3c')]({},_0x5a99ba,_0x2b8212['options']);var _0x47704d={'where':_0x5a99ba[_0xccf9('0x38')]};return db[_0xccf9('0x29')][_0xccf9('0x1c')](_0x47704d)[_0xccf9('0x23')](function(_0x544239){_0x392cef[_0xccf9('0x1c')]=_0x544239;if(_0x2b8212[_0xccf9('0x2e')]['includeAll']){_0x5a99ba[_0xccf9('0x3d')]=[{'all':!![]}];}return db[_0xccf9('0x29')][_0xccf9('0x3e')](_0x5a99ba);})[_0xccf9('0x23')](function(_0x12b37c){_0x392cef[_0xccf9('0x3f')]=_0x12b37c;return _0x392cef;})[_0xccf9('0x23')](respondWithFilteredResult(_0x279f9a,_0x5a99ba))[_0xccf9('0x40')](handleError(_0x279f9a,null));};exports['show']=function(_0x317785,_0x4f8333){var _0x126e04={'raw':![],'where':{'id':_0x317785[_0xccf9('0x41')]['id']}},_0x1bbb91={};_0x1bbb91[_0xccf9('0x31')]=_['keys'](db[_0xccf9('0x29')]['rawAttributes']);_0x1bbb91[_0xccf9('0x2e')]=_[_0xccf9('0x2d')](_0x317785[_0xccf9('0x2e')]);_0x1bbb91[_0xccf9('0x2f')]=_[_0xccf9('0x30')](_0x1bbb91['model'],_0x1bbb91['query']);_0x126e04['attributes']=_[_0xccf9('0x30')](_0x1bbb91[_0xccf9('0x31')],qs['fields'](_0x317785[_0xccf9('0x2e')][_0xccf9('0x32')]));_0x126e04[_0xccf9('0x33')]=_0x126e04[_0xccf9('0x33')][_0xccf9('0x34')]?_0x126e04[_0xccf9('0x33')]:_0x1bbb91[_0xccf9('0x31')];if(_0x317785[_0xccf9('0x2e')][_0xccf9('0x42')]){_0x126e04[_0xccf9('0x3d')]=[{'all':!![]}];}_0x126e04=_[_0xccf9('0x3c')]({},_0x126e04,_0x317785['options']);return db[_0xccf9('0x29')]['find'](_0x126e04)[_0xccf9('0x23')](handleEntityNotFound(_0x4f8333,null))['then'](respondWithResult(_0x4f8333,null))[_0xccf9('0x40')](handleError(_0x4f8333,null));};exports[_0xccf9('0x43')]=function(_0x39d97c,_0x1b1e7c){return db[_0xccf9('0x29')]['create'](_0x39d97c[_0xccf9('0x44')],{})[_0xccf9('0x23')](respondWithResult(_0x1b1e7c,0xc9))[_0xccf9('0x40')](handleError(_0x1b1e7c,null));};exports['update']=function(_0x4d8e98,_0x10a412){if(_0x4d8e98[_0xccf9('0x44')]['id']){delete _0x4d8e98[_0xccf9('0x44')]['id'];}return db[_0xccf9('0x29')][_0xccf9('0x45')]({'where':{'id':_0x4d8e98[_0xccf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x10a412,null))[_0xccf9('0x23')](saveUpdates(_0x4d8e98['body'],null))[_0xccf9('0x23')](respondWithResult(_0x10a412,null))[_0xccf9('0x40')](handleError(_0x10a412,null));};exports[_0xccf9('0x24')]=function(_0x275f2f,_0x595716){return db[_0xccf9('0x29')]['find']({'where':{'id':_0x275f2f['params']['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x595716,null))[_0xccf9('0x23')](removeEntity(_0x595716,null))[_0xccf9('0x40')](handleError(_0x595716,null));};exports[_0xccf9('0x46')]=function(_0x43ddc3,_0x5ccfdd,_0x5955ef){var _0x561ca9={};var _0x3119cf={};var _0x2a44ac;var _0x1a68e9;return db[_0xccf9('0x29')][_0xccf9('0x47')]({'where':{'id':_0x43ddc3[_0xccf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ccfdd,null))[_0xccf9('0x23')](function(_0x15b912){if(_0x15b912){_0x2a44ac=_0x15b912;_0x3119cf[_0xccf9('0x31')]=_[_0xccf9('0x2d')](db[_0xccf9('0x48')][_0xccf9('0x2a')]);_0x3119cf[_0xccf9('0x2e')]=_[_0xccf9('0x2d')](_0x43ddc3[_0xccf9('0x2e')]);_0x3119cf[_0xccf9('0x2f')]=_[_0xccf9('0x30')](_0x3119cf[_0xccf9('0x31')],_0x3119cf['query']);_0x561ca9[_0xccf9('0x33')]=_[_0xccf9('0x30')](_0x3119cf[_0xccf9('0x31')],qs['fields'](_0x43ddc3[_0xccf9('0x2e')][_0xccf9('0x32')]));_0x561ca9['attributes']=_0x561ca9[_0xccf9('0x33')][_0xccf9('0x34')]?_0x561ca9[_0xccf9('0x33')]:_0x3119cf[_0xccf9('0x31')];_0x561ca9[_0xccf9('0x49')]=qs[_0xccf9('0x37')](_0x43ddc3['query'][_0xccf9('0x37')]);_0x561ca9[_0xccf9('0x38')]=qs[_0xccf9('0x2f')](_[_0xccf9('0x39')](_0x43ddc3[_0xccf9('0x2e')],_0x3119cf[_0xccf9('0x2f')]));if(_0x43ddc3[_0xccf9('0x2e')][_0xccf9('0x3b')]){_0x561ca9['where']=_[_0xccf9('0x3c')](_0x561ca9[_0xccf9('0x38')],{'$or':_[_0xccf9('0x28')](_0x561ca9[_0xccf9('0x33')],function(_0x21bf68){var _0x3d0226={};_0x3d0226[_0x21bf68]={'$like':'%'+_0x43ddc3['query'][_0xccf9('0x3b')]+'%'};return _0x3d0226;})});}_0x561ca9=_[_0xccf9('0x3c')]({},_0x561ca9,_0x43ddc3[_0xccf9('0x4a')]);return _0x2a44ac['getSubjects'](_0x561ca9);}})[_0xccf9('0x23')](function(_0x4c1710){if(_0x4c1710){_0x1a68e9=_0x4c1710[_0xccf9('0x34')];if(!_0x43ddc3['query'][_0xccf9('0x35')](_0xccf9('0x36'))){_0x561ca9['limit']=qs[_0xccf9('0x1b')](_0x43ddc3['query'][_0xccf9('0x1b')]);_0x561ca9[_0xccf9('0x1a')]=qs[_0xccf9('0x1a')](_0x43ddc3[_0xccf9('0x2e')][_0xccf9('0x1a')]);}return _0x2a44ac[_0xccf9('0x46')](_0x561ca9);}})[_0xccf9('0x23')](function(_0x20b370){if(_0x20b370){return _0x20b370?{'count':_0x1a68e9,'rows':_0x20b370}:null;}})['then'](respondWithResult(_0x5ccfdd,null))['catch'](handleError(_0x5ccfdd,null));};exports[_0xccf9('0x4b')]=function(_0x4083b1,_0x120c37,_0x5862bf){var _0x452c3f={};var _0x2f7a53={};var _0x2c37a2;var _0x51dc86;return db[_0xccf9('0x29')]['findOne']({'where':{'id':_0x4083b1[_0xccf9('0x41')]['id']}})['then'](handleEntityNotFound(_0x120c37,null))[_0xccf9('0x23')](function(_0xb07d02){if(_0xb07d02){_0x2c37a2=_0xb07d02;_0x2f7a53[_0xccf9('0x31')]=_[_0xccf9('0x2d')](db[_0xccf9('0x48')][_0xccf9('0x2a')]);_0x2f7a53[_0xccf9('0x2e')]=_['keys'](_0x4083b1['query']);_0x2f7a53['filters']=_[_0xccf9('0x30')](_0x2f7a53['model'],_0x2f7a53[_0xccf9('0x2e')]);_0x452c3f[_0xccf9('0x33')]=_[_0xccf9('0x30')](_0x2f7a53[_0xccf9('0x31')],qs[_0xccf9('0x32')](_0x4083b1[_0xccf9('0x2e')][_0xccf9('0x32')]));_0x452c3f[_0xccf9('0x33')]=_0x452c3f[_0xccf9('0x33')][_0xccf9('0x34')]?_0x452c3f[_0xccf9('0x33')]:_0x2f7a53['model'];_0x452c3f[_0xccf9('0x49')]=qs[_0xccf9('0x37')](_0x4083b1[_0xccf9('0x2e')][_0xccf9('0x37')]);_0x452c3f['where']=qs[_0xccf9('0x2f')](_[_0xccf9('0x39')](_0x4083b1[_0xccf9('0x2e')],_0x2f7a53[_0xccf9('0x2f')]));if(_0x4083b1[_0xccf9('0x2e')]['filter']){_0x452c3f[_0xccf9('0x38')]=_['merge'](_0x452c3f['where'],{'$or':_[_0xccf9('0x28')](_0x452c3f['attributes'],function(_0x39b9d6){var _0x4bdf0a={};_0x4bdf0a[_0x39b9d6]={'$like':'%'+_0x4083b1['query'][_0xccf9('0x3b')]+'%'};return _0x4bdf0a;})});}_0x452c3f=_[_0xccf9('0x3c')]({},_0x452c3f,_0x4083b1[_0xccf9('0x4a')]);return _0x2c37a2[_0xccf9('0x4b')](_0x452c3f);}})[_0xccf9('0x23')](function(_0x14dec5){if(_0x14dec5){_0x51dc86=_0x14dec5[_0xccf9('0x34')];if(!_0x4083b1[_0xccf9('0x2e')][_0xccf9('0x35')](_0xccf9('0x36'))){_0x452c3f[_0xccf9('0x1b')]=qs['limit'](_0x4083b1[_0xccf9('0x2e')]['limit']);_0x452c3f[_0xccf9('0x1a')]=qs[_0xccf9('0x1a')](_0x4083b1['query'][_0xccf9('0x1a')]);}return _0x2c37a2[_0xccf9('0x4b')](_0x452c3f);}})['then'](function(_0x22b44d){if(_0x22b44d){return _0x22b44d?{'count':_0x51dc86,'rows':_0x22b44d}:null;}})[_0xccf9('0x23')](respondWithResult(_0x120c37,null))['catch'](handleError(_0x120c37,null));};exports['getFields']=function(_0x33a4ad,_0xd95959,_0x38850a){var _0x367f89={};var _0xe85b48={};var _0x1cd856;var _0x885492;return db[_0xccf9('0x29')][_0xccf9('0x47')]({'where':{'id':_0x33a4ad[_0xccf9('0x41')]['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0xd95959,null))[_0xccf9('0x23')](function(_0x1c3bc0){if(_0x1c3bc0){_0x1cd856=_0x1c3bc0;_0xe85b48['model']=_[_0xccf9('0x2d')](db[_0xccf9('0x48')][_0xccf9('0x2a')]);_0xe85b48[_0xccf9('0x2e')]=_[_0xccf9('0x2d')](_0x33a4ad[_0xccf9('0x2e')]);_0xe85b48[_0xccf9('0x2f')]=_[_0xccf9('0x30')](_0xe85b48['model'],_0xe85b48[_0xccf9('0x2e')]);_0x367f89[_0xccf9('0x33')]=_[_0xccf9('0x30')](_0xe85b48[_0xccf9('0x31')],qs[_0xccf9('0x32')](_0x33a4ad['query']['fields']));_0x367f89[_0xccf9('0x33')]=_0x367f89[_0xccf9('0x33')]['length']?_0x367f89[_0xccf9('0x33')]:_0xe85b48[_0xccf9('0x31')];_0x367f89[_0xccf9('0x49')]=qs[_0xccf9('0x37')](_0x33a4ad[_0xccf9('0x2e')]['sort']);_0x367f89[_0xccf9('0x38')]=qs[_0xccf9('0x2f')](_[_0xccf9('0x39')](_0x33a4ad[_0xccf9('0x2e')],_0xe85b48[_0xccf9('0x2f')]));if(_0x33a4ad['query'][_0xccf9('0x3b')]){_0x367f89[_0xccf9('0x38')]=_[_0xccf9('0x3c')](_0x367f89[_0xccf9('0x38')],{'$or':_[_0xccf9('0x28')](_0x367f89[_0xccf9('0x33')],function(_0x5cbe2a){var _0x3f0562={};_0x3f0562[_0x5cbe2a]={'$like':'%'+_0x33a4ad[_0xccf9('0x2e')][_0xccf9('0x3b')]+'%'};return _0x3f0562;})});}_0x367f89=_[_0xccf9('0x3c')]({},_0x367f89,_0x33a4ad[_0xccf9('0x4a')]);return _0x1cd856[_0xccf9('0x4c')](_0x367f89);}})[_0xccf9('0x23')](function(_0x195d4a){if(_0x195d4a){_0x885492=_0x195d4a[_0xccf9('0x34')];if(!_0x33a4ad['query'][_0xccf9('0x35')]('nolimit')){_0x367f89['limit']=qs[_0xccf9('0x1b')](_0x33a4ad['query'][_0xccf9('0x1b')]);_0x367f89[_0xccf9('0x1a')]=qs[_0xccf9('0x1a')](_0x33a4ad['query']['offset']);}return _0x1cd856[_0xccf9('0x4c')](_0x367f89);}})[_0xccf9('0x23')](function(_0x3d4e12){if(_0x3d4e12){return _0x3d4e12?{'count':_0x885492,'rows':_0x3d4e12}:null;}})[_0xccf9('0x23')](respondWithResult(_0xd95959,null))['catch'](handleError(_0xd95959,null));}; \ No newline at end of file +var _0x3699=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','destroy','then','error','stack','name','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3699,0x12b));var _0x9369=function(_0x5119f,_0x2ee58f){_0x5119f=_0x5119f-0x0;var _0x1047fb=_0x3699[_0x5119f];return _0x1047fb;};'use strict';var emlformat=require(_0x9369('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9369('0x1'));var Mustache=require(_0x9369('0x2'));var util=require('util');var path=require(_0x9369('0x3'));var sox=require(_0x9369('0x4'));var csv=require(_0x9369('0x5'));var ejs=require(_0x9369('0x6'));var fs=require('fs');var fs_extra=require(_0x9369('0x7'));var _=require(_0x9369('0x8'));var squel=require('squel');var crypto=require(_0x9369('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9369('0xa'));var toCsv=require(_0x9369('0x5'));var querystring=require('querystring');var Papa=require(_0x9369('0xb'));var Redis=require(_0x9369('0xc'));var authService=require(_0x9369('0xd'));var qs=require(_0x9369('0xe'));var as=require(_0x9369('0xf'));var hardwareService=require(_0x9369('0x10'));var logger=require(_0x9369('0x11'))(_0x9369('0x12'));var utils=require(_0x9369('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9369('0x14'));var db=require(_0x9369('0x15'))['db'];function respondWithStatusCode(_0x15c9b3,_0x539253){_0x539253=_0x539253||0xcc;return function(_0x3cb664){if(_0x3cb664){return _0x15c9b3[_0x9369('0x16')](_0x539253);}return _0x15c9b3[_0x9369('0x17')](_0x539253)[_0x9369('0x18')]();};}function respondWithResult(_0x3d0e2f,_0x3f381f){_0x3f381f=_0x3f381f||0xc8;return function(_0x57c0d4){if(_0x57c0d4){return _0x3d0e2f['status'](_0x3f381f)['json'](_0x57c0d4);}};}function respondWithFilteredResult(_0x5eb350,_0x3a55d9){return function(_0x31ced1){if(_0x31ced1){var _0x169bbc=typeof _0x3a55d9['offset']===_0x9369('0x19')&&typeof _0x3a55d9[_0x9369('0x1a')]===_0x9369('0x19');var _0x2cd76e=_0x31ced1[_0x9369('0x1b')];var _0x5d0676=_0x169bbc?0x0:_0x3a55d9[_0x9369('0x1c')];var _0x412df8=_0x169bbc?_0x31ced1[_0x9369('0x1b')]:_0x3a55d9[_0x9369('0x1c')]+_0x3a55d9[_0x9369('0x1a')];var _0x41ca06;if(_0x412df8>=_0x2cd76e){_0x412df8=_0x2cd76e;_0x41ca06=0xc8;}else{_0x41ca06=0xce;}_0x5eb350[_0x9369('0x17')](_0x41ca06);return _0x5eb350['set'](_0x9369('0x1d'),_0x5d0676+'-'+_0x412df8+'/'+_0x2cd76e)[_0x9369('0x1e')](_0x31ced1);}return null;};}function patchUpdates(_0x5192f4){return function(_0x309211){try{jsonpatch['apply'](_0x309211,_0x5192f4,!![]);}catch(_0x2f5f94){return BPromise['reject'](_0x2f5f94);}return _0x309211[_0x9369('0x1f')]();};}function saveUpdates(_0x3bc496,_0x2c0df6){return function(_0x400975){if(_0x400975){return _0x400975[_0x9369('0x20')](_0x3bc496)['then'](function(_0x39ec19){return _0x39ec19;});}return null;};}function removeEntity(_0x34a411,_0x4ba02c){return function(_0x192137){if(_0x192137){return _0x192137[_0x9369('0x21')]()[_0x9369('0x22')](function(){_0x34a411[_0x9369('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f76ca,_0x590af6){return function(_0xb091eb){if(!_0xb091eb){_0x2f76ca[_0x9369('0x16')](0x194);}return _0xb091eb;};}function handleError(_0x3d0f50,_0x484fff){_0x484fff=_0x484fff||0x1f4;return function(_0xba5733){logger[_0x9369('0x23')](_0xba5733[_0x9369('0x24')]);if(_0xba5733['name']){delete _0xba5733[_0x9369('0x25')];}_0x3d0f50[_0x9369('0x17')](_0x484fff)['send'](_0xba5733);};}exports['index']=function(_0x2eccbd,_0x3755bc){var _0x14e3fc={},_0x287918={},_0x2ca752={'count':0x0,'rows':[]};var _0x4a22e6=_['map'](db[_0x9369('0x26')][_0x9369('0x27')],function(_0x549b77){return{'name':_0x549b77[_0x9369('0x28')],'type':_0x549b77[_0x9369('0x29')][_0x9369('0x2a')]};});_0x287918[_0x9369('0x2b')]=_[_0x9369('0x2c')](_0x4a22e6,_0x9369('0x25'));_0x287918['query']=_[_0x9369('0x2d')](_0x2eccbd['query']);_0x287918[_0x9369('0x2e')]=_[_0x9369('0x2f')](_0x287918[_0x9369('0x2b')],_0x287918['query']);_0x14e3fc[_0x9369('0x30')]=_['intersection'](_0x287918[_0x9369('0x2b')],qs[_0x9369('0x31')](_0x2eccbd[_0x9369('0x32')][_0x9369('0x31')]));_0x14e3fc['attributes']=_0x14e3fc['attributes'][_0x9369('0x33')]?_0x14e3fc[_0x9369('0x30')]:_0x287918['model'];if(!_0x2eccbd[_0x9369('0x32')][_0x9369('0x34')](_0x9369('0x35'))){_0x14e3fc[_0x9369('0x1a')]=qs['limit'](_0x2eccbd[_0x9369('0x32')][_0x9369('0x1a')]);_0x14e3fc[_0x9369('0x1c')]=qs[_0x9369('0x1c')](_0x2eccbd[_0x9369('0x32')][_0x9369('0x1c')]);}_0x14e3fc[_0x9369('0x36')]=qs[_0x9369('0x37')](_0x2eccbd[_0x9369('0x32')][_0x9369('0x37')]);_0x14e3fc['where']=qs[_0x9369('0x2e')](_['pick'](_0x2eccbd[_0x9369('0x32')],_0x287918[_0x9369('0x2e')]),_0x4a22e6);if(_0x2eccbd[_0x9369('0x32')][_0x9369('0x38')]){_0x14e3fc[_0x9369('0x39')]=_[_0x9369('0x3a')](_0x14e3fc['where'],{'$or':_['map'](_0x4a22e6,function(_0x58c2c6){if(_0x58c2c6[_0x9369('0x29')]!==_0x9369('0x3b')){var _0xcb18b6={};_0xcb18b6[_0x58c2c6[_0x9369('0x25')]]={'$like':'%'+_0x2eccbd[_0x9369('0x32')][_0x9369('0x38')]+'%'};return _0xcb18b6;}})});}_0x14e3fc=_[_0x9369('0x3a')]({},_0x14e3fc,_0x2eccbd[_0x9369('0x3c')]);var _0x5784ac={'where':_0x14e3fc[_0x9369('0x39')]};return db[_0x9369('0x26')]['count'](_0x5784ac)['then'](function(_0x59351d){_0x2ca752[_0x9369('0x1b')]=_0x59351d;if(_0x2eccbd[_0x9369('0x32')][_0x9369('0x3d')]){_0x14e3fc['include']=[{'all':!![]}];}return db[_0x9369('0x26')][_0x9369('0x3e')](_0x14e3fc);})[_0x9369('0x22')](function(_0x185707){_0x2ca752[_0x9369('0x3f')]=_0x185707;return _0x2ca752;})[_0x9369('0x22')](respondWithFilteredResult(_0x3755bc,_0x14e3fc))[_0x9369('0x40')](handleError(_0x3755bc,null));};exports[_0x9369('0x41')]=function(_0x327fa2,_0x10433c){var _0x17cf14={'raw':![],'where':{'id':_0x327fa2['params']['id']}},_0x4c11c1={};_0x4c11c1['model']=_[_0x9369('0x2d')](db[_0x9369('0x26')][_0x9369('0x27')]);_0x4c11c1['query']=_[_0x9369('0x2d')](_0x327fa2[_0x9369('0x32')]);_0x4c11c1[_0x9369('0x2e')]=_[_0x9369('0x2f')](_0x4c11c1['model'],_0x4c11c1[_0x9369('0x32')]);_0x17cf14[_0x9369('0x30')]=_[_0x9369('0x2f')](_0x4c11c1[_0x9369('0x2b')],qs[_0x9369('0x31')](_0x327fa2[_0x9369('0x32')][_0x9369('0x31')]));_0x17cf14[_0x9369('0x30')]=_0x17cf14[_0x9369('0x30')][_0x9369('0x33')]?_0x17cf14['attributes']:_0x4c11c1[_0x9369('0x2b')];if(_0x327fa2[_0x9369('0x32')][_0x9369('0x3d')]){_0x17cf14[_0x9369('0x42')]=[{'all':!![]}];}_0x17cf14=_['merge']({},_0x17cf14,_0x327fa2[_0x9369('0x3c')]);return db[_0x9369('0x26')][_0x9369('0x43')](_0x17cf14)[_0x9369('0x22')](handleEntityNotFound(_0x10433c,null))['then'](respondWithResult(_0x10433c,null))[_0x9369('0x40')](handleError(_0x10433c,null));};exports[_0x9369('0x44')]=function(_0x8ea715,_0x3878f8){return db['FreshsalesConfiguration']['create'](_0x8ea715['body'],{})[_0x9369('0x22')](respondWithResult(_0x3878f8,0xc9))[_0x9369('0x40')](handleError(_0x3878f8,null));};exports['update']=function(_0x41ffee,_0x11f637){if(_0x41ffee['body']['id']){delete _0x41ffee[_0x9369('0x45')]['id'];}return db['FreshsalesConfiguration'][_0x9369('0x43')]({'where':{'id':_0x41ffee[_0x9369('0x46')]['id']}})[_0x9369('0x22')](handleEntityNotFound(_0x11f637,null))[_0x9369('0x22')](saveUpdates(_0x41ffee[_0x9369('0x45')],null))[_0x9369('0x22')](respondWithResult(_0x11f637,null))['catch'](handleError(_0x11f637,null));};exports['destroy']=function(_0x1430c9,_0x48b9b7){return db[_0x9369('0x26')][_0x9369('0x43')]({'where':{'id':_0x1430c9[_0x9369('0x46')]['id']}})['then'](handleEntityNotFound(_0x48b9b7,null))[_0x9369('0x22')](removeEntity(_0x48b9b7,null))[_0x9369('0x40')](handleError(_0x48b9b7,null));};exports[_0x9369('0x47')]=function(_0x56229c,_0x4a249d,_0x26d1ab){var _0x180580={};var _0x108ad0={};var _0x12e05d;var _0x4f9988;return db['FreshsalesConfiguration'][_0x9369('0x48')]({'where':{'id':_0x56229c[_0x9369('0x46')]['id']}})[_0x9369('0x22')](handleEntityNotFound(_0x4a249d,null))['then'](function(_0x1127e7){if(_0x1127e7){_0x12e05d=_0x1127e7;_0x108ad0[_0x9369('0x2b')]=_[_0x9369('0x2d')](db[_0x9369('0x49')][_0x9369('0x27')]);_0x108ad0[_0x9369('0x32')]=_[_0x9369('0x2d')](_0x56229c[_0x9369('0x32')]);_0x108ad0[_0x9369('0x2e')]=_['intersection'](_0x108ad0[_0x9369('0x2b')],_0x108ad0['query']);_0x180580[_0x9369('0x30')]=_['intersection'](_0x108ad0[_0x9369('0x2b')],qs[_0x9369('0x31')](_0x56229c[_0x9369('0x32')][_0x9369('0x31')]));_0x180580[_0x9369('0x30')]=_0x180580[_0x9369('0x30')][_0x9369('0x33')]?_0x180580[_0x9369('0x30')]:_0x108ad0[_0x9369('0x2b')];_0x180580[_0x9369('0x36')]=qs[_0x9369('0x37')](_0x56229c['query'][_0x9369('0x37')]);_0x180580['where']=qs[_0x9369('0x2e')](_[_0x9369('0x4a')](_0x56229c[_0x9369('0x32')],_0x108ad0[_0x9369('0x2e')]));if(_0x56229c[_0x9369('0x32')][_0x9369('0x38')]){_0x180580[_0x9369('0x39')]=_[_0x9369('0x3a')](_0x180580[_0x9369('0x39')],{'$or':_[_0x9369('0x2c')](_0x180580[_0x9369('0x30')],function(_0x50fcc0){var _0xea5c29={};_0xea5c29[_0x50fcc0]={'$like':'%'+_0x56229c[_0x9369('0x32')]['filter']+'%'};return _0xea5c29;})});}_0x180580=_[_0x9369('0x3a')]({},_0x180580,_0x56229c[_0x9369('0x3c')]);return _0x12e05d['getSubjects'](_0x180580);}})['then'](function(_0x26a3d3){if(_0x26a3d3){_0x4f9988=_0x26a3d3[_0x9369('0x33')];if(!_0x56229c[_0x9369('0x32')][_0x9369('0x34')]('nolimit')){_0x180580[_0x9369('0x1a')]=qs['limit'](_0x56229c[_0x9369('0x32')][_0x9369('0x1a')]);_0x180580['offset']=qs[_0x9369('0x1c')](_0x56229c[_0x9369('0x32')][_0x9369('0x1c')]);}return _0x12e05d[_0x9369('0x47')](_0x180580);}})['then'](function(_0x49ead6){if(_0x49ead6){return _0x49ead6?{'count':_0x4f9988,'rows':_0x49ead6}:null;}})[_0x9369('0x22')](respondWithResult(_0x4a249d,null))['catch'](handleError(_0x4a249d,null));};exports[_0x9369('0x4b')]=function(_0x4a2090,_0x20cf40,_0x430071){var _0x1b0058={};var _0x54094d={};var _0x20c480;var _0x1de017;return db[_0x9369('0x26')][_0x9369('0x48')]({'where':{'id':_0x4a2090[_0x9369('0x46')]['id']}})[_0x9369('0x22')](handleEntityNotFound(_0x20cf40,null))[_0x9369('0x22')](function(_0x57d3a5){if(_0x57d3a5){_0x20c480=_0x57d3a5;_0x54094d[_0x9369('0x2b')]=_[_0x9369('0x2d')](db[_0x9369('0x49')]['rawAttributes']);_0x54094d[_0x9369('0x32')]=_[_0x9369('0x2d')](_0x4a2090['query']);_0x54094d['filters']=_['intersection'](_0x54094d[_0x9369('0x2b')],_0x54094d['query']);_0x1b0058[_0x9369('0x30')]=_[_0x9369('0x2f')](_0x54094d[_0x9369('0x2b')],qs[_0x9369('0x31')](_0x4a2090[_0x9369('0x32')][_0x9369('0x31')]));_0x1b0058[_0x9369('0x30')]=_0x1b0058[_0x9369('0x30')]['length']?_0x1b0058['attributes']:_0x54094d[_0x9369('0x2b')];_0x1b0058['order']=qs[_0x9369('0x37')](_0x4a2090[_0x9369('0x32')][_0x9369('0x37')]);_0x1b0058[_0x9369('0x39')]=qs['filters'](_[_0x9369('0x4a')](_0x4a2090[_0x9369('0x32')],_0x54094d[_0x9369('0x2e')]));if(_0x4a2090[_0x9369('0x32')][_0x9369('0x38')]){_0x1b0058[_0x9369('0x39')]=_[_0x9369('0x3a')](_0x1b0058['where'],{'$or':_['map'](_0x1b0058[_0x9369('0x30')],function(_0x32c473){var _0x40f2eb={};_0x40f2eb[_0x32c473]={'$like':'%'+_0x4a2090['query'][_0x9369('0x38')]+'%'};return _0x40f2eb;})});}_0x1b0058=_[_0x9369('0x3a')]({},_0x1b0058,_0x4a2090['options']);return _0x20c480['getDescriptions'](_0x1b0058);}})[_0x9369('0x22')](function(_0x57a68c){if(_0x57a68c){_0x1de017=_0x57a68c['length'];if(!_0x4a2090[_0x9369('0x32')][_0x9369('0x34')]('nolimit')){_0x1b0058[_0x9369('0x1a')]=qs[_0x9369('0x1a')](_0x4a2090[_0x9369('0x32')][_0x9369('0x1a')]);_0x1b0058['offset']=qs[_0x9369('0x1c')](_0x4a2090[_0x9369('0x32')][_0x9369('0x1c')]);}return _0x20c480['getDescriptions'](_0x1b0058);}})[_0x9369('0x22')](function(_0x175318){if(_0x175318){return _0x175318?{'count':_0x1de017,'rows':_0x175318}:null;}})['then'](respondWithResult(_0x20cf40,null))[_0x9369('0x40')](handleError(_0x20cf40,null));};exports[_0x9369('0x4c')]=function(_0x1b1ce5,_0x543751,_0x5a9e76){var _0x54e860={};var _0x242cd3={};var _0x4e73cc;var _0x5c8cb8;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x1b1ce5[_0x9369('0x46')]['id']}})[_0x9369('0x22')](handleEntityNotFound(_0x543751,null))[_0x9369('0x22')](function(_0x270298){if(_0x270298){_0x4e73cc=_0x270298;_0x242cd3[_0x9369('0x2b')]=_[_0x9369('0x2d')](db[_0x9369('0x49')][_0x9369('0x27')]);_0x242cd3[_0x9369('0x32')]=_[_0x9369('0x2d')](_0x1b1ce5[_0x9369('0x32')]);_0x242cd3['filters']=_[_0x9369('0x2f')](_0x242cd3[_0x9369('0x2b')],_0x242cd3[_0x9369('0x32')]);_0x54e860['attributes']=_[_0x9369('0x2f')](_0x242cd3[_0x9369('0x2b')],qs[_0x9369('0x31')](_0x1b1ce5['query'][_0x9369('0x31')]));_0x54e860['attributes']=_0x54e860['attributes']['length']?_0x54e860[_0x9369('0x30')]:_0x242cd3[_0x9369('0x2b')];_0x54e860[_0x9369('0x36')]=qs[_0x9369('0x37')](_0x1b1ce5['query'][_0x9369('0x37')]);_0x54e860[_0x9369('0x39')]=qs[_0x9369('0x2e')](_[_0x9369('0x4a')](_0x1b1ce5['query'],_0x242cd3[_0x9369('0x2e')]));if(_0x1b1ce5[_0x9369('0x32')][_0x9369('0x38')]){_0x54e860[_0x9369('0x39')]=_['merge'](_0x54e860[_0x9369('0x39')],{'$or':_[_0x9369('0x2c')](_0x54e860[_0x9369('0x30')],function(_0x42168e){var _0xbc1b08={};_0xbc1b08[_0x42168e]={'$like':'%'+_0x1b1ce5[_0x9369('0x32')][_0x9369('0x38')]+'%'};return _0xbc1b08;})});}_0x54e860=_[_0x9369('0x3a')]({},_0x54e860,_0x1b1ce5[_0x9369('0x3c')]);return _0x4e73cc[_0x9369('0x4c')](_0x54e860);}})['then'](function(_0x4ab187){if(_0x4ab187){_0x5c8cb8=_0x4ab187['length'];if(!_0x1b1ce5[_0x9369('0x32')]['hasOwnProperty'](_0x9369('0x35'))){_0x54e860[_0x9369('0x1a')]=qs[_0x9369('0x1a')](_0x1b1ce5[_0x9369('0x32')]['limit']);_0x54e860[_0x9369('0x1c')]=qs[_0x9369('0x1c')](_0x1b1ce5[_0x9369('0x32')]['offset']);}return _0x4e73cc[_0x9369('0x4c')](_0x54e860);}})[_0x9369('0x22')](function(_0x5ce0b9){if(_0x5ce0b9){return _0x5ce0b9?{'count':_0x5c8cb8,'rows':_0x5ce0b9}:null;}})[_0x9369('0x22')](respondWithResult(_0x543751,null))[_0x9369('0x40')](handleError(_0x543751,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index bb07c65..042f726 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 _0x2120=['rimraf','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','moment','bluebird','request-promise','path'];(function(_0x16d04c,_0x4e2aaf){var _0x4769f1=function(_0x40043a){while(--_0x40043a){_0x16d04c['push'](_0x16d04c['shift']());}};_0x4769f1(++_0x4e2aaf);}(_0x2120,0x16c));var _0x0212=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x2120[_0x34eb31];return _0x254994;};'use strict';var _=require(_0x0212('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0212('0x1'));var BPromise=require(_0x0212('0x2'));var rp=require(_0x0212('0x3'));var fs=require('fs');var path=require(_0x0212('0x4'));var rimraf=require(_0x0212('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x1c6cdf,_0x2e773a){return _0x1c6cdf[_0x0212('0x6')](_0x0212('0x7'),attributes,{'tableName':_0x0212('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x772a=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x772a,0xbc));var _0xa772=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x772a[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xa772('0x0'));var util=require(_0xa772('0x1'));var logger=require(_0xa772('0x2'))('api');var moment=require(_0xa772('0x3'));var BPromise=require(_0xa772('0x4'));var rp=require(_0xa772('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa772('0x6'));var config=require(_0xa772('0x7'));var attributes=require(_0xa772('0x8'));module['exports']=function(_0x415127,_0x3e9e77){return _0x415127[_0xa772('0x9')](_0xa772('0xa'),attributes,{'tableName':_0xa772('0xb'),'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 9fa8464..1937e4a 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 _0xa5b7=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf714cf,_0x584b1b){var _0x4570d6=function(_0xd1eb1){while(--_0xd1eb1){_0xf714cf['push'](_0xf714cf['shift']());}};_0x4570d6(++_0x584b1b);}(_0xa5b7,0x7e));var _0x7a5b=function(_0x552b0c,_0x490a49){_0x552b0c=_0x552b0c-0x0;var _0x4d5bdf=_0xa5b7[_0x552b0c];return _0x4d5bdf;};'use strict';var _=require('lodash');var util=require(_0x7a5b('0x0'));var moment=require(_0x7a5b('0x1'));var BPromise=require(_0x7a5b('0x2'));var rs=require(_0x7a5b('0x3'));var fs=require('fs');var Redis=require(_0x7a5b('0x4'));var db=require(_0x7a5b('0x5'))['db'];var utils=require(_0x7a5b('0x6'));var logger=require(_0x7a5b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a5b('0x8'));var client=jayson[_0x7a5b('0x9')][_0x7a5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448548,_0x4db60f,_0x34fbe1){return new BPromise(function(_0x289d9c,_0x5ae20e){return client[_0x7a5b('0xb')](_0x448548,_0x34fbe1)[_0x7a5b('0xc')](function(_0x48f3d5){logger[_0x7a5b('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4db60f,_0x7a5b('0xe'));logger[_0x7a5b('0xf')](_0x7a5b('0x10'),_0x4db60f,_0x7a5b('0xe'),JSON[_0x7a5b('0x11')](_0x48f3d5));if(_0x48f3d5[_0x7a5b('0x12')]){if(_0x48f3d5[_0x7a5b('0x12')]['code']===0x1f4){logger[_0x7a5b('0x12')](_0x7a5b('0x13'),_0x4db60f,_0x48f3d5['error'][_0x7a5b('0x14')]);return _0x5ae20e(_0x48f3d5[_0x7a5b('0x12')][_0x7a5b('0x14')]);}logger['error'](_0x7a5b('0x13'),_0x4db60f,_0x48f3d5['error'][_0x7a5b('0x14')]);return _0x289d9c(_0x48f3d5[_0x7a5b('0x12')][_0x7a5b('0x14')]);}else{logger[_0x7a5b('0xd')](_0x7a5b('0x13'),_0x4db60f,_0x7a5b('0xe'));_0x289d9c(_0x48f3d5['result'][_0x7a5b('0x14')]);}})[_0x7a5b('0x15')](function(_0x30923d){logger[_0x7a5b('0x12')](_0x7a5b('0x13'),_0x4db60f,_0x30923d);_0x5ae20e(_0x30923d);});});} \ No newline at end of file +var _0x90fb=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x90fb,0x189));var _0xb90f=function(_0x34361b,_0x9642d4){_0x34361b=_0x34361b-0x0;var _0x1de9c5=_0x90fb[_0x34361b];return _0x1de9c5;};'use strict';var _=require(_0xb90f('0x0'));var util=require(_0xb90f('0x1'));var moment=require(_0xb90f('0x2'));var BPromise=require(_0xb90f('0x3'));var rs=require(_0xb90f('0x4'));var fs=require('fs');var Redis=require(_0xb90f('0x5'));var db=require(_0xb90f('0x6'))['db'];var utils=require(_0xb90f('0x7'));var logger=require(_0xb90f('0x8'))('rpc');var config=require(_0xb90f('0x9'));var jayson=require(_0xb90f('0xa'));var client=jayson[_0xb90f('0xb')][_0xb90f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e9de4,_0x387db5,_0x3ba020){return new BPromise(function(_0x208295,_0x2498fc){return client[_0xb90f('0xd')](_0x3e9de4,_0x3ba020)[_0xb90f('0xe')](function(_0x39aec4){logger['info'](_0xb90f('0xf'),_0x387db5,_0xb90f('0x10'));logger['debug'](_0xb90f('0x11'),_0x387db5,_0xb90f('0x10'),JSON['stringify'](_0x39aec4));if(_0x39aec4['error']){if(_0x39aec4[_0xb90f('0x12')][_0xb90f('0x13')]===0x1f4){logger['error'](_0xb90f('0xf'),_0x387db5,_0x39aec4[_0xb90f('0x12')]['message']);return _0x2498fc(_0x39aec4[_0xb90f('0x12')][_0xb90f('0x14')]);}logger['error'](_0xb90f('0xf'),_0x387db5,_0x39aec4[_0xb90f('0x12')][_0xb90f('0x14')]);return _0x208295(_0x39aec4['error'][_0xb90f('0x14')]);}else{logger[_0xb90f('0x15')](_0xb90f('0xf'),_0x387db5,_0xb90f('0x10'));_0x208295(_0x39aec4[_0xb90f('0x16')]['message']);}})[_0xb90f('0x17')](function(_0x33abc2){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x387db5,_0x33abc2);_0x2498fc(_0x33abc2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index f933c01..4a91351 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 _0x3379=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x66f017,_0x7a13e6){var _0x1df4cc=function(_0x6e1ee5){while(--_0x6e1ee5){_0x66f017['push'](_0x66f017['shift']());}};_0x1df4cc(++_0x7a13e6);}(_0x3379,0x115));var _0x9337=function(_0x3334ed,_0x2faaf6){_0x3334ed=_0x3334ed-0x0;var _0x461494=_0x3379[_0x3334ed];return _0x461494;};'use strict';var multer=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var path=require(_0x9337('0x2'));var timeout=require(_0x9337('0x3'));var express=require('express');var router=express[_0x9337('0x4')]();var fs_extra=require(_0x9337('0x5'));var auth=require(_0x9337('0x6'));var interaction=require(_0x9337('0x7'));var config=require('../../config/environment');var controller=require(_0x9337('0x8'));router[_0x9337('0x9')]('/',auth[_0x9337('0xa')](),controller[_0x9337('0xb')]);router['get'](_0x9337('0xc'),auth['isAuthenticated'](),controller[_0x9337('0xd')]);router[_0x9337('0xe')]('/',auth[_0x9337('0xa')](),controller[_0x9337('0xf')]);router[_0x9337('0x10')]('/:id',auth[_0x9337('0xa')](),controller[_0x9337('0x11')]);router[_0x9337('0x12')](_0x9337('0xc'),auth[_0x9337('0xa')](),controller['destroy']);module[_0x9337('0x13')]=router; \ No newline at end of file +var _0x58a7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x15df0c,_0x259ad1){var _0x36887b=function(_0x2a87bf){while(--_0x2a87bf){_0x15df0c['push'](_0x15df0c['shift']());}};_0x36887b(++_0x259ad1);}(_0x58a7,0xf7));var _0x758a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x58a7[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var path=require(_0x758a('0x2'));var timeout=require(_0x758a('0x3'));var express=require(_0x758a('0x4'));var router=express[_0x758a('0x5')]();var fs_extra=require(_0x758a('0x6'));var auth=require(_0x758a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x758a('0x8'));var controller=require(_0x758a('0x9'));router[_0x758a('0xa')]('/',auth[_0x758a('0xb')](),controller['index']);router['get'](_0x758a('0xc'),auth['isAuthenticated'](),controller[_0x758a('0xd')]);router[_0x758a('0xe')]('/',auth[_0x758a('0xb')](),controller[_0x758a('0xf')]);router[_0x758a('0x10')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller[_0x758a('0x11')]);router[_0x758a('0x12')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 6f5f0fc..080f752 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 _0x8f38=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f38,0xc6));var _0x88f3=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8f38[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require('sequelize');module[_0x88f3('0x0')]={'type':{'type':Sequelize['ENUM'](_0x88f3('0x1'),_0x88f3('0x2'),_0x88f3('0x3'),_0x88f3('0x4'),_0x88f3('0x5')),'defaultValue':_0x88f3('0x1')},'content':{'type':Sequelize[_0x88f3('0x6')]},'key':{'type':Sequelize[_0x88f3('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x88f3('0x1'),_0x88f3('0x2'),_0x88f3('0x3'))},'keyContent':{'type':Sequelize[_0x88f3('0x6')]},'idField':{'type':Sequelize[_0x88f3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x88f3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88f3('0x6')]}}; \ No newline at end of file +var _0x0b33=['sequelize','exports','ENUM','variable','keyValue','STRING','string','customVariable'];(function(_0x355d3e,_0x54cb05){var _0x4dcc0a=function(_0x31afbd){while(--_0x31afbd){_0x355d3e['push'](_0x355d3e['shift']());}};_0x4dcc0a(++_0x54cb05);}(_0x0b33,0x1a8));var _0x30b3=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x0b33[_0x391c55];return _0xa434e0;};'use strict';var Sequelize=require(_0x30b3('0x0'));module[_0x30b3('0x1')]={'type':{'type':Sequelize[_0x30b3('0x2')]('string',_0x30b3('0x3'),'customVariable',_0x30b3('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x30b3('0x5')]},'keyType':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x6'),'variable',_0x30b3('0x7'))},'keyContent':{'type':Sequelize[_0x30b3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x30b3('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x30b3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f20b826..a50aaca 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 _0x3542=['stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','FreshsalesField','count','include','findAll','rows','params','keys','includeAll','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0x3542,0x194));var _0x2354=function(_0x40292e,_0xaa2a7b){_0x40292e=_0x40292e-0x0;var _0x1ed986=_0x3542[_0x40292e];return _0x1ed986;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2354('0x0'));var zipdir=require(_0x2354('0x1'));var jsonpatch=require(_0x2354('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2354('0x3'));var Mustache=require(_0x2354('0x4'));var util=require(_0x2354('0x5'));var path=require('path');var sox=require(_0x2354('0x6'));var csv=require('to-csv');var ejs=require(_0x2354('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2354('0x8'));var squel=require(_0x2354('0x9'));var crypto=require('crypto');var jsforce=require(_0x2354('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2354('0xb'));var querystring=require(_0x2354('0xc'));var Papa=require(_0x2354('0xd'));var Redis=require(_0x2354('0xe'));var authService=require(_0x2354('0xf'));var qs=require(_0x2354('0x10'));var as=require(_0x2354('0x11'));var hardwareService=require(_0x2354('0x12'));var logger=require(_0x2354('0x13'))(_0x2354('0x14'));var utils=require(_0x2354('0x15'));var config=require(_0x2354('0x16'));var licenseUtil=require(_0x2354('0x17'));var db=require(_0x2354('0x18'))['db'];function respondWithStatusCode(_0x4fa737,_0x3b973c){_0x3b973c=_0x3b973c||0xcc;return function(_0x4d14e7){if(_0x4d14e7){return _0x4fa737[_0x2354('0x19')](_0x3b973c);}return _0x4fa737[_0x2354('0x1a')](_0x3b973c)[_0x2354('0x1b')]();};}function respondWithResult(_0x24c8c5,_0x271814){_0x271814=_0x271814||0xc8;return function(_0x34a4fe){if(_0x34a4fe){return _0x24c8c5[_0x2354('0x1a')](_0x271814)[_0x2354('0x1c')](_0x34a4fe);}};}function respondWithFilteredResult(_0x328c16,_0x2c8d8d){return function(_0x467a04){if(_0x467a04){var _0x49ae46=typeof _0x2c8d8d[_0x2354('0x1d')]===_0x2354('0x1e')&&typeof _0x2c8d8d[_0x2354('0x1f')]===_0x2354('0x1e');var _0x5edc98=_0x467a04['count'];var _0x37acdf=_0x49ae46?0x0:_0x2c8d8d[_0x2354('0x1d')];var _0x12d5a0=_0x49ae46?_0x467a04['count']:_0x2c8d8d[_0x2354('0x1d')]+_0x2c8d8d[_0x2354('0x1f')];var _0x96ab90;if(_0x12d5a0>=_0x5edc98){_0x12d5a0=_0x5edc98;_0x96ab90=0xc8;}else{_0x96ab90=0xce;}_0x328c16[_0x2354('0x1a')](_0x96ab90);return _0x328c16[_0x2354('0x20')]('Content-Range',_0x37acdf+'-'+_0x12d5a0+'/'+_0x5edc98)['json'](_0x467a04);}return null;};}function patchUpdates(_0x15005c){return function(_0x134564){try{jsonpatch[_0x2354('0x21')](_0x134564,_0x15005c,!![]);}catch(_0x495f61){return BPromise[_0x2354('0x22')](_0x495f61);}return _0x134564[_0x2354('0x23')]();};}function saveUpdates(_0x1d33cd,_0x2eb24e){return function(_0xa4969){if(_0xa4969){return _0xa4969[_0x2354('0x24')](_0x1d33cd)[_0x2354('0x25')](function(_0x7b344c){return _0x7b344c;});}return null;};}function removeEntity(_0x1d2d66,_0x5b7dd6){return function(_0x3d7360){if(_0x3d7360){return _0x3d7360[_0x2354('0x26')]()[_0x2354('0x25')](function(){_0x1d2d66[_0x2354('0x1a')](0xcc)[_0x2354('0x1b')]();});}};}function handleEntityNotFound(_0x140181,_0x10629a){return function(_0x2ea728){if(!_0x2ea728){_0x140181[_0x2354('0x19')](0x194);}return _0x2ea728;};}function handleError(_0x580f63,_0x32a231){_0x32a231=_0x32a231||0x1f4;return function(_0x529436){logger[_0x2354('0x27')](_0x529436[_0x2354('0x28')]);if(_0x529436[_0x2354('0x29')]){delete _0x529436[_0x2354('0x29')];}_0x580f63[_0x2354('0x1a')](_0x32a231)[_0x2354('0x2a')](_0x529436);};}exports['index']=function(_0x1055b0,_0x3a71ad){var _0x1dd241={},_0x16044f={},_0x559da4={'count':0x0,'rows':[]};var _0x5e529=_[_0x2354('0x2b')](db['FreshsalesField'][_0x2354('0x2c')],function(_0x2106d1){return{'name':_0x2106d1[_0x2354('0x2d')],'type':_0x2106d1[_0x2354('0x2e')][_0x2354('0x2f')]};});_0x16044f[_0x2354('0x30')]=_['map'](_0x5e529,'name');_0x16044f[_0x2354('0x31')]=_['keys'](_0x1055b0['query']);_0x16044f[_0x2354('0x32')]=_[_0x2354('0x33')](_0x16044f[_0x2354('0x30')],_0x16044f[_0x2354('0x31')]);_0x1dd241[_0x2354('0x34')]=_['intersection'](_0x16044f[_0x2354('0x30')],qs[_0x2354('0x35')](_0x1055b0['query'][_0x2354('0x35')]));_0x1dd241[_0x2354('0x34')]=_0x1dd241['attributes'][_0x2354('0x36')]?_0x1dd241[_0x2354('0x34')]:_0x16044f[_0x2354('0x30')];if(!_0x1055b0['query']['hasOwnProperty']('nolimit')){_0x1dd241[_0x2354('0x1f')]=qs[_0x2354('0x1f')](_0x1055b0[_0x2354('0x31')][_0x2354('0x1f')]);_0x1dd241[_0x2354('0x1d')]=qs[_0x2354('0x1d')](_0x1055b0['query']['offset']);}_0x1dd241['order']=qs[_0x2354('0x37')](_0x1055b0[_0x2354('0x31')][_0x2354('0x37')]);_0x1dd241['where']=qs['filters'](_[_0x2354('0x38')](_0x1055b0[_0x2354('0x31')],_0x16044f['filters']),_0x5e529);if(_0x1055b0[_0x2354('0x31')][_0x2354('0x39')]){_0x1dd241[_0x2354('0x3a')]=_[_0x2354('0x3b')](_0x1dd241[_0x2354('0x3a')],{'$or':_[_0x2354('0x2b')](_0x5e529,function(_0x34ae58){if(_0x34ae58[_0x2354('0x2e')]!==_0x2354('0x3c')){var _0x55cded={};_0x55cded[_0x34ae58['name']]={'$like':'%'+_0x1055b0[_0x2354('0x31')]['filter']+'%'};return _0x55cded;}})});}_0x1dd241=_[_0x2354('0x3b')]({},_0x1dd241,_0x1055b0['options']);var _0x2b6cff={'where':_0x1dd241[_0x2354('0x3a')]};return db[_0x2354('0x3d')][_0x2354('0x3e')](_0x2b6cff)['then'](function(_0x8b384f){_0x559da4[_0x2354('0x3e')]=_0x8b384f;if(_0x1055b0[_0x2354('0x31')]['includeAll']){_0x1dd241[_0x2354('0x3f')]=[{'all':!![]}];}return db[_0x2354('0x3d')][_0x2354('0x40')](_0x1dd241);})[_0x2354('0x25')](function(_0x447205){_0x559da4[_0x2354('0x41')]=_0x447205;return _0x559da4;})[_0x2354('0x25')](respondWithFilteredResult(_0x3a71ad,_0x1dd241))['catch'](handleError(_0x3a71ad,null));};exports['show']=function(_0x1d4737,_0x5edeef){var _0x4355b8={'raw':!![],'where':{'id':_0x1d4737[_0x2354('0x42')]['id']}},_0x217bd1={};_0x217bd1[_0x2354('0x30')]=_['keys'](db[_0x2354('0x3d')][_0x2354('0x2c')]);_0x217bd1[_0x2354('0x31')]=_[_0x2354('0x43')](_0x1d4737[_0x2354('0x31')]);_0x217bd1[_0x2354('0x32')]=_[_0x2354('0x33')](_0x217bd1[_0x2354('0x30')],_0x217bd1[_0x2354('0x31')]);_0x4355b8[_0x2354('0x34')]=_[_0x2354('0x33')](_0x217bd1[_0x2354('0x30')],qs[_0x2354('0x35')](_0x1d4737[_0x2354('0x31')]['fields']));_0x4355b8['attributes']=_0x4355b8[_0x2354('0x34')][_0x2354('0x36')]?_0x4355b8[_0x2354('0x34')]:_0x217bd1[_0x2354('0x30')];if(_0x1d4737[_0x2354('0x31')][_0x2354('0x44')]){_0x4355b8[_0x2354('0x3f')]=[{'all':!![]}];}_0x4355b8=_[_0x2354('0x3b')]({},_0x4355b8,_0x1d4737[_0x2354('0x45')]);return db[_0x2354('0x3d')][_0x2354('0x46')](_0x4355b8)[_0x2354('0x25')](handleEntityNotFound(_0x5edeef,null))['then'](respondWithResult(_0x5edeef,null))[_0x2354('0x47')](handleError(_0x5edeef,null));};exports['create']=function(_0x5ed2d9,_0xa54d8){return db['FreshsalesField'][_0x2354('0x48')](_0x5ed2d9['body'],{})[_0x2354('0x25')](respondWithResult(_0xa54d8,0xc9))[_0x2354('0x47')](handleError(_0xa54d8,null));};exports['update']=function(_0x346ab9,_0x5d9dbb){if(_0x346ab9['body']['id']){delete _0x346ab9[_0x2354('0x49')]['id'];}return db[_0x2354('0x3d')][_0x2354('0x46')]({'where':{'id':_0x346ab9[_0x2354('0x42')]['id']}})[_0x2354('0x25')](handleEntityNotFound(_0x5d9dbb,null))[_0x2354('0x25')](saveUpdates(_0x346ab9[_0x2354('0x49')],null))['then'](respondWithResult(_0x5d9dbb,null))[_0x2354('0x47')](handleError(_0x5d9dbb,null));};exports['destroy']=function(_0x438f04,_0x2f72fb){return db[_0x2354('0x3d')][_0x2354('0x46')]({'where':{'id':_0x438f04['params']['id']}})[_0x2354('0x25')](handleEntityNotFound(_0x2f72fb,null))[_0x2354('0x25')](removeEntity(_0x2f72fb,null))[_0x2354('0x47')](handleError(_0x2f72fb,null));}; \ No newline at end of file +var _0x6864=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','update','then','destroy','error','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','intersection','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x6864,0xbe));var _0x4686=function(_0x282c98,_0x578bd7){_0x282c98=_0x282c98-0x0;var _0x2f1fbb=_0x6864[_0x282c98];return _0x2f1fbb;};'use strict';var emlformat=require(_0x4686('0x0'));var rimraf=require(_0x4686('0x1'));var zipdir=require(_0x4686('0x2'));var jsonpatch=require(_0x4686('0x3'));var rp=require(_0x4686('0x4'));var moment=require(_0x4686('0x5'));var BPromise=require(_0x4686('0x6'));var Mustache=require(_0x4686('0x7'));var util=require('util');var path=require(_0x4686('0x8'));var sox=require('sox');var csv=require(_0x4686('0x9'));var ejs=require(_0x4686('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4686('0xb'));var squel=require(_0x4686('0xc'));var crypto=require(_0x4686('0xd'));var jsforce=require(_0x4686('0xe'));var deskjs=require(_0x4686('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4686('0x10'));var Papa=require(_0x4686('0x11'));var Redis=require('ioredis');var authService=require(_0x4686('0x12'));var qs=require(_0x4686('0x13'));var as=require(_0x4686('0x14'));var hardwareService=require(_0x4686('0x15'));var logger=require(_0x4686('0x16'))(_0x4686('0x17'));var utils=require(_0x4686('0x18'));var config=require(_0x4686('0x19'));var licenseUtil=require(_0x4686('0x1a'));var db=require(_0x4686('0x1b'))['db'];function respondWithStatusCode(_0x13f33d,_0x210639){_0x210639=_0x210639||0xcc;return function(_0x343784){if(_0x343784){return _0x13f33d[_0x4686('0x1c')](_0x210639);}return _0x13f33d[_0x4686('0x1d')](_0x210639)[_0x4686('0x1e')]();};}function respondWithResult(_0xc45406,_0x37eb1d){_0x37eb1d=_0x37eb1d||0xc8;return function(_0x4110a5){if(_0x4110a5){return _0xc45406[_0x4686('0x1d')](_0x37eb1d)[_0x4686('0x1f')](_0x4110a5);}};}function respondWithFilteredResult(_0x1feb00,_0x3684be){return function(_0x804718){if(_0x804718){var _0x4a18e1=typeof _0x3684be[_0x4686('0x20')]===_0x4686('0x21')&&typeof _0x3684be[_0x4686('0x22')]===_0x4686('0x21');var _0x3772cc=_0x804718['count'];var _0x2c7387=_0x4a18e1?0x0:_0x3684be[_0x4686('0x20')];var _0xe0ed62=_0x4a18e1?_0x804718['count']:_0x3684be[_0x4686('0x20')]+_0x3684be[_0x4686('0x22')];var _0x1cab90;if(_0xe0ed62>=_0x3772cc){_0xe0ed62=_0x3772cc;_0x1cab90=0xc8;}else{_0x1cab90=0xce;}_0x1feb00[_0x4686('0x1d')](_0x1cab90);return _0x1feb00['set'](_0x4686('0x23'),_0x2c7387+'-'+_0xe0ed62+'/'+_0x3772cc)[_0x4686('0x1f')](_0x804718);}return null;};}function patchUpdates(_0x31720c){return function(_0x272ba8){try{jsonpatch[_0x4686('0x24')](_0x272ba8,_0x31720c,!![]);}catch(_0x6427dc){return BPromise['reject'](_0x6427dc);}return _0x272ba8['save']();};}function saveUpdates(_0x3dd280,_0x3070fe){return function(_0x266f65){if(_0x266f65){return _0x266f65[_0x4686('0x25')](_0x3dd280)[_0x4686('0x26')](function(_0x8d878e){return _0x8d878e;});}return null;};}function removeEntity(_0x45785e,_0x535841){return function(_0x7e984c){if(_0x7e984c){return _0x7e984c[_0x4686('0x27')]()['then'](function(){_0x45785e[_0x4686('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4787ea,_0x1bb0c3){return function(_0x54d9ab){if(!_0x54d9ab){_0x4787ea[_0x4686('0x1c')](0x194);}return _0x54d9ab;};}function handleError(_0x4d6f0e,_0x3bf0ca){_0x3bf0ca=_0x3bf0ca||0x1f4;return function(_0x3dc769){logger[_0x4686('0x28')](_0x3dc769['stack']);if(_0x3dc769[_0x4686('0x29')]){delete _0x3dc769['name'];}_0x4d6f0e[_0x4686('0x1d')](_0x3bf0ca)['send'](_0x3dc769);};}exports[_0x4686('0x2a')]=function(_0x1aa141,_0x53fa2e){var _0x48901b={},_0xb50a5={},_0x5e0717={'count':0x0,'rows':[]};var _0x5982a1=_[_0x4686('0x2b')](db[_0x4686('0x2c')][_0x4686('0x2d')],function(_0x5a0457){return{'name':_0x5a0457[_0x4686('0x2e')],'type':_0x5a0457[_0x4686('0x2f')][_0x4686('0x30')]};});_0xb50a5[_0x4686('0x31')]=_[_0x4686('0x2b')](_0x5982a1,'name');_0xb50a5[_0x4686('0x32')]=_['keys'](_0x1aa141[_0x4686('0x32')]);_0xb50a5[_0x4686('0x33')]=_['intersection'](_0xb50a5[_0x4686('0x31')],_0xb50a5[_0x4686('0x32')]);_0x48901b[_0x4686('0x34')]=_['intersection'](_0xb50a5['model'],qs[_0x4686('0x35')](_0x1aa141[_0x4686('0x32')][_0x4686('0x35')]));_0x48901b[_0x4686('0x34')]=_0x48901b[_0x4686('0x34')][_0x4686('0x36')]?_0x48901b[_0x4686('0x34')]:_0xb50a5[_0x4686('0x31')];if(!_0x1aa141[_0x4686('0x32')][_0x4686('0x37')]('nolimit')){_0x48901b[_0x4686('0x22')]=qs[_0x4686('0x22')](_0x1aa141[_0x4686('0x32')][_0x4686('0x22')]);_0x48901b[_0x4686('0x20')]=qs['offset'](_0x1aa141[_0x4686('0x32')][_0x4686('0x20')]);}_0x48901b[_0x4686('0x38')]=qs[_0x4686('0x39')](_0x1aa141['query'][_0x4686('0x39')]);_0x48901b['where']=qs['filters'](_['pick'](_0x1aa141['query'],_0xb50a5[_0x4686('0x33')]),_0x5982a1);if(_0x1aa141[_0x4686('0x32')][_0x4686('0x3a')]){_0x48901b[_0x4686('0x3b')]=_[_0x4686('0x3c')](_0x48901b[_0x4686('0x3b')],{'$or':_[_0x4686('0x2b')](_0x5982a1,function(_0x559faa){if(_0x559faa[_0x4686('0x2f')]!==_0x4686('0x3d')){var _0x315de1={};_0x315de1[_0x559faa[_0x4686('0x29')]]={'$like':'%'+_0x1aa141[_0x4686('0x32')]['filter']+'%'};return _0x315de1;}})});}_0x48901b=_[_0x4686('0x3c')]({},_0x48901b,_0x1aa141[_0x4686('0x3e')]);var _0x33597e={'where':_0x48901b[_0x4686('0x3b')]};return db[_0x4686('0x2c')][_0x4686('0x3f')](_0x33597e)[_0x4686('0x26')](function(_0x7aa0c5){_0x5e0717[_0x4686('0x3f')]=_0x7aa0c5;if(_0x1aa141[_0x4686('0x32')][_0x4686('0x40')]){_0x48901b[_0x4686('0x41')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4686('0x42')](_0x48901b);})[_0x4686('0x26')](function(_0x13cae6){_0x5e0717['rows']=_0x13cae6;return _0x5e0717;})[_0x4686('0x26')](respondWithFilteredResult(_0x53fa2e,_0x48901b))[_0x4686('0x43')](handleError(_0x53fa2e,null));};exports['show']=function(_0x4d9be2,_0x7e31b8){var _0x5343af={'raw':!![],'where':{'id':_0x4d9be2[_0x4686('0x44')]['id']}},_0x142c96={};_0x142c96[_0x4686('0x31')]=_['keys'](db[_0x4686('0x2c')]['rawAttributes']);_0x142c96[_0x4686('0x32')]=_['keys'](_0x4d9be2['query']);_0x142c96[_0x4686('0x33')]=_[_0x4686('0x45')](_0x142c96[_0x4686('0x31')],_0x142c96[_0x4686('0x32')]);_0x5343af[_0x4686('0x34')]=_[_0x4686('0x45')](_0x142c96[_0x4686('0x31')],qs[_0x4686('0x35')](_0x4d9be2['query']['fields']));_0x5343af['attributes']=_0x5343af[_0x4686('0x34')]['length']?_0x5343af['attributes']:_0x142c96[_0x4686('0x31')];if(_0x4d9be2[_0x4686('0x32')][_0x4686('0x40')]){_0x5343af[_0x4686('0x41')]=[{'all':!![]}];}_0x5343af=_[_0x4686('0x3c')]({},_0x5343af,_0x4d9be2[_0x4686('0x3e')]);return db[_0x4686('0x2c')]['find'](_0x5343af)[_0x4686('0x26')](handleEntityNotFound(_0x7e31b8,null))[_0x4686('0x26')](respondWithResult(_0x7e31b8,null))[_0x4686('0x43')](handleError(_0x7e31b8,null));};exports[_0x4686('0x46')]=function(_0x4275ca,_0x57b1ca){return db[_0x4686('0x2c')]['create'](_0x4275ca['body'],{})[_0x4686('0x26')](respondWithResult(_0x57b1ca,0xc9))[_0x4686('0x43')](handleError(_0x57b1ca,null));};exports[_0x4686('0x25')]=function(_0xf638b1,_0x165d44){if(_0xf638b1[_0x4686('0x47')]['id']){delete _0xf638b1[_0x4686('0x47')]['id'];}return db[_0x4686('0x2c')]['find']({'where':{'id':_0xf638b1[_0x4686('0x44')]['id']}})['then'](handleEntityNotFound(_0x165d44,null))[_0x4686('0x26')](saveUpdates(_0xf638b1[_0x4686('0x47')],null))[_0x4686('0x26')](respondWithResult(_0x165d44,null))[_0x4686('0x43')](handleError(_0x165d44,null));};exports[_0x4686('0x27')]=function(_0x1e3406,_0xad4d8a){return db[_0x4686('0x2c')]['find']({'where':{'id':_0x1e3406[_0x4686('0x44')]['id']}})[_0x4686('0x26')](handleEntityNotFound(_0xad4d8a,null))['then'](removeEntity(_0xad4d8a,null))[_0x4686('0x43')](handleError(_0xad4d8a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b42d7e2..b2fd850 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 _0x27fb=['moment','request-promise','path','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2b503e,_0x2bf9a9){var _0x234b33=function(_0x17b7b4){while(--_0x17b7b4){_0x2b503e['push'](_0x2b503e['shift']());}};_0x234b33(++_0x2bf9a9);}(_0x27fb,0x1de));var _0xb27f=function(_0x1b944d,_0x14ac0f){_0x1b944d=_0x1b944d-0x0;var _0x1caddc=_0x27fb[_0x1b944d];return _0x1caddc;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var logger=require(_0xb27f('0x2'))('api');var moment=require(_0xb27f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb27f('0x4'));var fs=require('fs');var path=require(_0xb27f('0x5'));var rimraf=require(_0xb27f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb27f('0x7'));module['exports']=function(_0x2a1fa2,_0x3d70f3){return _0x2a1fa2[_0xb27f('0x8')](_0xb27f('0x9'),attributes,{'tableName':_0xb27f('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb27f('0xb'),_0xb27f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30d3=['freshsales_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','int_freshsales_fields'];(function(_0x425355,_0x53d26b){var _0x4a3d30=function(_0x51b9a7){while(--_0x51b9a7){_0x425355['push'](_0x425355['shift']());}};_0x4a3d30(++_0x53d26b);}(_0x30d3,0x9f));var _0x330d=function(_0x2e4ac0,_0x37eaa3){_0x2e4ac0=_0x2e4ac0-0x0;var _0x17abdb=_0x30d3[_0x2e4ac0];return _0x17abdb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x330d('0x0'))(_0x330d('0x1'));var moment=require(_0x330d('0x2'));var BPromise=require(_0x330d('0x3'));var rp=require(_0x330d('0x4'));var fs=require('fs');var path=require(_0x330d('0x5'));var rimraf=require(_0x330d('0x6'));var config=require('../../config/environment');var attributes=require(_0x330d('0x7'));module[_0x330d('0x8')]=function(_0xd8503,_0x2a330f){return _0xd8503['define']('FreshsalesField',attributes,{'tableName':_0x330d('0x9'),'paranoid':![],'indexes':[{'name':_0x330d('0xa'),'fields':[_0x330d('0xb'),_0x330d('0xc')],'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 1acbf57..7751efc 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 _0xd8fb=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0xd8fb,0x99));var _0xbd8f=function(_0x7f8009,_0x182798){_0x7f8009=_0x7f8009-0x0;var _0x4bc0ef=_0xd8fb[_0x7f8009];return _0x4bc0ef;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});} \ No newline at end of file +var _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x7096,0x10c));var _0x6709=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7096[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 07b7c45..3b3c289 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x44817a,_0x16f8ae){var _0x55af6b=function(_0x1e6d12){while(--_0x1e6d12){_0x44817a['push'](_0x44817a['shift']());}};_0x55af6b(++_0x16f8ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1d0721,_0x127c5a){var _0x4b490e=function(_0x1672ff){while(--_0x1672ff){_0x1d0721['push'](_0x1d0721['shift']());}};_0x4b490e(++_0x127c5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ceb9fee..ba181f0 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 _0x2432=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2432,0x7a));var _0x2243=function(_0x44046e,_0x43f1c3){_0x44046e=_0x44046e-0x0;var _0x4d8ed7=_0x2432[_0x44046e];return _0x4d8ed7;};'use strict';var Sequelize=require(_0x2243('0x0'));module[_0x2243('0x1')]={'name':{'type':Sequelize[_0x2243('0x2')]},'description':{'type':Sequelize[_0x2243('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2243('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2243('0x2')]},'clientId':{'type':Sequelize[_0x2243('0x2')]},'clientSecret':{'type':Sequelize[_0x2243('0x2')]},'securityToken':{'type':Sequelize[_0x2243('0x2')]},'serverUrl':{'type':Sequelize[_0x2243('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2243('0x4')](_0x2243('0x5'),_0x2243('0x6')),'defaultValue':_0x2243('0x5')}}; \ No newline at end of file +var _0x62ff=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x4acbcd,_0x7120ba){var _0x22dbd5=function(_0x1d32d7){while(--_0x1d32d7){_0x4acbcd['push'](_0x4acbcd['shift']());}};_0x22dbd5(++_0x7120ba);}(_0x62ff,0x1e5));var _0xf62f=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x62ff[_0x4e7d25];return _0x526fe6;};'use strict';var Sequelize=require(_0xf62f('0x0'));module[_0xf62f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf62f('0x2')]},'username':{'type':Sequelize[_0xf62f('0x2')],'unique':_0xf62f('0x3')},'remoteUri':{'type':Sequelize[_0xf62f('0x2')]},'password':{'type':Sequelize[_0xf62f('0x2')]},'clientId':{'type':Sequelize[_0xf62f('0x2')]},'clientSecret':{'type':Sequelize[_0xf62f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf62f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf62f('0x4')](_0xf62f('0x5'),'newTab'),'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 75a76a6..40102fb 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 _0x6167=['where','filter','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','merge','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','username','securityToken','slice','lastIndexOf','Connection','clientSecret','login','password','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort'];(function(_0x13aba8,_0x4217f7){var _0x37c8ba=function(_0x32dc49){while(--_0x32dc49){_0x13aba8['push'](_0x13aba8['shift']());}};_0x37c8ba(++_0x4217f7);}(_0x6167,0x136));var _0x7616=function(_0x3e5af7,_0x522cbf){_0x3e5af7=_0x3e5af7-0x0;var _0x25915a=_0x6167[_0x3e5af7];return _0x25915a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7616('0x0'));var jsonpatch=require(_0x7616('0x1'));var rp=require(_0x7616('0x2'));var moment=require('moment');var BPromise=require(_0x7616('0x3'));var Mustache=require(_0x7616('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7616('0x5'));var fs=require('fs');var fs_extra=require(_0x7616('0x6'));var _=require(_0x7616('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7616('0x8'));var deskjs=require(_0x7616('0x9'));var toCsv=require(_0x7616('0xa'));var querystring=require('querystring');var Papa=require(_0x7616('0xb'));var Redis=require(_0x7616('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7616('0xd'));var logger=require(_0x7616('0xe'))(_0x7616('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7616('0x10'));var db=require(_0x7616('0x11'))['db'];var integrations=require(_0x7616('0x12'));function respondWithStatusCode(_0x5cfa76,_0x122f1c){_0x122f1c=_0x122f1c||0xcc;return function(_0x375962){if(_0x375962){return _0x5cfa76[_0x7616('0x13')](_0x122f1c);}return _0x5cfa76[_0x7616('0x14')](_0x122f1c)[_0x7616('0x15')]();};}function respondWithResult(_0x2da939,_0x40dbc8){_0x40dbc8=_0x40dbc8||0xc8;return function(_0x15d9f3){if(_0x15d9f3){return _0x2da939['status'](_0x40dbc8)[_0x7616('0x16')](_0x15d9f3);}};}function respondWithFilteredResult(_0x940309,_0x3b9873){return function(_0x1b9208){if(_0x1b9208){var _0x26be0f=typeof _0x3b9873[_0x7616('0x17')]===_0x7616('0x18')&&typeof _0x3b9873[_0x7616('0x19')]===_0x7616('0x18');var _0x384779=_0x1b9208[_0x7616('0x1a')];var _0x1182bd=_0x26be0f?0x0:_0x3b9873[_0x7616('0x17')];var _0x162007=_0x26be0f?_0x1b9208[_0x7616('0x1a')]:_0x3b9873[_0x7616('0x17')]+_0x3b9873[_0x7616('0x19')];var _0x58252f;if(_0x162007>=_0x384779){_0x162007=_0x384779;_0x58252f=0xc8;}else{_0x58252f=0xce;}_0x940309['status'](_0x58252f);return _0x940309[_0x7616('0x1b')]('Content-Range',_0x1182bd+'-'+_0x162007+'/'+_0x384779)['json'](_0x1b9208);}return null;};}function patchUpdates(_0x287a0c){return function(_0x151d68){try{jsonpatch[_0x7616('0x1c')](_0x151d68,_0x287a0c,!![]);}catch(_0x6713d5){return BPromise[_0x7616('0x1d')](_0x6713d5);}return _0x151d68[_0x7616('0x1e')]();};}function saveUpdates(_0x3e6b52,_0x457e6e){return function(_0x31e67b){if(_0x31e67b){return _0x31e67b[_0x7616('0x1f')](_0x3e6b52)['then'](function(_0x2849a2){return _0x2849a2;});}return null;};}function removeEntity(_0x31e598,_0x2fdddd){return function(_0x123711){if(_0x123711){return _0x123711[_0x7616('0x20')]()[_0x7616('0x21')](function(){_0x31e598['status'](0xcc)[_0x7616('0x15')]();});}};}function handleEntityNotFound(_0x591425,_0x5a5603){return function(_0x235ee8){if(!_0x235ee8){_0x591425[_0x7616('0x13')](0x194);}return _0x235ee8;};}function handleError(_0x5b2aed,_0x9883f7){_0x9883f7=_0x9883f7||0x1f4;return function(_0x59bb17){logger[_0x7616('0x22')](_0x59bb17['stack']);if(_0x59bb17[_0x7616('0x23')]){delete _0x59bb17['name'];}_0x5b2aed['status'](_0x9883f7)[_0x7616('0x24')](_0x59bb17);};}exports['index']=function(_0x3ea373,_0x476f44){var _0x5c2de0={},_0x35477b={},_0x30501b={'count':0x0,'rows':[]};var _0x2521ce=_[_0x7616('0x25')](db[_0x7616('0x26')][_0x7616('0x27')],function(_0x198416){return{'name':_0x198416[_0x7616('0x28')],'type':_0x198416[_0x7616('0x29')][_0x7616('0x2a')]};});_0x35477b[_0x7616('0x2b')]=_[_0x7616('0x25')](_0x2521ce,_0x7616('0x23'));_0x35477b[_0x7616('0x2c')]=_[_0x7616('0x2d')](_0x3ea373[_0x7616('0x2c')]);_0x35477b[_0x7616('0x2e')]=_['intersection'](_0x35477b[_0x7616('0x2b')],_0x35477b[_0x7616('0x2c')]);_0x5c2de0[_0x7616('0x2f')]=_[_0x7616('0x30')](_0x35477b[_0x7616('0x2b')],qs[_0x7616('0x31')](_0x3ea373[_0x7616('0x2c')]['fields']));_0x5c2de0['attributes']=_0x5c2de0[_0x7616('0x2f')][_0x7616('0x32')]?_0x5c2de0['attributes']:_0x35477b[_0x7616('0x2b')];if(!_0x3ea373[_0x7616('0x2c')]['hasOwnProperty'](_0x7616('0x33'))){_0x5c2de0[_0x7616('0x19')]=qs[_0x7616('0x19')](_0x3ea373[_0x7616('0x2c')][_0x7616('0x19')]);_0x5c2de0[_0x7616('0x17')]=qs['offset'](_0x3ea373[_0x7616('0x2c')][_0x7616('0x17')]);}_0x5c2de0['order']=qs[_0x7616('0x34')](_0x3ea373['query'][_0x7616('0x34')]);_0x5c2de0[_0x7616('0x35')]=qs[_0x7616('0x2e')](_['pick'](_0x3ea373[_0x7616('0x2c')],_0x35477b['filters']),_0x2521ce);if(_0x3ea373[_0x7616('0x2c')][_0x7616('0x36')]){_0x5c2de0[_0x7616('0x35')]=_['merge'](_0x5c2de0[_0x7616('0x35')],{'$or':_[_0x7616('0x25')](_0x2521ce,function(_0x1d6e0c){if(_0x1d6e0c[_0x7616('0x29')]!==_0x7616('0x37')){var _0x2ef82f={};_0x2ef82f[_0x1d6e0c[_0x7616('0x23')]]={'$like':'%'+_0x3ea373[_0x7616('0x2c')][_0x7616('0x36')]+'%'};return _0x2ef82f;}})});}_0x5c2de0=_['merge']({},_0x5c2de0,_0x3ea373[_0x7616('0x38')]);var _0x465af2={'where':_0x5c2de0['where']};return db[_0x7616('0x26')][_0x7616('0x1a')](_0x465af2)[_0x7616('0x21')](function(_0x22f2a6){_0x30501b[_0x7616('0x1a')]=_0x22f2a6;if(_0x3ea373['query']['includeAll']){_0x5c2de0['include']=[{'all':!![]}];}return db[_0x7616('0x26')][_0x7616('0x39')](_0x5c2de0);})[_0x7616('0x21')](function(_0x398cfa){_0x30501b[_0x7616('0x3a')]=_0x398cfa;return _0x30501b;})[_0x7616('0x21')](respondWithFilteredResult(_0x476f44,_0x5c2de0))[_0x7616('0x3b')](handleError(_0x476f44,null));};exports[_0x7616('0x3c')]=function(_0x5cf314,_0xda16b0){var _0x3bc7ac={'raw':![],'where':{'id':_0x5cf314[_0x7616('0x3d')]['id']}},_0x37f6bd={};_0x37f6bd['model']=_['keys'](db[_0x7616('0x26')]['rawAttributes']);_0x37f6bd['query']=_[_0x7616('0x2d')](_0x5cf314[_0x7616('0x2c')]);_0x37f6bd['filters']=_['intersection'](_0x37f6bd[_0x7616('0x2b')],_0x37f6bd[_0x7616('0x2c')]);_0x3bc7ac[_0x7616('0x2f')]=_[_0x7616('0x30')](_0x37f6bd[_0x7616('0x2b')],qs[_0x7616('0x31')](_0x5cf314[_0x7616('0x2c')]['fields']));_0x3bc7ac['attributes']=_0x3bc7ac['attributes'][_0x7616('0x32')]?_0x3bc7ac[_0x7616('0x2f')]:_0x37f6bd['model'];if(_0x5cf314[_0x7616('0x2c')][_0x7616('0x3e')]){_0x3bc7ac[_0x7616('0x3f')]=[{'all':!![]}];}_0x3bc7ac=_[_0x7616('0x40')]({},_0x3bc7ac,_0x5cf314[_0x7616('0x38')]);return db[_0x7616('0x26')]['find'](_0x3bc7ac)['then'](handleEntityNotFound(_0xda16b0,null))[_0x7616('0x21')](respondWithResult(_0xda16b0,null))[_0x7616('0x3b')](handleError(_0xda16b0,null));};exports[_0x7616('0x41')]=function(_0xb00c71,_0x3e39b2){return db['SalesforceAccount']['create'](_0xb00c71[_0x7616('0x42')],{})[_0x7616('0x21')](respondWithResult(_0x3e39b2,0xc9))['catch'](handleError(_0x3e39b2,null));};exports[_0x7616('0x1f')]=function(_0x2aaae6,_0x34968a){if(_0x2aaae6[_0x7616('0x42')]['id']){delete _0x2aaae6[_0x7616('0x42')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x2aaae6[_0x7616('0x3d')]['id']}})[_0x7616('0x21')](handleEntityNotFound(_0x34968a,null))['then'](saveUpdates(_0x2aaae6[_0x7616('0x42')],null))[_0x7616('0x21')](respondWithResult(_0x34968a,null))[_0x7616('0x3b')](handleError(_0x34968a,null));};exports[_0x7616('0x20')]=function(_0x2393ea,_0x572988){return db[_0x7616('0x26')]['find']({'where':{'id':_0x2393ea[_0x7616('0x3d')]['id']}})[_0x7616('0x21')](handleEntityNotFound(_0x572988,null))[_0x7616('0x21')](removeEntity(_0x572988,null))['catch'](handleError(_0x572988,null));};exports[_0x7616('0x43')]=function(_0x1a59ff,_0x272e93,_0x4f54b8){var _0x2ea34b={};var _0x4d06e3={};var _0x36ae1d;var _0x2811c4;return db[_0x7616('0x26')][_0x7616('0x44')]({'where':{'id':_0x1a59ff['params']['id']}})['then'](handleEntityNotFound(_0x272e93,null))[_0x7616('0x21')](function(_0x4ce3ad){if(_0x4ce3ad){_0x36ae1d=_0x4ce3ad;_0x4d06e3[_0x7616('0x2b')]=_[_0x7616('0x2d')](db[_0x7616('0x45')][_0x7616('0x27')]);_0x4d06e3[_0x7616('0x2c')]=_[_0x7616('0x2d')](_0x1a59ff[_0x7616('0x2c')]);_0x4d06e3[_0x7616('0x2e')]=_[_0x7616('0x30')](_0x4d06e3[_0x7616('0x2b')],_0x4d06e3[_0x7616('0x2c')]);_0x2ea34b[_0x7616('0x2f')]=_[_0x7616('0x30')](_0x4d06e3[_0x7616('0x2b')],qs[_0x7616('0x31')](_0x1a59ff[_0x7616('0x2c')][_0x7616('0x31')]));_0x2ea34b[_0x7616('0x2f')]=_0x2ea34b[_0x7616('0x2f')][_0x7616('0x32')]?_0x2ea34b[_0x7616('0x2f')]:_0x4d06e3[_0x7616('0x2b')];_0x2ea34b['order']=qs[_0x7616('0x34')](_0x1a59ff['query']['sort']);_0x2ea34b['where']=qs[_0x7616('0x2e')](_[_0x7616('0x46')](_0x1a59ff[_0x7616('0x2c')],_0x4d06e3[_0x7616('0x2e')]));if(_0x1a59ff[_0x7616('0x2c')]['filter']){_0x2ea34b[_0x7616('0x35')]=_[_0x7616('0x40')](_0x2ea34b[_0x7616('0x35')],{'$or':_['map'](_0x2ea34b[_0x7616('0x2f')],function(_0x723287){var _0x51d11d={};_0x51d11d[_0x723287]={'$like':'%'+_0x1a59ff[_0x7616('0x2c')]['filter']+'%'};return _0x51d11d;})});}_0x2ea34b=_[_0x7616('0x40')]({},_0x2ea34b,_0x1a59ff[_0x7616('0x38')]);return _0x36ae1d[_0x7616('0x43')](_0x2ea34b);}})['then'](function(_0x192a5f){if(_0x192a5f){_0x2811c4=_0x192a5f['length'];if(!_0x1a59ff[_0x7616('0x2c')][_0x7616('0x47')]('nolimit')){_0x2ea34b[_0x7616('0x19')]=qs[_0x7616('0x19')](_0x1a59ff[_0x7616('0x2c')][_0x7616('0x19')]);_0x2ea34b[_0x7616('0x17')]=qs[_0x7616('0x17')](_0x1a59ff[_0x7616('0x2c')][_0x7616('0x17')]);}return _0x36ae1d['getConfigurations'](_0x2ea34b);}})[_0x7616('0x21')](function(_0xcbb70f){if(_0xcbb70f){return _0xcbb70f?{'count':_0x2811c4,'rows':_0xcbb70f}:null;}})[_0x7616('0x21')](respondWithResult(_0x272e93,null))[_0x7616('0x3b')](handleError(_0x272e93,null));};exports[_0x7616('0x48')]=function(_0x35f8a0,_0x40755e,_0x26c540){if(_0x35f8a0[_0x7616('0x42')]['id']){delete _0x35f8a0[_0x7616('0x42')]['id'];}return db[_0x7616('0x26')][_0x7616('0x44')]({'where':{'id':_0x35f8a0[_0x7616('0x3d')]['id']}})[_0x7616('0x21')](handleEntityNotFound(_0x40755e,null))['then'](function(_0x50f9be){if(_0x50f9be){_0x35f8a0['body']['AccountId']=_0x50f9be['id'];_0x35f8a0[_0x7616('0x42')][_0x7616('0x49')]=integrations[_0x7616('0x4a')](_0x35f8a0[_0x7616('0x42')][_0x7616('0x4b')],_0x35f8a0[_0x7616('0x42')][_0x7616('0x29')]);_0x35f8a0[_0x7616('0x42')][_0x7616('0x4c')]=integrations[_0x7616('0x4d')](_0x35f8a0[_0x7616('0x42')][_0x7616('0x4b')],_0x35f8a0['body']['type']);return db['SalesforceConfiguration'][_0x7616('0x41')](_0x35f8a0[_0x7616('0x42')],{'include':[{'model':db[_0x7616('0x4e')],'as':_0x7616('0x49')},{'model':db['SalesforceField'],'as':_0x7616('0x4c')}]});}return null;})['then'](respondWithResult(_0x40755e,null))[_0x7616('0x3b')](handleError(_0x40755e,null));};exports['getFields']=function(_0x223312,_0x58a112,_0x315d9f){var _0x3731d3;var _0x5f31e9='';var _0x2591ad=_0x7616('0x4f');return db['SalesforceAccount'][_0x7616('0x44')]({'where':{'id':_0x223312[_0x7616('0x3d')]['id']},'attributes':['id',_0x7616('0x50'),_0x7616('0x51'),'clientSecret',_0x7616('0x52'),'password',_0x7616('0x53')]})[_0x7616('0x21')](handleEntityNotFound(_0x58a112,null))[_0x7616('0x21')](function(_0x1ebc3a){if(_0x1ebc3a){_0x5f31e9=_0x1ebc3a[_0x7616('0x50')];var _0x7b09e=_0x5f31e9[_0x7616('0x54')](-0x1);if(_0x7b09e==='/'){_0x5f31e9=_0x5f31e9['substring'](0x0,_0x5f31e9[_0x7616('0x55')](_0x7b09e));}_0x3731d3=new jsforce[(_0x7616('0x56'))]({'oauth2':{'loginUrl':_0x5f31e9,'clientId':_0x1ebc3a[_0x7616('0x51')],'clientSecret':_0x1ebc3a[_0x7616('0x57')]}});return _0x3731d3[_0x7616('0x58')](_0x1ebc3a[_0x7616('0x52')],_0x1ebc3a[_0x7616('0x59')][_0x7616('0x5a')](_0x1ebc3a['securityToken']));}})['then'](function(_0x422a62){if(_0x422a62){if(!_[_0x7616('0x5b')](_0x223312[_0x7616('0x2c')][_0x7616('0x5c')])){_0x2591ad=_0x223312['query']['ticketType'];}return _0x3731d3[_0x7616('0x5d')](_0x2591ad)['describe']();}})['then'](function(_0x514d4b){var _0x208f43=['OwnerId',_0x7616('0x5e'),_0x7616('0x5f'),_0x7616('0x60'),_0x7616('0x61'),_0x7616('0x62')];var _0x4a0140=[_0x7616('0x63'),_0x7616('0x64'),_0x7616('0x65'),_0x7616('0x66'),_0x7616('0x67'),_0x7616('0x68'),_0x7616('0x69')];if(_0x514d4b){_[_0x7616('0x6a')](_0x514d4b[_0x7616('0x31')],function(_0x29de68){return _0x208f43[_0x7616('0x6b')](_0x29de68['name'])||!_0x4a0140[_0x7616('0x6b')](_0x29de68[_0x7616('0x29')]);});return{'count':_0x514d4b[_0x7616('0x31')][_0x7616('0x32')],'rows':_[_0x7616('0x25')](_0x514d4b['fields'],function(_0x967ab9){return{'id':_0x967ab9[_0x7616('0x23')],'name':_0x967ab9['label'],'custom':_0x967ab9[_0x7616('0x6c')],'options':_0x967ab9[_0x7616('0x6d')][_0x7616('0x32')]>0x0?_[_0x7616('0x25')](_0x967ab9['picklistValues'],function(_0x11d2fb){return{'name':_0x11d2fb[_0x7616('0x6e')],'value':_0x11d2fb[_0x7616('0x6f')]};}):_0x967ab9[_0x7616('0x29')]==_0x7616('0x66')?[{'name':_0x7616('0x70'),'value':'true'},{'name':_0x7616('0x71'),'value':_0x7616('0x72')}]:[]};})};}})[_0x7616('0x21')](respondWithResult(_0x58a112,null))[_0x7616('0x3b')](function(_0xcc3782){var _0x4fe015=_0x223312[_0x7616('0x2c')][_0x7616('0x73')]?0x1f4:_0xcc3782[_0x7616('0x74')]||0x1f4;logger['error'](_0x7616('0x75'),_0x7616('0x76'),_0x4fe015,JSON[_0x7616('0x77')](_0xcc3782));delete _0xcc3782[_0x7616('0x23')];if(_0x4fe015===0x191){_0x4fe015=0x190;}_0x58a112['status'](_0x4fe015)[_0x7616('0x24')](_0x223312[_0x7616('0x2c')][_0x7616('0x73')]?{'message':_0x7616('0x78'),'statusCode':_0xcc3782[_0x7616('0x74')]}:_0xcc3782);});}; \ No newline at end of file +var _0xb697=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','then','end','sendStatus','stack','name','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','AccountId','channel','Descriptions','SalesforceField','Subjects','getFields','Task','clientSecret','securityToken','remoteUri','lastIndexOf','Connection','clientId','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','boolean','textarea','remove','includes','label','custom','picklistValues','value','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','rimraf'];(function(_0x1090e9,_0x389bd1){var _0x479f50=function(_0x5822ab){while(--_0x5822ab){_0x1090e9['push'](_0x1090e9['shift']());}};_0x479f50(++_0x389bd1);}(_0xb697,0x1df));var _0x7b69=function(_0x4826d1,_0x34bb4e){_0x4826d1=_0x4826d1-0x0;var _0x17c72f=_0xb697[_0x4826d1];return _0x17c72f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b69('0x0'));var zipdir=require(_0x7b69('0x1'));var jsonpatch=require(_0x7b69('0x2'));var rp=require(_0x7b69('0x3'));var moment=require('moment');var BPromise=require(_0x7b69('0x4'));var Mustache=require(_0x7b69('0x5'));var util=require(_0x7b69('0x6'));var path=require(_0x7b69('0x7'));var sox=require(_0x7b69('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b69('0x9'));var squel=require(_0x7b69('0xa'));var crypto=require(_0x7b69('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b69('0xc'));var toCsv=require(_0x7b69('0xd'));var querystring=require(_0x7b69('0xe'));var Papa=require(_0x7b69('0xf'));var Redis=require(_0x7b69('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7b69('0x11'));var as=require(_0x7b69('0x12'));var hardwareService=require(_0x7b69('0x13'));var logger=require(_0x7b69('0x14'))(_0x7b69('0x15'));var utils=require('../../config/utils');var config=require(_0x7b69('0x16'));var licenseUtil=require(_0x7b69('0x17'));var db=require(_0x7b69('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x34d20e,_0x335e86){_0x335e86=_0x335e86||0xcc;return function(_0x7be6ff){if(_0x7be6ff){return _0x34d20e['sendStatus'](_0x335e86);}return _0x34d20e[_0x7b69('0x19')](_0x335e86)['end']();};}function respondWithResult(_0x3528be,_0x59a5fa){_0x59a5fa=_0x59a5fa||0xc8;return function(_0x58567e){if(_0x58567e){return _0x3528be[_0x7b69('0x19')](_0x59a5fa)[_0x7b69('0x1a')](_0x58567e);}};}function respondWithFilteredResult(_0x5205c8,_0x5d881f){return function(_0x4e9665){if(_0x4e9665){var _0xfbe7f=typeof _0x5d881f[_0x7b69('0x1b')]===_0x7b69('0x1c')&&typeof _0x5d881f[_0x7b69('0x1d')]===_0x7b69('0x1c');var _0x30afdf=_0x4e9665[_0x7b69('0x1e')];var _0x1f6225=_0xfbe7f?0x0:_0x5d881f[_0x7b69('0x1b')];var _0x34d46c=_0xfbe7f?_0x4e9665[_0x7b69('0x1e')]:_0x5d881f['offset']+_0x5d881f[_0x7b69('0x1d')];var _0x388ede;if(_0x34d46c>=_0x30afdf){_0x34d46c=_0x30afdf;_0x388ede=0xc8;}else{_0x388ede=0xce;}_0x5205c8[_0x7b69('0x19')](_0x388ede);return _0x5205c8['set'](_0x7b69('0x1f'),_0x1f6225+'-'+_0x34d46c+'/'+_0x30afdf)[_0x7b69('0x1a')](_0x4e9665);}return null;};}function patchUpdates(_0x103698){return function(_0x35826b){try{jsonpatch[_0x7b69('0x20')](_0x35826b,_0x103698,!![]);}catch(_0x65670d){return BPromise[_0x7b69('0x21')](_0x65670d);}return _0x35826b['save']();};}function saveUpdates(_0x1b8e2d,_0x2db1a2){return function(_0x462ed3){if(_0x462ed3){return _0x462ed3['update'](_0x1b8e2d)['then'](function(_0xf5f865){return _0xf5f865;});}return null;};}function removeEntity(_0x540ba5,_0x382c9a){return function(_0x91747c){if(_0x91747c){return _0x91747c[_0x7b69('0x22')]()[_0x7b69('0x23')](function(){_0x540ba5['status'](0xcc)[_0x7b69('0x24')]();});}};}function handleEntityNotFound(_0x1e2b45,_0x564571){return function(_0x1523d8){if(!_0x1523d8){_0x1e2b45[_0x7b69('0x25')](0x194);}return _0x1523d8;};}function handleError(_0x45eac2,_0x477c9d){_0x477c9d=_0x477c9d||0x1f4;return function(_0x327133){logger['error'](_0x327133[_0x7b69('0x26')]);if(_0x327133[_0x7b69('0x27')]){delete _0x327133[_0x7b69('0x27')];}_0x45eac2[_0x7b69('0x19')](_0x477c9d)['send'](_0x327133);};}exports['index']=function(_0x3e19f3,_0x4658f9){var _0x309dae={},_0xe724d2={},_0x4220b4={'count':0x0,'rows':[]};var _0x554464=_['map'](db[_0x7b69('0x28')][_0x7b69('0x29')],function(_0x4519c2){return{'name':_0x4519c2[_0x7b69('0x2a')],'type':_0x4519c2[_0x7b69('0x2b')][_0x7b69('0x2c')]};});_0xe724d2[_0x7b69('0x2d')]=_[_0x7b69('0x2e')](_0x554464,'name');_0xe724d2['query']=_[_0x7b69('0x2f')](_0x3e19f3[_0x7b69('0x30')]);_0xe724d2['filters']=_[_0x7b69('0x31')](_0xe724d2[_0x7b69('0x2d')],_0xe724d2[_0x7b69('0x30')]);_0x309dae[_0x7b69('0x32')]=_['intersection'](_0xe724d2[_0x7b69('0x2d')],qs[_0x7b69('0x33')](_0x3e19f3[_0x7b69('0x30')][_0x7b69('0x33')]));_0x309dae[_0x7b69('0x32')]=_0x309dae['attributes']['length']?_0x309dae[_0x7b69('0x32')]:_0xe724d2[_0x7b69('0x2d')];if(!_0x3e19f3[_0x7b69('0x30')][_0x7b69('0x34')](_0x7b69('0x35'))){_0x309dae[_0x7b69('0x1d')]=qs[_0x7b69('0x1d')](_0x3e19f3[_0x7b69('0x30')][_0x7b69('0x1d')]);_0x309dae[_0x7b69('0x1b')]=qs[_0x7b69('0x1b')](_0x3e19f3[_0x7b69('0x30')][_0x7b69('0x1b')]);}_0x309dae['order']=qs[_0x7b69('0x36')](_0x3e19f3['query']['sort']);_0x309dae[_0x7b69('0x37')]=qs[_0x7b69('0x38')](_[_0x7b69('0x39')](_0x3e19f3[_0x7b69('0x30')],_0xe724d2['filters']),_0x554464);if(_0x3e19f3['query'][_0x7b69('0x3a')]){_0x309dae[_0x7b69('0x37')]=_[_0x7b69('0x3b')](_0x309dae[_0x7b69('0x37')],{'$or':_[_0x7b69('0x2e')](_0x554464,function(_0x15c668){if(_0x15c668[_0x7b69('0x2b')]!==_0x7b69('0x3c')){var _0x4de7ed={};_0x4de7ed[_0x15c668['name']]={'$like':'%'+_0x3e19f3['query'][_0x7b69('0x3a')]+'%'};return _0x4de7ed;}})});}_0x309dae=_[_0x7b69('0x3b')]({},_0x309dae,_0x3e19f3[_0x7b69('0x3d')]);var _0x1bc9c3={'where':_0x309dae[_0x7b69('0x37')]};return db[_0x7b69('0x28')][_0x7b69('0x1e')](_0x1bc9c3)[_0x7b69('0x23')](function(_0x429a51){_0x4220b4[_0x7b69('0x1e')]=_0x429a51;if(_0x3e19f3[_0x7b69('0x30')][_0x7b69('0x3e')]){_0x309dae[_0x7b69('0x3f')]=[{'all':!![]}];}return db[_0x7b69('0x28')][_0x7b69('0x40')](_0x309dae);})[_0x7b69('0x23')](function(_0xca1401){_0x4220b4[_0x7b69('0x41')]=_0xca1401;return _0x4220b4;})[_0x7b69('0x23')](respondWithFilteredResult(_0x4658f9,_0x309dae))[_0x7b69('0x42')](handleError(_0x4658f9,null));};exports[_0x7b69('0x43')]=function(_0x878e7e,_0x4fd902){var _0x304f9f={'raw':![],'where':{'id':_0x878e7e[_0x7b69('0x44')]['id']}},_0x4299c3={};_0x4299c3[_0x7b69('0x2d')]=_[_0x7b69('0x2f')](db[_0x7b69('0x28')][_0x7b69('0x29')]);_0x4299c3[_0x7b69('0x30')]=_[_0x7b69('0x2f')](_0x878e7e[_0x7b69('0x30')]);_0x4299c3[_0x7b69('0x38')]=_[_0x7b69('0x31')](_0x4299c3[_0x7b69('0x2d')],_0x4299c3[_0x7b69('0x30')]);_0x304f9f['attributes']=_[_0x7b69('0x31')](_0x4299c3[_0x7b69('0x2d')],qs[_0x7b69('0x33')](_0x878e7e[_0x7b69('0x30')][_0x7b69('0x33')]));_0x304f9f[_0x7b69('0x32')]=_0x304f9f[_0x7b69('0x32')][_0x7b69('0x45')]?_0x304f9f[_0x7b69('0x32')]:_0x4299c3[_0x7b69('0x2d')];if(_0x878e7e[_0x7b69('0x30')][_0x7b69('0x3e')]){_0x304f9f[_0x7b69('0x3f')]=[{'all':!![]}];}_0x304f9f=_[_0x7b69('0x3b')]({},_0x304f9f,_0x878e7e[_0x7b69('0x3d')]);return db[_0x7b69('0x28')]['find'](_0x304f9f)[_0x7b69('0x23')](handleEntityNotFound(_0x4fd902,null))[_0x7b69('0x23')](respondWithResult(_0x4fd902,null))[_0x7b69('0x42')](handleError(_0x4fd902,null));};exports[_0x7b69('0x46')]=function(_0x4c3256,_0x2d3eae){return db[_0x7b69('0x28')]['create'](_0x4c3256[_0x7b69('0x47')],{})[_0x7b69('0x23')](respondWithResult(_0x2d3eae,0xc9))['catch'](handleError(_0x2d3eae,null));};exports[_0x7b69('0x48')]=function(_0x1024ab,_0x4ef2d4){if(_0x1024ab['body']['id']){delete _0x1024ab[_0x7b69('0x47')]['id'];}return db[_0x7b69('0x28')][_0x7b69('0x49')]({'where':{'id':_0x1024ab[_0x7b69('0x44')]['id']}})[_0x7b69('0x23')](handleEntityNotFound(_0x4ef2d4,null))[_0x7b69('0x23')](saveUpdates(_0x1024ab[_0x7b69('0x47')],null))['then'](respondWithResult(_0x4ef2d4,null))[_0x7b69('0x42')](handleError(_0x4ef2d4,null));};exports['destroy']=function(_0x42bcd0,_0x2ba5c4){return db[_0x7b69('0x28')][_0x7b69('0x49')]({'where':{'id':_0x42bcd0[_0x7b69('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ba5c4,null))[_0x7b69('0x23')](removeEntity(_0x2ba5c4,null))['catch'](handleError(_0x2ba5c4,null));};exports[_0x7b69('0x4a')]=function(_0x1470bf,_0x9856d8,_0x56ebe5){var _0x543370={};var _0x48fec4={};var _0x711668;var _0x4242fa;return db[_0x7b69('0x28')]['findOne']({'where':{'id':_0x1470bf['params']['id']}})[_0x7b69('0x23')](handleEntityNotFound(_0x9856d8,null))['then'](function(_0x4bcefd){if(_0x4bcefd){_0x711668=_0x4bcefd;_0x48fec4['model']=_[_0x7b69('0x2f')](db[_0x7b69('0x4b')][_0x7b69('0x29')]);_0x48fec4[_0x7b69('0x30')]=_[_0x7b69('0x2f')](_0x1470bf[_0x7b69('0x30')]);_0x48fec4[_0x7b69('0x38')]=_['intersection'](_0x48fec4['model'],_0x48fec4[_0x7b69('0x30')]);_0x543370[_0x7b69('0x32')]=_['intersection'](_0x48fec4[_0x7b69('0x2d')],qs['fields'](_0x1470bf[_0x7b69('0x30')][_0x7b69('0x33')]));_0x543370[_0x7b69('0x32')]=_0x543370['attributes'][_0x7b69('0x45')]?_0x543370['attributes']:_0x48fec4[_0x7b69('0x2d')];_0x543370[_0x7b69('0x4c')]=qs[_0x7b69('0x36')](_0x1470bf[_0x7b69('0x30')][_0x7b69('0x36')]);_0x543370[_0x7b69('0x37')]=qs[_0x7b69('0x38')](_[_0x7b69('0x39')](_0x1470bf[_0x7b69('0x30')],_0x48fec4[_0x7b69('0x38')]));if(_0x1470bf[_0x7b69('0x30')][_0x7b69('0x3a')]){_0x543370[_0x7b69('0x37')]=_[_0x7b69('0x3b')](_0x543370[_0x7b69('0x37')],{'$or':_[_0x7b69('0x2e')](_0x543370[_0x7b69('0x32')],function(_0x4b7053){var _0x2f4c2c={};_0x2f4c2c[_0x4b7053]={'$like':'%'+_0x1470bf[_0x7b69('0x30')][_0x7b69('0x3a')]+'%'};return _0x2f4c2c;})});}_0x543370=_[_0x7b69('0x3b')]({},_0x543370,_0x1470bf['options']);return _0x711668[_0x7b69('0x4a')](_0x543370);}})[_0x7b69('0x23')](function(_0x1265c3){if(_0x1265c3){_0x4242fa=_0x1265c3['length'];if(!_0x1470bf[_0x7b69('0x30')][_0x7b69('0x34')](_0x7b69('0x35'))){_0x543370[_0x7b69('0x1d')]=qs[_0x7b69('0x1d')](_0x1470bf['query']['limit']);_0x543370[_0x7b69('0x1b')]=qs[_0x7b69('0x1b')](_0x1470bf['query'][_0x7b69('0x1b')]);}return _0x711668['getConfigurations'](_0x543370);}})[_0x7b69('0x23')](function(_0x402a6b){if(_0x402a6b){return _0x402a6b?{'count':_0x4242fa,'rows':_0x402a6b}:null;}})[_0x7b69('0x23')](respondWithResult(_0x9856d8,null))[_0x7b69('0x42')](handleError(_0x9856d8,null));};exports[_0x7b69('0x4d')]=function(_0x1b1677,_0x34d462,_0x16bc55){if(_0x1b1677[_0x7b69('0x47')]['id']){delete _0x1b1677[_0x7b69('0x47')]['id'];}return db[_0x7b69('0x28')][_0x7b69('0x4e')]({'where':{'id':_0x1b1677['params']['id']}})[_0x7b69('0x23')](handleEntityNotFound(_0x34d462,null))[_0x7b69('0x23')](function(_0x5e8a63){if(_0x5e8a63){_0x1b1677[_0x7b69('0x47')][_0x7b69('0x4f')]=_0x5e8a63['id'];_0x1b1677['body']['Subjects']=integrations['getSubjects'](_0x1b1677[_0x7b69('0x47')][_0x7b69('0x50')],_0x1b1677['body']['type']);_0x1b1677[_0x7b69('0x47')][_0x7b69('0x51')]=integrations['getDescriptions'](_0x1b1677[_0x7b69('0x47')][_0x7b69('0x50')],_0x1b1677['body'][_0x7b69('0x2b')]);return db['SalesforceConfiguration'][_0x7b69('0x46')](_0x1b1677['body'],{'include':[{'model':db[_0x7b69('0x52')],'as':_0x7b69('0x53')},{'model':db[_0x7b69('0x52')],'as':_0x7b69('0x51')}]});}return null;})['then'](respondWithResult(_0x34d462,null))['catch'](handleError(_0x34d462,null));};exports[_0x7b69('0x54')]=function(_0x2445e8,_0x49a5fe,_0x3a0501){var _0x57c20d;var _0x165e94='';var _0x151c75=_0x7b69('0x55');return db[_0x7b69('0x28')][_0x7b69('0x4e')]({'where':{'id':_0x2445e8[_0x7b69('0x44')]['id']},'attributes':['id','remoteUri','clientId',_0x7b69('0x56'),'username','password',_0x7b69('0x57')]})['then'](handleEntityNotFound(_0x49a5fe,null))['then'](function(_0x161f8d){if(_0x161f8d){_0x165e94=_0x161f8d[_0x7b69('0x58')];var _0x5acbea=_0x165e94['slice'](-0x1);if(_0x5acbea==='/'){_0x165e94=_0x165e94['substring'](0x0,_0x165e94[_0x7b69('0x59')](_0x5acbea));}_0x57c20d=new jsforce[(_0x7b69('0x5a'))]({'oauth2':{'loginUrl':_0x165e94,'clientId':_0x161f8d[_0x7b69('0x5b')],'clientSecret':_0x161f8d['clientSecret']}});return _0x57c20d['login'](_0x161f8d[_0x7b69('0x5c')],_0x161f8d['password'][_0x7b69('0x5d')](_0x161f8d[_0x7b69('0x57')]));}})[_0x7b69('0x23')](function(_0x6d62a){if(_0x6d62a){if(!_[_0x7b69('0x5e')](_0x2445e8['query'][_0x7b69('0x5f')])){_0x151c75=_0x2445e8[_0x7b69('0x30')][_0x7b69('0x5f')];}return _0x57c20d[_0x7b69('0x60')](_0x151c75)[_0x7b69('0x61')]();}})['then'](function(_0x2cd139){var _0x325322=[_0x7b69('0x62'),_0x7b69('0x63'),_0x7b69('0x64'),_0x7b69('0x65'),_0x7b69('0x66'),_0x7b69('0x67')];var _0x48851f=['string',_0x7b69('0x68'),'picklist',_0x7b69('0x69'),'email',_0x7b69('0x6a'),'phone'];if(_0x2cd139){_[_0x7b69('0x6b')](_0x2cd139['fields'],function(_0x4905ce){return _0x325322['includes'](_0x4905ce[_0x7b69('0x27')])||!_0x48851f[_0x7b69('0x6c')](_0x4905ce[_0x7b69('0x2b')]);});return{'count':_0x2cd139[_0x7b69('0x33')][_0x7b69('0x45')],'rows':_[_0x7b69('0x2e')](_0x2cd139[_0x7b69('0x33')],function(_0x552693){return{'id':_0x552693['name'],'name':_0x552693[_0x7b69('0x6d')],'custom':_0x552693[_0x7b69('0x6e')],'options':_0x552693['picklistValues'][_0x7b69('0x45')]>0x0?_['map'](_0x552693[_0x7b69('0x6f')],function(_0x1f0cdc){return{'name':_0x1f0cdc[_0x7b69('0x6d')],'value':_0x1f0cdc[_0x7b69('0x70')]};}):_0x552693[_0x7b69('0x2b')]==_0x7b69('0x69')?[{'name':'True','value':_0x7b69('0x71')},{'name':_0x7b69('0x72'),'value':'false'}]:[]};})};}})[_0x7b69('0x23')](respondWithResult(_0x49a5fe,null))['catch'](function(_0x127e6c){var _0x1f09aa=_0x2445e8[_0x7b69('0x30')]['test']?0x1f4:_0x127e6c[_0x7b69('0x73')]||0x1f4;logger['error'](_0x7b69('0x74'),_0x7b69('0x54'),_0x1f09aa,JSON['stringify'](_0x127e6c));delete _0x127e6c[_0x7b69('0x27')];if(_0x1f09aa===0x191){_0x1f09aa=0x190;}_0x49a5fe['status'](_0x1f09aa)[_0x7b69('0x75')](_0x2445e8[_0x7b69('0x30')][_0x7b69('0x76')]?{'message':_0x7b69('0x77'),'statusCode':_0x127e6c['statusCode']}:_0x127e6c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b96046b..403920e 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 _0x4c18=['SalesforceAccount','int_salesforce_accounts','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x5df4d7,_0x1b05bf){var _0x5672c3=function(_0x49f8e1){while(--_0x49f8e1){_0x5df4d7['push'](_0x5df4d7['shift']());}};_0x5672c3(++_0x1b05bf);}(_0x4c18,0x18e));var _0x84c1=function(_0x4293a8,_0x385fc5){_0x4293a8=_0x4293a8-0x0;var _0x2ad40e=_0x4c18[_0x4293a8];return _0x2ad40e;};'use strict';var _=require(_0x84c1('0x0'));var util=require(_0x84c1('0x1'));var logger=require('../../config/logger')(_0x84c1('0x2'));var moment=require('moment');var BPromise=require(_0x84c1('0x3'));var rp=require(_0x84c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84c1('0x5'));var config=require(_0x84c1('0x6'));var attributes=require(_0x84c1('0x7'));var integrations=require(_0x84c1('0x8'));module['exports']=function(_0x597cdb,_0x1b174e){return _0x597cdb['define'](_0x84c1('0x9'),attributes,{'tableName':_0x84c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a5e=['rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x2a5e,0xf6));var _0xe2a5=function(_0x52a427,_0x367a76){_0x52a427=_0x52a427-0x0;var _0x3c0321=_0x2a5e[_0x52a427];return _0x3c0321;};'use strict';var _=require(_0xe2a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe2a5('0x1'));var moment=require(_0xe2a5('0x2'));var BPromise=require(_0xe2a5('0x3'));var rp=require(_0xe2a5('0x4'));var fs=require('fs');var path=require(_0xe2a5('0x5'));var rimraf=require(_0xe2a5('0x6'));var config=require(_0xe2a5('0x7'));var attributes=require(_0xe2a5('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xe2a5('0x9')]=function(_0x5a8487,_0x1d176e){return _0x5a8487['define'](_0xe2a5('0xa'),attributes,{'tableName':_0xe2a5('0xb'),'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 e2b508a..925ef72 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 _0xc26e=['rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','find','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x218b73,_0x224d06){var _0xb3f8dc=function(_0x543721){while(--_0x543721){_0x218b73['push'](_0x218b73['shift']());}};_0xb3f8dc(++_0x224d06);}(_0xc26e,0x103));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec26('0x0'));var BPromise=require('bluebird');var rs=require(_0xec26('0x1'));var fs=require('fs');var Redis=require(_0xec26('0x2'));var db=require(_0xec26('0x3'))['db'];var utils=require(_0xec26('0x4'));var logger=require('../../config/logger')(_0xec26('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec26('0x6')][_0xec26('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x380276,_0x5b97b4,_0x5733a6){return new BPromise(function(_0x29846c,_0x40e0f6){return client[_0xec26('0x8')](_0x380276,_0x5733a6)[_0xec26('0x9')](function(_0x254cc6){logger[_0xec26('0xa')](_0xec26('0xb'),_0x5b97b4,_0xec26('0xc'));logger[_0xec26('0xd')](_0xec26('0xe'),_0x5b97b4,'request\x20sent',JSON['stringify'](_0x254cc6));if(_0x254cc6[_0xec26('0xf')]){if(_0x254cc6['error'][_0xec26('0x10')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5b97b4,_0x254cc6['error'][_0xec26('0x11')]);return _0x40e0f6(_0x254cc6[_0xec26('0xf')][_0xec26('0x11')]);}logger[_0xec26('0xf')](_0xec26('0xb'),_0x5b97b4,_0x254cc6[_0xec26('0xf')][_0xec26('0x11')]);return _0x29846c(_0x254cc6['error'][_0xec26('0x11')]);}else{logger['info'](_0xec26('0xb'),_0x5b97b4,_0xec26('0xc'));_0x29846c(_0x254cc6[_0xec26('0x12')][_0xec26('0x11')]);}})[_0xec26('0x13')](function(_0x4b1c89){logger[_0xec26('0xf')](_0xec26('0xb'),_0x5b97b4,_0x4b1c89);_0x40e0f6(_0x4b1c89);});});}exports['GetSalesforceAccount']=function(_0x1c5fcc){var _0x2be1b2=this;return new Promise(function(_0x330d56,_0x1e7b64){return db[_0xec26('0x14')][_0xec26('0x15')]({'raw':_0x1c5fcc[_0xec26('0x16')]?_0x1c5fcc['options'][_0xec26('0x17')]===undefined?!![]:![]:!![],'where':_0x1c5fcc[_0xec26('0x16')]?_0x1c5fcc[_0xec26('0x16')][_0xec26('0x18')]||null:null,'attributes':_0x1c5fcc['options']?_0x1c5fcc[_0xec26('0x16')][_0xec26('0x19')]||null:null,'limit':_0x1c5fcc['options']?_0x1c5fcc[_0xec26('0x16')]['limit']||null:null,'include':_0x1c5fcc[_0xec26('0x16')]?_0x1c5fcc[_0xec26('0x16')][_0xec26('0x1a')]?_[_0xec26('0x1b')](_0x1c5fcc[_0xec26('0x16')]['include'],function(_0x4f88dc){return{'model':db[_0x4f88dc[_0xec26('0x1c')]],'as':_0x4f88dc['as'],'attributes':_0x4f88dc[_0xec26('0x19')],'include':_0x4f88dc[_0xec26('0x1a')]?_[_0xec26('0x1b')](_0x4f88dc[_0xec26('0x1a')],function(_0x41eedc){return{'model':db[_0x41eedc['model']],'as':_0x41eedc['as'],'attributes':_0x41eedc['attributes'],'include':_0x41eedc[_0xec26('0x1a')]?_[_0xec26('0x1b')](_0x41eedc[_0xec26('0x1a')],function(_0x5dd9bd){return{'model':db[_0x5dd9bd[_0xec26('0x1c')]],'as':_0x5dd9bd['as'],'attributes':_0x5dd9bd[_0xec26('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4711bb){logger[_0xec26('0xa')](_0xec26('0x1d'),_0x1c5fcc);logger[_0xec26('0xd')]('GetSalesforceAccount',_0x1c5fcc,JSON['stringify'](_0x4711bb));_0x330d56(_0x4711bb);})['catch'](function(_0x5c18a2){logger[_0xec26('0xf')](_0xec26('0x1d'),_0x5c18a2[_0xec26('0x11')],_0x1c5fcc);_0x1e7b64(_0x2be1b2[_0xec26('0xf')](0x1f4,_0x5c18a2[_0xec26('0x11')]));});});};exports[_0xec26('0x1e')]=function(_0x505fa9){var _0x37a614=this;return new Promise(function(_0x905884,_0xe599c9){return db['SalesforceAccount'][_0xec26('0x1f')]({'raw':_0x505fa9['options']?_0x505fa9[_0xec26('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x505fa9[_0xec26('0x16')]?_0x505fa9[_0xec26('0x16')]['where']||null:null,'attributes':_0x505fa9[_0xec26('0x16')]?_0x505fa9[_0xec26('0x16')][_0xec26('0x19')]||null:null,'include':_0x505fa9['options']?_0x505fa9[_0xec26('0x16')][_0xec26('0x1a')]?_[_0xec26('0x1b')](_0x505fa9['options'][_0xec26('0x1a')],function(_0xd2268e){return{'model':db[_0xd2268e[_0xec26('0x1c')]],'as':_0xd2268e['as'],'attributes':_0xd2268e[_0xec26('0x19')],'include':_0xd2268e[_0xec26('0x1a')]?_[_0xec26('0x1b')](_0xd2268e['include'],function(_0x4f8cac){return{'model':db[_0x4f8cac['model']],'as':_0x4f8cac['as'],'attributes':_0x4f8cac[_0xec26('0x19')],'include':_0x4f8cac[_0xec26('0x1a')]?_[_0xec26('0x1b')](_0x4f8cac[_0xec26('0x1a')],function(_0x16f8ea){return{'model':db[_0x16f8ea['model']],'as':_0x16f8ea['as'],'attributes':_0x16f8ea[_0xec26('0x19')]};}):[]};}):[]};}):[]:[]})[_0xec26('0x9')](function(_0x553edd){logger[_0xec26('0xa')]('ShowSalesforceAccount',_0x505fa9);logger[_0xec26('0xd')](_0xec26('0x1e'),_0x505fa9,JSON[_0xec26('0x20')](_0x553edd));_0x905884(_0x553edd);})[_0xec26('0x13')](function(_0x38cf48){logger['error'](_0xec26('0x1e'),_0x38cf48[_0xec26('0x11')],_0x505fa9);_0xe599c9(_0x37a614[_0xec26('0xf')](0x1f4,_0x38cf48[_0xec26('0x11')]));});});}; \ No newline at end of file +var _0xaf5a=['map','model','attributes','ShowSalesforceAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','limit','include'];(function(_0x432253,_0x572e3a){var _0x5ec4d6=function(_0x44e388){while(--_0x44e388){_0x432253['push'](_0x432253['shift']());}};_0x5ec4d6(++_0x572e3a);}(_0xaf5a,0x71));var _0xaaf5=function(_0x1d5cfa,_0x57efb0){_0x1d5cfa=_0x1d5cfa-0x0;var _0x19a273=_0xaf5a[_0x1d5cfa];return _0x19a273;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require(_0xaaf5('0x1'));var BPromise=require('bluebird');var rs=require(_0xaaf5('0x2'));var fs=require('fs');var Redis=require(_0xaaf5('0x3'));var db=require(_0xaaf5('0x4'))['db'];var utils=require(_0xaaf5('0x5'));var logger=require('../../config/logger')(_0xaaf5('0x6'));var config=require('../../config/environment');var jayson=require(_0xaaf5('0x7'));var client=jayson[_0xaaf5('0x8')][_0xaaf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37d9e3,_0x5820ef,_0x4bf0c8){return new BPromise(function(_0x46123f,_0x4c08db){return client[_0xaaf5('0xa')](_0x37d9e3,_0x4bf0c8)[_0xaaf5('0xb')](function(_0x2c82f7){logger[_0xaaf5('0xc')](_0xaaf5('0xd'),_0x5820ef,'request\x20sent');logger[_0xaaf5('0xe')](_0xaaf5('0xf'),_0x5820ef,'request\x20sent',JSON[_0xaaf5('0x10')](_0x2c82f7));if(_0x2c82f7[_0xaaf5('0x11')]){if(_0x2c82f7['error'][_0xaaf5('0x12')]===0x1f4){logger[_0xaaf5('0x11')](_0xaaf5('0xd'),_0x5820ef,_0x2c82f7[_0xaaf5('0x11')][_0xaaf5('0x13')]);return _0x4c08db(_0x2c82f7[_0xaaf5('0x11')][_0xaaf5('0x13')]);}logger[_0xaaf5('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x5820ef,_0x2c82f7['error'][_0xaaf5('0x13')]);return _0x46123f(_0x2c82f7[_0xaaf5('0x11')][_0xaaf5('0x13')]);}else{logger[_0xaaf5('0xc')](_0xaaf5('0xd'),_0x5820ef,_0xaaf5('0x14'));_0x46123f(_0x2c82f7[_0xaaf5('0x15')][_0xaaf5('0x13')]);}})[_0xaaf5('0x16')](function(_0x2abe2c){logger[_0xaaf5('0x11')](_0xaaf5('0xd'),_0x5820ef,_0x2abe2c);_0x4c08db(_0x2abe2c);});});}exports[_0xaaf5('0x17')]=function(_0x544305){var _0x4170a3=this;return new Promise(function(_0x20136c,_0x2b2b39){return db[_0xaaf5('0x18')][_0xaaf5('0x19')]({'raw':_0x544305['options']?_0x544305['options'][_0xaaf5('0x1a')]===undefined?!![]:![]:!![],'where':_0x544305[_0xaaf5('0x1b')]?_0x544305['options'][_0xaaf5('0x1c')]||null:null,'attributes':_0x544305['options']?_0x544305['options']['attributes']||null:null,'limit':_0x544305['options']?_0x544305[_0xaaf5('0x1b')][_0xaaf5('0x1d')]||null:null,'include':_0x544305[_0xaaf5('0x1b')]?_0x544305[_0xaaf5('0x1b')][_0xaaf5('0x1e')]?_[_0xaaf5('0x1f')](_0x544305[_0xaaf5('0x1b')][_0xaaf5('0x1e')],function(_0x2a7720){return{'model':db[_0x2a7720[_0xaaf5('0x20')]],'as':_0x2a7720['as'],'attributes':_0x2a7720[_0xaaf5('0x21')],'include':_0x2a7720[_0xaaf5('0x1e')]?_[_0xaaf5('0x1f')](_0x2a7720['include'],function(_0x20ebbb){return{'model':db[_0x20ebbb[_0xaaf5('0x20')]],'as':_0x20ebbb['as'],'attributes':_0x20ebbb['attributes'],'include':_0x20ebbb[_0xaaf5('0x1e')]?_[_0xaaf5('0x1f')](_0x20ebbb['include'],function(_0x20b7b5){return{'model':db[_0x20b7b5[_0xaaf5('0x20')]],'as':_0x20b7b5['as'],'attributes':_0x20b7b5[_0xaaf5('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x91fe92){logger[_0xaaf5('0xc')](_0xaaf5('0x17'),_0x544305);logger[_0xaaf5('0xe')](_0xaaf5('0x17'),_0x544305,JSON[_0xaaf5('0x10')](_0x91fe92));_0x20136c(_0x91fe92);})[_0xaaf5('0x16')](function(_0x283f2e){logger['error']('GetSalesforceAccount',_0x283f2e[_0xaaf5('0x13')],_0x544305);_0x2b2b39(_0x4170a3[_0xaaf5('0x11')](0x1f4,_0x283f2e[_0xaaf5('0x13')]));});});};exports[_0xaaf5('0x22')]=function(_0x188305){var _0x11a055=this;return new Promise(function(_0xe699b7,_0x54a143){return db[_0xaaf5('0x18')][_0xaaf5('0x23')]({'raw':_0x188305['options']?_0x188305[_0xaaf5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x188305['options']?_0x188305[_0xaaf5('0x1b')][_0xaaf5('0x1c')]||null:null,'attributes':_0x188305[_0xaaf5('0x1b')]?_0x188305[_0xaaf5('0x1b')][_0xaaf5('0x21')]||null:null,'include':_0x188305[_0xaaf5('0x1b')]?_0x188305[_0xaaf5('0x1b')][_0xaaf5('0x1e')]?_['map'](_0x188305[_0xaaf5('0x1b')]['include'],function(_0x14077a){return{'model':db[_0x14077a[_0xaaf5('0x20')]],'as':_0x14077a['as'],'attributes':_0x14077a[_0xaaf5('0x21')],'include':_0x14077a[_0xaaf5('0x1e')]?_[_0xaaf5('0x1f')](_0x14077a[_0xaaf5('0x1e')],function(_0x50e169){return{'model':db[_0x50e169[_0xaaf5('0x20')]],'as':_0x50e169['as'],'attributes':_0x50e169[_0xaaf5('0x21')],'include':_0x50e169['include']?_['map'](_0x50e169[_0xaaf5('0x1e')],function(_0x2a189d){return{'model':db[_0x2a189d[_0xaaf5('0x20')]],'as':_0x2a189d['as'],'attributes':_0x2a189d[_0xaaf5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaaf5('0xb')](function(_0x368836){logger[_0xaaf5('0xc')](_0xaaf5('0x22'),_0x188305);logger['debug'](_0xaaf5('0x22'),_0x188305,JSON[_0xaaf5('0x10')](_0x368836));_0xe699b7(_0x368836);})[_0xaaf5('0x16')](function(_0x3ac014){logger[_0xaaf5('0x11')](_0xaaf5('0x22'),_0x3ac014[_0xaaf5('0x13')],_0x188305);_0x54a143(_0x11a055[_0xaaf5('0x11')](0x1f4,_0x3ac014[_0xaaf5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 3e1f55c..ed0b0da 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x2515e8,_0xb4c2c){var _0x4ada9a=function(_0x3852b1){while(--_0x3852b1){_0x2515e8['push'](_0x2515e8['shift']());}};_0x4ada9a(++_0xb4c2c);}(_0x2ef3,0xba));var _0x32ef=function(_0x454d23,_0x22695a){_0x454d23=_0x454d23-0x0;var _0x5f094e=_0x2ef3[_0x454d23];return _0x5f094e;};'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['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x349d07,_0x44c06e){var _0x2bd241=function(_0x1fd335){while(--_0x1fd335){_0x349d07['push'](_0x349d07['shift']());}};_0x2bd241(++_0x44c06e);}(_0x2ef3,0xba));var _0x32ef=function(_0x390705,_0x30bb54){_0x390705=_0x390705-0x0;var _0x2dcb6c=_0x2ef3[_0x390705];return _0x2dcb6c;};'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['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4fb3816..cf47764 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 _0xcde4=['nothing','account','sequelize','exports','STRING','Case','Task','contact','lead','account_contact_lead','contact_lead','ENUM'];(function(_0x31ec99,_0x23a6d0){var _0x586649=function(_0x4205be){while(--_0x4205be){_0x31ec99['push'](_0x31ec99['shift']());}};_0x586649(++_0x23a6d0);}(_0xcde4,0x13a));var _0x4cde=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0xcde4[_0x289891];return _0x31cf2e;};'use strict';var Sequelize=require(_0x4cde('0x0'));module[_0x4cde('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4cde('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x4cde('0x3')),'defaultValue':_0x4cde('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x4cde('0x5'),_0x4cde('0x6'),_0x4cde('0x7'),'account'),'defaultValue':_0x4cde('0x8')},'moduleCreate':{'type':Sequelize[_0x4cde('0x9')](_0x4cde('0xa'),_0x4cde('0x5'),_0x4cde('0x6'),_0x4cde('0xb')),'defaultValue':_0x4cde('0x6')},'leadId':{'type':Sequelize[_0x4cde('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x4cde('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x4cde('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x4cde('0x2')]}}; \ No newline at end of file +var _0x4443=['lead','account_contact_lead','account','sequelize','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x4443,0x71));var _0x3444=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4443[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3444('0x0'));module['exports']={'name':{'type':Sequelize[_0x3444('0x1')]},'description':{'type':Sequelize[_0x3444('0x1')]},'ticketType':{'type':Sequelize[_0x3444('0x2')](_0x3444('0x3'),_0x3444('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x3444('0x2')](_0x3444('0x5'),_0x3444('0x6'),_0x3444('0x7'),_0x3444('0x8'),_0x3444('0x9')),'defaultValue':_0x3444('0x5')},'moduleCreate':{'type':Sequelize[_0x3444('0x2')]('nothing',_0x3444('0x6'),_0x3444('0x7'),_0x3444('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x3444('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x3444('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x3444('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x3444('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 294f519..41e9544 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 _0xf768=['create','body','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','params','keys','include','find'];(function(_0x12ef9a,_0x5dfbf7){var _0x3a6833=function(_0x38e1bd){while(--_0x38e1bd){_0x12ef9a['push'](_0x12ef9a['shift']());}};_0x3a6833(++_0x5dfbf7);}(_0xf768,0x1dc));var _0x8f76=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf768[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x8f76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f76('0x1'));var jsonpatch=require(_0x8f76('0x2'));var rp=require('request-promise');var moment=require(_0x8f76('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8f76('0x4'));var util=require('util');var path=require(_0x8f76('0x5'));var sox=require(_0x8f76('0x6'));var csv=require(_0x8f76('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f76('0x8'));var _=require(_0x8f76('0x9'));var squel=require(_0x8f76('0xa'));var crypto=require(_0x8f76('0xb'));var jsforce=require(_0x8f76('0xc'));var deskjs=require(_0x8f76('0xd'));var toCsv=require(_0x8f76('0x7'));var querystring=require(_0x8f76('0xe'));var Papa=require(_0x8f76('0xf'));var Redis=require(_0x8f76('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8f76('0x11'));var as=require(_0x8f76('0x12'));var hardwareService=require(_0x8f76('0x13'));var logger=require(_0x8f76('0x14'))('api');var utils=require(_0x8f76('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8f76('0x16'));var db=require(_0x8f76('0x17'))['db'];function respondWithStatusCode(_0x4cc5d0,_0x1fcb32){_0x1fcb32=_0x1fcb32||0xcc;return function(_0x3080d6){if(_0x3080d6){return _0x4cc5d0[_0x8f76('0x18')](_0x1fcb32);}return _0x4cc5d0[_0x8f76('0x19')](_0x1fcb32)[_0x8f76('0x1a')]();};}function respondWithResult(_0x32c84a,_0x21032d){_0x21032d=_0x21032d||0xc8;return function(_0x4b1756){if(_0x4b1756){return _0x32c84a[_0x8f76('0x19')](_0x21032d)[_0x8f76('0x1b')](_0x4b1756);}};}function respondWithFilteredResult(_0x40d399,_0x5538d6){return function(_0x30e0b2){if(_0x30e0b2){var _0x48f7a1=typeof _0x5538d6[_0x8f76('0x1c')]==='undefined'&&typeof _0x5538d6[_0x8f76('0x1d')]===_0x8f76('0x1e');var _0x1e0069=_0x30e0b2[_0x8f76('0x1f')];var _0x303d66=_0x48f7a1?0x0:_0x5538d6[_0x8f76('0x1c')];var _0x3300d0=_0x48f7a1?_0x30e0b2[_0x8f76('0x1f')]:_0x5538d6[_0x8f76('0x1c')]+_0x5538d6['limit'];var _0xcc48c9;if(_0x3300d0>=_0x1e0069){_0x3300d0=_0x1e0069;_0xcc48c9=0xc8;}else{_0xcc48c9=0xce;}_0x40d399['status'](_0xcc48c9);return _0x40d399['set']('Content-Range',_0x303d66+'-'+_0x3300d0+'/'+_0x1e0069)[_0x8f76('0x1b')](_0x30e0b2);}return null;};}function patchUpdates(_0xf6a8e1){return function(_0x18ba30){try{jsonpatch[_0x8f76('0x20')](_0x18ba30,_0xf6a8e1,!![]);}catch(_0x5d4e0a){return BPromise['reject'](_0x5d4e0a);}return _0x18ba30[_0x8f76('0x21')]();};}function saveUpdates(_0x197790,_0x3e7006){return function(_0x433018){if(_0x433018){return _0x433018[_0x8f76('0x22')](_0x197790)[_0x8f76('0x23')](function(_0x427e9d){return _0x427e9d;});}return null;};}function removeEntity(_0x3ce90a,_0x1b0213){return function(_0x12d856){if(_0x12d856){return _0x12d856[_0x8f76('0x24')]()['then'](function(){_0x3ce90a[_0x8f76('0x19')](0xcc)[_0x8f76('0x1a')]();});}};}function handleEntityNotFound(_0x5e4859,_0x4d6633){return function(_0x3181ad){if(!_0x3181ad){_0x5e4859['sendStatus'](0x194);}return _0x3181ad;};}function handleError(_0x4f0177,_0x90fa55){_0x90fa55=_0x90fa55||0x1f4;return function(_0x50c24f){logger[_0x8f76('0x25')](_0x50c24f[_0x8f76('0x26')]);if(_0x50c24f[_0x8f76('0x27')]){delete _0x50c24f[_0x8f76('0x27')];}_0x4f0177['status'](_0x90fa55)[_0x8f76('0x28')](_0x50c24f);};}exports[_0x8f76('0x29')]=function(_0xc522cf,_0x25d0f9){var _0x59a623={},_0x442410={},_0x5aeffc={'count':0x0,'rows':[]};var _0x4d165f=_['map'](db[_0x8f76('0x2a')][_0x8f76('0x2b')],function(_0x44f83c){return{'name':_0x44f83c[_0x8f76('0x2c')],'type':_0x44f83c[_0x8f76('0x2d')]['key']};});_0x442410[_0x8f76('0x2e')]=_[_0x8f76('0x2f')](_0x4d165f,_0x8f76('0x27'));_0x442410[_0x8f76('0x30')]=_['keys'](_0xc522cf['query']);_0x442410['filters']=_[_0x8f76('0x31')](_0x442410[_0x8f76('0x2e')],_0x442410[_0x8f76('0x30')]);_0x59a623[_0x8f76('0x32')]=_[_0x8f76('0x31')](_0x442410['model'],qs['fields'](_0xc522cf['query'][_0x8f76('0x33')]));_0x59a623[_0x8f76('0x32')]=_0x59a623[_0x8f76('0x32')][_0x8f76('0x34')]?_0x59a623[_0x8f76('0x32')]:_0x442410['model'];if(!_0xc522cf[_0x8f76('0x30')][_0x8f76('0x35')](_0x8f76('0x36'))){_0x59a623[_0x8f76('0x1d')]=qs[_0x8f76('0x1d')](_0xc522cf[_0x8f76('0x30')][_0x8f76('0x1d')]);_0x59a623[_0x8f76('0x1c')]=qs[_0x8f76('0x1c')](_0xc522cf[_0x8f76('0x30')][_0x8f76('0x1c')]);}_0x59a623['order']=qs[_0x8f76('0x37')](_0xc522cf[_0x8f76('0x30')][_0x8f76('0x37')]);_0x59a623[_0x8f76('0x38')]=qs[_0x8f76('0x39')](_[_0x8f76('0x3a')](_0xc522cf[_0x8f76('0x30')],_0x442410['filters']),_0x4d165f);if(_0xc522cf[_0x8f76('0x30')]['filter']){_0x59a623[_0x8f76('0x38')]=_['merge'](_0x59a623[_0x8f76('0x38')],{'$or':_[_0x8f76('0x2f')](_0x4d165f,function(_0x45ea57){if(_0x45ea57[_0x8f76('0x2d')]!==_0x8f76('0x3b')){var _0x301ef8={};_0x301ef8[_0x45ea57['name']]={'$like':'%'+_0xc522cf[_0x8f76('0x30')][_0x8f76('0x3c')]+'%'};return _0x301ef8;}})});}_0x59a623=_[_0x8f76('0x3d')]({},_0x59a623,_0xc522cf[_0x8f76('0x3e')]);var _0x168671={'where':_0x59a623[_0x8f76('0x38')]};return db['SalesforceConfiguration']['count'](_0x168671)[_0x8f76('0x23')](function(_0x3d5e78){_0x5aeffc['count']=_0x3d5e78;if(_0xc522cf[_0x8f76('0x30')][_0x8f76('0x3f')]){_0x59a623['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x8f76('0x40')](_0x59a623);})[_0x8f76('0x23')](function(_0x59f8bf){_0x5aeffc['rows']=_0x59f8bf;return _0x5aeffc;})[_0x8f76('0x23')](respondWithFilteredResult(_0x25d0f9,_0x59a623))[_0x8f76('0x41')](handleError(_0x25d0f9,null));};exports['show']=function(_0x2cf1f2,_0xa325fc){var _0x2b9267={'raw':![],'where':{'id':_0x2cf1f2[_0x8f76('0x42')]['id']}},_0x9c8be3={};_0x9c8be3['model']=_[_0x8f76('0x43')](db[_0x8f76('0x2a')][_0x8f76('0x2b')]);_0x9c8be3['query']=_['keys'](_0x2cf1f2[_0x8f76('0x30')]);_0x9c8be3[_0x8f76('0x39')]=_[_0x8f76('0x31')](_0x9c8be3[_0x8f76('0x2e')],_0x9c8be3[_0x8f76('0x30')]);_0x2b9267[_0x8f76('0x32')]=_['intersection'](_0x9c8be3[_0x8f76('0x2e')],qs[_0x8f76('0x33')](_0x2cf1f2[_0x8f76('0x30')][_0x8f76('0x33')]));_0x2b9267[_0x8f76('0x32')]=_0x2b9267['attributes'][_0x8f76('0x34')]?_0x2b9267[_0x8f76('0x32')]:_0x9c8be3['model'];if(_0x2cf1f2[_0x8f76('0x30')]['includeAll']){_0x2b9267[_0x8f76('0x44')]=[{'all':!![]}];}_0x2b9267=_[_0x8f76('0x3d')]({},_0x2b9267,_0x2cf1f2[_0x8f76('0x3e')]);return db[_0x8f76('0x2a')][_0x8f76('0x45')](_0x2b9267)[_0x8f76('0x23')](handleEntityNotFound(_0xa325fc,null))[_0x8f76('0x23')](respondWithResult(_0xa325fc,null))['catch'](handleError(_0xa325fc,null));};exports[_0x8f76('0x46')]=function(_0x4481fa,_0x5e5a98){return db[_0x8f76('0x2a')][_0x8f76('0x46')](_0x4481fa[_0x8f76('0x47')],{})[_0x8f76('0x23')](respondWithResult(_0x5e5a98,0xc9))[_0x8f76('0x41')](handleError(_0x5e5a98,null));};exports[_0x8f76('0x22')]=function(_0x3ba9fd,_0x82bc51){if(_0x3ba9fd['body']['id']){delete _0x3ba9fd[_0x8f76('0x47')]['id'];}return db[_0x8f76('0x2a')][_0x8f76('0x45')]({'where':{'id':_0x3ba9fd[_0x8f76('0x42')]['id']}})[_0x8f76('0x23')](handleEntityNotFound(_0x82bc51,null))[_0x8f76('0x23')](saveUpdates(_0x3ba9fd['body'],null))['then'](respondWithResult(_0x82bc51,null))[_0x8f76('0x41')](handleError(_0x82bc51,null));};exports[_0x8f76('0x24')]=function(_0x4abe,_0x151652){return db[_0x8f76('0x2a')]['find']({'where':{'id':_0x4abe[_0x8f76('0x42')]['id']}})[_0x8f76('0x23')](handleEntityNotFound(_0x151652,null))['then'](removeEntity(_0x151652,null))['catch'](handleError(_0x151652,null));};exports[_0x8f76('0x48')]=function(_0x11c5fe,_0x1501db,_0x19101a){var _0xbdbc8f={};var _0x372c99={};var _0x225efd;var _0x42bfab;return db['SalesforceConfiguration'][_0x8f76('0x49')]({'where':{'id':_0x11c5fe[_0x8f76('0x42')]['id']}})['then'](handleEntityNotFound(_0x1501db,null))[_0x8f76('0x23')](function(_0x45afd8){if(_0x45afd8){_0x225efd=_0x45afd8;_0x372c99[_0x8f76('0x2e')]=_[_0x8f76('0x43')](db[_0x8f76('0x4a')]['rawAttributes']);_0x372c99[_0x8f76('0x30')]=_[_0x8f76('0x43')](_0x11c5fe[_0x8f76('0x30')]);_0x372c99[_0x8f76('0x39')]=_['intersection'](_0x372c99[_0x8f76('0x2e')],_0x372c99[_0x8f76('0x30')]);_0xbdbc8f[_0x8f76('0x32')]=_[_0x8f76('0x31')](_0x372c99['model'],qs[_0x8f76('0x33')](_0x11c5fe[_0x8f76('0x30')][_0x8f76('0x33')]));_0xbdbc8f['attributes']=_0xbdbc8f[_0x8f76('0x32')][_0x8f76('0x34')]?_0xbdbc8f[_0x8f76('0x32')]:_0x372c99['model'];_0xbdbc8f[_0x8f76('0x4b')]=qs[_0x8f76('0x37')](_0x11c5fe[_0x8f76('0x30')]['sort']);_0xbdbc8f['where']=qs['filters'](_[_0x8f76('0x3a')](_0x11c5fe['query'],_0x372c99[_0x8f76('0x39')]));if(_0x11c5fe['query'][_0x8f76('0x3c')]){_0xbdbc8f['where']=_['merge'](_0xbdbc8f[_0x8f76('0x38')],{'$or':_['map'](_0xbdbc8f[_0x8f76('0x32')],function(_0x3fe315){var _0x23a814={};_0x23a814[_0x3fe315]={'$like':'%'+_0x11c5fe[_0x8f76('0x30')][_0x8f76('0x3c')]+'%'};return _0x23a814;})});}_0xbdbc8f=_[_0x8f76('0x3d')]({},_0xbdbc8f,_0x11c5fe[_0x8f76('0x3e')]);return _0x225efd[_0x8f76('0x48')](_0xbdbc8f);}})['then'](function(_0x3973e5){if(_0x3973e5){_0x42bfab=_0x3973e5[_0x8f76('0x34')];if(!_0x11c5fe[_0x8f76('0x30')][_0x8f76('0x35')](_0x8f76('0x36'))){_0xbdbc8f[_0x8f76('0x1d')]=qs[_0x8f76('0x1d')](_0x11c5fe[_0x8f76('0x30')][_0x8f76('0x1d')]);_0xbdbc8f[_0x8f76('0x1c')]=qs[_0x8f76('0x1c')](_0x11c5fe[_0x8f76('0x30')][_0x8f76('0x1c')]);}return _0x225efd[_0x8f76('0x48')](_0xbdbc8f);}})['then'](function(_0x212898){if(_0x212898){return _0x212898?{'count':_0x42bfab,'rows':_0x212898}:null;}})['then'](respondWithResult(_0x1501db,null))[_0x8f76('0x41')](handleError(_0x1501db,null));};exports[_0x8f76('0x4c')]=function(_0x22ebac,_0x27ee1d,_0x188f2c){var _0x3676d7={};var _0x465551={};var _0x514ddd;var _0x618e7c;return db[_0x8f76('0x2a')][_0x8f76('0x49')]({'where':{'id':_0x22ebac['params']['id']}})[_0x8f76('0x23')](handleEntityNotFound(_0x27ee1d,null))[_0x8f76('0x23')](function(_0x44f552){if(_0x44f552){_0x514ddd=_0x44f552;_0x465551[_0x8f76('0x2e')]=_[_0x8f76('0x43')](db['SalesforceField']['rawAttributes']);_0x465551[_0x8f76('0x30')]=_[_0x8f76('0x43')](_0x22ebac[_0x8f76('0x30')]);_0x465551[_0x8f76('0x39')]=_[_0x8f76('0x31')](_0x465551[_0x8f76('0x2e')],_0x465551[_0x8f76('0x30')]);_0x3676d7[_0x8f76('0x32')]=_[_0x8f76('0x31')](_0x465551[_0x8f76('0x2e')],qs[_0x8f76('0x33')](_0x22ebac[_0x8f76('0x30')][_0x8f76('0x33')]));_0x3676d7[_0x8f76('0x32')]=_0x3676d7[_0x8f76('0x32')]['length']?_0x3676d7[_0x8f76('0x32')]:_0x465551['model'];_0x3676d7[_0x8f76('0x4b')]=qs[_0x8f76('0x37')](_0x22ebac[_0x8f76('0x30')][_0x8f76('0x37')]);_0x3676d7[_0x8f76('0x38')]=qs[_0x8f76('0x39')](_['pick'](_0x22ebac[_0x8f76('0x30')],_0x465551['filters']));if(_0x22ebac[_0x8f76('0x30')][_0x8f76('0x3c')]){_0x3676d7[_0x8f76('0x38')]=_[_0x8f76('0x3d')](_0x3676d7[_0x8f76('0x38')],{'$or':_['map'](_0x3676d7[_0x8f76('0x32')],function(_0x6ef2c6){var _0x4e10f7={};_0x4e10f7[_0x6ef2c6]={'$like':'%'+_0x22ebac[_0x8f76('0x30')][_0x8f76('0x3c')]+'%'};return _0x4e10f7;})});}_0x3676d7=_[_0x8f76('0x3d')]({},_0x3676d7,_0x22ebac[_0x8f76('0x3e')]);return _0x514ddd[_0x8f76('0x4c')](_0x3676d7);}})['then'](function(_0x55f194){if(_0x55f194){_0x618e7c=_0x55f194[_0x8f76('0x34')];if(!_0x22ebac[_0x8f76('0x30')]['hasOwnProperty']('nolimit')){_0x3676d7[_0x8f76('0x1d')]=qs['limit'](_0x22ebac['query'][_0x8f76('0x1d')]);_0x3676d7['offset']=qs[_0x8f76('0x1c')](_0x22ebac[_0x8f76('0x30')][_0x8f76('0x1c')]);}return _0x514ddd[_0x8f76('0x4c')](_0x3676d7);}})[_0x8f76('0x23')](function(_0x430b18){if(_0x430b18){return _0x430b18?{'count':_0x618e7c,'rows':_0x430b18}:null;}})['then'](respondWithResult(_0x27ee1d,null))[_0x8f76('0x41')](handleError(_0x27ee1d,null));};exports[_0x8f76('0x4d')]=function(_0x235643,_0x3240af,_0x3cb620){var _0x2ba5c4={};var _0x45a7f4={};var _0x6073c6;var _0x9e361e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x235643['params']['id']}})[_0x8f76('0x23')](handleEntityNotFound(_0x3240af,null))[_0x8f76('0x23')](function(_0x2a9897){if(_0x2a9897){_0x6073c6=_0x2a9897;_0x45a7f4[_0x8f76('0x2e')]=_[_0x8f76('0x43')](db[_0x8f76('0x4a')][_0x8f76('0x2b')]);_0x45a7f4['query']=_[_0x8f76('0x43')](_0x235643[_0x8f76('0x30')]);_0x45a7f4[_0x8f76('0x39')]=_['intersection'](_0x45a7f4[_0x8f76('0x2e')],_0x45a7f4['query']);_0x2ba5c4[_0x8f76('0x32')]=_[_0x8f76('0x31')](_0x45a7f4[_0x8f76('0x2e')],qs[_0x8f76('0x33')](_0x235643['query']['fields']));_0x2ba5c4[_0x8f76('0x32')]=_0x2ba5c4[_0x8f76('0x32')][_0x8f76('0x34')]?_0x2ba5c4[_0x8f76('0x32')]:_0x45a7f4[_0x8f76('0x2e')];_0x2ba5c4[_0x8f76('0x4b')]=qs[_0x8f76('0x37')](_0x235643[_0x8f76('0x30')][_0x8f76('0x37')]);_0x2ba5c4['where']=qs[_0x8f76('0x39')](_['pick'](_0x235643[_0x8f76('0x30')],_0x45a7f4[_0x8f76('0x39')]));if(_0x235643[_0x8f76('0x30')][_0x8f76('0x3c')]){_0x2ba5c4[_0x8f76('0x38')]=_['merge'](_0x2ba5c4[_0x8f76('0x38')],{'$or':_[_0x8f76('0x2f')](_0x2ba5c4[_0x8f76('0x32')],function(_0x59c3c2){var _0x570e3e={};_0x570e3e[_0x59c3c2]={'$like':'%'+_0x235643[_0x8f76('0x30')][_0x8f76('0x3c')]+'%'};return _0x570e3e;})});}_0x2ba5c4=_[_0x8f76('0x3d')]({},_0x2ba5c4,_0x235643['options']);return _0x6073c6['getDescriptions'](_0x2ba5c4);}})[_0x8f76('0x23')](function(_0x43991c){if(_0x43991c){_0x9e361e=_0x43991c[_0x8f76('0x34')];if(!_0x235643[_0x8f76('0x30')]['hasOwnProperty'](_0x8f76('0x36'))){_0x2ba5c4[_0x8f76('0x1d')]=qs['limit'](_0x235643['query'][_0x8f76('0x1d')]);_0x2ba5c4[_0x8f76('0x1c')]=qs[_0x8f76('0x1c')](_0x235643[_0x8f76('0x30')][_0x8f76('0x1c')]);}return _0x6073c6[_0x8f76('0x4d')](_0x2ba5c4);}})[_0x8f76('0x23')](function(_0x2b4b2c){if(_0x2b4b2c){return _0x2b4b2c?{'count':_0x9e361e,'rows':_0x2b4b2c}:null;}})[_0x8f76('0x23')](respondWithResult(_0x3240af,null))['catch'](handleError(_0x3240af,null));}; \ No newline at end of file +var _0x8d4c=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','index','map','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','name','filter','merge','options','SalesforceConfiguration','includeAll','include','findAll','catch','show','create','body','find','params','SalesforceField','rawAttributes','order','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x1e2a93,_0x30f669){var _0x4a5b66=function(_0x587700){while(--_0x587700){_0x1e2a93['push'](_0x1e2a93['shift']());}};_0x4a5b66(++_0x30f669);}(_0x8d4c,0x133));var _0xc8d4=function(_0x9d77b5,_0x4fcdb3){_0x9d77b5=_0x9d77b5-0x0;var _0x4b26d0=_0x8d4c[_0x9d77b5];return _0x4b26d0;};'use strict';var emlformat=require(_0xc8d4('0x0'));var rimraf=require(_0xc8d4('0x1'));var zipdir=require(_0xc8d4('0x2'));var jsonpatch=require(_0xc8d4('0x3'));var rp=require('request-promise');var moment=require(_0xc8d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8d4('0x5'));var util=require(_0xc8d4('0x6'));var path=require(_0xc8d4('0x7'));var sox=require(_0xc8d4('0x8'));var csv=require(_0xc8d4('0x9'));var ejs=require(_0xc8d4('0xa'));var fs=require('fs');var fs_extra=require(_0xc8d4('0xb'));var _=require('lodash');var squel=require(_0xc8d4('0xc'));var crypto=require('crypto');var jsforce=require(_0xc8d4('0xd'));var deskjs=require(_0xc8d4('0xe'));var toCsv=require(_0xc8d4('0x9'));var querystring=require(_0xc8d4('0xf'));var Papa=require('papaparse');var Redis=require(_0xc8d4('0x10'));var authService=require(_0xc8d4('0x11'));var qs=require(_0xc8d4('0x12'));var as=require(_0xc8d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8d4('0x14'));var utils=require('../../config/utils');var config=require(_0xc8d4('0x15'));var licenseUtil=require(_0xc8d4('0x16'));var db=require(_0xc8d4('0x17'))['db'];function respondWithStatusCode(_0x46478d,_0x37e6a8){_0x37e6a8=_0x37e6a8||0xcc;return function(_0x2fb343){if(_0x2fb343){return _0x46478d[_0xc8d4('0x18')](_0x37e6a8);}return _0x46478d[_0xc8d4('0x19')](_0x37e6a8)[_0xc8d4('0x1a')]();};}function respondWithResult(_0x2c076d,_0x52795c){_0x52795c=_0x52795c||0xc8;return function(_0x35f447){if(_0x35f447){return _0x2c076d[_0xc8d4('0x19')](_0x52795c)[_0xc8d4('0x1b')](_0x35f447);}};}function respondWithFilteredResult(_0x351f3b,_0x490e14){return function(_0x59ef07){if(_0x59ef07){var _0x3d268b=typeof _0x490e14[_0xc8d4('0x1c')]===_0xc8d4('0x1d')&&typeof _0x490e14[_0xc8d4('0x1e')]===_0xc8d4('0x1d');var _0x34d36d=_0x59ef07[_0xc8d4('0x1f')];var _0x36c684=_0x3d268b?0x0:_0x490e14['offset'];var _0x5e9a70=_0x3d268b?_0x59ef07[_0xc8d4('0x1f')]:_0x490e14['offset']+_0x490e14[_0xc8d4('0x1e')];var _0xe71ac;if(_0x5e9a70>=_0x34d36d){_0x5e9a70=_0x34d36d;_0xe71ac=0xc8;}else{_0xe71ac=0xce;}_0x351f3b[_0xc8d4('0x19')](_0xe71ac);return _0x351f3b[_0xc8d4('0x20')](_0xc8d4('0x21'),_0x36c684+'-'+_0x5e9a70+'/'+_0x34d36d)[_0xc8d4('0x1b')](_0x59ef07);}return null;};}function patchUpdates(_0x563a22){return function(_0x423d68){try{jsonpatch[_0xc8d4('0x22')](_0x423d68,_0x563a22,!![]);}catch(_0x496631){return BPromise[_0xc8d4('0x23')](_0x496631);}return _0x423d68[_0xc8d4('0x24')]();};}function saveUpdates(_0x474cb8,_0x10169f){return function(_0x4e1c48){if(_0x4e1c48){return _0x4e1c48[_0xc8d4('0x25')](_0x474cb8)[_0xc8d4('0x26')](function(_0x41b42e){return _0x41b42e;});}return null;};}function removeEntity(_0x201b63,_0xfa429d){return function(_0x3c8188){if(_0x3c8188){return _0x3c8188[_0xc8d4('0x27')]()['then'](function(){_0x201b63[_0xc8d4('0x19')](0xcc)[_0xc8d4('0x1a')]();});}};}function handleEntityNotFound(_0x141169,_0x1b2955){return function(_0x3b0815){if(!_0x3b0815){_0x141169['sendStatus'](0x194);}return _0x3b0815;};}function handleError(_0x321e00,_0x466534){_0x466534=_0x466534||0x1f4;return function(_0x131069){logger['error'](_0x131069[_0xc8d4('0x28')]);if(_0x131069['name']){delete _0x131069['name'];}_0x321e00[_0xc8d4('0x19')](_0x466534)['send'](_0x131069);};}exports[_0xc8d4('0x29')]=function(_0x540875,_0x164f17){var _0x400823={},_0x939b64={},_0x4ec16b={'count':0x0,'rows':[]};var _0xcca347=_[_0xc8d4('0x2a')](db['SalesforceConfiguration']['rawAttributes'],function(_0x10ac6d){return{'name':_0x10ac6d['fieldName'],'type':_0x10ac6d[_0xc8d4('0x2b')][_0xc8d4('0x2c')]};});_0x939b64[_0xc8d4('0x2d')]=_[_0xc8d4('0x2a')](_0xcca347,'name');_0x939b64['query']=_[_0xc8d4('0x2e')](_0x540875[_0xc8d4('0x2f')]);_0x939b64['filters']=_[_0xc8d4('0x30')](_0x939b64[_0xc8d4('0x2d')],_0x939b64[_0xc8d4('0x2f')]);_0x400823[_0xc8d4('0x31')]=_['intersection'](_0x939b64[_0xc8d4('0x2d')],qs[_0xc8d4('0x32')](_0x540875[_0xc8d4('0x2f')]['fields']));_0x400823[_0xc8d4('0x31')]=_0x400823[_0xc8d4('0x31')][_0xc8d4('0x33')]?_0x400823[_0xc8d4('0x31')]:_0x939b64[_0xc8d4('0x2d')];if(!_0x540875['query'][_0xc8d4('0x34')](_0xc8d4('0x35'))){_0x400823[_0xc8d4('0x1e')]=qs[_0xc8d4('0x1e')](_0x540875[_0xc8d4('0x2f')][_0xc8d4('0x1e')]);_0x400823[_0xc8d4('0x1c')]=qs[_0xc8d4('0x1c')](_0x540875[_0xc8d4('0x2f')][_0xc8d4('0x1c')]);}_0x400823['order']=qs[_0xc8d4('0x36')](_0x540875[_0xc8d4('0x2f')]['sort']);_0x400823[_0xc8d4('0x37')]=qs[_0xc8d4('0x38')](_[_0xc8d4('0x39')](_0x540875[_0xc8d4('0x2f')],_0x939b64['filters']),_0xcca347);if(_0x540875['query']['filter']){_0x400823[_0xc8d4('0x37')]=_['merge'](_0x400823[_0xc8d4('0x37')],{'$or':_[_0xc8d4('0x2a')](_0xcca347,function(_0x40faca){if(_0x40faca[_0xc8d4('0x2b')]!==_0xc8d4('0x3a')){var _0x348ed3={};_0x348ed3[_0x40faca[_0xc8d4('0x3b')]]={'$like':'%'+_0x540875[_0xc8d4('0x2f')][_0xc8d4('0x3c')]+'%'};return _0x348ed3;}})});}_0x400823=_[_0xc8d4('0x3d')]({},_0x400823,_0x540875[_0xc8d4('0x3e')]);var _0x25f1f9={'where':_0x400823['where']};return db[_0xc8d4('0x3f')]['count'](_0x25f1f9)[_0xc8d4('0x26')](function(_0x48fc04){_0x4ec16b[_0xc8d4('0x1f')]=_0x48fc04;if(_0x540875['query'][_0xc8d4('0x40')]){_0x400823[_0xc8d4('0x41')]=[{'all':!![]}];}return db[_0xc8d4('0x3f')][_0xc8d4('0x42')](_0x400823);})[_0xc8d4('0x26')](function(_0x3b16ea){_0x4ec16b['rows']=_0x3b16ea;return _0x4ec16b;})[_0xc8d4('0x26')](respondWithFilteredResult(_0x164f17,_0x400823))[_0xc8d4('0x43')](handleError(_0x164f17,null));};exports[_0xc8d4('0x44')]=function(_0x427c41,_0x29f431){var _0x46370e={'raw':![],'where':{'id':_0x427c41['params']['id']}},_0x41201b={};_0x41201b['model']=_[_0xc8d4('0x2e')](db[_0xc8d4('0x3f')]['rawAttributes']);_0x41201b[_0xc8d4('0x2f')]=_[_0xc8d4('0x2e')](_0x427c41[_0xc8d4('0x2f')]);_0x41201b['filters']=_['intersection'](_0x41201b[_0xc8d4('0x2d')],_0x41201b[_0xc8d4('0x2f')]);_0x46370e[_0xc8d4('0x31')]=_[_0xc8d4('0x30')](_0x41201b[_0xc8d4('0x2d')],qs[_0xc8d4('0x32')](_0x427c41[_0xc8d4('0x2f')][_0xc8d4('0x32')]));_0x46370e['attributes']=_0x46370e[_0xc8d4('0x31')][_0xc8d4('0x33')]?_0x46370e[_0xc8d4('0x31')]:_0x41201b[_0xc8d4('0x2d')];if(_0x427c41[_0xc8d4('0x2f')]['includeAll']){_0x46370e[_0xc8d4('0x41')]=[{'all':!![]}];}_0x46370e=_[_0xc8d4('0x3d')]({},_0x46370e,_0x427c41['options']);return db[_0xc8d4('0x3f')]['find'](_0x46370e)[_0xc8d4('0x26')](handleEntityNotFound(_0x29f431,null))[_0xc8d4('0x26')](respondWithResult(_0x29f431,null))[_0xc8d4('0x43')](handleError(_0x29f431,null));};exports[_0xc8d4('0x45')]=function(_0x52092d,_0x4342b1){return db[_0xc8d4('0x3f')]['create'](_0x52092d[_0xc8d4('0x46')],{})['then'](respondWithResult(_0x4342b1,0xc9))[_0xc8d4('0x43')](handleError(_0x4342b1,null));};exports['update']=function(_0x147139,_0x201dce){if(_0x147139['body']['id']){delete _0x147139[_0xc8d4('0x46')]['id'];}return db['SalesforceConfiguration'][_0xc8d4('0x47')]({'where':{'id':_0x147139[_0xc8d4('0x48')]['id']}})[_0xc8d4('0x26')](handleEntityNotFound(_0x201dce,null))[_0xc8d4('0x26')](saveUpdates(_0x147139[_0xc8d4('0x46')],null))[_0xc8d4('0x26')](respondWithResult(_0x201dce,null))[_0xc8d4('0x43')](handleError(_0x201dce,null));};exports[_0xc8d4('0x27')]=function(_0x1aef5c,_0x8c0aa8){return db[_0xc8d4('0x3f')][_0xc8d4('0x47')]({'where':{'id':_0x1aef5c[_0xc8d4('0x48')]['id']}})[_0xc8d4('0x26')](handleEntityNotFound(_0x8c0aa8,null))[_0xc8d4('0x26')](removeEntity(_0x8c0aa8,null))[_0xc8d4('0x43')](handleError(_0x8c0aa8,null));};exports['getFields']=function(_0x243967,_0x5ef7bc,_0x5ac009){var _0xe65b78={};var _0x1847b3={};var _0x1454a7;var _0x145fa6;return db[_0xc8d4('0x3f')]['findOne']({'where':{'id':_0x243967[_0xc8d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ef7bc,null))[_0xc8d4('0x26')](function(_0x44febe){if(_0x44febe){_0x1454a7=_0x44febe;_0x1847b3[_0xc8d4('0x2d')]=_['keys'](db[_0xc8d4('0x49')][_0xc8d4('0x4a')]);_0x1847b3[_0xc8d4('0x2f')]=_[_0xc8d4('0x2e')](_0x243967['query']);_0x1847b3[_0xc8d4('0x38')]=_['intersection'](_0x1847b3[_0xc8d4('0x2d')],_0x1847b3['query']);_0xe65b78[_0xc8d4('0x31')]=_[_0xc8d4('0x30')](_0x1847b3[_0xc8d4('0x2d')],qs[_0xc8d4('0x32')](_0x243967[_0xc8d4('0x2f')][_0xc8d4('0x32')]));_0xe65b78[_0xc8d4('0x31')]=_0xe65b78[_0xc8d4('0x31')][_0xc8d4('0x33')]?_0xe65b78[_0xc8d4('0x31')]:_0x1847b3[_0xc8d4('0x2d')];_0xe65b78[_0xc8d4('0x4b')]=qs[_0xc8d4('0x36')](_0x243967[_0xc8d4('0x2f')]['sort']);_0xe65b78[_0xc8d4('0x37')]=qs[_0xc8d4('0x38')](_['pick'](_0x243967[_0xc8d4('0x2f')],_0x1847b3[_0xc8d4('0x38')]));if(_0x243967[_0xc8d4('0x2f')][_0xc8d4('0x3c')]){_0xe65b78[_0xc8d4('0x37')]=_[_0xc8d4('0x3d')](_0xe65b78[_0xc8d4('0x37')],{'$or':_['map'](_0xe65b78[_0xc8d4('0x31')],function(_0x4cff45){var _0x22fce3={};_0x22fce3[_0x4cff45]={'$like':'%'+_0x243967[_0xc8d4('0x2f')][_0xc8d4('0x3c')]+'%'};return _0x22fce3;})});}_0xe65b78=_[_0xc8d4('0x3d')]({},_0xe65b78,_0x243967['options']);return _0x1454a7[_0xc8d4('0x4c')](_0xe65b78);}})[_0xc8d4('0x26')](function(_0x20a01e){if(_0x20a01e){_0x145fa6=_0x20a01e[_0xc8d4('0x33')];if(!_0x243967['query'][_0xc8d4('0x34')]('nolimit')){_0xe65b78[_0xc8d4('0x1e')]=qs[_0xc8d4('0x1e')](_0x243967[_0xc8d4('0x2f')][_0xc8d4('0x1e')]);_0xe65b78['offset']=qs[_0xc8d4('0x1c')](_0x243967['query'][_0xc8d4('0x1c')]);}return _0x1454a7[_0xc8d4('0x4c')](_0xe65b78);}})['then'](function(_0x400bbf){if(_0x400bbf){return _0x400bbf?{'count':_0x145fa6,'rows':_0x400bbf}:null;}})['then'](respondWithResult(_0x5ef7bc,null))[_0xc8d4('0x43')](handleError(_0x5ef7bc,null));};exports[_0xc8d4('0x4d')]=function(_0x5789ac,_0x21f792,_0x582951){var _0x4d906c={};var _0x3e54d5={};var _0x59d02b;var _0x9f0685;return db['SalesforceConfiguration'][_0xc8d4('0x4e')]({'where':{'id':_0x5789ac[_0xc8d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x21f792,null))[_0xc8d4('0x26')](function(_0x3f1408){if(_0x3f1408){_0x59d02b=_0x3f1408;_0x3e54d5[_0xc8d4('0x2d')]=_[_0xc8d4('0x2e')](db['SalesforceField']['rawAttributes']);_0x3e54d5[_0xc8d4('0x2f')]=_['keys'](_0x5789ac['query']);_0x3e54d5[_0xc8d4('0x38')]=_[_0xc8d4('0x30')](_0x3e54d5['model'],_0x3e54d5[_0xc8d4('0x2f')]);_0x4d906c[_0xc8d4('0x31')]=_[_0xc8d4('0x30')](_0x3e54d5[_0xc8d4('0x2d')],qs[_0xc8d4('0x32')](_0x5789ac['query'][_0xc8d4('0x32')]));_0x4d906c['attributes']=_0x4d906c[_0xc8d4('0x31')][_0xc8d4('0x33')]?_0x4d906c[_0xc8d4('0x31')]:_0x3e54d5[_0xc8d4('0x2d')];_0x4d906c['order']=qs['sort'](_0x5789ac['query'][_0xc8d4('0x36')]);_0x4d906c[_0xc8d4('0x37')]=qs[_0xc8d4('0x38')](_['pick'](_0x5789ac[_0xc8d4('0x2f')],_0x3e54d5['filters']));if(_0x5789ac['query'][_0xc8d4('0x3c')]){_0x4d906c[_0xc8d4('0x37')]=_[_0xc8d4('0x3d')](_0x4d906c[_0xc8d4('0x37')],{'$or':_['map'](_0x4d906c[_0xc8d4('0x31')],function(_0x23a7b4){var _0x4fa2f1={};_0x4fa2f1[_0x23a7b4]={'$like':'%'+_0x5789ac[_0xc8d4('0x2f')][_0xc8d4('0x3c')]+'%'};return _0x4fa2f1;})});}_0x4d906c=_[_0xc8d4('0x3d')]({},_0x4d906c,_0x5789ac['options']);return _0x59d02b[_0xc8d4('0x4d')](_0x4d906c);}})[_0xc8d4('0x26')](function(_0x35c9c1){if(_0x35c9c1){_0x9f0685=_0x35c9c1[_0xc8d4('0x33')];if(!_0x5789ac['query'][_0xc8d4('0x34')](_0xc8d4('0x35'))){_0x4d906c[_0xc8d4('0x1e')]=qs[_0xc8d4('0x1e')](_0x5789ac[_0xc8d4('0x2f')][_0xc8d4('0x1e')]);_0x4d906c['offset']=qs[_0xc8d4('0x1c')](_0x5789ac[_0xc8d4('0x2f')][_0xc8d4('0x1c')]);}return _0x59d02b[_0xc8d4('0x4d')](_0x4d906c);}})['then'](function(_0x28e72a){if(_0x28e72a){return _0x28e72a?{'count':_0x9f0685,'rows':_0x28e72a}:null;}})[_0xc8d4('0x26')](respondWithResult(_0x21f792,null))[_0xc8d4('0x43')](handleError(_0x21f792,null));};exports[_0xc8d4('0x4f')]=function(_0x303a1,_0x37422d,_0xba1517){var _0x230929={};var _0x1a5be8={};var _0x1d9bfc;var _0x1d8cbf;return db[_0xc8d4('0x3f')][_0xc8d4('0x4e')]({'where':{'id':_0x303a1[_0xc8d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x37422d,null))[_0xc8d4('0x26')](function(_0x490080){if(_0x490080){_0x1d9bfc=_0x490080;_0x1a5be8[_0xc8d4('0x2d')]=_[_0xc8d4('0x2e')](db[_0xc8d4('0x49')][_0xc8d4('0x4a')]);_0x1a5be8['query']=_[_0xc8d4('0x2e')](_0x303a1[_0xc8d4('0x2f')]);_0x1a5be8[_0xc8d4('0x38')]=_[_0xc8d4('0x30')](_0x1a5be8[_0xc8d4('0x2d')],_0x1a5be8['query']);_0x230929[_0xc8d4('0x31')]=_[_0xc8d4('0x30')](_0x1a5be8['model'],qs['fields'](_0x303a1[_0xc8d4('0x2f')]['fields']));_0x230929[_0xc8d4('0x31')]=_0x230929[_0xc8d4('0x31')][_0xc8d4('0x33')]?_0x230929[_0xc8d4('0x31')]:_0x1a5be8[_0xc8d4('0x2d')];_0x230929[_0xc8d4('0x4b')]=qs[_0xc8d4('0x36')](_0x303a1[_0xc8d4('0x2f')]['sort']);_0x230929[_0xc8d4('0x37')]=qs[_0xc8d4('0x38')](_['pick'](_0x303a1[_0xc8d4('0x2f')],_0x1a5be8[_0xc8d4('0x38')]));if(_0x303a1[_0xc8d4('0x2f')][_0xc8d4('0x3c')]){_0x230929['where']=_[_0xc8d4('0x3d')](_0x230929[_0xc8d4('0x37')],{'$or':_[_0xc8d4('0x2a')](_0x230929[_0xc8d4('0x31')],function(_0x1344de){var _0x5b39ce={};_0x5b39ce[_0x1344de]={'$like':'%'+_0x303a1[_0xc8d4('0x2f')][_0xc8d4('0x3c')]+'%'};return _0x5b39ce;})});}_0x230929=_['merge']({},_0x230929,_0x303a1[_0xc8d4('0x3e')]);return _0x1d9bfc['getDescriptions'](_0x230929);}})[_0xc8d4('0x26')](function(_0x39f042){if(_0x39f042){_0x1d8cbf=_0x39f042[_0xc8d4('0x33')];if(!_0x303a1[_0xc8d4('0x2f')][_0xc8d4('0x34')](_0xc8d4('0x35'))){_0x230929['limit']=qs[_0xc8d4('0x1e')](_0x303a1[_0xc8d4('0x2f')][_0xc8d4('0x1e')]);_0x230929['offset']=qs[_0xc8d4('0x1c')](_0x303a1[_0xc8d4('0x2f')]['offset']);}return _0x1d9bfc[_0xc8d4('0x4f')](_0x230929);}})['then'](function(_0x2a5abb){if(_0x2a5abb){return _0x2a5abb?{'count':_0x1d8cbf,'rows':_0x2a5abb}:null;}})[_0xc8d4('0x26')](respondWithResult(_0x37422d,null))[_0xc8d4('0x43')](handleError(_0x37422d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c62e9a3..aec9d9b 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 _0x0d33=['SalesforceConfiguration','lodash','../../config/logger','api','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x49aa1e,_0x19c7f3){var _0x366524=function(_0x5914ca){while(--_0x5914ca){_0x49aa1e['push'](_0x49aa1e['shift']());}};_0x366524(++_0x19c7f3);}(_0x0d33,0x187));var _0x30d3=function(_0x306fd5,_0xc37859){_0x306fd5=_0x306fd5-0x0;var _0x663169=_0x0d33[_0x306fd5];return _0x663169;};'use strict';var _=require(_0x30d3('0x0'));var util=require('util');var logger=require(_0x30d3('0x1'))(_0x30d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x30d3('0x3'));var fs=require('fs');var path=require(_0x30d3('0x4'));var rimraf=require('rimraf');var config=require(_0x30d3('0x5'));var attributes=require(_0x30d3('0x6'));module[_0x30d3('0x7')]=function(_0x2cf2d4,_0x26bef4){return _0x2cf2d4[_0x30d3('0x8')](_0x30d3('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8392=['bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8392,0x80));var _0x2839=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8392[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2839('0x0'));var util=require(_0x2839('0x1'));var logger=require(_0x2839('0x2'))(_0x2839('0x3'));var moment=require('moment');var BPromise=require(_0x2839('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2839('0x5'));var rimraf=require(_0x2839('0x6'));var config=require(_0x2839('0x7'));var attributes=require(_0x2839('0x8'));module['exports']=function(_0x3ff3aa,_0x1b1528){return _0x3ff3aa['define'](_0x2839('0x9'),attributes,{'tableName':_0x2839('0xa'),'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 1d3a3bb..cddd1cd 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 _0x8c55=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info'];(function(_0x1c2464,_0x4515ea){var _0x15001d=function(_0x396cef){while(--_0x396cef){_0x1c2464['push'](_0x1c2464['shift']());}};_0x15001d(++_0x4515ea);}(_0x8c55,0xb9));var _0x58c5=function(_0x5893d1,_0x1c10fd){_0x5893d1=_0x5893d1-0x0;var _0x478fe9=_0x8c55[_0x5893d1];return _0x478fe9;};'use strict';var _=require(_0x58c5('0x0'));var util=require(_0x58c5('0x1'));var moment=require(_0x58c5('0x2'));var BPromise=require(_0x58c5('0x3'));var rs=require(_0x58c5('0x4'));var fs=require('fs');var Redis=require(_0x58c5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c5('0x6'));var logger=require(_0x58c5('0x7'))(_0x58c5('0x8'));var config=require('../../config/environment');var jayson=require(_0x58c5('0x9'));var client=jayson['client'][_0x58c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x352639,_0x10e3f0,_0x4c12a1){return new BPromise(function(_0x4256a4,_0x276a49){return client[_0x58c5('0xb')](_0x352639,_0x4c12a1)[_0x58c5('0xc')](function(_0x1b84cf){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x10e3f0,_0x58c5('0xd'));logger[_0x58c5('0xe')](_0x58c5('0xf'),_0x10e3f0,'request\x20sent',JSON[_0x58c5('0x10')](_0x1b84cf));if(_0x1b84cf[_0x58c5('0x11')]){if(_0x1b84cf['error'][_0x58c5('0x12')]===0x1f4){logger[_0x58c5('0x11')](_0x58c5('0x13'),_0x10e3f0,_0x1b84cf[_0x58c5('0x11')][_0x58c5('0x14')]);return _0x276a49(_0x1b84cf[_0x58c5('0x11')][_0x58c5('0x14')]);}logger[_0x58c5('0x11')](_0x58c5('0x13'),_0x10e3f0,_0x1b84cf['error']['message']);return _0x4256a4(_0x1b84cf[_0x58c5('0x11')][_0x58c5('0x14')]);}else{logger[_0x58c5('0x15')]('SalesforceConfiguration,\x20%s,\x20%s',_0x10e3f0,'request\x20sent');_0x4256a4(_0x1b84cf['result'][_0x58c5('0x14')]);}})[_0x58c5('0x16')](function(_0x4d378e){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x10e3f0,_0x4d378e);_0x276a49(_0x4d378e);});});} \ No newline at end of file +var _0xfdf1=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x18734b,_0x265ab6){var _0x152419=function(_0x42aae0){while(--_0x42aae0){_0x18734b['push'](_0x18734b['shift']());}};_0x152419(++_0x265ab6);}(_0xfdf1,0x1ce));var _0x1fdf=function(_0x16fb01,_0x2e1d98){_0x16fb01=_0x16fb01-0x0;var _0x4b9e35=_0xfdf1[_0x16fb01];return _0x4b9e35;};'use strict';var _=require(_0x1fdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1fdf('0x1'));var rs=require(_0x1fdf('0x2'));var fs=require('fs');var Redis=require(_0x1fdf('0x3'));var db=require(_0x1fdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fdf('0x5'))(_0x1fdf('0x6'));var config=require(_0x1fdf('0x7'));var jayson=require(_0x1fdf('0x8'));var client=jayson[_0x1fdf('0x9')][_0x1fdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34ec59,_0x46e371,_0x210391){return new BPromise(function(_0x1c4cdb,_0x43c539){return client[_0x1fdf('0xb')](_0x34ec59,_0x210391)[_0x1fdf('0xc')](function(_0xf9409b){logger[_0x1fdf('0xd')](_0x1fdf('0xe'),_0x46e371,_0x1fdf('0xf'));logger['debug'](_0x1fdf('0x10'),_0x46e371,_0x1fdf('0xf'),JSON[_0x1fdf('0x11')](_0xf9409b));if(_0xf9409b[_0x1fdf('0x12')]){if(_0xf9409b[_0x1fdf('0x12')][_0x1fdf('0x13')]===0x1f4){logger[_0x1fdf('0x12')](_0x1fdf('0xe'),_0x46e371,_0xf9409b[_0x1fdf('0x12')][_0x1fdf('0x14')]);return _0x43c539(_0xf9409b[_0x1fdf('0x12')][_0x1fdf('0x14')]);}logger[_0x1fdf('0x12')](_0x1fdf('0xe'),_0x46e371,_0xf9409b[_0x1fdf('0x12')][_0x1fdf('0x14')]);return _0x1c4cdb(_0xf9409b[_0x1fdf('0x12')][_0x1fdf('0x14')]);}else{logger[_0x1fdf('0xd')](_0x1fdf('0xe'),_0x46e371,'request\x20sent');_0x1c4cdb(_0xf9409b[_0x1fdf('0x15')][_0x1fdf('0x14')]);}})['catch'](function(_0x39a9fe){logger[_0x1fdf('0x12')](_0x1fdf('0xe'),_0x46e371,_0x39a9fe);_0x43c539(_0x39a9fe);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 9374fb1..1c8093b 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 _0xdc03=['isAuthenticated','/:id','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xdc03,0x186));var _0x3dc0=function(_0x1d393d,_0x3e3ed2){_0x1d393d=_0x1d393d-0x0;var _0x48e93c=_0xdc03[_0x1d393d];return _0x48e93c;};'use strict';var multer=require(_0x3dc0('0x0'));var util=require(_0x3dc0('0x1'));var path=require(_0x3dc0('0x2'));var timeout=require(_0x3dc0('0x3'));var express=require(_0x3dc0('0x4'));var router=express[_0x3dc0('0x5')]();var fs_extra=require(_0x3dc0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3dc0('0x7'));var config=require('../../config/environment');var controller=require(_0x3dc0('0x8'));router[_0x3dc0('0x9')]('/',auth[_0x3dc0('0xa')](),controller['index']);router[_0x3dc0('0x9')](_0x3dc0('0xb'),auth[_0x3dc0('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3dc0('0xc')]);router[_0x3dc0('0xd')]('/:id',auth[_0x3dc0('0xa')](),controller['update']);router[_0x3dc0('0xe')](_0x3dc0('0xb'),auth[_0x3dc0('0xa')](),controller[_0x3dc0('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbc99=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','post','put','update','delete','destroy','exports','multer'];(function(_0x22088e,_0x3a0adb){var _0x547711=function(_0x5c2fea){while(--_0x5c2fea){_0x22088e['push'](_0x22088e['shift']());}};_0x547711(++_0x3a0adb);}(_0xbc99,0xfb));var _0x9bc9=function(_0x43f731,_0x3d02c8){_0x43f731=_0x43f731-0x0;var _0x348621=_0xbc99[_0x43f731];return _0x348621;};'use strict';var multer=require(_0x9bc9('0x0'));var util=require('util');var path=require(_0x9bc9('0x1'));var timeout=require(_0x9bc9('0x2'));var express=require(_0x9bc9('0x3'));var router=express[_0x9bc9('0x4')]();var fs_extra=require(_0x9bc9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9bc9('0x6'));var config=require(_0x9bc9('0x7'));var controller=require(_0x9bc9('0x8'));router[_0x9bc9('0x9')]('/',auth[_0x9bc9('0xa')](),controller['index']);router[_0x9bc9('0x9')](_0x9bc9('0xb'),auth[_0x9bc9('0xa')](),controller['show']);router[_0x9bc9('0xc')]('/',auth[_0x9bc9('0xa')](),controller['create']);router[_0x9bc9('0xd')](_0x9bc9('0xb'),auth['isAuthenticated'](),controller[_0x9bc9('0xe')]);router[_0x9bc9('0xf')](_0x9bc9('0xb'),auth['isAuthenticated'](),controller[_0x9bc9('0x10')]);module[_0x9bc9('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 087b30a..69cc15a 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 _0xfa59=['picklist','string','STRING','sequelize','ENUM','variable','customVariable'];(function(_0x3e94e2,_0x30790e){var _0x2a75d3=function(_0x58a633){while(--_0x58a633){_0x3e94e2['push'](_0x3e94e2['shift']());}};_0x2a75d3(++_0x30790e);}(_0xfa59,0x1e6));var _0x9fa5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfa59[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x9fa5('0x0'));module['exports']={'type':{'type':Sequelize[_0x9fa5('0x1')]('string',_0x9fa5('0x2'),_0x9fa5('0x3'),'keyValue',_0x9fa5('0x4')),'defaultValue':_0x9fa5('0x5')},'content':{'type':Sequelize[_0x9fa5('0x6')]},'key':{'type':Sequelize[_0x9fa5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x9fa5('0x5'),'variable',_0x9fa5('0x3'))},'keyContent':{'type':Sequelize[_0x9fa5('0x6')]},'idField':{'type':Sequelize[_0x9fa5('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc28c=['ENUM','variable','customVariable','keyValue','string','STRING','sequelize','exports'];(function(_0x1c8e25,_0x155208){var _0x4633ce=function(_0x450292){while(--_0x450292){_0x1c8e25['push'](_0x1c8e25['shift']());}};_0x4633ce(++_0x155208);}(_0xc28c,0x12e));var _0xcc28=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xc28c[_0x260f28];return _0x3aefcc;};'use strict';var Sequelize=require(_0xcc28('0x0'));module[_0xcc28('0x1')]={'type':{'type':Sequelize[_0xcc28('0x2')]('string',_0xcc28('0x3'),_0xcc28('0x4'),_0xcc28('0x5'),'picklist'),'defaultValue':_0xcc28('0x6')},'content':{'type':Sequelize[_0xcc28('0x7')]},'key':{'type':Sequelize[_0xcc28('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xcc28('0x6'),_0xcc28('0x3'),_0xcc28('0x4'))},'keyContent':{'type':Sequelize[_0xcc28('0x7')]},'idField':{'type':Sequelize[_0xcc28('0x7')]},'variableName':{'type':Sequelize[_0xcc28('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8dd0e98..54ff61c 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 _0xe06e=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe06e,0x132));var _0xee06=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xe06e[_0x1e4150];return _0x1ce3ee;};'use strict';var emlformat=require(_0xee06('0x0'));var rimraf=require(_0xee06('0x1'));var zipdir=require(_0xee06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee06('0x3'));var moment=require(_0xee06('0x4'));var BPromise=require(_0xee06('0x5'));var Mustache=require(_0xee06('0x6'));var util=require(_0xee06('0x7'));var path=require('path');var sox=require(_0xee06('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee06('0x9'));var crypto=require(_0xee06('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xee06('0xb'));var toCsv=require('to-csv');var querystring=require(_0xee06('0xc'));var Papa=require('papaparse');var Redis=require(_0xee06('0xd'));var authService=require(_0xee06('0xe'));var qs=require(_0xee06('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee06('0x10'));var logger=require(_0xee06('0x11'))('api');var utils=require(_0xee06('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xee06('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5a08,_0x42e7bc){_0x42e7bc=_0x42e7bc||0xcc;return function(_0x32549c){if(_0x32549c){return _0x1e5a08['sendStatus'](_0x42e7bc);}return _0x1e5a08[_0xee06('0x14')](_0x42e7bc)['end']();};}function respondWithResult(_0x1f1745,_0x5c3443){_0x5c3443=_0x5c3443||0xc8;return function(_0x5cf5ee){if(_0x5cf5ee){return _0x1f1745['status'](_0x5c3443)[_0xee06('0x15')](_0x5cf5ee);}};}function respondWithFilteredResult(_0x2253e6,_0x3022c9){return function(_0x4da7b7){if(_0x4da7b7){var _0x572a69=typeof _0x3022c9['offset']===_0xee06('0x16')&&typeof _0x3022c9[_0xee06('0x17')]==='undefined';var _0x3e27f9=_0x4da7b7[_0xee06('0x18')];var _0x372e64=_0x572a69?0x0:_0x3022c9[_0xee06('0x19')];var _0x15eae4=_0x572a69?_0x4da7b7['count']:_0x3022c9[_0xee06('0x19')]+_0x3022c9[_0xee06('0x17')];var _0x2a5c7d;if(_0x15eae4>=_0x3e27f9){_0x15eae4=_0x3e27f9;_0x2a5c7d=0xc8;}else{_0x2a5c7d=0xce;}_0x2253e6[_0xee06('0x14')](_0x2a5c7d);return _0x2253e6[_0xee06('0x1a')]('Content-Range',_0x372e64+'-'+_0x15eae4+'/'+_0x3e27f9)[_0xee06('0x15')](_0x4da7b7);}return null;};}function patchUpdates(_0x2fa6b4){return function(_0xfa401f){try{jsonpatch[_0xee06('0x1b')](_0xfa401f,_0x2fa6b4,!![]);}catch(_0xdf123b){return BPromise[_0xee06('0x1c')](_0xdf123b);}return _0xfa401f[_0xee06('0x1d')]();};}function saveUpdates(_0x39ab06,_0x59cbde){return function(_0x43444d){if(_0x43444d){return _0x43444d[_0xee06('0x1e')](_0x39ab06)[_0xee06('0x1f')](function(_0x263245){return _0x263245;});}return null;};}function removeEntity(_0x5bf609,_0x56ff1a){return function(_0x1143dc){if(_0x1143dc){return _0x1143dc[_0xee06('0x20')]()[_0xee06('0x1f')](function(){_0x5bf609['status'](0xcc)[_0xee06('0x21')]();});}};}function handleEntityNotFound(_0x235d12,_0x1d7206){return function(_0x197dde){if(!_0x197dde){_0x235d12[_0xee06('0x22')](0x194);}return _0x197dde;};}function handleError(_0x107ac1,_0x52e290){_0x52e290=_0x52e290||0x1f4;return function(_0x2da93e){logger['error'](_0x2da93e['stack']);if(_0x2da93e[_0xee06('0x23')]){delete _0x2da93e[_0xee06('0x23')];}_0x107ac1[_0xee06('0x14')](_0x52e290)[_0xee06('0x24')](_0x2da93e);};}exports[_0xee06('0x25')]=function(_0x1d4309,_0x5f1e0b){var _0x47cb49={},_0x53b14c={},_0x392ef8={'count':0x0,'rows':[]};var _0x4dcbe1=_[_0xee06('0x26')](db[_0xee06('0x27')][_0xee06('0x28')],function(_0x3ff8af){return{'name':_0x3ff8af[_0xee06('0x29')],'type':_0x3ff8af['type'][_0xee06('0x2a')]};});_0x53b14c[_0xee06('0x2b')]=_[_0xee06('0x26')](_0x4dcbe1,_0xee06('0x23'));_0x53b14c[_0xee06('0x2c')]=_[_0xee06('0x2d')](_0x1d4309[_0xee06('0x2c')]);_0x53b14c[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x53b14c[_0xee06('0x2b')],_0x53b14c[_0xee06('0x2c')]);_0x47cb49['attributes']=_[_0xee06('0x2f')](_0x53b14c[_0xee06('0x2b')],qs[_0xee06('0x30')](_0x1d4309[_0xee06('0x2c')][_0xee06('0x30')]));_0x47cb49[_0xee06('0x31')]=_0x47cb49['attributes'][_0xee06('0x32')]?_0x47cb49[_0xee06('0x31')]:_0x53b14c[_0xee06('0x2b')];if(!_0x1d4309[_0xee06('0x2c')][_0xee06('0x33')](_0xee06('0x34'))){_0x47cb49[_0xee06('0x17')]=qs['limit'](_0x1d4309['query']['limit']);_0x47cb49['offset']=qs[_0xee06('0x19')](_0x1d4309[_0xee06('0x2c')]['offset']);}_0x47cb49[_0xee06('0x35')]=qs[_0xee06('0x36')](_0x1d4309[_0xee06('0x2c')][_0xee06('0x36')]);_0x47cb49[_0xee06('0x37')]=qs[_0xee06('0x2e')](_[_0xee06('0x38')](_0x1d4309['query'],_0x53b14c[_0xee06('0x2e')]),_0x4dcbe1);if(_0x1d4309[_0xee06('0x2c')][_0xee06('0x39')]){_0x47cb49[_0xee06('0x37')]=_[_0xee06('0x3a')](_0x47cb49[_0xee06('0x37')],{'$or':_[_0xee06('0x26')](_0x4dcbe1,function(_0x5a9ffb){if(_0x5a9ffb[_0xee06('0x3b')]!==_0xee06('0x3c')){var _0x69803={};_0x69803[_0x5a9ffb['name']]={'$like':'%'+_0x1d4309['query'][_0xee06('0x39')]+'%'};return _0x69803;}})});}_0x47cb49=_[_0xee06('0x3a')]({},_0x47cb49,_0x1d4309['options']);var _0x27c0c6={'where':_0x47cb49[_0xee06('0x37')]};return db['SalesforceField'][_0xee06('0x18')](_0x27c0c6)[_0xee06('0x1f')](function(_0x271720){_0x392ef8['count']=_0x271720;if(_0x1d4309['query'][_0xee06('0x3d')]){_0x47cb49[_0xee06('0x3e')]=[{'all':!![]}];}return db[_0xee06('0x27')][_0xee06('0x3f')](_0x47cb49);})[_0xee06('0x1f')](function(_0x45f7ee){_0x392ef8['rows']=_0x45f7ee;return _0x392ef8;})['then'](respondWithFilteredResult(_0x5f1e0b,_0x47cb49))[_0xee06('0x40')](handleError(_0x5f1e0b,null));};exports[_0xee06('0x41')]=function(_0x49a68a,_0x2eec23){var _0x63028a={'raw':!![],'where':{'id':_0x49a68a[_0xee06('0x42')]['id']}},_0x2c1518={};_0x2c1518[_0xee06('0x2b')]=_[_0xee06('0x2d')](db[_0xee06('0x27')][_0xee06('0x28')]);_0x2c1518[_0xee06('0x2c')]=_[_0xee06('0x2d')](_0x49a68a[_0xee06('0x2c')]);_0x2c1518['filters']=_[_0xee06('0x2f')](_0x2c1518[_0xee06('0x2b')],_0x2c1518[_0xee06('0x2c')]);_0x63028a[_0xee06('0x31')]=_[_0xee06('0x2f')](_0x2c1518[_0xee06('0x2b')],qs[_0xee06('0x30')](_0x49a68a[_0xee06('0x2c')][_0xee06('0x30')]));_0x63028a[_0xee06('0x31')]=_0x63028a[_0xee06('0x31')][_0xee06('0x32')]?_0x63028a[_0xee06('0x31')]:_0x2c1518['model'];if(_0x49a68a[_0xee06('0x2c')][_0xee06('0x3d')]){_0x63028a[_0xee06('0x3e')]=[{'all':!![]}];}_0x63028a=_[_0xee06('0x3a')]({},_0x63028a,_0x49a68a[_0xee06('0x43')]);return db[_0xee06('0x27')]['find'](_0x63028a)[_0xee06('0x1f')](handleEntityNotFound(_0x2eec23,null))[_0xee06('0x1f')](respondWithResult(_0x2eec23,null))['catch'](handleError(_0x2eec23,null));};exports['create']=function(_0x29f40c,_0x1b7427){return db['SalesforceField'][_0xee06('0x44')](_0x29f40c[_0xee06('0x45')],{})['then'](respondWithResult(_0x1b7427,0xc9))[_0xee06('0x40')](handleError(_0x1b7427,null));};exports[_0xee06('0x1e')]=function(_0x5bb2a8,_0x469f41){if(_0x5bb2a8[_0xee06('0x45')]['id']){delete _0x5bb2a8[_0xee06('0x45')]['id'];}return db['SalesforceField'][_0xee06('0x46')]({'where':{'id':_0x5bb2a8[_0xee06('0x42')]['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x469f41,null))['then'](saveUpdates(_0x5bb2a8[_0xee06('0x45')],null))['then'](respondWithResult(_0x469f41,null))[_0xee06('0x40')](handleError(_0x469f41,null));};exports[_0xee06('0x20')]=function(_0x176353,_0x1931bb){return db['SalesforceField'][_0xee06('0x46')]({'where':{'id':_0x176353[_0xee06('0x42')]['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x1931bb,null))[_0xee06('0x1f')](removeEntity(_0x1931bb,null))[_0xee06('0x40')](handleError(_0x1931bb,null));}; \ No newline at end of file +var _0xb6d1=['eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','params','options','create','body'];(function(_0x42cfc0,_0x573bee){var _0x38a931=function(_0x50506f){while(--_0x50506f){_0x42cfc0['push'](_0x42cfc0['shift']());}};_0x38a931(++_0x573bee);}(_0xb6d1,0x172));var _0x1b6d=function(_0x28240d,_0x419a72){_0x28240d=_0x28240d-0x0;var _0x52725f=_0xb6d1[_0x28240d];return _0x52725f;};'use strict';var emlformat=require(_0x1b6d('0x0'));var rimraf=require(_0x1b6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6d('0x2'));var moment=require(_0x1b6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6d('0x4'));var util=require(_0x1b6d('0x5'));var path=require(_0x1b6d('0x6'));var sox=require(_0x1b6d('0x7'));var csv=require(_0x1b6d('0x8'));var ejs=require(_0x1b6d('0x9'));var fs=require('fs');var fs_extra=require(_0x1b6d('0xa'));var _=require(_0x1b6d('0xb'));var squel=require(_0x1b6d('0xc'));var crypto=require(_0x1b6d('0xd'));var jsforce=require(_0x1b6d('0xe'));var deskjs=require(_0x1b6d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1b6d('0x10'));var Papa=require(_0x1b6d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6d('0x12'));var as=require(_0x1b6d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1b6d('0x14'));var utils=require(_0x1b6d('0x15'));var config=require(_0x1b6d('0x16'));var licenseUtil=require(_0x1b6d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x316dbf,_0x5c2346){_0x5c2346=_0x5c2346||0xcc;return function(_0x58793f){if(_0x58793f){return _0x316dbf[_0x1b6d('0x18')](_0x5c2346);}return _0x316dbf['status'](_0x5c2346)[_0x1b6d('0x19')]();};}function respondWithResult(_0x52dd0c,_0x1db70b){_0x1db70b=_0x1db70b||0xc8;return function(_0x4733d6){if(_0x4733d6){return _0x52dd0c[_0x1b6d('0x1a')](_0x1db70b)['json'](_0x4733d6);}};}function respondWithFilteredResult(_0x2c81dc,_0x56d961){return function(_0x351ec7){if(_0x351ec7){var _0x381b38=typeof _0x56d961[_0x1b6d('0x1b')]===_0x1b6d('0x1c')&&typeof _0x56d961[_0x1b6d('0x1d')]===_0x1b6d('0x1c');var _0x1a2eb9=_0x351ec7[_0x1b6d('0x1e')];var _0x66146d=_0x381b38?0x0:_0x56d961[_0x1b6d('0x1b')];var _0x57e949=_0x381b38?_0x351ec7[_0x1b6d('0x1e')]:_0x56d961[_0x1b6d('0x1b')]+_0x56d961['limit'];var _0x5c1742;if(_0x57e949>=_0x1a2eb9){_0x57e949=_0x1a2eb9;_0x5c1742=0xc8;}else{_0x5c1742=0xce;}_0x2c81dc[_0x1b6d('0x1a')](_0x5c1742);return _0x2c81dc[_0x1b6d('0x1f')](_0x1b6d('0x20'),_0x66146d+'-'+_0x57e949+'/'+_0x1a2eb9)['json'](_0x351ec7);}return null;};}function patchUpdates(_0x1982b8){return function(_0x3bc785){try{jsonpatch[_0x1b6d('0x21')](_0x3bc785,_0x1982b8,!![]);}catch(_0xfa4c81){return BPromise[_0x1b6d('0x22')](_0xfa4c81);}return _0x3bc785[_0x1b6d('0x23')]();};}function saveUpdates(_0x2f4f59,_0x407fb9){return function(_0x45cd1a){if(_0x45cd1a){return _0x45cd1a[_0x1b6d('0x24')](_0x2f4f59)[_0x1b6d('0x25')](function(_0x5e5c67){return _0x5e5c67;});}return null;};}function removeEntity(_0x2b90b4,_0x4562c6){return function(_0x4ab5a1){if(_0x4ab5a1){return _0x4ab5a1[_0x1b6d('0x26')]()[_0x1b6d('0x25')](function(){_0x2b90b4[_0x1b6d('0x1a')](0xcc)[_0x1b6d('0x19')]();});}};}function handleEntityNotFound(_0x372eb3,_0x5f2e9f){return function(_0x353b66){if(!_0x353b66){_0x372eb3['sendStatus'](0x194);}return _0x353b66;};}function handleError(_0x2566e2,_0x5bcc2b){_0x5bcc2b=_0x5bcc2b||0x1f4;return function(_0x4422a5){logger[_0x1b6d('0x27')](_0x4422a5[_0x1b6d('0x28')]);if(_0x4422a5[_0x1b6d('0x29')]){delete _0x4422a5[_0x1b6d('0x29')];}_0x2566e2[_0x1b6d('0x1a')](_0x5bcc2b)[_0x1b6d('0x2a')](_0x4422a5);};}exports[_0x1b6d('0x2b')]=function(_0x35a08a,_0x22ad9a){var _0x8cbf10={},_0x331e33={},_0x1f3282={'count':0x0,'rows':[]};var _0x46739a=_[_0x1b6d('0x2c')](db[_0x1b6d('0x2d')][_0x1b6d('0x2e')],function(_0x218f4a){return{'name':_0x218f4a[_0x1b6d('0x2f')],'type':_0x218f4a[_0x1b6d('0x30')][_0x1b6d('0x31')]};});_0x331e33[_0x1b6d('0x32')]=_[_0x1b6d('0x2c')](_0x46739a,_0x1b6d('0x29'));_0x331e33[_0x1b6d('0x33')]=_[_0x1b6d('0x34')](_0x35a08a[_0x1b6d('0x33')]);_0x331e33[_0x1b6d('0x35')]=_[_0x1b6d('0x36')](_0x331e33[_0x1b6d('0x32')],_0x331e33[_0x1b6d('0x33')]);_0x8cbf10[_0x1b6d('0x37')]=_[_0x1b6d('0x36')](_0x331e33[_0x1b6d('0x32')],qs[_0x1b6d('0x38')](_0x35a08a[_0x1b6d('0x33')][_0x1b6d('0x38')]));_0x8cbf10[_0x1b6d('0x37')]=_0x8cbf10['attributes'][_0x1b6d('0x39')]?_0x8cbf10[_0x1b6d('0x37')]:_0x331e33['model'];if(!_0x35a08a[_0x1b6d('0x33')][_0x1b6d('0x3a')](_0x1b6d('0x3b'))){_0x8cbf10[_0x1b6d('0x1d')]=qs[_0x1b6d('0x1d')](_0x35a08a[_0x1b6d('0x33')][_0x1b6d('0x1d')]);_0x8cbf10['offset']=qs['offset'](_0x35a08a['query'][_0x1b6d('0x1b')]);}_0x8cbf10[_0x1b6d('0x3c')]=qs[_0x1b6d('0x3d')](_0x35a08a['query']['sort']);_0x8cbf10['where']=qs[_0x1b6d('0x35')](_['pick'](_0x35a08a[_0x1b6d('0x33')],_0x331e33[_0x1b6d('0x35')]),_0x46739a);if(_0x35a08a[_0x1b6d('0x33')]['filter']){_0x8cbf10[_0x1b6d('0x3e')]=_[_0x1b6d('0x3f')](_0x8cbf10[_0x1b6d('0x3e')],{'$or':_['map'](_0x46739a,function(_0x59f0c2){if(_0x59f0c2['type']!==_0x1b6d('0x40')){var _0x2df528={};_0x2df528[_0x59f0c2[_0x1b6d('0x29')]]={'$like':'%'+_0x35a08a['query'][_0x1b6d('0x41')]+'%'};return _0x2df528;}})});}_0x8cbf10=_[_0x1b6d('0x3f')]({},_0x8cbf10,_0x35a08a['options']);var _0x4984d4={'where':_0x8cbf10[_0x1b6d('0x3e')]};return db[_0x1b6d('0x2d')][_0x1b6d('0x1e')](_0x4984d4)[_0x1b6d('0x25')](function(_0x1c3586){_0x1f3282[_0x1b6d('0x1e')]=_0x1c3586;if(_0x35a08a[_0x1b6d('0x33')][_0x1b6d('0x42')]){_0x8cbf10[_0x1b6d('0x43')]=[{'all':!![]}];}return db['SalesforceField'][_0x1b6d('0x44')](_0x8cbf10);})[_0x1b6d('0x25')](function(_0x5f5790){_0x1f3282['rows']=_0x5f5790;return _0x1f3282;})[_0x1b6d('0x25')](respondWithFilteredResult(_0x22ad9a,_0x8cbf10))[_0x1b6d('0x45')](handleError(_0x22ad9a,null));};exports['show']=function(_0x80b749,_0x1d05e1){var _0x31af83={'raw':!![],'where':{'id':_0x80b749[_0x1b6d('0x46')]['id']}},_0x38f89d={};_0x38f89d[_0x1b6d('0x32')]=_[_0x1b6d('0x34')](db[_0x1b6d('0x2d')]['rawAttributes']);_0x38f89d[_0x1b6d('0x33')]=_[_0x1b6d('0x34')](_0x80b749['query']);_0x38f89d['filters']=_[_0x1b6d('0x36')](_0x38f89d['model'],_0x38f89d[_0x1b6d('0x33')]);_0x31af83[_0x1b6d('0x37')]=_[_0x1b6d('0x36')](_0x38f89d[_0x1b6d('0x32')],qs[_0x1b6d('0x38')](_0x80b749['query'][_0x1b6d('0x38')]));_0x31af83[_0x1b6d('0x37')]=_0x31af83[_0x1b6d('0x37')][_0x1b6d('0x39')]?_0x31af83[_0x1b6d('0x37')]:_0x38f89d[_0x1b6d('0x32')];if(_0x80b749['query'][_0x1b6d('0x42')]){_0x31af83[_0x1b6d('0x43')]=[{'all':!![]}];}_0x31af83=_[_0x1b6d('0x3f')]({},_0x31af83,_0x80b749[_0x1b6d('0x47')]);return db['SalesforceField']['find'](_0x31af83)[_0x1b6d('0x25')](handleEntityNotFound(_0x1d05e1,null))[_0x1b6d('0x25')](respondWithResult(_0x1d05e1,null))[_0x1b6d('0x45')](handleError(_0x1d05e1,null));};exports['create']=function(_0x11f18b,_0x416f7c){return db[_0x1b6d('0x2d')][_0x1b6d('0x48')](_0x11f18b[_0x1b6d('0x49')],{})[_0x1b6d('0x25')](respondWithResult(_0x416f7c,0xc9))[_0x1b6d('0x45')](handleError(_0x416f7c,null));};exports[_0x1b6d('0x24')]=function(_0x19ef55,_0x54e0e0){if(_0x19ef55[_0x1b6d('0x49')]['id']){delete _0x19ef55[_0x1b6d('0x49')]['id'];}return db[_0x1b6d('0x2d')]['find']({'where':{'id':_0x19ef55['params']['id']}})[_0x1b6d('0x25')](handleEntityNotFound(_0x54e0e0,null))[_0x1b6d('0x25')](saveUpdates(_0x19ef55[_0x1b6d('0x49')],null))[_0x1b6d('0x25')](respondWithResult(_0x54e0e0,null))['catch'](handleError(_0x54e0e0,null));};exports[_0x1b6d('0x26')]=function(_0x19dc94,_0x1c7e2b){return db['SalesforceField']['find']({'where':{'id':_0x19dc94[_0x1b6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c7e2b,null))[_0x1b6d('0x25')](removeEntity(_0x1c7e2b,null))['catch'](handleError(_0x1c7e2b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index d5c770a..d191f41 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 _0x2ce2=['request-promise','path','rimraf','exports','define','SalesforceField','salesforce_unique_index','idField','util','../../config/logger','api','moment','bluebird'];(function(_0x4c102e,_0x14dd36){var _0x20f51f=function(_0x5cf55c){while(--_0x5cf55c){_0x4c102e['push'](_0x4c102e['shift']());}};_0x20f51f(++_0x14dd36);}(_0x2ce2,0xb1));var _0x22ce=function(_0x48ea38,_0xb5b397){_0x48ea38=_0x48ea38-0x0;var _0xa6780=_0x2ce2[_0x48ea38];return _0xa6780;};'use strict';var _=require('lodash');var util=require(_0x22ce('0x0'));var logger=require(_0x22ce('0x1'))(_0x22ce('0x2'));var moment=require(_0x22ce('0x3'));var BPromise=require(_0x22ce('0x4'));var rp=require(_0x22ce('0x5'));var fs=require('fs');var path=require(_0x22ce('0x6'));var rimraf=require(_0x22ce('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x22ce('0x8')]=function(_0x2c7cc9,_0x48a3aa){return _0x2c7cc9[_0x22ce('0x9')](_0x22ce('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x22ce('0xb'),'fields':[_0x22ce('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb7=['salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','./intSalesforceField.attributes','exports','SalesforceField'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xccb7,0x78));var _0x7ccb=function(_0x2afd9a,_0x2174df){_0x2afd9a=_0x2afd9a-0x0;var _0x26cc22=_0xccb7[_0x2afd9a];return _0x26cc22;};'use strict';var _=require('lodash');var util=require(_0x7ccb('0x0'));var logger=require(_0x7ccb('0x1'))(_0x7ccb('0x2'));var moment=require(_0x7ccb('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ccb('0x4'));var fs=require('fs');var path=require(_0x7ccb('0x5'));var rimraf=require(_0x7ccb('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ccb('0x7'));module[_0x7ccb('0x8')]=function(_0x237666,_0x1feb81){return _0x237666['define'](_0x7ccb('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x7ccb('0xa'),'fields':[_0x7ccb('0xb'),_0x7ccb('0xc')],'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 d6ef6ff..822c286 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 _0x6c60=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','util'];(function(_0x5ceb59,_0x5d802b){var _0x2a4c20=function(_0x56ab43){while(--_0x56ab43){_0x5ceb59['push'](_0x5ceb59['shift']());}};_0x2a4c20(++_0x5d802b);}(_0x6c60,0xe3));var _0x06c6=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x6c60[_0x11e30d];return _0x2d4e29;};'use strict';var _=require('lodash');var util=require(_0x06c6('0x0'));var moment=require('moment');var BPromise=require(_0x06c6('0x1'));var rs=require(_0x06c6('0x2'));var fs=require('fs');var Redis=require(_0x06c6('0x3'));var db=require(_0x06c6('0x4'))['db'];var utils=require(_0x06c6('0x5'));var logger=require(_0x06c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06c6('0x7'));var client=jayson[_0x06c6('0x8')][_0x06c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a284c,_0x1d4224,_0x47b2aa){return new BPromise(function(_0x40a584,_0x4d7c56){return client[_0x06c6('0xa')](_0x2a284c,_0x47b2aa)[_0x06c6('0xb')](function(_0x41c19c){logger['info'](_0x06c6('0xc'),_0x1d4224,_0x06c6('0xd'));logger[_0x06c6('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1d4224,_0x06c6('0xd'),JSON['stringify'](_0x41c19c));if(_0x41c19c[_0x06c6('0xf')]){if(_0x41c19c[_0x06c6('0xf')]['code']===0x1f4){logger[_0x06c6('0xf')](_0x06c6('0xc'),_0x1d4224,_0x41c19c[_0x06c6('0xf')][_0x06c6('0x10')]);return _0x4d7c56(_0x41c19c[_0x06c6('0xf')]['message']);}logger[_0x06c6('0xf')](_0x06c6('0xc'),_0x1d4224,_0x41c19c[_0x06c6('0xf')][_0x06c6('0x10')]);return _0x40a584(_0x41c19c[_0x06c6('0xf')][_0x06c6('0x10')]);}else{logger[_0x06c6('0x11')](_0x06c6('0xc'),_0x1d4224,_0x06c6('0xd'));_0x40a584(_0x41c19c['result'][_0x06c6('0x10')]);}})[_0x06c6('0x12')](function(_0x4c7a46){logger[_0x06c6('0xf')]('SalesforceField,\x20%s,\x20%s',_0x1d4224,_0x4c7a46);_0x4d7c56(_0x4c7a46);});});} \ No newline at end of file +var _0xb657=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xb657,0x1f4));var _0x7b65=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xb657[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x7b65('0x0'));var util=require(_0x7b65('0x1'));var moment=require(_0x7b65('0x2'));var BPromise=require(_0x7b65('0x3'));var rs=require(_0x7b65('0x4'));var fs=require('fs');var Redis=require(_0x7b65('0x5'));var db=require(_0x7b65('0x6'))['db'];var utils=require(_0x7b65('0x7'));var logger=require(_0x7b65('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b65('0x9'));var client=jayson['client'][_0x7b65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518a6a,_0x4c6b7d,_0x1d0bab){return new BPromise(function(_0x4855ec,_0x594b4d){return client['request'](_0x518a6a,_0x1d0bab)['then'](function(_0x525da1){logger[_0x7b65('0xb')](_0x7b65('0xc'),_0x4c6b7d,_0x7b65('0xd'));logger['debug'](_0x7b65('0xe'),_0x4c6b7d,_0x7b65('0xd'),JSON['stringify'](_0x525da1));if(_0x525da1[_0x7b65('0xf')]){if(_0x525da1[_0x7b65('0xf')][_0x7b65('0x10')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4c6b7d,_0x525da1[_0x7b65('0xf')][_0x7b65('0x11')]);return _0x594b4d(_0x525da1['error'][_0x7b65('0x11')]);}logger[_0x7b65('0xf')](_0x7b65('0xc'),_0x4c6b7d,_0x525da1[_0x7b65('0xf')][_0x7b65('0x11')]);return _0x4855ec(_0x525da1[_0x7b65('0xf')][_0x7b65('0x11')]);}else{logger['info'](_0x7b65('0xc'),_0x4c6b7d,_0x7b65('0xd'));_0x4855ec(_0x525da1[_0x7b65('0x12')][_0x7b65('0x11')]);}})[_0x7b65('0x13')](function(_0x5d32fe){logger[_0x7b65('0xf')](_0x7b65('0xc'),_0x4c6b7d,_0x5d32fe);_0x594b4d(_0x5d32fe);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0091e6a..45de402 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 _0x6037=['post','addConfiguration','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','getFields'];(function(_0x16de8a,_0x2c0e2f){var _0x1fcc53=function(_0x1596cb){while(--_0x1596cb){_0x16de8a['push'](_0x16de8a['shift']());}};_0x1fcc53(++_0x2c0e2f);}(_0x6037,0xe2));var _0x7603=function(_0x3bd2b7,_0x31ae17){_0x3bd2b7=_0x3bd2b7-0x0;var _0x11405c=_0x6037[_0x3bd2b7];return _0x11405c;};'use strict';var multer=require(_0x7603('0x0'));var util=require(_0x7603('0x1'));var path=require(_0x7603('0x2'));var timeout=require('connect-timeout');var express=require(_0x7603('0x3'));var router=express['Router']();var fs_extra=require(_0x7603('0x4'));var auth=require(_0x7603('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7603('0x6'));var controller=require(_0x7603('0x7'));router['get']('/',auth[_0x7603('0x8')](),controller[_0x7603('0x9')]);router[_0x7603('0xa')](_0x7603('0xb'),auth[_0x7603('0x8')](),controller[_0x7603('0xc')]);router[_0x7603('0xa')]('/:id/configurations',auth[_0x7603('0x8')](),controller['getConfigurations']);router[_0x7603('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7603('0xd')]);router[_0x7603('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7603('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7603('0xf')]);router[_0x7603('0x10')](_0x7603('0xb'),auth[_0x7603('0x8')](),controller[_0x7603('0x11')]);router['delete'](_0x7603('0xb'),auth[_0x7603('0x8')](),controller[_0x7603('0x12')]);module[_0x7603('0x13')]=router; \ No newline at end of file +var _0xe27e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/fields','getFields','post','/:id','update','delete','destroy','multer','path','connect-timeout'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xe27e,0xa8));var _0xee27=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xe27e[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xee27('0x0'));var util=require('util');var path=require(_0xee27('0x1'));var timeout=require(_0xee27('0x2'));var express=require(_0xee27('0x3'));var router=express[_0xee27('0x4')]();var fs_extra=require(_0xee27('0x5'));var auth=require(_0xee27('0x6'));var interaction=require(_0xee27('0x7'));var config=require(_0xee27('0x8'));var controller=require('./intServicenowAccount.controller');router[_0xee27('0x9')]('/',auth[_0xee27('0xa')](),controller[_0xee27('0xb')]);router[_0xee27('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xee27('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xee27('0x9')](_0xee27('0xc'),auth[_0xee27('0xa')](),controller[_0xee27('0xd')]);router[_0xee27('0xe')]('/',auth[_0xee27('0xa')](),controller['create']);router[_0xee27('0xe')]('/:id/configurations',auth[_0xee27('0xa')](),controller['addConfiguration']);router['put'](_0xee27('0xf'),auth[_0xee27('0xa')](),controller[_0xee27('0x10')]);router[_0xee27('0x11')](_0xee27('0xf'),auth[_0xee27('0xa')](),controller[_0xee27('0x12')]);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 830c27c..674166f 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 _0xb37b=['exports','STRING'];(function(_0x3171c8,_0x2e7019){var _0x5f1ee5=function(_0x316c4c){while(--_0x316c4c){_0x3171c8['push'](_0x3171c8['shift']());}};_0x5f1ee5(++_0x2e7019);}(_0xb37b,0x1e0));var _0xbb37=function(_0x5395f2,_0x5b7554){_0x5395f2=_0x5395f2-0x0;var _0x396944=_0xb37b[_0x5395f2];return _0x396944;};'use strict';var Sequelize=require('sequelize');module[_0xbb37('0x0')]={'name':{'type':Sequelize[_0xbb37('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbb37('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xbb37('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfddf=['exports','STRING','username','remoteUri','sequelize'];(function(_0x14238a,_0x1f55ce){var _0xaea795=function(_0x351cec){while(--_0x351cec){_0x14238a['push'](_0x14238a['shift']());}};_0xaea795(++_0x1f55ce);}(_0xfddf,0x167));var _0xffdd=function(_0x114cc0,_0x3132bc){_0x114cc0=_0x114cc0-0x0;var _0x3307a8=_0xfddf[_0x114cc0];return _0x3307a8;};'use strict';var Sequelize=require(_0xffdd('0x0'));module[_0xffdd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xffdd('0x2')]},'username':{'type':Sequelize[_0xffdd('0x2')],'unique':_0xffdd('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xffdd('0x2')],'unique':_0xffdd('0x4')},'serverUrl':{'type':Sequelize[_0xffdd('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 f71c6a6..3c8c6fe 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 _0x2d00=['sendStatus','end','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','ServicenowConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','hold_reason','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','notify','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','assign','includes','internalType','label','push','all','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x361627,_0x34262e){var _0x5adc0f=function(_0x465f31){while(--_0x465f31){_0x361627['push'](_0x361627['shift']());}};_0x5adc0f(++_0x34262e);}(_0x2d00,0xa9));var _0x02d0=function(_0x5b253c,_0x456461){_0x5b253c=_0x5b253c-0x0;var _0x433ba2=_0x2d00[_0x5b253c];return _0x433ba2;};'use strict';var emlformat=require(_0x02d0('0x0'));var rimraf=require(_0x02d0('0x1'));var zipdir=require(_0x02d0('0x2'));var jsonpatch=require(_0x02d0('0x3'));var rp=require(_0x02d0('0x4'));var moment=require(_0x02d0('0x5'));var BPromise=require(_0x02d0('0x6'));var Mustache=require(_0x02d0('0x7'));var util=require(_0x02d0('0x8'));var path=require(_0x02d0('0x9'));var sox=require(_0x02d0('0xa'));var csv=require(_0x02d0('0xb'));var ejs=require(_0x02d0('0xc'));var fs=require('fs');var fs_extra=require(_0x02d0('0xd'));var _=require('lodash');var squel=require(_0x02d0('0xe'));var crypto=require(_0x02d0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02d0('0xb'));var querystring=require(_0x02d0('0x10'));var Papa=require(_0x02d0('0x11'));var Redis=require(_0x02d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x02d0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02d0('0x14'));var logger=require('../../config/logger')(_0x02d0('0x15'));var utils=require(_0x02d0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x02d0('0x17'));var db=require(_0x02d0('0x18'))['db'];var integrations=require(_0x02d0('0x19'));function respondWithStatusCode(_0x47ef54,_0x3b5584){_0x3b5584=_0x3b5584||0xcc;return function(_0x752743){if(_0x752743){return _0x47ef54[_0x02d0('0x1a')](_0x3b5584);}return _0x47ef54['status'](_0x3b5584)[_0x02d0('0x1b')]();};}function respondWithResult(_0x30cb72,_0x3fa62f){_0x3fa62f=_0x3fa62f||0xc8;return function(_0x34b9e0){if(_0x34b9e0){return _0x30cb72[_0x02d0('0x1c')](_0x3fa62f)[_0x02d0('0x1d')](_0x34b9e0);}};}function respondWithFilteredResult(_0x8ff190,_0x13fd34){return function(_0x283777){if(_0x283777){var _0x4c6b75=typeof _0x13fd34['offset']==='undefined'&&typeof _0x13fd34[_0x02d0('0x1e')]===_0x02d0('0x1f');var _0x470fc2=_0x283777[_0x02d0('0x20')];var _0x5a8616=_0x4c6b75?0x0:_0x13fd34['offset'];var _0x1f1ebd=_0x4c6b75?_0x283777['count']:_0x13fd34['offset']+_0x13fd34['limit'];var _0x1b9e73;if(_0x1f1ebd>=_0x470fc2){_0x1f1ebd=_0x470fc2;_0x1b9e73=0xc8;}else{_0x1b9e73=0xce;}_0x8ff190[_0x02d0('0x1c')](_0x1b9e73);return _0x8ff190[_0x02d0('0x21')](_0x02d0('0x22'),_0x5a8616+'-'+_0x1f1ebd+'/'+_0x470fc2)[_0x02d0('0x1d')](_0x283777);}return null;};}function patchUpdates(_0xd5a0d1){return function(_0x372d2a){try{jsonpatch[_0x02d0('0x23')](_0x372d2a,_0xd5a0d1,!![]);}catch(_0x40e37f){return BPromise[_0x02d0('0x24')](_0x40e37f);}return _0x372d2a[_0x02d0('0x25')]();};}function saveUpdates(_0x1b280e,_0x346e55){return function(_0x1cf235){if(_0x1cf235){return _0x1cf235[_0x02d0('0x26')](_0x1b280e)['then'](function(_0x2b7dad){return _0x2b7dad;});}return null;};}function removeEntity(_0x40d8c4,_0x447254){return function(_0x26225b){if(_0x26225b){return _0x26225b['destroy']()[_0x02d0('0x27')](function(){_0x40d8c4[_0x02d0('0x1c')](0xcc)[_0x02d0('0x1b')]();});}};}function handleEntityNotFound(_0xbcd0a2,_0x50c48c){return function(_0x495566){if(!_0x495566){_0xbcd0a2[_0x02d0('0x1a')](0x194);}return _0x495566;};}function handleError(_0x13a2bc,_0x4475e4){_0x4475e4=_0x4475e4||0x1f4;return function(_0x1eaaf9){logger[_0x02d0('0x28')](_0x1eaaf9[_0x02d0('0x29')]);if(_0x1eaaf9[_0x02d0('0x2a')]){delete _0x1eaaf9[_0x02d0('0x2a')];}_0x13a2bc[_0x02d0('0x1c')](_0x4475e4)['send'](_0x1eaaf9);};}exports['index']=function(_0x1e2cbd,_0x4463a0){var _0x50f677={},_0x354e06={},_0xc53a59={'count':0x0,'rows':[]};var _0x27d607=_[_0x02d0('0x2b')](db[_0x02d0('0x2c')][_0x02d0('0x2d')],function(_0x54b67a){return{'name':_0x54b67a[_0x02d0('0x2e')],'type':_0x54b67a[_0x02d0('0x2f')][_0x02d0('0x30')]};});_0x354e06[_0x02d0('0x31')]=_[_0x02d0('0x2b')](_0x27d607,'name');_0x354e06[_0x02d0('0x32')]=_[_0x02d0('0x33')](_0x1e2cbd[_0x02d0('0x32')]);_0x354e06[_0x02d0('0x34')]=_[_0x02d0('0x35')](_0x354e06[_0x02d0('0x31')],_0x354e06['query']);_0x50f677[_0x02d0('0x36')]=_[_0x02d0('0x35')](_0x354e06[_0x02d0('0x31')],qs[_0x02d0('0x37')](_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x37')]));_0x50f677['attributes']=_0x50f677[_0x02d0('0x36')][_0x02d0('0x38')]?_0x50f677[_0x02d0('0x36')]:_0x354e06[_0x02d0('0x31')];if(!_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x39')](_0x02d0('0x3a'))){_0x50f677[_0x02d0('0x1e')]=qs['limit'](_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x1e')]);_0x50f677[_0x02d0('0x3b')]=qs['offset'](_0x1e2cbd[_0x02d0('0x32')]['offset']);}_0x50f677[_0x02d0('0x3c')]=qs[_0x02d0('0x3d')](_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x3d')]);_0x50f677[_0x02d0('0x3e')]=qs[_0x02d0('0x34')](_['pick'](_0x1e2cbd[_0x02d0('0x32')],_0x354e06[_0x02d0('0x34')]),_0x27d607);if(_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x3f')]){_0x50f677[_0x02d0('0x3e')]=_['merge'](_0x50f677[_0x02d0('0x3e')],{'$or':_['map'](_0x27d607,function(_0x21c9db){if(_0x21c9db[_0x02d0('0x2f')]!==_0x02d0('0x40')){var _0x5e26ee={};_0x5e26ee[_0x21c9db['name']]={'$like':'%'+_0x1e2cbd[_0x02d0('0x32')][_0x02d0('0x3f')]+'%'};return _0x5e26ee;}})});}_0x50f677=_[_0x02d0('0x41')]({},_0x50f677,_0x1e2cbd[_0x02d0('0x42')]);var _0x5737b8={'where':_0x50f677[_0x02d0('0x3e')]};return db[_0x02d0('0x2c')][_0x02d0('0x20')](_0x5737b8)[_0x02d0('0x27')](function(_0xf7be18){_0xc53a59[_0x02d0('0x20')]=_0xf7be18;if(_0x1e2cbd['query']['includeAll']){_0x50f677[_0x02d0('0x43')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x02d0('0x44')](_0x50f677);})[_0x02d0('0x27')](function(_0xd4e746){_0xc53a59[_0x02d0('0x45')]=_0xd4e746;return _0xc53a59;})['then'](respondWithFilteredResult(_0x4463a0,_0x50f677))[_0x02d0('0x46')](handleError(_0x4463a0,null));};exports['show']=function(_0x25308d,_0x5628e0){var _0x2e1ff3={'raw':![],'where':{'id':_0x25308d[_0x02d0('0x47')]['id']}},_0x28f882={};_0x28f882['model']=_[_0x02d0('0x33')](db[_0x02d0('0x2c')]['rawAttributes']);_0x28f882[_0x02d0('0x32')]=_[_0x02d0('0x33')](_0x25308d[_0x02d0('0x32')]);_0x28f882['filters']=_[_0x02d0('0x35')](_0x28f882[_0x02d0('0x31')],_0x28f882[_0x02d0('0x32')]);_0x2e1ff3[_0x02d0('0x36')]=_['intersection'](_0x28f882[_0x02d0('0x31')],qs['fields'](_0x25308d[_0x02d0('0x32')][_0x02d0('0x37')]));_0x2e1ff3[_0x02d0('0x36')]=_0x2e1ff3[_0x02d0('0x36')][_0x02d0('0x38')]?_0x2e1ff3['attributes']:_0x28f882['model'];if(_0x25308d[_0x02d0('0x32')][_0x02d0('0x48')]){_0x2e1ff3[_0x02d0('0x43')]=[{'all':!![]}];}_0x2e1ff3=_['merge']({},_0x2e1ff3,_0x25308d[_0x02d0('0x42')]);return db[_0x02d0('0x2c')][_0x02d0('0x49')](_0x2e1ff3)[_0x02d0('0x27')](handleEntityNotFound(_0x5628e0,null))['then'](respondWithResult(_0x5628e0,null))['catch'](handleError(_0x5628e0,null));};exports[_0x02d0('0x4a')]=function(_0x4ab822,_0x5414d8){return db[_0x02d0('0x2c')][_0x02d0('0x4a')](_0x4ab822['body'],{})['then'](respondWithResult(_0x5414d8,0xc9))['catch'](handleError(_0x5414d8,null));};exports['update']=function(_0x3aa839,_0x1e0cfa){if(_0x3aa839[_0x02d0('0x4b')]['id']){delete _0x3aa839[_0x02d0('0x4b')]['id'];}return db['ServicenowAccount'][_0x02d0('0x49')]({'where':{'id':_0x3aa839[_0x02d0('0x47')]['id']}})[_0x02d0('0x27')](handleEntityNotFound(_0x1e0cfa,null))[_0x02d0('0x27')](saveUpdates(_0x3aa839[_0x02d0('0x4b')],null))[_0x02d0('0x27')](respondWithResult(_0x1e0cfa,null))['catch'](handleError(_0x1e0cfa,null));};exports[_0x02d0('0x4c')]=function(_0x1349b1,_0x20b3ec){return db[_0x02d0('0x2c')][_0x02d0('0x49')]({'where':{'id':_0x1349b1[_0x02d0('0x47')]['id']}})[_0x02d0('0x27')](handleEntityNotFound(_0x20b3ec,null))['then'](removeEntity(_0x20b3ec,null))[_0x02d0('0x46')](handleError(_0x20b3ec,null));};exports['getConfigurations']=function(_0x191445,_0x59ffeb,_0x17d6ad){var _0x76e6d={};var _0x63b7a2={};var _0x50a388;var _0x59bfcc;return db[_0x02d0('0x2c')]['findOne']({'where':{'id':_0x191445[_0x02d0('0x47')]['id']}})[_0x02d0('0x27')](handleEntityNotFound(_0x59ffeb,null))['then'](function(_0x2a968e){if(_0x2a968e){_0x50a388=_0x2a968e;_0x63b7a2[_0x02d0('0x31')]=_['keys'](db[_0x02d0('0x4d')][_0x02d0('0x2d')]);_0x63b7a2['query']=_[_0x02d0('0x33')](_0x191445[_0x02d0('0x32')]);_0x63b7a2[_0x02d0('0x34')]=_['intersection'](_0x63b7a2['model'],_0x63b7a2[_0x02d0('0x32')]);_0x76e6d[_0x02d0('0x36')]=_['intersection'](_0x63b7a2[_0x02d0('0x31')],qs[_0x02d0('0x37')](_0x191445[_0x02d0('0x32')][_0x02d0('0x37')]));_0x76e6d['attributes']=_0x76e6d[_0x02d0('0x36')][_0x02d0('0x38')]?_0x76e6d[_0x02d0('0x36')]:_0x63b7a2['model'];_0x76e6d[_0x02d0('0x3c')]=qs[_0x02d0('0x3d')](_0x191445[_0x02d0('0x32')][_0x02d0('0x3d')]);_0x76e6d['where']=qs[_0x02d0('0x34')](_[_0x02d0('0x4e')](_0x191445['query'],_0x63b7a2['filters']));if(_0x191445[_0x02d0('0x32')]['filter']){_0x76e6d[_0x02d0('0x3e')]=_['merge'](_0x76e6d['where'],{'$or':_[_0x02d0('0x2b')](_0x76e6d[_0x02d0('0x36')],function(_0x240415){var _0x1d60c4={};_0x1d60c4[_0x240415]={'$like':'%'+_0x191445[_0x02d0('0x32')][_0x02d0('0x3f')]+'%'};return _0x1d60c4;})});}_0x76e6d=_[_0x02d0('0x41')]({},_0x76e6d,_0x191445[_0x02d0('0x42')]);return _0x50a388['getConfigurations'](_0x76e6d);}})[_0x02d0('0x27')](function(_0x57a44d){if(_0x57a44d){_0x59bfcc=_0x57a44d[_0x02d0('0x38')];if(!_0x191445['query'][_0x02d0('0x39')](_0x02d0('0x3a'))){_0x76e6d[_0x02d0('0x1e')]=qs[_0x02d0('0x1e')](_0x191445[_0x02d0('0x32')]['limit']);_0x76e6d[_0x02d0('0x3b')]=qs['offset'](_0x191445[_0x02d0('0x32')][_0x02d0('0x3b')]);}return _0x50a388['getConfigurations'](_0x76e6d);}})[_0x02d0('0x27')](function(_0x4cce12){if(_0x4cce12){return _0x4cce12?{'count':_0x59bfcc,'rows':_0x4cce12}:null;}})[_0x02d0('0x27')](respondWithResult(_0x59ffeb,null))['catch'](handleError(_0x59ffeb,null));};exports[_0x02d0('0x4f')]=function(_0x3a88da,_0x26f690,_0x206ba7){if(_0x3a88da[_0x02d0('0x4b')]['id']){delete _0x3a88da[_0x02d0('0x4b')]['id'];}return db[_0x02d0('0x2c')][_0x02d0('0x50')]({'where':{'id':_0x3a88da[_0x02d0('0x47')]['id']}})['then'](handleEntityNotFound(_0x26f690,null))[_0x02d0('0x27')](function(_0xfffc0c){if(_0xfffc0c){_0x3a88da['body'][_0x02d0('0x51')]=_0xfffc0c['id'];_0x3a88da[_0x02d0('0x4b')][_0x02d0('0x52')]=integrations[_0x02d0('0x53')](_0x3a88da[_0x02d0('0x4b')][_0x02d0('0x54')],_0x3a88da['body'][_0x02d0('0x2f')]);_0x3a88da['body'][_0x02d0('0x55')]=integrations[_0x02d0('0x56')](_0x3a88da[_0x02d0('0x4b')][_0x02d0('0x54')],_0x3a88da[_0x02d0('0x4b')][_0x02d0('0x2f')]);return db['ServicenowConfiguration']['create'](_0x3a88da[_0x02d0('0x4b')],{'include':[{'model':db[_0x02d0('0x57')],'as':_0x02d0('0x52')},{'model':db['ServicenowField'],'as':_0x02d0('0x55')}]});}return null;})[_0x02d0('0x27')](respondWithResult(_0x26f690,null))[_0x02d0('0x46')](handleError(_0x26f690,null));};exports[_0x02d0('0x58')]=function(_0x118a77,_0x5d045d,_0x34ffd4){var _0xa36d2d=[_0x02d0('0x59'),'hold_reason',_0x02d0('0x5a'),_0x02d0('0x5b'),_0x02d0('0x5c'),'notify',_0x02d0('0x5d'),'severity',_0x02d0('0x5e')];var _0x4008ab=[_0x02d0('0x5f'),_0x02d0('0x59'),_0x02d0('0x60'),_0x02d0('0x61'),_0x02d0('0x62'),'sys_updated_on',_0x02d0('0x63'),_0x02d0('0x64'),_0x02d0('0x65'),'number',_0x02d0('0x66'),_0x02d0('0x67'),_0x02d0('0x68'),_0x02d0('0x69'),_0x02d0('0x6a'),'sys_domain',_0x02d0('0x6b'),_0x02d0('0x6c'),_0x02d0('0x5a'),_0x02d0('0x3c'),_0x02d0('0x6d'),_0x02d0('0x6e'),_0x02d0('0x6f'),_0x02d0('0x70'),_0x02d0('0x71'),_0x02d0('0x72'),_0x02d0('0x73'),_0x02d0('0x74'),_0x02d0('0x75'),_0x02d0('0x76'),_0x02d0('0x77'),_0x02d0('0x78'),_0x02d0('0x79'),_0x02d0('0x7a'),_0x02d0('0x7b'),_0x02d0('0x7c'),_0x02d0('0x7d'),_0x02d0('0x7e'),'resolved_at','caller_id',_0x02d0('0x7f'),'subcategory',_0x02d0('0x80'),_0x02d0('0x81'),_0x02d0('0x5c'),'correlation_display',_0x02d0('0x82'),_0x02d0('0x83'),_0x02d0('0x84'),_0x02d0('0x85'),_0x02d0('0x86'),_0x02d0('0x87'),'calendar_duration',_0x02d0('0x88'),'sys_class_name',_0x02d0('0x89'),_0x02d0('0x8a'),_0x02d0('0x8b'),_0x02d0('0x8c'),_0x02d0('0x8d'),_0x02d0('0x8e'),_0x02d0('0x8f'),_0x02d0('0x5d'),'urgency',_0x02d0('0x90'),_0x02d0('0x91'),_0x02d0('0x92'),_0x02d0('0x93'),'assigned_to',_0x02d0('0x94'),_0x02d0('0x95'),'sla_due',_0x02d0('0x96'),_0x02d0('0x97'),_0x02d0('0x98'),_0x02d0('0x99'),_0x02d0('0x9a'),_0x02d0('0x9b'),_0x02d0('0x9c'),'upon_approval','correlation_id',_0x02d0('0x9d'),'category'];var _0x16a5b3='';var _0x461647='';var _0x39c24d=[];var _0x44866d='';var _0xa763f8='';var _0x13a345=[];var _0x1eb53f='';var _0x31b013='';var _0x36e985={};var _0x63e8b='';return db[_0x02d0('0x2c')][_0x02d0('0x50')]({'where':{'id':_0x118a77[_0x02d0('0x47')]['id']},'attributes':['id',_0x02d0('0x9e'),'password',_0x02d0('0x9f'),_0x02d0('0xa0'),_0x02d0('0xa1')]})[_0x02d0('0x27')](handleEntityNotFound(_0x5d045d,null))[_0x02d0('0x27')](function(_0x5afe62){if(_0x5afe62){_0x63e8b=_0x5afe62[_0x02d0('0xa0')];var _0x5b054f=_0x63e8b['slice'](-0x1);if(_0x5b054f==='/'){_0x63e8b=_0x63e8b[_0x02d0('0xa2')](0x0,_0x63e8b[_0x02d0('0xa3')](_0x5b054f));}_0x31b013=util[_0x02d0('0xa4')](_0x02d0('0xa5'),_0x63e8b);_0x1eb53f=util[_0x02d0('0xa4')](_0x02d0('0xa6'),_0x63e8b);_0x36e985={'user':_0x5afe62['username'],'pass':_0x5afe62[_0x02d0('0xa7')]};var _0x3f5fb0={'method':_0x02d0('0xa8'),'uri':_0x31b013+'incident?sysparm_display_value=all','auth':_0x36e985,'json':!![]};return rp(_0x3f5fb0);}})[_0x02d0('0x27')](function(_0x27fd93){if(_0x27fd93[_0x02d0('0xa9')][_0x02d0('0x38')]>0x0){_0x16a5b3=_0x27fd93[_0x02d0('0xa9')];}console[_0x02d0('0xaa')](_0x02d0('0xab'),_0x16a5b3);_0x13a345=[];_0x461647=Object[_0x02d0('0xac')]([],_0x16a5b3);_['remove'](_0x461647,function(_0x545384){return!_0xa36d2d[_0x02d0('0xad')](_0x545384['name']);});_0x461647['forEach'](function(_0x231193){var _0x2daff0=createFieldObject(_0x1eb53f,_0x36e985,_0x231193[_0x02d0('0xae')],_0x231193['name'],_0x231193[_0x02d0('0xaf')],![]);_0x13a345[_0x02d0('0xb0')](_0x2daff0);});return Promise[_0x02d0('0xb1')](_0x13a345);})[_0x02d0('0x27')](function(_0x2c6943){_0x39c24d=_0x2c6943;_0x44866d=Object['assign']([],_0x16a5b3);console[_0x02d0('0xaa')]('TCL:\x20_object',_0x16a5b3);_[_0x02d0('0xb2')](_0x44866d,function(_0x5de5cb){return _0x4008ab['includes'](_0x5de5cb[_0x02d0('0x2a')]);});console[_0x02d0('0xaa')](_0x02d0('0xb3'),_0x44866d);_0x13a345=[];_0x44866d[_0x02d0('0xb4')](function(_0xe67cf4){var _0xfcbfa=createFieldObject(_0x1eb53f,_0x36e985,_0xe67cf4[_0x02d0('0xae')],_0xe67cf4[_0x02d0('0x2a')],_0xe67cf4[_0x02d0('0xaf')],!![]);_0x13a345['push'](_0xfcbfa);});return Promise[_0x02d0('0xb1')](_0x13a345);})[_0x02d0('0x27')](function(_0x4170f6){_0xa763f8=_0x4170f6;var _0x4177a5=_0x39c24d[_0x02d0('0xb5')](_0xa763f8);return{'count':_0x4177a5[_0x02d0('0x38')],'rows':_0x4177a5};})[_0x02d0('0x27')](respondWithResult(_0x5d045d,null))['catch'](function(_0x2bdc59){console['log'](_0x02d0('0xb6')+_0x2bdc59);var _0x112240=_0x118a77[_0x02d0('0x32')][_0x02d0('0xb7')]?0x1f4:_0x2bdc59[_0x02d0('0xb8')]||0x1f4;logger['error'](_0x2bdc59[_0x02d0('0x29')]);delete _0x2bdc59[_0x02d0('0x2a')];if(_0x112240===0x191){_0x112240=0x190;}_0x5d045d['status'](_0x112240)[_0x02d0('0xb9')](_0x118a77[_0x02d0('0x32')][_0x02d0('0xb7')]?{'message':_0x02d0('0xba'),'statusCode':_0x2bdc59[_0x02d0('0xb8')]}:_0x2bdc59);});};function createFieldObject(_0x340cea,_0x535f7a,_0xf9bbcb,_0xb6e516,_0x539f4c,_0x46c53f){return new Promise(function(_0x2296f1,_0x5abb8f){var _0x957840={'id':_0xb6e516,'name':_0x539f4c,'custom':_0x46c53f};if(_0xf9bbcb===_0x02d0('0xbb')){_0x957840[_0x02d0('0x42')]=[{'name':_0x02d0('0xbc'),'value':_0x02d0('0xbd')},{'name':_0x02d0('0xbe'),'value':_0x02d0('0xbf')}];_0x2296f1(_0x957840);}else{var _0xcd9be9={'method':_0x02d0('0xa8'),'uri':_0x340cea+_0x02d0('0xc0')+_0xb6e516,'auth':_0x535f7a,'json':!![]};return rp(_0xcd9be9)[_0x02d0('0x27')](function(_0x2c816c){var _0x4c431f=[];if(_0x2c816c[_0x02d0('0xa9')][_0x02d0('0x38')]>0x0){_0x2c816c[_0x02d0('0xa9')][_0x02d0('0xb4')](function(_0x20f845){if(_0x20f845[_0x02d0('0xc1')]===_0x02d0('0xbf')){var _0x3441a8={'name':_0x20f845[_0x02d0('0xaf')],'value':_0x20f845[_0x02d0('0xc2')]};_0x4c431f[_0x02d0('0xb0')](_0x3441a8);}});}_0x957840[_0x02d0('0x42')]=_0x4c431f;if(_0x957840['options'][_0x02d0('0x38')]>0x0){_0x2296f1(_0x957840);}else{if(_0x46c53f==![]){_0x2296f1();}else{_0x2296f1(_0x957840);}}});}});} \ No newline at end of file +var _0xb3dd=['delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','comments','sla_due','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ServicenowAccount','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','update','getConfigurations','findOne','AccountId','Subjects','channel','type','Descriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','knowledge','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','impact','active','business_service','priority','sys_domain_path','rfc','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','subcategory','work_notes','close_code','correlation_display'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xb3dd,0xfd));var _0xdb3d=function(_0xb00c5f,_0x4d5bba){_0xb00c5f=_0xb00c5f-0x0;var _0x2135d4=_0xb3dd[_0xb00c5f];return _0x2135d4;};'use strict';var emlformat=require(_0xdb3d('0x0'));var rimraf=require(_0xdb3d('0x1'));var zipdir=require(_0xdb3d('0x2'));var jsonpatch=require(_0xdb3d('0x3'));var rp=require(_0xdb3d('0x4'));var moment=require(_0xdb3d('0x5'));var BPromise=require(_0xdb3d('0x6'));var Mustache=require(_0xdb3d('0x7'));var util=require(_0xdb3d('0x8'));var path=require(_0xdb3d('0x9'));var sox=require(_0xdb3d('0xa'));var csv=require(_0xdb3d('0xb'));var ejs=require(_0xdb3d('0xc'));var fs=require('fs');var fs_extra=require(_0xdb3d('0xd'));var _=require(_0xdb3d('0xe'));var squel=require(_0xdb3d('0xf'));var crypto=require(_0xdb3d('0x10'));var jsforce=require(_0xdb3d('0x11'));var deskjs=require(_0xdb3d('0x12'));var toCsv=require('to-csv');var querystring=require(_0xdb3d('0x13'));var Papa=require(_0xdb3d('0x14'));var Redis=require(_0xdb3d('0x15'));var authService=require(_0xdb3d('0x16'));var qs=require(_0xdb3d('0x17'));var as=require(_0xdb3d('0x18'));var hardwareService=require(_0xdb3d('0x19'));var logger=require(_0xdb3d('0x1a'))(_0xdb3d('0x1b'));var utils=require(_0xdb3d('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0xdb3d('0x1d'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4d8eb4,_0x2d2203){_0x2d2203=_0x2d2203||0xcc;return function(_0x4d10cf){if(_0x4d10cf){return _0x4d8eb4[_0xdb3d('0x1e')](_0x2d2203);}return _0x4d8eb4['status'](_0x2d2203)[_0xdb3d('0x1f')]();};}function respondWithResult(_0x165c97,_0x499d50){_0x499d50=_0x499d50||0xc8;return function(_0x158d1e){if(_0x158d1e){return _0x165c97[_0xdb3d('0x20')](_0x499d50)['json'](_0x158d1e);}};}function respondWithFilteredResult(_0x183a71,_0x317fd9){return function(_0x375189){if(_0x375189){var _0x428254=typeof _0x317fd9[_0xdb3d('0x21')]===_0xdb3d('0x22')&&typeof _0x317fd9[_0xdb3d('0x23')]===_0xdb3d('0x22');var _0x5b38d8=_0x375189[_0xdb3d('0x24')];var _0x4c09ab=_0x428254?0x0:_0x317fd9[_0xdb3d('0x21')];var _0x58af3d=_0x428254?_0x375189['count']:_0x317fd9[_0xdb3d('0x21')]+_0x317fd9['limit'];var _0x30563a;if(_0x58af3d>=_0x5b38d8){_0x58af3d=_0x5b38d8;_0x30563a=0xc8;}else{_0x30563a=0xce;}_0x183a71['status'](_0x30563a);return _0x183a71['set'](_0xdb3d('0x25'),_0x4c09ab+'-'+_0x58af3d+'/'+_0x5b38d8)[_0xdb3d('0x26')](_0x375189);}return null;};}function patchUpdates(_0x344a5a){return function(_0x3f6d33){try{jsonpatch[_0xdb3d('0x27')](_0x3f6d33,_0x344a5a,!![]);}catch(_0xe14dbd){return BPromise[_0xdb3d('0x28')](_0xe14dbd);}return _0x3f6d33[_0xdb3d('0x29')]();};}function saveUpdates(_0x3bf48a,_0xe526d1){return function(_0x1ea370){if(_0x1ea370){return _0x1ea370['update'](_0x3bf48a)[_0xdb3d('0x2a')](function(_0x4e0f90){return _0x4e0f90;});}return null;};}function removeEntity(_0x3f95c6,_0x35aead){return function(_0x293023){if(_0x293023){return _0x293023[_0xdb3d('0x2b')]()[_0xdb3d('0x2a')](function(){_0x3f95c6[_0xdb3d('0x20')](0xcc)[_0xdb3d('0x1f')]();});}};}function handleEntityNotFound(_0x290953,_0x256794){return function(_0x1bc2c4){if(!_0x1bc2c4){_0x290953[_0xdb3d('0x1e')](0x194);}return _0x1bc2c4;};}function handleError(_0x319483,_0x385d34){_0x385d34=_0x385d34||0x1f4;return function(_0x33899d){logger[_0xdb3d('0x2c')](_0x33899d[_0xdb3d('0x2d')]);if(_0x33899d[_0xdb3d('0x2e')]){delete _0x33899d[_0xdb3d('0x2e')];}_0x319483[_0xdb3d('0x20')](_0x385d34)[_0xdb3d('0x2f')](_0x33899d);};}exports[_0xdb3d('0x30')]=function(_0x117356,_0x29c57e){var _0x42d8d6={},_0x1a55d6={},_0x36e015={'count':0x0,'rows':[]};var _0x3aac70=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0x22398e){return{'name':_0x22398e['fieldName'],'type':_0x22398e['type'][_0xdb3d('0x31')]};});_0x1a55d6[_0xdb3d('0x32')]=_[_0xdb3d('0x33')](_0x3aac70,_0xdb3d('0x2e'));_0x1a55d6[_0xdb3d('0x34')]=_[_0xdb3d('0x35')](_0x117356[_0xdb3d('0x34')]);_0x1a55d6[_0xdb3d('0x36')]=_[_0xdb3d('0x37')](_0x1a55d6[_0xdb3d('0x32')],_0x1a55d6[_0xdb3d('0x34')]);_0x42d8d6[_0xdb3d('0x38')]=_[_0xdb3d('0x37')](_0x1a55d6[_0xdb3d('0x32')],qs[_0xdb3d('0x39')](_0x117356[_0xdb3d('0x34')][_0xdb3d('0x39')]));_0x42d8d6['attributes']=_0x42d8d6[_0xdb3d('0x38')][_0xdb3d('0x3a')]?_0x42d8d6[_0xdb3d('0x38')]:_0x1a55d6[_0xdb3d('0x32')];if(!_0x117356[_0xdb3d('0x34')][_0xdb3d('0x3b')](_0xdb3d('0x3c'))){_0x42d8d6['limit']=qs[_0xdb3d('0x23')](_0x117356[_0xdb3d('0x34')][_0xdb3d('0x23')]);_0x42d8d6[_0xdb3d('0x21')]=qs['offset'](_0x117356[_0xdb3d('0x34')][_0xdb3d('0x21')]);}_0x42d8d6[_0xdb3d('0x3d')]=qs[_0xdb3d('0x3e')](_0x117356[_0xdb3d('0x34')][_0xdb3d('0x3e')]);_0x42d8d6[_0xdb3d('0x3f')]=qs[_0xdb3d('0x36')](_[_0xdb3d('0x40')](_0x117356[_0xdb3d('0x34')],_0x1a55d6[_0xdb3d('0x36')]),_0x3aac70);if(_0x117356['query']['filter']){_0x42d8d6[_0xdb3d('0x3f')]=_[_0xdb3d('0x41')](_0x42d8d6[_0xdb3d('0x3f')],{'$or':_[_0xdb3d('0x33')](_0x3aac70,function(_0x49f3da){if(_0x49f3da['type']!==_0xdb3d('0x42')){var _0x47f5d5={};_0x47f5d5[_0x49f3da['name']]={'$like':'%'+_0x117356[_0xdb3d('0x34')][_0xdb3d('0x43')]+'%'};return _0x47f5d5;}})});}_0x42d8d6=_[_0xdb3d('0x41')]({},_0x42d8d6,_0x117356[_0xdb3d('0x44')]);var _0x1d8e92={'where':_0x42d8d6[_0xdb3d('0x3f')]};return db[_0xdb3d('0x45')]['count'](_0x1d8e92)['then'](function(_0x2c07b9){_0x36e015['count']=_0x2c07b9;if(_0x117356[_0xdb3d('0x34')]['includeAll']){_0x42d8d6['include']=[{'all':!![]}];}return db[_0xdb3d('0x45')][_0xdb3d('0x46')](_0x42d8d6);})[_0xdb3d('0x2a')](function(_0x80fd6b){_0x36e015[_0xdb3d('0x47')]=_0x80fd6b;return _0x36e015;})['then'](respondWithFilteredResult(_0x29c57e,_0x42d8d6))[_0xdb3d('0x48')](handleError(_0x29c57e,null));};exports[_0xdb3d('0x49')]=function(_0x5b2be9,_0x1c6440){var _0x29059f={'raw':![],'where':{'id':_0x5b2be9[_0xdb3d('0x4a')]['id']}},_0x25c76a={};_0x25c76a[_0xdb3d('0x32')]=_[_0xdb3d('0x35')](db['ServicenowAccount'][_0xdb3d('0x4b')]);_0x25c76a[_0xdb3d('0x34')]=_[_0xdb3d('0x35')](_0x5b2be9[_0xdb3d('0x34')]);_0x25c76a[_0xdb3d('0x36')]=_[_0xdb3d('0x37')](_0x25c76a[_0xdb3d('0x32')],_0x25c76a[_0xdb3d('0x34')]);_0x29059f['attributes']=_[_0xdb3d('0x37')](_0x25c76a[_0xdb3d('0x32')],qs[_0xdb3d('0x39')](_0x5b2be9[_0xdb3d('0x34')][_0xdb3d('0x39')]));_0x29059f[_0xdb3d('0x38')]=_0x29059f['attributes']['length']?_0x29059f[_0xdb3d('0x38')]:_0x25c76a[_0xdb3d('0x32')];if(_0x5b2be9[_0xdb3d('0x34')][_0xdb3d('0x4c')]){_0x29059f[_0xdb3d('0x4d')]=[{'all':!![]}];}_0x29059f=_[_0xdb3d('0x41')]({},_0x29059f,_0x5b2be9['options']);return db['ServicenowAccount'][_0xdb3d('0x4e')](_0x29059f)[_0xdb3d('0x2a')](handleEntityNotFound(_0x1c6440,null))[_0xdb3d('0x2a')](respondWithResult(_0x1c6440,null))[_0xdb3d('0x48')](handleError(_0x1c6440,null));};exports[_0xdb3d('0x4f')]=function(_0x132893,_0x2d8ac2){return db['ServicenowAccount'][_0xdb3d('0x4f')](_0x132893[_0xdb3d('0x50')],{})[_0xdb3d('0x2a')](respondWithResult(_0x2d8ac2,0xc9))[_0xdb3d('0x48')](handleError(_0x2d8ac2,null));};exports[_0xdb3d('0x51')]=function(_0x208002,_0x2904aa){if(_0x208002[_0xdb3d('0x50')]['id']){delete _0x208002[_0xdb3d('0x50')]['id'];}return db['ServicenowAccount'][_0xdb3d('0x4e')]({'where':{'id':_0x208002[_0xdb3d('0x4a')]['id']}})[_0xdb3d('0x2a')](handleEntityNotFound(_0x2904aa,null))[_0xdb3d('0x2a')](saveUpdates(_0x208002[_0xdb3d('0x50')],null))[_0xdb3d('0x2a')](respondWithResult(_0x2904aa,null))[_0xdb3d('0x48')](handleError(_0x2904aa,null));};exports[_0xdb3d('0x2b')]=function(_0x1278c5,_0x1a2a0c){return db[_0xdb3d('0x45')]['find']({'where':{'id':_0x1278c5['params']['id']}})[_0xdb3d('0x2a')](handleEntityNotFound(_0x1a2a0c,null))[_0xdb3d('0x2a')](removeEntity(_0x1a2a0c,null))[_0xdb3d('0x48')](handleError(_0x1a2a0c,null));};exports[_0xdb3d('0x52')]=function(_0x4c0f52,_0x31ed59,_0x464a90){var _0x81c854={};var _0x2f56bc={};var _0x14b1ee;var _0x10814c;return db['ServicenowAccount'][_0xdb3d('0x53')]({'where':{'id':_0x4c0f52[_0xdb3d('0x4a')]['id']}})[_0xdb3d('0x2a')](handleEntityNotFound(_0x31ed59,null))[_0xdb3d('0x2a')](function(_0x352b7f){if(_0x352b7f){_0x14b1ee=_0x352b7f;_0x2f56bc[_0xdb3d('0x32')]=_[_0xdb3d('0x35')](db['ServicenowConfiguration'][_0xdb3d('0x4b')]);_0x2f56bc['query']=_[_0xdb3d('0x35')](_0x4c0f52[_0xdb3d('0x34')]);_0x2f56bc['filters']=_[_0xdb3d('0x37')](_0x2f56bc[_0xdb3d('0x32')],_0x2f56bc[_0xdb3d('0x34')]);_0x81c854[_0xdb3d('0x38')]=_['intersection'](_0x2f56bc['model'],qs[_0xdb3d('0x39')](_0x4c0f52[_0xdb3d('0x34')][_0xdb3d('0x39')]));_0x81c854[_0xdb3d('0x38')]=_0x81c854[_0xdb3d('0x38')][_0xdb3d('0x3a')]?_0x81c854[_0xdb3d('0x38')]:_0x2f56bc[_0xdb3d('0x32')];_0x81c854[_0xdb3d('0x3d')]=qs[_0xdb3d('0x3e')](_0x4c0f52[_0xdb3d('0x34')]['sort']);_0x81c854['where']=qs['filters'](_[_0xdb3d('0x40')](_0x4c0f52[_0xdb3d('0x34')],_0x2f56bc[_0xdb3d('0x36')]));if(_0x4c0f52[_0xdb3d('0x34')]['filter']){_0x81c854['where']=_[_0xdb3d('0x41')](_0x81c854[_0xdb3d('0x3f')],{'$or':_['map'](_0x81c854[_0xdb3d('0x38')],function(_0x5b0646){var _0x5d1910={};_0x5d1910[_0x5b0646]={'$like':'%'+_0x4c0f52[_0xdb3d('0x34')][_0xdb3d('0x43')]+'%'};return _0x5d1910;})});}_0x81c854=_[_0xdb3d('0x41')]({},_0x81c854,_0x4c0f52[_0xdb3d('0x44')]);return _0x14b1ee[_0xdb3d('0x52')](_0x81c854);}})['then'](function(_0x24a45f){if(_0x24a45f){_0x10814c=_0x24a45f[_0xdb3d('0x3a')];if(!_0x4c0f52[_0xdb3d('0x34')][_0xdb3d('0x3b')](_0xdb3d('0x3c'))){_0x81c854['limit']=qs[_0xdb3d('0x23')](_0x4c0f52[_0xdb3d('0x34')]['limit']);_0x81c854[_0xdb3d('0x21')]=qs[_0xdb3d('0x21')](_0x4c0f52[_0xdb3d('0x34')][_0xdb3d('0x21')]);}return _0x14b1ee[_0xdb3d('0x52')](_0x81c854);}})[_0xdb3d('0x2a')](function(_0x1b82e6){if(_0x1b82e6){return _0x1b82e6?{'count':_0x10814c,'rows':_0x1b82e6}:null;}})['then'](respondWithResult(_0x31ed59,null))[_0xdb3d('0x48')](handleError(_0x31ed59,null));};exports['addConfiguration']=function(_0x5c2e73,_0x3e89bc,_0x1c9675){if(_0x5c2e73[_0xdb3d('0x50')]['id']){delete _0x5c2e73[_0xdb3d('0x50')]['id'];}return db[_0xdb3d('0x45')]['findOne']({'where':{'id':_0x5c2e73[_0xdb3d('0x4a')]['id']}})[_0xdb3d('0x2a')](handleEntityNotFound(_0x3e89bc,null))[_0xdb3d('0x2a')](function(_0x41754d){if(_0x41754d){_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x54')]=_0x41754d['id'];_0x5c2e73['body'][_0xdb3d('0x55')]=integrations['getSubjects'](_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x56')],_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x57')]);_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x58')]=integrations['getDescriptions'](_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x56')],_0x5c2e73[_0xdb3d('0x50')][_0xdb3d('0x57')]);return db[_0xdb3d('0x59')][_0xdb3d('0x4f')](_0x5c2e73['body'],{'include':[{'model':db[_0xdb3d('0x5a')],'as':_0xdb3d('0x55')},{'model':db[_0xdb3d('0x5a')],'as':_0xdb3d('0x58')}]});}return null;})[_0xdb3d('0x2a')](respondWithResult(_0x3e89bc,null))['catch'](handleError(_0x3e89bc,null));};exports[_0xdb3d('0x5b')]=function(_0x2cac71,_0x4d7db9,_0x3084bf){var _0x5676d6=[_0xdb3d('0x5c'),'hold_reason',_0xdb3d('0x5d'),'subcategory','close_code',_0xdb3d('0x5e'),_0xdb3d('0x5f'),_0xdb3d('0x60'),_0xdb3d('0x61')];var _0x20d46a=[_0xdb3d('0x62'),_0xdb3d('0x5c'),_0xdb3d('0x63'),_0xdb3d('0x64'),_0xdb3d('0x65'),_0xdb3d('0x66'),'child_incidents',_0xdb3d('0x67'),_0xdb3d('0x68'),_0xdb3d('0x69'),_0xdb3d('0x6a'),_0xdb3d('0x6b'),_0xdb3d('0x6c'),_0xdb3d('0x6d'),_0xdb3d('0x6e'),'sys_domain',_0xdb3d('0x6f'),_0xdb3d('0x70'),_0xdb3d('0x5d'),_0xdb3d('0x3d'),'calendar_stc',_0xdb3d('0x71'),_0xdb3d('0x72'),'delivery_plan',_0xdb3d('0x73'),_0xdb3d('0x74'),'work_notes_list',_0xdb3d('0x75'),_0xdb3d('0x76'),_0xdb3d('0x77'),_0xdb3d('0x78'),'time_worked','expected_start',_0xdb3d('0x79'),_0xdb3d('0x7a'),'group_list',_0xdb3d('0x7b'),_0xdb3d('0x7c'),_0xdb3d('0x7d'),_0xdb3d('0x7e'),'approval_set',_0xdb3d('0x7f'),_0xdb3d('0x80'),'short_description',_0xdb3d('0x81'),_0xdb3d('0x82'),_0xdb3d('0x83'),_0xdb3d('0x84'),_0xdb3d('0x85'),_0xdb3d('0x86'),'additional_assignee_list',_0xdb3d('0x87'),_0xdb3d('0x88'),_0xdb3d('0x5e'),_0xdb3d('0x89'),_0xdb3d('0x8a'),_0xdb3d('0x8b'),'follow_up',_0xdb3d('0x8c'),_0xdb3d('0x8d'),_0xdb3d('0x8e'),_0xdb3d('0x8f'),_0xdb3d('0x5f'),_0xdb3d('0x90'),'problem_id',_0xdb3d('0x91'),_0xdb3d('0x92'),_0xdb3d('0x93'),'assigned_to',_0xdb3d('0x60'),_0xdb3d('0x94'),_0xdb3d('0x95'),'approval',_0xdb3d('0x96'),'due_date',_0xdb3d('0x97'),_0xdb3d('0x98'),'sys_tags',_0xdb3d('0x99'),_0xdb3d('0x9a'),_0xdb3d('0x9b'),_0xdb3d('0x9c'),_0xdb3d('0x61')];var _0x3859bc='';var _0x3da5db='';var _0x1976d6=[];var _0x1ac012='';var _0x500f18='';var _0x55955f=[];var _0x430043='';var _0x4f3045='';var _0x19cca1={};var _0x513810='';return db[_0xdb3d('0x45')][_0xdb3d('0x53')]({'where':{'id':_0x2cac71['params']['id']},'attributes':['id',_0xdb3d('0x9d'),'password',_0xdb3d('0x9e'),_0xdb3d('0x9f'),_0xdb3d('0xa0')]})['then'](handleEntityNotFound(_0x4d7db9,null))[_0xdb3d('0x2a')](function(_0x1cb05c){if(_0x1cb05c){_0x513810=_0x1cb05c['remoteUri'];var _0x1e1ee9=_0x513810[_0xdb3d('0xa1')](-0x1);if(_0x1e1ee9==='/'){_0x513810=_0x513810[_0xdb3d('0xa2')](0x0,_0x513810['lastIndexOf'](_0x1e1ee9));}_0x4f3045=util[_0xdb3d('0xa3')](_0xdb3d('0xa4'),_0x513810);_0x430043=util[_0xdb3d('0xa3')](_0xdb3d('0xa5'),_0x513810);_0x19cca1={'user':_0x1cb05c['username'],'pass':_0x1cb05c[_0xdb3d('0xa6')]};var _0x374413={'method':_0xdb3d('0xa7'),'uri':_0x4f3045+_0xdb3d('0xa8'),'auth':_0x19cca1,'json':!![]};return rp(_0x374413);}})[_0xdb3d('0x2a')](function(_0x5d1097){if(_0x5d1097[_0xdb3d('0xa9')][_0xdb3d('0x3a')]>0x0){_0x3859bc=_0x5d1097['result'];}console[_0xdb3d('0xaa')](_0xdb3d('0xab'),_0x3859bc);_0x55955f=[];_0x3da5db=Object[_0xdb3d('0xac')]([],_0x3859bc);_[_0xdb3d('0xad')](_0x3da5db,function(_0x3548b7){return!_0x5676d6[_0xdb3d('0xae')](_0x3548b7[_0xdb3d('0x2e')]);});_0x3da5db[_0xdb3d('0xaf')](function(_0x636300){var _0x10d81a=createFieldObject(_0x430043,_0x19cca1,_0x636300[_0xdb3d('0xb0')],_0x636300['name'],_0x636300[_0xdb3d('0xb1')],![]);_0x55955f[_0xdb3d('0xb2')](_0x10d81a);});return Promise['all'](_0x55955f);})[_0xdb3d('0x2a')](function(_0x33d82e){_0x1976d6=_0x33d82e;_0x1ac012=Object['assign']([],_0x3859bc);console[_0xdb3d('0xaa')](_0xdb3d('0xb3'),_0x3859bc);_[_0xdb3d('0xad')](_0x1ac012,function(_0x31db2e){return _0x20d46a['includes'](_0x31db2e[_0xdb3d('0x2e')]);});console['log'](_0xdb3d('0xb4'),_0x1ac012);_0x55955f=[];_0x1ac012['forEach'](function(_0x36f9a9){var _0x417268=createFieldObject(_0x430043,_0x19cca1,_0x36f9a9[_0xdb3d('0xb0')],_0x36f9a9[_0xdb3d('0x2e')],_0x36f9a9[_0xdb3d('0xb1')],!![]);_0x55955f[_0xdb3d('0xb2')](_0x417268);});return Promise[_0xdb3d('0xb5')](_0x55955f);})[_0xdb3d('0x2a')](function(_0x243abb){_0x500f18=_0x243abb;var _0x103b2c=_0x1976d6['concat'](_0x500f18);return{'count':_0x103b2c[_0xdb3d('0x3a')],'rows':_0x103b2c};})[_0xdb3d('0x2a')](respondWithResult(_0x4d7db9,null))[_0xdb3d('0x48')](function(_0x311bea){console[_0xdb3d('0xaa')](_0xdb3d('0xb6')+_0x311bea);var _0x5d54e9=_0x2cac71['query']['test']?0x1f4:_0x311bea[_0xdb3d('0xb7')]||0x1f4;logger[_0xdb3d('0x2c')](_0x311bea[_0xdb3d('0x2d')]);delete _0x311bea[_0xdb3d('0x2e')];if(_0x5d54e9===0x191){_0x5d54e9=0x190;}_0x4d7db9['status'](_0x5d54e9)[_0xdb3d('0x2f')](_0x2cac71[_0xdb3d('0x34')]['test']?{'message':_0xdb3d('0xb8'),'statusCode':_0x311bea[_0xdb3d('0xb7')]}:_0x311bea);});};function createFieldObject(_0x505cb7,_0xadbe15,_0x2df544,_0x18ffd9,_0x5c6430,_0x52a258){return new Promise(function(_0x54126e,_0x5edbe6){var _0x1ecf61={'id':_0x18ffd9,'name':_0x5c6430,'custom':_0x52a258};if(_0x2df544==='boolean'){_0x1ecf61[_0xdb3d('0x44')]=[{'name':_0xdb3d('0xb9'),'value':_0xdb3d('0xba')},{'name':_0xdb3d('0xbb'),'value':'false'}];_0x54126e(_0x1ecf61);}else{var _0x300e8d={'method':_0xdb3d('0xa7'),'uri':_0x505cb7+_0xdb3d('0xbc')+_0x18ffd9,'auth':_0xadbe15,'json':!![]};return rp(_0x300e8d)[_0xdb3d('0x2a')](function(_0x23e5fb){var _0x4eddda=[];if(_0x23e5fb['result'][_0xdb3d('0x3a')]>0x0){_0x23e5fb[_0xdb3d('0xa9')][_0xdb3d('0xaf')](function(_0x4f1b42){if(_0x4f1b42[_0xdb3d('0xbd')]===_0xdb3d('0xbe')){var _0x32ee97={'name':_0x4f1b42[_0xdb3d('0xb1')],'value':_0x4f1b42[_0xdb3d('0xbf')]};_0x4eddda[_0xdb3d('0xb2')](_0x32ee97);}});}_0x1ecf61[_0xdb3d('0x44')]=_0x4eddda;if(_0x1ecf61[_0xdb3d('0x44')][_0xdb3d('0x3a')]>0x0){_0x54126e(_0x1ecf61);}else{if(_0x52a258==![]){_0x54126e();}else{_0x54126e(_0x1ecf61);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 955eab5..24d95de 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 _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x4da7aa,_0x5d830c){var _0x3ffc2f=function(_0x3d050b){while(--_0x3d050b){_0x4da7aa['push'](_0x4da7aa['shift']());}};_0x3ffc2f(++_0x5d830c);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x33314d,_0x499628){var _0x4ffe8e=function(_0xb1ec35){while(--_0xb1ec35){_0x33314d['push'](_0x33314d['shift']());}};_0x4ffe8e(++_0x499628);}(_0x5d58,0x187));var _0x85d5=function(_0x37e0ad,_0x300b0f){_0x37e0ad=_0x37e0ad-0x0;var _0x72fb2e=_0x5d58[_0x37e0ad];return _0x72fb2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'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 643e30a..9413ab9 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 _0xc0b7=['model','ShowServicenowAccount','ServicenowAccount','find','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x445ab2,_0x28d7ed){var _0x3eae9f=function(_0x2d4b5a){while(--_0x2d4b5a){_0x445ab2['push'](_0x445ab2['shift']());}};_0x3eae9f(++_0x28d7ed);}(_0xc0b7,0xbe));var _0x7c0b=function(_0x19b16e,_0x3c3fa8){_0x19b16e=_0x19b16e-0x0;var _0x51eabf=_0xc0b7[_0x19b16e];return _0x51eabf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c0b('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c0b('0x1'))['db'];var utils=require(_0x7c0b('0x2'));var logger=require('../../config/logger')(_0x7c0b('0x3'));var config=require('../../config/environment');var jayson=require(_0x7c0b('0x4'));var client=jayson['client'][_0x7c0b('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x741cc5,_0x38765a,_0x42f22e){return new BPromise(function(_0x32c6c8,_0x468c82){return client[_0x7c0b('0x6')](_0x741cc5,_0x42f22e)[_0x7c0b('0x7')](function(_0x50d28f){logger['info'](_0x7c0b('0x8'),_0x38765a,_0x7c0b('0x9'));logger[_0x7c0b('0xa')](_0x7c0b('0xb'),_0x38765a,_0x7c0b('0x9'),JSON[_0x7c0b('0xc')](_0x50d28f));if(_0x50d28f[_0x7c0b('0xd')]){if(_0x50d28f['error'][_0x7c0b('0xe')]===0x1f4){logger[_0x7c0b('0xd')](_0x7c0b('0x8'),_0x38765a,_0x50d28f[_0x7c0b('0xd')][_0x7c0b('0xf')]);return _0x468c82(_0x50d28f['error']['message']);}logger['error'](_0x7c0b('0x8'),_0x38765a,_0x50d28f[_0x7c0b('0xd')][_0x7c0b('0xf')]);return _0x32c6c8(_0x50d28f['error'][_0x7c0b('0xf')]);}else{logger[_0x7c0b('0x10')](_0x7c0b('0x8'),_0x38765a,_0x7c0b('0x9'));_0x32c6c8(_0x50d28f['result'][_0x7c0b('0xf')]);}})[_0x7c0b('0x11')](function(_0x4cabad){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x38765a,_0x4cabad);_0x468c82(_0x4cabad);});});}exports[_0x7c0b('0x12')]=function(_0x4b12b7){var _0x3a2548=this;return new Promise(function(_0x5090eb,_0x9af20c){return db['ServicenowAccount'][_0x7c0b('0x13')]({'raw':_0x4b12b7[_0x7c0b('0x14')]?_0x4b12b7[_0x7c0b('0x14')][_0x7c0b('0x15')]===undefined?!![]:![]:!![],'where':_0x4b12b7[_0x7c0b('0x14')]?_0x4b12b7[_0x7c0b('0x14')][_0x7c0b('0x16')]||null:null,'attributes':_0x4b12b7['options']?_0x4b12b7[_0x7c0b('0x14')][_0x7c0b('0x17')]||null:null,'limit':_0x4b12b7[_0x7c0b('0x14')]?_0x4b12b7[_0x7c0b('0x14')][_0x7c0b('0x18')]||null:null,'include':_0x4b12b7[_0x7c0b('0x14')]?_0x4b12b7[_0x7c0b('0x14')][_0x7c0b('0x19')]?_[_0x7c0b('0x1a')](_0x4b12b7['options'][_0x7c0b('0x19')],function(_0x1873c5){return{'model':db[_0x1873c5['model']],'as':_0x1873c5['as'],'attributes':_0x1873c5[_0x7c0b('0x17')],'include':_0x1873c5[_0x7c0b('0x19')]?_[_0x7c0b('0x1a')](_0x1873c5['include'],function(_0x4c2a20){return{'model':db[_0x4c2a20[_0x7c0b('0x1b')]],'as':_0x4c2a20['as'],'attributes':_0x4c2a20[_0x7c0b('0x17')],'include':_0x4c2a20[_0x7c0b('0x19')]?_[_0x7c0b('0x1a')](_0x4c2a20[_0x7c0b('0x19')],function(_0x6695ae){return{'model':db[_0x6695ae[_0x7c0b('0x1b')]],'as':_0x6695ae['as'],'attributes':_0x6695ae[_0x7c0b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x564cc5){logger['info'](_0x7c0b('0x12'),_0x4b12b7);logger[_0x7c0b('0xa')](_0x7c0b('0x12'),_0x4b12b7,JSON[_0x7c0b('0xc')](_0x564cc5));_0x5090eb(_0x564cc5);})[_0x7c0b('0x11')](function(_0x1d3cdf){logger['error'](_0x7c0b('0x12'),_0x1d3cdf['message'],_0x4b12b7);_0x9af20c(_0x3a2548[_0x7c0b('0xd')](0x1f4,_0x1d3cdf[_0x7c0b('0xf')]));});});};exports[_0x7c0b('0x1c')]=function(_0x9bd775){var _0x12dd48=this;return new Promise(function(_0xf10e9a,_0x1eccbc){return db[_0x7c0b('0x1d')][_0x7c0b('0x1e')]({'raw':_0x9bd775[_0x7c0b('0x14')]?_0x9bd775[_0x7c0b('0x14')][_0x7c0b('0x15')]===undefined?!![]:![]:!![],'where':_0x9bd775['options']?_0x9bd775[_0x7c0b('0x14')][_0x7c0b('0x16')]||null:null,'attributes':_0x9bd775[_0x7c0b('0x14')]?_0x9bd775[_0x7c0b('0x14')]['attributes']||null:null,'include':_0x9bd775[_0x7c0b('0x14')]?_0x9bd775[_0x7c0b('0x14')]['include']?_[_0x7c0b('0x1a')](_0x9bd775[_0x7c0b('0x14')]['include'],function(_0x233bbf){return{'model':db[_0x233bbf[_0x7c0b('0x1b')]],'as':_0x233bbf['as'],'attributes':_0x233bbf['attributes'],'include':_0x233bbf[_0x7c0b('0x19')]?_[_0x7c0b('0x1a')](_0x233bbf[_0x7c0b('0x19')],function(_0x56c52f){return{'model':db[_0x56c52f[_0x7c0b('0x1b')]],'as':_0x56c52f['as'],'attributes':_0x56c52f[_0x7c0b('0x17')],'include':_0x56c52f[_0x7c0b('0x19')]?_[_0x7c0b('0x1a')](_0x56c52f[_0x7c0b('0x19')],function(_0x55d6a6){return{'model':db[_0x55d6a6[_0x7c0b('0x1b')]],'as':_0x55d6a6['as'],'attributes':_0x55d6a6[_0x7c0b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c07d6){logger[_0x7c0b('0x10')](_0x7c0b('0x1c'),_0x9bd775);logger[_0x7c0b('0xa')](_0x7c0b('0x1c'),_0x9bd775,JSON[_0x7c0b('0xc')](_0x2c07d6));_0xf10e9a(_0x2c07d6);})['catch'](function(_0x336d07){logger[_0x7c0b('0xd')](_0x7c0b('0x1c'),_0x336d07[_0x7c0b('0xf')],_0x9bd775);_0x1eccbc(_0x12dd48[_0x7c0b('0xd')](0x1f4,_0x336d07[_0x7c0b('0xf')]));});});}; \ No newline at end of file +var _0x607d=['raw','attributes','limit','include','map','model','GetServicenowAccount','debug','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x607d,0x115));var _0xd607=function(_0x4f5d1c,_0x17a5f6){_0x4f5d1c=_0x4f5d1c-0x0;var _0x5b0ec9=_0x607d[_0x4f5d1c];return _0x5b0ec9;};'use strict';var _=require(_0xd607('0x0'));var util=require(_0xd607('0x1'));var moment=require(_0xd607('0x2'));var BPromise=require(_0xd607('0x3'));var rs=require(_0xd607('0x4'));var fs=require('fs');var Redis=require(_0xd607('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd607('0x6'));var logger=require(_0xd607('0x7'))(_0xd607('0x8'));var config=require(_0xd607('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd607('0xa')][_0xd607('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f59d4,_0x4136f9,_0x122ff5){return new BPromise(function(_0x3f8bf8,_0x21532b){return client[_0xd607('0xc')](_0x5f59d4,_0x122ff5)[_0xd607('0xd')](function(_0x4b1e72){logger[_0xd607('0xe')](_0xd607('0xf'),_0x4136f9,_0xd607('0x10'));logger['debug'](_0xd607('0x11'),_0x4136f9,'request\x20sent',JSON[_0xd607('0x12')](_0x4b1e72));if(_0x4b1e72[_0xd607('0x13')]){if(_0x4b1e72[_0xd607('0x13')][_0xd607('0x14')]===0x1f4){logger[_0xd607('0x13')](_0xd607('0xf'),_0x4136f9,_0x4b1e72[_0xd607('0x13')][_0xd607('0x15')]);return _0x21532b(_0x4b1e72[_0xd607('0x13')][_0xd607('0x15')]);}logger[_0xd607('0x13')](_0xd607('0xf'),_0x4136f9,_0x4b1e72[_0xd607('0x13')]['message']);return _0x3f8bf8(_0x4b1e72['error'][_0xd607('0x15')]);}else{logger['info'](_0xd607('0xf'),_0x4136f9,'request\x20sent');_0x3f8bf8(_0x4b1e72[_0xd607('0x16')][_0xd607('0x15')]);}})[_0xd607('0x17')](function(_0x18f9d8){logger[_0xd607('0x13')](_0xd607('0xf'),_0x4136f9,_0x18f9d8);_0x21532b(_0x18f9d8);});});}exports['GetServicenowAccount']=function(_0x42fc93){var _0x14f7e4=this;return new Promise(function(_0x1c1051,_0x2bfe2c){return db[_0xd607('0x18')][_0xd607('0x19')]({'raw':_0x42fc93[_0xd607('0x1a')]?_0x42fc93[_0xd607('0x1a')][_0xd607('0x1b')]===undefined?!![]:![]:!![],'where':_0x42fc93[_0xd607('0x1a')]?_0x42fc93[_0xd607('0x1a')]['where']||null:null,'attributes':_0x42fc93[_0xd607('0x1a')]?_0x42fc93[_0xd607('0x1a')][_0xd607('0x1c')]||null:null,'limit':_0x42fc93[_0xd607('0x1a')]?_0x42fc93[_0xd607('0x1a')][_0xd607('0x1d')]||null:null,'include':_0x42fc93[_0xd607('0x1a')]?_0x42fc93[_0xd607('0x1a')][_0xd607('0x1e')]?_[_0xd607('0x1f')](_0x42fc93[_0xd607('0x1a')][_0xd607('0x1e')],function(_0x271e30){return{'model':db[_0x271e30[_0xd607('0x20')]],'as':_0x271e30['as'],'attributes':_0x271e30[_0xd607('0x1c')],'include':_0x271e30[_0xd607('0x1e')]?_[_0xd607('0x1f')](_0x271e30[_0xd607('0x1e')],function(_0x1ebfb5){return{'model':db[_0x1ebfb5['model']],'as':_0x1ebfb5['as'],'attributes':_0x1ebfb5['attributes'],'include':_0x1ebfb5[_0xd607('0x1e')]?_[_0xd607('0x1f')](_0x1ebfb5[_0xd607('0x1e')],function(_0x59c3af){return{'model':db[_0x59c3af[_0xd607('0x20')]],'as':_0x59c3af['as'],'attributes':_0x59c3af[_0xd607('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd607('0xd')](function(_0x26563d){logger[_0xd607('0xe')](_0xd607('0x21'),_0x42fc93);logger[_0xd607('0x22')](_0xd607('0x21'),_0x42fc93,JSON[_0xd607('0x12')](_0x26563d));_0x1c1051(_0x26563d);})[_0xd607('0x17')](function(_0x419036){logger['error']('GetServicenowAccount',_0x419036[_0xd607('0x15')],_0x42fc93);_0x2bfe2c(_0x14f7e4[_0xd607('0x13')](0x1f4,_0x419036[_0xd607('0x15')]));});});};exports[_0xd607('0x23')]=function(_0xdef243){var _0x4d8c9a=this;return new Promise(function(_0x4435ec,_0x4319d7){return db[_0xd607('0x18')][_0xd607('0x24')]({'raw':_0xdef243[_0xd607('0x1a')]?_0xdef243[_0xd607('0x1a')][_0xd607('0x1b')]===undefined?!![]:![]:!![],'where':_0xdef243[_0xd607('0x1a')]?_0xdef243[_0xd607('0x1a')][_0xd607('0x25')]||null:null,'attributes':_0xdef243[_0xd607('0x1a')]?_0xdef243[_0xd607('0x1a')][_0xd607('0x1c')]||null:null,'include':_0xdef243[_0xd607('0x1a')]?_0xdef243[_0xd607('0x1a')][_0xd607('0x1e')]?_['map'](_0xdef243[_0xd607('0x1a')]['include'],function(_0x2b4fe5){return{'model':db[_0x2b4fe5[_0xd607('0x20')]],'as':_0x2b4fe5['as'],'attributes':_0x2b4fe5[_0xd607('0x1c')],'include':_0x2b4fe5[_0xd607('0x1e')]?_[_0xd607('0x1f')](_0x2b4fe5[_0xd607('0x1e')],function(_0x56c34c){return{'model':db[_0x56c34c[_0xd607('0x20')]],'as':_0x56c34c['as'],'attributes':_0x56c34c[_0xd607('0x1c')],'include':_0x56c34c[_0xd607('0x1e')]?_[_0xd607('0x1f')](_0x56c34c[_0xd607('0x1e')],function(_0x5a4a2b){return{'model':db[_0x5a4a2b[_0xd607('0x20')]],'as':_0x5a4a2b['as'],'attributes':_0x5a4a2b[_0xd607('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2351e1){logger['info']('ShowServicenowAccount',_0xdef243);logger[_0xd607('0x22')](_0xd607('0x23'),_0xdef243,JSON[_0xd607('0x12')](_0x2351e1));_0x4435ec(_0x2351e1);})[_0xd607('0x17')](function(_0x349f56){logger['error'](_0xd607('0x23'),_0x349f56['message'],_0xdef243);_0x4319d7(_0x4d8c9a[_0xd607('0x13')](0x1f4,_0x349f56['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 078fd98..f124e75 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 _0x3b23=['put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','create'];(function(_0x1cf516,_0x2d2305){var _0x188f04=function(_0x302d7a){while(--_0x302d7a){_0x1cf516['push'](_0x1cf516['shift']());}};_0x188f04(++_0x2d2305);}(_0x3b23,0x16a));var _0x33b2=function(_0x56ea64,_0x10f838){_0x56ea64=_0x56ea64-0x0;var _0x13f4fa=_0x3b23[_0x56ea64];return _0x13f4fa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x33b2('0x0'));var express=require(_0x33b2('0x1'));var router=express[_0x33b2('0x2')]();var fs_extra=require(_0x33b2('0x3'));var auth=require(_0x33b2('0x4'));var interaction=require(_0x33b2('0x5'));var config=require(_0x33b2('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x33b2('0x7')]);router[_0x33b2('0x8')]('/:id',auth[_0x33b2('0x9')](),controller[_0x33b2('0xa')]);router[_0x33b2('0x8')](_0x33b2('0xb'),auth['isAuthenticated'](),controller[_0x33b2('0xc')]);router['get'](_0x33b2('0xd'),auth[_0x33b2('0x9')](),controller[_0x33b2('0xe')]);router[_0x33b2('0x8')]('/:id/descriptions',auth[_0x33b2('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x33b2('0x9')](),controller[_0x33b2('0xf')]);router[_0x33b2('0x10')](_0x33b2('0x11'),auth[_0x33b2('0x9')](),controller[_0x33b2('0x12')]);router[_0x33b2('0x13')](_0x33b2('0x11'),auth[_0x33b2('0x9')](),controller[_0x33b2('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8bf1=['getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x3eb5a5,_0x1a63b6){var _0x344b51=function(_0xeeedb9){while(--_0xeeedb9){_0x3eb5a5['push'](_0x3eb5a5['shift']());}};_0x344b51(++_0x1a63b6);}(_0x8bf1,0xf8));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x18bf('0x0'));var util=require(_0x18bf('0x1'));var path=require(_0x18bf('0x2'));var timeout=require(_0x18bf('0x3'));var express=require('express');var router=express[_0x18bf('0x4')]();var fs_extra=require(_0x18bf('0x5'));var auth=require(_0x18bf('0x6'));var interaction=require(_0x18bf('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x18bf('0x8')]('/',auth[_0x18bf('0x9')](),controller[_0x18bf('0xa')]);router['get'](_0x18bf('0xb'),auth[_0x18bf('0x9')](),controller[_0x18bf('0xc')]);router[_0x18bf('0x8')]('/:id/fields',auth[_0x18bf('0x9')](),controller[_0x18bf('0xd')]);router[_0x18bf('0x8')](_0x18bf('0xe'),auth['isAuthenticated'](),controller[_0x18bf('0xf')]);router[_0x18bf('0x8')]('/:id/descriptions',auth[_0x18bf('0x9')](),controller[_0x18bf('0x10')]);router[_0x18bf('0x11')]('/',auth['isAuthenticated'](),controller[_0x18bf('0x12')]);router[_0x18bf('0x13')](_0x18bf('0xb'),auth['isAuthenticated'](),controller[_0x18bf('0x14')]);router['delete']('/:id',auth[_0x18bf('0x9')](),controller['destroy']);module[_0x18bf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 72d652a..c84e415 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 _0x6641=['STRING','sequelize','exports'];(function(_0x3a3c05,_0x50368d){var _0x481b00=function(_0x3fd875){while(--_0x3fd875){_0x3a3c05['push'](_0x3a3c05['shift']());}};_0x481b00(++_0x50368d);}(_0x6641,0x163));var _0x1664=function(_0x2b4153,_0x1caadb){_0x2b4153=_0x2b4153-0x0;var _0x1e467f=_0x6641[_0x2b4153];return _0x1e467f;};'use strict';var Sequelize=require(_0x1664('0x0'));module[_0x1664('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1664('0x2')]}}; \ No newline at end of file +var _0x11ee=['sequelize','STRING'];(function(_0x27e072,_0x436d6f){var _0x3b0610=function(_0x372444){while(--_0x372444){_0x27e072['push'](_0x27e072['shift']());}};_0x3b0610(++_0x436d6f);}(_0x11ee,0x98));var _0xe11e=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x11ee[_0x11e03f];return _0x5666fe;};'use strict';var Sequelize=require(_0xe11e('0x0'));module['exports']={'name':{'type':Sequelize[_0xe11e('0x1')]},'description':{'type':Sequelize[_0xe11e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 93feee4..d4d7bda 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 _0xb1ce=['getFields','findOne','ServicenowField','length','nolimit','getSubjects','rawAttributes','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','find','create','body'];(function(_0x5d01e3,_0x580578){var _0x4671b9=function(_0x233638){while(--_0x233638){_0x5d01e3['push'](_0x5d01e3['shift']());}};_0x4671b9(++_0x580578);}(_0xb1ce,0xf8));var _0xeb1c=function(_0x11d570,_0x59fa8f){_0x11d570=_0x11d570-0x0;var _0x14f446=_0xb1ce[_0x11d570];return _0x14f446;};'use strict';var emlformat=require(_0xeb1c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb1c('0x1'));var jsonpatch=require(_0xeb1c('0x2'));var rp=require(_0xeb1c('0x3'));var moment=require(_0xeb1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeb1c('0x5'));var path=require(_0xeb1c('0x6'));var sox=require(_0xeb1c('0x7'));var csv=require(_0xeb1c('0x8'));var ejs=require(_0xeb1c('0x9'));var fs=require('fs');var fs_extra=require(_0xeb1c('0xa'));var _=require(_0xeb1c('0xb'));var squel=require(_0xeb1c('0xc'));var crypto=require(_0xeb1c('0xd'));var jsforce=require(_0xeb1c('0xe'));var deskjs=require(_0xeb1c('0xf'));var toCsv=require(_0xeb1c('0x8'));var querystring=require(_0xeb1c('0x10'));var Papa=require(_0xeb1c('0x11'));var Redis=require(_0xeb1c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb1c('0x13'));var hardwareService=require(_0xeb1c('0x14'));var logger=require(_0xeb1c('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb1c('0x16'));var db=require(_0xeb1c('0x17'))['db'];function respondWithStatusCode(_0x5b04e2,_0x2ad513){_0x2ad513=_0x2ad513||0xcc;return function(_0x8f786e){if(_0x8f786e){return _0x5b04e2[_0xeb1c('0x18')](_0x2ad513);}return _0x5b04e2[_0xeb1c('0x19')](_0x2ad513)[_0xeb1c('0x1a')]();};}function respondWithResult(_0x7787c5,_0x1d7c8a){_0x1d7c8a=_0x1d7c8a||0xc8;return function(_0xb9c093){if(_0xb9c093){return _0x7787c5[_0xeb1c('0x19')](_0x1d7c8a)[_0xeb1c('0x1b')](_0xb9c093);}};}function respondWithFilteredResult(_0x109276,_0x2ae9cd){return function(_0x5d8831){if(_0x5d8831){var _0x2c9b2f=typeof _0x2ae9cd[_0xeb1c('0x1c')]===_0xeb1c('0x1d')&&typeof _0x2ae9cd[_0xeb1c('0x1e')]===_0xeb1c('0x1d');var _0x579256=_0x5d8831[_0xeb1c('0x1f')];var _0x38812a=_0x2c9b2f?0x0:_0x2ae9cd['offset'];var _0x1d5a15=_0x2c9b2f?_0x5d8831[_0xeb1c('0x1f')]:_0x2ae9cd[_0xeb1c('0x1c')]+_0x2ae9cd[_0xeb1c('0x1e')];var _0x279957;if(_0x1d5a15>=_0x579256){_0x1d5a15=_0x579256;_0x279957=0xc8;}else{_0x279957=0xce;}_0x109276[_0xeb1c('0x19')](_0x279957);return _0x109276[_0xeb1c('0x20')](_0xeb1c('0x21'),_0x38812a+'-'+_0x1d5a15+'/'+_0x579256)[_0xeb1c('0x1b')](_0x5d8831);}return null;};}function patchUpdates(_0x5a3419){return function(_0x37bb2e){try{jsonpatch[_0xeb1c('0x22')](_0x37bb2e,_0x5a3419,!![]);}catch(_0x48aa96){return BPromise['reject'](_0x48aa96);}return _0x37bb2e['save']();};}function saveUpdates(_0x31ac90,_0x5c15c4){return function(_0x495798){if(_0x495798){return _0x495798[_0xeb1c('0x23')](_0x31ac90)['then'](function(_0x370e89){return _0x370e89;});}return null;};}function removeEntity(_0x155707,_0x2d0aa8){return function(_0x5f04a2){if(_0x5f04a2){return _0x5f04a2[_0xeb1c('0x24')]()[_0xeb1c('0x25')](function(){_0x155707[_0xeb1c('0x19')](0xcc)[_0xeb1c('0x1a')]();});}};}function handleEntityNotFound(_0xfe46c6,_0x177236){return function(_0x60bb03){if(!_0x60bb03){_0xfe46c6['sendStatus'](0x194);}return _0x60bb03;};}function handleError(_0x1aea6e,_0x2acc2d){_0x2acc2d=_0x2acc2d||0x1f4;return function(_0x231168){logger[_0xeb1c('0x26')](_0x231168[_0xeb1c('0x27')]);if(_0x231168[_0xeb1c('0x28')]){delete _0x231168[_0xeb1c('0x28')];}_0x1aea6e[_0xeb1c('0x19')](_0x2acc2d)[_0xeb1c('0x29')](_0x231168);};}exports[_0xeb1c('0x2a')]=function(_0x5b7880,_0x483614){var _0x41d5c4={},_0x1e1be7={},_0x3634dd={'count':0x0,'rows':[]};var _0xe972a9=_[_0xeb1c('0x2b')](db[_0xeb1c('0x2c')]['rawAttributes'],function(_0xf09383){return{'name':_0xf09383[_0xeb1c('0x2d')],'type':_0xf09383[_0xeb1c('0x2e')][_0xeb1c('0x2f')]};});_0x1e1be7[_0xeb1c('0x30')]=_[_0xeb1c('0x2b')](_0xe972a9,_0xeb1c('0x28'));_0x1e1be7[_0xeb1c('0x31')]=_[_0xeb1c('0x32')](_0x5b7880[_0xeb1c('0x31')]);_0x1e1be7[_0xeb1c('0x33')]=_['intersection'](_0x1e1be7[_0xeb1c('0x30')],_0x1e1be7['query']);_0x41d5c4[_0xeb1c('0x34')]=_['intersection'](_0x1e1be7[_0xeb1c('0x30')],qs[_0xeb1c('0x35')](_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x35')]));_0x41d5c4[_0xeb1c('0x34')]=_0x41d5c4[_0xeb1c('0x34')]['length']?_0x41d5c4[_0xeb1c('0x34')]:_0x1e1be7[_0xeb1c('0x30')];if(!_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x36')]('nolimit')){_0x41d5c4[_0xeb1c('0x1e')]=qs[_0xeb1c('0x1e')](_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x1e')]);_0x41d5c4[_0xeb1c('0x1c')]=qs[_0xeb1c('0x1c')](_0x5b7880['query'][_0xeb1c('0x1c')]);}_0x41d5c4[_0xeb1c('0x37')]=qs[_0xeb1c('0x38')](_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x38')]);_0x41d5c4[_0xeb1c('0x39')]=qs[_0xeb1c('0x33')](_[_0xeb1c('0x3a')](_0x5b7880[_0xeb1c('0x31')],_0x1e1be7['filters']),_0xe972a9);if(_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x3b')]){_0x41d5c4['where']=_[_0xeb1c('0x3c')](_0x41d5c4[_0xeb1c('0x39')],{'$or':_[_0xeb1c('0x2b')](_0xe972a9,function(_0x5a3988){if(_0x5a3988[_0xeb1c('0x2e')]!==_0xeb1c('0x3d')){var _0x56201b={};_0x56201b[_0x5a3988['name']]={'$like':'%'+_0x5b7880['query'][_0xeb1c('0x3b')]+'%'};return _0x56201b;}})});}_0x41d5c4=_[_0xeb1c('0x3c')]({},_0x41d5c4,_0x5b7880[_0xeb1c('0x3e')]);var _0x155f90={'where':_0x41d5c4[_0xeb1c('0x39')]};return db[_0xeb1c('0x2c')][_0xeb1c('0x1f')](_0x155f90)[_0xeb1c('0x25')](function(_0x6a36c1){_0x3634dd[_0xeb1c('0x1f')]=_0x6a36c1;if(_0x5b7880[_0xeb1c('0x31')][_0xeb1c('0x3f')]){_0x41d5c4['include']=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x41d5c4);})[_0xeb1c('0x25')](function(_0xdbbc85){_0x3634dd[_0xeb1c('0x40')]=_0xdbbc85;return _0x3634dd;})[_0xeb1c('0x25')](respondWithFilteredResult(_0x483614,_0x41d5c4))[_0xeb1c('0x41')](handleError(_0x483614,null));};exports[_0xeb1c('0x42')]=function(_0x290c8d,_0x4474b4){var _0x451828={'raw':![],'where':{'id':_0x290c8d[_0xeb1c('0x43')]['id']}},_0x1178d1={};_0x1178d1[_0xeb1c('0x30')]=_[_0xeb1c('0x32')](db[_0xeb1c('0x2c')]['rawAttributes']);_0x1178d1['query']=_[_0xeb1c('0x32')](_0x290c8d['query']);_0x1178d1[_0xeb1c('0x33')]=_[_0xeb1c('0x44')](_0x1178d1[_0xeb1c('0x30')],_0x1178d1[_0xeb1c('0x31')]);_0x451828[_0xeb1c('0x34')]=_[_0xeb1c('0x44')](_0x1178d1[_0xeb1c('0x30')],qs['fields'](_0x290c8d[_0xeb1c('0x31')][_0xeb1c('0x35')]));_0x451828[_0xeb1c('0x34')]=_0x451828[_0xeb1c('0x34')]['length']?_0x451828[_0xeb1c('0x34')]:_0x1178d1['model'];if(_0x290c8d[_0xeb1c('0x31')]['includeAll']){_0x451828['include']=[{'all':!![]}];}_0x451828=_['merge']({},_0x451828,_0x290c8d[_0xeb1c('0x3e')]);return db[_0xeb1c('0x2c')][_0xeb1c('0x45')](_0x451828)[_0xeb1c('0x25')](handleEntityNotFound(_0x4474b4,null))[_0xeb1c('0x25')](respondWithResult(_0x4474b4,null))[_0xeb1c('0x41')](handleError(_0x4474b4,null));};exports[_0xeb1c('0x46')]=function(_0x7a4ced,_0x2c8cad){return db['ServicenowConfiguration'][_0xeb1c('0x46')](_0x7a4ced[_0xeb1c('0x47')],{})[_0xeb1c('0x25')](respondWithResult(_0x2c8cad,0xc9))[_0xeb1c('0x41')](handleError(_0x2c8cad,null));};exports[_0xeb1c('0x23')]=function(_0x95e417,_0x3afebe){if(_0x95e417[_0xeb1c('0x47')]['id']){delete _0x95e417[_0xeb1c('0x47')]['id'];}return db['ServicenowConfiguration'][_0xeb1c('0x45')]({'where':{'id':_0x95e417[_0xeb1c('0x43')]['id']}})[_0xeb1c('0x25')](handleEntityNotFound(_0x3afebe,null))[_0xeb1c('0x25')](saveUpdates(_0x95e417['body'],null))['then'](respondWithResult(_0x3afebe,null))[_0xeb1c('0x41')](handleError(_0x3afebe,null));};exports[_0xeb1c('0x24')]=function(_0x49cba2,_0x5068b7){return db[_0xeb1c('0x2c')]['find']({'where':{'id':_0x49cba2[_0xeb1c('0x43')]['id']}})[_0xeb1c('0x25')](handleEntityNotFound(_0x5068b7,null))['then'](removeEntity(_0x5068b7,null))[_0xeb1c('0x41')](handleError(_0x5068b7,null));};exports[_0xeb1c('0x48')]=function(_0x59b42a,_0x50d021,_0x3d02c6){var _0x2a1387={};var _0x4dbd82={};var _0x30fd99;var _0x4344f8;return db[_0xeb1c('0x2c')][_0xeb1c('0x49')]({'where':{'id':_0x59b42a[_0xeb1c('0x43')]['id']}})[_0xeb1c('0x25')](handleEntityNotFound(_0x50d021,null))[_0xeb1c('0x25')](function(_0x331b80){if(_0x331b80){_0x30fd99=_0x331b80;_0x4dbd82['model']=_[_0xeb1c('0x32')](db[_0xeb1c('0x4a')]['rawAttributes']);_0x4dbd82[_0xeb1c('0x31')]=_['keys'](_0x59b42a['query']);_0x4dbd82[_0xeb1c('0x33')]=_['intersection'](_0x4dbd82[_0xeb1c('0x30')],_0x4dbd82[_0xeb1c('0x31')]);_0x2a1387[_0xeb1c('0x34')]=_[_0xeb1c('0x44')](_0x4dbd82['model'],qs[_0xeb1c('0x35')](_0x59b42a['query'][_0xeb1c('0x35')]));_0x2a1387['attributes']=_0x2a1387[_0xeb1c('0x34')]['length']?_0x2a1387[_0xeb1c('0x34')]:_0x4dbd82[_0xeb1c('0x30')];_0x2a1387['order']=qs[_0xeb1c('0x38')](_0x59b42a['query'][_0xeb1c('0x38')]);_0x2a1387[_0xeb1c('0x39')]=qs['filters'](_[_0xeb1c('0x3a')](_0x59b42a['query'],_0x4dbd82[_0xeb1c('0x33')]));if(_0x59b42a[_0xeb1c('0x31')]['filter']){_0x2a1387['where']=_[_0xeb1c('0x3c')](_0x2a1387[_0xeb1c('0x39')],{'$or':_[_0xeb1c('0x2b')](_0x2a1387[_0xeb1c('0x34')],function(_0xe25fff){var _0x5efd33={};_0x5efd33[_0xe25fff]={'$like':'%'+_0x59b42a[_0xeb1c('0x31')][_0xeb1c('0x3b')]+'%'};return _0x5efd33;})});}_0x2a1387=_[_0xeb1c('0x3c')]({},_0x2a1387,_0x59b42a[_0xeb1c('0x3e')]);return _0x30fd99[_0xeb1c('0x48')](_0x2a1387);}})[_0xeb1c('0x25')](function(_0xd393b6){if(_0xd393b6){_0x4344f8=_0xd393b6[_0xeb1c('0x4b')];if(!_0x59b42a[_0xeb1c('0x31')][_0xeb1c('0x36')](_0xeb1c('0x4c'))){_0x2a1387['limit']=qs[_0xeb1c('0x1e')](_0x59b42a[_0xeb1c('0x31')]['limit']);_0x2a1387[_0xeb1c('0x1c')]=qs[_0xeb1c('0x1c')](_0x59b42a[_0xeb1c('0x31')]['offset']);}return _0x30fd99[_0xeb1c('0x48')](_0x2a1387);}})[_0xeb1c('0x25')](function(_0x4339f5){if(_0x4339f5){return _0x4339f5?{'count':_0x4344f8,'rows':_0x4339f5}:null;}})[_0xeb1c('0x25')](respondWithResult(_0x50d021,null))[_0xeb1c('0x41')](handleError(_0x50d021,null));};exports[_0xeb1c('0x4d')]=function(_0x58b589,_0x1d97a2,_0x1d7787){var _0x43640e={};var _0x5782fd={};var _0x3c2ead;var _0x1f8b3d;return db[_0xeb1c('0x2c')]['findOne']({'where':{'id':_0x58b589[_0xeb1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d97a2,null))[_0xeb1c('0x25')](function(_0x3ab2e1){if(_0x3ab2e1){_0x3c2ead=_0x3ab2e1;_0x5782fd[_0xeb1c('0x30')]=_[_0xeb1c('0x32')](db['ServicenowField'][_0xeb1c('0x4e')]);_0x5782fd[_0xeb1c('0x31')]=_[_0xeb1c('0x32')](_0x58b589[_0xeb1c('0x31')]);_0x5782fd['filters']=_[_0xeb1c('0x44')](_0x5782fd['model'],_0x5782fd['query']);_0x43640e[_0xeb1c('0x34')]=_['intersection'](_0x5782fd[_0xeb1c('0x30')],qs['fields'](_0x58b589[_0xeb1c('0x31')][_0xeb1c('0x35')]));_0x43640e[_0xeb1c('0x34')]=_0x43640e['attributes'][_0xeb1c('0x4b')]?_0x43640e[_0xeb1c('0x34')]:_0x5782fd[_0xeb1c('0x30')];_0x43640e[_0xeb1c('0x37')]=qs['sort'](_0x58b589['query'][_0xeb1c('0x38')]);_0x43640e[_0xeb1c('0x39')]=qs[_0xeb1c('0x33')](_[_0xeb1c('0x3a')](_0x58b589['query'],_0x5782fd[_0xeb1c('0x33')]));if(_0x58b589[_0xeb1c('0x31')][_0xeb1c('0x3b')]){_0x43640e[_0xeb1c('0x39')]=_[_0xeb1c('0x3c')](_0x43640e['where'],{'$or':_['map'](_0x43640e[_0xeb1c('0x34')],function(_0x5a1995){var _0x33442f={};_0x33442f[_0x5a1995]={'$like':'%'+_0x58b589[_0xeb1c('0x31')][_0xeb1c('0x3b')]+'%'};return _0x33442f;})});}_0x43640e=_[_0xeb1c('0x3c')]({},_0x43640e,_0x58b589[_0xeb1c('0x3e')]);return _0x3c2ead['getSubjects'](_0x43640e);}})[_0xeb1c('0x25')](function(_0x1ac758){if(_0x1ac758){_0x1f8b3d=_0x1ac758['length'];if(!_0x58b589[_0xeb1c('0x31')][_0xeb1c('0x36')]('nolimit')){_0x43640e[_0xeb1c('0x1e')]=qs[_0xeb1c('0x1e')](_0x58b589['query'][_0xeb1c('0x1e')]);_0x43640e[_0xeb1c('0x1c')]=qs['offset'](_0x58b589['query']['offset']);}return _0x3c2ead[_0xeb1c('0x4d')](_0x43640e);}})[_0xeb1c('0x25')](function(_0x24e3d8){if(_0x24e3d8){return _0x24e3d8?{'count':_0x1f8b3d,'rows':_0x24e3d8}:null;}})['then'](respondWithResult(_0x1d97a2,null))[_0xeb1c('0x41')](handleError(_0x1d97a2,null));};exports[_0xeb1c('0x4f')]=function(_0xfd2965,_0x32ef13,_0x444a27){var _0x5cf073={};var _0x48b7d4={};var _0x23c806;var _0x316054;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xfd2965[_0xeb1c('0x43')]['id']}})[_0xeb1c('0x25')](handleEntityNotFound(_0x32ef13,null))[_0xeb1c('0x25')](function(_0x4eebe1){if(_0x4eebe1){_0x23c806=_0x4eebe1;_0x48b7d4[_0xeb1c('0x30')]=_[_0xeb1c('0x32')](db[_0xeb1c('0x4a')][_0xeb1c('0x4e')]);_0x48b7d4['query']=_['keys'](_0xfd2965[_0xeb1c('0x31')]);_0x48b7d4[_0xeb1c('0x33')]=_[_0xeb1c('0x44')](_0x48b7d4[_0xeb1c('0x30')],_0x48b7d4[_0xeb1c('0x31')]);_0x5cf073[_0xeb1c('0x34')]=_[_0xeb1c('0x44')](_0x48b7d4[_0xeb1c('0x30')],qs[_0xeb1c('0x35')](_0xfd2965[_0xeb1c('0x31')][_0xeb1c('0x35')]));_0x5cf073[_0xeb1c('0x34')]=_0x5cf073[_0xeb1c('0x34')][_0xeb1c('0x4b')]?_0x5cf073['attributes']:_0x48b7d4[_0xeb1c('0x30')];_0x5cf073['order']=qs['sort'](_0xfd2965[_0xeb1c('0x31')][_0xeb1c('0x38')]);_0x5cf073[_0xeb1c('0x39')]=qs[_0xeb1c('0x33')](_[_0xeb1c('0x3a')](_0xfd2965[_0xeb1c('0x31')],_0x48b7d4[_0xeb1c('0x33')]));if(_0xfd2965[_0xeb1c('0x31')]['filter']){_0x5cf073['where']=_['merge'](_0x5cf073[_0xeb1c('0x39')],{'$or':_[_0xeb1c('0x2b')](_0x5cf073[_0xeb1c('0x34')],function(_0x49a5fb){var _0x174d86={};_0x174d86[_0x49a5fb]={'$like':'%'+_0xfd2965[_0xeb1c('0x31')][_0xeb1c('0x3b')]+'%'};return _0x174d86;})});}_0x5cf073=_[_0xeb1c('0x3c')]({},_0x5cf073,_0xfd2965[_0xeb1c('0x3e')]);return _0x23c806[_0xeb1c('0x4f')](_0x5cf073);}})[_0xeb1c('0x25')](function(_0x18a0e0){if(_0x18a0e0){_0x316054=_0x18a0e0['length'];if(!_0xfd2965['query'][_0xeb1c('0x36')](_0xeb1c('0x4c'))){_0x5cf073[_0xeb1c('0x1e')]=qs[_0xeb1c('0x1e')](_0xfd2965['query'][_0xeb1c('0x1e')]);_0x5cf073[_0xeb1c('0x1c')]=qs['offset'](_0xfd2965[_0xeb1c('0x31')][_0xeb1c('0x1c')]);}return _0x23c806['getDescriptions'](_0x5cf073);}})['then'](function(_0x4b1e31){if(_0x4b1e31){return _0x4b1e31?{'count':_0x316054,'rows':_0x4b1e31}:null;}})[_0xeb1c('0x25')](respondWithResult(_0x32ef13,null))[_0xeb1c('0x41')](handleError(_0x32ef13,null));}; \ No newline at end of file +var _0x3133=['intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','findOne','ServicenowField','length','pick','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x1721b3,_0x1c18e5){var _0x184d78=function(_0x2b1557){while(--_0x2b1557){_0x1721b3['push'](_0x1721b3['shift']());}};_0x184d78(++_0x1c18e5);}(_0x3133,0xbe));var _0x3313=function(_0x34e223,_0x51a514){_0x34e223=_0x34e223-0x0;var _0x5411ca=_0x3133[_0x34e223];return _0x5411ca;};'use strict';var emlformat=require(_0x3313('0x0'));var rimraf=require(_0x3313('0x1'));var zipdir=require(_0x3313('0x2'));var jsonpatch=require(_0x3313('0x3'));var rp=require(_0x3313('0x4'));var moment=require(_0x3313('0x5'));var BPromise=require(_0x3313('0x6'));var Mustache=require(_0x3313('0x7'));var util=require(_0x3313('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3313('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3313('0xa'));var _=require(_0x3313('0xb'));var squel=require(_0x3313('0xc'));var crypto=require(_0x3313('0xd'));var jsforce=require(_0x3313('0xe'));var deskjs=require(_0x3313('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3313('0x10'));var Papa=require(_0x3313('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3313('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3313('0x13'));var logger=require(_0x3313('0x14'))(_0x3313('0x15'));var utils=require(_0x3313('0x16'));var config=require(_0x3313('0x17'));var licenseUtil=require(_0x3313('0x18'));var db=require(_0x3313('0x19'))['db'];function respondWithStatusCode(_0x3db6c2,_0x972929){_0x972929=_0x972929||0xcc;return function(_0x3d3b68){if(_0x3d3b68){return _0x3db6c2['sendStatus'](_0x972929);}return _0x3db6c2['status'](_0x972929)[_0x3313('0x1a')]();};}function respondWithResult(_0x4dea8c,_0x50353a){_0x50353a=_0x50353a||0xc8;return function(_0x38b6bd){if(_0x38b6bd){return _0x4dea8c['status'](_0x50353a)[_0x3313('0x1b')](_0x38b6bd);}};}function respondWithFilteredResult(_0x318b92,_0x3da3f9){return function(_0x3ba926){if(_0x3ba926){var _0x316cd2=typeof _0x3da3f9[_0x3313('0x1c')]===_0x3313('0x1d')&&typeof _0x3da3f9[_0x3313('0x1e')]===_0x3313('0x1d');var _0xd013c6=_0x3ba926['count'];var _0x2f3eb5=_0x316cd2?0x0:_0x3da3f9[_0x3313('0x1c')];var _0x125bf2=_0x316cd2?_0x3ba926[_0x3313('0x1f')]:_0x3da3f9[_0x3313('0x1c')]+_0x3da3f9[_0x3313('0x1e')];var _0x1708f7;if(_0x125bf2>=_0xd013c6){_0x125bf2=_0xd013c6;_0x1708f7=0xc8;}else{_0x1708f7=0xce;}_0x318b92['status'](_0x1708f7);return _0x318b92[_0x3313('0x20')]('Content-Range',_0x2f3eb5+'-'+_0x125bf2+'/'+_0xd013c6)[_0x3313('0x1b')](_0x3ba926);}return null;};}function patchUpdates(_0x285842){return function(_0x403e46){try{jsonpatch[_0x3313('0x21')](_0x403e46,_0x285842,!![]);}catch(_0x16bf92){return BPromise[_0x3313('0x22')](_0x16bf92);}return _0x403e46[_0x3313('0x23')]();};}function saveUpdates(_0x429271,_0x3d88d1){return function(_0x595840){if(_0x595840){return _0x595840[_0x3313('0x24')](_0x429271)[_0x3313('0x25')](function(_0x327b98){return _0x327b98;});}return null;};}function removeEntity(_0x19bbf0,_0xa5cff7){return function(_0x26fc23){if(_0x26fc23){return _0x26fc23[_0x3313('0x26')]()[_0x3313('0x25')](function(){_0x19bbf0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eca3c,_0x116724){return function(_0x35ff68){if(!_0x35ff68){_0x5eca3c[_0x3313('0x27')](0x194);}return _0x35ff68;};}function handleError(_0x818701,_0x4df6b7){_0x4df6b7=_0x4df6b7||0x1f4;return function(_0x5635c1){logger[_0x3313('0x28')](_0x5635c1['stack']);if(_0x5635c1[_0x3313('0x29')]){delete _0x5635c1[_0x3313('0x29')];}_0x818701['status'](_0x4df6b7)['send'](_0x5635c1);};}exports[_0x3313('0x2a')]=function(_0x46fc47,_0x1373a5){var _0x5ff9a6={},_0x494993={},_0x36ee42={'count':0x0,'rows':[]};var _0x52cfce=_[_0x3313('0x2b')](db[_0x3313('0x2c')][_0x3313('0x2d')],function(_0x1fcde0){return{'name':_0x1fcde0[_0x3313('0x2e')],'type':_0x1fcde0[_0x3313('0x2f')][_0x3313('0x30')]};});_0x494993[_0x3313('0x31')]=_[_0x3313('0x2b')](_0x52cfce,_0x3313('0x29'));_0x494993[_0x3313('0x32')]=_[_0x3313('0x33')](_0x46fc47['query']);_0x494993[_0x3313('0x34')]=_[_0x3313('0x35')](_0x494993[_0x3313('0x31')],_0x494993[_0x3313('0x32')]);_0x5ff9a6[_0x3313('0x36')]=_[_0x3313('0x35')](_0x494993[_0x3313('0x31')],qs[_0x3313('0x37')](_0x46fc47[_0x3313('0x32')][_0x3313('0x37')]));_0x5ff9a6[_0x3313('0x36')]=_0x5ff9a6[_0x3313('0x36')]['length']?_0x5ff9a6[_0x3313('0x36')]:_0x494993['model'];if(!_0x46fc47[_0x3313('0x32')][_0x3313('0x38')]('nolimit')){_0x5ff9a6[_0x3313('0x1e')]=qs[_0x3313('0x1e')](_0x46fc47[_0x3313('0x32')]['limit']);_0x5ff9a6[_0x3313('0x1c')]=qs[_0x3313('0x1c')](_0x46fc47[_0x3313('0x32')][_0x3313('0x1c')]);}_0x5ff9a6[_0x3313('0x39')]=qs[_0x3313('0x3a')](_0x46fc47['query'][_0x3313('0x3a')]);_0x5ff9a6[_0x3313('0x3b')]=qs[_0x3313('0x34')](_['pick'](_0x46fc47[_0x3313('0x32')],_0x494993[_0x3313('0x34')]),_0x52cfce);if(_0x46fc47[_0x3313('0x32')][_0x3313('0x3c')]){_0x5ff9a6[_0x3313('0x3b')]=_['merge'](_0x5ff9a6[_0x3313('0x3b')],{'$or':_[_0x3313('0x2b')](_0x52cfce,function(_0xf54763){if(_0xf54763[_0x3313('0x2f')]!=='VIRTUAL'){var _0x59f97b={};_0x59f97b[_0xf54763[_0x3313('0x29')]]={'$like':'%'+_0x46fc47[_0x3313('0x32')]['filter']+'%'};return _0x59f97b;}})});}_0x5ff9a6=_['merge']({},_0x5ff9a6,_0x46fc47[_0x3313('0x3d')]);var _0x15283c={'where':_0x5ff9a6[_0x3313('0x3b')]};return db[_0x3313('0x2c')][_0x3313('0x1f')](_0x15283c)['then'](function(_0x5622bf){_0x36ee42['count']=_0x5622bf;if(_0x46fc47[_0x3313('0x32')][_0x3313('0x3e')]){_0x5ff9a6[_0x3313('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x3313('0x40')](_0x5ff9a6);})['then'](function(_0x48ced1){_0x36ee42[_0x3313('0x41')]=_0x48ced1;return _0x36ee42;})['then'](respondWithFilteredResult(_0x1373a5,_0x5ff9a6))[_0x3313('0x42')](handleError(_0x1373a5,null));};exports[_0x3313('0x43')]=function(_0x52cba1,_0x517d26){var _0x4822bb={'raw':![],'where':{'id':_0x52cba1[_0x3313('0x44')]['id']}},_0x38b9a6={};_0x38b9a6[_0x3313('0x31')]=_[_0x3313('0x33')](db['ServicenowConfiguration'][_0x3313('0x2d')]);_0x38b9a6['query']=_[_0x3313('0x33')](_0x52cba1[_0x3313('0x32')]);_0x38b9a6['filters']=_[_0x3313('0x35')](_0x38b9a6[_0x3313('0x31')],_0x38b9a6[_0x3313('0x32')]);_0x4822bb[_0x3313('0x36')]=_[_0x3313('0x35')](_0x38b9a6[_0x3313('0x31')],qs[_0x3313('0x37')](_0x52cba1['query'][_0x3313('0x37')]));_0x4822bb[_0x3313('0x36')]=_0x4822bb[_0x3313('0x36')]['length']?_0x4822bb[_0x3313('0x36')]:_0x38b9a6[_0x3313('0x31')];if(_0x52cba1[_0x3313('0x32')][_0x3313('0x3e')]){_0x4822bb['include']=[{'all':!![]}];}_0x4822bb=_[_0x3313('0x45')]({},_0x4822bb,_0x52cba1[_0x3313('0x3d')]);return db['ServicenowConfiguration']['find'](_0x4822bb)[_0x3313('0x25')](handleEntityNotFound(_0x517d26,null))[_0x3313('0x25')](respondWithResult(_0x517d26,null))[_0x3313('0x42')](handleError(_0x517d26,null));};exports[_0x3313('0x46')]=function(_0x26e623,_0xff340d){return db[_0x3313('0x2c')][_0x3313('0x46')](_0x26e623['body'],{})[_0x3313('0x25')](respondWithResult(_0xff340d,0xc9))[_0x3313('0x42')](handleError(_0xff340d,null));};exports[_0x3313('0x24')]=function(_0xc59817,_0x4beb1b){if(_0xc59817[_0x3313('0x47')]['id']){delete _0xc59817['body']['id'];}return db['ServicenowConfiguration'][_0x3313('0x48')]({'where':{'id':_0xc59817[_0x3313('0x44')]['id']}})['then'](handleEntityNotFound(_0x4beb1b,null))[_0x3313('0x25')](saveUpdates(_0xc59817['body'],null))[_0x3313('0x25')](respondWithResult(_0x4beb1b,null))['catch'](handleError(_0x4beb1b,null));};exports['destroy']=function(_0x68ae38,_0x6df2fa){return db[_0x3313('0x2c')][_0x3313('0x48')]({'where':{'id':_0x68ae38[_0x3313('0x44')]['id']}})['then'](handleEntityNotFound(_0x6df2fa,null))[_0x3313('0x25')](removeEntity(_0x6df2fa,null))[_0x3313('0x42')](handleError(_0x6df2fa,null));};exports['getFields']=function(_0x53867d,_0x5f2f18,_0x4d5b34){var _0x58500d={};var _0x5a7c2b={};var _0x3af3d2;var _0x192703;return db[_0x3313('0x2c')][_0x3313('0x49')]({'where':{'id':_0x53867d[_0x3313('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f2f18,null))[_0x3313('0x25')](function(_0x524715){if(_0x524715){_0x3af3d2=_0x524715;_0x5a7c2b['model']=_[_0x3313('0x33')](db[_0x3313('0x4a')][_0x3313('0x2d')]);_0x5a7c2b[_0x3313('0x32')]=_[_0x3313('0x33')](_0x53867d[_0x3313('0x32')]);_0x5a7c2b[_0x3313('0x34')]=_['intersection'](_0x5a7c2b['model'],_0x5a7c2b['query']);_0x58500d[_0x3313('0x36')]=_[_0x3313('0x35')](_0x5a7c2b[_0x3313('0x31')],qs[_0x3313('0x37')](_0x53867d[_0x3313('0x32')][_0x3313('0x37')]));_0x58500d[_0x3313('0x36')]=_0x58500d['attributes'][_0x3313('0x4b')]?_0x58500d[_0x3313('0x36')]:_0x5a7c2b[_0x3313('0x31')];_0x58500d[_0x3313('0x39')]=qs[_0x3313('0x3a')](_0x53867d[_0x3313('0x32')][_0x3313('0x3a')]);_0x58500d[_0x3313('0x3b')]=qs['filters'](_[_0x3313('0x4c')](_0x53867d[_0x3313('0x32')],_0x5a7c2b['filters']));if(_0x53867d[_0x3313('0x32')]['filter']){_0x58500d[_0x3313('0x3b')]=_[_0x3313('0x45')](_0x58500d[_0x3313('0x3b')],{'$or':_[_0x3313('0x2b')](_0x58500d[_0x3313('0x36')],function(_0x107e02){var _0x15b72e={};_0x15b72e[_0x107e02]={'$like':'%'+_0x53867d[_0x3313('0x32')]['filter']+'%'};return _0x15b72e;})});}_0x58500d=_[_0x3313('0x45')]({},_0x58500d,_0x53867d[_0x3313('0x3d')]);return _0x3af3d2[_0x3313('0x4d')](_0x58500d);}})['then'](function(_0x2a344b){if(_0x2a344b){_0x192703=_0x2a344b['length'];if(!_0x53867d[_0x3313('0x32')][_0x3313('0x38')](_0x3313('0x4e'))){_0x58500d[_0x3313('0x1e')]=qs[_0x3313('0x1e')](_0x53867d['query'][_0x3313('0x1e')]);_0x58500d[_0x3313('0x1c')]=qs['offset'](_0x53867d['query']['offset']);}return _0x3af3d2[_0x3313('0x4d')](_0x58500d);}})[_0x3313('0x25')](function(_0x310305){if(_0x310305){return _0x310305?{'count':_0x192703,'rows':_0x310305}:null;}})['then'](respondWithResult(_0x5f2f18,null))[_0x3313('0x42')](handleError(_0x5f2f18,null));};exports[_0x3313('0x4f')]=function(_0x30611e,_0xa1fe3e,_0x57c3d0){var _0x312614={};var _0x1e88c4={};var _0x3ec548;var _0x3d3a43;return db['ServicenowConfiguration'][_0x3313('0x49')]({'where':{'id':_0x30611e[_0x3313('0x44')]['id']}})[_0x3313('0x25')](handleEntityNotFound(_0xa1fe3e,null))[_0x3313('0x25')](function(_0x5cab20){if(_0x5cab20){_0x3ec548=_0x5cab20;_0x1e88c4[_0x3313('0x31')]=_[_0x3313('0x33')](db[_0x3313('0x4a')][_0x3313('0x2d')]);_0x1e88c4['query']=_[_0x3313('0x33')](_0x30611e[_0x3313('0x32')]);_0x1e88c4[_0x3313('0x34')]=_[_0x3313('0x35')](_0x1e88c4[_0x3313('0x31')],_0x1e88c4['query']);_0x312614[_0x3313('0x36')]=_[_0x3313('0x35')](_0x1e88c4['model'],qs[_0x3313('0x37')](_0x30611e[_0x3313('0x32')][_0x3313('0x37')]));_0x312614[_0x3313('0x36')]=_0x312614[_0x3313('0x36')][_0x3313('0x4b')]?_0x312614[_0x3313('0x36')]:_0x1e88c4[_0x3313('0x31')];_0x312614[_0x3313('0x39')]=qs[_0x3313('0x3a')](_0x30611e[_0x3313('0x32')][_0x3313('0x3a')]);_0x312614[_0x3313('0x3b')]=qs[_0x3313('0x34')](_['pick'](_0x30611e[_0x3313('0x32')],_0x1e88c4['filters']));if(_0x30611e['query']['filter']){_0x312614[_0x3313('0x3b')]=_[_0x3313('0x45')](_0x312614[_0x3313('0x3b')],{'$or':_['map'](_0x312614[_0x3313('0x36')],function(_0x24ff99){var _0x5d4832={};_0x5d4832[_0x24ff99]={'$like':'%'+_0x30611e[_0x3313('0x32')][_0x3313('0x3c')]+'%'};return _0x5d4832;})});}_0x312614=_['merge']({},_0x312614,_0x30611e['options']);return _0x3ec548['getSubjects'](_0x312614);}})['then'](function(_0x275845){if(_0x275845){_0x3d3a43=_0x275845[_0x3313('0x4b')];if(!_0x30611e[_0x3313('0x32')][_0x3313('0x38')](_0x3313('0x4e'))){_0x312614['limit']=qs['limit'](_0x30611e[_0x3313('0x32')]['limit']);_0x312614[_0x3313('0x1c')]=qs[_0x3313('0x1c')](_0x30611e[_0x3313('0x32')]['offset']);}return _0x3ec548[_0x3313('0x4f')](_0x312614);}})['then'](function(_0x25fd48){if(_0x25fd48){return _0x25fd48?{'count':_0x3d3a43,'rows':_0x25fd48}:null;}})[_0x3313('0x25')](respondWithResult(_0xa1fe3e,null))[_0x3313('0x42')](handleError(_0xa1fe3e,null));};exports['getDescriptions']=function(_0x441cc0,_0x260ab0,_0x2e15b3){var _0x5692c5={};var _0x33790b={};var _0x5be556;var _0x2488c6;return db[_0x3313('0x2c')]['findOne']({'where':{'id':_0x441cc0['params']['id']}})[_0x3313('0x25')](handleEntityNotFound(_0x260ab0,null))['then'](function(_0x38ce94){if(_0x38ce94){_0x5be556=_0x38ce94;_0x33790b[_0x3313('0x31')]=_[_0x3313('0x33')](db[_0x3313('0x4a')][_0x3313('0x2d')]);_0x33790b['query']=_[_0x3313('0x33')](_0x441cc0[_0x3313('0x32')]);_0x33790b[_0x3313('0x34')]=_[_0x3313('0x35')](_0x33790b[_0x3313('0x31')],_0x33790b[_0x3313('0x32')]);_0x5692c5['attributes']=_['intersection'](_0x33790b['model'],qs[_0x3313('0x37')](_0x441cc0['query'][_0x3313('0x37')]));_0x5692c5['attributes']=_0x5692c5[_0x3313('0x36')][_0x3313('0x4b')]?_0x5692c5['attributes']:_0x33790b[_0x3313('0x31')];_0x5692c5[_0x3313('0x39')]=qs[_0x3313('0x3a')](_0x441cc0['query']['sort']);_0x5692c5[_0x3313('0x3b')]=qs[_0x3313('0x34')](_[_0x3313('0x4c')](_0x441cc0[_0x3313('0x32')],_0x33790b[_0x3313('0x34')]));if(_0x441cc0['query']['filter']){_0x5692c5[_0x3313('0x3b')]=_[_0x3313('0x45')](_0x5692c5[_0x3313('0x3b')],{'$or':_[_0x3313('0x2b')](_0x5692c5[_0x3313('0x36')],function(_0x10f6be){var _0x223d2e={};_0x223d2e[_0x10f6be]={'$like':'%'+_0x441cc0[_0x3313('0x32')]['filter']+'%'};return _0x223d2e;})});}_0x5692c5=_[_0x3313('0x45')]({},_0x5692c5,_0x441cc0[_0x3313('0x3d')]);return _0x5be556[_0x3313('0x50')](_0x5692c5);}})[_0x3313('0x25')](function(_0x5e73a3){if(_0x5e73a3){_0x2488c6=_0x5e73a3[_0x3313('0x4b')];if(!_0x441cc0[_0x3313('0x32')][_0x3313('0x38')](_0x3313('0x4e'))){_0x5692c5['limit']=qs[_0x3313('0x1e')](_0x441cc0[_0x3313('0x32')][_0x3313('0x1e')]);_0x5692c5[_0x3313('0x1c')]=qs[_0x3313('0x1c')](_0x441cc0[_0x3313('0x32')][_0x3313('0x1c')]);}return _0x5be556['getDescriptions'](_0x5692c5);}})[_0x3313('0x25')](function(_0x116874){if(_0x116874){return _0x116874?{'count':_0x2488c6,'rows':_0x116874}:null;}})[_0x3313('0x25')](respondWithResult(_0x260ab0,null))[_0x3313('0x42')](handleError(_0x260ab0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ad66bf0..a8ffb61 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 _0x3f72=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var logger=require(_0x23f7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x23f7('0x3'));var rp=require(_0x23f7('0x4'));var fs=require('fs');var path=require(_0x23f7('0x5'));var rimraf=require(_0x23f7('0x6'));var config=require(_0x23f7('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x23f7('0x8')]=function(_0x4d8274,_0xac4499){return _0x4d8274['define'](_0x23f7('0x9'),attributes,{'tableName':_0x23f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb3f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0xeb3f,0xa8));var _0xfeb3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb3f[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xfeb3('0x0'));var util=require(_0xfeb3('0x1'));var logger=require(_0xfeb3('0x2'))(_0xfeb3('0x3'));var moment=require(_0xfeb3('0x4'));var BPromise=require(_0xfeb3('0x5'));var rp=require(_0xfeb3('0x6'));var fs=require('fs');var path=require(_0xfeb3('0x7'));var rimraf=require(_0xfeb3('0x8'));var config=require(_0xfeb3('0x9'));var attributes=require(_0xfeb3('0xa'));module[_0xfeb3('0xb')]=function(_0x455738,_0x10fa12){return _0x455738[_0xfeb3('0xc')]('ServicenowConfiguration',attributes,{'tableName':_0xfeb3('0xd'),'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 63627d8..c56cde5 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 _0xfbc7=['rpc','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xfbc7,0x134));var _0x7fbc=function(_0x377090,_0x47d4e5){_0x377090=_0x377090-0x0;var _0x57d752=_0xfbc7[_0x377090];return _0x57d752;};'use strict';var _=require('lodash');var util=require(_0x7fbc('0x0'));var moment=require(_0x7fbc('0x1'));var BPromise=require('bluebird');var rs=require(_0x7fbc('0x2'));var fs=require('fs');var Redis=require(_0x7fbc('0x3'));var db=require(_0x7fbc('0x4'))['db'];var utils=require(_0x7fbc('0x5'));var logger=require(_0x7fbc('0x6'))(_0x7fbc('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fbc('0x8'));var client=jayson[_0x7fbc('0x9')][_0x7fbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae468,_0x313e54,_0x4dbd91){return new BPromise(function(_0x452e31,_0x8ba0ad){return client[_0x7fbc('0xb')](_0x3ae468,_0x4dbd91)['then'](function(_0x2c458f){logger[_0x7fbc('0xc')](_0x7fbc('0xd'),_0x313e54,'request\x20sent');logger['debug'](_0x7fbc('0xe'),_0x313e54,'request\x20sent',JSON[_0x7fbc('0xf')](_0x2c458f));if(_0x2c458f['error']){if(_0x2c458f[_0x7fbc('0x10')]['code']===0x1f4){logger[_0x7fbc('0x10')](_0x7fbc('0xd'),_0x313e54,_0x2c458f['error'][_0x7fbc('0x11')]);return _0x8ba0ad(_0x2c458f[_0x7fbc('0x10')]['message']);}logger[_0x7fbc('0x10')](_0x7fbc('0xd'),_0x313e54,_0x2c458f[_0x7fbc('0x10')][_0x7fbc('0x11')]);return _0x452e31(_0x2c458f[_0x7fbc('0x10')][_0x7fbc('0x11')]);}else{logger['info'](_0x7fbc('0xd'),_0x313e54,_0x7fbc('0x12'));_0x452e31(_0x2c458f[_0x7fbc('0x13')][_0x7fbc('0x11')]);}})[_0x7fbc('0x14')](function(_0x4433cc){logger['error'](_0x7fbc('0xd'),_0x313e54,_0x4433cc);_0x8ba0ad(_0x4433cc);});});} \ No newline at end of file +var _0xda5b=['info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2cd0e6,_0x4182b8){var _0x2e4df7=function(_0x44043f){while(--_0x44043f){_0x2cd0e6['push'](_0x2cd0e6['shift']());}};_0x2e4df7(++_0x4182b8);}(_0xda5b,0xc8));var _0xbda5=function(_0x3ff332,_0x145564){_0x3ff332=_0x3ff332-0x0;var _0x5a2264=_0xda5b[_0x3ff332];return _0x5a2264;};'use strict';var _=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var moment=require('moment');var BPromise=require(_0xbda5('0x2'));var rs=require(_0xbda5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbda5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbda5('0x5'))(_0xbda5('0x6'));var config=require(_0xbda5('0x7'));var jayson=require(_0xbda5('0x8'));var client=jayson[_0xbda5('0x9')][_0xbda5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0efc,_0x175bd5,_0x4965cf){return new BPromise(function(_0x558879,_0x410198){return client[_0xbda5('0xb')](_0x1e0efc,_0x4965cf)['then'](function(_0x1f4806){logger['info'](_0xbda5('0xc'),_0x175bd5,_0xbda5('0xd'));logger[_0xbda5('0xe')](_0xbda5('0xf'),_0x175bd5,'request\x20sent',JSON[_0xbda5('0x10')](_0x1f4806));if(_0x1f4806[_0xbda5('0x11')]){if(_0x1f4806[_0xbda5('0x11')][_0xbda5('0x12')]===0x1f4){logger[_0xbda5('0x11')](_0xbda5('0xc'),_0x175bd5,_0x1f4806[_0xbda5('0x11')][_0xbda5('0x13')]);return _0x410198(_0x1f4806[_0xbda5('0x11')][_0xbda5('0x13')]);}logger[_0xbda5('0x11')](_0xbda5('0xc'),_0x175bd5,_0x1f4806[_0xbda5('0x11')][_0xbda5('0x13')]);return _0x558879(_0x1f4806[_0xbda5('0x11')]['message']);}else{logger[_0xbda5('0x14')](_0xbda5('0xc'),_0x175bd5,'request\x20sent');_0x558879(_0x1f4806[_0xbda5('0x15')][_0xbda5('0x13')]);}})['catch'](function(_0x237755){logger[_0xbda5('0x11')](_0xbda5('0xc'),_0x175bd5,_0x237755);_0x410198(_0x237755);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 5fac7a5..795e14c 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 _0x4a8a=['util','path','express','fs-extra','../../config/environment','./intServicenowField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0xedde59,_0x50d9b1){var _0x4db279=function(_0xa24719){while(--_0xa24719){_0xedde59['push'](_0xedde59['shift']());}};_0x4db279(++_0x50d9b1);}(_0x4a8a,0x187));var _0xa4a8=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x4a8a[_0x1ae4a9];return _0x54d0b0;};'use strict';var multer=require('multer');var util=require(_0xa4a8('0x0'));var path=require(_0xa4a8('0x1'));var timeout=require('connect-timeout');var express=require(_0xa4a8('0x2'));var router=express['Router']();var fs_extra=require(_0xa4a8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa4a8('0x4'));var controller=require(_0xa4a8('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa4a8('0x6')]);router[_0xa4a8('0x7')](_0xa4a8('0x8'),auth[_0xa4a8('0x9')](),controller[_0xa4a8('0xa')]);router[_0xa4a8('0xb')]('/',auth[_0xa4a8('0x9')](),controller[_0xa4a8('0xc')]);router[_0xa4a8('0xd')]('/:id',auth[_0xa4a8('0x9')](),controller[_0xa4a8('0xe')]);router[_0xa4a8('0xf')](_0xa4a8('0x8'),auth['isAuthenticated'](),controller[_0xa4a8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe2bc=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','post','delete','multer','path'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xe2bc,0xb9));var _0xce2b=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xe2bc[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0xce2b('0x0'));var util=require('util');var path=require(_0xce2b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xce2b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xce2b('0x3'));var config=require(_0xce2b('0x4'));var controller=require(_0xce2b('0x5'));router[_0xce2b('0x6')]('/',auth[_0xce2b('0x7')](),controller['index']);router[_0xce2b('0x6')](_0xce2b('0x8'),auth[_0xce2b('0x7')](),controller['show']);router[_0xce2b('0x9')]('/',auth[_0xce2b('0x7')](),controller['create']);router['put'](_0xce2b('0x8'),auth[_0xce2b('0x7')](),controller['update']);router[_0xce2b('0xa')](_0xce2b('0x8'),auth[_0xce2b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e8232aa..a5b0c49 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 _0xd051=['picklist','STRING','ENUM','customVariable','sequelize','exports','string','variable','keyValue'];(function(_0x2d91de,_0x3eb0fa){var _0x2341e9=function(_0x2dad2a){while(--_0x2dad2a){_0x2d91de['push'](_0x2d91de['shift']());}};_0x2341e9(++_0x3eb0fa);}(_0xd051,0x8b));var _0x1d05=function(_0x13193e,_0x49cd42){_0x13193e=_0x13193e-0x0;var _0xcc200c=_0xd051[_0x13193e];return _0xcc200c;};'use strict';var Sequelize=require(_0x1d05('0x0'));module[_0x1d05('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1d05('0x2'),_0x1d05('0x3'),'customVariable',_0x1d05('0x4'),_0x1d05('0x5')),'defaultValue':_0x1d05('0x2')},'content':{'type':Sequelize[_0x1d05('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1d05('0x7')](_0x1d05('0x2'),_0x1d05('0x3'),_0x1d05('0x8'))},'keyContent':{'type':Sequelize[_0x1d05('0x6')]},'idField':{'type':Sequelize[_0x1d05('0x6')]},'nameField':{'type':Sequelize[_0x1d05('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6742=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x31a0fc,_0x4e24df){var _0x4e8d1d=function(_0x38915c){while(--_0x38915c){_0x31a0fc['push'](_0x31a0fc['shift']());}};_0x4e8d1d(++_0x4e24df);}(_0x6742,0x1b8));var _0x2674=function(_0x388bbb,_0x56cdd2){_0x388bbb=_0x388bbb-0x0;var _0x3a60d8=_0x6742[_0x388bbb];return _0x3a60d8;};'use strict';var Sequelize=require(_0x2674('0x0'));module[_0x2674('0x1')]={'type':{'type':Sequelize[_0x2674('0x2')](_0x2674('0x3'),_0x2674('0x4'),_0x2674('0x5'),_0x2674('0x6'),_0x2674('0x7')),'defaultValue':_0x2674('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2674('0x2')](_0x2674('0x3'),_0x2674('0x4'),_0x2674('0x5'))},'keyContent':{'type':Sequelize[_0x2674('0x8')]},'idField':{'type':Sequelize[_0x2674('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2674('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2674('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a7deb78..5d4798a 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 _0xc46d=['includeAll','include','findAll','catch','show','options','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x50a075,_0x4a7c30){var _0x34309c=function(_0x2744a0){while(--_0x2744a0){_0x50a075['push'](_0x50a075['shift']());}};_0x34309c(++_0x4a7c30);}(_0xc46d,0x17c));var _0xdc46=function(_0x4c83fb,_0x37d4e1){_0x4c83fb=_0x4c83fb-0x0;var _0x3afda3=_0xc46d[_0x4c83fb];return _0x3afda3;};'use strict';var emlformat=require(_0xdc46('0x0'));var rimraf=require(_0xdc46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc46('0x2'));var rp=require(_0xdc46('0x3'));var moment=require(_0xdc46('0x4'));var BPromise=require(_0xdc46('0x5'));var Mustache=require(_0xdc46('0x6'));var util=require(_0xdc46('0x7'));var path=require(_0xdc46('0x8'));var sox=require(_0xdc46('0x9'));var csv=require(_0xdc46('0xa'));var ejs=require(_0xdc46('0xb'));var fs=require('fs');var fs_extra=require(_0xdc46('0xc'));var _=require('lodash');var squel=require(_0xdc46('0xd'));var crypto=require(_0xdc46('0xe'));var jsforce=require(_0xdc46('0xf'));var deskjs=require(_0xdc46('0x10'));var toCsv=require(_0xdc46('0xa'));var querystring=require(_0xdc46('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdc46('0x12'));var as=require(_0xdc46('0x13'));var hardwareService=require(_0xdc46('0x14'));var logger=require(_0xdc46('0x15'))('api');var utils=require(_0xdc46('0x16'));var config=require(_0xdc46('0x17'));var licenseUtil=require(_0xdc46('0x18'));var db=require(_0xdc46('0x19'))['db'];function respondWithStatusCode(_0x3a3576,_0xfc540){_0xfc540=_0xfc540||0xcc;return function(_0x387314){if(_0x387314){return _0x3a3576[_0xdc46('0x1a')](_0xfc540);}return _0x3a3576[_0xdc46('0x1b')](_0xfc540)['end']();};}function respondWithResult(_0x519c2e,_0xffc068){_0xffc068=_0xffc068||0xc8;return function(_0x494d31){if(_0x494d31){return _0x519c2e[_0xdc46('0x1b')](_0xffc068)[_0xdc46('0x1c')](_0x494d31);}};}function respondWithFilteredResult(_0x2e678b,_0x35a93b){return function(_0xe29bf3){if(_0xe29bf3){var _0x370194=typeof _0x35a93b['offset']===_0xdc46('0x1d')&&typeof _0x35a93b[_0xdc46('0x1e')]===_0xdc46('0x1d');var _0x510409=_0xe29bf3[_0xdc46('0x1f')];var _0x3d3291=_0x370194?0x0:_0x35a93b['offset'];var _0x2eb11e=_0x370194?_0xe29bf3[_0xdc46('0x1f')]:_0x35a93b[_0xdc46('0x20')]+_0x35a93b['limit'];var _0x5ff2e4;if(_0x2eb11e>=_0x510409){_0x2eb11e=_0x510409;_0x5ff2e4=0xc8;}else{_0x5ff2e4=0xce;}_0x2e678b[_0xdc46('0x1b')](_0x5ff2e4);return _0x2e678b['set'](_0xdc46('0x21'),_0x3d3291+'-'+_0x2eb11e+'/'+_0x510409)[_0xdc46('0x1c')](_0xe29bf3);}return null;};}function patchUpdates(_0x128ad5){return function(_0x1e36f8){try{jsonpatch[_0xdc46('0x22')](_0x1e36f8,_0x128ad5,!![]);}catch(_0x16903e){return BPromise[_0xdc46('0x23')](_0x16903e);}return _0x1e36f8['save']();};}function saveUpdates(_0x1dc5bf,_0xf8f6b7){return function(_0xea30ef){if(_0xea30ef){return _0xea30ef[_0xdc46('0x24')](_0x1dc5bf)[_0xdc46('0x25')](function(_0x39f30b){return _0x39f30b;});}return null;};}function removeEntity(_0x28fb3e,_0x34ea19){return function(_0x8fef76){if(_0x8fef76){return _0x8fef76['destroy']()['then'](function(){_0x28fb3e[_0xdc46('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47af41,_0xf3817e){return function(_0x383a5b){if(!_0x383a5b){_0x47af41[_0xdc46('0x1a')](0x194);}return _0x383a5b;};}function handleError(_0xf766c6,_0x3966ab){_0x3966ab=_0x3966ab||0x1f4;return function(_0x59b608){logger[_0xdc46('0x26')](_0x59b608['stack']);if(_0x59b608[_0xdc46('0x27')]){delete _0x59b608[_0xdc46('0x27')];}_0xf766c6['status'](_0x3966ab)[_0xdc46('0x28')](_0x59b608);};}exports[_0xdc46('0x29')]=function(_0x5945ae,_0x19e6a7){var _0x3bff92={},_0x16d4c3={},_0x53d061={'count':0x0,'rows':[]};var _0x1cc3ec=_[_0xdc46('0x2a')](db[_0xdc46('0x2b')][_0xdc46('0x2c')],function(_0x100b3){return{'name':_0x100b3[_0xdc46('0x2d')],'type':_0x100b3[_0xdc46('0x2e')][_0xdc46('0x2f')]};});_0x16d4c3['model']=_[_0xdc46('0x2a')](_0x1cc3ec,'name');_0x16d4c3[_0xdc46('0x30')]=_[_0xdc46('0x31')](_0x5945ae[_0xdc46('0x30')]);_0x16d4c3['filters']=_[_0xdc46('0x32')](_0x16d4c3['model'],_0x16d4c3[_0xdc46('0x30')]);_0x3bff92[_0xdc46('0x33')]=_[_0xdc46('0x32')](_0x16d4c3[_0xdc46('0x34')],qs[_0xdc46('0x35')](_0x5945ae[_0xdc46('0x30')]['fields']));_0x3bff92[_0xdc46('0x33')]=_0x3bff92[_0xdc46('0x33')][_0xdc46('0x36')]?_0x3bff92['attributes']:_0x16d4c3[_0xdc46('0x34')];if(!_0x5945ae[_0xdc46('0x30')][_0xdc46('0x37')]('nolimit')){_0x3bff92[_0xdc46('0x1e')]=qs[_0xdc46('0x1e')](_0x5945ae[_0xdc46('0x30')][_0xdc46('0x1e')]);_0x3bff92[_0xdc46('0x20')]=qs[_0xdc46('0x20')](_0x5945ae[_0xdc46('0x30')][_0xdc46('0x20')]);}_0x3bff92[_0xdc46('0x38')]=qs[_0xdc46('0x39')](_0x5945ae['query'][_0xdc46('0x39')]);_0x3bff92['where']=qs[_0xdc46('0x3a')](_[_0xdc46('0x3b')](_0x5945ae[_0xdc46('0x30')],_0x16d4c3[_0xdc46('0x3a')]),_0x1cc3ec);if(_0x5945ae[_0xdc46('0x30')][_0xdc46('0x3c')]){_0x3bff92[_0xdc46('0x3d')]=_[_0xdc46('0x3e')](_0x3bff92[_0xdc46('0x3d')],{'$or':_[_0xdc46('0x2a')](_0x1cc3ec,function(_0x1b9c52){if(_0x1b9c52[_0xdc46('0x2e')]!==_0xdc46('0x3f')){var _0x227f56={};_0x227f56[_0x1b9c52[_0xdc46('0x27')]]={'$like':'%'+_0x5945ae[_0xdc46('0x30')][_0xdc46('0x3c')]+'%'};return _0x227f56;}})});}_0x3bff92=_[_0xdc46('0x3e')]({},_0x3bff92,_0x5945ae['options']);var _0x4bb896={'where':_0x3bff92[_0xdc46('0x3d')]};return db['ServicenowField'][_0xdc46('0x1f')](_0x4bb896)['then'](function(_0x29f90f){_0x53d061[_0xdc46('0x1f')]=_0x29f90f;if(_0x5945ae[_0xdc46('0x30')][_0xdc46('0x40')]){_0x3bff92[_0xdc46('0x41')]=[{'all':!![]}];}return db[_0xdc46('0x2b')][_0xdc46('0x42')](_0x3bff92);})[_0xdc46('0x25')](function(_0x50add1){_0x53d061['rows']=_0x50add1;return _0x53d061;})[_0xdc46('0x25')](respondWithFilteredResult(_0x19e6a7,_0x3bff92))[_0xdc46('0x43')](handleError(_0x19e6a7,null));};exports[_0xdc46('0x44')]=function(_0x513abe,_0x534374){var _0x4c07a7={'raw':!![],'where':{'id':_0x513abe['params']['id']}},_0x52e22c={};_0x52e22c['model']=_[_0xdc46('0x31')](db[_0xdc46('0x2b')][_0xdc46('0x2c')]);_0x52e22c[_0xdc46('0x30')]=_[_0xdc46('0x31')](_0x513abe[_0xdc46('0x30')]);_0x52e22c['filters']=_[_0xdc46('0x32')](_0x52e22c[_0xdc46('0x34')],_0x52e22c[_0xdc46('0x30')]);_0x4c07a7[_0xdc46('0x33')]=_[_0xdc46('0x32')](_0x52e22c[_0xdc46('0x34')],qs['fields'](_0x513abe[_0xdc46('0x30')][_0xdc46('0x35')]));_0x4c07a7[_0xdc46('0x33')]=_0x4c07a7['attributes'][_0xdc46('0x36')]?_0x4c07a7[_0xdc46('0x33')]:_0x52e22c[_0xdc46('0x34')];if(_0x513abe[_0xdc46('0x30')][_0xdc46('0x40')]){_0x4c07a7[_0xdc46('0x41')]=[{'all':!![]}];}_0x4c07a7=_['merge']({},_0x4c07a7,_0x513abe[_0xdc46('0x45')]);return db[_0xdc46('0x2b')]['find'](_0x4c07a7)['then'](handleEntityNotFound(_0x534374,null))[_0xdc46('0x25')](respondWithResult(_0x534374,null))['catch'](handleError(_0x534374,null));};exports[_0xdc46('0x46')]=function(_0x5b1e86,_0x5b67cb){return db[_0xdc46('0x2b')][_0xdc46('0x46')](_0x5b1e86[_0xdc46('0x47')],{})[_0xdc46('0x25')](respondWithResult(_0x5b67cb,0xc9))[_0xdc46('0x43')](handleError(_0x5b67cb,null));};exports['update']=function(_0x5ec822,_0x32bdee){if(_0x5ec822['body']['id']){delete _0x5ec822[_0xdc46('0x47')]['id'];}return db[_0xdc46('0x2b')][_0xdc46('0x48')]({'where':{'id':_0x5ec822[_0xdc46('0x49')]['id']}})[_0xdc46('0x25')](handleEntityNotFound(_0x32bdee,null))[_0xdc46('0x25')](saveUpdates(_0x5ec822[_0xdc46('0x47')],null))[_0xdc46('0x25')](respondWithResult(_0x32bdee,null))[_0xdc46('0x43')](handleError(_0x32bdee,null));};exports['destroy']=function(_0x11f699,_0x21ccdf){return db[_0xdc46('0x2b')]['find']({'where':{'id':_0x11f699[_0xdc46('0x49')]['id']}})[_0xdc46('0x25')](handleEntityNotFound(_0x21ccdf,null))['then'](removeEntity(_0x21ccdf,null))[_0xdc46('0x43')](handleError(_0x21ccdf,null));}; \ No newline at end of file +var _0x4fd0=['count','offset','limit','set','reject','update','then','destroy','stack','name','send','map','ServicenowField','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined'];(function(_0x3a4544,_0x410078){var _0x1da5a0=function(_0x55d8a4){while(--_0x55d8a4){_0x3a4544['push'](_0x3a4544['shift']());}};_0x1da5a0(++_0x410078);}(_0x4fd0,0xfc));var _0x04fd=function(_0x5a558e,_0x2c0473){_0x5a558e=_0x5a558e-0x0;var _0x44eb26=_0x4fd0[_0x5a558e];return _0x44eb26;};'use strict';var emlformat=require(_0x04fd('0x0'));var rimraf=require(_0x04fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04fd('0x2'));var rp=require('request-promise');var moment=require(_0x04fd('0x3'));var BPromise=require(_0x04fd('0x4'));var Mustache=require(_0x04fd('0x5'));var util=require(_0x04fd('0x6'));var path=require(_0x04fd('0x7'));var sox=require('sox');var csv=require(_0x04fd('0x8'));var ejs=require(_0x04fd('0x9'));var fs=require('fs');var fs_extra=require(_0x04fd('0xa'));var _=require(_0x04fd('0xb'));var squel=require(_0x04fd('0xc'));var crypto=require(_0x04fd('0xd'));var jsforce=require(_0x04fd('0xe'));var deskjs=require(_0x04fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x04fd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04fd('0x11'));var hardwareService=require(_0x04fd('0x12'));var logger=require(_0x04fd('0x13'))(_0x04fd('0x14'));var utils=require(_0x04fd('0x15'));var config=require(_0x04fd('0x16'));var licenseUtil=require(_0x04fd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bea44,_0x3b42e8){_0x3b42e8=_0x3b42e8||0xcc;return function(_0x4ed424){if(_0x4ed424){return _0x3bea44['sendStatus'](_0x3b42e8);}return _0x3bea44[_0x04fd('0x18')](_0x3b42e8)[_0x04fd('0x19')]();};}function respondWithResult(_0x1b8a3d,_0x15c1f1){_0x15c1f1=_0x15c1f1||0xc8;return function(_0x4adb51){if(_0x4adb51){return _0x1b8a3d[_0x04fd('0x18')](_0x15c1f1)[_0x04fd('0x1a')](_0x4adb51);}};}function respondWithFilteredResult(_0x4bc785,_0x210673){return function(_0x5ef050){if(_0x5ef050){var _0x14acfa=typeof _0x210673['offset']===_0x04fd('0x1b')&&typeof _0x210673['limit']===_0x04fd('0x1b');var _0x5049e6=_0x5ef050[_0x04fd('0x1c')];var _0x1576a4=_0x14acfa?0x0:_0x210673[_0x04fd('0x1d')];var _0x559669=_0x14acfa?_0x5ef050['count']:_0x210673[_0x04fd('0x1d')]+_0x210673[_0x04fd('0x1e')];var _0x56850c;if(_0x559669>=_0x5049e6){_0x559669=_0x5049e6;_0x56850c=0xc8;}else{_0x56850c=0xce;}_0x4bc785[_0x04fd('0x18')](_0x56850c);return _0x4bc785[_0x04fd('0x1f')]('Content-Range',_0x1576a4+'-'+_0x559669+'/'+_0x5049e6)[_0x04fd('0x1a')](_0x5ef050);}return null;};}function patchUpdates(_0x5e3fc1){return function(_0x263732){try{jsonpatch['apply'](_0x263732,_0x5e3fc1,!![]);}catch(_0x749f6d){return BPromise[_0x04fd('0x20')](_0x749f6d);}return _0x263732['save']();};}function saveUpdates(_0x3d3f42,_0x411e75){return function(_0x41d182){if(_0x41d182){return _0x41d182[_0x04fd('0x21')](_0x3d3f42)[_0x04fd('0x22')](function(_0x4dfe71){return _0x4dfe71;});}return null;};}function removeEntity(_0x4dbd66,_0x5c8eab){return function(_0x2923fb){if(_0x2923fb){return _0x2923fb[_0x04fd('0x23')]()['then'](function(){_0x4dbd66[_0x04fd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x347360,_0x141dc9){return function(_0xb5f530){if(!_0xb5f530){_0x347360['sendStatus'](0x194);}return _0xb5f530;};}function handleError(_0x566dce,_0x257c2e){_0x257c2e=_0x257c2e||0x1f4;return function(_0x48573e){logger['error'](_0x48573e[_0x04fd('0x24')]);if(_0x48573e['name']){delete _0x48573e[_0x04fd('0x25')];}_0x566dce[_0x04fd('0x18')](_0x257c2e)[_0x04fd('0x26')](_0x48573e);};}exports['index']=function(_0xbb67d6,_0x4ddb17){var _0x16f7cc={},_0x20100e={},_0x4b5f2d={'count':0x0,'rows':[]};var _0x494d2e=_[_0x04fd('0x27')](db[_0x04fd('0x28')][_0x04fd('0x29')],function(_0x49715f){return{'name':_0x49715f['fieldName'],'type':_0x49715f['type'][_0x04fd('0x2a')]};});_0x20100e[_0x04fd('0x2b')]=_[_0x04fd('0x27')](_0x494d2e,_0x04fd('0x25'));_0x20100e[_0x04fd('0x2c')]=_[_0x04fd('0x2d')](_0xbb67d6['query']);_0x20100e[_0x04fd('0x2e')]=_['intersection'](_0x20100e[_0x04fd('0x2b')],_0x20100e[_0x04fd('0x2c')]);_0x16f7cc[_0x04fd('0x2f')]=_[_0x04fd('0x30')](_0x20100e[_0x04fd('0x2b')],qs[_0x04fd('0x31')](_0xbb67d6['query']['fields']));_0x16f7cc[_0x04fd('0x2f')]=_0x16f7cc[_0x04fd('0x2f')][_0x04fd('0x32')]?_0x16f7cc['attributes']:_0x20100e[_0x04fd('0x2b')];if(!_0xbb67d6[_0x04fd('0x2c')][_0x04fd('0x33')](_0x04fd('0x34'))){_0x16f7cc[_0x04fd('0x1e')]=qs['limit'](_0xbb67d6['query'][_0x04fd('0x1e')]);_0x16f7cc[_0x04fd('0x1d')]=qs[_0x04fd('0x1d')](_0xbb67d6[_0x04fd('0x2c')]['offset']);}_0x16f7cc['order']=qs[_0x04fd('0x35')](_0xbb67d6[_0x04fd('0x2c')][_0x04fd('0x35')]);_0x16f7cc[_0x04fd('0x36')]=qs['filters'](_[_0x04fd('0x37')](_0xbb67d6[_0x04fd('0x2c')],_0x20100e[_0x04fd('0x2e')]),_0x494d2e);if(_0xbb67d6[_0x04fd('0x2c')]['filter']){_0x16f7cc[_0x04fd('0x36')]=_[_0x04fd('0x38')](_0x16f7cc[_0x04fd('0x36')],{'$or':_['map'](_0x494d2e,function(_0x2dc87c){if(_0x2dc87c[_0x04fd('0x39')]!==_0x04fd('0x3a')){var _0x5362bd={};_0x5362bd[_0x2dc87c[_0x04fd('0x25')]]={'$like':'%'+_0xbb67d6[_0x04fd('0x2c')][_0x04fd('0x3b')]+'%'};return _0x5362bd;}})});}_0x16f7cc=_[_0x04fd('0x38')]({},_0x16f7cc,_0xbb67d6['options']);var _0x50b790={'where':_0x16f7cc[_0x04fd('0x36')]};return db[_0x04fd('0x28')][_0x04fd('0x1c')](_0x50b790)[_0x04fd('0x22')](function(_0x1ccc2b){_0x4b5f2d[_0x04fd('0x1c')]=_0x1ccc2b;if(_0xbb67d6['query'][_0x04fd('0x3c')]){_0x16f7cc[_0x04fd('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0x04fd('0x3e')](_0x16f7cc);})[_0x04fd('0x22')](function(_0x90fd68){_0x4b5f2d[_0x04fd('0x3f')]=_0x90fd68;return _0x4b5f2d;})[_0x04fd('0x22')](respondWithFilteredResult(_0x4ddb17,_0x16f7cc))[_0x04fd('0x40')](handleError(_0x4ddb17,null));};exports[_0x04fd('0x41')]=function(_0x2f9c46,_0x39f4f3){var _0xa17189={'raw':!![],'where':{'id':_0x2f9c46['params']['id']}},_0x172376={};_0x172376[_0x04fd('0x2b')]=_[_0x04fd('0x2d')](db[_0x04fd('0x28')]['rawAttributes']);_0x172376['query']=_[_0x04fd('0x2d')](_0x2f9c46[_0x04fd('0x2c')]);_0x172376[_0x04fd('0x2e')]=_[_0x04fd('0x30')](_0x172376['model'],_0x172376[_0x04fd('0x2c')]);_0xa17189['attributes']=_[_0x04fd('0x30')](_0x172376[_0x04fd('0x2b')],qs['fields'](_0x2f9c46['query'][_0x04fd('0x31')]));_0xa17189[_0x04fd('0x2f')]=_0xa17189[_0x04fd('0x2f')][_0x04fd('0x32')]?_0xa17189['attributes']:_0x172376[_0x04fd('0x2b')];if(_0x2f9c46[_0x04fd('0x2c')][_0x04fd('0x3c')]){_0xa17189['include']=[{'all':!![]}];}_0xa17189=_[_0x04fd('0x38')]({},_0xa17189,_0x2f9c46['options']);return db[_0x04fd('0x28')][_0x04fd('0x42')](_0xa17189)[_0x04fd('0x22')](handleEntityNotFound(_0x39f4f3,null))[_0x04fd('0x22')](respondWithResult(_0x39f4f3,null))[_0x04fd('0x40')](handleError(_0x39f4f3,null));};exports[_0x04fd('0x43')]=function(_0xed4f1d,_0xff8530){return db[_0x04fd('0x28')]['create'](_0xed4f1d['body'],{})['then'](respondWithResult(_0xff8530,0xc9))[_0x04fd('0x40')](handleError(_0xff8530,null));};exports['update']=function(_0x5ba762,_0x30a99e){if(_0x5ba762[_0x04fd('0x44')]['id']){delete _0x5ba762[_0x04fd('0x44')]['id'];}return db[_0x04fd('0x28')]['find']({'where':{'id':_0x5ba762[_0x04fd('0x45')]['id']}})[_0x04fd('0x22')](handleEntityNotFound(_0x30a99e,null))[_0x04fd('0x22')](saveUpdates(_0x5ba762['body'],null))['then'](respondWithResult(_0x30a99e,null))[_0x04fd('0x40')](handleError(_0x30a99e,null));};exports[_0x04fd('0x23')]=function(_0x309e85,_0x49465e){return db['ServicenowField'][_0x04fd('0x42')]({'where':{'id':_0x309e85['params']['id']}})[_0x04fd('0x22')](handleEntityNotFound(_0x49465e,null))[_0x04fd('0x22')](removeEntity(_0x49465e,null))[_0x04fd('0x40')](handleError(_0x49465e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e9196bf..fbcb43e 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 _0xb887=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x3ff57a,_0x58c2c5){var _0x4ef047=function(_0x3d53a3){while(--_0x3d53a3){_0x3ff57a['push'](_0x3ff57a['shift']());}};_0x4ef047(++_0x58c2c5);}(_0xb887,0xd6));var _0x7b88=function(_0x3e7c70,_0x75b001){_0x3e7c70=_0x3e7c70-0x0;var _0x35b87c=_0xb887[_0x3e7c70];return _0x35b87c;};'use strict';var _=require(_0x7b88('0x0'));var util=require(_0x7b88('0x1'));var logger=require('../../config/logger')(_0x7b88('0x2'));var moment=require(_0x7b88('0x3'));var BPromise=require(_0x7b88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b88('0x5'));var rimraf=require(_0x7b88('0x6'));var config=require(_0x7b88('0x7'));var attributes=require(_0x7b88('0x8'));module[_0x7b88('0x9')]=function(_0x103a31,_0xa4ec2){return _0x103a31[_0x7b88('0xa')]('ServicenowField',attributes,{'tableName':_0x7b88('0xb'),'paranoid':![],'indexes':[{'name':_0x7b88('0xc'),'fields':[_0x7b88('0xd'),_0x7b88('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc562=['api','moment','bluebird','path','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0xae2c8a,_0x392686){var _0x11a11=function(_0x235e0f){while(--_0x235e0f){_0xae2c8a['push'](_0xae2c8a['shift']());}};_0x11a11(++_0x392686);}(_0xc562,0x9a));var _0x2c56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc562[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x2c56('0x0'));var util=require(_0x2c56('0x1'));var logger=require('../../config/logger')(_0x2c56('0x2'));var moment=require(_0x2c56('0x3'));var BPromise=require(_0x2c56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c56('0x5'));var rimraf=require('rimraf');var config=require(_0x2c56('0x6'));var attributes=require(_0x2c56('0x7'));module[_0x2c56('0x8')]=function(_0x10cf9c,_0x3ae96a){return _0x10cf9c['define']('ServicenowField',attributes,{'tableName':_0x2c56('0x9'),'paranoid':![],'indexes':[{'name':_0x2c56('0xa'),'fields':[_0x2c56('0xb'),_0x2c56('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 815f1fc..d1eea0e 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x282069,_0x302eb5){var _0x39a39c=function(_0x1942c4){while(--_0x1942c4){_0x282069['push'](_0x282069['shift']());}};_0x39a39c(++_0x302eb5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xcb91[_0x126f47];return _0x49508a;};'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')]('ServicenowField,\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 _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0xda3f,0xec));var _0xfda3=function(_0x27eb4b,_0x3029a2){_0x27eb4b=_0x27eb4b-0x0;var _0x6c125e=_0xda3f[_0x27eb4b];return _0x6c125e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5e1784b..33096b0 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 _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(_0x52f0f6,_0x12df13){var _0x29de63=function(_0x43c1b9){while(--_0x43c1b9){_0x52f0f6['push'](_0x52f0f6['shift']());}};_0x29de63(++_0x12df13);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3d8ecc,_0x84a70d){var _0xc1fe58=function(_0x334f3c){while(--_0x334f3c){_0x3d8ecc['push'](_0x3d8ecc['shift']());}};_0xc1fe58(++_0x84a70d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 662641e..433fd8d 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(_0x4b3354,_0x59bfc6){var _0x5b1c50=function(_0x4f6136){while(--_0x4f6136){_0x4b3354['push'](_0x4b3354['shift']());}};_0x5b1c50(++_0x59bfc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x52072a,_0xc5330e){var _0x512c48=function(_0x27d134){while(--_0x27d134){_0x52072a['push'](_0x52072a['shift']());}};_0x512c48(++_0xc5330e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 ab9edc0..48f4514 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 _0xb3c4=['sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','stringify','Calls','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','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/license/hardware','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4cb3ef,_0x4bcb7d){var _0x27702b=function(_0x3385cd){while(--_0x3385cd){_0x4cb3ef['push'](_0x4cb3ef['shift']());}};_0x27702b(++_0x4bcb7d);}(_0xb3c4,0xb2));var _0x4b3c=function(_0x30f63d,_0xf0902b){_0x30f63d=_0x30f63d-0x0;var _0x4f59f4=_0xb3c4[_0x30f63d];return _0x4f59f4;};'use strict';var emlformat=require(_0x4b3c('0x0'));var rimraf=require(_0x4b3c('0x1'));var zipdir=require(_0x4b3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b3c('0x3'));var moment=require('moment');var BPromise=require(_0x4b3c('0x4'));var Mustache=require(_0x4b3c('0x5'));var util=require(_0x4b3c('0x6'));var path=require(_0x4b3c('0x7'));var sox=require(_0x4b3c('0x8'));var csv=require(_0x4b3c('0x9'));var ejs=require(_0x4b3c('0xa'));var fs=require('fs');var fs_extra=require(_0x4b3c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4b3c('0xc'));var jsforce=require(_0x4b3c('0xd'));var deskjs=require(_0x4b3c('0xe'));var toCsv=require(_0x4b3c('0x9'));var querystring=require(_0x4b3c('0xf'));var Papa=require(_0x4b3c('0x10'));var Redis=require(_0x4b3c('0x11'));var authService=require(_0x4b3c('0x12'));var qs=require(_0x4b3c('0x13'));var as=require(_0x4b3c('0x14'));var hardwareService=require(_0x4b3c('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4b3c('0x16'));var licenseUtil=require(_0x4b3c('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4b3c('0x18'));function respondWithStatusCode(_0x5bd5e5,_0x2da77d){_0x2da77d=_0x2da77d||0xcc;return function(_0x2144bf){if(_0x2144bf){return _0x5bd5e5[_0x4b3c('0x19')](_0x2da77d);}return _0x5bd5e5[_0x4b3c('0x1a')](_0x2da77d)[_0x4b3c('0x1b')]();};}function respondWithResult(_0x4dc500,_0xeab3a7){_0xeab3a7=_0xeab3a7||0xc8;return function(_0x247933){if(_0x247933){return _0x4dc500[_0x4b3c('0x1a')](_0xeab3a7)[_0x4b3c('0x1c')](_0x247933);}};}function respondWithFilteredResult(_0x264244,_0x108d23){return function(_0x46f32){if(_0x46f32){var _0x37c324=typeof _0x108d23['offset']===_0x4b3c('0x1d')&&typeof _0x108d23[_0x4b3c('0x1e')]==='undefined';var _0x5bc867=_0x46f32[_0x4b3c('0x1f')];var _0x3cdce3=_0x37c324?0x0:_0x108d23[_0x4b3c('0x20')];var _0x4c615a=_0x37c324?_0x46f32[_0x4b3c('0x1f')]:_0x108d23[_0x4b3c('0x20')]+_0x108d23[_0x4b3c('0x1e')];var _0x29ad33;if(_0x4c615a>=_0x5bc867){_0x4c615a=_0x5bc867;_0x29ad33=0xc8;}else{_0x29ad33=0xce;}_0x264244[_0x4b3c('0x1a')](_0x29ad33);return _0x264244['set'](_0x4b3c('0x21'),_0x3cdce3+'-'+_0x4c615a+'/'+_0x5bc867)[_0x4b3c('0x1c')](_0x46f32);}return null;};}function patchUpdates(_0x27bd68){return function(_0x38b376){try{jsonpatch[_0x4b3c('0x22')](_0x38b376,_0x27bd68,!![]);}catch(_0x56a489){return BPromise['reject'](_0x56a489);}return _0x38b376[_0x4b3c('0x23')]();};}function saveUpdates(_0x3b5b40,_0x384648){return function(_0x1c59bf){if(_0x1c59bf){return _0x1c59bf[_0x4b3c('0x24')](_0x3b5b40)[_0x4b3c('0x25')](function(_0x54486b){return _0x54486b;});}return null;};}function removeEntity(_0x51840f,_0xf6b7ec){return function(_0x4651d8){if(_0x4651d8){return _0x4651d8[_0x4b3c('0x26')]()['then'](function(){_0x51840f[_0x4b3c('0x1a')](0xcc)[_0x4b3c('0x1b')]();});}};}function handleEntityNotFound(_0x53851a,_0x34664f){return function(_0x3b32ec){if(!_0x3b32ec){_0x53851a['sendStatus'](0x194);}return _0x3b32ec;};}function handleError(_0x50fd66,_0x30a0b3){_0x30a0b3=_0x30a0b3||0x1f4;return function(_0x1a5495){logger[_0x4b3c('0x27')](_0x1a5495['stack']);if(_0x1a5495['name']){delete _0x1a5495['name'];}_0x50fd66[_0x4b3c('0x1a')](_0x30a0b3)['send'](_0x1a5495);};}exports[_0x4b3c('0x28')]=function(_0x31b8d7,_0x57b8df){var _0x27f104={},_0x2f0ea9={},_0x4fcba8={'count':0x0,'rows':[]};var _0x45f9c8=_[_0x4b3c('0x29')](db[_0x4b3c('0x2a')][_0x4b3c('0x2b')],function(_0x2bf618){return{'name':_0x2bf618[_0x4b3c('0x2c')],'type':_0x2bf618[_0x4b3c('0x2d')][_0x4b3c('0x2e')]};});_0x2f0ea9[_0x4b3c('0x2f')]=_[_0x4b3c('0x29')](_0x45f9c8,_0x4b3c('0x30'));_0x2f0ea9[_0x4b3c('0x31')]=_[_0x4b3c('0x32')](_0x31b8d7[_0x4b3c('0x31')]);_0x2f0ea9['filters']=_[_0x4b3c('0x33')](_0x2f0ea9['model'],_0x2f0ea9[_0x4b3c('0x31')]);_0x27f104[_0x4b3c('0x34')]=_[_0x4b3c('0x33')](_0x2f0ea9['model'],qs[_0x4b3c('0x35')](_0x31b8d7[_0x4b3c('0x31')][_0x4b3c('0x35')]));_0x27f104[_0x4b3c('0x34')]=_0x27f104[_0x4b3c('0x34')][_0x4b3c('0x36')]?_0x27f104[_0x4b3c('0x34')]:_0x2f0ea9[_0x4b3c('0x2f')];if(!_0x31b8d7[_0x4b3c('0x31')][_0x4b3c('0x37')](_0x4b3c('0x38'))){_0x27f104['limit']=qs[_0x4b3c('0x1e')](_0x31b8d7[_0x4b3c('0x31')][_0x4b3c('0x1e')]);_0x27f104[_0x4b3c('0x20')]=qs[_0x4b3c('0x20')](_0x31b8d7['query'][_0x4b3c('0x20')]);}_0x27f104[_0x4b3c('0x39')]=qs[_0x4b3c('0x3a')](_0x31b8d7[_0x4b3c('0x31')][_0x4b3c('0x3a')]);_0x27f104[_0x4b3c('0x3b')]=qs[_0x4b3c('0x3c')](_[_0x4b3c('0x3d')](_0x31b8d7[_0x4b3c('0x31')],_0x2f0ea9['filters']),_0x45f9c8);if(_0x31b8d7[_0x4b3c('0x31')]['filter']){_0x27f104[_0x4b3c('0x3b')]=_['merge'](_0x27f104['where'],{'$or':_[_0x4b3c('0x29')](_0x45f9c8,function(_0x5a8bd7){if(_0x5a8bd7[_0x4b3c('0x2d')]!==_0x4b3c('0x3e')){var _0x21000={};_0x21000[_0x5a8bd7[_0x4b3c('0x30')]]={'$like':'%'+_0x31b8d7[_0x4b3c('0x31')][_0x4b3c('0x3f')]+'%'};return _0x21000;}})});}_0x27f104=_[_0x4b3c('0x40')]({},_0x27f104,_0x31b8d7[_0x4b3c('0x41')]);var _0x229430={'where':_0x27f104[_0x4b3c('0x3b')]};return db[_0x4b3c('0x2a')][_0x4b3c('0x1f')](_0x229430)[_0x4b3c('0x25')](function(_0x502de1){_0x4fcba8[_0x4b3c('0x1f')]=_0x502de1;if(_0x31b8d7[_0x4b3c('0x31')]['includeAll']){_0x27f104[_0x4b3c('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x4b3c('0x43')](_0x27f104);})[_0x4b3c('0x25')](function(_0x62cf7e){_0x4fcba8[_0x4b3c('0x44')]=_0x62cf7e;return _0x4fcba8;})['then'](respondWithFilteredResult(_0x57b8df,_0x27f104))[_0x4b3c('0x45')](handleError(_0x57b8df,null));};exports[_0x4b3c('0x46')]=function(_0x22cd7f,_0x54f995){var _0x256362={'raw':![],'where':{'id':_0x22cd7f[_0x4b3c('0x47')]['id']}},_0x1fc22c={};_0x1fc22c[_0x4b3c('0x2f')]=_[_0x4b3c('0x32')](db[_0x4b3c('0x2a')][_0x4b3c('0x2b')]);_0x1fc22c['query']=_[_0x4b3c('0x32')](_0x22cd7f[_0x4b3c('0x31')]);_0x1fc22c[_0x4b3c('0x3c')]=_['intersection'](_0x1fc22c['model'],_0x1fc22c[_0x4b3c('0x31')]);_0x256362[_0x4b3c('0x34')]=_[_0x4b3c('0x33')](_0x1fc22c[_0x4b3c('0x2f')],qs[_0x4b3c('0x35')](_0x22cd7f[_0x4b3c('0x31')]['fields']));_0x256362['attributes']=_0x256362[_0x4b3c('0x34')][_0x4b3c('0x36')]?_0x256362['attributes']:_0x1fc22c['model'];if(_0x22cd7f['query']['includeAll']){_0x256362[_0x4b3c('0x42')]=[{'all':!![]}];}_0x256362=_[_0x4b3c('0x40')]({},_0x256362,_0x22cd7f[_0x4b3c('0x41')]);return db[_0x4b3c('0x2a')]['find'](_0x256362)['then'](handleEntityNotFound(_0x54f995,null))[_0x4b3c('0x25')](respondWithResult(_0x54f995,null))['catch'](handleError(_0x54f995,null));};exports[_0x4b3c('0x48')]=function(_0x657400,_0x567781){return db['SugarcrmAccount']['create'](_0x657400[_0x4b3c('0x49')],{})[_0x4b3c('0x25')](respondWithResult(_0x567781,0xc9))[_0x4b3c('0x45')](handleError(_0x567781,null));};exports[_0x4b3c('0x24')]=function(_0x3af425,_0x46a5ea){if(_0x3af425['body']['id']){delete _0x3af425[_0x4b3c('0x49')]['id'];}return db[_0x4b3c('0x2a')][_0x4b3c('0x4a')]({'where':{'id':_0x3af425[_0x4b3c('0x47')]['id']}})[_0x4b3c('0x25')](handleEntityNotFound(_0x46a5ea,null))[_0x4b3c('0x25')](saveUpdates(_0x3af425[_0x4b3c('0x49')],null))[_0x4b3c('0x25')](respondWithResult(_0x46a5ea,null))['catch'](handleError(_0x46a5ea,null));};exports['destroy']=function(_0x5b1537,_0x46339d){return db['SugarcrmAccount']['find']({'where':{'id':_0x5b1537[_0x4b3c('0x47')]['id']}})[_0x4b3c('0x25')](handleEntityNotFound(_0x46339d,null))[_0x4b3c('0x25')](removeEntity(_0x46339d,null))[_0x4b3c('0x45')](handleError(_0x46339d,null));};exports[_0x4b3c('0x4b')]=function(_0x3b72c6,_0x1c5cf2,_0xc7ff4b){var _0x5664f9={};var _0xe8bb47={};var _0x1602b7;var _0x46c4e1;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3b72c6[_0x4b3c('0x47')]['id']}})[_0x4b3c('0x25')](handleEntityNotFound(_0x1c5cf2,null))[_0x4b3c('0x25')](function(_0x44d7ac){if(_0x44d7ac){_0x1602b7=_0x44d7ac;_0xe8bb47[_0x4b3c('0x2f')]=_[_0x4b3c('0x32')](db[_0x4b3c('0x4c')][_0x4b3c('0x2b')]);_0xe8bb47['query']=_[_0x4b3c('0x32')](_0x3b72c6[_0x4b3c('0x31')]);_0xe8bb47['filters']=_['intersection'](_0xe8bb47['model'],_0xe8bb47[_0x4b3c('0x31')]);_0x5664f9[_0x4b3c('0x34')]=_[_0x4b3c('0x33')](_0xe8bb47[_0x4b3c('0x2f')],qs[_0x4b3c('0x35')](_0x3b72c6[_0x4b3c('0x31')][_0x4b3c('0x35')]));_0x5664f9['attributes']=_0x5664f9[_0x4b3c('0x34')][_0x4b3c('0x36')]?_0x5664f9[_0x4b3c('0x34')]:_0xe8bb47[_0x4b3c('0x2f')];_0x5664f9[_0x4b3c('0x39')]=qs[_0x4b3c('0x3a')](_0x3b72c6[_0x4b3c('0x31')][_0x4b3c('0x3a')]);_0x5664f9[_0x4b3c('0x3b')]=qs[_0x4b3c('0x3c')](_[_0x4b3c('0x3d')](_0x3b72c6['query'],_0xe8bb47[_0x4b3c('0x3c')]));if(_0x3b72c6[_0x4b3c('0x31')]['filter']){_0x5664f9[_0x4b3c('0x3b')]=_[_0x4b3c('0x40')](_0x5664f9['where'],{'$or':_[_0x4b3c('0x29')](_0x5664f9[_0x4b3c('0x34')],function(_0x21c521){var _0x3150b0={};_0x3150b0[_0x21c521]={'$like':'%'+_0x3b72c6['query'][_0x4b3c('0x3f')]+'%'};return _0x3150b0;})});}_0x5664f9=_[_0x4b3c('0x40')]({},_0x5664f9,_0x3b72c6[_0x4b3c('0x41')]);return _0x1602b7[_0x4b3c('0x4b')](_0x5664f9);}})[_0x4b3c('0x25')](function(_0x1700a){if(_0x1700a){_0x46c4e1=_0x1700a[_0x4b3c('0x36')];if(!_0x3b72c6['query'][_0x4b3c('0x37')](_0x4b3c('0x38'))){_0x5664f9[_0x4b3c('0x1e')]=qs[_0x4b3c('0x1e')](_0x3b72c6[_0x4b3c('0x31')][_0x4b3c('0x1e')]);_0x5664f9[_0x4b3c('0x20')]=qs[_0x4b3c('0x20')](_0x3b72c6[_0x4b3c('0x31')]['offset']);}return _0x1602b7['getConfigurations'](_0x5664f9);}})[_0x4b3c('0x25')](function(_0x182021){if(_0x182021){return _0x182021?{'count':_0x46c4e1,'rows':_0x182021}:null;}})[_0x4b3c('0x25')](respondWithResult(_0x1c5cf2,null))[_0x4b3c('0x45')](handleError(_0x1c5cf2,null));};exports[_0x4b3c('0x4d')]=function(_0x568812,_0x4372fd,_0x425ba3){if(_0x568812[_0x4b3c('0x49')]['id']){delete _0x568812[_0x4b3c('0x49')]['id'];}return db[_0x4b3c('0x2a')]['findOne']({'where':{'id':_0x568812['params']['id']}})[_0x4b3c('0x25')](handleEntityNotFound(_0x4372fd,null))['then'](function(_0x5f4d26){if(_0x5f4d26){_0x568812[_0x4b3c('0x49')][_0x4b3c('0x4e')]=_0x5f4d26['id'];_0x568812['body'][_0x4b3c('0x4f')]=integrations[_0x4b3c('0x50')](_0x568812['body']['channel'],_0x568812['body']['type']);_0x568812['body'][_0x4b3c('0x51')]=integrations['getDescriptions'](_0x568812[_0x4b3c('0x49')]['channel'],_0x568812['body'][_0x4b3c('0x2d')]);return db['SugarcrmConfiguration'][_0x4b3c('0x48')](_0x568812[_0x4b3c('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0x4b3c('0x4f')},{'model':db['SugarcrmField'],'as':_0x4b3c('0x51')}]});}return null;})[_0x4b3c('0x25')](respondWithResult(_0x4372fd,null))[_0x4b3c('0x45')](handleError(_0x4372fd,null));};exports[_0x4b3c('0x52')]=function(_0x54d35e,_0x550809,_0x8c533a){var _0x3584da='';var _0x3fa73d=['id',_0x4b3c('0x30'),_0x4b3c('0x53'),_0x4b3c('0x54'),'description',_0x4b3c('0x55'),_0x4b3c('0x56'),'duration_minutes',_0x4b3c('0x57'),_0x4b3c('0x58'),_0x4b3c('0x59'),_0x4b3c('0x5a')];return db[_0x4b3c('0x2a')][_0x4b3c('0x5b')]({'where':{'id':_0x54d35e[_0x4b3c('0x47')]['id']},'attributes':['id',_0x4b3c('0x5c'),_0x4b3c('0x5d'),_0x4b3c('0x5e')]})[_0x4b3c('0x25')](handleEntityNotFound(_0x550809,null))[_0x4b3c('0x25')](function(_0x5535b9){if(_0x5535b9){_0x3584da=_0x5535b9['remoteUri'];var _0x1cce4a=_0x3584da['slice'](-0x1);if(_0x1cce4a==='/'){_0x3584da=_0x3584da[_0x4b3c('0x5f')](0x0,_0x3584da[_0x4b3c('0x60')](_0x1cce4a));}return rp({'method':'POST','uri':util[_0x4b3c('0x61')](_0x4b3c('0x62'),_0x3584da,_0x4b3c('0x63')),'json':!![],'form':{'method':_0x4b3c('0x64'),'input_type':'JSON','response_type':_0x4b3c('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5535b9['username'],'password':_0x5535b9[_0x4b3c('0x5d')],'encryption':_0x4b3c('0x66')},'application':_0x4b3c('0x67')})}});}})[_0x4b3c('0x25')](function(_0x40ca60){if(_0x40ca60&&_0x40ca60['name']!==_0x4b3c('0x68')&&_0x40ca60[_0x4b3c('0x30')]!==_0x4b3c('0x69')){return rp({'method':_0x4b3c('0x6a'),'uri':util[_0x4b3c('0x61')](_0x4b3c('0x62'),_0x3584da,_0x4b3c('0x63')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4b3c('0x6b')]({'session':_0x40ca60['id'],'module_name':_0x4b3c('0x6c')})}})[_0x4b3c('0x25')](function(_0x120c81){if(_0x120c81){var _0x1f995a=_['values'](_0x120c81['module_fields']);_[_0x4b3c('0x6d')](_0x1f995a,function(_0x4a4ecd){return _0x3fa73d[_0x4b3c('0x6e')](_0x4a4ecd[_0x4b3c('0x30')]);});return{'count':_0x1f995a['length'],'rows':_[_0x4b3c('0x29')](_0x1f995a,function(_0x3bf99d){return{'id':_0x3bf99d[_0x4b3c('0x30')],'name':_0x3bf99d['label'],'custom':_[_0x4b3c('0x6f')](_0x3bf99d[_0x4b3c('0x30')],'_c')?!![]:![],'options':_0x3bf99d[_0x4b3c('0x41')]?_[_0x4b3c('0x29')](_['values'](_0x3bf99d['options']),function(_0x24089c){return{'name':_0x24089c[_0x4b3c('0x70')],'value':_0x24089c['name']};}):[]};})};}})['then'](respondWithResult(_0x550809,null))[_0x4b3c('0x45')](function(_0x4559ce){var _0x325371=_0x54d35e[_0x4b3c('0x31')]['test']?0x1f4:_0x4559ce[_0x4b3c('0x71')]||0x1f4;logger[_0x4b3c('0x27')](_0x4b3c('0x72'),_0x4b3c('0x52'),_0x325371,JSON[_0x4b3c('0x6b')](_0x4559ce));delete _0x4559ce[_0x4b3c('0x30')];if(_0x325371===0x191){_0x325371=0x190;}_0x550809[_0x4b3c('0x1a')](_0x325371)[_0x4b3c('0x73')](_0x54d35e[_0x4b3c('0x31')][_0x4b3c('0x74')]?{'message':_0x4b3c('0x75'),'statusCode':_0x4559ce[_0x4b3c('0x71')]}:_0x4559ce);});}else{var _0x3b2661=0x1f4;_0x550809['status'](_0x3b2661)[_0x4b3c('0x73')]({'message':_0x4b3c('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x10ad=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','include','findAll','catch','params','includeAll','find','create','body','update','getConfigurations','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmConfiguration','SugarcrmField','getFields','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','findOne','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','fast-json-patch'];(function(_0x17772e,_0x3d4d93){var _0x21e766=function(_0x474f74){while(--_0x474f74){_0x17772e['push'](_0x17772e['shift']());}};_0x21e766(++_0x3d4d93);}(_0x10ad,0xec));var _0xd10a=function(_0x575fd8,_0x56d159){_0x575fd8=_0x575fd8-0x0;var _0x447744=_0x10ad[_0x575fd8];return _0x447744;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd10a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd10a('0x1'));var rp=require('request-promise');var moment=require(_0xd10a('0x2'));var BPromise=require(_0xd10a('0x3'));var Mustache=require('mustache');var util=require(_0xd10a('0x4'));var path=require('path');var sox=require(_0xd10a('0x5'));var csv=require(_0xd10a('0x6'));var ejs=require(_0xd10a('0x7'));var fs=require('fs');var fs_extra=require(_0xd10a('0x8'));var _=require(_0xd10a('0x9'));var squel=require(_0xd10a('0xa'));var crypto=require(_0xd10a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd10a('0xc'));var toCsv=require(_0xd10a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd10a('0xd'));var authService=require(_0xd10a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd10a('0xf'));var hardwareService=require(_0xd10a('0x10'));var logger=require('../../config/logger')(_0xd10a('0x11'));var utils=require(_0xd10a('0x12'));var config=require(_0xd10a('0x13'));var licenseUtil=require(_0xd10a('0x14'));var db=require(_0xd10a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5835e3,_0x2bbc5f){_0x2bbc5f=_0x2bbc5f||0xcc;return function(_0x12ce9e){if(_0x12ce9e){return _0x5835e3[_0xd10a('0x16')](_0x2bbc5f);}return _0x5835e3[_0xd10a('0x17')](_0x2bbc5f)['end']();};}function respondWithResult(_0x912834,_0x148645){_0x148645=_0x148645||0xc8;return function(_0x1fbd77){if(_0x1fbd77){return _0x912834[_0xd10a('0x17')](_0x148645)['json'](_0x1fbd77);}};}function respondWithFilteredResult(_0x129120,_0x56780d){return function(_0x3c2acb){if(_0x3c2acb){var _0x1c4af0=typeof _0x56780d['offset']===_0xd10a('0x18')&&typeof _0x56780d[_0xd10a('0x19')]==='undefined';var _0x52ef42=_0x3c2acb[_0xd10a('0x1a')];var _0x13678d=_0x1c4af0?0x0:_0x56780d[_0xd10a('0x1b')];var _0xed4547=_0x1c4af0?_0x3c2acb['count']:_0x56780d[_0xd10a('0x1b')]+_0x56780d[_0xd10a('0x19')];var _0x443e48;if(_0xed4547>=_0x52ef42){_0xed4547=_0x52ef42;_0x443e48=0xc8;}else{_0x443e48=0xce;}_0x129120[_0xd10a('0x17')](_0x443e48);return _0x129120[_0xd10a('0x1c')](_0xd10a('0x1d'),_0x13678d+'-'+_0xed4547+'/'+_0x52ef42)[_0xd10a('0x1e')](_0x3c2acb);}return null;};}function patchUpdates(_0x55a51e){return function(_0x5dae2d){try{jsonpatch[_0xd10a('0x1f')](_0x5dae2d,_0x55a51e,!![]);}catch(_0x663ddc){return BPromise[_0xd10a('0x20')](_0x663ddc);}return _0x5dae2d['save']();};}function saveUpdates(_0x392248,_0x13c5d1){return function(_0x5445aa){if(_0x5445aa){return _0x5445aa['update'](_0x392248)[_0xd10a('0x21')](function(_0x2f585b){return _0x2f585b;});}return null;};}function removeEntity(_0x1bb808,_0x55a716){return function(_0x303238){if(_0x303238){return _0x303238[_0xd10a('0x22')]()[_0xd10a('0x21')](function(){_0x1bb808[_0xd10a('0x17')](0xcc)[_0xd10a('0x23')]();});}};}function handleEntityNotFound(_0x3f60f7,_0x4b93fa){return function(_0x534af7){if(!_0x534af7){_0x3f60f7[_0xd10a('0x16')](0x194);}return _0x534af7;};}function handleError(_0x269bb0,_0x1487cb){_0x1487cb=_0x1487cb||0x1f4;return function(_0x435295){logger[_0xd10a('0x24')](_0x435295[_0xd10a('0x25')]);if(_0x435295['name']){delete _0x435295[_0xd10a('0x26')];}_0x269bb0['status'](_0x1487cb)['send'](_0x435295);};}exports[_0xd10a('0x27')]=function(_0x1b8fc3,_0x408eb1){var _0x4c1afb={},_0x4533ad={},_0x44f56a={'count':0x0,'rows':[]};var _0x53203c=_[_0xd10a('0x28')](db['SugarcrmAccount'][_0xd10a('0x29')],function(_0x2f2f07){return{'name':_0x2f2f07['fieldName'],'type':_0x2f2f07[_0xd10a('0x2a')][_0xd10a('0x2b')]};});_0x4533ad['model']=_[_0xd10a('0x28')](_0x53203c,_0xd10a('0x26'));_0x4533ad[_0xd10a('0x2c')]=_[_0xd10a('0x2d')](_0x1b8fc3['query']);_0x4533ad['filters']=_[_0xd10a('0x2e')](_0x4533ad[_0xd10a('0x2f')],_0x4533ad[_0xd10a('0x2c')]);_0x4c1afb[_0xd10a('0x30')]=_[_0xd10a('0x2e')](_0x4533ad[_0xd10a('0x2f')],qs['fields'](_0x1b8fc3[_0xd10a('0x2c')][_0xd10a('0x31')]));_0x4c1afb[_0xd10a('0x30')]=_0x4c1afb[_0xd10a('0x30')][_0xd10a('0x32')]?_0x4c1afb[_0xd10a('0x30')]:_0x4533ad[_0xd10a('0x2f')];if(!_0x1b8fc3[_0xd10a('0x2c')]['hasOwnProperty']('nolimit')){_0x4c1afb[_0xd10a('0x19')]=qs['limit'](_0x1b8fc3[_0xd10a('0x2c')][_0xd10a('0x19')]);_0x4c1afb[_0xd10a('0x1b')]=qs[_0xd10a('0x1b')](_0x1b8fc3[_0xd10a('0x2c')][_0xd10a('0x1b')]);}_0x4c1afb[_0xd10a('0x33')]=qs[_0xd10a('0x34')](_0x1b8fc3['query'][_0xd10a('0x34')]);_0x4c1afb[_0xd10a('0x35')]=qs[_0xd10a('0x36')](_[_0xd10a('0x37')](_0x1b8fc3[_0xd10a('0x2c')],_0x4533ad[_0xd10a('0x36')]),_0x53203c);if(_0x1b8fc3[_0xd10a('0x2c')][_0xd10a('0x38')]){_0x4c1afb[_0xd10a('0x35')]=_[_0xd10a('0x39')](_0x4c1afb[_0xd10a('0x35')],{'$or':_[_0xd10a('0x28')](_0x53203c,function(_0x46281f){if(_0x46281f[_0xd10a('0x2a')]!==_0xd10a('0x3a')){var _0x514584={};_0x514584[_0x46281f[_0xd10a('0x26')]]={'$like':'%'+_0x1b8fc3['query'][_0xd10a('0x38')]+'%'};return _0x514584;}})});}_0x4c1afb=_[_0xd10a('0x39')]({},_0x4c1afb,_0x1b8fc3[_0xd10a('0x3b')]);var _0x2fff96={'where':_0x4c1afb[_0xd10a('0x35')]};return db[_0xd10a('0x3c')][_0xd10a('0x1a')](_0x2fff96)[_0xd10a('0x21')](function(_0x320599){_0x44f56a[_0xd10a('0x1a')]=_0x320599;if(_0x1b8fc3['query']['includeAll']){_0x4c1afb[_0xd10a('0x3d')]=[{'all':!![]}];}return db[_0xd10a('0x3c')][_0xd10a('0x3e')](_0x4c1afb);})[_0xd10a('0x21')](function(_0xbd763d){_0x44f56a['rows']=_0xbd763d;return _0x44f56a;})[_0xd10a('0x21')](respondWithFilteredResult(_0x408eb1,_0x4c1afb))[_0xd10a('0x3f')](handleError(_0x408eb1,null));};exports['show']=function(_0x486062,_0x41fa40){var _0x135bd4={'raw':![],'where':{'id':_0x486062[_0xd10a('0x40')]['id']}},_0x45c2f7={};_0x45c2f7[_0xd10a('0x2f')]=_[_0xd10a('0x2d')](db[_0xd10a('0x3c')]['rawAttributes']);_0x45c2f7[_0xd10a('0x2c')]=_[_0xd10a('0x2d')](_0x486062[_0xd10a('0x2c')]);_0x45c2f7[_0xd10a('0x36')]=_['intersection'](_0x45c2f7[_0xd10a('0x2f')],_0x45c2f7[_0xd10a('0x2c')]);_0x135bd4[_0xd10a('0x30')]=_[_0xd10a('0x2e')](_0x45c2f7[_0xd10a('0x2f')],qs[_0xd10a('0x31')](_0x486062[_0xd10a('0x2c')]['fields']));_0x135bd4[_0xd10a('0x30')]=_0x135bd4[_0xd10a('0x30')][_0xd10a('0x32')]?_0x135bd4[_0xd10a('0x30')]:_0x45c2f7[_0xd10a('0x2f')];if(_0x486062[_0xd10a('0x2c')][_0xd10a('0x41')]){_0x135bd4['include']=[{'all':!![]}];}_0x135bd4=_[_0xd10a('0x39')]({},_0x135bd4,_0x486062[_0xd10a('0x3b')]);return db[_0xd10a('0x3c')][_0xd10a('0x42')](_0x135bd4)['then'](handleEntityNotFound(_0x41fa40,null))[_0xd10a('0x21')](respondWithResult(_0x41fa40,null))[_0xd10a('0x3f')](handleError(_0x41fa40,null));};exports[_0xd10a('0x43')]=function(_0x3f0dd9,_0x22c319){return db[_0xd10a('0x3c')]['create'](_0x3f0dd9[_0xd10a('0x44')],{})[_0xd10a('0x21')](respondWithResult(_0x22c319,0xc9))[_0xd10a('0x3f')](handleError(_0x22c319,null));};exports[_0xd10a('0x45')]=function(_0x49f090,_0x544cbd){if(_0x49f090[_0xd10a('0x44')]['id']){delete _0x49f090['body']['id'];}return db['SugarcrmAccount'][_0xd10a('0x42')]({'where':{'id':_0x49f090[_0xd10a('0x40')]['id']}})[_0xd10a('0x21')](handleEntityNotFound(_0x544cbd,null))['then'](saveUpdates(_0x49f090[_0xd10a('0x44')],null))['then'](respondWithResult(_0x544cbd,null))[_0xd10a('0x3f')](handleError(_0x544cbd,null));};exports[_0xd10a('0x22')]=function(_0x119e85,_0x471753){return db[_0xd10a('0x3c')]['find']({'where':{'id':_0x119e85[_0xd10a('0x40')]['id']}})[_0xd10a('0x21')](handleEntityNotFound(_0x471753,null))['then'](removeEntity(_0x471753,null))[_0xd10a('0x3f')](handleError(_0x471753,null));};exports[_0xd10a('0x46')]=function(_0x3fcf0f,_0x1b3387,_0x33afff){var _0x1af96c={};var _0x32b282={};var _0x21d68f;var _0x47153f;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3fcf0f[_0xd10a('0x40')]['id']}})[_0xd10a('0x21')](handleEntityNotFound(_0x1b3387,null))[_0xd10a('0x21')](function(_0x270c3f){if(_0x270c3f){_0x21d68f=_0x270c3f;_0x32b282[_0xd10a('0x2f')]=_[_0xd10a('0x2d')](db['SugarcrmConfiguration'][_0xd10a('0x29')]);_0x32b282['query']=_[_0xd10a('0x2d')](_0x3fcf0f[_0xd10a('0x2c')]);_0x32b282[_0xd10a('0x36')]=_['intersection'](_0x32b282[_0xd10a('0x2f')],_0x32b282['query']);_0x1af96c[_0xd10a('0x30')]=_[_0xd10a('0x2e')](_0x32b282[_0xd10a('0x2f')],qs[_0xd10a('0x31')](_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x31')]));_0x1af96c[_0xd10a('0x30')]=_0x1af96c[_0xd10a('0x30')]['length']?_0x1af96c[_0xd10a('0x30')]:_0x32b282[_0xd10a('0x2f')];_0x1af96c[_0xd10a('0x33')]=qs[_0xd10a('0x34')](_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x34')]);_0x1af96c[_0xd10a('0x35')]=qs['filters'](_[_0xd10a('0x37')](_0x3fcf0f[_0xd10a('0x2c')],_0x32b282[_0xd10a('0x36')]));if(_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x38')]){_0x1af96c['where']=_[_0xd10a('0x39')](_0x1af96c[_0xd10a('0x35')],{'$or':_[_0xd10a('0x28')](_0x1af96c[_0xd10a('0x30')],function(_0xb66e21){var _0x5ce5ed={};_0x5ce5ed[_0xb66e21]={'$like':'%'+_0x3fcf0f['query'][_0xd10a('0x38')]+'%'};return _0x5ce5ed;})});}_0x1af96c=_[_0xd10a('0x39')]({},_0x1af96c,_0x3fcf0f['options']);return _0x21d68f[_0xd10a('0x46')](_0x1af96c);}})[_0xd10a('0x21')](function(_0x1286fe){if(_0x1286fe){_0x47153f=_0x1286fe[_0xd10a('0x32')];if(!_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x47')](_0xd10a('0x48'))){_0x1af96c['limit']=qs['limit'](_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x19')]);_0x1af96c['offset']=qs[_0xd10a('0x1b')](_0x3fcf0f[_0xd10a('0x2c')][_0xd10a('0x1b')]);}return _0x21d68f['getConfigurations'](_0x1af96c);}})['then'](function(_0x24321e){if(_0x24321e){return _0x24321e?{'count':_0x47153f,'rows':_0x24321e}:null;}})[_0xd10a('0x21')](respondWithResult(_0x1b3387,null))[_0xd10a('0x3f')](handleError(_0x1b3387,null));};exports[_0xd10a('0x49')]=function(_0x5c8d71,_0x62e4c6,_0x24482f){if(_0x5c8d71[_0xd10a('0x44')]['id']){delete _0x5c8d71[_0xd10a('0x44')]['id'];}return db[_0xd10a('0x3c')]['findOne']({'where':{'id':_0x5c8d71['params']['id']}})[_0xd10a('0x21')](handleEntityNotFound(_0x62e4c6,null))[_0xd10a('0x21')](function(_0x2ee37b){if(_0x2ee37b){_0x5c8d71[_0xd10a('0x44')][_0xd10a('0x4a')]=_0x2ee37b['id'];_0x5c8d71[_0xd10a('0x44')][_0xd10a('0x4b')]=integrations[_0xd10a('0x4c')](_0x5c8d71[_0xd10a('0x44')]['channel'],_0x5c8d71[_0xd10a('0x44')][_0xd10a('0x2a')]);_0x5c8d71[_0xd10a('0x44')][_0xd10a('0x4d')]=integrations['getDescriptions'](_0x5c8d71[_0xd10a('0x44')][_0xd10a('0x4e')],_0x5c8d71['body'][_0xd10a('0x2a')]);return db[_0xd10a('0x4f')][_0xd10a('0x43')](_0x5c8d71[_0xd10a('0x44')],{'include':[{'model':db[_0xd10a('0x50')],'as':_0xd10a('0x4b')},{'model':db[_0xd10a('0x50')],'as':_0xd10a('0x4d')}]});}return null;})['then'](respondWithResult(_0x62e4c6,null))[_0xd10a('0x3f')](handleError(_0x62e4c6,null));};exports[_0xd10a('0x51')]=function(_0x3ba878,_0x17285a,_0x19b1a0){var _0x42019a='';var _0x2a9381=['id','name','assigned_user_id','created_by',_0xd10a('0x52'),_0xd10a('0x53'),_0xd10a('0x54'),_0xd10a('0x55'),_0xd10a('0x56'),_0xd10a('0x57'),'parent_name',_0xd10a('0x58')];return db['SugarcrmAccount'][_0xd10a('0x59')]({'where':{'id':_0x3ba878[_0xd10a('0x40')]['id']},'attributes':['id',_0xd10a('0x5a'),_0xd10a('0x5b'),'remoteUri']})[_0xd10a('0x21')](handleEntityNotFound(_0x17285a,null))[_0xd10a('0x21')](function(_0x308ced){if(_0x308ced){_0x42019a=_0x308ced[_0xd10a('0x5c')];var _0xa59ba1=_0x42019a[_0xd10a('0x5d')](-0x1);if(_0xa59ba1==='/'){_0x42019a=_0x42019a[_0xd10a('0x5e')](0x0,_0x42019a['lastIndexOf'](_0xa59ba1));}return rp({'method':_0xd10a('0x5f'),'uri':util[_0xd10a('0x60')](_0xd10a('0x61'),_0x42019a,_0xd10a('0x62')),'json':!![],'form':{'method':'login','input_type':_0xd10a('0x63'),'response_type':_0xd10a('0x63'),'rest_data':JSON[_0xd10a('0x64')]({'user_auth':{'user_name':_0x308ced[_0xd10a('0x5a')],'password':_0x308ced[_0xd10a('0x5b')],'encryption':_0xd10a('0x65')},'application':_0xd10a('0x66')})}});}})[_0xd10a('0x21')](function(_0x235ebd){if(_0x235ebd&&_0x235ebd['name']!==_0xd10a('0x67')&&_0x235ebd[_0xd10a('0x26')]!==_0xd10a('0x68')){return rp({'method':_0xd10a('0x5f'),'uri':util['format'](_0xd10a('0x61'),_0x42019a,_0xd10a('0x62')),'json':!![],'form':{'method':_0xd10a('0x69'),'input_type':_0xd10a('0x63'),'response_type':_0xd10a('0x63'),'rest_data':JSON[_0xd10a('0x64')]({'session':_0x235ebd['id'],'module_name':_0xd10a('0x6a')})}})['then'](function(_0xd61cb1){if(_0xd61cb1){var _0x372b37=_[_0xd10a('0x6b')](_0xd61cb1[_0xd10a('0x6c')]);_[_0xd10a('0x6d')](_0x372b37,function(_0x5e3e6f){return _0x2a9381[_0xd10a('0x6e')](_0x5e3e6f['name']);});return{'count':_0x372b37[_0xd10a('0x32')],'rows':_[_0xd10a('0x28')](_0x372b37,function(_0x57335c){return{'id':_0x57335c[_0xd10a('0x26')],'name':_0x57335c[_0xd10a('0x6f')],'custom':_[_0xd10a('0x70')](_0x57335c[_0xd10a('0x26')],'_c')?!![]:![],'options':_0x57335c[_0xd10a('0x3b')]?_['map'](_['values'](_0x57335c[_0xd10a('0x3b')]),function(_0x4dc3e7){return{'name':_0x4dc3e7[_0xd10a('0x71')],'value':_0x4dc3e7[_0xd10a('0x26')]};}):[]};})};}})[_0xd10a('0x21')](respondWithResult(_0x17285a,null))['catch'](function(_0x3aa242){var _0x526e01=_0x3ba878[_0xd10a('0x2c')][_0xd10a('0x72')]?0x1f4:_0x3aa242[_0xd10a('0x73')]||0x1f4;logger[_0xd10a('0x24')](_0xd10a('0x74'),'getFields',_0x526e01,JSON[_0xd10a('0x64')](_0x3aa242));delete _0x3aa242['name'];if(_0x526e01===0x191){_0x526e01=0x190;}_0x17285a[_0xd10a('0x17')](_0x526e01)[_0xd10a('0x75')](_0x3ba878[_0xd10a('0x2c')]['test']?{'message':_0xd10a('0x76'),'statusCode':_0x3aa242[_0xd10a('0x73')]}:_0x3aa242);});}else{var _0x4b2129=0x1f4;_0x17285a['status'](_0x4b2129)['send']({'message':_0xd10a('0x76'),'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 1634872..0f60395 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 _0x6059=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2e1cd7,_0x293ea1){var _0x515226=function(_0x816b94){while(--_0x816b94){_0x2e1cd7['push'](_0x2e1cd7['shift']());}};_0x515226(++_0x293ea1);}(_0x6059,0x186));var _0x9605=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x6059[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require(_0x9605('0x0'));var util=require(_0x9605('0x1'));var logger=require('../../config/logger')(_0x9605('0x2'));var moment=require(_0x9605('0x3'));var BPromise=require(_0x9605('0x4'));var rp=require(_0x9605('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9605('0x6'));var config=require(_0x9605('0x7'));var attributes=require(_0x9605('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x9605('0x9')]=function(_0x299077,_0x1913de){return _0x299077['define'](_0x9605('0xa'),attributes,{'tableName':_0x9605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96bb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2e611d,_0x4cc9ba){var _0x3690e2=function(_0x2d63b0){while(--_0x2d63b0){_0x2e611d['push'](_0x2e611d['shift']());}};_0x3690e2(++_0x4cc9ba);}(_0x96bb,0x9c));var _0xb96b=function(_0x9fb085,_0x2251a3){_0x9fb085=_0x9fb085-0x0;var _0x400c75=_0x96bb[_0x9fb085];return _0x400c75;};'use strict';var _=require('lodash');var util=require(_0xb96b('0x0'));var logger=require(_0xb96b('0x1'))(_0xb96b('0x2'));var moment=require(_0xb96b('0x3'));var BPromise=require(_0xb96b('0x4'));var rp=require(_0xb96b('0x5'));var fs=require('fs');var path=require(_0xb96b('0x6'));var rimraf=require(_0xb96b('0x7'));var config=require(_0xb96b('0x8'));var attributes=require(_0xb96b('0x9'));var integrations=require(_0xb96b('0xa'));module[_0xb96b('0xb')]=function(_0x4af514,_0x5da463){return _0x4af514[_0xb96b('0xc')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','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 b914062..bdbdf81 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 _0xeff7=['raw','attributes','limit','map','model','include','catch','ShowSugarcrmAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x227c59,_0x575c83){var _0x35aeac=function(_0x477179){while(--_0x477179){_0x227c59['push'](_0x227c59['shift']());}};_0x35aeac(++_0x575c83);}(_0xeff7,0x17b));var _0x7eff=function(_0x101634,_0x40c0b2){_0x101634=_0x101634-0x0;var _0x3ab53c=_0xeff7[_0x101634];return _0x3ab53c;};'use strict';var _=require(_0x7eff('0x0'));var util=require(_0x7eff('0x1'));var moment=require(_0x7eff('0x2'));var BPromise=require(_0x7eff('0x3'));var rs=require(_0x7eff('0x4'));var fs=require('fs');var Redis=require(_0x7eff('0x5'));var db=require(_0x7eff('0x6'))['db'];var utils=require(_0x7eff('0x7'));var logger=require(_0x7eff('0x8'))(_0x7eff('0x9'));var config=require(_0x7eff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7eff('0xb')][_0x7eff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55bdb5,_0x4e721e,_0x2d8a63){return new BPromise(function(_0x314164,_0x58cbbb){return client[_0x7eff('0xd')](_0x55bdb5,_0x2d8a63)[_0x7eff('0xe')](function(_0x52e601){logger['info'](_0x7eff('0xf'),_0x4e721e,_0x7eff('0x10'));logger[_0x7eff('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4e721e,_0x7eff('0x10'),JSON[_0x7eff('0x12')](_0x52e601));if(_0x52e601['error']){if(_0x52e601[_0x7eff('0x13')][_0x7eff('0x14')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4e721e,_0x52e601[_0x7eff('0x13')]['message']);return _0x58cbbb(_0x52e601[_0x7eff('0x13')][_0x7eff('0x15')]);}logger['error'](_0x7eff('0xf'),_0x4e721e,_0x52e601[_0x7eff('0x13')][_0x7eff('0x15')]);return _0x314164(_0x52e601[_0x7eff('0x13')][_0x7eff('0x15')]);}else{logger[_0x7eff('0x16')]('SugarcrmAccount,\x20%s,\x20%s',_0x4e721e,_0x7eff('0x10'));_0x314164(_0x52e601[_0x7eff('0x17')]['message']);}})['catch'](function(_0x2c4b2b){logger[_0x7eff('0x13')](_0x7eff('0xf'),_0x4e721e,_0x2c4b2b);_0x58cbbb(_0x2c4b2b);});});}exports[_0x7eff('0x18')]=function(_0x3a94ce){var _0x4f1207=this;return new Promise(function(_0x37bd09,_0x40dc06){return db[_0x7eff('0x19')][_0x7eff('0x1a')]({'raw':_0x3a94ce[_0x7eff('0x1b')]?_0x3a94ce[_0x7eff('0x1b')][_0x7eff('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a94ce[_0x7eff('0x1b')]?_0x3a94ce[_0x7eff('0x1b')]['where']||null:null,'attributes':_0x3a94ce['options']?_0x3a94ce[_0x7eff('0x1b')][_0x7eff('0x1d')]||null:null,'limit':_0x3a94ce['options']?_0x3a94ce[_0x7eff('0x1b')][_0x7eff('0x1e')]||null:null,'include':_0x3a94ce[_0x7eff('0x1b')]?_0x3a94ce[_0x7eff('0x1b')]['include']?_[_0x7eff('0x1f')](_0x3a94ce[_0x7eff('0x1b')]['include'],function(_0x368bc5){return{'model':db[_0x368bc5[_0x7eff('0x20')]],'as':_0x368bc5['as'],'attributes':_0x368bc5[_0x7eff('0x1d')],'include':_0x368bc5[_0x7eff('0x21')]?_['map'](_0x368bc5[_0x7eff('0x21')],function(_0x5e9265){return{'model':db[_0x5e9265['model']],'as':_0x5e9265['as'],'attributes':_0x5e9265['attributes'],'include':_0x5e9265[_0x7eff('0x21')]?_[_0x7eff('0x1f')](_0x5e9265[_0x7eff('0x21')],function(_0x3bdae9){return{'model':db[_0x3bdae9[_0x7eff('0x20')]],'as':_0x3bdae9['as'],'attributes':_0x3bdae9['attributes']};}):[]};}):[]};}):[]:[]})[_0x7eff('0xe')](function(_0x112cd4){logger[_0x7eff('0x16')](_0x7eff('0x18'),_0x3a94ce);logger[_0x7eff('0x11')]('GetSugarcrmAccount',_0x3a94ce,JSON[_0x7eff('0x12')](_0x112cd4));_0x37bd09(_0x112cd4);})[_0x7eff('0x22')](function(_0x54195a){logger[_0x7eff('0x13')](_0x7eff('0x18'),_0x54195a[_0x7eff('0x15')],_0x3a94ce);_0x40dc06(_0x4f1207['error'](0x1f4,_0x54195a[_0x7eff('0x15')]));});});};exports[_0x7eff('0x23')]=function(_0x57d7ac){var _0x54a375=this;return new Promise(function(_0xdcd626,_0x5796b6){return db[_0x7eff('0x19')]['find']({'raw':_0x57d7ac[_0x7eff('0x1b')]?_0x57d7ac[_0x7eff('0x1b')][_0x7eff('0x1c')]===undefined?!![]:![]:!![],'where':_0x57d7ac[_0x7eff('0x1b')]?_0x57d7ac[_0x7eff('0x1b')][_0x7eff('0x24')]||null:null,'attributes':_0x57d7ac[_0x7eff('0x1b')]?_0x57d7ac[_0x7eff('0x1b')][_0x7eff('0x1d')]||null:null,'include':_0x57d7ac['options']?_0x57d7ac[_0x7eff('0x1b')]['include']?_[_0x7eff('0x1f')](_0x57d7ac[_0x7eff('0x1b')][_0x7eff('0x21')],function(_0x17375c){return{'model':db[_0x17375c[_0x7eff('0x20')]],'as':_0x17375c['as'],'attributes':_0x17375c[_0x7eff('0x1d')],'include':_0x17375c[_0x7eff('0x21')]?_[_0x7eff('0x1f')](_0x17375c[_0x7eff('0x21')],function(_0x63370d){return{'model':db[_0x63370d[_0x7eff('0x20')]],'as':_0x63370d['as'],'attributes':_0x63370d[_0x7eff('0x1d')],'include':_0x63370d[_0x7eff('0x21')]?_[_0x7eff('0x1f')](_0x63370d[_0x7eff('0x21')],function(_0x2640f3){return{'model':db[_0x2640f3[_0x7eff('0x20')]],'as':_0x2640f3['as'],'attributes':_0x2640f3[_0x7eff('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7eff('0xe')](function(_0x672420){logger['info'](_0x7eff('0x23'),_0x57d7ac);logger['debug'](_0x7eff('0x23'),_0x57d7ac,JSON['stringify'](_0x672420));_0xdcd626(_0x672420);})['catch'](function(_0x60a9e3){logger[_0x7eff('0x13')](_0x7eff('0x23'),_0x60a9e3[_0x7eff('0x15')],_0x57d7ac);_0x5796b6(_0x54a375['error'](0x1f4,_0x60a9e3['message']));});});}; \ No newline at end of file +var _0x0c87=['request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options','where','limit','include','map','attributes','model','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x53dd50,_0x52b320){var _0x40a87a=function(_0x1f2e0e){while(--_0x1f2e0e){_0x53dd50['push'](_0x53dd50['shift']());}};_0x40a87a(++_0x52b320);}(_0x0c87,0x179));var _0x70c8=function(_0x35f5c9,_0x3267d6){_0x35f5c9=_0x35f5c9-0x0;var _0x463e96=_0x0c87[_0x35f5c9];return _0x463e96;};'use strict';var _=require(_0x70c8('0x0'));var util=require(_0x70c8('0x1'));var moment=require(_0x70c8('0x2'));var BPromise=require(_0x70c8('0x3'));var rs=require(_0x70c8('0x4'));var fs=require('fs');var Redis=require(_0x70c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x70c8('0x6'));var logger=require(_0x70c8('0x7'))(_0x70c8('0x8'));var config=require(_0x70c8('0x9'));var jayson=require(_0x70c8('0xa'));var client=jayson[_0x70c8('0xb')][_0x70c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d393f,_0x92aea7,_0x46b505){return new BPromise(function(_0x5b7e3f,_0x12d66b){return client[_0x70c8('0xd')](_0x2d393f,_0x46b505)[_0x70c8('0xe')](function(_0x3023ad){logger[_0x70c8('0xf')](_0x70c8('0x10'),_0x92aea7,_0x70c8('0x11'));logger[_0x70c8('0x12')](_0x70c8('0x13'),_0x92aea7,_0x70c8('0x11'),JSON[_0x70c8('0x14')](_0x3023ad));if(_0x3023ad['error']){if(_0x3023ad['error'][_0x70c8('0x15')]===0x1f4){logger[_0x70c8('0x16')](_0x70c8('0x10'),_0x92aea7,_0x3023ad[_0x70c8('0x16')][_0x70c8('0x17')]);return _0x12d66b(_0x3023ad[_0x70c8('0x16')][_0x70c8('0x17')]);}logger['error'](_0x70c8('0x10'),_0x92aea7,_0x3023ad[_0x70c8('0x16')]['message']);return _0x5b7e3f(_0x3023ad['error']['message']);}else{logger[_0x70c8('0xf')](_0x70c8('0x10'),_0x92aea7,_0x70c8('0x11'));_0x5b7e3f(_0x3023ad[_0x70c8('0x18')][_0x70c8('0x17')]);}})[_0x70c8('0x19')](function(_0x315448){logger['error'](_0x70c8('0x10'),_0x92aea7,_0x315448);_0x12d66b(_0x315448);});});}exports[_0x70c8('0x1a')]=function(_0x2da1a6){var _0x4063bd=this;return new Promise(function(_0x2ad8db,_0x23dfe5){return db[_0x70c8('0x1b')][_0x70c8('0x1c')]({'raw':_0x2da1a6['options']?_0x2da1a6['options'][_0x70c8('0x1d')]===undefined?!![]:![]:!![],'where':_0x2da1a6[_0x70c8('0x1e')]?_0x2da1a6[_0x70c8('0x1e')][_0x70c8('0x1f')]||null:null,'attributes':_0x2da1a6[_0x70c8('0x1e')]?_0x2da1a6['options']['attributes']||null:null,'limit':_0x2da1a6[_0x70c8('0x1e')]?_0x2da1a6[_0x70c8('0x1e')][_0x70c8('0x20')]||null:null,'include':_0x2da1a6[_0x70c8('0x1e')]?_0x2da1a6[_0x70c8('0x1e')][_0x70c8('0x21')]?_[_0x70c8('0x22')](_0x2da1a6[_0x70c8('0x1e')][_0x70c8('0x21')],function(_0x34b55f){return{'model':db[_0x34b55f['model']],'as':_0x34b55f['as'],'attributes':_0x34b55f[_0x70c8('0x23')],'include':_0x34b55f[_0x70c8('0x21')]?_[_0x70c8('0x22')](_0x34b55f['include'],function(_0x37ccad){return{'model':db[_0x37ccad[_0x70c8('0x24')]],'as':_0x37ccad['as'],'attributes':_0x37ccad[_0x70c8('0x23')],'include':_0x37ccad[_0x70c8('0x21')]?_[_0x70c8('0x22')](_0x37ccad[_0x70c8('0x21')],function(_0x447184){return{'model':db[_0x447184[_0x70c8('0x24')]],'as':_0x447184['as'],'attributes':_0x447184[_0x70c8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70c8('0xe')](function(_0x71c839){logger['info'](_0x70c8('0x1a'),_0x2da1a6);logger[_0x70c8('0x12')](_0x70c8('0x1a'),_0x2da1a6,JSON[_0x70c8('0x14')](_0x71c839));_0x2ad8db(_0x71c839);})[_0x70c8('0x19')](function(_0xfe13a5){logger[_0x70c8('0x16')](_0x70c8('0x1a'),_0xfe13a5[_0x70c8('0x17')],_0x2da1a6);_0x23dfe5(_0x4063bd['error'](0x1f4,_0xfe13a5[_0x70c8('0x17')]));});});};exports[_0x70c8('0x25')]=function(_0x5a89b7){var _0x316ae0=this;return new Promise(function(_0x3cb6b2,_0x145658){return db[_0x70c8('0x1b')][_0x70c8('0x26')]({'raw':_0x5a89b7['options']?_0x5a89b7[_0x70c8('0x1e')][_0x70c8('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a89b7[_0x70c8('0x1e')]?_0x5a89b7[_0x70c8('0x1e')][_0x70c8('0x1f')]||null:null,'attributes':_0x5a89b7[_0x70c8('0x1e')]?_0x5a89b7[_0x70c8('0x1e')][_0x70c8('0x23')]||null:null,'include':_0x5a89b7[_0x70c8('0x1e')]?_0x5a89b7[_0x70c8('0x1e')]['include']?_[_0x70c8('0x22')](_0x5a89b7[_0x70c8('0x1e')][_0x70c8('0x21')],function(_0x388da3){return{'model':db[_0x388da3['model']],'as':_0x388da3['as'],'attributes':_0x388da3['attributes'],'include':_0x388da3['include']?_['map'](_0x388da3[_0x70c8('0x21')],function(_0x5584ff){return{'model':db[_0x5584ff[_0x70c8('0x24')]],'as':_0x5584ff['as'],'attributes':_0x5584ff['attributes'],'include':_0x5584ff[_0x70c8('0x21')]?_['map'](_0x5584ff[_0x70c8('0x21')],function(_0x19fbf9){return{'model':db[_0x19fbf9[_0x70c8('0x24')]],'as':_0x19fbf9['as'],'attributes':_0x19fbf9[_0x70c8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70c8('0xe')](function(_0x3f49ea){logger[_0x70c8('0xf')](_0x70c8('0x25'),_0x5a89b7);logger[_0x70c8('0x12')](_0x70c8('0x25'),_0x5a89b7,JSON[_0x70c8('0x14')](_0x3f49ea));_0x3cb6b2(_0x3f49ea);})[_0x70c8('0x19')](function(_0x5136e8){logger[_0x70c8('0x16')]('ShowSugarcrmAccount',_0x5136e8['message'],_0x5a89b7);_0x145658(_0x316ae0[_0x70c8('0x16')](0x1f4,_0x5136e8[_0x70c8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4c132b5..14e69d1 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 _0xcd94=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','/:id','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x382f8e,_0x164e01){var _0x2fe7cb=function(_0x324708){while(--_0x324708){_0x382f8e['push'](_0x382f8e['shift']());}};_0x2fe7cb(++_0x164e01);}(_0xcd94,0x1ee));var _0x4cd9=function(_0x280a2e,_0x244c6f){_0x280a2e=_0x280a2e-0x0;var _0x286f67=_0xcd94[_0x280a2e];return _0x286f67;};'use strict';var multer=require(_0x4cd9('0x0'));var util=require(_0x4cd9('0x1'));var path=require(_0x4cd9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4cd9('0x3')]();var fs_extra=require(_0x4cd9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4cd9('0x5'));var config=require(_0x4cd9('0x6'));var controller=require(_0x4cd9('0x7'));router[_0x4cd9('0x8')]('/',auth[_0x4cd9('0x9')](),controller[_0x4cd9('0xa')]);router[_0x4cd9('0x8')]('/:id',auth[_0x4cd9('0x9')](),controller[_0x4cd9('0xb')]);router[_0x4cd9('0x8')](_0x4cd9('0xc'),auth['isAuthenticated'](),controller[_0x4cd9('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x4cd9('0xe')]);router[_0x4cd9('0x8')](_0x4cd9('0xf'),auth['isAuthenticated'](),controller[_0x4cd9('0x10')]);router['post']('/',auth[_0x4cd9('0x9')](),controller[_0x4cd9('0x11')]);router['put'](_0x4cd9('0x12'),auth[_0x4cd9('0x9')](),controller['update']);router[_0x4cd9('0x13')]('/:id',auth[_0x4cd9('0x9')](),controller[_0x4cd9('0x14')]);module[_0x4cd9('0x15')]=router; \ No newline at end of file +var _0x57e9=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x57e9,0x19e));var _0x957e=function(_0x44f360,_0x179c37){_0x44f360=_0x44f360-0x0;var _0x21e7e5=_0x57e9[_0x44f360];return _0x21e7e5;};'use strict';var multer=require(_0x957e('0x0'));var util=require(_0x957e('0x1'));var path=require(_0x957e('0x2'));var timeout=require(_0x957e('0x3'));var express=require('express');var router=express[_0x957e('0x4')]();var fs_extra=require(_0x957e('0x5'));var auth=require(_0x957e('0x6'));var interaction=require(_0x957e('0x7'));var config=require('../../config/environment');var controller=require(_0x957e('0x8'));router[_0x957e('0x9')]('/',auth[_0x957e('0xa')](),controller['index']);router[_0x957e('0x9')](_0x957e('0xb'),auth[_0x957e('0xa')](),controller['show']);router[_0x957e('0x9')](_0x957e('0xc'),auth[_0x957e('0xa')](),controller[_0x957e('0xd')]);router[_0x957e('0x9')](_0x957e('0xe'),auth[_0x957e('0xa')](),controller[_0x957e('0xf')]);router[_0x957e('0x9')](_0x957e('0x10'),auth['isAuthenticated'](),controller[_0x957e('0x11')]);router[_0x957e('0x12')]('/',auth[_0x957e('0xa')](),controller[_0x957e('0x13')]);router[_0x957e('0x14')]('/:id',auth[_0x957e('0xa')](),controller[_0x957e('0x15')]);router[_0x957e('0x16')]('/:id',auth[_0x957e('0xa')](),controller[_0x957e('0x17')]);module[_0x957e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 67fdb56..f18c02d 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 _0x940c=['exports','STRING','sequelize'];(function(_0x28be65,_0x32f3e8){var _0x3f4707=function(_0x1876c1){while(--_0x1876c1){_0x28be65['push'](_0x28be65['shift']());}};_0x3f4707(++_0x32f3e8);}(_0x940c,0x19a));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc940('0x0'));module[_0xc940('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc940('0x2')]}}; \ No newline at end of file +var _0x1443=['STRING','sequelize'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x1443,0xa7));var _0x3144=function(_0x3a5ad0,_0x4d67d7){_0x3a5ad0=_0x3a5ad0-0x0;var _0x4ca989=_0x1443[_0x3a5ad0];return _0x4ca989;};'use strict';var Sequelize=require(_0x3144('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3144('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 85647e1..2b12f53 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 _0xda7b=['offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','SugarcrmConfiguration','rawAttributes','type','key','query','keys','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','SugarcrmField','getFields','getSubjects','findOne','getDescriptions','eml-format','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2ff5f2,_0x292be9){var _0x17f937=function(_0x12aa28){while(--_0x12aa28){_0x2ff5f2['push'](_0x2ff5f2['shift']());}};_0x17f937(++_0x292be9);}(_0xda7b,0xdd));var _0xbda7=function(_0x1019e7,_0xb4147a){_0x1019e7=_0x1019e7-0x0;var _0x527b17=_0xda7b[_0x1019e7];return _0x527b17;};'use strict';var emlformat=require(_0xbda7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbda7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbda7('0x2'));var moment=require(_0xbda7('0x3'));var BPromise=require(_0xbda7('0x4'));var Mustache=require(_0xbda7('0x5'));var util=require('util');var path=require(_0xbda7('0x6'));var sox=require(_0xbda7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbda7('0x8'));var _=require(_0xbda7('0x9'));var squel=require(_0xbda7('0xa'));var crypto=require(_0xbda7('0xb'));var jsforce=require(_0xbda7('0xc'));var deskjs=require(_0xbda7('0xd'));var toCsv=require(_0xbda7('0xe'));var querystring=require(_0xbda7('0xf'));var Papa=require(_0xbda7('0x10'));var Redis=require(_0xbda7('0x11'));var authService=require(_0xbda7('0x12'));var qs=require(_0xbda7('0x13'));var as=require(_0xbda7('0x14'));var hardwareService=require(_0xbda7('0x15'));var logger=require('../../config/logger')(_0xbda7('0x16'));var utils=require(_0xbda7('0x17'));var config=require(_0xbda7('0x18'));var licenseUtil=require(_0xbda7('0x19'));var db=require(_0xbda7('0x1a'))['db'];function respondWithStatusCode(_0x147605,_0x53f694){_0x53f694=_0x53f694||0xcc;return function(_0x40858b){if(_0x40858b){return _0x147605[_0xbda7('0x1b')](_0x53f694);}return _0x147605[_0xbda7('0x1c')](_0x53f694)[_0xbda7('0x1d')]();};}function respondWithResult(_0x1ba6fe,_0x3cc7e5){_0x3cc7e5=_0x3cc7e5||0xc8;return function(_0x5036cc){if(_0x5036cc){return _0x1ba6fe['status'](_0x3cc7e5)[_0xbda7('0x1e')](_0x5036cc);}};}function respondWithFilteredResult(_0x2e3f03,_0x4dcd61){return function(_0xa8d684){if(_0xa8d684){var _0x119d7f=typeof _0x4dcd61[_0xbda7('0x1f')]==='undefined'&&typeof _0x4dcd61['limit']===_0xbda7('0x20');var _0x2cb5d2=_0xa8d684[_0xbda7('0x21')];var _0x227741=_0x119d7f?0x0:_0x4dcd61[_0xbda7('0x1f')];var _0x29bdc4=_0x119d7f?_0xa8d684[_0xbda7('0x21')]:_0x4dcd61['offset']+_0x4dcd61[_0xbda7('0x22')];var _0x5c5d76;if(_0x29bdc4>=_0x2cb5d2){_0x29bdc4=_0x2cb5d2;_0x5c5d76=0xc8;}else{_0x5c5d76=0xce;}_0x2e3f03[_0xbda7('0x1c')](_0x5c5d76);return _0x2e3f03[_0xbda7('0x23')](_0xbda7('0x24'),_0x227741+'-'+_0x29bdc4+'/'+_0x2cb5d2)[_0xbda7('0x1e')](_0xa8d684);}return null;};}function patchUpdates(_0x125672){return function(_0xb6fc38){try{jsonpatch[_0xbda7('0x25')](_0xb6fc38,_0x125672,!![]);}catch(_0x124e88){return BPromise[_0xbda7('0x26')](_0x124e88);}return _0xb6fc38[_0xbda7('0x27')]();};}function saveUpdates(_0x26b77a,_0x35bdb0){return function(_0x219711){if(_0x219711){return _0x219711[_0xbda7('0x28')](_0x26b77a)['then'](function(_0x16927f){return _0x16927f;});}return null;};}function removeEntity(_0x50fb4a,_0x187b80){return function(_0x5ced57){if(_0x5ced57){return _0x5ced57[_0xbda7('0x29')]()[_0xbda7('0x2a')](function(){_0x50fb4a[_0xbda7('0x1c')](0xcc)[_0xbda7('0x1d')]();});}};}function handleEntityNotFound(_0x1d7da1,_0x1a673a){return function(_0x368999){if(!_0x368999){_0x1d7da1[_0xbda7('0x1b')](0x194);}return _0x368999;};}function handleError(_0x1c33c8,_0x15430c){_0x15430c=_0x15430c||0x1f4;return function(_0x59081a){logger[_0xbda7('0x2b')](_0x59081a['stack']);if(_0x59081a[_0xbda7('0x2c')]){delete _0x59081a[_0xbda7('0x2c')];}_0x1c33c8[_0xbda7('0x1c')](_0x15430c)[_0xbda7('0x2d')](_0x59081a);};}exports[_0xbda7('0x2e')]=function(_0x2afe58,_0x3cb7b2){var _0x632911={},_0x5cede2={},_0x1809a9={'count':0x0,'rows':[]};var _0x280a13=_['map'](db[_0xbda7('0x2f')][_0xbda7('0x30')],function(_0x3b439c){return{'name':_0x3b439c['fieldName'],'type':_0x3b439c[_0xbda7('0x31')][_0xbda7('0x32')]};});_0x5cede2['model']=_['map'](_0x280a13,_0xbda7('0x2c'));_0x5cede2[_0xbda7('0x33')]=_[_0xbda7('0x34')](_0x2afe58[_0xbda7('0x33')]);_0x5cede2['filters']=_['intersection'](_0x5cede2[_0xbda7('0x35')],_0x5cede2[_0xbda7('0x33')]);_0x632911[_0xbda7('0x36')]=_[_0xbda7('0x37')](_0x5cede2[_0xbda7('0x35')],qs['fields'](_0x2afe58[_0xbda7('0x33')]['fields']));_0x632911['attributes']=_0x632911[_0xbda7('0x36')][_0xbda7('0x38')]?_0x632911['attributes']:_0x5cede2[_0xbda7('0x35')];if(!_0x2afe58[_0xbda7('0x33')][_0xbda7('0x39')](_0xbda7('0x3a'))){_0x632911[_0xbda7('0x22')]=qs[_0xbda7('0x22')](_0x2afe58['query'][_0xbda7('0x22')]);_0x632911['offset']=qs['offset'](_0x2afe58[_0xbda7('0x33')][_0xbda7('0x1f')]);}_0x632911[_0xbda7('0x3b')]=qs[_0xbda7('0x3c')](_0x2afe58[_0xbda7('0x33')][_0xbda7('0x3c')]);_0x632911['where']=qs[_0xbda7('0x3d')](_[_0xbda7('0x3e')](_0x2afe58[_0xbda7('0x33')],_0x5cede2['filters']),_0x280a13);if(_0x2afe58[_0xbda7('0x33')]['filter']){_0x632911[_0xbda7('0x3f')]=_['merge'](_0x632911[_0xbda7('0x3f')],{'$or':_[_0xbda7('0x40')](_0x280a13,function(_0x473ec9){if(_0x473ec9[_0xbda7('0x31')]!==_0xbda7('0x41')){var _0x15e762={};_0x15e762[_0x473ec9[_0xbda7('0x2c')]]={'$like':'%'+_0x2afe58[_0xbda7('0x33')][_0xbda7('0x42')]+'%'};return _0x15e762;}})});}_0x632911=_[_0xbda7('0x43')]({},_0x632911,_0x2afe58[_0xbda7('0x44')]);var _0x54f3a5={'where':_0x632911[_0xbda7('0x3f')]};return db['SugarcrmConfiguration'][_0xbda7('0x21')](_0x54f3a5)[_0xbda7('0x2a')](function(_0x30f9b5){_0x1809a9['count']=_0x30f9b5;if(_0x2afe58[_0xbda7('0x33')][_0xbda7('0x45')]){_0x632911[_0xbda7('0x46')]=[{'all':!![]}];}return db[_0xbda7('0x2f')][_0xbda7('0x47')](_0x632911);})['then'](function(_0x5cdb55){_0x1809a9[_0xbda7('0x48')]=_0x5cdb55;return _0x1809a9;})[_0xbda7('0x2a')](respondWithFilteredResult(_0x3cb7b2,_0x632911))[_0xbda7('0x49')](handleError(_0x3cb7b2,null));};exports['show']=function(_0x27f55d,_0x1ca740){var _0x3a94fb={'raw':![],'where':{'id':_0x27f55d[_0xbda7('0x4a')]['id']}},_0x2c8384={};_0x2c8384['model']=_[_0xbda7('0x34')](db[_0xbda7('0x2f')][_0xbda7('0x30')]);_0x2c8384[_0xbda7('0x33')]=_['keys'](_0x27f55d['query']);_0x2c8384[_0xbda7('0x3d')]=_['intersection'](_0x2c8384[_0xbda7('0x35')],_0x2c8384[_0xbda7('0x33')]);_0x3a94fb[_0xbda7('0x36')]=_[_0xbda7('0x37')](_0x2c8384[_0xbda7('0x35')],qs[_0xbda7('0x4b')](_0x27f55d['query']['fields']));_0x3a94fb[_0xbda7('0x36')]=_0x3a94fb[_0xbda7('0x36')][_0xbda7('0x38')]?_0x3a94fb[_0xbda7('0x36')]:_0x2c8384[_0xbda7('0x35')];if(_0x27f55d[_0xbda7('0x33')][_0xbda7('0x45')]){_0x3a94fb[_0xbda7('0x46')]=[{'all':!![]}];}_0x3a94fb=_['merge']({},_0x3a94fb,_0x27f55d[_0xbda7('0x44')]);return db[_0xbda7('0x2f')][_0xbda7('0x4c')](_0x3a94fb)['then'](handleEntityNotFound(_0x1ca740,null))['then'](respondWithResult(_0x1ca740,null))[_0xbda7('0x49')](handleError(_0x1ca740,null));};exports[_0xbda7('0x4d')]=function(_0x5a9800,_0x4f07a1){return db[_0xbda7('0x2f')][_0xbda7('0x4d')](_0x5a9800[_0xbda7('0x4e')],{})[_0xbda7('0x2a')](respondWithResult(_0x4f07a1,0xc9))[_0xbda7('0x49')](handleError(_0x4f07a1,null));};exports['update']=function(_0x9e27f7,_0x348128){if(_0x9e27f7[_0xbda7('0x4e')]['id']){delete _0x9e27f7['body']['id'];}return db[_0xbda7('0x2f')][_0xbda7('0x4c')]({'where':{'id':_0x9e27f7['params']['id']}})[_0xbda7('0x2a')](handleEntityNotFound(_0x348128,null))[_0xbda7('0x2a')](saveUpdates(_0x9e27f7['body'],null))[_0xbda7('0x2a')](respondWithResult(_0x348128,null))['catch'](handleError(_0x348128,null));};exports[_0xbda7('0x29')]=function(_0x552f47,_0x33407){return db[_0xbda7('0x2f')][_0xbda7('0x4c')]({'where':{'id':_0x552f47['params']['id']}})[_0xbda7('0x2a')](handleEntityNotFound(_0x33407,null))['then'](removeEntity(_0x33407,null))['catch'](handleError(_0x33407,null));};exports['getFields']=function(_0x528e3,_0x55266a,_0x110915){var _0x38b78f={};var _0x39f45e={};var _0x11a5a1;var _0x12c9af;return db[_0xbda7('0x2f')]['findOne']({'where':{'id':_0x528e3[_0xbda7('0x4a')]['id']}})[_0xbda7('0x2a')](handleEntityNotFound(_0x55266a,null))['then'](function(_0x544da1){if(_0x544da1){_0x11a5a1=_0x544da1;_0x39f45e['model']=_['keys'](db[_0xbda7('0x4f')][_0xbda7('0x30')]);_0x39f45e['query']=_['keys'](_0x528e3[_0xbda7('0x33')]);_0x39f45e[_0xbda7('0x3d')]=_[_0xbda7('0x37')](_0x39f45e[_0xbda7('0x35')],_0x39f45e[_0xbda7('0x33')]);_0x38b78f[_0xbda7('0x36')]=_['intersection'](_0x39f45e['model'],qs[_0xbda7('0x4b')](_0x528e3[_0xbda7('0x33')][_0xbda7('0x4b')]));_0x38b78f[_0xbda7('0x36')]=_0x38b78f['attributes'][_0xbda7('0x38')]?_0x38b78f[_0xbda7('0x36')]:_0x39f45e['model'];_0x38b78f[_0xbda7('0x3b')]=qs[_0xbda7('0x3c')](_0x528e3[_0xbda7('0x33')]['sort']);_0x38b78f[_0xbda7('0x3f')]=qs['filters'](_[_0xbda7('0x3e')](_0x528e3[_0xbda7('0x33')],_0x39f45e['filters']));if(_0x528e3[_0xbda7('0x33')][_0xbda7('0x42')]){_0x38b78f[_0xbda7('0x3f')]=_[_0xbda7('0x43')](_0x38b78f[_0xbda7('0x3f')],{'$or':_['map'](_0x38b78f[_0xbda7('0x36')],function(_0x11cb8c){var _0x324a37={};_0x324a37[_0x11cb8c]={'$like':'%'+_0x528e3[_0xbda7('0x33')]['filter']+'%'};return _0x324a37;})});}_0x38b78f=_[_0xbda7('0x43')]({},_0x38b78f,_0x528e3[_0xbda7('0x44')]);return _0x11a5a1[_0xbda7('0x50')](_0x38b78f);}})[_0xbda7('0x2a')](function(_0x5c2244){if(_0x5c2244){_0x12c9af=_0x5c2244[_0xbda7('0x38')];if(!_0x528e3[_0xbda7('0x33')][_0xbda7('0x39')](_0xbda7('0x3a'))){_0x38b78f['limit']=qs[_0xbda7('0x22')](_0x528e3['query'][_0xbda7('0x22')]);_0x38b78f[_0xbda7('0x1f')]=qs[_0xbda7('0x1f')](_0x528e3[_0xbda7('0x33')][_0xbda7('0x1f')]);}return _0x11a5a1[_0xbda7('0x50')](_0x38b78f);}})[_0xbda7('0x2a')](function(_0x34f4ad){if(_0x34f4ad){return _0x34f4ad?{'count':_0x12c9af,'rows':_0x34f4ad}:null;}})['then'](respondWithResult(_0x55266a,null))['catch'](handleError(_0x55266a,null));};exports[_0xbda7('0x51')]=function(_0x307450,_0x3ea6ac,_0x39ba7b){var _0x2c6285={};var _0xd9bcf9={};var _0x578508;var _0xdcd521;return db[_0xbda7('0x2f')][_0xbda7('0x52')]({'where':{'id':_0x307450[_0xbda7('0x4a')]['id']}})[_0xbda7('0x2a')](handleEntityNotFound(_0x3ea6ac,null))[_0xbda7('0x2a')](function(_0x4398c1){if(_0x4398c1){_0x578508=_0x4398c1;_0xd9bcf9[_0xbda7('0x35')]=_[_0xbda7('0x34')](db['SugarcrmField'][_0xbda7('0x30')]);_0xd9bcf9[_0xbda7('0x33')]=_[_0xbda7('0x34')](_0x307450[_0xbda7('0x33')]);_0xd9bcf9[_0xbda7('0x3d')]=_['intersection'](_0xd9bcf9['model'],_0xd9bcf9['query']);_0x2c6285['attributes']=_[_0xbda7('0x37')](_0xd9bcf9[_0xbda7('0x35')],qs['fields'](_0x307450[_0xbda7('0x33')][_0xbda7('0x4b')]));_0x2c6285[_0xbda7('0x36')]=_0x2c6285['attributes']['length']?_0x2c6285[_0xbda7('0x36')]:_0xd9bcf9[_0xbda7('0x35')];_0x2c6285[_0xbda7('0x3b')]=qs[_0xbda7('0x3c')](_0x307450['query'][_0xbda7('0x3c')]);_0x2c6285['where']=qs[_0xbda7('0x3d')](_['pick'](_0x307450[_0xbda7('0x33')],_0xd9bcf9['filters']));if(_0x307450[_0xbda7('0x33')]['filter']){_0x2c6285[_0xbda7('0x3f')]=_[_0xbda7('0x43')](_0x2c6285[_0xbda7('0x3f')],{'$or':_[_0xbda7('0x40')](_0x2c6285[_0xbda7('0x36')],function(_0x299d0c){var _0x1fe888={};_0x1fe888[_0x299d0c]={'$like':'%'+_0x307450[_0xbda7('0x33')][_0xbda7('0x42')]+'%'};return _0x1fe888;})});}_0x2c6285=_[_0xbda7('0x43')]({},_0x2c6285,_0x307450[_0xbda7('0x44')]);return _0x578508['getSubjects'](_0x2c6285);}})[_0xbda7('0x2a')](function(_0x3aae2f){if(_0x3aae2f){_0xdcd521=_0x3aae2f['length'];if(!_0x307450[_0xbda7('0x33')][_0xbda7('0x39')](_0xbda7('0x3a'))){_0x2c6285[_0xbda7('0x22')]=qs[_0xbda7('0x22')](_0x307450[_0xbda7('0x33')]['limit']);_0x2c6285[_0xbda7('0x1f')]=qs['offset'](_0x307450[_0xbda7('0x33')][_0xbda7('0x1f')]);}return _0x578508[_0xbda7('0x51')](_0x2c6285);}})['then'](function(_0x4bdf76){if(_0x4bdf76){return _0x4bdf76?{'count':_0xdcd521,'rows':_0x4bdf76}:null;}})[_0xbda7('0x2a')](respondWithResult(_0x3ea6ac,null))[_0xbda7('0x49')](handleError(_0x3ea6ac,null));};exports[_0xbda7('0x53')]=function(_0x9ec5d1,_0x1f113e,_0x106344){var _0x4f3454={};var _0x22345a={};var _0x1a2d38;var _0x1c42be;return db[_0xbda7('0x2f')][_0xbda7('0x52')]({'where':{'id':_0x9ec5d1[_0xbda7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f113e,null))[_0xbda7('0x2a')](function(_0x51e5df){if(_0x51e5df){_0x1a2d38=_0x51e5df;_0x22345a[_0xbda7('0x35')]=_[_0xbda7('0x34')](db[_0xbda7('0x4f')][_0xbda7('0x30')]);_0x22345a[_0xbda7('0x33')]=_[_0xbda7('0x34')](_0x9ec5d1[_0xbda7('0x33')]);_0x22345a[_0xbda7('0x3d')]=_[_0xbda7('0x37')](_0x22345a['model'],_0x22345a[_0xbda7('0x33')]);_0x4f3454[_0xbda7('0x36')]=_[_0xbda7('0x37')](_0x22345a[_0xbda7('0x35')],qs['fields'](_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x4b')]));_0x4f3454[_0xbda7('0x36')]=_0x4f3454[_0xbda7('0x36')][_0xbda7('0x38')]?_0x4f3454[_0xbda7('0x36')]:_0x22345a[_0xbda7('0x35')];_0x4f3454[_0xbda7('0x3b')]=qs[_0xbda7('0x3c')](_0x9ec5d1['query'][_0xbda7('0x3c')]);_0x4f3454['where']=qs[_0xbda7('0x3d')](_[_0xbda7('0x3e')](_0x9ec5d1[_0xbda7('0x33')],_0x22345a[_0xbda7('0x3d')]));if(_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x42')]){_0x4f3454[_0xbda7('0x3f')]=_['merge'](_0x4f3454[_0xbda7('0x3f')],{'$or':_[_0xbda7('0x40')](_0x4f3454['attributes'],function(_0x33536f){var _0x56af62={};_0x56af62[_0x33536f]={'$like':'%'+_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x42')]+'%'};return _0x56af62;})});}_0x4f3454=_[_0xbda7('0x43')]({},_0x4f3454,_0x9ec5d1[_0xbda7('0x44')]);return _0x1a2d38[_0xbda7('0x53')](_0x4f3454);}})[_0xbda7('0x2a')](function(_0x2645b5){if(_0x2645b5){_0x1c42be=_0x2645b5[_0xbda7('0x38')];if(!_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x39')]('nolimit')){_0x4f3454['limit']=qs[_0xbda7('0x22')](_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x22')]);_0x4f3454[_0xbda7('0x1f')]=qs['offset'](_0x9ec5d1[_0xbda7('0x33')][_0xbda7('0x1f')]);}return _0x1a2d38[_0xbda7('0x53')](_0x4f3454);}})['then'](function(_0x2d7951){if(_0x2d7951){return _0x2d7951?{'count':_0x1c42be,'rows':_0x2d7951}:null;}})[_0xbda7('0x2a')](respondWithResult(_0x1f113e,null))[_0xbda7('0x49')](handleError(_0x1f113e,null));}; \ No newline at end of file +var _0x8228=['sort','pick','filter','where','merge','options','SugarcrmConfiguration','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','findOne','SugarcrmField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','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','count','set','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x408e25,_0x14cf6c){var _0x2f0a4b=function(_0x2b4045){while(--_0x2b4045){_0x408e25['push'](_0x408e25['shift']());}};_0x2f0a4b(++_0x14cf6c);}(_0x8228,0x157));var _0x8822=function(_0x572c1a,_0x3add69){_0x572c1a=_0x572c1a-0x0;var _0x30f61a=_0x8228[_0x572c1a];return _0x30f61a;};'use strict';var emlformat=require(_0x8822('0x0'));var rimraf=require(_0x8822('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8822('0x2'));var rp=require(_0x8822('0x3'));var moment=require(_0x8822('0x4'));var BPromise=require(_0x8822('0x5'));var Mustache=require(_0x8822('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8822('0x7'));var csv=require(_0x8822('0x8'));var ejs=require(_0x8822('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8822('0xa'));var squel=require(_0x8822('0xb'));var crypto=require(_0x8822('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8822('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8822('0xe'));var Redis=require(_0x8822('0xf'));var authService=require(_0x8822('0x10'));var qs=require(_0x8822('0x11'));var as=require(_0x8822('0x12'));var hardwareService=require(_0x8822('0x13'));var logger=require(_0x8822('0x14'))(_0x8822('0x15'));var utils=require('../../config/utils');var config=require(_0x8822('0x16'));var licenseUtil=require(_0x8822('0x17'));var db=require(_0x8822('0x18'))['db'];function respondWithStatusCode(_0x5ca451,_0x30852e){_0x30852e=_0x30852e||0xcc;return function(_0x16d42c){if(_0x16d42c){return _0x5ca451[_0x8822('0x19')](_0x30852e);}return _0x5ca451[_0x8822('0x1a')](_0x30852e)[_0x8822('0x1b')]();};}function respondWithResult(_0x418374,_0x46c98e){_0x46c98e=_0x46c98e||0xc8;return function(_0x70ebfb){if(_0x70ebfb){return _0x418374[_0x8822('0x1a')](_0x46c98e)[_0x8822('0x1c')](_0x70ebfb);}};}function respondWithFilteredResult(_0xcc8f91,_0x5add5a){return function(_0x5ea282){if(_0x5ea282){var _0x19b987=typeof _0x5add5a[_0x8822('0x1d')]===_0x8822('0x1e')&&typeof _0x5add5a['limit']===_0x8822('0x1e');var _0x1ca3ad=_0x5ea282[_0x8822('0x1f')];var _0x4fadaf=_0x19b987?0x0:_0x5add5a[_0x8822('0x1d')];var _0x5ccc2a=_0x19b987?_0x5ea282[_0x8822('0x1f')]:_0x5add5a['offset']+_0x5add5a['limit'];var _0x1d587d;if(_0x5ccc2a>=_0x1ca3ad){_0x5ccc2a=_0x1ca3ad;_0x1d587d=0xc8;}else{_0x1d587d=0xce;}_0xcc8f91[_0x8822('0x1a')](_0x1d587d);return _0xcc8f91[_0x8822('0x20')]('Content-Range',_0x4fadaf+'-'+_0x5ccc2a+'/'+_0x1ca3ad)['json'](_0x5ea282);}return null;};}function patchUpdates(_0x2f068d){return function(_0x314219){try{jsonpatch['apply'](_0x314219,_0x2f068d,!![]);}catch(_0x33b043){return BPromise[_0x8822('0x21')](_0x33b043);}return _0x314219[_0x8822('0x22')]();};}function saveUpdates(_0x51d80b,_0x25754b){return function(_0x34c460){if(_0x34c460){return _0x34c460[_0x8822('0x23')](_0x51d80b)[_0x8822('0x24')](function(_0x3e7da3){return _0x3e7da3;});}return null;};}function removeEntity(_0xb0cf29,_0xd698c9){return function(_0x5d0329){if(_0x5d0329){return _0x5d0329[_0x8822('0x25')]()[_0x8822('0x24')](function(){_0xb0cf29['status'](0xcc)[_0x8822('0x1b')]();});}};}function handleEntityNotFound(_0x243ab2,_0xdc6622){return function(_0x319a03){if(!_0x319a03){_0x243ab2[_0x8822('0x19')](0x194);}return _0x319a03;};}function handleError(_0x5ebaf5,_0x3b6bb2){_0x3b6bb2=_0x3b6bb2||0x1f4;return function(_0x36774b){logger[_0x8822('0x26')](_0x36774b['stack']);if(_0x36774b[_0x8822('0x27')]){delete _0x36774b['name'];}_0x5ebaf5[_0x8822('0x1a')](_0x3b6bb2)[_0x8822('0x28')](_0x36774b);};}exports[_0x8822('0x29')]=function(_0x5d582b,_0x531e5a){var _0x510845={},_0x445713={},_0x59f8f8={'count':0x0,'rows':[]};var _0x6916=_[_0x8822('0x2a')](db['SugarcrmConfiguration'][_0x8822('0x2b')],function(_0x25d38b){return{'name':_0x25d38b[_0x8822('0x2c')],'type':_0x25d38b[_0x8822('0x2d')]['key']};});_0x445713[_0x8822('0x2e')]=_['map'](_0x6916,'name');_0x445713[_0x8822('0x2f')]=_['keys'](_0x5d582b['query']);_0x445713[_0x8822('0x30')]=_[_0x8822('0x31')](_0x445713['model'],_0x445713[_0x8822('0x2f')]);_0x510845[_0x8822('0x32')]=_[_0x8822('0x31')](_0x445713[_0x8822('0x2e')],qs[_0x8822('0x33')](_0x5d582b[_0x8822('0x2f')][_0x8822('0x33')]));_0x510845[_0x8822('0x32')]=_0x510845['attributes'][_0x8822('0x34')]?_0x510845[_0x8822('0x32')]:_0x445713[_0x8822('0x2e')];if(!_0x5d582b[_0x8822('0x2f')][_0x8822('0x35')](_0x8822('0x36'))){_0x510845[_0x8822('0x37')]=qs[_0x8822('0x37')](_0x5d582b['query'][_0x8822('0x37')]);_0x510845[_0x8822('0x1d')]=qs[_0x8822('0x1d')](_0x5d582b['query'][_0x8822('0x1d')]);}_0x510845[_0x8822('0x38')]=qs['sort'](_0x5d582b[_0x8822('0x2f')][_0x8822('0x39')]);_0x510845['where']=qs['filters'](_[_0x8822('0x3a')](_0x5d582b[_0x8822('0x2f')],_0x445713[_0x8822('0x30')]),_0x6916);if(_0x5d582b['query'][_0x8822('0x3b')]){_0x510845[_0x8822('0x3c')]=_[_0x8822('0x3d')](_0x510845[_0x8822('0x3c')],{'$or':_[_0x8822('0x2a')](_0x6916,function(_0x2cdbc4){if(_0x2cdbc4[_0x8822('0x2d')]!=='VIRTUAL'){var _0x400ef7={};_0x400ef7[_0x2cdbc4[_0x8822('0x27')]]={'$like':'%'+_0x5d582b[_0x8822('0x2f')][_0x8822('0x3b')]+'%'};return _0x400ef7;}})});}_0x510845=_[_0x8822('0x3d')]({},_0x510845,_0x5d582b[_0x8822('0x3e')]);var _0x5ca54d={'where':_0x510845[_0x8822('0x3c')]};return db[_0x8822('0x3f')]['count'](_0x5ca54d)['then'](function(_0x5cee32){_0x59f8f8[_0x8822('0x1f')]=_0x5cee32;if(_0x5d582b['query']['includeAll']){_0x510845[_0x8822('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x8822('0x41')](_0x510845);})[_0x8822('0x24')](function(_0x36b9ee){_0x59f8f8[_0x8822('0x42')]=_0x36b9ee;return _0x59f8f8;})[_0x8822('0x24')](respondWithFilteredResult(_0x531e5a,_0x510845))[_0x8822('0x43')](handleError(_0x531e5a,null));};exports[_0x8822('0x44')]=function(_0x5161e4,_0x379123){var _0x339d96={'raw':![],'where':{'id':_0x5161e4[_0x8822('0x45')]['id']}},_0x208bbe={};_0x208bbe[_0x8822('0x2e')]=_[_0x8822('0x46')](db['SugarcrmConfiguration']['rawAttributes']);_0x208bbe[_0x8822('0x2f')]=_[_0x8822('0x46')](_0x5161e4[_0x8822('0x2f')]);_0x208bbe[_0x8822('0x30')]=_[_0x8822('0x31')](_0x208bbe['model'],_0x208bbe[_0x8822('0x2f')]);_0x339d96[_0x8822('0x32')]=_[_0x8822('0x31')](_0x208bbe['model'],qs[_0x8822('0x33')](_0x5161e4[_0x8822('0x2f')][_0x8822('0x33')]));_0x339d96[_0x8822('0x32')]=_0x339d96[_0x8822('0x32')][_0x8822('0x34')]?_0x339d96[_0x8822('0x32')]:_0x208bbe[_0x8822('0x2e')];if(_0x5161e4[_0x8822('0x2f')][_0x8822('0x47')]){_0x339d96[_0x8822('0x40')]=[{'all':!![]}];}_0x339d96=_[_0x8822('0x3d')]({},_0x339d96,_0x5161e4[_0x8822('0x3e')]);return db[_0x8822('0x3f')][_0x8822('0x48')](_0x339d96)[_0x8822('0x24')](handleEntityNotFound(_0x379123,null))[_0x8822('0x24')](respondWithResult(_0x379123,null))[_0x8822('0x43')](handleError(_0x379123,null));};exports[_0x8822('0x49')]=function(_0x19e3f9,_0x40f7ee){return db[_0x8822('0x3f')][_0x8822('0x49')](_0x19e3f9[_0x8822('0x4a')],{})[_0x8822('0x24')](respondWithResult(_0x40f7ee,0xc9))[_0x8822('0x43')](handleError(_0x40f7ee,null));};exports[_0x8822('0x23')]=function(_0x3a9f95,_0x433967){if(_0x3a9f95['body']['id']){delete _0x3a9f95[_0x8822('0x4a')]['id'];}return db[_0x8822('0x3f')][_0x8822('0x48')]({'where':{'id':_0x3a9f95[_0x8822('0x45')]['id']}})[_0x8822('0x24')](handleEntityNotFound(_0x433967,null))[_0x8822('0x24')](saveUpdates(_0x3a9f95['body'],null))['then'](respondWithResult(_0x433967,null))[_0x8822('0x43')](handleError(_0x433967,null));};exports[_0x8822('0x25')]=function(_0x5ce258,_0x66581b){return db[_0x8822('0x3f')][_0x8822('0x48')]({'where':{'id':_0x5ce258[_0x8822('0x45')]['id']}})[_0x8822('0x24')](handleEntityNotFound(_0x66581b,null))[_0x8822('0x24')](removeEntity(_0x66581b,null))[_0x8822('0x43')](handleError(_0x66581b,null));};exports['getFields']=function(_0x21d373,_0x54da46,_0x5b84ed){var _0x1f8e8b={};var _0x400721={};var _0x45195c;var _0x294416;return db[_0x8822('0x3f')][_0x8822('0x4b')]({'where':{'id':_0x21d373['params']['id']}})['then'](handleEntityNotFound(_0x54da46,null))[_0x8822('0x24')](function(_0x33bd49){if(_0x33bd49){_0x45195c=_0x33bd49;_0x400721[_0x8822('0x2e')]=_['keys'](db[_0x8822('0x4c')][_0x8822('0x2b')]);_0x400721[_0x8822('0x2f')]=_['keys'](_0x21d373['query']);_0x400721[_0x8822('0x30')]=_['intersection'](_0x400721['model'],_0x400721[_0x8822('0x2f')]);_0x1f8e8b[_0x8822('0x32')]=_[_0x8822('0x31')](_0x400721['model'],qs['fields'](_0x21d373[_0x8822('0x2f')][_0x8822('0x33')]));_0x1f8e8b[_0x8822('0x32')]=_0x1f8e8b[_0x8822('0x32')][_0x8822('0x34')]?_0x1f8e8b['attributes']:_0x400721[_0x8822('0x2e')];_0x1f8e8b[_0x8822('0x38')]=qs[_0x8822('0x39')](_0x21d373['query'][_0x8822('0x39')]);_0x1f8e8b['where']=qs[_0x8822('0x30')](_[_0x8822('0x3a')](_0x21d373['query'],_0x400721[_0x8822('0x30')]));if(_0x21d373[_0x8822('0x2f')][_0x8822('0x3b')]){_0x1f8e8b[_0x8822('0x3c')]=_['merge'](_0x1f8e8b[_0x8822('0x3c')],{'$or':_[_0x8822('0x2a')](_0x1f8e8b['attributes'],function(_0x166d44){var _0x2925f8={};_0x2925f8[_0x166d44]={'$like':'%'+_0x21d373[_0x8822('0x2f')][_0x8822('0x3b')]+'%'};return _0x2925f8;})});}_0x1f8e8b=_['merge']({},_0x1f8e8b,_0x21d373[_0x8822('0x3e')]);return _0x45195c['getFields'](_0x1f8e8b);}})[_0x8822('0x24')](function(_0x5ac8e7){if(_0x5ac8e7){_0x294416=_0x5ac8e7['length'];if(!_0x21d373['query']['hasOwnProperty'](_0x8822('0x36'))){_0x1f8e8b[_0x8822('0x37')]=qs[_0x8822('0x37')](_0x21d373[_0x8822('0x2f')]['limit']);_0x1f8e8b[_0x8822('0x1d')]=qs[_0x8822('0x1d')](_0x21d373[_0x8822('0x2f')]['offset']);}return _0x45195c[_0x8822('0x4d')](_0x1f8e8b);}})[_0x8822('0x24')](function(_0x151ce0){if(_0x151ce0){return _0x151ce0?{'count':_0x294416,'rows':_0x151ce0}:null;}})[_0x8822('0x24')](respondWithResult(_0x54da46,null))[_0x8822('0x43')](handleError(_0x54da46,null));};exports['getSubjects']=function(_0x3f9274,_0x80a2cf,_0x1d3491){var _0x4803ab={};var _0x43a8b1={};var _0x53d3e1;var _0x24ae24;return db[_0x8822('0x3f')]['findOne']({'where':{'id':_0x3f9274['params']['id']}})[_0x8822('0x24')](handleEntityNotFound(_0x80a2cf,null))[_0x8822('0x24')](function(_0xd41f99){if(_0xd41f99){_0x53d3e1=_0xd41f99;_0x43a8b1[_0x8822('0x2e')]=_[_0x8822('0x46')](db['SugarcrmField'][_0x8822('0x2b')]);_0x43a8b1[_0x8822('0x2f')]=_[_0x8822('0x46')](_0x3f9274[_0x8822('0x2f')]);_0x43a8b1[_0x8822('0x30')]=_[_0x8822('0x31')](_0x43a8b1['model'],_0x43a8b1[_0x8822('0x2f')]);_0x4803ab[_0x8822('0x32')]=_[_0x8822('0x31')](_0x43a8b1[_0x8822('0x2e')],qs['fields'](_0x3f9274['query'][_0x8822('0x33')]));_0x4803ab['attributes']=_0x4803ab[_0x8822('0x32')][_0x8822('0x34')]?_0x4803ab[_0x8822('0x32')]:_0x43a8b1[_0x8822('0x2e')];_0x4803ab[_0x8822('0x38')]=qs['sort'](_0x3f9274[_0x8822('0x2f')][_0x8822('0x39')]);_0x4803ab['where']=qs[_0x8822('0x30')](_[_0x8822('0x3a')](_0x3f9274[_0x8822('0x2f')],_0x43a8b1[_0x8822('0x30')]));if(_0x3f9274[_0x8822('0x2f')][_0x8822('0x3b')]){_0x4803ab[_0x8822('0x3c')]=_['merge'](_0x4803ab[_0x8822('0x3c')],{'$or':_['map'](_0x4803ab['attributes'],function(_0x11d577){var _0x15eb53={};_0x15eb53[_0x11d577]={'$like':'%'+_0x3f9274[_0x8822('0x2f')]['filter']+'%'};return _0x15eb53;})});}_0x4803ab=_['merge']({},_0x4803ab,_0x3f9274[_0x8822('0x3e')]);return _0x53d3e1['getSubjects'](_0x4803ab);}})['then'](function(_0x4a5a1a){if(_0x4a5a1a){_0x24ae24=_0x4a5a1a[_0x8822('0x34')];if(!_0x3f9274[_0x8822('0x2f')][_0x8822('0x35')](_0x8822('0x36'))){_0x4803ab[_0x8822('0x37')]=qs[_0x8822('0x37')](_0x3f9274[_0x8822('0x2f')][_0x8822('0x37')]);_0x4803ab[_0x8822('0x1d')]=qs[_0x8822('0x1d')](_0x3f9274[_0x8822('0x2f')][_0x8822('0x1d')]);}return _0x53d3e1[_0x8822('0x4e')](_0x4803ab);}})[_0x8822('0x24')](function(_0x1283e3){if(_0x1283e3){return _0x1283e3?{'count':_0x24ae24,'rows':_0x1283e3}:null;}})['then'](respondWithResult(_0x80a2cf,null))['catch'](handleError(_0x80a2cf,null));};exports[_0x8822('0x4f')]=function(_0xaa124b,_0x4c94a2,_0x210dba){var _0xade18f={};var _0x56bc6c={};var _0x27644f;var _0x1844f8;return db['SugarcrmConfiguration'][_0x8822('0x4b')]({'where':{'id':_0xaa124b['params']['id']}})[_0x8822('0x24')](handleEntityNotFound(_0x4c94a2,null))[_0x8822('0x24')](function(_0x164c9e){if(_0x164c9e){_0x27644f=_0x164c9e;_0x56bc6c[_0x8822('0x2e')]=_['keys'](db[_0x8822('0x4c')]['rawAttributes']);_0x56bc6c[_0x8822('0x2f')]=_[_0x8822('0x46')](_0xaa124b['query']);_0x56bc6c[_0x8822('0x30')]=_[_0x8822('0x31')](_0x56bc6c[_0x8822('0x2e')],_0x56bc6c['query']);_0xade18f['attributes']=_[_0x8822('0x31')](_0x56bc6c[_0x8822('0x2e')],qs[_0x8822('0x33')](_0xaa124b[_0x8822('0x2f')][_0x8822('0x33')]));_0xade18f[_0x8822('0x32')]=_0xade18f[_0x8822('0x32')][_0x8822('0x34')]?_0xade18f[_0x8822('0x32')]:_0x56bc6c[_0x8822('0x2e')];_0xade18f[_0x8822('0x38')]=qs[_0x8822('0x39')](_0xaa124b[_0x8822('0x2f')][_0x8822('0x39')]);_0xade18f[_0x8822('0x3c')]=qs['filters'](_[_0x8822('0x3a')](_0xaa124b[_0x8822('0x2f')],_0x56bc6c['filters']));if(_0xaa124b[_0x8822('0x2f')][_0x8822('0x3b')]){_0xade18f[_0x8822('0x3c')]=_[_0x8822('0x3d')](_0xade18f[_0x8822('0x3c')],{'$or':_[_0x8822('0x2a')](_0xade18f[_0x8822('0x32')],function(_0x49a989){var _0x3cbb96={};_0x3cbb96[_0x49a989]={'$like':'%'+_0xaa124b[_0x8822('0x2f')][_0x8822('0x3b')]+'%'};return _0x3cbb96;})});}_0xade18f=_[_0x8822('0x3d')]({},_0xade18f,_0xaa124b[_0x8822('0x3e')]);return _0x27644f[_0x8822('0x4f')](_0xade18f);}})['then'](function(_0x4d11b1){if(_0x4d11b1){_0x1844f8=_0x4d11b1[_0x8822('0x34')];if(!_0xaa124b[_0x8822('0x2f')][_0x8822('0x35')](_0x8822('0x36'))){_0xade18f[_0x8822('0x37')]=qs[_0x8822('0x37')](_0xaa124b['query']['limit']);_0xade18f[_0x8822('0x1d')]=qs[_0x8822('0x1d')](_0xaa124b[_0x8822('0x2f')]['offset']);}return _0x27644f[_0x8822('0x4f')](_0xade18f);}})[_0x8822('0x24')](function(_0x462621){if(_0x462621){return _0x462621?{'count':_0x1844f8,'rows':_0x462621}:null;}})[_0x8822('0x24')](respondWithResult(_0x4c94a2,null))[_0x8822('0x43')](handleError(_0x4c94a2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9b49328..1445aac 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 _0x5d6b=['moment','bluebird','request-promise','path','../../config/environment','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0x448af7,_0x2ef04e){var _0x108aa9=function(_0x4e81de){while(--_0x4e81de){_0x448af7['push'](_0x448af7['shift']());}};_0x108aa9(++_0x2ef04e);}(_0x5d6b,0xe0));var _0xb5d6=function(_0x2d07f3,_0x2e210c){_0x2d07f3=_0x2d07f3-0x0;var _0x1594d7=_0x5d6b[_0x2d07f3];return _0x1594d7;};'use strict';var _=require(_0xb5d6('0x0'));var util=require(_0xb5d6('0x1'));var logger=require(_0xb5d6('0x2'))(_0xb5d6('0x3'));var moment=require(_0xb5d6('0x4'));var BPromise=require(_0xb5d6('0x5'));var rp=require(_0xb5d6('0x6'));var fs=require('fs');var path=require(_0xb5d6('0x7'));var rimraf=require('rimraf');var config=require(_0xb5d6('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xb5d6('0x9')]=function(_0xa2d122,_0x34dcd2){return _0xa2d122['define'](_0xb5d6('0xa'),attributes,{'tableName':_0xb5d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bce=['moment','bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1bce,0x194));var _0xe1bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1bce[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe1bc('0x0'));var util=require(_0xe1bc('0x1'));var logger=require(_0xe1bc('0x2'))(_0xe1bc('0x3'));var moment=require(_0xe1bc('0x4'));var BPromise=require(_0xe1bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1bc('0x6'));var rimraf=require(_0xe1bc('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1bc('0x8'));module[_0xe1bc('0x9')]=function(_0x4c1084,_0x166e6c){return _0x4c1084[_0xe1bc('0xa')](_0xe1bc('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','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 dc12b05..f517213 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 _0xd89c=['../../config/logger','rpc','jayson/promise','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50113b,_0x5b95f6){var _0xbadb16=function(_0x4914eb){while(--_0x4914eb){_0x50113b['push'](_0x50113b['shift']());}};_0xbadb16(++_0x5b95f6);}(_0xd89c,0x11b));var _0xcd89=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xd89c[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require(_0xcd89('0x0'));var moment=require('moment');var BPromise=require(_0xcd89('0x1'));var rs=require(_0xcd89('0x2'));var fs=require('fs');var Redis=require(_0xcd89('0x3'));var db=require(_0xcd89('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd89('0x5'))(_0xcd89('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd89('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd47a,_0x3518dd,_0x4fd239){return new BPromise(function(_0x4c884a,_0x28ce52){return client[_0xcd89('0x8')](_0x2fd47a,_0x4fd239)[_0xcd89('0x9')](function(_0x1e0414){logger['info'](_0xcd89('0xa'),_0x3518dd,'request\x20sent');logger[_0xcd89('0xb')](_0xcd89('0xc'),_0x3518dd,'request\x20sent',JSON[_0xcd89('0xd')](_0x1e0414));if(_0x1e0414[_0xcd89('0xe')]){if(_0x1e0414[_0xcd89('0xe')][_0xcd89('0xf')]===0x1f4){logger[_0xcd89('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3518dd,_0x1e0414['error'][_0xcd89('0x10')]);return _0x28ce52(_0x1e0414['error']['message']);}logger[_0xcd89('0xe')](_0xcd89('0xa'),_0x3518dd,_0x1e0414[_0xcd89('0xe')]['message']);return _0x4c884a(_0x1e0414[_0xcd89('0xe')][_0xcd89('0x10')]);}else{logger['info'](_0xcd89('0xa'),_0x3518dd,'request\x20sent');_0x4c884a(_0x1e0414['result'][_0xcd89('0x10')]);}})[_0xcd89('0x11')](function(_0x1cc1ef){logger[_0xcd89('0xe')](_0xcd89('0xa'),_0x3518dd,_0x1cc1ef);_0x28ce52(_0x1cc1ef);});});} \ No newline at end of file +var _0xf77b=['../../mysqldb','../../config/logger','rpc','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0xf77b,0xe6));var _0xbf77=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xf77b[_0x215dc8];return _0x583ea3;};'use strict';var _=require(_0xbf77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbf77('0x1'));var rs=require(_0xbf77('0x2'));var fs=require('fs');var Redis=require(_0xbf77('0x3'));var db=require(_0xbf77('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf77('0x5'))(_0xbf77('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf77('0x7')][_0xbf77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x303bb8,_0x2247ab,_0x54eaf1){return new BPromise(function(_0x175440,_0x3577ee){return client['request'](_0x303bb8,_0x54eaf1)['then'](function(_0x4560bc){logger[_0xbf77('0x9')](_0xbf77('0xa'),_0x2247ab,_0xbf77('0xb'));logger[_0xbf77('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2247ab,_0xbf77('0xb'),JSON[_0xbf77('0xd')](_0x4560bc));if(_0x4560bc[_0xbf77('0xe')]){if(_0x4560bc[_0xbf77('0xe')]['code']===0x1f4){logger['error'](_0xbf77('0xa'),_0x2247ab,_0x4560bc[_0xbf77('0xe')][_0xbf77('0xf')]);return _0x3577ee(_0x4560bc[_0xbf77('0xe')][_0xbf77('0xf')]);}logger[_0xbf77('0xe')](_0xbf77('0xa'),_0x2247ab,_0x4560bc[_0xbf77('0xe')][_0xbf77('0xf')]);return _0x175440(_0x4560bc[_0xbf77('0xe')][_0xbf77('0xf')]);}else{logger[_0xbf77('0x9')](_0xbf77('0xa'),_0x2247ab,_0xbf77('0xb'));_0x175440(_0x4560bc[_0xbf77('0x10')][_0xbf77('0xf')]);}})[_0xbf77('0x11')](function(_0x4a6f06){logger['error'](_0xbf77('0xa'),_0x2247ab,_0x4a6f06);_0x3577ee(_0x4a6f06);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8174300..b179a42 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 _0x9778=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x3ac063,_0x52424f){var _0xa682d=function(_0x47af4a){while(--_0x47af4a){_0x3ac063['push'](_0x3ac063['shift']());}};_0xa682d(++_0x52424f);}(_0x9778,0x1d5));var _0x8977=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x9778[_0x54b396];return _0x532e6d;};'use strict';var multer=require('multer');var util=require(_0x8977('0x0'));var path=require(_0x8977('0x1'));var timeout=require(_0x8977('0x2'));var express=require('express');var router=express[_0x8977('0x3')]();var fs_extra=require(_0x8977('0x4'));var auth=require(_0x8977('0x5'));var interaction=require(_0x8977('0x6'));var config=require(_0x8977('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x8977('0x8')]('/',auth[_0x8977('0x9')](),controller[_0x8977('0xa')]);router[_0x8977('0x8')](_0x8977('0xb'),auth[_0x8977('0x9')](),controller[_0x8977('0xc')]);router[_0x8977('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8977('0xe')](_0x8977('0xb'),auth[_0x8977('0x9')](),controller[_0x8977('0xf')]);router['delete'](_0x8977('0xb'),auth[_0x8977('0x9')](),controller[_0x8977('0x10')]);module[_0x8977('0x11')]=router; \ No newline at end of file +var _0xe8af=['delete','exports','util','path','connect-timeout','express','Router','./intSugarcrmField.controller','isAuthenticated','index','post','/:id','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xe8af,0x13a));var _0xfe8a=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xe8af[_0x43b584];return _0x48f27b;};'use strict';var multer=require('multer');var util=require(_0xfe8a('0x0'));var path=require(_0xfe8a('0x1'));var timeout=require(_0xfe8a('0x2'));var express=require(_0xfe8a('0x3'));var router=express[_0xfe8a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfe8a('0x5'));router['get']('/',auth[_0xfe8a('0x6')](),controller[_0xfe8a('0x7')]);router['get']('/:id',auth[_0xfe8a('0x6')](),controller['show']);router[_0xfe8a('0x8')]('/',auth[_0xfe8a('0x6')](),controller['create']);router['put'](_0xfe8a('0x9'),auth[_0xfe8a('0x6')](),controller[_0xfe8a('0xa')]);router[_0xfe8a('0xb')](_0xfe8a('0x9'),auth[_0xfe8a('0x6')](),controller['destroy']);module[_0xfe8a('0xc')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 1b7bff5..ba82499 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 _0x910e=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x803c0d,_0x34db27){var _0x49a88a=function(_0x48a26f){while(--_0x48a26f){_0x803c0d['push'](_0x803c0d['shift']());}};_0x49a88a(++_0x34db27);}(_0x910e,0x72));var _0xe910=function(_0x4d04d5,_0x3f3eb1){_0x4d04d5=_0x4d04d5-0x0;var _0x4d37b6=_0x910e[_0x4d04d5];return _0x4d37b6;};'use strict';var Sequelize=require(_0xe910('0x0'));module[_0xe910('0x1')]={'type':{'type':Sequelize[_0xe910('0x2')]('string',_0xe910('0x3'),_0xe910('0x4'),_0xe910('0x5'),_0xe910('0x6')),'defaultValue':_0xe910('0x7')},'content':{'type':Sequelize[_0xe910('0x8')]},'key':{'type':Sequelize[_0xe910('0x8')]},'keyType':{'type':Sequelize[_0xe910('0x2')](_0xe910('0x7'),_0xe910('0x3'),_0xe910('0x4'))},'keyContent':{'type':Sequelize[_0xe910('0x8')]},'idField':{'type':Sequelize[_0xe910('0x8')]},'nameField':{'type':Sequelize[_0xe910('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe910('0x8')]}}; \ No newline at end of file +var _0x3bcd=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x3bcd,0x94));var _0xd3bc=function(_0x3ff97b,_0x459934){_0x3ff97b=_0x3ff97b-0x0;var _0x43ab91=_0x3bcd[_0x3ff97b];return _0x43ab91;};'use strict';var Sequelize=require(_0xd3bc('0x0'));module[_0xd3bc('0x1')]={'type':{'type':Sequelize[_0xd3bc('0x2')]('string',_0xd3bc('0x3'),_0xd3bc('0x4'),_0xd3bc('0x5'),_0xd3bc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd3bc('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xd3bc('0x3'),_0xd3bc('0x4'))},'keyContent':{'type':Sequelize[_0xd3bc('0x7')]},'idField':{'type':Sequelize[_0xd3bc('0x7')]},'nameField':{'type':Sequelize[_0xd3bc('0x7')]},'customField':{'type':Sequelize[_0xd3bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd3bc('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 698a294..59cb282 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 _0x63e2=['stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error'];(function(_0x3c8d16,_0x411be5){var _0x124b8d=function(_0xd09f42){while(--_0xd09f42){_0x3c8d16['push'](_0x3c8d16['shift']());}};_0x124b8d(++_0x411be5);}(_0x63e2,0xad));var _0x263e=function(_0x483940,_0x4648ee){_0x483940=_0x483940-0x0;var _0x1d4b6e=_0x63e2[_0x483940];return _0x1d4b6e;};'use strict';var emlformat=require(_0x263e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x263e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x263e('0x2'));var BPromise=require(_0x263e('0x3'));var Mustache=require('mustache');var util=require(_0x263e('0x4'));var path=require('path');var sox=require(_0x263e('0x5'));var csv=require(_0x263e('0x6'));var ejs=require(_0x263e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x263e('0x8'));var squel=require(_0x263e('0x9'));var crypto=require(_0x263e('0xa'));var jsforce=require(_0x263e('0xb'));var deskjs=require(_0x263e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x263e('0xd'));var Papa=require('papaparse');var Redis=require(_0x263e('0xe'));var authService=require(_0x263e('0xf'));var qs=require(_0x263e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x263e('0x11'));var utils=require(_0x263e('0x12'));var config=require(_0x263e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x263e('0x14'))['db'];function respondWithStatusCode(_0x295638,_0x489e32){_0x489e32=_0x489e32||0xcc;return function(_0x57e0f5){if(_0x57e0f5){return _0x295638['sendStatus'](_0x489e32);}return _0x295638['status'](_0x489e32)['end']();};}function respondWithResult(_0x49ba7c,_0x45b220){_0x45b220=_0x45b220||0xc8;return function(_0xfc7f02){if(_0xfc7f02){return _0x49ba7c[_0x263e('0x15')](_0x45b220)[_0x263e('0x16')](_0xfc7f02);}};}function respondWithFilteredResult(_0x547cef,_0x30ff24){return function(_0xdd12f7){if(_0xdd12f7){var _0x124805=typeof _0x30ff24[_0x263e('0x17')]===_0x263e('0x18')&&typeof _0x30ff24[_0x263e('0x19')]===_0x263e('0x18');var _0x23885d=_0xdd12f7['count'];var _0x59bdc9=_0x124805?0x0:_0x30ff24['offset'];var _0x236b7e=_0x124805?_0xdd12f7[_0x263e('0x1a')]:_0x30ff24[_0x263e('0x17')]+_0x30ff24['limit'];var _0x2bf1c7;if(_0x236b7e>=_0x23885d){_0x236b7e=_0x23885d;_0x2bf1c7=0xc8;}else{_0x2bf1c7=0xce;}_0x547cef['status'](_0x2bf1c7);return _0x547cef[_0x263e('0x1b')](_0x263e('0x1c'),_0x59bdc9+'-'+_0x236b7e+'/'+_0x23885d)[_0x263e('0x16')](_0xdd12f7);}return null;};}function patchUpdates(_0x4df05a){return function(_0xa05cd){try{jsonpatch[_0x263e('0x1d')](_0xa05cd,_0x4df05a,!![]);}catch(_0xc8f787){return BPromise[_0x263e('0x1e')](_0xc8f787);}return _0xa05cd[_0x263e('0x1f')]();};}function saveUpdates(_0x557a60,_0x4ad6a3){return function(_0x7bee5b){if(_0x7bee5b){return _0x7bee5b['update'](_0x557a60)[_0x263e('0x20')](function(_0x355c99){return _0x355c99;});}return null;};}function removeEntity(_0x4d88b0,_0x342f3b){return function(_0x2eac57){if(_0x2eac57){return _0x2eac57[_0x263e('0x21')]()[_0x263e('0x20')](function(){_0x4d88b0['status'](0xcc)[_0x263e('0x22')]();});}};}function handleEntityNotFound(_0x97bb8d,_0x3f56b2){return function(_0x585acf){if(!_0x585acf){_0x97bb8d[_0x263e('0x23')](0x194);}return _0x585acf;};}function handleError(_0x2cc9c2,_0x483c8b){_0x483c8b=_0x483c8b||0x1f4;return function(_0x455674){logger[_0x263e('0x24')](_0x455674[_0x263e('0x25')]);if(_0x455674[_0x263e('0x26')]){delete _0x455674[_0x263e('0x26')];}_0x2cc9c2['status'](_0x483c8b)[_0x263e('0x27')](_0x455674);};}exports[_0x263e('0x28')]=function(_0x506ece,_0x30ef8e){var _0x15c514={},_0x2064e3={},_0x3110c0={'count':0x0,'rows':[]};var _0x312891=_[_0x263e('0x29')](db[_0x263e('0x2a')][_0x263e('0x2b')],function(_0x92becd){return{'name':_0x92becd[_0x263e('0x2c')],'type':_0x92becd[_0x263e('0x2d')]['key']};});_0x2064e3[_0x263e('0x2e')]=_[_0x263e('0x29')](_0x312891,_0x263e('0x26'));_0x2064e3[_0x263e('0x2f')]=_[_0x263e('0x30')](_0x506ece[_0x263e('0x2f')]);_0x2064e3[_0x263e('0x31')]=_[_0x263e('0x32')](_0x2064e3[_0x263e('0x2e')],_0x2064e3[_0x263e('0x2f')]);_0x15c514[_0x263e('0x33')]=_[_0x263e('0x32')](_0x2064e3[_0x263e('0x2e')],qs[_0x263e('0x34')](_0x506ece[_0x263e('0x2f')][_0x263e('0x34')]));_0x15c514[_0x263e('0x33')]=_0x15c514[_0x263e('0x33')]['length']?_0x15c514[_0x263e('0x33')]:_0x2064e3[_0x263e('0x2e')];if(!_0x506ece[_0x263e('0x2f')]['hasOwnProperty'](_0x263e('0x35'))){_0x15c514[_0x263e('0x19')]=qs[_0x263e('0x19')](_0x506ece[_0x263e('0x2f')][_0x263e('0x19')]);_0x15c514[_0x263e('0x17')]=qs[_0x263e('0x17')](_0x506ece['query'][_0x263e('0x17')]);}_0x15c514['order']=qs['sort'](_0x506ece['query']['sort']);_0x15c514[_0x263e('0x36')]=qs[_0x263e('0x31')](_[_0x263e('0x37')](_0x506ece[_0x263e('0x2f')],_0x2064e3[_0x263e('0x31')]),_0x312891);if(_0x506ece['query'][_0x263e('0x38')]){_0x15c514[_0x263e('0x36')]=_[_0x263e('0x39')](_0x15c514[_0x263e('0x36')],{'$or':_['map'](_0x312891,function(_0x13f502){if(_0x13f502['type']!=='VIRTUAL'){var _0x315cef={};_0x315cef[_0x13f502['name']]={'$like':'%'+_0x506ece[_0x263e('0x2f')][_0x263e('0x38')]+'%'};return _0x315cef;}})});}_0x15c514=_[_0x263e('0x39')]({},_0x15c514,_0x506ece[_0x263e('0x3a')]);var _0x382396={'where':_0x15c514[_0x263e('0x36')]};return db[_0x263e('0x2a')][_0x263e('0x1a')](_0x382396)[_0x263e('0x20')](function(_0x4d64a2){_0x3110c0[_0x263e('0x1a')]=_0x4d64a2;if(_0x506ece[_0x263e('0x2f')][_0x263e('0x3b')]){_0x15c514[_0x263e('0x3c')]=[{'all':!![]}];}return db[_0x263e('0x2a')][_0x263e('0x3d')](_0x15c514);})[_0x263e('0x20')](function(_0x5bd80f){_0x3110c0[_0x263e('0x3e')]=_0x5bd80f;return _0x3110c0;})[_0x263e('0x20')](respondWithFilteredResult(_0x30ef8e,_0x15c514))[_0x263e('0x3f')](handleError(_0x30ef8e,null));};exports['show']=function(_0xfbba20,_0x55c8eb){var _0x39a2cb={'raw':!![],'where':{'id':_0xfbba20['params']['id']}},_0x5527eb={};_0x5527eb['model']=_[_0x263e('0x30')](db[_0x263e('0x2a')][_0x263e('0x2b')]);_0x5527eb[_0x263e('0x2f')]=_[_0x263e('0x30')](_0xfbba20[_0x263e('0x2f')]);_0x5527eb[_0x263e('0x31')]=_[_0x263e('0x32')](_0x5527eb[_0x263e('0x2e')],_0x5527eb[_0x263e('0x2f')]);_0x39a2cb[_0x263e('0x33')]=_[_0x263e('0x32')](_0x5527eb[_0x263e('0x2e')],qs[_0x263e('0x34')](_0xfbba20[_0x263e('0x2f')][_0x263e('0x34')]));_0x39a2cb[_0x263e('0x33')]=_0x39a2cb['attributes'][_0x263e('0x40')]?_0x39a2cb[_0x263e('0x33')]:_0x5527eb[_0x263e('0x2e')];if(_0xfbba20[_0x263e('0x2f')][_0x263e('0x3b')]){_0x39a2cb['include']=[{'all':!![]}];}_0x39a2cb=_[_0x263e('0x39')]({},_0x39a2cb,_0xfbba20[_0x263e('0x3a')]);return db[_0x263e('0x2a')][_0x263e('0x41')](_0x39a2cb)[_0x263e('0x20')](handleEntityNotFound(_0x55c8eb,null))['then'](respondWithResult(_0x55c8eb,null))[_0x263e('0x3f')](handleError(_0x55c8eb,null));};exports[_0x263e('0x42')]=function(_0x315873,_0x48bc83){return db[_0x263e('0x2a')]['create'](_0x315873[_0x263e('0x43')],{})[_0x263e('0x20')](respondWithResult(_0x48bc83,0xc9))[_0x263e('0x3f')](handleError(_0x48bc83,null));};exports[_0x263e('0x44')]=function(_0x5d9d85,_0x2b734f){if(_0x5d9d85['body']['id']){delete _0x5d9d85[_0x263e('0x43')]['id'];}return db[_0x263e('0x2a')][_0x263e('0x41')]({'where':{'id':_0x5d9d85[_0x263e('0x45')]['id']}})[_0x263e('0x20')](handleEntityNotFound(_0x2b734f,null))[_0x263e('0x20')](saveUpdates(_0x5d9d85[_0x263e('0x43')],null))[_0x263e('0x20')](respondWithResult(_0x2b734f,null))['catch'](handleError(_0x2b734f,null));};exports[_0x263e('0x21')]=function(_0x1fe0b5,_0x356261){return db['SugarcrmField']['find']({'where':{'id':_0x1fe0b5[_0x263e('0x45')]['id']}})[_0x263e('0x20')](handleEntityNotFound(_0x356261,null))[_0x263e('0x20')](removeEntity(_0x356261,null))[_0x263e('0x3f')](handleError(_0x356261,null));}; \ No newline at end of file +var _0x2d87=['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','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','VIRTUAL','filter','SugarcrmField','includeAll','include','rows','show','params','rawAttributes','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xd4c1f4,_0x5cb205){var _0x3407db=function(_0x140d17){while(--_0x140d17){_0xd4c1f4['push'](_0xd4c1f4['shift']());}};_0x3407db(++_0x5cb205);}(_0x2d87,0xe0));var _0x72d8=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2d87[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0x72d8('0x0'));var rimraf=require(_0x72d8('0x1'));var zipdir=require(_0x72d8('0x2'));var jsonpatch=require(_0x72d8('0x3'));var rp=require(_0x72d8('0x4'));var moment=require(_0x72d8('0x5'));var BPromise=require(_0x72d8('0x6'));var Mustache=require(_0x72d8('0x7'));var util=require(_0x72d8('0x8'));var path=require(_0x72d8('0x9'));var sox=require('sox');var csv=require(_0x72d8('0xa'));var ejs=require(_0x72d8('0xb'));var fs=require('fs');var fs_extra=require(_0x72d8('0xc'));var _=require(_0x72d8('0xd'));var squel=require(_0x72d8('0xe'));var crypto=require(_0x72d8('0xf'));var jsforce=require(_0x72d8('0x10'));var deskjs=require(_0x72d8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x72d8('0x12'));var Papa=require(_0x72d8('0x13'));var Redis=require(_0x72d8('0x14'));var authService=require(_0x72d8('0x15'));var qs=require(_0x72d8('0x16'));var as=require(_0x72d8('0x17'));var hardwareService=require(_0x72d8('0x18'));var logger=require(_0x72d8('0x19'))(_0x72d8('0x1a'));var utils=require(_0x72d8('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x72d8('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x510241,_0x502741){_0x502741=_0x502741||0xcc;return function(_0x46dc1c){if(_0x46dc1c){return _0x510241[_0x72d8('0x1d')](_0x502741);}return _0x510241[_0x72d8('0x1e')](_0x502741)[_0x72d8('0x1f')]();};}function respondWithResult(_0x2f3b56,_0x449c6d){_0x449c6d=_0x449c6d||0xc8;return function(_0x25a0b1){if(_0x25a0b1){return _0x2f3b56[_0x72d8('0x1e')](_0x449c6d)[_0x72d8('0x20')](_0x25a0b1);}};}function respondWithFilteredResult(_0x549d34,_0x16e44e){return function(_0x4cc6a5){if(_0x4cc6a5){var _0x26f385=typeof _0x16e44e[_0x72d8('0x21')]==='undefined'&&typeof _0x16e44e[_0x72d8('0x22')]===_0x72d8('0x23');var _0x2c6d2e=_0x4cc6a5[_0x72d8('0x24')];var _0xbf1d5d=_0x26f385?0x0:_0x16e44e['offset'];var _0x26db93=_0x26f385?_0x4cc6a5[_0x72d8('0x24')]:_0x16e44e[_0x72d8('0x21')]+_0x16e44e['limit'];var _0x5d1432;if(_0x26db93>=_0x2c6d2e){_0x26db93=_0x2c6d2e;_0x5d1432=0xc8;}else{_0x5d1432=0xce;}_0x549d34['status'](_0x5d1432);return _0x549d34[_0x72d8('0x25')](_0x72d8('0x26'),_0xbf1d5d+'-'+_0x26db93+'/'+_0x2c6d2e)[_0x72d8('0x20')](_0x4cc6a5);}return null;};}function patchUpdates(_0x35b378){return function(_0x1c466f){try{jsonpatch[_0x72d8('0x27')](_0x1c466f,_0x35b378,!![]);}catch(_0x40b749){return BPromise[_0x72d8('0x28')](_0x40b749);}return _0x1c466f[_0x72d8('0x29')]();};}function saveUpdates(_0x218e5c,_0x3cc8c6){return function(_0x16999a){if(_0x16999a){return _0x16999a[_0x72d8('0x2a')](_0x218e5c)[_0x72d8('0x2b')](function(_0x2645ce){return _0x2645ce;});}return null;};}function removeEntity(_0x3f15d7,_0x239867){return function(_0x38c9f7){if(_0x38c9f7){return _0x38c9f7[_0x72d8('0x2c')]()[_0x72d8('0x2b')](function(){_0x3f15d7[_0x72d8('0x1e')](0xcc)[_0x72d8('0x1f')]();});}};}function handleEntityNotFound(_0x295e69,_0xce98f6){return function(_0xd3637c){if(!_0xd3637c){_0x295e69[_0x72d8('0x1d')](0x194);}return _0xd3637c;};}function handleError(_0x2332b2,_0x1ca1b5){_0x1ca1b5=_0x1ca1b5||0x1f4;return function(_0x43bb33){logger[_0x72d8('0x2d')](_0x43bb33[_0x72d8('0x2e')]);if(_0x43bb33[_0x72d8('0x2f')]){delete _0x43bb33[_0x72d8('0x2f')];}_0x2332b2[_0x72d8('0x1e')](_0x1ca1b5)[_0x72d8('0x30')](_0x43bb33);};}exports['index']=function(_0x31f7d1,_0x1e976a){var _0x14ffc2={},_0x33e390={},_0x311d84={'count':0x0,'rows':[]};var _0x10813a=_[_0x72d8('0x31')](db['SugarcrmField']['rawAttributes'],function(_0x51f960){return{'name':_0x51f960['fieldName'],'type':_0x51f960[_0x72d8('0x32')][_0x72d8('0x33')]};});_0x33e390['model']=_[_0x72d8('0x31')](_0x10813a,_0x72d8('0x2f'));_0x33e390[_0x72d8('0x34')]=_[_0x72d8('0x35')](_0x31f7d1[_0x72d8('0x34')]);_0x33e390[_0x72d8('0x36')]=_[_0x72d8('0x37')](_0x33e390[_0x72d8('0x38')],_0x33e390[_0x72d8('0x34')]);_0x14ffc2[_0x72d8('0x39')]=_[_0x72d8('0x37')](_0x33e390[_0x72d8('0x38')],qs['fields'](_0x31f7d1[_0x72d8('0x34')][_0x72d8('0x3a')]));_0x14ffc2['attributes']=_0x14ffc2[_0x72d8('0x39')][_0x72d8('0x3b')]?_0x14ffc2[_0x72d8('0x39')]:_0x33e390[_0x72d8('0x38')];if(!_0x31f7d1['query']['hasOwnProperty'](_0x72d8('0x3c'))){_0x14ffc2['limit']=qs['limit'](_0x31f7d1[_0x72d8('0x34')]['limit']);_0x14ffc2[_0x72d8('0x21')]=qs['offset'](_0x31f7d1['query'][_0x72d8('0x21')]);}_0x14ffc2['order']=qs[_0x72d8('0x3d')](_0x31f7d1[_0x72d8('0x34')]['sort']);_0x14ffc2[_0x72d8('0x3e')]=qs[_0x72d8('0x36')](_['pick'](_0x31f7d1[_0x72d8('0x34')],_0x33e390[_0x72d8('0x36')]),_0x10813a);if(_0x31f7d1[_0x72d8('0x34')]['filter']){_0x14ffc2[_0x72d8('0x3e')]=_['merge'](_0x14ffc2['where'],{'$or':_[_0x72d8('0x31')](_0x10813a,function(_0xdee05c){if(_0xdee05c[_0x72d8('0x32')]!==_0x72d8('0x3f')){var _0x57edcc={};_0x57edcc[_0xdee05c[_0x72d8('0x2f')]]={'$like':'%'+_0x31f7d1[_0x72d8('0x34')][_0x72d8('0x40')]+'%'};return _0x57edcc;}})});}_0x14ffc2=_['merge']({},_0x14ffc2,_0x31f7d1['options']);var _0x2d8311={'where':_0x14ffc2[_0x72d8('0x3e')]};return db[_0x72d8('0x41')]['count'](_0x2d8311)[_0x72d8('0x2b')](function(_0x29d09a){_0x311d84[_0x72d8('0x24')]=_0x29d09a;if(_0x31f7d1['query'][_0x72d8('0x42')]){_0x14ffc2[_0x72d8('0x43')]=[{'all':!![]}];}return db[_0x72d8('0x41')]['findAll'](_0x14ffc2);})[_0x72d8('0x2b')](function(_0xe1c21a){_0x311d84[_0x72d8('0x44')]=_0xe1c21a;return _0x311d84;})['then'](respondWithFilteredResult(_0x1e976a,_0x14ffc2))['catch'](handleError(_0x1e976a,null));};exports[_0x72d8('0x45')]=function(_0x11a2fc,_0x3a91b4){var _0x582384={'raw':!![],'where':{'id':_0x11a2fc[_0x72d8('0x46')]['id']}},_0x725dfa={};_0x725dfa[_0x72d8('0x38')]=_[_0x72d8('0x35')](db[_0x72d8('0x41')][_0x72d8('0x47')]);_0x725dfa[_0x72d8('0x34')]=_[_0x72d8('0x35')](_0x11a2fc[_0x72d8('0x34')]);_0x725dfa[_0x72d8('0x36')]=_[_0x72d8('0x37')](_0x725dfa[_0x72d8('0x38')],_0x725dfa[_0x72d8('0x34')]);_0x582384['attributes']=_[_0x72d8('0x37')](_0x725dfa['model'],qs[_0x72d8('0x3a')](_0x11a2fc[_0x72d8('0x34')]['fields']));_0x582384['attributes']=_0x582384[_0x72d8('0x39')]['length']?_0x582384[_0x72d8('0x39')]:_0x725dfa[_0x72d8('0x38')];if(_0x11a2fc[_0x72d8('0x34')][_0x72d8('0x42')]){_0x582384[_0x72d8('0x43')]=[{'all':!![]}];}_0x582384=_[_0x72d8('0x48')]({},_0x582384,_0x11a2fc[_0x72d8('0x49')]);return db['SugarcrmField'][_0x72d8('0x4a')](_0x582384)['then'](handleEntityNotFound(_0x3a91b4,null))[_0x72d8('0x2b')](respondWithResult(_0x3a91b4,null))['catch'](handleError(_0x3a91b4,null));};exports[_0x72d8('0x4b')]=function(_0x47fc37,_0x5eb2ea){return db[_0x72d8('0x41')][_0x72d8('0x4b')](_0x47fc37[_0x72d8('0x4c')],{})[_0x72d8('0x2b')](respondWithResult(_0x5eb2ea,0xc9))[_0x72d8('0x4d')](handleError(_0x5eb2ea,null));};exports['update']=function(_0x52d428,_0x1af0bc){if(_0x52d428['body']['id']){delete _0x52d428[_0x72d8('0x4c')]['id'];}return db[_0x72d8('0x41')]['find']({'where':{'id':_0x52d428[_0x72d8('0x46')]['id']}})[_0x72d8('0x2b')](handleEntityNotFound(_0x1af0bc,null))[_0x72d8('0x2b')](saveUpdates(_0x52d428['body'],null))['then'](respondWithResult(_0x1af0bc,null))[_0x72d8('0x4d')](handleError(_0x1af0bc,null));};exports[_0x72d8('0x2c')]=function(_0x1dbb42,_0x262d56){return db[_0x72d8('0x41')][_0x72d8('0x4a')]({'where':{'id':_0x1dbb42[_0x72d8('0x46')]['id']}})[_0x72d8('0x2b')](handleEntityNotFound(_0x262d56,null))[_0x72d8('0x2b')](removeEntity(_0x262d56,null))['catch'](handleError(_0x262d56,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d5dd12c..fec55f4 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 _0xbb7b=['SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x1c7e42,_0x17d603){var _0x1142d9=function(_0x12c2b0){while(--_0x12c2b0){_0x1c7e42['push'](_0x1c7e42['shift']());}};_0x1142d9(++_0x17d603);}(_0xbb7b,0xe4));var _0xbbb7=function(_0x28856e,_0xd57c4d){_0x28856e=_0x28856e-0x0;var _0x1432c6=_0xbb7b[_0x28856e];return _0x1432c6;};'use strict';var _=require(_0xbbb7('0x0'));var util=require(_0xbbb7('0x1'));var logger=require('../../config/logger')(_0xbbb7('0x2'));var moment=require(_0xbbb7('0x3'));var BPromise=require('bluebird');var rp=require(_0xbbb7('0x4'));var fs=require('fs');var path=require(_0xbbb7('0x5'));var rimraf=require(_0xbbb7('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbb7('0x7'));module[_0xbbb7('0x8')]=function(_0x23760b,_0x2e0a71){return _0x23760b[_0xbbb7('0x9')](_0xbbb7('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xbbb7('0xb'),'fields':[_0xbbb7('0xc'),_0xbbb7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51bd=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','sugarcrm_unique_index'];(function(_0x51bd7d,_0x511fa){var _0x20f733=function(_0x36625f){while(--_0x36625f){_0x51bd7d['push'](_0x51bd7d['shift']());}};_0x20f733(++_0x511fa);}(_0x51bd,0x1f0));var _0xd51b=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x51bd[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xd51b('0x0'));var util=require(_0xd51b('0x1'));var logger=require(_0xd51b('0x2'))(_0xd51b('0x3'));var moment=require(_0xd51b('0x4'));var BPromise=require(_0xd51b('0x5'));var rp=require(_0xd51b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd51b('0x7'));var config=require(_0xd51b('0x8'));var attributes=require(_0xd51b('0x9'));module['exports']=function(_0x3616cd,_0xb99684){return _0x3616cd['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xd51b('0xa'),'fields':[_0xd51b('0xb'),_0xd51b('0xc')],'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 05ab983..f73c3d1 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 _0xfbcb=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','http','then','info','request\x20sent','debug','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfbcb,0x76));var _0xbfbc=function(_0x2cc1a9,_0x534ba3){_0x2cc1a9=_0x2cc1a9-0x0;var _0x996857=_0xfbcb[_0x2cc1a9];return _0x996857;};'use strict';var _=require('lodash');var util=require(_0xbfbc('0x0'));var moment=require(_0xbfbc('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfbc('0x2'));var fs=require('fs');var Redis=require(_0xbfbc('0x3'));var db=require(_0xbfbc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfbc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbfbc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x47082a,_0xc892b8,_0x469447){return new BPromise(function(_0x4c623c,_0x42bced){return client['request'](_0x47082a,_0x469447)[_0xbfbc('0x7')](function(_0xdc717){logger[_0xbfbc('0x8')]('SugarcrmField,\x20%s,\x20%s',_0xc892b8,_0xbfbc('0x9'));logger[_0xbfbc('0xa')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0xc892b8,_0xbfbc('0x9'),JSON[_0xbfbc('0xb')](_0xdc717));if(_0xdc717[_0xbfbc('0xc')]){if(_0xdc717[_0xbfbc('0xc')][_0xbfbc('0xd')]===0x1f4){logger['error'](_0xbfbc('0xe'),_0xc892b8,_0xdc717[_0xbfbc('0xc')]['message']);return _0x42bced(_0xdc717[_0xbfbc('0xc')]['message']);}logger['error'](_0xbfbc('0xe'),_0xc892b8,_0xdc717[_0xbfbc('0xc')][_0xbfbc('0xf')]);return _0x4c623c(_0xdc717[_0xbfbc('0xc')]['message']);}else{logger[_0xbfbc('0x8')](_0xbfbc('0xe'),_0xc892b8,_0xbfbc('0x9'));_0x4c623c(_0xdc717['result']['message']);}})[_0xbfbc('0x10')](function(_0x2822f6){logger[_0xbfbc('0xc')](_0xbfbc('0xe'),_0xc892b8,_0x2822f6);_0x42bced(_0x2822f6);});});} \ No newline at end of file +var _0x2f36=['../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3d07ac,_0x48e276){var _0x5b88ce=function(_0x55bb3e){while(--_0x55bb3e){_0x3d07ac['push'](_0x3d07ac['shift']());}};_0x5b88ce(++_0x48e276);}(_0x2f36,0x115));var _0x62f3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f36[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x62f3('0x0'));var util=require(_0x62f3('0x1'));var moment=require(_0x62f3('0x2'));var BPromise=require(_0x62f3('0x3'));var rs=require(_0x62f3('0x4'));var fs=require('fs');var Redis=require(_0x62f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f3('0x6'));var logger=require(_0x62f3('0x7'))(_0x62f3('0x8'));var config=require(_0x62f3('0x9'));var jayson=require(_0x62f3('0xa'));var client=jayson[_0x62f3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13c4ee,_0xad7a9d,_0x4045c1){return new BPromise(function(_0x23fbde,_0x2d06e3){return client[_0x62f3('0xc')](_0x13c4ee,_0x4045c1)[_0x62f3('0xd')](function(_0x4e8054){logger[_0x62f3('0xe')]('SugarcrmField,\x20%s,\x20%s',_0xad7a9d,'request\x20sent');logger['debug'](_0x62f3('0xf'),_0xad7a9d,'request\x20sent',JSON[_0x62f3('0x10')](_0x4e8054));if(_0x4e8054[_0x62f3('0x11')]){if(_0x4e8054[_0x62f3('0x11')]['code']===0x1f4){logger[_0x62f3('0x11')](_0x62f3('0x12'),_0xad7a9d,_0x4e8054[_0x62f3('0x11')]['message']);return _0x2d06e3(_0x4e8054[_0x62f3('0x11')][_0x62f3('0x13')]);}logger['error'](_0x62f3('0x12'),_0xad7a9d,_0x4e8054[_0x62f3('0x11')][_0x62f3('0x13')]);return _0x23fbde(_0x4e8054[_0x62f3('0x11')][_0x62f3('0x13')]);}else{logger['info'](_0x62f3('0x12'),_0xad7a9d,_0x62f3('0x14'));_0x23fbde(_0x4e8054['result']['message']);}})[_0x62f3('0x15')](function(_0x337dd3){logger['error'](_0x62f3('0x12'),_0xad7a9d,_0x337dd3);_0x2d06e3(_0x337dd3);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e1f1551..39db09a 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 _0xf120=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','create','/:id/configurations','put','update'];(function(_0x29ff87,_0x48d794){var _0x19d029=function(_0x437824){while(--_0x437824){_0x29ff87['push'](_0x29ff87['shift']());}};_0x19d029(++_0x48d794);}(_0xf120,0x179));var _0x0f12=function(_0x25ecbe,_0x2acd32){_0x25ecbe=_0x25ecbe-0x0;var _0x18c088=_0xf120[_0x25ecbe];return _0x18c088;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require(_0x0f12('0x2'));var express=require('express');var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f12('0x6'));var controller=require(_0x0f12('0x7'));router[_0x0f12('0x8')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router[_0x0f12('0x8')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller['show']);router[_0x0f12('0x8')]('/:id/configurations',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0f12('0xd')]);router[_0x0f12('0xe')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xf')]);router[_0x0f12('0xe')](_0x0f12('0x10'),auth[_0x0f12('0x9')](),controller['addConfiguration']);router[_0x0f12('0x11')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x12')]);router[_0x0f12('0x13')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x14')]);module[_0x0f12('0x15')]=router; \ No newline at end of file +var _0x7266=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x7266,0xec));var _0x6726=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7266[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var path=require(_0x6726('0x2'));var timeout=require(_0x6726('0x3'));var express=require(_0x6726('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6726('0x5'));var interaction=require(_0x6726('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x6726('0x7')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0x9')]);router[_0x6726('0x7')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller[_0x6726('0xb')]);router[_0x6726('0x7')](_0x6726('0xc'),auth[_0x6726('0x8')](),controller[_0x6726('0xd')]);router[_0x6726('0x7')](_0x6726('0xe'),auth['isAuthenticated'](),controller[_0x6726('0xf')]);router[_0x6726('0x10')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0x11')]);router['post'](_0x6726('0xc'),auth['isAuthenticated'](),controller[_0x6726('0x12')]);router[_0x6726('0x13')]('/:id',auth[_0x6726('0x8')](),controller[_0x6726('0x14')]);router[_0x6726('0x15')](_0x6726('0xa'),auth['isAuthenticated'](),controller[_0x6726('0x16')]);module[_0x6726('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e29579f..0c4300e 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 _0xefa6=['STRING','HelpDesk','sequelize','exports'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xefa6,0x17a));var _0x6efa=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xefa6[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x6efa('0x0'));module[_0x6efa('0x1')]={'name':{'type':Sequelize[_0x6efa('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6efa('0x2')]},'username':{'type':Sequelize[_0x6efa('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6efa('0x2')],'allowNull':![],'defaultValue':_0x6efa('0x3')},'remoteUri':{'type':Sequelize[_0x6efa('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6efa('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2244=['sequelize','STRING'];(function(_0x559d02,_0x27950f){var _0x735d02=function(_0x4460c5){while(--_0x4460c5){_0x559d02['push'](_0x559d02['shift']());}};_0x735d02(++_0x27950f);}(_0x2244,0x76));var _0x4224=function(_0x20e9f6,_0x5081b3){_0x20e9f6=_0x20e9f6-0x0;var _0x423ca6=_0x2244[_0x20e9f6];return _0x423ca6;};'use strict';var Sequelize=require(_0x4224('0x0'));module['exports']={'name':{'type':Sequelize[_0x4224('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4224('0x1')]},'username':{'type':Sequelize[_0x4224('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x4224('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4224('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 08d9f37..2d4b93a 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 _0xe017=['then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','VtigerAccount','include','findAll','rows','catch','show','params','find','create','body','findOne','VtigerConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0x1b34aa,_0x218c95){var _0x424c7c=function(_0x5d0206){while(--_0x5d0206){_0x1b34aa['push'](_0x1b34aa['shift']());}};_0x424c7c(++_0x218c95);}(_0xe017,0x1e0));var _0x7e01=function(_0x382671,_0x176b3c){_0x382671=_0x382671-0x0;var _0x50218b=_0xe017[_0x382671];return _0x50218b;};'use strict';var emlformat=require(_0x7e01('0x0'));var rimraf=require(_0x7e01('0x1'));var zipdir=require(_0x7e01('0x2'));var jsonpatch=require(_0x7e01('0x3'));var rp=require(_0x7e01('0x4'));var moment=require(_0x7e01('0x5'));var BPromise=require(_0x7e01('0x6'));var Mustache=require(_0x7e01('0x7'));var util=require(_0x7e01('0x8'));var path=require(_0x7e01('0x9'));var sox=require(_0x7e01('0xa'));var csv=require('to-csv');var ejs=require(_0x7e01('0xb'));var fs=require('fs');var fs_extra=require(_0x7e01('0xc'));var _=require(_0x7e01('0xd'));var squel=require(_0x7e01('0xe'));var crypto=require(_0x7e01('0xf'));var jsforce=require(_0x7e01('0x10'));var deskjs=require(_0x7e01('0x11'));var toCsv=require(_0x7e01('0x12'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e01('0x13'));var authService=require(_0x7e01('0x14'));var qs=require(_0x7e01('0x15'));var as=require(_0x7e01('0x16'));var hardwareService=require(_0x7e01('0x17'));var logger=require(_0x7e01('0x18'))(_0x7e01('0x19'));var utils=require(_0x7e01('0x1a'));var config=require(_0x7e01('0x1b'));var licenseUtil=require(_0x7e01('0x1c'));var db=require(_0x7e01('0x1d'))['db'];var integrations=require(_0x7e01('0x1e'));function respondWithStatusCode(_0x3a2381,_0x32fd50){_0x32fd50=_0x32fd50||0xcc;return function(_0x528d2a){if(_0x528d2a){return _0x3a2381[_0x7e01('0x1f')](_0x32fd50);}return _0x3a2381['status'](_0x32fd50)[_0x7e01('0x20')]();};}function respondWithResult(_0x15ba5a,_0x44d0ef){_0x44d0ef=_0x44d0ef||0xc8;return function(_0x1b90f1){if(_0x1b90f1){return _0x15ba5a[_0x7e01('0x21')](_0x44d0ef)[_0x7e01('0x22')](_0x1b90f1);}};}function respondWithFilteredResult(_0x10051f,_0x591f32){return function(_0x12be92){if(_0x12be92){var _0x11373e=typeof _0x591f32[_0x7e01('0x23')]===_0x7e01('0x24')&&typeof _0x591f32[_0x7e01('0x25')]==='undefined';var _0x308bdb=_0x12be92[_0x7e01('0x26')];var _0x5bb1af=_0x11373e?0x0:_0x591f32[_0x7e01('0x23')];var _0x407afe=_0x11373e?_0x12be92[_0x7e01('0x26')]:_0x591f32[_0x7e01('0x23')]+_0x591f32['limit'];var _0x44d5ba;if(_0x407afe>=_0x308bdb){_0x407afe=_0x308bdb;_0x44d5ba=0xc8;}else{_0x44d5ba=0xce;}_0x10051f[_0x7e01('0x21')](_0x44d5ba);return _0x10051f['set'](_0x7e01('0x27'),_0x5bb1af+'-'+_0x407afe+'/'+_0x308bdb)[_0x7e01('0x22')](_0x12be92);}return null;};}function patchUpdates(_0x1f1f11){return function(_0x24539f){try{jsonpatch[_0x7e01('0x28')](_0x24539f,_0x1f1f11,!![]);}catch(_0x1788e9){return BPromise[_0x7e01('0x29')](_0x1788e9);}return _0x24539f[_0x7e01('0x2a')]();};}function saveUpdates(_0x59a9d9,_0x276a3f){return function(_0x3df1d2){if(_0x3df1d2){return _0x3df1d2[_0x7e01('0x2b')](_0x59a9d9)[_0x7e01('0x2c')](function(_0x1988c8){return _0x1988c8;});}return null;};}function removeEntity(_0x15cfdc,_0x3d3b81){return function(_0x2ac439){if(_0x2ac439){return _0x2ac439[_0x7e01('0x2d')]()['then'](function(){_0x15cfdc[_0x7e01('0x21')](0xcc)[_0x7e01('0x20')]();});}};}function handleEntityNotFound(_0x557c79,_0x10ce60){return function(_0x4cd6d7){if(!_0x4cd6d7){_0x557c79[_0x7e01('0x1f')](0x194);}return _0x4cd6d7;};}function handleError(_0x25ef2e,_0x944676){_0x944676=_0x944676||0x1f4;return function(_0x179c1d){logger['error'](_0x179c1d[_0x7e01('0x2e')]);if(_0x179c1d[_0x7e01('0x2f')]){delete _0x179c1d[_0x7e01('0x2f')];}_0x25ef2e['status'](_0x944676)[_0x7e01('0x30')](_0x179c1d);};}exports[_0x7e01('0x31')]=function(_0x401856,_0x4854ea){var _0x846840={},_0x36e893={},_0x15bb6b={'count':0x0,'rows':[]};var _0x521dd8=_['map'](db['VtigerAccount'][_0x7e01('0x32')],function(_0x154ff9){return{'name':_0x154ff9[_0x7e01('0x33')],'type':_0x154ff9[_0x7e01('0x34')][_0x7e01('0x35')]};});_0x36e893[_0x7e01('0x36')]=_['map'](_0x521dd8,_0x7e01('0x2f'));_0x36e893[_0x7e01('0x37')]=_[_0x7e01('0x38')](_0x401856[_0x7e01('0x37')]);_0x36e893[_0x7e01('0x39')]=_[_0x7e01('0x3a')](_0x36e893['model'],_0x36e893['query']);_0x846840['attributes']=_['intersection'](_0x36e893[_0x7e01('0x36')],qs[_0x7e01('0x3b')](_0x401856[_0x7e01('0x37')]['fields']));_0x846840[_0x7e01('0x3c')]=_0x846840[_0x7e01('0x3c')][_0x7e01('0x3d')]?_0x846840[_0x7e01('0x3c')]:_0x36e893[_0x7e01('0x36')];if(!_0x401856['query'][_0x7e01('0x3e')](_0x7e01('0x3f'))){_0x846840['limit']=qs[_0x7e01('0x25')](_0x401856[_0x7e01('0x37')][_0x7e01('0x25')]);_0x846840[_0x7e01('0x23')]=qs[_0x7e01('0x23')](_0x401856[_0x7e01('0x37')][_0x7e01('0x23')]);}_0x846840[_0x7e01('0x40')]=qs[_0x7e01('0x41')](_0x401856[_0x7e01('0x37')][_0x7e01('0x41')]);_0x846840[_0x7e01('0x42')]=qs[_0x7e01('0x39')](_[_0x7e01('0x43')](_0x401856[_0x7e01('0x37')],_0x36e893[_0x7e01('0x39')]),_0x521dd8);if(_0x401856[_0x7e01('0x37')][_0x7e01('0x44')]){_0x846840[_0x7e01('0x42')]=_[_0x7e01('0x45')](_0x846840[_0x7e01('0x42')],{'$or':_[_0x7e01('0x46')](_0x521dd8,function(_0x52fc16){if(_0x52fc16[_0x7e01('0x34')]!==_0x7e01('0x47')){var _0x1dc083={};_0x1dc083[_0x52fc16[_0x7e01('0x2f')]]={'$like':'%'+_0x401856[_0x7e01('0x37')][_0x7e01('0x44')]+'%'};return _0x1dc083;}})});}_0x846840=_[_0x7e01('0x45')]({},_0x846840,_0x401856[_0x7e01('0x48')]);var _0x361899={'where':_0x846840['where']};return db[_0x7e01('0x49')]['count'](_0x361899)[_0x7e01('0x2c')](function(_0x43ef8b){_0x15bb6b[_0x7e01('0x26')]=_0x43ef8b;if(_0x401856[_0x7e01('0x37')]['includeAll']){_0x846840[_0x7e01('0x4a')]=[{'all':!![]}];}return db[_0x7e01('0x49')][_0x7e01('0x4b')](_0x846840);})[_0x7e01('0x2c')](function(_0x5ecf65){_0x15bb6b[_0x7e01('0x4c')]=_0x5ecf65;return _0x15bb6b;})[_0x7e01('0x2c')](respondWithFilteredResult(_0x4854ea,_0x846840))[_0x7e01('0x4d')](handleError(_0x4854ea,null));};exports[_0x7e01('0x4e')]=function(_0x14cfb8,_0x1bfb64){var _0x4ce258={'raw':![],'where':{'id':_0x14cfb8[_0x7e01('0x4f')]['id']}},_0x4e7cc3={};_0x4e7cc3[_0x7e01('0x36')]=_['keys'](db[_0x7e01('0x49')]['rawAttributes']);_0x4e7cc3[_0x7e01('0x37')]=_[_0x7e01('0x38')](_0x14cfb8[_0x7e01('0x37')]);_0x4e7cc3[_0x7e01('0x39')]=_[_0x7e01('0x3a')](_0x4e7cc3[_0x7e01('0x36')],_0x4e7cc3['query']);_0x4ce258['attributes']=_[_0x7e01('0x3a')](_0x4e7cc3[_0x7e01('0x36')],qs['fields'](_0x14cfb8['query'][_0x7e01('0x3b')]));_0x4ce258[_0x7e01('0x3c')]=_0x4ce258['attributes'][_0x7e01('0x3d')]?_0x4ce258[_0x7e01('0x3c')]:_0x4e7cc3[_0x7e01('0x36')];if(_0x14cfb8[_0x7e01('0x37')]['includeAll']){_0x4ce258[_0x7e01('0x4a')]=[{'all':!![]}];}_0x4ce258=_[_0x7e01('0x45')]({},_0x4ce258,_0x14cfb8[_0x7e01('0x48')]);return db[_0x7e01('0x49')][_0x7e01('0x50')](_0x4ce258)[_0x7e01('0x2c')](handleEntityNotFound(_0x1bfb64,null))['then'](respondWithResult(_0x1bfb64,null))[_0x7e01('0x4d')](handleError(_0x1bfb64,null));};exports[_0x7e01('0x51')]=function(_0x2c722b,_0x105b81){return db[_0x7e01('0x49')][_0x7e01('0x51')](_0x2c722b[_0x7e01('0x52')],{})['then'](respondWithResult(_0x105b81,0xc9))[_0x7e01('0x4d')](handleError(_0x105b81,null));};exports[_0x7e01('0x2b')]=function(_0x3c4064,_0x487ef5){if(_0x3c4064[_0x7e01('0x52')]['id']){delete _0x3c4064[_0x7e01('0x52')]['id'];}return db[_0x7e01('0x49')][_0x7e01('0x50')]({'where':{'id':_0x3c4064[_0x7e01('0x4f')]['id']}})[_0x7e01('0x2c')](handleEntityNotFound(_0x487ef5,null))[_0x7e01('0x2c')](saveUpdates(_0x3c4064[_0x7e01('0x52')],null))[_0x7e01('0x2c')](respondWithResult(_0x487ef5,null))['catch'](handleError(_0x487ef5,null));};exports[_0x7e01('0x2d')]=function(_0x3828ec,_0x419553){return db[_0x7e01('0x49')][_0x7e01('0x50')]({'where':{'id':_0x3828ec[_0x7e01('0x4f')]['id']}})[_0x7e01('0x2c')](handleEntityNotFound(_0x419553,null))[_0x7e01('0x2c')](removeEntity(_0x419553,null))[_0x7e01('0x4d')](handleError(_0x419553,null));};exports['getConfigurations']=function(_0x184a75,_0x3839ff,_0x1aaee5){var _0x4244d2={};var _0x2d0c5f={};var _0x41ff74;var _0x36459a;return db[_0x7e01('0x49')][_0x7e01('0x53')]({'where':{'id':_0x184a75[_0x7e01('0x4f')]['id']}})[_0x7e01('0x2c')](handleEntityNotFound(_0x3839ff,null))[_0x7e01('0x2c')](function(_0x519b13){if(_0x519b13){_0x41ff74=_0x519b13;_0x2d0c5f['model']=_[_0x7e01('0x38')](db[_0x7e01('0x54')][_0x7e01('0x32')]);_0x2d0c5f['query']=_[_0x7e01('0x38')](_0x184a75[_0x7e01('0x37')]);_0x2d0c5f['filters']=_[_0x7e01('0x3a')](_0x2d0c5f[_0x7e01('0x36')],_0x2d0c5f[_0x7e01('0x37')]);_0x4244d2[_0x7e01('0x3c')]=_[_0x7e01('0x3a')](_0x2d0c5f['model'],qs['fields'](_0x184a75[_0x7e01('0x37')][_0x7e01('0x3b')]));_0x4244d2['attributes']=_0x4244d2['attributes'][_0x7e01('0x3d')]?_0x4244d2[_0x7e01('0x3c')]:_0x2d0c5f[_0x7e01('0x36')];_0x4244d2['order']=qs[_0x7e01('0x41')](_0x184a75[_0x7e01('0x37')][_0x7e01('0x41')]);_0x4244d2['where']=qs[_0x7e01('0x39')](_['pick'](_0x184a75[_0x7e01('0x37')],_0x2d0c5f[_0x7e01('0x39')]));if(_0x184a75['query'][_0x7e01('0x44')]){_0x4244d2[_0x7e01('0x42')]=_[_0x7e01('0x45')](_0x4244d2[_0x7e01('0x42')],{'$or':_['map'](_0x4244d2[_0x7e01('0x3c')],function(_0x21f36f){var _0xf70a4c={};_0xf70a4c[_0x21f36f]={'$like':'%'+_0x184a75[_0x7e01('0x37')][_0x7e01('0x44')]+'%'};return _0xf70a4c;})});}_0x4244d2=_[_0x7e01('0x45')]({},_0x4244d2,_0x184a75[_0x7e01('0x48')]);return _0x41ff74[_0x7e01('0x55')](_0x4244d2);}})[_0x7e01('0x2c')](function(_0x5236e9){if(_0x5236e9){_0x36459a=_0x5236e9['length'];if(!_0x184a75[_0x7e01('0x37')]['hasOwnProperty'](_0x7e01('0x3f'))){_0x4244d2['limit']=qs['limit'](_0x184a75[_0x7e01('0x37')][_0x7e01('0x25')]);_0x4244d2['offset']=qs[_0x7e01('0x23')](_0x184a75[_0x7e01('0x37')]['offset']);}return _0x41ff74['getConfigurations'](_0x4244d2);}})[_0x7e01('0x2c')](function(_0xca89d8){if(_0xca89d8){return _0xca89d8?{'count':_0x36459a,'rows':_0xca89d8}:null;}})[_0x7e01('0x2c')](respondWithResult(_0x3839ff,null))[_0x7e01('0x4d')](handleError(_0x3839ff,null));};exports['addConfiguration']=function(_0xc4645b,_0xab19f6,_0xebb066){if(_0xc4645b['body']['id']){delete _0xc4645b[_0x7e01('0x52')]['id'];}return db['VtigerAccount'][_0x7e01('0x53')]({'where':{'id':_0xc4645b['params']['id']}})[_0x7e01('0x2c')](handleEntityNotFound(_0xab19f6,null))[_0x7e01('0x2c')](function(_0x56f652){if(_0x56f652){_0xc4645b[_0x7e01('0x52')][_0x7e01('0x56')]=_0x56f652['id'];_0xc4645b['body'][_0x7e01('0x57')]=integrations[_0x7e01('0x58')](_0xc4645b['body'][_0x7e01('0x59')],_0xc4645b[_0x7e01('0x52')][_0x7e01('0x34')]);_0xc4645b[_0x7e01('0x52')][_0x7e01('0x5a')]=integrations[_0x7e01('0x5b')](_0xc4645b['body']['channel'],_0xc4645b[_0x7e01('0x52')][_0x7e01('0x34')]);return db['VtigerConfiguration']['create'](_0xc4645b['body'],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x7e01('0x5c')],'as':_0x7e01('0x5a')}]});}return null;})[_0x7e01('0x2c')](respondWithResult(_0xab19f6,null))[_0x7e01('0x4d')](handleError(_0xab19f6,null));};var md5=require(_0x7e01('0x5d'));exports[_0x7e01('0x5e')]=function(_0x30ee21,_0x9b1e57,_0x5ec246){var _0x521567=null;var _0x472674=null;var _0x2edbfe=null;var _0x577ce7=null;var _0x10232e='';return db[_0x7e01('0x49')]['findOne']({'where':{'id':_0x30ee21[_0x7e01('0x4f')]['id']},'attributes':['id','name',_0x7e01('0x5f'),_0x7e01('0x60'),_0x7e01('0x61'),_0x7e01('0x62'),_0x7e01('0x63'),_0x7e01('0x64')]})[_0x7e01('0x2c')](handleEntityNotFound(_0x9b1e57,null))[_0x7e01('0x2c')](function(_0x23a072){if(_0x23a072){_0x521567=_0x23a072['username'];_0x472674=_0x23a072[_0x7e01('0x64')];_0x2edbfe=_0x23a072[_0x7e01('0x61')];_0x10232e=_0x23a072['remoteUri'];var _0x3e736e=_0x10232e['slice'](-0x1);if(_0x3e736e==='/'){_0x10232e=_0x10232e[_0x7e01('0x65')](0x0,_0x10232e[_0x7e01('0x66')](_0x3e736e));}_0x577ce7=util[_0x7e01('0x67')](_0x7e01('0x68'),_0x10232e);var _0x27695f={'method':_0x7e01('0x69'),'uri':_0x577ce7,'qs':{'operation':_0x7e01('0x6a'),'username':_0x23a072['username']},'json':!![]};return rp(_0x27695f);}})[_0x7e01('0x2c')](function(_0x16d72b){if(_0x16d72b[_0x7e01('0x6b')]){var _0x488e6e={'method':_0x7e01('0x6c'),'uri':_0x577ce7,'form':{'operation':_0x7e01('0x6d'),'username':_0x521567,'accessKey':md5(_0x16d72b[_0x7e01('0x6e')][_0x7e01('0x6f')]+_0x472674)},'json':!![]};return rp(_0x488e6e);}})[_0x7e01('0x2c')](function(_0x30b6b8){if(_0x30b6b8[_0x7e01('0x6b')]){var _0x126eed={'method':_0x7e01('0x69'),'uri':_0x577ce7,'qs':{'operation':_0x7e01('0x70'),'username':_0x521567,'sessionName':_0x30b6b8[_0x7e01('0x6e')][_0x7e01('0x71')],'elementType':_0x2edbfe},'json':!![]};return rp(_0x126eed);}})[_0x7e01('0x2c')](function(_0x13226e){if(_0x13226e[_0x7e01('0x6b')]){var _0x2819e4=[_0x7e01('0x72'),_0x7e01('0x73'),_0x7e01('0x74')];_[_0x7e01('0x75')](_0x13226e[_0x7e01('0x6e')]['fields'],function(_0x101d92){return _0x2819e4[_0x7e01('0x76')](_0x101d92[_0x7e01('0x34')]['name']);});_[_0x7e01('0x75')](_0x13226e['result'][_0x7e01('0x3b')],function(_0x87bb15){return _0x87bb15[_0x7e01('0x77')]==='false';});return{'count':_0x13226e[_0x7e01('0x6e')]['fields'][_0x7e01('0x3d')],'rows':_['map'](_0x13226e['result'][_0x7e01('0x3b')],function(_0x11fae5){return{'id':_0x11fae5['name'],'name':_0x11fae5[_0x7e01('0x78')],'custom':_['startsWith'](_0x11fae5[_0x7e01('0x2f')],_0x7e01('0x79'))?!![]:![],'options':_0x11fae5[_0x7e01('0x34')][_0x7e01('0x2f')]===_0x7e01('0x7a')&&_0x11fae5['type'][_0x7e01('0x7b')][_0x7e01('0x3d')]>0x0?_[_0x7e01('0x46')](_0x11fae5[_0x7e01('0x34')][_0x7e01('0x7b')],function(_0x1f60eb){return{'name':_0x1f60eb[_0x7e01('0x78')],'value':_0x1f60eb[_0x7e01('0x7c')]};}):[]};})};}})[_0x7e01('0x2c')](respondWithResult(_0x9b1e57,null))[_0x7e01('0x4d')](function(_0x92b90b){console[_0x7e01('0x7d')](_0x7e01('0x7e')+_0x92b90b);var _0x1355a8=_0x30ee21[_0x7e01('0x37')][_0x7e01('0x7f')]?0x1f4:_0x92b90b['statusCode']||0x1f4;logger['error'](_0x7e01('0x80'),_0x7e01('0x5e'),_0x1355a8,JSON['stringify'](_0x92b90b));delete _0x92b90b['name'];if(_0x1355a8===0x191){_0x1355a8=0x190;}_0x9b1e57['status'](_0x1355a8)['send'](_0x30ee21[_0x7e01('0x37')][_0x7e01('0x7f')]?{'message':_0x7e01('0x81'),'statusCode':_0x92b90b[_0x7e01('0x82')]}:_0x92b90b);});}; \ No newline at end of file +var _0x8360=['Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','remoteUri','serverUrl','accessKey','moduleName','slice','%s/webservice.php','getchallenge','POST','login','result','token','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration'];(function(_0xfaee60,_0x14b852){var _0x58e2fc=function(_0x22b654){while(--_0x22b654){_0xfaee60['push'](_0xfaee60['shift']());}};_0x58e2fc(++_0x14b852);}(_0x8360,0x18e));var _0x0836=function(_0x51d516,_0x10a107){_0x51d516=_0x51d516-0x0;var _0x68f7a1=_0x8360[_0x51d516];return _0x68f7a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0836('0x0'));var zipdir=require(_0x0836('0x1'));var jsonpatch=require(_0x0836('0x2'));var rp=require(_0x0836('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0836('0x4'));var util=require('util');var path=require(_0x0836('0x5'));var sox=require(_0x0836('0x6'));var csv=require('to-csv');var ejs=require(_0x0836('0x7'));var fs=require('fs');var fs_extra=require(_0x0836('0x8'));var _=require(_0x0836('0x9'));var squel=require(_0x0836('0xa'));var crypto=require(_0x0836('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0836('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0836('0xd'));var Papa=require('papaparse');var Redis=require(_0x0836('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0836('0xf'));var as=require(_0x0836('0x10'));var hardwareService=require(_0x0836('0x11'));var logger=require(_0x0836('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0836('0x13'));var db=require(_0x0836('0x14'))['db'];var integrations=require(_0x0836('0x15'));function respondWithStatusCode(_0x51784d,_0x48d8ee){_0x48d8ee=_0x48d8ee||0xcc;return function(_0x23e0ba){if(_0x23e0ba){return _0x51784d[_0x0836('0x16')](_0x48d8ee);}return _0x51784d['status'](_0x48d8ee)[_0x0836('0x17')]();};}function respondWithResult(_0x246166,_0x465725){_0x465725=_0x465725||0xc8;return function(_0x463dd9){if(_0x463dd9){return _0x246166[_0x0836('0x18')](_0x465725)[_0x0836('0x19')](_0x463dd9);}};}function respondWithFilteredResult(_0x256a90,_0xcc7d26){return function(_0x2449c0){if(_0x2449c0){var _0xaff509=typeof _0xcc7d26[_0x0836('0x1a')]===_0x0836('0x1b')&&typeof _0xcc7d26['limit']==='undefined';var _0x4df54d=_0x2449c0[_0x0836('0x1c')];var _0x25b9ac=_0xaff509?0x0:_0xcc7d26['offset'];var _0x397e5b=_0xaff509?_0x2449c0[_0x0836('0x1c')]:_0xcc7d26[_0x0836('0x1a')]+_0xcc7d26[_0x0836('0x1d')];var _0x5454c7;if(_0x397e5b>=_0x4df54d){_0x397e5b=_0x4df54d;_0x5454c7=0xc8;}else{_0x5454c7=0xce;}_0x256a90[_0x0836('0x18')](_0x5454c7);return _0x256a90[_0x0836('0x1e')](_0x0836('0x1f'),_0x25b9ac+'-'+_0x397e5b+'/'+_0x4df54d)[_0x0836('0x19')](_0x2449c0);}return null;};}function patchUpdates(_0x9ac94a){return function(_0x2ff71c){try{jsonpatch['apply'](_0x2ff71c,_0x9ac94a,!![]);}catch(_0x348728){return BPromise[_0x0836('0x20')](_0x348728);}return _0x2ff71c[_0x0836('0x21')]();};}function saveUpdates(_0x5e2f8f,_0x179fe4){return function(_0x2d6adf){if(_0x2d6adf){return _0x2d6adf[_0x0836('0x22')](_0x5e2f8f)[_0x0836('0x23')](function(_0x170fe8){return _0x170fe8;});}return null;};}function removeEntity(_0xebf6f0,_0x37c9d7){return function(_0x22e875){if(_0x22e875){return _0x22e875[_0x0836('0x24')]()[_0x0836('0x23')](function(){_0xebf6f0[_0x0836('0x18')](0xcc)[_0x0836('0x17')]();});}};}function handleEntityNotFound(_0x109a00,_0x64e58b){return function(_0x44cf3d){if(!_0x44cf3d){_0x109a00[_0x0836('0x16')](0x194);}return _0x44cf3d;};}function handleError(_0x596e7a,_0x6bd872){_0x6bd872=_0x6bd872||0x1f4;return function(_0x53364e){logger['error'](_0x53364e[_0x0836('0x25')]);if(_0x53364e[_0x0836('0x26')]){delete _0x53364e[_0x0836('0x26')];}_0x596e7a[_0x0836('0x18')](_0x6bd872)[_0x0836('0x27')](_0x53364e);};}exports[_0x0836('0x28')]=function(_0x4248c4,_0x3ea3be){var _0x1a2cf3={},_0x5265a5={},_0x17d1b3={'count':0x0,'rows':[]};var _0x123394=_[_0x0836('0x29')](db[_0x0836('0x2a')][_0x0836('0x2b')],function(_0x720d57){return{'name':_0x720d57[_0x0836('0x2c')],'type':_0x720d57[_0x0836('0x2d')][_0x0836('0x2e')]};});_0x5265a5[_0x0836('0x2f')]=_['map'](_0x123394,_0x0836('0x26'));_0x5265a5[_0x0836('0x30')]=_[_0x0836('0x31')](_0x4248c4[_0x0836('0x30')]);_0x5265a5[_0x0836('0x32')]=_['intersection'](_0x5265a5[_0x0836('0x2f')],_0x5265a5['query']);_0x1a2cf3[_0x0836('0x33')]=_[_0x0836('0x34')](_0x5265a5['model'],qs[_0x0836('0x35')](_0x4248c4['query'][_0x0836('0x35')]));_0x1a2cf3[_0x0836('0x33')]=_0x1a2cf3['attributes'][_0x0836('0x36')]?_0x1a2cf3[_0x0836('0x33')]:_0x5265a5[_0x0836('0x2f')];if(!_0x4248c4[_0x0836('0x30')]['hasOwnProperty'](_0x0836('0x37'))){_0x1a2cf3[_0x0836('0x1d')]=qs[_0x0836('0x1d')](_0x4248c4[_0x0836('0x30')]['limit']);_0x1a2cf3[_0x0836('0x1a')]=qs[_0x0836('0x1a')](_0x4248c4[_0x0836('0x30')][_0x0836('0x1a')]);}_0x1a2cf3[_0x0836('0x38')]=qs[_0x0836('0x39')](_0x4248c4[_0x0836('0x30')]['sort']);_0x1a2cf3['where']=qs[_0x0836('0x32')](_[_0x0836('0x3a')](_0x4248c4[_0x0836('0x30')],_0x5265a5['filters']),_0x123394);if(_0x4248c4['query'][_0x0836('0x3b')]){_0x1a2cf3['where']=_[_0x0836('0x3c')](_0x1a2cf3[_0x0836('0x3d')],{'$or':_[_0x0836('0x29')](_0x123394,function(_0x3bad41){if(_0x3bad41[_0x0836('0x2d')]!==_0x0836('0x3e')){var _0x1e6844={};_0x1e6844[_0x3bad41[_0x0836('0x26')]]={'$like':'%'+_0x4248c4[_0x0836('0x30')]['filter']+'%'};return _0x1e6844;}})});}_0x1a2cf3=_[_0x0836('0x3c')]({},_0x1a2cf3,_0x4248c4[_0x0836('0x3f')]);var _0x546b50={'where':_0x1a2cf3[_0x0836('0x3d')]};return db[_0x0836('0x2a')][_0x0836('0x1c')](_0x546b50)['then'](function(_0x1ec3d5){_0x17d1b3[_0x0836('0x1c')]=_0x1ec3d5;if(_0x4248c4[_0x0836('0x30')][_0x0836('0x40')]){_0x1a2cf3[_0x0836('0x41')]=[{'all':!![]}];}return db[_0x0836('0x2a')]['findAll'](_0x1a2cf3);})['then'](function(_0x296e44){_0x17d1b3[_0x0836('0x42')]=_0x296e44;return _0x17d1b3;})['then'](respondWithFilteredResult(_0x3ea3be,_0x1a2cf3))[_0x0836('0x43')](handleError(_0x3ea3be,null));};exports[_0x0836('0x44')]=function(_0x5023f5,_0x377874){var _0x3525f1={'raw':![],'where':{'id':_0x5023f5[_0x0836('0x45')]['id']}},_0x3a9b72={};_0x3a9b72['model']=_[_0x0836('0x31')](db[_0x0836('0x2a')][_0x0836('0x2b')]);_0x3a9b72['query']=_['keys'](_0x5023f5[_0x0836('0x30')]);_0x3a9b72[_0x0836('0x32')]=_['intersection'](_0x3a9b72[_0x0836('0x2f')],_0x3a9b72['query']);_0x3525f1[_0x0836('0x33')]=_[_0x0836('0x34')](_0x3a9b72[_0x0836('0x2f')],qs[_0x0836('0x35')](_0x5023f5[_0x0836('0x30')][_0x0836('0x35')]));_0x3525f1['attributes']=_0x3525f1['attributes'][_0x0836('0x36')]?_0x3525f1[_0x0836('0x33')]:_0x3a9b72[_0x0836('0x2f')];if(_0x5023f5['query']['includeAll']){_0x3525f1[_0x0836('0x41')]=[{'all':!![]}];}_0x3525f1=_['merge']({},_0x3525f1,_0x5023f5[_0x0836('0x3f')]);return db[_0x0836('0x2a')]['find'](_0x3525f1)[_0x0836('0x23')](handleEntityNotFound(_0x377874,null))['then'](respondWithResult(_0x377874,null))[_0x0836('0x43')](handleError(_0x377874,null));};exports[_0x0836('0x46')]=function(_0x2a54b7,_0x32456e){return db[_0x0836('0x2a')]['create'](_0x2a54b7[_0x0836('0x47')],{})[_0x0836('0x23')](respondWithResult(_0x32456e,0xc9))['catch'](handleError(_0x32456e,null));};exports[_0x0836('0x22')]=function(_0x3cd738,_0x8217a){if(_0x3cd738[_0x0836('0x47')]['id']){delete _0x3cd738[_0x0836('0x47')]['id'];}return db['VtigerAccount'][_0x0836('0x48')]({'where':{'id':_0x3cd738[_0x0836('0x45')]['id']}})['then'](handleEntityNotFound(_0x8217a,null))[_0x0836('0x23')](saveUpdates(_0x3cd738[_0x0836('0x47')],null))['then'](respondWithResult(_0x8217a,null))[_0x0836('0x43')](handleError(_0x8217a,null));};exports[_0x0836('0x24')]=function(_0x14ce9b,_0x4a1663){return db['VtigerAccount']['find']({'where':{'id':_0x14ce9b[_0x0836('0x45')]['id']}})[_0x0836('0x23')](handleEntityNotFound(_0x4a1663,null))[_0x0836('0x23')](removeEntity(_0x4a1663,null))['catch'](handleError(_0x4a1663,null));};exports[_0x0836('0x49')]=function(_0x57adc9,_0x2b896c,_0xb33289){var _0x4f8d02={};var _0x223c6c={};var _0xbad3f3;var _0x4bd9d0;return db[_0x0836('0x2a')][_0x0836('0x4a')]({'where':{'id':_0x57adc9[_0x0836('0x45')]['id']}})[_0x0836('0x23')](handleEntityNotFound(_0x2b896c,null))['then'](function(_0x1ee361){if(_0x1ee361){_0xbad3f3=_0x1ee361;_0x223c6c[_0x0836('0x2f')]=_[_0x0836('0x31')](db[_0x0836('0x4b')][_0x0836('0x2b')]);_0x223c6c[_0x0836('0x30')]=_[_0x0836('0x31')](_0x57adc9[_0x0836('0x30')]);_0x223c6c['filters']=_[_0x0836('0x34')](_0x223c6c['model'],_0x223c6c[_0x0836('0x30')]);_0x4f8d02['attributes']=_[_0x0836('0x34')](_0x223c6c[_0x0836('0x2f')],qs[_0x0836('0x35')](_0x57adc9['query'][_0x0836('0x35')]));_0x4f8d02[_0x0836('0x33')]=_0x4f8d02[_0x0836('0x33')][_0x0836('0x36')]?_0x4f8d02[_0x0836('0x33')]:_0x223c6c[_0x0836('0x2f')];_0x4f8d02[_0x0836('0x38')]=qs[_0x0836('0x39')](_0x57adc9[_0x0836('0x30')][_0x0836('0x39')]);_0x4f8d02[_0x0836('0x3d')]=qs[_0x0836('0x32')](_[_0x0836('0x3a')](_0x57adc9[_0x0836('0x30')],_0x223c6c['filters']));if(_0x57adc9['query']['filter']){_0x4f8d02[_0x0836('0x3d')]=_[_0x0836('0x3c')](_0x4f8d02[_0x0836('0x3d')],{'$or':_['map'](_0x4f8d02['attributes'],function(_0x31a5ff){var _0x4894bb={};_0x4894bb[_0x31a5ff]={'$like':'%'+_0x57adc9[_0x0836('0x30')][_0x0836('0x3b')]+'%'};return _0x4894bb;})});}_0x4f8d02=_[_0x0836('0x3c')]({},_0x4f8d02,_0x57adc9['options']);return _0xbad3f3[_0x0836('0x49')](_0x4f8d02);}})[_0x0836('0x23')](function(_0x6fe5a6){if(_0x6fe5a6){_0x4bd9d0=_0x6fe5a6[_0x0836('0x36')];if(!_0x57adc9[_0x0836('0x30')][_0x0836('0x4c')](_0x0836('0x37'))){_0x4f8d02['limit']=qs[_0x0836('0x1d')](_0x57adc9['query'][_0x0836('0x1d')]);_0x4f8d02[_0x0836('0x1a')]=qs[_0x0836('0x1a')](_0x57adc9[_0x0836('0x30')][_0x0836('0x1a')]);}return _0xbad3f3[_0x0836('0x49')](_0x4f8d02);}})['then'](function(_0x5839d9){if(_0x5839d9){return _0x5839d9?{'count':_0x4bd9d0,'rows':_0x5839d9}:null;}})['then'](respondWithResult(_0x2b896c,null))['catch'](handleError(_0x2b896c,null));};exports[_0x0836('0x4d')]=function(_0x1aeb45,_0x456b1d,_0xcafa6b){if(_0x1aeb45['body']['id']){delete _0x1aeb45[_0x0836('0x47')]['id'];}return db[_0x0836('0x2a')][_0x0836('0x4a')]({'where':{'id':_0x1aeb45[_0x0836('0x45')]['id']}})['then'](handleEntityNotFound(_0x456b1d,null))[_0x0836('0x23')](function(_0x257297){if(_0x257297){_0x1aeb45[_0x0836('0x47')]['AccountId']=_0x257297['id'];_0x1aeb45[_0x0836('0x47')][_0x0836('0x4e')]=integrations[_0x0836('0x4f')](_0x1aeb45[_0x0836('0x47')][_0x0836('0x50')],_0x1aeb45[_0x0836('0x47')][_0x0836('0x2d')]);_0x1aeb45[_0x0836('0x47')][_0x0836('0x51')]=integrations[_0x0836('0x52')](_0x1aeb45['body'][_0x0836('0x50')],_0x1aeb45[_0x0836('0x47')][_0x0836('0x2d')]);return db['VtigerConfiguration']['create'](_0x1aeb45['body'],{'include':[{'model':db[_0x0836('0x53')],'as':_0x0836('0x4e')},{'model':db['VtigerField'],'as':_0x0836('0x51')}]});}return null;})[_0x0836('0x23')](respondWithResult(_0x456b1d,null))['catch'](handleError(_0x456b1d,null));};var md5=require(_0x0836('0x54'));exports[_0x0836('0x55')]=function(_0x36418b,_0x3b8ba4,_0x3d3e8d){var _0x5aff30=null;var _0x55332f=null;var _0x2fd83d=null;var _0x5e0a32=null;var _0x5e5196='';return db['VtigerAccount']['findOne']({'where':{'id':_0x36418b['params']['id']},'attributes':['id',_0x0836('0x26'),_0x0836('0x56'),'description','moduleName',_0x0836('0x57'),_0x0836('0x58'),_0x0836('0x59')]})[_0x0836('0x23')](handleEntityNotFound(_0x3b8ba4,null))[_0x0836('0x23')](function(_0x449cff){if(_0x449cff){_0x5aff30=_0x449cff[_0x0836('0x56')];_0x55332f=_0x449cff[_0x0836('0x59')];_0x2fd83d=_0x449cff[_0x0836('0x5a')];_0x5e5196=_0x449cff[_0x0836('0x57')];var _0xd94e6c=_0x5e5196[_0x0836('0x5b')](-0x1);if(_0xd94e6c==='/'){_0x5e5196=_0x5e5196['substring'](0x0,_0x5e5196['lastIndexOf'](_0xd94e6c));}_0x5e0a32=util['format'](_0x0836('0x5c'),_0x5e5196);var _0x81c390={'method':'GET','uri':_0x5e0a32,'qs':{'operation':_0x0836('0x5d'),'username':_0x449cff[_0x0836('0x56')]},'json':!![]};return rp(_0x81c390);}})['then'](function(_0x4fcd47){if(_0x4fcd47['success']){var _0x33cd0b={'method':_0x0836('0x5e'),'uri':_0x5e0a32,'form':{'operation':_0x0836('0x5f'),'username':_0x5aff30,'accessKey':md5(_0x4fcd47[_0x0836('0x60')][_0x0836('0x61')]+_0x55332f)},'json':!![]};return rp(_0x33cd0b);}})[_0x0836('0x23')](function(_0x4c197d){if(_0x4c197d[_0x0836('0x62')]){var _0x12f973={'method':'GET','uri':_0x5e0a32,'qs':{'operation':_0x0836('0x63'),'username':_0x5aff30,'sessionName':_0x4c197d['result'][_0x0836('0x64')],'elementType':_0x2fd83d},'json':!![]};return rp(_0x12f973);}})[_0x0836('0x23')](function(_0x3ca43d){if(_0x3ca43d[_0x0836('0x62')]){var _0x4f0d40=[_0x0836('0x65'),_0x0836('0x66'),_0x0836('0x67')];_[_0x0836('0x68')](_0x3ca43d[_0x0836('0x60')]['fields'],function(_0x34a5b3){return _0x4f0d40[_0x0836('0x69')](_0x34a5b3[_0x0836('0x2d')]['name']);});_[_0x0836('0x68')](_0x3ca43d[_0x0836('0x60')]['fields'],function(_0x4d9497){return _0x4d9497[_0x0836('0x6a')]===_0x0836('0x6b');});return{'count':_0x3ca43d['result']['fields'][_0x0836('0x36')],'rows':_['map'](_0x3ca43d[_0x0836('0x60')][_0x0836('0x35')],function(_0x38c51c){return{'id':_0x38c51c[_0x0836('0x26')],'name':_0x38c51c[_0x0836('0x6c')],'custom':_['startsWith'](_0x38c51c[_0x0836('0x26')],_0x0836('0x6d'))?!![]:![],'options':_0x38c51c['type']['name']===_0x0836('0x6e')&&_0x38c51c[_0x0836('0x2d')][_0x0836('0x6f')]['length']>0x0?_[_0x0836('0x29')](_0x38c51c[_0x0836('0x2d')][_0x0836('0x6f')],function(_0x38940e){return{'name':_0x38940e[_0x0836('0x6c')],'value':_0x38940e[_0x0836('0x70')]};}):[]};})};}})[_0x0836('0x23')](respondWithResult(_0x3b8ba4,null))[_0x0836('0x43')](function(_0x3875ae){console[_0x0836('0x71')](_0x0836('0x72')+_0x3875ae);var _0x46e465=_0x36418b[_0x0836('0x30')]['test']?0x1f4:_0x3875ae[_0x0836('0x73')]||0x1f4;logger['error'](_0x0836('0x74'),_0x0836('0x55'),_0x46e465,JSON[_0x0836('0x75')](_0x3875ae));delete _0x3875ae[_0x0836('0x26')];if(_0x46e465===0x191){_0x46e465=0x190;}_0x3b8ba4[_0x0836('0x18')](_0x46e465)['send'](_0x36418b[_0x0836('0x30')][_0x0836('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x3875ae[_0x0836('0x73')]}:_0x3875ae);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6d0fd2d..c32b56b 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 _0x3755=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount'];(function(_0x385814,_0x21c0cb){var _0x188862=function(_0x1f6fe1){while(--_0x1f6fe1){_0x385814['push'](_0x385814['shift']());}};_0x188862(++_0x21c0cb);}(_0x3755,0x1bb));var _0x5375=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3755[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5375('0x0'));var util=require(_0x5375('0x1'));var logger=require(_0x5375('0x2'))(_0x5375('0x3'));var moment=require('moment');var BPromise=require(_0x5375('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5375('0x5'));var rimraf=require(_0x5375('0x6'));var config=require(_0x5375('0x7'));var attributes=require(_0x5375('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x5375('0x9')]=function(_0x97e569,_0x343094){return _0x97e569[_0x5375('0xa')](_0x5375('0xb'),attributes,{'tableName':_0x5375('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa482=['VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xf382e5,_0x4c8690){var _0x3272b6=function(_0x42a6d2){while(--_0x42a6d2){_0xf382e5['push'](_0xf382e5['shift']());}};_0x3272b6(++_0x4c8690);}(_0xa482,0x154));var _0x2a48=function(_0x3fbe6d,_0x5d6353){_0x3fbe6d=_0x3fbe6d-0x0;var _0x33e0eb=_0xa482[_0x3fbe6d];return _0x33e0eb;};'use strict';var _=require(_0x2a48('0x0'));var util=require('util');var logger=require(_0x2a48('0x1'))(_0x2a48('0x2'));var moment=require('moment');var BPromise=require(_0x2a48('0x3'));var rp=require(_0x2a48('0x4'));var fs=require('fs');var path=require(_0x2a48('0x5'));var rimraf=require(_0x2a48('0x6'));var config=require(_0x2a48('0x7'));var attributes=require(_0x2a48('0x8'));var integrations=require(_0x2a48('0x9'));module[_0x2a48('0xa')]=function(_0x5e6264,_0x1fe50a){return _0x5e6264['define'](_0x2a48('0xb'),attributes,{'tableName':_0x2a48('0xc'),'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 d013a17..d064e6c 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 _0xf4eb=['VtigerAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowVtigerAccount','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVtigerAccount'];(function(_0x24c09a,_0x416174){var _0x28fdf5=function(_0x2a844d){while(--_0x2a844d){_0x24c09a['push'](_0x24c09a['shift']());}};_0x28fdf5(++_0x416174);}(_0xf4eb,0xec));var _0xbf4e=function(_0x282a3d,_0x5516df){_0x282a3d=_0x282a3d-0x0;var _0x2e3d12=_0xf4eb[_0x282a3d];return _0x2e3d12;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')]({'raw':_0x577c27[_0xbf4e('0x16')]?_0x577c27['options']['raw']===undefined?!![]:![]:!![],'where':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x18')]||null:null,'limit':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x19')]||null:null,'include':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')]['include']?_[_0xbf4e('0x1a')](_0x577c27[_0xbf4e('0x16')]['include'],function(_0x31e3f5){return{'model':db[_0x31e3f5[_0xbf4e('0x1b')]],'as':_0x31e3f5['as'],'attributes':_0x31e3f5[_0xbf4e('0x18')],'include':_0x31e3f5[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x31e3f5['include'],function(_0x90635e){return{'model':db[_0x90635e[_0xbf4e('0x1b')]],'as':_0x90635e['as'],'attributes':_0x90635e[_0xbf4e('0x18')],'include':_0x90635e['include']?_[_0xbf4e('0x1a')](_0x90635e['include'],function(_0x5bcf71){return{'model':db[_0x5bcf71[_0xbf4e('0x1b')]],'as':_0x5bcf71['as'],'attributes':_0x5bcf71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4e('0x9')](function(_0x315df3){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger['debug'](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x315df3));_0x566ec3(_0x315df3);})[_0xbf4e('0x12')](function(_0x4cd4a1){logger[_0xbf4e('0xf')]('GetVtigerAccount',_0x4cd4a1[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x4cd4a1[_0xbf4e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x1d12e2){var _0x362716=this;return new Promise(function(_0x2f3cf8,_0xc7ca87){return db[_0xbf4e('0x14')][_0xbf4e('0x1d')]({'raw':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')]['attributes']||null:null,'include':_0x1d12e2[_0xbf4e('0x16')]?_0x1d12e2['options'][_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x1d12e2[_0xbf4e('0x16')]['include'],function(_0x2716b7){return{'model':db[_0x2716b7[_0xbf4e('0x1b')]],'as':_0x2716b7['as'],'attributes':_0x2716b7[_0xbf4e('0x18')],'include':_0x2716b7[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x2716b7[_0xbf4e('0x1c')],function(_0x5b8440){return{'model':db[_0x5b8440[_0xbf4e('0x1b')]],'as':_0x5b8440['as'],'attributes':_0x5b8440[_0xbf4e('0x18')],'include':_0x5b8440[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x5b8440[_0xbf4e('0x1c')],function(_0x5b7ea1){return{'model':db[_0x5b7ea1['model']],'as':_0x5b7ea1['as'],'attributes':_0x5b7ea1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x429c07){logger[_0xbf4e('0xa')](_0xbf4e('0x1f'),_0x1d12e2);logger[_0xbf4e('0xd')](_0xbf4e('0x1f'),_0x1d12e2,JSON[_0xbf4e('0xe')](_0x429c07));_0x2f3cf8(_0x429c07);})[_0xbf4e('0x12')](function(_0x467b74){logger[_0xbf4e('0xf')]('ShowVtigerAccount',_0x467b74['message'],_0x1d12e2);_0xc7ca87(_0x362716[_0xbf4e('0xf')](0x1f4,_0x467b74[_0xbf4e('0x11')]));});});}; \ No newline at end of file +var _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0x1f23a8,_0x329269){var _0x34a265=function(_0xcf7bfa){while(--_0xcf7bfa){_0x1f23a8['push'](_0x1f23a8['shift']());}};_0x34a265(++_0x329269);}(_0xefda,0x96));var _0xaefd=function(_0x220902,_0x421928){_0x220902=_0x220902-0x0;var _0x5e7f1b=_0xefda[_0x220902];return _0x5e7f1b;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 38aa10a..6999d86 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 _0xf7a5=['show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4b5375,_0x4aa25f){var _0x58b94c=function(_0x5547c2){while(--_0x5547c2){_0x4b5375['push'](_0x4b5375['shift']());}};_0x58b94c(++_0x4aa25f);}(_0xf7a5,0xe6));var _0x5f7a=function(_0xb87d55,_0x578ce1){_0xb87d55=_0xb87d55-0x0;var _0x1c31c8=_0xf7a5[_0xb87d55];return _0x1c31c8;};'use strict';var multer=require('multer');var util=require(_0x5f7a('0x0'));var path=require('path');var timeout=require(_0x5f7a('0x1'));var express=require(_0x5f7a('0x2'));var router=express[_0x5f7a('0x3')]();var fs_extra=require(_0x5f7a('0x4'));var auth=require(_0x5f7a('0x5'));var interaction=require(_0x5f7a('0x6'));var config=require(_0x5f7a('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x5f7a('0x8')]('/',auth[_0x5f7a('0x9')](),controller[_0x5f7a('0xa')]);router[_0x5f7a('0x8')](_0x5f7a('0xb'),auth[_0x5f7a('0x9')](),controller[_0x5f7a('0xc')]);router[_0x5f7a('0x8')](_0x5f7a('0xd'),auth[_0x5f7a('0x9')](),controller['getFields']);router['get'](_0x5f7a('0xe'),auth[_0x5f7a('0x9')](),controller[_0x5f7a('0xf')]);router[_0x5f7a('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5f7a('0x10')]);router[_0x5f7a('0x11')]('/',auth['isAuthenticated'](),controller[_0x5f7a('0x12')]);router[_0x5f7a('0x13')](_0x5f7a('0xb'),auth[_0x5f7a('0x9')](),controller[_0x5f7a('0x14')]);router[_0x5f7a('0x15')](_0x5f7a('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaacd=['isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34cc91,_0x2128e9){var _0x524dd6=function(_0x46eff7){while(--_0x46eff7){_0x34cc91['push'](_0x34cc91['shift']());}};_0x524dd6(++_0x2128e9);}(_0xaacd,0x172));var _0xdaac=function(_0x3a6f68,_0xc8e6c9){_0x3a6f68=_0x3a6f68-0x0;var _0x21a1ad=_0xaacd[_0x3a6f68];return _0x21a1ad;};'use strict';var multer=require(_0xdaac('0x0'));var util=require(_0xdaac('0x1'));var path=require(_0xdaac('0x2'));var timeout=require(_0xdaac('0x3'));var express=require(_0xdaac('0x4'));var router=express[_0xdaac('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdaac('0x6'));var interaction=require(_0xdaac('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0xdaac('0x8')](),controller['index']);router[_0xdaac('0x9')](_0xdaac('0xa'),auth[_0xdaac('0x8')](),controller[_0xdaac('0xb')]);router[_0xdaac('0x9')](_0xdaac('0xc'),auth['isAuthenticated'](),controller[_0xdaac('0xd')]);router[_0xdaac('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xdaac('0x9')](_0xdaac('0xe'),auth['isAuthenticated'](),controller[_0xdaac('0xf')]);router[_0xdaac('0x10')]('/',auth[_0xdaac('0x8')](),controller[_0xdaac('0x11')]);router['put'](_0xdaac('0xa'),auth['isAuthenticated'](),controller[_0xdaac('0x12')]);router[_0xdaac('0x13')](_0xdaac('0xa'),auth[_0xdaac('0x8')](),controller[_0xdaac('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7cac86f..2a7fbca 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 _0xc07b=['STRING','sequelize'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc07b,0x187));var _0xbc07=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xc07b[_0x4b03c9];return _0x161ba2;};'use strict';var Sequelize=require(_0xbc07('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc07('0x1')]},'description':{'type':Sequelize[_0xbc07('0x1')]}}; \ No newline at end of file +var _0x9b44=['sequelize','exports','STRING'];(function(_0x5babfe,_0xb2415){var _0x5e8c19=function(_0xe0b8a1){while(--_0xe0b8a1){_0x5babfe['push'](_0x5babfe['shift']());}};_0x5e8c19(++_0xb2415);}(_0x9b44,0x17d));var _0x49b4=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x9b44[_0x3bcf9e];return _0x1bb37c;};'use strict';var Sequelize=require(_0x49b4('0x0'));module[_0x49b4('0x1')]={'name':{'type':Sequelize[_0x49b4('0x2')]},'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 045ad06..5e68310 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 _0x61ce=['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','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','type','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','length','find','create','body','destroy','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x5be3eb,_0x42f789){var _0x1c219b=function(_0x2c883c){while(--_0x2c883c){_0x5be3eb['push'](_0x5be3eb['shift']());}};_0x1c219b(++_0x42f789);}(_0x61ce,0xeb));var _0xe61c=function(_0x1c6a5a,_0x3568e1){_0x1c6a5a=_0x1c6a5a-0x0;var _0x282c86=_0x61ce[_0x1c6a5a];return _0x282c86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe61c('0x0'));var zipdir=require(_0xe61c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe61c('0x2'));var BPromise=require(_0xe61c('0x3'));var Mustache=require(_0xe61c('0x4'));var util=require(_0xe61c('0x5'));var path=require(_0xe61c('0x6'));var sox=require(_0xe61c('0x7'));var csv=require(_0xe61c('0x8'));var ejs=require(_0xe61c('0x9'));var fs=require('fs');var fs_extra=require(_0xe61c('0xa'));var _=require('lodash');var squel=require(_0xe61c('0xb'));var crypto=require(_0xe61c('0xc'));var jsforce=require(_0xe61c('0xd'));var deskjs=require(_0xe61c('0xe'));var toCsv=require(_0xe61c('0x8'));var querystring=require('querystring');var Papa=require(_0xe61c('0xf'));var Redis=require(_0xe61c('0x10'));var authService=require(_0xe61c('0x11'));var qs=require(_0xe61c('0x12'));var as=require(_0xe61c('0x13'));var hardwareService=require(_0xe61c('0x14'));var logger=require('../../config/logger')(_0xe61c('0x15'));var utils=require(_0xe61c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe61c('0x17'))['db'];function respondWithStatusCode(_0x145f8c,_0x1d5f35){_0x1d5f35=_0x1d5f35||0xcc;return function(_0x3bd46b){if(_0x3bd46b){return _0x145f8c['sendStatus'](_0x1d5f35);}return _0x145f8c[_0xe61c('0x18')](_0x1d5f35)[_0xe61c('0x19')]();};}function respondWithResult(_0x3e0b1f,_0x365ceb){_0x365ceb=_0x365ceb||0xc8;return function(_0x349237){if(_0x349237){return _0x3e0b1f[_0xe61c('0x18')](_0x365ceb)[_0xe61c('0x1a')](_0x349237);}};}function respondWithFilteredResult(_0x1a7883,_0x2f4f76){return function(_0x20a1a1){if(_0x20a1a1){var _0x2d28c6=typeof _0x2f4f76[_0xe61c('0x1b')]==='undefined'&&typeof _0x2f4f76[_0xe61c('0x1c')]===_0xe61c('0x1d');var _0x3c2454=_0x20a1a1[_0xe61c('0x1e')];var _0x11866b=_0x2d28c6?0x0:_0x2f4f76[_0xe61c('0x1b')];var _0x5754dc=_0x2d28c6?_0x20a1a1[_0xe61c('0x1e')]:_0x2f4f76['offset']+_0x2f4f76['limit'];var _0x26db92;if(_0x5754dc>=_0x3c2454){_0x5754dc=_0x3c2454;_0x26db92=0xc8;}else{_0x26db92=0xce;}_0x1a7883[_0xe61c('0x18')](_0x26db92);return _0x1a7883[_0xe61c('0x1f')](_0xe61c('0x20'),_0x11866b+'-'+_0x5754dc+'/'+_0x3c2454)[_0xe61c('0x1a')](_0x20a1a1);}return null;};}function patchUpdates(_0x429e14){return function(_0x2c5036){try{jsonpatch['apply'](_0x2c5036,_0x429e14,!![]);}catch(_0x4bb7eb){return BPromise[_0xe61c('0x21')](_0x4bb7eb);}return _0x2c5036[_0xe61c('0x22')]();};}function saveUpdates(_0x2cb0d8,_0x1be15f){return function(_0x133318){if(_0x133318){return _0x133318[_0xe61c('0x23')](_0x2cb0d8)[_0xe61c('0x24')](function(_0x4f81ec){return _0x4f81ec;});}return null;};}function removeEntity(_0x46bbda,_0x2a0dbe){return function(_0x34d941){if(_0x34d941){return _0x34d941['destroy']()['then'](function(){_0x46bbda['status'](0xcc)[_0xe61c('0x19')]();});}};}function handleEntityNotFound(_0x3d7827,_0x34b7a0){return function(_0x1ff5b4){if(!_0x1ff5b4){_0x3d7827[_0xe61c('0x25')](0x194);}return _0x1ff5b4;};}function handleError(_0x480bbc,_0x493dc1){_0x493dc1=_0x493dc1||0x1f4;return function(_0x447c34){logger[_0xe61c('0x26')](_0x447c34[_0xe61c('0x27')]);if(_0x447c34[_0xe61c('0x28')]){delete _0x447c34[_0xe61c('0x28')];}_0x480bbc['status'](_0x493dc1)[_0xe61c('0x29')](_0x447c34);};}exports[_0xe61c('0x2a')]=function(_0x340004,_0x146d1d){var _0x3714ef={},_0x22e506={},_0x250cff={'count':0x0,'rows':[]};var _0x4fd7e0=_[_0xe61c('0x2b')](db[_0xe61c('0x2c')][_0xe61c('0x2d')],function(_0x48ec19){return{'name':_0x48ec19[_0xe61c('0x2e')],'type':_0x48ec19['type']['key']};});_0x22e506[_0xe61c('0x2f')]=_[_0xe61c('0x2b')](_0x4fd7e0,'name');_0x22e506[_0xe61c('0x30')]=_[_0xe61c('0x31')](_0x340004[_0xe61c('0x30')]);_0x22e506['filters']=_[_0xe61c('0x32')](_0x22e506[_0xe61c('0x2f')],_0x22e506[_0xe61c('0x30')]);_0x3714ef[_0xe61c('0x33')]=_[_0xe61c('0x32')](_0x22e506['model'],qs[_0xe61c('0x34')](_0x340004[_0xe61c('0x30')][_0xe61c('0x34')]));_0x3714ef[_0xe61c('0x33')]=_0x3714ef[_0xe61c('0x33')]['length']?_0x3714ef[_0xe61c('0x33')]:_0x22e506['model'];if(!_0x340004[_0xe61c('0x30')][_0xe61c('0x35')]('nolimit')){_0x3714ef[_0xe61c('0x1c')]=qs['limit'](_0x340004['query']['limit']);_0x3714ef[_0xe61c('0x1b')]=qs[_0xe61c('0x1b')](_0x340004[_0xe61c('0x30')][_0xe61c('0x1b')]);}_0x3714ef[_0xe61c('0x36')]=qs[_0xe61c('0x37')](_0x340004[_0xe61c('0x30')][_0xe61c('0x37')]);_0x3714ef[_0xe61c('0x38')]=qs['filters'](_[_0xe61c('0x39')](_0x340004[_0xe61c('0x30')],_0x22e506[_0xe61c('0x3a')]),_0x4fd7e0);if(_0x340004[_0xe61c('0x30')]['filter']){_0x3714ef[_0xe61c('0x38')]=_['merge'](_0x3714ef['where'],{'$or':_['map'](_0x4fd7e0,function(_0x4a03be){if(_0x4a03be[_0xe61c('0x3b')]!==_0xe61c('0x3c')){var _0x1fa9b0={};_0x1fa9b0[_0x4a03be[_0xe61c('0x28')]]={'$like':'%'+_0x340004[_0xe61c('0x30')][_0xe61c('0x3d')]+'%'};return _0x1fa9b0;}})});}_0x3714ef=_[_0xe61c('0x3e')]({},_0x3714ef,_0x340004[_0xe61c('0x3f')]);var _0x259ab6={'where':_0x3714ef[_0xe61c('0x38')]};return db[_0xe61c('0x2c')]['count'](_0x259ab6)[_0xe61c('0x24')](function(_0x295b9e){_0x250cff['count']=_0x295b9e;if(_0x340004[_0xe61c('0x30')][_0xe61c('0x40')]){_0x3714ef[_0xe61c('0x41')]=[{'all':!![]}];}return db[_0xe61c('0x2c')]['findAll'](_0x3714ef);})[_0xe61c('0x24')](function(_0x264841){_0x250cff['rows']=_0x264841;return _0x250cff;})[_0xe61c('0x24')](respondWithFilteredResult(_0x146d1d,_0x3714ef))[_0xe61c('0x42')](handleError(_0x146d1d,null));};exports[_0xe61c('0x43')]=function(_0x53234b,_0x25a795){var _0x3d5953={'raw':![],'where':{'id':_0x53234b[_0xe61c('0x44')]['id']}},_0x5ab798={};_0x5ab798['model']=_[_0xe61c('0x31')](db[_0xe61c('0x2c')][_0xe61c('0x2d')]);_0x5ab798[_0xe61c('0x30')]=_[_0xe61c('0x31')](_0x53234b[_0xe61c('0x30')]);_0x5ab798[_0xe61c('0x3a')]=_[_0xe61c('0x32')](_0x5ab798[_0xe61c('0x2f')],_0x5ab798[_0xe61c('0x30')]);_0x3d5953[_0xe61c('0x33')]=_[_0xe61c('0x32')](_0x5ab798[_0xe61c('0x2f')],qs[_0xe61c('0x34')](_0x53234b[_0xe61c('0x30')][_0xe61c('0x34')]));_0x3d5953[_0xe61c('0x33')]=_0x3d5953['attributes'][_0xe61c('0x45')]?_0x3d5953[_0xe61c('0x33')]:_0x5ab798[_0xe61c('0x2f')];if(_0x53234b['query'][_0xe61c('0x40')]){_0x3d5953[_0xe61c('0x41')]=[{'all':!![]}];}_0x3d5953=_[_0xe61c('0x3e')]({},_0x3d5953,_0x53234b['options']);return db[_0xe61c('0x2c')][_0xe61c('0x46')](_0x3d5953)[_0xe61c('0x24')](handleEntityNotFound(_0x25a795,null))[_0xe61c('0x24')](respondWithResult(_0x25a795,null))[_0xe61c('0x42')](handleError(_0x25a795,null));};exports[_0xe61c('0x47')]=function(_0x4da263,_0x5b5984){return db[_0xe61c('0x2c')][_0xe61c('0x47')](_0x4da263[_0xe61c('0x48')],{})[_0xe61c('0x24')](respondWithResult(_0x5b5984,0xc9))[_0xe61c('0x42')](handleError(_0x5b5984,null));};exports[_0xe61c('0x23')]=function(_0x4afa70,_0x165a56){if(_0x4afa70[_0xe61c('0x48')]['id']){delete _0x4afa70[_0xe61c('0x48')]['id'];}return db[_0xe61c('0x2c')]['find']({'where':{'id':_0x4afa70[_0xe61c('0x44')]['id']}})[_0xe61c('0x24')](handleEntityNotFound(_0x165a56,null))[_0xe61c('0x24')](saveUpdates(_0x4afa70[_0xe61c('0x48')],null))[_0xe61c('0x24')](respondWithResult(_0x165a56,null))[_0xe61c('0x42')](handleError(_0x165a56,null));};exports[_0xe61c('0x49')]=function(_0xc1b4f,_0x539b1d){return db[_0xe61c('0x2c')][_0xe61c('0x46')]({'where':{'id':_0xc1b4f[_0xe61c('0x44')]['id']}})['then'](handleEntityNotFound(_0x539b1d,null))['then'](removeEntity(_0x539b1d,null))[_0xe61c('0x42')](handleError(_0x539b1d,null));};exports[_0xe61c('0x4a')]=function(_0x241ab6,_0x5d2119,_0x5607b7){var _0x17cf0c={};var _0xbe0355={};var _0x108ea9;var _0x1895dd;return db[_0xe61c('0x2c')][_0xe61c('0x4b')]({'where':{'id':_0x241ab6['params']['id']}})[_0xe61c('0x24')](handleEntityNotFound(_0x5d2119,null))[_0xe61c('0x24')](function(_0x3a216e){if(_0x3a216e){_0x108ea9=_0x3a216e;_0xbe0355[_0xe61c('0x2f')]=_[_0xe61c('0x31')](db[_0xe61c('0x4c')][_0xe61c('0x2d')]);_0xbe0355['query']=_['keys'](_0x241ab6[_0xe61c('0x30')]);_0xbe0355['filters']=_[_0xe61c('0x32')](_0xbe0355[_0xe61c('0x2f')],_0xbe0355[_0xe61c('0x30')]);_0x17cf0c[_0xe61c('0x33')]=_[_0xe61c('0x32')](_0xbe0355['model'],qs[_0xe61c('0x34')](_0x241ab6[_0xe61c('0x30')][_0xe61c('0x34')]));_0x17cf0c[_0xe61c('0x33')]=_0x17cf0c[_0xe61c('0x33')][_0xe61c('0x45')]?_0x17cf0c['attributes']:_0xbe0355[_0xe61c('0x2f')];_0x17cf0c[_0xe61c('0x36')]=qs[_0xe61c('0x37')](_0x241ab6[_0xe61c('0x30')][_0xe61c('0x37')]);_0x17cf0c[_0xe61c('0x38')]=qs[_0xe61c('0x3a')](_[_0xe61c('0x39')](_0x241ab6[_0xe61c('0x30')],_0xbe0355['filters']));if(_0x241ab6[_0xe61c('0x30')][_0xe61c('0x3d')]){_0x17cf0c['where']=_[_0xe61c('0x3e')](_0x17cf0c[_0xe61c('0x38')],{'$or':_['map'](_0x17cf0c['attributes'],function(_0x1b9e1e){var _0x22a160={};_0x22a160[_0x1b9e1e]={'$like':'%'+_0x241ab6[_0xe61c('0x30')][_0xe61c('0x3d')]+'%'};return _0x22a160;})});}_0x17cf0c=_[_0xe61c('0x3e')]({},_0x17cf0c,_0x241ab6[_0xe61c('0x3f')]);return _0x108ea9[_0xe61c('0x4a')](_0x17cf0c);}})[_0xe61c('0x24')](function(_0x21b160){if(_0x21b160){_0x1895dd=_0x21b160[_0xe61c('0x45')];if(!_0x241ab6[_0xe61c('0x30')]['hasOwnProperty'](_0xe61c('0x4d'))){_0x17cf0c[_0xe61c('0x1c')]=qs['limit'](_0x241ab6['query']['limit']);_0x17cf0c[_0xe61c('0x1b')]=qs[_0xe61c('0x1b')](_0x241ab6[_0xe61c('0x30')]['offset']);}return _0x108ea9[_0xe61c('0x4a')](_0x17cf0c);}})['then'](function(_0x268cd8){if(_0x268cd8){return _0x268cd8?{'count':_0x1895dd,'rows':_0x268cd8}:null;}})[_0xe61c('0x24')](respondWithResult(_0x5d2119,null))['catch'](handleError(_0x5d2119,null));};exports['getSubjects']=function(_0x35236a,_0x21e17f,_0x4ca77d){var _0x5607ab={};var _0x1084cb={};var _0x5277f7;var _0x4aa62e;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x35236a[_0xe61c('0x44')]['id']}})['then'](handleEntityNotFound(_0x21e17f,null))[_0xe61c('0x24')](function(_0x21233c){if(_0x21233c){_0x5277f7=_0x21233c;_0x1084cb[_0xe61c('0x2f')]=_[_0xe61c('0x31')](db[_0xe61c('0x4c')][_0xe61c('0x2d')]);_0x1084cb[_0xe61c('0x30')]=_[_0xe61c('0x31')](_0x35236a[_0xe61c('0x30')]);_0x1084cb[_0xe61c('0x3a')]=_['intersection'](_0x1084cb['model'],_0x1084cb[_0xe61c('0x30')]);_0x5607ab[_0xe61c('0x33')]=_[_0xe61c('0x32')](_0x1084cb[_0xe61c('0x2f')],qs['fields'](_0x35236a[_0xe61c('0x30')]['fields']));_0x5607ab[_0xe61c('0x33')]=_0x5607ab[_0xe61c('0x33')][_0xe61c('0x45')]?_0x5607ab[_0xe61c('0x33')]:_0x1084cb['model'];_0x5607ab['order']=qs[_0xe61c('0x37')](_0x35236a['query'][_0xe61c('0x37')]);_0x5607ab[_0xe61c('0x38')]=qs[_0xe61c('0x3a')](_['pick'](_0x35236a['query'],_0x1084cb['filters']));if(_0x35236a['query'][_0xe61c('0x3d')]){_0x5607ab[_0xe61c('0x38')]=_[_0xe61c('0x3e')](_0x5607ab[_0xe61c('0x38')],{'$or':_[_0xe61c('0x2b')](_0x5607ab[_0xe61c('0x33')],function(_0x36fb38){var _0x290ab0={};_0x290ab0[_0x36fb38]={'$like':'%'+_0x35236a['query'][_0xe61c('0x3d')]+'%'};return _0x290ab0;})});}_0x5607ab=_[_0xe61c('0x3e')]({},_0x5607ab,_0x35236a[_0xe61c('0x3f')]);return _0x5277f7[_0xe61c('0x4e')](_0x5607ab);}})['then'](function(_0x57c963){if(_0x57c963){_0x4aa62e=_0x57c963[_0xe61c('0x45')];if(!_0x35236a[_0xe61c('0x30')][_0xe61c('0x35')]('nolimit')){_0x5607ab[_0xe61c('0x1c')]=qs['limit'](_0x35236a[_0xe61c('0x30')]['limit']);_0x5607ab[_0xe61c('0x1b')]=qs[_0xe61c('0x1b')](_0x35236a[_0xe61c('0x30')][_0xe61c('0x1b')]);}return _0x5277f7['getSubjects'](_0x5607ab);}})[_0xe61c('0x24')](function(_0xa92d40){if(_0xa92d40){return _0xa92d40?{'count':_0x4aa62e,'rows':_0xa92d40}:null;}})['then'](respondWithResult(_0x21e17f,null))[_0xe61c('0x42')](handleError(_0x21e17f,null));};exports[_0xe61c('0x4f')]=function(_0x24556b,_0x5672a0,_0x550020){var _0x2178f7={};var _0x5d884e={};var _0x2518cc;var _0x556a7a;return db[_0xe61c('0x2c')][_0xe61c('0x4b')]({'where':{'id':_0x24556b[_0xe61c('0x44')]['id']}})[_0xe61c('0x24')](handleEntityNotFound(_0x5672a0,null))[_0xe61c('0x24')](function(_0x2ef863){if(_0x2ef863){_0x2518cc=_0x2ef863;_0x5d884e[_0xe61c('0x2f')]=_[_0xe61c('0x31')](db[_0xe61c('0x4c')][_0xe61c('0x2d')]);_0x5d884e[_0xe61c('0x30')]=_[_0xe61c('0x31')](_0x24556b[_0xe61c('0x30')]);_0x5d884e['filters']=_[_0xe61c('0x32')](_0x5d884e[_0xe61c('0x2f')],_0x5d884e[_0xe61c('0x30')]);_0x2178f7[_0xe61c('0x33')]=_['intersection'](_0x5d884e[_0xe61c('0x2f')],qs[_0xe61c('0x34')](_0x24556b['query'][_0xe61c('0x34')]));_0x2178f7[_0xe61c('0x33')]=_0x2178f7[_0xe61c('0x33')]['length']?_0x2178f7[_0xe61c('0x33')]:_0x5d884e[_0xe61c('0x2f')];_0x2178f7[_0xe61c('0x36')]=qs['sort'](_0x24556b[_0xe61c('0x30')][_0xe61c('0x37')]);_0x2178f7[_0xe61c('0x38')]=qs[_0xe61c('0x3a')](_['pick'](_0x24556b[_0xe61c('0x30')],_0x5d884e[_0xe61c('0x3a')]));if(_0x24556b['query']['filter']){_0x2178f7[_0xe61c('0x38')]=_[_0xe61c('0x3e')](_0x2178f7[_0xe61c('0x38')],{'$or':_[_0xe61c('0x2b')](_0x2178f7[_0xe61c('0x33')],function(_0x13239a){var _0x119907={};_0x119907[_0x13239a]={'$like':'%'+_0x24556b[_0xe61c('0x30')]['filter']+'%'};return _0x119907;})});}_0x2178f7=_['merge']({},_0x2178f7,_0x24556b[_0xe61c('0x3f')]);return _0x2518cc['getDescriptions'](_0x2178f7);}})[_0xe61c('0x24')](function(_0xa273da){if(_0xa273da){_0x556a7a=_0xa273da[_0xe61c('0x45')];if(!_0x24556b['query'][_0xe61c('0x35')](_0xe61c('0x4d'))){_0x2178f7[_0xe61c('0x1c')]=qs[_0xe61c('0x1c')](_0x24556b[_0xe61c('0x30')]['limit']);_0x2178f7[_0xe61c('0x1b')]=qs[_0xe61c('0x1b')](_0x24556b[_0xe61c('0x30')][_0xe61c('0x1b')]);}return _0x2518cc[_0xe61c('0x4f')](_0x2178f7);}})['then'](function(_0x55450c){if(_0x55450c){return _0x55450c?{'count':_0x556a7a,'rows':_0x55450c}:null;}})['then'](respondWithResult(_0x5672a0,null))['catch'](handleError(_0x5672a0,null));}; \ No newline at end of file +var _0x1395=['findAll','catch','params','include','find','create','body','findOne','getFields','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll'];(function(_0x2f9739,_0x2570d4){var _0x1f2dec=function(_0x203977){while(--_0x203977){_0x2f9739['push'](_0x2f9739['shift']());}};_0x1f2dec(++_0x2570d4);}(_0x1395,0x105));var _0x5139=function(_0x20ebf9,_0x25ebef){_0x20ebf9=_0x20ebf9-0x0;var _0x319d66=_0x1395[_0x20ebf9];return _0x319d66;};'use strict';var emlformat=require(_0x5139('0x0'));var rimraf=require(_0x5139('0x1'));var zipdir=require(_0x5139('0x2'));var jsonpatch=require(_0x5139('0x3'));var rp=require(_0x5139('0x4'));var moment=require(_0x5139('0x5'));var BPromise=require(_0x5139('0x6'));var Mustache=require(_0x5139('0x7'));var util=require('util');var path=require(_0x5139('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5139('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5139('0xa'));var squel=require(_0x5139('0xb'));var crypto=require(_0x5139('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5139('0xd'));var toCsv=require(_0x5139('0xe'));var querystring=require(_0x5139('0xf'));var Papa=require(_0x5139('0x10'));var Redis=require(_0x5139('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5139('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5139('0x13'));var logger=require(_0x5139('0x14'))(_0x5139('0x15'));var utils=require(_0x5139('0x16'));var config=require(_0x5139('0x17'));var licenseUtil=require(_0x5139('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x146c2b,_0x19315a){_0x19315a=_0x19315a||0xcc;return function(_0x2719b){if(_0x2719b){return _0x146c2b[_0x5139('0x19')](_0x19315a);}return _0x146c2b[_0x5139('0x1a')](_0x19315a)['end']();};}function respondWithResult(_0xb2c8c9,_0x5a90c7){_0x5a90c7=_0x5a90c7||0xc8;return function(_0x1b7d33){if(_0x1b7d33){return _0xb2c8c9[_0x5139('0x1a')](_0x5a90c7)[_0x5139('0x1b')](_0x1b7d33);}};}function respondWithFilteredResult(_0x22d5bc,_0x431aed){return function(_0x4c81ba){if(_0x4c81ba){var _0x2270ce=typeof _0x431aed[_0x5139('0x1c')]===_0x5139('0x1d')&&typeof _0x431aed['limit']==='undefined';var _0x4cdde7=_0x4c81ba[_0x5139('0x1e')];var _0x52a4db=_0x2270ce?0x0:_0x431aed[_0x5139('0x1c')];var _0x2579b5=_0x2270ce?_0x4c81ba['count']:_0x431aed[_0x5139('0x1c')]+_0x431aed[_0x5139('0x1f')];var _0xecf30d;if(_0x2579b5>=_0x4cdde7){_0x2579b5=_0x4cdde7;_0xecf30d=0xc8;}else{_0xecf30d=0xce;}_0x22d5bc[_0x5139('0x1a')](_0xecf30d);return _0x22d5bc[_0x5139('0x20')](_0x5139('0x21'),_0x52a4db+'-'+_0x2579b5+'/'+_0x4cdde7)[_0x5139('0x1b')](_0x4c81ba);}return null;};}function patchUpdates(_0x42731d){return function(_0x5e47b8){try{jsonpatch[_0x5139('0x22')](_0x5e47b8,_0x42731d,!![]);}catch(_0x48ad24){return BPromise[_0x5139('0x23')](_0x48ad24);}return _0x5e47b8[_0x5139('0x24')]();};}function saveUpdates(_0x523b97,_0x37382f){return function(_0xe902fa){if(_0xe902fa){return _0xe902fa[_0x5139('0x25')](_0x523b97)[_0x5139('0x26')](function(_0x1ec3e1){return _0x1ec3e1;});}return null;};}function removeEntity(_0x3a040e,_0x51481d){return function(_0x5ebb89){if(_0x5ebb89){return _0x5ebb89[_0x5139('0x27')]()['then'](function(){_0x3a040e['status'](0xcc)[_0x5139('0x28')]();});}};}function handleEntityNotFound(_0x516c34,_0x31cfcd){return function(_0x77e1cf){if(!_0x77e1cf){_0x516c34[_0x5139('0x19')](0x194);}return _0x77e1cf;};}function handleError(_0x178b8f,_0x52e772){_0x52e772=_0x52e772||0x1f4;return function(_0x325681){logger[_0x5139('0x29')](_0x325681[_0x5139('0x2a')]);if(_0x325681[_0x5139('0x2b')]){delete _0x325681[_0x5139('0x2b')];}_0x178b8f[_0x5139('0x1a')](_0x52e772)[_0x5139('0x2c')](_0x325681);};}exports[_0x5139('0x2d')]=function(_0x45c62a,_0x2cbba7){var _0x436955={},_0x5f303e={},_0x1b46fd={'count':0x0,'rows':[]};var _0x18ad79=_[_0x5139('0x2e')](db[_0x5139('0x2f')][_0x5139('0x30')],function(_0x469c21){return{'name':_0x469c21[_0x5139('0x31')],'type':_0x469c21[_0x5139('0x32')][_0x5139('0x33')]};});_0x5f303e[_0x5139('0x34')]=_[_0x5139('0x2e')](_0x18ad79,_0x5139('0x2b'));_0x5f303e[_0x5139('0x35')]=_[_0x5139('0x36')](_0x45c62a[_0x5139('0x35')]);_0x5f303e['filters']=_[_0x5139('0x37')](_0x5f303e[_0x5139('0x34')],_0x5f303e[_0x5139('0x35')]);_0x436955[_0x5139('0x38')]=_['intersection'](_0x5f303e['model'],qs[_0x5139('0x39')](_0x45c62a[_0x5139('0x35')][_0x5139('0x39')]));_0x436955[_0x5139('0x38')]=_0x436955[_0x5139('0x38')][_0x5139('0x3a')]?_0x436955[_0x5139('0x38')]:_0x5f303e[_0x5139('0x34')];if(!_0x45c62a[_0x5139('0x35')][_0x5139('0x3b')](_0x5139('0x3c'))){_0x436955[_0x5139('0x1f')]=qs[_0x5139('0x1f')](_0x45c62a[_0x5139('0x35')][_0x5139('0x1f')]);_0x436955['offset']=qs[_0x5139('0x1c')](_0x45c62a[_0x5139('0x35')][_0x5139('0x1c')]);}_0x436955[_0x5139('0x3d')]=qs[_0x5139('0x3e')](_0x45c62a[_0x5139('0x35')][_0x5139('0x3e')]);_0x436955['where']=qs[_0x5139('0x3f')](_[_0x5139('0x40')](_0x45c62a[_0x5139('0x35')],_0x5f303e[_0x5139('0x3f')]),_0x18ad79);if(_0x45c62a[_0x5139('0x35')][_0x5139('0x41')]){_0x436955['where']=_[_0x5139('0x42')](_0x436955[_0x5139('0x43')],{'$or':_[_0x5139('0x2e')](_0x18ad79,function(_0x3a4c1c){if(_0x3a4c1c[_0x5139('0x32')]!==_0x5139('0x44')){var _0x18aa29={};_0x18aa29[_0x3a4c1c[_0x5139('0x2b')]]={'$like':'%'+_0x45c62a[_0x5139('0x35')]['filter']+'%'};return _0x18aa29;}})});}_0x436955=_['merge']({},_0x436955,_0x45c62a[_0x5139('0x45')]);var _0x8521da={'where':_0x436955[_0x5139('0x43')]};return db[_0x5139('0x2f')][_0x5139('0x1e')](_0x8521da)[_0x5139('0x26')](function(_0x326f2a){_0x1b46fd[_0x5139('0x1e')]=_0x326f2a;if(_0x45c62a[_0x5139('0x35')][_0x5139('0x46')]){_0x436955['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x5139('0x47')](_0x436955);})['then'](function(_0x2e710d){_0x1b46fd['rows']=_0x2e710d;return _0x1b46fd;})['then'](respondWithFilteredResult(_0x2cbba7,_0x436955))[_0x5139('0x48')](handleError(_0x2cbba7,null));};exports['show']=function(_0x111394,_0x1b893c){var _0x4fde8c={'raw':![],'where':{'id':_0x111394[_0x5139('0x49')]['id']}},_0x33a7c4={};_0x33a7c4[_0x5139('0x34')]=_['keys'](db[_0x5139('0x2f')][_0x5139('0x30')]);_0x33a7c4[_0x5139('0x35')]=_[_0x5139('0x36')](_0x111394[_0x5139('0x35')]);_0x33a7c4[_0x5139('0x3f')]=_[_0x5139('0x37')](_0x33a7c4[_0x5139('0x34')],_0x33a7c4[_0x5139('0x35')]);_0x4fde8c[_0x5139('0x38')]=_[_0x5139('0x37')](_0x33a7c4[_0x5139('0x34')],qs['fields'](_0x111394['query'][_0x5139('0x39')]));_0x4fde8c[_0x5139('0x38')]=_0x4fde8c['attributes'][_0x5139('0x3a')]?_0x4fde8c['attributes']:_0x33a7c4[_0x5139('0x34')];if(_0x111394[_0x5139('0x35')][_0x5139('0x46')]){_0x4fde8c[_0x5139('0x4a')]=[{'all':!![]}];}_0x4fde8c=_[_0x5139('0x42')]({},_0x4fde8c,_0x111394[_0x5139('0x45')]);return db['VtigerConfiguration'][_0x5139('0x4b')](_0x4fde8c)[_0x5139('0x26')](handleEntityNotFound(_0x1b893c,null))[_0x5139('0x26')](respondWithResult(_0x1b893c,null))[_0x5139('0x48')](handleError(_0x1b893c,null));};exports[_0x5139('0x4c')]=function(_0x3831e1,_0x404f53){return db[_0x5139('0x2f')]['create'](_0x3831e1[_0x5139('0x4d')],{})['then'](respondWithResult(_0x404f53,0xc9))[_0x5139('0x48')](handleError(_0x404f53,null));};exports[_0x5139('0x25')]=function(_0x401bc1,_0x6f311c){if(_0x401bc1['body']['id']){delete _0x401bc1['body']['id'];}return db[_0x5139('0x2f')][_0x5139('0x4b')]({'where':{'id':_0x401bc1['params']['id']}})[_0x5139('0x26')](handleEntityNotFound(_0x6f311c,null))[_0x5139('0x26')](saveUpdates(_0x401bc1[_0x5139('0x4d')],null))[_0x5139('0x26')](respondWithResult(_0x6f311c,null))['catch'](handleError(_0x6f311c,null));};exports['destroy']=function(_0x3311e3,_0xb47e33){return db[_0x5139('0x2f')][_0x5139('0x4b')]({'where':{'id':_0x3311e3[_0x5139('0x49')]['id']}})[_0x5139('0x26')](handleEntityNotFound(_0xb47e33,null))[_0x5139('0x26')](removeEntity(_0xb47e33,null))[_0x5139('0x48')](handleError(_0xb47e33,null));};exports['getFields']=function(_0x1c1153,_0x421bfe,_0x541346){var _0x3c746b={};var _0x5bd11b={};var _0x568c25;var _0x422aaa;return db['VtigerConfiguration'][_0x5139('0x4e')]({'where':{'id':_0x1c1153[_0x5139('0x49')]['id']}})[_0x5139('0x26')](handleEntityNotFound(_0x421bfe,null))[_0x5139('0x26')](function(_0x42a2ae){if(_0x42a2ae){_0x568c25=_0x42a2ae;_0x5bd11b[_0x5139('0x34')]=_[_0x5139('0x36')](db['VtigerField'][_0x5139('0x30')]);_0x5bd11b['query']=_[_0x5139('0x36')](_0x1c1153[_0x5139('0x35')]);_0x5bd11b[_0x5139('0x3f')]=_[_0x5139('0x37')](_0x5bd11b[_0x5139('0x34')],_0x5bd11b[_0x5139('0x35')]);_0x3c746b[_0x5139('0x38')]=_[_0x5139('0x37')](_0x5bd11b[_0x5139('0x34')],qs[_0x5139('0x39')](_0x1c1153[_0x5139('0x35')]['fields']));_0x3c746b['attributes']=_0x3c746b[_0x5139('0x38')][_0x5139('0x3a')]?_0x3c746b['attributes']:_0x5bd11b[_0x5139('0x34')];_0x3c746b[_0x5139('0x3d')]=qs['sort'](_0x1c1153['query'][_0x5139('0x3e')]);_0x3c746b[_0x5139('0x43')]=qs[_0x5139('0x3f')](_['pick'](_0x1c1153[_0x5139('0x35')],_0x5bd11b[_0x5139('0x3f')]));if(_0x1c1153['query'][_0x5139('0x41')]){_0x3c746b[_0x5139('0x43')]=_[_0x5139('0x42')](_0x3c746b['where'],{'$or':_[_0x5139('0x2e')](_0x3c746b[_0x5139('0x38')],function(_0x1378d6){var _0xf9b7f2={};_0xf9b7f2[_0x1378d6]={'$like':'%'+_0x1c1153[_0x5139('0x35')][_0x5139('0x41')]+'%'};return _0xf9b7f2;})});}_0x3c746b=_[_0x5139('0x42')]({},_0x3c746b,_0x1c1153['options']);return _0x568c25[_0x5139('0x4f')](_0x3c746b);}})[_0x5139('0x26')](function(_0x2ca0d9){if(_0x2ca0d9){_0x422aaa=_0x2ca0d9[_0x5139('0x3a')];if(!_0x1c1153['query']['hasOwnProperty'](_0x5139('0x3c'))){_0x3c746b[_0x5139('0x1f')]=qs[_0x5139('0x1f')](_0x1c1153[_0x5139('0x35')][_0x5139('0x1f')]);_0x3c746b[_0x5139('0x1c')]=qs[_0x5139('0x1c')](_0x1c1153[_0x5139('0x35')]['offset']);}return _0x568c25[_0x5139('0x4f')](_0x3c746b);}})[_0x5139('0x26')](function(_0x4df02f){if(_0x4df02f){return _0x4df02f?{'count':_0x422aaa,'rows':_0x4df02f}:null;}})[_0x5139('0x26')](respondWithResult(_0x421bfe,null))[_0x5139('0x48')](handleError(_0x421bfe,null));};exports['getSubjects']=function(_0x33eae7,_0x1a9e24,_0x3e2786){var _0x4c2a1f={};var _0x44db5f={};var _0x44d1a7;var _0x43d3cc;return db[_0x5139('0x2f')][_0x5139('0x4e')]({'where':{'id':_0x33eae7[_0x5139('0x49')]['id']}})[_0x5139('0x26')](handleEntityNotFound(_0x1a9e24,null))[_0x5139('0x26')](function(_0x5f4bf6){if(_0x5f4bf6){_0x44d1a7=_0x5f4bf6;_0x44db5f[_0x5139('0x34')]=_[_0x5139('0x36')](db[_0x5139('0x50')][_0x5139('0x30')]);_0x44db5f['query']=_['keys'](_0x33eae7[_0x5139('0x35')]);_0x44db5f[_0x5139('0x3f')]=_['intersection'](_0x44db5f['model'],_0x44db5f[_0x5139('0x35')]);_0x4c2a1f[_0x5139('0x38')]=_[_0x5139('0x37')](_0x44db5f[_0x5139('0x34')],qs[_0x5139('0x39')](_0x33eae7[_0x5139('0x35')]['fields']));_0x4c2a1f[_0x5139('0x38')]=_0x4c2a1f['attributes'][_0x5139('0x3a')]?_0x4c2a1f['attributes']:_0x44db5f[_0x5139('0x34')];_0x4c2a1f['order']=qs['sort'](_0x33eae7['query']['sort']);_0x4c2a1f[_0x5139('0x43')]=qs['filters'](_['pick'](_0x33eae7[_0x5139('0x35')],_0x44db5f[_0x5139('0x3f')]));if(_0x33eae7[_0x5139('0x35')]['filter']){_0x4c2a1f[_0x5139('0x43')]=_[_0x5139('0x42')](_0x4c2a1f['where'],{'$or':_[_0x5139('0x2e')](_0x4c2a1f[_0x5139('0x38')],function(_0x459dc5){var _0x493270={};_0x493270[_0x459dc5]={'$like':'%'+_0x33eae7['query'][_0x5139('0x41')]+'%'};return _0x493270;})});}_0x4c2a1f=_[_0x5139('0x42')]({},_0x4c2a1f,_0x33eae7[_0x5139('0x45')]);return _0x44d1a7['getSubjects'](_0x4c2a1f);}})[_0x5139('0x26')](function(_0x1e3423){if(_0x1e3423){_0x43d3cc=_0x1e3423[_0x5139('0x3a')];if(!_0x33eae7['query']['hasOwnProperty'](_0x5139('0x3c'))){_0x4c2a1f[_0x5139('0x1f')]=qs[_0x5139('0x1f')](_0x33eae7['query']['limit']);_0x4c2a1f['offset']=qs[_0x5139('0x1c')](_0x33eae7['query'][_0x5139('0x1c')]);}return _0x44d1a7[_0x5139('0x51')](_0x4c2a1f);}})['then'](function(_0xfeb113){if(_0xfeb113){return _0xfeb113?{'count':_0x43d3cc,'rows':_0xfeb113}:null;}})['then'](respondWithResult(_0x1a9e24,null))['catch'](handleError(_0x1a9e24,null));};exports[_0x5139('0x52')]=function(_0x46df4d,_0x2ceb31,_0x74b859){var _0x49bb3a={};var _0x33f108={};var _0x43f39a;var _0x19b703;return db[_0x5139('0x2f')][_0x5139('0x4e')]({'where':{'id':_0x46df4d[_0x5139('0x49')]['id']}})[_0x5139('0x26')](handleEntityNotFound(_0x2ceb31,null))['then'](function(_0x11d5f3){if(_0x11d5f3){_0x43f39a=_0x11d5f3;_0x33f108[_0x5139('0x34')]=_[_0x5139('0x36')](db[_0x5139('0x50')][_0x5139('0x30')]);_0x33f108[_0x5139('0x35')]=_[_0x5139('0x36')](_0x46df4d[_0x5139('0x35')]);_0x33f108[_0x5139('0x3f')]=_[_0x5139('0x37')](_0x33f108[_0x5139('0x34')],_0x33f108[_0x5139('0x35')]);_0x49bb3a[_0x5139('0x38')]=_[_0x5139('0x37')](_0x33f108[_0x5139('0x34')],qs[_0x5139('0x39')](_0x46df4d[_0x5139('0x35')]['fields']));_0x49bb3a[_0x5139('0x38')]=_0x49bb3a['attributes']['length']?_0x49bb3a[_0x5139('0x38')]:_0x33f108[_0x5139('0x34')];_0x49bb3a[_0x5139('0x3d')]=qs[_0x5139('0x3e')](_0x46df4d[_0x5139('0x35')][_0x5139('0x3e')]);_0x49bb3a[_0x5139('0x43')]=qs[_0x5139('0x3f')](_[_0x5139('0x40')](_0x46df4d[_0x5139('0x35')],_0x33f108[_0x5139('0x3f')]));if(_0x46df4d[_0x5139('0x35')][_0x5139('0x41')]){_0x49bb3a[_0x5139('0x43')]=_[_0x5139('0x42')](_0x49bb3a['where'],{'$or':_[_0x5139('0x2e')](_0x49bb3a[_0x5139('0x38')],function(_0x20edc6){var _0x2943ad={};_0x2943ad[_0x20edc6]={'$like':'%'+_0x46df4d[_0x5139('0x35')][_0x5139('0x41')]+'%'};return _0x2943ad;})});}_0x49bb3a=_[_0x5139('0x42')]({},_0x49bb3a,_0x46df4d[_0x5139('0x45')]);return _0x43f39a[_0x5139('0x52')](_0x49bb3a);}})[_0x5139('0x26')](function(_0x3effa0){if(_0x3effa0){_0x19b703=_0x3effa0[_0x5139('0x3a')];if(!_0x46df4d['query'][_0x5139('0x3b')](_0x5139('0x3c'))){_0x49bb3a[_0x5139('0x1f')]=qs[_0x5139('0x1f')](_0x46df4d[_0x5139('0x35')]['limit']);_0x49bb3a[_0x5139('0x1c')]=qs[_0x5139('0x1c')](_0x46df4d[_0x5139('0x35')][_0x5139('0x1c')]);}return _0x43f39a[_0x5139('0x52')](_0x49bb3a);}})[_0x5139('0x26')](function(_0x1afe67){if(_0x1afe67){return _0x1afe67?{'count':_0x19b703,'rows':_0x1afe67}:null;}})['then'](respondWithResult(_0x2ceb31,null))[_0x5139('0x48')](handleError(_0x2ceb31,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bc2ff48..c5ba6ae 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 _0x80cd=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intVtigerConfiguration.attributes','define'];(function(_0x43e4b3,_0x38f0d9){var _0x2d9e75=function(_0x3d1b25){while(--_0x3d1b25){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x2d9e75(++_0x38f0d9);}(_0x80cd,0x176));var _0xd80c=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0x80cd[_0x7148a3];return _0x52f31d;};'use strict';var _=require(_0xd80c('0x0'));var util=require(_0xd80c('0x1'));var logger=require(_0xd80c('0x2'))(_0xd80c('0x3'));var moment=require(_0xd80c('0x4'));var BPromise=require(_0xd80c('0x5'));var rp=require(_0xd80c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd80c('0x7'));var config=require('../../config/environment');var attributes=require(_0xd80c('0x8'));module['exports']=function(_0x1eb25e,_0x1c333c){return _0x1eb25e[_0xd80c('0x9')](_0xd80c('0xa'),attributes,{'tableName':_0xd80c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad31=['util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define','lodash'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0xad31,0x74));var _0x1ad3=function(_0x3446dc,_0xa69b0f){_0x3446dc=_0x3446dc-0x0;var _0x584a16=_0xad31[_0x3446dc];return _0x584a16;};'use strict';var _=require(_0x1ad3('0x0'));var util=require(_0x1ad3('0x1'));var logger=require(_0x1ad3('0x2'))('api');var moment=require(_0x1ad3('0x3'));var BPromise=require(_0x1ad3('0x4'));var rp=require(_0x1ad3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ad3('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x1ad3('0x7')]=function(_0x4d1050,_0x48f9b2){return _0x4d1050[_0x1ad3('0x8')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index bf02fdf..7d45687 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 _0xbe89=['request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http'];(function(_0x3a1dec,_0x1f943f){var _0x60ede0=function(_0x285fd5){while(--_0x285fd5){_0x3a1dec['push'](_0x3a1dec['shift']());}};_0x60ede0(++_0x1f943f);}(_0xbe89,0x6e));var _0x9be8=function(_0x39ddb5,_0x322d8e){_0x39ddb5=_0x39ddb5-0x0;var _0x5c6fae=_0xbe89[_0x39ddb5];return _0x5c6fae;};'use strict';var _=require(_0x9be8('0x0'));var util=require(_0x9be8('0x1'));var moment=require(_0x9be8('0x2'));var BPromise=require(_0x9be8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9be8('0x4'));var db=require(_0x9be8('0x5'))['db'];var utils=require(_0x9be8('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9be8('0x7'));var client=jayson[_0x9be8('0x8')][_0x9be8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233f03,_0xbf206d,_0x36156a){return new BPromise(function(_0x319d49,_0x3cd8cc){return client[_0x9be8('0xa')](_0x233f03,_0x36156a)[_0x9be8('0xb')](function(_0x4e7725){logger[_0x9be8('0xc')](_0x9be8('0xd'),_0xbf206d,_0x9be8('0xe'));logger['debug'](_0x9be8('0xf'),_0xbf206d,_0x9be8('0xe'),JSON[_0x9be8('0x10')](_0x4e7725));if(_0x4e7725[_0x9be8('0x11')]){if(_0x4e7725['error'][_0x9be8('0x12')]===0x1f4){logger[_0x9be8('0x11')](_0x9be8('0xd'),_0xbf206d,_0x4e7725[_0x9be8('0x11')][_0x9be8('0x13')]);return _0x3cd8cc(_0x4e7725[_0x9be8('0x11')]['message']);}logger['error'](_0x9be8('0xd'),_0xbf206d,_0x4e7725[_0x9be8('0x11')][_0x9be8('0x13')]);return _0x319d49(_0x4e7725[_0x9be8('0x11')][_0x9be8('0x13')]);}else{logger[_0x9be8('0xc')](_0x9be8('0xd'),_0xbf206d,'request\x20sent');_0x319d49(_0x4e7725['result'][_0x9be8('0x13')]);}})['catch'](function(_0x4e7f8a){logger['error'](_0x9be8('0xd'),_0xbf206d,_0x4e7f8a);_0x3cd8cc(_0x4e7f8a);});});} \ No newline at end of file +var _0xee12=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x1e6f9a,_0x37c6d8){var _0x2b65b0=function(_0xfc8c6){while(--_0xfc8c6){_0x1e6f9a['push'](_0x1e6f9a['shift']());}};_0x2b65b0(++_0x37c6d8);}(_0xee12,0x1a6));var _0x2ee1=function(_0x1ae11c,_0x5e2780){_0x1ae11c=_0x1ae11c-0x0;var _0x2e3d43=_0xee12[_0x1ae11c];return _0x2e3d43;};'use strict';var _=require(_0x2ee1('0x0'));var util=require(_0x2ee1('0x1'));var moment=require('moment');var BPromise=require(_0x2ee1('0x2'));var rs=require(_0x2ee1('0x3'));var fs=require('fs');var Redis=require(_0x2ee1('0x4'));var db=require(_0x2ee1('0x5'))['db'];var utils=require(_0x2ee1('0x6'));var logger=require(_0x2ee1('0x7'))('rpc');var config=require(_0x2ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ee1('0x9')][_0x2ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15b79e,_0x2d1105,_0x30b2e4){return new BPromise(function(_0x5c6a6f,_0x3876ea){return client[_0x2ee1('0xb')](_0x15b79e,_0x30b2e4)[_0x2ee1('0xc')](function(_0x2bf540){logger[_0x2ee1('0xd')](_0x2ee1('0xe'),_0x2d1105,_0x2ee1('0xf'));logger[_0x2ee1('0x10')](_0x2ee1('0x11'),_0x2d1105,_0x2ee1('0xf'),JSON[_0x2ee1('0x12')](_0x2bf540));if(_0x2bf540[_0x2ee1('0x13')]){if(_0x2bf540['error'][_0x2ee1('0x14')]===0x1f4){logger[_0x2ee1('0x13')](_0x2ee1('0xe'),_0x2d1105,_0x2bf540['error'][_0x2ee1('0x15')]);return _0x3876ea(_0x2bf540['error'][_0x2ee1('0x15')]);}logger[_0x2ee1('0x13')](_0x2ee1('0xe'),_0x2d1105,_0x2bf540[_0x2ee1('0x13')][_0x2ee1('0x15')]);return _0x5c6a6f(_0x2bf540[_0x2ee1('0x13')]['message']);}else{logger['info'](_0x2ee1('0xe'),_0x2d1105,'request\x20sent');_0x5c6a6f(_0x2bf540[_0x2ee1('0x16')][_0x2ee1('0x15')]);}})[_0x2ee1('0x17')](function(_0xc328a6){logger[_0x2ee1('0x13')](_0x2ee1('0xe'),_0x2d1105,_0xc328a6);_0x3876ea(_0xc328a6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index cf6d767..decf835 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 _0xf3d3=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x56ea29,_0x1f50b0){var _0x441aaa=function(_0x264399){while(--_0x264399){_0x56ea29['push'](_0x56ea29['shift']());}};_0x441aaa(++_0x1f50b0);}(_0xf3d3,0x79));var _0x3f3d=function(_0x13d153,_0x3edda1){_0x13d153=_0x13d153-0x0;var _0x508a08=_0xf3d3[_0x13d153];return _0x508a08;};'use strict';var multer=require(_0x3f3d('0x0'));var util=require(_0x3f3d('0x1'));var path=require(_0x3f3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x3f3d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f3d('0x4'));var interaction=require(_0x3f3d('0x5'));var config=require('../../config/environment');var controller=require(_0x3f3d('0x6'));router[_0x3f3d('0x7')]('/',auth[_0x3f3d('0x8')](),controller['index']);router[_0x3f3d('0x7')](_0x3f3d('0x9'),auth[_0x3f3d('0x8')](),controller[_0x3f3d('0xa')]);router[_0x3f3d('0xb')]('/',auth['isAuthenticated'](),controller[_0x3f3d('0xc')]);router[_0x3f3d('0xd')](_0x3f3d('0x9'),auth[_0x3f3d('0x8')](),controller['update']);router[_0x3f3d('0xe')]('/:id',auth[_0x3f3d('0x8')](),controller[_0x3f3d('0xf')]);module[_0x3f3d('0x10')]=router; \ No newline at end of file +var _0xeae9=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','index','isAuthenticated','show','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3f13b3,_0x592fd6){var _0x12f642=function(_0x2f6eeb){while(--_0x2f6eeb){_0x3f13b3['push'](_0x3f13b3['shift']());}};_0x12f642(++_0x592fd6);}(_0xeae9,0x140));var _0x9eae=function(_0x13db5b,_0x1abac7){_0x13db5b=_0x13db5b-0x0;var _0x159cb9=_0xeae9[_0x13db5b];return _0x159cb9;};'use strict';var multer=require(_0x9eae('0x0'));var util=require(_0x9eae('0x1'));var path=require('path');var timeout=require(_0x9eae('0x2'));var express=require(_0x9eae('0x3'));var router=express['Router']();var fs_extra=require(_0x9eae('0x4'));var auth=require(_0x9eae('0x5'));var interaction=require(_0x9eae('0x6'));var config=require('../../config/environment');var controller=require(_0x9eae('0x7'));router[_0x9eae('0x8')]('/',auth['isAuthenticated'](),controller[_0x9eae('0x9')]);router[_0x9eae('0x8')]('/:id',auth[_0x9eae('0xa')](),controller[_0x9eae('0xb')]);router['post']('/',auth[_0x9eae('0xa')](),controller[_0x9eae('0xc')]);router[_0x9eae('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9eae('0xe')]);router['delete'](_0x9eae('0xf'),auth[_0x9eae('0xa')](),controller[_0x9eae('0x10')]);module[_0x9eae('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index afba1d3..33564f7 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 _0x1ea1=['exports','ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1ea1,0x98));var _0x11ea=function(_0x29b8ea,_0x1bfd3d){_0x29b8ea=_0x29b8ea-0x0;var _0x24ac0a=_0x1ea1[_0x29b8ea];return _0x24ac0a;};'use strict';var Sequelize=require(_0x11ea('0x0'));module[_0x11ea('0x1')]={'type':{'type':Sequelize[_0x11ea('0x2')](_0x11ea('0x3'),'variable','customVariable',_0x11ea('0x4'),'picklist'),'defaultValue':_0x11ea('0x3')},'content':{'type':Sequelize[_0x11ea('0x5')]},'key':{'type':Sequelize[_0x11ea('0x5')]},'keyType':{'type':Sequelize[_0x11ea('0x2')](_0x11ea('0x3'),_0x11ea('0x6'),_0x11ea('0x7'))},'keyContent':{'type':Sequelize[_0x11ea('0x5')]},'idField':{'type':Sequelize[_0x11ea('0x5')]},'nameField':{'type':Sequelize[_0x11ea('0x5')]},'customField':{'type':Sequelize[_0x11ea('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11ea('0x5')]}}; \ No newline at end of file +var _0x0bdb=['sequelize','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0xcc1624,_0x33a1ef){var _0x484741=function(_0xff8fc5){while(--_0xff8fc5){_0xcc1624['push'](_0xcc1624['shift']());}};_0x484741(++_0x33a1ef);}(_0x0bdb,0x1d8));var _0xb0bd=function(_0x3b2b64,_0x123b84){_0x3b2b64=_0x3b2b64-0x0;var _0x4c1b54=_0x0bdb[_0x3b2b64];return _0x4c1b54;};'use strict';var Sequelize=require(_0xb0bd('0x0'));module['exports']={'type':{'type':Sequelize[_0xb0bd('0x1')](_0xb0bd('0x2'),_0xb0bd('0x3'),'customVariable','keyValue',_0xb0bd('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb0bd('0x5')]},'key':{'type':Sequelize[_0xb0bd('0x5')]},'keyType':{'type':Sequelize[_0xb0bd('0x1')]('string',_0xb0bd('0x3'),_0xb0bd('0x6'))},'keyContent':{'type':Sequelize[_0xb0bd('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb0bd('0x5')]},'customField':{'type':Sequelize[_0xb0bd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb0bd('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 3e56301..819f069 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 _0xb0e3=['type','VIRTUAL','options','include','rows','catch','show','params','intersection','find','create','body','update','eml-format','rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','then','destroy','sendStatus','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where'];(function(_0x55bdd9,_0x50b4df){var _0xb8e992=function(_0xee67c9){while(--_0xee67c9){_0x55bdd9['push'](_0x55bdd9['shift']());}};_0xb8e992(++_0x50b4df);}(_0xb0e3,0x184));var _0x3b0e=function(_0x508d54,_0x3dcfe){_0x508d54=_0x508d54-0x0;var _0x1e346c=_0xb0e3[_0x508d54];return _0x1e346c;};'use strict';var emlformat=require(_0x3b0e('0x0'));var rimraf=require(_0x3b0e('0x1'));var zipdir=require(_0x3b0e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b0e('0x3'));var moment=require('moment');var BPromise=require(_0x3b0e('0x4'));var Mustache=require(_0x3b0e('0x5'));var util=require(_0x3b0e('0x6'));var path=require(_0x3b0e('0x7'));var sox=require(_0x3b0e('0x8'));var csv=require(_0x3b0e('0x9'));var ejs=require(_0x3b0e('0xa'));var fs=require('fs');var fs_extra=require(_0x3b0e('0xb'));var _=require(_0x3b0e('0xc'));var squel=require(_0x3b0e('0xd'));var crypto=require(_0x3b0e('0xe'));var jsforce=require(_0x3b0e('0xf'));var deskjs=require(_0x3b0e('0x10'));var toCsv=require(_0x3b0e('0x9'));var querystring=require(_0x3b0e('0x11'));var Papa=require(_0x3b0e('0x12'));var Redis=require(_0x3b0e('0x13'));var authService=require(_0x3b0e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3b0e('0x15'));var hardwareService=require(_0x3b0e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x3b0e('0x17'));var config=require(_0x3b0e('0x18'));var licenseUtil=require(_0x3b0e('0x19'));var db=require(_0x3b0e('0x1a'))['db'];function respondWithStatusCode(_0x1e9cc2,_0x2f56a5){_0x2f56a5=_0x2f56a5||0xcc;return function(_0x59f803){if(_0x59f803){return _0x1e9cc2['sendStatus'](_0x2f56a5);}return _0x1e9cc2['status'](_0x2f56a5)[_0x3b0e('0x1b')]();};}function respondWithResult(_0x518980,_0x5eba8a){_0x5eba8a=_0x5eba8a||0xc8;return function(_0x25248c){if(_0x25248c){return _0x518980['status'](_0x5eba8a)['json'](_0x25248c);}};}function respondWithFilteredResult(_0x10ff19,_0x1467d6){return function(_0x1f7091){if(_0x1f7091){var _0x30c5bd=typeof _0x1467d6[_0x3b0e('0x1c')]===_0x3b0e('0x1d')&&typeof _0x1467d6[_0x3b0e('0x1e')]===_0x3b0e('0x1d');var _0x189285=_0x1f7091[_0x3b0e('0x1f')];var _0x502621=_0x30c5bd?0x0:_0x1467d6['offset'];var _0x2cd68f=_0x30c5bd?_0x1f7091[_0x3b0e('0x1f')]:_0x1467d6[_0x3b0e('0x1c')]+_0x1467d6[_0x3b0e('0x1e')];var _0x250ec6;if(_0x2cd68f>=_0x189285){_0x2cd68f=_0x189285;_0x250ec6=0xc8;}else{_0x250ec6=0xce;}_0x10ff19[_0x3b0e('0x20')](_0x250ec6);return _0x10ff19['set'](_0x3b0e('0x21'),_0x502621+'-'+_0x2cd68f+'/'+_0x189285)[_0x3b0e('0x22')](_0x1f7091);}return null;};}function patchUpdates(_0x1affd4){return function(_0x4dd61a){try{jsonpatch[_0x3b0e('0x23')](_0x4dd61a,_0x1affd4,!![]);}catch(_0x505788){return BPromise[_0x3b0e('0x24')](_0x505788);}return _0x4dd61a[_0x3b0e('0x25')]();};}function saveUpdates(_0x59cc8a,_0x515a3d){return function(_0x179957){if(_0x179957){return _0x179957['update'](_0x59cc8a)[_0x3b0e('0x26')](function(_0x2647e2){return _0x2647e2;});}return null;};}function removeEntity(_0x2b72a7,_0x53dcf5){return function(_0x3f1056){if(_0x3f1056){return _0x3f1056[_0x3b0e('0x27')]()[_0x3b0e('0x26')](function(){_0x2b72a7[_0x3b0e('0x20')](0xcc)[_0x3b0e('0x1b')]();});}};}function handleEntityNotFound(_0x16537c,_0x14bc3e){return function(_0x2db57c){if(!_0x2db57c){_0x16537c[_0x3b0e('0x28')](0x194);}return _0x2db57c;};}function handleError(_0x22480a,_0x33690c){_0x33690c=_0x33690c||0x1f4;return function(_0x559775){logger['error'](_0x559775['stack']);if(_0x559775['name']){delete _0x559775[_0x3b0e('0x29')];}_0x22480a[_0x3b0e('0x20')](_0x33690c)[_0x3b0e('0x2a')](_0x559775);};}exports[_0x3b0e('0x2b')]=function(_0x34706d,_0x119cdf){var _0x132057={},_0x44c964={},_0x5638dc={'count':0x0,'rows':[]};var _0x35f077=_[_0x3b0e('0x2c')](db[_0x3b0e('0x2d')][_0x3b0e('0x2e')],function(_0x5e4f0f){return{'name':_0x5e4f0f[_0x3b0e('0x2f')],'type':_0x5e4f0f['type'][_0x3b0e('0x30')]};});_0x44c964[_0x3b0e('0x31')]=_['map'](_0x35f077,_0x3b0e('0x29'));_0x44c964[_0x3b0e('0x32')]=_[_0x3b0e('0x33')](_0x34706d[_0x3b0e('0x32')]);_0x44c964['filters']=_['intersection'](_0x44c964[_0x3b0e('0x31')],_0x44c964[_0x3b0e('0x32')]);_0x132057[_0x3b0e('0x34')]=_['intersection'](_0x44c964[_0x3b0e('0x31')],qs[_0x3b0e('0x35')](_0x34706d['query']['fields']));_0x132057[_0x3b0e('0x34')]=_0x132057[_0x3b0e('0x34')][_0x3b0e('0x36')]?_0x132057[_0x3b0e('0x34')]:_0x44c964[_0x3b0e('0x31')];if(!_0x34706d['query']['hasOwnProperty'](_0x3b0e('0x37'))){_0x132057['limit']=qs[_0x3b0e('0x1e')](_0x34706d['query']['limit']);_0x132057[_0x3b0e('0x1c')]=qs[_0x3b0e('0x1c')](_0x34706d[_0x3b0e('0x32')]['offset']);}_0x132057[_0x3b0e('0x38')]=qs[_0x3b0e('0x39')](_0x34706d[_0x3b0e('0x32')][_0x3b0e('0x39')]);_0x132057['where']=qs[_0x3b0e('0x3a')](_['pick'](_0x34706d[_0x3b0e('0x32')],_0x44c964['filters']),_0x35f077);if(_0x34706d['query'][_0x3b0e('0x3b')]){_0x132057['where']=_[_0x3b0e('0x3c')](_0x132057[_0x3b0e('0x3d')],{'$or':_['map'](_0x35f077,function(_0x4fefd2){if(_0x4fefd2[_0x3b0e('0x3e')]!==_0x3b0e('0x3f')){var _0x39f3dd={};_0x39f3dd[_0x4fefd2['name']]={'$like':'%'+_0x34706d[_0x3b0e('0x32')][_0x3b0e('0x3b')]+'%'};return _0x39f3dd;}})});}_0x132057=_[_0x3b0e('0x3c')]({},_0x132057,_0x34706d[_0x3b0e('0x40')]);var _0x5ccc30={'where':_0x132057[_0x3b0e('0x3d')]};return db[_0x3b0e('0x2d')][_0x3b0e('0x1f')](_0x5ccc30)[_0x3b0e('0x26')](function(_0x56b9d8){_0x5638dc['count']=_0x56b9d8;if(_0x34706d['query']['includeAll']){_0x132057[_0x3b0e('0x41')]=[{'all':!![]}];}return db[_0x3b0e('0x2d')]['findAll'](_0x132057);})[_0x3b0e('0x26')](function(_0xecd5f1){_0x5638dc[_0x3b0e('0x42')]=_0xecd5f1;return _0x5638dc;})[_0x3b0e('0x26')](respondWithFilteredResult(_0x119cdf,_0x132057))[_0x3b0e('0x43')](handleError(_0x119cdf,null));};exports[_0x3b0e('0x44')]=function(_0x341adc,_0x25e1cf){var _0x3f74={'raw':!![],'where':{'id':_0x341adc[_0x3b0e('0x45')]['id']}},_0x1dfdd1={};_0x1dfdd1[_0x3b0e('0x31')]=_[_0x3b0e('0x33')](db[_0x3b0e('0x2d')]['rawAttributes']);_0x1dfdd1[_0x3b0e('0x32')]=_[_0x3b0e('0x33')](_0x341adc['query']);_0x1dfdd1['filters']=_['intersection'](_0x1dfdd1['model'],_0x1dfdd1[_0x3b0e('0x32')]);_0x3f74[_0x3b0e('0x34')]=_[_0x3b0e('0x46')](_0x1dfdd1[_0x3b0e('0x31')],qs[_0x3b0e('0x35')](_0x341adc['query'][_0x3b0e('0x35')]));_0x3f74[_0x3b0e('0x34')]=_0x3f74[_0x3b0e('0x34')][_0x3b0e('0x36')]?_0x3f74[_0x3b0e('0x34')]:_0x1dfdd1[_0x3b0e('0x31')];if(_0x341adc['query']['includeAll']){_0x3f74['include']=[{'all':!![]}];}_0x3f74=_[_0x3b0e('0x3c')]({},_0x3f74,_0x341adc[_0x3b0e('0x40')]);return db[_0x3b0e('0x2d')][_0x3b0e('0x47')](_0x3f74)[_0x3b0e('0x26')](handleEntityNotFound(_0x25e1cf,null))[_0x3b0e('0x26')](respondWithResult(_0x25e1cf,null))[_0x3b0e('0x43')](handleError(_0x25e1cf,null));};exports['create']=function(_0x2f5e89,_0x52dbbd){return db['VtigerField'][_0x3b0e('0x48')](_0x2f5e89[_0x3b0e('0x49')],{})['then'](respondWithResult(_0x52dbbd,0xc9))[_0x3b0e('0x43')](handleError(_0x52dbbd,null));};exports[_0x3b0e('0x4a')]=function(_0x1a49a6,_0x36f0ce){if(_0x1a49a6[_0x3b0e('0x49')]['id']){delete _0x1a49a6['body']['id'];}return db[_0x3b0e('0x2d')]['find']({'where':{'id':_0x1a49a6['params']['id']}})[_0x3b0e('0x26')](handleEntityNotFound(_0x36f0ce,null))[_0x3b0e('0x26')](saveUpdates(_0x1a49a6[_0x3b0e('0x49')],null))[_0x3b0e('0x26')](respondWithResult(_0x36f0ce,null))[_0x3b0e('0x43')](handleError(_0x36f0ce,null));};exports[_0x3b0e('0x27')]=function(_0x111be7,_0x168d80){return db[_0x3b0e('0x2d')]['find']({'where':{'id':_0x111be7[_0x3b0e('0x45')]['id']}})[_0x3b0e('0x26')](handleEntityNotFound(_0x168d80,null))[_0x3b0e('0x26')](removeEntity(_0x168d80,null))['catch'](handleError(_0x168d80,null));}; \ No newline at end of file +var _0x05dd=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','VtigerField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','fields','options','find','body'];(function(_0x3d6bee,_0x26a478){var _0x505f84=function(_0x5d2301){while(--_0x5d2301){_0x3d6bee['push'](_0x3d6bee['shift']());}};_0x505f84(++_0x26a478);}(_0x05dd,0x134));var _0xd05d=function(_0xa91f01,_0x169324){_0xa91f01=_0xa91f01-0x0;var _0x5d9610=_0x05dd[_0xa91f01];return _0x5d9610;};'use strict';var emlformat=require(_0xd05d('0x0'));var rimraf=require(_0xd05d('0x1'));var zipdir=require(_0xd05d('0x2'));var jsonpatch=require(_0xd05d('0x3'));var rp=require('request-promise');var moment=require(_0xd05d('0x4'));var BPromise=require(_0xd05d('0x5'));var Mustache=require(_0xd05d('0x6'));var util=require(_0xd05d('0x7'));var path=require(_0xd05d('0x8'));var sox=require(_0xd05d('0x9'));var csv=require(_0xd05d('0xa'));var ejs=require(_0xd05d('0xb'));var fs=require('fs');var fs_extra=require(_0xd05d('0xc'));var _=require(_0xd05d('0xd'));var squel=require(_0xd05d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd05d('0xf'));var toCsv=require(_0xd05d('0xa'));var querystring=require(_0xd05d('0x10'));var Papa=require('papaparse');var Redis=require(_0xd05d('0x11'));var authService=require(_0xd05d('0x12'));var qs=require(_0xd05d('0x13'));var as=require(_0xd05d('0x14'));var hardwareService=require(_0xd05d('0x15'));var logger=require('../../config/logger')(_0xd05d('0x16'));var utils=require(_0xd05d('0x17'));var config=require(_0xd05d('0x18'));var licenseUtil=require(_0xd05d('0x19'));var db=require(_0xd05d('0x1a'))['db'];function respondWithStatusCode(_0x3a0eac,_0x4a9633){_0x4a9633=_0x4a9633||0xcc;return function(_0x2ea58d){if(_0x2ea58d){return _0x3a0eac[_0xd05d('0x1b')](_0x4a9633);}return _0x3a0eac[_0xd05d('0x1c')](_0x4a9633)['end']();};}function respondWithResult(_0x826493,_0x11a4b3){_0x11a4b3=_0x11a4b3||0xc8;return function(_0x114a91){if(_0x114a91){return _0x826493[_0xd05d('0x1c')](_0x11a4b3)[_0xd05d('0x1d')](_0x114a91);}};}function respondWithFilteredResult(_0x5ce1d9,_0x587987){return function(_0x527173){if(_0x527173){var _0x5803e4=typeof _0x587987[_0xd05d('0x1e')]===_0xd05d('0x1f')&&typeof _0x587987[_0xd05d('0x20')]===_0xd05d('0x1f');var _0x40b7ae=_0x527173[_0xd05d('0x21')];var _0x2969ed=_0x5803e4?0x0:_0x587987['offset'];var _0x5b99bd=_0x5803e4?_0x527173[_0xd05d('0x21')]:_0x587987[_0xd05d('0x1e')]+_0x587987[_0xd05d('0x20')];var _0x193dc8;if(_0x5b99bd>=_0x40b7ae){_0x5b99bd=_0x40b7ae;_0x193dc8=0xc8;}else{_0x193dc8=0xce;}_0x5ce1d9[_0xd05d('0x1c')](_0x193dc8);return _0x5ce1d9[_0xd05d('0x22')](_0xd05d('0x23'),_0x2969ed+'-'+_0x5b99bd+'/'+_0x40b7ae)['json'](_0x527173);}return null;};}function patchUpdates(_0x2a20c3){return function(_0x24ae07){try{jsonpatch[_0xd05d('0x24')](_0x24ae07,_0x2a20c3,!![]);}catch(_0x4c284f){return BPromise[_0xd05d('0x25')](_0x4c284f);}return _0x24ae07[_0xd05d('0x26')]();};}function saveUpdates(_0x541892,_0x4ecf14){return function(_0x5abde8){if(_0x5abde8){return _0x5abde8[_0xd05d('0x27')](_0x541892)[_0xd05d('0x28')](function(_0xac3592){return _0xac3592;});}return null;};}function removeEntity(_0x116e5e,_0x31a125){return function(_0x1eb0bb){if(_0x1eb0bb){return _0x1eb0bb[_0xd05d('0x29')]()[_0xd05d('0x28')](function(){_0x116e5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3534ba,_0x206a59){return function(_0x49bec0){if(!_0x49bec0){_0x3534ba[_0xd05d('0x1b')](0x194);}return _0x49bec0;};}function handleError(_0x54af4b,_0x3d9f41){_0x3d9f41=_0x3d9f41||0x1f4;return function(_0x2a37e0){logger['error'](_0x2a37e0['stack']);if(_0x2a37e0[_0xd05d('0x2a')]){delete _0x2a37e0[_0xd05d('0x2a')];}_0x54af4b['status'](_0x3d9f41)[_0xd05d('0x2b')](_0x2a37e0);};}exports[_0xd05d('0x2c')]=function(_0x128e90,_0x19e175){var _0x458250={},_0x52ba6f={},_0x24736d={'count':0x0,'rows':[]};var _0x48c790=_[_0xd05d('0x2d')](db[_0xd05d('0x2e')][_0xd05d('0x2f')],function(_0x2bcece){return{'name':_0x2bcece[_0xd05d('0x30')],'type':_0x2bcece['type']['key']};});_0x52ba6f[_0xd05d('0x31')]=_['map'](_0x48c790,_0xd05d('0x2a'));_0x52ba6f[_0xd05d('0x32')]=_[_0xd05d('0x33')](_0x128e90[_0xd05d('0x32')]);_0x52ba6f[_0xd05d('0x34')]=_[_0xd05d('0x35')](_0x52ba6f[_0xd05d('0x31')],_0x52ba6f[_0xd05d('0x32')]);_0x458250[_0xd05d('0x36')]=_['intersection'](_0x52ba6f[_0xd05d('0x31')],qs['fields'](_0x128e90['query']['fields']));_0x458250['attributes']=_0x458250[_0xd05d('0x36')][_0xd05d('0x37')]?_0x458250[_0xd05d('0x36')]:_0x52ba6f[_0xd05d('0x31')];if(!_0x128e90['query'][_0xd05d('0x38')](_0xd05d('0x39'))){_0x458250[_0xd05d('0x20')]=qs[_0xd05d('0x20')](_0x128e90[_0xd05d('0x32')]['limit']);_0x458250[_0xd05d('0x1e')]=qs['offset'](_0x128e90[_0xd05d('0x32')][_0xd05d('0x1e')]);}_0x458250[_0xd05d('0x3a')]=qs[_0xd05d('0x3b')](_0x128e90[_0xd05d('0x32')]['sort']);_0x458250['where']=qs[_0xd05d('0x34')](_[_0xd05d('0x3c')](_0x128e90[_0xd05d('0x32')],_0x52ba6f['filters']),_0x48c790);if(_0x128e90[_0xd05d('0x32')][_0xd05d('0x3d')]){_0x458250[_0xd05d('0x3e')]=_['merge'](_0x458250[_0xd05d('0x3e')],{'$or':_[_0xd05d('0x2d')](_0x48c790,function(_0x56f421){if(_0x56f421[_0xd05d('0x3f')]!==_0xd05d('0x40')){var _0x1f79ca={};_0x1f79ca[_0x56f421['name']]={'$like':'%'+_0x128e90[_0xd05d('0x32')][_0xd05d('0x3d')]+'%'};return _0x1f79ca;}})});}_0x458250=_[_0xd05d('0x41')]({},_0x458250,_0x128e90['options']);var _0x2a4a51={'where':_0x458250[_0xd05d('0x3e')]};return db[_0xd05d('0x2e')][_0xd05d('0x21')](_0x2a4a51)[_0xd05d('0x28')](function(_0x358758){_0x24736d['count']=_0x358758;if(_0x128e90[_0xd05d('0x32')][_0xd05d('0x42')]){_0x458250[_0xd05d('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0xd05d('0x44')](_0x458250);})[_0xd05d('0x28')](function(_0x5c2fec){_0x24736d[_0xd05d('0x45')]=_0x5c2fec;return _0x24736d;})[_0xd05d('0x28')](respondWithFilteredResult(_0x19e175,_0x458250))[_0xd05d('0x46')](handleError(_0x19e175,null));};exports[_0xd05d('0x47')]=function(_0x2718cb,_0x234e2f){var _0x2d18d6={'raw':!![],'where':{'id':_0x2718cb[_0xd05d('0x48')]['id']}},_0x1663af={};_0x1663af[_0xd05d('0x31')]=_[_0xd05d('0x33')](db[_0xd05d('0x2e')][_0xd05d('0x2f')]);_0x1663af[_0xd05d('0x32')]=_[_0xd05d('0x33')](_0x2718cb[_0xd05d('0x32')]);_0x1663af[_0xd05d('0x34')]=_['intersection'](_0x1663af['model'],_0x1663af['query']);_0x2d18d6['attributes']=_[_0xd05d('0x35')](_0x1663af[_0xd05d('0x31')],qs[_0xd05d('0x49')](_0x2718cb['query'][_0xd05d('0x49')]));_0x2d18d6['attributes']=_0x2d18d6[_0xd05d('0x36')][_0xd05d('0x37')]?_0x2d18d6[_0xd05d('0x36')]:_0x1663af[_0xd05d('0x31')];if(_0x2718cb['query']['includeAll']){_0x2d18d6[_0xd05d('0x43')]=[{'all':!![]}];}_0x2d18d6=_['merge']({},_0x2d18d6,_0x2718cb[_0xd05d('0x4a')]);return db[_0xd05d('0x2e')][_0xd05d('0x4b')](_0x2d18d6)[_0xd05d('0x28')](handleEntityNotFound(_0x234e2f,null))[_0xd05d('0x28')](respondWithResult(_0x234e2f,null))[_0xd05d('0x46')](handleError(_0x234e2f,null));};exports['create']=function(_0x3de25c,_0x3d7fe6){return db['VtigerField']['create'](_0x3de25c[_0xd05d('0x4c')],{})[_0xd05d('0x28')](respondWithResult(_0x3d7fe6,0xc9))['catch'](handleError(_0x3d7fe6,null));};exports['update']=function(_0x5eed92,_0x215631){if(_0x5eed92[_0xd05d('0x4c')]['id']){delete _0x5eed92[_0xd05d('0x4c')]['id'];}return db[_0xd05d('0x2e')][_0xd05d('0x4b')]({'where':{'id':_0x5eed92['params']['id']}})[_0xd05d('0x28')](handleEntityNotFound(_0x215631,null))[_0xd05d('0x28')](saveUpdates(_0x5eed92[_0xd05d('0x4c')],null))['then'](respondWithResult(_0x215631,null))['catch'](handleError(_0x215631,null));};exports[_0xd05d('0x29')]=function(_0x81e49a,_0x41e4e6){return db[_0xd05d('0x2e')]['find']({'where':{'id':_0x81e49a[_0xd05d('0x48')]['id']}})['then'](handleEntityNotFound(_0x41e4e6,null))['then'](removeEntity(_0x41e4e6,null))[_0xd05d('0x46')](handleError(_0x41e4e6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 70bffc8..147c2f1 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 _0xf8ec=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x309c93,_0x549e2e){var _0x25567d=function(_0x3f1e43){while(--_0x3f1e43){_0x309c93['push'](_0x309c93['shift']());}};_0x25567d(++_0x549e2e);}(_0xf8ec,0x192));var _0xcf8e=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xf8ec[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xcf8e('0x0'));var util=require(_0xcf8e('0x1'));var logger=require(_0xcf8e('0x2'))(_0xcf8e('0x3'));var moment=require(_0xcf8e('0x4'));var BPromise=require(_0xcf8e('0x5'));var rp=require(_0xcf8e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf8e('0x7'));var config=require(_0xcf8e('0x8'));var attributes=require(_0xcf8e('0x9'));module[_0xcf8e('0xa')]=function(_0xe78817,_0x281182){return _0xe78817['define'](_0xcf8e('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xcf8e('0xc'),'fields':[_0xcf8e('0xd'),_0xcf8e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x10b0=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields'];(function(_0x19b35e,_0x5488bf){var _0x1b589c=function(_0x54ce4b){while(--_0x54ce4b){_0x19b35e['push'](_0x19b35e['shift']());}};_0x1b589c(++_0x5488bf);}(_0x10b0,0x79));var _0x010b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x10b0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x010b('0x0'));var util=require(_0x010b('0x1'));var logger=require(_0x010b('0x2'))(_0x010b('0x3'));var moment=require(_0x010b('0x4'));var BPromise=require(_0x010b('0x5'));var rp=require(_0x010b('0x6'));var fs=require('fs');var path=require(_0x010b('0x7'));var rimraf=require(_0x010b('0x8'));var config=require(_0x010b('0x9'));var attributes=require(_0x010b('0xa'));module['exports']=function(_0x568064,_0x632c3e){return _0x568064[_0x010b('0xb')](_0x010b('0xc'),attributes,{'tableName':_0x010b('0xd'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x010b('0xe')],'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 99a063c..6991ae8 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 _0x003a=['client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe453a3,_0x1848f0){var _0x6d49fb=function(_0x4750a8){while(--_0x4750a8){_0xe453a3['push'](_0xe453a3['shift']());}};_0x6d49fb(++_0x1848f0);}(_0x003a,0xdc));var _0xa003=function(_0x8acd9f,_0x211497){_0x8acd9f=_0x8acd9f-0x0;var _0x4dd98c=_0x003a[_0x8acd9f];return _0x4dd98c;};'use strict';var _=require(_0xa003('0x0'));var util=require(_0xa003('0x1'));var moment=require('moment');var BPromise=require(_0xa003('0x2'));var rs=require(_0xa003('0x3'));var fs=require('fs');var Redis=require(_0xa003('0x4'));var db=require(_0xa003('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa003('0x6'))(_0xa003('0x7'));var config=require(_0xa003('0x8'));var jayson=require(_0xa003('0x9'));var client=jayson[_0xa003('0xa')][_0xa003('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1446e9,_0x5a855c,_0x475521){return new BPromise(function(_0x5338fb,_0x3f36ed){return client[_0xa003('0xc')](_0x1446e9,_0x475521)['then'](function(_0x50270b){logger['info'](_0xa003('0xd'),_0x5a855c,_0xa003('0xe'));logger[_0xa003('0xf')](_0xa003('0x10'),_0x5a855c,_0xa003('0xe'),JSON[_0xa003('0x11')](_0x50270b));if(_0x50270b[_0xa003('0x12')]){if(_0x50270b['error'][_0xa003('0x13')]===0x1f4){logger['error'](_0xa003('0xd'),_0x5a855c,_0x50270b[_0xa003('0x12')][_0xa003('0x14')]);return _0x3f36ed(_0x50270b['error'][_0xa003('0x14')]);}logger[_0xa003('0x12')]('VtigerField,\x20%s,\x20%s',_0x5a855c,_0x50270b[_0xa003('0x12')]['message']);return _0x5338fb(_0x50270b[_0xa003('0x12')][_0xa003('0x14')]);}else{logger[_0xa003('0x15')](_0xa003('0xd'),_0x5a855c,'request\x20sent');_0x5338fb(_0x50270b[_0xa003('0x16')][_0xa003('0x14')]);}})['catch'](function(_0x5b9abc){logger[_0xa003('0x12')](_0xa003('0xd'),_0x5a855c,_0x5b9abc);_0x3f36ed(_0x5b9abc);});});} \ No newline at end of file +var _0x9c46=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x165303,_0x4c4d68){var _0x5ac782=function(_0x5d1dfd){while(--_0x5d1dfd){_0x165303['push'](_0x165303['shift']());}};_0x5ac782(++_0x4c4d68);}(_0x9c46,0x1d2));var _0x69c4=function(_0x4d4c04,_0x52bfe4){_0x4d4c04=_0x4d4c04-0x0;var _0x2a5748=_0x9c46[_0x4d4c04];return _0x2a5748;};'use strict';var _=require(_0x69c4('0x0'));var util=require(_0x69c4('0x1'));var moment=require(_0x69c4('0x2'));var BPromise=require(_0x69c4('0x3'));var rs=require(_0x69c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69c4('0x5'))['db'];var utils=require(_0x69c4('0x6'));var logger=require(_0x69c4('0x7'))(_0x69c4('0x8'));var config=require(_0x69c4('0x9'));var jayson=require(_0x69c4('0xa'));var client=jayson[_0x69c4('0xb')][_0x69c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f9a5a,_0x2b2f57,_0x8b8b9a){return new BPromise(function(_0x342e59,_0x2f5a55){return client['request'](_0x1f9a5a,_0x8b8b9a)['then'](function(_0x4ed1de){logger['info'](_0x69c4('0xd'),_0x2b2f57,_0x69c4('0xe'));logger[_0x69c4('0xf')](_0x69c4('0x10'),_0x2b2f57,'request\x20sent',JSON[_0x69c4('0x11')](_0x4ed1de));if(_0x4ed1de[_0x69c4('0x12')]){if(_0x4ed1de[_0x69c4('0x12')][_0x69c4('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x2b2f57,_0x4ed1de[_0x69c4('0x12')][_0x69c4('0x14')]);return _0x2f5a55(_0x4ed1de[_0x69c4('0x12')]['message']);}logger[_0x69c4('0x12')](_0x69c4('0xd'),_0x2b2f57,_0x4ed1de[_0x69c4('0x12')]['message']);return _0x342e59(_0x4ed1de[_0x69c4('0x12')][_0x69c4('0x14')]);}else{logger['info'](_0x69c4('0xd'),_0x2b2f57,_0x69c4('0xe'));_0x342e59(_0x4ed1de[_0x69c4('0x15')]['message']);}})[_0x69c4('0x16')](function(_0x212325){logger[_0x69c4('0x12')](_0x69c4('0xd'),_0x2b2f57,_0x212325);_0x2f5a55(_0x212325);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index bf453c5..51a967e 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 _0x37de=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0x37de,0xed));var _0xe37d=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x37de[_0x45313f];return _0x402910;};'use strict';var multer=require(_0xe37d('0x0'));var util=require(_0xe37d('0x1'));var path=require(_0xe37d('0x2'));var timeout=require(_0xe37d('0x3'));var express=require('express');var router=express[_0xe37d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe37d('0x5'));var config=require(_0xe37d('0x6'));var controller=require('./intZendeskAccount.controller');router[_0xe37d('0x7')]('/',auth['isAuthenticated'](),controller[_0xe37d('0x8')]);router[_0xe37d('0x7')](_0xe37d('0x9'),auth[_0xe37d('0xa')](),controller[_0xe37d('0xb')]);router['get'](_0xe37d('0xc'),auth[_0xe37d('0xa')](),controller[_0xe37d('0xd')]);router[_0xe37d('0x7')](_0xe37d('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xe37d('0xa')](),controller[_0xe37d('0xf')]);router['post'](_0xe37d('0xc'),auth[_0xe37d('0xa')](),controller['addConfiguration']);router[_0xe37d('0x10')](_0xe37d('0x9'),auth[_0xe37d('0xa')](),controller[_0xe37d('0x11')]);router[_0xe37d('0x12')](_0xe37d('0x9'),auth[_0xe37d('0xa')](),controller[_0xe37d('0x13')]);module[_0xe37d('0x14')]=router; \ No newline at end of file +var _0xf2b2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','addConfiguration'];(function(_0x301b7a,_0x2944b8){var _0x2d86ac=function(_0x2204b7){while(--_0x2204b7){_0x301b7a['push'](_0x301b7a['shift']());}};_0x2d86ac(++_0x2944b8);}(_0xf2b2,0x1d1));var _0x2f2b=function(_0x11e1ec,_0x463a63){_0x11e1ec=_0x11e1ec-0x0;var _0x4017bc=_0xf2b2[_0x11e1ec];return _0x4017bc;};'use strict';var multer=require('multer');var util=require(_0x2f2b('0x0'));var path=require(_0x2f2b('0x1'));var timeout=require(_0x2f2b('0x2'));var express=require(_0x2f2b('0x3'));var router=express['Router']();var fs_extra=require(_0x2f2b('0x4'));var auth=require(_0x2f2b('0x5'));var interaction=require(_0x2f2b('0x6'));var config=require(_0x2f2b('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x2f2b('0x8')]('/',auth[_0x2f2b('0x9')](),controller[_0x2f2b('0xa')]);router[_0x2f2b('0x8')](_0x2f2b('0xb'),auth[_0x2f2b('0x9')](),controller[_0x2f2b('0xc')]);router[_0x2f2b('0x8')](_0x2f2b('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2f2b('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2f2b('0xe')]);router[_0x2f2b('0xf')]('/',auth[_0x2f2b('0x9')](),controller[_0x2f2b('0x10')]);router[_0x2f2b('0xf')]('/:id/configurations',auth[_0x2f2b('0x9')](),controller[_0x2f2b('0x11')]);router[_0x2f2b('0x12')](_0x2f2b('0xb'),auth[_0x2f2b('0x9')](),controller[_0x2f2b('0x13')]);router[_0x2f2b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2f2b('0x15')]);module[_0x2f2b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index d42d2e8..2d76e35 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 _0x6d11=['token','integrationTab','sequelize','exports','STRING','ENUM','password'];(function(_0x4b43ce,_0x29237c){var _0x1c36e0=function(_0x54c4d5){while(--_0x54c4d5){_0x4b43ce['push'](_0x4b43ce['shift']());}};_0x1c36e0(++_0x29237c);}(_0x6d11,0xbf));var _0x16d1=function(_0x4fd27b,_0x16905f){_0x4fd27b=_0x4fd27b-0x0;var _0x3e5b4d=_0x6d11[_0x4fd27b];return _0x3e5b4d;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x16d1('0x2')]},'token':{'type':Sequelize[_0x16d1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x4'),_0x16d1('0x5')),'defaultValue':_0x16d1('0x4')},'serverUrl':{'type':Sequelize[_0x16d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x6'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf8af=['password','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x37f7f8,_0x401c22){var _0x24b54f=function(_0x4a1d9c){while(--_0x4a1d9c){_0x37f7f8['push'](_0x37f7f8['shift']());}};_0x24b54f(++_0x401c22);}(_0xf8af,0x8b));var _0xff8a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf8af[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xff8a('0x0'));module['exports']={'name':{'type':Sequelize[_0xff8a('0x1')]},'description':{'type':Sequelize[_0xff8a('0x1')]},'username':{'type':Sequelize[_0xff8a('0x1')],'unique':_0xff8a('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xff8a('0x1')]},'remoteUri':{'type':Sequelize[_0xff8a('0x1')],'unique':_0xff8a('0x3')},'authType':{'type':Sequelize[_0xff8a('0x4')]('password','token'),'defaultValue':_0xff8a('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xff8a('0x4')](_0xff8a('0x6'),_0xff8a('0x7')),'defaultValue':_0xff8a('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c10ff19..29d947c 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 _0x0bb5=['offset','limit','undefined','count','set','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','substring','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x1ce00b,_0x24359c){var _0x2f8f37=function(_0x92bdf2){while(--_0x92bdf2){_0x1ce00b['push'](_0x1ce00b['shift']());}};_0x2f8f37(++_0x24359c);}(_0x0bb5,0x148));var _0x50bb=function(_0x1ec5dc,_0xc37e68){_0x1ec5dc=_0x1ec5dc-0x0;var _0x4d2682=_0x0bb5[_0x1ec5dc];return _0x4d2682;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x50bb('0x19'));function respondWithStatusCode(_0x58837d,_0x283f04){_0x283f04=_0x283f04||0xcc;return function(_0xd8ab27){if(_0xd8ab27){return _0x58837d[_0x50bb('0x1a')](_0x283f04);}return _0x58837d['status'](_0x283f04)[_0x50bb('0x1b')]();};}function respondWithResult(_0x309986,_0x3094f2){_0x3094f2=_0x3094f2||0xc8;return function(_0x5244b0){if(_0x5244b0){return _0x309986[_0x50bb('0x1c')](_0x3094f2)['json'](_0x5244b0);}};}function respondWithFilteredResult(_0x21befa,_0x3e1a51){return function(_0x253073){if(_0x253073){var _0x42ffab=typeof _0x3e1a51[_0x50bb('0x1d')]==='undefined'&&typeof _0x3e1a51[_0x50bb('0x1e')]===_0x50bb('0x1f');var _0x4b1f5f=_0x253073[_0x50bb('0x20')];var _0x4796ec=_0x42ffab?0x0:_0x3e1a51[_0x50bb('0x1d')];var _0x431ed4=_0x42ffab?_0x253073['count']:_0x3e1a51['offset']+_0x3e1a51[_0x50bb('0x1e')];var _0x1499dc;if(_0x431ed4>=_0x4b1f5f){_0x431ed4=_0x4b1f5f;_0x1499dc=0xc8;}else{_0x1499dc=0xce;}_0x21befa[_0x50bb('0x1c')](_0x1499dc);return _0x21befa[_0x50bb('0x21')]('Content-Range',_0x4796ec+'-'+_0x431ed4+'/'+_0x4b1f5f)[_0x50bb('0x22')](_0x253073);}return null;};}function patchUpdates(_0x32bfc3){return function(_0x4020a0){try{jsonpatch['apply'](_0x4020a0,_0x32bfc3,!![]);}catch(_0x3104c8){return BPromise[_0x50bb('0x23')](_0x3104c8);}return _0x4020a0[_0x50bb('0x24')]();};}function saveUpdates(_0x4825f8,_0x1dbba2){return function(_0x4cc7f9){if(_0x4cc7f9){return _0x4cc7f9[_0x50bb('0x25')](_0x4825f8)[_0x50bb('0x26')](function(_0x1a2a0b){return _0x1a2a0b;});}return null;};}function removeEntity(_0x2ee87a,_0x846311){return function(_0x342078){if(_0x342078){return _0x342078['destroy']()[_0x50bb('0x26')](function(){_0x2ee87a[_0x50bb('0x1c')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x3462c1,_0x5234d7){return function(_0x75fea6){if(!_0x75fea6){_0x3462c1['sendStatus'](0x194);}return _0x75fea6;};}function handleError(_0x55e87b,_0x2befd9){_0x2befd9=_0x2befd9||0x1f4;return function(_0x491632){logger['error'](_0x491632[_0x50bb('0x27')]);if(_0x491632[_0x50bb('0x28')]){delete _0x491632[_0x50bb('0x28')];}_0x55e87b[_0x50bb('0x1c')](_0x2befd9)[_0x50bb('0x29')](_0x491632);};}exports[_0x50bb('0x2a')]=function(_0x41a8ad,_0x41d479){var _0x4f7514={},_0x44ce86={},_0x461cf3={'count':0x0,'rows':[]};var _0x15ee2e=_[_0x50bb('0x2b')](db['ZendeskAccount'][_0x50bb('0x2c')],function(_0x1a62fb){return{'name':_0x1a62fb[_0x50bb('0x2d')],'type':_0x1a62fb[_0x50bb('0x2e')][_0x50bb('0x2f')]};});_0x44ce86[_0x50bb('0x30')]=_[_0x50bb('0x2b')](_0x15ee2e,_0x50bb('0x28'));_0x44ce86[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x41a8ad[_0x50bb('0x31')]);_0x44ce86[_0x50bb('0x33')]=_['intersection'](_0x44ce86[_0x50bb('0x30')],_0x44ce86[_0x50bb('0x31')]);_0x4f7514[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x44ce86[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x36')]));_0x4f7514[_0x50bb('0x34')]=_0x4f7514[_0x50bb('0x34')][_0x50bb('0x37')]?_0x4f7514['attributes']:_0x44ce86[_0x50bb('0x30')];if(!_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x38')](_0x50bb('0x39'))){_0x4f7514[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x41a8ad['query']['limit']);_0x4f7514[_0x50bb('0x1d')]=qs['offset'](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x1d')]);}_0x4f7514[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x41a8ad[_0x50bb('0x31')]['sort']);_0x4f7514[_0x50bb('0x3c')]=qs['filters'](_[_0x50bb('0x3d')](_0x41a8ad[_0x50bb('0x31')],_0x44ce86[_0x50bb('0x33')]),_0x15ee2e);if(_0x41a8ad['query']['filter']){_0x4f7514[_0x50bb('0x3c')]=_[_0x50bb('0x3e')](_0x4f7514[_0x50bb('0x3c')],{'$or':_[_0x50bb('0x2b')](_0x15ee2e,function(_0x51750b){if(_0x51750b[_0x50bb('0x2e')]!=='VIRTUAL'){var _0x52059b={};_0x52059b[_0x51750b[_0x50bb('0x28')]]={'$like':'%'+_0x41a8ad['query'][_0x50bb('0x3f')]+'%'};return _0x52059b;}})});}_0x4f7514=_[_0x50bb('0x3e')]({},_0x4f7514,_0x41a8ad[_0x50bb('0x40')]);var _0x1f156e={'where':_0x4f7514[_0x50bb('0x3c')]};return db[_0x50bb('0x41')][_0x50bb('0x20')](_0x1f156e)[_0x50bb('0x26')](function(_0x46039a){_0x461cf3[_0x50bb('0x20')]=_0x46039a;if(_0x41a8ad['query']['includeAll']){_0x4f7514[_0x50bb('0x42')]=[{'all':!![]}];}return db[_0x50bb('0x41')][_0x50bb('0x43')](_0x4f7514);})[_0x50bb('0x26')](function(_0x5e8085){_0x461cf3[_0x50bb('0x44')]=_0x5e8085;return _0x461cf3;})['then'](respondWithFilteredResult(_0x41d479,_0x4f7514))[_0x50bb('0x45')](handleError(_0x41d479,null));};exports[_0x50bb('0x46')]=function(_0x379944,_0x40748d){var _0x1c438b={'raw':![],'where':{'id':_0x379944[_0x50bb('0x47')]['id']}},_0x355726={};_0x355726[_0x50bb('0x30')]=_[_0x50bb('0x32')](db[_0x50bb('0x41')][_0x50bb('0x2c')]);_0x355726[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x379944[_0x50bb('0x31')]);_0x355726[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x355726['model'],_0x355726[_0x50bb('0x31')]);_0x1c438b['attributes']=_[_0x50bb('0x35')](_0x355726[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x379944[_0x50bb('0x31')][_0x50bb('0x36')]));_0x1c438b[_0x50bb('0x34')]=_0x1c438b[_0x50bb('0x34')][_0x50bb('0x37')]?_0x1c438b[_0x50bb('0x34')]:_0x355726[_0x50bb('0x30')];if(_0x379944[_0x50bb('0x31')][_0x50bb('0x48')]){_0x1c438b[_0x50bb('0x42')]=[{'all':!![]}];}_0x1c438b=_[_0x50bb('0x3e')]({},_0x1c438b,_0x379944['options']);return db[_0x50bb('0x41')]['find'](_0x1c438b)[_0x50bb('0x26')](handleEntityNotFound(_0x40748d,null))[_0x50bb('0x26')](respondWithResult(_0x40748d,null))[_0x50bb('0x45')](handleError(_0x40748d,null));};exports[_0x50bb('0x49')]=function(_0x650e91,_0x39ac1a){return db[_0x50bb('0x41')][_0x50bb('0x49')](_0x650e91['body'],{})[_0x50bb('0x26')](respondWithResult(_0x39ac1a,0xc9))[_0x50bb('0x45')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x25')]=function(_0x13afe2,_0x3659c4){if(_0x13afe2['body']['id']){delete _0x13afe2[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x13afe2[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3659c4,null))['then'](saveUpdates(_0x13afe2['body'],null))[_0x50bb('0x26')](respondWithResult(_0x3659c4,null))['catch'](handleError(_0x3659c4,null));};exports[_0x50bb('0x4c')]=function(_0x57ee0e,_0x4316e4){return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x57ee0e['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x4316e4,null))[_0x50bb('0x26')](removeEntity(_0x4316e4,null))['catch'](handleError(_0x4316e4,null));};exports[_0x50bb('0x4d')]=function(_0x1dff6a,_0x8d62af,_0x3c525c){var _0x55a4a6={};var _0x33e71f={};var _0x46b51e;var _0x2e0032;return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x1dff6a['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x8d62af,null))['then'](function(_0x38a775){if(_0x38a775){_0x46b51e=_0x38a775;_0x33e71f['model']=_['keys'](db[_0x50bb('0x4f')]['rawAttributes']);_0x33e71f['query']=_[_0x50bb('0x32')](_0x1dff6a[_0x50bb('0x31')]);_0x33e71f[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x33e71f[_0x50bb('0x30')],_0x33e71f[_0x50bb('0x31')]);_0x55a4a6[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x33e71f['model'],qs['fields'](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x36')]));_0x55a4a6[_0x50bb('0x34')]=_0x55a4a6[_0x50bb('0x34')][_0x50bb('0x37')]?_0x55a4a6[_0x50bb('0x34')]:_0x33e71f[_0x50bb('0x30')];_0x55a4a6['order']=qs[_0x50bb('0x3b')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3b')]);_0x55a4a6[_0x50bb('0x3c')]=qs[_0x50bb('0x33')](_['pick'](_0x1dff6a[_0x50bb('0x31')],_0x33e71f[_0x50bb('0x33')]));if(_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]){_0x55a4a6[_0x50bb('0x3c')]=_['merge'](_0x55a4a6[_0x50bb('0x3c')],{'$or':_['map'](_0x55a4a6['attributes'],function(_0x170761){var _0x3057f2={};_0x3057f2[_0x170761]={'$like':'%'+_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]+'%'};return _0x3057f2;})});}_0x55a4a6=_[_0x50bb('0x3e')]({},_0x55a4a6,_0x1dff6a[_0x50bb('0x40')]);return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x330299){if(_0x330299){_0x2e0032=_0x330299[_0x50bb('0x37')];if(!_0x1dff6a[_0x50bb('0x31')]['hasOwnProperty'](_0x50bb('0x39'))){_0x55a4a6['limit']=qs[_0x50bb('0x1e')](_0x1dff6a[_0x50bb('0x31')]['limit']);_0x55a4a6[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x1d')]);}return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x2b7df6){if(_0x2b7df6){return _0x2b7df6?{'count':_0x2e0032,'rows':_0x2b7df6}:null;}})[_0x50bb('0x26')](respondWithResult(_0x8d62af,null))['catch'](handleError(_0x8d62af,null));};exports[_0x50bb('0x50')]=function(_0x2dc832,_0x3b17c8,_0x4a226d){if(_0x2dc832[_0x50bb('0x4a')]['id']){delete _0x2dc832[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x2dc832[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3b17c8,null))['then'](function(_0xf47641){if(_0xf47641){_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x51')]=_0xf47641['id'];_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x52')]=integrations[_0x50bb('0x53')](_0x2dc832['body'][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x2e')]);_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x55')]=integrations[_0x50bb('0x56')](_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')]['type']);return db[_0x50bb('0x4f')][_0x50bb('0x49')](_0x2dc832[_0x50bb('0x4a')],{'include':[{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x52')},{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x55')}]});}return null;})[_0x50bb('0x26')](respondWithResult(_0x3b17c8,null))[_0x50bb('0x45')](handleError(_0x3b17c8,null));};exports['getFields']=function(_0x58ad41,_0x5babbc,_0x4159ad){var _0x5ba597='';return db['ZendeskAccount'][_0x50bb('0x4e')]({'where':{'id':_0x58ad41[_0x50bb('0x47')]['id']},'attributes':['id',_0x50bb('0x58'),_0x50bb('0x59'),'token',_0x50bb('0x5a'),_0x50bb('0x5b')]})['then'](handleEntityNotFound(_0x5babbc,null))[_0x50bb('0x26')](function(_0x51e64f){if(_0x51e64f){_0x5ba597=_0x51e64f[_0x50bb('0x5b')];var _0x239a82=_0x5ba597['slice'](-0x1);if(_0x239a82==='/'){_0x5ba597=_0x5ba597[_0x50bb('0x5c')](0x0,_0x5ba597['lastIndexOf'](_0x239a82));}var _0x8f5df6={'method':_0x50bb('0x5d'),'uri':util['format'](_0x50bb('0x5e'),_0x5ba597,_0x50bb('0x5f')),'json':!![]};switch(_0x51e64f[_0x50bb('0x5a')]){case'password':_0x8f5df6[_0x50bb('0x60')]={'Authorization':util[_0x50bb('0x61')](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')]('%s:%s',_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x59')]))['toString']('base64'))};break;case _0x50bb('0x63'):_0x8f5df6[_0x50bb('0x60')]={'Authorization':util['format'](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')](_0x50bb('0x64'),_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x50bb('0x65'))][(_0x50bb('0x66'))](_0x50bb('0x67'));}return rp(_0x8f5df6);}})[_0x50bb('0x26')](function(_0x4b51d4){if(_0x4b51d4){var _0x1975f7=['subject',_0x50bb('0x68'),_0x50bb('0x69'),_0x50bb('0x6a')];_[_0x50bb('0x6b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x217170){return _0x1975f7[_0x50bb('0x6c')](_0x217170['type']);});return{'count':_0x4b51d4[_0x50bb('0x5f')][_0x50bb('0x37')],'rows':_[_0x50bb('0x2b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x5d2dc4){return{'id':_0x5d2dc4['id'],'name':_0x5d2dc4[_0x50bb('0x6d')]>0x7?_0x5d2dc4[_0x50bb('0x6e')]:_0x5d2dc4['type'],'custom':_0x5d2dc4[_0x50bb('0x6d')]>0x7?!![]:![],'options':_0x5d2dc4[_0x50bb('0x6f')]?_0x5d2dc4[_0x50bb('0x6f')]:_0x5d2dc4[_0x50bb('0x70')]?_0x5d2dc4[_0x50bb('0x70')]:[]};})};}})['then'](respondWithResult(_0x5babbc,null))['catch'](function(_0x145cf8){var _0x47e80f=_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?0x1f4:_0x145cf8['statusCode']||0x1f4;logger['error'](_0x50bb('0x72'),_0x50bb('0x73'),_0x47e80f,JSON[_0x50bb('0x74')](_0x145cf8));delete _0x145cf8['name'];if(_0x47e80f===0x191){_0x47e80f=0x190;}_0x5babbc[_0x50bb('0x1c')](_0x47e80f)[_0x50bb('0x29')](_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?{'message':_0x50bb('0x75'),'statusCode':_0x145cf8[_0x50bb('0x76')]}:_0x145cf8);});}; \ No newline at end of file +var _0xd87e=['undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0xd87e,0x1bf));var _0xed87=function(_0x1a188e,_0x1087e6){_0x1a188e=_0x1a188e-0x0;var _0x46f4e=_0xd87e[_0x1a188e];return _0x46f4e;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ffc2d,_0x466f35){_0x466f35=_0x466f35||0xcc;return function(_0x32276e){if(_0x32276e){return _0x4ffc2d[_0xed87('0x18')](_0x466f35);}return _0x4ffc2d[_0xed87('0x19')](_0x466f35)[_0xed87('0x1a')]();};}function respondWithResult(_0x3865c5,_0x52dfe8){_0x52dfe8=_0x52dfe8||0xc8;return function(_0x4494da){if(_0x4494da){return _0x3865c5[_0xed87('0x19')](_0x52dfe8)[_0xed87('0x1b')](_0x4494da);}};}function respondWithFilteredResult(_0x1e9a3d,_0x2f2fd3){return function(_0xd34e0e){if(_0xd34e0e){var _0x173413=typeof _0x2f2fd3[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x2f2fd3['limit']===_0xed87('0x1d');var _0x18ab7d=_0xd34e0e[_0xed87('0x1e')];var _0xfb8a44=_0x173413?0x0:_0x2f2fd3['offset'];var _0x211085=_0x173413?_0xd34e0e[_0xed87('0x1e')]:_0x2f2fd3[_0xed87('0x1c')]+_0x2f2fd3[_0xed87('0x1f')];var _0x98a2ca;if(_0x211085>=_0x18ab7d){_0x211085=_0x18ab7d;_0x98a2ca=0xc8;}else{_0x98a2ca=0xce;}_0x1e9a3d[_0xed87('0x19')](_0x98a2ca);return _0x1e9a3d[_0xed87('0x20')](_0xed87('0x21'),_0xfb8a44+'-'+_0x211085+'/'+_0x18ab7d)[_0xed87('0x1b')](_0xd34e0e);}return null;};}function patchUpdates(_0x52e81c){return function(_0x5a7329){try{jsonpatch['apply'](_0x5a7329,_0x52e81c,!![]);}catch(_0x47c121){return BPromise[_0xed87('0x22')](_0x47c121);}return _0x5a7329['save']();};}function saveUpdates(_0x4191a7,_0x2b0b98){return function(_0x5b1659){if(_0x5b1659){return _0x5b1659[_0xed87('0x23')](_0x4191a7)['then'](function(_0x3d1641){return _0x3d1641;});}return null;};}function removeEntity(_0x24962e,_0x27799a){return function(_0x2a8733){if(_0x2a8733){return _0x2a8733[_0xed87('0x24')]()['then'](function(){_0x24962e[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x41e0d4,_0x320bcc){return function(_0x31c600){if(!_0x31c600){_0x41e0d4[_0xed87('0x18')](0x194);}return _0x31c600;};}function handleError(_0x25a6f7,_0x4735b3){_0x4735b3=_0x4735b3||0x1f4;return function(_0x40b2fa){logger[_0xed87('0x25')](_0x40b2fa[_0xed87('0x26')]);if(_0x40b2fa[_0xed87('0x27')]){delete _0x40b2fa[_0xed87('0x27')];}_0x25a6f7[_0xed87('0x19')](_0x4735b3)['send'](_0x40b2fa);};}exports[_0xed87('0x28')]=function(_0x1c4a65,_0x4eaa44){var _0x3dff74={},_0x33c367={},_0x21c93b={'count':0x0,'rows':[]};var _0x4b259e=_['map'](db[_0xed87('0x29')][_0xed87('0x2a')],function(_0x21ab8a){return{'name':_0x21ab8a['fieldName'],'type':_0x21ab8a[_0xed87('0x2b')][_0xed87('0x2c')]};});_0x33c367[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x4b259e,_0xed87('0x27'));_0x33c367[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x1c4a65[_0xed87('0x2f')]);_0x33c367[_0xed87('0x31')]=_['intersection'](_0x33c367[_0xed87('0x2d')],_0x33c367[_0xed87('0x2f')]);_0x3dff74['attributes']=_[_0xed87('0x32')](_0x33c367['model'],qs[_0xed87('0x33')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x33')]));_0x3dff74[_0xed87('0x34')]=_0x3dff74[_0xed87('0x34')][_0xed87('0x35')]?_0x3dff74[_0xed87('0x34')]:_0x33c367[_0xed87('0x2d')];if(!_0x1c4a65[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x3dff74['limit']=qs[_0xed87('0x1f')](_0x1c4a65[_0xed87('0x2f')]['limit']);_0x3dff74[_0xed87('0x1c')]=qs['offset'](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x1c')]);}_0x3dff74['order']=qs[_0xed87('0x38')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x38')]);_0x3dff74[_0xed87('0x39')]=qs[_0xed87('0x31')](_['pick'](_0x1c4a65[_0xed87('0x2f')],_0x33c367['filters']),_0x4b259e);if(_0x1c4a65[_0xed87('0x2f')]['filter']){_0x3dff74[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x3dff74[_0xed87('0x39')],{'$or':_[_0xed87('0x2e')](_0x4b259e,function(_0x319f69){if(_0x319f69[_0xed87('0x2b')]!==_0xed87('0x3b')){var _0x161491={};_0x161491[_0x319f69[_0xed87('0x27')]]={'$like':'%'+_0x1c4a65['query']['filter']+'%'};return _0x161491;}})});}_0x3dff74=_[_0xed87('0x3a')]({},_0x3dff74,_0x1c4a65[_0xed87('0x3c')]);var _0x1f16a8={'where':_0x3dff74[_0xed87('0x39')]};return db[_0xed87('0x29')][_0xed87('0x1e')](_0x1f16a8)['then'](function(_0x4398a0){_0x21c93b[_0xed87('0x1e')]=_0x4398a0;if(_0x1c4a65[_0xed87('0x2f')]['includeAll']){_0x3dff74[_0xed87('0x3d')]=[{'all':!![]}];}return db[_0xed87('0x29')][_0xed87('0x3e')](_0x3dff74);})[_0xed87('0x3f')](function(_0x1d1e99){_0x21c93b[_0xed87('0x40')]=_0x1d1e99;return _0x21c93b;})[_0xed87('0x3f')](respondWithFilteredResult(_0x4eaa44,_0x3dff74))[_0xed87('0x41')](handleError(_0x4eaa44,null));};exports[_0xed87('0x42')]=function(_0x406b73,_0x5c6925){var _0x7e6cbb={'raw':![],'where':{'id':_0x406b73[_0xed87('0x43')]['id']}},_0x3c7fcc={};_0x3c7fcc['model']=_['keys'](db[_0xed87('0x29')][_0xed87('0x2a')]);_0x3c7fcc[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x406b73['query']);_0x3c7fcc[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3c7fcc['model'],_0x3c7fcc[_0xed87('0x2f')]);_0x7e6cbb[_0xed87('0x34')]=_[_0xed87('0x32')](_0x3c7fcc[_0xed87('0x2d')],qs[_0xed87('0x33')](_0x406b73[_0xed87('0x2f')][_0xed87('0x33')]));_0x7e6cbb[_0xed87('0x34')]=_0x7e6cbb[_0xed87('0x34')][_0xed87('0x35')]?_0x7e6cbb[_0xed87('0x34')]:_0x3c7fcc['model'];if(_0x406b73[_0xed87('0x2f')][_0xed87('0x44')]){_0x7e6cbb[_0xed87('0x3d')]=[{'all':!![]}];}_0x7e6cbb=_[_0xed87('0x3a')]({},_0x7e6cbb,_0x406b73[_0xed87('0x3c')]);return db[_0xed87('0x29')][_0xed87('0x45')](_0x7e6cbb)[_0xed87('0x3f')](handleEntityNotFound(_0x5c6925,null))[_0xed87('0x3f')](respondWithResult(_0x5c6925,null))[_0xed87('0x41')](handleError(_0x5c6925,null));};exports[_0xed87('0x46')]=function(_0x26c8f4,_0x27ed22){return db[_0xed87('0x29')][_0xed87('0x46')](_0x26c8f4[_0xed87('0x47')],{})[_0xed87('0x3f')](respondWithResult(_0x27ed22,0xc9))['catch'](handleError(_0x27ed22,null));};exports[_0xed87('0x23')]=function(_0x1a68a7,_0x3a91c5){if(_0x1a68a7['body']['id']){delete _0x1a68a7[_0xed87('0x47')]['id'];}return db[_0xed87('0x29')]['find']({'where':{'id':_0x1a68a7[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3a91c5,null))[_0xed87('0x3f')](saveUpdates(_0x1a68a7[_0xed87('0x47')],null))['then'](respondWithResult(_0x3a91c5,null))[_0xed87('0x41')](handleError(_0x3a91c5,null));};exports[_0xed87('0x24')]=function(_0x3ca34c,_0x272a07){return db[_0xed87('0x29')][_0xed87('0x45')]({'where':{'id':_0x3ca34c[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x272a07,null))[_0xed87('0x3f')](removeEntity(_0x272a07,null))[_0xed87('0x41')](handleError(_0x272a07,null));};exports[_0xed87('0x48')]=function(_0x18846f,_0x2e5a9f,_0x4df105){var _0x43ffa4={};var _0x4ea4e3={};var _0x17cad7;var _0x329973;return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x18846f[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x2e5a9f,null))[_0xed87('0x3f')](function(_0xccdbb6){if(_0xccdbb6){_0x17cad7=_0xccdbb6;_0x4ea4e3[_0xed87('0x2d')]=_[_0xed87('0x30')](db['ZendeskConfiguration'][_0xed87('0x2a')]);_0x4ea4e3[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x18846f[_0xed87('0x2f')]);_0x4ea4e3[_0xed87('0x31')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],_0x4ea4e3[_0xed87('0x2f')]);_0x43ffa4[_0xed87('0x34')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],qs['fields'](_0x18846f['query'][_0xed87('0x33')]));_0x43ffa4[_0xed87('0x34')]=_0x43ffa4[_0xed87('0x34')][_0xed87('0x35')]?_0x43ffa4[_0xed87('0x34')]:_0x4ea4e3['model'];_0x43ffa4[_0xed87('0x4a')]=qs[_0xed87('0x38')](_0x18846f[_0xed87('0x2f')][_0xed87('0x38')]);_0x43ffa4[_0xed87('0x39')]=qs[_0xed87('0x31')](_[_0xed87('0x4b')](_0x18846f[_0xed87('0x2f')],_0x4ea4e3[_0xed87('0x31')]));if(_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]){_0x43ffa4[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x43ffa4[_0xed87('0x39')],{'$or':_['map'](_0x43ffa4[_0xed87('0x34')],function(_0x10a19c){var _0x2f03d4={};_0x2f03d4[_0x10a19c]={'$like':'%'+_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]+'%'};return _0x2f03d4;})});}_0x43ffa4=_[_0xed87('0x3a')]({},_0x43ffa4,_0x18846f[_0xed87('0x3c')]);return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})['then'](function(_0x4367c3){if(_0x4367c3){_0x329973=_0x4367c3[_0xed87('0x35')];if(!_0x18846f[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x43ffa4[_0xed87('0x1f')]=qs['limit'](_0x18846f['query'][_0xed87('0x1f')]);_0x43ffa4[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0x18846f[_0xed87('0x2f')][_0xed87('0x1c')]);}return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})[_0xed87('0x3f')](function(_0x3bdf7c){if(_0x3bdf7c){return _0x3bdf7c?{'count':_0x329973,'rows':_0x3bdf7c}:null;}})['then'](respondWithResult(_0x2e5a9f,null))[_0xed87('0x41')](handleError(_0x2e5a9f,null));};exports['addConfiguration']=function(_0xd3b300,_0x3c82de,_0x4e5055){if(_0xd3b300[_0xed87('0x47')]['id']){delete _0xd3b300[_0xed87('0x47')]['id'];}return db['ZendeskAccount'][_0xed87('0x49')]({'where':{'id':_0xd3b300[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3c82de,null))[_0xed87('0x3f')](function(_0x112685){if(_0x112685){_0xd3b300['body'][_0xed87('0x4d')]=_0x112685['id'];_0xd3b300[_0xed87('0x47')][_0xed87('0x4e')]=integrations[_0xed87('0x4f')](_0xd3b300['body']['channel'],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);_0xd3b300['body'][_0xed87('0x50')]=integrations[_0xed87('0x51')](_0xd3b300[_0xed87('0x47')][_0xed87('0x52')],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);return db[_0xed87('0x53')][_0xed87('0x46')](_0xd3b300[_0xed87('0x47')],{'include':[{'model':db[_0xed87('0x54')],'as':_0xed87('0x4e')},{'model':db[_0xed87('0x54')],'as':_0xed87('0x50')}]});}return null;})[_0xed87('0x3f')](respondWithResult(_0x3c82de,null))['catch'](handleError(_0x3c82de,null));};exports[_0xed87('0x55')]=function(_0x2686cd,_0x566ace,_0x4f7b92){var _0x5136c9='';return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x2686cd[_0xed87('0x43')]['id']},'attributes':['id',_0xed87('0x56'),_0xed87('0x57'),_0xed87('0x58'),_0xed87('0x59'),'remoteUri']})[_0xed87('0x3f')](handleEntityNotFound(_0x566ace,null))[_0xed87('0x3f')](function(_0x3b6a9b){if(_0x3b6a9b){_0x5136c9=_0x3b6a9b[_0xed87('0x5a')];var _0xc35cab=_0x5136c9[_0xed87('0x5b')](-0x1);if(_0xc35cab==='/'){_0x5136c9=_0x5136c9[_0xed87('0x5c')](0x0,_0x5136c9[_0xed87('0x5d')](_0xc35cab));}var _0x116198={'method':_0xed87('0x5e'),'uri':util['format']('%s/%s',_0x5136c9,'ticket_fields'),'json':!![]};switch(_0x3b6a9b[_0xed87('0x59')]){case _0xed87('0x57'):_0x116198[_0xed87('0x5f')]={'Authorization':util[_0xed87('0x60')](_0xed87('0x61'),new Buffer(util['format'](_0xed87('0x62'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x57')]))[_0xed87('0x63')](_0xed87('0x64')))};break;case _0xed87('0x58'):_0x116198['headers']={'Authorization':util['format'](_0xed87('0x61'),new Buffer(util[_0xed87('0x60')](_0xed87('0x65'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x58')]))[_0xed87('0x63')](_0xed87('0x64')))};break;default:throw new db[(_0xed87('0x66'))][(_0xed87('0x67'))](_0xed87('0x68'));}return rp(_0x116198);}})[_0xed87('0x3f')](function(_0x1a1f95){if(_0x1a1f95){var _0x52af5c=[_0xed87('0x69'),_0xed87('0x6a'),_0xed87('0x6b'),_0xed87('0x6c')];_[_0xed87('0x6d')](_0x1a1f95[_0xed87('0x6e')],function(_0x4ae84c){return _0x52af5c[_0xed87('0x6f')](_0x4ae84c[_0xed87('0x2b')]);});return{'count':_0x1a1f95[_0xed87('0x6e')][_0xed87('0x35')],'rows':_['map'](_0x1a1f95['ticket_fields'],function(_0x4bfca0){return{'id':_0x4bfca0['id'],'name':_0x4bfca0['position']>0x7?_0x4bfca0['title']:_0x4bfca0[_0xed87('0x2b')],'custom':_0x4bfca0[_0xed87('0x70')]>0x7?!![]:![],'options':_0x4bfca0[_0xed87('0x71')]?_0x4bfca0[_0xed87('0x71')]:_0x4bfca0[_0xed87('0x72')]?_0x4bfca0[_0xed87('0x72')]:[]};})};}})[_0xed87('0x3f')](respondWithResult(_0x566ace,null))[_0xed87('0x41')](function(_0x1b223b){var _0x510066=_0x2686cd['query'][_0xed87('0x73')]?0x1f4:_0x1b223b[_0xed87('0x74')]||0x1f4;logger[_0xed87('0x25')](_0xed87('0x75'),_0xed87('0x55'),_0x510066,JSON['stringify'](_0x1b223b));delete _0x1b223b['name'];if(_0x510066===0x191){_0x510066=0x190;}_0x566ace[_0xed87('0x19')](_0x510066)[_0xed87('0x76')](_0x2686cd['query'][_0xed87('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1b223b[_0xed87('0x74')]}:_0x1b223b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e780d3f..819cdde 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 _0x7114=['exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x7114,0x161));var _0x4711=function(_0x44e36b,_0x5c2eaa){_0x44e36b=_0x44e36b-0x0;var _0x5f3292=_0x7114[_0x44e36b];return _0x5f3292;};'use strict';var _=require(_0x4711('0x0'));var util=require('util');var logger=require(_0x4711('0x1'))('api');var moment=require(_0x4711('0x2'));var BPromise=require('bluebird');var rp=require(_0x4711('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4711('0x4'));var config=require(_0x4711('0x5'));var attributes=require(_0x4711('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x4711('0x7')]=function(_0xb77528,_0x148c39){return _0xb77528['define'](_0x4711('0x8'),attributes,{'tableName':_0x4711('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d1=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts'];(function(_0x58af3a,_0x5eceaa){var _0x43ff9d=function(_0x317c62){while(--_0x317c62){_0x58af3a['push'](_0x58af3a['shift']());}};_0x43ff9d(++_0x5eceaa);}(_0x69d1,0x179));var _0x169d=function(_0x46aebd,_0x488973){_0x46aebd=_0x46aebd-0x0;var _0x549577=_0x69d1[_0x46aebd];return _0x549577;};'use strict';var _=require('lodash');var util=require(_0x169d('0x0'));var logger=require(_0x169d('0x1'))(_0x169d('0x2'));var moment=require(_0x169d('0x3'));var BPromise=require(_0x169d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x169d('0x5'));var rimraf=require(_0x169d('0x6'));var config=require(_0x169d('0x7'));var attributes=require(_0x169d('0x8'));var integrations=require(_0x169d('0x9'));module[_0x169d('0xa')]=function(_0x8ffa29,_0x4df44e){return _0x8ffa29['define'](_0x169d('0xb'),attributes,{'tableName':_0x169d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 9834eea..c94a218 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 _0x938d=['find','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowZendeskAccount'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x938d,0x122));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(_0xd938('0x2'));var rs=require(_0xd938('0x3'));var fs=require('fs');var Redis=require(_0xd938('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd938('0x5'))(_0xd938('0x6'));var config=require(_0xd938('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd938('0x8')][_0xd938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed46b,_0x29fcaa,_0x678164){return new BPromise(function(_0x419e0b,_0x4792db){return client[_0xd938('0xa')](_0x1ed46b,_0x678164)[_0xd938('0xb')](function(_0x19fac0){logger[_0xd938('0xc')](_0xd938('0xd'),_0x29fcaa,_0xd938('0xe'));logger['debug'](_0xd938('0xf'),_0x29fcaa,_0xd938('0xe'),JSON[_0xd938('0x10')](_0x19fac0));if(_0x19fac0[_0xd938('0x11')]){if(_0x19fac0[_0xd938('0x11')][_0xd938('0x12')]===0x1f4){logger[_0xd938('0x11')](_0xd938('0xd'),_0x29fcaa,_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);return _0x4792db(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}logger[_0xd938('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x29fcaa,_0x19fac0['error']['message']);return _0x419e0b(_0x19fac0[_0xd938('0x11')][_0xd938('0x13')]);}else{logger[_0xd938('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x29fcaa,'request\x20sent');_0x419e0b(_0x19fac0[_0xd938('0x14')][_0xd938('0x13')]);}})['catch'](function(_0x5aef15){logger['error'](_0xd938('0xd'),_0x29fcaa,_0x5aef15);_0x4792db(_0x5aef15);});});}exports[_0xd938('0x15')]=function(_0x355185){var _0x54b652=this;return new Promise(function(_0x103e84,_0x34d512){return db[_0xd938('0x16')][_0xd938('0x17')]({'raw':_0x355185[_0xd938('0x18')]?_0x355185['options'][_0xd938('0x19')]===undefined?!![]:![]:!![],'where':_0x355185['options']?_0x355185['options'][_0xd938('0x1a')]||null:null,'attributes':_0x355185['options']?_0x355185[_0xd938('0x18')][_0xd938('0x1b')]||null:null,'limit':_0x355185[_0xd938('0x18')]?_0x355185[_0xd938('0x18')][_0xd938('0x1c')]||null:null,'include':_0x355185['options']?_0x355185[_0xd938('0x18')][_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x355185[_0xd938('0x18')][_0xd938('0x1d')],function(_0x28f56a){return{'model':db[_0x28f56a[_0xd938('0x1f')]],'as':_0x28f56a['as'],'attributes':_0x28f56a[_0xd938('0x1b')],'include':_0x28f56a[_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x28f56a[_0xd938('0x1d')],function(_0x5bc216){return{'model':db[_0x5bc216['model']],'as':_0x5bc216['as'],'attributes':_0x5bc216[_0xd938('0x1b')],'include':_0x5bc216[_0xd938('0x1d')]?_[_0xd938('0x1e')](_0x5bc216['include'],function(_0x10044c){return{'model':db[_0x10044c['model']],'as':_0x10044c['as'],'attributes':_0x10044c[_0xd938('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43fc62){logger['info'](_0xd938('0x15'),_0x355185);logger[_0xd938('0x20')](_0xd938('0x15'),_0x355185,JSON[_0xd938('0x10')](_0x43fc62));_0x103e84(_0x43fc62);})['catch'](function(_0x20a873){logger[_0xd938('0x11')](_0xd938('0x15'),_0x20a873[_0xd938('0x13')],_0x355185);_0x34d512(_0x54b652['error'](0x1f4,_0x20a873[_0xd938('0x13')]));});});};exports[_0xd938('0x21')]=function(_0xd55990){var _0x4bf006=this;return new Promise(function(_0x3ff1ce,_0x2d8fc0){return db[_0xd938('0x16')][_0xd938('0x22')]({'raw':_0xd55990[_0xd938('0x18')]?_0xd55990[_0xd938('0x18')][_0xd938('0x19')]===undefined?!![]:![]:!![],'where':_0xd55990[_0xd938('0x18')]?_0xd55990['options'][_0xd938('0x1a')]||null:null,'attributes':_0xd55990[_0xd938('0x18')]?_0xd55990[_0xd938('0x18')][_0xd938('0x1b')]||null:null,'include':_0xd55990['options']?_0xd55990[_0xd938('0x18')][_0xd938('0x1d')]?_[_0xd938('0x1e')](_0xd55990[_0xd938('0x18')]['include'],function(_0x29a978){return{'model':db[_0x29a978[_0xd938('0x1f')]],'as':_0x29a978['as'],'attributes':_0x29a978[_0xd938('0x1b')],'include':_0x29a978[_0xd938('0x1d')]?_['map'](_0x29a978[_0xd938('0x1d')],function(_0x1a77fc){return{'model':db[_0x1a77fc['model']],'as':_0x1a77fc['as'],'attributes':_0x1a77fc[_0xd938('0x1b')],'include':_0x1a77fc['include']?_['map'](_0x1a77fc[_0xd938('0x1d')],function(_0x216627){return{'model':db[_0x216627[_0xd938('0x1f')]],'as':_0x216627['as'],'attributes':_0x216627['attributes']};}):[]};}):[]};}):[]:[]})[_0xd938('0xb')](function(_0x100594){logger[_0xd938('0xc')](_0xd938('0x21'),_0xd55990);logger['debug']('ShowZendeskAccount',_0xd55990,JSON[_0xd938('0x10')](_0x100594));_0x3ff1ce(_0x100594);})[_0xd938('0x23')](function(_0x5e49e0){logger['error']('ShowZendeskAccount',_0x5e49e0[_0xd938('0x13')],_0xd55990);_0x2d8fc0(_0x4bf006[_0xd938('0x11')](0x1f4,_0x5e49e0[_0xd938('0x13')]));});});}; \ No newline at end of file +var _0x9258=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9258,0x1a0));var _0x8925=function(_0x3c256c,_0x17d401){_0x3c256c=_0x3c256c-0x0;var _0x3bb65a=_0x9258[_0x3c256c];return _0x3bb65a;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var moment=require(_0x8925('0x2'));var BPromise=require(_0x8925('0x3'));var rs=require(_0x8925('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8925('0x5'))['db'];var utils=require(_0x8925('0x6'));var logger=require(_0x8925('0x7'))(_0x8925('0x8'));var config=require(_0x8925('0x9'));var jayson=require(_0x8925('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45aa11,_0x25ce96,_0x358321){return new BPromise(function(_0x2f6430,_0x5b2d7e){return client['request'](_0x45aa11,_0x358321)[_0x8925('0xb')](function(_0x3519de){logger[_0x8925('0xc')](_0x8925('0xd'),_0x25ce96,_0x8925('0xe'));logger[_0x8925('0xf')](_0x8925('0x10'),_0x25ce96,_0x8925('0xe'),JSON[_0x8925('0x11')](_0x3519de));if(_0x3519de[_0x8925('0x12')]){if(_0x3519de[_0x8925('0x12')][_0x8925('0x13')]===0x1f4){logger[_0x8925('0x12')](_0x8925('0xd'),_0x25ce96,_0x3519de[_0x8925('0x12')]['message']);return _0x5b2d7e(_0x3519de[_0x8925('0x12')][_0x8925('0x14')]);}logger['error'](_0x8925('0xd'),_0x25ce96,_0x3519de[_0x8925('0x12')][_0x8925('0x14')]);return _0x2f6430(_0x3519de[_0x8925('0x12')]['message']);}else{logger['info'](_0x8925('0xd'),_0x25ce96,_0x8925('0xe'));_0x2f6430(_0x3519de[_0x8925('0x15')][_0x8925('0x14')]);}})[_0x8925('0x16')](function(_0xbe2be5){logger[_0x8925('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x25ce96,_0xbe2be5);_0x5b2d7e(_0xbe2be5);});});}exports[_0x8925('0x17')]=function(_0x1592b1){var _0x21f01f=this;return new Promise(function(_0x400e10,_0x3482cf){return db[_0x8925('0x18')][_0x8925('0x19')]({'raw':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1b')]===undefined?!![]:![]:!![],'where':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1c')]||null:null,'attributes':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1d')]||null:null,'limit':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')]['limit']||null:null,'include':_0x1592b1[_0x8925('0x1a')]?_0x1592b1[_0x8925('0x1a')][_0x8925('0x1e')]?_[_0x8925('0x1f')](_0x1592b1['options'][_0x8925('0x1e')],function(_0x4d27e7){return{'model':db[_0x4d27e7[_0x8925('0x20')]],'as':_0x4d27e7['as'],'attributes':_0x4d27e7[_0x8925('0x1d')],'include':_0x4d27e7[_0x8925('0x1e')]?_[_0x8925('0x1f')](_0x4d27e7['include'],function(_0x2cb459){return{'model':db[_0x2cb459[_0x8925('0x20')]],'as':_0x2cb459['as'],'attributes':_0x2cb459[_0x8925('0x1d')],'include':_0x2cb459['include']?_[_0x8925('0x1f')](_0x2cb459[_0x8925('0x1e')],function(_0x3edd4d){return{'model':db[_0x3edd4d[_0x8925('0x20')]],'as':_0x3edd4d['as'],'attributes':_0x3edd4d[_0x8925('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8925('0xb')](function(_0x4e24f7){logger[_0x8925('0xc')](_0x8925('0x17'),_0x1592b1);logger['debug'](_0x8925('0x17'),_0x1592b1,JSON[_0x8925('0x11')](_0x4e24f7));_0x400e10(_0x4e24f7);})[_0x8925('0x16')](function(_0x225edb){logger[_0x8925('0x12')](_0x8925('0x17'),_0x225edb['message'],_0x1592b1);_0x3482cf(_0x21f01f['error'](0x1f4,_0x225edb[_0x8925('0x14')]));});});};exports[_0x8925('0x21')]=function(_0x5707c0){var _0xa99b17=this;return new Promise(function(_0x47e167,_0x22a0c6){return db['ZendeskAccount'][_0x8925('0x22')]({'raw':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')][_0x8925('0x1c')]||null:null,'attributes':_0x5707c0['options']?_0x5707c0[_0x8925('0x1a')][_0x8925('0x1d')]||null:null,'include':_0x5707c0[_0x8925('0x1a')]?_0x5707c0[_0x8925('0x1a')]['include']?_['map'](_0x5707c0['options'][_0x8925('0x1e')],function(_0x5d973c){return{'model':db[_0x5d973c['model']],'as':_0x5d973c['as'],'attributes':_0x5d973c[_0x8925('0x1d')],'include':_0x5d973c[_0x8925('0x1e')]?_['map'](_0x5d973c[_0x8925('0x1e')],function(_0x5c5fb5){return{'model':db[_0x5c5fb5[_0x8925('0x20')]],'as':_0x5c5fb5['as'],'attributes':_0x5c5fb5[_0x8925('0x1d')],'include':_0x5c5fb5[_0x8925('0x1e')]?_['map'](_0x5c5fb5[_0x8925('0x1e')],function(_0x39c851){return{'model':db[_0x39c851[_0x8925('0x20')]],'as':_0x39c851['as'],'attributes':_0x39c851[_0x8925('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8925('0xb')](function(_0x86a27e){logger['info'](_0x8925('0x21'),_0x5707c0);logger['debug'](_0x8925('0x21'),_0x5707c0,JSON[_0x8925('0x11')](_0x86a27e));_0x47e167(_0x86a27e);})['catch'](function(_0x5929d3){logger[_0x8925('0x12')](_0x8925('0x21'),_0x5929d3[_0x8925('0x14')],_0x5707c0);_0x22a0c6(_0xa99b17[_0x8925('0x12')](0x1f4,_0x5929d3[_0x8925('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d13f706..11958df 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(_0x849fd8,_0xf76b4d){var _0x2b2c37=function(_0x479ce3){while(--_0x479ce3){_0x849fd8['push'](_0x849fd8['shift']());}};_0x2b2c37(++_0xf76b4d);}(_0x153f,0x15b));var _0xf153=function(_0x2e9887,_0x964cb4){_0x2e9887=_0x2e9887-0x0;var _0x5b5e39=_0x153f[_0x2e9887];return _0x5b5e39;};'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 _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0xe72b4b,_0x1d7b17){var _0x2c5320=function(_0x3ec6b2){while(--_0x3ec6b2){_0xe72b4b['push'](_0xe72b4b['shift']());}};_0x2c5320(++_0x1d7b17);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('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 54cd493..da3ec58 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 _0x9006=['exports','STRING','sequelize'];(function(_0x1f632a,_0x5872bc){var _0x228b4a=function(_0x4fb482){while(--_0x4fb482){_0x1f632a['push'](_0x1f632a['shift']());}};_0x228b4a(++_0x5872bc);}(_0x9006,0x1d6));var _0x6900=function(_0x4d9565,_0x32a730){_0x4d9565=_0x4d9565-0x0;var _0x535f76=_0x9006[_0x4d9565];return _0x535f76;};'use strict';var Sequelize=require(_0x6900('0x0'));module[_0x6900('0x1')]={'name':{'type':Sequelize[_0x6900('0x2')]},'description':{'type':Sequelize[_0x6900('0x2')]}}; \ No newline at end of file +var _0x46b4=['STRING','exports'];(function(_0x4ba7ad,_0x5ea5b1){var _0x27f869=function(_0x56757f){while(--_0x56757f){_0x4ba7ad['push'](_0x4ba7ad['shift']());}};_0x27f869(++_0x5ea5b1);}(_0x46b4,0x17b));var _0x446b=function(_0x34ec76,_0x1bd7f2){_0x34ec76=_0x34ec76-0x0;var _0x4af73a=_0x46b4[_0x34ec76];return _0x4af73a;};'use strict';var Sequelize=require('sequelize');module[_0x446b('0x0')]={'name':{'type':Sequelize[_0x446b('0x1')]},'description':{'type':Sequelize[_0x446b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 31d33e6..9ab60fe 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 _0x308a=['filter','VIRTUAL','merge','options','where','include','findAll','catch','show','fields','includeAll','find','create','update','body','params','ZendeskField','order','getFields','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','length','hasOwnProperty','sort','pick'];(function(_0x3bd4be,_0x20633b){var _0x1cec6b=function(_0x13aca4){while(--_0x13aca4){_0x3bd4be['push'](_0x3bd4be['shift']());}};_0x1cec6b(++_0x20633b);}(_0x308a,0x1ce));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa308('0x0'));var rimraf=require(_0xa308('0x1'));var zipdir=require(_0xa308('0x2'));var jsonpatch=require(_0xa308('0x3'));var rp=require('request-promise');var moment=require(_0xa308('0x4'));var BPromise=require(_0xa308('0x5'));var Mustache=require(_0xa308('0x6'));var util=require(_0xa308('0x7'));var path=require(_0xa308('0x8'));var sox=require('sox');var csv=require(_0xa308('0x9'));var ejs=require(_0xa308('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa308('0xb'));var squel=require(_0xa308('0xc'));var crypto=require(_0xa308('0xd'));var jsforce=require(_0xa308('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa308('0x9'));var querystring=require('querystring');var Papa=require(_0xa308('0xf'));var Redis=require(_0xa308('0x10'));var authService=require(_0xa308('0x11'));var qs=require(_0xa308('0x12'));var as=require(_0xa308('0x13'));var hardwareService=require(_0xa308('0x14'));var logger=require('../../config/logger')(_0xa308('0x15'));var utils=require(_0xa308('0x16'));var config=require(_0xa308('0x17'));var licenseUtil=require(_0xa308('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d099,_0x476a35){_0x476a35=_0x476a35||0xcc;return function(_0x53736f){if(_0x53736f){return _0x11d099['sendStatus'](_0x476a35);}return _0x11d099[_0xa308('0x19')](_0x476a35)[_0xa308('0x1a')]();};}function respondWithResult(_0x41f085,_0x4d3fba){_0x4d3fba=_0x4d3fba||0xc8;return function(_0x5168c1){if(_0x5168c1){return _0x41f085[_0xa308('0x19')](_0x4d3fba)[_0xa308('0x1b')](_0x5168c1);}};}function respondWithFilteredResult(_0x558735,_0x2fe2a5){return function(_0x18edda){if(_0x18edda){var _0xcd2a37=typeof _0x2fe2a5[_0xa308('0x1c')]==='undefined'&&typeof _0x2fe2a5[_0xa308('0x1d')]===_0xa308('0x1e');var _0xba4ba7=_0x18edda['count'];var _0x38a1db=_0xcd2a37?0x0:_0x2fe2a5[_0xa308('0x1c')];var _0x55d7c9=_0xcd2a37?_0x18edda[_0xa308('0x1f')]:_0x2fe2a5['offset']+_0x2fe2a5[_0xa308('0x1d')];var _0xc06f39;if(_0x55d7c9>=_0xba4ba7){_0x55d7c9=_0xba4ba7;_0xc06f39=0xc8;}else{_0xc06f39=0xce;}_0x558735[_0xa308('0x19')](_0xc06f39);return _0x558735[_0xa308('0x20')](_0xa308('0x21'),_0x38a1db+'-'+_0x55d7c9+'/'+_0xba4ba7)[_0xa308('0x1b')](_0x18edda);}return null;};}function patchUpdates(_0x265343){return function(_0x1eb2e4){try{jsonpatch[_0xa308('0x22')](_0x1eb2e4,_0x265343,!![]);}catch(_0x42216c){return BPromise[_0xa308('0x23')](_0x42216c);}return _0x1eb2e4[_0xa308('0x24')]();};}function saveUpdates(_0x584aae,_0x2bab47){return function(_0x399f39){if(_0x399f39){return _0x399f39['update'](_0x584aae)['then'](function(_0x3eb14e){return _0x3eb14e;});}return null;};}function removeEntity(_0x1af789,_0x5da43d){return function(_0x458f44){if(_0x458f44){return _0x458f44[_0xa308('0x25')]()[_0xa308('0x26')](function(){_0x1af789[_0xa308('0x19')](0xcc)[_0xa308('0x1a')]();});}};}function handleEntityNotFound(_0x32d6b4,_0x36826b){return function(_0x2a806b){if(!_0x2a806b){_0x32d6b4[_0xa308('0x27')](0x194);}return _0x2a806b;};}function handleError(_0x8f076f,_0x244df5){_0x244df5=_0x244df5||0x1f4;return function(_0x363686){logger['error'](_0x363686[_0xa308('0x28')]);if(_0x363686['name']){delete _0x363686['name'];}_0x8f076f['status'](_0x244df5)[_0xa308('0x29')](_0x363686);};}exports[_0xa308('0x2a')]=function(_0x20d788,_0x4f490f){var _0x28b8ec={},_0x1e2dcc={},_0x4125df={'count':0x0,'rows':[]};var _0x52140e=_[_0xa308('0x2b')](db[_0xa308('0x2c')][_0xa308('0x2d')],function(_0x3ea5e3){return{'name':_0x3ea5e3[_0xa308('0x2e')],'type':_0x3ea5e3[_0xa308('0x2f')][_0xa308('0x30')]};});_0x1e2dcc[_0xa308('0x31')]=_[_0xa308('0x2b')](_0x52140e,_0xa308('0x32'));_0x1e2dcc['query']=_[_0xa308('0x33')](_0x20d788[_0xa308('0x34')]);_0x1e2dcc[_0xa308('0x35')]=_['intersection'](_0x1e2dcc[_0xa308('0x31')],_0x1e2dcc[_0xa308('0x34')]);_0x28b8ec[_0xa308('0x36')]=_[_0xa308('0x37')](_0x1e2dcc['model'],qs['fields'](_0x20d788[_0xa308('0x34')]['fields']));_0x28b8ec[_0xa308('0x36')]=_0x28b8ec[_0xa308('0x36')][_0xa308('0x38')]?_0x28b8ec[_0xa308('0x36')]:_0x1e2dcc[_0xa308('0x31')];if(!_0x20d788[_0xa308('0x34')][_0xa308('0x39')]('nolimit')){_0x28b8ec[_0xa308('0x1d')]=qs[_0xa308('0x1d')](_0x20d788[_0xa308('0x34')]['limit']);_0x28b8ec[_0xa308('0x1c')]=qs[_0xa308('0x1c')](_0x20d788[_0xa308('0x34')][_0xa308('0x1c')]);}_0x28b8ec['order']=qs[_0xa308('0x3a')](_0x20d788['query'][_0xa308('0x3a')]);_0x28b8ec['where']=qs[_0xa308('0x35')](_[_0xa308('0x3b')](_0x20d788[_0xa308('0x34')],_0x1e2dcc[_0xa308('0x35')]),_0x52140e);if(_0x20d788[_0xa308('0x34')][_0xa308('0x3c')]){_0x28b8ec['where']=_['merge'](_0x28b8ec['where'],{'$or':_[_0xa308('0x2b')](_0x52140e,function(_0x24deed){if(_0x24deed[_0xa308('0x2f')]!==_0xa308('0x3d')){var _0x27fa32={};_0x27fa32[_0x24deed[_0xa308('0x32')]]={'$like':'%'+_0x20d788[_0xa308('0x34')][_0xa308('0x3c')]+'%'};return _0x27fa32;}})});}_0x28b8ec=_[_0xa308('0x3e')]({},_0x28b8ec,_0x20d788[_0xa308('0x3f')]);var _0x4bd936={'where':_0x28b8ec[_0xa308('0x40')]};return db[_0xa308('0x2c')][_0xa308('0x1f')](_0x4bd936)[_0xa308('0x26')](function(_0x4f308d){_0x4125df[_0xa308('0x1f')]=_0x4f308d;if(_0x20d788['query']['includeAll']){_0x28b8ec[_0xa308('0x41')]=[{'all':!![]}];}return db[_0xa308('0x2c')][_0xa308('0x42')](_0x28b8ec);})[_0xa308('0x26')](function(_0x3fe537){_0x4125df['rows']=_0x3fe537;return _0x4125df;})['then'](respondWithFilteredResult(_0x4f490f,_0x28b8ec))[_0xa308('0x43')](handleError(_0x4f490f,null));};exports[_0xa308('0x44')]=function(_0x3ebb47,_0xe71208){var _0x2a2915={'raw':![],'where':{'id':_0x3ebb47['params']['id']}},_0x3af3d8={};_0x3af3d8[_0xa308('0x31')]=_['keys'](db[_0xa308('0x2c')][_0xa308('0x2d')]);_0x3af3d8[_0xa308('0x34')]=_[_0xa308('0x33')](_0x3ebb47[_0xa308('0x34')]);_0x3af3d8['filters']=_['intersection'](_0x3af3d8['model'],_0x3af3d8[_0xa308('0x34')]);_0x2a2915[_0xa308('0x36')]=_['intersection'](_0x3af3d8[_0xa308('0x31')],qs[_0xa308('0x45')](_0x3ebb47[_0xa308('0x34')][_0xa308('0x45')]));_0x2a2915['attributes']=_0x2a2915[_0xa308('0x36')]['length']?_0x2a2915[_0xa308('0x36')]:_0x3af3d8[_0xa308('0x31')];if(_0x3ebb47[_0xa308('0x34')][_0xa308('0x46')]){_0x2a2915[_0xa308('0x41')]=[{'all':!![]}];}_0x2a2915=_['merge']({},_0x2a2915,_0x3ebb47[_0xa308('0x3f')]);return db[_0xa308('0x2c')][_0xa308('0x47')](_0x2a2915)['then'](handleEntityNotFound(_0xe71208,null))[_0xa308('0x26')](respondWithResult(_0xe71208,null))['catch'](handleError(_0xe71208,null));};exports['create']=function(_0x238db4,_0x307d5b){return db[_0xa308('0x2c')][_0xa308('0x48')](_0x238db4['body'],{})[_0xa308('0x26')](respondWithResult(_0x307d5b,0xc9))[_0xa308('0x43')](handleError(_0x307d5b,null));};exports[_0xa308('0x49')]=function(_0x46a19b,_0x413126){if(_0x46a19b[_0xa308('0x4a')]['id']){delete _0x46a19b[_0xa308('0x4a')]['id'];}return db['ZendeskConfiguration'][_0xa308('0x47')]({'where':{'id':_0x46a19b[_0xa308('0x4b')]['id']}})[_0xa308('0x26')](handleEntityNotFound(_0x413126,null))[_0xa308('0x26')](saveUpdates(_0x46a19b[_0xa308('0x4a')],null))[_0xa308('0x26')](respondWithResult(_0x413126,null))[_0xa308('0x43')](handleError(_0x413126,null));};exports[_0xa308('0x25')]=function(_0x29040d,_0x4f3dc0){return db[_0xa308('0x2c')][_0xa308('0x47')]({'where':{'id':_0x29040d[_0xa308('0x4b')]['id']}})[_0xa308('0x26')](handleEntityNotFound(_0x4f3dc0,null))[_0xa308('0x26')](removeEntity(_0x4f3dc0,null))['catch'](handleError(_0x4f3dc0,null));};exports['getFields']=function(_0x36847b,_0x5c584e,_0x5de277){var _0x4fddbc={};var _0x5e1cdf={};var _0x3a18f7;var _0x5482ab;return db[_0xa308('0x2c')]['findOne']({'where':{'id':_0x36847b[_0xa308('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c584e,null))[_0xa308('0x26')](function(_0x105bf9){if(_0x105bf9){_0x3a18f7=_0x105bf9;_0x5e1cdf[_0xa308('0x31')]=_[_0xa308('0x33')](db[_0xa308('0x4c')][_0xa308('0x2d')]);_0x5e1cdf['query']=_[_0xa308('0x33')](_0x36847b[_0xa308('0x34')]);_0x5e1cdf[_0xa308('0x35')]=_[_0xa308('0x37')](_0x5e1cdf['model'],_0x5e1cdf[_0xa308('0x34')]);_0x4fddbc[_0xa308('0x36')]=_[_0xa308('0x37')](_0x5e1cdf['model'],qs['fields'](_0x36847b['query'][_0xa308('0x45')]));_0x4fddbc[_0xa308('0x36')]=_0x4fddbc[_0xa308('0x36')][_0xa308('0x38')]?_0x4fddbc['attributes']:_0x5e1cdf['model'];_0x4fddbc[_0xa308('0x4d')]=qs[_0xa308('0x3a')](_0x36847b[_0xa308('0x34')][_0xa308('0x3a')]);_0x4fddbc[_0xa308('0x40')]=qs[_0xa308('0x35')](_[_0xa308('0x3b')](_0x36847b['query'],_0x5e1cdf[_0xa308('0x35')]));if(_0x36847b[_0xa308('0x34')][_0xa308('0x3c')]){_0x4fddbc[_0xa308('0x40')]=_[_0xa308('0x3e')](_0x4fddbc[_0xa308('0x40')],{'$or':_['map'](_0x4fddbc[_0xa308('0x36')],function(_0x5009bc){var _0x4478c1={};_0x4478c1[_0x5009bc]={'$like':'%'+_0x36847b[_0xa308('0x34')]['filter']+'%'};return _0x4478c1;})});}_0x4fddbc=_[_0xa308('0x3e')]({},_0x4fddbc,_0x36847b[_0xa308('0x3f')]);return _0x3a18f7[_0xa308('0x4e')](_0x4fddbc);}})[_0xa308('0x26')](function(_0x31bea2){if(_0x31bea2){_0x5482ab=_0x31bea2[_0xa308('0x38')];if(!_0x36847b['query'][_0xa308('0x39')](_0xa308('0x4f'))){_0x4fddbc[_0xa308('0x1d')]=qs['limit'](_0x36847b[_0xa308('0x34')][_0xa308('0x1d')]);_0x4fddbc[_0xa308('0x1c')]=qs['offset'](_0x36847b[_0xa308('0x34')][_0xa308('0x1c')]);}return _0x3a18f7[_0xa308('0x4e')](_0x4fddbc);}})[_0xa308('0x26')](function(_0xa208fa){if(_0xa208fa){return _0xa208fa?{'count':_0x5482ab,'rows':_0xa208fa}:null;}})[_0xa308('0x26')](respondWithResult(_0x5c584e,null))[_0xa308('0x43')](handleError(_0x5c584e,null));};exports[_0xa308('0x50')]=function(_0x4fe3ac,_0x1d3816,_0x222080){var _0x566cfa={};var _0x22b1e0={};var _0x4e8c8a;var _0x17b694;return db[_0xa308('0x2c')][_0xa308('0x51')]({'where':{'id':_0x4fe3ac[_0xa308('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d3816,null))['then'](function(_0x150092){if(_0x150092){_0x4e8c8a=_0x150092;_0x22b1e0[_0xa308('0x31')]=_[_0xa308('0x33')](db['ZendeskField'][_0xa308('0x2d')]);_0x22b1e0[_0xa308('0x34')]=_[_0xa308('0x33')](_0x4fe3ac[_0xa308('0x34')]);_0x22b1e0[_0xa308('0x35')]=_['intersection'](_0x22b1e0['model'],_0x22b1e0[_0xa308('0x34')]);_0x566cfa[_0xa308('0x36')]=_[_0xa308('0x37')](_0x22b1e0[_0xa308('0x31')],qs[_0xa308('0x45')](_0x4fe3ac[_0xa308('0x34')][_0xa308('0x45')]));_0x566cfa[_0xa308('0x36')]=_0x566cfa[_0xa308('0x36')]['length']?_0x566cfa[_0xa308('0x36')]:_0x22b1e0[_0xa308('0x31')];_0x566cfa[_0xa308('0x4d')]=qs['sort'](_0x4fe3ac[_0xa308('0x34')]['sort']);_0x566cfa[_0xa308('0x40')]=qs['filters'](_['pick'](_0x4fe3ac[_0xa308('0x34')],_0x22b1e0[_0xa308('0x35')]));if(_0x4fe3ac[_0xa308('0x34')][_0xa308('0x3c')]){_0x566cfa[_0xa308('0x40')]=_['merge'](_0x566cfa[_0xa308('0x40')],{'$or':_['map'](_0x566cfa[_0xa308('0x36')],function(_0x521526){var _0xbea805={};_0xbea805[_0x521526]={'$like':'%'+_0x4fe3ac[_0xa308('0x34')][_0xa308('0x3c')]+'%'};return _0xbea805;})});}_0x566cfa=_[_0xa308('0x3e')]({},_0x566cfa,_0x4fe3ac['options']);return _0x4e8c8a[_0xa308('0x50')](_0x566cfa);}})[_0xa308('0x26')](function(_0xc0176e){if(_0xc0176e){_0x17b694=_0xc0176e[_0xa308('0x38')];if(!_0x4fe3ac[_0xa308('0x34')]['hasOwnProperty'](_0xa308('0x4f'))){_0x566cfa[_0xa308('0x1d')]=qs[_0xa308('0x1d')](_0x4fe3ac[_0xa308('0x34')]['limit']);_0x566cfa[_0xa308('0x1c')]=qs[_0xa308('0x1c')](_0x4fe3ac['query'][_0xa308('0x1c')]);}return _0x4e8c8a[_0xa308('0x50')](_0x566cfa);}})[_0xa308('0x26')](function(_0x24479c){if(_0x24479c){return _0x24479c?{'count':_0x17b694,'rows':_0x24479c}:null;}})['then'](respondWithResult(_0x1d3816,null))[_0xa308('0x43')](handleError(_0x1d3816,null));};exports[_0xa308('0x52')]=function(_0x52b130,_0x4b99e7,_0x5ef807){var _0x15c802={};var _0x44b1ab={};var _0x371b90;var _0x1cf5d4;return db['ZendeskConfiguration'][_0xa308('0x51')]({'where':{'id':_0x52b130['params']['id']}})['then'](handleEntityNotFound(_0x4b99e7,null))[_0xa308('0x26')](function(_0x24ab73){if(_0x24ab73){_0x371b90=_0x24ab73;_0x44b1ab[_0xa308('0x31')]=_[_0xa308('0x33')](db[_0xa308('0x4c')][_0xa308('0x2d')]);_0x44b1ab[_0xa308('0x34')]=_[_0xa308('0x33')](_0x52b130[_0xa308('0x34')]);_0x44b1ab[_0xa308('0x35')]=_[_0xa308('0x37')](_0x44b1ab[_0xa308('0x31')],_0x44b1ab[_0xa308('0x34')]);_0x15c802[_0xa308('0x36')]=_[_0xa308('0x37')](_0x44b1ab['model'],qs[_0xa308('0x45')](_0x52b130[_0xa308('0x34')][_0xa308('0x45')]));_0x15c802['attributes']=_0x15c802[_0xa308('0x36')]['length']?_0x15c802['attributes']:_0x44b1ab[_0xa308('0x31')];_0x15c802[_0xa308('0x4d')]=qs[_0xa308('0x3a')](_0x52b130[_0xa308('0x34')][_0xa308('0x3a')]);_0x15c802[_0xa308('0x40')]=qs[_0xa308('0x35')](_[_0xa308('0x3b')](_0x52b130[_0xa308('0x34')],_0x44b1ab[_0xa308('0x35')]));if(_0x52b130[_0xa308('0x34')][_0xa308('0x3c')]){_0x15c802[_0xa308('0x40')]=_[_0xa308('0x3e')](_0x15c802[_0xa308('0x40')],{'$or':_[_0xa308('0x2b')](_0x15c802[_0xa308('0x36')],function(_0x3e3a4a){var _0x4bbc88={};_0x4bbc88[_0x3e3a4a]={'$like':'%'+_0x52b130['query'][_0xa308('0x3c')]+'%'};return _0x4bbc88;})});}_0x15c802=_[_0xa308('0x3e')]({},_0x15c802,_0x52b130['options']);return _0x371b90['getDescriptions'](_0x15c802);}})[_0xa308('0x26')](function(_0x3053ab){if(_0x3053ab){_0x1cf5d4=_0x3053ab[_0xa308('0x38')];if(!_0x52b130[_0xa308('0x34')]['hasOwnProperty']('nolimit')){_0x15c802[_0xa308('0x1d')]=qs[_0xa308('0x1d')](_0x52b130['query']['limit']);_0x15c802[_0xa308('0x1c')]=qs['offset'](_0x52b130[_0xa308('0x34')][_0xa308('0x1c')]);}return _0x371b90['getDescriptions'](_0x15c802);}})[_0xa308('0x26')](function(_0x3556f0){if(_0x3556f0){return _0x3556f0?{'count':_0x1cf5d4,'rows':_0x3556f0}:null;}})['then'](respondWithResult(_0x4b99e7,null))[_0xa308('0x43')](handleError(_0x4b99e7,null));};exports[_0xa308('0x53')]=function(_0x4fe4cb,_0x44fdf1,_0x307b84){var _0x5a1449={};var _0xf6618={};var _0x2a2654;var _0x3dea51;return db[_0xa308('0x2c')][_0xa308('0x51')]({'where':{'id':_0x4fe4cb[_0xa308('0x4b')]['id']}})[_0xa308('0x26')](handleEntityNotFound(_0x44fdf1,null))['then'](function(_0x475326){if(_0x475326){_0x2a2654=_0x475326;_0xf6618['model']=_[_0xa308('0x33')](db[_0xa308('0x54')][_0xa308('0x2d')]);_0xf6618['query']=_['keys'](_0x4fe4cb[_0xa308('0x34')]);_0xf6618['filters']=_[_0xa308('0x37')](_0xf6618[_0xa308('0x31')],_0xf6618['query']);_0x5a1449[_0xa308('0x36')]=_[_0xa308('0x37')](_0xf6618[_0xa308('0x31')],qs[_0xa308('0x45')](_0x4fe4cb['query'][_0xa308('0x45')]));_0x5a1449['attributes']=_0x5a1449[_0xa308('0x36')][_0xa308('0x38')]?_0x5a1449[_0xa308('0x36')]:_0xf6618[_0xa308('0x31')];_0x5a1449[_0xa308('0x4d')]=qs['sort'](_0x4fe4cb['query'][_0xa308('0x3a')]);_0x5a1449[_0xa308('0x40')]=qs['filters'](_[_0xa308('0x3b')](_0x4fe4cb[_0xa308('0x34')],_0xf6618[_0xa308('0x35')]));if(_0x4fe4cb[_0xa308('0x34')][_0xa308('0x3c')]){_0x5a1449['where']=_[_0xa308('0x3e')](_0x5a1449['where'],{'$or':_['map'](_0x5a1449['attributes'],function(_0x37bb79){var _0x243f7a={};_0x243f7a[_0x37bb79]={'$like':'%'+_0x4fe4cb[_0xa308('0x34')][_0xa308('0x3c')]+'%'};return _0x243f7a;})});}_0x5a1449=_[_0xa308('0x3e')]({},_0x5a1449,_0x4fe4cb['options']);return _0x2a2654['getTags'](_0x5a1449);}})['then'](function(_0x35524f){if(_0x35524f){_0x3dea51=_0x35524f['length'];if(!_0x4fe4cb[_0xa308('0x34')][_0xa308('0x39')](_0xa308('0x4f'))){_0x5a1449['limit']=qs[_0xa308('0x1d')](_0x4fe4cb[_0xa308('0x34')][_0xa308('0x1d')]);_0x5a1449[_0xa308('0x1c')]=qs[_0xa308('0x1c')](_0x4fe4cb[_0xa308('0x34')][_0xa308('0x1c')]);}return _0x2a2654[_0xa308('0x53')](_0x5a1449);}})['then'](function(_0x15d355){if(_0x15d355){return _0x15d355?{'count':_0x3dea51,'rows':_0x15d355}:null;}})['then'](respondWithResult(_0x44fdf1,null))[_0xa308('0x43')](handleError(_0x44fdf1,null));};exports['setTags']=function(_0x250014,_0x350e12,_0x44555d){if(_0x250014[_0xa308('0x4a')]['id']){delete _0x250014[_0xa308('0x4a')]['id'];}return db['ZendeskConfiguration'][_0xa308('0x51')]({'where':{'id':_0x250014[_0xa308('0x4b')]['id']}})[_0xa308('0x26')](handleEntityNotFound(_0x350e12,null))['then'](function(_0x3af077){if(_0x3af077){return _0x3af077[_0xa308('0x55')](_0x250014['body'][_0xa308('0x56')]||[]);}return null;})[_0xa308('0x26')](respondWithResult(_0x350e12,null))['catch'](handleError(_0x350e12,null));}; \ No newline at end of file +var _0xd691=['attributes','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','show','fields','find','create','update','body','params','getFields','findOne','ZendeskField','length','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','status','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd691,0x12a));var _0x1d69=function(_0x1839fa,_0x2d18ba){_0x1839fa=_0x1839fa-0x0;var _0x599af0=_0xd691[_0x1839fa];return _0x599af0;};'use strict';var emlformat=require(_0x1d69('0x0'));var rimraf=require(_0x1d69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d69('0x2'));var rp=require(_0x1d69('0x3'));var moment=require(_0x1d69('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1d69('0x5'));var util=require(_0x1d69('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1d69('0x7'));var ejs=require(_0x1d69('0x8'));var fs=require('fs');var fs_extra=require(_0x1d69('0x9'));var _=require(_0x1d69('0xa'));var squel=require(_0x1d69('0xb'));var crypto=require(_0x1d69('0xc'));var jsforce=require(_0x1d69('0xd'));var deskjs=require(_0x1d69('0xe'));var toCsv=require(_0x1d69('0x7'));var querystring=require('querystring');var Papa=require(_0x1d69('0xf'));var Redis=require(_0x1d69('0x10'));var authService=require(_0x1d69('0x11'));var qs=require(_0x1d69('0x12'));var as=require(_0x1d69('0x13'));var hardwareService=require(_0x1d69('0x14'));var logger=require(_0x1d69('0x15'))(_0x1d69('0x16'));var utils=require('../../config/utils');var config=require(_0x1d69('0x17'));var licenseUtil=require(_0x1d69('0x18'));var db=require(_0x1d69('0x19'))['db'];function respondWithStatusCode(_0x3e1035,_0x17f87e){_0x17f87e=_0x17f87e||0xcc;return function(_0x5cc285){if(_0x5cc285){return _0x3e1035[_0x1d69('0x1a')](_0x17f87e);}return _0x3e1035['status'](_0x17f87e)[_0x1d69('0x1b')]();};}function respondWithResult(_0x3a1644,_0x4a7e98){_0x4a7e98=_0x4a7e98||0xc8;return function(_0xd62406){if(_0xd62406){return _0x3a1644['status'](_0x4a7e98)[_0x1d69('0x1c')](_0xd62406);}};}function respondWithFilteredResult(_0x35e927,_0x12b4f6){return function(_0x2a0750){if(_0x2a0750){var _0x87e63e=typeof _0x12b4f6[_0x1d69('0x1d')]===_0x1d69('0x1e')&&typeof _0x12b4f6['limit']==='undefined';var _0x553aa2=_0x2a0750[_0x1d69('0x1f')];var _0x488487=_0x87e63e?0x0:_0x12b4f6['offset'];var _0x160306=_0x87e63e?_0x2a0750[_0x1d69('0x1f')]:_0x12b4f6[_0x1d69('0x1d')]+_0x12b4f6[_0x1d69('0x20')];var _0x54f6cb;if(_0x160306>=_0x553aa2){_0x160306=_0x553aa2;_0x54f6cb=0xc8;}else{_0x54f6cb=0xce;}_0x35e927['status'](_0x54f6cb);return _0x35e927[_0x1d69('0x21')](_0x1d69('0x22'),_0x488487+'-'+_0x160306+'/'+_0x553aa2)[_0x1d69('0x1c')](_0x2a0750);}return null;};}function patchUpdates(_0x5cb94d){return function(_0x3e5398){try{jsonpatch[_0x1d69('0x23')](_0x3e5398,_0x5cb94d,!![]);}catch(_0x321863){return BPromise[_0x1d69('0x24')](_0x321863);}return _0x3e5398[_0x1d69('0x25')]();};}function saveUpdates(_0x3c8155,_0x386e13){return function(_0x247483){if(_0x247483){return _0x247483['update'](_0x3c8155)['then'](function(_0x2dcc5b){return _0x2dcc5b;});}return null;};}function removeEntity(_0x5dc396,_0x39de39){return function(_0x419e96){if(_0x419e96){return _0x419e96[_0x1d69('0x26')]()[_0x1d69('0x27')](function(){_0x5dc396[_0x1d69('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e371a,_0x8b2485){return function(_0xfc5eb3){if(!_0xfc5eb3){_0x5e371a[_0x1d69('0x1a')](0x194);}return _0xfc5eb3;};}function handleError(_0x51900b,_0x41fde9){_0x41fde9=_0x41fde9||0x1f4;return function(_0x55935f){logger[_0x1d69('0x29')](_0x55935f[_0x1d69('0x2a')]);if(_0x55935f[_0x1d69('0x2b')]){delete _0x55935f['name'];}_0x51900b[_0x1d69('0x28')](_0x41fde9)[_0x1d69('0x2c')](_0x55935f);};}exports['index']=function(_0xf891a5,_0x3f8c63){var _0xd0916e={},_0x2563ac={},_0x31b1e2={'count':0x0,'rows':[]};var _0x181125=_[_0x1d69('0x2d')](db['ZendeskConfiguration'][_0x1d69('0x2e')],function(_0x26b75c){return{'name':_0x26b75c[_0x1d69('0x2f')],'type':_0x26b75c[_0x1d69('0x30')][_0x1d69('0x31')]};});_0x2563ac['model']=_['map'](_0x181125,_0x1d69('0x2b'));_0x2563ac[_0x1d69('0x32')]=_[_0x1d69('0x33')](_0xf891a5[_0x1d69('0x32')]);_0x2563ac['filters']=_[_0x1d69('0x34')](_0x2563ac['model'],_0x2563ac[_0x1d69('0x32')]);_0xd0916e['attributes']=_['intersection'](_0x2563ac[_0x1d69('0x35')],qs['fields'](_0xf891a5[_0x1d69('0x32')]['fields']));_0xd0916e[_0x1d69('0x36')]=_0xd0916e['attributes']['length']?_0xd0916e[_0x1d69('0x36')]:_0x2563ac[_0x1d69('0x35')];if(!_0xf891a5[_0x1d69('0x32')]['hasOwnProperty']('nolimit')){_0xd0916e['limit']=qs[_0x1d69('0x20')](_0xf891a5[_0x1d69('0x32')][_0x1d69('0x20')]);_0xd0916e['offset']=qs[_0x1d69('0x1d')](_0xf891a5[_0x1d69('0x32')][_0x1d69('0x1d')]);}_0xd0916e[_0x1d69('0x37')]=qs[_0x1d69('0x38')](_0xf891a5[_0x1d69('0x32')][_0x1d69('0x38')]);_0xd0916e['where']=qs[_0x1d69('0x39')](_[_0x1d69('0x3a')](_0xf891a5[_0x1d69('0x32')],_0x2563ac[_0x1d69('0x39')]),_0x181125);if(_0xf891a5[_0x1d69('0x32')]['filter']){_0xd0916e['where']=_[_0x1d69('0x3b')](_0xd0916e[_0x1d69('0x3c')],{'$or':_[_0x1d69('0x2d')](_0x181125,function(_0x20368a){if(_0x20368a['type']!==_0x1d69('0x3d')){var _0x5c2f93={};_0x5c2f93[_0x20368a[_0x1d69('0x2b')]]={'$like':'%'+_0xf891a5[_0x1d69('0x32')][_0x1d69('0x3e')]+'%'};return _0x5c2f93;}})});}_0xd0916e=_['merge']({},_0xd0916e,_0xf891a5[_0x1d69('0x3f')]);var _0x54ec03={'where':_0xd0916e[_0x1d69('0x3c')]};return db[_0x1d69('0x40')][_0x1d69('0x1f')](_0x54ec03)['then'](function(_0x7b61b4){_0x31b1e2[_0x1d69('0x1f')]=_0x7b61b4;if(_0xf891a5['query'][_0x1d69('0x41')]){_0xd0916e[_0x1d69('0x42')]=[{'all':!![]}];}return db[_0x1d69('0x40')][_0x1d69('0x43')](_0xd0916e);})[_0x1d69('0x27')](function(_0x4654da){_0x31b1e2[_0x1d69('0x44')]=_0x4654da;return _0x31b1e2;})[_0x1d69('0x27')](respondWithFilteredResult(_0x3f8c63,_0xd0916e))[_0x1d69('0x45')](handleError(_0x3f8c63,null));};exports[_0x1d69('0x46')]=function(_0x136ece,_0x26d74f){var _0x303c3a={'raw':![],'where':{'id':_0x136ece['params']['id']}},_0x4a158f={};_0x4a158f[_0x1d69('0x35')]=_[_0x1d69('0x33')](db[_0x1d69('0x40')]['rawAttributes']);_0x4a158f[_0x1d69('0x32')]=_['keys'](_0x136ece['query']);_0x4a158f[_0x1d69('0x39')]=_[_0x1d69('0x34')](_0x4a158f[_0x1d69('0x35')],_0x4a158f[_0x1d69('0x32')]);_0x303c3a[_0x1d69('0x36')]=_['intersection'](_0x4a158f[_0x1d69('0x35')],qs['fields'](_0x136ece[_0x1d69('0x32')][_0x1d69('0x47')]));_0x303c3a[_0x1d69('0x36')]=_0x303c3a['attributes']['length']?_0x303c3a['attributes']:_0x4a158f[_0x1d69('0x35')];if(_0x136ece[_0x1d69('0x32')][_0x1d69('0x41')]){_0x303c3a[_0x1d69('0x42')]=[{'all':!![]}];}_0x303c3a=_['merge']({},_0x303c3a,_0x136ece[_0x1d69('0x3f')]);return db[_0x1d69('0x40')][_0x1d69('0x48')](_0x303c3a)[_0x1d69('0x27')](handleEntityNotFound(_0x26d74f,null))[_0x1d69('0x27')](respondWithResult(_0x26d74f,null))['catch'](handleError(_0x26d74f,null));};exports[_0x1d69('0x49')]=function(_0x4978df,_0x36ef8a){return db[_0x1d69('0x40')][_0x1d69('0x49')](_0x4978df['body'],{})[_0x1d69('0x27')](respondWithResult(_0x36ef8a,0xc9))[_0x1d69('0x45')](handleError(_0x36ef8a,null));};exports[_0x1d69('0x4a')]=function(_0x270948,_0x24d2b1){if(_0x270948[_0x1d69('0x4b')]['id']){delete _0x270948[_0x1d69('0x4b')]['id'];}return db[_0x1d69('0x40')][_0x1d69('0x48')]({'where':{'id':_0x270948[_0x1d69('0x4c')]['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0x24d2b1,null))['then'](saveUpdates(_0x270948[_0x1d69('0x4b')],null))['then'](respondWithResult(_0x24d2b1,null))[_0x1d69('0x45')](handleError(_0x24d2b1,null));};exports[_0x1d69('0x26')]=function(_0x4ded10,_0xfb37f5){return db[_0x1d69('0x40')][_0x1d69('0x48')]({'where':{'id':_0x4ded10[_0x1d69('0x4c')]['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0xfb37f5,null))[_0x1d69('0x27')](removeEntity(_0xfb37f5,null))[_0x1d69('0x45')](handleError(_0xfb37f5,null));};exports[_0x1d69('0x4d')]=function(_0x2ec1d3,_0x16cfc9,_0x39fc57){var _0x3a1e1b={};var _0x5df7c2={};var _0x51bc87;var _0x33a547;return db[_0x1d69('0x40')][_0x1d69('0x4e')]({'where':{'id':_0x2ec1d3['params']['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0x16cfc9,null))['then'](function(_0x3fe78d){if(_0x3fe78d){_0x51bc87=_0x3fe78d;_0x5df7c2['model']=_[_0x1d69('0x33')](db[_0x1d69('0x4f')][_0x1d69('0x2e')]);_0x5df7c2[_0x1d69('0x32')]=_['keys'](_0x2ec1d3[_0x1d69('0x32')]);_0x5df7c2[_0x1d69('0x39')]=_[_0x1d69('0x34')](_0x5df7c2[_0x1d69('0x35')],_0x5df7c2[_0x1d69('0x32')]);_0x3a1e1b[_0x1d69('0x36')]=_[_0x1d69('0x34')](_0x5df7c2[_0x1d69('0x35')],qs[_0x1d69('0x47')](_0x2ec1d3[_0x1d69('0x32')][_0x1d69('0x47')]));_0x3a1e1b[_0x1d69('0x36')]=_0x3a1e1b[_0x1d69('0x36')][_0x1d69('0x50')]?_0x3a1e1b[_0x1d69('0x36')]:_0x5df7c2[_0x1d69('0x35')];_0x3a1e1b[_0x1d69('0x37')]=qs[_0x1d69('0x38')](_0x2ec1d3[_0x1d69('0x32')][_0x1d69('0x38')]);_0x3a1e1b[_0x1d69('0x3c')]=qs[_0x1d69('0x39')](_['pick'](_0x2ec1d3[_0x1d69('0x32')],_0x5df7c2[_0x1d69('0x39')]));if(_0x2ec1d3[_0x1d69('0x32')][_0x1d69('0x3e')]){_0x3a1e1b[_0x1d69('0x3c')]=_[_0x1d69('0x3b')](_0x3a1e1b[_0x1d69('0x3c')],{'$or':_[_0x1d69('0x2d')](_0x3a1e1b[_0x1d69('0x36')],function(_0x2a2994){var _0x5bc550={};_0x5bc550[_0x2a2994]={'$like':'%'+_0x2ec1d3[_0x1d69('0x32')][_0x1d69('0x3e')]+'%'};return _0x5bc550;})});}_0x3a1e1b=_['merge']({},_0x3a1e1b,_0x2ec1d3[_0x1d69('0x3f')]);return _0x51bc87[_0x1d69('0x4d')](_0x3a1e1b);}})[_0x1d69('0x27')](function(_0x347532){if(_0x347532){_0x33a547=_0x347532['length'];if(!_0x2ec1d3[_0x1d69('0x32')][_0x1d69('0x51')](_0x1d69('0x52'))){_0x3a1e1b[_0x1d69('0x20')]=qs[_0x1d69('0x20')](_0x2ec1d3[_0x1d69('0x32')]['limit']);_0x3a1e1b[_0x1d69('0x1d')]=qs[_0x1d69('0x1d')](_0x2ec1d3['query'][_0x1d69('0x1d')]);}return _0x51bc87['getFields'](_0x3a1e1b);}})[_0x1d69('0x27')](function(_0x5eb171){if(_0x5eb171){return _0x5eb171?{'count':_0x33a547,'rows':_0x5eb171}:null;}})['then'](respondWithResult(_0x16cfc9,null))[_0x1d69('0x45')](handleError(_0x16cfc9,null));};exports[_0x1d69('0x53')]=function(_0x2efc29,_0x11e764,_0x2ad46d){var _0x5e730f={};var _0x297abb={};var _0x56e316;var _0x275b00;return db[_0x1d69('0x40')][_0x1d69('0x4e')]({'where':{'id':_0x2efc29[_0x1d69('0x4c')]['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0x11e764,null))[_0x1d69('0x27')](function(_0xe51eb0){if(_0xe51eb0){_0x56e316=_0xe51eb0;_0x297abb[_0x1d69('0x35')]=_[_0x1d69('0x33')](db[_0x1d69('0x4f')]['rawAttributes']);_0x297abb[_0x1d69('0x32')]=_[_0x1d69('0x33')](_0x2efc29[_0x1d69('0x32')]);_0x297abb['filters']=_['intersection'](_0x297abb['model'],_0x297abb[_0x1d69('0x32')]);_0x5e730f[_0x1d69('0x36')]=_[_0x1d69('0x34')](_0x297abb['model'],qs['fields'](_0x2efc29['query'][_0x1d69('0x47')]));_0x5e730f[_0x1d69('0x36')]=_0x5e730f[_0x1d69('0x36')]['length']?_0x5e730f['attributes']:_0x297abb[_0x1d69('0x35')];_0x5e730f[_0x1d69('0x37')]=qs['sort'](_0x2efc29[_0x1d69('0x32')][_0x1d69('0x38')]);_0x5e730f[_0x1d69('0x3c')]=qs[_0x1d69('0x39')](_['pick'](_0x2efc29[_0x1d69('0x32')],_0x297abb[_0x1d69('0x39')]));if(_0x2efc29[_0x1d69('0x32')][_0x1d69('0x3e')]){_0x5e730f[_0x1d69('0x3c')]=_['merge'](_0x5e730f[_0x1d69('0x3c')],{'$or':_[_0x1d69('0x2d')](_0x5e730f[_0x1d69('0x36')],function(_0xabbf80){var _0x3784c0={};_0x3784c0[_0xabbf80]={'$like':'%'+_0x2efc29[_0x1d69('0x32')]['filter']+'%'};return _0x3784c0;})});}_0x5e730f=_[_0x1d69('0x3b')]({},_0x5e730f,_0x2efc29[_0x1d69('0x3f')]);return _0x56e316[_0x1d69('0x53')](_0x5e730f);}})['then'](function(_0x4629ea){if(_0x4629ea){_0x275b00=_0x4629ea['length'];if(!_0x2efc29['query']['hasOwnProperty']('nolimit')){_0x5e730f[_0x1d69('0x20')]=qs[_0x1d69('0x20')](_0x2efc29[_0x1d69('0x32')][_0x1d69('0x20')]);_0x5e730f[_0x1d69('0x1d')]=qs[_0x1d69('0x1d')](_0x2efc29[_0x1d69('0x32')][_0x1d69('0x1d')]);}return _0x56e316['getSubjects'](_0x5e730f);}})[_0x1d69('0x27')](function(_0x56c901){if(_0x56c901){return _0x56c901?{'count':_0x275b00,'rows':_0x56c901}:null;}})['then'](respondWithResult(_0x11e764,null))[_0x1d69('0x45')](handleError(_0x11e764,null));};exports['getDescriptions']=function(_0x5451e9,_0x3e3e9e,_0x5e42f5){var _0x2e12fd={};var _0x546685={};var _0x53ac1e;var _0xd389db;return db[_0x1d69('0x40')][_0x1d69('0x4e')]({'where':{'id':_0x5451e9[_0x1d69('0x4c')]['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0x3e3e9e,null))[_0x1d69('0x27')](function(_0x45f560){if(_0x45f560){_0x53ac1e=_0x45f560;_0x546685['model']=_[_0x1d69('0x33')](db[_0x1d69('0x4f')][_0x1d69('0x2e')]);_0x546685['query']=_['keys'](_0x5451e9[_0x1d69('0x32')]);_0x546685[_0x1d69('0x39')]=_['intersection'](_0x546685[_0x1d69('0x35')],_0x546685['query']);_0x2e12fd[_0x1d69('0x36')]=_[_0x1d69('0x34')](_0x546685[_0x1d69('0x35')],qs['fields'](_0x5451e9[_0x1d69('0x32')]['fields']));_0x2e12fd[_0x1d69('0x36')]=_0x2e12fd[_0x1d69('0x36')][_0x1d69('0x50')]?_0x2e12fd[_0x1d69('0x36')]:_0x546685[_0x1d69('0x35')];_0x2e12fd['order']=qs[_0x1d69('0x38')](_0x5451e9[_0x1d69('0x32')][_0x1d69('0x38')]);_0x2e12fd[_0x1d69('0x3c')]=qs[_0x1d69('0x39')](_['pick'](_0x5451e9['query'],_0x546685[_0x1d69('0x39')]));if(_0x5451e9[_0x1d69('0x32')][_0x1d69('0x3e')]){_0x2e12fd[_0x1d69('0x3c')]=_['merge'](_0x2e12fd[_0x1d69('0x3c')],{'$or':_[_0x1d69('0x2d')](_0x2e12fd[_0x1d69('0x36')],function(_0x3e1219){var _0x3bc46e={};_0x3bc46e[_0x3e1219]={'$like':'%'+_0x5451e9['query']['filter']+'%'};return _0x3bc46e;})});}_0x2e12fd=_['merge']({},_0x2e12fd,_0x5451e9[_0x1d69('0x3f')]);return _0x53ac1e[_0x1d69('0x54')](_0x2e12fd);}})[_0x1d69('0x27')](function(_0x39ce27){if(_0x39ce27){_0xd389db=_0x39ce27[_0x1d69('0x50')];if(!_0x5451e9[_0x1d69('0x32')][_0x1d69('0x51')]('nolimit')){_0x2e12fd[_0x1d69('0x20')]=qs[_0x1d69('0x20')](_0x5451e9[_0x1d69('0x32')][_0x1d69('0x20')]);_0x2e12fd[_0x1d69('0x1d')]=qs[_0x1d69('0x1d')](_0x5451e9[_0x1d69('0x32')][_0x1d69('0x1d')]);}return _0x53ac1e[_0x1d69('0x54')](_0x2e12fd);}})[_0x1d69('0x27')](function(_0x3b4f9e){if(_0x3b4f9e){return _0x3b4f9e?{'count':_0xd389db,'rows':_0x3b4f9e}:null;}})[_0x1d69('0x27')](respondWithResult(_0x3e3e9e,null))['catch'](handleError(_0x3e3e9e,null));};exports[_0x1d69('0x55')]=function(_0x2a7f48,_0x10602c,_0x439e67){var _0x1b1b58={};var _0x3d2a80={};var _0x574a3a;var _0x1eb72a;return db[_0x1d69('0x40')]['findOne']({'where':{'id':_0x2a7f48[_0x1d69('0x4c')]['id']}})[_0x1d69('0x27')](handleEntityNotFound(_0x10602c,null))[_0x1d69('0x27')](function(_0x1458bc){if(_0x1458bc){_0x574a3a=_0x1458bc;_0x3d2a80[_0x1d69('0x35')]=_[_0x1d69('0x33')](db['Tag'][_0x1d69('0x2e')]);_0x3d2a80[_0x1d69('0x32')]=_[_0x1d69('0x33')](_0x2a7f48['query']);_0x3d2a80['filters']=_[_0x1d69('0x34')](_0x3d2a80[_0x1d69('0x35')],_0x3d2a80[_0x1d69('0x32')]);_0x1b1b58[_0x1d69('0x36')]=_['intersection'](_0x3d2a80['model'],qs[_0x1d69('0x47')](_0x2a7f48[_0x1d69('0x32')]['fields']));_0x1b1b58['attributes']=_0x1b1b58['attributes']['length']?_0x1b1b58['attributes']:_0x3d2a80[_0x1d69('0x35')];_0x1b1b58[_0x1d69('0x37')]=qs[_0x1d69('0x38')](_0x2a7f48[_0x1d69('0x32')][_0x1d69('0x38')]);_0x1b1b58[_0x1d69('0x3c')]=qs[_0x1d69('0x39')](_[_0x1d69('0x3a')](_0x2a7f48['query'],_0x3d2a80['filters']));if(_0x2a7f48[_0x1d69('0x32')]['filter']){_0x1b1b58[_0x1d69('0x3c')]=_[_0x1d69('0x3b')](_0x1b1b58[_0x1d69('0x3c')],{'$or':_[_0x1d69('0x2d')](_0x1b1b58['attributes'],function(_0x437cab){var _0x349040={};_0x349040[_0x437cab]={'$like':'%'+_0x2a7f48[_0x1d69('0x32')][_0x1d69('0x3e')]+'%'};return _0x349040;})});}_0x1b1b58=_[_0x1d69('0x3b')]({},_0x1b1b58,_0x2a7f48[_0x1d69('0x3f')]);return _0x574a3a['getTags'](_0x1b1b58);}})['then'](function(_0x1f0e2e){if(_0x1f0e2e){_0x1eb72a=_0x1f0e2e['length'];if(!_0x2a7f48['query'][_0x1d69('0x51')](_0x1d69('0x52'))){_0x1b1b58[_0x1d69('0x20')]=qs[_0x1d69('0x20')](_0x2a7f48[_0x1d69('0x32')][_0x1d69('0x20')]);_0x1b1b58[_0x1d69('0x1d')]=qs['offset'](_0x2a7f48[_0x1d69('0x32')][_0x1d69('0x1d')]);}return _0x574a3a[_0x1d69('0x55')](_0x1b1b58);}})[_0x1d69('0x27')](function(_0x597d06){if(_0x597d06){return _0x597d06?{'count':_0x1eb72a,'rows':_0x597d06}:null;}})['then'](respondWithResult(_0x10602c,null))[_0x1d69('0x45')](handleError(_0x10602c,null));};exports[_0x1d69('0x56')]=function(_0xc417e8,_0x29bd8c,_0x3fc913){if(_0xc417e8[_0x1d69('0x4b')]['id']){delete _0xc417e8['body']['id'];}return db[_0x1d69('0x40')][_0x1d69('0x4e')]({'where':{'id':_0xc417e8[_0x1d69('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29bd8c,null))[_0x1d69('0x27')](function(_0x2bc5f2){if(_0x2bc5f2){return _0x2bc5f2[_0x1d69('0x56')](_0xc417e8[_0x1d69('0x4b')][_0x1d69('0x57')]||[]);}return null;})[_0x1d69('0x27')](respondWithResult(_0x29bd8c,null))['catch'](handleError(_0x29bd8c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 109a231..e3e3f24 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x58a3da,_0x4bb384){var _0x2612a2=function(_0x2178ab){while(--_0x2178ab){_0x58a3da['push'](_0x58a3da['shift']());}};_0x2612a2(++_0x4bb384);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd914=['util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x4811e3,_0x4f03ad){var _0x4f0d23=function(_0x1e4d7f){while(--_0x1e4d7f){_0x4811e3['push'](_0x4811e3['shift']());}};_0x4f0d23(++_0x4f03ad);}(_0xd914,0x17f));var _0x4d91=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0xd914[_0x2678d6];return _0x475503;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var logger=require('../../config/logger')(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var BPromise=require(_0x4d91('0x4'));var rp=require(_0x4d91('0x5'));var fs=require('fs');var path=require(_0x4d91('0x6'));var rimraf=require(_0x4d91('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d91('0x8'));module['exports']=function(_0x3ab6f8,_0x42d7ae){return _0x3ab6f8[_0x4d91('0x9')](_0x4d91('0xa'),attributes,{'tableName':_0x4d91('0xb'),'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 1f86637..a521be9 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 _0xf392=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0xf392,0xe0));var _0x2f39=function(_0xc7f01,_0xe3bd03){_0xc7f01=_0xc7f01-0x0;var _0x32b22f=_0xf392[_0xc7f01];return _0x32b22f;};'use strict';var _=require(_0x2f39('0x0'));var util=require(_0x2f39('0x1'));var moment=require(_0x2f39('0x2'));var BPromise=require(_0x2f39('0x3'));var rs=require(_0x2f39('0x4'));var fs=require('fs');var Redis=require(_0x2f39('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f39('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f39('0x7'));var jayson=require(_0x2f39('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7adf,_0x508d2a,_0x15e159){return new BPromise(function(_0x279267,_0x163929){return client[_0x2f39('0x9')](_0x1f7adf,_0x15e159)['then'](function(_0x5c6e7){logger[_0x2f39('0xa')](_0x2f39('0xb'),_0x508d2a,_0x2f39('0xc'));logger['debug'](_0x2f39('0xd'),_0x508d2a,_0x2f39('0xc'),JSON['stringify'](_0x5c6e7));if(_0x5c6e7['error']){if(_0x5c6e7[_0x2f39('0xe')][_0x2f39('0xf')]===0x1f4){logger['error'](_0x2f39('0xb'),_0x508d2a,_0x5c6e7[_0x2f39('0xe')][_0x2f39('0x10')]);return _0x163929(_0x5c6e7['error'][_0x2f39('0x10')]);}logger['error'](_0x2f39('0xb'),_0x508d2a,_0x5c6e7['error'][_0x2f39('0x10')]);return _0x279267(_0x5c6e7[_0x2f39('0xe')][_0x2f39('0x10')]);}else{logger[_0x2f39('0xa')](_0x2f39('0xb'),_0x508d2a,_0x2f39('0xc'));_0x279267(_0x5c6e7[_0x2f39('0x11')]['message']);}})[_0x2f39('0x12')](function(_0x94624b){logger[_0x2f39('0xe')](_0x2f39('0xb'),_0x508d2a,_0x94624b);_0x163929(_0x94624b);});});} \ No newline at end of file +var _0x4302=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x21cd93,_0x1d7734){var _0x2bf113=function(_0x3b56ed){while(--_0x3b56ed){_0x21cd93['push'](_0x21cd93['shift']());}};_0x2bf113(++_0x1d7734);}(_0x4302,0xb2));var _0x2430=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x4302[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x2430('0x0'));var util=require(_0x2430('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2430('0x2'));var db=require(_0x2430('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2430('0x4'));var config=require('../../config/environment');var jayson=require(_0x2430('0x5'));var client=jayson['client'][_0x2430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4148a0,_0x55cc4d,_0x1dee30){return new BPromise(function(_0x13a5e7,_0x5d4fa4){return client[_0x2430('0x7')](_0x4148a0,_0x1dee30)[_0x2430('0x8')](function(_0x5773f0){logger[_0x2430('0x9')](_0x2430('0xa'),_0x55cc4d,_0x2430('0xb'));logger[_0x2430('0xc')](_0x2430('0xd'),_0x55cc4d,_0x2430('0xb'),JSON['stringify'](_0x5773f0));if(_0x5773f0['error']){if(_0x5773f0['error'][_0x2430('0xe')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x55cc4d,_0x5773f0[_0x2430('0xf')][_0x2430('0x10')]);return _0x5d4fa4(_0x5773f0[_0x2430('0xf')][_0x2430('0x10')]);}logger[_0x2430('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x55cc4d,_0x5773f0['error'][_0x2430('0x10')]);return _0x13a5e7(_0x5773f0[_0x2430('0xf')][_0x2430('0x10')]);}else{logger[_0x2430('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x55cc4d,'request\x20sent');_0x13a5e7(_0x5773f0[_0x2430('0x11')][_0x2430('0x10')]);}})[_0x2430('0x12')](function(_0x55e82b){logger[_0x2430('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x55cc4d,_0x55e82b);_0x5d4fa4(_0x55e82b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a284479..929396f 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 _0x75be=['get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0xc0cf6d,_0x5e1b19){var _0xeb7bf2=function(_0x59c6dc){while(--_0x59c6dc){_0xc0cf6d['push'](_0xc0cf6d['shift']());}};_0xeb7bf2(++_0x5e1b19);}(_0x75be,0x15e));var _0xe75b=function(_0x3f2cbd,_0x26a36e){_0x3f2cbd=_0x3f2cbd-0x0;var _0xef597b=_0x75be[_0x3f2cbd];return _0xef597b;};'use strict';var multer=require(_0xe75b('0x0'));var util=require(_0xe75b('0x1'));var path=require(_0xe75b('0x2'));var timeout=require(_0xe75b('0x3'));var express=require(_0xe75b('0x4'));var router=express[_0xe75b('0x5')]();var fs_extra=require(_0xe75b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe75b('0x7'));var config=require(_0xe75b('0x8'));var controller=require(_0xe75b('0x9'));router[_0xe75b('0xa')]('/',auth[_0xe75b('0xb')](),controller[_0xe75b('0xc')]);router['get'](_0xe75b('0xd'),auth['isAuthenticated'](),controller[_0xe75b('0xe')]);router[_0xe75b('0xf')]('/',auth[_0xe75b('0xb')](),controller[_0xe75b('0x10')]);router[_0xe75b('0x11')](_0xe75b('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe75b('0xd'),auth['isAuthenticated'](),controller[_0xe75b('0x12')]);module[_0xe75b('0x13')]=router; \ No newline at end of file +var _0x4e9c=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','isAuthenticated','/:id','show','create','update','exports','multer'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x4e9c,0xa7));var _0xc4e9=function(_0x5c59e1,_0xebbf1b){_0x5c59e1=_0x5c59e1-0x0;var _0xebe66=_0x4e9c[_0x5c59e1];return _0xebe66;};'use strict';var multer=require(_0xc4e9('0x0'));var util=require(_0xc4e9('0x1'));var path=require(_0xc4e9('0x2'));var timeout=require(_0xc4e9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc4e9('0x4'));var auth=require(_0xc4e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc4e9('0x6'));var controller=require(_0xc4e9('0x7'));router['get']('/',auth[_0xc4e9('0x8')](),controller['index']);router['get'](_0xc4e9('0x9'),auth['isAuthenticated'](),controller[_0xc4e9('0xa')]);router['post']('/',auth[_0xc4e9('0x8')](),controller[_0xc4e9('0xb')]);router['put'](_0xc4e9('0x9'),auth[_0xc4e9('0x8')](),controller[_0xc4e9('0xc')]);router['delete'](_0xc4e9('0x9'),auth[_0xc4e9('0x8')](),controller['destroy']);module[_0xc4e9('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index cf640ef..248bb2f 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 _0x6402=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x36a521,_0x3c4a33){var _0x380f4b=function(_0x1e84bc){while(--_0x1e84bc){_0x36a521['push'](_0x36a521['shift']());}};_0x380f4b(++_0x3c4a33);}(_0x6402,0x10f));var _0x2640=function(_0x2de114,_0xc8e415){_0x2de114=_0x2de114-0x0;var _0x467c98=_0x6402[_0x2de114];return _0x467c98;};'use strict';var Sequelize=require(_0x2640('0x0'));module[_0x2640('0x1')]={'type':{'type':Sequelize[_0x2640('0x2')]('string',_0x2640('0x3'),_0x2640('0x4'),_0x2640('0x5'),_0x2640('0x6')),'defaultValue':_0x2640('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2640('0x8')]},'keyType':{'type':Sequelize[_0x2640('0x2')](_0x2640('0x7'),_0x2640('0x3'),_0x2640('0x4'))},'keyContent':{'type':Sequelize[_0x2640('0x8')]},'idField':{'type':Sequelize[_0x2640('0x8')]},'nameField':{'type':Sequelize[_0x2640('0x8')]},'customField':{'type':Sequelize[_0x2640('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6bfc=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4e180e,_0x46099d){var _0x2df150=function(_0x5583c7){while(--_0x5583c7){_0x4e180e['push'](_0x4e180e['shift']());}};_0x2df150(++_0x46099d);}(_0x6bfc,0x13d));var _0xc6bf=function(_0x52a492,_0x48c09e){_0x52a492=_0x52a492-0x0;var _0x3800df=_0x6bfc[_0x52a492];return _0x3800df;};'use strict';var Sequelize=require(_0xc6bf('0x0'));module[_0xc6bf('0x1')]={'type':{'type':Sequelize[_0xc6bf('0x2')](_0xc6bf('0x3'),_0xc6bf('0x4'),_0xc6bf('0x5'),_0xc6bf('0x6'),_0xc6bf('0x7')),'defaultValue':_0xc6bf('0x3')},'content':{'type':Sequelize[_0xc6bf('0x8')]},'key':{'type':Sequelize[_0xc6bf('0x8')]},'keyType':{'type':Sequelize[_0xc6bf('0x2')](_0xc6bf('0x3'),_0xc6bf('0x4'),_0xc6bf('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc6bf('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6bf('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 6bb4501..71184c0 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 _0xba30=['includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','then','sendStatus','error','stack','name','map','ZendeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options'];(function(_0x1443c4,_0x291ebe){var _0x493131=function(_0x458d91){while(--_0x458d91){_0x1443c4['push'](_0x1443c4['shift']());}};_0x493131(++_0x291ebe);}(_0xba30,0xf0));var _0x0ba3=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0xba30[_0x58175c];return _0x55b88f;};'use strict';var emlformat=require(_0x0ba3('0x0'));var rimraf=require(_0x0ba3('0x1'));var zipdir=require(_0x0ba3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ba3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0ba3('0x4'));var util=require(_0x0ba3('0x5'));var path=require('path');var sox=require(_0x0ba3('0x6'));var csv=require(_0x0ba3('0x7'));var ejs=require(_0x0ba3('0x8'));var fs=require('fs');var fs_extra=require(_0x0ba3('0x9'));var _=require(_0x0ba3('0xa'));var squel=require(_0x0ba3('0xb'));var crypto=require(_0x0ba3('0xc'));var jsforce=require(_0x0ba3('0xd'));var deskjs=require(_0x0ba3('0xe'));var toCsv=require(_0x0ba3('0x7'));var querystring=require(_0x0ba3('0xf'));var Papa=require(_0x0ba3('0x10'));var Redis=require(_0x0ba3('0x11'));var authService=require(_0x0ba3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0ba3('0x13'));var hardwareService=require(_0x0ba3('0x14'));var logger=require(_0x0ba3('0x15'))(_0x0ba3('0x16'));var utils=require(_0x0ba3('0x17'));var config=require(_0x0ba3('0x18'));var licenseUtil=require(_0x0ba3('0x19'));var db=require(_0x0ba3('0x1a'))['db'];function respondWithStatusCode(_0xad75f4,_0x1ec211){_0x1ec211=_0x1ec211||0xcc;return function(_0x177470){if(_0x177470){return _0xad75f4['sendStatus'](_0x1ec211);}return _0xad75f4[_0x0ba3('0x1b')](_0x1ec211)[_0x0ba3('0x1c')]();};}function respondWithResult(_0xcfe51b,_0x55b17c){_0x55b17c=_0x55b17c||0xc8;return function(_0x7a333f){if(_0x7a333f){return _0xcfe51b[_0x0ba3('0x1b')](_0x55b17c)[_0x0ba3('0x1d')](_0x7a333f);}};}function respondWithFilteredResult(_0x25a224,_0x24cfcf){return function(_0x9295dc){if(_0x9295dc){var _0x2add8e=typeof _0x24cfcf[_0x0ba3('0x1e')]===_0x0ba3('0x1f')&&typeof _0x24cfcf[_0x0ba3('0x20')]===_0x0ba3('0x1f');var _0x4910d5=_0x9295dc[_0x0ba3('0x21')];var _0x4f8dff=_0x2add8e?0x0:_0x24cfcf[_0x0ba3('0x1e')];var _0x13c515=_0x2add8e?_0x9295dc[_0x0ba3('0x21')]:_0x24cfcf['offset']+_0x24cfcf['limit'];var _0x3fe514;if(_0x13c515>=_0x4910d5){_0x13c515=_0x4910d5;_0x3fe514=0xc8;}else{_0x3fe514=0xce;}_0x25a224[_0x0ba3('0x1b')](_0x3fe514);return _0x25a224[_0x0ba3('0x22')]('Content-Range',_0x4f8dff+'-'+_0x13c515+'/'+_0x4910d5)[_0x0ba3('0x1d')](_0x9295dc);}return null;};}function patchUpdates(_0x2a2315){return function(_0x15913e){try{jsonpatch[_0x0ba3('0x23')](_0x15913e,_0x2a2315,!![]);}catch(_0x43868a){return BPromise['reject'](_0x43868a);}return _0x15913e[_0x0ba3('0x24')]();};}function saveUpdates(_0x18c425,_0xeb2208){return function(_0x3cc9b4){if(_0x3cc9b4){return _0x3cc9b4['update'](_0x18c425)[_0x0ba3('0x25')](function(_0x323c40){return _0x323c40;});}return null;};}function removeEntity(_0x261a43,_0x3b133b){return function(_0x2e64ff){if(_0x2e64ff){return _0x2e64ff['destroy']()[_0x0ba3('0x25')](function(){_0x261a43[_0x0ba3('0x1b')](0xcc)[_0x0ba3('0x1c')]();});}};}function handleEntityNotFound(_0x4ce335,_0xdeff0b){return function(_0x59754d){if(!_0x59754d){_0x4ce335[_0x0ba3('0x26')](0x194);}return _0x59754d;};}function handleError(_0x42865d,_0x5669e5){_0x5669e5=_0x5669e5||0x1f4;return function(_0x345354){logger[_0x0ba3('0x27')](_0x345354[_0x0ba3('0x28')]);if(_0x345354[_0x0ba3('0x29')]){delete _0x345354[_0x0ba3('0x29')];}_0x42865d[_0x0ba3('0x1b')](_0x5669e5)['send'](_0x345354);};}exports['index']=function(_0xbded04,_0x4cdb55){var _0x1bddf3={},_0xd60db={},_0x5eb53c={'count':0x0,'rows':[]};var _0x4dbbbe=_[_0x0ba3('0x2a')](db[_0x0ba3('0x2b')][_0x0ba3('0x2c')],function(_0x523bb0){return{'name':_0x523bb0[_0x0ba3('0x2d')],'type':_0x523bb0[_0x0ba3('0x2e')]['key']};});_0xd60db[_0x0ba3('0x2f')]=_[_0x0ba3('0x2a')](_0x4dbbbe,_0x0ba3('0x29'));_0xd60db[_0x0ba3('0x30')]=_[_0x0ba3('0x31')](_0xbded04[_0x0ba3('0x30')]);_0xd60db[_0x0ba3('0x32')]=_['intersection'](_0xd60db[_0x0ba3('0x2f')],_0xd60db[_0x0ba3('0x30')]);_0x1bddf3[_0x0ba3('0x33')]=_[_0x0ba3('0x34')](_0xd60db[_0x0ba3('0x2f')],qs[_0x0ba3('0x35')](_0xbded04[_0x0ba3('0x30')]['fields']));_0x1bddf3[_0x0ba3('0x33')]=_0x1bddf3[_0x0ba3('0x33')][_0x0ba3('0x36')]?_0x1bddf3[_0x0ba3('0x33')]:_0xd60db['model'];if(!_0xbded04[_0x0ba3('0x30')][_0x0ba3('0x37')](_0x0ba3('0x38'))){_0x1bddf3['limit']=qs[_0x0ba3('0x20')](_0xbded04[_0x0ba3('0x30')][_0x0ba3('0x20')]);_0x1bddf3[_0x0ba3('0x1e')]=qs['offset'](_0xbded04[_0x0ba3('0x30')]['offset']);}_0x1bddf3[_0x0ba3('0x39')]=qs[_0x0ba3('0x3a')](_0xbded04[_0x0ba3('0x30')][_0x0ba3('0x3a')]);_0x1bddf3['where']=qs[_0x0ba3('0x32')](_[_0x0ba3('0x3b')](_0xbded04[_0x0ba3('0x30')],_0xd60db[_0x0ba3('0x32')]),_0x4dbbbe);if(_0xbded04[_0x0ba3('0x30')][_0x0ba3('0x3c')]){_0x1bddf3[_0x0ba3('0x3d')]=_[_0x0ba3('0x3e')](_0x1bddf3['where'],{'$or':_['map'](_0x4dbbbe,function(_0x3616ab){if(_0x3616ab[_0x0ba3('0x2e')]!=='VIRTUAL'){var _0x37b538={};_0x37b538[_0x3616ab[_0x0ba3('0x29')]]={'$like':'%'+_0xbded04[_0x0ba3('0x30')]['filter']+'%'};return _0x37b538;}})});}_0x1bddf3=_[_0x0ba3('0x3e')]({},_0x1bddf3,_0xbded04[_0x0ba3('0x3f')]);var _0x4fc13a={'where':_0x1bddf3[_0x0ba3('0x3d')]};return db[_0x0ba3('0x2b')]['count'](_0x4fc13a)['then'](function(_0x37083d){_0x5eb53c[_0x0ba3('0x21')]=_0x37083d;if(_0xbded04[_0x0ba3('0x30')][_0x0ba3('0x40')]){_0x1bddf3[_0x0ba3('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x0ba3('0x42')](_0x1bddf3);})[_0x0ba3('0x25')](function(_0x29a4d6){_0x5eb53c[_0x0ba3('0x43')]=_0x29a4d6;return _0x5eb53c;})[_0x0ba3('0x25')](respondWithFilteredResult(_0x4cdb55,_0x1bddf3))[_0x0ba3('0x44')](handleError(_0x4cdb55,null));};exports[_0x0ba3('0x45')]=function(_0x41a03e,_0x272df8){var _0x32a5f0={'raw':!![],'where':{'id':_0x41a03e[_0x0ba3('0x46')]['id']}},_0x3486f4={};_0x3486f4[_0x0ba3('0x2f')]=_[_0x0ba3('0x31')](db['ZendeskField'][_0x0ba3('0x2c')]);_0x3486f4[_0x0ba3('0x30')]=_[_0x0ba3('0x31')](_0x41a03e[_0x0ba3('0x30')]);_0x3486f4[_0x0ba3('0x32')]=_['intersection'](_0x3486f4[_0x0ba3('0x2f')],_0x3486f4[_0x0ba3('0x30')]);_0x32a5f0['attributes']=_[_0x0ba3('0x34')](_0x3486f4['model'],qs[_0x0ba3('0x35')](_0x41a03e[_0x0ba3('0x30')][_0x0ba3('0x35')]));_0x32a5f0[_0x0ba3('0x33')]=_0x32a5f0['attributes']['length']?_0x32a5f0[_0x0ba3('0x33')]:_0x3486f4[_0x0ba3('0x2f')];if(_0x41a03e[_0x0ba3('0x30')]['includeAll']){_0x32a5f0[_0x0ba3('0x41')]=[{'all':!![]}];}_0x32a5f0=_[_0x0ba3('0x3e')]({},_0x32a5f0,_0x41a03e[_0x0ba3('0x3f')]);return db[_0x0ba3('0x2b')][_0x0ba3('0x47')](_0x32a5f0)[_0x0ba3('0x25')](handleEntityNotFound(_0x272df8,null))[_0x0ba3('0x25')](respondWithResult(_0x272df8,null))[_0x0ba3('0x44')](handleError(_0x272df8,null));};exports[_0x0ba3('0x48')]=function(_0x5d9f60,_0x5aa86b){return db[_0x0ba3('0x2b')][_0x0ba3('0x48')](_0x5d9f60[_0x0ba3('0x49')],{})[_0x0ba3('0x25')](respondWithResult(_0x5aa86b,0xc9))['catch'](handleError(_0x5aa86b,null));};exports[_0x0ba3('0x4a')]=function(_0x541af3,_0x4c0c0e){if(_0x541af3[_0x0ba3('0x49')]['id']){delete _0x541af3[_0x0ba3('0x49')]['id'];}return db[_0x0ba3('0x2b')][_0x0ba3('0x47')]({'where':{'id':_0x541af3[_0x0ba3('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c0c0e,null))[_0x0ba3('0x25')](saveUpdates(_0x541af3[_0x0ba3('0x49')],null))['then'](respondWithResult(_0x4c0c0e,null))['catch'](handleError(_0x4c0c0e,null));};exports[_0x0ba3('0x4b')]=function(_0x1935f7,_0x2d625a){return db[_0x0ba3('0x2b')][_0x0ba3('0x47')]({'where':{'id':_0x1935f7[_0x0ba3('0x46')]['id']}})[_0x0ba3('0x25')](handleEntityNotFound(_0x2d625a,null))['then'](removeEntity(_0x2d625a,null))[_0x0ba3('0x44')](handleError(_0x2d625a,null));}; \ No newline at end of file +var _0xda45=['ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','json','reject','save','update','destroy','error','stack','name','send','index','map','ZendeskField','type','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','catch','show','rawAttributes','include','create','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xda45,0x111));var _0x5da4=function(_0x1ac48d,_0x326583){_0x1ac48d=_0x1ac48d-0x0;var _0xf55ed7=_0xda45[_0x1ac48d];return _0xf55ed7;};'use strict';var emlformat=require(_0x5da4('0x0'));var rimraf=require(_0x5da4('0x1'));var zipdir=require(_0x5da4('0x2'));var jsonpatch=require(_0x5da4('0x3'));var rp=require(_0x5da4('0x4'));var moment=require(_0x5da4('0x5'));var BPromise=require(_0x5da4('0x6'));var Mustache=require(_0x5da4('0x7'));var util=require(_0x5da4('0x8'));var path=require(_0x5da4('0x9'));var sox=require('sox');var csv=require(_0x5da4('0xa'));var ejs=require(_0x5da4('0xb'));var fs=require('fs');var fs_extra=require(_0x5da4('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5da4('0xd'));var jsforce=require(_0x5da4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5da4('0xa'));var querystring=require(_0x5da4('0xf'));var Papa=require(_0x5da4('0x10'));var Redis=require(_0x5da4('0x11'));var authService=require(_0x5da4('0x12'));var qs=require(_0x5da4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5da4('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5da4('0x15'));var licenseUtil=require(_0x5da4('0x16'));var db=require(_0x5da4('0x17'))['db'];function respondWithStatusCode(_0x2d02a0,_0x143409){_0x143409=_0x143409||0xcc;return function(_0x9c07d){if(_0x9c07d){return _0x2d02a0[_0x5da4('0x18')](_0x143409);}return _0x2d02a0[_0x5da4('0x19')](_0x143409)[_0x5da4('0x1a')]();};}function respondWithResult(_0x4419f1,_0x2952e2){_0x2952e2=_0x2952e2||0xc8;return function(_0x5cc22a){if(_0x5cc22a){return _0x4419f1['status'](_0x2952e2)['json'](_0x5cc22a);}};}function respondWithFilteredResult(_0x557872,_0x177fb2){return function(_0x41a93e){if(_0x41a93e){var _0x501d71=typeof _0x177fb2['offset']===_0x5da4('0x1b')&&typeof _0x177fb2[_0x5da4('0x1c')]==='undefined';var _0x1d1a88=_0x41a93e['count'];var _0xc83365=_0x501d71?0x0:_0x177fb2[_0x5da4('0x1d')];var _0x3fff38=_0x501d71?_0x41a93e[_0x5da4('0x1e')]:_0x177fb2[_0x5da4('0x1d')]+_0x177fb2[_0x5da4('0x1c')];var _0x7f1965;if(_0x3fff38>=_0x1d1a88){_0x3fff38=_0x1d1a88;_0x7f1965=0xc8;}else{_0x7f1965=0xce;}_0x557872[_0x5da4('0x19')](_0x7f1965);return _0x557872['set']('Content-Range',_0xc83365+'-'+_0x3fff38+'/'+_0x1d1a88)[_0x5da4('0x1f')](_0x41a93e);}return null;};}function patchUpdates(_0x46e309){return function(_0x586a55){try{jsonpatch['apply'](_0x586a55,_0x46e309,!![]);}catch(_0xc69a13){return BPromise[_0x5da4('0x20')](_0xc69a13);}return _0x586a55[_0x5da4('0x21')]();};}function saveUpdates(_0x3415db,_0x8a44bb){return function(_0x2e885f){if(_0x2e885f){return _0x2e885f[_0x5da4('0x22')](_0x3415db)['then'](function(_0x41d5d7){return _0x41d5d7;});}return null;};}function removeEntity(_0x5c8d2a,_0x154bc1){return function(_0x5054bb){if(_0x5054bb){return _0x5054bb[_0x5da4('0x23')]()['then'](function(){_0x5c8d2a[_0x5da4('0x19')](0xcc)[_0x5da4('0x1a')]();});}};}function handleEntityNotFound(_0x4074c5,_0x260d7b){return function(_0x1d133f){if(!_0x1d133f){_0x4074c5[_0x5da4('0x18')](0x194);}return _0x1d133f;};}function handleError(_0x5911d3,_0x55d683){_0x55d683=_0x55d683||0x1f4;return function(_0x96c7a2){logger[_0x5da4('0x24')](_0x96c7a2[_0x5da4('0x25')]);if(_0x96c7a2[_0x5da4('0x26')]){delete _0x96c7a2[_0x5da4('0x26')];}_0x5911d3[_0x5da4('0x19')](_0x55d683)[_0x5da4('0x27')](_0x96c7a2);};}exports[_0x5da4('0x28')]=function(_0x35c1a9,_0x615312){var _0x4eb9fe={},_0x464885={},_0x49f1f2={'count':0x0,'rows':[]};var _0xf58f9a=_[_0x5da4('0x29')](db[_0x5da4('0x2a')]['rawAttributes'],function(_0x256265){return{'name':_0x256265['fieldName'],'type':_0x256265[_0x5da4('0x2b')]['key']};});_0x464885['model']=_[_0x5da4('0x29')](_0xf58f9a,_0x5da4('0x26'));_0x464885[_0x5da4('0x2c')]=_[_0x5da4('0x2d')](_0x35c1a9[_0x5da4('0x2c')]);_0x464885['filters']=_['intersection'](_0x464885[_0x5da4('0x2e')],_0x464885['query']);_0x4eb9fe[_0x5da4('0x2f')]=_[_0x5da4('0x30')](_0x464885[_0x5da4('0x2e')],qs[_0x5da4('0x31')](_0x35c1a9['query'][_0x5da4('0x31')]));_0x4eb9fe[_0x5da4('0x2f')]=_0x4eb9fe[_0x5da4('0x2f')][_0x5da4('0x32')]?_0x4eb9fe[_0x5da4('0x2f')]:_0x464885[_0x5da4('0x2e')];if(!_0x35c1a9[_0x5da4('0x2c')]['hasOwnProperty'](_0x5da4('0x33'))){_0x4eb9fe['limit']=qs[_0x5da4('0x1c')](_0x35c1a9[_0x5da4('0x2c')][_0x5da4('0x1c')]);_0x4eb9fe[_0x5da4('0x1d')]=qs['offset'](_0x35c1a9[_0x5da4('0x2c')]['offset']);}_0x4eb9fe[_0x5da4('0x34')]=qs['sort'](_0x35c1a9['query'][_0x5da4('0x35')]);_0x4eb9fe['where']=qs[_0x5da4('0x36')](_[_0x5da4('0x37')](_0x35c1a9[_0x5da4('0x2c')],_0x464885[_0x5da4('0x36')]),_0xf58f9a);if(_0x35c1a9[_0x5da4('0x2c')][_0x5da4('0x38')]){_0x4eb9fe['where']=_[_0x5da4('0x39')](_0x4eb9fe['where'],{'$or':_[_0x5da4('0x29')](_0xf58f9a,function(_0x410f4e){if(_0x410f4e[_0x5da4('0x2b')]!==_0x5da4('0x3a')){var _0x2e4e99={};_0x2e4e99[_0x410f4e[_0x5da4('0x26')]]={'$like':'%'+_0x35c1a9[_0x5da4('0x2c')][_0x5da4('0x38')]+'%'};return _0x2e4e99;}})});}_0x4eb9fe=_[_0x5da4('0x39')]({},_0x4eb9fe,_0x35c1a9[_0x5da4('0x3b')]);var _0x3acf90={'where':_0x4eb9fe['where']};return db['ZendeskField'][_0x5da4('0x1e')](_0x3acf90)[_0x5da4('0x3c')](function(_0x4b065a){_0x49f1f2[_0x5da4('0x1e')]=_0x4b065a;if(_0x35c1a9[_0x5da4('0x2c')][_0x5da4('0x3d')]){_0x4eb9fe['include']=[{'all':!![]}];}return db[_0x5da4('0x2a')][_0x5da4('0x3e')](_0x4eb9fe);})[_0x5da4('0x3c')](function(_0xd50911){_0x49f1f2['rows']=_0xd50911;return _0x49f1f2;})[_0x5da4('0x3c')](respondWithFilteredResult(_0x615312,_0x4eb9fe))[_0x5da4('0x3f')](handleError(_0x615312,null));};exports[_0x5da4('0x40')]=function(_0x4d4e3,_0x319c4c){var _0x55d7a1={'raw':!![],'where':{'id':_0x4d4e3['params']['id']}},_0x3d79f6={};_0x3d79f6[_0x5da4('0x2e')]=_[_0x5da4('0x2d')](db['ZendeskField'][_0x5da4('0x41')]);_0x3d79f6['query']=_[_0x5da4('0x2d')](_0x4d4e3[_0x5da4('0x2c')]);_0x3d79f6[_0x5da4('0x36')]=_[_0x5da4('0x30')](_0x3d79f6['model'],_0x3d79f6[_0x5da4('0x2c')]);_0x55d7a1['attributes']=_[_0x5da4('0x30')](_0x3d79f6['model'],qs[_0x5da4('0x31')](_0x4d4e3[_0x5da4('0x2c')][_0x5da4('0x31')]));_0x55d7a1[_0x5da4('0x2f')]=_0x55d7a1[_0x5da4('0x2f')]['length']?_0x55d7a1[_0x5da4('0x2f')]:_0x3d79f6[_0x5da4('0x2e')];if(_0x4d4e3['query']['includeAll']){_0x55d7a1[_0x5da4('0x42')]=[{'all':!![]}];}_0x55d7a1=_['merge']({},_0x55d7a1,_0x4d4e3[_0x5da4('0x3b')]);return db['ZendeskField']['find'](_0x55d7a1)[_0x5da4('0x3c')](handleEntityNotFound(_0x319c4c,null))['then'](respondWithResult(_0x319c4c,null))[_0x5da4('0x3f')](handleError(_0x319c4c,null));};exports[_0x5da4('0x43')]=function(_0x24dcc0,_0x3872e5){return db[_0x5da4('0x2a')]['create'](_0x24dcc0[_0x5da4('0x44')],{})[_0x5da4('0x3c')](respondWithResult(_0x3872e5,0xc9))['catch'](handleError(_0x3872e5,null));};exports[_0x5da4('0x22')]=function(_0x258067,_0x15d20e){if(_0x258067[_0x5da4('0x44')]['id']){delete _0x258067[_0x5da4('0x44')]['id'];}return db[_0x5da4('0x2a')]['find']({'where':{'id':_0x258067[_0x5da4('0x45')]['id']}})[_0x5da4('0x3c')](handleEntityNotFound(_0x15d20e,null))['then'](saveUpdates(_0x258067[_0x5da4('0x44')],null))['then'](respondWithResult(_0x15d20e,null))[_0x5da4('0x3f')](handleError(_0x15d20e,null));};exports[_0x5da4('0x23')]=function(_0x27dbf3,_0x2f1bdd){return db[_0x5da4('0x2a')][_0x5da4('0x46')]({'where':{'id':_0x27dbf3['params']['id']}})[_0x5da4('0x3c')](handleEntityNotFound(_0x2f1bdd,null))[_0x5da4('0x3c')](removeEntity(_0x2f1bdd,null))[_0x5da4('0x3f')](handleError(_0x2f1bdd,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d37d588..8b0c12b 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 _0x7afb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','ZendeskField','int_zendesk_fields','idField','lodash','util'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7afb,0x7c));var _0xb7af=function(_0x4aa68b,_0x4ebaf3){_0x4aa68b=_0x4aa68b-0x0;var _0x5a6487=_0x7afb[_0x4aa68b];return _0x5a6487;};'use strict';var _=require(_0xb7af('0x0'));var util=require(_0xb7af('0x1'));var logger=require(_0xb7af('0x2'))(_0xb7af('0x3'));var moment=require(_0xb7af('0x4'));var BPromise=require(_0xb7af('0x5'));var rp=require(_0xb7af('0x6'));var fs=require('fs');var path=require(_0xb7af('0x7'));var rimraf=require(_0xb7af('0x8'));var config=require(_0xb7af('0x9'));var attributes=require(_0xb7af('0xa'));module['exports']=function(_0x2830e4,_0x5f5df6){return _0x2830e4['define'](_0xb7af('0xb'),attributes,{'tableName':_0xb7af('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xb7af('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8172=['FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8172,0x1dd));var _0x2817=function(_0x331309,_0x4403ec){_0x331309=_0x331309-0x0;var _0x8354ff=_0x8172[_0x331309];return _0x8354ff;};'use strict';var _=require(_0x2817('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2817('0x1'));var moment=require(_0x2817('0x2'));var BPromise=require(_0x2817('0x3'));var rp=require(_0x2817('0x4'));var fs=require('fs');var path=require(_0x2817('0x5'));var rimraf=require(_0x2817('0x6'));var config=require(_0x2817('0x7'));var attributes=require(_0x2817('0x8'));module['exports']=function(_0x5e37f1,_0x1637c7){return _0x5e37f1[_0x2817('0x9')]('ZendeskField',attributes,{'tableName':_0x2817('0xa'),'paranoid':![],'indexes':[{'name':_0x2817('0xb'),'fields':[_0x2817('0xc'),_0x2817('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 3e539c0..fe1ca4d 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 _0x6395=['then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6395,0x113));var _0x5639=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6395[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x5639('0x0'));var util=require(_0x5639('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5639('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5639('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5639('0x4'))(_0x5639('0x5'));var config=require(_0x5639('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5639('0x7')][_0x5639('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5bf057,_0x168566,_0x39c480){return new BPromise(function(_0x316350,_0x4a4268){return client[_0x5639('0x9')](_0x5bf057,_0x39c480)[_0x5639('0xa')](function(_0x4c6faa){logger[_0x5639('0xb')](_0x5639('0xc'),_0x168566,'request\x20sent');logger[_0x5639('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x168566,_0x5639('0xe'),JSON[_0x5639('0xf')](_0x4c6faa));if(_0x4c6faa['error']){if(_0x4c6faa['error']['code']===0x1f4){logger[_0x5639('0x10')](_0x5639('0xc'),_0x168566,_0x4c6faa[_0x5639('0x10')][_0x5639('0x11')]);return _0x4a4268(_0x4c6faa[_0x5639('0x10')][_0x5639('0x11')]);}logger[_0x5639('0x10')](_0x5639('0xc'),_0x168566,_0x4c6faa[_0x5639('0x10')][_0x5639('0x11')]);return _0x316350(_0x4c6faa[_0x5639('0x10')][_0x5639('0x11')]);}else{logger[_0x5639('0xb')](_0x5639('0xc'),_0x168566,_0x5639('0xe'));_0x316350(_0x4c6faa['result'][_0x5639('0x11')]);}})[_0x5639('0x12')](function(_0x7ebd59){logger[_0x5639('0x10')](_0x5639('0xc'),_0x168566,_0x7ebd59);_0x4a4268(_0x7ebd59);});});} \ No newline at end of file +var _0x47fb=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x137a43,_0x3ee0f8){var _0x290ef8=function(_0x7754ce){while(--_0x7754ce){_0x137a43['push'](_0x137a43['shift']());}};_0x290ef8(++_0x3ee0f8);}(_0x47fb,0x130));var _0xb47f=function(_0xb008fd,_0x5b7d87){_0xb008fd=_0xb008fd-0x0;var _0x237675=_0x47fb[_0xb008fd];return _0x237675;};'use strict';var _=require('lodash');var util=require(_0xb47f('0x0'));var moment=require(_0xb47f('0x1'));var BPromise=require(_0xb47f('0x2'));var rs=require(_0xb47f('0x3'));var fs=require('fs');var Redis=require(_0xb47f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb47f('0x5'));var logger=require('../../config/logger')(_0xb47f('0x6'));var config=require(_0xb47f('0x7'));var jayson=require(_0xb47f('0x8'));var client=jayson[_0xb47f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xefaa8f,_0x193c2c,_0x37b374){return new BPromise(function(_0x4c17ca,_0x2662c9){return client[_0xb47f('0xa')](_0xefaa8f,_0x37b374)[_0xb47f('0xb')](function(_0xb741e2){logger[_0xb47f('0xc')](_0xb47f('0xd'),_0x193c2c,_0xb47f('0xe'));logger[_0xb47f('0xf')](_0xb47f('0x10'),_0x193c2c,_0xb47f('0xe'),JSON[_0xb47f('0x11')](_0xb741e2));if(_0xb741e2[_0xb47f('0x12')]){if(_0xb741e2[_0xb47f('0x12')][_0xb47f('0x13')]===0x1f4){logger[_0xb47f('0x12')]('ZendeskField,\x20%s,\x20%s',_0x193c2c,_0xb741e2[_0xb47f('0x12')][_0xb47f('0x14')]);return _0x2662c9(_0xb741e2[_0xb47f('0x12')][_0xb47f('0x14')]);}logger[_0xb47f('0x12')](_0xb47f('0xd'),_0x193c2c,_0xb741e2['error'][_0xb47f('0x14')]);return _0x4c17ca(_0xb741e2['error'][_0xb47f('0x14')]);}else{logger[_0xb47f('0xc')](_0xb47f('0xd'),_0x193c2c,_0xb47f('0xe'));_0x4c17ca(_0xb741e2[_0xb47f('0x15')]['message']);}})[_0xb47f('0x16')](function(_0x371c81){logger[_0xb47f('0x12')](_0xb47f('0xd'),_0x193c2c,_0x371c81);_0x2662c9(_0x371c81);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 3762844..f39d57c 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 _0xb1c4=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','isAuthenticated','create','post','addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','/:id'];(function(_0x4516be,_0x381ced){var _0x2a87b5=function(_0x53e5a5){while(--_0x53e5a5){_0x4516be['push'](_0x4516be['shift']());}};_0x2a87b5(++_0x381ced);}(_0xb1c4,0xe5));var _0x4b1c=function(_0x42be8b,_0x8ad475){_0x42be8b=_0x42be8b-0x0;var _0x3345fe=_0xb1c4[_0x42be8b];return _0x3345fe;};'use strict';var multer=require('multer');var util=require(_0x4b1c('0x0'));var path=require(_0x4b1c('0x1'));var timeout=require(_0x4b1c('0x2'));var express=require(_0x4b1c('0x3'));var router=express[_0x4b1c('0x4')]();var fs_extra=require(_0x4b1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4b1c('0x6'));var config=require(_0x4b1c('0x7'));var controller=require(_0x4b1c('0x8'));router[_0x4b1c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4b1c('0xa'),auth['isAuthenticated'](),controller[_0x4b1c('0xb')]);router['get'](_0x4b1c('0xc'),auth['isAuthenticated'](),controller[_0x4b1c('0xd')]);router[_0x4b1c('0x9')](_0x4b1c('0xe'),auth['isAuthenticated'](),controller[_0x4b1c('0xf')]);router['post']('/',auth[_0x4b1c('0x10')](),controller[_0x4b1c('0x11')]);router[_0x4b1c('0x12')]('/:id/configurations',auth[_0x4b1c('0x10')](),controller[_0x4b1c('0x13')]);router['put']('/:id',auth[_0x4b1c('0x10')](),controller[_0x4b1c('0x14')]);router[_0x4b1c('0x15')](_0x4b1c('0xa'),auth[_0x4b1c('0x10')](),controller[_0x4b1c('0x16')]);module[_0x4b1c('0x17')]=router; \ No newline at end of file +var _0x3b09=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','delete','destroy','exports','path'];(function(_0x40dcd1,_0x5cd1da){var _0x5c056b=function(_0x87a3a7){while(--_0x87a3a7){_0x40dcd1['push'](_0x40dcd1['shift']());}};_0x5c056b(++_0x5cd1da);}(_0x3b09,0x1cb));var _0x93b0=function(_0x290973,_0x5d4efc){_0x290973=_0x290973-0x0;var _0x659aeb=_0x3b09[_0x290973];return _0x659aeb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x93b0('0x0'));var timeout=require(_0x93b0('0x1'));var express=require(_0x93b0('0x2'));var router=express[_0x93b0('0x3')]();var fs_extra=require(_0x93b0('0x4'));var auth=require(_0x93b0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93b0('0x6'));var controller=require(_0x93b0('0x7'));router[_0x93b0('0x8')]('/',auth[_0x93b0('0x9')](),controller['index']);router[_0x93b0('0x8')](_0x93b0('0xa'),auth['isAuthenticated'](),controller[_0x93b0('0xb')]);router['get'](_0x93b0('0xc'),auth[_0x93b0('0x9')](),controller[_0x93b0('0xd')]);router[_0x93b0('0x8')](_0x93b0('0xe'),auth[_0x93b0('0x9')](),controller['getFields']);router['post']('/',auth[_0x93b0('0x9')](),controller[_0x93b0('0xf')]);router['post'](_0x93b0('0xc'),auth[_0x93b0('0x9')](),controller[_0x93b0('0x10')]);router['put'](_0x93b0('0xa'),auth[_0x93b0('0x9')](),controller['update']);router[_0x93b0('0x11')](_0x93b0('0xa'),auth[_0x93b0('0x9')](),controller[_0x93b0('0x12')]);module[_0x93b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2aaf059..bfa5c3e 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 _0xdace=['STRING','sequelize'];(function(_0xe35782,_0x173323){var _0x276375=function(_0x4af4d8){while(--_0x4af4d8){_0xe35782['push'](_0xe35782['shift']());}};_0x276375(++_0x173323);}(_0xdace,0xc5));var _0xedac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdace[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c44=['STRING'];(function(_0xb8fd40,_0x23030a){var _0x46fcde=function(_0x1a22ff){while(--_0x1a22ff){_0xb8fd40['push'](_0xb8fd40['shift']());}};_0x46fcde(++_0x23030a);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 5f3a102..518a55b 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 _0x3b78=['response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','includes','system_mandatory','push','display_label','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','name','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','filter','options','includeAll','findAll','rows','show','params','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','AccountId','Descriptions','getDescriptions','channel','Subjects','ZohoField','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','zone','code','host','zoho.eu','com','serverUrl','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20'];(function(_0x3e9577,_0x2f6d4c){var _0x2e8331=function(_0x22b2f7){while(--_0x22b2f7){_0x3e9577['push'](_0x3e9577['shift']());}};_0x2e8331(++_0x2f6d4c);}(_0x3b78,0x107));var _0x83b7=function(_0x1fac98,_0x3a615e){_0x1fac98=_0x1fac98-0x0;var _0x56dfff=_0x3b78[_0x1fac98];return _0x56dfff;};'use strict';var emlformat=require(_0x83b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83b7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83b7('0x2'));var moment=require(_0x83b7('0x3'));var BPromise=require(_0x83b7('0x4'));var Mustache=require(_0x83b7('0x5'));var util=require(_0x83b7('0x6'));var path=require('path');var sox=require(_0x83b7('0x7'));var csv=require(_0x83b7('0x8'));var ejs=require(_0x83b7('0x9'));var fs=require('fs');var fs_extra=require(_0x83b7('0xa'));var _=require('lodash');var squel=require(_0x83b7('0xb'));var crypto=require(_0x83b7('0xc'));var jsforce=require(_0x83b7('0xd'));var deskjs=require(_0x83b7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83b7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83b7('0x10'));var hardwareService=require(_0x83b7('0x11'));var logger=require(_0x83b7('0x12'))(_0x83b7('0x13'));var utils=require(_0x83b7('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x83b7('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47f639,_0x4283bd){_0x4283bd=_0x4283bd||0xcc;return function(_0x1f32ac){if(_0x1f32ac){return _0x47f639[_0x83b7('0x16')](_0x4283bd);}return _0x47f639[_0x83b7('0x17')](_0x4283bd)[_0x83b7('0x18')]();};}function respondWithResult(_0x12f7d5,_0x3b483f){_0x3b483f=_0x3b483f||0xc8;return function(_0x3be4d3){if(_0x3be4d3){return _0x12f7d5[_0x83b7('0x17')](_0x3b483f)[_0x83b7('0x19')](_0x3be4d3);}};}function respondWithFilteredResult(_0x86a333,_0x44f1a5){return function(_0x34a37a){if(_0x34a37a){var _0x1f6c00=typeof _0x44f1a5['offset']===_0x83b7('0x1a')&&typeof _0x44f1a5[_0x83b7('0x1b')]===_0x83b7('0x1a');var _0x2693a2=_0x34a37a[_0x83b7('0x1c')];var _0x400119=_0x1f6c00?0x0:_0x44f1a5[_0x83b7('0x1d')];var _0x46bca4=_0x1f6c00?_0x34a37a[_0x83b7('0x1c')]:_0x44f1a5[_0x83b7('0x1d')]+_0x44f1a5[_0x83b7('0x1b')];var _0x2df6a8;if(_0x46bca4>=_0x2693a2){_0x46bca4=_0x2693a2;_0x2df6a8=0xc8;}else{_0x2df6a8=0xce;}_0x86a333['status'](_0x2df6a8);return _0x86a333[_0x83b7('0x1e')]('Content-Range',_0x400119+'-'+_0x46bca4+'/'+_0x2693a2)[_0x83b7('0x19')](_0x34a37a);}return null;};}function patchUpdates(_0x59089a){return function(_0x569b8a){try{jsonpatch[_0x83b7('0x1f')](_0x569b8a,_0x59089a,!![]);}catch(_0x273b61){return BPromise[_0x83b7('0x20')](_0x273b61);}return _0x569b8a['save']();};}function saveUpdates(_0x1cfc48,_0x13c52c){return function(_0x410052){if(_0x410052){return _0x410052[_0x83b7('0x21')](_0x1cfc48)[_0x83b7('0x22')](function(_0x143843){return _0x143843;});}return null;};}function removeEntity(_0xda17db,_0x418cf1){return function(_0x5e9c4f){if(_0x5e9c4f){return _0x5e9c4f[_0x83b7('0x23')]()['then'](function(){_0xda17db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36f238,_0x501b8f){return function(_0x215fa9){if(!_0x215fa9){_0x36f238[_0x83b7('0x16')](0x194);}return _0x215fa9;};}function handleError(_0x13c868,_0x5bc45e){_0x5bc45e=_0x5bc45e||0x1f4;return function(_0x2ca706){logger[_0x83b7('0x24')](_0x2ca706['stack']);if(_0x2ca706['name']){delete _0x2ca706[_0x83b7('0x25')];}_0x13c868['status'](_0x5bc45e)['send'](_0x2ca706);};}exports['index']=function(_0x43e078,_0x1f91b8){var _0xd1464b={},_0x3bc55f={},_0xf93236={'count':0x0,'rows':[]};var _0x59679c=_['map'](db[_0x83b7('0x26')][_0x83b7('0x27')],function(_0x2794e8){return{'name':_0x2794e8[_0x83b7('0x28')],'type':_0x2794e8[_0x83b7('0x29')][_0x83b7('0x2a')]};});_0x3bc55f[_0x83b7('0x2b')]=_[_0x83b7('0x2c')](_0x59679c,_0x83b7('0x25'));_0x3bc55f[_0x83b7('0x2d')]=_[_0x83b7('0x2e')](_0x43e078[_0x83b7('0x2d')]);_0x3bc55f['filters']=_[_0x83b7('0x2f')](_0x3bc55f[_0x83b7('0x2b')],_0x3bc55f[_0x83b7('0x2d')]);_0xd1464b[_0x83b7('0x30')]=_[_0x83b7('0x2f')](_0x3bc55f['model'],qs['fields'](_0x43e078[_0x83b7('0x2d')][_0x83b7('0x31')]));_0xd1464b[_0x83b7('0x30')]=_0xd1464b['attributes'][_0x83b7('0x32')]?_0xd1464b[_0x83b7('0x30')]:_0x3bc55f[_0x83b7('0x2b')];if(!_0x43e078[_0x83b7('0x2d')]['hasOwnProperty'](_0x83b7('0x33'))){_0xd1464b[_0x83b7('0x1b')]=qs['limit'](_0x43e078[_0x83b7('0x2d')][_0x83b7('0x1b')]);_0xd1464b[_0x83b7('0x1d')]=qs[_0x83b7('0x1d')](_0x43e078[_0x83b7('0x2d')][_0x83b7('0x1d')]);}_0xd1464b[_0x83b7('0x34')]=qs['sort'](_0x43e078[_0x83b7('0x2d')][_0x83b7('0x35')]);_0xd1464b['where']=qs[_0x83b7('0x36')](_[_0x83b7('0x37')](_0x43e078[_0x83b7('0x2d')],_0x3bc55f[_0x83b7('0x36')]),_0x59679c);if(_0x43e078['query']['filter']){_0xd1464b[_0x83b7('0x38')]=_[_0x83b7('0x39')](_0xd1464b[_0x83b7('0x38')],{'$or':_['map'](_0x59679c,function(_0x3bf990){if(_0x3bf990[_0x83b7('0x29')]!=='VIRTUAL'){var _0x14cb87={};_0x14cb87[_0x3bf990[_0x83b7('0x25')]]={'$like':'%'+_0x43e078[_0x83b7('0x2d')][_0x83b7('0x3a')]+'%'};return _0x14cb87;}})});}_0xd1464b=_[_0x83b7('0x39')]({},_0xd1464b,_0x43e078[_0x83b7('0x3b')]);var _0x3f6404={'where':_0xd1464b['where']};return db[_0x83b7('0x26')][_0x83b7('0x1c')](_0x3f6404)['then'](function(_0x5d2dd9){_0xf93236[_0x83b7('0x1c')]=_0x5d2dd9;if(_0x43e078[_0x83b7('0x2d')][_0x83b7('0x3c')]){_0xd1464b['include']=[{'all':!![]}];}return db[_0x83b7('0x26')][_0x83b7('0x3d')](_0xd1464b);})[_0x83b7('0x22')](function(_0x562222){_0xf93236[_0x83b7('0x3e')]=_0x562222;return _0xf93236;})['then'](respondWithFilteredResult(_0x1f91b8,_0xd1464b))['catch'](handleError(_0x1f91b8,null));};exports[_0x83b7('0x3f')]=function(_0x5dd3e3,_0x531e8b){var _0x59d584={'raw':![],'where':{'id':_0x5dd3e3[_0x83b7('0x40')]['id']}},_0x479910={};_0x479910[_0x83b7('0x2b')]=_['keys'](db['ZohoAccount'][_0x83b7('0x27')]);_0x479910[_0x83b7('0x2d')]=_[_0x83b7('0x2e')](_0x5dd3e3['query']);_0x479910[_0x83b7('0x36')]=_[_0x83b7('0x2f')](_0x479910[_0x83b7('0x2b')],_0x479910[_0x83b7('0x2d')]);_0x59d584[_0x83b7('0x30')]=_[_0x83b7('0x2f')](_0x479910[_0x83b7('0x2b')],qs[_0x83b7('0x31')](_0x5dd3e3[_0x83b7('0x2d')][_0x83b7('0x31')]));_0x59d584[_0x83b7('0x30')]=_0x59d584[_0x83b7('0x30')][_0x83b7('0x32')]?_0x59d584[_0x83b7('0x30')]:_0x479910[_0x83b7('0x2b')];if(_0x5dd3e3[_0x83b7('0x2d')][_0x83b7('0x3c')]){_0x59d584['include']=[{'all':!![]}];}_0x59d584=_[_0x83b7('0x39')]({},_0x59d584,_0x5dd3e3[_0x83b7('0x3b')]);return db['ZohoAccount'][_0x83b7('0x41')](_0x59d584)[_0x83b7('0x22')](handleEntityNotFound(_0x531e8b,null))['then'](respondWithResult(_0x531e8b,null))[_0x83b7('0x42')](handleError(_0x531e8b,null));};exports[_0x83b7('0x43')]=function(_0x554912,_0x5a1216){return db[_0x83b7('0x26')][_0x83b7('0x43')](_0x554912[_0x83b7('0x44')],{})['then'](respondWithResult(_0x5a1216,0xc9))[_0x83b7('0x42')](handleError(_0x5a1216,null));};exports[_0x83b7('0x21')]=function(_0x2b8594,_0x1695a5){if(_0x2b8594[_0x83b7('0x44')]['id']){delete _0x2b8594[_0x83b7('0x44')]['id'];}return db[_0x83b7('0x26')]['find']({'where':{'id':_0x2b8594[_0x83b7('0x40')]['id']}})[_0x83b7('0x22')](handleEntityNotFound(_0x1695a5,null))[_0x83b7('0x22')](saveUpdates(_0x2b8594[_0x83b7('0x44')],null))[_0x83b7('0x22')](respondWithResult(_0x1695a5,null))[_0x83b7('0x42')](handleError(_0x1695a5,null));};exports[_0x83b7('0x23')]=function(_0x2af80d,_0x3a8349){return db[_0x83b7('0x26')][_0x83b7('0x41')]({'where':{'id':_0x2af80d['params']['id']}})['then'](handleEntityNotFound(_0x3a8349,null))[_0x83b7('0x22')](removeEntity(_0x3a8349,null))['catch'](handleError(_0x3a8349,null));};exports[_0x83b7('0x45')]=function(_0x2bd30a,_0x3e8b18,_0x30d97d){var _0x30bd64={};var _0x271ce8={};var _0x5df5fc;var _0x3e49d3;return db[_0x83b7('0x26')][_0x83b7('0x46')]({'where':{'id':_0x2bd30a[_0x83b7('0x40')]['id']}})[_0x83b7('0x22')](handleEntityNotFound(_0x3e8b18,null))[_0x83b7('0x22')](function(_0x4179ba){if(_0x4179ba){_0x5df5fc=_0x4179ba;_0x271ce8[_0x83b7('0x2b')]=_[_0x83b7('0x2e')](db[_0x83b7('0x47')][_0x83b7('0x27')]);_0x271ce8[_0x83b7('0x2d')]=_['keys'](_0x2bd30a[_0x83b7('0x2d')]);_0x271ce8[_0x83b7('0x36')]=_[_0x83b7('0x2f')](_0x271ce8['model'],_0x271ce8[_0x83b7('0x2d')]);_0x30bd64['attributes']=_[_0x83b7('0x2f')](_0x271ce8[_0x83b7('0x2b')],qs[_0x83b7('0x31')](_0x2bd30a['query'][_0x83b7('0x31')]));_0x30bd64[_0x83b7('0x30')]=_0x30bd64[_0x83b7('0x30')][_0x83b7('0x32')]?_0x30bd64['attributes']:_0x271ce8[_0x83b7('0x2b')];_0x30bd64[_0x83b7('0x34')]=qs[_0x83b7('0x35')](_0x2bd30a[_0x83b7('0x2d')][_0x83b7('0x35')]);_0x30bd64[_0x83b7('0x38')]=qs[_0x83b7('0x36')](_[_0x83b7('0x37')](_0x2bd30a[_0x83b7('0x2d')],_0x271ce8[_0x83b7('0x36')]));if(_0x2bd30a['query']['filter']){_0x30bd64['where']=_['merge'](_0x30bd64[_0x83b7('0x38')],{'$or':_[_0x83b7('0x2c')](_0x30bd64[_0x83b7('0x30')],function(_0x3bc462){var _0x653844={};_0x653844[_0x3bc462]={'$like':'%'+_0x2bd30a['query'][_0x83b7('0x3a')]+'%'};return _0x653844;})});}_0x30bd64=_[_0x83b7('0x39')]({},_0x30bd64,_0x2bd30a[_0x83b7('0x3b')]);return _0x5df5fc['getConfigurations'](_0x30bd64);}})['then'](function(_0x5c07a9){if(_0x5c07a9){_0x3e49d3=_0x5c07a9[_0x83b7('0x32')];if(!_0x2bd30a[_0x83b7('0x2d')][_0x83b7('0x48')]('nolimit')){_0x30bd64[_0x83b7('0x1b')]=qs[_0x83b7('0x1b')](_0x2bd30a['query'][_0x83b7('0x1b')]);_0x30bd64['offset']=qs['offset'](_0x2bd30a[_0x83b7('0x2d')][_0x83b7('0x1d')]);}return _0x5df5fc['getConfigurations'](_0x30bd64);}})['then'](function(_0x17886e){if(_0x17886e){return _0x17886e?{'count':_0x3e49d3,'rows':_0x17886e}:null;}})[_0x83b7('0x22')](respondWithResult(_0x3e8b18,null))[_0x83b7('0x42')](handleError(_0x3e8b18,null));};exports['addConfiguration']=function(_0x2e26e5,_0x9df1c1,_0x5c302a){if(_0x2e26e5[_0x83b7('0x44')]['id']){delete _0x2e26e5[_0x83b7('0x44')]['id'];}return db['ZohoAccount'][_0x83b7('0x46')]({'where':{'id':_0x2e26e5[_0x83b7('0x40')]['id']}})['then'](handleEntityNotFound(_0x9df1c1,null))[_0x83b7('0x22')](function(_0x39b722){if(_0x39b722){_0x2e26e5[_0x83b7('0x44')][_0x83b7('0x49')]=_0x39b722['id'];_0x2e26e5[_0x83b7('0x44')]['Subjects']=integrations['getSubjects'](_0x2e26e5[_0x83b7('0x44')]['channel'],_0x2e26e5[_0x83b7('0x44')][_0x83b7('0x29')]);_0x2e26e5['body'][_0x83b7('0x4a')]=integrations[_0x83b7('0x4b')](_0x2e26e5[_0x83b7('0x44')][_0x83b7('0x4c')],_0x2e26e5[_0x83b7('0x44')][_0x83b7('0x29')]);return db['ZohoConfiguration'][_0x83b7('0x43')](_0x2e26e5[_0x83b7('0x44')],{'include':[{'model':db['ZohoField'],'as':_0x83b7('0x4d')},{'model':db[_0x83b7('0x4e')],'as':_0x83b7('0x4a')}]});}return null;})['then'](respondWithResult(_0x9df1c1,null))['catch'](handleError(_0x9df1c1,null));};function getAccessToken(_0x3df03d){return new Promise(function(_0x41d89f,_0x266699){var _0x68a8bb;switch(_0x3df03d['zone']){case'US':_0x68a8bb='https://accounts.zoho.com';break;case'AU':_0x68a8bb='https://accounts.zoho.com.au';break;case'EU':_0x68a8bb=_0x83b7('0x4f');break;case'IN':_0x68a8bb=_0x83b7('0x50');break;case'CN':_0x68a8bb=_0x83b7('0x51');break;default:_0x68a8bb=_0x83b7('0x4f');break;}var _0x58242f={'method':_0x83b7('0x52'),'uri':_0x68a8bb+_0x83b7('0x53'),'qs':{'refresh_token':_0x3df03d[_0x83b7('0x54')],'client_id':_0x3df03d[_0x83b7('0x55')],'client_secret':_0x3df03d[_0x83b7('0x56')],'grant_type':_0x83b7('0x57')},'json':!![]};return rp(_0x58242f)['then'](function(_0x407e82){if(_0x407e82[_0x83b7('0x58')]){_0x41d89f(_0x407e82[_0x83b7('0x58')]);}else{_0x266699('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x23cd53){_0x266699(_0x23cd53);});});}exports[_0x83b7('0x59')]=function(_0x4e9828,_0x5a4538,_0x5ad7f3){var _0x4f8cc9,_0x2a1ead,_0xfb2146,_0xa957df,_0x4771e4;return db[_0x83b7('0x26')][_0x83b7('0x46')]({'where':{'id':_0x4e9828['params']['id']},'attributes':['id','host',_0x83b7('0x5a'),_0x83b7('0x55'),_0x83b7('0x56'),'serverUrl',_0x83b7('0x5b'),'refreshToken']})[_0x83b7('0x22')](handleEntityNotFound(_0x5a4538,null))[_0x83b7('0x22')](function(_0x59cfba){_0x4771e4=_0x59cfba;_0x4f8cc9=_0x4771e4[_0x83b7('0x5c')];_0x2a1ead=_0x4f8cc9===_0x83b7('0x5d')?'eu':_0x83b7('0x5e');_0xfb2146=_0x4771e4[_0x83b7('0x5f')];var _0x541ed9=_0xfb2146['slice'](-0x1);if(_0x541ed9==='/'||_0x541ed9==='\x5c'||_0x541ed9===':'){_0xfb2146=_0xfb2146[_0x83b7('0x60')](0x0,_0xfb2146[_0x83b7('0x61')](_0x541ed9));}if(!_0x4771e4[_0x83b7('0x54')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4771e4);})['then'](function(_0x4b3f95){if(_0x4b3f95){return rp({'method':_0x83b7('0x62'),'uri':util[_0x83b7('0x63')](_0x83b7('0x64'),_0x2a1ead),'qs':{'module':_0x83b7('0x65')},'headers':{'Authorization':_0x83b7('0x66')+_0x4b3f95},'json':!![]});}})[_0x83b7('0x22')](function(_0x29c0a8){if(_0x29c0a8){if(_0x29c0a8['response']&&_0x29c0a8[_0x83b7('0x67')]['error']){throw new Error(_0x29c0a8[_0x83b7('0x67')][_0x83b7('0x24')]['message']);}var _0x5e38bc=[];var _0x20bd4f=[];var _0x181e3b=[_0x83b7('0x68'),_0x83b7('0x69'),_0x83b7('0x6a'),_0x83b7('0x6b'),_0x83b7('0x6c'),_0x83b7('0x6d'),'Call_Start_Time',_0x83b7('0x6e')];_0x20bd4f=_['remove'](_0x29c0a8['fields'],function(_0x54621f){return _0x181e3b[_0x83b7('0x6f')](_0x54621f['api_name']);});for(var _0x15cd78=0x0;_0x15cd78<_0x20bd4f[_0x83b7('0x32')];_0x15cd78++){if(_0x20bd4f[_0x15cd78][_0x83b7('0x70')]===![]){_0x5e38bc[_0x83b7('0x71')]({'id':_0x20bd4f[_0x15cd78]['id'],'name':_0x20bd4f[_0x15cd78][_0x83b7('0x72')],'custom':_0x20bd4f[_0x15cd78]['custom_field'],'options':_0x20bd4f[_0x15cd78]['data_type']===_0x83b7('0x73')&&_0x20bd4f[_0x15cd78][_0x83b7('0x74')][_0x83b7('0x32')]>-0x1?_[_0x83b7('0x2c')](_0x20bd4f[_0x15cd78][_0x83b7('0x74')],function(_0x2f4c85){return{'name':_0x2f4c85,'value':_0x2f4c85};}):[]});}}return{'count':_0x5e38bc[_0x83b7('0x32')],'rows':_0x5e38bc};}else{return{'count':0x0,'rows':[]};}})[_0x83b7('0x22')](respondWithResult(_0x5a4538,null))['catch'](function(_0x3363cb){var _0x4be851=_0x4e9828[_0x83b7('0x2d')][_0x83b7('0x75')]?0x1f4:_0x3363cb[_0x83b7('0x76')]||0x1f4;logger[_0x83b7('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x83b7('0x59'),_0x4be851,JSON[_0x83b7('0x77')](_0x3363cb));delete _0x3363cb[_0x83b7('0x25')];if(_0x4be851===0x191){_0x4be851=0x190;}_0x5a4538['status'](_0x4be851)[_0x83b7('0x78')](_0x4e9828[_0x83b7('0x2d')][_0x83b7('0x75')]?{'message':_0x83b7('0x79'),'statusCode':_0x3363cb[_0x83b7('0x76')]}:_0x3363cb);});}; \ No newline at end of file +var _0x1724=['where','filters','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','host','zone','serverUrl','code','zoho.eu','com','slice','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1724,0xca));var _0x4172=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x1724[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x4172('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4172('0x1'));var jsonpatch=require(_0x4172('0x2'));var rp=require(_0x4172('0x3'));var moment=require('moment');var BPromise=require(_0x4172('0x4'));var Mustache=require('mustache');var util=require(_0x4172('0x5'));var path=require(_0x4172('0x6'));var sox=require(_0x4172('0x7'));var csv=require(_0x4172('0x8'));var ejs=require(_0x4172('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4172('0xa'));var squel=require(_0x4172('0xb'));var crypto=require('crypto');var jsforce=require(_0x4172('0xc'));var deskjs=require(_0x4172('0xd'));var toCsv=require(_0x4172('0x8'));var querystring=require(_0x4172('0xe'));var Papa=require(_0x4172('0xf'));var Redis=require(_0x4172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4172('0x11'));var as=require(_0x4172('0x12'));var hardwareService=require(_0x4172('0x13'));var logger=require(_0x4172('0x14'))(_0x4172('0x15'));var utils=require(_0x4172('0x16'));var config=require(_0x4172('0x17'));var licenseUtil=require(_0x4172('0x18'));var db=require(_0x4172('0x19'))['db'];var integrations=require(_0x4172('0x1a'));function respondWithStatusCode(_0x403c17,_0xdac044){_0xdac044=_0xdac044||0xcc;return function(_0x54cd1e){if(_0x54cd1e){return _0x403c17['sendStatus'](_0xdac044);}return _0x403c17['status'](_0xdac044)[_0x4172('0x1b')]();};}function respondWithResult(_0x3b5ccd,_0x5c83de){_0x5c83de=_0x5c83de||0xc8;return function(_0x742dae){if(_0x742dae){return _0x3b5ccd[_0x4172('0x1c')](_0x5c83de)[_0x4172('0x1d')](_0x742dae);}};}function respondWithFilteredResult(_0x21e990,_0xf7f7df){return function(_0x4a0b4e){if(_0x4a0b4e){var _0x250bc7=typeof _0xf7f7df[_0x4172('0x1e')]==='undefined'&&typeof _0xf7f7df[_0x4172('0x1f')]===_0x4172('0x20');var _0x152b83=_0x4a0b4e['count'];var _0x532a9c=_0x250bc7?0x0:_0xf7f7df[_0x4172('0x1e')];var _0x4862b1=_0x250bc7?_0x4a0b4e[_0x4172('0x21')]:_0xf7f7df[_0x4172('0x1e')]+_0xf7f7df[_0x4172('0x1f')];var _0x154af3;if(_0x4862b1>=_0x152b83){_0x4862b1=_0x152b83;_0x154af3=0xc8;}else{_0x154af3=0xce;}_0x21e990[_0x4172('0x1c')](_0x154af3);return _0x21e990[_0x4172('0x22')]('Content-Range',_0x532a9c+'-'+_0x4862b1+'/'+_0x152b83)['json'](_0x4a0b4e);}return null;};}function patchUpdates(_0x4dd773){return function(_0x24cb11){try{jsonpatch[_0x4172('0x23')](_0x24cb11,_0x4dd773,!![]);}catch(_0x4a2cae){return BPromise['reject'](_0x4a2cae);}return _0x24cb11[_0x4172('0x24')]();};}function saveUpdates(_0x29b01a,_0x1a5667){return function(_0x1ade23){if(_0x1ade23){return _0x1ade23[_0x4172('0x25')](_0x29b01a)[_0x4172('0x26')](function(_0x38a941){return _0x38a941;});}return null;};}function removeEntity(_0x2c393f,_0x5e90a4){return function(_0x304804){if(_0x304804){return _0x304804[_0x4172('0x27')]()[_0x4172('0x26')](function(){_0x2c393f['status'](0xcc)[_0x4172('0x1b')]();});}};}function handleEntityNotFound(_0x370f7a,_0x3f7bf5){return function(_0x3aef07){if(!_0x3aef07){_0x370f7a[_0x4172('0x28')](0x194);}return _0x3aef07;};}function handleError(_0x1dcd06,_0x1a1cd1){_0x1a1cd1=_0x1a1cd1||0x1f4;return function(_0x25fccc){logger[_0x4172('0x29')](_0x25fccc[_0x4172('0x2a')]);if(_0x25fccc[_0x4172('0x2b')]){delete _0x25fccc[_0x4172('0x2b')];}_0x1dcd06[_0x4172('0x1c')](_0x1a1cd1)[_0x4172('0x2c')](_0x25fccc);};}exports['index']=function(_0x94bcf5,_0x37b580){var _0x20c415={},_0x103431={},_0x27bf80={'count':0x0,'rows':[]};var _0x13f1e8=_[_0x4172('0x2d')](db['ZohoAccount'][_0x4172('0x2e')],function(_0x2f6ece){return{'name':_0x2f6ece[_0x4172('0x2f')],'type':_0x2f6ece[_0x4172('0x30')]['key']};});_0x103431[_0x4172('0x31')]=_[_0x4172('0x2d')](_0x13f1e8,_0x4172('0x2b'));_0x103431['query']=_['keys'](_0x94bcf5[_0x4172('0x32')]);_0x103431['filters']=_[_0x4172('0x33')](_0x103431['model'],_0x103431[_0x4172('0x32')]);_0x20c415[_0x4172('0x34')]=_[_0x4172('0x33')](_0x103431[_0x4172('0x31')],qs[_0x4172('0x35')](_0x94bcf5[_0x4172('0x32')][_0x4172('0x35')]));_0x20c415['attributes']=_0x20c415['attributes'][_0x4172('0x36')]?_0x20c415[_0x4172('0x34')]:_0x103431[_0x4172('0x31')];if(!_0x94bcf5[_0x4172('0x32')]['hasOwnProperty'](_0x4172('0x37'))){_0x20c415['limit']=qs[_0x4172('0x1f')](_0x94bcf5[_0x4172('0x32')][_0x4172('0x1f')]);_0x20c415[_0x4172('0x1e')]=qs[_0x4172('0x1e')](_0x94bcf5['query'][_0x4172('0x1e')]);}_0x20c415[_0x4172('0x38')]=qs[_0x4172('0x39')](_0x94bcf5['query']['sort']);_0x20c415[_0x4172('0x3a')]=qs[_0x4172('0x3b')](_['pick'](_0x94bcf5[_0x4172('0x32')],_0x103431[_0x4172('0x3b')]),_0x13f1e8);if(_0x94bcf5[_0x4172('0x32')]['filter']){_0x20c415[_0x4172('0x3a')]=_[_0x4172('0x3c')](_0x20c415[_0x4172('0x3a')],{'$or':_['map'](_0x13f1e8,function(_0x1e0245){if(_0x1e0245[_0x4172('0x30')]!==_0x4172('0x3d')){var _0x31eaa1={};_0x31eaa1[_0x1e0245['name']]={'$like':'%'+_0x94bcf5['query'][_0x4172('0x3e')]+'%'};return _0x31eaa1;}})});}_0x20c415=_[_0x4172('0x3c')]({},_0x20c415,_0x94bcf5[_0x4172('0x3f')]);var _0x5192d7={'where':_0x20c415[_0x4172('0x3a')]};return db[_0x4172('0x40')][_0x4172('0x21')](_0x5192d7)[_0x4172('0x26')](function(_0x3c790f){_0x27bf80[_0x4172('0x21')]=_0x3c790f;if(_0x94bcf5[_0x4172('0x32')][_0x4172('0x41')]){_0x20c415[_0x4172('0x42')]=[{'all':!![]}];}return db[_0x4172('0x40')][_0x4172('0x43')](_0x20c415);})[_0x4172('0x26')](function(_0x19fa9a){_0x27bf80[_0x4172('0x44')]=_0x19fa9a;return _0x27bf80;})[_0x4172('0x26')](respondWithFilteredResult(_0x37b580,_0x20c415))[_0x4172('0x45')](handleError(_0x37b580,null));};exports[_0x4172('0x46')]=function(_0x3ae9ca,_0x5948eb){var _0x21b37a={'raw':![],'where':{'id':_0x3ae9ca[_0x4172('0x47')]['id']}},_0x8742a9={};_0x8742a9['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x8742a9[_0x4172('0x32')]=_[_0x4172('0x48')](_0x3ae9ca[_0x4172('0x32')]);_0x8742a9['filters']=_[_0x4172('0x33')](_0x8742a9[_0x4172('0x31')],_0x8742a9[_0x4172('0x32')]);_0x21b37a[_0x4172('0x34')]=_[_0x4172('0x33')](_0x8742a9[_0x4172('0x31')],qs[_0x4172('0x35')](_0x3ae9ca['query']['fields']));_0x21b37a[_0x4172('0x34')]=_0x21b37a['attributes'][_0x4172('0x36')]?_0x21b37a[_0x4172('0x34')]:_0x8742a9['model'];if(_0x3ae9ca[_0x4172('0x32')][_0x4172('0x41')]){_0x21b37a['include']=[{'all':!![]}];}_0x21b37a=_[_0x4172('0x3c')]({},_0x21b37a,_0x3ae9ca[_0x4172('0x3f')]);return db[_0x4172('0x40')][_0x4172('0x49')](_0x21b37a)[_0x4172('0x26')](handleEntityNotFound(_0x5948eb,null))['then'](respondWithResult(_0x5948eb,null))[_0x4172('0x45')](handleError(_0x5948eb,null));};exports[_0x4172('0x4a')]=function(_0x4506c7,_0x1f6992){return db[_0x4172('0x40')][_0x4172('0x4a')](_0x4506c7['body'],{})['then'](respondWithResult(_0x1f6992,0xc9))['catch'](handleError(_0x1f6992,null));};exports[_0x4172('0x25')]=function(_0xcf6937,_0x1e87b0){if(_0xcf6937['body']['id']){delete _0xcf6937['body']['id'];}return db['ZohoAccount'][_0x4172('0x49')]({'where':{'id':_0xcf6937['params']['id']}})['then'](handleEntityNotFound(_0x1e87b0,null))[_0x4172('0x26')](saveUpdates(_0xcf6937[_0x4172('0x4b')],null))['then'](respondWithResult(_0x1e87b0,null))['catch'](handleError(_0x1e87b0,null));};exports[_0x4172('0x27')]=function(_0x58be2e,_0x25aece){return db[_0x4172('0x40')]['find']({'where':{'id':_0x58be2e[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x25aece,null))[_0x4172('0x26')](removeEntity(_0x25aece,null))[_0x4172('0x45')](handleError(_0x25aece,null));};exports[_0x4172('0x4c')]=function(_0x542450,_0x3c5a5e,_0x3f7437){var _0x775399={};var _0x593c7a={};var _0x4b94f4;var _0x44bee6;return db[_0x4172('0x40')][_0x4172('0x4d')]({'where':{'id':_0x542450[_0x4172('0x47')]['id']}})[_0x4172('0x26')](handleEntityNotFound(_0x3c5a5e,null))[_0x4172('0x26')](function(_0x5c80c0){if(_0x5c80c0){_0x4b94f4=_0x5c80c0;_0x593c7a[_0x4172('0x31')]=_[_0x4172('0x48')](db[_0x4172('0x4e')][_0x4172('0x2e')]);_0x593c7a['query']=_[_0x4172('0x48')](_0x542450['query']);_0x593c7a[_0x4172('0x3b')]=_[_0x4172('0x33')](_0x593c7a[_0x4172('0x31')],_0x593c7a[_0x4172('0x32')]);_0x775399[_0x4172('0x34')]=_[_0x4172('0x33')](_0x593c7a[_0x4172('0x31')],qs[_0x4172('0x35')](_0x542450[_0x4172('0x32')][_0x4172('0x35')]));_0x775399[_0x4172('0x34')]=_0x775399[_0x4172('0x34')][_0x4172('0x36')]?_0x775399[_0x4172('0x34')]:_0x593c7a[_0x4172('0x31')];_0x775399[_0x4172('0x38')]=qs[_0x4172('0x39')](_0x542450[_0x4172('0x32')][_0x4172('0x39')]);_0x775399[_0x4172('0x3a')]=qs[_0x4172('0x3b')](_['pick'](_0x542450[_0x4172('0x32')],_0x593c7a['filters']));if(_0x542450['query'][_0x4172('0x3e')]){_0x775399['where']=_['merge'](_0x775399['where'],{'$or':_[_0x4172('0x2d')](_0x775399['attributes'],function(_0x19ad4f){var _0x37ea73={};_0x37ea73[_0x19ad4f]={'$like':'%'+_0x542450[_0x4172('0x32')]['filter']+'%'};return _0x37ea73;})});}_0x775399=_['merge']({},_0x775399,_0x542450[_0x4172('0x3f')]);return _0x4b94f4['getConfigurations'](_0x775399);}})[_0x4172('0x26')](function(_0x1c615b){if(_0x1c615b){_0x44bee6=_0x1c615b['length'];if(!_0x542450[_0x4172('0x32')][_0x4172('0x4f')](_0x4172('0x37'))){_0x775399[_0x4172('0x1f')]=qs[_0x4172('0x1f')](_0x542450[_0x4172('0x32')][_0x4172('0x1f')]);_0x775399[_0x4172('0x1e')]=qs[_0x4172('0x1e')](_0x542450[_0x4172('0x32')][_0x4172('0x1e')]);}return _0x4b94f4[_0x4172('0x4c')](_0x775399);}})[_0x4172('0x26')](function(_0x4e97c8){if(_0x4e97c8){return _0x4e97c8?{'count':_0x44bee6,'rows':_0x4e97c8}:null;}})[_0x4172('0x26')](respondWithResult(_0x3c5a5e,null))['catch'](handleError(_0x3c5a5e,null));};exports[_0x4172('0x50')]=function(_0x56d3b1,_0x10acfb,_0x24ea35){if(_0x56d3b1[_0x4172('0x4b')]['id']){delete _0x56d3b1[_0x4172('0x4b')]['id'];}return db[_0x4172('0x40')][_0x4172('0x4d')]({'where':{'id':_0x56d3b1[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x10acfb,null))[_0x4172('0x26')](function(_0x2f055f){if(_0x2f055f){_0x56d3b1[_0x4172('0x4b')]['AccountId']=_0x2f055f['id'];_0x56d3b1[_0x4172('0x4b')]['Subjects']=integrations[_0x4172('0x51')](_0x56d3b1['body'][_0x4172('0x52')],_0x56d3b1[_0x4172('0x4b')][_0x4172('0x30')]);_0x56d3b1[_0x4172('0x4b')][_0x4172('0x53')]=integrations[_0x4172('0x54')](_0x56d3b1['body'][_0x4172('0x52')],_0x56d3b1[_0x4172('0x4b')][_0x4172('0x30')]);return db['ZohoConfiguration'][_0x4172('0x4a')](_0x56d3b1['body'],{'include':[{'model':db[_0x4172('0x55')],'as':_0x4172('0x56')},{'model':db[_0x4172('0x55')],'as':_0x4172('0x53')}]});}return null;})[_0x4172('0x26')](respondWithResult(_0x10acfb,null))['catch'](handleError(_0x10acfb,null));};function getAccessToken(_0x11fa24){return new Promise(function(_0x514f64,_0x25dd5a){var _0x53cb26;switch(_0x11fa24['zone']){case'US':_0x53cb26=_0x4172('0x57');break;case'AU':_0x53cb26=_0x4172('0x58');break;case'EU':_0x53cb26=_0x4172('0x59');break;case'IN':_0x53cb26='https://accounts.zoho.in';break;case'CN':_0x53cb26=_0x4172('0x5a');break;default:_0x53cb26=_0x4172('0x59');break;}var _0x3d5b67={'method':'POST','uri':_0x53cb26+_0x4172('0x5b'),'qs':{'refresh_token':_0x11fa24[_0x4172('0x5c')],'client_id':_0x11fa24[_0x4172('0x5d')],'client_secret':_0x11fa24[_0x4172('0x5e')],'grant_type':_0x4172('0x5f')},'json':!![]};return rp(_0x3d5b67)[_0x4172('0x26')](function(_0x482e51){if(_0x482e51[_0x4172('0x60')]){_0x514f64(_0x482e51[_0x4172('0x60')]);}else{_0x25dd5a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x4172('0x45')](function(_0x4c5ad9){_0x25dd5a(_0x4c5ad9);});});}exports['getFields']=function(_0x20abd5,_0x56b08f,_0x78bd55){var _0x48be3a,_0x563667,_0x34dec2,_0x5857a7,_0x4d9c51;return db[_0x4172('0x40')][_0x4172('0x4d')]({'where':{'id':_0x20abd5[_0x4172('0x47')]['id']},'attributes':['id',_0x4172('0x61'),_0x4172('0x62'),'clientId',_0x4172('0x5e'),_0x4172('0x63'),_0x4172('0x64'),_0x4172('0x5c')]})['then'](handleEntityNotFound(_0x56b08f,null))[_0x4172('0x26')](function(_0xbde3a1){_0x4d9c51=_0xbde3a1;_0x48be3a=_0x4d9c51[_0x4172('0x61')];_0x563667=_0x48be3a===_0x4172('0x65')?'eu':_0x4172('0x66');_0x34dec2=_0x4d9c51[_0x4172('0x63')];var _0x22c44a=_0x34dec2[_0x4172('0x67')](-0x1);if(_0x22c44a==='/'||_0x22c44a==='\x5c'||_0x22c44a===':'){_0x34dec2=_0x34dec2['substring'](0x0,_0x34dec2[_0x4172('0x68')](_0x22c44a));}if(!_0x4d9c51[_0x4172('0x5c')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4d9c51);})[_0x4172('0x26')](function(_0xeff34d){if(_0xeff34d){return rp({'method':_0x4172('0x69'),'uri':util['format'](_0x4172('0x6a'),_0x563667),'qs':{'module':_0x4172('0x6b')},'headers':{'Authorization':_0x4172('0x6c')+_0xeff34d},'json':!![]});}})[_0x4172('0x26')](function(_0x591609){if(_0x591609){if(_0x591609[_0x4172('0x6d')]&&_0x591609[_0x4172('0x6d')]['error']){throw new Error(_0x591609['response'][_0x4172('0x29')][_0x4172('0x6e')]);}var _0xb586a2=[];var _0x2760dd=[];var _0x4d02e3=[_0x4172('0x6f'),_0x4172('0x70'),'Description','WhoId','Call_Duration',_0x4172('0x71'),'Call_Start_Time',_0x4172('0x72')];_0x2760dd=_[_0x4172('0x73')](_0x591609[_0x4172('0x35')],function(_0x368ce8){return _0x4d02e3[_0x4172('0x74')](_0x368ce8[_0x4172('0x75')]);});for(var _0x5088fd=0x0;_0x5088fd<_0x2760dd[_0x4172('0x36')];_0x5088fd++){if(_0x2760dd[_0x5088fd][_0x4172('0x76')]===![]){_0xb586a2[_0x4172('0x77')]({'id':_0x2760dd[_0x5088fd]['id'],'name':_0x2760dd[_0x5088fd][_0x4172('0x78')],'custom':_0x2760dd[_0x5088fd][_0x4172('0x79')],'options':_0x2760dd[_0x5088fd][_0x4172('0x7a')]===_0x4172('0x7b')&&_0x2760dd[_0x5088fd][_0x4172('0x7c')][_0x4172('0x36')]>-0x1?_[_0x4172('0x2d')](_0x2760dd[_0x5088fd][_0x4172('0x7c')],function(_0x36d181){return{'name':_0x36d181,'value':_0x36d181};}):[]});}}return{'count':_0xb586a2['length'],'rows':_0xb586a2};}else{return{'count':0x0,'rows':[]};}})[_0x4172('0x26')](respondWithResult(_0x56b08f,null))[_0x4172('0x45')](function(_0x552d39){var _0x194a86=_0x20abd5['query'][_0x4172('0x7d')]?0x1f4:_0x552d39[_0x4172('0x7e')]||0x1f4;logger[_0x4172('0x29')](_0x4172('0x7f'),_0x4172('0x80'),_0x194a86,JSON['stringify'](_0x552d39));delete _0x552d39[_0x4172('0x2b')];if(_0x194a86===0x191){_0x194a86=0x190;}_0x56b08f['status'](_0x194a86)[_0x4172('0x2c')](_0x20abd5[_0x4172('0x32')][_0x4172('0x7d')]?{'message':_0x4172('0x81'),'statusCode':_0x552d39[_0x4172('0x7e')]}:_0x552d39);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c378ed0..c936b09 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 _0x24bd=['https://accounts.zoho.eu','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','host','lastIndexOf','/oauth/v2/token','authorization_code','catch','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn'];(function(_0x5a68c4,_0x1c6c70){var _0x41ada2=function(_0x49555a){while(--_0x49555a){_0x5a68c4['push'](_0x5a68c4['shift']());}};_0x41ada2(++_0x1c6c70);}(_0x24bd,0x194));var _0xd24b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x24bd[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xd24b('0x0'));var util=require(_0xd24b('0x1'));var logger=require(_0xd24b('0x2'))(_0xd24b('0x3'));var moment=require(_0xd24b('0x4'));var BPromise=require('bluebird');var rp=require(_0xd24b('0x5'));var fs=require('fs');var path=require(_0xd24b('0x6'));var rimraf=require(_0xd24b('0x7'));var config=require(_0xd24b('0x8'));var attributes=require(_0xd24b('0x9'));var integrations=require(_0xd24b('0xa'));module[_0xd24b('0xb')]=function(_0x51ac76,_0x188586){return _0x51ac76[_0xd24b('0xc')](_0xd24b('0xd'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x542916,_0x46eac0,_0x4bb1d9){if(_0x542916['changed']('zone')||_0x542916[_0xd24b('0xe')](_0xd24b('0xf'))||_0x542916[_0xd24b('0xe')](_0xd24b('0x10'))||_0x542916[_0xd24b('0xe')](_0xd24b('0x11'))||_0x542916[_0xd24b('0xe')](_0xd24b('0x12'))||_0x542916['changed']('host')){var _0x31a23c,_0x41db78;_0x31a23c=_0x542916[_0xd24b('0xf')];var _0x54b579=_0x31a23c[_0xd24b('0x13')](-0x1);if(_0x54b579==='/'||_0x54b579==='\x5c'||_0x54b579===':'){_0x31a23c=_0x31a23c[_0xd24b('0x14')](0x0,_0x31a23c['lastIndexOf'](_0x54b579));}switch(_0x542916[_0xd24b('0x15')]){case'US':_0x41db78=_0xd24b('0x16');break;case'AU':_0x41db78=_0xd24b('0x17');break;case'IN':_0x41db78=_0xd24b('0x18');break;case'CN':_0x41db78=_0xd24b('0x19');break;default:_0x41db78=_0xd24b('0x1a');break;}var _0x310290={'method':'POST','uri':_0x41db78+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x542916[_0xd24b('0x10')],'client_secret':_0x542916[_0xd24b('0x11')],'redirect_uri':_0x542916[_0xd24b('0xf')],'code':_0x542916[_0xd24b('0x12')]},'headers':{'Content-Type':_0xd24b('0x1b')}};return rp(_0x310290)[_0xd24b('0x1c')](function(_0x4670a9){var _0x218760=JSON[_0xd24b('0x1d')](_0x4670a9);if(_0x218760[_0xd24b('0x1e')]){_0x542916[_0xd24b('0x1f')]=_0x218760[_0xd24b('0x1e')];logger['info'](util['format'](_0xd24b('0x20'),_0x542916[_0xd24b('0x21')],_0x542916['id']));}else{logger[_0xd24b('0x22')](util[_0xd24b('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x542916[_0xd24b('0x21')],_0x542916['id']),util['inspect'](_0x218760,{'showHidden':![],'depth':null}));}return _0x4bb1d9(null,_0x46eac0);})['catch'](function(_0x4842e7){logger['error'](util[_0xd24b('0x23')](_0xd24b('0x24'),_0x542916[_0xd24b('0x21')],_0x542916['id']),util[_0xd24b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4bb1d9(_0x4842e7);});}else{return _0x4bb1d9(null,_0x46eac0);}},'beforeUpdate':function(_0x280553,_0x29d449,_0x116172){if(_0x280553[_0xd24b('0xe')](_0xd24b('0x15'))||_0x280553[_0xd24b('0xe')](_0xd24b('0xf'))||_0x280553[_0xd24b('0xe')](_0xd24b('0x10'))||_0x280553[_0xd24b('0xe')](_0xd24b('0x11'))||_0x280553[_0xd24b('0xe')](_0xd24b('0x12'))||_0x280553['changed'](_0xd24b('0x26'))){var _0x5d3288,_0xce9dc3;_0x5d3288=_0x280553[_0xd24b('0xf')];var _0x701610=_0x5d3288['slice'](-0x1);if(_0x701610==='/'||_0x701610==='\x5c'||_0x701610===':'){_0x5d3288=_0x5d3288[_0xd24b('0x14')](0x0,_0x5d3288[_0xd24b('0x27')](_0x701610));}switch(_0x280553[_0xd24b('0x15')]){case'US':_0xce9dc3=_0xd24b('0x16');break;case'AU':_0xce9dc3=_0xd24b('0x17');break;case'IN':_0xce9dc3=_0xd24b('0x18');break;case'CN':_0xce9dc3=_0xd24b('0x19');break;default:_0xce9dc3='https://accounts.zoho.eu';break;}var _0x5a863e={'method':'POST','uri':_0xce9dc3+_0xd24b('0x28'),'form':{'grant_type':_0xd24b('0x29'),'client_id':_0x280553[_0xd24b('0x10')],'client_secret':_0x280553[_0xd24b('0x11')],'redirect_uri':_0x280553[_0xd24b('0xf')],'code':_0x280553[_0xd24b('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5a863e)[_0xd24b('0x1c')](function(_0x315da2){var _0x44c03c=JSON[_0xd24b('0x1d')](_0x315da2);if(_0x44c03c[_0xd24b('0x1e')]){_0x280553['refreshToken']=_0x44c03c[_0xd24b('0x1e')];logger['info'](util[_0xd24b('0x23')](_0xd24b('0x20'),_0x280553[_0xd24b('0x21')],_0x280553['id']));}else{logger['error'](util[_0xd24b('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x280553[_0xd24b('0x21')],_0x280553['id']),util[_0xd24b('0x25')](_0x44c03c,{'showHidden':![],'depth':null}));}return _0x116172(null,_0x29d449);})[_0xd24b('0x2a')](function(_0x1ed001){logger['error'](util[_0xd24b('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x280553[_0xd24b('0x21')],_0x280553['id']),util[_0xd24b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x116172(_0x1ed001);});}else{return _0x116172(null,_0x29d449);}}}});}; \ No newline at end of file +var _0x5d44=['https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','clientSecret','slice','parse','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x2a8439,_0x39dfaa){var _0x51bf1f=function(_0x167955){while(--_0x167955){_0x2a8439['push'](_0x2a8439['shift']());}};_0x51bf1f(++_0x39dfaa);}(_0x5d44,0x6e));var _0x45d4=function(_0x54a7ca,_0x278a23){_0x54a7ca=_0x54a7ca-0x0;var _0x297ee7=_0x5d44[_0x54a7ca];return _0x297ee7;};'use strict';var _=require(_0x45d4('0x0'));var util=require(_0x45d4('0x1'));var logger=require(_0x45d4('0x2'))(_0x45d4('0x3'));var moment=require(_0x45d4('0x4'));var BPromise=require('bluebird');var rp=require(_0x45d4('0x5'));var fs=require('fs');var path=require(_0x45d4('0x6'));var rimraf=require('rimraf');var config=require(_0x45d4('0x7'));var attributes=require(_0x45d4('0x8'));var integrations=require(_0x45d4('0x9'));module[_0x45d4('0xa')]=function(_0x49bf26,_0x4e89fb){return _0x49bf26[_0x45d4('0xb')](_0x45d4('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xdc4612,_0x35df85,_0x401dd0){if(_0xdc4612[_0x45d4('0xd')](_0x45d4('0xe'))||_0xdc4612[_0x45d4('0xd')](_0x45d4('0xf'))||_0xdc4612[_0x45d4('0xd')]('clientId')||_0xdc4612[_0x45d4('0xd')]('clientSecret')||_0xdc4612[_0x45d4('0xd')](_0x45d4('0x10'))||_0xdc4612[_0x45d4('0xd')](_0x45d4('0x11'))){var _0x1eb33f,_0x14babe;_0x1eb33f=_0xdc4612['serverUrl'];var _0x249a29=_0x1eb33f['slice'](-0x1);if(_0x249a29==='/'||_0x249a29==='\x5c'||_0x249a29===':'){_0x1eb33f=_0x1eb33f[_0x45d4('0x12')](0x0,_0x1eb33f[_0x45d4('0x13')](_0x249a29));}switch(_0xdc4612[_0x45d4('0xe')]){case'US':_0x14babe=_0x45d4('0x14');break;case'AU':_0x14babe=_0x45d4('0x15');break;case'IN':_0x14babe=_0x45d4('0x16');break;case'CN':_0x14babe=_0x45d4('0x17');break;default:_0x14babe=_0x45d4('0x18');break;}var _0x156896={'method':_0x45d4('0x19'),'uri':_0x14babe+_0x45d4('0x1a'),'form':{'grant_type':_0x45d4('0x1b'),'client_id':_0xdc4612[_0x45d4('0x1c')],'client_secret':_0xdc4612['clientSecret'],'redirect_uri':_0xdc4612['serverUrl'],'code':_0xdc4612[_0x45d4('0x10')]},'headers':{'Content-Type':_0x45d4('0x1d')}};return rp(_0x156896)[_0x45d4('0x1e')](function(_0x3686ba){var _0x50010f=JSON['parse'](_0x3686ba);if(_0x50010f[_0x45d4('0x1f')]){_0xdc4612[_0x45d4('0x20')]=_0x50010f[_0x45d4('0x1f')];logger[_0x45d4('0x21')](util[_0x45d4('0x22')](_0x45d4('0x23'),_0xdc4612['name'],_0xdc4612['id']));}else{logger[_0x45d4('0x24')](util[_0x45d4('0x22')](_0x45d4('0x25'),_0xdc4612[_0x45d4('0x26')],_0xdc4612['id']),util[_0x45d4('0x27')](_0x50010f,{'showHidden':![],'depth':null}));}return _0x401dd0(null,_0x35df85);})[_0x45d4('0x28')](function(_0xaeaeb5){logger[_0x45d4('0x24')](util['format'](_0x45d4('0x25'),_0xdc4612[_0x45d4('0x26')],_0xdc4612['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x401dd0(_0xaeaeb5);});}else{return _0x401dd0(null,_0x35df85);}},'beforeUpdate':function(_0x3e2305,_0x4fe2bc,_0xaf2093){if(_0x3e2305[_0x45d4('0xd')](_0x45d4('0xe'))||_0x3e2305[_0x45d4('0xd')](_0x45d4('0xf'))||_0x3e2305[_0x45d4('0xd')](_0x45d4('0x1c'))||_0x3e2305[_0x45d4('0xd')](_0x45d4('0x29'))||_0x3e2305[_0x45d4('0xd')]('code')||_0x3e2305[_0x45d4('0xd')](_0x45d4('0x11'))){var _0x3afb2c,_0x1f9184;_0x3afb2c=_0x3e2305[_0x45d4('0xf')];var _0x2142f0=_0x3afb2c[_0x45d4('0x2a')](-0x1);if(_0x2142f0==='/'||_0x2142f0==='\x5c'||_0x2142f0===':'){_0x3afb2c=_0x3afb2c[_0x45d4('0x12')](0x0,_0x3afb2c['lastIndexOf'](_0x2142f0));}switch(_0x3e2305[_0x45d4('0xe')]){case'US':_0x1f9184=_0x45d4('0x14');break;case'AU':_0x1f9184='https://accounts.zoho.com.au';break;case'IN':_0x1f9184=_0x45d4('0x16');break;case'CN':_0x1f9184=_0x45d4('0x17');break;default:_0x1f9184=_0x45d4('0x18');break;}var _0x72f081={'method':'POST','uri':_0x1f9184+_0x45d4('0x1a'),'form':{'grant_type':_0x45d4('0x1b'),'client_id':_0x3e2305[_0x45d4('0x1c')],'client_secret':_0x3e2305[_0x45d4('0x29')],'redirect_uri':_0x3e2305[_0x45d4('0xf')],'code':_0x3e2305[_0x45d4('0x10')]},'headers':{'Content-Type':_0x45d4('0x1d')}};return rp(_0x72f081)[_0x45d4('0x1e')](function(_0x3706f5){var _0x5f45cb=JSON[_0x45d4('0x2b')](_0x3706f5);if(_0x5f45cb[_0x45d4('0x1f')]){_0x3e2305[_0x45d4('0x20')]=_0x5f45cb[_0x45d4('0x1f')];logger[_0x45d4('0x21')](util['format'](_0x45d4('0x23'),_0x3e2305[_0x45d4('0x26')],_0x3e2305['id']));}else{logger['error'](util[_0x45d4('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3e2305['name'],_0x3e2305['id']),util['inspect'](_0x5f45cb,{'showHidden':![],'depth':null}));}return _0xaf2093(null,_0x4fe2bc);})['catch'](function(_0xabb665){logger['error'](util[_0x45d4('0x22')](_0x45d4('0x25'),_0x3e2305['name'],_0x3e2305['id']),util[_0x45d4('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0xaf2093(_0xabb665);});}else{return _0xaf2093(null,_0x4fe2bc);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index bfffa36..07b3133 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 _0xed5c=['client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','then','stringify','ShowZohoAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x49e10a,_0x506386){var _0xc31416=function(_0x31fb3c){while(--_0x31fb3c){_0x49e10a['push'](_0x49e10a['shift']());}};_0xc31416(++_0x506386);}(_0xed5c,0x81));var _0xced5=function(_0x32f69a,_0x43e98a){_0x32f69a=_0x32f69a-0x0;var _0x4e8374=_0xed5c[_0x32f69a];return _0x4e8374;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var moment=require(_0xced5('0x2'));var BPromise=require(_0xced5('0x3'));var rs=require(_0xced5('0x4'));var fs=require('fs');var Redis=require(_0xced5('0x5'));var db=require(_0xced5('0x6'))['db'];var utils=require(_0xced5('0x7'));var logger=require(_0xced5('0x8'))(_0xced5('0x9'));var config=require('../../config/environment');var jayson=require(_0xced5('0xa'));var client=jayson[_0xced5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c59d1,_0x31a495,_0xc738da){return new BPromise(function(_0x2857d8,_0x2113e4){return client[_0xced5('0xc')](_0x5c59d1,_0xc738da)['then'](function(_0x50d620){logger[_0xced5('0xd')](_0xced5('0xe'),_0x31a495,_0xced5('0xf'));logger[_0xced5('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x31a495,_0xced5('0xf'),JSON['stringify'](_0x50d620));if(_0x50d620[_0xced5('0x11')]){if(_0x50d620[_0xced5('0x11')]['code']===0x1f4){logger[_0xced5('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x31a495,_0x50d620[_0xced5('0x11')][_0xced5('0x12')]);return _0x2113e4(_0x50d620[_0xced5('0x11')][_0xced5('0x12')]);}logger[_0xced5('0x11')](_0xced5('0xe'),_0x31a495,_0x50d620[_0xced5('0x11')]['message']);return _0x2857d8(_0x50d620['error'][_0xced5('0x12')]);}else{logger[_0xced5('0xd')](_0xced5('0xe'),_0x31a495,'request\x20sent');_0x2857d8(_0x50d620['result'][_0xced5('0x12')]);}})[_0xced5('0x13')](function(_0x3e1dfc){logger[_0xced5('0x11')](_0xced5('0xe'),_0x31a495,_0x3e1dfc);_0x2113e4(_0x3e1dfc);});});}exports[_0xced5('0x14')]=function(_0x54c5a4){var _0x29a3ba=this;return new Promise(function(_0x153e29,_0x5d1615){return db[_0xced5('0x15')][_0xced5('0x16')]({'raw':_0x54c5a4[_0xced5('0x17')]?_0x54c5a4['options'][_0xced5('0x18')]===undefined?!![]:![]:!![],'where':_0x54c5a4[_0xced5('0x17')]?_0x54c5a4[_0xced5('0x17')]['where']||null:null,'attributes':_0x54c5a4[_0xced5('0x17')]?_0x54c5a4[_0xced5('0x17')][_0xced5('0x19')]||null:null,'limit':_0x54c5a4[_0xced5('0x17')]?_0x54c5a4[_0xced5('0x17')][_0xced5('0x1a')]||null:null,'include':_0x54c5a4['options']?_0x54c5a4[_0xced5('0x17')][_0xced5('0x1b')]?_[_0xced5('0x1c')](_0x54c5a4[_0xced5('0x17')][_0xced5('0x1b')],function(_0x18f299){return{'model':db[_0x18f299[_0xced5('0x1d')]],'as':_0x18f299['as'],'attributes':_0x18f299[_0xced5('0x19')],'include':_0x18f299[_0xced5('0x1b')]?_[_0xced5('0x1c')](_0x18f299[_0xced5('0x1b')],function(_0x2f092b){return{'model':db[_0x2f092b[_0xced5('0x1d')]],'as':_0x2f092b['as'],'attributes':_0x2f092b[_0xced5('0x19')],'include':_0x2f092b['include']?_['map'](_0x2f092b[_0xced5('0x1b')],function(_0x2cd6c4){return{'model':db[_0x2cd6c4[_0xced5('0x1d')]],'as':_0x2cd6c4['as'],'attributes':_0x2cd6c4[_0xced5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced5('0x1e')](function(_0x26790a){logger[_0xced5('0xd')](_0xced5('0x14'),_0x54c5a4);logger[_0xced5('0x10')](_0xced5('0x14'),_0x54c5a4,JSON[_0xced5('0x1f')](_0x26790a));_0x153e29(_0x26790a);})['catch'](function(_0x20aa83){logger[_0xced5('0x11')]('GetZohoAccount',_0x20aa83['message'],_0x54c5a4);_0x5d1615(_0x29a3ba['error'](0x1f4,_0x20aa83['message']));});});};exports[_0xced5('0x20')]=function(_0x2f7cd4){var _0x9d2fee=this;return new Promise(function(_0x409ff4,_0xd502de){return db['ZohoAccount'][_0xced5('0x21')]({'raw':_0x2f7cd4['options']?_0x2f7cd4[_0xced5('0x17')][_0xced5('0x18')]===undefined?!![]:![]:!![],'where':_0x2f7cd4['options']?_0x2f7cd4['options'][_0xced5('0x22')]||null:null,'attributes':_0x2f7cd4['options']?_0x2f7cd4[_0xced5('0x17')][_0xced5('0x19')]||null:null,'include':_0x2f7cd4[_0xced5('0x17')]?_0x2f7cd4[_0xced5('0x17')][_0xced5('0x1b')]?_[_0xced5('0x1c')](_0x2f7cd4[_0xced5('0x17')]['include'],function(_0x1f49b5){return{'model':db[_0x1f49b5[_0xced5('0x1d')]],'as':_0x1f49b5['as'],'attributes':_0x1f49b5['attributes'],'include':_0x1f49b5[_0xced5('0x1b')]?_[_0xced5('0x1c')](_0x1f49b5['include'],function(_0x288ab0){return{'model':db[_0x288ab0[_0xced5('0x1d')]],'as':_0x288ab0['as'],'attributes':_0x288ab0['attributes'],'include':_0x288ab0[_0xced5('0x1b')]?_['map'](_0x288ab0[_0xced5('0x1b')],function(_0x4f64a4){return{'model':db[_0x4f64a4[_0xced5('0x1d')]],'as':_0x4f64a4['as'],'attributes':_0x4f64a4[_0xced5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ba805){logger[_0xced5('0xd')](_0xced5('0x20'),_0x2f7cd4);logger['debug'](_0xced5('0x20'),_0x2f7cd4,JSON[_0xced5('0x1f')](_0x5ba805));_0x409ff4(_0x5ba805);})['catch'](function(_0x43c1d8){logger[_0xced5('0x11')](_0xced5('0x20'),_0x43c1d8['message'],_0x2f7cd4);_0xd502de(_0x9d2fee[_0xced5('0x11')](0x1f4,_0x43c1d8[_0xced5('0x12')]));});});}; \ No newline at end of file +var _0xed1c=['model','ShowZohoAccount','find','debug','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','include','map'];(function(_0x4b9d59,_0x910c53){var _0x2426ba=function(_0x25bae3){while(--_0x25bae3){_0x4b9d59['push'](_0x4b9d59['shift']());}};_0x2426ba(++_0x910c53);}(_0xed1c,0xe4));var _0xced1=function(_0x1bbe54,_0xdc2c1b){_0x1bbe54=_0x1bbe54-0x0;var _0x1c5952=_0xed1c[_0x1bbe54];return _0x1c5952;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});}exports[_0xced1('0x14')]=function(_0x5a563a){var _0x56fc50=this;return new Promise(function(_0x2a92c8,_0x111fb0){return db[_0xced1('0x15')]['findAll']({'raw':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')][_0xced1('0x17')]===undefined?!![]:![]:!![],'where':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x5a563a[_0xced1('0x16')]?_0x5a563a['options'][_0xced1('0x19')]||null:null,'limit':_0x5a563a[_0xced1('0x16')]?_0x5a563a[_0xced1('0x16')]['limit']||null:null,'include':_0x5a563a['options']?_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x5a563a[_0xced1('0x16')][_0xced1('0x1a')],function(_0x49c8b9){return{'model':db[_0x49c8b9[_0xced1('0x1c')]],'as':_0x49c8b9['as'],'attributes':_0x49c8b9[_0xced1('0x19')],'include':_0x49c8b9['include']?_['map'](_0x49c8b9[_0xced1('0x1a')],function(_0x258c9a){return{'model':db[_0x258c9a[_0xced1('0x1c')]],'as':_0x258c9a['as'],'attributes':_0x258c9a[_0xced1('0x19')],'include':_0x258c9a[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x258c9a['include'],function(_0x181f6e){return{'model':db[_0x181f6e[_0xced1('0x1c')]],'as':_0x181f6e['as'],'attributes':_0x181f6e[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x34dd2e){logger[_0xced1('0xb')](_0xced1('0x14'),_0x5a563a);logger['debug'](_0xced1('0x14'),_0x5a563a,JSON['stringify'](_0x34dd2e));_0x2a92c8(_0x34dd2e);})[_0xced1('0x13')](function(_0x2c2269){logger[_0xced1('0xf')](_0xced1('0x14'),_0x2c2269['message'],_0x5a563a);_0x111fb0(_0x56fc50['error'](0x1f4,_0x2c2269[_0xced1('0x11')]));});});};exports[_0xced1('0x1d')]=function(_0x2bc785){var _0x4ea07e=this;return new Promise(function(_0x573146,_0x543c47){return db[_0xced1('0x15')][_0xced1('0x1e')]({'raw':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x18')]||null:null,'attributes':_0x2bc785[_0xced1('0x16')]?_0x2bc785[_0xced1('0x16')][_0xced1('0x19')]||null:null,'include':_0x2bc785[_0xced1('0x16')]?_0x2bc785['options']['include']?_[_0xced1('0x1b')](_0x2bc785[_0xced1('0x16')][_0xced1('0x1a')],function(_0x7ebeb3){return{'model':db[_0x7ebeb3[_0xced1('0x1c')]],'as':_0x7ebeb3['as'],'attributes':_0x7ebeb3[_0xced1('0x19')],'include':_0x7ebeb3['include']?_['map'](_0x7ebeb3['include'],function(_0x4d305c){return{'model':db[_0x4d305c[_0xced1('0x1c')]],'as':_0x4d305c['as'],'attributes':_0x4d305c[_0xced1('0x19')],'include':_0x4d305c[_0xced1('0x1a')]?_[_0xced1('0x1b')](_0x4d305c[_0xced1('0x1a')],function(_0x1c36fa){return{'model':db[_0x1c36fa[_0xced1('0x1c')]],'as':_0x1c36fa['as'],'attributes':_0x1c36fa[_0xced1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xced1('0xa')](function(_0x3dfd2f){logger[_0xced1('0xb')](_0xced1('0x1d'),_0x2bc785);logger[_0xced1('0x1f')]('ShowZohoAccount',_0x2bc785,JSON[_0xced1('0xe')](_0x3dfd2f));_0x573146(_0x3dfd2f);})[_0xced1('0x13')](function(_0x1116de){logger[_0xced1('0xf')](_0xced1('0x1d'),_0x1116de[_0xced1('0x11')],_0x2bc785);_0x543c47(_0x4ea07e['error'](0x1f4,_0x1116de[_0xced1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 3bde860..858dc93 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 _0x614d=['../../components/interaction/service','get','index','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0x614d,0x1ee));var _0xd614=function(_0x2a370c,_0x37bc17){_0x2a370c=_0x2a370c-0x0;var _0x5c4621=_0x614d[_0x2a370c];return _0x5c4621;};'use strict';var multer=require(_0xd614('0x0'));var util=require(_0xd614('0x1'));var path=require(_0xd614('0x2'));var timeout=require(_0xd614('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd614('0x4'));var auth=require(_0xd614('0x5'));var interaction=require(_0xd614('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xd614('0x7')]('/',auth['isAuthenticated'](),controller[_0xd614('0x8')]);router[_0xd614('0x7')](_0xd614('0x9'),auth['isAuthenticated'](),controller[_0xd614('0xa')]);router[_0xd614('0x7')](_0xd614('0xb'),auth['isAuthenticated'](),controller[_0xd614('0xc')]);router[_0xd614('0x7')](_0xd614('0xd'),auth[_0xd614('0xe')](),controller[_0xd614('0xf')]);router[_0xd614('0x7')](_0xd614('0x10'),auth[_0xd614('0xe')](),controller[_0xd614('0x11')]);router[_0xd614('0x12')]('/',auth['isAuthenticated'](),controller[_0xd614('0x13')]);router[_0xd614('0x14')](_0xd614('0x9'),auth[_0xd614('0xe')](),controller[_0xd614('0x15')]);router[_0xd614('0x16')](_0xd614('0x9'),auth[_0xd614('0xe')](),controller[_0xd614('0x17')]);module[_0xd614('0x18')]=router; \ No newline at end of file +var _0xfb6e=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x1123ed,_0x3bcc83){var _0x4cdac4=function(_0x120773){while(--_0x120773){_0x1123ed['push'](_0x1123ed['shift']());}};_0x4cdac4(++_0x3bcc83);}(_0xfb6e,0xc4));var _0xefb6=function(_0x1432b5,_0x3799fc){_0x1432b5=_0x1432b5-0x0;var _0x491241=_0xfb6e[_0x1432b5];return _0x491241;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xefb6('0x0'));var timeout=require(_0xefb6('0x1'));var express=require(_0xefb6('0x2'));var router=express[_0xefb6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xefb6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xefb6('0x5'));var controller=require(_0xefb6('0x6'));router['get']('/',auth[_0xefb6('0x7')](),controller[_0xefb6('0x8')]);router[_0xefb6('0x9')](_0xefb6('0xa'),auth[_0xefb6('0x7')](),controller[_0xefb6('0xb')]);router[_0xefb6('0x9')](_0xefb6('0xc'),auth[_0xefb6('0x7')](),controller[_0xefb6('0xd')]);router['get']('/:id/subjects',auth[_0xefb6('0x7')](),controller[_0xefb6('0xe')]);router[_0xefb6('0x9')](_0xefb6('0xf'),auth[_0xefb6('0x7')](),controller[_0xefb6('0x10')]);router[_0xefb6('0x11')]('/',auth['isAuthenticated'](),controller[_0xefb6('0x12')]);router[_0xefb6('0x13')](_0xefb6('0xa'),auth[_0xefb6('0x7')](),controller[_0xefb6('0x14')]);router[_0xefb6('0x15')](_0xefb6('0xa'),auth[_0xefb6('0x7')](),controller[_0xefb6('0x16')]);module[_0xefb6('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index d9be6e8..fa1607f 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 _0x5a01=['contact','nothing','ENUM','contact_lead','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5a01,0x1af));var _0x15a0=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x5a01[_0x108831];return _0x4da77a;};'use strict';var Sequelize=require(_0x15a0('0x0'));module[_0x15a0('0x1')]={'name':{'type':Sequelize[_0x15a0('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x15a0('0x3'),_0x15a0('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x15a0('0x5')](_0x15a0('0x6'),_0x15a0('0x3'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x15a0('0x2')]}}; \ No newline at end of file +var _0xc7bf=['ENUM','lead','contact','nothing','contact_lead','sequelize','STRING'];(function(_0x4863eb,_0x2d73ed){var _0x51b74b=function(_0x341b6a){while(--_0x341b6a){_0x4863eb['push'](_0x4863eb['shift']());}};_0x51b74b(++_0x2d73ed);}(_0xc7bf,0x1e8));var _0xfc7b=function(_0x7f8769,_0x4ff9bc){_0x7f8769=_0x7f8769-0x0;var _0x2f61a3=_0xc7bf[_0x7f8769];return _0x2f61a3;};'use strict';var Sequelize=require(_0xfc7b('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc7b('0x1')]},'moduleCreate':{'type':Sequelize[_0xfc7b('0x2')](_0xfc7b('0x3'),_0xfc7b('0x4'),_0xfc7b('0x5')),'defaultValue':_0xfc7b('0x3')},'moduleSearch':{'type':Sequelize[_0xfc7b('0x2')](_0xfc7b('0x6'),_0xfc7b('0x4'),_0xfc7b('0x3')),'defaultValue':_0xfc7b('0x6')},'description':{'type':Sequelize[_0xfc7b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 99118d2..0aad4db 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 _0x3507=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x3507,0x169));var _0x7350=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0x3507[_0x4cb095];return _0x2b565d;};'use strict';var emlformat=require(_0x7350('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7350('0x1'));var jsonpatch=require(_0x7350('0x2'));var rp=require(_0x7350('0x3'));var moment=require('moment');var BPromise=require(_0x7350('0x4'));var Mustache=require(_0x7350('0x5'));var util=require(_0x7350('0x6'));var path=require(_0x7350('0x7'));var sox=require(_0x7350('0x8'));var csv=require(_0x7350('0x9'));var ejs=require(_0x7350('0xa'));var fs=require('fs');var fs_extra=require(_0x7350('0xb'));var _=require(_0x7350('0xc'));var squel=require('squel');var crypto=require(_0x7350('0xd'));var jsforce=require(_0x7350('0xe'));var deskjs=require(_0x7350('0xf'));var toCsv=require(_0x7350('0x9'));var querystring=require(_0x7350('0x10'));var Papa=require(_0x7350('0x11'));var Redis=require(_0x7350('0x12'));var authService=require(_0x7350('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7350('0x14'));var hardwareService=require(_0x7350('0x15'));var logger=require('../../config/logger')(_0x7350('0x16'));var utils=require(_0x7350('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7350('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a6b89,_0x86e26f){_0x86e26f=_0x86e26f||0xcc;return function(_0x2b4bd6){if(_0x2b4bd6){return _0x4a6b89['sendStatus'](_0x86e26f);}return _0x4a6b89[_0x7350('0x19')](_0x86e26f)[_0x7350('0x1a')]();};}function respondWithResult(_0x4593dd,_0x8f9284){_0x8f9284=_0x8f9284||0xc8;return function(_0x3b2c14){if(_0x3b2c14){return _0x4593dd[_0x7350('0x19')](_0x8f9284)[_0x7350('0x1b')](_0x3b2c14);}};}function respondWithFilteredResult(_0x563073,_0x4a7cc3){return function(_0x55b653){if(_0x55b653){var _0xc55cf=typeof _0x4a7cc3[_0x7350('0x1c')]==='undefined'&&typeof _0x4a7cc3[_0x7350('0x1d')]===_0x7350('0x1e');var _0x985e1e=_0x55b653[_0x7350('0x1f')];var _0x5dc356=_0xc55cf?0x0:_0x4a7cc3[_0x7350('0x1c')];var _0x1f1e79=_0xc55cf?_0x55b653[_0x7350('0x1f')]:_0x4a7cc3['offset']+_0x4a7cc3[_0x7350('0x1d')];var _0xa47278;if(_0x1f1e79>=_0x985e1e){_0x1f1e79=_0x985e1e;_0xa47278=0xc8;}else{_0xa47278=0xce;}_0x563073[_0x7350('0x19')](_0xa47278);return _0x563073[_0x7350('0x20')](_0x7350('0x21'),_0x5dc356+'-'+_0x1f1e79+'/'+_0x985e1e)[_0x7350('0x1b')](_0x55b653);}return null;};}function patchUpdates(_0x2a1f64){return function(_0x105a15){try{jsonpatch[_0x7350('0x22')](_0x105a15,_0x2a1f64,!![]);}catch(_0x41b562){return BPromise['reject'](_0x41b562);}return _0x105a15[_0x7350('0x23')]();};}function saveUpdates(_0xc4aac8,_0xecbe96){return function(_0x291d28){if(_0x291d28){return _0x291d28[_0x7350('0x24')](_0xc4aac8)['then'](function(_0x3b7ab9){return _0x3b7ab9;});}return null;};}function removeEntity(_0x5beb73,_0xdf8e48){return function(_0x4b3f7b){if(_0x4b3f7b){return _0x4b3f7b['destroy']()[_0x7350('0x25')](function(){_0x5beb73['status'](0xcc)[_0x7350('0x1a')]();});}};}function handleEntityNotFound(_0x2a719d,_0x8e1a2a){return function(_0x5d2dfd){if(!_0x5d2dfd){_0x2a719d[_0x7350('0x26')](0x194);}return _0x5d2dfd;};}function handleError(_0x5ef0bd,_0x319624){_0x319624=_0x319624||0x1f4;return function(_0x5a14fc){logger[_0x7350('0x27')](_0x5a14fc[_0x7350('0x28')]);if(_0x5a14fc[_0x7350('0x29')]){delete _0x5a14fc[_0x7350('0x29')];}_0x5ef0bd['status'](_0x319624)[_0x7350('0x2a')](_0x5a14fc);};}exports[_0x7350('0x2b')]=function(_0x490a36,_0x7e7e6a){var _0x1792c0={},_0x52014e={},_0x13623a={'count':0x0,'rows':[]};var _0x4e2f50=_[_0x7350('0x2c')](db[_0x7350('0x2d')][_0x7350('0x2e')],function(_0x1026cc){return{'name':_0x1026cc[_0x7350('0x2f')],'type':_0x1026cc[_0x7350('0x30')][_0x7350('0x31')]};});_0x52014e[_0x7350('0x32')]=_[_0x7350('0x2c')](_0x4e2f50,'name');_0x52014e[_0x7350('0x33')]=_['keys'](_0x490a36[_0x7350('0x33')]);_0x52014e[_0x7350('0x34')]=_[_0x7350('0x35')](_0x52014e[_0x7350('0x32')],_0x52014e[_0x7350('0x33')]);_0x1792c0[_0x7350('0x36')]=_[_0x7350('0x35')](_0x52014e[_0x7350('0x32')],qs[_0x7350('0x37')](_0x490a36[_0x7350('0x33')][_0x7350('0x37')]));_0x1792c0[_0x7350('0x36')]=_0x1792c0['attributes'][_0x7350('0x38')]?_0x1792c0[_0x7350('0x36')]:_0x52014e[_0x7350('0x32')];if(!_0x490a36[_0x7350('0x33')][_0x7350('0x39')](_0x7350('0x3a'))){_0x1792c0['limit']=qs[_0x7350('0x1d')](_0x490a36[_0x7350('0x33')][_0x7350('0x1d')]);_0x1792c0['offset']=qs[_0x7350('0x1c')](_0x490a36[_0x7350('0x33')][_0x7350('0x1c')]);}_0x1792c0[_0x7350('0x3b')]=qs[_0x7350('0x3c')](_0x490a36[_0x7350('0x33')][_0x7350('0x3c')]);_0x1792c0[_0x7350('0x3d')]=qs['filters'](_[_0x7350('0x3e')](_0x490a36[_0x7350('0x33')],_0x52014e[_0x7350('0x34')]),_0x4e2f50);if(_0x490a36['query'][_0x7350('0x3f')]){_0x1792c0[_0x7350('0x3d')]=_['merge'](_0x1792c0[_0x7350('0x3d')],{'$or':_[_0x7350('0x2c')](_0x4e2f50,function(_0x1c798b){if(_0x1c798b[_0x7350('0x30')]!==_0x7350('0x40')){var _0x2895bc={};_0x2895bc[_0x1c798b[_0x7350('0x29')]]={'$like':'%'+_0x490a36[_0x7350('0x33')]['filter']+'%'};return _0x2895bc;}})});}_0x1792c0=_[_0x7350('0x41')]({},_0x1792c0,_0x490a36[_0x7350('0x42')]);var _0x125ec4={'where':_0x1792c0['where']};return db[_0x7350('0x2d')][_0x7350('0x1f')](_0x125ec4)[_0x7350('0x25')](function(_0x11b481){_0x13623a[_0x7350('0x1f')]=_0x11b481;if(_0x490a36[_0x7350('0x33')][_0x7350('0x43')]){_0x1792c0[_0x7350('0x44')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7350('0x45')](_0x1792c0);})[_0x7350('0x25')](function(_0xcade23){_0x13623a[_0x7350('0x46')]=_0xcade23;return _0x13623a;})['then'](respondWithFilteredResult(_0x7e7e6a,_0x1792c0))[_0x7350('0x47')](handleError(_0x7e7e6a,null));};exports[_0x7350('0x48')]=function(_0x4f2927,_0x4347d7){var _0x4cc1b3={'raw':![],'where':{'id':_0x4f2927[_0x7350('0x49')]['id']}},_0x30f0dd={};_0x30f0dd['model']=_[_0x7350('0x4a')](db[_0x7350('0x2d')][_0x7350('0x2e')]);_0x30f0dd['query']=_[_0x7350('0x4a')](_0x4f2927[_0x7350('0x33')]);_0x30f0dd['filters']=_[_0x7350('0x35')](_0x30f0dd[_0x7350('0x32')],_0x30f0dd[_0x7350('0x33')]);_0x4cc1b3[_0x7350('0x36')]=_[_0x7350('0x35')](_0x30f0dd[_0x7350('0x32')],qs[_0x7350('0x37')](_0x4f2927[_0x7350('0x33')]['fields']));_0x4cc1b3[_0x7350('0x36')]=_0x4cc1b3['attributes']['length']?_0x4cc1b3[_0x7350('0x36')]:_0x30f0dd['model'];if(_0x4f2927['query'][_0x7350('0x43')]){_0x4cc1b3[_0x7350('0x44')]=[{'all':!![]}];}_0x4cc1b3=_[_0x7350('0x41')]({},_0x4cc1b3,_0x4f2927['options']);return db[_0x7350('0x2d')][_0x7350('0x4b')](_0x4cc1b3)[_0x7350('0x25')](handleEntityNotFound(_0x4347d7,null))[_0x7350('0x25')](respondWithResult(_0x4347d7,null))[_0x7350('0x47')](handleError(_0x4347d7,null));};exports[_0x7350('0x4c')]=function(_0x29b036,_0x2df082){return db[_0x7350('0x2d')]['create'](_0x29b036[_0x7350('0x4d')],{})[_0x7350('0x25')](respondWithResult(_0x2df082,0xc9))['catch'](handleError(_0x2df082,null));};exports[_0x7350('0x24')]=function(_0x52ed13,_0x55b64a){if(_0x52ed13['body']['id']){delete _0x52ed13['body']['id'];}return db[_0x7350('0x2d')]['find']({'where':{'id':_0x52ed13['params']['id']}})['then'](handleEntityNotFound(_0x55b64a,null))[_0x7350('0x25')](saveUpdates(_0x52ed13[_0x7350('0x4d')],null))[_0x7350('0x25')](respondWithResult(_0x55b64a,null))[_0x7350('0x47')](handleError(_0x55b64a,null));};exports[_0x7350('0x4e')]=function(_0x214834,_0x19186a){return db[_0x7350('0x2d')][_0x7350('0x4b')]({'where':{'id':_0x214834[_0x7350('0x49')]['id']}})[_0x7350('0x25')](handleEntityNotFound(_0x19186a,null))[_0x7350('0x25')](removeEntity(_0x19186a,null))[_0x7350('0x47')](handleError(_0x19186a,null));};exports['getFields']=function(_0x413ac2,_0x812f04,_0x2f4897){var _0x25fcbc={};var _0x5fb497={};var _0x5eb158;var _0x20f271;return db[_0x7350('0x2d')][_0x7350('0x4f')]({'where':{'id':_0x413ac2[_0x7350('0x49')]['id']}})[_0x7350('0x25')](handleEntityNotFound(_0x812f04,null))[_0x7350('0x25')](function(_0x1f4ec6){if(_0x1f4ec6){_0x5eb158=_0x1f4ec6;_0x5fb497[_0x7350('0x32')]=_['keys'](db[_0x7350('0x50')]['rawAttributes']);_0x5fb497[_0x7350('0x33')]=_[_0x7350('0x4a')](_0x413ac2[_0x7350('0x33')]);_0x5fb497[_0x7350('0x34')]=_[_0x7350('0x35')](_0x5fb497['model'],_0x5fb497['query']);_0x25fcbc[_0x7350('0x36')]=_[_0x7350('0x35')](_0x5fb497[_0x7350('0x32')],qs['fields'](_0x413ac2['query'][_0x7350('0x37')]));_0x25fcbc[_0x7350('0x36')]=_0x25fcbc[_0x7350('0x36')]['length']?_0x25fcbc[_0x7350('0x36')]:_0x5fb497['model'];_0x25fcbc[_0x7350('0x3b')]=qs[_0x7350('0x3c')](_0x413ac2[_0x7350('0x33')][_0x7350('0x3c')]);_0x25fcbc[_0x7350('0x3d')]=qs[_0x7350('0x34')](_[_0x7350('0x3e')](_0x413ac2[_0x7350('0x33')],_0x5fb497['filters']));if(_0x413ac2[_0x7350('0x33')]['filter']){_0x25fcbc[_0x7350('0x3d')]=_[_0x7350('0x41')](_0x25fcbc[_0x7350('0x3d')],{'$or':_[_0x7350('0x2c')](_0x25fcbc[_0x7350('0x36')],function(_0x6167bb){var _0x2a9542={};_0x2a9542[_0x6167bb]={'$like':'%'+_0x413ac2[_0x7350('0x33')]['filter']+'%'};return _0x2a9542;})});}_0x25fcbc=_[_0x7350('0x41')]({},_0x25fcbc,_0x413ac2['options']);return _0x5eb158['getFields'](_0x25fcbc);}})[_0x7350('0x25')](function(_0x41d962){if(_0x41d962){_0x20f271=_0x41d962[_0x7350('0x38')];if(!_0x413ac2['query'][_0x7350('0x39')](_0x7350('0x3a'))){_0x25fcbc[_0x7350('0x1d')]=qs[_0x7350('0x1d')](_0x413ac2[_0x7350('0x33')]['limit']);_0x25fcbc[_0x7350('0x1c')]=qs[_0x7350('0x1c')](_0x413ac2[_0x7350('0x33')]['offset']);}return _0x5eb158[_0x7350('0x51')](_0x25fcbc);}})[_0x7350('0x25')](function(_0x2a05b4){if(_0x2a05b4){return _0x2a05b4?{'count':_0x20f271,'rows':_0x2a05b4}:null;}})[_0x7350('0x25')](respondWithResult(_0x812f04,null))['catch'](handleError(_0x812f04,null));};exports['getSubjects']=function(_0xe86bae,_0x2ec093,_0xe183e7){var _0x49b848={};var _0x3b089f={};var _0x42c967;var _0x409575;return db[_0x7350('0x2d')][_0x7350('0x4f')]({'where':{'id':_0xe86bae[_0x7350('0x49')]['id']}})[_0x7350('0x25')](handleEntityNotFound(_0x2ec093,null))['then'](function(_0x53d768){if(_0x53d768){_0x42c967=_0x53d768;_0x3b089f[_0x7350('0x32')]=_[_0x7350('0x4a')](db[_0x7350('0x50')][_0x7350('0x2e')]);_0x3b089f[_0x7350('0x33')]=_[_0x7350('0x4a')](_0xe86bae[_0x7350('0x33')]);_0x3b089f[_0x7350('0x34')]=_[_0x7350('0x35')](_0x3b089f[_0x7350('0x32')],_0x3b089f[_0x7350('0x33')]);_0x49b848[_0x7350('0x36')]=_[_0x7350('0x35')](_0x3b089f[_0x7350('0x32')],qs[_0x7350('0x37')](_0xe86bae[_0x7350('0x33')][_0x7350('0x37')]));_0x49b848['attributes']=_0x49b848[_0x7350('0x36')][_0x7350('0x38')]?_0x49b848[_0x7350('0x36')]:_0x3b089f[_0x7350('0x32')];_0x49b848[_0x7350('0x3b')]=qs[_0x7350('0x3c')](_0xe86bae['query'][_0x7350('0x3c')]);_0x49b848[_0x7350('0x3d')]=qs['filters'](_['pick'](_0xe86bae[_0x7350('0x33')],_0x3b089f[_0x7350('0x34')]));if(_0xe86bae[_0x7350('0x33')]['filter']){_0x49b848[_0x7350('0x3d')]=_[_0x7350('0x41')](_0x49b848[_0x7350('0x3d')],{'$or':_['map'](_0x49b848[_0x7350('0x36')],function(_0x3a8f23){var _0x26bac2={};_0x26bac2[_0x3a8f23]={'$like':'%'+_0xe86bae['query']['filter']+'%'};return _0x26bac2;})});}_0x49b848=_[_0x7350('0x41')]({},_0x49b848,_0xe86bae[_0x7350('0x42')]);return _0x42c967[_0x7350('0x52')](_0x49b848);}})[_0x7350('0x25')](function(_0x5bc10f){if(_0x5bc10f){_0x409575=_0x5bc10f[_0x7350('0x38')];if(!_0xe86bae['query'][_0x7350('0x39')](_0x7350('0x3a'))){_0x49b848[_0x7350('0x1d')]=qs[_0x7350('0x1d')](_0xe86bae[_0x7350('0x33')]['limit']);_0x49b848[_0x7350('0x1c')]=qs[_0x7350('0x1c')](_0xe86bae[_0x7350('0x33')][_0x7350('0x1c')]);}return _0x42c967['getSubjects'](_0x49b848);}})[_0x7350('0x25')](function(_0x4c87ef){if(_0x4c87ef){return _0x4c87ef?{'count':_0x409575,'rows':_0x4c87ef}:null;}})[_0x7350('0x25')](respondWithResult(_0x2ec093,null))[_0x7350('0x47')](handleError(_0x2ec093,null));};exports[_0x7350('0x53')]=function(_0x2c2e42,_0x30706e,_0x58b5a0){var _0x3a39ff={};var _0x3201e1={};var _0xb5931c;var _0x2d7316;return db[_0x7350('0x2d')][_0x7350('0x4f')]({'where':{'id':_0x2c2e42[_0x7350('0x49')]['id']}})[_0x7350('0x25')](handleEntityNotFound(_0x30706e,null))[_0x7350('0x25')](function(_0x3ffdd7){if(_0x3ffdd7){_0xb5931c=_0x3ffdd7;_0x3201e1[_0x7350('0x32')]=_[_0x7350('0x4a')](db['ZohoField']['rawAttributes']);_0x3201e1[_0x7350('0x33')]=_[_0x7350('0x4a')](_0x2c2e42[_0x7350('0x33')]);_0x3201e1[_0x7350('0x34')]=_[_0x7350('0x35')](_0x3201e1[_0x7350('0x32')],_0x3201e1[_0x7350('0x33')]);_0x3a39ff[_0x7350('0x36')]=_[_0x7350('0x35')](_0x3201e1[_0x7350('0x32')],qs[_0x7350('0x37')](_0x2c2e42[_0x7350('0x33')]['fields']));_0x3a39ff[_0x7350('0x36')]=_0x3a39ff[_0x7350('0x36')]['length']?_0x3a39ff[_0x7350('0x36')]:_0x3201e1['model'];_0x3a39ff['order']=qs[_0x7350('0x3c')](_0x2c2e42[_0x7350('0x33')][_0x7350('0x3c')]);_0x3a39ff['where']=qs['filters'](_['pick'](_0x2c2e42[_0x7350('0x33')],_0x3201e1[_0x7350('0x34')]));if(_0x2c2e42[_0x7350('0x33')][_0x7350('0x3f')]){_0x3a39ff['where']=_[_0x7350('0x41')](_0x3a39ff[_0x7350('0x3d')],{'$or':_[_0x7350('0x2c')](_0x3a39ff[_0x7350('0x36')],function(_0x377461){var _0x2ad2a4={};_0x2ad2a4[_0x377461]={'$like':'%'+_0x2c2e42[_0x7350('0x33')][_0x7350('0x3f')]+'%'};return _0x2ad2a4;})});}_0x3a39ff=_[_0x7350('0x41')]({},_0x3a39ff,_0x2c2e42[_0x7350('0x42')]);return _0xb5931c[_0x7350('0x53')](_0x3a39ff);}})[_0x7350('0x25')](function(_0x43e7c0){if(_0x43e7c0){_0x2d7316=_0x43e7c0[_0x7350('0x38')];if(!_0x2c2e42[_0x7350('0x33')][_0x7350('0x39')](_0x7350('0x3a'))){_0x3a39ff[_0x7350('0x1d')]=qs['limit'](_0x2c2e42[_0x7350('0x33')]['limit']);_0x3a39ff[_0x7350('0x1c')]=qs['offset'](_0x2c2e42['query'][_0x7350('0x1c')]);}return _0xb5931c[_0x7350('0x53')](_0x3a39ff);}})[_0x7350('0x25')](function(_0x3241e0){if(_0x3241e0){return _0x3241e0?{'count':_0x2d7316,'rows':_0x3241e0}:null;}})['then'](respondWithResult(_0x30706e,null))[_0x7350('0x47')](handleError(_0x30706e,null));}; \ No newline at end of file +var _0x2f80=['attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','getFields','findOne','nolimit','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','key','query','keys','filters','intersection','model'];(function(_0x15cbbf,_0x1379a5){var _0x20a8da=function(_0x4ec996){while(--_0x4ec996){_0x15cbbf['push'](_0x15cbbf['shift']());}};_0x20a8da(++_0x1379a5);}(_0x2f80,0x6f));var _0x02f8=function(_0x3c8ed7,_0x5b4105){_0x3c8ed7=_0x3c8ed7-0x0;var _0x54e9a6=_0x2f80[_0x3c8ed7];return _0x54e9a6;};'use strict';var emlformat=require(_0x02f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02f8('0x1'));var jsonpatch=require(_0x02f8('0x2'));var rp=require(_0x02f8('0x3'));var moment=require(_0x02f8('0x4'));var BPromise=require(_0x02f8('0x5'));var Mustache=require(_0x02f8('0x6'));var util=require(_0x02f8('0x7'));var path=require(_0x02f8('0x8'));var sox=require(_0x02f8('0x9'));var csv=require(_0x02f8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02f8('0xb'));var _=require(_0x02f8('0xc'));var squel=require(_0x02f8('0xd'));var crypto=require(_0x02f8('0xe'));var jsforce=require(_0x02f8('0xf'));var deskjs=require(_0x02f8('0x10'));var toCsv=require(_0x02f8('0xa'));var querystring=require(_0x02f8('0x11'));var Papa=require('papaparse');var Redis=require(_0x02f8('0x12'));var authService=require(_0x02f8('0x13'));var qs=require(_0x02f8('0x14'));var as=require(_0x02f8('0x15'));var hardwareService=require(_0x02f8('0x16'));var logger=require('../../config/logger')(_0x02f8('0x17'));var utils=require(_0x02f8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x02f8('0x19'));var db=require(_0x02f8('0x1a'))['db'];function respondWithStatusCode(_0x5c198a,_0x2a96ee){_0x2a96ee=_0x2a96ee||0xcc;return function(_0x3acba0){if(_0x3acba0){return _0x5c198a[_0x02f8('0x1b')](_0x2a96ee);}return _0x5c198a['status'](_0x2a96ee)[_0x02f8('0x1c')]();};}function respondWithResult(_0x566f86,_0x29ce38){_0x29ce38=_0x29ce38||0xc8;return function(_0x273b9b){if(_0x273b9b){return _0x566f86[_0x02f8('0x1d')](_0x29ce38)[_0x02f8('0x1e')](_0x273b9b);}};}function respondWithFilteredResult(_0x3eb34d,_0x264d79){return function(_0x493b3e){if(_0x493b3e){var _0x4391ff=typeof _0x264d79[_0x02f8('0x1f')]===_0x02f8('0x20')&&typeof _0x264d79[_0x02f8('0x21')]==='undefined';var _0x5b5e33=_0x493b3e[_0x02f8('0x22')];var _0x56c078=_0x4391ff?0x0:_0x264d79[_0x02f8('0x1f')];var _0x3c603e=_0x4391ff?_0x493b3e[_0x02f8('0x22')]:_0x264d79['offset']+_0x264d79[_0x02f8('0x21')];var _0x48ca64;if(_0x3c603e>=_0x5b5e33){_0x3c603e=_0x5b5e33;_0x48ca64=0xc8;}else{_0x48ca64=0xce;}_0x3eb34d[_0x02f8('0x1d')](_0x48ca64);return _0x3eb34d['set'](_0x02f8('0x23'),_0x56c078+'-'+_0x3c603e+'/'+_0x5b5e33)['json'](_0x493b3e);}return null;};}function patchUpdates(_0x44fa1f){return function(_0x545eed){try{jsonpatch['apply'](_0x545eed,_0x44fa1f,!![]);}catch(_0x45c2bd){return BPromise[_0x02f8('0x24')](_0x45c2bd);}return _0x545eed[_0x02f8('0x25')]();};}function saveUpdates(_0x4a1c28,_0x5602ac){return function(_0x4363e9){if(_0x4363e9){return _0x4363e9['update'](_0x4a1c28)[_0x02f8('0x26')](function(_0x7d5054){return _0x7d5054;});}return null;};}function removeEntity(_0x3c11e3,_0x4bb50d){return function(_0x497894){if(_0x497894){return _0x497894[_0x02f8('0x27')]()[_0x02f8('0x26')](function(){_0x3c11e3[_0x02f8('0x1d')](0xcc)[_0x02f8('0x1c')]();});}};}function handleEntityNotFound(_0x4513c2,_0xf09fef){return function(_0xfca45f){if(!_0xfca45f){_0x4513c2[_0x02f8('0x1b')](0x194);}return _0xfca45f;};}function handleError(_0x1e0056,_0x3180ec){_0x3180ec=_0x3180ec||0x1f4;return function(_0x45e241){logger[_0x02f8('0x28')](_0x45e241[_0x02f8('0x29')]);if(_0x45e241['name']){delete _0x45e241[_0x02f8('0x2a')];}_0x1e0056[_0x02f8('0x1d')](_0x3180ec)['send'](_0x45e241);};}exports[_0x02f8('0x2b')]=function(_0x4d0620,_0x2fc906){var _0x529ead={},_0x55bf8a={},_0x237501={'count':0x0,'rows':[]};var _0x51d5d5=_[_0x02f8('0x2c')](db[_0x02f8('0x2d')][_0x02f8('0x2e')],function(_0x38e653){return{'name':_0x38e653['fieldName'],'type':_0x38e653['type'][_0x02f8('0x2f')]};});_0x55bf8a['model']=_[_0x02f8('0x2c')](_0x51d5d5,_0x02f8('0x2a'));_0x55bf8a[_0x02f8('0x30')]=_[_0x02f8('0x31')](_0x4d0620['query']);_0x55bf8a[_0x02f8('0x32')]=_[_0x02f8('0x33')](_0x55bf8a[_0x02f8('0x34')],_0x55bf8a[_0x02f8('0x30')]);_0x529ead[_0x02f8('0x35')]=_['intersection'](_0x55bf8a[_0x02f8('0x34')],qs['fields'](_0x4d0620[_0x02f8('0x30')][_0x02f8('0x36')]));_0x529ead[_0x02f8('0x35')]=_0x529ead[_0x02f8('0x35')][_0x02f8('0x37')]?_0x529ead['attributes']:_0x55bf8a[_0x02f8('0x34')];if(!_0x4d0620['query'][_0x02f8('0x38')]('nolimit')){_0x529ead[_0x02f8('0x21')]=qs[_0x02f8('0x21')](_0x4d0620[_0x02f8('0x30')][_0x02f8('0x21')]);_0x529ead[_0x02f8('0x1f')]=qs[_0x02f8('0x1f')](_0x4d0620[_0x02f8('0x30')][_0x02f8('0x1f')]);}_0x529ead[_0x02f8('0x39')]=qs['sort'](_0x4d0620[_0x02f8('0x30')][_0x02f8('0x3a')]);_0x529ead['where']=qs[_0x02f8('0x32')](_[_0x02f8('0x3b')](_0x4d0620[_0x02f8('0x30')],_0x55bf8a[_0x02f8('0x32')]),_0x51d5d5);if(_0x4d0620[_0x02f8('0x30')]['filter']){_0x529ead[_0x02f8('0x3c')]=_[_0x02f8('0x3d')](_0x529ead[_0x02f8('0x3c')],{'$or':_[_0x02f8('0x2c')](_0x51d5d5,function(_0x65fb5e){if(_0x65fb5e['type']!==_0x02f8('0x3e')){var _0x45fe57={};_0x45fe57[_0x65fb5e[_0x02f8('0x2a')]]={'$like':'%'+_0x4d0620[_0x02f8('0x30')][_0x02f8('0x3f')]+'%'};return _0x45fe57;}})});}_0x529ead=_[_0x02f8('0x3d')]({},_0x529ead,_0x4d0620[_0x02f8('0x40')]);var _0x21d32c={'where':_0x529ead[_0x02f8('0x3c')]};return db[_0x02f8('0x2d')][_0x02f8('0x22')](_0x21d32c)[_0x02f8('0x26')](function(_0x664509){_0x237501['count']=_0x664509;if(_0x4d0620['query']['includeAll']){_0x529ead['include']=[{'all':!![]}];}return db[_0x02f8('0x2d')][_0x02f8('0x41')](_0x529ead);})[_0x02f8('0x26')](function(_0x35bfd9){_0x237501[_0x02f8('0x42')]=_0x35bfd9;return _0x237501;})[_0x02f8('0x26')](respondWithFilteredResult(_0x2fc906,_0x529ead))[_0x02f8('0x43')](handleError(_0x2fc906,null));};exports[_0x02f8('0x44')]=function(_0x3924a7,_0x157e53){var _0x311b67={'raw':![],'where':{'id':_0x3924a7[_0x02f8('0x45')]['id']}},_0x54671b={};_0x54671b['model']=_[_0x02f8('0x31')](db[_0x02f8('0x2d')][_0x02f8('0x2e')]);_0x54671b['query']=_['keys'](_0x3924a7[_0x02f8('0x30')]);_0x54671b[_0x02f8('0x32')]=_[_0x02f8('0x33')](_0x54671b['model'],_0x54671b['query']);_0x311b67[_0x02f8('0x35')]=_[_0x02f8('0x33')](_0x54671b[_0x02f8('0x34')],qs[_0x02f8('0x36')](_0x3924a7[_0x02f8('0x30')][_0x02f8('0x36')]));_0x311b67[_0x02f8('0x35')]=_0x311b67[_0x02f8('0x35')]['length']?_0x311b67[_0x02f8('0x35')]:_0x54671b[_0x02f8('0x34')];if(_0x3924a7[_0x02f8('0x30')][_0x02f8('0x46')]){_0x311b67[_0x02f8('0x47')]=[{'all':!![]}];}_0x311b67=_[_0x02f8('0x3d')]({},_0x311b67,_0x3924a7[_0x02f8('0x40')]);return db[_0x02f8('0x2d')][_0x02f8('0x48')](_0x311b67)[_0x02f8('0x26')](handleEntityNotFound(_0x157e53,null))[_0x02f8('0x26')](respondWithResult(_0x157e53,null))[_0x02f8('0x43')](handleError(_0x157e53,null));};exports[_0x02f8('0x49')]=function(_0x8b29e0,_0x76fab0){return db[_0x02f8('0x2d')][_0x02f8('0x49')](_0x8b29e0[_0x02f8('0x4a')],{})[_0x02f8('0x26')](respondWithResult(_0x76fab0,0xc9))[_0x02f8('0x43')](handleError(_0x76fab0,null));};exports[_0x02f8('0x4b')]=function(_0x331099,_0x4ae039){if(_0x331099[_0x02f8('0x4a')]['id']){delete _0x331099[_0x02f8('0x4a')]['id'];}return db[_0x02f8('0x2d')][_0x02f8('0x48')]({'where':{'id':_0x331099[_0x02f8('0x45')]['id']}})[_0x02f8('0x26')](handleEntityNotFound(_0x4ae039,null))[_0x02f8('0x26')](saveUpdates(_0x331099[_0x02f8('0x4a')],null))[_0x02f8('0x26')](respondWithResult(_0x4ae039,null))['catch'](handleError(_0x4ae039,null));};exports[_0x02f8('0x27')]=function(_0x2a62c9,_0x12eb64){return db[_0x02f8('0x2d')][_0x02f8('0x48')]({'where':{'id':_0x2a62c9[_0x02f8('0x45')]['id']}})['then'](handleEntityNotFound(_0x12eb64,null))['then'](removeEntity(_0x12eb64,null))[_0x02f8('0x43')](handleError(_0x12eb64,null));};exports[_0x02f8('0x4c')]=function(_0xbcb6ef,_0x11c541,_0xe63392){var _0x407c02={};var _0x510dec={};var _0xb93e30;var _0x47f709;return db[_0x02f8('0x2d')][_0x02f8('0x4d')]({'where':{'id':_0xbcb6ef['params']['id']}})[_0x02f8('0x26')](handleEntityNotFound(_0x11c541,null))[_0x02f8('0x26')](function(_0x2af5c1){if(_0x2af5c1){_0xb93e30=_0x2af5c1;_0x510dec[_0x02f8('0x34')]=_[_0x02f8('0x31')](db['ZohoField']['rawAttributes']);_0x510dec[_0x02f8('0x30')]=_[_0x02f8('0x31')](_0xbcb6ef[_0x02f8('0x30')]);_0x510dec[_0x02f8('0x32')]=_[_0x02f8('0x33')](_0x510dec[_0x02f8('0x34')],_0x510dec[_0x02f8('0x30')]);_0x407c02[_0x02f8('0x35')]=_['intersection'](_0x510dec[_0x02f8('0x34')],qs[_0x02f8('0x36')](_0xbcb6ef['query'][_0x02f8('0x36')]));_0x407c02[_0x02f8('0x35')]=_0x407c02[_0x02f8('0x35')][_0x02f8('0x37')]?_0x407c02[_0x02f8('0x35')]:_0x510dec[_0x02f8('0x34')];_0x407c02[_0x02f8('0x39')]=qs[_0x02f8('0x3a')](_0xbcb6ef[_0x02f8('0x30')][_0x02f8('0x3a')]);_0x407c02[_0x02f8('0x3c')]=qs[_0x02f8('0x32')](_['pick'](_0xbcb6ef[_0x02f8('0x30')],_0x510dec['filters']));if(_0xbcb6ef[_0x02f8('0x30')]['filter']){_0x407c02['where']=_[_0x02f8('0x3d')](_0x407c02[_0x02f8('0x3c')],{'$or':_[_0x02f8('0x2c')](_0x407c02[_0x02f8('0x35')],function(_0x566c0f){var _0x312bd6={};_0x312bd6[_0x566c0f]={'$like':'%'+_0xbcb6ef[_0x02f8('0x30')][_0x02f8('0x3f')]+'%'};return _0x312bd6;})});}_0x407c02=_['merge']({},_0x407c02,_0xbcb6ef[_0x02f8('0x40')]);return _0xb93e30[_0x02f8('0x4c')](_0x407c02);}})[_0x02f8('0x26')](function(_0x3d7796){if(_0x3d7796){_0x47f709=_0x3d7796[_0x02f8('0x37')];if(!_0xbcb6ef[_0x02f8('0x30')][_0x02f8('0x38')](_0x02f8('0x4e'))){_0x407c02['limit']=qs[_0x02f8('0x21')](_0xbcb6ef['query'][_0x02f8('0x21')]);_0x407c02[_0x02f8('0x1f')]=qs['offset'](_0xbcb6ef['query']['offset']);}return _0xb93e30[_0x02f8('0x4c')](_0x407c02);}})['then'](function(_0x3ed39c){if(_0x3ed39c){return _0x3ed39c?{'count':_0x47f709,'rows':_0x3ed39c}:null;}})[_0x02f8('0x26')](respondWithResult(_0x11c541,null))['catch'](handleError(_0x11c541,null));};exports['getSubjects']=function(_0x4e8c15,_0x328f7a,_0x4d291b){var _0x287dd7={};var _0x4484e4={};var _0x4849d1;var _0x15dadd;return db[_0x02f8('0x2d')]['findOne']({'where':{'id':_0x4e8c15['params']['id']}})['then'](handleEntityNotFound(_0x328f7a,null))[_0x02f8('0x26')](function(_0xcc4300){if(_0xcc4300){_0x4849d1=_0xcc4300;_0x4484e4['model']=_[_0x02f8('0x31')](db[_0x02f8('0x4f')]['rawAttributes']);_0x4484e4[_0x02f8('0x30')]=_[_0x02f8('0x31')](_0x4e8c15[_0x02f8('0x30')]);_0x4484e4[_0x02f8('0x32')]=_['intersection'](_0x4484e4[_0x02f8('0x34')],_0x4484e4[_0x02f8('0x30')]);_0x287dd7[_0x02f8('0x35')]=_['intersection'](_0x4484e4[_0x02f8('0x34')],qs['fields'](_0x4e8c15[_0x02f8('0x30')][_0x02f8('0x36')]));_0x287dd7[_0x02f8('0x35')]=_0x287dd7['attributes']['length']?_0x287dd7[_0x02f8('0x35')]:_0x4484e4[_0x02f8('0x34')];_0x287dd7[_0x02f8('0x39')]=qs[_0x02f8('0x3a')](_0x4e8c15[_0x02f8('0x30')][_0x02f8('0x3a')]);_0x287dd7['where']=qs[_0x02f8('0x32')](_['pick'](_0x4e8c15['query'],_0x4484e4[_0x02f8('0x32')]));if(_0x4e8c15[_0x02f8('0x30')][_0x02f8('0x3f')]){_0x287dd7[_0x02f8('0x3c')]=_[_0x02f8('0x3d')](_0x287dd7['where'],{'$or':_['map'](_0x287dd7[_0x02f8('0x35')],function(_0x3f9a06){var _0x27ad4b={};_0x27ad4b[_0x3f9a06]={'$like':'%'+_0x4e8c15['query'][_0x02f8('0x3f')]+'%'};return _0x27ad4b;})});}_0x287dd7=_[_0x02f8('0x3d')]({},_0x287dd7,_0x4e8c15[_0x02f8('0x40')]);return _0x4849d1[_0x02f8('0x50')](_0x287dd7);}})[_0x02f8('0x26')](function(_0x4241a0){if(_0x4241a0){_0x15dadd=_0x4241a0['length'];if(!_0x4e8c15[_0x02f8('0x30')][_0x02f8('0x38')](_0x02f8('0x4e'))){_0x287dd7['limit']=qs[_0x02f8('0x21')](_0x4e8c15['query'][_0x02f8('0x21')]);_0x287dd7[_0x02f8('0x1f')]=qs[_0x02f8('0x1f')](_0x4e8c15[_0x02f8('0x30')][_0x02f8('0x1f')]);}return _0x4849d1[_0x02f8('0x50')](_0x287dd7);}})['then'](function(_0x5e2d90){if(_0x5e2d90){return _0x5e2d90?{'count':_0x15dadd,'rows':_0x5e2d90}:null;}})['then'](respondWithResult(_0x328f7a,null))[_0x02f8('0x43')](handleError(_0x328f7a,null));};exports[_0x02f8('0x51')]=function(_0xf085ec,_0x3b9b82,_0x534acd){var _0x51f570={};var _0x45a922={};var _0x46dd70;var _0x1dbda7;return db['ZohoConfiguration'][_0x02f8('0x4d')]({'where':{'id':_0xf085ec[_0x02f8('0x45')]['id']}})[_0x02f8('0x26')](handleEntityNotFound(_0x3b9b82,null))[_0x02f8('0x26')](function(_0x1fb5c8){if(_0x1fb5c8){_0x46dd70=_0x1fb5c8;_0x45a922[_0x02f8('0x34')]=_[_0x02f8('0x31')](db[_0x02f8('0x4f')][_0x02f8('0x2e')]);_0x45a922[_0x02f8('0x30')]=_[_0x02f8('0x31')](_0xf085ec[_0x02f8('0x30')]);_0x45a922['filters']=_[_0x02f8('0x33')](_0x45a922[_0x02f8('0x34')],_0x45a922[_0x02f8('0x30')]);_0x51f570[_0x02f8('0x35')]=_[_0x02f8('0x33')](_0x45a922['model'],qs[_0x02f8('0x36')](_0xf085ec['query'][_0x02f8('0x36')]));_0x51f570[_0x02f8('0x35')]=_0x51f570[_0x02f8('0x35')][_0x02f8('0x37')]?_0x51f570['attributes']:_0x45a922[_0x02f8('0x34')];_0x51f570[_0x02f8('0x39')]=qs['sort'](_0xf085ec[_0x02f8('0x30')][_0x02f8('0x3a')]);_0x51f570[_0x02f8('0x3c')]=qs[_0x02f8('0x32')](_[_0x02f8('0x3b')](_0xf085ec[_0x02f8('0x30')],_0x45a922['filters']));if(_0xf085ec[_0x02f8('0x30')][_0x02f8('0x3f')]){_0x51f570['where']=_[_0x02f8('0x3d')](_0x51f570[_0x02f8('0x3c')],{'$or':_['map'](_0x51f570[_0x02f8('0x35')],function(_0x474d6d){var _0x4ad57e={};_0x4ad57e[_0x474d6d]={'$like':'%'+_0xf085ec[_0x02f8('0x30')][_0x02f8('0x3f')]+'%'};return _0x4ad57e;})});}_0x51f570=_[_0x02f8('0x3d')]({},_0x51f570,_0xf085ec['options']);return _0x46dd70['getDescriptions'](_0x51f570);}})[_0x02f8('0x26')](function(_0x163f38){if(_0x163f38){_0x1dbda7=_0x163f38[_0x02f8('0x37')];if(!_0xf085ec[_0x02f8('0x30')][_0x02f8('0x38')](_0x02f8('0x4e'))){_0x51f570['limit']=qs['limit'](_0xf085ec[_0x02f8('0x30')]['limit']);_0x51f570['offset']=qs[_0x02f8('0x1f')](_0xf085ec[_0x02f8('0x30')][_0x02f8('0x1f')]);}return _0x46dd70['getDescriptions'](_0x51f570);}})[_0x02f8('0x26')](function(_0x4a0835){if(_0x4a0835){return _0x4a0835?{'count':_0x1dbda7,'rows':_0x4a0835}:null;}})[_0x02f8('0x26')](respondWithResult(_0x3b9b82,null))[_0x02f8('0x43')](handleError(_0x3b9b82,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 337d33a..202b331 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 _0x8401=['api','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes','int_zoho_configurations','lodash','../../config/logger'];(function(_0x3b1413,_0x308e98){var _0x2cafbc=function(_0xa3aee2){while(--_0xa3aee2){_0x3b1413['push'](_0x3b1413['shift']());}};_0x2cafbc(++_0x308e98);}(_0x8401,0x6a));var _0x1840=function(_0x51e4dd,_0x814134){_0x51e4dd=_0x51e4dd-0x0;var _0x5a4f30=_0x8401[_0x51e4dd];return _0x5a4f30;};'use strict';var _=require(_0x1840('0x0'));var util=require('util');var logger=require(_0x1840('0x1'))(_0x1840('0x2'));var moment=require(_0x1840('0x3'));var BPromise=require(_0x1840('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1840('0x5'));var rimraf=require(_0x1840('0x6'));var config=require('../../config/environment');var attributes=require(_0x1840('0x7'));module['exports']=function(_0xc66434,_0x3a6d03){return _0xc66434['define']('ZohoConfiguration',attributes,{'tableName':_0x1840('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51fe=['bluebird','path','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','util','../../config/logger','api','moment'];(function(_0xb3436c,_0x4d077d){var _0x383cd1=function(_0x8b6311){while(--_0x8b6311){_0xb3436c['push'](_0xb3436c['shift']());}};_0x383cd1(++_0x4d077d);}(_0x51fe,0x13c));var _0xe51f=function(_0x2073f2,_0x131e28){_0x2073f2=_0x2073f2-0x0;var _0x44915b=_0x51fe[_0x2073f2];return _0x44915b;};'use strict';var _=require('lodash');var util=require(_0xe51f('0x0'));var logger=require(_0xe51f('0x1'))(_0xe51f('0x2'));var moment=require(_0xe51f('0x3'));var BPromise=require(_0xe51f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe51f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe51f('0x6'));module[_0xe51f('0x7')]=function(_0x28c0f3,_0x432856){return _0x28c0f3[_0xe51f('0x8')](_0xe51f('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index f35caf4..b7bf025 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 _0x2ab5=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b150f,_0x31722f){var _0x784f7e=function(_0x8050dc){while(--_0x8050dc){_0x3b150f['push'](_0x3b150f['shift']());}};_0x784f7e(++_0x31722f);}(_0x2ab5,0x76));var _0x52ab=function(_0x53e32a,_0x3c7964){_0x53e32a=_0x53e32a-0x0;var _0x15a8bf=_0x2ab5[_0x53e32a];return _0x15a8bf;};'use strict';var _=require(_0x52ab('0x0'));var util=require(_0x52ab('0x1'));var moment=require(_0x52ab('0x2'));var BPromise=require(_0x52ab('0x3'));var rs=require(_0x52ab('0x4'));var fs=require('fs');var Redis=require(_0x52ab('0x5'));var db=require(_0x52ab('0x6'))['db'];var utils=require(_0x52ab('0x7'));var logger=require(_0x52ab('0x8'))(_0x52ab('0x9'));var config=require(_0x52ab('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x52ab('0xb')][_0x52ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3622dd,_0x83ae6d,_0x18e8ee){return new BPromise(function(_0x13d763,_0x4c2899){return client['request'](_0x3622dd,_0x18e8ee)[_0x52ab('0xd')](function(_0x2356b4){logger[_0x52ab('0xe')](_0x52ab('0xf'),_0x83ae6d,'request\x20sent');logger[_0x52ab('0x10')](_0x52ab('0x11'),_0x83ae6d,_0x52ab('0x12'),JSON[_0x52ab('0x13')](_0x2356b4));if(_0x2356b4[_0x52ab('0x14')]){if(_0x2356b4['error'][_0x52ab('0x15')]===0x1f4){logger['error'](_0x52ab('0xf'),_0x83ae6d,_0x2356b4[_0x52ab('0x14')]['message']);return _0x4c2899(_0x2356b4[_0x52ab('0x14')]['message']);}logger[_0x52ab('0x14')](_0x52ab('0xf'),_0x83ae6d,_0x2356b4['error'][_0x52ab('0x16')]);return _0x13d763(_0x2356b4[_0x52ab('0x14')][_0x52ab('0x16')]);}else{logger[_0x52ab('0xe')](_0x52ab('0xf'),_0x83ae6d,_0x52ab('0x12'));_0x13d763(_0x2356b4[_0x52ab('0x17')][_0x52ab('0x16')]);}})[_0x52ab('0x18')](function(_0x34c4cf){logger[_0x52ab('0x14')](_0x52ab('0xf'),_0x83ae6d,_0x34c4cf);_0x4c2899(_0x34c4cf);});});} \ No newline at end of file +var _0xd1da=['message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xd1da,0x71));var _0xad1d=function(_0x2697d9,_0x26806a){_0x2697d9=_0x2697d9-0x0;var _0x25e6ae=_0xd1da[_0x2697d9];return _0x25e6ae;};'use strict';var _=require('lodash');var util=require(_0xad1d('0x0'));var moment=require(_0xad1d('0x1'));var BPromise=require(_0xad1d('0x2'));var rs=require(_0xad1d('0x3'));var fs=require('fs');var Redis=require(_0xad1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad1d('0x5'));var logger=require('../../config/logger')(_0xad1d('0x6'));var config=require(_0xad1d('0x7'));var jayson=require(_0xad1d('0x8'));var client=jayson[_0xad1d('0x9')][_0xad1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba37a,_0x36021,_0x3a5382){return new BPromise(function(_0x2ace03,_0x27c419){return client[_0xad1d('0xb')](_0x2ba37a,_0x3a5382)[_0xad1d('0xc')](function(_0x6039ab){logger['info'](_0xad1d('0xd'),_0x36021,_0xad1d('0xe'));logger[_0xad1d('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x36021,_0xad1d('0xe'),JSON[_0xad1d('0x10')](_0x6039ab));if(_0x6039ab[_0xad1d('0x11')]){if(_0x6039ab['error'][_0xad1d('0x12')]===0x1f4){logger['error'](_0xad1d('0xd'),_0x36021,_0x6039ab['error'][_0xad1d('0x13')]);return _0x27c419(_0x6039ab[_0xad1d('0x11')][_0xad1d('0x13')]);}logger['error'](_0xad1d('0xd'),_0x36021,_0x6039ab[_0xad1d('0x11')][_0xad1d('0x13')]);return _0x2ace03(_0x6039ab[_0xad1d('0x11')][_0xad1d('0x13')]);}else{logger[_0xad1d('0x14')](_0xad1d('0xd'),_0x36021,_0xad1d('0xe'));_0x2ace03(_0x6039ab[_0xad1d('0x15')][_0xad1d('0x13')]);}})['catch'](function(_0x56e369){logger[_0xad1d('0x11')](_0xad1d('0xd'),_0x36021,_0x56e369);_0x27c419(_0x56e369);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f1da380..59661f4 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 _0x7078=['put','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x4c8d03,_0x3ca8cd){var _0x4dbec9=function(_0x3ba3f4){while(--_0x3ba3f4){_0x4c8d03['push'](_0x4c8d03['shift']());}};_0x4dbec9(++_0x3ca8cd);}(_0x7078,0x10e));var _0x8707=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x7078[_0x189d3c];return _0x485959;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8707('0x0'));var express=require(_0x8707('0x1'));var router=express[_0x8707('0x2')]();var fs_extra=require(_0x8707('0x3'));var auth=require(_0x8707('0x4'));var interaction=require(_0x8707('0x5'));var config=require(_0x8707('0x6'));var controller=require(_0x8707('0x7'));router['get']('/',auth[_0x8707('0x8')](),controller[_0x8707('0x9')]);router[_0x8707('0xa')](_0x8707('0xb'),auth[_0x8707('0x8')](),controller[_0x8707('0xc')]);router[_0x8707('0xd')]('/',auth[_0x8707('0x8')](),controller[_0x8707('0xe')]);router[_0x8707('0xf')](_0x8707('0xb'),auth[_0x8707('0x8')](),controller[_0x8707('0x10')]);router['delete']('/:id',auth[_0x8707('0x8')](),controller[_0x8707('0x11')]);module[_0x8707('0x12')]=router; \ No newline at end of file +var _0x7680=['index','/:id','show','post','create','put','update','exports','multer','path','express','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x5ea56c,_0x304a06){var _0x577395=function(_0x3a93d6){while(--_0x3a93d6){_0x5ea56c['push'](_0x5ea56c['shift']());}};_0x577395(++_0x304a06);}(_0x7680,0x78));var _0x0768=function(_0x3cd590,_0x54deaa){_0x3cd590=_0x3cd590-0x0;var _0x149858=_0x7680[_0x3cd590];return _0x149858;};'use strict';var multer=require(_0x0768('0x0'));var util=require('util');var path=require(_0x0768('0x1'));var timeout=require('connect-timeout');var express=require(_0x0768('0x2'));var router=express['Router']();var fs_extra=require(_0x0768('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0768('0x4'));var controller=require(_0x0768('0x5'));router[_0x0768('0x6')]('/',auth[_0x0768('0x7')](),controller[_0x0768('0x8')]);router['get'](_0x0768('0x9'),auth[_0x0768('0x7')](),controller[_0x0768('0xa')]);router[_0x0768('0xb')]('/',auth[_0x0768('0x7')](),controller[_0x0768('0xc')]);router[_0x0768('0xd')]('/:id',auth[_0x0768('0x7')](),controller[_0x0768('0xe')]);router['delete'](_0x0768('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0768('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0e4b05d..60c5d34 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 _0xae1a=['string','variable','keyValue','STRING','customVariable','BOOLEAN','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae1a,0xe6));var _0xaae1=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xae1a[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require('sequelize');module[_0xaae1('0x0')]={'type':{'type':Sequelize[_0xaae1('0x1')](_0xaae1('0x2'),_0xaae1('0x3'),'customVariable',_0xaae1('0x4'),'picklist'),'defaultValue':_0xaae1('0x2')},'content':{'type':Sequelize[_0xaae1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xaae1('0x2'),_0xaae1('0x3'),_0xaae1('0x6'))},'keyContent':{'type':Sequelize[_0xaae1('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xaae1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbe09=['ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x4993e8,_0x4c806f){var _0x583759=function(_0x4652f8){while(--_0x4652f8){_0x4993e8['push'](_0x4993e8['shift']());}};_0x583759(++_0x4c806f);}(_0xbe09,0xb0));var _0x9be0=function(_0x5055eb,_0x4272ef){_0x5055eb=_0x5055eb-0x0;var _0x46fcce=_0xbe09[_0x5055eb];return _0x46fcce;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9be0('0x0')]('string','variable',_0x9be0('0x1'),_0x9be0('0x2'),_0x9be0('0x3')),'defaultValue':_0x9be0('0x4')},'content':{'type':Sequelize[_0x9be0('0x5')]},'key':{'type':Sequelize[_0x9be0('0x5')]},'keyType':{'type':Sequelize[_0x9be0('0x0')](_0x9be0('0x4'),_0x9be0('0x6'),_0x9be0('0x1'))},'keyContent':{'type':Sequelize[_0x9be0('0x5')]},'idField':{'type':Sequelize[_0x9be0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9be0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9be0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f4ef22b..53f6455 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 _0x56d1=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','name','ZohoField','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra'];(function(_0xa765b1,_0x50d5ce){var _0x46197b=function(_0x44e98e){while(--_0x44e98e){_0xa765b1['push'](_0xa765b1['shift']());}};_0x46197b(++_0x50d5ce);}(_0x56d1,0x1ac));var _0x156d=function(_0x18a16d,_0x199976){_0x18a16d=_0x18a16d-0x0;var _0x21cf0c=_0x56d1[_0x18a16d];return _0x21cf0c;};'use strict';var emlformat=require(_0x156d('0x0'));var rimraf=require(_0x156d('0x1'));var zipdir=require(_0x156d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x156d('0x3'));var moment=require(_0x156d('0x4'));var BPromise=require(_0x156d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x156d('0x6'));var csv=require(_0x156d('0x7'));var ejs=require(_0x156d('0x8'));var fs=require('fs');var fs_extra=require(_0x156d('0x9'));var _=require(_0x156d('0xa'));var squel=require(_0x156d('0xb'));var crypto=require(_0x156d('0xc'));var jsforce=require(_0x156d('0xd'));var deskjs=require(_0x156d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x156d('0xf'));var Papa=require(_0x156d('0x10'));var Redis=require(_0x156d('0x11'));var authService=require(_0x156d('0x12'));var qs=require(_0x156d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x156d('0x14'));var logger=require(_0x156d('0x15'))(_0x156d('0x16'));var utils=require('../../config/utils');var config=require(_0x156d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x156d('0x18'))['db'];function respondWithStatusCode(_0x46db55,_0x1d58df){_0x1d58df=_0x1d58df||0xcc;return function(_0x3ab84e){if(_0x3ab84e){return _0x46db55[_0x156d('0x19')](_0x1d58df);}return _0x46db55[_0x156d('0x1a')](_0x1d58df)[_0x156d('0x1b')]();};}function respondWithResult(_0x2f4df1,_0x1a1539){_0x1a1539=_0x1a1539||0xc8;return function(_0x49f7f2){if(_0x49f7f2){return _0x2f4df1[_0x156d('0x1a')](_0x1a1539)['json'](_0x49f7f2);}};}function respondWithFilteredResult(_0x104e71,_0x343de9){return function(_0xc6ccbc){if(_0xc6ccbc){var _0x3f50ec=typeof _0x343de9[_0x156d('0x1c')]===_0x156d('0x1d')&&typeof _0x343de9[_0x156d('0x1e')]==='undefined';var _0x3880f9=_0xc6ccbc['count'];var _0xdbe874=_0x3f50ec?0x0:_0x343de9['offset'];var _0x1c9ef0=_0x3f50ec?_0xc6ccbc['count']:_0x343de9[_0x156d('0x1c')]+_0x343de9['limit'];var _0x57a845;if(_0x1c9ef0>=_0x3880f9){_0x1c9ef0=_0x3880f9;_0x57a845=0xc8;}else{_0x57a845=0xce;}_0x104e71[_0x156d('0x1a')](_0x57a845);return _0x104e71[_0x156d('0x1f')]('Content-Range',_0xdbe874+'-'+_0x1c9ef0+'/'+_0x3880f9)[_0x156d('0x20')](_0xc6ccbc);}return null;};}function patchUpdates(_0x27d8a3){return function(_0x39ec67){try{jsonpatch[_0x156d('0x21')](_0x39ec67,_0x27d8a3,!![]);}catch(_0x579c62){return BPromise[_0x156d('0x22')](_0x579c62);}return _0x39ec67[_0x156d('0x23')]();};}function saveUpdates(_0x326250,_0x1016d1){return function(_0x46a219){if(_0x46a219){return _0x46a219['update'](_0x326250)[_0x156d('0x24')](function(_0xeedd4){return _0xeedd4;});}return null;};}function removeEntity(_0x751bae,_0x237d23){return function(_0x378167){if(_0x378167){return _0x378167[_0x156d('0x25')]()[_0x156d('0x24')](function(){_0x751bae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d10aa,_0x20a539){return function(_0x26790c){if(!_0x26790c){_0x4d10aa[_0x156d('0x19')](0x194);}return _0x26790c;};}function handleError(_0x44d1e7,_0x93a33){_0x93a33=_0x93a33||0x1f4;return function(_0xdc8283){logger['error'](_0xdc8283['stack']);if(_0xdc8283[_0x156d('0x26')]){delete _0xdc8283[_0x156d('0x26')];}_0x44d1e7['status'](_0x93a33)['send'](_0xdc8283);};}exports['index']=function(_0x22340f,_0xf96cb2){var _0x351fd0={},_0x11c493={},_0x5f075c={'count':0x0,'rows':[]};var _0x17a43c=_['map'](db[_0x156d('0x27')]['rawAttributes'],function(_0x40f40b){return{'name':_0x40f40b[_0x156d('0x28')],'type':_0x40f40b[_0x156d('0x29')][_0x156d('0x2a')]};});_0x11c493['model']=_[_0x156d('0x2b')](_0x17a43c,_0x156d('0x26'));_0x11c493[_0x156d('0x2c')]=_[_0x156d('0x2d')](_0x22340f['query']);_0x11c493[_0x156d('0x2e')]=_['intersection'](_0x11c493[_0x156d('0x2f')],_0x11c493[_0x156d('0x2c')]);_0x351fd0[_0x156d('0x30')]=_[_0x156d('0x31')](_0x11c493['model'],qs[_0x156d('0x32')](_0x22340f[_0x156d('0x2c')][_0x156d('0x32')]));_0x351fd0[_0x156d('0x30')]=_0x351fd0[_0x156d('0x30')][_0x156d('0x33')]?_0x351fd0['attributes']:_0x11c493['model'];if(!_0x22340f[_0x156d('0x2c')][_0x156d('0x34')]('nolimit')){_0x351fd0[_0x156d('0x1e')]=qs[_0x156d('0x1e')](_0x22340f[_0x156d('0x2c')][_0x156d('0x1e')]);_0x351fd0[_0x156d('0x1c')]=qs[_0x156d('0x1c')](_0x22340f[_0x156d('0x2c')][_0x156d('0x1c')]);}_0x351fd0[_0x156d('0x35')]=qs[_0x156d('0x36')](_0x22340f['query'][_0x156d('0x36')]);_0x351fd0[_0x156d('0x37')]=qs[_0x156d('0x2e')](_['pick'](_0x22340f[_0x156d('0x2c')],_0x11c493['filters']),_0x17a43c);if(_0x22340f[_0x156d('0x2c')][_0x156d('0x38')]){_0x351fd0['where']=_[_0x156d('0x39')](_0x351fd0[_0x156d('0x37')],{'$or':_[_0x156d('0x2b')](_0x17a43c,function(_0xd51c76){if(_0xd51c76[_0x156d('0x29')]!==_0x156d('0x3a')){var _0x48640d={};_0x48640d[_0xd51c76[_0x156d('0x26')]]={'$like':'%'+_0x22340f['query'][_0x156d('0x38')]+'%'};return _0x48640d;}})});}_0x351fd0=_[_0x156d('0x39')]({},_0x351fd0,_0x22340f[_0x156d('0x3b')]);var _0x2e4c0d={'where':_0x351fd0[_0x156d('0x37')]};return db[_0x156d('0x27')][_0x156d('0x3c')](_0x2e4c0d)[_0x156d('0x24')](function(_0x4fa4b8){_0x5f075c[_0x156d('0x3c')]=_0x4fa4b8;if(_0x22340f[_0x156d('0x2c')][_0x156d('0x3d')]){_0x351fd0[_0x156d('0x3e')]=[{'all':!![]}];}return db[_0x156d('0x27')][_0x156d('0x3f')](_0x351fd0);})[_0x156d('0x24')](function(_0x265f87){_0x5f075c[_0x156d('0x40')]=_0x265f87;return _0x5f075c;})[_0x156d('0x24')](respondWithFilteredResult(_0xf96cb2,_0x351fd0))[_0x156d('0x41')](handleError(_0xf96cb2,null));};exports[_0x156d('0x42')]=function(_0x3b5e9,_0x55aa7e){var _0xb8270e={'raw':!![],'where':{'id':_0x3b5e9[_0x156d('0x43')]['id']}},_0x1c6faf={};_0x1c6faf[_0x156d('0x2f')]=_[_0x156d('0x2d')](db['ZohoField'][_0x156d('0x44')]);_0x1c6faf[_0x156d('0x2c')]=_['keys'](_0x3b5e9[_0x156d('0x2c')]);_0x1c6faf['filters']=_['intersection'](_0x1c6faf[_0x156d('0x2f')],_0x1c6faf[_0x156d('0x2c')]);_0xb8270e[_0x156d('0x30')]=_[_0x156d('0x31')](_0x1c6faf[_0x156d('0x2f')],qs['fields'](_0x3b5e9[_0x156d('0x2c')][_0x156d('0x32')]));_0xb8270e[_0x156d('0x30')]=_0xb8270e[_0x156d('0x30')][_0x156d('0x33')]?_0xb8270e['attributes']:_0x1c6faf[_0x156d('0x2f')];if(_0x3b5e9['query'][_0x156d('0x3d')]){_0xb8270e['include']=[{'all':!![]}];}_0xb8270e=_[_0x156d('0x39')]({},_0xb8270e,_0x3b5e9[_0x156d('0x3b')]);return db[_0x156d('0x27')][_0x156d('0x45')](_0xb8270e)[_0x156d('0x24')](handleEntityNotFound(_0x55aa7e,null))[_0x156d('0x24')](respondWithResult(_0x55aa7e,null))[_0x156d('0x41')](handleError(_0x55aa7e,null));};exports[_0x156d('0x46')]=function(_0x460743,_0xe5caa2){return db[_0x156d('0x27')][_0x156d('0x46')](_0x460743[_0x156d('0x47')],{})[_0x156d('0x24')](respondWithResult(_0xe5caa2,0xc9))[_0x156d('0x41')](handleError(_0xe5caa2,null));};exports[_0x156d('0x48')]=function(_0x592510,_0x12987d){if(_0x592510[_0x156d('0x47')]['id']){delete _0x592510[_0x156d('0x47')]['id'];}return db[_0x156d('0x27')][_0x156d('0x45')]({'where':{'id':_0x592510['params']['id']}})['then'](handleEntityNotFound(_0x12987d,null))[_0x156d('0x24')](saveUpdates(_0x592510[_0x156d('0x47')],null))['then'](respondWithResult(_0x12987d,null))[_0x156d('0x41')](handleError(_0x12987d,null));};exports['destroy']=function(_0x2a889c,_0x4c76db){return db[_0x156d('0x27')][_0x156d('0x45')]({'where':{'id':_0x2a889c[_0x156d('0x43')]['id']}})[_0x156d('0x24')](handleEntityNotFound(_0x4c76db,null))['then'](removeEntity(_0x4c76db,null))[_0x156d('0x41')](handleError(_0x4c76db,null));}; \ No newline at end of file +var _0xcc88=['offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','filters','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end'];(function(_0x3b0d03,_0xdcc67){var _0x54e738=function(_0x12b00e){while(--_0x12b00e){_0x3b0d03['push'](_0x3b0d03['shift']());}};_0x54e738(++_0xdcc67);}(_0xcc88,0xc2));var _0x8cc8=function(_0x3e45e4,_0x34d0ff){_0x3e45e4=_0x3e45e4-0x0;var _0x12168c=_0xcc88[_0x3e45e4];return _0x12168c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8cc8('0x0'));var jsonpatch=require(_0x8cc8('0x1'));var rp=require(_0x8cc8('0x2'));var moment=require(_0x8cc8('0x3'));var BPromise=require(_0x8cc8('0x4'));var Mustache=require(_0x8cc8('0x5'));var util=require(_0x8cc8('0x6'));var path=require('path');var sox=require(_0x8cc8('0x7'));var csv=require(_0x8cc8('0x8'));var ejs=require(_0x8cc8('0x9'));var fs=require('fs');var fs_extra=require(_0x8cc8('0xa'));var _=require('lodash');var squel=require(_0x8cc8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8cc8('0x8'));var querystring=require(_0x8cc8('0xc'));var Papa=require(_0x8cc8('0xd'));var Redis=require(_0x8cc8('0xe'));var authService=require(_0x8cc8('0xf'));var qs=require(_0x8cc8('0x10'));var as=require(_0x8cc8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cc8('0x12'))(_0x8cc8('0x13'));var utils=require(_0x8cc8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8cc8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db983,_0x38236f){_0x38236f=_0x38236f||0xcc;return function(_0x2110bd){if(_0x2110bd){return _0x4db983[_0x8cc8('0x16')](_0x38236f);}return _0x4db983[_0x8cc8('0x17')](_0x38236f)[_0x8cc8('0x18')]();};}function respondWithResult(_0x8575d9,_0x46295e){_0x46295e=_0x46295e||0xc8;return function(_0x2d6f4b){if(_0x2d6f4b){return _0x8575d9[_0x8cc8('0x17')](_0x46295e)['json'](_0x2d6f4b);}};}function respondWithFilteredResult(_0x5a1403,_0x118e2b){return function(_0x3c3644){if(_0x3c3644){var _0x5925e9=typeof _0x118e2b[_0x8cc8('0x19')]===_0x8cc8('0x1a')&&typeof _0x118e2b[_0x8cc8('0x1b')]===_0x8cc8('0x1a');var _0x76a993=_0x3c3644[_0x8cc8('0x1c')];var _0x76589d=_0x5925e9?0x0:_0x118e2b[_0x8cc8('0x19')];var _0x34a30a=_0x5925e9?_0x3c3644[_0x8cc8('0x1c')]:_0x118e2b[_0x8cc8('0x19')]+_0x118e2b[_0x8cc8('0x1b')];var _0x35d154;if(_0x34a30a>=_0x76a993){_0x34a30a=_0x76a993;_0x35d154=0xc8;}else{_0x35d154=0xce;}_0x5a1403[_0x8cc8('0x17')](_0x35d154);return _0x5a1403[_0x8cc8('0x1d')](_0x8cc8('0x1e'),_0x76589d+'-'+_0x34a30a+'/'+_0x76a993)[_0x8cc8('0x1f')](_0x3c3644);}return null;};}function patchUpdates(_0x476fc4){return function(_0x3acbba){try{jsonpatch['apply'](_0x3acbba,_0x476fc4,!![]);}catch(_0x357b55){return BPromise[_0x8cc8('0x20')](_0x357b55);}return _0x3acbba[_0x8cc8('0x21')]();};}function saveUpdates(_0x1bc3b7,_0x20acd8){return function(_0x287ac0){if(_0x287ac0){return _0x287ac0[_0x8cc8('0x22')](_0x1bc3b7)[_0x8cc8('0x23')](function(_0x3788b0){return _0x3788b0;});}return null;};}function removeEntity(_0x338fcd,_0x53bb3b){return function(_0x2a1f40){if(_0x2a1f40){return _0x2a1f40[_0x8cc8('0x24')]()['then'](function(){_0x338fcd[_0x8cc8('0x17')](0xcc)[_0x8cc8('0x18')]();});}};}function handleEntityNotFound(_0x5d2907,_0x2b6ebb){return function(_0x541ad5){if(!_0x541ad5){_0x5d2907[_0x8cc8('0x16')](0x194);}return _0x541ad5;};}function handleError(_0x275700,_0x21cc38){_0x21cc38=_0x21cc38||0x1f4;return function(_0x27d9e9){logger[_0x8cc8('0x25')](_0x27d9e9[_0x8cc8('0x26')]);if(_0x27d9e9['name']){delete _0x27d9e9[_0x8cc8('0x27')];}_0x275700[_0x8cc8('0x17')](_0x21cc38)['send'](_0x27d9e9);};}exports[_0x8cc8('0x28')]=function(_0x59971d,_0x58c4f5){var _0x24bd28={},_0x1b5659={},_0x4b270c={'count':0x0,'rows':[]};var _0x4f44b7=_[_0x8cc8('0x29')](db[_0x8cc8('0x2a')][_0x8cc8('0x2b')],function(_0x3bcbad){return{'name':_0x3bcbad[_0x8cc8('0x2c')],'type':_0x3bcbad[_0x8cc8('0x2d')][_0x8cc8('0x2e')]};});_0x1b5659[_0x8cc8('0x2f')]=_['map'](_0x4f44b7,_0x8cc8('0x27'));_0x1b5659[_0x8cc8('0x30')]=_[_0x8cc8('0x31')](_0x59971d[_0x8cc8('0x30')]);_0x1b5659['filters']=_[_0x8cc8('0x32')](_0x1b5659[_0x8cc8('0x2f')],_0x1b5659[_0x8cc8('0x30')]);_0x24bd28['attributes']=_['intersection'](_0x1b5659[_0x8cc8('0x2f')],qs[_0x8cc8('0x33')](_0x59971d[_0x8cc8('0x30')]['fields']));_0x24bd28[_0x8cc8('0x34')]=_0x24bd28[_0x8cc8('0x34')][_0x8cc8('0x35')]?_0x24bd28['attributes']:_0x1b5659[_0x8cc8('0x2f')];if(!_0x59971d[_0x8cc8('0x30')][_0x8cc8('0x36')](_0x8cc8('0x37'))){_0x24bd28[_0x8cc8('0x1b')]=qs[_0x8cc8('0x1b')](_0x59971d[_0x8cc8('0x30')][_0x8cc8('0x1b')]);_0x24bd28[_0x8cc8('0x19')]=qs[_0x8cc8('0x19')](_0x59971d[_0x8cc8('0x30')][_0x8cc8('0x19')]);}_0x24bd28['order']=qs[_0x8cc8('0x38')](_0x59971d['query'][_0x8cc8('0x38')]);_0x24bd28[_0x8cc8('0x39')]=qs['filters'](_[_0x8cc8('0x3a')](_0x59971d[_0x8cc8('0x30')],_0x1b5659['filters']),_0x4f44b7);if(_0x59971d[_0x8cc8('0x30')][_0x8cc8('0x3b')]){_0x24bd28[_0x8cc8('0x39')]=_[_0x8cc8('0x3c')](_0x24bd28[_0x8cc8('0x39')],{'$or':_[_0x8cc8('0x29')](_0x4f44b7,function(_0x394e97){if(_0x394e97[_0x8cc8('0x2d')]!==_0x8cc8('0x3d')){var _0x5605d1={};_0x5605d1[_0x394e97['name']]={'$like':'%'+_0x59971d[_0x8cc8('0x30')][_0x8cc8('0x3b')]+'%'};return _0x5605d1;}})});}_0x24bd28=_['merge']({},_0x24bd28,_0x59971d[_0x8cc8('0x3e')]);var _0x17991f={'where':_0x24bd28[_0x8cc8('0x39')]};return db[_0x8cc8('0x2a')][_0x8cc8('0x1c')](_0x17991f)['then'](function(_0x2f1738){_0x4b270c[_0x8cc8('0x1c')]=_0x2f1738;if(_0x59971d[_0x8cc8('0x30')]['includeAll']){_0x24bd28[_0x8cc8('0x3f')]=[{'all':!![]}];}return db[_0x8cc8('0x2a')][_0x8cc8('0x40')](_0x24bd28);})['then'](function(_0x30e9c8){_0x4b270c[_0x8cc8('0x41')]=_0x30e9c8;return _0x4b270c;})[_0x8cc8('0x23')](respondWithFilteredResult(_0x58c4f5,_0x24bd28))[_0x8cc8('0x42')](handleError(_0x58c4f5,null));};exports[_0x8cc8('0x43')]=function(_0x5c64eb,_0x3d84b9){var _0x4c009a={'raw':!![],'where':{'id':_0x5c64eb['params']['id']}},_0x1a90d2={};_0x1a90d2['model']=_['keys'](db['ZohoField'][_0x8cc8('0x2b')]);_0x1a90d2[_0x8cc8('0x30')]=_[_0x8cc8('0x31')](_0x5c64eb[_0x8cc8('0x30')]);_0x1a90d2[_0x8cc8('0x44')]=_['intersection'](_0x1a90d2['model'],_0x1a90d2['query']);_0x4c009a[_0x8cc8('0x34')]=_[_0x8cc8('0x32')](_0x1a90d2[_0x8cc8('0x2f')],qs['fields'](_0x5c64eb['query'][_0x8cc8('0x33')]));_0x4c009a['attributes']=_0x4c009a['attributes'][_0x8cc8('0x35')]?_0x4c009a[_0x8cc8('0x34')]:_0x1a90d2[_0x8cc8('0x2f')];if(_0x5c64eb[_0x8cc8('0x30')]['includeAll']){_0x4c009a[_0x8cc8('0x3f')]=[{'all':!![]}];}_0x4c009a=_[_0x8cc8('0x3c')]({},_0x4c009a,_0x5c64eb[_0x8cc8('0x3e')]);return db[_0x8cc8('0x2a')]['find'](_0x4c009a)['then'](handleEntityNotFound(_0x3d84b9,null))[_0x8cc8('0x23')](respondWithResult(_0x3d84b9,null))[_0x8cc8('0x42')](handleError(_0x3d84b9,null));};exports[_0x8cc8('0x45')]=function(_0x185bc4,_0x428d7a){return db['ZohoField'][_0x8cc8('0x45')](_0x185bc4['body'],{})[_0x8cc8('0x23')](respondWithResult(_0x428d7a,0xc9))['catch'](handleError(_0x428d7a,null));};exports[_0x8cc8('0x22')]=function(_0x113f8a,_0x32200e){if(_0x113f8a[_0x8cc8('0x46')]['id']){delete _0x113f8a['body']['id'];}return db[_0x8cc8('0x2a')]['find']({'where':{'id':_0x113f8a['params']['id']}})[_0x8cc8('0x23')](handleEntityNotFound(_0x32200e,null))[_0x8cc8('0x23')](saveUpdates(_0x113f8a[_0x8cc8('0x46')],null))['then'](respondWithResult(_0x32200e,null))[_0x8cc8('0x42')](handleError(_0x32200e,null));};exports['destroy']=function(_0x287c0f,_0x7ff8d2){return db[_0x8cc8('0x2a')][_0x8cc8('0x47')]({'where':{'id':_0x287c0f[_0x8cc8('0x48')]['id']}})[_0x8cc8('0x23')](handleEntityNotFound(_0x7ff8d2,null))[_0x8cc8('0x23')](removeEntity(_0x7ff8d2,null))[_0x8cc8('0x42')](handleError(_0x7ff8d2,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 1dec7d4..c352d09 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 _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(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x781d[_0x2d7f0e];return _0x110b07;};'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 +var _0xf61e=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index'];(function(_0x4ac4a1,_0x2e9361){var _0x5d5bb1=function(_0x2c1735){while(--_0x2c1735){_0x4ac4a1['push'](_0x4ac4a1['shift']());}};_0x5d5bb1(++_0x2e9361);}(_0xf61e,0x191));var _0xef61=function(_0x15a989,_0x52c21a){_0x15a989=_0x15a989-0x0;var _0x327071=_0xf61e[_0x15a989];return _0x327071;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('ZohoField',attributes,{'tableName':_0xef61('0xd'),'paranoid':![],'indexes':[{'name':_0xef61('0xe'),'fields':[_0xef61('0xf'),'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 505b97d..3cf2d5e 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 _0x914b=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1cbc47,_0x58b1e4){var _0x2759ff=function(_0x4294af){while(--_0x4294af){_0x1cbc47['push'](_0x1cbc47['shift']());}};_0x2759ff(++_0x58b1e4);}(_0x914b,0x168));var _0xb914=function(_0x46884f,_0x2b5c5a){_0x46884f=_0x46884f-0x0;var _0x78c6c0=_0x914b[_0x46884f];return _0x78c6c0;};'use strict';var _=require(_0xb914('0x0'));var util=require(_0xb914('0x1'));var moment=require(_0xb914('0x2'));var BPromise=require('bluebird');var rs=require(_0xb914('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb914('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb914('0x5'))(_0xb914('0x6'));var config=require(_0xb914('0x7'));var jayson=require(_0xb914('0x8'));var client=jayson[_0xb914('0x9')][_0xb914('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504fff,_0x105a16,_0x4315e0){return new BPromise(function(_0x1036ab,_0xe15113){return client[_0xb914('0xb')](_0x504fff,_0x4315e0)['then'](function(_0x18f410){logger[_0xb914('0xc')](_0xb914('0xd'),_0x105a16,'request\x20sent');logger['debug'](_0xb914('0xe'),_0x105a16,'request\x20sent',JSON[_0xb914('0xf')](_0x18f410));if(_0x18f410['error']){if(_0x18f410[_0xb914('0x10')]['code']===0x1f4){logger[_0xb914('0x10')](_0xb914('0xd'),_0x105a16,_0x18f410['error'][_0xb914('0x11')]);return _0xe15113(_0x18f410[_0xb914('0x10')][_0xb914('0x11')]);}logger[_0xb914('0x10')](_0xb914('0xd'),_0x105a16,_0x18f410[_0xb914('0x10')][_0xb914('0x11')]);return _0x1036ab(_0x18f410[_0xb914('0x10')][_0xb914('0x11')]);}else{logger['info'](_0xb914('0xd'),_0x105a16,'request\x20sent');_0x1036ab(_0x18f410[_0xb914('0x12')]['message']);}})[_0xb914('0x13')](function(_0x4a6839){logger[_0xb914('0x10')]('ZohoField,\x20%s,\x20%s',_0x105a16,_0x4a6839);_0xe15113(_0x4a6839);});});} \ No newline at end of file +var _0xf955=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x311dc8,_0x5591b4){var _0x407865=function(_0x4eda7b){while(--_0x4eda7b){_0x311dc8['push'](_0x311dc8['shift']());}};_0x407865(++_0x5591b4);}(_0xf955,0x126));var _0x5f95=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xf955[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x5f95('0x0'));var util=require(_0x5f95('0x1'));var moment=require('moment');var BPromise=require(_0x5f95('0x2'));var rs=require(_0x5f95('0x3'));var fs=require('fs');var Redis=require(_0x5f95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f95('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5f95('0x6'));var jayson=require(_0x5f95('0x7'));var client=jayson[_0x5f95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dfe5d,_0x1bb999,_0x1a6fee){return new BPromise(function(_0x3814da,_0x4ebe9b){return client[_0x5f95('0x9')](_0x3dfe5d,_0x1a6fee)[_0x5f95('0xa')](function(_0x5938cf){logger['info'](_0x5f95('0xb'),_0x1bb999,_0x5f95('0xc'));logger['debug'](_0x5f95('0xd'),_0x1bb999,_0x5f95('0xc'),JSON[_0x5f95('0xe')](_0x5938cf));if(_0x5938cf['error']){if(_0x5938cf[_0x5f95('0xf')][_0x5f95('0x10')]===0x1f4){logger[_0x5f95('0xf')](_0x5f95('0xb'),_0x1bb999,_0x5938cf[_0x5f95('0xf')][_0x5f95('0x11')]);return _0x4ebe9b(_0x5938cf['error'][_0x5f95('0x11')]);}logger['error'](_0x5f95('0xb'),_0x1bb999,_0x5938cf[_0x5f95('0xf')][_0x5f95('0x11')]);return _0x3814da(_0x5938cf['error'][_0x5f95('0x11')]);}else{logger[_0x5f95('0x12')](_0x5f95('0xb'),_0x1bb999,_0x5f95('0xc'));_0x3814da(_0x5938cf[_0x5f95('0x13')][_0x5f95('0x11')]);}})[_0x5f95('0x14')](function(_0x3d9e9e){logger[_0x5f95('0xf')](_0x5f95('0xb'),_0x1bb999,_0x3d9e9e);_0x4ebe9b(_0x3d9e9e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b585b13..be3c7f4 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x57c977,_0x3c6280){var _0x3795c7=function(_0x104ba3){while(--_0x104ba3){_0x57c977['push'](_0x57c977['shift']());}};_0x3795c7(++_0x3c6280);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x302b72,_0x483f35){var _0x48aa64=function(_0x45c63a){while(--_0x45c63a){_0x302b72['push'](_0x302b72['shift']());}};_0x48aa64(++_0x483f35);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 107938f..891c0da 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 _0x3e05=['unique_name_and_version','app.js','INTEGER','BOOLEAN','exports','STRING'];(function(_0x275894,_0xdfda5c){var _0x17e919=function(_0x57a301){while(--_0x57a301){_0x275894['push'](_0x275894['shift']());}};_0x17e919(++_0xdfda5c);}(_0x3e05,0x64));var _0x53e0=function(_0x5d37cd,_0x43fed3){_0x5d37cd=_0x5d37cd-0x0;var _0x1d45ac=_0x3e05[_0x5d37cd];return _0x1d45ac;};'use strict';var Sequelize=require('sequelize');module[_0x53e0('0x0')]={'name':{'type':Sequelize[_0x53e0('0x1')],'allowNull':![],'unique':_0x53e0('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x53e0('0x1')],'defaultValue':_0x53e0('0x3')},'filename':{'type':Sequelize[_0x53e0('0x1')]},'path':{'type':Sequelize[_0x53e0('0x1')]},'type':{'type':Sequelize[_0x53e0('0x1')]},'size':{'type':Sequelize[_0x53e0('0x4')]},'active':{'type':Sequelize[_0x53e0('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x53e0('0x1')]},'logo':{'type':Sequelize[_0x53e0('0x1')]},'state':{'type':Sequelize[_0x53e0('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x53e0('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x53e0('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa244=['sequelize','STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xa244,0xd2));var _0x4a24=function(_0x148fa9,_0x269ab0){_0x148fa9=_0x148fa9-0x0;var _0x11ebb8=_0xa244[_0x148fa9];return _0x11ebb8;};'use strict';var Sequelize=require(_0x4a24('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x4a24('0x1')],'allowNull':![],'unique':_0x4a24('0x2')},'main':{'type':Sequelize[_0x4a24('0x1')],'defaultValue':_0x4a24('0x3')},'filename':{'type':Sequelize[_0x4a24('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4a24('0x1')]},'size':{'type':Sequelize[_0x4a24('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x4a24('0x1')]},'logo':{'type':Sequelize[_0x4a24('0x1')]},'state':{'type':Sequelize[_0x4a24('0x1')],'unique':_0x4a24('0x5')},'description':{'type':Sequelize[_0x4a24('0x1')]},'title':{'type':Sequelize[_0x4a24('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x4a24('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 2efb709..19cdafc 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 _0xc1c6=['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','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x46bea6,_0x4398cb){var _0x89d185=function(_0x182b68){while(--_0x182b68){_0x46bea6['push'](_0x46bea6['shift']());}};_0x89d185(++_0x4398cb);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x34fc37,_0x45095e){_0x34fc37=_0x34fc37-0x0;var _0x19abb7=_0xc1c6[_0x34fc37];return _0x19abb7;};'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['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_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['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file +var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1c08f6,_0x14c077){var _0xbc156a=function(_0x59df22){while(--_0x59df22){_0x1c08f6['push'](_0x1c08f6['shift']());}};_0xbc156a(++_0x14c077);}(_0x2542,0x169));var _0x2254=function(_0x15220c,_0x56bcb3){_0x15220c=_0x15220c-0x0;var _0x4a0d69=_0x2542[_0x15220c];return _0x4a0d69;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 04f3ad0..e739f45 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 _0x090a=['exports','define','Integration','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xca8958,_0x25eed8){var _0x3d7165=function(_0x5dcced){while(--_0x5dcced){_0xca8958['push'](_0xca8958['shift']());}};_0x3d7165(++_0x25eed8);}(_0x090a,0x156));var _0xa090=function(_0x3676f1,_0x19c567){_0x3676f1=_0x3676f1-0x0;var _0x19f97d=_0x090a[_0x3676f1];return _0x19f97d;};'use strict';var _=require(_0xa090('0x0'));var util=require('util');var logger=require(_0xa090('0x1'))(_0xa090('0x2'));var moment=require(_0xa090('0x3'));var BPromise=require(_0xa090('0x4'));var rp=require(_0xa090('0x5'));var fs=require('fs');var path=require(_0xa090('0x6'));var rimraf=require(_0xa090('0x7'));var config=require(_0xa090('0x8'));var attributes=require('./integration.attributes');module[_0xa090('0x9')]=function(_0x1c135e,_0x2989ae){return _0x1c135e[_0xa090('0xa')](_0xa090('0xb'),attributes,{'tableName':_0xa090('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb81c=['rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','api','moment','bluebird'];(function(_0x2f8af8,_0x2c67fa){var _0x46a209=function(_0x5761d5){while(--_0x5761d5){_0x2f8af8['push'](_0x2f8af8['shift']());}};_0x46a209(++_0x2c67fa);}(_0xb81c,0x17c));var _0xcb81=function(_0x299e7e,_0x5c3f9b){_0x299e7e=_0x299e7e-0x0;var _0x2c1730=_0xb81c[_0x299e7e];return _0x2c1730;};'use strict';var _=require(_0xcb81('0x0'));var util=require(_0xcb81('0x1'));var logger=require('../../config/logger')(_0xcb81('0x2'));var moment=require(_0xcb81('0x3'));var BPromise=require(_0xcb81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb81('0x5'));var config=require(_0xcb81('0x6'));var attributes=require(_0xcb81('0x7'));module['exports']=function(_0x1107c9,_0xf3819b){return _0x1107c9[_0xcb81('0x8')](_0xcb81('0x9'),attributes,{'tableName':_0xcb81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index a35cecc..7f2b02a 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x59ce6a,_0x234b9f){var _0x59bc1d=function(_0x20a10c){while(--_0x20a10c){_0x59ce6a['push'](_0x59ce6a['shift']());}};_0x59bc1d(++_0x234b9f);}(_0xdb28,0x106));var _0x8db2=function(_0x104c7a,_0xb15a53){_0x104c7a=_0x104c7a-0x0;var _0x3c81f6=_0xdb28[_0x104c7a];return _0x3c81f6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3a1e1d,_0x3f400f){var _0x5c65d5=function(_0x2d1470){while(--_0x2d1470){_0x3a1e1d['push'](_0x3a1e1d['shift']());}};_0x5c65d5(++_0x3f400f);}(_0x2542,0x169));var _0x2254=function(_0xa311f9,_0x1fe6a9){_0xa311f9=_0xa311f9-0x0;var _0x300eea=_0x2542[_0xa311f9];return _0x300eea;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d88edf0..5b276e8 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xd943,0x15d));var _0x3d94=function(_0x833be8,_0x1df9fe){_0x833be8=_0x833be8-0x0;var _0x3a3088=_0xd943[_0x833be8];return _0x3a3088;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x46f39a,_0x25361f){_0x46f39a=_0x46f39a-0x0;var _0x37da76=_0x5f2f[_0x46f39a];return _0x37da76;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index fee108a..c2695f6 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 _0x28ff=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','RECEIVED','FAILED','exports','STRING'];(function(_0x556e75,_0x244403){var _0xd46094=function(_0x164334){while(--_0x164334){_0x556e75['push'](_0x556e75['shift']());}};_0xd46094(++_0x244403);}(_0x28ff,0x1b7));var _0xf28f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x28ff[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0xf28f('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xf28f('0x1')]},'ticketId':{'type':Sequelize[_0xf28f('0x1')]},'integrationId':{'type':Sequelize[_0xf28f('0x2')]},'contacts':{'type':Sequelize[_0xf28f('0x1')]},'uniqueid':{'type':Sequelize[_0xf28f('0x1')]},'calleridnum':{'type':Sequelize[_0xf28f('0x1')]},'calleridname':{'type':Sequelize[_0xf28f('0x1')]},'queue':{'type':Sequelize[_0xf28f('0x1')]},'interface':{'type':Sequelize[_0xf28f('0x1')]},'membername':{'type':Sequelize[_0xf28f('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf28f('0x3')]},'agentconnectAt':{'type':Sequelize[_0xf28f('0x3')]},'holdtime':{'type':Sequelize[_0xf28f('0x2')]},'agentcomplete':{'type':Sequelize[_0xf28f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf28f('0x3')]},'talktime':{'type':Sequelize[_0xf28f('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf28f('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf28f('0x3')]},'agentdump':{'type':Sequelize[_0xf28f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf28f('0x3')]},'lastevent':{'type':Sequelize[_0xf28f('0x1')]},'channel':{'type':Sequelize[_0xf28f('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf28f('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf28f('0x1')]},'language':{'type':Sequelize[_0xf28f('0x1')]},'accountcode':{'type':Sequelize[_0xf28f('0x1')]},'context':{'type':Sequelize[_0xf28f('0x1')]},'exten':{'type':Sequelize[_0xf28f('0x1')]},'priority':{'type':Sequelize[_0xf28f('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf28f('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf28f('0x1')]},'destcalleridname':{'type':Sequelize[_0xf28f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf28f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf28f('0x1')]},'destlanguage':{'type':Sequelize[_0xf28f('0x1')]},'destaccountcode':{'type':Sequelize[_0xf28f('0x1')]},'destcontext':{'type':Sequelize[_0xf28f('0x1')]},'destexten':{'type':Sequelize[_0xf28f('0x1')]},'destpriority':{'type':Sequelize[_0xf28f('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xf28f('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xf28f('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf28f('0x1')]},'cc':{'type':Sequelize[_0xf28f('0x1')]},'attachment':{'type':Sequelize[_0xf28f('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf28f('0x5')]},'status':{'type':Sequelize[_0xf28f('0x6')]('SENT','SENDING',_0xf28f('0x7'),_0xf28f('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xf28f('0x1')]},'projectId':{'type':Sequelize[_0xf28f('0x2')]}}; \ No newline at end of file +var _0xdb4e=['DATE','BOOLEAN','TEXT','SENT','SENDING','FAILED','STRING','INTEGER'];(function(_0x18c923,_0x446ce7){var _0x209f1f=function(_0x9f42a4){while(--_0x9f42a4){_0x18c923['push'](_0x18c923['shift']());}};_0x209f1f(++_0x446ce7);}(_0xdb4e,0x116));var _0xedb4=function(_0x4fdd27,_0x5c0912){_0x4fdd27=_0x4fdd27-0x0;var _0x5944ef=_0xdb4e[_0x4fdd27];return _0x5944ef;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xedb4('0x0')]},'exitStatus':{'type':Sequelize[_0xedb4('0x0')]},'ticketId':{'type':Sequelize[_0xedb4('0x0')]},'integrationId':{'type':Sequelize[_0xedb4('0x1')]},'contacts':{'type':Sequelize[_0xedb4('0x0')]},'uniqueid':{'type':Sequelize[_0xedb4('0x0')]},'calleridnum':{'type':Sequelize[_0xedb4('0x0')]},'calleridname':{'type':Sequelize[_0xedb4('0x0')]},'queue':{'type':Sequelize[_0xedb4('0x0')]},'interface':{'type':Sequelize[_0xedb4('0x0')]},'membername':{'type':Sequelize[_0xedb4('0x0')]},'agentcalledAt':{'type':Sequelize[_0xedb4('0x2')]},'agentconnectAt':{'type':Sequelize[_0xedb4('0x2')]},'holdtime':{'type':Sequelize[_0xedb4('0x1')]},'agentcomplete':{'type':Sequelize[_0xedb4('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xedb4('0x2')]},'talktime':{'type':Sequelize[_0xedb4('0x1')]},'agentacw':{'type':Sequelize[_0xedb4('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xedb4('0x1')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xedb4('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xedb4('0x2')]},'agentdump':{'type':Sequelize[_0xedb4('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xedb4('0x2')]},'lastevent':{'type':Sequelize[_0xedb4('0x0')]},'channel':{'type':Sequelize[_0xedb4('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xedb4('0x0')]},'connectedlinenum':{'type':Sequelize[_0xedb4('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xedb4('0x0')]},'accountcode':{'type':Sequelize[_0xedb4('0x0')]},'context':{'type':Sequelize[_0xedb4('0x0')]},'exten':{'type':Sequelize[_0xedb4('0x0')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xedb4('0x0')]},'destchannelstate':{'type':Sequelize[_0xedb4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0xedb4('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xedb4('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0xedb4('0x0')]},'destconnectedlinename':{'type':Sequelize[_0xedb4('0x0')]},'destlanguage':{'type':Sequelize[_0xedb4('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xedb4('0x0')]},'destpriority':{'type':Sequelize[_0xedb4('0x0')]},'destuniqueid':{'type':Sequelize[_0xedb4('0x0')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xedb4('0x0')]},'subject':{'type':Sequelize[_0xedb4('0x0')]},'from':{'type':Sequelize[_0xedb4('0x0')]},'to':{'type':Sequelize[_0xedb4('0x0')]},'cc':{'type':Sequelize[_0xedb4('0x0')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xedb4('0x4')]},'text':{'type':Sequelize[_0xedb4('0x4')]},'status':{'type':Sequelize['ENUM'](_0xedb4('0x5'),_0xedb4('0x6'),'RECEIVED',_0xedb4('0x7'))},'url':{'type':Sequelize[_0xedb4('0x0')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xedb4('0x0')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0792e07..8bf500d 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 _0x1550=['limit','sort','filters','filter','where','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','reject','save','update','then','destroy','error','stack','name','send','index','type','key','map','query','intersection','model','attributes','fields','length','nolimit'];(function(_0x242357,_0x15ed16){var _0x556e04=function(_0x310d9a){while(--_0x310d9a){_0x242357['push'](_0x242357['shift']());}};_0x556e04(++_0x15ed16);}(_0x1550,0x131));var _0x0155=function(_0x55ac0a,_0x2e5512){_0x55ac0a=_0x55ac0a-0x0;var _0x268277=_0x1550[_0x55ac0a];return _0x268277;};'use strict';var emlformat=require(_0x0155('0x0'));var rimraf=require(_0x0155('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0155('0x2'));var rp=require('request-promise');var moment=require(_0x0155('0x3'));var BPromise=require(_0x0155('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0155('0x5'));var sox=require('sox');var csv=require(_0x0155('0x6'));var ejs=require(_0x0155('0x7'));var fs=require('fs');var fs_extra=require(_0x0155('0x8'));var _=require(_0x0155('0x9'));var squel=require(_0x0155('0xa'));var crypto=require(_0x0155('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0155('0xc'));var toCsv=require(_0x0155('0x6'));var querystring=require(_0x0155('0xd'));var Papa=require(_0x0155('0xe'));var Redis=require(_0x0155('0xf'));var authService=require(_0x0155('0x10'));var qs=require(_0x0155('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0155('0x12'));var logger=require('../../config/logger')(_0x0155('0x13'));var utils=require(_0x0155('0x14'));var config=require(_0x0155('0x15'));var licenseUtil=require(_0x0155('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc5df,_0x3566b8){_0x3566b8=_0x3566b8||0xcc;return function(_0x23afaa){if(_0x23afaa){return _0x5dc5df[_0x0155('0x17')](_0x3566b8);}return _0x5dc5df['status'](_0x3566b8)[_0x0155('0x18')]();};}function respondWithResult(_0x1f0ec7,_0x1dcace){_0x1dcace=_0x1dcace||0xc8;return function(_0x20b2d1){if(_0x20b2d1){return _0x1f0ec7['status'](_0x1dcace)[_0x0155('0x19')](_0x20b2d1);}};}function respondWithFilteredResult(_0x4429ed,_0x473064){return function(_0xe52956){if(_0xe52956){var _0x2ca1c6=typeof _0x473064[_0x0155('0x1a')]===_0x0155('0x1b')&&typeof _0x473064['limit']===_0x0155('0x1b');var _0x3ed6e3=_0xe52956[_0x0155('0x1c')];var _0x3e4fec=_0x2ca1c6?0x0:_0x473064['offset'];var _0x20470f=_0x2ca1c6?_0xe52956[_0x0155('0x1c')]:_0x473064[_0x0155('0x1a')]+_0x473064['limit'];var _0x42c718;if(_0x20470f>=_0x3ed6e3){_0x20470f=_0x3ed6e3;_0x42c718=0xc8;}else{_0x42c718=0xce;}_0x4429ed[_0x0155('0x1d')](_0x42c718);return _0x4429ed['set']('Content-Range',_0x3e4fec+'-'+_0x20470f+'/'+_0x3ed6e3)[_0x0155('0x19')](_0xe52956);}return null;};}function patchUpdates(_0x547825){return function(_0x352a09){try{jsonpatch['apply'](_0x352a09,_0x547825,!![]);}catch(_0x42cb20){return BPromise[_0x0155('0x1e')](_0x42cb20);}return _0x352a09[_0x0155('0x1f')]();};}function saveUpdates(_0x4bb8eb,_0x15e9a3){return function(_0x4ae4aa){if(_0x4ae4aa){return _0x4ae4aa[_0x0155('0x20')](_0x4bb8eb)[_0x0155('0x21')](function(_0x1a3ac0){return _0x1a3ac0;});}return null;};}function removeEntity(_0xfdc9e5,_0x36e58f){return function(_0x2336ba){if(_0x2336ba){return _0x2336ba[_0x0155('0x22')]()[_0x0155('0x21')](function(){_0xfdc9e5[_0x0155('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fc305,_0x4299ad){return function(_0x1742c9){if(!_0x1742c9){_0x3fc305['sendStatus'](0x194);}return _0x1742c9;};}function handleError(_0x3b99b4,_0x12e404){_0x12e404=_0x12e404||0x1f4;return function(_0x330ad8){logger[_0x0155('0x23')](_0x330ad8[_0x0155('0x24')]);if(_0x330ad8['name']){delete _0x330ad8[_0x0155('0x25')];}_0x3b99b4[_0x0155('0x1d')](_0x12e404)[_0x0155('0x26')](_0x330ad8);};}exports[_0x0155('0x27')]=function(_0x196c9d,_0x54a2be){var _0x28f450={},_0x10ce41={},_0x1e0e4f={'count':0x0,'rows':[]};var _0x2995d3=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x5c737d){return{'name':_0x5c737d['fieldName'],'type':_0x5c737d[_0x0155('0x28')][_0x0155('0x29')]};});_0x10ce41['model']=_[_0x0155('0x2a')](_0x2995d3,_0x0155('0x25'));_0x10ce41[_0x0155('0x2b')]=_['keys'](_0x196c9d[_0x0155('0x2b')]);_0x10ce41['filters']=_[_0x0155('0x2c')](_0x10ce41[_0x0155('0x2d')],_0x10ce41[_0x0155('0x2b')]);_0x28f450[_0x0155('0x2e')]=_[_0x0155('0x2c')](_0x10ce41[_0x0155('0x2d')],qs['fields'](_0x196c9d[_0x0155('0x2b')][_0x0155('0x2f')]));_0x28f450[_0x0155('0x2e')]=_0x28f450[_0x0155('0x2e')][_0x0155('0x30')]?_0x28f450[_0x0155('0x2e')]:_0x10ce41[_0x0155('0x2d')];if(!_0x196c9d[_0x0155('0x2b')]['hasOwnProperty'](_0x0155('0x31'))){_0x28f450[_0x0155('0x32')]=qs[_0x0155('0x32')](_0x196c9d[_0x0155('0x2b')]['limit']);_0x28f450[_0x0155('0x1a')]=qs['offset'](_0x196c9d[_0x0155('0x2b')][_0x0155('0x1a')]);}_0x28f450['order']=qs['sort'](_0x196c9d['query'][_0x0155('0x33')]);_0x28f450['where']=qs[_0x0155('0x34')](_['pick'](_0x196c9d[_0x0155('0x2b')],_0x10ce41[_0x0155('0x34')]),_0x2995d3);if(_0x196c9d[_0x0155('0x2b')][_0x0155('0x35')]){_0x28f450[_0x0155('0x36')]=_['merge'](_0x28f450['where'],{'$or':_['map'](_0x2995d3,function(_0xc8c4aa){if(_0xc8c4aa[_0x0155('0x28')]!==_0x0155('0x37')){var _0x29012d={};_0x29012d[_0xc8c4aa['name']]={'$like':'%'+_0x196c9d['query'][_0x0155('0x35')]+'%'};return _0x29012d;}})});}_0x28f450=_['merge']({},_0x28f450,_0x196c9d['options']);var _0x49e46f={'where':_0x28f450[_0x0155('0x36')]};return db[_0x0155('0x38')][_0x0155('0x1c')](_0x49e46f)['then'](function(_0x3e2155){_0x1e0e4f[_0x0155('0x1c')]=_0x3e2155;if(_0x196c9d[_0x0155('0x2b')][_0x0155('0x39')]){_0x28f450[_0x0155('0x3a')]=[{'all':!![]}];}return db[_0x0155('0x38')][_0x0155('0x3b')](_0x28f450);})[_0x0155('0x21')](function(_0x3f92d3){_0x1e0e4f[_0x0155('0x3c')]=_0x3f92d3;return _0x1e0e4f;})[_0x0155('0x21')](respondWithFilteredResult(_0x54a2be,_0x28f450))[_0x0155('0x3d')](handleError(_0x54a2be,null));};exports[_0x0155('0x3e')]=function(_0x4b67f5,_0x28de4b){var _0x51a55c={'raw':![],'where':{'id':_0x4b67f5[_0x0155('0x3f')]['id']}},_0x1cedff={};_0x1cedff['model']=_['keys'](db[_0x0155('0x38')]['rawAttributes']);_0x1cedff[_0x0155('0x2b')]=_[_0x0155('0x40')](_0x4b67f5[_0x0155('0x2b')]);_0x1cedff[_0x0155('0x34')]=_[_0x0155('0x2c')](_0x1cedff[_0x0155('0x2d')],_0x1cedff['query']);_0x51a55c[_0x0155('0x2e')]=_[_0x0155('0x2c')](_0x1cedff['model'],qs['fields'](_0x4b67f5[_0x0155('0x2b')][_0x0155('0x2f')]));_0x51a55c[_0x0155('0x2e')]=_0x51a55c['attributes']['length']?_0x51a55c[_0x0155('0x2e')]:_0x1cedff[_0x0155('0x2d')];if(_0x4b67f5[_0x0155('0x2b')]['includeAll']){_0x51a55c[_0x0155('0x3a')]=[{'all':!![]}];}_0x51a55c=_[_0x0155('0x41')]({},_0x51a55c,_0x4b67f5[_0x0155('0x42')]);return db['IntegrationReport']['find'](_0x51a55c)[_0x0155('0x21')](handleEntityNotFound(_0x28de4b,null))[_0x0155('0x21')](respondWithResult(_0x28de4b,null))['catch'](handleError(_0x28de4b,null));};exports[_0x0155('0x43')]=function(_0x16318e,_0x336049){return db[_0x0155('0x38')][_0x0155('0x43')](_0x16318e['body'],{})[_0x0155('0x21')](respondWithResult(_0x336049,0xc9))[_0x0155('0x3d')](handleError(_0x336049,null));};exports[_0x0155('0x20')]=function(_0x4c8e79,_0x1811cc){if(_0x4c8e79[_0x0155('0x44')]['id']){delete _0x4c8e79[_0x0155('0x44')]['id'];}return db[_0x0155('0x38')]['find']({'where':{'id':_0x4c8e79[_0x0155('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1811cc,null))[_0x0155('0x21')](saveUpdates(_0x4c8e79[_0x0155('0x44')],null))[_0x0155('0x21')](respondWithResult(_0x1811cc,null))[_0x0155('0x3d')](handleError(_0x1811cc,null));};exports['destroy']=function(_0x11c332,_0x162298){return db[_0x0155('0x38')][_0x0155('0x45')]({'where':{'id':_0x11c332[_0x0155('0x3f')]['id']}})[_0x0155('0x21')](handleEntityNotFound(_0x162298,null))[_0x0155('0x21')](removeEntity(_0x162298,null))[_0x0155('0x3d')](handleError(_0x162298,null));};exports['describe']=function(_0x2146bb,_0x28fdc9){return db['IntegrationReport'][_0x0155('0x46')]()['then'](respondWithResult(_0x28fdc9,null))['catch'](handleError(_0x28fdc9,null));}; \ No newline at end of file +var _0xf5df=['find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','json','apply','save','update','then','destroy','error','stack','name','send','map','IntegrationReport','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf5df,0x98));var _0xff5d=function(_0xe2200d,_0x5de855){_0xe2200d=_0xe2200d-0x0;var _0x52c980=_0xf5df[_0xe2200d];return _0x52c980;};'use strict';var emlformat=require(_0xff5d('0x0'));var rimraf=require(_0xff5d('0x1'));var zipdir=require(_0xff5d('0x2'));var jsonpatch=require(_0xff5d('0x3'));var rp=require(_0xff5d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff5d('0x5'));var util=require(_0xff5d('0x6'));var path=require('path');var sox=require(_0xff5d('0x7'));var csv=require(_0xff5d('0x8'));var ejs=require(_0xff5d('0x9'));var fs=require('fs');var fs_extra=require(_0xff5d('0xa'));var _=require(_0xff5d('0xb'));var squel=require(_0xff5d('0xc'));var crypto=require('crypto');var jsforce=require(_0xff5d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff5d('0xe'));var Papa=require(_0xff5d('0xf'));var Redis=require('ioredis');var authService=require(_0xff5d('0x10'));var qs=require(_0xff5d('0x11'));var as=require(_0xff5d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff5d('0x13'))(_0xff5d('0x14'));var utils=require(_0xff5d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff5d('0x16'));var db=require(_0xff5d('0x17'))['db'];function respondWithStatusCode(_0x21878b,_0xbd7ddb){_0xbd7ddb=_0xbd7ddb||0xcc;return function(_0x142dde){if(_0x142dde){return _0x21878b[_0xff5d('0x18')](_0xbd7ddb);}return _0x21878b['status'](_0xbd7ddb)[_0xff5d('0x19')]();};}function respondWithResult(_0x523270,_0x395f2e){_0x395f2e=_0x395f2e||0xc8;return function(_0x269edc){if(_0x269edc){return _0x523270[_0xff5d('0x1a')](_0x395f2e)['json'](_0x269edc);}};}function respondWithFilteredResult(_0x232cc0,_0x5270c7){return function(_0x520a27){if(_0x520a27){var _0x1d827a=typeof _0x5270c7['offset']===_0xff5d('0x1b')&&typeof _0x5270c7['limit']===_0xff5d('0x1b');var _0x4ba48e=_0x520a27[_0xff5d('0x1c')];var _0x4b6735=_0x1d827a?0x0:_0x5270c7['offset'];var _0x1a5245=_0x1d827a?_0x520a27['count']:_0x5270c7[_0xff5d('0x1d')]+_0x5270c7[_0xff5d('0x1e')];var _0xf24f7b;if(_0x1a5245>=_0x4ba48e){_0x1a5245=_0x4ba48e;_0xf24f7b=0xc8;}else{_0xf24f7b=0xce;}_0x232cc0[_0xff5d('0x1a')](_0xf24f7b);return _0x232cc0['set']('Content-Range',_0x4b6735+'-'+_0x1a5245+'/'+_0x4ba48e)[_0xff5d('0x1f')](_0x520a27);}return null;};}function patchUpdates(_0x2547a2){return function(_0x2caf8b){try{jsonpatch[_0xff5d('0x20')](_0x2caf8b,_0x2547a2,!![]);}catch(_0x475503){return BPromise['reject'](_0x475503);}return _0x2caf8b[_0xff5d('0x21')]();};}function saveUpdates(_0x1e599d,_0x356369){return function(_0x52cd73){if(_0x52cd73){return _0x52cd73[_0xff5d('0x22')](_0x1e599d)[_0xff5d('0x23')](function(_0x57f372){return _0x57f372;});}return null;};}function removeEntity(_0xeb431b,_0x8a8e56){return function(_0x374a93){if(_0x374a93){return _0x374a93[_0xff5d('0x24')]()[_0xff5d('0x23')](function(){_0xeb431b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a810,_0x2acdd9){return function(_0x4b1d51){if(!_0x4b1d51){_0x58a810[_0xff5d('0x18')](0x194);}return _0x4b1d51;};}function handleError(_0x173d53,_0x20e290){_0x20e290=_0x20e290||0x1f4;return function(_0x28278a){logger[_0xff5d('0x25')](_0x28278a[_0xff5d('0x26')]);if(_0x28278a[_0xff5d('0x27')]){delete _0x28278a[_0xff5d('0x27')];}_0x173d53[_0xff5d('0x1a')](_0x20e290)[_0xff5d('0x28')](_0x28278a);};}exports['index']=function(_0xee4640,_0x4f50df){var _0x3f5f5a={},_0x27081c={},_0x3b8255={'count':0x0,'rows':[]};var _0x15252f=_[_0xff5d('0x29')](db[_0xff5d('0x2a')]['rawAttributes'],function(_0x14a2c0){return{'name':_0x14a2c0[_0xff5d('0x2b')],'type':_0x14a2c0['type'][_0xff5d('0x2c')]};});_0x27081c['model']=_['map'](_0x15252f,_0xff5d('0x27'));_0x27081c[_0xff5d('0x2d')]=_['keys'](_0xee4640[_0xff5d('0x2d')]);_0x27081c[_0xff5d('0x2e')]=_[_0xff5d('0x2f')](_0x27081c[_0xff5d('0x30')],_0x27081c[_0xff5d('0x2d')]);_0x3f5f5a[_0xff5d('0x31')]=_['intersection'](_0x27081c[_0xff5d('0x30')],qs['fields'](_0xee4640[_0xff5d('0x2d')][_0xff5d('0x32')]));_0x3f5f5a[_0xff5d('0x31')]=_0x3f5f5a[_0xff5d('0x31')]['length']?_0x3f5f5a[_0xff5d('0x31')]:_0x27081c[_0xff5d('0x30')];if(!_0xee4640[_0xff5d('0x2d')][_0xff5d('0x33')](_0xff5d('0x34'))){_0x3f5f5a[_0xff5d('0x1e')]=qs[_0xff5d('0x1e')](_0xee4640[_0xff5d('0x2d')][_0xff5d('0x1e')]);_0x3f5f5a[_0xff5d('0x1d')]=qs['offset'](_0xee4640[_0xff5d('0x2d')][_0xff5d('0x1d')]);}_0x3f5f5a[_0xff5d('0x35')]=qs['sort'](_0xee4640['query']['sort']);_0x3f5f5a['where']=qs[_0xff5d('0x2e')](_[_0xff5d('0x36')](_0xee4640[_0xff5d('0x2d')],_0x27081c[_0xff5d('0x2e')]),_0x15252f);if(_0xee4640[_0xff5d('0x2d')][_0xff5d('0x37')]){_0x3f5f5a['where']=_['merge'](_0x3f5f5a[_0xff5d('0x38')],{'$or':_[_0xff5d('0x29')](_0x15252f,function(_0x4dfb6b){if(_0x4dfb6b[_0xff5d('0x39')]!==_0xff5d('0x3a')){var _0x427fe9={};_0x427fe9[_0x4dfb6b[_0xff5d('0x27')]]={'$like':'%'+_0xee4640[_0xff5d('0x2d')][_0xff5d('0x37')]+'%'};return _0x427fe9;}})});}_0x3f5f5a=_['merge']({},_0x3f5f5a,_0xee4640[_0xff5d('0x3b')]);var _0x24c5bb={'where':_0x3f5f5a[_0xff5d('0x38')]};return db[_0xff5d('0x2a')][_0xff5d('0x1c')](_0x24c5bb)['then'](function(_0x4b5b69){_0x3b8255[_0xff5d('0x1c')]=_0x4b5b69;if(_0xee4640[_0xff5d('0x2d')][_0xff5d('0x3c')]){_0x3f5f5a[_0xff5d('0x3d')]=[{'all':!![]}];}return db[_0xff5d('0x2a')][_0xff5d('0x3e')](_0x3f5f5a);})[_0xff5d('0x23')](function(_0x5dad6b){_0x3b8255[_0xff5d('0x3f')]=_0x5dad6b;return _0x3b8255;})[_0xff5d('0x23')](respondWithFilteredResult(_0x4f50df,_0x3f5f5a))[_0xff5d('0x40')](handleError(_0x4f50df,null));};exports[_0xff5d('0x41')]=function(_0x136843,_0x5ee25d){var _0x1e11db={'raw':![],'where':{'id':_0x136843[_0xff5d('0x42')]['id']}},_0x3462f2={};_0x3462f2[_0xff5d('0x30')]=_[_0xff5d('0x43')](db[_0xff5d('0x2a')][_0xff5d('0x44')]);_0x3462f2[_0xff5d('0x2d')]=_[_0xff5d('0x43')](_0x136843[_0xff5d('0x2d')]);_0x3462f2[_0xff5d('0x2e')]=_[_0xff5d('0x2f')](_0x3462f2[_0xff5d('0x30')],_0x3462f2[_0xff5d('0x2d')]);_0x1e11db['attributes']=_[_0xff5d('0x2f')](_0x3462f2[_0xff5d('0x30')],qs[_0xff5d('0x32')](_0x136843[_0xff5d('0x2d')][_0xff5d('0x32')]));_0x1e11db['attributes']=_0x1e11db[_0xff5d('0x31')]['length']?_0x1e11db['attributes']:_0x3462f2[_0xff5d('0x30')];if(_0x136843[_0xff5d('0x2d')]['includeAll']){_0x1e11db['include']=[{'all':!![]}];}_0x1e11db=_[_0xff5d('0x45')]({},_0x1e11db,_0x136843['options']);return db[_0xff5d('0x2a')][_0xff5d('0x46')](_0x1e11db)['then'](handleEntityNotFound(_0x5ee25d,null))[_0xff5d('0x23')](respondWithResult(_0x5ee25d,null))['catch'](handleError(_0x5ee25d,null));};exports[_0xff5d('0x47')]=function(_0x5c6112,_0x342476){return db[_0xff5d('0x2a')][_0xff5d('0x47')](_0x5c6112['body'],{})['then'](respondWithResult(_0x342476,0xc9))['catch'](handleError(_0x342476,null));};exports[_0xff5d('0x22')]=function(_0x2e43f1,_0x360c7f){if(_0x2e43f1['body']['id']){delete _0x2e43f1[_0xff5d('0x48')]['id'];}return db[_0xff5d('0x2a')][_0xff5d('0x46')]({'where':{'id':_0x2e43f1[_0xff5d('0x42')]['id']}})[_0xff5d('0x23')](handleEntityNotFound(_0x360c7f,null))[_0xff5d('0x23')](saveUpdates(_0x2e43f1['body'],null))[_0xff5d('0x23')](respondWithResult(_0x360c7f,null))[_0xff5d('0x40')](handleError(_0x360c7f,null));};exports['destroy']=function(_0x29a002,_0x44102b){return db[_0xff5d('0x2a')]['find']({'where':{'id':_0x29a002[_0xff5d('0x42')]['id']}})[_0xff5d('0x23')](handleEntityNotFound(_0x44102b,null))[_0xff5d('0x23')](removeEntity(_0x44102b,null))[_0xff5d('0x40')](handleError(_0x44102b,null));};exports['describe']=function(_0x2d44ae,_0x53f63d){return db['IntegrationReport'][_0xff5d('0x49')]()[_0xff5d('0x23')](respondWithResult(_0x53f63d,null))[_0xff5d('0x40')](handleError(_0x53f63d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 398a99e..44434a0 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 _0x03cb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','IntegrationReport','report_integration','lodash','util','../../config/logger'];(function(_0x3e478c,_0x3afee8){var _0x3a0906=function(_0x580d99){while(--_0x580d99){_0x3e478c['push'](_0x3e478c['shift']());}};_0x3a0906(++_0x3afee8);}(_0x03cb,0x1ad));var _0xb03c=function(_0x21d52b,_0x354e04){_0x21d52b=_0x21d52b-0x0;var _0x13c3b0=_0x03cb[_0x21d52b];return _0x13c3b0;};'use strict';var _=require(_0xb03c('0x0'));var util=require(_0xb03c('0x1'));var logger=require(_0xb03c('0x2'))(_0xb03c('0x3'));var moment=require(_0xb03c('0x4'));var BPromise=require(_0xb03c('0x5'));var rp=require(_0xb03c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb03c('0x7'));var config=require(_0xb03c('0x8'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x5b6726,_0x3ede50){return _0x5b6726[_0xb03c('0x9')](_0xb03c('0xa'),attributes,{'tableName':_0xb03c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0888=['request-promise','../../config/environment','./integrationReport.attributes','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x4bf4db,_0x4b0757){var _0x4002ce=function(_0x1e3f65){while(--_0x1e3f65){_0x4bf4db['push'](_0x4bf4db['shift']());}};_0x4002ce(++_0x4b0757);}(_0x0888,0x191));var _0x8088=function(_0x1c507d,_0x5f38cf){_0x1c507d=_0x1c507d-0x0;var _0x2bfa74=_0x0888[_0x1c507d];return _0x2bfa74;};'use strict';var _=require(_0x8088('0x0'));var util=require('util');var logger=require(_0x8088('0x1'))(_0x8088('0x2'));var moment=require('moment');var BPromise=require(_0x8088('0x3'));var rp=require(_0x8088('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8088('0x5'));var attributes=require(_0x8088('0x6'));module[_0x8088('0x7')]=function(_0x406797,_0x20bb60){return _0x406797[_0x8088('0x8')]('IntegrationReport',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 00e2a53..a80fdd2 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x429674,_0x2f8675){var _0x3831eb=function(_0xab7564){while(--_0xab7564){_0x429674['push'](_0x429674['shift']());}};_0x3831eb(++_0x2f8675);}(_0xda19,0xd5));var _0x9da1=function(_0x93d2c9,_0x1a3046){_0x93d2c9=_0x93d2c9-0x0;var _0x108bd0=_0xda19[_0x93d2c9];return _0x108bd0;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x9670f,_0x587aac){var _0x5650da=function(_0x5e8384){while(--_0x5e8384){_0x9670f['push'](_0x9670f['shift']());}};_0x5650da(++_0x587aac);}(_0x4819,0xcd));var _0x9481=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x4819[_0x2ed8f3];return _0x525a55;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 456bbb3..c2621e7 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 _0x3079=['create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','post'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3079,0x110));var _0x9307=function(_0x3b1ed4,_0x158fec){_0x3b1ed4=_0x3b1ed4-0x0;var _0x2fc35e=_0x3079[_0x3b1ed4];return _0x2fc35e;};'use strict';var multer=require('multer');var util=require(_0x9307('0x0'));var path=require(_0x9307('0x1'));var timeout=require(_0x9307('0x2'));var express=require(_0x9307('0x3'));var router=express['Router']();var fs_extra=require(_0x9307('0x4'));var auth=require(_0x9307('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9307('0x6'));router[_0x9307('0x7')]('/',auth[_0x9307('0x8')](),controller[_0x9307('0x9')]);router[_0x9307('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9307('0xa')]);router['get'](_0x9307('0xb'),auth[_0x9307('0x8')](),controller['getIntervals']);router[_0x9307('0xc')]('/',auth[_0x9307('0x8')](),controller[_0x9307('0xd')]);router['post']('/:id/sub_intervals',auth[_0x9307('0x8')](),controller[_0x9307('0xe')]);router[_0x9307('0xc')](_0x9307('0xf'),auth[_0x9307('0x8')](),controller[_0x9307('0x10')]);router['put'](_0x9307('0x11'),auth[_0x9307('0x8')](),controller['update']);router['delete'](_0x9307('0x11'),auth[_0x9307('0x8')](),controller['destroy']);module[_0x9307('0x12')]=router; \ No newline at end of file +var _0x2a9b=['../../config/environment','./interval.controller','get','isAuthenticated','index','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1825bc,_0x304712){var _0x47a7b1=function(_0x4533e0){while(--_0x4533e0){_0x1825bc['push'](_0x1825bc['shift']());}};_0x47a7b1(++_0x304712);}(_0x2a9b,0x14b));var _0xb2a9=function(_0x456a66,_0x1ff56e){_0x456a66=_0x456a66-0x0;var _0x4b9212=_0x2a9b[_0x456a66];return _0x4b9212;};'use strict';var multer=require('multer');var util=require(_0xb2a9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb2a9('0x1'));var router=express[_0xb2a9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb2a9('0x3'));var interaction=require(_0xb2a9('0x4'));var config=require(_0xb2a9('0x5'));var controller=require(_0xb2a9('0x6'));router[_0xb2a9('0x7')]('/',auth[_0xb2a9('0x8')](),controller[_0xb2a9('0x9')]);router[_0xb2a9('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/sub_intervals',auth[_0xb2a9('0x8')](),controller[_0xb2a9('0xa')]);router[_0xb2a9('0xb')]('/',auth[_0xb2a9('0x8')](),controller[_0xb2a9('0xc')]);router[_0xb2a9('0xb')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xb2a9('0xd')]);router[_0xb2a9('0xb')](_0xb2a9('0xe'),auth[_0xb2a9('0x8')](),controller[_0xb2a9('0xf')]);router[_0xb2a9('0x10')](_0xb2a9('0x11'),auth['isAuthenticated'](),controller[_0xb2a9('0x12')]);router[_0xb2a9('0x13')](_0xb2a9('0x11'),auth[_0xb2a9('0x8')](),controller[_0xb2a9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4874d6b..cf1b36c 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 _0x0c1a=['exports','STRING'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x0c1a,0x160));var _0xa0c1=function(_0x20a487,_0x545b40){_0x20a487=_0x20a487-0x0;var _0x1e5742=_0x0c1a[_0x20a487];return _0x1e5742;};'use strict';var Sequelize=require('sequelize');module[_0xa0c1('0x0')]={'name':{'type':Sequelize[_0xa0c1('0x1')]},'description':{'type':Sequelize[_0xa0c1('0x1')]},'interval':{'type':Sequelize[_0xa0c1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xaf6c=['STRING','sequelize','exports'];(function(_0x4a3397,_0x1a3b91){var _0x28cdf8=function(_0x3a97fb){while(--_0x3a97fb){_0x4a3397['push'](_0x4a3397['shift']());}};_0x28cdf8(++_0x1a3b91);}(_0xaf6c,0x11e));var _0xcaf6=function(_0x33333a,_0x570d35){_0x33333a=_0x33333a-0x0;var _0x33fe43=_0xaf6c[_0x33333a];return _0x33fe43;};'use strict';var Sequelize=require(_0xcaf6('0x0'));module[_0xcaf6('0x1')]={'name':{'type':Sequelize[_0xcaf6('0x2')]},'description':{'type':Sequelize[_0xcaf6('0x2')]},'interval':{'type':Sequelize[_0xcaf6('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 58e5c76..fabe440 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 _0xb523=['reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','sendStatus','name','send','index','map','Interval','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','getIntervals','findOne','keys','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','count','set','apply'];(function(_0x3f9d42,_0x429c01){var _0x3a731d=function(_0x570a8e){while(--_0x570a8e){_0x3f9d42['push'](_0x3f9d42['shift']());}};_0x3a731d(++_0x429c01);}(_0xb523,0xf1));var _0x3b52=function(_0x18c521,_0x48f22c){_0x18c521=_0x18c521-0x0;var _0x5c2726=_0xb523[_0x18c521];return _0x5c2726;};'use strict';var emlformat=require(_0x3b52('0x0'));var rimraf=require(_0x3b52('0x1'));var zipdir=require(_0x3b52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b52('0x3'));var moment=require(_0x3b52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b52('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3b52('0x6'));var csv=require(_0x3b52('0x7'));var ejs=require(_0x3b52('0x8'));var fs=require('fs');var fs_extra=require(_0x3b52('0x9'));var _=require(_0x3b52('0xa'));var squel=require('squel');var crypto=require(_0x3b52('0xb'));var jsforce=require(_0x3b52('0xc'));var deskjs=require(_0x3b52('0xd'));var toCsv=require(_0x3b52('0x7'));var querystring=require(_0x3b52('0xe'));var Papa=require(_0x3b52('0xf'));var Redis=require(_0x3b52('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b52('0x11'));var as=require(_0x3b52('0x12'));var hardwareService=require(_0x3b52('0x13'));var logger=require(_0x3b52('0x14'))(_0x3b52('0x15'));var utils=require(_0x3b52('0x16'));var config=require(_0x3b52('0x17'));var licenseUtil=require(_0x3b52('0x18'));var db=require(_0x3b52('0x19'))['db'];var extensions=require(_0x3b52('0x1a'));function respondWithStatusCode(_0x577025,_0x3b2157){_0x3b2157=_0x3b2157||0xcc;return function(_0x50560e){if(_0x50560e){return _0x577025['sendStatus'](_0x3b2157);}return _0x577025[_0x3b52('0x1b')](_0x3b2157)['end']();};}function respondWithResult(_0x21fc6f,_0x3cbcaa){_0x3cbcaa=_0x3cbcaa||0xc8;return function(_0x48c5b6){if(_0x48c5b6){return _0x21fc6f[_0x3b52('0x1b')](_0x3cbcaa)[_0x3b52('0x1c')](_0x48c5b6);}};}function respondWithFilteredResult(_0x5e6112,_0x2de2b1){return function(_0x38b7d5){if(_0x38b7d5){var _0x294c80=typeof _0x2de2b1[_0x3b52('0x1d')]===_0x3b52('0x1e')&&typeof _0x2de2b1[_0x3b52('0x1f')]===_0x3b52('0x1e');var _0x475f12=_0x38b7d5[_0x3b52('0x20')];var _0x44ff79=_0x294c80?0x0:_0x2de2b1[_0x3b52('0x1d')];var _0x268bd5=_0x294c80?_0x38b7d5[_0x3b52('0x20')]:_0x2de2b1['offset']+_0x2de2b1[_0x3b52('0x1f')];var _0x14ee38;if(_0x268bd5>=_0x475f12){_0x268bd5=_0x475f12;_0x14ee38=0xc8;}else{_0x14ee38=0xce;}_0x5e6112['status'](_0x14ee38);return _0x5e6112[_0x3b52('0x21')]('Content-Range',_0x44ff79+'-'+_0x268bd5+'/'+_0x475f12)[_0x3b52('0x1c')](_0x38b7d5);}return null;};}function patchUpdates(_0xa55c6c){return function(_0x2586da){try{jsonpatch[_0x3b52('0x22')](_0x2586da,_0xa55c6c,!![]);}catch(_0x33d023){return BPromise[_0x3b52('0x23')](_0x33d023);}return _0x2586da[_0x3b52('0x24')]();};}function saveUpdates(_0x5ef202,_0x2e9ac9){return function(_0x21c609){if(_0x21c609){return _0x21c609[_0x3b52('0x25')](_0x5ef202)[_0x3b52('0x26')](function(_0x377f6d){return _0x377f6d;});}return null;};}function removeEntity(_0x3ab73c,_0x4b4ff7){return function(_0x380111){if(_0x380111){return _0x380111[_0x3b52('0x27')]()[_0x3b52('0x26')](function(){var _0x1e1f75=_0x380111[_0x3b52('0x28')]({'plain':!![]});var _0x4f39f5=_0x3b52('0x29');return db[_0x3b52('0x2a')]['destroy']({'where':{'type':_0x4f39f5,'resourceId':_0x1e1f75['id']}})['then'](function(){return _0x380111;});})[_0x3b52('0x26')](function(){_0x3ab73c[_0x3b52('0x1b')](0xcc)[_0x3b52('0x2b')]();});}};}function handleEntityNotFound(_0x289654,_0x485305){return function(_0x17d113){if(!_0x17d113){_0x289654[_0x3b52('0x2c')](0x194);}return _0x17d113;};}function handleError(_0x3ebbb9,_0x1c970a){_0x1c970a=_0x1c970a||0x1f4;return function(_0x215326){logger['error'](_0x215326['stack']);if(_0x215326['name']){delete _0x215326[_0x3b52('0x2d')];}_0x3ebbb9['status'](_0x1c970a)[_0x3b52('0x2e')](_0x215326);};}exports[_0x3b52('0x2f')]=function(_0x1dd381,_0x2e4c96){var _0x34c490={},_0x4e462a={},_0x57446c={'count':0x0,'rows':[]};var _0x311846=_[_0x3b52('0x30')](db[_0x3b52('0x31')]['rawAttributes'],function(_0x210f7c){return{'name':_0x210f7c[_0x3b52('0x32')],'type':_0x210f7c[_0x3b52('0x33')]['key']};});_0x4e462a[_0x3b52('0x34')]=_[_0x3b52('0x30')](_0x311846,'name');_0x4e462a['query']=_['keys'](_0x1dd381[_0x3b52('0x35')]);_0x4e462a[_0x3b52('0x36')]=_[_0x3b52('0x37')](_0x4e462a[_0x3b52('0x34')],_0x4e462a[_0x3b52('0x35')]);_0x34c490[_0x3b52('0x38')]=_['intersection'](_0x4e462a[_0x3b52('0x34')],qs['fields'](_0x1dd381[_0x3b52('0x35')]['fields']));_0x34c490[_0x3b52('0x38')]=_0x34c490['attributes'][_0x3b52('0x39')]?_0x34c490[_0x3b52('0x38')]:_0x4e462a[_0x3b52('0x34')];if(!_0x1dd381[_0x3b52('0x35')][_0x3b52('0x3a')]('nolimit')){_0x34c490[_0x3b52('0x1f')]=qs['limit'](_0x1dd381['query'][_0x3b52('0x1f')]);_0x34c490[_0x3b52('0x1d')]=qs[_0x3b52('0x1d')](_0x1dd381[_0x3b52('0x35')][_0x3b52('0x1d')]);}_0x34c490['order']=qs[_0x3b52('0x3b')](_0x1dd381['query']['sort']);_0x34c490[_0x3b52('0x3c')]=qs['filters'](_[_0x3b52('0x3d')](_0x1dd381[_0x3b52('0x35')],_0x4e462a['filters']),_0x311846);if(_0x1dd381['query'][_0x3b52('0x3e')]){_0x34c490['where']=_[_0x3b52('0x3f')](_0x34c490['where'],{'$or':_['map'](_0x311846,function(_0x12f758){if(_0x12f758['type']!=='VIRTUAL'){var _0x41fc65={};_0x41fc65[_0x12f758['name']]={'$like':'%'+_0x1dd381['query'][_0x3b52('0x3e')]+'%'};return _0x41fc65;}})});}_0x34c490=_[_0x3b52('0x3f')]({},_0x34c490,_0x1dd381[_0x3b52('0x40')]);var _0x41fd92={'where':_0x34c490[_0x3b52('0x3c')]};return db[_0x3b52('0x31')][_0x3b52('0x20')](_0x41fd92)[_0x3b52('0x26')](function(_0x4db7f2){_0x57446c[_0x3b52('0x20')]=_0x4db7f2;if(_0x1dd381[_0x3b52('0x35')][_0x3b52('0x41')]){_0x34c490[_0x3b52('0x42')]=[{'all':!![]}];}return db['Interval'][_0x3b52('0x43')](_0x34c490);})[_0x3b52('0x26')](function(_0x26d604){_0x57446c[_0x3b52('0x44')]=_0x26d604;return _0x57446c;})[_0x3b52('0x26')](respondWithFilteredResult(_0x2e4c96,_0x34c490))[_0x3b52('0x45')](handleError(_0x2e4c96,null));};exports[_0x3b52('0x46')]=function(_0x34eda3,_0x3cdc7e){var _0x1ae8ac={'raw':!![],'where':{'id':_0x34eda3['params']['id']}},_0x3c4250={};_0x3c4250[_0x3b52('0x34')]=_['keys'](db['Interval'][_0x3b52('0x47')]);_0x3c4250[_0x3b52('0x35')]=_['keys'](_0x34eda3[_0x3b52('0x35')]);_0x3c4250[_0x3b52('0x36')]=_[_0x3b52('0x37')](_0x3c4250[_0x3b52('0x34')],_0x3c4250[_0x3b52('0x35')]);_0x1ae8ac[_0x3b52('0x38')]=_[_0x3b52('0x37')](_0x3c4250['model'],qs[_0x3b52('0x48')](_0x34eda3[_0x3b52('0x35')]['fields']));_0x1ae8ac[_0x3b52('0x38')]=_0x1ae8ac['attributes'][_0x3b52('0x39')]?_0x1ae8ac[_0x3b52('0x38')]:_0x3c4250[_0x3b52('0x34')];if(_0x34eda3[_0x3b52('0x35')]['includeAll']){_0x1ae8ac[_0x3b52('0x42')]=[{'all':!![]}];}_0x1ae8ac=_[_0x3b52('0x3f')]({},_0x1ae8ac,_0x34eda3[_0x3b52('0x40')]);return db['Interval']['find'](_0x1ae8ac)[_0x3b52('0x26')](handleEntityNotFound(_0x3cdc7e,null))['then'](respondWithResult(_0x3cdc7e,null))['catch'](handleError(_0x3cdc7e,null));};exports[_0x3b52('0x49')]=function(_0x5a0893,_0x500d4b){return db['Interval'][_0x3b52('0x49')](_0x5a0893['body'],{})[_0x3b52('0x26')](function(_0x10068c){var _0x5729a9=_0x5a0893[_0x3b52('0x4a')][_0x3b52('0x28')]({'plain':!![]});if(!_0x5729a9)throw new Error(_0x3b52('0x4b'));if(_0x5729a9['role']==='user'){var _0x49fc7d=_0x10068c[_0x3b52('0x28')]({'plain':!![]});var _0x2cbd10=_0x3b52('0x29');return db[_0x3b52('0x4c')][_0x3b52('0x4d')]({'where':{'name':_0x2cbd10,'userProfileId':_0x5729a9[_0x3b52('0x4e')]},'raw':!![]})[_0x3b52('0x26')](function(_0x5541c5){if(_0x5541c5&&_0x5541c5['autoAssociation']===0x0){return db['UserProfileResource'][_0x3b52('0x49')]({'name':_0x49fc7d[_0x3b52('0x2d')],'resourceId':_0x49fc7d['id'],'type':_0x5541c5[_0x3b52('0x2d')],'sectionId':_0x5541c5['id']},{})[_0x3b52('0x26')](function(){return _0x10068c;});}else{return _0x10068c;}})[_0x3b52('0x45')](function(_0x533446){logger[_0x3b52('0x4f')](_0x3b52('0x50'),_0x533446);throw _0x533446;});}return _0x10068c;})[_0x3b52('0x26')](respondWithResult(_0x500d4b,0xc9))[_0x3b52('0x45')](handleError(_0x500d4b,null));};exports[_0x3b52('0x25')]=function(_0x4c78d5,_0x99aed2){if(_0x4c78d5['body']['id']){delete _0x4c78d5[_0x3b52('0x51')]['id'];}return db[_0x3b52('0x31')][_0x3b52('0x4d')]({'where':{'id':_0x4c78d5[_0x3b52('0x52')]['id']}})['then'](handleEntityNotFound(_0x99aed2,null))['then'](saveUpdates(_0x4c78d5[_0x3b52('0x51')],null))[_0x3b52('0x26')](respondWithResult(_0x99aed2,null))[_0x3b52('0x45')](handleError(_0x99aed2,null));};exports['destroy']=function(_0x9ed0c8,_0x54b864){return db[_0x3b52('0x31')][_0x3b52('0x4d')]({'where':{'id':_0x9ed0c8[_0x3b52('0x52')]['id']}})[_0x3b52('0x26')](handleEntityNotFound(_0x54b864,null))[_0x3b52('0x26')](removeEntity(_0x54b864,null))[_0x3b52('0x45')](handleError(_0x54b864,null));};exports[_0x3b52('0x53')]=function(_0x3ae307,_0x5a5585,_0x1c7d70){if(_0x3ae307[_0x3b52('0x51')]['id']){delete _0x3ae307[_0x3b52('0x51')]['id'];}return db[_0x3b52('0x31')][_0x3b52('0x4d')]({'where':{'id':_0x3ae307[_0x3b52('0x52')]['id']}})[_0x3b52('0x26')](handleEntityNotFound(_0x5a5585,null))[_0x3b52('0x26')](function(_0x10158a){if(_0x10158a){_0x3ae307[_0x3b52('0x51')]['IntervalId']=_0x10158a['id'];return db[_0x3b52('0x31')][_0x3b52('0x49')](_0x3ae307[_0x3b52('0x51')]);}})[_0x3b52('0x26')](respondWithResult(_0x5a5585,null))['catch'](handleError(_0x5a5585,null));};exports[_0x3b52('0x54')]=function(_0x931028,_0x205a81,_0x34139e){var _0x10390a={};var _0xe737ea={};var _0x42eee5;var _0x2463ac;return db[_0x3b52('0x31')][_0x3b52('0x55')]({'where':{'id':_0x931028['params']['id']}})[_0x3b52('0x26')](handleEntityNotFound(_0x205a81,null))[_0x3b52('0x26')](function(_0x100eb7){if(_0x100eb7){_0x42eee5=_0x100eb7;_0xe737ea['model']=_[_0x3b52('0x56')](db[_0x3b52('0x31')]['rawAttributes']);_0xe737ea['query']=_[_0x3b52('0x56')](_0x931028[_0x3b52('0x35')]);_0xe737ea[_0x3b52('0x36')]=_[_0x3b52('0x37')](_0xe737ea[_0x3b52('0x34')],_0xe737ea[_0x3b52('0x35')]);_0x10390a[_0x3b52('0x38')]=_[_0x3b52('0x37')](_0xe737ea['model'],qs[_0x3b52('0x48')](_0x931028[_0x3b52('0x35')][_0x3b52('0x48')]));_0x10390a[_0x3b52('0x38')]=_0x10390a[_0x3b52('0x38')]['length']?_0x10390a[_0x3b52('0x38')]:_0xe737ea[_0x3b52('0x34')];_0x10390a['order']=qs[_0x3b52('0x3b')](_0x931028[_0x3b52('0x35')][_0x3b52('0x3b')]);_0x10390a[_0x3b52('0x3c')]=qs[_0x3b52('0x36')](_[_0x3b52('0x3d')](_0x931028[_0x3b52('0x35')],_0xe737ea[_0x3b52('0x36')]));if(_0x931028[_0x3b52('0x35')]['filter']){_0x10390a[_0x3b52('0x3c')]=_['merge'](_0x10390a['where'],{'$or':_['map'](_0x10390a[_0x3b52('0x38')],function(_0x16f53e){var _0x585368={};_0x585368[_0x16f53e]={'$like':'%'+_0x931028[_0x3b52('0x35')]['filter']+'%'};return _0x585368;})});}_0x10390a=_[_0x3b52('0x3f')]({},_0x10390a,_0x931028['options']);return _0x42eee5['getIntervals'](_0x10390a);}})[_0x3b52('0x26')](function(_0x42f970){if(_0x42f970){_0x2463ac=_0x42f970[_0x3b52('0x39')];if(!_0x931028[_0x3b52('0x35')][_0x3b52('0x3a')]('nolimit')){_0x10390a[_0x3b52('0x1f')]=qs[_0x3b52('0x1f')](_0x931028[_0x3b52('0x35')][_0x3b52('0x1f')]);_0x10390a['offset']=qs[_0x3b52('0x1d')](_0x931028[_0x3b52('0x35')]['offset']);}return _0x42eee5[_0x3b52('0x54')](_0x10390a);}})['then'](function(_0x3d68fc){if(_0x3d68fc){return _0x3d68fc?{'count':_0x2463ac,'rows':_0x3d68fc}:null;}})[_0x3b52('0x26')](respondWithResult(_0x205a81,null))[_0x3b52('0x45')](handleError(_0x205a81,null));};exports[_0x3b52('0x57')]=function(_0x1396b3,_0x21f98a,_0x462e5e){return db['Interval'][_0x3b52('0x55')]({'where':{'id':_0x1396b3[_0x3b52('0x52')]['id']}})[_0x3b52('0x26')](handleEntityNotFound(_0x21f98a,null))['then'](function(_0x1c6a8e){if(_0x1c6a8e){return db[_0x3b52('0x58')][_0x3b52('0x59')](function(_0x36b09f){return db[_0x3b52('0x31')]['destroy']({'where':{'IntervalId':_0x1396b3['params']['id']},'transaction':_0x36b09f})[_0x3b52('0x26')](function(_0x38d00f){var _0xce00d5=_[_0x3b52('0x30')](_0x1396b3[_0x3b52('0x51')],function(_0x40dc2c){delete _0x40dc2c['id'];_0x40dc2c[_0x3b52('0x5a')]=_0x1396b3[_0x3b52('0x52')]['id'];return _0x40dc2c;});return db[_0x3b52('0x31')][_0x3b52('0x5b')](_0xce00d5,{'transaction':_0x36b09f});});})[_0x3b52('0x26')](function(){return db[_0x3b52('0x31')][_0x3b52('0x43')]({'where':{'IntervalId':_0x1396b3[_0x3b52('0x52')]['id']}});});}})[_0x3b52('0x26')](respondWithResult(_0x21f98a,null))[_0x3b52('0x45')](handleError(_0x21f98a,null));}; \ No newline at end of file +var _0x6b73=['UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','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','addInterval','IntervalId','getIntervals','findOne','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6b73,0xf0));var _0x36b7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b73[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x36b7('0x0'));var rimraf=require(_0x36b7('0x1'));var zipdir=require(_0x36b7('0x2'));var jsonpatch=require(_0x36b7('0x3'));var rp=require(_0x36b7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36b7('0x5'));var util=require(_0x36b7('0x6'));var path=require('path');var sox=require(_0x36b7('0x7'));var csv=require(_0x36b7('0x8'));var ejs=require(_0x36b7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36b7('0xa'));var squel=require(_0x36b7('0xb'));var crypto=require('crypto');var jsforce=require(_0x36b7('0xc'));var deskjs=require(_0x36b7('0xd'));var toCsv=require(_0x36b7('0x8'));var querystring=require(_0x36b7('0xe'));var Papa=require(_0x36b7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36b7('0x10'));var hardwareService=require(_0x36b7('0x11'));var logger=require(_0x36b7('0x12'))(_0x36b7('0x13'));var utils=require(_0x36b7('0x14'));var config=require(_0x36b7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x36b7('0x16'))['db'];var extensions=require(_0x36b7('0x17'));function respondWithStatusCode(_0x5a0a1d,_0x2ff17a){_0x2ff17a=_0x2ff17a||0xcc;return function(_0x4a4321){if(_0x4a4321){return _0x5a0a1d[_0x36b7('0x18')](_0x2ff17a);}return _0x5a0a1d[_0x36b7('0x19')](_0x2ff17a)[_0x36b7('0x1a')]();};}function respondWithResult(_0x29edc9,_0x21718f){_0x21718f=_0x21718f||0xc8;return function(_0x50976e){if(_0x50976e){return _0x29edc9[_0x36b7('0x19')](_0x21718f)[_0x36b7('0x1b')](_0x50976e);}};}function respondWithFilteredResult(_0x4e8033,_0x4b4191){return function(_0x15f925){if(_0x15f925){var _0x713eea=typeof _0x4b4191[_0x36b7('0x1c')]===_0x36b7('0x1d')&&typeof _0x4b4191[_0x36b7('0x1e')]==='undefined';var _0x419703=_0x15f925['count'];var _0x3f9122=_0x713eea?0x0:_0x4b4191['offset'];var _0xeba4bb=_0x713eea?_0x15f925[_0x36b7('0x1f')]:_0x4b4191[_0x36b7('0x1c')]+_0x4b4191[_0x36b7('0x1e')];var _0x50c83a;if(_0xeba4bb>=_0x419703){_0xeba4bb=_0x419703;_0x50c83a=0xc8;}else{_0x50c83a=0xce;}_0x4e8033[_0x36b7('0x19')](_0x50c83a);return _0x4e8033[_0x36b7('0x20')](_0x36b7('0x21'),_0x3f9122+'-'+_0xeba4bb+'/'+_0x419703)[_0x36b7('0x1b')](_0x15f925);}return null;};}function patchUpdates(_0x30bebb){return function(_0x2e57fb){try{jsonpatch[_0x36b7('0x22')](_0x2e57fb,_0x30bebb,!![]);}catch(_0x2703b4){return BPromise[_0x36b7('0x23')](_0x2703b4);}return _0x2e57fb[_0x36b7('0x24')]();};}function saveUpdates(_0x24a9da,_0xc28f4c){return function(_0x604f7e){if(_0x604f7e){return _0x604f7e[_0x36b7('0x25')](_0x24a9da)[_0x36b7('0x26')](function(_0x56d767){return _0x56d767;});}return null;};}function removeEntity(_0x2be36f,_0x16d199){return function(_0x3e8190){if(_0x3e8190){return _0x3e8190[_0x36b7('0x27')]()['then'](function(){var _0x2ddecd=_0x3e8190[_0x36b7('0x28')]({'plain':!![]});var _0xeaeec4=_0x36b7('0x29');return db[_0x36b7('0x2a')][_0x36b7('0x27')]({'where':{'type':_0xeaeec4,'resourceId':_0x2ddecd['id']}})['then'](function(){return _0x3e8190;});})[_0x36b7('0x26')](function(){_0x2be36f[_0x36b7('0x19')](0xcc)[_0x36b7('0x1a')]();});}};}function handleEntityNotFound(_0xf8f584,_0x57f905){return function(_0x1248fa){if(!_0x1248fa){_0xf8f584[_0x36b7('0x18')](0x194);}return _0x1248fa;};}function handleError(_0xc04393,_0x43d591){_0x43d591=_0x43d591||0x1f4;return function(_0x15f738){logger[_0x36b7('0x2b')](_0x15f738[_0x36b7('0x2c')]);if(_0x15f738[_0x36b7('0x2d')]){delete _0x15f738[_0x36b7('0x2d')];}_0xc04393[_0x36b7('0x19')](_0x43d591)[_0x36b7('0x2e')](_0x15f738);};}exports[_0x36b7('0x2f')]=function(_0x341667,_0x56ec79){var _0x2503c8={},_0x2e6e23={},_0x222d24={'count':0x0,'rows':[]};var _0x1c8ec2=_[_0x36b7('0x30')](db[_0x36b7('0x31')][_0x36b7('0x32')],function(_0x2c1e8e){return{'name':_0x2c1e8e[_0x36b7('0x33')],'type':_0x2c1e8e[_0x36b7('0x34')]['key']};});_0x2e6e23['model']=_[_0x36b7('0x30')](_0x1c8ec2,'name');_0x2e6e23[_0x36b7('0x35')]=_[_0x36b7('0x36')](_0x341667[_0x36b7('0x35')]);_0x2e6e23['filters']=_['intersection'](_0x2e6e23['model'],_0x2e6e23[_0x36b7('0x35')]);_0x2503c8['attributes']=_['intersection'](_0x2e6e23[_0x36b7('0x37')],qs[_0x36b7('0x38')](_0x341667[_0x36b7('0x35')][_0x36b7('0x38')]));_0x2503c8[_0x36b7('0x39')]=_0x2503c8[_0x36b7('0x39')][_0x36b7('0x3a')]?_0x2503c8['attributes']:_0x2e6e23[_0x36b7('0x37')];if(!_0x341667['query'][_0x36b7('0x3b')](_0x36b7('0x3c'))){_0x2503c8[_0x36b7('0x1e')]=qs[_0x36b7('0x1e')](_0x341667[_0x36b7('0x35')][_0x36b7('0x1e')]);_0x2503c8[_0x36b7('0x1c')]=qs['offset'](_0x341667['query'][_0x36b7('0x1c')]);}_0x2503c8[_0x36b7('0x3d')]=qs['sort'](_0x341667[_0x36b7('0x35')][_0x36b7('0x3e')]);_0x2503c8[_0x36b7('0x3f')]=qs[_0x36b7('0x40')](_[_0x36b7('0x41')](_0x341667[_0x36b7('0x35')],_0x2e6e23['filters']),_0x1c8ec2);if(_0x341667[_0x36b7('0x35')][_0x36b7('0x42')]){_0x2503c8['where']=_[_0x36b7('0x43')](_0x2503c8[_0x36b7('0x3f')],{'$or':_[_0x36b7('0x30')](_0x1c8ec2,function(_0xe1cd1b){if(_0xe1cd1b[_0x36b7('0x34')]!==_0x36b7('0x44')){var _0x5d7c4a={};_0x5d7c4a[_0xe1cd1b[_0x36b7('0x2d')]]={'$like':'%'+_0x341667[_0x36b7('0x35')]['filter']+'%'};return _0x5d7c4a;}})});}_0x2503c8=_[_0x36b7('0x43')]({},_0x2503c8,_0x341667[_0x36b7('0x45')]);var _0x3f3a05={'where':_0x2503c8['where']};return db['Interval'][_0x36b7('0x1f')](_0x3f3a05)[_0x36b7('0x26')](function(_0x5df75a){_0x222d24[_0x36b7('0x1f')]=_0x5df75a;if(_0x341667[_0x36b7('0x35')][_0x36b7('0x46')]){_0x2503c8[_0x36b7('0x47')]=[{'all':!![]}];}return db[_0x36b7('0x31')][_0x36b7('0x48')](_0x2503c8);})[_0x36b7('0x26')](function(_0x4350c7){_0x222d24[_0x36b7('0x49')]=_0x4350c7;return _0x222d24;})[_0x36b7('0x26')](respondWithFilteredResult(_0x56ec79,_0x2503c8))[_0x36b7('0x4a')](handleError(_0x56ec79,null));};exports[_0x36b7('0x4b')]=function(_0x5d0907,_0x29f8bd){var _0x59df58={'raw':!![],'where':{'id':_0x5d0907[_0x36b7('0x4c')]['id']}},_0x300504={};_0x300504['model']=_[_0x36b7('0x36')](db[_0x36b7('0x31')][_0x36b7('0x32')]);_0x300504[_0x36b7('0x35')]=_[_0x36b7('0x36')](_0x5d0907[_0x36b7('0x35')]);_0x300504[_0x36b7('0x40')]=_[_0x36b7('0x4d')](_0x300504[_0x36b7('0x37')],_0x300504[_0x36b7('0x35')]);_0x59df58[_0x36b7('0x39')]=_[_0x36b7('0x4d')](_0x300504[_0x36b7('0x37')],qs['fields'](_0x5d0907[_0x36b7('0x35')][_0x36b7('0x38')]));_0x59df58[_0x36b7('0x39')]=_0x59df58['attributes'][_0x36b7('0x3a')]?_0x59df58[_0x36b7('0x39')]:_0x300504[_0x36b7('0x37')];if(_0x5d0907[_0x36b7('0x35')][_0x36b7('0x46')]){_0x59df58[_0x36b7('0x47')]=[{'all':!![]}];}_0x59df58=_['merge']({},_0x59df58,_0x5d0907[_0x36b7('0x45')]);return db[_0x36b7('0x31')][_0x36b7('0x4e')](_0x59df58)[_0x36b7('0x26')](handleEntityNotFound(_0x29f8bd,null))[_0x36b7('0x26')](respondWithResult(_0x29f8bd,null))[_0x36b7('0x4a')](handleError(_0x29f8bd,null));};exports[_0x36b7('0x4f')]=function(_0x34247d,_0x37d07d){return db['Interval'][_0x36b7('0x4f')](_0x34247d[_0x36b7('0x50')],{})[_0x36b7('0x26')](function(_0xf34bfd){var _0xc902f8=_0x34247d[_0x36b7('0x51')][_0x36b7('0x28')]({'plain':!![]});if(!_0xc902f8)throw new Error(_0x36b7('0x52'));if(_0xc902f8[_0x36b7('0x53')]==='user'){var _0x2b0827=_0xf34bfd[_0x36b7('0x28')]({'plain':!![]});var _0x4b35a7=_0x36b7('0x29');return db[_0x36b7('0x54')]['find']({'where':{'name':_0x4b35a7,'userProfileId':_0xc902f8[_0x36b7('0x55')]},'raw':!![]})[_0x36b7('0x26')](function(_0x268c09){if(_0x268c09&&_0x268c09[_0x36b7('0x56')]===0x0){return db[_0x36b7('0x2a')][_0x36b7('0x4f')]({'name':_0x2b0827[_0x36b7('0x2d')],'resourceId':_0x2b0827['id'],'type':_0x268c09[_0x36b7('0x2d')],'sectionId':_0x268c09['id']},{})[_0x36b7('0x26')](function(){return _0xf34bfd;});}else{return _0xf34bfd;}})['catch'](function(_0x51152c){logger['error'](_0x36b7('0x57'),_0x51152c);throw _0x51152c;});}return _0xf34bfd;})[_0x36b7('0x26')](respondWithResult(_0x37d07d,0xc9))[_0x36b7('0x4a')](handleError(_0x37d07d,null));};exports[_0x36b7('0x25')]=function(_0x3763ef,_0x485284){if(_0x3763ef[_0x36b7('0x50')]['id']){delete _0x3763ef[_0x36b7('0x50')]['id'];}return db['Interval'][_0x36b7('0x4e')]({'where':{'id':_0x3763ef[_0x36b7('0x4c')]['id']}})[_0x36b7('0x26')](handleEntityNotFound(_0x485284,null))[_0x36b7('0x26')](saveUpdates(_0x3763ef[_0x36b7('0x50')],null))[_0x36b7('0x26')](respondWithResult(_0x485284,null))[_0x36b7('0x4a')](handleError(_0x485284,null));};exports[_0x36b7('0x27')]=function(_0x4dfba5,_0x5ecb6f){return db[_0x36b7('0x31')][_0x36b7('0x4e')]({'where':{'id':_0x4dfba5[_0x36b7('0x4c')]['id']}})[_0x36b7('0x26')](handleEntityNotFound(_0x5ecb6f,null))[_0x36b7('0x26')](removeEntity(_0x5ecb6f,null))[_0x36b7('0x4a')](handleError(_0x5ecb6f,null));};exports[_0x36b7('0x58')]=function(_0x23256f,_0x4ac166,_0x30de0e){if(_0x23256f[_0x36b7('0x50')]['id']){delete _0x23256f[_0x36b7('0x50')]['id'];}return db['Interval']['find']({'where':{'id':_0x23256f['params']['id']}})['then'](handleEntityNotFound(_0x4ac166,null))['then'](function(_0x3a673a){if(_0x3a673a){_0x23256f['body'][_0x36b7('0x59')]=_0x3a673a['id'];return db[_0x36b7('0x31')][_0x36b7('0x4f')](_0x23256f[_0x36b7('0x50')]);}})[_0x36b7('0x26')](respondWithResult(_0x4ac166,null))[_0x36b7('0x4a')](handleError(_0x4ac166,null));};exports[_0x36b7('0x5a')]=function(_0x5e446f,_0x4bfa8f,_0xce278b){var _0x11461e={};var _0x3ae2c9={};var _0x41aa69;var _0x1990b9;return db[_0x36b7('0x31')][_0x36b7('0x5b')]({'where':{'id':_0x5e446f[_0x36b7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4bfa8f,null))[_0x36b7('0x26')](function(_0x4ab37e){if(_0x4ab37e){_0x41aa69=_0x4ab37e;_0x3ae2c9[_0x36b7('0x37')]=_[_0x36b7('0x36')](db[_0x36b7('0x31')][_0x36b7('0x32')]);_0x3ae2c9[_0x36b7('0x35')]=_[_0x36b7('0x36')](_0x5e446f[_0x36b7('0x35')]);_0x3ae2c9[_0x36b7('0x40')]=_[_0x36b7('0x4d')](_0x3ae2c9[_0x36b7('0x37')],_0x3ae2c9[_0x36b7('0x35')]);_0x11461e['attributes']=_[_0x36b7('0x4d')](_0x3ae2c9[_0x36b7('0x37')],qs[_0x36b7('0x38')](_0x5e446f['query'][_0x36b7('0x38')]));_0x11461e['attributes']=_0x11461e[_0x36b7('0x39')]['length']?_0x11461e[_0x36b7('0x39')]:_0x3ae2c9[_0x36b7('0x37')];_0x11461e['order']=qs['sort'](_0x5e446f[_0x36b7('0x35')][_0x36b7('0x3e')]);_0x11461e[_0x36b7('0x3f')]=qs[_0x36b7('0x40')](_['pick'](_0x5e446f[_0x36b7('0x35')],_0x3ae2c9['filters']));if(_0x5e446f[_0x36b7('0x35')][_0x36b7('0x42')]){_0x11461e[_0x36b7('0x3f')]=_[_0x36b7('0x43')](_0x11461e[_0x36b7('0x3f')],{'$or':_[_0x36b7('0x30')](_0x11461e[_0x36b7('0x39')],function(_0x4206ce){var _0x4fb900={};_0x4fb900[_0x4206ce]={'$like':'%'+_0x5e446f[_0x36b7('0x35')][_0x36b7('0x42')]+'%'};return _0x4fb900;})});}_0x11461e=_[_0x36b7('0x43')]({},_0x11461e,_0x5e446f[_0x36b7('0x45')]);return _0x41aa69[_0x36b7('0x5a')](_0x11461e);}})['then'](function(_0x2537b1){if(_0x2537b1){_0x1990b9=_0x2537b1[_0x36b7('0x3a')];if(!_0x5e446f[_0x36b7('0x35')]['hasOwnProperty'](_0x36b7('0x3c'))){_0x11461e['limit']=qs['limit'](_0x5e446f['query'][_0x36b7('0x1e')]);_0x11461e['offset']=qs[_0x36b7('0x1c')](_0x5e446f[_0x36b7('0x35')][_0x36b7('0x1c')]);}return _0x41aa69[_0x36b7('0x5a')](_0x11461e);}})[_0x36b7('0x26')](function(_0xf43983){if(_0xf43983){return _0xf43983?{'count':_0x1990b9,'rows':_0xf43983}:null;}})[_0x36b7('0x26')](respondWithResult(_0x4bfa8f,null))[_0x36b7('0x4a')](handleError(_0x4bfa8f,null));};exports[_0x36b7('0x5c')]=function(_0x5d0f75,_0x4d5254,_0x572f93){return db[_0x36b7('0x31')][_0x36b7('0x5b')]({'where':{'id':_0x5d0f75[_0x36b7('0x4c')]['id']}})[_0x36b7('0x26')](handleEntityNotFound(_0x4d5254,null))[_0x36b7('0x26')](function(_0x523186){if(_0x523186){return db['sequelize']['transaction'](function(_0x2da4dc){return db[_0x36b7('0x31')][_0x36b7('0x27')]({'where':{'IntervalId':_0x5d0f75['params']['id']},'transaction':_0x2da4dc})[_0x36b7('0x26')](function(_0x37ffb5){var _0x3bbba9=_['map'](_0x5d0f75[_0x36b7('0x50')],function(_0x4b0b4b){delete _0x4b0b4b['id'];_0x4b0b4b[_0x36b7('0x59')]=_0x5d0f75[_0x36b7('0x4c')]['id'];return _0x4b0b4b;});return db[_0x36b7('0x31')][_0x36b7('0x5d')](_0x3bbba9,{'transaction':_0x2da4dc});});})[_0x36b7('0x26')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5d0f75['params']['id']}});});}})[_0x36b7('0x26')](respondWithResult(_0x4d5254,null))[_0x36b7('0x4a')](handleError(_0x4d5254,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ef6f857..47fb7b2 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 _0x1199=['moment','bluebird','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x1199,0x168));var _0x9119=function(_0x486398,_0x370d53){_0x486398=_0x486398-0x0;var _0x2d4bc5=_0x1199[_0x486398];return _0x2d4bc5;};'use strict';var _=require(_0x9119('0x0'));var util=require(_0x9119('0x1'));var logger=require(_0x9119('0x2'))(_0x9119('0x3'));var moment=require(_0x9119('0x4'));var BPromise=require(_0x9119('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9119('0x6'));var rimraf=require(_0x9119('0x7'));var config=require(_0x9119('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x9119('0x9'));module[_0x9119('0xa')]=function(_0x3e16df,_0x485e4a){return _0x3e16df[_0x9119('0xb')]('Interval',attributes,{'tableName':_0x9119('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c1dda,_0x266b6e){extensions[_0x9119('0xd')](_0x3e16df,_0x4c1dda);},'afterBulkCreate':function(_0x15e3fd,_0x45c668,_0x380458){_0x380458();extensions['rewrite'](_0x3e16df,_0x15e3fd[0x0]);},'afterUpdate':function(_0xf65bf,_0x395e59){extensions[_0x9119('0xd')](_0x3e16df,_0xf65bf);},'afterDestroy':function(_0x339186,_0x2ce0a6){extensions[_0x9119('0xd')](_0x3e16df,_0x339186);}}});}; \ No newline at end of file +var _0x76c3=['rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals'];(function(_0x4ed07e,_0x55d3fa){var _0xfef20e=function(_0x4749a8){while(--_0x4749a8){_0x4ed07e['push'](_0x4ed07e['shift']());}};_0xfef20e(++_0x55d3fa);}(_0x76c3,0x127));var _0x376c=function(_0x12e58d,_0x142910){_0x12e58d=_0x12e58d-0x0;var _0x3905e8=_0x76c3[_0x12e58d];return _0x3905e8;};'use strict';var _=require('lodash');var util=require(_0x376c('0x0'));var logger=require(_0x376c('0x1'))(_0x376c('0x2'));var moment=require(_0x376c('0x3'));var BPromise=require(_0x376c('0x4'));var rp=require(_0x376c('0x5'));var fs=require('fs');var path=require(_0x376c('0x6'));var rimraf=require(_0x376c('0x7'));var config=require(_0x376c('0x8'));var attributes=require(_0x376c('0x9'));var extensions=require(_0x376c('0xa'));module['exports']=function(_0x134f17,_0x49241e){return _0x134f17[_0x376c('0xb')]('Interval',attributes,{'tableName':_0x376c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x32ca77,_0x40a827){extensions[_0x376c('0xd')](_0x134f17,_0x32ca77);},'afterBulkCreate':function(_0x64b522,_0x34e15b,_0x7c847d){_0x7c847d();extensions[_0x376c('0xd')](_0x134f17,_0x64b522[0x0]);},'afterUpdate':function(_0x34b8e2,_0xc4a63a){extensions[_0x376c('0xd')](_0x134f17,_0x34b8e2);},'afterDestroy':function(_0x149699,_0xbc5a63){extensions['rewrite'](_0x134f17,_0x149699);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 484da8c..f8b74c7 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 dc6cc88..63ededf 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0xd7ddef,_0x52c361){var _0x33323c=function(_0x3d96a4){while(--_0x3d96a4){_0xd7ddef['push'](_0xd7ddef['shift']());}};_0x33323c(++_0x52c361);}(_0xadb5,0xad));var _0x5adb=function(_0x31355d,_0x3eae21){_0x31355d=_0x31355d-0x0;var _0x23284a=_0xadb5[_0x31355d];return _0x23284a;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 0524d6b..fdad8cf 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 _0x6b72=['customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','request','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields'];(function(_0x32c97a,_0x29b6fc){var _0x5de34d=function(_0x97daf7){while(--_0x97daf7){_0x32c97a['push'](_0x32c97a['shift']());}};_0x5de34d(++_0x29b6fc);}(_0x6b72,0x1bc));var _0x26b7=function(_0x5b655b,_0x38fe25){_0x5b655b=_0x5b655b-0x0;var _0x5dc92d=_0x6b72[_0x5b655b];return _0x5dc92d;};'use strict';var BPromise=require(_0x26b7('0x0'));var https=require(_0x26b7('0x1'));var logger=require(_0x26b7('0x2'))(_0x26b7('0x3'));var USERNAME=_0x26b7('0x4');var PASSWORD=_0x26b7('0x5');function openIssue(_0x132f41,_0x213a1f){var _0xd98867={'fields':{'project':{'key':_0x132f41[_0x26b7('0x6')]||_0x26b7('0x7')},'summary':(_0x132f41[_0x26b7('0x8')]||_0x26b7('0x9'))+_0x26b7('0xa')+_0x132f41['ip'],'description':_0x132f41[_0x26b7('0xb')]||JSON[_0x26b7('0xc')](_0x132f41),'issuetype':{'name':_0x132f41[_0x26b7('0xd')]||_0x26b7('0xe')}}};_0xd98867[_0x26b7('0xf')][_0x26b7('0x10')]=_0x132f41[_0x26b7('0x11')];_0xd98867['fields'][_0x26b7('0x12')]=_0x132f41['oldToken'];_0xd98867['fields'][_0x26b7('0x13')]=_0x132f41[_0x26b7('0x14')];_0xd98867[_0x26b7('0xf')]['customfield_11503']=_0x132f41['name'];_0xd98867['fields'][_0x26b7('0x15')]=_0x132f41[_0x26b7('0x16')];_0xd98867[_0x26b7('0xf')]['customfield_10102']=_0x132f41['ip'];var _0x1373c3={'host':_0x26b7('0x17'),'port':0x1bb,'path':_0x26b7('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x26b7('0x19'),'Authorization':_0x26b7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x26b7('0x1b'))}};var _0xf74d02=JSON[_0x26b7('0xc')](_0xd98867);var _0x54024d=https[_0x26b7('0x1c')](_0x1373c3,function(_0x439bff){_0x439bff['setEncoding'](_0x26b7('0x1d'));var _0x295645='';_0x439bff['on'](_0x26b7('0x1e'),function(_0x89b135){_0x295645+=_0x89b135;});_0x439bff['on'](_0x26b7('0x1f'),function(){if(_0x213a1f){return _0x213a1f[_0x26b7('0x20')](_0x439bff[_0x26b7('0x21')])[_0x26b7('0x22')](JSON[_0x26b7('0x23')](_0x295645));}});});_0x54024d['on'](_0x26b7('0x24'),function(_0x17ba51){if(_0x213a1f){return _0x213a1f[_0x26b7('0x20')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x26b7('0x25')}]});}});_0x54024d[_0x26b7('0x26')](_0xf74d02);_0x54024d[_0x26b7('0x1f')]();}exports[_0x26b7('0x27')]=openIssue;exports['send']=function(_0x39f2a1,_0x256eaa){_0x39f2a1[_0x26b7('0x28')]['ip']=_0x39f2a1[_0x26b7('0x29')][_0x26b7('0x2a')]||_0x39f2a1[_0x26b7('0x2b')][_0x26b7('0x2c')]||_0x39f2a1['socket'][_0x26b7('0x2c')]||_0x39f2a1[_0x26b7('0x2b')][_0x26b7('0x2d')][_0x26b7('0x2c')];return openIssue(_0x39f2a1['body'],_0x256eaa);}; \ No newline at end of file +var _0x556e=['customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','base64','request','utf8','end','status','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields'];(function(_0x211872,_0x27244c){var _0x2c9872=function(_0x4ad5e6){while(--_0x4ad5e6){_0x211872['push'](_0x211872['shift']());}};_0x2c9872(++_0x27244c);}(_0x556e,0x72));var _0xe556=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x556e[_0x29e3b6];return _0x55d4b0;};'use strict';var BPromise=require(_0xe556('0x0'));var https=require(_0xe556('0x1'));var logger=require(_0xe556('0x2'))(_0xe556('0x3'));var USERNAME=_0xe556('0x4');var PASSWORD=_0xe556('0x5');function openIssue(_0xfebba8,_0x11fa13){var _0x22d070={'fields':{'project':{'key':_0xfebba8[_0xe556('0x6')]||_0xe556('0x7')},'summary':(_0xfebba8['summary']||_0xe556('0x8'))+_0xe556('0x9')+_0xfebba8['ip'],'description':_0xfebba8[_0xe556('0xa')]||JSON[_0xe556('0xb')](_0xfebba8),'issuetype':{'name':_0xfebba8[_0xe556('0xc')]||_0xe556('0xd')}}};_0x22d070[_0xe556('0xe')][_0xe556('0xf')]=_0xfebba8[_0xe556('0x10')];_0x22d070[_0xe556('0xe')][_0xe556('0x11')]=_0xfebba8[_0xe556('0x12')];_0x22d070[_0xe556('0xe')]['customfield_11502']=_0xfebba8[_0xe556('0x13')];_0x22d070['fields'][_0xe556('0x14')]=_0xfebba8[_0xe556('0x15')];_0x22d070[_0xe556('0xe')][_0xe556('0x16')]=_0xfebba8[_0xe556('0x17')];_0x22d070['fields'][_0xe556('0x18')]=_0xfebba8['ip'];var _0x3fbf32={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xe556('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xe556('0x1a'))}};var _0x7a84a9=JSON['stringify'](_0x22d070);var _0x439c2b=https[_0xe556('0x1b')](_0x3fbf32,function(_0x491dd7){_0x491dd7['setEncoding'](_0xe556('0x1c'));var _0x27c2ed='';_0x491dd7['on']('data',function(_0x2cc1be){_0x27c2ed+=_0x2cc1be;});_0x491dd7['on'](_0xe556('0x1d'),function(){if(_0x11fa13){return _0x11fa13[_0xe556('0x1e')](_0x491dd7['statusCode'])['json'](JSON['parse'](_0x27c2ed));}});});_0x439c2b['on'](_0xe556('0x1f'),function(_0x423ddc){if(_0x11fa13){return _0x11fa13[_0xe556('0x1e')](0x1f4)['json']({'errors':[{'message':_0xe556('0x20'),'type':_0xe556('0x21')}]});}});_0x439c2b[_0xe556('0x22')](_0x7a84a9);_0x439c2b[_0xe556('0x1d')]();}exports[_0xe556('0x23')]=openIssue;exports[_0xe556('0x24')]=function(_0x4e8086,_0x2e7907){_0x4e8086[_0xe556('0x25')]['ip']=_0x4e8086[_0xe556('0x26')][_0xe556('0x27')]||_0x4e8086[_0xe556('0x28')][_0xe556('0x29')]||_0x4e8086[_0xe556('0x2a')][_0xe556('0x29')]||_0x4e8086[_0xe556('0x28')]['socket'][_0xe556('0x29')];return openIssue(_0x4e8086[_0xe556('0x25')],_0x2e7907);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 410b8ea..3655fb3 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 _0xaa88=['/describe','isAuthenticated','describe','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xaa88,0x137));var _0x8aa8=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0xaa88[_0x4c70c4];return _0x437865;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')]('/',auth['isAuthenticated'](),controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')](_0x8aa8('0x13'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x13'),auth['isAuthenticated'](),controller[_0x8aa8('0x15')]);module[_0x8aa8('0x16')]=router; \ No newline at end of file +var _0x6f7a=['isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x58ff18,_0x321352){var _0x153c22=function(_0x2356c5){while(--_0x2356c5){_0x58ff18['push'](_0x58ff18['shift']());}};_0x153c22(++_0x321352);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x237514,_0x19aa02){_0x237514=_0x237514-0x0;var _0x3f5265=_0x6f7a[_0x237514];return _0x3f5265;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6f7('0x11')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);module[_0xa6f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8bdb793..2614d6f 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x265987,_0x3ef969){_0x265987=_0x265987-0x0;var _0x558965=_0x7a54[_0x265987];return _0x558965;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x3b89fc,_0x43c2bf){_0x3b89fc=_0x3b89fc-0x0;var _0x4de584=_0x7a54[_0x3b89fc];return _0x4de584;};'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 69b373d..41578d9 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 _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x687b,0x14a));var _0xb687=function(_0x3428b3,_0x4396cc){_0x3428b3=_0x3428b3-0x0;var _0x4474ad=_0x687b[_0x3428b3];return _0x4474ad;};'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'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['JscriptyAnswerReport'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file +var _0xe626=['keys','rawAttributes','intersection','length','options','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','type','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','rows','show'];(function(_0x2c7366,_0x582f5c){var _0x5d2e36=function(_0x3ee305){while(--_0x3ee305){_0x2c7366['push'](_0x2c7366['shift']());}};_0x5d2e36(++_0x582f5c);}(_0xe626,0x9d));var _0x6e62=function(_0x491e5d,_0x51f908){_0x491e5d=_0x491e5d-0x0;var _0x6c84c6=_0xe626[_0x491e5d];return _0x6c84c6;};'use strict';var emlformat=require(_0x6e62('0x0'));var rimraf=require(_0x6e62('0x1'));var zipdir=require(_0x6e62('0x2'));var jsonpatch=require(_0x6e62('0x3'));var rp=require('request-promise');var moment=require(_0x6e62('0x4'));var BPromise=require(_0x6e62('0x5'));var Mustache=require(_0x6e62('0x6'));var util=require(_0x6e62('0x7'));var path=require(_0x6e62('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e62('0x9'));var _=require(_0x6e62('0xa'));var squel=require('squel');var crypto=require(_0x6e62('0xb'));var jsforce=require(_0x6e62('0xc'));var deskjs=require(_0x6e62('0xd'));var toCsv=require(_0x6e62('0xe'));var querystring=require('querystring');var Papa=require(_0x6e62('0xf'));var Redis=require(_0x6e62('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6e62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e62('0x12'));var logger=require('../../config/logger')(_0x6e62('0x13'));var utils=require('../../config/utils');var config=require(_0x6e62('0x14'));var licenseUtil=require(_0x6e62('0x15'));var db=require(_0x6e62('0x16'))['db'];function respondWithStatusCode(_0x43e3d4,_0x3c3af1){_0x3c3af1=_0x3c3af1||0xcc;return function(_0x1c266b){if(_0x1c266b){return _0x43e3d4[_0x6e62('0x17')](_0x3c3af1);}return _0x43e3d4['status'](_0x3c3af1)['end']();};}function respondWithResult(_0x44b131,_0x3b980d){_0x3b980d=_0x3b980d||0xc8;return function(_0x5328fe){if(_0x5328fe){return _0x44b131[_0x6e62('0x18')](_0x3b980d)[_0x6e62('0x19')](_0x5328fe);}};}function respondWithFilteredResult(_0x19a80d,_0x3f4e35){return function(_0x58d84e){if(_0x58d84e){var _0x416158=typeof _0x3f4e35[_0x6e62('0x1a')]===_0x6e62('0x1b')&&typeof _0x3f4e35[_0x6e62('0x1c')]===_0x6e62('0x1b');var _0x31b304=_0x58d84e[_0x6e62('0x1d')];var _0x45d7ee=_0x416158?0x0:_0x3f4e35[_0x6e62('0x1a')];var _0x15bce5=_0x416158?_0x58d84e['count']:_0x3f4e35[_0x6e62('0x1a')]+_0x3f4e35[_0x6e62('0x1c')];var _0x55ce3b;if(_0x15bce5>=_0x31b304){_0x15bce5=_0x31b304;_0x55ce3b=0xc8;}else{_0x55ce3b=0xce;}_0x19a80d[_0x6e62('0x18')](_0x55ce3b);return _0x19a80d['set'](_0x6e62('0x1e'),_0x45d7ee+'-'+_0x15bce5+'/'+_0x31b304)[_0x6e62('0x19')](_0x58d84e);}return null;};}function patchUpdates(_0x2e162e){return function(_0x270405){try{jsonpatch[_0x6e62('0x1f')](_0x270405,_0x2e162e,!![]);}catch(_0x77c5f9){return BPromise[_0x6e62('0x20')](_0x77c5f9);}return _0x270405[_0x6e62('0x21')]();};}function saveUpdates(_0x3f9067,_0x421d13){return function(_0x1954dc){if(_0x1954dc){return _0x1954dc['update'](_0x3f9067)[_0x6e62('0x22')](function(_0x52d5e7){return _0x52d5e7;});}return null;};}function removeEntity(_0x183469,_0x3dad96){return function(_0x345af8){if(_0x345af8){return _0x345af8[_0x6e62('0x23')]()[_0x6e62('0x22')](function(){_0x183469[_0x6e62('0x18')](0xcc)[_0x6e62('0x24')]();});}};}function handleEntityNotFound(_0x3a1683,_0x2e4fe1){return function(_0x448691){if(!_0x448691){_0x3a1683['sendStatus'](0x194);}return _0x448691;};}function handleError(_0x33f81c,_0x555793){_0x555793=_0x555793||0x1f4;return function(_0x2f9c68){logger[_0x6e62('0x25')](_0x2f9c68[_0x6e62('0x26')]);if(_0x2f9c68[_0x6e62('0x27')]){delete _0x2f9c68[_0x6e62('0x27')];}_0x33f81c[_0x6e62('0x18')](_0x555793)['send'](_0x2f9c68);};}exports[_0x6e62('0x28')]=function(_0x26c991,_0x14cd51){var _0x50ba00={},_0x58afab={},_0x191df5={'count':0x0,'rows':[]};var _0x50813d=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x17f634){return{'name':_0x17f634['fieldName'],'type':_0x17f634[_0x6e62('0x29')]['key']};});_0x58afab[_0x6e62('0x2a')]=_[_0x6e62('0x2b')](_0x50813d,_0x6e62('0x27'));_0x58afab['query']=_['keys'](_0x26c991[_0x6e62('0x2c')]);_0x58afab[_0x6e62('0x2d')]=_['intersection'](_0x58afab['model'],_0x58afab['query']);_0x50ba00[_0x6e62('0x2e')]=_['intersection'](_0x58afab[_0x6e62('0x2a')],qs[_0x6e62('0x2f')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x2f')]));_0x50ba00[_0x6e62('0x2e')]=_0x50ba00['attributes']['length']?_0x50ba00[_0x6e62('0x2e')]:_0x58afab[_0x6e62('0x2a')];if(!_0x26c991[_0x6e62('0x2c')][_0x6e62('0x30')](_0x6e62('0x31'))){_0x50ba00[_0x6e62('0x1c')]=qs[_0x6e62('0x1c')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x1c')]);_0x50ba00['offset']=qs[_0x6e62('0x1a')](_0x26c991[_0x6e62('0x2c')][_0x6e62('0x1a')]);}_0x50ba00['order']=qs[_0x6e62('0x32')](_0x26c991[_0x6e62('0x2c')]['sort']);_0x50ba00[_0x6e62('0x33')]=qs[_0x6e62('0x2d')](_[_0x6e62('0x34')](_0x26c991[_0x6e62('0x2c')],_0x58afab[_0x6e62('0x2d')]),_0x50813d);if(_0x26c991['query'][_0x6e62('0x35')]){_0x50ba00[_0x6e62('0x33')]=_[_0x6e62('0x36')](_0x50ba00[_0x6e62('0x33')],{'$or':_[_0x6e62('0x2b')](_0x50813d,function(_0x4900b0){if(_0x4900b0[_0x6e62('0x29')]!==_0x6e62('0x37')){var _0x234710={};_0x234710[_0x4900b0['name']]={'$like':'%'+_0x26c991[_0x6e62('0x2c')][_0x6e62('0x35')]+'%'};return _0x234710;}})});}_0x50ba00=_['merge']({},_0x50ba00,_0x26c991['options']);var _0x13728c={'where':_0x50ba00[_0x6e62('0x33')]};return db[_0x6e62('0x38')]['count'](_0x13728c)['then'](function(_0x1ef318){_0x191df5['count']=_0x1ef318;if(_0x26c991['query'][_0x6e62('0x39')]){_0x50ba00[_0x6e62('0x3a')]=[{'all':!![]}];}return db[_0x6e62('0x38')][_0x6e62('0x3b')](_0x50ba00);})[_0x6e62('0x22')](function(_0x58ac40){_0x191df5[_0x6e62('0x3c')]=_0x58ac40;return _0x191df5;})['then'](respondWithFilteredResult(_0x14cd51,_0x50ba00))['catch'](handleError(_0x14cd51,null));};exports[_0x6e62('0x3d')]=function(_0x469fa1,_0x940288){var _0x5352d3={'raw':!![],'where':{'id':_0x469fa1['params']['id']}},_0x1a7e7f={};_0x1a7e7f[_0x6e62('0x2a')]=_[_0x6e62('0x3e')](db[_0x6e62('0x38')][_0x6e62('0x3f')]);_0x1a7e7f[_0x6e62('0x2c')]=_[_0x6e62('0x3e')](_0x469fa1[_0x6e62('0x2c')]);_0x1a7e7f[_0x6e62('0x2d')]=_[_0x6e62('0x40')](_0x1a7e7f[_0x6e62('0x2a')],_0x1a7e7f['query']);_0x5352d3['attributes']=_['intersection'](_0x1a7e7f[_0x6e62('0x2a')],qs['fields'](_0x469fa1[_0x6e62('0x2c')][_0x6e62('0x2f')]));_0x5352d3['attributes']=_0x5352d3[_0x6e62('0x2e')][_0x6e62('0x41')]?_0x5352d3[_0x6e62('0x2e')]:_0x1a7e7f[_0x6e62('0x2a')];if(_0x469fa1[_0x6e62('0x2c')][_0x6e62('0x39')]){_0x5352d3[_0x6e62('0x3a')]=[{'all':!![]}];}_0x5352d3=_[_0x6e62('0x36')]({},_0x5352d3,_0x469fa1[_0x6e62('0x42')]);return db[_0x6e62('0x38')][_0x6e62('0x43')](_0x5352d3)[_0x6e62('0x22')](handleEntityNotFound(_0x940288,null))[_0x6e62('0x22')](respondWithResult(_0x940288,null))['catch'](handleError(_0x940288,null));};exports[_0x6e62('0x44')]=function(_0x158c75,_0x57c6d1){return db[_0x6e62('0x38')]['create'](_0x158c75[_0x6e62('0x45')],{})[_0x6e62('0x22')](respondWithResult(_0x57c6d1,0xc9))[_0x6e62('0x46')](handleError(_0x57c6d1,null));};exports['update']=function(_0x447fc2,_0x4745a3){if(_0x447fc2[_0x6e62('0x45')]['id']){delete _0x447fc2[_0x6e62('0x45')]['id'];}return db[_0x6e62('0x38')][_0x6e62('0x43')]({'where':{'id':_0x447fc2[_0x6e62('0x47')]['id']}})[_0x6e62('0x22')](handleEntityNotFound(_0x4745a3,null))[_0x6e62('0x22')](saveUpdates(_0x447fc2[_0x6e62('0x45')],null))[_0x6e62('0x22')](respondWithResult(_0x4745a3,null))['catch'](handleError(_0x4745a3,null));};exports['destroy']=function(_0x2d7732,_0xe6f92d){return db[_0x6e62('0x38')][_0x6e62('0x43')]({'where':{'id':_0x2d7732[_0x6e62('0x47')]['id']}})[_0x6e62('0x22')](handleEntityNotFound(_0xe6f92d,null))['then'](removeEntity(_0xe6f92d,null))[_0x6e62('0x46')](handleError(_0xe6f92d,null));};exports['describe']=function(_0x28bcb3,_0xead50c){return db[_0x6e62('0x38')][_0x6e62('0x48')]()[_0x6e62('0x22')](respondWithResult(_0xead50c,null))['catch'](handleError(_0xead50c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 72e6635..bf26985 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 _0xb1f4=['../../config/environment','./jscriptyAnswerReport.attributes','exports','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x59c5be,_0x16f949){var _0x4996aa=function(_0x3929ce){while(--_0x3929ce){_0x59c5be['push'](_0x59c5be['shift']());}};_0x4996aa(++_0x16f949);}(_0xb1f4,0x159));var _0x4b1f=function(_0x3e8e11,_0x6753dd){_0x3e8e11=_0x3e8e11-0x0;var _0x290f86=_0xb1f4[_0x3e8e11];return _0x290f86;};'use strict';var _=require(_0x4b1f('0x0'));var util=require(_0x4b1f('0x1'));var logger=require(_0x4b1f('0x2'))('api');var moment=require(_0x4b1f('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b1f('0x4'));var fs=require('fs');var path=require(_0x4b1f('0x5'));var rimraf=require(_0x4b1f('0x6'));var config=require(_0x4b1f('0x7'));var attributes=require(_0x4b1f('0x8'));module[_0x4b1f('0x9')]=function(_0xb193b0,_0xe356ea){return _0xb193b0['define']('JscriptyAnswerReport',attributes,{'tableName':_0x4b1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59f7=['request-promise','./jscriptyAnswerReport.attributes','define','report_jscripty_answers','lodash','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x59f7,0x15a));var _0x759f=function(_0x278bae,_0x209bad){_0x278bae=_0x278bae-0x0;var _0x18cea1=_0x59f7[_0x278bae];return _0x18cea1;};'use strict';var _=require(_0x759f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x759f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x759f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x759f('0x3'));module['exports']=function(_0x42a8e6,_0x5897ca){return _0x42a8e6[_0x759f('0x4')]('JscriptyAnswerReport',attributes,{'tableName':_0x759f('0x5'),'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 b5208bb..a67d5c5 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 _0x2c39=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xabf05f,_0x32993c){var _0x3161e5=function(_0x43e0ba){while(--_0x43e0ba){_0xabf05f['push'](_0xabf05f['shift']());}};_0x3161e5(++_0x32993c);}(_0x2c39,0x1b4));var _0x92c3=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x2c39[_0x45c0da];return _0x51efff;};'use strict';var _=require(_0x92c3('0x0'));var util=require(_0x92c3('0x1'));var moment=require('moment');var BPromise=require(_0x92c3('0x2'));var rs=require(_0x92c3('0x3'));var fs=require('fs');var Redis=require(_0x92c3('0x4'));var db=require(_0x92c3('0x5'))['db'];var utils=require(_0x92c3('0x6'));var logger=require(_0x92c3('0x7'))('rpc');var config=require(_0x92c3('0x8'));var jayson=require(_0x92c3('0x9'));var client=jayson[_0x92c3('0xa')][_0x92c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b13b,_0x3a5ea5,_0x54e698){return new BPromise(function(_0x31f269,_0x4712b3){return client[_0x92c3('0xc')](_0x25b13b,_0x54e698)[_0x92c3('0xd')](function(_0x5dd533){logger['info'](_0x92c3('0xe'),_0x3a5ea5,_0x92c3('0xf'));logger[_0x92c3('0x10')](_0x92c3('0x11'),_0x3a5ea5,_0x92c3('0xf'),JSON[_0x92c3('0x12')](_0x5dd533));if(_0x5dd533[_0x92c3('0x13')]){if(_0x5dd533[_0x92c3('0x13')]['code']===0x1f4){logger['error'](_0x92c3('0xe'),_0x3a5ea5,_0x5dd533[_0x92c3('0x13')][_0x92c3('0x14')]);return _0x4712b3(_0x5dd533['error'][_0x92c3('0x14')]);}logger[_0x92c3('0x13')](_0x92c3('0xe'),_0x3a5ea5,_0x5dd533[_0x92c3('0x13')][_0x92c3('0x14')]);return _0x31f269(_0x5dd533['error']['message']);}else{logger[_0x92c3('0x15')](_0x92c3('0xe'),_0x3a5ea5,_0x92c3('0xf'));_0x31f269(_0x5dd533[_0x92c3('0x16')][_0x92c3('0x14')]);}})[_0x92c3('0x17')](function(_0x1dc419){logger[_0x92c3('0x13')](_0x92c3('0xe'),_0x3a5ea5,_0x1dc419);_0x4712b3(_0x1dc419);});});} \ No newline at end of file +var _0x200c=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x200c,0x1c4));var _0xc200=function(_0x30b5af,_0x1520e3){_0x30b5af=_0x30b5af-0x0;var _0x406e6a=_0x200c[_0x30b5af];return _0x406e6a;};'use strict';var _=require(_0xc200('0x0'));var util=require('util');var moment=require(_0xc200('0x1'));var BPromise=require(_0xc200('0x2'));var rs=require(_0xc200('0x3'));var fs=require('fs');var Redis=require(_0xc200('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc200('0x5'));var logger=require(_0xc200('0x6'))(_0xc200('0x7'));var config=require(_0xc200('0x8'));var jayson=require(_0xc200('0x9'));var client=jayson[_0xc200('0xa')][_0xc200('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x470b21,_0x423ae6,_0x4e94ad){return new BPromise(function(_0xf2e529,_0x5a7945){return client[_0xc200('0xc')](_0x470b21,_0x4e94ad)[_0xc200('0xd')](function(_0x262320){logger[_0xc200('0xe')](_0xc200('0xf'),_0x423ae6,'request\x20sent');logger['debug'](_0xc200('0x10'),_0x423ae6,_0xc200('0x11'),JSON['stringify'](_0x262320));if(_0x262320[_0xc200('0x12')]){if(_0x262320[_0xc200('0x12')]['code']===0x1f4){logger[_0xc200('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x423ae6,_0x262320[_0xc200('0x12')][_0xc200('0x13')]);return _0x5a7945(_0x262320[_0xc200('0x12')]['message']);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x423ae6,_0x262320[_0xc200('0x12')][_0xc200('0x13')]);return _0xf2e529(_0x262320[_0xc200('0x12')][_0xc200('0x13')]);}else{logger[_0xc200('0xe')](_0xc200('0xf'),_0x423ae6,_0xc200('0x11'));_0xf2e529(_0x262320[_0xc200('0x14')][_0xc200('0x13')]);}})[_0xc200('0x15')](function(_0x2361b7){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x423ae6,_0x2361b7);_0x5a7945(_0x2361b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9c7e743..a6273b4 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 _0x3bdf=['path','connect-timeout','express','Router','../../components/interaction/service','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','put','update','destroy','exports','util'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x3bdf,0xe0));var _0xf3bd=function(_0x224b3e,_0x2d6c81){_0x224b3e=_0x224b3e-0x0;var _0x2c5655=_0x3bdf[_0x224b3e];return _0x2c5655;};'use strict';var multer=require('multer');var util=require(_0xf3bd('0x0'));var path=require(_0xf3bd('0x1'));var timeout=require(_0xf3bd('0x2'));var express=require(_0xf3bd('0x3'));var router=express[_0xf3bd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf3bd('0x5'));var config=require('../../config/environment');var controller=require(_0xf3bd('0x6'));router[_0xf3bd('0x7')]('/',auth['isAuthenticated'](),controller[_0xf3bd('0x8')]);router[_0xf3bd('0x7')](_0xf3bd('0x9'),auth[_0xf3bd('0xa')](),controller[_0xf3bd('0xb')]);router['get'](_0xf3bd('0xc'),auth[_0xf3bd('0xa')](),controller[_0xf3bd('0xd')]);router['get'](_0xf3bd('0xe'),auth[_0xf3bd('0xa')](),controller[_0xf3bd('0xf')]);router[_0xf3bd('0x7')](_0xf3bd('0x10'),auth[_0xf3bd('0xa')](),timeout('30s'),controller[_0xf3bd('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf3bd('0x12')]);router[_0xf3bd('0x13')](_0xf3bd('0x14'),auth[_0xf3bd('0xa')](),controller['clone']);router[_0xf3bd('0x15')]('/:id',auth[_0xf3bd('0xa')](),controller[_0xf3bd('0x16')]);router['delete']('/:id',auth[_0xf3bd('0xa')](),controller[_0xf3bd('0x17')]);module[_0xf3bd('0x18')]=router; \ No newline at end of file +var _0x6457=['getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSessions'];(function(_0x336e9b,_0xe5c27a){var _0x336afb=function(_0x45991a){while(--_0x45991a){_0x336e9b['push'](_0x336e9b['shift']());}};_0x336afb(++_0xe5c27a);}(_0x6457,0xa7));var _0x7645=function(_0x226352,_0x5a0597){_0x226352=_0x226352-0x0;var _0x3feaf7=_0x6457[_0x226352];return _0x3feaf7;};'use strict';var multer=require(_0x7645('0x0'));var util=require(_0x7645('0x1'));var path=require(_0x7645('0x2'));var timeout=require(_0x7645('0x3'));var express=require('express');var router=express[_0x7645('0x4')]();var fs_extra=require(_0x7645('0x5'));var auth=require(_0x7645('0x6'));var interaction=require(_0x7645('0x7'));var config=require(_0x7645('0x8'));var controller=require('./jscriptyProject.controller');router[_0x7645('0x9')]('/',auth[_0x7645('0xa')](),controller[_0x7645('0xb')]);router['get'](_0x7645('0xc'),auth[_0x7645('0xa')](),controller[_0x7645('0xd')]);router[_0x7645('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x7645('0xe')]);router[_0x7645('0x9')]('/:id/answers',auth['isAuthenticated'](),controller[_0x7645('0xf')]);router[_0x7645('0x9')](_0x7645('0x10'),auth[_0x7645('0xa')](),timeout(_0x7645('0x11')),controller[_0x7645('0x12')]);router[_0x7645('0x13')]('/',auth['isAuthenticated'](),controller[_0x7645('0x14')]);router['post'](_0x7645('0x15'),auth[_0x7645('0xa')](),controller['clone']);router['put']('/:id',auth[_0x7645('0xa')](),controller[_0x7645('0x16')]);router[_0x7645('0x17')]('/:id',auth[_0x7645('0xa')](),controller[_0x7645('0x18')]);module[_0x7645('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 39f66fe..d5ee493 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 _0xcc7c=['util','exports','STRING','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','getDataValue','description','sequelize','lodash'];(function(_0x5acacb,_0x250ff0){var _0x5ee8eb=function(_0xd8dfea){while(--_0xd8dfea){_0x5acacb['push'](_0x5acacb['shift']());}};_0x5ee8eb(++_0x250ff0);}(_0xcc7c,0x7c));var _0xccc7=function(_0x32ffd3,_0x5538fa){_0x32ffd3=_0x32ffd3-0x0;var _0x5806ae=_0xcc7c[_0x32ffd3];return _0x5806ae;};'use strict';var Sequelize=require(_0xccc7('0x0'));var _=require(_0xccc7('0x1'));var util=require(_0xccc7('0x2'));module[_0xccc7('0x3')]={'name':{'type':Sequelize[_0xccc7('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xccc7('0x5')](_0xccc7('0x6')),'set':function(_0x3cff06){if(_[_0xccc7('0x7')](_0x3cff06)){this['setDataValue'](_0xccc7('0x8'),JSON[_0xccc7('0x9')](_0x3cff06));}else if(_[_0xccc7('0xa')](_0x3cff06)){this[_0xccc7('0xb')]('formData',_0x3cff06);}else{this[_0xccc7('0xb')](_0xccc7('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xccc7('0xc')]('name')||'',this[_0xccc7('0xc')](_0xccc7('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe928=['isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','util','exports','STRING','TEXT','long'];(function(_0x464c32,_0x241609){var _0x1db3f3=function(_0x39806d){while(--_0x39806d){_0x464c32['push'](_0x464c32['shift']());}};_0x1db3f3(++_0x241609);}(_0xe928,0x167));var _0x8e92=function(_0x51c6cf,_0x2aa7a6){_0x51c6cf=_0x51c6cf-0x0;var _0x97166a=_0xe928[_0x51c6cf];return _0x97166a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x8e92('0x0'));module[_0x8e92('0x1')]={'name':{'type':Sequelize[_0x8e92('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x8e92('0x2')]},'formData':{'type':Sequelize[_0x8e92('0x3')](_0x8e92('0x4')),'set':function(_0x376e9a){if(_[_0x8e92('0x5')](_0x376e9a)){this[_0x8e92('0x6')]('formData',JSON['stringify'](_0x376e9a));}else if(_['isString'](_0x376e9a)){this[_0x8e92('0x6')]('formData',_0x376e9a);}else{this['setDataValue'](_0x8e92('0x7'),util[_0x8e92('0x8')](_0x8e92('0x9'),this[_0x8e92('0xa')](_0x8e92('0xb'))||'',this[_0x8e92('0xa')](_0x8e92('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8e92('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index fa8d98b..4f5734b 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 _0x80e4=['/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','role','Projects','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getSessions','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','order','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','now'];(function(_0x330726,_0x2e2c1d){var _0x197123=function(_0x553c8b){while(--_0x553c8b){_0x330726['push'](_0x330726['shift']());}};_0x197123(++_0x2e2c1d);}(_0x80e4,0x103));var _0x480e=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x80e4[_0x172133];return _0x2460e5;};'use strict';var emlformat=require(_0x480e('0x0'));var rimraf=require(_0x480e('0x1'));var zipdir=require(_0x480e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x480e('0x3'));var moment=require(_0x480e('0x4'));var BPromise=require(_0x480e('0x5'));var Mustache=require(_0x480e('0x6'));var util=require(_0x480e('0x7'));var path=require('path');var sox=require(_0x480e('0x8'));var csv=require(_0x480e('0x9'));var ejs=require(_0x480e('0xa'));var fs=require('fs');var fs_extra=require(_0x480e('0xb'));var _=require(_0x480e('0xc'));var squel=require(_0x480e('0xd'));var crypto=require(_0x480e('0xe'));var jsforce=require(_0x480e('0xf'));var deskjs=require(_0x480e('0x10'));var toCsv=require(_0x480e('0x9'));var querystring=require(_0x480e('0x11'));var Papa=require(_0x480e('0x12'));var Redis=require('ioredis');var authService=require(_0x480e('0x13'));var qs=require(_0x480e('0x14'));var as=require(_0x480e('0x15'));var hardwareService=require(_0x480e('0x16'));var logger=require(_0x480e('0x17'))(_0x480e('0x18'));var utils=require('../../config/utils');var config=require(_0x480e('0x19'));var licenseUtil=require(_0x480e('0x1a'));var db=require(_0x480e('0x1b'))['db'];function respondWithStatusCode(_0xbd69cf,_0x5ced0f){_0x5ced0f=_0x5ced0f||0xcc;return function(_0x388310){if(_0x388310){return _0xbd69cf[_0x480e('0x1c')](_0x5ced0f);}return _0xbd69cf[_0x480e('0x1d')](_0x5ced0f)[_0x480e('0x1e')]();};}function respondWithResult(_0x5af7c5,_0x6ddb08){_0x6ddb08=_0x6ddb08||0xc8;return function(_0x567bc6){if(_0x567bc6){return _0x5af7c5[_0x480e('0x1d')](_0x6ddb08)[_0x480e('0x1f')](_0x567bc6);}};}function respondWithFilteredResult(_0x45322c,_0x450def){return function(_0x5b91a2){if(_0x5b91a2){var _0x2d61d1=typeof _0x450def[_0x480e('0x20')]===_0x480e('0x21')&&typeof _0x450def[_0x480e('0x22')]===_0x480e('0x21');var _0x233b55=_0x5b91a2[_0x480e('0x23')];var _0x58275b=_0x2d61d1?0x0:_0x450def[_0x480e('0x20')];var _0x54f36b=_0x2d61d1?_0x5b91a2[_0x480e('0x23')]:_0x450def[_0x480e('0x20')]+_0x450def[_0x480e('0x22')];var _0xf1e54d;if(_0x54f36b>=_0x233b55){_0x54f36b=_0x233b55;_0xf1e54d=0xc8;}else{_0xf1e54d=0xce;}_0x45322c[_0x480e('0x1d')](_0xf1e54d);return _0x45322c[_0x480e('0x24')](_0x480e('0x25'),_0x58275b+'-'+_0x54f36b+'/'+_0x233b55)[_0x480e('0x1f')](_0x5b91a2);}return null;};}function patchUpdates(_0x3f1011){return function(_0xd7f410){try{jsonpatch['apply'](_0xd7f410,_0x3f1011,!![]);}catch(_0x2b9182){return BPromise[_0x480e('0x26')](_0x2b9182);}return _0xd7f410[_0x480e('0x27')]();};}function saveUpdates(_0x10f83a,_0x5699d5){return function(_0x286374){if(_0x286374){return _0x286374[_0x480e('0x28')](_0x10f83a)[_0x480e('0x29')](function(_0x1db609){return _0x1db609;});}return null;};}function removeEntity(_0x144672,_0xfcd7a7){return function(_0x942fed){if(_0x942fed){return _0x942fed[_0x480e('0x2a')]()['then'](function(){var _0x264386=_0x942fed[_0x480e('0x2b')]({'plain':!![]});var _0x5bf29c='Projects';return db[_0x480e('0x2c')][_0x480e('0x2a')]({'where':{'type':_0x5bf29c,'resourceId':_0x264386['id']}})['then'](function(){return _0x942fed;});})[_0x480e('0x29')](function(){_0x144672['status'](0xcc)[_0x480e('0x1e')]();});}};}function handleEntityNotFound(_0x4ec5c8,_0x1cdd4d){return function(_0x55ad03){if(!_0x55ad03){_0x4ec5c8[_0x480e('0x1c')](0x194);}return _0x55ad03;};}function handleError(_0x3bc0b0,_0x4c80e9){_0x4c80e9=_0x4c80e9||0x1f4;return function(_0x6f0315){logger['error'](_0x6f0315[_0x480e('0x2d')]);if(_0x6f0315[_0x480e('0x2e')]){delete _0x6f0315[_0x480e('0x2e')];}_0x3bc0b0[_0x480e('0x1d')](_0x4c80e9)[_0x480e('0x2f')](_0x6f0315);};}exports[_0x480e('0x30')]=function(_0x26e69c,_0x47a442){var _0x50730b={},_0x2f2142={},_0xc242aa={'count':0x0,'rows':[]};var _0x6b7ee8=_['map'](db[_0x480e('0x31')][_0x480e('0x32')],function(_0x6e949e){return{'name':_0x6e949e[_0x480e('0x33')],'type':_0x6e949e[_0x480e('0x34')][_0x480e('0x35')]};});_0x2f2142[_0x480e('0x36')]=_[_0x480e('0x37')](_0x6b7ee8,_0x480e('0x2e'));_0x2f2142[_0x480e('0x38')]=_[_0x480e('0x39')](_0x26e69c[_0x480e('0x38')]);_0x2f2142[_0x480e('0x3a')]=_[_0x480e('0x3b')](_0x2f2142['model'],_0x2f2142[_0x480e('0x38')]);_0x50730b[_0x480e('0x3c')]=_['intersection'](_0x2f2142[_0x480e('0x36')],qs[_0x480e('0x3d')](_0x26e69c[_0x480e('0x38')]['fields']));_0x50730b[_0x480e('0x3c')]=_0x50730b[_0x480e('0x3c')][_0x480e('0x3e')]?_0x50730b[_0x480e('0x3c')]:_0x2f2142[_0x480e('0x36')];if(!_0x26e69c[_0x480e('0x38')]['hasOwnProperty']('nolimit')){_0x50730b[_0x480e('0x22')]=qs[_0x480e('0x22')](_0x26e69c['query'][_0x480e('0x22')]);_0x50730b[_0x480e('0x20')]=qs[_0x480e('0x20')](_0x26e69c[_0x480e('0x38')][_0x480e('0x20')]);}_0x50730b['order']=qs[_0x480e('0x3f')](_0x26e69c['query'][_0x480e('0x3f')]);_0x50730b[_0x480e('0x40')]=qs[_0x480e('0x3a')](_[_0x480e('0x41')](_0x26e69c['query'],_0x2f2142['filters']),_0x6b7ee8);if(_0x26e69c[_0x480e('0x38')][_0x480e('0x42')]){_0x50730b[_0x480e('0x40')]=_[_0x480e('0x43')](_0x50730b[_0x480e('0x40')],{'$or':_[_0x480e('0x37')](_0x6b7ee8,function(_0x5d354b){if(_0x5d354b[_0x480e('0x34')]!==_0x480e('0x44')){var _0x504b05={};_0x504b05[_0x5d354b[_0x480e('0x2e')]]={'$like':'%'+_0x26e69c[_0x480e('0x38')][_0x480e('0x42')]+'%'};return _0x504b05;}})});}_0x50730b=_[_0x480e('0x43')]({},_0x50730b,_0x26e69c[_0x480e('0x45')]);var _0x1821ec={'where':_0x50730b[_0x480e('0x40')]};return db[_0x480e('0x31')][_0x480e('0x23')](_0x1821ec)[_0x480e('0x29')](function(_0x545cdf){_0xc242aa[_0x480e('0x23')]=_0x545cdf;if(_0x26e69c[_0x480e('0x38')][_0x480e('0x46')]){_0x50730b[_0x480e('0x47')]=[{'all':!![]}];}return db[_0x480e('0x31')][_0x480e('0x48')](_0x50730b);})[_0x480e('0x29')](function(_0x486d18){_0xc242aa[_0x480e('0x49')]=_0x486d18;return _0xc242aa;})[_0x480e('0x29')](respondWithFilteredResult(_0x47a442,_0x50730b))[_0x480e('0x4a')](handleError(_0x47a442,null));};exports['show']=function(_0x126222,_0x63fc6e){var _0x2ee124={'raw':![],'where':{'id':_0x126222[_0x480e('0x4b')]['id']}},_0x36fd6c={};_0x36fd6c[_0x480e('0x36')]=_['keys'](db[_0x480e('0x31')]['rawAttributes']);_0x36fd6c[_0x480e('0x38')]=_['keys'](_0x126222[_0x480e('0x38')]);_0x36fd6c['filters']=_[_0x480e('0x3b')](_0x36fd6c[_0x480e('0x36')],_0x36fd6c[_0x480e('0x38')]);_0x2ee124[_0x480e('0x3c')]=_[_0x480e('0x3b')](_0x36fd6c[_0x480e('0x36')],qs[_0x480e('0x3d')](_0x126222['query']['fields']));_0x2ee124[_0x480e('0x3c')]=_0x2ee124['attributes'][_0x480e('0x3e')]?_0x2ee124[_0x480e('0x3c')]:_0x36fd6c[_0x480e('0x36')];if(_0x126222[_0x480e('0x38')][_0x480e('0x46')]){_0x2ee124[_0x480e('0x47')]=[{'all':!![]}];}_0x2ee124=_[_0x480e('0x43')]({},_0x2ee124,_0x126222[_0x480e('0x45')]);return db[_0x480e('0x31')]['find'](_0x2ee124)['then'](handleEntityNotFound(_0x63fc6e,null))['then'](respondWithResult(_0x63fc6e,null))[_0x480e('0x4a')](handleError(_0x63fc6e,null));};exports[_0x480e('0x4c')]=function(_0x1f1411,_0x10e5ec){return db[_0x480e('0x31')]['create'](_0x1f1411[_0x480e('0x4d')],{})[_0x480e('0x29')](function(_0x15b02f){var _0x570f8b=_0x1f1411[_0x480e('0x4e')][_0x480e('0x2b')]({'plain':!![]});if(!_0x570f8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x570f8b[_0x480e('0x4f')]==='user'){var _0x42c304=_0x15b02f[_0x480e('0x2b')]({'plain':!![]});var _0x24e1b3=_0x480e('0x50');return db[_0x480e('0x51')][_0x480e('0x52')]({'where':{'name':_0x24e1b3,'userProfileId':_0x570f8b['userProfileId']},'raw':!![]})[_0x480e('0x29')](function(_0x143e73){if(_0x143e73&&_0x143e73[_0x480e('0x53')]===0x0){return db['UserProfileResource'][_0x480e('0x4c')]({'name':_0x42c304['name'],'resourceId':_0x42c304['id'],'type':_0x143e73[_0x480e('0x2e')],'sectionId':_0x143e73['id']},{})[_0x480e('0x29')](function(){return _0x15b02f;});}else{return _0x15b02f;}})[_0x480e('0x4a')](function(_0x5a2c75){logger[_0x480e('0x54')](_0x480e('0x55'),_0x5a2c75);throw _0x5a2c75;});}return _0x15b02f;})[_0x480e('0x29')](respondWithResult(_0x10e5ec,0xc9))['catch'](handleError(_0x10e5ec,null));};exports[_0x480e('0x56')]=function(_0x5ab3a7,_0x41f401){var _0x25269b={'where':{'id':_0x5ab3a7[_0x480e('0x4b')]['id']}},_0x13bf4f={};_0x13bf4f[_0x480e('0x36')]=_[_0x480e('0x39')](db['JscriptyProject']['rawAttributes']);_0x25269b['attributes']=_['intersection'](_0x13bf4f['model'],qs['fields'](_0x5ab3a7[_0x480e('0x38')]['fields']));_0x25269b[_0x480e('0x3c')]=_0x25269b[_0x480e('0x3c')][_0x480e('0x3e')]?_0x25269b[_0x480e('0x3c')]:_0x13bf4f[_0x480e('0x36')];if(_0x5ab3a7[_0x480e('0x38')]['includeAll']){_0x25269b[_0x480e('0x47')]=[{'all':!![]}];}_0x25269b=_['merge']({},_0x25269b,_0x5ab3a7[_0x480e('0x45')]);return db[_0x480e('0x31')][_0x480e('0x52')](_0x25269b)['then'](handleEntityNotFound(_0x41f401,null))[_0x480e('0x29')](function(_0x2106d7){if(_0x2106d7){var _0x1ea2c9=_0x2106d7[_0x480e('0x2b')]({'plain':!![]});_0x1ea2c9=qs[_0x480e('0x57')](_0x1ea2c9,['id',_0x480e('0x58'),_0x480e('0x59')]);_0x5ab3a7[_0x480e('0x4d')]=_['omit'](_0x5ab3a7[_0x480e('0x4d')],['id',_0x480e('0x58'),_0x480e('0x59')]);return db[_0x480e('0x31')]['create'](_[_0x480e('0x43')](_0x1ea2c9,_0x5ab3a7[_0x480e('0x4d')]),{'include':_0x5ab3a7[_0x480e('0x38')][_0x480e('0x46')]?[{'all':!![]}]:undefined})[_0x480e('0x29')](function(_0x119455){var _0x2068ce=_0x5ab3a7[_0x480e('0x4e')]['get']({'plain':!![]});if(!_0x2068ce)throw new Error(_0x480e('0x5a'));if(_0x2068ce[_0x480e('0x4f')]===_0x480e('0x4e')){var _0x45d0a3=_0x119455[_0x480e('0x2b')]({'plain':!![]});var _0xa343e7=_0x480e('0x50');return db[_0x480e('0x51')]['find']({'where':{'name':_0xa343e7,'userProfileId':_0x2068ce[_0x480e('0x5b')]},'raw':!![]})[_0x480e('0x29')](function(_0x1037ff){if(_0x1037ff&&_0x1037ff[_0x480e('0x53')]===0x0){return db[_0x480e('0x2c')][_0x480e('0x4c')]({'name':_0x45d0a3[_0x480e('0x2e')],'resourceId':_0x45d0a3['id'],'type':_0x1037ff[_0x480e('0x2e')],'sectionId':_0x1037ff['id']},{})[_0x480e('0x29')](function(){return _0x119455;});}else{return _0x119455;}})['catch'](function(_0x3d5e02){logger[_0x480e('0x54')](_0x480e('0x55'),_0x3d5e02);throw _0x3d5e02;});}return _0x119455;});}})[_0x480e('0x29')](respondWithResult(_0x41f401,0xc9))[_0x480e('0x4a')](handleError(_0x41f401,null));};exports[_0x480e('0x28')]=function(_0x2d73b1,_0x3fd150){if(_0x2d73b1[_0x480e('0x4d')]['id']){delete _0x2d73b1[_0x480e('0x4d')]['id'];}return db[_0x480e('0x31')][_0x480e('0x52')]({'where':{'id':_0x2d73b1[_0x480e('0x4b')]['id']}})[_0x480e('0x29')](handleEntityNotFound(_0x3fd150,null))[_0x480e('0x29')](saveUpdates(_0x2d73b1['body'],null))[_0x480e('0x29')](respondWithResult(_0x3fd150,null))['catch'](handleError(_0x3fd150,null));};exports[_0x480e('0x2a')]=function(_0x3246c2,_0x343da9){return db[_0x480e('0x31')][_0x480e('0x52')]({'where':{'id':_0x3246c2[_0x480e('0x4b')]['id']}})[_0x480e('0x29')](handleEntityNotFound(_0x343da9,null))[_0x480e('0x29')](removeEntity(_0x343da9,null))['catch'](handleError(_0x343da9,null));};exports[_0x480e('0x5c')]=function(_0x51d40e,_0xa2ccca,_0xdea190){var _0x5aa95b={'raw':!![],'where':{}};var _0x18e240={};var _0x3879d1={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x480e('0x5d')]({'where':{'id':_0x51d40e[_0x480e('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa2ccca,null))['then'](function(_0x25fec0){if(_0x25fec0){_0x18e240[_0x480e('0x36')]=_[_0x480e('0x39')](db[_0x480e('0x5e')]['rawAttributes']);_0x18e240[_0x480e('0x38')]=_[_0x480e('0x39')](_0x51d40e[_0x480e('0x38')]);_0x18e240[_0x480e('0x3a')]=_[_0x480e('0x3b')](_0x18e240['model'],_0x18e240['query']);_0x5aa95b[_0x480e('0x3c')]=_[_0x480e('0x3b')](_0x18e240[_0x480e('0x36')],qs[_0x480e('0x3d')](_0x51d40e[_0x480e('0x38')][_0x480e('0x3d')]));_0x5aa95b[_0x480e('0x3c')]=_0x5aa95b[_0x480e('0x3c')][_0x480e('0x3e')]?_0x5aa95b[_0x480e('0x3c')]:_0x18e240[_0x480e('0x36')];if(!_0x51d40e[_0x480e('0x38')][_0x480e('0x5f')](_0x480e('0x60'))){_0x5aa95b['limit']=qs[_0x480e('0x22')](_0x51d40e[_0x480e('0x38')][_0x480e('0x22')]);_0x5aa95b[_0x480e('0x20')]=qs['offset'](_0x51d40e['query'][_0x480e('0x20')]);}_0x5aa95b['order']=qs['sort'](_0x51d40e[_0x480e('0x38')]['sort']);_0x5aa95b[_0x480e('0x40')]=qs[_0x480e('0x3a')](_[_0x480e('0x41')](_0x51d40e[_0x480e('0x38')],_0x18e240['filters']));_0x5aa95b[_0x480e('0x40')][_0x480e('0x61')]=_0x25fec0['id'];if(_0x51d40e[_0x480e('0x38')][_0x480e('0x42')]){_0x5aa95b['where']=_['merge'](_0x5aa95b[_0x480e('0x40')],{'$or':_[_0x480e('0x37')](_0x5aa95b[_0x480e('0x3c')],function(_0x43fe6a){var _0x3fa541={};_0x3fa541[_0x43fe6a]={'$like':'%'+_0x51d40e['query'][_0x480e('0x42')]+'%'};return _0x3fa541;})});}_0x5aa95b=_['merge']({},_0x5aa95b,_0x51d40e[_0x480e('0x45')]);return db[_0x480e('0x5e')][_0x480e('0x23')]({'where':_0x5aa95b[_0x480e('0x40')]})[_0x480e('0x29')](function(_0x1e8f93){_0x3879d1[_0x480e('0x23')]=_0x1e8f93;if(_0x51d40e['query'][_0x480e('0x46')]){_0x5aa95b[_0x480e('0x47')]=[{'all':!![]}];}return db[_0x480e('0x5e')][_0x480e('0x48')](_0x5aa95b);})[_0x480e('0x29')](function(_0x5b48c9){_0x3879d1[_0x480e('0x49')]=_0x5b48c9;return _0x3879d1;});}})[_0x480e('0x29')](respondWithFilteredResult(_0xa2ccca,_0x5aa95b))[_0x480e('0x4a')](handleError(_0xa2ccca,null));};exports[_0x480e('0x62')]=function(_0x31416e,_0x24d204,_0x39e28e){var _0x282dd2={'raw':!![],'where':{}};var _0x268c67={};var _0x19b2cb={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x480e('0x5d')]({'where':{'id':_0x31416e[_0x480e('0x4b')]['id']}})[_0x480e('0x29')](handleEntityNotFound(_0x24d204,null))['then'](function(_0x31e259){if(_0x31e259){_0x268c67[_0x480e('0x36')]=_[_0x480e('0x39')](db[_0x480e('0x63')][_0x480e('0x32')]);_0x268c67[_0x480e('0x38')]=_['keys'](_0x31416e[_0x480e('0x38')]);_0x268c67['filters']=_[_0x480e('0x3b')](_0x268c67[_0x480e('0x36')],_0x268c67[_0x480e('0x38')]);_0x282dd2[_0x480e('0x3c')]=_[_0x480e('0x3b')](_0x268c67['model'],qs[_0x480e('0x3d')](_0x31416e[_0x480e('0x38')][_0x480e('0x3d')]));_0x282dd2[_0x480e('0x3c')]=_0x282dd2['attributes'][_0x480e('0x3e')]?_0x282dd2[_0x480e('0x3c')]:_0x268c67[_0x480e('0x36')];if(!_0x31416e['query'][_0x480e('0x5f')](_0x480e('0x60'))){_0x282dd2[_0x480e('0x22')]=qs[_0x480e('0x22')](_0x31416e[_0x480e('0x38')][_0x480e('0x22')]);_0x282dd2[_0x480e('0x20')]=qs['offset'](_0x31416e['query']['offset']);}_0x282dd2[_0x480e('0x64')]=qs['sort'](_0x31416e[_0x480e('0x38')][_0x480e('0x3f')]);_0x282dd2[_0x480e('0x40')]=qs[_0x480e('0x3a')](_['pick'](_0x31416e[_0x480e('0x38')],_0x268c67[_0x480e('0x3a')]));_0x282dd2[_0x480e('0x40')][_0x480e('0x61')]=_0x31e259['id'];if(_0x31416e[_0x480e('0x38')][_0x480e('0x42')]){_0x282dd2[_0x480e('0x40')]=_[_0x480e('0x43')](_0x282dd2[_0x480e('0x40')],{'$or':_[_0x480e('0x37')](_0x282dd2[_0x480e('0x3c')],function(_0xc4189b){var _0x33aa9d={};_0x33aa9d[_0xc4189b]={'$like':'%'+_0x31416e[_0x480e('0x38')][_0x480e('0x42')]+'%'};return _0x33aa9d;})});}_0x282dd2=_[_0x480e('0x43')]({},_0x282dd2,_0x31416e['options']);return db['JscriptyAnswerReport'][_0x480e('0x23')]({'where':_0x282dd2[_0x480e('0x40')]})[_0x480e('0x29')](function(_0x2c7d5d){_0x19b2cb['count']=_0x2c7d5d;if(_0x31416e[_0x480e('0x38')][_0x480e('0x46')]){_0x282dd2['include']=[{'all':!![]}];}return db[_0x480e('0x63')]['findAll'](_0x282dd2);})[_0x480e('0x29')](function(_0x130705){_0x19b2cb[_0x480e('0x49')]=_0x130705;return _0x19b2cb;});}})[_0x480e('0x29')](respondWithFilteredResult(_0x24d204,_0x282dd2))[_0x480e('0x4a')](handleError(_0x24d204,null));};function char(_0x48da4b){return _0x480e('0x65')===typeof _0x48da4b?String[_0x480e('0x66')][_0x480e('0x67')](null,arguments):_0x48da4b;}function needsEncapsulation(_0x34b143){return!!_0x34b143&&(_0x34b143[_0x480e('0x68')]()[_0x480e('0x69')](char(0xd))>=0x0||_0x34b143[_0x480e('0x68')]()[_0x480e('0x69')](char(0xa))>=0x0||_0x34b143[_0x480e('0x68')]()[_0x480e('0x69')](char(0x2c))>=0x0||_0x34b143[_0x480e('0x68')]()[_0x480e('0x69')](char(0x22))>=0x0);}function encapsulate(_0x5124a5){var _0x369b9f=char(0x22),_0x8dac35='\x5c'+char(0x22),_0x2425c0=_0x5124a5['toString']()[_0x480e('0x6a')](new RegExp(_0x369b9f,'g'),_0x8dac35);return _0x369b9f+_0x2425c0+_0x369b9f;}exports[_0x480e('0x6b')]=function(_0x1f008d,_0x2e05ab,_0x255fa7){var _0x4edeb7,_0xef8f65;var _0x49d152={'where':{'ProjectId':_0x1f008d[_0x480e('0x4b')]['id']}};if(_0x1f008d[_0x480e('0x38')][_0x480e('0x6c')]){_0x49d152[_0x480e('0x40')]['starttime']=JSON[_0x480e('0x6d')](_0x1f008d[_0x480e('0x38')]['startTime']);}return db['JscriptySessionReport']['findAll'](_0x49d152)[_0x480e('0x29')](handleEntityNotFound(_0x2e05ab,null))[_0x480e('0x29')](function(_0x5df120){if(_0x5df120){_0x4edeb7=_0x5df120;return db[_0x480e('0x6e')][_0x480e('0x48')]({'where':{'SessionId':{'$in':_[_0x480e('0x37')](_0x4edeb7,'id')},'ProjectId':_0x1f008d[_0x480e('0x4b')]['id']},'order':_0x480e('0x6f')});}})['then'](handleEntityNotFound(_0x2e05ab,null))[_0x480e('0x29')](function(_0x53c269){if(_0x53c269){_0xef8f65=_0x53c269;var _0x47f551={};for(var _0x318d12=0x0,_0x13a7ee=_0xef8f65['length'];_0x318d12<_0x13a7ee;_0x318d12++){if(!_0x47f551[_0x480e('0x5f')](_0xef8f65[_0x318d12][_0x480e('0x70')])){_0x47f551[_0xef8f65[_0x318d12]['questionId']]=needsEncapsulation(_0xef8f65[_0x318d12][_0x480e('0x71')])?encapsulate(_0xef8f65[_0x318d12][_0x480e('0x71')]):_0xef8f65[_0x318d12][_0x480e('0x71')];}}var _0x1ff154=[],_0x1f0803={};for(var _0x1057fb=0x0,_0x5ad0f2=_0x4edeb7[_0x480e('0x3e')];_0x1057fb<_0x5ad0f2;_0x1057fb++){_0x1f0803={'ProjectId':_0x1f008d[_0x480e('0x4b')]['id'],'SessionId':_0x4edeb7[_0x1057fb]['id'],'StartTime':moment(_0x4edeb7[_0x1057fb][_0x480e('0x72')])[_0x480e('0x73')](_0x480e('0x74'))};for(var _0x55d797=0x0,_0x51ce91=_0xef8f65[_0x480e('0x3e')];_0x55d797<_0x51ce91;_0x55d797++){if(_0xef8f65[_0x55d797][_0x480e('0x75')]==_0x4edeb7[_0x1057fb]['id']&&_0x47f551[_0x480e('0x5f')](_0xef8f65[_0x55d797]['questionId'])){_0x1f0803[_0x47f551[_0xef8f65[_0x55d797][_0x480e('0x70')]]]=_0xef8f65[_0x55d797]['answer'];}}for(var _0x57bf77 in _0x47f551){if(!_0x1f0803['hasOwnProperty'](_0x47f551[_0x57bf77])){_0x1f0803[_0x47f551[_0x57bf77]]=null;}}_0x1ff154['push'](_0x1f0803);}return _0x1ff154;}})['then'](function(_0x2eef95){if(!_['isEmpty'](_0x2eef95)){var _0x259f33=toCsv(_0x2eef95);var _0x897cf3=Date[_0x480e('0x76')]();fs['writeFileSync'](util[_0x480e('0x73')](_0x480e('0x77'),_0x1f008d['params']['id'],_0x897cf3),_0x259f33);_0x2e05ab[_0x480e('0x78')](_0x480e('0x79'),_0x480e('0x7a')+util[_0x480e('0x73')]('Jscripty_Project_%d_Summary_%s.csv',_0x1f008d[_0x480e('0x4b')]['id'],_0x897cf3));_0x2e05ab[_0x480e('0x78')](_0x480e('0x7b'),_0x480e('0x7c'));return _0x2e05ab[_0x480e('0x7d')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1f008d[_0x480e('0x4b')]['id'],_0x897cf3));}else{return _0x2e05ab['sendStatus'](0xcc);}})[_0x480e('0x4a')](handleError(_0x2e05ab,null));}; \ No newline at end of file +var _0x8533=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','status','Content-Range','json','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','map','JscriptyProject','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','includeAll','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','ProjectId','JscriptySessionReport','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','setHeader','Content-disposition','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x58a00f,_0x21962c){var _0x2f7f3d=function(_0x2cf0ee){while(--_0x2cf0ee){_0x58a00f['push'](_0x58a00f['shift']());}};_0x2f7f3d(++_0x21962c);}(_0x8533,0x141));var _0x3853=function(_0x2faa46,_0xd13092){_0x2faa46=_0x2faa46-0x0;var _0x16684e=_0x8533[_0x2faa46];return _0x16684e;};'use strict';var emlformat=require(_0x3853('0x0'));var rimraf=require(_0x3853('0x1'));var zipdir=require(_0x3853('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3853('0x3'));var moment=require(_0x3853('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3853('0x5'));var util=require('util');var path=require(_0x3853('0x6'));var sox=require('sox');var csv=require(_0x3853('0x7'));var ejs=require(_0x3853('0x8'));var fs=require('fs');var fs_extra=require(_0x3853('0x9'));var _=require(_0x3853('0xa'));var squel=require('squel');var crypto=require(_0x3853('0xb'));var jsforce=require(_0x3853('0xc'));var deskjs=require(_0x3853('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3853('0xe'));var Redis=require(_0x3853('0xf'));var authService=require(_0x3853('0x10'));var qs=require(_0x3853('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3853('0x12'));var logger=require(_0x3853('0x13'))(_0x3853('0x14'));var utils=require(_0x3853('0x15'));var config=require(_0x3853('0x16'));var licenseUtil=require(_0x3853('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ddbfe,_0x1927d8){_0x1927d8=_0x1927d8||0xcc;return function(_0x330363){if(_0x330363){return _0x1ddbfe[_0x3853('0x18')](_0x1927d8);}return _0x1ddbfe['status'](_0x1927d8)[_0x3853('0x19')]();};}function respondWithResult(_0x32ffe1,_0x96cfef){_0x96cfef=_0x96cfef||0xc8;return function(_0x97c5d9){if(_0x97c5d9){return _0x32ffe1['status'](_0x96cfef)['json'](_0x97c5d9);}};}function respondWithFilteredResult(_0x510e99,_0x130b7b){return function(_0x77518){if(_0x77518){var _0x378431=typeof _0x130b7b[_0x3853('0x1a')]===_0x3853('0x1b')&&typeof _0x130b7b['limit']===_0x3853('0x1b');var _0x4bf82a=_0x77518[_0x3853('0x1c')];var _0x42dbd1=_0x378431?0x0:_0x130b7b[_0x3853('0x1a')];var _0x1ffdc9=_0x378431?_0x77518[_0x3853('0x1c')]:_0x130b7b[_0x3853('0x1a')]+_0x130b7b['limit'];var _0x5464f3;if(_0x1ffdc9>=_0x4bf82a){_0x1ffdc9=_0x4bf82a;_0x5464f3=0xc8;}else{_0x5464f3=0xce;}_0x510e99[_0x3853('0x1d')](_0x5464f3);return _0x510e99['set'](_0x3853('0x1e'),_0x42dbd1+'-'+_0x1ffdc9+'/'+_0x4bf82a)[_0x3853('0x1f')](_0x77518);}return null;};}function patchUpdates(_0x5b211d){return function(_0x24223c){try{jsonpatch[_0x3853('0x20')](_0x24223c,_0x5b211d,!![]);}catch(_0x231b3){return BPromise[_0x3853('0x21')](_0x231b3);}return _0x24223c[_0x3853('0x22')]();};}function saveUpdates(_0x54252e,_0x1140e3){return function(_0x233c9c){if(_0x233c9c){return _0x233c9c[_0x3853('0x23')](_0x54252e)[_0x3853('0x24')](function(_0x2d089e){return _0x2d089e;});}return null;};}function removeEntity(_0x2a8fdb,_0x464fc2){return function(_0x5ea629){if(_0x5ea629){return _0x5ea629[_0x3853('0x25')]()['then'](function(){var _0x3cdbab=_0x5ea629['get']({'plain':!![]});var _0x5068fa=_0x3853('0x26');return db[_0x3853('0x27')][_0x3853('0x25')]({'where':{'type':_0x5068fa,'resourceId':_0x3cdbab['id']}})[_0x3853('0x24')](function(){return _0x5ea629;});})[_0x3853('0x24')](function(){_0x2a8fdb['status'](0xcc)[_0x3853('0x19')]();});}};}function handleEntityNotFound(_0x2b6bab,_0x5c0e8e){return function(_0x23b888){if(!_0x23b888){_0x2b6bab['sendStatus'](0x194);}return _0x23b888;};}function handleError(_0x47dfcc,_0x4ad20b){_0x4ad20b=_0x4ad20b||0x1f4;return function(_0x20c68e){logger[_0x3853('0x28')](_0x20c68e[_0x3853('0x29')]);if(_0x20c68e['name']){delete _0x20c68e[_0x3853('0x2a')];}_0x47dfcc[_0x3853('0x1d')](_0x4ad20b)['send'](_0x20c68e);};}exports['index']=function(_0x5873b3,_0x1f8ebe){var _0x2d6a84={},_0x314882={},_0x2fc6e1={'count':0x0,'rows':[]};var _0x272082=_[_0x3853('0x2b')](db[_0x3853('0x2c')][_0x3853('0x2d')],function(_0x5e8eca){return{'name':_0x5e8eca[_0x3853('0x2e')],'type':_0x5e8eca[_0x3853('0x2f')]['key']};});_0x314882[_0x3853('0x30')]=_['map'](_0x272082,_0x3853('0x2a'));_0x314882[_0x3853('0x31')]=_[_0x3853('0x32')](_0x5873b3['query']);_0x314882['filters']=_[_0x3853('0x33')](_0x314882['model'],_0x314882[_0x3853('0x31')]);_0x2d6a84[_0x3853('0x34')]=_[_0x3853('0x33')](_0x314882[_0x3853('0x30')],qs['fields'](_0x5873b3[_0x3853('0x31')][_0x3853('0x35')]));_0x2d6a84[_0x3853('0x34')]=_0x2d6a84[_0x3853('0x34')][_0x3853('0x36')]?_0x2d6a84[_0x3853('0x34')]:_0x314882['model'];if(!_0x5873b3[_0x3853('0x31')][_0x3853('0x37')](_0x3853('0x38'))){_0x2d6a84['limit']=qs[_0x3853('0x39')](_0x5873b3[_0x3853('0x31')]['limit']);_0x2d6a84[_0x3853('0x1a')]=qs[_0x3853('0x1a')](_0x5873b3['query'][_0x3853('0x1a')]);}_0x2d6a84[_0x3853('0x3a')]=qs[_0x3853('0x3b')](_0x5873b3[_0x3853('0x31')][_0x3853('0x3b')]);_0x2d6a84[_0x3853('0x3c')]=qs[_0x3853('0x3d')](_['pick'](_0x5873b3[_0x3853('0x31')],_0x314882[_0x3853('0x3d')]),_0x272082);if(_0x5873b3['query'][_0x3853('0x3e')]){_0x2d6a84[_0x3853('0x3c')]=_[_0x3853('0x3f')](_0x2d6a84[_0x3853('0x3c')],{'$or':_[_0x3853('0x2b')](_0x272082,function(_0x50d2a8){if(_0x50d2a8[_0x3853('0x2f')]!==_0x3853('0x40')){var _0x1abf37={};_0x1abf37[_0x50d2a8[_0x3853('0x2a')]]={'$like':'%'+_0x5873b3[_0x3853('0x31')][_0x3853('0x3e')]+'%'};return _0x1abf37;}})});}_0x2d6a84=_['merge']({},_0x2d6a84,_0x5873b3[_0x3853('0x41')]);var _0x9eb0e={'where':_0x2d6a84[_0x3853('0x3c')]};return db['JscriptyProject'][_0x3853('0x1c')](_0x9eb0e)[_0x3853('0x24')](function(_0x1bf89c){_0x2fc6e1[_0x3853('0x1c')]=_0x1bf89c;if(_0x5873b3[_0x3853('0x31')]['includeAll']){_0x2d6a84[_0x3853('0x42')]=[{'all':!![]}];}return db[_0x3853('0x2c')][_0x3853('0x43')](_0x2d6a84);})[_0x3853('0x24')](function(_0x4b5d73){_0x2fc6e1[_0x3853('0x44')]=_0x4b5d73;return _0x2fc6e1;})[_0x3853('0x24')](respondWithFilteredResult(_0x1f8ebe,_0x2d6a84))[_0x3853('0x45')](handleError(_0x1f8ebe,null));};exports[_0x3853('0x46')]=function(_0x3d0a83,_0x412351){var _0xf51d38={'raw':![],'where':{'id':_0x3d0a83[_0x3853('0x47')]['id']}},_0x3210d3={};_0x3210d3[_0x3853('0x30')]=_[_0x3853('0x32')](db['JscriptyProject'][_0x3853('0x2d')]);_0x3210d3[_0x3853('0x31')]=_[_0x3853('0x32')](_0x3d0a83[_0x3853('0x31')]);_0x3210d3['filters']=_['intersection'](_0x3210d3[_0x3853('0x30')],_0x3210d3[_0x3853('0x31')]);_0xf51d38[_0x3853('0x34')]=_[_0x3853('0x33')](_0x3210d3['model'],qs['fields'](_0x3d0a83[_0x3853('0x31')][_0x3853('0x35')]));_0xf51d38['attributes']=_0xf51d38[_0x3853('0x34')][_0x3853('0x36')]?_0xf51d38[_0x3853('0x34')]:_0x3210d3['model'];if(_0x3d0a83[_0x3853('0x31')]['includeAll']){_0xf51d38[_0x3853('0x42')]=[{'all':!![]}];}_0xf51d38=_[_0x3853('0x3f')]({},_0xf51d38,_0x3d0a83[_0x3853('0x41')]);return db[_0x3853('0x2c')][_0x3853('0x48')](_0xf51d38)[_0x3853('0x24')](handleEntityNotFound(_0x412351,null))[_0x3853('0x24')](respondWithResult(_0x412351,null))['catch'](handleError(_0x412351,null));};exports[_0x3853('0x49')]=function(_0x34db04,_0x2538ff){return db[_0x3853('0x2c')][_0x3853('0x49')](_0x34db04[_0x3853('0x4a')],{})[_0x3853('0x24')](function(_0x4c7469){var _0xbcdc18=_0x34db04[_0x3853('0x4b')][_0x3853('0x4c')]({'plain':!![]});if(!_0xbcdc18)throw new Error(_0x3853('0x4d'));if(_0xbcdc18[_0x3853('0x4e')]==='user'){var _0x2e8ad0=_0x4c7469['get']({'plain':!![]});var _0x405104=_0x3853('0x26');return db[_0x3853('0x4f')][_0x3853('0x48')]({'where':{'name':_0x405104,'userProfileId':_0xbcdc18[_0x3853('0x50')]},'raw':!![]})[_0x3853('0x24')](function(_0x1ad44d){if(_0x1ad44d&&_0x1ad44d[_0x3853('0x51')]===0x0){return db[_0x3853('0x27')][_0x3853('0x49')]({'name':_0x2e8ad0[_0x3853('0x2a')],'resourceId':_0x2e8ad0['id'],'type':_0x1ad44d[_0x3853('0x2a')],'sectionId':_0x1ad44d['id']},{})[_0x3853('0x24')](function(){return _0x4c7469;});}else{return _0x4c7469;}})[_0x3853('0x45')](function(_0x2dc19f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dc19f);throw _0x2dc19f;});}return _0x4c7469;})[_0x3853('0x24')](respondWithResult(_0x2538ff,0xc9))[_0x3853('0x45')](handleError(_0x2538ff,null));};exports[_0x3853('0x52')]=function(_0x4688bd,_0x2b77f6){var _0x126eb4={'where':{'id':_0x4688bd[_0x3853('0x47')]['id']}},_0x394aa5={};_0x394aa5[_0x3853('0x30')]=_[_0x3853('0x32')](db[_0x3853('0x2c')][_0x3853('0x2d')]);_0x126eb4[_0x3853('0x34')]=_[_0x3853('0x33')](_0x394aa5[_0x3853('0x30')],qs[_0x3853('0x35')](_0x4688bd[_0x3853('0x31')][_0x3853('0x35')]));_0x126eb4[_0x3853('0x34')]=_0x126eb4[_0x3853('0x34')][_0x3853('0x36')]?_0x126eb4[_0x3853('0x34')]:_0x394aa5[_0x3853('0x30')];if(_0x4688bd[_0x3853('0x31')]['includeAll']){_0x126eb4[_0x3853('0x42')]=[{'all':!![]}];}_0x126eb4=_[_0x3853('0x3f')]({},_0x126eb4,_0x4688bd[_0x3853('0x41')]);return db[_0x3853('0x2c')][_0x3853('0x48')](_0x126eb4)[_0x3853('0x24')](handleEntityNotFound(_0x2b77f6,null))[_0x3853('0x24')](function(_0x2740e4){if(_0x2740e4){var _0x416ec4=_0x2740e4['get']({'plain':!![]});_0x416ec4=qs[_0x3853('0x53')](_0x416ec4,['id',_0x3853('0x54'),_0x3853('0x55')]);_0x4688bd[_0x3853('0x4a')]=_[_0x3853('0x53')](_0x4688bd[_0x3853('0x4a')],['id','createdAt',_0x3853('0x55')]);return db[_0x3853('0x2c')][_0x3853('0x49')](_[_0x3853('0x3f')](_0x416ec4,_0x4688bd['body']),{'include':_0x4688bd['query'][_0x3853('0x56')]?[{'all':!![]}]:undefined})[_0x3853('0x24')](function(_0x4139ff){var _0xdca3a5=_0x4688bd[_0x3853('0x4b')][_0x3853('0x4c')]({'plain':!![]});if(!_0xdca3a5)throw new Error(_0x3853('0x4d'));if(_0xdca3a5[_0x3853('0x4e')]==='user'){var _0x4e868e=_0x4139ff[_0x3853('0x4c')]({'plain':!![]});var _0x5a54df=_0x3853('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x5a54df,'userProfileId':_0xdca3a5[_0x3853('0x50')]},'raw':!![]})[_0x3853('0x24')](function(_0x3157d4){if(_0x3157d4&&_0x3157d4[_0x3853('0x51')]===0x0){return db[_0x3853('0x27')][_0x3853('0x49')]({'name':_0x4e868e[_0x3853('0x2a')],'resourceId':_0x4e868e['id'],'type':_0x3157d4['name'],'sectionId':_0x3157d4['id']},{})['then'](function(){return _0x4139ff;});}else{return _0x4139ff;}})[_0x3853('0x45')](function(_0x46490b){logger[_0x3853('0x28')](_0x3853('0x57'),_0x46490b);throw _0x46490b;});}return _0x4139ff;});}})[_0x3853('0x24')](respondWithResult(_0x2b77f6,0xc9))[_0x3853('0x45')](handleError(_0x2b77f6,null));};exports[_0x3853('0x23')]=function(_0x288551,_0x3663f0){if(_0x288551[_0x3853('0x4a')]['id']){delete _0x288551[_0x3853('0x4a')]['id'];}return db['JscriptyProject'][_0x3853('0x48')]({'where':{'id':_0x288551[_0x3853('0x47')]['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x3663f0,null))[_0x3853('0x24')](saveUpdates(_0x288551[_0x3853('0x4a')],null))['then'](respondWithResult(_0x3663f0,null))['catch'](handleError(_0x3663f0,null));};exports['destroy']=function(_0x57f3a5,_0x4241ec){return db[_0x3853('0x2c')][_0x3853('0x48')]({'where':{'id':_0x57f3a5[_0x3853('0x47')]['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x4241ec,null))['then'](removeEntity(_0x4241ec,null))[_0x3853('0x45')](handleError(_0x4241ec,null));};exports['getSessions']=function(_0x1cc5e4,_0x1347f5,_0x4969bf){var _0x240871={'raw':!![],'where':{}};var _0x51e77d={};var _0x25d4df={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x1cc5e4['params']['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x1347f5,null))[_0x3853('0x24')](function(_0x571af3){if(_0x571af3){_0x51e77d[_0x3853('0x30')]=_[_0x3853('0x32')](db['JscriptySessionReport']['rawAttributes']);_0x51e77d[_0x3853('0x31')]=_['keys'](_0x1cc5e4[_0x3853('0x31')]);_0x51e77d[_0x3853('0x3d')]=_[_0x3853('0x33')](_0x51e77d[_0x3853('0x30')],_0x51e77d['query']);_0x240871['attributes']=_[_0x3853('0x33')](_0x51e77d[_0x3853('0x30')],qs['fields'](_0x1cc5e4[_0x3853('0x31')][_0x3853('0x35')]));_0x240871[_0x3853('0x34')]=_0x240871[_0x3853('0x34')][_0x3853('0x36')]?_0x240871['attributes']:_0x51e77d[_0x3853('0x30')];if(!_0x1cc5e4['query'][_0x3853('0x37')](_0x3853('0x38'))){_0x240871[_0x3853('0x39')]=qs['limit'](_0x1cc5e4[_0x3853('0x31')]['limit']);_0x240871[_0x3853('0x1a')]=qs[_0x3853('0x1a')](_0x1cc5e4['query'][_0x3853('0x1a')]);}_0x240871[_0x3853('0x3a')]=qs[_0x3853('0x3b')](_0x1cc5e4[_0x3853('0x31')][_0x3853('0x3b')]);_0x240871['where']=qs[_0x3853('0x3d')](_[_0x3853('0x58')](_0x1cc5e4[_0x3853('0x31')],_0x51e77d[_0x3853('0x3d')]));_0x240871[_0x3853('0x3c')][_0x3853('0x59')]=_0x571af3['id'];if(_0x1cc5e4[_0x3853('0x31')][_0x3853('0x3e')]){_0x240871[_0x3853('0x3c')]=_[_0x3853('0x3f')](_0x240871[_0x3853('0x3c')],{'$or':_[_0x3853('0x2b')](_0x240871[_0x3853('0x34')],function(_0x3e7a13){var _0x4600f2={};_0x4600f2[_0x3e7a13]={'$like':'%'+_0x1cc5e4['query'][_0x3853('0x3e')]+'%'};return _0x4600f2;})});}_0x240871=_[_0x3853('0x3f')]({},_0x240871,_0x1cc5e4['options']);return db['JscriptySessionReport'][_0x3853('0x1c')]({'where':_0x240871[_0x3853('0x3c')]})[_0x3853('0x24')](function(_0xb681d4){_0x25d4df[_0x3853('0x1c')]=_0xb681d4;if(_0x1cc5e4[_0x3853('0x31')]['includeAll']){_0x240871[_0x3853('0x42')]=[{'all':!![]}];}return db[_0x3853('0x5a')][_0x3853('0x43')](_0x240871);})[_0x3853('0x24')](function(_0x1c8d8c){_0x25d4df[_0x3853('0x44')]=_0x1c8d8c;return _0x25d4df;});}})[_0x3853('0x24')](respondWithFilteredResult(_0x1347f5,_0x240871))[_0x3853('0x45')](handleError(_0x1347f5,null));};exports['getAnswers']=function(_0x31cce1,_0x5a0812,_0x507a17){var _0x1c31c4={'raw':!![],'where':{}};var _0x2f3528={};var _0x30c31b={'count':0x0,'rows':[]};return db[_0x3853('0x2c')]['findOne']({'where':{'id':_0x31cce1[_0x3853('0x47')]['id']}})[_0x3853('0x24')](handleEntityNotFound(_0x5a0812,null))[_0x3853('0x24')](function(_0x47a837){if(_0x47a837){_0x2f3528[_0x3853('0x30')]=_[_0x3853('0x32')](db[_0x3853('0x5b')][_0x3853('0x2d')]);_0x2f3528[_0x3853('0x31')]=_[_0x3853('0x32')](_0x31cce1[_0x3853('0x31')]);_0x2f3528['filters']=_[_0x3853('0x33')](_0x2f3528['model'],_0x2f3528[_0x3853('0x31')]);_0x1c31c4['attributes']=_[_0x3853('0x33')](_0x2f3528[_0x3853('0x30')],qs['fields'](_0x31cce1['query'][_0x3853('0x35')]));_0x1c31c4[_0x3853('0x34')]=_0x1c31c4[_0x3853('0x34')][_0x3853('0x36')]?_0x1c31c4['attributes']:_0x2f3528[_0x3853('0x30')];if(!_0x31cce1[_0x3853('0x31')]['hasOwnProperty'](_0x3853('0x38'))){_0x1c31c4[_0x3853('0x39')]=qs[_0x3853('0x39')](_0x31cce1[_0x3853('0x31')]['limit']);_0x1c31c4[_0x3853('0x1a')]=qs[_0x3853('0x1a')](_0x31cce1[_0x3853('0x31')][_0x3853('0x1a')]);}_0x1c31c4[_0x3853('0x3a')]=qs['sort'](_0x31cce1[_0x3853('0x31')][_0x3853('0x3b')]);_0x1c31c4[_0x3853('0x3c')]=qs['filters'](_[_0x3853('0x58')](_0x31cce1[_0x3853('0x31')],_0x2f3528[_0x3853('0x3d')]));_0x1c31c4['where'][_0x3853('0x59')]=_0x47a837['id'];if(_0x31cce1[_0x3853('0x31')][_0x3853('0x3e')]){_0x1c31c4[_0x3853('0x3c')]=_[_0x3853('0x3f')](_0x1c31c4[_0x3853('0x3c')],{'$or':_[_0x3853('0x2b')](_0x1c31c4[_0x3853('0x34')],function(_0x47a3b6){var _0x1dc0fb={};_0x1dc0fb[_0x47a3b6]={'$like':'%'+_0x31cce1['query'][_0x3853('0x3e')]+'%'};return _0x1dc0fb;})});}_0x1c31c4=_['merge']({},_0x1c31c4,_0x31cce1[_0x3853('0x41')]);return db[_0x3853('0x5b')][_0x3853('0x1c')]({'where':_0x1c31c4['where']})['then'](function(_0x2b191e){_0x30c31b[_0x3853('0x1c')]=_0x2b191e;if(_0x31cce1[_0x3853('0x31')]['includeAll']){_0x1c31c4['include']=[{'all':!![]}];}return db[_0x3853('0x5b')][_0x3853('0x43')](_0x1c31c4);})[_0x3853('0x24')](function(_0x7e683){_0x30c31b['rows']=_0x7e683;return _0x30c31b;});}})['then'](respondWithFilteredResult(_0x5a0812,_0x1c31c4))[_0x3853('0x45')](handleError(_0x5a0812,null));};function char(_0x23808b){return'number'===typeof _0x23808b?String[_0x3853('0x5c')][_0x3853('0x20')](null,arguments):_0x23808b;}function needsEncapsulation(_0x19b2c6){return!!_0x19b2c6&&(_0x19b2c6[_0x3853('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x19b2c6[_0x3853('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x19b2c6[_0x3853('0x5d')]()['indexOf'](char(0x2c))>=0x0||_0x19b2c6[_0x3853('0x5d')]()[_0x3853('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x23215a){var _0x3689c7=char(0x22),_0x285eaf='\x5c'+char(0x22),_0x2b7906=_0x23215a[_0x3853('0x5d')]()[_0x3853('0x5f')](new RegExp(_0x3689c7,'g'),_0x285eaf);return _0x3689c7+_0x2b7906+_0x3689c7;}exports[_0x3853('0x60')]=function(_0x157c55,_0x5efb76,_0x56b1b7){var _0x53a753,_0x5bd5ab;var _0x18b7c5={'where':{'ProjectId':_0x157c55[_0x3853('0x47')]['id']}};if(_0x157c55[_0x3853('0x31')][_0x3853('0x61')]){_0x18b7c5[_0x3853('0x3c')]['starttime']=JSON[_0x3853('0x62')](_0x157c55[_0x3853('0x31')][_0x3853('0x61')]);}return db[_0x3853('0x5a')]['findAll'](_0x18b7c5)[_0x3853('0x24')](handleEntityNotFound(_0x5efb76,null))['then'](function(_0x1622c7){if(_0x1622c7){_0x53a753=_0x1622c7;return db[_0x3853('0x63')][_0x3853('0x43')]({'where':{'SessionId':{'$in':_[_0x3853('0x2b')](_0x53a753,'id')},'ProjectId':_0x157c55['params']['id']},'order':_0x3853('0x64')});}})[_0x3853('0x24')](handleEntityNotFound(_0x5efb76,null))['then'](function(_0x2f5f2a){if(_0x2f5f2a){_0x5bd5ab=_0x2f5f2a;var _0x5e9239={};for(var _0xac82b1=0x0,_0x1ab0e5=_0x5bd5ab[_0x3853('0x36')];_0xac82b1<_0x1ab0e5;_0xac82b1++){if(!_0x5e9239[_0x3853('0x37')](_0x5bd5ab[_0xac82b1][_0x3853('0x65')])){_0x5e9239[_0x5bd5ab[_0xac82b1][_0x3853('0x65')]]=needsEncapsulation(_0x5bd5ab[_0xac82b1]['question'])?encapsulate(_0x5bd5ab[_0xac82b1][_0x3853('0x66')]):_0x5bd5ab[_0xac82b1]['question'];}}var _0x3ab228=[],_0x3163e3={};for(var _0x3c5f5b=0x0,_0x4d95e0=_0x53a753[_0x3853('0x36')];_0x3c5f5b<_0x4d95e0;_0x3c5f5b++){_0x3163e3={'ProjectId':_0x157c55[_0x3853('0x47')]['id'],'SessionId':_0x53a753[_0x3c5f5b]['id'],'StartTime':moment(_0x53a753[_0x3c5f5b]['starttime'])[_0x3853('0x67')](_0x3853('0x68'))};for(var _0x1e4c5b=0x0,_0x458b26=_0x5bd5ab[_0x3853('0x36')];_0x1e4c5b<_0x458b26;_0x1e4c5b++){if(_0x5bd5ab[_0x1e4c5b]['SessionId']==_0x53a753[_0x3c5f5b]['id']&&_0x5e9239[_0x3853('0x37')](_0x5bd5ab[_0x1e4c5b]['questionId'])){_0x3163e3[_0x5e9239[_0x5bd5ab[_0x1e4c5b][_0x3853('0x65')]]]=_0x5bd5ab[_0x1e4c5b][_0x3853('0x69')];}}for(var _0x2ea27f in _0x5e9239){if(!_0x3163e3[_0x3853('0x37')](_0x5e9239[_0x2ea27f])){_0x3163e3[_0x5e9239[_0x2ea27f]]=null;}}_0x3ab228[_0x3853('0x6a')](_0x3163e3);}return _0x3ab228;}})[_0x3853('0x24')](function(_0x36ab35){if(!_[_0x3853('0x6b')](_0x36ab35)){var _0x457c01=toCsv(_0x36ab35);var _0x445dee=Date['now']();fs['writeFileSync'](util[_0x3853('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x157c55[_0x3853('0x47')]['id'],_0x445dee),_0x457c01);_0x5efb76[_0x3853('0x6c')](_0x3853('0x6d'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x157c55[_0x3853('0x47')]['id'],_0x445dee));_0x5efb76['setHeader'](_0x3853('0x6e'),_0x3853('0x6f'));return _0x5efb76[_0x3853('0x70')](util[_0x3853('0x67')](_0x3853('0x71'),_0x157c55[_0x3853('0x47')]['id'],_0x445dee));}else{return _0x5efb76[_0x3853('0x18')](0xcc);}})[_0x3853('0x45')](handleError(_0x5efb76,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index fee4224..15304e6 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 _0x8ef6=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x2317ae,_0x150322){var _0x27624b=function(_0x123ef8){while(--_0x123ef8){_0x2317ae['push'](_0x2317ae['shift']());}};_0x27624b(++_0x150322);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3e62b0,_0x132831){_0x3e62b0=_0x3e62b0-0x0;var _0x19e398=_0x8ef6[_0x3e62b0];return _0x19e398;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4fb=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x560871,_0x4d8e6a){var _0x2632fe=function(_0x4f05f){while(--_0x4f05f){_0x560871['push'](_0x560871['shift']());}};_0x2632fe(++_0x4d8e6a);}(_0xa4fb,0x150));var _0xba4f=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0xa4fb[_0x3ef45e];return _0x69e7c;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var logger=require(_0xba4f('0x2'))(_0xba4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba4f('0x4'));var fs=require('fs');var path=require(_0xba4f('0x5'));var rimraf=require(_0xba4f('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4f('0x7'));module[_0xba4f('0x8')]=function(_0x379b0f,_0x18baa8){return _0x379b0f[_0xba4f('0x9')](_0xba4f('0xa'),attributes,{'tableName':_0xba4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 95f8cb9..18342ac 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3a0065,_0xd9823c){var _0x264f8a=function(_0x4bf81e){while(--_0x4bf81e){_0x3a0065['push'](_0x3a0065['shift']());}};_0x264f8a(++_0xd9823c);}(_0x70e0,0x17b));var _0x070e=function(_0x56f354,_0xad2325){_0x56f354=_0x56f354-0x0;var _0x17cf21=_0x70e0[_0x56f354];return _0x17cf21;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0xda3f,0xec));var _0xfda3=function(_0x33cae4,_0x64745b){_0x33cae4=_0x33cae4-0x0;var _0x4884de=_0xda3f[_0x33cae4];return _0x4884de;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c78d260..7d0b270 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 _0x6986=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x47bb6,_0x4f24ca){var _0x21ab44=function(_0x2e850d){while(--_0x2e850d){_0x47bb6['push'](_0x47bb6['shift']());}};_0x21ab44(++_0x4f24ca);}(_0x6986,0x65));var _0x6698=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x6986[_0x421c56];return _0x49b244;};'use strict';var multer=require(_0x6698('0x0'));var util=require('util');var path=require(_0x6698('0x1'));var timeout=require(_0x6698('0x2'));var express=require('express');var router=express[_0x6698('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6698('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6698('0x5'));var controller=require(_0x6698('0x6'));router[_0x6698('0x7')]('/',auth[_0x6698('0x8')](),controller[_0x6698('0x9')]);router[_0x6698('0x7')](_0x6698('0xa'),auth[_0x6698('0x8')](),controller[_0x6698('0xb')]);router[_0x6698('0x7')](_0x6698('0xc'),auth[_0x6698('0x8')](),controller[_0x6698('0xd')]);router[_0x6698('0xe')]('/',auth[_0x6698('0x8')](),controller['create']);router[_0x6698('0xf')](_0x6698('0xc'),auth[_0x6698('0x8')](),controller[_0x6698('0x10')]);router[_0x6698('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6698('0x12')]);module[_0x6698('0x13')]=router; \ No newline at end of file +var _0x5848=['fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','update','delete','destroy','util','path'];(function(_0x107511,_0x6605a2){var _0x1caf76=function(_0x4ecc23){while(--_0x4ecc23){_0x107511['push'](_0x107511['shift']());}};_0x1caf76(++_0x6605a2);}(_0x5848,0x19e));var _0x8584=function(_0x2ae259,_0x2a565a){_0x2ae259=_0x2ae259-0x0;var _0x3e269a=_0x5848[_0x2ae259];return _0x3e269a;};'use strict';var multer=require('multer');var util=require(_0x8584('0x0'));var path=require(_0x8584('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8584('0x2'));var auth=require(_0x8584('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8584('0x4'));var controller=require(_0x8584('0x5'));router[_0x8584('0x6')]('/',auth['isAuthenticated'](),controller[_0x8584('0x7')]);router[_0x8584('0x6')](_0x8584('0x8'),auth['isAuthenticated'](),controller[_0x8584('0x9')]);router[_0x8584('0x6')](_0x8584('0xa'),auth[_0x8584('0xb')](),controller['show']);router['post']('/',auth[_0x8584('0xb')](),controller[_0x8584('0xc')]);router['put'](_0x8584('0xa'),auth['isAuthenticated'](),controller[_0x8584('0xd')]);router[_0x8584('0xe')](_0x8584('0xa'),auth['isAuthenticated'](),controller[_0x8584('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index f41e2c2..dea8a46 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(_0x51ccb2,_0x2b8dac){_0x51ccb2=_0x51ccb2-0x0;var _0x7186c1=_0x7a54[_0x51ccb2];return _0x7186c1;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x391dc4,_0x343f2e){_0x391dc4=_0x391dc4-0x0;var _0x34cff1=_0x7a54[_0x391dc4];return _0x34cff1;};'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 db53ff9..36d894f 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 _0x723f=['body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','pick','filter','where','merge','JscriptyQuestionReport','findAll','rows','show','params','keys','length','include','options','catch','create'];(function(_0x1f40f4,_0x1c2061){var _0x2494d6=function(_0x474b09){while(--_0x474b09){_0x1f40f4['push'](_0x1f40f4['shift']());}};_0x2494d6(++_0x1c2061);}(_0x723f,0x1bf));var _0xf723=function(_0x3f4d9a,_0x39a8ce){_0x3f4d9a=_0x3f4d9a-0x0;var _0xf5a24a=_0x723f[_0x3f4d9a];return _0xf5a24a;};'use strict';var emlformat=require(_0xf723('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf723('0x1'));var jsonpatch=require(_0xf723('0x2'));var rp=require(_0xf723('0x3'));var moment=require(_0xf723('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf723('0x5'));var sox=require(_0xf723('0x6'));var csv=require('to-csv');var ejs=require(_0xf723('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf723('0x8'));var squel=require(_0xf723('0x9'));var crypto=require('crypto');var jsforce=require(_0xf723('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf723('0xb'));var querystring=require(_0xf723('0xc'));var Papa=require(_0xf723('0xd'));var Redis=require(_0xf723('0xe'));var authService=require(_0xf723('0xf'));var qs=require(_0xf723('0x10'));var as=require(_0xf723('0x11'));var hardwareService=require(_0xf723('0x12'));var logger=require(_0xf723('0x13'))(_0xf723('0x14'));var utils=require(_0xf723('0x15'));var config=require(_0xf723('0x16'));var licenseUtil=require(_0xf723('0x17'));var db=require(_0xf723('0x18'))['db'];function respondWithStatusCode(_0x23df4e,_0x1d3f22){_0x1d3f22=_0x1d3f22||0xcc;return function(_0x4a6d0b){if(_0x4a6d0b){return _0x23df4e[_0xf723('0x19')](_0x1d3f22);}return _0x23df4e[_0xf723('0x1a')](_0x1d3f22)[_0xf723('0x1b')]();};}function respondWithResult(_0xd65ba5,_0x4c9fc6){_0x4c9fc6=_0x4c9fc6||0xc8;return function(_0x38cdc2){if(_0x38cdc2){return _0xd65ba5[_0xf723('0x1a')](_0x4c9fc6)[_0xf723('0x1c')](_0x38cdc2);}};}function respondWithFilteredResult(_0x4542a9,_0x1d5017){return function(_0x3638c1){if(_0x3638c1){var _0xe10367=typeof _0x1d5017['offset']==='undefined'&&typeof _0x1d5017[_0xf723('0x1d')]==='undefined';var _0x459e30=_0x3638c1[_0xf723('0x1e')];var _0x44873f=_0xe10367?0x0:_0x1d5017[_0xf723('0x1f')];var _0x14bb22=_0xe10367?_0x3638c1['count']:_0x1d5017[_0xf723('0x1f')]+_0x1d5017[_0xf723('0x1d')];var _0x126fd2;if(_0x14bb22>=_0x459e30){_0x14bb22=_0x459e30;_0x126fd2=0xc8;}else{_0x126fd2=0xce;}_0x4542a9[_0xf723('0x1a')](_0x126fd2);return _0x4542a9[_0xf723('0x20')](_0xf723('0x21'),_0x44873f+'-'+_0x14bb22+'/'+_0x459e30)['json'](_0x3638c1);}return null;};}function patchUpdates(_0x56688a){return function(_0x5ba1ab){try{jsonpatch['apply'](_0x5ba1ab,_0x56688a,!![]);}catch(_0x336737){return BPromise[_0xf723('0x22')](_0x336737);}return _0x5ba1ab[_0xf723('0x23')]();};}function saveUpdates(_0x5c83a1,_0x44af85){return function(_0x17e8fa){if(_0x17e8fa){return _0x17e8fa[_0xf723('0x24')](_0x5c83a1)['then'](function(_0x1db093){return _0x1db093;});}return null;};}function removeEntity(_0x3d09f2,_0x5e7a14){return function(_0x18da4d){if(_0x18da4d){return _0x18da4d[_0xf723('0x25')]()[_0xf723('0x26')](function(){_0x3d09f2[_0xf723('0x1a')](0xcc)[_0xf723('0x1b')]();});}};}function handleEntityNotFound(_0x2cd84e,_0x4713c3){return function(_0x5c2571){if(!_0x5c2571){_0x2cd84e['sendStatus'](0x194);}return _0x5c2571;};}function handleError(_0x46dcc7,_0x59245d){_0x59245d=_0x59245d||0x1f4;return function(_0xa38935){logger[_0xf723('0x27')](_0xa38935[_0xf723('0x28')]);if(_0xa38935[_0xf723('0x29')]){delete _0xa38935['name'];}_0x46dcc7[_0xf723('0x1a')](_0x59245d)[_0xf723('0x2a')](_0xa38935);};}exports[_0xf723('0x2b')]=function(_0x19fd30,_0x3a59a7){var _0x20ba14={},_0x133fb6={},_0x13c393={'count':0x0,'rows':[]};var _0x517b45=_['map'](db['JscriptyQuestionReport'][_0xf723('0x2c')],function(_0x48ef27){return{'name':_0x48ef27[_0xf723('0x2d')],'type':_0x48ef27[_0xf723('0x2e')][_0xf723('0x2f')]};});_0x133fb6[_0xf723('0x30')]=_[_0xf723('0x31')](_0x517b45,_0xf723('0x29'));_0x133fb6[_0xf723('0x32')]=_['keys'](_0x19fd30[_0xf723('0x32')]);_0x133fb6[_0xf723('0x33')]=_['intersection'](_0x133fb6[_0xf723('0x30')],_0x133fb6[_0xf723('0x32')]);_0x20ba14[_0xf723('0x34')]=_[_0xf723('0x35')](_0x133fb6['model'],qs['fields'](_0x19fd30[_0xf723('0x32')][_0xf723('0x36')]));_0x20ba14['attributes']=_0x20ba14[_0xf723('0x34')]['length']?_0x20ba14[_0xf723('0x34')]:_0x133fb6[_0xf723('0x30')];if(!_0x19fd30[_0xf723('0x32')]['hasOwnProperty'](_0xf723('0x37'))){_0x20ba14[_0xf723('0x1d')]=qs[_0xf723('0x1d')](_0x19fd30[_0xf723('0x32')][_0xf723('0x1d')]);_0x20ba14[_0xf723('0x1f')]=qs[_0xf723('0x1f')](_0x19fd30[_0xf723('0x32')]['offset']);}_0x20ba14['order']=qs['sort'](_0x19fd30[_0xf723('0x32')]['sort']);_0x20ba14['where']=qs['filters'](_[_0xf723('0x38')](_0x19fd30['query'],_0x133fb6[_0xf723('0x33')]),_0x517b45);if(_0x19fd30[_0xf723('0x32')][_0xf723('0x39')]){_0x20ba14[_0xf723('0x3a')]=_[_0xf723('0x3b')](_0x20ba14[_0xf723('0x3a')],{'$or':_[_0xf723('0x31')](_0x517b45,function(_0x22d949){if(_0x22d949[_0xf723('0x2e')]!=='VIRTUAL'){var _0x2da424={};_0x2da424[_0x22d949[_0xf723('0x29')]]={'$like':'%'+_0x19fd30[_0xf723('0x32')]['filter']+'%'};return _0x2da424;}})});}_0x20ba14=_[_0xf723('0x3b')]({},_0x20ba14,_0x19fd30['options']);var _0x3fd1be={'where':_0x20ba14[_0xf723('0x3a')]};return db[_0xf723('0x3c')][_0xf723('0x1e')](_0x3fd1be)[_0xf723('0x26')](function(_0x2a3174){_0x13c393[_0xf723('0x1e')]=_0x2a3174;if(_0x19fd30[_0xf723('0x32')]['includeAll']){_0x20ba14['include']=[{'all':!![]}];}return db[_0xf723('0x3c')][_0xf723('0x3d')](_0x20ba14);})[_0xf723('0x26')](function(_0x11b2f0){_0x13c393[_0xf723('0x3e')]=_0x11b2f0;return _0x13c393;})[_0xf723('0x26')](respondWithFilteredResult(_0x3a59a7,_0x20ba14))['catch'](handleError(_0x3a59a7,null));};exports[_0xf723('0x3f')]=function(_0xa7fe69,_0xa6fd04){var _0x97894={'raw':!![],'where':{'id':_0xa7fe69[_0xf723('0x40')]['id']}},_0x22019c={};_0x22019c[_0xf723('0x30')]=_['keys'](db[_0xf723('0x3c')][_0xf723('0x2c')]);_0x22019c['query']=_[_0xf723('0x41')](_0xa7fe69[_0xf723('0x32')]);_0x22019c[_0xf723('0x33')]=_[_0xf723('0x35')](_0x22019c[_0xf723('0x30')],_0x22019c[_0xf723('0x32')]);_0x97894['attributes']=_[_0xf723('0x35')](_0x22019c[_0xf723('0x30')],qs['fields'](_0xa7fe69[_0xf723('0x32')]['fields']));_0x97894[_0xf723('0x34')]=_0x97894['attributes'][_0xf723('0x42')]?_0x97894[_0xf723('0x34')]:_0x22019c[_0xf723('0x30')];if(_0xa7fe69[_0xf723('0x32')]['includeAll']){_0x97894[_0xf723('0x43')]=[{'all':!![]}];}_0x97894=_[_0xf723('0x3b')]({},_0x97894,_0xa7fe69[_0xf723('0x44')]);return db[_0xf723('0x3c')]['find'](_0x97894)[_0xf723('0x26')](handleEntityNotFound(_0xa6fd04,null))[_0xf723('0x26')](respondWithResult(_0xa6fd04,null))[_0xf723('0x45')](handleError(_0xa6fd04,null));};exports[_0xf723('0x46')]=function(_0x460bce,_0x397915){return db[_0xf723('0x3c')][_0xf723('0x46')](_0x460bce[_0xf723('0x47')],{})['then'](respondWithResult(_0x397915,0xc9))[_0xf723('0x45')](handleError(_0x397915,null));};exports[_0xf723('0x24')]=function(_0x1367d6,_0x3633ac){if(_0x1367d6[_0xf723('0x47')]['id']){delete _0x1367d6['body']['id'];}return db[_0xf723('0x3c')][_0xf723('0x48')]({'where':{'id':_0x1367d6[_0xf723('0x40')]['id']}})['then'](handleEntityNotFound(_0x3633ac,null))[_0xf723('0x26')](saveUpdates(_0x1367d6[_0xf723('0x47')],null))[_0xf723('0x26')](respondWithResult(_0x3633ac,null))[_0xf723('0x45')](handleError(_0x3633ac,null));};exports['destroy']=function(_0x3e8d4d,_0x40eba9){return db[_0xf723('0x3c')]['find']({'where':{'id':_0x3e8d4d[_0xf723('0x40')]['id']}})['then'](handleEntityNotFound(_0x40eba9,null))['then'](removeEntity(_0x40eba9,null))[_0xf723('0x45')](handleError(_0x40eba9,null));};exports[_0xf723('0x49')]=function(_0x412d13,_0x48ed65){return db[_0xf723('0x3c')][_0xf723('0x49')]()['then'](respondWithResult(_0x48ed65,null))['catch'](handleError(_0x48ed65,null));}; \ No newline at end of file +var _0xc4d6=['send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','filters','attributes','intersection','query','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x38b1df,_0x56d0aa){var _0x23a64b=function(_0x509d62){while(--_0x509d62){_0x38b1df['push'](_0x38b1df['shift']());}};_0x23a64b(++_0x56d0aa);}(_0xc4d6,0x151));var _0x6c4d=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xc4d6[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require(_0x6c4d('0x0'));var rimraf=require(_0x6c4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c4d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c4d('0x3'));var Mustache=require('mustache');var util=require(_0x6c4d('0x4'));var path=require('path');var sox=require(_0x6c4d('0x5'));var csv=require(_0x6c4d('0x6'));var ejs=require(_0x6c4d('0x7'));var fs=require('fs');var fs_extra=require(_0x6c4d('0x8'));var _=require(_0x6c4d('0x9'));var squel=require(_0x6c4d('0xa'));var crypto=require(_0x6c4d('0xb'));var jsforce=require(_0x6c4d('0xc'));var deskjs=require(_0x6c4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c4d('0xe'));var Papa=require(_0x6c4d('0xf'));var Redis=require(_0x6c4d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6c4d('0x11'));var as=require(_0x6c4d('0x12'));var hardwareService=require(_0x6c4d('0x13'));var logger=require(_0x6c4d('0x14'))('api');var utils=require(_0x6c4d('0x15'));var config=require(_0x6c4d('0x16'));var licenseUtil=require(_0x6c4d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1698dc,_0x16e417){_0x16e417=_0x16e417||0xcc;return function(_0x41c7b5){if(_0x41c7b5){return _0x1698dc['sendStatus'](_0x16e417);}return _0x1698dc[_0x6c4d('0x18')](_0x16e417)[_0x6c4d('0x19')]();};}function respondWithResult(_0x80348a,_0x34606a){_0x34606a=_0x34606a||0xc8;return function(_0x529b43){if(_0x529b43){return _0x80348a['status'](_0x34606a)[_0x6c4d('0x1a')](_0x529b43);}};}function respondWithFilteredResult(_0x437104,_0xd6490f){return function(_0x3f68a4){if(_0x3f68a4){var _0x303ca8=typeof _0xd6490f[_0x6c4d('0x1b')]===_0x6c4d('0x1c')&&typeof _0xd6490f[_0x6c4d('0x1d')]==='undefined';var _0x1fed2a=_0x3f68a4['count'];var _0x1f3586=_0x303ca8?0x0:_0xd6490f['offset'];var _0x3ecd2f=_0x303ca8?_0x3f68a4[_0x6c4d('0x1e')]:_0xd6490f[_0x6c4d('0x1b')]+_0xd6490f[_0x6c4d('0x1d')];var _0x3f9a23;if(_0x3ecd2f>=_0x1fed2a){_0x3ecd2f=_0x1fed2a;_0x3f9a23=0xc8;}else{_0x3f9a23=0xce;}_0x437104[_0x6c4d('0x18')](_0x3f9a23);return _0x437104[_0x6c4d('0x1f')](_0x6c4d('0x20'),_0x1f3586+'-'+_0x3ecd2f+'/'+_0x1fed2a)[_0x6c4d('0x1a')](_0x3f68a4);}return null;};}function patchUpdates(_0x5082f6){return function(_0x226a29){try{jsonpatch[_0x6c4d('0x21')](_0x226a29,_0x5082f6,!![]);}catch(_0xc0ab91){return BPromise[_0x6c4d('0x22')](_0xc0ab91);}return _0x226a29[_0x6c4d('0x23')]();};}function saveUpdates(_0x137444,_0x542283){return function(_0x5f14f2){if(_0x5f14f2){return _0x5f14f2[_0x6c4d('0x24')](_0x137444)[_0x6c4d('0x25')](function(_0x2e8db2){return _0x2e8db2;});}return null;};}function removeEntity(_0x6bc5ef,_0x2a14f2){return function(_0x29b4a2){if(_0x29b4a2){return _0x29b4a2[_0x6c4d('0x26')]()[_0x6c4d('0x25')](function(){_0x6bc5ef[_0x6c4d('0x18')](0xcc)[_0x6c4d('0x19')]();});}};}function handleEntityNotFound(_0x432004,_0x5a7c4a){return function(_0x5c5c29){if(!_0x5c5c29){_0x432004[_0x6c4d('0x27')](0x194);}return _0x5c5c29;};}function handleError(_0x25f271,_0x7c505f){_0x7c505f=_0x7c505f||0x1f4;return function(_0x113c73){logger[_0x6c4d('0x28')](_0x113c73[_0x6c4d('0x29')]);if(_0x113c73[_0x6c4d('0x2a')]){delete _0x113c73['name'];}_0x25f271[_0x6c4d('0x18')](_0x7c505f)[_0x6c4d('0x2b')](_0x113c73);};}exports['index']=function(_0x1d9f24,_0x4e546f){var _0x4f6136={},_0x46c55c={},_0x2e19b3={'count':0x0,'rows':[]};var _0x4500bf=_[_0x6c4d('0x2c')](db[_0x6c4d('0x2d')][_0x6c4d('0x2e')],function(_0x44fa47){return{'name':_0x44fa47[_0x6c4d('0x2f')],'type':_0x44fa47[_0x6c4d('0x30')][_0x6c4d('0x31')]};});_0x46c55c[_0x6c4d('0x32')]=_[_0x6c4d('0x2c')](_0x4500bf,_0x6c4d('0x2a'));_0x46c55c['query']=_['keys'](_0x1d9f24['query']);_0x46c55c[_0x6c4d('0x33')]=_['intersection'](_0x46c55c['model'],_0x46c55c['query']);_0x4f6136[_0x6c4d('0x34')]=_[_0x6c4d('0x35')](_0x46c55c[_0x6c4d('0x32')],qs['fields'](_0x1d9f24[_0x6c4d('0x36')]['fields']));_0x4f6136['attributes']=_0x4f6136[_0x6c4d('0x34')][_0x6c4d('0x37')]?_0x4f6136['attributes']:_0x46c55c[_0x6c4d('0x32')];if(!_0x1d9f24['query'][_0x6c4d('0x38')]('nolimit')){_0x4f6136[_0x6c4d('0x1d')]=qs['limit'](_0x1d9f24[_0x6c4d('0x36')][_0x6c4d('0x1d')]);_0x4f6136['offset']=qs[_0x6c4d('0x1b')](_0x1d9f24['query'][_0x6c4d('0x1b')]);}_0x4f6136['order']=qs[_0x6c4d('0x39')](_0x1d9f24['query'][_0x6c4d('0x39')]);_0x4f6136[_0x6c4d('0x3a')]=qs[_0x6c4d('0x33')](_[_0x6c4d('0x3b')](_0x1d9f24[_0x6c4d('0x36')],_0x46c55c[_0x6c4d('0x33')]),_0x4500bf);if(_0x1d9f24[_0x6c4d('0x36')][_0x6c4d('0x3c')]){_0x4f6136[_0x6c4d('0x3a')]=_[_0x6c4d('0x3d')](_0x4f6136[_0x6c4d('0x3a')],{'$or':_['map'](_0x4500bf,function(_0x1382d0){if(_0x1382d0[_0x6c4d('0x30')]!=='VIRTUAL'){var _0x27fbd3={};_0x27fbd3[_0x1382d0[_0x6c4d('0x2a')]]={'$like':'%'+_0x1d9f24[_0x6c4d('0x36')]['filter']+'%'};return _0x27fbd3;}})});}_0x4f6136=_[_0x6c4d('0x3d')]({},_0x4f6136,_0x1d9f24[_0x6c4d('0x3e')]);var _0x133aae={'where':_0x4f6136[_0x6c4d('0x3a')]};return db[_0x6c4d('0x2d')]['count'](_0x133aae)['then'](function(_0x35cd68){_0x2e19b3[_0x6c4d('0x1e')]=_0x35cd68;if(_0x1d9f24[_0x6c4d('0x36')][_0x6c4d('0x3f')]){_0x4f6136[_0x6c4d('0x40')]=[{'all':!![]}];}return db[_0x6c4d('0x2d')][_0x6c4d('0x41')](_0x4f6136);})[_0x6c4d('0x25')](function(_0x31e23c){_0x2e19b3[_0x6c4d('0x42')]=_0x31e23c;return _0x2e19b3;})[_0x6c4d('0x25')](respondWithFilteredResult(_0x4e546f,_0x4f6136))[_0x6c4d('0x43')](handleError(_0x4e546f,null));};exports[_0x6c4d('0x44')]=function(_0x13dde2,_0x21088d){var _0x586a71={'raw':!![],'where':{'id':_0x13dde2[_0x6c4d('0x45')]['id']}},_0x39facc={};_0x39facc[_0x6c4d('0x32')]=_[_0x6c4d('0x46')](db[_0x6c4d('0x2d')]['rawAttributes']);_0x39facc[_0x6c4d('0x36')]=_[_0x6c4d('0x46')](_0x13dde2[_0x6c4d('0x36')]);_0x39facc['filters']=_[_0x6c4d('0x35')](_0x39facc[_0x6c4d('0x32')],_0x39facc[_0x6c4d('0x36')]);_0x586a71[_0x6c4d('0x34')]=_[_0x6c4d('0x35')](_0x39facc[_0x6c4d('0x32')],qs[_0x6c4d('0x47')](_0x13dde2[_0x6c4d('0x36')][_0x6c4d('0x47')]));_0x586a71['attributes']=_0x586a71['attributes']['length']?_0x586a71[_0x6c4d('0x34')]:_0x39facc[_0x6c4d('0x32')];if(_0x13dde2[_0x6c4d('0x36')]['includeAll']){_0x586a71[_0x6c4d('0x40')]=[{'all':!![]}];}_0x586a71=_[_0x6c4d('0x3d')]({},_0x586a71,_0x13dde2[_0x6c4d('0x3e')]);return db[_0x6c4d('0x2d')][_0x6c4d('0x48')](_0x586a71)[_0x6c4d('0x25')](handleEntityNotFound(_0x21088d,null))[_0x6c4d('0x25')](respondWithResult(_0x21088d,null))['catch'](handleError(_0x21088d,null));};exports[_0x6c4d('0x49')]=function(_0x578311,_0x83d9f7){return db[_0x6c4d('0x2d')][_0x6c4d('0x49')](_0x578311[_0x6c4d('0x4a')],{})['then'](respondWithResult(_0x83d9f7,0xc9))[_0x6c4d('0x43')](handleError(_0x83d9f7,null));};exports['update']=function(_0x37b4cb,_0x569e30){if(_0x37b4cb[_0x6c4d('0x4a')]['id']){delete _0x37b4cb[_0x6c4d('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0x6c4d('0x48')]({'where':{'id':_0x37b4cb[_0x6c4d('0x45')]['id']}})[_0x6c4d('0x25')](handleEntityNotFound(_0x569e30,null))[_0x6c4d('0x25')](saveUpdates(_0x37b4cb[_0x6c4d('0x4a')],null))[_0x6c4d('0x25')](respondWithResult(_0x569e30,null))[_0x6c4d('0x43')](handleError(_0x569e30,null));};exports[_0x6c4d('0x26')]=function(_0x240403,_0x2c9733){return db[_0x6c4d('0x2d')][_0x6c4d('0x48')]({'where':{'id':_0x240403[_0x6c4d('0x45')]['id']}})[_0x6c4d('0x25')](handleEntityNotFound(_0x2c9733,null))[_0x6c4d('0x25')](removeEntity(_0x2c9733,null))[_0x6c4d('0x43')](handleError(_0x2c9733,null));};exports[_0x6c4d('0x4b')]=function(_0xf886fe,_0x59cb04){return db[_0x6c4d('0x2d')]['describe']()[_0x6c4d('0x25')](respondWithResult(_0x59cb04,null))[_0x6c4d('0x43')](handleError(_0x59cb04,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 397ec11..f2de622 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 _0x08e4=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','lodash','util','api'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x08e4,0x168));var _0x408e=function(_0x5cdaed,_0x306a85){_0x5cdaed=_0x5cdaed-0x0;var _0x5d8c01=_0x08e4[_0x5cdaed];return _0x5d8c01;};'use strict';var _=require(_0x408e('0x0'));var util=require(_0x408e('0x1'));var logger=require('../../config/logger')(_0x408e('0x2'));var moment=require(_0x408e('0x3'));var BPromise=require(_0x408e('0x4'));var rp=require(_0x408e('0x5'));var fs=require('fs');var path=require(_0x408e('0x6'));var rimraf=require('rimraf');var config=require(_0x408e('0x7'));var attributes=require(_0x408e('0x8'));module[_0x408e('0x9')]=function(_0x50d3bd,_0x4837af){return _0x50d3bd[_0x408e('0xa')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3317=['util','../../config/logger','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x3317,0xdb));var _0x7331=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x3317[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x7331('0x0'));var util=require(_0x7331('0x1'));var logger=require(_0x7331('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7331('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7331('0x4'));var rimraf=require(_0x7331('0x5'));var config=require('../../config/environment');var attributes=require(_0x7331('0x6'));module[_0x7331('0x7')]=function(_0x3f1f3f,_0x56666e){return _0x3f1f3f[_0x7331('0x8')](_0x7331('0x9'),attributes,{'tableName':_0x7331('0xa'),'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 f810fec..5580d1e 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 _0xfd7f=['moment','bluebird','../../config/utils','rpc','http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x44c466,_0x426234){var _0x489c46=function(_0x4c548f){while(--_0x4c548f){_0x44c466['push'](_0x44c466['shift']());}};_0x489c46(++_0x426234);}(_0xfd7f,0x99));var _0xffd7=function(_0x1b0307,_0x4336b1){_0x1b0307=_0x1b0307-0x0;var _0x5c8d34=_0xfd7f[_0x1b0307];return _0x5c8d34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xffd7('0x0'));var BPromise=require(_0xffd7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffd7('0x2'));var logger=require('../../config/logger')(_0xffd7('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffd7('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x166fbe,_0x5363b0,_0x18987e){return new BPromise(function(_0x5aa2e0,_0x53e5ff){return client['request'](_0x166fbe,_0x18987e)[_0xffd7('0x5')](function(_0x344647){logger['info'](_0xffd7('0x6'),_0x5363b0,_0xffd7('0x7'));logger[_0xffd7('0x8')](_0xffd7('0x9'),_0x5363b0,_0xffd7('0x7'),JSON[_0xffd7('0xa')](_0x344647));if(_0x344647[_0xffd7('0xb')]){if(_0x344647[_0xffd7('0xb')][_0xffd7('0xc')]===0x1f4){logger[_0xffd7('0xb')](_0xffd7('0x6'),_0x5363b0,_0x344647['error'][_0xffd7('0xd')]);return _0x53e5ff(_0x344647[_0xffd7('0xb')][_0xffd7('0xd')]);}logger['error'](_0xffd7('0x6'),_0x5363b0,_0x344647[_0xffd7('0xb')][_0xffd7('0xd')]);return _0x5aa2e0(_0x344647[_0xffd7('0xb')][_0xffd7('0xd')]);}else{logger[_0xffd7('0xe')](_0xffd7('0x6'),_0x5363b0,_0xffd7('0x7'));_0x5aa2e0(_0x344647[_0xffd7('0xf')][_0xffd7('0xd')]);}})[_0xffd7('0x10')](function(_0x575659){logger[_0xffd7('0xb')](_0xffd7('0x6'),_0x5363b0,_0x575659);_0x53e5ff(_0x575659);});});} \ No newline at end of file +var _0x2a40=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2a40,0xf5));var _0x02a4=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x2a40[_0x562faa];return _0xc70f59;};'use strict';var _=require(_0x02a4('0x0'));var util=require(_0x02a4('0x1'));var moment=require(_0x02a4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02a4('0x3'));var db=require(_0x02a4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x02a4('0x5'))(_0x02a4('0x6'));var config=require(_0x02a4('0x7'));var jayson=require(_0x02a4('0x8'));var client=jayson[_0x02a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x655e9b,_0x1ee8ab,_0x4f0bac){return new BPromise(function(_0x1366fb,_0x253bfa){return client['request'](_0x655e9b,_0x4f0bac)[_0x02a4('0xa')](function(_0x29f0f4){logger[_0x02a4('0xb')](_0x02a4('0xc'),_0x1ee8ab,'request\x20sent');logger[_0x02a4('0xd')](_0x02a4('0xe'),_0x1ee8ab,_0x02a4('0xf'),JSON[_0x02a4('0x10')](_0x29f0f4));if(_0x29f0f4['error']){if(_0x29f0f4[_0x02a4('0x11')][_0x02a4('0x12')]===0x1f4){logger['error'](_0x02a4('0xc'),_0x1ee8ab,_0x29f0f4[_0x02a4('0x11')][_0x02a4('0x13')]);return _0x253bfa(_0x29f0f4['error'][_0x02a4('0x13')]);}logger[_0x02a4('0x11')](_0x02a4('0xc'),_0x1ee8ab,_0x29f0f4[_0x02a4('0x11')]['message']);return _0x1366fb(_0x29f0f4[_0x02a4('0x11')][_0x02a4('0x13')]);}else{logger[_0x02a4('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ee8ab,_0x02a4('0xf'));_0x1366fb(_0x29f0f4[_0x02a4('0x14')][_0x02a4('0x13')]);}})[_0x02a4('0x15')](function(_0x2edc0d){logger[_0x02a4('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1ee8ab,_0x2edc0d);_0x253bfa(_0x2edc0d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index b9a6e64..05eed51 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 _0x55f7=['/describe','describe','/:id','isAuthenticated','show','/:id/questions','getQuestions','post','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x55f7,0x197));var _0x755f=function(_0x9da069,_0x228bee){_0x9da069=_0x9da069-0x0;var _0x25e4a0=_0x55f7[_0x9da069];return _0x25e4a0;};'use strict';var multer=require(_0x755f('0x0'));var util=require(_0x755f('0x1'));var path=require(_0x755f('0x2'));var timeout=require('connect-timeout');var express=require(_0x755f('0x3'));var router=express[_0x755f('0x4')]();var fs_extra=require(_0x755f('0x5'));var auth=require(_0x755f('0x6'));var interaction=require(_0x755f('0x7'));var config=require(_0x755f('0x8'));var controller=require(_0x755f('0x9'));router[_0x755f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x755f('0xa')](_0x755f('0xb'),auth['isAuthenticated'](),controller[_0x755f('0xc')]);router['get'](_0x755f('0xd'),auth[_0x755f('0xe')](),controller[_0x755f('0xf')]);router[_0x755f('0xa')](_0x755f('0x10'),auth[_0x755f('0xe')](),controller[_0x755f('0x11')]);router[_0x755f('0x12')]('/',auth[_0x755f('0xe')](),controller['create']);router[_0x755f('0x13')](_0x755f('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x755f('0x14')](_0x755f('0xd'),auth[_0x755f('0xe')](),controller[_0x755f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x164f=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/questions','getQuestions','post','create','update','delete'];(function(_0x1e4454,_0x2bfd7f){var _0x119ddd=function(_0x45c797){while(--_0x45c797){_0x1e4454['push'](_0x1e4454['shift']());}};_0x119ddd(++_0x2bfd7f);}(_0x164f,0x1e3));var _0xf164=function(_0x1b8a04,_0x1bb154){_0x1b8a04=_0x1b8a04-0x0;var _0x4f6b96=_0x164f[_0x1b8a04];return _0x4f6b96;};'use strict';var multer=require(_0xf164('0x0'));var util=require(_0xf164('0x1'));var path=require(_0xf164('0x2'));var timeout=require(_0xf164('0x3'));var express=require(_0xf164('0x4'));var router=express[_0xf164('0x5')]();var fs_extra=require(_0xf164('0x6'));var auth=require(_0xf164('0x7'));var interaction=require(_0xf164('0x8'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xf164('0x9')]('/',auth['isAuthenticated'](),controller[_0xf164('0xa')]);router[_0xf164('0x9')](_0xf164('0xb'),auth[_0xf164('0xc')](),controller[_0xf164('0xd')]);router[_0xf164('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf164('0xe')]);router[_0xf164('0x9')](_0xf164('0xf'),auth[_0xf164('0xc')](),controller[_0xf164('0x10')]);router[_0xf164('0x11')]('/',auth['isAuthenticated'](),controller[_0xf164('0x12')]);router['put']('/:id',auth[_0xf164('0xc')](),controller[_0xf164('0x13')]);router[_0xf164('0x14')](_0xf164('0x15'),auth[_0xf164('0xc')](),controller[_0xf164('0x16')]);module[_0xf164('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 fbf92a1..5264a6a 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 _0x6d78=['DATE','STRING','moment','sequelize','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f1f48,_0x42d69d){var _0x239bad=function(_0x38c6e9){while(--_0x38c6e9){_0x3f1f48['push'](_0x3f1f48['shift']());}};_0x239bad(++_0x42d69d);}(_0x6d78,0x1c9));var _0x86d7=function(_0x1bc9a2,_0x3ddf39){_0x1bc9a2=_0x1bc9a2-0x0;var _0x3f16e7=_0x6d78[_0x1bc9a2];return _0x3f16e7;};'use strict';var moment=require(_0x86d7('0x0'));var Sequelize=require(_0x86d7('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5c9ae2){this['setDataValue'](_0x86d7('0x2'),_0x5c9ae2);this['setDataValue'](_0x86d7('0x3'),moment()['format'](_0x86d7('0x4')));}},'endtime':{'type':Sequelize[_0x86d7('0x5')]},'membername':{'type':Sequelize[_0x86d7('0x6')]},'projectname':{'type':Sequelize[_0x86d7('0x6')]},'queue':{'type':Sequelize[_0x86d7('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x86d7('0x6')]},'calleridnum':{'type':Sequelize[_0x86d7('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0e38=['DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize'];(function(_0x1520e3,_0x2ecaa2){var _0x1110f0=function(_0x587000){while(--_0x587000){_0x1520e3['push'](_0x1520e3['shift']());}};_0x1110f0(++_0x2ecaa2);}(_0x0e38,0x15f));var _0x80e3=function(_0xa6f5ed,_0x5259d8){_0xa6f5ed=_0xa6f5ed-0x0;var _0x5e4053=_0x0e38[_0xa6f5ed];return _0x5e4053;};'use strict';var moment=require('moment');var Sequelize=require(_0x80e3('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x80e3('0x1')],'set':function(_0x5289fa){this['setDataValue'](_0x80e3('0x2'),_0x5289fa);this[_0x80e3('0x3')](_0x80e3('0x4'),moment()['format'](_0x80e3('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x80e3('0x6')]},'projectname':{'type':Sequelize[_0x80e3('0x6')]},'queue':{'type':Sequelize[_0x80e3('0x6')]},'uniqueid':{'type':Sequelize[_0x80e3('0x6')]},'calleridname':{'type':Sequelize[_0x80e3('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x80e3('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 46dc687..3d02599 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 _0x0800=['error','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','getQuestions','findOne','pick','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy'];(function(_0x96c72,_0x581cfb){var _0x4868a6=function(_0x1185a8){while(--_0x1185a8){_0x96c72['push'](_0x96c72['shift']());}};_0x4868a6(++_0x581cfb);}(_0x0800,0x11c));var _0x0080=function(_0x1d0645,_0x480b38){_0x1d0645=_0x1d0645-0x0;var _0x46f0b3=_0x0800[_0x1d0645];return _0x46f0b3;};'use strict';var emlformat=require(_0x0080('0x0'));var rimraf=require(_0x0080('0x1'));var zipdir=require(_0x0080('0x2'));var jsonpatch=require(_0x0080('0x3'));var rp=require(_0x0080('0x4'));var moment=require(_0x0080('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0080('0x6'));var util=require(_0x0080('0x7'));var path=require(_0x0080('0x8'));var sox=require('sox');var csv=require(_0x0080('0x9'));var ejs=require(_0x0080('0xa'));var fs=require('fs');var fs_extra=require(_0x0080('0xb'));var _=require(_0x0080('0xc'));var squel=require(_0x0080('0xd'));var crypto=require(_0x0080('0xe'));var jsforce=require(_0x0080('0xf'));var deskjs=require(_0x0080('0x10'));var toCsv=require(_0x0080('0x9'));var querystring=require(_0x0080('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0080('0x12'));var qs=require(_0x0080('0x13'));var as=require(_0x0080('0x14'));var hardwareService=require(_0x0080('0x15'));var logger=require(_0x0080('0x16'))(_0x0080('0x17'));var utils=require(_0x0080('0x18'));var config=require(_0x0080('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0080('0x1a'))['db'];function respondWithStatusCode(_0x4f8983,_0x74bc1f){_0x74bc1f=_0x74bc1f||0xcc;return function(_0xbacdb2){if(_0xbacdb2){return _0x4f8983[_0x0080('0x1b')](_0x74bc1f);}return _0x4f8983[_0x0080('0x1c')](_0x74bc1f)[_0x0080('0x1d')]();};}function respondWithResult(_0x5ca565,_0x4246ea){_0x4246ea=_0x4246ea||0xc8;return function(_0x1f5124){if(_0x1f5124){return _0x5ca565[_0x0080('0x1c')](_0x4246ea)[_0x0080('0x1e')](_0x1f5124);}};}function respondWithFilteredResult(_0x5922c0,_0x518c45){return function(_0x4c8255){if(_0x4c8255){var _0x1c871f=typeof _0x518c45['offset']===_0x0080('0x1f')&&typeof _0x518c45[_0x0080('0x20')]===_0x0080('0x1f');var _0x16e47d=_0x4c8255[_0x0080('0x21')];var _0x4b04aa=_0x1c871f?0x0:_0x518c45['offset'];var _0x2ed275=_0x1c871f?_0x4c8255['count']:_0x518c45[_0x0080('0x22')]+_0x518c45['limit'];var _0x4d8ee6;if(_0x2ed275>=_0x16e47d){_0x2ed275=_0x16e47d;_0x4d8ee6=0xc8;}else{_0x4d8ee6=0xce;}_0x5922c0[_0x0080('0x1c')](_0x4d8ee6);return _0x5922c0['set']('Content-Range',_0x4b04aa+'-'+_0x2ed275+'/'+_0x16e47d)['json'](_0x4c8255);}return null;};}function patchUpdates(_0x267901){return function(_0x2f74dc){try{jsonpatch['apply'](_0x2f74dc,_0x267901,!![]);}catch(_0x159ce8){return BPromise[_0x0080('0x23')](_0x159ce8);}return _0x2f74dc[_0x0080('0x24')]();};}function saveUpdates(_0x542879,_0x736e59){return function(_0x47f7fd){if(_0x47f7fd){return _0x47f7fd[_0x0080('0x25')](_0x542879)[_0x0080('0x26')](function(_0x5722ea){return _0x5722ea;});}return null;};}function removeEntity(_0xe2c59,_0x2669a1){return function(_0xdd1da){if(_0xdd1da){return _0xdd1da[_0x0080('0x27')]()[_0x0080('0x26')](function(){_0xe2c59[_0x0080('0x1c')](0xcc)[_0x0080('0x1d')]();});}};}function handleEntityNotFound(_0x916d0f,_0x3a474b){return function(_0x2c913a){if(!_0x2c913a){_0x916d0f['sendStatus'](0x194);}return _0x2c913a;};}function handleError(_0x46c73f,_0x4714d0){_0x4714d0=_0x4714d0||0x1f4;return function(_0x1c9132){logger[_0x0080('0x28')](_0x1c9132['stack']);if(_0x1c9132[_0x0080('0x29')]){delete _0x1c9132[_0x0080('0x29')];}_0x46c73f[_0x0080('0x1c')](_0x4714d0)['send'](_0x1c9132);};}exports[_0x0080('0x2a')]=function(_0x421bbe,_0x339b8c){var _0x30916b={},_0x5dc131={},_0x1f6070={'count':0x0,'rows':[]};var _0x39aed2=_[_0x0080('0x2b')](db[_0x0080('0x2c')][_0x0080('0x2d')],function(_0x52aec3){return{'name':_0x52aec3[_0x0080('0x2e')],'type':_0x52aec3[_0x0080('0x2f')][_0x0080('0x30')]};});_0x5dc131[_0x0080('0x31')]=_[_0x0080('0x2b')](_0x39aed2,'name');_0x5dc131[_0x0080('0x32')]=_[_0x0080('0x33')](_0x421bbe['query']);_0x5dc131[_0x0080('0x34')]=_[_0x0080('0x35')](_0x5dc131[_0x0080('0x31')],_0x5dc131[_0x0080('0x32')]);_0x30916b[_0x0080('0x36')]=_[_0x0080('0x35')](_0x5dc131[_0x0080('0x31')],qs[_0x0080('0x37')](_0x421bbe[_0x0080('0x32')]['fields']));_0x30916b[_0x0080('0x36')]=_0x30916b[_0x0080('0x36')][_0x0080('0x38')]?_0x30916b[_0x0080('0x36')]:_0x5dc131[_0x0080('0x31')];if(!_0x421bbe[_0x0080('0x32')][_0x0080('0x39')](_0x0080('0x3a'))){_0x30916b[_0x0080('0x20')]=qs['limit'](_0x421bbe['query']['limit']);_0x30916b[_0x0080('0x22')]=qs[_0x0080('0x22')](_0x421bbe['query'][_0x0080('0x22')]);}_0x30916b[_0x0080('0x3b')]=qs[_0x0080('0x3c')](_0x421bbe['query'][_0x0080('0x3c')]);_0x30916b[_0x0080('0x3d')]=qs[_0x0080('0x34')](_['pick'](_0x421bbe[_0x0080('0x32')],_0x5dc131[_0x0080('0x34')]),_0x39aed2);if(_0x421bbe[_0x0080('0x32')][_0x0080('0x3e')]){_0x30916b[_0x0080('0x3d')]=_[_0x0080('0x3f')](_0x30916b['where'],{'$or':_[_0x0080('0x2b')](_0x39aed2,function(_0x25a298){if(_0x25a298[_0x0080('0x2f')]!==_0x0080('0x40')){var _0x472544={};_0x472544[_0x25a298[_0x0080('0x29')]]={'$like':'%'+_0x421bbe['query']['filter']+'%'};return _0x472544;}})});}_0x30916b=_[_0x0080('0x3f')]({},_0x30916b,_0x421bbe[_0x0080('0x41')]);var _0x5d16e4={'where':_0x30916b[_0x0080('0x3d')]};return db[_0x0080('0x2c')][_0x0080('0x21')](_0x5d16e4)[_0x0080('0x26')](function(_0x4bfe04){_0x1f6070['count']=_0x4bfe04;if(_0x421bbe[_0x0080('0x32')][_0x0080('0x42')]){_0x30916b[_0x0080('0x43')]=[{'all':!![]}];}return db[_0x0080('0x2c')][_0x0080('0x44')](_0x30916b);})[_0x0080('0x26')](function(_0x5dcbbe){_0x1f6070[_0x0080('0x45')]=_0x5dcbbe;return _0x1f6070;})['then'](respondWithFilteredResult(_0x339b8c,_0x30916b))[_0x0080('0x46')](handleError(_0x339b8c,null));};exports['show']=function(_0x5c8159,_0x47c3f7){var _0x39557d={'raw':!![],'where':{'id':_0x5c8159[_0x0080('0x47')]['id']}},_0x46f6c3={};_0x46f6c3[_0x0080('0x31')]=_[_0x0080('0x33')](db[_0x0080('0x2c')][_0x0080('0x2d')]);_0x46f6c3['query']=_['keys'](_0x5c8159[_0x0080('0x32')]);_0x46f6c3[_0x0080('0x34')]=_[_0x0080('0x35')](_0x46f6c3['model'],_0x46f6c3['query']);_0x39557d[_0x0080('0x36')]=_[_0x0080('0x35')](_0x46f6c3[_0x0080('0x31')],qs[_0x0080('0x37')](_0x5c8159[_0x0080('0x32')][_0x0080('0x37')]));_0x39557d[_0x0080('0x36')]=_0x39557d[_0x0080('0x36')][_0x0080('0x38')]?_0x39557d[_0x0080('0x36')]:_0x46f6c3[_0x0080('0x31')];if(_0x5c8159[_0x0080('0x32')][_0x0080('0x42')]){_0x39557d[_0x0080('0x43')]=[{'all':!![]}];}_0x39557d=_['merge']({},_0x39557d,_0x5c8159[_0x0080('0x41')]);return db['JscriptySessionReport'][_0x0080('0x48')](_0x39557d)['then'](handleEntityNotFound(_0x47c3f7,null))[_0x0080('0x26')](respondWithResult(_0x47c3f7,null))[_0x0080('0x46')](handleError(_0x47c3f7,null));};exports[_0x0080('0x49')]=function(_0x5c334e,_0x31bca9){return db[_0x0080('0x2c')][_0x0080('0x49')](_0x5c334e[_0x0080('0x4a')],{})[_0x0080('0x26')](respondWithResult(_0x31bca9,0xc9))[_0x0080('0x46')](handleError(_0x31bca9,null));};exports[_0x0080('0x25')]=function(_0x2184c2,_0x54fa68){if(_0x2184c2[_0x0080('0x4a')]['id']){delete _0x2184c2[_0x0080('0x4a')]['id'];}return db[_0x0080('0x2c')][_0x0080('0x48')]({'where':{'id':_0x2184c2[_0x0080('0x47')]['id']}})['then'](handleEntityNotFound(_0x54fa68,null))[_0x0080('0x26')](saveUpdates(_0x2184c2[_0x0080('0x4a')],null))['then'](respondWithResult(_0x54fa68,null))[_0x0080('0x46')](handleError(_0x54fa68,null));};exports[_0x0080('0x27')]=function(_0x25afca,_0x327517){return db['JscriptySessionReport']['find']({'where':{'id':_0x25afca[_0x0080('0x47')]['id']}})[_0x0080('0x26')](handleEntityNotFound(_0x327517,null))[_0x0080('0x26')](removeEntity(_0x327517,null))[_0x0080('0x46')](handleError(_0x327517,null));};exports[_0x0080('0x4b')]=function(_0x323532,_0x157ba5){return db[_0x0080('0x2c')][_0x0080('0x4b')]()[_0x0080('0x26')](respondWithResult(_0x157ba5,null))['catch'](handleError(_0x157ba5,null));};exports[_0x0080('0x4c')]=function(_0xd1cd26,_0x1d3a16,_0x1df019){var _0x18bda2={'raw':!![],'where':{}};var _0x4452ff={};var _0x2c2901={'count':0x0,'rows':[]};return db[_0x0080('0x2c')][_0x0080('0x4d')]({'where':{'id':_0xd1cd26['params']['id']}})[_0x0080('0x26')](handleEntityNotFound(_0x1d3a16,null))['then'](function(_0x19ad5d){if(_0x19ad5d){_0x4452ff[_0x0080('0x31')]=_[_0x0080('0x33')](db['JscriptyQuestionReport'][_0x0080('0x2d')]);_0x4452ff[_0x0080('0x32')]=_[_0x0080('0x33')](_0xd1cd26[_0x0080('0x32')]);_0x4452ff[_0x0080('0x34')]=_[_0x0080('0x35')](_0x4452ff['model'],_0x4452ff[_0x0080('0x32')]);_0x18bda2['attributes']=_[_0x0080('0x35')](_0x4452ff['model'],qs[_0x0080('0x37')](_0xd1cd26[_0x0080('0x32')][_0x0080('0x37')]));_0x18bda2['attributes']=_0x18bda2[_0x0080('0x36')][_0x0080('0x38')]?_0x18bda2[_0x0080('0x36')]:_0x4452ff['model'];if(!_0xd1cd26['query']['hasOwnProperty']('nolimit')){_0x18bda2['limit']=qs['limit'](_0xd1cd26[_0x0080('0x32')]['limit']);_0x18bda2['offset']=qs[_0x0080('0x22')](_0xd1cd26['query']['offset']);}_0x18bda2['order']=qs[_0x0080('0x3c')](_0xd1cd26[_0x0080('0x32')][_0x0080('0x3c')]);_0x18bda2[_0x0080('0x3d')]=qs[_0x0080('0x34')](_[_0x0080('0x4e')](_0xd1cd26['query'],_0x4452ff['filters']));_0x18bda2[_0x0080('0x3d')][_0x0080('0x4f')]=_0x19ad5d['id'];if(_0xd1cd26[_0x0080('0x32')]['filter']){_0x18bda2[_0x0080('0x3d')]=_['merge'](_0x18bda2['where'],{'$or':_[_0x0080('0x2b')](_0x18bda2[_0x0080('0x36')],function(_0x5652f3){var _0x1ed2b1={};_0x1ed2b1[_0x5652f3]={'$like':'%'+_0xd1cd26[_0x0080('0x32')]['filter']+'%'};return _0x1ed2b1;})});}_0x18bda2=_[_0x0080('0x3f')]({},_0x18bda2,_0xd1cd26[_0x0080('0x41')]);return db[_0x0080('0x50')]['count']({'where':_0x18bda2[_0x0080('0x3d')]})[_0x0080('0x26')](function(_0x54943c){_0x2c2901['count']=_0x54943c;if(_0xd1cd26[_0x0080('0x32')]['includeAll']){_0x18bda2['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0080('0x44')](_0x18bda2);})[_0x0080('0x26')](function(_0x3c09d1){_0x2c2901['rows']=_0x3c09d1;return _0x2c2901;});}})['then'](respondWithFilteredResult(_0x1d3a16,_0x18bda2))[_0x0080('0x46')](handleError(_0x1d3a16,null));}; \ No newline at end of file +var _0x064e=['save','update','destroy','then','error','index','JscriptySessionReport','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','filters','includeAll','options','find','create','body','describe','getQuestions','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','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','sendStatus','status','end','undefined','limit','count','offset','apply','reject'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x064e,0x7b));var _0xe064=function(_0x94dbe9,_0x136917){_0x94dbe9=_0x94dbe9-0x0;var _0x188142=_0x064e[_0x94dbe9];return _0x188142;};'use strict';var emlformat=require(_0xe064('0x0'));var rimraf=require(_0xe064('0x1'));var zipdir=require(_0xe064('0x2'));var jsonpatch=require(_0xe064('0x3'));var rp=require(_0xe064('0x4'));var moment=require(_0xe064('0x5'));var BPromise=require(_0xe064('0x6'));var Mustache=require(_0xe064('0x7'));var util=require(_0xe064('0x8'));var path=require('path');var sox=require(_0xe064('0x9'));var csv=require(_0xe064('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe064('0xb'));var _=require('lodash');var squel=require(_0xe064('0xc'));var crypto=require(_0xe064('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe064('0xe'));var toCsv=require(_0xe064('0xa'));var querystring=require(_0xe064('0xf'));var Papa=require(_0xe064('0x10'));var Redis=require('ioredis');var authService=require(_0xe064('0x11'));var qs=require(_0xe064('0x12'));var as=require(_0xe064('0x13'));var hardwareService=require(_0xe064('0x14'));var logger=require('../../config/logger')(_0xe064('0x15'));var utils=require(_0xe064('0x16'));var config=require(_0xe064('0x17'));var licenseUtil=require(_0xe064('0x18'));var db=require(_0xe064('0x19'))['db'];function respondWithStatusCode(_0x4e0f65,_0x23a976){_0x23a976=_0x23a976||0xcc;return function(_0x22244b){if(_0x22244b){return _0x4e0f65[_0xe064('0x1a')](_0x23a976);}return _0x4e0f65[_0xe064('0x1b')](_0x23a976)[_0xe064('0x1c')]();};}function respondWithResult(_0x4b6231,_0x26e3b7){_0x26e3b7=_0x26e3b7||0xc8;return function(_0x4ccab0){if(_0x4ccab0){return _0x4b6231[_0xe064('0x1b')](_0x26e3b7)['json'](_0x4ccab0);}};}function respondWithFilteredResult(_0x5c4003,_0x305ce2){return function(_0x22f402){if(_0x22f402){var _0xc65780=typeof _0x305ce2['offset']===_0xe064('0x1d')&&typeof _0x305ce2[_0xe064('0x1e')]==='undefined';var _0x3ac227=_0x22f402[_0xe064('0x1f')];var _0x3cac20=_0xc65780?0x0:_0x305ce2[_0xe064('0x20')];var _0x4a77da=_0xc65780?_0x22f402['count']:_0x305ce2['offset']+_0x305ce2[_0xe064('0x1e')];var _0x49e729;if(_0x4a77da>=_0x3ac227){_0x4a77da=_0x3ac227;_0x49e729=0xc8;}else{_0x49e729=0xce;}_0x5c4003[_0xe064('0x1b')](_0x49e729);return _0x5c4003['set']('Content-Range',_0x3cac20+'-'+_0x4a77da+'/'+_0x3ac227)['json'](_0x22f402);}return null;};}function patchUpdates(_0x496f06){return function(_0x5a5280){try{jsonpatch[_0xe064('0x21')](_0x5a5280,_0x496f06,!![]);}catch(_0x1e57d8){return BPromise[_0xe064('0x22')](_0x1e57d8);}return _0x5a5280[_0xe064('0x23')]();};}function saveUpdates(_0x2ca0ae,_0x32e422){return function(_0x2c5002){if(_0x2c5002){return _0x2c5002[_0xe064('0x24')](_0x2ca0ae)['then'](function(_0x556cbe){return _0x556cbe;});}return null;};}function removeEntity(_0xf36b3b,_0x4762de){return function(_0x3c8677){if(_0x3c8677){return _0x3c8677[_0xe064('0x25')]()[_0xe064('0x26')](function(){_0xf36b3b['status'](0xcc)[_0xe064('0x1c')]();});}};}function handleEntityNotFound(_0x2044b4,_0xba5b11){return function(_0x188b55){if(!_0x188b55){_0x2044b4[_0xe064('0x1a')](0x194);}return _0x188b55;};}function handleError(_0x1a9ae4,_0x1e7825){_0x1e7825=_0x1e7825||0x1f4;return function(_0x2a094b){logger[_0xe064('0x27')](_0x2a094b['stack']);if(_0x2a094b['name']){delete _0x2a094b['name'];}_0x1a9ae4[_0xe064('0x1b')](_0x1e7825)['send'](_0x2a094b);};}exports[_0xe064('0x28')]=function(_0x319619,_0x56e2cb){var _0xa3df47={},_0x1d6a71={},_0x5887ba={'count':0x0,'rows':[]};var _0x39a4d4=_['map'](db[_0xe064('0x29')][_0xe064('0x2a')],function(_0x5d425e){return{'name':_0x5d425e[_0xe064('0x2b')],'type':_0x5d425e[_0xe064('0x2c')]['key']};});_0x1d6a71[_0xe064('0x2d')]=_[_0xe064('0x2e')](_0x39a4d4,_0xe064('0x2f'));_0x1d6a71[_0xe064('0x30')]=_[_0xe064('0x31')](_0x319619[_0xe064('0x30')]);_0x1d6a71['filters']=_[_0xe064('0x32')](_0x1d6a71[_0xe064('0x2d')],_0x1d6a71['query']);_0xa3df47['attributes']=_[_0xe064('0x32')](_0x1d6a71[_0xe064('0x2d')],qs['fields'](_0x319619[_0xe064('0x30')][_0xe064('0x33')]));_0xa3df47[_0xe064('0x34')]=_0xa3df47[_0xe064('0x34')][_0xe064('0x35')]?_0xa3df47['attributes']:_0x1d6a71[_0xe064('0x2d')];if(!_0x319619['query'][_0xe064('0x36')](_0xe064('0x37'))){_0xa3df47[_0xe064('0x1e')]=qs['limit'](_0x319619[_0xe064('0x30')][_0xe064('0x1e')]);_0xa3df47[_0xe064('0x20')]=qs[_0xe064('0x20')](_0x319619[_0xe064('0x30')][_0xe064('0x20')]);}_0xa3df47[_0xe064('0x38')]=qs[_0xe064('0x39')](_0x319619[_0xe064('0x30')][_0xe064('0x39')]);_0xa3df47[_0xe064('0x3a')]=qs['filters'](_[_0xe064('0x3b')](_0x319619[_0xe064('0x30')],_0x1d6a71['filters']),_0x39a4d4);if(_0x319619[_0xe064('0x30')][_0xe064('0x3c')]){_0xa3df47[_0xe064('0x3a')]=_['merge'](_0xa3df47[_0xe064('0x3a')],{'$or':_['map'](_0x39a4d4,function(_0x2364ae){if(_0x2364ae['type']!==_0xe064('0x3d')){var _0x20ea3c={};_0x20ea3c[_0x2364ae['name']]={'$like':'%'+_0x319619['query'][_0xe064('0x3c')]+'%'};return _0x20ea3c;}})});}_0xa3df47=_[_0xe064('0x3e')]({},_0xa3df47,_0x319619['options']);var _0x53f535={'where':_0xa3df47[_0xe064('0x3a')]};return db[_0xe064('0x29')][_0xe064('0x1f')](_0x53f535)[_0xe064('0x26')](function(_0x23adf2){_0x5887ba[_0xe064('0x1f')]=_0x23adf2;if(_0x319619[_0xe064('0x30')]['includeAll']){_0xa3df47[_0xe064('0x3f')]=[{'all':!![]}];}return db[_0xe064('0x29')][_0xe064('0x40')](_0xa3df47);})[_0xe064('0x26')](function(_0x3e2f00){_0x5887ba[_0xe064('0x41')]=_0x3e2f00;return _0x5887ba;})[_0xe064('0x26')](respondWithFilteredResult(_0x56e2cb,_0xa3df47))[_0xe064('0x42')](handleError(_0x56e2cb,null));};exports[_0xe064('0x43')]=function(_0x2a9821,_0x278ea6){var _0x8895d6={'raw':!![],'where':{'id':_0x2a9821[_0xe064('0x44')]['id']}},_0x1bf89e={};_0x1bf89e[_0xe064('0x2d')]=_['keys'](db[_0xe064('0x29')][_0xe064('0x2a')]);_0x1bf89e[_0xe064('0x30')]=_['keys'](_0x2a9821['query']);_0x1bf89e[_0xe064('0x45')]=_[_0xe064('0x32')](_0x1bf89e[_0xe064('0x2d')],_0x1bf89e[_0xe064('0x30')]);_0x8895d6[_0xe064('0x34')]=_['intersection'](_0x1bf89e[_0xe064('0x2d')],qs[_0xe064('0x33')](_0x2a9821[_0xe064('0x30')][_0xe064('0x33')]));_0x8895d6[_0xe064('0x34')]=_0x8895d6[_0xe064('0x34')][_0xe064('0x35')]?_0x8895d6[_0xe064('0x34')]:_0x1bf89e[_0xe064('0x2d')];if(_0x2a9821['query'][_0xe064('0x46')]){_0x8895d6[_0xe064('0x3f')]=[{'all':!![]}];}_0x8895d6=_['merge']({},_0x8895d6,_0x2a9821[_0xe064('0x47')]);return db[_0xe064('0x29')][_0xe064('0x48')](_0x8895d6)[_0xe064('0x26')](handleEntityNotFound(_0x278ea6,null))['then'](respondWithResult(_0x278ea6,null))[_0xe064('0x42')](handleError(_0x278ea6,null));};exports['create']=function(_0x2803ca,_0x2a2b7e){return db['JscriptySessionReport'][_0xe064('0x49')](_0x2803ca[_0xe064('0x4a')],{})[_0xe064('0x26')](respondWithResult(_0x2a2b7e,0xc9))['catch'](handleError(_0x2a2b7e,null));};exports[_0xe064('0x24')]=function(_0x3c104b,_0x5f2fee){if(_0x3c104b[_0xe064('0x4a')]['id']){delete _0x3c104b[_0xe064('0x4a')]['id'];}return db[_0xe064('0x29')][_0xe064('0x48')]({'where':{'id':_0x3c104b['params']['id']}})['then'](handleEntityNotFound(_0x5f2fee,null))[_0xe064('0x26')](saveUpdates(_0x3c104b[_0xe064('0x4a')],null))[_0xe064('0x26')](respondWithResult(_0x5f2fee,null))['catch'](handleError(_0x5f2fee,null));};exports[_0xe064('0x25')]=function(_0x39ecf6,_0x5246f4){return db['JscriptySessionReport'][_0xe064('0x48')]({'where':{'id':_0x39ecf6[_0xe064('0x44')]['id']}})[_0xe064('0x26')](handleEntityNotFound(_0x5246f4,null))[_0xe064('0x26')](removeEntity(_0x5246f4,null))[_0xe064('0x42')](handleError(_0x5246f4,null));};exports[_0xe064('0x4b')]=function(_0x5cfe5d,_0x5483b6){return db[_0xe064('0x29')][_0xe064('0x4b')]()['then'](respondWithResult(_0x5483b6,null))['catch'](handleError(_0x5483b6,null));};exports[_0xe064('0x4c')]=function(_0x5982cc,_0xdbc0b,_0x116d35){var _0x2b2c98={'raw':!![],'where':{}};var _0x1057e6={};var _0x515507={'count':0x0,'rows':[]};return db[_0xe064('0x29')]['findOne']({'where':{'id':_0x5982cc[_0xe064('0x44')]['id']}})[_0xe064('0x26')](handleEntityNotFound(_0xdbc0b,null))['then'](function(_0x42eab9){if(_0x42eab9){_0x1057e6[_0xe064('0x2d')]=_[_0xe064('0x31')](db[_0xe064('0x4d')][_0xe064('0x2a')]);_0x1057e6[_0xe064('0x30')]=_[_0xe064('0x31')](_0x5982cc[_0xe064('0x30')]);_0x1057e6['filters']=_['intersection'](_0x1057e6[_0xe064('0x2d')],_0x1057e6[_0xe064('0x30')]);_0x2b2c98[_0xe064('0x34')]=_[_0xe064('0x32')](_0x1057e6['model'],qs['fields'](_0x5982cc[_0xe064('0x30')][_0xe064('0x33')]));_0x2b2c98[_0xe064('0x34')]=_0x2b2c98[_0xe064('0x34')][_0xe064('0x35')]?_0x2b2c98[_0xe064('0x34')]:_0x1057e6[_0xe064('0x2d')];if(!_0x5982cc[_0xe064('0x30')][_0xe064('0x36')](_0xe064('0x37'))){_0x2b2c98['limit']=qs[_0xe064('0x1e')](_0x5982cc['query'][_0xe064('0x1e')]);_0x2b2c98[_0xe064('0x20')]=qs[_0xe064('0x20')](_0x5982cc['query'][_0xe064('0x20')]);}_0x2b2c98[_0xe064('0x38')]=qs['sort'](_0x5982cc['query'][_0xe064('0x39')]);_0x2b2c98[_0xe064('0x3a')]=qs[_0xe064('0x45')](_['pick'](_0x5982cc[_0xe064('0x30')],_0x1057e6[_0xe064('0x45')]));_0x2b2c98[_0xe064('0x3a')][_0xe064('0x4e')]=_0x42eab9['id'];if(_0x5982cc[_0xe064('0x30')][_0xe064('0x3c')]){_0x2b2c98[_0xe064('0x3a')]=_[_0xe064('0x3e')](_0x2b2c98['where'],{'$or':_[_0xe064('0x2e')](_0x2b2c98[_0xe064('0x34')],function(_0x58280f){var _0x22549d={};_0x22549d[_0x58280f]={'$like':'%'+_0x5982cc['query'][_0xe064('0x3c')]+'%'};return _0x22549d;})});}_0x2b2c98=_[_0xe064('0x3e')]({},_0x2b2c98,_0x5982cc[_0xe064('0x47')]);return db[_0xe064('0x4d')][_0xe064('0x1f')]({'where':_0x2b2c98[_0xe064('0x3a')]})[_0xe064('0x26')](function(_0x4a4a90){_0x515507[_0xe064('0x1f')]=_0x4a4a90;if(_0x5982cc['query'][_0xe064('0x46')]){_0x2b2c98['include']=[{'all':!![]}];}return db[_0xe064('0x4d')][_0xe064('0x40')](_0x2b2c98);})[_0xe064('0x26')](function(_0xc58394){_0x515507[_0xe064('0x41')]=_0xc58394;return _0x515507;});}})['then'](respondWithFilteredResult(_0xdbc0b,_0x2b2c98))['catch'](handleError(_0xdbc0b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2d9d1a2..1ecfd31 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 _0x326f=['report_jscripty_sessions','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x4f1957,_0x5bcbdf){var _0x47e845=function(_0x180876){while(--_0x180876){_0x4f1957['push'](_0x4f1957['shift']());}};_0x47e845(++_0x5bcbdf);}(_0x326f,0xd1));var _0xf326=function(_0x1bbf0c,_0x27fb89){_0x1bbf0c=_0x1bbf0c-0x0;var _0x4b20e8=_0x326f[_0x1bbf0c];return _0x4b20e8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x40921e,_0x6ca193){var _0x3c1dac=function(_0x3235f7){while(--_0x3235f7){_0x40921e['push'](_0x40921e['shift']());}};_0x3c1dac(++_0x6ca193);}(_0x038b,0x114));var _0xb038=function(_0x26b4fe,_0x77cce8){_0x26b4fe=_0x26b4fe-0x0;var _0xd5f3fa=_0x038b[_0x26b4fe];return _0xd5f3fa;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'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 de3b00b..dfb793a 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2a9852,_0x12f8e0){var _0x50edf3=function(_0x3b8cb6){while(--_0x3b8cb6){_0x2a9852['push'](_0x2a9852['shift']());}};_0x50edf3(++_0x12f8e0);}(_0x2ef3,0xba));var _0x32ef=function(_0x4c1a3c,_0xca5ea7){_0x4c1a3c=_0x4c1a3c-0x0;var _0x444263=_0x2ef3[_0x4c1a3c];return _0x444263;};'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')]('JscriptySessionReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x17ebae,_0x7da3){var _0x8cbe7d=function(_0x4cfdd5){while(--_0x4cfdd5){_0x17ebae['push'](_0x17ebae['shift']());}};_0x8cbe7d(++_0x7da3);}(_0x524e,0x15e));var _0xe524=function(_0x5a9b65,_0x2a2ea3){_0x5a9b65=_0x5a9b65-0x0;var _0x5770b7=_0x524e[_0x5a9b65];return _0x5770b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index cd4f972..7965248 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 _0x771d=['update','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated'];(function(_0x537ec5,_0x380dc6){var _0x2667b4=function(_0x46d933){while(--_0x46d933){_0x537ec5['push'](_0x537ec5['shift']());}};_0x2667b4(++_0x380dc6);}(_0x771d,0xdb));var _0xd771=function(_0x36fae1,_0x3e23f7){_0x36fae1=_0x36fae1-0x0;var _0x4b6ce7=_0x771d[_0x36fae1];return _0x4b6ce7;};'use strict';var multer=require(_0xd771('0x0'));var util=require(_0xd771('0x1'));var path=require(_0xd771('0x2'));var timeout=require(_0xd771('0x3'));var express=require(_0xd771('0x4'));var router=express[_0xd771('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd771('0x6'));var interaction=require(_0xd771('0x7'));var config=require(_0xd771('0x8'));var controller=require(_0xd771('0x9'));router[_0xd771('0xa')]('/',controller[_0xd771('0xb')]);router[_0xd771('0xc')](_0xd771('0xd'),auth[_0xd771('0xe')](),controller[_0xd771('0xf')]);router[_0xd771('0xa')]('/download_log_file',auth['isAuthenticated'](),controller[_0xd771('0x10')]);module[_0xd771('0x11')]=router; \ No newline at end of file +var _0x431e=['multer','util','path','connect-timeout','express','../../components/interaction/service','./license.controller','index','isAuthenticated','update','get','/download_log_file','exports'];(function(_0x297aff,_0x1987e4){var _0x3acb78=function(_0x348869){while(--_0x348869){_0x297aff['push'](_0x297aff['shift']());}};_0x3acb78(++_0x1987e4);}(_0x431e,0x12b));var _0xe431=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x431e[_0x5d61b4];return _0x183fc5;};'use strict';var multer=require(_0xe431('0x0'));var util=require(_0xe431('0x1'));var path=require(_0xe431('0x2'));var timeout=require(_0xe431('0x3'));var express=require(_0xe431('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe431('0x5'));var config=require('../../config/environment');var controller=require(_0xe431('0x6'));router['get']('/',controller[_0xe431('0x7')]);router['put']('/:id',auth[_0xe431('0x8')](),controller[_0xe431('0x9')]);router[_0xe431('0xa')](_0xe431('0xb'),auth[_0xe431('0x8')](),controller['downloadLogFile']);module[_0xe431('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e282de6..6fcb25a 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 _0x0359=['TEXT','STRING','INTEGER','sequelize'];(function(_0x404ad2,_0x42f399){var _0x34c9a2=function(_0x514172){while(--_0x514172){_0x404ad2['push'](_0x404ad2['shift']());}};_0x34c9a2(++_0x42f399);}(_0x0359,0xff));var _0x9035=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0359[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x9035('0x0'));module['exports']={'license':{'type':Sequelize[_0x9035('0x1')]},'data1':{'type':Sequelize[_0x9035('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x9035('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd298=['exports','TEXT','STRING'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xd298,0x84));var _0x8d29=function(_0x23eb36,_0x34846a){_0x23eb36=_0x23eb36-0x0;var _0x24689b=_0xd298[_0x23eb36];return _0x24689b;};'use strict';var Sequelize=require('sequelize');module[_0x8d29('0x0')]={'license':{'type':Sequelize[_0x8d29('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x8d29('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 2f39d71..1f97584 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 _0x171a=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','set','apply','reject','update','then','destroy','error','stack','name','model','keys','rawAttributes','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','get','checkLicense','demo','downloadLogFile','license-info.log','join','/var','log','xcally','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x10af80,_0x5c9c36){var _0x362586=function(_0x23b1b1){while(--_0x23b1b1){_0x10af80['push'](_0x10af80['shift']());}};_0x362586(++_0x5c9c36);}(_0x171a,0x1c4));var _0xa171=function(_0x362256,_0x4f8638){_0x362256=_0x362256-0x0;var _0xfa7997=_0x171a[_0x362256];return _0xfa7997;};'use strict';var emlformat=require(_0xa171('0x0'));var rimraf=require(_0xa171('0x1'));var zipdir=require(_0xa171('0x2'));var jsonpatch=require(_0xa171('0x3'));var rp=require('request-promise');var moment=require(_0xa171('0x4'));var BPromise=require(_0xa171('0x5'));var Mustache=require('mustache');var util=require(_0xa171('0x6'));var path=require(_0xa171('0x7'));var sox=require('sox');var csv=require(_0xa171('0x8'));var ejs=require(_0xa171('0x9'));var fs=require('fs');var fs_extra=require(_0xa171('0xa'));var _=require('lodash');var squel=require(_0xa171('0xb'));var crypto=require(_0xa171('0xc'));var jsforce=require(_0xa171('0xd'));var deskjs=require(_0xa171('0xe'));var toCsv=require(_0xa171('0x8'));var querystring=require(_0xa171('0xf'));var Papa=require(_0xa171('0x10'));var Redis=require(_0xa171('0x11'));var authService=require(_0xa171('0x12'));var qs=require(_0xa171('0x13'));var as=require(_0xa171('0x14'));var hardwareService=require(_0xa171('0x15'));var logger=require(_0xa171('0x16'))(_0xa171('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa171('0x18'));var db=require(_0xa171('0x19'))['db'];function respondWithStatusCode(_0x563246,_0x52b72b){_0x52b72b=_0x52b72b||0xcc;return function(_0x2fbdb4){if(_0x2fbdb4){return _0x563246[_0xa171('0x1a')](_0x52b72b);}return _0x563246[_0xa171('0x1b')](_0x52b72b)[_0xa171('0x1c')]();};}function respondWithResult(_0x2cdf35,_0xb2fcc2){_0xb2fcc2=_0xb2fcc2||0xc8;return function(_0x281a3b){if(_0x281a3b){return _0x2cdf35[_0xa171('0x1b')](_0xb2fcc2)[_0xa171('0x1d')](_0x281a3b);}};}function respondWithFilteredResult(_0x4cebd5,_0x44a902){return function(_0x51ffe3){if(_0x51ffe3){var _0x15c8ed=typeof _0x44a902['offset']==='undefined'&&typeof _0x44a902[_0xa171('0x1e')]==='undefined';var _0xd903fa=_0x51ffe3['count'];var _0x26bd75=_0x15c8ed?0x0:_0x44a902[_0xa171('0x1f')];var _0x3a561f=_0x15c8ed?_0x51ffe3[_0xa171('0x20')]:_0x44a902[_0xa171('0x1f')]+_0x44a902[_0xa171('0x1e')];var _0x781f50;if(_0x3a561f>=_0xd903fa){_0x3a561f=_0xd903fa;_0x781f50=0xc8;}else{_0x781f50=0xce;}_0x4cebd5[_0xa171('0x1b')](_0x781f50);return _0x4cebd5[_0xa171('0x21')]('Content-Range',_0x26bd75+'-'+_0x3a561f+'/'+_0xd903fa)[_0xa171('0x1d')](_0x51ffe3);}return null;};}function patchUpdates(_0x2aa458){return function(_0x27cab7){try{jsonpatch[_0xa171('0x22')](_0x27cab7,_0x2aa458,!![]);}catch(_0x29af50){return BPromise[_0xa171('0x23')](_0x29af50);}return _0x27cab7['save']();};}function saveUpdates(_0x1d6223,_0x10305a){return function(_0x40d5d3){if(_0x40d5d3){return _0x40d5d3[_0xa171('0x24')](_0x1d6223)[_0xa171('0x25')](function(_0x5a1491){return _0x5a1491;});}return null;};}function removeEntity(_0x2d0aea,_0x10713c){return function(_0x29283f){if(_0x29283f){return _0x29283f[_0xa171('0x26')]()[_0xa171('0x25')](function(){_0x2d0aea[_0xa171('0x1b')](0xcc)[_0xa171('0x1c')]();});}};}function handleEntityNotFound(_0x3998b2,_0xba8519){return function(_0x3ed01e){if(!_0x3ed01e){_0x3998b2[_0xa171('0x1a')](0x194);}return _0x3ed01e;};}function handleError(_0x521c99,_0xb84895){_0xb84895=_0xb84895||0x1f4;return function(_0x9b6a72){logger[_0xa171('0x27')](_0x9b6a72[_0xa171('0x28')]);if(_0x9b6a72['name']){delete _0x9b6a72[_0xa171('0x29')];}_0x521c99[_0xa171('0x1b')](_0xb84895)['send'](_0x9b6a72);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x1dbadb,_0x3e9560){var _0x2dc7b0={'raw':!![],'where':{'id':0x1}},_0x5c7df7={};_0x5c7df7[_0xa171('0x2a')]=_[_0xa171('0x2b')](db['License'][_0xa171('0x2c')]);_0x5c7df7['query']=_['keys'](_0x1dbadb[_0xa171('0x2d')]);_0x5c7df7[_0xa171('0x2e')]=_['intersection'](_0x5c7df7[_0xa171('0x2a')],_0x5c7df7['query']);_0x2dc7b0[_0xa171('0x2f')]=_[_0xa171('0x30')](_0x5c7df7[_0xa171('0x2a')],qs[_0xa171('0x31')](_0x1dbadb['query'][_0xa171('0x31')]));_0x2dc7b0['attributes']=_0x2dc7b0['attributes']['length']?_0x2dc7b0[_0xa171('0x2f')]:_0x5c7df7[_0xa171('0x2a')];_0x2dc7b0=_[_0xa171('0x32')]({},_0x2dc7b0,_0x1dbadb[_0xa171('0x33')]);return utilLicense[_0xa171('0x34')](_0x2dc7b0)['then'](respondWithResult(_0x3e9560,null))[_0xa171('0x35')](handleError(_0x3e9560,null));};exports['update']=function(_0x16eee7,_0x15ab93){if(_0x16eee7[_0xa171('0x36')]['id']){delete _0x16eee7[_0xa171('0x36')]['id'];}return db['License']['find']({'where':{'id':_0x16eee7['params']['id']}})[_0xa171('0x25')](handleEntityNotFound(_0x15ab93,null))[_0xa171('0x25')](function(_0x22cd33){var _0x150ea4=_0x22cd33[_0xa171('0x37')]({'plain':!![]});return utilLicense[_0xa171('0x38')](_0x150ea4,_0x16eee7['body']['key']);})[_0xa171('0x25')](function(_0x34c756){if(!_0x34c756[_0xa171('0x39')]){return saveUpdates(_0x16eee7['body'],null);}return _0x34c756;})[_0xa171('0x25')](respondWithResult(_0x15ab93,null))['catch'](handleError(_0x15ab93,null));};exports[_0xa171('0x3a')]=function(_0xc00001,_0x4e7f03){var _0x362b81=_0xa171('0x3b');var _0x3322fd=path[_0xa171('0x3c')](_0xa171('0x3d'),_0xa171('0x3e'),_0xa171('0x3f'),_0x362b81);_0x4e7f03['setHeader']('Content-disposition',_0xa171('0x40')+_0x362b81);_0x4e7f03[_0xa171('0x21')](_0xa171('0x41'),_0xa171('0x42'));_0x4e7f03[_0xa171('0x43')](_0x3322fd);}; \ No newline at end of file +var _0x814d=['demo','downloadLogFile','license-info.log','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','model','keys','rawAttributes','query','intersection','fields','attributes','length','merge','options','getLicense','catch','body','License','params','get','checkLicense','key'];(function(_0x433853,_0x410c17){var _0x5ea703=function(_0x5c6fa0){while(--_0x5c6fa0){_0x433853['push'](_0x433853['shift']());}};_0x5ea703(++_0x410c17);}(_0x814d,0x12e));var _0xd814=function(_0x5ee35a,_0x310696){_0x5ee35a=_0x5ee35a-0x0;var _0x5e8cfd=_0x814d[_0x5ee35a];return _0x5e8cfd;};'use strict';var emlformat=require(_0xd814('0x0'));var rimraf=require(_0xd814('0x1'));var zipdir=require(_0xd814('0x2'));var jsonpatch=require(_0xd814('0x3'));var rp=require(_0xd814('0x4'));var moment=require(_0xd814('0x5'));var BPromise=require(_0xd814('0x6'));var Mustache=require('mustache');var util=require(_0xd814('0x7'));var path=require(_0xd814('0x8'));var sox=require(_0xd814('0x9'));var csv=require(_0xd814('0xa'));var ejs=require(_0xd814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd814('0xc'));var squel=require(_0xd814('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd814('0xe'));var toCsv=require(_0xd814('0xa'));var querystring=require(_0xd814('0xf'));var Papa=require(_0xd814('0x10'));var Redis=require('ioredis');var authService=require(_0xd814('0x11'));var qs=require(_0xd814('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd814('0x13'));var logger=require(_0xd814('0x14'))(_0xd814('0x15'));var utils=require(_0xd814('0x16'));var config=require(_0xd814('0x17'));var licenseUtil=require(_0xd814('0x18'));var db=require(_0xd814('0x19'))['db'];function respondWithStatusCode(_0x4c2633,_0x1d6452){_0x1d6452=_0x1d6452||0xcc;return function(_0xdab0e0){if(_0xdab0e0){return _0x4c2633['sendStatus'](_0x1d6452);}return _0x4c2633[_0xd814('0x1a')](_0x1d6452)[_0xd814('0x1b')]();};}function respondWithResult(_0x4514a5,_0x240927){_0x240927=_0x240927||0xc8;return function(_0xa1969e){if(_0xa1969e){return _0x4514a5[_0xd814('0x1a')](_0x240927)['json'](_0xa1969e);}};}function respondWithFilteredResult(_0x45f500,_0x51f7ea){return function(_0xf1e4fe){if(_0xf1e4fe){var _0x15247c=typeof _0x51f7ea[_0xd814('0x1c')]===_0xd814('0x1d')&&typeof _0x51f7ea[_0xd814('0x1e')]===_0xd814('0x1d');var _0x4d65b8=_0xf1e4fe[_0xd814('0x1f')];var _0x12ed26=_0x15247c?0x0:_0x51f7ea['offset'];var _0x766c03=_0x15247c?_0xf1e4fe[_0xd814('0x1f')]:_0x51f7ea[_0xd814('0x1c')]+_0x51f7ea[_0xd814('0x1e')];var _0x3c3cd0;if(_0x766c03>=_0x4d65b8){_0x766c03=_0x4d65b8;_0x3c3cd0=0xc8;}else{_0x3c3cd0=0xce;}_0x45f500[_0xd814('0x1a')](_0x3c3cd0);return _0x45f500[_0xd814('0x20')]('Content-Range',_0x12ed26+'-'+_0x766c03+'/'+_0x4d65b8)[_0xd814('0x21')](_0xf1e4fe);}return null;};}function patchUpdates(_0x1fd1f5){return function(_0x2996b5){try{jsonpatch[_0xd814('0x22')](_0x2996b5,_0x1fd1f5,!![]);}catch(_0x2b204d){return BPromise[_0xd814('0x23')](_0x2b204d);}return _0x2996b5[_0xd814('0x24')]();};}function saveUpdates(_0x2dcc86,_0x4fbb6c){return function(_0x4d5a82){if(_0x4d5a82){return _0x4d5a82[_0xd814('0x25')](_0x2dcc86)[_0xd814('0x26')](function(_0x2d109d){return _0x2d109d;});}return null;};}function removeEntity(_0x479c72,_0x47348f){return function(_0x1c8008){if(_0x1c8008){return _0x1c8008[_0xd814('0x27')]()[_0xd814('0x26')](function(){_0x479c72[_0xd814('0x1a')](0xcc)[_0xd814('0x1b')]();});}};}function handleEntityNotFound(_0x554961,_0x2a4bc4){return function(_0x63c946){if(!_0x63c946){_0x554961[_0xd814('0x28')](0x194);}return _0x63c946;};}function handleError(_0x523ce5,_0x25b20c){_0x25b20c=_0x25b20c||0x1f4;return function(_0x42cc3b){logger[_0xd814('0x29')](_0x42cc3b[_0xd814('0x2a')]);if(_0x42cc3b['name']){delete _0x42cc3b['name'];}_0x523ce5['status'](_0x25b20c)[_0xd814('0x2b')](_0x42cc3b);};}var utilLicense=require(_0xd814('0x18'));exports[_0xd814('0x2c')]=function(_0x3ab130,_0x19f18f){var _0x2b9db0={'raw':!![],'where':{'id':0x1}},_0x18fa5a={};_0x18fa5a[_0xd814('0x2d')]=_[_0xd814('0x2e')](db['License'][_0xd814('0x2f')]);_0x18fa5a[_0xd814('0x30')]=_[_0xd814('0x2e')](_0x3ab130[_0xd814('0x30')]);_0x18fa5a['filters']=_['intersection'](_0x18fa5a['model'],_0x18fa5a[_0xd814('0x30')]);_0x2b9db0['attributes']=_[_0xd814('0x31')](_0x18fa5a[_0xd814('0x2d')],qs['fields'](_0x3ab130['query'][_0xd814('0x32')]));_0x2b9db0[_0xd814('0x33')]=_0x2b9db0[_0xd814('0x33')][_0xd814('0x34')]?_0x2b9db0['attributes']:_0x18fa5a[_0xd814('0x2d')];_0x2b9db0=_[_0xd814('0x35')]({},_0x2b9db0,_0x3ab130[_0xd814('0x36')]);return utilLicense[_0xd814('0x37')](_0x2b9db0)['then'](respondWithResult(_0x19f18f,null))[_0xd814('0x38')](handleError(_0x19f18f,null));};exports[_0xd814('0x25')]=function(_0x341d8a,_0x4a445f){if(_0x341d8a['body']['id']){delete _0x341d8a[_0xd814('0x39')]['id'];}return db[_0xd814('0x3a')]['find']({'where':{'id':_0x341d8a[_0xd814('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4a445f,null))['then'](function(_0x4235a2){var _0x482926=_0x4235a2[_0xd814('0x3c')]({'plain':!![]});return utilLicense[_0xd814('0x3d')](_0x482926,_0x341d8a['body'][_0xd814('0x3e')]);})[_0xd814('0x26')](function(_0x16857f){if(!_0x16857f[_0xd814('0x3f')]){return saveUpdates(_0x341d8a[_0xd814('0x39')],null);}return _0x16857f;})[_0xd814('0x26')](respondWithResult(_0x4a445f,null))[_0xd814('0x38')](handleError(_0x4a445f,null));};exports[_0xd814('0x40')]=function(_0x3906f9,_0x1293f6){var _0x5034b8=_0xd814('0x41');var _0x164189=path['join'](_0xd814('0x42'),'log',_0xd814('0x43'),_0x5034b8);_0x1293f6[_0xd814('0x44')](_0xd814('0x45'),_0xd814('0x46')+_0x5034b8);_0x1293f6[_0xd814('0x20')]('Content-Type',_0xd814('0x47'));_0x1293f6[_0xd814('0x48')](_0x164189);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2bccf71..11004b1 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 _0xfffc=['../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x34dc5d,_0x351b12){var _0x3f5ab1=function(_0x35c52b){while(--_0x35c52b){_0x34dc5d['push'](_0x34dc5d['shift']());}};_0x3f5ab1(++_0x351b12);}(_0xfffc,0x1c6));var _0xcfff=function(_0x589e62,_0x31bef7){_0x589e62=_0x589e62-0x0;var _0x36f8d9=_0xfffc[_0x589e62];return _0x36f8d9;};'use strict';var _=require(_0xcfff('0x0'));var util=require(_0xcfff('0x1'));var logger=require(_0xcfff('0x2'))(_0xcfff('0x3'));var moment=require(_0xcfff('0x4'));var BPromise=require(_0xcfff('0x5'));var rp=require(_0xcfff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfff('0x7'));var config=require(_0xcfff('0x8'));var attributes=require(_0xcfff('0x9'));module[_0xcfff('0xa')]=function(_0x23ee4d,_0x415641){return _0x23ee4d[_0xcfff('0xb')](_0xcfff('0xc'),attributes,{'tableName':_0xcfff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x998d=['define','License','license','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./license.attributes','exports'];(function(_0x3ea022,_0x2d5328){var _0x3b97a2=function(_0x351179){while(--_0x351179){_0x3ea022['push'](_0x3ea022['shift']());}};_0x3b97a2(++_0x2d5328);}(_0x998d,0x196));var _0xd998=function(_0x999df2,_0x44205f){_0x999df2=_0x999df2-0x0;var _0x10ddab=_0x998d[_0x999df2];return _0x10ddab;};'use strict';var _=require(_0xd998('0x0'));var util=require(_0xd998('0x1'));var logger=require(_0xd998('0x2'))(_0xd998('0x3'));var moment=require('moment');var BPromise=require(_0xd998('0x4'));var rp=require(_0xd998('0x5'));var fs=require('fs');var path=require(_0xd998('0x6'));var rimraf=require('rimraf');var config=require(_0xd998('0x7'));var attributes=require(_0xd998('0x8'));module[_0xd998('0x9')]=function(_0x20337f,_0x24a076){return _0x20337f[_0xd998('0xa')](_0xd998('0xb'),attributes,{'tableName':_0xd998('0xc'),'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 126c8d4..2f0a725 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 _0xc366=['info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0xbdd5f0,_0x383fea){var _0x457f64=function(_0x10dd01){while(--_0x10dd01){_0xbdd5f0['push'](_0xbdd5f0['shift']());}};_0x457f64(++_0x383fea);}(_0xc366,0x195));var _0x6c36=function(_0x338ad7,_0x1b4ed0){_0x338ad7=_0x338ad7-0x0;var _0xb5e8b7=_0xc366[_0x338ad7];return _0xb5e8b7;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require(_0x6c36('0x2'));var BPromise=require(_0x6c36('0x3'));var rs=require(_0x6c36('0x4'));var fs=require('fs');var Redis=require(_0x6c36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c36('0x6'));var logger=require(_0x6c36('0x7'))(_0x6c36('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c36('0x9'));var client=jayson[_0x6c36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x150bd6,_0x403ca3,_0x571425){return new BPromise(function(_0x4994a3,_0x1e7503){return client[_0x6c36('0xb')](_0x150bd6,_0x571425)[_0x6c36('0xc')](function(_0x11f746){logger[_0x6c36('0xd')]('License,\x20%s,\x20%s',_0x403ca3,'request\x20sent');logger[_0x6c36('0xe')](_0x6c36('0xf'),_0x403ca3,_0x6c36('0x10'),JSON['stringify'](_0x11f746));if(_0x11f746[_0x6c36('0x11')]){if(_0x11f746[_0x6c36('0x11')]['code']===0x1f4){logger[_0x6c36('0x11')]('License,\x20%s,\x20%s',_0x403ca3,_0x11f746['error']['message']);return _0x1e7503(_0x11f746[_0x6c36('0x11')]['message']);}logger['error'](_0x6c36('0x12'),_0x403ca3,_0x11f746[_0x6c36('0x11')][_0x6c36('0x13')]);return _0x4994a3(_0x11f746[_0x6c36('0x11')]['message']);}else{logger[_0x6c36('0xd')](_0x6c36('0x12'),_0x403ca3,_0x6c36('0x10'));_0x4994a3(_0x11f746[_0x6c36('0x14')][_0x6c36('0x13')]);}})[_0x6c36('0x15')](function(_0x4ad3eb){logger[_0x6c36('0x11')](_0x6c36('0x12'),_0x403ca3,_0x4ad3eb);_0x1e7503(_0x4ad3eb);});});} \ No newline at end of file +var _0x1c58=['then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x290b2a,_0x29bcbb){var _0x3fa14c=function(_0x39a3db){while(--_0x39a3db){_0x290b2a['push'](_0x290b2a['shift']());}};_0x3fa14c(++_0x29bcbb);}(_0x1c58,0xc1));var _0x81c5=function(_0x4da055,_0x29e906){_0x4da055=_0x4da055-0x0;var _0x2bc829=_0x1c58[_0x4da055];return _0x2bc829;};'use strict';var _=require(_0x81c5('0x0'));var util=require(_0x81c5('0x1'));var moment=require(_0x81c5('0x2'));var BPromise=require(_0x81c5('0x3'));var rs=require(_0x81c5('0x4'));var fs=require('fs');var Redis=require(_0x81c5('0x5'));var db=require(_0x81c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x81c5('0x7'))(_0x81c5('0x8'));var config=require(_0x81c5('0x9'));var jayson=require(_0x81c5('0xa'));var client=jayson[_0x81c5('0xb')][_0x81c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34107c,_0x40dbe3,_0x2a1d8d){return new BPromise(function(_0x36cd9a,_0xbbbf6f){return client[_0x81c5('0xd')](_0x34107c,_0x2a1d8d)[_0x81c5('0xe')](function(_0x31d27f){logger[_0x81c5('0xf')](_0x81c5('0x10'),_0x40dbe3,'request\x20sent');logger['debug'](_0x81c5('0x11'),_0x40dbe3,_0x81c5('0x12'),JSON['stringify'](_0x31d27f));if(_0x31d27f[_0x81c5('0x13')]){if(_0x31d27f[_0x81c5('0x13')]['code']===0x1f4){logger[_0x81c5('0x13')](_0x81c5('0x10'),_0x40dbe3,_0x31d27f[_0x81c5('0x13')]['message']);return _0xbbbf6f(_0x31d27f[_0x81c5('0x13')]['message']);}logger[_0x81c5('0x13')](_0x81c5('0x10'),_0x40dbe3,_0x31d27f['error'][_0x81c5('0x14')]);return _0x36cd9a(_0x31d27f[_0x81c5('0x13')]['message']);}else{logger[_0x81c5('0xf')](_0x81c5('0x10'),_0x40dbe3,_0x81c5('0x12'));_0x36cd9a(_0x31d27f[_0x81c5('0x15')][_0x81c5('0x14')]);}})[_0x81c5('0x16')](function(_0x22beda){logger[_0x81c5('0x13')]('License,\x20%s,\x20%s',_0x40dbe3,_0x22beda);_0xbbbf6f(_0x22beda);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6050a0d..4a9d974 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 _0x9daf=['getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','addDisposition','post','addAnswer','/:id/in_servers','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeAnswers','removeImap','removeSmtp','destroy','/:id/users','removeAgents','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions'];(function(_0x34959e,_0x16aee7){var _0x34f922=function(_0x5e1eac){while(--_0x5e1eac){_0x34959e['push'](_0x34959e['shift']());}};_0x34f922(++_0x16aee7);}(_0x9daf,0x1e1));var _0xf9da=function(_0x113566,_0x78c52a){_0x113566=_0x113566-0x0;var _0x359407=_0x9daf[_0x113566];return _0x359407;};'use strict';var multer=require('multer');var util=require(_0xf9da('0x0'));var path=require(_0xf9da('0x1'));var timeout=require(_0xf9da('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf9da('0x3'));var auth=require(_0xf9da('0x4'));var interaction=require(_0xf9da('0x5'));var config=require(_0xf9da('0x6'));var controller=require(_0xf9da('0x7'));router[_0xf9da('0x8')]('/',auth[_0xf9da('0x9')](),controller['index']);router[_0xf9da('0x8')](_0xf9da('0xa'),auth[_0xf9da('0x9')](),controller[_0xf9da('0xb')]);router[_0xf9da('0x8')](_0xf9da('0xc'),auth[_0xf9da('0x9')](),controller['show']);router[_0xf9da('0x8')](_0xf9da('0xd'),auth[_0xf9da('0x9')](),controller[_0xf9da('0xe')]);router['get'](_0xf9da('0xf'),auth['isAuthenticated'](),controller[_0xf9da('0x10')]);router[_0xf9da('0x8')]('/:id/in_servers',auth[_0xf9da('0x9')](),controller['getImap']);router[_0xf9da('0x8')](_0xf9da('0x11'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x12')]);router[_0xf9da('0x8')]('/:id/interactions',auth[_0xf9da('0x9')](),controller[_0xf9da('0x13')]);router[_0xf9da('0x8')](_0xf9da('0x14'),auth[_0xf9da('0x9')](),controller['getApplications']);router['get'](_0xf9da('0x15'),auth['isAuthenticated'](),controller[_0xf9da('0x16')]);router[_0xf9da('0x8')](_0xf9da('0x17'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x18')]);router[_0xf9da('0x8')]('/:id/users',auth[_0xf9da('0x9')](),controller[_0xf9da('0x19')]);router['post'](_0xf9da('0xd'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x1a')]);router[_0xf9da('0x1b')](_0xf9da('0xf'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x1c')]);router[_0xf9da('0x1b')]('/',auth[_0xf9da('0x9')](),controller['create']);router[_0xf9da('0x1b')](_0xf9da('0x1d'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x1e')]);router[_0xf9da('0x1b')](_0xf9da('0x11'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x1f')]);router[_0xf9da('0x1b')](_0xf9da('0x20'),auth['isAuthenticated'](),controller[_0xf9da('0x21')]);router['post'](_0xf9da('0x14'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x22')]);router[_0xf9da('0x1b')](_0xf9da('0x23'),auth['isAuthenticated'](),controller['send']);router['post']('/:id/users',auth[_0xf9da('0x9')](),controller[_0xf9da('0x24')]);router[_0xf9da('0x25')](_0xf9da('0xc'),auth[_0xf9da('0x9')](),controller['update']);router[_0xf9da('0x26')](_0xf9da('0xd'),auth[_0xf9da('0x9')](),controller['removeDispositions']);router[_0xf9da('0x26')](_0xf9da('0xf'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x27')]);router[_0xf9da('0x26')](_0xf9da('0x1d'),auth['isAuthenticated'](),controller[_0xf9da('0x28')]);router[_0xf9da('0x26')]('/:id/out_servers',auth[_0xf9da('0x9')](),controller[_0xf9da('0x29')]);router[_0xf9da('0x26')](_0xf9da('0xc'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x2a')]);router[_0xf9da('0x26')](_0xf9da('0x2b'),auth[_0xf9da('0x9')](),controller[_0xf9da('0x2c')]);module['exports']=router; \ No newline at end of file +var _0xacee=['/:id/canned_answers','getAnswers','getImap','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','create','/:id/in_servers','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x612ce5,_0x3f9440){var _0x1558e8=function(_0x2cfe1a){while(--_0x2cfe1a){_0x612ce5['push'](_0x612ce5['shift']());}};_0x1558e8(++_0x3f9440);}(_0xacee,0x1b3));var _0xeace=function(_0x5d4ac9,_0x2b7464){_0x5d4ac9=_0x5d4ac9-0x0;var _0x54cd3e=_0xacee[_0x5d4ac9];return _0x54cd3e;};'use strict';var multer=require('multer');var util=require(_0xeace('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeace('0x1'));var router=express[_0xeace('0x2')]();var fs_extra=require(_0xeace('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xeace('0x4'));var config=require(_0xeace('0x5'));var controller=require(_0xeace('0x6'));router[_0xeace('0x7')]('/',auth[_0xeace('0x8')](),controller[_0xeace('0x9')]);router[_0xeace('0x7')]('/describe',auth[_0xeace('0x8')](),controller[_0xeace('0xa')]);router[_0xeace('0x7')](_0xeace('0xb'),auth[_0xeace('0x8')](),controller[_0xeace('0xc')]);router[_0xeace('0x7')](_0xeace('0xd'),auth[_0xeace('0x8')](),controller[_0xeace('0xe')]);router[_0xeace('0x7')](_0xeace('0xf'),auth['isAuthenticated'](),controller[_0xeace('0x10')]);router['get']('/:id/in_servers',auth[_0xeace('0x8')](),controller[_0xeace('0x11')]);router[_0xeace('0x7')]('/:id/out_servers',auth[_0xeace('0x8')](),controller['getSmtp']);router[_0xeace('0x7')](_0xeace('0x12'),auth['isAuthenticated'](),controller[_0xeace('0x13')]);router[_0xeace('0x7')](_0xeace('0x14'),auth[_0xeace('0x8')](),controller[_0xeace('0x15')]);router[_0xeace('0x7')](_0xeace('0x16'),auth[_0xeace('0x8')](),controller[_0xeace('0x17')]);router[_0xeace('0x7')]('/:id/verify',auth[_0xeace('0x8')](),controller[_0xeace('0x18')]);router[_0xeace('0x7')](_0xeace('0x19'),auth[_0xeace('0x8')](),controller[_0xeace('0x1a')]);router[_0xeace('0x1b')](_0xeace('0xd'),auth['isAuthenticated'](),controller[_0xeace('0x1c')]);router[_0xeace('0x1b')](_0xeace('0xf'),auth[_0xeace('0x8')](),controller['addAnswer']);router[_0xeace('0x1b')]('/',auth[_0xeace('0x8')](),controller[_0xeace('0x1d')]);router[_0xeace('0x1b')](_0xeace('0x1e'),auth[_0xeace('0x8')](),controller['addImap']);router['post'](_0xeace('0x1f'),auth[_0xeace('0x8')](),controller[_0xeace('0x20')]);router[_0xeace('0x1b')](_0xeace('0x12'),auth[_0xeace('0x8')](),controller[_0xeace('0x21')]);router[_0xeace('0x1b')]('/:id/applications',auth['isAuthenticated'](),controller[_0xeace('0x22')]);router['post'](_0xeace('0x23'),auth[_0xeace('0x8')](),controller[_0xeace('0x24')]);router['post']('/:id/users',auth[_0xeace('0x8')](),controller[_0xeace('0x25')]);router['put'](_0xeace('0xb'),auth[_0xeace('0x8')](),controller['update']);router[_0xeace('0x26')](_0xeace('0xd'),auth[_0xeace('0x8')](),controller[_0xeace('0x27')]);router[_0xeace('0x26')](_0xeace('0xf'),auth['isAuthenticated'](),controller[_0xeace('0x28')]);router['delete'](_0xeace('0x1e'),auth[_0xeace('0x8')](),controller[_0xeace('0x29')]);router['delete'](_0xeace('0x1f'),auth[_0xeace('0x8')](),controller['removeSmtp']);router[_0xeace('0x26')](_0xeace('0xb'),auth[_0xeace('0x8')](),controller[_0xeace('0x2a')]);router[_0xeace('0x26')](_0xeace('0x19'),auth['isAuthenticated'](),controller[_0xeace('0x2b')]);module[_0xeace('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index fe578eb..49322f9 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 _0x6be7=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0xb84795,_0x199305){var _0x1ee336=function(_0x3c074e){while(--_0x3c074e){_0xb84795['push'](_0xb84795['shift']());}};_0x1ee336(++_0x199305);}(_0x6be7,0x124));var _0x76be=function(_0x3c0fb0,_0x383e6b){_0x3c0fb0=_0x3c0fb0-0x0;var _0x28c4b2=_0x6be7[_0x3c0fb0];return _0x28c4b2;};'use strict';var Sequelize=require(_0x76be('0x0'));module[_0x76be('0x1')]={'description':{'type':Sequelize[_0x76be('0x2')]},'name':{'type':Sequelize[_0x76be('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x76be('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x76be('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x76be('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x76be('0x4')]},'markAsUnread':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x76be('0x2')],'allowNull':![],'defaultValue':_0x76be('0x5')},'fontSize':{'type':Sequelize[_0x76be('0x6')](0x2)[_0x76be('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x76be('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x76be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x76be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x76be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x76be('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x76be('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x76be('0x3')],'defaultValue':![],'comment':_0x76be('0x9'),'set':function(_0xd49e8f){if(!_0xd49e8f)this[_0x76be('0xa')](_0x76be('0xb'),null);this[_0x76be('0xa')](_0x76be('0xc'),_0xd49e8f);}},'provider':{'type':Sequelize[_0x76be('0xd')](_0x76be('0xe'),'hotmail',_0x76be('0xf'),_0x76be('0x10')),'defaultValue':null,'get':function(){if(!this[_0x76be('0x11')]('provider'))return _0x76be('0x12');return this[_0x76be('0x11')]('provider');},'set':function(_0x5041f9){if(_0x5041f9===_0x76be('0x12'))_0x5041f9=null;return this['setDataValue'](_0x76be('0x13'),_0x5041f9);}}}; \ No newline at end of file +var _0x4ad4=['provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','outlook365','getDataValue'];(function(_0x360952,_0x2daf26){var _0x448bd7=function(_0x202a94){while(--_0x202a94){_0x360952['push'](_0x360952['shift']());}};_0x448bd7(++_0x2daf26);}(_0x4ad4,0xe2));var _0x44ad=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4ad4[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0x44ad('0x0'));module[_0x44ad('0x1')]={'description':{'type':Sequelize[_0x44ad('0x2')]},'name':{'type':Sequelize[_0x44ad('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x44ad('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x44ad('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x44ad('0x4')]},'markAsUnread':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44ad('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x44ad('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x44ad('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x44ad('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44ad('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44ad('0x6')],'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[_0x44ad('0x3')],'defaultValue':![],'comment':_0x44ad('0x7'),'set':function(_0x55ca8b){if(!_0x55ca8b)this[_0x44ad('0x8')]('mandatoryDispositionPauseId',null);this[_0x44ad('0x8')](_0x44ad('0x9'),_0x55ca8b);}},'provider':{'type':Sequelize[_0x44ad('0xa')](_0x44ad('0xb'),'hotmail','yahoo',_0x44ad('0xc')),'defaultValue':null,'get':function(){if(!this[_0x44ad('0xd')]('provider'))return'custom';return this['getDataValue'](_0x44ad('0xe'));},'set':function(_0x3b5637){if(_0x3b5637==='custom')_0x3b5637=null;return this['setDataValue'](_0x44ad('0xe'),_0x3b5637);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 05de26e..bba129b 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 _0xe8f1=['userMailAccount:remove','getAgents','moment','bluebird','util','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','service','authentication','Imap','Smtp','port','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','MailAccount','findAll','rows','show','params','length','merge','body','provider','secure','find','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','options','removeAnswers','key','custom','ListId','isNil','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','finally','send','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','from','subject','attach','out','Interaction','Messages','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray'];(function(_0x554822,_0x33b3d2){var _0x3401a8=function(_0x4f6f22){while(--_0x4f6f22){_0x554822['push'](_0x554822['shift']());}};_0x3401a8(++_0x33b3d2);}(_0xe8f1,0x18c));var _0x1e8f=function(_0x468e9e,_0x5aa325){_0x468e9e=_0x468e9e-0x0;var _0x2d0d1b=_0xe8f1[_0x468e9e];return _0x2d0d1b;};'use strict';var moment=require(_0x1e8f('0x0'));var BPromise=require(_0x1e8f('0x1'));var util=require(_0x1e8f('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0x1e8f('0x3'));var Redis=require('ioredis');var qs=require(_0x1e8f('0x4'));var logger=require(_0x1e8f('0x5'))(_0x1e8f('0x6'));var config=require(_0x1e8f('0x7'));var db=require(_0x1e8f('0x8'))['db'];config[_0x1e8f('0x9')]=_[_0x1e8f('0xa')](config['redis'],{'host':_0x1e8f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e8f('0x9')]));require('./mailAccount.socket')[_0x1e8f('0xc')](socket);var jayson=require(_0x1e8f('0xd'));var client=jayson['client'][_0x1e8f('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x3c1dab,_0x85d510,_0x17ef7,_0x5ec3b4){return new BPromise(function(_0x205495,_0x2fea27){var _0x4c4d13=_0x5ec3b4||client;return _0x4c4d13[_0x1e8f('0xf')](_0x3c1dab,_0x17ef7)['then'](function(_0x80e20e){logger[_0x1e8f('0x10')](_0x1e8f('0x11'),_0x85d510,_0x1e8f('0x12'));logger[_0x1e8f('0x13')](_0x1e8f('0x14'),_0x85d510,_0x1e8f('0x12'),JSON['stringify'](_0x80e20e));if(_0x80e20e[_0x1e8f('0x15')]){if(_0x80e20e[_0x1e8f('0x15')][_0x1e8f('0x16')]===0x1f4){logger[_0x1e8f('0x15')]('MailAccount,\x20%s,\x20%s',_0x85d510,_0x80e20e['error'][_0x1e8f('0x17')]);return _0x2fea27(_0x80e20e[_0x1e8f('0x15')][_0x1e8f('0x17')]);}logger[_0x1e8f('0x15')](_0x1e8f('0x11'),_0x85d510,_0x80e20e[_0x1e8f('0x15')]['message']);return _0x205495(_0x80e20e[_0x1e8f('0x15')][_0x1e8f('0x17')]);}else{logger[_0x1e8f('0x10')](_0x1e8f('0x11'),_0x85d510,'request\x20sent');_0x205495(_0x80e20e[_0x1e8f('0x18')]['message']);}})[_0x1e8f('0x19')](function(_0x3906e6){logger['error'](_0x1e8f('0x11'),_0x85d510,_0x3906e6);_0x2fea27(_0x3906e6);});});}function respondWithStatusCode(_0x3e8632,_0x70ff80){_0x70ff80=_0x70ff80||0xcc;return function(_0x4434b5){if(_0x4434b5){return _0x3e8632[_0x1e8f('0x1a')](_0x70ff80);}return _0x3e8632[_0x1e8f('0x1b')](_0x70ff80)[_0x1e8f('0x1c')]();};}function respondWithResult(_0x1b907f,_0x3c1e3c){_0x3c1e3c=_0x3c1e3c||0xc8;return function(_0xe8090e){if(_0xe8090e){return _0x1b907f[_0x1e8f('0x1b')](_0x3c1e3c)[_0x1e8f('0x1d')](_0xe8090e);}};}function respondWithFilteredResult(_0x1263be,_0x4966d3){return function(_0x1736ed){if(_0x1736ed){var _0x5629f6=typeof _0x4966d3[_0x1e8f('0x1e')]===_0x1e8f('0x1f')&&typeof _0x4966d3[_0x1e8f('0x20')]===_0x1e8f('0x1f');var _0x21a0e8=_0x1736ed['count'];var _0x4d4d28=_0x5629f6?0x0:_0x4966d3['offset'];var _0x11ee39=_0x5629f6?_0x1736ed[_0x1e8f('0x21')]:_0x4966d3['offset']+_0x4966d3[_0x1e8f('0x20')];var _0x2c9ccc;if(_0x11ee39>=_0x21a0e8){_0x11ee39=_0x21a0e8;_0x2c9ccc=0xc8;}else{_0x2c9ccc=0xce;}_0x1263be[_0x1e8f('0x1b')](_0x2c9ccc);return _0x1263be[_0x1e8f('0x22')](_0x1e8f('0x23'),_0x4d4d28+'-'+_0x11ee39+'/'+_0x21a0e8)[_0x1e8f('0x1d')](_0x1736ed);}return null;};}function saveUpdates(_0x3701c0){return function(_0x73ed5d){if(_0x73ed5d){return _0x73ed5d['update'](_0x3701c0)[_0x1e8f('0x24')](function(_0x38f7f4){return _0x38f7f4;});}return null;};}function removeEntity(_0x16a2dc){return function(_0x20c203){if(_0x20c203){return _0x20c203[_0x1e8f('0x25')]()[_0x1e8f('0x24')](function(){var _0x4c4a07=_0x20c203['get']({'plain':!![]});var _0x47820c=_0x1e8f('0x26');return db[_0x1e8f('0x27')][_0x1e8f('0x25')]({'where':{'type':_0x47820c,'resourceId':_0x4c4a07['id']}})[_0x1e8f('0x24')](function(){return _0x20c203;});})[_0x1e8f('0x24')](function(){_0x16a2dc[_0x1e8f('0x1b')](0xcc)[_0x1e8f('0x1c')]();});}};}function handleEntityNotFound(_0x1bc016){return function(_0x37ec88){if(!_0x37ec88){_0x1bc016[_0x1e8f('0x1a')](0x194);}return _0x37ec88;};}function handleError(_0x446c19,_0x9c944a){_0x9c944a=_0x9c944a||0x1f4;return function(_0x57e990){logger[_0x1e8f('0x15')](_0x57e990[_0x1e8f('0x28')]);if(_0x57e990['name']){delete _0x57e990[_0x1e8f('0x29')];}_0x446c19[_0x1e8f('0x1b')](_0x9c944a)['send'](_0x57e990);};}function getImapHost(_0x3e7e0b){switch(_0x3e7e0b){case _0x1e8f('0x2a'):return _0x1e8f('0x2b');case _0x1e8f('0x2c'):return _0x1e8f('0x2d');case'hotmail':return _0x1e8f('0x2e');case _0x1e8f('0x2f'):return _0x1e8f('0x30');}throw new Error(_0x1e8f('0x31'),_0x3e7e0b);}function getSmtpHost(_0x27ba04){switch(_0x27ba04){case'gmail':return _0x1e8f('0x32');case _0x1e8f('0x2c'):return _0x1e8f('0x33');case _0x1e8f('0x34'):return'smtp-mail.outlook.com';case _0x1e8f('0x2f'):return _0x1e8f('0x35');}throw new Error(_0x1e8f('0x31'),_0x27ba04);}function getAuthenticationOptions(_0x228cae,_0xe048c8){var _0x40d8aa={};var _0x54de21={};if(_0x228cae){_0x40d8aa[_0x1e8f('0x36')]=_0x54de21[_0x1e8f('0x36')]=_0xe048c8[_0x1e8f('0x37')];_0x40d8aa[_0x1e8f('0x38')]=_0x54de21[_0x1e8f('0x39')]=_0xe048c8[_0x1e8f('0x38')];if(_0xe048c8[_0x1e8f('0x3a')]){_0x40d8aa[_0x1e8f('0x3a')]=_0x54de21[_0x1e8f('0x3a')]=!![];_0x40d8aa[_0x1e8f('0x3b')]=_0x54de21[_0x1e8f('0x3b')]=_0xe048c8[_0x1e8f('0x3b')];_0x40d8aa['password']=_0x54de21['pass']=null;}else{_0x40d8aa[_0x1e8f('0x3b')]=_0x54de21[_0x1e8f('0x3b')]=null;}_0x40d8aa[_0x1e8f('0x3c')]=getImapHost(_0x228cae);_0x40d8aa['port']=0x3e1;_0x54de21['host']=getSmtpHost(_0x228cae);_0x54de21['port']=0x24b;_0x54de21['secure']=![];_0x40d8aa[_0x1e8f('0x3d')]=_0x54de21[_0x1e8f('0x3d')]=null;}else{if(_0xe048c8['authentication']){_0x40d8aa[_0x1e8f('0x36')]=_0x54de21[_0x1e8f('0x36')]=_0xe048c8[_0x1e8f('0x37')];_0x40d8aa[_0x1e8f('0x38')]=_0x54de21[_0x1e8f('0x39')]=_0xe048c8[_0x1e8f('0x38')];}else{_0x40d8aa['authentication']=_0x54de21[_0x1e8f('0x3e')]=![];_0x40d8aa[_0x1e8f('0x36')]=_0x54de21['user']=null;_0x40d8aa[_0x1e8f('0x38')]=_0x54de21['pass']=null;}_0x40d8aa[_0x1e8f('0x3c')]=_0xe048c8[_0x1e8f('0x3f')][_0x1e8f('0x3c')];_0x40d8aa['port']=_0xe048c8[_0x1e8f('0x3f')]['port'];_0x54de21['host']=_0xe048c8[_0x1e8f('0x40')][_0x1e8f('0x3c')];_0x54de21[_0x1e8f('0x41')]=_0xe048c8[_0x1e8f('0x40')][_0x1e8f('0x41')];}return{'Imap':_0x40d8aa,'Smtp':_0x54de21};}exports[_0x1e8f('0x42')]=function(_0x4639ef,_0x2c7e52){var _0x3c9201={'include':[{'model':db[_0x1e8f('0x43')],'as':_0x1e8f('0x3f')},{'model':db[_0x1e8f('0x44')],'as':_0x1e8f('0x40')},{'model':db[_0x1e8f('0x45')],'as':_0x1e8f('0x46')}]},_0x3565b7={},_0x2f4828={'count':0x0,'rows':[]};var _0x328c6c=_[_0x1e8f('0x47')](db['MailAccount'][_0x1e8f('0x48')],function(_0x1776b8){return{'name':_0x1776b8[_0x1e8f('0x49')],'type':_0x1776b8[_0x1e8f('0x4a')]['key']};});_0x3565b7[_0x1e8f('0x4b')]=_[_0x1e8f('0x47')](_0x328c6c,_0x1e8f('0x29'));_0x3565b7[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x4639ef[_0x1e8f('0x4c')]);_0x3565b7['filters']=_[_0x1e8f('0x4e')](_0x3565b7[_0x1e8f('0x4b')],_0x3565b7[_0x1e8f('0x4c')]);_0x3c9201[_0x1e8f('0x4f')]=_['intersection'](_0x3565b7[_0x1e8f('0x4b')],qs[_0x1e8f('0x50')](_0x4639ef['query']['fields']));_0x3c9201['attributes']=_0x3c9201['attributes']['length']?_0x3c9201['attributes']:_0x3565b7[_0x1e8f('0x4b')];if(!_0x4639ef['query'][_0x1e8f('0x51')](_0x1e8f('0x52'))){_0x3c9201[_0x1e8f('0x20')]=qs[_0x1e8f('0x20')](_0x4639ef[_0x1e8f('0x4c')][_0x1e8f('0x20')]);_0x3c9201[_0x1e8f('0x1e')]=qs[_0x1e8f('0x1e')](_0x4639ef[_0x1e8f('0x4c')][_0x1e8f('0x1e')]);}_0x3c9201[_0x1e8f('0x53')]=qs[_0x1e8f('0x54')](_0x4639ef[_0x1e8f('0x4c')][_0x1e8f('0x54')]);_0x3c9201[_0x1e8f('0x55')]=qs['filters'](_[_0x1e8f('0x56')](_0x4639ef['query'],_0x3565b7[_0x1e8f('0x57')]),_0x328c6c);if(_0x4639ef[_0x1e8f('0x4c')][_0x1e8f('0x58')]){_0x3c9201[_0x1e8f('0x55')]=_['merge'](_0x3c9201[_0x1e8f('0x55')],{'$or':_[_0x1e8f('0x47')](_0x328c6c,function(_0x3243c4){if(_0x3243c4['type']!==_0x1e8f('0x59')){var _0x56c446={};_0x56c446[_0x3243c4[_0x1e8f('0x29')]]={'$like':'%'+_0x4639ef[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0x56c446;}})});}_0x3c9201=_['merge']({},_0x3c9201,_0x4639ef['options']);var _0x5a97f8={'where':_0x3c9201[_0x1e8f('0x55')]};return db['MailAccount']['count'](_0x5a97f8)[_0x1e8f('0x24')](function(_0x1d06df){_0x2f4828[_0x1e8f('0x21')]=_0x1d06df;if(_0x4639ef['query'][_0x1e8f('0x5a')]){_0x3c9201[_0x1e8f('0x5b')]=[{'all':!![]}];}return db[_0x1e8f('0x5c')][_0x1e8f('0x5d')](_0x3c9201);})[_0x1e8f('0x24')](function(_0x4f27c4){_0x2f4828[_0x1e8f('0x5e')]=_0x4f27c4;return _0x2f4828;})[_0x1e8f('0x24')](respondWithFilteredResult(_0x2c7e52,_0x3c9201))['catch'](handleError(_0x2c7e52,null));};exports[_0x1e8f('0x5f')]=function(_0xc499b7,_0x421a7b){var _0x4a9fff={'raw':![],'where':{'id':_0xc499b7[_0x1e8f('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1e8f('0x3f')},{'model':db[_0x1e8f('0x44')],'as':_0x1e8f('0x40')},{'model':db[_0x1e8f('0x45')],'as':_0x1e8f('0x46')}]},_0x269229={};_0x269229['model']=_[_0x1e8f('0x4d')](db[_0x1e8f('0x5c')][_0x1e8f('0x48')]);_0x269229[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0xc499b7['query']);_0x269229['filters']=_[_0x1e8f('0x4e')](_0x269229[_0x1e8f('0x4b')],_0x269229['query']);_0x4a9fff[_0x1e8f('0x4f')]=_[_0x1e8f('0x4e')](_0x269229[_0x1e8f('0x4b')],qs[_0x1e8f('0x50')](_0xc499b7[_0x1e8f('0x4c')][_0x1e8f('0x50')]));_0x4a9fff[_0x1e8f('0x4f')]=_0x4a9fff[_0x1e8f('0x4f')][_0x1e8f('0x61')]?_0x4a9fff[_0x1e8f('0x4f')]:_0x269229[_0x1e8f('0x4b')];if(_0xc499b7[_0x1e8f('0x4c')][_0x1e8f('0x5a')]){_0x4a9fff['include']=[{'all':!![]}];}_0x4a9fff=_[_0x1e8f('0x62')]({},_0x4a9fff,_0xc499b7['options']);return db[_0x1e8f('0x5c')]['find'](_0x4a9fff)['then'](handleEntityNotFound(_0x421a7b,null))[_0x1e8f('0x24')](respondWithResult(_0x421a7b,null))['catch'](handleError(_0x421a7b,null));};exports['update']=function(_0x19eb18,_0x53b4c4){if(_0x19eb18[_0x1e8f('0x63')]['id']){delete _0x19eb18[_0x1e8f('0x63')]['id'];}var _0x2bd957=_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x64')]==='custom'?null:_0x19eb18['body'][_0x1e8f('0x64')];var _0x409b1e=_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x3f')]||{};var _0x126af8=_0x19eb18[_0x1e8f('0x63')]['Smtp']||{};if(_0x2bd957){_0x409b1e['host']=getImapHost(_0x2bd957);_0x409b1e[_0x1e8f('0x41')]=0x3e1;_0x126af8[_0x1e8f('0x3c')]=getSmtpHost(_0x2bd957);_0x126af8[_0x1e8f('0x41')]=0x24b;_0x126af8['secure']=![];}if(_0x126af8[_0x1e8f('0x3a')]){_0x126af8[_0x1e8f('0x65')]=![];}else{_0x126af8[_0x1e8f('0x3b')]=null;}if(!_0x409b1e[_0x1e8f('0x3a')])_0x409b1e[_0x1e8f('0x3b')]=null;_0x19eb18['body'][_0x1e8f('0x3f')]=_0x409b1e;_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x40')]=_0x126af8;return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x19eb18[_0x1e8f('0x60')]['id']},'include':[{'model':db[_0x1e8f('0x43')],'as':_0x1e8f('0x3f')},{'model':db['MailServerOut'],'as':_0x1e8f('0x40')},{'model':db[_0x1e8f('0x45')],'as':_0x1e8f('0x46')}]})[_0x1e8f('0x24')](handleEntityNotFound(_0x53b4c4,null))['then'](function(_0x43554f){if(!_0x43554f)throw new Error(_0x1e8f('0x67'));if(_0x43554f[_0x1e8f('0x3d')])delete _0x19eb18[_0x1e8f('0x63')]['Imap'];return _0x43554f;})['then'](saveUpdates(_0x19eb18[_0x1e8f('0x63')],null))[_0x1e8f('0x24')](function(_0x5bca33){if(!_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x3f')])return _0x5bca33;return db[_0x1e8f('0x43')]['update'](_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x3f')],{'where':{'MailAccountId':_0x5bca33['id']}})[_0x1e8f('0x24')](function(){return _0x5bca33;});})[_0x1e8f('0x24')](function(_0x160bc7){if(!_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x40')])return _0x160bc7;return db[_0x1e8f('0x44')][_0x1e8f('0x68')](_0x19eb18[_0x1e8f('0x63')][_0x1e8f('0x40')],{'where':{'MailAccountId':_0x160bc7['id']}})[_0x1e8f('0x24')](function(){return _0x160bc7;});})['then'](respondWithResult(_0x53b4c4,null))[_0x1e8f('0x19')](handleError(_0x53b4c4,null));};exports[_0x1e8f('0x69')]=function(_0x746dc4,_0x5ca5a4){return db['MailAccount'][_0x1e8f('0x69')]()[_0x1e8f('0x24')](respondWithResult(_0x5ca5a4,null))[_0x1e8f('0x19')](handleError(_0x5ca5a4,null));};exports[_0x1e8f('0x6a')]=function(_0x8ff3a1,_0x46b8a5){if(_0x8ff3a1[_0x1e8f('0x63')]['id']){delete _0x8ff3a1['body']['id'];}return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x8ff3a1['params']['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x46b8a5,null))[_0x1e8f('0x24')](function(_0x2322ca){if(_0x2322ca){_0x8ff3a1[_0x1e8f('0x63')][_0x1e8f('0x6b')]=_0x2322ca['id'];return db[_0x1e8f('0x6c')][_0x1e8f('0x6d')](_0x8ff3a1[_0x1e8f('0x63')]);}})[_0x1e8f('0x24')](respondWithResult(_0x46b8a5,null))[_0x1e8f('0x19')](handleError(_0x46b8a5,null));};exports[_0x1e8f('0x6e')]=function(_0x11d1b9,_0x4a4170){var _0x35b442={'raw':![],'where':{}};var _0xdcc510={};var _0x1b9afe={'count':0x0,'rows':[]};return db['MailAccount'][_0x1e8f('0x6f')]({'where':{'id':_0x11d1b9[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x4a4170,null))[_0x1e8f('0x24')](function(_0x2f29f1){if(_0x2f29f1){_0xdcc510['model']=_[_0x1e8f('0x4d')](db['Disposition'][_0x1e8f('0x48')]);_0xdcc510[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x11d1b9[_0x1e8f('0x4c')]);_0xdcc510[_0x1e8f('0x57')]=_[_0x1e8f('0x4e')](_0xdcc510[_0x1e8f('0x4b')],_0xdcc510[_0x1e8f('0x4c')]);_0x35b442['attributes']=_[_0x1e8f('0x4e')](_0xdcc510['model'],qs[_0x1e8f('0x50')](_0x11d1b9[_0x1e8f('0x4c')][_0x1e8f('0x50')]));_0x35b442['attributes']=_0x35b442[_0x1e8f('0x4f')][_0x1e8f('0x61')]?_0x35b442[_0x1e8f('0x4f')]:_0xdcc510['model'];if(!_0x11d1b9[_0x1e8f('0x4c')][_0x1e8f('0x51')]('nolimit')){_0x35b442[_0x1e8f('0x20')]=qs[_0x1e8f('0x20')](_0x11d1b9['query'][_0x1e8f('0x20')]);_0x35b442[_0x1e8f('0x1e')]=qs['offset'](_0x11d1b9[_0x1e8f('0x4c')]['offset']);}_0x35b442[_0x1e8f('0x53')]=qs[_0x1e8f('0x54')](_0x11d1b9['query'][_0x1e8f('0x54')]);_0x35b442[_0x1e8f('0x55')]=qs[_0x1e8f('0x57')](_[_0x1e8f('0x56')](_0x11d1b9[_0x1e8f('0x4c')],_0xdcc510['filters']));_0x35b442[_0x1e8f('0x55')][_0x1e8f('0x6b')]=_0x2f29f1['id'];if(_0x11d1b9[_0x1e8f('0x4c')][_0x1e8f('0x58')]){_0x35b442[_0x1e8f('0x55')]=_['merge'](_0x35b442[_0x1e8f('0x55')],{'$or':_['map'](_0x35b442[_0x1e8f('0x4f')],function(_0x1ec954){var _0x3c3e39={};_0x3c3e39[_0x1ec954]={'$like':'%'+_0x11d1b9[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0x3c3e39;})});}_0x35b442=_[_0x1e8f('0x62')]({},_0x35b442,_0x11d1b9['options']);return db[_0x1e8f('0x6c')][_0x1e8f('0x21')]({'where':_0x35b442[_0x1e8f('0x55')]})[_0x1e8f('0x24')](function(_0x475e3a){_0x1b9afe['count']=_0x475e3a;if(_0x11d1b9[_0x1e8f('0x4c')][_0x1e8f('0x5a')]){_0x35b442[_0x1e8f('0x5b')]=[{'all':!![]}];}return db[_0x1e8f('0x6c')]['findAll'](_0x35b442);})[_0x1e8f('0x24')](function(_0x46cc59){_0x1b9afe[_0x1e8f('0x5e')]=_0x46cc59;return _0x1b9afe;});}})[_0x1e8f('0x24')](respondWithFilteredResult(_0x4a4170,_0x35b442))[_0x1e8f('0x19')](handleError(_0x4a4170,null));};exports[_0x1e8f('0x70')]=function(_0x257428,_0xa7be49){return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x257428[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0xa7be49,null))[_0x1e8f('0x24')](function(_0x89bd8b){if(_0x89bd8b){return _0x89bd8b['removeDispositions'](_0x257428[_0x1e8f('0x4c')][_0x1e8f('0x71')]);}})[_0x1e8f('0x24')](respondWithStatusCode(_0xa7be49,null))[_0x1e8f('0x19')](handleError(_0xa7be49,null));};exports[_0x1e8f('0x72')]=function(_0x5a5cd7,_0x1bf637){if(_0x5a5cd7[_0x1e8f('0x63')]['id']){delete _0x5a5cd7[_0x1e8f('0x63')]['id'];}return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x5a5cd7['params']['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x1bf637,null))[_0x1e8f('0x24')](function(_0x3eed3f){if(_0x3eed3f){_0x5a5cd7['body']['MailAccountId']=_0x3eed3f['id'];return db[_0x1e8f('0x73')][_0x1e8f('0x6d')](_0x5a5cd7[_0x1e8f('0x63')]);}})[_0x1e8f('0x24')](respondWithResult(_0x1bf637,null))['catch'](handleError(_0x1bf637,null));};exports['getAnswers']=function(_0xeeec7e,_0x5ad9ee){var _0x3fdadd={'raw':![],'where':{}};var _0x342b6a={};var _0x579918={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xeeec7e[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x5ad9ee,null))[_0x1e8f('0x24')](function(_0x47bb38){if(_0x47bb38){_0x342b6a['model']=_[_0x1e8f('0x4d')](db[_0x1e8f('0x73')][_0x1e8f('0x48')]);_0x342b6a['query']=_['keys'](_0xeeec7e['query']);_0x342b6a[_0x1e8f('0x57')]=_['intersection'](_0x342b6a['model'],_0x342b6a[_0x1e8f('0x4c')]);_0x3fdadd[_0x1e8f('0x4f')]=_[_0x1e8f('0x4e')](_0x342b6a[_0x1e8f('0x4b')],qs[_0x1e8f('0x50')](_0xeeec7e['query'][_0x1e8f('0x50')]));_0x3fdadd['attributes']=_0x3fdadd[_0x1e8f('0x4f')][_0x1e8f('0x61')]?_0x3fdadd[_0x1e8f('0x4f')]:_0x342b6a['model'];if(!_0xeeec7e[_0x1e8f('0x4c')][_0x1e8f('0x51')]('nolimit')){_0x3fdadd[_0x1e8f('0x20')]=qs[_0x1e8f('0x20')](_0xeeec7e[_0x1e8f('0x4c')][_0x1e8f('0x20')]);_0x3fdadd[_0x1e8f('0x1e')]=qs[_0x1e8f('0x1e')](_0xeeec7e['query'][_0x1e8f('0x1e')]);}_0x3fdadd[_0x1e8f('0x53')]=qs[_0x1e8f('0x54')](_0xeeec7e[_0x1e8f('0x4c')]['sort']);_0x3fdadd[_0x1e8f('0x55')]=qs['filters'](_['pick'](_0xeeec7e[_0x1e8f('0x4c')],_0x342b6a[_0x1e8f('0x57')]));_0x3fdadd[_0x1e8f('0x55')][_0x1e8f('0x6b')]=_0x47bb38['id'];if(_0xeeec7e['query'][_0x1e8f('0x58')]){_0x3fdadd[_0x1e8f('0x55')]=_[_0x1e8f('0x62')](_0x3fdadd['where'],{'$or':_['map'](_0x3fdadd['attributes'],function(_0x176e3b){var _0x3e8b6b={};_0x3e8b6b[_0x176e3b]={'$like':'%'+_0xeeec7e['query'][_0x1e8f('0x58')]+'%'};return _0x3e8b6b;})});}_0x3fdadd=_[_0x1e8f('0x62')]({},_0x3fdadd,_0xeeec7e[_0x1e8f('0x74')]);return db[_0x1e8f('0x73')]['count']({'where':_0x3fdadd[_0x1e8f('0x55')]})['then'](function(_0x18e646){_0x579918['count']=_0x18e646;if(_0xeeec7e[_0x1e8f('0x4c')]['includeAll']){_0x3fdadd[_0x1e8f('0x5b')]=[{'all':!![]}];}return db[_0x1e8f('0x73')]['findAll'](_0x3fdadd);})[_0x1e8f('0x24')](function(_0x162a6f){_0x579918[_0x1e8f('0x5e')]=_0x162a6f;return _0x579918;});}})['then'](respondWithFilteredResult(_0x5ad9ee,_0x3fdadd))[_0x1e8f('0x19')](handleError(_0x5ad9ee,null));};exports[_0x1e8f('0x75')]=function(_0xb42c75,_0x1a6fb5){return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0xb42c75[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x1a6fb5,null))['then'](function(_0x31f0c4){if(_0x31f0c4){return _0x31f0c4[_0x1e8f('0x75')](_0xb42c75[_0x1e8f('0x4c')][_0x1e8f('0x71')]);}})[_0x1e8f('0x24')](respondWithStatusCode(_0x1a6fb5,null))[_0x1e8f('0x19')](handleError(_0x1a6fb5,null));};exports['create']=function(_0xf78769,_0x386550){var _0x371b45={'name':_0xf78769[_0x1e8f('0x63')]['name'],'key':_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x76')],'provider':_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x64')]===_0x1e8f('0x77')?null:_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x64')],'email':_0xf78769[_0x1e8f('0x63')]['email'],'ListId':_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x78')],'active':!_[_0x1e8f('0x79')](_0xf78769[_0x1e8f('0x63')]['active'])?_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x7a')]:!![],'description':_0xf78769[_0x1e8f('0x63')][_0x1e8f('0x7b')]||null};var _0x753cad=getAuthenticationOptions(_0x371b45[_0x1e8f('0x64')],_0xf78769[_0x1e8f('0x63')]);_0x371b45[_0x1e8f('0x3f')]=_0x753cad[_0x1e8f('0x3f')];_0x371b45[_0x1e8f('0x40')]=_0x753cad[_0x1e8f('0x40')];return db[_0x1e8f('0x5c')]['create'](_0x371b45,{'include':[{'model':db['MailServerOut'],'as':_0x1e8f('0x40')},{'model':db['MailServerIn'],'as':_0x1e8f('0x3f')}]})[_0x1e8f('0x24')](function(_0xb61f9e){var _0x4dff3c=_0xf78769['user'][_0x1e8f('0x7c')]({'plain':!![]});if(!_0x4dff3c)throw new Error(_0x1e8f('0x7d'));if(_0x4dff3c[_0x1e8f('0x7e')]===_0x1e8f('0x36')){var _0x24947f=_0xb61f9e['get']({'plain':!![]});return db[_0x1e8f('0x7f')][_0x1e8f('0x66')]({'where':{'name':'MailAccounts','userProfileId':_0x4dff3c[_0x1e8f('0x80')]},'raw':!![]})[_0x1e8f('0x24')](function(_0x2208e8){if(_0x2208e8&&_0x2208e8['autoAssociation']===0x0){return db[_0x1e8f('0x27')][_0x1e8f('0x6d')]({'name':_0x24947f[_0x1e8f('0x29')],'resourceId':_0x24947f['id'],'type':_0x2208e8[_0x1e8f('0x29')],'sectionId':_0x2208e8['id']},{})['then'](function(){return _0xb61f9e;});}else{return _0xb61f9e;}})[_0x1e8f('0x19')](function(_0x511244){logger[_0x1e8f('0x15')](_0x1e8f('0x81'),_0x511244);throw _0x511244;});}return _0xb61f9e;})[_0x1e8f('0x24')](respondWithResult(_0x386550,0xc9))[_0x1e8f('0x19')](handleError(_0x386550,null));};exports[_0x1e8f('0x82')]=function(_0x3093cd,_0x4c20c7){return db[_0x1e8f('0x5c')]['findOne']({'where':{'id':_0x3093cd[_0x1e8f('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c20c7,null))[_0x1e8f('0x24')](function(_0x4bc6e4){if(_0x4bc6e4){return _0x4bc6e4['getImap']();}return null;})[_0x1e8f('0x24')](respondWithResult(_0x4c20c7,null))[_0x1e8f('0x19')](handleError(_0x4c20c7,null));};exports['addImap']=function(_0xfe818d,_0x45f623){if(_0xfe818d[_0x1e8f('0x63')]['id']){delete _0xfe818d[_0x1e8f('0x63')]['id'];}return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0xfe818d[_0x1e8f('0x60')]['id']}})['then'](handleEntityNotFound(_0x45f623,null))[_0x1e8f('0x24')](function(_0x1d6ca4){if(_0x1d6ca4){_0xfe818d[_0x1e8f('0x63')][_0x1e8f('0x6b')]=_0x1d6ca4['id'];return db['MailServerIn']['create'](_0xfe818d[_0x1e8f('0x63')]);}})['then'](respondWithResult(_0x45f623,null))['catch'](handleError(_0x45f623,null));};exports[_0x1e8f('0x83')]=function(_0x8ea6bb,_0x3da95f){return db['MailAccount'][_0x1e8f('0x6f')]({'where':{'id':_0x8ea6bb['params']['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x3da95f,null))['then'](function(_0x59f931){if(_0x59f931){return _0x59f931[_0x1e8f('0x84')](null);}return null;})[_0x1e8f('0x24')](respondWithStatusCode(_0x3da95f,null))[_0x1e8f('0x19')](handleError(_0x3da95f,null));};exports[_0x1e8f('0x85')]=function(_0x2e8a9c,_0x2512f5){return db[_0x1e8f('0x5c')][_0x1e8f('0x6f')]({'where':{'id':_0x2e8a9c[_0x1e8f('0x60')]['id']}})['then'](handleEntityNotFound(_0x2512f5,null))[_0x1e8f('0x24')](function(_0x5ee47e){if(_0x5ee47e){return _0x5ee47e[_0x1e8f('0x85')]();}return null;})[_0x1e8f('0x24')](respondWithResult(_0x2512f5,null))[_0x1e8f('0x19')](handleError(_0x2512f5,null));};exports[_0x1e8f('0x86')]=function(_0x44e38b,_0x260e8e){if(_0x44e38b[_0x1e8f('0x63')]['id']){delete _0x44e38b[_0x1e8f('0x63')]['id'];}return db[_0x1e8f('0x5c')]['find']({'where':{'id':_0x44e38b[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x260e8e,null))[_0x1e8f('0x24')](function(_0x5c72af){if(_0x5c72af){_0x44e38b['body'][_0x1e8f('0x6b')]=_0x5c72af['id'];return db[_0x1e8f('0x44')][_0x1e8f('0x6d')](_0x44e38b[_0x1e8f('0x63')]);}})['then'](respondWithResult(_0x260e8e,null))['catch'](handleError(_0x260e8e,null));};exports['removeSmtp']=function(_0x41b6e2,_0x361ac2){return db['MailAccount']['findOne']({'where':{'id':_0x41b6e2[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x361ac2,null))[_0x1e8f('0x24')](function(_0x383b72){if(_0x383b72){return _0x383b72[_0x1e8f('0x87')](null);}return null;})[_0x1e8f('0x24')](respondWithStatusCode(_0x361ac2,null))[_0x1e8f('0x19')](handleError(_0x361ac2,null));};exports[_0x1e8f('0x88')]=function(_0x2bc114,_0x5a8bc1){return db['MailInteraction'][_0x1e8f('0x66')]({'where':{'id':_0x2bc114[_0x1e8f('0x60')]['id']}})['then'](handleEntityNotFound(_0x5a8bc1,null))[_0x1e8f('0x24')](function(_0x359055){if(_0x359055){return _0x359055[_0x1e8f('0x88')](_0x2bc114[_0x1e8f('0x63')]['ids'],_[_0x1e8f('0x89')](_0x2bc114['body'],[_0x1e8f('0x71'),'id'])||{});}})[_0x1e8f('0x24')](respondWithResult(_0x5a8bc1,null))['catch'](handleError(_0x5a8bc1,null));};exports[_0x1e8f('0x8a')]=function(_0x17e6ef,_0x328de4){var _0x587880={'raw':![],'where':{}};var _0x8b0383={};var _0x855333={'count':0x0,'rows':[]};return db[_0x1e8f('0x5c')][_0x1e8f('0x6f')]({'where':{'id':_0x17e6ef[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x328de4,null))[_0x1e8f('0x24')](function(_0x5acfc1){if(_0x5acfc1){_0x8b0383[_0x1e8f('0x4b')]=_[_0x1e8f('0x4d')](db[_0x1e8f('0x8b')]['rawAttributes']);_0x8b0383[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x17e6ef[_0x1e8f('0x4c')]);_0x8b0383[_0x1e8f('0x57')]=_[_0x1e8f('0x4e')](_0x8b0383['model'],_0x8b0383[_0x1e8f('0x4c')]);_0x587880[_0x1e8f('0x4f')]=_[_0x1e8f('0x4e')](_0x8b0383[_0x1e8f('0x4b')],qs[_0x1e8f('0x50')](_0x17e6ef['query'][_0x1e8f('0x50')]));_0x587880['attributes']=_0x587880[_0x1e8f('0x4f')][_0x1e8f('0x61')]?_0x587880[_0x1e8f('0x4f')]:_0x8b0383[_0x1e8f('0x4b')];if(!_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x51')]('nolimit')){_0x587880[_0x1e8f('0x20')]=qs[_0x1e8f('0x20')](_0x17e6ef[_0x1e8f('0x4c')]['limit']);_0x587880['offset']=qs[_0x1e8f('0x1e')](_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x1e')]);}_0x587880[_0x1e8f('0x53')]=qs['sort'](_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x54')]);_0x587880[_0x1e8f('0x55')]=qs['filters'](_[_0x1e8f('0x56')](_0x17e6ef[_0x1e8f('0x4c')],_0x8b0383['filters']));_0x587880[_0x1e8f('0x55')]['MailAccountId']=_0x5acfc1['id'];if(_0x17e6ef[_0x1e8f('0x4c')]['filter']){_0x587880[_0x1e8f('0x55')]=_[_0x1e8f('0x62')](_0x587880[_0x1e8f('0x55')],{'$or':_[_0x1e8f('0x47')](_0x587880[_0x1e8f('0x4f')],function(_0x614ef4){var _0xf21baf={};_0xf21baf[_0x614ef4]={'$like':'%'+_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0xf21baf;})});}_0x587880=_[_0x1e8f('0x62')]({},_0x587880,_0x17e6ef['options']);return db[_0x1e8f('0x8b')]['count']({'where':_0x587880['where']})['then'](function(_0x5ba7f6){_0x855333[_0x1e8f('0x21')]=_0x5ba7f6;if(_0x17e6ef[_0x1e8f('0x4c')]['includeAll']){_0x587880[_0x1e8f('0x5b')]=[{'model':db[_0x1e8f('0x8c')],'as':_0x1e8f('0x8d'),'required':![]},{'model':db[_0x1e8f('0x8e')],'as':_0x1e8f('0x8f'),'attributes':[_0x1e8f('0x29'),'fullname','internal'],'required':![]},{'model':db[_0x1e8f('0x90')],'as':_0x1e8f('0x91'),'attributes':['id','name','color'],'where':_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x92')]?{'id':_0x17e6ef[_0x1e8f('0x4c')][_0x1e8f('0x92')]}:undefined,'required':_0x17e6ef[_0x1e8f('0x4c')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x1e8f('0x5d')](_0x587880);})[_0x1e8f('0x24')](function(_0x3dd5f4){_0x855333['rows']=_0x3dd5f4;return _0x855333;});}})[_0x1e8f('0x24')](respondWithFilteredResult(_0x328de4,_0x587880))['catch'](handleError(_0x328de4,null));};exports[_0x1e8f('0x93')]=function addApplications(_0x559ff1,_0x4b8396){var _0x482167=_0x559ff1[_0x1e8f('0x60')]['id'];var _0x140e0f=_0x559ff1[_0x1e8f('0x63')];var _0x3e7b79=0xc8;var _0x46195d=null;return db[_0x1e8f('0x94')][_0x1e8f('0x95')]({'isolationLevel':db[_0x1e8f('0x94')][_0x1e8f('0x96')][_0x1e8f('0x97')]['READ_COMMITTED']},function(_0x524112){return db[_0x1e8f('0x5c')][_0x1e8f('0x6f')]({'where':{'id':_0x482167},'transaction':_0x524112})[_0x1e8f('0x24')](function(_0x121626){if(_0x121626){return db[_0x1e8f('0x98')][_0x1e8f('0x25')]({'where':{'MailAccountId':_0x482167},'transaction':_0x524112})['then'](function(){var _0x753883=_['map'](_0x140e0f,function(_0x36e195){_0x36e195['MailAccountId']=_0x482167;return _0x36e195;});return db[_0x1e8f('0x98')]['bulkCreate'](_0x753883,{'transaction':_0x524112});});}else{_0x3e7b79=0x194;_0x46195d=[];}});})[_0x1e8f('0x24')](function(){if(_0x3e7b79!==0x194){return db[_0x1e8f('0x98')][_0x1e8f('0x99')]({'where':{'MailAccountId':_0x482167},'order':_0x1e8f('0x9a')})[_0x1e8f('0x24')](function(_0x336b56){_0x46195d=_0x336b56;});}})[_0x1e8f('0x19')](function(_0x7d379d){_0x3e7b79=0x1f4;logger['error'](_0x7d379d['stack']);if(_0x7d379d[_0x1e8f('0x29')]){delete _0x7d379d[_0x1e8f('0x29')];}_0x46195d=_0x7d379d;})[_0x1e8f('0x9b')](function(){if(_0x46195d===null){_0x4b8396[_0x1e8f('0x1a')](_0x3e7b79);}else{if(_0x3e7b79===0x1f4){_0x4b8396['status'](_0x3e7b79)[_0x1e8f('0x9c')](_0x46195d);}else{_0x4b8396['status'](_0x3e7b79)['json'](_0x46195d);}}});};exports['getApplications']=function(_0x253ad1,_0x34470a){var _0x378f4f={};var _0x4319e7={};var _0x548581;var _0x5d5828;return db['MailAccount'][_0x1e8f('0x6f')]({'where':{'id':_0x253ad1[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x34470a,null))[_0x1e8f('0x24')](function(_0x188cf5){if(_0x188cf5){_0x548581=_0x188cf5;_0x4319e7[_0x1e8f('0x4b')]=_['keys'](db[_0x1e8f('0x98')][_0x1e8f('0x48')]);_0x4319e7[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x253ad1[_0x1e8f('0x4c')]);_0x4319e7[_0x1e8f('0x57')]=_['intersection'](_0x4319e7['model'],_0x4319e7[_0x1e8f('0x4c')]);_0x378f4f[_0x1e8f('0x4f')]=_[_0x1e8f('0x4e')](_0x4319e7[_0x1e8f('0x4b')],qs['fields'](_0x253ad1[_0x1e8f('0x4c')][_0x1e8f('0x50')]));_0x378f4f[_0x1e8f('0x4f')]=_0x378f4f['attributes'][_0x1e8f('0x61')]?_0x378f4f[_0x1e8f('0x4f')]:_0x4319e7['model'];_0x378f4f['order']=qs[_0x1e8f('0x54')](_0x253ad1['query'][_0x1e8f('0x54')]);_0x378f4f[_0x1e8f('0x55')]=qs['filters'](_[_0x1e8f('0x56')](_0x253ad1[_0x1e8f('0x4c')],_0x4319e7[_0x1e8f('0x57')]));if(_0x253ad1[_0x1e8f('0x4c')][_0x1e8f('0x58')]){_0x378f4f[_0x1e8f('0x55')]=_[_0x1e8f('0x62')](_0x378f4f[_0x1e8f('0x55')],{'$or':_[_0x1e8f('0x47')](_0x378f4f[_0x1e8f('0x4f')],function(_0x53b4f3){var _0x46bb6d={};_0x46bb6d[_0x53b4f3]={'$like':'%'+_0x253ad1[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0x46bb6d;})});}_0x378f4f=_[_0x1e8f('0x62')]({},_0x378f4f,_0x253ad1[_0x1e8f('0x74')]);return _0x548581[_0x1e8f('0x9d')](_0x378f4f);}})[_0x1e8f('0x24')](function(_0x4fd0fc){if(_0x4fd0fc){_0x5d5828=_0x4fd0fc[_0x1e8f('0x61')];if(!_0x253ad1['query']['hasOwnProperty'](_0x1e8f('0x52'))){_0x378f4f[_0x1e8f('0x20')]=qs['limit'](_0x253ad1[_0x1e8f('0x4c')][_0x1e8f('0x20')]);_0x378f4f[_0x1e8f('0x1e')]=qs[_0x1e8f('0x1e')](_0x253ad1[_0x1e8f('0x4c')][_0x1e8f('0x1e')]);}return _0x548581[_0x1e8f('0x9d')](_0x378f4f);}})[_0x1e8f('0x24')](function(_0x2069c){if(_0x2069c){return _0x2069c?{'count':_0x5d5828,'rows':_0x2069c}:null;}})[_0x1e8f('0x24')](respondWithResult(_0x34470a,null))[_0x1e8f('0x19')](handleError(_0x34470a,null));};exports[_0x1e8f('0x9e')]=function(_0x4caa7e,_0x195c01){var _0x243a56={'raw':!![],'where':{}};var _0x2a5bd1={};var _0x3b3829={'count':0x0,'rows':[]};return db[_0x1e8f('0x5c')][_0x1e8f('0x6f')]({'where':{'id':_0x4caa7e['params']['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x195c01,null))[_0x1e8f('0x24')](function(_0x3c400d){if(_0x3c400d){_0x2a5bd1[_0x1e8f('0x4b')]=_[_0x1e8f('0x4d')](db['MailMessage'][_0x1e8f('0x48')]);_0x2a5bd1[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x4caa7e[_0x1e8f('0x4c')]);_0x2a5bd1['filters']=_[_0x1e8f('0x4e')](_0x2a5bd1[_0x1e8f('0x4b')],_0x2a5bd1[_0x1e8f('0x4c')]);_0x243a56[_0x1e8f('0x4f')]=_[_0x1e8f('0x4e')](_0x2a5bd1['model'],qs[_0x1e8f('0x50')](_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x50')]));_0x243a56[_0x1e8f('0x4f')]=_0x243a56[_0x1e8f('0x4f')]['length']?_0x243a56['attributes']:_0x2a5bd1[_0x1e8f('0x4b')];if(!_0x4caa7e['query'][_0x1e8f('0x51')]('nolimit')){_0x243a56['limit']=qs[_0x1e8f('0x20')](_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x20')]);_0x243a56[_0x1e8f('0x1e')]=qs[_0x1e8f('0x1e')](_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x1e')]);}_0x243a56[_0x1e8f('0x53')]=qs[_0x1e8f('0x54')](_0x4caa7e['query']['sort']);_0x243a56['where']=qs[_0x1e8f('0x57')](_[_0x1e8f('0x56')](_0x4caa7e['query'],_0x2a5bd1[_0x1e8f('0x57')]));_0x243a56[_0x1e8f('0x55')][_0x1e8f('0x6b')]=_0x3c400d['id'];if(_0x4caa7e['query'][_0x1e8f('0x58')]){_0x243a56['where']=_['merge'](_0x243a56['where'],{'$or':_[_0x1e8f('0x47')](_0x243a56[_0x1e8f('0x4f')],function(_0x53e0ed){var _0x3d9b23={};_0x3d9b23[_0x53e0ed]={'$like':'%'+_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0x3d9b23;})});}if(_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x9f')]){var _0xe08a10=_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x9f')][_0x1e8f('0xa0')](',');var _0x1e0f7c={};_0x1e0f7c[_0xe08a10[0x0]]={'$gte':moment(_0xe08a10[0x1])[_0x1e8f('0xa1')](_0x1e8f('0xa2'))};_0x243a56[_0x1e8f('0x55')]=_['merge'](_0x243a56['where'],_0x1e0f7c);}_0x243a56=_[_0x1e8f('0x62')]({},_0x243a56,_0x4caa7e[_0x1e8f('0x74')]);return db[_0x1e8f('0xa3')][_0x1e8f('0x21')]({'where':_0x243a56[_0x1e8f('0x55')]})['then'](function(_0x5f1bc4){_0x3b3829['count']=_0x5f1bc4;if(_0x4caa7e[_0x1e8f('0x4c')][_0x1e8f('0x5a')]){_0x243a56['include']=[{'all':!![]}];}return db[_0x1e8f('0xa3')][_0x1e8f('0x5d')](_0x243a56);})[_0x1e8f('0x24')](function(_0x3e007c){if(_0x4caa7e['query'][_0x1e8f('0xa4')]===_0x1e8f('0xa5')){for(var _0x3fabc9=0x0;_0x3fabc9<_0x3e007c[_0x1e8f('0x61')];_0x3fabc9++){_0x3e007c[_0x3fabc9][_0x1e8f('0x63')]=juice(_0x3e007c[_0x3fabc9][_0x1e8f('0x63')]);}}_0x3b3829[_0x1e8f('0x5e')]=_0x3e007c;return _0x3b3829;});}})['then'](respondWithFilteredResult(_0x195c01,_0x243a56))[_0x1e8f('0x19')](handleError(_0x195c01,null));};exports[_0x1e8f('0x9c')]=function(_0x281ad9,_0x44a45a){var _0x11e65d,_0x1d9f8c={},_0x406b65;if(_0x281ad9[_0x1e8f('0x63')]['to']){_0x406b65=_0x281ad9[_0x1e8f('0x63')]['to'][_0x1e8f('0xa0')](',')[0x0];}return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x281ad9['params']['id']},'include':[{'model':db[_0x1e8f('0xa6')],'as':_0x1e8f('0xa7'),'include':[{'model':db[_0x1e8f('0x8c')],'as':_0x1e8f('0xa8'),'where':{'email':_0x406b65},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1e8f('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1e8f('0xa9')],'as':'CloudProvider','raw':!![]}]}]})[_0x1e8f('0x24')](handleEntityNotFound(_0x44a45a,null))[_0x1e8f('0x24')](function(_0x12457d){if(!_0x12457d)return;_0x11e65d=_0x12457d;if(!_0x12457d['Smtp'])throw new Error(_0x1e8f('0xaa'));if(_[_0x1e8f('0x79')](_0x281ad9[_0x1e8f('0x63')]['from'])){_0x281ad9['body']['from']=util['format'](_0x1e8f('0xab'),_0x12457d['name'],_0x12457d['email']||_0x12457d[_0x1e8f('0x40')][_0x1e8f('0x36')]);}if(_0x281ad9[_0x1e8f('0x63')]['attachments']&&_0x281ad9['body'][_0x1e8f('0xac')]['length']){for(var _0x50f190=0x0;_0x50f190<_0x281ad9[_0x1e8f('0x63')][_0x1e8f('0xac')][_0x1e8f('0x61')];_0x50f190+=0x1){_0x281ad9[_0x1e8f('0x63')]['attachments'][_0x50f190]={'filename':_0x281ad9['body'][_0x1e8f('0xac')][_0x50f190][_0x1e8f('0x29')],'path':path[_0x1e8f('0xad')](config[_0x1e8f('0xae')],_0x1e8f('0xaf'),_0x281ad9[_0x1e8f('0x63')][_0x1e8f('0xac')][_0x50f190][_0x1e8f('0xb0')])};}}var _0x5b0667=_0x12457d[_0x1e8f('0xb1')]();return respondWithRpcPromise(_0x1e8f('0xb2'),_0x1e8f('0xb3'),{'account':_0x5b0667,'message':_0x281ad9[_0x1e8f('0x63')]});})[_0x1e8f('0x24')](function(_0x1880bf){if(!_0x1880bf)return;_0x1d9f8c=_0x1880bf;if(!_0x11e65d[_0x1e8f('0xa7')])throw new Error(_0x1e8f('0xb4'));if(_0x11e65d[_0x1e8f('0xa7')]['Contacts'][_0x1e8f('0x61')])return _0x11e65d[_0x1e8f('0xa7')][_0x1e8f('0xa8')][0x0];return db[_0x1e8f('0x8c')][_0x1e8f('0x6d')](_['defaults'](_0x281ad9[_0x1e8f('0x63')],{'firstName':_0x281ad9['body']['to'],'email':_0x281ad9[_0x1e8f('0x63')]['to'],'phone':_0x281ad9['body']['to'],'ListId':_0x11e65d[_0x1e8f('0x78')]}));})[_0x1e8f('0x24')](function(_0xdb8143){if(!_0xdb8143)return;var _0x492014={'UserId':_0x281ad9[_0x1e8f('0x36')]['id'],'ContactId':_0xdb8143['id'],'MailAccountId':_0x11e65d['id'],'inReplyTo':_0x1d9f8c[_0x1e8f('0xb5')],'to':_0x281ad9[_0x1e8f('0x63')][_0x1e8f('0xb6')],'cc':_0x281ad9[_0x1e8f('0x63')]['cc'],'subject':_0x281ad9[_0x1e8f('0x63')][_0x1e8f('0xb7')],'attach':_0x281ad9['body'][_0x1e8f('0xb8')],'firstMsgDirection':_0x1e8f('0xb9'),'lastMsgAt':moment()['format'](_0x1e8f('0xa2')),'lastMsgDirection':'out','Messages':[_[_0x1e8f('0x62')](_0x281ad9[_0x1e8f('0x63')],{'messageId':_0x1d9f8c[_0x1e8f('0xb5')],'sentAt':moment()[_0x1e8f('0xa1')](_0x1e8f('0xa2')),'read':!![],'MailAccountId':_0x11e65d['id'],'UserId':_0x281ad9[_0x1e8f('0x36')]['id'],'ContactId':_0xdb8143['id']})]};if(_0x281ad9['body']['Interaction']){_0x492014=_[_0x1e8f('0x62')](_0x492014,_0x281ad9[_0x1e8f('0x63')][_0x1e8f('0xba')]);}return db[_0x1e8f('0x8b')][_0x1e8f('0x6d')](_0x492014,{'include':[{'model':db['MailMessage'],'as':_0x1e8f('0xbb')}]});})[_0x1e8f('0x24')](respondWithResult(_0x44a45a,null))[_0x1e8f('0x19')](handleError(_0x44a45a,null));};exports['verifySmtp']=function(_0x536341,_0x4a9341){return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x536341[_0x1e8f('0x60')]['id']},'include':[{'model':db[_0x1e8f('0x44')],'as':_0x1e8f('0x40'),'raw':!![],'include':[{'model':db[_0x1e8f('0xa9')],'as':_0x1e8f('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4a9341,null))['then'](function(_0x49f091){if(!_0x49f091[_0x1e8f('0x40')])return;var _0x692001=_0x49f091[_0x1e8f('0xb1')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x692001});})['then'](respondWithResult(_0x4a9341,null))[_0x1e8f('0x19')](handleError(_0x4a9341,null));};exports[_0x1e8f('0x25')]=function(_0x428a5e,_0x1c39ac){return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x428a5e[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0x1c39ac,null))[_0x1e8f('0x24')](function(_0x27b1cf){if(_0x27b1cf&&_0x27b1cf[_0x1e8f('0x3d')]){throw new db['Sequelize'][(_0x1e8f('0xbc'))](_0x1e8f('0xbd'));}return _0x27b1cf;})[_0x1e8f('0x24')](removeEntity(_0x1c39ac,null))[_0x1e8f('0x19')](handleError(_0x1c39ac,null));};exports[_0x1e8f('0xbe')]=function(_0x2e150b,_0x2359cf){return db[_0x1e8f('0x5c')][_0x1e8f('0x66')]({'where':{'id':_0x2e150b['params']['id']}})['then'](handleEntityNotFound(_0x2359cf,null))['then'](function(_0x554ffe){if(_0x554ffe){return _0x554ffe['addAgents'](_0x2e150b[_0x1e8f('0x63')][_0x1e8f('0x71')],_[_0x1e8f('0x89')](_0x2e150b[_0x1e8f('0x63')],['ids','id'])||{})['spread'](function(_0x3e83cd){for(var _0x14f545=0x0;_0x14f545<_0x2e150b[_0x1e8f('0x63')][_0x1e8f('0x71')][_0x1e8f('0x61')];_0x14f545+=0x1){socket[_0x1e8f('0xbf')](_0x1e8f('0xc0'),{'UserId':Number(_0x2e150b['body'][_0x1e8f('0x71')][_0x14f545]),'MailAccountId':Number(_0x2e150b[_0x1e8f('0x60')]['id'])});}return _0x3e83cd;});}})['then'](respondWithResult(_0x2359cf,null))[_0x1e8f('0x19')](handleError(_0x2359cf,null));};exports[_0x1e8f('0xc1')]=function(_0x5f074b,_0xda31b){return db['MailAccount'][_0x1e8f('0x66')]({'where':{'id':_0x5f074b[_0x1e8f('0x60')]['id']}})[_0x1e8f('0x24')](handleEntityNotFound(_0xda31b,null))['then'](function(_0x533c58){if(_0x533c58){return _0x533c58['removeAgents'](_0x5f074b[_0x1e8f('0x4c')][_0x1e8f('0x71')])[_0x1e8f('0x24')](function(){if(_[_0x1e8f('0xc2')](_0x5f074b[_0x1e8f('0x4c')]['ids'])){for(var _0x396be5=0x0;_0x396be5<_0x5f074b[_0x1e8f('0x4c')][_0x1e8f('0x71')][_0x1e8f('0x61')];_0x396be5+=0x1){socket[_0x1e8f('0xbf')](_0x1e8f('0xc3'),{'UserId':Number(_0x5f074b['query']['ids'][_0x396be5]),'MailAccountId':Number(_0x5f074b['params']['id'])});}}else{socket[_0x1e8f('0xbf')](_0x1e8f('0xc3'),{'UserId':Number(_0x5f074b[_0x1e8f('0x4c')][_0x1e8f('0x71')]),'MailAccountId':Number(_0x5f074b[_0x1e8f('0x60')]['id'])});}});}})[_0x1e8f('0x24')](respondWithStatusCode(_0xda31b,null))[_0x1e8f('0x19')](handleError(_0xda31b,null));};exports[_0x1e8f('0xc4')]=function(_0x376f33,_0x2a467a){var _0x16ed88={};var _0x29b25e={};var _0x55d45d;var _0x372c9c;return db['MailAccount']['findOne']({'where':{'id':_0x376f33[_0x1e8f('0x60')]['id']}})['then'](handleEntityNotFound(_0x2a467a,null))[_0x1e8f('0x24')](function(_0x2aad5b){if(_0x2aad5b){_0x55d45d=_0x2aad5b;_0x29b25e[_0x1e8f('0x4b')]=_['keys'](db[_0x1e8f('0x8e')]['rawAttributes']);_0x29b25e[_0x1e8f('0x4c')]=_[_0x1e8f('0x4d')](_0x376f33[_0x1e8f('0x4c')]);_0x29b25e[_0x1e8f('0x57')]=_[_0x1e8f('0x4e')](_0x29b25e['model'],_0x29b25e[_0x1e8f('0x4c')]);_0x16ed88[_0x1e8f('0x4f')]=_['intersection'](_0x29b25e[_0x1e8f('0x4b')],qs[_0x1e8f('0x50')](_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x50')]));_0x16ed88[_0x1e8f('0x4f')]=_0x16ed88[_0x1e8f('0x4f')][_0x1e8f('0x61')]?_0x16ed88['attributes']:_0x29b25e['model'];_0x16ed88['order']=qs[_0x1e8f('0x54')](_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x54')]);_0x16ed88[_0x1e8f('0x55')]=qs[_0x1e8f('0x57')](_['pick'](_0x376f33[_0x1e8f('0x4c')],_0x29b25e[_0x1e8f('0x57')]));if(_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x58')]){_0x16ed88[_0x1e8f('0x55')]=_[_0x1e8f('0x62')](_0x16ed88['where'],{'$or':_[_0x1e8f('0x47')](_0x16ed88['attributes'],function(_0x199372){var _0x51c30b={};_0x51c30b[_0x199372]={'$like':'%'+_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x58')]+'%'};return _0x51c30b;})});}_0x16ed88=_[_0x1e8f('0x62')]({},_0x16ed88,_0x376f33['options']);return _0x55d45d[_0x1e8f('0xc4')](_0x16ed88);}})[_0x1e8f('0x24')](function(_0x3b5e62){if(_0x3b5e62){_0x372c9c=_0x3b5e62[_0x1e8f('0x61')];if(!_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x51')](_0x1e8f('0x52'))){_0x16ed88[_0x1e8f('0x20')]=qs['limit'](_0x376f33[_0x1e8f('0x4c')][_0x1e8f('0x20')]);_0x16ed88[_0x1e8f('0x1e')]=qs[_0x1e8f('0x1e')](_0x376f33['query'][_0x1e8f('0x1e')]);}return _0x55d45d['getAgents'](_0x16ed88);}})[_0x1e8f('0x24')](function(_0x53c9b3){if(_0x53c9b3){return _0x53c9b3?{'count':_0x372c9c,'rows':_0x53c9b3}:null;}})[_0x1e8f('0x24')](respondWithResult(_0x2a467a,null))['catch'](handleError(_0x2a467a,null));}; \ No newline at end of file +var _0xfa08=['CloudProviderId','password','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','MailAccount','body','custom','find','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','isNil','active','provider','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','subject','attach','out','messageId','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','modernAuthentication'];(function(_0x153738,_0xe704c1){var _0x3028d9=function(_0x47afa0){while(--_0x47afa0){_0x153738['push'](_0x153738['shift']());}};_0x3028d9(++_0xe704c1);}(_0xfa08,0x8e));var _0x8fa0=function(_0x3f320e,_0x269f24){_0x3f320e=_0x3f320e-0x0;var _0x233347=_0xfa08[_0x3f320e];return _0x233347;};'use strict';var moment=require(_0x8fa0('0x0'));var BPromise=require(_0x8fa0('0x1'));var util=require(_0x8fa0('0x2'));var path=require('path');var _=require(_0x8fa0('0x3'));var juice=require(_0x8fa0('0x4'));var Redis=require('ioredis');var qs=require(_0x8fa0('0x5'));var logger=require(_0x8fa0('0x6'))(_0x8fa0('0x7'));var config=require(_0x8fa0('0x8'));var db=require(_0x8fa0('0x9'))['db'];config[_0x8fa0('0xa')]=_[_0x8fa0('0xb')](config[_0x8fa0('0xa')],{'host':_0x8fa0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fa0('0xa')]));require('./mailAccount.socket')[_0x8fa0('0xd')](socket);var jayson=require(_0x8fa0('0xe'));var client=jayson['client'][_0x8fa0('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x5cd80e,_0x5b886f,_0x2900a3,_0x1be9a7){return new BPromise(function(_0x21bee8,_0x5e843d){var _0x39cc22=_0x1be9a7||client;return _0x39cc22[_0x8fa0('0x10')](_0x5cd80e,_0x2900a3)[_0x8fa0('0x11')](function(_0x1c81aa){logger[_0x8fa0('0x12')]('MailAccount,\x20%s,\x20%s',_0x5b886f,_0x8fa0('0x13'));logger[_0x8fa0('0x14')](_0x8fa0('0x15'),_0x5b886f,'request\x20sent',JSON[_0x8fa0('0x16')](_0x1c81aa));if(_0x1c81aa['error']){if(_0x1c81aa[_0x8fa0('0x17')][_0x8fa0('0x18')]===0x1f4){logger[_0x8fa0('0x17')](_0x8fa0('0x19'),_0x5b886f,_0x1c81aa[_0x8fa0('0x17')][_0x8fa0('0x1a')]);return _0x5e843d(_0x1c81aa['error'][_0x8fa0('0x1a')]);}logger[_0x8fa0('0x17')](_0x8fa0('0x19'),_0x5b886f,_0x1c81aa[_0x8fa0('0x17')][_0x8fa0('0x1a')]);return _0x21bee8(_0x1c81aa[_0x8fa0('0x17')][_0x8fa0('0x1a')]);}else{logger['info'](_0x8fa0('0x19'),_0x5b886f,_0x8fa0('0x13'));_0x21bee8(_0x1c81aa[_0x8fa0('0x1b')]['message']);}})['catch'](function(_0x52be81){logger['error'](_0x8fa0('0x19'),_0x5b886f,_0x52be81);_0x5e843d(_0x52be81);});});}function respondWithStatusCode(_0x567753,_0x2b621b){_0x2b621b=_0x2b621b||0xcc;return function(_0x1294b5){if(_0x1294b5){return _0x567753[_0x8fa0('0x1c')](_0x2b621b);}return _0x567753[_0x8fa0('0x1d')](_0x2b621b)[_0x8fa0('0x1e')]();};}function respondWithResult(_0x280db0,_0x42969a){_0x42969a=_0x42969a||0xc8;return function(_0x567ef2){if(_0x567ef2){return _0x280db0[_0x8fa0('0x1d')](_0x42969a)[_0x8fa0('0x1f')](_0x567ef2);}};}function respondWithFilteredResult(_0x1be30f,_0x4c2df4){return function(_0x99ea43){if(_0x99ea43){var _0x4f36cf=typeof _0x4c2df4['offset']===_0x8fa0('0x20')&&typeof _0x4c2df4['limit']===_0x8fa0('0x20');var _0x3ce1b1=_0x99ea43[_0x8fa0('0x21')];var _0x16250e=_0x4f36cf?0x0:_0x4c2df4[_0x8fa0('0x22')];var _0x5c549a=_0x4f36cf?_0x99ea43[_0x8fa0('0x21')]:_0x4c2df4[_0x8fa0('0x22')]+_0x4c2df4['limit'];var _0x2e4c48;if(_0x5c549a>=_0x3ce1b1){_0x5c549a=_0x3ce1b1;_0x2e4c48=0xc8;}else{_0x2e4c48=0xce;}_0x1be30f[_0x8fa0('0x1d')](_0x2e4c48);return _0x1be30f[_0x8fa0('0x23')](_0x8fa0('0x24'),_0x16250e+'-'+_0x5c549a+'/'+_0x3ce1b1)[_0x8fa0('0x1f')](_0x99ea43);}return null;};}function saveUpdates(_0xe54b90){return function(_0x20628d){if(_0x20628d){return _0x20628d[_0x8fa0('0x25')](_0xe54b90)[_0x8fa0('0x11')](function(_0x30f141){return _0x30f141;});}return null;};}function removeEntity(_0x47cd64){return function(_0x32d6e5){if(_0x32d6e5){return _0x32d6e5[_0x8fa0('0x26')]()[_0x8fa0('0x11')](function(){var _0x31d90b=_0x32d6e5[_0x8fa0('0x27')]({'plain':!![]});var _0x4253a5='MailAccounts';return db[_0x8fa0('0x28')][_0x8fa0('0x26')]({'where':{'type':_0x4253a5,'resourceId':_0x31d90b['id']}})[_0x8fa0('0x11')](function(){return _0x32d6e5;});})[_0x8fa0('0x11')](function(){_0x47cd64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c3214){return function(_0x44d5be){if(!_0x44d5be){_0x5c3214[_0x8fa0('0x1c')](0x194);}return _0x44d5be;};}function handleError(_0x517198,_0x3c346f){_0x3c346f=_0x3c346f||0x1f4;return function(_0x1ff507){logger['error'](_0x1ff507['stack']);if(_0x1ff507[_0x8fa0('0x29')]){delete _0x1ff507[_0x8fa0('0x29')];}_0x517198['status'](_0x3c346f)['send'](_0x1ff507);};}function getImapHost(_0x44a392){switch(_0x44a392){case'gmail':return _0x8fa0('0x2a');case _0x8fa0('0x2b'):return _0x8fa0('0x2c');case _0x8fa0('0x2d'):return _0x8fa0('0x2e');case _0x8fa0('0x2f'):return _0x8fa0('0x30');}throw new Error('Unknown\x20email\x20service\x20provider',_0x44a392);}function getSmtpHost(_0xa2f80c){switch(_0xa2f80c){case _0x8fa0('0x31'):return _0x8fa0('0x32');case'yahoo':return _0x8fa0('0x33');case _0x8fa0('0x2d'):return'smtp-mail.outlook.com';case _0x8fa0('0x2f'):return _0x8fa0('0x34');}throw new Error(_0x8fa0('0x35'),_0xa2f80c);}function getAuthenticationOptions(_0x35a58d,_0x3f441b){var _0x191ec0={};var _0x5e08c3={};if(_0x35a58d){_0x191ec0['user']=_0x5e08c3[_0x8fa0('0x36')]=_0x3f441b[_0x8fa0('0x37')];_0x191ec0['password']=_0x5e08c3['pass']=_0x3f441b['password'];if(_0x3f441b[_0x8fa0('0x38')]){_0x191ec0[_0x8fa0('0x38')]=_0x5e08c3[_0x8fa0('0x38')]=!![];_0x191ec0[_0x8fa0('0x39')]=_0x5e08c3['CloudProviderId']=_0x3f441b[_0x8fa0('0x39')];_0x191ec0[_0x8fa0('0x3a')]=_0x5e08c3[_0x8fa0('0x3b')]=null;}else{_0x191ec0[_0x8fa0('0x39')]=_0x5e08c3['CloudProviderId']=null;}_0x191ec0[_0x8fa0('0x3c')]=getImapHost(_0x35a58d);_0x191ec0[_0x8fa0('0x3d')]=0x3e1;_0x5e08c3[_0x8fa0('0x3c')]=getSmtpHost(_0x35a58d);_0x5e08c3[_0x8fa0('0x3d')]=0x24b;_0x5e08c3[_0x8fa0('0x3e')]=![];_0x191ec0[_0x8fa0('0x3f')]=_0x5e08c3[_0x8fa0('0x3f')]=null;}else{if(_0x3f441b[_0x8fa0('0x40')]){_0x191ec0[_0x8fa0('0x36')]=_0x5e08c3[_0x8fa0('0x36')]=_0x3f441b[_0x8fa0('0x37')];_0x191ec0[_0x8fa0('0x3a')]=_0x5e08c3[_0x8fa0('0x3b')]=_0x3f441b[_0x8fa0('0x3a')];}else{_0x191ec0[_0x8fa0('0x40')]=_0x5e08c3[_0x8fa0('0x40')]=![];_0x191ec0['user']=_0x5e08c3[_0x8fa0('0x36')]=null;_0x191ec0[_0x8fa0('0x3a')]=_0x5e08c3[_0x8fa0('0x3b')]=null;}_0x191ec0['host']=_0x3f441b[_0x8fa0('0x41')][_0x8fa0('0x3c')];_0x191ec0[_0x8fa0('0x3d')]=_0x3f441b[_0x8fa0('0x41')][_0x8fa0('0x3d')];_0x5e08c3[_0x8fa0('0x3c')]=_0x3f441b[_0x8fa0('0x42')]['host'];_0x5e08c3[_0x8fa0('0x3d')]=_0x3f441b[_0x8fa0('0x42')][_0x8fa0('0x3d')];}return{'Imap':_0x191ec0,'Smtp':_0x5e08c3};}exports[_0x8fa0('0x43')]=function(_0x4d2128,_0x265695){var _0x50c40d={'include':[{'model':db[_0x8fa0('0x44')],'as':_0x8fa0('0x41')},{'model':db[_0x8fa0('0x45')],'as':_0x8fa0('0x42')},{'model':db[_0x8fa0('0x46')],'as':_0x8fa0('0x47')}]},_0x3026f3={},_0x25d3b4={'count':0x0,'rows':[]};var _0x573cda=_[_0x8fa0('0x48')](db['MailAccount'][_0x8fa0('0x49')],function(_0x332329){return{'name':_0x332329[_0x8fa0('0x4a')],'type':_0x332329[_0x8fa0('0x4b')][_0x8fa0('0x4c')]};});_0x3026f3[_0x8fa0('0x4d')]=_['map'](_0x573cda,_0x8fa0('0x29'));_0x3026f3[_0x8fa0('0x4e')]=_[_0x8fa0('0x4f')](_0x4d2128['query']);_0x3026f3[_0x8fa0('0x50')]=_[_0x8fa0('0x51')](_0x3026f3[_0x8fa0('0x4d')],_0x3026f3[_0x8fa0('0x4e')]);_0x50c40d[_0x8fa0('0x52')]=_[_0x8fa0('0x51')](_0x3026f3[_0x8fa0('0x4d')],qs[_0x8fa0('0x53')](_0x4d2128[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x50c40d['attributes']=_0x50c40d['attributes'][_0x8fa0('0x54')]?_0x50c40d[_0x8fa0('0x52')]:_0x3026f3[_0x8fa0('0x4d')];if(!_0x4d2128[_0x8fa0('0x4e')]['hasOwnProperty'](_0x8fa0('0x55'))){_0x50c40d[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x4d2128[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x50c40d[_0x8fa0('0x22')]=qs[_0x8fa0('0x22')](_0x4d2128[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}_0x50c40d[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x4d2128['query'][_0x8fa0('0x58')]);_0x50c40d[_0x8fa0('0x59')]=qs[_0x8fa0('0x50')](_[_0x8fa0('0x5a')](_0x4d2128[_0x8fa0('0x4e')],_0x3026f3[_0x8fa0('0x50')]),_0x573cda);if(_0x4d2128[_0x8fa0('0x4e')]['filter']){_0x50c40d['where']=_[_0x8fa0('0x5b')](_0x50c40d[_0x8fa0('0x59')],{'$or':_[_0x8fa0('0x48')](_0x573cda,function(_0x5b5ab2){if(_0x5b5ab2[_0x8fa0('0x4b')]!==_0x8fa0('0x5c')){var _0x4b840d={};_0x4b840d[_0x5b5ab2[_0x8fa0('0x29')]]={'$like':'%'+_0x4d2128[_0x8fa0('0x4e')][_0x8fa0('0x5d')]+'%'};return _0x4b840d;}})});}_0x50c40d=_[_0x8fa0('0x5b')]({},_0x50c40d,_0x4d2128[_0x8fa0('0x5e')]);var _0x45ab08={'where':_0x50c40d[_0x8fa0('0x59')]};return db['MailAccount'][_0x8fa0('0x21')](_0x45ab08)[_0x8fa0('0x11')](function(_0x2f2e69){_0x25d3b4[_0x8fa0('0x21')]=_0x2f2e69;if(_0x4d2128[_0x8fa0('0x4e')][_0x8fa0('0x5f')]){_0x50c40d[_0x8fa0('0x60')]=[{'all':!![]}];}return db['MailAccount'][_0x8fa0('0x61')](_0x50c40d);})[_0x8fa0('0x11')](function(_0x34eab1){_0x25d3b4[_0x8fa0('0x62')]=_0x34eab1;return _0x25d3b4;})[_0x8fa0('0x11')](respondWithFilteredResult(_0x265695,_0x50c40d))[_0x8fa0('0x63')](handleError(_0x265695,null));};exports['show']=function(_0x7d349b,_0x2799fa){var _0x31b625={'raw':![],'where':{'id':_0x7d349b[_0x8fa0('0x64')]['id']},'include':[{'model':db[_0x8fa0('0x44')],'as':_0x8fa0('0x41')},{'model':db[_0x8fa0('0x45')],'as':_0x8fa0('0x42')},{'model':db[_0x8fa0('0x46')],'as':_0x8fa0('0x47')}]},_0x5d6230={};_0x5d6230['model']=_[_0x8fa0('0x4f')](db[_0x8fa0('0x65')][_0x8fa0('0x49')]);_0x5d6230['query']=_[_0x8fa0('0x4f')](_0x7d349b[_0x8fa0('0x4e')]);_0x5d6230[_0x8fa0('0x50')]=_[_0x8fa0('0x51')](_0x5d6230[_0x8fa0('0x4d')],_0x5d6230[_0x8fa0('0x4e')]);_0x31b625[_0x8fa0('0x52')]=_[_0x8fa0('0x51')](_0x5d6230[_0x8fa0('0x4d')],qs[_0x8fa0('0x53')](_0x7d349b[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x31b625[_0x8fa0('0x52')]=_0x31b625['attributes']['length']?_0x31b625[_0x8fa0('0x52')]:_0x5d6230[_0x8fa0('0x4d')];if(_0x7d349b[_0x8fa0('0x4e')][_0x8fa0('0x5f')]){_0x31b625[_0x8fa0('0x60')]=[{'all':!![]}];}_0x31b625=_[_0x8fa0('0x5b')]({},_0x31b625,_0x7d349b[_0x8fa0('0x5e')]);return db[_0x8fa0('0x65')]['find'](_0x31b625)[_0x8fa0('0x11')](handleEntityNotFound(_0x2799fa,null))[_0x8fa0('0x11')](respondWithResult(_0x2799fa,null))[_0x8fa0('0x63')](handleError(_0x2799fa,null));};exports[_0x8fa0('0x25')]=function(_0x473d6b,_0x4793db){if(_0x473d6b['body']['id']){delete _0x473d6b[_0x8fa0('0x66')]['id'];}var _0x161826=_0x473d6b['body']['provider']===_0x8fa0('0x67')?null:_0x473d6b[_0x8fa0('0x66')]['provider'];var _0x4e3479=_0x473d6b['body']['Imap']||{};var _0x5ce251=_0x473d6b[_0x8fa0('0x66')][_0x8fa0('0x42')]||{};if(_0x161826){_0x4e3479['host']=getImapHost(_0x161826);_0x4e3479['port']=0x3e1;_0x5ce251[_0x8fa0('0x3c')]=getSmtpHost(_0x161826);_0x5ce251[_0x8fa0('0x3d')]=0x24b;_0x5ce251[_0x8fa0('0x3e')]=![];}if(_0x5ce251[_0x8fa0('0x38')]){_0x5ce251[_0x8fa0('0x3e')]=![];}else{_0x5ce251[_0x8fa0('0x39')]=null;}if(!_0x4e3479[_0x8fa0('0x38')])_0x4e3479[_0x8fa0('0x39')]=null;_0x473d6b['body'][_0x8fa0('0x41')]=_0x4e3479;_0x473d6b[_0x8fa0('0x66')][_0x8fa0('0x42')]=_0x5ce251;return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x473d6b[_0x8fa0('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x8fa0('0x41')},{'model':db['MailServerOut'],'as':_0x8fa0('0x42')},{'model':db['Pause'],'as':_0x8fa0('0x47')}]})['then'](handleEntityNotFound(_0x4793db,null))[_0x8fa0('0x11')](function(_0x4e5eef){if(!_0x4e5eef)throw new Error(_0x8fa0('0x69'));if(_0x4e5eef[_0x8fa0('0x3f')])delete _0x473d6b[_0x8fa0('0x66')][_0x8fa0('0x41')];return _0x4e5eef;})[_0x8fa0('0x11')](saveUpdates(_0x473d6b['body'],null))[_0x8fa0('0x11')](function(_0x14cc03){if(!_0x473d6b[_0x8fa0('0x66')][_0x8fa0('0x41')])return _0x14cc03;return db[_0x8fa0('0x44')][_0x8fa0('0x25')](_0x473d6b['body'][_0x8fa0('0x41')],{'where':{'MailAccountId':_0x14cc03['id']}})['then'](function(){return _0x14cc03;});})[_0x8fa0('0x11')](function(_0x323c2b){if(!_0x473d6b[_0x8fa0('0x66')]['Smtp'])return _0x323c2b;return db[_0x8fa0('0x45')][_0x8fa0('0x25')](_0x473d6b['body'][_0x8fa0('0x42')],{'where':{'MailAccountId':_0x323c2b['id']}})['then'](function(){return _0x323c2b;});})[_0x8fa0('0x11')](respondWithResult(_0x4793db,null))[_0x8fa0('0x63')](handleError(_0x4793db,null));};exports[_0x8fa0('0x6a')]=function(_0x38f7df,_0x131773){return db[_0x8fa0('0x65')][_0x8fa0('0x6a')]()[_0x8fa0('0x11')](respondWithResult(_0x131773,null))['catch'](handleError(_0x131773,null));};exports['addDisposition']=function(_0x3a09ee,_0x26c0be){if(_0x3a09ee['body']['id']){delete _0x3a09ee[_0x8fa0('0x66')]['id'];}return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x3a09ee[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x26c0be,null))['then'](function(_0x19f8fb){if(_0x19f8fb){_0x3a09ee[_0x8fa0('0x66')][_0x8fa0('0x6b')]=_0x19f8fb['id'];return db['Disposition'][_0x8fa0('0x6c')](_0x3a09ee[_0x8fa0('0x66')]);}})['then'](respondWithResult(_0x26c0be,null))[_0x8fa0('0x63')](handleError(_0x26c0be,null));};exports[_0x8fa0('0x6d')]=function(_0x43e68c,_0x1071c9){var _0x3eda7b={'raw':![],'where':{}};var _0x22a6b3={};var _0x26b3c8={'count':0x0,'rows':[]};return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x43e68c[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x1071c9,null))[_0x8fa0('0x11')](function(_0x68ff81){if(_0x68ff81){_0x22a6b3[_0x8fa0('0x4d')]=_['keys'](db[_0x8fa0('0x6f')][_0x8fa0('0x49')]);_0x22a6b3['query']=_['keys'](_0x43e68c[_0x8fa0('0x4e')]);_0x22a6b3[_0x8fa0('0x50')]=_[_0x8fa0('0x51')](_0x22a6b3[_0x8fa0('0x4d')],_0x22a6b3['query']);_0x3eda7b['attributes']=_[_0x8fa0('0x51')](_0x22a6b3[_0x8fa0('0x4d')],qs['fields'](_0x43e68c[_0x8fa0('0x4e')]['fields']));_0x3eda7b[_0x8fa0('0x52')]=_0x3eda7b[_0x8fa0('0x52')][_0x8fa0('0x54')]?_0x3eda7b[_0x8fa0('0x52')]:_0x22a6b3[_0x8fa0('0x4d')];if(!_0x43e68c[_0x8fa0('0x4e')][_0x8fa0('0x70')](_0x8fa0('0x55'))){_0x3eda7b[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x43e68c[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x3eda7b[_0x8fa0('0x22')]=qs[_0x8fa0('0x22')](_0x43e68c[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}_0x3eda7b[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x43e68c[_0x8fa0('0x4e')]['sort']);_0x3eda7b['where']=qs[_0x8fa0('0x50')](_[_0x8fa0('0x5a')](_0x43e68c[_0x8fa0('0x4e')],_0x22a6b3[_0x8fa0('0x50')]));_0x3eda7b['where']['MailAccountId']=_0x68ff81['id'];if(_0x43e68c[_0x8fa0('0x4e')][_0x8fa0('0x5d')]){_0x3eda7b[_0x8fa0('0x59')]=_[_0x8fa0('0x5b')](_0x3eda7b['where'],{'$or':_[_0x8fa0('0x48')](_0x3eda7b['attributes'],function(_0x5711ef){var _0x919f6a={};_0x919f6a[_0x5711ef]={'$like':'%'+_0x43e68c[_0x8fa0('0x4e')][_0x8fa0('0x5d')]+'%'};return _0x919f6a;})});}_0x3eda7b=_[_0x8fa0('0x5b')]({},_0x3eda7b,_0x43e68c[_0x8fa0('0x5e')]);return db[_0x8fa0('0x6f')][_0x8fa0('0x21')]({'where':_0x3eda7b[_0x8fa0('0x59')]})[_0x8fa0('0x11')](function(_0x1f62b3){_0x26b3c8[_0x8fa0('0x21')]=_0x1f62b3;if(_0x43e68c['query']['includeAll']){_0x3eda7b[_0x8fa0('0x60')]=[{'all':!![]}];}return db['Disposition'][_0x8fa0('0x61')](_0x3eda7b);})[_0x8fa0('0x11')](function(_0x5246d9){_0x26b3c8[_0x8fa0('0x62')]=_0x5246d9;return _0x26b3c8;});}})[_0x8fa0('0x11')](respondWithFilteredResult(_0x1071c9,_0x3eda7b))[_0x8fa0('0x63')](handleError(_0x1071c9,null));};exports['removeDispositions']=function(_0x56e323,_0x248aeb){return db[_0x8fa0('0x65')]['find']({'where':{'id':_0x56e323[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x248aeb,null))['then'](function(_0x13a05b){if(_0x13a05b){return _0x13a05b[_0x8fa0('0x71')](_0x56e323[_0x8fa0('0x4e')][_0x8fa0('0x72')]);}})[_0x8fa0('0x11')](respondWithStatusCode(_0x248aeb,null))['catch'](handleError(_0x248aeb,null));};exports[_0x8fa0('0x73')]=function(_0x142f48,_0x20eb56){if(_0x142f48[_0x8fa0('0x66')]['id']){delete _0x142f48['body']['id'];}return db[_0x8fa0('0x65')]['find']({'where':{'id':_0x142f48['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x20eb56,null))['then'](function(_0x5bc1d8){if(_0x5bc1d8){_0x142f48[_0x8fa0('0x66')]['MailAccountId']=_0x5bc1d8['id'];return db['CannedAnswer'][_0x8fa0('0x6c')](_0x142f48[_0x8fa0('0x66')]);}})[_0x8fa0('0x11')](respondWithResult(_0x20eb56,null))['catch'](handleError(_0x20eb56,null));};exports['getAnswers']=function(_0x3440cd,_0x367088){var _0x166a59={'raw':![],'where':{}};var _0x2990c9={};var _0x188665={'count':0x0,'rows':[]};return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x3440cd['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x367088,null))[_0x8fa0('0x11')](function(_0x2b65c4){if(_0x2b65c4){_0x2990c9[_0x8fa0('0x4d')]=_[_0x8fa0('0x4f')](db['CannedAnswer'][_0x8fa0('0x49')]);_0x2990c9[_0x8fa0('0x4e')]=_[_0x8fa0('0x4f')](_0x3440cd[_0x8fa0('0x4e')]);_0x2990c9[_0x8fa0('0x50')]=_[_0x8fa0('0x51')](_0x2990c9[_0x8fa0('0x4d')],_0x2990c9['query']);_0x166a59['attributes']=_[_0x8fa0('0x51')](_0x2990c9[_0x8fa0('0x4d')],qs[_0x8fa0('0x53')](_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x166a59[_0x8fa0('0x52')]=_0x166a59['attributes'][_0x8fa0('0x54')]?_0x166a59[_0x8fa0('0x52')]:_0x2990c9[_0x8fa0('0x4d')];if(!_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x70')](_0x8fa0('0x55'))){_0x166a59[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x166a59[_0x8fa0('0x22')]=qs[_0x8fa0('0x22')](_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}_0x166a59[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x58')]);_0x166a59[_0x8fa0('0x59')]=qs['filters'](_['pick'](_0x3440cd['query'],_0x2990c9[_0x8fa0('0x50')]));_0x166a59[_0x8fa0('0x59')][_0x8fa0('0x6b')]=_0x2b65c4['id'];if(_0x3440cd[_0x8fa0('0x4e')]['filter']){_0x166a59[_0x8fa0('0x59')]=_[_0x8fa0('0x5b')](_0x166a59[_0x8fa0('0x59')],{'$or':_[_0x8fa0('0x48')](_0x166a59[_0x8fa0('0x52')],function(_0x4998ac){var _0x86ea63={};_0x86ea63[_0x4998ac]={'$like':'%'+_0x3440cd[_0x8fa0('0x4e')][_0x8fa0('0x5d')]+'%'};return _0x86ea63;})});}_0x166a59=_[_0x8fa0('0x5b')]({},_0x166a59,_0x3440cd[_0x8fa0('0x5e')]);return db[_0x8fa0('0x74')][_0x8fa0('0x21')]({'where':_0x166a59[_0x8fa0('0x59')]})['then'](function(_0x37a28b){_0x188665[_0x8fa0('0x21')]=_0x37a28b;if(_0x3440cd['query']['includeAll']){_0x166a59[_0x8fa0('0x60')]=[{'all':!![]}];}return db[_0x8fa0('0x74')][_0x8fa0('0x61')](_0x166a59);})[_0x8fa0('0x11')](function(_0x5b5220){_0x188665[_0x8fa0('0x62')]=_0x5b5220;return _0x188665;});}})['then'](respondWithFilteredResult(_0x367088,_0x166a59))[_0x8fa0('0x63')](handleError(_0x367088,null));};exports[_0x8fa0('0x75')]=function(_0x48b4c7,_0x4db644){return db[_0x8fa0('0x65')]['find']({'where':{'id':_0x48b4c7[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x4db644,null))[_0x8fa0('0x11')](function(_0x809a98){if(_0x809a98){return _0x809a98[_0x8fa0('0x75')](_0x48b4c7[_0x8fa0('0x4e')][_0x8fa0('0x72')]);}})[_0x8fa0('0x11')](respondWithStatusCode(_0x4db644,null))[_0x8fa0('0x63')](handleError(_0x4db644,null));};exports[_0x8fa0('0x6c')]=function(_0x3a7f36,_0x531516){var _0xe2247c={'name':_0x3a7f36['body']['name'],'key':_0x3a7f36[_0x8fa0('0x66')][_0x8fa0('0x4c')],'provider':_0x3a7f36[_0x8fa0('0x66')]['provider']==='custom'?null:_0x3a7f36[_0x8fa0('0x66')]['provider'],'email':_0x3a7f36[_0x8fa0('0x66')]['email'],'ListId':_0x3a7f36[_0x8fa0('0x66')]['ListId'],'active':!_[_0x8fa0('0x76')](_0x3a7f36[_0x8fa0('0x66')][_0x8fa0('0x77')])?_0x3a7f36[_0x8fa0('0x66')][_0x8fa0('0x77')]:!![],'description':_0x3a7f36[_0x8fa0('0x66')]['description']||null};var _0x30c3ab=getAuthenticationOptions(_0xe2247c[_0x8fa0('0x78')],_0x3a7f36['body']);_0xe2247c[_0x8fa0('0x41')]=_0x30c3ab[_0x8fa0('0x41')];_0xe2247c[_0x8fa0('0x42')]=_0x30c3ab[_0x8fa0('0x42')];return db[_0x8fa0('0x65')][_0x8fa0('0x6c')](_0xe2247c,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8fa0('0x44')],'as':_0x8fa0('0x41')}]})[_0x8fa0('0x11')](function(_0x3e397a){var _0x181f85=_0x3a7f36[_0x8fa0('0x36')][_0x8fa0('0x27')]({'plain':!![]});if(!_0x181f85)throw new Error(_0x8fa0('0x79'));if(_0x181f85[_0x8fa0('0x7a')]===_0x8fa0('0x36')){var _0x23c5c2=_0x3e397a['get']({'plain':!![]});return db[_0x8fa0('0x7b')][_0x8fa0('0x68')]({'where':{'name':_0x8fa0('0x7c'),'userProfileId':_0x181f85['userProfileId']},'raw':!![]})['then'](function(_0x4d2357){if(_0x4d2357&&_0x4d2357[_0x8fa0('0x7d')]===0x0){return db[_0x8fa0('0x28')][_0x8fa0('0x6c')]({'name':_0x23c5c2[_0x8fa0('0x29')],'resourceId':_0x23c5c2['id'],'type':_0x4d2357[_0x8fa0('0x29')],'sectionId':_0x4d2357['id']},{})['then'](function(){return _0x3e397a;});}else{return _0x3e397a;}})[_0x8fa0('0x63')](function(_0x280f73){logger[_0x8fa0('0x17')](_0x8fa0('0x7e'),_0x280f73);throw _0x280f73;});}return _0x3e397a;})[_0x8fa0('0x11')](respondWithResult(_0x531516,0xc9))['catch'](handleError(_0x531516,null));};exports[_0x8fa0('0x7f')]=function(_0x3db26e,_0x4fafc0){return db['MailAccount'][_0x8fa0('0x6e')]({'where':{'id':_0x3db26e[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x4fafc0,null))[_0x8fa0('0x11')](function(_0x4c302b){if(_0x4c302b){return _0x4c302b['getImap']();}return null;})[_0x8fa0('0x11')](respondWithResult(_0x4fafc0,null))[_0x8fa0('0x63')](handleError(_0x4fafc0,null));};exports[_0x8fa0('0x80')]=function(_0x15fc54,_0x1c56ba){if(_0x15fc54[_0x8fa0('0x66')]['id']){delete _0x15fc54[_0x8fa0('0x66')]['id'];}return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x15fc54[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x1c56ba,null))[_0x8fa0('0x11')](function(_0x462eb8){if(_0x462eb8){_0x15fc54[_0x8fa0('0x66')][_0x8fa0('0x6b')]=_0x462eb8['id'];return db[_0x8fa0('0x44')][_0x8fa0('0x6c')](_0x15fc54[_0x8fa0('0x66')]);}})[_0x8fa0('0x11')](respondWithResult(_0x1c56ba,null))[_0x8fa0('0x63')](handleError(_0x1c56ba,null));};exports[_0x8fa0('0x81')]=function(_0x64725b,_0x16c20a){return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x64725b['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x16c20a,null))[_0x8fa0('0x11')](function(_0x504405){if(_0x504405){return _0x504405[_0x8fa0('0x82')](null);}return null;})[_0x8fa0('0x11')](respondWithStatusCode(_0x16c20a,null))[_0x8fa0('0x63')](handleError(_0x16c20a,null));};exports[_0x8fa0('0x83')]=function(_0x2595e5,_0x22ee4c){return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x2595e5['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x22ee4c,null))[_0x8fa0('0x11')](function(_0x59500f){if(_0x59500f){return _0x59500f['getSmtp']();}return null;})['then'](respondWithResult(_0x22ee4c,null))[_0x8fa0('0x63')](handleError(_0x22ee4c,null));};exports[_0x8fa0('0x84')]=function(_0x27faf1,_0x20a8da){if(_0x27faf1['body']['id']){delete _0x27faf1[_0x8fa0('0x66')]['id'];}return db[_0x8fa0('0x65')]['find']({'where':{'id':_0x27faf1['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x20a8da,null))[_0x8fa0('0x11')](function(_0x143f5a){if(_0x143f5a){_0x27faf1[_0x8fa0('0x66')][_0x8fa0('0x6b')]=_0x143f5a['id'];return db['MailServerOut']['create'](_0x27faf1[_0x8fa0('0x66')]);}})[_0x8fa0('0x11')](respondWithResult(_0x20a8da,null))[_0x8fa0('0x63')](handleError(_0x20a8da,null));};exports[_0x8fa0('0x85')]=function(_0x727d4e,_0x5b8736){return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x727d4e[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x5b8736,null))[_0x8fa0('0x11')](function(_0x52bf7a){if(_0x52bf7a){return _0x52bf7a[_0x8fa0('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x5b8736,null))[_0x8fa0('0x63')](handleError(_0x5b8736,null));};exports[_0x8fa0('0x87')]=function(_0x4d7b09,_0x47c8e3){return db[_0x8fa0('0x88')][_0x8fa0('0x68')]({'where':{'id':_0x4d7b09[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x47c8e3,null))[_0x8fa0('0x11')](function(_0xf9201e){if(_0xf9201e){return _0xf9201e[_0x8fa0('0x87')](_0x4d7b09['body'][_0x8fa0('0x72')],_[_0x8fa0('0x89')](_0x4d7b09[_0x8fa0('0x66')],[_0x8fa0('0x72'),'id'])||{});}})[_0x8fa0('0x11')](respondWithResult(_0x47c8e3,null))[_0x8fa0('0x63')](handleError(_0x47c8e3,null));};exports[_0x8fa0('0x8a')]=function(_0x4b9272,_0xa89801){var _0x12a546={'raw':![],'where':{}};var _0x54f6ea={};var _0x166ee0={'count':0x0,'rows':[]};return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x4b9272['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0xa89801,null))[_0x8fa0('0x11')](function(_0x46172b){if(_0x46172b){_0x54f6ea[_0x8fa0('0x4d')]=_[_0x8fa0('0x4f')](db['MailInteraction'][_0x8fa0('0x49')]);_0x54f6ea[_0x8fa0('0x4e')]=_[_0x8fa0('0x4f')](_0x4b9272['query']);_0x54f6ea['filters']=_['intersection'](_0x54f6ea['model'],_0x54f6ea[_0x8fa0('0x4e')]);_0x12a546[_0x8fa0('0x52')]=_[_0x8fa0('0x51')](_0x54f6ea['model'],qs[_0x8fa0('0x53')](_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x12a546['attributes']=_0x12a546[_0x8fa0('0x52')]['length']?_0x12a546[_0x8fa0('0x52')]:_0x54f6ea[_0x8fa0('0x4d')];if(!_0x4b9272[_0x8fa0('0x4e')]['hasOwnProperty'](_0x8fa0('0x55'))){_0x12a546['limit']=qs[_0x8fa0('0x56')](_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x12a546[_0x8fa0('0x22')]=qs['offset'](_0x4b9272[_0x8fa0('0x4e')]['offset']);}_0x12a546[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x58')]);_0x12a546[_0x8fa0('0x59')]=qs[_0x8fa0('0x50')](_[_0x8fa0('0x5a')](_0x4b9272[_0x8fa0('0x4e')],_0x54f6ea['filters']));_0x12a546[_0x8fa0('0x59')]['MailAccountId']=_0x46172b['id'];if(_0x4b9272['query'][_0x8fa0('0x5d')]){_0x12a546['where']=_[_0x8fa0('0x5b')](_0x12a546[_0x8fa0('0x59')],{'$or':_[_0x8fa0('0x48')](_0x12a546[_0x8fa0('0x52')],function(_0x1f9c26){var _0x289ae7={};_0x289ae7[_0x1f9c26]={'$like':'%'+_0x4b9272['query']['filter']+'%'};return _0x289ae7;})});}_0x12a546=_[_0x8fa0('0x5b')]({},_0x12a546,_0x4b9272[_0x8fa0('0x5e')]);return db[_0x8fa0('0x88')][_0x8fa0('0x21')]({'where':_0x12a546['where']})[_0x8fa0('0x11')](function(_0x72cb59){_0x166ee0[_0x8fa0('0x21')]=_0x72cb59;if(_0x4b9272[_0x8fa0('0x4e')]['includeAll']){_0x12a546[_0x8fa0('0x60')]=[{'model':db[_0x8fa0('0x8b')],'as':_0x8fa0('0x8c'),'required':![]},{'model':db[_0x8fa0('0x8d')],'as':_0x8fa0('0x8e'),'attributes':[_0x8fa0('0x29'),_0x8fa0('0x8f'),_0x8fa0('0x90')],'required':![]},{'model':db[_0x8fa0('0x91')],'as':_0x8fa0('0x92'),'attributes':['id',_0x8fa0('0x29'),_0x8fa0('0x93')],'where':_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x94')]?{'id':_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x94')]}:undefined,'required':_0x4b9272[_0x8fa0('0x4e')][_0x8fa0('0x94')]?!![]:![]}];}return db[_0x8fa0('0x88')][_0x8fa0('0x61')](_0x12a546);})['then'](function(_0x3f669b){_0x166ee0[_0x8fa0('0x62')]=_0x3f669b;return _0x166ee0;});}})['then'](respondWithFilteredResult(_0xa89801,_0x12a546))['catch'](handleError(_0xa89801,null));};exports[_0x8fa0('0x95')]=function addApplications(_0x1a6f7b,_0x20ea5f){var _0x22bf7a=_0x1a6f7b[_0x8fa0('0x64')]['id'];var _0x120453=_0x1a6f7b[_0x8fa0('0x66')];var _0x2e2f84=0xc8;var _0x121dd7=null;return db[_0x8fa0('0x96')][_0x8fa0('0x97')]({'isolationLevel':db[_0x8fa0('0x96')]['Transaction'][_0x8fa0('0x98')][_0x8fa0('0x99')]},function(_0x55ec97){return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x22bf7a},'transaction':_0x55ec97})[_0x8fa0('0x11')](function(_0x313f3c){if(_0x313f3c){return db[_0x8fa0('0x9a')][_0x8fa0('0x26')]({'where':{'MailAccountId':_0x22bf7a},'transaction':_0x55ec97})[_0x8fa0('0x11')](function(){var _0x3925c9=_['map'](_0x120453,function(_0x3240cd){_0x3240cd[_0x8fa0('0x6b')]=_0x22bf7a;return _0x3240cd;});return db['MailApplication'][_0x8fa0('0x9b')](_0x3925c9,{'transaction':_0x55ec97});});}else{_0x2e2f84=0x194;_0x121dd7=[];}});})['then'](function(){if(_0x2e2f84!==0x194){return db[_0x8fa0('0x9a')][_0x8fa0('0x9c')]({'where':{'MailAccountId':_0x22bf7a},'order':_0x8fa0('0x9d')})['then'](function(_0x3fa0f5){_0x121dd7=_0x3fa0f5;});}})[_0x8fa0('0x63')](function(_0x4b3387){_0x2e2f84=0x1f4;logger[_0x8fa0('0x17')](_0x4b3387['stack']);if(_0x4b3387[_0x8fa0('0x29')]){delete _0x4b3387['name'];}_0x121dd7=_0x4b3387;})['finally'](function(){if(_0x121dd7===null){_0x20ea5f['sendStatus'](_0x2e2f84);}else{if(_0x2e2f84===0x1f4){_0x20ea5f[_0x8fa0('0x1d')](_0x2e2f84)[_0x8fa0('0x9e')](_0x121dd7);}else{_0x20ea5f[_0x8fa0('0x1d')](_0x2e2f84)[_0x8fa0('0x1f')](_0x121dd7);}}});};exports[_0x8fa0('0x9f')]=function(_0x25c602,_0x21e232){var _0x4ff342={};var _0x510977={};var _0x2553ac;var _0x591ab7;return db[_0x8fa0('0x65')]['findOne']({'where':{'id':_0x25c602[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x21e232,null))[_0x8fa0('0x11')](function(_0x56fc3a){if(_0x56fc3a){_0x2553ac=_0x56fc3a;_0x510977[_0x8fa0('0x4d')]=_[_0x8fa0('0x4f')](db[_0x8fa0('0x9a')][_0x8fa0('0x49')]);_0x510977[_0x8fa0('0x4e')]=_[_0x8fa0('0x4f')](_0x25c602[_0x8fa0('0x4e')]);_0x510977[_0x8fa0('0x50')]=_['intersection'](_0x510977[_0x8fa0('0x4d')],_0x510977[_0x8fa0('0x4e')]);_0x4ff342[_0x8fa0('0x52')]=_['intersection'](_0x510977[_0x8fa0('0x4d')],qs[_0x8fa0('0x53')](_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x4ff342[_0x8fa0('0x52')]=_0x4ff342[_0x8fa0('0x52')]['length']?_0x4ff342[_0x8fa0('0x52')]:_0x510977[_0x8fa0('0x4d')];_0x4ff342[_0x8fa0('0x57')]=qs['sort'](_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x58')]);_0x4ff342['where']=qs['filters'](_[_0x8fa0('0x5a')](_0x25c602['query'],_0x510977[_0x8fa0('0x50')]));if(_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x5d')]){_0x4ff342['where']=_[_0x8fa0('0x5b')](_0x4ff342[_0x8fa0('0x59')],{'$or':_[_0x8fa0('0x48')](_0x4ff342[_0x8fa0('0x52')],function(_0x5801c8){var _0x2ded6e={};_0x2ded6e[_0x5801c8]={'$like':'%'+_0x25c602['query']['filter']+'%'};return _0x2ded6e;})});}_0x4ff342=_[_0x8fa0('0x5b')]({},_0x4ff342,_0x25c602[_0x8fa0('0x5e')]);return _0x2553ac[_0x8fa0('0x9f')](_0x4ff342);}})[_0x8fa0('0x11')](function(_0x3bbd4b){if(_0x3bbd4b){_0x591ab7=_0x3bbd4b[_0x8fa0('0x54')];if(!_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x70')](_0x8fa0('0x55'))){_0x4ff342[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x4ff342[_0x8fa0('0x22')]=qs[_0x8fa0('0x22')](_0x25c602[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}return _0x2553ac['getApplications'](_0x4ff342);}})[_0x8fa0('0x11')](function(_0x2b8398){if(_0x2b8398){return _0x2b8398?{'count':_0x591ab7,'rows':_0x2b8398}:null;}})[_0x8fa0('0x11')](respondWithResult(_0x21e232,null))[_0x8fa0('0x63')](handleError(_0x21e232,null));};exports[_0x8fa0('0xa0')]=function(_0x431b34,_0x4bca83){var _0x55c606={'raw':!![],'where':{}};var _0x5309d={};var _0x58c98a={'count':0x0,'rows':[]};return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x431b34[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x4bca83,null))[_0x8fa0('0x11')](function(_0x1cda76){if(_0x1cda76){_0x5309d[_0x8fa0('0x4d')]=_[_0x8fa0('0x4f')](db[_0x8fa0('0xa1')][_0x8fa0('0x49')]);_0x5309d[_0x8fa0('0x4e')]=_[_0x8fa0('0x4f')](_0x431b34[_0x8fa0('0x4e')]);_0x5309d['filters']=_[_0x8fa0('0x51')](_0x5309d[_0x8fa0('0x4d')],_0x5309d[_0x8fa0('0x4e')]);_0x55c606[_0x8fa0('0x52')]=_[_0x8fa0('0x51')](_0x5309d[_0x8fa0('0x4d')],qs[_0x8fa0('0x53')](_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x55c606[_0x8fa0('0x52')]=_0x55c606[_0x8fa0('0x52')][_0x8fa0('0x54')]?_0x55c606[_0x8fa0('0x52')]:_0x5309d[_0x8fa0('0x4d')];if(!_0x431b34['query'][_0x8fa0('0x70')](_0x8fa0('0x55'))){_0x55c606[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x431b34['query'][_0x8fa0('0x56')]);_0x55c606[_0x8fa0('0x22')]=qs['offset'](_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}_0x55c606[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0x58')]);_0x55c606[_0x8fa0('0x59')]=qs[_0x8fa0('0x50')](_['pick'](_0x431b34[_0x8fa0('0x4e')],_0x5309d[_0x8fa0('0x50')]));_0x55c606[_0x8fa0('0x59')][_0x8fa0('0x6b')]=_0x1cda76['id'];if(_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0x5d')]){_0x55c606['where']=_['merge'](_0x55c606[_0x8fa0('0x59')],{'$or':_['map'](_0x55c606['attributes'],function(_0x31159e){var _0x5e7e87={};_0x5e7e87[_0x31159e]={'$like':'%'+_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0x5d')]+'%'};return _0x5e7e87;})});}if(_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0xa2')]){var _0x32c7bf=_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0xa2')][_0x8fa0('0xa3')](',');var _0x28184b={};_0x28184b[_0x32c7bf[0x0]]={'$gte':moment(_0x32c7bf[0x1])[_0x8fa0('0xa4')](_0x8fa0('0xa5'))};_0x55c606[_0x8fa0('0x59')]=_[_0x8fa0('0x5b')](_0x55c606['where'],_0x28184b);}_0x55c606=_[_0x8fa0('0x5b')]({},_0x55c606,_0x431b34[_0x8fa0('0x5e')]);return db[_0x8fa0('0xa1')]['count']({'where':_0x55c606['where']})[_0x8fa0('0x11')](function(_0x32a875){_0x58c98a[_0x8fa0('0x21')]=_0x32a875;if(_0x431b34['query'][_0x8fa0('0x5f')]){_0x55c606[_0x8fa0('0x60')]=[{'all':!![]}];}return db['MailMessage'][_0x8fa0('0x61')](_0x55c606);})[_0x8fa0('0x11')](function(_0x174680){if(_0x431b34[_0x8fa0('0x4e')][_0x8fa0('0xa6')]==='true'){for(var _0x4273b8=0x0;_0x4273b8<_0x174680['length'];_0x4273b8++){_0x174680[_0x4273b8][_0x8fa0('0x66')]=juice(_0x174680[_0x4273b8][_0x8fa0('0x66')]);}}_0x58c98a[_0x8fa0('0x62')]=_0x174680;return _0x58c98a;});}})[_0x8fa0('0x11')](respondWithFilteredResult(_0x4bca83,_0x55c606))[_0x8fa0('0x63')](handleError(_0x4bca83,null));};exports['send']=function(_0x2a3678,_0x1bd445){var _0x4d0909,_0x57150d={},_0x1d123e;if(_0x2a3678['body']['to']){_0x1d123e=_0x2a3678[_0x8fa0('0x66')]['to']['split'](',')[0x0];}return db[_0x8fa0('0x65')]['find']({'where':{'id':_0x2a3678[_0x8fa0('0x64')]['id']},'include':[{'model':db[_0x8fa0('0xa7')],'as':_0x8fa0('0xa8'),'include':[{'model':db[_0x8fa0('0x8b')],'as':'Contacts','where':{'email':_0x1d123e},'limit':0x1,'order':[[_0x8fa0('0xa9'),_0x8fa0('0xaa')]]}]},{'model':db['MailServerOut'],'as':_0x8fa0('0x42'),'raw':!![],'include':[{'model':db[_0x8fa0('0xab')],'as':_0x8fa0('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1bd445,null))[_0x8fa0('0x11')](function(_0x145b75){if(!_0x145b75)return;_0x4d0909=_0x145b75;if(!_0x145b75['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xac')])){_0x2a3678['body'][_0x8fa0('0xac')]=util[_0x8fa0('0xa4')](_0x8fa0('0xad'),_0x145b75['name'],_0x145b75['email']||_0x145b75[_0x8fa0('0x42')]['user']);}if(_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xae')]&&_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xae')]['length']){for(var _0x4f918b=0x0;_0x4f918b<_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xae')]['length'];_0x4f918b+=0x1){_0x2a3678['body']['attachments'][_0x4f918b]={'filename':_0x2a3678['body'][_0x8fa0('0xae')][_0x4f918b]['name'],'path':path[_0x8fa0('0xaf')](config[_0x8fa0('0xb0')],_0x8fa0('0xb1'),_0x2a3678['body'][_0x8fa0('0xae')][_0x4f918b]['basename'])};}}var _0x402519=_0x145b75[_0x8fa0('0xb2')]();return respondWithRpcPromise(_0x8fa0('0xb3'),_0x8fa0('0xb4'),{'account':_0x402519,'message':_0x2a3678[_0x8fa0('0x66')]});})[_0x8fa0('0x11')](function(_0x1ded59){if(!_0x1ded59)return;_0x57150d=_0x1ded59;if(!_0x4d0909[_0x8fa0('0xa8')])throw new Error(_0x8fa0('0xb5'));if(_0x4d0909['List'][_0x8fa0('0xb6')][_0x8fa0('0x54')])return _0x4d0909[_0x8fa0('0xa8')][_0x8fa0('0xb6')][0x0];return db['CmContact']['create'](_[_0x8fa0('0xb')](_0x2a3678[_0x8fa0('0x66')],{'firstName':_0x2a3678[_0x8fa0('0x66')]['to'],'email':_0x2a3678[_0x8fa0('0x66')]['to'],'phone':_0x2a3678['body']['to'],'ListId':_0x4d0909['ListId']}));})[_0x8fa0('0x11')](function(_0x13d5ed){if(!_0x13d5ed)return;var _0x242022={'UserId':_0x2a3678[_0x8fa0('0x36')]['id'],'ContactId':_0x13d5ed['id'],'MailAccountId':_0x4d0909['id'],'inReplyTo':_0x57150d['messageId'],'to':_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xac')],'cc':_0x2a3678['body']['cc'],'subject':_0x2a3678['body'][_0x8fa0('0xb7')],'attach':_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xb8')],'firstMsgDirection':_0x8fa0('0xb9'),'lastMsgAt':moment()['format'](_0x8fa0('0xa5')),'lastMsgDirection':'out','Messages':[_[_0x8fa0('0x5b')](_0x2a3678[_0x8fa0('0x66')],{'messageId':_0x57150d[_0x8fa0('0xba')],'sentAt':moment()[_0x8fa0('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4d0909['id'],'UserId':_0x2a3678['user']['id'],'ContactId':_0x13d5ed['id']})]};if(_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xbb')]){_0x242022=_['merge'](_0x242022,_0x2a3678[_0x8fa0('0x66')][_0x8fa0('0xbb')]);}return db['MailInteraction']['create'](_0x242022,{'include':[{'model':db[_0x8fa0('0xa1')],'as':_0x8fa0('0xbc')}]});})[_0x8fa0('0x11')](respondWithResult(_0x1bd445,null))[_0x8fa0('0x63')](handleError(_0x1bd445,null));};exports[_0x8fa0('0xbd')]=function(_0x30d374,_0x2ccbc2){return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x30d374[_0x8fa0('0x64')]['id']},'include':[{'model':db[_0x8fa0('0x45')],'as':_0x8fa0('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8fa0('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2ccbc2,null))['then'](function(_0x14007e){if(!_0x14007e[_0x8fa0('0x42')])return;var _0x2c2fad=_0x14007e['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x8fa0('0xbd'),{'account':_0x2c2fad});})[_0x8fa0('0x11')](respondWithResult(_0x2ccbc2,null))[_0x8fa0('0x63')](handleError(_0x2ccbc2,null));};exports[_0x8fa0('0x26')]=function(_0x428187,_0x27a411){return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x428187[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x27a411,null))['then'](function(_0x5d24dc){if(_0x5d24dc&&_0x5d24dc['service']){throw new db[(_0x8fa0('0xbe'))][(_0x8fa0('0xbf'))](_0x8fa0('0xc0'));}return _0x5d24dc;})[_0x8fa0('0x11')](removeEntity(_0x27a411,null))[_0x8fa0('0x63')](handleError(_0x27a411,null));};exports[_0x8fa0('0xc1')]=function(_0x58982d,_0x324c34){return db['MailAccount'][_0x8fa0('0x68')]({'where':{'id':_0x58982d[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x324c34,null))[_0x8fa0('0x11')](function(_0x5753c6){if(_0x5753c6){return _0x5753c6[_0x8fa0('0xc1')](_0x58982d[_0x8fa0('0x66')][_0x8fa0('0x72')],_[_0x8fa0('0x89')](_0x58982d[_0x8fa0('0x66')],[_0x8fa0('0x72'),'id'])||{})['spread'](function(_0x2b9707){for(var _0x53e021=0x0;_0x53e021<_0x58982d[_0x8fa0('0x66')][_0x8fa0('0x72')]['length'];_0x53e021+=0x1){socket[_0x8fa0('0xc2')](_0x8fa0('0xc3'),{'UserId':Number(_0x58982d[_0x8fa0('0x66')]['ids'][_0x53e021]),'MailAccountId':Number(_0x58982d[_0x8fa0('0x64')]['id'])});}return _0x2b9707;});}})[_0x8fa0('0x11')](respondWithResult(_0x324c34,null))[_0x8fa0('0x63')](handleError(_0x324c34,null));};exports[_0x8fa0('0xc4')]=function(_0x4ee7b9,_0x4a781c){return db[_0x8fa0('0x65')][_0x8fa0('0x68')]({'where':{'id':_0x4ee7b9[_0x8fa0('0x64')]['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x4a781c,null))[_0x8fa0('0x11')](function(_0x170bf2){if(_0x170bf2){return _0x170bf2['removeAgents'](_0x4ee7b9['query']['ids'])[_0x8fa0('0x11')](function(){if(_['isArray'](_0x4ee7b9[_0x8fa0('0x4e')]['ids'])){for(var _0x3ef080=0x0;_0x3ef080<_0x4ee7b9[_0x8fa0('0x4e')][_0x8fa0('0x72')][_0x8fa0('0x54')];_0x3ef080+=0x1){socket[_0x8fa0('0xc2')](_0x8fa0('0xc5'),{'UserId':Number(_0x4ee7b9[_0x8fa0('0x4e')][_0x8fa0('0x72')][_0x3ef080]),'MailAccountId':Number(_0x4ee7b9[_0x8fa0('0x64')]['id'])});}}else{socket[_0x8fa0('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x4ee7b9['query']['ids']),'MailAccountId':Number(_0x4ee7b9[_0x8fa0('0x64')]['id'])});}});}})[_0x8fa0('0x11')](respondWithStatusCode(_0x4a781c,null))[_0x8fa0('0x63')](handleError(_0x4a781c,null));};exports[_0x8fa0('0xc6')]=function(_0x5544e6,_0x1a363b){var _0x1f9dff={};var _0x7bd238={};var _0x241151;var _0x3b1286;return db[_0x8fa0('0x65')][_0x8fa0('0x6e')]({'where':{'id':_0x5544e6['params']['id']}})[_0x8fa0('0x11')](handleEntityNotFound(_0x1a363b,null))['then'](function(_0x2e1c99){if(_0x2e1c99){_0x241151=_0x2e1c99;_0x7bd238[_0x8fa0('0x4d')]=_[_0x8fa0('0x4f')](db[_0x8fa0('0x8d')][_0x8fa0('0x49')]);_0x7bd238['query']=_[_0x8fa0('0x4f')](_0x5544e6['query']);_0x7bd238[_0x8fa0('0x50')]=_[_0x8fa0('0x51')](_0x7bd238['model'],_0x7bd238[_0x8fa0('0x4e')]);_0x1f9dff[_0x8fa0('0x52')]=_['intersection'](_0x7bd238[_0x8fa0('0x4d')],qs['fields'](_0x5544e6[_0x8fa0('0x4e')][_0x8fa0('0x53')]));_0x1f9dff[_0x8fa0('0x52')]=_0x1f9dff['attributes']['length']?_0x1f9dff[_0x8fa0('0x52')]:_0x7bd238[_0x8fa0('0x4d')];_0x1f9dff[_0x8fa0('0x57')]=qs[_0x8fa0('0x58')](_0x5544e6[_0x8fa0('0x4e')][_0x8fa0('0x58')]);_0x1f9dff[_0x8fa0('0x59')]=qs[_0x8fa0('0x50')](_[_0x8fa0('0x5a')](_0x5544e6['query'],_0x7bd238[_0x8fa0('0x50')]));if(_0x5544e6[_0x8fa0('0x4e')]['filter']){_0x1f9dff[_0x8fa0('0x59')]=_[_0x8fa0('0x5b')](_0x1f9dff['where'],{'$or':_[_0x8fa0('0x48')](_0x1f9dff[_0x8fa0('0x52')],function(_0x1e6a66){var _0x3cf1ba={};_0x3cf1ba[_0x1e6a66]={'$like':'%'+_0x5544e6['query'][_0x8fa0('0x5d')]+'%'};return _0x3cf1ba;})});}_0x1f9dff=_[_0x8fa0('0x5b')]({},_0x1f9dff,_0x5544e6[_0x8fa0('0x5e')]);return _0x241151[_0x8fa0('0xc6')](_0x1f9dff);}})['then'](function(_0x46092f){if(_0x46092f){_0x3b1286=_0x46092f[_0x8fa0('0x54')];if(!_0x5544e6[_0x8fa0('0x4e')][_0x8fa0('0x70')](_0x8fa0('0x55'))){_0x1f9dff[_0x8fa0('0x56')]=qs[_0x8fa0('0x56')](_0x5544e6[_0x8fa0('0x4e')][_0x8fa0('0x56')]);_0x1f9dff[_0x8fa0('0x22')]=qs[_0x8fa0('0x22')](_0x5544e6[_0x8fa0('0x4e')][_0x8fa0('0x22')]);}return _0x241151[_0x8fa0('0xc6')](_0x1f9dff);}})[_0x8fa0('0x11')](function(_0x56f9cb){if(_0x56f9cb){return _0x56f9cb?{'count':_0x3b1286,'rows':_0x56f9cb}:null;}})[_0x8fa0('0x11')](respondWithResult(_0x1a363b,null))[_0x8fa0('0x63')](handleError(_0x1a363b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 181d62b..e7f2ea2 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 _0xd798=['save','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x6a4437,_0x25b47f){var _0x8b9e47=function(_0x33403b){while(--_0x33403b){_0x6a4437['push'](_0x6a4437['shift']());}};_0x8b9e47(++_0x25b47f);}(_0xd798,0x77));var _0x8d79=function(_0x5bb392,_0x2be3bc){_0x5bb392=_0x5bb392-0x0;var _0x2bb8f1=_0xd798[_0x5bb392];return _0x2bb8f1;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8d79('0x0')](0x0);var events={'afterCreate':_0x8d79('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19cae2){return function(_0x87bc7,_0x15829a,_0x5dc45c){MailAccountEvents[_0x8d79('0x2')](_0x19cae2+':'+_0x87bc7['id'],_0x87bc7);MailAccountEvents[_0x8d79('0x2')](_0x19cae2,_0x87bc7);_0x5dc45c(null);};}for(var e in events){if(events[_0x8d79('0x3')](e)){var event=events[e];MailAccount[_0x8d79('0x4')](e,emitEvent(event));}}module[_0x8d79('0x5')]=MailAccountEvents; \ No newline at end of file +var _0x0eeb=['../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x16bc92,_0x1b0935){var _0x27a2d2=function(_0x334beb){while(--_0x334beb){_0x16bc92['push'](_0x16bc92['shift']());}};_0x27a2d2(++_0x1b0935);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0eeb[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xb0ee('0x0'));var MailAccount=require(_0xb0ee('0x1'))['db'][_0xb0ee('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb0ee('0x3')](0x0);var events={'afterCreate':_0xb0ee('0x4'),'afterUpdate':_0xb0ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5add55){return function(_0x3b94a0,_0xfbf0cc,_0x13a7ce){MailAccountEvents[_0xb0ee('0x6')](_0x5add55+':'+_0x3b94a0['id'],_0x3b94a0);MailAccountEvents[_0xb0ee('0x6')](_0x5add55,_0x3b94a0);_0x13a7ce(null);};}for(var e in events){if(events[_0xb0ee('0x7')](e)){var event=events[e];MailAccount[_0xb0ee('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 9d84a7e..fab3c11 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 _0x7dab=['secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','CloudProvider','data5','auth','user','pass','./mailAccount.attributes','exports','define','mail_accounts','provider','custom','service','host','port','Smtp'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7dab,0xed));var _0xb7da=function(_0x2f25da,_0x4598be){_0x2f25da=_0x2f25da-0x0;var _0x45d56c=_0x7dab[_0x2f25da];return _0x45d56c;};'use strict';var attributes=require(_0xb7da('0x0'));module[_0xb7da('0x1')]=function(_0x50aac5){return _0x50aac5[_0xb7da('0x2')]('MailAccount',attributes,{'tableName':_0xb7da('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x8b78ef=this;var _0x3d0828={'id':_0x8b78ef['id'],'tls':{'rejectUnauthorized':![]}};if(_0x8b78ef[_0xb7da('0x4')]!==_0xb7da('0x5')){_0x3d0828[_0xb7da('0x6')]=_0x8b78ef[_0xb7da('0x4')];}else{_0x3d0828[_0xb7da('0x7')]=_0x8b78ef['Smtp'][_0xb7da('0x7')];_0x3d0828[_0xb7da('0x8')]=_0x8b78ef[_0xb7da('0x9')][_0xb7da('0x8')];_0x3d0828['secure']=_0x8b78ef[_0xb7da('0x9')][_0xb7da('0xa')];}if(_0x8b78ef[_0xb7da('0x9')][_0xb7da('0xb')]){if(_0x8b78ef[_0xb7da('0x9')][_0xb7da('0xc')]){if(!_0x8b78ef[_0xb7da('0x9')]['CloudProvider'])throw new Error(_0xb7da('0xd'));_0x3d0828['auth']={'type':'OAuth2','user':_0x8b78ef[_0xb7da('0x9')]['user'],'accessToken':_0x8b78ef['Smtp'][_0xb7da('0xe')][_0xb7da('0xf')]};}else{_0x3d0828[_0xb7da('0x10')]={'user':_0x8b78ef[_0xb7da('0x9')][_0xb7da('0x11')],'pass':_0x8b78ef['Smtp'][_0xb7da('0x12')]};}}return _0x3d0828;}}});}; \ No newline at end of file +var _0x151c=['Smtp','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','CloudProvider','data5','user','pass','exports','MailAccount','mail_accounts','provider','custom','service','host'];(function(_0x36039d,_0x2a8cd1){var _0x37b073=function(_0x5d8082){while(--_0x5d8082){_0x36039d['push'](_0x36039d['shift']());}};_0x37b073(++_0x2a8cd1);}(_0x151c,0x1cd));var _0xc151=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x151c[_0x2dafbe];return _0x58a45a;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xc151('0x0')]=function(_0x414786){return _0x414786['define'](_0xc151('0x1'),attributes,{'tableName':_0xc151('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3e9a1f=this;var _0x40de0f={'id':_0x3e9a1f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3e9a1f[_0xc151('0x3')]!==_0xc151('0x4')){_0x40de0f[_0xc151('0x5')]=_0x3e9a1f['provider'];}else{_0x40de0f[_0xc151('0x6')]=_0x3e9a1f[_0xc151('0x7')][_0xc151('0x6')];_0x40de0f['port']=_0x3e9a1f['Smtp']['port'];_0x40de0f[_0xc151('0x8')]=_0x3e9a1f['Smtp'][_0xc151('0x8')];}if(_0x3e9a1f[_0xc151('0x7')][_0xc151('0x9')]){if(_0x3e9a1f['Smtp'][_0xc151('0xa')]){if(!_0x3e9a1f[_0xc151('0x7')]['CloudProvider'])throw new Error(_0xc151('0xb'));_0x40de0f[_0xc151('0xc')]={'type':_0xc151('0xd'),'user':_0x3e9a1f[_0xc151('0x7')]['user'],'accessToken':_0x3e9a1f[_0xc151('0x7')][_0xc151('0xe')][_0xc151('0xf')]};}else{_0x40de0f[_0xc151('0xc')]={'user':_0x3e9a1f[_0xc151('0x7')][_0xc151('0x10')],'pass':_0x3e9a1f[_0xc151('0x7')][_0xc151('0x11')]};}}return _0x40de0f;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 26b3ab5..1e808ba 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 _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x258f44,_0x307b39){var _0x4cdafd=function(_0x36ffe8){while(--_0x36ffe8){_0x258f44['push'](_0x258f44['shift']());}};_0x4cdafd(++_0x307b39);}(_0xc2c7,0x134));var _0x7c2c=function(_0x36eab3,_0x1d97f2){_0x36eab3=_0x36eab3-0x0;var _0x70168d=_0xc2c7[_0x36eab3];return _0x70168d;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ 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(_0x474e22,_0x5d5515){var _0x76a179=function(_0x4dc2ff){while(--_0x4dc2ff){_0x474e22['push'](_0x474e22['shift']());}};_0x76a179(++_0x5d5515);}(_0x1967,0x173));var _0x7196=function(_0x1cecbc,_0x8c1111){_0x1cecbc=_0x1cecbc-0x0;var _0x4dde2a=_0x1967[_0x1cecbc];return _0x4dde2a;};'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 0065202..d547052 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 _0xf443=['./mailAccount.events','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x2433e7,_0x3430a1){var _0x5a4919=function(_0x4bef63){while(--_0x4bef63){_0x2433e7['push'](_0x2433e7['shift']());}};_0x5a4919(++_0x3430a1);}(_0xf443,0x1c8));var _0x3f44=function(_0x49c30e,_0x40422c){_0x49c30e=_0x49c30e-0x0;var _0x155bf6=_0xf443[_0x49c30e];return _0x155bf6;};'use strict';var MailAccountEvents=require(_0x3f44('0x0'));var events=['save',_0x3f44('0x1'),_0x3f44('0x2')];function createListener(_0x4dd238,_0x21bf46){return function(_0x41c3d2){_0x21bf46[_0x3f44('0x3')](_0x4dd238,_0x41c3d2);};}function removeListener(_0x8ada15,_0x29d527){return function(){MailAccountEvents[_0x3f44('0x4')](_0x8ada15,_0x29d527);};}exports[_0x3f44('0x5')]=function(_0xbb2707){for(var _0x22d56a=0x0,_0x52c70d=events[_0x3f44('0x6')];_0x22d56a<_0x52c70d;_0x22d56a++){var _0x905c6d=events[_0x22d56a];var _0x5d8256=createListener(_0x3f44('0x7')+_0x905c6d,_0xbb2707);MailAccountEvents['on'](_0x905c6d,_0x5d8256);}}; \ No newline at end of file +var _0x6ade=['removeListener','register','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0xdb7dc,_0x525361){var _0x36d8f1=function(_0x1fc169){while(--_0x1fc169){_0xdb7dc['push'](_0xdb7dc['shift']());}};_0x36d8f1(++_0x525361);}(_0x6ade,0x15a));var _0xe6ad=function(_0x542450,_0x4a5c37){_0x542450=_0x542450-0x0;var _0x438418=_0x6ade[_0x542450];return _0x438418;};'use strict';var MailAccountEvents=require(_0xe6ad('0x0'));var events=['save',_0xe6ad('0x1'),_0xe6ad('0x2')];function createListener(_0x568d63,_0x21bb78){return function(_0x1e0b44){_0x21bb78[_0xe6ad('0x3')](_0x568d63,_0x1e0b44);};}function removeListener(_0x44be51,_0x699122){return function(){MailAccountEvents[_0xe6ad('0x4')](_0x44be51,_0x699122);};}exports[_0xe6ad('0x5')]=function(_0x443c90){for(var _0x108415=0x0,_0x1beead=events['length'];_0x108415<_0x1beead;_0x108415++){var _0x21b093=events[_0x108415];var _0x1c2123=createListener(_0xe6ad('0x6')+_0x21b093,_0x443c90);MailAccountEvents['on'](_0x21b093,_0x1c2123);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9c3dd97..8625001 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 _0x2078=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','update','multer','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x2078,0x1a2));var _0x8207=function(_0x2ad8ce,_0x44a5e7){_0x2ad8ce=_0x2ad8ce-0x0;var _0x507323=_0x2078[_0x2ad8ce];return _0x507323;};'use strict';var multer=require(_0x8207('0x0'));var util=require(_0x8207('0x1'));var path=require('path');var timeout=require(_0x8207('0x2'));var express=require('express');var router=express[_0x8207('0x3')]();var fs_extra=require(_0x8207('0x4'));var auth=require(_0x8207('0x5'));var interaction=require(_0x8207('0x6'));var config=require(_0x8207('0x7'));var controller=require(_0x8207('0x8'));router[_0x8207('0x9')](_0x8207('0xa'),auth[_0x8207('0xb')](),controller[_0x8207('0xc')]);router['put'](_0x8207('0xa'),auth[_0x8207('0xb')](),controller[_0x8207('0xd')]);router['delete'](_0x8207('0xa'),auth[_0x8207('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1a19=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','update','destroy','multer'];(function(_0xde524,_0x79b09f){var _0x3ffc46=function(_0x532701){while(--_0x532701){_0xde524['push'](_0xde524['shift']());}};_0x3ffc46(++_0x79b09f);}(_0x1a19,0x13f));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x91a1('0x0'));var util=require(_0x91a1('0x1'));var path=require(_0x91a1('0x2'));var timeout=require(_0x91a1('0x3'));var express=require(_0x91a1('0x4'));var router=express[_0x91a1('0x5')]();var fs_extra=require(_0x91a1('0x6'));var auth=require(_0x91a1('0x7'));var interaction=require(_0x91a1('0x8'));var config=require(_0x91a1('0x9'));var controller=require('./mailApplication.controller');router['get'](_0x91a1('0xa'),auth[_0x91a1('0xb')](),controller[_0x91a1('0xc')]);router[_0x91a1('0xd')](_0x91a1('0xa'),auth[_0x91a1('0xb')](),controller[_0x91a1('0xe')]);router['delete'](_0x91a1('0xa'),auth[_0x91a1('0xb')](),controller[_0x91a1('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e5ddec1..0cb839f 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 _0x5865=['STRING','sequelize','INTEGER'];(function(_0xea53cd,_0x49e9d2){var _0x163561=function(_0x2667aa){while(--_0x2667aa){_0xea53cd['push'](_0xea53cd['shift']());}};_0x163561(++_0x49e9d2);}(_0x5865,0x193));var _0x5586=function(_0x10eb44,_0x3c6d28){_0x10eb44=_0x10eb44-0x0;var _0xba7303=_0x5865[_0x10eb44];return _0xba7303;};'use strict';var Sequelize=require(_0x5586('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5586('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5586('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5586('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa692=['STRING','sequelize','INTEGER'];(function(_0x1ea676,_0x5ddcf7){var _0x2c4f66=function(_0xe6747a){while(--_0xe6747a){_0x1ea676['push'](_0x1ea676['shift']());}};_0x2c4f66(++_0x5ddcf7);}(_0xa692,0x15d));var _0x2a69=function(_0x76d2ec,_0x45ea7c){_0x76d2ec=_0x76d2ec-0x0;var _0x540bdc=_0xa692[_0x76d2ec];return _0x540bdc;};'use strict';var Sequelize=require(_0x2a69('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2a69('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2a69('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2a69('0x2')]},'interval':{'type':Sequelize[_0x2a69('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 62c2f20..90aa014 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 _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xedd9,0xfc));var _0x9edd=function(_0x469f66,_0x2daba6){_0x469f66=_0x469f66-0x0;var _0x442f79=_0xedd9[_0x469f66];return _0x442f79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2e8c7e,_0x28648a){var _0x48fded=function(_0x55b9c5){while(--_0x55b9c5){_0x2e8c7e['push'](_0x2e8c7e['shift']());}};_0x48fded(++_0x28648a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3f30ff,_0x293e00){_0x3f30ff=_0x3f30ff-0x0;var _0x339084=_0x9bde[_0x3f30ff];return _0x339084;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f27abc5..535acc4 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 _0xf0f4=['../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5d927b,_0x2d7eb8){var _0x5438d4=function(_0x353fe5){while(--_0x353fe5){_0x5d927b['push'](_0x5d927b['shift']());}};_0x5438d4(++_0x2d7eb8);}(_0xf0f4,0x13e));var _0x4f0f=function(_0x1e8a44,_0x595f07){_0x1e8a44=_0x1e8a44-0x0;var _0x585ad3=_0xf0f4[_0x1e8a44];return _0x585ad3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f0f('0x0'))(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require(_0x4f0f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f0f('0x4'));var rimraf=require(_0x4f0f('0x5'));var config=require(_0x4f0f('0x6'));var attributes=require(_0x4f0f('0x7'));module['exports']=function(_0x2d5722,_0x33ceef){return _0x2d5722[_0x4f0f('0x8')](_0x4f0f('0x9'),attributes,{'tableName':_0x4f0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f0f('0xb')});}; \ No newline at end of file +var _0x5bba=['rimraf','define','MailApplication','mail_applications','utf8mb4','util','../../config/logger','request-promise','path'];(function(_0x48092d,_0x4e1c8a){var _0x2cb71c=function(_0x13d6f4){while(--_0x13d6f4){_0x48092d['push'](_0x48092d['shift']());}};_0x2cb71c(++_0x4e1c8a);}(_0x5bba,0x140));var _0xa5bb=function(_0x218ada,_0x2194b5){_0x218ada=_0x218ada-0x0;var _0x3caba9=_0x5bba[_0x218ada];return _0x3caba9;};'use strict';var _=require('lodash');var util=require(_0xa5bb('0x0'));var logger=require(_0xa5bb('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5bb('0x2'));var fs=require('fs');var path=require(_0xa5bb('0x3'));var rimraf=require(_0xa5bb('0x4'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x5919d9,_0x3fa7bf){return _0x5919d9[_0xa5bb('0x5')](_0xa5bb('0x6'),attributes,{'tableName':_0xa5bb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5bb('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 5ae9697..403547a 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 _0x28e1=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','then','lodash','util','moment'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x28e1,0xcf));var _0x128e=function(_0x19eba9,_0xc0a946){_0x19eba9=_0x19eba9-0x0;var _0x20a59b=_0x28e1[_0x19eba9];return _0x20a59b;};'use strict';var _=require(_0x128e('0x0'));var util=require(_0x128e('0x1'));var moment=require(_0x128e('0x2'));var BPromise=require('bluebird');var rs=require(_0x128e('0x3'));var fs=require('fs');var Redis=require(_0x128e('0x4'));var db=require(_0x128e('0x5'))['db'];var utils=require(_0x128e('0x6'));var logger=require('../../config/logger')(_0x128e('0x7'));var config=require('../../config/environment');var jayson=require(_0x128e('0x8'));var client=jayson[_0x128e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527bb1,_0x495357,_0x438d37){return new BPromise(function(_0x1a8c08,_0x51de99){return client[_0x128e('0xa')](_0x527bb1,_0x438d37)['then'](function(_0x2815ce){logger['info'](_0x128e('0xb'),_0x495357,_0x128e('0xc'));logger[_0x128e('0xd')](_0x128e('0xe'),_0x495357,_0x128e('0xc'),JSON[_0x128e('0xf')](_0x2815ce));if(_0x2815ce[_0x128e('0x10')]){if(_0x2815ce[_0x128e('0x10')][_0x128e('0x11')]===0x1f4){logger['error'](_0x128e('0xb'),_0x495357,_0x2815ce[_0x128e('0x10')][_0x128e('0x12')]);return _0x51de99(_0x2815ce['error'][_0x128e('0x12')]);}logger[_0x128e('0x10')]('MailApplication,\x20%s,\x20%s',_0x495357,_0x2815ce['error'][_0x128e('0x12')]);return _0x1a8c08(_0x2815ce[_0x128e('0x10')][_0x128e('0x12')]);}else{logger[_0x128e('0x13')](_0x128e('0xb'),_0x495357,_0x128e('0xc'));_0x1a8c08(_0x2815ce[_0x128e('0x14')][_0x128e('0x12')]);}})[_0x128e('0x15')](function(_0x2f5659){logger[_0x128e('0x10')]('MailApplication,\x20%s,\x20%s',_0x495357,_0x2f5659);_0x51de99(_0x2f5659);});});}exports[_0x128e('0x16')]=function(_0x330ea7){var _0x56ec26=this;return new Promise(function(_0x160869,_0x547d64){return db[_0x128e('0x17')][_0x128e('0x18')](_0x330ea7[_0x128e('0x19')],{'raw':_0x330ea7[_0x128e('0x1a')]?_0x330ea7['options'][_0x128e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330ea7[_0x128e('0x1a')]?_0x330ea7[_0x128e('0x1a')]['where']||null:null,'attributes':_0x330ea7['options']?_0x330ea7[_0x128e('0x1a')][_0x128e('0x1c')]||null:null,'limit':_0x330ea7[_0x128e('0x1a')]?_0x330ea7[_0x128e('0x1a')]['limit']||null:null})[_0x128e('0x1d')](function(_0x5cd5e3){logger['info']('UpdateMailApplication',_0x330ea7);logger[_0x128e('0xd')](_0x128e('0x16'),_0x330ea7,JSON[_0x128e('0xf')](_0x5cd5e3));_0x160869(_0x5cd5e3);})['catch'](function(_0x56e6c0){logger[_0x128e('0x10')](_0x128e('0x16'),_0x56e6c0[_0x128e('0x12')],_0x330ea7);_0x547d64(_0x56ec26[_0x128e('0x10')](0x1f4,_0x56e6c0['message']));});});}; \ No newline at end of file +var _0x48b2=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','info','lodash','util','moment'];(function(_0x3146a4,_0x9a0675){var _0x18fe41=function(_0x57d93e){while(--_0x57d93e){_0x3146a4['push'](_0x3146a4['shift']());}};_0x18fe41(++_0x9a0675);}(_0x48b2,0x176));var _0x248b=function(_0x3f0b4f,_0x4302dd){_0x3f0b4f=_0x3f0b4f-0x0;var _0x52d841=_0x48b2[_0x3f0b4f];return _0x52d841;};'use strict';var _=require(_0x248b('0x0'));var util=require(_0x248b('0x1'));var moment=require(_0x248b('0x2'));var BPromise=require(_0x248b('0x3'));var rs=require(_0x248b('0x4'));var fs=require('fs');var Redis=require(_0x248b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x248b('0x6'));var logger=require('../../config/logger')(_0x248b('0x7'));var config=require(_0x248b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x248b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5189bb,_0x14fc46,_0x109fd7){return new BPromise(function(_0xa580ff,_0x376960){return client[_0x248b('0xa')](_0x5189bb,_0x109fd7)[_0x248b('0xb')](function(_0x5be12f){logger['info'](_0x248b('0xc'),_0x14fc46,'request\x20sent');logger[_0x248b('0xd')](_0x248b('0xe'),_0x14fc46,'request\x20sent',JSON[_0x248b('0xf')](_0x5be12f));if(_0x5be12f[_0x248b('0x10')]){if(_0x5be12f['error'][_0x248b('0x11')]===0x1f4){logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f['error']['message']);return _0x376960(_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);}logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);return _0xa580ff(_0x5be12f[_0x248b('0x10')]['message']);}else{logger['info'](_0x248b('0xc'),_0x14fc46,_0x248b('0x13'));_0xa580ff(_0x5be12f['result'][_0x248b('0x12')]);}})[_0x248b('0x14')](function(_0x304dba){logger[_0x248b('0x10')]('MailApplication,\x20%s,\x20%s',_0x14fc46,_0x304dba);_0x376960(_0x304dba);});});}exports[_0x248b('0x15')]=function(_0x146300){var _0xaa8232=this;return new Promise(function(_0x3bb21f,_0x4de01a){return db[_0x248b('0x16')]['update'](_0x146300[_0x248b('0x17')],{'raw':_0x146300[_0x248b('0x18')]?_0x146300[_0x248b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x146300[_0x248b('0x18')]?_0x146300[_0x248b('0x18')][_0x248b('0x19')]||null:null,'attributes':_0x146300[_0x248b('0x18')]?_0x146300[_0x248b('0x18')][_0x248b('0x1a')]||null:null,'limit':_0x146300['options']?_0x146300[_0x248b('0x18')][_0x248b('0x1b')]||null:null})[_0x248b('0xb')](function(_0x543b46){logger[_0x248b('0x1c')](_0x248b('0x15'),_0x146300);logger['debug']('UpdateMailApplication',_0x146300,JSON[_0x248b('0xf')](_0x543b46));_0x3bb21f(_0x543b46);})[_0x248b('0x14')](function(_0x2657e3){logger['error'](_0x248b('0x15'),_0x2657e3[_0x248b('0x12')],_0x146300);_0x4de01a(_0xaa8232[_0x248b('0x10')](0x1f4,_0x2657e3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0fbed6a..f02e6a5 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 _0x5fe8=['tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','/:id/tags'];(function(_0x276764,_0x16d12f){var _0x43d916=function(_0x1579f7){while(--_0x1579f7){_0x276764['push'](_0x276764['shift']());}};_0x43d916(++_0x16d12f);}(_0x5fe8,0x8c));var _0x85fe=function(_0x4750ac,_0x4ad64b){_0x4750ac=_0x4750ac-0x0;var _0x67de85=_0x5fe8[_0x4750ac];return _0x67de85;};'use strict';var express=require(_0x85fe('0x0'));var router=express[_0x85fe('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x85fe('0x2'));var controller=require(_0x85fe('0x3'));router[_0x85fe('0x4')]('/',auth['isAuthenticated'](),controller[_0x85fe('0x5')]);router['get'](_0x85fe('0x6'),auth[_0x85fe('0x7')](),controller[_0x85fe('0x8')]);router[_0x85fe('0x4')](_0x85fe('0x9'),auth[_0x85fe('0x7')](),controller[_0x85fe('0xa')]);router[_0x85fe('0x4')](_0x85fe('0xb'),auth[_0x85fe('0x7')](),controller[_0x85fe('0xc')]);router[_0x85fe('0x4')](_0x85fe('0xd'),auth[_0x85fe('0x7')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x85fe('0xe')]('/:id/messages',auth[_0x85fe('0x7')](),controller['addMessage']);router[_0x85fe('0xe')](_0x85fe('0xf'),auth[_0x85fe('0x7')](),interaction[_0x85fe('0x10')](_0x85fe('0x11'),_0x85fe('0x12')),controller[_0x85fe('0x13')]);router['put'](_0x85fe('0x9'),auth[_0x85fe('0x7')](),interaction[_0x85fe('0x10')]('mail',_0x85fe('0x14')),controller[_0x85fe('0x15')]);router[_0x85fe('0x16')](_0x85fe('0x9'),auth[_0x85fe('0x7')](),interaction[_0x85fe('0x10')](_0x85fe('0x11'),'mailinteraction:destroy'),controller[_0x85fe('0x17')]);router[_0x85fe('0x16')](_0x85fe('0xf'),auth[_0x85fe('0x7')](),controller[_0x85fe('0x18')]);module[_0x85fe('0x19')]=router; \ No newline at end of file +var _0x1ca9=['tracked','delete','mailinteraction:destroy','destroy','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put'];(function(_0x59481b,_0x4c7624){var _0x55e559=function(_0x15c3a4){while(--_0x15c3a4){_0x59481b['push'](_0x59481b['shift']());}};_0x55e559(++_0x4c7624);}(_0x1ca9,0x86));var _0x91ca=function(_0x247d7a,_0x5cead7){_0x247d7a=_0x247d7a-0x0;var _0x443fed=_0x1ca9[_0x247d7a];return _0x443fed;};'use strict';var express=require(_0x91ca('0x0'));var router=express[_0x91ca('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x91ca('0x2'));var controller=require(_0x91ca('0x3'));router[_0x91ca('0x4')]('/',auth[_0x91ca('0x5')](),controller[_0x91ca('0x6')]);router[_0x91ca('0x4')](_0x91ca('0x7'),auth[_0x91ca('0x5')](),controller[_0x91ca('0x8')]);router[_0x91ca('0x4')](_0x91ca('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x91ca('0x4')](_0x91ca('0xa'),auth['isAuthenticated'](),controller[_0x91ca('0xb')]);router[_0x91ca('0x4')](_0x91ca('0xc'),auth['isAuthenticated'](),controller[_0x91ca('0xd')]);router[_0x91ca('0xe')]('/',auth['isAuthenticated'](),controller[_0x91ca('0xf')]);router[_0x91ca('0xe')](_0x91ca('0xa'),auth[_0x91ca('0x5')](),controller[_0x91ca('0x10')]);router['post'](_0x91ca('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x91ca('0x12'),_0x91ca('0x13')),controller[_0x91ca('0x14')]);router[_0x91ca('0x15')](_0x91ca('0x9'),auth[_0x91ca('0x5')](),interaction[_0x91ca('0x16')](_0x91ca('0x12'),'mailinteraction:update'),controller['update']);router[_0x91ca('0x17')](_0x91ca('0x9'),auth[_0x91ca('0x5')](),interaction[_0x91ca('0x16')](_0x91ca('0x12'),_0x91ca('0x18')),controller[_0x91ca('0x19')]);router[_0x91ca('0x17')](_0x91ca('0x11'),auth[_0x91ca('0x5')](),controller['removeTags']);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 2910a64..9a364bc 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 _0xb6a9=['TEXT','long','DATE','ENUM','sequelize','iconv','BOOLEAN','STRING'];(function(_0x524ce0,_0x3670b2){var _0x38299f=function(_0x513ef4){while(--_0x513ef4){_0x524ce0['push'](_0x524ce0['shift']());}};_0x38299f(++_0x3670b2);}(_0xb6a9,0xc4));var _0x9b6a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb6a9[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x9b6a('0x0'));var iconv=require(_0x9b6a('0x1'));module['exports']={'closed':{'type':Sequelize[_0x9b6a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9b6a('0x3')]},'secondDisposition':{'type':Sequelize[_0x9b6a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9b6a('0x3')]},'note':{'type':Sequelize[_0x9b6a('0x3')]},'inReplyTo':{'type':Sequelize[_0x9b6a('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9b6a('0x4')](_0x9b6a('0x5'))},'subject':{'type':Sequelize[_0x9b6a('0x4')]()},'attach':{'type':Sequelize[_0x9b6a('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9b6a('0x6')]},'substatus':{'type':Sequelize[_0x9b6a('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9b6a('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9b6a('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x9b6a('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9b6a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf712=['STRING','TEXT','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x2b61a0,_0x59eb38){var _0x501adc=function(_0x231227){while(--_0x231227){_0x2b61a0['push'](_0x2b61a0['shift']());}};_0x501adc(++_0x59eb38);}(_0xf712,0x19c));var _0x2f71=function(_0x58654c,_0x365f37){_0x58654c=_0x58654c-0x0;var _0x44ac78=_0xf712[_0x58654c];return _0x44ac78;};'use strict';var Sequelize=require(_0x2f71('0x0'));var iconv=require('iconv');module[_0x2f71('0x1')]={'closed':{'type':Sequelize[_0x2f71('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2f71('0x3')]},'disposition':{'type':Sequelize[_0x2f71('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2f71('0x4')]},'note':{'type':Sequelize[_0x2f71('0x4')]},'inReplyTo':{'type':Sequelize[_0x2f71('0x4')](0x1fe)},'to':{'type':Sequelize[_0x2f71('0x4')]},'cc':{'type':Sequelize[_0x2f71('0x5')]('long')},'subject':{'type':Sequelize[_0x2f71('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x2f71('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2f71('0x6')]('in',_0x2f71('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2f71('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2f71('0x6')]('in',_0x2f71('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2f71('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b0b9bf0..9f27dfb 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 _0xe5da=['../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','end','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','findAll','query','user','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','omit','ids','findOne','MailMessage','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','mkdirSync','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','path','juice','ioredis'];(function(_0x443fe6,_0xcc1e25){var _0x1dfbee=function(_0x4263a0){while(--_0x4263a0){_0x443fe6['push'](_0x443fe6['shift']());}};_0x1dfbee(++_0xcc1e25);}(_0xe5da,0x6c));var _0xae5d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe5da[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xae5d('0x0'));var rimraf=require(_0xae5d('0x1'));var zipdir=require(_0xae5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xae5d('0x3'));var path=require(_0xae5d('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0xae5d('0x5'));var Redis=require(_0xae5d('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xae5d('0x7'));var logger=require(_0xae5d('0x8'))(_0xae5d('0x9'));var config=require('../../config/environment');var db=require(_0xae5d('0xa'))['db'];var htmlEntities=require(_0xae5d('0xb'));config[_0xae5d('0xc')]=_[_0xae5d('0xd')](config[_0xae5d('0xc')],{'host':_0xae5d('0xe'),'port':0x18eb});var socket=require(_0xae5d('0xf'))(new Redis(config['redis']));require(_0xae5d('0x10'))[_0xae5d('0x11')](socket);function respondWithStatusCode(_0x164598,_0x39e188){_0x39e188=_0x39e188||0xcc;return function(_0x1100ab){if(_0x1100ab){return _0x164598[_0xae5d('0x12')](_0x39e188);}return _0x164598[_0xae5d('0x13')](_0x39e188)['end']();};}function respondWithResult(_0x59a005,_0x42b303){_0x42b303=_0x42b303||0xc8;return function(_0x2c3a9f){if(_0x2c3a9f){return _0x59a005[_0xae5d('0x13')](_0x42b303)[_0xae5d('0x14')](_0x2c3a9f);}};}function respondWithFilteredResult(_0x125eda,_0x358b5d){return function(_0x164c34){if(_0x164c34){var _0xbc9cf=typeof _0x358b5d[_0xae5d('0x15')]===_0xae5d('0x16')&&typeof _0x358b5d['limit']===_0xae5d('0x16');var _0x3cbc51=_0x164c34[_0xae5d('0x17')];var _0x20102d=_0xbc9cf?0x0:_0x358b5d[_0xae5d('0x15')];var _0xc12de4=_0xbc9cf?_0x164c34['count']:_0x358b5d[_0xae5d('0x15')]+_0x358b5d[_0xae5d('0x18')];var _0x28c06b;if(_0xc12de4>=_0x3cbc51){_0xc12de4=_0x3cbc51;_0x28c06b=0xc8;}else{_0x28c06b=0xce;}_0x125eda[_0xae5d('0x13')](_0x28c06b);return _0x125eda[_0xae5d('0x19')](_0xae5d('0x1a'),_0x20102d+'-'+_0xc12de4+'/'+_0x3cbc51)[_0xae5d('0x14')](_0x164c34);}return null;};}function saveUpdates(_0x104389){return function(_0x25e737){if(_0x25e737){return _0x25e737[_0xae5d('0x1b')](_0x104389)['then'](function(_0x39ce57){return _0x39ce57;});}return null;};}function removeEntity(_0xfc4520){return function(_0x763eb5){if(_0x763eb5){return _0x763eb5[_0xae5d('0x1c')]()[_0xae5d('0x1d')](function(){_0xfc4520[_0xae5d('0x13')](0xcc)[_0xae5d('0x1e')]();});}};}function handleEntityNotFound(_0xd38dc){return function(_0x22f4e7){if(!_0x22f4e7){_0xd38dc['sendStatus'](0x194);}return _0x22f4e7;};}function handleError(_0x390eca,_0x804eb9){_0x804eb9=_0x804eb9||0x1f4;return function(_0x265b80){logger[_0xae5d('0x1f')](_0x265b80[_0xae5d('0x20')]);if(_0x265b80[_0xae5d('0x21')]){delete _0x265b80[_0xae5d('0x21')];}_0x390eca[_0xae5d('0x13')](_0x804eb9)[_0xae5d('0x22')](_0x265b80);};}exports[_0xae5d('0x23')]=function(_0xdf1878,_0x1665ff){var _0x1a2639={};var _0x28b491=_[_0xae5d('0x24')](db[_0xae5d('0x25')][_0xae5d('0x26')],function(_0x183d8f){return{'name':_0x183d8f[_0xae5d('0x27')],'type':_0x183d8f[_0xae5d('0x28')]['key']};});_0x1a2639=qs['getOptions'](_0x28b491,_0xdf1878);return interaction[_0xae5d('0x29')]('mail',_0xdf1878[_0xae5d('0x2a')],_0xdf1878[_0xae5d('0x2b')],_0x1a2639,_0x28b491)[_0xae5d('0x1d')](respondWithFilteredResult(_0x1665ff,_0x1a2639))['catch'](handleError(_0x1665ff,null));};exports['show']=function(_0x42fc26,_0x30c460){var _0x1f2e66={'raw':![],'where':{'id':_0x42fc26[_0xae5d('0x2c')]['id']}},_0x3e1d30={};_0x3e1d30[_0xae5d('0x2d')]=_[_0xae5d('0x2e')](db[_0xae5d('0x25')][_0xae5d('0x26')]);_0x3e1d30['query']=_[_0xae5d('0x2e')](_0x42fc26[_0xae5d('0x2a')]);_0x3e1d30[_0xae5d('0x2f')]=_['intersection'](_0x3e1d30[_0xae5d('0x2d')],_0x3e1d30[_0xae5d('0x2a')]);_0x1f2e66[_0xae5d('0x30')]=_[_0xae5d('0x31')](_0x3e1d30[_0xae5d('0x2d')],qs[_0xae5d('0x32')](_0x42fc26[_0xae5d('0x2a')]['fields']));_0x1f2e66[_0xae5d('0x30')]=_0x1f2e66[_0xae5d('0x30')][_0xae5d('0x33')]?_0x1f2e66[_0xae5d('0x30')]:_0x3e1d30[_0xae5d('0x2d')];if(_0x42fc26[_0xae5d('0x2a')][_0xae5d('0x34')]){_0x1f2e66[_0xae5d('0x35')]=[{'all':!![]}];}_0x1f2e66=_[_0xae5d('0x36')]({},_0x1f2e66,_0x42fc26[_0xae5d('0x37')]);return db[_0xae5d('0x25')][_0xae5d('0x38')](_0x1f2e66)[_0xae5d('0x1d')](handleEntityNotFound(_0x30c460,null))[_0xae5d('0x1d')](respondWithResult(_0x30c460,null))[_0xae5d('0x39')](handleError(_0x30c460,null));};exports[_0xae5d('0x3a')]=function(_0x3028c3,_0x28b723){return db[_0xae5d('0x25')][_0xae5d('0x3a')](_0x3028c3[_0xae5d('0x3b')],{})[_0xae5d('0x1d')](respondWithResult(_0x28b723,0xc9))[_0xae5d('0x39')](handleError(_0x28b723,null));};exports[_0xae5d('0x1b')]=function(_0x56f863,_0x31eade){if(_0x56f863[_0xae5d('0x3b')]['id']){delete _0x56f863['body']['id'];}return db[_0xae5d('0x25')][_0xae5d('0x38')]({'where':{'id':_0x56f863[_0xae5d('0x2c')]['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x31eade,null))[_0xae5d('0x1d')](saveUpdates(_0x56f863[_0xae5d('0x3b')],null))[_0xae5d('0x1d')](respondWithResult(_0x31eade,null))['catch'](handleError(_0x31eade,null));};exports['destroy']=function(_0x3be962,_0x3fd703){return db[_0xae5d('0x25')][_0xae5d('0x38')]({'where':{'id':_0x3be962[_0xae5d('0x2c')]['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x3fd703,null))[_0xae5d('0x1d')](removeEntity(_0x3fd703,null))[_0xae5d('0x39')](handleError(_0x3fd703,null));};exports[_0xae5d('0x3c')]=function(_0x53ef79,_0x5f5773){return db[_0xae5d('0x25')][_0xae5d('0x3c')]()['then'](respondWithResult(_0x5f5773,null))[_0xae5d('0x39')](handleError(_0x5f5773,null));};exports[_0xae5d('0x3d')]=function(_0x1c7e54,_0x5537b9){return db['MailMessage'][_0xae5d('0x38')]({'where':{'id':_0x1c7e54['params']['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x5537b9,null))[_0xae5d('0x1d')](function(_0x1c9200){if(_0x1c9200){return _0x1c9200[_0xae5d('0x3d')](_0x1c7e54[_0xae5d('0x3b')]['ids'],_[_0xae5d('0x3e')](_0x1c7e54[_0xae5d('0x3b')],[_0xae5d('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x5537b9,null))['catch'](handleError(_0x5537b9,null));};exports['getMessages']=function(_0xb1ec6f,_0x374e54){var _0x22b23f={'raw':![],'where':{}};var _0x110ab6={};var _0x4f92fd={'count':0x0,'rows':[]};return db[_0xae5d('0x25')][_0xae5d('0x40')]({'where':{'id':_0xb1ec6f[_0xae5d('0x2c')]['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x374e54,null))[_0xae5d('0x1d')](function(_0x3493e4){if(_0x3493e4){_0x110ab6[_0xae5d('0x2d')]=_[_0xae5d('0x2e')](db[_0xae5d('0x41')][_0xae5d('0x26')]);_0x110ab6['query']=_[_0xae5d('0x2e')](_0xb1ec6f[_0xae5d('0x2a')]);_0x110ab6[_0xae5d('0x2f')]=_[_0xae5d('0x31')](_0x110ab6[_0xae5d('0x2d')],_0x110ab6[_0xae5d('0x2a')]);_0x22b23f['attributes']=_[_0xae5d('0x31')](_0x110ab6[_0xae5d('0x2d')],qs[_0xae5d('0x32')](_0xb1ec6f[_0xae5d('0x2a')]['fields']));_0x22b23f[_0xae5d('0x30')]=_0x22b23f[_0xae5d('0x30')][_0xae5d('0x33')]?_0x22b23f[_0xae5d('0x30')]:_0x110ab6[_0xae5d('0x2d')];if(!_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x42')](_0xae5d('0x43'))){_0x22b23f[_0xae5d('0x18')]=qs['limit'](_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x18')]);_0x22b23f[_0xae5d('0x15')]=qs[_0xae5d('0x15')](_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x15')]);}_0x22b23f[_0xae5d('0x44')]=qs[_0xae5d('0x45')](_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x45')]);_0x22b23f[_0xae5d('0x46')]=qs[_0xae5d('0x2f')](_[_0xae5d('0x47')](_0xb1ec6f[_0xae5d('0x2a')],_0x110ab6[_0xae5d('0x2f')]));_0x22b23f[_0xae5d('0x46')][_0xae5d('0x48')]=_0x3493e4['id'];if(_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x49')]){_0x22b23f[_0xae5d('0x46')]=_['merge'](_0x22b23f['where'],{'$or':_[_0xae5d('0x24')](_0x22b23f['attributes'],function(_0x3706a4){var _0x1e51b8={};_0x1e51b8[_0x3706a4]={'$like':'%'+_0xb1ec6f['query'][_0xae5d('0x49')]+'%'};return _0x1e51b8;})});}if(_0xb1ec6f[_0xae5d('0x2a')]['$gte']){var _0x160dbc=_0xb1ec6f['query'][_0xae5d('0x4a')][_0xae5d('0x4b')](',');var _0x2c66ff={};_0x2c66ff[_0x160dbc[0x0]]={'$gte':moment(_0x160dbc[0x1])['format'](_0xae5d('0x4c'))};_0x22b23f[_0xae5d('0x46')]=_[_0xae5d('0x36')](_0x22b23f[_0xae5d('0x46')],_0x2c66ff);}_0x22b23f=_['merge']({},_0x22b23f,_0xb1ec6f[_0xae5d('0x37')]);return db[_0xae5d('0x41')][_0xae5d('0x17')]({'where':_0x22b23f['where']})[_0xae5d('0x1d')](function(_0x4da0bb){_0x4f92fd[_0xae5d('0x17')]=_0x4da0bb;if(_0xb1ec6f[_0xae5d('0x2a')][_0xae5d('0x34')]){_0x22b23f['include']=[{'all':!![]}];}return db[_0xae5d('0x41')][_0xae5d('0x29')](_0x22b23f);})[_0xae5d('0x1d')](function(_0x3ef0ec){if(_0xb1ec6f[_0xae5d('0x2a')]['inlineCss']===_0xae5d('0x4d')){for(var _0x30b5c1=0x0;_0x30b5c1<_0x3ef0ec['length'];_0x30b5c1++){_0x3ef0ec[_0x30b5c1][_0xae5d('0x3b')]=juice(_0x3ef0ec[_0x30b5c1]['body']);}}_0x4f92fd[_0xae5d('0x4e')]=_0x3ef0ec;return _0x4f92fd;});}})['then'](respondWithFilteredResult(_0x374e54,_0x22b23f))[_0xae5d('0x39')](handleError(_0x374e54,null));};exports[_0xae5d('0x4f')]=function(_0x2473f8,_0x5597b9){return db[_0xae5d('0x25')][_0xae5d('0x38')]({'where':{'id':_0x2473f8[_0xae5d('0x2c')]['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x5597b9,null))[_0xae5d('0x1d')](function(_0x921042){if(_0x921042){return _0x921042[_0xae5d('0x50')](_0x2473f8['body'][_0xae5d('0x3f')],_[_0xae5d('0x3e')](_0x2473f8[_0xae5d('0x3b')],[_0xae5d('0x3f'),'id'])||{})[_0xae5d('0x51')](function(){return db['Tag'][_0xae5d('0x29')]({'attributes':['id',_0xae5d('0x21'),'color'],'where':{'id':_0x2473f8[_0xae5d('0x3b')][_0xae5d('0x3f')]}});})[_0xae5d('0x1d')](function(_0x45bf1c){socket[_0xae5d('0x52')](_0xae5d('0x53'),{'id':Number(_0x2473f8['params']['id']),'tags':_0x45bf1c||[]});return{'id':Number(_0x2473f8[_0xae5d('0x2c')]['id']),'tags':_0x45bf1c||[]};});}})['then'](respondWithResult(_0x5597b9,null))[_0xae5d('0x39')](handleError(_0x5597b9,null));};exports['removeTags']=function(_0x5c1a53,_0x4bb999){return db[_0xae5d('0x25')][_0xae5d('0x38')]({'where':{'id':_0x5c1a53[_0xae5d('0x2c')]['id']}})[_0xae5d('0x1d')](handleEntityNotFound(_0x4bb999,null))[_0xae5d('0x1d')](function(_0x1085f0){if(_0x1085f0){return _0x1085f0[_0xae5d('0x54')](_0x5c1a53['query'][_0xae5d('0x3f')]);}})[_0xae5d('0x1d')](respondWithStatusCode(_0x4bb999,null))[_0xae5d('0x39')](handleError(_0x4bb999,null));};exports[_0xae5d('0x55')]=function(_0x6a7ff4,_0x1f7424){var _0x4b8509=moment()[_0xae5d('0x56')]()[_0xae5d('0x57')]();var _0x21e435=path[_0xae5d('0x58')](config[_0xae5d('0x59')],_0xae5d('0x5a'),_0xae5d('0x5b'),_0xae5d('0x5c'));var _0x5cbd87=path['join'](config[_0xae5d('0x59')],_0xae5d('0x5a'),'files',_0xae5d('0x5d'));var _0x484e86=path[_0xae5d('0x58')](_0x21e435,_0x4b8509);var _0x32897f=util[_0xae5d('0x5e')](_0xae5d('0x5f'),_0x6a7ff4['params']['id'],_0x4b8509);var _0x5f30fa=path[_0xae5d('0x58')](_0x21e435,_0x32897f);var _0x17eae6=[];if(_0x6a7ff4[_0xae5d('0x2a')][_0xae5d('0x5d')]){_0x17eae6[_0xae5d('0x60')]({'model':db[_0xae5d('0x61')],'as':_0xae5d('0x62'),'raw':!![]});}var _0x384849=[{'model':db[_0xae5d('0x41')],'as':_0xae5d('0x63'),'attributes':['id',_0xae5d('0x3b'),_0xae5d('0x64'),'to','cc',_0xae5d('0x65'),_0xae5d('0x66'),'createdAt'],'where':{'secret':![]},'order':qs[_0xae5d('0x45')]('id'),'include':_0x17eae6}];return db[_0xae5d('0x25')][_0xae5d('0x38')]({'where':{'id':_0x6a7ff4[_0xae5d('0x2c')]['id']},'include':_0x384849})[_0xae5d('0x1d')](handleEntityNotFound(_0x1f7424,null))['then'](function(_0x2c0b71){if(_0x2c0b71&&_0x2c0b71['Messages']){var _0xb2cf7=_0x2c0b71['get']({'plain':!![]});fs[_0xae5d('0x67')](_0x484e86);return BPromise['each'](_0xb2cf7[_0xae5d('0x63')],function(_0x2aa8d4,_0x117724){var _0x4793d8={'from':_0x2aa8d4[_0xae5d('0x64')],'to':_0x2aa8d4['to']||'missing.recipient@your.company.com','subject':_0x2aa8d4[_0xae5d('0x66')],'html':htmlEntities[_0xae5d('0x68')](_0x2aa8d4['body']),'headers':{'Date':moment(_0x2aa8d4[_0xae5d('0x69')])[_0xae5d('0x5e')](_0xae5d('0x6a'))},'attachments':[]};if(_0x2aa8d4['cc']){_0x4793d8[_0xae5d('0x6b')]['Cc']=_0x2aa8d4['cc'];}if(_0x2aa8d4[_0xae5d('0x65')]){_0x4793d8[_0xae5d('0x6b')][_0xae5d('0x6c')]=_0x2aa8d4['bcc'];}return new BPromise(function(_0x42258b,_0x2eeba1){if(_0x2aa8d4[_0xae5d('0x62')]){for(var _0x5690dc=0x0;_0x5690dc<_0x2aa8d4[_0xae5d('0x62')][_0xae5d('0x33')];_0x5690dc++){var _0x1a527b=_0x2aa8d4['Attachments'][_0x5690dc];var _0x17bede=path[_0xae5d('0x58')](_0x5cbd87,_0x1a527b[_0xae5d('0x6d')]);if(fs[_0xae5d('0x6e')](_0x17bede)){_0x4793d8[_0xae5d('0x5d')][_0xae5d('0x60')]({'name':_0x1a527b['name'],'contentType':_0x1a527b[_0xae5d('0x28')],'data':fs[_0xae5d('0x6f')](_0x17bede)});}}}emlformat[_0xae5d('0x70')](_0x4793d8,function(_0x5d8b0b,_0x349f3e){if(_0x5d8b0b)return _0x2eeba1(_0x5d8b0b);fs['writeFileSync'](path[_0xae5d('0x58')](_0x484e86,util[_0xae5d('0x5e')](_0xae5d('0x71'),_0x117724)),_0x349f3e);return _0x42258b(_0x349f3e);});});})['then'](function(){return new BPromise(function(_0x2be659,_0x2681cd){zipdir(_0x484e86,{'saveTo':_0x5f30fa},function(_0x5e4ce9,_0x360e72){if(_0x5e4ce9)return _0x2681cd(_0x5e4ce9);return _0x2be659(_0x360e72);});})[_0xae5d('0x1d')](function(){return new BPromise(function(_0x118f65,_0x218839){rimraf(_0x484e86,function(_0x1dd26b){if(_0x1dd26b)_0x218839(_0x1dd26b);return _0x118f65();});});})[_0xae5d('0x1d')](function(){return _0x1f7424[_0xae5d('0x55')](_0x5f30fa,_0x32897f,function(_0x1c61ea){if(!_0x1c61ea)fs[_0xae5d('0x72')](_0x5f30fa);});});});}else{return _0x1f7424['sendStatus'](0xc8);}})[_0xae5d('0x39')](handleError(_0x1f7424,null));}; \ No newline at end of file +var _0x0bd7=['merge','find','create','update','body','params','describe','MailMessage','getMessages','findOne','keys','filters','length','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','options','inlineCss','true','rows','ids','omit','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','bcc','subject','createdAt','mkdirSync','each','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','index','map','MailInteraction','fieldName','type','key','findAll','mail','query','user','catch','show','model','rawAttributes','intersection','attributes','fields','includeAll'];(function(_0x24f9d9,_0x6b4d81){var _0x392b6c=function(_0x4e685b){while(--_0x4e685b){_0x24f9d9['push'](_0x24f9d9['shift']());}};_0x392b6c(++_0x6b4d81);}(_0x0bd7,0x19c));var _0x70bd=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x0bd7[_0x1857d0];return _0x3e3c46;};'use strict';var emlformat=require(_0x70bd('0x0'));var rimraf=require(_0x70bd('0x1'));var zipdir=require(_0x70bd('0x2'));var moment=require(_0x70bd('0x3'));var BPromise=require(_0x70bd('0x4'));var util=require(_0x70bd('0x5'));var path=require(_0x70bd('0x6'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x70bd('0x7'));var interaction=require(_0x70bd('0x8'));var qs=require(_0x70bd('0x9'));var logger=require(_0x70bd('0xa'))(_0x70bd('0xb'));var config=require(_0x70bd('0xc'));var db=require(_0x70bd('0xd'))['db'];var htmlEntities=require(_0x70bd('0xe'));config[_0x70bd('0xf')]=_['defaults'](config[_0x70bd('0xf')],{'host':_0x70bd('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x70bd('0x11'))[_0x70bd('0x12')](socket);function respondWithStatusCode(_0x186f47,_0x2965a3){_0x2965a3=_0x2965a3||0xcc;return function(_0xf06d4d){if(_0xf06d4d){return _0x186f47[_0x70bd('0x13')](_0x2965a3);}return _0x186f47[_0x70bd('0x14')](_0x2965a3)[_0x70bd('0x15')]();};}function respondWithResult(_0x547e84,_0xda264e){_0xda264e=_0xda264e||0xc8;return function(_0x539ea3){if(_0x539ea3){return _0x547e84[_0x70bd('0x14')](_0xda264e)[_0x70bd('0x16')](_0x539ea3);}};}function respondWithFilteredResult(_0x3fcee4,_0x15ffea){return function(_0x58e38a){if(_0x58e38a){var _0x260f42=typeof _0x15ffea[_0x70bd('0x17')]===_0x70bd('0x18')&&typeof _0x15ffea[_0x70bd('0x19')]===_0x70bd('0x18');var _0x3b5b73=_0x58e38a[_0x70bd('0x1a')];var _0x5d7e8f=_0x260f42?0x0:_0x15ffea[_0x70bd('0x17')];var _0xaf0f3b=_0x260f42?_0x58e38a[_0x70bd('0x1a')]:_0x15ffea[_0x70bd('0x17')]+_0x15ffea[_0x70bd('0x19')];var _0x36de66;if(_0xaf0f3b>=_0x3b5b73){_0xaf0f3b=_0x3b5b73;_0x36de66=0xc8;}else{_0x36de66=0xce;}_0x3fcee4['status'](_0x36de66);return _0x3fcee4[_0x70bd('0x1b')](_0x70bd('0x1c'),_0x5d7e8f+'-'+_0xaf0f3b+'/'+_0x3b5b73)[_0x70bd('0x16')](_0x58e38a);}return null;};}function saveUpdates(_0x22e8a7){return function(_0x1f2c6d){if(_0x1f2c6d){return _0x1f2c6d['update'](_0x22e8a7)[_0x70bd('0x1d')](function(_0x32a56e){return _0x32a56e;});}return null;};}function removeEntity(_0x10053e){return function(_0x2d69cc){if(_0x2d69cc){return _0x2d69cc[_0x70bd('0x1e')]()[_0x70bd('0x1d')](function(){_0x10053e[_0x70bd('0x14')](0xcc)[_0x70bd('0x15')]();});}};}function handleEntityNotFound(_0x509805){return function(_0x1a3271){if(!_0x1a3271){_0x509805[_0x70bd('0x13')](0x194);}return _0x1a3271;};}function handleError(_0x5ad5b6,_0xa16795){_0xa16795=_0xa16795||0x1f4;return function(_0x19e1a1){logger['error'](_0x19e1a1[_0x70bd('0x1f')]);if(_0x19e1a1['name']){delete _0x19e1a1[_0x70bd('0x20')];}_0x5ad5b6[_0x70bd('0x14')](_0xa16795)[_0x70bd('0x21')](_0x19e1a1);};}exports[_0x70bd('0x22')]=function(_0x2b52e3,_0x65e286){var _0x54d850={};var _0x36be10=_[_0x70bd('0x23')](db[_0x70bd('0x24')]['rawAttributes'],function(_0x47c28e){return{'name':_0x47c28e[_0x70bd('0x25')],'type':_0x47c28e[_0x70bd('0x26')][_0x70bd('0x27')]};});_0x54d850=qs['getOptions'](_0x36be10,_0x2b52e3);return interaction[_0x70bd('0x28')](_0x70bd('0x29'),_0x2b52e3[_0x70bd('0x2a')],_0x2b52e3[_0x70bd('0x2b')],_0x54d850,_0x36be10)[_0x70bd('0x1d')](respondWithFilteredResult(_0x65e286,_0x54d850))[_0x70bd('0x2c')](handleError(_0x65e286,null));};exports[_0x70bd('0x2d')]=function(_0x4d2685,_0x239e7b){var _0x2dd0a1={'raw':![],'where':{'id':_0x4d2685['params']['id']}},_0x26156e={};_0x26156e[_0x70bd('0x2e')]=_['keys'](db[_0x70bd('0x24')][_0x70bd('0x2f')]);_0x26156e['query']=_['keys'](_0x4d2685[_0x70bd('0x2a')]);_0x26156e['filters']=_[_0x70bd('0x30')](_0x26156e['model'],_0x26156e['query']);_0x2dd0a1[_0x70bd('0x31')]=_['intersection'](_0x26156e[_0x70bd('0x2e')],qs[_0x70bd('0x32')](_0x4d2685[_0x70bd('0x2a')][_0x70bd('0x32')]));_0x2dd0a1[_0x70bd('0x31')]=_0x2dd0a1[_0x70bd('0x31')]['length']?_0x2dd0a1['attributes']:_0x26156e[_0x70bd('0x2e')];if(_0x4d2685[_0x70bd('0x2a')][_0x70bd('0x33')]){_0x2dd0a1['include']=[{'all':!![]}];}_0x2dd0a1=_[_0x70bd('0x34')]({},_0x2dd0a1,_0x4d2685['options']);return db['MailInteraction'][_0x70bd('0x35')](_0x2dd0a1)[_0x70bd('0x1d')](handleEntityNotFound(_0x239e7b,null))[_0x70bd('0x1d')](respondWithResult(_0x239e7b,null))[_0x70bd('0x2c')](handleError(_0x239e7b,null));};exports[_0x70bd('0x36')]=function(_0x2d3e95,_0x3b3faf){return db[_0x70bd('0x24')][_0x70bd('0x36')](_0x2d3e95['body'],{})[_0x70bd('0x1d')](respondWithResult(_0x3b3faf,0xc9))['catch'](handleError(_0x3b3faf,null));};exports[_0x70bd('0x37')]=function(_0x4741ee,_0x3e181f){if(_0x4741ee[_0x70bd('0x38')]['id']){delete _0x4741ee[_0x70bd('0x38')]['id'];}return db[_0x70bd('0x24')][_0x70bd('0x35')]({'where':{'id':_0x4741ee[_0x70bd('0x39')]['id']}})['then'](handleEntityNotFound(_0x3e181f,null))[_0x70bd('0x1d')](saveUpdates(_0x4741ee['body'],null))[_0x70bd('0x1d')](respondWithResult(_0x3e181f,null))[_0x70bd('0x2c')](handleError(_0x3e181f,null));};exports[_0x70bd('0x1e')]=function(_0x445ba7,_0x1ef84d){return db['MailInteraction']['find']({'where':{'id':_0x445ba7[_0x70bd('0x39')]['id']}})[_0x70bd('0x1d')](handleEntityNotFound(_0x1ef84d,null))['then'](removeEntity(_0x1ef84d,null))[_0x70bd('0x2c')](handleError(_0x1ef84d,null));};exports[_0x70bd('0x3a')]=function(_0x4a025a,_0x4e7d4d){return db[_0x70bd('0x24')]['describe']()[_0x70bd('0x1d')](respondWithResult(_0x4e7d4d,null))[_0x70bd('0x2c')](handleError(_0x4e7d4d,null));};exports['addMessage']=function(_0x49e680,_0x4d6d48){return db[_0x70bd('0x3b')][_0x70bd('0x35')]({'where':{'id':_0x49e680[_0x70bd('0x39')]['id']}})[_0x70bd('0x1d')](handleEntityNotFound(_0x4d6d48,null))[_0x70bd('0x1d')](function(_0x30d63b){if(_0x30d63b){return _0x30d63b['addMessage'](_0x49e680[_0x70bd('0x38')]['ids'],_['omit'](_0x49e680['body'],['ids','id'])||{});}})[_0x70bd('0x1d')](respondWithResult(_0x4d6d48,null))[_0x70bd('0x2c')](handleError(_0x4d6d48,null));};exports[_0x70bd('0x3c')]=function(_0x29abd8,_0x4d8fec){var _0x29bb73={'raw':![],'where':{}};var _0x9c827d={};var _0x293f21={'count':0x0,'rows':[]};return db[_0x70bd('0x24')][_0x70bd('0x3d')]({'where':{'id':_0x29abd8[_0x70bd('0x39')]['id']}})['then'](handleEntityNotFound(_0x4d8fec,null))[_0x70bd('0x1d')](function(_0x2de057){if(_0x2de057){_0x9c827d[_0x70bd('0x2e')]=_[_0x70bd('0x3e')](db['MailMessage'][_0x70bd('0x2f')]);_0x9c827d[_0x70bd('0x2a')]=_[_0x70bd('0x3e')](_0x29abd8[_0x70bd('0x2a')]);_0x9c827d[_0x70bd('0x3f')]=_[_0x70bd('0x30')](_0x9c827d['model'],_0x9c827d['query']);_0x29bb73[_0x70bd('0x31')]=_['intersection'](_0x9c827d[_0x70bd('0x2e')],qs[_0x70bd('0x32')](_0x29abd8['query'][_0x70bd('0x32')]));_0x29bb73[_0x70bd('0x31')]=_0x29bb73[_0x70bd('0x31')][_0x70bd('0x40')]?_0x29bb73[_0x70bd('0x31')]:_0x9c827d['model'];if(!_0x29abd8[_0x70bd('0x2a')][_0x70bd('0x41')](_0x70bd('0x42'))){_0x29bb73[_0x70bd('0x19')]=qs['limit'](_0x29abd8['query'][_0x70bd('0x19')]);_0x29bb73['offset']=qs[_0x70bd('0x17')](_0x29abd8[_0x70bd('0x2a')][_0x70bd('0x17')]);}_0x29bb73[_0x70bd('0x43')]=qs[_0x70bd('0x44')](_0x29abd8[_0x70bd('0x2a')]['sort']);_0x29bb73[_0x70bd('0x45')]=qs[_0x70bd('0x3f')](_[_0x70bd('0x46')](_0x29abd8[_0x70bd('0x2a')],_0x9c827d[_0x70bd('0x3f')]));_0x29bb73['where'][_0x70bd('0x47')]=_0x2de057['id'];if(_0x29abd8[_0x70bd('0x2a')][_0x70bd('0x48')]){_0x29bb73[_0x70bd('0x45')]=_[_0x70bd('0x34')](_0x29bb73[_0x70bd('0x45')],{'$or':_[_0x70bd('0x23')](_0x29bb73['attributes'],function(_0x139c4e){var _0x5310fb={};_0x5310fb[_0x139c4e]={'$like':'%'+_0x29abd8[_0x70bd('0x2a')][_0x70bd('0x48')]+'%'};return _0x5310fb;})});}if(_0x29abd8['query'][_0x70bd('0x49')]){var _0x2fc573=_0x29abd8['query'][_0x70bd('0x49')][_0x70bd('0x4a')](',');var _0x2b9153={};_0x2b9153[_0x2fc573[0x0]]={'$gte':moment(_0x2fc573[0x1])[_0x70bd('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x29bb73[_0x70bd('0x45')]=_['merge'](_0x29bb73['where'],_0x2b9153);}_0x29bb73=_[_0x70bd('0x34')]({},_0x29bb73,_0x29abd8[_0x70bd('0x4c')]);return db[_0x70bd('0x3b')][_0x70bd('0x1a')]({'where':_0x29bb73['where']})[_0x70bd('0x1d')](function(_0x3dabbd){_0x293f21['count']=_0x3dabbd;if(_0x29abd8['query'][_0x70bd('0x33')]){_0x29bb73['include']=[{'all':!![]}];}return db['MailMessage'][_0x70bd('0x28')](_0x29bb73);})[_0x70bd('0x1d')](function(_0x116133){if(_0x29abd8[_0x70bd('0x2a')][_0x70bd('0x4d')]===_0x70bd('0x4e')){for(var _0x499c7e=0x0;_0x499c7e<_0x116133[_0x70bd('0x40')];_0x499c7e++){_0x116133[_0x499c7e][_0x70bd('0x38')]=juice(_0x116133[_0x499c7e][_0x70bd('0x38')]);}}_0x293f21[_0x70bd('0x4f')]=_0x116133;return _0x293f21;});}})[_0x70bd('0x1d')](respondWithFilteredResult(_0x4d8fec,_0x29bb73))[_0x70bd('0x2c')](handleError(_0x4d8fec,null));};exports['addTags']=function(_0x4e4206,_0x4d05a2){return db[_0x70bd('0x24')][_0x70bd('0x35')]({'where':{'id':_0x4e4206[_0x70bd('0x39')]['id']}})['then'](handleEntityNotFound(_0x4d05a2,null))['then'](function(_0x2673f9){if(_0x2673f9){return _0x2673f9['setTags'](_0x4e4206['body'][_0x70bd('0x50')],_[_0x70bd('0x51')](_0x4e4206['body'],[_0x70bd('0x50'),'id'])||{})[_0x70bd('0x52')](function(){return db[_0x70bd('0x53')][_0x70bd('0x28')]({'attributes':['id',_0x70bd('0x20'),_0x70bd('0x54')],'where':{'id':_0x4e4206[_0x70bd('0x38')]['ids']}});})[_0x70bd('0x1d')](function(_0x3d38fd){socket['emit'](_0x70bd('0x55'),{'id':Number(_0x4e4206[_0x70bd('0x39')]['id']),'tags':_0x3d38fd||[]});return{'id':Number(_0x4e4206[_0x70bd('0x39')]['id']),'tags':_0x3d38fd||[]};});}})[_0x70bd('0x1d')](respondWithResult(_0x4d05a2,null))['catch'](handleError(_0x4d05a2,null));};exports[_0x70bd('0x56')]=function(_0x83dfe5,_0x5c3b26){return db[_0x70bd('0x24')][_0x70bd('0x35')]({'where':{'id':_0x83dfe5[_0x70bd('0x39')]['id']}})[_0x70bd('0x1d')](handleEntityNotFound(_0x5c3b26,null))[_0x70bd('0x1d')](function(_0x35ae54){if(_0x35ae54){return _0x35ae54[_0x70bd('0x56')](_0x83dfe5[_0x70bd('0x2a')][_0x70bd('0x50')]);}})[_0x70bd('0x1d')](respondWithStatusCode(_0x5c3b26,null))['catch'](handleError(_0x5c3b26,null));};exports[_0x70bd('0x57')]=function(_0x455070,_0x57f8c6){var _0x5a0597=moment()[_0x70bd('0x58')]()[_0x70bd('0x59')]();var _0x3e9fe2=path[_0x70bd('0x5a')](config['root'],_0x70bd('0x5b'),_0x70bd('0x5c'),_0x70bd('0x5d'));var _0x46f074=path[_0x70bd('0x5a')](config[_0x70bd('0x5e')],_0x70bd('0x5b'),_0x70bd('0x5c'),_0x70bd('0x5f'));var _0x195c54=path[_0x70bd('0x5a')](_0x3e9fe2,_0x5a0597);var _0x1272fc=util[_0x70bd('0x4b')](_0x70bd('0x60'),_0x455070[_0x70bd('0x39')]['id'],_0x5a0597);var _0x2d6a4d=path[_0x70bd('0x5a')](_0x3e9fe2,_0x1272fc);var _0x2040fa=[];if(_0x455070[_0x70bd('0x2a')][_0x70bd('0x5f')]){_0x2040fa[_0x70bd('0x61')]({'model':db[_0x70bd('0x62')],'as':_0x70bd('0x63'),'raw':!![]});}var _0x388428=[{'model':db[_0x70bd('0x3b')],'as':_0x70bd('0x64'),'attributes':['id','body','from','to','cc',_0x70bd('0x65'),_0x70bd('0x66'),_0x70bd('0x67')],'where':{'secret':![]},'order':qs[_0x70bd('0x44')]('id'),'include':_0x2040fa}];return db[_0x70bd('0x24')][_0x70bd('0x35')]({'where':{'id':_0x455070[_0x70bd('0x39')]['id']},'include':_0x388428})[_0x70bd('0x1d')](handleEntityNotFound(_0x57f8c6,null))[_0x70bd('0x1d')](function(_0x5904a9){if(_0x5904a9&&_0x5904a9['Messages']){var _0x3861f3=_0x5904a9['get']({'plain':!![]});fs[_0x70bd('0x68')](_0x195c54);return BPromise[_0x70bd('0x69')](_0x3861f3['Messages'],function(_0x51c933,_0x2f54fd){var _0x552031={'from':_0x51c933[_0x70bd('0x6a')],'to':_0x51c933['to']||'missing.recipient@your.company.com','subject':_0x51c933[_0x70bd('0x66')],'html':htmlEntities[_0x70bd('0x6b')](_0x51c933[_0x70bd('0x38')]),'headers':{'Date':moment(_0x51c933[_0x70bd('0x67')])[_0x70bd('0x4b')](_0x70bd('0x6c'))},'attachments':[]};if(_0x51c933['cc']){_0x552031[_0x70bd('0x6d')]['Cc']=_0x51c933['cc'];}if(_0x51c933[_0x70bd('0x65')]){_0x552031[_0x70bd('0x6d')][_0x70bd('0x6e')]=_0x51c933[_0x70bd('0x65')];}return new BPromise(function(_0x3ebdc6,_0x3488a9){if(_0x51c933[_0x70bd('0x63')]){for(var _0x49a1bd=0x0;_0x49a1bd<_0x51c933[_0x70bd('0x63')][_0x70bd('0x40')];_0x49a1bd++){var _0x241e31=_0x51c933[_0x70bd('0x63')][_0x49a1bd];var _0x3815ad=path[_0x70bd('0x5a')](_0x46f074,_0x241e31['basename']);if(fs[_0x70bd('0x6f')](_0x3815ad)){_0x552031[_0x70bd('0x5f')][_0x70bd('0x61')]({'name':_0x241e31['name'],'contentType':_0x241e31[_0x70bd('0x26')],'data':fs[_0x70bd('0x70')](_0x3815ad)});}}}emlformat[_0x70bd('0x71')](_0x552031,function(_0x26f0ce,_0x57a0ed){if(_0x26f0ce)return _0x3488a9(_0x26f0ce);fs[_0x70bd('0x72')](path['join'](_0x195c54,util[_0x70bd('0x4b')]('message%d.eml',_0x2f54fd)),_0x57a0ed);return _0x3ebdc6(_0x57a0ed);});});})[_0x70bd('0x1d')](function(){return new BPromise(function(_0x3d4a47,_0x3bb2e1){zipdir(_0x195c54,{'saveTo':_0x2d6a4d},function(_0x4968ad,_0x96f7ed){if(_0x4968ad)return _0x3bb2e1(_0x4968ad);return _0x3d4a47(_0x96f7ed);});})[_0x70bd('0x1d')](function(){return new BPromise(function(_0x231949,_0x5945a9){rimraf(_0x195c54,function(_0x2e74a1){if(_0x2e74a1)_0x5945a9(_0x2e74a1);return _0x231949();});});})[_0x70bd('0x1d')](function(){return _0x57f8c6[_0x70bd('0x57')](_0x2d6a4d,_0x1272fc,function(_0x2acc6c){if(!_0x2acc6c)fs[_0x70bd('0x73')](_0x2d6a4d);});});});}else{return _0x57f8c6[_0x70bd('0x13')](0xc8);}})[_0x70bd('0x2c')](handleError(_0x57f8c6,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 31f25bf..1abec50 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 _0xc4f1=['then','setDataValue','Users','findAll','length','emit','hook','../../mysqldb','MailInteraction','MailMessage','remove','getUsers'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc4f1,0xf7));var _0x1c4f=function(_0x4743f8,_0x291e9c){_0x4743f8=_0x4743f8-0x0;var _0x5e9976=_0xc4f1[_0x4743f8];return _0x5e9976;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x1c4f('0x0'))['db'][_0x1c4f('0x1')];var MailMessage=require(_0x1c4f('0x0'))['db'][_0x1c4f('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1c4f('0x3')};function emitEvent(_0x5d0516){return function(_0x552685,_0x491f62,_0x31fc71){_0x552685[_0x1c4f('0x4')]({'attributes':['id'],'raw':!![]})[_0x1c4f('0x5')](function(_0x595dce){_0x552685[_0x1c4f('0x6')](_0x1c4f('0x7'),_0x595dce['map'](function(_0x232dd9){return{'id':_0x232dd9['id']};}));return MailMessage[_0x1c4f('0x8')]({'where':{'MailInteractionId':_0x552685['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1c4f('0x5')](function(_0x153844){_0x552685[_0x1c4f('0x6')]('unreadMessages',_0x153844[_0x1c4f('0x9')]);MailInteractionEvents[_0x1c4f('0xa')](_0x5d0516+':'+_0x552685['id'],_0x552685);MailInteractionEvents[_0x1c4f('0xa')](_0x5d0516,_0x552685);_0x31fc71(null);})['catch'](_0x31fc71(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x1c4f('0xb')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x49e5=['unreadMessages','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','save','remove','then','Users','findAll','setDataValue'];(function(_0x532f78,_0x434fd2){var _0x5e07a2=function(_0xfb64da){while(--_0xfb64da){_0x532f78['push'](_0x532f78['shift']());}};_0x5e07a2(++_0x434fd2);}(_0x49e5,0x126));var _0x549e=function(_0x14f8eb,_0x53f5b4){_0x14f8eb=_0x14f8eb-0x0;var _0x4c159d=_0x49e5[_0x14f8eb];return _0x4c159d;};'use strict';var EventEmitter=require(_0x549e('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x549e('0x1')];var MailMessage=require(_0x549e('0x2'))['db'][_0x549e('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x549e('0x4'),'afterUpdate':'update','afterDestroy':_0x549e('0x5')};function emitEvent(_0x548b65){return function(_0x3b47f3,_0x2883ae,_0x47c090){_0x3b47f3['getUsers']({'attributes':['id'],'raw':!![]})[_0x549e('0x6')](function(_0x5f3497){_0x3b47f3['setDataValue'](_0x549e('0x7'),_0x5f3497['map'](function(_0x4413f6){return{'id':_0x4413f6['id']};}));return MailMessage[_0x549e('0x8')]({'where':{'MailInteractionId':_0x3b47f3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x549e('0x6')](function(_0x42bd24){_0x3b47f3[_0x549e('0x9')](_0x549e('0xa'),_0x42bd24[_0x549e('0xb')]);MailInteractionEvents[_0x549e('0xc')](_0x548b65+':'+_0x3b47f3['id'],_0x3b47f3);MailInteractionEvents[_0x549e('0xc')](_0x548b65,_0x3b47f3);_0x47c090(null);})[_0x549e('0xd')](_0x47c090(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x549e('0xe')](e,emitEvent(event));}}module[_0x549e('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index eec0150..d9745c1 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 _0x1414=['mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x439944,_0x1f3226){var _0x4f395c=function(_0x5a2246){while(--_0x5a2246){_0x439944['push'](_0x439944['shift']());}};_0x4f395c(++_0x1f3226);}(_0x1414,0x1c5));var _0x4141=function(_0x23e4b5,_0x3b30a6){_0x23e4b5=_0x23e4b5-0x0;var _0x64799c=_0x1414[_0x23e4b5];return _0x64799c;};'use strict';var _=require(_0x4141('0x0'));var util=require(_0x4141('0x1'));var logger=require('../../config/logger')(_0x4141('0x2'));var moment=require(_0x4141('0x3'));var BPromise=require(_0x4141('0x4'));var rp=require(_0x4141('0x5'));var fs=require('fs');var path=require(_0x4141('0x6'));var rimraf=require('rimraf');var config=require(_0x4141('0x7'));var attributes=require(_0x4141('0x8'));module[_0x4141('0x9')]=function(_0xcd5200,_0x552c6c){return _0xcd5200[_0x4141('0xa')]('MailInteraction',attributes,{'tableName':_0x4141('0xb'),'paranoid':![],'indexes':[{'name':_0x4141('0xc'),'fields':[_0x4141('0xd'),'to'],'type':_0x4141('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xdcb3ad,_0x28f0fb,_0xf20c6c){if(_0xdcb3ad[_0x4141('0xf')]){_0xdcb3ad[_0x4141('0x10')]=moment()[_0x4141('0x11')](_0x4141('0x12'));}if(_0xdcb3ad[_0x4141('0x13')]){_0xdcb3ad[_0x4141('0x14')]=moment()['format'](_0x4141('0x12'));}_0xf20c6c(null,_0x28f0fb);},'beforeUpdate':function(_0x272326,_0x8a0e0d,_0x244629){if(_0x272326[_0x4141('0x15')](_0x4141('0xf'))){_0x272326[_0x4141('0x10')]=_0x272326[_0x4141('0xf')]?moment()[_0x4141('0x11')](_0x4141('0x12')):null;}if(_0x272326[_0x4141('0x15')](_0x4141('0x13'))){_0x272326[_0x4141('0x14')]=moment()[_0x4141('0x11')](_0x4141('0x12'));_0x272326[_0x4141('0xf')]=null;_0x272326[_0x4141('0x10')]=null;}_0x244629(null,_0x272326);},'afterUpdate':function(_0x1710bd,_0x5216b7,_0x1b78cb){var _0x51da1a=_0xcd5200[_0x4141('0x16')];var _0x5ace17=_0x1710bd[_0x4141('0x17')]({'plain':!![]});if(_0x5ace17[_0x4141('0x13')]){return _0x51da1a[_0x4141('0x18')][_0x4141('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x5ace17['id']}})[_0x4141('0x1a')](function(){_0x1b78cb();})[_0x4141('0x1b')](function(_0x2c2e23){_0x1b78cb(_0x2c2e23);});}else{_0x1b78cb();}}},'charset':'utf8mb4','collate':_0x4141('0x1c')});}; \ No newline at end of file +var _0xac49=['substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','MailMessage','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT'];(function(_0x4cfb45,_0x5a8cf7){var _0x75b8fa=function(_0x4943f6){while(--_0x4943f6){_0x4cfb45['push'](_0x4cfb45['shift']());}};_0x75b8fa(++_0x5a8cf7);}(_0xac49,0xae));var _0x9ac4=function(_0xc7e790,_0x387385){_0xc7e790=_0xc7e790-0x0;var _0x9d0bb8=_0xac49[_0xc7e790];return _0x9d0bb8;};'use strict';var _=require(_0x9ac4('0x0'));var util=require(_0x9ac4('0x1'));var logger=require(_0x9ac4('0x2'))(_0x9ac4('0x3'));var moment=require(_0x9ac4('0x4'));var BPromise=require(_0x9ac4('0x5'));var rp=require(_0x9ac4('0x6'));var fs=require('fs');var path=require(_0x9ac4('0x7'));var rimraf=require(_0x9ac4('0x8'));var config=require(_0x9ac4('0x9'));var attributes=require('./mailInteraction.attributes');module[_0x9ac4('0xa')]=function(_0x1cf016,_0x2669e0){return _0x1cf016[_0x9ac4('0xb')](_0x9ac4('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x9ac4('0xd'),'fields':['subject','to'],'type':_0x9ac4('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4faddc,_0x272c13,_0xa0e1b2){if(_0x4faddc[_0x9ac4('0xf')]){_0x4faddc['substatusAt']=moment()['format'](_0x9ac4('0x10'));}if(_0x4faddc[_0x9ac4('0x11')]){_0x4faddc[_0x9ac4('0x12')]=moment()[_0x9ac4('0x13')](_0x9ac4('0x10'));}_0xa0e1b2(null,_0x272c13);},'beforeUpdate':function(_0x3c6710,_0x34a4ba,_0x194914){if(_0x3c6710[_0x9ac4('0x14')]('substatus')){_0x3c6710['substatusAt']=_0x3c6710[_0x9ac4('0xf')]?moment()[_0x9ac4('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3c6710[_0x9ac4('0x14')]('closed')){_0x3c6710[_0x9ac4('0x12')]=moment()[_0x9ac4('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c6710[_0x9ac4('0xf')]=null;_0x3c6710[_0x9ac4('0x15')]=null;}_0x194914(null,_0x3c6710);},'afterUpdate':function(_0x57834b,_0x11078e,_0x4039ec){var _0x360c76=_0x1cf016[_0x9ac4('0x16')];var _0x20607b=_0x57834b['get']({'plain':!![]});if(_0x20607b[_0x9ac4('0x11')]){return _0x360c76[_0x9ac4('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x20607b['id']}})[_0x9ac4('0x18')](function(){_0x4039ec();})[_0x9ac4('0x19')](function(_0x206afd){_0x4039ec(_0x206afd);});}else{_0x4039ec();}}},'charset':_0x9ac4('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c85d8d0..d08e899 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 _0x315b=['ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','body'];(function(_0x4a96e2,_0x1a7677){var _0x38424c=function(_0x1a1607){while(--_0x1a1607){_0x4a96e2['push'](_0x4a96e2['shift']());}};_0x38424c(++_0x1a7677);}(_0x315b,0xae));var _0xb315=function(_0x2975c7,_0x5dcc22){_0x2975c7=_0x2975c7-0x0;var _0x26a179=_0x315b[_0x2975c7];return _0x26a179;};'use strict';var _=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var moment=require(_0xb315('0x2'));var BPromise=require(_0xb315('0x3'));var rs=require(_0xb315('0x4'));var fs=require('fs');var Redis=require(_0xb315('0x5'));var db=require(_0xb315('0x6'))['db'];var utils=require(_0xb315('0x7'));var logger=require(_0xb315('0x8'))(_0xb315('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb315('0xa')][_0xb315('0xb')]({'port':0x232a});config[_0xb315('0xc')]=_['defaults'](config[_0xb315('0xc')],{'host':_0xb315('0xd'),'port':0x18eb});var socket=require(_0xb315('0xe'))(new Redis(config[_0xb315('0xc')]));require(_0xb315('0xf'))[_0xb315('0x10')](socket);function respondWithRpcPromise(_0x4df84a,_0x40ecb1,_0x4f39a5){return new BPromise(function(_0x327146,_0x37a9f4){return client[_0xb315('0x11')](_0x4df84a,_0x4f39a5)[_0xb315('0x12')](function(_0x51312d){logger[_0xb315('0x13')](_0xb315('0x14'),_0x40ecb1,_0xb315('0x15'));logger[_0xb315('0x16')](_0xb315('0x17'),_0x40ecb1,_0xb315('0x15'),JSON[_0xb315('0x18')](_0x51312d));if(_0x51312d['error']){if(_0x51312d[_0xb315('0x19')][_0xb315('0x1a')]===0x1f4){logger[_0xb315('0x19')](_0xb315('0x14'),_0x40ecb1,_0x51312d[_0xb315('0x19')][_0xb315('0x1b')]);return _0x37a9f4(_0x51312d[_0xb315('0x19')][_0xb315('0x1b')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x40ecb1,_0x51312d[_0xb315('0x19')][_0xb315('0x1b')]);return _0x327146(_0x51312d[_0xb315('0x19')][_0xb315('0x1b')]);}else{logger[_0xb315('0x13')](_0xb315('0x14'),_0x40ecb1,_0xb315('0x15'));_0x327146(_0x51312d['result']['message']);}})[_0xb315('0x1c')](function(_0x41a9b4){logger[_0xb315('0x19')](_0xb315('0x14'),_0x40ecb1,_0x41a9b4);_0x37a9f4(_0x41a9b4);});});}exports[_0xb315('0x1d')]=function(_0x6dac42){var _0x24d5cb=this;return new Promise(function(_0xa293e2,_0x1fa2f2){return db[_0xb315('0x1e')][_0xb315('0x1f')](_0x6dac42['body'],{'raw':_0x6dac42[_0xb315('0x20')]?_0x6dac42['options'][_0xb315('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6dac42[_0xb315('0x20')]?_0x6dac42['options'][_0xb315('0x22')]||null:null,'attributes':_0x6dac42[_0xb315('0x20')]?_0x6dac42['options'][_0xb315('0x23')]||null:null,'limit':_0x6dac42[_0xb315('0x20')]?_0x6dac42[_0xb315('0x20')][_0xb315('0x24')]||null:null})[_0xb315('0x12')](function(_0x597a2e){logger[_0xb315('0x13')](_0xb315('0x1d'),_0x6dac42);logger[_0xb315('0x16')](_0xb315('0x1d'),_0x6dac42,JSON[_0xb315('0x18')](_0x597a2e));_0xa293e2(_0x597a2e);})[_0xb315('0x1c')](function(_0x26a48a){logger['error'](_0xb315('0x1d'),_0x26a48a[_0xb315('0x1b')],_0x6dac42);_0x1fa2f2(_0x24d5cb['error'](0x1f4,_0x26a48a[_0xb315('0x1b')]));});});};exports[_0xb315('0x25')]=function(_0x48f096){return new Promise(function(_0x149f92,_0x4137ad){return db[_0xb315('0x1e')][_0xb315('0x26')]({'where':_0x48f096[_0xb315('0x20')]?_0x48f096[_0xb315('0x20')][_0xb315('0x22')]||null:null})[_0xb315('0x12')](function(_0x24dfe9){if(_0x24dfe9){return _0x24dfe9[_0xb315('0x27')](_0x48f096[_0xb315('0x28')][_0xb315('0x29')],_['omit'](_0x48f096['body'],[_0xb315('0x29'),'id'])||{});}})['spread'](function(_0x277c04){logger['info'](_0xb315('0x2a'),_0x48f096);logger[_0xb315('0x16')](_0xb315('0x2a'),_0x48f096,JSON['stringify'](_0x277c04));_0x149f92(_0x277c04);})['catch'](function(_0x26ee80){logger[_0xb315('0x19')]('AddTags',_0x26ee80[_0xb315('0x1b')],_0x48f096);_0x4137ad(_this['error'](0x1f4,_0x26ee80[_0xb315('0x1b')]));});});}; \ No newline at end of file +var _0xe24c=['defaults','localhost','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x5ce14b,_0x204cab){var _0x29c5fc=function(_0xe0f36a){while(--_0xe0f36a){_0x5ce14b['push'](_0x5ce14b['shift']());}};_0x29c5fc(++_0x204cab);}(_0xe24c,0x70));var _0xce24=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe24c[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xce24('0x0'));var util=require(_0xce24('0x1'));var moment=require(_0xce24('0x2'));var BPromise=require(_0xce24('0x3'));var rs=require(_0xce24('0x4'));var fs=require('fs');var Redis=require(_0xce24('0x5'));var db=require(_0xce24('0x6'))['db'];var utils=require(_0xce24('0x7'));var logger=require(_0xce24('0x8'))(_0xce24('0x9'));var config=require('../../config/environment');var jayson=require(_0xce24('0xa'));var client=jayson[_0xce24('0xb')][_0xce24('0xc')]({'port':0x232a});config[_0xce24('0xd')]=_[_0xce24('0xe')](config['redis'],{'host':_0xce24('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce24('0xd')]));require(_0xce24('0x10'))['register'](socket);function respondWithRpcPromise(_0x1ce660,_0x3dec1a,_0x2f533e){return new BPromise(function(_0x5081d7,_0x3a2a78){return client[_0xce24('0x11')](_0x1ce660,_0x2f533e)[_0xce24('0x12')](function(_0x13fabc){logger[_0xce24('0x13')](_0xce24('0x14'),_0x3dec1a,_0xce24('0x15'));logger['debug'](_0xce24('0x16'),_0x3dec1a,_0xce24('0x15'),JSON[_0xce24('0x17')](_0x13fabc));if(_0x13fabc[_0xce24('0x18')]){if(_0x13fabc[_0xce24('0x18')]['code']===0x1f4){logger[_0xce24('0x18')](_0xce24('0x14'),_0x3dec1a,_0x13fabc['error'][_0xce24('0x19')]);return _0x3a2a78(_0x13fabc['error']['message']);}logger[_0xce24('0x18')](_0xce24('0x14'),_0x3dec1a,_0x13fabc[_0xce24('0x18')]['message']);return _0x5081d7(_0x13fabc[_0xce24('0x18')][_0xce24('0x19')]);}else{logger[_0xce24('0x13')]('MailInteraction,\x20%s,\x20%s',_0x3dec1a,_0xce24('0x15'));_0x5081d7(_0x13fabc['result'][_0xce24('0x19')]);}})[_0xce24('0x1a')](function(_0x228f36){logger[_0xce24('0x18')](_0xce24('0x14'),_0x3dec1a,_0x228f36);_0x3a2a78(_0x228f36);});});}exports[_0xce24('0x1b')]=function(_0x14af2b){var _0x217296=this;return new Promise(function(_0x5c41f1,_0x384bff){return db[_0xce24('0x1c')][_0xce24('0x1d')](_0x14af2b[_0xce24('0x1e')],{'raw':_0x14af2b[_0xce24('0x1f')]?_0x14af2b[_0xce24('0x1f')][_0xce24('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14af2b[_0xce24('0x1f')]?_0x14af2b[_0xce24('0x1f')][_0xce24('0x21')]||null:null,'attributes':_0x14af2b[_0xce24('0x1f')]?_0x14af2b[_0xce24('0x1f')][_0xce24('0x22')]||null:null,'limit':_0x14af2b[_0xce24('0x1f')]?_0x14af2b[_0xce24('0x1f')][_0xce24('0x23')]||null:null})['then'](function(_0x4d465a){logger[_0xce24('0x13')](_0xce24('0x1b'),_0x14af2b);logger[_0xce24('0x24')](_0xce24('0x1b'),_0x14af2b,JSON['stringify'](_0x4d465a));_0x5c41f1(_0x4d465a);})[_0xce24('0x1a')](function(_0x11da20){logger['error'](_0xce24('0x1b'),_0x11da20['message'],_0x14af2b);_0x384bff(_0x217296[_0xce24('0x18')](0x1f4,_0x11da20[_0xce24('0x19')]));});});};exports[_0xce24('0x25')]=function(_0x3b1522){return new Promise(function(_0x21793a,_0x727c44){return db[_0xce24('0x1c')][_0xce24('0x26')]({'where':_0x3b1522['options']?_0x3b1522[_0xce24('0x1f')]['where']||null:null})[_0xce24('0x12')](function(_0x5a07bd){if(_0x5a07bd){return _0x5a07bd[_0xce24('0x27')](_0x3b1522['body'][_0xce24('0x28')],_['omit'](_0x3b1522[_0xce24('0x1e')],[_0xce24('0x28'),'id'])||{});}})['spread'](function(_0xd46c67){logger[_0xce24('0x13')]('AddTags',_0x3b1522);logger[_0xce24('0x24')](_0xce24('0x29'),_0x3b1522,JSON[_0xce24('0x17')](_0xd46c67));_0x21793a(_0xd46c67);})[_0xce24('0x1a')](function(_0x3a060c){logger[_0xce24('0x18')]('AddTags',_0x3a060c[_0xce24('0x19')],_0x3b1522);_0x727c44(_this['error'](0x1f4,_0x3a060c[_0xce24('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8afde27..278e189 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 _0x06e9=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','emit'];(function(_0x30c87d,_0x52c8f5){var _0x2f5649=function(_0xfa768b){while(--_0xfa768b){_0x30c87d['push'](_0x30c87d['shift']());}};_0x2f5649(++_0x52c8f5);}(_0x06e9,0x14c));var _0x906e=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x06e9[_0x288f5e];return _0x476cc9;};'use strict';var MailInteractionEvents=require(_0x906e('0x0'));var events=[_0x906e('0x1'),_0x906e('0x2'),'update'];function createListener(_0x10fb82,_0x3fcc1c){return function(_0x16a66e){_0x3fcc1c[_0x906e('0x3')](_0x10fb82,_0x16a66e);};}function removeListener(_0x5d361f,_0x181fb9){return function(){MailInteractionEvents[_0x906e('0x4')](_0x5d361f,_0x181fb9);};}exports[_0x906e('0x5')]=function(_0x5ed5cf){for(var _0x1efdcf=0x0,_0x126a59=events[_0x906e('0x6')];_0x1efdcf<_0x126a59;_0x1efdcf++){var _0x497580=events[_0x1efdcf];var _0x2b4afb=createListener(_0x906e('0x7')+_0x497580,_0x5ed5cf);MailInteractionEvents['on'](_0x497580,_0x2b4afb);}}; \ No newline at end of file +var _0x1560=['remove','update','emit','removeListener','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x1560,0x18e));var _0x0156=function(_0x2291ae,_0x3ba21a){_0x2291ae=_0x2291ae-0x0;var _0x551986=_0x1560[_0x2291ae];return _0x551986;};'use strict';var MailInteractionEvents=require(_0x0156('0x0'));var events=[_0x0156('0x1'),_0x0156('0x2'),_0x0156('0x3')];function createListener(_0x4a09de,_0x1c9dd5){return function(_0xec49eb){_0x1c9dd5[_0x0156('0x4')](_0x4a09de,_0xec49eb);};}function removeListener(_0x5c6489,_0x57965c){return function(){MailInteractionEvents[_0x0156('0x5')](_0x5c6489,_0x57965c);};}exports['register']=function(_0x1f492b){for(var _0x75ac42=0x0,_0x440c89=events[_0x0156('0x6')];_0x75ac42<_0x440c89;_0x75ac42++){var _0x1717fa=events[_0x75ac42];var _0x2542cb=createListener(_0x0156('0x7')+_0x1717fa,_0x1f492b);MailInteractionEvents['on'](_0x1717fa,_0x2542cb);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 68a4ddd..cfabe44 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 _0xc686=['update','/:id/accept','accept','/:id/reject','reject','delete','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','download','mail','mailmessage:create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc686,0x148));var _0x6c68=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc686[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6c68('0x0'));var timeout=require('connect-timeout');var express=require(_0x6c68('0x1'));var router=express['Router']();var fs_extra=require(_0x6c68('0x2'));var auth=require(_0x6c68('0x3'));var interaction=require(_0x6c68('0x4'));var config=require(_0x6c68('0x5'));var controller=require(_0x6c68('0x6'));router[_0x6c68('0x7')]('/',auth[_0x6c68('0x8')](),controller[_0x6c68('0x9')]);router[_0x6c68('0x7')](_0x6c68('0xa'),auth[_0x6c68('0x8')](),controller[_0x6c68('0xb')]);router['get'](_0x6c68('0xc'),auth[_0x6c68('0x8')](),controller['show']);router[_0x6c68('0x7')]('/:id/download',auth[_0x6c68('0x8')](),controller[_0x6c68('0xd')]);router['post']('/',auth[_0x6c68('0x8')](),interaction['tracked'](_0x6c68('0xe'),_0x6c68('0xf')),controller['create']);router[_0x6c68('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6c68('0x11')]);router['put'](_0x6c68('0x12'),auth[_0x6c68('0x8')](),controller[_0x6c68('0x13')]);router['put'](_0x6c68('0x14'),auth[_0x6c68('0x8')](),controller[_0x6c68('0x15')]);router[_0x6c68('0x16')](_0x6c68('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdc65=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','/:id/accept','accept'];(function(_0x48ce42,_0x58fd14){var _0x5a6bf6=function(_0xd367bb){while(--_0xd367bb){_0x48ce42['push'](_0x48ce42['shift']());}};_0x5a6bf6(++_0x58fd14);}(_0xdc65,0x79));var _0x5dc6=function(_0xa12e0b,_0x4f7379){_0xa12e0b=_0xa12e0b-0x0;var _0xd71996=_0xdc65[_0xa12e0b];return _0xd71996;};'use strict';var multer=require(_0x5dc6('0x0'));var util=require(_0x5dc6('0x1'));var path=require(_0x5dc6('0x2'));var timeout=require(_0x5dc6('0x3'));var express=require('express');var router=express[_0x5dc6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5dc6('0x5'));var interaction=require(_0x5dc6('0x6'));var config=require(_0x5dc6('0x7'));var controller=require(_0x5dc6('0x8'));router[_0x5dc6('0x9')]('/',auth[_0x5dc6('0xa')](),controller[_0x5dc6('0xb')]);router[_0x5dc6('0x9')](_0x5dc6('0xc'),auth['isAuthenticated'](),controller[_0x5dc6('0xd')]);router[_0x5dc6('0x9')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller['show']);router[_0x5dc6('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x5dc6('0xf')]);router[_0x5dc6('0x10')]('/',auth['isAuthenticated'](),interaction[_0x5dc6('0x11')]('mail',_0x5dc6('0x12')),controller[_0x5dc6('0x13')]);router['put'](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x14')]);router[_0x5dc6('0x15')](_0x5dc6('0x16'),auth['isAuthenticated'](),controller[_0x5dc6('0x17')]);router[_0x5dc6('0x15')](_0x5dc6('0x18'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x19')]);router[_0x5dc6('0x1a')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x1b')]);module[_0x5dc6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a12bdc5..bbaef0a 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 _0xc582=['out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT','long','BOOLEAN','ENUM'];(function(_0x39580c,_0x22425c){var _0x1a4cd8=function(_0x42ee09){while(--_0x42ee09){_0x39580c['push'](_0x39580c['shift']());}};_0x1a4cd8(++_0x22425c);}(_0xc582,0x96));var _0x2c58=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xc582[_0x54defc];return _0x1955d3;};'use strict';var Sequelize=require(_0x2c58('0x0'));var _=require(_0x2c58('0x1'));module['exports']={'body':{'type':Sequelize[_0x2c58('0x2')](_0x2c58('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2c58('0x2')]('medium')},'read':{'type':Sequelize[_0x2c58('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c58('0x5')]('in','out'),'defaultValue':_0x2c58('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2c58('0x7')](0x1fe)},'from':{'type':Sequelize[_0x2c58('0x7')]},'to':{'type':Sequelize['TEXT'](_0x2c58('0x3'))},'cc':{'type':Sequelize[_0x2c58('0x2')](_0x2c58('0x3'))},'bcc':{'type':Sequelize[_0x2c58('0x2')](_0x2c58('0x3'))},'subject':{'type':Sequelize[_0x2c58('0x2')]},'sentAt':{'type':Sequelize[_0x2c58('0x8')]},'attach':{'type':Sequelize[_0x2c58('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2c58('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x2c58('0x3'))},'originCc':{'type':Sequelize[_0x2c58('0x2')](_0x2c58('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0x2c58('0xa'),_0x2c58('0xb')),'defaultValue':_0x2c58('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x5aae=['out','DATE','INTEGER','Email','Chat','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5aae,0x131));var _0xe5aa=function(_0x19584e,_0x528482){_0x19584e=_0x19584e-0x0;var _0x5725b0=_0x5aae[_0x19584e];return _0x5725b0;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xe5aa('0x0')](_0xe5aa('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xe5aa('0x2'))},'read':{'type':Sequelize[_0xe5aa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe5aa('0x4')]('in',_0xe5aa('0x5')),'defaultValue':_0xe5aa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xe5aa('0x0')]('long')},'cc':{'type':Sequelize['TEXT'](_0xe5aa('0x1'))},'bcc':{'type':Sequelize[_0xe5aa('0x0')](_0xe5aa('0x1'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xe5aa('0x6')]},'attach':{'type':Sequelize[_0xe5aa('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe5aa('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xe5aa('0x0')](_0xe5aa('0x1'))},'originCc':{'type':Sequelize['TEXT'](_0xe5aa('0x1'))},'originChannel':{'type':Sequelize[_0xe5aa('0x4')](_0xe5aa('0x8'),_0xe5aa('0x9')),'defaultValue':_0xe5aa('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index bf28d69..cc46540 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 _0xbeed=['read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','acceptmessage','RejectMessage','QueryTypes','reject','EventManager','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','json','offset','undefined','count','limit','status','set','Content-Range','update','destroy','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','MailMessage','includeAll','include','show','params','body','find','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','length','join','server/files/attachments','basename','List','CmContact','ListId','SendMail','messageId','format','stringify','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbeed,0xd1));var _0xdbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeed[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xdbee('0x0'));var moment=require(_0xdbee('0x1'));var BPromise=require('bluebird');var util=require(_0xdbee('0x2'));var path=require(_0xdbee('0x3'));var fs=require('fs');var _=require(_0xdbee('0x4'));var Redis=require(_0xdbee('0x5'));var htmlToText=require(_0xdbee('0x6'));var qs=require(_0xdbee('0x7'));var logger=require(_0xdbee('0x8'))(_0xdbee('0x9'));var interaction_log=require(_0xdbee('0x8'))(_0xdbee('0xa'));var config=require(_0xdbee('0xb'));var db=require(_0xdbee('0xc'))['db'];config[_0xdbee('0xd')]=_[_0xdbee('0xe')](config[_0xdbee('0xd')],{'host':_0xdbee('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xdbee('0x10'));require(_0xdbee('0x11'))[_0xdbee('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdbee('0x13')][_0xdbee('0x14')]({'port':0x232c});var client9003=jayson[_0xdbee('0x13')][_0xdbee('0x14')]({'port':0x232b});var client9002=jayson[_0xdbee('0x13')][_0xdbee('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x354465,_0x7dfdd1,_0x2c4581,_0x46865b){return new BPromise(function(_0x59528b,_0x4eac2d){var _0x2128c6=_0x46865b||client;return _0x2128c6['request'](_0x354465,_0x2c4581)[_0xdbee('0x15')](function(_0x6108a8){logger[_0xdbee('0x16')](_0xdbee('0x17'),_0x7dfdd1,_0xdbee('0x18'));logger['debug'](_0xdbee('0x19'),_0x7dfdd1,_0xdbee('0x18'),JSON['stringify'](_0x6108a8));if(_0x6108a8[_0xdbee('0x1a')]){if(_0x6108a8[_0xdbee('0x1a')][_0xdbee('0x1b')]===0x1f4){logger[_0xdbee('0x1a')](_0xdbee('0x17'),_0x7dfdd1,_0x6108a8[_0xdbee('0x1a')][_0xdbee('0x1c')]);return _0x4eac2d(_0x6108a8['error'][_0xdbee('0x1c')]);}logger[_0xdbee('0x1a')]('MailMessage,\x20%s,\x20%s',_0x7dfdd1,_0x6108a8[_0xdbee('0x1a')][_0xdbee('0x1c')]);return _0x59528b(_0x6108a8['error'][_0xdbee('0x1c')]);}else{logger[_0xdbee('0x16')](_0xdbee('0x17'),_0x7dfdd1,_0xdbee('0x18'));_0x59528b(_0x6108a8[_0xdbee('0x1d')][_0xdbee('0x1c')]);}})[_0xdbee('0x1e')](function(_0x20dadd){logger[_0xdbee('0x1a')](_0xdbee('0x17'),_0x7dfdd1,_0x20dadd);_0x4eac2d(_0x20dadd);});});}function respondWithResult(_0x3434da,_0x5ad435){_0x5ad435=_0x5ad435||0xc8;return function(_0x95ccab){if(_0x95ccab){return _0x3434da['status'](_0x5ad435)[_0xdbee('0x1f')](_0x95ccab);}};}function respondWithFilteredResult(_0x40c61c,_0x3cbeb6){return function(_0x415146){if(_0x415146){var _0x346c2a=typeof _0x3cbeb6[_0xdbee('0x20')]===_0xdbee('0x21')&&typeof _0x3cbeb6['limit']==='undefined';var _0x3fdbf5=_0x415146['count'];var _0x59f973=_0x346c2a?0x0:_0x3cbeb6[_0xdbee('0x20')];var _0x461467=_0x346c2a?_0x415146[_0xdbee('0x22')]:_0x3cbeb6['offset']+_0x3cbeb6[_0xdbee('0x23')];var _0x1c5106;if(_0x461467>=_0x3fdbf5){_0x461467=_0x3fdbf5;_0x1c5106=0xc8;}else{_0x1c5106=0xce;}_0x40c61c[_0xdbee('0x24')](_0x1c5106);return _0x40c61c[_0xdbee('0x25')](_0xdbee('0x26'),_0x59f973+'-'+_0x461467+'/'+_0x3fdbf5)[_0xdbee('0x1f')](_0x415146);}return null;};}function saveUpdates(_0x17cc85){return function(_0x27026f){if(_0x27026f){return _0x27026f[_0xdbee('0x27')](_0x17cc85)[_0xdbee('0x15')](function(_0x20c1be){return _0x20c1be;});}return null;};}function removeEntity(_0x34ae4b){return function(_0xf28346){if(_0xf28346){return _0xf28346[_0xdbee('0x28')]()[_0xdbee('0x15')](function(){_0x34ae4b[_0xdbee('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d20a8){return function(_0x545f74){if(!_0x545f74){_0x4d20a8['sendStatus'](0x194);}return _0x545f74;};}function handleError(_0x54d794,_0x23b579){_0x23b579=_0x23b579||0x1f4;return function(_0x4df49b){logger[_0xdbee('0x1a')](_0x4df49b[_0xdbee('0x29')]);if(_0x4df49b[_0xdbee('0x2a')]){delete _0x4df49b['name'];}_0x54d794[_0xdbee('0x24')](_0x23b579)[_0xdbee('0x2b')](_0x4df49b);};}exports[_0xdbee('0x2c')]=function(_0x168977,_0x132ae5){var _0x5c17d7={},_0x1f5c23={},_0x50399b={'count':0x0,'rows':[]};var _0x3ce5b8=_['map'](db['MailMessage'][_0xdbee('0x2d')],function(_0x510186){return{'name':_0x510186['fieldName'],'type':_0x510186[_0xdbee('0x2e')]['key']};});_0x1f5c23[_0xdbee('0x2f')]=_[_0xdbee('0x30')](_0x3ce5b8,_0xdbee('0x2a'));_0x1f5c23[_0xdbee('0x31')]=_[_0xdbee('0x32')](_0x168977[_0xdbee('0x31')]);_0x1f5c23[_0xdbee('0x33')]=_[_0xdbee('0x34')](_0x1f5c23[_0xdbee('0x2f')],_0x1f5c23['query']);_0x5c17d7[_0xdbee('0x35')]=_[_0xdbee('0x34')](_0x1f5c23[_0xdbee('0x2f')],qs['fields'](_0x168977[_0xdbee('0x31')][_0xdbee('0x36')]));_0x5c17d7['attributes']=_0x5c17d7[_0xdbee('0x35')]['length']?_0x5c17d7[_0xdbee('0x35')]:_0x1f5c23[_0xdbee('0x2f')];if(!_0x168977[_0xdbee('0x31')][_0xdbee('0x37')](_0xdbee('0x38'))){_0x5c17d7['limit']=qs[_0xdbee('0x23')](_0x168977[_0xdbee('0x31')][_0xdbee('0x23')]);_0x5c17d7['offset']=qs['offset'](_0x168977[_0xdbee('0x31')][_0xdbee('0x20')]);}_0x5c17d7[_0xdbee('0x39')]=qs['sort'](_0x168977[_0xdbee('0x31')]['sort']);_0x5c17d7[_0xdbee('0x3a')]=qs[_0xdbee('0x33')](_['pick'](_0x168977['query'],_0x1f5c23['filters']),_0x3ce5b8);if(_0x168977[_0xdbee('0x31')][_0xdbee('0x3b')]){_0x5c17d7[_0xdbee('0x3a')]=_[_0xdbee('0x3c')](_0x5c17d7[_0xdbee('0x3a')],{'$or':_[_0xdbee('0x30')](_0x3ce5b8,function(_0x1b9845){if(_0x1b9845['type']!==_0xdbee('0x3d')){var _0x3b4018={};_0x3b4018[_0x1b9845[_0xdbee('0x2a')]]={'$like':'%'+_0x168977[_0xdbee('0x31')][_0xdbee('0x3b')]+'%'};return _0x3b4018;}})});}_0x5c17d7=_[_0xdbee('0x3c')]({},_0x5c17d7,_0x168977[_0xdbee('0x3e')]);var _0x4d39d7={'where':_0x5c17d7[_0xdbee('0x3a')]};return db[_0xdbee('0x3f')]['count'](_0x4d39d7)['then'](function(_0x90a484){_0x50399b[_0xdbee('0x22')]=_0x90a484;if(_0x168977[_0xdbee('0x31')][_0xdbee('0x40')]){_0x5c17d7[_0xdbee('0x41')]=[{'all':!![]}];}return db[_0xdbee('0x3f')]['findAll'](_0x5c17d7);})[_0xdbee('0x15')](function(_0x2dbeae){_0x50399b['rows']=_0x2dbeae;return _0x50399b;})[_0xdbee('0x15')](respondWithFilteredResult(_0x132ae5,_0x5c17d7))[_0xdbee('0x1e')](handleError(_0x132ae5,null));};exports[_0xdbee('0x42')]=function(_0xe79cd,_0xeb767a){var _0x254bbe={'raw':!![],'where':{'id':_0xe79cd[_0xdbee('0x43')]['id']}},_0x17bb3a={};_0x17bb3a['model']=_[_0xdbee('0x32')](db[_0xdbee('0x3f')]['rawAttributes']);_0x17bb3a[_0xdbee('0x31')]=_[_0xdbee('0x32')](_0xe79cd['query']);_0x17bb3a[_0xdbee('0x33')]=_[_0xdbee('0x34')](_0x17bb3a[_0xdbee('0x2f')],_0x17bb3a['query']);_0x254bbe['attributes']=_['intersection'](_0x17bb3a[_0xdbee('0x2f')],qs[_0xdbee('0x36')](_0xe79cd[_0xdbee('0x31')][_0xdbee('0x36')]));_0x254bbe['attributes']=_0x254bbe['attributes']['length']?_0x254bbe[_0xdbee('0x35')]:_0x17bb3a['model'];if(_0xe79cd[_0xdbee('0x31')][_0xdbee('0x40')]){_0x254bbe[_0xdbee('0x41')]=[{'all':!![]}];}_0x254bbe=_[_0xdbee('0x3c')]({},_0x254bbe,_0xe79cd['options']);return db['MailMessage']['find'](_0x254bbe)[_0xdbee('0x15')](handleEntityNotFound(_0xeb767a,null))[_0xdbee('0x15')](respondWithResult(_0xeb767a,null))[_0xdbee('0x1e')](handleError(_0xeb767a,null));};exports['update']=function(_0x2da089,_0x38c741){if(_0x2da089[_0xdbee('0x44')]['id']){delete _0x2da089[_0xdbee('0x44')]['id'];}return db[_0xdbee('0x3f')][_0xdbee('0x45')]({'where':{'id':_0x2da089[_0xdbee('0x43')]['id']}})['then'](handleEntityNotFound(_0x38c741,null))[_0xdbee('0x15')](saveUpdates(_0x2da089['body'],null))[_0xdbee('0x15')](respondWithResult(_0x38c741,null))[_0xdbee('0x1e')](handleError(_0x38c741,null));};exports[_0xdbee('0x28')]=function(_0x21ab0e,_0x9fd7bf){return db['MailMessage'][_0xdbee('0x45')]({'where':{'id':_0x21ab0e['params']['id']}})[_0xdbee('0x15')](handleEntityNotFound(_0x9fd7bf,null))[_0xdbee('0x15')](removeEntity(_0x9fd7bf,null))[_0xdbee('0x1e')](handleError(_0x9fd7bf,null));};exports[_0xdbee('0x46')]=function(_0x3c9792,_0x2167ac){return db[_0xdbee('0x3f')][_0xdbee('0x46')]()[_0xdbee('0x15')](respondWithResult(_0x2167ac,null))[_0xdbee('0x1e')](handleError(_0x2167ac,null));};exports['create']=function(_0x19707f,_0x599a9b){return db[_0xdbee('0x3f')][_0xdbee('0x47')](_0x19707f[_0xdbee('0x44')])['then'](function(_0x4f61ad){if(_0x4f61ad){if(_0x4f61ad[_0xdbee('0x48')]===_0xdbee('0x49')&&!_0x4f61ad[_0xdbee('0x4a')]){var _0x3878b0,_0xed2397,_0x45a69d;if(_0x19707f[_0xdbee('0x44')]['to']){_0xed2397=_0x19707f['body']['to'][_0xdbee('0x4b')](',')[0x0];}return db[_0xdbee('0x4c')][_0xdbee('0x4d')]({'where':{'id':_0x4f61ad[_0xdbee('0x4e')]},'include':[{'model':db[_0xdbee('0x4f')],'as':'List','include':[{'model':db['CmContact'],'as':_0xdbee('0x50'),'where':{'email':_0xed2397},'limit':0x1,'order':[['updatedAt',_0xdbee('0x51')]]}]},{'model':db[_0xdbee('0x52')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xdbee('0x53')],'as':_0xdbee('0x53'),'raw':!![]}]}]})[_0xdbee('0x15')](function(_0xb23242){_0x3878b0=_0xb23242;if(!_0x3878b0||!_0x3878b0[_0xdbee('0x54')])return;var _0x408cd3=_0x3878b0[_0xdbee('0x55')]();if(_0x19707f[_0xdbee('0x44')][_0xdbee('0x56')]&&_0x19707f[_0xdbee('0x44')]['attachments'][_0xdbee('0x57')]){for(var _0x58fdd7=0x0;_0x58fdd7<_0x19707f[_0xdbee('0x44')]['attachments'][_0xdbee('0x57')];_0x58fdd7+=0x1){_0x19707f[_0xdbee('0x44')][_0xdbee('0x56')][_0x58fdd7]={'filename':_0x19707f[_0xdbee('0x44')][_0xdbee('0x56')][_0x58fdd7][_0xdbee('0x2a')],'path':path[_0xdbee('0x58')](config['root'],_0xdbee('0x59'),_0x19707f[_0xdbee('0x44')][_0xdbee('0x56')][_0x58fdd7][_0xdbee('0x5a')])};}}_0x45a69d={'account':_0x408cd3,'message':_0x19707f[_0xdbee('0x44')]};return;})[_0xdbee('0x15')](function(){if(_0x3878b0[_0xdbee('0x5b')]){if(_0x3878b0[_0xdbee('0x5b')]['Contacts'][_0xdbee('0x57')]){return _0x3878b0['List'][_0xdbee('0x50')][0x0];}else{return db[_0xdbee('0x5c')][_0xdbee('0x47')](_[_0xdbee('0xe')](_0x19707f[_0xdbee('0x44')],{'firstName':_0x19707f[_0xdbee('0x44')]['to'],'email':_0x19707f[_0xdbee('0x44')]['to'],'phone':_0x19707f[_0xdbee('0x44')]['to'],'ListId':_0x3878b0[_0xdbee('0x5d')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xdbee('0x15')](function(){if(_0x45a69d){return respondWithRpcPromise(_0xdbee('0x5e'),'sendMail',_0x45a69d,client9003)[_0xdbee('0x15')](function(_0x22d7f9){return _0x4f61ad['update']({'read':!![],'messageId':_0x22d7f9[_0xdbee('0x5f')],'sentAt':moment()[_0xdbee('0x60')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdbee('0x1e')](function(_0x4811b4){logger['error']('%s',JSON[_0xdbee('0x61')](_0x4811b4));return _0x4f61ad;});}return _0x4f61ad;});}return _0x4f61ad;}})[_0xdbee('0x15')](respondWithResult(_0x599a9b,0xc9))[_0xdbee('0x1e')](handleError(_0x599a9b,null));};exports[_0xdbee('0x62')]=function(_0x4d547d,_0x3a5f3f){var _0x281b17={'agent':{},'channel':_0xdbee('0x63')};if(_0x4d547d[_0xdbee('0x44')]['id']){delete _0x4d547d[_0xdbee('0x44')]['id'];}_0x4d547d[_0xdbee('0x44')][_0xdbee('0x64')]=!![];_0x4d547d[_0xdbee('0x44')]['readAt']=moment()['format'](_0xdbee('0x65'));_0x4d547d[_0xdbee('0x44')][_0xdbee('0x66')]=_0x4d547d[_0xdbee('0x44')]['UserId']||_0x4d547d[_0xdbee('0x67')]['id'];_0x281b17[_0xdbee('0x68')]['id']=_0x4d547d['body']['UserId'];return db[_0xdbee('0x3f')][_0xdbee('0x45')]({'where':{'id':_0x4d547d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a5f3f,null))[_0xdbee('0x15')](saveUpdates(_0x4d547d[_0xdbee('0x44')],null))[_0xdbee('0x15')](function(_0x483ca0){if(_0x483ca0){_0x281b17[_0xdbee('0x1c')]=_0x483ca0[_0xdbee('0x69')]({'plain':!![]});return db[_0xdbee('0x6a')][_0xdbee('0x45')]({'where':{'id':_0x483ca0[_0xdbee('0x6b')]}});}return null;})[_0xdbee('0x15')](handleEntityNotFound(_0x3a5f3f,null))[_0xdbee('0x15')](function(_0x419d70){if(_0x419d70){return _0x419d70['update']({'UserId':_0x4d547d['body']['UserId'],'read1stAt':_[_0xdbee('0x6c')](_0x419d70[_0xdbee('0x6d')])?moment()[_0xdbee('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdbee('0x15')](function(_0x4ad6d7){if(_0x4ad6d7){_0x281b17[_0xdbee('0x6e')]=_0x4ad6d7['get']({'plain':!![]});interaction_log['info'](_0xdbee('0x6f'),_0x4d547d[_0xdbee('0x67')]['id'],_0x4d547d[_0xdbee('0x67')][_0xdbee('0x2a')],_0x4d547d['user'][_0xdbee('0x70')],_0x281b17[_0xdbee('0x6e')]['id'],_0x4d547d[_0xdbee('0x44')]?JSON['stringify'](_0x4d547d[_0xdbee('0x44')]):_0xdbee('0x71'));return respondWithRpcPromise(_0xdbee('0x72'),_0xdbee('0x73'),_0x281b17);}return null;})['then'](function(_0x1b338d){var _0x5cbb39=_0xdbee('0x74')+_0x1b338d[_0xdbee('0x1c')][_0xdbee('0x75')];return db[_0xdbee('0x76')][_0xdbee('0x31')](_0x5cbb39,{'type':db['Sequelize']['QueryTypes'][_0xdbee('0x77')],'raw':!![]})['then'](function(_0x41f1b9){return _0x41f1b9;});})[_0xdbee('0x15')](function(_0x565019){if(_0x565019){_0x281b17[_0xdbee('0x1c')][_0xdbee('0x78')]=_0x565019[0x0];if(!_0x4d547d['body'][_0xdbee('0x66')])return;return db[_0xdbee('0x79')][_0xdbee('0x45')]({'where':{'id':_0x4d547d[_0xdbee('0x44')][_0xdbee('0x66')],'role':_0xdbee('0x68')},'attributes':['id',_0xdbee('0x2a'),_0xdbee('0x7a'),_0xdbee('0x7b'),_0xdbee('0x7c')],'raw':!![]});}return null;})[_0xdbee('0x15')](function(_0x5e5b84){if(!_0x5e5b84)return null;_0x281b17[_0xdbee('0x1c')][_0xdbee('0x68')]=_0x5e5b84;return _0x281b17;})[_0xdbee('0x15')](function(_0x284faf){if(_0x284faf){if(_0x4d547d[_0xdbee('0x44')][_0xdbee('0x7d')]){_0x281b17[_0xdbee('0x1c')][_0xdbee('0x7e')]=util[_0xdbee('0x60')](_0xdbee('0x7f'),_0x4d547d[_0xdbee('0x67')][_0xdbee('0x2a')]);_0x281b17['message'][_0xdbee('0x80')]=_0x281b17[_0xdbee('0x80')];_0x281b17[_0xdbee('0x1c')][_0xdbee('0x81')]=_0x281b17['channel'];_0x281b17[_0xdbee('0x1c')][_0xdbee('0x82')]=_0xdbee('0x62');_0x281b17[_0xdbee('0x1c')]['body']=htmlToText[_0xdbee('0x83')](_0x281b17['message'][_0xdbee('0x44')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xdbee('0x84'),'message':_0x281b17['message']},client9002)['then'](function(){return _0x281b17;});}return _0x281b17;}return null;})['then'](respondWithResult(_0x3a5f3f,null))[_0xdbee('0x1e')](handleError(_0x3a5f3f,null));};exports['reject']=function(_0x39f8ab,_0x4d779e){var _0x5f366a={'agent':{},'channel':_0xdbee('0x63')};if(_0x39f8ab[_0xdbee('0x44')]['id']){delete _0x39f8ab[_0xdbee('0x44')]['id'];}_0x39f8ab[_0xdbee('0x44')][_0xdbee('0x66')]=_0x39f8ab['body'][_0xdbee('0x66')]||_0x39f8ab[_0xdbee('0x67')]['id'];_0x5f366a[_0xdbee('0x68')]['id']=_0x39f8ab[_0xdbee('0x44')][_0xdbee('0x66')];return db['MailMessage']['find']({'where':{'id':_0x39f8ab['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d779e,null))[_0xdbee('0x15')](function(_0x3df252){if(_0x3df252){_0x5f366a[_0xdbee('0x1c')]=_0x3df252['get']({'plain':!![]});return db[_0xdbee('0x6a')][_0xdbee('0x45')]({'where':{'id':_0x3df252[_0xdbee('0x6b')]}});}return null;})[_0xdbee('0x15')](handleEntityNotFound(_0x4d779e,null))[_0xdbee('0x15')](function(_0x2cfde7){if(_0x2cfde7){_0x5f366a[_0xdbee('0x6e')]=_0x2cfde7[_0xdbee('0x69')]({'plain':!![]});interaction_log[_0xdbee('0x16')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39f8ab[_0xdbee('0x67')]['id'],_0x39f8ab['user']['name'],_0x39f8ab['user']['role'],_0x5f366a[_0xdbee('0x6e')]['id'],_0x39f8ab[_0xdbee('0x44')]?JSON[_0xdbee('0x61')](_0x39f8ab[_0xdbee('0x44')]):'null');return respondWithRpcPromise(_0xdbee('0x85'),'rejectMessage',_0x5f366a);}return null;})['then'](function(_0x1134d8){var _0x28931f=_0xdbee('0x74')+_0x1134d8[_0xdbee('0x1c')][_0xdbee('0x75')];return db['sequelize'][_0xdbee('0x31')](_0x28931f,{'type':db['Sequelize'][_0xdbee('0x86')][_0xdbee('0x77')],'raw':!![]})['then'](function(_0x3ca2fb){return _0x3ca2fb;});})['then'](function(_0x20708f){if(_0x20708f){_0x5f366a[_0xdbee('0x1c')][_0xdbee('0x78')]=_0x20708f[0x0];if(!_0x39f8ab[_0xdbee('0x44')][_0xdbee('0x66')])return;return db[_0xdbee('0x79')][_0xdbee('0x45')]({'where':{'id':_0x39f8ab[_0xdbee('0x44')][_0xdbee('0x66')],'role':_0xdbee('0x68')},'attributes':['id','name','fullname',_0xdbee('0x7b'),_0xdbee('0x7c')],'raw':!![]});}return null;})['then'](function(_0x5f1396){if(!_0x5f1396)return null;_0x5f366a[_0xdbee('0x1c')][_0xdbee('0x68')]=_0x5f1396;return _0x5f366a;})[_0xdbee('0x15')](function(_0x264e29){if(_0x264e29){_0x264e29[_0xdbee('0x1c')][_0xdbee('0x7e')]=util[_0xdbee('0x60')](_0xdbee('0x7f'),_0x39f8ab[_0xdbee('0x67')][_0xdbee('0x2a')]);_0x264e29[_0xdbee('0x1c')]['channel']=_0x5f366a['channel'];_0x264e29[_0xdbee('0x1c')][_0xdbee('0x81')]=_0x5f366a[_0xdbee('0x80')];_0x264e29['message'][_0xdbee('0x82')]=_0xdbee('0x87');_0x264e29[_0xdbee('0x1c')][_0xdbee('0x44')]=htmlToText[_0xdbee('0x83')](_0x5f366a[_0xdbee('0x1c')][_0xdbee('0x44')]);respondWithRpcPromise(_0xdbee('0x88'),_0xdbee('0x88'),{'event':_0xdbee('0x89'),'message':_0x264e29[_0xdbee('0x1c')]},client9002);return _0x5f366a;}return null;})[_0xdbee('0x15')](respondWithResult(_0x4d779e,null))[_0xdbee('0x1e')](handleError(_0x4d779e,null));};exports[_0xdbee('0x8a')]=function(_0x16d0e9,_0x529c91){var _0x27f2ee=moment()[_0xdbee('0x8b')]()[_0xdbee('0x8c')]();var _0x6f2de=path[_0xdbee('0x58')](config[_0xdbee('0x8d')],_0xdbee('0x8e'),_0xdbee('0x8f'),_0xdbee('0x90'));var _0xebb59b=path[_0xdbee('0x58')](config[_0xdbee('0x8d')],_0xdbee('0x8e'),_0xdbee('0x8f'),'attachments');var _0x3ac7db=util['format'](_0xdbee('0x91'),_0x27f2ee);return db[_0xdbee('0x3f')][_0xdbee('0x45')]({'where':{'id':_0x16d0e9['params']['id']},'attributes':['id',_0xdbee('0x44'),_0xdbee('0x92'),'to','cc',_0xdbee('0x93'),'subject',_0xdbee('0x94')],'include':_0x16d0e9[_0xdbee('0x31')][_0xdbee('0x56')]?[{'model':db[_0xdbee('0x95')],'as':_0xdbee('0x96')}]:undefined})['then'](handleEntityNotFound(_0x529c91,null))[_0xdbee('0x15')](function(_0x4c205e){if(_0x4c205e){var _0x2f7247=_0x4c205e;var _0x5a47b4={'from':_0x2f7247[_0xdbee('0x92')],'to':_0x2f7247['to'],'subject':_0x2f7247[_0xdbee('0x97')],'html':htmlEntities[_0xdbee('0x98')](_0x2f7247[_0xdbee('0x44')]),'headers':{'Date':moment(_0x2f7247['createdAt'])[_0xdbee('0x60')](_0xdbee('0x99'))},'attachments':[]};if(_0x4c205e['cc']){_0x5a47b4[_0xdbee('0x9a')]['Cc']=_0x4c205e['cc'];}if(_0x4c205e['bcc']){_0x5a47b4['headers'][_0xdbee('0x9b')]=_0x4c205e['bcc'];}return new BPromise(function(_0x19ce09,_0x520947){if(_0x4c205e[_0xdbee('0x96')]){for(var _0x64e24b=0x0;_0x64e24b<_0x4c205e['Attachments'][_0xdbee('0x57')];_0x64e24b++){var _0x193364=_0x4c205e[_0xdbee('0x96')][_0x64e24b];var _0x4eb787=path[_0xdbee('0x58')](_0xebb59b,_0x193364[_0xdbee('0x5a')]);if(fs[_0xdbee('0x9c')](_0x4eb787)){_0x5a47b4[_0xdbee('0x56')]['push']({'name':_0x193364[_0xdbee('0x2a')],'contentType':_0x193364[_0xdbee('0x2e')],'data':fs[_0xdbee('0x9d')](_0x4eb787)});}}}emlformat['build'](_0x5a47b4,function(_0x5aa430,_0x42f9ad){if(_0x5aa430)return _0x520947(_0x5aa430);fs['writeFileSync'](path[_0xdbee('0x58')](_0x6f2de,_0x3ac7db),_0x42f9ad);return _0x19ce09(_0x42f9ad);});});}})[_0xdbee('0x15')](function(_0x15e446){if(_0x15e446){return _0x529c91[_0xdbee('0x8a')](path[_0xdbee('0x58')](_0x6f2de,_0x3ac7db),_0x3ac7db,function(_0x24391e){if(!_0x24391e)fs[_0xdbee('0x9e')](path[_0xdbee('0x58')](_0x6f2de,_0x3ac7db));});}})[_0xdbee('0x1e')](handleError(_0x529c91,null));}; \ No newline at end of file +var _0x1565=['html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','end','sendStatus','stack','name','map','type','key','model','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','where','pick','filter','merge','options','MailMessage','includeAll','include','show','params','rawAttributes','length','find','body','describe','create','direction','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','attachments','root','defaults','ListId','SendMail','messageId','format','stringify','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','internal','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','join','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x52b242,_0xca71c9){var _0x786b1a=function(_0x583fab){while(--_0x583fab){_0x52b242['push'](_0x52b242['shift']());}};_0x786b1a(++_0xca71c9);}(_0x1565,0x1cd));var _0x5156=function(_0x40ae5b,_0x4d16fb){_0x40ae5b=_0x40ae5b-0x0;var _0x230d1=_0x1565[_0x40ae5b];return _0x230d1;};'use strict';var emlformat=require(_0x5156('0x0'));var moment=require(_0x5156('0x1'));var BPromise=require(_0x5156('0x2'));var util=require(_0x5156('0x3'));var path=require(_0x5156('0x4'));var fs=require('fs');var _=require(_0x5156('0x5'));var Redis=require(_0x5156('0x6'));var htmlToText=require('html-to-text');var qs=require(_0x5156('0x7'));var logger=require('../../config/logger')(_0x5156('0x8'));var interaction_log=require(_0x5156('0x9'))(_0x5156('0xa'));var config=require(_0x5156('0xb'));var db=require(_0x5156('0xc'))['db'];config[_0x5156('0xd')]=_['defaults'](config['redis'],{'host':_0x5156('0xe'),'port':0x18eb});var socket=require(_0x5156('0xf'))(new Redis(config[_0x5156('0xd')]));var htmlEntities=require(_0x5156('0x10'));require(_0x5156('0x11'))['register'](socket);var jayson=require(_0x5156('0x12'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x5156('0x13')][_0x5156('0x14')]({'port':0x232b});var client9002=jayson[_0x5156('0x13')][_0x5156('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x17f879,_0x613f0d,_0x183a2d,_0x3135a4){return new BPromise(function(_0x454b5f,_0x14b39b){var _0x123a3f=_0x3135a4||client;return _0x123a3f[_0x5156('0x15')](_0x17f879,_0x183a2d)[_0x5156('0x16')](function(_0x51a4dd){logger[_0x5156('0x17')]('MailMessage,\x20%s,\x20%s',_0x613f0d,'request\x20sent');logger[_0x5156('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x613f0d,_0x5156('0x19'),JSON['stringify'](_0x51a4dd));if(_0x51a4dd[_0x5156('0x1a')]){if(_0x51a4dd[_0x5156('0x1a')][_0x5156('0x1b')]===0x1f4){logger[_0x5156('0x1a')](_0x5156('0x1c'),_0x613f0d,_0x51a4dd[_0x5156('0x1a')][_0x5156('0x1d')]);return _0x14b39b(_0x51a4dd[_0x5156('0x1a')][_0x5156('0x1d')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x613f0d,_0x51a4dd['error'][_0x5156('0x1d')]);return _0x454b5f(_0x51a4dd[_0x5156('0x1a')][_0x5156('0x1d')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x613f0d,_0x5156('0x19'));_0x454b5f(_0x51a4dd[_0x5156('0x1e')][_0x5156('0x1d')]);}})[_0x5156('0x1f')](function(_0x10330a){logger[_0x5156('0x1a')](_0x5156('0x1c'),_0x613f0d,_0x10330a);_0x14b39b(_0x10330a);});});}function respondWithResult(_0x3a881d,_0x252fc5){_0x252fc5=_0x252fc5||0xc8;return function(_0x2bc15c){if(_0x2bc15c){return _0x3a881d[_0x5156('0x20')](_0x252fc5)[_0x5156('0x21')](_0x2bc15c);}};}function respondWithFilteredResult(_0x2c6036,_0x20a4ec){return function(_0x4aef6f){if(_0x4aef6f){var _0xd5d712=typeof _0x20a4ec[_0x5156('0x22')]==='undefined'&&typeof _0x20a4ec[_0x5156('0x23')]===_0x5156('0x24');var _0x29fd7e=_0x4aef6f[_0x5156('0x25')];var _0x992782=_0xd5d712?0x0:_0x20a4ec['offset'];var _0x3ce851=_0xd5d712?_0x4aef6f[_0x5156('0x25')]:_0x20a4ec['offset']+_0x20a4ec[_0x5156('0x23')];var _0x34d820;if(_0x3ce851>=_0x29fd7e){_0x3ce851=_0x29fd7e;_0x34d820=0xc8;}else{_0x34d820=0xce;}_0x2c6036['status'](_0x34d820);return _0x2c6036[_0x5156('0x26')](_0x5156('0x27'),_0x992782+'-'+_0x3ce851+'/'+_0x29fd7e)[_0x5156('0x21')](_0x4aef6f);}return null;};}function saveUpdates(_0x1e5e12){return function(_0x413445){if(_0x413445){return _0x413445[_0x5156('0x28')](_0x1e5e12)[_0x5156('0x16')](function(_0x3ecaaf){return _0x3ecaaf;});}return null;};}function removeEntity(_0x5bfe63){return function(_0x41f805){if(_0x41f805){return _0x41f805['destroy']()[_0x5156('0x16')](function(){_0x5bfe63[_0x5156('0x20')](0xcc)[_0x5156('0x29')]();});}};}function handleEntityNotFound(_0x520d73){return function(_0xd9fc9c){if(!_0xd9fc9c){_0x520d73[_0x5156('0x2a')](0x194);}return _0xd9fc9c;};}function handleError(_0x38138e,_0x75d6f0){_0x75d6f0=_0x75d6f0||0x1f4;return function(_0x5420c6){logger[_0x5156('0x1a')](_0x5420c6[_0x5156('0x2b')]);if(_0x5420c6[_0x5156('0x2c')]){delete _0x5420c6[_0x5156('0x2c')];}_0x38138e['status'](_0x75d6f0)['send'](_0x5420c6);};}exports['index']=function(_0x5f21c4,_0x297cb6){var _0x565f4b={},_0x4792af={},_0xafcd2={'count':0x0,'rows':[]};var _0x552a22=_[_0x5156('0x2d')](db['MailMessage']['rawAttributes'],function(_0xb0c1b0){return{'name':_0xb0c1b0['fieldName'],'type':_0xb0c1b0[_0x5156('0x2e')][_0x5156('0x2f')]};});_0x4792af[_0x5156('0x30')]=_[_0x5156('0x2d')](_0x552a22,_0x5156('0x2c'));_0x4792af['query']=_[_0x5156('0x31')](_0x5f21c4['query']);_0x4792af[_0x5156('0x32')]=_[_0x5156('0x33')](_0x4792af['model'],_0x4792af['query']);_0x565f4b[_0x5156('0x34')]=_[_0x5156('0x33')](_0x4792af[_0x5156('0x30')],qs[_0x5156('0x35')](_0x5f21c4[_0x5156('0x36')][_0x5156('0x35')]));_0x565f4b[_0x5156('0x34')]=_0x565f4b['attributes']['length']?_0x565f4b[_0x5156('0x34')]:_0x4792af['model'];if(!_0x5f21c4[_0x5156('0x36')]['hasOwnProperty'](_0x5156('0x37'))){_0x565f4b[_0x5156('0x23')]=qs[_0x5156('0x23')](_0x5f21c4[_0x5156('0x36')][_0x5156('0x23')]);_0x565f4b[_0x5156('0x22')]=qs[_0x5156('0x22')](_0x5f21c4[_0x5156('0x36')]['offset']);}_0x565f4b[_0x5156('0x38')]=qs['sort'](_0x5f21c4[_0x5156('0x36')][_0x5156('0x39')]);_0x565f4b[_0x5156('0x3a')]=qs[_0x5156('0x32')](_[_0x5156('0x3b')](_0x5f21c4[_0x5156('0x36')],_0x4792af[_0x5156('0x32')]),_0x552a22);if(_0x5f21c4[_0x5156('0x36')][_0x5156('0x3c')]){_0x565f4b[_0x5156('0x3a')]=_[_0x5156('0x3d')](_0x565f4b[_0x5156('0x3a')],{'$or':_[_0x5156('0x2d')](_0x552a22,function(_0x12c83e){if(_0x12c83e['type']!=='VIRTUAL'){var _0x574d40={};_0x574d40[_0x12c83e['name']]={'$like':'%'+_0x5f21c4[_0x5156('0x36')][_0x5156('0x3c')]+'%'};return _0x574d40;}})});}_0x565f4b=_[_0x5156('0x3d')]({},_0x565f4b,_0x5f21c4[_0x5156('0x3e')]);var _0x53e25e={'where':_0x565f4b[_0x5156('0x3a')]};return db[_0x5156('0x3f')][_0x5156('0x25')](_0x53e25e)[_0x5156('0x16')](function(_0x363289){_0xafcd2['count']=_0x363289;if(_0x5f21c4['query'][_0x5156('0x40')]){_0x565f4b[_0x5156('0x41')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x565f4b);})[_0x5156('0x16')](function(_0x5793ba){_0xafcd2['rows']=_0x5793ba;return _0xafcd2;})[_0x5156('0x16')](respondWithFilteredResult(_0x297cb6,_0x565f4b))[_0x5156('0x1f')](handleError(_0x297cb6,null));};exports[_0x5156('0x42')]=function(_0x3ceda5,_0x332060){var _0x520877={'raw':!![],'where':{'id':_0x3ceda5[_0x5156('0x43')]['id']}},_0x8605ef={};_0x8605ef[_0x5156('0x30')]=_['keys'](db[_0x5156('0x3f')][_0x5156('0x44')]);_0x8605ef[_0x5156('0x36')]=_[_0x5156('0x31')](_0x3ceda5[_0x5156('0x36')]);_0x8605ef[_0x5156('0x32')]=_['intersection'](_0x8605ef[_0x5156('0x30')],_0x8605ef['query']);_0x520877['attributes']=_['intersection'](_0x8605ef['model'],qs['fields'](_0x3ceda5[_0x5156('0x36')][_0x5156('0x35')]));_0x520877[_0x5156('0x34')]=_0x520877[_0x5156('0x34')][_0x5156('0x45')]?_0x520877[_0x5156('0x34')]:_0x8605ef[_0x5156('0x30')];if(_0x3ceda5[_0x5156('0x36')][_0x5156('0x40')]){_0x520877['include']=[{'all':!![]}];}_0x520877=_['merge']({},_0x520877,_0x3ceda5[_0x5156('0x3e')]);return db['MailMessage'][_0x5156('0x46')](_0x520877)[_0x5156('0x16')](handleEntityNotFound(_0x332060,null))['then'](respondWithResult(_0x332060,null))['catch'](handleError(_0x332060,null));};exports[_0x5156('0x28')]=function(_0x1bcf20,_0x16906b){if(_0x1bcf20[_0x5156('0x47')]['id']){delete _0x1bcf20['body']['id'];}return db['MailMessage'][_0x5156('0x46')]({'where':{'id':_0x1bcf20[_0x5156('0x43')]['id']}})['then'](handleEntityNotFound(_0x16906b,null))[_0x5156('0x16')](saveUpdates(_0x1bcf20[_0x5156('0x47')],null))[_0x5156('0x16')](respondWithResult(_0x16906b,null))[_0x5156('0x1f')](handleError(_0x16906b,null));};exports['destroy']=function(_0x410b39,_0x4a4e05){return db['MailMessage'][_0x5156('0x46')]({'where':{'id':_0x410b39[_0x5156('0x43')]['id']}})[_0x5156('0x16')](handleEntityNotFound(_0x4a4e05,null))[_0x5156('0x16')](removeEntity(_0x4a4e05,null))[_0x5156('0x1f')](handleError(_0x4a4e05,null));};exports[_0x5156('0x48')]=function(_0x2c85b7,_0x1359be){return db['MailMessage'][_0x5156('0x48')]()[_0x5156('0x16')](respondWithResult(_0x1359be,null))[_0x5156('0x1f')](handleError(_0x1359be,null));};exports[_0x5156('0x49')]=function(_0x590c2a,_0x5bbcda){return db[_0x5156('0x3f')][_0x5156('0x49')](_0x590c2a[_0x5156('0x47')])[_0x5156('0x16')](function(_0x831865){if(_0x831865){if(_0x831865[_0x5156('0x4a')]==='out'&&!_0x831865[_0x5156('0x4b')]){var _0x396d20,_0x55749f,_0xffad42;if(_0x590c2a[_0x5156('0x47')]['to']){_0x55749f=_0x590c2a[_0x5156('0x47')]['to'][_0x5156('0x4c')](',')[0x0];}return db[_0x5156('0x4d')]['findOne']({'where':{'id':_0x831865[_0x5156('0x4e')]},'include':[{'model':db[_0x5156('0x4f')],'as':_0x5156('0x50'),'include':[{'model':db[_0x5156('0x51')],'as':_0x5156('0x52'),'where':{'email':_0x55749f},'limit':0x1,'order':[[_0x5156('0x53'),_0x5156('0x54')]]}]},{'model':db[_0x5156('0x55')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x5156('0x16')](function(_0x276d5e){_0x396d20=_0x276d5e;if(!_0x396d20||!_0x396d20[_0x5156('0x56')])return;var _0x249773=_0x396d20['getSmtpOptions']();if(_0x590c2a[_0x5156('0x47')][_0x5156('0x57')]&&_0x590c2a[_0x5156('0x47')][_0x5156('0x57')][_0x5156('0x45')]){for(var _0x34ffff=0x0;_0x34ffff<_0x590c2a[_0x5156('0x47')]['attachments'][_0x5156('0x45')];_0x34ffff+=0x1){_0x590c2a[_0x5156('0x47')][_0x5156('0x57')][_0x34ffff]={'filename':_0x590c2a[_0x5156('0x47')]['attachments'][_0x34ffff][_0x5156('0x2c')],'path':path['join'](config[_0x5156('0x58')],'server/files/attachments',_0x590c2a['body']['attachments'][_0x34ffff]['basename'])};}}_0xffad42={'account':_0x249773,'message':_0x590c2a['body']};return;})[_0x5156('0x16')](function(){if(_0x396d20['List']){if(_0x396d20[_0x5156('0x50')][_0x5156('0x52')][_0x5156('0x45')]){return _0x396d20[_0x5156('0x50')][_0x5156('0x52')][0x0];}else{return db[_0x5156('0x51')][_0x5156('0x49')](_[_0x5156('0x59')](_0x590c2a[_0x5156('0x47')],{'firstName':_0x590c2a[_0x5156('0x47')]['to'],'email':_0x590c2a[_0x5156('0x47')]['to'],'phone':_0x590c2a[_0x5156('0x47')]['to'],'ListId':_0x396d20[_0x5156('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x5156('0x16')](function(){if(_0xffad42){return respondWithRpcPromise(_0x5156('0x5b'),'sendMail',_0xffad42,client9003)[_0x5156('0x16')](function(_0x6ee623){return _0x831865[_0x5156('0x28')]({'read':!![],'messageId':_0x6ee623[_0x5156('0x5c')],'sentAt':moment()[_0x5156('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x5156('0x1f')](function(_0x5e1679){logger[_0x5156('0x1a')]('%s',JSON[_0x5156('0x5e')](_0x5e1679));return _0x831865;});}return _0x831865;});}return _0x831865;}})[_0x5156('0x16')](respondWithResult(_0x5bbcda,0xc9))['catch'](handleError(_0x5bbcda,null));};exports[_0x5156('0x5f')]=function(_0x246dd6,_0x56fdca){var _0x41c290={'agent':{},'channel':_0x5156('0x60')};if(_0x246dd6[_0x5156('0x47')]['id']){delete _0x246dd6[_0x5156('0x47')]['id'];}_0x246dd6[_0x5156('0x47')][_0x5156('0x61')]=!![];_0x246dd6[_0x5156('0x47')][_0x5156('0x62')]=moment()[_0x5156('0x5d')](_0x5156('0x63'));_0x246dd6[_0x5156('0x47')][_0x5156('0x64')]=_0x246dd6[_0x5156('0x47')][_0x5156('0x64')]||_0x246dd6[_0x5156('0x65')]['id'];_0x41c290[_0x5156('0x66')]['id']=_0x246dd6['body'][_0x5156('0x64')];return db[_0x5156('0x3f')][_0x5156('0x46')]({'where':{'id':_0x246dd6[_0x5156('0x43')]['id'],'UserId':null}})[_0x5156('0x16')](handleEntityNotFound(_0x56fdca,null))[_0x5156('0x16')](saveUpdates(_0x246dd6[_0x5156('0x47')],null))[_0x5156('0x16')](function(_0x3bac33){if(_0x3bac33){_0x41c290[_0x5156('0x1d')]=_0x3bac33[_0x5156('0x67')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x3bac33['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x56fdca,null))[_0x5156('0x16')](function(_0x17b72e){if(_0x17b72e){return _0x17b72e[_0x5156('0x28')]({'UserId':_0x246dd6[_0x5156('0x47')]['UserId'],'read1stAt':_[_0x5156('0x68')](_0x17b72e[_0x5156('0x69')])?moment()['format'](_0x5156('0x63')):undefined});}return null;})[_0x5156('0x16')](function(_0x3e5db6){if(_0x3e5db6){_0x41c290['interaction']=_0x3e5db6['get']({'plain':!![]});interaction_log['info'](_0x5156('0x6a'),_0x246dd6[_0x5156('0x65')]['id'],_0x246dd6[_0x5156('0x65')][_0x5156('0x2c')],_0x246dd6['user'][_0x5156('0x6b')],_0x41c290[_0x5156('0x6c')]['id'],_0x246dd6[_0x5156('0x47')]?JSON[_0x5156('0x5e')](_0x246dd6[_0x5156('0x47')]):_0x5156('0x6d'));return respondWithRpcPromise(_0x5156('0x6e'),_0x5156('0x6f'),_0x41c290);}return null;})[_0x5156('0x16')](function(_0x5ec4c3){var _0xe1178c=_0x5156('0x70')+_0x5ec4c3[_0x5156('0x1d')][_0x5156('0x71')];return db[_0x5156('0x72')][_0x5156('0x36')](_0xe1178c,{'type':db[_0x5156('0x73')]['QueryTypes'][_0x5156('0x74')],'raw':!![]})[_0x5156('0x16')](function(_0x11f424){return _0x11f424;});})[_0x5156('0x16')](function(_0x1b74e4){if(_0x1b74e4){_0x41c290[_0x5156('0x1d')][_0x5156('0x75')]=_0x1b74e4[0x0];if(!_0x246dd6[_0x5156('0x47')]['UserId'])return;return db[_0x5156('0x76')][_0x5156('0x46')]({'where':{'id':_0x246dd6[_0x5156('0x47')]['UserId'],'role':_0x5156('0x66')},'attributes':['id',_0x5156('0x2c'),_0x5156('0x77'),_0x5156('0x78'),'internal'],'raw':!![]});}return null;})[_0x5156('0x16')](function(_0x1e5faa){if(!_0x1e5faa)return null;_0x41c290[_0x5156('0x1d')][_0x5156('0x66')]=_0x1e5faa;return _0x41c290;})[_0x5156('0x16')](function(_0x3254da){if(_0x3254da){if(_0x246dd6[_0x5156('0x47')][_0x5156('0x79')]){_0x41c290['message'][_0x5156('0x7a')]=util[_0x5156('0x5d')](_0x5156('0x7b'),_0x246dd6[_0x5156('0x65')]['name']);_0x41c290['message'][_0x5156('0x7c')]=_0x41c290[_0x5156('0x7c')];_0x41c290[_0x5156('0x1d')][_0x5156('0x7d')]=_0x41c290[_0x5156('0x7c')];_0x41c290['message'][_0x5156('0x7e')]='accept';_0x41c290[_0x5156('0x1d')][_0x5156('0x47')]=htmlToText[_0x5156('0x7f')](_0x41c290[_0x5156('0x1d')][_0x5156('0x47')]);return respondWithRpcPromise(_0x5156('0x80'),_0x5156('0x80'),{'event':_0x5156('0x81'),'message':_0x41c290[_0x5156('0x1d')]},client9002)['then'](function(){return _0x41c290;});}return _0x41c290;}return null;})[_0x5156('0x16')](respondWithResult(_0x56fdca,null))[_0x5156('0x1f')](handleError(_0x56fdca,null));};exports[_0x5156('0x82')]=function(_0x4df884,_0x2bff16){var _0x27925f={'agent':{},'channel':'mail'};if(_0x4df884['body']['id']){delete _0x4df884[_0x5156('0x47')]['id'];}_0x4df884[_0x5156('0x47')][_0x5156('0x64')]=_0x4df884[_0x5156('0x47')]['UserId']||_0x4df884['user']['id'];_0x27925f[_0x5156('0x66')]['id']=_0x4df884[_0x5156('0x47')][_0x5156('0x64')];return db['MailMessage']['find']({'where':{'id':_0x4df884[_0x5156('0x43')]['id'],'UserId':null}})[_0x5156('0x16')](handleEntityNotFound(_0x2bff16,null))[_0x5156('0x16')](function(_0x351d){if(_0x351d){_0x27925f[_0x5156('0x1d')]=_0x351d[_0x5156('0x67')]({'plain':!![]});return db[_0x5156('0x83')][_0x5156('0x46')]({'where':{'id':_0x351d[_0x5156('0x84')]}});}return null;})[_0x5156('0x16')](handleEntityNotFound(_0x2bff16,null))['then'](function(_0x5abf65){if(_0x5abf65){_0x27925f[_0x5156('0x6c')]=_0x5abf65['get']({'plain':!![]});interaction_log[_0x5156('0x17')](_0x5156('0x85'),_0x4df884[_0x5156('0x65')]['id'],_0x4df884[_0x5156('0x65')][_0x5156('0x2c')],_0x4df884[_0x5156('0x65')][_0x5156('0x6b')],_0x27925f['interaction']['id'],_0x4df884[_0x5156('0x47')]?JSON[_0x5156('0x5e')](_0x4df884[_0x5156('0x47')]):_0x5156('0x6d'));return respondWithRpcPromise(_0x5156('0x86'),_0x5156('0x87'),_0x27925f);}return null;})[_0x5156('0x16')](function(_0x1fb1dc){var _0x329594=_0x5156('0x70')+_0x1fb1dc[_0x5156('0x1d')][_0x5156('0x71')];return db[_0x5156('0x72')]['query'](_0x329594,{'type':db['Sequelize'][_0x5156('0x88')]['SELECT'],'raw':!![]})[_0x5156('0x16')](function(_0x3b6c38){return _0x3b6c38;});})[_0x5156('0x16')](function(_0x1b3316){if(_0x1b3316){_0x27925f[_0x5156('0x1d')][_0x5156('0x75')]=_0x1b3316[0x0];if(!_0x4df884[_0x5156('0x47')][_0x5156('0x64')])return;return db[_0x5156('0x76')][_0x5156('0x46')]({'where':{'id':_0x4df884[_0x5156('0x47')]['UserId'],'role':_0x5156('0x66')},'attributes':['id',_0x5156('0x2c'),_0x5156('0x77'),_0x5156('0x78'),_0x5156('0x89')],'raw':!![]});}return null;})[_0x5156('0x16')](function(_0x254b86){if(!_0x254b86)return null;_0x27925f[_0x5156('0x1d')][_0x5156('0x66')]=_0x254b86;return _0x27925f;})[_0x5156('0x16')](function(_0x13bf00){if(_0x13bf00){_0x13bf00[_0x5156('0x1d')][_0x5156('0x7a')]=util[_0x5156('0x5d')](_0x5156('0x7b'),_0x4df884[_0x5156('0x65')][_0x5156('0x2c')]);_0x13bf00[_0x5156('0x1d')][_0x5156('0x7c')]=_0x27925f[_0x5156('0x7c')];_0x13bf00['message'][_0x5156('0x7d')]=_0x27925f['channel'];_0x13bf00[_0x5156('0x1d')][_0x5156('0x7e')]=_0x5156('0x82');_0x13bf00[_0x5156('0x1d')]['body']=htmlToText['fromString'](_0x27925f[_0x5156('0x1d')][_0x5156('0x47')]);respondWithRpcPromise('EventManager',_0x5156('0x80'),{'event':_0x5156('0x8a'),'message':_0x13bf00[_0x5156('0x1d')]},client9002);return _0x27925f;}return null;})[_0x5156('0x16')](respondWithResult(_0x2bff16,null))['catch'](handleError(_0x2bff16,null));};exports[_0x5156('0x8b')]=function(_0x29632f,_0x2c92f5){var _0x2363e0=moment()[_0x5156('0x8c')]()[_0x5156('0x8d')]();var _0x3129fd=path['join'](config[_0x5156('0x58')],_0x5156('0x8e'),_0x5156('0x8f'),_0x5156('0x90'));var _0x31b8df=path['join'](config[_0x5156('0x58')],_0x5156('0x8e'),_0x5156('0x8f'),_0x5156('0x57'));var _0x42c74a=util[_0x5156('0x5d')](_0x5156('0x91'),_0x2363e0);return db[_0x5156('0x3f')]['find']({'where':{'id':_0x29632f['params']['id']},'attributes':['id','body',_0x5156('0x92'),'to','cc',_0x5156('0x93'),_0x5156('0x94'),_0x5156('0x95')],'include':_0x29632f[_0x5156('0x36')][_0x5156('0x57')]?[{'model':db[_0x5156('0x96')],'as':_0x5156('0x97')}]:undefined})[_0x5156('0x16')](handleEntityNotFound(_0x2c92f5,null))['then'](function(_0x5534da){if(_0x5534da){var _0x24e912=_0x5534da;var _0x3967b4={'from':_0x24e912[_0x5156('0x92')],'to':_0x24e912['to'],'subject':_0x24e912[_0x5156('0x94')],'html':htmlEntities[_0x5156('0x98')](_0x24e912[_0x5156('0x47')]),'headers':{'Date':moment(_0x24e912[_0x5156('0x95')])[_0x5156('0x5d')](_0x5156('0x99'))},'attachments':[]};if(_0x5534da['cc']){_0x3967b4[_0x5156('0x9a')]['Cc']=_0x5534da['cc'];}if(_0x5534da[_0x5156('0x93')]){_0x3967b4[_0x5156('0x9a')]['Bcc']=_0x5534da[_0x5156('0x93')];}return new BPromise(function(_0x15a0d8,_0x4ea1d7){if(_0x5534da[_0x5156('0x97')]){for(var _0x3f6f27=0x0;_0x3f6f27<_0x5534da[_0x5156('0x97')][_0x5156('0x45')];_0x3f6f27++){var _0x121fc7=_0x5534da[_0x5156('0x97')][_0x3f6f27];var _0x4a48d6=path['join'](_0x31b8df,_0x121fc7['basename']);if(fs[_0x5156('0x9b')](_0x4a48d6)){_0x3967b4[_0x5156('0x57')][_0x5156('0x9c')]({'name':_0x121fc7[_0x5156('0x2c')],'contentType':_0x121fc7[_0x5156('0x2e')],'data':fs['readFileSync'](_0x4a48d6)});}}}emlformat['build'](_0x3967b4,function(_0x4e2c20,_0x2ae50b){if(_0x4e2c20)return _0x4ea1d7(_0x4e2c20);fs['writeFileSync'](path['join'](_0x3129fd,_0x42c74a),_0x2ae50b);return _0x15a0d8(_0x2ae50b);});});}})[_0x5156('0x16')](function(_0x225da7){if(_0x225da7){return _0x2c92f5['download'](path[_0x5156('0x9d')](_0x3129fd,_0x42c74a),_0x42c74a,function(_0x350e1f){if(!_0x350e1f)fs[_0x5156('0x9e')](path['join'](_0x3129fd,_0x42c74a));});}})[_0x5156('0x1f')](handleError(_0x2c92f5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0a1c6b4..6d697df 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 _0xa1cb=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xa1cb,0x159));var _0xba1c=function(_0xe5cac7,_0x6c2f84){_0xe5cac7=_0xe5cac7-0x0;var _0x50df20=_0xa1cb[_0xe5cac7];return _0x50df20;};'use strict';var EventEmitter=require(_0xba1c('0x0'));var MailMessage=require(_0xba1c('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xba1c('0x2')](0x0);var events={'afterCreate':_0xba1c('0x3'),'afterUpdate':_0xba1c('0x4'),'afterDestroy':_0xba1c('0x5')};function emitEvent(_0x36003d){return function(_0x53e5c5,_0x272b60,_0x19d79a){MailMessageEvents[_0xba1c('0x6')](_0x36003d+':'+_0x53e5c5['id'],_0x53e5c5);MailMessageEvents['emit'](_0x36003d,_0x53e5c5);_0x19d79a(null);};}for(var e in events){if(events[_0xba1c('0x7')](e)){var event=events[e];MailMessage[_0xba1c('0x8')](e,emitEvent(event));}}module[_0xba1c('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x4c98=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x257385,_0x5e8325){var _0x42e4d6=function(_0x26199d){while(--_0x26199d){_0x257385['push'](_0x257385['shift']());}};_0x42e4d6(++_0x5e8325);}(_0x4c98,0xe2));var _0x84c9=function(_0x5e8363,_0x5a4f35){_0x5e8363=_0x5e8363-0x0;var _0x45bdc8=_0x4c98[_0x5e8363];return _0x45bdc8;};'use strict';var EventEmitter=require(_0x84c9('0x0'));var MailMessage=require(_0x84c9('0x1'))['db'][_0x84c9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x84c9('0x3')](0x0);var events={'afterCreate':_0x84c9('0x4'),'afterUpdate':_0x84c9('0x5'),'afterDestroy':_0x84c9('0x6')};function emitEvent(_0x576646){return function(_0x4e8753,_0x468434,_0x49e91c){MailMessageEvents[_0x84c9('0x7')](_0x576646+':'+_0x4e8753['id'],_0x4e8753);MailMessageEvents[_0x84c9('0x7')](_0x576646,_0x4e8753);_0x49e91c(null);};}for(var e in events){if(events[_0x84c9('0x8')](e)){var event=events[e];MailMessage[_0x84c9('0x9')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 4746cf9..0da5c49 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 _0x0a4a=['./mailMessage.attributes','exports','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','rimraf'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0a4a,0x121));var _0xa0a4=function(_0x2f30f8,_0x39b7ee){_0x2f30f8=_0x2f30f8-0x0;var _0x37b8d4=_0x0a4a[_0x2f30f8];return _0x37b8d4;};'use strict';var _=require(_0xa0a4('0x0'));var util=require(_0xa0a4('0x1'));var logger=require(_0xa0a4('0x2'))('api');var moment=require(_0xa0a4('0x3'));var BPromise=require(_0xa0a4('0x4'));var rp=require(_0xa0a4('0x5'));var htmlToText=require(_0xa0a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0a4('0x7'));var config=require('../../config/environment');var attributes=require(_0xa0a4('0x8'));module[_0xa0a4('0x9')]=function(_0x536dcc,_0x70e265){return _0x536dcc['define'](_0xa0a4('0xa'),attributes,{'tableName':_0xa0a4('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xa0a4('0xc'),'fields':[_0xa0a4('0xd'),_0xa0a4('0xe')],'type':_0xa0a4('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3754d8,_0x247bd4,_0x1125e1){if(_0x3754d8[_0xa0a4('0x10')]){_0x3754d8['plainBody']=htmlToText[_0xa0a4('0x11')](_0x3754d8[_0xa0a4('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1125e1(null,_0x247bd4);},'afterCreate':function(_0x496717,_0x143e63,_0x1d4ee5){var _0xf99848=_0x536dcc[_0xa0a4('0x12')];var _0x16d5ad=_0x496717[_0xa0a4('0x13')]({'plain':!![]});if(_0x16d5ad[_0xa0a4('0x14')][_0xa0a4('0x15')]()==='in'||_0x16d5ad[_0xa0a4('0x14')][_0xa0a4('0x15')]()===_0xa0a4('0x16')&&!_0x16d5ad[_0xa0a4('0x17')]&&!_[_0xa0a4('0x18')](_0x16d5ad['UserId'])){_0xf99848[_0xa0a4('0x19')]['findOne']({'where':{'id':_0x16d5ad[_0xa0a4('0x1a')]}})[_0xa0a4('0x1b')](function(_0x26fe3a){if(_0x26fe3a){_0x26fe3a[_0xa0a4('0x1c')]({'lastMsgAt':_0x16d5ad[_0xa0a4('0x1d')],'lastMsgDirection':_0x16d5ad[_0xa0a4('0x14')][_0xa0a4('0x15')]()});}})[_0xa0a4('0x1e')](function(_0xa34047){console[_0xa0a4('0x1f')](_0xa34047);});}_0x1d4ee5();}},'charset':_0xa0a4('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x12eb=['MailInteraction','findOne','MailInteractionId','then','update','direction','error','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','html-to-text','rimraf','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','toLowerCase','out','secret','isNil','UserId'];(function(_0xc809ea,_0x4c5604){var _0x1a12ed=function(_0x192976){while(--_0x192976){_0xc809ea['push'](_0xc809ea['shift']());}};_0x1a12ed(++_0x4c5604);}(_0x12eb,0xd3));var _0xb12e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x12eb[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xb12e('0x0'));var util=require(_0xb12e('0x1'));var logger=require(_0xb12e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb12e('0x3'));var rp=require(_0xb12e('0x4'));var htmlToText=require(_0xb12e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb12e('0x6'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module['exports']=function(_0x3950c1,_0x112338){return _0x3950c1[_0xb12e('0x7')](_0xb12e('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xb12e('0x9'),'fields':[_0xb12e('0x9')]},{'name':_0xb12e('0xa'),'fields':[_0xb12e('0xb'),_0xb12e('0xc')],'type':_0xb12e('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2720a0,_0x23db12,_0x187bee){if(_0x2720a0['body']){_0x2720a0[_0xb12e('0xb')]=htmlToText[_0xb12e('0xe')](_0x2720a0['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x187bee(null,_0x23db12);},'afterCreate':function(_0x32ed78,_0x198ea9,_0x32d54e){var _0x40d578=_0x3950c1[_0xb12e('0xf')];var _0x3037f9=_0x32ed78['get']({'plain':!![]});if(_0x3037f9['direction'][_0xb12e('0x10')]()==='in'||_0x3037f9['direction'][_0xb12e('0x10')]()===_0xb12e('0x11')&&!_0x3037f9[_0xb12e('0x12')]&&!_[_0xb12e('0x13')](_0x3037f9[_0xb12e('0x14')])){_0x40d578[_0xb12e('0x15')][_0xb12e('0x16')]({'where':{'id':_0x3037f9[_0xb12e('0x17')]}})[_0xb12e('0x18')](function(_0x43ecb){if(_0x43ecb){_0x43ecb[_0xb12e('0x19')]({'lastMsgAt':_0x3037f9['createdAt'],'lastMsgDirection':_0x3037f9[_0xb12e('0x1a')][_0xb12e('0x10')]()});}})['catch'](function(_0x5d4273){console[_0xb12e('0x1b')](_0x5d4273);});}_0x32d54e();}},'charset':_0xb12e('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index ecf21b5..1a5f5db 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 _0x6343=['jayson/promise','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','moment','bluebird','../../config/logger','rpc'];(function(_0x170f8b,_0x575b2c){var _0x51cef4=function(_0x17a607){while(--_0x17a607){_0x170f8b['push'](_0x170f8b['shift']());}};_0x51cef4(++_0x575b2c);}(_0x6343,0x168));var _0x3634=function(_0x52923e,_0x30caac){_0x52923e=_0x52923e-0x0;var _0x1e6fb2=_0x6343[_0x52923e];return _0x1e6fb2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));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(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});config[_0x3634('0x6')]=_[_0x3634('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3634('0x8'))(new Redis(config[_0x3634('0x6')]));require(_0x3634('0x9'))[_0x3634('0xa')](socket);function respondWithRpcPromise(_0x2e8e8b,_0x43f681,_0x5e907a){return new BPromise(function(_0x4b965a,_0x31bcfc){return client[_0x3634('0xb')](_0x2e8e8b,_0x5e907a)['then'](function(_0x2bb4db){logger[_0x3634('0xc')](_0x3634('0xd'),_0x43f681,_0x3634('0xe'));logger[_0x3634('0xf')](_0x3634('0x10'),_0x43f681,_0x3634('0xe'),JSON[_0x3634('0x11')](_0x2bb4db));if(_0x2bb4db[_0x3634('0x12')]){if(_0x2bb4db[_0x3634('0x12')][_0x3634('0x13')]===0x1f4){logger[_0x3634('0x12')](_0x3634('0xd'),_0x43f681,_0x2bb4db[_0x3634('0x12')]['message']);return _0x31bcfc(_0x2bb4db[_0x3634('0x12')]['message']);}logger[_0x3634('0x12')](_0x3634('0xd'),_0x43f681,_0x2bb4db[_0x3634('0x12')][_0x3634('0x14')]);return _0x4b965a(_0x2bb4db[_0x3634('0x12')]['message']);}else{logger[_0x3634('0xc')]('MailMessage,\x20%s,\x20%s',_0x43f681,'request\x20sent');_0x4b965a(_0x2bb4db[_0x3634('0x15')]['message']);}})[_0x3634('0x16')](function(_0x32e3c6){logger[_0x3634('0x12')]('MailMessage,\x20%s,\x20%s',_0x43f681,_0x32e3c6);_0x31bcfc(_0x32e3c6);});});}exports[_0x3634('0x17')]=function(_0x4366bc){var _0x577a6c=this;return new Promise(function(_0xeb9231,_0x506281){return db[_0x3634('0x18')][_0x3634('0x19')](_0x4366bc['body'],{'raw':_0x4366bc[_0x3634('0x1a')]?_0x4366bc[_0x3634('0x1a')][_0x3634('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x22b7ef){logger[_0x3634('0xc')]('CreateMailMessage',_0x4366bc);logger[_0x3634('0xf')]('CreateMailMessage',_0x4366bc,JSON['stringify'](_0x22b7ef));_0xeb9231(_0x22b7ef);})[_0x3634('0x16')](function(_0x862ab5){logger['error'](_0x3634('0x17'),_0x862ab5[_0x3634('0x14')],_0x4366bc);_0x506281(_0x577a6c[_0x3634('0x12')](0x1f4,_0x862ab5[_0x3634('0x14')]));});});}; \ No newline at end of file +var _0xb78e=['http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x13f472,_0x4923e0){var _0x48ee5d=function(_0x279268){while(--_0x279268){_0x13f472['push'](_0x13f472['shift']());}};_0x48ee5d(++_0x4923e0);}(_0xb78e,0x1c9));var _0xeb78=function(_0x4d7aa0,_0x3ecdcc){_0x4d7aa0=_0x4d7aa0-0x0;var _0x1fd681=_0xb78e[_0x4d7aa0];return _0x1fd681;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});config[_0xeb78('0xc')]=_[_0xeb78('0xd')](config[_0xeb78('0xc')],{'host':_0xeb78('0xe'),'port':0x18eb});var socket=require(_0xeb78('0xf'))(new Redis(config['redis']));require(_0xeb78('0x10'))[_0xeb78('0x11')](socket);function respondWithRpcPromise(_0xa1ca82,_0x46fbad,_0x125e97){return new BPromise(function(_0x402680,_0x15137b){return client[_0xeb78('0x12')](_0xa1ca82,_0x125e97)[_0xeb78('0x13')](function(_0x59d8d8){logger[_0xeb78('0x14')](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));logger[_0xeb78('0x17')](_0xeb78('0x18'),_0x46fbad,_0xeb78('0x16'),JSON[_0xeb78('0x19')](_0x59d8d8));if(_0x59d8d8[_0xeb78('0x1a')]){if(_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1b')]===0x1f4){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x59d8d8[_0xeb78('0x1a')]['message']);return _0x15137b(_0x59d8d8['error']['message']);}logger[_0xeb78('0x1a')]('MailMessage,\x20%s,\x20%s',_0x46fbad,_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1c')]);return _0x402680(_0x59d8d8['error'][_0xeb78('0x1c')]);}else{logger['info'](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));_0x402680(_0x59d8d8['result'][_0xeb78('0x1c')]);}})[_0xeb78('0x1d')](function(_0x1cb338){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x1cb338);_0x15137b(_0x1cb338);});});}exports[_0xeb78('0x1e')]=function(_0x4ab933){var _0x48b106=this;return new Promise(function(_0x455e30,_0x106c5d){return db[_0xeb78('0x1f')][_0xeb78('0x20')](_0x4ab933[_0xeb78('0x21')],{'raw':_0x4ab933[_0xeb78('0x22')]?_0x4ab933[_0xeb78('0x22')][_0xeb78('0x23')]===undefined?!![]:![]:!![]})[_0xeb78('0x13')](function(_0x52b8c1){logger['info']('CreateMailMessage',_0x4ab933);logger['debug'](_0xeb78('0x1e'),_0x4ab933,JSON['stringify'](_0x52b8c1));_0x455e30(_0x52b8c1);})[_0xeb78('0x1d')](function(_0x1fbf2f){logger['error'](_0xeb78('0x1e'),_0x1fbf2f['message'],_0x4ab933);_0x106c5d(_0x48b106[_0xeb78('0x1a')](0x1f4,_0x1fbf2f[_0xeb78('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 0ed9afb..11a4e59 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 _0xbc8f=['update','removeListener','length','mailMessage:','save','remove'];(function(_0x177803,_0x383358){var _0x55b3f8=function(_0x13bc67){while(--_0x13bc67){_0x177803['push'](_0x177803['shift']());}};_0x55b3f8(++_0x383358);}(_0xbc8f,0x154));var _0xfbc8=function(_0x50d8d0,_0x240df4){_0x50d8d0=_0x50d8d0-0x0;var _0x526b6b=_0xbc8f[_0x50d8d0];return _0x526b6b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xfbc8('0x0'),_0xfbc8('0x1'),_0xfbc8('0x2')];function createListener(_0x5bb3c4,_0x227eb9){return function(_0x9b0650){_0x227eb9['emit'](_0x5bb3c4,_0x9b0650);};}function removeListener(_0x5525b5,_0x23b85a){return function(){MailMessageEvents[_0xfbc8('0x3')](_0x5525b5,_0x23b85a);};}exports['register']=function(_0x5079fe){for(var _0x23d40f=0x0,_0x5674a4=events[_0xfbc8('0x4')];_0x23d40f<_0x5674a4;_0x23d40f++){var _0x5d1cba=events[_0x23d40f];var _0x2241d7=createListener(_0xfbc8('0x5')+_0x5d1cba,_0x5079fe);MailMessageEvents['on'](_0x5d1cba,_0x2241d7);}}; \ No newline at end of file +var _0xc6e6=['register','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x1e0511,_0x52d6eb){var _0x1a72bd=function(_0x406995){while(--_0x406995){_0x1e0511['push'](_0x1e0511['shift']());}};_0x1a72bd(++_0x52d6eb);}(_0xc6e6,0xc2));var _0x6c6e=function(_0x5c135a,_0x49a7cd){_0x5c135a=_0x5c135a-0x0;var _0x36256f=_0xc6e6[_0x5c135a];return _0x36256f;};'use strict';var MailMessageEvents=require(_0x6c6e('0x0'));var events=[_0x6c6e('0x1'),_0x6c6e('0x2'),_0x6c6e('0x3')];function createListener(_0x4aecc5,_0x6696d1){return function(_0x21ac13){_0x6696d1[_0x6c6e('0x4')](_0x4aecc5,_0x21ac13);};}function removeListener(_0x4922f2,_0x4cf985){return function(){MailMessageEvents[_0x6c6e('0x5')](_0x4922f2,_0x4cf985);};}exports[_0x6c6e('0x6')]=function(_0x4d2b66){for(var _0x32c759=0x0,_0x4e4082=events['length'];_0x32c759<_0x4e4082;_0x32c759++){var _0x5a49a5=events[_0x32c759];var _0x55f8dc=createListener(_0x6c6e('0x7')+_0x5a49a5,_0x4d2b66);MailMessageEvents['on'](_0x5a49a5,_0x55f8dc);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c3e1c98..f3da73f 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 _0xbc14=['fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','addAgents','delete','destroy','removeTeams','/:id/users','removeAgents','multer','path','connect-timeout','Router'];(function(_0x40a0a4,_0x4269e1){var _0x115c37=function(_0x22bbf0){while(--_0x22bbf0){_0x40a0a4['push'](_0x40a0a4['shift']());}};_0x115c37(++_0x4269e1);}(_0xbc14,0x130));var _0x4bc1=function(_0x21a1a6,_0x1474bf){_0x21a1a6=_0x21a1a6-0x0;var _0x5cec0e=_0xbc14[_0x21a1a6];return _0x5cec0e;};'use strict';var multer=require(_0x4bc1('0x0'));var util=require('util');var path=require(_0x4bc1('0x1'));var timeout=require(_0x4bc1('0x2'));var express=require('express');var router=express[_0x4bc1('0x3')]();var fs_extra=require(_0x4bc1('0x4'));var auth=require(_0x4bc1('0x5'));var interaction=require(_0x4bc1('0x6'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4bc1('0x7')]);router[_0x4bc1('0x8')](_0x4bc1('0x9'),auth[_0x4bc1('0xa')](),controller[_0x4bc1('0xb')]);router[_0x4bc1('0x8')](_0x4bc1('0xc'),auth[_0x4bc1('0xa')](),controller[_0x4bc1('0xd')]);router['get'](_0x4bc1('0xe'),auth['isAuthenticated'](),controller[_0x4bc1('0xf')]);router[_0x4bc1('0x8')]('/:id/teams',auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x10')]);router[_0x4bc1('0x8')]('/:id/users',auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4bc1('0x12')]);router[_0x4bc1('0x13')](_0x4bc1('0x14'),auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x15')]);router['post']('/:id/users',auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x16')]);router['put'](_0x4bc1('0xc'),auth[_0x4bc1('0xa')](),controller['update']);router[_0x4bc1('0x17')](_0x4bc1('0xc'),auth['isAuthenticated'](),controller[_0x4bc1('0x18')]);router[_0x4bc1('0x17')](_0x4bc1('0x14'),auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x19')]);router[_0x4bc1('0x17')](_0x4bc1('0x1a'),auth[_0x4bc1('0xa')](),controller[_0x4bc1('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xef73=['../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra'];(function(_0x324c1d,_0x59e774){var _0x77503a=function(_0x10af5b){while(--_0x10af5b){_0x324c1d['push'](_0x324c1d['shift']());}};_0x77503a(++_0x59e774);}(_0xef73,0xa8));var _0x3ef7=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xef73[_0xf2f332];return _0x56cce3;};'use strict';var multer=require(_0x3ef7('0x0'));var util=require(_0x3ef7('0x1'));var path=require(_0x3ef7('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ef7('0x3'));var router=express[_0x3ef7('0x4')]();var fs_extra=require(_0x3ef7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ef7('0x6'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x8')]);router[_0x3ef7('0x9')](_0x3ef7('0xa'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0xb')]);router[_0x3ef7('0x9')](_0x3ef7('0xc'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0xd')]);router['get'](_0x3ef7('0xe'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0xf')]);router[_0x3ef7('0x9')](_0x3ef7('0x10'),auth[_0x3ef7('0x7')](),controller['getTeams']);router['get']('/:id/users',auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ef7('0x12')]);router[_0x3ef7('0x13')](_0x3ef7('0x10'),auth['isAuthenticated'](),controller[_0x3ef7('0x14')]);router[_0x3ef7('0x13')](_0x3ef7('0x15'),auth[_0x3ef7('0x7')](),controller['addAgents']);router[_0x3ef7('0x16')]('/:id',auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x17')]);router[_0x3ef7('0x18')](_0x3ef7('0xc'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x19')]);router[_0x3ef7('0x18')](_0x3ef7('0x10'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x1a')]);router[_0x3ef7('0x18')](_0x3ef7('0x15'),auth[_0x3ef7('0x7')](),controller[_0x3ef7('0x1b')]);module[_0x3ef7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index bb81a51..ffc1d84 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 _0x69f5=['sequelize','exports','STRING','rrmemory','beepall','roundrobin'];(function(_0x5cf5ca,_0x24b617){var _0x64b85a=function(_0x3943c1){while(--_0x3943c1){_0x5cf5ca['push'](_0x5cf5ca['shift']());}};_0x64b85a(++_0x24b617);}(_0x69f5,0x84));var _0x569f=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x69f5[_0xdbd4f7];return _0x5c3f9d;};'use strict';var Sequelize=require(_0x569f('0x0'));module[_0x569f('0x1')]={'name':{'type':Sequelize[_0x569f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x569f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x569f('0x3'),_0x569f('0x4'),_0x569f('0x5'))}}; \ No newline at end of file +var _0x0dff=['ENUM','rrmemory','roundrobin','sequelize','name','STRING'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0dff,0x1ef));var _0xf0df=function(_0x167374,_0x3d3f6a){_0x167374=_0x167374-0x0;var _0x27e970=_0x0dff[_0x167374];return _0x27e970;};'use strict';var Sequelize=require(_0xf0df('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf0df('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf0df('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf0df('0x3')](_0xf0df('0x4'),'beepall',_0xf0df('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 569012e..264d18d 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 _0xb9a0=['end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','nolimit','order','where','pick','filter','merge','options','MailQueue','includeAll','rows','catch','show','keys','intersection','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','MailQueueId','findAll','User','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','forEach','emit','userMailQueue:save','removeTeams','Team','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status'];(function(_0x53753e,_0x5c46b2){var _0x1c0c62=function(_0x149915){while(--_0x149915){_0x53753e['push'](_0x53753e['shift']());}};_0x1c0c62(++_0x5c46b2);}(_0xb9a0,0x186));var _0x0b9a=function(_0x396ead,_0x2b4d16){_0x396ead=_0x396ead-0x0;var _0x4a55a1=_0xb9a0[_0x396ead];return _0x4a55a1;};'use strict';var emlformat=require(_0x0b9a('0x0'));var rimraf=require(_0x0b9a('0x1'));var zipdir=require(_0x0b9a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b9a('0x3'));var moment=require(_0x0b9a('0x4'));var BPromise=require(_0x0b9a('0x5'));var Mustache=require(_0x0b9a('0x6'));var util=require(_0x0b9a('0x7'));var path=require(_0x0b9a('0x8'));var sox=require(_0x0b9a('0x9'));var csv=require('to-csv');var ejs=require(_0x0b9a('0xa'));var fs=require('fs');var fs_extra=require(_0x0b9a('0xb'));var _=require(_0x0b9a('0xc'));var squel=require(_0x0b9a('0xd'));var crypto=require(_0x0b9a('0xe'));var jsforce=require(_0x0b9a('0xf'));var deskjs=require(_0x0b9a('0x10'));var toCsv=require(_0x0b9a('0x11'));var querystring=require(_0x0b9a('0x12'));var Papa=require(_0x0b9a('0x13'));var Redis=require(_0x0b9a('0x14'));var authService=require(_0x0b9a('0x15'));var qs=require(_0x0b9a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b9a('0x17'));var logger=require('../../config/logger')(_0x0b9a('0x18'));var utils=require('../../config/utils');var config=require(_0x0b9a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0b9a('0x1a')]=_[_0x0b9a('0x1b')](config[_0x0b9a('0x1a')],{'host':_0x0b9a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b9a('0x1a')]));require(_0x0b9a('0x1d'))[_0x0b9a('0x1e')](socket);function respondWithStatusCode(_0x31adef,_0x1de36d){_0x1de36d=_0x1de36d||0xcc;return function(_0xcdef1c){if(_0xcdef1c){return _0x31adef[_0x0b9a('0x1f')](_0x1de36d);}return _0x31adef[_0x0b9a('0x20')](_0x1de36d)[_0x0b9a('0x21')]();};}function respondWithResult(_0x17dda7,_0x1b8380){_0x1b8380=_0x1b8380||0xc8;return function(_0x4fef3f){if(_0x4fef3f){return _0x17dda7[_0x0b9a('0x20')](_0x1b8380)[_0x0b9a('0x22')](_0x4fef3f);}};}function respondWithFilteredResult(_0xcaa5d0,_0x5f102b){return function(_0x3fb823){if(_0x3fb823){var _0x5f0fd9=typeof _0x5f102b['offset']===_0x0b9a('0x23')&&typeof _0x5f102b[_0x0b9a('0x24')]===_0x0b9a('0x23');var _0x3a2268=_0x3fb823[_0x0b9a('0x25')];var _0x180bdb=_0x5f0fd9?0x0:_0x5f102b[_0x0b9a('0x26')];var _0x1a2cd5=_0x5f0fd9?_0x3fb823['count']:_0x5f102b['offset']+_0x5f102b[_0x0b9a('0x24')];var _0x53b526;if(_0x1a2cd5>=_0x3a2268){_0x1a2cd5=_0x3a2268;_0x53b526=0xc8;}else{_0x53b526=0xce;}_0xcaa5d0[_0x0b9a('0x20')](_0x53b526);return _0xcaa5d0[_0x0b9a('0x27')](_0x0b9a('0x28'),_0x180bdb+'-'+_0x1a2cd5+'/'+_0x3a2268)[_0x0b9a('0x22')](_0x3fb823);}return null;};}function patchUpdates(_0x362b65){return function(_0xdb6a0b){try{jsonpatch[_0x0b9a('0x29')](_0xdb6a0b,_0x362b65,!![]);}catch(_0x1ae8d5){return BPromise['reject'](_0x1ae8d5);}return _0xdb6a0b[_0x0b9a('0x2a')]();};}function saveUpdates(_0xa5dd9e,_0x2b37dd){return function(_0x1f29ac){if(_0x1f29ac){return _0x1f29ac[_0x0b9a('0x2b')](_0xa5dd9e)[_0x0b9a('0x2c')](function(_0x535e40){return _0x535e40;});}return null;};}function removeEntity(_0x13eb99,_0x538287){return function(_0x4964b9){if(_0x4964b9){return _0x4964b9[_0x0b9a('0x2d')]()['then'](function(){var _0x2cca68=_0x4964b9[_0x0b9a('0x2e')]({'plain':!![]});var _0xcfe793='MailQueues';return db[_0x0b9a('0x2f')][_0x0b9a('0x2d')]({'where':{'type':_0xcfe793,'resourceId':_0x2cca68['id']}})[_0x0b9a('0x2c')](function(){return _0x4964b9;});})[_0x0b9a('0x2c')](function(){_0x13eb99[_0x0b9a('0x20')](0xcc)[_0x0b9a('0x21')]();});}};}function handleEntityNotFound(_0x4bd629,_0x3bfe08){return function(_0x21ebae){if(!_0x21ebae){_0x4bd629[_0x0b9a('0x1f')](0x194);}return _0x21ebae;};}function handleError(_0x3eaa74,_0x2effcf){_0x2effcf=_0x2effcf||0x1f4;return function(_0x890d1d){logger['error'](_0x890d1d[_0x0b9a('0x30')]);if(_0x890d1d[_0x0b9a('0x31')]){delete _0x890d1d[_0x0b9a('0x31')];}_0x3eaa74['status'](_0x2effcf)['send'](_0x890d1d);};}exports[_0x0b9a('0x32')]=function(_0x494052,_0x316f96){var _0x4ca09c={},_0xf1e1ff={},_0x5cf4e3={'count':0x0,'rows':[]};var _0xe39e5c=_['map'](db['MailQueue'][_0x0b9a('0x33')],function(_0x330fd6){return{'name':_0x330fd6[_0x0b9a('0x34')],'type':_0x330fd6[_0x0b9a('0x35')][_0x0b9a('0x36')]};});_0xf1e1ff[_0x0b9a('0x37')]=_[_0x0b9a('0x38')](_0xe39e5c,'name');_0xf1e1ff[_0x0b9a('0x39')]=_['keys'](_0x494052['query']);_0xf1e1ff[_0x0b9a('0x3a')]=_['intersection'](_0xf1e1ff[_0x0b9a('0x37')],_0xf1e1ff[_0x0b9a('0x39')]);_0x4ca09c[_0x0b9a('0x3b')]=_['intersection'](_0xf1e1ff[_0x0b9a('0x37')],qs['fields'](_0x494052['query']['fields']));_0x4ca09c[_0x0b9a('0x3b')]=_0x4ca09c[_0x0b9a('0x3b')]['length']?_0x4ca09c[_0x0b9a('0x3b')]:_0xf1e1ff[_0x0b9a('0x37')];if(!_0x494052['query']['hasOwnProperty'](_0x0b9a('0x3c'))){_0x4ca09c[_0x0b9a('0x24')]=qs[_0x0b9a('0x24')](_0x494052['query'][_0x0b9a('0x24')]);_0x4ca09c[_0x0b9a('0x26')]=qs[_0x0b9a('0x26')](_0x494052[_0x0b9a('0x39')][_0x0b9a('0x26')]);}_0x4ca09c[_0x0b9a('0x3d')]=qs['sort'](_0x494052[_0x0b9a('0x39')]['sort']);_0x4ca09c[_0x0b9a('0x3e')]=qs['filters'](_[_0x0b9a('0x3f')](_0x494052['query'],_0xf1e1ff[_0x0b9a('0x3a')]),_0xe39e5c);if(_0x494052[_0x0b9a('0x39')][_0x0b9a('0x40')]){_0x4ca09c['where']=_[_0x0b9a('0x41')](_0x4ca09c[_0x0b9a('0x3e')],{'$or':_[_0x0b9a('0x38')](_0xe39e5c,function(_0xd4c6c){if(_0xd4c6c['type']!=='VIRTUAL'){var _0x365ac4={};_0x365ac4[_0xd4c6c['name']]={'$like':'%'+_0x494052[_0x0b9a('0x39')]['filter']+'%'};return _0x365ac4;}})});}_0x4ca09c=_[_0x0b9a('0x41')]({},_0x4ca09c,_0x494052[_0x0b9a('0x42')]);var _0x174e0d={'where':_0x4ca09c[_0x0b9a('0x3e')]};return db[_0x0b9a('0x43')][_0x0b9a('0x25')](_0x174e0d)[_0x0b9a('0x2c')](function(_0x420702){_0x5cf4e3['count']=_0x420702;if(_0x494052['query'][_0x0b9a('0x44')]){_0x4ca09c['include']=[{'all':!![]}];}return db[_0x0b9a('0x43')]['findAll'](_0x4ca09c);})[_0x0b9a('0x2c')](function(_0x47da96){_0x5cf4e3[_0x0b9a('0x45')]=_0x47da96;return _0x5cf4e3;})['then'](respondWithFilteredResult(_0x316f96,_0x4ca09c))[_0x0b9a('0x46')](handleError(_0x316f96,null));};exports[_0x0b9a('0x47')]=function(_0x5ac4c7,_0x3b3b2d){var _0x2a5295={'raw':!![],'where':{'id':_0x5ac4c7['params']['id']}},_0x3e6e97={};_0x3e6e97[_0x0b9a('0x37')]=_[_0x0b9a('0x48')](db[_0x0b9a('0x43')][_0x0b9a('0x33')]);_0x3e6e97[_0x0b9a('0x39')]=_[_0x0b9a('0x48')](_0x5ac4c7[_0x0b9a('0x39')]);_0x3e6e97[_0x0b9a('0x3a')]=_[_0x0b9a('0x49')](_0x3e6e97[_0x0b9a('0x37')],_0x3e6e97['query']);_0x2a5295['attributes']=_[_0x0b9a('0x49')](_0x3e6e97[_0x0b9a('0x37')],qs['fields'](_0x5ac4c7['query'][_0x0b9a('0x4a')]));_0x2a5295[_0x0b9a('0x3b')]=_0x2a5295[_0x0b9a('0x3b')][_0x0b9a('0x4b')]?_0x2a5295['attributes']:_0x3e6e97[_0x0b9a('0x37')];if(_0x5ac4c7[_0x0b9a('0x39')][_0x0b9a('0x44')]){_0x2a5295['include']=[{'all':!![]}];}_0x2a5295=_[_0x0b9a('0x41')]({},_0x2a5295,_0x5ac4c7[_0x0b9a('0x42')]);return db['MailQueue'][_0x0b9a('0x4c')](_0x2a5295)[_0x0b9a('0x2c')](handleEntityNotFound(_0x3b3b2d,null))[_0x0b9a('0x2c')](respondWithResult(_0x3b3b2d,null))[_0x0b9a('0x46')](handleError(_0x3b3b2d,null));};exports[_0x0b9a('0x4d')]=function(_0x2cc5cf,_0x271b4b){return db['MailQueue'][_0x0b9a('0x4d')](_0x2cc5cf[_0x0b9a('0x4e')],{})[_0x0b9a('0x2c')](function(_0x2e5760){var _0xa6ecf2=_0x2cc5cf[_0x0b9a('0x4f')][_0x0b9a('0x2e')]({'plain':!![]});if(!_0xa6ecf2)throw new Error(_0x0b9a('0x50'));if(_0xa6ecf2[_0x0b9a('0x51')]===_0x0b9a('0x4f')){var _0x37de41=_0x2e5760[_0x0b9a('0x2e')]({'plain':!![]});var _0x38d6c7='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0x38d6c7,'userProfileId':_0xa6ecf2[_0x0b9a('0x52')]},'raw':!![]})[_0x0b9a('0x2c')](function(_0x59b7ac){if(_0x59b7ac&&_0x59b7ac[_0x0b9a('0x53')]===0x0){return db[_0x0b9a('0x2f')]['create']({'name':_0x37de41['name'],'resourceId':_0x37de41['id'],'type':_0x59b7ac[_0x0b9a('0x31')],'sectionId':_0x59b7ac['id']},{})[_0x0b9a('0x2c')](function(){return _0x2e5760;});}else{return _0x2e5760;}})[_0x0b9a('0x46')](function(_0xeec42a){logger[_0x0b9a('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeec42a);throw _0xeec42a;});}return _0x2e5760;})[_0x0b9a('0x2c')](respondWithResult(_0x271b4b,0xc9))[_0x0b9a('0x46')](handleError(_0x271b4b,null));};exports['update']=function(_0x29ee0a,_0x545269){if(_0x29ee0a[_0x0b9a('0x4e')]['id']){delete _0x29ee0a['body']['id'];}return db[_0x0b9a('0x43')]['find']({'where':{'id':_0x29ee0a[_0x0b9a('0x55')]['id']}})[_0x0b9a('0x2c')](handleEntityNotFound(_0x545269,null))[_0x0b9a('0x2c')](saveUpdates(_0x29ee0a[_0x0b9a('0x4e')],null))[_0x0b9a('0x2c')](respondWithResult(_0x545269,null))[_0x0b9a('0x46')](handleError(_0x545269,null));};exports[_0x0b9a('0x2d')]=function(_0x2ad30a,_0x1640a4){return db[_0x0b9a('0x43')][_0x0b9a('0x4c')]({'where':{'id':_0x2ad30a[_0x0b9a('0x55')]['id']}})[_0x0b9a('0x2c')](handleEntityNotFound(_0x1640a4,null))['then'](removeEntity(_0x1640a4,null))['catch'](handleError(_0x1640a4,null));};exports[_0x0b9a('0x56')]=function(_0xcacdae,_0x260409){return db[_0x0b9a('0x43')][_0x0b9a('0x56')]()[_0x0b9a('0x2c')](respondWithResult(_0x260409,null))[_0x0b9a('0x46')](handleError(_0x260409,null));};exports[_0x0b9a('0x57')]=function(_0x505837,_0x42d9d3,_0x4f0504){var _0x5654a3={'raw':!![],'where':{}},_0x5e2266={},_0x590b29;return db[_0x0b9a('0x43')][_0x0b9a('0x58')]({'where':{'id':_0x505837['params']['id']}})[_0x0b9a('0x2c')](handleEntityNotFound(_0x42d9d3,null))[_0x0b9a('0x2c')](function(_0x2d282c){if(_0x2d282c){_0x590b29=_0x2d282c[_0x0b9a('0x2e')]({'plain':!![]});_0x5e2266[_0x0b9a('0x37')]=_['keys'](db[_0x0b9a('0x59')][_0x0b9a('0x33')]);_0x5e2266[_0x0b9a('0x39')]=_[_0x0b9a('0x48')](_0x505837[_0x0b9a('0x39')]);_0x5e2266[_0x0b9a('0x3a')]=_[_0x0b9a('0x49')](_0x5e2266[_0x0b9a('0x37')],_0x5e2266[_0x0b9a('0x39')]);_0x5654a3[_0x0b9a('0x3b')]=_[_0x0b9a('0x49')](_0x5e2266[_0x0b9a('0x37')],qs['fields'](_0x505837['query'][_0x0b9a('0x4a')]));_0x5654a3[_0x0b9a('0x3b')]=_0x5654a3[_0x0b9a('0x3b')][_0x0b9a('0x4b')]?_0x5654a3[_0x0b9a('0x3b')]:_0x5e2266[_0x0b9a('0x37')];if(!_0x505837[_0x0b9a('0x39')][_0x0b9a('0x5a')]('nolimit')){_0x5654a3[_0x0b9a('0x24')]=qs[_0x0b9a('0x24')](_0x505837[_0x0b9a('0x39')][_0x0b9a('0x24')]);_0x5654a3[_0x0b9a('0x26')]=qs[_0x0b9a('0x26')](_0x505837['query'][_0x0b9a('0x26')]);}_0x5654a3['order']=qs['sort'](_0x505837['query'][_0x0b9a('0x5b')]);_0x5654a3['where']=qs['filters'](_[_0x0b9a('0x3f')](_0x505837[_0x0b9a('0x39')],_0x5e2266[_0x0b9a('0x3a')]));_0x5654a3['where'][_0x0b9a('0x5c')]=_0x2d282c['id'];if(_0x505837[_0x0b9a('0x39')][_0x0b9a('0x40')]){_0x5654a3[_0x0b9a('0x3e')]=_[_0x0b9a('0x41')](_0x5654a3[_0x0b9a('0x3e')],{'$or':_[_0x0b9a('0x38')](_0x5654a3[_0x0b9a('0x3b')],function(_0x505e38){var _0x221cd1={};_0x221cd1[_0x505e38]={'$like':'%'+_0x505837[_0x0b9a('0x39')][_0x0b9a('0x40')]+'%'};return _0x221cd1;})});}_0x5654a3=_[_0x0b9a('0x41')]({},_0x5654a3,_0x505837[_0x0b9a('0x42')]);return db[_0x0b9a('0x59')][_0x0b9a('0x5d')](_0x5654a3);}})[_0x0b9a('0x2c')](function(_0x22500c){if(_0x22500c){return db[_0x0b9a('0x5e')]['findAndCountAll']({'where':{'id':_[_0x0b9a('0x38')](_0x22500c,_0x0b9a('0x5f')),'role':_0x0b9a('0x60')},'attributes':['id',_0x0b9a('0x31'),_0x0b9a('0x61'),'updatedAt',_0x0b9a('0x62')]});}})['then'](function(_0x4f23fd){if(_0x4f23fd){return{'count':_0x4f23fd[_0x0b9a('0x25')],'rows':_[_0x0b9a('0x38')](_0x4f23fd['rows'],function(_0x4265c7){return{'membername':_0x4265c7[_0x0b9a('0x31')],'UserId':_0x4265c7['id'],'queue_name':_0x590b29[_0x0b9a('0x31')],'MailQueueId':_0x590b29['id'],'interface':util[_0x0b9a('0x63')](_0x0b9a('0x64'),_0x0b9a('0x65'),_0x4265c7[_0x0b9a('0x31')]),'penalty':0x0,'paused':_0x4265c7[_0x0b9a('0x61')],'createdAt':_0x4265c7[_0x0b9a('0x62')],'updatedAt':_0x4265c7[_0x0b9a('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x42d9d3,_0x5654a3))['catch'](handleError(_0x42d9d3,null));};exports[_0x0b9a('0x67')]=function(_0x4e8f1a,_0x36f96a,_0x52f9bf){var _0x37c94f={};var _0x122e4a={};var _0xce8c16;var _0x4d7d79;return db['MailQueue'][_0x0b9a('0x58')]({'where':{'id':_0x4e8f1a[_0x0b9a('0x55')]['id']}})['then'](handleEntityNotFound(_0x36f96a,null))[_0x0b9a('0x2c')](function(_0xb5ae6e){if(_0xb5ae6e){_0xce8c16=_0xb5ae6e;_0x122e4a['model']=_[_0x0b9a('0x48')](db['Team'][_0x0b9a('0x33')]);_0x122e4a['query']=_[_0x0b9a('0x48')](_0x4e8f1a[_0x0b9a('0x39')]);_0x122e4a[_0x0b9a('0x3a')]=_[_0x0b9a('0x49')](_0x122e4a[_0x0b9a('0x37')],_0x122e4a[_0x0b9a('0x39')]);_0x37c94f['attributes']=_[_0x0b9a('0x49')](_0x122e4a[_0x0b9a('0x37')],qs[_0x0b9a('0x4a')](_0x4e8f1a['query']['fields']));_0x37c94f[_0x0b9a('0x3b')]=_0x37c94f[_0x0b9a('0x3b')][_0x0b9a('0x4b')]?_0x37c94f['attributes']:_0x122e4a[_0x0b9a('0x37')];_0x37c94f[_0x0b9a('0x3d')]=qs[_0x0b9a('0x5b')](_0x4e8f1a[_0x0b9a('0x39')][_0x0b9a('0x5b')]);_0x37c94f[_0x0b9a('0x3e')]=qs[_0x0b9a('0x3a')](_[_0x0b9a('0x3f')](_0x4e8f1a[_0x0b9a('0x39')],_0x122e4a[_0x0b9a('0x3a')]));if(_0x4e8f1a[_0x0b9a('0x39')][_0x0b9a('0x40')]){_0x37c94f[_0x0b9a('0x3e')]=_[_0x0b9a('0x41')](_0x37c94f[_0x0b9a('0x3e')],{'$or':_['map'](_0x37c94f[_0x0b9a('0x3b')],function(_0x52a0b2){var _0x2cc2b8={};_0x2cc2b8[_0x52a0b2]={'$like':'%'+_0x4e8f1a[_0x0b9a('0x39')]['filter']+'%'};return _0x2cc2b8;})});}_0x37c94f=_[_0x0b9a('0x41')]({},_0x37c94f,_0x4e8f1a['options']);return _0xce8c16[_0x0b9a('0x67')](_0x37c94f);}})[_0x0b9a('0x2c')](function(_0x340468){if(_0x340468){_0x4d7d79=_0x340468[_0x0b9a('0x4b')];if(!_0x4e8f1a[_0x0b9a('0x39')][_0x0b9a('0x5a')]('nolimit')){_0x37c94f[_0x0b9a('0x24')]=qs['limit'](_0x4e8f1a[_0x0b9a('0x39')][_0x0b9a('0x24')]);_0x37c94f[_0x0b9a('0x26')]=qs[_0x0b9a('0x26')](_0x4e8f1a[_0x0b9a('0x39')][_0x0b9a('0x26')]);}return _0xce8c16[_0x0b9a('0x67')](_0x37c94f);}})[_0x0b9a('0x2c')](function(_0x4d1936){if(_0x4d1936){return _0x4d1936?{'count':_0x4d7d79,'rows':_0x4d1936}:null;}})[_0x0b9a('0x2c')](respondWithResult(_0x36f96a,null))['catch'](handleError(_0x36f96a,null));};exports['addTeams']=function(_0x261b44,_0x485b02,_0xd71b96){var _0x2c03bc=_0x261b44[_0x0b9a('0x4e')][_0x0b9a('0x68')];return db['Team']['findAll']({'where':{'id':_0x2c03bc},'attributes':['id'],'include':[{'model':db[_0x0b9a('0x5e')],'as':_0x0b9a('0x69'),'attributes':['id',_0x0b9a('0x31'),_0x0b9a('0x6a'),_0x0b9a('0x6b'),'interface'],'raw':!![]}]})[_0x0b9a('0x2c')](function(_0x1c8305){if(_0x1c8305){var _0x4c4a98=_[_0x0b9a('0x6c')](_0x1c8305,function(_0x4b00e6){var _0x23885a=_0x4b00e6[_0x0b9a('0x2e')]({'plain':!![]});return _0x23885a[_0x0b9a('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x261b44[_0x0b9a('0x55')]['id']}})['then'](function(_0x4abf43){return db[_0x0b9a('0x6d')][_0x0b9a('0x6e')](function(_0x41d03f){return _0x4abf43[_0x0b9a('0x6f')](_0x2c03bc,{'transaction':_0x41d03f})['then'](function(){return BPromise['each'](_0x4c4a98,function(_0x2c5096){return db[_0x0b9a('0x59')]['findOrCreate']({'where':{'UserId':_0x2c5096['id'],'MailQueueId':_0x261b44[_0x0b9a('0x55')]['id']},'transaction':_0x41d03f});});})[_0x0b9a('0x2c')](function(){_0x4c4a98[_0x0b9a('0x70')](function(_0x2996a8){socket[_0x0b9a('0x71')](_0x0b9a('0x72'),{'UserId':_0x2996a8['id'],'MailQueueId':_0x4abf43['id']});});});});});}})['then'](respondWithStatusCode(_0x485b02,null))[_0x0b9a('0x46')](handleError(_0x485b02,null));};exports[_0x0b9a('0x73')]=function(_0x109494,_0x52586d,_0x486961){return db[_0x0b9a('0x74')][_0x0b9a('0x5d')]({'where':{'id':_0x109494[_0x0b9a('0x39')][_0x0b9a('0x68')]},'attributes':['id'],'include':[{'model':db[_0x0b9a('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x52586d,null))[_0x0b9a('0x2c')](function(_0x4d1e7a){var _0x1b6609=_['map'](_0x4d1e7a,'id');var _0x30b4c7=[];var _0x1fde61=[];var _0x1a9b66=squel['select']();_0x1a9b66['field'](_0x0b9a('0x75'))[_0x0b9a('0x76')](_0x0b9a('0x77'),'tq')[_0x0b9a('0x78')](_0x0b9a('0x79'),'ut',_0x0b9a('0x7a'))[_0x0b9a('0x3e')](_0x0b9a('0x7b'),_0x109494[_0x0b9a('0x55')]['id']);for(var _0x451aad=0x0;_0x451aad<_0x4d1e7a[_0x0b9a('0x4b')];_0x451aad+=0x1){let _0x23b9d8=_0x4d1e7a[_0x451aad];for(var _0x1be50=0x0;_0x1be50<_0x23b9d8[_0x0b9a('0x69')][_0x0b9a('0x4b')];_0x1be50+=0x1){let _0x72535c=_0x23b9d8[_0x0b9a('0x69')][_0x1be50];var _0xe1ce37=_0x1a9b66['clone']();_0xe1ce37[_0x0b9a('0x3e')]('ut.UserId\x20=\x20?',_0x72535c['id']);_0x1fde61['push'](db[_0x0b9a('0x6d')][_0x0b9a('0x39')](_0xe1ce37[_0x0b9a('0x7c')](),{'type':db[_0x0b9a('0x6d')][_0x0b9a('0x7d')][_0x0b9a('0x7e')]})[_0x0b9a('0x2c')](function(_0x24ff88){if(_0x24ff88[_0x0b9a('0x4b')]===0x1){return _0x72535c['id'];}else{var _0x2cf263=_[_0x0b9a('0x7f')](_[_0x0b9a('0x38')](_0x24ff88,'TeamId'),function(_0x4eeacc){return _[_0x0b9a('0x80')](_0x1b6609,_0x4eeacc);});if(_0x2cf263){return _0x72535c['id'];}}}));}}return BPromise[_0x0b9a('0x81')](_0x1fde61)[_0x0b9a('0x2c')](function(_0x10fc0d){_0x30b4c7=_(_0x30b4c7)[_0x0b9a('0x82')](_0x10fc0d)[_0x0b9a('0x83')]()[_0x0b9a('0x84')]();return db[_0x0b9a('0x43')][_0x0b9a('0x4c')]({'where':{'id':_0x109494['params']['id']}})[_0x0b9a('0x2c')](function(_0x442d80){return db[_0x0b9a('0x6d')]['transaction'](function(_0x4cb737){return _0x442d80[_0x0b9a('0x73')](_0x109494[_0x0b9a('0x39')]['ids'],{'transaction':_0x4cb737})[_0x0b9a('0x2c')](function(){if(!_[_0x0b9a('0x85')](_0x30b4c7)){return _0x442d80[_0x0b9a('0x86')](_0x30b4c7,{'transaction':_0x4cb737});}})['then'](function(){_0x30b4c7[_0x0b9a('0x70')](function(_0x34e1ad){socket[_0x0b9a('0x71')](_0x0b9a('0x87'),{'UserId':_0x34e1ad,'MailQueueId':_0x442d80['id']});});});});});});})[_0x0b9a('0x2c')](respondWithStatusCode(_0x52586d,null))[_0x0b9a('0x46')](handleError(_0x52586d,null));};exports[_0x0b9a('0x88')]=function(_0x4c8b9c,_0x4d2b28,_0x1435cc){return db[_0x0b9a('0x43')][_0x0b9a('0x4c')]({'where':{'id':_0x4c8b9c['params']['id']}})[_0x0b9a('0x2c')](handleEntityNotFound(_0x4d2b28,null))[_0x0b9a('0x2c')](function(_0x1a9415){if(_0x1a9415){return _0x1a9415['addAgents'](_0x4c8b9c[_0x0b9a('0x4e')]['ids'],_[_0x0b9a('0x89')](_0x4c8b9c[_0x0b9a('0x4e')],[_0x0b9a('0x68'),'id'])||{})[_0x0b9a('0x8a')](function(_0x5f3ada){for(var _0x306b7a=0x0;_0x306b7a<_0x4c8b9c['body'][_0x0b9a('0x68')][_0x0b9a('0x4b')];_0x306b7a+=0x1){socket[_0x0b9a('0x71')](_0x0b9a('0x72'),{'UserId':Number(_0x4c8b9c[_0x0b9a('0x4e')][_0x0b9a('0x68')][_0x306b7a]),'MailQueueId':Number(_0x4c8b9c[_0x0b9a('0x55')]['id'])});}return _0x5f3ada;});}})[_0x0b9a('0x2c')](respondWithResult(_0x4d2b28,null))[_0x0b9a('0x46')](handleError(_0x4d2b28,null));};exports[_0x0b9a('0x86')]=function(_0xae102a,_0xc2e8f7,_0x42bd97){return db[_0x0b9a('0x43')]['find']({'where':{'id':_0xae102a[_0x0b9a('0x55')]['id']}})['then'](handleEntityNotFound(_0xc2e8f7,null))['then'](function(_0x2fb66e){if(_0x2fb66e){return _0x2fb66e['removeAgents'](_0xae102a[_0x0b9a('0x39')][_0x0b9a('0x68')])[_0x0b9a('0x2c')](function(){if(_[_0x0b9a('0x8b')](_0xae102a['query'][_0x0b9a('0x68')])){for(var _0x344755=0x0;_0x344755<_0xae102a[_0x0b9a('0x39')][_0x0b9a('0x68')][_0x0b9a('0x4b')];_0x344755+=0x1){socket[_0x0b9a('0x71')](_0x0b9a('0x87'),{'UserId':Number(_0xae102a[_0x0b9a('0x39')]['ids'][_0x344755]),'MailQueueId':Number(_0xae102a[_0x0b9a('0x55')]['id'])});}}else{socket[_0x0b9a('0x71')](_0x0b9a('0x87'),{'UserId':Number(_0xae102a['query']['ids']),'MailQueueId':Number(_0xae102a[_0x0b9a('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xc2e8f7,null))[_0x0b9a('0x46')](handleError(_0xc2e8f7,null));};exports[_0x0b9a('0x8c')]=function(_0x3d0d88,_0x459c8c,_0x14e7bc){var _0x2c88ee={};var _0x2ac188={};var _0x3540b0;var _0x2c85ca;return db[_0x0b9a('0x43')]['findOne']({'where':{'id':_0x3d0d88[_0x0b9a('0x55')]['id']}})['then'](handleEntityNotFound(_0x459c8c,null))['then'](function(_0xf36bfa){if(_0xf36bfa){_0x3540b0=_0xf36bfa;_0x2ac188[_0x0b9a('0x37')]=_[_0x0b9a('0x48')](db[_0x0b9a('0x5e')][_0x0b9a('0x33')]);_0x2ac188[_0x0b9a('0x39')]=_[_0x0b9a('0x48')](_0x3d0d88[_0x0b9a('0x39')]);_0x2ac188[_0x0b9a('0x3a')]=_['intersection'](_0x2ac188[_0x0b9a('0x37')],_0x2ac188[_0x0b9a('0x39')]);_0x2c88ee[_0x0b9a('0x3b')]=_['intersection'](_0x2ac188[_0x0b9a('0x37')],qs[_0x0b9a('0x4a')](_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x4a')]));_0x2c88ee[_0x0b9a('0x3b')]=_0x2c88ee['attributes'][_0x0b9a('0x4b')]?_0x2c88ee[_0x0b9a('0x3b')]:_0x2ac188[_0x0b9a('0x37')];_0x2c88ee['order']=qs[_0x0b9a('0x5b')](_0x3d0d88[_0x0b9a('0x39')]['sort']);_0x2c88ee[_0x0b9a('0x3e')]=qs[_0x0b9a('0x3a')](_[_0x0b9a('0x3f')](_0x3d0d88[_0x0b9a('0x39')],_0x2ac188[_0x0b9a('0x3a')]));if(_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x40')]){_0x2c88ee['where']=_[_0x0b9a('0x41')](_0x2c88ee[_0x0b9a('0x3e')],{'$or':_[_0x0b9a('0x38')](_0x2c88ee['attributes'],function(_0x272532){var _0x73abf2={};_0x73abf2[_0x272532]={'$like':'%'+_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x40')]+'%'};return _0x73abf2;})});}_0x2c88ee=_[_0x0b9a('0x41')]({},_0x2c88ee,_0x3d0d88[_0x0b9a('0x42')]);return _0x3540b0[_0x0b9a('0x8c')](_0x2c88ee);}})[_0x0b9a('0x2c')](function(_0x308627){if(_0x308627){_0x2c85ca=_0x308627[_0x0b9a('0x4b')];if(!_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x5a')](_0x0b9a('0x3c'))){_0x2c88ee[_0x0b9a('0x24')]=qs[_0x0b9a('0x24')](_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x24')]);_0x2c88ee['offset']=qs['offset'](_0x3d0d88[_0x0b9a('0x39')][_0x0b9a('0x26')]);}return _0x3540b0[_0x0b9a('0x8c')](_0x2c88ee);}})[_0x0b9a('0x2c')](function(_0x24a1d6){if(_0x24a1d6){return _0x24a1d6?{'count':_0x2c85ca,'rows':_0x24a1d6}:null;}})[_0x0b9a('0x2c')](respondWithResult(_0x459c8c,null))['catch'](handleError(_0x459c8c,null));}; \ No newline at end of file +var _0x923c=['eml-format','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','MailQueues','end','stack','name','index','map','MailQueue','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserMailQueue','intersection','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','mailPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','findOrCreate','forEach','emit','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','all','compact','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x923c,0x198));var _0xc923=function(_0x233c56,_0xea0bb2){_0x233c56=_0x233c56-0x0;var _0x33a8c9=_0x923c[_0x233c56];return _0x33a8c9;};'use strict';var emlformat=require(_0xc923('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc923('0x1'));var jsonpatch=require(_0xc923('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc923('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc923('0x4'));var sox=require(_0xc923('0x5'));var csv=require('to-csv');var ejs=require(_0xc923('0x6'));var fs=require('fs');var fs_extra=require(_0xc923('0x7'));var _=require(_0xc923('0x8'));var squel=require(_0xc923('0x9'));var crypto=require(_0xc923('0xa'));var jsforce=require(_0xc923('0xb'));var deskjs=require(_0xc923('0xc'));var toCsv=require(_0xc923('0xd'));var querystring=require(_0xc923('0xe'));var Papa=require('papaparse');var Redis=require(_0xc923('0xf'));var authService=require(_0xc923('0x10'));var qs=require(_0xc923('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc923('0x12'));var logger=require(_0xc923('0x13'))(_0xc923('0x14'));var utils=require(_0xc923('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc923('0x16'));var db=require(_0xc923('0x17'))['db'];config['redis']=_[_0xc923('0x18')](config[_0xc923('0x19')],{'host':_0xc923('0x1a'),'port':0x18eb});var socket=require(_0xc923('0x1b'))(new Redis(config[_0xc923('0x19')]));require('./mailQueue.socket')[_0xc923('0x1c')](socket);function respondWithStatusCode(_0x1e4672,_0x177390){_0x177390=_0x177390||0xcc;return function(_0x27efde){if(_0x27efde){return _0x1e4672[_0xc923('0x1d')](_0x177390);}return _0x1e4672['status'](_0x177390)['end']();};}function respondWithResult(_0x52ea65,_0x1055d9){_0x1055d9=_0x1055d9||0xc8;return function(_0xbc1d98){if(_0xbc1d98){return _0x52ea65[_0xc923('0x1e')](_0x1055d9)[_0xc923('0x1f')](_0xbc1d98);}};}function respondWithFilteredResult(_0x58fb40,_0x3969bd){return function(_0x46f263){if(_0x46f263){var _0x2413bd=typeof _0x3969bd[_0xc923('0x20')]===_0xc923('0x21')&&typeof _0x3969bd[_0xc923('0x22')]===_0xc923('0x21');var _0x497258=_0x46f263[_0xc923('0x23')];var _0x323d57=_0x2413bd?0x0:_0x3969bd[_0xc923('0x20')];var _0x23743f=_0x2413bd?_0x46f263[_0xc923('0x23')]:_0x3969bd[_0xc923('0x20')]+_0x3969bd[_0xc923('0x22')];var _0x4535f8;if(_0x23743f>=_0x497258){_0x23743f=_0x497258;_0x4535f8=0xc8;}else{_0x4535f8=0xce;}_0x58fb40[_0xc923('0x1e')](_0x4535f8);return _0x58fb40[_0xc923('0x24')](_0xc923('0x25'),_0x323d57+'-'+_0x23743f+'/'+_0x497258)[_0xc923('0x1f')](_0x46f263);}return null;};}function patchUpdates(_0x2af037){return function(_0x4b1409){try{jsonpatch[_0xc923('0x26')](_0x4b1409,_0x2af037,!![]);}catch(_0x1ef2c5){return BPromise[_0xc923('0x27')](_0x1ef2c5);}return _0x4b1409['save']();};}function saveUpdates(_0xee757e,_0x22e878){return function(_0x44c92b){if(_0x44c92b){return _0x44c92b[_0xc923('0x28')](_0xee757e)['then'](function(_0x59323e){return _0x59323e;});}return null;};}function removeEntity(_0x1c68d5,_0x313d1b){return function(_0x4045ea){if(_0x4045ea){return _0x4045ea[_0xc923('0x29')]()[_0xc923('0x2a')](function(){var _0x5e7156=_0x4045ea[_0xc923('0x2b')]({'plain':!![]});var _0x4e3c90=_0xc923('0x2c');return db['UserProfileResource'][_0xc923('0x29')]({'where':{'type':_0x4e3c90,'resourceId':_0x5e7156['id']}})[_0xc923('0x2a')](function(){return _0x4045ea;});})[_0xc923('0x2a')](function(){_0x1c68d5[_0xc923('0x1e')](0xcc)[_0xc923('0x2d')]();});}};}function handleEntityNotFound(_0x3f35de,_0x40b18b){return function(_0x5f108e){if(!_0x5f108e){_0x3f35de[_0xc923('0x1d')](0x194);}return _0x5f108e;};}function handleError(_0x2d5435,_0x4eb21d){_0x4eb21d=_0x4eb21d||0x1f4;return function(_0x14f109){logger['error'](_0x14f109[_0xc923('0x2e')]);if(_0x14f109[_0xc923('0x2f')]){delete _0x14f109[_0xc923('0x2f')];}_0x2d5435[_0xc923('0x1e')](_0x4eb21d)['send'](_0x14f109);};}exports[_0xc923('0x30')]=function(_0x1b0f57,_0x3aff46){var _0x1e25ad={},_0x10927b={},_0x1fb3e5={'count':0x0,'rows':[]};var _0x51239b=_[_0xc923('0x31')](db[_0xc923('0x32')]['rawAttributes'],function(_0x26b7e0){return{'name':_0x26b7e0[_0xc923('0x33')],'type':_0x26b7e0[_0xc923('0x34')][_0xc923('0x35')]};});_0x10927b[_0xc923('0x36')]=_[_0xc923('0x31')](_0x51239b,_0xc923('0x2f'));_0x10927b[_0xc923('0x37')]=_[_0xc923('0x38')](_0x1b0f57[_0xc923('0x37')]);_0x10927b[_0xc923('0x39')]=_['intersection'](_0x10927b['model'],_0x10927b[_0xc923('0x37')]);_0x1e25ad[_0xc923('0x3a')]=_['intersection'](_0x10927b[_0xc923('0x36')],qs[_0xc923('0x3b')](_0x1b0f57[_0xc923('0x37')]['fields']));_0x1e25ad[_0xc923('0x3a')]=_0x1e25ad[_0xc923('0x3a')][_0xc923('0x3c')]?_0x1e25ad['attributes']:_0x10927b[_0xc923('0x36')];if(!_0x1b0f57['query'][_0xc923('0x3d')](_0xc923('0x3e'))){_0x1e25ad[_0xc923('0x22')]=qs[_0xc923('0x22')](_0x1b0f57[_0xc923('0x37')][_0xc923('0x22')]);_0x1e25ad[_0xc923('0x20')]=qs[_0xc923('0x20')](_0x1b0f57['query'][_0xc923('0x20')]);}_0x1e25ad[_0xc923('0x3f')]=qs[_0xc923('0x40')](_0x1b0f57[_0xc923('0x37')][_0xc923('0x40')]);_0x1e25ad['where']=qs[_0xc923('0x39')](_[_0xc923('0x41')](_0x1b0f57['query'],_0x10927b[_0xc923('0x39')]),_0x51239b);if(_0x1b0f57['query'][_0xc923('0x42')]){_0x1e25ad[_0xc923('0x43')]=_['merge'](_0x1e25ad['where'],{'$or':_['map'](_0x51239b,function(_0x9e8a00){if(_0x9e8a00[_0xc923('0x34')]!=='VIRTUAL'){var _0x22c9a6={};_0x22c9a6[_0x9e8a00[_0xc923('0x2f')]]={'$like':'%'+_0x1b0f57['query'][_0xc923('0x42')]+'%'};return _0x22c9a6;}})});}_0x1e25ad=_[_0xc923('0x44')]({},_0x1e25ad,_0x1b0f57['options']);var _0x1a9255={'where':_0x1e25ad[_0xc923('0x43')]};return db['MailQueue'][_0xc923('0x23')](_0x1a9255)[_0xc923('0x2a')](function(_0x28006b){_0x1fb3e5[_0xc923('0x23')]=_0x28006b;if(_0x1b0f57['query'][_0xc923('0x45')]){_0x1e25ad[_0xc923('0x46')]=[{'all':!![]}];}return db[_0xc923('0x32')][_0xc923('0x47')](_0x1e25ad);})[_0xc923('0x2a')](function(_0x398924){_0x1fb3e5[_0xc923('0x48')]=_0x398924;return _0x1fb3e5;})[_0xc923('0x2a')](respondWithFilteredResult(_0x3aff46,_0x1e25ad))[_0xc923('0x49')](handleError(_0x3aff46,null));};exports[_0xc923('0x4a')]=function(_0x155d1d,_0x215226){var _0x1c1a76={'raw':!![],'where':{'id':_0x155d1d[_0xc923('0x4b')]['id']}},_0x1f07de={};_0x1f07de['model']=_['keys'](db[_0xc923('0x32')][_0xc923('0x4c')]);_0x1f07de['query']=_['keys'](_0x155d1d[_0xc923('0x37')]);_0x1f07de[_0xc923('0x39')]=_['intersection'](_0x1f07de['model'],_0x1f07de[_0xc923('0x37')]);_0x1c1a76['attributes']=_['intersection'](_0x1f07de[_0xc923('0x36')],qs[_0xc923('0x3b')](_0x155d1d['query'][_0xc923('0x3b')]));_0x1c1a76['attributes']=_0x1c1a76[_0xc923('0x3a')]['length']?_0x1c1a76[_0xc923('0x3a')]:_0x1f07de[_0xc923('0x36')];if(_0x155d1d[_0xc923('0x37')]['includeAll']){_0x1c1a76['include']=[{'all':!![]}];}_0x1c1a76=_[_0xc923('0x44')]({},_0x1c1a76,_0x155d1d[_0xc923('0x4d')]);return db['MailQueue'][_0xc923('0x4e')](_0x1c1a76)[_0xc923('0x2a')](handleEntityNotFound(_0x215226,null))[_0xc923('0x2a')](respondWithResult(_0x215226,null))[_0xc923('0x49')](handleError(_0x215226,null));};exports['create']=function(_0x3a8426,_0x583582){return db[_0xc923('0x32')][_0xc923('0x4f')](_0x3a8426['body'],{})[_0xc923('0x2a')](function(_0x5b3d45){var _0x4e20e1=_0x3a8426[_0xc923('0x50')]['get']({'plain':!![]});if(!_0x4e20e1)throw new Error(_0xc923('0x51'));if(_0x4e20e1['role']===_0xc923('0x50')){var _0x484c98=_0x5b3d45[_0xc923('0x2b')]({'plain':!![]});var _0x47e7be='MailQueues';return db[_0xc923('0x52')][_0xc923('0x4e')]({'where':{'name':_0x47e7be,'userProfileId':_0x4e20e1['userProfileId']},'raw':!![]})['then'](function(_0x439c47){if(_0x439c47&&_0x439c47[_0xc923('0x53')]===0x0){return db[_0xc923('0x54')][_0xc923('0x4f')]({'name':_0x484c98[_0xc923('0x2f')],'resourceId':_0x484c98['id'],'type':_0x439c47['name'],'sectionId':_0x439c47['id']},{})[_0xc923('0x2a')](function(){return _0x5b3d45;});}else{return _0x5b3d45;}})[_0xc923('0x49')](function(_0x18008b){logger[_0xc923('0x55')](_0xc923('0x56'),_0x18008b);throw _0x18008b;});}return _0x5b3d45;})['then'](respondWithResult(_0x583582,0xc9))['catch'](handleError(_0x583582,null));};exports['update']=function(_0x2a8c0b,_0x3a0d41){if(_0x2a8c0b['body']['id']){delete _0x2a8c0b[_0xc923('0x57')]['id'];}return db[_0xc923('0x32')][_0xc923('0x4e')]({'where':{'id':_0x2a8c0b[_0xc923('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a0d41,null))[_0xc923('0x2a')](saveUpdates(_0x2a8c0b[_0xc923('0x57')],null))[_0xc923('0x2a')](respondWithResult(_0x3a0d41,null))[_0xc923('0x49')](handleError(_0x3a0d41,null));};exports[_0xc923('0x29')]=function(_0xc45624,_0x25ec71){return db[_0xc923('0x32')][_0xc923('0x4e')]({'where':{'id':_0xc45624[_0xc923('0x4b')]['id']}})[_0xc923('0x2a')](handleEntityNotFound(_0x25ec71,null))[_0xc923('0x2a')](removeEntity(_0x25ec71,null))[_0xc923('0x49')](handleError(_0x25ec71,null));};exports['describe']=function(_0x5e0e4c,_0x360c89){return db[_0xc923('0x32')]['describe']()[_0xc923('0x2a')](respondWithResult(_0x360c89,null))['catch'](handleError(_0x360c89,null));};exports[_0xc923('0x58')]=function(_0x47f294,_0x57f845,_0x3daa98){var _0x3a9cad={'raw':!![],'where':{}},_0x5e866e={},_0x2ea741;return db[_0xc923('0x32')][_0xc923('0x59')]({'where':{'id':_0x47f294[_0xc923('0x4b')]['id']}})[_0xc923('0x2a')](handleEntityNotFound(_0x57f845,null))[_0xc923('0x2a')](function(_0x32bd92){if(_0x32bd92){_0x2ea741=_0x32bd92[_0xc923('0x2b')]({'plain':!![]});_0x5e866e['model']=_['keys'](db[_0xc923('0x5a')][_0xc923('0x4c')]);_0x5e866e[_0xc923('0x37')]=_['keys'](_0x47f294[_0xc923('0x37')]);_0x5e866e[_0xc923('0x39')]=_['intersection'](_0x5e866e[_0xc923('0x36')],_0x5e866e['query']);_0x3a9cad['attributes']=_[_0xc923('0x5b')](_0x5e866e[_0xc923('0x36')],qs[_0xc923('0x3b')](_0x47f294['query'][_0xc923('0x3b')]));_0x3a9cad[_0xc923('0x3a')]=_0x3a9cad[_0xc923('0x3a')]['length']?_0x3a9cad[_0xc923('0x3a')]:_0x5e866e[_0xc923('0x36')];if(!_0x47f294['query'][_0xc923('0x3d')](_0xc923('0x3e'))){_0x3a9cad[_0xc923('0x22')]=qs[_0xc923('0x22')](_0x47f294[_0xc923('0x37')]['limit']);_0x3a9cad['offset']=qs[_0xc923('0x20')](_0x47f294[_0xc923('0x37')][_0xc923('0x20')]);}_0x3a9cad[_0xc923('0x3f')]=qs['sort'](_0x47f294['query'][_0xc923('0x40')]);_0x3a9cad[_0xc923('0x43')]=qs[_0xc923('0x39')](_[_0xc923('0x41')](_0x47f294[_0xc923('0x37')],_0x5e866e[_0xc923('0x39')]));_0x3a9cad[_0xc923('0x43')]['MailQueueId']=_0x32bd92['id'];if(_0x47f294[_0xc923('0x37')][_0xc923('0x42')]){_0x3a9cad[_0xc923('0x43')]=_['merge'](_0x3a9cad[_0xc923('0x43')],{'$or':_[_0xc923('0x31')](_0x3a9cad[_0xc923('0x3a')],function(_0xc108b){var _0x29473c={};_0x29473c[_0xc108b]={'$like':'%'+_0x47f294[_0xc923('0x37')][_0xc923('0x42')]+'%'};return _0x29473c;})});}_0x3a9cad=_[_0xc923('0x44')]({},_0x3a9cad,_0x47f294[_0xc923('0x4d')]);return db[_0xc923('0x5a')]['findAll'](_0x3a9cad);}})[_0xc923('0x2a')](function(_0x1011a9){if(_0x1011a9){return db[_0xc923('0x5c')][_0xc923('0x5d')]({'where':{'id':_[_0xc923('0x31')](_0x1011a9,_0xc923('0x5e')),'role':_0xc923('0x5f')},'attributes':['id','name','mailPause',_0xc923('0x60'),_0xc923('0x61')]});}})['then'](function(_0xf62b7b){if(_0xf62b7b){return{'count':_0xf62b7b[_0xc923('0x23')],'rows':_[_0xc923('0x31')](_0xf62b7b[_0xc923('0x48')],function(_0x4de8d5){return{'membername':_0x4de8d5[_0xc923('0x2f')],'UserId':_0x4de8d5['id'],'queue_name':_0x2ea741[_0xc923('0x2f')],'MailQueueId':_0x2ea741['id'],'interface':util['format'](_0xc923('0x62'),'SIP',_0x4de8d5[_0xc923('0x2f')]),'penalty':0x0,'paused':_0x4de8d5[_0xc923('0x63')],'createdAt':_0x4de8d5['createdAt'],'updatedAt':_0x4de8d5[_0xc923('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc923('0x2a')](respondWithFilteredResult(_0x57f845,_0x3a9cad))['catch'](handleError(_0x57f845,null));};exports[_0xc923('0x64')]=function(_0x21ef83,_0x182ed6,_0x34deba){var _0x48b1b3={};var _0x29a927={};var _0x2e48e7;var _0x509ca8;return db[_0xc923('0x32')][_0xc923('0x59')]({'where':{'id':_0x21ef83[_0xc923('0x4b')]['id']}})['then'](handleEntityNotFound(_0x182ed6,null))['then'](function(_0x28fc26){if(_0x28fc26){_0x2e48e7=_0x28fc26;_0x29a927[_0xc923('0x36')]=_[_0xc923('0x38')](db[_0xc923('0x65')][_0xc923('0x4c')]);_0x29a927[_0xc923('0x37')]=_[_0xc923('0x38')](_0x21ef83[_0xc923('0x37')]);_0x29a927[_0xc923('0x39')]=_[_0xc923('0x5b')](_0x29a927['model'],_0x29a927['query']);_0x48b1b3[_0xc923('0x3a')]=_[_0xc923('0x5b')](_0x29a927[_0xc923('0x36')],qs[_0xc923('0x3b')](_0x21ef83['query']['fields']));_0x48b1b3['attributes']=_0x48b1b3[_0xc923('0x3a')][_0xc923('0x3c')]?_0x48b1b3['attributes']:_0x29a927[_0xc923('0x36')];_0x48b1b3[_0xc923('0x3f')]=qs['sort'](_0x21ef83[_0xc923('0x37')]['sort']);_0x48b1b3['where']=qs[_0xc923('0x39')](_[_0xc923('0x41')](_0x21ef83['query'],_0x29a927[_0xc923('0x39')]));if(_0x21ef83[_0xc923('0x37')][_0xc923('0x42')]){_0x48b1b3[_0xc923('0x43')]=_[_0xc923('0x44')](_0x48b1b3[_0xc923('0x43')],{'$or':_[_0xc923('0x31')](_0x48b1b3[_0xc923('0x3a')],function(_0x50a7aa){var _0x44157d={};_0x44157d[_0x50a7aa]={'$like':'%'+_0x21ef83[_0xc923('0x37')][_0xc923('0x42')]+'%'};return _0x44157d;})});}_0x48b1b3=_[_0xc923('0x44')]({},_0x48b1b3,_0x21ef83['options']);return _0x2e48e7['getTeams'](_0x48b1b3);}})[_0xc923('0x2a')](function(_0x11e607){if(_0x11e607){_0x509ca8=_0x11e607[_0xc923('0x3c')];if(!_0x21ef83[_0xc923('0x37')][_0xc923('0x3d')](_0xc923('0x3e'))){_0x48b1b3['limit']=qs[_0xc923('0x22')](_0x21ef83[_0xc923('0x37')]['limit']);_0x48b1b3['offset']=qs[_0xc923('0x20')](_0x21ef83[_0xc923('0x37')]['offset']);}return _0x2e48e7['getTeams'](_0x48b1b3);}})[_0xc923('0x2a')](function(_0x54ea71){if(_0x54ea71){return _0x54ea71?{'count':_0x509ca8,'rows':_0x54ea71}:null;}})['then'](respondWithResult(_0x182ed6,null))[_0xc923('0x49')](handleError(_0x182ed6,null));};exports[_0xc923('0x66')]=function(_0x178106,_0x276bdb,_0x767d2){var _0x1281ed=_0x178106[_0xc923('0x57')][_0xc923('0x67')];return db[_0xc923('0x65')][_0xc923('0x47')]({'where':{'id':_0x1281ed},'attributes':['id'],'include':[{'model':db[_0xc923('0x5c')],'as':_0xc923('0x68'),'attributes':['id',_0xc923('0x2f'),_0xc923('0x69'),_0xc923('0x6a'),_0xc923('0x6b')],'raw':!![]}]})['then'](function(_0x28704a){if(_0x28704a){var _0x40b019=_['flatMap'](_0x28704a,function(_0x267ceb){var _0x19e6c1=_0x267ceb[_0xc923('0x2b')]({'plain':!![]});return _0x19e6c1['Agents'];});return db[_0xc923('0x32')][_0xc923('0x4e')]({'where':{'id':_0x178106['params']['id']}})[_0xc923('0x2a')](function(_0x2845f0){return db['sequelize']['transaction'](function(_0xc708eb){return _0x2845f0[_0xc923('0x66')](_0x1281ed,{'transaction':_0xc708eb})[_0xc923('0x2a')](function(){return BPromise['each'](_0x40b019,function(_0x19aeb2){return db['UserMailQueue'][_0xc923('0x6c')]({'where':{'UserId':_0x19aeb2['id'],'MailQueueId':_0x178106[_0xc923('0x4b')]['id']},'transaction':_0xc708eb});});})['then'](function(){_0x40b019[_0xc923('0x6d')](function(_0x1cef36){socket[_0xc923('0x6e')]('userMailQueue:save',{'UserId':_0x1cef36['id'],'MailQueueId':_0x2845f0['id']});});});});});}})[_0xc923('0x2a')](respondWithStatusCode(_0x276bdb,null))[_0xc923('0x49')](handleError(_0x276bdb,null));};exports['removeTeams']=function(_0x318d15,_0xefe60a,_0x433c3c){return db[_0xc923('0x65')]['findAll']({'where':{'id':_0x318d15['query'][_0xc923('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc923('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc923('0x2a')](handleEntityNotFound(_0xefe60a,null))[_0xc923('0x2a')](function(_0x58613a){var _0x341f25=_[_0xc923('0x31')](_0x58613a,'id');var _0x131744=[];var _0x2f4fee=[];var _0x1b7397=squel[_0xc923('0x6f')]();_0x1b7397['field'](_0xc923('0x70'))[_0xc923('0x71')]('team_has_mail_queues','tq')[_0xc923('0x72')]('user_has_teams','ut',_0xc923('0x73'))[_0xc923('0x43')](_0xc923('0x74'),_0x318d15[_0xc923('0x4b')]['id']);for(var _0x2ddb29=0x0;_0x2ddb29<_0x58613a[_0xc923('0x3c')];_0x2ddb29+=0x1){let _0x1446c7=_0x58613a[_0x2ddb29];for(var _0x446a22=0x0;_0x446a22<_0x1446c7[_0xc923('0x68')][_0xc923('0x3c')];_0x446a22+=0x1){let _0x3b2dd1=_0x1446c7[_0xc923('0x68')][_0x446a22];var _0x3fd811=_0x1b7397[_0xc923('0x75')]();_0x3fd811['where'](_0xc923('0x76'),_0x3b2dd1['id']);_0x2f4fee[_0xc923('0x77')](db[_0xc923('0x78')][_0xc923('0x37')](_0x3fd811[_0xc923('0x79')](),{'type':db[_0xc923('0x78')][_0xc923('0x7a')]['SELECT']})['then'](function(_0x5130a8){if(_0x5130a8[_0xc923('0x3c')]===0x1){return _0x3b2dd1['id'];}else{var _0x3cf7b6=_[_0xc923('0x7b')](_[_0xc923('0x31')](_0x5130a8,'TeamId'),function(_0xd8cd5a){return _[_0xc923('0x7c')](_0x341f25,_0xd8cd5a);});if(_0x3cf7b6){return _0x3b2dd1['id'];}}}));}}return BPromise[_0xc923('0x7d')](_0x2f4fee)[_0xc923('0x2a')](function(_0x40fc8b){_0x131744=_(_0x131744)['union'](_0x40fc8b)[_0xc923('0x7e')]()['value']();return db[_0xc923('0x32')]['find']({'where':{'id':_0x318d15['params']['id']}})[_0xc923('0x2a')](function(_0x5ecf52){return db[_0xc923('0x78')]['transaction'](function(_0x4e42b2){return _0x5ecf52[_0xc923('0x7f')](_0x318d15[_0xc923('0x37')][_0xc923('0x67')],{'transaction':_0x4e42b2})[_0xc923('0x2a')](function(){if(!_[_0xc923('0x80')](_0x131744)){return _0x5ecf52[_0xc923('0x81')](_0x131744,{'transaction':_0x4e42b2});}})['then'](function(){_0x131744[_0xc923('0x6d')](function(_0x3d026c){socket[_0xc923('0x6e')]('userMailQueue:remove',{'UserId':_0x3d026c,'MailQueueId':_0x5ecf52['id']});});});});});});})[_0xc923('0x2a')](respondWithStatusCode(_0xefe60a,null))[_0xc923('0x49')](handleError(_0xefe60a,null));};exports[_0xc923('0x82')]=function(_0x161647,_0x24b31a,_0xf4b165){return db[_0xc923('0x32')][_0xc923('0x4e')]({'where':{'id':_0x161647[_0xc923('0x4b')]['id']}})[_0xc923('0x2a')](handleEntityNotFound(_0x24b31a,null))[_0xc923('0x2a')](function(_0x5d8373){if(_0x5d8373){return _0x5d8373['addAgents'](_0x161647['body'][_0xc923('0x67')],_[_0xc923('0x83')](_0x161647['body'],['ids','id'])||{})[_0xc923('0x84')](function(_0x5229bd){for(var _0x4a7ada=0x0;_0x4a7ada<_0x161647['body'][_0xc923('0x67')][_0xc923('0x3c')];_0x4a7ada+=0x1){socket[_0xc923('0x6e')]('userMailQueue:save',{'UserId':Number(_0x161647[_0xc923('0x57')][_0xc923('0x67')][_0x4a7ada]),'MailQueueId':Number(_0x161647[_0xc923('0x4b')]['id'])});}return _0x5229bd;});}})[_0xc923('0x2a')](respondWithResult(_0x24b31a,null))['catch'](handleError(_0x24b31a,null));};exports[_0xc923('0x81')]=function(_0x569984,_0x596cf1,_0x46e058){return db['MailQueue']['find']({'where':{'id':_0x569984[_0xc923('0x4b')]['id']}})['then'](handleEntityNotFound(_0x596cf1,null))[_0xc923('0x2a')](function(_0x1936a5){if(_0x1936a5){return _0x1936a5['removeAgents'](_0x569984[_0xc923('0x37')][_0xc923('0x67')])['then'](function(){if(_[_0xc923('0x85')](_0x569984[_0xc923('0x37')][_0xc923('0x67')])){for(var _0x1d0d3b=0x0;_0x1d0d3b<_0x569984[_0xc923('0x37')][_0xc923('0x67')]['length'];_0x1d0d3b+=0x1){socket[_0xc923('0x6e')](_0xc923('0x86'),{'UserId':Number(_0x569984[_0xc923('0x37')][_0xc923('0x67')][_0x1d0d3b]),'MailQueueId':Number(_0x569984[_0xc923('0x4b')]['id'])});}}else{socket[_0xc923('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x569984[_0xc923('0x37')]['ids']),'MailQueueId':Number(_0x569984[_0xc923('0x4b')]['id'])});}});}})[_0xc923('0x2a')](respondWithStatusCode(_0x596cf1,null))[_0xc923('0x49')](handleError(_0x596cf1,null));};exports['getAgents']=function(_0xc08b2f,_0x4bad52,_0x2ee383){var _0x29dbe3={};var _0x373da6={};var _0x5ef5d5;var _0x290e2b;return db['MailQueue'][_0xc923('0x59')]({'where':{'id':_0xc08b2f['params']['id']}})[_0xc923('0x2a')](handleEntityNotFound(_0x4bad52,null))[_0xc923('0x2a')](function(_0x11333f){if(_0x11333f){_0x5ef5d5=_0x11333f;_0x373da6[_0xc923('0x36')]=_[_0xc923('0x38')](db[_0xc923('0x5c')][_0xc923('0x4c')]);_0x373da6[_0xc923('0x37')]=_[_0xc923('0x38')](_0xc08b2f[_0xc923('0x37')]);_0x373da6['filters']=_[_0xc923('0x5b')](_0x373da6[_0xc923('0x36')],_0x373da6['query']);_0x29dbe3[_0xc923('0x3a')]=_[_0xc923('0x5b')](_0x373da6[_0xc923('0x36')],qs[_0xc923('0x3b')](_0xc08b2f[_0xc923('0x37')][_0xc923('0x3b')]));_0x29dbe3['attributes']=_0x29dbe3[_0xc923('0x3a')][_0xc923('0x3c')]?_0x29dbe3[_0xc923('0x3a')]:_0x373da6[_0xc923('0x36')];_0x29dbe3[_0xc923('0x3f')]=qs[_0xc923('0x40')](_0xc08b2f[_0xc923('0x37')][_0xc923('0x40')]);_0x29dbe3[_0xc923('0x43')]=qs[_0xc923('0x39')](_[_0xc923('0x41')](_0xc08b2f[_0xc923('0x37')],_0x373da6[_0xc923('0x39')]));if(_0xc08b2f[_0xc923('0x37')][_0xc923('0x42')]){_0x29dbe3[_0xc923('0x43')]=_[_0xc923('0x44')](_0x29dbe3['where'],{'$or':_['map'](_0x29dbe3[_0xc923('0x3a')],function(_0x1a5a31){var _0x23b743={};_0x23b743[_0x1a5a31]={'$like':'%'+_0xc08b2f[_0xc923('0x37')][_0xc923('0x42')]+'%'};return _0x23b743;})});}_0x29dbe3=_[_0xc923('0x44')]({},_0x29dbe3,_0xc08b2f[_0xc923('0x4d')]);return _0x5ef5d5[_0xc923('0x87')](_0x29dbe3);}})[_0xc923('0x2a')](function(_0x723c06){if(_0x723c06){_0x290e2b=_0x723c06[_0xc923('0x3c')];if(!_0xc08b2f['query'][_0xc923('0x3d')](_0xc923('0x3e'))){_0x29dbe3['limit']=qs['limit'](_0xc08b2f[_0xc923('0x37')][_0xc923('0x22')]);_0x29dbe3[_0xc923('0x20')]=qs['offset'](_0xc08b2f[_0xc923('0x37')][_0xc923('0x20')]);}return _0x5ef5d5[_0xc923('0x87')](_0x29dbe3);}})['then'](function(_0x35989a){if(_0x35989a){return _0x35989a?{'count':_0x290e2b,'rows':_0x35989a}:null;}})[_0xc923('0x2a')](respondWithResult(_0x4bad52,null))[_0xc923('0x49')](handleError(_0x4bad52,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ad633e9..5989ae6 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 _0xf369=['MailQueue','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xf369,0x193));var _0x9f36=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0xf369[_0x1aae33];return _0x2e91e9;};'use strict';var EventEmitter=require(_0x9f36('0x0'));var MailQueue=require(_0x9f36('0x1'))['db'][_0x9f36('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f36('0x3'),'afterDestroy':_0x9f36('0x4')};function emitEvent(_0x4162f3){return function(_0x4c8000,_0x39bdfd,_0x3f00a6){MailQueueEvents[_0x9f36('0x5')](_0x4162f3+':'+_0x4c8000['id'],_0x4c8000);MailQueueEvents['emit'](_0x4162f3,_0x4c8000);_0x3f00a6(null);};}for(var e in events){if(events[_0x9f36('0x6')](e)){var event=events[e];MailQueue[_0x9f36('0x7')](e,emitEvent(event));}}module[_0x9f36('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x2ec9=['events','../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x2ec9,0x1dd));var _0x92ec=function(_0x1132ef,_0xc791b4){_0x1132ef=_0x1132ef-0x0;var _0x2c3242=_0x2ec9[_0x1132ef];return _0x2c3242;};'use strict';var EventEmitter=require(_0x92ec('0x0'));var MailQueue=require(_0x92ec('0x1'))['db'][_0x92ec('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92ec('0x3'),'afterUpdate':_0x92ec('0x4'),'afterDestroy':_0x92ec('0x5')};function emitEvent(_0x5d6929){return function(_0x5836a8,_0x1f8456,_0x672753){MailQueueEvents[_0x92ec('0x6')](_0x5d6929+':'+_0x5836a8['id'],_0x5836a8);MailQueueEvents[_0x92ec('0x6')](_0x5d6929,_0x5836a8);_0x672753(null);};}for(var e in events){if(events[_0x92ec('0x7')](e)){var event=events[e];MailQueue[_0x92ec('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index fc6f96d..56df9d8 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 _0x018a=['request-promise','path','rimraf','define','MailQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x38b4de,_0x3b2b10){var _0x54f3dc=function(_0xf82116){while(--_0xf82116){_0x38b4de['push'](_0x38b4de['shift']());}};_0x54f3dc(++_0x3b2b10);}(_0x018a,0x13b));var _0xa018=function(_0xbe6d5d,_0x308a41){_0xbe6d5d=_0xbe6d5d-0x0;var _0x2cb584=_0x018a[_0xbe6d5d];return _0x2cb584;};'use strict';var _=require('lodash');var util=require(_0xa018('0x0'));var logger=require(_0xa018('0x1'))(_0xa018('0x2'));var moment=require(_0xa018('0x3'));var BPromise=require(_0xa018('0x4'));var rp=require(_0xa018('0x5'));var fs=require('fs');var path=require(_0xa018('0x6'));var rimraf=require(_0xa018('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x597d0e,_0x53adc7){return _0x597d0e[_0xa018('0x8')](_0xa018('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dd4=['mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailQueue'];(function(_0x148691,_0xc992aa){var _0x15ca68=function(_0x596dcd){while(--_0x596dcd){_0x148691['push'](_0x148691['shift']());}};_0x15ca68(++_0xc992aa);}(_0x6dd4,0x1b9));var _0x46dd=function(_0x5cfae8,_0x2734e7){_0x5cfae8=_0x5cfae8-0x0;var _0xd8d3bf=_0x6dd4[_0x5cfae8];return _0xd8d3bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x46dd('0x0'))(_0x46dd('0x1'));var moment=require(_0x46dd('0x2'));var BPromise=require(_0x46dd('0x3'));var rp=require(_0x46dd('0x4'));var fs=require('fs');var path=require(_0x46dd('0x5'));var rimraf=require(_0x46dd('0x6'));var config=require(_0x46dd('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x26a878,_0x428d1e){return _0x26a878[_0x46dd('0x8')](_0x46dd('0x9'),attributes,{'tableName':_0x46dd('0xa'),'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 ff4fe7b..e9659d8 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 _0x4c90=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','then','debug','ShowMailQueue','find','lodash','util','moment'];(function(_0x2c34ba,_0x3a4eb6){var _0x420bc3=function(_0x4921bc){while(--_0x4921bc){_0x2c34ba['push'](_0x2c34ba['shift']());}};_0x420bc3(++_0x3a4eb6);}(_0x4c90,0x78));var _0x04c9=function(_0x3c7a65,_0x4c05c4){_0x3c7a65=_0x3c7a65-0x0;var _0xc48a10=_0x4c90[_0x3c7a65];return _0xc48a10;};'use strict';var _=require(_0x04c9('0x0'));var util=require(_0x04c9('0x1'));var moment=require(_0x04c9('0x2'));var BPromise=require(_0x04c9('0x3'));var rs=require(_0x04c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04c9('0x5'))['db'];var utils=require(_0x04c9('0x6'));var logger=require('../../config/logger')(_0x04c9('0x7'));var config=require(_0x04c9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c9('0x9')][_0x04c9('0xa')]({'port':0x232a});config[_0x04c9('0xb')]=_[_0x04c9('0xc')](config[_0x04c9('0xb')],{'host':_0x04c9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04c9('0xb')]));require(_0x04c9('0xe'))[_0x04c9('0xf')](socket);function respondWithRpcPromise(_0x441190,_0x22c19a,_0x146dcb){return new BPromise(function(_0xcc426e,_0x5a3372){return client[_0x04c9('0x10')](_0x441190,_0x146dcb)['then'](function(_0x1d0923){logger['info']('MailQueue,\x20%s,\x20%s',_0x22c19a,_0x04c9('0x11'));logger['debug'](_0x04c9('0x12'),_0x22c19a,_0x04c9('0x11'),JSON[_0x04c9('0x13')](_0x1d0923));if(_0x1d0923[_0x04c9('0x14')]){if(_0x1d0923['error'][_0x04c9('0x15')]===0x1f4){logger[_0x04c9('0x14')](_0x04c9('0x16'),_0x22c19a,_0x1d0923['error'][_0x04c9('0x17')]);return _0x5a3372(_0x1d0923[_0x04c9('0x14')]['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x22c19a,_0x1d0923[_0x04c9('0x14')][_0x04c9('0x17')]);return _0xcc426e(_0x1d0923[_0x04c9('0x14')][_0x04c9('0x17')]);}else{logger[_0x04c9('0x18')](_0x04c9('0x16'),_0x22c19a,_0x04c9('0x11'));_0xcc426e(_0x1d0923[_0x04c9('0x19')][_0x04c9('0x17')]);}})[_0x04c9('0x1a')](function(_0x7998d1){logger['error'](_0x04c9('0x16'),_0x22c19a,_0x7998d1);_0x5a3372(_0x7998d1);});});}exports[_0x04c9('0x1b')]=function(_0x13758c){var _0x1f9cfa=this;return new Promise(function(_0x158af0,_0xbaca97){return db[_0x04c9('0x1c')][_0x04c9('0x1d')]({'raw':_0x13758c[_0x04c9('0x1e')]?_0x13758c[_0x04c9('0x1e')][_0x04c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x13758c[_0x04c9('0x1e')]?_0x13758c[_0x04c9('0x1e')][_0x04c9('0x20')]||null:null,'attributes':_0x13758c[_0x04c9('0x1e')]?_0x13758c['options'][_0x04c9('0x21')]||null:null,'limit':_0x13758c[_0x04c9('0x1e')]?_0x13758c[_0x04c9('0x1e')]['limit']||null:null,'include':_0x13758c[_0x04c9('0x1e')]?_0x13758c['options'][_0x04c9('0x22')]?_[_0x04c9('0x23')](_0x13758c[_0x04c9('0x1e')][_0x04c9('0x22')],function(_0x11fc7d){return{'model':db[_0x11fc7d[_0x04c9('0x24')]],'as':_0x11fc7d['as'],'attributes':_0x11fc7d[_0x04c9('0x21')],'include':_0x11fc7d[_0x04c9('0x22')]?_[_0x04c9('0x23')](_0x11fc7d[_0x04c9('0x22')],function(_0x773f2a){return{'model':db[_0x773f2a[_0x04c9('0x24')]],'as':_0x773f2a['as'],'attributes':_0x773f2a[_0x04c9('0x21')],'include':_0x773f2a[_0x04c9('0x22')]?_[_0x04c9('0x23')](_0x773f2a['include'],function(_0x546ee0){return{'model':db[_0x546ee0[_0x04c9('0x24')]],'as':_0x546ee0['as'],'attributes':_0x546ee0[_0x04c9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x04c9('0x25')](function(_0x4f9a23){logger[_0x04c9('0x18')](_0x04c9('0x1b'),_0x13758c);logger[_0x04c9('0x26')]('GetMailQueue',_0x13758c,JSON['stringify'](_0x4f9a23));_0x158af0(_0x4f9a23);})['catch'](function(_0x341078){logger[_0x04c9('0x14')](_0x04c9('0x1b'),_0x341078[_0x04c9('0x17')],_0x13758c);_0xbaca97(_0x1f9cfa['error'](0x1f4,_0x341078[_0x04c9('0x17')]));});});};exports[_0x04c9('0x27')]=function(_0x552e39){var _0x24262a=this;return new Promise(function(_0x526a66,_0x1438fa){return db[_0x04c9('0x1c')][_0x04c9('0x28')]({'raw':_0x552e39['options']?_0x552e39[_0x04c9('0x1e')][_0x04c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x552e39[_0x04c9('0x1e')]?_0x552e39[_0x04c9('0x1e')][_0x04c9('0x20')]||null:null,'attributes':_0x552e39[_0x04c9('0x1e')]?_0x552e39['options'][_0x04c9('0x21')]||null:null,'include':_0x552e39[_0x04c9('0x1e')]?_0x552e39[_0x04c9('0x1e')][_0x04c9('0x22')]?_['map'](_0x552e39['options'][_0x04c9('0x22')],function(_0x558bae){return{'model':db[_0x558bae[_0x04c9('0x24')]],'as':_0x558bae['as'],'attributes':_0x558bae['attributes'],'include':_0x558bae[_0x04c9('0x22')]?_['map'](_0x558bae[_0x04c9('0x22')],function(_0x429d85){return{'model':db[_0x429d85[_0x04c9('0x24')]],'as':_0x429d85['as'],'attributes':_0x429d85[_0x04c9('0x21')],'include':_0x429d85['include']?_[_0x04c9('0x23')](_0x429d85['include'],function(_0x2d3403){return{'model':db[_0x2d3403[_0x04c9('0x24')]],'as':_0x2d3403['as'],'attributes':_0x2d3403[_0x04c9('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52ee88){logger[_0x04c9('0x18')]('ShowMailQueue',_0x552e39);logger[_0x04c9('0x26')](_0x04c9('0x27'),_0x552e39,JSON[_0x04c9('0x13')](_0x52ee88));_0x526a66(_0x52ee88);})['catch'](function(_0x2e74c5){logger[_0x04c9('0x14')](_0x04c9('0x27'),_0x2e74c5[_0x04c9('0x17')],_0x552e39);_0x1438fa(_0x24262a['error'](0x1f4,_0x2e74c5[_0x04c9('0x17')]));});});}; \ No newline at end of file +var _0x67f0=['MailQueue','find','where','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','options','raw','limit','include','model','map','attributes','GetMailQueue','catch','ShowMailQueue'];(function(_0x4ad364,_0x34d600){var _0x1ace8f=function(_0x4f4503){while(--_0x4f4503){_0x4ad364['push'](_0x4ad364['shift']());}};_0x1ace8f(++_0x34d600);}(_0x67f0,0x1b0));var _0x067f=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x67f0[_0x256d6a];return _0x460058;};'use strict';var _=require(_0x067f('0x0'));var util=require(_0x067f('0x1'));var moment=require(_0x067f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x067f('0x3'));var db=require(_0x067f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x067f('0x5'))(_0x067f('0x6'));var config=require(_0x067f('0x7'));var jayson=require(_0x067f('0x8'));var client=jayson[_0x067f('0x9')]['http']({'port':0x232a});config[_0x067f('0xa')]=_[_0x067f('0xb')](config[_0x067f('0xa')],{'host':_0x067f('0xc'),'port':0x18eb});var socket=require(_0x067f('0xd'))(new Redis(config[_0x067f('0xa')]));require(_0x067f('0xe'))[_0x067f('0xf')](socket);function respondWithRpcPromise(_0x379bbc,_0x556e29,_0x4729b5){return new BPromise(function(_0x532396,_0xaa3de6){return client['request'](_0x379bbc,_0x4729b5)[_0x067f('0x10')](function(_0x4841e3){logger[_0x067f('0x11')](_0x067f('0x12'),_0x556e29,_0x067f('0x13'));logger[_0x067f('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x556e29,'request\x20sent',JSON[_0x067f('0x15')](_0x4841e3));if(_0x4841e3[_0x067f('0x16')]){if(_0x4841e3['error'][_0x067f('0x17')]===0x1f4){logger[_0x067f('0x16')](_0x067f('0x12'),_0x556e29,_0x4841e3[_0x067f('0x16')][_0x067f('0x18')]);return _0xaa3de6(_0x4841e3['error']['message']);}logger['error'](_0x067f('0x12'),_0x556e29,_0x4841e3['error'][_0x067f('0x18')]);return _0x532396(_0x4841e3['error']['message']);}else{logger[_0x067f('0x11')]('MailQueue,\x20%s,\x20%s',_0x556e29,_0x067f('0x13'));_0x532396(_0x4841e3[_0x067f('0x19')][_0x067f('0x18')]);}})['catch'](function(_0xf4ac93){logger[_0x067f('0x16')](_0x067f('0x12'),_0x556e29,_0xf4ac93);_0xaa3de6(_0xf4ac93);});});}exports['GetMailQueue']=function(_0xf5df7b){var _0x209591=this;return new Promise(function(_0x363fec,_0x141611){return db['MailQueue']['findAll']({'raw':_0xf5df7b[_0x067f('0x1a')]?_0xf5df7b[_0x067f('0x1a')][_0x067f('0x1b')]===undefined?!![]:![]:!![],'where':_0xf5df7b[_0x067f('0x1a')]?_0xf5df7b[_0x067f('0x1a')]['where']||null:null,'attributes':_0xf5df7b[_0x067f('0x1a')]?_0xf5df7b[_0x067f('0x1a')]['attributes']||null:null,'limit':_0xf5df7b[_0x067f('0x1a')]?_0xf5df7b['options'][_0x067f('0x1c')]||null:null,'include':_0xf5df7b[_0x067f('0x1a')]?_0xf5df7b[_0x067f('0x1a')][_0x067f('0x1d')]?_['map'](_0xf5df7b[_0x067f('0x1a')]['include'],function(_0x254a3a){return{'model':db[_0x254a3a[_0x067f('0x1e')]],'as':_0x254a3a['as'],'attributes':_0x254a3a['attributes'],'include':_0x254a3a['include']?_[_0x067f('0x1f')](_0x254a3a[_0x067f('0x1d')],function(_0x21926a){return{'model':db[_0x21926a[_0x067f('0x1e')]],'as':_0x21926a['as'],'attributes':_0x21926a[_0x067f('0x20')],'include':_0x21926a[_0x067f('0x1d')]?_[_0x067f('0x1f')](_0x21926a['include'],function(_0xd519a2){return{'model':db[_0xd519a2[_0x067f('0x1e')]],'as':_0xd519a2['as'],'attributes':_0xd519a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x067f('0x10')](function(_0x59fb7c){logger['info'](_0x067f('0x21'),_0xf5df7b);logger[_0x067f('0x14')](_0x067f('0x21'),_0xf5df7b,JSON[_0x067f('0x15')](_0x59fb7c));_0x363fec(_0x59fb7c);})[_0x067f('0x22')](function(_0x377a21){logger[_0x067f('0x16')]('GetMailQueue',_0x377a21[_0x067f('0x18')],_0xf5df7b);_0x141611(_0x209591[_0x067f('0x16')](0x1f4,_0x377a21['message']));});});};exports[_0x067f('0x23')]=function(_0x143af6){var _0x5f49b6=this;return new Promise(function(_0x46a6cc,_0x380e11){return db[_0x067f('0x24')][_0x067f('0x25')]({'raw':_0x143af6['options']?_0x143af6[_0x067f('0x1a')][_0x067f('0x1b')]===undefined?!![]:![]:!![],'where':_0x143af6[_0x067f('0x1a')]?_0x143af6['options'][_0x067f('0x26')]||null:null,'attributes':_0x143af6[_0x067f('0x1a')]?_0x143af6[_0x067f('0x1a')][_0x067f('0x20')]||null:null,'include':_0x143af6[_0x067f('0x1a')]?_0x143af6[_0x067f('0x1a')][_0x067f('0x1d')]?_[_0x067f('0x1f')](_0x143af6['options'][_0x067f('0x1d')],function(_0x47bd63){return{'model':db[_0x47bd63[_0x067f('0x1e')]],'as':_0x47bd63['as'],'attributes':_0x47bd63[_0x067f('0x20')],'include':_0x47bd63[_0x067f('0x1d')]?_[_0x067f('0x1f')](_0x47bd63[_0x067f('0x1d')],function(_0x20854b){return{'model':db[_0x20854b[_0x067f('0x1e')]],'as':_0x20854b['as'],'attributes':_0x20854b[_0x067f('0x20')],'include':_0x20854b['include']?_[_0x067f('0x1f')](_0x20854b[_0x067f('0x1d')],function(_0x4dc037){return{'model':db[_0x4dc037[_0x067f('0x1e')]],'as':_0x4dc037['as'],'attributes':_0x4dc037[_0x067f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x067f('0x10')](function(_0x24e2b6){logger[_0x067f('0x11')]('ShowMailQueue',_0x143af6);logger['debug'](_0x067f('0x23'),_0x143af6,JSON[_0x067f('0x15')](_0x24e2b6));_0x46a6cc(_0x24e2b6);})['catch'](function(_0x50e4c5){logger[_0x067f('0x16')]('ShowMailQueue',_0x50e4c5[_0x067f('0x18')],_0x143af6);_0x380e11(_0x5f49b6['error'](0x1f4,_0x50e4c5[_0x067f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 05dde38..90c42ed 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 _0xe206=['update','emit','removeListener','register','length','save','remove'];(function(_0x419b19,_0x2d68e8){var _0xb2d0c6=function(_0x50fec0){while(--_0x50fec0){_0x419b19['push'](_0x419b19['shift']());}};_0xb2d0c6(++_0x2d68e8);}(_0xe206,0x101));var _0x6e20=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xe206[_0x29db36];return _0x234e87;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6e20('0x0'),_0x6e20('0x1'),_0x6e20('0x2')];function createListener(_0x44161a,_0x5de7ff){return function(_0x4ae79c){_0x5de7ff[_0x6e20('0x3')](_0x44161a,_0x4ae79c);};}function removeListener(_0x4083fe,_0x4c0282){return function(){MailQueueEvents[_0x6e20('0x4')](_0x4083fe,_0x4c0282);};}exports[_0x6e20('0x5')]=function(_0x4dd6ba){for(var _0x196f64=0x0,_0x28ae32=events[_0x6e20('0x6')];_0x196f64<_0x28ae32;_0x196f64++){var _0x31176c=events[_0x196f64];var _0x50e088=createListener('mailQueue:'+_0x31176c,_0x4dd6ba);MailQueueEvents['on'](_0x31176c,_0x50e088);}}; \ No newline at end of file +var _0xe09a=['remove','update','emit','register','mailQueue:'];(function(_0x2dc15f,_0x35cb3f){var _0x4e0436=function(_0x125018){while(--_0x125018){_0x2dc15f['push'](_0x2dc15f['shift']());}};_0x4e0436(++_0x35cb3f);}(_0xe09a,0xaa));var _0xae09=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0xe09a[_0x30c7c5];return _0x29e24e;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xae09('0x0'),_0xae09('0x1')];function createListener(_0x4350e0,_0x919c84){return function(_0x1f1c11){_0x919c84[_0xae09('0x2')](_0x4350e0,_0x1f1c11);};}function removeListener(_0x3cd467,_0xbe2557){return function(){MailQueueEvents['removeListener'](_0x3cd467,_0xbe2557);};}exports[_0xae09('0x3')]=function(_0x574796){for(var _0x4c94f8=0x0,_0x31eed9=events['length'];_0x4c94f8<_0x31eed9;_0x4c94f8++){var _0x37a36b=events[_0x4c94f8];var _0x391a06=createListener(_0xae09('0x4')+_0x37a36b,_0x574796);MailQueueEvents['on'](_0x37a36b,_0x391a06);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7bef5c7..e5bb418 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 _0xa603=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','delete','destroy','multer','util'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xa603,0x178));var _0x3a60=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa603[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x3a60('0x0'));var util=require(_0x3a60('0x1'));var path=require(_0x3a60('0x2'));var timeout=require(_0x3a60('0x3'));var express=require(_0x3a60('0x4'));var router=express['Router']();var fs_extra=require(_0x3a60('0x5'));var auth=require(_0x3a60('0x6'));var interaction=require(_0x3a60('0x7'));var config=require(_0x3a60('0x8'));var controller=require(_0x3a60('0x9'));router[_0x3a60('0xa')]('/',auth[_0x3a60('0xb')](),controller[_0x3a60('0xc')]);router[_0x3a60('0xa')](_0x3a60('0xd'),auth[_0x3a60('0xb')](),controller[_0x3a60('0xe')]);router[_0x3a60('0xa')]('/:id',auth[_0x3a60('0xb')](),controller[_0x3a60('0xf')]);router[_0x3a60('0x10')]('/',auth[_0x3a60('0xb')](),controller['create']);router[_0x3a60('0x11')](_0x3a60('0x12'),auth[_0x3a60('0xb')](),controller['update']);router[_0x3a60('0x13')](_0x3a60('0x12'),auth[_0x3a60('0xb')](),controller[_0x3a60('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc491=['put','update','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','/describe','isAuthenticated','describe','get','/:id','post','create'];(function(_0x516f61,_0x278f18){var _0x3d7d33=function(_0x1016e2){while(--_0x1016e2){_0x516f61['push'](_0x516f61['shift']());}};_0x3d7d33(++_0x278f18);}(_0xc491,0x16b));var _0x1c49=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0xc491[_0x1e235e];return _0x1e8e94;};'use strict';var multer=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var path=require(_0x1c49('0x2'));var timeout=require(_0x1c49('0x3'));var express=require(_0x1c49('0x4'));var router=express[_0x1c49('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c49('0x6'));var controller=require(_0x1c49('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1c49('0x8'),auth[_0x1c49('0x9')](),controller[_0x1c49('0xa')]);router[_0x1c49('0xb')](_0x1c49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1c49('0xd')]('/',auth[_0x1c49('0x9')](),controller[_0x1c49('0xe')]);router[_0x1c49('0xf')](_0x1c49('0xc'),auth[_0x1c49('0x9')](),controller[_0x1c49('0x10')]);router['delete'](_0x1c49('0xc'),auth[_0x1c49('0x9')](),controller['destroy']);module[_0x1c49('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2797077..ad99178 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 _0x277c=['exports','STRING','DATE','moment'];(function(_0x2e3754,_0x430b9d){var _0x43f327=function(_0x238837){while(--_0x238837){_0x2e3754['push'](_0x2e3754['shift']());}};_0x43f327(++_0x430b9d);}(_0x277c,0x153));var _0xc277=function(_0x47820e,_0x29c785){_0x47820e=_0x47820e-0x0;var _0x1b7473=_0x277c[_0x47820e];return _0x1b7473;};'use strict';var moment=require(_0xc277('0x0'));var Sequelize=require('sequelize');module[_0xc277('0x1')]={'uniqueid':{'type':Sequelize[_0xc277('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc277('0x2')]},'joinAt':{'type':Sequelize[_0xc277('0x3')]},'leaveAt':{'type':Sequelize[_0xc277('0x3')]},'acceptAt':{'type':Sequelize[_0xc277('0x3')]},'exitAt':{'type':Sequelize[_0xc277('0x3')]},'reason':{'type':Sequelize[_0xc277('0x2')]}}; \ No newline at end of file +var _0x64d0=['sequelize','exports','STRING','DATE','moment'];(function(_0x33fdf1,_0x1faec7){var _0x14313b=function(_0x42507a){while(--_0x42507a){_0x33fdf1['push'](_0x33fdf1['shift']());}};_0x14313b(++_0x1faec7);}(_0x64d0,0x171));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x064d('0x0'));var Sequelize=require(_0x064d('0x1'));module[_0x064d('0x2')]={'uniqueid':{'type':Sequelize[_0x064d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x064d('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x064d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x064d('0x4')]},'reason':{'type':Sequelize[_0x064d('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index feaeb24..192ac34 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 _0x0b0e=['merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0x13fb80,_0x5a3d39){var _0x3733e8=function(_0x5c5655){while(--_0x5c5655){_0x13fb80['push'](_0x13fb80['shift']());}};_0x3733e8(++_0x5a3d39);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x0b0e[_0x4a3ee3];return _0x56d16d;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['MailQueueReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['MailQueueReport'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['MailQueueReport']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};exports[_0xe0b0('0x4a')]=function(_0x54cf7b,_0x4b65d1){return db[_0xe0b0('0x2a')][_0xe0b0('0x4a')]()[_0xe0b0('0x23')](respondWithResult(_0x4b65d1,null))[_0xe0b0('0x43')](handleError(_0x4b65d1,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x2d2153,_0x4509d6){var _0x20299e=function(_0x5cf09f){while(--_0x5cf09f){_0x2d2153['push'](_0x2d2153['shift']());}};_0x20299e(++_0x4509d6);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index eac3478..c46bb32 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 _0x05eb=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid'];(function(_0x4c9d58,_0x1c83f0){var _0x3ad22d=function(_0xd95048){while(--_0xd95048){_0x4c9d58['push'](_0x4c9d58['shift']());}};_0x3ad22d(++_0x1c83f0);}(_0x05eb,0x1bc));var _0xb05e=function(_0x441bb1,_0x1eea34){_0x441bb1=_0x441bb1-0x0;var _0x5b03ff=_0x05eb[_0x441bb1];return _0x5b03ff;};'use strict';var _=require(_0xb05e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb05e('0x1'));var moment=require(_0xb05e('0x2'));var BPromise=require(_0xb05e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb05e('0x4'));var rimraf=require(_0xb05e('0x5'));var config=require(_0xb05e('0x6'));var attributes=require(_0xb05e('0x7'));module[_0xb05e('0x8')]=function(_0x5de4fd,_0x9bd4c){return _0x5de4fd[_0xb05e('0x9')]('MailQueueReport',attributes,{'tableName':_0xb05e('0xa'),'paranoid':![],'indexes':[{'name':_0xb05e('0xb'),'fields':[_0xb05e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55de=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailQueueReport'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x55de,0x1ef));var _0xe55d=function(_0x1341a8,_0x31b787){_0x1341a8=_0x1341a8-0x0;var _0x551b2d=_0x55de[_0x1341a8];return _0x551b2d;};'use strict';var _=require(_0xe55d('0x0'));var util=require(_0xe55d('0x1'));var logger=require(_0xe55d('0x2'))(_0xe55d('0x3'));var moment=require(_0xe55d('0x4'));var BPromise=require(_0xe55d('0x5'));var rp=require(_0xe55d('0x6'));var fs=require('fs');var path=require(_0xe55d('0x7'));var rimraf=require(_0xe55d('0x8'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xe55d('0x9')]=function(_0xa76859,_0x294745){return _0xa76859[_0xe55d('0xa')](_0xe55d('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xe55d('0xc'),'fields':[_0xe55d('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 1e63d5f..a0ae791 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x302a02,_0x34f365){var _0x2b1d2d=function(_0x5ea1fe){while(--_0x5ea1fe){_0x302a02['push'](_0x302a02['shift']());}};_0x2b1d2d(++_0x34f365);}(_0x326f,0xd1));var _0xf326=function(_0x4eb928,_0x1fad0d){_0x4eb928=_0x4eb928-0x0;var _0xd985d8=_0x326f[_0x4eb928];return _0xd985d8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x223197,_0x43dcb7){var _0x22f98b=function(_0x284673){while(--_0x284673){_0x223197['push'](_0x223197['shift']());}};_0x22f98b(++_0x43dcb7);}(_0x7a54,0x106));var _0x47a5=function(_0x283ecb,_0x52ae00){_0x283ecb=_0x283ecb-0x0;var _0x44532f=_0x7a54[_0x283ecb];return _0x44532f;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index c67008e..37e1ad4 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xa7c249,_0x599b5e){var _0x1a9b26=function(_0x2b8797){while(--_0x2b8797){_0xa7c249['push'](_0xa7c249['shift']());}};_0x1a9b26(++_0x599b5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xc069,_0x3005d6){var _0x3f143c=function(_0x2de702){while(--_0x2de702){_0xc069['push'](_0xc069['shift']());}};_0x3f143c(++_0x3005d6);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index fe58c3c..9335f72 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 _0xbbb4=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x28592f,_0x424870){var _0x2d3e15=function(_0x410eb2){while(--_0x410eb2){_0x28592f['push'](_0x28592f['shift']());}};_0x2d3e15(++_0x424870);}(_0xbbb4,0xe0));var _0x4bbb=function(_0x40f64c,_0x19b59c){_0x40f64c=_0x40f64c-0x0;var _0x3ed3e5=_0xbbb4[_0x40f64c];return _0x3ed3e5;};'use strict';var Sequelize=require('sequelize');module[_0x4bbb('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4bbb('0x1')]},'authentication':{'type':Sequelize[_0x4bbb('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4bbb('0x3')]},'tls':{'type':Sequelize[_0x4bbb('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4bbb('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x4bbb('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4bbb('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4bbb('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xecef=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x2f42d3,_0x362e7a){var _0x25a67e=function(_0x103ce2){while(--_0x103ce2){_0x2f42d3['push'](_0x2f42d3['shift']());}};_0x25a67e(++_0x362e7a);}(_0xecef,0xdd));var _0xfece=function(_0x455ad6,_0x3500ca){_0x455ad6=_0x455ad6-0x0;var _0x539d64=_0xecef[_0x455ad6];return _0x539d64;};'use strict';var Sequelize=require(_0xfece('0x0'));module[_0xfece('0x1')]={'description':{'type':Sequelize[_0xfece('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xfece('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfece('0x2')]},'port':{'type':Sequelize[_0xfece('0x4')]},'tls':{'type':Sequelize[_0xfece('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xfece('0x2')],'defaultValue':_0xfece('0x5')},'connTimeout':{'type':Sequelize[_0xfece('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xfece('0x2')]},'modernAuthentication':{'type':Sequelize[_0xfece('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 10326a1..2808456 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 _0xca10=['define','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x54f3cb,_0xca1fa1){var _0x231f27=function(_0x43941e){while(--_0x43941e){_0x54f3cb['push'](_0x54f3cb['shift']());}};_0x231f27(++_0xca1fa1);}(_0xca10,0x141));var _0x0ca1=function(_0xbb81d5,_0x52ffe0){_0xbb81d5=_0xbb81d5-0x0;var _0x1acacc=_0xca10[_0xbb81d5];return _0x1acacc;};'use strict';var _=require('lodash');var util=require(_0x0ca1('0x0'));var logger=require('../../config/logger')(_0x0ca1('0x1'));var moment=require(_0x0ca1('0x2'));var BPromise=require(_0x0ca1('0x3'));var rp=require(_0x0ca1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ca1('0x5'));var config=require(_0x0ca1('0x6'));var attributes=require(_0x0ca1('0x7'));module[_0x0ca1('0x8')]=function(_0x11d10a,_0x12639b){return _0x11d10a[_0x0ca1('0x9')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4273=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x4273,0xcb));var _0x3427=function(_0x100e68,_0x245f74){_0x100e68=_0x100e68-0x0;var _0x173234=_0x4273[_0x100e68];return _0x173234;};'use strict';var _=require(_0x3427('0x0'));var util=require(_0x3427('0x1'));var logger=require(_0x3427('0x2'))('api');var moment=require(_0x3427('0x3'));var BPromise=require(_0x3427('0x4'));var rp=require(_0x3427('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3427('0x6'));var config=require('../../config/environment');var attributes=require(_0x3427('0x7'));module[_0x3427('0x8')]=function(_0x295bd1,_0x179b04){return _0x295bd1[_0x3427('0x9')](_0x3427('0xa'),attributes,{'tableName':_0x3427('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 dddbecc..9471671 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 _0xdb76=['debug','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x118432,_0x34d34f){var _0x5ad711=function(_0x220467){while(--_0x220467){_0x118432['push'](_0x118432['shift']());}};_0x5ad711(++_0x34d34f);}(_0xdb76,0x1be));var _0x6db7=function(_0x1d823c,_0x18f39b){_0x1d823c=_0x1d823c-0x0;var _0x4b89fe=_0xdb76[_0x1d823c];return _0x4b89fe;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var moment=require(_0x6db7('0x2'));var BPromise=require(_0x6db7('0x3'));var rs=require(_0x6db7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db7('0x5'))['db'];var utils=require(_0x6db7('0x6'));var logger=require(_0x6db7('0x7'))(_0x6db7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6db7('0x9'));var client=jayson[_0x6db7('0xa')][_0x6db7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x417e71,_0x3b7b8a,_0x58f6e4){return new BPromise(function(_0x1c7f92,_0x3df405){return client['request'](_0x417e71,_0x58f6e4)[_0x6db7('0xc')](function(_0x40735e){logger[_0x6db7('0xd')](_0x6db7('0xe'),_0x3b7b8a,_0x6db7('0xf'));logger[_0x6db7('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x3b7b8a,'request\x20sent',JSON[_0x6db7('0x11')](_0x40735e));if(_0x40735e[_0x6db7('0x12')]){if(_0x40735e['error'][_0x6db7('0x13')]===0x1f4){logger[_0x6db7('0x12')](_0x6db7('0xe'),_0x3b7b8a,_0x40735e[_0x6db7('0x12')][_0x6db7('0x14')]);return _0x3df405(_0x40735e[_0x6db7('0x12')]['message']);}logger['error'](_0x6db7('0xe'),_0x3b7b8a,_0x40735e[_0x6db7('0x12')][_0x6db7('0x14')]);return _0x1c7f92(_0x40735e[_0x6db7('0x12')][_0x6db7('0x14')]);}else{logger[_0x6db7('0xd')](_0x6db7('0xe'),_0x3b7b8a,_0x6db7('0xf'));_0x1c7f92(_0x40735e[_0x6db7('0x15')][_0x6db7('0x14')]);}})[_0x6db7('0x16')](function(_0x3ba044){logger['error'](_0x6db7('0xe'),_0x3b7b8a,_0x3ba044);_0x3df405(_0x3ba044);});});}exports[_0x6db7('0x17')]=function(_0x331e92){var _0x53ea04=this;return new Promise(function(_0x37ffe3,_0x272bda){return db[_0x6db7('0x18')][_0x6db7('0x19')]({'raw':_0x331e92[_0x6db7('0x1a')]?_0x331e92[_0x6db7('0x1a')][_0x6db7('0x1b')]===undefined?!![]:![]:!![],'where':_0x331e92[_0x6db7('0x1a')]?_0x331e92['options'][_0x6db7('0x1c')]||null:null,'attributes':_0x331e92[_0x6db7('0x1a')]?_0x331e92[_0x6db7('0x1a')][_0x6db7('0x1d')]||null:null,'limit':_0x331e92[_0x6db7('0x1a')]?_0x331e92[_0x6db7('0x1a')]['limit']||null:null,'include':_0x331e92[_0x6db7('0x1a')]?_0x331e92[_0x6db7('0x1a')]['include']?_[_0x6db7('0x1e')](_0x331e92[_0x6db7('0x1a')][_0x6db7('0x1f')],function(_0x48e3af){return{'model':db[_0x48e3af[_0x6db7('0x20')]],'as':_0x48e3af['as'],'attributes':_0x48e3af[_0x6db7('0x1d')],'include':_0x48e3af['include']?_[_0x6db7('0x1e')](_0x48e3af[_0x6db7('0x1f')],function(_0x2d6fca){return{'model':db[_0x2d6fca['model']],'as':_0x2d6fca['as'],'attributes':_0x2d6fca['attributes'],'include':_0x2d6fca[_0x6db7('0x1f')]?_[_0x6db7('0x1e')](_0x2d6fca[_0x6db7('0x1f')],function(_0x4f28e9){return{'model':db[_0x4f28e9[_0x6db7('0x20')]],'as':_0x4f28e9['as'],'attributes':_0x4f28e9[_0x6db7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c090){logger[_0x6db7('0xd')](_0x6db7('0x17'),_0x331e92);logger[_0x6db7('0x10')](_0x6db7('0x17'),_0x331e92,JSON[_0x6db7('0x11')](_0x47c090));_0x37ffe3(_0x47c090);})[_0x6db7('0x16')](function(_0x4fb6dd){logger[_0x6db7('0x12')](_0x6db7('0x17'),_0x4fb6dd['message'],_0x331e92);_0x272bda(_0x53ea04[_0x6db7('0x12')](0x1f4,_0x4fb6dd['message']));});});}; \ No newline at end of file +var _0x2b51=['../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2bb89a,_0x376448){var _0x21dbc7=function(_0x278f22){while(--_0x278f22){_0x2bb89a['push'](_0x2bb89a['shift']());}};_0x21dbc7(++_0x376448);}(_0x2b51,0xe7));var _0x12b5=function(_0xfec10e,_0x277ad5){_0xfec10e=_0xfec10e-0x0;var _0x2a3331=_0x2b51[_0xfec10e];return _0x2a3331;};'use strict';var _=require(_0x12b5('0x0'));var util=require(_0x12b5('0x1'));var moment=require(_0x12b5('0x2'));var BPromise=require(_0x12b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12b5('0x4'));var db=require(_0x12b5('0x5'))['db'];var utils=require(_0x12b5('0x6'));var logger=require(_0x12b5('0x7'))('rpc');var config=require(_0x12b5('0x8'));var jayson=require(_0x12b5('0x9'));var client=jayson['client'][_0x12b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5efae3,_0x26f3fe,_0x2114d9){return new BPromise(function(_0x5698c5,_0x5dae37){return client[_0x12b5('0xb')](_0x5efae3,_0x2114d9)['then'](function(_0x348d0f){logger[_0x12b5('0xc')]('MailServerIn,\x20%s,\x20%s',_0x26f3fe,_0x12b5('0xd'));logger[_0x12b5('0xe')](_0x12b5('0xf'),_0x26f3fe,_0x12b5('0xd'),JSON['stringify'](_0x348d0f));if(_0x348d0f[_0x12b5('0x10')]){if(_0x348d0f['error'][_0x12b5('0x11')]===0x1f4){logger[_0x12b5('0x10')](_0x12b5('0x12'),_0x26f3fe,_0x348d0f[_0x12b5('0x10')][_0x12b5('0x13')]);return _0x5dae37(_0x348d0f['error'][_0x12b5('0x13')]);}logger[_0x12b5('0x10')](_0x12b5('0x12'),_0x26f3fe,_0x348d0f['error'][_0x12b5('0x13')]);return _0x5698c5(_0x348d0f[_0x12b5('0x10')][_0x12b5('0x13')]);}else{logger[_0x12b5('0xc')](_0x12b5('0x12'),_0x26f3fe,_0x12b5('0xd'));_0x5698c5(_0x348d0f['result']['message']);}})[_0x12b5('0x14')](function(_0x332b7f){logger[_0x12b5('0x10')]('MailServerIn,\x20%s,\x20%s',_0x26f3fe,_0x332b7f);_0x5dae37(_0x332b7f);});});}exports[_0x12b5('0x15')]=function(_0xe1a0e3){var _0x3336ea=this;return new Promise(function(_0x41c06e,_0x23476a){return db[_0x12b5('0x16')][_0x12b5('0x17')]({'raw':_0xe1a0e3['options']?_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x19')]===undefined?!![]:![]:!![],'where':_0xe1a0e3[_0x12b5('0x18')]?_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x1a')]||null:null,'attributes':_0xe1a0e3['options']?_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x1b')]||null:null,'limit':_0xe1a0e3[_0x12b5('0x18')]?_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x1c')]||null:null,'include':_0xe1a0e3[_0x12b5('0x18')]?_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x1d')]?_[_0x12b5('0x1e')](_0xe1a0e3[_0x12b5('0x18')][_0x12b5('0x1d')],function(_0xd882dc){return{'model':db[_0xd882dc[_0x12b5('0x1f')]],'as':_0xd882dc['as'],'attributes':_0xd882dc['attributes'],'include':_0xd882dc[_0x12b5('0x1d')]?_[_0x12b5('0x1e')](_0xd882dc[_0x12b5('0x1d')],function(_0x5bbeed){return{'model':db[_0x5bbeed[_0x12b5('0x1f')]],'as':_0x5bbeed['as'],'attributes':_0x5bbeed[_0x12b5('0x1b')],'include':_0x5bbeed[_0x12b5('0x1d')]?_['map'](_0x5bbeed[_0x12b5('0x1d')],function(_0x530822){return{'model':db[_0x530822[_0x12b5('0x1f')]],'as':_0x530822['as'],'attributes':_0x530822[_0x12b5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12b5('0x20')](function(_0x2047d7){logger[_0x12b5('0xc')](_0x12b5('0x15'),_0xe1a0e3);logger[_0x12b5('0xe')]('GetMailServerIn',_0xe1a0e3,JSON[_0x12b5('0x21')](_0x2047d7));_0x41c06e(_0x2047d7);})['catch'](function(_0x49b7c9){logger['error']('GetMailServerIn',_0x49b7c9[_0x12b5('0x13')],_0xe1a0e3);_0x23476a(_0x3336ea[_0x12b5('0x10')](0x1f4,_0x49b7c9[_0x12b5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7a7ff12..16fb740 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 _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(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 +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(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 8c4bf3d..eab8a7d 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 _0xd4f4=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x20fdfc,_0xbc387d){var _0x5080ef=function(_0x163854){while(--_0x163854){_0x20fdfc['push'](_0x20fdfc['shift']());}};_0x5080ef(++_0xbc387d);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x55f2cf,_0x495a00){_0x55f2cf=_0x55f2cf-0x0;var _0x132f82=_0xd4f4[_0x55f2cf];return _0x132f82;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'description':{'type':Sequelize[_0x4d4f('0x2')]},'host':{'type':Sequelize[_0x4d4f('0x2')]},'user':{'type':Sequelize[_0x4d4f('0x2')]},'pass':{'type':Sequelize[_0x4d4f('0x2')]},'port':{'type':Sequelize[_0x4d4f('0x3')]},'secure':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d4f('0x2')]},'authentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xda3f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xda3f,0xec));var _0xfda3=function(_0x49cada,_0x41f626){_0x49cada=_0x49cada-0x0;var _0x42f00b=_0xda3f[_0x49cada];return _0x42f00b;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'description':{'type':Sequelize[_0xfda3('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfda3('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xfda3('0x1')]},'authentication':{'type':Sequelize[_0xfda3('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 8a2eade..c9707b0 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 _0x8766=['keys','filters','model','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','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/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','then','destroy','error','stack','name','send','map','MailServerOut','type','key','query'];(function(_0x3f109a,_0x249aa9){var _0x2fc2cf=function(_0x1fb17f){while(--_0x1fb17f){_0x3f109a['push'](_0x3f109a['shift']());}};_0x2fc2cf(++_0x249aa9);}(_0x8766,0x17d));var _0x6876=function(_0x4a673b,_0xd7824){_0x4a673b=_0x4a673b-0x0;var _0x5e9f53=_0x8766[_0x4a673b];return _0x5e9f53;};'use strict';var emlformat=require(_0x6876('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6876('0x1'));var jsonpatch=require(_0x6876('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6876('0x3'));var Mustache=require(_0x6876('0x4'));var util=require(_0x6876('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6876('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6876('0x7'));var _=require(_0x6876('0x8'));var squel=require(_0x6876('0x9'));var crypto=require(_0x6876('0xa'));var jsforce=require(_0x6876('0xb'));var deskjs=require(_0x6876('0xc'));var toCsv=require(_0x6876('0x6'));var querystring=require('querystring');var Papa=require(_0x6876('0xd'));var Redis=require(_0x6876('0xe'));var authService=require(_0x6876('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6876('0x10'));var hardwareService=require(_0x6876('0x11'));var logger=require(_0x6876('0x12'))(_0x6876('0x13'));var utils=require(_0x6876('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6876('0x15'));var db=require(_0x6876('0x16'))['db'];function respondWithStatusCode(_0x429c0b,_0x2b8f0e){_0x2b8f0e=_0x2b8f0e||0xcc;return function(_0x220d43){if(_0x220d43){return _0x429c0b[_0x6876('0x17')](_0x2b8f0e);}return _0x429c0b['status'](_0x2b8f0e)[_0x6876('0x18')]();};}function respondWithResult(_0x53355,_0x444fb6){_0x444fb6=_0x444fb6||0xc8;return function(_0xf0605b){if(_0xf0605b){return _0x53355['status'](_0x444fb6)[_0x6876('0x19')](_0xf0605b);}};}function respondWithFilteredResult(_0xbdf210,_0x4b2baa){return function(_0x371ffd){if(_0x371ffd){var _0x517a64=typeof _0x4b2baa[_0x6876('0x1a')]===_0x6876('0x1b')&&typeof _0x4b2baa['limit']==='undefined';var _0x3d419a=_0x371ffd[_0x6876('0x1c')];var _0x4fea40=_0x517a64?0x0:_0x4b2baa[_0x6876('0x1a')];var _0x20fa31=_0x517a64?_0x371ffd[_0x6876('0x1c')]:_0x4b2baa[_0x6876('0x1a')]+_0x4b2baa[_0x6876('0x1d')];var _0x3b805a;if(_0x20fa31>=_0x3d419a){_0x20fa31=_0x3d419a;_0x3b805a=0xc8;}else{_0x3b805a=0xce;}_0xbdf210[_0x6876('0x1e')](_0x3b805a);return _0xbdf210[_0x6876('0x1f')]('Content-Range',_0x4fea40+'-'+_0x20fa31+'/'+_0x3d419a)[_0x6876('0x19')](_0x371ffd);}return null;};}function patchUpdates(_0x50f660){return function(_0x16301e){try{jsonpatch[_0x6876('0x20')](_0x16301e,_0x50f660,!![]);}catch(_0x2524b6){return BPromise[_0x6876('0x21')](_0x2524b6);}return _0x16301e['save']();};}function saveUpdates(_0x32c75a,_0x13dd20){return function(_0x32c8ca){if(_0x32c8ca){return _0x32c8ca['update'](_0x32c75a)[_0x6876('0x22')](function(_0x4ef95d){return _0x4ef95d;});}return null;};}function removeEntity(_0x4e9c20,_0x36ca91){return function(_0x24cb44){if(_0x24cb44){return _0x24cb44[_0x6876('0x23')]()[_0x6876('0x22')](function(){_0x4e9c20['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e178,_0x287e2e){return function(_0x1456c0){if(!_0x1456c0){_0x32e178[_0x6876('0x17')](0x194);}return _0x1456c0;};}function handleError(_0x42a09e,_0x36b9a6){_0x36b9a6=_0x36b9a6||0x1f4;return function(_0x517833){logger[_0x6876('0x24')](_0x517833[_0x6876('0x25')]);if(_0x517833[_0x6876('0x26')]){delete _0x517833[_0x6876('0x26')];}_0x42a09e[_0x6876('0x1e')](_0x36b9a6)[_0x6876('0x27')](_0x517833);};}exports['index']=function(_0x4909a4,_0x1ae91a){var _0x5791ac={},_0x5df422={},_0xec8782={'count':0x0,'rows':[]};var _0x23d53f=_[_0x6876('0x28')](db[_0x6876('0x29')]['rawAttributes'],function(_0x14d7bb){return{'name':_0x14d7bb['fieldName'],'type':_0x14d7bb[_0x6876('0x2a')][_0x6876('0x2b')]};});_0x5df422['model']=_['map'](_0x23d53f,'name');_0x5df422[_0x6876('0x2c')]=_[_0x6876('0x2d')](_0x4909a4[_0x6876('0x2c')]);_0x5df422[_0x6876('0x2e')]=_['intersection'](_0x5df422[_0x6876('0x2f')],_0x5df422[_0x6876('0x2c')]);_0x5791ac['attributes']=_[_0x6876('0x30')](_0x5df422[_0x6876('0x2f')],qs['fields'](_0x4909a4[_0x6876('0x2c')]['fields']));_0x5791ac[_0x6876('0x31')]=_0x5791ac[_0x6876('0x31')][_0x6876('0x32')]?_0x5791ac[_0x6876('0x31')]:_0x5df422[_0x6876('0x2f')];if(!_0x4909a4['query'][_0x6876('0x33')](_0x6876('0x34'))){_0x5791ac['limit']=qs[_0x6876('0x1d')](_0x4909a4['query'][_0x6876('0x1d')]);_0x5791ac[_0x6876('0x1a')]=qs[_0x6876('0x1a')](_0x4909a4['query'][_0x6876('0x1a')]);}_0x5791ac['order']=qs['sort'](_0x4909a4[_0x6876('0x2c')][_0x6876('0x35')]);_0x5791ac['where']=qs[_0x6876('0x2e')](_[_0x6876('0x36')](_0x4909a4[_0x6876('0x2c')],_0x5df422['filters']),_0x23d53f);if(_0x4909a4[_0x6876('0x2c')]['filter']){_0x5791ac[_0x6876('0x37')]=_[_0x6876('0x38')](_0x5791ac[_0x6876('0x37')],{'$or':_[_0x6876('0x28')](_0x23d53f,function(_0x5ed832){if(_0x5ed832[_0x6876('0x2a')]!==_0x6876('0x39')){var _0x1ae75e={};_0x1ae75e[_0x5ed832[_0x6876('0x26')]]={'$like':'%'+_0x4909a4['query'][_0x6876('0x3a')]+'%'};return _0x1ae75e;}})});}_0x5791ac=_[_0x6876('0x38')]({},_0x5791ac,_0x4909a4[_0x6876('0x3b')]);var _0x4bf02b={'where':_0x5791ac[_0x6876('0x37')]};return db[_0x6876('0x29')][_0x6876('0x1c')](_0x4bf02b)[_0x6876('0x22')](function(_0x3f5865){_0xec8782[_0x6876('0x1c')]=_0x3f5865;if(_0x4909a4[_0x6876('0x2c')][_0x6876('0x3c')]){_0x5791ac[_0x6876('0x3d')]=[{'all':!![]}];}return db[_0x6876('0x29')][_0x6876('0x3e')](_0x5791ac);})[_0x6876('0x22')](function(_0x548401){_0xec8782[_0x6876('0x3f')]=_0x548401;return _0xec8782;})[_0x6876('0x22')](respondWithFilteredResult(_0x1ae91a,_0x5791ac))[_0x6876('0x40')](handleError(_0x1ae91a,null));};exports[_0x6876('0x41')]=function(_0x47cbde,_0x495554){var _0x4f0f2a={'raw':!![],'where':{'id':_0x47cbde[_0x6876('0x42')]['id']}},_0xc842f4={};_0xc842f4[_0x6876('0x2f')]=_[_0x6876('0x2d')](db['MailServerOut'][_0x6876('0x43')]);_0xc842f4[_0x6876('0x2c')]=_[_0x6876('0x2d')](_0x47cbde['query']);_0xc842f4[_0x6876('0x2e')]=_[_0x6876('0x30')](_0xc842f4[_0x6876('0x2f')],_0xc842f4['query']);_0x4f0f2a[_0x6876('0x31')]=_[_0x6876('0x30')](_0xc842f4[_0x6876('0x2f')],qs['fields'](_0x47cbde[_0x6876('0x2c')]['fields']));_0x4f0f2a['attributes']=_0x4f0f2a[_0x6876('0x31')][_0x6876('0x32')]?_0x4f0f2a['attributes']:_0xc842f4['model'];if(_0x47cbde[_0x6876('0x2c')]['includeAll']){_0x4f0f2a[_0x6876('0x3d')]=[{'all':!![]}];}_0x4f0f2a=_[_0x6876('0x38')]({},_0x4f0f2a,_0x47cbde[_0x6876('0x3b')]);return db['MailServerOut'][_0x6876('0x44')](_0x4f0f2a)['then'](handleEntityNotFound(_0x495554,null))[_0x6876('0x22')](respondWithResult(_0x495554,null))['catch'](handleError(_0x495554,null));};exports[_0x6876('0x45')]=function(_0x31d418,_0x2e56df){return db[_0x6876('0x29')][_0x6876('0x45')](_0x31d418[_0x6876('0x46')],{})['then'](respondWithResult(_0x2e56df,0xc9))[_0x6876('0x40')](handleError(_0x2e56df,null));};exports['update']=function(_0x42f132,_0x172f88){if(_0x42f132[_0x6876('0x46')]['id']){delete _0x42f132[_0x6876('0x46')]['id'];}return db[_0x6876('0x29')]['find']({'where':{'id':_0x42f132[_0x6876('0x42')]['id']}})[_0x6876('0x22')](handleEntityNotFound(_0x172f88,null))[_0x6876('0x22')](saveUpdates(_0x42f132['body'],null))[_0x6876('0x22')](respondWithResult(_0x172f88,null))[_0x6876('0x40')](handleError(_0x172f88,null));};exports[_0x6876('0x23')]=function(_0x3fc629,_0x1f2646){return db[_0x6876('0x29')][_0x6876('0x44')]({'where':{'id':_0x3fc629[_0x6876('0x42')]['id']}})[_0x6876('0x22')](handleEntityNotFound(_0x1f2646,null))[_0x6876('0x22')](removeEntity(_0x1f2646,null))[_0x6876('0x40')](handleError(_0x1f2646,null));}; \ No newline at end of file +var _0x9040=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','params','find'];(function(_0x5df2df,_0x34d2f5){var _0x69a0af=function(_0x5241d2){while(--_0x5241d2){_0x5df2df['push'](_0x5df2df['shift']());}};_0x69a0af(++_0x34d2f5);}(_0x9040,0x13a));var _0x0904=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9040[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0904('0x0'));var zipdir=require(_0x0904('0x1'));var jsonpatch=require(_0x0904('0x2'));var rp=require(_0x0904('0x3'));var moment=require(_0x0904('0x4'));var BPromise=require(_0x0904('0x5'));var Mustache=require(_0x0904('0x6'));var util=require(_0x0904('0x7'));var path=require(_0x0904('0x8'));var sox=require(_0x0904('0x9'));var csv=require(_0x0904('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0904('0xb'));var _=require(_0x0904('0xc'));var squel=require('squel');var crypto=require(_0x0904('0xd'));var jsforce=require(_0x0904('0xe'));var deskjs=require(_0x0904('0xf'));var toCsv=require(_0x0904('0xa'));var querystring=require(_0x0904('0x10'));var Papa=require(_0x0904('0x11'));var Redis=require(_0x0904('0x12'));var authService=require(_0x0904('0x13'));var qs=require(_0x0904('0x14'));var as=require(_0x0904('0x15'));var hardwareService=require(_0x0904('0x16'));var logger=require(_0x0904('0x17'))(_0x0904('0x18'));var utils=require(_0x0904('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0904('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x384695,_0x164e0b){_0x164e0b=_0x164e0b||0xcc;return function(_0x4a5d92){if(_0x4a5d92){return _0x384695[_0x0904('0x1b')](_0x164e0b);}return _0x384695[_0x0904('0x1c')](_0x164e0b)[_0x0904('0x1d')]();};}function respondWithResult(_0x4dfa25,_0x5b8ece){_0x5b8ece=_0x5b8ece||0xc8;return function(_0x274c8a){if(_0x274c8a){return _0x4dfa25[_0x0904('0x1c')](_0x5b8ece)['json'](_0x274c8a);}};}function respondWithFilteredResult(_0x5489bd,_0x30375a){return function(_0x33484d){if(_0x33484d){var _0x91201a=typeof _0x30375a[_0x0904('0x1e')]==='undefined'&&typeof _0x30375a[_0x0904('0x1f')]===_0x0904('0x20');var _0xc732cf=_0x33484d[_0x0904('0x21')];var _0x1bdc5c=_0x91201a?0x0:_0x30375a['offset'];var _0x194643=_0x91201a?_0x33484d[_0x0904('0x21')]:_0x30375a['offset']+_0x30375a['limit'];var _0x235813;if(_0x194643>=_0xc732cf){_0x194643=_0xc732cf;_0x235813=0xc8;}else{_0x235813=0xce;}_0x5489bd['status'](_0x235813);return _0x5489bd[_0x0904('0x22')](_0x0904('0x23'),_0x1bdc5c+'-'+_0x194643+'/'+_0xc732cf)[_0x0904('0x24')](_0x33484d);}return null;};}function patchUpdates(_0x40d97c){return function(_0x201a82){try{jsonpatch[_0x0904('0x25')](_0x201a82,_0x40d97c,!![]);}catch(_0x446126){return BPromise[_0x0904('0x26')](_0x446126);}return _0x201a82[_0x0904('0x27')]();};}function saveUpdates(_0x3a9c6e,_0x8d153e){return function(_0x29241f){if(_0x29241f){return _0x29241f[_0x0904('0x28')](_0x3a9c6e)[_0x0904('0x29')](function(_0x509c4c){return _0x509c4c;});}return null;};}function removeEntity(_0x5ca0c4,_0x265ffe){return function(_0x33eb70){if(_0x33eb70){return _0x33eb70[_0x0904('0x2a')]()[_0x0904('0x29')](function(){_0x5ca0c4[_0x0904('0x1c')](0xcc)[_0x0904('0x1d')]();});}};}function handleEntityNotFound(_0x498f00,_0xb33559){return function(_0x230671){if(!_0x230671){_0x498f00[_0x0904('0x1b')](0x194);}return _0x230671;};}function handleError(_0x92f498,_0x54b58e){_0x54b58e=_0x54b58e||0x1f4;return function(_0x42d7e0){logger[_0x0904('0x2b')](_0x42d7e0[_0x0904('0x2c')]);if(_0x42d7e0['name']){delete _0x42d7e0[_0x0904('0x2d')];}_0x92f498[_0x0904('0x1c')](_0x54b58e)[_0x0904('0x2e')](_0x42d7e0);};}exports[_0x0904('0x2f')]=function(_0x4c4547,_0x5097b3){var _0x26275b={},_0x19bc2a={},_0x5cd1ab={'count':0x0,'rows':[]};var _0x592e1e=_[_0x0904('0x30')](db[_0x0904('0x31')][_0x0904('0x32')],function(_0x2429c7){return{'name':_0x2429c7[_0x0904('0x33')],'type':_0x2429c7['type'][_0x0904('0x34')]};});_0x19bc2a['model']=_['map'](_0x592e1e,_0x0904('0x2d'));_0x19bc2a[_0x0904('0x35')]=_['keys'](_0x4c4547[_0x0904('0x35')]);_0x19bc2a[_0x0904('0x36')]=_[_0x0904('0x37')](_0x19bc2a[_0x0904('0x38')],_0x19bc2a[_0x0904('0x35')]);_0x26275b[_0x0904('0x39')]=_[_0x0904('0x37')](_0x19bc2a[_0x0904('0x38')],qs[_0x0904('0x3a')](_0x4c4547[_0x0904('0x35')][_0x0904('0x3a')]));_0x26275b[_0x0904('0x39')]=_0x26275b[_0x0904('0x39')][_0x0904('0x3b')]?_0x26275b[_0x0904('0x39')]:_0x19bc2a['model'];if(!_0x4c4547['query'][_0x0904('0x3c')](_0x0904('0x3d'))){_0x26275b['limit']=qs[_0x0904('0x1f')](_0x4c4547[_0x0904('0x35')]['limit']);_0x26275b[_0x0904('0x1e')]=qs['offset'](_0x4c4547[_0x0904('0x35')][_0x0904('0x1e')]);}_0x26275b['order']=qs[_0x0904('0x3e')](_0x4c4547['query'][_0x0904('0x3e')]);_0x26275b[_0x0904('0x3f')]=qs[_0x0904('0x36')](_[_0x0904('0x40')](_0x4c4547[_0x0904('0x35')],_0x19bc2a[_0x0904('0x36')]),_0x592e1e);if(_0x4c4547[_0x0904('0x35')][_0x0904('0x41')]){_0x26275b[_0x0904('0x3f')]=_['merge'](_0x26275b['where'],{'$or':_[_0x0904('0x30')](_0x592e1e,function(_0x478db1){if(_0x478db1[_0x0904('0x42')]!=='VIRTUAL'){var _0x4c4e8e={};_0x4c4e8e[_0x478db1[_0x0904('0x2d')]]={'$like':'%'+_0x4c4547[_0x0904('0x35')][_0x0904('0x41')]+'%'};return _0x4c4e8e;}})});}_0x26275b=_[_0x0904('0x43')]({},_0x26275b,_0x4c4547[_0x0904('0x44')]);var _0x2b03e7={'where':_0x26275b['where']};return db[_0x0904('0x31')][_0x0904('0x21')](_0x2b03e7)['then'](function(_0x47b1f7){_0x5cd1ab[_0x0904('0x21')]=_0x47b1f7;if(_0x4c4547['query'][_0x0904('0x45')]){_0x26275b[_0x0904('0x46')]=[{'all':!![]}];}return db[_0x0904('0x31')][_0x0904('0x47')](_0x26275b);})[_0x0904('0x29')](function(_0x3275c8){_0x5cd1ab[_0x0904('0x48')]=_0x3275c8;return _0x5cd1ab;})[_0x0904('0x29')](respondWithFilteredResult(_0x5097b3,_0x26275b))[_0x0904('0x49')](handleError(_0x5097b3,null));};exports['show']=function(_0x16c244,_0xfe34fa){var _0xe08241={'raw':!![],'where':{'id':_0x16c244[_0x0904('0x4a')]['id']}},_0x48147={};_0x48147[_0x0904('0x38')]=_['keys'](db['MailServerOut'][_0x0904('0x32')]);_0x48147[_0x0904('0x35')]=_['keys'](_0x16c244[_0x0904('0x35')]);_0x48147['filters']=_['intersection'](_0x48147[_0x0904('0x38')],_0x48147[_0x0904('0x35')]);_0xe08241['attributes']=_[_0x0904('0x37')](_0x48147[_0x0904('0x38')],qs[_0x0904('0x3a')](_0x16c244[_0x0904('0x35')][_0x0904('0x3a')]));_0xe08241[_0x0904('0x39')]=_0xe08241[_0x0904('0x39')][_0x0904('0x3b')]?_0xe08241[_0x0904('0x39')]:_0x48147['model'];if(_0x16c244[_0x0904('0x35')][_0x0904('0x45')]){_0xe08241['include']=[{'all':!![]}];}_0xe08241=_[_0x0904('0x43')]({},_0xe08241,_0x16c244[_0x0904('0x44')]);return db[_0x0904('0x31')][_0x0904('0x4b')](_0xe08241)[_0x0904('0x29')](handleEntityNotFound(_0xfe34fa,null))[_0x0904('0x29')](respondWithResult(_0xfe34fa,null))[_0x0904('0x49')](handleError(_0xfe34fa,null));};exports[_0x0904('0x4c')]=function(_0x527a65,_0x17f2bb){return db['MailServerOut'][_0x0904('0x4c')](_0x527a65['body'],{})['then'](respondWithResult(_0x17f2bb,0xc9))[_0x0904('0x49')](handleError(_0x17f2bb,null));};exports[_0x0904('0x28')]=function(_0x38017e,_0x407cc7){if(_0x38017e[_0x0904('0x4d')]['id']){delete _0x38017e[_0x0904('0x4d')]['id'];}return db[_0x0904('0x31')]['find']({'where':{'id':_0x38017e[_0x0904('0x4a')]['id']}})[_0x0904('0x29')](handleEntityNotFound(_0x407cc7,null))[_0x0904('0x29')](saveUpdates(_0x38017e[_0x0904('0x4d')],null))[_0x0904('0x29')](respondWithResult(_0x407cc7,null))[_0x0904('0x49')](handleError(_0x407cc7,null));};exports[_0x0904('0x2a')]=function(_0x414e81,_0x4f20f7){return db[_0x0904('0x31')][_0x0904('0x4b')]({'where':{'id':_0x414e81[_0x0904('0x4a')]['id']}})[_0x0904('0x29')](handleEntityNotFound(_0x4f20f7,null))[_0x0904('0x29')](removeEntity(_0x4f20f7,null))[_0x0904('0x49')](handleError(_0x4f20f7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 5e8a60a..fc2dca9 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 _0x70a1=['request-promise','path','./mailServerOut.attributes','define','MailServerOut','lodash','util','api','bluebird'];(function(_0x2f6404,_0x454760){var _0x44f797=function(_0x286d80){while(--_0x286d80){_0x2f6404['push'](_0x2f6404['shift']());}};_0x44f797(++_0x454760);}(_0x70a1,0xd4));var _0x170a=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x70a1[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x170a('0x0'));var util=require(_0x170a('0x1'));var logger=require('../../config/logger')(_0x170a('0x2'));var moment=require('moment');var BPromise=require(_0x170a('0x3'));var rp=require(_0x170a('0x4'));var fs=require('fs');var path=require(_0x170a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x170a('0x6'));module['exports']=function(_0x568277,_0x13522a){return _0x568277[_0x170a('0x7')](_0x170a('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89e8=['moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','mail_servers_out','lodash','util','../../config/logger'];(function(_0x1ffe75,_0x59931f){var _0x56bcdc=function(_0x1c1760){while(--_0x1c1760){_0x1ffe75['push'](_0x1ffe75['shift']());}};_0x56bcdc(++_0x59931f);}(_0x89e8,0xe3));var _0x889e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x89e8[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var logger=require(_0x889e('0x2'))('api');var moment=require(_0x889e('0x3'));var BPromise=require(_0x889e('0x4'));var rp=require(_0x889e('0x5'));var fs=require('fs');var path=require(_0x889e('0x6'));var rimraf=require(_0x889e('0x7'));var config=require('../../config/environment');var attributes=require(_0x889e('0x8'));module['exports']=function(_0x4450dc,_0x2be9ee){return _0x4450dc['define']('MailServerOut',attributes,{'tableName':_0x889e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index adfd0a2..ec89fbb 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3e7096,_0x405f40){var _0x147dbd=function(_0x5f3918){while(--_0x5f3918){_0x3e7096['push'](_0x3e7096['shift']());}};_0x147dbd(++_0x405f40);}(_0x5f2f,0x73));var _0xf5f2=function(_0x279755,_0x42ad77){_0x279755=_0x279755-0x0;var _0x138178=_0x5f2f[_0x279755];return _0x138178;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1717fe,_0x59a96e){var _0x3c002e=function(_0x292788){while(--_0x292788){_0x1717fe['push'](_0x1717fe['shift']());}};_0x3c002e(++_0x59a96e);}(_0x1261,0x144));var _0x1126=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1261[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e7986bb..6a122fb 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 _0xece0=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy'];(function(_0x1e642d,_0x2a77f6){var _0x188a34=function(_0x1f5027){while(--_0x1f5027){_0x1e642d['push'](_0x1e642d['shift']());}};_0x188a34(++_0x2a77f6);}(_0xece0,0x17d));var _0x0ece=function(_0x10a1d3,_0x1f70d3){_0x10a1d3=_0x10a1d3-0x0;var _0x33102f=_0xece0[_0x10a1d3];return _0x33102f;};'use strict';var multer=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ece('0x2'));var router=express[_0x0ece('0x3')]();var fs_extra=require(_0x0ece('0x4'));var auth=require(_0x0ece('0x5'));var interaction=require(_0x0ece('0x6'));var config=require(_0x0ece('0x7'));var controller=require(_0x0ece('0x8'));router[_0x0ece('0x9')]('/',auth[_0x0ece('0xa')](),controller['index']);router[_0x0ece('0x9')](_0x0ece('0xb'),auth[_0x0ece('0xa')](),controller['describe']);router[_0x0ece('0x9')](_0x0ece('0xc'),auth['isAuthenticated'](),controller[_0x0ece('0xd')]);router[_0x0ece('0xe')]('/',auth[_0x0ece('0xa')](),controller[_0x0ece('0xf')]);router[_0x0ece('0x10')](_0x0ece('0xc'),auth[_0x0ece('0xa')](),controller['update']);router[_0x0ece('0x11')](_0x0ece('0xc'),auth[_0x0ece('0xa')](),controller[_0x0ece('0x12')]);module[_0x0ece('0x13')]=router; \ No newline at end of file +var _0x9b9c=['show','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9b9c,0x1a5));var _0xc9b9=function(_0x2e77d3,_0x2b381e){_0x2e77d3=_0x2e77d3-0x0;var _0x8c3cdc=_0x9b9c[_0x2e77d3];return _0x8c3cdc;};'use strict';var multer=require('multer');var util=require(_0xc9b9('0x0'));var path=require(_0xc9b9('0x1'));var timeout=require(_0xc9b9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc9b9('0x3'));var interaction=require(_0xc9b9('0x4'));var config=require(_0xc9b9('0x5'));var controller=require(_0xc9b9('0x6'));router[_0xc9b9('0x7')]('/',auth[_0xc9b9('0x8')](),controller[_0xc9b9('0x9')]);router[_0xc9b9('0x7')](_0xc9b9('0xa'),auth[_0xc9b9('0x8')](),controller['describe']);router[_0xc9b9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc9b9('0xb')]);router['post']('/',auth[_0xc9b9('0x8')](),controller[_0xc9b9('0xc')]);router[_0xc9b9('0xd')](_0xc9b9('0xe'),auth[_0xc9b9('0x8')](),controller['update']);router[_0xc9b9('0xf')]('/:id',auth[_0xc9b9('0x8')](),controller[_0xc9b9('0x10')]);module[_0xc9b9('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 42850b6..2ddcba0 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 _0x0af5=['STRING','name','exports'];(function(_0x3dd8dd,_0x369f8e){var _0x33e300=function(_0xf1a7db){while(--_0xf1a7db){_0x3dd8dd['push'](_0x3dd8dd['shift']());}};_0x33e300(++_0x369f8e);}(_0x0af5,0x158));var _0x50af=function(_0x38bf1b,_0x40f574){_0x38bf1b=_0x38bf1b-0x0;var _0xffd8a2=_0x0af5[_0x38bf1b];return _0xffd8a2;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'unique':_0x50af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x50af('0x1')]}}; \ No newline at end of file +var _0x3eea=['STRING','name','sequelize'];(function(_0x460254,_0x58e020){var _0x152dff=function(_0x32baa3){while(--_0x32baa3){_0x460254['push'](_0x460254['shift']());}};_0x152dff(++_0x58e020);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xed0fbb,_0x2ae4cd){_0xed0fbb=_0xed0fbb-0x0;var _0x3a2483=_0x3eea[_0xed0fbb];return _0x3a2483;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'unique':_0xa3ee('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa3ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 5def0e2..2226489 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 _0xf2d0=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3b2615,_0x4ffda1){var _0x22cbff=function(_0x211b24){while(--_0x211b24){_0x3b2615['push'](_0x3b2615['shift']());}};_0x22cbff(++_0x4ffda1);}(_0xf2d0,0x17d));var _0x0f2d=function(_0x5d68aa,_0x2c7725){_0x5d68aa=_0x5d68aa-0x0;var _0x451702=_0xf2d0[_0x5d68aa];return _0x451702;};'use strict';var emlformat=require(_0x0f2d('0x0'));var rimraf=require(_0x0f2d('0x1'));var zipdir=require(_0x0f2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f2d('0x3'));var moment=require('moment');var BPromise=require(_0x0f2d('0x4'));var Mustache=require(_0x0f2d('0x5'));var util=require('util');var path=require(_0x0f2d('0x6'));var sox=require('sox');var csv=require(_0x0f2d('0x7'));var ejs=require(_0x0f2d('0x8'));var fs=require('fs');var fs_extra=require(_0x0f2d('0x9'));var _=require(_0x0f2d('0xa'));var squel=require(_0x0f2d('0xb'));var crypto=require(_0x0f2d('0xc'));var jsforce=require(_0x0f2d('0xd'));var deskjs=require(_0x0f2d('0xe'));var toCsv=require(_0x0f2d('0x7'));var querystring=require('querystring');var Papa=require(_0x0f2d('0xf'));var Redis=require('ioredis');var authService=require(_0x0f2d('0x10'));var qs=require(_0x0f2d('0x11'));var as=require(_0x0f2d('0x12'));var hardwareService=require(_0x0f2d('0x13'));var logger=require(_0x0f2d('0x14'))(_0x0f2d('0x15'));var utils=require(_0x0f2d('0x16'));var config=require(_0x0f2d('0x17'));var licenseUtil=require(_0x0f2d('0x18'));var db=require(_0x0f2d('0x19'))['db'];function respondWithStatusCode(_0x4d2f23,_0x482a54){_0x482a54=_0x482a54||0xcc;return function(_0x231f15){if(_0x231f15){return _0x4d2f23['sendStatus'](_0x482a54);}return _0x4d2f23[_0x0f2d('0x1a')](_0x482a54)[_0x0f2d('0x1b')]();};}function respondWithResult(_0x50ca68,_0x197435){_0x197435=_0x197435||0xc8;return function(_0x1a8a64){if(_0x1a8a64){return _0x50ca68[_0x0f2d('0x1a')](_0x197435)['json'](_0x1a8a64);}};}function respondWithFilteredResult(_0x298e95,_0x5db61b){return function(_0x12b532){if(_0x12b532){var _0xbe67f4=typeof _0x5db61b[_0x0f2d('0x1c')]===_0x0f2d('0x1d')&&typeof _0x5db61b[_0x0f2d('0x1e')]==='undefined';var _0x5a9985=_0x12b532[_0x0f2d('0x1f')];var _0x449389=_0xbe67f4?0x0:_0x5db61b[_0x0f2d('0x1c')];var _0x4d1d7a=_0xbe67f4?_0x12b532['count']:_0x5db61b[_0x0f2d('0x1c')]+_0x5db61b[_0x0f2d('0x1e')];var _0x42c681;if(_0x4d1d7a>=_0x5a9985){_0x4d1d7a=_0x5a9985;_0x42c681=0xc8;}else{_0x42c681=0xce;}_0x298e95[_0x0f2d('0x1a')](_0x42c681);return _0x298e95[_0x0f2d('0x20')](_0x0f2d('0x21'),_0x449389+'-'+_0x4d1d7a+'/'+_0x5a9985)[_0x0f2d('0x22')](_0x12b532);}return null;};}function patchUpdates(_0x22cdda){return function(_0x10a443){try{jsonpatch[_0x0f2d('0x23')](_0x10a443,_0x22cdda,!![]);}catch(_0x1c011c){return BPromise[_0x0f2d('0x24')](_0x1c011c);}return _0x10a443['save']();};}function saveUpdates(_0x3b9602,_0x4150dd){return function(_0x1c1c49){if(_0x1c1c49){return _0x1c1c49[_0x0f2d('0x25')](_0x3b9602)[_0x0f2d('0x26')](function(_0x201af1){return _0x201af1;});}return null;};}function removeEntity(_0x12e540,_0x37c98e){return function(_0x1255f3){if(_0x1255f3){return _0x1255f3[_0x0f2d('0x27')]()['then'](function(){_0x12e540['status'](0xcc)[_0x0f2d('0x1b')]();});}};}function handleEntityNotFound(_0xc5a775,_0x2c017f){return function(_0x4760ba){if(!_0x4760ba){_0xc5a775[_0x0f2d('0x28')](0x194);}return _0x4760ba;};}function handleError(_0x44c7a7,_0x420b4a){_0x420b4a=_0x420b4a||0x1f4;return function(_0x51708f){logger[_0x0f2d('0x29')](_0x51708f['stack']);if(_0x51708f[_0x0f2d('0x2a')]){delete _0x51708f[_0x0f2d('0x2a')];}_0x44c7a7['status'](_0x420b4a)[_0x0f2d('0x2b')](_0x51708f);};}exports[_0x0f2d('0x2c')]=function(_0x2be4f2,_0x317f14){var _0x1541f4={},_0xf81567={},_0x552430={'count':0x0,'rows':[]};var _0x4c1ea5=_[_0x0f2d('0x2d')](db[_0x0f2d('0x2e')][_0x0f2d('0x2f')],function(_0x46a4a1){return{'name':_0x46a4a1[_0x0f2d('0x30')],'type':_0x46a4a1['type'][_0x0f2d('0x31')]};});_0xf81567[_0x0f2d('0x32')]=_[_0x0f2d('0x2d')](_0x4c1ea5,'name');_0xf81567[_0x0f2d('0x33')]=_[_0x0f2d('0x34')](_0x2be4f2[_0x0f2d('0x33')]);_0xf81567[_0x0f2d('0x35')]=_[_0x0f2d('0x36')](_0xf81567[_0x0f2d('0x32')],_0xf81567[_0x0f2d('0x33')]);_0x1541f4['attributes']=_[_0x0f2d('0x36')](_0xf81567[_0x0f2d('0x32')],qs[_0x0f2d('0x37')](_0x2be4f2['query'][_0x0f2d('0x37')]));_0x1541f4['attributes']=_0x1541f4['attributes']['length']?_0x1541f4[_0x0f2d('0x38')]:_0xf81567[_0x0f2d('0x32')];if(!_0x2be4f2[_0x0f2d('0x33')]['hasOwnProperty'](_0x0f2d('0x39'))){_0x1541f4[_0x0f2d('0x1e')]=qs[_0x0f2d('0x1e')](_0x2be4f2[_0x0f2d('0x33')]['limit']);_0x1541f4['offset']=qs[_0x0f2d('0x1c')](_0x2be4f2[_0x0f2d('0x33')][_0x0f2d('0x1c')]);}_0x1541f4[_0x0f2d('0x3a')]=qs[_0x0f2d('0x3b')](_0x2be4f2[_0x0f2d('0x33')][_0x0f2d('0x3b')]);_0x1541f4[_0x0f2d('0x3c')]=qs[_0x0f2d('0x35')](_[_0x0f2d('0x3d')](_0x2be4f2['query'],_0xf81567['filters']),_0x4c1ea5);if(_0x2be4f2[_0x0f2d('0x33')][_0x0f2d('0x3e')]){_0x1541f4[_0x0f2d('0x3c')]=_[_0x0f2d('0x3f')](_0x1541f4[_0x0f2d('0x3c')],{'$or':_[_0x0f2d('0x2d')](_0x4c1ea5,function(_0x180504){if(_0x180504[_0x0f2d('0x40')]!=='VIRTUAL'){var _0x15034e={};_0x15034e[_0x180504[_0x0f2d('0x2a')]]={'$like':'%'+_0x2be4f2[_0x0f2d('0x33')][_0x0f2d('0x3e')]+'%'};return _0x15034e;}})});}_0x1541f4=_[_0x0f2d('0x3f')]({},_0x1541f4,_0x2be4f2[_0x0f2d('0x41')]);var _0x478cbd={'where':_0x1541f4['where']};return db[_0x0f2d('0x2e')]['count'](_0x478cbd)[_0x0f2d('0x26')](function(_0x190d31){_0x552430[_0x0f2d('0x1f')]=_0x190d31;if(_0x2be4f2['query'][_0x0f2d('0x42')]){_0x1541f4[_0x0f2d('0x43')]=[{'all':!![]}];}return db[_0x0f2d('0x2e')]['findAll'](_0x1541f4);})['then'](function(_0x316c76){_0x552430[_0x0f2d('0x44')]=_0x316c76;return _0x552430;})['then'](respondWithFilteredResult(_0x317f14,_0x1541f4))[_0x0f2d('0x45')](handleError(_0x317f14,null));};exports[_0x0f2d('0x46')]=function(_0x263629,_0x159478){var _0x104b37={'raw':!![],'where':{'id':_0x263629[_0x0f2d('0x47')]['id']}},_0x41c630={};_0x41c630[_0x0f2d('0x32')]=_[_0x0f2d('0x34')](db[_0x0f2d('0x2e')]['rawAttributes']);_0x41c630['query']=_[_0x0f2d('0x34')](_0x263629['query']);_0x41c630[_0x0f2d('0x35')]=_[_0x0f2d('0x36')](_0x41c630[_0x0f2d('0x32')],_0x41c630[_0x0f2d('0x33')]);_0x104b37['attributes']=_[_0x0f2d('0x36')](_0x41c630[_0x0f2d('0x32')],qs['fields'](_0x263629[_0x0f2d('0x33')]['fields']));_0x104b37[_0x0f2d('0x38')]=_0x104b37[_0x0f2d('0x38')][_0x0f2d('0x48')]?_0x104b37[_0x0f2d('0x38')]:_0x41c630[_0x0f2d('0x32')];if(_0x263629[_0x0f2d('0x33')][_0x0f2d('0x42')]){_0x104b37[_0x0f2d('0x43')]=[{'all':!![]}];}_0x104b37=_[_0x0f2d('0x3f')]({},_0x104b37,_0x263629[_0x0f2d('0x41')]);return db[_0x0f2d('0x2e')][_0x0f2d('0x49')](_0x104b37)['then'](handleEntityNotFound(_0x159478,null))[_0x0f2d('0x26')](respondWithResult(_0x159478,null))[_0x0f2d('0x45')](handleError(_0x159478,null));};exports['create']=function(_0x427d71,_0xd3b345){return db['MailSubstatus'][_0x0f2d('0x4a')](_0x427d71[_0x0f2d('0x4b')],{})['then'](respondWithResult(_0xd3b345,0xc9))[_0x0f2d('0x45')](handleError(_0xd3b345,null));};exports[_0x0f2d('0x25')]=function(_0x21047a,_0x5edf4c){if(_0x21047a[_0x0f2d('0x4b')]['id']){delete _0x21047a['body']['id'];}return db[_0x0f2d('0x2e')]['find']({'where':{'id':_0x21047a[_0x0f2d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5edf4c,null))['then'](saveUpdates(_0x21047a[_0x0f2d('0x4b')],null))['then'](respondWithResult(_0x5edf4c,null))[_0x0f2d('0x45')](handleError(_0x5edf4c,null));};exports[_0x0f2d('0x27')]=function(_0x55d72a,_0x2e8982){return db[_0x0f2d('0x2e')]['find']({'where':{'id':_0x55d72a[_0x0f2d('0x47')]['id']}})[_0x0f2d('0x26')](handleEntityNotFound(_0x2e8982,null))[_0x0f2d('0x26')](removeEntity(_0x2e8982,null))[_0x0f2d('0x45')](handleError(_0x2e8982,null));};exports['describe']=function(_0x56dbf1,_0x565fef){return db[_0x0f2d('0x2e')][_0x0f2d('0x4c')]()[_0x0f2d('0x26')](respondWithResult(_0x565fef,null))[_0x0f2d('0x45')](handleError(_0x565fef,null));}; \ No newline at end of file +var _0x4c5a=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','params','include','options','create','body','find','describe','eml-format','rimraf'];(function(_0x43ee81,_0x45d21a){var _0x3577db=function(_0x149147){while(--_0x149147){_0x43ee81['push'](_0x43ee81['shift']());}};_0x3577db(++_0x45d21a);}(_0x4c5a,0xd9));var _0xa4c5=function(_0x44799b,_0x269c0d){_0x44799b=_0x44799b-0x0;var _0x4b16e7=_0x4c5a[_0x44799b];return _0x4b16e7;};'use strict';var emlformat=require(_0xa4c5('0x0'));var rimraf=require(_0xa4c5('0x1'));var zipdir=require(_0xa4c5('0x2'));var jsonpatch=require(_0xa4c5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa4c5('0x4'));var Mustache=require(_0xa4c5('0x5'));var util=require(_0xa4c5('0x6'));var path=require(_0xa4c5('0x7'));var sox=require(_0xa4c5('0x8'));var csv=require(_0xa4c5('0x9'));var ejs=require(_0xa4c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4c5('0xc'));var deskjs=require(_0xa4c5('0xd'));var toCsv=require(_0xa4c5('0x9'));var querystring=require(_0xa4c5('0xe'));var Papa=require(_0xa4c5('0xf'));var Redis=require('ioredis');var authService=require(_0xa4c5('0x10'));var qs=require(_0xa4c5('0x11'));var as=require(_0xa4c5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4c5('0x13'))(_0xa4c5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4c5('0x15'))['db'];function respondWithStatusCode(_0xc5b674,_0x3ad0bc){_0x3ad0bc=_0x3ad0bc||0xcc;return function(_0x1ecac2){if(_0x1ecac2){return _0xc5b674[_0xa4c5('0x16')](_0x3ad0bc);}return _0xc5b674[_0xa4c5('0x17')](_0x3ad0bc)[_0xa4c5('0x18')]();};}function respondWithResult(_0x308ace,_0x43245c){_0x43245c=_0x43245c||0xc8;return function(_0x309315){if(_0x309315){return _0x308ace[_0xa4c5('0x17')](_0x43245c)['json'](_0x309315);}};}function respondWithFilteredResult(_0x3ddb77,_0x1c0204){return function(_0x462b30){if(_0x462b30){var _0x221911=typeof _0x1c0204['offset']===_0xa4c5('0x19')&&typeof _0x1c0204[_0xa4c5('0x1a')]===_0xa4c5('0x19');var _0x207891=_0x462b30[_0xa4c5('0x1b')];var _0x373c8d=_0x221911?0x0:_0x1c0204[_0xa4c5('0x1c')];var _0x54e6d3=_0x221911?_0x462b30[_0xa4c5('0x1b')]:_0x1c0204[_0xa4c5('0x1c')]+_0x1c0204[_0xa4c5('0x1a')];var _0x3c3e7c;if(_0x54e6d3>=_0x207891){_0x54e6d3=_0x207891;_0x3c3e7c=0xc8;}else{_0x3c3e7c=0xce;}_0x3ddb77[_0xa4c5('0x17')](_0x3c3e7c);return _0x3ddb77[_0xa4c5('0x1d')](_0xa4c5('0x1e'),_0x373c8d+'-'+_0x54e6d3+'/'+_0x207891)[_0xa4c5('0x1f')](_0x462b30);}return null;};}function patchUpdates(_0x5e74be){return function(_0x55d831){try{jsonpatch['apply'](_0x55d831,_0x5e74be,!![]);}catch(_0x4a384d){return BPromise['reject'](_0x4a384d);}return _0x55d831[_0xa4c5('0x20')]();};}function saveUpdates(_0x551664,_0x3c1514){return function(_0xb70a2d){if(_0xb70a2d){return _0xb70a2d[_0xa4c5('0x21')](_0x551664)[_0xa4c5('0x22')](function(_0x5439ee){return _0x5439ee;});}return null;};}function removeEntity(_0x5ade1d,_0x256dad){return function(_0x20fd68){if(_0x20fd68){return _0x20fd68[_0xa4c5('0x23')]()[_0xa4c5('0x22')](function(){_0x5ade1d[_0xa4c5('0x17')](0xcc)[_0xa4c5('0x18')]();});}};}function handleEntityNotFound(_0x261f16,_0x59084c){return function(_0x59fe7f){if(!_0x59fe7f){_0x261f16[_0xa4c5('0x16')](0x194);}return _0x59fe7f;};}function handleError(_0x3bece5,_0xa33c98){_0xa33c98=_0xa33c98||0x1f4;return function(_0x3e6d88){logger[_0xa4c5('0x24')](_0x3e6d88[_0xa4c5('0x25')]);if(_0x3e6d88[_0xa4c5('0x26')]){delete _0x3e6d88[_0xa4c5('0x26')];}_0x3bece5[_0xa4c5('0x17')](_0xa33c98)[_0xa4c5('0x27')](_0x3e6d88);};}exports[_0xa4c5('0x28')]=function(_0x13cc18,_0x1c9041){var _0x1ed220={},_0x31987b={},_0x36bfac={'count':0x0,'rows':[]};var _0xcf554e=_['map'](db[_0xa4c5('0x29')][_0xa4c5('0x2a')],function(_0x16a28f){return{'name':_0x16a28f[_0xa4c5('0x2b')],'type':_0x16a28f[_0xa4c5('0x2c')][_0xa4c5('0x2d')]};});_0x31987b[_0xa4c5('0x2e')]=_[_0xa4c5('0x2f')](_0xcf554e,'name');_0x31987b['query']=_[_0xa4c5('0x30')](_0x13cc18[_0xa4c5('0x31')]);_0x31987b[_0xa4c5('0x32')]=_[_0xa4c5('0x33')](_0x31987b[_0xa4c5('0x2e')],_0x31987b[_0xa4c5('0x31')]);_0x1ed220[_0xa4c5('0x34')]=_['intersection'](_0x31987b[_0xa4c5('0x2e')],qs[_0xa4c5('0x35')](_0x13cc18[_0xa4c5('0x31')][_0xa4c5('0x35')]));_0x1ed220[_0xa4c5('0x34')]=_0x1ed220[_0xa4c5('0x34')][_0xa4c5('0x36')]?_0x1ed220[_0xa4c5('0x34')]:_0x31987b['model'];if(!_0x13cc18['query']['hasOwnProperty']('nolimit')){_0x1ed220[_0xa4c5('0x1a')]=qs['limit'](_0x13cc18[_0xa4c5('0x31')]['limit']);_0x1ed220['offset']=qs['offset'](_0x13cc18['query'][_0xa4c5('0x1c')]);}_0x1ed220[_0xa4c5('0x37')]=qs[_0xa4c5('0x38')](_0x13cc18[_0xa4c5('0x31')]['sort']);_0x1ed220[_0xa4c5('0x39')]=qs[_0xa4c5('0x32')](_[_0xa4c5('0x3a')](_0x13cc18[_0xa4c5('0x31')],_0x31987b['filters']),_0xcf554e);if(_0x13cc18[_0xa4c5('0x31')]['filter']){_0x1ed220[_0xa4c5('0x39')]=_[_0xa4c5('0x3b')](_0x1ed220['where'],{'$or':_[_0xa4c5('0x2f')](_0xcf554e,function(_0x106de4){if(_0x106de4[_0xa4c5('0x2c')]!==_0xa4c5('0x3c')){var _0x4ee1de={};_0x4ee1de[_0x106de4[_0xa4c5('0x26')]]={'$like':'%'+_0x13cc18[_0xa4c5('0x31')][_0xa4c5('0x3d')]+'%'};return _0x4ee1de;}})});}_0x1ed220=_['merge']({},_0x1ed220,_0x13cc18['options']);var _0x33020c={'where':_0x1ed220[_0xa4c5('0x39')]};return db[_0xa4c5('0x29')][_0xa4c5('0x1b')](_0x33020c)[_0xa4c5('0x22')](function(_0x4a136c){_0x36bfac[_0xa4c5('0x1b')]=_0x4a136c;if(_0x13cc18[_0xa4c5('0x31')][_0xa4c5('0x3e')]){_0x1ed220['include']=[{'all':!![]}];}return db[_0xa4c5('0x29')][_0xa4c5('0x3f')](_0x1ed220);})[_0xa4c5('0x22')](function(_0x38e941){_0x36bfac[_0xa4c5('0x40')]=_0x38e941;return _0x36bfac;})[_0xa4c5('0x22')](respondWithFilteredResult(_0x1c9041,_0x1ed220))[_0xa4c5('0x41')](handleError(_0x1c9041,null));};exports['show']=function(_0x566eb1,_0x36ac70){var _0x15c508={'raw':!![],'where':{'id':_0x566eb1[_0xa4c5('0x42')]['id']}},_0x16e289={};_0x16e289[_0xa4c5('0x2e')]=_[_0xa4c5('0x30')](db[_0xa4c5('0x29')][_0xa4c5('0x2a')]);_0x16e289['query']=_[_0xa4c5('0x30')](_0x566eb1[_0xa4c5('0x31')]);_0x16e289['filters']=_[_0xa4c5('0x33')](_0x16e289[_0xa4c5('0x2e')],_0x16e289['query']);_0x15c508[_0xa4c5('0x34')]=_[_0xa4c5('0x33')](_0x16e289['model'],qs['fields'](_0x566eb1[_0xa4c5('0x31')][_0xa4c5('0x35')]));_0x15c508[_0xa4c5('0x34')]=_0x15c508[_0xa4c5('0x34')][_0xa4c5('0x36')]?_0x15c508[_0xa4c5('0x34')]:_0x16e289[_0xa4c5('0x2e')];if(_0x566eb1[_0xa4c5('0x31')][_0xa4c5('0x3e')]){_0x15c508[_0xa4c5('0x43')]=[{'all':!![]}];}_0x15c508=_[_0xa4c5('0x3b')]({},_0x15c508,_0x566eb1[_0xa4c5('0x44')]);return db[_0xa4c5('0x29')]['find'](_0x15c508)[_0xa4c5('0x22')](handleEntityNotFound(_0x36ac70,null))[_0xa4c5('0x22')](respondWithResult(_0x36ac70,null))[_0xa4c5('0x41')](handleError(_0x36ac70,null));};exports['create']=function(_0x16d42e,_0x1706e3){return db['MailSubstatus'][_0xa4c5('0x45')](_0x16d42e['body'],{})[_0xa4c5('0x22')](respondWithResult(_0x1706e3,0xc9))[_0xa4c5('0x41')](handleError(_0x1706e3,null));};exports[_0xa4c5('0x21')]=function(_0x5b400c,_0x29c181){if(_0x5b400c[_0xa4c5('0x46')]['id']){delete _0x5b400c[_0xa4c5('0x46')]['id'];}return db[_0xa4c5('0x29')][_0xa4c5('0x47')]({'where':{'id':_0x5b400c[_0xa4c5('0x42')]['id']}})[_0xa4c5('0x22')](handleEntityNotFound(_0x29c181,null))[_0xa4c5('0x22')](saveUpdates(_0x5b400c[_0xa4c5('0x46')],null))[_0xa4c5('0x22')](respondWithResult(_0x29c181,null))[_0xa4c5('0x41')](handleError(_0x29c181,null));};exports[_0xa4c5('0x23')]=function(_0x5b3d57,_0x2349b1){return db[_0xa4c5('0x29')][_0xa4c5('0x47')]({'where':{'id':_0x5b3d57[_0xa4c5('0x42')]['id']}})['then'](handleEntityNotFound(_0x2349b1,null))[_0xa4c5('0x22')](removeEntity(_0x2349b1,null))[_0xa4c5('0x41')](handleError(_0x2349b1,null));};exports[_0xa4c5('0x48')]=function(_0x40c71b,_0x5cfe30){return db[_0xa4c5('0x29')][_0xa4c5('0x48')]()[_0xa4c5('0x22')](respondWithResult(_0x5cfe30,null))['catch'](handleError(_0x5cfe30,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b685a2d..e62fc1a 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 _0xc99f=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x990c78,_0x129ea8){var _0x3464d5=function(_0x14982b){while(--_0x14982b){_0x990c78['push'](_0x990c78['shift']());}};_0x3464d5(++_0x129ea8);}(_0xc99f,0x150));var _0xfc99=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0xc99f[_0x1d39f6];return _0x3dbd7a;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xfc99('0x0'))['db'][_0xfc99('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xfc99('0x2')](0x0);var events={'afterUpdate':_0xfc99('0x3')};function emitEvent(_0x4ff06d){return function(_0x27ceff,_0x430208,_0x2cb50e){MailSubstatusEvents['emit'](_0x4ff06d+':'+_0x27ceff['id'],_0x27ceff);MailSubstatusEvents[_0xfc99('0x4')](_0x4ff06d,_0x27ceff);_0x2cb50e(null);};}for(var e in events){if(events[_0xfc99('0x5')](e)){var event=events[e];MailSubstatus[_0xfc99('0x6')](e,emitEvent(event));}}module[_0xfc99('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x14d0=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x18c389,_0x55468e){var _0x1e3da0=function(_0x47b456){while(--_0x47b456){_0x18c389['push'](_0x18c389['shift']());}};_0x1e3da0(++_0x55468e);}(_0x14d0,0x66));var _0x014d=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x14d0[_0x4e7d25];return _0x526fe6;};'use strict';var EventEmitter=require(_0x014d('0x0'));var MailSubstatus=require(_0x014d('0x1'))['db'][_0x014d('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x014d('0x3')](0x0);var events={'afterUpdate':_0x014d('0x4')};function emitEvent(_0x3fa41c){return function(_0x9efa2,_0x95b694,_0x3ca822){MailSubstatusEvents[_0x014d('0x5')](_0x3fa41c+':'+_0x9efa2['id'],_0x9efa2);MailSubstatusEvents[_0x014d('0x5')](_0x3fa41c,_0x9efa2);_0x3ca822(null);};}for(var e in events){if(events[_0x014d('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x014d('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1b3cf8e..a76f656 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 _0x7df7=['_previousDataValues','name','then','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus'];(function(_0x6f43ba,_0x2ebafd){var _0x57eba5=function(_0x26de80){while(--_0x26de80){_0x6f43ba['push'](_0x6f43ba['shift']());}};_0x57eba5(++_0x2ebafd);}(_0x7df7,0x1a5));var _0x77df=function(_0x4b06c6,_0x57bdf5){_0x4b06c6=_0x4b06c6-0x0;var _0x3a327a=_0x7df7[_0x4b06c6];return _0x3a327a;};'use strict';var attributes=require(_0x77df('0x0'));module[_0x77df('0x1')]=function(_0x3a371f){var _0xab26c6=_0x3a371f[_0x77df('0x2')];return _0x3a371f['define'](_0x77df('0x3'),attributes,{'tableName':_0x77df('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x35c0cf,_0x3f6a72,_0x52b876){return _0xab26c6[_0x77df('0x5')][_0x77df('0x6')]({'value':_0x35c0cf['name']},{'where':{'field':_0x77df('0x7'),'value':_0x35c0cf[_0x77df('0x8')][_0x77df('0x9')]}})[_0x77df('0xa')](function(){_0x52b876();})['catch'](function(_0x5bee76){_0x52b876(_0x5bee76);});}}});}; \ No newline at end of file +var _0x0c08=['_previousDataValues','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x5a3dff,_0x20b8f5){var _0x48b1cf=function(_0xf6f704){while(--_0xf6f704){_0x5a3dff['push'](_0x5a3dff['shift']());}};_0x48b1cf(++_0x20b8f5);}(_0x0c08,0x12d));var _0x80c0=function(_0x3baaf2,_0x894e3d){_0x3baaf2=_0x3baaf2-0x0;var _0x50e8b0=_0x0c08[_0x3baaf2];return _0x50e8b0;};'use strict';var attributes=require(_0x80c0('0x0'));module[_0x80c0('0x1')]=function(_0x526d50){var _0x2cf1e0=_0x526d50[_0x80c0('0x2')];return _0x526d50[_0x80c0('0x3')]('MailSubstatus',attributes,{'tableName':_0x80c0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5d1bed,_0x22f2e6,_0x1d8202){return _0x2cf1e0[_0x80c0('0x5')][_0x80c0('0x6')]({'value':_0x5d1bed[_0x80c0('0x7')]},{'where':{'field':_0x80c0('0x8'),'value':_0x5d1bed[_0x80c0('0x9')][_0x80c0('0x7')]}})['then'](function(){_0x1d8202();})['catch'](function(_0x403229){_0x1d8202(_0x403229);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 0cf78f7..023e2b7 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 _0x4ae0=['bluebird','randomstring','ioredis','../../config/logger','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment'];(function(_0x412baf,_0x31ff60){var _0x24090d=function(_0x5cb316){while(--_0x5cb316){_0x412baf['push'](_0x412baf['shift']());}};_0x24090d(++_0x31ff60);}(_0x4ae0,0x152));var _0x04ae=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x4ae0[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x04ae('0x0'));var util=require('util');var moment=require(_0x04ae('0x1'));var BPromise=require(_0x04ae('0x2'));var rs=require(_0x04ae('0x3'));var fs=require('fs');var Redis=require(_0x04ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x04ae('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x04ae('0x6')][_0x04ae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8f78ed,_0x58748b,_0x244c78){return new BPromise(function(_0x2c15de,_0x5c118f){return client['request'](_0x8f78ed,_0x244c78)[_0x04ae('0x8')](function(_0x4fc89c){logger[_0x04ae('0x9')](_0x04ae('0xa'),_0x58748b,_0x04ae('0xb'));logger[_0x04ae('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x58748b,_0x04ae('0xb'),JSON['stringify'](_0x4fc89c));if(_0x4fc89c[_0x04ae('0xd')]){if(_0x4fc89c[_0x04ae('0xd')][_0x04ae('0xe')]===0x1f4){logger[_0x04ae('0xd')](_0x04ae('0xa'),_0x58748b,_0x4fc89c[_0x04ae('0xd')][_0x04ae('0xf')]);return _0x5c118f(_0x4fc89c[_0x04ae('0xd')][_0x04ae('0xf')]);}logger[_0x04ae('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x58748b,_0x4fc89c['error'][_0x04ae('0xf')]);return _0x2c15de(_0x4fc89c['error'][_0x04ae('0xf')]);}else{logger[_0x04ae('0x9')](_0x04ae('0xa'),_0x58748b,'request\x20sent');_0x2c15de(_0x4fc89c['result'][_0x04ae('0xf')]);}})[_0x04ae('0x10')](function(_0x35d446){logger[_0x04ae('0xd')](_0x04ae('0xa'),_0x58748b,_0x35d446);_0x5c118f(_0x35d446);});});} \ No newline at end of file +var _0x7dee=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4afe41,_0x22bd75){var _0x552f0f=function(_0x486dd9){while(--_0x486dd9){_0x4afe41['push'](_0x4afe41['shift']());}};_0x552f0f(++_0x22bd75);}(_0x7dee,0xb0));var _0xe7de=function(_0x548c67,_0x1698ba){_0x548c67=_0x548c67-0x0;var _0x5e152b=_0x7dee[_0x548c67];return _0x5e152b;};'use strict';var _=require(_0xe7de('0x0'));var util=require('util');var moment=require(_0xe7de('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7de('0x2'));var fs=require('fs');var Redis=require(_0xe7de('0x3'));var db=require(_0xe7de('0x4'))['db'];var utils=require(_0xe7de('0x5'));var logger=require('../../config/logger')(_0xe7de('0x6'));var config=require('../../config/environment');var jayson=require(_0xe7de('0x7'));var client=jayson[_0xe7de('0x8')][_0xe7de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17515b,_0x372910,_0x392168){return new BPromise(function(_0x52753f,_0x4469e0){return client[_0xe7de('0xa')](_0x17515b,_0x392168)[_0xe7de('0xb')](function(_0x2177f9){logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));logger[_0xe7de('0xe')](_0xe7de('0xf'),_0x372910,_0xe7de('0xd'),JSON[_0xe7de('0x10')](_0x2177f9));if(_0x2177f9[_0xe7de('0x11')]){if(_0x2177f9['error'][_0xe7de('0x12')]===0x1f4){logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x4469e0(_0x2177f9['error'][_0xe7de('0x13')]);}logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x52753f(_0x2177f9[_0xe7de('0x11')]['message']);}else{logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));_0x52753f(_0x2177f9[_0xe7de('0x14')][_0xe7de('0x13')]);}})[_0xe7de('0x15')](function(_0x573cb4){logger[_0xe7de('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x372910,_0x573cb4);_0x4469e0(_0x573cb4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 0a7c4a2..3eac9fd 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 _0x0541=['../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x340f82,_0x26ee78){var _0x766f92=function(_0x2d52fb){while(--_0x2d52fb){_0x340f82['push'](_0x340f82['shift']());}};_0x766f92(++_0x26ee78);}(_0x0541,0x1b2));var _0x1054=function(_0x2eeed4,_0x28dc98){_0x2eeed4=_0x2eeed4-0x0;var _0x56099d=_0x0541[_0x2eeed4];return _0x56099d;};'use strict';var multer=require(_0x1054('0x0'));var util=require('util');var path=require(_0x1054('0x1'));var timeout=require(_0x1054('0x2'));var express=require(_0x1054('0x3'));var router=express[_0x1054('0x4')]();var fs_extra=require(_0x1054('0x5'));var auth=require(_0x1054('0x6'));var interaction=require(_0x1054('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x1054('0x8')](),controller[_0x1054('0x9')]);router[_0x1054('0xa')](_0x1054('0xb'),auth['isAuthenticated'](),controller[_0x1054('0xc')]);router[_0x1054('0xa')](_0x1054('0xd'),auth[_0x1054('0x8')](),controller[_0x1054('0xe')]);router[_0x1054('0xf')]('/',auth[_0x1054('0x8')](),controller[_0x1054('0x10')]);router[_0x1054('0x11')](_0x1054('0xd'),auth[_0x1054('0x8')](),controller[_0x1054('0x12')]);router['delete'](_0x1054('0xd'),auth[_0x1054('0x8')](),controller[_0x1054('0x13')]);module[_0x1054('0x14')]=router; \ No newline at end of file +var _0x8944=['get','isAuthenticated','index','describe','/:id','show','post','create','update','multer','util','path','express','Router','../../components/auth/service','./mailTransferReport.controller'];(function(_0x135b6d,_0x8b3f9f){var _0x2b47e2=function(_0x132d40){while(--_0x132d40){_0x135b6d['push'](_0x135b6d['shift']());}};_0x2b47e2(++_0x8b3f9f);}(_0x8944,0x119));var _0x4894=function(_0x887b0e,_0x434f83){_0x887b0e=_0x887b0e-0x0;var _0x4f5f56=_0x8944[_0x887b0e];return _0x4f5f56;};'use strict';var multer=require(_0x4894('0x0'));var util=require(_0x4894('0x1'));var path=require(_0x4894('0x2'));var timeout=require('connect-timeout');var express=require(_0x4894('0x3'));var router=express[_0x4894('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4894('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4894('0x6'));router[_0x4894('0x7')]('/',auth[_0x4894('0x8')](),controller[_0x4894('0x9')]);router[_0x4894('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x4894('0xa')]);router[_0x4894('0x7')](_0x4894('0xb'),auth[_0x4894('0x8')](),controller[_0x4894('0xc')]);router[_0x4894('0xd')]('/',auth['isAuthenticated'](),controller[_0x4894('0xe')]);router['put'](_0x4894('0xb'),auth[_0x4894('0x8')](),controller[_0x4894('0xf')]);router['delete'](_0x4894('0xb'),auth[_0x4894('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index fb458a2..6c23019 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x416326,_0xd2abb0){var _0xa70bf5=function(_0x2a2d1b){while(--_0x2a2d1b){_0x416326['push'](_0x416326['shift']());}};_0xa70bf5(++_0xd2abb0);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x554d07,_0x5d0897){var _0x18913f=function(_0x157840){while(--_0x157840){_0x554d07['push'](_0x554d07['shift']());}};_0x18913f(++_0x5d0897);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xf3cd[_0x1c546c];return _0x2cc384;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 394280d..5c69d34 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 _0x2c43=['stack','name','send','index','MailTransferReport','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','end','sendStatus','error'];(function(_0xcafee3,_0x3c1bc1){var _0x3c2b17=function(_0x12b45a){while(--_0x12b45a){_0xcafee3['push'](_0xcafee3['shift']());}};_0x3c2b17(++_0x3c1bc1);}(_0x2c43,0x19b));var _0x32c4=function(_0x45710d,_0x1c3ec8){_0x45710d=_0x45710d-0x0;var _0x3d38b9=_0x2c43[_0x45710d];return _0x3d38b9;};'use strict';var emlformat=require(_0x32c4('0x0'));var rimraf=require(_0x32c4('0x1'));var zipdir=require(_0x32c4('0x2'));var jsonpatch=require(_0x32c4('0x3'));var rp=require(_0x32c4('0x4'));var moment=require(_0x32c4('0x5'));var BPromise=require(_0x32c4('0x6'));var Mustache=require('mustache');var util=require(_0x32c4('0x7'));var path=require(_0x32c4('0x8'));var sox=require('sox');var csv=require(_0x32c4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32c4('0xa'));var _=require(_0x32c4('0xb'));var squel=require(_0x32c4('0xc'));var crypto=require(_0x32c4('0xd'));var jsforce=require(_0x32c4('0xe'));var deskjs=require(_0x32c4('0xf'));var toCsv=require(_0x32c4('0x9'));var querystring=require(_0x32c4('0x10'));var Papa=require(_0x32c4('0x11'));var Redis=require(_0x32c4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x32c4('0x13'));var as=require(_0x32c4('0x14'));var hardwareService=require(_0x32c4('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x32c4('0x16'));var config=require(_0x32c4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x32c4('0x18'))['db'];function respondWithStatusCode(_0x53a104,_0x456f4e){_0x456f4e=_0x456f4e||0xcc;return function(_0x3aff2d){if(_0x3aff2d){return _0x53a104['sendStatus'](_0x456f4e);}return _0x53a104['status'](_0x456f4e)['end']();};}function respondWithResult(_0x5e7e37,_0x20ba8d){_0x20ba8d=_0x20ba8d||0xc8;return function(_0x4e734d){if(_0x4e734d){return _0x5e7e37[_0x32c4('0x19')](_0x20ba8d)['json'](_0x4e734d);}};}function respondWithFilteredResult(_0x17c9c0,_0x51132a){return function(_0x436b8c){if(_0x436b8c){var _0x21bf63=typeof _0x51132a[_0x32c4('0x1a')]===_0x32c4('0x1b')&&typeof _0x51132a[_0x32c4('0x1c')]===_0x32c4('0x1b');var _0x26baff=_0x436b8c[_0x32c4('0x1d')];var _0x3478a5=_0x21bf63?0x0:_0x51132a[_0x32c4('0x1a')];var _0x29f139=_0x21bf63?_0x436b8c[_0x32c4('0x1d')]:_0x51132a[_0x32c4('0x1a')]+_0x51132a[_0x32c4('0x1c')];var _0x957ca0;if(_0x29f139>=_0x26baff){_0x29f139=_0x26baff;_0x957ca0=0xc8;}else{_0x957ca0=0xce;}_0x17c9c0[_0x32c4('0x19')](_0x957ca0);return _0x17c9c0[_0x32c4('0x1e')](_0x32c4('0x1f'),_0x3478a5+'-'+_0x29f139+'/'+_0x26baff)[_0x32c4('0x20')](_0x436b8c);}return null;};}function patchUpdates(_0x2a1068){return function(_0x3a565b){try{jsonpatch['apply'](_0x3a565b,_0x2a1068,!![]);}catch(_0x12354d){return BPromise[_0x32c4('0x21')](_0x12354d);}return _0x3a565b[_0x32c4('0x22')]();};}function saveUpdates(_0x163821,_0x1700ff){return function(_0x3b232c){if(_0x3b232c){return _0x3b232c['update'](_0x163821)[_0x32c4('0x23')](function(_0x36657d){return _0x36657d;});}return null;};}function removeEntity(_0x2a1c9c,_0x1936da){return function(_0x441e4c){if(_0x441e4c){return _0x441e4c['destroy']()[_0x32c4('0x23')](function(){_0x2a1c9c[_0x32c4('0x19')](0xcc)[_0x32c4('0x24')]();});}};}function handleEntityNotFound(_0x820d14,_0x4abe97){return function(_0x383222){if(!_0x383222){_0x820d14[_0x32c4('0x25')](0x194);}return _0x383222;};}function handleError(_0x2818b9,_0x5e767a){_0x5e767a=_0x5e767a||0x1f4;return function(_0x1d235a){logger[_0x32c4('0x26')](_0x1d235a[_0x32c4('0x27')]);if(_0x1d235a[_0x32c4('0x28')]){delete _0x1d235a[_0x32c4('0x28')];}_0x2818b9['status'](_0x5e767a)[_0x32c4('0x29')](_0x1d235a);};}exports[_0x32c4('0x2a')]=function(_0x2fc966,_0x28ca91){var _0xaa75db={},_0x1bdfcc={},_0x2c87e5={'count':0x0,'rows':[]};var _0x2ac0f5=_['map'](db[_0x32c4('0x2b')][_0x32c4('0x2c')],function(_0x2c539f){return{'name':_0x2c539f[_0x32c4('0x2d')],'type':_0x2c539f['type']['key']};});_0x1bdfcc[_0x32c4('0x2e')]=_[_0x32c4('0x2f')](_0x2ac0f5,_0x32c4('0x28'));_0x1bdfcc[_0x32c4('0x30')]=_[_0x32c4('0x31')](_0x2fc966[_0x32c4('0x30')]);_0x1bdfcc['filters']=_[_0x32c4('0x32')](_0x1bdfcc[_0x32c4('0x2e')],_0x1bdfcc[_0x32c4('0x30')]);_0xaa75db[_0x32c4('0x33')]=_[_0x32c4('0x32')](_0x1bdfcc[_0x32c4('0x2e')],qs['fields'](_0x2fc966[_0x32c4('0x30')]['fields']));_0xaa75db['attributes']=_0xaa75db['attributes']['length']?_0xaa75db[_0x32c4('0x33')]:_0x1bdfcc['model'];if(!_0x2fc966[_0x32c4('0x30')][_0x32c4('0x34')](_0x32c4('0x35'))){_0xaa75db[_0x32c4('0x1c')]=qs[_0x32c4('0x1c')](_0x2fc966[_0x32c4('0x30')][_0x32c4('0x1c')]);_0xaa75db['offset']=qs[_0x32c4('0x1a')](_0x2fc966['query'][_0x32c4('0x1a')]);}_0xaa75db[_0x32c4('0x36')]=qs[_0x32c4('0x37')](_0x2fc966['query'][_0x32c4('0x37')]);_0xaa75db[_0x32c4('0x38')]=qs[_0x32c4('0x39')](_[_0x32c4('0x3a')](_0x2fc966['query'],_0x1bdfcc['filters']),_0x2ac0f5);if(_0x2fc966[_0x32c4('0x30')][_0x32c4('0x3b')]){_0xaa75db['where']=_[_0x32c4('0x3c')](_0xaa75db['where'],{'$or':_[_0x32c4('0x2f')](_0x2ac0f5,function(_0x27c9ed){if(_0x27c9ed['type']!==_0x32c4('0x3d')){var _0x4f5330={};_0x4f5330[_0x27c9ed[_0x32c4('0x28')]]={'$like':'%'+_0x2fc966[_0x32c4('0x30')][_0x32c4('0x3b')]+'%'};return _0x4f5330;}})});}_0xaa75db=_[_0x32c4('0x3c')]({},_0xaa75db,_0x2fc966[_0x32c4('0x3e')]);var _0x22adca={'where':_0xaa75db[_0x32c4('0x38')]};return db['MailTransferReport'][_0x32c4('0x1d')](_0x22adca)[_0x32c4('0x23')](function(_0x5de2fd){_0x2c87e5['count']=_0x5de2fd;if(_0x2fc966[_0x32c4('0x30')][_0x32c4('0x3f')]){_0xaa75db[_0x32c4('0x40')]=[{'all':!![]}];}return db[_0x32c4('0x2b')]['findAll'](_0xaa75db);})[_0x32c4('0x23')](function(_0x33ee02){_0x2c87e5[_0x32c4('0x41')]=_0x33ee02;return _0x2c87e5;})[_0x32c4('0x23')](respondWithFilteredResult(_0x28ca91,_0xaa75db))[_0x32c4('0x42')](handleError(_0x28ca91,null));};exports[_0x32c4('0x43')]=function(_0x49d81c,_0x294092){var _0xc1930f={'raw':!![],'where':{'id':_0x49d81c[_0x32c4('0x44')]['id']}},_0x482584={};_0x482584[_0x32c4('0x2e')]=_[_0x32c4('0x31')](db[_0x32c4('0x2b')]['rawAttributes']);_0x482584[_0x32c4('0x30')]=_[_0x32c4('0x31')](_0x49d81c[_0x32c4('0x30')]);_0x482584[_0x32c4('0x39')]=_[_0x32c4('0x32')](_0x482584[_0x32c4('0x2e')],_0x482584[_0x32c4('0x30')]);_0xc1930f['attributes']=_['intersection'](_0x482584[_0x32c4('0x2e')],qs['fields'](_0x49d81c['query']['fields']));_0xc1930f[_0x32c4('0x33')]=_0xc1930f['attributes'][_0x32c4('0x45')]?_0xc1930f['attributes']:_0x482584[_0x32c4('0x2e')];if(_0x49d81c['query'][_0x32c4('0x3f')]){_0xc1930f[_0x32c4('0x40')]=[{'all':!![]}];}_0xc1930f=_[_0x32c4('0x3c')]({},_0xc1930f,_0x49d81c[_0x32c4('0x3e')]);return db[_0x32c4('0x2b')][_0x32c4('0x46')](_0xc1930f)[_0x32c4('0x23')](handleEntityNotFound(_0x294092,null))[_0x32c4('0x23')](respondWithResult(_0x294092,null))['catch'](handleError(_0x294092,null));};exports[_0x32c4('0x47')]=function(_0x2050e4,_0x2fa0de){return db[_0x32c4('0x2b')][_0x32c4('0x47')](_0x2050e4[_0x32c4('0x48')],{})['then'](respondWithResult(_0x2fa0de,0xc9))[_0x32c4('0x42')](handleError(_0x2fa0de,null));};exports[_0x32c4('0x49')]=function(_0x4d48d1,_0x3b693d){if(_0x4d48d1[_0x32c4('0x48')]['id']){delete _0x4d48d1[_0x32c4('0x48')]['id'];}return db[_0x32c4('0x2b')]['find']({'where':{'id':_0x4d48d1[_0x32c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b693d,null))['then'](saveUpdates(_0x4d48d1[_0x32c4('0x48')],null))[_0x32c4('0x23')](respondWithResult(_0x3b693d,null))[_0x32c4('0x42')](handleError(_0x3b693d,null));};exports['destroy']=function(_0x1de38e,_0x5984de){return db[_0x32c4('0x2b')][_0x32c4('0x46')]({'where':{'id':_0x1de38e[_0x32c4('0x44')]['id']}})[_0x32c4('0x23')](handleEntityNotFound(_0x5984de,null))[_0x32c4('0x23')](removeEntity(_0x5984de,null))['catch'](handleError(_0x5984de,null));};exports[_0x32c4('0x4a')]=function(_0xf933ef,_0x2370da){return db[_0x32c4('0x2b')][_0x32c4('0x4a')]()[_0x32c4('0x23')](respondWithResult(_0x2370da,null))[_0x32c4('0x42')](handleError(_0x2370da,null));}; \ No newline at end of file +var _0x65e6=['util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','options','find','create','body','params','describe','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x493c9d,_0x555253){var _0x2a924c=function(_0x2383f2){while(--_0x2383f2){_0x493c9d['push'](_0x493c9d['shift']());}};_0x2a924c(++_0x555253);}(_0x65e6,0xe0));var _0x665e=function(_0x5d281d,_0x41e380){_0x5d281d=_0x5d281d-0x0;var _0x139fa1=_0x65e6[_0x5d281d];return _0x139fa1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x665e('0x0'));var rp=require(_0x665e('0x1'));var moment=require('moment');var BPromise=require(_0x665e('0x2'));var Mustache=require(_0x665e('0x3'));var util=require(_0x665e('0x4'));var path=require(_0x665e('0x5'));var sox=require(_0x665e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x665e('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x665e('0x8'));var jsforce=require(_0x665e('0x9'));var deskjs=require(_0x665e('0xa'));var toCsv=require('to-csv');var querystring=require(_0x665e('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x665e('0xc'));var qs=require(_0x665e('0xd'));var as=require(_0x665e('0xe'));var hardwareService=require(_0x665e('0xf'));var logger=require(_0x665e('0x10'))(_0x665e('0x11'));var utils=require(_0x665e('0x12'));var config=require(_0x665e('0x13'));var licenseUtil=require(_0x665e('0x14'));var db=require(_0x665e('0x15'))['db'];function respondWithStatusCode(_0x23058b,_0x35f989){_0x35f989=_0x35f989||0xcc;return function(_0x31c665){if(_0x31c665){return _0x23058b[_0x665e('0x16')](_0x35f989);}return _0x23058b[_0x665e('0x17')](_0x35f989)[_0x665e('0x18')]();};}function respondWithResult(_0x215570,_0x3ff4d2){_0x3ff4d2=_0x3ff4d2||0xc8;return function(_0x4285b8){if(_0x4285b8){return _0x215570[_0x665e('0x17')](_0x3ff4d2)[_0x665e('0x19')](_0x4285b8);}};}function respondWithFilteredResult(_0x5816d7,_0x66cd3f){return function(_0x4c08e4){if(_0x4c08e4){var _0x370418=typeof _0x66cd3f[_0x665e('0x1a')]===_0x665e('0x1b')&&typeof _0x66cd3f['limit']===_0x665e('0x1b');var _0x68c883=_0x4c08e4['count'];var _0x460dfb=_0x370418?0x0:_0x66cd3f[_0x665e('0x1a')];var _0x12d95a=_0x370418?_0x4c08e4[_0x665e('0x1c')]:_0x66cd3f[_0x665e('0x1a')]+_0x66cd3f[_0x665e('0x1d')];var _0x2746e0;if(_0x12d95a>=_0x68c883){_0x12d95a=_0x68c883;_0x2746e0=0xc8;}else{_0x2746e0=0xce;}_0x5816d7['status'](_0x2746e0);return _0x5816d7[_0x665e('0x1e')](_0x665e('0x1f'),_0x460dfb+'-'+_0x12d95a+'/'+_0x68c883)[_0x665e('0x19')](_0x4c08e4);}return null;};}function patchUpdates(_0x3494f6){return function(_0x11072e){try{jsonpatch[_0x665e('0x20')](_0x11072e,_0x3494f6,!![]);}catch(_0x2889cf){return BPromise[_0x665e('0x21')](_0x2889cf);}return _0x11072e[_0x665e('0x22')]();};}function saveUpdates(_0x4ff168,_0x59b79b){return function(_0x106045){if(_0x106045){return _0x106045[_0x665e('0x23')](_0x4ff168)[_0x665e('0x24')](function(_0x46319d){return _0x46319d;});}return null;};}function removeEntity(_0x2bee29,_0x5365cc){return function(_0x8f7163){if(_0x8f7163){return _0x8f7163[_0x665e('0x25')]()[_0x665e('0x24')](function(){_0x2bee29[_0x665e('0x17')](0xcc)[_0x665e('0x18')]();});}};}function handleEntityNotFound(_0x58a3d6,_0x2780e1){return function(_0x5715fa){if(!_0x5715fa){_0x58a3d6[_0x665e('0x16')](0x194);}return _0x5715fa;};}function handleError(_0x5eabd7,_0x1875b8){_0x1875b8=_0x1875b8||0x1f4;return function(_0x23a5da){logger['error'](_0x23a5da[_0x665e('0x26')]);if(_0x23a5da[_0x665e('0x27')]){delete _0x23a5da[_0x665e('0x27')];}_0x5eabd7[_0x665e('0x17')](_0x1875b8)[_0x665e('0x28')](_0x23a5da);};}exports[_0x665e('0x29')]=function(_0x47767e,_0x2e8b28){var _0x2bf6ea={},_0xefdba5={},_0x4e0590={'count':0x0,'rows':[]};var _0x4fa27d=_[_0x665e('0x2a')](db[_0x665e('0x2b')][_0x665e('0x2c')],function(_0x46f05b){return{'name':_0x46f05b[_0x665e('0x2d')],'type':_0x46f05b[_0x665e('0x2e')][_0x665e('0x2f')]};});_0xefdba5[_0x665e('0x30')]=_[_0x665e('0x2a')](_0x4fa27d,_0x665e('0x27'));_0xefdba5['query']=_[_0x665e('0x31')](_0x47767e['query']);_0xefdba5[_0x665e('0x32')]=_[_0x665e('0x33')](_0xefdba5[_0x665e('0x30')],_0xefdba5['query']);_0x2bf6ea[_0x665e('0x34')]=_['intersection'](_0xefdba5[_0x665e('0x30')],qs[_0x665e('0x35')](_0x47767e['query']['fields']));_0x2bf6ea['attributes']=_0x2bf6ea[_0x665e('0x34')][_0x665e('0x36')]?_0x2bf6ea['attributes']:_0xefdba5['model'];if(!_0x47767e[_0x665e('0x37')][_0x665e('0x38')](_0x665e('0x39'))){_0x2bf6ea[_0x665e('0x1d')]=qs[_0x665e('0x1d')](_0x47767e[_0x665e('0x37')][_0x665e('0x1d')]);_0x2bf6ea['offset']=qs[_0x665e('0x1a')](_0x47767e['query'][_0x665e('0x1a')]);}_0x2bf6ea[_0x665e('0x3a')]=qs['sort'](_0x47767e[_0x665e('0x37')][_0x665e('0x3b')]);_0x2bf6ea['where']=qs['filters'](_[_0x665e('0x3c')](_0x47767e[_0x665e('0x37')],_0xefdba5['filters']),_0x4fa27d);if(_0x47767e[_0x665e('0x37')][_0x665e('0x3d')]){_0x2bf6ea[_0x665e('0x3e')]=_['merge'](_0x2bf6ea[_0x665e('0x3e')],{'$or':_[_0x665e('0x2a')](_0x4fa27d,function(_0xf2c47){if(_0xf2c47[_0x665e('0x2e')]!==_0x665e('0x3f')){var _0x455df9={};_0x455df9[_0xf2c47['name']]={'$like':'%'+_0x47767e[_0x665e('0x37')][_0x665e('0x3d')]+'%'};return _0x455df9;}})});}_0x2bf6ea=_[_0x665e('0x40')]({},_0x2bf6ea,_0x47767e['options']);var _0x291f5c={'where':_0x2bf6ea[_0x665e('0x3e')]};return db['MailTransferReport'][_0x665e('0x1c')](_0x291f5c)['then'](function(_0x435f43){_0x4e0590['count']=_0x435f43;if(_0x47767e[_0x665e('0x37')][_0x665e('0x41')]){_0x2bf6ea[_0x665e('0x42')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x2bf6ea);})['then'](function(_0x1e48d8){_0x4e0590[_0x665e('0x43')]=_0x1e48d8;return _0x4e0590;})[_0x665e('0x24')](respondWithFilteredResult(_0x2e8b28,_0x2bf6ea))[_0x665e('0x44')](handleError(_0x2e8b28,null));};exports[_0x665e('0x45')]=function(_0x50e235,_0x43948c){var _0x19f682={'raw':!![],'where':{'id':_0x50e235['params']['id']}},_0x15cb2f={};_0x15cb2f[_0x665e('0x30')]=_[_0x665e('0x31')](db['MailTransferReport'][_0x665e('0x2c')]);_0x15cb2f['query']=_[_0x665e('0x31')](_0x50e235[_0x665e('0x37')]);_0x15cb2f[_0x665e('0x32')]=_['intersection'](_0x15cb2f[_0x665e('0x30')],_0x15cb2f[_0x665e('0x37')]);_0x19f682[_0x665e('0x34')]=_[_0x665e('0x33')](_0x15cb2f[_0x665e('0x30')],qs[_0x665e('0x35')](_0x50e235[_0x665e('0x37')][_0x665e('0x35')]));_0x19f682[_0x665e('0x34')]=_0x19f682['attributes'][_0x665e('0x36')]?_0x19f682[_0x665e('0x34')]:_0x15cb2f[_0x665e('0x30')];if(_0x50e235['query'][_0x665e('0x41')]){_0x19f682['include']=[{'all':!![]}];}_0x19f682=_[_0x665e('0x40')]({},_0x19f682,_0x50e235[_0x665e('0x46')]);return db['MailTransferReport'][_0x665e('0x47')](_0x19f682)[_0x665e('0x24')](handleEntityNotFound(_0x43948c,null))[_0x665e('0x24')](respondWithResult(_0x43948c,null))['catch'](handleError(_0x43948c,null));};exports[_0x665e('0x48')]=function(_0x36b3b0,_0x34dc95){return db[_0x665e('0x2b')]['create'](_0x36b3b0[_0x665e('0x49')],{})[_0x665e('0x24')](respondWithResult(_0x34dc95,0xc9))[_0x665e('0x44')](handleError(_0x34dc95,null));};exports['update']=function(_0x3c724a,_0x15e628){if(_0x3c724a[_0x665e('0x49')]['id']){delete _0x3c724a['body']['id'];}return db[_0x665e('0x2b')][_0x665e('0x47')]({'where':{'id':_0x3c724a[_0x665e('0x4a')]['id']}})[_0x665e('0x24')](handleEntityNotFound(_0x15e628,null))['then'](saveUpdates(_0x3c724a[_0x665e('0x49')],null))[_0x665e('0x24')](respondWithResult(_0x15e628,null))[_0x665e('0x44')](handleError(_0x15e628,null));};exports[_0x665e('0x25')]=function(_0x5f1f1a,_0x5660d3){return db[_0x665e('0x2b')][_0x665e('0x47')]({'where':{'id':_0x5f1f1a[_0x665e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5660d3,null))[_0x665e('0x24')](removeEntity(_0x5660d3,null))[_0x665e('0x44')](handleError(_0x5660d3,null));};exports[_0x665e('0x4b')]=function(_0x71f642,_0x481219){return db[_0x665e('0x2b')][_0x665e('0x4b')]()[_0x665e('0x24')](respondWithResult(_0x481219,null))[_0x665e('0x44')](handleError(_0x481219,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4d0e6f2..8bda963 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 _0x535d=['exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x535d,0xe8));var _0xd535=function(_0x2a44d3,_0x27c980){_0x2a44d3=_0x2a44d3-0x0;var _0x25c4bc=_0x535d[_0x2a44d3];return _0x25c4bc;};'use strict';var _=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var logger=require('../../config/logger')(_0xd535('0x2'));var moment=require(_0xd535('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd535('0x4'));var rimraf=require(_0xd535('0x5'));var config=require(_0xd535('0x6'));var attributes=require(_0xd535('0x7'));module[_0xd535('0x8')]=function(_0xa9d48d,_0x4a25fa){return _0xa9d48d['define'](_0xd535('0x9'),attributes,{'tableName':_0xd535('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd535('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xebfb=['report_mail_transfer','uniqueid','util','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xebfb,0x10a));var _0xbebf=function(_0x1aabec,_0x264d37){_0x1aabec=_0x1aabec-0x0;var _0x5152ec=_0xebfb[_0x1aabec];return _0x5152ec;};'use strict';var _=require('lodash');var util=require(_0xbebf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbebf('0x1'));var BPromise=require(_0xbebf('0x2'));var rp=require(_0xbebf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbebf('0x4'));var config=require(_0xbebf('0x5'));var attributes=require(_0xbebf('0x6'));module[_0xbebf('0x7')]=function(_0x5c973b,_0x315042){return _0x5c973b['define'](_0xbebf('0x8'),attributes,{'tableName':_0xbebf('0x9'),'paranoid':![],'indexes':[{'name':_0xbebf('0xa'),'fields':[_0xbebf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 915626e..36dc9e7 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 _0x9388=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x379fff,_0x4c6b70){var _0x3cd70c=function(_0x50edbb){while(--_0x50edbb){_0x379fff['push'](_0x379fff['shift']());}};_0x3cd70c(++_0x4c6b70);}(_0x9388,0x1e8));var _0x8938=function(_0x5eaf1e,_0x13f2f2){_0x5eaf1e=_0x5eaf1e-0x0;var _0x16520f=_0x9388[_0x5eaf1e];return _0x16520f;};'use strict';var _=require(_0x8938('0x0'));var util=require(_0x8938('0x1'));var moment=require(_0x8938('0x2'));var BPromise=require(_0x8938('0x3'));var rs=require(_0x8938('0x4'));var fs=require('fs');var Redis=require(_0x8938('0x5'));var db=require(_0x8938('0x6'))['db'];var utils=require(_0x8938('0x7'));var logger=require(_0x8938('0x8'))(_0x8938('0x9'));var config=require('../../config/environment');var jayson=require(_0x8938('0xa'));var client=jayson[_0x8938('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb30b,_0x1c1d23,_0x4c8e24){return new BPromise(function(_0x12dcc9,_0x35a9a5){return client[_0x8938('0xc')](_0x5bb30b,_0x4c8e24)[_0x8938('0xd')](function(_0x2230e2){logger['info'](_0x8938('0xe'),_0x1c1d23,_0x8938('0xf'));logger[_0x8938('0x10')](_0x8938('0x11'),_0x1c1d23,_0x8938('0xf'),JSON[_0x8938('0x12')](_0x2230e2));if(_0x2230e2[_0x8938('0x13')]){if(_0x2230e2[_0x8938('0x13')][_0x8938('0x14')]===0x1f4){logger[_0x8938('0x13')](_0x8938('0xe'),_0x1c1d23,_0x2230e2[_0x8938('0x13')][_0x8938('0x15')]);return _0x35a9a5(_0x2230e2[_0x8938('0x13')][_0x8938('0x15')]);}logger[_0x8938('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x1c1d23,_0x2230e2['error']['message']);return _0x12dcc9(_0x2230e2['error'][_0x8938('0x15')]);}else{logger[_0x8938('0x16')]('MailTransferReport,\x20%s,\x20%s',_0x1c1d23,_0x8938('0xf'));_0x12dcc9(_0x2230e2[_0x8938('0x17')][_0x8938('0x15')]);}})['catch'](function(_0xa5f933){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1c1d23,_0xa5f933);_0x35a9a5(_0xa5f933);});});} \ No newline at end of file +var _0x2add=['then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x2add,0x7b));var _0xd2ad=function(_0x553e1f,_0x52741){_0x553e1f=_0x553e1f-0x0;var _0x45728a=_0x2add[_0x553e1f];return _0x45728a;};'use strict';var _=require(_0xd2ad('0x0'));var util=require(_0xd2ad('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd2ad('0x2'));var fs=require('fs');var Redis=require(_0xd2ad('0x3'));var db=require(_0xd2ad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2ad('0x5'))('rpc');var config=require(_0xd2ad('0x6'));var jayson=require(_0xd2ad('0x7'));var client=jayson['client'][_0xd2ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56a76b,_0x3d6f40,_0x5483ea){return new BPromise(function(_0x328a71,_0x56dc03){return client[_0xd2ad('0x9')](_0x56a76b,_0x5483ea)[_0xd2ad('0xa')](function(_0x12d0df){logger['info'](_0xd2ad('0xb'),_0x3d6f40,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x3d6f40,_0xd2ad('0xc'),JSON[_0xd2ad('0xd')](_0x12d0df));if(_0x12d0df[_0xd2ad('0xe')]){if(_0x12d0df[_0xd2ad('0xe')][_0xd2ad('0xf')]===0x1f4){logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x12d0df[_0xd2ad('0xe')][_0xd2ad('0x10')]);return _0x56dc03(_0x12d0df[_0xd2ad('0xe')]['message']);}logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x12d0df['error'][_0xd2ad('0x10')]);return _0x328a71(_0x12d0df[_0xd2ad('0xe')]['message']);}else{logger['info'](_0xd2ad('0xb'),_0x3d6f40,_0xd2ad('0xc'));_0x328a71(_0x12d0df[_0xd2ad('0x11')]['message']);}})[_0xd2ad('0x12')](function(_0x5147c1){logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x5147c1);_0x56dc03(_0x5147c1);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 9726725..7bd2b29 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 _0x9379=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x9379,0x14b));var _0x9937=function(_0x37aab4,_0xb7cc1e){_0x37aab4=_0x37aab4-0x0;var _0x16949a=_0x9379[_0x37aab4];return _0x16949a;};'use strict';var multer=require(_0x9937('0x0'));var util=require(_0x9937('0x1'));var path=require('path');var timeout=require(_0x9937('0x2'));var express=require(_0x9937('0x3'));var router=express[_0x9937('0x4')]();var fs_extra=require(_0x9937('0x5'));var auth=require(_0x9937('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9937('0x7'));var controller=require(_0x9937('0x8'));router[_0x9937('0x9')]('/',auth[_0x9937('0xa')](),controller[_0x9937('0xb')]);router[_0x9937('0x9')](_0x9937('0xc'),auth[_0x9937('0xa')](),controller[_0x9937('0xd')]);router[_0x9937('0x9')](_0x9937('0xe'),auth[_0x9937('0xa')](),controller[_0x9937('0xf')]);router[_0x9937('0x10')]('/',auth[_0x9937('0xa')](),controller[_0x9937('0x11')]);router[_0x9937('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9937('0x13')]);router[_0x9937('0x14')](_0x9937('0xe'),auth[_0x9937('0xa')](),controller[_0x9937('0x15')]);module[_0x9937('0x16')]=router; \ No newline at end of file +var _0x8a54=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','/:id','show','post','create'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x8a54,0x9c));var _0x48a5=function(_0x109cb5,_0x47385c){_0x109cb5=_0x109cb5-0x0;var _0x2b21cb=_0x8a54[_0x109cb5];return _0x2b21cb;};'use strict';var multer=require(_0x48a5('0x0'));var util=require(_0x48a5('0x1'));var path=require('path');var timeout=require(_0x48a5('0x2'));var express=require(_0x48a5('0x3'));var router=express[_0x48a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x48a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48a5('0x6'));var controller=require(_0x48a5('0x7'));router[_0x48a5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x48a5('0x9'),auth[_0x48a5('0xa')](),controller['describe']);router[_0x48a5('0x8')](_0x48a5('0xb'),auth[_0x48a5('0xa')](),controller[_0x48a5('0xc')]);router[_0x48a5('0xd')]('/',auth[_0x48a5('0xa')](),controller[_0x48a5('0xe')]);router[_0x48a5('0xf')]('/:id',auth[_0x48a5('0xa')](),controller['update']);router[_0x48a5('0x10')](_0x48a5('0xb'),auth[_0x48a5('0xa')](),controller[_0x48a5('0x11')]);module[_0x48a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a33acfb..00a3624 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 _0x51d3=['exports','STRING','DEFAULT\x20PAUSE','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x41bc31,_0x402a02){var _0x4ada39=function(_0x31a0ef){while(--_0x31a0ef){_0x41bc31['push'](_0x41bc31['shift']());}};_0x4ada39(++_0x402a02);}(_0x51d3,0x8b));var _0x351d=function(_0x65924e,_0x4e2f0d){_0x65924e=_0x65924e-0x0;var _0x5e85b8=_0x51d3[_0x65924e];return _0x5e85b8;};'use strict';var Sequelize=require(_0x351d('0x0'));var moment=require('moment');module[_0x351d('0x1')]={'channel':{'type':Sequelize[_0x351d('0x2')]},'membername':{'type':Sequelize[_0x351d('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x351d('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x351d('0x4')]},'exitAt':{'type':Sequelize[_0x351d('0x4')],'set':function(_0x294978){var _0x1702fb=moment(_0x294978);var _0x12faa5=moment(this['getDataValue'](_0x351d('0x5')));var _0x38c77b=_0x1702fb[_0x351d('0x6')](_0x12faa5,_0x351d('0x7'));this[_0x351d('0x8')](_0x351d('0x9'),_0x294978);this[_0x351d('0x8')](_0x351d('0xa'),_0x38c77b>=0x0?_0x38c77b:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x351d('0x2')],'comment':_0x351d('0xb')},'data3':{'type':Sequelize[_0x351d('0x2')],'comment':_0x351d('0xc')},'data4':{'type':Sequelize[_0x351d('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x351d('0x2')],'comment':_0x351d('0xd')},'role':{'type':Sequelize[_0x351d('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x351d('0x2')]}}; \ No newline at end of file +var _0x2d74=['INTEGER','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','enterAt','diff','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x2d74,0x187));var _0x42d7=function(_0x1fae40,_0x42597d){_0x1fae40=_0x1fae40-0x0;var _0x5a2bfa=_0x2d74[_0x1fae40];return _0x5a2bfa;};'use strict';var Sequelize=require(_0x42d7('0x0'));var moment=require(_0x42d7('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x42d7('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x42d7('0x3'),'comment':_0x42d7('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x35bfba){var _0xe05f0f=moment(_0x35bfba);var _0x4fff3f=moment(this['getDataValue'](_0x42d7('0x5')));var _0x1c8e66=_0xe05f0f[_0x42d7('0x6')](_0x4fff3f,'seconds');this[_0x42d7('0x7')]('exitAt',_0x35bfba);this[_0x42d7('0x7')]('duration',_0x1c8e66>=0x0?_0x1c8e66:null);}},'data1':{'type':Sequelize[_0x42d7('0x2')],'comment':_0x42d7('0x8')},'data2':{'type':Sequelize[_0x42d7('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x42d7('0x2')],'comment':_0x42d7('0x9')},'data4':{'type':Sequelize[_0x42d7('0x2')],'comment':_0x42d7('0xa')},'data5':{'type':Sequelize[_0x42d7('0x2')],'comment':_0x42d7('0xb')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x42d7('0xc')]},'uniqueid':{'type':Sequelize[_0x42d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8bf9576..bd3e06c 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(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x34e8,0x12c));var _0x834e=function(_0x3d3115,_0x319b46){_0x3d3115=_0x3d3115-0x0;var _0x1daa16=_0x34e8[_0x3d3115];return _0x1daa16;};'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(_0x18c284,_0x1cd679){var _0x2fdf50=function(_0x162e11){while(--_0x162e11){_0x18c284['push'](_0x18c284['shift']());}};_0x2fdf50(++_0x1cd679);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 a3c77a9..6c18bba 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 _0xacc6=['api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger'];(function(_0x239292,_0x4662d5){var _0x478273=function(_0x510a55){while(--_0x510a55){_0x239292['push'](_0x239292['shift']());}};_0x478273(++_0x4662d5);}(_0xacc6,0x11d));var _0x6acc=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xacc6[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var logger=require(_0x6acc('0x2'))(_0x6acc('0x3'));var moment=require(_0x6acc('0x4'));var BPromise=require(_0x6acc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6acc('0x6'));var rimraf=require(_0x6acc('0x7'));var config=require(_0x6acc('0x8'));var attributes=require(_0x6acc('0x9'));module[_0x6acc('0xa')]=function(_0x21cc28,_0x21ca1b){return _0x21cc28[_0x6acc('0xb')]('MemberReport',attributes,{'tableName':_0x6acc('0xc'),'paranoid':![],'indexes':[{'name':_0x6acc('0xd'),'fields':[_0x6acc('0xe'),_0x6acc('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x744c=['exports','define','membername_interface','membername','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4fee41,_0x2a1b3b){var _0x35a6d1=function(_0xa5a5d9){while(--_0xa5a5d9){_0x4fee41['push'](_0x4fee41['shift']());}};_0x35a6d1(++_0x2a1b3b);}(_0x744c,0xa0));var _0xc744=function(_0x30a1b6,_0x158e1e){_0x30a1b6=_0x30a1b6-0x0;var _0x304819=_0x744c[_0x30a1b6];return _0x304819;};'use strict';var _=require(_0xc744('0x0'));var util=require(_0xc744('0x1'));var logger=require(_0xc744('0x2'))(_0xc744('0x3'));var moment=require('moment');var BPromise=require(_0xc744('0x4'));var rp=require(_0xc744('0x5'));var fs=require('fs');var path=require(_0xc744('0x6'));var rimraf=require(_0xc744('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xc744('0x8')]=function(_0x1cc521,_0x471094){return _0x1cc521[_0xc744('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xc744('0xa'),'fields':[_0xc744('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index c4adf03..ea99299 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 _0xb923=['raw','where','attributes','model','include','map','stringify','create','CreateMemberReport','catch','UpdateMemberReport','update','body','limit','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','info','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x45bd44,_0x4c37ab){var _0x4f8f37=function(_0x5a3a45){while(--_0x5a3a45){_0x45bd44['push'](_0x45bd44['shift']());}};_0x4f8f37(++_0x4c37ab);}(_0xb923,0xa2));var _0x3b92=function(_0xc3b992,_0x49e807){_0xc3b992=_0xc3b992-0x0;var _0x212dc0=_0xb923[_0xc3b992];return _0x212dc0;};'use strict';var _=require(_0x3b92('0x0'));var util=require(_0x3b92('0x1'));var moment=require(_0x3b92('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b92('0x3'));var fs=require('fs');var Redis=require(_0x3b92('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require(_0x3b92('0x7'));var client=jayson[_0x3b92('0x8')][_0x3b92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b490c,_0x6809d9,_0x48b468){return new BPromise(function(_0x511c10,_0x2aefa5){return client['request'](_0x2b490c,_0x48b468)[_0x3b92('0xa')](function(_0x43b28a){logger['info'](_0x3b92('0xb'),_0x6809d9,_0x3b92('0xc'));logger[_0x3b92('0xd')](_0x3b92('0xe'),_0x6809d9,_0x3b92('0xc'),JSON['stringify'](_0x43b28a));if(_0x43b28a[_0x3b92('0xf')]){if(_0x43b28a['error']['code']===0x1f4){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);return _0x2aefa5(_0x43b28a['error']['message']);}logger[_0x3b92('0xf')]('MemberReport,\x20%s,\x20%s',_0x6809d9,_0x43b28a['error'][_0x3b92('0x10')]);return _0x511c10(_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);}else{logger[_0x3b92('0x11')](_0x3b92('0xb'),_0x6809d9,'request\x20sent');_0x511c10(_0x43b28a[_0x3b92('0x12')][_0x3b92('0x10')]);}})['catch'](function(_0x4e6da7){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x4e6da7);_0x2aefa5(_0x4e6da7);});});}exports[_0x3b92('0x13')]=function(_0x1859b4){var _0x3d7f80=this;return new Promise(function(_0xc2cd15,_0x361754){return db[_0x3b92('0x14')][_0x3b92('0x15')]({'raw':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x17')]===undefined?!![]:![]:!![],'where':_0x1859b4[_0x3b92('0x16')]?_0x1859b4['options'][_0x3b92('0x18')]||null:null,'attributes':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x19')]||null:null,'limit':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['limit']||null:null,'include':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['include']?_['map'](_0x1859b4['options']['include'],function(_0x450f2e){return{'model':db[_0x450f2e[_0x3b92('0x1a')]],'as':_0x450f2e['as'],'attributes':_0x450f2e[_0x3b92('0x19')],'include':_0x450f2e[_0x3b92('0x1b')]?_[_0x3b92('0x1c')](_0x450f2e[_0x3b92('0x1b')],function(_0x427a90){return{'model':db[_0x427a90['model']],'as':_0x427a90['as'],'attributes':_0x427a90[_0x3b92('0x19')],'include':_0x427a90['include']?_[_0x3b92('0x1c')](_0x427a90['include'],function(_0x24a15f){return{'model':db[_0x24a15f[_0x3b92('0x1a')]],'as':_0x24a15f['as'],'attributes':_0x24a15f[_0x3b92('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3b92('0xa')](function(_0x42fc82){logger[_0x3b92('0x11')]('GetMemberReport',_0x1859b4);logger[_0x3b92('0xd')](_0x3b92('0x13'),_0x1859b4,JSON[_0x3b92('0x1d')](_0x42fc82));_0xc2cd15(_0x42fc82);})['catch'](function(_0x4ac7b4){logger[_0x3b92('0xf')](_0x3b92('0x13'),_0x4ac7b4['message'],_0x1859b4);_0x361754(_0x3d7f80['error'](0x1f4,_0x4ac7b4[_0x3b92('0x10')]));});});};exports['CreateMemberReport']=function(_0x2d8b2e){var _0x4e404c=this;return new Promise(function(_0x5b8e18,_0x4a3596){return db[_0x3b92('0x14')][_0x3b92('0x1e')](_0x2d8b2e['body'],{'raw':_0x2d8b2e[_0x3b92('0x16')]?_0x2d8b2e[_0x3b92('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3b92('0xa')](function(_0x44e13){logger[_0x3b92('0x11')]('CreateMemberReport',_0x2d8b2e);logger['debug'](_0x3b92('0x1f'),_0x2d8b2e,JSON[_0x3b92('0x1d')](_0x44e13));_0x5b8e18(_0x44e13);})[_0x3b92('0x20')](function(_0x55f9ad){logger['error'](_0x3b92('0x1f'),_0x55f9ad['message'],_0x2d8b2e);_0x4a3596(_0x4e404c[_0x3b92('0xf')](0x1f4,_0x55f9ad[_0x3b92('0x10')]));});});};exports[_0x3b92('0x21')]=function(_0x3b31e6){var _0x336f73=this;return new Promise(function(_0x1ec1e2,_0x415492){return db['MemberReport'][_0x3b92('0x22')](_0x3b31e6[_0x3b92('0x23')],{'raw':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6['options'][_0x3b92('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x18')]||null:null,'attributes':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x19')]||null:null,'limit':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x24')]||null:null})[_0x3b92('0xa')](function(_0x14fec7){logger[_0x3b92('0x11')](_0x3b92('0x21'),_0x3b31e6);logger[_0x3b92('0xd')](_0x3b92('0x21'),_0x3b31e6,JSON[_0x3b92('0x1d')](_0x14fec7));_0x1ec1e2(_0x14fec7);})[_0x3b92('0x20')](function(_0x36aeb7){logger[_0x3b92('0xf')](_0x3b92('0x21'),_0x36aeb7[_0x3b92('0x10')],_0x3b31e6);_0x415492(_0x336f73[_0x3b92('0xf')](0x1f4,_0x36aeb7[_0x3b92('0x10')]));});});}; \ No newline at end of file +var _0xa23f=['findAll','options','attributes','limit','include','map','model','GetMemberReport','stringify','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','catch'];(function(_0x33bdcc,_0x42df92){var _0x523944=function(_0x4cfa82){while(--_0x4cfa82){_0x33bdcc['push'](_0x33bdcc['shift']());}};_0x523944(++_0x42df92);}(_0xa23f,0x7c));var _0xfa23=function(_0x21b518,_0x23705d){_0x21b518=_0x21b518-0x0;var _0x186f20=_0xa23f[_0x21b518];return _0x186f20;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa23('0x2'));var fs=require('fs');var Redis=require(_0xfa23('0x3'));var db=require(_0xfa23('0x4'))['db'];var utils=require(_0xfa23('0x5'));var logger=require('../../config/logger')(_0xfa23('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa23('0x7'));var client=jayson[_0xfa23('0x8')][_0xfa23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3696ef,_0x4fb6e6,_0x5a7882){return new BPromise(function(_0x59d53e,_0x19a1ac){return client[_0xfa23('0xa')](_0x3696ef,_0x5a7882)[_0xfa23('0xb')](function(_0x31bb2c){logger[_0xfa23('0xc')]('MemberReport,\x20%s,\x20%s',_0x4fb6e6,'request\x20sent');logger[_0xfa23('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4fb6e6,_0xfa23('0xe'),JSON['stringify'](_0x31bb2c));if(_0x31bb2c[_0xfa23('0xf')]){if(_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x10')]===0x1f4){logger['error'](_0xfa23('0x11'),_0x4fb6e6,_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x12')]);return _0x19a1ac(_0x31bb2c['error']['message']);}logger[_0xfa23('0xf')](_0xfa23('0x11'),_0x4fb6e6,_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x12')]);return _0x59d53e(_0x31bb2c['error'][_0xfa23('0x12')]);}else{logger[_0xfa23('0xc')](_0xfa23('0x11'),_0x4fb6e6,_0xfa23('0xe'));_0x59d53e(_0x31bb2c['result'][_0xfa23('0x12')]);}})[_0xfa23('0x13')](function(_0x3ca6be){logger[_0xfa23('0xf')](_0xfa23('0x11'),_0x4fb6e6,_0x3ca6be);_0x19a1ac(_0x3ca6be);});});}exports['GetMemberReport']=function(_0x59610c){var _0x5c3c6d=this;return new Promise(function(_0x445bd0,_0xb3ced2){return db['MemberReport'][_0xfa23('0x14')]({'raw':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')]['where']||null:null,'attributes':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')][_0xfa23('0x16')]||null:null,'limit':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')][_0xfa23('0x17')]||null:null,'include':_0x59610c[_0xfa23('0x15')]?_0x59610c['options'][_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x59610c[_0xfa23('0x15')][_0xfa23('0x18')],function(_0x542cde){return{'model':db[_0x542cde[_0xfa23('0x1a')]],'as':_0x542cde['as'],'attributes':_0x542cde['attributes'],'include':_0x542cde[_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x542cde[_0xfa23('0x18')],function(_0x26bdce){return{'model':db[_0x26bdce[_0xfa23('0x1a')]],'as':_0x26bdce['as'],'attributes':_0x26bdce[_0xfa23('0x16')],'include':_0x26bdce[_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x26bdce['include'],function(_0x2ae826){return{'model':db[_0x2ae826['model']],'as':_0x2ae826['as'],'attributes':_0x2ae826[_0xfa23('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ea972){logger[_0xfa23('0xc')](_0xfa23('0x1b'),_0x59610c);logger[_0xfa23('0xd')](_0xfa23('0x1b'),_0x59610c,JSON[_0xfa23('0x1c')](_0x4ea972));_0x445bd0(_0x4ea972);})[_0xfa23('0x13')](function(_0x3c9d9d){logger['error'](_0xfa23('0x1b'),_0x3c9d9d['message'],_0x59610c);_0xb3ced2(_0x5c3c6d[_0xfa23('0xf')](0x1f4,_0x3c9d9d[_0xfa23('0x12')]));});});};exports['CreateMemberReport']=function(_0x1c83d0){var _0x3a6966=this;return new Promise(function(_0xf9c420,_0x3dadc0){return db[_0xfa23('0x1d')][_0xfa23('0x1e')](_0x1c83d0[_0xfa23('0x1f')],{'raw':_0x1c83d0[_0xfa23('0x15')]?_0x1c83d0[_0xfa23('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xfa23('0xb')](function(_0x59c393){logger[_0xfa23('0xc')](_0xfa23('0x20'),_0x1c83d0);logger[_0xfa23('0xd')](_0xfa23('0x20'),_0x1c83d0,JSON[_0xfa23('0x1c')](_0x59c393));_0xf9c420(_0x59c393);})[_0xfa23('0x13')](function(_0x18f549){logger[_0xfa23('0xf')](_0xfa23('0x20'),_0x18f549['message'],_0x1c83d0);_0x3dadc0(_0x3a6966[_0xfa23('0xf')](0x1f4,_0x18f549['message']));});});};exports[_0xfa23('0x21')]=function(_0x88a593){var _0x17c407=this;return new Promise(function(_0x30ea1e,_0x3fed37){return db[_0xfa23('0x1d')][_0xfa23('0x22')](_0x88a593['body'],{'raw':_0x88a593[_0xfa23('0x15')]?_0x88a593[_0xfa23('0x15')][_0xfa23('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x88a593[_0xfa23('0x15')]?_0x88a593['options']['where']||null:null,'attributes':_0x88a593['options']?_0x88a593[_0xfa23('0x15')][_0xfa23('0x16')]||null:null,'limit':_0x88a593['options']?_0x88a593[_0xfa23('0x15')][_0xfa23('0x17')]||null:null})[_0xfa23('0xb')](function(_0x588fa5){logger[_0xfa23('0xc')]('UpdateMemberReport',_0x88a593);logger[_0xfa23('0xd')](_0xfa23('0x21'),_0x88a593,JSON[_0xfa23('0x1c')](_0x588fa5));_0x30ea1e(_0x588fa5);})[_0xfa23('0x13')](function(_0x1bc029){logger[_0xfa23('0xf')]('UpdateMemberReport',_0x1bc029[_0xfa23('0x12')],_0x88a593);_0x3fed37(_0x17c407[_0xfa23('0xf')](0x1f4,_0x1bc029[_0xfa23('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index a16ba6f..e31cbc5 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 _0x280b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','multer','util','connect-timeout'];(function(_0x1ebf72,_0x2323de){var _0x289112=function(_0x2b318f){while(--_0x2b318f){_0x1ebf72['push'](_0x1ebf72['shift']());}};_0x289112(++_0x2323de);}(_0x280b,0xce));var _0xb280=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x280b[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var path=require('path');var timeout=require(_0xb280('0x2'));var express=require(_0xb280('0x3'));var router=express[_0xb280('0x4')]();var fs_extra=require(_0xb280('0x5'));var auth=require(_0xb280('0x6'));var interaction=require(_0xb280('0x7'));var config=require(_0xb280('0x8'));var controller=require(_0xb280('0x9'));router[_0xb280('0xa')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0xf2d8=['index','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x37b642,_0x1c12b0){var _0x41766c=function(_0xfb7d07){while(--_0xfb7d07){_0x37b642['push'](_0x37b642['shift']());}};_0x41766c(++_0x1c12b0);}(_0xf2d8,0x65));var _0x8f2d=function(_0x46066f,_0x23105c){_0x46066f=_0x46066f-0x0;var _0x411977=_0xf2d8[_0x46066f];return _0x411977;};'use strict';var multer=require(_0x8f2d('0x0'));var util=require('util');var path=require(_0x8f2d('0x1'));var timeout=require(_0x8f2d('0x2'));var express=require('express');var router=express[_0x8f2d('0x3')]();var fs_extra=require(_0x8f2d('0x4'));var auth=require(_0x8f2d('0x5'));var interaction=require(_0x8f2d('0x6'));var config=require(_0x8f2d('0x7'));var controller=require('./migration.controller');router[_0x8f2d('0x8')]('/',controller[_0x8f2d('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b39da1e..f656db7 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 _0x3442=['STRING','version','sequelize'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x3442,0x10d));var _0x2344=function(_0x427b3d,_0x7ac0b3){_0x427b3d=_0x427b3d-0x0;var _0x2ce42f=_0x3442[_0x427b3d];return _0x2ce42f;};'use strict';var Sequelize=require(_0x2344('0x0'));module['exports']={'version':{'type':Sequelize[_0x2344('0x1')],'unique':_0x2344('0x2')}}; \ No newline at end of file +var _0xbfc6=['STRING','version','exports'];(function(_0x5c008e,_0x1c5f09){var _0x3b7c23=function(_0x12a274){while(--_0x12a274){_0x5c008e['push'](_0x5c008e['shift']());}};_0x3b7c23(++_0x1c5f09);}(_0xbfc6,0xe0));var _0x6bfc=function(_0x2ae0e1,_0x82d445){_0x2ae0e1=_0x2ae0e1-0x0;var _0x19a8bb=_0xbfc6[_0x2ae0e1];return _0x19a8bb;};'use strict';var Sequelize=require('sequelize');module[_0x6bfc('0x0')]={'version':{'type':Sequelize[_0x6bfc('0x1')],'unique':_0x6bfc('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 7b931f6..4d7bd32 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 _0xabe1=['then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Migration','includeAll','findAll','rows','catch','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy'];(function(_0x4f263d,_0x5dd636){var _0x215103=function(_0x140433){while(--_0x140433){_0x4f263d['push'](_0x4f263d['shift']());}};_0x215103(++_0x5dd636);}(_0xabe1,0x147));var _0x1abe=function(_0x46de4d,_0x411100){_0x46de4d=_0x46de4d-0x0;var _0x474d08=_0xabe1[_0x46de4d];return _0x474d08;};'use strict';var emlformat=require(_0x1abe('0x0'));var rimraf=require(_0x1abe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1abe('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1abe('0x3'));var util=require(_0x1abe('0x4'));var path=require(_0x1abe('0x5'));var sox=require('sox');var csv=require(_0x1abe('0x6'));var ejs=require(_0x1abe('0x7'));var fs=require('fs');var fs_extra=require(_0x1abe('0x8'));var _=require(_0x1abe('0x9'));var squel=require(_0x1abe('0xa'));var crypto=require(_0x1abe('0xb'));var jsforce=require(_0x1abe('0xc'));var deskjs=require(_0x1abe('0xd'));var toCsv=require(_0x1abe('0x6'));var querystring=require(_0x1abe('0xe'));var Papa=require(_0x1abe('0xf'));var Redis=require(_0x1abe('0x10'));var authService=require(_0x1abe('0x11'));var qs=require(_0x1abe('0x12'));var as=require(_0x1abe('0x13'));var hardwareService=require(_0x1abe('0x14'));var logger=require(_0x1abe('0x15'))(_0x1abe('0x16'));var utils=require(_0x1abe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1abe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c205,_0x563351){_0x563351=_0x563351||0xcc;return function(_0xf0c25c){if(_0xf0c25c){return _0x11c205[_0x1abe('0x19')](_0x563351);}return _0x11c205[_0x1abe('0x1a')](_0x563351)['end']();};}function respondWithResult(_0x22f754,_0x1fe865){_0x1fe865=_0x1fe865||0xc8;return function(_0x11e907){if(_0x11e907){return _0x22f754[_0x1abe('0x1a')](_0x1fe865)[_0x1abe('0x1b')](_0x11e907);}};}function respondWithFilteredResult(_0x2ea416,_0x38307e){return function(_0x1ba1b3){if(_0x1ba1b3){var _0x5edad3=typeof _0x38307e[_0x1abe('0x1c')]===_0x1abe('0x1d')&&typeof _0x38307e[_0x1abe('0x1e')]===_0x1abe('0x1d');var _0x19b159=_0x1ba1b3['count'];var _0x117cea=_0x5edad3?0x0:_0x38307e[_0x1abe('0x1c')];var _0x1edacb=_0x5edad3?_0x1ba1b3[_0x1abe('0x1f')]:_0x38307e[_0x1abe('0x1c')]+_0x38307e[_0x1abe('0x1e')];var _0x58fa1a;if(_0x1edacb>=_0x19b159){_0x1edacb=_0x19b159;_0x58fa1a=0xc8;}else{_0x58fa1a=0xce;}_0x2ea416[_0x1abe('0x1a')](_0x58fa1a);return _0x2ea416['set'](_0x1abe('0x20'),_0x117cea+'-'+_0x1edacb+'/'+_0x19b159)[_0x1abe('0x1b')](_0x1ba1b3);}return null;};}function patchUpdates(_0x571621){return function(_0x3f8a98){try{jsonpatch[_0x1abe('0x21')](_0x3f8a98,_0x571621,!![]);}catch(_0xf2b097){return BPromise[_0x1abe('0x22')](_0xf2b097);}return _0x3f8a98[_0x1abe('0x23')]();};}function saveUpdates(_0x2e2f1e,_0x1d3e8d){return function(_0x34e9a0){if(_0x34e9a0){return _0x34e9a0[_0x1abe('0x24')](_0x2e2f1e)['then'](function(_0x139e5e){return _0x139e5e;});}return null;};}function removeEntity(_0x13d98b,_0x38e86a){return function(_0x44fe16){if(_0x44fe16){return _0x44fe16[_0x1abe('0x25')]()[_0x1abe('0x26')](function(){_0x13d98b[_0x1abe('0x1a')](0xcc)[_0x1abe('0x27')]();});}};}function handleEntityNotFound(_0x19aff6,_0x1b8e6c){return function(_0x1a28d5){if(!_0x1a28d5){_0x19aff6[_0x1abe('0x19')](0x194);}return _0x1a28d5;};}function handleError(_0x20e3fa,_0xc7bef8){_0xc7bef8=_0xc7bef8||0x1f4;return function(_0x8f5fa5){logger[_0x1abe('0x28')](_0x8f5fa5[_0x1abe('0x29')]);if(_0x8f5fa5['name']){delete _0x8f5fa5[_0x1abe('0x2a')];}_0x20e3fa['status'](_0xc7bef8)[_0x1abe('0x2b')](_0x8f5fa5);};}exports[_0x1abe('0x2c')]=function(_0x5e1bbd,_0x1960f7){var _0x1ea4e6={},_0x445e37={},_0x43e347={'count':0x0,'rows':[]};var _0x41ed57=_['map'](db['Migration'][_0x1abe('0x2d')],function(_0x580133){return{'name':_0x580133[_0x1abe('0x2e')],'type':_0x580133[_0x1abe('0x2f')][_0x1abe('0x30')]};});_0x445e37['model']=_[_0x1abe('0x31')](_0x41ed57,'name');_0x445e37['query']=_[_0x1abe('0x32')](_0x5e1bbd[_0x1abe('0x33')]);_0x445e37[_0x1abe('0x34')]=_[_0x1abe('0x35')](_0x445e37[_0x1abe('0x36')],_0x445e37[_0x1abe('0x33')]);_0x1ea4e6[_0x1abe('0x37')]=_[_0x1abe('0x35')](_0x445e37['model'],qs[_0x1abe('0x38')](_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x38')]));_0x1ea4e6['attributes']=_0x1ea4e6[_0x1abe('0x37')][_0x1abe('0x39')]?_0x1ea4e6['attributes']:_0x445e37[_0x1abe('0x36')];if(!_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x3a')](_0x1abe('0x3b'))){_0x1ea4e6[_0x1abe('0x1e')]=qs[_0x1abe('0x1e')](_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x1e')]);_0x1ea4e6['offset']=qs[_0x1abe('0x1c')](_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x1c')]);}_0x1ea4e6[_0x1abe('0x3c')]=qs[_0x1abe('0x3d')](_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x3d')]);_0x1ea4e6[_0x1abe('0x3e')]=qs[_0x1abe('0x34')](_[_0x1abe('0x3f')](_0x5e1bbd[_0x1abe('0x33')],_0x445e37['filters']),_0x41ed57);if(_0x5e1bbd['query'][_0x1abe('0x40')]){_0x1ea4e6[_0x1abe('0x3e')]=_[_0x1abe('0x41')](_0x1ea4e6[_0x1abe('0x3e')],{'$or':_['map'](_0x41ed57,function(_0x80526d){if(_0x80526d[_0x1abe('0x2f')]!==_0x1abe('0x42')){var _0x488c34={};_0x488c34[_0x80526d[_0x1abe('0x2a')]]={'$like':'%'+_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x40')]+'%'};return _0x488c34;}})});}_0x1ea4e6=_[_0x1abe('0x41')]({},_0x1ea4e6,_0x5e1bbd[_0x1abe('0x43')]);var _0x21c491={'where':_0x1ea4e6['where']};return db[_0x1abe('0x44')][_0x1abe('0x1f')](_0x21c491)['then'](function(_0x329e0a){_0x43e347['count']=_0x329e0a;if(_0x5e1bbd[_0x1abe('0x33')][_0x1abe('0x45')]){_0x1ea4e6['include']=[{'all':!![]}];}return db[_0x1abe('0x44')][_0x1abe('0x46')](_0x1ea4e6);})[_0x1abe('0x26')](function(_0x402dc4){_0x43e347[_0x1abe('0x47')]=_0x402dc4;return _0x43e347;})[_0x1abe('0x26')](respondWithFilteredResult(_0x1960f7,_0x1ea4e6))[_0x1abe('0x48')](handleError(_0x1960f7,null));}; \ No newline at end of file +var _0xfe33=['where','filters','pick','VIRTUAL','filter','options','include','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','destroy','then','error','stack','name','send','index','map','Migration','rawAttributes','type','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x36eeb2,_0x1deee5){var _0x5483e1=function(_0x10eddb){while(--_0x10eddb){_0x36eeb2['push'](_0x36eeb2['shift']());}};_0x5483e1(++_0x1deee5);}(_0xfe33,0x13e));var _0x3fe3=function(_0x3064e7,_0x34edba){_0x3064e7=_0x3064e7-0x0;var _0x26038e=_0xfe33[_0x3064e7];return _0x26038e;};'use strict';var emlformat=require(_0x3fe3('0x0'));var rimraf=require(_0x3fe3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fe3('0x2'));var rp=require(_0x3fe3('0x3'));var moment=require(_0x3fe3('0x4'));var BPromise=require(_0x3fe3('0x5'));var Mustache=require(_0x3fe3('0x6'));var util=require(_0x3fe3('0x7'));var path=require(_0x3fe3('0x8'));var sox=require(_0x3fe3('0x9'));var csv=require(_0x3fe3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fe3('0xb'));var _=require(_0x3fe3('0xc'));var squel=require('squel');var crypto=require(_0x3fe3('0xd'));var jsforce=require(_0x3fe3('0xe'));var deskjs=require(_0x3fe3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3fe3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3fe3('0x11'));var as=require(_0x3fe3('0x12'));var hardwareService=require(_0x3fe3('0x13'));var logger=require(_0x3fe3('0x14'))('api');var utils=require(_0x3fe3('0x15'));var config=require(_0x3fe3('0x16'));var licenseUtil=require(_0x3fe3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38b954,_0x2e348b){_0x2e348b=_0x2e348b||0xcc;return function(_0x315085){if(_0x315085){return _0x38b954[_0x3fe3('0x18')](_0x2e348b);}return _0x38b954[_0x3fe3('0x19')](_0x2e348b)[_0x3fe3('0x1a')]();};}function respondWithResult(_0x3467d5,_0x50ccec){_0x50ccec=_0x50ccec||0xc8;return function(_0x220120){if(_0x220120){return _0x3467d5['status'](_0x50ccec)[_0x3fe3('0x1b')](_0x220120);}};}function respondWithFilteredResult(_0x204857,_0x3fe519){return function(_0x3e1bab){if(_0x3e1bab){var _0x3e94f4=typeof _0x3fe519[_0x3fe3('0x1c')]===_0x3fe3('0x1d')&&typeof _0x3fe519[_0x3fe3('0x1e')]==='undefined';var _0x21d1a9=_0x3e1bab[_0x3fe3('0x1f')];var _0xded6b0=_0x3e94f4?0x0:_0x3fe519['offset'];var _0x127d71=_0x3e94f4?_0x3e1bab[_0x3fe3('0x1f')]:_0x3fe519[_0x3fe3('0x1c')]+_0x3fe519[_0x3fe3('0x1e')];var _0x55f503;if(_0x127d71>=_0x21d1a9){_0x127d71=_0x21d1a9;_0x55f503=0xc8;}else{_0x55f503=0xce;}_0x204857['status'](_0x55f503);return _0x204857['set']('Content-Range',_0xded6b0+'-'+_0x127d71+'/'+_0x21d1a9)[_0x3fe3('0x1b')](_0x3e1bab);}return null;};}function patchUpdates(_0x77e354){return function(_0x38e288){try{jsonpatch['apply'](_0x38e288,_0x77e354,!![]);}catch(_0x4e255e){return BPromise[_0x3fe3('0x20')](_0x4e255e);}return _0x38e288['save']();};}function saveUpdates(_0x49155b,_0x2919eb){return function(_0x229441){if(_0x229441){return _0x229441[_0x3fe3('0x21')](_0x49155b)['then'](function(_0xcb22cd){return _0xcb22cd;});}return null;};}function removeEntity(_0x325034,_0x3e7da0){return function(_0x4f2e7e){if(_0x4f2e7e){return _0x4f2e7e[_0x3fe3('0x22')]()[_0x3fe3('0x23')](function(){_0x325034['status'](0xcc)[_0x3fe3('0x1a')]();});}};}function handleEntityNotFound(_0x567ce9,_0x2e6ed7){return function(_0x5df92e){if(!_0x5df92e){_0x567ce9[_0x3fe3('0x18')](0x194);}return _0x5df92e;};}function handleError(_0x1e9a6f,_0xf16f2e){_0xf16f2e=_0xf16f2e||0x1f4;return function(_0x227c7b){logger[_0x3fe3('0x24')](_0x227c7b[_0x3fe3('0x25')]);if(_0x227c7b[_0x3fe3('0x26')]){delete _0x227c7b[_0x3fe3('0x26')];}_0x1e9a6f[_0x3fe3('0x19')](_0xf16f2e)[_0x3fe3('0x27')](_0x227c7b);};}exports[_0x3fe3('0x28')]=function(_0x1df8d7,_0x481dd3){var _0x3e9ccb={},_0x3d5f1e={},_0x110311={'count':0x0,'rows':[]};var _0x42d486=_[_0x3fe3('0x29')](db[_0x3fe3('0x2a')][_0x3fe3('0x2b')],function(_0x363ff7){return{'name':_0x363ff7['fieldName'],'type':_0x363ff7[_0x3fe3('0x2c')]['key']};});_0x3d5f1e[_0x3fe3('0x2d')]=_[_0x3fe3('0x29')](_0x42d486,_0x3fe3('0x26'));_0x3d5f1e['query']=_[_0x3fe3('0x2e')](_0x1df8d7['query']);_0x3d5f1e['filters']=_[_0x3fe3('0x2f')](_0x3d5f1e[_0x3fe3('0x2d')],_0x3d5f1e[_0x3fe3('0x30')]);_0x3e9ccb[_0x3fe3('0x31')]=_[_0x3fe3('0x2f')](_0x3d5f1e[_0x3fe3('0x2d')],qs['fields'](_0x1df8d7['query'][_0x3fe3('0x32')]));_0x3e9ccb[_0x3fe3('0x31')]=_0x3e9ccb[_0x3fe3('0x31')]['length']?_0x3e9ccb[_0x3fe3('0x31')]:_0x3d5f1e[_0x3fe3('0x2d')];if(!_0x1df8d7[_0x3fe3('0x30')][_0x3fe3('0x33')](_0x3fe3('0x34'))){_0x3e9ccb[_0x3fe3('0x1e')]=qs[_0x3fe3('0x1e')](_0x1df8d7[_0x3fe3('0x30')][_0x3fe3('0x1e')]);_0x3e9ccb[_0x3fe3('0x1c')]=qs[_0x3fe3('0x1c')](_0x1df8d7[_0x3fe3('0x30')][_0x3fe3('0x1c')]);}_0x3e9ccb['order']=qs[_0x3fe3('0x35')](_0x1df8d7[_0x3fe3('0x30')][_0x3fe3('0x35')]);_0x3e9ccb[_0x3fe3('0x36')]=qs[_0x3fe3('0x37')](_[_0x3fe3('0x38')](_0x1df8d7[_0x3fe3('0x30')],_0x3d5f1e['filters']),_0x42d486);if(_0x1df8d7['query']['filter']){_0x3e9ccb[_0x3fe3('0x36')]=_['merge'](_0x3e9ccb[_0x3fe3('0x36')],{'$or':_[_0x3fe3('0x29')](_0x42d486,function(_0x5c8785){if(_0x5c8785[_0x3fe3('0x2c')]!==_0x3fe3('0x39')){var _0x423a47={};_0x423a47[_0x5c8785[_0x3fe3('0x26')]]={'$like':'%'+_0x1df8d7['query'][_0x3fe3('0x3a')]+'%'};return _0x423a47;}})});}_0x3e9ccb=_['merge']({},_0x3e9ccb,_0x1df8d7[_0x3fe3('0x3b')]);var _0x56f20b={'where':_0x3e9ccb[_0x3fe3('0x36')]};return db['Migration'][_0x3fe3('0x1f')](_0x56f20b)[_0x3fe3('0x23')](function(_0x211b90){_0x110311['count']=_0x211b90;if(_0x1df8d7[_0x3fe3('0x30')]['includeAll']){_0x3e9ccb[_0x3fe3('0x3c')]=[{'all':!![]}];}return db[_0x3fe3('0x2a')]['findAll'](_0x3e9ccb);})[_0x3fe3('0x23')](function(_0x168735){_0x110311['rows']=_0x168735;return _0x110311;})[_0x3fe3('0x23')](respondWithFilteredResult(_0x481dd3,_0x3e9ccb))[_0x3fe3('0x3d')](handleError(_0x481dd3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ee76520..32cfc14 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 _0xc9dd=['Migration','migrations','lodash','util','api','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','define'];(function(_0x425ec8,_0x293ff){var _0x1cbf90=function(_0x1a1974){while(--_0x1a1974){_0x425ec8['push'](_0x425ec8['shift']());}};_0x1cbf90(++_0x293ff);}(_0xc9dd,0x13a));var _0xdc9d=function(_0x3fbc93,_0x4430e8){_0x3fbc93=_0x3fbc93-0x0;var _0x6b5f15=_0xc9dd[_0x3fbc93];return _0x6b5f15;};'use strict';var _=require(_0xdc9d('0x0'));var util=require(_0xdc9d('0x1'));var logger=require('../../config/logger')(_0xdc9d('0x2'));var moment=require('moment');var BPromise=require(_0xdc9d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc9d('0x4'));var rimraf=require(_0xdc9d('0x5'));var config=require(_0xdc9d('0x6'));var attributes=require(_0xdc9d('0x7'));module[_0xdc9d('0x8')]=function(_0x4fd55e,_0x56545a){return _0x4fd55e[_0xdc9d('0x9')](_0xdc9d('0xa'),attributes,{'tableName':_0xdc9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a97=['Migration','migrations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define'];(function(_0x3a8ad5,_0x1f4154){var _0x2422e6=function(_0x5b3ee7){while(--_0x5b3ee7){_0x3a8ad5['push'](_0x3a8ad5['shift']());}};_0x2422e6(++_0x1f4154);}(_0x8a97,0xca));var _0x78a9=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8a97[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x78a9('0x0'));var logger=require(_0x78a9('0x1'))(_0x78a9('0x2'));var moment=require('moment');var BPromise=require(_0x78a9('0x3'));var rp=require(_0x78a9('0x4'));var fs=require('fs');var path=require(_0x78a9('0x5'));var rimraf=require(_0x78a9('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x4775c2,_0x3cb863){return _0x4775c2[_0x78a9('0x7')](_0x78a9('0x8'),attributes,{'tableName':_0x78a9('0x9'),'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 2abe9c6..d7fc452 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 _0x6d2e=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6d2e,0x97));var _0xe6d2=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x6d2e[_0x4c2f30];return _0xb8854d;};'use strict';var _=require('lodash');var util=require(_0xe6d2('0x0'));var moment=require(_0xe6d2('0x1'));var BPromise=require(_0xe6d2('0x2'));var rs=require(_0xe6d2('0x3'));var fs=require('fs');var Redis=require(_0xe6d2('0x4'));var db=require(_0xe6d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6d2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6d2('0x7'));var client=jayson[_0xe6d2('0x8')][_0xe6d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d9c9f,_0x36d6ad,_0x53906e){return new BPromise(function(_0x2e227e,_0x2ce8cb){return client['request'](_0x4d9c9f,_0x53906e)[_0xe6d2('0xa')](function(_0xa7d0e1){logger['info'](_0xe6d2('0xb'),_0x36d6ad,_0xe6d2('0xc'));logger['debug'](_0xe6d2('0xd'),_0x36d6ad,_0xe6d2('0xc'),JSON[_0xe6d2('0xe')](_0xa7d0e1));if(_0xa7d0e1[_0xe6d2('0xf')]){if(_0xa7d0e1['error'][_0xe6d2('0x10')]===0x1f4){logger[_0xe6d2('0xf')]('Migration,\x20%s,\x20%s',_0x36d6ad,_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);return _0x2ce8cb(_0xa7d0e1['error'][_0xe6d2('0x11')]);}logger[_0xe6d2('0xf')](_0xe6d2('0xb'),_0x36d6ad,_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);return _0x2e227e(_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);}else{logger[_0xe6d2('0x12')](_0xe6d2('0xb'),_0x36d6ad,_0xe6d2('0xc'));_0x2e227e(_0xa7d0e1[_0xe6d2('0x13')][_0xe6d2('0x11')]);}})[_0xe6d2('0x14')](function(_0x2ad072){logger[_0xe6d2('0xf')]('Migration,\x20%s,\x20%s',_0x36d6ad,_0x2ad072);_0x2ce8cb(_0x2ad072);});});} \ No newline at end of file +var _0x3308=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1a69f0,_0x234e06){var _0x3995e3=function(_0x573f31){while(--_0x573f31){_0x1a69f0['push'](_0x1a69f0['shift']());}};_0x3995e3(++_0x234e06);}(_0x3308,0x160));var _0x8330=function(_0x45babe,_0x50dd5f){_0x45babe=_0x45babe-0x0;var _0x2162e2=_0x3308[_0x45babe];return _0x2162e2;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var BPromise=require(_0x8330('0x3'));var rs=require(_0x8330('0x4'));var fs=require('fs');var Redis=require(_0x8330('0x5'));var db=require(_0x8330('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8330('0x7'));var config=require('../../config/environment');var jayson=require(_0x8330('0x8'));var client=jayson[_0x8330('0x9')][_0x8330('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59c19e,_0x413cac,_0x1d5fd6){return new BPromise(function(_0x1244a7,_0x2dcc17){return client[_0x8330('0xb')](_0x59c19e,_0x1d5fd6)[_0x8330('0xc')](function(_0x4f917e){logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x413cac,'request\x20sent',JSON['stringify'](_0x4f917e));if(_0x4f917e['error']){if(_0x4f917e['error'][_0x8330('0x10')]===0x1f4){logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);return _0x2dcc17(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e['error'][_0x8330('0x12')]);return _0x1244a7(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}else{logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));_0x1244a7(_0x4f917e[_0x8330('0x13')][_0x8330('0x12')]);}})[_0x8330('0x14')](function(_0x4d9662){logger[_0x8330('0x11')](_0x8330('0xe'),_0x413cac,_0x4d9662);_0x2dcc17(_0x4d9662);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 1f2e247..5eb605a 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 _0xebc4=['isAuthenticated','get','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./network.controller'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xebc4,0xf9));var _0x4ebc=function(_0x2a9dcf,_0x4939b1){_0x2a9dcf=_0x2a9dcf-0x0;var _0x46560e=_0xebc4[_0x2a9dcf];return _0x46560e;};'use strict';var multer=require('multer');var util=require(_0x4ebc('0x0'));var path=require(_0x4ebc('0x1'));var timeout=require(_0x4ebc('0x2'));var express=require(_0x4ebc('0x3'));var router=express['Router']();var fs_extra=require(_0x4ebc('0x4'));var auth=require(_0x4ebc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ebc('0x6'));router['get']('/',auth[_0x4ebc('0x7')](),controller['index']);router[_0x4ebc('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4ebc('0x9')]('/',auth[_0x4ebc('0x7')](),controller[_0x4ebc('0xa')]);router[_0x4ebc('0xb')](_0x4ebc('0xc'),auth[_0x4ebc('0x7')](),controller[_0x4ebc('0xd')]);router[_0x4ebc('0xe')](_0x4ebc('0xc'),auth[_0x4ebc('0x7')](),controller['destroy']);module[_0x4ebc('0xf')]=router; \ No newline at end of file +var _0x27d7=['destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete'];(function(_0x42fd32,_0x12d3ae){var _0x328b6f=function(_0x3b9d38){while(--_0x3b9d38){_0x42fd32['push'](_0x42fd32['shift']());}};_0x328b6f(++_0x12d3ae);}(_0x27d7,0xa4));var _0x727d=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x27d7[_0x421791];return _0x495838;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x727d('0x0'));var timeout=require(_0x727d('0x1'));var express=require('express');var router=express[_0x727d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x727d('0x3'));var interaction=require(_0x727d('0x4'));var config=require(_0x727d('0x5'));var controller=require(_0x727d('0x6'));router['get']('/',auth[_0x727d('0x7')](),controller['index']);router[_0x727d('0x8')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0xa')]);router[_0x727d('0xb')]('/',auth[_0x727d('0x7')](),controller[_0x727d('0xc')]);router[_0x727d('0xd')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0xe')]);router[_0x727d('0xf')](_0x727d('0x9'),auth[_0x727d('0x7')](),controller[_0x727d('0x10')]);module[_0x727d('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6ecf573..e09a8cb 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 _0x5bdd=['ENUM','externip','stun','turn','STRING','exports'];(function(_0x8b7a73,_0x56aab2){var _0x280ac9=function(_0xca311){while(--_0xca311){_0x8b7a73['push'](_0x8b7a73['shift']());}};_0x280ac9(++_0x56aab2);}(_0x5bdd,0x95));var _0xd5bd=function(_0x479037,_0x35dd00){_0x479037=_0x479037-0x0;var _0x544fa7=_0x5bdd[_0x479037];return _0x544fa7;};'use strict';var Sequelize=require('sequelize');module[_0xd5bd('0x0')]={'type':{'type':Sequelize[_0xd5bd('0x1')]('localnet',_0xd5bd('0x2'),_0xd5bd('0x3'),_0xd5bd('0x4'))},'value':{'type':Sequelize[_0xd5bd('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e6c=['stun','turn','STRING','sequelize','localnet','externip'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e6c,0x1a1));var _0xc8e6=function(_0x5d1aa5,_0x3f0fb6){_0x5d1aa5=_0x5d1aa5-0x0;var _0x492a3e=_0x8e6c[_0x5d1aa5];return _0x492a3e;};'use strict';var Sequelize=require(_0xc8e6('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xc8e6('0x1'),_0xc8e6('0x2'),_0xc8e6('0x3'),_0xc8e6('0x4'))},'value':{'type':Sequelize[_0xc8e6('0x5')]},'username':{'type':Sequelize[_0xc8e6('0x5')]},'password':{'type':Sequelize[_0xc8e6('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 27b6e78..673288d 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 _0xa7c6=['STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','root','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','join','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','destroy','server/files/templates/turn_multiple.ejs','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','request\x20sent','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Network','rows','show','params','keys','find','create','body','findAll','toUpperCase'];(function(_0x47aff1,_0x505c41){var _0x264d2b=function(_0xae785f){while(--_0xae785f){_0x47aff1['push'](_0x47aff1['shift']());}};_0x264d2b(++_0x505c41);}(_0xa7c6,0x6b));var _0x6a7c=function(_0x211e38,_0x4491c4){_0x211e38=_0x211e38-0x0;var _0x3af407=_0xa7c6[_0x211e38];return _0x3af407;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x6a7c('0x0'));var fs=require('fs');var _=require(_0x6a7c('0x1'));var qs=require(_0x6a7c('0x2'));var logger=require(_0x6a7c('0x3'))(_0x6a7c('0x4'));var config=require(_0x6a7c('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6a7c('0x6'));var client=jayson[_0x6a7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11a685,_0x3c898a,_0x4b8076,_0x5de8d6){return new Promise(function(_0x43e847,_0xd28998){var _0x40ddf=_0x5de8d6||client;return _0x40ddf[_0x6a7c('0x8')](_0x11a685,_0x4b8076)[_0x6a7c('0x9')](function(_0xf59e93){logger[_0x6a7c('0xa')]('Network,\x20%s,\x20%s',_0x3c898a,'request\x20sent');logger['debug'](_0x6a7c('0xb'),_0x3c898a,'request\x20sent',JSON['stringify'](_0xf59e93));if(_0xf59e93[_0x6a7c('0xc')]){if(_0xf59e93[_0x6a7c('0xc')][_0x6a7c('0xd')]===0x1f4){logger['error'](_0x6a7c('0xe'),_0x3c898a,_0xf59e93[_0x6a7c('0xc')][_0x6a7c('0xf')]);return _0xd28998(_0xf59e93[_0x6a7c('0xc')][_0x6a7c('0xf')]);}logger[_0x6a7c('0xc')](_0x6a7c('0xe'),_0x3c898a,_0xf59e93[_0x6a7c('0xc')][_0x6a7c('0xf')]);return _0x43e847(_0xf59e93['error'][_0x6a7c('0xf')]);}else{logger[_0x6a7c('0xa')]('Network,\x20%s,\x20%s',_0x3c898a,_0x6a7c('0x10'));_0x43e847(_0xf59e93['result'][_0x6a7c('0xf')]);}})[_0x6a7c('0x11')](function(_0x550016){logger[_0x6a7c('0xc')](_0x6a7c('0xe'),_0x3c898a,_0x550016);_0xd28998(_0x550016);});});}function respondWithResult(_0x57c483,_0xa8f22d){_0xa8f22d=_0xa8f22d||0xc8;return function(_0x1071d1){if(_0x1071d1){return _0x57c483[_0x6a7c('0x12')](_0xa8f22d)[_0x6a7c('0x13')](_0x1071d1);}};}function respondWithFilteredResult(_0x1fe4b3,_0x5cadbc){return function(_0x46e325){if(_0x46e325){var _0x1c17bb=typeof _0x5cadbc[_0x6a7c('0x14')]===_0x6a7c('0x15')&&typeof _0x5cadbc[_0x6a7c('0x16')]==='undefined';var _0x4d90b5=_0x46e325[_0x6a7c('0x17')];var _0x42ce3c=_0x1c17bb?0x0:_0x5cadbc['offset'];var _0x3a3c4f=_0x1c17bb?_0x46e325[_0x6a7c('0x17')]:_0x5cadbc[_0x6a7c('0x14')]+_0x5cadbc[_0x6a7c('0x16')];var _0x36961b;if(_0x3a3c4f>=_0x4d90b5){_0x3a3c4f=_0x4d90b5;_0x36961b=0xc8;}else{_0x36961b=0xce;}_0x1fe4b3['status'](_0x36961b);return _0x1fe4b3[_0x6a7c('0x18')](_0x6a7c('0x19'),_0x42ce3c+'-'+_0x3a3c4f+'/'+_0x4d90b5)[_0x6a7c('0x13')](_0x46e325);}return null;};}function saveUpdates(_0x180f5e){return function(_0x222857){if(_0x222857){return _0x222857[_0x6a7c('0x1a')](_0x180f5e)[_0x6a7c('0x9')](function(_0x1538f5){return _0x1538f5;});}return null;};}function removeEntity(_0x2caa8d){return function(_0x3ae327){if(_0x3ae327){return _0x3ae327['destroy']()[_0x6a7c('0x9')](function(){_0x2caa8d['status'](0xcc)[_0x6a7c('0x1b')]();});}};}function handleEntityNotFound(_0x3d6b8a){return function(_0x29dc32){if(!_0x29dc32){_0x3d6b8a[_0x6a7c('0x1c')](0x194);}return _0x29dc32;};}function handleError(_0x50c7e1,_0x42143a){_0x42143a=_0x42143a||0x1f4;return function(_0x15636e){logger[_0x6a7c('0xc')](_0x15636e[_0x6a7c('0x1d')]);if(_0x15636e['name']){delete _0x15636e['name'];}_0x50c7e1['status'](_0x42143a)[_0x6a7c('0x1e')](_0x15636e);};}exports[_0x6a7c('0x1f')]=function(_0x58920b,_0x2ef1d6){var _0x41553d={},_0x544ca9={},_0x1e21b2={'count':0x0,'rows':[]};var _0x313a62=_[_0x6a7c('0x20')](db['Network'][_0x6a7c('0x21')],function(_0x1e2ea2){return{'name':_0x1e2ea2[_0x6a7c('0x22')],'type':_0x1e2ea2[_0x6a7c('0x23')][_0x6a7c('0x24')]};});_0x544ca9['model']=_[_0x6a7c('0x20')](_0x313a62,_0x6a7c('0x25'));_0x544ca9[_0x6a7c('0x26')]=_['keys'](_0x58920b[_0x6a7c('0x26')]);_0x544ca9[_0x6a7c('0x27')]=_[_0x6a7c('0x28')](_0x544ca9[_0x6a7c('0x29')],_0x544ca9[_0x6a7c('0x26')]);_0x41553d[_0x6a7c('0x2a')]=_['intersection'](_0x544ca9[_0x6a7c('0x29')],qs[_0x6a7c('0x2b')](_0x58920b[_0x6a7c('0x26')][_0x6a7c('0x2b')]));_0x41553d[_0x6a7c('0x2a')]=_0x41553d[_0x6a7c('0x2a')][_0x6a7c('0x2c')]?_0x41553d[_0x6a7c('0x2a')]:_0x544ca9[_0x6a7c('0x29')];if(!_0x58920b['query'][_0x6a7c('0x2d')](_0x6a7c('0x2e'))){_0x41553d[_0x6a7c('0x16')]=qs[_0x6a7c('0x16')](_0x58920b['query']['limit']);_0x41553d[_0x6a7c('0x14')]=qs[_0x6a7c('0x14')](_0x58920b['query'][_0x6a7c('0x14')]);}_0x41553d[_0x6a7c('0x2f')]=qs[_0x6a7c('0x30')](_0x58920b['query'][_0x6a7c('0x30')]);_0x41553d[_0x6a7c('0x31')]=qs[_0x6a7c('0x27')](_[_0x6a7c('0x32')](_0x58920b['query'],_0x544ca9[_0x6a7c('0x27')]),_0x313a62);if(_0x58920b[_0x6a7c('0x26')]['filter']){_0x41553d[_0x6a7c('0x31')]=_[_0x6a7c('0x33')](_0x41553d[_0x6a7c('0x31')],{'$or':_[_0x6a7c('0x20')](_0x313a62,function(_0x13fbc0){if(_0x13fbc0[_0x6a7c('0x23')]!==_0x6a7c('0x34')){var _0x39d439={};_0x39d439[_0x13fbc0[_0x6a7c('0x25')]]={'$like':'%'+_0x58920b[_0x6a7c('0x26')][_0x6a7c('0x35')]+'%'};return _0x39d439;}})});}_0x41553d=_[_0x6a7c('0x33')]({},_0x41553d,_0x58920b[_0x6a7c('0x36')]);var _0x1bbd61={'where':_0x41553d[_0x6a7c('0x31')]};return db['Network']['count'](_0x1bbd61)[_0x6a7c('0x9')](function(_0x1659de){_0x1e21b2['count']=_0x1659de;if(_0x58920b[_0x6a7c('0x26')][_0x6a7c('0x37')]){_0x41553d[_0x6a7c('0x38')]=[{'all':!![]}];}return db[_0x6a7c('0x39')]['findAll'](_0x41553d);})[_0x6a7c('0x9')](function(_0x1f624a){_0x1e21b2[_0x6a7c('0x3a')]=_0x1f624a;return _0x1e21b2;})[_0x6a7c('0x9')](respondWithFilteredResult(_0x2ef1d6,_0x41553d))[_0x6a7c('0x11')](handleError(_0x2ef1d6,null));};exports[_0x6a7c('0x3b')]=function(_0x32ab0a,_0x2893b6){var _0x2837b7={'raw':!![],'where':{'id':_0x32ab0a[_0x6a7c('0x3c')]['id']}},_0x139671={};_0x139671['model']=_[_0x6a7c('0x3d')](db['Network'][_0x6a7c('0x21')]);_0x139671[_0x6a7c('0x26')]=_['keys'](_0x32ab0a[_0x6a7c('0x26')]);_0x139671[_0x6a7c('0x27')]=_['intersection'](_0x139671['model'],_0x139671[_0x6a7c('0x26')]);_0x2837b7[_0x6a7c('0x2a')]=_[_0x6a7c('0x28')](_0x139671[_0x6a7c('0x29')],qs[_0x6a7c('0x2b')](_0x32ab0a[_0x6a7c('0x26')][_0x6a7c('0x2b')]));_0x2837b7[_0x6a7c('0x2a')]=_0x2837b7[_0x6a7c('0x2a')][_0x6a7c('0x2c')]?_0x2837b7[_0x6a7c('0x2a')]:_0x139671['model'];if(_0x32ab0a[_0x6a7c('0x26')][_0x6a7c('0x37')]){_0x2837b7['include']=[{'all':!![]}];}_0x2837b7=_[_0x6a7c('0x33')]({},_0x2837b7,_0x32ab0a[_0x6a7c('0x36')]);return db['Network'][_0x6a7c('0x3e')](_0x2837b7)[_0x6a7c('0x9')](handleEntityNotFound(_0x2893b6,null))[_0x6a7c('0x9')](respondWithResult(_0x2893b6,null))['catch'](handleError(_0x2893b6,null));};exports[_0x6a7c('0x3f')]=function(_0x378187,_0x526543){var _0x29fd85;return db[_0x6a7c('0x39')][_0x6a7c('0x3f')](_0x378187[_0x6a7c('0x40')],{'raw':!![]})['then'](function(_0x30fe35){_0x29fd85=_0x30fe35;return db[_0x6a7c('0x39')][_0x6a7c('0x41')]({'where':{'type':_0x378187[_0x6a7c('0x40')][_0x6a7c('0x23')]},'raw':!![]});})['then'](function(_0x57166d){if(_0x29fd85['type'][_0x6a7c('0x42')]()==_0x6a7c('0x43')){var _0x73cd47=fs['readFileSync'](path['join'](config['root'],_0x6a7c('0x44')),_0x6a7c('0x45'));var _0x45816a=ejs[_0x6a7c('0x46')](_0x73cd47,{'networks':_0x57166d||[]});fs[_0x6a7c('0x47')](_0x6a7c('0x48'),_0x45816a);return respondWithRpcPromise(_0x6a7c('0x49'),_0x6a7c('0x3f'),{'module':'res_stun_monitor.so'});}else if(_0x29fd85[_0x6a7c('0x23')]['toUpperCase']()==_0x6a7c('0x4a')){var _0x1f754b=fs[_0x6a7c('0x4b')](path['join'](config[_0x6a7c('0x4c')],'server/files/templates/turn_multiple.ejs'),_0x6a7c('0x45'));var _0x222ecb=ejs[_0x6a7c('0x46')](_0x1f754b,{'networks':_0x57166d||[]});fs['writeFileSync'](_0x6a7c('0x4d'),_0x222ecb);return respondWithRpcPromise('Reload',_0x6a7c('0x3f'),{'module':_0x6a7c('0x4e')});}else{var _0x529b77=fs['readFileSync'](path[_0x6a7c('0x4f')](config[_0x6a7c('0x4c')],_0x6a7c('0x50')),_0x6a7c('0x45'));var _0x51aba5=ejs[_0x6a7c('0x46')](_0x529b77,{'networks':_0x57166d||[]});fs[_0x6a7c('0x47')](util[_0x6a7c('0x51')](_0x6a7c('0x52'),_0x378187[_0x6a7c('0x40')]['type'][_0x6a7c('0x53')]()),_0x51aba5);return respondWithRpcPromise(_0x6a7c('0x49'),_0x6a7c('0x3f'),{'module':_0x6a7c('0x54')});}})[_0x6a7c('0x9')](function(){return _0x29fd85;})['then'](respondWithResult(_0x526543,0xc9))[_0x6a7c('0x11')](handleError(_0x526543,null));};exports[_0x6a7c('0x1a')]=function(_0x20afbf,_0x80078e){var _0x46fdff;return db['Network'][_0x6a7c('0x3e')]({'where':{'id':_0x20afbf['params']['id']}})[_0x6a7c('0x9')](handleEntityNotFound(_0x80078e,null))[_0x6a7c('0x9')](saveUpdates(_0x20afbf[_0x6a7c('0x40')],null))[_0x6a7c('0x9')](function(_0x7bf308){if(_0x7bf308){_0x46fdff=_0x7bf308;return db[_0x6a7c('0x39')][_0x6a7c('0x41')]({'where':{'type':_0x46fdff[_0x6a7c('0x23')]},'raw':!![]});}return null;})[_0x6a7c('0x9')](function(_0x119c95){if(_0x46fdff[_0x6a7c('0x23')][_0x6a7c('0x42')]()=='STUN'){var _0x58515f=fs[_0x6a7c('0x4b')](path['join'](config[_0x6a7c('0x4c')],_0x6a7c('0x44')),_0x6a7c('0x45'));var _0x537ced=ejs[_0x6a7c('0x46')](_0x58515f,{'networks':_0x119c95||[]});fs[_0x6a7c('0x47')](_0x6a7c('0x48'),_0x537ced);return respondWithRpcPromise('Reload',_0x6a7c('0x1a'),{'module':_0x6a7c('0x4e')});}else if(_0x46fdff[_0x6a7c('0x23')]['toUpperCase']()=='TURN'){var _0xefe705=fs[_0x6a7c('0x4b')](path[_0x6a7c('0x4f')](config[_0x6a7c('0x4c')],'server/files/templates/turn_multiple.ejs'),_0x6a7c('0x45'));var _0xe30815=ejs[_0x6a7c('0x46')](_0xefe705,{'networks':_0x119c95||[]});fs[_0x6a7c('0x47')](_0x6a7c('0x4d'),_0xe30815);return respondWithRpcPromise(_0x6a7c('0x49'),_0x6a7c('0x1a'),{'module':'res_stun_monitor.so'});}else{var _0xb88055=fs[_0x6a7c('0x4b')](path[_0x6a7c('0x4f')](config[_0x6a7c('0x4c')],'server/files/templates/network.ejs'),_0x6a7c('0x45'));var _0x3ad18f=ejs[_0x6a7c('0x46')](_0xb88055,{'networks':_0x119c95||[]});fs[_0x6a7c('0x47')](util[_0x6a7c('0x51')](_0x6a7c('0x52'),_0x20afbf[_0x6a7c('0x40')][_0x6a7c('0x23')][_0x6a7c('0x53')]()),_0x3ad18f);return respondWithRpcPromise(_0x6a7c('0x49'),_0x6a7c('0x1a'),{'module':_0x6a7c('0x54')});}})[_0x6a7c('0x9')](function(_0x55c582){if(_0x55c582){return _0x46fdff;}return null;})[_0x6a7c('0x9')](respondWithResult(_0x80078e,null))['catch'](handleError(_0x80078e,null));};exports['destroy']=function(_0x31e537,_0x4c80e2){var _0x343e64;return db[_0x6a7c('0x39')][_0x6a7c('0x3e')]({'where':{'id':_0x31e537[_0x6a7c('0x3c')]['id']}})[_0x6a7c('0x9')](function(_0x2653af){_0x343e64=_0x2653af;return _0x2653af;})['then'](handleEntityNotFound(_0x4c80e2,null))[_0x6a7c('0x9')](removeEntity(_0x4c80e2,null))['then'](function(){if(_0x343e64){return db[_0x6a7c('0x39')][_0x6a7c('0x41')]({'where':{'type':_0x343e64[_0x6a7c('0x23')]},'raw':!![]});}})[_0x6a7c('0x9')](function(_0xd0a0dd){if(_0x343e64[_0x6a7c('0x23')][_0x6a7c('0x42')]()=='STUN'){var _0x1a2eff=fs[_0x6a7c('0x4b')](path['join'](config[_0x6a7c('0x4c')],_0x6a7c('0x44')),'utf8');var _0x42a4ef=ejs[_0x6a7c('0x46')](_0x1a2eff,{'networks':_0xd0a0dd||[]});fs[_0x6a7c('0x47')](_0x6a7c('0x48'),_0x42a4ef);return respondWithRpcPromise(_0x6a7c('0x49'),_0x6a7c('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x343e64[_0x6a7c('0x23')][_0x6a7c('0x42')]()==_0x6a7c('0x4a')){var _0x16fe4a=fs['readFileSync'](path[_0x6a7c('0x4f')](config[_0x6a7c('0x4c')],_0x6a7c('0x56')),'utf8');var _0x21f329=ejs[_0x6a7c('0x46')](_0x16fe4a,{'networks':_0xd0a0dd||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x21f329);return respondWithRpcPromise('Reload',_0x6a7c('0x55'),{'module':_0x6a7c('0x4e')});}else{var _0x44a275=fs['readFileSync'](path[_0x6a7c('0x4f')](config[_0x6a7c('0x4c')],_0x6a7c('0x50')),_0x6a7c('0x45'));var _0x5691ac=ejs[_0x6a7c('0x46')](_0x44a275,{'networks':_0xd0a0dd||[]});fs['writeFileSync'](util[_0x6a7c('0x51')](_0x6a7c('0x52'),_0x343e64[_0x6a7c('0x23')][_0x6a7c('0x53')]()),_0x5691ac);return respondWithRpcPromise('Reload',_0x6a7c('0x55'),{'module':_0x6a7c('0x54')});}})['catch'](handleError(_0x4c80e2,null));}; \ No newline at end of file +var _0xcb08=['jayson/promise','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','type','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','find','/etc/asterisk/stun_xcally.conf','util','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3a8875,_0xeee0b6){var _0x26e5a6=function(_0x339a19){while(--_0x339a19){_0x3a8875['push'](_0x3a8875['shift']());}};_0x26e5a6(++_0xeee0b6);}(_0xcb08,0x10a));var _0x8cb0=function(_0x485aba,_0x4baa8a){_0x485aba=_0x485aba-0x0;var _0x5e4919=_0xcb08[_0x485aba];return _0x5e4919;};'use strict';var util=require(_0x8cb0('0x0'));var path=require(_0x8cb0('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8cb0('0x2'));var qs=require(_0x8cb0('0x3'));var logger=require(_0x8cb0('0x4'))('api');var config=require(_0x8cb0('0x5'));var db=require(_0x8cb0('0x6'))['db'];var jayson=require(_0x8cb0('0x7'));var client=jayson['client'][_0x8cb0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xce019a,_0x371bdd,_0x44bb6e,_0x19eb0e){return new Promise(function(_0x26aa11,_0x4a4fcb){var _0x1916f7=_0x19eb0e||client;return _0x1916f7[_0x8cb0('0x9')](_0xce019a,_0x44bb6e)['then'](function(_0x2fb2e7){logger[_0x8cb0('0xa')](_0x8cb0('0xb'),_0x371bdd,_0x8cb0('0xc'));logger[_0x8cb0('0xd')](_0x8cb0('0xe'),_0x371bdd,_0x8cb0('0xc'),JSON[_0x8cb0('0xf')](_0x2fb2e7));if(_0x2fb2e7[_0x8cb0('0x10')]){if(_0x2fb2e7[_0x8cb0('0x10')][_0x8cb0('0x11')]===0x1f4){logger['error'](_0x8cb0('0xb'),_0x371bdd,_0x2fb2e7[_0x8cb0('0x10')][_0x8cb0('0x12')]);return _0x4a4fcb(_0x2fb2e7['error'][_0x8cb0('0x12')]);}logger['error'](_0x8cb0('0xb'),_0x371bdd,_0x2fb2e7[_0x8cb0('0x10')][_0x8cb0('0x12')]);return _0x26aa11(_0x2fb2e7[_0x8cb0('0x10')][_0x8cb0('0x12')]);}else{logger[_0x8cb0('0xa')]('Network,\x20%s,\x20%s',_0x371bdd,_0x8cb0('0xc'));_0x26aa11(_0x2fb2e7[_0x8cb0('0x13')]['message']);}})[_0x8cb0('0x14')](function(_0x4006f1){logger['error']('Network,\x20%s,\x20%s',_0x371bdd,_0x4006f1);_0x4a4fcb(_0x4006f1);});});}function respondWithResult(_0x43ff1e,_0x561950){_0x561950=_0x561950||0xc8;return function(_0x18cc9e){if(_0x18cc9e){return _0x43ff1e[_0x8cb0('0x15')](_0x561950)['json'](_0x18cc9e);}};}function respondWithFilteredResult(_0x51b167,_0x549e2f){return function(_0x43dde4){if(_0x43dde4){var _0x5b150c=typeof _0x549e2f[_0x8cb0('0x16')]===_0x8cb0('0x17')&&typeof _0x549e2f[_0x8cb0('0x18')]==='undefined';var _0x1a457d=_0x43dde4[_0x8cb0('0x19')];var _0x795dc4=_0x5b150c?0x0:_0x549e2f[_0x8cb0('0x16')];var _0x446c80=_0x5b150c?_0x43dde4['count']:_0x549e2f[_0x8cb0('0x16')]+_0x549e2f[_0x8cb0('0x18')];var _0x5edeba;if(_0x446c80>=_0x1a457d){_0x446c80=_0x1a457d;_0x5edeba=0xc8;}else{_0x5edeba=0xce;}_0x51b167[_0x8cb0('0x15')](_0x5edeba);return _0x51b167[_0x8cb0('0x1a')](_0x8cb0('0x1b'),_0x795dc4+'-'+_0x446c80+'/'+_0x1a457d)[_0x8cb0('0x1c')](_0x43dde4);}return null;};}function saveUpdates(_0x1c77ec){return function(_0x589916){if(_0x589916){return _0x589916['update'](_0x1c77ec)['then'](function(_0x2d3506){return _0x2d3506;});}return null;};}function removeEntity(_0x4b4b0f){return function(_0x5c3a14){if(_0x5c3a14){return _0x5c3a14[_0x8cb0('0x1d')]()[_0x8cb0('0x1e')](function(){_0x4b4b0f[_0x8cb0('0x15')](0xcc)[_0x8cb0('0x1f')]();});}};}function handleEntityNotFound(_0x11c982){return function(_0x5258dc){if(!_0x5258dc){_0x11c982[_0x8cb0('0x20')](0x194);}return _0x5258dc;};}function handleError(_0x225221,_0x35c581){_0x35c581=_0x35c581||0x1f4;return function(_0x2b6d0a){logger[_0x8cb0('0x10')](_0x2b6d0a[_0x8cb0('0x21')]);if(_0x2b6d0a[_0x8cb0('0x22')]){delete _0x2b6d0a[_0x8cb0('0x22')];}_0x225221[_0x8cb0('0x15')](_0x35c581)[_0x8cb0('0x23')](_0x2b6d0a);};}exports[_0x8cb0('0x24')]=function(_0x2a3c88,_0x29898e){var _0xb29efb={},_0x32e9e5={},_0x3f050f={'count':0x0,'rows':[]};var _0x2582fa=_[_0x8cb0('0x25')](db[_0x8cb0('0x26')][_0x8cb0('0x27')],function(_0x12c82b){return{'name':_0x12c82b[_0x8cb0('0x28')],'type':_0x12c82b['type'][_0x8cb0('0x29')]};});_0x32e9e5[_0x8cb0('0x2a')]=_[_0x8cb0('0x25')](_0x2582fa,_0x8cb0('0x22'));_0x32e9e5[_0x8cb0('0x2b')]=_[_0x8cb0('0x2c')](_0x2a3c88[_0x8cb0('0x2b')]);_0x32e9e5[_0x8cb0('0x2d')]=_[_0x8cb0('0x2e')](_0x32e9e5[_0x8cb0('0x2a')],_0x32e9e5[_0x8cb0('0x2b')]);_0xb29efb['attributes']=_[_0x8cb0('0x2e')](_0x32e9e5['model'],qs[_0x8cb0('0x2f')](_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x2f')]));_0xb29efb[_0x8cb0('0x30')]=_0xb29efb[_0x8cb0('0x30')][_0x8cb0('0x31')]?_0xb29efb[_0x8cb0('0x30')]:_0x32e9e5[_0x8cb0('0x2a')];if(!_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x32')](_0x8cb0('0x33'))){_0xb29efb[_0x8cb0('0x18')]=qs[_0x8cb0('0x18')](_0x2a3c88['query'][_0x8cb0('0x18')]);_0xb29efb[_0x8cb0('0x16')]=qs['offset'](_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x16')]);}_0xb29efb[_0x8cb0('0x34')]=qs[_0x8cb0('0x35')](_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x35')]);_0xb29efb[_0x8cb0('0x36')]=qs[_0x8cb0('0x2d')](_[_0x8cb0('0x37')](_0x2a3c88[_0x8cb0('0x2b')],_0x32e9e5[_0x8cb0('0x2d')]),_0x2582fa);if(_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x38')]){_0xb29efb['where']=_[_0x8cb0('0x39')](_0xb29efb['where'],{'$or':_[_0x8cb0('0x25')](_0x2582fa,function(_0x389d08){if(_0x389d08['type']!==_0x8cb0('0x3a')){var _0x12e329={};_0x12e329[_0x389d08[_0x8cb0('0x22')]]={'$like':'%'+_0x2a3c88[_0x8cb0('0x2b')][_0x8cb0('0x38')]+'%'};return _0x12e329;}})});}_0xb29efb=_[_0x8cb0('0x39')]({},_0xb29efb,_0x2a3c88[_0x8cb0('0x3b')]);var _0x2f1ba5={'where':_0xb29efb[_0x8cb0('0x36')]};return db[_0x8cb0('0x26')][_0x8cb0('0x19')](_0x2f1ba5)['then'](function(_0x30d8a6){_0x3f050f[_0x8cb0('0x19')]=_0x30d8a6;if(_0x2a3c88['query']['includeAll']){_0xb29efb[_0x8cb0('0x3c')]=[{'all':!![]}];}return db[_0x8cb0('0x26')][_0x8cb0('0x3d')](_0xb29efb);})[_0x8cb0('0x1e')](function(_0x2e2a7f){_0x3f050f[_0x8cb0('0x3e')]=_0x2e2a7f;return _0x3f050f;})[_0x8cb0('0x1e')](respondWithFilteredResult(_0x29898e,_0xb29efb))[_0x8cb0('0x14')](handleError(_0x29898e,null));};exports[_0x8cb0('0x3f')]=function(_0x3bcdeb,_0x5e3094){var _0x1fc993={'raw':!![],'where':{'id':_0x3bcdeb[_0x8cb0('0x40')]['id']}},_0x1cc68b={};_0x1cc68b[_0x8cb0('0x2a')]=_[_0x8cb0('0x2c')](db[_0x8cb0('0x26')]['rawAttributes']);_0x1cc68b[_0x8cb0('0x2b')]=_[_0x8cb0('0x2c')](_0x3bcdeb[_0x8cb0('0x2b')]);_0x1cc68b[_0x8cb0('0x2d')]=_[_0x8cb0('0x2e')](_0x1cc68b[_0x8cb0('0x2a')],_0x1cc68b['query']);_0x1fc993[_0x8cb0('0x30')]=_[_0x8cb0('0x2e')](_0x1cc68b['model'],qs[_0x8cb0('0x2f')](_0x3bcdeb[_0x8cb0('0x2b')][_0x8cb0('0x2f')]));_0x1fc993[_0x8cb0('0x30')]=_0x1fc993[_0x8cb0('0x30')][_0x8cb0('0x31')]?_0x1fc993[_0x8cb0('0x30')]:_0x1cc68b[_0x8cb0('0x2a')];if(_0x3bcdeb['query'][_0x8cb0('0x41')]){_0x1fc993['include']=[{'all':!![]}];}_0x1fc993=_['merge']({},_0x1fc993,_0x3bcdeb['options']);return db[_0x8cb0('0x26')]['find'](_0x1fc993)[_0x8cb0('0x1e')](handleEntityNotFound(_0x5e3094,null))[_0x8cb0('0x1e')](respondWithResult(_0x5e3094,null))['catch'](handleError(_0x5e3094,null));};exports[_0x8cb0('0x42')]=function(_0x190619,_0x4a9a36){var _0x3a8f2e;return db[_0x8cb0('0x26')][_0x8cb0('0x42')](_0x190619['body'],{'raw':!![]})[_0x8cb0('0x1e')](function(_0x4d90c2){_0x3a8f2e=_0x4d90c2;return db[_0x8cb0('0x26')][_0x8cb0('0x3d')]({'where':{'type':_0x190619[_0x8cb0('0x43')][_0x8cb0('0x44')]},'raw':!![]});})[_0x8cb0('0x1e')](function(_0xe1e18f){if(_0x3a8f2e['type'][_0x8cb0('0x45')]()==_0x8cb0('0x46')){var _0x59a6e4=fs[_0x8cb0('0x47')](path['join'](config['root'],_0x8cb0('0x48')),_0x8cb0('0x49'));var _0x2a12af=ejs[_0x8cb0('0x4a')](_0x59a6e4,{'networks':_0xe1e18f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2a12af);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x42'),{'module':_0x8cb0('0x4c')});}else if(_0x3a8f2e['type'][_0x8cb0('0x45')]()==_0x8cb0('0x4d')){var _0x1c2cc5=fs[_0x8cb0('0x47')](path[_0x8cb0('0x4e')](config['root'],_0x8cb0('0x4f')),'utf8');var _0x4178ac=ejs['render'](_0x1c2cc5,{'networks':_0xe1e18f||[]});fs[_0x8cb0('0x50')](_0x8cb0('0x51'),_0x4178ac);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x42'),{'module':'res_stun_monitor.so'});}else{var _0x2be77f=fs[_0x8cb0('0x47')](path[_0x8cb0('0x4e')](config[_0x8cb0('0x52')],_0x8cb0('0x53')),_0x8cb0('0x49'));var _0xa65a0f=ejs[_0x8cb0('0x4a')](_0x2be77f,{'networks':_0xe1e18f||[]});fs['writeFileSync'](util[_0x8cb0('0x54')](_0x8cb0('0x55'),_0x190619[_0x8cb0('0x43')][_0x8cb0('0x44')][_0x8cb0('0x56')]()),_0xa65a0f);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x42'),{'module':_0x8cb0('0x57')});}})[_0x8cb0('0x1e')](function(){return _0x3a8f2e;})['then'](respondWithResult(_0x4a9a36,0xc9))[_0x8cb0('0x14')](handleError(_0x4a9a36,null));};exports[_0x8cb0('0x58')]=function(_0x4eb710,_0x15008c){var _0x20cf75;return db[_0x8cb0('0x26')][_0x8cb0('0x59')]({'where':{'id':_0x4eb710[_0x8cb0('0x40')]['id']}})[_0x8cb0('0x1e')](handleEntityNotFound(_0x15008c,null))[_0x8cb0('0x1e')](saveUpdates(_0x4eb710['body'],null))[_0x8cb0('0x1e')](function(_0x28294d){if(_0x28294d){_0x20cf75=_0x28294d;return db[_0x8cb0('0x26')][_0x8cb0('0x3d')]({'where':{'type':_0x20cf75[_0x8cb0('0x44')]},'raw':!![]});}return null;})['then'](function(_0x26e457){if(_0x20cf75[_0x8cb0('0x44')][_0x8cb0('0x45')]()==_0x8cb0('0x46')){var _0x4313dd=fs[_0x8cb0('0x47')](path['join'](config[_0x8cb0('0x52')],_0x8cb0('0x48')),_0x8cb0('0x49'));var _0x5856b7=ejs[_0x8cb0('0x4a')](_0x4313dd,{'networks':_0x26e457||[]});fs[_0x8cb0('0x50')](_0x8cb0('0x5a'),_0x5856b7);return respondWithRpcPromise(_0x8cb0('0x4b'),'update',{'module':_0x8cb0('0x4c')});}else if(_0x20cf75[_0x8cb0('0x44')][_0x8cb0('0x45')]()==_0x8cb0('0x4d')){var _0x6caa01=fs[_0x8cb0('0x47')](path[_0x8cb0('0x4e')](config[_0x8cb0('0x52')],_0x8cb0('0x4f')),'utf8');var _0x35ca49=ejs['render'](_0x6caa01,{'networks':_0x26e457||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x35ca49);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x58'),{'module':_0x8cb0('0x4c')});}else{var _0x1c3342=fs[_0x8cb0('0x47')](path['join'](config[_0x8cb0('0x52')],'server/files/templates/network.ejs'),'utf8');var _0x43e7b5=ejs['render'](_0x1c3342,{'networks':_0x26e457||[]});fs[_0x8cb0('0x50')](util['format'](_0x8cb0('0x55'),_0x4eb710[_0x8cb0('0x43')][_0x8cb0('0x44')]['toLowerCase']()),_0x43e7b5);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x58'),{'module':'chan_sip.so'});}})['then'](function(_0x4a6085){if(_0x4a6085){return _0x20cf75;}return null;})['then'](respondWithResult(_0x15008c,null))[_0x8cb0('0x14')](handleError(_0x15008c,null));};exports[_0x8cb0('0x1d')]=function(_0x3d51af,_0x54d6a8){var _0x109649;return db[_0x8cb0('0x26')][_0x8cb0('0x59')]({'where':{'id':_0x3d51af[_0x8cb0('0x40')]['id']}})['then'](function(_0x13d157){_0x109649=_0x13d157;return _0x13d157;})['then'](handleEntityNotFound(_0x54d6a8,null))[_0x8cb0('0x1e')](removeEntity(_0x54d6a8,null))['then'](function(){if(_0x109649){return db[_0x8cb0('0x26')][_0x8cb0('0x3d')]({'where':{'type':_0x109649[_0x8cb0('0x44')]},'raw':!![]});}})[_0x8cb0('0x1e')](function(_0x240413){if(_0x109649['type']['toUpperCase']()=='STUN'){var _0x5ee6c9=fs[_0x8cb0('0x47')](path['join'](config[_0x8cb0('0x52')],_0x8cb0('0x48')),_0x8cb0('0x49'));var _0x5aa8d4=ejs[_0x8cb0('0x4a')](_0x5ee6c9,{'networks':_0x240413||[]});fs[_0x8cb0('0x50')](_0x8cb0('0x5a'),_0x5aa8d4);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x1d'),{'module':_0x8cb0('0x4c')});}else if(_0x109649[_0x8cb0('0x44')][_0x8cb0('0x45')]()==_0x8cb0('0x4d')){var _0x36f01c=fs['readFileSync'](path[_0x8cb0('0x4e')](config['root'],_0x8cb0('0x4f')),_0x8cb0('0x49'));var _0x3dc98b=ejs[_0x8cb0('0x4a')](_0x36f01c,{'networks':_0x240413||[]});fs[_0x8cb0('0x50')]('/etc/asterisk/turn_xcally.conf',_0x3dc98b);return respondWithRpcPromise(_0x8cb0('0x4b'),'destroy',{'module':_0x8cb0('0x4c')});}else{var _0x4053e7=fs[_0x8cb0('0x47')](path[_0x8cb0('0x4e')](config['root'],'server/files/templates/network.ejs'),_0x8cb0('0x49'));var _0x4380ae=ejs['render'](_0x4053e7,{'networks':_0x240413||[]});fs['writeFileSync'](util[_0x8cb0('0x54')](_0x8cb0('0x55'),_0x109649[_0x8cb0('0x44')][_0x8cb0('0x56')]()),_0x4380ae);return respondWithRpcPromise(_0x8cb0('0x4b'),_0x8cb0('0x1d'),{'module':_0x8cb0('0x57')});}})['catch'](handleError(_0x54d6a8,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4e56da9..2a441d3 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 _0x9d9b=['rimraf','./network.attributes','Network','network','util','../../config/logger','moment','request-promise','path'];(function(_0x19e99c,_0x100aa1){var _0xf4381e=function(_0x6672b4){while(--_0x6672b4){_0x19e99c['push'](_0x19e99c['shift']());}};_0xf4381e(++_0x100aa1);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x35f95a,_0x40d951){_0x35f95a=_0x35f95a-0x0;var _0x547a7a=_0x9d9b[_0x35f95a];return _0x547a7a;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var logger=require(_0xb9d9('0x1'))('api');var moment=require(_0xb9d9('0x2'));var BPromise=require('bluebird');var rp=require(_0xb9d9('0x3'));var fs=require('fs');var path=require(_0xb9d9('0x4'));var rimraf=require(_0xb9d9('0x5'));var config=require('../../config/environment');var attributes=require(_0xb9d9('0x6'));module['exports']=function(_0x1b1f3c,_0x32cf18){return _0x1b1f3c['define'](_0xb9d9('0x7'),attributes,{'tableName':_0xb9d9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e9=['bluebird','rimraf','./network.attributes','exports','define','Network','network','lodash','util','api','moment'];(function(_0x2b4c81,_0x35a785){var _0xc997a9=function(_0x1cb119){while(--_0x1cb119){_0x2b4c81['push'](_0x2b4c81['shift']());}};_0xc997a9(++_0x35a785);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require('../../config/logger')(_0x949e('0x2'));var moment=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x949e('0x5'));var config=require('../../config/environment');var attributes=require(_0x949e('0x6'));module[_0x949e('0x7')]=function(_0x360308,_0x56c7b2){return _0x360308[_0x949e('0x8')](_0x949e('0x9'),attributes,{'tableName':_0x949e('0xa'),'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 162c90f..0811cb8 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(_0x35e03d,_0xf916d6){var _0x12738d=function(_0x38bd4c){while(--_0x38bd4c){_0x35e03d['push'](_0x35e03d['shift']());}};_0x12738d(++_0xf916d6);}(_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 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5afcd1,_0x3e9528){_0x5afcd1=_0x5afcd1-0x0;var _0x408c61=_0x7a54[_0x5afcd1];return _0x408c61;};'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 02490d5..291d522 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 _0xf3f5=['getAgents','create','post','addDisposition','addAnswer','addApplications','/:id/send','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users'];(function(_0x29bb0a,_0x4a49e6){var _0x1725e4=function(_0xc984bd){while(--_0xc984bd){_0x29bb0a['push'](_0x29bb0a['shift']());}};_0x1725e4(++_0x4a49e6);}(_0xf3f5,0x7f));var _0x5f3f=function(_0x269e3f,_0x35992a){_0x269e3f=_0x269e3f-0x0;var _0x37144d=_0xf3f5[_0x269e3f];return _0x37144d;};'use strict';var multer=require(_0x5f3f('0x0'));var util=require(_0x5f3f('0x1'));var path=require(_0x5f3f('0x2'));var timeout=require(_0x5f3f('0x3'));var express=require(_0x5f3f('0x4'));var router=express[_0x5f3f('0x5')]();var fs_extra=require(_0x5f3f('0x6'));var auth=require(_0x5f3f('0x7'));var interaction=require(_0x5f3f('0x8'));var config=require('../../config/environment');var controller=require(_0x5f3f('0x9'));router[_0x5f3f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5f3f('0xa')](_0x5f3f('0xb'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0xd')]);router[_0x5f3f('0xa')](_0x5f3f('0xe'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0xf')]);router[_0x5f3f('0xa')](_0x5f3f('0x10'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x11')]);router[_0x5f3f('0xa')](_0x5f3f('0x12'),auth['isAuthenticated'](),controller[_0x5f3f('0x13')]);router[_0x5f3f('0xa')](_0x5f3f('0x14'),auth['isAuthenticated'](),controller[_0x5f3f('0x15')]);router['get'](_0x5f3f('0x16'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x17')]);router[_0x5f3f('0xa')](_0x5f3f('0x18'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x19')]);router['post']('/',auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x1a')]);router[_0x5f3f('0x1b')](_0x5f3f('0x10'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x1c')]);router[_0x5f3f('0x1b')](_0x5f3f('0x12'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x1d')]);router[_0x5f3f('0x1b')]('/:id/notify',controller['notify']);router[_0x5f3f('0x1b')](_0x5f3f('0x14'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x1e')]);router['post'](_0x5f3f('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x5f3f('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x5f3f('0x20')](_0x5f3f('0xe'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x21')]);router[_0x5f3f('0x22')](_0x5f3f('0xe'),auth[_0x5f3f('0xc')](),controller['destroy']);router['delete'](_0x5f3f('0x10'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x23')]);router[_0x5f3f('0x22')](_0x5f3f('0x12'),auth[_0x5f3f('0xc')](),controller[_0x5f3f('0x24')]);router[_0x5f3f('0x22')](_0x5f3f('0x18'),auth[_0x5f3f('0xc')](),controller['removeAgents']);module[_0x5f3f('0x25')]=router; \ No newline at end of file +var _0x76b9=['getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x76b9,0x109));var _0x976b=function(_0x3ac731,_0x215fee){_0x3ac731=_0x3ac731-0x0;var _0x272da0=_0x76b9[_0x3ac731];return _0x272da0;};'use strict';var multer=require(_0x976b('0x0'));var util=require(_0x976b('0x1'));var path=require(_0x976b('0x2'));var timeout=require(_0x976b('0x3'));var express=require('express');var router=express[_0x976b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x976b('0x5'));var interaction=require(_0x976b('0x6'));var config=require(_0x976b('0x7'));var controller=require(_0x976b('0x8'));router[_0x976b('0x9')]('/',auth[_0x976b('0xa')](),controller['index']);router[_0x976b('0x9')](_0x976b('0xb'),auth[_0x976b('0xa')](),controller[_0x976b('0xc')]);router[_0x976b('0x9')](_0x976b('0xd'),auth[_0x976b('0xa')](),controller[_0x976b('0xe')]);router['get'](_0x976b('0xf'),auth['isAuthenticated'](),controller[_0x976b('0x10')]);router['get'](_0x976b('0x11'),auth[_0x976b('0xa')](),controller[_0x976b('0x12')]);router['get'](_0x976b('0x13'),auth[_0x976b('0xa')](),controller[_0x976b('0x14')]);router[_0x976b('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x976b('0x9')](_0x976b('0x15'),auth[_0x976b('0xa')](),controller[_0x976b('0x16')]);router['post']('/',auth[_0x976b('0xa')](),controller[_0x976b('0x17')]);router[_0x976b('0x18')](_0x976b('0xf'),auth[_0x976b('0xa')](),controller[_0x976b('0x19')]);router[_0x976b('0x18')](_0x976b('0x11'),auth['isAuthenticated'](),controller[_0x976b('0x1a')]);router[_0x976b('0x18')](_0x976b('0x1b'),controller[_0x976b('0x1c')]);router[_0x976b('0x18')](_0x976b('0x13'),auth[_0x976b('0xa')](),controller[_0x976b('0x1d')]);router[_0x976b('0x18')](_0x976b('0x15'),auth[_0x976b('0xa')](),controller[_0x976b('0x1e')]);router['post'](_0x976b('0x1f'),auth[_0x976b('0xa')](),controller[_0x976b('0x20')]);router[_0x976b('0x21')](_0x976b('0xd'),auth[_0x976b('0xa')](),controller[_0x976b('0x22')]);router[_0x976b('0x23')](_0x976b('0xd'),auth[_0x976b('0xa')](),controller[_0x976b('0x24')]);router[_0x976b('0x23')](_0x976b('0xf'),auth['isAuthenticated'](),controller[_0x976b('0x25')]);router[_0x976b('0x23')](_0x976b('0x11'),auth['isAuthenticated'](),controller[_0x976b('0x26')]);router[_0x976b('0x23')]('/:id/users',auth[_0x976b('0xa')](),controller[_0x976b('0x27')]);module[_0x976b('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 84bd946..694d653 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 _0x9d37=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','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'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x9d37,0x1ef));var _0x79d3=function(_0x569b09,_0x1cc10c){_0x569b09=_0x569b09-0x0;var _0x50295e=_0x9d37[_0x569b09];return _0x50295e;};'use strict';var Sequelize=require(_0x79d3('0x0'));var rs=require(_0x79d3('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x79d3('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x79d3('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x79d3('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x79d3('0x4')],'defaultValue':function(){return _0x79d3('0x5');}},'notificationSound':{'type':Sequelize[_0x79d3('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x79d3('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x79d3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x79d3('0x3')]},'queueTransfer':{'type':Sequelize[_0x79d3('0x6')],'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[_0x79d3('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x79d3('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x79d3('0x9'),'set':function(_0x459bdb){if(!_0x459bdb)this['setDataValue'](_0x79d3('0xa'),null);this['setDataValue'](_0x79d3('0xb'),_0x459bdb);}}}; \ No newline at end of file +var _0xcf29=['generate','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING'];(function(_0x16cb99,_0x1a310a){var _0x356708=function(_0xa4a085){while(--_0xa4a085){_0x16cb99['push'](_0x16cb99['shift']());}};_0x356708(++_0x1a310a);}(_0xcf29,0x111));var _0x9cf2=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0xcf29[_0x238830];return _0x5917f0;};'use strict';var Sequelize=require(_0x9cf2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9cf2('0x1')]},'token':{'type':Sequelize[_0x9cf2('0x1')],'defaultValue':function(){return rs[_0x9cf2('0x2')]();}},'replyUri':{'type':Sequelize[_0x9cf2('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9cf2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9cf2('0x3')],'defaultValue':function(){return _0x9cf2('0x4');}},'notificationSound':{'type':Sequelize[_0x9cf2('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cf2('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cf2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9cf2('0x1')]},'queueTransfer':{'type':Sequelize[_0x9cf2('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cf2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9cf2('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cf2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cf2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x9cf2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x9cf2('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3bd074){if(!_0x3bd074)this[_0x9cf2('0x8')](_0x9cf2('0x9'),null);this[_0x9cf2('0x8')](_0x9cf2('0xa'),_0x3bd074);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ac33a76..184d6c8 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 _0x1801=['out','Messages','OpenchannelMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','save','update','destroy','get','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','OpenchannelApplication','List','account','applications','orderBy','priority','asc','Applications','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1801,0xc6));var _0x1180=function(_0x1478c4,_0x356182){_0x1478c4=_0x1478c4-0x0;var _0x2d4169=_0x1801[_0x1478c4];return _0x2d4169;};'use strict';var emlformat=require(_0x1180('0x0'));var rimraf=require(_0x1180('0x1'));var zipdir=require(_0x1180('0x2'));var jsonpatch=require(_0x1180('0x3'));var rp=require(_0x1180('0x4'));var moment=require(_0x1180('0x5'));var BPromise=require(_0x1180('0x6'));var Mustache=require(_0x1180('0x7'));var util=require(_0x1180('0x8'));var path=require(_0x1180('0x9'));var sox=require(_0x1180('0xa'));var csv=require(_0x1180('0xb'));var ejs=require(_0x1180('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1180('0xd'));var squel=require(_0x1180('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1180('0xf'));var toCsv=require(_0x1180('0xb'));var querystring=require(_0x1180('0x10'));var Papa=require(_0x1180('0x11'));var Redis=require(_0x1180('0x12'));var authService=require(_0x1180('0x13'));var qs=require(_0x1180('0x14'));var as=require(_0x1180('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1180('0x16'))(_0x1180('0x17'));var utils=require(_0x1180('0x18'));var config=require(_0x1180('0x19'));var licenseUtil=require(_0x1180('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1180('0x1b')](config[_0x1180('0x1c')],{'host':_0x1180('0x1d'),'port':0x18eb});var socket=require(_0x1180('0x1e'))(new Redis(config[_0x1180('0x1c')]));require(_0x1180('0x1f'))[_0x1180('0x20')](socket);var jayson=require(_0x1180('0x21'));var client=jayson[_0x1180('0x22')][_0x1180('0x23')]({'port':0x232c});var client9002=jayson[_0x1180('0x22')][_0x1180('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x12de8c,_0x5e263f,_0x56cd8b,_0x56b828){return new BPromise(function(_0x37c513,_0x5b8d60){var _0x22448f=_0x56b828||client;return _0x22448f['request'](_0x12de8c,_0x56cd8b)[_0x1180('0x24')](function(_0x2d4714){logger[_0x1180('0x25')](_0x1180('0x26'),_0x5e263f,_0x1180('0x27'));logger[_0x1180('0x28')](_0x1180('0x29'),_0x5e263f,_0x1180('0x27'),JSON[_0x1180('0x2a')](_0x2d4714));if(_0x2d4714[_0x1180('0x2b')]){if(_0x2d4714[_0x1180('0x2b')]['code']===0x1f4){logger[_0x1180('0x2b')](_0x1180('0x26'),_0x5e263f,_0x2d4714[_0x1180('0x2b')]['message']);return _0x5b8d60(_0x2d4714[_0x1180('0x2b')]['message']);}logger[_0x1180('0x2b')](_0x1180('0x26'),_0x5e263f,_0x2d4714[_0x1180('0x2b')][_0x1180('0x2c')]);return _0x37c513(_0x2d4714[_0x1180('0x2b')]['message']);}else{logger[_0x1180('0x25')](_0x1180('0x26'),_0x5e263f,_0x1180('0x27'));_0x37c513(_0x2d4714[_0x1180('0x2d')][_0x1180('0x2c')]);}})[_0x1180('0x2e')](function(_0x3586ff){logger[_0x1180('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e263f,_0x3586ff);_0x5b8d60(_0x3586ff);});});}function respondWithStatusCode(_0x3bdeee,_0x3f7348){_0x3f7348=_0x3f7348||0xcc;return function(_0x289013){if(_0x289013){return _0x3bdeee[_0x1180('0x2f')](_0x3f7348);}return _0x3bdeee[_0x1180('0x30')](_0x3f7348)['end']();};}function respondWithResult(_0x433eb8,_0x319426){_0x319426=_0x319426||0xc8;return function(_0x1309bb){if(_0x1309bb){return _0x433eb8[_0x1180('0x30')](_0x319426)['json'](_0x1309bb);}};}function respondWithFilteredResult(_0x349783,_0xbdec61){return function(_0x1917f5){if(_0x1917f5){var _0x9bec5f=typeof _0xbdec61[_0x1180('0x31')]===_0x1180('0x32')&&typeof _0xbdec61['limit']==='undefined';var _0x141908=_0x1917f5[_0x1180('0x33')];var _0x54836a=_0x9bec5f?0x0:_0xbdec61[_0x1180('0x31')];var _0x548d03=_0x9bec5f?_0x1917f5[_0x1180('0x33')]:_0xbdec61[_0x1180('0x31')]+_0xbdec61['limit'];var _0x4df16a;if(_0x548d03>=_0x141908){_0x548d03=_0x141908;_0x4df16a=0xc8;}else{_0x4df16a=0xce;}_0x349783[_0x1180('0x30')](_0x4df16a);return _0x349783[_0x1180('0x34')](_0x1180('0x35'),_0x54836a+'-'+_0x548d03+'/'+_0x141908)[_0x1180('0x36')](_0x1917f5);}return null;};}function patchUpdates(_0x20530b){return function(_0xa88840){try{jsonpatch[_0x1180('0x37')](_0xa88840,_0x20530b,!![]);}catch(_0x57875f){return BPromise['reject'](_0x57875f);}return _0xa88840[_0x1180('0x38')]();};}function saveUpdates(_0x16dde2,_0x82c94f){return function(_0x3f1053){if(_0x3f1053){return _0x3f1053[_0x1180('0x39')](_0x16dde2)['then'](function(_0x2cf6bc){return _0x2cf6bc;});}return null;};}function removeEntity(_0x8f2563,_0x490429){return function(_0xa2aff8){if(_0xa2aff8){return _0xa2aff8[_0x1180('0x3a')]()['then'](function(){var _0x2e1b6b=_0xa2aff8[_0x1180('0x3b')]({'plain':!![]});var _0xb1099b=_0x1180('0x3c');return db['UserProfileResource'][_0x1180('0x3a')]({'where':{'type':_0xb1099b,'resourceId':_0x2e1b6b['id']}})[_0x1180('0x24')](function(){return _0xa2aff8;});})['then'](function(){_0x8f2563[_0x1180('0x30')](0xcc)[_0x1180('0x3d')]();});}};}function handleEntityNotFound(_0xfdeca8,_0x5bb77e){return function(_0x4c1456){if(!_0x4c1456){_0xfdeca8[_0x1180('0x2f')](0x194);}return _0x4c1456;};}function handleError(_0x1d7762,_0x5cc735){_0x5cc735=_0x5cc735||0x1f4;return function(_0x1167cc){logger['error'](_0x1167cc[_0x1180('0x3e')]);if(_0x1167cc[_0x1180('0x3f')]){delete _0x1167cc[_0x1180('0x3f')];}_0x1d7762[_0x1180('0x30')](_0x5cc735)[_0x1180('0x40')](_0x1167cc);};}exports[_0x1180('0x41')]=function(_0x595936,_0x1e7856){var _0x34fcaa={'include':[{'model':db[_0x1180('0x42')],'as':_0x1180('0x43')}]},_0x998e7f={},_0x412d2b={'count':0x0,'rows':[]};var _0x531515=_[_0x1180('0x44')](db[_0x1180('0x45')]['rawAttributes'],function(_0x28033b){return{'name':_0x28033b['fieldName'],'type':_0x28033b[_0x1180('0x46')][_0x1180('0x47')]};});_0x998e7f[_0x1180('0x48')]=_[_0x1180('0x44')](_0x531515,_0x1180('0x3f'));_0x998e7f[_0x1180('0x49')]=_[_0x1180('0x4a')](_0x595936['query']);_0x998e7f[_0x1180('0x4b')]=_[_0x1180('0x4c')](_0x998e7f[_0x1180('0x48')],_0x998e7f['query']);_0x34fcaa[_0x1180('0x4d')]=_[_0x1180('0x4c')](_0x998e7f[_0x1180('0x48')],qs[_0x1180('0x4e')](_0x595936[_0x1180('0x49')][_0x1180('0x4e')]));_0x34fcaa[_0x1180('0x4d')]=_0x34fcaa[_0x1180('0x4d')][_0x1180('0x4f')]?_0x34fcaa[_0x1180('0x4d')]:_0x998e7f[_0x1180('0x48')];if(!_0x595936['query'][_0x1180('0x50')](_0x1180('0x51'))){_0x34fcaa[_0x1180('0x52')]=qs[_0x1180('0x52')](_0x595936[_0x1180('0x49')][_0x1180('0x52')]);_0x34fcaa['offset']=qs['offset'](_0x595936['query'][_0x1180('0x31')]);}_0x34fcaa[_0x1180('0x53')]=qs[_0x1180('0x54')](_0x595936['query']['sort']);_0x34fcaa['where']=qs[_0x1180('0x4b')](_[_0x1180('0x55')](_0x595936[_0x1180('0x49')],_0x998e7f['filters']),_0x531515);if(_0x595936[_0x1180('0x49')][_0x1180('0x56')]){_0x34fcaa[_0x1180('0x57')]=_[_0x1180('0x58')](_0x34fcaa['where'],{'$or':_['map'](_0x531515,function(_0x4ba899){if(_0x4ba899[_0x1180('0x46')]!==_0x1180('0x59')){var _0x3d702b={};_0x3d702b[_0x4ba899['name']]={'$like':'%'+_0x595936[_0x1180('0x49')][_0x1180('0x56')]+'%'};return _0x3d702b;}})});}_0x34fcaa=_[_0x1180('0x58')]({},_0x34fcaa,_0x595936[_0x1180('0x5a')]);var _0x1f6f97={'where':_0x34fcaa['where']};return db[_0x1180('0x45')][_0x1180('0x33')](_0x1f6f97)[_0x1180('0x24')](function(_0x37cb47){_0x412d2b[_0x1180('0x33')]=_0x37cb47;if(_0x595936[_0x1180('0x49')][_0x1180('0x5b')]){_0x34fcaa['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x1180('0x5c')](_0x34fcaa);})[_0x1180('0x24')](function(_0x49dc14){_0x412d2b[_0x1180('0x5d')]=_0x49dc14;return _0x412d2b;})['then'](respondWithFilteredResult(_0x1e7856,_0x34fcaa))['catch'](handleError(_0x1e7856,null));};exports[_0x1180('0x5e')]=function(_0x539b72,_0x44a1c2){var _0x53cfcd={'raw':![],'where':{'id':_0x539b72[_0x1180('0x5f')]['id']},'include':[{'model':db[_0x1180('0x42')],'as':'mandatoryDispositionPause'}]},_0x152dae={};_0x152dae[_0x1180('0x48')]=_['keys'](db[_0x1180('0x45')][_0x1180('0x60')]);_0x152dae[_0x1180('0x49')]=_[_0x1180('0x4a')](_0x539b72[_0x1180('0x49')]);_0x152dae[_0x1180('0x4b')]=_[_0x1180('0x4c')](_0x152dae['model'],_0x152dae[_0x1180('0x49')]);_0x53cfcd[_0x1180('0x4d')]=_[_0x1180('0x4c')](_0x152dae['model'],qs[_0x1180('0x4e')](_0x539b72[_0x1180('0x49')][_0x1180('0x4e')]));_0x53cfcd['attributes']=_0x53cfcd[_0x1180('0x4d')][_0x1180('0x4f')]?_0x53cfcd[_0x1180('0x4d')]:_0x152dae[_0x1180('0x48')];if(_0x539b72['query'][_0x1180('0x5b')]){_0x53cfcd[_0x1180('0x61')]=[{'all':!![]}];}_0x53cfcd=_[_0x1180('0x58')]({},_0x53cfcd,_0x539b72[_0x1180('0x5a')]);return db[_0x1180('0x45')][_0x1180('0x62')](_0x53cfcd)[_0x1180('0x24')](handleEntityNotFound(_0x44a1c2,null))[_0x1180('0x24')](respondWithResult(_0x44a1c2,null))[_0x1180('0x2e')](handleError(_0x44a1c2,null));};exports[_0x1180('0x63')]=function(_0x41a7ae,_0x28eb8a){return db[_0x1180('0x45')][_0x1180('0x63')](_0x41a7ae[_0x1180('0x64')],{})[_0x1180('0x24')](function(_0x1503aa){var _0x5c674f=_0x41a7ae[_0x1180('0x65')][_0x1180('0x3b')]({'plain':!![]});if(!_0x5c674f)throw new Error(_0x1180('0x66'));if(_0x5c674f[_0x1180('0x67')]===_0x1180('0x65')){var _0x5020cc=_0x1503aa[_0x1180('0x3b')]({'plain':!![]});var _0xe51fa=_0x1180('0x3c');return db[_0x1180('0x68')][_0x1180('0x62')]({'where':{'name':_0xe51fa,'userProfileId':_0x5c674f[_0x1180('0x69')]},'raw':!![]})[_0x1180('0x24')](function(_0x5773d7){if(_0x5773d7&&_0x5773d7['autoAssociation']===0x0){return db['UserProfileResource'][_0x1180('0x63')]({'name':_0x5020cc[_0x1180('0x3f')],'resourceId':_0x5020cc['id'],'type':_0x5773d7[_0x1180('0x3f')],'sectionId':_0x5773d7['id']},{})[_0x1180('0x24')](function(){return _0x1503aa;});}else{return _0x1503aa;}})['catch'](function(_0x55d3e1){logger[_0x1180('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55d3e1);throw _0x55d3e1;});}return _0x1503aa;})[_0x1180('0x24')](respondWithResult(_0x28eb8a,0xc9))['catch'](handleError(_0x28eb8a,null));};exports['update']=function(_0x15a453,_0x167917){if(_0x15a453['body']['id']){delete _0x15a453[_0x1180('0x64')]['id'];}return db['OpenchannelAccount'][_0x1180('0x62')]({'where':{'id':_0x15a453[_0x1180('0x5f')]['id']},'include':[{'model':db[_0x1180('0x42')],'as':_0x1180('0x43')}]})[_0x1180('0x24')](handleEntityNotFound(_0x167917,null))[_0x1180('0x24')](saveUpdates(_0x15a453[_0x1180('0x64')],null))[_0x1180('0x24')](respondWithResult(_0x167917,null))[_0x1180('0x2e')](handleError(_0x167917,null));};exports['destroy']=function(_0x191e4d,_0x1c7f52){return db[_0x1180('0x45')][_0x1180('0x62')]({'where':{'id':_0x191e4d['params']['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x1c7f52,null))['then'](removeEntity(_0x1c7f52,null))[_0x1180('0x2e')](handleError(_0x1c7f52,null));};exports[_0x1180('0x6a')]=function(_0x57f0a3,_0x193e5e){return db[_0x1180('0x45')][_0x1180('0x6a')]()[_0x1180('0x24')](respondWithResult(_0x193e5e,null))[_0x1180('0x2e')](handleError(_0x193e5e,null));};exports[_0x1180('0x6b')]=function(_0x239290,_0x369491,_0x131e40){if(_0x239290[_0x1180('0x64')]['id']){delete _0x239290[_0x1180('0x64')]['id'];}return db[_0x1180('0x45')]['find']({'where':{'id':_0x239290['params']['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x369491,null))[_0x1180('0x24')](function(_0xfc58eb){if(_0xfc58eb){_0x239290[_0x1180('0x64')][_0x1180('0x6c')]=_0xfc58eb['id'];return db['Disposition'][_0x1180('0x63')](_0x239290[_0x1180('0x64')]);}})[_0x1180('0x24')](respondWithResult(_0x369491,null))['catch'](handleError(_0x369491,null));};exports[_0x1180('0x6d')]=function(_0xe70cbd,_0x3544a8,_0x43dfc0){var _0x23462b={'raw':![],'where':{}};var _0x39a2cf={};var _0x9a43c7={'count':0x0,'rows':[]};return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0xe70cbd[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x3544a8,null))[_0x1180('0x24')](function(_0x2cbbb7){if(_0x2cbbb7){_0x39a2cf['model']=_['keys'](db['Disposition'][_0x1180('0x60')]);_0x39a2cf[_0x1180('0x49')]=_[_0x1180('0x4a')](_0xe70cbd[_0x1180('0x49')]);_0x39a2cf[_0x1180('0x4b')]=_['intersection'](_0x39a2cf[_0x1180('0x48')],_0x39a2cf['query']);_0x23462b['attributes']=_[_0x1180('0x4c')](_0x39a2cf['model'],qs[_0x1180('0x4e')](_0xe70cbd['query'][_0x1180('0x4e')]));_0x23462b[_0x1180('0x4d')]=_0x23462b[_0x1180('0x4d')][_0x1180('0x4f')]?_0x23462b[_0x1180('0x4d')]:_0x39a2cf['model'];if(!_0xe70cbd[_0x1180('0x49')]['hasOwnProperty'](_0x1180('0x51'))){_0x23462b[_0x1180('0x52')]=qs[_0x1180('0x52')](_0xe70cbd[_0x1180('0x49')][_0x1180('0x52')]);_0x23462b[_0x1180('0x31')]=qs[_0x1180('0x31')](_0xe70cbd[_0x1180('0x49')]['offset']);}_0x23462b[_0x1180('0x53')]=qs[_0x1180('0x54')](_0xe70cbd[_0x1180('0x49')]['sort']);_0x23462b[_0x1180('0x57')]=qs[_0x1180('0x4b')](_[_0x1180('0x55')](_0xe70cbd['query'],_0x39a2cf['filters']));_0x23462b[_0x1180('0x57')][_0x1180('0x6c')]=_0x2cbbb7['id'];if(_0xe70cbd[_0x1180('0x49')][_0x1180('0x56')]){_0x23462b[_0x1180('0x57')]=_[_0x1180('0x58')](_0x23462b[_0x1180('0x57')],{'$or':_[_0x1180('0x44')](_0x23462b[_0x1180('0x4d')],function(_0x42f42c){var _0x2dbb5c={};_0x2dbb5c[_0x42f42c]={'$like':'%'+_0xe70cbd[_0x1180('0x49')][_0x1180('0x56')]+'%'};return _0x2dbb5c;})});}_0x23462b=_['merge']({},_0x23462b,_0xe70cbd[_0x1180('0x5a')]);return db[_0x1180('0x6f')][_0x1180('0x33')]({'where':_0x23462b['where']})[_0x1180('0x24')](function(_0x312c3f){_0x9a43c7[_0x1180('0x33')]=_0x312c3f;if(_0xe70cbd['query']['includeAll']){_0x23462b[_0x1180('0x61')]=[{'all':!![]}];}return db['Disposition'][_0x1180('0x5c')](_0x23462b);})['then'](function(_0x201dbb){_0x9a43c7['rows']=_0x201dbb;return _0x9a43c7;});}})['then'](respondWithFilteredResult(_0x3544a8,_0x23462b))['catch'](handleError(_0x3544a8,null));};exports[_0x1180('0x70')]=function(_0x5cc431,_0x36715a,_0x41e522){return db['OpenchannelAccount'][_0x1180('0x62')]({'where':{'id':_0x5cc431[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x36715a,null))[_0x1180('0x24')](function(_0x3a3a0f){if(_0x3a3a0f){return _0x3a3a0f[_0x1180('0x70')](_0x5cc431[_0x1180('0x49')][_0x1180('0x71')]);}})[_0x1180('0x24')](respondWithStatusCode(_0x36715a,null))[_0x1180('0x2e')](handleError(_0x36715a,null));};exports[_0x1180('0x72')]=function(_0x5d8a88,_0x39d47e,_0x1aad25){if(_0x5d8a88[_0x1180('0x64')]['id']){delete _0x5d8a88['body']['id'];}return db[_0x1180('0x45')][_0x1180('0x62')]({'where':{'id':_0x5d8a88['params']['id']}})['then'](handleEntityNotFound(_0x39d47e,null))[_0x1180('0x24')](function(_0x1fdf71){if(_0x1fdf71){_0x5d8a88[_0x1180('0x64')][_0x1180('0x6c')]=_0x1fdf71['id'];return db['CannedAnswer']['create'](_0x5d8a88[_0x1180('0x64')]);}})['then'](respondWithResult(_0x39d47e,null))[_0x1180('0x2e')](handleError(_0x39d47e,null));};exports[_0x1180('0x73')]=function(_0x2123fb,_0x529273,_0xea3620){var _0x41eaa6={'raw':![],'where':{}};var _0x1c3e56={};var _0x5317c0={'count':0x0,'rows':[]};return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0x2123fb[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x529273,null))[_0x1180('0x24')](function(_0x135667){if(_0x135667){_0x1c3e56[_0x1180('0x48')]=_[_0x1180('0x4a')](db['CannedAnswer']['rawAttributes']);_0x1c3e56[_0x1180('0x49')]=_['keys'](_0x2123fb[_0x1180('0x49')]);_0x1c3e56[_0x1180('0x4b')]=_[_0x1180('0x4c')](_0x1c3e56['model'],_0x1c3e56['query']);_0x41eaa6[_0x1180('0x4d')]=_[_0x1180('0x4c')](_0x1c3e56['model'],qs['fields'](_0x2123fb[_0x1180('0x49')][_0x1180('0x4e')]));_0x41eaa6[_0x1180('0x4d')]=_0x41eaa6[_0x1180('0x4d')]['length']?_0x41eaa6['attributes']:_0x1c3e56[_0x1180('0x48')];if(!_0x2123fb['query'][_0x1180('0x50')]('nolimit')){_0x41eaa6[_0x1180('0x52')]=qs['limit'](_0x2123fb['query'][_0x1180('0x52')]);_0x41eaa6[_0x1180('0x31')]=qs[_0x1180('0x31')](_0x2123fb[_0x1180('0x49')][_0x1180('0x31')]);}_0x41eaa6[_0x1180('0x53')]=qs['sort'](_0x2123fb['query'][_0x1180('0x54')]);_0x41eaa6['where']=qs['filters'](_['pick'](_0x2123fb[_0x1180('0x49')],_0x1c3e56[_0x1180('0x4b')]));_0x41eaa6[_0x1180('0x57')]['OpenchannelAccountId']=_0x135667['id'];if(_0x2123fb['query'][_0x1180('0x56')]){_0x41eaa6[_0x1180('0x57')]=_[_0x1180('0x58')](_0x41eaa6[_0x1180('0x57')],{'$or':_[_0x1180('0x44')](_0x41eaa6[_0x1180('0x4d')],function(_0x42880d){var _0x18831f={};_0x18831f[_0x42880d]={'$like':'%'+_0x2123fb[_0x1180('0x49')][_0x1180('0x56')]+'%'};return _0x18831f;})});}_0x41eaa6=_[_0x1180('0x58')]({},_0x41eaa6,_0x2123fb[_0x1180('0x5a')]);return db[_0x1180('0x74')]['count']({'where':_0x41eaa6[_0x1180('0x57')]})[_0x1180('0x24')](function(_0x2e9d4d){_0x5317c0[_0x1180('0x33')]=_0x2e9d4d;if(_0x2123fb[_0x1180('0x49')][_0x1180('0x5b')]){_0x41eaa6[_0x1180('0x61')]=[{'all':!![]}];}return db[_0x1180('0x74')][_0x1180('0x5c')](_0x41eaa6);})[_0x1180('0x24')](function(_0x298e1b){_0x5317c0[_0x1180('0x5d')]=_0x298e1b;return _0x5317c0;});}})[_0x1180('0x24')](respondWithFilteredResult(_0x529273,_0x41eaa6))['catch'](handleError(_0x529273,null));};exports[_0x1180('0x75')]=function(_0x44b7f6,_0x129e95,_0x40e199){return db[_0x1180('0x45')][_0x1180('0x62')]({'where':{'id':_0x44b7f6[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x129e95,null))[_0x1180('0x24')](function(_0xcab93a){if(_0xcab93a){return _0xcab93a[_0x1180('0x75')](_0x44b7f6[_0x1180('0x49')][_0x1180('0x71')]);}})['then'](respondWithStatusCode(_0x129e95,null))[_0x1180('0x2e')](handleError(_0x129e95,null));};exports['notify']=function(_0x197812,_0x4613c9,_0x52bde5){var _0x643ebe={'body':_0x197812[_0x1180('0x64')],'channel':_0x1180('0x76')};var _0x10a93a=[];var _0x5d4f81=[];var _0x169b96={};var _0x4418c8=![];return db['CmContact'][_0x1180('0x6a')]()[_0x1180('0x24')](function(_0x56c9a2){if(!_0x56c9a2){throw new db[(_0x1180('0x77'))][(_0x1180('0x78'))]('no\x20available\x20attributes');}_0x10a93a=_[_0x1180('0x79')](_[_0x1180('0x4a')](_0x56c9a2),[_0x1180('0x7a'),_0x1180('0x7b')]);_0x5d4f81=_[_0x1180('0x79')](_[_0x1180('0x4a')](_0x56c9a2),[_0x1180('0x7a'),_0x1180('0x7b'),_0x1180('0x7c'),'ListId']);if(_0x197812[_0x1180('0x64')]['id']){delete _0x197812['body']['id'];}if(_[_0x1180('0x7d')](_0x197812[_0x1180('0x64')][_0x1180('0x7e')])){throw new db[(_0x1180('0x77'))][(_0x1180('0x78'))]('from\x20is\x20mandatory');}if(_[_0x1180('0x7d')](_0x197812[_0x1180('0x64')][_0x1180('0x64')])||_0x197812[_0x1180('0x64')][_0x1180('0x64')]===''){throw new db[(_0x1180('0x77'))][(_0x1180('0x78'))](_0x1180('0x7f'));}if(_[_0x1180('0x7d')](_0x197812[_0x1180('0x64')]['mapKey'])){throw new db[(_0x1180('0x77'))][(_0x1180('0x78'))](_0x1180('0x80')+_0x5d4f81);}if(!_[_0x1180('0x81')](_0x5d4f81,_0x197812[_0x1180('0x64')][_0x1180('0x82')])){throw new db[(_0x1180('0x77'))]['ValidationError'](_0x1180('0x83')+_0x5d4f81);}_0x169b96[_0x197812[_0x1180('0x64')][_0x1180('0x82')]]=_0x197812[_0x1180('0x64')][_0x1180('0x7e')];})[_0x1180('0x24')](function(){return db[_0x1180('0x45')][_0x1180('0x62')]({'where':{'id':_0x197812[_0x1180('0x5f')]['id']},'include':[{'model':db[_0x1180('0x84')],'as':'List','include':[{'model':db[_0x1180('0x85')],'as':_0x1180('0x86'),'where':_0x169b96,'limit':0x1,'order':[[_0x1180('0x7b'),_0x1180('0x87')]]}]},{'model':db[_0x1180('0x88')],'as':'Applications'}]});})[_0x1180('0x24')](handleEntityNotFound(_0x4613c9,null))['then'](function(_0xca57a7){if(_0xca57a7&&_0xca57a7[_0x1180('0x89')]){_0x643ebe[_0x1180('0x8a')]=_0xca57a7;_0x643ebe[_0x1180('0x8b')]=_0xca57a7['Applications'];_0x643ebe['list']=_0xca57a7[_0x1180('0x89')];_0x643ebe[_0x1180('0x8b')]=_[_0x1180('0x8c')](_0x643ebe[_0x1180('0x8b')],[_0x1180('0x8d')],[_0x1180('0x8e')]);if(_0x643ebe['account']['Applications']){delete _0x643ebe[_0x1180('0x8a')][_0x1180('0x8f')];}if(_0x643ebe[_0x1180('0x8a')]['List']&&_0x643ebe[_0x1180('0x8a')][_0x1180('0x89')][_0x1180('0x86')][_0x1180('0x4f')]){return _0x643ebe[_0x1180('0x8a')]['List']['Contacts'][0x0];}var _0x3cdb1a=_[_0x1180('0x1b')](_0x197812[_0x1180('0x64')],{'firstName':_0x197812[_0x1180('0x64')][_0x1180('0x7e')],'ListId':_0xca57a7[_0x1180('0x90')]});_0x3cdb1a[_0x197812[_0x1180('0x64')][_0x1180('0x82')]]=_0x197812[_0x1180('0x64')][_0x1180('0x7e')];return db['CmContact']['create'](_0x3cdb1a,{'fields':_0x10a93a,'raw':!![]});}})[_0x1180('0x24')](handleEntityNotFound(_0x4613c9,null))[_0x1180('0x24')](function(_0xdd020d){_0x643ebe[_0x1180('0x91')]=_0xdd020d;if(_0xdd020d){var _0x529b31={'ContactId':_0xdd020d['id'],'OpenchannelAccountId':_0x197812[_0x1180('0x5f')]['id'],'from':(_0xdd020d['firstName']||'')+'\x20'+(_0xdd020d[_0x1180('0x92')]||'')};var _0x447d86={'OpenchannelAccountId':_0x197812[_0x1180('0x5f')]['id'],'closed':![]};if(_0x197812[_0x1180('0x64')]['threadId']){_0x447d86['threadId']=_0x197812['body'][_0x1180('0x93')];return db[_0x1180('0x94')][_0x1180('0x62')]({'where':_0x447d86})[_0x1180('0x24')](function(_0x101bc6){if(_0x101bc6){return[_0x101bc6,![]];}_0x529b31['threadId']=_0x197812['body'][_0x1180('0x93')];_0x529b31[_0x1180('0x95')]=_0x197812[_0x1180('0x64')][_0x1180('0x95')];return db['OpenchannelInteraction'][_0x1180('0x63')](_0x529b31)[_0x1180('0x24')](function(_0x30258b){return[_0x30258b,!![]];});});}else{_0x447d86[_0x1180('0x93')]=null;}_0x447d86['ContactId']=_0xdd020d['id'];return db[_0x1180('0x94')]['find']({'where':_0x447d86})['then'](function(_0x3caa20){if(_0x3caa20){return[_0x3caa20,![]];}return db[_0x1180('0x94')][_0x1180('0x63')](_0x529b31)[_0x1180('0x24')](function(_0x3d18d4){return[_0x3d18d4,!![]];});});}})[_0x1180('0x96')](function(_0xc7581a,_0x4ecf5b){if(_0xc7581a){_0x4418c8=_0x4ecf5b;if(!_0x4ecf5b){var _0x382ff7={'from':(_0x643ebe[_0x1180('0x91')][_0x1180('0x97')]||'')+'\x20'+(_0x643ebe[_0x1180('0x91')][_0x1180('0x92')]||'')};if(_0x197812[_0x1180('0x64')][_0x1180('0x93')]&&_0x197812[_0x1180('0x64')]['messageId']&&_0x197812['body'][_0x1180('0x93')]!=_0x197812[_0x1180('0x64')][_0x1180('0x98')]){_0x382ff7[_0x1180('0x93')]=_0x197812[_0x1180('0x64')]['messageId'];}return _0xc7581a[_0x1180('0x39')](_0x382ff7);}else{return _0xc7581a;}}})[_0x1180('0x24')](function(_0x2ce442){_0x643ebe[_0x1180('0x99')]=_0x2ce442[_0x1180('0x3b')]({'plain':!![]});_0x643ebe[_0x1180('0x99')][_0x1180('0x9a')]=_0x4418c8;if(_0x643ebe['interaction']['created']){if(_0x643ebe['account'][_0x1180('0x9b')]){_0x643ebe[_0x1180('0x8b')][_0x1180('0x9c')]({'id':0x0,'priority':_0x643ebe[_0x1180('0x8b')]['length']+0x1,'app':_0x1180('0x9d'),'appdata':_0x1180('0x9e'),'interval':_0x1180('0x9f')});}}return db['OpenchannelMessage'][_0x1180('0x63')]({'body':_0x197812['body'][_0x1180('0x64')],'OpenchannelAccountId':_0x197812[_0x1180('0x5f')]['id'],'OpenchannelInteractionId':_0x2ce442['id'],'direction':'in','ContactId':_0x643ebe[_0x1180('0x91')]['id'],'AttachmentId':_0x197812[_0x1180('0x64')][_0x1180('0xa0')]});})[_0x1180('0x24')](function(_0x514dfa){_0x643ebe['message']=_0x514dfa;if(_0x643ebe[_0x1180('0x99')][_0x1180('0xa1')]){return db[_0x1180('0xa2')][_0x1180('0x62')]({'attributes':['id',_0x1180('0x3f')],'where':{'id':_0x643ebe[_0x1180('0x99')]['UserId']}})['then'](function(_0x353125){if(_0x353125){_0x643ebe[_0x1180('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1180('0xa3'),'appdata':_0x353125[_0x1180('0x3f')]+','+(_0x643ebe[_0x1180('0x8a')][_0x1180('0xa4')]||0xa),'interval':_0x1180('0x9f')});_0x643ebe['forcedOwnership']=![];}return respondWithRpcPromise(_0x1180('0xa5'),_0x1180('0xa6'),_0x643ebe);});}return respondWithRpcPromise(_0x1180('0xa5'),'startRouting',_0x643ebe);})[_0x1180('0x24')](function(_0x5b4e1c){respondWithRpcPromise(_0x1180('0xa7'),_0x1180('0xa7'),{'event':'notify','message':_0x5b4e1c},client9002);return _0x5b4e1c;})['then'](respondWithResult(_0x4613c9,null))['catch'](handleError(_0x4613c9,null));};exports[_0x1180('0xa8')]=function(_0x478d44,_0x33346b){var _0x4ffb1e=_0x478d44[_0x1180('0x5f')]['id'];var _0x9861=_0x478d44[_0x1180('0x64')];var _0x31bdd8=0xc8;var _0x4eabc2=null;return db[_0x1180('0xa9')][_0x1180('0xaa')]({'isolationLevel':db[_0x1180('0xa9')]['Transaction']['ISOLATION_LEVELS'][_0x1180('0xab')]},function(_0x1fe7a0){return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0x4ffb1e},'transaction':_0x1fe7a0})['then'](function(_0x133402){if(_0x133402){return db[_0x1180('0x88')][_0x1180('0x3a')]({'where':{'OpenchannelAccountId':_0x4ffb1e},'transaction':_0x1fe7a0})[_0x1180('0x24')](function(){var _0x38c273=_[_0x1180('0x44')](_0x9861,function(_0x3a3e40){_0x3a3e40['OpenchannelAccountId']=_0x4ffb1e;return _0x3a3e40;});return db['OpenchannelApplication'][_0x1180('0xac')](_0x38c273,{'transaction':_0x1fe7a0});});}else{_0x31bdd8=0x194;_0x4eabc2=[];}});})[_0x1180('0x24')](function(){if(_0x31bdd8!==0x194){return db['OpenchannelApplication'][_0x1180('0xad')]({'where':{'OpenchannelAccountId':_0x4ffb1e},'order':'priority'})['then'](function(_0x2ed9f6){_0x4eabc2=_0x2ed9f6;});}})[_0x1180('0x2e')](function(_0x789147){_0x31bdd8=0x1f4;logger['error'](_0x789147[_0x1180('0x3e')]);if(_0x789147[_0x1180('0x3f')]){delete _0x789147[_0x1180('0x3f')];}_0x4eabc2=_0x789147;})[_0x1180('0xae')](function(){if(_0x4eabc2===null){_0x33346b[_0x1180('0x2f')](_0x31bdd8);}else{if(_0x31bdd8===0x1f4){_0x33346b[_0x1180('0x30')](_0x31bdd8)[_0x1180('0x40')](_0x4eabc2);}else{_0x33346b[_0x1180('0x30')](_0x31bdd8)[_0x1180('0x36')](_0x4eabc2);}}});};exports[_0x1180('0xaf')]=function(_0x1be9cb,_0x37c116,_0x29b956){var _0x602969={};var _0x359a61={};var _0x1055a2;var _0x478387;return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0x1be9cb[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x37c116,null))['then'](function(_0x42a2e7){if(_0x42a2e7){_0x1055a2=_0x42a2e7;_0x359a61[_0x1180('0x48')]=_['keys'](db[_0x1180('0x88')][_0x1180('0x60')]);_0x359a61[_0x1180('0x49')]=_[_0x1180('0x4a')](_0x1be9cb['query']);_0x359a61[_0x1180('0x4b')]=_[_0x1180('0x4c')](_0x359a61[_0x1180('0x48')],_0x359a61['query']);_0x602969[_0x1180('0x4d')]=_['intersection'](_0x359a61[_0x1180('0x48')],qs['fields'](_0x1be9cb[_0x1180('0x49')][_0x1180('0x4e')]));_0x602969[_0x1180('0x4d')]=_0x602969[_0x1180('0x4d')][_0x1180('0x4f')]?_0x602969[_0x1180('0x4d')]:_0x359a61[_0x1180('0x48')];_0x602969[_0x1180('0x53')]=qs[_0x1180('0x54')](_0x1be9cb[_0x1180('0x49')][_0x1180('0x54')]);_0x602969[_0x1180('0x57')]=qs[_0x1180('0x4b')](_['pick'](_0x1be9cb[_0x1180('0x49')],_0x359a61[_0x1180('0x4b')]));if(_0x1be9cb['query'][_0x1180('0x56')]){_0x602969[_0x1180('0x57')]=_[_0x1180('0x58')](_0x602969[_0x1180('0x57')],{'$or':_[_0x1180('0x44')](_0x602969[_0x1180('0x4d')],function(_0x37b39f){var _0x583015={};_0x583015[_0x37b39f]={'$like':'%'+_0x1be9cb['query']['filter']+'%'};return _0x583015;})});}_0x602969=_[_0x1180('0x58')]({},_0x602969,_0x1be9cb[_0x1180('0x5a')]);return _0x1055a2[_0x1180('0xaf')](_0x602969);}})[_0x1180('0x24')](function(_0x71bb2c){if(_0x71bb2c){_0x478387=_0x71bb2c[_0x1180('0x4f')];if(!_0x1be9cb['query'][_0x1180('0x50')](_0x1180('0x51'))){_0x602969['limit']=qs[_0x1180('0x52')](_0x1be9cb[_0x1180('0x49')][_0x1180('0x52')]);_0x602969[_0x1180('0x31')]=qs[_0x1180('0x31')](_0x1be9cb['query'][_0x1180('0x31')]);}return _0x1055a2[_0x1180('0xaf')](_0x602969);}})[_0x1180('0x24')](function(_0x55c62c){if(_0x55c62c){return _0x55c62c?{'count':_0x478387,'rows':_0x55c62c}:null;}})['then'](respondWithResult(_0x37c116,null))['catch'](handleError(_0x37c116,null));};exports[_0x1180('0xb0')]=function(_0x5f2e66,_0x55940d,_0x5e4452){var _0x1aed7f={'raw':![],'where':{}};var _0x16b26b={};var _0x3ef022={'count':0x0,'rows':[]};return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0x5f2e66[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x55940d,null))['then'](function(_0x13561a){if(_0x13561a){_0x16b26b[_0x1180('0x48')]=_[_0x1180('0x4a')](db['OpenchannelInteraction']['rawAttributes']);_0x16b26b['query']=_[_0x1180('0x4a')](_0x5f2e66[_0x1180('0x49')]);_0x16b26b[_0x1180('0x4b')]=_[_0x1180('0x4c')](_0x16b26b['model'],_0x16b26b['query']);_0x1aed7f[_0x1180('0x4d')]=_[_0x1180('0x4c')](_0x16b26b['model'],qs['fields'](_0x5f2e66['query']['fields']));_0x1aed7f['attributes']=_0x1aed7f[_0x1180('0x4d')][_0x1180('0x4f')]?_0x1aed7f[_0x1180('0x4d')]:_0x16b26b[_0x1180('0x48')];if(!_0x5f2e66['query'][_0x1180('0x50')](_0x1180('0x51'))){_0x1aed7f[_0x1180('0x52')]=qs['limit'](_0x5f2e66[_0x1180('0x49')][_0x1180('0x52')]);_0x1aed7f[_0x1180('0x31')]=qs[_0x1180('0x31')](_0x5f2e66['query'][_0x1180('0x31')]);}_0x1aed7f['order']=qs[_0x1180('0x54')](_0x5f2e66[_0x1180('0x49')]['sort']);_0x1aed7f[_0x1180('0x57')]=qs[_0x1180('0x4b')](_[_0x1180('0x55')](_0x5f2e66[_0x1180('0x49')],_0x16b26b[_0x1180('0x4b')]));_0x1aed7f[_0x1180('0x57')]['OpenchannelAccountId']=_0x13561a['id'];if(_0x5f2e66[_0x1180('0x49')][_0x1180('0x56')]){_0x1aed7f[_0x1180('0x57')]=_[_0x1180('0x58')](_0x1aed7f[_0x1180('0x57')],{'$or':_[_0x1180('0x44')](_0x1aed7f[_0x1180('0x4d')],function(_0x372c83){var _0xe94a1b={};_0xe94a1b[_0x372c83]={'$like':'%'+_0x5f2e66[_0x1180('0x49')][_0x1180('0x56')]+'%'};return _0xe94a1b;})});}_0x1aed7f=_[_0x1180('0x58')]({},_0x1aed7f,_0x5f2e66[_0x1180('0x5a')]);return db['OpenchannelInteraction'][_0x1180('0x33')]({'where':_0x1aed7f['where']})[_0x1180('0x24')](function(_0x1ed35a){_0x3ef022[_0x1180('0x33')]=_0x1ed35a;if(_0x5f2e66[_0x1180('0x49')][_0x1180('0x5b')]){_0x1aed7f['include']=[{'model':db[_0x1180('0x85')],'as':_0x1180('0xb1'),'required':![]},{'model':db[_0x1180('0xa2')],'as':_0x1180('0xb2'),'attributes':[_0x1180('0x3f'),_0x1180('0xb3'),_0x1180('0xb4')],'required':![]},{'model':db['Tag'],'as':_0x1180('0xb5'),'attributes':['id',_0x1180('0x3f'),_0x1180('0xb6')],'where':_0x5f2e66[_0x1180('0x49')][_0x1180('0xb7')]?{'id':_0x5f2e66[_0x1180('0x49')][_0x1180('0xb7')]}:undefined,'required':_0x5f2e66[_0x1180('0x49')][_0x1180('0xb7')]?!![]:![]}];}return db[_0x1180('0x94')][_0x1180('0x5c')](_0x1aed7f);})[_0x1180('0x24')](function(_0x29b25a){_0x3ef022[_0x1180('0x5d')]=_0x29b25a;return _0x3ef022;});}})[_0x1180('0x24')](respondWithFilteredResult(_0x55940d,_0x1aed7f))[_0x1180('0x2e')](handleError(_0x55940d,null));};exports[_0x1180('0xb8')]=function(_0x500537,_0x1ef91b,_0x536ae9){return db[_0x1180('0x45')][_0x1180('0x62')]({'where':{'id':_0x500537[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x1ef91b,null))['then'](function(_0x49c6f8){if(_0x49c6f8){return _0x49c6f8[_0x1180('0xb8')](_0x500537[_0x1180('0x64')]['ids'],_[_0x1180('0xb9')](_0x500537[_0x1180('0x64')],['ids','id'])||{})[_0x1180('0x96')](function(_0x77a843){for(var _0x83dd04=0x0;_0x83dd04<_0x500537[_0x1180('0x64')][_0x1180('0x71')][_0x1180('0x4f')];_0x83dd04+=0x1){socket[_0x1180('0xba')]('userOpenchannelAccount:save',{'UserId':Number(_0x500537[_0x1180('0x64')][_0x1180('0x71')][_0x83dd04]),'OpenchannelAccountId':Number(_0x500537['params']['id'])});}return _0x77a843;});}})['then'](respondWithResult(_0x1ef91b,null))[_0x1180('0x2e')](handleError(_0x1ef91b,null));};exports[_0x1180('0xbb')]=function(_0xa064b9,_0x57cdc2,_0x4315cd){return db[_0x1180('0x45')]['find']({'where':{'id':_0xa064b9[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x57cdc2,null))[_0x1180('0x24')](function(_0x107b16){if(_0x107b16){return _0x107b16[_0x1180('0xbb')](_0xa064b9[_0x1180('0x49')][_0x1180('0x71')])[_0x1180('0x24')](function(){if(_[_0x1180('0xbc')](_0xa064b9[_0x1180('0x49')][_0x1180('0x71')])){for(var _0x37fada=0x0;_0x37fada<_0xa064b9[_0x1180('0x49')][_0x1180('0x71')][_0x1180('0x4f')];_0x37fada+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xa064b9[_0x1180('0x49')][_0x1180('0x71')][_0x37fada]),'OpenchannelAccountId':Number(_0xa064b9[_0x1180('0x5f')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xa064b9[_0x1180('0x49')][_0x1180('0x71')]),'OpenchannelAccountId':Number(_0xa064b9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x57cdc2,null))[_0x1180('0x2e')](handleError(_0x57cdc2,null));};exports['getAgents']=function(_0x41b4b2,_0xee1d86,_0x24027d){var _0x3d2247={};var _0x460cee={};var _0xf9cb6c;var _0x22b96c;return db[_0x1180('0x45')]['findOne']({'where':{'id':_0x41b4b2[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0xee1d86,null))[_0x1180('0x24')](function(_0x267466){if(_0x267466){_0xf9cb6c=_0x267466;_0x460cee[_0x1180('0x48')]=_[_0x1180('0x4a')](db[_0x1180('0xa2')]['rawAttributes']);_0x460cee[_0x1180('0x49')]=_[_0x1180('0x4a')](_0x41b4b2[_0x1180('0x49')]);_0x460cee[_0x1180('0x4b')]=_['intersection'](_0x460cee['model'],_0x460cee[_0x1180('0x49')]);_0x3d2247[_0x1180('0x4d')]=_[_0x1180('0x4c')](_0x460cee[_0x1180('0x48')],qs[_0x1180('0x4e')](_0x41b4b2[_0x1180('0x49')][_0x1180('0x4e')]));_0x3d2247['attributes']=_0x3d2247[_0x1180('0x4d')][_0x1180('0x4f')]?_0x3d2247['attributes']:_0x460cee[_0x1180('0x48')];_0x3d2247[_0x1180('0x53')]=qs[_0x1180('0x54')](_0x41b4b2[_0x1180('0x49')][_0x1180('0x54')]);_0x3d2247[_0x1180('0x57')]=qs[_0x1180('0x4b')](_['pick'](_0x41b4b2[_0x1180('0x49')],_0x460cee['filters']));if(_0x41b4b2['query'][_0x1180('0x56')]){_0x3d2247[_0x1180('0x57')]=_[_0x1180('0x58')](_0x3d2247[_0x1180('0x57')],{'$or':_[_0x1180('0x44')](_0x3d2247[_0x1180('0x4d')],function(_0x59c9e0){var _0x4dcb5d={};_0x4dcb5d[_0x59c9e0]={'$like':'%'+_0x41b4b2[_0x1180('0x49')][_0x1180('0x56')]+'%'};return _0x4dcb5d;})});}_0x3d2247=_[_0x1180('0x58')]({},_0x3d2247,_0x41b4b2[_0x1180('0x5a')]);return _0xf9cb6c[_0x1180('0xbd')](_0x3d2247);}})[_0x1180('0x24')](function(_0x53cb57){if(_0x53cb57){_0x22b96c=_0x53cb57[_0x1180('0x4f')];if(!_0x41b4b2[_0x1180('0x49')]['hasOwnProperty'](_0x1180('0x51'))){_0x3d2247[_0x1180('0x52')]=qs['limit'](_0x41b4b2['query'][_0x1180('0x52')]);_0x3d2247[_0x1180('0x31')]=qs[_0x1180('0x31')](_0x41b4b2[_0x1180('0x49')][_0x1180('0x31')]);}return _0xf9cb6c['getAgents'](_0x3d2247);}})[_0x1180('0x24')](function(_0x30f83a){if(_0x30f83a){return _0x30f83a?{'count':_0x22b96c,'rows':_0x30f83a}:null;}})[_0x1180('0x24')](respondWithResult(_0xee1d86,null))[_0x1180('0x2e')](handleError(_0xee1d86,null));};exports['send']=function(_0x4c9a52,_0x4b213a,_0x3b3300){var _0x143878,_0x4e205b,_0x21bfef;if(_['isNil'](_0x4c9a52[_0x1180('0x64')][_0x1180('0x64')])||_0x4c9a52[_0x1180('0x64')][_0x1180('0x64')]===''){throw new db['Sequelize'][(_0x1180('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4c9a52[_0x1180('0x64')]['to'])){}_0x143878=_0x4c9a52['body']['to'];return db[_0x1180('0x45')][_0x1180('0x6e')]({'where':{'id':_0x4c9a52[_0x1180('0x5f')]['id']}})[_0x1180('0x24')](handleEntityNotFound(_0x4b213a,null))[_0x1180('0x24')](function(_0x4e1948){if(_0x4e1948){return db['OpenchannelAccount'][_0x1180('0x62')]({'where':{'id':_0x4e1948['id']},'include':[{'model':db[_0x1180('0x84')],'as':_0x1180('0x89'),'include':[{'model':db['CmContact'],'as':_0x1180('0x86'),'where':{[_0x4e1948['mapKey']]:_0x143878},'limit':0x1,'order':[['updatedAt',_0x1180('0x87')]]}]}]})['then'](handleEntityNotFound(_0x4b213a,null))[_0x1180('0x24')](function(_0x2f4588){if(_0x2f4588&&_0x2f4588[_0x1180('0x89')]){_0x4e205b=_0x2f4588[_0x1180('0x3b')]({'plain':!![]});if(_0x4e205b['List']&&_0x4e205b[_0x1180('0x89')][_0x1180('0x86')][_0x1180('0x4f')]){return _0x4e205b[_0x1180('0x89')][_0x1180('0x86')][0x0];}return db[_0x1180('0x85')][_0x1180('0x63')](_[_0x1180('0x1b')](_0x4c9a52['body'],{'firstName':_0x143878,[_0x2f4588[_0x1180('0x82')]]:_0x143878,'phone':_0x143878,'ListId':_0x4e205b[_0x1180('0x90')]}));}})[_0x1180('0x24')](handleEntityNotFound(_0x4b213a,null))[_0x1180('0x24')](function(_0x122b23){if(_0x122b23){_0x21bfef=_0x122b23;return db[_0x1180('0x94')][_0x1180('0x62')]({'where':{'ContactId':_0x21bfef['id'],'closed':![],'OpenchannelAccountId':_0x4e205b['id']}})[_0x1180('0x24')](function(_0x2031e9){if(_0x2031e9){return[_0x2031e9,![]];}return db[_0x1180('0x94')][_0x1180('0x63')]({'UserId':_0x4c9a52[_0x1180('0x65')]['id'],'ContactId':_0x21bfef['id'],'OpenchannelAccountId':_0x4e205b['id'],'lastMsgDirection':'out','firstMsgDirection':_0x1180('0xbe'),'Messages':[_[_0x1180('0x58')](_0x4c9a52[_0x1180('0x64')],{'read':![],'body':_0x4c9a52['body'][_0x1180('0x64')],'OpenchannelAccountId':_0x4e205b['id'],'UserId':_0x4c9a52[_0x1180('0x65')]['id'],'ContactId':_0x21bfef['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x1180('0xbf')}]})[_0x1180('0x24')](function(_0x2711f4){return[_0x2711f4,!![]];});});}})[_0x1180('0x96')](function(_0x1871be,_0xebfdbd){if(_0xebfdbd){return _0x1871be;}return db[_0x1180('0xc0')]['create'](_[_0x1180('0x58')](_0x4c9a52[_0x1180('0x64')],{'read':![],'body':_0x4c9a52['body']['body'],'OpenchannelAccountId':_0x4e205b['id'],'OpenchannelInteractionId':_0x1871be['id'],'UserId':_0x4c9a52[_0x1180('0x65')]['id'],'ContactId':_0x21bfef['id']}))['then'](function(_0x53beba){_0x1871be[_0x1180('0xc1')][_0x1180('0xbf')]=[];_0x1871be[_0x1180('0xc1')][_0x1180('0xbf')][_0x1180('0x9c')](_0x53beba[_0x1180('0xc1')]);return _0x1871be;});});}})[_0x1180('0x24')](respondWithResult(_0x4b213a,null))[_0x1180('0x2e')](handleError(_0x4b213a,null));}; \ No newline at end of file +var _0x3ee5=['account','list','applications','ListId','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','firstName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','OpenchannelApplication','findAndCountAll','priority','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','limit','Content-Range','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','rows','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','ids','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','updatedAt','DESC','Applications'];(function(_0x45043b,_0x5b7b19){var _0x3887eb=function(_0x5d4885){while(--_0x5d4885){_0x45043b['push'](_0x45043b['shift']());}};_0x3887eb(++_0x5b7b19);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x2897ae,_0xa26ef){_0x2897ae=_0x2897ae-0x0;var _0x87697=_0x3ee5[_0x2897ae];return _0x87697;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53ee('0x0'));var zipdir=require(_0x53ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53ee('0x2'));var moment=require(_0x53ee('0x3'));var BPromise=require(_0x53ee('0x4'));var Mustache=require(_0x53ee('0x5'));var util=require(_0x53ee('0x6'));var path=require(_0x53ee('0x7'));var sox=require(_0x53ee('0x8'));var csv=require(_0x53ee('0x9'));var ejs=require(_0x53ee('0xa'));var fs=require('fs');var fs_extra=require(_0x53ee('0xb'));var _=require(_0x53ee('0xc'));var squel=require('squel');var crypto=require(_0x53ee('0xd'));var jsforce=require(_0x53ee('0xe'));var deskjs=require(_0x53ee('0xf'));var toCsv=require(_0x53ee('0x9'));var querystring=require(_0x53ee('0x10'));var Papa=require(_0x53ee('0x11'));var Redis=require(_0x53ee('0x12'));var authService=require(_0x53ee('0x13'));var qs=require(_0x53ee('0x14'));var as=require(_0x53ee('0x15'));var hardwareService=require(_0x53ee('0x16'));var logger=require(_0x53ee('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x53ee('0x18'));var licenseUtil=require(_0x53ee('0x19'));var db=require(_0x53ee('0x1a'))['db'];config[_0x53ee('0x1b')]=_[_0x53ee('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x53ee('0x1d'))(new Redis(config[_0x53ee('0x1b')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x53ee('0x1e'));var client=jayson[_0x53ee('0x1f')][_0x53ee('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x53ee('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3de016,_0x34545b,_0x15a1a5,_0x10a622){return new BPromise(function(_0x2fb3cd,_0x486ede){var _0x13a622=_0x10a622||client;return _0x13a622[_0x53ee('0x21')](_0x3de016,_0x15a1a5)[_0x53ee('0x22')](function(_0x17c3cb){logger[_0x53ee('0x23')](_0x53ee('0x24'),_0x34545b,_0x53ee('0x25'));logger[_0x53ee('0x26')](_0x53ee('0x27'),_0x34545b,_0x53ee('0x25'),JSON[_0x53ee('0x28')](_0x17c3cb));if(_0x17c3cb[_0x53ee('0x29')]){if(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2a')]===0x1f4){logger['error'](_0x53ee('0x24'),_0x34545b,_0x17c3cb['error']['message']);return _0x486ede(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);}logger[_0x53ee('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x34545b,_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);return _0x2fb3cd(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);}else{logger[_0x53ee('0x23')](_0x53ee('0x24'),_0x34545b,'request\x20sent');_0x2fb3cd(_0x17c3cb['result'][_0x53ee('0x2b')]);}})[_0x53ee('0x2c')](function(_0x2274cf){logger[_0x53ee('0x29')](_0x53ee('0x24'),_0x34545b,_0x2274cf);_0x486ede(_0x2274cf);});});}function respondWithStatusCode(_0x55522c,_0x2b49f9){_0x2b49f9=_0x2b49f9||0xcc;return function(_0x5f3206){if(_0x5f3206){return _0x55522c[_0x53ee('0x2d')](_0x2b49f9);}return _0x55522c['status'](_0x2b49f9)[_0x53ee('0x2e')]();};}function respondWithResult(_0x446f12,_0x11d4fa){_0x11d4fa=_0x11d4fa||0xc8;return function(_0x36ab7c){if(_0x36ab7c){return _0x446f12[_0x53ee('0x2f')](_0x11d4fa)[_0x53ee('0x30')](_0x36ab7c);}};}function respondWithFilteredResult(_0x16062c,_0x3b9ae7){return function(_0x3e92a0){if(_0x3e92a0){var _0x189ef9=typeof _0x3b9ae7[_0x53ee('0x31')]==='undefined'&&typeof _0x3b9ae7[_0x53ee('0x32')]==='undefined';var _0x3ea35e=_0x3e92a0['count'];var _0x92c662=_0x189ef9?0x0:_0x3b9ae7[_0x53ee('0x31')];var _0x2a9e25=_0x189ef9?_0x3e92a0['count']:_0x3b9ae7['offset']+_0x3b9ae7[_0x53ee('0x32')];var _0x156f59;if(_0x2a9e25>=_0x3ea35e){_0x2a9e25=_0x3ea35e;_0x156f59=0xc8;}else{_0x156f59=0xce;}_0x16062c[_0x53ee('0x2f')](_0x156f59);return _0x16062c['set'](_0x53ee('0x33'),_0x92c662+'-'+_0x2a9e25+'/'+_0x3ea35e)['json'](_0x3e92a0);}return null;};}function patchUpdates(_0x4453bb){return function(_0x206f72){try{jsonpatch['apply'](_0x206f72,_0x4453bb,!![]);}catch(_0xd3ed27){return BPromise['reject'](_0xd3ed27);}return _0x206f72[_0x53ee('0x34')]();};}function saveUpdates(_0x95dfce,_0xbaecc0){return function(_0x21e5ca){if(_0x21e5ca){return _0x21e5ca[_0x53ee('0x35')](_0x95dfce)[_0x53ee('0x22')](function(_0x2323eb){return _0x2323eb;});}return null;};}function removeEntity(_0x2138de,_0x411d1f){return function(_0x4770c8){if(_0x4770c8){return _0x4770c8[_0x53ee('0x36')]()[_0x53ee('0x22')](function(){var _0xa83513=_0x4770c8[_0x53ee('0x37')]({'plain':!![]});var _0x3f8821=_0x53ee('0x38');return db[_0x53ee('0x39')][_0x53ee('0x36')]({'where':{'type':_0x3f8821,'resourceId':_0xa83513['id']}})['then'](function(){return _0x4770c8;});})[_0x53ee('0x22')](function(){_0x2138de[_0x53ee('0x2f')](0xcc)[_0x53ee('0x2e')]();});}};}function handleEntityNotFound(_0x501595,_0x58584f){return function(_0x1445d2){if(!_0x1445d2){_0x501595[_0x53ee('0x2d')](0x194);}return _0x1445d2;};}function handleError(_0xd8e631,_0x5bb6f2){_0x5bb6f2=_0x5bb6f2||0x1f4;return function(_0x22b913){logger[_0x53ee('0x29')](_0x22b913[_0x53ee('0x3a')]);if(_0x22b913[_0x53ee('0x3b')]){delete _0x22b913['name'];}_0xd8e631[_0x53ee('0x2f')](_0x5bb6f2)['send'](_0x22b913);};}exports[_0x53ee('0x3c')]=function(_0x477cbf,_0x394fc9){var _0x5ee378={'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]},_0x29af8d={},_0x42e0e4={'count':0x0,'rows':[]};var _0x4bf3b3=_[_0x53ee('0x3f')](db[_0x53ee('0x40')][_0x53ee('0x41')],function(_0x2eda26){return{'name':_0x2eda26[_0x53ee('0x42')],'type':_0x2eda26[_0x53ee('0x43')]['key']};});_0x29af8d['model']=_[_0x53ee('0x3f')](_0x4bf3b3,_0x53ee('0x3b'));_0x29af8d[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x477cbf[_0x53ee('0x44')]);_0x29af8d[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x29af8d[_0x53ee('0x48')],_0x29af8d[_0x53ee('0x44')]);_0x5ee378['attributes']=_[_0x53ee('0x47')](_0x29af8d['model'],qs[_0x53ee('0x49')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x49')]));_0x5ee378['attributes']=_0x5ee378[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x5ee378['attributes']:_0x29af8d[_0x53ee('0x48')];if(!_0x477cbf[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x5ee378[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x32')]);_0x5ee378[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x5ee378[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x477cbf['query'][_0x53ee('0x4f')]);_0x5ee378[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x477cbf['query'],_0x29af8d[_0x53ee('0x46')]),_0x4bf3b3);if(_0x477cbf[_0x53ee('0x44')][_0x53ee('0x52')]){_0x5ee378[_0x53ee('0x50')]=_['merge'](_0x5ee378[_0x53ee('0x50')],{'$or':_['map'](_0x4bf3b3,function(_0x55e839){if(_0x55e839[_0x53ee('0x43')]!==_0x53ee('0x53')){var _0x3de4bb={};_0x3de4bb[_0x55e839[_0x53ee('0x3b')]]={'$like':'%'+_0x477cbf[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3de4bb;}})});}_0x5ee378=_[_0x53ee('0x54')]({},_0x5ee378,_0x477cbf['options']);var _0x5da011={'where':_0x5ee378[_0x53ee('0x50')]};return db[_0x53ee('0x40')][_0x53ee('0x55')](_0x5da011)[_0x53ee('0x22')](function(_0x4ddfec){_0x42e0e4[_0x53ee('0x55')]=_0x4ddfec;if(_0x477cbf[_0x53ee('0x44')][_0x53ee('0x56')]){_0x5ee378[_0x53ee('0x57')]=[{'all':!![]}];}return db[_0x53ee('0x40')][_0x53ee('0x58')](_0x5ee378);})['then'](function(_0x29ecdf){_0x42e0e4['rows']=_0x29ecdf;return _0x42e0e4;})['then'](respondWithFilteredResult(_0x394fc9,_0x5ee378))[_0x53ee('0x2c')](handleError(_0x394fc9,null));};exports[_0x53ee('0x59')]=function(_0x57f7e4,_0x131b85){var _0xccc92d={'raw':![],'where':{'id':_0x57f7e4[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]},_0xda2c9c={};_0xda2c9c[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x40')][_0x53ee('0x41')]);_0xda2c9c['query']=_[_0x53ee('0x45')](_0x57f7e4[_0x53ee('0x44')]);_0xda2c9c['filters']=_[_0x53ee('0x47')](_0xda2c9c['model'],_0xda2c9c[_0x53ee('0x44')]);_0xccc92d[_0x53ee('0x4a')]=_['intersection'](_0xda2c9c['model'],qs[_0x53ee('0x49')](_0x57f7e4[_0x53ee('0x44')]['fields']));_0xccc92d[_0x53ee('0x4a')]=_0xccc92d[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0xccc92d[_0x53ee('0x4a')]:_0xda2c9c[_0x53ee('0x48')];if(_0x57f7e4[_0x53ee('0x44')][_0x53ee('0x56')]){_0xccc92d[_0x53ee('0x57')]=[{'all':!![]}];}_0xccc92d=_['merge']({},_0xccc92d,_0x57f7e4[_0x53ee('0x5b')]);return db['OpenchannelAccount'][_0x53ee('0x5c')](_0xccc92d)[_0x53ee('0x22')](handleEntityNotFound(_0x131b85,null))[_0x53ee('0x22')](respondWithResult(_0x131b85,null))[_0x53ee('0x2c')](handleError(_0x131b85,null));};exports[_0x53ee('0x5d')]=function(_0x47e0af,_0xb4f489){return db['OpenchannelAccount']['create'](_0x47e0af[_0x53ee('0x5e')],{})[_0x53ee('0x22')](function(_0x3b3c77){var _0x1a2ab1=_0x47e0af[_0x53ee('0x5f')][_0x53ee('0x37')]({'plain':!![]});if(!_0x1a2ab1)throw new Error(_0x53ee('0x60'));if(_0x1a2ab1[_0x53ee('0x61')]===_0x53ee('0x5f')){var _0x3762e5=_0x3b3c77[_0x53ee('0x37')]({'plain':!![]});var _0x101a56=_0x53ee('0x38');return db[_0x53ee('0x62')][_0x53ee('0x5c')]({'where':{'name':_0x101a56,'userProfileId':_0x1a2ab1[_0x53ee('0x63')]},'raw':!![]})['then'](function(_0x1091f3){if(_0x1091f3&&_0x1091f3[_0x53ee('0x64')]===0x0){return db[_0x53ee('0x39')][_0x53ee('0x5d')]({'name':_0x3762e5[_0x53ee('0x3b')],'resourceId':_0x3762e5['id'],'type':_0x1091f3[_0x53ee('0x3b')],'sectionId':_0x1091f3['id']},{})[_0x53ee('0x22')](function(){return _0x3b3c77;});}else{return _0x3b3c77;}})['catch'](function(_0x2e70ee){logger[_0x53ee('0x29')](_0x53ee('0x65'),_0x2e70ee);throw _0x2e70ee;});}return _0x3b3c77;})[_0x53ee('0x22')](respondWithResult(_0xb4f489,0xc9))['catch'](handleError(_0xb4f489,null));};exports['update']=function(_0x56562d,_0x3e2b55){if(_0x56562d[_0x53ee('0x5e')]['id']){delete _0x56562d[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x56562d[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]})[_0x53ee('0x22')](handleEntityNotFound(_0x3e2b55,null))['then'](saveUpdates(_0x56562d[_0x53ee('0x5e')],null))['then'](respondWithResult(_0x3e2b55,null))[_0x53ee('0x2c')](handleError(_0x3e2b55,null));};exports[_0x53ee('0x36')]=function(_0x59766f,_0x256221){return db['OpenchannelAccount']['find']({'where':{'id':_0x59766f[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x256221,null))[_0x53ee('0x22')](removeEntity(_0x256221,null))[_0x53ee('0x2c')](handleError(_0x256221,null));};exports[_0x53ee('0x66')]=function(_0x162feb,_0x537680){return db[_0x53ee('0x40')][_0x53ee('0x66')]()[_0x53ee('0x22')](respondWithResult(_0x537680,null))[_0x53ee('0x2c')](handleError(_0x537680,null));};exports['addDisposition']=function(_0x41d280,_0x25b479,_0x14e4ed){if(_0x41d280[_0x53ee('0x5e')]['id']){delete _0x41d280[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x41d280['params']['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x25b479,null))[_0x53ee('0x22')](function(_0x4d446d){if(_0x4d446d){_0x41d280[_0x53ee('0x5e')]['OpenchannelAccountId']=_0x4d446d['id'];return db[_0x53ee('0x67')][_0x53ee('0x5d')](_0x41d280[_0x53ee('0x5e')]);}})[_0x53ee('0x22')](respondWithResult(_0x25b479,null))[_0x53ee('0x2c')](handleError(_0x25b479,null));};exports[_0x53ee('0x68')]=function(_0x4aca92,_0xe7881a,_0x4d060f){var _0x49f405={'raw':![],'where':{}};var _0x387a45={};var _0x3f0f70={'count':0x0,'rows':[]};return db[_0x53ee('0x40')]['findOne']({'where':{'id':_0x4aca92['params']['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0xe7881a,null))[_0x53ee('0x22')](function(_0x2c778e){if(_0x2c778e){_0x387a45[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x67')][_0x53ee('0x41')]);_0x387a45[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x4aca92[_0x53ee('0x44')]);_0x387a45[_0x53ee('0x46')]=_['intersection'](_0x387a45['model'],_0x387a45[_0x53ee('0x44')]);_0x49f405[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x387a45[_0x53ee('0x48')],qs['fields'](_0x4aca92[_0x53ee('0x44')][_0x53ee('0x49')]));_0x49f405[_0x53ee('0x4a')]=_0x49f405[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x49f405[_0x53ee('0x4a')]:_0x387a45[_0x53ee('0x48')];if(!_0x4aca92[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x49f405[_0x53ee('0x32')]=qs['limit'](_0x4aca92[_0x53ee('0x44')]['limit']);_0x49f405[_0x53ee('0x31')]=qs['offset'](_0x4aca92[_0x53ee('0x44')]['offset']);}_0x49f405[_0x53ee('0x4e')]=qs['sort'](_0x4aca92[_0x53ee('0x44')][_0x53ee('0x4f')]);_0x49f405[_0x53ee('0x50')]=qs['filters'](_[_0x53ee('0x51')](_0x4aca92[_0x53ee('0x44')],_0x387a45[_0x53ee('0x46')]));_0x49f405[_0x53ee('0x50')]['OpenchannelAccountId']=_0x2c778e['id'];if(_0x4aca92[_0x53ee('0x44')][_0x53ee('0x52')]){_0x49f405[_0x53ee('0x50')]=_['merge'](_0x49f405[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x49f405[_0x53ee('0x4a')],function(_0x764eed){var _0x11426b={};_0x11426b[_0x764eed]={'$like':'%'+_0x4aca92[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x11426b;})});}_0x49f405=_[_0x53ee('0x54')]({},_0x49f405,_0x4aca92[_0x53ee('0x5b')]);return db['Disposition']['count']({'where':_0x49f405[_0x53ee('0x50')]})['then'](function(_0x6e31f5){_0x3f0f70[_0x53ee('0x55')]=_0x6e31f5;if(_0x4aca92[_0x53ee('0x44')][_0x53ee('0x56')]){_0x49f405[_0x53ee('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x53ee('0x58')](_0x49f405);})[_0x53ee('0x22')](function(_0x3ad284){_0x3f0f70[_0x53ee('0x69')]=_0x3ad284;return _0x3f0f70;});}})['then'](respondWithFilteredResult(_0xe7881a,_0x49f405))['catch'](handleError(_0xe7881a,null));};exports[_0x53ee('0x6a')]=function(_0x5e7b0d,_0x26a83d,_0x150b9f){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x5e7b0d[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x26a83d,null))['then'](function(_0x181ad0){if(_0x181ad0){return _0x181ad0[_0x53ee('0x6a')](_0x5e7b0d[_0x53ee('0x44')]['ids']);}})[_0x53ee('0x22')](respondWithStatusCode(_0x26a83d,null))[_0x53ee('0x2c')](handleError(_0x26a83d,null));};exports[_0x53ee('0x6b')]=function(_0x3612c2,_0x1db0dc,_0x4f1b11){if(_0x3612c2[_0x53ee('0x5e')]['id']){delete _0x3612c2[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x3612c2[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x1db0dc,null))[_0x53ee('0x22')](function(_0x471b6c){if(_0x471b6c){_0x3612c2[_0x53ee('0x5e')][_0x53ee('0x6c')]=_0x471b6c['id'];return db[_0x53ee('0x6d')]['create'](_0x3612c2[_0x53ee('0x5e')]);}})[_0x53ee('0x22')](respondWithResult(_0x1db0dc,null))[_0x53ee('0x2c')](handleError(_0x1db0dc,null));};exports[_0x53ee('0x6e')]=function(_0x2c4c40,_0x4c85d9,_0x5565a6){var _0x2b84a8={'raw':![],'where':{}};var _0x1b5ceb={};var _0x4abeb7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x53ee('0x6f')]({'where':{'id':_0x2c4c40[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c85d9,null))[_0x53ee('0x22')](function(_0x3f450d){if(_0x3f450d){_0x1b5ceb[_0x53ee('0x48')]=_['keys'](db[_0x53ee('0x6d')]['rawAttributes']);_0x1b5ceb[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x2c4c40[_0x53ee('0x44')]);_0x1b5ceb[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x1b5ceb['model'],_0x1b5ceb['query']);_0x2b84a8[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x1b5ceb[_0x53ee('0x48')],qs[_0x53ee('0x49')](_0x2c4c40[_0x53ee('0x44')]['fields']));_0x2b84a8['attributes']=_0x2b84a8[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x2b84a8[_0x53ee('0x4a')]:_0x1b5ceb[_0x53ee('0x48')];if(!_0x2c4c40[_0x53ee('0x44')]['hasOwnProperty'](_0x53ee('0x4d'))){_0x2b84a8[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x32')]);_0x2b84a8['offset']=qs['offset'](_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x2b84a8['order']=qs[_0x53ee('0x4f')](_0x2c4c40['query'][_0x53ee('0x4f')]);_0x2b84a8[_0x53ee('0x50')]=qs['filters'](_[_0x53ee('0x51')](_0x2c4c40[_0x53ee('0x44')],_0x1b5ceb[_0x53ee('0x46')]));_0x2b84a8['where'][_0x53ee('0x6c')]=_0x3f450d['id'];if(_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x52')]){_0x2b84a8['where']=_[_0x53ee('0x54')](_0x2b84a8[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x2b84a8[_0x53ee('0x4a')],function(_0x526218){var _0x4c39f1={};_0x4c39f1[_0x526218]={'$like':'%'+_0x2c4c40['query'][_0x53ee('0x52')]+'%'};return _0x4c39f1;})});}_0x2b84a8=_[_0x53ee('0x54')]({},_0x2b84a8,_0x2c4c40[_0x53ee('0x5b')]);return db['CannedAnswer'][_0x53ee('0x55')]({'where':_0x2b84a8[_0x53ee('0x50')]})[_0x53ee('0x22')](function(_0x2d9d4c){_0x4abeb7['count']=_0x2d9d4c;if(_0x2c4c40[_0x53ee('0x44')]['includeAll']){_0x2b84a8[_0x53ee('0x57')]=[{'all':!![]}];}return db[_0x53ee('0x6d')]['findAll'](_0x2b84a8);})['then'](function(_0x1a29e4){_0x4abeb7[_0x53ee('0x69')]=_0x1a29e4;return _0x4abeb7;});}})['then'](respondWithFilteredResult(_0x4c85d9,_0x2b84a8))[_0x53ee('0x2c')](handleError(_0x4c85d9,null));};exports[_0x53ee('0x70')]=function(_0x454b51,_0x281e2d,_0x30d4b3){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x454b51[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x281e2d,null))[_0x53ee('0x22')](function(_0x586768){if(_0x586768){return _0x586768[_0x53ee('0x70')](_0x454b51[_0x53ee('0x44')][_0x53ee('0x71')]);}})[_0x53ee('0x22')](respondWithStatusCode(_0x281e2d,null))[_0x53ee('0x2c')](handleError(_0x281e2d,null));};exports[_0x53ee('0x72')]=function(_0x1ba807,_0x25b31c,_0x19f9f5){var _0x31542e={'body':_0x1ba807['body'],'channel':_0x53ee('0x73')};var _0x68330f=[];var _0x2c1f6b=[];var _0x115b5b={};var _0xd8199d=![];return db['CmContact'][_0x53ee('0x66')]()[_0x53ee('0x22')](function(_0x3bfd7c){if(!_0x3bfd7c){throw new db['Sequelize'][(_0x53ee('0x74'))](_0x53ee('0x75'));}_0x68330f=_[_0x53ee('0x76')](_['keys'](_0x3bfd7c),[_0x53ee('0x77'),'updatedAt']);_0x2c1f6b=_[_0x53ee('0x76')](_['keys'](_0x3bfd7c),[_0x53ee('0x77'),'updatedAt','CompanyId','ListId']);if(_0x1ba807[_0x53ee('0x5e')]['id']){delete _0x1ba807[_0x53ee('0x5e')]['id'];}if(_[_0x53ee('0x78')](_0x1ba807[_0x53ee('0x5e')]['from'])){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7a'));}if(_[_0x53ee('0x78')](_0x1ba807[_0x53ee('0x5e')]['body'])||_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x5e')]===''){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7b'));}if(_['isNil'](_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7c')])){throw new db[(_0x53ee('0x79'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c1f6b);}if(!_[_0x53ee('0x7d')](_0x2c1f6b,_0x1ba807['body']['mapKey'])){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7e')+_0x2c1f6b);}_0x115b5b[_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7c')]]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')];})[_0x53ee('0x22')](function(){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x1ba807[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x80')],'as':_0x53ee('0x81'),'include':[{'model':db[_0x53ee('0x82')],'as':_0x53ee('0x83'),'where':_0x115b5b,'limit':0x1,'order':[[_0x53ee('0x84'),_0x53ee('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x53ee('0x86')}]});})['then'](handleEntityNotFound(_0x25b31c,null))[_0x53ee('0x22')](function(_0x3cd597){if(_0x3cd597&&_0x3cd597['List']){_0x31542e[_0x53ee('0x87')]=_0x3cd597;_0x31542e['applications']=_0x3cd597[_0x53ee('0x86')];_0x31542e[_0x53ee('0x88')]=_0x3cd597[_0x53ee('0x81')];_0x31542e[_0x53ee('0x89')]=_['orderBy'](_0x31542e[_0x53ee('0x89')],['priority'],['asc']);if(_0x31542e[_0x53ee('0x87')]['Applications']){delete _0x31542e['account'][_0x53ee('0x86')];}if(_0x31542e[_0x53ee('0x87')]['List']&&_0x31542e['account'][_0x53ee('0x81')]['Contacts'][_0x53ee('0x4b')]){return _0x31542e[_0x53ee('0x87')]['List']['Contacts'][0x0];}var _0x2f6a25=_[_0x53ee('0x1c')](_0x1ba807[_0x53ee('0x5e')],{'firstName':_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')],'ListId':_0x3cd597[_0x53ee('0x8a')]});_0x2f6a25[_0x1ba807[_0x53ee('0x5e')]['mapKey']]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')];return db['CmContact'][_0x53ee('0x5d')](_0x2f6a25,{'fields':_0x68330f,'raw':!![]});}})[_0x53ee('0x22')](handleEntityNotFound(_0x25b31c,null))['then'](function(_0x57af6b){_0x31542e['contact']=_0x57af6b;if(_0x57af6b){var _0x554550={'ContactId':_0x57af6b['id'],'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'from':(_0x57af6b['firstName']||'')+'\x20'+(_0x57af6b[_0x53ee('0x8b')]||'')};var _0x31aceb={'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'closed':![]};if(_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')]){_0x31aceb[_0x53ee('0x8c')]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')];return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':_0x31aceb})[_0x53ee('0x22')](function(_0x17290c){if(_0x17290c){return[_0x17290c,![]];}_0x554550[_0x53ee('0x8c')]=_0x1ba807['body']['threadId'];_0x554550[_0x53ee('0x8e')]=_0x1ba807['body']['externalUrl'];return db[_0x53ee('0x8d')]['create'](_0x554550)[_0x53ee('0x22')](function(_0x35a317){return[_0x35a317,!![]];});});}else{_0x31aceb[_0x53ee('0x8c')]=null;}_0x31aceb['ContactId']=_0x57af6b['id'];return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':_0x31aceb})['then'](function(_0x20d7c9){if(_0x20d7c9){return[_0x20d7c9,![]];}return db[_0x53ee('0x8d')][_0x53ee('0x5d')](_0x554550)[_0x53ee('0x22')](function(_0x435a2a){return[_0x435a2a,!![]];});});}})[_0x53ee('0x8f')](function(_0x281d91,_0x5c9a3e){if(_0x281d91){_0xd8199d=_0x5c9a3e;if(!_0x5c9a3e){var _0x345ccc={'from':(_0x31542e[_0x53ee('0x90')][_0x53ee('0x91')]||'')+'\x20'+(_0x31542e[_0x53ee('0x90')][_0x53ee('0x8b')]||'')};if(_0x1ba807['body'][_0x53ee('0x8c')]&&_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x92')]&&_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')]!=_0x1ba807['body'][_0x53ee('0x92')]){_0x345ccc[_0x53ee('0x8c')]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x92')];}return _0x281d91[_0x53ee('0x35')](_0x345ccc);}else{return _0x281d91;}}})[_0x53ee('0x22')](function(_0x159f23){_0x31542e[_0x53ee('0x93')]=_0x159f23['get']({'plain':!![]});_0x31542e['interaction'][_0x53ee('0x94')]=_0xd8199d;if(_0x31542e[_0x53ee('0x93')][_0x53ee('0x94')]){if(_0x31542e['account'][_0x53ee('0x95')]){_0x31542e['applications'][_0x53ee('0x96')]({'id':0x0,'priority':_0x31542e[_0x53ee('0x89')]['length']+0x1,'app':'close','appdata':_0x53ee('0x97'),'interval':_0x53ee('0x98')});}}return db[_0x53ee('0x99')][_0x53ee('0x5d')]({'body':_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x5e')],'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'OpenchannelInteractionId':_0x159f23['id'],'direction':'in','ContactId':_0x31542e['contact']['id'],'AttachmentId':_0x1ba807['body'][_0x53ee('0x9a')]});})[_0x53ee('0x22')](function(_0x1723e2){_0x31542e['message']=_0x1723e2;if(_0x31542e['interaction'][_0x53ee('0x9b')]){return db[_0x53ee('0x9c')][_0x53ee('0x5c')]({'attributes':['id',_0x53ee('0x3b')],'where':{'id':_0x31542e[_0x53ee('0x93')][_0x53ee('0x9b')]}})[_0x53ee('0x22')](function(_0x2697a9){if(_0x2697a9){_0x31542e[_0x53ee('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x53ee('0x9d'),'appdata':_0x2697a9[_0x53ee('0x3b')]+','+(_0x31542e[_0x53ee('0x87')]['waitForTheAssignedAgent']||0xa),'interval':_0x53ee('0x98')});_0x31542e[_0x53ee('0x9e')]=![];}return respondWithRpcPromise('Start','startRouting',_0x31542e);});}return respondWithRpcPromise('Start',_0x53ee('0x9f'),_0x31542e);})[_0x53ee('0x22')](function(_0x333dca){respondWithRpcPromise(_0x53ee('0xa0'),'EventManager',{'event':_0x53ee('0x72'),'message':_0x333dca},client9002);return _0x333dca;})['then'](respondWithResult(_0x25b31c,null))[_0x53ee('0x2c')](handleError(_0x25b31c,null));};exports[_0x53ee('0xa1')]=function(_0x326e77,_0x303896){var _0x41ee59=_0x326e77[_0x53ee('0x5a')]['id'];var _0x3fd753=_0x326e77['body'];var _0x178f38=0xc8;var _0x112c4a=null;return db[_0x53ee('0xa2')][_0x53ee('0xa3')]({'isolationLevel':db[_0x53ee('0xa2')][_0x53ee('0xa4')][_0x53ee('0xa5')][_0x53ee('0xa6')]},function(_0x3563b4){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x41ee59},'transaction':_0x3563b4})[_0x53ee('0x22')](function(_0x3bfc10){if(_0x3bfc10){return db['OpenchannelApplication'][_0x53ee('0x36')]({'where':{'OpenchannelAccountId':_0x41ee59},'transaction':_0x3563b4})[_0x53ee('0x22')](function(){var _0x520a2e=_[_0x53ee('0x3f')](_0x3fd753,function(_0x59d9d3){_0x59d9d3[_0x53ee('0x6c')]=_0x41ee59;return _0x59d9d3;});return db['OpenchannelApplication'][_0x53ee('0xa7')](_0x520a2e,{'transaction':_0x3563b4});});}else{_0x178f38=0x194;_0x112c4a=[];}});})[_0x53ee('0x22')](function(){if(_0x178f38!==0x194){return db[_0x53ee('0xa8')][_0x53ee('0xa9')]({'where':{'OpenchannelAccountId':_0x41ee59},'order':_0x53ee('0xaa')})[_0x53ee('0x22')](function(_0x522d01){_0x112c4a=_0x522d01;});}})['catch'](function(_0x317943){_0x178f38=0x1f4;logger[_0x53ee('0x29')](_0x317943[_0x53ee('0x3a')]);if(_0x317943[_0x53ee('0x3b')]){delete _0x317943[_0x53ee('0x3b')];}_0x112c4a=_0x317943;})[_0x53ee('0xab')](function(){if(_0x112c4a===null){_0x303896[_0x53ee('0x2d')](_0x178f38);}else{if(_0x178f38===0x1f4){_0x303896[_0x53ee('0x2f')](_0x178f38)[_0x53ee('0xac')](_0x112c4a);}else{_0x303896['status'](_0x178f38)[_0x53ee('0x30')](_0x112c4a);}}});};exports[_0x53ee('0xad')]=function(_0x47c3d3,_0x10c406,_0x51cf25){var _0x3769a3={};var _0x2bfdc3={};var _0x46ca06;var _0x4d2da2;return db[_0x53ee('0x40')]['findOne']({'where':{'id':_0x47c3d3[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x10c406,null))[_0x53ee('0x22')](function(_0x5cc893){if(_0x5cc893){_0x46ca06=_0x5cc893;_0x2bfdc3['model']=_['keys'](db[_0x53ee('0xa8')][_0x53ee('0x41')]);_0x2bfdc3[_0x53ee('0x44')]=_['keys'](_0x47c3d3[_0x53ee('0x44')]);_0x2bfdc3[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x2bfdc3[_0x53ee('0x48')],_0x2bfdc3['query']);_0x3769a3[_0x53ee('0x4a')]=_['intersection'](_0x2bfdc3['model'],qs[_0x53ee('0x49')](_0x47c3d3[_0x53ee('0x44')]['fields']));_0x3769a3[_0x53ee('0x4a')]=_0x3769a3[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x3769a3['attributes']:_0x2bfdc3[_0x53ee('0x48')];_0x3769a3[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x47c3d3['query']['sort']);_0x3769a3['where']=qs[_0x53ee('0x46')](_['pick'](_0x47c3d3[_0x53ee('0x44')],_0x2bfdc3[_0x53ee('0x46')]));if(_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x52')]){_0x3769a3[_0x53ee('0x50')]=_[_0x53ee('0x54')](_0x3769a3[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x3769a3['attributes'],function(_0x9f30a6){var _0x3a0f48={};_0x3a0f48[_0x9f30a6]={'$like':'%'+_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3a0f48;})});}_0x3769a3=_[_0x53ee('0x54')]({},_0x3769a3,_0x47c3d3[_0x53ee('0x5b')]);return _0x46ca06['getApplications'](_0x3769a3);}})[_0x53ee('0x22')](function(_0x4fdff6){if(_0x4fdff6){_0x4d2da2=_0x4fdff6['length'];if(!_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x4c')]('nolimit')){_0x3769a3[_0x53ee('0x32')]=qs['limit'](_0x47c3d3['query'][_0x53ee('0x32')]);_0x3769a3[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x47c3d3[_0x53ee('0x44')]['offset']);}return _0x46ca06[_0x53ee('0xad')](_0x3769a3);}})[_0x53ee('0x22')](function(_0x2ea33d){if(_0x2ea33d){return _0x2ea33d?{'count':_0x4d2da2,'rows':_0x2ea33d}:null;}})[_0x53ee('0x22')](respondWithResult(_0x10c406,null))['catch'](handleError(_0x10c406,null));};exports[_0x53ee('0xae')]=function(_0x450801,_0x3cdee3,_0x1b9413){var _0x251377={'raw':![],'where':{}};var _0x1fa9b6={};var _0x2a9dcb={'count':0x0,'rows':[]};return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x450801[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3cdee3,null))[_0x53ee('0x22')](function(_0xf2668a){if(_0xf2668a){_0x1fa9b6['model']=_['keys'](db[_0x53ee('0x8d')][_0x53ee('0x41')]);_0x1fa9b6[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x450801[_0x53ee('0x44')]);_0x1fa9b6[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x1fa9b6[_0x53ee('0x48')],_0x1fa9b6[_0x53ee('0x44')]);_0x251377[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x1fa9b6['model'],qs[_0x53ee('0x49')](_0x450801['query'][_0x53ee('0x49')]));_0x251377[_0x53ee('0x4a')]=_0x251377[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x251377['attributes']:_0x1fa9b6[_0x53ee('0x48')];if(!_0x450801['query']['hasOwnProperty'](_0x53ee('0x4d'))){_0x251377[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x450801['query']['limit']);_0x251377['offset']=qs['offset'](_0x450801[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x251377[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x450801['query']['sort']);_0x251377[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x450801['query'],_0x1fa9b6['filters']));_0x251377['where']['OpenchannelAccountId']=_0xf2668a['id'];if(_0x450801[_0x53ee('0x44')]['filter']){_0x251377['where']=_[_0x53ee('0x54')](_0x251377[_0x53ee('0x50')],{'$or':_['map'](_0x251377['attributes'],function(_0x42d271){var _0x3da21d={};_0x3da21d[_0x42d271]={'$like':'%'+_0x450801[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3da21d;})});}_0x251377=_[_0x53ee('0x54')]({},_0x251377,_0x450801[_0x53ee('0x5b')]);return db[_0x53ee('0x8d')][_0x53ee('0x55')]({'where':_0x251377['where']})[_0x53ee('0x22')](function(_0x1acd6a){_0x2a9dcb[_0x53ee('0x55')]=_0x1acd6a;if(_0x450801['query'][_0x53ee('0x56')]){_0x251377[_0x53ee('0x57')]=[{'model':db['CmContact'],'as':_0x53ee('0xaf'),'required':![]},{'model':db['User'],'as':_0x53ee('0xb0'),'attributes':[_0x53ee('0x3b'),_0x53ee('0xb1'),_0x53ee('0xb2')],'required':![]},{'model':db['Tag'],'as':_0x53ee('0xb3'),'attributes':['id','name','color'],'where':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]?{'id':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]}:undefined,'required':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x53ee('0x58')](_0x251377);})['then'](function(_0x221335){_0x2a9dcb[_0x53ee('0x69')]=_0x221335;return _0x2a9dcb;});}})['then'](respondWithFilteredResult(_0x3cdee3,_0x251377))[_0x53ee('0x2c')](handleError(_0x3cdee3,null));};exports[_0x53ee('0xb5')]=function(_0x2cd346,_0x27bcc9,_0x1eb6b5){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x2cd346[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x27bcc9,null))['then'](function(_0x44e018){if(_0x44e018){return _0x44e018['addAgents'](_0x2cd346[_0x53ee('0x5e')][_0x53ee('0x71')],_['omit'](_0x2cd346['body'],[_0x53ee('0x71'),'id'])||{})[_0x53ee('0x8f')](function(_0x372ca7){for(var _0x1b761f=0x0;_0x1b761f<_0x2cd346['body'][_0x53ee('0x71')][_0x53ee('0x4b')];_0x1b761f+=0x1){socket[_0x53ee('0xb6')](_0x53ee('0xb7'),{'UserId':Number(_0x2cd346[_0x53ee('0x5e')][_0x53ee('0x71')][_0x1b761f]),'OpenchannelAccountId':Number(_0x2cd346[_0x53ee('0x5a')]['id'])});}return _0x372ca7;});}})[_0x53ee('0x22')](respondWithResult(_0x27bcc9,null))['catch'](handleError(_0x27bcc9,null));};exports[_0x53ee('0xb8')]=function(_0x3874dc,_0x48c8e2,_0x32da3e){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x3874dc[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x48c8e2,null))[_0x53ee('0x22')](function(_0x3faa14){if(_0x3faa14){return _0x3faa14[_0x53ee('0xb8')](_0x3874dc[_0x53ee('0x44')]['ids'])[_0x53ee('0x22')](function(){if(_[_0x53ee('0xb9')](_0x3874dc['query'][_0x53ee('0x71')])){for(var _0xf8834b=0x0;_0xf8834b<_0x3874dc[_0x53ee('0x44')]['ids'][_0x53ee('0x4b')];_0xf8834b+=0x1){socket[_0x53ee('0xb6')](_0x53ee('0xba'),{'UserId':Number(_0x3874dc[_0x53ee('0x44')][_0x53ee('0x71')][_0xf8834b]),'OpenchannelAccountId':Number(_0x3874dc[_0x53ee('0x5a')]['id'])});}}else{socket[_0x53ee('0xb6')](_0x53ee('0xba'),{'UserId':Number(_0x3874dc[_0x53ee('0x44')][_0x53ee('0x71')]),'OpenchannelAccountId':Number(_0x3874dc[_0x53ee('0x5a')]['id'])});}});}})[_0x53ee('0x22')](respondWithStatusCode(_0x48c8e2,null))[_0x53ee('0x2c')](handleError(_0x48c8e2,null));};exports['getAgents']=function(_0x5e9bcf,_0x330d32,_0x201738){var _0x1816ec={};var _0x44d813={};var _0x33b8d6;var _0x4378ac;return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x5e9bcf[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x330d32,null))[_0x53ee('0x22')](function(_0x620c97){if(_0x620c97){_0x33b8d6=_0x620c97;_0x44d813[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x9c')][_0x53ee('0x41')]);_0x44d813['query']=_[_0x53ee('0x45')](_0x5e9bcf['query']);_0x44d813[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x44d813['model'],_0x44d813[_0x53ee('0x44')]);_0x1816ec[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x44d813[_0x53ee('0x48')],qs[_0x53ee('0x49')](_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x49')]));_0x1816ec[_0x53ee('0x4a')]=_0x1816ec[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x1816ec[_0x53ee('0x4a')]:_0x44d813[_0x53ee('0x48')];_0x1816ec['order']=qs['sort'](_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x4f')]);_0x1816ec[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x5e9bcf[_0x53ee('0x44')],_0x44d813[_0x53ee('0x46')]));if(_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x52')]){_0x1816ec[_0x53ee('0x50')]=_[_0x53ee('0x54')](_0x1816ec[_0x53ee('0x50')],{'$or':_['map'](_0x1816ec[_0x53ee('0x4a')],function(_0x520fbb){var _0x333d79={};_0x333d79[_0x520fbb]={'$like':'%'+_0x5e9bcf[_0x53ee('0x44')]['filter']+'%'};return _0x333d79;})});}_0x1816ec=_[_0x53ee('0x54')]({},_0x1816ec,_0x5e9bcf[_0x53ee('0x5b')]);return _0x33b8d6[_0x53ee('0xbb')](_0x1816ec);}})[_0x53ee('0x22')](function(_0x2470ee){if(_0x2470ee){_0x4378ac=_0x2470ee[_0x53ee('0x4b')];if(!_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x1816ec[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x5e9bcf[_0x53ee('0x44')]['limit']);_0x1816ec[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x5e9bcf[_0x53ee('0x44')]['offset']);}return _0x33b8d6['getAgents'](_0x1816ec);}})[_0x53ee('0x22')](function(_0x56459e){if(_0x56459e){return _0x56459e?{'count':_0x4378ac,'rows':_0x56459e}:null;}})[_0x53ee('0x22')](respondWithResult(_0x330d32,null))[_0x53ee('0x2c')](handleError(_0x330d32,null));};exports[_0x53ee('0xac')]=function(_0x15ac4d,_0x37fecc,_0x2c1726){var _0x168941,_0x3bdaad,_0x352625;if(_[_0x53ee('0x78')](_0x15ac4d[_0x53ee('0x5e')]['body'])||_0x15ac4d[_0x53ee('0x5e')][_0x53ee('0x5e')]===''){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7b'));}if(_[_0x53ee('0x78')](_0x15ac4d[_0x53ee('0x5e')]['to'])){}_0x168941=_0x15ac4d['body']['to'];return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x15ac4d[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x37fecc,null))['then'](function(_0x4a7345){if(_0x4a7345){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x4a7345['id']},'include':[{'model':db[_0x53ee('0x80')],'as':_0x53ee('0x81'),'include':[{'model':db['CmContact'],'as':_0x53ee('0x83'),'where':{[_0x4a7345[_0x53ee('0x7c')]]:_0x168941},'limit':0x1,'order':[[_0x53ee('0x84'),_0x53ee('0x85')]]}]}]})[_0x53ee('0x22')](handleEntityNotFound(_0x37fecc,null))[_0x53ee('0x22')](function(_0xbe5bea){if(_0xbe5bea&&_0xbe5bea[_0x53ee('0x81')]){_0x3bdaad=_0xbe5bea[_0x53ee('0x37')]({'plain':!![]});if(_0x3bdaad[_0x53ee('0x81')]&&_0x3bdaad['List'][_0x53ee('0x83')][_0x53ee('0x4b')]){return _0x3bdaad[_0x53ee('0x81')][_0x53ee('0x83')][0x0];}return db[_0x53ee('0x82')][_0x53ee('0x5d')](_[_0x53ee('0x1c')](_0x15ac4d['body'],{'firstName':_0x168941,[_0xbe5bea[_0x53ee('0x7c')]]:_0x168941,'phone':_0x168941,'ListId':_0x3bdaad['ListId']}));}})['then'](handleEntityNotFound(_0x37fecc,null))['then'](function(_0x379d03){if(_0x379d03){_0x352625=_0x379d03;return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':{'ContactId':_0x352625['id'],'closed':![],'OpenchannelAccountId':_0x3bdaad['id']}})[_0x53ee('0x22')](function(_0x275904){if(_0x275904){return[_0x275904,![]];}return db[_0x53ee('0x8d')][_0x53ee('0x5d')]({'UserId':_0x15ac4d['user']['id'],'ContactId':_0x352625['id'],'OpenchannelAccountId':_0x3bdaad['id'],'lastMsgDirection':_0x53ee('0xbc'),'firstMsgDirection':_0x53ee('0xbc'),'Messages':[_[_0x53ee('0x54')](_0x15ac4d[_0x53ee('0x5e')],{'read':![],'body':_0x15ac4d[_0x53ee('0x5e')][_0x53ee('0x5e')],'OpenchannelAccountId':_0x3bdaad['id'],'UserId':_0x15ac4d[_0x53ee('0x5f')]['id'],'ContactId':_0x352625['id']})]},{'include':[{'model':db[_0x53ee('0x99')],'as':_0x53ee('0xbd')}]})[_0x53ee('0x22')](function(_0x75f8a2){return[_0x75f8a2,!![]];});});}})[_0x53ee('0x8f')](function(_0x908b2c,_0x4f77dd){if(_0x4f77dd){return _0x908b2c;}return db[_0x53ee('0x99')][_0x53ee('0x5d')](_[_0x53ee('0x54')](_0x15ac4d['body'],{'read':![],'body':_0x15ac4d[_0x53ee('0x5e')]['body'],'OpenchannelAccountId':_0x3bdaad['id'],'OpenchannelInteractionId':_0x908b2c['id'],'UserId':_0x15ac4d[_0x53ee('0x5f')]['id'],'ContactId':_0x352625['id']}))[_0x53ee('0x22')](function(_0x8f91ca){_0x908b2c['dataValues'][_0x53ee('0xbd')]=[];_0x908b2c[_0x53ee('0xbe')][_0x53ee('0xbd')][_0x53ee('0x96')](_0x8f91ca['dataValues']);return _0x908b2c;});});}})[_0x53ee('0x22')](respondWithResult(_0x37fecc,null))[_0x53ee('0x2c')](handleError(_0x37fecc,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f8a9474..61eb6d8 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 _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b3413,_0x58c416){var _0x3b01ba=function(_0xb25f43){while(--_0xb25f43){_0x4b3413['push'](_0x4b3413['shift']());}};_0x3b01ba(++_0x58c416);}(_0x9bde,0xe1));var _0xe9bd=function(_0x263f60,_0x45dfc9){_0x263f60=_0x263f60-0x0;var _0x31651a=_0x9bde[_0x263f60];return _0x31651a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x1059ab,_0x2af4fb){var _0x22c4ab=function(_0x12a9f1){while(--_0x12a9f1){_0x1059ab['push'](_0x1059ab['shift']());}};_0x22c4ab(++_0x2af4fb);}(_0xa74f,0x9a));var _0xfa74=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0xa74f[_0x585ee5];return _0x470808;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 2ebf2a5..8bedf96 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(_0x4c109b,_0x28d2d2){var _0x201d9=function(_0x33097e){while(--_0x33097e){_0x4c109b['push'](_0x4c109b['shift']());}};_0x201d9(++_0x28d2d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x5d930d,_0x5f2016){var _0x43c8d6=function(_0x4979a6){while(--_0x4979a6){_0x5d930d['push'](_0x5d930d['shift']());}};_0x43c8d6(++_0x5f2016);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var 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 caa72fa..a51ecca 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 _0xa149=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','request\x20sent','debug','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x16ddf3,_0x1bb6d9){var _0xd80028=function(_0x343b5f){while(--_0x343b5f){_0x16ddf3['push'](_0x16ddf3['shift']());}};_0xd80028(++_0x1bb6d9);}(_0xa149,0x18c));var _0x9a14=function(_0x4c5433,_0x465a7a){_0x4c5433=_0x4c5433-0x0;var _0x429ebe=_0xa149[_0x4c5433];return _0x429ebe;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var moment=require(_0x9a14('0x2'));var BPromise=require(_0x9a14('0x3'));var rs=require(_0x9a14('0x4'));var fs=require('fs');var Redis=require(_0x9a14('0x5'));var db=require(_0x9a14('0x6'))['db'];var utils=require(_0x9a14('0x7'));var logger=require(_0x9a14('0x8'))('rpc');var config=require(_0x9a14('0x9'));var jayson=require(_0x9a14('0xa'));var client=jayson['client'][_0x9a14('0xb')]({'port':0x232a});config[_0x9a14('0xc')]=_[_0x9a14('0xd')](config[_0x9a14('0xc')],{'host':_0x9a14('0xe'),'port':0x18eb});var socket=require(_0x9a14('0xf'))(new Redis(config['redis']));require(_0x9a14('0x10'))['register'](socket);function respondWithRpcPromise(_0x3d0481,_0x25afa7,_0x36c9ed){return new BPromise(function(_0x33bb89,_0x4155e5){return client[_0x9a14('0x11')](_0x3d0481,_0x36c9ed)['then'](function(_0x5d4ed8){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x25afa7,_0x9a14('0x12'));logger[_0x9a14('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x25afa7,_0x9a14('0x12'),JSON['stringify'](_0x5d4ed8));if(_0x5d4ed8[_0x9a14('0x14')]){if(_0x5d4ed8['error']['code']===0x1f4){logger[_0x9a14('0x14')](_0x9a14('0x15'),_0x25afa7,_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);return _0x4155e5(_0x5d4ed8['error'][_0x9a14('0x16')]);}logger[_0x9a14('0x14')](_0x9a14('0x15'),_0x25afa7,_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);return _0x33bb89(_0x5d4ed8[_0x9a14('0x14')][_0x9a14('0x16')]);}else{logger[_0x9a14('0x17')](_0x9a14('0x15'),_0x25afa7,_0x9a14('0x12'));_0x33bb89(_0x5d4ed8[_0x9a14('0x18')]['message']);}})['catch'](function(_0x589822){logger[_0x9a14('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x25afa7,_0x589822);_0x4155e5(_0x589822);});});} \ No newline at end of file +var _0xcf66=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then'];(function(_0x2a1465,_0x8bf785){var _0x128933=function(_0x4f2a1f){while(--_0x4f2a1f){_0x2a1465['push'](_0x2a1465['shift']());}};_0x128933(++_0x8bf785);}(_0xcf66,0x71));var _0x6cf6=function(_0x5c4498,_0x302ae5){_0x5c4498=_0x5c4498-0x0;var _0x54bb30=_0xcf66[_0x5c4498];return _0x54bb30;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});config['redis']=_[_0x6cf6('0xa')](config[_0x6cf6('0xb')],{'host':_0x6cf6('0xc'),'port':0x18eb});var socket=require(_0x6cf6('0xd'))(new Redis(config[_0x6cf6('0xb')]));require(_0x6cf6('0xe'))['register'](socket);function respondWithRpcPromise(_0x58378c,_0x5b7f4e,_0x8e90e){return new BPromise(function(_0x504c98,_0x1fdf80){return client[_0x6cf6('0xf')](_0x58378c,_0x8e90e)[_0x6cf6('0x10')](function(_0x3f7fc1){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b7f4e,'request\x20sent');logger[_0x6cf6('0x11')](_0x6cf6('0x12'),_0x5b7f4e,_0x6cf6('0x13'),JSON[_0x6cf6('0x14')](_0x3f7fc1));if(_0x3f7fc1[_0x6cf6('0x15')]){if(_0x3f7fc1[_0x6cf6('0x15')]['code']===0x1f4){logger[_0x6cf6('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x1fdf80(_0x3f7fc1['error'][_0x6cf6('0x16')]);}logger[_0x6cf6('0x15')](_0x6cf6('0x17'),_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x504c98(_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);}else{logger[_0x6cf6('0x18')](_0x6cf6('0x17'),_0x5b7f4e,_0x6cf6('0x13'));_0x504c98(_0x3f7fc1['result'][_0x6cf6('0x16')]);}})[_0x6cf6('0x19')](function(_0x22ab0){logger['error'](_0x6cf6('0x17'),_0x5b7f4e,_0x22ab0);_0x1fdf80(_0x22ab0);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 70014ee..a585f07 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 _0x1ae3=['update','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x1ae3,0x139));var _0x31ae=function(_0x5a5849,_0x1ab4de){_0x5a5849=_0x5a5849-0x0;var _0x2bf3bb=_0x1ae3[_0x5a5849];return _0x2bf3bb;};'use strict';var OpenchannelAccountEvents=require(_0x31ae('0x0'));var events=[_0x31ae('0x1'),'remove',_0x31ae('0x2')];function createListener(_0x3ba253,_0x21cada){return function(_0x293580){_0x21cada['emit'](_0x3ba253,_0x293580);};}function removeListener(_0x16eaa4,_0xf41e21){return function(){OpenchannelAccountEvents[_0x31ae('0x3')](_0x16eaa4,_0xf41e21);};}exports[_0x31ae('0x4')]=function(_0xe1202b){for(var _0x3f2e91=0x0,_0x3500b4=events[_0x31ae('0x5')];_0x3f2e91<_0x3500b4;_0x3f2e91++){var _0x43773f=events[_0x3f2e91];var _0x1d2071=createListener(_0x31ae('0x6')+_0x43773f,_0xe1202b);OpenchannelAccountEvents['on'](_0x43773f,_0x1d2071);}}; \ No newline at end of file +var _0x2121=['length','./openchannelAccount.events','save','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2121,0x1b4));var _0x1212=function(_0x54612c,_0x167d51){_0x54612c=_0x54612c-0x0;var _0x5d6e89=_0x2121[_0x54612c];return _0x5d6e89;};'use strict';var OpenchannelAccountEvents=require(_0x1212('0x0'));var events=[_0x1212('0x1'),'remove','update'];function createListener(_0x1e00c4,_0x3081d8){return function(_0x3929a1){_0x3081d8[_0x1212('0x2')](_0x1e00c4,_0x3929a1);};}function removeListener(_0x44337c,_0x553ed1){return function(){OpenchannelAccountEvents[_0x1212('0x3')](_0x44337c,_0x553ed1);};}exports['register']=function(_0x7b16ef){for(var _0x452116=0x0,_0x20fadc=events[_0x1212('0x4')];_0x452116<_0x20fadc;_0x452116++){var _0x233a53=events[_0x452116];var _0x642ed5=createListener('openchannelAccount:'+_0x233a53,_0x7b16ef);OpenchannelAccountEvents['on'](_0x233a53,_0x642ed5);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6fdffab..24019b7 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 _0x38e2=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x311dc5,_0x1b5f03){var _0x1da967=function(_0x1c48ed){while(--_0x1c48ed){_0x311dc5['push'](_0x311dc5['shift']());}};_0x1da967(++_0x1b5f03);}(_0x38e2,0x110));var _0x238e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x38e2[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x238e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x238e('0x1'));var router=express[_0x238e('0x2')]();var fs_extra=require(_0x238e('0x3'));var auth=require(_0x238e('0x4'));var interaction=require(_0x238e('0x5'));var config=require('../../config/environment');var controller=require(_0x238e('0x6'));router[_0x238e('0x7')]('/',auth[_0x238e('0x8')](),controller[_0x238e('0x9')]);router['get']('/:id',auth[_0x238e('0x8')](),controller[_0x238e('0xa')]);router[_0x238e('0xb')]('/',auth[_0x238e('0x8')](),controller[_0x238e('0xc')]);router[_0x238e('0xd')](_0x238e('0xe'),auth['isAuthenticated'](),controller[_0x238e('0xf')]);router[_0x238e('0x10')](_0x238e('0xe'),auth[_0x238e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2122=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x41fdcc,_0x586927){var _0x3de759=function(_0xd5d493){while(--_0xd5d493){_0x41fdcc['push'](_0x41fdcc['shift']());}};_0x3de759(++_0x586927);}(_0x2122,0x161));var _0x2212=function(_0xe0f3ca,_0x12e10a){_0xe0f3ca=_0xe0f3ca-0x0;var _0x5db0fd=_0x2122[_0xe0f3ca];return _0x5db0fd;};'use strict';var multer=require(_0x2212('0x0'));var util=require(_0x2212('0x1'));var path=require(_0x2212('0x2'));var timeout=require('connect-timeout');var express=require(_0x2212('0x3'));var router=express[_0x2212('0x4')]();var fs_extra=require(_0x2212('0x5'));var auth=require(_0x2212('0x6'));var interaction=require(_0x2212('0x7'));var config=require(_0x2212('0x8'));var controller=require(_0x2212('0x9'));router['get']('/',auth[_0x2212('0xa')](),controller[_0x2212('0xb')]);router[_0x2212('0xc')](_0x2212('0xd'),auth[_0x2212('0xa')](),controller['show']);router[_0x2212('0xe')]('/',auth[_0x2212('0xa')](),controller[_0x2212('0xf')]);router[_0x2212('0x10')](_0x2212('0xd'),auth[_0x2212('0xa')](),controller[_0x2212('0x11')]);router[_0x2212('0x12')](_0x2212('0xd'),auth[_0x2212('0xa')](),controller['destroy']);module[_0x2212('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e8d226c..c693f61 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 _0xb0f8=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb0f8,0xd4));var _0x8b0f=function(_0x2a404a,_0x377b39){_0x2a404a=_0x2a404a-0x0;var _0x4e2362=_0xb0f8[_0x2a404a];return _0x4e2362;};'use strict';var Sequelize=require(_0x8b0f('0x0'));module[_0x8b0f('0x1')]={'priority':{'type':Sequelize[_0x8b0f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8b0f('0x3')],'allowNull':![],'defaultValue':_0x8b0f('0x4')},'appdata':{'type':Sequelize[_0x8b0f('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8b0f('0x6')}}; \ No newline at end of file +var _0xe214=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x568cd1,_0xbc6010){var _0x1d9654=function(_0x40f89d){while(--_0x40f89d){_0x568cd1['push'](_0x568cd1['shift']());}};_0x1d9654(++_0xbc6010);}(_0xe214,0x18a));var _0x4e21=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe214[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4e21('0x0'));module[_0x4e21('0x1')]={'priority':{'type':Sequelize[_0x4e21('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4e21('0x3')],'allowNull':![],'defaultValue':_0x4e21('0x4')},'appdata':{'type':Sequelize[_0x4e21('0x5')]()},'description':{'type':Sequelize[_0x4e21('0x3')]},'interval':{'type':Sequelize[_0x4e21('0x3')],'defaultValue':_0x4e21('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index a09676c..baf77e6 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 _0x0a53=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x0a53,0x1cc));var _0x30a5=function(_0x34cbea,_0x5f0505){_0x34cbea=_0x34cbea-0x0;var _0x1874e5=_0x0a53[_0x34cbea];return _0x1874e5;};'use strict';var emlformat=require(_0x30a5('0x0'));var rimraf=require(_0x30a5('0x1'));var zipdir=require(_0x30a5('0x2'));var jsonpatch=require(_0x30a5('0x3'));var rp=require('request-promise');var moment=require(_0x30a5('0x4'));var BPromise=require(_0x30a5('0x5'));var Mustache=require(_0x30a5('0x6'));var util=require(_0x30a5('0x7'));var path=require(_0x30a5('0x8'));var sox=require(_0x30a5('0x9'));var csv=require(_0x30a5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a5('0xb'));var _=require(_0x30a5('0xc'));var squel=require(_0x30a5('0xd'));var crypto=require(_0x30a5('0xe'));var jsforce=require(_0x30a5('0xf'));var deskjs=require(_0x30a5('0x10'));var toCsv=require(_0x30a5('0xa'));var querystring=require(_0x30a5('0x11'));var Papa=require(_0x30a5('0x12'));var Redis=require(_0x30a5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x30a5('0x14'));var as=require(_0x30a5('0x15'));var hardwareService=require(_0x30a5('0x16'));var logger=require(_0x30a5('0x17'))(_0x30a5('0x18'));var utils=require(_0x30a5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x30a5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8ab5e4,_0xbe7b4c){_0xbe7b4c=_0xbe7b4c||0xcc;return function(_0x36adcd){if(_0x36adcd){return _0x8ab5e4[_0x30a5('0x1b')](_0xbe7b4c);}return _0x8ab5e4['status'](_0xbe7b4c)['end']();};}function respondWithResult(_0x239e11,_0x4a1c5b){_0x4a1c5b=_0x4a1c5b||0xc8;return function(_0x3e6793){if(_0x3e6793){return _0x239e11[_0x30a5('0x1c')](_0x4a1c5b)[_0x30a5('0x1d')](_0x3e6793);}};}function respondWithFilteredResult(_0x5e7e8c,_0x2aac5b){return function(_0x97d4eb){if(_0x97d4eb){var _0x21104b=typeof _0x2aac5b['offset']===_0x30a5('0x1e')&&typeof _0x2aac5b['limit']==='undefined';var _0x262927=_0x97d4eb[_0x30a5('0x1f')];var _0x261058=_0x21104b?0x0:_0x2aac5b['offset'];var _0x5a394a=_0x21104b?_0x97d4eb[_0x30a5('0x1f')]:_0x2aac5b[_0x30a5('0x20')]+_0x2aac5b[_0x30a5('0x21')];var _0x52295c;if(_0x5a394a>=_0x262927){_0x5a394a=_0x262927;_0x52295c=0xc8;}else{_0x52295c=0xce;}_0x5e7e8c[_0x30a5('0x1c')](_0x52295c);return _0x5e7e8c[_0x30a5('0x22')](_0x30a5('0x23'),_0x261058+'-'+_0x5a394a+'/'+_0x262927)[_0x30a5('0x1d')](_0x97d4eb);}return null;};}function patchUpdates(_0xd000d4){return function(_0x598e5b){try{jsonpatch['apply'](_0x598e5b,_0xd000d4,!![]);}catch(_0x3d0842){return BPromise[_0x30a5('0x24')](_0x3d0842);}return _0x598e5b[_0x30a5('0x25')]();};}function saveUpdates(_0x3ee104,_0x4edaf8){return function(_0x4176a5){if(_0x4176a5){return _0x4176a5[_0x30a5('0x26')](_0x3ee104)[_0x30a5('0x27')](function(_0x346705){return _0x346705;});}return null;};}function removeEntity(_0x5bac39,_0x1d65fd){return function(_0x1a22c0){if(_0x1a22c0){return _0x1a22c0['destroy']()[_0x30a5('0x27')](function(){_0x5bac39[_0x30a5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2238aa,_0x39f7f8){return function(_0x3a9331){if(!_0x3a9331){_0x2238aa['sendStatus'](0x194);}return _0x3a9331;};}function handleError(_0x2ed094,_0x34a133){_0x34a133=_0x34a133||0x1f4;return function(_0x3dc856){logger['error'](_0x3dc856[_0x30a5('0x28')]);if(_0x3dc856['name']){delete _0x3dc856[_0x30a5('0x29')];}_0x2ed094[_0x30a5('0x1c')](_0x34a133)[_0x30a5('0x2a')](_0x3dc856);};}exports[_0x30a5('0x2b')]=function(_0x31ecb8,_0x114501){var _0x3e9f6c={},_0x13c7b0={},_0x41bf4b={'count':0x0,'rows':[]};var _0x595672=_[_0x30a5('0x2c')](db[_0x30a5('0x2d')][_0x30a5('0x2e')],function(_0x34d512){return{'name':_0x34d512[_0x30a5('0x2f')],'type':_0x34d512['type'][_0x30a5('0x30')]};});_0x13c7b0[_0x30a5('0x31')]=_[_0x30a5('0x2c')](_0x595672,_0x30a5('0x29'));_0x13c7b0[_0x30a5('0x32')]=_[_0x30a5('0x33')](_0x31ecb8['query']);_0x13c7b0['filters']=_[_0x30a5('0x34')](_0x13c7b0[_0x30a5('0x31')],_0x13c7b0[_0x30a5('0x32')]);_0x3e9f6c[_0x30a5('0x35')]=_[_0x30a5('0x34')](_0x13c7b0[_0x30a5('0x31')],qs['fields'](_0x31ecb8['query'][_0x30a5('0x36')]));_0x3e9f6c['attributes']=_0x3e9f6c[_0x30a5('0x35')][_0x30a5('0x37')]?_0x3e9f6c[_0x30a5('0x35')]:_0x13c7b0[_0x30a5('0x31')];if(!_0x31ecb8[_0x30a5('0x32')][_0x30a5('0x38')](_0x30a5('0x39'))){_0x3e9f6c[_0x30a5('0x21')]=qs[_0x30a5('0x21')](_0x31ecb8['query'][_0x30a5('0x21')]);_0x3e9f6c[_0x30a5('0x20')]=qs[_0x30a5('0x20')](_0x31ecb8[_0x30a5('0x32')][_0x30a5('0x20')]);}_0x3e9f6c['order']=qs[_0x30a5('0x3a')](_0x31ecb8[_0x30a5('0x32')]['sort']);_0x3e9f6c[_0x30a5('0x3b')]=qs[_0x30a5('0x3c')](_[_0x30a5('0x3d')](_0x31ecb8[_0x30a5('0x32')],_0x13c7b0['filters']),_0x595672);if(_0x31ecb8[_0x30a5('0x32')]['filter']){_0x3e9f6c[_0x30a5('0x3b')]=_[_0x30a5('0x3e')](_0x3e9f6c[_0x30a5('0x3b')],{'$or':_[_0x30a5('0x2c')](_0x595672,function(_0x2c89d2){if(_0x2c89d2[_0x30a5('0x3f')]!==_0x30a5('0x40')){var _0x3c0ee4={};_0x3c0ee4[_0x2c89d2[_0x30a5('0x29')]]={'$like':'%'+_0x31ecb8[_0x30a5('0x32')][_0x30a5('0x41')]+'%'};return _0x3c0ee4;}})});}_0x3e9f6c=_[_0x30a5('0x3e')]({},_0x3e9f6c,_0x31ecb8['options']);var _0x2536ac={'where':_0x3e9f6c[_0x30a5('0x3b')]};return db['OpenchannelApplication'][_0x30a5('0x1f')](_0x2536ac)[_0x30a5('0x27')](function(_0x505ff3){_0x41bf4b[_0x30a5('0x1f')]=_0x505ff3;if(_0x31ecb8[_0x30a5('0x32')][_0x30a5('0x42')]){_0x3e9f6c[_0x30a5('0x43')]=[{'all':!![]}];}return db[_0x30a5('0x2d')][_0x30a5('0x44')](_0x3e9f6c);})['then'](function(_0x52cce0){_0x41bf4b[_0x30a5('0x45')]=_0x52cce0;return _0x41bf4b;})[_0x30a5('0x27')](respondWithFilteredResult(_0x114501,_0x3e9f6c))[_0x30a5('0x46')](handleError(_0x114501,null));};exports[_0x30a5('0x47')]=function(_0x5d9df4,_0x2f9920){var _0x5d3053={'raw':!![],'where':{'id':_0x5d9df4['params']['id']}},_0x4df245={};_0x4df245[_0x30a5('0x31')]=_[_0x30a5('0x33')](db[_0x30a5('0x2d')][_0x30a5('0x2e')]);_0x4df245[_0x30a5('0x32')]=_[_0x30a5('0x33')](_0x5d9df4[_0x30a5('0x32')]);_0x4df245[_0x30a5('0x3c')]=_[_0x30a5('0x34')](_0x4df245[_0x30a5('0x31')],_0x4df245[_0x30a5('0x32')]);_0x5d3053[_0x30a5('0x35')]=_[_0x30a5('0x34')](_0x4df245[_0x30a5('0x31')],qs['fields'](_0x5d9df4[_0x30a5('0x32')]['fields']));_0x5d3053[_0x30a5('0x35')]=_0x5d3053[_0x30a5('0x35')][_0x30a5('0x37')]?_0x5d3053[_0x30a5('0x35')]:_0x4df245[_0x30a5('0x31')];if(_0x5d9df4['query'][_0x30a5('0x42')]){_0x5d3053[_0x30a5('0x43')]=[{'all':!![]}];}_0x5d3053=_[_0x30a5('0x3e')]({},_0x5d3053,_0x5d9df4['options']);return db['OpenchannelApplication'][_0x30a5('0x48')](_0x5d3053)[_0x30a5('0x27')](handleEntityNotFound(_0x2f9920,null))[_0x30a5('0x27')](respondWithResult(_0x2f9920,null))['catch'](handleError(_0x2f9920,null));};exports[_0x30a5('0x49')]=function(_0x5808c4,_0x313ace){return db[_0x30a5('0x2d')]['create'](_0x5808c4[_0x30a5('0x4a')],{})[_0x30a5('0x27')](respondWithResult(_0x313ace,0xc9))[_0x30a5('0x46')](handleError(_0x313ace,null));};exports[_0x30a5('0x26')]=function(_0x37c49b,_0x53637d){if(_0x37c49b[_0x30a5('0x4a')]['id']){delete _0x37c49b[_0x30a5('0x4a')]['id'];}return db[_0x30a5('0x2d')][_0x30a5('0x48')]({'where':{'id':_0x37c49b[_0x30a5('0x4b')]['id']}})[_0x30a5('0x27')](handleEntityNotFound(_0x53637d,null))['then'](saveUpdates(_0x37c49b[_0x30a5('0x4a')],null))[_0x30a5('0x27')](respondWithResult(_0x53637d,null))[_0x30a5('0x46')](handleError(_0x53637d,null));};exports[_0x30a5('0x4c')]=function(_0x5e6e1a,_0x543351){return db['OpenchannelApplication'][_0x30a5('0x48')]({'where':{'id':_0x5e6e1a[_0x30a5('0x4b')]['id']}})[_0x30a5('0x27')](handleEntityNotFound(_0x543351,null))[_0x30a5('0x27')](removeEntity(_0x543351,null))['catch'](handleError(_0x543351,null));}; \ No newline at end of file +var _0x2aa3=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','findAll','rows','show','params','include','find','catch','create','update','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','name','send','OpenchannelApplication','rawAttributes','type','key','model','query','keys','intersection'];(function(_0x4afc2c,_0x336a88){var _0x164084=function(_0x14b783){while(--_0x14b783){_0x4afc2c['push'](_0x4afc2c['shift']());}};_0x164084(++_0x336a88);}(_0x2aa3,0xac));var _0x32aa=function(_0xd5e1e2,_0x20cc25){_0xd5e1e2=_0xd5e1e2-0x0;var _0x1e4605=_0x2aa3[_0xd5e1e2];return _0x1e4605;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x32aa('0x0'));var jsonpatch=require(_0x32aa('0x1'));var rp=require(_0x32aa('0x2'));var moment=require(_0x32aa('0x3'));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(_0x32aa('0xa'));var fs=require('fs');var fs_extra=require(_0x32aa('0xb'));var _=require(_0x32aa('0xc'));var squel=require(_0x32aa('0xd'));var crypto=require(_0x32aa('0xe'));var jsforce=require(_0x32aa('0xf'));var deskjs=require(_0x32aa('0x10'));var toCsv=require(_0x32aa('0x9'));var querystring=require(_0x32aa('0x11'));var Papa=require(_0x32aa('0x12'));var Redis=require(_0x32aa('0x13'));var authService=require(_0x32aa('0x14'));var qs=require(_0x32aa('0x15'));var as=require(_0x32aa('0x16'));var hardwareService=require(_0x32aa('0x17'));var logger=require(_0x32aa('0x18'))(_0x32aa('0x19'));var utils=require('../../config/utils');var config=require(_0x32aa('0x1a'));var licenseUtil=require(_0x32aa('0x1b'));var db=require(_0x32aa('0x1c'))['db'];function respondWithStatusCode(_0x558c85,_0x4f3b6f){_0x4f3b6f=_0x4f3b6f||0xcc;return function(_0x2783c3){if(_0x2783c3){return _0x558c85[_0x32aa('0x1d')](_0x4f3b6f);}return _0x558c85[_0x32aa('0x1e')](_0x4f3b6f)[_0x32aa('0x1f')]();};}function respondWithResult(_0x2264a3,_0x4a459d){_0x4a459d=_0x4a459d||0xc8;return function(_0x241996){if(_0x241996){return _0x2264a3[_0x32aa('0x1e')](_0x4a459d)[_0x32aa('0x20')](_0x241996);}};}function respondWithFilteredResult(_0x2c8640,_0xe7e8a7){return function(_0x38782f){if(_0x38782f){var _0x769325=typeof _0xe7e8a7[_0x32aa('0x21')]===_0x32aa('0x22')&&typeof _0xe7e8a7[_0x32aa('0x23')]===_0x32aa('0x22');var _0x43fc1f=_0x38782f[_0x32aa('0x24')];var _0x4c1cd3=_0x769325?0x0:_0xe7e8a7[_0x32aa('0x21')];var _0x189a68=_0x769325?_0x38782f[_0x32aa('0x24')]:_0xe7e8a7[_0x32aa('0x21')]+_0xe7e8a7[_0x32aa('0x23')];var _0x105de2;if(_0x189a68>=_0x43fc1f){_0x189a68=_0x43fc1f;_0x105de2=0xc8;}else{_0x105de2=0xce;}_0x2c8640[_0x32aa('0x1e')](_0x105de2);return _0x2c8640['set'](_0x32aa('0x25'),_0x4c1cd3+'-'+_0x189a68+'/'+_0x43fc1f)['json'](_0x38782f);}return null;};}function patchUpdates(_0x3d8f86){return function(_0x9f9683){try{jsonpatch['apply'](_0x9f9683,_0x3d8f86,!![]);}catch(_0x3d6215){return BPromise[_0x32aa('0x26')](_0x3d6215);}return _0x9f9683[_0x32aa('0x27')]();};}function saveUpdates(_0x35e10b,_0x2499b5){return function(_0x5bade7){if(_0x5bade7){return _0x5bade7['update'](_0x35e10b)[_0x32aa('0x28')](function(_0x157744){return _0x157744;});}return null;};}function removeEntity(_0x171cdd,_0x2e2eaa){return function(_0x2d7fcd){if(_0x2d7fcd){return _0x2d7fcd[_0x32aa('0x29')]()[_0x32aa('0x28')](function(){_0x171cdd[_0x32aa('0x1e')](0xcc)[_0x32aa('0x1f')]();});}};}function handleEntityNotFound(_0x58ee2c,_0x171e6a){return function(_0x1726af){if(!_0x1726af){_0x58ee2c['sendStatus'](0x194);}return _0x1726af;};}function handleError(_0x5bc7ae,_0x3421bf){_0x3421bf=_0x3421bf||0x1f4;return function(_0x2c7633){logger[_0x32aa('0x2a')](_0x2c7633['stack']);if(_0x2c7633[_0x32aa('0x2b')]){delete _0x2c7633[_0x32aa('0x2b')];}_0x5bc7ae[_0x32aa('0x1e')](_0x3421bf)[_0x32aa('0x2c')](_0x2c7633);};}exports['index']=function(_0x419475,_0x5afff2){var _0x5c0abf={},_0x3bc633={},_0x14eb8f={'count':0x0,'rows':[]};var _0x382869=_['map'](db[_0x32aa('0x2d')][_0x32aa('0x2e')],function(_0x25e75b){return{'name':_0x25e75b['fieldName'],'type':_0x25e75b[_0x32aa('0x2f')][_0x32aa('0x30')]};});_0x3bc633[_0x32aa('0x31')]=_['map'](_0x382869,_0x32aa('0x2b'));_0x3bc633[_0x32aa('0x32')]=_[_0x32aa('0x33')](_0x419475['query']);_0x3bc633['filters']=_[_0x32aa('0x34')](_0x3bc633[_0x32aa('0x31')],_0x3bc633[_0x32aa('0x32')]);_0x5c0abf[_0x32aa('0x35')]=_[_0x32aa('0x34')](_0x3bc633['model'],qs[_0x32aa('0x36')](_0x419475[_0x32aa('0x32')]['fields']));_0x5c0abf[_0x32aa('0x35')]=_0x5c0abf['attributes'][_0x32aa('0x37')]?_0x5c0abf[_0x32aa('0x35')]:_0x3bc633[_0x32aa('0x31')];if(!_0x419475['query'][_0x32aa('0x38')](_0x32aa('0x39'))){_0x5c0abf[_0x32aa('0x23')]=qs[_0x32aa('0x23')](_0x419475[_0x32aa('0x32')]['limit']);_0x5c0abf[_0x32aa('0x21')]=qs['offset'](_0x419475[_0x32aa('0x32')][_0x32aa('0x21')]);}_0x5c0abf[_0x32aa('0x3a')]=qs[_0x32aa('0x3b')](_0x419475['query'][_0x32aa('0x3b')]);_0x5c0abf[_0x32aa('0x3c')]=qs[_0x32aa('0x3d')](_[_0x32aa('0x3e')](_0x419475['query'],_0x3bc633[_0x32aa('0x3d')]),_0x382869);if(_0x419475[_0x32aa('0x32')][_0x32aa('0x3f')]){_0x5c0abf['where']=_['merge'](_0x5c0abf[_0x32aa('0x3c')],{'$or':_['map'](_0x382869,function(_0x5437a6){if(_0x5437a6['type']!=='VIRTUAL'){var _0x585871={};_0x585871[_0x5437a6[_0x32aa('0x2b')]]={'$like':'%'+_0x419475[_0x32aa('0x32')][_0x32aa('0x3f')]+'%'};return _0x585871;}})});}_0x5c0abf=_['merge']({},_0x5c0abf,_0x419475['options']);var _0x309a45={'where':_0x5c0abf[_0x32aa('0x3c')]};return db[_0x32aa('0x2d')][_0x32aa('0x24')](_0x309a45)[_0x32aa('0x28')](function(_0x5c2022){_0x14eb8f[_0x32aa('0x24')]=_0x5c2022;if(_0x419475[_0x32aa('0x32')][_0x32aa('0x40')]){_0x5c0abf['include']=[{'all':!![]}];}return db[_0x32aa('0x2d')][_0x32aa('0x41')](_0x5c0abf);})[_0x32aa('0x28')](function(_0x356a41){_0x14eb8f[_0x32aa('0x42')]=_0x356a41;return _0x14eb8f;})['then'](respondWithFilteredResult(_0x5afff2,_0x5c0abf))['catch'](handleError(_0x5afff2,null));};exports[_0x32aa('0x43')]=function(_0x4d2f67,_0x53ff79){var _0x481796={'raw':!![],'where':{'id':_0x4d2f67[_0x32aa('0x44')]['id']}},_0x9fe69f={};_0x9fe69f['model']=_[_0x32aa('0x33')](db[_0x32aa('0x2d')][_0x32aa('0x2e')]);_0x9fe69f[_0x32aa('0x32')]=_[_0x32aa('0x33')](_0x4d2f67[_0x32aa('0x32')]);_0x9fe69f['filters']=_[_0x32aa('0x34')](_0x9fe69f[_0x32aa('0x31')],_0x9fe69f[_0x32aa('0x32')]);_0x481796[_0x32aa('0x35')]=_[_0x32aa('0x34')](_0x9fe69f[_0x32aa('0x31')],qs['fields'](_0x4d2f67['query'][_0x32aa('0x36')]));_0x481796[_0x32aa('0x35')]=_0x481796['attributes']['length']?_0x481796[_0x32aa('0x35')]:_0x9fe69f[_0x32aa('0x31')];if(_0x4d2f67[_0x32aa('0x32')][_0x32aa('0x40')]){_0x481796[_0x32aa('0x45')]=[{'all':!![]}];}_0x481796=_['merge']({},_0x481796,_0x4d2f67['options']);return db[_0x32aa('0x2d')][_0x32aa('0x46')](_0x481796)['then'](handleEntityNotFound(_0x53ff79,null))['then'](respondWithResult(_0x53ff79,null))[_0x32aa('0x47')](handleError(_0x53ff79,null));};exports[_0x32aa('0x48')]=function(_0x322291,_0x1c8ae4){return db[_0x32aa('0x2d')]['create'](_0x322291['body'],{})[_0x32aa('0x28')](respondWithResult(_0x1c8ae4,0xc9))[_0x32aa('0x47')](handleError(_0x1c8ae4,null));};exports[_0x32aa('0x49')]=function(_0x3ee13c,_0x3b7496){if(_0x3ee13c['body']['id']){delete _0x3ee13c[_0x32aa('0x4a')]['id'];}return db[_0x32aa('0x2d')][_0x32aa('0x46')]({'where':{'id':_0x3ee13c[_0x32aa('0x44')]['id']}})[_0x32aa('0x28')](handleEntityNotFound(_0x3b7496,null))[_0x32aa('0x28')](saveUpdates(_0x3ee13c[_0x32aa('0x4a')],null))[_0x32aa('0x28')](respondWithResult(_0x3b7496,null))['catch'](handleError(_0x3b7496,null));};exports[_0x32aa('0x29')]=function(_0x4bb732,_0x264ff2){return db[_0x32aa('0x2d')][_0x32aa('0x46')]({'where':{'id':_0x4bb732['params']['id']}})[_0x32aa('0x28')](handleEntityNotFound(_0x264ff2,null))[_0x32aa('0x28')](removeEntity(_0x264ff2,null))[_0x32aa('0x47')](handleError(_0x264ff2,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 908f92f..a7741c8 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 _0x1629=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x1629,0x1ae));var _0x9162=function(_0x568704,_0xc49285){_0x568704=_0x568704-0x0;var _0x5a4779=_0x1629[_0x568704];return _0x5a4779;};'use strict';var _=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var logger=require(_0x9162('0x2'))(_0x9162('0x3'));var moment=require(_0x9162('0x4'));var BPromise=require(_0x9162('0x5'));var rp=require(_0x9162('0x6'));var fs=require('fs');var path=require(_0x9162('0x7'));var rimraf=require(_0x9162('0x8'));var config=require(_0x9162('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x9162('0xa')]=function(_0x28e53d,_0x2623dd){return _0x28e53d[_0x9162('0xb')](_0x9162('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9162('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x07b5=['./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e8ebd,_0x57eebe){var _0x336446=function(_0xcdb00d){while(--_0xcdb00d){_0x1e8ebd['push'](_0x1e8ebd['shift']());}};_0x336446(++_0x57eebe);}(_0x07b5,0x163));var _0x507b=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0x07b5[_0xae1a83];return _0xdb9da8;};'use strict';var _=require(_0x507b('0x0'));var util=require(_0x507b('0x1'));var logger=require(_0x507b('0x2'))(_0x507b('0x3'));var moment=require(_0x507b('0x4'));var BPromise=require(_0x507b('0x5'));var rp=require(_0x507b('0x6'));var fs=require('fs');var path=require(_0x507b('0x7'));var rimraf=require(_0x507b('0x8'));var config=require('../../config/environment');var attributes=require(_0x507b('0x9'));module[_0x507b('0xa')]=function(_0x453aaf,_0x5753b0){return _0x453aaf[_0x507b('0xb')]('OpenchannelApplication',attributes,{'tableName':_0x507b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x507b('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 6164b01..c2f11a9 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 _0x63e0=['client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x63e0,0xc2));var _0x063e=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x63e0[_0x23b655];return _0x364b32;};'use strict';var _=require(_0x063e('0x0'));var util=require(_0x063e('0x1'));var moment=require(_0x063e('0x2'));var BPromise=require(_0x063e('0x3'));var rs=require(_0x063e('0x4'));var fs=require('fs');var Redis=require(_0x063e('0x5'));var db=require(_0x063e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x063e('0x7'));var jayson=require(_0x063e('0x8'));var client=jayson[_0x063e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444944,_0x591eb0,_0x4ebadf){return new BPromise(function(_0xeee305,_0x424c9f){return client[_0x063e('0xa')](_0x444944,_0x4ebadf)[_0x063e('0xb')](function(_0x16be57){logger[_0x063e('0xc')](_0x063e('0xd'),_0x591eb0,_0x063e('0xe'));logger[_0x063e('0xf')](_0x063e('0x10'),_0x591eb0,_0x063e('0xe'),JSON[_0x063e('0x11')](_0x16be57));if(_0x16be57[_0x063e('0x12')]){if(_0x16be57['error'][_0x063e('0x13')]===0x1f4){logger[_0x063e('0x12')](_0x063e('0xd'),_0x591eb0,_0x16be57[_0x063e('0x12')]['message']);return _0x424c9f(_0x16be57[_0x063e('0x12')][_0x063e('0x14')]);}logger[_0x063e('0x12')](_0x063e('0xd'),_0x591eb0,_0x16be57[_0x063e('0x12')]['message']);return _0xeee305(_0x16be57[_0x063e('0x12')][_0x063e('0x14')]);}else{logger[_0x063e('0xc')](_0x063e('0xd'),_0x591eb0,_0x063e('0xe'));_0xeee305(_0x16be57[_0x063e('0x15')][_0x063e('0x14')]);}})['catch'](function(_0xcad62d){logger[_0x063e('0x12')](_0x063e('0xd'),_0x591eb0,_0xcad62d);_0x424c9f(_0xcad62d);});});}exports[_0x063e('0x16')]=function(_0x54dfc9){var _0x38cdb0=this;return new Promise(function(_0x3667be,_0x412eac){return db[_0x063e('0x17')]['update'](_0x54dfc9[_0x063e('0x18')],{'raw':_0x54dfc9[_0x063e('0x19')]?_0x54dfc9[_0x063e('0x19')][_0x063e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54dfc9[_0x063e('0x19')]?_0x54dfc9[_0x063e('0x19')]['where']||null:null,'attributes':_0x54dfc9[_0x063e('0x19')]?_0x54dfc9[_0x063e('0x19')]['attributes']||null:null,'limit':_0x54dfc9['options']?_0x54dfc9[_0x063e('0x19')][_0x063e('0x1b')]||null:null})[_0x063e('0xb')](function(_0x26db59){logger[_0x063e('0xc')](_0x063e('0x16'),_0x54dfc9);logger['debug'](_0x063e('0x16'),_0x54dfc9,JSON[_0x063e('0x11')](_0x26db59));_0x3667be(_0x26db59);})[_0x063e('0x1c')](function(_0x3b1731){logger['error'](_0x063e('0x16'),_0x3b1731[_0x063e('0x14')],_0x54dfc9);_0x412eac(_0x38cdb0[_0x063e('0x12')](0x1f4,_0x3b1731[_0x063e('0x14')]));});});}; \ No newline at end of file +var _0xb186=['request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x29e48e,_0x2ecb0b){var _0x4a7644=function(_0x327349){while(--_0x327349){_0x29e48e['push'](_0x29e48e['shift']());}};_0x4a7644(++_0x2ecb0b);}(_0xb186,0xa9));var _0x6b18=function(_0x25483f,_0x43852f){_0x25483f=_0x25483f-0x0;var _0x220d13=_0xb186[_0x25483f];return _0x220d13;};'use strict';var _=require(_0x6b18('0x0'));var util=require('util');var moment=require(_0x6b18('0x1'));var BPromise=require(_0x6b18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b18('0x3'));var db=require(_0x6b18('0x4'))['db'];var utils=require(_0x6b18('0x5'));var logger=require(_0x6b18('0x6'))(_0x6b18('0x7'));var config=require(_0x6b18('0x8'));var jayson=require(_0x6b18('0x9'));var client=jayson['client'][_0x6b18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xef9bdf,_0x87251b,_0x47d45a){return new BPromise(function(_0x536795,_0x1a72b9){return client[_0x6b18('0xb')](_0xef9bdf,_0x47d45a)[_0x6b18('0xc')](function(_0x2695be){logger['info'](_0x6b18('0xd'),_0x87251b,'request\x20sent');logger[_0x6b18('0xe')](_0x6b18('0xf'),_0x87251b,'request\x20sent',JSON[_0x6b18('0x10')](_0x2695be));if(_0x2695be[_0x6b18('0x11')]){if(_0x2695be['error'][_0x6b18('0x12')]===0x1f4){logger[_0x6b18('0x11')](_0x6b18('0xd'),_0x87251b,_0x2695be[_0x6b18('0x11')]['message']);return _0x1a72b9(_0x2695be[_0x6b18('0x11')][_0x6b18('0x13')]);}logger[_0x6b18('0x11')](_0x6b18('0xd'),_0x87251b,_0x2695be[_0x6b18('0x11')]['message']);return _0x536795(_0x2695be[_0x6b18('0x11')]['message']);}else{logger[_0x6b18('0x14')](_0x6b18('0xd'),_0x87251b,_0x6b18('0x15'));_0x536795(_0x2695be['result'][_0x6b18('0x13')]);}})[_0x6b18('0x16')](function(_0x2619f1){logger[_0x6b18('0x11')](_0x6b18('0xd'),_0x87251b,_0x2619f1);_0x1a72b9(_0x2619f1);});});}exports[_0x6b18('0x17')]=function(_0x25c526){var _0x57debe=this;return new Promise(function(_0x34ff7a,_0x1f5085){return db[_0x6b18('0x18')][_0x6b18('0x19')](_0x25c526[_0x6b18('0x1a')],{'raw':_0x25c526[_0x6b18('0x1b')]?_0x25c526[_0x6b18('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25c526[_0x6b18('0x1b')]?_0x25c526[_0x6b18('0x1b')][_0x6b18('0x1c')]||null:null,'attributes':_0x25c526[_0x6b18('0x1b')]?_0x25c526['options'][_0x6b18('0x1d')]||null:null,'limit':_0x25c526[_0x6b18('0x1b')]?_0x25c526[_0x6b18('0x1b')]['limit']||null:null})[_0x6b18('0xc')](function(_0x38964a){logger[_0x6b18('0x14')]('UpdateOpenchannelApplication',_0x25c526);logger['debug'](_0x6b18('0x17'),_0x25c526,JSON['stringify'](_0x38964a));_0x34ff7a(_0x38964a);})[_0x6b18('0x16')](function(_0x1a5978){logger['error']('UpdateOpenchannelApplication',_0x1a5978[_0x6b18('0x13')],_0x25c526);_0x1f5085(_0x57debe[_0x6b18('0x11')](0x1f4,_0x1a5978[_0x6b18('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 045e725..2e90fb7 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 _0x809c=['util','path','connect-timeout','express','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x8d5813,_0x3a8fdb){var _0x3817fb=function(_0xff13d6){while(--_0xff13d6){_0x8d5813['push'](_0x8d5813['shift']());}};_0x3817fb(++_0x3a8fdb);}(_0x809c,0x1ee));var _0xc809=function(_0x5eb980,_0x3941ff){_0x5eb980=_0x5eb980-0x0;var _0x4c2a4c=_0x809c[_0x5eb980];return _0x4c2a4c;};'use strict';var multer=require(_0xc809('0x0'));var util=require(_0xc809('0x1'));var path=require(_0xc809('0x2'));var timeout=require(_0xc809('0x3'));var express=require(_0xc809('0x4'));var router=express['Router']();var fs_extra=require(_0xc809('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc809('0x6'));router[_0xc809('0x7')]('/',auth[_0xc809('0x8')](),controller[_0xc809('0x9')]);router['get'](_0xc809('0xa'),auth[_0xc809('0x8')](),controller[_0xc809('0xb')]);router[_0xc809('0x7')](_0xc809('0xc'),auth[_0xc809('0x8')](),controller[_0xc809('0xd')]);router['get'](_0xc809('0xe'),auth['isAuthenticated'](),controller[_0xc809('0xf')]);router[_0xc809('0x7')](_0xc809('0x10'),auth[_0xc809('0x8')](),controller['download']);router['post']('/',auth[_0xc809('0x8')](),controller[_0xc809('0x11')]);router[_0xc809('0x12')]('/:id/messages',auth[_0xc809('0x8')](),controller[_0xc809('0x13')]);router['post'](_0xc809('0x14'),auth['isAuthenticated'](),interaction[_0xc809('0x15')](_0xc809('0x16'),_0xc809('0x17')),controller[_0xc809('0x18')]);router[_0xc809('0x19')](_0xc809('0xc'),auth['isAuthenticated'](),interaction[_0xc809('0x15')](_0xc809('0x16'),_0xc809('0x1a')),controller[_0xc809('0x1b')]);router[_0xc809('0x1c')](_0xc809('0xc'),auth[_0xc809('0x8')](),interaction[_0xc809('0x15')](_0xc809('0x16'),_0xc809('0x1d')),controller[_0xc809('0x1e')]);router[_0xc809('0x1c')](_0xc809('0x14'),auth[_0xc809('0x8')](),controller[_0xc809('0x1f')]);module[_0xc809('0x20')]=router; \ No newline at end of file +var _0x272f=['describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0xbf098b,_0x269d81){var _0x2f1446=function(_0xa84d24){while(--_0xa84d24){_0xbf098b['push'](_0xbf098b['shift']());}};_0x2f1446(++_0x269d81);}(_0x272f,0xa8));var _0xf272=function(_0xb2cb0b,_0x564603){_0xb2cb0b=_0xb2cb0b-0x0;var _0x3d4fe8=_0x272f[_0xb2cb0b];return _0x3d4fe8;};'use strict';var multer=require(_0xf272('0x0'));var util=require(_0xf272('0x1'));var path=require(_0xf272('0x2'));var timeout=require('connect-timeout');var express=require(_0xf272('0x3'));var router=express[_0xf272('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf272('0x5'));var config=require(_0xf272('0x6'));var controller=require(_0xf272('0x7'));router[_0xf272('0x8')]('/',auth[_0xf272('0x9')](),controller[_0xf272('0xa')]);router[_0xf272('0x8')](_0xf272('0xb'),auth[_0xf272('0x9')](),controller[_0xf272('0xc')]);router[_0xf272('0x8')](_0xf272('0xd'),auth[_0xf272('0x9')](),controller[_0xf272('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xf272('0xf')]);router[_0xf272('0x8')](_0xf272('0x10'),auth[_0xf272('0x9')](),controller[_0xf272('0x11')]);router[_0xf272('0x12')]('/',auth[_0xf272('0x9')](),controller['create']);router['post'](_0xf272('0x13'),auth[_0xf272('0x9')](),controller['addMessage']);router[_0xf272('0x12')](_0xf272('0x14'),auth[_0xf272('0x9')](),interaction[_0xf272('0x15')](_0xf272('0x16'),_0xf272('0x17')),controller['addTags']);router[_0xf272('0x18')](_0xf272('0xd'),auth[_0xf272('0x9')](),interaction[_0xf272('0x15')](_0xf272('0x16'),_0xf272('0x19')),controller['update']);router[_0xf272('0x1a')]('/:id',auth[_0xf272('0x9')](),interaction[_0xf272('0x15')](_0xf272('0x16'),_0xf272('0x1b')),controller[_0xf272('0x1c')]);router[_0xf272('0x1a')](_0xf272('0x14'),auth[_0xf272('0x9')](),controller['removeTags']);module[_0xf272('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index deb21a8..e7d979c 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 _0x295f=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x178b31,_0x29dd58){var _0x251b81=function(_0x50b58b){while(--_0x50b58b){_0x178b31['push'](_0x178b31['shift']());}};_0x251b81(++_0x29dd58);}(_0x295f,0x168));var _0xf295=function(_0x3121a6,_0x1da914){_0x3121a6=_0x3121a6-0x0;var _0x4f08e8=_0x295f[_0x3121a6];return _0x4f08e8;};'use strict';var Sequelize=require('sequelize');module[_0xf295('0x0')]={'closed':{'type':Sequelize[_0xf295('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf295('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf295('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf295('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xf295('0x3')]},'externalUrl':{'type':Sequelize[_0xf295('0x3')]},'lastMsgAt':{'type':Sequelize[_0xf295('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf295('0x4')]('in',_0xf295('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf295('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf295('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xf295('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xf4dd=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x381284,_0xe9b91e){var _0x2683aa=function(_0x1b770c){while(--_0x1b770c){_0x381284['push'](_0x381284['shift']());}};_0x2683aa(++_0xe9b91e);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xf4dd[_0x383dbb];return _0x6e8bde;};'use strict';var Sequelize=require(_0xdf4d('0x0'));module[_0xdf4d('0x1')]={'closed':{'type':Sequelize[_0xdf4d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdf4d('0x3')]},'disposition':{'type':Sequelize[_0xdf4d('0x4')]},'secondDisposition':{'type':Sequelize[_0xdf4d('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdf4d('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xdf4d('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xdf4d('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xdf4d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xdf4d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xdf4d('0x4')]},'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 2242185..e3118be 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 _0x73cb=['model','keys','filters','intersection','fields','attributes','length','merge','options','OpenchannelInteraction','find','catch','create','body','describe','addMessage','omit','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','download','toString','root','join','server','files','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','secret','read','Account','Owner','mkdirSync','Openchannel','N.A.','closedAt','disposition','Public','Private','basename','pipe','createWriteStream','direction','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','index','map','rawAttributes','type','key','getOptions','findAll','query','user','show','from','params'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x73cb,0x1cd));var _0xb73c=function(_0x47497e,_0x107eb1){_0x47497e=_0x47497e-0x0;var _0x132719=_0x73cb[_0x47497e];return _0x132719;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb73c('0x0'));var moment=require('moment');var util=require('util');var path=require(_0xb73c('0x1'));var ejs=require(_0xb73c('0x2'));var fs=require('fs');var _=require(_0xb73c('0x3'));var Redis=require(_0xb73c('0x4'));var interaction=require(_0xb73c('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0xb73c('0x6'));var logger=require(_0xb73c('0x7'))(_0xb73c('0x8'));var config=require('../../config/environment');var db=require(_0xb73c('0x9'))['db'];config[_0xb73c('0xa')]=_['defaults'](config[_0xb73c('0xa')],{'host':_0xb73c('0xb'),'port':0x18eb});var socket=require(_0xb73c('0xc'))(new Redis(config[_0xb73c('0xa')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4400ed,_0x56b80a){_0x56b80a=_0x56b80a||0xcc;return function(_0x21fab1){if(_0x21fab1){return _0x4400ed[_0xb73c('0xd')](_0x56b80a);}return _0x4400ed[_0xb73c('0xe')](_0x56b80a)[_0xb73c('0xf')]();};}function respondWithResult(_0x5d1b32,_0x364f32){_0x364f32=_0x364f32||0xc8;return function(_0x320000){if(_0x320000){return _0x5d1b32[_0xb73c('0xe')](_0x364f32)[_0xb73c('0x10')](_0x320000);}};}function respondWithFilteredResult(_0xaf4bdc,_0x51c902){return function(_0x457c2a){if(_0x457c2a){var _0x30dc90=typeof _0x51c902[_0xb73c('0x11')]===_0xb73c('0x12')&&typeof _0x51c902[_0xb73c('0x13')]===_0xb73c('0x12');var _0xbb41ab=_0x457c2a[_0xb73c('0x14')];var _0x2a3862=_0x30dc90?0x0:_0x51c902[_0xb73c('0x11')];var _0x179d8f=_0x30dc90?_0x457c2a[_0xb73c('0x14')]:_0x51c902[_0xb73c('0x11')]+_0x51c902[_0xb73c('0x13')];var _0x14a1b2;if(_0x179d8f>=_0xbb41ab){_0x179d8f=_0xbb41ab;_0x14a1b2=0xc8;}else{_0x14a1b2=0xce;}_0xaf4bdc[_0xb73c('0xe')](_0x14a1b2);return _0xaf4bdc[_0xb73c('0x15')]('Content-Range',_0x2a3862+'-'+_0x179d8f+'/'+_0xbb41ab)[_0xb73c('0x10')](_0x457c2a);}return null;};}function saveUpdates(_0xad785b){return function(_0x52242a){if(_0x52242a){return _0x52242a[_0xb73c('0x16')](_0xad785b)['then'](function(_0x30b2a4){return _0x30b2a4;});}return null;};}function removeEntity(_0x455182){return function(_0x43d8db){if(_0x43d8db){return _0x43d8db['destroy']()[_0xb73c('0x17')](function(){_0x455182['status'](0xcc)[_0xb73c('0xf')]();});}};}function handleEntityNotFound(_0x534315){return function(_0x42cad2){if(!_0x42cad2){_0x534315[_0xb73c('0xd')](0x194);}return _0x42cad2;};}function handleError(_0x2cdce7,_0x12b198){_0x12b198=_0x12b198||0x1f4;return function(_0x3d5461){logger[_0xb73c('0x18')](_0x3d5461[_0xb73c('0x19')]);if(_0x3d5461['name']){delete _0x3d5461[_0xb73c('0x1a')];}_0x2cdce7[_0xb73c('0xe')](_0x12b198)['send'](_0x3d5461);};}exports[_0xb73c('0x1b')]=function(_0x1def8c,_0x594744){var _0x122800={};var _0x392a46=_[_0xb73c('0x1c')](db['OpenchannelInteraction'][_0xb73c('0x1d')],function(_0x412fd9){return{'name':_0x412fd9['fieldName'],'type':_0x412fd9[_0xb73c('0x1e')][_0xb73c('0x1f')]};});_0x122800=qs[_0xb73c('0x20')](_0x392a46,_0x1def8c);return interaction[_0xb73c('0x21')]('openchannel',_0x1def8c[_0xb73c('0x22')],_0x1def8c[_0xb73c('0x23')],_0x122800,_0x392a46)[_0xb73c('0x17')](respondWithFilteredResult(_0x594744,_0x122800))['catch'](handleError(_0x594744,null));};exports[_0xb73c('0x24')]=function(_0x5efbe9,_0x12d70a){var _0x46ee7f={};if(_0x5efbe9[_0xb73c('0x22')][_0xb73c('0x1e')]&&_0x5efbe9[_0xb73c('0x22')][_0xb73c('0x1e')]===_0xb73c('0x25')){_0x46ee7f[_0xb73c('0x25')]=_0x5efbe9[_0xb73c('0x26')]['id'];}else{_0x46ee7f['id']=_0x5efbe9[_0xb73c('0x26')]['id'];}var _0x348620={'raw':![],'where':_0x46ee7f},_0x36b0a8={};_0x36b0a8[_0xb73c('0x27')]=_[_0xb73c('0x28')](db['OpenchannelInteraction'][_0xb73c('0x1d')]);_0x36b0a8[_0xb73c('0x22')]=_[_0xb73c('0x28')](_0x5efbe9[_0xb73c('0x22')]);_0x36b0a8[_0xb73c('0x29')]=_['intersection'](_0x36b0a8['model'],_0x36b0a8['query']);_0x348620['attributes']=_[_0xb73c('0x2a')](_0x36b0a8[_0xb73c('0x27')],qs['fields'](_0x5efbe9[_0xb73c('0x22')][_0xb73c('0x2b')]));_0x348620[_0xb73c('0x2c')]=_0x348620[_0xb73c('0x2c')][_0xb73c('0x2d')]?_0x348620[_0xb73c('0x2c')]:_0x36b0a8[_0xb73c('0x27')];if(_0x5efbe9[_0xb73c('0x22')]['includeAll']){_0x348620['include']=[{'all':!![]}];}_0x348620=_[_0xb73c('0x2e')]({},_0x348620,_0x5efbe9[_0xb73c('0x2f')]);return db[_0xb73c('0x30')][_0xb73c('0x31')](_0x348620)[_0xb73c('0x17')](handleEntityNotFound(_0x12d70a,null))[_0xb73c('0x17')](respondWithResult(_0x12d70a,null))[_0xb73c('0x32')](handleError(_0x12d70a,null));};exports[_0xb73c('0x33')]=function(_0xa790cf,_0x57accd){return db['OpenchannelInteraction'][_0xb73c('0x33')](_0xa790cf[_0xb73c('0x34')],{})['then'](respondWithResult(_0x57accd,0xc9))[_0xb73c('0x32')](handleError(_0x57accd,null));};exports[_0xb73c('0x16')]=function(_0x3cdd09,_0x394da8){if(_0x3cdd09[_0xb73c('0x34')]['id']){delete _0x3cdd09[_0xb73c('0x34')]['id'];}return db[_0xb73c('0x30')][_0xb73c('0x31')]({'where':{'id':_0x3cdd09[_0xb73c('0x26')]['id']}})['then'](handleEntityNotFound(_0x394da8,null))[_0xb73c('0x17')](saveUpdates(_0x3cdd09[_0xb73c('0x34')],null))['then'](respondWithResult(_0x394da8,null))[_0xb73c('0x32')](handleError(_0x394da8,null));};exports['destroy']=function(_0x32df01,_0x2d7d27){return db[_0xb73c('0x30')]['find']({'where':{'id':_0x32df01['params']['id']}})[_0xb73c('0x17')](handleEntityNotFound(_0x2d7d27,null))[_0xb73c('0x17')](removeEntity(_0x2d7d27,null))[_0xb73c('0x32')](handleError(_0x2d7d27,null));};exports[_0xb73c('0x35')]=function(_0x34da68,_0x5a78e6){return db[_0xb73c('0x30')]['describe']()[_0xb73c('0x17')](respondWithResult(_0x5a78e6,null))[_0xb73c('0x32')](handleError(_0x5a78e6,null));};exports[_0xb73c('0x36')]=function(_0x431cc9,_0x2c52cc){return db['OpenchannelMessage'][_0xb73c('0x31')]({'where':{'id':_0x431cc9[_0xb73c('0x26')]['id']}})['then'](handleEntityNotFound(_0x2c52cc,null))[_0xb73c('0x17')](function(_0x2b7053){if(_0x2b7053){return _0x2b7053[_0xb73c('0x36')](_0x431cc9[_0xb73c('0x34')]['ids'],_[_0xb73c('0x37')](_0x431cc9['body'],[_0xb73c('0x38'),'id'])||{});}})[_0xb73c('0x17')](respondWithResult(_0x2c52cc,null))[_0xb73c('0x32')](handleError(_0x2c52cc,null));};exports[_0xb73c('0x39')]=function(_0x223a2e,_0x1bbf48){var _0x283ada={'raw':![],'where':{}};var _0x13c862={};var _0x1a48d0={'count':0x0,'rows':[]};return db[_0xb73c('0x30')][_0xb73c('0x3a')]({'where':{'id':_0x223a2e[_0xb73c('0x26')]['id']}})[_0xb73c('0x17')](handleEntityNotFound(_0x1bbf48,null))[_0xb73c('0x17')](function(_0x5d2c0b){if(_0x5d2c0b){_0x13c862['model']=_[_0xb73c('0x28')](db[_0xb73c('0x3b')][_0xb73c('0x1d')]);_0x13c862['query']=_[_0xb73c('0x28')](_0x223a2e['query']);_0x13c862[_0xb73c('0x29')]=_['intersection'](_0x13c862[_0xb73c('0x27')],_0x13c862[_0xb73c('0x22')]);_0x283ada[_0xb73c('0x2c')]=_[_0xb73c('0x2a')](_0x13c862[_0xb73c('0x27')],qs[_0xb73c('0x2b')](_0x223a2e[_0xb73c('0x22')][_0xb73c('0x2b')]));_0x283ada[_0xb73c('0x2c')]=_0x283ada['attributes']['length']?_0x283ada[_0xb73c('0x2c')]:_0x13c862['model'];if(!_0x223a2e['query'][_0xb73c('0x3c')](_0xb73c('0x3d'))){_0x283ada['limit']=qs[_0xb73c('0x13')](_0x223a2e[_0xb73c('0x22')]['limit']);_0x283ada['offset']=qs[_0xb73c('0x11')](_0x223a2e[_0xb73c('0x22')][_0xb73c('0x11')]);}_0x283ada[_0xb73c('0x3e')]=qs[_0xb73c('0x3f')](_0x223a2e['query']['sort']);_0x283ada[_0xb73c('0x40')]=qs['filters'](_[_0xb73c('0x41')](_0x223a2e['query'],_0x13c862[_0xb73c('0x29')]));_0x283ada['where'][_0xb73c('0x42')]=_0x5d2c0b['id'];if(_0x223a2e[_0xb73c('0x22')][_0xb73c('0x43')]){_0x283ada[_0xb73c('0x40')]=_[_0xb73c('0x2e')](_0x283ada[_0xb73c('0x40')],{'$or':_['map'](_0x283ada[_0xb73c('0x2c')],function(_0x4cf163){var _0x18bbeb={};_0x18bbeb[_0x4cf163]={'$like':'%'+_0x223a2e[_0xb73c('0x22')]['filter']+'%'};return _0x18bbeb;})});}if(_0x223a2e[_0xb73c('0x22')][_0xb73c('0x44')]){var _0x54ba9a=_0x223a2e[_0xb73c('0x22')][_0xb73c('0x44')][_0xb73c('0x45')](',');var _0x5c7171={};_0x5c7171[_0x54ba9a[0x0]]={'$gte':moment(_0x54ba9a[0x1])['format'](_0xb73c('0x46'))};_0x283ada[_0xb73c('0x40')]=_[_0xb73c('0x2e')](_0x283ada[_0xb73c('0x40')],_0x5c7171);}_0x283ada=_[_0xb73c('0x2e')]({},_0x283ada,_0x223a2e[_0xb73c('0x2f')]);return db[_0xb73c('0x3b')][_0xb73c('0x14')]({'where':_0x283ada['where']})[_0xb73c('0x17')](function(_0x9c585f){_0x1a48d0[_0xb73c('0x14')]=_0x9c585f;if(_0x223a2e['query'][_0xb73c('0x47')]){_0x283ada[_0xb73c('0x48')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb73c('0x21')](_0x283ada);})['then'](function(_0x20e9e0){_0x1a48d0['rows']=_0x20e9e0;return _0x1a48d0;});}})[_0xb73c('0x17')](respondWithFilteredResult(_0x1bbf48,_0x283ada))[_0xb73c('0x32')](handleError(_0x1bbf48,null));};exports[_0xb73c('0x49')]=function(_0x14f077,_0x4ddbd6){return db['OpenchannelInteraction'][_0xb73c('0x31')]({'where':{'id':_0x14f077['params']['id']}})[_0xb73c('0x17')](handleEntityNotFound(_0x4ddbd6,null))[_0xb73c('0x17')](function(_0x92501e){if(_0x92501e){return _0x92501e[_0xb73c('0x4a')](_0x14f077['body']['ids'],_[_0xb73c('0x37')](_0x14f077[_0xb73c('0x34')],[_0xb73c('0x38'),'id'])||{})[_0xb73c('0x4b')](function(){return db[_0xb73c('0x4c')]['findAll']({'attributes':['id',_0xb73c('0x1a'),_0xb73c('0x4d')],'where':{'id':_0x14f077[_0xb73c('0x34')][_0xb73c('0x38')]}});})[_0xb73c('0x17')](function(_0x25068d){socket[_0xb73c('0x4e')](_0xb73c('0x4f'),{'id':Number(_0x14f077[_0xb73c('0x26')]['id']),'tags':_0x25068d||[]});return{'id':Number(_0x14f077[_0xb73c('0x26')]['id']),'tags':_0x25068d||[]};});}})[_0xb73c('0x17')](respondWithResult(_0x4ddbd6,null))[_0xb73c('0x32')](handleError(_0x4ddbd6,null));};exports['removeTags']=function(_0x257f07,_0x2a40b1){return db[_0xb73c('0x30')][_0xb73c('0x31')]({'where':{'id':_0x257f07[_0xb73c('0x26')]['id']}})[_0xb73c('0x17')](handleEntityNotFound(_0x2a40b1,null))['then'](function(_0xd7824e){if(_0xd7824e){return _0xd7824e['removeTags'](_0x257f07[_0xb73c('0x22')][_0xb73c('0x38')]);}})[_0xb73c('0x17')](respondWithStatusCode(_0x2a40b1,null))['catch'](handleError(_0x2a40b1,null));};exports[_0xb73c('0x50')]=function(_0x434a41,_0x383f22){var _0x12e2dc=moment()['unix']()[_0xb73c('0x51')]();var _0xa24da8=path['join'](config[_0xb73c('0x52')],'server','files','tmp');var _0x4b273c=path[_0xb73c('0x53')](config[_0xb73c('0x52')],_0xb73c('0x54'),_0xb73c('0x55'),'attachments');var _0x1392c2=path['join'](_0xa24da8,_0x12e2dc);var _0x58cbe1=util[_0xb73c('0x56')](_0xb73c('0x57'),_0x434a41['params']['id'],_0x12e2dc);var _0x655966=path[_0xb73c('0x53')](_0xa24da8,_0x58cbe1);var _0x37cfaf=[];_0x37cfaf[_0xb73c('0x58')]({'model':db['User'],'as':_0xb73c('0x59'),'attributes':['id',_0xb73c('0x5a')],'raw':!![]});_0x37cfaf['push']({'model':db[_0xb73c('0x5b')],'as':_0xb73c('0x5c'),'attributes':['id','firstName',_0xb73c('0x5d')],'raw':!![]});if(_0x434a41['query'][_0xb73c('0x5e')]){_0x37cfaf[_0xb73c('0x58')]({'model':db[_0xb73c('0x5f')],'as':'Attachment','raw':!![]});}var _0x55497d=[{'model':db[_0xb73c('0x3b')],'as':_0xb73c('0x60'),'attributes':['id',_0xb73c('0x34'),_0xb73c('0x61'),'direction',_0xb73c('0x62'),_0xb73c('0x63')],'include':_0x37cfaf}];_0x55497d[_0xb73c('0x58')]({'model':db['OpenchannelAccount'],'as':_0xb73c('0x64'),'attributes':['id','name']});_0x55497d['push']({'model':db['User'],'as':_0xb73c('0x65'),'attributes':['id',_0xb73c('0x5a')]});return db[_0xb73c('0x30')]['find']({'where':{'id':_0x434a41[_0xb73c('0x26')]['id']},'include':_0x55497d})[_0xb73c('0x17')](handleEntityNotFound(_0x383f22,null))[_0xb73c('0x17')](function(_0x4a06b9){if(_0x4a06b9){var _0x4c6f0b=_0x4a06b9['get']({'plain':!![]});fs[_0xb73c('0x66')](_0x1392c2);var _0x1a5604={'channel':_0xb73c('0x67'),'account':_0x4c6f0b['Account'][_0xb73c('0x1a')],'agent':_0x4c6f0b['Owner']?_0x4c6f0b[_0xb73c('0x65')][_0xb73c('0x5a')]:_0xb73c('0x68'),'createdAt':moment(_0x4c6f0b[_0xb73c('0x61')])[_0xb73c('0x56')](_0xb73c('0x46'))['toString'](),'closedAt':_0x4c6f0b['closed']?moment(_0x4c6f0b[_0xb73c('0x69')])['format'](_0xb73c('0x46'))[_0xb73c('0x51')]():'','disposition':_0x4c6f0b[_0xb73c('0x6a')],'visibility':_0x4c6f0b['threadId']?_0xb73c('0x6b'):_0xb73c('0x6c'),'messages':_(_0x4c6f0b['Messages'])[_0xb73c('0x43')]({'secret':![]})[_0xb73c('0x1c')](function(_0x55c9d0){if(_0x55c9d0[_0xb73c('0x5f')]){var _0x1d4f3e=path[_0xb73c('0x53')](_0x4b273c,_0x55c9d0[_0xb73c('0x5f')][_0xb73c('0x6d')]);if(fs['existsSync'](_0x1d4f3e)){fs['createReadStream'](_0x1d4f3e)[_0xb73c('0x6e')](fs[_0xb73c('0x6f')](path['join'](_0x1392c2,_0x55c9d0[_0xb73c('0x5f')]['basename'])));}}return{'date':moment(_0x55c9d0[_0xb73c('0x61')])[_0xb73c('0x56')](_0xb73c('0x46'))['toString'](),'sender':_0x55c9d0[_0xb73c('0x70')]===_0xb73c('0x71')?_0x55c9d0[_0xb73c('0x59')]?_0x55c9d0[_0xb73c('0x59')][_0xb73c('0x5a')]:_0xb73c('0x72'):_0x55c9d0['Contact'][_0xb73c('0x73')]+(_0x55c9d0[_0xb73c('0x5c')][_0xb73c('0x5d')]?'\x20'+_0x55c9d0[_0xb73c('0x5c')]['lastName']:''),'body':_0x55c9d0[_0xb73c('0x5f')]?_0x55c9d0[_0xb73c('0x5f')]['basename']:_0x55c9d0['body'],'direction':_0x55c9d0['direction']==='out'?'A':'C','secret':_0x55c9d0[_0xb73c('0x62')],'read':_0x55c9d0['read'],'attachment':_0x55c9d0['Attachment']};})[_0xb73c('0x74')]()};return ejs[_0xb73c('0x75')](path[_0xb73c('0x53')](config[_0xb73c('0x52')],_0xb73c('0x54'),_0xb73c('0x76'),_0xb73c('0x77')),{'interaction':_0x1a5604})[_0xb73c('0x17')](function(_0x152484){var _0xb74c45=path[_0xb73c('0x53')](_0x1392c2,_0xb73c('0x78')+_0x4c6f0b['id']+'-'+_0x12e2dc+_0xb73c('0x79'));var _0x1521b9={'path':_0xb74c45,'channel':_0xb73c('0x67'),'interactionId':_0x4c6f0b['id']};return pdf[_0xb73c('0x7a')](_0x152484,_0x1521b9);})['then'](function(){return new Promise(function(_0x4414f9,_0x1b3b73){zipdir(_0x1392c2,{'saveTo':_0x655966},function(_0x404e04,_0x14b0be){if(_0x404e04)return _0x1b3b73(_0x404e04);return _0x4414f9(_0x14b0be);});})['then'](function(){return new Promise(function(_0x21979b,_0x2199b8){rimraf(_0x1392c2,function(_0xb6a6b5){if(_0xb6a6b5)_0x2199b8(_0xb6a6b5);return _0x21979b();});});})['then'](function(){return _0x383f22[_0xb73c('0x50')](_0x655966,_0x58cbe1,function(_0x526f63){if(_0x526f63){logger[_0xb73c('0x18')](_0xb73c('0x7b'),_0x526f63);}else{fs[_0xb73c('0x7c')](_0x655966);}});});});}else{return _0x383f22[_0xb73c('0xd')](0xc8);}})['catch'](handleError(_0x383f22,null));}; \ No newline at end of file +var _0xf64a=['create','body','find','describe','addMessage','ids','omit','getMessages','findOne','length','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','toString','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','Messages','direction','OpenchannelAccount','get','mkdirSync','Openchannel','Account','Owner','createdAt','closed','closedAt','Public','Private','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','secret','read','value','renderFile','root','views','transcript-','.pdf','createPdfFromHTML','download','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','end','status','offset','undefined','count','limit','set','json','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','OpenchannelInteraction'];(function(_0x498219,_0x28eb06){var _0x1e04c6=function(_0x59c2b7){while(--_0x59c2b7){_0x498219['push'](_0x498219['shift']());}};_0x1e04c6(++_0x28eb06);}(_0xf64a,0x1d9));var _0xaf64=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xf64a[_0x469a3c];return _0x968f4;};'use strict';var rimraf=require(_0xaf64('0x0'));var zipdir=require(_0xaf64('0x1'));var moment=require(_0xaf64('0x2'));var util=require(_0xaf64('0x3'));var path=require(_0xaf64('0x4'));var ejs=require(_0xaf64('0x5'));var fs=require('fs');var _=require(_0xaf64('0x6'));var Redis=require(_0xaf64('0x7'));var interaction=require(_0xaf64('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xaf64('0x9'))('api');var config=require(_0xaf64('0xa'));var db=require('../../mysqldb')['db'];config[_0xaf64('0xb')]=_[_0xaf64('0xc')](config['redis'],{'host':_0xaf64('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf64('0xb')]));require(_0xaf64('0xe'))['register'](socket);function respondWithStatusCode(_0x5ddbf2,_0xa12317){_0xa12317=_0xa12317||0xcc;return function(_0x119f65){if(_0x119f65){return _0x5ddbf2[_0xaf64('0xf')](_0xa12317);}return _0x5ddbf2['status'](_0xa12317)[_0xaf64('0x10')]();};}function respondWithResult(_0x4dd48d,_0x45b411){_0x45b411=_0x45b411||0xc8;return function(_0x575372){if(_0x575372){return _0x4dd48d[_0xaf64('0x11')](_0x45b411)['json'](_0x575372);}};}function respondWithFilteredResult(_0x3359fb,_0x21d830){return function(_0x1a7df2){if(_0x1a7df2){var _0x95ebc2=typeof _0x21d830[_0xaf64('0x12')]===_0xaf64('0x13')&&typeof _0x21d830['limit']===_0xaf64('0x13');var _0x32fa9f=_0x1a7df2[_0xaf64('0x14')];var _0x3d0b00=_0x95ebc2?0x0:_0x21d830[_0xaf64('0x12')];var _0x4d8023=_0x95ebc2?_0x1a7df2[_0xaf64('0x14')]:_0x21d830[_0xaf64('0x12')]+_0x21d830[_0xaf64('0x15')];var _0x5b09f8;if(_0x4d8023>=_0x32fa9f){_0x4d8023=_0x32fa9f;_0x5b09f8=0xc8;}else{_0x5b09f8=0xce;}_0x3359fb['status'](_0x5b09f8);return _0x3359fb[_0xaf64('0x16')]('Content-Range',_0x3d0b00+'-'+_0x4d8023+'/'+_0x32fa9f)[_0xaf64('0x17')](_0x1a7df2);}return null;};}function saveUpdates(_0x514075){return function(_0x56b879){if(_0x56b879){return _0x56b879[_0xaf64('0x18')](_0x514075)['then'](function(_0x3cd67d){return _0x3cd67d;});}return null;};}function removeEntity(_0x352a8f){return function(_0x3acc6b){if(_0x3acc6b){return _0x3acc6b[_0xaf64('0x19')]()[_0xaf64('0x1a')](function(){_0x352a8f[_0xaf64('0x11')](0xcc)[_0xaf64('0x10')]();});}};}function handleEntityNotFound(_0x1b9deb){return function(_0x2fff52){if(!_0x2fff52){_0x1b9deb[_0xaf64('0xf')](0x194);}return _0x2fff52;};}function handleError(_0x3ee55a,_0x1837dc){_0x1837dc=_0x1837dc||0x1f4;return function(_0x5465f7){logger[_0xaf64('0x1b')](_0x5465f7[_0xaf64('0x1c')]);if(_0x5465f7[_0xaf64('0x1d')]){delete _0x5465f7[_0xaf64('0x1d')];}_0x3ee55a[_0xaf64('0x11')](_0x1837dc)[_0xaf64('0x1e')](_0x5465f7);};}exports[_0xaf64('0x1f')]=function(_0x4b50c0,_0x5f4f24){var _0x427cb4={};var _0x4d27e9=_[_0xaf64('0x20')](db['OpenchannelInteraction'][_0xaf64('0x21')],function(_0x2b026d){return{'name':_0x2b026d[_0xaf64('0x22')],'type':_0x2b026d[_0xaf64('0x23')]['key']};});_0x427cb4=qs[_0xaf64('0x24')](_0x4d27e9,_0x4b50c0);return interaction[_0xaf64('0x25')](_0xaf64('0x26'),_0x4b50c0[_0xaf64('0x27')],_0x4b50c0[_0xaf64('0x28')],_0x427cb4,_0x4d27e9)[_0xaf64('0x1a')](respondWithFilteredResult(_0x5f4f24,_0x427cb4))[_0xaf64('0x29')](handleError(_0x5f4f24,null));};exports[_0xaf64('0x2a')]=function(_0x553c26,_0x5c0866){var _0x235b0d={};if(_0x553c26['query'][_0xaf64('0x23')]&&_0x553c26['query']['type']===_0xaf64('0x2b')){_0x235b0d[_0xaf64('0x2b')]=_0x553c26[_0xaf64('0x2c')]['id'];}else{_0x235b0d['id']=_0x553c26[_0xaf64('0x2c')]['id'];}var _0x331732={'raw':![],'where':_0x235b0d},_0x223b64={};_0x223b64[_0xaf64('0x2d')]=_[_0xaf64('0x2e')](db['OpenchannelInteraction'][_0xaf64('0x21')]);_0x223b64['query']=_[_0xaf64('0x2e')](_0x553c26[_0xaf64('0x27')]);_0x223b64[_0xaf64('0x2f')]=_[_0xaf64('0x30')](_0x223b64[_0xaf64('0x2d')],_0x223b64[_0xaf64('0x27')]);_0x331732[_0xaf64('0x31')]=_[_0xaf64('0x30')](_0x223b64['model'],qs[_0xaf64('0x32')](_0x553c26[_0xaf64('0x27')][_0xaf64('0x32')]));_0x331732[_0xaf64('0x31')]=_0x331732[_0xaf64('0x31')]['length']?_0x331732[_0xaf64('0x31')]:_0x223b64[_0xaf64('0x2d')];if(_0x553c26[_0xaf64('0x27')][_0xaf64('0x33')]){_0x331732[_0xaf64('0x34')]=[{'all':!![]}];}_0x331732=_['merge']({},_0x331732,_0x553c26[_0xaf64('0x35')]);return db[_0xaf64('0x36')]['find'](_0x331732)[_0xaf64('0x1a')](handleEntityNotFound(_0x5c0866,null))['then'](respondWithResult(_0x5c0866,null))[_0xaf64('0x29')](handleError(_0x5c0866,null));};exports[_0xaf64('0x37')]=function(_0x385109,_0x16483d){return db[_0xaf64('0x36')]['create'](_0x385109[_0xaf64('0x38')],{})[_0xaf64('0x1a')](respondWithResult(_0x16483d,0xc9))[_0xaf64('0x29')](handleError(_0x16483d,null));};exports[_0xaf64('0x18')]=function(_0x2b5b84,_0x55b275){if(_0x2b5b84[_0xaf64('0x38')]['id']){delete _0x2b5b84[_0xaf64('0x38')]['id'];}return db[_0xaf64('0x36')][_0xaf64('0x39')]({'where':{'id':_0x2b5b84[_0xaf64('0x2c')]['id']}})[_0xaf64('0x1a')](handleEntityNotFound(_0x55b275,null))[_0xaf64('0x1a')](saveUpdates(_0x2b5b84[_0xaf64('0x38')],null))[_0xaf64('0x1a')](respondWithResult(_0x55b275,null))[_0xaf64('0x29')](handleError(_0x55b275,null));};exports[_0xaf64('0x19')]=function(_0x5b4f93,_0x490d04){return db[_0xaf64('0x36')][_0xaf64('0x39')]({'where':{'id':_0x5b4f93[_0xaf64('0x2c')]['id']}})[_0xaf64('0x1a')](handleEntityNotFound(_0x490d04,null))[_0xaf64('0x1a')](removeEntity(_0x490d04,null))['catch'](handleError(_0x490d04,null));};exports[_0xaf64('0x3a')]=function(_0x585831,_0x21eaf1){return db[_0xaf64('0x36')][_0xaf64('0x3a')]()[_0xaf64('0x1a')](respondWithResult(_0x21eaf1,null))['catch'](handleError(_0x21eaf1,null));};exports[_0xaf64('0x3b')]=function(_0x537db3,_0x428e65){return db['OpenchannelMessage'][_0xaf64('0x39')]({'where':{'id':_0x537db3[_0xaf64('0x2c')]['id']}})['then'](handleEntityNotFound(_0x428e65,null))[_0xaf64('0x1a')](function(_0x484d4){if(_0x484d4){return _0x484d4['addMessage'](_0x537db3['body'][_0xaf64('0x3c')],_[_0xaf64('0x3d')](_0x537db3[_0xaf64('0x38')],[_0xaf64('0x3c'),'id'])||{});}})[_0xaf64('0x1a')](respondWithResult(_0x428e65,null))[_0xaf64('0x29')](handleError(_0x428e65,null));};exports[_0xaf64('0x3e')]=function(_0x43feb3,_0xa529c4){var _0x516d0f={'raw':![],'where':{}};var _0x2b694d={};var _0x3ad0ab={'count':0x0,'rows':[]};return db[_0xaf64('0x36')][_0xaf64('0x3f')]({'where':{'id':_0x43feb3['params']['id']}})[_0xaf64('0x1a')](handleEntityNotFound(_0xa529c4,null))[_0xaf64('0x1a')](function(_0x3e415f){if(_0x3e415f){_0x2b694d[_0xaf64('0x2d')]=_[_0xaf64('0x2e')](db['OpenchannelMessage'][_0xaf64('0x21')]);_0x2b694d[_0xaf64('0x27')]=_[_0xaf64('0x2e')](_0x43feb3['query']);_0x2b694d['filters']=_[_0xaf64('0x30')](_0x2b694d['model'],_0x2b694d[_0xaf64('0x27')]);_0x516d0f['attributes']=_[_0xaf64('0x30')](_0x2b694d[_0xaf64('0x2d')],qs[_0xaf64('0x32')](_0x43feb3['query']['fields']));_0x516d0f[_0xaf64('0x31')]=_0x516d0f['attributes'][_0xaf64('0x40')]?_0x516d0f['attributes']:_0x2b694d[_0xaf64('0x2d')];if(!_0x43feb3[_0xaf64('0x27')]['hasOwnProperty'](_0xaf64('0x41'))){_0x516d0f[_0xaf64('0x15')]=qs['limit'](_0x43feb3['query'][_0xaf64('0x15')]);_0x516d0f[_0xaf64('0x12')]=qs[_0xaf64('0x12')](_0x43feb3[_0xaf64('0x27')][_0xaf64('0x12')]);}_0x516d0f[_0xaf64('0x42')]=qs[_0xaf64('0x43')](_0x43feb3[_0xaf64('0x27')][_0xaf64('0x43')]);_0x516d0f[_0xaf64('0x44')]=qs[_0xaf64('0x2f')](_[_0xaf64('0x45')](_0x43feb3[_0xaf64('0x27')],_0x2b694d[_0xaf64('0x2f')]));_0x516d0f[_0xaf64('0x44')][_0xaf64('0x46')]=_0x3e415f['id'];if(_0x43feb3[_0xaf64('0x27')][_0xaf64('0x47')]){_0x516d0f[_0xaf64('0x44')]=_[_0xaf64('0x48')](_0x516d0f[_0xaf64('0x44')],{'$or':_[_0xaf64('0x20')](_0x516d0f[_0xaf64('0x31')],function(_0x45d52c){var _0x4aba2c={};_0x4aba2c[_0x45d52c]={'$like':'%'+_0x43feb3[_0xaf64('0x27')][_0xaf64('0x47')]+'%'};return _0x4aba2c;})});}if(_0x43feb3[_0xaf64('0x27')][_0xaf64('0x49')]){var _0x5e713c=_0x43feb3[_0xaf64('0x27')]['$gte'][_0xaf64('0x4a')](',');var _0x27301e={};_0x27301e[_0x5e713c[0x0]]={'$gte':moment(_0x5e713c[0x1])[_0xaf64('0x4b')](_0xaf64('0x4c'))};_0x516d0f[_0xaf64('0x44')]=_[_0xaf64('0x48')](_0x516d0f[_0xaf64('0x44')],_0x27301e);}_0x516d0f=_[_0xaf64('0x48')]({},_0x516d0f,_0x43feb3['options']);return db['OpenchannelMessage'][_0xaf64('0x14')]({'where':_0x516d0f[_0xaf64('0x44')]})['then'](function(_0x55f968){_0x3ad0ab[_0xaf64('0x14')]=_0x55f968;if(_0x43feb3[_0xaf64('0x27')][_0xaf64('0x33')]){_0x516d0f[_0xaf64('0x34')]=[{'all':!![]}];}return db[_0xaf64('0x4d')]['findAll'](_0x516d0f);})['then'](function(_0x4c1a56){_0x3ad0ab[_0xaf64('0x4e')]=_0x4c1a56;return _0x3ad0ab;});}})[_0xaf64('0x1a')](respondWithFilteredResult(_0xa529c4,_0x516d0f))['catch'](handleError(_0xa529c4,null));};exports[_0xaf64('0x4f')]=function(_0x4b6129,_0x1e12d1){return db[_0xaf64('0x36')][_0xaf64('0x39')]({'where':{'id':_0x4b6129[_0xaf64('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1e12d1,null))[_0xaf64('0x1a')](function(_0x263937){if(_0x263937){return _0x263937[_0xaf64('0x50')](_0x4b6129['body'][_0xaf64('0x3c')],_['omit'](_0x4b6129[_0xaf64('0x38')],['ids','id'])||{})[_0xaf64('0x51')](function(){return db[_0xaf64('0x52')]['findAll']({'attributes':['id','name',_0xaf64('0x53')],'where':{'id':_0x4b6129[_0xaf64('0x38')][_0xaf64('0x3c')]}});})['then'](function(_0x1ea800){socket[_0xaf64('0x54')](_0xaf64('0x55'),{'id':Number(_0x4b6129[_0xaf64('0x2c')]['id']),'tags':_0x1ea800||[]});return{'id':Number(_0x4b6129[_0xaf64('0x2c')]['id']),'tags':_0x1ea800||[]};});}})[_0xaf64('0x1a')](respondWithResult(_0x1e12d1,null))[_0xaf64('0x29')](handleError(_0x1e12d1,null));};exports[_0xaf64('0x56')]=function(_0x3841e1,_0x4b9b93){return db['OpenchannelInteraction'][_0xaf64('0x39')]({'where':{'id':_0x3841e1[_0xaf64('0x2c')]['id']}})[_0xaf64('0x1a')](handleEntityNotFound(_0x4b9b93,null))[_0xaf64('0x1a')](function(_0x4da4cc){if(_0x4da4cc){return _0x4da4cc[_0xaf64('0x56')](_0x3841e1[_0xaf64('0x27')][_0xaf64('0x3c')]);}})[_0xaf64('0x1a')](respondWithStatusCode(_0x4b9b93,null))[_0xaf64('0x29')](handleError(_0x4b9b93,null));};exports['download']=function(_0x396fb8,_0x409078){var _0x5210ef=moment()['unix']()[_0xaf64('0x57')]();var _0x2f1043=path['join'](config['root'],_0xaf64('0x58'),_0xaf64('0x59'),_0xaf64('0x5a'));var _0x4f63da=path['join'](config['root'],_0xaf64('0x58'),_0xaf64('0x59'),'attachments');var _0x434752=path[_0xaf64('0x5b')](_0x2f1043,_0x5210ef);var _0x2e62db=util['format'](_0xaf64('0x5c'),_0x396fb8[_0xaf64('0x2c')]['id'],_0x5210ef);var _0x53307f=path[_0xaf64('0x5b')](_0x2f1043,_0x2e62db);var _0x187106=[];_0x187106[_0xaf64('0x5d')]({'model':db[_0xaf64('0x5e')],'as':_0xaf64('0x5e'),'attributes':['id',_0xaf64('0x5f')],'raw':!![]});_0x187106[_0xaf64('0x5d')]({'model':db[_0xaf64('0x60')],'as':_0xaf64('0x61'),'attributes':['id',_0xaf64('0x62'),'lastName'],'raw':!![]});if(_0x396fb8[_0xaf64('0x27')][_0xaf64('0x63')]){_0x187106[_0xaf64('0x5d')]({'model':db[_0xaf64('0x64')],'as':_0xaf64('0x64'),'raw':!![]});}var _0x3dce3a=[{'model':db[_0xaf64('0x4d')],'as':_0xaf64('0x65'),'attributes':['id',_0xaf64('0x38'),'createdAt',_0xaf64('0x66'),'secret','read'],'include':_0x187106}];_0x3dce3a[_0xaf64('0x5d')]({'model':db[_0xaf64('0x67')],'as':'Account','attributes':['id',_0xaf64('0x1d')]});_0x3dce3a[_0xaf64('0x5d')]({'model':db['User'],'as':'Owner','attributes':['id',_0xaf64('0x5f')]});return db['OpenchannelInteraction'][_0xaf64('0x39')]({'where':{'id':_0x396fb8['params']['id']},'include':_0x3dce3a})[_0xaf64('0x1a')](handleEntityNotFound(_0x409078,null))[_0xaf64('0x1a')](function(_0x593530){if(_0x593530){var _0x36c76d=_0x593530[_0xaf64('0x68')]({'plain':!![]});fs[_0xaf64('0x69')](_0x434752);var _0x93e494={'channel':_0xaf64('0x6a'),'account':_0x36c76d[_0xaf64('0x6b')]['name'],'agent':_0x36c76d[_0xaf64('0x6c')]?_0x36c76d[_0xaf64('0x6c')][_0xaf64('0x5f')]:'N.A.','createdAt':moment(_0x36c76d[_0xaf64('0x6d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xaf64('0x57')](),'closedAt':_0x36c76d[_0xaf64('0x6e')]?moment(_0x36c76d[_0xaf64('0x6f')])[_0xaf64('0x4b')](_0xaf64('0x4c'))[_0xaf64('0x57')]():'','disposition':_0x36c76d['disposition'],'visibility':_0x36c76d['threadId']?_0xaf64('0x70'):_0xaf64('0x71'),'messages':_(_0x36c76d['Messages'])['filter']({'secret':![]})[_0xaf64('0x20')](function(_0x387ab4){if(_0x387ab4['Attachment']){var _0x25f1ef=path['join'](_0x4f63da,_0x387ab4['Attachment'][_0xaf64('0x72')]);if(fs[_0xaf64('0x73')](_0x25f1ef)){fs[_0xaf64('0x74')](_0x25f1ef)['pipe'](fs[_0xaf64('0x75')](path['join'](_0x434752,_0x387ab4[_0xaf64('0x64')][_0xaf64('0x72')])));}}return{'date':moment(_0x387ab4[_0xaf64('0x6d')])[_0xaf64('0x4b')](_0xaf64('0x4c'))['toString'](),'sender':_0x387ab4[_0xaf64('0x66')]===_0xaf64('0x76')?_0x387ab4[_0xaf64('0x5e')]?_0x387ab4[_0xaf64('0x5e')][_0xaf64('0x5f')]:_0xaf64('0x77'):_0x387ab4[_0xaf64('0x61')][_0xaf64('0x62')]+(_0x387ab4[_0xaf64('0x61')]['lastName']?'\x20'+_0x387ab4['Contact'][_0xaf64('0x78')]:''),'body':_0x387ab4[_0xaf64('0x64')]?_0x387ab4[_0xaf64('0x64')]['basename']:_0x387ab4[_0xaf64('0x38')],'direction':_0x387ab4[_0xaf64('0x66')]===_0xaf64('0x76')?'A':'C','secret':_0x387ab4[_0xaf64('0x79')],'read':_0x387ab4[_0xaf64('0x7a')],'attachment':_0x387ab4[_0xaf64('0x64')]};})[_0xaf64('0x7b')]()};return ejs[_0xaf64('0x7c')](path[_0xaf64('0x5b')](config[_0xaf64('0x7d')],_0xaf64('0x58'),_0xaf64('0x7e'),'downloadInteraction.ejs'),{'interaction':_0x93e494})[_0xaf64('0x1a')](function(_0x4a9172){var _0xb94f73=path['join'](_0x434752,_0xaf64('0x7f')+_0x36c76d['id']+'-'+_0x5210ef+_0xaf64('0x80'));var _0x39adc8={'path':_0xb94f73,'channel':_0xaf64('0x6a'),'interactionId':_0x36c76d['id']};return pdf[_0xaf64('0x81')](_0x4a9172,_0x39adc8);})['then'](function(){return new Promise(function(_0x2d6b58,_0x50d67e){zipdir(_0x434752,{'saveTo':_0x53307f},function(_0xd82aef,_0x16356c){if(_0xd82aef)return _0x50d67e(_0xd82aef);return _0x2d6b58(_0x16356c);});})['then'](function(){return new Promise(function(_0x51fc0e,_0x47be94){rimraf(_0x434752,function(_0x1713c2){if(_0x1713c2)_0x47be94(_0x1713c2);return _0x51fc0e();});});})[_0xaf64('0x1a')](function(){return _0x409078[_0xaf64('0x82')](_0x53307f,_0x2e62db,function(_0x3115c8){if(_0x3115c8){logger['error']('Unable\x20to\x20delete\x20zip\x20file',_0x3115c8);}else{fs[_0xaf64('0x83')](_0x53307f);}});});});}else{return _0x409078[_0xaf64('0xf')](0xc8);}})[_0xaf64('0x29')](handleError(_0x409078,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 86211ad..da53b81 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 _0x4e02=['map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x4e02,0x1a7));var _0x24e0=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x4e02[_0x412e27];return _0x53da42;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x24e0('0x0')];var OpenchannelMessage=require(_0x24e0('0x1'))['db'][_0x24e0('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x24e0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x24e0('0x4'),'afterDestroy':_0x24e0('0x5')};function emitEvent(_0x404fa4){return function(_0x56e211,_0x1c5ad2,_0x595820){_0x56e211[_0x24e0('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d75e1){_0x56e211[_0x24e0('0x7')](_0x24e0('0x8'),_0x5d75e1[_0x24e0('0x9')](function(_0x1b27bd){return{'id':_0x1b27bd['id']};}));return OpenchannelMessage[_0x24e0('0xa')]({'where':{'OpenchannelInteractionId':_0x56e211['id'],'direction':'in','read':![]},'raw':!![]});})[_0x24e0('0xb')](function(_0x28cda3){_0x56e211[_0x24e0('0x7')]('unreadMessages',_0x28cda3[_0x24e0('0xc')]);OpenchannelInteractionEvents[_0x24e0('0xd')](_0x404fa4+':'+_0x56e211['id'],_0x56e211);OpenchannelInteractionEvents['emit'](_0x404fa4,_0x56e211);_0x595820(null);})[_0x24e0('0xe')](_0x595820(null));};}for(var e in events){if(events[_0x24e0('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x24e0('0x10')](e,emitEvent(event));}}module[_0x24e0('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4fc9=['events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x4fc9,0x18f));var _0x94fc=function(_0x3e4766,_0x58ccd3){_0x3e4766=_0x3e4766-0x0;var _0x5e181a=_0x4fc9[_0x3e4766];return _0x5e181a;};'use strict';var EventEmitter=require(_0x94fc('0x0'));var OpenchannelInteraction=require(_0x94fc('0x1'))['db'][_0x94fc('0x2')];var OpenchannelMessage=require(_0x94fc('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x94fc('0x3')](0x0);var events={'afterCreate':_0x94fc('0x4'),'afterUpdate':_0x94fc('0x5'),'afterDestroy':_0x94fc('0x6')};function emitEvent(_0x24293a){return function(_0x7cbd1a,_0x59b901,_0xaa4a1a){_0x7cbd1a[_0x94fc('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2a196e){_0x7cbd1a['setDataValue'](_0x94fc('0x8'),_0x2a196e[_0x94fc('0x9')](function(_0x523e55){return{'id':_0x523e55['id']};}));return OpenchannelMessage[_0x94fc('0xa')]({'where':{'OpenchannelInteractionId':_0x7cbd1a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94fc('0xb')](function(_0x7e7789){_0x7cbd1a[_0x94fc('0xc')](_0x94fc('0xd'),_0x7e7789['length']);OpenchannelInteractionEvents[_0x94fc('0xe')](_0x24293a+':'+_0x7cbd1a['id'],_0x7cbd1a);OpenchannelInteractionEvents[_0x94fc('0xe')](_0x24293a,_0x7cbd1a);_0xaa4a1a(null);})[_0x94fc('0xf')](_0xaa4a1a(null));};}for(var e in events){if(events[_0x94fc('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x94fc('0x11')](e,emitEvent(event));}}module[_0x94fc('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b290ad6..e4264d6 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 _0xf2f7=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x1b6629,_0x4ae9cd){var _0x50cfba=function(_0x453014){while(--_0x453014){_0x1b6629['push'](_0x1b6629['shift']());}};_0x50cfba(++_0x4ae9cd);}(_0xf2f7,0xa3));var _0x7f2f=function(_0x1fe79b,_0x3d510e){_0x1fe79b=_0x1fe79b-0x0;var _0x393861=_0xf2f7[_0x1fe79b];return _0x393861;};'use strict';var _=require(_0x7f2f('0x0'));var util=require('util');var logger=require(_0x7f2f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7f2f('0x2'));var rp=require(_0x7f2f('0x3'));var fs=require('fs');var path=require(_0x7f2f('0x4'));var rimraf=require(_0x7f2f('0x5'));var config=require(_0x7f2f('0x6'));var attributes=require(_0x7f2f('0x7'));module['exports']=function(_0x4b788c,_0x30c93c){return _0x4b788c[_0x7f2f('0x8')](_0x7f2f('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f2f('0xa'),'collate':_0x7f2f('0xb'),'hooks':{'beforeUpdate':function(_0x3cad14,_0x201483,_0x57aa99){if(_0x3cad14[_0x7f2f('0xc')]('closed')){_0x3cad14[_0x7f2f('0xd')]=moment()[_0x7f2f('0xe')](_0x7f2f('0xf'));}_0x57aa99(null,_0x3cad14);}}});}; \ No newline at end of file +var _0xc556=['changed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x547302,_0x5c1853){var _0x120aa6=function(_0x54de1c){while(--_0x54de1c){_0x547302['push'](_0x547302['shift']());}};_0x120aa6(++_0x5c1853);}(_0xc556,0x1d4));var _0x6c55=function(_0x2399ec,_0x22b88c){_0x2399ec=_0x2399ec-0x0;var _0x5159a2=_0xc556[_0x2399ec];return _0x5159a2;};'use strict';var _=require(_0x6c55('0x0'));var util=require(_0x6c55('0x1'));var logger=require(_0x6c55('0x2'))('api');var moment=require(_0x6c55('0x3'));var BPromise=require(_0x6c55('0x4'));var rp=require(_0x6c55('0x5'));var fs=require('fs');var path=require(_0x6c55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x6c55('0x7')]=function(_0x5b6678,_0x160ac0){return _0x5b6678['define'](_0x6c55('0x8'),attributes,{'tableName':_0x6c55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c55('0xa'),'collate':_0x6c55('0xb'),'hooks':{'beforeUpdate':function(_0x349204,_0x547549,_0x3f322f){if(_0x349204[_0x6c55('0xc')]('closed')){_0x349204[_0x6c55('0xd')]=moment()[_0x6c55('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f322f(null,_0x349204);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ea3624a..5d9adff 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 _0x776a=['AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit'];(function(_0x40b74c,_0x205361){var _0x19facb=function(_0x23d10a){while(--_0x23d10a){_0x40b74c['push'](_0x40b74c['shift']());}};_0x19facb(++_0x205361);}(_0x776a,0x1df));var _0xa776=function(_0x152503,_0x3bfb12){_0x152503=_0x152503-0x0;var _0x71197=_0x776a[_0x152503];return _0x71197;};'use strict';var _=require(_0xa776('0x0'));var util=require(_0xa776('0x1'));var moment=require(_0xa776('0x2'));var BPromise=require(_0xa776('0x3'));var rs=require(_0xa776('0x4'));var fs=require('fs');var Redis=require(_0xa776('0x5'));var db=require(_0xa776('0x6'))['db'];var utils=require(_0xa776('0x7'));var logger=require(_0xa776('0x8'))('rpc');var config=require(_0xa776('0x9'));var jayson=require(_0xa776('0xa'));var client=jayson[_0xa776('0xb')]['http']({'port':0x232a});config[_0xa776('0xc')]=_[_0xa776('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa776('0xe'))(new Redis(config[_0xa776('0xc')]));require(_0xa776('0xf'))[_0xa776('0x10')](socket);function respondWithRpcPromise(_0x374465,_0x3bf655,_0x5116fc){return new BPromise(function(_0x1ff521,_0x3a912f){return client[_0xa776('0x11')](_0x374465,_0x5116fc)[_0xa776('0x12')](function(_0x2c8d8b){logger[_0xa776('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3bf655,'request\x20sent');logger[_0xa776('0x14')](_0xa776('0x15'),_0x3bf655,_0xa776('0x16'),JSON[_0xa776('0x17')](_0x2c8d8b));if(_0x2c8d8b[_0xa776('0x18')]){if(_0x2c8d8b[_0xa776('0x18')][_0xa776('0x19')]===0x1f4){logger['error'](_0xa776('0x1a'),_0x3bf655,_0x2c8d8b[_0xa776('0x18')][_0xa776('0x1b')]);return _0x3a912f(_0x2c8d8b[_0xa776('0x18')][_0xa776('0x1b')]);}logger[_0xa776('0x18')](_0xa776('0x1a'),_0x3bf655,_0x2c8d8b[_0xa776('0x18')][_0xa776('0x1b')]);return _0x1ff521(_0x2c8d8b['error'][_0xa776('0x1b')]);}else{logger[_0xa776('0x13')](_0xa776('0x1a'),_0x3bf655,_0xa776('0x16'));_0x1ff521(_0x2c8d8b['result'][_0xa776('0x1b')]);}})[_0xa776('0x1c')](function(_0x14d5d4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3bf655,_0x14d5d4);_0x3a912f(_0x14d5d4);});});}exports[_0xa776('0x1d')]=function(_0x5ecd59){var _0x23e2ba=this;return new Promise(function(_0x1d74c1,_0x282fe1){return db[_0xa776('0x1e')][_0xa776('0x1f')](_0x5ecd59[_0xa776('0x20')],{'raw':_0x5ecd59[_0xa776('0x21')]?_0x5ecd59[_0xa776('0x21')][_0xa776('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ecd59[_0xa776('0x21')]?_0x5ecd59[_0xa776('0x21')][_0xa776('0x23')]||null:null,'attributes':_0x5ecd59[_0xa776('0x21')]?_0x5ecd59[_0xa776('0x21')]['attributes']||null:null,'limit':_0x5ecd59[_0xa776('0x21')]?_0x5ecd59[_0xa776('0x21')][_0xa776('0x24')]||null:null})[_0xa776('0x12')](function(_0x555907){logger['info'](_0xa776('0x1d'),_0x5ecd59);logger[_0xa776('0x14')](_0xa776('0x1d'),_0x5ecd59,JSON['stringify'](_0x555907));_0x1d74c1(_0x555907);})['catch'](function(_0x172b93){logger['error'](_0xa776('0x1d'),_0x172b93[_0xa776('0x1b')],_0x5ecd59);_0x282fe1(_0x23e2ba[_0xa776('0x18')](0x1f4,_0x172b93['message']));});});};exports[_0xa776('0x25')]=function(_0x26b6ab){return new Promise(function(_0x566d08,_0x7eb9fb){return db[_0xa776('0x1e')][_0xa776('0x26')]({'where':_0x26b6ab[_0xa776('0x21')]?_0x26b6ab[_0xa776('0x21')][_0xa776('0x23')]||null:null})['then'](function(_0x248e6e){if(_0x248e6e){return _0x248e6e[_0xa776('0x27')](_0x26b6ab[_0xa776('0x20')][_0xa776('0x28')],_['omit'](_0x26b6ab[_0xa776('0x20')],['ids','id'])||{});}})[_0xa776('0x29')](function(_0x3db695){logger[_0xa776('0x13')](_0xa776('0x2a'),_0x26b6ab);logger[_0xa776('0x14')](_0xa776('0x2a'),_0x26b6ab,JSON[_0xa776('0x17')](_0x3db695));_0x566d08(_0x3db695);})[_0xa776('0x1c')](function(_0x12a637){logger[_0xa776('0x18')](_0xa776('0x2a'),_0x12a637[_0xa776('0x1b')],_0x26b6ab);_0x7eb9fb(_this[_0xa776('0x18')](0x1f4,_0x12a637[_0xa776('0x1b')]));});});}; \ No newline at end of file +var _0x8932=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./openchannelInteraction.socket','register','request','then'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x8932,0xed));var _0x2893=function(_0x3eddfb,_0x2930c3){_0x3eddfb=_0x3eddfb-0x0;var _0x44aa25=_0x8932[_0x3eddfb];return _0x44aa25;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2893('0x0'));var rs=require(_0x2893('0x1'));var fs=require('fs');var Redis=require(_0x2893('0x2'));var db=require(_0x2893('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2893('0x4'))(_0x2893('0x5'));var config=require(_0x2893('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2893('0x7')][_0x2893('0x8')]({'port':0x232a});config[_0x2893('0x9')]=_['defaults'](config[_0x2893('0x9')],{'host':_0x2893('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2893('0x9')]));require(_0x2893('0xb'))[_0x2893('0xc')](socket);function respondWithRpcPromise(_0x76a6f5,_0x4fce49,_0x46a557){return new BPromise(function(_0x5659e7,_0x230df1){return client[_0x2893('0xd')](_0x76a6f5,_0x46a557)[_0x2893('0xe')](function(_0x843605){logger[_0x2893('0xf')](_0x2893('0x10'),_0x4fce49,_0x2893('0x11'));logger[_0x2893('0x12')](_0x2893('0x13'),_0x4fce49,_0x2893('0x11'),JSON['stringify'](_0x843605));if(_0x843605[_0x2893('0x14')]){if(_0x843605[_0x2893('0x14')][_0x2893('0x15')]===0x1f4){logger[_0x2893('0x14')](_0x2893('0x10'),_0x4fce49,_0x843605[_0x2893('0x14')][_0x2893('0x16')]);return _0x230df1(_0x843605[_0x2893('0x14')][_0x2893('0x16')]);}logger[_0x2893('0x14')](_0x2893('0x10'),_0x4fce49,_0x843605[_0x2893('0x14')][_0x2893('0x16')]);return _0x5659e7(_0x843605[_0x2893('0x14')][_0x2893('0x16')]);}else{logger[_0x2893('0xf')](_0x2893('0x10'),_0x4fce49,_0x2893('0x11'));_0x5659e7(_0x843605[_0x2893('0x17')]['message']);}})[_0x2893('0x18')](function(_0x5c9477){logger[_0x2893('0x14')](_0x2893('0x10'),_0x4fce49,_0x5c9477);_0x230df1(_0x5c9477);});});}exports[_0x2893('0x19')]=function(_0x2f8b1d){var _0x26cfaf=this;return new Promise(function(_0x2b40d9,_0x522211){return db['OpenchannelInteraction'][_0x2893('0x1a')](_0x2f8b1d[_0x2893('0x1b')],{'raw':_0x2f8b1d[_0x2893('0x1c')]?_0x2f8b1d[_0x2893('0x1c')][_0x2893('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f8b1d['options']?_0x2f8b1d[_0x2893('0x1c')][_0x2893('0x1e')]||null:null,'attributes':_0x2f8b1d['options']?_0x2f8b1d[_0x2893('0x1c')][_0x2893('0x1f')]||null:null,'limit':_0x2f8b1d[_0x2893('0x1c')]?_0x2f8b1d[_0x2893('0x1c')][_0x2893('0x20')]||null:null})[_0x2893('0xe')](function(_0xab7bdf){logger[_0x2893('0xf')](_0x2893('0x19'),_0x2f8b1d);logger[_0x2893('0x12')](_0x2893('0x19'),_0x2f8b1d,JSON[_0x2893('0x21')](_0xab7bdf));_0x2b40d9(_0xab7bdf);})[_0x2893('0x18')](function(_0x50850f){logger[_0x2893('0x14')](_0x2893('0x19'),_0x50850f[_0x2893('0x16')],_0x2f8b1d);_0x522211(_0x26cfaf[_0x2893('0x14')](0x1f4,_0x50850f[_0x2893('0x16')]));});});};exports[_0x2893('0x22')]=function(_0x54f6ce){return new Promise(function(_0x58ab6a,_0x179e09){return db[_0x2893('0x23')][_0x2893('0x24')]({'where':_0x54f6ce[_0x2893('0x1c')]?_0x54f6ce['options'][_0x2893('0x1e')]||null:null})[_0x2893('0xe')](function(_0x367e37){if(_0x367e37){return _0x367e37[_0x2893('0x25')](_0x54f6ce[_0x2893('0x1b')][_0x2893('0x26')],_[_0x2893('0x27')](_0x54f6ce[_0x2893('0x1b')],[_0x2893('0x26'),'id'])||{});}})[_0x2893('0x28')](function(_0x192256){logger[_0x2893('0xf')](_0x2893('0x29'),_0x54f6ce);logger[_0x2893('0x12')](_0x2893('0x29'),_0x54f6ce,JSON[_0x2893('0x21')](_0x192256));_0x58ab6a(_0x192256);})[_0x2893('0x18')](function(_0x3013fc){logger[_0x2893('0x14')](_0x2893('0x29'),_0x3013fc[_0x2893('0x16')],_0x54f6ce);_0x179e09(_this[_0x2893('0x14')](0x1f4,_0x3013fc[_0x2893('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a36c060..ddd031d 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 _0x9de8=['remove','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9de8,0x6a));var _0x89de=function(_0x9a7b67,_0x293818){_0x9a7b67=_0x9a7b67-0x0;var _0x38f122=_0x9de8[_0x9a7b67];return _0x38f122;};'use strict';var OpenchannelInteractionEvents=require(_0x89de('0x0'));var events=[_0x89de('0x1'),_0x89de('0x2'),_0x89de('0x3')];function createListener(_0x1aa212,_0x31614c){return function(_0x2d03bd){_0x31614c[_0x89de('0x4')](_0x1aa212,_0x2d03bd);};}function removeListener(_0x393fd2,_0xe15351){return function(){OpenchannelInteractionEvents[_0x89de('0x5')](_0x393fd2,_0xe15351);};}exports[_0x89de('0x6')]=function(_0x47d3f1){for(var _0x4b03a9=0x0,_0x39b049=events[_0x89de('0x7')];_0x4b03a9<_0x39b049;_0x4b03a9++){var _0x4b9ba9=events[_0x4b03a9];var _0x4956b3=createListener(_0x89de('0x8')+_0x4b9ba9,_0x47d3f1);OpenchannelInteractionEvents['on'](_0x4b9ba9,_0x4956b3);}}; \ No newline at end of file +var _0xe5ad=['save','remove','removeListener','register','length','openchannelInteraction:'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xe5ad,0x72));var _0xde5a=function(_0x4d5ea6,_0x1aa93c){_0x4d5ea6=_0x4d5ea6-0x0;var _0x5b6eaf=_0xe5ad[_0x4d5ea6];return _0x5b6eaf;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xde5a('0x0'),_0xde5a('0x1'),'update'];function createListener(_0x5c6cc2,_0x233162){return function(_0x1fa7d4){_0x233162['emit'](_0x5c6cc2,_0x1fa7d4);};}function removeListener(_0x4da659,_0x5ee689){return function(){OpenchannelInteractionEvents[_0xde5a('0x2')](_0x4da659,_0x5ee689);};}exports[_0xde5a('0x3')]=function(_0x4d39eb){for(var _0x33014c=0x0,_0xdb96b8=events[_0xde5a('0x4')];_0x33014c<_0xdb96b8;_0x33014c++){var _0x3c5094=events[_0x33014c];var _0x24ed3c=createListener(_0xde5a('0x5')+_0x3c5094,_0x4d39eb);OpenchannelInteractionEvents['on'](_0x3c5094,_0x24ed3c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f515bff..22485af 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x3a7670,_0x17fe59){var _0x19c3a5=function(_0x52e7b8){while(--_0x52e7b8){_0x3a7670['push'](_0x3a7670['shift']());}};_0x19c3a5(++_0x17fe59);}(_0xe706,0xa3));var _0x6e70=function(_0xe70f6c,_0x3b734d){_0xe70f6c=_0xe70f6c-0x0;var _0x29d959=_0xe706[_0xe70f6c];return _0x29d959;};'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')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +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(_0x22a524,_0x32c0d0){var _0x2ebb53=function(_0x4899a6){while(--_0x4899a6){_0x22a524['push'](_0x22a524['shift']());}};_0x2ebb53(++_0x32c0d0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0xcb91[_0x29d2d2];return _0x3f6476;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 1093a62..f3c5c09 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 _0xc692=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x519140,_0x762c1e){var _0x2b9d3b=function(_0xfed490){while(--_0xfed490){_0x519140['push'](_0x519140['shift']());}};_0x2b9d3b(++_0x762c1e);}(_0xc692,0x15f));var _0x2c69=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xc692[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'body':{'type':Sequelize[_0x2c69('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2c69('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c69('0x4')]('in',_0x2c69('0x5')),'defaultValue':_0x2c69('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2c69('0x6')]},'providerName':{'type':Sequelize[_0x2c69('0x7')]},'providerResponse':{'type':Sequelize[_0x2c69('0x2')]}}; \ No newline at end of file +var _0x43c8=['exports','medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x43c8,0xaf));var _0x843c=function(_0x35ec4d,_0x4f6226){_0x35ec4d=_0x35ec4d-0x0;var _0x5d116d=_0x43c8[_0x35ec4d];return _0x5d116d;};'use strict';var Sequelize=require('sequelize');module[_0x843c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x843c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x843c('0x3')]('in',_0x843c('0x4')),'defaultValue':_0x843c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x843c('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x843c('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b68c460..2c45008 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 _0x70ff=['intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','VIRTUAL','options','where','OpenchannelMessage','include','findAll','rows','show','params','fields','find','create','body','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','format','UserId','user','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','event','accept','EventManager','acceptmessage','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','fullname','channel','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x33a70d,_0x580f17){var _0x5d0ee8=function(_0x1af7b3){while(--_0x1af7b3){_0x33a70d['push'](_0x33a70d['shift']());}};_0x5d0ee8(++_0x580f17);}(_0x70ff,0x1ce));var _0xf70f=function(_0x2a6bc,_0x761a07){_0x2a6bc=_0x2a6bc-0x0;var _0x288d3a=_0x70ff[_0x2a6bc];return _0x288d3a;};'use strict';var emlformat=require(_0xf70f('0x0'));var rimraf=require(_0xf70f('0x1'));var zipdir=require(_0xf70f('0x2'));var jsonpatch=require(_0xf70f('0x3'));var rp=require(_0xf70f('0x4'));var moment=require(_0xf70f('0x5'));var BPromise=require(_0xf70f('0x6'));var Mustache=require(_0xf70f('0x7'));var util=require(_0xf70f('0x8'));var path=require(_0xf70f('0x9'));var sox=require(_0xf70f('0xa'));var csv=require(_0xf70f('0xb'));var ejs=require(_0xf70f('0xc'));var fs=require('fs');var fs_extra=require(_0xf70f('0xd'));var _=require(_0xf70f('0xe'));var squel=require(_0xf70f('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf70f('0x10'));var toCsv=require(_0xf70f('0xb'));var querystring=require(_0xf70f('0x11'));var Papa=require(_0xf70f('0x12'));var Redis=require('ioredis');var authService=require(_0xf70f('0x13'));var qs=require(_0xf70f('0x14'));var as=require(_0xf70f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf70f('0x16'));var utils=require(_0xf70f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf70f('0x18')]=_['defaults'](config['redis'],{'host':_0xf70f('0x19'),'port':0x18eb});var socket=require(_0xf70f('0x1a'))(new Redis(config[_0xf70f('0x18')]));require(_0xf70f('0x1b'))[_0xf70f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf70f('0x1d')][_0xf70f('0x1e')]({'port':0x232c});var client9002=jayson[_0xf70f('0x1d')][_0xf70f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5e80b7,_0x15b1f8,_0x3bd63e,_0x27a1ff){return new BPromise(function(_0x59fd5c,_0x523a9c){var _0x51cd11=_0x27a1ff||client;return _0x51cd11[_0xf70f('0x1f')](_0x5e80b7,_0x3bd63e)['then'](function(_0x2791c6){logger[_0xf70f('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x15b1f8,_0xf70f('0x21'));logger['debug'](_0xf70f('0x22'),_0x15b1f8,_0xf70f('0x21'),JSON[_0xf70f('0x23')](_0x2791c6));if(_0x2791c6[_0xf70f('0x24')]){if(_0x2791c6[_0xf70f('0x24')]['code']===0x1f4){logger[_0xf70f('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x15b1f8,_0x2791c6[_0xf70f('0x24')][_0xf70f('0x25')]);return _0x523a9c(_0x2791c6['error']['message']);}logger['error'](_0xf70f('0x26'),_0x15b1f8,_0x2791c6[_0xf70f('0x24')]['message']);return _0x59fd5c(_0x2791c6[_0xf70f('0x24')][_0xf70f('0x25')]);}else{logger[_0xf70f('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x15b1f8,'request\x20sent');_0x59fd5c(_0x2791c6[_0xf70f('0x27')]['message']);}})[_0xf70f('0x28')](function(_0x30e150){logger[_0xf70f('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x15b1f8,_0x30e150);_0x523a9c(_0x30e150);});});}function respondWithStatusCode(_0x2da785,_0x53e49a){_0x53e49a=_0x53e49a||0xcc;return function(_0x2407c9){if(_0x2407c9){return _0x2da785['sendStatus'](_0x53e49a);}return _0x2da785[_0xf70f('0x29')](_0x53e49a)['end']();};}function respondWithResult(_0x49f8c3,_0x9685ba){_0x9685ba=_0x9685ba||0xc8;return function(_0x98c516){if(_0x98c516){return _0x49f8c3['status'](_0x9685ba)['json'](_0x98c516);}};}function respondWithFilteredResult(_0x6bf5f,_0x1a9b51){return function(_0x1e7ae1){if(_0x1e7ae1){var _0x424bc8=typeof _0x1a9b51[_0xf70f('0x2a')]==='undefined'&&typeof _0x1a9b51['limit']===_0xf70f('0x2b');var _0xcff797=_0x1e7ae1[_0xf70f('0x2c')];var _0x143843=_0x424bc8?0x0:_0x1a9b51[_0xf70f('0x2a')];var _0x1e80af=_0x424bc8?_0x1e7ae1[_0xf70f('0x2c')]:_0x1a9b51['offset']+_0x1a9b51[_0xf70f('0x2d')];var _0x53b3df;if(_0x1e80af>=_0xcff797){_0x1e80af=_0xcff797;_0x53b3df=0xc8;}else{_0x53b3df=0xce;}_0x6bf5f[_0xf70f('0x29')](_0x53b3df);return _0x6bf5f[_0xf70f('0x2e')](_0xf70f('0x2f'),_0x143843+'-'+_0x1e80af+'/'+_0xcff797)[_0xf70f('0x30')](_0x1e7ae1);}return null;};}function patchUpdates(_0xd6a1fe){return function(_0x5a2719){try{jsonpatch[_0xf70f('0x31')](_0x5a2719,_0xd6a1fe,!![]);}catch(_0x52dce2){return BPromise[_0xf70f('0x32')](_0x52dce2);}return _0x5a2719[_0xf70f('0x33')]();};}function saveUpdates(_0x210067,_0x50a228){return function(_0x5c10dd){if(_0x5c10dd){return _0x5c10dd['update'](_0x210067)[_0xf70f('0x34')](function(_0x4d49ec){return _0x4d49ec;});}return null;};}function removeEntity(_0xc2cf1a,_0x35411d){return function(_0x360983){if(_0x360983){return _0x360983[_0xf70f('0x35')]()[_0xf70f('0x34')](function(){_0xc2cf1a[_0xf70f('0x29')](0xcc)[_0xf70f('0x36')]();});}};}function handleEntityNotFound(_0x201f73,_0x1c32ee){return function(_0x177747){if(!_0x177747){_0x201f73['sendStatus'](0x194);}return _0x177747;};}function handleError(_0x49a0b6,_0x26bfe8){_0x26bfe8=_0x26bfe8||0x1f4;return function(_0x50a042){logger[_0xf70f('0x24')](_0x50a042['stack']);if(_0x50a042[_0xf70f('0x37')]){delete _0x50a042[_0xf70f('0x37')];}_0x49a0b6['status'](_0x26bfe8)[_0xf70f('0x38')](_0x50a042);};}exports[_0xf70f('0x39')]=function(_0x32ad80,_0x34b9da){var _0x544ddd={},_0x3098e3={},_0x393a9c={'count':0x0,'rows':[]};var _0x15069d=_[_0xf70f('0x3a')](db['OpenchannelMessage'][_0xf70f('0x3b')],function(_0x28bd83){return{'name':_0x28bd83[_0xf70f('0x3c')],'type':_0x28bd83[_0xf70f('0x3d')][_0xf70f('0x3e')]};});_0x3098e3[_0xf70f('0x3f')]=_[_0xf70f('0x3a')](_0x15069d,_0xf70f('0x37'));_0x3098e3[_0xf70f('0x40')]=_[_0xf70f('0x41')](_0x32ad80[_0xf70f('0x40')]);_0x3098e3['filters']=_[_0xf70f('0x42')](_0x3098e3[_0xf70f('0x3f')],_0x3098e3['query']);_0x544ddd[_0xf70f('0x43')]=_[_0xf70f('0x42')](_0x3098e3[_0xf70f('0x3f')],qs['fields'](_0x32ad80[_0xf70f('0x40')]['fields']));_0x544ddd['attributes']=_0x544ddd[_0xf70f('0x43')]['length']?_0x544ddd[_0xf70f('0x43')]:_0x3098e3[_0xf70f('0x3f')];if(!_0x32ad80[_0xf70f('0x40')][_0xf70f('0x44')](_0xf70f('0x45'))){_0x544ddd[_0xf70f('0x2d')]=qs['limit'](_0x32ad80[_0xf70f('0x40')][_0xf70f('0x2d')]);_0x544ddd[_0xf70f('0x2a')]=qs[_0xf70f('0x2a')](_0x32ad80[_0xf70f('0x40')][_0xf70f('0x2a')]);}_0x544ddd[_0xf70f('0x46')]=qs[_0xf70f('0x47')](_0x32ad80['query'][_0xf70f('0x47')]);_0x544ddd['where']=qs['filters'](_[_0xf70f('0x48')](_0x32ad80[_0xf70f('0x40')],_0x3098e3[_0xf70f('0x49')]),_0x15069d);if(_0x32ad80[_0xf70f('0x40')][_0xf70f('0x4a')]){_0x544ddd['where']=_[_0xf70f('0x4b')](_0x544ddd['where'],{'$or':_[_0xf70f('0x3a')](_0x15069d,function(_0x343764){if(_0x343764[_0xf70f('0x3d')]!==_0xf70f('0x4c')){var _0x53dc23={};_0x53dc23[_0x343764[_0xf70f('0x37')]]={'$like':'%'+_0x32ad80[_0xf70f('0x40')][_0xf70f('0x4a')]+'%'};return _0x53dc23;}})});}_0x544ddd=_[_0xf70f('0x4b')]({},_0x544ddd,_0x32ad80[_0xf70f('0x4d')]);var _0x3f6fa1={'where':_0x544ddd[_0xf70f('0x4e')]};return db[_0xf70f('0x4f')][_0xf70f('0x2c')](_0x3f6fa1)[_0xf70f('0x34')](function(_0x4d9914){_0x393a9c[_0xf70f('0x2c')]=_0x4d9914;if(_0x32ad80['query']['includeAll']){_0x544ddd[_0xf70f('0x50')]=[{'all':!![]}];}return db[_0xf70f('0x4f')][_0xf70f('0x51')](_0x544ddd);})[_0xf70f('0x34')](function(_0x442ca9){_0x393a9c[_0xf70f('0x52')]=_0x442ca9;return _0x393a9c;})[_0xf70f('0x34')](respondWithFilteredResult(_0x34b9da,_0x544ddd))[_0xf70f('0x28')](handleError(_0x34b9da,null));};exports[_0xf70f('0x53')]=function(_0x7a6f63,_0x4c3ebd){var _0x44c692={'raw':!![],'where':{'id':_0x7a6f63[_0xf70f('0x54')]['id']}},_0x1a9a3b={};_0x1a9a3b[_0xf70f('0x3f')]=_[_0xf70f('0x41')](db[_0xf70f('0x4f')][_0xf70f('0x3b')]);_0x1a9a3b[_0xf70f('0x40')]=_[_0xf70f('0x41')](_0x7a6f63[_0xf70f('0x40')]);_0x1a9a3b[_0xf70f('0x49')]=_[_0xf70f('0x42')](_0x1a9a3b[_0xf70f('0x3f')],_0x1a9a3b[_0xf70f('0x40')]);_0x44c692[_0xf70f('0x43')]=_[_0xf70f('0x42')](_0x1a9a3b['model'],qs[_0xf70f('0x55')](_0x7a6f63['query'][_0xf70f('0x55')]));_0x44c692[_0xf70f('0x43')]=_0x44c692['attributes']['length']?_0x44c692[_0xf70f('0x43')]:_0x1a9a3b[_0xf70f('0x3f')];if(_0x7a6f63['query']['includeAll']){_0x44c692[_0xf70f('0x50')]=[{'all':!![]}];}_0x44c692=_[_0xf70f('0x4b')]({},_0x44c692,_0x7a6f63['options']);return db[_0xf70f('0x4f')][_0xf70f('0x56')](_0x44c692)['then'](handleEntityNotFound(_0x4c3ebd,null))['then'](respondWithResult(_0x4c3ebd,null))[_0xf70f('0x28')](handleError(_0x4c3ebd,null));};exports[_0xf70f('0x57')]=function(_0x3ac421,_0x30f808){return db[_0xf70f('0x4f')][_0xf70f('0x57')](_0x3ac421[_0xf70f('0x58')],{})['then'](respondWithResult(_0x30f808,0xc9))['catch'](handleError(_0x30f808,null));};exports['update']=function(_0x23381b,_0x1d5dad){if(_0x23381b[_0xf70f('0x58')]['id']){delete _0x23381b[_0xf70f('0x58')]['id'];}return db[_0xf70f('0x4f')][_0xf70f('0x56')]({'where':{'id':_0x23381b['params']['id']}})[_0xf70f('0x34')](handleEntityNotFound(_0x1d5dad,null))['then'](saveUpdates(_0x23381b[_0xf70f('0x58')],null))['then'](respondWithResult(_0x1d5dad,null))[_0xf70f('0x28')](handleError(_0x1d5dad,null));};exports[_0xf70f('0x35')]=function(_0xa30f53,_0x3052db){return db[_0xf70f('0x4f')][_0xf70f('0x56')]({'where':{'id':_0xa30f53[_0xf70f('0x54')]['id']}})[_0xf70f('0x34')](handleEntityNotFound(_0x3052db,null))[_0xf70f('0x34')](removeEntity(_0x3052db,null))[_0xf70f('0x28')](handleError(_0x3052db,null));};exports[_0xf70f('0x59')]=function(_0x1169d6,_0x1c0ac2){return db['OpenchannelMessage']['describe']()[_0xf70f('0x34')](respondWithResult(_0x1c0ac2,null))['catch'](handleError(_0x1c0ac2,null));};var interaction_log=require(_0xf70f('0x5a'))(_0xf70f('0x5b'));exports['accept']=function(_0x348b84,_0x31597f,_0x43225f){var _0x59f7f1={'agent':{},'channel':_0xf70f('0x5c')};if(_0x348b84[_0xf70f('0x58')]['id']){delete _0x348b84['body']['id'];}_0x348b84[_0xf70f('0x58')][_0xf70f('0x5d')]=!![];_0x348b84[_0xf70f('0x58')][_0xf70f('0x5e')]=moment()[_0xf70f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x348b84[_0xf70f('0x58')][_0xf70f('0x60')]=_0x348b84['body'][_0xf70f('0x60')]||_0x348b84[_0xf70f('0x61')]['id'];_0x59f7f1['agent']['id']=_0x348b84['body']['UserId'];return db[_0xf70f('0x4f')][_0xf70f('0x56')]({'where':{'id':_0x348b84['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31597f,null))[_0xf70f('0x34')](saveUpdates(_0x348b84['body'],null))[_0xf70f('0x34')](function(_0x2ba3a9){if(_0x2ba3a9){_0x59f7f1['message']=_0x2ba3a9[_0xf70f('0x62')]({'plain':!![]});return db[_0xf70f('0x63')][_0xf70f('0x56')]({'where':{'id':_0x2ba3a9['OpenchannelInteractionId']}});}return null;})[_0xf70f('0x34')](handleEntityNotFound(_0x31597f,null))[_0xf70f('0x34')](function(_0x42d12e){if(_0x42d12e){return _0x42d12e['update']({'UserId':_0x348b84[_0xf70f('0x58')][_0xf70f('0x60')],'read1stAt':_[_0xf70f('0x64')](_0x42d12e[_0xf70f('0x65')])?moment()[_0xf70f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf70f('0x34')](function(_0x3e01f3){if(_0x3e01f3){_0x59f7f1['interaction']=_0x3e01f3[_0xf70f('0x62')]({'plain':!![]});interaction_log[_0xf70f('0x20')](_0xf70f('0x66'),_0x348b84[_0xf70f('0x61')]['id'],_0x348b84[_0xf70f('0x61')][_0xf70f('0x37')],_0x348b84[_0xf70f('0x61')][_0xf70f('0x67')],_0x59f7f1['interaction']['id'],_0x348b84[_0xf70f('0x58')]?JSON[_0xf70f('0x23')](_0x348b84[_0xf70f('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0xf70f('0x68'),_0x59f7f1);}return null;})[_0xf70f('0x34')](function(_0x122a4b){var _0x46bad5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x122a4b['message']['ContactId'];return db[_0xf70f('0x69')][_0xf70f('0x40')](_0x46bad5,{'type':db[_0xf70f('0x6a')][_0xf70f('0x6b')][_0xf70f('0x6c')],'raw':!![]})[_0xf70f('0x34')](function(_0x2616f7){return _0x2616f7;});})[_0xf70f('0x34')](function(_0x5b1455){if(_0x5b1455){_0x59f7f1[_0xf70f('0x25')][_0xf70f('0x6d')]=_0x5b1455[0x0];if(!_0x348b84[_0xf70f('0x58')][_0xf70f('0x60')])return;return db[_0xf70f('0x6e')]['find']({'where':{'id':_0x348b84[_0xf70f('0x58')][_0xf70f('0x60')],'role':_0xf70f('0x6f')},'attributes':['id',_0xf70f('0x37'),'fullname',_0xf70f('0x70'),_0xf70f('0x71')],'raw':!![]});}return null;})['then'](function(_0x15f3c0){if(!_0x15f3c0)return null;_0x59f7f1['message'][_0xf70f('0x6f')]=_0x15f3c0;return _0x59f7f1;})[_0xf70f('0x34')](function(_0x4b147c){if(_0x4b147c){if(_0x348b84[_0xf70f('0x58')][_0xf70f('0x72')]){_0x59f7f1[_0xf70f('0x25')][_0xf70f('0x73')]=util['format'](_0xf70f('0x74'),_0x348b84[_0xf70f('0x61')][_0xf70f('0x37')]);_0x59f7f1[_0xf70f('0x25')]['channel']=_0x59f7f1['channel'];_0x59f7f1['message']['motionChannel']=_0x59f7f1['channel'];_0x59f7f1['message'][_0xf70f('0x75')]=_0xf70f('0x76');return respondWithRpcPromise(_0xf70f('0x77'),'EventManager',{'event':_0xf70f('0x78'),'message':_0x59f7f1[_0xf70f('0x25')]},client9002)[_0xf70f('0x34')](function(){return _0x59f7f1;});}return _0x59f7f1;}return null;})[_0xf70f('0x34')](respondWithResult(_0x31597f,null))[_0xf70f('0x28')](handleError(_0x31597f,null));};var interaction_log=require('../../config/logger')(_0xf70f('0x5b'));exports[_0xf70f('0x32')]=function(_0x2451c0,_0x2c27b1,_0xbf3680){var _0x5ad9b0={'agent':{},'channel':_0xf70f('0x5c')};if(_0x2451c0[_0xf70f('0x58')]['id']){delete _0x2451c0['body']['id'];}_0x2451c0[_0xf70f('0x58')][_0xf70f('0x60')]=_0x2451c0['body'][_0xf70f('0x60')]||_0x2451c0[_0xf70f('0x61')]['id'];_0x5ad9b0[_0xf70f('0x6f')]['id']=_0x2451c0[_0xf70f('0x58')][_0xf70f('0x60')];return db[_0xf70f('0x4f')]['find']({'where':{'id':_0x2451c0[_0xf70f('0x54')]['id'],'UserId':null}})[_0xf70f('0x34')](handleEntityNotFound(_0x2c27b1,null))['then'](function(_0x3a8f86){if(_0x3a8f86){_0x5ad9b0['message']=_0x3a8f86[_0xf70f('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf70f('0x56')]({'where':{'id':_0x3a8f86['OpenchannelInteractionId']}});}return null;})[_0xf70f('0x34')](handleEntityNotFound(_0x2c27b1,null))[_0xf70f('0x34')](function(_0x558b3c){if(_0x558b3c){_0x5ad9b0[_0xf70f('0x79')]=_0x558b3c[_0xf70f('0x62')]({'plain':!![]});interaction_log[_0xf70f('0x20')](_0xf70f('0x7a'),_0x2451c0[_0xf70f('0x61')]['id'],_0x2451c0['user'][_0xf70f('0x37')],_0x2451c0['user'][_0xf70f('0x67')],_0x5ad9b0[_0xf70f('0x79')]['id'],_0x2451c0['body']?JSON[_0xf70f('0x23')](_0x2451c0[_0xf70f('0x58')]):_0xf70f('0x7b'));return respondWithRpcPromise(_0xf70f('0x7c'),_0xf70f('0x7d'),_0x5ad9b0);}return null;})[_0xf70f('0x34')](function(_0x6dbab6){var _0x86d944=_0xf70f('0x7e')+_0x6dbab6['message'][_0xf70f('0x7f')];return db[_0xf70f('0x69')][_0xf70f('0x40')](_0x86d944,{'type':db[_0xf70f('0x6a')][_0xf70f('0x6b')][_0xf70f('0x6c')],'raw':!![]})[_0xf70f('0x34')](function(_0x33de50){return _0x33de50;});})[_0xf70f('0x34')](function(_0x446d10){if(_0x446d10){_0x5ad9b0[_0xf70f('0x25')][_0xf70f('0x6d')]=_0x446d10[0x0];if(!_0x2451c0[_0xf70f('0x58')][_0xf70f('0x60')])return;return db[_0xf70f('0x6e')][_0xf70f('0x56')]({'where':{'id':_0x2451c0['body']['UserId'],'role':_0xf70f('0x6f')},'attributes':['id',_0xf70f('0x37'),_0xf70f('0x80'),_0xf70f('0x70'),_0xf70f('0x71')],'raw':!![]});}return null;})[_0xf70f('0x34')](function(_0x3ad2bf){if(!_0x3ad2bf)return null;_0x5ad9b0[_0xf70f('0x25')][_0xf70f('0x6f')]=_0x3ad2bf;return _0x5ad9b0;})[_0xf70f('0x34')](function(_0x51c7b1){if(_0x51c7b1){_0x51c7b1[_0xf70f('0x25')]['interface']=util[_0xf70f('0x5f')](_0xf70f('0x74'),_0x2451c0[_0xf70f('0x61')][_0xf70f('0x37')]);_0x51c7b1[_0xf70f('0x25')][_0xf70f('0x81')]=_0x5ad9b0[_0xf70f('0x81')];_0x51c7b1['message'][_0xf70f('0x82')]=_0x5ad9b0[_0xf70f('0x81')];_0x51c7b1[_0xf70f('0x25')][_0xf70f('0x75')]='reject';respondWithRpcPromise(_0xf70f('0x77'),'EventManager',{'event':_0xf70f('0x83'),'message':_0x51c7b1[_0xf70f('0x25')]},client9002);return _0x5ad9b0;}return null;})[_0xf70f('0x34')](respondWithResult(_0x2c27b1,null))[_0xf70f('0x28')](handleError(_0x2c27b1,null));}; \ No newline at end of file +var _0x9d9d=['sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','update','isNil','read1stAt','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','User','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','save','end','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x2e95b1,_0x51d9db){var _0x4514ca=function(_0x2d13aa){while(--_0x2d13aa){_0x2e95b1['push'](_0x2e95b1['shift']());}};_0x4514ca(++_0x51d9db);}(_0x9d9d,0x1ba));var _0xd9d9=function(_0x5448ff,_0x4757df){_0x5448ff=_0x5448ff-0x0;var _0x1030f4=_0x9d9d[_0x5448ff];return _0x1030f4;};'use strict';var emlformat=require(_0xd9d9('0x0'));var rimraf=require(_0xd9d9('0x1'));var zipdir=require(_0xd9d9('0x2'));var jsonpatch=require(_0xd9d9('0x3'));var rp=require('request-promise');var moment=require(_0xd9d9('0x4'));var BPromise=require(_0xd9d9('0x5'));var Mustache=require('mustache');var util=require(_0xd9d9('0x6'));var path=require('path');var sox=require(_0xd9d9('0x7'));var csv=require(_0xd9d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9d9('0x9'));var _=require(_0xd9d9('0xa'));var squel=require(_0xd9d9('0xb'));var crypto=require(_0xd9d9('0xc'));var jsforce=require(_0xd9d9('0xd'));var deskjs=require(_0xd9d9('0xe'));var toCsv=require(_0xd9d9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9d9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd9d9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9d9('0x11'))('api');var utils=require(_0xd9d9('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd9d9('0x13'))['db'];config[_0xd9d9('0x14')]=_[_0xd9d9('0x15')](config['redis'],{'host':_0xd9d9('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xd9d9('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd9d9('0x18')][_0xd9d9('0x19')]({'port':0x232c});var client9002=jayson[_0xd9d9('0x18')][_0xd9d9('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x20ffea,_0x103c02,_0x392d51,_0x3b1f9d){return new BPromise(function(_0x1eccbf,_0x4af247){var _0x532802=_0x3b1f9d||client;return _0x532802[_0xd9d9('0x1a')](_0x20ffea,_0x392d51)[_0xd9d9('0x1b')](function(_0x42ca1b){logger['info'](_0xd9d9('0x1c'),_0x103c02,_0xd9d9('0x1d'));logger['debug'](_0xd9d9('0x1e'),_0x103c02,_0xd9d9('0x1d'),JSON[_0xd9d9('0x1f')](_0x42ca1b));if(_0x42ca1b[_0xd9d9('0x20')]){if(_0x42ca1b[_0xd9d9('0x20')]['code']===0x1f4){logger[_0xd9d9('0x20')](_0xd9d9('0x1c'),_0x103c02,_0x42ca1b[_0xd9d9('0x20')][_0xd9d9('0x21')]);return _0x4af247(_0x42ca1b[_0xd9d9('0x20')][_0xd9d9('0x21')]);}logger[_0xd9d9('0x20')](_0xd9d9('0x1c'),_0x103c02,_0x42ca1b['error'][_0xd9d9('0x21')]);return _0x1eccbf(_0x42ca1b[_0xd9d9('0x20')][_0xd9d9('0x21')]);}else{logger['info'](_0xd9d9('0x1c'),_0x103c02,'request\x20sent');_0x1eccbf(_0x42ca1b[_0xd9d9('0x22')][_0xd9d9('0x21')]);}})[_0xd9d9('0x23')](function(_0x15a040){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x103c02,_0x15a040);_0x4af247(_0x15a040);});});}function respondWithStatusCode(_0x181017,_0x10b6a9){_0x10b6a9=_0x10b6a9||0xcc;return function(_0x2cee5c){if(_0x2cee5c){return _0x181017['sendStatus'](_0x10b6a9);}return _0x181017[_0xd9d9('0x24')](_0x10b6a9)['end']();};}function respondWithResult(_0x129b8f,_0xc39e56){_0xc39e56=_0xc39e56||0xc8;return function(_0x2f9dfb){if(_0x2f9dfb){return _0x129b8f[_0xd9d9('0x24')](_0xc39e56)[_0xd9d9('0x25')](_0x2f9dfb);}};}function respondWithFilteredResult(_0x5243e9,_0x2aabb5){return function(_0x3deffa){if(_0x3deffa){var _0xf0d9ca=typeof _0x2aabb5[_0xd9d9('0x26')]===_0xd9d9('0x27')&&typeof _0x2aabb5[_0xd9d9('0x28')]==='undefined';var _0x366b8b=_0x3deffa[_0xd9d9('0x29')];var _0x3c9f33=_0xf0d9ca?0x0:_0x2aabb5['offset'];var _0xe8985=_0xf0d9ca?_0x3deffa[_0xd9d9('0x29')]:_0x2aabb5['offset']+_0x2aabb5[_0xd9d9('0x28')];var _0xa8a63b;if(_0xe8985>=_0x366b8b){_0xe8985=_0x366b8b;_0xa8a63b=0xc8;}else{_0xa8a63b=0xce;}_0x5243e9[_0xd9d9('0x24')](_0xa8a63b);return _0x5243e9[_0xd9d9('0x2a')]('Content-Range',_0x3c9f33+'-'+_0xe8985+'/'+_0x366b8b)[_0xd9d9('0x25')](_0x3deffa);}return null;};}function patchUpdates(_0x43ba18){return function(_0x58feb0){try{jsonpatch[_0xd9d9('0x2b')](_0x58feb0,_0x43ba18,!![]);}catch(_0x4bf074){return BPromise[_0xd9d9('0x2c')](_0x4bf074);}return _0x58feb0[_0xd9d9('0x2d')]();};}function saveUpdates(_0x12ff53,_0x8cc5ff){return function(_0x35c43b){if(_0x35c43b){return _0x35c43b['update'](_0x12ff53)['then'](function(_0x468c11){return _0x468c11;});}return null;};}function removeEntity(_0x4eac01,_0x298147){return function(_0x3f1fde){if(_0x3f1fde){return _0x3f1fde['destroy']()[_0xd9d9('0x1b')](function(){_0x4eac01[_0xd9d9('0x24')](0xcc)[_0xd9d9('0x2e')]();});}};}function handleEntityNotFound(_0x173cf4,_0x348753){return function(_0x2afdee){if(!_0x2afdee){_0x173cf4[_0xd9d9('0x2f')](0x194);}return _0x2afdee;};}function handleError(_0x393910,_0x34ec17){_0x34ec17=_0x34ec17||0x1f4;return function(_0x22ade3){logger[_0xd9d9('0x20')](_0x22ade3[_0xd9d9('0x30')]);if(_0x22ade3['name']){delete _0x22ade3[_0xd9d9('0x31')];}_0x393910['status'](_0x34ec17)[_0xd9d9('0x32')](_0x22ade3);};}exports[_0xd9d9('0x33')]=function(_0xe5b39b,_0x22a25a){var _0x203254={},_0xbc226e={},_0x3bd31c={'count':0x0,'rows':[]};var _0x47db7f=_[_0xd9d9('0x34')](db[_0xd9d9('0x35')][_0xd9d9('0x36')],function(_0x2f6e16){return{'name':_0x2f6e16['fieldName'],'type':_0x2f6e16[_0xd9d9('0x37')][_0xd9d9('0x38')]};});_0xbc226e[_0xd9d9('0x39')]=_[_0xd9d9('0x34')](_0x47db7f,_0xd9d9('0x31'));_0xbc226e[_0xd9d9('0x3a')]=_[_0xd9d9('0x3b')](_0xe5b39b[_0xd9d9('0x3a')]);_0xbc226e[_0xd9d9('0x3c')]=_['intersection'](_0xbc226e['model'],_0xbc226e[_0xd9d9('0x3a')]);_0x203254['attributes']=_[_0xd9d9('0x3d')](_0xbc226e[_0xd9d9('0x39')],qs[_0xd9d9('0x3e')](_0xe5b39b[_0xd9d9('0x3a')][_0xd9d9('0x3e')]));_0x203254[_0xd9d9('0x3f')]=_0x203254[_0xd9d9('0x3f')]['length']?_0x203254[_0xd9d9('0x3f')]:_0xbc226e['model'];if(!_0xe5b39b[_0xd9d9('0x3a')][_0xd9d9('0x40')](_0xd9d9('0x41'))){_0x203254[_0xd9d9('0x28')]=qs[_0xd9d9('0x28')](_0xe5b39b[_0xd9d9('0x3a')][_0xd9d9('0x28')]);_0x203254['offset']=qs['offset'](_0xe5b39b[_0xd9d9('0x3a')]['offset']);}_0x203254['order']=qs[_0xd9d9('0x42')](_0xe5b39b[_0xd9d9('0x3a')]['sort']);_0x203254['where']=qs[_0xd9d9('0x3c')](_[_0xd9d9('0x43')](_0xe5b39b['query'],_0xbc226e[_0xd9d9('0x3c')]),_0x47db7f);if(_0xe5b39b[_0xd9d9('0x3a')][_0xd9d9('0x44')]){_0x203254[_0xd9d9('0x45')]=_[_0xd9d9('0x46')](_0x203254[_0xd9d9('0x45')],{'$or':_[_0xd9d9('0x34')](_0x47db7f,function(_0x182e79){if(_0x182e79[_0xd9d9('0x37')]!==_0xd9d9('0x47')){var _0x4aa85a={};_0x4aa85a[_0x182e79[_0xd9d9('0x31')]]={'$like':'%'+_0xe5b39b['query'][_0xd9d9('0x44')]+'%'};return _0x4aa85a;}})});}_0x203254=_[_0xd9d9('0x46')]({},_0x203254,_0xe5b39b[_0xd9d9('0x48')]);var _0x37cd1b={'where':_0x203254[_0xd9d9('0x45')]};return db[_0xd9d9('0x35')]['count'](_0x37cd1b)[_0xd9d9('0x1b')](function(_0x3d2ca7){_0x3bd31c['count']=_0x3d2ca7;if(_0xe5b39b['query'][_0xd9d9('0x49')]){_0x203254[_0xd9d9('0x4a')]=[{'all':!![]}];}return db[_0xd9d9('0x35')][_0xd9d9('0x4b')](_0x203254);})[_0xd9d9('0x1b')](function(_0x3b92b6){_0x3bd31c['rows']=_0x3b92b6;return _0x3bd31c;})['then'](respondWithFilteredResult(_0x22a25a,_0x203254))[_0xd9d9('0x23')](handleError(_0x22a25a,null));};exports[_0xd9d9('0x4c')]=function(_0xb73596,_0x5b2fd3){var _0xc5f98c={'raw':!![],'where':{'id':_0xb73596[_0xd9d9('0x4d')]['id']}},_0x3983c0={};_0x3983c0[_0xd9d9('0x39')]=_[_0xd9d9('0x3b')](db[_0xd9d9('0x35')][_0xd9d9('0x36')]);_0x3983c0['query']=_['keys'](_0xb73596[_0xd9d9('0x3a')]);_0x3983c0['filters']=_[_0xd9d9('0x3d')](_0x3983c0['model'],_0x3983c0[_0xd9d9('0x3a')]);_0xc5f98c[_0xd9d9('0x3f')]=_[_0xd9d9('0x3d')](_0x3983c0[_0xd9d9('0x39')],qs['fields'](_0xb73596[_0xd9d9('0x3a')][_0xd9d9('0x3e')]));_0xc5f98c[_0xd9d9('0x3f')]=_0xc5f98c[_0xd9d9('0x3f')][_0xd9d9('0x4e')]?_0xc5f98c[_0xd9d9('0x3f')]:_0x3983c0[_0xd9d9('0x39')];if(_0xb73596[_0xd9d9('0x3a')][_0xd9d9('0x49')]){_0xc5f98c[_0xd9d9('0x4a')]=[{'all':!![]}];}_0xc5f98c=_[_0xd9d9('0x46')]({},_0xc5f98c,_0xb73596['options']);return db['OpenchannelMessage'][_0xd9d9('0x4f')](_0xc5f98c)[_0xd9d9('0x1b')](handleEntityNotFound(_0x5b2fd3,null))[_0xd9d9('0x1b')](respondWithResult(_0x5b2fd3,null))['catch'](handleError(_0x5b2fd3,null));};exports['create']=function(_0x3470a9,_0xc7ea24){return db[_0xd9d9('0x35')][_0xd9d9('0x50')](_0x3470a9[_0xd9d9('0x51')],{})[_0xd9d9('0x1b')](respondWithResult(_0xc7ea24,0xc9))[_0xd9d9('0x23')](handleError(_0xc7ea24,null));};exports['update']=function(_0x9116e9,_0x5699cd){if(_0x9116e9[_0xd9d9('0x51')]['id']){delete _0x9116e9['body']['id'];}return db[_0xd9d9('0x35')][_0xd9d9('0x4f')]({'where':{'id':_0x9116e9[_0xd9d9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5699cd,null))[_0xd9d9('0x1b')](saveUpdates(_0x9116e9[_0xd9d9('0x51')],null))[_0xd9d9('0x1b')](respondWithResult(_0x5699cd,null))['catch'](handleError(_0x5699cd,null));};exports[_0xd9d9('0x52')]=function(_0x14547c,_0x19ed49){return db[_0xd9d9('0x35')][_0xd9d9('0x4f')]({'where':{'id':_0x14547c[_0xd9d9('0x4d')]['id']}})[_0xd9d9('0x1b')](handleEntityNotFound(_0x19ed49,null))['then'](removeEntity(_0x19ed49,null))[_0xd9d9('0x23')](handleError(_0x19ed49,null));};exports[_0xd9d9('0x53')]=function(_0x5c950b,_0x23cf8b){return db[_0xd9d9('0x35')]['describe']()[_0xd9d9('0x1b')](respondWithResult(_0x23cf8b,null))[_0xd9d9('0x23')](handleError(_0x23cf8b,null));};var interaction_log=require(_0xd9d9('0x11'))(_0xd9d9('0x54'));exports[_0xd9d9('0x55')]=function(_0x198006,_0x4b9afd,_0x3aa961){var _0x446f1c={'agent':{},'channel':_0xd9d9('0x56')};if(_0x198006['body']['id']){delete _0x198006[_0xd9d9('0x51')]['id'];}_0x198006[_0xd9d9('0x51')][_0xd9d9('0x57')]=!![];_0x198006['body'][_0xd9d9('0x58')]=moment()[_0xd9d9('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x198006[_0xd9d9('0x51')][_0xd9d9('0x5a')]=_0x198006[_0xd9d9('0x51')][_0xd9d9('0x5a')]||_0x198006['user']['id'];_0x446f1c['agent']['id']=_0x198006['body']['UserId'];return db['OpenchannelMessage'][_0xd9d9('0x4f')]({'where':{'id':_0x198006[_0xd9d9('0x4d')]['id'],'UserId':null}})[_0xd9d9('0x1b')](handleEntityNotFound(_0x4b9afd,null))[_0xd9d9('0x1b')](saveUpdates(_0x198006[_0xd9d9('0x51')],null))[_0xd9d9('0x1b')](function(_0x354557){if(_0x354557){_0x446f1c[_0xd9d9('0x21')]=_0x354557['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x354557['OpenchannelInteractionId']}});}return null;})[_0xd9d9('0x1b')](handleEntityNotFound(_0x4b9afd,null))['then'](function(_0x4c1eab){if(_0x4c1eab){return _0x4c1eab[_0xd9d9('0x5b')]({'UserId':_0x198006[_0xd9d9('0x51')][_0xd9d9('0x5a')],'read1stAt':_[_0xd9d9('0x5c')](_0x4c1eab[_0xd9d9('0x5d')])?moment()[_0xd9d9('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd9d9('0x1b')](function(_0x42fb08){if(_0x42fb08){_0x446f1c['interaction']=_0x42fb08[_0xd9d9('0x5e')]({'plain':!![]});interaction_log[_0xd9d9('0x5f')](_0xd9d9('0x60'),_0x198006[_0xd9d9('0x61')]['id'],_0x198006[_0xd9d9('0x61')][_0xd9d9('0x31')],_0x198006[_0xd9d9('0x61')][_0xd9d9('0x62')],_0x446f1c[_0xd9d9('0x63')]['id'],_0x198006[_0xd9d9('0x51')]?JSON[_0xd9d9('0x1f')](_0x198006[_0xd9d9('0x51')]):_0xd9d9('0x64'));return respondWithRpcPromise(_0xd9d9('0x65'),_0xd9d9('0x66'),_0x446f1c);}return null;})[_0xd9d9('0x1b')](function(_0xdd1d9f){var _0x4b46ee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xdd1d9f[_0xd9d9('0x21')][_0xd9d9('0x67')];return db['sequelize'][_0xd9d9('0x3a')](_0x4b46ee,{'type':db[_0xd9d9('0x68')][_0xd9d9('0x69')]['SELECT'],'raw':!![]})['then'](function(_0x4c2733){return _0x4c2733;});})['then'](function(_0x4ba06e){if(_0x4ba06e){_0x446f1c[_0xd9d9('0x21')][_0xd9d9('0x6a')]=_0x4ba06e[0x0];if(!_0x198006['body']['UserId'])return;return db['User'][_0xd9d9('0x4f')]({'where':{'id':_0x198006['body'][_0xd9d9('0x5a')],'role':_0xd9d9('0x6b')},'attributes':['id',_0xd9d9('0x31'),_0xd9d9('0x6c'),'email',_0xd9d9('0x6d')],'raw':!![]});}return null;})[_0xd9d9('0x1b')](function(_0x191cf0){if(!_0x191cf0)return null;_0x446f1c['message']['agent']=_0x191cf0;return _0x446f1c;})[_0xd9d9('0x1b')](function(_0x37e0a9){if(_0x37e0a9){if(_0x198006[_0xd9d9('0x51')][_0xd9d9('0x6e')]){_0x446f1c[_0xd9d9('0x21')][_0xd9d9('0x6f')]=util[_0xd9d9('0x59')](_0xd9d9('0x70'),_0x198006[_0xd9d9('0x61')]['name']);_0x446f1c[_0xd9d9('0x21')][_0xd9d9('0x71')]=_0x446f1c[_0xd9d9('0x71')];_0x446f1c[_0xd9d9('0x21')][_0xd9d9('0x72')]=_0x446f1c[_0xd9d9('0x71')];_0x446f1c[_0xd9d9('0x21')][_0xd9d9('0x73')]=_0xd9d9('0x55');return respondWithRpcPromise(_0xd9d9('0x74'),_0xd9d9('0x74'),{'event':_0xd9d9('0x75'),'message':_0x446f1c[_0xd9d9('0x21')]},client9002)[_0xd9d9('0x1b')](function(){return _0x446f1c;});}return _0x446f1c;}return null;})[_0xd9d9('0x1b')](respondWithResult(_0x4b9afd,null))[_0xd9d9('0x23')](handleError(_0x4b9afd,null));};var interaction_log=require(_0xd9d9('0x11'))(_0xd9d9('0x54'));exports[_0xd9d9('0x2c')]=function(_0x6dc99b,_0x4dd8b1,_0x23e3fb){var _0x5cc16f={'agent':{},'channel':_0xd9d9('0x56')};if(_0x6dc99b[_0xd9d9('0x51')]['id']){delete _0x6dc99b['body']['id'];}_0x6dc99b['body'][_0xd9d9('0x5a')]=_0x6dc99b[_0xd9d9('0x51')]['UserId']||_0x6dc99b['user']['id'];_0x5cc16f['agent']['id']=_0x6dc99b[_0xd9d9('0x51')][_0xd9d9('0x5a')];return db['OpenchannelMessage'][_0xd9d9('0x4f')]({'where':{'id':_0x6dc99b[_0xd9d9('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4dd8b1,null))[_0xd9d9('0x1b')](function(_0x25c9c6){if(_0x25c9c6){_0x5cc16f[_0xd9d9('0x21')]=_0x25c9c6[_0xd9d9('0x5e')]({'plain':!![]});return db[_0xd9d9('0x76')][_0xd9d9('0x4f')]({'where':{'id':_0x25c9c6[_0xd9d9('0x77')]}});}return null;})[_0xd9d9('0x1b')](handleEntityNotFound(_0x4dd8b1,null))[_0xd9d9('0x1b')](function(_0x32c10b){if(_0x32c10b){_0x5cc16f[_0xd9d9('0x63')]=_0x32c10b[_0xd9d9('0x5e')]({'plain':!![]});interaction_log[_0xd9d9('0x5f')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6dc99b[_0xd9d9('0x61')]['id'],_0x6dc99b[_0xd9d9('0x61')][_0xd9d9('0x31')],_0x6dc99b[_0xd9d9('0x61')][_0xd9d9('0x62')],_0x5cc16f['interaction']['id'],_0x6dc99b['body']?JSON[_0xd9d9('0x1f')](_0x6dc99b[_0xd9d9('0x51')]):_0xd9d9('0x64'));return respondWithRpcPromise('RejectMessage',_0xd9d9('0x78'),_0x5cc16f);}return null;})['then'](function(_0x5f4b98){var _0x250c02=_0xd9d9('0x79')+_0x5f4b98['message']['ContactId'];return db[_0xd9d9('0x7a')]['query'](_0x250c02,{'type':db[_0xd9d9('0x68')][_0xd9d9('0x69')][_0xd9d9('0x7b')],'raw':!![]})[_0xd9d9('0x1b')](function(_0x228418){return _0x228418;});})[_0xd9d9('0x1b')](function(_0x38cff4){if(_0x38cff4){_0x5cc16f['message'][_0xd9d9('0x6a')]=_0x38cff4[0x0];if(!_0x6dc99b[_0xd9d9('0x51')][_0xd9d9('0x5a')])return;return db[_0xd9d9('0x7c')][_0xd9d9('0x4f')]({'where':{'id':_0x6dc99b[_0xd9d9('0x51')][_0xd9d9('0x5a')],'role':_0xd9d9('0x6b')},'attributes':['id',_0xd9d9('0x31'),'fullname',_0xd9d9('0x7d'),_0xd9d9('0x6d')],'raw':!![]});}return null;})[_0xd9d9('0x1b')](function(_0x5845ab){if(!_0x5845ab)return null;_0x5cc16f[_0xd9d9('0x21')][_0xd9d9('0x6b')]=_0x5845ab;return _0x5cc16f;})[_0xd9d9('0x1b')](function(_0x3a5906){if(_0x3a5906){_0x3a5906['message'][_0xd9d9('0x6f')]=util['format'](_0xd9d9('0x70'),_0x6dc99b[_0xd9d9('0x61')][_0xd9d9('0x31')]);_0x3a5906['message'][_0xd9d9('0x71')]=_0x5cc16f[_0xd9d9('0x71')];_0x3a5906[_0xd9d9('0x21')][_0xd9d9('0x72')]=_0x5cc16f[_0xd9d9('0x71')];_0x3a5906[_0xd9d9('0x21')][_0xd9d9('0x73')]=_0xd9d9('0x2c');respondWithRpcPromise(_0xd9d9('0x74'),_0xd9d9('0x74'),{'event':_0xd9d9('0x7e'),'message':_0x3a5906[_0xd9d9('0x21')]},client9002);return _0x5cc16f;}return null;})['then'](respondWithResult(_0x4dd8b1,null))[_0xd9d9('0x23')](handleError(_0x4dd8b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index e4c06f1..fdb47c8 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 _0xcc7d=['hook','exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1ac9f1,_0x2de131){var _0x2924dc=function(_0x3b6c50){while(--_0x3b6c50){_0x1ac9f1['push'](_0x1ac9f1['shift']());}};_0x2924dc(++_0x2de131);}(_0xcc7d,0x7a));var _0xdcc7=function(_0x267d12,_0x57358a){_0x267d12=_0x267d12-0x0;var _0xa70361=_0xcc7d[_0x267d12];return _0xa70361;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xdcc7('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xdcc7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdcc7('0x2'),'afterDestroy':_0xdcc7('0x3')};function emitEvent(_0x167f2c){return function(_0x145e24,_0x58e264,_0x5c99bd){OpenchannelMessageEvents[_0xdcc7('0x4')](_0x167f2c+':'+_0x145e24['id'],_0x145e24);OpenchannelMessageEvents[_0xdcc7('0x4')](_0x167f2c,_0x145e24);_0x5c99bd(null);};}for(var e in events){if(events[_0xdcc7('0x5')](e)){var event=events[e];OpenchannelMessage[_0xdcc7('0x6')](e,emitEvent(event));}}module[_0xdcc7('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xde8d=['hook','exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x453241,_0x2c4634){var _0x6e5ce1=function(_0x47d684){while(--_0x47d684){_0x453241['push'](_0x453241['shift']());}};_0x6e5ce1(++_0x2c4634);}(_0xde8d,0x1b2));var _0xdde8=function(_0x9a72f,_0xed9260){_0x9a72f=_0x9a72f-0x0;var _0x1a6326=_0xde8d[_0x9a72f];return _0x1a6326;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xdde8('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xdde8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdde8('0x2'),'afterDestroy':_0xdde8('0x3')};function emitEvent(_0x25f4f9){return function(_0x3e7a44,_0x1c8e18,_0x3fa71a){OpenchannelMessageEvents[_0xdde8('0x4')](_0x25f4f9+':'+_0x3e7a44['id'],_0x3e7a44);OpenchannelMessageEvents['emit'](_0x25f4f9,_0x3e7a44);_0x3fa71a(null);};}for(var e in events){if(events[_0xdde8('0x5')](e)){var event=events[e];OpenchannelMessage[_0xdde8('0x6')](e,emitEvent(event));}}module[_0xdde8('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index f46fa88..07c6ca2 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 _0x50d4=['get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','threadId','Interaction','update','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT'];(function(_0x324b14,_0x177956){var _0x5c3bb5=function(_0xa74a72){while(--_0xa74a72){_0x324b14['push'](_0x324b14['shift']());}};_0x5c3bb5(++_0x177956);}(_0x50d4,0x164));var _0x450d=function(_0x44426b,_0x1d3819){_0x44426b=_0x44426b-0x0;var _0x170754=_0x50d4[_0x44426b];return _0x170754;};'use strict';var _=require(_0x450d('0x0'));var util=require(_0x450d('0x1'));var logger=require(_0x450d('0x2'))(_0x450d('0x3'));var moment=require('moment');var BPromise=require(_0x450d('0x4'));var rp=require(_0x450d('0x5'));var fs=require('fs');var path=require(_0x450d('0x6'));var rimraf=require(_0x450d('0x7'));var config=require(_0x450d('0x8'));var attributes=require(_0x450d('0x9'));module[_0x450d('0xa')]=function(_0x11bef3,_0x2bfd9c){return _0x11bef3['define']('OpenchannelMessage',attributes,{'tableName':_0x450d('0xb'),'paranoid':![],'indexes':[{'name':_0x450d('0xc'),'fields':[_0x450d('0xd')],'type':_0x450d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22f024,_0x2c866a,_0x524d65){var _0x455dfb=_0x11bef3['models'];var _0x2078c0=_0x22f024[_0x450d('0xf')]({'plain':!![]});if(_0x2078c0['direction'][_0x450d('0x10')]()==='in'||_0x2078c0[_0x450d('0x11')][_0x450d('0x10')]()===_0x450d('0x12')&&!_0x2078c0[_0x450d('0x13')]&&!_[_0x450d('0x14')](_0x2078c0[_0x450d('0x15')])){_0x455dfb[_0x450d('0x16')]['findOne']({'where':{'id':_0x2078c0[_0x450d('0x17')]}})['then'](function(_0x9d18ee){if(_0x9d18ee){_0x9d18ee['update']({'lastMsgAt':_0x2078c0[_0x450d('0x18')],'lastMsgDirection':_0x2078c0[_0x450d('0x11')][_0x450d('0x10')]()});}})[_0x450d('0x19')](function(_0x526dce){console[_0x450d('0x1a')](_0x526dce);});}if(_0x2078c0[_0x450d('0x11')]===_0x450d('0x12')&&!_0x2078c0['secret']){var _0x2187ba;_0x455dfb[_0x450d('0x1b')][_0x450d('0x1c')]()[_0x450d('0x1d')](function(_0x3d69b2){return _0x455dfb[_0x450d('0x1e')][_0x450d('0x1f')]({'where':{'id':_0x2078c0[_0x450d('0x20')]},'include':[{'model':_0x455dfb[_0x450d('0x16')],'as':_0x450d('0x21'),'where':{'id':_0x2078c0[_0x450d('0x17')]},'limit':0x1,'include':[{'model':_0x455dfb[_0x450d('0x1b')],'as':_0x450d('0x22'),'attributes':_[_0x450d('0x23')](_0x3d69b2)}]}]});})[_0x450d('0x1d')](function(_0x260c87){_0x2187ba=_0x260c87[_0x450d('0xf')]({'plain':!![]});if(_0x2187ba&&_0x2187ba[_0x450d('0x24')]){logger[_0x450d('0x25')](_0x450d('0x26'),'afterCreate',util[_0x450d('0x27')](_0x450d('0x28'),_0x2078c0['id'],_0x2187ba['replyUri']));if(_0x2187ba['Interactions']&&_0x2187ba[_0x450d('0x21')][_0x450d('0x29')]){_0x2078c0['Interaction']=_[_0x450d('0x2a')](_0x2187ba['Interactions'][0x0],_0x450d('0x22'));_0x2078c0[_0x450d('0x22')]=_0x2187ba['Interactions'][0x0][_0x450d('0x22')];}var _0x2c866a={'method':_0x450d('0x2b'),'uri':encodeURI(_0x2187ba['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2c866a[_0x450d('0x2c')]){case'GET':_0x2c866a['qs']=_0x2078c0;break;case _0x450d('0x2b'):_0x2c866a['body']=_0x2078c0;break;}return rp(_0x2c866a)[_0x450d('0x1d')](function(_0x216950){logger[_0x450d('0x25')](_0x450d('0x26'),'afterCreate',util[_0x450d('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2078c0['id'],_0x2187ba[_0x450d('0x24')]));if(_0x216950[_0x450d('0xd')][_0x450d('0x2d')]&&_0x216950[_0x450d('0xd')]['threadId']!=_0x2078c0[_0x450d('0x2e')][_0x450d('0x2d')]){return _0x455dfb[_0x450d('0x16')][_0x450d('0x2f')]({'threadId':_0x216950['body']['threadId']},{'where':{'id':_0x2078c0['Interaction']['id']}});}else{return;}})[_0x450d('0x1d')](function(){return _0x22f024['update']({'read':!![]});})[_0x450d('0x19')](function(_0x38d51b){logger[_0x450d('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0x450d('0x30'),util[_0x450d('0x31')](_0x38d51b,{'showHidden':![],'depth':null}));_0x524d65();});}else{_0x524d65();}})[_0x450d('0x32')](function(){_0x524d65();});}else{_0x524d65();}}},'charset':_0x450d('0x33'),'collate':_0x450d('0x34')});}; \ No newline at end of file +var _0x3ccc=['afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','then','update','createdAt','direction','error','CmContact','OpenchannelAccount','find','Interactions','OpenchannelInteractionId','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interaction','method','GET','POST'];(function(_0x48ef63,_0x56862a){var _0x3ceeb4=function(_0x50c8e4){while(--_0x50c8e4){_0x48ef63['push'](_0x48ef63['shift']());}};_0x3ceeb4(++_0x56862a);}(_0x3ccc,0x1c1));var _0xc3cc=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x3ccc[_0x142ec2];return _0x45ef4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3cc('0x0'))(_0xc3cc('0x1'));var moment=require(_0xc3cc('0x2'));var BPromise=require(_0xc3cc('0x3'));var rp=require(_0xc3cc('0x4'));var fs=require('fs');var path=require(_0xc3cc('0x5'));var rimraf=require(_0xc3cc('0x6'));var config=require('../../config/environment');var attributes=require(_0xc3cc('0x7'));module[_0xc3cc('0x8')]=function(_0x57c568,_0x236b70){return _0x57c568[_0xc3cc('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xc3cc('0xa'),'paranoid':![],'indexes':[{'name':_0xc3cc('0xb'),'fields':[_0xc3cc('0xc')],'type':_0xc3cc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x428862,_0x1a5b82,_0x1b1a4d){var _0x29fcf2=_0x57c568['models'];var _0x3f6e5f=_0x428862['get']({'plain':!![]});if(_0x3f6e5f['direction'][_0xc3cc('0xe')]()==='in'||_0x3f6e5f['direction'][_0xc3cc('0xe')]()===_0xc3cc('0xf')&&!_0x3f6e5f[_0xc3cc('0x10')]&&!_['isNil'](_0x3f6e5f[_0xc3cc('0x11')])){_0x29fcf2[_0xc3cc('0x12')][_0xc3cc('0x13')]({'where':{'id':_0x3f6e5f['OpenchannelInteractionId']}})[_0xc3cc('0x14')](function(_0xfb9ec5){if(_0xfb9ec5){_0xfb9ec5[_0xc3cc('0x15')]({'lastMsgAt':_0x3f6e5f[_0xc3cc('0x16')],'lastMsgDirection':_0x3f6e5f[_0xc3cc('0x17')][_0xc3cc('0xe')]()});}})['catch'](function(_0x614890){console[_0xc3cc('0x18')](_0x614890);});}if(_0x3f6e5f[_0xc3cc('0x17')]===_0xc3cc('0xf')&&!_0x3f6e5f['secret']){var _0x12eadd;_0x29fcf2[_0xc3cc('0x19')]['describe']()[_0xc3cc('0x14')](function(_0x3ab9a9){return _0x29fcf2[_0xc3cc('0x1a')][_0xc3cc('0x1b')]({'where':{'id':_0x3f6e5f['OpenchannelAccountId']},'include':[{'model':_0x29fcf2[_0xc3cc('0x12')],'as':_0xc3cc('0x1c'),'where':{'id':_0x3f6e5f[_0xc3cc('0x1d')]},'limit':0x1,'include':[{'model':_0x29fcf2[_0xc3cc('0x19')],'as':_0xc3cc('0x1e'),'attributes':_[_0xc3cc('0x1f')](_0x3ab9a9)}]}]});})[_0xc3cc('0x14')](function(_0x3d3f98){_0x12eadd=_0x3d3f98['get']({'plain':!![]});if(_0x12eadd&&_0x12eadd['replyUri']){logger[_0xc3cc('0x20')](_0xc3cc('0x21'),'afterCreate',util[_0xc3cc('0x22')](_0xc3cc('0x23'),_0x3f6e5f['id'],_0x12eadd[_0xc3cc('0x24')]));if(_0x12eadd[_0xc3cc('0x1c')]&&_0x12eadd['Interactions']['length']){_0x3f6e5f[_0xc3cc('0x25')]=_['omit'](_0x12eadd[_0xc3cc('0x1c')][0x0],'Contact');_0x3f6e5f[_0xc3cc('0x1e')]=_0x12eadd[_0xc3cc('0x1c')][0x0]['Contact'];}var _0x1a5b82={'method':'POST','uri':encodeURI(_0x12eadd[_0xc3cc('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1a5b82[_0xc3cc('0x26')]){case _0xc3cc('0x27'):_0x1a5b82['qs']=_0x3f6e5f;break;case _0xc3cc('0x28'):_0x1a5b82[_0xc3cc('0xc')]=_0x3f6e5f;break;}return rp(_0x1a5b82)['then'](function(_0x5e0aa1){logger[_0xc3cc('0x20')](_0xc3cc('0x21'),_0xc3cc('0x29'),util['format'](_0xc3cc('0x2a'),_0x3f6e5f['id'],_0x12eadd[_0xc3cc('0x24')]));if(_0x5e0aa1[_0xc3cc('0xc')][_0xc3cc('0x2b')]&&_0x5e0aa1[_0xc3cc('0xc')][_0xc3cc('0x2b')]!=_0x3f6e5f[_0xc3cc('0x25')][_0xc3cc('0x2b')]){return _0x29fcf2['OpenchannelInteraction'][_0xc3cc('0x15')]({'threadId':_0x5e0aa1[_0xc3cc('0xc')][_0xc3cc('0x2b')]},{'where':{'id':_0x3f6e5f[_0xc3cc('0x25')]['id']}});}else{return;}})[_0xc3cc('0x14')](function(){return _0x428862['update']({'read':!![]});})[_0xc3cc('0x2c')](function(_0x1b28b3){logger[_0xc3cc('0x18')](_0xc3cc('0x21'),_0xc3cc('0x29'),util[_0xc3cc('0x2d')](_0x1b28b3,{'showHidden':![],'depth':null}));_0x1b1a4d();});}else{_0x1b1a4d();}})[_0xc3cc('0x2e')](function(){_0x1b1a4d();});}else{_0x1b1a4d();}}},'charset':_0xc3cc('0x2f'),'collate':_0xc3cc('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d787b75..9339dcc 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x13652f,_0x5ebf97){var _0x942df0=function(_0x4cdef5){while(--_0x4cdef5){_0x13652f['push'](_0x13652f['shift']());}};_0x942df0(++_0x5ebf97);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fdd0a,_0xa1e087){_0x3fdd0a=_0x3fdd0a-0x0;var _0x7c0549=_0x2ef3[_0x3fdd0a];return _0x7c0549;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x39efc2,_0x15d178){var _0x4eab90=function(_0x1a91c7){while(--_0x1a91c7){_0x39efc2['push'](_0x39efc2['shift']());}};_0x4eab90(++_0x15d178);}(_0xadb5,0xad));var _0x5adb=function(_0x5d6a7d,_0x803d99){_0x5d6a7d=_0x5d6a7d-0x0;var _0x159b85=_0xadb5[_0x5d6a7d];return _0x159b85;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 77e2bc5..627a63c 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 _0xa7e6=['save','remove','update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0xf75c37,_0x2fa1c7){var _0x568a1f=function(_0x2246b5){while(--_0x2246b5){_0xf75c37['push'](_0xf75c37['shift']());}};_0x568a1f(++_0x2fa1c7);}(_0xa7e6,0x74));var _0x6a7e=function(_0x374214,_0x262429){_0x374214=_0x374214-0x0;var _0x402719=_0xa7e6[_0x374214];return _0x402719;};'use strict';var OpenchannelMessageEvents=require(_0x6a7e('0x0'));var events=[_0x6a7e('0x1'),_0x6a7e('0x2'),_0x6a7e('0x3')];function createListener(_0x67fa72,_0x21c1de){return function(_0x4c809c){_0x21c1de[_0x6a7e('0x4')](_0x67fa72,_0x4c809c);};}function removeListener(_0x8787b5,_0x1ea310){return function(){OpenchannelMessageEvents[_0x6a7e('0x5')](_0x8787b5,_0x1ea310);};}exports[_0x6a7e('0x6')]=function(_0x599006){for(var _0x79df6f=0x0,_0x16249d=events[_0x6a7e('0x7')];_0x79df6f<_0x16249d;_0x79df6f++){var _0x342c96=events[_0x79df6f];var _0x45e92e=createListener(_0x6a7e('0x8')+_0x342c96,_0x599006);OpenchannelMessageEvents['on'](_0x342c96,_0x45e92e);}}; \ No newline at end of file +var _0xfce5=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x520776,_0x1cd9d7){var _0x5b91bb=function(_0x15c0b8){while(--_0x15c0b8){_0x520776['push'](_0x520776['shift']());}};_0x5b91bb(++_0x1cd9d7);}(_0xfce5,0x1d5));var _0x5fce=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0xfce5[_0xabbd65];return _0x1d005a;};'use strict';var OpenchannelMessageEvents=require(_0x5fce('0x0'));var events=[_0x5fce('0x1'),_0x5fce('0x2'),_0x5fce('0x3')];function createListener(_0x4e1e3b,_0x33bbff){return function(_0x39d4f0){_0x33bbff[_0x5fce('0x4')](_0x4e1e3b,_0x39d4f0);};}function removeListener(_0x56a3fb,_0x301c5c){return function(){OpenchannelMessageEvents[_0x5fce('0x5')](_0x56a3fb,_0x301c5c);};}exports[_0x5fce('0x6')]=function(_0x3a1256){for(var _0x47e830=0x0,_0x345bce=events[_0x5fce('0x7')];_0x47e830<_0x345bce;_0x47e830++){var _0x302a2d=events[_0x47e830];var _0x3ff878=createListener(_0x5fce('0x8')+_0x302a2d,_0x3a1256);OpenchannelMessageEvents['on'](_0x302a2d,_0x3ff878);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f046376..82faeef 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 _0xd4b1=['addTeams','/:id/users','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','create','post'];(function(_0x314f9f,_0x48227c){var _0x1b6484=function(_0xa3cab){while(--_0xa3cab){_0x314f9f['push'](_0x314f9f['shift']());}};_0x1b6484(++_0x48227c);}(_0xd4b1,0x17f));var _0x1d4b=function(_0x408cc5,_0x459ed9){_0x408cc5=_0x408cc5-0x0;var _0x28b5fe=_0xd4b1[_0x408cc5];return _0x28b5fe;};'use strict';var multer=require(_0x1d4b('0x0'));var util=require(_0x1d4b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1d4b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1d4b('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x1d4b('0x4')]('/',auth['isAuthenticated'](),controller[_0x1d4b('0x5')]);router['get'](_0x1d4b('0x6'),auth['isAuthenticated'](),controller[_0x1d4b('0x7')]);router[_0x1d4b('0x4')](_0x1d4b('0x8'),auth[_0x1d4b('0x9')](),controller[_0x1d4b('0xa')]);router[_0x1d4b('0x4')](_0x1d4b('0xb'),auth[_0x1d4b('0x9')](),controller[_0x1d4b('0xc')]);router[_0x1d4b('0x4')](_0x1d4b('0xd'),auth[_0x1d4b('0x9')](),controller[_0x1d4b('0xe')]);router[_0x1d4b('0x4')]('/:id/users',auth[_0x1d4b('0x9')](),controller['getAgents']);router['post']('/',auth[_0x1d4b('0x9')](),controller[_0x1d4b('0xf')]);router[_0x1d4b('0x10')]('/:id/teams',auth[_0x1d4b('0x9')](),controller[_0x1d4b('0x11')]);router['post'](_0x1d4b('0x12'),auth[_0x1d4b('0x9')](),controller['addAgents']);router[_0x1d4b('0x13')](_0x1d4b('0x8'),auth[_0x1d4b('0x9')](),controller['update']);router[_0x1d4b('0x14')](_0x1d4b('0x8'),auth[_0x1d4b('0x9')](),controller[_0x1d4b('0x15')]);router[_0x1d4b('0x14')](_0x1d4b('0xd'),auth[_0x1d4b('0x9')](),controller[_0x1d4b('0x16')]);router[_0x1d4b('0x14')](_0x1d4b('0x12'),auth['isAuthenticated'](),controller[_0x1d4b('0x17')]);module[_0x1d4b('0x18')]=router; \ No newline at end of file +var _0x4d74=['delete','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update'];(function(_0x23bf8e,_0x278c9a){var _0x70711f=function(_0xebfb8a){while(--_0xebfb8a){_0x23bf8e['push'](_0x23bf8e['shift']());}};_0x70711f(++_0x278c9a);}(_0x4d74,0x1e9));var _0x44d7=function(_0x110479,_0x492d7b){_0x110479=_0x110479-0x0;var _0x55335=_0x4d74[_0x110479];return _0x55335;};'use strict';var multer=require(_0x44d7('0x0'));var util=require(_0x44d7('0x1'));var path=require(_0x44d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x44d7('0x3')]();var fs_extra=require(_0x44d7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x44d7('0x5'));var config=require(_0x44d7('0x6'));var controller=require(_0x44d7('0x7'));router[_0x44d7('0x8')]('/',auth[_0x44d7('0x9')](),controller['index']);router['get'](_0x44d7('0xa'),auth[_0x44d7('0x9')](),controller[_0x44d7('0xb')]);router['get'](_0x44d7('0xc'),auth[_0x44d7('0x9')](),controller[_0x44d7('0xd')]);router[_0x44d7('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x44d7('0xe'),auth[_0x44d7('0x9')](),controller[_0x44d7('0xf')]);router['get'](_0x44d7('0x10'),auth[_0x44d7('0x9')](),controller[_0x44d7('0x11')]);router[_0x44d7('0x12')]('/',auth[_0x44d7('0x9')](),controller[_0x44d7('0x13')]);router[_0x44d7('0x12')](_0x44d7('0xe'),auth[_0x44d7('0x9')](),controller[_0x44d7('0x14')]);router[_0x44d7('0x12')](_0x44d7('0x10'),auth[_0x44d7('0x9')](),controller[_0x44d7('0x15')]);router[_0x44d7('0x16')](_0x44d7('0xc'),auth[_0x44d7('0x9')](),controller[_0x44d7('0x17')]);router['delete']('/:id',auth[_0x44d7('0x9')](),controller['destroy']);router[_0x44d7('0x18')](_0x44d7('0xe'),auth[_0x44d7('0x9')](),controller['removeTeams']);router[_0x44d7('0x18')](_0x44d7('0x10'),auth[_0x44d7('0x9')](),controller[_0x44d7('0x19')]);module[_0x44d7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c7033db..bcffeed 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 _0xc1b8=['name','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2e571f,_0x4eeecf){var _0x49c7bd=function(_0x3dd6e4){while(--_0x3dd6e4){_0x2e571f['push'](_0x2e571f['shift']());}};_0x49c7bd(++_0x4eeecf);}(_0xc1b8,0xe6));var _0x8c1b=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xc1b8[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x8c1b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8c1b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8c1b('0x2')]},'timeout':{'type':Sequelize[_0x8c1b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8c1b('0x4')](_0x8c1b('0x5'),'beepall',_0x8c1b('0x6'))}}; \ No newline at end of file +var _0x4d61=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0xd24f56,_0x34169e){var _0x9ca3be=function(_0x42d27f){while(--_0x42d27f){_0xd24f56['push'](_0xd24f56['shift']());}};_0x9ca3be(++_0x34169e);}(_0x4d61,0x149));var _0x14d6=function(_0x1bded9,_0x34c1d0){_0x1bded9=_0x1bded9-0x0;var _0x76ab36=_0x4d61[_0x1bded9];return _0x76ab36;};'use strict';var Sequelize=require('sequelize');module[_0x14d6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x14d6('0x1')]},'timeout':{'type':Sequelize[_0x14d6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x14d6('0x3')](_0x14d6('0x4'),_0x14d6('0x5'),_0x14d6('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 33b1d68..9413c3e 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 _0x5e01=['autoAssociation','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','openchannelPause','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','findOrCreate','emit','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','compact','transaction','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5e01,0x1ea));var _0x15e0=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x5e01[_0x335271];return _0xa9fff8;};'use strict';var emlformat=require(_0x15e0('0x0'));var rimraf=require(_0x15e0('0x1'));var zipdir=require(_0x15e0('0x2'));var jsonpatch=require(_0x15e0('0x3'));var rp=require(_0x15e0('0x4'));var moment=require(_0x15e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15e0('0x6'));var util=require('util');var path=require(_0x15e0('0x7'));var sox=require(_0x15e0('0x8'));var csv=require(_0x15e0('0x9'));var ejs=require(_0x15e0('0xa'));var fs=require('fs');var fs_extra=require(_0x15e0('0xb'));var _=require('lodash');var squel=require(_0x15e0('0xc'));var crypto=require(_0x15e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x15e0('0xe'));var toCsv=require(_0x15e0('0x9'));var querystring=require(_0x15e0('0xf'));var Papa=require(_0x15e0('0x10'));var Redis=require(_0x15e0('0x11'));var authService=require(_0x15e0('0x12'));var qs=require(_0x15e0('0x13'));var as=require(_0x15e0('0x14'));var hardwareService=require(_0x15e0('0x15'));var logger=require(_0x15e0('0x16'))(_0x15e0('0x17'));var utils=require('../../config/utils');var config=require(_0x15e0('0x18'));var licenseUtil=require(_0x15e0('0x19'));var db=require(_0x15e0('0x1a'))['db'];config[_0x15e0('0x1b')]=_[_0x15e0('0x1c')](config[_0x15e0('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x15e0('0x1d'))(new Redis(config[_0x15e0('0x1b')]));require('./openchannelQueue.socket')[_0x15e0('0x1e')](socket);function respondWithStatusCode(_0x2350ce,_0x48b581){_0x48b581=_0x48b581||0xcc;return function(_0x4976d2){if(_0x4976d2){return _0x2350ce[_0x15e0('0x1f')](_0x48b581);}return _0x2350ce[_0x15e0('0x20')](_0x48b581)[_0x15e0('0x21')]();};}function respondWithResult(_0x37b031,_0x1aecce){_0x1aecce=_0x1aecce||0xc8;return function(_0x1acb58){if(_0x1acb58){return _0x37b031[_0x15e0('0x20')](_0x1aecce)['json'](_0x1acb58);}};}function respondWithFilteredResult(_0x40d8a2,_0x500a27){return function(_0x58b997){if(_0x58b997){var _0xfd9480=typeof _0x500a27[_0x15e0('0x22')]===_0x15e0('0x23')&&typeof _0x500a27['limit']===_0x15e0('0x23');var _0x4be877=_0x58b997[_0x15e0('0x24')];var _0x411466=_0xfd9480?0x0:_0x500a27[_0x15e0('0x22')];var _0x42e56f=_0xfd9480?_0x58b997[_0x15e0('0x24')]:_0x500a27['offset']+_0x500a27[_0x15e0('0x25')];var _0x3d8cfe;if(_0x42e56f>=_0x4be877){_0x42e56f=_0x4be877;_0x3d8cfe=0xc8;}else{_0x3d8cfe=0xce;}_0x40d8a2[_0x15e0('0x20')](_0x3d8cfe);return _0x40d8a2['set']('Content-Range',_0x411466+'-'+_0x42e56f+'/'+_0x4be877)[_0x15e0('0x26')](_0x58b997);}return null;};}function patchUpdates(_0x3a0ad8){return function(_0x4200aa){try{jsonpatch[_0x15e0('0x27')](_0x4200aa,_0x3a0ad8,!![]);}catch(_0x13fff1){return BPromise[_0x15e0('0x28')](_0x13fff1);}return _0x4200aa['save']();};}function saveUpdates(_0x4d8b98,_0x3adc86){return function(_0x38d092){if(_0x38d092){return _0x38d092[_0x15e0('0x29')](_0x4d8b98)['then'](function(_0x1f6c2f){return _0x1f6c2f;});}return null;};}function removeEntity(_0x194b4c,_0x3b59ff){return function(_0x37aa3b){if(_0x37aa3b){return _0x37aa3b['destroy']()[_0x15e0('0x2a')](function(){var _0x13415d=_0x37aa3b[_0x15e0('0x2b')]({'plain':!![]});var _0x1581b4=_0x15e0('0x2c');return db[_0x15e0('0x2d')][_0x15e0('0x2e')]({'where':{'type':_0x1581b4,'resourceId':_0x13415d['id']}})['then'](function(){return _0x37aa3b;});})[_0x15e0('0x2a')](function(){_0x194b4c[_0x15e0('0x20')](0xcc)[_0x15e0('0x21')]();});}};}function handleEntityNotFound(_0x462ecd,_0x3cff5f){return function(_0x12e326){if(!_0x12e326){_0x462ecd[_0x15e0('0x1f')](0x194);}return _0x12e326;};}function handleError(_0x354a07,_0x405864){_0x405864=_0x405864||0x1f4;return function(_0x18b589){logger[_0x15e0('0x2f')](_0x18b589[_0x15e0('0x30')]);if(_0x18b589['name']){delete _0x18b589['name'];}_0x354a07[_0x15e0('0x20')](_0x405864)[_0x15e0('0x31')](_0x18b589);};}exports[_0x15e0('0x32')]=function(_0x15e582,_0xf5f771){var _0x22c41d={},_0x11666a={},_0x20d71d={'count':0x0,'rows':[]};var _0x194582=_[_0x15e0('0x33')](db[_0x15e0('0x34')][_0x15e0('0x35')],function(_0x543599){return{'name':_0x543599[_0x15e0('0x36')],'type':_0x543599[_0x15e0('0x37')][_0x15e0('0x38')]};});_0x11666a[_0x15e0('0x39')]=_[_0x15e0('0x33')](_0x194582,'name');_0x11666a['query']=_['keys'](_0x15e582[_0x15e0('0x3a')]);_0x11666a['filters']=_[_0x15e0('0x3b')](_0x11666a['model'],_0x11666a[_0x15e0('0x3a')]);_0x22c41d[_0x15e0('0x3c')]=_['intersection'](_0x11666a[_0x15e0('0x39')],qs[_0x15e0('0x3d')](_0x15e582[_0x15e0('0x3a')][_0x15e0('0x3d')]));_0x22c41d['attributes']=_0x22c41d[_0x15e0('0x3c')][_0x15e0('0x3e')]?_0x22c41d['attributes']:_0x11666a['model'];if(!_0x15e582['query'][_0x15e0('0x3f')](_0x15e0('0x40'))){_0x22c41d[_0x15e0('0x25')]=qs[_0x15e0('0x25')](_0x15e582[_0x15e0('0x3a')][_0x15e0('0x25')]);_0x22c41d['offset']=qs[_0x15e0('0x22')](_0x15e582['query'][_0x15e0('0x22')]);}_0x22c41d[_0x15e0('0x41')]=qs[_0x15e0('0x42')](_0x15e582[_0x15e0('0x3a')][_0x15e0('0x42')]);_0x22c41d[_0x15e0('0x43')]=qs[_0x15e0('0x44')](_[_0x15e0('0x45')](_0x15e582[_0x15e0('0x3a')],_0x11666a[_0x15e0('0x44')]),_0x194582);if(_0x15e582['query']['filter']){_0x22c41d[_0x15e0('0x43')]=_[_0x15e0('0x46')](_0x22c41d[_0x15e0('0x43')],{'$or':_[_0x15e0('0x33')](_0x194582,function(_0x3fc2b8){if(_0x3fc2b8[_0x15e0('0x37')]!==_0x15e0('0x47')){var _0x209674={};_0x209674[_0x3fc2b8[_0x15e0('0x48')]]={'$like':'%'+_0x15e582[_0x15e0('0x3a')][_0x15e0('0x49')]+'%'};return _0x209674;}})});}_0x22c41d=_[_0x15e0('0x46')]({},_0x22c41d,_0x15e582[_0x15e0('0x4a')]);var _0x5d216a={'where':_0x22c41d[_0x15e0('0x43')]};return db['OpenchannelQueue'][_0x15e0('0x24')](_0x5d216a)[_0x15e0('0x2a')](function(_0x4f45c4){_0x20d71d[_0x15e0('0x24')]=_0x4f45c4;if(_0x15e582[_0x15e0('0x3a')]['includeAll']){_0x22c41d[_0x15e0('0x4b')]=[{'all':!![]}];}return db[_0x15e0('0x34')][_0x15e0('0x4c')](_0x22c41d);})[_0x15e0('0x2a')](function(_0xf2f3dc){_0x20d71d[_0x15e0('0x4d')]=_0xf2f3dc;return _0x20d71d;})[_0x15e0('0x2a')](respondWithFilteredResult(_0xf5f771,_0x22c41d))[_0x15e0('0x4e')](handleError(_0xf5f771,null));};exports[_0x15e0('0x4f')]=function(_0xc8f385,_0x2c7e41){var _0x48b2fc={'raw':!![],'where':{'id':_0xc8f385['params']['id']}},_0x4ef912={};_0x4ef912[_0x15e0('0x39')]=_[_0x15e0('0x50')](db['OpenchannelQueue']['rawAttributes']);_0x4ef912['query']=_[_0x15e0('0x50')](_0xc8f385[_0x15e0('0x3a')]);_0x4ef912[_0x15e0('0x44')]=_[_0x15e0('0x3b')](_0x4ef912['model'],_0x4ef912[_0x15e0('0x3a')]);_0x48b2fc[_0x15e0('0x3c')]=_[_0x15e0('0x3b')](_0x4ef912['model'],qs[_0x15e0('0x3d')](_0xc8f385['query'][_0x15e0('0x3d')]));_0x48b2fc['attributes']=_0x48b2fc[_0x15e0('0x3c')][_0x15e0('0x3e')]?_0x48b2fc[_0x15e0('0x3c')]:_0x4ef912[_0x15e0('0x39')];if(_0xc8f385[_0x15e0('0x3a')][_0x15e0('0x51')]){_0x48b2fc['include']=[{'all':!![]}];}_0x48b2fc=_[_0x15e0('0x46')]({},_0x48b2fc,_0xc8f385[_0x15e0('0x4a')]);return db['OpenchannelQueue'][_0x15e0('0x52')](_0x48b2fc)[_0x15e0('0x2a')](handleEntityNotFound(_0x2c7e41,null))[_0x15e0('0x2a')](respondWithResult(_0x2c7e41,null))[_0x15e0('0x4e')](handleError(_0x2c7e41,null));};exports[_0x15e0('0x53')]=function(_0x4424d5,_0x4976ea){return db[_0x15e0('0x34')][_0x15e0('0x53')](_0x4424d5[_0x15e0('0x54')],{})[_0x15e0('0x2a')](function(_0x424e54){var _0x31e2ac=_0x4424d5[_0x15e0('0x55')][_0x15e0('0x2b')]({'plain':!![]});if(!_0x31e2ac)throw new Error(_0x15e0('0x56'));if(_0x31e2ac[_0x15e0('0x57')]==='user'){var _0x76e50c=_0x424e54[_0x15e0('0x2b')]({'plain':!![]});var _0x127c28=_0x15e0('0x2c');return db[_0x15e0('0x58')][_0x15e0('0x52')]({'where':{'name':_0x127c28,'userProfileId':_0x31e2ac[_0x15e0('0x59')]},'raw':!![]})[_0x15e0('0x2a')](function(_0x385a7f){if(_0x385a7f&&_0x385a7f[_0x15e0('0x5a')]===0x0){return db[_0x15e0('0x2d')][_0x15e0('0x53')]({'name':_0x76e50c['name'],'resourceId':_0x76e50c['id'],'type':_0x385a7f[_0x15e0('0x48')],'sectionId':_0x385a7f['id']},{})['then'](function(){return _0x424e54;});}else{return _0x424e54;}})[_0x15e0('0x4e')](function(_0x557165){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x557165);throw _0x557165;});}return _0x424e54;})[_0x15e0('0x2a')](respondWithResult(_0x4976ea,0xc9))[_0x15e0('0x4e')](handleError(_0x4976ea,null));};exports[_0x15e0('0x29')]=function(_0x2217dd,_0x448bbe){if(_0x2217dd[_0x15e0('0x54')]['id']){delete _0x2217dd[_0x15e0('0x54')]['id'];}return db[_0x15e0('0x34')]['find']({'where':{'id':_0x2217dd[_0x15e0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x448bbe,null))[_0x15e0('0x2a')](saveUpdates(_0x2217dd[_0x15e0('0x54')],null))[_0x15e0('0x2a')](respondWithResult(_0x448bbe,null))[_0x15e0('0x4e')](handleError(_0x448bbe,null));};exports['destroy']=function(_0x5af9a2,_0xf3ed43){return db['OpenchannelQueue']['find']({'where':{'id':_0x5af9a2['params']['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0xf3ed43,null))[_0x15e0('0x2a')](removeEntity(_0xf3ed43,null))[_0x15e0('0x4e')](handleError(_0xf3ed43,null));};exports[_0x15e0('0x5c')]=function(_0x4afd59,_0x1f406a){return db[_0x15e0('0x34')][_0x15e0('0x5c')]()['then'](respondWithResult(_0x1f406a,null))[_0x15e0('0x4e')](handleError(_0x1f406a,null));};exports[_0x15e0('0x5d')]=function(_0x5b7e5a,_0x308ca7,_0xbca83a){var _0xba8336={'raw':!![],'where':{}},_0x352f55={},_0x1d98c4;return db[_0x15e0('0x34')][_0x15e0('0x5e')]({'where':{'id':_0x5b7e5a[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0x308ca7,null))[_0x15e0('0x2a')](function(_0x1fdcfd){if(_0x1fdcfd){_0x1d98c4=_0x1fdcfd['get']({'plain':!![]});_0x352f55[_0x15e0('0x39')]=_['keys'](db[_0x15e0('0x5f')][_0x15e0('0x35')]);_0x352f55[_0x15e0('0x3a')]=_[_0x15e0('0x50')](_0x5b7e5a[_0x15e0('0x3a')]);_0x352f55[_0x15e0('0x44')]=_[_0x15e0('0x3b')](_0x352f55[_0x15e0('0x39')],_0x352f55['query']);_0xba8336[_0x15e0('0x3c')]=_[_0x15e0('0x3b')](_0x352f55[_0x15e0('0x39')],qs[_0x15e0('0x3d')](_0x5b7e5a[_0x15e0('0x3a')][_0x15e0('0x3d')]));_0xba8336[_0x15e0('0x3c')]=_0xba8336[_0x15e0('0x3c')][_0x15e0('0x3e')]?_0xba8336['attributes']:_0x352f55[_0x15e0('0x39')];if(!_0x5b7e5a[_0x15e0('0x3a')][_0x15e0('0x3f')]('nolimit')){_0xba8336[_0x15e0('0x25')]=qs[_0x15e0('0x25')](_0x5b7e5a[_0x15e0('0x3a')]['limit']);_0xba8336[_0x15e0('0x22')]=qs[_0x15e0('0x22')](_0x5b7e5a[_0x15e0('0x3a')][_0x15e0('0x22')]);}_0xba8336[_0x15e0('0x41')]=qs[_0x15e0('0x42')](_0x5b7e5a[_0x15e0('0x3a')]['sort']);_0xba8336[_0x15e0('0x43')]=qs[_0x15e0('0x44')](_[_0x15e0('0x45')](_0x5b7e5a['query'],_0x352f55[_0x15e0('0x44')]));_0xba8336['where'][_0x15e0('0x60')]=_0x1fdcfd['id'];if(_0x5b7e5a[_0x15e0('0x3a')]['filter']){_0xba8336[_0x15e0('0x43')]=_[_0x15e0('0x46')](_0xba8336['where'],{'$or':_[_0x15e0('0x33')](_0xba8336[_0x15e0('0x3c')],function(_0x360dd2){var _0x5181dc={};_0x5181dc[_0x360dd2]={'$like':'%'+_0x5b7e5a[_0x15e0('0x3a')][_0x15e0('0x49')]+'%'};return _0x5181dc;})});}_0xba8336=_[_0x15e0('0x46')]({},_0xba8336,_0x5b7e5a['options']);return db['UserOpenchannelQueue'][_0x15e0('0x4c')](_0xba8336);}})[_0x15e0('0x2a')](function(_0x284cb4){if(_0x284cb4){return db[_0x15e0('0x61')][_0x15e0('0x62')]({'where':{'id':_[_0x15e0('0x33')](_0x284cb4,'UserId'),'role':_0x15e0('0x63')},'attributes':['id','name','openchannelPause',_0x15e0('0x64'),_0x15e0('0x65')]});}})['then'](function(_0x28a89c){if(_0x28a89c){return{'count':_0x28a89c[_0x15e0('0x24')],'rows':_[_0x15e0('0x33')](_0x28a89c[_0x15e0('0x4d')],function(_0x96b6f6){return{'membername':_0x96b6f6['name'],'UserId':_0x96b6f6['id'],'queue_name':_0x1d98c4[_0x15e0('0x48')],'OpenchannelQueueId':_0x1d98c4['id'],'interface':util[_0x15e0('0x66')](_0x15e0('0x67'),'SIP',_0x96b6f6[_0x15e0('0x48')]),'penalty':0x0,'paused':_0x96b6f6[_0x15e0('0x68')],'createdAt':_0x96b6f6[_0x15e0('0x65')],'updatedAt':_0x96b6f6[_0x15e0('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x308ca7,_0xba8336))[_0x15e0('0x4e')](handleError(_0x308ca7,null));};exports[_0x15e0('0x69')]=function(_0x1a51f5,_0x4bd682,_0x635ae9){var _0x113660={};var _0x14cc1f={};var _0x10ef21;var _0x26d78b;return db[_0x15e0('0x34')][_0x15e0('0x5e')]({'where':{'id':_0x1a51f5[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0x4bd682,null))['then'](function(_0x19d0fe){if(_0x19d0fe){_0x10ef21=_0x19d0fe;_0x14cc1f[_0x15e0('0x39')]=_[_0x15e0('0x50')](db[_0x15e0('0x6a')][_0x15e0('0x35')]);_0x14cc1f['query']=_[_0x15e0('0x50')](_0x1a51f5[_0x15e0('0x3a')]);_0x14cc1f[_0x15e0('0x44')]=_[_0x15e0('0x3b')](_0x14cc1f[_0x15e0('0x39')],_0x14cc1f['query']);_0x113660[_0x15e0('0x3c')]=_[_0x15e0('0x3b')](_0x14cc1f[_0x15e0('0x39')],qs['fields'](_0x1a51f5['query'][_0x15e0('0x3d')]));_0x113660['attributes']=_0x113660[_0x15e0('0x3c')][_0x15e0('0x3e')]?_0x113660[_0x15e0('0x3c')]:_0x14cc1f['model'];_0x113660['order']=qs[_0x15e0('0x42')](_0x1a51f5['query']['sort']);_0x113660[_0x15e0('0x43')]=qs[_0x15e0('0x44')](_[_0x15e0('0x45')](_0x1a51f5['query'],_0x14cc1f[_0x15e0('0x44')]));if(_0x1a51f5[_0x15e0('0x3a')][_0x15e0('0x49')]){_0x113660['where']=_['merge'](_0x113660[_0x15e0('0x43')],{'$or':_[_0x15e0('0x33')](_0x113660[_0x15e0('0x3c')],function(_0xe8b365){var _0x57fd5d={};_0x57fd5d[_0xe8b365]={'$like':'%'+_0x1a51f5[_0x15e0('0x3a')][_0x15e0('0x49')]+'%'};return _0x57fd5d;})});}_0x113660=_['merge']({},_0x113660,_0x1a51f5[_0x15e0('0x4a')]);return _0x10ef21[_0x15e0('0x69')](_0x113660);}})[_0x15e0('0x2a')](function(_0x3589aa){if(_0x3589aa){_0x26d78b=_0x3589aa[_0x15e0('0x3e')];if(!_0x1a51f5[_0x15e0('0x3a')][_0x15e0('0x3f')](_0x15e0('0x40'))){_0x113660['limit']=qs[_0x15e0('0x25')](_0x1a51f5[_0x15e0('0x3a')][_0x15e0('0x25')]);_0x113660['offset']=qs[_0x15e0('0x22')](_0x1a51f5[_0x15e0('0x3a')]['offset']);}return _0x10ef21[_0x15e0('0x69')](_0x113660);}})[_0x15e0('0x2a')](function(_0x2fe6db){if(_0x2fe6db){return _0x2fe6db?{'count':_0x26d78b,'rows':_0x2fe6db}:null;}})['then'](respondWithResult(_0x4bd682,null))[_0x15e0('0x4e')](handleError(_0x4bd682,null));};exports['addTeams']=function(_0x5d1e44,_0x2a4941,_0x31ec0f){var _0x2a6b3f=_0x5d1e44[_0x15e0('0x54')][_0x15e0('0x6b')];return db['Team'][_0x15e0('0x4c')]({'where':{'id':_0x2a6b3f},'attributes':['id'],'include':[{'model':db[_0x15e0('0x61')],'as':'Agents','attributes':['id',_0x15e0('0x48'),_0x15e0('0x6c'),_0x15e0('0x6d'),_0x15e0('0x6e')],'raw':!![]}]})[_0x15e0('0x2a')](function(_0x174100){if(_0x174100){var _0x617295=_[_0x15e0('0x6f')](_0x174100,function(_0x2c8d02){var _0x5b78d3=_0x2c8d02[_0x15e0('0x2b')]({'plain':!![]});return _0x5b78d3[_0x15e0('0x70')];});return db[_0x15e0('0x34')][_0x15e0('0x52')]({'where':{'id':_0x5d1e44[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](function(_0x318054){return db[_0x15e0('0x71')]['transaction'](function(_0x376364){return _0x318054[_0x15e0('0x72')](_0x2a6b3f,{'transaction':_0x376364})[_0x15e0('0x2a')](function(){return BPromise['each'](_0x617295,function(_0x444f2c){return db[_0x15e0('0x5f')][_0x15e0('0x73')]({'where':{'UserId':_0x444f2c['id'],'OpenchannelQueueId':_0x5d1e44[_0x15e0('0x5b')]['id']},'transaction':_0x376364});});})[_0x15e0('0x2a')](function(){_0x617295['forEach'](function(_0x4ae8cf){socket[_0x15e0('0x74')]('userOpenchannelQueue:save',{'UserId':_0x4ae8cf['id'],'OpenchannelQueueId':_0x318054['id']});});});});});}})[_0x15e0('0x2a')](respondWithStatusCode(_0x2a4941,null))['catch'](handleError(_0x2a4941,null));};exports['removeTeams']=function(_0x5bd43f,_0x4e9c43,_0x5b7c28){return db['Team'][_0x15e0('0x4c')]({'where':{'id':_0x5bd43f[_0x15e0('0x3a')][_0x15e0('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x15e0('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x15e0('0x2a')](handleEntityNotFound(_0x4e9c43,null))[_0x15e0('0x2a')](function(_0x1306c1){var _0x3580e0=_[_0x15e0('0x33')](_0x1306c1,'id');var _0x179812=[];var _0x535d41=[];var _0x51904f=squel[_0x15e0('0x75')]();_0x51904f[_0x15e0('0x76')](_0x15e0('0x77'))[_0x15e0('0x78')](_0x15e0('0x79'),'tq')['join'](_0x15e0('0x7a'),'ut',_0x15e0('0x7b'))[_0x15e0('0x43')](_0x15e0('0x7c'),_0x5bd43f['params']['id']);for(var _0x10f405=0x0;_0x10f405<_0x1306c1[_0x15e0('0x3e')];_0x10f405+=0x1){let _0x3c5353=_0x1306c1[_0x10f405];for(var _0xd54cc6=0x0;_0xd54cc6<_0x3c5353[_0x15e0('0x70')]['length'];_0xd54cc6+=0x1){let _0x5d6dda=_0x3c5353['Agents'][_0xd54cc6];var _0x58db55=_0x51904f[_0x15e0('0x7d')]();_0x58db55[_0x15e0('0x43')](_0x15e0('0x7e'),_0x5d6dda['id']);_0x535d41[_0x15e0('0x7f')](db[_0x15e0('0x71')][_0x15e0('0x3a')](_0x58db55[_0x15e0('0x80')](),{'type':db[_0x15e0('0x71')][_0x15e0('0x81')]['SELECT']})[_0x15e0('0x2a')](function(_0x3ebed0){if(_0x3ebed0['length']===0x1){return _0x5d6dda['id'];}else{var _0x4f8b8a=_[_0x15e0('0x82')](_[_0x15e0('0x33')](_0x3ebed0,'TeamId'),function(_0x1f9ef3){return _['includes'](_0x3580e0,_0x1f9ef3);});if(_0x4f8b8a){return _0x5d6dda['id'];}}}));}}return BPromise[_0x15e0('0x83')](_0x535d41)[_0x15e0('0x2a')](function(_0x353468){_0x179812=_(_0x179812)['union'](_0x353468)[_0x15e0('0x84')]()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x5bd43f[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](function(_0x344ab7){return db['sequelize'][_0x15e0('0x85')](function(_0x16e8c9){return _0x344ab7[_0x15e0('0x86')](_0x5bd43f['query'][_0x15e0('0x6b')],{'transaction':_0x16e8c9})['then'](function(){if(!_[_0x15e0('0x87')](_0x179812)){return _0x344ab7[_0x15e0('0x88')](_0x179812,{'transaction':_0x16e8c9});}})[_0x15e0('0x2a')](function(){_0x179812[_0x15e0('0x89')](function(_0x3db91a){socket[_0x15e0('0x74')](_0x15e0('0x8a'),{'UserId':_0x3db91a,'OpenchannelQueueId':_0x344ab7['id']});});});});});});})[_0x15e0('0x2a')](respondWithStatusCode(_0x4e9c43,null))[_0x15e0('0x4e')](handleError(_0x4e9c43,null));};exports[_0x15e0('0x8b')]=function(_0x2b47e6,_0x47e071,_0x16a3f4){return db[_0x15e0('0x34')][_0x15e0('0x52')]({'where':{'id':_0x2b47e6[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0x47e071,null))[_0x15e0('0x2a')](function(_0x30427b){if(_0x30427b){return _0x30427b[_0x15e0('0x8b')](_0x2b47e6[_0x15e0('0x54')][_0x15e0('0x6b')],_[_0x15e0('0x8c')](_0x2b47e6[_0x15e0('0x54')],[_0x15e0('0x6b'),'id'])||{})[_0x15e0('0x8d')](function(_0x49f309){for(var _0xf81206=0x0;_0xf81206<_0x2b47e6[_0x15e0('0x54')]['ids'][_0x15e0('0x3e')];_0xf81206+=0x1){socket[_0x15e0('0x74')](_0x15e0('0x8e'),{'UserId':Number(_0x2b47e6[_0x15e0('0x54')][_0x15e0('0x6b')][_0xf81206]),'OpenchannelQueueId':Number(_0x2b47e6['params']['id'])});}return _0x49f309;});}})[_0x15e0('0x2a')](respondWithResult(_0x47e071,null))[_0x15e0('0x4e')](handleError(_0x47e071,null));};exports[_0x15e0('0x88')]=function(_0x1e085e,_0x59e823,_0x277312){return db[_0x15e0('0x34')][_0x15e0('0x52')]({'where':{'id':_0x1e085e[_0x15e0('0x5b')]['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0x59e823,null))[_0x15e0('0x2a')](function(_0x3e16b4){if(_0x3e16b4){return _0x3e16b4[_0x15e0('0x88')](_0x1e085e['query'][_0x15e0('0x6b')])[_0x15e0('0x2a')](function(){if(_[_0x15e0('0x8f')](_0x1e085e[_0x15e0('0x3a')][_0x15e0('0x6b')])){for(var _0x14fd6f=0x0;_0x14fd6f<_0x1e085e['query'][_0x15e0('0x6b')][_0x15e0('0x3e')];_0x14fd6f+=0x1){socket[_0x15e0('0x74')](_0x15e0('0x8a'),{'UserId':Number(_0x1e085e['query'][_0x15e0('0x6b')][_0x14fd6f]),'OpenchannelQueueId':Number(_0x1e085e[_0x15e0('0x5b')]['id'])});}}else{socket[_0x15e0('0x74')](_0x15e0('0x8a'),{'UserId':Number(_0x1e085e['query'][_0x15e0('0x6b')]),'OpenchannelQueueId':Number(_0x1e085e[_0x15e0('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x59e823,null))[_0x15e0('0x4e')](handleError(_0x59e823,null));};exports[_0x15e0('0x90')]=function(_0x28f906,_0x4bcb73,_0x2c430f){var _0x251d5b={};var _0x4a7670={};var _0x7beb99;var _0x12c7f0;return db['OpenchannelQueue'][_0x15e0('0x5e')]({'where':{'id':_0x28f906['params']['id']}})[_0x15e0('0x2a')](handleEntityNotFound(_0x4bcb73,null))[_0x15e0('0x2a')](function(_0x20259c){if(_0x20259c){_0x7beb99=_0x20259c;_0x4a7670[_0x15e0('0x39')]=_['keys'](db[_0x15e0('0x61')][_0x15e0('0x35')]);_0x4a7670[_0x15e0('0x3a')]=_[_0x15e0('0x50')](_0x28f906[_0x15e0('0x3a')]);_0x4a7670[_0x15e0('0x44')]=_['intersection'](_0x4a7670['model'],_0x4a7670['query']);_0x251d5b['attributes']=_[_0x15e0('0x3b')](_0x4a7670[_0x15e0('0x39')],qs[_0x15e0('0x3d')](_0x28f906[_0x15e0('0x3a')][_0x15e0('0x3d')]));_0x251d5b[_0x15e0('0x3c')]=_0x251d5b['attributes']['length']?_0x251d5b[_0x15e0('0x3c')]:_0x4a7670['model'];_0x251d5b[_0x15e0('0x41')]=qs['sort'](_0x28f906[_0x15e0('0x3a')]['sort']);_0x251d5b['where']=qs[_0x15e0('0x44')](_['pick'](_0x28f906[_0x15e0('0x3a')],_0x4a7670[_0x15e0('0x44')]));if(_0x28f906['query'][_0x15e0('0x49')]){_0x251d5b['where']=_[_0x15e0('0x46')](_0x251d5b[_0x15e0('0x43')],{'$or':_['map'](_0x251d5b[_0x15e0('0x3c')],function(_0x4670af){var _0x5d4f39={};_0x5d4f39[_0x4670af]={'$like':'%'+_0x28f906[_0x15e0('0x3a')][_0x15e0('0x49')]+'%'};return _0x5d4f39;})});}_0x251d5b=_[_0x15e0('0x46')]({},_0x251d5b,_0x28f906[_0x15e0('0x4a')]);return _0x7beb99['getAgents'](_0x251d5b);}})[_0x15e0('0x2a')](function(_0x54d3f4){if(_0x54d3f4){_0x12c7f0=_0x54d3f4['length'];if(!_0x28f906['query']['hasOwnProperty'](_0x15e0('0x40'))){_0x251d5b[_0x15e0('0x25')]=qs[_0x15e0('0x25')](_0x28f906['query'][_0x15e0('0x25')]);_0x251d5b[_0x15e0('0x22')]=qs[_0x15e0('0x22')](_0x28f906['query'][_0x15e0('0x22')]);}return _0x7beb99['getAgents'](_0x251d5b);}})['then'](function(_0x18aa01){if(_0x18aa01){return _0x18aa01?{'count':_0x12c7f0,'rows':_0x18aa01}:null;}})[_0x15e0('0x2a')](respondWithResult(_0x4bcb73,null))['catch'](handleError(_0x4bcb73,null));}; \ No newline at end of file +var _0x69ee=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','undefined','limit','offset','count','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','OpenchannelQueueId','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x69ee,0x1ab));var _0xe69e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x69ee[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xe69e('0x0'));var rimraf=require(_0xe69e('0x1'));var zipdir=require(_0xe69e('0x2'));var jsonpatch=require(_0xe69e('0x3'));var rp=require(_0xe69e('0x4'));var moment=require(_0xe69e('0x5'));var BPromise=require(_0xe69e('0x6'));var Mustache=require('mustache');var util=require(_0xe69e('0x7'));var path=require(_0xe69e('0x8'));var sox=require(_0xe69e('0x9'));var csv=require(_0xe69e('0xa'));var ejs=require(_0xe69e('0xb'));var fs=require('fs');var fs_extra=require(_0xe69e('0xc'));var _=require(_0xe69e('0xd'));var squel=require(_0xe69e('0xe'));var crypto=require(_0xe69e('0xf'));var jsforce=require(_0xe69e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe69e('0xa'));var querystring=require(_0xe69e('0x11'));var Papa=require(_0xe69e('0x12'));var Redis=require(_0xe69e('0x13'));var authService=require(_0xe69e('0x14'));var qs=require(_0xe69e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe69e('0x16'))(_0xe69e('0x17'));var utils=require(_0xe69e('0x18'));var config=require(_0xe69e('0x19'));var licenseUtil=require(_0xe69e('0x1a'));var db=require(_0xe69e('0x1b'))['db'];config[_0xe69e('0x1c')]=_['defaults'](config[_0xe69e('0x1c')],{'host':_0xe69e('0x1d'),'port':0x18eb});var socket=require(_0xe69e('0x1e'))(new Redis(config[_0xe69e('0x1c')]));require('./openchannelQueue.socket')[_0xe69e('0x1f')](socket);function respondWithStatusCode(_0x581dab,_0xc767aa){_0xc767aa=_0xc767aa||0xcc;return function(_0x52b3cb){if(_0x52b3cb){return _0x581dab[_0xe69e('0x20')](_0xc767aa);}return _0x581dab['status'](_0xc767aa)[_0xe69e('0x21')]();};}function respondWithResult(_0x4732c7,_0xe8c37e){_0xe8c37e=_0xe8c37e||0xc8;return function(_0x4556ee){if(_0x4556ee){return _0x4732c7[_0xe69e('0x22')](_0xe8c37e)['json'](_0x4556ee);}};}function respondWithFilteredResult(_0x8e9bc7,_0x5a3ef8){return function(_0x6b682){if(_0x6b682){var _0x3c06ff=typeof _0x5a3ef8['offset']===_0xe69e('0x23')&&typeof _0x5a3ef8[_0xe69e('0x24')]===_0xe69e('0x23');var _0x3deb5f=_0x6b682['count'];var _0x1b9f87=_0x3c06ff?0x0:_0x5a3ef8[_0xe69e('0x25')];var _0x58abc3=_0x3c06ff?_0x6b682[_0xe69e('0x26')]:_0x5a3ef8[_0xe69e('0x25')]+_0x5a3ef8['limit'];var _0x4676cc;if(_0x58abc3>=_0x3deb5f){_0x58abc3=_0x3deb5f;_0x4676cc=0xc8;}else{_0x4676cc=0xce;}_0x8e9bc7[_0xe69e('0x22')](_0x4676cc);return _0x8e9bc7['set'](_0xe69e('0x27'),_0x1b9f87+'-'+_0x58abc3+'/'+_0x3deb5f)['json'](_0x6b682);}return null;};}function patchUpdates(_0x4676b4){return function(_0x5a537b){try{jsonpatch['apply'](_0x5a537b,_0x4676b4,!![]);}catch(_0xe6f06d){return BPromise[_0xe69e('0x28')](_0xe6f06d);}return _0x5a537b[_0xe69e('0x29')]();};}function saveUpdates(_0x3af728,_0xb2677){return function(_0x14b77e){if(_0x14b77e){return _0x14b77e[_0xe69e('0x2a')](_0x3af728)[_0xe69e('0x2b')](function(_0x2d0459){return _0x2d0459;});}return null;};}function removeEntity(_0x26384b,_0x514f1b){return function(_0x76384c){if(_0x76384c){return _0x76384c[_0xe69e('0x2c')]()['then'](function(){var _0x4e9d1f=_0x76384c[_0xe69e('0x2d')]({'plain':!![]});var _0x37a7c3=_0xe69e('0x2e');return db[_0xe69e('0x2f')][_0xe69e('0x2c')]({'where':{'type':_0x37a7c3,'resourceId':_0x4e9d1f['id']}})[_0xe69e('0x2b')](function(){return _0x76384c;});})[_0xe69e('0x2b')](function(){_0x26384b[_0xe69e('0x22')](0xcc)[_0xe69e('0x21')]();});}};}function handleEntityNotFound(_0x8af8a4,_0x2fc0c0){return function(_0x574488){if(!_0x574488){_0x8af8a4['sendStatus'](0x194);}return _0x574488;};}function handleError(_0x275875,_0x5a603d){_0x5a603d=_0x5a603d||0x1f4;return function(_0x513b31){logger[_0xe69e('0x30')](_0x513b31[_0xe69e('0x31')]);if(_0x513b31[_0xe69e('0x32')]){delete _0x513b31[_0xe69e('0x32')];}_0x275875[_0xe69e('0x22')](_0x5a603d)[_0xe69e('0x33')](_0x513b31);};}exports[_0xe69e('0x34')]=function(_0x43005d,_0x277fe1){var _0x3bdc7c={},_0x298e2e={},_0x4ea858={'count':0x0,'rows':[]};var _0x1f0466=_[_0xe69e('0x35')](db[_0xe69e('0x36')][_0xe69e('0x37')],function(_0x24a91a){return{'name':_0x24a91a[_0xe69e('0x38')],'type':_0x24a91a['type'][_0xe69e('0x39')]};});_0x298e2e[_0xe69e('0x3a')]=_[_0xe69e('0x35')](_0x1f0466,_0xe69e('0x32'));_0x298e2e['query']=_['keys'](_0x43005d[_0xe69e('0x3b')]);_0x298e2e[_0xe69e('0x3c')]=_[_0xe69e('0x3d')](_0x298e2e[_0xe69e('0x3a')],_0x298e2e[_0xe69e('0x3b')]);_0x3bdc7c[_0xe69e('0x3e')]=_[_0xe69e('0x3d')](_0x298e2e[_0xe69e('0x3a')],qs['fields'](_0x43005d[_0xe69e('0x3b')][_0xe69e('0x3f')]));_0x3bdc7c[_0xe69e('0x3e')]=_0x3bdc7c[_0xe69e('0x3e')][_0xe69e('0x40')]?_0x3bdc7c[_0xe69e('0x3e')]:_0x298e2e[_0xe69e('0x3a')];if(!_0x43005d[_0xe69e('0x3b')]['hasOwnProperty']('nolimit')){_0x3bdc7c[_0xe69e('0x24')]=qs[_0xe69e('0x24')](_0x43005d['query']['limit']);_0x3bdc7c[_0xe69e('0x25')]=qs['offset'](_0x43005d[_0xe69e('0x3b')]['offset']);}_0x3bdc7c[_0xe69e('0x41')]=qs[_0xe69e('0x42')](_0x43005d[_0xe69e('0x3b')]['sort']);_0x3bdc7c[_0xe69e('0x43')]=qs[_0xe69e('0x3c')](_[_0xe69e('0x44')](_0x43005d['query'],_0x298e2e[_0xe69e('0x3c')]),_0x1f0466);if(_0x43005d['query'][_0xe69e('0x45')]){_0x3bdc7c['where']=_[_0xe69e('0x46')](_0x3bdc7c['where'],{'$or':_['map'](_0x1f0466,function(_0x1cf417){if(_0x1cf417[_0xe69e('0x47')]!==_0xe69e('0x48')){var _0x24fafe={};_0x24fafe[_0x1cf417[_0xe69e('0x32')]]={'$like':'%'+_0x43005d[_0xe69e('0x3b')][_0xe69e('0x45')]+'%'};return _0x24fafe;}})});}_0x3bdc7c=_[_0xe69e('0x46')]({},_0x3bdc7c,_0x43005d[_0xe69e('0x49')]);var _0x42e975={'where':_0x3bdc7c[_0xe69e('0x43')]};return db[_0xe69e('0x36')][_0xe69e('0x26')](_0x42e975)['then'](function(_0x5612c0){_0x4ea858[_0xe69e('0x26')]=_0x5612c0;if(_0x43005d[_0xe69e('0x3b')][_0xe69e('0x4a')]){_0x3bdc7c[_0xe69e('0x4b')]=[{'all':!![]}];}return db[_0xe69e('0x36')][_0xe69e('0x4c')](_0x3bdc7c);})[_0xe69e('0x2b')](function(_0x468fae){_0x4ea858[_0xe69e('0x4d')]=_0x468fae;return _0x4ea858;})[_0xe69e('0x2b')](respondWithFilteredResult(_0x277fe1,_0x3bdc7c))[_0xe69e('0x4e')](handleError(_0x277fe1,null));};exports[_0xe69e('0x4f')]=function(_0x5dd570,_0x512982){var _0x141793={'raw':!![],'where':{'id':_0x5dd570[_0xe69e('0x50')]['id']}},_0x3aae50={};_0x3aae50[_0xe69e('0x3a')]=_[_0xe69e('0x51')](db[_0xe69e('0x36')][_0xe69e('0x37')]);_0x3aae50[_0xe69e('0x3b')]=_['keys'](_0x5dd570['query']);_0x3aae50[_0xe69e('0x3c')]=_[_0xe69e('0x3d')](_0x3aae50['model'],_0x3aae50[_0xe69e('0x3b')]);_0x141793[_0xe69e('0x3e')]=_['intersection'](_0x3aae50[_0xe69e('0x3a')],qs['fields'](_0x5dd570[_0xe69e('0x3b')][_0xe69e('0x3f')]));_0x141793['attributes']=_0x141793[_0xe69e('0x3e')][_0xe69e('0x40')]?_0x141793['attributes']:_0x3aae50['model'];if(_0x5dd570[_0xe69e('0x3b')]['includeAll']){_0x141793[_0xe69e('0x4b')]=[{'all':!![]}];}_0x141793=_[_0xe69e('0x46')]({},_0x141793,_0x5dd570[_0xe69e('0x49')]);return db[_0xe69e('0x36')][_0xe69e('0x52')](_0x141793)[_0xe69e('0x2b')](handleEntityNotFound(_0x512982,null))[_0xe69e('0x2b')](respondWithResult(_0x512982,null))[_0xe69e('0x4e')](handleError(_0x512982,null));};exports['create']=function(_0x3f64f3,_0x53b040){return db['OpenchannelQueue']['create'](_0x3f64f3[_0xe69e('0x53')],{})[_0xe69e('0x2b')](function(_0x5326e4){var _0x3ac89b=_0x3f64f3[_0xe69e('0x54')][_0xe69e('0x2d')]({'plain':!![]});if(!_0x3ac89b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ac89b[_0xe69e('0x55')]===_0xe69e('0x54')){var _0x25cd58=_0x5326e4[_0xe69e('0x2d')]({'plain':!![]});var _0x598437=_0xe69e('0x2e');return db[_0xe69e('0x56')][_0xe69e('0x52')]({'where':{'name':_0x598437,'userProfileId':_0x3ac89b[_0xe69e('0x57')]},'raw':!![]})[_0xe69e('0x2b')](function(_0xb52a35){if(_0xb52a35&&_0xb52a35[_0xe69e('0x58')]===0x0){return db[_0xe69e('0x2f')]['create']({'name':_0x25cd58[_0xe69e('0x32')],'resourceId':_0x25cd58['id'],'type':_0xb52a35['name'],'sectionId':_0xb52a35['id']},{})[_0xe69e('0x2b')](function(){return _0x5326e4;});}else{return _0x5326e4;}})[_0xe69e('0x4e')](function(_0x386e6d){logger[_0xe69e('0x30')](_0xe69e('0x59'),_0x386e6d);throw _0x386e6d;});}return _0x5326e4;})[_0xe69e('0x2b')](respondWithResult(_0x53b040,0xc9))[_0xe69e('0x4e')](handleError(_0x53b040,null));};exports[_0xe69e('0x2a')]=function(_0x17a18a,_0x392187){if(_0x17a18a[_0xe69e('0x53')]['id']){delete _0x17a18a['body']['id'];}return db[_0xe69e('0x36')][_0xe69e('0x52')]({'where':{'id':_0x17a18a['params']['id']}})['then'](handleEntityNotFound(_0x392187,null))[_0xe69e('0x2b')](saveUpdates(_0x17a18a[_0xe69e('0x53')],null))[_0xe69e('0x2b')](respondWithResult(_0x392187,null))[_0xe69e('0x4e')](handleError(_0x392187,null));};exports[_0xe69e('0x2c')]=function(_0xff35ed,_0xd29a48){return db['OpenchannelQueue'][_0xe69e('0x52')]({'where':{'id':_0xff35ed[_0xe69e('0x50')]['id']}})[_0xe69e('0x2b')](handleEntityNotFound(_0xd29a48,null))['then'](removeEntity(_0xd29a48,null))[_0xe69e('0x4e')](handleError(_0xd29a48,null));};exports[_0xe69e('0x5a')]=function(_0x140c1c,_0x350692){return db['OpenchannelQueue'][_0xe69e('0x5a')]()[_0xe69e('0x2b')](respondWithResult(_0x350692,null))[_0xe69e('0x4e')](handleError(_0x350692,null));};exports[_0xe69e('0x5b')]=function(_0x244c1c,_0x397b9b,_0x106cce){var _0x5d3253={'raw':!![],'where':{}},_0xe32f2e={},_0x28cf0d;return db['OpenchannelQueue'][_0xe69e('0x5c')]({'where':{'id':_0x244c1c[_0xe69e('0x50')]['id']}})[_0xe69e('0x2b')](handleEntityNotFound(_0x397b9b,null))[_0xe69e('0x2b')](function(_0x25d520){if(_0x25d520){_0x28cf0d=_0x25d520['get']({'plain':!![]});_0xe32f2e[_0xe69e('0x3a')]=_[_0xe69e('0x51')](db[_0xe69e('0x5d')][_0xe69e('0x37')]);_0xe32f2e['query']=_[_0xe69e('0x51')](_0x244c1c['query']);_0xe32f2e['filters']=_[_0xe69e('0x3d')](_0xe32f2e['model'],_0xe32f2e[_0xe69e('0x3b')]);_0x5d3253[_0xe69e('0x3e')]=_[_0xe69e('0x3d')](_0xe32f2e['model'],qs[_0xe69e('0x3f')](_0x244c1c['query'][_0xe69e('0x3f')]));_0x5d3253[_0xe69e('0x3e')]=_0x5d3253['attributes']['length']?_0x5d3253[_0xe69e('0x3e')]:_0xe32f2e['model'];if(!_0x244c1c['query'][_0xe69e('0x5e')](_0xe69e('0x5f'))){_0x5d3253[_0xe69e('0x24')]=qs[_0xe69e('0x24')](_0x244c1c[_0xe69e('0x3b')][_0xe69e('0x24')]);_0x5d3253[_0xe69e('0x25')]=qs[_0xe69e('0x25')](_0x244c1c['query']['offset']);}_0x5d3253[_0xe69e('0x41')]=qs['sort'](_0x244c1c[_0xe69e('0x3b')][_0xe69e('0x42')]);_0x5d3253[_0xe69e('0x43')]=qs[_0xe69e('0x3c')](_[_0xe69e('0x44')](_0x244c1c[_0xe69e('0x3b')],_0xe32f2e[_0xe69e('0x3c')]));_0x5d3253[_0xe69e('0x43')][_0xe69e('0x60')]=_0x25d520['id'];if(_0x244c1c[_0xe69e('0x3b')][_0xe69e('0x45')]){_0x5d3253['where']=_[_0xe69e('0x46')](_0x5d3253[_0xe69e('0x43')],{'$or':_['map'](_0x5d3253[_0xe69e('0x3e')],function(_0x5228de){var _0xf0ae46={};_0xf0ae46[_0x5228de]={'$like':'%'+_0x244c1c[_0xe69e('0x3b')][_0xe69e('0x45')]+'%'};return _0xf0ae46;})});}_0x5d3253=_[_0xe69e('0x46')]({},_0x5d3253,_0x244c1c[_0xe69e('0x49')]);return db['UserOpenchannelQueue']['findAll'](_0x5d3253);}})['then'](function(_0x6e9214){if(_0x6e9214){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x6e9214,_0xe69e('0x61')),'role':_0xe69e('0x62')},'attributes':['id',_0xe69e('0x32'),_0xe69e('0x63'),_0xe69e('0x64'),_0xe69e('0x65')]});}})['then'](function(_0x31e293){if(_0x31e293){return{'count':_0x31e293['count'],'rows':_['map'](_0x31e293['rows'],function(_0x3bb715){return{'membername':_0x3bb715[_0xe69e('0x32')],'UserId':_0x3bb715['id'],'queue_name':_0x28cf0d['name'],'OpenchannelQueueId':_0x28cf0d['id'],'interface':util[_0xe69e('0x66')](_0xe69e('0x67'),_0xe69e('0x68'),_0x3bb715[_0xe69e('0x32')]),'penalty':0x0,'paused':_0x3bb715[_0xe69e('0x63')],'createdAt':_0x3bb715[_0xe69e('0x65')],'updatedAt':_0x3bb715[_0xe69e('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe69e('0x2b')](respondWithFilteredResult(_0x397b9b,_0x5d3253))[_0xe69e('0x4e')](handleError(_0x397b9b,null));};exports['getTeams']=function(_0x454d61,_0x34e312,_0x450398){var _0x426256={};var _0x16e079={};var _0x463741;var _0x1e12d2;return db[_0xe69e('0x36')][_0xe69e('0x5c')]({'where':{'id':_0x454d61[_0xe69e('0x50')]['id']}})['then'](handleEntityNotFound(_0x34e312,null))[_0xe69e('0x2b')](function(_0x336f78){if(_0x336f78){_0x463741=_0x336f78;_0x16e079[_0xe69e('0x3a')]=_[_0xe69e('0x51')](db[_0xe69e('0x69')][_0xe69e('0x37')]);_0x16e079[_0xe69e('0x3b')]=_[_0xe69e('0x51')](_0x454d61[_0xe69e('0x3b')]);_0x16e079[_0xe69e('0x3c')]=_['intersection'](_0x16e079[_0xe69e('0x3a')],_0x16e079[_0xe69e('0x3b')]);_0x426256[_0xe69e('0x3e')]=_['intersection'](_0x16e079[_0xe69e('0x3a')],qs['fields'](_0x454d61[_0xe69e('0x3b')][_0xe69e('0x3f')]));_0x426256[_0xe69e('0x3e')]=_0x426256['attributes']['length']?_0x426256[_0xe69e('0x3e')]:_0x16e079[_0xe69e('0x3a')];_0x426256[_0xe69e('0x41')]=qs[_0xe69e('0x42')](_0x454d61[_0xe69e('0x3b')]['sort']);_0x426256[_0xe69e('0x43')]=qs[_0xe69e('0x3c')](_[_0xe69e('0x44')](_0x454d61[_0xe69e('0x3b')],_0x16e079[_0xe69e('0x3c')]));if(_0x454d61['query']['filter']){_0x426256[_0xe69e('0x43')]=_['merge'](_0x426256[_0xe69e('0x43')],{'$or':_[_0xe69e('0x35')](_0x426256[_0xe69e('0x3e')],function(_0x3361c0){var _0x2517cd={};_0x2517cd[_0x3361c0]={'$like':'%'+_0x454d61[_0xe69e('0x3b')]['filter']+'%'};return _0x2517cd;})});}_0x426256=_[_0xe69e('0x46')]({},_0x426256,_0x454d61['options']);return _0x463741[_0xe69e('0x6a')](_0x426256);}})[_0xe69e('0x2b')](function(_0x147fa1){if(_0x147fa1){_0x1e12d2=_0x147fa1['length'];if(!_0x454d61['query'][_0xe69e('0x5e')](_0xe69e('0x5f'))){_0x426256[_0xe69e('0x24')]=qs[_0xe69e('0x24')](_0x454d61['query']['limit']);_0x426256[_0xe69e('0x25')]=qs[_0xe69e('0x25')](_0x454d61[_0xe69e('0x3b')][_0xe69e('0x25')]);}return _0x463741[_0xe69e('0x6a')](_0x426256);}})[_0xe69e('0x2b')](function(_0x33f774){if(_0x33f774){return _0x33f774?{'count':_0x1e12d2,'rows':_0x33f774}:null;}})[_0xe69e('0x2b')](respondWithResult(_0x34e312,null))[_0xe69e('0x4e')](handleError(_0x34e312,null));};exports['addTeams']=function(_0x22154b,_0x339384,_0x46c605){var _0x137984=_0x22154b[_0xe69e('0x53')][_0xe69e('0x6b')];return db[_0xe69e('0x69')][_0xe69e('0x4c')]({'where':{'id':_0x137984},'attributes':['id'],'include':[{'model':db[_0xe69e('0x6c')],'as':_0xe69e('0x6d'),'attributes':['id',_0xe69e('0x32'),_0xe69e('0x6e'),_0xe69e('0x6f'),_0xe69e('0x70')],'raw':!![]}]})[_0xe69e('0x2b')](function(_0x2e3f53){if(_0x2e3f53){var _0x1e201d=_[_0xe69e('0x71')](_0x2e3f53,function(_0x2d85c0){var _0x1bca55=_0x2d85c0['get']({'plain':!![]});return _0x1bca55[_0xe69e('0x6d')];});return db[_0xe69e('0x36')][_0xe69e('0x52')]({'where':{'id':_0x22154b[_0xe69e('0x50')]['id']}})['then'](function(_0x3cb50d){return db['sequelize'][_0xe69e('0x72')](function(_0x417af5){return _0x3cb50d[_0xe69e('0x73')](_0x137984,{'transaction':_0x417af5})[_0xe69e('0x2b')](function(){return BPromise[_0xe69e('0x74')](_0x1e201d,function(_0x37051f){return db[_0xe69e('0x5d')][_0xe69e('0x75')]({'where':{'UserId':_0x37051f['id'],'OpenchannelQueueId':_0x22154b['params']['id']},'transaction':_0x417af5});});})['then'](function(){_0x1e201d[_0xe69e('0x76')](function(_0x417ee6){socket[_0xe69e('0x77')](_0xe69e('0x78'),{'UserId':_0x417ee6['id'],'OpenchannelQueueId':_0x3cb50d['id']});});});});});}})[_0xe69e('0x2b')](respondWithStatusCode(_0x339384,null))['catch'](handleError(_0x339384,null));};exports[_0xe69e('0x79')]=function(_0x226189,_0x8cd637,_0x2023f8){return db[_0xe69e('0x69')][_0xe69e('0x4c')]({'where':{'id':_0x226189[_0xe69e('0x3b')][_0xe69e('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe69e('0x6c')],'as':_0xe69e('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x8cd637,null))[_0xe69e('0x2b')](function(_0xf7ec7d){var _0x88bb66=_[_0xe69e('0x35')](_0xf7ec7d,'id');var _0x1df934=[];var _0x61530d=[];var _0xe34959=squel['select']();_0xe34959[_0xe69e('0x7a')](_0xe69e('0x7b'))[_0xe69e('0x7c')]('team_has_openchannel_queues','tq')[_0xe69e('0x7d')](_0xe69e('0x7e'),'ut',_0xe69e('0x7f'))[_0xe69e('0x43')](_0xe69e('0x80'),_0x226189[_0xe69e('0x50')]['id']);for(var _0x30b904=0x0;_0x30b904<_0xf7ec7d['length'];_0x30b904+=0x1){let _0x16cfc9=_0xf7ec7d[_0x30b904];for(var _0x14f9d3=0x0;_0x14f9d3<_0x16cfc9[_0xe69e('0x6d')]['length'];_0x14f9d3+=0x1){let _0x9824cc=_0x16cfc9[_0xe69e('0x6d')][_0x14f9d3];var _0x5321ef=_0xe34959['clone']();_0x5321ef['where'](_0xe69e('0x81'),_0x9824cc['id']);_0x61530d['push'](db[_0xe69e('0x82')][_0xe69e('0x3b')](_0x5321ef[_0xe69e('0x83')](),{'type':db['sequelize'][_0xe69e('0x84')][_0xe69e('0x85')]})[_0xe69e('0x2b')](function(_0x521930){if(_0x521930[_0xe69e('0x40')]===0x1){return _0x9824cc['id'];}else{var _0x35a170=_[_0xe69e('0x86')](_[_0xe69e('0x35')](_0x521930,_0xe69e('0x87')),function(_0x3cf2b9){return _['includes'](_0x88bb66,_0x3cf2b9);});if(_0x35a170){return _0x9824cc['id'];}}}));}}return BPromise[_0xe69e('0x88')](_0x61530d)[_0xe69e('0x2b')](function(_0x316b3f){_0x1df934=_(_0x1df934)[_0xe69e('0x89')](_0x316b3f)['compact']()['value']();return db[_0xe69e('0x36')][_0xe69e('0x52')]({'where':{'id':_0x226189[_0xe69e('0x50')]['id']}})[_0xe69e('0x2b')](function(_0x5efe77){return db[_0xe69e('0x82')]['transaction'](function(_0x5b83dd){return _0x5efe77[_0xe69e('0x79')](_0x226189[_0xe69e('0x3b')][_0xe69e('0x6b')],{'transaction':_0x5b83dd})[_0xe69e('0x2b')](function(){if(!_[_0xe69e('0x8a')](_0x1df934)){return _0x5efe77[_0xe69e('0x8b')](_0x1df934,{'transaction':_0x5b83dd});}})['then'](function(){_0x1df934[_0xe69e('0x76')](function(_0x4d0d20){socket[_0xe69e('0x77')]('userOpenchannelQueue:remove',{'UserId':_0x4d0d20,'OpenchannelQueueId':_0x5efe77['id']});});});});});});})[_0xe69e('0x2b')](respondWithStatusCode(_0x8cd637,null))[_0xe69e('0x4e')](handleError(_0x8cd637,null));};exports['addAgents']=function(_0x42315b,_0x1c1cd2,_0xc1f0d8){return db[_0xe69e('0x36')][_0xe69e('0x52')]({'where':{'id':_0x42315b['params']['id']}})[_0xe69e('0x2b')](handleEntityNotFound(_0x1c1cd2,null))[_0xe69e('0x2b')](function(_0x2a276e){if(_0x2a276e){return _0x2a276e[_0xe69e('0x8c')](_0x42315b[_0xe69e('0x53')][_0xe69e('0x6b')],_[_0xe69e('0x8d')](_0x42315b[_0xe69e('0x53')],[_0xe69e('0x6b'),'id'])||{})[_0xe69e('0x8e')](function(_0x10490a){for(var _0x4aef4f=0x0;_0x4aef4f<_0x42315b['body']['ids'][_0xe69e('0x40')];_0x4aef4f+=0x1){socket['emit'](_0xe69e('0x78'),{'UserId':Number(_0x42315b[_0xe69e('0x53')][_0xe69e('0x6b')][_0x4aef4f]),'OpenchannelQueueId':Number(_0x42315b[_0xe69e('0x50')]['id'])});}return _0x10490a;});}})[_0xe69e('0x2b')](respondWithResult(_0x1c1cd2,null))[_0xe69e('0x4e')](handleError(_0x1c1cd2,null));};exports[_0xe69e('0x8b')]=function(_0x26fae0,_0x242a61,_0x7c3253){return db[_0xe69e('0x36')][_0xe69e('0x52')]({'where':{'id':_0x26fae0[_0xe69e('0x50')]['id']}})[_0xe69e('0x2b')](handleEntityNotFound(_0x242a61,null))[_0xe69e('0x2b')](function(_0x4a8f64){if(_0x4a8f64){return _0x4a8f64[_0xe69e('0x8b')](_0x26fae0['query'][_0xe69e('0x6b')])[_0xe69e('0x2b')](function(){if(_['isArray'](_0x26fae0['query'][_0xe69e('0x6b')])){for(var _0x2f9887=0x0;_0x2f9887<_0x26fae0[_0xe69e('0x3b')][_0xe69e('0x6b')][_0xe69e('0x40')];_0x2f9887+=0x1){socket[_0xe69e('0x77')](_0xe69e('0x8f'),{'UserId':Number(_0x26fae0[_0xe69e('0x3b')][_0xe69e('0x6b')][_0x2f9887]),'OpenchannelQueueId':Number(_0x26fae0[_0xe69e('0x50')]['id'])});}}else{socket['emit'](_0xe69e('0x8f'),{'UserId':Number(_0x26fae0[_0xe69e('0x3b')]['ids']),'OpenchannelQueueId':Number(_0x26fae0['params']['id'])});}});}})[_0xe69e('0x2b')](respondWithStatusCode(_0x242a61,null))[_0xe69e('0x4e')](handleError(_0x242a61,null));};exports[_0xe69e('0x90')]=function(_0x3739db,_0x45f40d,_0x3fc947){var _0x55a8c2={};var _0x498b33={};var _0x3a032a;var _0x32db66;return db['OpenchannelQueue'][_0xe69e('0x5c')]({'where':{'id':_0x3739db[_0xe69e('0x50')]['id']}})[_0xe69e('0x2b')](handleEntityNotFound(_0x45f40d,null))[_0xe69e('0x2b')](function(_0x2dff45){if(_0x2dff45){_0x3a032a=_0x2dff45;_0x498b33[_0xe69e('0x3a')]=_[_0xe69e('0x51')](db['User'][_0xe69e('0x37')]);_0x498b33[_0xe69e('0x3b')]=_[_0xe69e('0x51')](_0x3739db['query']);_0x498b33['filters']=_[_0xe69e('0x3d')](_0x498b33[_0xe69e('0x3a')],_0x498b33[_0xe69e('0x3b')]);_0x55a8c2['attributes']=_[_0xe69e('0x3d')](_0x498b33[_0xe69e('0x3a')],qs[_0xe69e('0x3f')](_0x3739db[_0xe69e('0x3b')][_0xe69e('0x3f')]));_0x55a8c2[_0xe69e('0x3e')]=_0x55a8c2[_0xe69e('0x3e')][_0xe69e('0x40')]?_0x55a8c2[_0xe69e('0x3e')]:_0x498b33[_0xe69e('0x3a')];_0x55a8c2['order']=qs['sort'](_0x3739db[_0xe69e('0x3b')][_0xe69e('0x42')]);_0x55a8c2[_0xe69e('0x43')]=qs[_0xe69e('0x3c')](_[_0xe69e('0x44')](_0x3739db['query'],_0x498b33[_0xe69e('0x3c')]));if(_0x3739db[_0xe69e('0x3b')]['filter']){_0x55a8c2[_0xe69e('0x43')]=_[_0xe69e('0x46')](_0x55a8c2[_0xe69e('0x43')],{'$or':_['map'](_0x55a8c2[_0xe69e('0x3e')],function(_0x3799e8){var _0x470008={};_0x470008[_0x3799e8]={'$like':'%'+_0x3739db['query'][_0xe69e('0x45')]+'%'};return _0x470008;})});}_0x55a8c2=_[_0xe69e('0x46')]({},_0x55a8c2,_0x3739db[_0xe69e('0x49')]);return _0x3a032a[_0xe69e('0x90')](_0x55a8c2);}})['then'](function(_0x4d32bf){if(_0x4d32bf){_0x32db66=_0x4d32bf[_0xe69e('0x40')];if(!_0x3739db[_0xe69e('0x3b')][_0xe69e('0x5e')](_0xe69e('0x5f'))){_0x55a8c2[_0xe69e('0x24')]=qs[_0xe69e('0x24')](_0x3739db[_0xe69e('0x3b')][_0xe69e('0x24')]);_0x55a8c2[_0xe69e('0x25')]=qs[_0xe69e('0x25')](_0x3739db[_0xe69e('0x3b')][_0xe69e('0x25')]);}return _0x3a032a[_0xe69e('0x90')](_0x55a8c2);}})['then'](function(_0x18bed3){if(_0x18bed3){return _0x18bed3?{'count':_0x32db66,'rows':_0x18bed3}:null;}})[_0xe69e('0x2b')](respondWithResult(_0x45f40d,null))[_0xe69e('0x4e')](handleError(_0x45f40d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1da2e7b..e6f3e46 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 _0x2209=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x15fa45,_0x132622){var _0x3e7413=function(_0xba8cb9){while(--_0xba8cb9){_0x15fa45['push'](_0x15fa45['shift']());}};_0x3e7413(++_0x132622);}(_0x2209,0xf9));var _0x9220=function(_0xfdcc53,_0x2b5d47){_0xfdcc53=_0xfdcc53-0x0;var _0x40a609=_0x2209[_0xfdcc53];return _0x40a609;};'use strict';var EventEmitter=require(_0x9220('0x0'));var OpenchannelQueue=require(_0x9220('0x1'))['db'][_0x9220('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9220('0x3')](0x0);var events={'afterCreate':_0x9220('0x4'),'afterUpdate':_0x9220('0x5'),'afterDestroy':_0x9220('0x6')};function emitEvent(_0x243ff5){return function(_0x1198a7,_0x1b6268,_0x287f58){OpenchannelQueueEvents[_0x9220('0x7')](_0x243ff5+':'+_0x1198a7['id'],_0x1198a7);OpenchannelQueueEvents[_0x9220('0x7')](_0x243ff5,_0x1198a7);_0x287f58(null);};}for(var e in events){if(events[_0x9220('0x8')](e)){var event=events[e];OpenchannelQueue[_0x9220('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x059f=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x56e790,_0x5bec09){var _0x4fa9fa=function(_0x513862){while(--_0x513862){_0x56e790['push'](_0x56e790['shift']());}};_0x4fa9fa(++_0x5bec09);}(_0x059f,0x9c));var _0xf059=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0x059f[_0x2e7a43];return _0x52e9e1;};'use strict';var EventEmitter=require(_0xf059('0x0'));var OpenchannelQueue=require(_0xf059('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xf059('0x2')](0x0);var events={'afterCreate':_0xf059('0x3'),'afterUpdate':'update','afterDestroy':_0xf059('0x4')};function emitEvent(_0x2aac7b){return function(_0x1c5a04,_0x1ad162,_0x522877){OpenchannelQueueEvents[_0xf059('0x5')](_0x2aac7b+':'+_0x1c5a04['id'],_0x1c5a04);OpenchannelQueueEvents[_0xf059('0x5')](_0x2aac7b,_0x1c5a04);_0x522877(null);};}for(var e in events){if(events[_0xf059('0x6')](e)){var event=events[e];OpenchannelQueue[_0xf059('0x7')](e,emitEvent(event));}}module[_0xf059('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index dadb5ed..ed8e0ab 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 _0x26d2=['path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x417e86,_0x254185){var _0x5b933f=function(_0x5a1aaf){while(--_0x5a1aaf){_0x417e86['push'](_0x417e86['shift']());}};_0x5b933f(++_0x254185);}(_0x26d2,0x10e));var _0x226d=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x26d2[_0x267d8d];return _0x11a98f;};'use strict';var _=require('lodash');var util=require(_0x226d('0x0'));var logger=require(_0x226d('0x1'))(_0x226d('0x2'));var moment=require('moment');var BPromise=require(_0x226d('0x3'));var rp=require(_0x226d('0x4'));var fs=require('fs');var path=require(_0x226d('0x5'));var rimraf=require(_0x226d('0x6'));var config=require(_0x226d('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x226d('0x8')]=function(_0x3784bb,_0xe1fa10){return _0x3784bb['define'](_0x226d('0x9'),attributes,{'tableName':_0x226d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e16=['define','openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x8e16,0x7a));var _0x68e1=function(_0x4a4b5c,_0x4fbf8b){_0x4a4b5c=_0x4a4b5c-0x0;var _0xd3a4e=_0x8e16[_0x4a4b5c];return _0xd3a4e;};'use strict';var _=require(_0x68e1('0x0'));var util=require(_0x68e1('0x1'));var logger=require(_0x68e1('0x2'))(_0x68e1('0x3'));var moment=require(_0x68e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x68e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68e1('0x6'));var config=require(_0x68e1('0x7'));var attributes=require(_0x68e1('0x8'));module[_0x68e1('0x9')]=function(_0x478a24,_0x3cc85c){return _0x478a24[_0x68e1('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x68e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 0a2b191..bf127cc 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 _0xc9b8=['result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','ShowOpenchannelQueue','find','map','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xc9b8,0x19f));var _0x8c9b=function(_0x5e599e,_0x1d61e2){_0x5e599e=_0x5e599e-0x0;var _0x241bbe=_0xc9b8[_0x5e599e];return _0x241bbe;};'use strict';var _=require(_0x8c9b('0x0'));var util=require(_0x8c9b('0x1'));var moment=require('moment');var BPromise=require(_0x8c9b('0x2'));var rs=require(_0x8c9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c9b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c9b('0x5'))(_0x8c9b('0x6'));var config=require(_0x8c9b('0x7'));var jayson=require(_0x8c9b('0x8'));var client=jayson[_0x8c9b('0x9')][_0x8c9b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x8c9b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c9b('0xc')]));require(_0x8c9b('0xd'))[_0x8c9b('0xe')](socket);function respondWithRpcPromise(_0x4d8813,_0x5218e0,_0x50d7ea){return new BPromise(function(_0x12e343,_0x306285){return client[_0x8c9b('0xf')](_0x4d8813,_0x50d7ea)['then'](function(_0x2d7d95){logger['info'](_0x8c9b('0x10'),_0x5218e0,_0x8c9b('0x11'));logger[_0x8c9b('0x12')](_0x8c9b('0x13'),_0x5218e0,_0x8c9b('0x11'),JSON[_0x8c9b('0x14')](_0x2d7d95));if(_0x2d7d95[_0x8c9b('0x15')]){if(_0x2d7d95['error'][_0x8c9b('0x16')]===0x1f4){logger[_0x8c9b('0x15')](_0x8c9b('0x10'),_0x5218e0,_0x2d7d95[_0x8c9b('0x15')][_0x8c9b('0x17')]);return _0x306285(_0x2d7d95[_0x8c9b('0x15')]['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x5218e0,_0x2d7d95[_0x8c9b('0x15')]['message']);return _0x12e343(_0x2d7d95['error'][_0x8c9b('0x17')]);}else{logger[_0x8c9b('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x5218e0,_0x8c9b('0x11'));_0x12e343(_0x2d7d95[_0x8c9b('0x19')][_0x8c9b('0x17')]);}})[_0x8c9b('0x1a')](function(_0x5cd9c5){logger[_0x8c9b('0x15')](_0x8c9b('0x10'),_0x5218e0,_0x5cd9c5);_0x306285(_0x5cd9c5);});});}exports[_0x8c9b('0x1b')]=function(_0x298bb1){var _0x2a9117=this;return new Promise(function(_0x53a70d,_0x5bc99f){return db[_0x8c9b('0x1c')][_0x8c9b('0x1d')]({'raw':_0x298bb1['options']?_0x298bb1[_0x8c9b('0x1e')][_0x8c9b('0x1f')]===undefined?!![]:![]:!![],'where':_0x298bb1['options']?_0x298bb1['options'][_0x8c9b('0x20')]||null:null,'attributes':_0x298bb1[_0x8c9b('0x1e')]?_0x298bb1[_0x8c9b('0x1e')][_0x8c9b('0x21')]||null:null,'limit':_0x298bb1[_0x8c9b('0x1e')]?_0x298bb1[_0x8c9b('0x1e')]['limit']||null:null,'include':_0x298bb1[_0x8c9b('0x1e')]?_0x298bb1['options'][_0x8c9b('0x22')]?_['map'](_0x298bb1['options'][_0x8c9b('0x22')],function(_0x5ec177){return{'model':db[_0x5ec177[_0x8c9b('0x23')]],'as':_0x5ec177['as'],'attributes':_0x5ec177[_0x8c9b('0x21')],'include':_0x5ec177[_0x8c9b('0x22')]?_['map'](_0x5ec177[_0x8c9b('0x22')],function(_0x2a7c61){return{'model':db[_0x2a7c61[_0x8c9b('0x23')]],'as':_0x2a7c61['as'],'attributes':_0x2a7c61[_0x8c9b('0x21')],'include':_0x2a7c61[_0x8c9b('0x22')]?_['map'](_0x2a7c61[_0x8c9b('0x22')],function(_0x128d13){return{'model':db[_0x128d13[_0x8c9b('0x23')]],'as':_0x128d13['as'],'attributes':_0x128d13[_0x8c9b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f8986){logger['info'](_0x8c9b('0x1b'),_0x298bb1);logger['debug'](_0x8c9b('0x1b'),_0x298bb1,JSON[_0x8c9b('0x14')](_0x1f8986));_0x53a70d(_0x1f8986);})[_0x8c9b('0x1a')](function(_0x3817c5){logger[_0x8c9b('0x15')]('GetOpenchannelQueue',_0x3817c5[_0x8c9b('0x17')],_0x298bb1);_0x5bc99f(_0x2a9117[_0x8c9b('0x15')](0x1f4,_0x3817c5[_0x8c9b('0x17')]));});});};exports[_0x8c9b('0x24')]=function(_0x5849a0){var _0x5bdfca=this;return new Promise(function(_0x3e23ac,_0x30e5e1){return db['OpenchannelQueue'][_0x8c9b('0x25')]({'raw':_0x5849a0[_0x8c9b('0x1e')]?_0x5849a0['options']['raw']===undefined?!![]:![]:!![],'where':_0x5849a0[_0x8c9b('0x1e')]?_0x5849a0[_0x8c9b('0x1e')][_0x8c9b('0x20')]||null:null,'attributes':_0x5849a0[_0x8c9b('0x1e')]?_0x5849a0[_0x8c9b('0x1e')]['attributes']||null:null,'include':_0x5849a0[_0x8c9b('0x1e')]?_0x5849a0[_0x8c9b('0x1e')]['include']?_['map'](_0x5849a0['options'][_0x8c9b('0x22')],function(_0x4f9d0a){return{'model':db[_0x4f9d0a[_0x8c9b('0x23')]],'as':_0x4f9d0a['as'],'attributes':_0x4f9d0a['attributes'],'include':_0x4f9d0a[_0x8c9b('0x22')]?_[_0x8c9b('0x26')](_0x4f9d0a['include'],function(_0x5ba4a9){return{'model':db[_0x5ba4a9[_0x8c9b('0x23')]],'as':_0x5ba4a9['as'],'attributes':_0x5ba4a9[_0x8c9b('0x21')],'include':_0x5ba4a9['include']?_[_0x8c9b('0x26')](_0x5ba4a9[_0x8c9b('0x22')],function(_0x541f70){return{'model':db[_0x541f70[_0x8c9b('0x23')]],'as':_0x541f70['as'],'attributes':_0x541f70[_0x8c9b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8c9b('0x27')](function(_0x460381){logger[_0x8c9b('0x18')](_0x8c9b('0x24'),_0x5849a0);logger['debug'](_0x8c9b('0x24'),_0x5849a0,JSON[_0x8c9b('0x14')](_0x460381));_0x3e23ac(_0x460381);})[_0x8c9b('0x1a')](function(_0x34fb93){logger['error'](_0x8c9b('0x24'),_0x34fb93[_0x8c9b('0x17')],_0x5849a0);_0x30e5e1(_0x5bdfca[_0x8c9b('0x15')](0x1f4,_0x34fb93[_0x8c9b('0x17')]));});});}; \ No newline at end of file +var _0x3274=['localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','OpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x3274,0x8b));var _0x4327=function(_0x296c81,_0x2f42d1){_0x296c81=_0x296c81-0x0;var _0x3b8fec=_0x3274[_0x296c81];return _0x3b8fec;};'use strict';var _=require('lodash');var util=require(_0x4327('0x0'));var moment=require(_0x4327('0x1'));var BPromise=require(_0x4327('0x2'));var rs=require(_0x4327('0x3'));var fs=require('fs');var Redis=require(_0x4327('0x4'));var db=require(_0x4327('0x5'))['db'];var utils=require(_0x4327('0x6'));var logger=require('../../config/logger')(_0x4327('0x7'));var config=require(_0x4327('0x8'));var jayson=require(_0x4327('0x9'));var client=jayson[_0x4327('0xa')][_0x4327('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4327('0xc')],{'host':_0x4327('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4327('0xc')]));require(_0x4327('0xe'))[_0x4327('0xf')](socket);function respondWithRpcPromise(_0x520807,_0x382f3c,_0x1ff3e2){return new BPromise(function(_0x1a62da,_0x2422fd){return client[_0x4327('0x10')](_0x520807,_0x1ff3e2)[_0x4327('0x11')](function(_0x196091){logger[_0x4327('0x12')](_0x4327('0x13'),_0x382f3c,_0x4327('0x14'));logger[_0x4327('0x15')](_0x4327('0x16'),_0x382f3c,_0x4327('0x14'),JSON[_0x4327('0x17')](_0x196091));if(_0x196091[_0x4327('0x18')]){if(_0x196091[_0x4327('0x18')]['code']===0x1f4){logger[_0x4327('0x18')](_0x4327('0x13'),_0x382f3c,_0x196091['error'][_0x4327('0x19')]);return _0x2422fd(_0x196091[_0x4327('0x18')][_0x4327('0x19')]);}logger[_0x4327('0x18')](_0x4327('0x13'),_0x382f3c,_0x196091[_0x4327('0x18')]['message']);return _0x1a62da(_0x196091[_0x4327('0x18')][_0x4327('0x19')]);}else{logger[_0x4327('0x12')](_0x4327('0x13'),_0x382f3c,_0x4327('0x14'));_0x1a62da(_0x196091[_0x4327('0x1a')][_0x4327('0x19')]);}})['catch'](function(_0x2ada1b){logger[_0x4327('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x382f3c,_0x2ada1b);_0x2422fd(_0x2ada1b);});});}exports[_0x4327('0x1b')]=function(_0x2d1bd8){var _0x3f2c4d=this;return new Promise(function(_0x7aa697,_0x479a3e){return db['OpenchannelQueue']['findAll']({'raw':_0x2d1bd8[_0x4327('0x1c')]?_0x2d1bd8['options'][_0x4327('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d1bd8[_0x4327('0x1c')]?_0x2d1bd8[_0x4327('0x1c')][_0x4327('0x1e')]||null:null,'attributes':_0x2d1bd8['options']?_0x2d1bd8[_0x4327('0x1c')][_0x4327('0x1f')]||null:null,'limit':_0x2d1bd8[_0x4327('0x1c')]?_0x2d1bd8[_0x4327('0x1c')][_0x4327('0x20')]||null:null,'include':_0x2d1bd8[_0x4327('0x1c')]?_0x2d1bd8[_0x4327('0x1c')][_0x4327('0x21')]?_[_0x4327('0x22')](_0x2d1bd8[_0x4327('0x1c')][_0x4327('0x21')],function(_0x30e253){return{'model':db[_0x30e253[_0x4327('0x23')]],'as':_0x30e253['as'],'attributes':_0x30e253[_0x4327('0x1f')],'include':_0x30e253[_0x4327('0x21')]?_[_0x4327('0x22')](_0x30e253[_0x4327('0x21')],function(_0x44a315){return{'model':db[_0x44a315[_0x4327('0x23')]],'as':_0x44a315['as'],'attributes':_0x44a315[_0x4327('0x1f')],'include':_0x44a315[_0x4327('0x21')]?_['map'](_0x44a315[_0x4327('0x21')],function(_0x51ce74){return{'model':db[_0x51ce74[_0x4327('0x23')]],'as':_0x51ce74['as'],'attributes':_0x51ce74[_0x4327('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4327('0x11')](function(_0xb8595c){logger[_0x4327('0x12')](_0x4327('0x1b'),_0x2d1bd8);logger[_0x4327('0x15')]('GetOpenchannelQueue',_0x2d1bd8,JSON['stringify'](_0xb8595c));_0x7aa697(_0xb8595c);})['catch'](function(_0x412130){logger[_0x4327('0x18')](_0x4327('0x1b'),_0x412130[_0x4327('0x19')],_0x2d1bd8);_0x479a3e(_0x3f2c4d[_0x4327('0x18')](0x1f4,_0x412130[_0x4327('0x19')]));});});};exports[_0x4327('0x24')]=function(_0x433e58){var _0x167bc3=this;return new Promise(function(_0x3b38ae,_0x299430){return db[_0x4327('0x25')]['find']({'raw':_0x433e58[_0x4327('0x1c')]?_0x433e58[_0x4327('0x1c')][_0x4327('0x1d')]===undefined?!![]:![]:!![],'where':_0x433e58[_0x4327('0x1c')]?_0x433e58[_0x4327('0x1c')][_0x4327('0x1e')]||null:null,'attributes':_0x433e58['options']?_0x433e58[_0x4327('0x1c')]['attributes']||null:null,'include':_0x433e58['options']?_0x433e58[_0x4327('0x1c')][_0x4327('0x21')]?_[_0x4327('0x22')](_0x433e58[_0x4327('0x1c')][_0x4327('0x21')],function(_0xfbe58c){return{'model':db[_0xfbe58c[_0x4327('0x23')]],'as':_0xfbe58c['as'],'attributes':_0xfbe58c['attributes'],'include':_0xfbe58c[_0x4327('0x21')]?_['map'](_0xfbe58c[_0x4327('0x21')],function(_0x832579){return{'model':db[_0x832579[_0x4327('0x23')]],'as':_0x832579['as'],'attributes':_0x832579[_0x4327('0x1f')],'include':_0x832579[_0x4327('0x21')]?_[_0x4327('0x22')](_0x832579['include'],function(_0x5ba285){return{'model':db[_0x5ba285[_0x4327('0x23')]],'as':_0x5ba285['as'],'attributes':_0x5ba285[_0x4327('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5227e0){logger[_0x4327('0x12')](_0x4327('0x24'),_0x433e58);logger[_0x4327('0x15')](_0x4327('0x24'),_0x433e58,JSON[_0x4327('0x17')](_0x5227e0));_0x3b38ae(_0x5227e0);})['catch'](function(_0x1f2d28){logger[_0x4327('0x18')](_0x4327('0x24'),_0x1f2d28[_0x4327('0x19')],_0x433e58);_0x299430(_0x167bc3[_0x4327('0x18')](0x1f4,_0x1f2d28[_0x4327('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 42b14db..240a0ce 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 _0x7631=['./openchannelQueue.events','remove','update','removeListener','register','length','openchannelQueue:'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7631,0x188));var _0x1763=function(_0x4d033d,_0x147076){_0x4d033d=_0x4d033d-0x0;var _0x136d72=_0x7631[_0x4d033d];return _0x136d72;};'use strict';var OpenchannelQueueEvents=require(_0x1763('0x0'));var events=['save',_0x1763('0x1'),_0x1763('0x2')];function createListener(_0x3a2647,_0x2eccfe){return function(_0x5e7d8d){_0x2eccfe['emit'](_0x3a2647,_0x5e7d8d);};}function removeListener(_0x2001ef,_0xd57ef){return function(){OpenchannelQueueEvents[_0x1763('0x3')](_0x2001ef,_0xd57ef);};}exports[_0x1763('0x4')]=function(_0x1f34d0){for(var _0x3c8642=0x0,_0x302528=events[_0x1763('0x5')];_0x3c8642<_0x302528;_0x3c8642++){var _0x1db7ee=events[_0x3c8642];var _0x863c3e=createListener(_0x1763('0x6')+_0x1db7ee,_0x1f34d0);OpenchannelQueueEvents['on'](_0x1db7ee,_0x863c3e);}}; \ No newline at end of file +var _0xd283=['openchannelQueue:','./openchannelQueue.events','save','emit','removeListener','register','length'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xd283,0x86));var _0x3d28=function(_0x4c565a,_0x568c16){_0x4c565a=_0x4c565a-0x0;var _0x40e418=_0xd283[_0x4c565a];return _0x40e418;};'use strict';var OpenchannelQueueEvents=require(_0x3d28('0x0'));var events=[_0x3d28('0x1'),'remove','update'];function createListener(_0x3b25be,_0x5b0289){return function(_0x20a2be){_0x5b0289[_0x3d28('0x2')](_0x3b25be,_0x20a2be);};}function removeListener(_0x3eeaae,_0x2ada5e){return function(){OpenchannelQueueEvents[_0x3d28('0x3')](_0x3eeaae,_0x2ada5e);};}exports[_0x3d28('0x4')]=function(_0x4ef407){for(var _0x4f46c9=0x0,_0x4cbd0a=events[_0x3d28('0x5')];_0x4f46c9<_0x4cbd0a;_0x4f46c9++){var _0x11ca0f=events[_0x4f46c9];var _0x309e0b=createListener(_0x3d28('0x6')+_0x11ca0f,_0x4ef407);OpenchannelQueueEvents['on'](_0x11ca0f,_0x309e0b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ceee143..6215fcc 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 _0x3deb=['get','/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x59603e,_0x3aa57b){var _0x4afb96=function(_0x1b5496){while(--_0x1b5496){_0x59603e['push'](_0x59603e['shift']());}};_0x4afb96(++_0x3aa57b);}(_0x3deb,0x13c));var _0xb3de=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x3deb[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xb3de('0x0'));var util=require(_0xb3de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb3de('0x2'));var router=express['Router']();var fs_extra=require(_0xb3de('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb3de('0x4'));var config=require(_0xb3de('0x5'));var controller=require(_0xb3de('0x6'));router[_0xb3de('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb3de('0x8'),auth[_0xb3de('0x9')](),controller[_0xb3de('0xa')]);router[_0xb3de('0x7')]('/:id',auth[_0xb3de('0x9')](),controller[_0xb3de('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3de('0xc')]);router[_0xb3de('0xd')]('/:id',auth[_0xb3de('0x9')](),controller[_0xb3de('0xe')]);router[_0xb3de('0xf')](_0xb3de('0x10'),auth['isAuthenticated'](),controller[_0xb3de('0x11')]);module[_0xb3de('0x12')]=router; \ No newline at end of file +var _0x9d65=['index','get','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x9d65,0xbc));var _0x59d6=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x9d65[_0x3d8240];return _0x3d0372;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x59d6('0x0'));var timeout=require(_0x59d6('0x1'));var express=require(_0x59d6('0x2'));var router=express[_0x59d6('0x3')]();var fs_extra=require(_0x59d6('0x4'));var auth=require(_0x59d6('0x5'));var interaction=require(_0x59d6('0x6'));var config=require(_0x59d6('0x7'));var controller=require(_0x59d6('0x8'));router['get']('/',auth[_0x59d6('0x9')](),controller[_0x59d6('0xa')]);router[_0x59d6('0xb')](_0x59d6('0xc'),auth['isAuthenticated'](),controller[_0x59d6('0xd')]);router['get']('/:id',auth[_0x59d6('0x9')](),controller[_0x59d6('0xe')]);router[_0x59d6('0xf')]('/',auth[_0x59d6('0x9')](),controller['create']);router[_0x59d6('0x10')]('/:id',auth[_0x59d6('0x9')](),controller[_0x59d6('0x11')]);router[_0x59d6('0x12')](_0x59d6('0x13'),auth[_0x59d6('0x9')](),controller[_0x59d6('0x14')]);module[_0x59d6('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 40eb820..6c6011c 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 _0xba06=['exports','STRING','DATE','moment'];(function(_0x2989b0,_0x24dc6f){var _0x1aa7b5=function(_0x96cd73){while(--_0x96cd73){_0x2989b0['push'](_0x2989b0['shift']());}};_0x1aa7b5(++_0x24dc6f);}(_0xba06,0xcf));var _0x6ba0=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xba06[_0x4e9d3c];return _0x2d0825;};'use strict';var moment=require(_0x6ba0('0x0'));var Sequelize=require('sequelize');module[_0x6ba0('0x1')]={'uniqueid':{'type':Sequelize[_0x6ba0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6ba0('0x3')]},'leaveAt':{'type':Sequelize[_0x6ba0('0x3')]},'acceptAt':{'type':Sequelize[_0x6ba0('0x3')]},'exitAt':{'type':Sequelize[_0x6ba0('0x3')]},'reason':{'type':Sequelize[_0x6ba0('0x2')]}}; \ No newline at end of file +var _0xdc3c=['moment','STRING','DATE'];(function(_0x2d6884,_0x440669){var _0x1f4873=function(_0x5ef41f){while(--_0x5ef41f){_0x2d6884['push'](_0x2d6884['shift']());}};_0x1f4873(++_0x440669);}(_0xdc3c,0x147));var _0xcdc3=function(_0x5563cd,_0x782b12){_0x5563cd=_0x5563cd-0x0;var _0x24c0d1=_0xdc3c[_0x5563cd];return _0x24c0d1;};'use strict';var moment=require(_0xcdc3('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcdc3('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xcdc3('0x1')]},'joinAt':{'type':Sequelize[_0xcdc3('0x2')]},'leaveAt':{'type':Sequelize[_0xcdc3('0x2')]},'acceptAt':{'type':Sequelize[_0xcdc3('0x2')]},'exitAt':{'type':Sequelize[_0xcdc3('0x2')]},'reason':{'type':Sequelize[_0xcdc3('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a78a55a..5cc4809 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 _0x0462=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','OpenchannelQueueReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0462,0x11f));var _0x2046=function(_0x40e9d9,_0x37e4a4){_0x40e9d9=_0x40e9d9-0x0;var _0x5628db=_0x0462[_0x40e9d9];return _0x5628db;};'use strict';var emlformat=require(_0x2046('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2046('0x1'));var jsonpatch=require(_0x2046('0x2'));var rp=require(_0x2046('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2046('0x4'));var util=require(_0x2046('0x5'));var path=require(_0x2046('0x6'));var sox=require(_0x2046('0x7'));var csv=require('to-csv');var ejs=require(_0x2046('0x8'));var fs=require('fs');var fs_extra=require(_0x2046('0x9'));var _=require(_0x2046('0xa'));var squel=require(_0x2046('0xb'));var crypto=require(_0x2046('0xc'));var jsforce=require(_0x2046('0xd'));var deskjs=require(_0x2046('0xe'));var toCsv=require(_0x2046('0xf'));var querystring=require(_0x2046('0x10'));var Papa=require(_0x2046('0x11'));var Redis=require(_0x2046('0x12'));var authService=require(_0x2046('0x13'));var qs=require(_0x2046('0x14'));var as=require(_0x2046('0x15'));var hardwareService=require(_0x2046('0x16'));var logger=require(_0x2046('0x17'))(_0x2046('0x18'));var utils=require(_0x2046('0x19'));var config=require(_0x2046('0x1a'));var licenseUtil=require(_0x2046('0x1b'));var db=require(_0x2046('0x1c'))['db'];function respondWithStatusCode(_0x5b19f9,_0x1601c3){_0x1601c3=_0x1601c3||0xcc;return function(_0x28405e){if(_0x28405e){return _0x5b19f9[_0x2046('0x1d')](_0x1601c3);}return _0x5b19f9[_0x2046('0x1e')](_0x1601c3)[_0x2046('0x1f')]();};}function respondWithResult(_0x2fb690,_0x4ff17c){_0x4ff17c=_0x4ff17c||0xc8;return function(_0x25a5b7){if(_0x25a5b7){return _0x2fb690[_0x2046('0x1e')](_0x4ff17c)[_0x2046('0x20')](_0x25a5b7);}};}function respondWithFilteredResult(_0x4c4db7,_0x25effc){return function(_0x594965){if(_0x594965){var _0x564b59=typeof _0x25effc[_0x2046('0x21')]===_0x2046('0x22')&&typeof _0x25effc[_0x2046('0x23')]===_0x2046('0x22');var _0x362af3=_0x594965['count'];var _0x2ac6b9=_0x564b59?0x0:_0x25effc['offset'];var _0x257b23=_0x564b59?_0x594965[_0x2046('0x24')]:_0x25effc[_0x2046('0x21')]+_0x25effc[_0x2046('0x23')];var _0x17b9b0;if(_0x257b23>=_0x362af3){_0x257b23=_0x362af3;_0x17b9b0=0xc8;}else{_0x17b9b0=0xce;}_0x4c4db7[_0x2046('0x1e')](_0x17b9b0);return _0x4c4db7['set'](_0x2046('0x25'),_0x2ac6b9+'-'+_0x257b23+'/'+_0x362af3)[_0x2046('0x20')](_0x594965);}return null;};}function patchUpdates(_0x149b42){return function(_0x53b2ff){try{jsonpatch[_0x2046('0x26')](_0x53b2ff,_0x149b42,!![]);}catch(_0xb57dec){return BPromise[_0x2046('0x27')](_0xb57dec);}return _0x53b2ff['save']();};}function saveUpdates(_0x27c0d1,_0x2c677b){return function(_0x4e3f6b){if(_0x4e3f6b){return _0x4e3f6b['update'](_0x27c0d1)[_0x2046('0x28')](function(_0x1d3665){return _0x1d3665;});}return null;};}function removeEntity(_0x47734f,_0x109960){return function(_0x12c1bb){if(_0x12c1bb){return _0x12c1bb[_0x2046('0x29')]()[_0x2046('0x28')](function(){_0x47734f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d74cb,_0x39c98d){return function(_0x246bdb){if(!_0x246bdb){_0x5d74cb[_0x2046('0x1d')](0x194);}return _0x246bdb;};}function handleError(_0x551cfe,_0x17ce62){_0x17ce62=_0x17ce62||0x1f4;return function(_0x585b0a){logger['error'](_0x585b0a[_0x2046('0x2a')]);if(_0x585b0a[_0x2046('0x2b')]){delete _0x585b0a[_0x2046('0x2b')];}_0x551cfe['status'](_0x17ce62)[_0x2046('0x2c')](_0x585b0a);};}exports['index']=function(_0x45d472,_0x732f46){var _0x53391a={},_0x2d99a3={},_0xacc21f={'count':0x0,'rows':[]};var _0x2ed067=_['map'](db[_0x2046('0x2d')][_0x2046('0x2e')],function(_0x2bfec7){return{'name':_0x2bfec7['fieldName'],'type':_0x2bfec7[_0x2046('0x2f')][_0x2046('0x30')]};});_0x2d99a3['model']=_['map'](_0x2ed067,_0x2046('0x2b'));_0x2d99a3[_0x2046('0x31')]=_[_0x2046('0x32')](_0x45d472[_0x2046('0x31')]);_0x2d99a3[_0x2046('0x33')]=_['intersection'](_0x2d99a3[_0x2046('0x34')],_0x2d99a3[_0x2046('0x31')]);_0x53391a[_0x2046('0x35')]=_[_0x2046('0x36')](_0x2d99a3['model'],qs[_0x2046('0x37')](_0x45d472['query'][_0x2046('0x37')]));_0x53391a['attributes']=_0x53391a[_0x2046('0x35')][_0x2046('0x38')]?_0x53391a[_0x2046('0x35')]:_0x2d99a3[_0x2046('0x34')];if(!_0x45d472['query'][_0x2046('0x39')](_0x2046('0x3a'))){_0x53391a[_0x2046('0x23')]=qs[_0x2046('0x23')](_0x45d472[_0x2046('0x31')][_0x2046('0x23')]);_0x53391a[_0x2046('0x21')]=qs['offset'](_0x45d472['query'][_0x2046('0x21')]);}_0x53391a['order']=qs[_0x2046('0x3b')](_0x45d472[_0x2046('0x31')][_0x2046('0x3b')]);_0x53391a['where']=qs[_0x2046('0x33')](_[_0x2046('0x3c')](_0x45d472[_0x2046('0x31')],_0x2d99a3[_0x2046('0x33')]),_0x2ed067);if(_0x45d472[_0x2046('0x31')][_0x2046('0x3d')]){_0x53391a[_0x2046('0x3e')]=_[_0x2046('0x3f')](_0x53391a[_0x2046('0x3e')],{'$or':_[_0x2046('0x40')](_0x2ed067,function(_0x5a3ee2){if(_0x5a3ee2['type']!=='VIRTUAL'){var _0x4563b7={};_0x4563b7[_0x5a3ee2[_0x2046('0x2b')]]={'$like':'%'+_0x45d472[_0x2046('0x31')][_0x2046('0x3d')]+'%'};return _0x4563b7;}})});}_0x53391a=_['merge']({},_0x53391a,_0x45d472[_0x2046('0x41')]);var _0x38e38a={'where':_0x53391a[_0x2046('0x3e')]};return db[_0x2046('0x2d')][_0x2046('0x24')](_0x38e38a)[_0x2046('0x28')](function(_0x1658a5){_0xacc21f[_0x2046('0x24')]=_0x1658a5;if(_0x45d472['query'][_0x2046('0x42')]){_0x53391a[_0x2046('0x43')]=[{'all':!![]}];}return db[_0x2046('0x2d')][_0x2046('0x44')](_0x53391a);})[_0x2046('0x28')](function(_0x5049ab){_0xacc21f['rows']=_0x5049ab;return _0xacc21f;})[_0x2046('0x28')](respondWithFilteredResult(_0x732f46,_0x53391a))[_0x2046('0x45')](handleError(_0x732f46,null));};exports[_0x2046('0x46')]=function(_0x5c77e9,_0x2e8efe){var _0x40ced2={'raw':!![],'where':{'id':_0x5c77e9[_0x2046('0x47')]['id']}},_0x4f9291={};_0x4f9291['model']=_['keys'](db['OpenchannelQueueReport'][_0x2046('0x2e')]);_0x4f9291[_0x2046('0x31')]=_[_0x2046('0x32')](_0x5c77e9['query']);_0x4f9291['filters']=_[_0x2046('0x36')](_0x4f9291[_0x2046('0x34')],_0x4f9291[_0x2046('0x31')]);_0x40ced2[_0x2046('0x35')]=_[_0x2046('0x36')](_0x4f9291[_0x2046('0x34')],qs[_0x2046('0x37')](_0x5c77e9[_0x2046('0x31')][_0x2046('0x37')]));_0x40ced2['attributes']=_0x40ced2[_0x2046('0x35')][_0x2046('0x38')]?_0x40ced2[_0x2046('0x35')]:_0x4f9291['model'];if(_0x5c77e9[_0x2046('0x31')][_0x2046('0x42')]){_0x40ced2[_0x2046('0x43')]=[{'all':!![]}];}_0x40ced2=_[_0x2046('0x3f')]({},_0x40ced2,_0x5c77e9[_0x2046('0x41')]);return db[_0x2046('0x2d')][_0x2046('0x48')](_0x40ced2)['then'](handleEntityNotFound(_0x2e8efe,null))[_0x2046('0x28')](respondWithResult(_0x2e8efe,null))['catch'](handleError(_0x2e8efe,null));};exports['create']=function(_0x2653ed,_0x6a5e41){return db[_0x2046('0x2d')]['create'](_0x2653ed['body'],{})[_0x2046('0x28')](respondWithResult(_0x6a5e41,0xc9))['catch'](handleError(_0x6a5e41,null));};exports['update']=function(_0x4753f1,_0x573e07){if(_0x4753f1[_0x2046('0x49')]['id']){delete _0x4753f1['body']['id'];}return db[_0x2046('0x2d')][_0x2046('0x48')]({'where':{'id':_0x4753f1[_0x2046('0x47')]['id']}})[_0x2046('0x28')](handleEntityNotFound(_0x573e07,null))['then'](saveUpdates(_0x4753f1[_0x2046('0x49')],null))['then'](respondWithResult(_0x573e07,null))[_0x2046('0x45')](handleError(_0x573e07,null));};exports[_0x2046('0x29')]=function(_0x53e8f8,_0x366c90){return db[_0x2046('0x2d')][_0x2046('0x48')]({'where':{'id':_0x53e8f8[_0x2046('0x47')]['id']}})[_0x2046('0x28')](handleEntityNotFound(_0x366c90,null))['then'](removeEntity(_0x366c90,null))[_0x2046('0x45')](handleError(_0x366c90,null));};exports[_0x2046('0x4a')]=function(_0x42ce0b,_0x29b9cd){return db[_0x2046('0x2d')][_0x2046('0x4a')]()[_0x2046('0x28')](respondWithResult(_0x29b9cd,null))['catch'](handleError(_0x29b9cd,null));}; \ No newline at end of file +var _0x249a=['map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','options','OpenchannelQueueReport','include','findAll','rows','show','params','keys','merge','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','then','sendStatus','stack','name'];(function(_0x44cef4,_0x2feebb){var _0x327f4c=function(_0x3aa570){while(--_0x3aa570){_0x44cef4['push'](_0x44cef4['shift']());}};_0x327f4c(++_0x2feebb);}(_0x249a,0x103));var _0xa249=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x249a[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0xa249('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa249('0x1'));var jsonpatch=require(_0xa249('0x2'));var rp=require(_0xa249('0x3'));var moment=require('moment');var BPromise=require(_0xa249('0x4'));var Mustache=require(_0xa249('0x5'));var util=require(_0xa249('0x6'));var path=require(_0xa249('0x7'));var sox=require(_0xa249('0x8'));var csv=require(_0xa249('0x9'));var ejs=require(_0xa249('0xa'));var fs=require('fs');var fs_extra=require(_0xa249('0xb'));var _=require(_0xa249('0xc'));var squel=require(_0xa249('0xd'));var crypto=require(_0xa249('0xe'));var jsforce=require(_0xa249('0xf'));var deskjs=require(_0xa249('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa249('0x11'));var Redis=require(_0xa249('0x12'));var authService=require(_0xa249('0x13'));var qs=require(_0xa249('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa249('0x15'));var logger=require(_0xa249('0x16'))(_0xa249('0x17'));var utils=require(_0xa249('0x18'));var config=require(_0xa249('0x19'));var licenseUtil=require(_0xa249('0x1a'));var db=require(_0xa249('0x1b'))['db'];function respondWithStatusCode(_0x4bbed4,_0x271291){_0x271291=_0x271291||0xcc;return function(_0x2ebe95){if(_0x2ebe95){return _0x4bbed4['sendStatus'](_0x271291);}return _0x4bbed4[_0xa249('0x1c')](_0x271291)[_0xa249('0x1d')]();};}function respondWithResult(_0x38d183,_0x510b38){_0x510b38=_0x510b38||0xc8;return function(_0x4d8843){if(_0x4d8843){return _0x38d183[_0xa249('0x1c')](_0x510b38)[_0xa249('0x1e')](_0x4d8843);}};}function respondWithFilteredResult(_0x33a518,_0x144c32){return function(_0xa85a6e){if(_0xa85a6e){var _0x3f58bf=typeof _0x144c32['offset']===_0xa249('0x1f')&&typeof _0x144c32['limit']===_0xa249('0x1f');var _0x13cb62=_0xa85a6e[_0xa249('0x20')];var _0x35bd47=_0x3f58bf?0x0:_0x144c32[_0xa249('0x21')];var _0x2168ae=_0x3f58bf?_0xa85a6e[_0xa249('0x20')]:_0x144c32['offset']+_0x144c32[_0xa249('0x22')];var _0x4c0322;if(_0x2168ae>=_0x13cb62){_0x2168ae=_0x13cb62;_0x4c0322=0xc8;}else{_0x4c0322=0xce;}_0x33a518[_0xa249('0x1c')](_0x4c0322);return _0x33a518[_0xa249('0x23')]('Content-Range',_0x35bd47+'-'+_0x2168ae+'/'+_0x13cb62)['json'](_0xa85a6e);}return null;};}function patchUpdates(_0x45ff7f){return function(_0x4e813d){try{jsonpatch[_0xa249('0x24')](_0x4e813d,_0x45ff7f,!![]);}catch(_0x2a52d8){return BPromise[_0xa249('0x25')](_0x2a52d8);}return _0x4e813d[_0xa249('0x26')]();};}function saveUpdates(_0x416f9d,_0x1972a8){return function(_0x34a2b1){if(_0x34a2b1){return _0x34a2b1[_0xa249('0x27')](_0x416f9d)['then'](function(_0x33b752){return _0x33b752;});}return null;};}function removeEntity(_0x3d6cbd,_0x401882){return function(_0x2ba09b){if(_0x2ba09b){return _0x2ba09b[_0xa249('0x28')]()[_0xa249('0x29')](function(){_0x3d6cbd[_0xa249('0x1c')](0xcc)[_0xa249('0x1d')]();});}};}function handleEntityNotFound(_0x4d2c4b,_0x403d7b){return function(_0x40caa1){if(!_0x40caa1){_0x4d2c4b[_0xa249('0x2a')](0x194);}return _0x40caa1;};}function handleError(_0x4e25d3,_0x341f9c){_0x341f9c=_0x341f9c||0x1f4;return function(_0xbc7012){logger['error'](_0xbc7012[_0xa249('0x2b')]);if(_0xbc7012['name']){delete _0xbc7012[_0xa249('0x2c')];}_0x4e25d3[_0xa249('0x1c')](_0x341f9c)['send'](_0xbc7012);};}exports['index']=function(_0x6b5748,_0x43cdc1){var _0x39d6f2={},_0x1ac15e={},_0x34c37f={'count':0x0,'rows':[]};var _0xcb6ada=_[_0xa249('0x2d')](db['OpenchannelQueueReport'][_0xa249('0x2e')],function(_0x483bfc){return{'name':_0x483bfc[_0xa249('0x2f')],'type':_0x483bfc[_0xa249('0x30')][_0xa249('0x31')]};});_0x1ac15e[_0xa249('0x32')]=_['map'](_0xcb6ada,'name');_0x1ac15e['query']=_['keys'](_0x6b5748[_0xa249('0x33')]);_0x1ac15e['filters']=_[_0xa249('0x34')](_0x1ac15e[_0xa249('0x32')],_0x1ac15e[_0xa249('0x33')]);_0x39d6f2['attributes']=_[_0xa249('0x34')](_0x1ac15e[_0xa249('0x32')],qs[_0xa249('0x35')](_0x6b5748[_0xa249('0x33')]['fields']));_0x39d6f2[_0xa249('0x36')]=_0x39d6f2['attributes'][_0xa249('0x37')]?_0x39d6f2[_0xa249('0x36')]:_0x1ac15e['model'];if(!_0x6b5748[_0xa249('0x33')]['hasOwnProperty'](_0xa249('0x38'))){_0x39d6f2[_0xa249('0x22')]=qs[_0xa249('0x22')](_0x6b5748[_0xa249('0x33')]['limit']);_0x39d6f2[_0xa249('0x21')]=qs[_0xa249('0x21')](_0x6b5748[_0xa249('0x33')][_0xa249('0x21')]);}_0x39d6f2[_0xa249('0x39')]=qs[_0xa249('0x3a')](_0x6b5748[_0xa249('0x33')][_0xa249('0x3a')]);_0x39d6f2[_0xa249('0x3b')]=qs[_0xa249('0x3c')](_['pick'](_0x6b5748['query'],_0x1ac15e[_0xa249('0x3c')]),_0xcb6ada);if(_0x6b5748[_0xa249('0x33')][_0xa249('0x3d')]){_0x39d6f2['where']=_['merge'](_0x39d6f2[_0xa249('0x3b')],{'$or':_[_0xa249('0x2d')](_0xcb6ada,function(_0x20703b){if(_0x20703b['type']!=='VIRTUAL'){var _0x222cb6={};_0x222cb6[_0x20703b[_0xa249('0x2c')]]={'$like':'%'+_0x6b5748[_0xa249('0x33')][_0xa249('0x3d')]+'%'};return _0x222cb6;}})});}_0x39d6f2=_['merge']({},_0x39d6f2,_0x6b5748[_0xa249('0x3e')]);var _0x1488fa={'where':_0x39d6f2['where']};return db[_0xa249('0x3f')][_0xa249('0x20')](_0x1488fa)['then'](function(_0x3a4ceb){_0x34c37f[_0xa249('0x20')]=_0x3a4ceb;if(_0x6b5748[_0xa249('0x33')]['includeAll']){_0x39d6f2[_0xa249('0x40')]=[{'all':!![]}];}return db[_0xa249('0x3f')][_0xa249('0x41')](_0x39d6f2);})[_0xa249('0x29')](function(_0x33c6e9){_0x34c37f[_0xa249('0x42')]=_0x33c6e9;return _0x34c37f;})['then'](respondWithFilteredResult(_0x43cdc1,_0x39d6f2))['catch'](handleError(_0x43cdc1,null));};exports[_0xa249('0x43')]=function(_0x399365,_0x66f5b7){var _0x14ce1c={'raw':!![],'where':{'id':_0x399365[_0xa249('0x44')]['id']}},_0x5aaa49={};_0x5aaa49[_0xa249('0x32')]=_[_0xa249('0x45')](db[_0xa249('0x3f')]['rawAttributes']);_0x5aaa49['query']=_[_0xa249('0x45')](_0x399365[_0xa249('0x33')]);_0x5aaa49[_0xa249('0x3c')]=_[_0xa249('0x34')](_0x5aaa49['model'],_0x5aaa49['query']);_0x14ce1c[_0xa249('0x36')]=_[_0xa249('0x34')](_0x5aaa49['model'],qs['fields'](_0x399365[_0xa249('0x33')][_0xa249('0x35')]));_0x14ce1c['attributes']=_0x14ce1c[_0xa249('0x36')][_0xa249('0x37')]?_0x14ce1c[_0xa249('0x36')]:_0x5aaa49[_0xa249('0x32')];if(_0x399365[_0xa249('0x33')]['includeAll']){_0x14ce1c[_0xa249('0x40')]=[{'all':!![]}];}_0x14ce1c=_[_0xa249('0x46')]({},_0x14ce1c,_0x399365[_0xa249('0x3e')]);return db[_0xa249('0x3f')][_0xa249('0x47')](_0x14ce1c)[_0xa249('0x29')](handleEntityNotFound(_0x66f5b7,null))['then'](respondWithResult(_0x66f5b7,null))[_0xa249('0x48')](handleError(_0x66f5b7,null));};exports[_0xa249('0x49')]=function(_0x2c64a7,_0x126849){return db[_0xa249('0x3f')][_0xa249('0x49')](_0x2c64a7['body'],{})[_0xa249('0x29')](respondWithResult(_0x126849,0xc9))[_0xa249('0x48')](handleError(_0x126849,null));};exports[_0xa249('0x27')]=function(_0x16ce86,_0x571b6a){if(_0x16ce86['body']['id']){delete _0x16ce86[_0xa249('0x4a')]['id'];}return db[_0xa249('0x3f')][_0xa249('0x47')]({'where':{'id':_0x16ce86[_0xa249('0x44')]['id']}})[_0xa249('0x29')](handleEntityNotFound(_0x571b6a,null))[_0xa249('0x29')](saveUpdates(_0x16ce86[_0xa249('0x4a')],null))[_0xa249('0x29')](respondWithResult(_0x571b6a,null))[_0xa249('0x48')](handleError(_0x571b6a,null));};exports[_0xa249('0x28')]=function(_0x2697a2,_0x15545c){return db[_0xa249('0x3f')][_0xa249('0x47')]({'where':{'id':_0x2697a2[_0xa249('0x44')]['id']}})[_0xa249('0x29')](handleEntityNotFound(_0x15545c,null))[_0xa249('0x29')](removeEntity(_0x15545c,null))[_0xa249('0x48')](handleError(_0x15545c,null));};exports[_0xa249('0x4b')]=function(_0x652186,_0x1c3761){return db[_0xa249('0x3f')][_0xa249('0x4b')]()[_0xa249('0x29')](respondWithResult(_0x1c3761,null))[_0xa249('0x48')](handleError(_0x1c3761,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index baabd9c..de8237e 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x323241,_0x399da2){var _0x18cd8d=function(_0x286e54){while(--_0x286e54){_0x323241['push'](_0x323241['shift']());}};_0x18cd8d(++_0x399da2);}(_0x326f,0xd1));var _0xf326=function(_0x35e872,_0x1092cc){_0x35e872=_0x35e872-0x0;var _0x2a2da7=_0x326f[_0x35e872];return _0x2a2da7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x4bfb8b,_0x10b39f){var _0x48f13c=function(_0x346d11){while(--_0x346d11){_0x4bfb8b['push'](_0x4bfb8b['shift']());}};_0x48f13c(++_0x10b39f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x5fc3[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('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 9196cab..9bc16ca 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 _0x4f7b=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','raw','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','options'];(function(_0x2c83f9,_0xeb2f3e){var _0x2bb6ef=function(_0x1a1d61){while(--_0x1a1d61){_0x2c83f9['push'](_0x2c83f9['shift']());}};_0x2bb6ef(++_0xeb2f3e);}(_0x4f7b,0x13e));var _0xb4f7=function(_0xb9dc34,_0x211b91){_0xb9dc34=_0xb9dc34-0x0;var _0x46a81e=_0x4f7b[_0xb9dc34];return _0x46a81e;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}exports['CreateOpenchannelQueueReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')](_0x53b135[_0xb4f7('0x19')],{'raw':_0x53b135['options']?_0x53b135['options'][_0xb4f7('0x1a')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x5cc40e){logger[_0xb4f7('0xd')](_0xb4f7('0x1b'),_0x53b135);logger[_0xb4f7('0x1c')](_0xb4f7('0x1b'),_0x53b135,JSON['stringify'](_0x5cc40e));_0x22e273(_0x5cc40e);})[_0xb4f7('0x16')](function(_0x56bac5){logger[_0xb4f7('0x12')](_0xb4f7('0x1b'),_0x56bac5[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7[_0xb4f7('0x12')](0x1f4,_0x56bac5[_0xb4f7('0x14')]));});});};exports[_0xb4f7('0x1d')]=function(_0x493d81){var _0x1fe0cf=this;return new Promise(function(_0x291166,_0x19e549){return db[_0xb4f7('0x17')][_0xb4f7('0x1e')](_0x493d81[_0xb4f7('0x19')],{'raw':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493d81[_0xb4f7('0x1f')]?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x20')]||null:null,'attributes':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x21')]||null:null,'limit':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x22')]||null:null})[_0xb4f7('0xc')](function(_0x35582a){logger['info'](_0xb4f7('0x1d'),_0x493d81);logger[_0xb4f7('0x1c')](_0xb4f7('0x1d'),_0x493d81,JSON[_0xb4f7('0x11')](_0x35582a));_0x291166(_0x35582a);})['catch'](function(_0x4ea802){logger[_0xb4f7('0x12')]('UpdateOpenchannelQueueReport',_0x4ea802[_0xb4f7('0x14')],_0x493d81);_0x19e549(_0x1fe0cf[_0xb4f7('0x12')](0x1f4,_0x4ea802['message']));});});}; \ No newline at end of file +var _0x2272=['raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x39e73a,_0x5a06c9){var _0x13a6e3=function(_0x550ba2){while(--_0x550ba2){_0x39e73a['push'](_0x39e73a['shift']());}};_0x13a6e3(++_0x5a06c9);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2b26b7){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON[_0x2227('0x11')](_0x2b26b7));_0x620012(_0x2b26b7);})[_0x2227('0x17')](function(_0x10d9ca){logger[_0x2227('0x12')](_0x2227('0x18'),_0x10d9ca[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80['error'](0x1f4,_0x10d9ca[_0x2227('0x15')]));});});};exports[_0x2227('0x1e')]=function(_0x5b3a09){var _0x2cef4b=this;return new Promise(function(_0xbfdce1,_0x5ea1c3){return db['OpenchannelQueueReport'][_0x2227('0x1f')](_0x5b3a09[_0x2227('0x1b')],{'raw':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x20')]||null:null,'attributes':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09['options'][_0x2227('0x21')]||null:null,'limit':_0x5b3a09[_0x2227('0x1c')]?_0x5b3a09[_0x2227('0x1c')][_0x2227('0x22')]||null:null})[_0x2227('0xc')](function(_0x4789eb){logger['info']('UpdateOpenchannelQueueReport',_0x5b3a09);logger[_0x2227('0xf')]('UpdateOpenchannelQueueReport',_0x5b3a09,JSON[_0x2227('0x11')](_0x4789eb));_0xbfdce1(_0x4789eb);})[_0x2227('0x17')](function(_0x58609e){logger['error'](_0x2227('0x1e'),_0x58609e[_0x2227('0x15')],_0x5b3a09);_0x5ea1c3(_0x2cef4b[_0x2227('0x12')](0x1f4,_0x58609e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ab65238..60c6f60 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 _0xe390=['/:id','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x2b13b9,_0x108496){var _0x79a60b=function(_0x1194e3){while(--_0x1194e3){_0x2b13b9['push'](_0x2b13b9['shift']());}};_0x79a60b(++_0x108496);}(_0xe390,0x15a));var _0x0e39=function(_0x3a851e,_0x578f2c){_0x3a851e=_0x3a851e-0x0;var _0x157ad4=_0xe390[_0x3a851e];return _0x157ad4;};'use strict';var multer=require(_0x0e39('0x0'));var util=require(_0x0e39('0x1'));var path=require(_0x0e39('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e39('0x3')]();var fs_extra=require(_0x0e39('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e39('0x5'));var config=require('../../config/environment');var controller=require(_0x0e39('0x6'));router[_0x0e39('0x7')]('/',auth[_0x0e39('0x8')](),controller['index']);router[_0x0e39('0x7')](_0x0e39('0x9'),auth[_0x0e39('0x8')](),controller[_0x0e39('0xa')]);router['get'](_0x0e39('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0e39('0x8')](),controller[_0x0e39('0xc')]);router[_0x0e39('0xd')]('/:id',auth[_0x0e39('0x8')](),controller[_0x0e39('0xe')]);router['delete'](_0x0e39('0xb'),auth['isAuthenticated'](),controller[_0x0e39('0xf')]);module[_0x0e39('0x10')]=router; \ No newline at end of file +var _0xd482=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','util','express','Router','fs-extra'];(function(_0x1035df,_0x4978a0){var _0x50b154=function(_0x334820){while(--_0x334820){_0x1035df['push'](_0x1035df['shift']());}};_0x50b154(++_0x4978a0);}(_0xd482,0xb0));var _0x2d48=function(_0x2fee5d,_0x1fee0a){_0x2fee5d=_0x2fee5d-0x0;var _0x26c71a=_0xd482[_0x2fee5d];return _0x26c71a;};'use strict';var multer=require('multer');var util=require(_0x2d48('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d48('0x1'));var router=express[_0x2d48('0x2')]();var fs_extra=require(_0x2d48('0x3'));var auth=require(_0x2d48('0x4'));var interaction=require(_0x2d48('0x5'));var config=require(_0x2d48('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x2d48('0x7')]('/',auth[_0x2d48('0x8')](),controller[_0x2d48('0x9')]);router[_0x2d48('0x7')](_0x2d48('0xa'),auth['isAuthenticated'](),controller[_0x2d48('0xb')]);router['get'](_0x2d48('0xc'),auth[_0x2d48('0x8')](),controller[_0x2d48('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2d48('0xe')](_0x2d48('0xc'),auth[_0x2d48('0x8')](),controller[_0x2d48('0xf')]);router[_0x2d48('0x10')](_0x2d48('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d48('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 699058d..4100f95 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1d619b,_0x80734e){var _0x578641=function(_0x37c945){while(--_0x37c945){_0x1d619b['push'](_0x1d619b['shift']());}};_0x578641(++_0x80734e);}(_0x70e0,0x17b));var _0x070e=function(_0x582a13,_0x4e9f8a){_0x582a13=_0x582a13-0x0;var _0x33a5e8=_0x70e0[_0x582a13];return _0x33a5e8;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x35d120,_0x2ca28c){var _0x69e008=function(_0x182896){while(--_0x182896){_0x35d120['push'](_0x35d120['shift']());}};_0x69e008(++_0x2ca28c);}(_0x34e8,0x12c));var _0x834e=function(_0x475188,_0xbe02aa){_0x475188=_0x475188-0x0;var _0x5c3d05=_0x34e8[_0x475188];return _0x5c3d05;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6234106..6bdcdcf 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 _0x246f=['fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','intersection','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','ejs'];(function(_0x2262a7,_0x48f417){var _0x4d8132=function(_0x433e30){while(--_0x433e30){_0x2262a7['push'](_0x2262a7['shift']());}};_0x4d8132(++_0x48f417);}(_0x246f,0x166));var _0xf246=function(_0xf818d6,_0x990be){_0xf818d6=_0xf818d6-0x0;var _0x59dffe=_0x246f[_0xf818d6];return _0x59dffe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf246('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf246('0x1'));var rp=require(_0xf246('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf246('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf246('0x4'));var csv=require(_0xf246('0x5'));var ejs=require(_0xf246('0x6'));var fs=require('fs');var fs_extra=require(_0xf246('0x7'));var _=require(_0xf246('0x8'));var squel=require(_0xf246('0x9'));var crypto=require(_0xf246('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf246('0xb'));var toCsv=require(_0xf246('0x5'));var querystring=require(_0xf246('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf246('0xd'));var as=require(_0xf246('0xe'));var hardwareService=require(_0xf246('0xf'));var logger=require(_0xf246('0x10'))(_0xf246('0x11'));var utils=require('../../config/utils');var config=require(_0xf246('0x12'));var licenseUtil=require(_0xf246('0x13'));var db=require(_0xf246('0x14'))['db'];function respondWithStatusCode(_0x20a3a9,_0x5db1d9){_0x5db1d9=_0x5db1d9||0xcc;return function(_0xd1e9b0){if(_0xd1e9b0){return _0x20a3a9['sendStatus'](_0x5db1d9);}return _0x20a3a9[_0xf246('0x15')](_0x5db1d9)['end']();};}function respondWithResult(_0x15109f,_0x2b5145){_0x2b5145=_0x2b5145||0xc8;return function(_0x524e9b){if(_0x524e9b){return _0x15109f[_0xf246('0x15')](_0x2b5145)[_0xf246('0x16')](_0x524e9b);}};}function respondWithFilteredResult(_0x359b1b,_0x3714ec){return function(_0x59c4f0){if(_0x59c4f0){var _0x2deeda=typeof _0x3714ec['offset']===_0xf246('0x17')&&typeof _0x3714ec[_0xf246('0x18')]===_0xf246('0x17');var _0x4057e3=_0x59c4f0[_0xf246('0x19')];var _0x5066a2=_0x2deeda?0x0:_0x3714ec['offset'];var _0x4e9608=_0x2deeda?_0x59c4f0[_0xf246('0x19')]:_0x3714ec['offset']+_0x3714ec[_0xf246('0x18')];var _0x5d59c0;if(_0x4e9608>=_0x4057e3){_0x4e9608=_0x4057e3;_0x5d59c0=0xc8;}else{_0x5d59c0=0xce;}_0x359b1b[_0xf246('0x15')](_0x5d59c0);return _0x359b1b[_0xf246('0x1a')](_0xf246('0x1b'),_0x5066a2+'-'+_0x4e9608+'/'+_0x4057e3)[_0xf246('0x16')](_0x59c4f0);}return null;};}function patchUpdates(_0x43496a){return function(_0x423d28){try{jsonpatch[_0xf246('0x1c')](_0x423d28,_0x43496a,!![]);}catch(_0x532fa8){return BPromise[_0xf246('0x1d')](_0x532fa8);}return _0x423d28[_0xf246('0x1e')]();};}function saveUpdates(_0x4596d2,_0x3513bb){return function(_0x20bf5b){if(_0x20bf5b){return _0x20bf5b[_0xf246('0x1f')](_0x4596d2)[_0xf246('0x20')](function(_0x3e5f11){return _0x3e5f11;});}return null;};}function removeEntity(_0x4fea57,_0x3a346b){return function(_0x31df39){if(_0x31df39){return _0x31df39[_0xf246('0x21')]()[_0xf246('0x20')](function(){_0x4fea57[_0xf246('0x15')](0xcc)[_0xf246('0x22')]();});}};}function handleEntityNotFound(_0xdac926,_0x4c0fde){return function(_0x4ce10d){if(!_0x4ce10d){_0xdac926[_0xf246('0x23')](0x194);}return _0x4ce10d;};}function handleError(_0x47a5e5,_0x4bfdb1){_0x4bfdb1=_0x4bfdb1||0x1f4;return function(_0x5c6efb){logger[_0xf246('0x24')](_0x5c6efb['stack']);if(_0x5c6efb[_0xf246('0x25')]){delete _0x5c6efb[_0xf246('0x25')];}_0x47a5e5[_0xf246('0x15')](_0x4bfdb1)[_0xf246('0x26')](_0x5c6efb);};}exports[_0xf246('0x27')]=function(_0x430698,_0x22253d){var _0x126602={},_0x571255={},_0x212647={'count':0x0,'rows':[]};var _0x5f0855=_[_0xf246('0x28')](db[_0xf246('0x29')][_0xf246('0x2a')],function(_0x4b7cae){return{'name':_0x4b7cae[_0xf246('0x2b')],'type':_0x4b7cae[_0xf246('0x2c')]['key']};});_0x571255['model']=_[_0xf246('0x28')](_0x5f0855,_0xf246('0x25'));_0x571255[_0xf246('0x2d')]=_['keys'](_0x430698['query']);_0x571255[_0xf246('0x2e')]=_['intersection'](_0x571255[_0xf246('0x2f')],_0x571255[_0xf246('0x2d')]);_0x126602[_0xf246('0x30')]=_['intersection'](_0x571255['model'],qs['fields'](_0x430698[_0xf246('0x2d')][_0xf246('0x31')]));_0x126602[_0xf246('0x30')]=_0x126602[_0xf246('0x30')][_0xf246('0x32')]?_0x126602[_0xf246('0x30')]:_0x571255[_0xf246('0x2f')];if(!_0x430698[_0xf246('0x2d')][_0xf246('0x33')]('nolimit')){_0x126602['limit']=qs['limit'](_0x430698[_0xf246('0x2d')]['limit']);_0x126602[_0xf246('0x34')]=qs[_0xf246('0x34')](_0x430698[_0xf246('0x2d')][_0xf246('0x34')]);}_0x126602[_0xf246('0x35')]=qs[_0xf246('0x36')](_0x430698[_0xf246('0x2d')][_0xf246('0x36')]);_0x126602['where']=qs[_0xf246('0x2e')](_[_0xf246('0x37')](_0x430698['query'],_0x571255[_0xf246('0x2e')]),_0x5f0855);if(_0x430698[_0xf246('0x2d')][_0xf246('0x38')]){_0x126602[_0xf246('0x39')]=_[_0xf246('0x3a')](_0x126602['where'],{'$or':_[_0xf246('0x28')](_0x5f0855,function(_0x1e5c45){if(_0x1e5c45['type']!==_0xf246('0x3b')){var _0x3f2f61={};_0x3f2f61[_0x1e5c45[_0xf246('0x25')]]={'$like':'%'+_0x430698[_0xf246('0x2d')][_0xf246('0x38')]+'%'};return _0x3f2f61;}})});}_0x126602=_['merge']({},_0x126602,_0x430698[_0xf246('0x3c')]);var _0x3ff349={'where':_0x126602[_0xf246('0x39')]};return db['OpenchannelTransferReport']['count'](_0x3ff349)[_0xf246('0x20')](function(_0x5687eb){_0x212647[_0xf246('0x19')]=_0x5687eb;if(_0x430698[_0xf246('0x2d')]['includeAll']){_0x126602[_0xf246('0x3d')]=[{'all':!![]}];}return db[_0xf246('0x29')][_0xf246('0x3e')](_0x126602);})[_0xf246('0x20')](function(_0x1313f3){_0x212647[_0xf246('0x3f')]=_0x1313f3;return _0x212647;})[_0xf246('0x20')](respondWithFilteredResult(_0x22253d,_0x126602))[_0xf246('0x40')](handleError(_0x22253d,null));};exports['show']=function(_0x1f8052,_0x5af8a2){var _0x564010={'raw':!![],'where':{'id':_0x1f8052[_0xf246('0x41')]['id']}},_0x461220={};_0x461220[_0xf246('0x2f')]=_[_0xf246('0x42')](db[_0xf246('0x29')][_0xf246('0x2a')]);_0x461220[_0xf246('0x2d')]=_['keys'](_0x1f8052[_0xf246('0x2d')]);_0x461220[_0xf246('0x2e')]=_[_0xf246('0x43')](_0x461220[_0xf246('0x2f')],_0x461220['query']);_0x564010['attributes']=_[_0xf246('0x43')](_0x461220[_0xf246('0x2f')],qs[_0xf246('0x31')](_0x1f8052[_0xf246('0x2d')][_0xf246('0x31')]));_0x564010[_0xf246('0x30')]=_0x564010[_0xf246('0x30')][_0xf246('0x32')]?_0x564010[_0xf246('0x30')]:_0x461220[_0xf246('0x2f')];if(_0x1f8052['query'][_0xf246('0x44')]){_0x564010[_0xf246('0x3d')]=[{'all':!![]}];}_0x564010=_[_0xf246('0x3a')]({},_0x564010,_0x1f8052['options']);return db[_0xf246('0x29')][_0xf246('0x45')](_0x564010)[_0xf246('0x20')](handleEntityNotFound(_0x5af8a2,null))[_0xf246('0x20')](respondWithResult(_0x5af8a2,null))['catch'](handleError(_0x5af8a2,null));};exports[_0xf246('0x46')]=function(_0x52198a,_0x97ae15){return db[_0xf246('0x29')]['create'](_0x52198a['body'],{})[_0xf246('0x20')](respondWithResult(_0x97ae15,0xc9))[_0xf246('0x40')](handleError(_0x97ae15,null));};exports[_0xf246('0x1f')]=function(_0x4bd472,_0x2f5fa6){if(_0x4bd472[_0xf246('0x47')]['id']){delete _0x4bd472[_0xf246('0x47')]['id'];}return db['OpenchannelTransferReport'][_0xf246('0x45')]({'where':{'id':_0x4bd472[_0xf246('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5fa6,null))['then'](saveUpdates(_0x4bd472[_0xf246('0x47')],null))['then'](respondWithResult(_0x2f5fa6,null))[_0xf246('0x40')](handleError(_0x2f5fa6,null));};exports[_0xf246('0x21')]=function(_0x4c578e,_0x13b3d2){return db[_0xf246('0x29')][_0xf246('0x45')]({'where':{'id':_0x4c578e['params']['id']}})[_0xf246('0x20')](handleEntityNotFound(_0x13b3d2,null))[_0xf246('0x20')](removeEntity(_0x13b3d2,null))[_0xf246('0x40')](handleError(_0x13b3d2,null));};exports[_0xf246('0x48')]=function(_0x5c61f1,_0x1ccfb6){return db[_0xf246('0x29')]['describe']()['then'](respondWithResult(_0x1ccfb6,null))[_0xf246('0x40')](handleError(_0x1ccfb6,null));}; \ No newline at end of file +var _0x37de=['set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count'];(function(_0x222d81,_0x25a457){var _0x2c1e51=function(_0x51e642){while(--_0x51e642){_0x222d81['push'](_0x222d81['shift']());}};_0x2c1e51(++_0x25a457);}(_0x37de,0x10f));var _0xe37d=function(_0x2d3160,_0xec23d7){_0x2d3160=_0x2d3160-0x0;var _0x73e127=_0x37de[_0x2d3160];return _0x73e127;};'use strict';var emlformat=require(_0xe37d('0x0'));var rimraf=require(_0xe37d('0x1'));var zipdir=require(_0xe37d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe37d('0x3'));var moment=require(_0xe37d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe37d('0x5'));var util=require('util');var path=require(_0xe37d('0x6'));var sox=require(_0xe37d('0x7'));var csv=require(_0xe37d('0x8'));var ejs=require(_0xe37d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe37d('0xa'));var crypto=require(_0xe37d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe37d('0xc'));var toCsv=require(_0xe37d('0x8'));var querystring=require(_0xe37d('0xd'));var Papa=require(_0xe37d('0xe'));var Redis=require(_0xe37d('0xf'));var authService=require(_0xe37d('0x10'));var qs=require(_0xe37d('0x11'));var as=require(_0xe37d('0x12'));var hardwareService=require(_0xe37d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe37d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe37d('0x15'));var db=require(_0xe37d('0x16'))['db'];function respondWithStatusCode(_0x262cca,_0x184120){_0x184120=_0x184120||0xcc;return function(_0x5dee3c){if(_0x5dee3c){return _0x262cca['sendStatus'](_0x184120);}return _0x262cca[_0xe37d('0x17')](_0x184120)['end']();};}function respondWithResult(_0x21b22a,_0x551811){_0x551811=_0x551811||0xc8;return function(_0x2e5304){if(_0x2e5304){return _0x21b22a[_0xe37d('0x17')](_0x551811)[_0xe37d('0x18')](_0x2e5304);}};}function respondWithFilteredResult(_0x16b925,_0x41584f){return function(_0x2e2728){if(_0x2e2728){var _0x1bff73=typeof _0x41584f[_0xe37d('0x19')]==='undefined'&&typeof _0x41584f[_0xe37d('0x1a')]===_0xe37d('0x1b');var _0x44422c=_0x2e2728['count'];var _0x2dcb70=_0x1bff73?0x0:_0x41584f[_0xe37d('0x19')];var _0x1f8964=_0x1bff73?_0x2e2728[_0xe37d('0x1c')]:_0x41584f['offset']+_0x41584f[_0xe37d('0x1a')];var _0x28ae1e;if(_0x1f8964>=_0x44422c){_0x1f8964=_0x44422c;_0x28ae1e=0xc8;}else{_0x28ae1e=0xce;}_0x16b925[_0xe37d('0x17')](_0x28ae1e);return _0x16b925[_0xe37d('0x1d')](_0xe37d('0x1e'),_0x2dcb70+'-'+_0x1f8964+'/'+_0x44422c)['json'](_0x2e2728);}return null;};}function patchUpdates(_0x3be3ad){return function(_0x9adb81){try{jsonpatch[_0xe37d('0x1f')](_0x9adb81,_0x3be3ad,!![]);}catch(_0x5eac6f){return BPromise[_0xe37d('0x20')](_0x5eac6f);}return _0x9adb81['save']();};}function saveUpdates(_0x2744eb,_0x46e295){return function(_0x1f949a){if(_0x1f949a){return _0x1f949a[_0xe37d('0x21')](_0x2744eb)['then'](function(_0x90bb9d){return _0x90bb9d;});}return null;};}function removeEntity(_0xb17327,_0x15ef7e){return function(_0x41ea11){if(_0x41ea11){return _0x41ea11[_0xe37d('0x22')]()[_0xe37d('0x23')](function(){_0xb17327[_0xe37d('0x17')](0xcc)[_0xe37d('0x24')]();});}};}function handleEntityNotFound(_0x558bc3,_0x1e9276){return function(_0x2ae185){if(!_0x2ae185){_0x558bc3['sendStatus'](0x194);}return _0x2ae185;};}function handleError(_0x44381e,_0x6c86b2){_0x6c86b2=_0x6c86b2||0x1f4;return function(_0xec276c){logger[_0xe37d('0x25')](_0xec276c[_0xe37d('0x26')]);if(_0xec276c['name']){delete _0xec276c[_0xe37d('0x27')];}_0x44381e[_0xe37d('0x17')](_0x6c86b2)[_0xe37d('0x28')](_0xec276c);};}exports['index']=function(_0x47fe4f,_0x59fb45){var _0x54e0f6={},_0x435bca={},_0x3d051f={'count':0x0,'rows':[]};var _0x4372be=_[_0xe37d('0x29')](db[_0xe37d('0x2a')][_0xe37d('0x2b')],function(_0x14383f){return{'name':_0x14383f[_0xe37d('0x2c')],'type':_0x14383f[_0xe37d('0x2d')][_0xe37d('0x2e')]};});_0x435bca[_0xe37d('0x2f')]=_[_0xe37d('0x29')](_0x4372be,_0xe37d('0x27'));_0x435bca['query']=_[_0xe37d('0x30')](_0x47fe4f['query']);_0x435bca[_0xe37d('0x31')]=_[_0xe37d('0x32')](_0x435bca[_0xe37d('0x2f')],_0x435bca['query']);_0x54e0f6['attributes']=_['intersection'](_0x435bca['model'],qs[_0xe37d('0x33')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x33')]));_0x54e0f6[_0xe37d('0x35')]=_0x54e0f6['attributes']['length']?_0x54e0f6[_0xe37d('0x35')]:_0x435bca[_0xe37d('0x2f')];if(!_0x47fe4f['query'][_0xe37d('0x36')](_0xe37d('0x37'))){_0x54e0f6[_0xe37d('0x1a')]=qs[_0xe37d('0x1a')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x1a')]);_0x54e0f6[_0xe37d('0x19')]=qs[_0xe37d('0x19')](_0x47fe4f['query'][_0xe37d('0x19')]);}_0x54e0f6[_0xe37d('0x38')]=qs[_0xe37d('0x39')](_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x39')]);_0x54e0f6['where']=qs['filters'](_['pick'](_0x47fe4f[_0xe37d('0x34')],_0x435bca[_0xe37d('0x31')]),_0x4372be);if(_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3a')]){_0x54e0f6[_0xe37d('0x3b')]=_['merge'](_0x54e0f6[_0xe37d('0x3b')],{'$or':_[_0xe37d('0x29')](_0x4372be,function(_0x3cc437){if(_0x3cc437[_0xe37d('0x2d')]!==_0xe37d('0x3c')){var _0x2f75ac={};_0x2f75ac[_0x3cc437['name']]={'$like':'%'+_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3a')]+'%'};return _0x2f75ac;}})});}_0x54e0f6=_[_0xe37d('0x3d')]({},_0x54e0f6,_0x47fe4f[_0xe37d('0x3e')]);var _0x2dd724={'where':_0x54e0f6[_0xe37d('0x3b')]};return db[_0xe37d('0x2a')][_0xe37d('0x1c')](_0x2dd724)['then'](function(_0x5a392e){_0x3d051f[_0xe37d('0x1c')]=_0x5a392e;if(_0x47fe4f[_0xe37d('0x34')][_0xe37d('0x3f')]){_0x54e0f6[_0xe37d('0x40')]=[{'all':!![]}];}return db[_0xe37d('0x2a')][_0xe37d('0x41')](_0x54e0f6);})['then'](function(_0x332557){_0x3d051f[_0xe37d('0x42')]=_0x332557;return _0x3d051f;})[_0xe37d('0x23')](respondWithFilteredResult(_0x59fb45,_0x54e0f6))[_0xe37d('0x43')](handleError(_0x59fb45,null));};exports[_0xe37d('0x44')]=function(_0x5c3772,_0xa68aea){var _0x3033c6={'raw':!![],'where':{'id':_0x5c3772[_0xe37d('0x45')]['id']}},_0x22bb11={};_0x22bb11[_0xe37d('0x2f')]=_[_0xe37d('0x30')](db[_0xe37d('0x2a')]['rawAttributes']);_0x22bb11['query']=_[_0xe37d('0x30')](_0x5c3772['query']);_0x22bb11[_0xe37d('0x31')]=_[_0xe37d('0x32')](_0x22bb11['model'],_0x22bb11[_0xe37d('0x34')]);_0x3033c6[_0xe37d('0x35')]=_[_0xe37d('0x32')](_0x22bb11['model'],qs[_0xe37d('0x33')](_0x5c3772[_0xe37d('0x34')][_0xe37d('0x33')]));_0x3033c6[_0xe37d('0x35')]=_0x3033c6[_0xe37d('0x35')][_0xe37d('0x46')]?_0x3033c6[_0xe37d('0x35')]:_0x22bb11[_0xe37d('0x2f')];if(_0x5c3772[_0xe37d('0x34')][_0xe37d('0x3f')]){_0x3033c6[_0xe37d('0x40')]=[{'all':!![]}];}_0x3033c6=_['merge']({},_0x3033c6,_0x5c3772['options']);return db[_0xe37d('0x2a')][_0xe37d('0x47')](_0x3033c6)[_0xe37d('0x23')](handleEntityNotFound(_0xa68aea,null))['then'](respondWithResult(_0xa68aea,null))[_0xe37d('0x43')](handleError(_0xa68aea,null));};exports['create']=function(_0x449211,_0x1d8f8d){return db[_0xe37d('0x2a')][_0xe37d('0x48')](_0x449211[_0xe37d('0x49')],{})[_0xe37d('0x23')](respondWithResult(_0x1d8f8d,0xc9))[_0xe37d('0x43')](handleError(_0x1d8f8d,null));};exports['update']=function(_0x20e372,_0x19c987){if(_0x20e372[_0xe37d('0x49')]['id']){delete _0x20e372[_0xe37d('0x49')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x20e372[_0xe37d('0x45')]['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x19c987,null))['then'](saveUpdates(_0x20e372[_0xe37d('0x49')],null))[_0xe37d('0x23')](respondWithResult(_0x19c987,null))[_0xe37d('0x43')](handleError(_0x19c987,null));};exports[_0xe37d('0x22')]=function(_0x33d9c3,_0x455528){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x33d9c3[_0xe37d('0x45')]['id']}})[_0xe37d('0x23')](handleEntityNotFound(_0x455528,null))[_0xe37d('0x23')](removeEntity(_0x455528,null))['catch'](handleError(_0x455528,null));};exports[_0xe37d('0x4a')]=function(_0x3deb59,_0x37050b){return db[_0xe37d('0x2a')][_0xe37d('0x4a')]()[_0xe37d('0x23')](respondWithResult(_0x37050b,null))[_0xe37d('0x43')](handleError(_0x37050b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e08b687..2cd7b7f 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 _0x07dc=['request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','moment'];(function(_0x5da6ab,_0x2f5805){var _0x1f60bd=function(_0x14d8bb){while(--_0x14d8bb){_0x5da6ab['push'](_0x5da6ab['shift']());}};_0x1f60bd(++_0x2f5805);}(_0x07dc,0x1d4));var _0xc07d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x07dc[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc07d('0x0'))('api');var moment=require(_0xc07d('0x1'));var BPromise=require('bluebird');var rp=require(_0xc07d('0x2'));var fs=require('fs');var path=require(_0xc07d('0x3'));var rimraf=require('rimraf');var config=require(_0xc07d('0x4'));var attributes=require(_0xc07d('0x5'));module['exports']=function(_0xe3bb35,_0x42e4fe){return _0xe3bb35[_0xc07d('0x6')](_0xc07d('0x7'),attributes,{'tableName':_0xc07d('0x8'),'paranoid':![],'indexes':[{'name':_0xc07d('0x9'),'fields':[_0xc07d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcafe=['../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x36e8bf,_0x46e2ac){var _0xc7bd11=function(_0x744275){while(--_0x744275){_0x36e8bf['push'](_0x36e8bf['shift']());}};_0xc7bd11(++_0x46e2ac);}(_0xcafe,0x1e7));var _0xecaf=function(_0x37295e,_0x76c55a){_0x37295e=_0x37295e-0x0;var _0x4c6027=_0xcafe[_0x37295e];return _0x4c6027;};'use strict';var _=require(_0xecaf('0x0'));var util=require('util');var logger=require(_0xecaf('0x1'))(_0xecaf('0x2'));var moment=require(_0xecaf('0x3'));var BPromise=require(_0xecaf('0x4'));var rp=require(_0xecaf('0x5'));var fs=require('fs');var path=require(_0xecaf('0x6'));var rimraf=require(_0xecaf('0x7'));var config=require(_0xecaf('0x8'));var attributes=require(_0xecaf('0x9'));module[_0xecaf('0xa')]=function(_0x942fcf,_0x6f66f6){return _0x942fcf[_0xecaf('0xb')](_0xecaf('0xc'),attributes,{'tableName':_0xecaf('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xecaf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 411c1df..23b76e7 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 _0x4f0d=['ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x7b61c,_0xcd60e7){var _0x11cfb1=function(_0x39fd7f){while(--_0x39fd7f){_0x7b61c['push'](_0x7b61c['shift']());}};_0x11cfb1(++_0xcd60e7);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x4f0d[_0xf55e73];return _0x116b99;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f0('0x0'));var db=require(_0xd4f0('0x1'))['db'];var utils=require(_0xd4f0('0x2'));var logger=require('../../config/logger')(_0xd4f0('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4f0('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16da18,_0x4dd938,_0x50e79f){return new BPromise(function(_0x19a779,_0x69309d){return client[_0xd4f0('0x5')](_0x16da18,_0x50e79f)[_0xd4f0('0x6')](function(_0x9b959f){logger['info'](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4dd938,_0xd4f0('0x8'),JSON[_0xd4f0('0x9')](_0x9b959f));if(_0x9b959f['error']){if(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xb')]===0x1f4){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')]['message']);return _0x69309d(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);return _0x19a779(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}else{logger[_0xd4f0('0xd')](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));_0x19a779(_0x9b959f[_0xd4f0('0xe')]['message']);}})['catch'](function(_0x169443){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x169443);_0x69309d(_0x169443);});});} \ No newline at end of file +var _0x3fc6=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x354dbd,_0x33b8cc){var _0x207afc=function(_0x3c64a2){while(--_0x3c64a2){_0x354dbd['push'](_0x354dbd['shift']());}};_0x207afc(++_0x33b8cc);}(_0x3fc6,0x159));var _0x63fc=function(_0x538b3f,_0x36db5f){_0x538b3f=_0x538b3f-0x0;var _0x44df4e=_0x3fc6[_0x538b3f];return _0x44df4e;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var moment=require(_0x63fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require(_0x63fc('0x5'))['db'];var utils=require(_0x63fc('0x6'));var logger=require(_0x63fc('0x7'))(_0x63fc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x63fc('0x9')][_0x63fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa0d23e,_0x48cc45,_0x7d7e64){return new BPromise(function(_0x3e182f,_0x5da412){return client[_0x63fc('0xb')](_0xa0d23e,_0x7d7e64)[_0x63fc('0xc')](function(_0x231e48){logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,_0x63fc('0xf'));logger[_0x63fc('0x10')](_0x63fc('0x11'),_0x48cc45,_0x63fc('0xf'),JSON[_0x63fc('0x12')](_0x231e48));if(_0x231e48['error']){if(_0x231e48[_0x63fc('0x13')][_0x63fc('0x14')]===0x1f4){logger[_0x63fc('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x48cc45,_0x231e48['error'][_0x63fc('0x15')]);return _0x5da412(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x231e48[_0x63fc('0x13')]['message']);return _0x3e182f(_0x231e48[_0x63fc('0x13')][_0x63fc('0x15')]);}else{logger[_0x63fc('0xd')](_0x63fc('0xe'),_0x48cc45,'request\x20sent');_0x3e182f(_0x231e48[_0x63fc('0x16')]['message']);}})[_0x63fc('0x17')](function(_0x35631f){logger[_0x63fc('0x13')](_0x63fc('0xe'),_0x48cc45,_0x35631f);_0x5da412(_0x35631f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 22b4d89..5a70d0c 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 _0x60c2=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','show','create'];(function(_0x42a0fe,_0x4c693c){var _0x391dff=function(_0x5063e6){while(--_0x5063e6){_0x42a0fe['push'](_0x42a0fe['shift']());}};_0x391dff(++_0x4c693c);}(_0x60c2,0xce));var _0x260c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x60c2[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x260c('0x0'));var path=require(_0x260c('0x1'));var timeout=require(_0x260c('0x2'));var express=require(_0x260c('0x3'));var router=express[_0x260c('0x4')]();var fs_extra=require(_0x260c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x260c('0x6'));var config=require(_0x260c('0x7'));var controller=require(_0x260c('0x8'));router['get']('/',auth[_0x260c('0x9')](),controller[_0x260c('0xa')]);router[_0x260c('0xb')]('/:id',auth[_0x260c('0x9')](),controller[_0x260c('0xc')]);router['post']('/',auth[_0x260c('0x9')](),controller[_0x260c('0xd')]);router[_0x260c('0xe')](_0x260c('0xf'),auth['isAuthenticated'](),controller[_0x260c('0x10')]);router[_0x260c('0x11')](_0x260c('0xf'),auth[_0x260c('0x9')](),controller[_0x260c('0x12')]);module[_0x260c('0x13')]=router; \ No newline at end of file +var _0x0fc5=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x4859fb,_0x4a2e4d){var _0x1a8d3c=function(_0xe5fe9d){while(--_0xe5fe9d){_0x4859fb['push'](_0x4859fb['shift']());}};_0x1a8d3c(++_0x4a2e4d);}(_0x0fc5,0x1ce));var _0x50fc=function(_0x4658c8,_0x149e2f){_0x4658c8=_0x4658c8-0x0;var _0x435dae=_0x0fc5[_0x4658c8];return _0x435dae;};'use strict';var multer=require(_0x50fc('0x0'));var util=require(_0x50fc('0x1'));var path=require(_0x50fc('0x2'));var timeout=require(_0x50fc('0x3'));var express=require(_0x50fc('0x4'));var router=express[_0x50fc('0x5')]();var fs_extra=require(_0x50fc('0x6'));var auth=require(_0x50fc('0x7'));var interaction=require(_0x50fc('0x8'));var config=require('../../config/environment');var controller=require(_0x50fc('0x9'));router[_0x50fc('0xa')]('/',auth[_0x50fc('0xb')](),controller['index']);router[_0x50fc('0xa')](_0x50fc('0xc'),auth[_0x50fc('0xb')](),controller[_0x50fc('0xd')]);router[_0x50fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x50fc('0xf')]);router[_0x50fc('0x10')](_0x50fc('0xc'),auth['isAuthenticated'](),controller[_0x50fc('0x11')]);router[_0x50fc('0x12')](_0x50fc('0xc'),auth[_0x50fc('0xb')](),controller[_0x50fc('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2a20d5a..4002c29 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 _0x13a6=['sequelize','exports','STRING','name'];(function(_0xe966b3,_0x33dc7){var _0x3cf386=function(_0x53f7ea){while(--_0x53f7ea){_0xe966b3['push'](_0xe966b3['shift']());}};_0x3cf386(++_0x33dc7);}(_0x13a6,0x144));var _0x613a=function(_0x1d795a,_0x14eec0){_0x1d795a=_0x1d795a-0x0;var _0x576324=_0x13a6[_0x1d795a];return _0x576324;};'use strict';var Sequelize=require(_0x613a('0x0'));module[_0x613a('0x1')]={'name':{'type':Sequelize[_0x613a('0x2')],'unique':_0x613a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x613a('0x2')]}}; \ No newline at end of file +var _0xf6b1=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6b1,0x191));var _0x1f6b=function(_0xcabeca,_0x9b5e79){_0xcabeca=_0xcabeca-0x0;var _0x5cacb9=_0xf6b1[_0xcabeca];return _0x5cacb9;};'use strict';var Sequelize=require(_0x1f6b('0x0'));module[_0x1f6b('0x1')]={'name':{'type':Sequelize[_0x1f6b('0x2')],'unique':_0x1f6b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f3d2044..ea98d99 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 _0xf461=['filter','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','fields','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x2aae4d,_0x23330c){var _0x3c1e15=function(_0x43761d){while(--_0x43761d){_0x2aae4d['push'](_0x2aae4d['shift']());}};_0x3c1e15(++_0x23330c);}(_0xf461,0x11e));var _0x1f46=function(_0x1eaae9,_0x2b112c){_0x1eaae9=_0x1eaae9-0x0;var _0x53fc4d=_0xf461[_0x1eaae9];return _0x53fc4d;};'use strict';var emlformat=require(_0x1f46('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f46('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f46('0x2'));var moment=require(_0x1f46('0x3'));var BPromise=require(_0x1f46('0x4'));var Mustache=require(_0x1f46('0x5'));var util=require(_0x1f46('0x6'));var path=require(_0x1f46('0x7'));var sox=require(_0x1f46('0x8'));var csv=require(_0x1f46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f46('0xa'));var _=require('lodash');var squel=require(_0x1f46('0xb'));var crypto=require('crypto');var jsforce=require(_0x1f46('0xc'));var deskjs=require(_0x1f46('0xd'));var toCsv=require(_0x1f46('0x9'));var querystring=require(_0x1f46('0xe'));var Papa=require(_0x1f46('0xf'));var Redis=require(_0x1f46('0x10'));var authService=require(_0x1f46('0x11'));var qs=require(_0x1f46('0x12'));var as=require(_0x1f46('0x13'));var hardwareService=require(_0x1f46('0x14'));var logger=require(_0x1f46('0x15'))(_0x1f46('0x16'));var utils=require(_0x1f46('0x17'));var config=require(_0x1f46('0x18'));var licenseUtil=require(_0x1f46('0x19'));var db=require(_0x1f46('0x1a'))['db'];function respondWithStatusCode(_0xa41054,_0x2ed01f){_0x2ed01f=_0x2ed01f||0xcc;return function(_0x72336b){if(_0x72336b){return _0xa41054[_0x1f46('0x1b')](_0x2ed01f);}return _0xa41054['status'](_0x2ed01f)[_0x1f46('0x1c')]();};}function respondWithResult(_0x5d9198,_0x139c25){_0x139c25=_0x139c25||0xc8;return function(_0x2a2a2a){if(_0x2a2a2a){return _0x5d9198[_0x1f46('0x1d')](_0x139c25)[_0x1f46('0x1e')](_0x2a2a2a);}};}function respondWithFilteredResult(_0x380aa0,_0x24e46d){return function(_0x581bb4){if(_0x581bb4){var _0x47712c=typeof _0x24e46d[_0x1f46('0x1f')]===_0x1f46('0x20')&&typeof _0x24e46d['limit']===_0x1f46('0x20');var _0x345ab8=_0x581bb4[_0x1f46('0x21')];var _0x19e2f5=_0x47712c?0x0:_0x24e46d['offset'];var _0x13d7bb=_0x47712c?_0x581bb4[_0x1f46('0x21')]:_0x24e46d[_0x1f46('0x1f')]+_0x24e46d[_0x1f46('0x22')];var _0x32470b;if(_0x13d7bb>=_0x345ab8){_0x13d7bb=_0x345ab8;_0x32470b=0xc8;}else{_0x32470b=0xce;}_0x380aa0[_0x1f46('0x1d')](_0x32470b);return _0x380aa0[_0x1f46('0x23')]('Content-Range',_0x19e2f5+'-'+_0x13d7bb+'/'+_0x345ab8)['json'](_0x581bb4);}return null;};}function patchUpdates(_0x350ced){return function(_0x4ffad3){try{jsonpatch[_0x1f46('0x24')](_0x4ffad3,_0x350ced,!![]);}catch(_0x5dcb12){return BPromise[_0x1f46('0x25')](_0x5dcb12);}return _0x4ffad3[_0x1f46('0x26')]();};}function saveUpdates(_0x4f9bb8,_0x12eb7e){return function(_0x39de95){if(_0x39de95){return _0x39de95[_0x1f46('0x27')](_0x4f9bb8)[_0x1f46('0x28')](function(_0x57f95c){return _0x57f95c;});}return null;};}function removeEntity(_0x305546,_0x3f27d7){return function(_0x4d0b4d){if(_0x4d0b4d){return _0x4d0b4d[_0x1f46('0x29')]()[_0x1f46('0x28')](function(){var _0x5560cd=_0x4d0b4d['get']({'plain':!![]});var _0xf2fa8d=_0x1f46('0x2a');return db[_0x1f46('0x2b')][_0x1f46('0x29')]({'where':{'type':_0xf2fa8d,'resourceId':_0x5560cd['id']}})[_0x1f46('0x28')](function(){return _0x4d0b4d;});})[_0x1f46('0x28')](function(){_0x305546['status'](0xcc)[_0x1f46('0x1c')]();});}};}function handleEntityNotFound(_0xf9d1f,_0x2e3473){return function(_0x750d8c){if(!_0x750d8c){_0xf9d1f[_0x1f46('0x1b')](0x194);}return _0x750d8c;};}function handleError(_0x92800d,_0xfa8fd0){_0xfa8fd0=_0xfa8fd0||0x1f4;return function(_0x4e5856){logger[_0x1f46('0x2c')](_0x4e5856[_0x1f46('0x2d')]);if(_0x4e5856[_0x1f46('0x2e')]){delete _0x4e5856[_0x1f46('0x2e')];}_0x92800d['status'](_0xfa8fd0)[_0x1f46('0x2f')](_0x4e5856);};}exports[_0x1f46('0x30')]=function(_0x4f3f40,_0x4b2cbb){var _0x254a2f={},_0x55d9df={},_0x79df1d={'count':0x0,'rows':[]};var _0x27c875=_[_0x1f46('0x31')](db['Pause'][_0x1f46('0x32')],function(_0x13c4f2){return{'name':_0x13c4f2['fieldName'],'type':_0x13c4f2[_0x1f46('0x33')]['key']};});_0x55d9df[_0x1f46('0x34')]=_[_0x1f46('0x31')](_0x27c875,_0x1f46('0x2e'));_0x55d9df[_0x1f46('0x35')]=_[_0x1f46('0x36')](_0x4f3f40[_0x1f46('0x35')]);_0x55d9df['filters']=_[_0x1f46('0x37')](_0x55d9df[_0x1f46('0x34')],_0x55d9df['query']);_0x254a2f[_0x1f46('0x38')]=_[_0x1f46('0x37')](_0x55d9df['model'],qs['fields'](_0x4f3f40[_0x1f46('0x35')]['fields']));_0x254a2f[_0x1f46('0x38')]=_0x254a2f['attributes']['length']?_0x254a2f[_0x1f46('0x38')]:_0x55d9df[_0x1f46('0x34')];if(!_0x4f3f40[_0x1f46('0x35')][_0x1f46('0x39')](_0x1f46('0x3a'))){_0x254a2f[_0x1f46('0x22')]=qs[_0x1f46('0x22')](_0x4f3f40[_0x1f46('0x35')][_0x1f46('0x22')]);_0x254a2f[_0x1f46('0x1f')]=qs[_0x1f46('0x1f')](_0x4f3f40[_0x1f46('0x35')]['offset']);}_0x254a2f['order']=qs['sort'](_0x4f3f40['query'][_0x1f46('0x3b')]);_0x254a2f[_0x1f46('0x3c')]=qs['filters'](_['pick'](_0x4f3f40['query'],_0x55d9df[_0x1f46('0x3d')]),_0x27c875);if(_0x4f3f40['query'][_0x1f46('0x3e')]){_0x254a2f[_0x1f46('0x3c')]=_[_0x1f46('0x3f')](_0x254a2f['where'],{'$or':_['map'](_0x27c875,function(_0x2000f1){if(_0x2000f1[_0x1f46('0x33')]!==_0x1f46('0x40')){var _0x4cf254={};_0x4cf254[_0x2000f1[_0x1f46('0x2e')]]={'$like':'%'+_0x4f3f40['query'][_0x1f46('0x3e')]+'%'};return _0x4cf254;}})});}_0x254a2f=_['merge']({},_0x254a2f,_0x4f3f40[_0x1f46('0x41')]);var _0x2da842={'where':_0x254a2f[_0x1f46('0x3c')]};return db[_0x1f46('0x42')][_0x1f46('0x21')](_0x2da842)[_0x1f46('0x28')](function(_0x5b64db){_0x79df1d[_0x1f46('0x21')]=_0x5b64db;if(_0x4f3f40[_0x1f46('0x35')][_0x1f46('0x43')]){_0x254a2f['include']=[{'all':!![]}];}return db[_0x1f46('0x42')][_0x1f46('0x44')](_0x254a2f);})[_0x1f46('0x28')](function(_0x5de1a8){_0x79df1d[_0x1f46('0x45')]=_0x5de1a8;return _0x79df1d;})[_0x1f46('0x28')](respondWithFilteredResult(_0x4b2cbb,_0x254a2f))[_0x1f46('0x46')](handleError(_0x4b2cbb,null));};exports[_0x1f46('0x47')]=function(_0xd52803,_0x5af830){var _0x359d31={'raw':!![],'where':{'id':_0xd52803['params']['id']}},_0x4d3f9f={};_0x4d3f9f['model']=_[_0x1f46('0x36')](db['Pause'][_0x1f46('0x32')]);_0x4d3f9f['query']=_['keys'](_0xd52803[_0x1f46('0x35')]);_0x4d3f9f[_0x1f46('0x3d')]=_[_0x1f46('0x37')](_0x4d3f9f[_0x1f46('0x34')],_0x4d3f9f[_0x1f46('0x35')]);_0x359d31[_0x1f46('0x38')]=_[_0x1f46('0x37')](_0x4d3f9f['model'],qs[_0x1f46('0x48')](_0xd52803['query']['fields']));_0x359d31['attributes']=_0x359d31['attributes'][_0x1f46('0x49')]?_0x359d31[_0x1f46('0x38')]:_0x4d3f9f['model'];if(_0xd52803[_0x1f46('0x35')][_0x1f46('0x43')]){_0x359d31[_0x1f46('0x4a')]=[{'all':!![]}];}_0x359d31=_[_0x1f46('0x3f')]({},_0x359d31,_0xd52803[_0x1f46('0x41')]);return db[_0x1f46('0x42')][_0x1f46('0x4b')](_0x359d31)[_0x1f46('0x28')](handleEntityNotFound(_0x5af830,null))[_0x1f46('0x28')](respondWithResult(_0x5af830,null))[_0x1f46('0x46')](handleError(_0x5af830,null));};exports[_0x1f46('0x4c')]=function(_0x5a7654,_0x40c34e){return db[_0x1f46('0x42')]['create'](_0x5a7654[_0x1f46('0x4d')],{})[_0x1f46('0x28')](function(_0x13e579){var _0x5d845a=_0x5a7654[_0x1f46('0x4e')][_0x1f46('0x4f')]({'plain':!![]});if(!_0x5d845a)throw new Error(_0x1f46('0x50'));if(_0x5d845a[_0x1f46('0x51')]===_0x1f46('0x4e')){var _0x2d2a6b=_0x13e579[_0x1f46('0x4f')]({'plain':!![]});var _0x30049f=_0x1f46('0x2a');return db[_0x1f46('0x52')][_0x1f46('0x4b')]({'where':{'name':_0x30049f,'userProfileId':_0x5d845a[_0x1f46('0x53')]},'raw':!![]})[_0x1f46('0x28')](function(_0x32cf18){if(_0x32cf18&&_0x32cf18[_0x1f46('0x54')]===0x0){return db[_0x1f46('0x2b')][_0x1f46('0x4c')]({'name':_0x2d2a6b[_0x1f46('0x2e')],'resourceId':_0x2d2a6b['id'],'type':_0x32cf18[_0x1f46('0x2e')],'sectionId':_0x32cf18['id']},{})['then'](function(){return _0x13e579;});}else{return _0x13e579;}})[_0x1f46('0x46')](function(_0xaf3e88){logger[_0x1f46('0x2c')](_0x1f46('0x55'),_0xaf3e88);throw _0xaf3e88;});}return _0x13e579;})[_0x1f46('0x28')](respondWithResult(_0x40c34e,0xc9))[_0x1f46('0x46')](handleError(_0x40c34e,null));};exports[_0x1f46('0x27')]=function(_0x1d1a75,_0x53d970){if(_0x1d1a75['body']['id']){delete _0x1d1a75['body']['id'];}return db[_0x1f46('0x42')][_0x1f46('0x4b')]({'where':{'id':_0x1d1a75['params']['id']}})['then'](handleEntityNotFound(_0x53d970,null))[_0x1f46('0x28')](saveUpdates(_0x1d1a75['body'],null))[_0x1f46('0x28')](respondWithResult(_0x53d970,null))[_0x1f46('0x46')](handleError(_0x53d970,null));};exports['destroy']=function(_0x4e9f8a,_0x4b35b9){return db['Pause']['find']({'where':{'id':_0x4e9f8a[_0x1f46('0x56')]['id']}})[_0x1f46('0x28')](handleEntityNotFound(_0x4b35b9,null))[_0x1f46('0x28')](removeEntity(_0x4b35b9,null))[_0x1f46('0x46')](handleError(_0x4b35b9,null));}; \ No newline at end of file +var _0x1517=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x4fcfbe,_0x107dc6){var _0x50b203=function(_0x3a9083){while(--_0x3a9083){_0x4fcfbe['push'](_0x4fcfbe['shift']());}};_0x50b203(++_0x107dc6);}(_0x1517,0x1c7));var _0x7151=function(_0x4c6bca,_0x3de390){_0x4c6bca=_0x4c6bca-0x0;var _0x29d58e=_0x1517[_0x4c6bca];return _0x29d58e;};'use strict';var emlformat=require(_0x7151('0x0'));var rimraf=require(_0x7151('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7151('0x2'));var rp=require(_0x7151('0x3'));var moment=require(_0x7151('0x4'));var BPromise=require(_0x7151('0x5'));var Mustache=require(_0x7151('0x6'));var util=require('util');var path=require(_0x7151('0x7'));var sox=require(_0x7151('0x8'));var csv=require(_0x7151('0x9'));var ejs=require(_0x7151('0xa'));var fs=require('fs');var fs_extra=require(_0x7151('0xb'));var _=require(_0x7151('0xc'));var squel=require(_0x7151('0xd'));var crypto=require(_0x7151('0xe'));var jsforce=require(_0x7151('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7151('0x9'));var querystring=require(_0x7151('0x10'));var Papa=require(_0x7151('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7151('0x12'));var as=require(_0x7151('0x13'));var hardwareService=require(_0x7151('0x14'));var logger=require(_0x7151('0x15'))(_0x7151('0x16'));var utils=require('../../config/utils');var config=require(_0x7151('0x17'));var licenseUtil=require(_0x7151('0x18'));var db=require(_0x7151('0x19'))['db'];function respondWithStatusCode(_0x1e7906,_0x31bd97){_0x31bd97=_0x31bd97||0xcc;return function(_0x37ebc5){if(_0x37ebc5){return _0x1e7906[_0x7151('0x1a')](_0x31bd97);}return _0x1e7906['status'](_0x31bd97)[_0x7151('0x1b')]();};}function respondWithResult(_0x3bbcc8,_0x2a9a1e){_0x2a9a1e=_0x2a9a1e||0xc8;return function(_0x241d9b){if(_0x241d9b){return _0x3bbcc8[_0x7151('0x1c')](_0x2a9a1e)[_0x7151('0x1d')](_0x241d9b);}};}function respondWithFilteredResult(_0x55cdcc,_0x4e3331){return function(_0x16ef1e){if(_0x16ef1e){var _0x5aba7e=typeof _0x4e3331[_0x7151('0x1e')]===_0x7151('0x1f')&&typeof _0x4e3331[_0x7151('0x20')]===_0x7151('0x1f');var _0x14ef03=_0x16ef1e['count'];var _0x194917=_0x5aba7e?0x0:_0x4e3331['offset'];var _0x215058=_0x5aba7e?_0x16ef1e[_0x7151('0x21')]:_0x4e3331[_0x7151('0x1e')]+_0x4e3331[_0x7151('0x20')];var _0x2ac88a;if(_0x215058>=_0x14ef03){_0x215058=_0x14ef03;_0x2ac88a=0xc8;}else{_0x2ac88a=0xce;}_0x55cdcc[_0x7151('0x1c')](_0x2ac88a);return _0x55cdcc[_0x7151('0x22')]('Content-Range',_0x194917+'-'+_0x215058+'/'+_0x14ef03)['json'](_0x16ef1e);}return null;};}function patchUpdates(_0x3370ab){return function(_0x5b4c8a){try{jsonpatch[_0x7151('0x23')](_0x5b4c8a,_0x3370ab,!![]);}catch(_0x15c61d){return BPromise[_0x7151('0x24')](_0x15c61d);}return _0x5b4c8a[_0x7151('0x25')]();};}function saveUpdates(_0x1ed809,_0x169371){return function(_0x20984d){if(_0x20984d){return _0x20984d['update'](_0x1ed809)[_0x7151('0x26')](function(_0x2a5bfe){return _0x2a5bfe;});}return null;};}function removeEntity(_0xda5356,_0x5cbe6b){return function(_0x20ae4a){if(_0x20ae4a){return _0x20ae4a[_0x7151('0x27')]()['then'](function(){var _0x3f40f1=_0x20ae4a[_0x7151('0x28')]({'plain':!![]});var _0x477b4d=_0x7151('0x29');return db[_0x7151('0x2a')][_0x7151('0x27')]({'where':{'type':_0x477b4d,'resourceId':_0x3f40f1['id']}})[_0x7151('0x26')](function(){return _0x20ae4a;});})['then'](function(){_0xda5356[_0x7151('0x1c')](0xcc)[_0x7151('0x1b')]();});}};}function handleEntityNotFound(_0x22770c,_0x2c2366){return function(_0x1ae525){if(!_0x1ae525){_0x22770c[_0x7151('0x1a')](0x194);}return _0x1ae525;};}function handleError(_0x471897,_0xe2d769){_0xe2d769=_0xe2d769||0x1f4;return function(_0x515fa2){logger['error'](_0x515fa2[_0x7151('0x2b')]);if(_0x515fa2['name']){delete _0x515fa2[_0x7151('0x2c')];}_0x471897['status'](_0xe2d769)[_0x7151('0x2d')](_0x515fa2);};}exports[_0x7151('0x2e')]=function(_0x4358ed,_0x4be72c){var _0x3136c0={},_0x5836b5={},_0x51f21f={'count':0x0,'rows':[]};var _0xb3c0b2=_[_0x7151('0x2f')](db[_0x7151('0x30')][_0x7151('0x31')],function(_0x2cee62){return{'name':_0x2cee62[_0x7151('0x32')],'type':_0x2cee62[_0x7151('0x33')]['key']};});_0x5836b5[_0x7151('0x34')]=_['map'](_0xb3c0b2,_0x7151('0x2c'));_0x5836b5['query']=_[_0x7151('0x35')](_0x4358ed[_0x7151('0x36')]);_0x5836b5[_0x7151('0x37')]=_[_0x7151('0x38')](_0x5836b5['model'],_0x5836b5[_0x7151('0x36')]);_0x3136c0[_0x7151('0x39')]=_[_0x7151('0x38')](_0x5836b5[_0x7151('0x34')],qs[_0x7151('0x3a')](_0x4358ed[_0x7151('0x36')]['fields']));_0x3136c0[_0x7151('0x39')]=_0x3136c0[_0x7151('0x39')]['length']?_0x3136c0[_0x7151('0x39')]:_0x5836b5[_0x7151('0x34')];if(!_0x4358ed[_0x7151('0x36')][_0x7151('0x3b')](_0x7151('0x3c'))){_0x3136c0[_0x7151('0x20')]=qs[_0x7151('0x20')](_0x4358ed[_0x7151('0x36')][_0x7151('0x20')]);_0x3136c0['offset']=qs['offset'](_0x4358ed[_0x7151('0x36')][_0x7151('0x1e')]);}_0x3136c0[_0x7151('0x3d')]=qs['sort'](_0x4358ed[_0x7151('0x36')][_0x7151('0x3e')]);_0x3136c0[_0x7151('0x3f')]=qs[_0x7151('0x37')](_[_0x7151('0x40')](_0x4358ed[_0x7151('0x36')],_0x5836b5[_0x7151('0x37')]),_0xb3c0b2);if(_0x4358ed[_0x7151('0x36')][_0x7151('0x41')]){_0x3136c0[_0x7151('0x3f')]=_[_0x7151('0x42')](_0x3136c0[_0x7151('0x3f')],{'$or':_['map'](_0xb3c0b2,function(_0x4ec7e8){if(_0x4ec7e8[_0x7151('0x33')]!==_0x7151('0x43')){var _0x176117={};_0x176117[_0x4ec7e8[_0x7151('0x2c')]]={'$like':'%'+_0x4358ed[_0x7151('0x36')][_0x7151('0x41')]+'%'};return _0x176117;}})});}_0x3136c0=_[_0x7151('0x42')]({},_0x3136c0,_0x4358ed[_0x7151('0x44')]);var _0x3ccf64={'where':_0x3136c0[_0x7151('0x3f')]};return db[_0x7151('0x30')][_0x7151('0x21')](_0x3ccf64)[_0x7151('0x26')](function(_0x1480d3){_0x51f21f['count']=_0x1480d3;if(_0x4358ed[_0x7151('0x36')][_0x7151('0x45')]){_0x3136c0[_0x7151('0x46')]=[{'all':!![]}];}return db[_0x7151('0x30')][_0x7151('0x47')](_0x3136c0);})[_0x7151('0x26')](function(_0x150041){_0x51f21f['rows']=_0x150041;return _0x51f21f;})[_0x7151('0x26')](respondWithFilteredResult(_0x4be72c,_0x3136c0))[_0x7151('0x48')](handleError(_0x4be72c,null));};exports[_0x7151('0x49')]=function(_0x19c779,_0x27cb79){var _0x568cba={'raw':!![],'where':{'id':_0x19c779[_0x7151('0x4a')]['id']}},_0x25af65={};_0x25af65['model']=_[_0x7151('0x35')](db[_0x7151('0x30')][_0x7151('0x31')]);_0x25af65[_0x7151('0x36')]=_[_0x7151('0x35')](_0x19c779[_0x7151('0x36')]);_0x25af65[_0x7151('0x37')]=_[_0x7151('0x38')](_0x25af65[_0x7151('0x34')],_0x25af65[_0x7151('0x36')]);_0x568cba['attributes']=_[_0x7151('0x38')](_0x25af65[_0x7151('0x34')],qs['fields'](_0x19c779[_0x7151('0x36')][_0x7151('0x3a')]));_0x568cba[_0x7151('0x39')]=_0x568cba['attributes'][_0x7151('0x4b')]?_0x568cba[_0x7151('0x39')]:_0x25af65[_0x7151('0x34')];if(_0x19c779['query'][_0x7151('0x45')]){_0x568cba[_0x7151('0x46')]=[{'all':!![]}];}_0x568cba=_['merge']({},_0x568cba,_0x19c779[_0x7151('0x44')]);return db[_0x7151('0x30')][_0x7151('0x4c')](_0x568cba)['then'](handleEntityNotFound(_0x27cb79,null))[_0x7151('0x26')](respondWithResult(_0x27cb79,null))['catch'](handleError(_0x27cb79,null));};exports[_0x7151('0x4d')]=function(_0x3eb443,_0x30e28c){return db[_0x7151('0x30')][_0x7151('0x4d')](_0x3eb443[_0x7151('0x4e')],{})['then'](function(_0x43bf9d){var _0x45cd76=_0x3eb443['user'][_0x7151('0x28')]({'plain':!![]});if(!_0x45cd76)throw new Error(_0x7151('0x4f'));if(_0x45cd76[_0x7151('0x50')]==='user'){var _0x4bd8c0=_0x43bf9d['get']({'plain':!![]});var _0x3b6b9b=_0x7151('0x29');return db[_0x7151('0x51')][_0x7151('0x4c')]({'where':{'name':_0x3b6b9b,'userProfileId':_0x45cd76['userProfileId']},'raw':!![]})[_0x7151('0x26')](function(_0x251e70){if(_0x251e70&&_0x251e70[_0x7151('0x52')]===0x0){return db[_0x7151('0x2a')][_0x7151('0x4d')]({'name':_0x4bd8c0[_0x7151('0x2c')],'resourceId':_0x4bd8c0['id'],'type':_0x251e70[_0x7151('0x2c')],'sectionId':_0x251e70['id']},{})[_0x7151('0x26')](function(){return _0x43bf9d;});}else{return _0x43bf9d;}})['catch'](function(_0x32f0c3){logger[_0x7151('0x53')](_0x7151('0x54'),_0x32f0c3);throw _0x32f0c3;});}return _0x43bf9d;})[_0x7151('0x26')](respondWithResult(_0x30e28c,0xc9))[_0x7151('0x48')](handleError(_0x30e28c,null));};exports[_0x7151('0x55')]=function(_0x4b4f9e,_0x5843de){if(_0x4b4f9e[_0x7151('0x4e')]['id']){delete _0x4b4f9e[_0x7151('0x4e')]['id'];}return db[_0x7151('0x30')][_0x7151('0x4c')]({'where':{'id':_0x4b4f9e[_0x7151('0x4a')]['id']}})[_0x7151('0x26')](handleEntityNotFound(_0x5843de,null))[_0x7151('0x26')](saveUpdates(_0x4b4f9e['body'],null))[_0x7151('0x26')](respondWithResult(_0x5843de,null))[_0x7151('0x48')](handleError(_0x5843de,null));};exports[_0x7151('0x27')]=function(_0x450fcb,_0x68af49){return db[_0x7151('0x30')]['find']({'where':{'id':_0x450fcb[_0x7151('0x4a')]['id']}})[_0x7151('0x26')](handleEntityNotFound(_0x68af49,null))[_0x7151('0x26')](removeEntity(_0x68af49,null))[_0x7151('0x48')](handleError(_0x68af49,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index bac8f3a..e93cc9b 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x286949,_0x1ba55d){_0x286949=_0x286949-0x0;var _0x35a894=_0x6aa7[_0x286949];return _0x35a894;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 92ee629..5b49dbd 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(_0x52ea90,_0x4dedaf){var _0x14d239=function(_0x4b6eef){while(--_0x4b6eef){_0x52ea90['push'](_0x52ea90['shift']());}};_0x14d239(++_0x4dedaf);}(_0x7a54,0x106));var _0x47a5=function(_0x317ab4,_0x896565){_0x317ab4=_0x317ab4-0x0;var _0x5b3a5a=_0x7a54[_0x317ab4];return _0x5b3a5a;};'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(_0x74a5dc,_0x3b7c9d){var _0x971ad=function(_0x369e31){while(--_0x369e31){_0x74a5dc['push'](_0x74a5dc['shift']());}};_0x971ad(++_0x3b7c9d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a08cf,_0x186382){_0x1a08cf=_0x1a08cf-0x0;var _0x4174b7=_0xb10b[_0x1a08cf];return _0x4174b7;};'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 99c47d5..466c423 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 _0xb4e6=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost'];(function(_0x3ec68b,_0x379b17){var _0x4224fa=function(_0x26a6ca){while(--_0x26a6ca){_0x3ec68b['push'](_0x3ec68b['shift']());}};_0x4224fa(++_0x379b17);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0xb4e6[_0x5a26f5];return _0x2e9ef7;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/webhook',controller['webhookGet']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router[_0x6b4e('0x9')](_0x6b4e('0xc'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xd')]);var upload=multer({'storage':multer[_0x6b4e('0xe')]({'destination':function(_0x323487,_0x49c734,_0x39b4ec){_0x39b4ec(null,path[_0x6b4e('0xf')](config['root'],_0x6b4e('0x10')));},'filename':function(_0x9cd7da,_0x432399,_0x2b2ce0){_0x432399[_0x6b4e('0x11')]=_0x432399[_0x6b4e('0x11')][_0x6b4e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b2ce0(null,util['format'](_0x6b4e('0x13'),path[_0x6b4e('0x14')](_0x432399['originalname'],path[_0x6b4e('0x15')](_0x432399['originalname'])),Date[_0x6b4e('0x16')](),path[_0x6b4e('0x15')](_0x432399[_0x6b4e('0x11')])));}})});router[_0x6b4e('0x17')]('/',upload[_0x6b4e('0x18')](_0x6b4e('0x19')),controller['upload']);router['post'](_0x6b4e('0x1a'),controller[_0x6b4e('0x1b')]);router[_0x6b4e('0x1c')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1e')]);router[_0x6b4e('0x1f')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1f')]);module[_0x6b4e('0x20')]=router; \ No newline at end of file +var _0x8d0e=['basename','extname','now','post','file','upload','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/plugins','originalname','replace'];(function(_0x4e437e,_0x3388e0){var _0x3eca24=function(_0x25ca84){while(--_0x25ca84){_0x4e437e['push'](_0x4e437e['shift']());}};_0x3eca24(++_0x3388e0);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2cfa09,_0x6ccfce){_0x2cfa09=_0x2cfa09-0x0;var _0x42d2dc=_0x8d0e[_0x2cfa09];return _0x42d2dc;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xb')](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x10')]);router['get'](_0xe8d0('0x11'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x580aab,_0x42e0c2,_0x25e6b8){_0x25e6b8(null,path[_0xe8d0('0x13')](config[_0xe8d0('0x14')],_0xe8d0('0x15')));},'filename':function(_0x41de69,_0x5934b2,_0x38fac0){_0x5934b2[_0xe8d0('0x16')]=_0x5934b2['originalname'][_0xe8d0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38fac0(null,util['format']('%s-%s%s',path[_0xe8d0('0x18')](_0x5934b2[_0xe8d0('0x16')],path[_0xe8d0('0x19')](_0x5934b2[_0xe8d0('0x16')])),Date[_0xe8d0('0x1a')](),path[_0xe8d0('0x19')](_0x5934b2['originalname'])));}})});router[_0xe8d0('0x1b')]('/',upload['single'](_0xe8d0('0x1c')),controller[_0xe8d0('0x1d')]);router[_0xe8d0('0x1b')]('/webhook',controller['webhookPost']);router['put'](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x1e')]);router[_0xe8d0('0x1f')](_0xe8d0('0xe'),auth['isAuthenticated'](),controller[_0xe8d0('0x1f')]);module[_0xe8d0('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index abf8387..3b9eca6 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 _0xcff8=['html','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM'];(function(_0x44ee77,_0x1bcfb3){var _0x4ccfa2=function(_0x135aba){while(--_0x135aba){_0x44ee77['push'](_0x44ee77['shift']());}};_0x4ccfa2(++_0x1bcfb3);}(_0xcff8,0x182));var _0x8cff=function(_0x396dd0,_0x72023c){_0x396dd0=_0x396dd0-0x0;var _0x288f63=_0xcff8[_0x396dd0];return _0x288f63;};'use strict';var Sequelize=require(_0x8cff('0x0'));module[_0x8cff('0x1')]={'name':{'type':Sequelize[_0x8cff('0x2')]},'type':{'type':Sequelize[_0x8cff('0x3')](_0x8cff('0x4'),_0x8cff('0x5'))},'description':{'type':Sequelize[_0x8cff('0x6')]},'version':{'type':Sequelize[_0x8cff('0x6')]},'path':{'type':Sequelize[_0x8cff('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8cff('0x7')},'sidebar':{'type':Sequelize[_0x8cff('0x3')](_0x8cff('0x8'),_0x8cff('0x9'),_0x8cff('0xa'),_0x8cff('0xb')),'defaultValue':_0x8cff('0xa'),'comment':_0x8cff('0xc')},'icon':{'type':Sequelize[_0x8cff('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8cff('0x2')]},'scriptName':{'type':Sequelize[_0x8cff('0x2')]},'scriptPath':{'type':Sequelize[_0x8cff('0x2')]}}; \ No newline at end of file +var _0x0bc2=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x0bc2,0x8a));var _0x20bc=function(_0x48bc69,_0x3eabe6){_0x48bc69=_0x48bc69-0x0;var _0x488b70=_0x0bc2[_0x48bc69];return _0x488b70;};'use strict';var Sequelize=require(_0x20bc('0x0'));module[_0x20bc('0x1')]={'name':{'type':Sequelize[_0x20bc('0x2')]},'type':{'type':Sequelize[_0x20bc('0x3')]('html',_0x20bc('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x20bc('0x5')]},'path':{'type':Sequelize[_0x20bc('0x2')],'comment':_0x20bc('0x6')},'active':{'type':Sequelize[_0x20bc('0x7')],'defaultValue':0x0,'comment':_0x20bc('0x8')},'sidebar':{'type':Sequelize[_0x20bc('0x3')](_0x20bc('0x9'),_0x20bc('0xa'),_0x20bc('0xb'),'never'),'defaultValue':_0x20bc('0xb'),'comment':_0x20bc('0xc')},'icon':{'type':Sequelize[_0x20bc('0x2')]},'adminUrl':{'type':Sequelize[_0x20bc('0x2')]},'agentUrl':{'type':Sequelize[_0x20bc('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x20bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 8e40537..10a7338 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 _0x0c08=['get','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','body','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy'];(function(_0xb35529,_0xbd48c5){var _0x1d8c70=function(_0x64a4e){while(--_0x64a4e){_0xb35529['push'](_0xb35529['shift']());}};_0x1d8c70(++_0xbd48c5);}(_0x0c08,0x12d));var _0x80c0=function(_0x43e97d,_0x56a06b){_0x43e97d=_0x43e97d-0x0;var _0x424cd9=_0x0c08[_0x43e97d];return _0x424cd9;};'use strict';var emlformat=require(_0x80c0('0x0'));var rimraf=require(_0x80c0('0x1'));var zipdir=require(_0x80c0('0x2'));var jsonpatch=require(_0x80c0('0x3'));var rp=require('request-promise');var moment=require(_0x80c0('0x4'));var BPromise=require(_0x80c0('0x5'));var Mustache=require(_0x80c0('0x6'));var util=require('util');var path=require(_0x80c0('0x7'));var sox=require('sox');var csv=require(_0x80c0('0x8'));var ejs=require(_0x80c0('0x9'));var fs=require('fs');var fs_extra=require(_0x80c0('0xa'));var _=require(_0x80c0('0xb'));var squel=require(_0x80c0('0xc'));var crypto=require(_0x80c0('0xd'));var jsforce=require(_0x80c0('0xe'));var deskjs=require(_0x80c0('0xf'));var toCsv=require(_0x80c0('0x8'));var querystring=require(_0x80c0('0x10'));var Papa=require('papaparse');var extract=require(_0x80c0('0x11'));var rimraf=require(_0x80c0('0x1'));var archiver=require(_0x80c0('0x12'));var Redis=require(_0x80c0('0x13'));var authService=require(_0x80c0('0x14'));var qs=require(_0x80c0('0x15'));var as=require(_0x80c0('0x16'));var hardwareService=require(_0x80c0('0x17'));var logger=require(_0x80c0('0x18'))(_0x80c0('0x19'));var utils=require(_0x80c0('0x1a'));var config=require(_0x80c0('0x1b'));var licenseUtil=require(_0x80c0('0x1c'));var db=require(_0x80c0('0x1d'))['db'];config['redis']=_[_0x80c0('0x1e')](config[_0x80c0('0x1f')],{'host':_0x80c0('0x20'),'port':0x18eb});var socket=require(_0x80c0('0x21'))(new Redis(config[_0x80c0('0x1f')]));require(_0x80c0('0x22'))['register'](socket);function respondWithStatusCode(_0x5cafbb,_0x5997e8){_0x5997e8=_0x5997e8||0xcc;return function(_0x4d6125){if(_0x4d6125){return _0x5cafbb[_0x80c0('0x23')](_0x5997e8);}return _0x5cafbb['status'](_0x5997e8)[_0x80c0('0x24')]();};}function respondWithResult(_0x3c9ebc,_0xf90286){_0xf90286=_0xf90286||0xc8;return function(_0x1559ed){if(_0x1559ed){return _0x3c9ebc['status'](_0xf90286)[_0x80c0('0x25')](_0x1559ed);}};}function respondWithFilteredResult(_0x44b203,_0x212cb2){return function(_0x1658e4){if(_0x1658e4){var _0x4c528c=typeof _0x212cb2[_0x80c0('0x26')]===_0x80c0('0x27')&&typeof _0x212cb2['limit']===_0x80c0('0x27');var _0x3ba161=_0x1658e4[_0x80c0('0x28')];var _0x32e7b1=_0x4c528c?0x0:_0x212cb2[_0x80c0('0x26')];var _0x30e201=_0x4c528c?_0x1658e4[_0x80c0('0x28')]:_0x212cb2[_0x80c0('0x26')]+_0x212cb2['limit'];var _0x6d8435;if(_0x30e201>=_0x3ba161){_0x30e201=_0x3ba161;_0x6d8435=0xc8;}else{_0x6d8435=0xce;}_0x44b203[_0x80c0('0x29')](_0x6d8435);return _0x44b203[_0x80c0('0x2a')](_0x80c0('0x2b'),_0x32e7b1+'-'+_0x30e201+'/'+_0x3ba161)[_0x80c0('0x25')](_0x1658e4);}return null;};}function patchUpdates(_0x38dee1){return function(_0x1d6dde){try{jsonpatch[_0x80c0('0x2c')](_0x1d6dde,_0x38dee1,!![]);}catch(_0x4c1319){return BPromise[_0x80c0('0x2d')](_0x4c1319);}return _0x1d6dde['save']();};}function saveUpdates(_0x4751ab,_0x13da6f){return function(_0x48a9a5){if(_0x48a9a5){return _0x48a9a5[_0x80c0('0x2e')](_0x4751ab)[_0x80c0('0x2f')](function(_0x1a4d9a){return _0x1a4d9a;});}return null;};}function removeEntity(_0x28a24d,_0x29b389){return function(_0x36713a){if(_0x36713a){return _0x36713a[_0x80c0('0x30')]()[_0x80c0('0x2f')](function(){var _0x28289a=_0x36713a[_0x80c0('0x31')]({'plain':!![]});var _0x2fbad2=_0x80c0('0x32');return db[_0x80c0('0x33')]['destroy']({'where':{'type':_0x2fbad2,'resourceId':_0x28289a['id']}})[_0x80c0('0x2f')](function(){return _0x36713a;});})[_0x80c0('0x2f')](function(){_0x28a24d[_0x80c0('0x29')](0xcc)[_0x80c0('0x24')]();});}};}function handleEntityNotFound(_0x3a3b78,_0x4695cb){return function(_0x3e7d3f){if(!_0x3e7d3f){_0x3a3b78[_0x80c0('0x23')](0x194);}return _0x3e7d3f;};}function handleError(_0x10c979,_0x16e6d9){_0x16e6d9=_0x16e6d9||0x1f4;return function(_0x44b333){logger[_0x80c0('0x34')](_0x44b333[_0x80c0('0x35')]);if(_0x44b333[_0x80c0('0x36')]){delete _0x44b333[_0x80c0('0x36')];}_0x10c979[_0x80c0('0x29')](_0x16e6d9)['send'](_0x44b333);};}exports[_0x80c0('0x37')]=function(_0x39cb45,_0x538f0e){var _0x4b0c62={},_0x45ec76={},_0x118ef5={'count':0x0,'rows':[]};var _0x35b983=_[_0x80c0('0x38')](db[_0x80c0('0x39')][_0x80c0('0x3a')],function(_0x49444f){return{'name':_0x49444f['fieldName'],'type':_0x49444f[_0x80c0('0x3b')]['key']};});_0x45ec76[_0x80c0('0x3c')]=_[_0x80c0('0x38')](_0x35b983,'name');_0x45ec76[_0x80c0('0x3d')]=_[_0x80c0('0x3e')](_0x39cb45[_0x80c0('0x3d')]);_0x45ec76[_0x80c0('0x3f')]=_['intersection'](_0x45ec76['model'],_0x45ec76['query']);_0x4b0c62['attributes']=_[_0x80c0('0x40')](_0x45ec76[_0x80c0('0x3c')],qs[_0x80c0('0x41')](_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x41')]));_0x4b0c62[_0x80c0('0x42')]=_0x4b0c62[_0x80c0('0x42')][_0x80c0('0x43')]?_0x4b0c62[_0x80c0('0x42')]:_0x45ec76[_0x80c0('0x3c')];if(!_0x39cb45[_0x80c0('0x3d')]['hasOwnProperty'](_0x80c0('0x44'))){_0x4b0c62[_0x80c0('0x45')]=qs['limit'](_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x45')]);_0x4b0c62['offset']=qs[_0x80c0('0x26')](_0x39cb45['query'][_0x80c0('0x26')]);}_0x4b0c62[_0x80c0('0x46')]=qs[_0x80c0('0x47')](_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x47')]);_0x4b0c62['where']=qs[_0x80c0('0x3f')](_['pick'](_0x39cb45[_0x80c0('0x3d')],_0x45ec76[_0x80c0('0x3f')]),_0x35b983);if(_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x48')]){_0x4b0c62[_0x80c0('0x49')]=_['merge'](_0x4b0c62['where'],{'$or':_['map'](_0x35b983,function(_0x5b1955){if(_0x5b1955[_0x80c0('0x3b')]!==_0x80c0('0x4a')){var _0x21b460={};_0x21b460[_0x5b1955[_0x80c0('0x36')]]={'$like':'%'+_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x48')]+'%'};return _0x21b460;}})});}_0x4b0c62=_[_0x80c0('0x4b')]({},_0x4b0c62,_0x39cb45[_0x80c0('0x4c')]);var _0x29e2f6={'where':_0x4b0c62['where']};return db[_0x80c0('0x39')][_0x80c0('0x28')](_0x29e2f6)[_0x80c0('0x2f')](function(_0x30df91){_0x118ef5[_0x80c0('0x28')]=_0x30df91;if(_0x39cb45[_0x80c0('0x3d')][_0x80c0('0x4d')]){_0x4b0c62[_0x80c0('0x4e')]=[{'all':!![]}];}return db['Plugin'][_0x80c0('0x4f')](_0x4b0c62);})[_0x80c0('0x2f')](function(_0x5e8365){_0x118ef5[_0x80c0('0x50')]=_0x5e8365;return _0x118ef5;})[_0x80c0('0x2f')](respondWithFilteredResult(_0x538f0e,_0x4b0c62))[_0x80c0('0x51')](handleError(_0x538f0e,null));};exports['show']=function(_0x2bb408,_0x50dc66){var _0x5ca102={'raw':!![],'where':{'id':_0x2bb408[_0x80c0('0x52')]['id']}},_0x13c165={};_0x13c165[_0x80c0('0x3c')]=_[_0x80c0('0x3e')](db[_0x80c0('0x39')][_0x80c0('0x3a')]);_0x13c165[_0x80c0('0x3d')]=_['keys'](_0x2bb408[_0x80c0('0x3d')]);_0x13c165[_0x80c0('0x3f')]=_['intersection'](_0x13c165[_0x80c0('0x3c')],_0x13c165[_0x80c0('0x3d')]);_0x5ca102[_0x80c0('0x42')]=_['intersection'](_0x13c165[_0x80c0('0x3c')],qs[_0x80c0('0x41')](_0x2bb408[_0x80c0('0x3d')][_0x80c0('0x41')]));_0x5ca102[_0x80c0('0x42')]=_0x5ca102[_0x80c0('0x42')]['length']?_0x5ca102[_0x80c0('0x42')]:_0x13c165[_0x80c0('0x3c')];if(_0x2bb408['query'][_0x80c0('0x4d')]){_0x5ca102['include']=[{'all':!![]}];}_0x5ca102=_[_0x80c0('0x4b')]({},_0x5ca102,_0x2bb408['options']);return db[_0x80c0('0x39')][_0x80c0('0x53')](_0x5ca102)[_0x80c0('0x2f')](handleEntityNotFound(_0x50dc66,null))['then'](respondWithResult(_0x50dc66,null))[_0x80c0('0x51')](handleError(_0x50dc66,null));};exports[_0x80c0('0x54')]=function(_0x5141c1,_0xc80d91,_0x3eb603){return db['Plugin'][_0x80c0('0x53')]({'where':{'id':_0x5141c1[_0x80c0('0x52')]['id']},'attributes':['name',_0x80c0('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0xc80d91,null))[_0x80c0('0x2f')](function(_0x3ac7db){if(_0x3ac7db){var _0x2b5b27=path[_0x80c0('0x55')](config[_0x80c0('0x56')],_0x80c0('0x57'),util[_0x80c0('0x58')](_0x80c0('0x59'),path['basename'](_0x3ac7db[_0x80c0('0x7')])));var _0x54ae96=fs[_0x80c0('0x5a')](_0x2b5b27);var _0x1dfb44=archiver(_0x80c0('0x5b'),{'zlib':{'level':0x9}});_0x1dfb44['on']('warning',function(_0x14c308){if(_0x14c308[_0x80c0('0x5c')]===_0x80c0('0x5d')){logger['error'](_0x14c308);}else{throw new db[(_0x80c0('0x5e'))][(_0x80c0('0x5f'))](_0x80c0('0x60'));}});_0x1dfb44['on'](_0x80c0('0x34'),function(_0x10f66f){throw new db[(_0x80c0('0x5e'))]['Error'](_0x80c0('0x60'));});_0x1dfb44[_0x80c0('0x61')](_0x54ae96);_0x1dfb44[_0x80c0('0x62')](_0x80c0('0x63'),{'cwd':path[_0x80c0('0x55')](config[_0x80c0('0x56')],'server/files/plugins',path[_0x80c0('0x64')](_0x3ac7db[_0x80c0('0x7')])),'ignore':[path['join'](path[_0x80c0('0x65')](_0x3ac7db[_0x80c0('0x7')]),_0x80c0('0x66')),path['join'](path[_0x80c0('0x65')](_0x3ac7db['path']),_0x80c0('0x67'))],'nodir':!![]})[_0x80c0('0x68')]();_0x54ae96['on'](_0x80c0('0x69'),function(){if(!fs[_0x80c0('0x6a')](_0x2b5b27)){throw new db[(_0x80c0('0x5e'))][(_0x80c0('0x5f'))](_0x80c0('0x6b'));}return _0xc80d91['download'](_0x2b5b27,util[_0x80c0('0x58')]('%s.zip',path[_0x80c0('0x65')](_0x3ac7db[_0x80c0('0x7')])),function(_0x9b4ab2){if(_0x9b4ab2){throw new db[(_0x80c0('0x5e'))][(_0x80c0('0x5f'))](_0x80c0('0x6c'));}fs['unlinkSync'](_0x2b5b27);logger[_0x80c0('0x6d')](_0x80c0('0x6e'));logger[_0x80c0('0x6d')](_0x80c0('0x6f'));});});}return null;})['catch'](handleError(_0xc80d91,null));};exports[_0x80c0('0x70')]=function(_0x5c6b0e,_0x3499bd,_0x99ac3a){var _0x368fc0=path[_0x80c0('0x65')](_0x5c6b0e[_0x80c0('0x71')][_0x80c0('0x72')],path[_0x80c0('0x73')](_0x5c6b0e[_0x80c0('0x71')]['filename']));var _0x5a567f=path[_0x80c0('0x55')](config['root'],_0x80c0('0x57'),_0x5c6b0e['file'][_0x80c0('0x72')]);var _0x3394ec=path['join'](config[_0x80c0('0x56')],_0x80c0('0x57'),_0x368fc0);logger[_0x80c0('0x6d')](_0x80c0('0x74'),_0x5a567f);logger['info'](_0x80c0('0x75'),_0x3394ec);try{fs[_0x80c0('0x76')](_0x5a567f,parseInt(_0x80c0('0x77'),0x8));extract(_0x5a567f,{'dir':_0x3394ec},function(_0x247caa){if(_0x247caa){logger[_0x80c0('0x34')](_0x247caa);handleError(_0x247caa,!![]);};var _0x1a0b88=fs[_0x80c0('0x78')](_0x3394ec);if(_0x1a0b88[_0x80c0('0x43')]>0x1){removeReferences(_0x5a567f,_0x3394ec);logger['error']('Invalid\x20plugin\x20structure');return _0x99ac3a(new Error('Invalid\x20plugin\x20structure'));}var _0x8f49c0=fs[_0x80c0('0x79')](path[_0x80c0('0x55')](_0x3394ec,_0x1a0b88[0x0]));if(_0x8f49c0[_0x80c0('0x7a')]()){removeReferences(_0x5a567f,_0x3394ec);logger['error']('Invalid\x20plugin\x20structure');return _0x99ac3a(new Error(_0x80c0('0x7b')));}if(_0x8f49c0['isDirectory']()){var _0x912e55=fs[_0x80c0('0x78')](path[_0x80c0('0x55')](_0x3394ec,_0x1a0b88[0x0]));if(_0x912e55[_0x80c0('0x43')]===0x0){removeReferences(_0x5a567f,_0x3394ec);logger['error'](_0x80c0('0x7b'));return _0x99ac3a(new Error('Invalid\x20plugin\x20structure'));}var _0xe31ec2=_0x912e55[_0x80c0('0x7c')](function(_0x47f549){return _0x47f549==='manifest.json';});if(!_0xe31ec2){return _0x99ac3a(new Error('Plugin\x20manifest\x20missing'));}var _0x5977f2=fs['readFileSync'](path[_0x80c0('0x55')](_0x3394ec,_0x1a0b88[0x0],_0x80c0('0x7d')));var _0x5f107d=JSON[_0x80c0('0x7e')](_0x5977f2);if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x36')]){return _0x99ac3a(new Error(_0x80c0('0x7f')));}if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x3b')]){return _0x99ac3a(new Error(_0x80c0('0x80')));}if('undefined'==typeof _0x5f107d[_0x80c0('0x81')]){return _0x99ac3a(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x82')]){return _0x99ac3a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5f107d[_0x80c0('0x3b')]===_0x80c0('0x83')){if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')]){return _0x99ac3a(new Error(_0x80c0('0x85')));}if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')][_0x80c0('0x86')]&&_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x82')]['views']['agent']){return _0x99ac3a(new Error(_0x80c0('0x87')));}}else if(_0x5f107d['type']==='script'){if('undefined'==typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x88')]){return _0x99ac3a(new Error(_0x80c0('0x89')));}if(_0x80c0('0x27')==typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x8a')]){return _0x99ac3a(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x99ac3a(new Error(_0x80c0('0x8b')));}var _0x4a1edc=_0x5f107d['name'];var _0x638f50=_0x5f107d[_0x80c0('0x8c')];var _0x5a9925=_0x5f107d[_0x80c0('0x3b')];var _0x4a8078=_0x5f107d[_0x80c0('0x8d')]?_0x5f107d[_0x80c0('0x8d')]:'always';var _0x36eb5e=_0x5f107d['icon']?_0x5f107d[_0x80c0('0x8e')]:_0x80c0('0x8f');var _0x40cb97='';var _0x8229cc='';var _0x3f766b='';var _0x5849ea='';var _0x512f64=_0x5f107d['version'];if(_0x5a9925===_0x80c0('0x83')){if(_0x80c0('0x27')!=typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')]['admin']){var _0x57e248=_0x5f107d[_0x80c0('0x82')]['views'][_0x80c0('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x80c0('0x90')](_0x57e248)){_0x40cb97=path[_0x80c0('0x55')](_0x80c0('0x91'),_0x368fc0,_0x1a0b88[0x0],_0x57e248);}else{_0x40cb97=_0x57e248;}}else{logger[_0x80c0('0x6d')](_0x80c0('0x92'));}if(_0x80c0('0x27')!=typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')][_0x80c0('0x93')]){var _0x4e32dc=_0x5f107d['parameters']['views'][_0x80c0('0x93')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4e32dc)){_0x8229cc=path[_0x80c0('0x55')](_0x80c0('0x91'),_0x368fc0,_0x1a0b88[0x0],_0x4e32dc);}else{_0x8229cc=_0x4e32dc;}}else{logger[_0x80c0('0x6d')](_0x80c0('0x94'));}}else if(_0x5a9925===_0x80c0('0x95')){_0x3f766b=_0x5f107d['parameters'][_0x80c0('0x88')];_0x5849ea=_0x5f107d[_0x80c0('0x82')][_0x80c0('0x8a')];if(_0x80c0('0x27')!=typeof _0x5f107d[_0x80c0('0x82')]['views']){if(_0x80c0('0x27')!=typeof _0x5f107d['parameters'][_0x80c0('0x84')][_0x80c0('0x86')]){var _0x57e248=_0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')][_0x80c0('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x80c0('0x90')](_0x57e248)){_0x40cb97=path[_0x80c0('0x55')](_0x80c0('0x91'),_0x368fc0,_0x1a0b88[0x0],_0x57e248);}else{_0x40cb97=_0x57e248;}}if(_0x80c0('0x27')!=typeof _0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')][_0x80c0('0x93')]){var _0x4e32dc=_0x5f107d[_0x80c0('0x82')][_0x80c0('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x80c0('0x90')](_0x4e32dc)){_0x8229cc=path[_0x80c0('0x55')](_0x80c0('0x91'),_0x368fc0,_0x1a0b88[0x0],_0x4e32dc);}else{_0x8229cc=_0x4e32dc;}}}}var _0x1de4c8={'name':_0x4a1edc,'description':_0x638f50,'path':path['join'](_0x368fc0,_0x1a0b88[0x0]),'type':_0x5a9925,'sidebar':_0x4a8078,'icon':_0x36eb5e,'adminUrl':_0x40cb97,'agentUrl':_0x8229cc,'scriptName':_0x3f766b,'scriptPath':_0x5849ea,'version':_0x512f64};removeReferences(_0x5a567f,null);return db[_0x80c0('0x39')][_0x80c0('0x96')](_0x1de4c8)[_0x80c0('0x2f')](function(_0x510288){var _0x4ba62a={'role':_0x5c6b0e['body'][_0x80c0('0x97')],'userProfileId':_0x5c6b0e['body'][_0x80c0('0x98')]};if(!_0x4ba62a)throw new Error(_0x80c0('0x99'));if(_0x4ba62a['role']==='user'){var _0xe3898c=_0x510288[_0x80c0('0x31')]({'plain':!![]});return db[_0x80c0('0x9a')]['find']({'where':{'name':_0x80c0('0x32'),'userProfileId':_0x4ba62a[_0x80c0('0x98')]},'raw':!![]})[_0x80c0('0x2f')](function(_0x3102a7){if(_0x3102a7&&_0x3102a7['autoAssociation']===0x0){return db['UserProfileResource'][_0x80c0('0x96')]({'name':_0xe3898c[_0x80c0('0x36')],'resourceId':_0xe3898c['id'],'type':_0x3102a7[_0x80c0('0x36')],'sectionId':_0x3102a7['id']},{})[_0x80c0('0x2f')](function(){return _0x510288;});}else{return _0x510288;}})['catch'](function(_0x25d5c6){logger[_0x80c0('0x34')](_0x80c0('0x9b'),_0x25d5c6);throw _0x25d5c6;});}return _0x510288;})[_0x80c0('0x2f')](respondWithResult(_0x3499bd,null))[_0x80c0('0x51')](handleError(_0x3499bd,null));}});}catch(_0x5521c5){_0x3499bd['status'](0x1f4)[_0x80c0('0x9c')](_0x5521c5);}};function removeReferences(_0x20fd6e,_0x2f34a6){try{if(_0x20fd6e){fs[_0x80c0('0x9d')](_0x20fd6e);logger[_0x80c0('0x6d')]('Zip\x20archive\x20removed');}if(_0x2f34a6){rimraf(_0x2f34a6,function(){});logger[_0x80c0('0x6d')](_0x80c0('0x9e'));}}catch(_0xfd633e){logger[_0x80c0('0x34')](_0xfd633e);}}exports[_0x80c0('0x2e')]=function(_0x560511,_0x54cdc5,_0x436362){return db[_0x80c0('0x39')][_0x80c0('0x53')]({'where':{'id':_0x560511['params']['id']}})['then'](handleEntityNotFound(_0x54cdc5,null))['then'](saveUpdates(_0x560511['body'],null))[_0x80c0('0x2f')](respondWithResult(_0x54cdc5,null))[_0x80c0('0x51')](handleError(_0x54cdc5,null));};exports[_0x80c0('0x9f')]=function(_0xa554bc,_0x1c3863,_0x3f6c3b){return db['Plugin'][_0x80c0('0x53')]({'where':{'id':_0xa554bc[_0x80c0('0x52')]['id']}})['then'](function(_0x520ba5){if(_0x520ba5){return _0x520ba5[_0x80c0('0x30')]();}})[_0x80c0('0x2f')](function(_0x33da98){rimraf(path[_0x80c0('0x55')](config[_0x80c0('0x56')],_0x80c0('0x57'),path['dirname'](_0x33da98[_0x80c0('0x7')])),function(){});return _0x33da98;})[_0x80c0('0x2f')](handleEntityNotFound(_0x1c3863,null))['then'](respondWithStatusCode(_0x1c3863,null))['catch'](handleError(_0x1c3863,null));};exports[_0x80c0('0xa0')]=function(_0x2a8deb,_0x25ac7e,_0x5a5607){return BPromise[_0x80c0('0xa1')]()[_0x80c0('0x2f')](function(){if(!_0x2a8deb['query']['path']){throw new Error(_0x80c0('0xa2'));}if(!_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0xa3')]){throw new Error(_0x80c0('0xa4'));}var _0x54bfd2=_0x2a8deb[_0x80c0('0x3d')]['hostname']?_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0xa5')]+':'+_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0xa3')]:_0x80c0('0xa6')+_0x2a8deb['query'][_0x80c0('0xa3')];var _0x37a2a0=_0x2a8deb['query'][_0x80c0('0x25')]?_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0x25')]:!![];var _0x107ae4=_0x2a8deb['query']['encoding']?_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0xa7')]:null;var _0x559fc2={'method':_0x2a8deb[_0x80c0('0xa8')],'uri':util[_0x80c0('0x58')](_0x80c0('0xa9'),_0x54bfd2,_0x2a8deb[_0x80c0('0x3d')][_0x80c0('0x7')]),'json':_0x37a2a0,'resolveWithFullResponse':!![],'encoding':_0x107ae4,'qs':_0x2a8deb['query']};if(_0x2a8deb['headers']){_0x559fc2[_0x80c0('0xaa')]=_0x2a8deb[_0x80c0('0xaa')];if(_0x559fc2['headers'][_0x80c0('0xab')]){delete _0x559fc2[_0x80c0('0xaa')]['content-length'];}}if(_0x559fc2['headers']['content-type']){delete _0x559fc2['headers']['content-type'];}return rp(_0x559fc2);})[_0x80c0('0x2f')](function(_0x66415f){if(_0x66415f){_0x25ac7e[_0x80c0('0x2a')](_0x66415f[_0x80c0('0xaa')]);logger[_0x80c0('0x6d')](_0x66415f[_0x80c0('0xac')]);if(_['endsWith'](_0x2a8deb['query'][_0x80c0('0x7')],_0x80c0('0x54'))&&_0x66415f[_0x80c0('0xad')]==0x1f4){return _0x25ac7e[_0x80c0('0x23')](_0x66415f[_0x80c0('0xad')]);}else{return _0x25ac7e[_0x80c0('0x29')](_0x66415f[_0x80c0('0xad')])[_0x80c0('0x9c')](_0x66415f['body']);}}else{return _0x25ac7e[_0x80c0('0x23')](0xc8);}})[_0x80c0('0x51')](handleError(_0x25ac7e,null));};exports[_0x80c0('0xae')]=function(_0x57dc37,_0x4730d1,_0x475fef){return BPromise[_0x80c0('0xa1')]()['then'](function(){if(!_0x57dc37[_0x80c0('0x3d')][_0x80c0('0x7')]){throw new Error(_0x80c0('0xa2'));}if(!_0x57dc37[_0x80c0('0x3d')][_0x80c0('0xa3')]){throw new Error(_0x80c0('0xa4'));}var _0x55e5fc=_0x57dc37[_0x80c0('0x3d')]['hostname']?_0x57dc37[_0x80c0('0x3d')]['hostname']+':'+_0x57dc37[_0x80c0('0x3d')][_0x80c0('0xa3')]:'http://localhost:'+_0x57dc37['query'][_0x80c0('0xa3')];var _0x2a0533=_0x57dc37[_0x80c0('0x3d')]['json']?_0x57dc37[_0x80c0('0x3d')][_0x80c0('0x25')]:!![];var _0x5cadfd=_0x57dc37[_0x80c0('0x3d')]['encoding']?_0x57dc37[_0x80c0('0x3d')]['encoding']:null;var _0x159a34={'method':_0x57dc37['method'],'uri':util[_0x80c0('0x58')](_0x80c0('0xa9'),_0x55e5fc,_0x57dc37[_0x80c0('0x3d')]['path']),'json':_0x2a0533,'resolveWithFullResponse':!![],'encoding':_0x5cadfd,'body':_0x57dc37[_0x80c0('0xac')]};if(_0x57dc37[_0x80c0('0xaa')]){_0x159a34[_0x80c0('0xaa')]=_0x57dc37[_0x80c0('0xaa')];if(_0x159a34[_0x80c0('0xaa')]['content-length']){delete _0x159a34[_0x80c0('0xaa')][_0x80c0('0xab')];}}if(_0x159a34[_0x80c0('0xaa')]['content-type']){delete _0x159a34[_0x80c0('0xaa')]['content-type'];}return rp(_0x159a34);})[_0x80c0('0x2f')](function(_0x4b1708){if(_0x4b1708){_0x4730d1[_0x80c0('0x2a')](_0x4b1708[_0x80c0('0xaa')]);logger[_0x80c0('0x6d')](_0x4b1708[_0x80c0('0xac')]);return _0x4730d1[_0x80c0('0x29')](_0x4b1708[_0x80c0('0xad')])[_0x80c0('0x9c')](_0x4b1708['body']);}else{return _0x4730d1['sendStatus'](0xc8);}})[_0x80c0('0x51')](handleError(_0x4730d1,null));}; \ No newline at end of file +var _0xeecf=['attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','statusCode','webhookPost','resolve','method','%s%s','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','UserProfileResource','destroy','then','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','model'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xeecf,0x1c0));var _0xfeec=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xeecf[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfeec('0x0'));var zipdir=require(_0xfeec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfeec('0x2'));var moment=require(_0xfeec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfeec('0x4'));var util=require(_0xfeec('0x5'));var path=require(_0xfeec('0x6'));var sox=require(_0xfeec('0x7'));var csv=require(_0xfeec('0x8'));var ejs=require(_0xfeec('0x9'));var fs=require('fs');var fs_extra=require(_0xfeec('0xa'));var _=require(_0xfeec('0xb'));var squel=require(_0xfeec('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfeec('0xd'));var toCsv=require(_0xfeec('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xfeec('0xe'));var rimraf=require(_0xfeec('0x0'));var archiver=require(_0xfeec('0xf'));var Redis=require(_0xfeec('0x10'));var authService=require(_0xfeec('0x11'));var qs=require(_0xfeec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfeec('0x13'));var logger=require(_0xfeec('0x14'))('api');var utils=require(_0xfeec('0x15'));var config=require(_0xfeec('0x16'));var licenseUtil=require(_0xfeec('0x17'));var db=require(_0xfeec('0x18'))['db'];config[_0xfeec('0x19')]=_[_0xfeec('0x1a')](config[_0xfeec('0x19')],{'host':_0xfeec('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xfeec('0x1c')](socket);function respondWithStatusCode(_0x4af894,_0x497f87){_0x497f87=_0x497f87||0xcc;return function(_0x1914be){if(_0x1914be){return _0x4af894[_0xfeec('0x1d')](_0x497f87);}return _0x4af894[_0xfeec('0x1e')](_0x497f87)['end']();};}function respondWithResult(_0x58c30f,_0x428c75){_0x428c75=_0x428c75||0xc8;return function(_0x15c537){if(_0x15c537){return _0x58c30f['status'](_0x428c75)[_0xfeec('0x1f')](_0x15c537);}};}function respondWithFilteredResult(_0x4462d3,_0x16ad41){return function(_0x3c6348){if(_0x3c6348){var _0x32bdc0=typeof _0x16ad41[_0xfeec('0x20')]===_0xfeec('0x21')&&typeof _0x16ad41['limit']==='undefined';var _0x5001a0=_0x3c6348['count'];var _0x217307=_0x32bdc0?0x0:_0x16ad41[_0xfeec('0x20')];var _0xcbbaa=_0x32bdc0?_0x3c6348[_0xfeec('0x22')]:_0x16ad41[_0xfeec('0x20')]+_0x16ad41['limit'];var _0x207398;if(_0xcbbaa>=_0x5001a0){_0xcbbaa=_0x5001a0;_0x207398=0xc8;}else{_0x207398=0xce;}_0x4462d3[_0xfeec('0x1e')](_0x207398);return _0x4462d3[_0xfeec('0x23')](_0xfeec('0x24'),_0x217307+'-'+_0xcbbaa+'/'+_0x5001a0)[_0xfeec('0x1f')](_0x3c6348);}return null;};}function patchUpdates(_0x3f1d58){return function(_0x484d40){try{jsonpatch[_0xfeec('0x25')](_0x484d40,_0x3f1d58,!![]);}catch(_0x1528a8){return BPromise[_0xfeec('0x26')](_0x1528a8);}return _0x484d40[_0xfeec('0x27')]();};}function saveUpdates(_0x1df0f3,_0x38ebc7){return function(_0x12822a){if(_0x12822a){return _0x12822a[_0xfeec('0x28')](_0x1df0f3)['then'](function(_0x349c49){return _0x349c49;});}return null;};}function removeEntity(_0x3eece4,_0x11e77d){return function(_0x347666){if(_0x347666){return _0x347666['destroy']()['then'](function(){var _0x5375b9=_0x347666['get']({'plain':!![]});var _0x2fedae='Plugins';return db[_0xfeec('0x29')][_0xfeec('0x2a')]({'where':{'type':_0x2fedae,'resourceId':_0x5375b9['id']}})[_0xfeec('0x2b')](function(){return _0x347666;});})[_0xfeec('0x2b')](function(){_0x3eece4[_0xfeec('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cd3b1,_0x31bf9b){return function(_0x5277f8){if(!_0x5277f8){_0x5cd3b1[_0xfeec('0x1d')](0x194);}return _0x5277f8;};}function handleError(_0x2c743b,_0x419498){_0x419498=_0x419498||0x1f4;return function(_0x5b3766){logger[_0xfeec('0x2c')](_0x5b3766[_0xfeec('0x2d')]);if(_0x5b3766[_0xfeec('0x2e')]){delete _0x5b3766['name'];}_0x2c743b[_0xfeec('0x1e')](_0x419498)[_0xfeec('0x2f')](_0x5b3766);};}exports[_0xfeec('0x30')]=function(_0x4d0bda,_0x63a445){var _0x355eea={},_0x3045cd={},_0x7557cc={'count':0x0,'rows':[]};var _0x10e40d=_[_0xfeec('0x31')](db[_0xfeec('0x32')][_0xfeec('0x33')],function(_0x197cef){return{'name':_0x197cef[_0xfeec('0x34')],'type':_0x197cef[_0xfeec('0x35')][_0xfeec('0x36')]};});_0x3045cd['model']=_[_0xfeec('0x31')](_0x10e40d,_0xfeec('0x2e'));_0x3045cd[_0xfeec('0x37')]=_[_0xfeec('0x38')](_0x4d0bda[_0xfeec('0x37')]);_0x3045cd[_0xfeec('0x39')]=_['intersection'](_0x3045cd[_0xfeec('0x3a')],_0x3045cd[_0xfeec('0x37')]);_0x355eea[_0xfeec('0x3b')]=_[_0xfeec('0x3c')](_0x3045cd['model'],qs['fields'](_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x3d')]));_0x355eea[_0xfeec('0x3b')]=_0x355eea['attributes'][_0xfeec('0x3e')]?_0x355eea['attributes']:_0x3045cd[_0xfeec('0x3a')];if(!_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x3f')](_0xfeec('0x40'))){_0x355eea[_0xfeec('0x41')]=qs[_0xfeec('0x41')](_0x4d0bda[_0xfeec('0x37')]['limit']);_0x355eea[_0xfeec('0x20')]=qs[_0xfeec('0x20')](_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x20')]);}_0x355eea[_0xfeec('0x42')]=qs[_0xfeec('0x43')](_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x43')]);_0x355eea[_0xfeec('0x44')]=qs[_0xfeec('0x39')](_[_0xfeec('0x45')](_0x4d0bda[_0xfeec('0x37')],_0x3045cd[_0xfeec('0x39')]),_0x10e40d);if(_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x46')]){_0x355eea[_0xfeec('0x44')]=_[_0xfeec('0x47')](_0x355eea[_0xfeec('0x44')],{'$or':_[_0xfeec('0x31')](_0x10e40d,function(_0xb801fb){if(_0xb801fb[_0xfeec('0x35')]!==_0xfeec('0x48')){var _0x234b6f={};_0x234b6f[_0xb801fb[_0xfeec('0x2e')]]={'$like':'%'+_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x46')]+'%'};return _0x234b6f;}})});}_0x355eea=_['merge']({},_0x355eea,_0x4d0bda[_0xfeec('0x49')]);var _0x593399={'where':_0x355eea[_0xfeec('0x44')]};return db[_0xfeec('0x32')]['count'](_0x593399)[_0xfeec('0x2b')](function(_0x1a2fb3){_0x7557cc[_0xfeec('0x22')]=_0x1a2fb3;if(_0x4d0bda[_0xfeec('0x37')][_0xfeec('0x4a')]){_0x355eea[_0xfeec('0x4b')]=[{'all':!![]}];}return db[_0xfeec('0x32')][_0xfeec('0x4c')](_0x355eea);})[_0xfeec('0x2b')](function(_0x7c6f7b){_0x7557cc[_0xfeec('0x4d')]=_0x7c6f7b;return _0x7557cc;})[_0xfeec('0x2b')](respondWithFilteredResult(_0x63a445,_0x355eea))[_0xfeec('0x4e')](handleError(_0x63a445,null));};exports[_0xfeec('0x4f')]=function(_0x251ca6,_0x4b64dd){var _0x1ad38a={'raw':!![],'where':{'id':_0x251ca6['params']['id']}},_0x402391={};_0x402391['model']=_[_0xfeec('0x38')](db['Plugin'][_0xfeec('0x33')]);_0x402391[_0xfeec('0x37')]=_[_0xfeec('0x38')](_0x251ca6[_0xfeec('0x37')]);_0x402391['filters']=_[_0xfeec('0x3c')](_0x402391[_0xfeec('0x3a')],_0x402391[_0xfeec('0x37')]);_0x1ad38a[_0xfeec('0x3b')]=_[_0xfeec('0x3c')](_0x402391[_0xfeec('0x3a')],qs[_0xfeec('0x3d')](_0x251ca6[_0xfeec('0x37')][_0xfeec('0x3d')]));_0x1ad38a[_0xfeec('0x3b')]=_0x1ad38a[_0xfeec('0x3b')][_0xfeec('0x3e')]?_0x1ad38a[_0xfeec('0x3b')]:_0x402391[_0xfeec('0x3a')];if(_0x251ca6[_0xfeec('0x37')][_0xfeec('0x4a')]){_0x1ad38a[_0xfeec('0x4b')]=[{'all':!![]}];}_0x1ad38a=_[_0xfeec('0x47')]({},_0x1ad38a,_0x251ca6[_0xfeec('0x49')]);return db[_0xfeec('0x32')][_0xfeec('0x50')](_0x1ad38a)[_0xfeec('0x2b')](handleEntityNotFound(_0x4b64dd,null))[_0xfeec('0x2b')](respondWithResult(_0x4b64dd,null))['catch'](handleError(_0x4b64dd,null));};exports[_0xfeec('0x51')]=function(_0x42663a,_0x45bb97,_0x6872ba){return db[_0xfeec('0x32')][_0xfeec('0x50')]({'where':{'id':_0x42663a[_0xfeec('0x52')]['id']},'attributes':[_0xfeec('0x2e'),_0xfeec('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x45bb97,null))[_0xfeec('0x2b')](function(_0x4c6d15){if(_0x4c6d15){var _0x3819b0=path[_0xfeec('0x53')](config[_0xfeec('0x54')],_0xfeec('0x55'),util[_0xfeec('0x56')](_0xfeec('0x57'),path[_0xfeec('0x58')](_0x4c6d15[_0xfeec('0x6')])));var _0x1cfebe=fs[_0xfeec('0x59')](_0x3819b0);var _0x2d95af=archiver(_0xfeec('0x5a'),{'zlib':{'level':0x9}});_0x2d95af['on']('warning',function(_0x35c473){if(_0x35c473[_0xfeec('0x5b')]===_0xfeec('0x5c')){logger[_0xfeec('0x2c')](_0x35c473);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2d95af['on'](_0xfeec('0x2c'),function(_0x868918){throw new db[(_0xfeec('0x5d'))][(_0xfeec('0x5e'))](_0xfeec('0x5f'));});_0x2d95af['pipe'](_0x1cfebe);_0x2d95af[_0xfeec('0x60')]('**/*',{'cwd':path[_0xfeec('0x53')](config['root'],_0xfeec('0x55'),path[_0xfeec('0x61')](_0x4c6d15['path'])),'ignore':[path['join'](path[_0xfeec('0x58')](_0x4c6d15[_0xfeec('0x6')]),_0xfeec('0x62')),path[_0xfeec('0x53')](path[_0xfeec('0x58')](_0x4c6d15[_0xfeec('0x6')]),_0xfeec('0x63'))],'nodir':!![]})[_0xfeec('0x64')]();_0x1cfebe['on'](_0xfeec('0x65'),function(){if(!fs[_0xfeec('0x66')](_0x3819b0)){throw new db[(_0xfeec('0x5d'))][(_0xfeec('0x5e'))]('Plugin\x20not\x20found');}return _0x45bb97['download'](_0x3819b0,util[_0xfeec('0x56')](_0xfeec('0x57'),path[_0xfeec('0x58')](_0x4c6d15[_0xfeec('0x6')])),function(_0xe4150){if(_0xe4150){throw new db[(_0xfeec('0x5d'))][(_0xfeec('0x5e'))](_0xfeec('0x67'));}fs['unlinkSync'](_0x3819b0);logger['info'](_0xfeec('0x68'));logger['info'](_0xfeec('0x69'));});});}return null;})[_0xfeec('0x4e')](handleError(_0x45bb97,null));};exports[_0xfeec('0x6a')]=function(_0x4a2bc2,_0x2b3216,_0x1b0dc2){var _0x2431e3=path[_0xfeec('0x58')](_0x4a2bc2[_0xfeec('0x6b')][_0xfeec('0x6c')],path[_0xfeec('0x6d')](_0x4a2bc2[_0xfeec('0x6b')][_0xfeec('0x6c')]));var _0xe1f556=path[_0xfeec('0x53')](config[_0xfeec('0x54')],_0xfeec('0x55'),_0x4a2bc2[_0xfeec('0x6b')][_0xfeec('0x6c')]);var _0xd8fb5a=path['join'](config[_0xfeec('0x54')],_0xfeec('0x55'),_0x2431e3);logger[_0xfeec('0x6e')](_0xfeec('0x6f'),_0xe1f556);logger[_0xfeec('0x6e')]('Plugin\x20upload\x20destination:\x20%s',_0xd8fb5a);try{fs[_0xfeec('0x70')](_0xe1f556,parseInt(_0xfeec('0x71'),0x8));extract(_0xe1f556,{'dir':_0xd8fb5a},function(_0x187159){if(_0x187159){logger[_0xfeec('0x2c')](_0x187159);handleError(_0x187159,!![]);};var _0x2c136a=fs[_0xfeec('0x72')](_0xd8fb5a);if(_0x2c136a['length']>0x1){removeReferences(_0xe1f556,_0xd8fb5a);logger['error'](_0xfeec('0x73'));return _0x1b0dc2(new Error('Invalid\x20plugin\x20structure'));}var _0x2f835a=fs[_0xfeec('0x74')](path[_0xfeec('0x53')](_0xd8fb5a,_0x2c136a[0x0]));if(_0x2f835a['isFile']()){removeReferences(_0xe1f556,_0xd8fb5a);logger[_0xfeec('0x2c')]('Invalid\x20plugin\x20structure');return _0x1b0dc2(new Error(_0xfeec('0x73')));}if(_0x2f835a[_0xfeec('0x75')]()){var _0x4e6a29=fs[_0xfeec('0x72')](path[_0xfeec('0x53')](_0xd8fb5a,_0x2c136a[0x0]));if(_0x4e6a29[_0xfeec('0x3e')]===0x0){removeReferences(_0xe1f556,_0xd8fb5a);logger[_0xfeec('0x2c')](_0xfeec('0x73'));return _0x1b0dc2(new Error(_0xfeec('0x73')));}var _0x1211ae=_0x4e6a29[_0xfeec('0x76')](function(_0x1775ae){return _0x1775ae===_0xfeec('0x77');});if(!_0x1211ae){return _0x1b0dc2(new Error(_0xfeec('0x78')));}var _0x266d42=fs[_0xfeec('0x79')](path[_0xfeec('0x53')](_0xd8fb5a,_0x2c136a[0x0],'manifest.json'));var _0x1bb0a6=JSON[_0xfeec('0x7a')](_0x266d42);if(_0xfeec('0x21')==typeof _0x1bb0a6[_0xfeec('0x2e')]){return _0x1b0dc2(new Error(_0xfeec('0x7b')));}if('undefined'==typeof _0x1bb0a6[_0xfeec('0x35')]){return _0x1b0dc2(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xfeec('0x21')==typeof _0x1bb0a6[_0xfeec('0x7c')]){return _0x1b0dc2(new Error(_0xfeec('0x7d')));}if(_0xfeec('0x21')==typeof _0x1bb0a6[_0xfeec('0x7e')]){return _0x1b0dc2(new Error(_0xfeec('0x7f')));}if(_0x1bb0a6[_0xfeec('0x35')]===_0xfeec('0x80')){if('undefined'==typeof _0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')]){return _0x1b0dc2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x1bb0a6['parameters'][_0xfeec('0x81')][_0xfeec('0x82')]&&_0xfeec('0x21')==typeof _0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')]['agent']){return _0x1b0dc2(new Error(_0xfeec('0x83')));}}else if(_0x1bb0a6[_0xfeec('0x35')]===_0xfeec('0x84')){if(_0xfeec('0x21')==typeof _0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x85')]){return _0x1b0dc2(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x1bb0a6['parameters']['scriptPath']){return _0x1b0dc2(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x1b0dc2(new Error(_0xfeec('0x86')));}var _0x2ccce5=_0x1bb0a6[_0xfeec('0x2e')];var _0x4c7357=_0x1bb0a6[_0xfeec('0x87')];var _0x36870d=_0x1bb0a6[_0xfeec('0x35')];var _0x212afa=_0x1bb0a6['sidebar']?_0x1bb0a6['sidebar']:_0xfeec('0x88');var _0x237a70=_0x1bb0a6['icon']?_0x1bb0a6[_0xfeec('0x89')]:'icon-apps';var _0x1d07e3='';var _0x31233a='';var _0x502cbb='';var _0x31c10a='';var _0x13b86f=_0x1bb0a6['version'];if(_0x36870d===_0xfeec('0x80')){if('undefined'!=typeof _0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x82')]){var _0x11fdf3=_0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xfeec('0x8a')](_0x11fdf3)){_0x1d07e3=path[_0xfeec('0x53')](_0xfeec('0x8b'),_0x2431e3,_0x2c136a[0x0],_0x11fdf3);}else{_0x1d07e3=_0x11fdf3;}}else{logger['info'](_0xfeec('0x8c'));}if('undefined'!=typeof _0x1bb0a6['parameters'][_0xfeec('0x81')][_0xfeec('0x8d')]){var _0x50a232=_0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xfeec('0x8a')](_0x50a232)){_0x31233a=path['join']('plugins',_0x2431e3,_0x2c136a[0x0],_0x50a232);}else{_0x31233a=_0x50a232;}}else{logger[_0xfeec('0x6e')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x36870d==='script'){_0x502cbb=_0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x85')];_0x31c10a=_0x1bb0a6['parameters']['scriptPath'];if(_0xfeec('0x21')!=typeof _0x1bb0a6[_0xfeec('0x7e')]['views']){if('undefined'!=typeof _0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x82')]){var _0x11fdf3=_0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xfeec('0x8a')](_0x11fdf3)){_0x1d07e3=path[_0xfeec('0x53')](_0xfeec('0x8b'),_0x2431e3,_0x2c136a[0x0],_0x11fdf3);}else{_0x1d07e3=_0x11fdf3;}}if(_0xfeec('0x21')!=typeof _0x1bb0a6['parameters'][_0xfeec('0x81')]['agent']){var _0x50a232=_0x1bb0a6[_0xfeec('0x7e')][_0xfeec('0x81')][_0xfeec('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xfeec('0x8a')](_0x50a232)){_0x31233a=path[_0xfeec('0x53')](_0xfeec('0x8b'),_0x2431e3,_0x2c136a[0x0],_0x50a232);}else{_0x31233a=_0x50a232;}}}}var _0x192549={'name':_0x2ccce5,'description':_0x4c7357,'path':path[_0xfeec('0x53')](_0x2431e3,_0x2c136a[0x0]),'type':_0x36870d,'sidebar':_0x212afa,'icon':_0x237a70,'adminUrl':_0x1d07e3,'agentUrl':_0x31233a,'scriptName':_0x502cbb,'scriptPath':_0x31c10a,'version':_0x13b86f};removeReferences(_0xe1f556,null);return db[_0xfeec('0x32')][_0xfeec('0x8e')](_0x192549)[_0xfeec('0x2b')](function(_0x45d845){var _0x53e0d9={'role':_0x4a2bc2[_0xfeec('0x8f')][_0xfeec('0x90')],'userProfileId':_0x4a2bc2[_0xfeec('0x8f')][_0xfeec('0x91')]};if(!_0x53e0d9)throw new Error(_0xfeec('0x92'));if(_0x53e0d9[_0xfeec('0x90')]==='user'){var _0xf8506c=_0x45d845[_0xfeec('0x93')]({'plain':!![]});return db['UserProfileSection'][_0xfeec('0x50')]({'where':{'name':'Plugins','userProfileId':_0x53e0d9['userProfileId']},'raw':!![]})[_0xfeec('0x2b')](function(_0x321916){if(_0x321916&&_0x321916[_0xfeec('0x94')]===0x0){return db['UserProfileResource']['create']({'name':_0xf8506c[_0xfeec('0x2e')],'resourceId':_0xf8506c['id'],'type':_0x321916[_0xfeec('0x2e')],'sectionId':_0x321916['id']},{})['then'](function(){return _0x45d845;});}else{return _0x45d845;}})[_0xfeec('0x4e')](function(_0x4db0ee){logger[_0xfeec('0x2c')](_0xfeec('0x95'),_0x4db0ee);throw _0x4db0ee;});}return _0x45d845;})[_0xfeec('0x2b')](respondWithResult(_0x2b3216,null))[_0xfeec('0x4e')](handleError(_0x2b3216,null));}});}catch(_0x4bf49c){_0x2b3216[_0xfeec('0x1e')](0x1f4)[_0xfeec('0x2f')](_0x4bf49c);}};function removeReferences(_0x5f221a,_0x22d376){try{if(_0x5f221a){fs[_0xfeec('0x96')](_0x5f221a);logger[_0xfeec('0x6e')](_0xfeec('0x97'));}if(_0x22d376){rimraf(_0x22d376,function(){});logger[_0xfeec('0x6e')](_0xfeec('0x98'));}}catch(_0xc79b23){logger[_0xfeec('0x2c')](_0xc79b23);}}exports[_0xfeec('0x28')]=function(_0x47aa25,_0x1b92fb,_0x2367c7){return db['Plugin'][_0xfeec('0x50')]({'where':{'id':_0x47aa25['params']['id']}})[_0xfeec('0x2b')](handleEntityNotFound(_0x1b92fb,null))['then'](saveUpdates(_0x47aa25[_0xfeec('0x8f')],null))[_0xfeec('0x2b')](respondWithResult(_0x1b92fb,null))['catch'](handleError(_0x1b92fb,null));};exports[_0xfeec('0x99')]=function(_0x5b4447,_0x462957,_0x1f47e1){return db[_0xfeec('0x32')][_0xfeec('0x50')]({'where':{'id':_0x5b4447['params']['id']}})[_0xfeec('0x2b')](function(_0x2523d3){if(_0x2523d3){return _0x2523d3[_0xfeec('0x2a')]();}})[_0xfeec('0x2b')](function(_0x4178f4){rimraf(path[_0xfeec('0x53')](config['root'],_0xfeec('0x55'),path['dirname'](_0x4178f4['path'])),function(){});return _0x4178f4;})[_0xfeec('0x2b')](handleEntityNotFound(_0x462957,null))[_0xfeec('0x2b')](respondWithStatusCode(_0x462957,null))[_0xfeec('0x4e')](handleError(_0x462957,null));};exports[_0xfeec('0x9a')]=function(_0x4cc61c,_0xaab72e,_0x2ad724){return BPromise['resolve']()[_0xfeec('0x2b')](function(){if(!_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x6')]){throw new Error(_0xfeec('0x9b'));}if(!_0x4cc61c['query'][_0xfeec('0x9c')]){throw new Error(_0xfeec('0x9d'));}var _0x102b94=_0x4cc61c[_0xfeec('0x37')]['hostname']?_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x9e')]+':'+_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x9c')]:_0xfeec('0x9f')+_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x9c')];var _0xdd5be5=_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x1f')]?_0x4cc61c[_0xfeec('0x37')]['json']:!![];var _0x145498=_0x4cc61c[_0xfeec('0x37')]['encoding']?_0x4cc61c['query'][_0xfeec('0xa0')]:null;var _0x1aba1e={'method':_0x4cc61c['method'],'uri':util['format']('%s%s',_0x102b94,_0x4cc61c[_0xfeec('0x37')][_0xfeec('0x6')]),'json':_0xdd5be5,'resolveWithFullResponse':!![],'encoding':_0x145498,'qs':_0x4cc61c['query']};if(_0x4cc61c['headers']){_0x1aba1e['headers']=_0x4cc61c[_0xfeec('0xa1')];if(_0x1aba1e[_0xfeec('0xa1')][_0xfeec('0xa2')]){delete _0x1aba1e['headers']['content-length'];}}if(_0x1aba1e['headers']['content-type']){delete _0x1aba1e[_0xfeec('0xa1')][_0xfeec('0xa3')];}return rp(_0x1aba1e);})['then'](function(_0x53bc76){if(_0x53bc76){_0xaab72e[_0xfeec('0x23')](_0x53bc76[_0xfeec('0xa1')]);logger[_0xfeec('0x6e')](_0x53bc76[_0xfeec('0x8f')]);if(_['endsWith'](_0x4cc61c['query']['path'],_0xfeec('0x51'))&&_0x53bc76[_0xfeec('0xa4')]==0x1f4){return _0xaab72e[_0xfeec('0x1d')](_0x53bc76[_0xfeec('0xa4')]);}else{return _0xaab72e['status'](_0x53bc76[_0xfeec('0xa4')])[_0xfeec('0x2f')](_0x53bc76[_0xfeec('0x8f')]);}}else{return _0xaab72e[_0xfeec('0x1d')](0xc8);}})[_0xfeec('0x4e')](handleError(_0xaab72e,null));};exports[_0xfeec('0xa5')]=function(_0x34b05f,_0x2894ce,_0x44f38a){return BPromise[_0xfeec('0xa6')]()[_0xfeec('0x2b')](function(){if(!_0x34b05f['query'][_0xfeec('0x6')]){throw new Error(_0xfeec('0x9b'));}if(!_0x34b05f['query']['port']){throw new Error(_0xfeec('0x9d'));}var _0x2752c7=_0x34b05f[_0xfeec('0x37')][_0xfeec('0x9e')]?_0x34b05f[_0xfeec('0x37')][_0xfeec('0x9e')]+':'+_0x34b05f[_0xfeec('0x37')][_0xfeec('0x9c')]:_0xfeec('0x9f')+_0x34b05f['query'][_0xfeec('0x9c')];var _0x881261=_0x34b05f[_0xfeec('0x37')][_0xfeec('0x1f')]?_0x34b05f[_0xfeec('0x37')][_0xfeec('0x1f')]:!![];var _0x1c46fc=_0x34b05f[_0xfeec('0x37')][_0xfeec('0xa0')]?_0x34b05f[_0xfeec('0x37')]['encoding']:null;var _0x1539df={'method':_0x34b05f[_0xfeec('0xa7')],'uri':util[_0xfeec('0x56')](_0xfeec('0xa8'),_0x2752c7,_0x34b05f[_0xfeec('0x37')][_0xfeec('0x6')]),'json':_0x881261,'resolveWithFullResponse':!![],'encoding':_0x1c46fc,'body':_0x34b05f[_0xfeec('0x8f')]};if(_0x34b05f[_0xfeec('0xa1')]){_0x1539df['headers']=_0x34b05f[_0xfeec('0xa1')];if(_0x1539df['headers']['content-length']){delete _0x1539df[_0xfeec('0xa1')][_0xfeec('0xa2')];}}if(_0x1539df[_0xfeec('0xa1')][_0xfeec('0xa3')]){delete _0x1539df[_0xfeec('0xa1')]['content-type'];}return rp(_0x1539df);})[_0xfeec('0x2b')](function(_0x2f32e8){if(_0x2f32e8){_0x2894ce[_0xfeec('0x23')](_0x2f32e8[_0xfeec('0xa1')]);logger[_0xfeec('0x6e')](_0x2f32e8['body']);return _0x2894ce[_0xfeec('0x1e')](_0x2f32e8[_0xfeec('0xa4')])[_0xfeec('0x2f')](_0x2f32e8[_0xfeec('0x8f')]);}else{return _0x2894ce[_0xfeec('0x1d')](0xc8);}})['catch'](handleError(_0x2894ce,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index abe36a9..113dd76 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 _0x78d3=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4a534f,_0x1b8b22){var _0x7f42e3=function(_0xdaa5ea){while(--_0xdaa5ea){_0x4a534f['push'](_0x4a534f['shift']());}};_0x7f42e3(++_0x1b8b22);}(_0x78d3,0x73));var _0x378d=function(_0x54e81a,_0x4ba69d){_0x54e81a=_0x54e81a-0x0;var _0x937fe=_0x78d3[_0x54e81a];return _0x937fe;};'use strict';var EventEmitter=require(_0x378d('0x0'));var Plugin=require(_0x378d('0x1'))['db'][_0x378d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x378d('0x3')](0x0);var events={'afterCreate':_0x378d('0x4'),'afterUpdate':_0x378d('0x5'),'afterDestroy':_0x378d('0x6')};function emitEvent(_0x29273c){return function(_0x52f934,_0x32a62f,_0x23360d){PluginEvents[_0x378d('0x7')](_0x29273c+':'+_0x52f934['id'],_0x52f934);PluginEvents[_0x378d('0x7')](_0x29273c,_0x52f934);_0x23360d(null);};}for(var e in events){if(events[_0x378d('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x2bae=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe2ba('0x0'));var Plugin=require(_0xe2ba('0x1'))['db'][_0xe2ba('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe2ba('0x3')](0x0);var events={'afterCreate':_0xe2ba('0x4'),'afterUpdate':_0xe2ba('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd372a){return function(_0x52f39e,_0x442279,_0x58af7d){PluginEvents[_0xe2ba('0x6')](_0xd372a+':'+_0x52f39e['id'],_0x52f39e);PluginEvents[_0xe2ba('0x6')](_0xd372a,_0x52f39e);_0x58af7d(null);};}for(var e in events){if(events[_0xe2ba('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xe2ba('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8b89916..7a91e8c 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 _0x39c6=['moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x39c6,0x175));var _0x639c=function(_0x41b7f2,_0x5df667){_0x41b7f2=_0x41b7f2-0x0;var _0x42d595=_0x39c6[_0x41b7f2];return _0x42d595;};'use strict';var _=require(_0x639c('0x0'));var util=require(_0x639c('0x1'));var logger=require(_0x639c('0x2'))(_0x639c('0x3'));var moment=require(_0x639c('0x4'));var BPromise=require('bluebird');var rp=require(_0x639c('0x5'));var fs=require('fs');var path=require(_0x639c('0x6'));var rimraf=require(_0x639c('0x7'));var config=require(_0x639c('0x8'));var attributes=require(_0x639c('0x9'));module[_0x639c('0xa')]=function(_0x21fd3b,_0x56da41){return _0x21fd3b[_0x639c('0xb')](_0x639c('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3566=['../../config/environment','exports','Plugin','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3566,0x159));var _0x6356=function(_0xb0c885,_0x6f33d5){_0xb0c885=_0xb0c885-0x0;var _0x5f1f88=_0x3566[_0xb0c885];return _0x5f1f88;};'use strict';var _=require(_0x6356('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6356('0x1'));var moment=require(_0x6356('0x2'));var BPromise=require(_0x6356('0x3'));var rp=require(_0x6356('0x4'));var fs=require('fs');var path=require(_0x6356('0x5'));var rimraf=require('rimraf');var config=require(_0x6356('0x6'));var attributes=require('./plugin.attributes');module[_0x6356('0x7')]=function(_0x5600e6,_0x320f59){return _0x5600e6['define'](_0x6356('0x8'),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 7ac7fdd..ec87313 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 _0x19fa=['redis','localhost','register','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','body','options','raw','info','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x19fa,0x8e));var _0xa19f=function(_0x493cf6,_0x246edb){_0x493cf6=_0x493cf6-0x0;var _0xaf5f92=_0x19fa[_0x493cf6];return _0xaf5f92;};'use strict';var _=require(_0xa19f('0x0'));var util=require(_0xa19f('0x1'));var moment=require(_0xa19f('0x2'));var BPromise=require(_0xa19f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19f('0x4'));var db=require(_0xa19f('0x5'))['db'];var utils=require(_0xa19f('0x6'));var logger=require(_0xa19f('0x7'))(_0xa19f('0x8'));var config=require(_0xa19f('0x9'));var jayson=require(_0xa19f('0xa'));var client=jayson[_0xa19f('0xb')][_0xa19f('0xc')]({'port':0x232a});config[_0xa19f('0xd')]=_['defaults'](config[_0xa19f('0xd')],{'host':_0xa19f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xa19f('0xf')](socket);function respondWithRpcPromise(_0x540c2f,_0x2823ee,_0x4223d2){return new BPromise(function(_0x3e7373,_0x2d574a){return client['request'](_0x540c2f,_0x4223d2)[_0xa19f('0x10')](function(_0x22f98a){logger['info'](_0xa19f('0x11'),_0x2823ee,'request\x20sent');logger[_0xa19f('0x12')](_0xa19f('0x13'),_0x2823ee,'request\x20sent',JSON['stringify'](_0x22f98a));if(_0x22f98a[_0xa19f('0x14')]){if(_0x22f98a['error'][_0xa19f('0x15')]===0x1f4){logger['error'](_0xa19f('0x11'),_0x2823ee,_0x22f98a[_0xa19f('0x14')]['message']);return _0x2d574a(_0x22f98a[_0xa19f('0x14')][_0xa19f('0x16')]);}logger[_0xa19f('0x14')]('Plugin,\x20%s,\x20%s',_0x2823ee,_0x22f98a['error']['message']);return _0x3e7373(_0x22f98a[_0xa19f('0x14')]['message']);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x2823ee,'request\x20sent');_0x3e7373(_0x22f98a[_0xa19f('0x17')][_0xa19f('0x16')]);}})[_0xa19f('0x18')](function(_0x3c3f5f){logger[_0xa19f('0x14')](_0xa19f('0x11'),_0x2823ee,_0x3c3f5f);_0x2d574a(_0x3c3f5f);});});}exports[_0xa19f('0x19')]=function(_0x1f04b3){var _0x35f5ef=this;return new Promise(function(_0x4aeda8,_0x52ec78){return db['Plugin']['create'](_0x1f04b3[_0xa19f('0x1a')],{'raw':_0x1f04b3['options']?_0x1f04b3[_0xa19f('0x1b')][_0xa19f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x15f83c){logger[_0xa19f('0x1d')]('CreatePlugin',_0x1f04b3);logger[_0xa19f('0x12')]('CreatePlugin',_0x1f04b3,JSON[_0xa19f('0x1e')](_0x15f83c));_0x4aeda8(_0x15f83c);})[_0xa19f('0x18')](function(_0x1c8ffd){logger[_0xa19f('0x14')](_0xa19f('0x19'),_0x1c8ffd[_0xa19f('0x16')],_0x1f04b3);_0x52ec78(_0x35f5ef['error'](0x1f4,_0x1c8ffd[_0xa19f('0x16')]));});});}; \ No newline at end of file +var _0x3414=['lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','body','options','debug','stringify'];(function(_0x3b724b,_0x9a0f1d){var _0x2725da=function(_0x42313a){while(--_0x42313a){_0x3b724b['push'](_0x3b724b['shift']());}};_0x2725da(++_0x9a0f1d);}(_0x3414,0x1b0));var _0x4341=function(_0x51f9bd,_0x1b85f3){_0x51f9bd=_0x51f9bd-0x0;var _0x229c60=_0x3414[_0x51f9bd];return _0x229c60;};'use strict';var _=require(_0x4341('0x0'));var util=require('util');var moment=require(_0x4341('0x1'));var BPromise=require('bluebird');var rs=require(_0x4341('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4341('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4341('0x4'))(_0x4341('0x5'));var config=require(_0x4341('0x6'));var jayson=require(_0x4341('0x7'));var client=jayson[_0x4341('0x8')][_0x4341('0x9')]({'port':0x232a});config[_0x4341('0xa')]=_[_0x4341('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4341('0xc'))(new Redis(config[_0x4341('0xa')]));require('./plugin.socket')[_0x4341('0xd')](socket);function respondWithRpcPromise(_0x5a0bd4,_0x16b2ed,_0x5ed998){return new BPromise(function(_0x4e1889,_0x3b35a8){return client[_0x4341('0xe')](_0x5a0bd4,_0x5ed998)['then'](function(_0x31dc4d){logger[_0x4341('0xf')]('Plugin,\x20%s,\x20%s',_0x16b2ed,'request\x20sent');logger['debug'](_0x4341('0x10'),_0x16b2ed,_0x4341('0x11'),JSON['stringify'](_0x31dc4d));if(_0x31dc4d[_0x4341('0x12')]){if(_0x31dc4d[_0x4341('0x12')]['code']===0x1f4){logger['error'](_0x4341('0x13'),_0x16b2ed,_0x31dc4d[_0x4341('0x12')][_0x4341('0x14')]);return _0x3b35a8(_0x31dc4d['error'][_0x4341('0x14')]);}logger['error'](_0x4341('0x13'),_0x16b2ed,_0x31dc4d[_0x4341('0x12')][_0x4341('0x14')]);return _0x4e1889(_0x31dc4d['error'][_0x4341('0x14')]);}else{logger[_0x4341('0xf')](_0x4341('0x13'),_0x16b2ed,'request\x20sent');_0x4e1889(_0x31dc4d['result'][_0x4341('0x14')]);}})[_0x4341('0x15')](function(_0x229035){logger['error'](_0x4341('0x13'),_0x16b2ed,_0x229035);_0x3b35a8(_0x229035);});});}exports[_0x4341('0x16')]=function(_0x44d50e){var _0x432f90=this;return new Promise(function(_0x20b520,_0x26cb6f){return db['Plugin']['create'](_0x44d50e[_0x4341('0x17')],{'raw':_0x44d50e[_0x4341('0x18')]?_0x44d50e[_0x4341('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x575a0c){logger[_0x4341('0xf')](_0x4341('0x16'),_0x44d50e);logger[_0x4341('0x19')](_0x4341('0x16'),_0x44d50e,JSON[_0x4341('0x1a')](_0x575a0c));_0x20b520(_0x575a0c);})[_0x4341('0x15')](function(_0x4db6d4){logger[_0x4341('0x12')]('CreatePlugin',_0x4db6d4[_0x4341('0x14')],_0x44d50e);_0x26cb6f(_0x432f90['error'](0x1f4,_0x4db6d4[_0x4341('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c8251df..8e17914 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 _0x8d23=['emit','removeListener','register','length','remove','update'];(function(_0x3b1e3f,_0xf8826b){var _0x3b1cd3=function(_0x26ad44){while(--_0x26ad44){_0x3b1e3f['push'](_0x3b1e3f['shift']());}};_0x3b1cd3(++_0xf8826b);}(_0x8d23,0x8e));var _0x38d2=function(_0x1d2345,_0x3138f4){_0x1d2345=_0x1d2345-0x0;var _0x207ec0=_0x8d23[_0x1d2345];return _0x207ec0;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x38d2('0x0'),_0x38d2('0x1')];function createListener(_0xa230fb,_0x273a9a){return function(_0x526e08){_0x273a9a[_0x38d2('0x2')](_0xa230fb,_0x526e08);};}function removeListener(_0x480910,_0x48e415){return function(){PluginEvents[_0x38d2('0x3')](_0x480910,_0x48e415);};}exports[_0x38d2('0x4')]=function(_0x4486aa){for(var _0x1f2de9=0x0,_0x189e32=events[_0x38d2('0x5')];_0x1f2de9<_0x189e32;_0x1f2de9++){var _0x1576dc=events[_0x1f2de9];var _0xec09bb=createListener('plugin:'+_0x1576dc,_0x4486aa);PluginEvents['on'](_0x1576dc,_0xec09bb);}}; \ No newline at end of file +var _0x8abc=['./plugin.events','save','remove','update','emit','removeListener','length'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x8abc,0x15e));var _0xc8ab=function(_0x2f4bc4,_0x443c97){_0x2f4bc4=_0x2f4bc4-0x0;var _0x354881=_0x8abc[_0x2f4bc4];return _0x354881;};'use strict';var PluginEvents=require(_0xc8ab('0x0'));var events=[_0xc8ab('0x1'),_0xc8ab('0x2'),_0xc8ab('0x3')];function createListener(_0x2a8807,_0x5d94c3){return function(_0x2579bd){_0x5d94c3[_0xc8ab('0x4')](_0x2a8807,_0x2579bd);};}function removeListener(_0x1760dd,_0x3f2021){return function(){PluginEvents[_0xc8ab('0x5')](_0x1760dd,_0x3f2021);};}exports['register']=function(_0x3c9532){for(var _0xfaa39a=0x0,_0x15cbd6=events[_0xc8ab('0x6')];_0xfaa39a<_0x15cbd6;_0xfaa39a++){var _0x4ad229=events[_0xfaa39a];var _0x12e527=createListener('plugin:'+_0x4ad229,_0x3c9532);PluginEvents['on'](_0x4ad229,_0x12e527);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d4280f3..d344c89 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(_0x3574a2,_0x4d20c0){var _0x3e7246=function(_0x3e78c5){while(--_0x3e78c5){_0x3574a2['push'](_0x3574a2['shift']());}};_0x3e7246(++_0x4d20c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x4dbe67,_0x1ebc59){var _0x3d7eb9=function(_0x44eecb){while(--_0x44eecb){_0x4dbe67['push'](_0x4dbe67['shift']());}};_0x3d7eb9(++_0x1ebc59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 a594b7b..c16ebad 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 _0xc6d8=['Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','path','exec','sendStatus','status','stack','name','send','npm\x20install','info','error','index','list','then','reject','length','show','describe','create','body','join','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','params','catch'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0xc6d8[_0x2cfb48];return _0xc4594f;};'use strict';var _=require(_0x8c6d('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x8c6d('0x1'))('api');var path=require(_0x8c6d('0x2'));var exec=require('child_process')[_0x8c6d('0x3')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5b6b04,_0x352b8c){return function(_0xdff6f){if(!_0xdff6f){_0x5b6b04[_0x8c6d('0x4')](0x194);;}return _0xdff6f;};}function respondWithResult(_0x4f5e8f,_0x3c265c){_0x3c265c=_0x3c265c||0xc8;return function(_0x2dbb52){if(_0x2dbb52){return _0x4f5e8f[_0x8c6d('0x5')](_0x3c265c)['json'](_0x2dbb52);}return null;};}function handleError(_0x1496ba,_0x75c49f){_0x75c49f=_0x75c49f||0x1f4;return function(_0x16d4b2){logger['error'](_0x16d4b2[_0x8c6d('0x6')]);if(_0x16d4b2[_0x8c6d('0x7')]){delete _0x16d4b2[_0x8c6d('0x7')];}_0x1496ba[_0x8c6d('0x5')](_0x75c49f)[_0x8c6d('0x8')](_0x16d4b2);};}function execChildProcess(){return new BPromise(function(_0x43a7ab,_0x60cd5c){exec(_0x8c6d('0x9'),function(_0x50af75,_0x36d6fb,_0x559d17){logger['info'](_0x36d6fb);logger[_0x8c6d('0xa')](_0x559d17);if(_0x50af75){logger[_0x8c6d('0xb')](_0x50af75);return _0x60cd5c(_0x50af75);}return _0x43a7ab(_0x36d6fb);});});}exports[_0x8c6d('0xc')]=function(_0x8ec2d4,_0x30ecfa){return pm2[_0x8c6d('0xd')]()[_0x8c6d('0xe')](function(_0x103699){if(_0x103699){var _0x14c1ee=_[_0x8c6d('0xf')](_0x103699,function(_0x4fb956){return _0x4fb956[_0x8c6d('0x7')]==='express'||_0x4fb956[_0x8c6d('0x7')]==='motion2';});return{'rows':_0x14c1ee,'count':_0x14c1ee[_0x8c6d('0x10')]};}return null;})[_0x8c6d('0xe')](respondWithResult(_0x30ecfa,null))['catch'](handleError(_0x30ecfa,null));};exports[_0x8c6d('0x11')]=function(_0x2b8a26,_0x51a5fa){return pm2[_0x8c6d('0x12')](_0x2b8a26['params']['id'])['then'](respondWithResult(_0x51a5fa,null))[_0x8c6d('0xe')](handleEntityNotFound(_0x51a5fa,null))['catch'](handleError(_0x51a5fa,null));};exports[_0x8c6d('0x13')]=function(_0x174a4f,_0x1d0f0a){if(_0x174a4f[_0x8c6d('0x14')][_0x8c6d('0x7')]&&_0x174a4f['body']['script']){var _0x550079=path[_0x8c6d('0x15')](__dirname,'../../files/plugins',_0x174a4f[_0x8c6d('0x14')]['script']);var _0x4c378b=process[_0x8c6d('0x16')]();process[_0x8c6d('0x17')](path['dirname'](_0x550079));return execChildProcess()['then'](function(_0x51bb08){process['chdir'](_0x4c378b);return pm2[_0x8c6d('0x18')]({'name':_0x174a4f[_0x8c6d('0x14')][_0x8c6d('0x7')],'script':_0x550079});})['then'](function(_0x41c904){pm2['dump']();return _0x41c904[0x0];})[_0x8c6d('0xe')](respondWithResult(_0x1d0f0a,0xc9))['catch'](handleError(_0x1d0f0a,null));}else{return _0x1d0f0a[_0x8c6d('0x5')](0x1f4)[_0x8c6d('0x8')]({'message':_0x8c6d('0x19')});}};exports[_0x8c6d('0x1a')]=function(_0x1e6755,_0x3e3cd3){if(_0x1e6755[_0x8c6d('0x14')]['id']){delete _0x1e6755[_0x8c6d('0x14')]['id'];}var _0x3eab38={'online':'restart','stopped':'stop'};if(_0x3eab38[_0x8c6d('0x1b')](_0x1e6755[_0x8c6d('0x14')][_0x8c6d('0x5')])){return pm2[_0x3eab38[_0x1e6755[_0x8c6d('0x14')][_0x8c6d('0x5')]]](_0x1e6755[_0x8c6d('0x1c')]['id'])[_0x8c6d('0xe')](respondWithResult(_0x3e3cd3,0xc8))[_0x8c6d('0x1d')](handleError(_0x3e3cd3,null));}else{return _0x3e3cd3[_0x8c6d('0x5')](0x1f4)[_0x8c6d('0x8')]({'message':_0x8c6d('0x1e')});}};exports[_0x8c6d('0x1f')]=function(_0x4e5203,_0x3af625){if(_0x4e5203[_0x8c6d('0x14')]['id']){delete _0x4e5203[_0x8c6d('0x14')]['id'];}if(_0x4e5203[_0x8c6d('0x1c')]['id']){return pm2[_0x8c6d('0x20')](_0x4e5203[_0x8c6d('0x1c')]['id'])[_0x8c6d('0xe')](function(_0x1857f9){pm2[_0x8c6d('0x21')]();return _0x1857f9[0x0];})['then'](respondWithResult(_0x3af625,null))[_0x8c6d('0x1d')](handleError(_0x3af625,null));}else{return _0x3af625['status'](0x1f4)[_0x8c6d('0x8')]({'message':_0x8c6d('0x22')});}}; \ No newline at end of file +var _0xa9e0=['list','then','reject','express','motion2','catch','describe','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','bluebird','sendStatus','status','stack','name','send','info','error','index'];(function(_0x3c5f7f,_0x317d17){var _0x5e68d4=function(_0x104480){while(--_0x104480){_0x3c5f7f['push'](_0x3c5f7f['shift']());}};_0x5e68d4(++_0x317d17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var pm2=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var path=require('path');var exec=require(_0x0a9e('0x3'))['exec'];var BPromise=require(_0x0a9e('0x4'));function handleEntityNotFound(_0x432180,_0x2ab90b){return function(_0x991246){if(!_0x991246){_0x432180[_0x0a9e('0x5')](0x194);;}return _0x991246;};}function respondWithResult(_0x57b080,_0x219af0){_0x219af0=_0x219af0||0xc8;return function(_0x441e3a){if(_0x441e3a){return _0x57b080[_0x0a9e('0x6')](_0x219af0)['json'](_0x441e3a);}return null;};}function handleError(_0x503809,_0xe42b77){_0xe42b77=_0xe42b77||0x1f4;return function(_0x56465b){logger['error'](_0x56465b[_0x0a9e('0x7')]);if(_0x56465b[_0x0a9e('0x8')]){delete _0x56465b[_0x0a9e('0x8')];}_0x503809[_0x0a9e('0x6')](_0xe42b77)[_0x0a9e('0x9')](_0x56465b);};}function execChildProcess(){return new BPromise(function(_0xbd1168,_0x4a4c56){exec('npm\x20install',function(_0x527cdd,_0x4cfe67,_0x273d4d){logger[_0x0a9e('0xa')](_0x4cfe67);logger[_0x0a9e('0xa')](_0x273d4d);if(_0x527cdd){logger[_0x0a9e('0xb')](_0x527cdd);return _0x4a4c56(_0x527cdd);}return _0xbd1168(_0x4cfe67);});});}exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return pm2[_0x0a9e('0xd')]()[_0x0a9e('0xe')](function(_0x2b4227){if(_0x2b4227){var _0x281129=_[_0x0a9e('0xf')](_0x2b4227,function(_0x4d5611){return _0x4d5611['name']===_0x0a9e('0x10')||_0x4d5611['name']===_0x0a9e('0x11');});return{'rows':_0x281129,'count':_0x281129['length']};}return null;})[_0x0a9e('0xe')](respondWithResult(_0x5db4b0,null))[_0x0a9e('0x12')](handleError(_0x5db4b0,null));};exports['show']=function(_0x225616,_0x5a0a06){return pm2[_0x0a9e('0x13')](_0x225616[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x5a0a06,null))[_0x0a9e('0xe')](handleEntityNotFound(_0x5a0a06,null))[_0x0a9e('0x12')](handleError(_0x5a0a06,null));};exports[_0x0a9e('0x15')]=function(_0x530eb7,_0x20559e){if(_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')]&&_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x17')]){var _0x4bb1e3=path[_0x0a9e('0x18')](__dirname,_0x0a9e('0x19'),_0x530eb7['body'][_0x0a9e('0x17')]);var _0x5a09ef=process['cwd']();process[_0x0a9e('0x1a')](path[_0x0a9e('0x1b')](_0x4bb1e3));return execChildProcess()[_0x0a9e('0xe')](function(_0x30bae6){process['chdir'](_0x5a09ef);return pm2[_0x0a9e('0x1c')]({'name':_0x530eb7[_0x0a9e('0x16')][_0x0a9e('0x8')],'script':_0x4bb1e3});})[_0x0a9e('0xe')](function(_0x370d86){pm2[_0x0a9e('0x1d')]();return _0x370d86[0x0];})[_0x0a9e('0xe')](respondWithResult(_0x20559e,0xc9))['catch'](handleError(_0x20559e,null));}else{return _0x20559e['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x1e')});}};exports[_0x0a9e('0x1f')]=function(_0x33161b,_0x526cf3){if(_0x33161b[_0x0a9e('0x16')]['id']){delete _0x33161b['body']['id'];}var _0x45a1e7={'online':'restart','stopped':_0x0a9e('0x20')};if(_0x45a1e7[_0x0a9e('0x21')](_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')])){return pm2[_0x45a1e7[_0x33161b[_0x0a9e('0x16')][_0x0a9e('0x6')]]](_0x33161b[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](respondWithResult(_0x526cf3,0xc8))['catch'](handleError(_0x526cf3,null));}else{return _0x526cf3[_0x0a9e('0x6')](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x22')});}};exports[_0x0a9e('0x23')]=function(_0x5c877d,_0x15b200){if(_0x5c877d[_0x0a9e('0x16')]['id']){delete _0x5c877d[_0x0a9e('0x16')]['id'];}if(_0x5c877d[_0x0a9e('0x14')]['id']){return pm2[_0x0a9e('0x24')](_0x5c877d[_0x0a9e('0x14')]['id'])[_0x0a9e('0xe')](function(_0x2e8759){pm2[_0x0a9e('0x1d')]();return _0x2e8759[0x0];})['then'](respondWithResult(_0x15b200,null))[_0x0a9e('0x12')](handleError(_0x15b200,null));}else{return _0x15b200['status'](0x1f4)[_0x0a9e('0x9')]({'message':_0x0a9e('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0eabcec..a5a663a 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 _0x675a=['getAgents','get','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','/agents','isAuthenticated'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x675a,0x118));var _0xa675=function(_0x2c29d8,_0x45a0c2){_0x2c29d8=_0x2c29d8-0x0;var _0x4b2743=_0x675a[_0x2c29d8];return _0x4b2743;};'use strict';var express=require(_0xa675('0x0'));var router=express[_0xa675('0x1')]();var auth=require(_0xa675('0x2'));var controller=require(_0xa675('0x3'));router['get'](_0xa675('0x4'),auth[_0xa675('0x5')](),controller[_0xa675('0x6')]);router[_0xa675('0x7')](_0xa675('0x8'),auth[_0xa675('0x5')](),controller[_0xa675('0x9')]);module[_0xa675('0xa')]=router; \ No newline at end of file +var _0x0cee=['Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','getQueues'];(function(_0x3cb102,_0x1d1cdd){var _0x4966e1=function(_0x256513){while(--_0x256513){_0x3cb102['push'](_0x3cb102['shift']());}};_0x4966e1(++_0x1d1cdd);}(_0x0cee,0x138));var _0xe0ce=function(_0x413962,_0x2252fb){_0x413962=_0x413962-0x0;var _0x4cab5a=_0x0cee[_0x413962];return _0x4cab5a;};'use strict';var express=require('express');var router=express[_0xe0ce('0x0')]();var auth=require(_0xe0ce('0x1'));var controller=require('./realtime.controller');router[_0xe0ce('0x2')](_0xe0ce('0x3'),auth[_0xe0ce('0x4')](),controller[_0xe0ce('0x5')]);router[_0xe0ce('0x2')](_0xe0ce('0x6'),auth[_0xe0ce('0x4')](),controller[_0xe0ce('0x7')]);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 fafda56..a48f957 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 _0xd924=['dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','merge','pick','queue','some','connectedlinenum','internal','toString','then','length','UserId','accountcode','online','User','Pause','findAll','startCase','Invalid\x20channel','toLowerCase','getAgents','globalQueueFilter','globalStatusFilter','pause','*pause','resolve','channel','query','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','key','role','getOptions','sequelize','FIELD(id,','order','forEach','where','user','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','getQueues','Queue','userProfileId','QueueCampaigns','filter','UserProfile','getRealtimeAgents','all','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','api','../../mysqldb','client','http','offset','limit','undefined','count','set','stack','name','status','send','voice','request','Queues','error','format','result','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive'];(function(_0x4a0099,_0x5321ca){var _0x59b700=function(_0x403227){while(--_0x403227){_0x4a0099['push'](_0x4a0099['shift']());}};_0x59b700(++_0x5321ca);}(_0xd924,0x14e));var _0x4d92=function(_0x55b745,_0x36e0fa){_0x55b745=_0x55b745-0x0;var _0x1772a7=_0xd924[_0x55b745];return _0x1772a7;};'use strict';var util=require(_0x4d92('0x0'));var _=require(_0x4d92('0x1'));var jayson=require(_0x4d92('0x2'));var rta=require(_0x4d92('0x3'));var qs=require(_0x4d92('0x4'));var utils=require(_0x4d92('0x5'));var logger=require('../../config/logger')(_0x4d92('0x6'));var db=require(_0x4d92('0x7'))['db'];var amiClient=jayson[_0x4d92('0x8')]['http']({'port':0x232a});var routingClient=jayson[_0x4d92('0x8')][_0x4d92('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x452b28,_0x3beb5d){return function(_0x33b89c){if(_0x33b89c){var _0x2f0903=typeof _0x3beb5d[_0x4d92('0xa')]==='undefined'&&typeof _0x3beb5d[_0x4d92('0xb')]===_0x4d92('0xc');var _0x363ec9=_0x33b89c[_0x4d92('0xd')];var _0x4391de=_0x2f0903?0x0:_0x3beb5d[_0x4d92('0xa')];var _0x476c7d=_0x2f0903?_0x33b89c['count']:_0x3beb5d[_0x4d92('0xa')]+_0x3beb5d[_0x4d92('0xb')];var _0x41c41d;if(_0x476c7d>=_0x363ec9){_0x476c7d=_0x363ec9;_0x41c41d=0xc8;}else{_0x41c41d=0xce;}_0x452b28['status'](_0x41c41d);return _0x452b28[_0x4d92('0xe')]('Content-Range',_0x4391de+'-'+_0x476c7d+'/'+_0x363ec9)['json'](_0x33b89c);}return null;};}function handleError(_0x2aa644,_0x532a51){_0x532a51=_0x532a51||0x1f4;return function(_0x242c71){logger['error'](_0x242c71[_0x4d92('0xf')]);if(_0x242c71[_0x4d92('0x10')]){delete _0x242c71[_0x4d92('0x10')];}_0x2aa644[_0x4d92('0x11')](_0x532a51)[_0x4d92('0x12')](_0x242c71);};}function getRealtimeQueues(_0x3fa894,_0x5f4c6c){return new Promise(function(_0x3064cb,_0x297a9){var _0x365b00=_0x5f4c6c===_0x4d92('0x13')?amiClient:routingClient;return _0x365b00[_0x4d92('0x14')](_['startCase'](_0x5f4c6c)+_0x4d92('0x15'),_0x3fa894)['then'](function(_0x5591b0){if(_0x5591b0[_0x4d92('0x16')])throw new Error(util[_0x4d92('0x17')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x5f4c6c));return _0x3064cb(_0x5591b0[_0x4d92('0x18')]);})[_0x4d92('0x19')](function(_0x5647f3){_0x297a9(_0x5647f3);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xea5373,_0x329954){return amiClient[_0x4d92('0x14')]('VoiceQueuesChannels',{})['then'](function(_0x5e133d){if(_0x5e133d[_0x4d92('0x16')])throw new Error(_0x4d92('0x1a'));return _0xea5373(_0x5e133d[_0x4d92('0x18')]);})['catch'](function(_0x15357b){_0x329954(_0x15357b);});});}function initializeQueues(_0xd7b355,_0x4589a9,_0x52ace3,_0x3b7fff){var _0x541504=[_0x4d92('0x1b'),_0x4d92('0x1c'),_0x4d92('0x1d'),_0x4d92('0x1e'),_0x4d92('0x1f')];if(_0x52ace3===_0x4d92('0x13')&&_0x3b7fff===_0x4d92('0x20')){_0x541504[_0x4d92('0x21')](_0x4d92('0x22'),_0x4d92('0x23'),_0x4d92('0x24'),_0x4d92('0x25'),_0x4d92('0x26'),_0x4d92('0x27'),_0x4d92('0x28'),_0x4d92('0x29'),'erlangCalls',_0x4d92('0x2a'),_0x4d92('0x2b'),_0x4d92('0x2c'),_0x4d92('0x2d'),_0x4d92('0x2e'),'dialPredictiveIntervalMinThreshold',_0x4d92('0x2f'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x4d92('0x30'),_0x4d92('0x31'),_0x4d92('0x32'),_0x4d92('0x33'));}return _0xd7b355[_0x4d92('0x34')](function(_0x5a34f9){var _0x28ff58=_0x5a34f9[_0x4d92('0x35')]({'plain':!![]});_0x28ff58[_0x4d92('0x36')]=[];_0x28ff58[_0x4d92('0x1f')]=0x0;_0x28ff58[_0x4d92('0x37')]=0x0;_0x28ff58['loggedIn']=0x0;_0x28ff58[_0x4d92('0x1c')]=0x0;_0x28ff58[_0x4d92('0x1d')]=0x0;if(_0x52ace3==='voice'){_0x28ff58[_0x4d92('0x1e')]=0x0;_0x28ff58[_0x4d92('0x38')]=0x0;if(_0x3b7fff===_0x4d92('0x20')){_0x28ff58[_0x4d92('0x22')]=0x0;_0x28ff58[_0x4d92('0x23')]=0x0;}}var _0x5da826=_[_0x4d92('0x39')](_0x4589a9,['id',_0x28ff58['id']]);if(_0x5da826)_[_0x4d92('0x3a')](_0x28ff58,_[_0x4d92('0x3b')](_0x5da826,_0x541504));return _0x28ff58;});}function updateAgentVoiceStatus(_0x23e0fa,_0x106c19,_0x151516){var _0x16437c=_['filter'](_0x151516,[_0x4d92('0x3c'),_0x106c19[_0x4d92('0x10')]]);if(_0x16437c['length']===0x0)return _0x23e0fa['busy']=!![];if(_[_0x4d92('0x3d')](_0x16437c,[_0x4d92('0x3e'),_0x23e0fa[_0x4d92('0x3f')][_0x4d92('0x40')]()]))return _0x23e0fa[_0x4d92('0x1e')]=!![];if(!_0x23e0fa['talking'])return _0x23e0fa[_0x4d92('0x38')]=!![];}function getVoiceQueueAgents(_0x3e5633,_0x490603,_0x4f9980,_0x2c4f36){var _0x2ed641=_[_0x4d92('0x39')](_0x490603,['id',_0x3e5633['id']]);if(!_0x2ed641)return _0x3e5633;return _0x2ed641['getMembers']({'raw':!![]})[_0x4d92('0x41')](function(_0x2bdc91){for(var _0x2c4ba1=0x0;_0x2c4ba1<_0x2bdc91[_0x4d92('0x42')];_0x2c4ba1++){var _0x417998=_[_0x4d92('0x39')](_0x4f9980,['id',_0x2bdc91[_0x2c4ba1]['UserId']]);if(!_0x417998){_0x417998={'id':_0x2bdc91[_0x2c4ba1][_0x4d92('0x43')],'name':_0x2bdc91[_0x2c4ba1][_0x4d92('0x43')],'accountcode':'','online':![]};}var _0x453472={'id':_0x417998['id'],'name':_0x417998['name'],'internal':_0x417998[_0x4d92('0x44')],'online':Boolean(_0x417998[_0x4d92('0x45')]),'paused':Boolean(_0x2bdc91[_0x2c4ba1][_0x4d92('0x1f')])};if(_0x417998['voiceStatus']===_0x4d92('0x1e'))updateAgentVoiceStatus(_0x453472,_0x3e5633,_0x2c4f36);if(_0x453472['online'])_0x3e5633['loggedInDb']++;if(_0x453472[_0x4d92('0x38')])_0x3e5633[_0x4d92('0x38')]++;if(_0x453472[_0x4d92('0x1f')]&&!_0x453472[_0x4d92('0x38')]&&!_0x453472[_0x4d92('0x1e')])_0x3e5633[_0x4d92('0x1f')]++;_0x3e5633[_0x4d92('0x36')][_0x4d92('0x21')](_0x453472);}return _0x3e5633;});}function getQueueAgents(_0x101ea6,_0x1fd1e6,_0x5b5d63){var _0x186de7=_0x4d92('0x46')+_['startCase'](_0x5b5d63)+'Queue';var _0xf4feb9=_0x5b5d63+_0x4d92('0x47');return db[_0x186de7][_0x4d92('0x48')]({'where':{[_[_0x4d92('0x49')](_0x5b5d63)+'QueueId']:_0x101ea6['id']},'raw':!![]})[_0x4d92('0x41')](function(_0x41311c){for(var _0x20dc55=0x0;_0x20dc55<_0x41311c[_0x4d92('0x42')];_0x20dc55++){var _0x222d19=_[_0x4d92('0x39')](_0x1fd1e6,['id',_0x41311c[_0x20dc55]['UserId']]);if(!_0x222d19){_0x222d19={'id':_0x41311c[_0x20dc55][_0x4d92('0x43')],'name':_0x41311c[_0x20dc55][_0x4d92('0x43')],'online':![],['pauseField']:![]};}var _0x464360={'id':_0x222d19['id'],'name':_0x222d19[_0x4d92('0x10')],'online':Boolean(_0x222d19['online']),'paused':Boolean(_0x222d19[_0xf4feb9])};if(_0x464360[_0x4d92('0x45')])_0x101ea6['loggedInDb']++;_0x101ea6[_0x4d92('0x36')][_0x4d92('0x21')](_0x464360);}return _0x101ea6;});}function validateChannel(_0x1f046b){var _0x152019=utils['getChannels']();if(!_['includes'](_0x152019,_0x1f046b['toLowerCase']()))throw new Error(_0x4d92('0x4a'));return _0x1f046b[_0x4d92('0x4b')]();}exports[_0x4d92('0x4c')]=function(_0x521a18,_0x3e6262){var _0x29f1cc={'count':0x0,'rows':[]};var _0x58bed4={};var _0xd6bfb8;var _0x3072d9;var _0x2976dd;var _0x88a40c;var _0x124287=utils['getChannels']();var _0x3f0028=_0x521a18['query'][_0x4d92('0x4d')];var _0x541f59=_0x521a18['query'][_0x4d92('0x4e')];var _0x27e816=_0x521a18['query']['pauseTypeFilter'];var _0x55476c=_0x541f59===_0x4d92('0x4f')||_0x541f59===_0x4d92('0x50')?!![]:![];var _0x196dfa=[];var _0x5ecf2a;Promise[_0x4d92('0x51')]()[_0x4d92('0x41')](function(){if(_0x521a18['query'][_0x4d92('0x52')]){_0xd6bfb8=validateChannel(_0x521a18['query'][_0x4d92('0x52')]);}if(!_0x521a18[_0x4d92('0x53')][_0x4d92('0x54')]||!_0x521a18['query']['sort'][_0x4d92('0x55')](_0x4d92('0x56'))){_0x521a18[_0x4d92('0x53')][_0x4d92('0x54')]=rta[_0x4d92('0x57')](_0x521a18[_0x4d92('0x53')][_0x4d92('0x54')]);return;}var _0x2ebcbc=rta[_0x4d92('0x58')](_0x521a18[_0x4d92('0x53')]['sort']);_0x521a18[_0x4d92('0x53')][_0x4d92('0x54')]=_0x2ebcbc[_0x4d92('0x59')][_0x4d92('0x5a')](',');_0x3072d9=_0x2ebcbc['order'];})[_0x4d92('0x41')](function(){if(!_0x3f0028){return[];}return rta[_0x4d92('0x5b')](_0x3f0028,_0xd6bfb8);})[_0x4d92('0x41')](function(_0x400388){_0x196dfa=_0x400388;return rta['getRealtimeAgents']();})[_0x4d92('0x41')](function(_0x5b3f47){_0x88a40c=_0x5b3f47[_0x4d92('0x5c')];if((!_0x541f59||_0x55476c)&&!_0x3072d9){return _0x196dfa;}if(_0x3072d9&&!_0x541f59){return rta[_0x4d92('0x5d')](_0x88a40c,_0x196dfa,_0x3072d9);}else{return rta[_0x4d92('0x5e')](_0x88a40c,_0x196dfa,_0x541f59);}})[_0x4d92('0x41')](function(_0x3af994){_0x196dfa=_0x3af994;var _0x3bef5c=![];if(_0x196dfa[_0x4d92('0x42')]===0x0){if(_0x3f0028||_0x541f59){_0x3bef5c=!![];}if(_0x55476c){_0x3bef5c=![];}}if(_0x3bef5c){return _0x29f1cc;}var _0x24f580=_[_0x4d92('0x34')](db['User'][_0x4d92('0x5f')],function(_0x2712aa){return{'name':_0x2712aa[_0x4d92('0x60')],'type':_0x2712aa[_0x4d92('0x61')][_0x4d92('0x62')]};});_0x521a18[_0x4d92('0x53')][_0x4d92('0x63')]='agent';_0x521a18[_0x4d92('0x53')]['online']=!![];_0x58bed4=qs[_0x4d92('0x64')](_0x24f580,_0x521a18);_0x58bed4['raw']=!![];var _0x5b20e2=[];if(_0x196dfa[_0x4d92('0x42')]>0x0){_0x5b20e2[_0x4d92('0x21')]({'id':{'$in':_0x196dfa}});if(_0x3072d9&&!_0x541f59){_0x5ecf2a=[db[_0x4d92('0x65')]['literal'](_0x4d92('0x66')+_0x196dfa+')')];_0x58bed4[_0x4d92('0x67')]=_0x5ecf2a;}}if(_0x55476c){_0x124287[_0x4d92('0x68')](function(_0x14c144){var _0x3eb900=!![];if(_0x541f59===_0x4d92('0x50')&&_0xd6bfb8!==_0x14c144){_0x3eb900=![];}_0x5b20e2['push']({[_0x14c144+_0x4d92('0x47')]:_0x3eb900});});if(_0x27e816){_0x5b20e2['push']({'pauseType':_0x27e816});}}else if(_0x541f59){_0x124287['forEach'](function(_0x26f727){_0x5b20e2[_0x4d92('0x21')]({[_0x26f727+'Pause']:![]});});}_0x58bed4[_0x4d92('0x69')]=_[_0x4d92('0x3a')](_0x58bed4['where'],{'$and':_0x5b20e2});if(_0x521a18[_0x4d92('0x6a')]['role']===_0x4d92('0x6a')){var _0x13529c={'params':{'id':_0x521a18[_0x4d92('0x6a')]['userProfileId']},'query':{'section':_0x4d92('0x6b'),'role':'agent','online':!![],'raw':!![],'ids':_0x196dfa,'customSorting':_0x5ecf2a}};if(_0x55476c){_0x13529c[_0x4d92('0x53')][_0x4d92('0x6c')]=_0x5b20e2;}_0x13529c['query']=Object[_0x4d92('0x6d')](_0x13529c[_0x4d92('0x53')],_0x521a18[_0x4d92('0x53')]);delete _0x13529c[_0x4d92('0x53')]['id'];return db['UserProfile'][_0x4d92('0x6e')](_0x13529c);}return db['User'][_0x4d92('0x6f')](_0x58bed4);})['then'](function(_0x2ccb05){_0x29f1cc[_0x4d92('0xd')]=_0x2ccb05['count'];_0x2976dd=_0x2ccb05[_0x4d92('0x5c')];return _0x2976dd['map'](function(_0x2a2ff7){var _0x55beb5=_[_0x4d92('0x39')](_0x88a40c,['id',_0x2a2ff7['id']]);if(_0x55beb5){var _0x1cf384=rta[_0x4d92('0x70')](_0x55beb5);_['merge'](_0x2a2ff7,_0x1cf384);}_0x2a2ff7[_0x4d92('0x56')]=rta[_0x4d92('0x71')](_0x2a2ff7);if(_0x2a2ff7[_0x4d92('0x56')][_0x4d92('0x55')](_0x4d92('0x4f'))){_0x124287[_0x4d92('0x68')](function(_0x4549ec){if(_0x2a2ff7[_0x4549ec+_0x4d92('0x47')]){_0x2a2ff7[_0x4549ec+_0x4d92('0x72')]=_0x4d92('0x4f');}});}return _0x2a2ff7;});})['then'](function(_0x98083c){if(!_0x3072d9||_0x5ecf2a){return _0x98083c;}return rta[_0x4d92('0x73')](_0x98083c,_0x3072d9);})[_0x4d92('0x41')](function(_0x48364f){_0x29f1cc['rows']=_0x48364f;return _0x29f1cc;})[_0x4d92('0x41')](respondWithFilteredResult(_0x3e6262,_0x58bed4))[_0x4d92('0x19')](handleError(_0x3e6262,null));};exports[_0x4d92('0x74')]=function(_0x3f5ca8,_0x56b30a){var _0x1658b0={'count':0x0,'rows':[]},_0x2d3af0={},_0xcef98d,_0x50b885,_0x2c0cea,_0x29433d,_0x302f03;Promise['resolve']()[_0x4d92('0x41')](function(){if(_0x3f5ca8['query']['channel'])_0xcef98d=validateChannel(_0x3f5ca8['query'][_0x4d92('0x52')]);var _0x399793=_[_0x4d92('0x49')](_0xcef98d)+_0x4d92('0x75');var _0x5280a7=_['map'](db[_0x399793][_0x4d92('0x5f')],function(_0x208a37){return{'name':_0x208a37[_0x4d92('0x60')],'type':_0x208a37[_0x4d92('0x61')][_0x4d92('0x62')]};});_0x2d3af0=qs[_0x4d92('0x64')](_0x5280a7,_0x3f5ca8);if(_0x3f5ca8['user']['role']===_0x4d92('0x6a')){var _0x13fefe={'params':{'id':_0x3f5ca8[_0x4d92('0x6a')][_0x4d92('0x76')]},'query':{'section':_0xcef98d===_0x4d92('0x13')&&_0x3f5ca8[_0x4d92('0x53')][_0x4d92('0x61')]===_0x4d92('0x20')?_0x4d92('0x77'):_[_0x4d92('0x49')](_0xcef98d)+'Queues','type':_0x3f5ca8[_0x4d92('0x53')]['type'],'nolimit':!![],'sort':'name','filter':_0x3f5ca8[_0x4d92('0x53')][_0x4d92('0x78')]}};return db[_0x4d92('0x79')][_0x4d92('0x6e')](_0x13fefe);}return db[_0x399793][_0x4d92('0x6f')](_0x2d3af0);})[_0x4d92('0x41')](function(_0x50193e){_0x1658b0[_0x4d92('0xd')]=_0x50193e[_0x4d92('0xd')];_0x50b885=_0x50193e[_0x4d92('0x5c')];return getRealtimeQueues(_0x3f5ca8,_0xcef98d);})[_0x4d92('0x41')](function(_0x71bd4d){_0x29433d=_0x71bd4d[_0x4d92('0x5c')];return rta[_0x4d92('0x7a')]();})['then'](function(_0x309dbe){_0x2c0cea=_0x309dbe[_0x4d92('0x5c')];if(_0xcef98d!=_0x4d92('0x13'))return;return getRealtimeVoiceQueueChannels();})[_0x4d92('0x41')](function(_0x30b050){_0x302f03=_0x30b050?_0x30b050['rows']:[];return initializeQueues(_0x50b885,_0x29433d,_0xcef98d,_0x3f5ca8['query']['type']);})[_0x4d92('0x41')](function(_0x980207){var _0x5a59d6=_0x980207[_0x4d92('0x34')](function(_0x3cd584){if(_0xcef98d==='voice')return getVoiceQueueAgents(_0x3cd584,_0x50b885,_0x2c0cea,_0x302f03);else return getQueueAgents(_0x3cd584,_0x2c0cea,_0xcef98d);});return Promise[_0x4d92('0x7b')](_0x5a59d6);})['then'](function(_0x2a7892){_0x1658b0[_0x4d92('0x5c')]=_0x2a7892;return _0x1658b0;})[_0x4d92('0x41')](respondWithFilteredResult(_0x56b30a,_0x2d3af0))['catch'](handleError(_0x56b30a,null));}; \ No newline at end of file +var _0xa6c9=['User','startCase','Pause','findAll','length','getChannels','includes','Invalid\x20channel','toLowerCase','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','channel','sort','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','agent','raw','sequelize','literal','FIELD(id,','forEach','role','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','rows','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','getQueues','resolve','Queue','key','getOptions','QueueCampaigns','getResources','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','stack','name','voice','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','find','merge','pick','filter','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','busy'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xa6c9,0xb7));var _0x9a6c=function(_0x30b763,_0x12d0ff){_0x30b763=_0x30b763-0x0;var _0x127d70=_0xa6c9[_0x30b763];return _0x127d70;};'use strict';var util=require(_0x9a6c('0x0'));var _=require(_0x9a6c('0x1'));var jayson=require(_0x9a6c('0x2'));var rta=require(_0x9a6c('0x3'));var qs=require(_0x9a6c('0x4'));var utils=require(_0x9a6c('0x5'));var logger=require(_0x9a6c('0x6'))(_0x9a6c('0x7'));var db=require(_0x9a6c('0x8'))['db'];var amiClient=jayson[_0x9a6c('0x9')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x9a6c('0xa')]({'port':0x232c});function respondWithFilteredResult(_0x265347,_0xeb6762){return function(_0x5bed1f){if(_0x5bed1f){var _0x296672=typeof _0xeb6762[_0x9a6c('0xb')]===_0x9a6c('0xc')&&typeof _0xeb6762[_0x9a6c('0xd')]===_0x9a6c('0xc');var _0xa0d443=_0x5bed1f[_0x9a6c('0xe')];var _0x527667=_0x296672?0x0:_0xeb6762[_0x9a6c('0xb')];var _0x3126a9=_0x296672?_0x5bed1f[_0x9a6c('0xe')]:_0xeb6762[_0x9a6c('0xb')]+_0xeb6762['limit'];var _0x5df30a;if(_0x3126a9>=_0xa0d443){_0x3126a9=_0xa0d443;_0x5df30a=0xc8;}else{_0x5df30a=0xce;}_0x265347[_0x9a6c('0xf')](_0x5df30a);return _0x265347[_0x9a6c('0x10')]('Content-Range',_0x527667+'-'+_0x3126a9+'/'+_0xa0d443)['json'](_0x5bed1f);}return null;};}function handleError(_0x4cf191,_0xc180a1){_0xc180a1=_0xc180a1||0x1f4;return function(_0x21351c){logger['error'](_0x21351c[_0x9a6c('0x11')]);if(_0x21351c[_0x9a6c('0x12')]){delete _0x21351c[_0x9a6c('0x12')];}_0x4cf191[_0x9a6c('0xf')](_0xc180a1)['send'](_0x21351c);};}function getRealtimeQueues(_0x2da4be,_0xcaac71){return new Promise(function(_0x44b090,_0x5b41ac){var _0x400b3c=_0xcaac71===_0x9a6c('0x13')?amiClient:routingClient;return _0x400b3c['request'](_['startCase'](_0xcaac71)+_0x9a6c('0x14'),_0x2da4be)[_0x9a6c('0x15')](function(_0x219574){if(_0x219574[_0x9a6c('0x16')])throw new Error(util[_0x9a6c('0x17')](_0x9a6c('0x18'),_0xcaac71));return _0x44b090(_0x219574[_0x9a6c('0x19')]);})[_0x9a6c('0x1a')](function(_0xe88745){_0x5b41ac(_0xe88745);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x283ca6,_0x31d711){return amiClient['request'](_0x9a6c('0x1b'),{})[_0x9a6c('0x15')](function(_0x21fc76){if(_0x21fc76[_0x9a6c('0x16')])throw new Error(_0x9a6c('0x1c'));return _0x283ca6(_0x21fc76[_0x9a6c('0x19')]);})[_0x9a6c('0x1a')](function(_0x522d8e){_0x31d711(_0x522d8e);});});}function initializeQueues(_0x4bf5dc,_0x4b0d9a,_0x375f55,_0x1cbc4e){var _0x5194d8=[_0x9a6c('0x1d'),_0x9a6c('0x1e'),_0x9a6c('0x1f'),_0x9a6c('0x20'),_0x9a6c('0x21')];if(_0x375f55==='voice'&&_0x1cbc4e===_0x9a6c('0x22')){_0x5194d8[_0x9a6c('0x23')](_0x9a6c('0x24'),_0x9a6c('0x25'),_0x9a6c('0x26'),_0x9a6c('0x27'),_0x9a6c('0x28'),_0x9a6c('0x29'),'startPredictive',_0x9a6c('0x2a'),_0x9a6c('0x2b'),_0x9a6c('0x2c'),_0x9a6c('0x2d'),_0x9a6c('0x2e'),_0x9a6c('0x2f'),_0x9a6c('0x30'),'dialPredictiveIntervalMinThreshold',_0x9a6c('0x31'),'predictiveIntervalTotalCalls',_0x9a6c('0x32'),'predictiveIntervalDroppedCallsTimeout',_0x9a6c('0x33'),'predictiveIntervalAvgHoldtime',_0x9a6c('0x34'));}return _0x4bf5dc[_0x9a6c('0x35')](function(_0x5a8971){var _0x5abdd3=_0x5a8971[_0x9a6c('0x36')]({'plain':!![]});_0x5abdd3[_0x9a6c('0x37')]=[];_0x5abdd3[_0x9a6c('0x21')]=0x0;_0x5abdd3['loggedInDb']=0x0;_0x5abdd3[_0x9a6c('0x1d')]=0x0;_0x5abdd3[_0x9a6c('0x1e')]=0x0;_0x5abdd3[_0x9a6c('0x1f')]=0x0;if(_0x375f55===_0x9a6c('0x13')){_0x5abdd3[_0x9a6c('0x20')]=0x0;_0x5abdd3['busy']=0x0;if(_0x1cbc4e===_0x9a6c('0x22')){_0x5abdd3[_0x9a6c('0x24')]=0x0;_0x5abdd3['originated']=0x0;}}var _0x2eed9b=_[_0x9a6c('0x38')](_0x4b0d9a,['id',_0x5abdd3['id']]);if(_0x2eed9b)_[_0x9a6c('0x39')](_0x5abdd3,_[_0x9a6c('0x3a')](_0x2eed9b,_0x5194d8));return _0x5abdd3;});}function updateAgentVoiceStatus(_0xc50f4f,_0x200a5b,_0x236702){var _0xc033bc=_[_0x9a6c('0x3b')](_0x236702,['queue',_0x200a5b[_0x9a6c('0x12')]]);if(_0xc033bc['length']===0x0)return _0xc50f4f['busy']=!![];if(_[_0x9a6c('0x3c')](_0xc033bc,[_0x9a6c('0x3d'),_0xc50f4f[_0x9a6c('0x3e')][_0x9a6c('0x3f')]()]))return _0xc50f4f['talking']=!![];if(!_0xc50f4f[_0x9a6c('0x20')])return _0xc50f4f['busy']=!![];}function getVoiceQueueAgents(_0x436101,_0x10b928,_0x4b6f9c,_0x16b869){var _0x1b09ff=_['find'](_0x10b928,['id',_0x436101['id']]);if(!_0x1b09ff)return _0x436101;return _0x1b09ff[_0x9a6c('0x40')]({'raw':!![]})[_0x9a6c('0x15')](function(_0x35d2ee){for(var _0x1c3c87=0x0;_0x1c3c87<_0x35d2ee['length'];_0x1c3c87++){var _0x3e7ffd=_['find'](_0x4b6f9c,['id',_0x35d2ee[_0x1c3c87]['UserId']]);if(!_0x3e7ffd){_0x3e7ffd={'id':_0x35d2ee[_0x1c3c87]['UserId'],'name':_0x35d2ee[_0x1c3c87][_0x9a6c('0x41')],'accountcode':'','online':![]};}var _0x342320={'id':_0x3e7ffd['id'],'name':_0x3e7ffd['name'],'internal':_0x3e7ffd[_0x9a6c('0x42')],'online':Boolean(_0x3e7ffd[_0x9a6c('0x43')]),'paused':Boolean(_0x35d2ee[_0x1c3c87]['paused'])};if(_0x3e7ffd[_0x9a6c('0x44')]===_0x9a6c('0x20'))updateAgentVoiceStatus(_0x342320,_0x436101,_0x16b869);if(_0x342320[_0x9a6c('0x43')])_0x436101[_0x9a6c('0x45')]++;if(_0x342320[_0x9a6c('0x46')])_0x436101['busy']++;if(_0x342320[_0x9a6c('0x21')]&&!_0x342320['busy']&&!_0x342320[_0x9a6c('0x20')])_0x436101[_0x9a6c('0x21')]++;_0x436101[_0x9a6c('0x37')][_0x9a6c('0x23')](_0x342320);}return _0x436101;});}function getQueueAgents(_0xb0c5b3,_0x49bbb8,_0x25c4d2){var _0x19cb65=_0x9a6c('0x47')+_[_0x9a6c('0x48')](_0x25c4d2)+'Queue';var _0x5bd702=_0x25c4d2+_0x9a6c('0x49');return db[_0x19cb65][_0x9a6c('0x4a')]({'where':{[_[_0x9a6c('0x48')](_0x25c4d2)+'QueueId']:_0xb0c5b3['id']},'raw':!![]})['then'](function(_0x510fd0){for(var _0x97477c=0x0;_0x97477c<_0x510fd0[_0x9a6c('0x4b')];_0x97477c++){var _0x28e1a4=_[_0x9a6c('0x38')](_0x49bbb8,['id',_0x510fd0[_0x97477c][_0x9a6c('0x41')]]);if(!_0x28e1a4){_0x28e1a4={'id':_0x510fd0[_0x97477c][_0x9a6c('0x41')],'name':_0x510fd0[_0x97477c][_0x9a6c('0x41')],'online':![],['pauseField']:![]};}var _0x42bad3={'id':_0x28e1a4['id'],'name':_0x28e1a4[_0x9a6c('0x12')],'online':Boolean(_0x28e1a4[_0x9a6c('0x43')]),'paused':Boolean(_0x28e1a4[_0x5bd702])};if(_0x42bad3[_0x9a6c('0x43')])_0xb0c5b3[_0x9a6c('0x45')]++;_0xb0c5b3['agents']['push'](_0x42bad3);}return _0xb0c5b3;});}function validateChannel(_0x5e23f5){var _0x32dace=utils[_0x9a6c('0x4c')]();if(!_[_0x9a6c('0x4d')](_0x32dace,_0x5e23f5['toLowerCase']()))throw new Error(_0x9a6c('0x4e'));return _0x5e23f5[_0x9a6c('0x4f')]();}exports[_0x9a6c('0x50')]=function(_0x6e79e3,_0x2f42e4){var _0x55bd86={'count':0x0,'rows':[]};var _0x3a3850={};var _0x9ad588;var _0x1e4255;var _0x2050c7;var _0x355ffd;var _0x31b286=utils[_0x9a6c('0x4c')]();var _0x4b5ece=_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x52')];var _0x38530c=_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x53')];var _0x2293da=_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x54')];var _0x50e998=_0x38530c===_0x9a6c('0x55')||_0x38530c===_0x9a6c('0x56')?!![]:![];var _0x53a887=[];var _0x312ef6;Promise['resolve']()['then'](function(){if(_0x6e79e3[_0x9a6c('0x51')]['channel']){_0x9ad588=validateChannel(_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x57')]);}if(!_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x58')]||!_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x58')][_0x9a6c('0x4d')](_0x9a6c('0x59'))){_0x6e79e3['query'][_0x9a6c('0x58')]=rta['validateSortParameter'](_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x58')]);return;}var _0x3add1f=rta[_0x9a6c('0x5a')](_0x6e79e3[_0x9a6c('0x51')]['sort']);_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x58')]=_0x3add1f[_0x9a6c('0x5b')][_0x9a6c('0x5c')](',');_0x1e4255=_0x3add1f[_0x9a6c('0x5d')];})[_0x9a6c('0x15')](function(){if(!_0x4b5ece){return[];}return rta[_0x9a6c('0x5e')](_0x4b5ece,_0x9ad588);})[_0x9a6c('0x15')](function(_0x257287){_0x53a887=_0x257287;return rta[_0x9a6c('0x5f')]();})[_0x9a6c('0x15')](function(_0x416b7f){_0x355ffd=_0x416b7f['rows'];if((!_0x38530c||_0x50e998)&&!_0x1e4255){return _0x53a887;}if(_0x1e4255&&!_0x38530c){return rta[_0x9a6c('0x60')](_0x355ffd,_0x53a887,_0x1e4255);}else{return rta[_0x9a6c('0x61')](_0x355ffd,_0x53a887,_0x38530c);}})[_0x9a6c('0x15')](function(_0x4ffe20){_0x53a887=_0x4ffe20;var _0x529a4b=![];if(_0x53a887[_0x9a6c('0x4b')]===0x0){if(_0x4b5ece||_0x38530c){_0x529a4b=!![];}if(_0x50e998){_0x529a4b=![];}}if(_0x529a4b){return _0x55bd86;}var _0x25bfd2=_[_0x9a6c('0x35')](db[_0x9a6c('0x47')][_0x9a6c('0x62')],function(_0x58b6ec){return{'name':_0x58b6ec[_0x9a6c('0x63')],'type':_0x58b6ec[_0x9a6c('0x64')]['key']};});_0x6e79e3[_0x9a6c('0x51')]['role']=_0x9a6c('0x65');_0x6e79e3[_0x9a6c('0x51')][_0x9a6c('0x43')]=!![];_0x3a3850=qs['getOptions'](_0x25bfd2,_0x6e79e3);_0x3a3850[_0x9a6c('0x66')]=!![];var _0x1985ed=[];if(_0x53a887[_0x9a6c('0x4b')]>0x0){_0x1985ed[_0x9a6c('0x23')]({'id':{'$in':_0x53a887}});if(_0x1e4255&&!_0x38530c){_0x312ef6=[db[_0x9a6c('0x67')][_0x9a6c('0x68')](_0x9a6c('0x69')+_0x53a887+')')];_0x3a3850['order']=_0x312ef6;}}if(_0x50e998){_0x31b286[_0x9a6c('0x6a')](function(_0x2801b2){var _0x1d85da=!![];if(_0x38530c===_0x9a6c('0x56')&&_0x9ad588!==_0x2801b2){_0x1d85da=![];}_0x1985ed[_0x9a6c('0x23')]({[_0x2801b2+_0x9a6c('0x49')]:_0x1d85da});});if(_0x2293da){_0x1985ed[_0x9a6c('0x23')]({'pauseType':_0x2293da});}}else if(_0x38530c){_0x31b286['forEach'](function(_0x21b4ba){_0x1985ed[_0x9a6c('0x23')]({[_0x21b4ba+_0x9a6c('0x49')]:![]});});}_0x3a3850['where']=_[_0x9a6c('0x39')](_0x3a3850['where'],{'$and':_0x1985ed});if(_0x6e79e3['user'][_0x9a6c('0x6b')]===_0x9a6c('0x6c')){var _0x16b110={'params':{'id':_0x6e79e3[_0x9a6c('0x6c')][_0x9a6c('0x6d')]},'query':{'section':_0x9a6c('0x6e'),'role':_0x9a6c('0x65'),'online':!![],'raw':!![],'ids':_0x53a887,'customSorting':_0x312ef6}};if(_0x50e998){_0x16b110[_0x9a6c('0x51')][_0x9a6c('0x6f')]=_0x1985ed;}_0x16b110[_0x9a6c('0x51')]=Object[_0x9a6c('0x70')](_0x16b110[_0x9a6c('0x51')],_0x6e79e3['query']);delete _0x16b110[_0x9a6c('0x51')]['id'];return db[_0x9a6c('0x71')]['getResources'](_0x16b110);}return db[_0x9a6c('0x47')][_0x9a6c('0x72')](_0x3a3850);})[_0x9a6c('0x15')](function(_0x50b8d6){_0x55bd86[_0x9a6c('0xe')]=_0x50b8d6[_0x9a6c('0xe')];_0x2050c7=_0x50b8d6[_0x9a6c('0x73')];return _0x2050c7[_0x9a6c('0x35')](function(_0x57efb6){var _0x278290=_[_0x9a6c('0x38')](_0x355ffd,['id',_0x57efb6['id']]);if(_0x278290){var _0x4fd268=rta[_0x9a6c('0x74')](_0x278290);_[_0x9a6c('0x39')](_0x57efb6,_0x4fd268);}_0x57efb6['globalStatus']=rta[_0x9a6c('0x75')](_0x57efb6);if(_0x57efb6['globalStatus'][_0x9a6c('0x4d')](_0x9a6c('0x55'))){_0x31b286[_0x9a6c('0x6a')](function(_0x3853f3){if(_0x57efb6[_0x3853f3+'Pause']){_0x57efb6[_0x3853f3+_0x9a6c('0x76')]=_0x9a6c('0x55');}});}return _0x57efb6;});})[_0x9a6c('0x15')](function(_0x53d471){if(!_0x1e4255||_0x312ef6){return _0x53d471;}return rta[_0x9a6c('0x77')](_0x53d471,_0x1e4255);})['then'](function(_0x1daf83){_0x55bd86[_0x9a6c('0x73')]=_0x1daf83;return _0x55bd86;})[_0x9a6c('0x15')](respondWithFilteredResult(_0x2f42e4,_0x3a3850))[_0x9a6c('0x1a')](handleError(_0x2f42e4,null));};exports[_0x9a6c('0x78')]=function(_0x536911,_0x21aea4){var _0x5c6240={'count':0x0,'rows':[]},_0x3afd5d={},_0x882099,_0x355c6f,_0x3c78a5,_0x510830,_0x562b20;Promise[_0x9a6c('0x79')]()['then'](function(){if(_0x536911['query'][_0x9a6c('0x57')])_0x882099=validateChannel(_0x536911[_0x9a6c('0x51')][_0x9a6c('0x57')]);var _0x168ed8=_['startCase'](_0x882099)+_0x9a6c('0x7a');var _0x10a89d=_[_0x9a6c('0x35')](db[_0x168ed8]['rawAttributes'],function(_0x4662e2){return{'name':_0x4662e2['fieldName'],'type':_0x4662e2[_0x9a6c('0x64')][_0x9a6c('0x7b')]};});_0x3afd5d=qs[_0x9a6c('0x7c')](_0x10a89d,_0x536911);if(_0x536911['user'][_0x9a6c('0x6b')]===_0x9a6c('0x6c')){var _0x4fb6ca={'params':{'id':_0x536911[_0x9a6c('0x6c')][_0x9a6c('0x6d')]},'query':{'section':_0x882099===_0x9a6c('0x13')&&_0x536911['query'][_0x9a6c('0x64')]===_0x9a6c('0x22')?_0x9a6c('0x7d'):_['startCase'](_0x882099)+_0x9a6c('0x14'),'type':_0x536911[_0x9a6c('0x51')][_0x9a6c('0x64')],'nolimit':!![],'sort':_0x9a6c('0x12'),'filter':_0x536911[_0x9a6c('0x51')][_0x9a6c('0x3b')]}};return db[_0x9a6c('0x71')][_0x9a6c('0x7e')](_0x4fb6ca);}return db[_0x168ed8][_0x9a6c('0x72')](_0x3afd5d);})[_0x9a6c('0x15')](function(_0xd9928a){_0x5c6240['count']=_0xd9928a[_0x9a6c('0xe')];_0x355c6f=_0xd9928a[_0x9a6c('0x73')];return getRealtimeQueues(_0x536911,_0x882099);})[_0x9a6c('0x15')](function(_0x313175){_0x510830=_0x313175[_0x9a6c('0x73')];return rta[_0x9a6c('0x5f')]();})[_0x9a6c('0x15')](function(_0x6d4204){_0x3c78a5=_0x6d4204[_0x9a6c('0x73')];if(_0x882099!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x9a6c('0x15')](function(_0x966294){_0x562b20=_0x966294?_0x966294[_0x9a6c('0x73')]:[];return initializeQueues(_0x355c6f,_0x510830,_0x882099,_0x536911[_0x9a6c('0x51')][_0x9a6c('0x64')]);})[_0x9a6c('0x15')](function(_0x5d4c79){var _0x1122c6=_0x5d4c79['map'](function(_0x4d9e64){if(_0x882099===_0x9a6c('0x13'))return getVoiceQueueAgents(_0x4d9e64,_0x355c6f,_0x3c78a5,_0x562b20);else return getQueueAgents(_0x4d9e64,_0x3c78a5,_0x882099);});return Promise['all'](_0x1122c6);})[_0x9a6c('0x15')](function(_0x141a62){_0x5c6240[_0x9a6c('0x73')]=_0x141a62;return _0x5c6240;})[_0x9a6c('0x15')](respondWithFilteredResult(_0x21aea4,_0x3afd5d))[_0x9a6c('0x1a')](handleError(_0x21aea4,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index dfdfe44..e9c2f8c 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59881a,_0x5ef668){var _0x33a221=function(_0x396188){while(--_0x396188){_0x59881a['push'](_0x59881a['shift']());}};_0x33a221(++_0x5ef668);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1f8e33,_0x300371){var _0x37b939=function(_0x4d4fa4){while(--_0x4d4fa4){_0x1f8e33['push'](_0x1f8e33['shift']());}};_0x37b939(++_0x300371);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 756219f..b1c55d9 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 _0xc0a4=['INTEGER','STRING','DATE','exports'];(function(_0x4787e8,_0x53425e){var _0x3076a8=function(_0x574503){while(--_0x574503){_0x4787e8['push'](_0x4787e8['shift']());}};_0x3076a8(++_0x53425e);}(_0xc0a4,0x147));var _0x4c0a=function(_0x1305cb,_0xe80caf){_0x1305cb=_0x1305cb-0x0;var _0x41f38a=_0xc0a4[_0x1305cb];return _0x41f38a;};'use strict';var Sequelize=require('sequelize');module[_0x4c0a('0x0')]={'state':{'type':Sequelize[_0x4c0a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4c0a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x4c0a('0x2')]},'starttime':{'type':Sequelize[_0x4c0a('0x3')]},'responsetime':{'type':Sequelize[_0x4c0a('0x3')]},'ringtime':{'type':Sequelize[_0x4c0a('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4c0a('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4c0a('0x2')]}}; \ No newline at end of file +var _0x83d0=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x319801,_0x2bf3f0){var _0xc3759a=function(_0x169bdf){while(--_0x169bdf){_0x319801['push'](_0x319801['shift']());}};_0xc3759a(++_0x2bf3f0);}(_0x83d0,0xb7));var _0x083d=function(_0x1ce348,_0x55fa99){_0x1ce348=_0x1ce348-0x0;var _0x4720dc=_0x83d0[_0x1ce348];return _0x4720dc;};'use strict';var Sequelize=require(_0x083d('0x0'));module[_0x083d('0x1')]={'state':{'type':Sequelize[_0x083d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x083d('0x3')]},'scheduledat':{'type':Sequelize[_0x083d('0x4')]},'uniqueid':{'type':Sequelize[_0x083d('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x083d('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x083d('0x3')]},'membername':{'type':Sequelize[_0x083d('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 26e534b..0fef5c7 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 _0x979e=['api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x979e,0xcf));var _0xe979=function(_0x44eb35,_0x1088cd){_0x44eb35=_0x44eb35-0x0;var _0x30c3d2=_0x979e[_0x44eb35];return _0x30c3d2;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var logger=require(_0xe979('0x2'))(_0xe979('0x3'));var moment=require(_0xe979('0x4'));var BPromise=require(_0xe979('0x5'));var rp=require(_0xe979('0x6'));var fs=require('fs');var path=require(_0xe979('0x7'));var rimraf=require('rimraf');var config=require(_0xe979('0x8'));var attributes=require(_0xe979('0x9'));module[_0xe979('0xa')]=function(_0x2e5d24,_0xcf96a2){return _0x2e5d24[_0xe979('0xb')](_0xe979('0xc'),attributes,{'tableName':_0xe979('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc963=['exports','ReportAgentPreview','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes'];(function(_0x4a28c2,_0x509c2e){var _0x23f9d0=function(_0x3804ab){while(--_0x3804ab){_0x4a28c2['push'](_0x4a28c2['shift']());}};_0x23f9d0(++_0x509c2e);}(_0xc963,0x188));var _0x3c96=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc963[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x3c96('0x0'));var util=require('util');var logger=require(_0x3c96('0x1'))(_0x3c96('0x2'));var moment=require(_0x3c96('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c96('0x4'));var fs=require('fs');var path=require(_0x3c96('0x5'));var rimraf=require('rimraf');var config=require(_0x3c96('0x6'));var attributes=require(_0x3c96('0x7'));module[_0x3c96('0x8')]=function(_0xfd1cd,_0x4d5616){return _0xfd1cd['define'](_0x3c96('0x9'),attributes,{'tableName':'report_agent_preview','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 b9193a4..feb4cdf 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 _0x99e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x46c56c,_0x395ada){var _0x45e709=function(_0x1e20e3){while(--_0x1e20e3){_0x46c56c['push'](_0x46c56c['shift']());}};_0x45e709(++_0x395ada);}(_0x99e2,0x1ae));var _0x299e=function(_0x14e788,_0x5dfee2){_0x14e788=_0x14e788-0x0;var _0x3fd063=_0x99e2[_0x14e788];return _0x3fd063;};'use strict';var _=require(_0x299e('0x0'));var util=require(_0x299e('0x1'));var moment=require(_0x299e('0x2'));var BPromise=require(_0x299e('0x3'));var rs=require(_0x299e('0x4'));var fs=require('fs');var Redis=require(_0x299e('0x5'));var db=require(_0x299e('0x6'))['db'];var utils=require(_0x299e('0x7'));var logger=require(_0x299e('0x8'))(_0x299e('0x9'));var config=require('../../config/environment');var jayson=require(_0x299e('0xa'));var client=jayson['client'][_0x299e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa10382,_0xf439ef,_0x3ac5fe){return new BPromise(function(_0x1db850,_0x58d672){return client['request'](_0xa10382,_0x3ac5fe)[_0x299e('0xc')](function(_0x22bf2b){logger[_0x299e('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0xf439ef,_0x299e('0xe'));logger[_0x299e('0xf')](_0x299e('0x10'),_0xf439ef,_0x299e('0xe'),JSON['stringify'](_0x22bf2b));if(_0x22bf2b[_0x299e('0x11')]){if(_0x22bf2b[_0x299e('0x11')][_0x299e('0x12')]===0x1f4){logger['error'](_0x299e('0x13'),_0xf439ef,_0x22bf2b['error']['message']);return _0x58d672(_0x22bf2b[_0x299e('0x11')][_0x299e('0x14')]);}logger[_0x299e('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0xf439ef,_0x22bf2b[_0x299e('0x11')][_0x299e('0x14')]);return _0x1db850(_0x22bf2b[_0x299e('0x11')][_0x299e('0x14')]);}else{logger[_0x299e('0xd')](_0x299e('0x13'),_0xf439ef,_0x299e('0xe'));_0x1db850(_0x22bf2b[_0x299e('0x15')][_0x299e('0x14')]);}})['catch'](function(_0x2ee9c6){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0xf439ef,_0x2ee9c6);_0x58d672(_0x2ee9c6);});});}exports[_0x299e('0x16')]=function(_0x5176b3){var _0xe080fc=this;return new Promise(function(_0x406c70,_0x2a7bec){return db[_0x299e('0x17')]['create'](_0x5176b3[_0x299e('0x18')],{'raw':_0x5176b3[_0x299e('0x19')]?_0x5176b3['options'][_0x299e('0x1a')]===undefined?!![]:![]:!![]})[_0x299e('0xc')](function(_0x4bd04d){logger['info'](_0x299e('0x16'),_0x5176b3);logger['debug']('CreateReportAgentPreview',_0x5176b3,JSON[_0x299e('0x1b')](_0x4bd04d));_0x406c70(_0x4bd04d);})[_0x299e('0x1c')](function(_0x335f1f){logger[_0x299e('0x11')](_0x299e('0x16'),_0x335f1f[_0x299e('0x14')],_0x5176b3);_0x2a7bec(_0xe080fc[_0x299e('0x11')](0x1f4,_0x335f1f[_0x299e('0x14')]));});});}; \ No newline at end of file +var _0x50d4=['CreateReportAgentPreview','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ReportAgentPreview','create','options','raw'];(function(_0x16fd13,_0x41992b){var _0x4fba53=function(_0x409450){while(--_0x409450){_0x16fd13['push'](_0x16fd13['shift']());}};_0x4fba53(++_0x41992b);}(_0x50d4,0xda));var _0x450d=function(_0x44b9e0,_0x48d4b1){_0x44b9e0=_0x44b9e0-0x0;var _0x80db15=_0x50d4[_0x44b9e0];return _0x80db15;};'use strict';var _=require(_0x450d('0x0'));var util=require(_0x450d('0x1'));var moment=require(_0x450d('0x2'));var BPromise=require(_0x450d('0x3'));var rs=require(_0x450d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x450d('0x5'));var logger=require('../../config/logger')(_0x450d('0x6'));var config=require(_0x450d('0x7'));var jayson=require(_0x450d('0x8'));var client=jayson['client'][_0x450d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d64a,_0x2e3d3d,_0x590619){return new BPromise(function(_0x518e5c,_0x51b623){return client[_0x450d('0xa')](_0x52d64a,_0x590619)[_0x450d('0xb')](function(_0x1cc9c6){logger[_0x450d('0xc')](_0x450d('0xd'),_0x2e3d3d,'request\x20sent');logger['debug'](_0x450d('0xe'),_0x2e3d3d,'request\x20sent',JSON[_0x450d('0xf')](_0x1cc9c6));if(_0x1cc9c6['error']){if(_0x1cc9c6[_0x450d('0x10')][_0x450d('0x11')]===0x1f4){logger[_0x450d('0x10')](_0x450d('0xd'),_0x2e3d3d,_0x1cc9c6['error'][_0x450d('0x12')]);return _0x51b623(_0x1cc9c6[_0x450d('0x10')][_0x450d('0x12')]);}logger[_0x450d('0x10')](_0x450d('0xd'),_0x2e3d3d,_0x1cc9c6[_0x450d('0x10')]['message']);return _0x518e5c(_0x1cc9c6[_0x450d('0x10')][_0x450d('0x12')]);}else{logger['info'](_0x450d('0xd'),_0x2e3d3d,_0x450d('0x13'));_0x518e5c(_0x1cc9c6['result'][_0x450d('0x12')]);}})[_0x450d('0x14')](function(_0xbd17a3){logger[_0x450d('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2e3d3d,_0xbd17a3);_0x51b623(_0xbd17a3);});});}exports['CreateReportAgentPreview']=function(_0x512148){var _0xa341a5=this;return new Promise(function(_0x44b873,_0x44811b){return db[_0x450d('0x15')][_0x450d('0x16')](_0x512148['body'],{'raw':_0x512148[_0x450d('0x17')]?_0x512148[_0x450d('0x17')][_0x450d('0x18')]===undefined?!![]:![]:!![]})[_0x450d('0xb')](function(_0x574f65){logger[_0x450d('0xc')](_0x450d('0x19'),_0x512148);logger[_0x450d('0x1a')](_0x450d('0x19'),_0x512148,JSON['stringify'](_0x574f65));_0x44b873(_0x574f65);})[_0x450d('0x14')](function(_0x45487d){logger[_0x450d('0x10')](_0x450d('0x19'),_0x45487d[_0x450d('0x12')],_0x512148);_0x44811b(_0xa341a5['error'](0x1f4,_0x45487d[_0x450d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index cf244ac..504af73 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 _0x3902=['/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','util','path','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/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','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0xf41394,_0x5ed704){var _0x5d84a2=function(_0x11dd62){while(--_0x11dd62){_0xf41394['push'](_0xf41394['shift']());}};_0x5d84a2(++_0x5ed704);}(_0x3902,0x1ee));var _0x2390=function(_0x1c7394,_0x31f274){_0x1c7394=_0x1c7394-0x0;var _0x256abb=_0x3902[_0x1c7394];return _0x256abb;};'use strict';var multer=require('multer');var util=require(_0x2390('0x0'));var path=require(_0x2390('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x2390('0x2'));var controller=require(_0x2390('0x3'));router[_0x2390('0x4')](_0x2390('0x5'),auth[_0x2390('0x6')](),controller[_0x2390('0x7')]);router[_0x2390('0x4')](_0x2390('0x8'),auth[_0x2390('0x6')](),controller[_0x2390('0x9')]);router[_0x2390('0x4')](_0x2390('0xa'),auth[_0x2390('0x6')](),controller[_0x2390('0xb')]);router['get']('/voice/queues',auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0x2390('0xc'),auth[_0x2390('0x6')](),controller[_0x2390('0xd')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x2390('0x4')]('/mail/accounts',auth[_0x2390('0x6')](),controller['mailAccounts']);router['get'](_0x2390('0xe'),auth[_0x2390('0x6')](),controller['openchannelQueues']);router[_0x2390('0x4')](_0x2390('0xf'),auth[_0x2390('0x6')](),controller[_0x2390('0x10')]);router[_0x2390('0x4')](_0x2390('0x11'),auth[_0x2390('0x6')](),controller['whatsappQueues']);router[_0x2390('0x4')](_0x2390('0x12'),auth[_0x2390('0x6')](),controller[_0x2390('0x13')]);router[_0x2390('0x4')](_0x2390('0x14'),auth[_0x2390('0x6')](),controller['voiceQueuesPreview']);router[_0x2390('0x4')](_0x2390('0x15'),auth['isAuthenticated'](),controller[_0x2390('0x16')]);router['get'](_0x2390('0x17'),auth[_0x2390('0x6')](),controller[_0x2390('0x18')]);router[_0x2390('0x4')](_0x2390('0x19'),auth[_0x2390('0x6')](),controller[_0x2390('0x1a')]);router[_0x2390('0x4')](_0x2390('0x1b'),auth[_0x2390('0x6')](),controller[_0x2390('0x1c')]);router[_0x2390('0x4')](_0x2390('0x1d'),auth[_0x2390('0x6')](),controller['showVoiceQueues']);router['put']('/voice/queues/:id',auth[_0x2390('0x6')](),controller[_0x2390('0x1e')]);router['get']('/outbound',auth[_0x2390('0x6')](),controller[_0x2390('0x1f')]);router[_0x2390('0x4')](_0x2390('0x20'),auth[_0x2390('0x6')](),controller['outboundChannels']);router['get'](_0x2390('0x21'),auth[_0x2390('0x6')](),controller[_0x2390('0x22')]);router[_0x2390('0x23')](_0x2390('0x24'),auth[_0x2390('0x6')](),controller[_0x2390('0x25')]);router['get']('/telephones',auth[_0x2390('0x6')](),controller[_0x2390('0x26')]);router[_0x2390('0x4')](_0x2390('0x27'),auth[_0x2390('0x6')](),controller[_0x2390('0x28')]);router['get'](_0x2390('0x29'),auth[_0x2390('0x6')](),controller[_0x2390('0x2a')]);router[_0x2390('0x4')](_0x2390('0x2b'),auth['isAuthenticated'](),controller[_0x2390('0x2c')]);router[_0x2390('0x4')](_0x2390('0x2d'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x2390('0x4')](_0x2390('0x2e'),auth[_0x2390('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x2390('0x4')](_0x2390('0x2f'),auth[_0x2390('0x6')](),controller[_0x2390('0x30')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x2390('0x6')](),controller[_0x2390('0x31')]);router[_0x2390('0x4')](_0x2390('0x32'),auth[_0x2390('0x6')](),controller[_0x2390('0x33')]);router[_0x2390('0x4')](_0x2390('0x34'),auth[_0x2390('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x2390('0x4')]('/fax/queues/waitinginteractions',auth[_0x2390('0x6')](),controller[_0x2390('0x35')]);router['post']('/mail/queues/:id/notify',auth[_0x2390('0x6')](),controller[_0x2390('0x36')](_0x2390('0x37')));router['get']('/mail/queues/:id',auth[_0x2390('0x6')](),controller[_0x2390('0x38')]);router[_0x2390('0x39')](_0x2390('0x3a'),auth[_0x2390('0x6')](),controller['queueNotify'](_0x2390('0x3b')));router[_0x2390('0x4')](_0x2390('0x3c'),auth[_0x2390('0x6')](),controller[_0x2390('0x3d')]);router[_0x2390('0x39')](_0x2390('0x3e'),auth['isAuthenticated'](),controller['queueNotify']('fax'));router[_0x2390('0x4')](_0x2390('0x3f'),auth['isAuthenticated'](),controller[_0x2390('0x40')]);router[_0x2390('0x39')](_0x2390('0x41'),auth[_0x2390('0x6')](),controller[_0x2390('0x36')](_0x2390('0x42')));router[_0x2390('0x4')](_0x2390('0x43'),auth[_0x2390('0x6')](),controller[_0x2390('0x44')]);router[_0x2390('0x39')](_0x2390('0x45'),auth[_0x2390('0x6')](),controller['queueNotify'](_0x2390('0x46')));router[_0x2390('0x39')](_0x2390('0x47'),auth[_0x2390('0x6')](),controller[_0x2390('0x36')](_0x2390('0x48')));router[_0x2390('0x4')](_0x2390('0x49'),auth['isAuthenticated'](),controller[_0x2390('0x4a')]);router['get'](_0x2390('0x4b'),auth[_0x2390('0x6')](),controller[_0x2390('0x4c')]);router[_0x2390('0x39')]('/agents/:id/notify',auth[_0x2390('0x6')](),controller[_0x2390('0x4d')]);module['exports']=router; \ No newline at end of file +var _0x678e=['/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','path','express','/voice/channels','voiceChannels','voiceChannelMixMonitor','get'];(function(_0x5497ba,_0xde4426){var _0x120123=function(_0x417788){while(--_0x417788){_0x5497ba['push'](_0x5497ba['shift']());}};_0x120123(++_0xde4426);}(_0x678e,0xe0));var _0xe678=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x678e[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xe678('0x0'));var util=require('util');var path=require(_0xe678('0x1'));var express=require(_0xe678('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0xe678('0x3'),auth['isAuthenticated'](),controller[_0xe678('0x4')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xe678('0x5')]);router[_0xe678('0x6')](_0xe678('0x7'),auth[_0xe678('0x8')](),controller[_0xe678('0x9')]);router['get'](_0xe678('0xa'),auth[_0xe678('0x8')](),controller[_0xe678('0xb')]);router[_0xe678('0x6')](_0xe678('0xc'),auth['isAuthenticated'](),controller[_0xe678('0xd')]);router[_0xe678('0x6')](_0xe678('0xe'),auth[_0xe678('0x8')](),controller['mailQueues']);router['get'](_0xe678('0xf'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0xe678('0x6')](_0xe678('0x10'),auth[_0xe678('0x8')](),controller[_0xe678('0x11')]);router[_0xe678('0x6')](_0xe678('0x12'),auth[_0xe678('0x8')](),controller[_0xe678('0x13')]);router['get']('/whatsapp/queues',auth[_0xe678('0x8')](),controller[_0xe678('0x14')]);router[_0xe678('0x6')](_0xe678('0x15'),auth[_0xe678('0x8')](),controller['faxQueues']);router[_0xe678('0x6')](_0xe678('0x16'),auth[_0xe678('0x8')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth[_0xe678('0x8')](),controller['voiceQueuesChannels']);router[_0xe678('0x6')](_0xe678('0x17'),auth[_0xe678('0x8')](),controller[_0xe678('0x18')]);router[_0xe678('0x6')](_0xe678('0x19'),auth[_0xe678('0x8')](),controller[_0xe678('0x1a')]);router['get'](_0xe678('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get'](_0xe678('0x1c'),auth['isAuthenticated'](),controller[_0xe678('0x1d')]);router['put'](_0xe678('0x1c'),auth['isAuthenticated'](),controller[_0xe678('0x1e')]);router['get']('/outbound',auth[_0xe678('0x8')](),controller[_0xe678('0x1f')]);router['get'](_0xe678('0x20'),auth[_0xe678('0x8')](),controller['outboundChannels']);router['get'](_0xe678('0x21'),auth[_0xe678('0x8')](),controller[_0xe678('0x22')]);router[_0xe678('0x23')](_0xe678('0x24'),auth[_0xe678('0x8')](),controller[_0xe678('0x25')]);router[_0xe678('0x6')](_0xe678('0x26'),auth[_0xe678('0x8')](),controller[_0xe678('0x27')]);router[_0xe678('0x6')](_0xe678('0x28'),auth[_0xe678('0x8')](),controller[_0xe678('0x29')]);router[_0xe678('0x6')](_0xe678('0x2a'),auth[_0xe678('0x8')](),controller[_0xe678('0x2b')]);router['get'](_0xe678('0x2c'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xe678('0x6')](_0xe678('0x2d'),auth[_0xe678('0x8')](),controller[_0xe678('0x2e')]);router['get'](_0xe678('0x2f'),auth[_0xe678('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0xe678('0x6')](_0xe678('0x30'),auth[_0xe678('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xe678('0x6')](_0xe678('0x31'),auth[_0xe678('0x8')](),controller[_0xe678('0x32')]);router[_0xe678('0x6')](_0xe678('0x33'),auth[_0xe678('0x8')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xe678('0x34'),auth['isAuthenticated'](),controller[_0xe678('0x35')]);router[_0xe678('0x6')](_0xe678('0x36'),auth['isAuthenticated'](),controller[_0xe678('0x37')]);router[_0xe678('0x38')](_0xe678('0x39'),auth[_0xe678('0x8')](),controller[_0xe678('0x3a')](_0xe678('0x3b')));router['get'](_0xe678('0x3c'),auth[_0xe678('0x8')](),controller[_0xe678('0x3d')]);router[_0xe678('0x38')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe678('0x3a')](_0xe678('0x3e')));router[_0xe678('0x6')]('/chat/queues/:id',auth[_0xe678('0x8')](),controller[_0xe678('0x3f')]);router['post']('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe678('0x3a')](_0xe678('0x40')));router[_0xe678('0x6')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0xe678('0x41')]);router[_0xe678('0x38')](_0xe678('0x42'),auth[_0xe678('0x8')](),controller['queueNotify']('openchannel'));router[_0xe678('0x6')](_0xe678('0x43'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xe678('0x38')](_0xe678('0x44'),auth['isAuthenticated'](),controller[_0xe678('0x3a')]('sms'));router[_0xe678('0x38')](_0xe678('0x45'),auth['isAuthenticated'](),controller[_0xe678('0x3a')](_0xe678('0x46')));router[_0xe678('0x6')](_0xe678('0x47'),auth['isAuthenticated'](),controller[_0xe678('0x48')]);router[_0xe678('0x6')](_0xe678('0x49'),auth[_0xe678('0x8')](),controller[_0xe678('0x4a')]);router[_0xe678('0x38')](_0xe678('0x4b'),auth['isAuthenticated'](),controller[_0xe678('0x4c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 01ce552..f6c9d45 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 _0x3eea=['whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x39c549,_0x340d69){_0x39c549=_0x39c549-0x0;var _0x6ab579=_0x3eea[_0x39c549];return _0x6ab579;};'use strict';var BPromise=require(_0xa3ee('0x0'));var moment=require('moment');var _=require(_0xa3ee('0x1'));var util=require(_0xa3ee('0x2'));var db=require(_0xa3ee('0x3'))['db'];var logger=require(_0xa3ee('0x4'))(_0xa3ee('0x5'));var jayson=require(_0xa3ee('0x6'));var amiClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232a});var mailClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232b});var routingClient=jayson[_0xa3ee('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){var _0x1eeb5b=_0x4e4588?_0x4e4588:amiClient;return _0x1eeb5b['request'](_0x538bf9,_0x4183ee)[_0xa3ee('0x9')](function(_0x5ef236){if(_0x5ef236[_0xa3ee('0xa')]){if(_0x5ef236[_0xa3ee('0xa')][_0xa3ee('0xb')]===0x1f4){return _0x56f37b(_0x5ef236['error'][_0xa3ee('0xc')]);}return _0x37a3f0(_0x5ef236[_0xa3ee('0xa')]['message']);}else{_0x37a3f0(_0x5ef236['result']);}})[_0xa3ee('0xd')](function(_0x30e652){_0x56f37b(_0x30e652);});});}function respondWithResult(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xc8;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0xe')](_0x4363d1)['json'](_0x594c88);}return _0x403518[_0xa3ee('0xf')](0x194);};}function handleError(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0x1f4;return function(_0x150e20){logger['error'](_0x150e20[_0xa3ee('0x10')]);if(_0x150e20[_0xa3ee('0x11')]){delete _0x150e20['name'];}_0x20535f['status'](_0x2c34cf)['send'](_0x150e20);};}function findById(_0x40decb){return function(_0x7277cd){if(!_[_0xa3ee('0x12')](_0x40decb)&&!_[_0xa3ee('0x12')](_0x7277cd)&&!_['isNil'](_0x7277cd[_0xa3ee('0x13')])){return _[_0xa3ee('0x14')](_0x7277cd[_0xa3ee('0x13')],function(_0x299b1e){return _0x299b1e['id']==_0x40decb;});}return null;};}exports[_0xa3ee('0x15')]=function(_0x4aac0e,_0x377b9d){return respondWithRpcPromise(_0xa3ee('0x16'),_0x4aac0e[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x377b9d,null))[_0xa3ee('0xd')](handleError(_0x377b9d,null));};exports[_0xa3ee('0x18')]=function(_0x4f8c56,_0x3f5d70){return respondWithRpcPromise(_0xa3ee('0x19'),_['merge'](_0x4f8c56[_0xa3ee('0x17')],_0x4f8c56['params']))[_0xa3ee('0x9')](respondWithResult(_0x3f5d70,null))[_0xa3ee('0xd')](handleError(_0x3f5d70,null));};exports[_0xa3ee('0x1a')]=function(_0x1bd196,_0x60b899){return respondWithRpcPromise(_0xa3ee('0x1b'),_[_0xa3ee('0x1c')](_0x1bd196[_0xa3ee('0x17')],_0x1bd196[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x60b899,null))['catch'](handleError(_0x60b899,null));};exports[_0xa3ee('0x1e')]=function(_0x1dca29,_0x157071){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x1dca29[_0xa3ee('0x17')])['then'](respondWithResult(_0x157071,null))[_0xa3ee('0xd')](handleError(_0x157071,null));};exports[_0xa3ee('0x20')]=function(_0x146493,_0xd9a7f8){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x146493[_0xa3ee('0x17')])[_0xa3ee('0x9')](findById(_0x146493[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0xd9a7f8,null))[_0xa3ee('0xd')](handleError(_0xd9a7f8,null));};exports['updateVoiceQueue']=function(_0x5ba571,_0x4abf49){return respondWithRpcPromise(_0xa3ee('0x21'),_['merge'](_0x5ba571[_0xa3ee('0x22')],_0x5ba571[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x4abf49,null))[_0xa3ee('0xd')](handleError(_0x4abf49,null));};exports[_0xa3ee('0x23')]=function(_0x14547d,_0x30ba4e){return respondWithRpcPromise(_0xa3ee('0x24'),_[_0xa3ee('0x1c')](_0x14547d[_0xa3ee('0x17')],_0x14547d['params']))[_0xa3ee('0x9')](respondWithResult(_0x30ba4e,null))['catch'](handleError(_0x30ba4e,null));};exports[_0xa3ee('0x25')]=function(_0x332d61,_0x496839){return respondWithRpcPromise(_0xa3ee('0x26'),_0x332d61['query'])[_0xa3ee('0x9')](respondWithResult(_0x496839,null))['catch'](handleError(_0x496839,null));};exports[_0xa3ee('0x27')]=function(_0x299099,_0x2f803c){return respondWithRpcPromise(_0xa3ee('0x28'),_[_0xa3ee('0x1c')](_0x299099['query'],_0x299099[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x2f803c,null))[_0xa3ee('0xd')](handleError(_0x2f803c,null));};exports['voiceQueuesChannelHangup']=function(_0x1599e4,_0x531f58){return respondWithRpcPromise(_0xa3ee('0x29'),_['merge'](_0x1599e4[_0xa3ee('0x17')],_0x1599e4['params']))[_0xa3ee('0x9')](respondWithResult(_0x531f58,null))[_0xa3ee('0xd')](handleError(_0x531f58,null));};exports[_0xa3ee('0x2a')]=function(_0x45be9b,_0x1717ba){return respondWithRpcPromise(_0xa3ee('0x2b'),_[_0xa3ee('0x1c')](_0x45be9b[_0xa3ee('0x17')],_0x45be9b[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x1717ba,null))[_0xa3ee('0xd')](handleError(_0x1717ba,null));};exports[_0xa3ee('0x2c')]=function(_0x447efd,_0x595b55){return respondWithRpcPromise(_0xa3ee('0x2d'),_0x447efd[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x595b55,null))[_0xa3ee('0xd')](handleError(_0x595b55,null));};exports['outboundChannels']=function(_0x257627,_0x11a721){return respondWithRpcPromise(_0xa3ee('0x2e'),_0x257627['query'])[_0xa3ee('0x9')](respondWithResult(_0x11a721,null))[_0xa3ee('0xd')](handleError(_0x11a721,null));};exports['agents']=function(_0x319c26,_0x3ecbe6){var _0x4ef99a;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')])[_0xa3ee('0x9')](function(_0x2c8873){_0x4ef99a=_0x2c8873;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')],routingClient);})[_0xa3ee('0x9')](function(_0x3e0eec){return _[_0xa3ee('0x1c')]({},_0x3e0eec,_0x4ef99a);})[_0xa3ee('0x9')](respondWithResult(_0x3ecbe6,null))[_0xa3ee('0xd')](handleError(_0x3ecbe6,null));};exports['agentCapacity']=function(_0x5aa4b3,_0x548534){if(_0x5aa4b3[_0xa3ee('0x22')]&&_0x5aa4b3[_0xa3ee('0x22')]['interaction']&&_0x5aa4b3[_0xa3ee('0x30')]&&_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]){for(var _0x55f47f in _0x5aa4b3[_0xa3ee('0x22')]['interaction']){if(_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0xa3ee('0x32')](_0x55f47f)){db[_0xa3ee('0x33')][_0xa3ee('0x34')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'exitAt':null,'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]&&_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')]?{'$notIn':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]}:{'$ne':null}}})[_0xa3ee('0x9')](function(_0x25e0fe){var _0x4594e1=moment()['format'](_0xa3ee('0x37'));for(var _0xdca412=0x0,_0x112e80=_0x25e0fe[_0xa3ee('0x36')];_0xdca412<_0x112e80;_0xdca412+=0x1){_0x25e0fe[_0xdca412]['updateAttributes']({'exitAt':_0x4594e1});}});for(var _0x30fcf1=0x0;_0x30fcf1<_0x5aa4b3['body'][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')];_0x30fcf1+=0x1){db[_0xa3ee('0x33')][_0xa3ee('0x38')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1],'exitAt':null},'defaults':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')]['name'],'interface':_[_0xa3ee('0x12')](_0x5aa4b3['user']['interface'])?util[_0xa3ee('0x39')](_0xa3ee('0x3a'),_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]):_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x3b')],'type':_0xa3ee('0x35'),'enterAt':moment()['format'](_0xa3ee('0x37')),'role':_0xa3ee('0x3c'),'internal':_0x5aa4b3['user'][_0xa3ee('0x3d')],'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5aa4b3['params']['id'],'capacity':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x3e')]},routingClient)[_0xa3ee('0x9')](respondWithResult(_0x548534,null))[_0xa3ee('0xd')](handleError(_0x548534,null));};exports[_0xa3ee('0x3f')]=function(_0x57e654,_0x55678e){return respondWithRpcPromise(_0xa3ee('0x40'),_0x57e654[_0xa3ee('0x17')])['then'](respondWithResult(_0x55678e,null))[_0xa3ee('0xd')](handleError(_0x55678e,null));};exports[_0xa3ee('0x41')]=function(_0x13cd8b,_0x579ec8){return respondWithRpcPromise('Trunks',_0x13cd8b[_0xa3ee('0x17')])['then'](respondWithResult(_0x579ec8,null))[_0xa3ee('0xd')](handleError(_0x579ec8,null));};exports[_0xa3ee('0x42')]=function(_0x5b8e79,_0x4232e0){return respondWithRpcPromise(_0xa3ee('0x43'),_0x5b8e79[_0xa3ee('0x17')])['then'](respondWithResult(_0x4232e0,null))[_0xa3ee('0xd')](handleError(_0x4232e0,null));};exports[_0xa3ee('0x44')]=function(_0x594034,_0x1d832c){return respondWithRpcPromise(_0xa3ee('0x45'),_0x594034[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x1d832c,null))['catch'](handleError(_0x1d832c,null));};exports[_0xa3ee('0x46')]=function(_0x17ac07,_0x4a1a2f){return respondWithRpcPromise(_0xa3ee('0x45'),_0x17ac07[_0xa3ee('0x17')],routingClient)['then'](findById(_0x17ac07['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x4a1a2f,null))[_0xa3ee('0xd')](handleError(_0x4a1a2f,null));};exports[_0xa3ee('0x47')]=function(_0x52b824,_0x11fb6e){return respondWithRpcPromise(_0xa3ee('0x48'),_0x52b824[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x11fb6e,null))[_0xa3ee('0xd')](handleError(_0x11fb6e,null));};exports[_0xa3ee('0x49')]=function(_0x497be4,_0x10f508){return respondWithRpcPromise(_0xa3ee('0x48'),_0x497be4['query'],routingClient)[_0xa3ee('0x9')](findById(_0x497be4[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x10f508,null))[_0xa3ee('0xd')](handleError(_0x10f508,null));};exports[_0xa3ee('0x4a')]=function(_0x330778,_0x4a2255){return respondWithRpcPromise(_0xa3ee('0x4b'),_0x330778[_0xa3ee('0x17')],mailClient)[_0xa3ee('0x9')](respondWithResult(_0x4a2255,null))['catch'](handleError(_0x4a2255,null));};exports[_0xa3ee('0x4c')]=function(_0x13b81b,_0x519f10){return respondWithRpcPromise('OpenchannelQueues',_0x13b81b['query'],routingClient)['then'](respondWithResult(_0x519f10,null))[_0xa3ee('0xd')](handleError(_0x519f10,null));};exports[_0xa3ee('0x4d')]=function(_0x3adafb,_0x2f0424){return respondWithRpcPromise(_0xa3ee('0x4e'),_0x3adafb[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x3adafb['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x2f0424,null))[_0xa3ee('0xd')](handleError(_0x2f0424,null));};exports[_0xa3ee('0x4f')]=function(_0xaff641,_0x147024){return respondWithRpcPromise('SmsQueues',_0xaff641['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x147024,null))[_0xa3ee('0xd')](handleError(_0x147024,null));};exports[_0xa3ee('0x50')]=function(_0x24613d,_0x16aabe){return respondWithRpcPromise(_0xa3ee('0x51'),_0x24613d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x24613d[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x16aabe,null))[_0xa3ee('0xd')](handleError(_0x16aabe,null));};exports[_0xa3ee('0x52')]=function(_0x64f353,_0x224790){return respondWithRpcPromise(_0xa3ee('0x53'),_0x64f353['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x224790,null))['catch'](handleError(_0x224790,null));};exports['showWhatsappQueues']=function(_0x2b1c6e,_0x49daf9){return respondWithRpcPromise(_0xa3ee('0x53'),_0x2b1c6e[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x2b1c6e[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x49daf9,null))[_0xa3ee('0xd')](handleError(_0x49daf9,null));};exports[_0xa3ee('0x54')]=function(_0x179ae2,_0x370e3e){return respondWithRpcPromise('FaxQueues',_0x179ae2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x370e3e,null))['catch'](handleError(_0x370e3e,null));};exports[_0xa3ee('0x55')]=function(_0x52a066,_0x4f3aac){return respondWithRpcPromise(_0xa3ee('0x56'),_0x52a066['query'],routingClient)['then'](findById(_0x52a066[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x4f3aac,null))['catch'](handleError(_0x4f3aac,null));};exports[_0xa3ee('0x57')]=function(_0xf8689f,_0x538a9b){return respondWithRpcPromise('FaxAccounts',_0xf8689f['query'])[_0xa3ee('0x9')](respondWithResult(_0x538a9b,null))[_0xa3ee('0xd')](handleError(_0x538a9b,null));};exports[_0xa3ee('0x58')]=function(_0x7844ae,_0x389547){return respondWithRpcPromise(_0xa3ee('0x59'),_0x7844ae['query'],routingClient)['then'](respondWithResult(_0x389547,null))[_0xa3ee('0xd')](handleError(_0x389547,null));};exports[_0xa3ee('0x5a')]=function(_0x42a79e,_0x5675fb){return respondWithRpcPromise(_0xa3ee('0x5b'),_0x42a79e[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x5675fb,null))[_0xa3ee('0xd')](handleError(_0x5675fb,null));};exports[_0xa3ee('0x5c')]=function(_0x3be877,_0x2ad745){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x3be877['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2ad745,null))[_0xa3ee('0xd')](handleError(_0x2ad745,null));};exports[_0xa3ee('0x5e')]=function(_0x37e1c2,_0xbfb429){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x37e1c2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](function(_0x448f14){if(_0x37e1c2['query']['type']!==undefined){var _0x228671=_(_0x448f14['rows'])[_0xa3ee('0x5f')]([_0x37e1c2[_0xa3ee('0x17')][_0xa3ee('0x60')],_0x37e1c2[_0xa3ee('0x1d')]['id']])['map'](_0xa3ee('0x61'))[_0xa3ee('0x62')]()[_0xa3ee('0x63')]();return _0x448f14[_0xa3ee('0x13')][_0xa3ee('0x5f')](function(_0x4e9473){return _0x228671[_0xa3ee('0x64')](_0x4e9473[_0xa3ee('0x61')])>-0x1;});}else{return _0x448f14[_0xa3ee('0x13')]['filter'](function(_0x3ca523){return _0x3ca523['queue_id']===parseInt(_0x37e1c2[_0xa3ee('0x1d')]['id']);});}})['then'](respondWithResult(_0xbfb429,null))[_0xa3ee('0xd')](handleError(_0xbfb429,null));};exports[_0xa3ee('0x65')]=function(_0x119c3d,_0x140ee0){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x119c3d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x140ee0,null))['catch'](handleError(_0x140ee0,null));};exports[_0xa3ee('0x66')]=function(_0xa82482,_0x44b084){return respondWithRpcPromise(_0xa3ee('0x67'),_0xa82482[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x44b084,null))[_0xa3ee('0xd')](handleError(_0x44b084,null));};exports[_0xa3ee('0x68')]=function(_0x55a6b7,_0x2535ef){return respondWithRpcPromise(_0xa3ee('0x69'),_0x55a6b7[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2535ef,null))[_0xa3ee('0xd')](handleError(_0x2535ef,null));};exports[_0xa3ee('0x6a')]=function(_0x31d3ca){return function(_0x329e32,_0x37bde3){var _0x25334c,_0x4f7ace;var _0x21fd56=_[_0xa3ee('0x6b')](_0x31d3ca);var _0x26a124=_0x31d3ca==='chat'?_0xa3ee('0x6c'):'Account';return db[_0x21fd56+_0xa3ee('0x6d')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x329e32['params']['id']}})[_0xa3ee('0x9')](function(_0x44f27b){if(_['isNil'](_0x44f27b)){throw new Error(_0x21fd56+_0xa3ee('0x6f'));}_0x25334c=_0x44f27b;return db[_0x21fd56+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x329e32[_0xa3ee('0x22')][_0xa3ee('0x71')]},'include':[{'model':db[_0x21fd56+_0xa3ee('0x72')],'as':'Interaction'},{'model':db[_0x21fd56+_0x26a124],'as':'Account'}]});})['then'](function(_0x27454a){if(_['isNil'](_0x27454a)){throw new Error(_0x21fd56+_0xa3ee('0x73'));}_0x4f7ace=_0x27454a;return _0x27454a[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x312ad8={'uniqueid':_0x31d3ca+'.'+_0x4f7ace['id']+'.'+_0x4f7ace[_0xa3ee('0x72')]['id'],'FromUserId':_0x329e32[_0xa3ee('0x30')]['id'],'type':_0xa3ee('0x75')};_0x312ad8[_0x21fd56+_0xa3ee('0x76')]=_0x4f7ace['id'];_0x312ad8[_0x21fd56+_0xa3ee('0x77')]=_0x4f7ace[_0xa3ee('0x72')]['id'];_0x312ad8[_0xa3ee('0x78')+_0x21fd56+_0x26a124+'Id']=_0x4f7ace[_0xa3ee('0x79')]['id'];_0x312ad8['To'+_0x21fd56+_0xa3ee('0x7a')]=_0x25334c['id'];return db[_0x21fd56+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x312ad8);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x31d3ca,'interaction':_0x4f7ace[_0xa3ee('0x72')],'message':_0x4f7ace,'account':_0x4f7ace[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x25334c[_0xa3ee('0x11')]+','+(_0x4f7ace[_0xa3ee('0x79')][_0xa3ee('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x37bde3,null))[_0xa3ee('0xd')](handleError(_0x37bde3,null));};};exports[_0xa3ee('0x7f')]=function(_0x591bfa,_0x5b53f1){var _0x24cbc9,_0x157436;if(_[_0xa3ee('0x12')](_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')])){throw new Error(_0xa3ee('0x81'));}var _0x18a74b=_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')];var _0x3e6657=_[_0xa3ee('0x6b')](_0x18a74b);var _0x3236b3=_0x18a74b===_0xa3ee('0x82')?'Website':_0xa3ee('0x79');return db[_0xa3ee('0x83')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x591bfa[_0xa3ee('0x1d')]['id'],'role':_0xa3ee('0x3c')}})[_0xa3ee('0x9')](function(_0x4cc5e5){if(_['isNil'](_0x4cc5e5)){throw new Error(_0xa3ee('0x84'));}_0x24cbc9=_0x4cc5e5;return db[_0x3e6657+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x591bfa['body'][_0xa3ee('0x71')]},'include':[{'model':db[_0x3e6657+'Interaction'],'as':_0xa3ee('0x72')},{'model':db[_0x3e6657+_0x3236b3],'as':_0xa3ee('0x79')}]});})[_0xa3ee('0x9')](function(_0x10ec99){if(_[_0xa3ee('0x12')](_0x10ec99)){throw new Error(_0x3e6657+_0xa3ee('0x73'));}_0x157436=_0x10ec99;return _0x10ec99[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x116de1={'uniqueid':_0x18a74b+'.'+_0x157436['id']+'.'+_0x157436[_0xa3ee('0x72')]['id'],'FromUserId':_0x591bfa['user']['id'],'type':'queue','ToUserId':_0x24cbc9['id']};_0x116de1[_0x3e6657+'MessageId']=_0x157436['id'];_0x116de1[_0x3e6657+_0xa3ee('0x77')]=_0x157436['Interaction']['id'];_0x116de1[_0xa3ee('0x78')+_0x3e6657+_0x3236b3+'Id']=_0x157436[_0xa3ee('0x79')]['id'];return db[_0x3e6657+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x116de1);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x18a74b,'interaction':_0x157436[_0xa3ee('0x72')],'message':_0x157436,'account':_0x157436[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa3ee('0x3c'),'appdata':_0x24cbc9['name']+','+(_0x157436['Account'][_0xa3ee('0x85')]||0x12c),'interval':_0xa3ee('0x86')}]},routingClient);})[_0xa3ee('0x9')](respondWithResult(_0x5b53f1,null))[_0xa3ee('0xd')](handleError(_0x5b53f1,null));}; \ No newline at end of file +var _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x5d2c64,_0x27bb83){var _0x3d3688=function(_0x1d0530){while(--_0x1d0530){_0x5d2c64['push'](_0x5d2c64['shift']());}};_0x3d3688(++_0x27bb83);}(_0xe14b,0x93));var _0xbe14=function(_0x160b66,_0x1a22eb){_0x160b66=_0x160b66-0x0;var _0x4564af=_0xe14b[_0x160b66];return _0x4564af;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1a7b368..6276337 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 _0x19a8=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x19a8,0x172));var _0x819a=function(_0x149056,_0x1c26ef){_0x149056=_0x149056-0x0;var _0x1606cc=_0x19a8[_0x149056];return _0x1606cc;};'use strict';var multer=require(_0x819a('0x0'));var util=require(_0x819a('0x1'));var path=require(_0x819a('0x2'));var timeout=require(_0x819a('0x3'));var express=require('express');var router=express[_0x819a('0x4')]();var fs_extra=require(_0x819a('0x5'));var auth=require(_0x819a('0x6'));var interaction=require(_0x819a('0x7'));var config=require(_0x819a('0x8'));var controller=require('./schedule.controller');router[_0x819a('0x9')]('/',auth[_0x819a('0xa')](),controller[_0x819a('0xb')]);router[_0x819a('0x9')](_0x819a('0xc'),auth[_0x819a('0xa')](),controller[_0x819a('0xd')]);router[_0x819a('0x9')](_0x819a('0xe'),auth['isAuthenticated'](),controller[_0x819a('0xf')]);router[_0x819a('0x10')]('/',auth['isAuthenticated'](),controller[_0x819a('0x11')]);router[_0x819a('0x12')](_0x819a('0xc'),auth[_0x819a('0xa')](),controller['update']);router[_0x819a('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x819a('0x14')]=router; \ No newline at end of file +var _0x873e=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x119ea4,_0x5816f6){var _0x3cece4=function(_0x4d688d){while(--_0x4d688d){_0x119ea4['push'](_0x119ea4['shift']());}};_0x3cece4(++_0x5816f6);}(_0x873e,0x15a));var _0xe873=function(_0x13c2b1,_0x1dc503){_0x13c2b1=_0x13c2b1-0x0;var _0xf627e0=_0x873e[_0x13c2b1];return _0xf627e0;};'use strict';var multer=require('multer');var util=require(_0xe873('0x0'));var path=require(_0xe873('0x1'));var timeout=require(_0xe873('0x2'));var express=require(_0xe873('0x3'));var router=express[_0xe873('0x4')]();var fs_extra=require(_0xe873('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe873('0x6'));var config=require(_0xe873('0x7'));var controller=require(_0xe873('0x8'));router[_0xe873('0x9')]('/',auth[_0xe873('0xa')](),controller[_0xe873('0xb')]);router[_0xe873('0x9')](_0xe873('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe873('0x9')](_0xe873('0xd'),auth[_0xe873('0xa')](),controller[_0xe873('0xe')]);router[_0xe873('0xf')]('/',auth['isAuthenticated'](),controller[_0xe873('0x10')]);router[_0xe873('0x11')](_0xe873('0xc'),auth[_0xe873('0xa')](),controller[_0xe873('0x12')]);router[_0xe873('0x13')](_0xe873('0xc'),auth[_0xe873('0xa')](),controller[_0xe873('0x14')]);module[_0xe873('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c3fdd92..8aa58de 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 _0xef9d=['minutes','ENUM','csv','xlsx','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours'];(function(_0x2afc7b,_0x33dda7){var _0x391ef4=function(_0x3d906d){while(--_0x3d906d){_0x2afc7b['push'](_0x2afc7b['shift']());}};_0x391ef4(++_0x33dda7);}(_0xef9d,0x1e7));var _0xdef9=function(_0x11da22,_0x5e0518){_0x11da22=_0x11da22-0x0;var _0x3fb326=_0xef9d[_0x11da22];return _0x3fb326;};'use strict';var Sequelize=require(_0xdef9('0x0'));module[_0xdef9('0x1')]={'name':{'type':Sequelize[_0xdef9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdef9('0x2')]},'active':{'type':Sequelize[_0xdef9('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdef9('0x2')],'allowNull':![],'defaultValue':_0xdef9('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xdef9('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdef9('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xdef9('0x7'),_0xdef9('0x8'),_0xdef9('0x9'),_0xdef9('0xa'),_0xdef9('0xb'),_0xdef9('0xc'),_0xdef9('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xdef9('0xe')](_0xdef9('0xf'),'pdf',_0xdef9('0x10')),'allowNull':![],'defaultValue':_0xdef9('0xf')},'type':{'type':Sequelize['ENUM']('custom',_0xdef9('0x11')),'allowNull':![],'defaultValue':_0xdef9('0x12')},'sendMail':{'type':Sequelize[_0xdef9('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xdef9('0x13')]},'bcc':{'type':Sequelize[_0xdef9('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xdef9('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5731=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','TEXT','sequelize','exports','STRING'];(function(_0x273c01,_0x135a13){var _0x14b82a=function(_0x11a91b){while(--_0x11a91b){_0x273c01['push'](_0x273c01['shift']());}};_0x14b82a(++_0x135a13);}(_0x5731,0x165));var _0x1573=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5731[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x1573('0x0'));module[_0x1573('0x1')]={'name':{'type':Sequelize[_0x1573('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1573('0x2')]},'active':{'type':Sequelize[_0x1573('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1573('0x2')],'allowNull':![],'defaultValue':_0x1573('0x4')},'startAt':{'type':Sequelize[_0x1573('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x1573('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1573('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1573('0x7')](_0x1573('0x8'),_0x1573('0x9'),_0x1573('0xa'),_0x1573('0xb'),'days',_0x1573('0xc'),_0x1573('0xd')),'allowNull':![],'defaultValue':_0x1573('0xe')},'output':{'type':Sequelize[_0x1573('0x7')](_0x1573('0xf'),_0x1573('0x10'),_0x1573('0x11')),'allowNull':![],'defaultValue':_0x1573('0xf')},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':_0x1573('0x12')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x1573('0x2')]},'cc':{'type':Sequelize[_0x1573('0x13')]},'bcc':{'type':Sequelize[_0x1573('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x1573('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index f84d75d..811e38f 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 _0x2676=['request-promise','moment','bluebird','util','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','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','index','Schedule','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','eml-format','zip-dir','fast-json-patch'];(function(_0x58010e,_0x283c96){var _0x313a3e=function(_0x16abd6){while(--_0x16abd6){_0x58010e['push'](_0x58010e['shift']());}};_0x313a3e(++_0x283c96);}(_0x2676,0xb3));var _0x6267=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x2676[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0x6267('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6267('0x1'));var jsonpatch=require(_0x6267('0x2'));var rp=require(_0x6267('0x3'));var moment=require(_0x6267('0x4'));var BPromise=require(_0x6267('0x5'));var Mustache=require('mustache');var util=require(_0x6267('0x6'));var path=require(_0x6267('0x7'));var sox=require(_0x6267('0x8'));var csv=require(_0x6267('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6267('0xa'));var _=require(_0x6267('0xb'));var squel=require(_0x6267('0xc'));var crypto=require(_0x6267('0xd'));var jsforce=require(_0x6267('0xe'));var deskjs=require(_0x6267('0xf'));var toCsv=require(_0x6267('0x9'));var querystring=require(_0x6267('0x10'));var Papa=require(_0x6267('0x11'));var Redis=require(_0x6267('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6267('0x13'));var as=require(_0x6267('0x14'));var hardwareService=require(_0x6267('0x15'));var logger=require(_0x6267('0x16'))(_0x6267('0x17'));var utils=require(_0x6267('0x18'));var config=require(_0x6267('0x19'));var licenseUtil=require(_0x6267('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x91f393,_0xebdb69){_0xebdb69=_0xebdb69||0xcc;return function(_0x2131cd){if(_0x2131cd){return _0x91f393['sendStatus'](_0xebdb69);}return _0x91f393[_0x6267('0x1b')](_0xebdb69)[_0x6267('0x1c')]();};}function respondWithResult(_0x57c167,_0x37f779){_0x37f779=_0x37f779||0xc8;return function(_0xc29b9a){if(_0xc29b9a){return _0x57c167[_0x6267('0x1b')](_0x37f779)[_0x6267('0x1d')](_0xc29b9a);}};}function respondWithFilteredResult(_0x254b25,_0x781056){return function(_0x196f88){if(_0x196f88){var _0x2317e3=typeof _0x781056['offset']==='undefined'&&typeof _0x781056['limit']===_0x6267('0x1e');var _0x39c244=_0x196f88[_0x6267('0x1f')];var _0x1fbc17=_0x2317e3?0x0:_0x781056[_0x6267('0x20')];var _0x255aa3=_0x2317e3?_0x196f88[_0x6267('0x1f')]:_0x781056[_0x6267('0x20')]+_0x781056['limit'];var _0x4634ee;if(_0x255aa3>=_0x39c244){_0x255aa3=_0x39c244;_0x4634ee=0xc8;}else{_0x4634ee=0xce;}_0x254b25[_0x6267('0x1b')](_0x4634ee);return _0x254b25[_0x6267('0x21')](_0x6267('0x22'),_0x1fbc17+'-'+_0x255aa3+'/'+_0x39c244)[_0x6267('0x1d')](_0x196f88);}return null;};}function patchUpdates(_0x17354a){return function(_0x927e8e){try{jsonpatch[_0x6267('0x23')](_0x927e8e,_0x17354a,!![]);}catch(_0x3ae4ea){return BPromise[_0x6267('0x24')](_0x3ae4ea);}return _0x927e8e[_0x6267('0x25')]();};}function saveUpdates(_0xb7bd10,_0x11990a){return function(_0x2dd56c){if(_0x2dd56c){return _0x2dd56c[_0x6267('0x26')](_0xb7bd10)[_0x6267('0x27')](function(_0x5c550e){return _0x5c550e;});}return null;};}function removeEntity(_0x3a75d0,_0x2bbe0f){return function(_0xf9c5d2){if(_0xf9c5d2){return _0xf9c5d2[_0x6267('0x28')]()[_0x6267('0x27')](function(){var _0xefd202=_0xf9c5d2[_0x6267('0x29')]({'plain':!![]});var _0x102be9=_0x6267('0x2a');return db[_0x6267('0x2b')][_0x6267('0x28')]({'where':{'type':_0x102be9,'resourceId':_0xefd202['id']}})[_0x6267('0x27')](function(){return _0xf9c5d2;});})['then'](function(){_0x3a75d0[_0x6267('0x1b')](0xcc)[_0x6267('0x1c')]();});}};}function handleEntityNotFound(_0x49aa97,_0xdcbb9b){return function(_0x2dceba){if(!_0x2dceba){_0x49aa97[_0x6267('0x2c')](0x194);}return _0x2dceba;};}function handleError(_0x1386bd,_0x7a2513){_0x7a2513=_0x7a2513||0x1f4;return function(_0x191976){logger[_0x6267('0x2d')](_0x191976[_0x6267('0x2e')]);if(_0x191976[_0x6267('0x2f')]){delete _0x191976[_0x6267('0x2f')];}_0x1386bd[_0x6267('0x1b')](_0x7a2513)['send'](_0x191976);};}exports[_0x6267('0x30')]=function(_0x50a5c7,_0x3f7f9a){var _0x3eec50={},_0x23cf40={},_0x17cf02={'count':0x0,'rows':[]};var _0x2fff9d=_['map'](db[_0x6267('0x31')][_0x6267('0x32')],function(_0x5b1c8b){return{'name':_0x5b1c8b[_0x6267('0x33')],'type':_0x5b1c8b[_0x6267('0x34')][_0x6267('0x35')]};});_0x23cf40[_0x6267('0x36')]=_['map'](_0x2fff9d,'name');_0x23cf40['query']=_[_0x6267('0x37')](_0x50a5c7['query']);_0x23cf40[_0x6267('0x38')]=_[_0x6267('0x39')](_0x23cf40['model'],_0x23cf40[_0x6267('0x3a')]);_0x3eec50['attributes']=_[_0x6267('0x39')](_0x23cf40['model'],qs['fields'](_0x50a5c7[_0x6267('0x3a')][_0x6267('0x3b')]));_0x3eec50[_0x6267('0x3c')]=_0x3eec50[_0x6267('0x3c')][_0x6267('0x3d')]?_0x3eec50[_0x6267('0x3c')]:_0x23cf40[_0x6267('0x36')];if(!_0x50a5c7[_0x6267('0x3a')][_0x6267('0x3e')](_0x6267('0x3f'))){_0x3eec50[_0x6267('0x40')]=qs['limit'](_0x50a5c7[_0x6267('0x3a')][_0x6267('0x40')]);_0x3eec50[_0x6267('0x20')]=qs['offset'](_0x50a5c7[_0x6267('0x3a')]['offset']);}_0x3eec50[_0x6267('0x41')]=qs[_0x6267('0x42')](_0x50a5c7['query']['sort']);_0x3eec50[_0x6267('0x43')]=qs[_0x6267('0x38')](_[_0x6267('0x44')](_0x50a5c7[_0x6267('0x3a')],_0x23cf40['filters']),_0x2fff9d);if(_0x50a5c7['query'][_0x6267('0x45')]){_0x3eec50[_0x6267('0x43')]=_[_0x6267('0x46')](_0x3eec50[_0x6267('0x43')],{'$or':_[_0x6267('0x47')](_0x2fff9d,function(_0x5118c0){if(_0x5118c0[_0x6267('0x34')]!==_0x6267('0x48')){var _0x16a348={};_0x16a348[_0x5118c0['name']]={'$like':'%'+_0x50a5c7[_0x6267('0x3a')][_0x6267('0x45')]+'%'};return _0x16a348;}})});}_0x3eec50=_[_0x6267('0x46')]({},_0x3eec50,_0x50a5c7[_0x6267('0x49')]);var _0x243856={'where':_0x3eec50[_0x6267('0x43')]};return db[_0x6267('0x31')][_0x6267('0x1f')](_0x243856)['then'](function(_0x5c0d2d){_0x17cf02[_0x6267('0x1f')]=_0x5c0d2d;if(_0x50a5c7[_0x6267('0x3a')]['includeAll']){_0x3eec50[_0x6267('0x4a')]=[{'all':!![]}];}return db[_0x6267('0x31')][_0x6267('0x4b')](_0x3eec50);})[_0x6267('0x27')](function(_0x3f3f88){_0x17cf02[_0x6267('0x4c')]=_0x3f3f88;return _0x17cf02;})['then'](respondWithFilteredResult(_0x3f7f9a,_0x3eec50))[_0x6267('0x4d')](handleError(_0x3f7f9a,null));};exports[_0x6267('0x4e')]=function(_0x4edda5,_0x30ff00){var _0x26b3c9={'raw':![],'where':{'id':_0x4edda5['params']['id']}},_0x2f2902={};_0x2f2902[_0x6267('0x36')]=_[_0x6267('0x37')](db['Schedule'][_0x6267('0x32')]);_0x2f2902[_0x6267('0x3a')]=_[_0x6267('0x37')](_0x4edda5[_0x6267('0x3a')]);_0x2f2902[_0x6267('0x38')]=_[_0x6267('0x39')](_0x2f2902[_0x6267('0x36')],_0x2f2902[_0x6267('0x3a')]);_0x26b3c9[_0x6267('0x3c')]=_[_0x6267('0x39')](_0x2f2902[_0x6267('0x36')],qs[_0x6267('0x3b')](_0x4edda5[_0x6267('0x3a')][_0x6267('0x3b')]));_0x26b3c9[_0x6267('0x3c')]=_0x26b3c9['attributes']['length']?_0x26b3c9[_0x6267('0x3c')]:_0x2f2902[_0x6267('0x36')];if(_0x4edda5['query'][_0x6267('0x4f')]){_0x26b3c9[_0x6267('0x4a')]=[{'all':!![]}];}_0x26b3c9=_[_0x6267('0x46')]({},_0x26b3c9,_0x4edda5[_0x6267('0x49')]);return db[_0x6267('0x31')][_0x6267('0x50')](_0x26b3c9)[_0x6267('0x27')](handleEntityNotFound(_0x30ff00,null))['then'](respondWithResult(_0x30ff00,null))[_0x6267('0x4d')](handleError(_0x30ff00,null));};exports[_0x6267('0x51')]=function(_0x395cdf,_0x15f1df){return db[_0x6267('0x31')]['create'](_0x395cdf[_0x6267('0x52')],{})[_0x6267('0x27')](function(_0x5e4e40){var _0x1f2e8a=_0x395cdf[_0x6267('0x53')][_0x6267('0x29')]({'plain':!![]});if(!_0x1f2e8a)throw new Error(_0x6267('0x54'));if(_0x1f2e8a[_0x6267('0x55')]===_0x6267('0x53')){var _0x3eb21d=_0x5e4e40[_0x6267('0x29')]({'plain':!![]});var _0x44bd85='Scheduler';return db[_0x6267('0x56')][_0x6267('0x50')]({'where':{'name':_0x44bd85,'userProfileId':_0x1f2e8a[_0x6267('0x57')]},'raw':!![]})['then'](function(_0x386e35){if(_0x386e35&&_0x386e35['autoAssociation']===0x0){return db[_0x6267('0x2b')][_0x6267('0x51')]({'name':_0x3eb21d['name'],'resourceId':_0x3eb21d['id'],'type':_0x386e35[_0x6267('0x2f')],'sectionId':_0x386e35['id']},{})['then'](function(){return _0x5e4e40;});}else{return _0x5e4e40;}})[_0x6267('0x4d')](function(_0x3d4913){logger['error'](_0x6267('0x58'),_0x3d4913);throw _0x3d4913;});}return _0x5e4e40;})[_0x6267('0x27')](respondWithResult(_0x15f1df,0xc9))['catch'](handleError(_0x15f1df,null));};exports[_0x6267('0x26')]=function(_0x2b194e,_0x8ceb92){if(_0x2b194e[_0x6267('0x52')]['id']){delete _0x2b194e[_0x6267('0x52')]['id'];}return db[_0x6267('0x31')][_0x6267('0x50')]({'where':{'id':_0x2b194e[_0x6267('0x59')]['id']}})[_0x6267('0x27')](handleEntityNotFound(_0x8ceb92,null))[_0x6267('0x27')](saveUpdates(_0x2b194e[_0x6267('0x52')],null))[_0x6267('0x27')](respondWithResult(_0x8ceb92,null))[_0x6267('0x4d')](handleError(_0x8ceb92,null));};exports[_0x6267('0x28')]=function(_0x4c69be,_0x8de641){return db[_0x6267('0x31')][_0x6267('0x50')]({'where':{'id':_0x4c69be[_0x6267('0x59')]['id']}})[_0x6267('0x27')](handleEntityNotFound(_0x8de641,null))[_0x6267('0x27')](removeEntity(_0x8de641,null))[_0x6267('0x4d')](handleError(_0x8de641,null));};exports['run']=function(_0x12e9e7,_0x47bffa,_0x5ae8e4){var _0x237561=require('../../config/schedule');return db[_0x6267('0x31')][_0x6267('0x50')]({'where':{'id':_0x12e9e7[_0x6267('0x59')]['id']},'raw':!![]})[_0x6267('0x27')](handleEntityNotFound(_0x47bffa,null))['then'](function(){_0x237561[_0x6267('0x5a')](_0x12e9e7[_0x6267('0x59')]['id']);})[_0x6267('0x27')](respondWithStatusCode(_0x47bffa,null))[_0x6267('0x4d')](handleError(_0x47bffa,null));}; \ No newline at end of file +var _0x0149=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','destroy','get','Scheduler','then','error','name','index','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','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','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1bb9ac,_0x4a9c94){var _0x3b2409=function(_0x497ec9){while(--_0x497ec9){_0x1bb9ac['push'](_0x1bb9ac['shift']());}};_0x3b2409(++_0x4a9c94);}(_0x0149,0x19d));var _0x9014=function(_0x10d94f,_0x3b235c){_0x10d94f=_0x10d94f-0x0;var _0x4db8dc=_0x0149[_0x10d94f];return _0x4db8dc;};'use strict';var emlformat=require(_0x9014('0x0'));var rimraf=require(_0x9014('0x1'));var zipdir=require(_0x9014('0x2'));var jsonpatch=require(_0x9014('0x3'));var rp=require(_0x9014('0x4'));var moment=require(_0x9014('0x5'));var BPromise=require(_0x9014('0x6'));var Mustache=require(_0x9014('0x7'));var util=require(_0x9014('0x8'));var path=require(_0x9014('0x9'));var sox=require(_0x9014('0xa'));var csv=require(_0x9014('0xb'));var ejs=require(_0x9014('0xc'));var fs=require('fs');var fs_extra=require(_0x9014('0xd'));var _=require('lodash');var squel=require(_0x9014('0xe'));var crypto=require(_0x9014('0xf'));var jsforce=require(_0x9014('0x10'));var deskjs=require(_0x9014('0x11'));var toCsv=require(_0x9014('0xb'));var querystring=require(_0x9014('0x12'));var Papa=require(_0x9014('0x13'));var Redis=require(_0x9014('0x14'));var authService=require(_0x9014('0x15'));var qs=require(_0x9014('0x16'));var as=require(_0x9014('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9014('0x18'));var utils=require(_0x9014('0x19'));var config=require(_0x9014('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x9014('0x1b'))['db'];function respondWithStatusCode(_0x32d70b,_0x166faa){_0x166faa=_0x166faa||0xcc;return function(_0xc63e72){if(_0xc63e72){return _0x32d70b[_0x9014('0x1c')](_0x166faa);}return _0x32d70b[_0x9014('0x1d')](_0x166faa)[_0x9014('0x1e')]();};}function respondWithResult(_0x349e9e,_0x5363c8){_0x5363c8=_0x5363c8||0xc8;return function(_0x2b952f){if(_0x2b952f){return _0x349e9e[_0x9014('0x1d')](_0x5363c8)['json'](_0x2b952f);}};}function respondWithFilteredResult(_0x5002b7,_0x2fe920){return function(_0xecd267){if(_0xecd267){var _0x1c8520=typeof _0x2fe920[_0x9014('0x1f')]==='undefined'&&typeof _0x2fe920[_0x9014('0x20')]===_0x9014('0x21');var _0x7220c0=_0xecd267[_0x9014('0x22')];var _0x31eb14=_0x1c8520?0x0:_0x2fe920[_0x9014('0x1f')];var _0x161eaf=_0x1c8520?_0xecd267['count']:_0x2fe920[_0x9014('0x1f')]+_0x2fe920[_0x9014('0x20')];var _0x24c245;if(_0x161eaf>=_0x7220c0){_0x161eaf=_0x7220c0;_0x24c245=0xc8;}else{_0x24c245=0xce;}_0x5002b7[_0x9014('0x1d')](_0x24c245);return _0x5002b7['set'](_0x9014('0x23'),_0x31eb14+'-'+_0x161eaf+'/'+_0x7220c0)[_0x9014('0x24')](_0xecd267);}return null;};}function patchUpdates(_0x4a6ddc){return function(_0x26ab55){try{jsonpatch[_0x9014('0x25')](_0x26ab55,_0x4a6ddc,!![]);}catch(_0x541f4c){return BPromise['reject'](_0x541f4c);}return _0x26ab55[_0x9014('0x26')]();};}function saveUpdates(_0x5b92e3,_0x1c06c2){return function(_0x4e62f4){if(_0x4e62f4){return _0x4e62f4[_0x9014('0x27')](_0x5b92e3)['then'](function(_0x5ea42c){return _0x5ea42c;});}return null;};}function removeEntity(_0x2cf82e,_0x6093fb){return function(_0x1c044a){if(_0x1c044a){return _0x1c044a[_0x9014('0x28')]()['then'](function(){var _0x2e119f=_0x1c044a[_0x9014('0x29')]({'plain':!![]});var _0x482f26=_0x9014('0x2a');return db['UserProfileResource'][_0x9014('0x28')]({'where':{'type':_0x482f26,'resourceId':_0x2e119f['id']}})[_0x9014('0x2b')](function(){return _0x1c044a;});})[_0x9014('0x2b')](function(){_0x2cf82e[_0x9014('0x1d')](0xcc)[_0x9014('0x1e')]();});}};}function handleEntityNotFound(_0x327062,_0x5edce7){return function(_0x511a7d){if(!_0x511a7d){_0x327062[_0x9014('0x1c')](0x194);}return _0x511a7d;};}function handleError(_0x55bab8,_0x459167){_0x459167=_0x459167||0x1f4;return function(_0x215ff7){logger[_0x9014('0x2c')](_0x215ff7['stack']);if(_0x215ff7[_0x9014('0x2d')]){delete _0x215ff7['name'];}_0x55bab8[_0x9014('0x1d')](_0x459167)['send'](_0x215ff7);};}exports[_0x9014('0x2e')]=function(_0x28e176,_0x51af07){var _0x3932c8={},_0x442104={},_0x5e514f={'count':0x0,'rows':[]};var _0x3e7007=_['map'](db[_0x9014('0x2f')]['rawAttributes'],function(_0x1cc2cf){return{'name':_0x1cc2cf[_0x9014('0x30')],'type':_0x1cc2cf[_0x9014('0x31')][_0x9014('0x32')]};});_0x442104[_0x9014('0x33')]=_['map'](_0x3e7007,_0x9014('0x2d'));_0x442104[_0x9014('0x34')]=_[_0x9014('0x35')](_0x28e176[_0x9014('0x34')]);_0x442104[_0x9014('0x36')]=_[_0x9014('0x37')](_0x442104[_0x9014('0x33')],_0x442104[_0x9014('0x34')]);_0x3932c8[_0x9014('0x38')]=_['intersection'](_0x442104[_0x9014('0x33')],qs[_0x9014('0x39')](_0x28e176[_0x9014('0x34')][_0x9014('0x39')]));_0x3932c8[_0x9014('0x38')]=_0x3932c8[_0x9014('0x38')]['length']?_0x3932c8['attributes']:_0x442104[_0x9014('0x33')];if(!_0x28e176[_0x9014('0x34')][_0x9014('0x3a')]('nolimit')){_0x3932c8[_0x9014('0x20')]=qs[_0x9014('0x20')](_0x28e176[_0x9014('0x34')][_0x9014('0x20')]);_0x3932c8[_0x9014('0x1f')]=qs['offset'](_0x28e176[_0x9014('0x34')][_0x9014('0x1f')]);}_0x3932c8[_0x9014('0x3b')]=qs[_0x9014('0x3c')](_0x28e176[_0x9014('0x34')][_0x9014('0x3c')]);_0x3932c8['where']=qs[_0x9014('0x36')](_[_0x9014('0x3d')](_0x28e176['query'],_0x442104[_0x9014('0x36')]),_0x3e7007);if(_0x28e176['query'][_0x9014('0x3e')]){_0x3932c8[_0x9014('0x3f')]=_[_0x9014('0x40')](_0x3932c8[_0x9014('0x3f')],{'$or':_[_0x9014('0x41')](_0x3e7007,function(_0x448609){if(_0x448609[_0x9014('0x31')]!==_0x9014('0x42')){var _0x2b96c3={};_0x2b96c3[_0x448609[_0x9014('0x2d')]]={'$like':'%'+_0x28e176['query'][_0x9014('0x3e')]+'%'};return _0x2b96c3;}})});}_0x3932c8=_['merge']({},_0x3932c8,_0x28e176[_0x9014('0x43')]);var _0xab3e66={'where':_0x3932c8['where']};return db[_0x9014('0x2f')][_0x9014('0x22')](_0xab3e66)[_0x9014('0x2b')](function(_0xa91f15){_0x5e514f['count']=_0xa91f15;if(_0x28e176[_0x9014('0x34')][_0x9014('0x44')]){_0x3932c8[_0x9014('0x45')]=[{'all':!![]}];}return db['Schedule'][_0x9014('0x46')](_0x3932c8);})[_0x9014('0x2b')](function(_0x264310){_0x5e514f[_0x9014('0x47')]=_0x264310;return _0x5e514f;})[_0x9014('0x2b')](respondWithFilteredResult(_0x51af07,_0x3932c8))[_0x9014('0x48')](handleError(_0x51af07,null));};exports[_0x9014('0x49')]=function(_0x5d4086,_0x1a5883){var _0x219a47={'raw':![],'where':{'id':_0x5d4086[_0x9014('0x4a')]['id']}},_0x58205f={};_0x58205f[_0x9014('0x33')]=_['keys'](db['Schedule'][_0x9014('0x4b')]);_0x58205f[_0x9014('0x34')]=_[_0x9014('0x35')](_0x5d4086[_0x9014('0x34')]);_0x58205f[_0x9014('0x36')]=_['intersection'](_0x58205f[_0x9014('0x33')],_0x58205f[_0x9014('0x34')]);_0x219a47['attributes']=_[_0x9014('0x37')](_0x58205f[_0x9014('0x33')],qs[_0x9014('0x39')](_0x5d4086['query'][_0x9014('0x39')]));_0x219a47[_0x9014('0x38')]=_0x219a47[_0x9014('0x38')][_0x9014('0x4c')]?_0x219a47['attributes']:_0x58205f[_0x9014('0x33')];if(_0x5d4086['query'][_0x9014('0x44')]){_0x219a47[_0x9014('0x45')]=[{'all':!![]}];}_0x219a47=_['merge']({},_0x219a47,_0x5d4086[_0x9014('0x43')]);return db[_0x9014('0x2f')][_0x9014('0x4d')](_0x219a47)[_0x9014('0x2b')](handleEntityNotFound(_0x1a5883,null))[_0x9014('0x2b')](respondWithResult(_0x1a5883,null))['catch'](handleError(_0x1a5883,null));};exports['create']=function(_0xe85efd,_0x17dfa1){return db[_0x9014('0x2f')][_0x9014('0x4e')](_0xe85efd['body'],{})[_0x9014('0x2b')](function(_0x5d66dc){var _0x53825d=_0xe85efd[_0x9014('0x4f')][_0x9014('0x29')]({'plain':!![]});if(!_0x53825d)throw new Error(_0x9014('0x50'));if(_0x53825d[_0x9014('0x51')]===_0x9014('0x4f')){var _0x33b474=_0x5d66dc[_0x9014('0x29')]({'plain':!![]});var _0x79daf9=_0x9014('0x2a');return db[_0x9014('0x52')]['find']({'where':{'name':_0x79daf9,'userProfileId':_0x53825d[_0x9014('0x53')]},'raw':!![]})[_0x9014('0x2b')](function(_0x443091){if(_0x443091&&_0x443091['autoAssociation']===0x0){return db['UserProfileResource'][_0x9014('0x4e')]({'name':_0x33b474[_0x9014('0x2d')],'resourceId':_0x33b474['id'],'type':_0x443091[_0x9014('0x2d')],'sectionId':_0x443091['id']},{})[_0x9014('0x2b')](function(){return _0x5d66dc;});}else{return _0x5d66dc;}})[_0x9014('0x48')](function(_0xfbf416){logger['error'](_0x9014('0x54'),_0xfbf416);throw _0xfbf416;});}return _0x5d66dc;})['then'](respondWithResult(_0x17dfa1,0xc9))['catch'](handleError(_0x17dfa1,null));};exports[_0x9014('0x27')]=function(_0x3b8d51,_0xcb729a){if(_0x3b8d51[_0x9014('0x55')]['id']){delete _0x3b8d51[_0x9014('0x55')]['id'];}return db[_0x9014('0x2f')]['find']({'where':{'id':_0x3b8d51[_0x9014('0x4a')]['id']}})[_0x9014('0x2b')](handleEntityNotFound(_0xcb729a,null))[_0x9014('0x2b')](saveUpdates(_0x3b8d51[_0x9014('0x55')],null))['then'](respondWithResult(_0xcb729a,null))[_0x9014('0x48')](handleError(_0xcb729a,null));};exports[_0x9014('0x28')]=function(_0x2955cf,_0x262348){return db[_0x9014('0x2f')][_0x9014('0x4d')]({'where':{'id':_0x2955cf[_0x9014('0x4a')]['id']}})[_0x9014('0x2b')](handleEntityNotFound(_0x262348,null))[_0x9014('0x2b')](removeEntity(_0x262348,null))[_0x9014('0x48')](handleError(_0x262348,null));};exports['run']=function(_0x450a3a,_0x4b3c43,_0x4f65f0){var _0x1dbb3f=require(_0x9014('0x56'));return db['Schedule']['find']({'where':{'id':_0x450a3a['params']['id']},'raw':!![]})[_0x9014('0x2b')](handleEntityNotFound(_0x4b3c43,null))[_0x9014('0x2b')](function(){_0x1dbb3f['run'](_0x450a3a[_0x9014('0x4a')]['id']);})[_0x9014('0x2b')](respondWithStatusCode(_0x4b3c43,null))[_0x9014('0x48')](handleError(_0x4b3c43,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index e781cd4..73378d2 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 _0x3b9e=['util','../../config/logger','api','moment','bluebird','request-promise','./schedule.attributes','Schedule','lodash'];(function(_0x9a138c,_0x2607f8){var _0x3771a3=function(_0x22ebbb){while(--_0x22ebbb){_0x9a138c['push'](_0x9a138c['shift']());}};_0x3771a3(++_0x2607f8);}(_0x3b9e,0x170));var _0xe3b9=function(_0xb56647,_0x51680e){_0xb56647=_0xb56647-0x0;var _0x8e213c=_0x3b9e[_0xb56647];return _0x8e213c;};'use strict';var _=require(_0xe3b9('0x0'));var util=require(_0xe3b9('0x1'));var logger=require(_0xe3b9('0x2'))(_0xe3b9('0x3'));var moment=require(_0xe3b9('0x4'));var BPromise=require(_0xe3b9('0x5'));var rp=require(_0xe3b9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe3b9('0x7'));module['exports']=function(_0x2dcc36,_0x25ccb4){return _0x2dcc36['define'](_0xe3b9('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f86=['../../config/environment','./schedule.attributes','exports','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x8f86,0xa0));var _0x68f8=function(_0x50a0c6,_0x2549df){_0x50a0c6=_0x50a0c6-0x0;var _0x56b675=_0x8f86[_0x50a0c6];return _0x56b675;};'use strict';var _=require(_0x68f8('0x0'));var util=require(_0x68f8('0x1'));var logger=require(_0x68f8('0x2'))(_0x68f8('0x3'));var moment=require(_0x68f8('0x4'));var BPromise=require(_0x68f8('0x5'));var rp=require(_0x68f8('0x6'));var fs=require('fs');var path=require(_0x68f8('0x7'));var rimraf=require(_0x68f8('0x8'));var config=require(_0x68f8('0x9'));var attributes=require(_0x68f8('0xa'));module[_0x68f8('0xb')]=function(_0x1aa3eb,_0x349ab7){return _0x1aa3eb['define']('Schedule',attributes,{'tableName':_0x68f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index c0b9fbc..faa0dc5 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 _0x8373=['debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x44da89,_0x4de7d0){var _0x5b7ad0=function(_0x4f646f){while(--_0x4f646f){_0x44da89['push'](_0x44da89['shift']());}};_0x5b7ad0(++_0x4de7d0);}(_0x8373,0x136));var _0x3837=function(_0x287b3a,_0x392aed){_0x287b3a=_0x287b3a-0x0;var _0x3489c3=_0x8373[_0x287b3a];return _0x3489c3;};'use strict';var _=require(_0x3837('0x0'));var util=require(_0x3837('0x1'));var moment=require('moment');var BPromise=require(_0x3837('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3837('0x3'));var logger=require(_0x3837('0x4'))(_0x3837('0x5'));var config=require('../../config/environment');var jayson=require(_0x3837('0x6'));var client=jayson[_0x3837('0x7')][_0x3837('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c6d5a,_0x1ce723,_0x2f4c42){return new BPromise(function(_0x4ef70d,_0xe1ac81){return client[_0x3837('0x9')](_0x5c6d5a,_0x2f4c42)['then'](function(_0x1eeb54){logger[_0x3837('0xa')](_0x3837('0xb'),_0x1ce723,_0x3837('0xc'));logger[_0x3837('0xd')](_0x3837('0xe'),_0x1ce723,_0x3837('0xc'),JSON['stringify'](_0x1eeb54));if(_0x1eeb54[_0x3837('0xf')]){if(_0x1eeb54[_0x3837('0xf')][_0x3837('0x10')]===0x1f4){logger[_0x3837('0xf')](_0x3837('0xb'),_0x1ce723,_0x1eeb54[_0x3837('0xf')][_0x3837('0x11')]);return _0xe1ac81(_0x1eeb54['error']['message']);}logger[_0x3837('0xf')](_0x3837('0xb'),_0x1ce723,_0x1eeb54[_0x3837('0xf')][_0x3837('0x11')]);return _0x4ef70d(_0x1eeb54[_0x3837('0xf')]['message']);}else{logger['info'](_0x3837('0xb'),_0x1ce723,_0x3837('0xc'));_0x4ef70d(_0x1eeb54['result'][_0x3837('0x11')]);}})[_0x3837('0x12')](function(_0x2786f6){logger['error'](_0x3837('0xb'),_0x1ce723,_0x2786f6);_0xe1ac81(_0x2786f6);});});} \ No newline at end of file +var _0xf838=['error','message','info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Schedule,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2266f8,_0x370b59){var _0xeee5f8=function(_0x181b09){while(--_0x181b09){_0x2266f8['push'](_0x2266f8['shift']());}};_0xeee5f8(++_0x370b59);}(_0xf838,0xdc));var _0x8f83=function(_0x10d636,_0x29eaec){_0x10d636=_0x10d636-0x0;var _0x3b27a2=_0xf838[_0x10d636];return _0x3b27a2;};'use strict';var _=require(_0x8f83('0x0'));var util=require(_0x8f83('0x1'));var moment=require('moment');var BPromise=require(_0x8f83('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f83('0x3'))['db'];var utils=require(_0x8f83('0x4'));var logger=require(_0x8f83('0x5'))(_0x8f83('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f83('0x7'));var client=jayson[_0x8f83('0x8')][_0x8f83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d486a,_0x25c0cc,_0x2e4d42){return new BPromise(function(_0x485307,_0x24668c){return client[_0x8f83('0xa')](_0x4d486a,_0x2e4d42)['then'](function(_0x24875d){logger['info'](_0x8f83('0xb'),_0x25c0cc,'request\x20sent');logger[_0x8f83('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x25c0cc,_0x8f83('0xd'),JSON['stringify'](_0x24875d));if(_0x24875d[_0x8f83('0xe')]){if(_0x24875d[_0x8f83('0xe')]['code']===0x1f4){logger[_0x8f83('0xe')](_0x8f83('0xb'),_0x25c0cc,_0x24875d[_0x8f83('0xe')][_0x8f83('0xf')]);return _0x24668c(_0x24875d[_0x8f83('0xe')][_0x8f83('0xf')]);}logger[_0x8f83('0xe')]('Schedule,\x20%s,\x20%s',_0x25c0cc,_0x24875d[_0x8f83('0xe')][_0x8f83('0xf')]);return _0x485307(_0x24875d[_0x8f83('0xe')][_0x8f83('0xf')]);}else{logger[_0x8f83('0x10')](_0x8f83('0xb'),_0x25c0cc,'request\x20sent');_0x485307(_0x24875d['result'][_0x8f83('0xf')]);}})[_0x8f83('0x11')](function(_0x317e38){logger['error'](_0x8f83('0xb'),_0x25c0cc,_0x317e38);_0x24668c(_0x317e38);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 060ee86..7d22091 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 _0xcf8d=['express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','download','post','put','update','delete','destroy','multer','util'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xcf8d,0x1a0));var _0xdcf8=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xcf8d[_0x533e4e];return _0x1f14bb;};'use strict';var multer=require(_0xdcf8('0x0'));var util=require(_0xdcf8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdcf8('0x2'));var router=express[_0xdcf8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdcf8('0x4'));var config=require(_0xdcf8('0x5'));var controller=require(_0xdcf8('0x6'));router[_0xdcf8('0x7')]('/',auth[_0xdcf8('0x8')](),controller[_0xdcf8('0x9')]);router[_0xdcf8('0x7')](_0xdcf8('0xa'),auth[_0xdcf8('0x8')](),controller[_0xdcf8('0xb')]);router[_0xdcf8('0x7')](_0xdcf8('0xc'),auth[_0xdcf8('0x8')](),controller['show']);router[_0xdcf8('0x7')]('/:id/download',auth[_0xdcf8('0x8')](),controller[_0xdcf8('0xd')]);router[_0xdcf8('0xe')]('/',auth[_0xdcf8('0x8')](),controller['create']);router[_0xdcf8('0xf')](_0xdcf8('0xc'),auth[_0xdcf8('0x8')](),controller[_0xdcf8('0x10')]);router[_0xdcf8('0x11')](_0xdcf8('0xc'),auth['isAuthenticated'](),controller[_0xdcf8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9239=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x9239,0x188));var _0x9923=function(_0x3c9e00,_0x4a7154){_0x3c9e00=_0x3c9e00-0x0;var _0x10186c=_0x9239[_0x3c9e00];return _0x10186c;};'use strict';var multer=require(_0x9923('0x0'));var util=require(_0x9923('0x1'));var path=require(_0x9923('0x2'));var timeout=require(_0x9923('0x3'));var express=require('express');var router=express[_0x9923('0x4')]();var fs_extra=require(_0x9923('0x5'));var auth=require(_0x9923('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9923('0x7'));var controller=require(_0x9923('0x8'));router[_0x9923('0x9')]('/',auth[_0x9923('0xa')](),controller[_0x9923('0xb')]);router['get'](_0x9923('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9923('0x9')](_0x9923('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9923('0x9')](_0x9923('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x9923('0xf')]('/',auth['isAuthenticated'](),controller[_0x9923('0x10')]);router[_0x9923('0x11')](_0x9923('0xd'),auth[_0x9923('0xa')](),controller[_0x9923('0x12')]);router[_0x9923('0x13')](_0x9923('0xd'),auth[_0x9923('0xa')](),controller['destroy']);module[_0x9923('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 c268ef3..d6bb41f 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 _0xb4b6=['value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0xb4b6,0x7e));var _0x6b4b=function(_0xcc4c8e,_0x3d4ba3){_0xcc4c8e=_0xcc4c8e-0x0;var _0x2e4038=_0xb4b6[_0xcc4c8e];return _0x2e4038;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6b4b('0x0'));var path=require(_0x6b4b('0x1'));var config=require(_0x6b4b('0x2'));module[_0x6b4b('0x3')]={'format':{'type':Sequelize[_0x6b4b('0x4')],'get':function(){return this[_0x6b4b('0x5')](_0x6b4b('0x6'))?path[_0x6b4b('0x7')](this[_0x6b4b('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x6b4b('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x6b4b('0x8')],'set':function(_0x25eef2){var _0x8b279d=_0x25eef2[_0x6b4b('0x9')](/\\/g,'/');this[_0x6b4b('0xa')]('value',_0x8b279d);}},'rating':{'type':Sequelize[_0x6b4b('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6b4b('0xb')],'set':function(_0x40b391){this[_0x6b4b('0xa')](_0x6b4b('0xc'),moment()[_0x6b4b('0xd')](_0x40b391,'ms'));this[_0x6b4b('0xa')](_0x6b4b('0xe'),moment());this['setDataValue'](_0x6b4b('0xf'),_0x40b391);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6b4b('0x5')](_0x6b4b('0xc')))[_0x6b4b('0x10')](_0x6b4b('0x11'))[_0x6b4b('0x12')]();}},'closedAt':{'type':Sequelize[_0x6b4b('0x13')],'get':function(){return moment(this[_0x6b4b('0x5')]('closedAt'))[_0x6b4b('0x10')](_0x6b4b('0x11'))[_0x6b4b('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x6b4b('0x14')))[_0x6b4b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x6b4b('0x12')]();}},'updatedAt':{'type':Sequelize[_0x6b4b('0x13')],'get':function(){return moment(this[_0x6b4b('0x5')](_0x6b4b('0x15')))[_0x6b4b('0x10')](_0x6b4b('0x11'))[_0x6b4b('0x12')]();}}}; \ No newline at end of file +var _0x7e74=['replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING'];(function(_0x3b332f,_0x35fb82){var _0x86408=function(_0x182680){while(--_0x182680){_0x3b332f['push'](_0x3b332f['shift']());}};_0x86408(++_0x35fb82);}(_0x7e74,0xbd));var _0x47e7=function(_0x4b1c2a,_0x9e5a4a){_0x4b1c2a=_0x4b1c2a-0x0;var _0x103cbe=_0x7e74[_0x4b1c2a];return _0x103cbe;};'use strict';var Sequelize=require(_0x47e7('0x0'));var moment=require('moment');var path=require(_0x47e7('0x1'));var config=require(_0x47e7('0x2'));module[_0x47e7('0x3')]={'format':{'type':Sequelize[_0x47e7('0x4')],'get':function(){return this[_0x47e7('0x5')]('value')?path[_0x47e7('0x6')](this[_0x47e7('0x5')](_0x47e7('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x47e7('0x8')]},'channel':{'type':Sequelize[_0x47e7('0x8')]},'value':{'type':Sequelize[_0x47e7('0x8')],'set':function(_0x412d3e){var _0x50fc6c=_0x412d3e[_0x47e7('0x9')](/\\/g,'/');this['setDataValue'](_0x47e7('0x7'),_0x50fc6c);}},'rating':{'type':Sequelize[_0x47e7('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x47e7('0xa')],'set':function(_0x2f66c0){this[_0x47e7('0xb')](_0x47e7('0xc'),moment()[_0x47e7('0xd')](_0x2f66c0,'ms'));this[_0x47e7('0xb')](_0x47e7('0xe'),moment());this[_0x47e7('0xb')](_0x47e7('0xf'),_0x2f66c0);}},'startedAt':{'type':Sequelize[_0x47e7('0x10')],'get':function(){return moment(this[_0x47e7('0x5')]('startedAt'))[_0x47e7('0x11')](_0x47e7('0x12'))[_0x47e7('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x47e7('0x5')](_0x47e7('0xe')))[_0x47e7('0x11')](_0x47e7('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x47e7('0x10')],'get':function(){return moment(this[_0x47e7('0x5')](_0x47e7('0x14')))[_0x47e7('0x11')](_0x47e7('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x47e7('0x10')],'get':function(){return moment(this['getDataValue'](_0x47e7('0x15')))[_0x47e7('0x11')](_0x47e7('0x12'))[_0x47e7('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 0a0f0fd..6d9e701 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 _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x226af0,_0x498806){var _0x6cbde=function(_0x22a4e3){while(--_0x22a4e3){_0x226af0['push'](_0x226af0['shift']());}};_0x6cbde(++_0x498806);}(_0x98a8,0x12c));var _0x898a=function(_0x4fb127,_0x46e4ee){_0x4fb127=_0x4fb127-0x0;var _0x2941e9=_0x98a8[_0x4fb127];return _0x2941e9;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));}; \ No newline at end of file +var _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x280c03,_0x5ba994){var _0x5e271e=function(_0x2fbc31){while(--_0x2fbc31){_0x280c03['push'](_0x280c03['shift']());}};_0x5e271e(++_0x5ba994);}(_0x5fd1,0x155));var _0x15fd=function(_0x2391d4,_0x370bda){_0x2391d4=_0x2391d4-0x0;var _0x55d482=_0x5fd1[_0x2391d4];return _0x55d482;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e2429ba..d5db4e9 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 _0xa710=['define','ScreenRecording','interactionid','lodash','../../config/logger','request-promise','path','./screenRecording.attributes','exports'];(function(_0x307eb8,_0x24ac03){var _0x424443=function(_0x5901a9){while(--_0x5901a9){_0x307eb8['push'](_0x307eb8['shift']());}};_0x424443(++_0x24ac03);}(_0xa710,0x150));var _0x0a71=function(_0x2daedb,_0x3a2eb5){_0x2daedb=_0x2daedb-0x0;var _0x3e7747=_0xa710[_0x2daedb];return _0x3e7747;};'use strict';var _=require(_0x0a71('0x0'));var util=require('util');var logger=require(_0x0a71('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a71('0x2'));var fs=require('fs');var path=require(_0x0a71('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a71('0x4'));module[_0x0a71('0x5')]=function(_0x285bbf,_0x45b758){return _0x285bbf[_0x0a71('0x6')](_0x0a71('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x0a71('0x8'),'fields':[_0x0a71('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c6f=['request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x1c6f,0x144));var _0xf1c6=function(_0x684a4a,_0x5f3a66){_0x684a4a=_0x684a4a-0x0;var _0x168466=_0x1c6f[_0x684a4a];return _0x168466;};'use strict';var _=require(_0xf1c6('0x0'));var util=require(_0xf1c6('0x1'));var logger=require(_0xf1c6('0x2'))(_0xf1c6('0x3'));var moment=require(_0xf1c6('0x4'));var BPromise=require(_0xf1c6('0x5'));var rp=require(_0xf1c6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1c6('0x7'));var config=require(_0xf1c6('0x8'));var attributes=require(_0xf1c6('0x9'));module[_0xf1c6('0xa')]=function(_0x569850,_0x47cbf3){return _0x569850[_0xf1c6('0xb')](_0xf1c6('0xc'),attributes,{'tableName':_0xf1c6('0xd'),'paranoid':![],'indexes':[{'name':_0xf1c6('0xe'),'fields':[_0xf1c6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 023c8b8..98f87bb 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 _0x211a=['../../config/utils','../../config/logger','rpc','http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x264358,_0x55f75b){var _0x4125e0=function(_0x1b2839){while(--_0x1b2839){_0x264358['push'](_0x264358['shift']());}};_0x4125e0(++_0x55f75b);}(_0x211a,0x1f3));var _0xa211=function(_0x8a9d7e,_0x19a827){_0x8a9d7e=_0x8a9d7e-0x0;var _0x3fb9b7=_0x211a[_0x8a9d7e];return _0x3fb9b7;};'use strict';var _=require(_0xa211('0x0'));var util=require(_0xa211('0x1'));var moment=require('moment');var BPromise=require(_0xa211('0x2'));var rs=require(_0xa211('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa211('0x4'))['db'];var utils=require(_0xa211('0x5'));var logger=require(_0xa211('0x6'))(_0xa211('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa211('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322a16,_0x12248e,_0x30c9d4){return new BPromise(function(_0xf0afa9,_0x187a85){return client['request'](_0x322a16,_0x30c9d4)['then'](function(_0x254b77){logger[_0xa211('0x9')](_0xa211('0xa'),_0x12248e,_0xa211('0xb'));logger['debug'](_0xa211('0xc'),_0x12248e,'request\x20sent',JSON[_0xa211('0xd')](_0x254b77));if(_0x254b77['error']){if(_0x254b77['error'][_0xa211('0xe')]===0x1f4){logger[_0xa211('0xf')](_0xa211('0xa'),_0x12248e,_0x254b77[_0xa211('0xf')][_0xa211('0x10')]);return _0x187a85(_0x254b77[_0xa211('0xf')][_0xa211('0x10')]);}logger[_0xa211('0xf')](_0xa211('0xa'),_0x12248e,_0x254b77[_0xa211('0xf')][_0xa211('0x10')]);return _0xf0afa9(_0x254b77['error'][_0xa211('0x10')]);}else{logger['info'](_0xa211('0xa'),_0x12248e,_0xa211('0xb'));_0xf0afa9(_0x254b77['result'][_0xa211('0x10')]);}})[_0xa211('0x11')](function(_0x539453){logger[_0xa211('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x12248e,_0x539453);_0x187a85(_0x539453);});});} \ No newline at end of file +var _0x2498=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x5d27bc,_0x3a7b60){var _0x5734cc=function(_0xcc5c8f){while(--_0xcc5c8f){_0x5d27bc['push'](_0x5d27bc['shift']());}};_0x5734cc(++_0x3a7b60);}(_0x2498,0x188));var _0x8249=function(_0x16bc2e,_0x1f64fb){_0x16bc2e=_0x16bc2e-0x0;var _0x1a9611=_0x2498[_0x16bc2e];return _0x1a9611;};'use strict';var _=require('lodash');var util=require(_0x8249('0x0'));var moment=require(_0x8249('0x1'));var BPromise=require(_0x8249('0x2'));var rs=require(_0x8249('0x3'));var fs=require('fs');var Redis=require(_0x8249('0x4'));var db=require(_0x8249('0x5'))['db'];var utils=require(_0x8249('0x6'));var logger=require(_0x8249('0x7'))(_0x8249('0x8'));var config=require(_0x8249('0x9'));var jayson=require(_0x8249('0xa'));var client=jayson[_0x8249('0xb')][_0x8249('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3de2ee,_0x4d5856,_0x6db58b){return new BPromise(function(_0x2144d5,_0x297d82){return client['request'](_0x3de2ee,_0x6db58b)[_0x8249('0xd')](function(_0x44edb5){logger[_0x8249('0xe')](_0x8249('0xf'),_0x4d5856,_0x8249('0x10'));logger[_0x8249('0x11')](_0x8249('0x12'),_0x4d5856,_0x8249('0x10'),JSON[_0x8249('0x13')](_0x44edb5));if(_0x44edb5['error']){if(_0x44edb5['error'][_0x8249('0x14')]===0x1f4){logger['error'](_0x8249('0xf'),_0x4d5856,_0x44edb5[_0x8249('0x15')][_0x8249('0x16')]);return _0x297d82(_0x44edb5[_0x8249('0x15')]['message']);}logger['error'](_0x8249('0xf'),_0x4d5856,_0x44edb5[_0x8249('0x15')][_0x8249('0x16')]);return _0x2144d5(_0x44edb5[_0x8249('0x15')]['message']);}else{logger[_0x8249('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x4d5856,'request\x20sent');_0x2144d5(_0x44edb5['result'][_0x8249('0x16')]);}})[_0x8249('0x17')](function(_0x5e181e){logger[_0x8249('0x15')](_0x8249('0xf'),_0x4d5856,_0x5e181e);_0x297d82(_0x5e181e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 31fd012..05d8c41 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 _0xb98d=['join','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','diskStorage','root','logologin','extname','addLogoLogin','%s%s','preferred','addPreferred','favicon','addFavicon','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb98d,0x9c));var _0xdb98=function(_0x2bacd1,_0x1efeed){_0x2bacd1=_0x2bacd1-0x0;var _0x5c93d9=_0xb98d[_0x2bacd1];return _0x5c93d9;};'use strict';var multer=require(_0xdb98('0x0'));var util=require(_0xdb98('0x1'));var path=require(_0xdb98('0x2'));var timeout=require(_0xdb98('0x3'));var express=require(_0xdb98('0x4'));var router=express['Router']();var fs_extra=require(_0xdb98('0x5'));var auth=require(_0xdb98('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb98('0x7'));var controller=require('./setting.controller');router[_0xdb98('0x8')]('/',auth['isAuthenticated'](),controller[_0xdb98('0x9')]);router[_0xdb98('0x8')]('/now',controller[_0xdb98('0xa')]);router['get']('/:id',controller[_0xdb98('0xb')]);router[_0xdb98('0x8')](_0xdb98('0xc'),controller['getLogo']);router[_0xdb98('0x8')](_0xdb98('0xd'),controller[_0xdb98('0xe')]);router[_0xdb98('0x8')](_0xdb98('0xf'),controller[_0xdb98('0x10')]);router[_0xdb98('0x8')](_0xdb98('0x11'),controller['getPreferred']);router[_0xdb98('0x8')](_0xdb98('0x12'),controller[_0xdb98('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14c811,_0x5354e8,_0x43c3bb){_0x43c3bb(null,path[_0xdb98('0x14')](config['root'],_0xdb98('0x15')));},'filename':function(_0x4ca58c,_0x2dd9fa,_0x3e9103){_0x3e9103(null,util[_0xdb98('0x16')]('%s%s',_0xdb98('0x17'),path['extname'](_0x2dd9fa[_0xdb98('0x18')])));}})});router[_0xdb98('0x19')]('/:id/logo',upload[_0xdb98('0x1a')](_0xdb98('0x1b')),controller[_0xdb98('0x1c')]);var upload=multer({'storage':multer[_0xdb98('0x1d')]({'destination':function(_0x4153d0,_0x3c57d2,_0xbf3917){_0xbf3917(null,path[_0xdb98('0x14')](config[_0xdb98('0x1e')],_0xdb98('0x15')));},'filename':function(_0x1e14a8,_0x2e4d4d,_0x10a73f){_0x10a73f(null,util[_0xdb98('0x16')]('%s%s',_0xdb98('0x1f'),path[_0xdb98('0x20')](_0x2e4d4d[_0xdb98('0x18')])));}})});router[_0xdb98('0x19')](_0xdb98('0xd'),upload[_0xdb98('0x1a')](_0xdb98('0x1b')),controller[_0xdb98('0x21')]);var upload=multer({'storage':multer[_0xdb98('0x1d')]({'destination':function(_0x370fe0,_0xbfeb6d,_0x19f5b3){_0x19f5b3(null,path[_0xdb98('0x14')](config[_0xdb98('0x1e')],_0xdb98('0x15')));},'filename':function(_0xab8bdd,_0x3c9c1e,_0x452023){_0x452023(null,util['format'](_0xdb98('0x22'),_0xdb98('0x23'),path['extname'](_0x3c9c1e['originalname'])));}})});router[_0xdb98('0x19')]('/:id/preferred',upload[_0xdb98('0x1a')]('file'),controller[_0xdb98('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x475ede,_0x4e69b4,_0x1bd986){_0x1bd986(null,path[_0xdb98('0x14')](config[_0xdb98('0x1e')],_0xdb98('0x15')));},'filename':function(_0x111aa1,_0x3384a1,_0x4b24d2){_0x4b24d2(null,util[_0xdb98('0x16')](_0xdb98('0x22'),_0xdb98('0x25'),path[_0xdb98('0x20')](_0x3384a1[_0xdb98('0x18')])));}})});router[_0xdb98('0x19')](_0xdb98('0x12'),upload[_0xdb98('0x1a')]('file'),controller[_0xdb98('0x26')]);router[_0xdb98('0x27')](_0xdb98('0x28'),auth[_0xdb98('0x29')](),controller[_0xdb98('0x2a')]);module[_0xdb98('0x2b')]=router; \ No newline at end of file +var _0xea89=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','format','logo','originalname','single','file','extname','post','addLogoLogin','root','preferred','addPreferred','%s%s','/:id/favicon','addFavicon','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0x4590d5,_0x16a268){var _0x53305a=function(_0x3bbece){while(--_0x3bbece){_0x4590d5['push'](_0x4590d5['shift']());}};_0x53305a(++_0x16a268);}(_0xea89,0x1ec));var _0x9ea8=function(_0x376825,_0x48c174){_0x376825=_0x376825-0x0;var _0x3ead48=_0xea89[_0x376825];return _0x3ead48;};'use strict';var multer=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var path=require(_0x9ea8('0x2'));var timeout=require(_0x9ea8('0x3'));var express=require(_0x9ea8('0x4'));var router=express[_0x9ea8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9ea8('0x6'));var interaction=require(_0x9ea8('0x7'));var config=require(_0x9ea8('0x8'));var controller=require(_0x9ea8('0x9'));router[_0x9ea8('0xa')]('/',auth['isAuthenticated'](),controller[_0x9ea8('0xb')]);router[_0x9ea8('0xa')](_0x9ea8('0xc'),controller[_0x9ea8('0xd')]);router['get']('/:id',controller[_0x9ea8('0xe')]);router['get'](_0x9ea8('0xf'),controller[_0x9ea8('0x10')]);router[_0x9ea8('0xa')](_0x9ea8('0x11'),controller[_0x9ea8('0x12')]);router['get'](_0x9ea8('0x13'),controller[_0x9ea8('0x14')]);router[_0x9ea8('0xa')](_0x9ea8('0x15'),controller[_0x9ea8('0x16')]);router['get']('/:id/favicon',controller[_0x9ea8('0x17')]);var upload=multer({'storage':multer[_0x9ea8('0x18')]({'destination':function(_0x574d7f,_0x51851b,_0x50d352){_0x50d352(null,path[_0x9ea8('0x19')](config['root'],_0x9ea8('0x1a')));},'filename':function(_0x15d5c7,_0x5697b1,_0x31721e){_0x31721e(null,util[_0x9ea8('0x1b')]('%s%s',_0x9ea8('0x1c'),path['extname'](_0x5697b1[_0x9ea8('0x1d')])));}})});router['post'](_0x9ea8('0xf'),upload[_0x9ea8('0x1e')](_0x9ea8('0x1f')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e70b2,_0x1c32a7,_0x5bb56d){_0x5bb56d(null,path[_0x9ea8('0x19')](config['root'],_0x9ea8('0x1a')));},'filename':function(_0x3263e0,_0x2936fc,_0x4c3a86){_0x4c3a86(null,util[_0x9ea8('0x1b')]('%s%s','logologin',path[_0x9ea8('0x20')](_0x2936fc[_0x9ea8('0x1d')])));}})});router[_0x9ea8('0x21')]('/:id/logo_login',upload['single'](_0x9ea8('0x1f')),controller[_0x9ea8('0x22')]);var upload=multer({'storage':multer[_0x9ea8('0x18')]({'destination':function(_0x1ca5ba,_0x3068aa,_0x31ee87){_0x31ee87(null,path[_0x9ea8('0x19')](config[_0x9ea8('0x23')],_0x9ea8('0x1a')));},'filename':function(_0x53b806,_0x3745f6,_0x4d6b4e){_0x4d6b4e(null,util[_0x9ea8('0x1b')]('%s%s',_0x9ea8('0x24'),path['extname'](_0x3745f6[_0x9ea8('0x1d')])));}})});router['post'](_0x9ea8('0x15'),upload[_0x9ea8('0x1e')](_0x9ea8('0x1f')),controller[_0x9ea8('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6e74cf,_0x51acbc,_0x4c3a35){_0x4c3a35(null,path[_0x9ea8('0x19')](config[_0x9ea8('0x23')],_0x9ea8('0x1a')));},'filename':function(_0x53d1e1,_0x3d0630,_0x3d8c44){_0x3d8c44(null,util[_0x9ea8('0x1b')](_0x9ea8('0x26'),'favicon',path[_0x9ea8('0x20')](_0x3d0630[_0x9ea8('0x1d')])));}})});router[_0x9ea8('0x21')](_0x9ea8('0x27'),upload[_0x9ea8('0x1e')](_0x9ea8('0x1f')),controller[_0x9ea8('0x28')]);router['put'](_0x9ea8('0x29'),auth[_0x9ea8('0x2a')](),controller[_0x9ea8('0x2b')]);module[_0x9ea8('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 2f0aeec..1743c96 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4e01d6,_0x416ea4){var _0x5bd937=function(_0x8bdc00){while(--_0x8bdc00){_0x4e01d6['push'](_0x4e01d6['shift']());}};_0x5bd937(++_0x416ea4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x502de3,_0x1248be){var _0x5b73de=function(_0x590d00){while(--_0x590d00){_0x502de3['push'](_0x502de3['shift']());}};_0x5b73de(++_0x1248be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index aef3f94..15be751 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 _0x5b7f=['defaultFavicon','default_preferred.png','getFavicon','defaultPreferred','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','Setting','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','addLogo','file','filename','addLogoLogin','server/files/images/logos','logo','loginLogo','defaultLogo','defaultLoginLogo','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','getLicense','preferred','favicon','default_loginLogo.svg','download','gdpr','getPreferred'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x110ee2,_0x32ee92){_0x110ee2=_0x110ee2-0x0;var _0x4a16a3=_0x5b7f[_0x110ee2];return _0x4a16a3;};'use strict';var emlformat=require(_0xf5b7('0x0'));var rimraf=require(_0xf5b7('0x1'));var zipdir=require(_0xf5b7('0x2'));var jsonpatch=require(_0xf5b7('0x3'));var rp=require(_0xf5b7('0x4'));var moment=require(_0xf5b7('0x5'));var BPromise=require(_0xf5b7('0x6'));var Mustache=require(_0xf5b7('0x7'));var util=require(_0xf5b7('0x8'));var path=require(_0xf5b7('0x9'));var sox=require(_0xf5b7('0xa'));var csv=require(_0xf5b7('0xb'));var ejs=require(_0xf5b7('0xc'));var fs=require('fs');var fs_extra=require(_0xf5b7('0xd'));var _=require(_0xf5b7('0xe'));var squel=require(_0xf5b7('0xf'));var crypto=require(_0xf5b7('0x10'));var jsforce=require(_0xf5b7('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf5b7('0x12'));var Redis=require(_0xf5b7('0x13'));var authService=require(_0xf5b7('0x14'));var qs=require(_0xf5b7('0x15'));var as=require(_0xf5b7('0x16'));var hardwareService=require(_0xf5b7('0x17'));var logger=require(_0xf5b7('0x18'))(_0xf5b7('0x19'));var utils=require(_0xf5b7('0x1a'));var config=require(_0xf5b7('0x1b'));var licenseUtil=require(_0xf5b7('0x1c'));var db=require(_0xf5b7('0x1d'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf5b7('0x1e')][_0xf5b7('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4841e3,_0x11a5a8,_0x83cc83,_0x5dfeb7){return new BPromise(function(_0x20cd2,_0x4f087e){var _0x4b18b5=_0x5dfeb7||client;return _0x4b18b5['request'](_0x4841e3,_0x83cc83)['then'](function(_0x231013){logger[_0xf5b7('0x20')](_0xf5b7('0x21'),_0x11a5a8,_0xf5b7('0x22'));logger[_0xf5b7('0x23')]('Setting,\x20%s,\x20%s,\x20%s',_0x11a5a8,_0xf5b7('0x22'),JSON[_0xf5b7('0x24')](_0x231013));if(_0x231013[_0xf5b7('0x25')]){if(_0x231013[_0xf5b7('0x25')][_0xf5b7('0x26')]===0x1f4){logger[_0xf5b7('0x25')]('Setting,\x20%s,\x20%s',_0x11a5a8,_0x231013[_0xf5b7('0x25')][_0xf5b7('0x27')]);return _0x4f087e(_0x231013[_0xf5b7('0x25')][_0xf5b7('0x27')]);}logger[_0xf5b7('0x25')]('Setting,\x20%s,\x20%s',_0x11a5a8,_0x231013[_0xf5b7('0x25')][_0xf5b7('0x27')]);return _0x20cd2(_0x231013['error']['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x11a5a8,_0xf5b7('0x22'));_0x20cd2(_0x231013[_0xf5b7('0x28')][_0xf5b7('0x27')]);}})[_0xf5b7('0x29')](function(_0x2dc043){logger[_0xf5b7('0x25')](_0xf5b7('0x21'),_0x11a5a8,_0x2dc043);_0x4f087e(_0x2dc043);});});}function respondWithStatusCode(_0x445d22,_0x47dc6d){_0x47dc6d=_0x47dc6d||0xcc;return function(_0x348826){if(_0x348826){return _0x445d22[_0xf5b7('0x2a')](_0x47dc6d);}return _0x445d22[_0xf5b7('0x2b')](_0x47dc6d)['end']();};}function respondWithResult(_0x255c8c,_0x3f7258){_0x3f7258=_0x3f7258||0xc8;return function(_0x50af10){if(_0x50af10){return _0x255c8c[_0xf5b7('0x2b')](_0x3f7258)['json'](_0x50af10);}};}function respondWithFilteredResult(_0x450b70,_0x16046b){return function(_0x557ab5){if(_0x557ab5){var _0x40c2c4=typeof _0x16046b[_0xf5b7('0x2c')]===_0xf5b7('0x2d')&&typeof _0x16046b[_0xf5b7('0x2e')]==='undefined';var _0x3d6efc=_0x557ab5[_0xf5b7('0x2f')];var _0x574cf5=_0x40c2c4?0x0:_0x16046b[_0xf5b7('0x2c')];var _0x903891=_0x40c2c4?_0x557ab5[_0xf5b7('0x2f')]:_0x16046b[_0xf5b7('0x2c')]+_0x16046b[_0xf5b7('0x2e')];var _0x124045;if(_0x903891>=_0x3d6efc){_0x903891=_0x3d6efc;_0x124045=0xc8;}else{_0x124045=0xce;}_0x450b70[_0xf5b7('0x2b')](_0x124045);return _0x450b70[_0xf5b7('0x30')](_0xf5b7('0x31'),_0x574cf5+'-'+_0x903891+'/'+_0x3d6efc)[_0xf5b7('0x32')](_0x557ab5);}return null;};}function patchUpdates(_0x52ec8e){return function(_0x2e7375){try{jsonpatch[_0xf5b7('0x33')](_0x2e7375,_0x52ec8e,!![]);}catch(_0x1ac1b0){return BPromise[_0xf5b7('0x34')](_0x1ac1b0);}return _0x2e7375[_0xf5b7('0x35')]();};}function saveUpdates(_0x21ed70,_0x354066){return function(_0x4a93b0){if(_0x4a93b0){return _0x4a93b0[_0xf5b7('0x36')](_0x21ed70)[_0xf5b7('0x37')](function(_0x57e4aa){return _0x57e4aa;});}return null;};}function removeEntity(_0x19a674,_0x3b09f0){return function(_0x20099b){if(_0x20099b){return _0x20099b[_0xf5b7('0x38')]()[_0xf5b7('0x37')](function(){_0x19a674['status'](0xcc)[_0xf5b7('0x39')]();});}};}function handleEntityNotFound(_0x451004,_0x28ee80){return function(_0x2feff7){if(!_0x2feff7){_0x451004[_0xf5b7('0x2a')](0x194);}return _0x2feff7;};}function handleError(_0x41e146,_0x136d6c){_0x136d6c=_0x136d6c||0x1f4;return function(_0x5029e5){logger['error'](_0x5029e5['stack']);if(_0x5029e5[_0xf5b7('0x3a')]){delete _0x5029e5[_0xf5b7('0x3a')];}_0x41e146[_0xf5b7('0x2b')](_0x136d6c)[_0xf5b7('0x3b')](_0x5029e5);};}exports[_0xf5b7('0x3c')]=function(_0x22faec,_0x3f0c4d){var _0x27a9a6={},_0xce03c7={},_0x402888={'count':0x0,'rows':[]};var _0x4b609f=_['map'](db[_0xf5b7('0x3d')]['rawAttributes'],function(_0x4dd97c){return{'name':_0x4dd97c[_0xf5b7('0x3e')],'type':_0x4dd97c[_0xf5b7('0x3f')]['key']};});_0xce03c7[_0xf5b7('0x40')]=_[_0xf5b7('0x41')](_0x4b609f,_0xf5b7('0x3a'));_0xce03c7[_0xf5b7('0x42')]=_[_0xf5b7('0x43')](_0x22faec[_0xf5b7('0x42')]);_0xce03c7[_0xf5b7('0x44')]=_[_0xf5b7('0x45')](_0xce03c7[_0xf5b7('0x40')],_0xce03c7[_0xf5b7('0x42')]);_0x27a9a6[_0xf5b7('0x46')]=_[_0xf5b7('0x45')](_0xce03c7[_0xf5b7('0x40')],qs[_0xf5b7('0x47')](_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x47')]));_0x27a9a6[_0xf5b7('0x46')]=_0x27a9a6[_0xf5b7('0x46')][_0xf5b7('0x48')]?_0x27a9a6[_0xf5b7('0x46')]:_0xce03c7[_0xf5b7('0x40')];if(!_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x49')](_0xf5b7('0x4a'))){_0x27a9a6[_0xf5b7('0x2e')]=qs[_0xf5b7('0x2e')](_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x2e')]);_0x27a9a6[_0xf5b7('0x2c')]=qs[_0xf5b7('0x2c')](_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x2c')]);}_0x27a9a6[_0xf5b7('0x4b')]=qs[_0xf5b7('0x4c')](_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x4c')]);_0x27a9a6['where']=qs[_0xf5b7('0x44')](_[_0xf5b7('0x4d')](_0x22faec[_0xf5b7('0x42')],_0xce03c7[_0xf5b7('0x44')]),_0x4b609f);if(_0x22faec['query']['filter']){_0x27a9a6[_0xf5b7('0x4e')]=_[_0xf5b7('0x4f')](_0x27a9a6['where'],{'$or':_[_0xf5b7('0x41')](_0x4b609f,function(_0x2dc395){if(_0x2dc395[_0xf5b7('0x3f')]!==_0xf5b7('0x50')){var _0x660d3={};_0x660d3[_0x2dc395[_0xf5b7('0x3a')]]={'$like':'%'+_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x51')]+'%'};return _0x660d3;}})});}_0x27a9a6=_[_0xf5b7('0x4f')]({},_0x27a9a6,_0x22faec[_0xf5b7('0x52')]);var _0x3069b1={'where':_0x27a9a6[_0xf5b7('0x4e')]};return db[_0xf5b7('0x3d')][_0xf5b7('0x2f')](_0x3069b1)[_0xf5b7('0x37')](function(_0x10c940){_0x402888['count']=_0x10c940;if(_0x22faec[_0xf5b7('0x42')][_0xf5b7('0x53')]){_0x27a9a6[_0xf5b7('0x54')]=[{'all':!![]}];}return db[_0xf5b7('0x3d')][_0xf5b7('0x55')](_0x27a9a6);})[_0xf5b7('0x37')](function(_0x2c46c4){_0x402888[_0xf5b7('0x56')]=_0x2c46c4;return _0x402888;})[_0xf5b7('0x37')](respondWithFilteredResult(_0x3f0c4d,_0x27a9a6))[_0xf5b7('0x29')](handleError(_0x3f0c4d,null));};exports[_0xf5b7('0x57')]=function(_0x5872b7,_0x3e72d6){var _0xed7575={'raw':![],'where':{'id':_0x5872b7[_0xf5b7('0x58')]['id']}},_0x13ee66={};_0x13ee66[_0xf5b7('0x40')]=_[_0xf5b7('0x43')](db['Setting'][_0xf5b7('0x59')]);_0x13ee66[_0xf5b7('0x42')]=_[_0xf5b7('0x43')](_0x5872b7[_0xf5b7('0x42')]);_0x13ee66[_0xf5b7('0x44')]=_[_0xf5b7('0x45')](_0x13ee66[_0xf5b7('0x40')],_0x13ee66[_0xf5b7('0x42')]);_0xed7575['attributes']=_[_0xf5b7('0x45')](_0x13ee66[_0xf5b7('0x40')],qs[_0xf5b7('0x47')](_0x5872b7[_0xf5b7('0x42')]['fields']));_0xed7575['attributes']=_0xed7575['attributes'][_0xf5b7('0x48')]?_0xed7575[_0xf5b7('0x46')]:_0x13ee66[_0xf5b7('0x40')];if(_0x5872b7['query'][_0xf5b7('0x53')]){_0xed7575[_0xf5b7('0x54')]=[{'all':!![]}];}_0xed7575=_[_0xf5b7('0x4f')]({},_0xed7575,_0x5872b7['options']);return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')](_0xed7575)['then'](handleEntityNotFound(_0x3e72d6,null))[_0xf5b7('0x37')](respondWithResult(_0x3e72d6,null))[_0xf5b7('0x29')](handleError(_0x3e72d6,null));};exports[_0xf5b7('0x36')]=function(_0x486bee,_0x39fb9d){if(_0x486bee[_0xf5b7('0x5b')]['id']){delete _0x486bee[_0xf5b7('0x5b')]['id'];}return db[_0xf5b7('0x3d')]['find']({'where':{'id':_0x486bee['params']['id']}})['then'](handleEntityNotFound(_0x39fb9d,null))[_0xf5b7('0x37')](saveUpdates(_0x486bee[_0xf5b7('0x5b')],null))[_0xf5b7('0x37')](respondWithResult(_0x39fb9d,null))[_0xf5b7('0x29')](handleError(_0x39fb9d,null));};exports[_0xf5b7('0x5c')]=function(_0x4400ab,_0x5a7f86,_0x2c8487){if(_0x4400ab['file']&&_0x4400ab[_0xf5b7('0x5d')]['filename']){_0x4400ab['body']['logo']=_0x4400ab[_0xf5b7('0x5d')][_0xf5b7('0x5e')];}return db['Setting'][_0xf5b7('0x5a')]({'where':{'id':_0x4400ab['params']['id']}})[_0xf5b7('0x37')](handleEntityNotFound(_0x5a7f86,null))[_0xf5b7('0x37')](saveUpdates(_0x4400ab['body'],null))['then'](respondWithResult(_0x5a7f86,null))['catch'](handleError(_0x5a7f86,null));};exports[_0xf5b7('0x5f')]=function(_0x208ffc,_0x12033d,_0x237eef){if(_0x208ffc[_0xf5b7('0x5d')]&&_0x208ffc[_0xf5b7('0x5d')][_0xf5b7('0x5e')]){_0x208ffc[_0xf5b7('0x5b')]['loginLogo']=_0x208ffc[_0xf5b7('0x5d')]['filename'];}return db['Setting']['find']({'where':{'id':_0x208ffc[_0xf5b7('0x58')]['id']}})['then'](handleEntityNotFound(_0x12033d,null))[_0xf5b7('0x37')](saveUpdates(_0x208ffc[_0xf5b7('0x5b')],null))['then'](respondWithResult(_0x12033d,null))[_0xf5b7('0x29')](handleError(_0x12033d,null));};var utilLicense=require(_0xf5b7('0x1c'));exports['getLogo']=function(_0xa2eb8d,_0x333ac1,_0x22468e){var _0x1e4b01=_0xf5b7('0x60');var _0x25af8c={'custom':![]};return utilLicense['getLicense']()[_0xf5b7('0x37')](function(_0x5dafc9){if(_0x5dafc9){_0x25af8c=_0x5dafc9;}return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')]({'where':{'id':_0xa2eb8d['params']['id']},'attributes':[_0xf5b7('0x61'),_0xf5b7('0x62'),'preferred','favicon',_0xf5b7('0x63'),_0xf5b7('0x64'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xf5b7('0x37')](handleEntityNotFound(_0x333ac1,null))[_0xf5b7('0x37')](function(_0x5db682){if(_0x5db682){var _0x4a75d6=_0x5db682['logo']&&fs[_0xf5b7('0x65')](path['join'](config[_0xf5b7('0x66')],_0x1e4b01,_[_0xf5b7('0x67')](_0x5db682[_0xf5b7('0x61')])))?path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x1e4b01,_[_0xf5b7('0x67')](_0x5db682[_0xf5b7('0x61')])):path['join'](config[_0xf5b7('0x66')],_0x1e4b01,_['toLower'](_0xf5b7('0x69')));var _0x22266e=_0xf5b7('0x6a')+_[_0xf5b7('0x6b')](_0xf5b7('0x61'));if(_0x5db682[_0x22266e]||!_0x25af8c[_0xf5b7('0x6c')]){_0x4a75d6=path['join'](config[_0xf5b7('0x66')],_0x1e4b01,_[_0xf5b7('0x67')](_0xf5b7('0x69')));}if(!fs[_0xf5b7('0x65')](_0x4a75d6)){throw new db[(_0xf5b7('0x6d'))][(_0xf5b7('0x6e'))](_[_0xf5b7('0x6b')](_0xf5b7('0x61'))+_0xf5b7('0x6f'));}return _0x333ac1['download'](_0x4a75d6);}})[_0xf5b7('0x29')](handleError(_0x333ac1,null));};var utilLicense=require('../../config/license/util');exports[_0xf5b7('0x70')]=function(_0x55ebbe,_0x161f01,_0x1da192){var _0x295dc8='server/files/images/logos';var _0x71eeb8={'custom':![]};return utilLicense[_0xf5b7('0x71')]()[_0xf5b7('0x37')](function(_0x1984ae){if(_0x1984ae){_0x71eeb8=_0x1984ae;}return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')]({'where':{'id':_0x55ebbe[_0xf5b7('0x58')]['id']},'attributes':[_0xf5b7('0x61'),'loginLogo',_0xf5b7('0x72'),_0xf5b7('0x73'),_0xf5b7('0x63'),_0xf5b7('0x64'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xf5b7('0x37')](handleEntityNotFound(_0x161f01,null))[_0xf5b7('0x37')](function(_0x2c212f){if(_0x2c212f){var _0x5daf6d=_0x2c212f[_0xf5b7('0x62')]&&fs[_0xf5b7('0x65')](path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x295dc8,_[_0xf5b7('0x67')](_0x2c212f[_0xf5b7('0x62')])))?path['join'](config['root'],_0x295dc8,_[_0xf5b7('0x67')](_0x2c212f['loginLogo'])):path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x295dc8,_[_0xf5b7('0x67')](_0xf5b7('0x74')));var _0x5a5531=_0xf5b7('0x6a')+_[_0xf5b7('0x6b')]('loginLogo');if(_0x2c212f[_0x5a5531]||!_0x71eeb8[_0xf5b7('0x6c')]){_0x5daf6d=path[_0xf5b7('0x68')](config['root'],_0x295dc8,_['toLower'](_0xf5b7('0x74')));}if(!fs[_0xf5b7('0x65')](_0x5daf6d)){throw new db[(_0xf5b7('0x6d'))][(_0xf5b7('0x6e'))](_[_0xf5b7('0x6b')]('loginLogo')+_0xf5b7('0x6f'));}return _0x161f01[_0xf5b7('0x75')](_0x5daf6d);}})[_0xf5b7('0x29')](handleError(_0x161f01,null));};exports[_0xf5b7('0x76')]=function(_0x54c403,_0x5720f2){return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')]({'where':{'id':_0x54c403['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5720f2,null))[_0xf5b7('0x29')](handleError(_0x5720f2,null));};exports['addPreferred']=function(_0x2b8aa5,_0x3e80f5,_0x1a04eb){if(_0x2b8aa5[_0xf5b7('0x5d')]&&_0x2b8aa5[_0xf5b7('0x5d')][_0xf5b7('0x5e')]){_0x2b8aa5[_0xf5b7('0x5b')][_0xf5b7('0x72')]=_0x2b8aa5[_0xf5b7('0x5d')][_0xf5b7('0x5e')];}return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')]({'where':{'id':_0x2b8aa5[_0xf5b7('0x58')]['id']}})[_0xf5b7('0x37')](handleEntityNotFound(_0x3e80f5,null))[_0xf5b7('0x37')](saveUpdates(_0x2b8aa5[_0xf5b7('0x5b')],null))[_0xf5b7('0x37')](respondWithResult(_0x3e80f5,null))[_0xf5b7('0x29')](handleError(_0x3e80f5,null));};var utilLicense=require('../../config/license/util');exports[_0xf5b7('0x77')]=function(_0x57b701,_0x109f06,_0x5e3f1a){var _0xdac876=_0xf5b7('0x60');var _0x4358a9={'custom':![]};return utilLicense[_0xf5b7('0x71')]()[_0xf5b7('0x37')](function(_0x324156){if(_0x324156){_0x4358a9=_0x324156;}return db[_0xf5b7('0x3d')]['find']({'where':{'id':_0x57b701[_0xf5b7('0x58')]['id']},'attributes':[_0xf5b7('0x61'),_0xf5b7('0x62'),_0xf5b7('0x72'),'favicon',_0xf5b7('0x63'),_0xf5b7('0x64'),'defaultPreferred',_0xf5b7('0x78')],'raw':!![]});})[_0xf5b7('0x37')](handleEntityNotFound(_0x109f06,null))[_0xf5b7('0x37')](function(_0xed7f7e){if(_0xed7f7e){var _0x5e2fe2=_0xed7f7e[_0xf5b7('0x72')]&&fs['existsSync'](path['join'](config['root'],_0xdac876,_[_0xf5b7('0x67')](_0xed7f7e['preferred'])))?path[_0xf5b7('0x68')](config['root'],_0xdac876,_[_0xf5b7('0x67')](_0xed7f7e[_0xf5b7('0x72')])):path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0xdac876,_['toLower'](_0xf5b7('0x79')));var _0x490bc5=_0xf5b7('0x6a')+_['upperFirst'](_0xf5b7('0x72'));if(_0xed7f7e[_0x490bc5]||!_0x4358a9['custom']||!_0x4358a9[_0xf5b7('0x72')]){_0x5e2fe2=path['join'](config[_0xf5b7('0x66')],_0xdac876,_[_0xf5b7('0x67')](_0xf5b7('0x79')));}if(!fs[_0xf5b7('0x65')](_0x5e2fe2)){throw new db['Sequelize'][(_0xf5b7('0x6e'))](_[_0xf5b7('0x6b')](_0xf5b7('0x72'))+'\x20not\x20found');}return _0x109f06[_0xf5b7('0x75')](_0x5e2fe2);}})['catch'](handleError(_0x109f06,null));};exports['addFavicon']=function(_0x18c9f8,_0x43e0d2,_0x5610a0){if(_0x18c9f8[_0xf5b7('0x5d')]&&_0x18c9f8['file'][_0xf5b7('0x5e')]){_0x18c9f8[_0xf5b7('0x5b')][_0xf5b7('0x73')]=_0x18c9f8['file'][_0xf5b7('0x5e')];}return db[_0xf5b7('0x3d')][_0xf5b7('0x5a')]({'where':{'id':_0x18c9f8['params']['id']}})['then'](handleEntityNotFound(_0x43e0d2,null))[_0xf5b7('0x37')](saveUpdates(_0x18c9f8['body'],null))[_0xf5b7('0x37')](respondWithResult(_0x43e0d2,null))[_0xf5b7('0x29')](handleError(_0x43e0d2,null));};var utilLicense=require(_0xf5b7('0x1c'));exports[_0xf5b7('0x7a')]=function(_0x1ef348,_0x4b7d0d,_0x4d69a4){var _0x162a68='server/files/images/logos';var _0x57fe13={'custom':![]};return utilLicense[_0xf5b7('0x71')]()[_0xf5b7('0x37')](function(_0x56131f){if(_0x56131f){_0x57fe13=_0x56131f;}return db['Setting'][_0xf5b7('0x5a')]({'where':{'id':_0x1ef348[_0xf5b7('0x58')]['id']},'attributes':[_0xf5b7('0x61'),_0xf5b7('0x62'),_0xf5b7('0x72'),_0xf5b7('0x73'),'defaultLogo',_0xf5b7('0x64'),_0xf5b7('0x7b'),'defaultFavicon'],'raw':!![]});})[_0xf5b7('0x37')](handleEntityNotFound(_0x4b7d0d,null))['then'](function(_0x2303bd){if(_0x2303bd){var _0x59b695=_0x2303bd[_0xf5b7('0x73')]&&fs[_0xf5b7('0x65')](path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x162a68,_[_0xf5b7('0x67')](_0x2303bd[_0xf5b7('0x73')])))?path[_0xf5b7('0x68')](config['root'],_0x162a68,_['toLower'](_0x2303bd[_0xf5b7('0x73')])):path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x162a68,_[_0xf5b7('0x67')](_0xf5b7('0x7c')));var _0x305bf0=_0xf5b7('0x6a')+_[_0xf5b7('0x6b')](_0xf5b7('0x73'));if(_0x2303bd[_0x305bf0]||!_0x57fe13[_0xf5b7('0x6c')]){_0x59b695=path[_0xf5b7('0x68')](config[_0xf5b7('0x66')],_0x162a68,_[_0xf5b7('0x67')](_0xf5b7('0x7c')));}if(!fs['existsSync'](_0x59b695)){throw new db[(_0xf5b7('0x6d'))][(_0xf5b7('0x6e'))](_[_0xf5b7('0x6b')](_0xf5b7('0x73'))+_0xf5b7('0x6f'));}return _0x4b7d0d['download'](_0x59b695);}})[_0xf5b7('0x29')](handleError(_0x4b7d0d,null));};exports[_0xf5b7('0x7d')]=function(_0x388d3c,_0x4e75f8){var _0x4ead7d={'offset':moment()[_0xf5b7('0x7e')]()};_0x4ead7d[_0xf5b7('0x7f')]=moment()[_0xf5b7('0x7e')](_0x4ead7d[_0xf5b7('0x2c')])[_0xf5b7('0x80')](_0xf5b7('0x81'));return _0x4e75f8['status'](0xc8)[_0xf5b7('0x3b')](_0x4ead7d);}; \ No newline at end of file +var _0x6a88=['pick','filters','filter','where','Setting','includeAll','findAll','rows','show','params','fields','include','find','update','body','addLogo','file','logo','filename','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','getLicense','defaultPreferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','end','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x6a88,0xa9));var _0x86a8=function(_0x133804,_0x46eafb){_0x133804=_0x133804-0x0;var _0x45b070=_0x6a88[_0x133804];return _0x45b070;};'use strict';var emlformat=require(_0x86a8('0x0'));var rimraf=require(_0x86a8('0x1'));var zipdir=require(_0x86a8('0x2'));var jsonpatch=require(_0x86a8('0x3'));var rp=require(_0x86a8('0x4'));var moment=require(_0x86a8('0x5'));var BPromise=require(_0x86a8('0x6'));var Mustache=require('mustache');var util=require(_0x86a8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x86a8('0x8'));var ejs=require(_0x86a8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86a8('0xb'));var deskjs=require(_0x86a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86a8('0xd'));var Papa=require(_0x86a8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a8('0xf'));var as=require(_0x86a8('0x10'));var hardwareService=require(_0x86a8('0x11'));var logger=require(_0x86a8('0x12'))(_0x86a8('0x13'));var utils=require(_0x86a8('0x14'));var config=require(_0x86a8('0x15'));var licenseUtil=require(_0x86a8('0x16'));var db=require(_0x86a8('0x17'))['db'];var jayson=require(_0x86a8('0x18'));var client=jayson['client'][_0x86a8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4f1887,_0x54194f,_0x430729,_0x29a430){return new BPromise(function(_0x5d5b9d,_0x520697){var _0x4f8076=_0x29a430||client;return _0x4f8076[_0x86a8('0x1a')](_0x4f1887,_0x430729)[_0x86a8('0x1b')](function(_0x507fef){logger[_0x86a8('0x1c')](_0x86a8('0x1d'),_0x54194f,_0x86a8('0x1e'));logger[_0x86a8('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x54194f,_0x86a8('0x1e'),JSON['stringify'](_0x507fef));if(_0x507fef[_0x86a8('0x20')]){if(_0x507fef[_0x86a8('0x20')][_0x86a8('0x21')]===0x1f4){logger[_0x86a8('0x20')](_0x86a8('0x1d'),_0x54194f,_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);return _0x520697(_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);}logger['error'](_0x86a8('0x1d'),_0x54194f,_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);return _0x5d5b9d(_0x507fef[_0x86a8('0x20')]['message']);}else{logger['info'](_0x86a8('0x1d'),_0x54194f,_0x86a8('0x1e'));_0x5d5b9d(_0x507fef['result'][_0x86a8('0x22')]);}})[_0x86a8('0x23')](function(_0x4b0abf){logger[_0x86a8('0x20')](_0x86a8('0x1d'),_0x54194f,_0x4b0abf);_0x520697(_0x4b0abf);});});}function respondWithStatusCode(_0x5eb4df,_0x42a7f2){_0x42a7f2=_0x42a7f2||0xcc;return function(_0x34578a){if(_0x34578a){return _0x5eb4df[_0x86a8('0x24')](_0x42a7f2);}return _0x5eb4df[_0x86a8('0x25')](_0x42a7f2)['end']();};}function respondWithResult(_0x325fc8,_0x2dfde7){_0x2dfde7=_0x2dfde7||0xc8;return function(_0x2b6c1d){if(_0x2b6c1d){return _0x325fc8[_0x86a8('0x25')](_0x2dfde7)[_0x86a8('0x26')](_0x2b6c1d);}};}function respondWithFilteredResult(_0x3891bc,_0x1991fe){return function(_0x503613){if(_0x503613){var _0x5d3924=typeof _0x1991fe[_0x86a8('0x27')]==='undefined'&&typeof _0x1991fe['limit']===_0x86a8('0x28');var _0x146757=_0x503613[_0x86a8('0x29')];var _0x1059fc=_0x5d3924?0x0:_0x1991fe[_0x86a8('0x27')];var _0x35147b=_0x5d3924?_0x503613[_0x86a8('0x29')]:_0x1991fe['offset']+_0x1991fe[_0x86a8('0x2a')];var _0x3ddded;if(_0x35147b>=_0x146757){_0x35147b=_0x146757;_0x3ddded=0xc8;}else{_0x3ddded=0xce;}_0x3891bc[_0x86a8('0x25')](_0x3ddded);return _0x3891bc['set'](_0x86a8('0x2b'),_0x1059fc+'-'+_0x35147b+'/'+_0x146757)[_0x86a8('0x26')](_0x503613);}return null;};}function patchUpdates(_0x29e81e){return function(_0x39052e){try{jsonpatch[_0x86a8('0x2c')](_0x39052e,_0x29e81e,!![]);}catch(_0x4287ae){return BPromise[_0x86a8('0x2d')](_0x4287ae);}return _0x39052e[_0x86a8('0x2e')]();};}function saveUpdates(_0x3d1ce9,_0x34c364){return function(_0x407e4e){if(_0x407e4e){return _0x407e4e['update'](_0x3d1ce9)['then'](function(_0x5e2883){return _0x5e2883;});}return null;};}function removeEntity(_0x17fcc2,_0x2a2fb6){return function(_0x4326f5){if(_0x4326f5){return _0x4326f5[_0x86a8('0x2f')]()[_0x86a8('0x1b')](function(){_0x17fcc2[_0x86a8('0x25')](0xcc)[_0x86a8('0x30')]();});}};}function handleEntityNotFound(_0x39ea18,_0x43558f){return function(_0x519c52){if(!_0x519c52){_0x39ea18[_0x86a8('0x24')](0x194);}return _0x519c52;};}function handleError(_0x34bc3c,_0x4a881d){_0x4a881d=_0x4a881d||0x1f4;return function(_0x421d69){logger[_0x86a8('0x20')](_0x421d69['stack']);if(_0x421d69[_0x86a8('0x31')]){delete _0x421d69[_0x86a8('0x31')];}_0x34bc3c['status'](_0x4a881d)[_0x86a8('0x32')](_0x421d69);};}exports[_0x86a8('0x33')]=function(_0x231b7c,_0x497286){var _0x2b5813={},_0x47181d={},_0x240004={'count':0x0,'rows':[]};var _0x55712a=_[_0x86a8('0x34')](db['Setting']['rawAttributes'],function(_0x39c609){return{'name':_0x39c609[_0x86a8('0x35')],'type':_0x39c609[_0x86a8('0x36')][_0x86a8('0x37')]};});_0x47181d[_0x86a8('0x38')]=_['map'](_0x55712a,_0x86a8('0x31'));_0x47181d[_0x86a8('0x39')]=_[_0x86a8('0x3a')](_0x231b7c['query']);_0x47181d['filters']=_[_0x86a8('0x3b')](_0x47181d['model'],_0x47181d[_0x86a8('0x39')]);_0x2b5813[_0x86a8('0x3c')]=_['intersection'](_0x47181d['model'],qs['fields'](_0x231b7c[_0x86a8('0x39')]['fields']));_0x2b5813['attributes']=_0x2b5813[_0x86a8('0x3c')][_0x86a8('0x3d')]?_0x2b5813[_0x86a8('0x3c')]:_0x47181d['model'];if(!_0x231b7c[_0x86a8('0x39')]['hasOwnProperty'](_0x86a8('0x3e'))){_0x2b5813[_0x86a8('0x2a')]=qs[_0x86a8('0x2a')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x2a')]);_0x2b5813['offset']=qs[_0x86a8('0x27')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x27')]);}_0x2b5813[_0x86a8('0x3f')]=qs[_0x86a8('0x40')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x40')]);_0x2b5813['where']=qs['filters'](_[_0x86a8('0x41')](_0x231b7c[_0x86a8('0x39')],_0x47181d[_0x86a8('0x42')]),_0x55712a);if(_0x231b7c[_0x86a8('0x39')][_0x86a8('0x43')]){_0x2b5813[_0x86a8('0x44')]=_['merge'](_0x2b5813['where'],{'$or':_['map'](_0x55712a,function(_0x1b4340){if(_0x1b4340[_0x86a8('0x36')]!=='VIRTUAL'){var _0x4f1bce={};_0x4f1bce[_0x1b4340[_0x86a8('0x31')]]={'$like':'%'+_0x231b7c['query'][_0x86a8('0x43')]+'%'};return _0x4f1bce;}})});}_0x2b5813=_['merge']({},_0x2b5813,_0x231b7c['options']);var _0x35c5e9={'where':_0x2b5813[_0x86a8('0x44')]};return db[_0x86a8('0x45')][_0x86a8('0x29')](_0x35c5e9)[_0x86a8('0x1b')](function(_0x32b453){_0x240004['count']=_0x32b453;if(_0x231b7c[_0x86a8('0x39')][_0x86a8('0x46')]){_0x2b5813['include']=[{'all':!![]}];}return db[_0x86a8('0x45')][_0x86a8('0x47')](_0x2b5813);})[_0x86a8('0x1b')](function(_0x5cc9d7){_0x240004[_0x86a8('0x48')]=_0x5cc9d7;return _0x240004;})['then'](respondWithFilteredResult(_0x497286,_0x2b5813))[_0x86a8('0x23')](handleError(_0x497286,null));};exports[_0x86a8('0x49')]=function(_0x4479d9,_0x4964f0){var _0x1b042c={'raw':![],'where':{'id':_0x4479d9[_0x86a8('0x4a')]['id']}},_0x257f39={};_0x257f39['model']=_[_0x86a8('0x3a')](db['Setting']['rawAttributes']);_0x257f39[_0x86a8('0x39')]=_[_0x86a8('0x3a')](_0x4479d9[_0x86a8('0x39')]);_0x257f39['filters']=_[_0x86a8('0x3b')](_0x257f39[_0x86a8('0x38')],_0x257f39[_0x86a8('0x39')]);_0x1b042c[_0x86a8('0x3c')]=_[_0x86a8('0x3b')](_0x257f39['model'],qs[_0x86a8('0x4b')](_0x4479d9['query'][_0x86a8('0x4b')]));_0x1b042c['attributes']=_0x1b042c[_0x86a8('0x3c')][_0x86a8('0x3d')]?_0x1b042c[_0x86a8('0x3c')]:_0x257f39[_0x86a8('0x38')];if(_0x4479d9[_0x86a8('0x39')][_0x86a8('0x46')]){_0x1b042c[_0x86a8('0x4c')]=[{'all':!![]}];}_0x1b042c=_['merge']({},_0x1b042c,_0x4479d9['options']);return db[_0x86a8('0x45')][_0x86a8('0x4d')](_0x1b042c)['then'](handleEntityNotFound(_0x4964f0,null))[_0x86a8('0x1b')](respondWithResult(_0x4964f0,null))[_0x86a8('0x23')](handleError(_0x4964f0,null));};exports[_0x86a8('0x4e')]=function(_0x40228e,_0x2c0d29){if(_0x40228e[_0x86a8('0x4f')]['id']){delete _0x40228e[_0x86a8('0x4f')]['id'];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x40228e[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x2c0d29,null))[_0x86a8('0x1b')](saveUpdates(_0x40228e[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x2c0d29,null))[_0x86a8('0x23')](handleError(_0x2c0d29,null));};exports[_0x86a8('0x50')]=function(_0x206fb7,_0x482283,_0x48656a){if(_0x206fb7[_0x86a8('0x51')]&&_0x206fb7[_0x86a8('0x51')]['filename']){_0x206fb7[_0x86a8('0x4f')][_0x86a8('0x52')]=_0x206fb7[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x206fb7[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x482283,null))[_0x86a8('0x1b')](saveUpdates(_0x206fb7[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x482283,null))['catch'](handleError(_0x482283,null));};exports['addLogoLogin']=function(_0x409045,_0x2ba2f8,_0x2f4519){if(_0x409045[_0x86a8('0x51')]&&_0x409045[_0x86a8('0x51')][_0x86a8('0x53')]){_0x409045[_0x86a8('0x4f')][_0x86a8('0x54')]=_0x409045[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x409045[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x2ba2f8,null))[_0x86a8('0x1b')](saveUpdates(_0x409045['body'],null))[_0x86a8('0x1b')](respondWithResult(_0x2ba2f8,null))['catch'](handleError(_0x2ba2f8,null));};var utilLicense=require(_0x86a8('0x16'));exports['getLogo']=function(_0x483d69,_0x390f27,_0x4dd432){var _0x314e61=_0x86a8('0x55');var _0x38447d={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xcd0db4){if(_0xcd0db4){_0x38447d=_0xcd0db4;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x483d69['params']['id']},'attributes':[_0x86a8('0x52'),'loginLogo',_0x86a8('0x56'),_0x86a8('0x57'),_0x86a8('0x58'),_0x86a8('0x59'),'defaultPreferred',_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x390f27,null))[_0x86a8('0x1b')](function(_0x5bd882){if(_0x5bd882){var _0x4c1717=_0x5bd882[_0x86a8('0x52')]&&fs[_0x86a8('0x5b')](path['join'](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x5bd882[_0x86a8('0x52')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x5bd882['logo'])):path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x86a8('0x5f')));var _0x276141=_0x86a8('0x60')+_[_0x86a8('0x61')](_0x86a8('0x52'));if(_0x5bd882[_0x276141]||!_0x38447d[_0x86a8('0x62')]){_0x4c1717=path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x86a8('0x5f')));}if(!fs[_0x86a8('0x5b')](_0x4c1717)){throw new db[(_0x86a8('0x63'))]['ValidationError'](_[_0x86a8('0x61')](_0x86a8('0x52'))+_0x86a8('0x64'));}return _0x390f27[_0x86a8('0x65')](_0x4c1717);}})[_0x86a8('0x23')](handleError(_0x390f27,null));};var utilLicense=require(_0x86a8('0x16'));exports[_0x86a8('0x66')]=function(_0x3d7c4a,_0x4e09ec,_0x32b4c7){var _0x281347=_0x86a8('0x55');var _0x5d5e={'custom':![]};return utilLicense[_0x86a8('0x67')]()[_0x86a8('0x1b')](function(_0x13b554){if(_0x13b554){_0x5d5e=_0x13b554;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x3d7c4a[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x52'),_0x86a8('0x54'),'preferred',_0x86a8('0x57'),_0x86a8('0x58'),_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x4e09ec,null))[_0x86a8('0x1b')](function(_0xc24b1d){if(_0xc24b1d){var _0x287d06=_0xc24b1d[_0x86a8('0x54')]&&fs[_0x86a8('0x5b')](path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0xc24b1d[_0x86a8('0x54')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0xc24b1d[_0x86a8('0x54')])):path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0x86a8('0x69')));var _0x11701d=_0x86a8('0x60')+_[_0x86a8('0x61')](_0x86a8('0x54'));if(_0xc24b1d[_0x11701d]||!_0x5d5e[_0x86a8('0x62')]){_0x287d06=path['join'](config[_0x86a8('0x5c')],_0x281347,_['toLower'](_0x86a8('0x69')));}if(!fs[_0x86a8('0x5b')](_0x287d06)){throw new db['Sequelize'][(_0x86a8('0x6a'))](_['upperFirst']('loginLogo')+_0x86a8('0x64'));}return _0x4e09ec[_0x86a8('0x65')](_0x287d06);}})['catch'](handleError(_0x4e09ec,null));};exports[_0x86a8('0x6b')]=function(_0x15ce58,_0x19aaf9){return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x15ce58[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x6c')]})[_0x86a8('0x1b')](respondWithResult(_0x19aaf9,null))['catch'](handleError(_0x19aaf9,null));};exports[_0x86a8('0x6d')]=function(_0x440f43,_0x4917e1,_0x1502c0){if(_0x440f43[_0x86a8('0x51')]&&_0x440f43['file'][_0x86a8('0x53')]){_0x440f43[_0x86a8('0x4f')][_0x86a8('0x56')]=_0x440f43['file'][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x440f43[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x4917e1,null))[_0x86a8('0x1b')](saveUpdates(_0x440f43[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x4917e1,null))[_0x86a8('0x23')](handleError(_0x4917e1,null));};var utilLicense=require('../../config/license/util');exports[_0x86a8('0x6e')]=function(_0x1fbcc0,_0x2313cc,_0x110ce8){var _0x507607=_0x86a8('0x55');var _0x54d4c9={'custom':![]};return utilLicense['getLicense']()[_0x86a8('0x1b')](function(_0xc0c8bf){if(_0xc0c8bf){_0x54d4c9=_0xc0c8bf;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x1fbcc0[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x52'),'loginLogo',_0x86a8('0x56'),_0x86a8('0x57'),'defaultLogo',_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x2313cc,null))['then'](function(_0xe6876d){if(_0xe6876d){var _0x1ed8dd=_0xe6876d[_0x86a8('0x56')]&&fs['existsSync'](path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x507607,_[_0x86a8('0x5d')](_0xe6876d[_0x86a8('0x56')])))?path['join'](config[_0x86a8('0x5c')],_0x507607,_[_0x86a8('0x5d')](_0xe6876d[_0x86a8('0x56')])):path[_0x86a8('0x5e')](config['root'],_0x507607,_[_0x86a8('0x5d')]('default_preferred.png'));var _0x306f38='default'+_[_0x86a8('0x61')](_0x86a8('0x56'));if(_0xe6876d[_0x306f38]||!_0x54d4c9[_0x86a8('0x62')]||!_0x54d4c9[_0x86a8('0x56')]){_0x1ed8dd=path['join'](config[_0x86a8('0x5c')],_0x507607,_['toLower'](_0x86a8('0x6f')));}if(!fs[_0x86a8('0x5b')](_0x1ed8dd)){throw new db[(_0x86a8('0x63'))][(_0x86a8('0x6a'))](_['upperFirst'](_0x86a8('0x56'))+'\x20not\x20found');}return _0x2313cc[_0x86a8('0x65')](_0x1ed8dd);}})[_0x86a8('0x23')](handleError(_0x2313cc,null));};exports[_0x86a8('0x70')]=function(_0x212c42,_0x897c7e,_0x41835c){if(_0x212c42[_0x86a8('0x51')]&&_0x212c42[_0x86a8('0x51')][_0x86a8('0x53')]){_0x212c42[_0x86a8('0x4f')]['favicon']=_0x212c42[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x212c42['params']['id']}})['then'](handleEntityNotFound(_0x897c7e,null))[_0x86a8('0x1b')](saveUpdates(_0x212c42[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x897c7e,null))[_0x86a8('0x23')](handleError(_0x897c7e,null));};var utilLicense=require('../../config/license/util');exports[_0x86a8('0x71')]=function(_0x13c502,_0x4a4225,_0x53fbc8){var _0x3c89fa=_0x86a8('0x55');var _0x1bf333={'custom':![]};return utilLicense[_0x86a8('0x67')]()['then'](function(_0x172ab6){if(_0x172ab6){_0x1bf333=_0x172ab6;}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x13c502['params']['id']},'attributes':['logo','loginLogo',_0x86a8('0x56'),'favicon','defaultLogo',_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x4a4225,null))[_0x86a8('0x1b')](function(_0x4e4329){if(_0x4e4329){var _0x15b707=_0x4e4329[_0x86a8('0x57')]&&fs[_0x86a8('0x5b')](path['join'](config[_0x86a8('0x5c')],_0x3c89fa,_['toLower'](_0x4e4329[_0x86a8('0x57')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x3c89fa,_[_0x86a8('0x5d')](_0x4e4329[_0x86a8('0x57')])):path[_0x86a8('0x5e')](config['root'],_0x3c89fa,_[_0x86a8('0x5d')](_0x86a8('0x72')));var _0x137e85=_0x86a8('0x60')+_['upperFirst']('favicon');if(_0x4e4329[_0x137e85]||!_0x1bf333['custom']){_0x15b707=path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x3c89fa,_[_0x86a8('0x5d')](_0x86a8('0x72')));}if(!fs[_0x86a8('0x5b')](_0x15b707)){throw new db['Sequelize'][(_0x86a8('0x6a'))](_[_0x86a8('0x61')]('favicon')+_0x86a8('0x64'));}return _0x4a4225[_0x86a8('0x65')](_0x15b707);}})[_0x86a8('0x23')](handleError(_0x4a4225,null));};exports['getDate']=function(_0x4aabae,_0x322811){var _0x5891c5={'offset':moment()[_0x86a8('0x73')]()};_0x5891c5[_0x86a8('0x74')]=moment()[_0x86a8('0x73')](_0x5891c5[_0x86a8('0x27')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x322811[_0x86a8('0x25')](0xc8)['send'](_0x5891c5);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9ba6402..2525fad 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x5e7b6c,_0x4916d0){var _0x3afdbd=function(_0x648ee6){while(--_0x648ee6){_0x5e7b6c['push'](_0x5e7b6c['shift']());}};_0x3afdbd(++_0x4916d0);}(_0x008c,0x188));var _0xc008=function(_0x226494,_0xc4b645){_0x226494=_0x226494-0x0;var _0x27b950=_0x008c[_0x226494];return _0x27b950;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 4fc8fcf..0651b01 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 _0x4562=['map','include','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSetting','Setting','options','raw','attributes'];(function(_0x36c086,_0x53cba9){var _0x58bacc=function(_0x528235){while(--_0x528235){_0x36c086['push'](_0x36c086['shift']());}};_0x58bacc(++_0x53cba9);}(_0x4562,0x108));var _0x2456=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4562[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2456('0x0'));var util=require(_0x2456('0x1'));var moment=require(_0x2456('0x2'));var BPromise=require('bluebird');var rs=require(_0x2456('0x3'));var fs=require('fs');var Redis=require(_0x2456('0x4'));var db=require(_0x2456('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2456('0x6'))(_0x2456('0x7'));var config=require(_0x2456('0x8'));var jayson=require(_0x2456('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ba3fc,_0x2f1a98,_0x3e5497){return new BPromise(function(_0x8ce710,_0x5fea3c){return client[_0x2456('0xa')](_0x1ba3fc,_0x3e5497)[_0x2456('0xb')](function(_0x52063f){logger[_0x2456('0xc')](_0x2456('0xd'),_0x2f1a98,_0x2456('0xe'));logger[_0x2456('0xf')](_0x2456('0x10'),_0x2f1a98,_0x2456('0xe'),JSON['stringify'](_0x52063f));if(_0x52063f['error']){if(_0x52063f[_0x2456('0x11')]['code']===0x1f4){logger[_0x2456('0x11')](_0x2456('0xd'),_0x2f1a98,_0x52063f[_0x2456('0x11')][_0x2456('0x12')]);return _0x5fea3c(_0x52063f[_0x2456('0x11')][_0x2456('0x12')]);}logger[_0x2456('0x11')](_0x2456('0xd'),_0x2f1a98,_0x52063f[_0x2456('0x11')]['message']);return _0x8ce710(_0x52063f[_0x2456('0x11')]['message']);}else{logger[_0x2456('0xc')](_0x2456('0xd'),_0x2f1a98,_0x2456('0xe'));_0x8ce710(_0x52063f[_0x2456('0x13')][_0x2456('0x12')]);}})[_0x2456('0x14')](function(_0x5ae6d7){logger[_0x2456('0x11')]('Setting,\x20%s,\x20%s',_0x2f1a98,_0x5ae6d7);_0x5fea3c(_0x5ae6d7);});});}exports[_0x2456('0x15')]=function(_0x43c26f){var _0x301c00=this;return new Promise(function(_0x2c841d,_0x126a1b){return db[_0x2456('0x16')]['find']({'raw':_0x43c26f[_0x2456('0x17')]?_0x43c26f[_0x2456('0x17')][_0x2456('0x18')]===undefined?!![]:![]:!![],'where':_0x43c26f[_0x2456('0x17')]?_0x43c26f[_0x2456('0x17')]['where']||null:null,'attributes':_0x43c26f[_0x2456('0x17')]?_0x43c26f[_0x2456('0x17')][_0x2456('0x19')]||null:null,'include':_0x43c26f[_0x2456('0x17')]?_0x43c26f[_0x2456('0x17')]['include']?_[_0x2456('0x1a')](_0x43c26f[_0x2456('0x17')]['include'],function(_0x3c66e4){return{'model':db[_0x3c66e4['model']],'as':_0x3c66e4['as'],'attributes':_0x3c66e4[_0x2456('0x19')],'include':_0x3c66e4[_0x2456('0x1b')]?_[_0x2456('0x1a')](_0x3c66e4[_0x2456('0x1b')],function(_0x1ad770){return{'model':db[_0x1ad770['model']],'as':_0x1ad770['as'],'attributes':_0x1ad770[_0x2456('0x19')],'include':_0x1ad770['include']?_[_0x2456('0x1a')](_0x1ad770[_0x2456('0x1b')],function(_0x529205){return{'model':db[_0x529205[_0x2456('0x1c')]],'as':_0x529205['as'],'attributes':_0x529205['attributes']};}):[]};}):[]};}):[]:[]})[_0x2456('0xb')](function(_0x2c9d5a){logger[_0x2456('0xc')](_0x2456('0x15'),_0x43c26f);logger['debug'](_0x2456('0x15'),_0x43c26f,JSON['stringify'](_0x2c9d5a));_0x2c841d(_0x2c9d5a);})[_0x2456('0x14')](function(_0x9e181d){logger[_0x2456('0x11')]('ShowSetting',_0x9e181d[_0x2456('0x12')],_0x43c26f);_0x126a1b(_0x301c00['error'](0x1f4,_0x9e181d['message']));});});}; \ No newline at end of file +var _0x868b=['rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','Setting','find','options','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d2cf3,_0x16bfd2){var _0x45a3fc=function(_0x24e67f){while(--_0x24e67f){_0x5d2cf3['push'](_0x5d2cf3['shift']());}};_0x45a3fc(++_0x16bfd2);}(_0x868b,0x1e8));var _0xb868=function(_0x291299,_0x83106c){_0x291299=_0x291299-0x0;var _0x216491=_0x868b[_0x291299];return _0x216491;};'use strict';var _=require(_0xb868('0x0'));var util=require(_0xb868('0x1'));var moment=require(_0xb868('0x2'));var BPromise=require('bluebird');var rs=require(_0xb868('0x3'));var fs=require('fs');var Redis=require(_0xb868('0x4'));var db=require(_0xb868('0x5'))['db'];var utils=require(_0xb868('0x6'));var logger=require(_0xb868('0x7'))(_0xb868('0x8'));var config=require(_0xb868('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb868('0xa')][_0xb868('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ed747,_0x2ac0a8,_0x896946){return new BPromise(function(_0x48a9e8,_0x34192d){return client[_0xb868('0xc')](_0x1ed747,_0x896946)[_0xb868('0xd')](function(_0x374219){logger[_0xb868('0xe')](_0xb868('0xf'),_0x2ac0a8,_0xb868('0x10'));logger[_0xb868('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x2ac0a8,'request\x20sent',JSON[_0xb868('0x12')](_0x374219));if(_0x374219[_0xb868('0x13')]){if(_0x374219[_0xb868('0x13')][_0xb868('0x14')]===0x1f4){logger[_0xb868('0x13')](_0xb868('0xf'),_0x2ac0a8,_0x374219['error'][_0xb868('0x15')]);return _0x34192d(_0x374219[_0xb868('0x13')][_0xb868('0x15')]);}logger[_0xb868('0x13')]('Setting,\x20%s,\x20%s',_0x2ac0a8,_0x374219['error'][_0xb868('0x15')]);return _0x48a9e8(_0x374219[_0xb868('0x13')][_0xb868('0x15')]);}else{logger[_0xb868('0xe')](_0xb868('0xf'),_0x2ac0a8,_0xb868('0x10'));_0x48a9e8(_0x374219['result'][_0xb868('0x15')]);}})[_0xb868('0x16')](function(_0x21c55d){logger['error']('Setting,\x20%s,\x20%s',_0x2ac0a8,_0x21c55d);_0x34192d(_0x21c55d);});});}exports[_0xb868('0x17')]=function(_0x208d77){var _0x5143d0=this;return new Promise(function(_0x1952a4,_0x4a86a0){return db[_0xb868('0x18')][_0xb868('0x19')]({'raw':_0x208d77[_0xb868('0x1a')]?_0x208d77[_0xb868('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x208d77[_0xb868('0x1a')]?_0x208d77[_0xb868('0x1a')]['where']||null:null,'attributes':_0x208d77['options']?_0x208d77[_0xb868('0x1a')][_0xb868('0x1b')]||null:null,'include':_0x208d77['options']?_0x208d77['options'][_0xb868('0x1c')]?_[_0xb868('0x1d')](_0x208d77[_0xb868('0x1a')][_0xb868('0x1c')],function(_0x417cc6){return{'model':db[_0x417cc6[_0xb868('0x1e')]],'as':_0x417cc6['as'],'attributes':_0x417cc6['attributes'],'include':_0x417cc6[_0xb868('0x1c')]?_['map'](_0x417cc6[_0xb868('0x1c')],function(_0x1719bc){return{'model':db[_0x1719bc[_0xb868('0x1e')]],'as':_0x1719bc['as'],'attributes':_0x1719bc[_0xb868('0x1b')],'include':_0x1719bc[_0xb868('0x1c')]?_[_0xb868('0x1d')](_0x1719bc[_0xb868('0x1c')],function(_0x2192bf){return{'model':db[_0x2192bf[_0xb868('0x1e')]],'as':_0x2192bf['as'],'attributes':_0x2192bf[_0xb868('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb868('0xd')](function(_0x162b09){logger['info'](_0xb868('0x17'),_0x208d77);logger[_0xb868('0x11')]('ShowSetting',_0x208d77,JSON[_0xb868('0x12')](_0x162b09));_0x1952a4(_0x162b09);})[_0xb868('0x16')](function(_0x500321){logger[_0xb868('0x13')]('ShowSetting',_0x500321['message'],_0x208d77);_0x4a86a0(_0x5143d0['error'](0x1f4,_0x500321[_0xb868('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d57f639..72f6737 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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x48eddc,_0x5729b2){var _0xc8e91f=function(_0x1df926){while(--_0x1df926){_0x48eddc['push'](_0x48eddc['shift']());}};_0xc8e91f(++_0x5729b2);}(_0xe14b,0x93));var _0xbe14=function(_0x286348,_0x486aab){_0x286348=_0x286348-0x0;var _0x39f086=_0xe14b[_0x286348];return _0x39f086;};'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['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x5fab,0x177));var _0xb5fa=function(_0x4295fd,_0x1f2573){_0x4295fd=_0x4295fd-0x0;var _0x96f34e=_0x5fab[_0x4295fd];return _0x96f34e;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c37e027..3de74fc 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 _0x6c00=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','twilio','skebby','clicksend','plivo','infobip','intelepeer','TEXT'];(function(_0x30d9bf,_0x359bb6){var _0x2be61e=function(_0x3d5aab){while(--_0x3d5aab){_0x30d9bf['push'](_0x30d9bf['shift']());}};_0x2be61e(++_0x359bb6);}(_0x6c00,0x113));var _0x06c0=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x6c00[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require(_0x06c0('0x0'));var rs=require(_0x06c0('0x1'));module[_0x06c0('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x06c0('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x06c0('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x06c0('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x06c0('0x4')]},'type':{'type':Sequelize[_0x06c0('0x5')](_0x06c0('0x6'),_0x06c0('0x7'),'connectel',_0x06c0('0x8'),_0x06c0('0x9'),'clickatell','bandwidth','csc',_0x06c0('0xa'),_0x06c0('0xb'))},'accountSid':{'type':Sequelize[_0x06c0('0x4')]},'authId':{'type':Sequelize[_0x06c0('0x4')]},'authToken':{'type':Sequelize[_0x06c0('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x06c0('0x4')]},'password':{'type':Sequelize[_0x06c0('0x4')]},'apiKey':{'type':Sequelize[_0x06c0('0x4')]},'applicationId':{'type':Sequelize[_0x06c0('0x4')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x06c0('0x4')]},'notificationTemplate':{'type':Sequelize[_0x06c0('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x06c0('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x06c0('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x06c0('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x06c0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x06c0('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x06c0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x06c0('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x06c0('0xd')],'defaultValue':![],'comment':_0x06c0('0xf'),'set':function(_0x404330){if(!_0x404330)this['setDataValue'](_0x06c0('0x10'),null);this['setDataValue'](_0x06c0('0x11'),_0x404330);}}}; \ No newline at end of file +var _0xc192=['csc','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','twilio','skebby','connectel','plivo','clickatell','bandwidth'];(function(_0x251a76,_0x4892f6){var _0x3859c6=function(_0x213fdb){while(--_0x213fdb){_0x251a76['push'](_0x251a76['shift']());}};_0x3859c6(++_0x4892f6);}(_0xc192,0x74));var _0x2c19=function(_0x4ddc78,_0x193393){_0x4ddc78=_0x4ddc78-0x0;var _0x4f4fb6=_0xc192[_0x4ddc78];return _0x4f4fb6;};'use strict';var Sequelize=require(_0x2c19('0x0'));var rs=require(_0x2c19('0x1'));module['exports']={'name':{'type':Sequelize[_0x2c19('0x2')],'unique':_0x2c19('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2c19('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x2c19('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x2c19('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x2c19('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2c19('0x4'),_0x2c19('0x5'),_0x2c19('0x6'),'clicksend',_0x2c19('0x7'),_0x2c19('0x8'),_0x2c19('0x9'),_0x2c19('0xa'),_0x2c19('0xb'),_0x2c19('0xc'))},'accountSid':{'type':Sequelize[_0x2c19('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x2c19('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2c19('0x2')]},'password':{'type':Sequelize[_0x2c19('0x2')]},'apiKey':{'type':Sequelize[_0x2c19('0x2')]},'applicationId':{'type':Sequelize[_0x2c19('0x2')]},'accountId':{'type':Sequelize[_0x2c19('0x2')]},'senderString':{'type':Sequelize[_0x2c19('0x2')]},'deliveryReport':{'type':Sequelize[_0x2c19('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x2c19('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2c19('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2c19('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2c19('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c19('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2c19('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2c19('0x10')],'comment':_0x2c19('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x2c19('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3fc947){if(!_0x3fc947)this['setDataValue'](_0x2c19('0x12'),null);this[_0x2c19('0x13')](_0x2c19('0x14'),_0x3fc947);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 7d7374b..2ad4cca 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 _0xa492=['CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','twilio','from','messageId','MessageSid','skebby','text','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','SmsInteraction','interaction','created','autoclose','applications','push','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','\x0a','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','bandwidth','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','csc','state','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc'];(function(_0x38894d,_0x1883d8){var _0x5614fe=function(_0x181989){while(--_0x181989){_0x38894d['push'](_0x38894d['shift']());}};_0x5614fe(++_0x1883d8);}(_0xa492,0x69));var _0x2a49=function(_0x56d86f,_0xd57fb1){_0x56d86f=_0x56d86f-0x0;var _0x29e5be=_0xa492[_0x56d86f];return _0x29e5be;};'use strict';var emlformat=require(_0x2a49('0x0'));var rimraf=require(_0x2a49('0x1'));var zipdir=require(_0x2a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a49('0x3'));var moment=require(_0x2a49('0x4'));var BPromise=require(_0x2a49('0x5'));var Mustache=require(_0x2a49('0x6'));var util=require('util');var path=require(_0x2a49('0x7'));var sox=require(_0x2a49('0x8'));var csv=require(_0x2a49('0x9'));var ejs=require(_0x2a49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a49('0xb'));var squel=require(_0x2a49('0xc'));var crypto=require('crypto');var jsforce=require(_0x2a49('0xd'));var deskjs=require(_0x2a49('0xe'));var toCsv=require(_0x2a49('0x9'));var querystring=require(_0x2a49('0xf'));var Papa=require(_0x2a49('0x10'));var Redis=require(_0x2a49('0x11'));var authService=require(_0x2a49('0x12'));var qs=require(_0x2a49('0x13'));var as=require(_0x2a49('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2a49('0x15'));var utils=require('../../config/utils');var config=require(_0x2a49('0x16'));var licenseUtil=require(_0x2a49('0x17'));var db=require(_0x2a49('0x18'))['db'];config[_0x2a49('0x19')]=_[_0x2a49('0x1a')](config[_0x2a49('0x19')],{'host':_0x2a49('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x2a49('0x1c')](socket);var jayson=require(_0x2a49('0x1d'));var client=jayson[_0x2a49('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c19ac,_0x49d9b3,_0x454ff4,_0x37a3d9){return new BPromise(function(_0x5587e4,_0x426ca7){var _0x4dc085=_0x37a3d9||client;return _0x4dc085[_0x2a49('0x1f')](_0x3c19ac,_0x454ff4)[_0x2a49('0x20')](function(_0x28e682){logger[_0x2a49('0x21')](_0x2a49('0x22'),_0x49d9b3,_0x2a49('0x23'));logger[_0x2a49('0x24')](_0x2a49('0x25'),_0x49d9b3,_0x2a49('0x23'),JSON[_0x2a49('0x26')](_0x28e682));if(_0x28e682[_0x2a49('0x27')]){if(_0x28e682[_0x2a49('0x27')][_0x2a49('0x28')]===0x1f4){logger['error'](_0x2a49('0x22'),_0x49d9b3,_0x28e682[_0x2a49('0x27')][_0x2a49('0x29')]);return _0x426ca7(_0x28e682[_0x2a49('0x27')][_0x2a49('0x29')]);}logger[_0x2a49('0x27')](_0x2a49('0x22'),_0x49d9b3,_0x28e682['error'][_0x2a49('0x29')]);return _0x5587e4(_0x28e682['error'][_0x2a49('0x29')]);}else{logger[_0x2a49('0x21')](_0x2a49('0x22'),_0x49d9b3,_0x2a49('0x23'));_0x5587e4(_0x28e682[_0x2a49('0x2a')][_0x2a49('0x29')]);}})[_0x2a49('0x2b')](function(_0x538391){logger[_0x2a49('0x27')](_0x2a49('0x22'),_0x49d9b3,_0x538391);_0x426ca7(_0x538391);});});}function respondWithStatusCode(_0x33f661,_0x56a8c9){_0x56a8c9=_0x56a8c9||0xcc;return function(_0x1eaa25){if(_0x1eaa25){return _0x33f661[_0x2a49('0x2c')](_0x56a8c9);}return _0x33f661[_0x2a49('0x2d')](_0x56a8c9)['end']();};}function respondWithResult(_0x3c57de,_0x1f2fd3){_0x1f2fd3=_0x1f2fd3||0xc8;return function(_0x51b377){if(_0x51b377){return _0x3c57de[_0x2a49('0x2d')](_0x1f2fd3)[_0x2a49('0x2e')](_0x51b377);}};}function respondWithFilteredResult(_0x368a19,_0xb79042){return function(_0xca9aa8){if(_0xca9aa8){var _0x104929=typeof _0xb79042[_0x2a49('0x2f')]==='undefined'&&typeof _0xb79042[_0x2a49('0x30')]==='undefined';var _0x2befed=_0xca9aa8['count'];var _0x452985=_0x104929?0x0:_0xb79042['offset'];var _0x50c604=_0x104929?_0xca9aa8['count']:_0xb79042['offset']+_0xb79042['limit'];var _0x3d1dae;if(_0x50c604>=_0x2befed){_0x50c604=_0x2befed;_0x3d1dae=0xc8;}else{_0x3d1dae=0xce;}_0x368a19['status'](_0x3d1dae);return _0x368a19[_0x2a49('0x31')](_0x2a49('0x32'),_0x452985+'-'+_0x50c604+'/'+_0x2befed)[_0x2a49('0x2e')](_0xca9aa8);}return null;};}function patchUpdates(_0x3440e2){return function(_0x20d05a){try{jsonpatch[_0x2a49('0x33')](_0x20d05a,_0x3440e2,!![]);}catch(_0x416614){return BPromise[_0x2a49('0x34')](_0x416614);}return _0x20d05a[_0x2a49('0x35')]();};}function saveUpdates(_0x473e3e,_0x29b930){return function(_0x22552a){if(_0x22552a){return _0x22552a[_0x2a49('0x36')](_0x473e3e)['then'](function(_0x4196c3){return _0x4196c3;});}return null;};}function removeEntity(_0x437db1,_0x23a522){return function(_0x34edbe){if(_0x34edbe){return _0x34edbe[_0x2a49('0x37')]()[_0x2a49('0x20')](function(){var _0x3f0ad3=_0x34edbe[_0x2a49('0x38')]({'plain':!![]});var _0xd5cee5=_0x2a49('0x39');return db[_0x2a49('0x3a')][_0x2a49('0x37')]({'where':{'type':_0xd5cee5,'resourceId':_0x3f0ad3['id']}})[_0x2a49('0x20')](function(){return _0x34edbe;});})['then'](function(){_0x437db1[_0x2a49('0x2d')](0xcc)[_0x2a49('0x3b')]();});}};}function handleEntityNotFound(_0x5f2fdc,_0x54a5ce){return function(_0x32e15e){if(!_0x32e15e){_0x5f2fdc[_0x2a49('0x2c')](0x194);}return _0x32e15e;};}function handleError(_0x3ac392,_0x4fab61){_0x4fab61=_0x4fab61||0x1f4;return function(_0x21adf0){logger[_0x2a49('0x27')](_0x21adf0[_0x2a49('0x3c')]);if(_0x21adf0['name']){delete _0x21adf0['name'];}_0x3ac392[_0x2a49('0x2d')](_0x4fab61)[_0x2a49('0x3d')](_0x21adf0);};}exports[_0x2a49('0x3e')]=function(_0x2bbbe9,_0x537cfe){var _0x56ca2a={'include':[{'model':db[_0x2a49('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1782a7={},_0x371466={'count':0x0,'rows':[]};var _0x542a51=_[_0x2a49('0x40')](db[_0x2a49('0x41')][_0x2a49('0x42')],function(_0x37ad3e){return{'name':_0x37ad3e[_0x2a49('0x43')],'type':_0x37ad3e[_0x2a49('0x44')][_0x2a49('0x45')]};});_0x1782a7[_0x2a49('0x46')]=_['map'](_0x542a51,_0x2a49('0x47'));_0x1782a7['query']=_[_0x2a49('0x48')](_0x2bbbe9[_0x2a49('0x49')]);_0x1782a7[_0x2a49('0x4a')]=_[_0x2a49('0x4b')](_0x1782a7[_0x2a49('0x46')],_0x1782a7['query']);_0x56ca2a[_0x2a49('0x4c')]=_['intersection'](_0x1782a7[_0x2a49('0x46')],qs[_0x2a49('0x4d')](_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x4d')]));_0x56ca2a[_0x2a49('0x4c')]=_0x56ca2a[_0x2a49('0x4c')]['length']?_0x56ca2a[_0x2a49('0x4c')]:_0x1782a7[_0x2a49('0x46')];if(!_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x4e')](_0x2a49('0x4f'))){_0x56ca2a['limit']=qs[_0x2a49('0x30')](_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x30')]);_0x56ca2a['offset']=qs[_0x2a49('0x2f')](_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x2f')]);}_0x56ca2a[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x51')]);_0x56ca2a[_0x2a49('0x52')]=qs[_0x2a49('0x4a')](_[_0x2a49('0x53')](_0x2bbbe9[_0x2a49('0x49')],_0x1782a7[_0x2a49('0x4a')]),_0x542a51);if(_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x54')]){_0x56ca2a['where']=_[_0x2a49('0x55')](_0x56ca2a[_0x2a49('0x52')],{'$or':_['map'](_0x542a51,function(_0x44c83f){if(_0x44c83f['type']!==_0x2a49('0x56')){var _0x2ab182={};_0x2ab182[_0x44c83f[_0x2a49('0x47')]]={'$like':'%'+_0x2bbbe9['query'][_0x2a49('0x54')]+'%'};return _0x2ab182;}})});}_0x56ca2a=_['merge']({},_0x56ca2a,_0x2bbbe9[_0x2a49('0x57')]);var _0x4aa28a={'where':_0x56ca2a[_0x2a49('0x52')]};return db[_0x2a49('0x41')]['count'](_0x4aa28a)['then'](function(_0xcd0d24){_0x371466['count']=_0xcd0d24;if(_0x2bbbe9[_0x2a49('0x49')][_0x2a49('0x58')]){_0x56ca2a[_0x2a49('0x59')]=[{'all':!![]}];}return db[_0x2a49('0x41')][_0x2a49('0x5a')](_0x56ca2a);})['then'](function(_0x5a09c8){_0x371466[_0x2a49('0x5b')]=_0x5a09c8;return _0x371466;})[_0x2a49('0x20')](respondWithFilteredResult(_0x537cfe,_0x56ca2a))['catch'](handleError(_0x537cfe,null));};exports[_0x2a49('0x5c')]=function(_0x136a18,_0x1e685b){var _0x51abdf={'raw':![],'where':{'id':_0x136a18[_0x2a49('0x5d')]['id']},'include':[{'model':db[_0x2a49('0x3f')],'as':_0x2a49('0x5e')}]},_0x44627f={};_0x44627f[_0x2a49('0x46')]=_[_0x2a49('0x48')](db['SmsAccount'][_0x2a49('0x42')]);_0x44627f[_0x2a49('0x49')]=_['keys'](_0x136a18['query']);_0x44627f[_0x2a49('0x4a')]=_['intersection'](_0x44627f['model'],_0x44627f[_0x2a49('0x49')]);_0x51abdf[_0x2a49('0x4c')]=_['intersection'](_0x44627f[_0x2a49('0x46')],qs[_0x2a49('0x4d')](_0x136a18['query']['fields']));_0x51abdf[_0x2a49('0x4c')]=_0x51abdf[_0x2a49('0x4c')][_0x2a49('0x5f')]?_0x51abdf[_0x2a49('0x4c')]:_0x44627f[_0x2a49('0x46')];if(_0x136a18[_0x2a49('0x49')][_0x2a49('0x58')]){_0x51abdf[_0x2a49('0x59')]=[{'all':!![]}];}_0x51abdf=_[_0x2a49('0x55')]({},_0x51abdf,_0x136a18['options']);return db['SmsAccount']['find'](_0x51abdf)[_0x2a49('0x20')](handleEntityNotFound(_0x1e685b,null))[_0x2a49('0x20')](respondWithResult(_0x1e685b,null))['catch'](handleError(_0x1e685b,null));};exports[_0x2a49('0x60')]=function(_0x48cec6,_0x508baa){return db[_0x2a49('0x41')][_0x2a49('0x60')](_0x48cec6['body'],{})[_0x2a49('0x20')](function(_0x380e16){var _0x13412c=_0x48cec6[_0x2a49('0x61')][_0x2a49('0x38')]({'plain':!![]});if(!_0x13412c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13412c[_0x2a49('0x62')]==='user'){var _0x42157e=_0x380e16[_0x2a49('0x38')]({'plain':!![]});var _0x30ab86=_0x2a49('0x39');return db[_0x2a49('0x63')][_0x2a49('0x64')]({'where':{'name':_0x30ab86,'userProfileId':_0x13412c[_0x2a49('0x65')]},'raw':!![]})[_0x2a49('0x20')](function(_0x3c1150){if(_0x3c1150&&_0x3c1150[_0x2a49('0x66')]===0x0){return db['UserProfileResource'][_0x2a49('0x60')]({'name':_0x42157e[_0x2a49('0x47')],'resourceId':_0x42157e['id'],'type':_0x3c1150[_0x2a49('0x47')],'sectionId':_0x3c1150['id']},{})[_0x2a49('0x20')](function(){return _0x380e16;});}else{return _0x380e16;}})[_0x2a49('0x2b')](function(_0x3872bd){logger['error'](_0x2a49('0x67'),_0x3872bd);throw _0x3872bd;});}return _0x380e16;})[_0x2a49('0x20')](respondWithResult(_0x508baa,0xc9))[_0x2a49('0x2b')](handleError(_0x508baa,null));};exports[_0x2a49('0x36')]=function(_0x1977b7,_0x921c51){if(_0x1977b7[_0x2a49('0x68')]['id']){delete _0x1977b7[_0x2a49('0x68')]['id'];}return db['SmsAccount'][_0x2a49('0x64')]({'where':{'id':_0x1977b7[_0x2a49('0x5d')]['id']},'include':[{'model':db[_0x2a49('0x3f')],'as':_0x2a49('0x5e')}]})[_0x2a49('0x20')](handleEntityNotFound(_0x921c51,null))['then'](saveUpdates(_0x1977b7['body'],null))[_0x2a49('0x20')](respondWithResult(_0x921c51,null))[_0x2a49('0x2b')](handleError(_0x921c51,null));};exports['destroy']=function(_0x266e6b,_0x242cf2){return db[_0x2a49('0x41')]['find']({'where':{'id':_0x266e6b[_0x2a49('0x5d')]['id']}})['then'](handleEntityNotFound(_0x242cf2,null))[_0x2a49('0x20')](removeEntity(_0x242cf2,null))['catch'](handleError(_0x242cf2,null));};exports[_0x2a49('0x69')]=function(_0x5ebdf9,_0x17061b){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x17061b,null))[_0x2a49('0x2b')](handleError(_0x17061b,null));};exports[_0x2a49('0x6a')]=function(_0x44faac,_0x48c4eb,_0x401fcf){if(_0x44faac[_0x2a49('0x68')]['id']){delete _0x44faac[_0x2a49('0x68')]['id'];}return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x44faac[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x48c4eb,null))['then'](function(_0x4908e1){if(_0x4908e1){_0x44faac['body'][_0x2a49('0x6b')]=_0x4908e1['id'];return db[_0x2a49('0x6c')]['create'](_0x44faac[_0x2a49('0x68')]);}})[_0x2a49('0x20')](respondWithResult(_0x48c4eb,null))[_0x2a49('0x2b')](handleError(_0x48c4eb,null));};exports[_0x2a49('0x6d')]=function(_0x31318a,_0x30daf3,_0x317a46){var _0x37517a={'raw':![],'where':{}};var _0x56eae6={};var _0x58b1d0={'count':0x0,'rows':[]};return db[_0x2a49('0x41')][_0x2a49('0x6e')]({'where':{'id':_0x31318a['params']['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x30daf3,null))[_0x2a49('0x20')](function(_0x3210fa){if(_0x3210fa){_0x56eae6['model']=_['keys'](db[_0x2a49('0x6c')][_0x2a49('0x42')]);_0x56eae6[_0x2a49('0x49')]=_[_0x2a49('0x48')](_0x31318a[_0x2a49('0x49')]);_0x56eae6[_0x2a49('0x4a')]=_[_0x2a49('0x4b')](_0x56eae6[_0x2a49('0x46')],_0x56eae6[_0x2a49('0x49')]);_0x37517a['attributes']=_[_0x2a49('0x4b')](_0x56eae6['model'],qs[_0x2a49('0x4d')](_0x31318a[_0x2a49('0x49')][_0x2a49('0x4d')]));_0x37517a[_0x2a49('0x4c')]=_0x37517a[_0x2a49('0x4c')]['length']?_0x37517a[_0x2a49('0x4c')]:_0x56eae6[_0x2a49('0x46')];if(!_0x31318a[_0x2a49('0x49')]['hasOwnProperty'](_0x2a49('0x4f'))){_0x37517a[_0x2a49('0x30')]=qs[_0x2a49('0x30')](_0x31318a[_0x2a49('0x49')][_0x2a49('0x30')]);_0x37517a[_0x2a49('0x2f')]=qs[_0x2a49('0x2f')](_0x31318a['query'][_0x2a49('0x2f')]);}_0x37517a[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x31318a[_0x2a49('0x49')][_0x2a49('0x51')]);_0x37517a[_0x2a49('0x52')]=qs[_0x2a49('0x4a')](_[_0x2a49('0x53')](_0x31318a[_0x2a49('0x49')],_0x56eae6['filters']));_0x37517a[_0x2a49('0x52')][_0x2a49('0x6b')]=_0x3210fa['id'];if(_0x31318a[_0x2a49('0x49')]['filter']){_0x37517a[_0x2a49('0x52')]=_[_0x2a49('0x55')](_0x37517a[_0x2a49('0x52')],{'$or':_[_0x2a49('0x40')](_0x37517a[_0x2a49('0x4c')],function(_0x35948c){var _0x27bd4b={};_0x27bd4b[_0x35948c]={'$like':'%'+_0x31318a[_0x2a49('0x49')]['filter']+'%'};return _0x27bd4b;})});}_0x37517a=_[_0x2a49('0x55')]({},_0x37517a,_0x31318a[_0x2a49('0x57')]);return db[_0x2a49('0x6c')]['count']({'where':_0x37517a['where']})['then'](function(_0x41b161){_0x58b1d0[_0x2a49('0x6f')]=_0x41b161;if(_0x31318a[_0x2a49('0x49')][_0x2a49('0x58')]){_0x37517a[_0x2a49('0x59')]=[{'all':!![]}];}return db[_0x2a49('0x6c')][_0x2a49('0x5a')](_0x37517a);})[_0x2a49('0x20')](function(_0x403808){_0x58b1d0['rows']=_0x403808;return _0x58b1d0;});}})[_0x2a49('0x20')](respondWithFilteredResult(_0x30daf3,_0x37517a))[_0x2a49('0x2b')](handleError(_0x30daf3,null));};exports[_0x2a49('0x70')]=function(_0x58a205,_0x1c87bc,_0x510e3b){return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x58a205[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x1c87bc,null))[_0x2a49('0x20')](function(_0x47fe0a){if(_0x47fe0a){return _0x47fe0a[_0x2a49('0x70')](_0x58a205[_0x2a49('0x49')][_0x2a49('0x71')]);}})[_0x2a49('0x20')](respondWithStatusCode(_0x1c87bc,null))[_0x2a49('0x2b')](handleError(_0x1c87bc,null));};exports[_0x2a49('0x72')]=function(_0x46447d,_0x1b6a57,_0x37300f){if(_0x46447d[_0x2a49('0x68')]['id']){delete _0x46447d[_0x2a49('0x68')]['id'];}return db['SmsAccount'][_0x2a49('0x64')]({'where':{'id':_0x46447d[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x1b6a57,null))[_0x2a49('0x20')](function(_0x5b5904){if(_0x5b5904){_0x46447d['body'][_0x2a49('0x6b')]=_0x5b5904['id'];return db['CannedAnswer'][_0x2a49('0x60')](_0x46447d[_0x2a49('0x68')]);}})[_0x2a49('0x20')](respondWithResult(_0x1b6a57,null))[_0x2a49('0x2b')](handleError(_0x1b6a57,null));};exports[_0x2a49('0x73')]=function(_0x24bdf6,_0x224ba9,_0x1ef316){var _0x1838f2={'raw':![],'where':{}};var _0x2ba344={};var _0x235023={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2a49('0x6e')]({'where':{'id':_0x24bdf6[_0x2a49('0x5d')]['id']}})['then'](handleEntityNotFound(_0x224ba9,null))['then'](function(_0x4be739){if(_0x4be739){_0x2ba344['model']=_[_0x2a49('0x48')](db[_0x2a49('0x74')][_0x2a49('0x42')]);_0x2ba344['query']=_[_0x2a49('0x48')](_0x24bdf6[_0x2a49('0x49')]);_0x2ba344[_0x2a49('0x4a')]=_[_0x2a49('0x4b')](_0x2ba344[_0x2a49('0x46')],_0x2ba344[_0x2a49('0x49')]);_0x1838f2[_0x2a49('0x4c')]=_[_0x2a49('0x4b')](_0x2ba344['model'],qs[_0x2a49('0x4d')](_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x4d')]));_0x1838f2[_0x2a49('0x4c')]=_0x1838f2[_0x2a49('0x4c')]['length']?_0x1838f2['attributes']:_0x2ba344[_0x2a49('0x46')];if(!_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x4e')]('nolimit')){_0x1838f2[_0x2a49('0x30')]=qs['limit'](_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x30')]);_0x1838f2[_0x2a49('0x2f')]=qs[_0x2a49('0x2f')](_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x2f')]);}_0x1838f2[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x51')]);_0x1838f2[_0x2a49('0x52')]=qs['filters'](_['pick'](_0x24bdf6[_0x2a49('0x49')],_0x2ba344[_0x2a49('0x4a')]));_0x1838f2[_0x2a49('0x52')][_0x2a49('0x6b')]=_0x4be739['id'];if(_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x54')]){_0x1838f2['where']=_[_0x2a49('0x55')](_0x1838f2[_0x2a49('0x52')],{'$or':_['map'](_0x1838f2['attributes'],function(_0x162044){var _0x1e478b={};_0x1e478b[_0x162044]={'$like':'%'+_0x24bdf6[_0x2a49('0x49')][_0x2a49('0x54')]+'%'};return _0x1e478b;})});}_0x1838f2=_[_0x2a49('0x55')]({},_0x1838f2,_0x24bdf6[_0x2a49('0x57')]);return db['CannedAnswer']['count']({'where':_0x1838f2[_0x2a49('0x52')]})['then'](function(_0x19895d){_0x235023[_0x2a49('0x6f')]=_0x19895d;if(_0x24bdf6['query'][_0x2a49('0x58')]){_0x1838f2['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x2a49('0x5a')](_0x1838f2);})[_0x2a49('0x20')](function(_0x36e004){_0x235023[_0x2a49('0x5b')]=_0x36e004;return _0x235023;});}})['then'](respondWithFilteredResult(_0x224ba9,_0x1838f2))[_0x2a49('0x2b')](handleError(_0x224ba9,null));};exports[_0x2a49('0x75')]=function(_0x3cfa58,_0x29bdf9,_0x4a6307){return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x3cfa58['params']['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x29bdf9,null))[_0x2a49('0x20')](function(_0x15e983){if(_0x15e983){return _0x15e983[_0x2a49('0x75')](_0x3cfa58['query'][_0x2a49('0x71')]);}})[_0x2a49('0x20')](respondWithStatusCode(_0x29bdf9,null))[_0x2a49('0x2b')](handleError(_0x29bdf9,null));};exports[_0x2a49('0x76')]=function(_0x24dd49,_0x288747,_0x156f5d){var _0x165d9a={'channel':_0x2a49('0x77')};var _0x723f82=[];var _0x4c1696=[];var _0x278cba={};return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x24dd49[_0x2a49('0x5d')]['id']},'include':[{'model':db[_0x2a49('0x78')],'as':_0x2a49('0x79')}]})[_0x2a49('0x20')](handleEntityNotFound(_0x288747,null))[_0x2a49('0x20')](function(_0x13ba8f){_0x165d9a[_0x2a49('0x7a')]=_0x13ba8f;_0x165d9a['applications']=_[_0x2a49('0x7b')](_0x13ba8f[_0x2a49('0x79')],[_0x2a49('0x7c')],[_0x2a49('0x7d')]);if(_0x165d9a[_0x2a49('0x7a')][_0x2a49('0x79')]){delete _0x165d9a[_0x2a49('0x7a')][_0x2a49('0x79')];}return db[_0x2a49('0x7e')][_0x2a49('0x69')]();})[_0x2a49('0x20')](function(_0x34ef90){if(!_0x34ef90){throw new db[(_0x2a49('0x7f'))]['ValidationError'](_0x2a49('0x80'));}_0x723f82=_['difference'](_[_0x2a49('0x48')](_0x34ef90),[_0x2a49('0x81'),_0x2a49('0x82')]);_0x4c1696=_[_0x2a49('0x83')](_[_0x2a49('0x48')](_0x34ef90),[_0x2a49('0x81'),_0x2a49('0x82'),_0x2a49('0x84'),'ListId']);_0x165d9a['body']={'mapKey':'mobile'};if(_0x165d9a[_0x2a49('0x7a')]['type']){switch(_0x165d9a[_0x2a49('0x7a')][_0x2a49('0x44')]){case _0x2a49('0x85'):_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')]=_0x24dd49['body']['From'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')]['Body'];_0x165d9a['body'][_0x2a49('0x87')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x88')];break;case _0x2a49('0x89'):_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')]='+'+_0x24dd49['body']['sender'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x8a')];break;case'connectel':_0x165d9a['body'][_0x2a49('0x86')]=_0x24dd49['body']['from'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')]['message'];break;case _0x2a49('0x8b'):_0x165d9a['body']['from']=_0x24dd49[_0x2a49('0x68')]['from'];_0x165d9a[_0x2a49('0x68')]['body']=_0x24dd49['body']['body'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x87')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x8c')];break;case _0x2a49('0x8d'):_0x165d9a[_0x2a49('0x68')]['from']=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x8e')];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x8f')];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x87')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x90')];break;case _0x2a49('0x91'):_0x165d9a[_0x2a49('0x68')]['from']='+'+_0x24dd49[_0x2a49('0x68')][_0x2a49('0x92')][0x0]['from'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x92')][0x0]['text'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x87')]=_0x24dd49[_0x2a49('0x68')]['results'][0x0][_0x2a49('0x87')];break;case'csc':_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x93')];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x94')][_0x2a49('0x29')];break;case _0x2a49('0x95'):_0x165d9a['body'][_0x2a49('0x86')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x96')];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49['body'][_0x2a49('0x8a')];_0x165d9a[_0x2a49('0x68')]['messageId']=_0x24dd49['body'][_0x2a49('0x97')];break;case'bandwidth':_0x165d9a[_0x2a49('0x68')][_0x2a49('0x87')]=_0x24dd49[_0x2a49('0x68')][0x0][_0x2a49('0x29')]['id'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')]=_0x24dd49[_0x2a49('0x68')][0x0][_0x2a49('0x29')]['from'];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49[_0x2a49('0x68')][0x0][_0x2a49('0x29')]['text'];break;case _0x2a49('0x98'):_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')]=_0x24dd49[_0x2a49('0x68')][_0x2a49('0x86')];_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]=_0x24dd49['body'][_0x2a49('0x29')];_0x165d9a[_0x2a49('0x68')]['messageId']=_0x24dd49[_0x2a49('0x68')]['refid'];break;}}if(_0x165d9a[_0x2a49('0x68')]['id']){delete _0x165d9a[_0x2a49('0x68')]['id'];}if(_[_0x2a49('0x99')](_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')])){throw new db[(_0x2a49('0x7f'))][(_0x2a49('0x9a'))](_0x2a49('0x9b'));}if(_[_0x2a49('0x99')](_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')])||_0x165d9a[_0x2a49('0x68')][_0x2a49('0x68')]===''){throw new db[(_0x2a49('0x7f'))][(_0x2a49('0x9a'))](_0x2a49('0x9c'));}if(_['isNil'](_0x165d9a[_0x2a49('0x68')][_0x2a49('0x9d')])){throw new db[(_0x2a49('0x7f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c1696);}if(!_[_0x2a49('0x9e')](_0x4c1696,_0x165d9a[_0x2a49('0x68')][_0x2a49('0x9d')])){throw new db[(_0x2a49('0x7f'))][(_0x2a49('0x9a'))](_0x2a49('0x9f')+_0x4c1696);}_0x278cba[_0x165d9a[_0x2a49('0x68')][_0x2a49('0x9d')]]=_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')];return db[_0x2a49('0xa0')][_0x2a49('0x64')]({'where':{'id':_0x165d9a[_0x2a49('0x7a')][_0x2a49('0xa1')]},'include':[{'model':db[_0x2a49('0x7e')],'as':_0x2a49('0xa2'),'where':_0x278cba,'limit':0x1,'order':[[_0x2a49('0x82'),_0x2a49('0xa3')]]}]});})[_0x2a49('0x20')](handleEntityNotFound(_0x288747,null))[_0x2a49('0x20')](function(_0xc17ec){if(_0xc17ec){_0x165d9a[_0x2a49('0xa4')]=_['omit'](_0xc17ec,[_0x2a49('0xa2')]);if(_0xc17ec[_0x2a49('0xa2')][_0x2a49('0x5f')]){return _0xc17ec[_0x2a49('0xa2')][0x0];}var _0x2b0df8=_[_0x2a49('0x1a')](_0x165d9a[_0x2a49('0x68')],{'firstName':_0x165d9a[_0x2a49('0x68')]['from'],'ListId':_0xc17ec['id']});_0x2b0df8[_0x165d9a['body']['mapKey']]=_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')];return db[_0x2a49('0x7e')][_0x2a49('0x60')](_0x2b0df8,{'fields':_0x723f82,'raw':!![]});}})[_0x2a49('0x20')](handleEntityNotFound(_0x288747,null))[_0x2a49('0x20')](function(_0x3141f8){if(_0x3141f8){_0x165d9a['contact']=_0x3141f8;var _0x186117={'ContactId':_0x3141f8['id'],'phone':_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')],'SmsAccountId':_0x24dd49[_0x2a49('0x5d')]['id']};var _0x4b0434={'ContactId':_0x3141f8['id'],'SmsAccountId':_0x24dd49['params']['id'],'closed':![]};return db[_0x2a49('0xa5')][_0x2a49('0x64')]({'where':_0x4b0434})[_0x2a49('0x20')](function(_0x240255){if(_0x240255){return[_0x240255,![]];}return db[_0x2a49('0xa5')][_0x2a49('0x60')](_0x186117)['then'](function(_0x507f27){return[_0x507f27,!![]];});});}})['spread'](function(_0x5b39c4,_0x15f8de){_0x165d9a[_0x2a49('0xa6')]=_0x5b39c4[_0x2a49('0x38')]({'plain':!![]});_0x165d9a[_0x2a49('0xa6')][_0x2a49('0xa7')]=![];if(_0x15f8de){if(_0x165d9a[_0x2a49('0x7a')][_0x2a49('0xa8')]){_0x165d9a[_0x2a49('0xa9')][_0x2a49('0xaa')]({'id':0x0,'priority':_0x165d9a['applications'][_0x2a49('0x5f')]+0x1,'app':'close','appdata':_0x2a49('0xab'),'interval':_0x2a49('0xac')});}_0x165d9a[_0x2a49('0xa6')][_0x2a49('0xa7')]=!![];}return db[_0x2a49('0xad')][_0x2a49('0x60')]({'phone':_0x165d9a[_0x2a49('0x68')][_0x2a49('0x86')],'messageId':_0x165d9a[_0x2a49('0x68')][_0x2a49('0x87')],'body':_0x165d9a['body'][_0x2a49('0x68')],'SmsAccountId':_0x24dd49[_0x2a49('0x5d')]['id'],'SmsInteractionId':_0x5b39c4['id'],'direction':'in','ContactId':_0x5b39c4['ContactId'],'AttachmentId':_0x165d9a[_0x2a49('0x68')][_0x2a49('0xae')]});})[_0x2a49('0x20')](function(_0x3e78eb){_0x165d9a[_0x2a49('0x29')]=_0x3e78eb;if(_0x165d9a[_0x2a49('0xa6')][_0x2a49('0xaf')]){return db[_0x2a49('0xb0')]['find']({'attributes':['id','name'],'where':{'id':_0x165d9a[_0x2a49('0xa6')][_0x2a49('0xaf')]}})[_0x2a49('0x20')](function(_0x29067e){if(_0x29067e){_0x165d9a[_0x2a49('0xa9')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2a49('0xb1'),'appdata':_0x29067e[_0x2a49('0x47')]+','+(_0x165d9a[_0x2a49('0x7a')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2a49('0xb2'),_0x2a49('0xb3'),_0x165d9a);});}return respondWithRpcPromise(_0x2a49('0xb2'),_0x2a49('0xb3'),_0x165d9a);})['then'](function(_0x3b9b16){if(_0x3b9b16){var _0xc6422f=0xc8;var _0x505c27=_0x2a49('0xb4');logger[_0x2a49('0x21')](_0x2a49('0x25'),_0x505c27,_0xc6422f,_0x2a49('0xb5'));logger[_0x2a49('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x505c27,_0xc6422f,_0x2a49('0xb5'),JSON['stringify'](_0x3b9b16));if(_0x165d9a[_0x2a49('0x7a')][_0x2a49('0x44')]===_0x2a49('0x85')){return _0x288747[_0x2a49('0x2d')](_0xc6422f)[_0x2a49('0x31')](_0x2a49('0xb6'),'text/xml')[_0x2a49('0x3d')](_0x2a49('0xb7'));}else{return _0x288747[_0x2a49('0x2d')](_0xc6422f)[_0x2a49('0x2e')](_0x3b9b16);}}})[_0x2a49('0x2b')](handleError(_0x288747,null));};exports[_0x2a49('0xb8')]=function(_0x11ea18,_0x411de3){var _0x1ee337=_0x11ea18['params']['id'];var _0x58eca1=_0x11ea18[_0x2a49('0x68')];var _0x3128dd=0xc8;var _0x18b419=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2a49('0xb9')]['Transaction'][_0x2a49('0xba')][_0x2a49('0xbb')]},function(_0x3f319c){return db[_0x2a49('0x41')][_0x2a49('0x6e')]({'where':{'id':_0x1ee337},'transaction':_0x3f319c})[_0x2a49('0x20')](function(_0x36ea28){if(_0x36ea28){return db[_0x2a49('0x78')]['destroy']({'where':{'SmsAccountId':_0x1ee337},'transaction':_0x3f319c})[_0x2a49('0x20')](function(){var _0x57a292=_['map'](_0x58eca1,function(_0x577ea5){_0x577ea5[_0x2a49('0x6b')]=_0x1ee337;return _0x577ea5;});return db[_0x2a49('0x78')]['bulkCreate'](_0x57a292,{'transaction':_0x3f319c});});}else{_0x3128dd=0x194;_0x18b419=[];}});})['then'](function(){if(_0x3128dd!==0x194){return db[_0x2a49('0x78')][_0x2a49('0xbc')]({'where':{'SmsAccountId':_0x1ee337},'order':_0x2a49('0x7c')})[_0x2a49('0x20')](function(_0x36b02e){_0x18b419=_0x36b02e;});}})['catch'](function(_0x251a21){_0x3128dd=0x1f4;logger[_0x2a49('0x27')](_0x251a21['stack']);if(_0x251a21[_0x2a49('0x47')]){delete _0x251a21[_0x2a49('0x47')];}_0x18b419=_0x251a21;})['finally'](function(){if(_0x18b419===null){_0x411de3[_0x2a49('0x2c')](_0x3128dd);}else{if(_0x3128dd===0x1f4){_0x411de3[_0x2a49('0x2d')](_0x3128dd)['send'](_0x18b419);}else{_0x411de3[_0x2a49('0x2d')](_0x3128dd)[_0x2a49('0x2e')](_0x18b419);}}});};exports['getApplications']=function(_0x30bea3,_0x1e64b6,_0x58f7cf){var _0x31a508={};var _0x350036={};var _0x4790e3;var _0x504753;return db[_0x2a49('0x41')][_0x2a49('0x6e')]({'where':{'id':_0x30bea3[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x1e64b6,null))['then'](function(_0x3f7641){if(_0x3f7641){_0x4790e3=_0x3f7641;_0x350036['model']=_[_0x2a49('0x48')](db['SmsApplication'][_0x2a49('0x42')]);_0x350036[_0x2a49('0x49')]=_[_0x2a49('0x48')](_0x30bea3['query']);_0x350036[_0x2a49('0x4a')]=_[_0x2a49('0x4b')](_0x350036['model'],_0x350036[_0x2a49('0x49')]);_0x31a508[_0x2a49('0x4c')]=_['intersection'](_0x350036['model'],qs[_0x2a49('0x4d')](_0x30bea3[_0x2a49('0x49')][_0x2a49('0x4d')]));_0x31a508[_0x2a49('0x4c')]=_0x31a508['attributes'][_0x2a49('0x5f')]?_0x31a508[_0x2a49('0x4c')]:_0x350036[_0x2a49('0x46')];_0x31a508[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x30bea3[_0x2a49('0x49')][_0x2a49('0x51')]);_0x31a508[_0x2a49('0x52')]=qs[_0x2a49('0x4a')](_['pick'](_0x30bea3['query'],_0x350036[_0x2a49('0x4a')]));if(_0x30bea3[_0x2a49('0x49')][_0x2a49('0x54')]){_0x31a508[_0x2a49('0x52')]=_[_0x2a49('0x55')](_0x31a508['where'],{'$or':_['map'](_0x31a508[_0x2a49('0x4c')],function(_0x596e8c){var _0xc9b03e={};_0xc9b03e[_0x596e8c]={'$like':'%'+_0x30bea3['query'][_0x2a49('0x54')]+'%'};return _0xc9b03e;})});}_0x31a508=_['merge']({},_0x31a508,_0x30bea3[_0x2a49('0x57')]);return _0x4790e3[_0x2a49('0xbd')](_0x31a508);}})[_0x2a49('0x20')](function(_0x2fb150){if(_0x2fb150){_0x504753=_0x2fb150['length'];if(!_0x30bea3[_0x2a49('0x49')]['hasOwnProperty'](_0x2a49('0x4f'))){_0x31a508[_0x2a49('0x30')]=qs['limit'](_0x30bea3['query'][_0x2a49('0x30')]);_0x31a508[_0x2a49('0x2f')]=qs[_0x2a49('0x2f')](_0x30bea3[_0x2a49('0x49')][_0x2a49('0x2f')]);}return _0x4790e3[_0x2a49('0xbd')](_0x31a508);}})[_0x2a49('0x20')](function(_0x4d5a0f){if(_0x4d5a0f){return _0x4d5a0f?{'count':_0x504753,'rows':_0x4d5a0f}:null;}})[_0x2a49('0x20')](respondWithResult(_0x1e64b6,null))['catch'](handleError(_0x1e64b6,null));};exports[_0x2a49('0xbe')]=function(_0x2718eb,_0x23e14e,_0x5d83fd){var _0x24b273={'raw':![],'where':{}};var _0x2624fc={};var _0x52cf99={'count':0x0,'rows':[]};return db[_0x2a49('0x41')]['findOne']({'where':{'id':_0x2718eb[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x23e14e,null))[_0x2a49('0x20')](function(_0x3e218f){if(_0x3e218f){_0x2624fc[_0x2a49('0x46')]=_[_0x2a49('0x48')](db[_0x2a49('0xa5')][_0x2a49('0x42')]);_0x2624fc[_0x2a49('0x49')]=_[_0x2a49('0x48')](_0x2718eb[_0x2a49('0x49')]);_0x2624fc[_0x2a49('0x4a')]=_['intersection'](_0x2624fc['model'],_0x2624fc[_0x2a49('0x49')]);_0x24b273['attributes']=_['intersection'](_0x2624fc[_0x2a49('0x46')],qs[_0x2a49('0x4d')](_0x2718eb[_0x2a49('0x49')]['fields']));_0x24b273[_0x2a49('0x4c')]=_0x24b273[_0x2a49('0x4c')][_0x2a49('0x5f')]?_0x24b273[_0x2a49('0x4c')]:_0x2624fc[_0x2a49('0x46')];if(!_0x2718eb[_0x2a49('0x49')][_0x2a49('0x4e')](_0x2a49('0x4f'))){_0x24b273[_0x2a49('0x30')]=qs['limit'](_0x2718eb['query'][_0x2a49('0x30')]);_0x24b273[_0x2a49('0x2f')]=qs[_0x2a49('0x2f')](_0x2718eb['query'][_0x2a49('0x2f')]);}_0x24b273[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x2718eb[_0x2a49('0x49')]['sort']);_0x24b273[_0x2a49('0x52')]=qs[_0x2a49('0x4a')](_['pick'](_0x2718eb['query'],_0x2624fc['filters']));_0x24b273[_0x2a49('0x52')][_0x2a49('0x6b')]=_0x3e218f['id'];if(_0x2718eb['query'][_0x2a49('0x54')]){_0x24b273[_0x2a49('0x52')]=_['merge'](_0x24b273[_0x2a49('0x52')],{'$or':_[_0x2a49('0x40')](_0x24b273['attributes'],function(_0x579b27){var _0x42dce7={};_0x42dce7[_0x579b27]={'$like':'%'+_0x2718eb[_0x2a49('0x49')]['filter']+'%'};return _0x42dce7;})});}_0x24b273=_['merge']({},_0x24b273,_0x2718eb['options']);return db[_0x2a49('0xa5')][_0x2a49('0x6f')]({'where':_0x24b273[_0x2a49('0x52')]})['then'](function(_0x114ccc){_0x52cf99[_0x2a49('0x6f')]=_0x114ccc;if(_0x2718eb[_0x2a49('0x49')]['includeAll']){_0x24b273[_0x2a49('0x59')]=[{'model':db[_0x2a49('0x7e')],'as':_0x2a49('0xbf'),'required':![]},{'model':db[_0x2a49('0xb0')],'as':_0x2a49('0xc0'),'attributes':[_0x2a49('0x47'),_0x2a49('0xc1'),_0x2a49('0xc2')],'required':![]},{'model':db[_0x2a49('0xc3')],'as':_0x2a49('0xc4'),'attributes':['id',_0x2a49('0x47'),_0x2a49('0xc5')],'where':_0x2718eb[_0x2a49('0x49')][_0x2a49('0xc6')]?{'id':_0x2718eb['query'][_0x2a49('0xc6')]}:undefined,'required':_0x2718eb[_0x2a49('0x49')]['tag']?!![]:![]}];}return db[_0x2a49('0xa5')][_0x2a49('0x5a')](_0x24b273);})[_0x2a49('0x20')](function(_0x40ba6d){_0x52cf99[_0x2a49('0x5b')]=_0x40ba6d;return _0x52cf99;});}})[_0x2a49('0x20')](respondWithFilteredResult(_0x23e14e,_0x24b273))[_0x2a49('0x2b')](handleError(_0x23e14e,null));};exports[_0x2a49('0x3d')]=function(_0x58e3b0,_0x3a75c2,_0x5b2315){var _0x544082,_0xddd41e,_0xb109f8;if(_[_0x2a49('0x99')](_0x58e3b0[_0x2a49('0x68')][_0x2a49('0x68')])||_0x58e3b0['body']['body']===''){throw new db['Sequelize'][(_0x2a49('0x9a'))](_0x2a49('0x9c'));}if(_[_0x2a49('0x99')](_0x58e3b0[_0x2a49('0x68')]['to'])){throw new db[(_0x2a49('0x7f'))][(_0x2a49('0x9a'))](_0x2a49('0xc7'));}_0x544082=_0x58e3b0['body']['to'];return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x58e3b0[_0x2a49('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2a49('0x7e')],'as':'Contacts','where':{'mobile':_0x544082},'limit':0x1,'order':[['updatedAt',_0x2a49('0xa3')]]}]}]})[_0x2a49('0x20')](handleEntityNotFound(_0x3a75c2,null))['then'](function(_0x500aef){if(_0x500aef&&_0x500aef[_0x2a49('0xc8')]){_0xddd41e=_0x500aef['get']({'plain':!![]});if(_0xddd41e[_0x2a49('0xc8')]&&_0xddd41e[_0x2a49('0xc8')][_0x2a49('0xa2')][_0x2a49('0x5f')]){return _0xddd41e[_0x2a49('0xc8')][_0x2a49('0xa2')][0x0];}return db[_0x2a49('0x7e')][_0x2a49('0x60')](_['defaults'](_0x58e3b0['body'],{'firstName':_0x544082,'mobile':_0x544082,'phone':_0x544082,'ListId':_0xddd41e[_0x2a49('0xa1')]}));}})[_0x2a49('0x20')](handleEntityNotFound(_0x3a75c2,null))[_0x2a49('0x20')](function(_0x2dfc4c){if(_0x2dfc4c){_0xb109f8=_0x2dfc4c;return db[_0x2a49('0xa5')][_0x2a49('0x64')]({'where':{'ContactId':_0xb109f8['id'],'closed':![],'SmsAccountId':_0xddd41e['id']}})['then'](function(_0x206655){if(_0x206655){return[_0x206655,![]];}return db[_0x2a49('0xa5')][_0x2a49('0x60')]({'UserId':_0x58e3b0[_0x2a49('0x61')]['id'],'ContactId':_0xb109f8['id'],'SmsAccountId':_0xddd41e['id'],'phone':_0x544082,'firstMsgDirection':_0x2a49('0xc9'),'Messages':[_[_0x2a49('0x55')](_0x58e3b0[_0x2a49('0x68')],{'read':![],'body':_0x58e3b0[_0x2a49('0x68')][_0x2a49('0x68')],'phone':_0x544082,'SmsAccountId':_0xddd41e['id'],'UserId':_0x58e3b0[_0x2a49('0x61')]['id'],'ContactId':_0xb109f8['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x2a49('0xca')}]})[_0x2a49('0x20')](function(_0x4f0037){return[_0x4f0037,!![]];});});}})[_0x2a49('0xcb')](function(_0x1e0a09,_0x39368d){if(_0x39368d){return _0x1e0a09;}return db[_0x2a49('0xad')][_0x2a49('0x60')](_['merge'](_0x58e3b0[_0x2a49('0x68')],{'read':![],'body':_0x58e3b0[_0x2a49('0x68')]['body'],'phone':_0x544082,'SmsAccountId':_0xddd41e['id'],'SmsInteractionId':_0x1e0a09['id'],'UserId':_0x58e3b0[_0x2a49('0x61')]['id'],'ContactId':_0xb109f8['id']}))[_0x2a49('0x20')](function(_0x1e1fdc){_0x1e0a09[_0x2a49('0xcc')][_0x2a49('0xca')]=[];_0x1e0a09['dataValues'][_0x2a49('0xca')][_0x2a49('0xaa')](_0x1e1fdc[_0x2a49('0xcc')]);return _0x1e0a09;});})[_0x2a49('0x20')](respondWithResult(_0x3a75c2,null))[_0x2a49('0x2b')](handleError(_0x3a75c2,null));};exports[_0x2a49('0x2d')]=function(_0x30eed5,_0x41e839,_0x4fa055){if(_0x30eed5['body']['id']){delete _0x30eed5['body']['id'];}var _0x44622f,_0xdee89e,_0x516e79;return db[_0x2a49('0x41')]['find']({'where':{'id':_0x30eed5['params']['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x41e839,null))[_0x2a49('0x20')](function(_0x259fe7){if(_0x259fe7){_0x516e79=_0x259fe7;logger['debug'](_0x2a49('0x25'),_0x2a49('0x2d'),_0x2a49('0xcd'),_0x259fe7['type'],util[_0x2a49('0xce')](_0x30eed5['body'],{'showHidden':![],'depth':null}));switch(_0x259fe7[_0x2a49('0x44')]){case _0x2a49('0x89'):if(_0x30eed5[_0x2a49('0x68')][_0x2a49('0xcf')]&&_0x30eed5[_0x2a49('0x68')]['status']){_0xdee89e=_0x30eed5[_0x2a49('0x68')]['status'];return db['SmsMessage'][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5['body']['skebby_dispatch_id']}});}break;case _0x2a49('0xd0'):if(_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd1')]&&_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd2')]){_0xdee89e=_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd2')];return db[_0x2a49('0xad')][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd1')]}});}break;case _0x2a49('0x8b'):if(_0x30eed5[_0x2a49('0x68')][_0x2a49('0x8c')]&&_0x30eed5['body'][_0x2a49('0xd3')]){_0xdee89e=_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd3')];return db[_0x2a49('0xad')][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5['body'][_0x2a49('0x8c')]}});}break;case _0x2a49('0x91'):var _0x37a5e4=_0x30eed5[_0x2a49('0x68')][_0x2a49('0x92')][0x0];if(_0x37a5e4['messageId']&&_0x37a5e4[_0x2a49('0x2d')]['groupName']===_0x2a49('0xd4')){_0xdee89e=_0x37a5e4[_0x2a49('0x2d')][_0x2a49('0xd5')];return db['SmsMessage'][_0x2a49('0x64')]({'where':{'messageId':_0x37a5e4['messageId']}});}break;case _0x2a49('0x95'):if(_0x30eed5[_0x2a49('0x68')][_0x2a49('0x87')]&&_0x30eed5['body']['status']){_0xdee89e=_0x30eed5[_0x2a49('0x68')][_0x2a49('0x2d')];return db['SmsMessage'][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5[_0x2a49('0x68')][_0x2a49('0x87')]}});}break;case _0x2a49('0xd6'):if(_0x30eed5[_0x2a49('0x68')][0x0][_0x2a49('0x29')]['id']){_0xdee89e=_0x30eed5[_0x2a49('0x68')][0x0][_0x2a49('0x44')];return db[_0x2a49('0xad')][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5[_0x2a49('0x68')][0x0][_0x2a49('0x29')]['id']}});}break;case'intelepeer':if(_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd7')]&&_0x30eed5[_0x2a49('0x68')][_0x2a49('0x2d')]){_0xdee89e=_0x30eed5[_0x2a49('0x68')][_0x2a49('0x2d')];return db[_0x2a49('0xad')][_0x2a49('0x64')]({'where':{'messageId':_0x30eed5[_0x2a49('0x68')][_0x2a49('0xd7')]}});}break;}}})[_0x2a49('0x20')](handleEntityNotFound(_0x41e839,null))[_0x2a49('0x20')](function(_0xe2f731){if(_0xe2f731){_0x44622f=_0xe2f731;switch(_0x516e79[_0x2a49('0x44')]){case _0x2a49('0x89'):if(_0xdee89e==='DELIVERED'){return _0x44622f['update']({'read':!![]});}else{logger[_0x2a49('0x27')](_0x2a49('0x25'),_0x2a49('0x2d'),_0x2a49('0x89'),util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case _0x2a49('0xd0'):if(_0xdee89e==='1'){return _0x44622f[_0x2a49('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a49('0x2d'),_0x2a49('0x89'),util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case _0x2a49('0x8b'):if(!_0x30eed5[_0x2a49('0x68')]['error_code']&&_0xdee89e>=0xc8&&_0xdee89e<=0xce){return _0x44622f[_0x2a49('0x36')]({'read':!![]});}else{logger[_0x2a49('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a49('0x2d'),_0x2a49('0x8b'),util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case _0x2a49('0x91'):var _0x2c4a1f=_0x30eed5[_0x2a49('0x68')][_0x2a49('0x92')][0x0];if(_0x2c4a1f[_0x2a49('0x2d')][_0x2a49('0xd5')]===_0x2a49('0xd4')){return _0x44622f['update']({'read':!![]});}else{logger[_0x2a49('0x27')](_0x2a49('0x25'),_0x2a49('0x2d'),'infobip',util['inspect'](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case _0x2a49('0x95'):if(_0xdee89e==_0x2a49('0xd8')||_0xdee89e==_0x2a49('0xd9')){return _0x44622f[_0x2a49('0x36')]({'read':!![]});}else{logger['error'](_0x2a49('0x25'),_0x2a49('0x2d'),_0x2a49('0x95'),util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0xdee89e==_0x2a49('0xda')){return _0x44622f[_0x2a49('0x36')]({'read':!![]});}else{logger['error'](_0x2a49('0x25'),_0x2a49('0x2d'),'bandwidth',util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;case _0x2a49('0x98'):if(_0xdee89e===_0x2a49('0xdb')||_0xdee89e==='ACCEPTD'){return _0x44622f[_0x2a49('0x36')]({'read':!![]});}else{logger[_0x2a49('0x27')](_0x2a49('0x25'),_0x2a49('0x2d'),_0x2a49('0x98'),util[_0x2a49('0xce')](_0x30eed5[_0x2a49('0x68')],{'showHidden':![],'depth':null}));}break;}return _0x44622f;}})[_0x2a49('0x20')](respondWithResult(_0x41e839,null))['catch'](handleError(_0x41e839,null));};exports[_0x2a49('0xdc')]=function(_0x5fd025,_0x3a5a11,_0x1551e5){var _0x5c93c2,_0x1029fb,_0x527e25;return db[_0x2a49('0x41')]['find']({'where':{'id':_0x5fd025[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x3a5a11,null))['then'](function(_0x2ca011){if(_0x2ca011){_0x527e25=_0x2ca011;logger[_0x2a49('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a49('0x2d'),_0x2a49('0xcd'),_0x2ca011['type'],util[_0x2a49('0xce')](_0x5fd025[_0x2a49('0x49')],{'showHidden':![],'depth':null}));switch(_0x2ca011[_0x2a49('0x44')]){case _0x2a49('0xdd'):if(_0x5fd025[_0x2a49('0x49')]['message-id']&&_0x5fd025[_0x2a49('0x49')][_0x2a49('0xde')]){_0x1029fb=_0x5fd025[_0x2a49('0x49')]['state'];return db[_0x2a49('0xad')][_0x2a49('0x64')]({'where':{'messageId':_0x5fd025['query'][_0x2a49('0xdf')]}});}break;}}})[_0x2a49('0x20')](handleEntityNotFound(_0x3a5a11,null))[_0x2a49('0x20')](function(_0x50adc3){if(_0x50adc3){_0x5c93c2=_0x50adc3;switch(_0x527e25[_0x2a49('0x44')]){case _0x2a49('0xdd'):if(_0x1029fb==='2'||_0x1029fb==='6'){return _0x5c93c2[_0x2a49('0x36')]({'read':!![]});}else{logger[_0x2a49('0x27')](_0x2a49('0x25'),_0x2a49('0x2d'),'csc',util[_0x2a49('0xce')](_0x5fd025[_0x2a49('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x5c93c2;}})[_0x2a49('0x20')](respondWithResult(_0x3a5a11,null))[_0x2a49('0x2b')](handleError(_0x3a5a11,null));};exports['addAgents']=function(_0x4dd604,_0x5a36bc,_0x2cc957){return db[_0x2a49('0x41')][_0x2a49('0x64')]({'where':{'id':_0x4dd604[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x5a36bc,null))['then'](function(_0x3f782f){if(_0x3f782f){return _0x3f782f[_0x2a49('0xe0')](_0x4dd604[_0x2a49('0x68')]['ids'],_[_0x2a49('0xe1')](_0x4dd604[_0x2a49('0x68')],[_0x2a49('0x71'),'id'])||{})['spread'](function(_0xb77ffe){for(var _0x2f8fc2=0x0;_0x2f8fc2<_0x4dd604[_0x2a49('0x68')]['ids'][_0x2a49('0x5f')];_0x2f8fc2+=0x1){socket[_0x2a49('0xe2')](_0x2a49('0xe3'),{'UserId':Number(_0x4dd604['body']['ids'][_0x2f8fc2]),'SmsAccountId':Number(_0x4dd604[_0x2a49('0x5d')]['id'])});}return _0xb77ffe;});}})[_0x2a49('0x20')](respondWithResult(_0x5a36bc,null))[_0x2a49('0x2b')](handleError(_0x5a36bc,null));};exports[_0x2a49('0xe4')]=function(_0xfb0de3,_0x19ea37,_0x5db0ef){return db[_0x2a49('0x41')]['find']({'where':{'id':_0xfb0de3['params']['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x19ea37,null))['then'](function(_0x384fe5){if(_0x384fe5){return _0x384fe5[_0x2a49('0xe4')](_0xfb0de3[_0x2a49('0x49')][_0x2a49('0x71')])[_0x2a49('0x20')](function(){if(_['isArray'](_0xfb0de3[_0x2a49('0x49')]['ids'])){for(var _0x325772=0x0;_0x325772<_0xfb0de3[_0x2a49('0x49')][_0x2a49('0x71')][_0x2a49('0x5f')];_0x325772+=0x1){socket[_0x2a49('0xe2')](_0x2a49('0xe5'),{'UserId':Number(_0xfb0de3[_0x2a49('0x49')]['ids'][_0x325772]),'SmsAccountId':Number(_0xfb0de3[_0x2a49('0x5d')]['id'])});}}else{socket[_0x2a49('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0xfb0de3[_0x2a49('0x49')][_0x2a49('0x71')]),'SmsAccountId':Number(_0xfb0de3[_0x2a49('0x5d')]['id'])});}});}})[_0x2a49('0x20')](respondWithStatusCode(_0x19ea37,null))['catch'](handleError(_0x19ea37,null));};exports[_0x2a49('0xe6')]=function(_0x347bcb,_0x1efac4,_0xf96628){var _0x5effe2={};var _0xf454c6={};var _0xbe601d;var _0x4065a9;return db['SmsAccount'][_0x2a49('0x6e')]({'where':{'id':_0x347bcb[_0x2a49('0x5d')]['id']}})[_0x2a49('0x20')](handleEntityNotFound(_0x1efac4,null))['then'](function(_0x1e146d){if(_0x1e146d){_0xbe601d=_0x1e146d;_0xf454c6[_0x2a49('0x46')]=_['keys'](db['User'][_0x2a49('0x42')]);_0xf454c6[_0x2a49('0x49')]=_['keys'](_0x347bcb[_0x2a49('0x49')]);_0xf454c6[_0x2a49('0x4a')]=_[_0x2a49('0x4b')](_0xf454c6[_0x2a49('0x46')],_0xf454c6[_0x2a49('0x49')]);_0x5effe2[_0x2a49('0x4c')]=_[_0x2a49('0x4b')](_0xf454c6[_0x2a49('0x46')],qs[_0x2a49('0x4d')](_0x347bcb[_0x2a49('0x49')][_0x2a49('0x4d')]));_0x5effe2[_0x2a49('0x4c')]=_0x5effe2[_0x2a49('0x4c')][_0x2a49('0x5f')]?_0x5effe2[_0x2a49('0x4c')]:_0xf454c6[_0x2a49('0x46')];_0x5effe2[_0x2a49('0x50')]=qs[_0x2a49('0x51')](_0x347bcb['query']['sort']);_0x5effe2[_0x2a49('0x52')]=qs[_0x2a49('0x4a')](_[_0x2a49('0x53')](_0x347bcb[_0x2a49('0x49')],_0xf454c6[_0x2a49('0x4a')]));if(_0x347bcb[_0x2a49('0x49')][_0x2a49('0x54')]){_0x5effe2[_0x2a49('0x52')]=_[_0x2a49('0x55')](_0x5effe2['where'],{'$or':_[_0x2a49('0x40')](_0x5effe2[_0x2a49('0x4c')],function(_0x7a806c){var _0x6aa8b5={};_0x6aa8b5[_0x7a806c]={'$like':'%'+_0x347bcb['query'][_0x2a49('0x54')]+'%'};return _0x6aa8b5;})});}_0x5effe2=_[_0x2a49('0x55')]({},_0x5effe2,_0x347bcb[_0x2a49('0x57')]);return _0xbe601d[_0x2a49('0xe6')](_0x5effe2);}})[_0x2a49('0x20')](function(_0x3a232b){if(_0x3a232b){_0x4065a9=_0x3a232b['length'];if(!_0x347bcb['query'][_0x2a49('0x4e')](_0x2a49('0x4f'))){_0x5effe2[_0x2a49('0x30')]=qs[_0x2a49('0x30')](_0x347bcb[_0x2a49('0x49')][_0x2a49('0x30')]);_0x5effe2[_0x2a49('0x2f')]=qs['offset'](_0x347bcb[_0x2a49('0x49')][_0x2a49('0x2f')]);}return _0xbe601d[_0x2a49('0xe6')](_0x5effe2);}})[_0x2a49('0x20')](function(_0x2f61d5){if(_0x2f61d5){return _0x2f61d5?{'count':_0x4065a9,'rows':_0x2f61d5}:null;}})['then'](respondWithResult(_0x1efac4,null))[_0x2a49('0x2b')](handleError(_0x1efac4,null));}; \ No newline at end of file +var _0xc87d=['includeAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','messageId','MessageSid','skebby','from','sender','text','plivo','infobip','results','csc','originatingAddress','clickatell','fromNumber','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','applications','unshift','agent','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','send','getApplications','Contact','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','clicksend','message_id','status_code','groupName','DELIVERED','redif','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','ACCEPTD','statusGet','message-id','state','addAgents','omit','spread','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','end','name','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','Pause','rawAttributes','filters','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','order'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xc87d,0x157));var _0xdc87=function(_0x50696c,_0x2fb6a0){_0x50696c=_0x50696c-0x0;var _0x3d6ebb=_0xc87d[_0x50696c];return _0x3d6ebb;};'use strict';var emlformat=require(_0xdc87('0x0'));var rimraf=require(_0xdc87('0x1'));var zipdir=require(_0xdc87('0x2'));var jsonpatch=require(_0xdc87('0x3'));var rp=require(_0xdc87('0x4'));var moment=require(_0xdc87('0x5'));var BPromise=require(_0xdc87('0x6'));var Mustache=require(_0xdc87('0x7'));var util=require(_0xdc87('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdc87('0x9'));var fs=require('fs');var fs_extra=require(_0xdc87('0xa'));var _=require('lodash');var squel=require(_0xdc87('0xb'));var crypto=require('crypto');var jsforce=require(_0xdc87('0xc'));var deskjs=require(_0xdc87('0xd'));var toCsv=require(_0xdc87('0xe'));var querystring=require(_0xdc87('0xf'));var Papa=require(_0xdc87('0x10'));var Redis=require(_0xdc87('0x11'));var authService=require(_0xdc87('0x12'));var qs=require(_0xdc87('0x13'));var as=require(_0xdc87('0x14'));var hardwareService=require(_0xdc87('0x15'));var logger=require(_0xdc87('0x16'))('api');var utils=require(_0xdc87('0x17'));var config=require(_0xdc87('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc87('0x19'))['db'];config[_0xdc87('0x1a')]=_['defaults'](config['redis'],{'host':_0xdc87('0x1b'),'port':0x18eb});var socket=require(_0xdc87('0x1c'))(new Redis(config[_0xdc87('0x1a')]));require(_0xdc87('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdc87('0x1e')][_0xdc87('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xc3b828,_0x12c996,_0x4a376a,_0x2b32e8){return new BPromise(function(_0x3008cb,_0x58b396){var _0x48ac38=_0x2b32e8||client;return _0x48ac38['request'](_0xc3b828,_0x4a376a)[_0xdc87('0x20')](function(_0x5f54d0){logger[_0xdc87('0x21')](_0xdc87('0x22'),_0x12c996,_0xdc87('0x23'));logger[_0xdc87('0x24')](_0xdc87('0x25'),_0x12c996,_0xdc87('0x23'),JSON[_0xdc87('0x26')](_0x5f54d0));if(_0x5f54d0[_0xdc87('0x27')]){if(_0x5f54d0[_0xdc87('0x27')][_0xdc87('0x28')]===0x1f4){logger[_0xdc87('0x27')](_0xdc87('0x22'),_0x12c996,_0x5f54d0['error']['message']);return _0x58b396(_0x5f54d0[_0xdc87('0x27')][_0xdc87('0x29')]);}logger[_0xdc87('0x27')](_0xdc87('0x22'),_0x12c996,_0x5f54d0[_0xdc87('0x27')][_0xdc87('0x29')]);return _0x3008cb(_0x5f54d0['error'][_0xdc87('0x29')]);}else{logger[_0xdc87('0x21')](_0xdc87('0x22'),_0x12c996,_0xdc87('0x23'));_0x3008cb(_0x5f54d0[_0xdc87('0x2a')][_0xdc87('0x29')]);}})['catch'](function(_0x1a1422){logger['error']('SmsAccount,\x20%s,\x20%s',_0x12c996,_0x1a1422);_0x58b396(_0x1a1422);});});}function respondWithStatusCode(_0x4cf64e,_0xe5c997){_0xe5c997=_0xe5c997||0xcc;return function(_0x50d80e){if(_0x50d80e){return _0x4cf64e[_0xdc87('0x2b')](_0xe5c997);}return _0x4cf64e['status'](_0xe5c997)['end']();};}function respondWithResult(_0x303bfa,_0x365264){_0x365264=_0x365264||0xc8;return function(_0x191b1c){if(_0x191b1c){return _0x303bfa['status'](_0x365264)[_0xdc87('0x2c')](_0x191b1c);}};}function respondWithFilteredResult(_0x135295,_0x1800a3){return function(_0x4ab495){if(_0x4ab495){var _0x125288=typeof _0x1800a3[_0xdc87('0x2d')]==='undefined'&&typeof _0x1800a3[_0xdc87('0x2e')]===_0xdc87('0x2f');var _0x4d878c=_0x4ab495[_0xdc87('0x30')];var _0x182bbd=_0x125288?0x0:_0x1800a3[_0xdc87('0x2d')];var _0x571b28=_0x125288?_0x4ab495['count']:_0x1800a3['offset']+_0x1800a3[_0xdc87('0x2e')];var _0x800c6e;if(_0x571b28>=_0x4d878c){_0x571b28=_0x4d878c;_0x800c6e=0xc8;}else{_0x800c6e=0xce;}_0x135295[_0xdc87('0x31')](_0x800c6e);return _0x135295[_0xdc87('0x32')](_0xdc87('0x33'),_0x182bbd+'-'+_0x571b28+'/'+_0x4d878c)['json'](_0x4ab495);}return null;};}function patchUpdates(_0x4aa385){return function(_0x170a74){try{jsonpatch[_0xdc87('0x34')](_0x170a74,_0x4aa385,!![]);}catch(_0x2eaf9d){return BPromise[_0xdc87('0x35')](_0x2eaf9d);}return _0x170a74[_0xdc87('0x36')]();};}function saveUpdates(_0x15973d,_0x34f0a2){return function(_0x3ec40e){if(_0x3ec40e){return _0x3ec40e[_0xdc87('0x37')](_0x15973d)[_0xdc87('0x20')](function(_0x1abf70){return _0x1abf70;});}return null;};}function removeEntity(_0x5ce662,_0x57d4dd){return function(_0x104da2){if(_0x104da2){return _0x104da2['destroy']()[_0xdc87('0x20')](function(){var _0x877e20=_0x104da2[_0xdc87('0x38')]({'plain':!![]});var _0x14f4e8=_0xdc87('0x39');return db[_0xdc87('0x3a')][_0xdc87('0x3b')]({'where':{'type':_0x14f4e8,'resourceId':_0x877e20['id']}})[_0xdc87('0x20')](function(){return _0x104da2;});})[_0xdc87('0x20')](function(){_0x5ce662[_0xdc87('0x31')](0xcc)[_0xdc87('0x3c')]();});}};}function handleEntityNotFound(_0x19766a,_0xb5532c){return function(_0x32c7f5){if(!_0x32c7f5){_0x19766a[_0xdc87('0x2b')](0x194);}return _0x32c7f5;};}function handleError(_0x1a385c,_0x54aee5){_0x54aee5=_0x54aee5||0x1f4;return function(_0xb7ff6){logger[_0xdc87('0x27')](_0xb7ff6['stack']);if(_0xb7ff6[_0xdc87('0x3d')]){delete _0xb7ff6[_0xdc87('0x3d')];}_0x1a385c[_0xdc87('0x31')](_0x54aee5)['send'](_0xb7ff6);};}exports['index']=function(_0x395d60,_0x4a2c39){var _0x4c8c5f={'include':[{'model':db['Pause'],'as':_0xdc87('0x3e')}]},_0x20a3e5={},_0x3941c9={'count':0x0,'rows':[]};var _0x4a0bc1=_[_0xdc87('0x3f')](db[_0xdc87('0x40')]['rawAttributes'],function(_0x2ee3fa){return{'name':_0x2ee3fa[_0xdc87('0x41')],'type':_0x2ee3fa['type'][_0xdc87('0x42')]};});_0x20a3e5[_0xdc87('0x43')]=_[_0xdc87('0x3f')](_0x4a0bc1,_0xdc87('0x3d'));_0x20a3e5[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x395d60[_0xdc87('0x44')]);_0x20a3e5['filters']=_[_0xdc87('0x46')](_0x20a3e5['model'],_0x20a3e5[_0xdc87('0x44')]);_0x4c8c5f[_0xdc87('0x47')]=_[_0xdc87('0x46')](_0x20a3e5[_0xdc87('0x43')],qs[_0xdc87('0x48')](_0x395d60[_0xdc87('0x44')][_0xdc87('0x48')]));_0x4c8c5f[_0xdc87('0x47')]=_0x4c8c5f[_0xdc87('0x47')][_0xdc87('0x49')]?_0x4c8c5f[_0xdc87('0x47')]:_0x20a3e5[_0xdc87('0x43')];if(!_0x395d60[_0xdc87('0x44')][_0xdc87('0x4a')]('nolimit')){_0x4c8c5f[_0xdc87('0x2e')]=qs[_0xdc87('0x2e')](_0x395d60[_0xdc87('0x44')][_0xdc87('0x2e')]);_0x4c8c5f['offset']=qs[_0xdc87('0x2d')](_0x395d60[_0xdc87('0x44')][_0xdc87('0x2d')]);}_0x4c8c5f['order']=qs[_0xdc87('0x4b')](_0x395d60[_0xdc87('0x44')][_0xdc87('0x4b')]);_0x4c8c5f[_0xdc87('0x4c')]=qs['filters'](_[_0xdc87('0x4d')](_0x395d60['query'],_0x20a3e5['filters']),_0x4a0bc1);if(_0x395d60[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x4c8c5f[_0xdc87('0x4c')]=_[_0xdc87('0x4f')](_0x4c8c5f[_0xdc87('0x4c')],{'$or':_[_0xdc87('0x3f')](_0x4a0bc1,function(_0xd0bc18){if(_0xd0bc18[_0xdc87('0x50')]!==_0xdc87('0x51')){var _0xdf3e14={};_0xdf3e14[_0xd0bc18[_0xdc87('0x3d')]]={'$like':'%'+_0x395d60[_0xdc87('0x44')][_0xdc87('0x4e')]+'%'};return _0xdf3e14;}})});}_0x4c8c5f=_[_0xdc87('0x4f')]({},_0x4c8c5f,_0x395d60[_0xdc87('0x52')]);var _0x5986fd={'where':_0x4c8c5f[_0xdc87('0x4c')]};return db[_0xdc87('0x40')][_0xdc87('0x30')](_0x5986fd)[_0xdc87('0x20')](function(_0x1faa6e){_0x3941c9['count']=_0x1faa6e;if(_0x395d60[_0xdc87('0x44')]['includeAll']){_0x4c8c5f['include']=[{'all':!![]}];}return db[_0xdc87('0x40')][_0xdc87('0x53')](_0x4c8c5f);})['then'](function(_0x441e31){_0x3941c9[_0xdc87('0x54')]=_0x441e31;return _0x3941c9;})[_0xdc87('0x20')](respondWithFilteredResult(_0x4a2c39,_0x4c8c5f))[_0xdc87('0x55')](handleError(_0x4a2c39,null));};exports[_0xdc87('0x56')]=function(_0x231441,_0x283d44){var _0x1c27d5={'raw':![],'where':{'id':_0x231441['params']['id']},'include':[{'model':db[_0xdc87('0x57')],'as':'mandatoryDispositionPause'}]},_0x589a3c={};_0x589a3c[_0xdc87('0x43')]=_[_0xdc87('0x45')](db[_0xdc87('0x40')][_0xdc87('0x58')]);_0x589a3c[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x231441['query']);_0x589a3c[_0xdc87('0x59')]=_[_0xdc87('0x46')](_0x589a3c[_0xdc87('0x43')],_0x589a3c[_0xdc87('0x44')]);_0x1c27d5[_0xdc87('0x47')]=_[_0xdc87('0x46')](_0x589a3c['model'],qs[_0xdc87('0x48')](_0x231441[_0xdc87('0x44')]['fields']));_0x1c27d5[_0xdc87('0x47')]=_0x1c27d5['attributes'][_0xdc87('0x49')]?_0x1c27d5[_0xdc87('0x47')]:_0x589a3c['model'];if(_0x231441[_0xdc87('0x44')]['includeAll']){_0x1c27d5[_0xdc87('0x5a')]=[{'all':!![]}];}_0x1c27d5=_[_0xdc87('0x4f')]({},_0x1c27d5,_0x231441[_0xdc87('0x52')]);return db[_0xdc87('0x40')][_0xdc87('0x5b')](_0x1c27d5)[_0xdc87('0x20')](handleEntityNotFound(_0x283d44,null))['then'](respondWithResult(_0x283d44,null))['catch'](handleError(_0x283d44,null));};exports['create']=function(_0x5ad9fd,_0x3ef8c7){return db['SmsAccount']['create'](_0x5ad9fd[_0xdc87('0x5c')],{})['then'](function(_0x30e340){var _0x5c4b9f=_0x5ad9fd[_0xdc87('0x5d')][_0xdc87('0x38')]({'plain':!![]});if(!_0x5c4b9f)throw new Error(_0xdc87('0x5e'));if(_0x5c4b9f[_0xdc87('0x5f')]==='user'){var _0x2a7032=_0x30e340['get']({'plain':!![]});var _0x3420d8=_0xdc87('0x39');return db[_0xdc87('0x60')][_0xdc87('0x5b')]({'where':{'name':_0x3420d8,'userProfileId':_0x5c4b9f['userProfileId']},'raw':!![]})[_0xdc87('0x20')](function(_0x1010d8){if(_0x1010d8&&_0x1010d8[_0xdc87('0x61')]===0x0){return db[_0xdc87('0x3a')][_0xdc87('0x62')]({'name':_0x2a7032[_0xdc87('0x3d')],'resourceId':_0x2a7032['id'],'type':_0x1010d8[_0xdc87('0x3d')],'sectionId':_0x1010d8['id']},{})[_0xdc87('0x20')](function(){return _0x30e340;});}else{return _0x30e340;}})[_0xdc87('0x55')](function(_0x240508){logger['error'](_0xdc87('0x63'),_0x240508);throw _0x240508;});}return _0x30e340;})[_0xdc87('0x20')](respondWithResult(_0x3ef8c7,0xc9))[_0xdc87('0x55')](handleError(_0x3ef8c7,null));};exports[_0xdc87('0x37')]=function(_0x2bf368,_0xd071ae){if(_0x2bf368[_0xdc87('0x5c')]['id']){delete _0x2bf368[_0xdc87('0x5c')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2bf368['params']['id']},'include':[{'model':db[_0xdc87('0x57')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xd071ae,null))['then'](saveUpdates(_0x2bf368[_0xdc87('0x5c')],null))[_0xdc87('0x20')](respondWithResult(_0xd071ae,null))['catch'](handleError(_0xd071ae,null));};exports[_0xdc87('0x3b')]=function(_0x410299,_0xc4973e){return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x410299[_0xdc87('0x64')]['id']}})['then'](handleEntityNotFound(_0xc4973e,null))[_0xdc87('0x20')](removeEntity(_0xc4973e,null))[_0xdc87('0x55')](handleError(_0xc4973e,null));};exports[_0xdc87('0x65')]=function(_0x1e9b1d,_0x4256ec){return db[_0xdc87('0x40')]['describe']()['then'](respondWithResult(_0x4256ec,null))[_0xdc87('0x55')](handleError(_0x4256ec,null));};exports[_0xdc87('0x66')]=function(_0x47d477,_0x9fc290,_0x39412a){if(_0x47d477['body']['id']){delete _0x47d477[_0xdc87('0x5c')]['id'];}return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x47d477[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x9fc290,null))[_0xdc87('0x20')](function(_0x19b85c){if(_0x19b85c){_0x47d477[_0xdc87('0x5c')][_0xdc87('0x67')]=_0x19b85c['id'];return db[_0xdc87('0x68')][_0xdc87('0x62')](_0x47d477['body']);}})[_0xdc87('0x20')](respondWithResult(_0x9fc290,null))[_0xdc87('0x55')](handleError(_0x9fc290,null));};exports[_0xdc87('0x69')]=function(_0x1be4ce,_0x104a46,_0x16a49d){var _0x5b25e2={'raw':![],'where':{}};var _0x48bb6d={};var _0x31a5c2={'count':0x0,'rows':[]};return db[_0xdc87('0x40')][_0xdc87('0x6a')]({'where':{'id':_0x1be4ce[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x104a46,null))[_0xdc87('0x20')](function(_0x1917af){if(_0x1917af){_0x48bb6d['model']=_[_0xdc87('0x45')](db[_0xdc87('0x68')][_0xdc87('0x58')]);_0x48bb6d[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x1be4ce['query']);_0x48bb6d['filters']=_[_0xdc87('0x46')](_0x48bb6d[_0xdc87('0x43')],_0x48bb6d[_0xdc87('0x44')]);_0x5b25e2[_0xdc87('0x47')]=_['intersection'](_0x48bb6d[_0xdc87('0x43')],qs['fields'](_0x1be4ce[_0xdc87('0x44')][_0xdc87('0x48')]));_0x5b25e2[_0xdc87('0x47')]=_0x5b25e2[_0xdc87('0x47')][_0xdc87('0x49')]?_0x5b25e2[_0xdc87('0x47')]:_0x48bb6d[_0xdc87('0x43')];if(!_0x1be4ce['query'][_0xdc87('0x4a')](_0xdc87('0x6b'))){_0x5b25e2[_0xdc87('0x2e')]=qs[_0xdc87('0x2e')](_0x1be4ce[_0xdc87('0x44')]['limit']);_0x5b25e2[_0xdc87('0x2d')]=qs['offset'](_0x1be4ce['query'][_0xdc87('0x2d')]);}_0x5b25e2[_0xdc87('0x6c')]=qs[_0xdc87('0x4b')](_0x1be4ce['query'][_0xdc87('0x4b')]);_0x5b25e2[_0xdc87('0x4c')]=qs[_0xdc87('0x59')](_[_0xdc87('0x4d')](_0x1be4ce[_0xdc87('0x44')],_0x48bb6d[_0xdc87('0x59')]));_0x5b25e2[_0xdc87('0x4c')][_0xdc87('0x67')]=_0x1917af['id'];if(_0x1be4ce[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x5b25e2[_0xdc87('0x4c')]=_[_0xdc87('0x4f')](_0x5b25e2[_0xdc87('0x4c')],{'$or':_[_0xdc87('0x3f')](_0x5b25e2[_0xdc87('0x47')],function(_0xc4a37b){var _0xb4ad2={};_0xb4ad2[_0xc4a37b]={'$like':'%'+_0x1be4ce[_0xdc87('0x44')][_0xdc87('0x4e')]+'%'};return _0xb4ad2;})});}_0x5b25e2=_[_0xdc87('0x4f')]({},_0x5b25e2,_0x1be4ce[_0xdc87('0x52')]);return db[_0xdc87('0x68')][_0xdc87('0x30')]({'where':_0x5b25e2['where']})['then'](function(_0x326d34){_0x31a5c2[_0xdc87('0x30')]=_0x326d34;if(_0x1be4ce[_0xdc87('0x44')][_0xdc87('0x6d')]){_0x5b25e2[_0xdc87('0x5a')]=[{'all':!![]}];}return db[_0xdc87('0x68')][_0xdc87('0x53')](_0x5b25e2);})['then'](function(_0x1ce130){_0x31a5c2['rows']=_0x1ce130;return _0x31a5c2;});}})[_0xdc87('0x20')](respondWithFilteredResult(_0x104a46,_0x5b25e2))[_0xdc87('0x55')](handleError(_0x104a46,null));};exports[_0xdc87('0x6e')]=function(_0x32501e,_0xe18cc0,_0x3dcf83){return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x32501e['params']['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0xe18cc0,null))['then'](function(_0x57a41f){if(_0x57a41f){return _0x57a41f[_0xdc87('0x6e')](_0x32501e[_0xdc87('0x44')][_0xdc87('0x6f')]);}})[_0xdc87('0x20')](respondWithStatusCode(_0xe18cc0,null))[_0xdc87('0x55')](handleError(_0xe18cc0,null));};exports[_0xdc87('0x70')]=function(_0x3e9546,_0x147d0c,_0x2511f5){if(_0x3e9546['body']['id']){delete _0x3e9546['body']['id'];}return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x3e9546[_0xdc87('0x64')]['id']}})['then'](handleEntityNotFound(_0x147d0c,null))[_0xdc87('0x20')](function(_0x13d6b7){if(_0x13d6b7){_0x3e9546[_0xdc87('0x5c')][_0xdc87('0x67')]=_0x13d6b7['id'];return db['CannedAnswer'][_0xdc87('0x62')](_0x3e9546[_0xdc87('0x5c')]);}})[_0xdc87('0x20')](respondWithResult(_0x147d0c,null))[_0xdc87('0x55')](handleError(_0x147d0c,null));};exports[_0xdc87('0x71')]=function(_0x3ea130,_0xb2a50e,_0x54d882){var _0x1171a6={'raw':![],'where':{}};var _0x16f182={};var _0x5ba9f4={'count':0x0,'rows':[]};return db[_0xdc87('0x40')][_0xdc87('0x6a')]({'where':{'id':_0x3ea130[_0xdc87('0x64')]['id']}})['then'](handleEntityNotFound(_0xb2a50e,null))['then'](function(_0xbd910f){if(_0xbd910f){_0x16f182[_0xdc87('0x43')]=_['keys'](db[_0xdc87('0x72')]['rawAttributes']);_0x16f182[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x3ea130[_0xdc87('0x44')]);_0x16f182[_0xdc87('0x59')]=_[_0xdc87('0x46')](_0x16f182[_0xdc87('0x43')],_0x16f182['query']);_0x1171a6['attributes']=_[_0xdc87('0x46')](_0x16f182[_0xdc87('0x43')],qs[_0xdc87('0x48')](_0x3ea130[_0xdc87('0x44')][_0xdc87('0x48')]));_0x1171a6[_0xdc87('0x47')]=_0x1171a6[_0xdc87('0x47')]['length']?_0x1171a6[_0xdc87('0x47')]:_0x16f182[_0xdc87('0x43')];if(!_0x3ea130[_0xdc87('0x44')][_0xdc87('0x4a')]('nolimit')){_0x1171a6[_0xdc87('0x2e')]=qs[_0xdc87('0x2e')](_0x3ea130[_0xdc87('0x44')][_0xdc87('0x2e')]);_0x1171a6[_0xdc87('0x2d')]=qs[_0xdc87('0x2d')](_0x3ea130[_0xdc87('0x44')]['offset']);}_0x1171a6[_0xdc87('0x6c')]=qs['sort'](_0x3ea130[_0xdc87('0x44')][_0xdc87('0x4b')]);_0x1171a6[_0xdc87('0x4c')]=qs[_0xdc87('0x59')](_['pick'](_0x3ea130[_0xdc87('0x44')],_0x16f182[_0xdc87('0x59')]));_0x1171a6[_0xdc87('0x4c')]['SmsAccountId']=_0xbd910f['id'];if(_0x3ea130[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x1171a6['where']=_['merge'](_0x1171a6[_0xdc87('0x4c')],{'$or':_[_0xdc87('0x3f')](_0x1171a6[_0xdc87('0x47')],function(_0x4992da){var _0x381460={};_0x381460[_0x4992da]={'$like':'%'+_0x3ea130[_0xdc87('0x44')][_0xdc87('0x4e')]+'%'};return _0x381460;})});}_0x1171a6=_[_0xdc87('0x4f')]({},_0x1171a6,_0x3ea130[_0xdc87('0x52')]);return db[_0xdc87('0x72')]['count']({'where':_0x1171a6[_0xdc87('0x4c')]})['then'](function(_0x36c233){_0x5ba9f4[_0xdc87('0x30')]=_0x36c233;if(_0x3ea130['query'][_0xdc87('0x6d')]){_0x1171a6[_0xdc87('0x5a')]=[{'all':!![]}];}return db[_0xdc87('0x72')][_0xdc87('0x53')](_0x1171a6);})[_0xdc87('0x20')](function(_0x274d25){_0x5ba9f4[_0xdc87('0x54')]=_0x274d25;return _0x5ba9f4;});}})[_0xdc87('0x20')](respondWithFilteredResult(_0xb2a50e,_0x1171a6))[_0xdc87('0x55')](handleError(_0xb2a50e,null));};exports[_0xdc87('0x73')]=function(_0x375f90,_0x3aaef4,_0x4fb73d){return db[_0xdc87('0x40')]['find']({'where':{'id':_0x375f90[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x3aaef4,null))[_0xdc87('0x20')](function(_0x2d6db2){if(_0x2d6db2){return _0x2d6db2[_0xdc87('0x73')](_0x375f90[_0xdc87('0x44')]['ids']);}})[_0xdc87('0x20')](respondWithStatusCode(_0x3aaef4,null))[_0xdc87('0x55')](handleError(_0x3aaef4,null));};exports[_0xdc87('0x74')]=function(_0x458625,_0xa7eb80,_0x448b97){var _0x58259b={'channel':_0xdc87('0x75')};var _0x1ddbf2=[];var _0x5ccaa2=[];var _0x32e884={};return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x458625[_0xdc87('0x64')]['id']},'include':[{'model':db[_0xdc87('0x76')],'as':_0xdc87('0x77')}]})[_0xdc87('0x20')](handleEntityNotFound(_0xa7eb80,null))[_0xdc87('0x20')](function(_0x1705a1){_0x58259b[_0xdc87('0x78')]=_0x1705a1;_0x58259b['applications']=_[_0xdc87('0x79')](_0x1705a1['Applications'],['priority'],[_0xdc87('0x7a')]);if(_0x58259b[_0xdc87('0x78')]['Applications']){delete _0x58259b[_0xdc87('0x78')][_0xdc87('0x77')];}return db['CmContact'][_0xdc87('0x65')]();})[_0xdc87('0x20')](function(_0x1b5cdc){if(!_0x1b5cdc){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0x7d'));}_0x1ddbf2=_[_0xdc87('0x7e')](_[_0xdc87('0x45')](_0x1b5cdc),[_0xdc87('0x7f'),_0xdc87('0x80')]);_0x5ccaa2=_[_0xdc87('0x7e')](_[_0xdc87('0x45')](_0x1b5cdc),[_0xdc87('0x7f'),_0xdc87('0x80'),'CompanyId',_0xdc87('0x81')]);_0x58259b['body']={'mapKey':'mobile'};if(_0x58259b['account'][_0xdc87('0x50')]){switch(_0x58259b['account']['type']){case'twilio':_0x58259b['body']['from']=_0x458625['body'][_0xdc87('0x82')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625['body']['Body'];_0x58259b['body'][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x84')];break;case _0xdc87('0x85'):_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]='+'+_0x458625['body'][_0xdc87('0x87')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625['body'][_0xdc87('0x88')];break;case'connectel':_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x86')];_0x58259b[_0xdc87('0x5c')]['body']=_0x458625[_0xdc87('0x5c')][_0xdc87('0x29')];break;case'clicksend':_0x58259b['body'][_0xdc87('0x86')]=_0x458625['body'][_0xdc87('0x86')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625['body'][_0xdc87('0x5c')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')]['message_id'];break;case _0xdc87('0x89'):_0x58259b['body']['from']=_0x458625[_0xdc87('0x5c')][_0xdc87('0x82')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625[_0xdc87('0x5c')]['Text'];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')]['MessageUUID'];break;case _0xdc87('0x8a'):_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]='+'+_0x458625[_0xdc87('0x5c')][_0xdc87('0x8b')][0x0]['from'];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625['body'][_0xdc87('0x8b')][0x0][_0xdc87('0x88')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')]['results'][0x0][_0xdc87('0x83')];break;case _0xdc87('0x8c'):_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x8d')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625[_0xdc87('0x5c')]['segmentedMessage'][_0xdc87('0x29')];break;case _0xdc87('0x8e'):_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x8f')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x88')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')]['replyMessageId'];break;case'bandwidth':_0x58259b[_0xdc87('0x5c')][_0xdc87('0x83')]=_0x458625[_0xdc87('0x5c')][0x0][_0xdc87('0x29')]['id'];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')]=_0x458625[_0xdc87('0x5c')][0x0][_0xdc87('0x29')][_0xdc87('0x86')];_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]=_0x458625['body'][0x0][_0xdc87('0x29')][_0xdc87('0x88')];break;case _0xdc87('0x90'):_0x58259b['body'][_0xdc87('0x86')]=_0x458625[_0xdc87('0x5c')][_0xdc87('0x86')];_0x58259b['body'][_0xdc87('0x5c')]=_0x458625['body']['message'];_0x58259b['body']['messageId']=_0x458625[_0xdc87('0x5c')]['refid'];break;}}if(_0x58259b['body']['id']){delete _0x58259b[_0xdc87('0x5c')]['id'];}if(_[_0xdc87('0x91')](_0x58259b[_0xdc87('0x5c')]['from'])){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0x92'));}if(_[_0xdc87('0x91')](_0x58259b[_0xdc87('0x5c')]['body'])||_0x58259b[_0xdc87('0x5c')][_0xdc87('0x5c')]===''){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0x93'));}if(_[_0xdc87('0x91')](_0x58259b[_0xdc87('0x5c')][_0xdc87('0x94')])){throw new db['Sequelize'][(_0xdc87('0x7c'))](_0xdc87('0x95')+_0x5ccaa2);}if(!_['includes'](_0x5ccaa2,_0x58259b[_0xdc87('0x5c')][_0xdc87('0x94')])){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0x96')+_0x5ccaa2);}_0x32e884[_0x58259b['body']['mapKey']]=_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')];return db[_0xdc87('0x97')][_0xdc87('0x5b')]({'where':{'id':_0x58259b[_0xdc87('0x78')][_0xdc87('0x81')]},'include':[{'model':db[_0xdc87('0x98')],'as':_0xdc87('0x99'),'where':_0x32e884,'limit':0x1,'order':[[_0xdc87('0x80'),_0xdc87('0x9a')]]}]});})[_0xdc87('0x20')](handleEntityNotFound(_0xa7eb80,null))[_0xdc87('0x20')](function(_0x3f0b3b){if(_0x3f0b3b){_0x58259b['list']=_['omit'](_0x3f0b3b,[_0xdc87('0x99')]);if(_0x3f0b3b[_0xdc87('0x99')][_0xdc87('0x49')]){return _0x3f0b3b[_0xdc87('0x99')][0x0];}var _0x4d0984=_['defaults'](_0x58259b['body'],{'firstName':_0x58259b['body'][_0xdc87('0x86')],'ListId':_0x3f0b3b['id']});_0x4d0984[_0x58259b[_0xdc87('0x5c')]['mapKey']]=_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')];return db[_0xdc87('0x98')]['create'](_0x4d0984,{'fields':_0x1ddbf2,'raw':!![]});}})[_0xdc87('0x20')](handleEntityNotFound(_0xa7eb80,null))[_0xdc87('0x20')](function(_0x23704c){if(_0x23704c){_0x58259b[_0xdc87('0x9b')]=_0x23704c;var _0x15cc34={'ContactId':_0x23704c['id'],'phone':_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')],'SmsAccountId':_0x458625[_0xdc87('0x64')]['id']};var _0x30e882={'ContactId':_0x23704c['id'],'SmsAccountId':_0x458625[_0xdc87('0x64')]['id'],'closed':![]};return db[_0xdc87('0x9c')][_0xdc87('0x5b')]({'where':_0x30e882})[_0xdc87('0x20')](function(_0x1ff929){if(_0x1ff929){return[_0x1ff929,![]];}return db['SmsInteraction'][_0xdc87('0x62')](_0x15cc34)[_0xdc87('0x20')](function(_0x4dc1f3){return[_0x4dc1f3,!![]];});});}})['spread'](function(_0x4e6be9,_0x298df2){_0x58259b[_0xdc87('0x9d')]=_0x4e6be9['get']({'plain':!![]});_0x58259b[_0xdc87('0x9d')][_0xdc87('0x9e')]=![];if(_0x298df2){if(_0x58259b[_0xdc87('0x78')][_0xdc87('0x9f')]){_0x58259b['applications'][_0xdc87('0xa0')]({'id':0x0,'priority':_0x58259b['applications'][_0xdc87('0x49')]+0x1,'app':_0xdc87('0xa1'),'appdata':_0xdc87('0xa2'),'interval':_0xdc87('0xa3')});}_0x58259b['interaction']['created']=!![];}return db[_0xdc87('0xa4')][_0xdc87('0x62')]({'phone':_0x58259b[_0xdc87('0x5c')][_0xdc87('0x86')],'messageId':_0x58259b[_0xdc87('0x5c')]['messageId'],'body':_0x58259b['body'][_0xdc87('0x5c')],'SmsAccountId':_0x458625['params']['id'],'SmsInteractionId':_0x4e6be9['id'],'direction':'in','ContactId':_0x4e6be9[_0xdc87('0xa5')],'AttachmentId':_0x58259b[_0xdc87('0x5c')]['AttachmentId']});})[_0xdc87('0x20')](function(_0x285739){_0x58259b[_0xdc87('0x29')]=_0x285739;if(_0x58259b[_0xdc87('0x9d')]['UserId']){return db['User']['find']({'attributes':['id',_0xdc87('0x3d')],'where':{'id':_0x58259b[_0xdc87('0x9d')][_0xdc87('0xa6')]}})[_0xdc87('0x20')](function(_0x111f52){if(_0x111f52){_0x58259b[_0xdc87('0xa7')][_0xdc87('0xa8')]({'id':0x0,'priority':0x0,'app':_0xdc87('0xa9'),'appdata':_0x111f52[_0xdc87('0x3d')]+','+(_0x58259b['account']['waitForTheAssignedAgent']||0xa),'interval':_0xdc87('0xa3')});}return respondWithRpcPromise(_0xdc87('0xaa'),'startRouting',_0x58259b);});}return respondWithRpcPromise(_0xdc87('0xaa'),'startRouting',_0x58259b);})[_0xdc87('0x20')](function(_0x1ebb85){if(_0x1ebb85){var _0x190caf=0xc8;var _0x49e96c=_0xdc87('0xab');logger[_0xdc87('0x21')](_0xdc87('0x25'),_0x49e96c,_0x190caf,_0xdc87('0xac'));logger['debug'](_0xdc87('0xad'),_0x49e96c,_0x190caf,_0xdc87('0xac'),JSON['stringify'](_0x1ebb85));if(_0x58259b['account']['type']===_0xdc87('0xae')){return _0xa7eb80[_0xdc87('0x31')](_0x190caf)['set']('Content-Type',_0xdc87('0xaf'))['send'](_0xdc87('0xb0'));}else{return _0xa7eb80[_0xdc87('0x31')](_0x190caf)[_0xdc87('0x2c')](_0x1ebb85);}}})[_0xdc87('0x55')](handleError(_0xa7eb80,null));};exports[_0xdc87('0xb1')]=function(_0x4053fc,_0x2ca035){var _0x1ea45a=_0x4053fc[_0xdc87('0x64')]['id'];var _0x508328=_0x4053fc[_0xdc87('0x5c')];var _0x108ba6=0xc8;var _0x2dc908=null;return db[_0xdc87('0xb2')][_0xdc87('0xb3')]({'isolationLevel':db[_0xdc87('0xb2')]['Transaction'][_0xdc87('0xb4')][_0xdc87('0xb5')]},function(_0x581ce6){return db[_0xdc87('0x40')][_0xdc87('0x6a')]({'where':{'id':_0x1ea45a},'transaction':_0x581ce6})['then'](function(_0xd1e0f7){if(_0xd1e0f7){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x1ea45a},'transaction':_0x581ce6})[_0xdc87('0x20')](function(){var _0x2be0f9=_['map'](_0x508328,function(_0x66cc2d){_0x66cc2d[_0xdc87('0x67')]=_0x1ea45a;return _0x66cc2d;});return db[_0xdc87('0x76')][_0xdc87('0xb6')](_0x2be0f9,{'transaction':_0x581ce6});});}else{_0x108ba6=0x194;_0x2dc908=[];}});})[_0xdc87('0x20')](function(){if(_0x108ba6!==0x194){return db['SmsApplication'][_0xdc87('0xb7')]({'where':{'SmsAccountId':_0x1ea45a},'order':'priority'})[_0xdc87('0x20')](function(_0xd7e5cf){_0x2dc908=_0xd7e5cf;});}})[_0xdc87('0x55')](function(_0x1efd1c){_0x108ba6=0x1f4;logger['error'](_0x1efd1c[_0xdc87('0xb8')]);if(_0x1efd1c[_0xdc87('0x3d')]){delete _0x1efd1c[_0xdc87('0x3d')];}_0x2dc908=_0x1efd1c;})[_0xdc87('0xb9')](function(){if(_0x2dc908===null){_0x2ca035['sendStatus'](_0x108ba6);}else{if(_0x108ba6===0x1f4){_0x2ca035[_0xdc87('0x31')](_0x108ba6)[_0xdc87('0xba')](_0x2dc908);}else{_0x2ca035[_0xdc87('0x31')](_0x108ba6)[_0xdc87('0x2c')](_0x2dc908);}}});};exports[_0xdc87('0xbb')]=function(_0x59d0f5,_0x5d3027,_0x425eac){var _0x4a039f={};var _0x4c7c9d={};var _0x557212;var _0x1cf5a2;return db[_0xdc87('0x40')]['findOne']({'where':{'id':_0x59d0f5[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x5d3027,null))[_0xdc87('0x20')](function(_0x5e9a6b){if(_0x5e9a6b){_0x557212=_0x5e9a6b;_0x4c7c9d[_0xdc87('0x43')]=_['keys'](db[_0xdc87('0x76')][_0xdc87('0x58')]);_0x4c7c9d['query']=_['keys'](_0x59d0f5[_0xdc87('0x44')]);_0x4c7c9d[_0xdc87('0x59')]=_[_0xdc87('0x46')](_0x4c7c9d[_0xdc87('0x43')],_0x4c7c9d[_0xdc87('0x44')]);_0x4a039f['attributes']=_[_0xdc87('0x46')](_0x4c7c9d[_0xdc87('0x43')],qs[_0xdc87('0x48')](_0x59d0f5['query']['fields']));_0x4a039f[_0xdc87('0x47')]=_0x4a039f[_0xdc87('0x47')]['length']?_0x4a039f['attributes']:_0x4c7c9d[_0xdc87('0x43')];_0x4a039f['order']=qs[_0xdc87('0x4b')](_0x59d0f5['query'][_0xdc87('0x4b')]);_0x4a039f[_0xdc87('0x4c')]=qs[_0xdc87('0x59')](_[_0xdc87('0x4d')](_0x59d0f5['query'],_0x4c7c9d['filters']));if(_0x59d0f5[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x4a039f['where']=_[_0xdc87('0x4f')](_0x4a039f[_0xdc87('0x4c')],{'$or':_[_0xdc87('0x3f')](_0x4a039f[_0xdc87('0x47')],function(_0x63f0ab){var _0x40a6df={};_0x40a6df[_0x63f0ab]={'$like':'%'+_0x59d0f5[_0xdc87('0x44')][_0xdc87('0x4e')]+'%'};return _0x40a6df;})});}_0x4a039f=_[_0xdc87('0x4f')]({},_0x4a039f,_0x59d0f5['options']);return _0x557212[_0xdc87('0xbb')](_0x4a039f);}})[_0xdc87('0x20')](function(_0x38455d){if(_0x38455d){_0x1cf5a2=_0x38455d[_0xdc87('0x49')];if(!_0x59d0f5[_0xdc87('0x44')][_0xdc87('0x4a')](_0xdc87('0x6b'))){_0x4a039f[_0xdc87('0x2e')]=qs[_0xdc87('0x2e')](_0x59d0f5['query'][_0xdc87('0x2e')]);_0x4a039f[_0xdc87('0x2d')]=qs[_0xdc87('0x2d')](_0x59d0f5['query'][_0xdc87('0x2d')]);}return _0x557212[_0xdc87('0xbb')](_0x4a039f);}})['then'](function(_0x36b77d){if(_0x36b77d){return _0x36b77d?{'count':_0x1cf5a2,'rows':_0x36b77d}:null;}})[_0xdc87('0x20')](respondWithResult(_0x5d3027,null))['catch'](handleError(_0x5d3027,null));};exports['getInteractions']=function(_0x199724,_0x142cab,_0x322bb2){var _0x1639bf={'raw':![],'where':{}};var _0x211d36={};var _0x5baa1b={'count':0x0,'rows':[]};return db[_0xdc87('0x40')][_0xdc87('0x6a')]({'where':{'id':_0x199724[_0xdc87('0x64')]['id']}})['then'](handleEntityNotFound(_0x142cab,null))[_0xdc87('0x20')](function(_0x16f8c4){if(_0x16f8c4){_0x211d36['model']=_[_0xdc87('0x45')](db[_0xdc87('0x9c')][_0xdc87('0x58')]);_0x211d36[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x199724[_0xdc87('0x44')]);_0x211d36[_0xdc87('0x59')]=_[_0xdc87('0x46')](_0x211d36[_0xdc87('0x43')],_0x211d36[_0xdc87('0x44')]);_0x1639bf[_0xdc87('0x47')]=_['intersection'](_0x211d36['model'],qs[_0xdc87('0x48')](_0x199724[_0xdc87('0x44')][_0xdc87('0x48')]));_0x1639bf['attributes']=_0x1639bf[_0xdc87('0x47')][_0xdc87('0x49')]?_0x1639bf[_0xdc87('0x47')]:_0x211d36['model'];if(!_0x199724[_0xdc87('0x44')][_0xdc87('0x4a')](_0xdc87('0x6b'))){_0x1639bf[_0xdc87('0x2e')]=qs['limit'](_0x199724[_0xdc87('0x44')][_0xdc87('0x2e')]);_0x1639bf['offset']=qs[_0xdc87('0x2d')](_0x199724[_0xdc87('0x44')][_0xdc87('0x2d')]);}_0x1639bf['order']=qs[_0xdc87('0x4b')](_0x199724['query']['sort']);_0x1639bf[_0xdc87('0x4c')]=qs[_0xdc87('0x59')](_[_0xdc87('0x4d')](_0x199724[_0xdc87('0x44')],_0x211d36['filters']));_0x1639bf[_0xdc87('0x4c')][_0xdc87('0x67')]=_0x16f8c4['id'];if(_0x199724[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x1639bf[_0xdc87('0x4c')]=_[_0xdc87('0x4f')](_0x1639bf[_0xdc87('0x4c')],{'$or':_['map'](_0x1639bf[_0xdc87('0x47')],function(_0x4f1b12){var _0xc600bb={};_0xc600bb[_0x4f1b12]={'$like':'%'+_0x199724[_0xdc87('0x44')][_0xdc87('0x4e')]+'%'};return _0xc600bb;})});}_0x1639bf=_['merge']({},_0x1639bf,_0x199724[_0xdc87('0x52')]);return db[_0xdc87('0x9c')]['count']({'where':_0x1639bf[_0xdc87('0x4c')]})['then'](function(_0x1b7ba6){_0x5baa1b['count']=_0x1b7ba6;if(_0x199724[_0xdc87('0x44')]['includeAll']){_0x1639bf[_0xdc87('0x5a')]=[{'model':db[_0xdc87('0x98')],'as':_0xdc87('0xbc'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0xdc87('0xbd'),_0xdc87('0xbe')],'required':![]},{'model':db['Tag'],'as':_0xdc87('0xbf'),'attributes':['id','name','color'],'where':_0x199724[_0xdc87('0x44')][_0xdc87('0xc0')]?{'id':_0x199724[_0xdc87('0x44')][_0xdc87('0xc0')]}:undefined,'required':_0x199724[_0xdc87('0x44')][_0xdc87('0xc0')]?!![]:![]}];}return db[_0xdc87('0x9c')][_0xdc87('0x53')](_0x1639bf);})[_0xdc87('0x20')](function(_0x355084){_0x5baa1b[_0xdc87('0x54')]=_0x355084;return _0x5baa1b;});}})['then'](respondWithFilteredResult(_0x142cab,_0x1639bf))['catch'](handleError(_0x142cab,null));};exports['send']=function(_0x303ceb,_0x6ed96a,_0x5e7600){var _0x3b7995,_0x43e00b,_0x2ef3ed;if(_[_0xdc87('0x91')](_0x303ceb[_0xdc87('0x5c')][_0xdc87('0x5c')])||_0x303ceb[_0xdc87('0x5c')][_0xdc87('0x5c')]===''){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0x93'));}if(_[_0xdc87('0x91')](_0x303ceb['body']['to'])){throw new db[(_0xdc87('0x7b'))][(_0xdc87('0x7c'))](_0xdc87('0xc1'));}_0x3b7995=_0x303ceb[_0xdc87('0x5c')]['to'];return db[_0xdc87('0x40')]['find']({'where':{'id':_0x303ceb[_0xdc87('0x64')]['id']},'include':[{'model':db[_0xdc87('0x97')],'as':_0xdc87('0xc2'),'include':[{'model':db[_0xdc87('0x98')],'as':'Contacts','where':{'mobile':_0x3b7995},'limit':0x1,'order':[[_0xdc87('0x80'),_0xdc87('0x9a')]]}]}]})[_0xdc87('0x20')](handleEntityNotFound(_0x6ed96a,null))[_0xdc87('0x20')](function(_0x5edf9f){if(_0x5edf9f&&_0x5edf9f[_0xdc87('0xc2')]){_0x43e00b=_0x5edf9f[_0xdc87('0x38')]({'plain':!![]});if(_0x43e00b[_0xdc87('0xc2')]&&_0x43e00b[_0xdc87('0xc2')]['Contacts']['length']){return _0x43e00b[_0xdc87('0xc2')]['Contacts'][0x0];}return db['CmContact'][_0xdc87('0x62')](_['defaults'](_0x303ceb[_0xdc87('0x5c')],{'firstName':_0x3b7995,'mobile':_0x3b7995,'phone':_0x3b7995,'ListId':_0x43e00b[_0xdc87('0x81')]}));}})['then'](handleEntityNotFound(_0x6ed96a,null))[_0xdc87('0x20')](function(_0x4d10f6){if(_0x4d10f6){_0x2ef3ed=_0x4d10f6;return db['SmsInteraction'][_0xdc87('0x5b')]({'where':{'ContactId':_0x2ef3ed['id'],'closed':![],'SmsAccountId':_0x43e00b['id']}})[_0xdc87('0x20')](function(_0x46ccbe){if(_0x46ccbe){return[_0x46ccbe,![]];}return db['SmsInteraction'][_0xdc87('0x62')]({'UserId':_0x303ceb[_0xdc87('0x5d')]['id'],'ContactId':_0x2ef3ed['id'],'SmsAccountId':_0x43e00b['id'],'phone':_0x3b7995,'firstMsgDirection':_0xdc87('0xc3'),'Messages':[_[_0xdc87('0x4f')](_0x303ceb[_0xdc87('0x5c')],{'read':![],'body':_0x303ceb['body'][_0xdc87('0x5c')],'phone':_0x3b7995,'SmsAccountId':_0x43e00b['id'],'UserId':_0x303ceb[_0xdc87('0x5d')]['id'],'ContactId':_0x2ef3ed['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xdc87('0x20')](function(_0x390e67){return[_0x390e67,!![]];});});}})['spread'](function(_0x17ffb9,_0x39c0e4){if(_0x39c0e4){return _0x17ffb9;}return db[_0xdc87('0xa4')][_0xdc87('0x62')](_['merge'](_0x303ceb['body'],{'read':![],'body':_0x303ceb[_0xdc87('0x5c')]['body'],'phone':_0x3b7995,'SmsAccountId':_0x43e00b['id'],'SmsInteractionId':_0x17ffb9['id'],'UserId':_0x303ceb[_0xdc87('0x5d')]['id'],'ContactId':_0x2ef3ed['id']}))[_0xdc87('0x20')](function(_0x1cc1e5){_0x17ffb9[_0xdc87('0xc4')][_0xdc87('0xc5')]=[];_0x17ffb9['dataValues']['Messages'][_0xdc87('0xa0')](_0x1cc1e5[_0xdc87('0xc4')]);return _0x17ffb9;});})[_0xdc87('0x20')](respondWithResult(_0x6ed96a,null))[_0xdc87('0x55')](handleError(_0x6ed96a,null));};exports[_0xdc87('0x31')]=function(_0xa20078,_0x1f1fe9,_0x5dcc8d){if(_0xa20078[_0xdc87('0x5c')]['id']){delete _0xa20078[_0xdc87('0x5c')]['id'];}var _0x4d4ba3,_0x29b55f,_0x4fd8a2;return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0xa20078[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x1f1fe9,null))[_0xdc87('0x20')](function(_0x11ce2c){if(_0x11ce2c){_0x4fd8a2=_0x11ce2c;logger[_0xdc87('0x24')](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0xc6'),_0x11ce2c[_0xdc87('0x50')],util[_0xdc87('0xc7')](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));switch(_0x11ce2c[_0xdc87('0x50')]){case _0xdc87('0x85'):if(_0xa20078[_0xdc87('0x5c')][_0xdc87('0xc8')]&&_0xa20078[_0xdc87('0x5c')][_0xdc87('0x31')]){_0x29b55f=_0xa20078[_0xdc87('0x5c')]['status'];return db[_0xdc87('0xa4')][_0xdc87('0x5b')]({'where':{'messageId':_0xa20078[_0xdc87('0x5c')][_0xdc87('0xc8')]}});}break;case'connectel':if(_0xa20078[_0xdc87('0x5c')]['requestid']&&_0xa20078[_0xdc87('0x5c')][_0xdc87('0xc9')]){_0x29b55f=_0xa20078['body'][_0xdc87('0xc9')];return db[_0xdc87('0xa4')][_0xdc87('0x5b')]({'where':{'messageId':_0xa20078[_0xdc87('0x5c')][_0xdc87('0xca')]}});}break;case _0xdc87('0xcb'):if(_0xa20078['body'][_0xdc87('0xcc')]&&_0xa20078['body'][_0xdc87('0xcd')]){_0x29b55f=_0xa20078[_0xdc87('0x5c')]['status_code'];return db['SmsMessage']['find']({'where':{'messageId':_0xa20078[_0xdc87('0x5c')][_0xdc87('0xcc')]}});}break;case _0xdc87('0x8a'):var _0x2ae588=_0xa20078[_0xdc87('0x5c')][_0xdc87('0x8b')][0x0];if(_0x2ae588['messageId']&&_0x2ae588[_0xdc87('0x31')][_0xdc87('0xce')]===_0xdc87('0xcf')){_0x29b55f=_0x2ae588['status'][_0xdc87('0xce')];return db[_0xdc87('0xa4')][_0xdc87('0x5b')]({'where':{'messageId':_0x2ae588[_0xdc87('0x83')]}});}break;case _0xdc87('0x8e'):if(_0xa20078['body'][_0xdc87('0x83')]&&_0xa20078[_0xdc87('0x5c')][_0xdc87('0x31')]){_0x29b55f=_0xa20078[_0xdc87('0x5c')][_0xdc87('0x31')];return db[_0xdc87('0xa4')]['find']({'where':{'messageId':_0xa20078[_0xdc87('0x5c')][_0xdc87('0x83')]}});}break;case'bandwidth':if(_0xa20078['body'][0x0][_0xdc87('0x29')]['id']){_0x29b55f=_0xa20078['body'][0x0]['type'];return db[_0xdc87('0xa4')][_0xdc87('0x5b')]({'where':{'messageId':_0xa20078[_0xdc87('0x5c')][0x0][_0xdc87('0x29')]['id']}});}break;case _0xdc87('0x90'):if(_0xa20078['body'][_0xdc87('0xd0')]&&_0xa20078['body'][_0xdc87('0x31')]){_0x29b55f=_0xa20078[_0xdc87('0x5c')]['status'];return db['SmsMessage'][_0xdc87('0x5b')]({'where':{'messageId':_0xa20078['body']['redif']}});}break;}}})[_0xdc87('0x20')](handleEntityNotFound(_0x1f1fe9,null))[_0xdc87('0x20')](function(_0x58bb23){if(_0x58bb23){_0x4d4ba3=_0x58bb23;switch(_0x4fd8a2[_0xdc87('0x50')]){case _0xdc87('0x85'):if(_0x29b55f==='DELIVERED'){return _0x4d4ba3[_0xdc87('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0xdc87('0xc7')](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdc87('0xd1'):if(_0x29b55f==='1'){return _0x4d4ba3['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xdc87('0x85'),util['inspect'](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xa20078[_0xdc87('0x5c')][_0xdc87('0xd2')]&&_0x29b55f>=0xc8&&_0x29b55f<=0xce){return _0x4d4ba3['update']({'read':!![]});}else{logger['error'](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0xcb'),util['inspect'](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdc87('0x8a'):var _0x40f73e=_0xa20078[_0xdc87('0x5c')][_0xdc87('0x8b')][0x0];if(_0x40f73e[_0xdc87('0x31')][_0xdc87('0xce')]==='DELIVERED'){return _0x4d4ba3['update']({'read':!![]});}else{logger[_0xdc87('0x27')](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0x8a'),util[_0xdc87('0xc7')](_0xa20078['body'],{'showHidden':![],'depth':null}));}break;case _0xdc87('0x8e'):if(_0x29b55f==_0xdc87('0xd3')||_0x29b55f==_0xdc87('0xd4')){return _0x4d4ba3[_0xdc87('0x37')]({'read':!![]});}else{logger[_0xdc87('0x27')](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0x8e'),util[_0xdc87('0xc7')](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdc87('0xd5'):if(_0x29b55f=='message-delivered'){return _0x4d4ba3[_0xdc87('0x37')]({'read':!![]});}else{logger[_0xdc87('0x27')](_0xdc87('0x25'),'status',_0xdc87('0xd5'),util['inspect'](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdc87('0x90'):if(_0x29b55f==='DELIVRD'||_0x29b55f===_0xdc87('0xd6')){return _0x4d4ba3['update']({'read':!![]});}else{logger[_0xdc87('0x27')](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0x90'),util[_0xdc87('0xc7')](_0xa20078[_0xdc87('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4d4ba3;}})[_0xdc87('0x20')](respondWithResult(_0x1f1fe9,null))['catch'](handleError(_0x1f1fe9,null));};exports[_0xdc87('0xd7')]=function(_0x4881f0,_0xb84105,_0xdf9cf9){var _0x50d695,_0x15ee81,_0x5ab67e;return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x4881f0[_0xdc87('0x64')]['id']}})['then'](handleEntityNotFound(_0xb84105,null))[_0xdc87('0x20')](function(_0x4d0e97){if(_0x4d0e97){_0x5ab67e=_0x4d0e97;logger[_0xdc87('0x24')](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0xc6'),_0x4d0e97['type'],util['inspect'](_0x4881f0['query'],{'showHidden':![],'depth':null}));switch(_0x4d0e97[_0xdc87('0x50')]){case _0xdc87('0x8c'):if(_0x4881f0[_0xdc87('0x44')][_0xdc87('0xd8')]&&_0x4881f0[_0xdc87('0x44')][_0xdc87('0xd9')]){_0x15ee81=_0x4881f0['query'][_0xdc87('0xd9')];return db['SmsMessage'][_0xdc87('0x5b')]({'where':{'messageId':_0x4881f0['query']['message-id']}});}break;}}})[_0xdc87('0x20')](handleEntityNotFound(_0xb84105,null))[_0xdc87('0x20')](function(_0x4af619){if(_0x4af619){_0x50d695=_0x4af619;switch(_0x5ab67e['type']){case _0xdc87('0x8c'):if(_0x15ee81==='2'||_0x15ee81==='6'){return _0x50d695[_0xdc87('0x37')]({'read':!![]});}else{logger['error'](_0xdc87('0x25'),_0xdc87('0x31'),_0xdc87('0x8c'),util['inspect'](_0x4881f0[_0xdc87('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x50d695;}})[_0xdc87('0x20')](respondWithResult(_0xb84105,null))[_0xdc87('0x55')](handleError(_0xb84105,null));};exports[_0xdc87('0xda')]=function(_0x40b1ea,_0x433418,_0x1a41aa){return db[_0xdc87('0x40')][_0xdc87('0x5b')]({'where':{'id':_0x40b1ea[_0xdc87('0x64')]['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x433418,null))[_0xdc87('0x20')](function(_0x28ce64){if(_0x28ce64){return _0x28ce64[_0xdc87('0xda')](_0x40b1ea[_0xdc87('0x5c')][_0xdc87('0x6f')],_[_0xdc87('0xdb')](_0x40b1ea['body'],[_0xdc87('0x6f'),'id'])||{})[_0xdc87('0xdc')](function(_0x2a6303){for(var _0x3785ae=0x0;_0x3785ae<_0x40b1ea['body'][_0xdc87('0x6f')][_0xdc87('0x49')];_0x3785ae+=0x1){socket[_0xdc87('0xdd')](_0xdc87('0xde'),{'UserId':Number(_0x40b1ea[_0xdc87('0x5c')]['ids'][_0x3785ae]),'SmsAccountId':Number(_0x40b1ea[_0xdc87('0x64')]['id'])});}return _0x2a6303;});}})[_0xdc87('0x20')](respondWithResult(_0x433418,null))[_0xdc87('0x55')](handleError(_0x433418,null));};exports[_0xdc87('0xdf')]=function(_0x307eee,_0x802d02,_0x3228ff){return db['SmsAccount'][_0xdc87('0x5b')]({'where':{'id':_0x307eee['params']['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x802d02,null))[_0xdc87('0x20')](function(_0xf3478b){if(_0xf3478b){return _0xf3478b[_0xdc87('0xdf')](_0x307eee[_0xdc87('0x44')][_0xdc87('0x6f')])[_0xdc87('0x20')](function(){if(_['isArray'](_0x307eee[_0xdc87('0x44')][_0xdc87('0x6f')])){for(var _0x3c755f=0x0;_0x3c755f<_0x307eee[_0xdc87('0x44')]['ids'][_0xdc87('0x49')];_0x3c755f+=0x1){socket['emit'](_0xdc87('0xe0'),{'UserId':Number(_0x307eee[_0xdc87('0x44')]['ids'][_0x3c755f]),'SmsAccountId':Number(_0x307eee[_0xdc87('0x64')]['id'])});}}else{socket[_0xdc87('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x307eee['query'][_0xdc87('0x6f')]),'SmsAccountId':Number(_0x307eee[_0xdc87('0x64')]['id'])});}});}})[_0xdc87('0x20')](respondWithStatusCode(_0x802d02,null))[_0xdc87('0x55')](handleError(_0x802d02,null));};exports[_0xdc87('0xe1')]=function(_0x350b56,_0x49f5a3,_0x5a329b){var _0x32e7c4={};var _0x52b206={};var _0x1d19e7;var _0x23c3b6;return db[_0xdc87('0x40')][_0xdc87('0x6a')]({'where':{'id':_0x350b56['params']['id']}})[_0xdc87('0x20')](handleEntityNotFound(_0x49f5a3,null))[_0xdc87('0x20')](function(_0x3ae462){if(_0x3ae462){_0x1d19e7=_0x3ae462;_0x52b206[_0xdc87('0x43')]=_[_0xdc87('0x45')](db['User'][_0xdc87('0x58')]);_0x52b206[_0xdc87('0x44')]=_[_0xdc87('0x45')](_0x350b56[_0xdc87('0x44')]);_0x52b206[_0xdc87('0x59')]=_[_0xdc87('0x46')](_0x52b206[_0xdc87('0x43')],_0x52b206[_0xdc87('0x44')]);_0x32e7c4[_0xdc87('0x47')]=_['intersection'](_0x52b206['model'],qs[_0xdc87('0x48')](_0x350b56['query'][_0xdc87('0x48')]));_0x32e7c4[_0xdc87('0x47')]=_0x32e7c4[_0xdc87('0x47')]['length']?_0x32e7c4[_0xdc87('0x47')]:_0x52b206[_0xdc87('0x43')];_0x32e7c4[_0xdc87('0x6c')]=qs['sort'](_0x350b56[_0xdc87('0x44')][_0xdc87('0x4b')]);_0x32e7c4[_0xdc87('0x4c')]=qs[_0xdc87('0x59')](_[_0xdc87('0x4d')](_0x350b56[_0xdc87('0x44')],_0x52b206[_0xdc87('0x59')]));if(_0x350b56[_0xdc87('0x44')][_0xdc87('0x4e')]){_0x32e7c4[_0xdc87('0x4c')]=_[_0xdc87('0x4f')](_0x32e7c4[_0xdc87('0x4c')],{'$or':_['map'](_0x32e7c4[_0xdc87('0x47')],function(_0xb4910b){var _0x538305={};_0x538305[_0xb4910b]={'$like':'%'+_0x350b56['query'][_0xdc87('0x4e')]+'%'};return _0x538305;})});}_0x32e7c4=_[_0xdc87('0x4f')]({},_0x32e7c4,_0x350b56[_0xdc87('0x52')]);return _0x1d19e7[_0xdc87('0xe1')](_0x32e7c4);}})[_0xdc87('0x20')](function(_0x1f6b5b){if(_0x1f6b5b){_0x23c3b6=_0x1f6b5b['length'];if(!_0x350b56['query']['hasOwnProperty'](_0xdc87('0x6b'))){_0x32e7c4['limit']=qs[_0xdc87('0x2e')](_0x350b56['query'][_0xdc87('0x2e')]);_0x32e7c4[_0xdc87('0x2d')]=qs[_0xdc87('0x2d')](_0x350b56[_0xdc87('0x44')][_0xdc87('0x2d')]);}return _0x1d19e7[_0xdc87('0xe1')](_0x32e7c4);}})[_0xdc87('0x20')](function(_0x115630){if(_0x115630){return _0x115630?{'count':_0x23c3b6,'rows':_0x115630}:null;}})[_0xdc87('0x20')](respondWithResult(_0x49f5a3,null))['catch'](handleError(_0x49f5a3,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 39a8044..f2a8579 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 _0xff11=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x48e8b6,_0x1eb325){var _0x54b721=function(_0x3f99a4){while(--_0x3f99a4){_0x48e8b6['push'](_0x48e8b6['shift']());}};_0x54b721(++_0x1eb325);}(_0xff11,0x186));var _0x1ff1=function(_0x561c60,_0x22bc2e){_0x561c60=_0x561c60-0x0;var _0x3a73b4=_0xff11[_0x561c60];return _0x3a73b4;};'use strict';var EventEmitter=require(_0x1ff1('0x0'));var SmsAccount=require(_0x1ff1('0x1'))['db'][_0x1ff1('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1ff1('0x3')](0x0);var events={'afterCreate':_0x1ff1('0x4'),'afterUpdate':_0x1ff1('0x5'),'afterDestroy':_0x1ff1('0x6')};function emitEvent(_0x312ef3){return function(_0x2aed8c,_0xad5de3,_0x2e1af6){SmsAccountEvents[_0x1ff1('0x7')](_0x312ef3+':'+_0x2aed8c['id'],_0x2aed8c);SmsAccountEvents[_0x1ff1('0x7')](_0x312ef3,_0x2aed8c);_0x2e1af6(null);};}for(var e in events){if(events[_0x1ff1('0x8')](e)){var event=events[e];SmsAccount[_0x1ff1('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x731e=['setMaxListeners','save','update','remove','emit','hook'];(function(_0x2c3971,_0x581b6c){var _0x4d865f=function(_0x5eaef9){while(--_0x5eaef9){_0x2c3971['push'](_0x2c3971['shift']());}};_0x4d865f(++_0x581b6c);}(_0x731e,0x18c));var _0xe731=function(_0x14ab56,_0x5ed78b){_0x14ab56=_0x14ab56-0x0;var _0x40f652=_0x731e[_0x14ab56];return _0x40f652;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe731('0x0')](0x0);var events={'afterCreate':_0xe731('0x1'),'afterUpdate':_0xe731('0x2'),'afterDestroy':_0xe731('0x3')};function emitEvent(_0x342929){return function(_0xbaafcb,_0x2ec199,_0x123efb){SmsAccountEvents[_0xe731('0x4')](_0x342929+':'+_0xbaafcb['id'],_0xbaafcb);SmsAccountEvents[_0xe731('0x4')](_0x342929,_0xbaafcb);_0x123efb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe731('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 8b9fb65..d1ef31e 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 _0x6d14=['sms_accounts','lodash','util','../../config/logger','bluebird','path','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x6d14,0x12d));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x46d1('0x0'));var util=require(_0x46d1('0x1'));var logger=require(_0x46d1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46d1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46d1('0x5'));module[_0x46d1('0x6')]=function(_0x42d987,_0x3b2c84){return _0x42d987[_0x46d1('0x7')](_0x46d1('0x8'),attributes,{'tableName':_0x46d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dad=['bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5dad,0x8a));var _0xd5da=function(_0x5abc16,_0x8949d4){_0x5abc16=_0x5abc16-0x0;var _0x589fa4=_0x5dad[_0x5abc16];return _0x589fa4;};'use strict';var _=require(_0xd5da('0x0'));var util=require(_0xd5da('0x1'));var logger=require(_0xd5da('0x2'))(_0xd5da('0x3'));var moment=require(_0xd5da('0x4'));var BPromise=require(_0xd5da('0x5'));var rp=require(_0xd5da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5da('0x7'));var config=require(_0xd5da('0x8'));var attributes=require(_0xd5da('0x9'));module[_0xd5da('0xa')]=function(_0x24c95c,_0x59884f){return _0x24c95c['define'](_0xd5da('0xb'),attributes,{'tableName':_0xd5da('0xc'),'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 7ea0a58..5fc25e9 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 _0x7622=['redis','defaults','localhost','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','then','lodash','util','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x7622,0xc4));var _0x2762=function(_0x21ea7e,_0x5ec297){_0x21ea7e=_0x21ea7e-0x0;var _0xb9fe3=_0x7622[_0x21ea7e];return _0xb9fe3;};'use strict';var _=require(_0x2762('0x0'));var util=require(_0x2762('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2762('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2762('0x3'))('rpc');var config=require(_0x2762('0x4'));var jayson=require(_0x2762('0x5'));var client=jayson[_0x2762('0x6')][_0x2762('0x7')]({'port':0x232a});config[_0x2762('0x8')]=_[_0x2762('0x9')](config[_0x2762('0x8')],{'host':_0x2762('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2762('0xb'))[_0x2762('0xc')](socket);function respondWithRpcPromise(_0x302fed,_0xab9847,_0x206594){return new BPromise(function(_0x1e1fa5,_0x58af69){return client[_0x2762('0xd')](_0x302fed,_0x206594)['then'](function(_0x3737a9){logger[_0x2762('0xe')](_0x2762('0xf'),_0xab9847,_0x2762('0x10'));logger[_0x2762('0x11')](_0x2762('0x12'),_0xab9847,'request\x20sent',JSON[_0x2762('0x13')](_0x3737a9));if(_0x3737a9['error']){if(_0x3737a9[_0x2762('0x14')]['code']===0x1f4){logger['error'](_0x2762('0xf'),_0xab9847,_0x3737a9[_0x2762('0x14')]['message']);return _0x58af69(_0x3737a9['error']['message']);}logger['error'](_0x2762('0xf'),_0xab9847,_0x3737a9[_0x2762('0x14')][_0x2762('0x15')]);return _0x1e1fa5(_0x3737a9[_0x2762('0x14')][_0x2762('0x15')]);}else{logger[_0x2762('0xe')]('SmsAccount,\x20%s,\x20%s',_0xab9847,_0x2762('0x10'));_0x1e1fa5(_0x3737a9[_0x2762('0x16')][_0x2762('0x15')]);}})[_0x2762('0x17')](function(_0x5c9d9c){logger[_0x2762('0x14')]('SmsAccount,\x20%s,\x20%s',_0xab9847,_0x5c9d9c);_0x58af69(_0x5c9d9c);});});}exports[_0x2762('0x18')]=function(_0x673ee8){var _0x50ac7c=this;return new Promise(function(_0x154160,_0x212882){return db[_0x2762('0x19')]['find']({'raw':_0x673ee8[_0x2762('0x1a')]?_0x673ee8[_0x2762('0x1a')][_0x2762('0x1b')]===undefined?!![]:![]:!![],'where':_0x673ee8[_0x2762('0x1a')]?_0x673ee8[_0x2762('0x1a')][_0x2762('0x1c')]||null:null,'attributes':_0x673ee8[_0x2762('0x1a')]?_0x673ee8['options'][_0x2762('0x1d')]||null:null,'include':_0x673ee8[_0x2762('0x1a')]?_0x673ee8[_0x2762('0x1a')][_0x2762('0x1e')]?_[_0x2762('0x1f')](_0x673ee8[_0x2762('0x1a')][_0x2762('0x1e')],function(_0x45946d){return{'model':db[_0x45946d[_0x2762('0x20')]],'as':_0x45946d['as'],'attributes':_0x45946d[_0x2762('0x1d')],'include':_0x45946d[_0x2762('0x1e')]?_['map'](_0x45946d[_0x2762('0x1e')],function(_0x43a302){return{'model':db[_0x43a302[_0x2762('0x20')]],'as':_0x43a302['as'],'attributes':_0x43a302[_0x2762('0x1d')],'include':_0x43a302[_0x2762('0x1e')]?_[_0x2762('0x1f')](_0x43a302['include'],function(_0x625878){return{'model':db[_0x625878[_0x2762('0x20')]],'as':_0x625878['as'],'attributes':_0x625878[_0x2762('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2762('0x21')](function(_0x2e9126){logger[_0x2762('0xe')](_0x2762('0x18'),_0x673ee8);logger[_0x2762('0x11')]('ShowSmsAccount',_0x673ee8,JSON[_0x2762('0x13')](_0x2e9126));_0x154160(_0x2e9126);})[_0x2762('0x17')](function(_0x50a04c){logger[_0x2762('0x14')](_0x2762('0x18'),_0x50a04c['message'],_0x673ee8);_0x212882(_0x50ac7c[_0x2762('0x14')](0x1f4,_0x50a04c[_0x2762('0x15')]));});});}; \ No newline at end of file +var _0xa068=['http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','include','map','model','attributes','then','ShowSmsAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0xa068,0x85));var _0x8a06=function(_0x332819,_0x23b1d1){_0x332819=_0x332819-0x0;var _0xd98397=_0xa068[_0x332819];return _0xd98397;};'use strict';var _=require(_0x8a06('0x0'));var util=require(_0x8a06('0x1'));var moment=require('moment');var BPromise=require(_0x8a06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a06('0x3'));var db=require(_0x8a06('0x4'))['db'];var utils=require(_0x8a06('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a06('0x6')][_0x8a06('0x7')]({'port':0x232a});config[_0x8a06('0x8')]=_['defaults'](config[_0x8a06('0x8')],{'host':_0x8a06('0x9'),'port':0x18eb});var socket=require(_0x8a06('0xa'))(new Redis(config[_0x8a06('0x8')]));require(_0x8a06('0xb'))[_0x8a06('0xc')](socket);function respondWithRpcPromise(_0x2f16b3,_0x5729ea,_0x45f7ac){return new BPromise(function(_0x657f08,_0x1b1ab6){return client[_0x8a06('0xd')](_0x2f16b3,_0x45f7ac)['then'](function(_0x579f77){logger[_0x8a06('0xe')](_0x8a06('0xf'),_0x5729ea,'request\x20sent');logger[_0x8a06('0x10')](_0x8a06('0x11'),_0x5729ea,_0x8a06('0x12'),JSON[_0x8a06('0x13')](_0x579f77));if(_0x579f77['error']){if(_0x579f77[_0x8a06('0x14')][_0x8a06('0x15')]===0x1f4){logger['error'](_0x8a06('0xf'),_0x5729ea,_0x579f77[_0x8a06('0x14')][_0x8a06('0x16')]);return _0x1b1ab6(_0x579f77['error'][_0x8a06('0x16')]);}logger[_0x8a06('0x14')](_0x8a06('0xf'),_0x5729ea,_0x579f77[_0x8a06('0x14')][_0x8a06('0x16')]);return _0x657f08(_0x579f77['error']['message']);}else{logger[_0x8a06('0xe')](_0x8a06('0xf'),_0x5729ea,_0x8a06('0x12'));_0x657f08(_0x579f77[_0x8a06('0x17')][_0x8a06('0x16')]);}})[_0x8a06('0x18')](function(_0x5f3aee){logger[_0x8a06('0x14')]('SmsAccount,\x20%s,\x20%s',_0x5729ea,_0x5f3aee);_0x1b1ab6(_0x5f3aee);});});}exports['ShowSmsAccount']=function(_0x6f27f0){var _0x190ad0=this;return new Promise(function(_0x2ab87e,_0x38e8de){return db[_0x8a06('0x19')][_0x8a06('0x1a')]({'raw':_0x6f27f0[_0x8a06('0x1b')]?_0x6f27f0['options'][_0x8a06('0x1c')]===undefined?!![]:![]:!![],'where':_0x6f27f0[_0x8a06('0x1b')]?_0x6f27f0[_0x8a06('0x1b')]['where']||null:null,'attributes':_0x6f27f0[_0x8a06('0x1b')]?_0x6f27f0['options']['attributes']||null:null,'include':_0x6f27f0[_0x8a06('0x1b')]?_0x6f27f0[_0x8a06('0x1b')][_0x8a06('0x1d')]?_['map'](_0x6f27f0[_0x8a06('0x1b')]['include'],function(_0x20590f){return{'model':db[_0x20590f['model']],'as':_0x20590f['as'],'attributes':_0x20590f['attributes'],'include':_0x20590f[_0x8a06('0x1d')]?_[_0x8a06('0x1e')](_0x20590f[_0x8a06('0x1d')],function(_0x1cb02a){return{'model':db[_0x1cb02a[_0x8a06('0x1f')]],'as':_0x1cb02a['as'],'attributes':_0x1cb02a['attributes'],'include':_0x1cb02a[_0x8a06('0x1d')]?_[_0x8a06('0x1e')](_0x1cb02a[_0x8a06('0x1d')],function(_0x2d935b){return{'model':db[_0x2d935b[_0x8a06('0x1f')]],'as':_0x2d935b['as'],'attributes':_0x2d935b[_0x8a06('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8a06('0x21')](function(_0x48da44){logger[_0x8a06('0xe')](_0x8a06('0x22'),_0x6f27f0);logger[_0x8a06('0x10')]('ShowSmsAccount',_0x6f27f0,JSON[_0x8a06('0x13')](_0x48da44));_0x2ab87e(_0x48da44);})[_0x8a06('0x18')](function(_0x3fe64d){logger['error'](_0x8a06('0x22'),_0x3fe64d[_0x8a06('0x16')],_0x6f27f0);_0x38e8de(_0x190ad0[_0x8a06('0x14')](0x1f4,_0x3fe64d[_0x8a06('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 393ba67..897c4ef 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 abedc3f..3d8bab4 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(_0x1bce27,_0x468041){var _0x18747d=function(_0x1e2f93){while(--_0x1e2f93){_0x1bce27['push'](_0x1bce27['shift']());}};_0x18747d(++_0x468041);}(_0x34e8,0x12c));var _0x834e=function(_0x11a1bb,_0xed546d){_0x11a1bb=_0x11a1bb-0x0;var _0x940852=_0x34e8[_0x11a1bb];return _0x940852;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 512fecb..5de5303 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 _0x564c=['exports','STRING','*,*,*,*'];(function(_0x29d981,_0x3365ef){var _0x11a7f2=function(_0xcf7c87){while(--_0xcf7c87){_0x29d981['push'](_0x29d981['shift']());}};_0x11a7f2(++_0x3365ef);}(_0x564c,0xc0));var _0xc564=function(_0x424c0f,_0x31a27d){_0x424c0f=_0x424c0f-0x0;var _0x265bf4=_0x564c[_0x424c0f];return _0x265bf4;};'use strict';var Sequelize=require('sequelize');module[_0xc564('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc564('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc564('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc564('0x2')}}; \ No newline at end of file +var _0x373b=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x371deb,_0x5e5e3b){var _0x354a7c=function(_0x3a7662){while(--_0x3a7662){_0x371deb['push'](_0x371deb['shift']());}};_0x354a7c(++_0x5e5e3b);}(_0x373b,0x64));var _0xb373=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x373b[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xb373('0x0'));module[_0xb373('0x1')]={'priority':{'type':Sequelize[_0xb373('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb373('0x3')},'appdata':{'type':Sequelize[_0xb373('0x4')]()},'description':{'type':Sequelize[_0xb373('0x5')]},'interval':{'type':Sequelize[_0xb373('0x5')],'defaultValue':_0xb373('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 2014337..36271ba 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 _0x69f9=['save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69f9,0xb4));var _0x969f=function(_0x5e2cf7,_0x2d4ff8){_0x5e2cf7=_0x5e2cf7-0x0;var _0x407902=_0x69f9[_0x5e2cf7];return _0x407902;};'use strict';var emlformat=require(_0x969f('0x0'));var rimraf=require(_0x969f('0x1'));var zipdir=require(_0x969f('0x2'));var jsonpatch=require(_0x969f('0x3'));var rp=require(_0x969f('0x4'));var moment=require(_0x969f('0x5'));var BPromise=require(_0x969f('0x6'));var Mustache=require(_0x969f('0x7'));var util=require(_0x969f('0x8'));var path=require('path');var sox=require(_0x969f('0x9'));var csv=require(_0x969f('0xa'));var ejs=require(_0x969f('0xb'));var fs=require('fs');var fs_extra=require(_0x969f('0xc'));var _=require('lodash');var squel=require(_0x969f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x969f('0xe'));var toCsv=require(_0x969f('0xa'));var querystring=require(_0x969f('0xf'));var Papa=require(_0x969f('0x10'));var Redis=require(_0x969f('0x11'));var authService=require(_0x969f('0x12'));var qs=require(_0x969f('0x13'));var as=require(_0x969f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x969f('0x15'));var config=require(_0x969f('0x16'));var licenseUtil=require(_0x969f('0x17'));var db=require(_0x969f('0x18'))['db'];function respondWithStatusCode(_0x5c2c2c,_0x3d4705){_0x3d4705=_0x3d4705||0xcc;return function(_0xcffdcd){if(_0xcffdcd){return _0x5c2c2c['sendStatus'](_0x3d4705);}return _0x5c2c2c[_0x969f('0x19')](_0x3d4705)[_0x969f('0x1a')]();};}function respondWithResult(_0xc6b4bd,_0x27a83f){_0x27a83f=_0x27a83f||0xc8;return function(_0x321cd1){if(_0x321cd1){return _0xc6b4bd[_0x969f('0x19')](_0x27a83f)[_0x969f('0x1b')](_0x321cd1);}};}function respondWithFilteredResult(_0x232641,_0x54ed2a){return function(_0x2eb3a8){if(_0x2eb3a8){var _0x12a6ef=typeof _0x54ed2a[_0x969f('0x1c')]===_0x969f('0x1d')&&typeof _0x54ed2a[_0x969f('0x1e')]===_0x969f('0x1d');var _0x4b57bc=_0x2eb3a8[_0x969f('0x1f')];var _0x487074=_0x12a6ef?0x0:_0x54ed2a[_0x969f('0x1c')];var _0x14c368=_0x12a6ef?_0x2eb3a8[_0x969f('0x1f')]:_0x54ed2a[_0x969f('0x1c')]+_0x54ed2a[_0x969f('0x1e')];var _0x492ce1;if(_0x14c368>=_0x4b57bc){_0x14c368=_0x4b57bc;_0x492ce1=0xc8;}else{_0x492ce1=0xce;}_0x232641[_0x969f('0x19')](_0x492ce1);return _0x232641['set']('Content-Range',_0x487074+'-'+_0x14c368+'/'+_0x4b57bc)['json'](_0x2eb3a8);}return null;};}function patchUpdates(_0x156316){return function(_0x332df5){try{jsonpatch['apply'](_0x332df5,_0x156316,!![]);}catch(_0x5a557c){return BPromise[_0x969f('0x20')](_0x5a557c);}return _0x332df5[_0x969f('0x21')]();};}function saveUpdates(_0x259e9a,_0x10a643){return function(_0x53dae9){if(_0x53dae9){return _0x53dae9['update'](_0x259e9a)[_0x969f('0x22')](function(_0x48e535){return _0x48e535;});}return null;};}function removeEntity(_0x33bc6f,_0x45f517){return function(_0x3cc5c0){if(_0x3cc5c0){return _0x3cc5c0[_0x969f('0x23')]()[_0x969f('0x22')](function(){_0x33bc6f[_0x969f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f8da,_0x5c1c8a){return function(_0x4c7bcf){if(!_0x4c7bcf){_0x54f8da[_0x969f('0x24')](0x194);}return _0x4c7bcf;};}function handleError(_0xc01555,_0x3f72b3){_0x3f72b3=_0x3f72b3||0x1f4;return function(_0x5987bb){logger[_0x969f('0x25')](_0x5987bb[_0x969f('0x26')]);if(_0x5987bb[_0x969f('0x27')]){delete _0x5987bb[_0x969f('0x27')];}_0xc01555[_0x969f('0x19')](_0x3f72b3)[_0x969f('0x28')](_0x5987bb);};}exports[_0x969f('0x29')]=function(_0x19bd63,_0xba34a6){var _0x87ae84={},_0x2e273f={},_0x4b0e67={'count':0x0,'rows':[]};var _0x33c331=_[_0x969f('0x2a')](db[_0x969f('0x2b')][_0x969f('0x2c')],function(_0x42a321){return{'name':_0x42a321[_0x969f('0x2d')],'type':_0x42a321[_0x969f('0x2e')]['key']};});_0x2e273f[_0x969f('0x2f')]=_[_0x969f('0x2a')](_0x33c331,_0x969f('0x27'));_0x2e273f[_0x969f('0x30')]=_['keys'](_0x19bd63[_0x969f('0x30')]);_0x2e273f[_0x969f('0x31')]=_[_0x969f('0x32')](_0x2e273f[_0x969f('0x2f')],_0x2e273f[_0x969f('0x30')]);_0x87ae84[_0x969f('0x33')]=_['intersection'](_0x2e273f[_0x969f('0x2f')],qs['fields'](_0x19bd63[_0x969f('0x30')][_0x969f('0x34')]));_0x87ae84[_0x969f('0x33')]=_0x87ae84[_0x969f('0x33')]['length']?_0x87ae84[_0x969f('0x33')]:_0x2e273f[_0x969f('0x2f')];if(!_0x19bd63[_0x969f('0x30')][_0x969f('0x35')](_0x969f('0x36'))){_0x87ae84[_0x969f('0x1e')]=qs[_0x969f('0x1e')](_0x19bd63[_0x969f('0x30')][_0x969f('0x1e')]);_0x87ae84[_0x969f('0x1c')]=qs[_0x969f('0x1c')](_0x19bd63[_0x969f('0x30')][_0x969f('0x1c')]);}_0x87ae84['order']=qs['sort'](_0x19bd63[_0x969f('0x30')][_0x969f('0x37')]);_0x87ae84['where']=qs['filters'](_[_0x969f('0x38')](_0x19bd63[_0x969f('0x30')],_0x2e273f[_0x969f('0x31')]),_0x33c331);if(_0x19bd63[_0x969f('0x30')]['filter']){_0x87ae84[_0x969f('0x39')]=_[_0x969f('0x3a')](_0x87ae84['where'],{'$or':_[_0x969f('0x2a')](_0x33c331,function(_0x33c51){if(_0x33c51[_0x969f('0x2e')]!==_0x969f('0x3b')){var _0x53ed82={};_0x53ed82[_0x33c51['name']]={'$like':'%'+_0x19bd63[_0x969f('0x30')]['filter']+'%'};return _0x53ed82;}})});}_0x87ae84=_[_0x969f('0x3a')]({},_0x87ae84,_0x19bd63[_0x969f('0x3c')]);var _0x4a7315={'where':_0x87ae84[_0x969f('0x39')]};return db['SmsApplication'][_0x969f('0x1f')](_0x4a7315)[_0x969f('0x22')](function(_0xd04faf){_0x4b0e67[_0x969f('0x1f')]=_0xd04faf;if(_0x19bd63[_0x969f('0x30')][_0x969f('0x3d')]){_0x87ae84[_0x969f('0x3e')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x87ae84);})[_0x969f('0x22')](function(_0x2323b9){_0x4b0e67[_0x969f('0x3f')]=_0x2323b9;return _0x4b0e67;})['then'](respondWithFilteredResult(_0xba34a6,_0x87ae84))[_0x969f('0x40')](handleError(_0xba34a6,null));};exports['show']=function(_0x21a9c7,_0x2df5cd){var _0x7b2655={'raw':!![],'where':{'id':_0x21a9c7[_0x969f('0x41')]['id']}},_0x1891c9={};_0x1891c9[_0x969f('0x2f')]=_['keys'](db[_0x969f('0x2b')]['rawAttributes']);_0x1891c9[_0x969f('0x30')]=_[_0x969f('0x42')](_0x21a9c7[_0x969f('0x30')]);_0x1891c9['filters']=_[_0x969f('0x32')](_0x1891c9['model'],_0x1891c9['query']);_0x7b2655['attributes']=_[_0x969f('0x32')](_0x1891c9[_0x969f('0x2f')],qs['fields'](_0x21a9c7[_0x969f('0x30')]['fields']));_0x7b2655[_0x969f('0x33')]=_0x7b2655['attributes']['length']?_0x7b2655[_0x969f('0x33')]:_0x1891c9[_0x969f('0x2f')];if(_0x21a9c7[_0x969f('0x30')][_0x969f('0x3d')]){_0x7b2655[_0x969f('0x3e')]=[{'all':!![]}];}_0x7b2655=_[_0x969f('0x3a')]({},_0x7b2655,_0x21a9c7['options']);return db[_0x969f('0x2b')][_0x969f('0x43')](_0x7b2655)[_0x969f('0x22')](handleEntityNotFound(_0x2df5cd,null))[_0x969f('0x22')](respondWithResult(_0x2df5cd,null))[_0x969f('0x40')](handleError(_0x2df5cd,null));};exports['create']=function(_0x4e5749,_0xb47c97){return db[_0x969f('0x2b')][_0x969f('0x44')](_0x4e5749[_0x969f('0x45')],{})[_0x969f('0x22')](respondWithResult(_0xb47c97,0xc9))[_0x969f('0x40')](handleError(_0xb47c97,null));};exports[_0x969f('0x46')]=function(_0x6574da,_0x38d864){if(_0x6574da[_0x969f('0x45')]['id']){delete _0x6574da[_0x969f('0x45')]['id'];}return db[_0x969f('0x2b')][_0x969f('0x43')]({'where':{'id':_0x6574da[_0x969f('0x41')]['id']}})[_0x969f('0x22')](handleEntityNotFound(_0x38d864,null))[_0x969f('0x22')](saveUpdates(_0x6574da['body'],null))['then'](respondWithResult(_0x38d864,null))[_0x969f('0x40')](handleError(_0x38d864,null));};exports[_0x969f('0x23')]=function(_0x509e21,_0x8abf98){return db[_0x969f('0x2b')][_0x969f('0x43')]({'where':{'id':_0x509e21['params']['id']}})['then'](handleEntityNotFound(_0x8abf98,null))[_0x969f('0x22')](removeEntity(_0x8abf98,null))[_0x969f('0x40')](handleError(_0x8abf98,null));}; \ No newline at end of file +var _0x1f78=['name','send','map','SmsApplication','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','update','then','error','stack'];(function(_0x16ec9d,_0x36ac5d){var _0x1e98b=function(_0x18a954){while(--_0x18a954){_0x16ec9d['push'](_0x16ec9d['shift']());}};_0x1e98b(++_0x36ac5d);}(_0x1f78,0x72));var _0x81f7=function(_0xc2c526,_0x3f2a00){_0xc2c526=_0xc2c526-0x0;var _0x443b57=_0x1f78[_0xc2c526];return _0x443b57;};'use strict';var emlformat=require(_0x81f7('0x0'));var rimraf=require(_0x81f7('0x1'));var zipdir=require(_0x81f7('0x2'));var jsonpatch=require(_0x81f7('0x3'));var rp=require(_0x81f7('0x4'));var moment=require(_0x81f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81f7('0x6'));var util=require(_0x81f7('0x7'));var path=require(_0x81f7('0x8'));var sox=require('sox');var csv=require(_0x81f7('0x9'));var ejs=require(_0x81f7('0xa'));var fs=require('fs');var fs_extra=require(_0x81f7('0xb'));var _=require(_0x81f7('0xc'));var squel=require(_0x81f7('0xd'));var crypto=require(_0x81f7('0xe'));var jsforce=require(_0x81f7('0xf'));var deskjs=require(_0x81f7('0x10'));var toCsv=require(_0x81f7('0x9'));var querystring=require('querystring');var Papa=require(_0x81f7('0x11'));var Redis=require(_0x81f7('0x12'));var authService=require(_0x81f7('0x13'));var qs=require(_0x81f7('0x14'));var as=require(_0x81f7('0x15'));var hardwareService=require(_0x81f7('0x16'));var logger=require(_0x81f7('0x17'))(_0x81f7('0x18'));var utils=require(_0x81f7('0x19'));var config=require(_0x81f7('0x1a'));var licenseUtil=require(_0x81f7('0x1b'));var db=require(_0x81f7('0x1c'))['db'];function respondWithStatusCode(_0x507efd,_0x5f4f20){_0x5f4f20=_0x5f4f20||0xcc;return function(_0x505c01){if(_0x505c01){return _0x507efd[_0x81f7('0x1d')](_0x5f4f20);}return _0x507efd[_0x81f7('0x1e')](_0x5f4f20)[_0x81f7('0x1f')]();};}function respondWithResult(_0x223f00,_0x511933){_0x511933=_0x511933||0xc8;return function(_0x11d7c8){if(_0x11d7c8){return _0x223f00[_0x81f7('0x1e')](_0x511933)[_0x81f7('0x20')](_0x11d7c8);}};}function respondWithFilteredResult(_0x24f124,_0x1998b0){return function(_0x2cda3e){if(_0x2cda3e){var _0x37ba78=typeof _0x1998b0[_0x81f7('0x21')]==='undefined'&&typeof _0x1998b0[_0x81f7('0x22')]==='undefined';var _0x546384=_0x2cda3e[_0x81f7('0x23')];var _0x4f1c5d=_0x37ba78?0x0:_0x1998b0['offset'];var _0x334ec1=_0x37ba78?_0x2cda3e[_0x81f7('0x23')]:_0x1998b0[_0x81f7('0x21')]+_0x1998b0[_0x81f7('0x22')];var _0x594e39;if(_0x334ec1>=_0x546384){_0x334ec1=_0x546384;_0x594e39=0xc8;}else{_0x594e39=0xce;}_0x24f124[_0x81f7('0x1e')](_0x594e39);return _0x24f124['set'](_0x81f7('0x24'),_0x4f1c5d+'-'+_0x334ec1+'/'+_0x546384)['json'](_0x2cda3e);}return null;};}function patchUpdates(_0x23f7f8){return function(_0x5d0044){try{jsonpatch['apply'](_0x5d0044,_0x23f7f8,!![]);}catch(_0xc34bbf){return BPromise[_0x81f7('0x25')](_0xc34bbf);}return _0x5d0044['save']();};}function saveUpdates(_0x486664,_0x4fd710){return function(_0x118f7d){if(_0x118f7d){return _0x118f7d[_0x81f7('0x26')](_0x486664)['then'](function(_0x1ea16a){return _0x1ea16a;});}return null;};}function removeEntity(_0x159651,_0x31ff1e){return function(_0x48240e){if(_0x48240e){return _0x48240e['destroy']()[_0x81f7('0x27')](function(){_0x159651[_0x81f7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358e98,_0x24cdd1){return function(_0x214f35){if(!_0x214f35){_0x358e98[_0x81f7('0x1d')](0x194);}return _0x214f35;};}function handleError(_0x37d1da,_0xa48cd1){_0xa48cd1=_0xa48cd1||0x1f4;return function(_0x49338c){logger[_0x81f7('0x28')](_0x49338c[_0x81f7('0x29')]);if(_0x49338c['name']){delete _0x49338c[_0x81f7('0x2a')];}_0x37d1da[_0x81f7('0x1e')](_0xa48cd1)[_0x81f7('0x2b')](_0x49338c);};}exports['index']=function(_0x2128bf,_0x3def8f){var _0x47d9c1={},_0x5bcfb1={},_0x47eb8c={'count':0x0,'rows':[]};var _0x5dc294=_[_0x81f7('0x2c')](db[_0x81f7('0x2d')]['rawAttributes'],function(_0x28e313){return{'name':_0x28e313[_0x81f7('0x2e')],'type':_0x28e313[_0x81f7('0x2f')][_0x81f7('0x30')]};});_0x5bcfb1[_0x81f7('0x31')]=_['map'](_0x5dc294,_0x81f7('0x2a'));_0x5bcfb1[_0x81f7('0x32')]=_[_0x81f7('0x33')](_0x2128bf[_0x81f7('0x32')]);_0x5bcfb1[_0x81f7('0x34')]=_[_0x81f7('0x35')](_0x5bcfb1['model'],_0x5bcfb1['query']);_0x47d9c1['attributes']=_[_0x81f7('0x35')](_0x5bcfb1[_0x81f7('0x31')],qs[_0x81f7('0x36')](_0x2128bf[_0x81f7('0x32')][_0x81f7('0x36')]));_0x47d9c1[_0x81f7('0x37')]=_0x47d9c1[_0x81f7('0x37')][_0x81f7('0x38')]?_0x47d9c1[_0x81f7('0x37')]:_0x5bcfb1[_0x81f7('0x31')];if(!_0x2128bf['query'][_0x81f7('0x39')](_0x81f7('0x3a'))){_0x47d9c1[_0x81f7('0x22')]=qs[_0x81f7('0x22')](_0x2128bf[_0x81f7('0x32')][_0x81f7('0x22')]);_0x47d9c1[_0x81f7('0x21')]=qs[_0x81f7('0x21')](_0x2128bf[_0x81f7('0x32')][_0x81f7('0x21')]);}_0x47d9c1[_0x81f7('0x3b')]=qs[_0x81f7('0x3c')](_0x2128bf['query'][_0x81f7('0x3c')]);_0x47d9c1['where']=qs[_0x81f7('0x34')](_[_0x81f7('0x3d')](_0x2128bf[_0x81f7('0x32')],_0x5bcfb1['filters']),_0x5dc294);if(_0x2128bf[_0x81f7('0x32')][_0x81f7('0x3e')]){_0x47d9c1[_0x81f7('0x3f')]=_[_0x81f7('0x40')](_0x47d9c1['where'],{'$or':_[_0x81f7('0x2c')](_0x5dc294,function(_0x453d4d){if(_0x453d4d[_0x81f7('0x2f')]!==_0x81f7('0x41')){var _0x32fec7={};_0x32fec7[_0x453d4d[_0x81f7('0x2a')]]={'$like':'%'+_0x2128bf[_0x81f7('0x32')][_0x81f7('0x3e')]+'%'};return _0x32fec7;}})});}_0x47d9c1=_['merge']({},_0x47d9c1,_0x2128bf[_0x81f7('0x42')]);var _0x2d88bf={'where':_0x47d9c1[_0x81f7('0x3f')]};return db[_0x81f7('0x2d')][_0x81f7('0x23')](_0x2d88bf)[_0x81f7('0x27')](function(_0x249cc4){_0x47eb8c[_0x81f7('0x23')]=_0x249cc4;if(_0x2128bf[_0x81f7('0x32')][_0x81f7('0x43')]){_0x47d9c1[_0x81f7('0x44')]=[{'all':!![]}];}return db[_0x81f7('0x2d')][_0x81f7('0x45')](_0x47d9c1);})[_0x81f7('0x27')](function(_0x36dbb9){_0x47eb8c[_0x81f7('0x46')]=_0x36dbb9;return _0x47eb8c;})['then'](respondWithFilteredResult(_0x3def8f,_0x47d9c1))[_0x81f7('0x47')](handleError(_0x3def8f,null));};exports['show']=function(_0x244c55,_0x4a5dc2){var _0x5e4691={'raw':!![],'where':{'id':_0x244c55[_0x81f7('0x48')]['id']}},_0x1ee4ba={};_0x1ee4ba['model']=_[_0x81f7('0x33')](db[_0x81f7('0x2d')][_0x81f7('0x49')]);_0x1ee4ba[_0x81f7('0x32')]=_[_0x81f7('0x33')](_0x244c55['query']);_0x1ee4ba[_0x81f7('0x34')]=_['intersection'](_0x1ee4ba['model'],_0x1ee4ba[_0x81f7('0x32')]);_0x5e4691[_0x81f7('0x37')]=_['intersection'](_0x1ee4ba['model'],qs[_0x81f7('0x36')](_0x244c55[_0x81f7('0x32')]['fields']));_0x5e4691[_0x81f7('0x37')]=_0x5e4691[_0x81f7('0x37')][_0x81f7('0x38')]?_0x5e4691[_0x81f7('0x37')]:_0x1ee4ba[_0x81f7('0x31')];if(_0x244c55['query'][_0x81f7('0x43')]){_0x5e4691[_0x81f7('0x44')]=[{'all':!![]}];}_0x5e4691=_[_0x81f7('0x40')]({},_0x5e4691,_0x244c55[_0x81f7('0x42')]);return db[_0x81f7('0x2d')][_0x81f7('0x4a')](_0x5e4691)[_0x81f7('0x27')](handleEntityNotFound(_0x4a5dc2,null))[_0x81f7('0x27')](respondWithResult(_0x4a5dc2,null))['catch'](handleError(_0x4a5dc2,null));};exports['create']=function(_0x26f2e3,_0x56fd8e){return db[_0x81f7('0x2d')][_0x81f7('0x4b')](_0x26f2e3[_0x81f7('0x4c')],{})[_0x81f7('0x27')](respondWithResult(_0x56fd8e,0xc9))[_0x81f7('0x47')](handleError(_0x56fd8e,null));};exports[_0x81f7('0x26')]=function(_0x1eb280,_0x570e2a){if(_0x1eb280[_0x81f7('0x4c')]['id']){delete _0x1eb280[_0x81f7('0x4c')]['id'];}return db[_0x81f7('0x2d')][_0x81f7('0x4a')]({'where':{'id':_0x1eb280['params']['id']}})['then'](handleEntityNotFound(_0x570e2a,null))[_0x81f7('0x27')](saveUpdates(_0x1eb280[_0x81f7('0x4c')],null))['then'](respondWithResult(_0x570e2a,null))[_0x81f7('0x47')](handleError(_0x570e2a,null));};exports[_0x81f7('0x4d')]=function(_0x313ad2,_0x4def1c){return db[_0x81f7('0x2d')][_0x81f7('0x4a')]({'where':{'id':_0x313ad2[_0x81f7('0x48')]['id']}})[_0x81f7('0x27')](handleEntityNotFound(_0x4def1c,null))[_0x81f7('0x27')](removeEntity(_0x4def1c,null))[_0x81f7('0x47')](handleError(_0x4def1c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7ccc242..c90fb40 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 _0xb33f=['exports','SmsApplication','sms_applications','utf8mb4','lodash','util','api','request-promise','./smsApplication.attributes'];(function(_0x105cd0,_0x3cebe8){var _0x2368cc=function(_0x41235e){while(--_0x41235e){_0x105cd0['push'](_0x105cd0['shift']());}};_0x2368cc(++_0x3cebe8);}(_0xb33f,0x1cf));var _0xfb33=function(_0x3da5ed,_0x4a0f3e){_0x3da5ed=_0x3da5ed-0x0;var _0x285cc4=_0xb33f[_0x3da5ed];return _0x285cc4;};'use strict';var _=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var logger=require('../../config/logger')(_0xfb33('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfb33('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb33('0x4'));module[_0xfb33('0x5')]=function(_0x163eef,_0x13f672){return _0x163eef['define'](_0xfb33('0x6'),attributes,{'tableName':_0xfb33('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb33('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4385=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x4385,0x168));var _0x5438=function(_0x25f417,_0x3167c1){_0x25f417=_0x25f417-0x0;var _0x33aa85=_0x4385[_0x25f417];return _0x33aa85;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var logger=require(_0x5438('0x2'))(_0x5438('0x3'));var moment=require('moment');var BPromise=require(_0x5438('0x4'));var rp=require(_0x5438('0x5'));var fs=require('fs');var path=require(_0x5438('0x6'));var rimraf=require(_0x5438('0x7'));var config=require(_0x5438('0x8'));var attributes=require(_0x5438('0x9'));module[_0x5438('0xa')]=function(_0x4ce1df,_0x46c7fa){return _0x4ce1df[_0x5438('0xb')](_0x5438('0xc'),attributes,{'tableName':_0x5438('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5438('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0b67017..a47a975 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 _0x10ad=['code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x10ad,0xf4));var _0xd10a=function(_0x1843f1,_0x175a27){_0x1843f1=_0x1843f1-0x0;var _0x341bb3=_0x10ad[_0x1843f1];return _0x341bb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd10a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x1'));var db=require(_0xd10a('0x2'))['db'];var utils=require(_0xd10a('0x3'));var logger=require(_0xd10a('0x4'))('rpc');var config=require(_0xd10a('0x5'));var jayson=require(_0xd10a('0x6'));var client=jayson[_0xd10a('0x7')][_0xd10a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x429316,_0xdae354,_0x217329){return new BPromise(function(_0x194a4a,_0x5be3da){return client['request'](_0x429316,_0x217329)[_0xd10a('0x9')](function(_0x4d8613){logger[_0xd10a('0xa')](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));logger[_0xd10a('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xdae354,_0xd10a('0xc'),JSON[_0xd10a('0xe')](_0x4d8613));if(_0x4d8613[_0xd10a('0xf')]){if(_0x4d8613['error'][_0xd10a('0x10')]===0x1f4){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x5be3da(_0x4d8613[_0xd10a('0xf')]['message']);}logger['error'](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x194a4a(_0x4d8613[_0xd10a('0xf')]['message']);}else{logger['info'](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));_0x194a4a(_0x4d8613[_0xd10a('0x12')][_0xd10a('0x11')]);}})[_0xd10a('0x13')](function(_0x33bb89){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x33bb89);_0x5be3da(_0x33bb89);});});} \ No newline at end of file +var _0x762e=['SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d82a2,_0x4fa954){var _0x558b6a=function(_0x108743){while(--_0x108743){_0x2d82a2['push'](_0x2d82a2['shift']());}};_0x558b6a(++_0x4fa954);}(_0x762e,0xea));var _0xe762=function(_0xcc3e82,_0xa53490){_0xcc3e82=_0xcc3e82-0x0;var _0x519c88=_0x762e[_0xcc3e82];return _0x519c88;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe762('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe762('0x2'))['db'];var utils=require(_0xe762('0x3'));var logger=require(_0xe762('0x4'))('rpc');var config=require(_0xe762('0x5'));var jayson=require(_0xe762('0x6'));var client=jayson[_0xe762('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4726,_0x7a1740,_0x2511ad){return new BPromise(function(_0xf20548,_0x26a4fc){return client[_0xe762('0x8')](_0x1f4726,_0x2511ad)['then'](function(_0x50dd96){logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));logger[_0xe762('0xc')](_0xe762('0xd'),_0x7a1740,_0xe762('0xb'),JSON['stringify'](_0x50dd96));if(_0x50dd96[_0xe762('0xe')]){if(_0x50dd96[_0xe762('0xe')][_0xe762('0xf')]===0x1f4){logger['error'](_0xe762('0xa'),_0x7a1740,_0x50dd96['error'][_0xe762('0x10')]);return _0x26a4fc(_0x50dd96['error'][_0xe762('0x10')]);}logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x50dd96['error']['message']);return _0xf20548(_0x50dd96[_0xe762('0xe')][_0xe762('0x10')]);}else{logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));_0xf20548(_0x50dd96[_0xe762('0x11')][_0xe762('0x10')]);}})[_0xe762('0x12')](function(_0x531587){logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x531587);_0x26a4fc(_0x531587);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 913d1d4..f1ed9e0 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 _0x9c00=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags'];(function(_0xdf059b,_0x198a6c){var _0x4a3c71=function(_0x381d46){while(--_0x381d46){_0xdf059b['push'](_0xdf059b['shift']());}};_0x4a3c71(++_0x198a6c);}(_0x9c00,0x1a0));var _0x09c0=function(_0x188bcd,_0x52f234){_0x188bcd=_0x188bcd-0x0;var _0x3c4e5b=_0x9c00[_0x188bcd];return _0x3c4e5b;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0x8')](_0x09c0('0xf'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0x11')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x11')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x11')](_0x09c0('0x14'),auth[_0x09c0('0xa')](),interaction[_0x09c0('0x15')](_0x09c0('0x16'),_0x09c0('0x17')),controller[_0x09c0('0x18')]);router[_0x09c0('0x19')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x09c0('0x1b')),controller[_0x09c0('0x1c')]);router[_0x09c0('0x1d')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction[_0x09c0('0x15')]('sms','smsinteraction:destroy'),controller[_0x09c0('0x1e')]);router['delete'](_0x09c0('0x14'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x28467c,_0x1931bf){var _0x39841a=function(_0x16ec33){while(--_0x16ec33){_0x28467c['push'](_0x28467c['shift']());}};_0x39841a(++_0x1931bf);}(_0xea28,0x13a));var _0x8ea2=function(_0x4839bb,_0x290610){_0x4839bb=_0x4839bb-0x0;var _0x22560d=_0xea28[_0x4839bb];return _0x22560d;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);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 b6eaa76..59c87a6 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 _0xff2a=['moment','exports','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x4782eb,_0x1dafc9){var _0x9f1353=function(_0x1b74b4){while(--_0x1b74b4){_0x4782eb['push'](_0x4782eb['shift']());}};_0x9f1353(++_0x1dafc9);}(_0xff2a,0x93));var _0xaff2=function(_0x265468,_0xcf7439){_0x265468=_0x265468-0x0;var _0x37d555=_0xff2a[_0x265468];return _0x37d555;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaff2('0x0'));module[_0xaff2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaff2('0x2')]},'disposition':{'type':Sequelize[_0xaff2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaff2('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xaff2('0x3')]},'read1stAt':{'type':Sequelize[_0xaff2('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaff2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaff2('0x5')]('in',_0xaff2('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaff2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xc906=['ENUM','out','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0xa61f71,_0x3c339f){var _0x5b237d=function(_0x2fbec3){while(--_0x2fbec3){_0xa61f71['push'](_0xa61f71['shift']());}};_0x5b237d(++_0x3c339f);}(_0xc906,0x1ad));var _0x6c90=function(_0x7895bd,_0x563b2d){_0x7895bd=_0x7895bd-0x0;var _0x1af099=_0xc906[_0x7895bd];return _0x1af099;};'use strict';var Sequelize=require(_0x6c90('0x0'));var moment=require(_0x6c90('0x1'));module['exports']={'closed':{'type':Sequelize[_0x6c90('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6c90('0x3')]},'disposition':{'type':Sequelize[_0x6c90('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6c90('0x4')]},'note':{'type':Sequelize[_0x6c90('0x4')]},'phone':{'type':Sequelize[_0x6c90('0x4')]},'read1stAt':{'type':Sequelize[_0x6c90('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6c90('0x5')]('in',_0x6c90('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6c90('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 63ee744..8efa31e 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 _0x2131=['path','ejs','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','send','map','rawAttributes','fieldName','type','getOptions','findAll','sms','query','user','catch','show','params','model','keys','SmsInteraction','intersection','attributes','fields','length','includeAll','include','options','find','create','update','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','filters','pick','SmsInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','root','files','tmp','join','transcript-%d-%s.zip','push','User','CmContact','Contact','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','fullname','N.A.','toString','closed','closedAt','disposition','out','System','value','renderFile','server','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util'];(function(_0x515e5b,_0xf03ea2){var _0x2fcce0=function(_0x106fba){while(--_0x106fba){_0x515e5b['push'](_0x515e5b['shift']());}};_0x2fcce0(++_0xf03ea2);}(_0x2131,0xee));var _0x1213=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x2131[_0x332c1b];return _0x21b49b;};'use strict';var rimraf=require(_0x1213('0x0'));var zipdir=require(_0x1213('0x1'));var moment=require('moment');var BPromise=require(_0x1213('0x2'));var util=require(_0x1213('0x3'));var path=require(_0x1213('0x4'));var ejs=require(_0x1213('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1213('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x1213('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x1213('0x8'));var config=require(_0x1213('0x9'));var db=require(_0x1213('0xa'))['db'];config['redis']=_[_0x1213('0xb')](config[_0x1213('0xc')],{'host':_0x1213('0xd'),'port':0x18eb});var socket=require(_0x1213('0xe'))(new Redis(config[_0x1213('0xc')]));require(_0x1213('0xf'))[_0x1213('0x10')](socket);function respondWithStatusCode(_0x2a7598,_0x9c24d7){_0x9c24d7=_0x9c24d7||0xcc;return function(_0x469ba8){if(_0x469ba8){return _0x2a7598[_0x1213('0x11')](_0x9c24d7);}return _0x2a7598[_0x1213('0x12')](_0x9c24d7)[_0x1213('0x13')]();};}function respondWithResult(_0x2383fe,_0x488f9b){_0x488f9b=_0x488f9b||0xc8;return function(_0x37e707){if(_0x37e707){return _0x2383fe[_0x1213('0x12')](_0x488f9b)['json'](_0x37e707);}};}function respondWithFilteredResult(_0x280a2e,_0x48d202){return function(_0x256fa8){if(_0x256fa8){var _0x1a1b04=typeof _0x48d202[_0x1213('0x14')]===_0x1213('0x15')&&typeof _0x48d202[_0x1213('0x16')]===_0x1213('0x15');var _0x14d7b7=_0x256fa8['count'];var _0x464dbe=_0x1a1b04?0x0:_0x48d202[_0x1213('0x14')];var _0x391b54=_0x1a1b04?_0x256fa8[_0x1213('0x17')]:_0x48d202[_0x1213('0x14')]+_0x48d202['limit'];var _0x2f30cf;if(_0x391b54>=_0x14d7b7){_0x391b54=_0x14d7b7;_0x2f30cf=0xc8;}else{_0x2f30cf=0xce;}_0x280a2e[_0x1213('0x12')](_0x2f30cf);return _0x280a2e[_0x1213('0x18')](_0x1213('0x19'),_0x464dbe+'-'+_0x391b54+'/'+_0x14d7b7)['json'](_0x256fa8);}return null;};}function saveUpdates(_0x1388ae){return function(_0x48aff5){if(_0x48aff5){return _0x48aff5['update'](_0x1388ae)[_0x1213('0x1a')](function(_0x3e4a0d){return _0x3e4a0d;});}return null;};}function removeEntity(_0x6d99c1){return function(_0x3618e1){if(_0x3618e1){return _0x3618e1['destroy']()['then'](function(){_0x6d99c1[_0x1213('0x12')](0xcc)[_0x1213('0x13')]();});}};}function handleEntityNotFound(_0x3e500a){return function(_0x416a17){if(!_0x416a17){_0x3e500a['sendStatus'](0x194);}return _0x416a17;};}function handleError(_0x46f7fe,_0x56fbce){_0x56fbce=_0x56fbce||0x1f4;return function(_0x45a0e6){logger[_0x1213('0x1b')](_0x45a0e6[_0x1213('0x1c')]);if(_0x45a0e6[_0x1213('0x1d')]){delete _0x45a0e6[_0x1213('0x1d')];}_0x46f7fe[_0x1213('0x12')](_0x56fbce)[_0x1213('0x1e')](_0x45a0e6);};}exports['index']=function(_0x48353a,_0x5b322d){var _0x165478={};var _0x4cf8a0=_[_0x1213('0x1f')](db['SmsInteraction'][_0x1213('0x20')],function(_0x3a6dfc){return{'name':_0x3a6dfc[_0x1213('0x21')],'type':_0x3a6dfc[_0x1213('0x22')]['key']};});_0x165478=qs[_0x1213('0x23')](_0x4cf8a0,_0x48353a);return interaction[_0x1213('0x24')](_0x1213('0x25'),_0x48353a[_0x1213('0x26')],_0x48353a[_0x1213('0x27')],_0x165478,_0x4cf8a0)['then'](respondWithFilteredResult(_0x5b322d,_0x165478))[_0x1213('0x28')](handleError(_0x5b322d,null));};exports[_0x1213('0x29')]=function(_0x57e77b,_0x36d792){var _0x1deb8a={'raw':![],'where':{'id':_0x57e77b[_0x1213('0x2a')]['id']}},_0x3b7ab3={};_0x3b7ab3[_0x1213('0x2b')]=_[_0x1213('0x2c')](db[_0x1213('0x2d')]['rawAttributes']);_0x3b7ab3['query']=_[_0x1213('0x2c')](_0x57e77b[_0x1213('0x26')]);_0x3b7ab3['filters']=_[_0x1213('0x2e')](_0x3b7ab3[_0x1213('0x2b')],_0x3b7ab3[_0x1213('0x26')]);_0x1deb8a[_0x1213('0x2f')]=_[_0x1213('0x2e')](_0x3b7ab3['model'],qs['fields'](_0x57e77b[_0x1213('0x26')][_0x1213('0x30')]));_0x1deb8a[_0x1213('0x2f')]=_0x1deb8a[_0x1213('0x2f')][_0x1213('0x31')]?_0x1deb8a[_0x1213('0x2f')]:_0x3b7ab3['model'];if(_0x57e77b[_0x1213('0x26')][_0x1213('0x32')]){_0x1deb8a[_0x1213('0x33')]=[{'all':!![]}];}_0x1deb8a=_['merge']({},_0x1deb8a,_0x57e77b[_0x1213('0x34')]);return db[_0x1213('0x2d')][_0x1213('0x35')](_0x1deb8a)[_0x1213('0x1a')](handleEntityNotFound(_0x36d792,null))['then'](respondWithResult(_0x36d792,null))[_0x1213('0x28')](handleError(_0x36d792,null));};exports[_0x1213('0x36')]=function(_0x3606d6,_0x143000){return db[_0x1213('0x2d')][_0x1213('0x36')](_0x3606d6['body'],{})[_0x1213('0x1a')](respondWithResult(_0x143000,0xc9))[_0x1213('0x28')](handleError(_0x143000,null));};exports[_0x1213('0x37')]=function(_0x587a35,_0x169541){if(_0x587a35[_0x1213('0x38')]['id']){delete _0x587a35[_0x1213('0x38')]['id'];}return db['SmsInteraction'][_0x1213('0x35')]({'where':{'id':_0x587a35['params']['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x169541,null))[_0x1213('0x1a')](saveUpdates(_0x587a35['body'],null))['then'](respondWithResult(_0x169541,null))[_0x1213('0x28')](handleError(_0x169541,null));};exports['destroy']=function(_0x3a1435,_0x56e7ad){return db[_0x1213('0x2d')][_0x1213('0x35')]({'where':{'id':_0x3a1435[_0x1213('0x2a')]['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x56e7ad,null))[_0x1213('0x1a')](removeEntity(_0x56e7ad,null))[_0x1213('0x28')](handleError(_0x56e7ad,null));};exports[_0x1213('0x39')]=function(_0x21686f,_0xc7097f){return db['SmsInteraction'][_0x1213('0x39')]()[_0x1213('0x1a')](respondWithResult(_0xc7097f,null))[_0x1213('0x28')](handleError(_0xc7097f,null));};exports[_0x1213('0x3a')]=function(_0x46ec29,_0x27297e){return db[_0x1213('0x3b')][_0x1213('0x35')]({'where':{'id':_0x46ec29['params']['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x27297e,null))['then'](function(_0x4d4589){if(_0x4d4589){return _0x4d4589[_0x1213('0x3a')](_0x46ec29['body'][_0x1213('0x3c')],_[_0x1213('0x3d')](_0x46ec29[_0x1213('0x38')],[_0x1213('0x3c'),'id'])||{});}})[_0x1213('0x1a')](respondWithResult(_0x27297e,null))[_0x1213('0x28')](handleError(_0x27297e,null));};exports[_0x1213('0x3e')]=function(_0x5c9756,_0x5aa6da){var _0xde97c2={'raw':![],'where':{}};var _0x3b8037={};var _0x53b7bb={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x1213('0x3f')]({'where':{'id':_0x5c9756[_0x1213('0x2a')]['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x5aa6da,null))[_0x1213('0x1a')](function(_0x5e7c30){if(_0x5e7c30){_0x3b8037[_0x1213('0x2b')]=_['keys'](db['SmsMessage'][_0x1213('0x20')]);_0x3b8037['query']=_[_0x1213('0x2c')](_0x5c9756['query']);_0x3b8037['filters']=_[_0x1213('0x2e')](_0x3b8037[_0x1213('0x2b')],_0x3b8037['query']);_0xde97c2['attributes']=_[_0x1213('0x2e')](_0x3b8037[_0x1213('0x2b')],qs['fields'](_0x5c9756[_0x1213('0x26')][_0x1213('0x30')]));_0xde97c2[_0x1213('0x2f')]=_0xde97c2['attributes'][_0x1213('0x31')]?_0xde97c2['attributes']:_0x3b8037[_0x1213('0x2b')];if(!_0x5c9756['query'][_0x1213('0x40')](_0x1213('0x41'))){_0xde97c2['limit']=qs['limit'](_0x5c9756[_0x1213('0x26')]['limit']);_0xde97c2['offset']=qs[_0x1213('0x14')](_0x5c9756[_0x1213('0x26')][_0x1213('0x14')]);}_0xde97c2['order']=qs[_0x1213('0x42')](_0x5c9756[_0x1213('0x26')][_0x1213('0x42')]);_0xde97c2[_0x1213('0x43')]=qs[_0x1213('0x44')](_[_0x1213('0x45')](_0x5c9756[_0x1213('0x26')],_0x3b8037[_0x1213('0x44')]));_0xde97c2[_0x1213('0x43')][_0x1213('0x46')]=_0x5e7c30['id'];if(_0x5c9756[_0x1213('0x26')][_0x1213('0x47')]){_0xde97c2[_0x1213('0x43')]=_[_0x1213('0x48')](_0xde97c2[_0x1213('0x43')],{'$or':_[_0x1213('0x1f')](_0xde97c2[_0x1213('0x2f')],function(_0x36fd47){var _0x5e5ff6={};_0x5e5ff6[_0x36fd47]={'$like':'%'+_0x5c9756[_0x1213('0x26')][_0x1213('0x47')]+'%'};return _0x5e5ff6;})});}if(_0x5c9756['query'][_0x1213('0x49')]){var _0x11cda0=_0x5c9756[_0x1213('0x26')][_0x1213('0x49')][_0x1213('0x4a')](',');var _0x233b01={};_0x233b01[_0x11cda0[0x0]]={'$gte':moment(_0x11cda0[0x1])[_0x1213('0x4b')](_0x1213('0x4c'))};_0xde97c2[_0x1213('0x43')]=_[_0x1213('0x48')](_0xde97c2[_0x1213('0x43')],_0x233b01);}_0xde97c2=_[_0x1213('0x48')]({},_0xde97c2,_0x5c9756[_0x1213('0x34')]);return db['SmsMessage'][_0x1213('0x17')]({'where':_0xde97c2[_0x1213('0x43')]})[_0x1213('0x1a')](function(_0x240807){_0x53b7bb[_0x1213('0x17')]=_0x240807;if(_0x5c9756[_0x1213('0x26')][_0x1213('0x32')]){_0xde97c2[_0x1213('0x33')]=[{'all':!![]}];}return db[_0x1213('0x3b')][_0x1213('0x24')](_0xde97c2);})[_0x1213('0x1a')](function(_0x16f68d){_0x53b7bb[_0x1213('0x4d')]=_0x16f68d;return _0x53b7bb;});}})[_0x1213('0x1a')](respondWithFilteredResult(_0x5aa6da,_0xde97c2))[_0x1213('0x28')](handleError(_0x5aa6da,null));};exports[_0x1213('0x4e')]=function(_0x373859,_0x2982bf){return db[_0x1213('0x2d')][_0x1213('0x35')]({'where':{'id':_0x373859[_0x1213('0x2a')]['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x2982bf,null))['then'](function(_0x4965a7){if(_0x4965a7){return _0x4965a7[_0x1213('0x4f')](_0x373859['body']['ids'],_['omit'](_0x373859[_0x1213('0x38')],[_0x1213('0x3c'),'id'])||{})[_0x1213('0x50')](function(){return db['Tag'][_0x1213('0x24')]({'attributes':['id','name','color'],'where':{'id':_0x373859[_0x1213('0x38')][_0x1213('0x3c')]}});})['then'](function(_0x42335c){socket['emit'](_0x1213('0x51'),{'id':Number(_0x373859[_0x1213('0x2a')]['id']),'tags':_0x42335c||[]});return{'id':Number(_0x373859[_0x1213('0x2a')]['id']),'tags':_0x42335c||[]};});}})[_0x1213('0x1a')](respondWithResult(_0x2982bf,null))[_0x1213('0x28')](handleError(_0x2982bf,null));};exports[_0x1213('0x52')]=function(_0x52af50,_0x342d22){return db['SmsInteraction'][_0x1213('0x35')]({'where':{'id':_0x52af50[_0x1213('0x2a')]['id']}})[_0x1213('0x1a')](handleEntityNotFound(_0x342d22,null))[_0x1213('0x1a')](function(_0x49e491){if(_0x49e491){return _0x49e491[_0x1213('0x52')](_0x52af50[_0x1213('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x342d22,null))[_0x1213('0x28')](handleError(_0x342d22,null));};exports[_0x1213('0x53')]=function(_0xa70ae1,_0x18c378){var _0x160837=moment()['unix']()['toString']();var _0x1eca5c=path['join'](config[_0x1213('0x54')],'server',_0x1213('0x55'),_0x1213('0x56'));var _0xd10ba9=path[_0x1213('0x57')](_0x1eca5c,_0x160837);var _0x3817b7=util[_0x1213('0x4b')](_0x1213('0x58'),_0xa70ae1[_0x1213('0x2a')]['id'],_0x160837);var _0x5843db=path[_0x1213('0x57')](_0x1eca5c,_0x3817b7);var _0x1edda3=[];_0x1edda3[_0x1213('0x59')]({'model':db[_0x1213('0x5a')],'as':_0x1213('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x1edda3['push']({'model':db[_0x1213('0x5b')],'as':_0x1213('0x5c'),'attributes':['id','firstName',_0x1213('0x5d')],'raw':!![]});var _0x163ea7=[{'model':db[_0x1213('0x3b')],'as':_0x1213('0x5e'),'attributes':['id',_0x1213('0x38'),_0x1213('0x5f'),_0x1213('0x60'),_0x1213('0x61'),_0x1213('0x62')],'include':_0x1edda3}];_0x163ea7[_0x1213('0x59')]({'model':db[_0x1213('0x63')],'as':_0x1213('0x64'),'attributes':['id',_0x1213('0x1d')]});_0x163ea7['push']({'model':db['User'],'as':_0x1213('0x65'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x1213('0x35')]({'where':{'id':_0xa70ae1[_0x1213('0x2a')]['id']},'include':_0x163ea7})['then'](handleEntityNotFound(_0x18c378,null))['then'](function(_0x4158d1){if(_0x4158d1){var _0x3e2ec1=_0x4158d1[_0x1213('0x66')]({'plain':!![]});fs[_0x1213('0x67')](_0xd10ba9);var _0x53829e={'channel':_0x1213('0x68'),'account':_0x3e2ec1[_0x1213('0x64')][_0x1213('0x1d')],'agent':_0x3e2ec1[_0x1213('0x65')]?_0x3e2ec1['Owner'][_0x1213('0x69')]:_0x1213('0x6a'),'createdAt':moment(_0x3e2ec1[_0x1213('0x5f')])['format'](_0x1213('0x4c'))[_0x1213('0x6b')](),'closedAt':_0x3e2ec1[_0x1213('0x6c')]?moment(_0x3e2ec1[_0x1213('0x6d')])[_0x1213('0x4b')](_0x1213('0x4c'))['toString']():'','disposition':_0x3e2ec1[_0x1213('0x6e')],'messages':_(_0x3e2ec1['Messages'])['filter']({'secret':![]})[_0x1213('0x1f')](function(_0x4adca4){return{'date':moment(_0x4adca4[_0x1213('0x5f')])[_0x1213('0x4b')](_0x1213('0x4c'))[_0x1213('0x6b')](),'sender':_0x4adca4[_0x1213('0x60')]===_0x1213('0x6f')?_0x4adca4[_0x1213('0x5a')]?_0x4adca4['User'][_0x1213('0x69')]:_0x1213('0x70'):_0x4adca4[_0x1213('0x5c')]['firstName']+(_0x4adca4[_0x1213('0x5c')]['lastName']?'\x20'+_0x4adca4[_0x1213('0x5c')]['lastName']:''),'body':_0x4adca4[_0x1213('0x38')],'direction':_0x4adca4[_0x1213('0x60')]===_0x1213('0x6f')?'A':'C','secret':_0x4adca4[_0x1213('0x61')],'read':_0x4adca4[_0x1213('0x62')]};})[_0x1213('0x71')]()};return ejs[_0x1213('0x72')](path['join'](config['root'],_0x1213('0x73'),'views','downloadInteraction.ejs'),{'interaction':_0x53829e})[_0x1213('0x1a')](function(_0x3525fb){var _0x51add1=path[_0x1213('0x57')](_0xd10ba9,_0x1213('0x74')+_0x3e2ec1['id']+'-'+_0x160837+'.pdf');var _0x2d2140={'path':_0x51add1,'channel':'Sms','interactionId':_0x3e2ec1['id']};return pdf[_0x1213('0x75')](_0x3525fb,_0x2d2140);})[_0x1213('0x1a')](function(){return new BPromise(function(_0x33a227,_0x40147e){zipdir(_0xd10ba9,{'saveTo':_0x5843db},function(_0x2bbf15,_0x11cbf9){if(_0x2bbf15)return _0x40147e(_0x2bbf15);return _0x33a227(_0x11cbf9);});})[_0x1213('0x1a')](function(){return new BPromise(function(_0x24fea6,_0x29c142){rimraf(_0xd10ba9,function(_0x22e495){if(_0x22e495)_0x29c142(_0x22e495);return _0x24fea6();});});})[_0x1213('0x1a')](function(){return _0x18c378['download'](_0x5843db,_0x3817b7,function(_0x35abd5){if(_0x35abd5){console[_0x1213('0x76')](_0x1213('0x77'),_0x35abd5);}else{fs[_0x1213('0x78')](_0x5843db);}});});});}else{return _0x18c378[_0x1213('0x11')](0xc8);}})['catch'](handleError(_0x18c378,null));}; \ No newline at end of file +var _0xe93c=['mkdirSync','Sms','format','closed','closedAt','System','out','secret','value','renderFile','root','views','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','zip-dir','moment','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','query','user','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','then','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','pick','filters','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','removeTags','unix','toString','join','server','files','tmp','transcript-%d-%s.zip','User','push','Contact','firstName','lastName','Messages','createdAt','direction','read','SmsAccount','Account','Owner','fullname','get'];(function(_0x2f639c,_0x5d8fd3){var _0x156e38=function(_0x3bc508){while(--_0x3bc508){_0x2f639c['push'](_0x2f639c['shift']());}};_0x156e38(++_0x5d8fd3);}(_0xe93c,0x183));var _0xce93=function(_0x216711,_0x802f69){_0x216711=_0x216711-0x0;var _0x5fd53b=_0xe93c[_0x216711];return _0x5fd53b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xce93('0x0'));var moment=require(_0xce93('0x1'));var BPromise=require('bluebird');var util=require(_0xce93('0x2'));var path=require(_0xce93('0x3'));var ejs=require(_0xce93('0x4'));var fs=require('fs');var _=require(_0xce93('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xce93('0x6'));var pdf=require(_0xce93('0x7'));var logger=require(_0xce93('0x8'))('api');var config=require(_0xce93('0x9'));var db=require(_0xce93('0xa'))['db'];config[_0xce93('0xb')]=_[_0xce93('0xc')](config['redis'],{'host':_0xce93('0xd'),'port':0x18eb});var socket=require(_0xce93('0xe'))(new Redis(config['redis']));require(_0xce93('0xf'))[_0xce93('0x10')](socket);function respondWithStatusCode(_0x536b44,_0x598dae){_0x598dae=_0x598dae||0xcc;return function(_0x2d1f39){if(_0x2d1f39){return _0x536b44[_0xce93('0x11')](_0x598dae);}return _0x536b44[_0xce93('0x12')](_0x598dae)[_0xce93('0x13')]();};}function respondWithResult(_0x2381c6,_0x228d0f){_0x228d0f=_0x228d0f||0xc8;return function(_0x31fb56){if(_0x31fb56){return _0x2381c6[_0xce93('0x12')](_0x228d0f)[_0xce93('0x14')](_0x31fb56);}};}function respondWithFilteredResult(_0x5b9346,_0x3620b0){return function(_0x2de9a9){if(_0x2de9a9){var _0xf5f6ed=typeof _0x3620b0[_0xce93('0x15')]===_0xce93('0x16')&&typeof _0x3620b0[_0xce93('0x17')]===_0xce93('0x16');var _0xa9bf61=_0x2de9a9[_0xce93('0x18')];var _0x46b4b6=_0xf5f6ed?0x0:_0x3620b0[_0xce93('0x15')];var _0x48a037=_0xf5f6ed?_0x2de9a9['count']:_0x3620b0[_0xce93('0x15')]+_0x3620b0[_0xce93('0x17')];var _0x1ce053;if(_0x48a037>=_0xa9bf61){_0x48a037=_0xa9bf61;_0x1ce053=0xc8;}else{_0x1ce053=0xce;}_0x5b9346[_0xce93('0x12')](_0x1ce053);return _0x5b9346[_0xce93('0x19')]('Content-Range',_0x46b4b6+'-'+_0x48a037+'/'+_0xa9bf61)[_0xce93('0x14')](_0x2de9a9);}return null;};}function saveUpdates(_0x446b3f){return function(_0x547f92){if(_0x547f92){return _0x547f92[_0xce93('0x1a')](_0x446b3f)['then'](function(_0x121ea9){return _0x121ea9;});}return null;};}function removeEntity(_0x119efa){return function(_0x2dd9f3){if(_0x2dd9f3){return _0x2dd9f3['destroy']()['then'](function(){_0x119efa[_0xce93('0x12')](0xcc)[_0xce93('0x13')]();});}};}function handleEntityNotFound(_0x4f42d9){return function(_0x327085){if(!_0x327085){_0x4f42d9[_0xce93('0x11')](0x194);}return _0x327085;};}function handleError(_0x3371e0,_0x38f867){_0x38f867=_0x38f867||0x1f4;return function(_0x23752c){logger[_0xce93('0x1b')](_0x23752c[_0xce93('0x1c')]);if(_0x23752c[_0xce93('0x1d')]){delete _0x23752c[_0xce93('0x1d')];}_0x3371e0[_0xce93('0x12')](_0x38f867)[_0xce93('0x1e')](_0x23752c);};}exports[_0xce93('0x1f')]=function(_0x1b5c86,_0x40fd0d){var _0x20acb4={};var _0x51bd06=_[_0xce93('0x20')](db[_0xce93('0x21')][_0xce93('0x22')],function(_0x4855ea){return{'name':_0x4855ea[_0xce93('0x23')],'type':_0x4855ea[_0xce93('0x24')]['key']};});_0x20acb4=qs[_0xce93('0x25')](_0x51bd06,_0x1b5c86);return interaction[_0xce93('0x26')](_0xce93('0x27'),_0x1b5c86[_0xce93('0x28')],_0x1b5c86[_0xce93('0x29')],_0x20acb4,_0x51bd06)['then'](respondWithFilteredResult(_0x40fd0d,_0x20acb4))[_0xce93('0x2a')](handleError(_0x40fd0d,null));};exports[_0xce93('0x2b')]=function(_0x15ed6a,_0x77caed){var _0x4e0135={'raw':![],'where':{'id':_0x15ed6a[_0xce93('0x2c')]['id']}},_0x9d7dff={};_0x9d7dff[_0xce93('0x2d')]=_[_0xce93('0x2e')](db[_0xce93('0x21')][_0xce93('0x22')]);_0x9d7dff[_0xce93('0x28')]=_[_0xce93('0x2e')](_0x15ed6a[_0xce93('0x28')]);_0x9d7dff['filters']=_[_0xce93('0x2f')](_0x9d7dff[_0xce93('0x2d')],_0x9d7dff['query']);_0x4e0135['attributes']=_['intersection'](_0x9d7dff['model'],qs[_0xce93('0x30')](_0x15ed6a[_0xce93('0x28')][_0xce93('0x30')]));_0x4e0135[_0xce93('0x31')]=_0x4e0135[_0xce93('0x31')][_0xce93('0x32')]?_0x4e0135[_0xce93('0x31')]:_0x9d7dff[_0xce93('0x2d')];if(_0x15ed6a['query'][_0xce93('0x33')]){_0x4e0135[_0xce93('0x34')]=[{'all':!![]}];}_0x4e0135=_[_0xce93('0x35')]({},_0x4e0135,_0x15ed6a[_0xce93('0x36')]);return db[_0xce93('0x21')][_0xce93('0x37')](_0x4e0135)[_0xce93('0x38')](handleEntityNotFound(_0x77caed,null))[_0xce93('0x38')](respondWithResult(_0x77caed,null))[_0xce93('0x2a')](handleError(_0x77caed,null));};exports['create']=function(_0x66e367,_0xe3b213){return db['SmsInteraction'][_0xce93('0x39')](_0x66e367[_0xce93('0x3a')],{})[_0xce93('0x38')](respondWithResult(_0xe3b213,0xc9))[_0xce93('0x2a')](handleError(_0xe3b213,null));};exports['update']=function(_0x59c4f1,_0x838672){if(_0x59c4f1['body']['id']){delete _0x59c4f1[_0xce93('0x3a')]['id'];}return db['SmsInteraction'][_0xce93('0x37')]({'where':{'id':_0x59c4f1['params']['id']}})[_0xce93('0x38')](handleEntityNotFound(_0x838672,null))[_0xce93('0x38')](saveUpdates(_0x59c4f1[_0xce93('0x3a')],null))['then'](respondWithResult(_0x838672,null))['catch'](handleError(_0x838672,null));};exports[_0xce93('0x3b')]=function(_0x247ed7,_0x6aca45){return db['SmsInteraction'][_0xce93('0x37')]({'where':{'id':_0x247ed7[_0xce93('0x2c')]['id']}})['then'](handleEntityNotFound(_0x6aca45,null))[_0xce93('0x38')](removeEntity(_0x6aca45,null))[_0xce93('0x2a')](handleError(_0x6aca45,null));};exports[_0xce93('0x3c')]=function(_0x28016c,_0x3f0221){return db[_0xce93('0x21')]['describe']()[_0xce93('0x38')](respondWithResult(_0x3f0221,null))[_0xce93('0x2a')](handleError(_0x3f0221,null));};exports[_0xce93('0x3d')]=function(_0x30a1f9,_0xbc7bbb){return db['SmsMessage'][_0xce93('0x37')]({'where':{'id':_0x30a1f9[_0xce93('0x2c')]['id']}})['then'](handleEntityNotFound(_0xbc7bbb,null))[_0xce93('0x38')](function(_0x38b02a){if(_0x38b02a){return _0x38b02a[_0xce93('0x3d')](_0x30a1f9['body'][_0xce93('0x3e')],_[_0xce93('0x3f')](_0x30a1f9[_0xce93('0x3a')],[_0xce93('0x3e'),'id'])||{});}})[_0xce93('0x38')](respondWithResult(_0xbc7bbb,null))[_0xce93('0x2a')](handleError(_0xbc7bbb,null));};exports[_0xce93('0x40')]=function(_0x4bb527,_0x2e79eb){var _0x4a0ccd={'raw':![],'where':{}};var _0xd3812b={};var _0x39a6bb={'count':0x0,'rows':[]};return db[_0xce93('0x21')][_0xce93('0x41')]({'where':{'id':_0x4bb527[_0xce93('0x2c')]['id']}})[_0xce93('0x38')](handleEntityNotFound(_0x2e79eb,null))[_0xce93('0x38')](function(_0x126609){if(_0x126609){_0xd3812b['model']=_[_0xce93('0x2e')](db[_0xce93('0x42')][_0xce93('0x22')]);_0xd3812b[_0xce93('0x28')]=_[_0xce93('0x2e')](_0x4bb527['query']);_0xd3812b['filters']=_[_0xce93('0x2f')](_0xd3812b['model'],_0xd3812b[_0xce93('0x28')]);_0x4a0ccd[_0xce93('0x31')]=_[_0xce93('0x2f')](_0xd3812b[_0xce93('0x2d')],qs[_0xce93('0x30')](_0x4bb527[_0xce93('0x28')]['fields']));_0x4a0ccd[_0xce93('0x31')]=_0x4a0ccd[_0xce93('0x31')][_0xce93('0x32')]?_0x4a0ccd[_0xce93('0x31')]:_0xd3812b[_0xce93('0x2d')];if(!_0x4bb527[_0xce93('0x28')][_0xce93('0x43')](_0xce93('0x44'))){_0x4a0ccd[_0xce93('0x17')]=qs[_0xce93('0x17')](_0x4bb527[_0xce93('0x28')][_0xce93('0x17')]);_0x4a0ccd[_0xce93('0x15')]=qs[_0xce93('0x15')](_0x4bb527['query'][_0xce93('0x15')]);}_0x4a0ccd[_0xce93('0x45')]=qs[_0xce93('0x46')](_0x4bb527['query']['sort']);_0x4a0ccd['where']=qs['filters'](_[_0xce93('0x47')](_0x4bb527[_0xce93('0x28')],_0xd3812b[_0xce93('0x48')]));_0x4a0ccd[_0xce93('0x49')]['SmsInteractionId']=_0x126609['id'];if(_0x4bb527[_0xce93('0x28')][_0xce93('0x4a')]){_0x4a0ccd[_0xce93('0x49')]=_[_0xce93('0x35')](_0x4a0ccd['where'],{'$or':_[_0xce93('0x20')](_0x4a0ccd['attributes'],function(_0x102055){var _0x50dce8={};_0x50dce8[_0x102055]={'$like':'%'+_0x4bb527[_0xce93('0x28')]['filter']+'%'};return _0x50dce8;})});}if(_0x4bb527[_0xce93('0x28')][_0xce93('0x4b')]){var _0x174381=_0x4bb527[_0xce93('0x28')][_0xce93('0x4b')][_0xce93('0x4c')](',');var _0x15bbed={};_0x15bbed[_0x174381[0x0]]={'$gte':moment(_0x174381[0x1])['format'](_0xce93('0x4d'))};_0x4a0ccd[_0xce93('0x49')]=_['merge'](_0x4a0ccd[_0xce93('0x49')],_0x15bbed);}_0x4a0ccd=_['merge']({},_0x4a0ccd,_0x4bb527[_0xce93('0x36')]);return db[_0xce93('0x42')][_0xce93('0x18')]({'where':_0x4a0ccd[_0xce93('0x49')]})[_0xce93('0x38')](function(_0x579945){_0x39a6bb[_0xce93('0x18')]=_0x579945;if(_0x4bb527['query'][_0xce93('0x33')]){_0x4a0ccd['include']=[{'all':!![]}];}return db['SmsMessage'][_0xce93('0x26')](_0x4a0ccd);})[_0xce93('0x38')](function(_0x1039b4){_0x39a6bb[_0xce93('0x4e')]=_0x1039b4;return _0x39a6bb;});}})['then'](respondWithFilteredResult(_0x2e79eb,_0x4a0ccd))[_0xce93('0x2a')](handleError(_0x2e79eb,null));};exports['addTags']=function(_0x2fd70e,_0x5c6be4){return db[_0xce93('0x21')]['find']({'where':{'id':_0x2fd70e[_0xce93('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5c6be4,null))[_0xce93('0x38')](function(_0x56ab77){if(_0x56ab77){return _0x56ab77[_0xce93('0x4f')](_0x2fd70e['body'][_0xce93('0x3e')],_[_0xce93('0x3f')](_0x2fd70e['body'],[_0xce93('0x3e'),'id'])||{})[_0xce93('0x50')](function(){return db[_0xce93('0x51')][_0xce93('0x26')]({'attributes':['id','name',_0xce93('0x52')],'where':{'id':_0x2fd70e['body']['ids']}});})['then'](function(_0x197f9e){socket['emit']('smsInteractionTags:save',{'id':Number(_0x2fd70e[_0xce93('0x2c')]['id']),'tags':_0x197f9e||[]});return{'id':Number(_0x2fd70e['params']['id']),'tags':_0x197f9e||[]};});}})['then'](respondWithResult(_0x5c6be4,null))['catch'](handleError(_0x5c6be4,null));};exports[_0xce93('0x53')]=function(_0x1f9a30,_0x31f80a){return db[_0xce93('0x21')][_0xce93('0x37')]({'where':{'id':_0x1f9a30['params']['id']}})[_0xce93('0x38')](handleEntityNotFound(_0x31f80a,null))['then'](function(_0x21d5a7){if(_0x21d5a7){return _0x21d5a7[_0xce93('0x53')](_0x1f9a30[_0xce93('0x28')][_0xce93('0x3e')]);}})[_0xce93('0x38')](respondWithStatusCode(_0x31f80a,null))[_0xce93('0x2a')](handleError(_0x31f80a,null));};exports['download']=function(_0x5bc93d,_0x331f9c){var _0x4b4ea3=moment()[_0xce93('0x54')]()[_0xce93('0x55')]();var _0x1d029e=path[_0xce93('0x56')](config['root'],_0xce93('0x57'),_0xce93('0x58'),_0xce93('0x59'));var _0x2e8c84=path['join'](_0x1d029e,_0x4b4ea3);var _0x4e5242=util['format'](_0xce93('0x5a'),_0x5bc93d[_0xce93('0x2c')]['id'],_0x4b4ea3);var _0x43bb4d=path['join'](_0x1d029e,_0x4e5242);var _0x359c5a=[];_0x359c5a['push']({'model':db[_0xce93('0x5b')],'as':_0xce93('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0x359c5a[_0xce93('0x5c')]({'model':db['CmContact'],'as':_0xce93('0x5d'),'attributes':['id',_0xce93('0x5e'),_0xce93('0x5f')],'raw':!![]});var _0x11e42c=[{'model':db[_0xce93('0x42')],'as':_0xce93('0x60'),'attributes':['id',_0xce93('0x3a'),_0xce93('0x61'),_0xce93('0x62'),'secret',_0xce93('0x63')],'include':_0x359c5a}];_0x11e42c[_0xce93('0x5c')]({'model':db[_0xce93('0x64')],'as':_0xce93('0x65'),'attributes':['id',_0xce93('0x1d')]});_0x11e42c['push']({'model':db[_0xce93('0x5b')],'as':_0xce93('0x66'),'attributes':['id',_0xce93('0x67')]});return db[_0xce93('0x21')][_0xce93('0x37')]({'where':{'id':_0x5bc93d['params']['id']},'include':_0x11e42c})[_0xce93('0x38')](handleEntityNotFound(_0x331f9c,null))['then'](function(_0x546384){if(_0x546384){var _0x4cdace=_0x546384[_0xce93('0x68')]({'plain':!![]});fs[_0xce93('0x69')](_0x2e8c84);var _0x40f582={'channel':_0xce93('0x6a'),'account':_0x4cdace[_0xce93('0x65')][_0xce93('0x1d')],'agent':_0x4cdace[_0xce93('0x66')]?_0x4cdace[_0xce93('0x66')]['fullname']:'N.A.','createdAt':moment(_0x4cdace['createdAt'])[_0xce93('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xce93('0x55')](),'closedAt':_0x4cdace[_0xce93('0x6c')]?moment(_0x4cdace[_0xce93('0x6d')])[_0xce93('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4cdace['disposition'],'messages':_(_0x4cdace[_0xce93('0x60')])[_0xce93('0x4a')]({'secret':![]})['map'](function(_0x5c1a6c){return{'date':moment(_0x5c1a6c['createdAt'])['format'](_0xce93('0x4d'))[_0xce93('0x55')](),'sender':_0x5c1a6c[_0xce93('0x62')]==='out'?_0x5c1a6c[_0xce93('0x5b')]?_0x5c1a6c[_0xce93('0x5b')][_0xce93('0x67')]:_0xce93('0x6e'):_0x5c1a6c['Contact'][_0xce93('0x5e')]+(_0x5c1a6c[_0xce93('0x5d')]['lastName']?'\x20'+_0x5c1a6c['Contact'][_0xce93('0x5f')]:''),'body':_0x5c1a6c[_0xce93('0x3a')],'direction':_0x5c1a6c['direction']===_0xce93('0x6f')?'A':'C','secret':_0x5c1a6c[_0xce93('0x70')],'read':_0x5c1a6c[_0xce93('0x63')]};})[_0xce93('0x71')]()};return ejs[_0xce93('0x72')](path[_0xce93('0x56')](config[_0xce93('0x73')],_0xce93('0x57'),_0xce93('0x74'),'downloadInteraction.ejs'),{'interaction':_0x40f582})[_0xce93('0x38')](function(_0x34713c){var _0x1278b5=path[_0xce93('0x56')](_0x2e8c84,_0xce93('0x75')+_0x4cdace['id']+'-'+_0x4b4ea3+_0xce93('0x76'));var _0x441d9c={'path':_0x1278b5,'channel':_0xce93('0x6a'),'interactionId':_0x4cdace['id']};return pdf[_0xce93('0x77')](_0x34713c,_0x441d9c);})['then'](function(){return new BPromise(function(_0x1ef3cd,_0x1d9041){zipdir(_0x2e8c84,{'saveTo':_0x43bb4d},function(_0x5ec140,_0xc5ebc2){if(_0x5ec140)return _0x1d9041(_0x5ec140);return _0x1ef3cd(_0xc5ebc2);});})[_0xce93('0x38')](function(){return new BPromise(function(_0x25ab24,_0x466d25){rimraf(_0x2e8c84,function(_0x11c354){if(_0x11c354)_0x466d25(_0x11c354);return _0x25ab24();});});})[_0xce93('0x38')](function(){return _0x331f9c[_0xce93('0x78')](_0x43bb4d,_0x4e5242,function(_0x1e8579){if(_0x1e8579){console['log'](_0xce93('0x79'),_0x1e8579);}else{fs[_0xce93('0x7a')](_0x43bb4d);}});});});}else{return _0x331f9c[_0xce93('0x11')](0xc8);}})['catch'](handleError(_0x331f9c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5938684..6d2e669 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 _0x0972=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x279821,_0x2c52b8){var _0x28fc2d=function(_0x20aa80){while(--_0x20aa80){_0x279821['push'](_0x279821['shift']());}};_0x28fc2d(++_0x2c52b8);}(_0x0972,0x64));var _0x2097=function(_0x27c7df,_0xa21fc0){_0x27c7df=_0x27c7df-0x0;var _0x19851a=_0x0972[_0x27c7df];return _0x19851a;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2097('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x2097('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2097('0x1')](0x0);var events={'afterCreate':_0x2097('0x2'),'afterUpdate':'update','afterDestroy':_0x2097('0x3')};function emitEvent(_0x431d1c){return function(_0xe6fbae,_0x1a7d26,_0x2f84d8){_0xe6fbae[_0x2097('0x4')]({'attributes':['id'],'raw':!![]})[_0x2097('0x5')](function(_0x59739f){_0xe6fbae[_0x2097('0x6')](_0x2097('0x7'),_0x59739f[_0x2097('0x8')](function(_0x1d94e2){return{'id':_0x1d94e2['id']};}));return SmsMessage[_0x2097('0x9')]({'where':{'SmsInteractionId':_0xe6fbae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e0024){_0xe6fbae[_0x2097('0x6')](_0x2097('0xa'),_0x2e0024[_0x2097('0xb')]);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c+':'+_0xe6fbae['id'],_0xe6fbae);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c,_0xe6fbae);_0x2f84d8(null);})[_0x2097('0xd')](_0x2f84d8(null));};}for(var e in events){if(events[_0x2097('0xe')](e)){var event=events[e];SmsInteraction[_0x2097('0xf')](e,emitEvent(event));}}module[_0x2097('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0xbbbc=['map','findAll','length','emit','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','then','setDataValue','Users'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0xbbbc[_0x35ebae];return _0x1924cf;};'use strict';var EventEmitter=require(_0xcbbb('0x0'));var SmsInteraction=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x2')];var SmsMessage=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xcbbb('0x4')](0x0);var events={'afterCreate':_0xcbbb('0x5'),'afterUpdate':'update','afterDestroy':_0xcbbb('0x6')};function emitEvent(_0x938376){return function(_0x45da04,_0x3ccbf6,_0x43ff05){_0x45da04['getUsers']({'attributes':['id'],'raw':!![]})[_0xcbbb('0x7')](function(_0x1796b4){_0x45da04[_0xcbbb('0x8')](_0xcbbb('0x9'),_0x1796b4[_0xcbbb('0xa')](function(_0x150355){return{'id':_0x150355['id']};}));return SmsMessage[_0xcbbb('0xb')]({'where':{'SmsInteractionId':_0x45da04['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x225156){_0x45da04['setDataValue']('unreadMessages',_0x225156[_0xcbbb('0xc')]);SmsInteractionEvents['emit'](_0x938376+':'+_0x45da04['id'],_0x45da04);SmsInteractionEvents[_0xcbbb('0xd')](_0x938376,_0x45da04);_0x43ff05(null);})['catch'](_0x43ff05(null));};}for(var e in events){if(events[_0xcbbb('0xe')](e)){var event=events[e];SmsInteraction[_0xcbbb('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c2194e3..9f06d0e 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 _0x3f69=['bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x3f69,0xd9));var _0x93f6=function(_0x39e758,_0x454ce0){_0x39e758=_0x39e758-0x0;var _0x456464=_0x3f69[_0x39e758];return _0x456464;};'use strict';var _=require(_0x93f6('0x0'));var util=require('util');var logger=require(_0x93f6('0x1'))(_0x93f6('0x2'));var moment=require(_0x93f6('0x3'));var BPromise=require(_0x93f6('0x4'));var rp=require(_0x93f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93f6('0x6'));var config=require(_0x93f6('0x7'));var attributes=require(_0x93f6('0x8'));module[_0x93f6('0x9')]=function(_0xb51852,_0x3d534e){return _0xb51852[_0x93f6('0xa')](_0x93f6('0xb'),attributes,{'tableName':_0x93f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5cb85a,_0x516011,_0x38ccb6){if(_0x5cb85a[_0x93f6('0xd')]('closed')){_0x5cb85a[_0x93f6('0xe')]=moment()[_0x93f6('0xf')](_0x93f6('0x10'));}_0x38ccb6(null,_0x5cb85a);}}});}; \ No newline at end of file +var _0xeded=['request-promise','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','closed','closedAt','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeded,0x106));var _0xdede=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeded[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdede('0x0'))(_0xdede('0x1'));var moment=require(_0xdede('0x2'));var BPromise=require(_0xdede('0x3'));var rp=require(_0xdede('0x4'));var fs=require('fs');var path=require(_0xdede('0x5'));var rimraf=require(_0xdede('0x6'));var config=require(_0xdede('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x2a7225,_0x3f1735){return _0x2a7225[_0xdede('0x8')](_0xdede('0x9'),attributes,{'tableName':_0xdede('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34d9c7,_0x4b91f0,_0x2d8cb2){if(_0x34d9c7[_0xdede('0xb')](_0xdede('0xc'))){_0x34d9c7[_0xdede('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2d8cb2(null,_0x34d9c7);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a1335d6..02dbe3d 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 _0x378f=['client','redis','localhost','socket.io-emitter','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','ids','omit','body','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x22f924,_0x5201d2){var _0x4c6c70=function(_0x10d3b2){while(--_0x10d3b2){_0x22f924['push'](_0x22f924['shift']());}};_0x4c6c70(++_0x5201d2);}(_0x378f,0x92));var _0xf378=function(_0x19ddd9,_0x4351de){_0x19ddd9=_0x19ddd9-0x0;var _0x13ab97=_0x378f[_0x19ddd9];return _0x13ab97;};'use strict';var _=require(_0xf378('0x0'));var util=require('util');var moment=require(_0xf378('0x1'));var BPromise=require(_0xf378('0x2'));var rs=require(_0xf378('0x3'));var fs=require('fs');var Redis=require(_0xf378('0x4'));var db=require(_0xf378('0x5'))['db'];var utils=require(_0xf378('0x6'));var logger=require(_0xf378('0x7'))(_0xf378('0x8'));var config=require('../../config/environment');var jayson=require(_0xf378('0x9'));var client=jayson[_0xf378('0xa')]['http']({'port':0x232a});config[_0xf378('0xb')]=_['defaults'](config[_0xf378('0xb')],{'host':_0xf378('0xc'),'port':0x18eb});var socket=require(_0xf378('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x15d095,_0x446f78,_0x3e8792){return new BPromise(function(_0x191d7b,_0x4f673d){return client[_0xf378('0xe')](_0x15d095,_0x3e8792)['then'](function(_0x2360d6){logger[_0xf378('0xf')](_0xf378('0x10'),_0x446f78,'request\x20sent');logger[_0xf378('0x11')](_0xf378('0x12'),_0x446f78,_0xf378('0x13'),JSON[_0xf378('0x14')](_0x2360d6));if(_0x2360d6[_0xf378('0x15')]){if(_0x2360d6['error']['code']===0x1f4){logger[_0xf378('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x446f78,_0x2360d6[_0xf378('0x15')][_0xf378('0x16')]);return _0x4f673d(_0x2360d6['error']['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x446f78,_0x2360d6['error']['message']);return _0x191d7b(_0x2360d6[_0xf378('0x15')][_0xf378('0x16')]);}else{logger[_0xf378('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x446f78,_0xf378('0x13'));_0x191d7b(_0x2360d6['result'][_0xf378('0x16')]);}})[_0xf378('0x17')](function(_0x122853){logger[_0xf378('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x446f78,_0x122853);_0x4f673d(_0x122853);});});}exports[_0xf378('0x18')]=function(_0x10ed07){var _0x172716=this;return new Promise(function(_0x3680fb,_0xe9ed0a){return db[_0xf378('0x19')][_0xf378('0x1a')](_0x10ed07['body'],{'raw':_0x10ed07['options']?_0x10ed07[_0xf378('0x1b')][_0xf378('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10ed07[_0xf378('0x1b')]?_0x10ed07[_0xf378('0x1b')][_0xf378('0x1d')]||null:null,'attributes':_0x10ed07['options']?_0x10ed07[_0xf378('0x1b')][_0xf378('0x1e')]||null:null,'limit':_0x10ed07[_0xf378('0x1b')]?_0x10ed07[_0xf378('0x1b')][_0xf378('0x1f')]||null:null})[_0xf378('0x20')](function(_0x3c827a){logger[_0xf378('0xf')](_0xf378('0x18'),_0x10ed07);logger['debug'](_0xf378('0x18'),_0x10ed07,JSON[_0xf378('0x14')](_0x3c827a));_0x3680fb(_0x3c827a);})[_0xf378('0x17')](function(_0x11c4e0){logger[_0xf378('0x15')]('UpdateSmsInteraction',_0x11c4e0['message'],_0x10ed07);_0xe9ed0a(_0x172716[_0xf378('0x15')](0x1f4,_0x11c4e0[_0xf378('0x16')]));});});};exports[_0xf378('0x21')]=function(_0x2e925c){return new Promise(function(_0x8533b0,_0x2fa8cd){return db[_0xf378('0x19')]['find']({'where':_0x2e925c[_0xf378('0x1b')]?_0x2e925c[_0xf378('0x1b')][_0xf378('0x1d')]||null:null})['then'](function(_0x365d52){if(_0x365d52){return _0x365d52['addTags'](_0x2e925c['body'][_0xf378('0x22')],_[_0xf378('0x23')](_0x2e925c[_0xf378('0x24')],[_0xf378('0x22'),'id'])||{});}})[_0xf378('0x25')](function(_0x16f8f1){logger['info'](_0xf378('0x26'),_0x2e925c);logger[_0xf378('0x11')](_0xf378('0x26'),_0x2e925c,JSON[_0xf378('0x14')](_0x16f8f1));_0x8533b0(_0x16f8f1);})[_0xf378('0x17')](function(_0x282388){logger[_0xf378('0x15')]('AddTags',_0x282388[_0xf378('0x16')],_0x2e925c);_0x2fa8cd(_this[_0xf378('0x15')](0x1f4,_0x282388[_0xf378('0x16')]));});});}; \ No newline at end of file +var _0x4ad9=['request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','find','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4ad9,0x174));var _0x94ad=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4ad9[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x94ad('0x0'));var util=require(_0x94ad('0x1'));var moment=require(_0x94ad('0x2'));var BPromise=require('bluebird');var rs=require(_0x94ad('0x3'));var fs=require('fs');var Redis=require(_0x94ad('0x4'));var db=require(_0x94ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94ad('0x6'))(_0x94ad('0x7'));var config=require(_0x94ad('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x94ad('0x9')](config[_0x94ad('0xa')],{'host':_0x94ad('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x94ad('0xc'))[_0x94ad('0xd')](socket);function respondWithRpcPromise(_0x1c0b38,_0x323bed,_0x5676d0){return new BPromise(function(_0x256f52,_0x505e34){return client[_0x94ad('0xe')](_0x1c0b38,_0x5676d0)[_0x94ad('0xf')](function(_0x1cdeaf){logger[_0x94ad('0x10')](_0x94ad('0x11'),_0x323bed,_0x94ad('0x12'));logger['debug'](_0x94ad('0x13'),_0x323bed,'request\x20sent',JSON[_0x94ad('0x14')](_0x1cdeaf));if(_0x1cdeaf['error']){if(_0x1cdeaf[_0x94ad('0x15')]['code']===0x1f4){logger['error'](_0x94ad('0x11'),_0x323bed,_0x1cdeaf[_0x94ad('0x15')][_0x94ad('0x16')]);return _0x505e34(_0x1cdeaf[_0x94ad('0x15')][_0x94ad('0x16')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x323bed,_0x1cdeaf['error'][_0x94ad('0x16')]);return _0x256f52(_0x1cdeaf[_0x94ad('0x15')][_0x94ad('0x16')]);}else{logger[_0x94ad('0x10')](_0x94ad('0x11'),_0x323bed,_0x94ad('0x12'));_0x256f52(_0x1cdeaf[_0x94ad('0x17')][_0x94ad('0x16')]);}})[_0x94ad('0x18')](function(_0x101f2d){logger[_0x94ad('0x15')](_0x94ad('0x11'),_0x323bed,_0x101f2d);_0x505e34(_0x101f2d);});});}exports[_0x94ad('0x19')]=function(_0x3c08d9){var _0x32213a=this;return new Promise(function(_0x28817e,_0x36276b){return db[_0x94ad('0x1a')]['update'](_0x3c08d9['body'],{'raw':_0x3c08d9[_0x94ad('0x1b')]?_0x3c08d9[_0x94ad('0x1b')][_0x94ad('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c08d9[_0x94ad('0x1b')]?_0x3c08d9[_0x94ad('0x1b')][_0x94ad('0x1d')]||null:null,'attributes':_0x3c08d9[_0x94ad('0x1b')]?_0x3c08d9[_0x94ad('0x1b')][_0x94ad('0x1e')]||null:null,'limit':_0x3c08d9[_0x94ad('0x1b')]?_0x3c08d9[_0x94ad('0x1b')][_0x94ad('0x1f')]||null:null})[_0x94ad('0xf')](function(_0x35ced1){logger['info']('UpdateSmsInteraction',_0x3c08d9);logger[_0x94ad('0x20')]('UpdateSmsInteraction',_0x3c08d9,JSON[_0x94ad('0x14')](_0x35ced1));_0x28817e(_0x35ced1);})[_0x94ad('0x18')](function(_0xb25e2){logger['error']('UpdateSmsInteraction',_0xb25e2['message'],_0x3c08d9);_0x36276b(_0x32213a[_0x94ad('0x15')](0x1f4,_0xb25e2[_0x94ad('0x16')]));});});};exports[_0x94ad('0x21')]=function(_0x24ab6b){return new Promise(function(_0x10592d,_0x2cf1f1){return db[_0x94ad('0x1a')][_0x94ad('0x22')]({'where':_0x24ab6b['options']?_0x24ab6b[_0x94ad('0x1b')]['where']||null:null})[_0x94ad('0xf')](function(_0x314964){if(_0x314964){return _0x314964['addTags'](_0x24ab6b[_0x94ad('0x23')]['ids'],_['omit'](_0x24ab6b['body'],[_0x94ad('0x24'),'id'])||{});}})[_0x94ad('0x25')](function(_0x94699f){logger[_0x94ad('0x10')](_0x94ad('0x26'),_0x24ab6b);logger[_0x94ad('0x20')](_0x94ad('0x26'),_0x24ab6b,JSON[_0x94ad('0x14')](_0x94699f));_0x10592d(_0x94699f);})[_0x94ad('0x18')](function(_0x3fe0a0){logger['error']('AddTags',_0x3fe0a0[_0x94ad('0x16')],_0x24ab6b);_0x2cf1f1(_this[_0x94ad('0x15')](0x1f4,_0x3fe0a0[_0x94ad('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 872ddee..96a1b53 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 _0x0b55=['save','remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x58ab89,_0xf01b2d){var _0xb93c04=function(_0x29e1b2){while(--_0x29e1b2){_0x58ab89['push'](_0x58ab89['shift']());}};_0xb93c04(++_0xf01b2d);}(_0x0b55,0x182));var _0x50b5=function(_0x29603e,_0x4c10ee){_0x29603e=_0x29603e-0x0;var _0x5cbf1d=_0x0b55[_0x29603e];return _0x5cbf1d;};'use strict';var SmsInteractionEvents=require(_0x50b5('0x0'));var events=[_0x50b5('0x1'),_0x50b5('0x2'),_0x50b5('0x3')];function createListener(_0x5023c3,_0x5bb36b){return function(_0x2f2ca7){_0x5bb36b[_0x50b5('0x4')](_0x5023c3,_0x2f2ca7);};}function removeListener(_0x11ae68,_0x188ede){return function(){SmsInteractionEvents[_0x50b5('0x5')](_0x11ae68,_0x188ede);};}exports[_0x50b5('0x6')]=function(_0x19d840){for(var _0x1c9e42=0x0,_0x5cdd05=events[_0x50b5('0x7')];_0x1c9e42<_0x5cdd05;_0x1c9e42++){var _0x488a6b=events[_0x1c9e42];var _0x10cfcd=createListener(_0x50b5('0x8')+_0x488a6b,_0x19d840);SmsInteractionEvents['on'](_0x488a6b,_0x10cfcd);}}; \ No newline at end of file +var _0xa6aa=['remove','emit','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x2fe56a,_0x403e1f){var _0x3317a8=function(_0xdb4b23){while(--_0xdb4b23){_0x2fe56a['push'](_0x2fe56a['shift']());}};_0x3317a8(++_0x403e1f);}(_0xa6aa,0xef));var _0xaa6a=function(_0x337216,_0x4184e2){_0x337216=_0x337216-0x0;var _0x113fdb=_0xa6aa[_0x337216];return _0x113fdb;};'use strict';var SmsInteractionEvents=require(_0xaa6a('0x0'));var events=['save',_0xaa6a('0x1'),'update'];function createListener(_0x56c4ea,_0x18d59f){return function(_0x3e54f7){_0x18d59f[_0xaa6a('0x2')](_0x56c4ea,_0x3e54f7);};}function removeListener(_0x25a19c,_0x191e4a){return function(){SmsInteractionEvents[_0xaa6a('0x3')](_0x25a19c,_0x191e4a);};}exports['register']=function(_0x58b722){for(var _0x294a9a=0x0,_0x14563c=events[_0xaa6a('0x4')];_0x294a9a<_0x14563c;_0x294a9a++){var _0x1a1111=events[_0x294a9a];var _0x5180f1=createListener(_0xaa6a('0x5')+_0x1a1111,_0x58b722);SmsInteractionEvents['on'](_0x1a1111,_0x5180f1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 22ee56e..5e9b44a 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 _0x7903=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','reject','delete','destroy'];(function(_0x189b21,_0x4c1465){var _0x2add98=function(_0x3bb76e){while(--_0x3bb76e){_0x189b21['push'](_0x189b21['shift']());}};_0x2add98(++_0x4c1465);}(_0x7903,0xe2));var _0x3790=function(_0x488329,_0x4f6288){_0x488329=_0x488329-0x0;var _0x565768=_0x7903[_0x488329];return _0x565768;};'use strict';var multer=require(_0x3790('0x0'));var util=require('util');var path=require(_0x3790('0x1'));var timeout=require(_0x3790('0x2'));var express=require(_0x3790('0x3'));var router=express[_0x3790('0x4')]();var fs_extra=require(_0x3790('0x5'));var auth=require(_0x3790('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3790('0x7')]('/describe',auth[_0x3790('0x8')](),controller['describe']);router[_0x3790('0x7')](_0x3790('0x9'),auth[_0x3790('0x8')](),controller[_0x3790('0xa')]);router[_0x3790('0xb')]('/',auth[_0x3790('0x8')](),interaction[_0x3790('0xc')](_0x3790('0xd'),_0x3790('0xe')),controller[_0x3790('0xf')]);router[_0x3790('0xb')](_0x3790('0x10'),controller[_0x3790('0x11')]);router[_0x3790('0x12')](_0x3790('0x9'),auth[_0x3790('0x8')](),controller[_0x3790('0x13')]);router[_0x3790('0x12')](_0x3790('0x14'),auth[_0x3790('0x8')](),controller['accept']);router[_0x3790('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x3790('0x15')]);router[_0x3790('0x16')](_0x3790('0x9'),auth[_0x3790('0x8')](),controller[_0x3790('0x17')]);module[_0x3790('0x18')]=router; \ No newline at end of file +var _0x53f5=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout'];(function(_0x4d23f3,_0x59b5f7){var _0x261d33=function(_0x29bd94){while(--_0x29bd94){_0x4d23f3['push'](_0x4d23f3['shift']());}};_0x261d33(++_0x59b5f7);}(_0x53f5,0x1c0));var _0x553f=function(_0x1f6d0a,_0x172d42){_0x1f6d0a=_0x1f6d0a-0x0;var _0x28a0f3=_0x53f5[_0x1f6d0a];return _0x28a0f3;};'use strict';var multer=require(_0x553f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x553f('0x1'));var express=require(_0x553f('0x2'));var router=express[_0x553f('0x3')]();var fs_extra=require(_0x553f('0x4'));var auth=require(_0x553f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x553f('0x6'));var controller=require(_0x553f('0x7'));router[_0x553f('0x8')]('/',auth['isAuthenticated'](),controller[_0x553f('0x9')]);router[_0x553f('0x8')](_0x553f('0xa'),auth[_0x553f('0xb')](),controller[_0x553f('0xc')]);router[_0x553f('0x8')](_0x553f('0xd'),auth[_0x553f('0xb')](),controller[_0x553f('0xe')]);router[_0x553f('0xf')]('/',auth['isAuthenticated'](),interaction[_0x553f('0x10')](_0x553f('0x11'),_0x553f('0x12')),controller[_0x553f('0x13')]);router['post'](_0x553f('0x14'),controller[_0x553f('0x15')]);router[_0x553f('0x16')](_0x553f('0xd'),auth['isAuthenticated'](),controller[_0x553f('0x17')]);router['put'](_0x553f('0x18'),auth[_0x553f('0xb')](),controller['accept']);router['put'](_0x553f('0x19'),auth['isAuthenticated'](),controller[_0x553f('0x1a')]);router[_0x553f('0x1b')](_0x553f('0xd'),auth[_0x553f('0xb')](),controller[_0x553f('0x1c')]);module[_0x553f('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3c2fa54..3e80c58 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 _0xbacb=['medium','BOOLEAN','ENUM','out','STRING','TEXT','sequelize','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xbacb,0x1a6));var _0xbbac=function(_0x482837,_0x43fccc){_0x482837=_0x482837-0x0;var _0xce4813=_0xbacb[_0x482837];return _0xce4813;};'use strict';var Sequelize=require(_0xbbac('0x0'));module[_0xbbac('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbbac('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbbac('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbac('0x4')]('in',_0xbbac('0x5')),'defaultValue':_0xbbac('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbbac('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xbbac('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbbac('0x6')]},'providerResponse':{'type':Sequelize[_0xbbac('0x7')]}}; \ No newline at end of file +var _0xf358=['out','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x4e1c8d,_0x2157df){var _0x532bb6=function(_0x4c5f2c){while(--_0x4c5f2c){_0x4e1c8d['push'](_0x4e1c8d['shift']());}};_0x532bb6(++_0x2157df);}(_0xf358,0x13c));var _0x8f35=function(_0x2856cc,_0x3b5364){_0x2856cc=_0x2856cc-0x0;var _0x2c9a53=_0xf358[_0x2856cc];return _0x2c9a53;};'use strict';var Sequelize=require(_0x8f35('0x0'));module[_0x8f35('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8f35('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8f35('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x8f35('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8f35('0x5')](0xbe)},'phone':{'type':Sequelize[_0x8f35('0x5')]},'readAt':{'type':Sequelize[_0x8f35('0x6')]},'secret':{'type':Sequelize[_0x8f35('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x8f35('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 961c7d0..c797dbf 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 _0x8ed7=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','describe','sms-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','SmsInteraction','isNil','read1stAt','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','sms','RejectMessage','rejectMessage','fullname','rejectmessage','debug','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x42fd08,_0x48b478){var _0x2b4ab6=function(_0x44b37c){while(--_0x44b37c){_0x42fd08['push'](_0x42fd08['shift']());}};_0x2b4ab6(++_0x48b478);}(_0x8ed7,0x8b));var _0x78ed=function(_0x5d191f,_0x2f8da3){_0x5d191f=_0x5d191f-0x0;var _0x7985ff=_0x8ed7[_0x5d191f];return _0x7985ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78ed('0x0'));var zipdir=require(_0x78ed('0x1'));var jsonpatch=require(_0x78ed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78ed('0x3'));var Mustache=require(_0x78ed('0x4'));var util=require(_0x78ed('0x5'));var path=require(_0x78ed('0x6'));var sox=require(_0x78ed('0x7'));var csv=require(_0x78ed('0x8'));var ejs=require(_0x78ed('0x9'));var fs=require('fs');var fs_extra=require(_0x78ed('0xa'));var _=require(_0x78ed('0xb'));var squel=require('squel');var crypto=require(_0x78ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x78ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ed('0xf'));var qs=require(_0x78ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ed('0x11'));var logger=require(_0x78ed('0x12'))('api');var utils=require(_0x78ed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78ed('0x14'));var db=require(_0x78ed('0x15'))['db'];config[_0x78ed('0x16')]=_[_0x78ed('0x17')](config[_0x78ed('0x16')],{'host':_0x78ed('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78ed('0x16')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x78ed('0x19')][_0x78ed('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2e9007,_0x195b7e,_0x250d59,_0x454a65){return new BPromise(function(_0x336ae1,_0x29048d){var _0x17d0d6=_0x454a65||client;return _0x17d0d6[_0x78ed('0x1b')](_0x2e9007,_0x250d59)[_0x78ed('0x1c')](function(_0x4b9797){logger[_0x78ed('0x1d')](_0x78ed('0x1e'),_0x195b7e,'request\x20sent');logger['debug'](_0x78ed('0x1f'),_0x195b7e,_0x78ed('0x20'),JSON[_0x78ed('0x21')](_0x4b9797));if(_0x4b9797[_0x78ed('0x22')]){if(_0x4b9797[_0x78ed('0x22')][_0x78ed('0x23')]===0x1f4){logger[_0x78ed('0x22')](_0x78ed('0x1e'),_0x195b7e,_0x4b9797[_0x78ed('0x22')][_0x78ed('0x24')]);return _0x29048d(_0x4b9797[_0x78ed('0x22')]['message']);}logger['error'](_0x78ed('0x1e'),_0x195b7e,_0x4b9797['error'][_0x78ed('0x24')]);return _0x336ae1(_0x4b9797['error'][_0x78ed('0x24')]);}else{logger['info'](_0x78ed('0x1e'),_0x195b7e,_0x78ed('0x20'));_0x336ae1(_0x4b9797[_0x78ed('0x25')]['message']);}})[_0x78ed('0x26')](function(_0x5a8b87){logger[_0x78ed('0x22')](_0x78ed('0x1e'),_0x195b7e,_0x5a8b87);_0x29048d(_0x5a8b87);});});}function respondWithStatusCode(_0x34fb0e,_0x59349a){_0x59349a=_0x59349a||0xcc;return function(_0x5abe1b){if(_0x5abe1b){return _0x34fb0e[_0x78ed('0x27')](_0x59349a);}return _0x34fb0e['status'](_0x59349a)[_0x78ed('0x28')]();};}function respondWithResult(_0x55c5ed,_0x12d5e1){_0x12d5e1=_0x12d5e1||0xc8;return function(_0x1433e1){if(_0x1433e1){return _0x55c5ed[_0x78ed('0x29')](_0x12d5e1)[_0x78ed('0x2a')](_0x1433e1);}};}function respondWithFilteredResult(_0xafc1cf,_0x624bb1){return function(_0x3cd100){if(_0x3cd100){var _0x312801=typeof _0x624bb1[_0x78ed('0x2b')]==='undefined'&&typeof _0x624bb1[_0x78ed('0x2c')]===_0x78ed('0x2d');var _0x2a66ce=_0x3cd100[_0x78ed('0x2e')];var _0x4af685=_0x312801?0x0:_0x624bb1['offset'];var _0x5da4d0=_0x312801?_0x3cd100['count']:_0x624bb1[_0x78ed('0x2b')]+_0x624bb1[_0x78ed('0x2c')];var _0x17883d;if(_0x5da4d0>=_0x2a66ce){_0x5da4d0=_0x2a66ce;_0x17883d=0xc8;}else{_0x17883d=0xce;}_0xafc1cf[_0x78ed('0x29')](_0x17883d);return _0xafc1cf[_0x78ed('0x2f')](_0x78ed('0x30'),_0x4af685+'-'+_0x5da4d0+'/'+_0x2a66ce)[_0x78ed('0x2a')](_0x3cd100);}return null;};}function patchUpdates(_0x550956){return function(_0x24c908){try{jsonpatch['apply'](_0x24c908,_0x550956,!![]);}catch(_0x210e9d){return BPromise[_0x78ed('0x31')](_0x210e9d);}return _0x24c908['save']();};}function saveUpdates(_0x13a9db,_0x179d1d){return function(_0x13c39c){if(_0x13c39c){return _0x13c39c[_0x78ed('0x32')](_0x13a9db)[_0x78ed('0x1c')](function(_0x19bd3b){return _0x19bd3b;});}return null;};}function removeEntity(_0x135a8f,_0x45831d){return function(_0x4da527){if(_0x4da527){return _0x4da527[_0x78ed('0x33')]()['then'](function(){_0x135a8f[_0x78ed('0x29')](0xcc)[_0x78ed('0x28')]();});}};}function handleEntityNotFound(_0x3b8e9c,_0x963ece){return function(_0x437852){if(!_0x437852){_0x3b8e9c[_0x78ed('0x27')](0x194);}return _0x437852;};}function handleError(_0x2031eb,_0x47f969){_0x47f969=_0x47f969||0x1f4;return function(_0x2ac50){logger[_0x78ed('0x22')](_0x2ac50[_0x78ed('0x34')]);if(_0x2ac50[_0x78ed('0x35')]){delete _0x2ac50[_0x78ed('0x35')];}_0x2031eb[_0x78ed('0x29')](_0x47f969)[_0x78ed('0x36')](_0x2ac50);};}exports[_0x78ed('0x37')]=function(_0x3ba9e8,_0x1b30f6){var _0x1e3ead={},_0x59d30a={},_0x4b1bef={'count':0x0,'rows':[]};var _0x23e51b=_['map'](db[_0x78ed('0x38')][_0x78ed('0x39')],function(_0x4edc9c){return{'name':_0x4edc9c[_0x78ed('0x3a')],'type':_0x4edc9c[_0x78ed('0x3b')][_0x78ed('0x3c')]};});_0x59d30a[_0x78ed('0x3d')]=_[_0x78ed('0x3e')](_0x23e51b,_0x78ed('0x35'));_0x59d30a['query']=_[_0x78ed('0x3f')](_0x3ba9e8[_0x78ed('0x40')]);_0x59d30a[_0x78ed('0x41')]=_[_0x78ed('0x42')](_0x59d30a['model'],_0x59d30a['query']);_0x1e3ead[_0x78ed('0x43')]=_[_0x78ed('0x42')](_0x59d30a['model'],qs[_0x78ed('0x44')](_0x3ba9e8[_0x78ed('0x40')]['fields']));_0x1e3ead['attributes']=_0x1e3ead[_0x78ed('0x43')][_0x78ed('0x45')]?_0x1e3ead[_0x78ed('0x43')]:_0x59d30a[_0x78ed('0x3d')];if(!_0x3ba9e8['query']['hasOwnProperty'](_0x78ed('0x46'))){_0x1e3ead[_0x78ed('0x2c')]=qs['limit'](_0x3ba9e8[_0x78ed('0x40')]['limit']);_0x1e3ead[_0x78ed('0x2b')]=qs[_0x78ed('0x2b')](_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x2b')]);}_0x1e3ead[_0x78ed('0x47')]=qs['sort'](_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x48')]);_0x1e3ead[_0x78ed('0x49')]=qs[_0x78ed('0x41')](_[_0x78ed('0x4a')](_0x3ba9e8['query'],_0x59d30a['filters']),_0x23e51b);if(_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x4b')]){_0x1e3ead[_0x78ed('0x49')]=_[_0x78ed('0x4c')](_0x1e3ead['where'],{'$or':_[_0x78ed('0x3e')](_0x23e51b,function(_0x16223d){if(_0x16223d[_0x78ed('0x3b')]!==_0x78ed('0x4d')){var _0x103eb1={};_0x103eb1[_0x16223d[_0x78ed('0x35')]]={'$like':'%'+_0x3ba9e8['query'][_0x78ed('0x4b')]+'%'};return _0x103eb1;}})});}_0x1e3ead=_['merge']({},_0x1e3ead,_0x3ba9e8[_0x78ed('0x4e')]);var _0x59b8f4={'where':_0x1e3ead[_0x78ed('0x49')]};return db[_0x78ed('0x38')][_0x78ed('0x2e')](_0x59b8f4)[_0x78ed('0x1c')](function(_0x329e1d){_0x4b1bef['count']=_0x329e1d;if(_0x3ba9e8['query'][_0x78ed('0x4f')]){_0x1e3ead[_0x78ed('0x50')]=[{'all':!![]}];}return db[_0x78ed('0x38')]['findAll'](_0x1e3ead);})[_0x78ed('0x1c')](function(_0x439883){_0x4b1bef[_0x78ed('0x51')]=_0x439883;return _0x4b1bef;})['then'](respondWithFilteredResult(_0x1b30f6,_0x1e3ead))['catch'](handleError(_0x1b30f6,null));};exports[_0x78ed('0x52')]=function(_0x4ae8f5,_0x1a79df){var _0xc7a4e1={'raw':!![],'where':{'id':_0x4ae8f5['params']['id']}},_0x4b0b36={};_0x4b0b36[_0x78ed('0x3d')]=_[_0x78ed('0x3f')](db[_0x78ed('0x38')][_0x78ed('0x39')]);_0x4b0b36[_0x78ed('0x40')]=_[_0x78ed('0x3f')](_0x4ae8f5[_0x78ed('0x40')]);_0x4b0b36[_0x78ed('0x41')]=_[_0x78ed('0x42')](_0x4b0b36[_0x78ed('0x3d')],_0x4b0b36[_0x78ed('0x40')]);_0xc7a4e1[_0x78ed('0x43')]=_[_0x78ed('0x42')](_0x4b0b36[_0x78ed('0x3d')],qs['fields'](_0x4ae8f5[_0x78ed('0x40')][_0x78ed('0x44')]));_0xc7a4e1['attributes']=_0xc7a4e1[_0x78ed('0x43')][_0x78ed('0x45')]?_0xc7a4e1[_0x78ed('0x43')]:_0x4b0b36[_0x78ed('0x3d')];if(_0x4ae8f5[_0x78ed('0x40')]['includeAll']){_0xc7a4e1[_0x78ed('0x50')]=[{'all':!![]}];}_0xc7a4e1=_['merge']({},_0xc7a4e1,_0x4ae8f5[_0x78ed('0x4e')]);return db[_0x78ed('0x38')][_0x78ed('0x53')](_0xc7a4e1)[_0x78ed('0x1c')](handleEntityNotFound(_0x1a79df,null))[_0x78ed('0x1c')](respondWithResult(_0x1a79df,null))[_0x78ed('0x26')](handleError(_0x1a79df,null));};exports['create']=function(_0x537938,_0x226598){return db['SmsMessage'][_0x78ed('0x54')](_0x537938[_0x78ed('0x55')],{})[_0x78ed('0x1c')](respondWithResult(_0x226598,0xc9))[_0x78ed('0x26')](handleError(_0x226598,null));};exports['update']=function(_0x2d8326,_0x8ce62a){if(_0x2d8326[_0x78ed('0x55')]['id']){delete _0x2d8326[_0x78ed('0x55')]['id'];}return db[_0x78ed('0x38')][_0x78ed('0x53')]({'where':{'id':_0x2d8326['params']['id']}})[_0x78ed('0x1c')](handleEntityNotFound(_0x8ce62a,null))[_0x78ed('0x1c')](saveUpdates(_0x2d8326['body'],null))[_0x78ed('0x1c')](respondWithResult(_0x8ce62a,null))[_0x78ed('0x26')](handleError(_0x8ce62a,null));};exports[_0x78ed('0x33')]=function(_0x567523,_0x10a410){return db['SmsMessage'][_0x78ed('0x53')]({'where':{'id':_0x567523['params']['id']}})['then'](handleEntityNotFound(_0x10a410,null))[_0x78ed('0x1c')](removeEntity(_0x10a410,null))[_0x78ed('0x26')](handleError(_0x10a410,null));};exports[_0x78ed('0x56')]=function(_0x32ec7b,_0x3e36d5){return db[_0x78ed('0x38')][_0x78ed('0x56')]()[_0x78ed('0x1c')](respondWithResult(_0x3e36d5,null))[_0x78ed('0x26')](handleError(_0x3e36d5,null));};var interaction_log=require(_0x78ed('0x12'))(_0x78ed('0x57'));exports[_0x78ed('0x58')]=function(_0x4ab8eb,_0x3f62b0,_0x2b44de){var _0x1095c7={'agent':{},'channel':'sms'};if(_0x4ab8eb['body']['id']){delete _0x4ab8eb[_0x78ed('0x55')]['id'];}_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x59')]=!![];_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5a')]=moment()['format'](_0x78ed('0x5b'));_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')]=_0x4ab8eb['body'][_0x78ed('0x5c')]||_0x4ab8eb[_0x78ed('0x5d')]['id'];_0x1095c7[_0x78ed('0x5e')]['id']=_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')];return db[_0x78ed('0x38')][_0x78ed('0x53')]({'where':{'id':_0x4ab8eb[_0x78ed('0x5f')]['id'],'UserId':null}})[_0x78ed('0x1c')](handleEntityNotFound(_0x3f62b0,null))['then'](saveUpdates(_0x4ab8eb[_0x78ed('0x55')],null))[_0x78ed('0x1c')](function(_0x3fa09e){if(_0x3fa09e){_0x1095c7[_0x78ed('0x24')]=_0x3fa09e[_0x78ed('0x60')]({'plain':!![]});return db[_0x78ed('0x61')][_0x78ed('0x53')]({'where':{'id':_0x3fa09e['SmsInteractionId']}});}return null;})[_0x78ed('0x1c')](handleEntityNotFound(_0x3f62b0,null))[_0x78ed('0x1c')](function(_0x125ecd){if(_0x125ecd){return _0x125ecd['update']({'UserId':_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')],'read1stAt':_[_0x78ed('0x62')](_0x125ecd[_0x78ed('0x63')])?moment()[_0x78ed('0x64')](_0x78ed('0x5b')):undefined});}return null;})[_0x78ed('0x1c')](function(_0x47d00c){if(_0x47d00c){_0x1095c7['interaction']=_0x47d00c[_0x78ed('0x60')]({'plain':!![]});interaction_log[_0x78ed('0x1d')](_0x78ed('0x65'),_0x4ab8eb['user']['id'],_0x4ab8eb[_0x78ed('0x5d')]['name'],_0x4ab8eb['user'][_0x78ed('0x66')],_0x1095c7[_0x78ed('0x67')]['id'],_0x4ab8eb['body']?JSON[_0x78ed('0x21')](_0x4ab8eb['body']):_0x78ed('0x68'));return respondWithRpcPromise('AcceptMessage',_0x78ed('0x69'),_0x1095c7);}return null;})[_0x78ed('0x1c')](function(_0x26729f){var _0x5bd44a=_0x78ed('0x6a')+_0x26729f[_0x78ed('0x24')]['ContactId'];return db[_0x78ed('0x6b')][_0x78ed('0x40')](_0x5bd44a,{'type':db[_0x78ed('0x6c')][_0x78ed('0x6d')][_0x78ed('0x6e')],'raw':!![]})[_0x78ed('0x1c')](function(_0x46e8cb){return _0x46e8cb;});})['then'](function(_0x238cd2){if(_0x238cd2){_0x1095c7[_0x78ed('0x24')][_0x78ed('0x6f')]=_0x238cd2[0x0];if(!_0x4ab8eb['body'][_0x78ed('0x5c')])return;return db[_0x78ed('0x70')][_0x78ed('0x53')]({'where':{'id':_0x4ab8eb['body'][_0x78ed('0x5c')],'role':_0x78ed('0x5e')},'attributes':['id',_0x78ed('0x35'),'fullname',_0x78ed('0x71'),_0x78ed('0x72')],'raw':!![]});}return null;})['then'](function(_0x307d2c){if(!_0x307d2c)return null;_0x1095c7[_0x78ed('0x24')][_0x78ed('0x5e')]=_0x307d2c;return _0x1095c7;})[_0x78ed('0x1c')](function(_0x5d1794){if(_0x5d1794){if(_0x4ab8eb['body'][_0x78ed('0x73')]){_0x1095c7[_0x78ed('0x24')][_0x78ed('0x74')]=util[_0x78ed('0x64')](_0x78ed('0x75'),_0x4ab8eb[_0x78ed('0x5d')][_0x78ed('0x35')]);_0x1095c7[_0x78ed('0x24')][_0x78ed('0x76')]=_0x1095c7['channel'];_0x1095c7['message'][_0x78ed('0x77')]=_0x1095c7[_0x78ed('0x76')];_0x1095c7[_0x78ed('0x24')][_0x78ed('0x78')]=_0x78ed('0x58');return respondWithRpcPromise(_0x78ed('0x79'),_0x78ed('0x79'),{'event':'acceptmessage','message':_0x1095c7[_0x78ed('0x24')]},client9002)[_0x78ed('0x1c')](function(){return _0x1095c7;});}return _0x1095c7;}return null;})[_0x78ed('0x1c')](respondWithResult(_0x3f62b0,null))[_0x78ed('0x26')](handleError(_0x3f62b0,null));};var interaction_log=require(_0x78ed('0x12'))('sms-interactions');exports['reject']=function(_0x19ee8d,_0x118d2b,_0x413d2c){var _0x4b8f41={'agent':{},'channel':_0x78ed('0x7a')};if(_0x19ee8d[_0x78ed('0x55')]['id']){delete _0x19ee8d[_0x78ed('0x55')]['id'];}_0x19ee8d[_0x78ed('0x55')][_0x78ed('0x5c')]=_0x19ee8d[_0x78ed('0x55')]['UserId']||_0x19ee8d[_0x78ed('0x5d')]['id'];_0x4b8f41[_0x78ed('0x5e')]['id']=_0x19ee8d[_0x78ed('0x55')]['UserId'];return db[_0x78ed('0x38')]['find']({'where':{'id':_0x19ee8d[_0x78ed('0x5f')]['id'],'UserId':null}})[_0x78ed('0x1c')](handleEntityNotFound(_0x118d2b,null))[_0x78ed('0x1c')](function(_0x28a197){if(_0x28a197){_0x4b8f41['message']=_0x28a197[_0x78ed('0x60')]({'plain':!![]});return db[_0x78ed('0x61')][_0x78ed('0x53')]({'where':{'id':_0x28a197['SmsInteractionId']}});}return null;})[_0x78ed('0x1c')](handleEntityNotFound(_0x118d2b,null))[_0x78ed('0x1c')](function(_0x398b51){if(_0x398b51){_0x4b8f41[_0x78ed('0x67')]=_0x398b51[_0x78ed('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19ee8d[_0x78ed('0x5d')]['id'],_0x19ee8d[_0x78ed('0x5d')][_0x78ed('0x35')],_0x19ee8d[_0x78ed('0x5d')][_0x78ed('0x66')],_0x4b8f41[_0x78ed('0x67')]['id'],_0x19ee8d[_0x78ed('0x55')]?JSON[_0x78ed('0x21')](_0x19ee8d[_0x78ed('0x55')]):_0x78ed('0x68'));return respondWithRpcPromise(_0x78ed('0x7b'),_0x78ed('0x7c'),_0x4b8f41);}return null;})[_0x78ed('0x1c')](function(_0x520663){var _0x4819f3=_0x78ed('0x6a')+_0x520663[_0x78ed('0x24')]['ContactId'];return db[_0x78ed('0x6b')][_0x78ed('0x40')](_0x4819f3,{'type':db[_0x78ed('0x6c')][_0x78ed('0x6d')]['SELECT'],'raw':!![]})[_0x78ed('0x1c')](function(_0x294974){return _0x294974;});})[_0x78ed('0x1c')](function(_0x5a096f){if(_0x5a096f){_0x4b8f41['message'][_0x78ed('0x6f')]=_0x5a096f[0x0];if(!_0x19ee8d[_0x78ed('0x55')][_0x78ed('0x5c')])return;return db['User'][_0x78ed('0x53')]({'where':{'id':_0x19ee8d[_0x78ed('0x55')]['UserId'],'role':_0x78ed('0x5e')},'attributes':['id',_0x78ed('0x35'),_0x78ed('0x7d'),_0x78ed('0x71'),_0x78ed('0x72')],'raw':!![]});}return null;})[_0x78ed('0x1c')](function(_0x4e7c85){if(!_0x4e7c85)return null;_0x4b8f41[_0x78ed('0x24')][_0x78ed('0x5e')]=_0x4e7c85;return _0x4b8f41;})[_0x78ed('0x1c')](function(_0x2e9c9a){if(_0x2e9c9a){_0x2e9c9a['message']['interface']=util['format'](_0x78ed('0x75'),_0x19ee8d['user'][_0x78ed('0x35')]);_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x76')]=_0x4b8f41['channel'];_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x77')]=_0x4b8f41['channel'];_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x78')]=_0x78ed('0x31');respondWithRpcPromise('EventManager','EventManager',{'event':_0x78ed('0x7e'),'message':_0x2e9c9a[_0x78ed('0x24')]},client9002);return _0x4b8f41;}return null;})[_0x78ed('0x1c')](respondWithResult(_0x118d2b,null))[_0x78ed('0x26')](handleError(_0x118d2b,null));};exports['status']=function(_0xd32472,_0x4859a1,_0x5da3e1){if(_0xd32472[_0x78ed('0x55')]['id']){delete _0xd32472[_0x78ed('0x55')]['id'];}var _0x305e8b;return db[_0x78ed('0x38')]['find']({'where':{'id':_0xd32472[_0x78ed('0x5f')]['id']}})[_0x78ed('0x1c')](handleEntityNotFound(_0x4859a1,null))['then'](function(_0x4fba55){if(_0x4fba55){_0x305e8b=_0x4fba55;return db['SmsAccount'][_0x78ed('0x53')]({'where':{'id':_0x4fba55['SmsAccountId']}});}})[_0x78ed('0x1c')](handleEntityNotFound(_0x4859a1,null))[_0x78ed('0x1c')](function(_0x199174){if(_0x199174){logger[_0x78ed('0x7f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x78ed('0x29'),'received\x20delivery\x20report\x20from',_0x199174[_0x78ed('0x3b')],util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));switch(_0x199174[_0x78ed('0x3b')]){case _0x78ed('0x81'):if(_0xd32472['body'][_0x78ed('0x82')]&&_0xd32472[_0x78ed('0x55')][_0x78ed('0x82')]===_0x305e8b['messageId']){return _0x305e8b['update']({'read':!![]});}else{logger['error'](_0x78ed('0x83'),_0x78ed('0x29'),_0x78ed('0x81'),util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;case _0x78ed('0x84'):if(_0xd32472['body'][_0x78ed('0x85')]&&_0xd32472['body'][_0x78ed('0x85')]===_0x305e8b[_0x78ed('0x86')]&&_[_0x78ed('0x87')]([_0x78ed('0x88'),_0x78ed('0x89')],_0xd32472[_0x78ed('0x55')][_0x78ed('0x8a')])>=0x0){return _0x305e8b[_0x78ed('0x32')]({'read':!![]});}else{logger[_0x78ed('0x22')](_0x78ed('0x83'),_0x78ed('0x29'),_0x78ed('0x8b'),util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;case _0x78ed('0x8c'):var _0x5c1b67=_0xd32472['body'][_0x78ed('0x8d')][0x0];if(_0x5c1b67[_0x78ed('0x29')]['groupName']===_0x78ed('0x8e')){return _0x305e8b[_0x78ed('0x32')]({'read':!![]});}else{logger[_0x78ed('0x22')](_0x78ed('0x83'),'status',_0x78ed('0x8c'),util['inspect'](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x305e8b;}})[_0x78ed('0x1c')](respondWithResult(_0x4859a1,null))[_0x78ed('0x26')](handleError(_0x4859a1,null));}; \ No newline at end of file +var _0x0b36=['socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','stack','name','index','SmsMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','create','body','find','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','SmsInteraction','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','SELECT','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','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','../../mysqldb','redis','defaults'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x0b36,0x10c));var _0x60b3=function(_0x73e4cf,_0x2a8375){_0x73e4cf=_0x73e4cf-0x0;var _0x1e1bf8=_0x0b36[_0x73e4cf];return _0x1e1bf8;};'use strict';var emlformat=require(_0x60b3('0x0'));var rimraf=require(_0x60b3('0x1'));var zipdir=require(_0x60b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x60b3('0x3'));var Mustache=require('mustache');var util=require(_0x60b3('0x4'));var path=require(_0x60b3('0x5'));var sox=require(_0x60b3('0x6'));var csv=require(_0x60b3('0x7'));var ejs=require(_0x60b3('0x8'));var fs=require('fs');var fs_extra=require(_0x60b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x60b3('0xa'));var jsforce=require(_0x60b3('0xb'));var deskjs=require(_0x60b3('0xc'));var toCsv=require(_0x60b3('0x7'));var querystring=require(_0x60b3('0xd'));var Papa=require(_0x60b3('0xe'));var Redis=require(_0x60b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x60b3('0x10'));var as=require(_0x60b3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60b3('0x12'))(_0x60b3('0x13'));var utils=require(_0x60b3('0x14'));var config=require(_0x60b3('0x15'));var licenseUtil=require(_0x60b3('0x16'));var db=require(_0x60b3('0x17'))['db'];config[_0x60b3('0x18')]=_[_0x60b3('0x19')](config[_0x60b3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x60b3('0x1a'))(new Redis(config[_0x60b3('0x18')]));require(_0x60b3('0x1b'))[_0x60b3('0x1c')](socket);var jayson=require(_0x60b3('0x1d'));var client=jayson[_0x60b3('0x1e')][_0x60b3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x60b3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1c3afe,_0x55793c,_0x20dc0d,_0xda085){return new BPromise(function(_0x2c40d9,_0x293573){var _0x21ae50=_0xda085||client;return _0x21ae50['request'](_0x1c3afe,_0x20dc0d)['then'](function(_0x9df0ff){logger[_0x60b3('0x20')]('SmsMessage,\x20%s,\x20%s',_0x55793c,_0x60b3('0x21'));logger[_0x60b3('0x22')](_0x60b3('0x23'),_0x55793c,'request\x20sent',JSON[_0x60b3('0x24')](_0x9df0ff));if(_0x9df0ff[_0x60b3('0x25')]){if(_0x9df0ff['error'][_0x60b3('0x26')]===0x1f4){logger[_0x60b3('0x25')](_0x60b3('0x27'),_0x55793c,_0x9df0ff[_0x60b3('0x25')][_0x60b3('0x28')]);return _0x293573(_0x9df0ff[_0x60b3('0x25')][_0x60b3('0x28')]);}logger['error'](_0x60b3('0x27'),_0x55793c,_0x9df0ff[_0x60b3('0x25')][_0x60b3('0x28')]);return _0x2c40d9(_0x9df0ff['error'][_0x60b3('0x28')]);}else{logger[_0x60b3('0x20')](_0x60b3('0x27'),_0x55793c,'request\x20sent');_0x2c40d9(_0x9df0ff['result']['message']);}})[_0x60b3('0x29')](function(_0x1b9d11){logger['error'](_0x60b3('0x27'),_0x55793c,_0x1b9d11);_0x293573(_0x1b9d11);});});}function respondWithStatusCode(_0x22289e,_0x96244){_0x96244=_0x96244||0xcc;return function(_0x1524db){if(_0x1524db){return _0x22289e[_0x60b3('0x2a')](_0x96244);}return _0x22289e['status'](_0x96244)[_0x60b3('0x2b')]();};}function respondWithResult(_0x3441f7,_0x2ae666){_0x2ae666=_0x2ae666||0xc8;return function(_0x285eb9){if(_0x285eb9){return _0x3441f7[_0x60b3('0x2c')](_0x2ae666)[_0x60b3('0x2d')](_0x285eb9);}};}function respondWithFilteredResult(_0x4fafd3,_0x1a37f0){return function(_0x2e431d){if(_0x2e431d){var _0x204af=typeof _0x1a37f0[_0x60b3('0x2e')]===_0x60b3('0x2f')&&typeof _0x1a37f0['limit']===_0x60b3('0x2f');var _0x3b88e7=_0x2e431d[_0x60b3('0x30')];var _0x328a3c=_0x204af?0x0:_0x1a37f0[_0x60b3('0x2e')];var _0x563a1a=_0x204af?_0x2e431d[_0x60b3('0x30')]:_0x1a37f0[_0x60b3('0x2e')]+_0x1a37f0[_0x60b3('0x31')];var _0x5d1113;if(_0x563a1a>=_0x3b88e7){_0x563a1a=_0x3b88e7;_0x5d1113=0xc8;}else{_0x5d1113=0xce;}_0x4fafd3[_0x60b3('0x2c')](_0x5d1113);return _0x4fafd3[_0x60b3('0x32')]('Content-Range',_0x328a3c+'-'+_0x563a1a+'/'+_0x3b88e7)[_0x60b3('0x2d')](_0x2e431d);}return null;};}function patchUpdates(_0x7b75f5){return function(_0x1e332a){try{jsonpatch['apply'](_0x1e332a,_0x7b75f5,!![]);}catch(_0x2706be){return BPromise[_0x60b3('0x33')](_0x2706be);}return _0x1e332a[_0x60b3('0x34')]();};}function saveUpdates(_0xb69fb0,_0x5ddc76){return function(_0x29077c){if(_0x29077c){return _0x29077c[_0x60b3('0x35')](_0xb69fb0)[_0x60b3('0x36')](function(_0x563fb2){return _0x563fb2;});}return null;};}function removeEntity(_0x551dd1,_0x1b3ad3){return function(_0x26669b){if(_0x26669b){return _0x26669b[_0x60b3('0x37')]()[_0x60b3('0x36')](function(){_0x551dd1[_0x60b3('0x2c')](0xcc)[_0x60b3('0x2b')]();});}};}function handleEntityNotFound(_0x436544,_0x1a641a){return function(_0x45ee44){if(!_0x45ee44){_0x436544[_0x60b3('0x2a')](0x194);}return _0x45ee44;};}function handleError(_0x41619f,_0x34fca3){_0x34fca3=_0x34fca3||0x1f4;return function(_0x376ea8){logger[_0x60b3('0x25')](_0x376ea8[_0x60b3('0x38')]);if(_0x376ea8['name']){delete _0x376ea8[_0x60b3('0x39')];}_0x41619f[_0x60b3('0x2c')](_0x34fca3)['send'](_0x376ea8);};}exports[_0x60b3('0x3a')]=function(_0x4cb76c,_0x2e0669){var _0x31ba2e={},_0x3e8388={},_0x7ddaf9={'count':0x0,'rows':[]};var _0x49b90c=_['map'](db[_0x60b3('0x3b')][_0x60b3('0x3c')],function(_0x48974e){return{'name':_0x48974e[_0x60b3('0x3d')],'type':_0x48974e[_0x60b3('0x3e')][_0x60b3('0x3f')]};});_0x3e8388[_0x60b3('0x40')]=_['map'](_0x49b90c,_0x60b3('0x39'));_0x3e8388['query']=_['keys'](_0x4cb76c['query']);_0x3e8388[_0x60b3('0x41')]=_[_0x60b3('0x42')](_0x3e8388[_0x60b3('0x40')],_0x3e8388[_0x60b3('0x43')]);_0x31ba2e['attributes']=_['intersection'](_0x3e8388[_0x60b3('0x40')],qs[_0x60b3('0x44')](_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x44')]));_0x31ba2e[_0x60b3('0x45')]=_0x31ba2e[_0x60b3('0x45')][_0x60b3('0x46')]?_0x31ba2e[_0x60b3('0x45')]:_0x3e8388[_0x60b3('0x40')];if(!_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x47')](_0x60b3('0x48'))){_0x31ba2e[_0x60b3('0x31')]=qs[_0x60b3('0x31')](_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x31')]);_0x31ba2e[_0x60b3('0x2e')]=qs[_0x60b3('0x2e')](_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x2e')]);}_0x31ba2e[_0x60b3('0x49')]=qs[_0x60b3('0x4a')](_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x4a')]);_0x31ba2e[_0x60b3('0x4b')]=qs[_0x60b3('0x41')](_[_0x60b3('0x4c')](_0x4cb76c[_0x60b3('0x43')],_0x3e8388[_0x60b3('0x41')]),_0x49b90c);if(_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x4d')]){_0x31ba2e[_0x60b3('0x4b')]=_[_0x60b3('0x4e')](_0x31ba2e[_0x60b3('0x4b')],{'$or':_['map'](_0x49b90c,function(_0x406e35){if(_0x406e35['type']!==_0x60b3('0x4f')){var _0x42be4e={};_0x42be4e[_0x406e35['name']]={'$like':'%'+_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x4d')]+'%'};return _0x42be4e;}})});}_0x31ba2e=_[_0x60b3('0x4e')]({},_0x31ba2e,_0x4cb76c[_0x60b3('0x50')]);var _0x4d6bd9={'where':_0x31ba2e[_0x60b3('0x4b')]};return db[_0x60b3('0x3b')]['count'](_0x4d6bd9)['then'](function(_0x576399){_0x7ddaf9[_0x60b3('0x30')]=_0x576399;if(_0x4cb76c[_0x60b3('0x43')][_0x60b3('0x51')]){_0x31ba2e['include']=[{'all':!![]}];}return db[_0x60b3('0x3b')][_0x60b3('0x52')](_0x31ba2e);})[_0x60b3('0x36')](function(_0x91de6b){_0x7ddaf9[_0x60b3('0x53')]=_0x91de6b;return _0x7ddaf9;})[_0x60b3('0x36')](respondWithFilteredResult(_0x2e0669,_0x31ba2e))[_0x60b3('0x29')](handleError(_0x2e0669,null));};exports['show']=function(_0x49bb29,_0x1fb8ea){var _0x35f183={'raw':!![],'where':{'id':_0x49bb29[_0x60b3('0x54')]['id']}},_0x58219a={};_0x58219a[_0x60b3('0x40')]=_['keys'](db[_0x60b3('0x3b')][_0x60b3('0x3c')]);_0x58219a[_0x60b3('0x43')]=_[_0x60b3('0x55')](_0x49bb29[_0x60b3('0x43')]);_0x58219a[_0x60b3('0x41')]=_[_0x60b3('0x42')](_0x58219a[_0x60b3('0x40')],_0x58219a['query']);_0x35f183[_0x60b3('0x45')]=_[_0x60b3('0x42')](_0x58219a[_0x60b3('0x40')],qs[_0x60b3('0x44')](_0x49bb29['query'][_0x60b3('0x44')]));_0x35f183[_0x60b3('0x45')]=_0x35f183[_0x60b3('0x45')][_0x60b3('0x46')]?_0x35f183[_0x60b3('0x45')]:_0x58219a[_0x60b3('0x40')];if(_0x49bb29[_0x60b3('0x43')]['includeAll']){_0x35f183[_0x60b3('0x56')]=[{'all':!![]}];}_0x35f183=_['merge']({},_0x35f183,_0x49bb29['options']);return db[_0x60b3('0x3b')]['find'](_0x35f183)[_0x60b3('0x36')](handleEntityNotFound(_0x1fb8ea,null))[_0x60b3('0x36')](respondWithResult(_0x1fb8ea,null))['catch'](handleError(_0x1fb8ea,null));};exports[_0x60b3('0x57')]=function(_0xb09bf1,_0x1b31db){return db[_0x60b3('0x3b')][_0x60b3('0x57')](_0xb09bf1[_0x60b3('0x58')],{})[_0x60b3('0x36')](respondWithResult(_0x1b31db,0xc9))[_0x60b3('0x29')](handleError(_0x1b31db,null));};exports['update']=function(_0x3e52db,_0x23e54d){if(_0x3e52db[_0x60b3('0x58')]['id']){delete _0x3e52db[_0x60b3('0x58')]['id'];}return db[_0x60b3('0x3b')][_0x60b3('0x59')]({'where':{'id':_0x3e52db['params']['id']}})[_0x60b3('0x36')](handleEntityNotFound(_0x23e54d,null))[_0x60b3('0x36')](saveUpdates(_0x3e52db[_0x60b3('0x58')],null))[_0x60b3('0x36')](respondWithResult(_0x23e54d,null))['catch'](handleError(_0x23e54d,null));};exports[_0x60b3('0x37')]=function(_0x5342bd,_0x2b7143){return db[_0x60b3('0x3b')][_0x60b3('0x59')]({'where':{'id':_0x5342bd['params']['id']}})[_0x60b3('0x36')](handleEntityNotFound(_0x2b7143,null))[_0x60b3('0x36')](removeEntity(_0x2b7143,null))[_0x60b3('0x29')](handleError(_0x2b7143,null));};exports[_0x60b3('0x5a')]=function(_0x28df3b,_0x676ef7){return db[_0x60b3('0x3b')][_0x60b3('0x5a')]()['then'](respondWithResult(_0x676ef7,null))[_0x60b3('0x29')](handleError(_0x676ef7,null));};var interaction_log=require(_0x60b3('0x12'))(_0x60b3('0x5b'));exports['accept']=function(_0x3d6705,_0x277860,_0x590e56){var _0x963bfc={'agent':{},'channel':_0x60b3('0x5c')};if(_0x3d6705[_0x60b3('0x58')]['id']){delete _0x3d6705[_0x60b3('0x58')]['id'];}_0x3d6705[_0x60b3('0x58')][_0x60b3('0x5d')]=!![];_0x3d6705[_0x60b3('0x58')][_0x60b3('0x5e')]=moment()[_0x60b3('0x5f')](_0x60b3('0x60'));_0x3d6705[_0x60b3('0x58')][_0x60b3('0x61')]=_0x3d6705[_0x60b3('0x58')][_0x60b3('0x61')]||_0x3d6705[_0x60b3('0x62')]['id'];_0x963bfc[_0x60b3('0x63')]['id']=_0x3d6705[_0x60b3('0x58')][_0x60b3('0x61')];return db[_0x60b3('0x3b')][_0x60b3('0x59')]({'where':{'id':_0x3d6705[_0x60b3('0x54')]['id'],'UserId':null}})[_0x60b3('0x36')](handleEntityNotFound(_0x277860,null))[_0x60b3('0x36')](saveUpdates(_0x3d6705[_0x60b3('0x58')],null))['then'](function(_0x24a3dd){if(_0x24a3dd){_0x963bfc[_0x60b3('0x28')]=_0x24a3dd[_0x60b3('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x60b3('0x59')]({'where':{'id':_0x24a3dd[_0x60b3('0x65')]}});}return null;})[_0x60b3('0x36')](handleEntityNotFound(_0x277860,null))['then'](function(_0x1db26f){if(_0x1db26f){return _0x1db26f[_0x60b3('0x35')]({'UserId':_0x3d6705[_0x60b3('0x58')][_0x60b3('0x61')],'read1stAt':_['isNil'](_0x1db26f[_0x60b3('0x66')])?moment()[_0x60b3('0x5f')](_0x60b3('0x60')):undefined});}return null;})[_0x60b3('0x36')](function(_0x415050){if(_0x415050){_0x963bfc[_0x60b3('0x67')]=_0x415050[_0x60b3('0x64')]({'plain':!![]});interaction_log[_0x60b3('0x20')](_0x60b3('0x68'),_0x3d6705[_0x60b3('0x62')]['id'],_0x3d6705['user'][_0x60b3('0x39')],_0x3d6705[_0x60b3('0x62')][_0x60b3('0x69')],_0x963bfc['interaction']['id'],_0x3d6705[_0x60b3('0x58')]?JSON[_0x60b3('0x24')](_0x3d6705[_0x60b3('0x58')]):_0x60b3('0x6a'));return respondWithRpcPromise(_0x60b3('0x6b'),'acceptMessage',_0x963bfc);}return null;})[_0x60b3('0x36')](function(_0xbf68a2){var _0x4e1c6f=_0x60b3('0x6c')+_0xbf68a2['message']['ContactId'];return db[_0x60b3('0x6d')][_0x60b3('0x43')](_0x4e1c6f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x60b3('0x36')](function(_0x1964e4){return _0x1964e4;});})[_0x60b3('0x36')](function(_0x18c6ba){if(_0x18c6ba){_0x963bfc['message'][_0x60b3('0x6e')]=_0x18c6ba[0x0];if(!_0x3d6705['body'][_0x60b3('0x61')])return;return db[_0x60b3('0x6f')][_0x60b3('0x59')]({'where':{'id':_0x3d6705[_0x60b3('0x58')][_0x60b3('0x61')],'role':_0x60b3('0x63')},'attributes':['id','name',_0x60b3('0x70'),_0x60b3('0x71'),'internal'],'raw':!![]});}return null;})[_0x60b3('0x36')](function(_0x5aaf31){if(!_0x5aaf31)return null;_0x963bfc[_0x60b3('0x28')]['agent']=_0x5aaf31;return _0x963bfc;})[_0x60b3('0x36')](function(_0x77be0f){if(_0x77be0f){if(_0x3d6705[_0x60b3('0x58')]['manual']){_0x963bfc[_0x60b3('0x28')][_0x60b3('0x72')]=util[_0x60b3('0x5f')](_0x60b3('0x73'),_0x3d6705['user'][_0x60b3('0x39')]);_0x963bfc['message'][_0x60b3('0x74')]=_0x963bfc[_0x60b3('0x74')];_0x963bfc[_0x60b3('0x28')][_0x60b3('0x75')]=_0x963bfc['channel'];_0x963bfc[_0x60b3('0x28')][_0x60b3('0x76')]=_0x60b3('0x77');return respondWithRpcPromise(_0x60b3('0x78'),_0x60b3('0x78'),{'event':'acceptmessage','message':_0x963bfc[_0x60b3('0x28')]},client9002)[_0x60b3('0x36')](function(){return _0x963bfc;});}return _0x963bfc;}return null;})[_0x60b3('0x36')](respondWithResult(_0x277860,null))[_0x60b3('0x29')](handleError(_0x277860,null));};var interaction_log=require(_0x60b3('0x12'))('sms-interactions');exports['reject']=function(_0x407ea8,_0x390252,_0x3866e0){var _0xe6f377={'agent':{},'channel':_0x60b3('0x5c')};if(_0x407ea8[_0x60b3('0x58')]['id']){delete _0x407ea8[_0x60b3('0x58')]['id'];}_0x407ea8[_0x60b3('0x58')][_0x60b3('0x61')]=_0x407ea8[_0x60b3('0x58')][_0x60b3('0x61')]||_0x407ea8[_0x60b3('0x62')]['id'];_0xe6f377[_0x60b3('0x63')]['id']=_0x407ea8[_0x60b3('0x58')][_0x60b3('0x61')];return db['SmsMessage'][_0x60b3('0x59')]({'where':{'id':_0x407ea8['params']['id'],'UserId':null}})[_0x60b3('0x36')](handleEntityNotFound(_0x390252,null))[_0x60b3('0x36')](function(_0xe340b7){if(_0xe340b7){_0xe6f377[_0x60b3('0x28')]=_0xe340b7['get']({'plain':!![]});return db[_0x60b3('0x79')][_0x60b3('0x59')]({'where':{'id':_0xe340b7[_0x60b3('0x65')]}});}return null;})[_0x60b3('0x36')](handleEntityNotFound(_0x390252,null))[_0x60b3('0x36')](function(_0x3e70a5){if(_0x3e70a5){_0xe6f377[_0x60b3('0x67')]=_0x3e70a5[_0x60b3('0x64')]({'plain':!![]});interaction_log[_0x60b3('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x407ea8[_0x60b3('0x62')]['id'],_0x407ea8['user'][_0x60b3('0x39')],_0x407ea8[_0x60b3('0x62')][_0x60b3('0x69')],_0xe6f377['interaction']['id'],_0x407ea8['body']?JSON[_0x60b3('0x24')](_0x407ea8[_0x60b3('0x58')]):_0x60b3('0x6a'));return respondWithRpcPromise(_0x60b3('0x7a'),_0x60b3('0x7b'),_0xe6f377);}return null;})[_0x60b3('0x36')](function(_0x4630b5){var _0x5f0c28=_0x60b3('0x6c')+_0x4630b5[_0x60b3('0x28')][_0x60b3('0x7c')];return db['sequelize'][_0x60b3('0x43')](_0x5f0c28,{'type':db[_0x60b3('0x7d')][_0x60b3('0x7e')][_0x60b3('0x7f')],'raw':!![]})[_0x60b3('0x36')](function(_0xe05e50){return _0xe05e50;});})[_0x60b3('0x36')](function(_0x4b86df){if(_0x4b86df){_0xe6f377[_0x60b3('0x28')][_0x60b3('0x6e')]=_0x4b86df[0x0];if(!_0x407ea8[_0x60b3('0x58')][_0x60b3('0x61')])return;return db[_0x60b3('0x6f')][_0x60b3('0x59')]({'where':{'id':_0x407ea8['body'][_0x60b3('0x61')],'role':_0x60b3('0x63')},'attributes':['id','name',_0x60b3('0x70'),_0x60b3('0x71'),_0x60b3('0x80')],'raw':!![]});}return null;})[_0x60b3('0x36')](function(_0x4c339){if(!_0x4c339)return null;_0xe6f377[_0x60b3('0x28')][_0x60b3('0x63')]=_0x4c339;return _0xe6f377;})[_0x60b3('0x36')](function(_0x29b93b){if(_0x29b93b){_0x29b93b[_0x60b3('0x28')][_0x60b3('0x72')]=util[_0x60b3('0x5f')](_0x60b3('0x73'),_0x407ea8[_0x60b3('0x62')][_0x60b3('0x39')]);_0x29b93b[_0x60b3('0x28')][_0x60b3('0x74')]=_0xe6f377['channel'];_0x29b93b[_0x60b3('0x28')][_0x60b3('0x75')]=_0xe6f377['channel'];_0x29b93b[_0x60b3('0x28')][_0x60b3('0x76')]=_0x60b3('0x33');respondWithRpcPromise('EventManager',_0x60b3('0x78'),{'event':_0x60b3('0x81'),'message':_0x29b93b[_0x60b3('0x28')]},client9002);return _0xe6f377;}return null;})[_0x60b3('0x36')](respondWithResult(_0x390252,null))[_0x60b3('0x29')](handleError(_0x390252,null));};exports[_0x60b3('0x2c')]=function(_0x390c39,_0x79c6ac,_0x4351d7){if(_0x390c39[_0x60b3('0x58')]['id']){delete _0x390c39[_0x60b3('0x58')]['id'];}var _0x1bf9eb;return db[_0x60b3('0x3b')][_0x60b3('0x59')]({'where':{'id':_0x390c39['params']['id']}})[_0x60b3('0x36')](handleEntityNotFound(_0x79c6ac,null))['then'](function(_0x2a1b9e){if(_0x2a1b9e){_0x1bf9eb=_0x2a1b9e;return db[_0x60b3('0x82')]['find']({'where':{'id':_0x2a1b9e[_0x60b3('0x83')]}});}})['then'](handleEntityNotFound(_0x79c6ac,null))[_0x60b3('0x36')](function(_0x11aaf5){if(_0x11aaf5){logger[_0x60b3('0x22')](_0x60b3('0x23'),_0x60b3('0x2c'),_0x60b3('0x84'),_0x11aaf5[_0x60b3('0x3e')],util['inspect'](_0x390c39[_0x60b3('0x58')],{'showHidden':![],'depth':null}));switch(_0x11aaf5['type']){case _0x60b3('0x85'):if(_0x390c39['body'][_0x60b3('0x86')]&&_0x390c39[_0x60b3('0x58')][_0x60b3('0x86')]===_0x1bf9eb[_0x60b3('0x87')]){return _0x1bf9eb[_0x60b3('0x35')]({'read':!![]});}else{logger['error'](_0x60b3('0x88'),_0x60b3('0x2c'),_0x60b3('0x85'),util[_0x60b3('0x89')](_0x390c39[_0x60b3('0x58')],{'showHidden':![],'depth':null}));}break;case _0x60b3('0x8a'):if(_0x390c39['body']['MessageUUID']&&_0x390c39['body'][_0x60b3('0x8b')]===_0x1bf9eb['messageId']&&_[_0x60b3('0x8c')]([_0x60b3('0x8d'),_0x60b3('0x8e')],_0x390c39[_0x60b3('0x58')][_0x60b3('0x8f')])>=0x0){return _0x1bf9eb['update']({'read':!![]});}else{logger[_0x60b3('0x25')](_0x60b3('0x88'),'status','plivio',util[_0x60b3('0x89')](_0x390c39[_0x60b3('0x58')],{'showHidden':![],'depth':null}));}break;case _0x60b3('0x90'):var _0x55ea3c=_0x390c39[_0x60b3('0x58')]['results'][0x0];if(_0x55ea3c['status'][_0x60b3('0x91')]===_0x60b3('0x92')){return _0x1bf9eb[_0x60b3('0x35')]({'read':!![]});}else{logger[_0x60b3('0x25')](_0x60b3('0x88'),'status',_0x60b3('0x90'),util[_0x60b3('0x89')](_0x390c39[_0x60b3('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x1bf9eb;}})['then'](respondWithResult(_0x79c6ac,null))['catch'](handleError(_0x79c6ac,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c1c9069..c8ac6b1 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 _0x8289=['emit','hasOwnProperty','exports','events','SmsMessage','save','update','remove'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x8289,0x1db));var _0x9828=function(_0x528e95,_0x3a2de6){_0x528e95=_0x528e95-0x0;var _0x22a509=_0x8289[_0x528e95];return _0x22a509;};'use strict';var EventEmitter=require(_0x9828('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x9828('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9828('0x2'),'afterUpdate':_0x9828('0x3'),'afterDestroy':_0x9828('0x4')};function emitEvent(_0x2fa85c){return function(_0x407b7c,_0x4b102a,_0x1069a1){SmsMessageEvents[_0x9828('0x5')](_0x2fa85c+':'+_0x407b7c['id'],_0x407b7c);SmsMessageEvents['emit'](_0x2fa85c,_0x407b7c);_0x1069a1(null);};}for(var e in events){if(events[_0x9828('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x9828('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xc2f8=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xc2f8,0xec));var _0x8c2f=function(_0xf7e626,_0x37d37e){_0xf7e626=_0xf7e626-0x0;var _0x3f1472=_0xc2f8[_0xf7e626];return _0x3f1472;};'use strict';var EventEmitter=require(_0x8c2f('0x0'));var SmsMessage=require(_0x8c2f('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8c2f('0x2')](0x0);var events={'afterCreate':_0x8c2f('0x3'),'afterUpdate':'update','afterDestroy':_0x8c2f('0x4')};function emitEvent(_0x57f344){return function(_0x49f091,_0x4ef5f6,_0x4b7c30){SmsMessageEvents[_0x8c2f('0x5')](_0x57f344+':'+_0x49f091['id'],_0x49f091);SmsMessageEvents[_0x8c2f('0x5')](_0x57f344,_0x49f091);_0x4b7c30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x8c2f('0x6')](e,emitEvent(event));}}module[_0x8c2f('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index aa19d51..bd626f3 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 _0x4637=['../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','direction','isNil','SmsInteractionId','findOne','then','createdAt','catch','out','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','phone','authToken','create','remote','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','total_sent','internal_order_id','read','update','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','token','application/json','IBSSO\x20','csc','crypto','apiKey','text','timestamp','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','bandwidth','%s:%s','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x175cb1,_0x1d43e4){var _0x36134c=function(_0x47f11b){while(--_0x47f11b){_0x175cb1['push'](_0x175cb1['shift']());}};_0x36134c(++_0x1d43e4);}(_0x4637,0x71));var _0x7463=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4637[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x7463('0x0'));var util=require(_0x7463('0x1'));var logger=require('../../config/logger')(_0x7463('0x2'));var moment=require(_0x7463('0x3'));var BPromise=require(_0x7463('0x4'));var rp=require(_0x7463('0x5'));var fs=require('fs');var path=require(_0x7463('0x6'));var rimraf=require('rimraf');var config=require(_0x7463('0x7'));var attributes=require(_0x7463('0x8'));module[_0x7463('0x9')]=function(_0x219f78,_0x3d49c4){return _0x219f78[_0x7463('0xa')]('SmsMessage',attributes,{'tableName':_0x7463('0xb'),'paranoid':![],'indexes':[{'name':_0x7463('0xc'),'fields':['messageId']},{'name':_0x7463('0xd'),'fields':[_0x7463('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4157b1,_0xcaaa10,_0x512051){var _0x146c0e=_0x219f78[_0x7463('0xf')];var _0x214f1a=_0x4157b1[_0x7463('0x10')]({'plain':!![]});if(_0x214f1a['direction'][_0x7463('0x11')]()==='in'||_0x214f1a[_0x7463('0x12')]['toLowerCase']()==='out'&&!_0x214f1a['secret']&&!_[_0x7463('0x13')](_0x214f1a['UserId'])&&!_[_0x7463('0x13')](_0x214f1a[_0x7463('0x14')])){_0x146c0e['SmsInteraction'][_0x7463('0x15')]({'where':{'id':_0x214f1a['SmsInteractionId']}})[_0x7463('0x16')](function(_0x16b88e){if(_0x16b88e){_0x16b88e['update']({'lastMsgAt':_0x214f1a[_0x7463('0x17')],'lastMsgDirection':_0x214f1a[_0x7463('0x12')][_0x7463('0x11')]()});}})[_0x7463('0x18')](function(_0x4d547c){console['error'](_0x4d547c);});}if(_0x214f1a['direction']===_0x7463('0x19')&&!_0x214f1a[_0x7463('0x1a')]){var _0x1c17b2;_0x146c0e[_0x7463('0x1b')]['find']({'where':{'id':_0x214f1a[_0x7463('0x1c')]},'raw':!![]})[_0x7463('0x16')](function(_0x52ad50){_0x1c17b2=_0x52ad50;if(_0x1c17b2&&_0x1c17b2[_0x7463('0x1d')]){switch(_0x1c17b2[_0x7463('0x1d')]){case _0x7463('0x1e'):var _0x3630de=require(_0x7463('0x1e'));if(_0x1c17b2[_0x7463('0x1f')]&&_0x1c17b2['authToken']&&_0x1c17b2[_0x7463('0x20')]){var _0x4dd372=new _0x3630de(_0x1c17b2[_0x7463('0x1f')],_0x1c17b2[_0x7463('0x21')]);_0x4dd372['messages'][_0x7463('0x22')]({'body':_0x214f1a[_0x7463('0xe')],'to':_0x214f1a[_0x7463('0x20')],'from':_0x1c17b2[_0x7463('0x20')],'statusCallback':_0x1c17b2[_0x7463('0x23')]+_0x7463('0x24')+_0x214f1a['id']+_0x7463('0x25')+_0x1c17b2['token']})[_0x7463('0x16')](function(_0x4c9f70){if(_0x4c9f70[_0x7463('0x26')]){return _0x4157b1['update']({'messageId':_0x4c9f70['sid']});}})[_0x7463('0x18')](function(_0x5c9514){logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x1e'),util['inspect'](_0x5c9514,{'showHidden':![],'depth':null}));});}else{logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),'twilio',_0x7463('0x2a'));}break;case _0x7463('0x2b'):var _0x42c356=_0x7463('0x2c');if(_0x1c17b2[_0x7463('0x2d')]&&_0x1c17b2[_0x7463('0x2e')]){var _0x34e81={'recipient':[_0x214f1a[_0x7463('0x20')]],'message':_0x214f1a[_0x7463('0xe')],'message_type':_0x1c17b2['smsMethod']};if(_0x1c17b2['smsMethod']&&_0x1c17b2[_0x7463('0x2f')]!=='SI'){_0x34e81[_0x7463('0x30')]=_0x1c17b2['phone'];}var _0x5162b3={'url':_0x42c356+_0x7463('0x31')+_0x1c17b2[_0x7463('0x2d')]+_0x7463('0x32')+_0x1c17b2['password'],'method':_0x7463('0x33')};rp(_0x5162b3)[_0x7463('0x16')](function(_0x397abf){var _0x2cd3dd=_0x397abf['split'](';');var _0x4cb166={'user_key':_0x2cd3dd[0x0],'session_key':_0x2cd3dd[0x1]};_0x5162b3={'url':_0x42c356+_0x7463('0x34'),'method':_0x7463('0x35'),'headers':{'user_key':_0x4cb166['user_key'],'Session_key':_0x4cb166['session_key']},'json':!![],'body':_0x34e81};return rp(_0x5162b3);})['then'](function(_0x4cbb5c){if(_0x4cbb5c[_0x7463('0x36')]>=0x1){var _0x25533e={'messageId':_0x4cbb5c[_0x7463('0x37')]};if(_0x1c17b2[_0x7463('0x2f')]!=='GP'||!_0x1c17b2['deliveryReport']){_0x25533e[_0x7463('0x38')]=!![];}return _0x4157b1[_0x7463('0x39')](_0x25533e);}else{return logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x2b'),util[_0x7463('0x3a')](_0x4cbb5c,{'showHidden':![],'depth':null}));}})[_0x7463('0x18')](function(_0x26527e){return logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x2b'),util[_0x7463('0x3a')](_0x26527e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7463('0x3b'):if(_0x1c17b2[_0x7463('0x21')]){var _0x3f2f10={'recipient':_0x214f1a['phone'],'message':_0x214f1a[_0x7463('0xe')],'sender':_0x1c17b2[_0x7463('0x3c')]||_0x1c17b2[_0x7463('0x20')],'authorization':_0x1c17b2[_0x7463('0x21')]};var _0xcaaa10={'method':_0x7463('0x35'),'uri':_0x7463('0x3d'),'body':_0x3f2f10,'json':!![]};rp(_0xcaaa10)[_0x7463('0x16')](function(_0x455bdb){var _0x2e85c2={'messageId':_0x455bdb[_0x7463('0x3e')]};if(!_0x1c17b2[_0x7463('0x3f')]){_0x2e85c2[_0x7463('0x38')]=!![];}return _0x4157b1[_0x7463('0x39')](_0x2e85c2);})[_0x7463('0x18')](function(_0x2331c8){logger[_0x7463('0x27')](_0x7463('0x28'),'afterCreate',_0x7463('0x3b'),util['inspect'](_0x2331c8,{'showHidden':![],'depth':null}));});}else{logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x3b'),_0x7463('0x40'));}break;case'clicksend':if(_0x1c17b2[_0x7463('0x2d')]&&_0x1c17b2[_0x7463('0x2e')]){var _0x3f2f10={'messages':[{'source':_0x7463('0x41'),'to':_0x214f1a['phone'],'body':_0x214f1a[_0x7463('0xe')],'from':_0x1c17b2[_0x7463('0x3c')]||_0x1c17b2['phone']}]};var _0x10185e=util[_0x7463('0x42')]('%s:%s',_0x1c17b2[_0x7463('0x2d')],_0x1c17b2[_0x7463('0x2e')]);var _0xcaaa10={'method':_0x7463('0x35'),'uri':_0x7463('0x43'),'body':_0x3f2f10,'headers':{'Authorization':util[_0x7463('0x42')](_0x7463('0x44'),new Buffer(_0x10185e)[_0x7463('0x45')]('base64'))},'json':!![]};rp(_0xcaaa10)[_0x7463('0x16')](function(_0x3ba1c9){if(_0x3ba1c9['http_code']>=0xc8&&_0x3ba1c9[_0x7463('0x46')]<=0xce){if(_0x3ba1c9[_0x7463('0x47')]&&_0x3ba1c9[_0x7463('0x47')][_0x7463('0x48')]>0x0){var _0x66ab25=_[_0x7463('0x49')](_0x3ba1c9[_0x7463('0x47')][_0x7463('0x4a')]);var _0x1ba932={'messageId':_0x66ab25['message_id']};if(!_0x1c17b2[_0x7463('0x3f')]){_0x1ba932['read']=!![];}return _0x4157b1[_0x7463('0x39')](_0x1ba932);}else{logger['error'](_0x7463('0x28'),'afterCreate','clickSend',util[_0x7463('0x3a')](_0x3ba1c9,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x4b'),util[_0x7463('0x3a')](_0x3ba1c9,{'showHidden':![],'depth':null}));}})[_0x7463('0x18')](function(_0x46e583){logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x4b'),util[_0x7463('0x3a')](_0x46e583,{'showHidden':![],'depth':null}));});}else{logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x4b'),_0x7463('0x4c'));}break;case _0x7463('0x4d'):if(_0x1c17b2[_0x7463('0x4e')]&&_0x1c17b2[_0x7463('0x21')]){var _0x3f2f10={'dst':_0x214f1a['phone'],'text':_0x214f1a[_0x7463('0xe')],'src':_0x1c17b2[_0x7463('0x3c')]||_0x1c17b2[_0x7463('0x20')],'url':_0x1c17b2[_0x7463('0x23')]+'/api/sms/messages/'+_0x214f1a['id']+_0x7463('0x25')+_0x1c17b2['token']};var _0x10185e=util[_0x7463('0x42')]('%s:%s',_0x1c17b2[_0x7463('0x4e')],_0x1c17b2['authToken']);var _0xcaaa10={'method':_0x7463('0x35'),'uri':util[_0x7463('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1c17b2[_0x7463('0x4e')]),'body':_0x3f2f10,'headers':{'Authorization':util[_0x7463('0x42')](_0x7463('0x44'),new Buffer(_0x10185e)['toString'](_0x7463('0x4f')))},'json':!![]};rp(_0xcaaa10)[_0x7463('0x16')](function(_0x304a00){var _0x341287={'messageId':_0x304a00[_0x7463('0x50')][0x0]};return _0x4157b1[_0x7463('0x39')](_0x341287);})[_0x7463('0x18')](function(_0x247ba6){logger[_0x7463('0x27')](_0x7463('0x28'),'afterCreate',_0x7463('0x4d'),util['inspect'](_0x247ba6,{'showHidden':![],'depth':null}));});}else{logger[_0x7463('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7463('0x4d'),_0x7463('0x51'));}break;case _0x7463('0x52'):if(_0x1c17b2['username']&&_0x1c17b2[_0x7463('0x2e')]){if(_0x1c17b2[_0x7463('0x53')]){var _0x2ccd89={'method':_0x7463('0x35'),'uri':_0x1c17b2[_0x7463('0x53')]+'/auth/1/session','body':{'username':_0x1c17b2[_0x7463('0x2d')],'password':_0x1c17b2[_0x7463('0x2e')]},'json':!![]};return rp(_0x2ccd89)[_0x7463('0x16')](function(_0xca0f90){var _0x577675={'method':_0x7463('0x35'),'uri':_0x1c17b2[_0x7463('0x53')]+_0x7463('0x54'),'body':{'messages':[{'from':_0x1c17b2[_0x7463('0x20')],'destinations':[{'to':_0x214f1a[_0x7463('0x20')]}],'text':_0x214f1a[_0x7463('0xe')],'notifyUrl':_0x1c17b2[_0x7463('0x23')]+'/api/sms/messages/'+_0x214f1a['id']+_0x7463('0x25')+_0x1c17b2[_0x7463('0x55')],'notifyContentType':_0x7463('0x56'),'callbackData':_0x1c17b2[_0x7463('0x20')]+';'+_0x214f1a['body']}]},'headers':{'Authorization':_0x7463('0x57')+_0xca0f90[_0x7463('0x55')]},'json':!![]};return rp(_0x577675)[_0x7463('0x16')](function(_0x5e65bd){if(_0x5e65bd['messages']){var _0x59f7e1={'messageId':_0x5e65bd[_0x7463('0x4a')][0x0][_0x7463('0xc')]};if(!_0x1c17b2[_0x7463('0x3f')]){_0x59f7e1[_0x7463('0x38')]=!![];}return _0x4157b1['update'](_0x59f7e1);}else{return logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x52'),util[_0x7463('0x3a')](_0x5e65bd,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5b557e){return logger[_0x7463('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7463('0x52'),util[_0x7463('0x3a')](_0x5b557e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x7463('0x28'),'afterCreate','infobip',_0x7463('0x4c'));}break;case _0x7463('0x58'):var _0x5f1d47=require(_0x7463('0x59'));if(_0x1c17b2[_0x7463('0x5a')]){var _0x525c57={};_0x525c57['login']=_0x1c17b2[_0x7463('0x2d')];_0x525c57['phone']=_0x214f1a[_0x7463('0x20')];_0x525c57[_0x7463('0x30')]=_0x1c17b2[_0x7463('0x20')];_0x525c57[_0x7463('0x5b')]=_0x214f1a[_0x7463('0xe')];_0x525c57[_0x7463('0x5c')]=+new Date();var _0x1eaf0d='';var _0x1fea72='';var _0x68e0cc=Object['keys'](_0x525c57);_0x68e0cc['sort']();for(var _0x3a5751=0x0;_0x3a5751<_0x68e0cc[_0x7463('0x5d')];_0x3a5751++){if(_0x1eaf0d!=''){_0x1eaf0d+='&';}_0x1eaf0d+=_0x68e0cc[_0x3a5751]+'='+encodeURIComponent(_0x525c57[_0x68e0cc[_0x3a5751]]);_0x1fea72+=_0x525c57[_0x68e0cc[_0x3a5751]];}_0x1fea72+=_0x1c17b2[_0x7463('0x5a')];_0x1fea72=_0x5f1d47[_0x7463('0x5e')](_0x7463('0x5f'))['update'](_0x1fea72)[_0x7463('0x60')](_0x7463('0x61'));if(_0x1eaf0d!==''){_0x1eaf0d+='&';}_0x1eaf0d+=_0x7463('0x62')+_0x1fea72;var _0x5162b3={'method':_0x7463('0x33'),'uri':_0x1c17b2[_0x7463('0x53')]+_0x7463('0x63')+_0x1eaf0d,'json':!![]};return rp(_0x5162b3)[_0x7463('0x16')](function(_0x27d169){var _0x32b765=Object['keys'](_0x27d169);if(_0x27d169[_0x32b765[0x0]]['error']&&parseInt(_0x27d169[_0x32b765[0x0]][_0x7463('0x27')])===0x0){var _0xe50c67={'messageId':_0x27d169[_0x32b765[0x0]]['id_sms']};if(!_0x1c17b2['deliveryReport']){_0xe50c67[_0x7463('0x38')]=!![];}return _0x4157b1[_0x7463('0x39')](_0xe50c67);}else{return logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x58'),util[_0x7463('0x3a')](_0x27d169[_0x7463('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x519431){return logger[_0x7463('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7463('0x29'),'csc',util['inspect'](_0x519431,{'showHidden':![],'depth':null}));});}else{logger[_0x7463('0x27')](_0x7463('0x28'),'afterCreate',_0x7463('0x58'),_0x7463('0x64'));}break;case'clickatell':if(_0x1c17b2[_0x7463('0x5a')]){var _0x4a8947={'method':_0x7463('0x35'),'uri':_0x7463('0x65'),'headers':{'Authorization':_0x1c17b2['apiKey']},'body':{'content':_0x214f1a[_0x7463('0xe')],'to':[_0x214f1a[_0x7463('0x20')]],'from':_0x1c17b2[_0x7463('0x20')],'binary':![],'clientMessageId':_0x7463('0x66'),'charset':_0x7463('0x67')},'json':!![]};rp(_0x4a8947)[_0x7463('0x16')](function(_0x12fc25){if(!_0x12fc25[_0x7463('0x27')]){var _0x5ac93f={'messageId':_0x12fc25[_0x7463('0x4a')][0x0]['apiMessageId']};if(!_0x1c17b2[_0x7463('0x3f')]){_0x5ac93f[_0x7463('0x38')]=!![];}return _0x4157b1[_0x7463('0x39')](_0x5ac93f);}else{return logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x68'),util[_0x7463('0x3a')](_0x12fc25[_0x7463('0x27')],{'showHidden':![],'depth':null}));}})[_0x7463('0x18')](function(_0x12af90){return logger[_0x7463('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7463('0x29'),'clickatell',util[_0x7463('0x3a')](_0x12af90,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x68'),_0x7463('0x64'));}break;case _0x7463('0x69'):if(_0x1c17b2[_0x7463('0x2d')]&&_0x1c17b2[_0x7463('0x2e')]){var _0x10185e=util[_0x7463('0x42')](_0x7463('0x6a'),_0x1c17b2[_0x7463('0x2d')],_0x1c17b2[_0x7463('0x2e')]);var _0xcaaa10={'method':_0x7463('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1c17b2[_0x7463('0x6b')]+'/messages','body':{'to':[_0x214f1a[_0x7463('0x20')]],'text':_0x214f1a[_0x7463('0xe')],'from':_0x1c17b2[_0x7463('0x20')],'applicationId':_0x1c17b2[_0x7463('0x6c')]},'headers':{'Authorization':util[_0x7463('0x42')](_0x7463('0x44'),new Buffer(_0x10185e)[_0x7463('0x45')]('base64'))},'json':!![]};rp(_0xcaaa10)[_0x7463('0x16')](function(_0x1b7f46){if(_0x1b7f46['id']){var _0x3c39eb={'messageId':_0x1b7f46['id']};return _0x4157b1[_0x7463('0x39')](_0x3c39eb);}else{logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x69'),util[_0x7463('0x3a')](_0x1b7f46,{'showHidden':![],'depth':null}));}})[_0x7463('0x18')](function(_0x29e599){logger[_0x7463('0x27')](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x69'),util[_0x7463('0x3a')](_0x29e599,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7463('0x28'),'afterCreate',_0x7463('0x69'),_0x7463('0x4c'));}break;case _0x7463('0x6d'):if(_0x1c17b2['apiKey']){var _0x23e28a={};var _0x5162b3={'method':_0x7463('0x35'),'uri':_0x7463('0x6e'),'headers':{'Authorization':_0x7463('0x6f')+_0x1c17b2[_0x7463('0x5a')],'Content-Type':_0x7463('0x56')},'body':{'from':_0x1c17b2[_0x7463('0x20')],'to':_0x214f1a['phone'],'text':_0x214f1a['body']},'json':!![]};return rp(_0x5162b3)[_0x7463('0x16')](function(_0x23f00a){if(_0x23f00a['code']==0xca){_0x23e28a[_0x7463('0x70')]=_0x23f00a;var _0x299521={'method':'POST','uri':_0x7463('0x71'),'headers':{'Authorization':_0x7463('0x6f')+_0x1c17b2[_0x7463('0x5a')],'Content-Type':'application/json'},'body':{'refid':_0x23e28a['message'][_0x7463('0x72')]},'json':!![]};return rp(_0x299521)['then'](function(_0x2235b6){_0x23e28a[_0x7463('0x73')]=_0x2235b6;var _0x2df322={'messageId':_0x23e28a[_0x7463('0x70')][_0x7463('0x72')],'read':!![]};return _0x4157b1['update'](_0x2df322);});}else{return logger['error'](_0x7463('0x28'),_0x7463('0x29'),_0x7463('0x6d'),util[_0x7463('0x3a')](_0x23f00a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x302a96){return logger[_0x7463('0x27')](_0x7463('0x28'),'afterCreate','intelepeer',util[_0x7463('0x3a')](_0x302a96,{'showHidden':![],'depth':null}));});}else{return logger[_0x7463('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7463('0x29'),_0x7463('0x6d'),_0x7463('0x74'));}break;}}})[_0x7463('0x75')](function(){_0x512051();});}else{_0x512051();}}},'charset':_0x7463('0x76'),'collate':_0x7463('0x77')});}; \ No newline at end of file +var _0x89d5=['twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','sms','POST','user_key','session_key','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','clickSend','plivo','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','uuid','UTF-8','clickatell','bandwidth','accountId','/messages','applicationId','intelepeer','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','error','out','SmsAccount','then','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x89d5,0x1c2));var _0x589d=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x89d5[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x589d('0x0'));var util=require(_0x589d('0x1'));var logger=require(_0x589d('0x2'))(_0x589d('0x3'));var moment=require(_0x589d('0x4'));var BPromise=require(_0x589d('0x5'));var rp=require(_0x589d('0x6'));var fs=require('fs');var path=require(_0x589d('0x7'));var rimraf=require(_0x589d('0x8'));var config=require(_0x589d('0x9'));var attributes=require(_0x589d('0xa'));module[_0x589d('0xb')]=function(_0x39c58c,_0x3ecf7e){return _0x39c58c[_0x589d('0xc')](_0x589d('0xd'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x589d('0xe'),'fields':[_0x589d('0xe')]},{'name':_0x589d('0xf'),'fields':[_0x589d('0x10')],'type':_0x589d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24e7cb,_0x8222a7,_0x1e4c3d){var _0x46e0bf=_0x39c58c[_0x589d('0x12')];var _0x46e1c5=_0x24e7cb[_0x589d('0x13')]({'plain':!![]});if(_0x46e1c5[_0x589d('0x14')][_0x589d('0x15')]()==='in'||_0x46e1c5[_0x589d('0x14')][_0x589d('0x15')]()==='out'&&!_0x46e1c5[_0x589d('0x16')]&&!_[_0x589d('0x17')](_0x46e1c5['UserId'])&&!_['isNil'](_0x46e1c5[_0x589d('0x18')])){_0x46e0bf[_0x589d('0x19')][_0x589d('0x1a')]({'where':{'id':_0x46e1c5[_0x589d('0x18')]}})['then'](function(_0x37e34a){if(_0x37e34a){_0x37e34a[_0x589d('0x1b')]({'lastMsgAt':_0x46e1c5[_0x589d('0x1c')],'lastMsgDirection':_0x46e1c5[_0x589d('0x14')][_0x589d('0x15')]()});}})['catch'](function(_0x5c8cde){console[_0x589d('0x1d')](_0x5c8cde);});}if(_0x46e1c5[_0x589d('0x14')]===_0x589d('0x1e')&&!_0x46e1c5['secret']){var _0x352734;_0x46e0bf[_0x589d('0x1f')]['find']({'where':{'id':_0x46e1c5['SmsAccountId']},'raw':!![]})[_0x589d('0x20')](function(_0x28fd03){_0x352734=_0x28fd03;if(_0x352734&&_0x352734['type']){switch(_0x352734[_0x589d('0x21')]){case _0x589d('0x22'):var _0x47414c=require('twilio');if(_0x352734[_0x589d('0x23')]&&_0x352734[_0x589d('0x24')]&&_0x352734[_0x589d('0x25')]){var _0x103858=new _0x47414c(_0x352734[_0x589d('0x23')],_0x352734[_0x589d('0x24')]);_0x103858[_0x589d('0x26')][_0x589d('0x27')]({'body':_0x46e1c5['body'],'to':_0x46e1c5['phone'],'from':_0x352734[_0x589d('0x25')],'statusCallback':_0x352734[_0x589d('0x28')]+'/api/sms/messages/'+_0x46e1c5['id']+_0x589d('0x29')+_0x352734[_0x589d('0x2a')]})[_0x589d('0x20')](function(_0x458cdf){if(_0x458cdf[_0x589d('0x2b')]){return _0x24e7cb[_0x589d('0x1b')]({'messageId':_0x458cdf['sid']});}})[_0x589d('0x2c')](function(_0x2f11ed){logger['error'](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x22'),util[_0x589d('0x2f')](_0x2f11ed,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x22'),_0x589d('0x30'));}break;case'skebby':var _0x9a8aae=_0x589d('0x31');if(_0x352734[_0x589d('0x32')]&&_0x352734[_0x589d('0x33')]){var _0x2baee2={'recipient':[_0x46e1c5['phone']],'message':_0x46e1c5[_0x589d('0x10')],'message_type':_0x352734[_0x589d('0x34')]};if(_0x352734[_0x589d('0x34')]&&_0x352734[_0x589d('0x34')]!=='SI'){_0x2baee2[_0x589d('0x35')]=_0x352734['phone'];}var _0x12aae6={'url':_0x9a8aae+_0x589d('0x36')+_0x352734[_0x589d('0x32')]+_0x589d('0x37')+_0x352734[_0x589d('0x33')],'method':'GET'};rp(_0x12aae6)[_0x589d('0x20')](function(_0x3199d6){var _0x41d3ed=_0x3199d6['split'](';');var _0x363c32={'user_key':_0x41d3ed[0x0],'session_key':_0x41d3ed[0x1]};_0x12aae6={'url':_0x9a8aae+_0x589d('0x38'),'method':_0x589d('0x39'),'headers':{'user_key':_0x363c32[_0x589d('0x3a')],'Session_key':_0x363c32[_0x589d('0x3b')]},'json':!![],'body':_0x2baee2};return rp(_0x12aae6);})[_0x589d('0x20')](function(_0x28edb8){if(_0x28edb8['total_sent']>=0x1){var _0x35e949={'messageId':_0x28edb8[_0x589d('0x3c')]};if(_0x352734[_0x589d('0x34')]!=='GP'||!_0x352734['deliveryReport']){_0x35e949[_0x589d('0x3d')]=!![];}return _0x24e7cb[_0x589d('0x1b')](_0x35e949);}else{return logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),'skebby',util['inspect'](_0x28edb8,{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0x4ef56d){return logger[_0x589d('0x1d')](_0x589d('0x2d'),'afterCreate',_0x589d('0x3e'),util[_0x589d('0x2f')](_0x4ef56d,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),'afterCreate','skebby',_0x589d('0x3f'));}break;case _0x589d('0x40'):if(_0x352734['authToken']){var _0x588b49={'recipient':_0x46e1c5[_0x589d('0x25')],'message':_0x46e1c5['body'],'sender':_0x352734[_0x589d('0x41')]||_0x352734[_0x589d('0x25')],'authorization':_0x352734['authToken']};var _0x8222a7={'method':_0x589d('0x39'),'uri':_0x589d('0x42'),'body':_0x588b49,'json':!![]};rp(_0x8222a7)[_0x589d('0x20')](function(_0x460373){var _0x589ba3={'messageId':_0x460373['requestid']};if(!_0x352734[_0x589d('0x43')]){_0x589ba3[_0x589d('0x3d')]=!![];}return _0x24e7cb[_0x589d('0x1b')](_0x589ba3);})['catch'](function(_0x5ccc2c){logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x40'),util[_0x589d('0x2f')](_0x5ccc2c,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x40'),_0x589d('0x44'));}break;case _0x589d('0x45'):if(_0x352734[_0x589d('0x32')]&&_0x352734[_0x589d('0x33')]){var _0x588b49={'messages':[{'source':_0x589d('0x46'),'to':_0x46e1c5[_0x589d('0x25')],'body':_0x46e1c5[_0x589d('0x10')],'from':_0x352734[_0x589d('0x41')]||_0x352734[_0x589d('0x25')]}]};var _0x5044ce=util[_0x589d('0x47')](_0x589d('0x48'),_0x352734[_0x589d('0x32')],_0x352734[_0x589d('0x33')]);var _0x8222a7={'method':_0x589d('0x39'),'uri':_0x589d('0x49'),'body':_0x588b49,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5044ce)[_0x589d('0x4a')](_0x589d('0x4b')))},'json':!![]};rp(_0x8222a7)[_0x589d('0x20')](function(_0x4a06d3){if(_0x4a06d3[_0x589d('0x4c')]>=0xc8&&_0x4a06d3[_0x589d('0x4c')]<=0xce){if(_0x4a06d3[_0x589d('0x4d')]&&_0x4a06d3[_0x589d('0x4d')]['queued_count']>0x0){var _0x1ebf96=_[_0x589d('0x4e')](_0x4a06d3[_0x589d('0x4d')][_0x589d('0x26')]);var _0x4322dc={'messageId':_0x1ebf96['message_id']};if(!_0x352734[_0x589d('0x43')]){_0x4322dc[_0x589d('0x3d')]=!![];}return _0x24e7cb[_0x589d('0x1b')](_0x4322dc);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x589d('0x2f')](_0x4a06d3,{'showHidden':![],'depth':null}));}}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),'afterCreate',_0x589d('0x4f'),util[_0x589d('0x2f')](_0x4a06d3,{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0xe2d545){logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x4f'),util[_0x589d('0x2f')](_0xe2d545,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),'clickSend',_0x589d('0x3f'));}break;case _0x589d('0x50'):if(_0x352734['authId']&&_0x352734[_0x589d('0x24')]){var _0x588b49={'dst':_0x46e1c5[_0x589d('0x25')],'text':_0x46e1c5[_0x589d('0x10')],'src':_0x352734[_0x589d('0x41')]||_0x352734[_0x589d('0x25')],'url':_0x352734[_0x589d('0x28')]+_0x589d('0x51')+_0x46e1c5['id']+_0x589d('0x29')+_0x352734[_0x589d('0x2a')]};var _0x5044ce=util['format'](_0x589d('0x48'),_0x352734[_0x589d('0x52')],_0x352734[_0x589d('0x24')]);var _0x8222a7={'method':_0x589d('0x39'),'uri':util[_0x589d('0x47')](_0x589d('0x53'),_0x352734[_0x589d('0x52')]),'body':_0x588b49,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5044ce)['toString'](_0x589d('0x4b')))},'json':!![]};rp(_0x8222a7)['then'](function(_0x4527d7){var _0x3eb34a={'messageId':_0x4527d7['message_uuid'][0x0]};return _0x24e7cb[_0x589d('0x1b')](_0x3eb34a);})[_0x589d('0x2c')](function(_0x5ed2db){logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x50'),util[_0x589d('0x2f')](_0x5ed2db,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x50'),_0x589d('0x54'));}break;case'infobip':if(_0x352734[_0x589d('0x32')]&&_0x352734['password']){if(_0x352734['baseUrl']){var _0x5603ee={'method':_0x589d('0x39'),'uri':_0x352734[_0x589d('0x55')]+_0x589d('0x56'),'body':{'username':_0x352734[_0x589d('0x32')],'password':_0x352734[_0x589d('0x33')]},'json':!![]};return rp(_0x5603ee)[_0x589d('0x20')](function(_0x1b3f52){var _0x3927f0={'method':_0x589d('0x39'),'uri':_0x352734[_0x589d('0x55')]+_0x589d('0x57'),'body':{'messages':[{'from':_0x352734['phone'],'destinations':[{'to':_0x46e1c5['phone']}],'text':_0x46e1c5[_0x589d('0x10')],'notifyUrl':_0x352734[_0x589d('0x28')]+_0x589d('0x51')+_0x46e1c5['id']+_0x589d('0x29')+_0x352734[_0x589d('0x2a')],'notifyContentType':_0x589d('0x58'),'callbackData':_0x352734[_0x589d('0x25')]+';'+_0x46e1c5[_0x589d('0x10')]}]},'headers':{'Authorization':_0x589d('0x59')+_0x1b3f52[_0x589d('0x2a')]},'json':!![]};return rp(_0x3927f0)['then'](function(_0x1b8226){if(_0x1b8226[_0x589d('0x26')]){var _0x5a2916={'messageId':_0x1b8226[_0x589d('0x26')][0x0][_0x589d('0xe')]};if(!_0x352734['deliveryReport']){_0x5a2916[_0x589d('0x3d')]=!![];}return _0x24e7cb[_0x589d('0x1b')](_0x5a2916);}else{return logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x5a'),util[_0x589d('0x2f')](_0x1b8226,{'showHidden':![],'depth':null}));}});})[_0x589d('0x2c')](function(_0x35b030){return logger[_0x589d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x589d('0x2e'),'infobip',util[_0x589d('0x2f')](_0x35b030,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x589d('0x5a'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x5a'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x37ff4f=require('crypto');if(_0x352734[_0x589d('0x5b')]){var _0x44260b={};_0x44260b[_0x589d('0x5c')]=_0x352734[_0x589d('0x32')];_0x44260b[_0x589d('0x25')]=_0x46e1c5[_0x589d('0x25')];_0x44260b[_0x589d('0x35')]=_0x352734['phone'];_0x44260b['text']=_0x46e1c5[_0x589d('0x10')];_0x44260b[_0x589d('0x5d')]=+new Date();var _0x331523='';var _0x5d53fe='';var _0x57512d=Object[_0x589d('0x5e')](_0x44260b);_0x57512d[_0x589d('0x5f')]();for(var _0x305ee5=0x0;_0x305ee5<_0x57512d[_0x589d('0x60')];_0x305ee5++){if(_0x331523!=''){_0x331523+='&';}_0x331523+=_0x57512d[_0x305ee5]+'='+encodeURIComponent(_0x44260b[_0x57512d[_0x305ee5]]);_0x5d53fe+=_0x44260b[_0x57512d[_0x305ee5]];}_0x5d53fe+=_0x352734['apiKey'];_0x5d53fe=_0x37ff4f[_0x589d('0x61')](_0x589d('0x62'))[_0x589d('0x1b')](_0x5d53fe)[_0x589d('0x63')](_0x589d('0x64'));if(_0x331523!==''){_0x331523+='&';}_0x331523+=_0x589d('0x65')+_0x5d53fe;var _0x12aae6={'method':'GET','uri':_0x352734['baseUrl']+_0x589d('0x66')+_0x331523,'json':!![]};return rp(_0x12aae6)[_0x589d('0x20')](function(_0x28bb21){var _0x40e3aa=Object['keys'](_0x28bb21);if(_0x28bb21[_0x40e3aa[0x0]]['error']&&parseInt(_0x28bb21[_0x40e3aa[0x0]]['error'])===0x0){var _0x520bdf={'messageId':_0x28bb21[_0x40e3aa[0x0]]['id_sms']};if(!_0x352734[_0x589d('0x43')]){_0x520bdf[_0x589d('0x3d')]=!![];}return _0x24e7cb[_0x589d('0x1b')](_0x520bdf);}else{return logger[_0x589d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x589d('0x2e'),_0x589d('0x67'),util[_0x589d('0x2f')](_0x28bb21[_0x589d('0x1d')],{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0x3bcc3d){return logger['error'](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x67'),util['inspect'](_0x3bcc3d,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x589d('0x67'),_0x589d('0x68'));}break;case'clickatell':if(_0x352734[_0x589d('0x5b')]){var _0x1c8b0f={'method':_0x589d('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x352734['apiKey']},'body':{'content':_0x46e1c5[_0x589d('0x10')],'to':[_0x46e1c5[_0x589d('0x25')]],'from':_0x352734[_0x589d('0x25')],'binary':![],'clientMessageId':_0x589d('0x69'),'charset':_0x589d('0x6a')},'json':!![]};rp(_0x1c8b0f)['then'](function(_0x1160be){if(!_0x1160be[_0x589d('0x1d')]){var _0x38a3dd={'messageId':_0x1160be[_0x589d('0x26')][0x0]['apiMessageId']};if(!_0x352734[_0x589d('0x43')]){_0x38a3dd[_0x589d('0x3d')]=!![];}return _0x24e7cb['update'](_0x38a3dd);}else{return logger[_0x589d('0x1d')](_0x589d('0x2d'),'afterCreate',_0x589d('0x6b'),util[_0x589d('0x2f')](_0x1160be[_0x589d('0x1d')],{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0x5d80fe){return logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x6b'),util[_0x589d('0x2f')](_0x5d80fe,{'showHidden':![],'depth':null}));});}else{logger[_0x589d('0x1d')](_0x589d('0x2d'),'afterCreate',_0x589d('0x6b'),_0x589d('0x68'));}break;case _0x589d('0x6c'):if(_0x352734[_0x589d('0x32')]&&_0x352734[_0x589d('0x33')]){var _0x5044ce=util[_0x589d('0x47')](_0x589d('0x48'),_0x352734[_0x589d('0x32')],_0x352734[_0x589d('0x33')]);var _0x8222a7={'method':_0x589d('0x39'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x352734[_0x589d('0x6d')]+_0x589d('0x6e'),'body':{'to':[_0x46e1c5[_0x589d('0x25')]],'text':_0x46e1c5[_0x589d('0x10')],'from':_0x352734[_0x589d('0x25')],'applicationId':_0x352734[_0x589d('0x6f')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5044ce)[_0x589d('0x4a')](_0x589d('0x4b')))},'json':!![]};rp(_0x8222a7)[_0x589d('0x20')](function(_0x2600b6){if(_0x2600b6['id']){var _0x37278d={'messageId':_0x2600b6['id']};return _0x24e7cb[_0x589d('0x1b')](_0x37278d);}else{logger[_0x589d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x589d('0x2e'),_0x589d('0x6c'),util[_0x589d('0x2f')](_0x2600b6,{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0x468a13){logger['error'](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x6c'),util[_0x589d('0x2f')](_0x468a13,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x589d('0x2e'),_0x589d('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x589d('0x70'):if(_0x352734[_0x589d('0x5b')]){var _0x3febdc={};var _0x12aae6={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x589d('0x71')+_0x352734[_0x589d('0x5b')],'Content-Type':_0x589d('0x58')},'body':{'from':_0x352734[_0x589d('0x25')],'to':_0x46e1c5[_0x589d('0x25')],'text':_0x46e1c5[_0x589d('0x10')]},'json':!![]};return rp(_0x12aae6)['then'](function(_0x16c28d){if(_0x16c28d['code']==0xca){_0x3febdc[_0x589d('0x72')]=_0x16c28d;var _0x1d4cf1={'method':_0x589d('0x39'),'uri':_0x589d('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x352734[_0x589d('0x5b')],'Content-Type':_0x589d('0x58')},'body':{'refid':_0x3febdc['message'][_0x589d('0x74')]},'json':!![]};return rp(_0x1d4cf1)['then'](function(_0x32b0ad){_0x3febdc[_0x589d('0x75')]=_0x32b0ad;var _0x386ea2={'messageId':_0x3febdc['message'][_0x589d('0x74')],'read':!![]};return _0x24e7cb[_0x589d('0x1b')](_0x386ea2);});}else{return logger['error'](_0x589d('0x2d'),_0x589d('0x2e'),'intelepeer',util[_0x589d('0x2f')](_0x16c28d,{'showHidden':![],'depth':null}));}})[_0x589d('0x2c')](function(_0x1a8c12){return logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),_0x589d('0x70'),util[_0x589d('0x2f')](_0x1a8c12,{'showHidden':![],'depth':null}));});}else{return logger[_0x589d('0x1d')](_0x589d('0x2d'),_0x589d('0x2e'),'intelepeer',_0x589d('0x76'));}break;}}})['finally'](function(){_0x1e4c3d();});}else{_0x1e4c3d();}}},'charset':_0x589d('0x77'),'collate':_0x589d('0x78')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 327ac93..9caa2bf 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 _0xa74f=['message','result','catch','CreateSmsMessage','body','options','raw','debug','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd468,_0x285a43){var _0x3852c4=function(_0x36b275){while(--_0x36b275){_0x3dd468['push'](_0x3dd468['shift']());}};_0x3852c4(++_0x285a43);}(_0xa74f,0x1c8));var _0xfa74=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0xa74f[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0xfa74('0x0'));var util=require('util');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa74('0x4'));var logger=require(_0xfa74('0x5'))('rpc');var config=require(_0xfa74('0x6'));var jayson=require(_0xfa74('0x7'));var client=jayson[_0xfa74('0x8')][_0xfa74('0x9')]({'port':0x232a});config['redis']=_[_0xfa74('0xa')](config[_0xfa74('0xb')],{'host':_0xfa74('0xc'),'port':0x18eb});var socket=require(_0xfa74('0xd'))(new Redis(config[_0xfa74('0xb')]));require(_0xfa74('0xe'))[_0xfa74('0xf')](socket);function respondWithRpcPromise(_0x18bcbf,_0x330cda,_0x497f2c){return new BPromise(function(_0x2145e4,_0x5f5a57){return client['request'](_0x18bcbf,_0x497f2c)[_0xfa74('0x10')](function(_0x25c476){logger[_0xfa74('0x11')](_0xfa74('0x12'),_0x330cda,_0xfa74('0x13'));logger['debug'](_0xfa74('0x14'),_0x330cda,'request\x20sent',JSON[_0xfa74('0x15')](_0x25c476));if(_0x25c476[_0xfa74('0x16')]){if(_0x25c476['error'][_0xfa74('0x17')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x330cda,_0x25c476[_0xfa74('0x16')]['message']);return _0x5f5a57(_0x25c476[_0xfa74('0x16')][_0xfa74('0x18')]);}logger[_0xfa74('0x16')](_0xfa74('0x12'),_0x330cda,_0x25c476['error'][_0xfa74('0x18')]);return _0x2145e4(_0x25c476['error']['message']);}else{logger[_0xfa74('0x11')](_0xfa74('0x12'),_0x330cda,_0xfa74('0x13'));_0x2145e4(_0x25c476[_0xfa74('0x19')][_0xfa74('0x18')]);}})[_0xfa74('0x1a')](function(_0x2e20de){logger[_0xfa74('0x16')](_0xfa74('0x12'),_0x330cda,_0x2e20de);_0x5f5a57(_0x2e20de);});});}exports[_0xfa74('0x1b')]=function(_0x49e617){var _0xe9fa74=this;return new Promise(function(_0x5e26c9,_0x6305c4){return db['SmsMessage']['create'](_0x49e617[_0xfa74('0x1c')],{'raw':_0x49e617[_0xfa74('0x1d')]?_0x49e617['options'][_0xfa74('0x1e')]===undefined?!![]:![]:!![]})[_0xfa74('0x10')](function(_0x349b47){logger[_0xfa74('0x11')](_0xfa74('0x1b'),_0x49e617);logger[_0xfa74('0x1f')](_0xfa74('0x1b'),_0x49e617,JSON[_0xfa74('0x15')](_0x349b47));_0x5e26c9(_0x349b47);})[_0xfa74('0x1a')](function(_0xe5c86d){logger[_0xfa74('0x16')]('CreateSmsMessage',_0xe5c86d[_0xfa74('0x18')],_0x49e617);_0x6305c4(_0xe9fa74[_0xfa74('0x16')](0x1f4,_0xe5c86d['message']));});});}; \ No newline at end of file +var _0xb605=['then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsMessage','SmsMessage','create','body','raw'];(function(_0x11f110,_0x30e39c){var _0x4b95fd=function(_0x30c6a9){while(--_0x30c6a9){_0x11f110['push'](_0x11f110['shift']());}};_0x4b95fd(++_0x30e39c);}(_0xb605,0x1d6));var _0x5b60=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0xb605[_0x5517c0];return _0x33803b;};'use strict';var _=require(_0x5b60('0x0'));var util=require(_0x5b60('0x1'));var moment=require('moment');var BPromise=require(_0x5b60('0x2'));var rs=require(_0x5b60('0x3'));var fs=require('fs');var Redis=require(_0x5b60('0x4'));var db=require(_0x5b60('0x5'))['db'];var utils=require(_0x5b60('0x6'));var logger=require(_0x5b60('0x7'))(_0x5b60('0x8'));var config=require(_0x5b60('0x9'));var jayson=require(_0x5b60('0xa'));var client=jayson[_0x5b60('0xb')][_0x5b60('0xc')]({'port':0x232a});config[_0x5b60('0xd')]=_[_0x5b60('0xe')](config[_0x5b60('0xd')],{'host':_0x5b60('0xf'),'port':0x18eb});var socket=require(_0x5b60('0x10'))(new Redis(config[_0x5b60('0xd')]));require(_0x5b60('0x11'))[_0x5b60('0x12')](socket);function respondWithRpcPromise(_0x18980a,_0xd5b6dc,_0x13aeca){return new BPromise(function(_0x4b9200,_0x5ac887){return client[_0x5b60('0x13')](_0x18980a,_0x13aeca)['then'](function(_0x48b447){logger[_0x5b60('0x14')](_0x5b60('0x15'),_0xd5b6dc,_0x5b60('0x16'));logger[_0x5b60('0x17')](_0x5b60('0x18'),_0xd5b6dc,_0x5b60('0x16'),JSON[_0x5b60('0x19')](_0x48b447));if(_0x48b447[_0x5b60('0x1a')]){if(_0x48b447[_0x5b60('0x1a')]['code']===0x1f4){logger['error'](_0x5b60('0x15'),_0xd5b6dc,_0x48b447[_0x5b60('0x1a')][_0x5b60('0x1b')]);return _0x5ac887(_0x48b447[_0x5b60('0x1a')][_0x5b60('0x1b')]);}logger[_0x5b60('0x1a')]('SmsMessage,\x20%s,\x20%s',_0xd5b6dc,_0x48b447[_0x5b60('0x1a')][_0x5b60('0x1b')]);return _0x4b9200(_0x48b447[_0x5b60('0x1a')][_0x5b60('0x1b')]);}else{logger[_0x5b60('0x14')](_0x5b60('0x15'),_0xd5b6dc,_0x5b60('0x16'));_0x4b9200(_0x48b447[_0x5b60('0x1c')][_0x5b60('0x1b')]);}})['catch'](function(_0x5d636a){logger[_0x5b60('0x1a')](_0x5b60('0x15'),_0xd5b6dc,_0x5d636a);_0x5ac887(_0x5d636a);});});}exports[_0x5b60('0x1d')]=function(_0x5ec637){var _0x13831a=this;return new Promise(function(_0x1ba558,_0x1ff281){return db[_0x5b60('0x1e')][_0x5b60('0x1f')](_0x5ec637[_0x5b60('0x20')],{'raw':_0x5ec637['options']?_0x5ec637['options'][_0x5b60('0x21')]===undefined?!![]:![]:!![]})[_0x5b60('0x22')](function(_0x3e90a2){logger[_0x5b60('0x14')](_0x5b60('0x1d'),_0x5ec637);logger[_0x5b60('0x17')]('CreateSmsMessage',_0x5ec637,JSON[_0x5b60('0x19')](_0x3e90a2));_0x1ba558(_0x3e90a2);})[_0x5b60('0x23')](function(_0x263fa1){logger[_0x5b60('0x1a')]('CreateSmsMessage',_0x263fa1[_0x5b60('0x1b')],_0x5ec637);_0x1ff281(_0x13831a[_0x5b60('0x1a')](0x1f4,_0x263fa1[_0x5b60('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d04b7e4..113eaa5 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 _0x37c1=['update','emit','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x37c1,0x1ad));var _0x137c=function(_0x3225fc,_0x20dfd9){_0x3225fc=_0x3225fc-0x0;var _0x5bfe37=_0x37c1[_0x3225fc];return _0x5bfe37;};'use strict';var SmsMessageEvents=require(_0x137c('0x0'));var events=[_0x137c('0x1'),_0x137c('0x2'),_0x137c('0x3')];function createListener(_0x5466f0,_0x39570e){return function(_0x5d2b84){_0x39570e[_0x137c('0x4')](_0x5466f0,_0x5d2b84);};}function removeListener(_0x3caa51,_0x3adab8){return function(){SmsMessageEvents['removeListener'](_0x3caa51,_0x3adab8);};}exports[_0x137c('0x5')]=function(_0x10ad3f){for(var _0x568787=0x0,_0x3715ec=events[_0x137c('0x6')];_0x568787<_0x3715ec;_0x568787++){var _0xb02bc3=events[_0x568787];var _0x111dfb=createListener(_0x137c('0x7')+_0xb02bc3,_0x10ad3f);SmsMessageEvents['on'](_0xb02bc3,_0x111dfb);}}; \ No newline at end of file +var _0x40f8=['./smsMessage.events','save','register','smsMessage:'];(function(_0x1a7cbe,_0x1aeb42){var _0x1f721c=function(_0x1e3da7){while(--_0x1e3da7){_0x1a7cbe['push'](_0x1a7cbe['shift']());}};_0x1f721c(++_0x1aeb42);}(_0x40f8,0x16c));var _0x840f=function(_0x1fe46f,_0x144da1){_0x1fe46f=_0x1fe46f-0x0;var _0x21489e=_0x40f8[_0x1fe46f];return _0x21489e;};'use strict';var SmsMessageEvents=require(_0x840f('0x0'));var events=[_0x840f('0x1'),'remove','update'];function createListener(_0x54a15e,_0x276547){return function(_0x3b2c1d){_0x276547['emit'](_0x54a15e,_0x3b2c1d);};}function removeListener(_0x4f7d7a,_0x33d620){return function(){SmsMessageEvents['removeListener'](_0x4f7d7a,_0x33d620);};}exports[_0x840f('0x2')]=function(_0x59dcf1){for(var _0x3d1d57=0x0,_0x3f40c4=events['length'];_0x3d1d57<_0x3f40c4;_0x3d1d57++){var _0x479739=events[_0x3d1d57];var _0x207adc=createListener(_0x840f('0x3')+_0x479739,_0x59dcf1);SmsMessageEvents['on'](_0x479739,_0x207adc);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index e9747bd..5299f89 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 _0xb83f=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','describe','/:id','/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb83f,0x18c));var _0xfb83=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xb83f[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xfb83('0x0'));var util=require(_0xfb83('0x1'));var path=require(_0xfb83('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb83('0x3'));var router=express[_0xfb83('0x4')]();var fs_extra=require(_0xfb83('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb83('0x6'));var config=require(_0xfb83('0x7'));var controller=require(_0xfb83('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb83('0x9')]);router[_0xfb83('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xfb83('0xb')]);router[_0xfb83('0xa')](_0xfb83('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfb83('0xa')](_0xfb83('0xd'),auth[_0xfb83('0xe')](),controller[_0xfb83('0xf')]);router[_0xfb83('0xa')](_0xfb83('0x10'),auth[_0xfb83('0xe')](),controller[_0xfb83('0x11')]);router[_0xfb83('0xa')](_0xfb83('0x12'),auth[_0xfb83('0xe')](),controller[_0xfb83('0x13')]);router[_0xfb83('0x14')]('/',auth[_0xfb83('0xe')](),controller[_0xfb83('0x15')]);router[_0xfb83('0x14')]('/:id/teams',auth[_0xfb83('0xe')](),controller[_0xfb83('0x16')]);router['post'](_0xfb83('0x12'),auth[_0xfb83('0xe')](),controller['addAgents']);router[_0xfb83('0x17')](_0xfb83('0xc'),auth[_0xfb83('0xe')](),controller[_0xfb83('0x18')]);router[_0xfb83('0x19')](_0xfb83('0xc'),auth[_0xfb83('0xe')](),controller[_0xfb83('0x1a')]);router[_0xfb83('0x19')](_0xfb83('0x10'),auth['isAuthenticated'](),controller[_0xfb83('0x1b')]);router[_0xfb83('0x19')](_0xfb83('0x12'),auth['isAuthenticated'](),controller[_0xfb83('0x1c')]);module[_0xfb83('0x1d')]=router; \ No newline at end of file +var _0x1763=['describe','show','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x97c0e9,_0x33d339){var _0x4bb8f1=function(_0x206c5b){while(--_0x206c5b){_0x97c0e9['push'](_0x97c0e9['shift']());}};_0x4bb8f1(++_0x33d339);}(_0x1763,0x15c));var _0x3176=function(_0x31e3d5,_0x3fa1cd){_0x31e3d5=_0x31e3d5-0x0;var _0x4da910=_0x1763[_0x31e3d5];return _0x4da910;};'use strict';var multer=require(_0x3176('0x0'));var util=require('util');var path=require(_0x3176('0x1'));var timeout=require('connect-timeout');var express=require(_0x3176('0x2'));var router=express[_0x3176('0x3')]();var fs_extra=require(_0x3176('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3176('0x5'));var config=require(_0x3176('0x6'));var controller=require(_0x3176('0x7'));router[_0x3176('0x8')]('/',auth[_0x3176('0x9')](),controller[_0x3176('0xa')]);router['get'](_0x3176('0xb'),auth['isAuthenticated'](),controller[_0x3176('0xc')]);router[_0x3176('0x8')]('/:id',auth[_0x3176('0x9')](),controller[_0x3176('0xd')]);router[_0x3176('0x8')]('/:id/members',auth[_0x3176('0x9')](),controller[_0x3176('0xe')]);router[_0x3176('0x8')](_0x3176('0xf'),auth[_0x3176('0x9')](),controller['getTeams']);router[_0x3176('0x8')](_0x3176('0x10'),auth['isAuthenticated'](),controller[_0x3176('0x11')]);router[_0x3176('0x12')]('/',auth[_0x3176('0x9')](),controller[_0x3176('0x13')]);router[_0x3176('0x12')]('/:id/teams',auth[_0x3176('0x9')](),controller[_0x3176('0x14')]);router['post']('/:id/users',auth[_0x3176('0x9')](),controller[_0x3176('0x15')]);router[_0x3176('0x16')](_0x3176('0x17'),auth[_0x3176('0x9')](),controller[_0x3176('0x18')]);router[_0x3176('0x19')](_0x3176('0x17'),auth[_0x3176('0x9')](),controller[_0x3176('0x1a')]);router['delete'](_0x3176('0xf'),auth[_0x3176('0x9')](),controller[_0x3176('0x1b')]);router[_0x3176('0x19')](_0x3176('0x10'),auth[_0x3176('0x9')](),controller[_0x3176('0x1c')]);module[_0x3176('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 5366c45..1e79187 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 _0xa4e0=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1dc3bb,_0x31af09){var _0x17af1f=function(_0x5cf46e){while(--_0x5cf46e){_0x1dc3bb['push'](_0x1dc3bb['shift']());}};_0x17af1f(++_0x31af09);}(_0xa4e0,0x14f));var _0x0a4e=function(_0x5ed3c4,_0x259c9e){_0x5ed3c4=_0x5ed3c4-0x0;var _0x4c819b=_0xa4e0[_0x5ed3c4];return _0x4c819b;};'use strict';var Sequelize=require(_0x0a4e('0x0'));module[_0x0a4e('0x1')]={'name':{'type':Sequelize[_0x0a4e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0a4e('0x2')]},'timeout':{'type':Sequelize[_0x0a4e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0a4e('0x4')](_0x0a4e('0x5'),_0x0a4e('0x6'),_0x0a4e('0x7'))}}; \ No newline at end of file +var _0xcc6b=['rrmemory','roundrobin','exports','STRING','INTEGER'];(function(_0x463c98,_0x2d71b9){var _0x1ebca6=function(_0x4d3b2c){while(--_0x4d3b2c){_0x463c98['push'](_0x463c98['shift']());}};_0x1ebca6(++_0x2d71b9);}(_0xcc6b,0x12e));var _0xbcc6=function(_0x1469ee,_0x1ed8b5){_0x1469ee=_0x1469ee-0x0;var _0x35be1c=_0xcc6b[_0x1469ee];return _0x35be1c;};'use strict';var Sequelize=require('sequelize');module[_0xbcc6('0x0')]={'name':{'type':Sequelize[_0xbcc6('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbcc6('0x1')]},'timeout':{'type':Sequelize[_0xbcc6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xbcc6('0x3'),'beepall',_0xbcc6('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8a29f3f..d4ea029 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 _0xfaf6=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserSmsQueue','order','options','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','smsPause','findOne','nolimit','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeAgents','userSmsQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','SmsQueue','rawAttributes','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','filters','intersection','find','create','body'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xfaf6,0xcd));var _0x6faf=function(_0x1d39c9,_0x5836f8){_0x1d39c9=_0x1d39c9-0x0;var _0x3f8e13=_0xfaf6[_0x1d39c9];return _0x3f8e13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6faf('0x0'));var zipdir=require(_0x6faf('0x1'));var jsonpatch=require(_0x6faf('0x2'));var rp=require(_0x6faf('0x3'));var moment=require(_0x6faf('0x4'));var BPromise=require(_0x6faf('0x5'));var Mustache=require('mustache');var util=require(_0x6faf('0x6'));var path=require(_0x6faf('0x7'));var sox=require(_0x6faf('0x8'));var csv=require(_0x6faf('0x9'));var ejs=require(_0x6faf('0xa'));var fs=require('fs');var fs_extra=require(_0x6faf('0xb'));var _=require('lodash');var squel=require(_0x6faf('0xc'));var crypto=require(_0x6faf('0xd'));var jsforce=require(_0x6faf('0xe'));var deskjs=require(_0x6faf('0xf'));var toCsv=require(_0x6faf('0x9'));var querystring=require('querystring');var Papa=require(_0x6faf('0x10'));var Redis=require(_0x6faf('0x11'));var authService=require(_0x6faf('0x12'));var qs=require(_0x6faf('0x13'));var as=require(_0x6faf('0x14'));var hardwareService=require(_0x6faf('0x15'));var logger=require(_0x6faf('0x16'))(_0x6faf('0x17'));var utils=require('../../config/utils');var config=require(_0x6faf('0x18'));var licenseUtil=require(_0x6faf('0x19'));var db=require('../../mysqldb')['db'];config[_0x6faf('0x1a')]=_[_0x6faf('0x1b')](config[_0x6faf('0x1a')],{'host':_0x6faf('0x1c'),'port':0x18eb});var socket=require(_0x6faf('0x1d'))(new Redis(config[_0x6faf('0x1a')]));require(_0x6faf('0x1e'))[_0x6faf('0x1f')](socket);function respondWithStatusCode(_0x590b5b,_0x609fdb){_0x609fdb=_0x609fdb||0xcc;return function(_0x4a3d2f){if(_0x4a3d2f){return _0x590b5b[_0x6faf('0x20')](_0x609fdb);}return _0x590b5b[_0x6faf('0x21')](_0x609fdb)[_0x6faf('0x22')]();};}function respondWithResult(_0x4b9da7,_0xa3bc13){_0xa3bc13=_0xa3bc13||0xc8;return function(_0x17b913){if(_0x17b913){return _0x4b9da7[_0x6faf('0x21')](_0xa3bc13)['json'](_0x17b913);}};}function respondWithFilteredResult(_0x53847f,_0x44ad81){return function(_0x1cd6f7){if(_0x1cd6f7){var _0x5f3ae0=typeof _0x44ad81[_0x6faf('0x23')]===_0x6faf('0x24')&&typeof _0x44ad81[_0x6faf('0x25')]==='undefined';var _0x362a83=_0x1cd6f7[_0x6faf('0x26')];var _0x4cfc20=_0x5f3ae0?0x0:_0x44ad81[_0x6faf('0x23')];var _0x3f97ab=_0x5f3ae0?_0x1cd6f7[_0x6faf('0x26')]:_0x44ad81[_0x6faf('0x23')]+_0x44ad81[_0x6faf('0x25')];var _0x190052;if(_0x3f97ab>=_0x362a83){_0x3f97ab=_0x362a83;_0x190052=0xc8;}else{_0x190052=0xce;}_0x53847f['status'](_0x190052);return _0x53847f[_0x6faf('0x27')]('Content-Range',_0x4cfc20+'-'+_0x3f97ab+'/'+_0x362a83)[_0x6faf('0x28')](_0x1cd6f7);}return null;};}function patchUpdates(_0x36049b){return function(_0x3a748e){try{jsonpatch[_0x6faf('0x29')](_0x3a748e,_0x36049b,!![]);}catch(_0x33cd18){return BPromise[_0x6faf('0x2a')](_0x33cd18);}return _0x3a748e[_0x6faf('0x2b')]();};}function saveUpdates(_0x3b8965,_0x250d3f){return function(_0x3ec991){if(_0x3ec991){return _0x3ec991[_0x6faf('0x2c')](_0x3b8965)[_0x6faf('0x2d')](function(_0x1134b8){return _0x1134b8;});}return null;};}function removeEntity(_0x5b960c,_0x214597){return function(_0x10beec){if(_0x10beec){return _0x10beec[_0x6faf('0x2e')]()[_0x6faf('0x2d')](function(){var _0x3df59c=_0x10beec[_0x6faf('0x2f')]({'plain':!![]});var _0xdd3c43=_0x6faf('0x30');return db[_0x6faf('0x31')][_0x6faf('0x2e')]({'where':{'type':_0xdd3c43,'resourceId':_0x3df59c['id']}})['then'](function(){return _0x10beec;});})[_0x6faf('0x2d')](function(){_0x5b960c[_0x6faf('0x21')](0xcc)[_0x6faf('0x22')]();});}};}function handleEntityNotFound(_0x173f65,_0x57fc54){return function(_0x2e4788){if(!_0x2e4788){_0x173f65[_0x6faf('0x20')](0x194);}return _0x2e4788;};}function handleError(_0x64633a,_0x477446){_0x477446=_0x477446||0x1f4;return function(_0x116e7e){logger[_0x6faf('0x32')](_0x116e7e[_0x6faf('0x33')]);if(_0x116e7e[_0x6faf('0x34')]){delete _0x116e7e[_0x6faf('0x34')];}_0x64633a[_0x6faf('0x21')](_0x477446)[_0x6faf('0x35')](_0x116e7e);};}exports['index']=function(_0x5bb7eb,_0x31f6a9){var _0x58b9bf={},_0x1c00f={},_0x371c26={'count':0x0,'rows':[]};var _0x129e6e=_['map'](db[_0x6faf('0x36')][_0x6faf('0x37')],function(_0xc53581){return{'name':_0xc53581['fieldName'],'type':_0xc53581[_0x6faf('0x38')][_0x6faf('0x39')]};});_0x1c00f[_0x6faf('0x3a')]=_[_0x6faf('0x3b')](_0x129e6e,_0x6faf('0x34'));_0x1c00f[_0x6faf('0x3c')]=_[_0x6faf('0x3d')](_0x5bb7eb['query']);_0x1c00f['filters']=_['intersection'](_0x1c00f['model'],_0x1c00f[_0x6faf('0x3c')]);_0x58b9bf[_0x6faf('0x3e')]=_['intersection'](_0x1c00f[_0x6faf('0x3a')],qs[_0x6faf('0x3f')](_0x5bb7eb[_0x6faf('0x3c')][_0x6faf('0x3f')]));_0x58b9bf[_0x6faf('0x3e')]=_0x58b9bf[_0x6faf('0x3e')][_0x6faf('0x40')]?_0x58b9bf['attributes']:_0x1c00f[_0x6faf('0x3a')];if(!_0x5bb7eb[_0x6faf('0x3c')][_0x6faf('0x41')]('nolimit')){_0x58b9bf[_0x6faf('0x25')]=qs[_0x6faf('0x25')](_0x5bb7eb[_0x6faf('0x3c')]['limit']);_0x58b9bf[_0x6faf('0x23')]=qs[_0x6faf('0x23')](_0x5bb7eb[_0x6faf('0x3c')][_0x6faf('0x23')]);}_0x58b9bf['order']=qs[_0x6faf('0x42')](_0x5bb7eb[_0x6faf('0x3c')][_0x6faf('0x42')]);_0x58b9bf[_0x6faf('0x43')]=qs['filters'](_[_0x6faf('0x44')](_0x5bb7eb[_0x6faf('0x3c')],_0x1c00f['filters']),_0x129e6e);if(_0x5bb7eb['query']['filter']){_0x58b9bf[_0x6faf('0x43')]=_[_0x6faf('0x45')](_0x58b9bf[_0x6faf('0x43')],{'$or':_[_0x6faf('0x3b')](_0x129e6e,function(_0x304755){if(_0x304755[_0x6faf('0x38')]!==_0x6faf('0x46')){var _0x34385e={};_0x34385e[_0x304755[_0x6faf('0x34')]]={'$like':'%'+_0x5bb7eb[_0x6faf('0x3c')][_0x6faf('0x47')]+'%'};return _0x34385e;}})});}_0x58b9bf=_['merge']({},_0x58b9bf,_0x5bb7eb['options']);var _0x988c44={'where':_0x58b9bf[_0x6faf('0x43')]};return db['SmsQueue'][_0x6faf('0x26')](_0x988c44)[_0x6faf('0x2d')](function(_0x208f01){_0x371c26[_0x6faf('0x26')]=_0x208f01;if(_0x5bb7eb['query'][_0x6faf('0x48')]){_0x58b9bf[_0x6faf('0x49')]=[{'all':!![]}];}return db[_0x6faf('0x36')][_0x6faf('0x4a')](_0x58b9bf);})[_0x6faf('0x2d')](function(_0x43faa7){_0x371c26['rows']=_0x43faa7;return _0x371c26;})['then'](respondWithFilteredResult(_0x31f6a9,_0x58b9bf))[_0x6faf('0x4b')](handleError(_0x31f6a9,null));};exports[_0x6faf('0x4c')]=function(_0x4467f9,_0x58075d){var _0x42bb97={'raw':!![],'where':{'id':_0x4467f9[_0x6faf('0x4d')]['id']}},_0x5ac08c={};_0x5ac08c['model']=_[_0x6faf('0x3d')](db[_0x6faf('0x36')][_0x6faf('0x37')]);_0x5ac08c[_0x6faf('0x3c')]=_[_0x6faf('0x3d')](_0x4467f9[_0x6faf('0x3c')]);_0x5ac08c[_0x6faf('0x4e')]=_[_0x6faf('0x4f')](_0x5ac08c[_0x6faf('0x3a')],_0x5ac08c['query']);_0x42bb97[_0x6faf('0x3e')]=_[_0x6faf('0x4f')](_0x5ac08c[_0x6faf('0x3a')],qs['fields'](_0x4467f9[_0x6faf('0x3c')]['fields']));_0x42bb97['attributes']=_0x42bb97[_0x6faf('0x3e')][_0x6faf('0x40')]?_0x42bb97[_0x6faf('0x3e')]:_0x5ac08c[_0x6faf('0x3a')];if(_0x4467f9['query'][_0x6faf('0x48')]){_0x42bb97[_0x6faf('0x49')]=[{'all':!![]}];}_0x42bb97=_[_0x6faf('0x45')]({},_0x42bb97,_0x4467f9['options']);return db[_0x6faf('0x36')][_0x6faf('0x50')](_0x42bb97)[_0x6faf('0x2d')](handleEntityNotFound(_0x58075d,null))[_0x6faf('0x2d')](respondWithResult(_0x58075d,null))[_0x6faf('0x4b')](handleError(_0x58075d,null));};exports['create']=function(_0x1c4aa1,_0xa08daa){return db[_0x6faf('0x36')][_0x6faf('0x51')](_0x1c4aa1[_0x6faf('0x52')],{})['then'](function(_0x232138){var _0x248de1=_0x1c4aa1[_0x6faf('0x53')][_0x6faf('0x2f')]({'plain':!![]});if(!_0x248de1)throw new Error(_0x6faf('0x54'));if(_0x248de1['role']===_0x6faf('0x53')){var _0x47dbfa=_0x232138[_0x6faf('0x2f')]({'plain':!![]});var _0x29c07e=_0x6faf('0x30');return db[_0x6faf('0x55')][_0x6faf('0x50')]({'where':{'name':_0x29c07e,'userProfileId':_0x248de1[_0x6faf('0x56')]},'raw':!![]})[_0x6faf('0x2d')](function(_0x55be48){if(_0x55be48&&_0x55be48['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x47dbfa[_0x6faf('0x34')],'resourceId':_0x47dbfa['id'],'type':_0x55be48[_0x6faf('0x34')],'sectionId':_0x55be48['id']},{})[_0x6faf('0x2d')](function(){return _0x232138;});}else{return _0x232138;}})['catch'](function(_0x483ba3){logger[_0x6faf('0x32')](_0x6faf('0x57'),_0x483ba3);throw _0x483ba3;});}return _0x232138;})['then'](respondWithResult(_0xa08daa,0xc9))[_0x6faf('0x4b')](handleError(_0xa08daa,null));};exports['update']=function(_0x396f59,_0x400359){if(_0x396f59[_0x6faf('0x52')]['id']){delete _0x396f59[_0x6faf('0x52')]['id'];}return db[_0x6faf('0x36')][_0x6faf('0x50')]({'where':{'id':_0x396f59[_0x6faf('0x4d')]['id']}})[_0x6faf('0x2d')](handleEntityNotFound(_0x400359,null))[_0x6faf('0x2d')](saveUpdates(_0x396f59['body'],null))[_0x6faf('0x2d')](respondWithResult(_0x400359,null))['catch'](handleError(_0x400359,null));};exports[_0x6faf('0x2e')]=function(_0x4b837e,_0x59def9){return db[_0x6faf('0x36')][_0x6faf('0x50')]({'where':{'id':_0x4b837e[_0x6faf('0x4d')]['id']}})[_0x6faf('0x2d')](handleEntityNotFound(_0x59def9,null))[_0x6faf('0x2d')](removeEntity(_0x59def9,null))[_0x6faf('0x4b')](handleError(_0x59def9,null));};exports['describe']=function(_0x1218ae,_0xb03255){return db[_0x6faf('0x36')][_0x6faf('0x58')]()[_0x6faf('0x2d')](respondWithResult(_0xb03255,null))[_0x6faf('0x4b')](handleError(_0xb03255,null));};exports['getMembers']=function(_0xc7e61,_0x14b3b1,_0xbe83a7){var _0x185077={'raw':!![],'where':{}},_0x297183={},_0x38c198;return db['SmsQueue']['findOne']({'where':{'id':_0xc7e61[_0x6faf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x14b3b1,null))['then'](function(_0x2a5507){if(_0x2a5507){_0x38c198=_0x2a5507[_0x6faf('0x2f')]({'plain':!![]});_0x297183[_0x6faf('0x3a')]=_[_0x6faf('0x3d')](db[_0x6faf('0x59')][_0x6faf('0x37')]);_0x297183['query']=_['keys'](_0xc7e61[_0x6faf('0x3c')]);_0x297183[_0x6faf('0x4e')]=_['intersection'](_0x297183[_0x6faf('0x3a')],_0x297183[_0x6faf('0x3c')]);_0x185077[_0x6faf('0x3e')]=_[_0x6faf('0x4f')](_0x297183[_0x6faf('0x3a')],qs['fields'](_0xc7e61[_0x6faf('0x3c')][_0x6faf('0x3f')]));_0x185077[_0x6faf('0x3e')]=_0x185077['attributes'][_0x6faf('0x40')]?_0x185077['attributes']:_0x297183[_0x6faf('0x3a')];if(!_0xc7e61[_0x6faf('0x3c')][_0x6faf('0x41')]('nolimit')){_0x185077['limit']=qs[_0x6faf('0x25')](_0xc7e61[_0x6faf('0x3c')]['limit']);_0x185077['offset']=qs['offset'](_0xc7e61['query'][_0x6faf('0x23')]);}_0x185077[_0x6faf('0x5a')]=qs[_0x6faf('0x42')](_0xc7e61['query'][_0x6faf('0x42')]);_0x185077[_0x6faf('0x43')]=qs[_0x6faf('0x4e')](_[_0x6faf('0x44')](_0xc7e61[_0x6faf('0x3c')],_0x297183[_0x6faf('0x4e')]));_0x185077[_0x6faf('0x43')]['SmsQueueId']=_0x2a5507['id'];if(_0xc7e61[_0x6faf('0x3c')]['filter']){_0x185077[_0x6faf('0x43')]=_[_0x6faf('0x45')](_0x185077[_0x6faf('0x43')],{'$or':_['map'](_0x185077['attributes'],function(_0xa0702d){var _0x59f464={};_0x59f464[_0xa0702d]={'$like':'%'+_0xc7e61['query']['filter']+'%'};return _0x59f464;})});}_0x185077=_[_0x6faf('0x45')]({},_0x185077,_0xc7e61[_0x6faf('0x5b')]);return db['UserSmsQueue'][_0x6faf('0x4a')](_0x185077);}})[_0x6faf('0x2d')](function(_0x5bf0ae){if(_0x5bf0ae){return db[_0x6faf('0x5c')][_0x6faf('0x5d')]({'where':{'id':_['map'](_0x5bf0ae,_0x6faf('0x5e')),'role':_0x6faf('0x5f')},'attributes':['id',_0x6faf('0x34'),'smsPause',_0x6faf('0x60'),_0x6faf('0x61')]});}})[_0x6faf('0x2d')](function(_0x27192b){if(_0x27192b){return{'count':_0x27192b[_0x6faf('0x26')],'rows':_[_0x6faf('0x3b')](_0x27192b['rows'],function(_0x436506){return{'membername':_0x436506['name'],'UserId':_0x436506['id'],'queue_name':_0x38c198[_0x6faf('0x34')],'SmsQueueId':_0x38c198['id'],'interface':util['format'](_0x6faf('0x62'),_0x6faf('0x63'),_0x436506['name']),'penalty':0x0,'paused':_0x436506[_0x6faf('0x64')],'createdAt':_0x436506[_0x6faf('0x61')],'updatedAt':_0x436506[_0x6faf('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6faf('0x2d')](respondWithFilteredResult(_0x14b3b1,_0x185077))[_0x6faf('0x4b')](handleError(_0x14b3b1,null));};exports['getTeams']=function(_0x5ae0d7,_0x495143,_0x3a6cf8){var _0xb65f6b={};var _0x3d5908={};var _0x817f1a;var _0x51ffd7;return db[_0x6faf('0x36')][_0x6faf('0x65')]({'where':{'id':_0x5ae0d7[_0x6faf('0x4d')]['id']}})[_0x6faf('0x2d')](handleEntityNotFound(_0x495143,null))['then'](function(_0xe44899){if(_0xe44899){_0x817f1a=_0xe44899;_0x3d5908['model']=_[_0x6faf('0x3d')](db['Team'][_0x6faf('0x37')]);_0x3d5908['query']=_[_0x6faf('0x3d')](_0x5ae0d7[_0x6faf('0x3c')]);_0x3d5908[_0x6faf('0x4e')]=_[_0x6faf('0x4f')](_0x3d5908[_0x6faf('0x3a')],_0x3d5908[_0x6faf('0x3c')]);_0xb65f6b[_0x6faf('0x3e')]=_['intersection'](_0x3d5908[_0x6faf('0x3a')],qs[_0x6faf('0x3f')](_0x5ae0d7['query'][_0x6faf('0x3f')]));_0xb65f6b[_0x6faf('0x3e')]=_0xb65f6b['attributes'][_0x6faf('0x40')]?_0xb65f6b[_0x6faf('0x3e')]:_0x3d5908['model'];_0xb65f6b[_0x6faf('0x5a')]=qs[_0x6faf('0x42')](_0x5ae0d7[_0x6faf('0x3c')][_0x6faf('0x42')]);_0xb65f6b[_0x6faf('0x43')]=qs[_0x6faf('0x4e')](_[_0x6faf('0x44')](_0x5ae0d7[_0x6faf('0x3c')],_0x3d5908[_0x6faf('0x4e')]));if(_0x5ae0d7[_0x6faf('0x3c')][_0x6faf('0x47')]){_0xb65f6b['where']=_[_0x6faf('0x45')](_0xb65f6b[_0x6faf('0x43')],{'$or':_[_0x6faf('0x3b')](_0xb65f6b[_0x6faf('0x3e')],function(_0x598074){var _0x3506ef={};_0x3506ef[_0x598074]={'$like':'%'+_0x5ae0d7['query'][_0x6faf('0x47')]+'%'};return _0x3506ef;})});}_0xb65f6b=_[_0x6faf('0x45')]({},_0xb65f6b,_0x5ae0d7[_0x6faf('0x5b')]);return _0x817f1a['getTeams'](_0xb65f6b);}})[_0x6faf('0x2d')](function(_0x58a108){if(_0x58a108){_0x51ffd7=_0x58a108[_0x6faf('0x40')];if(!_0x5ae0d7[_0x6faf('0x3c')][_0x6faf('0x41')](_0x6faf('0x66'))){_0xb65f6b[_0x6faf('0x25')]=qs[_0x6faf('0x25')](_0x5ae0d7[_0x6faf('0x3c')][_0x6faf('0x25')]);_0xb65f6b[_0x6faf('0x23')]=qs[_0x6faf('0x23')](_0x5ae0d7[_0x6faf('0x3c')]['offset']);}return _0x817f1a[_0x6faf('0x67')](_0xb65f6b);}})[_0x6faf('0x2d')](function(_0x447384){if(_0x447384){return _0x447384?{'count':_0x51ffd7,'rows':_0x447384}:null;}})[_0x6faf('0x2d')](respondWithResult(_0x495143,null))[_0x6faf('0x4b')](handleError(_0x495143,null));};exports[_0x6faf('0x68')]=function(_0x552136,_0x26bcc3,_0x4cc7cd){var _0x17ce4c=_0x552136[_0x6faf('0x52')][_0x6faf('0x69')];return db[_0x6faf('0x6a')][_0x6faf('0x4a')]({'where':{'id':_0x17ce4c},'attributes':['id'],'include':[{'model':db[_0x6faf('0x5c')],'as':_0x6faf('0x6b'),'attributes':['id',_0x6faf('0x34'),_0x6faf('0x6c'),_0x6faf('0x6d'),_0x6faf('0x6e')],'raw':!![]}]})[_0x6faf('0x2d')](function(_0x2c106e){if(_0x2c106e){var _0x2aead2=_[_0x6faf('0x6f')](_0x2c106e,function(_0xb97d1a){var _0xbf71b6=_0xb97d1a['get']({'plain':!![]});return _0xbf71b6['Agents'];});return db['SmsQueue'][_0x6faf('0x50')]({'where':{'id':_0x552136['params']['id']}})[_0x6faf('0x2d')](function(_0xc093e6){return db[_0x6faf('0x70')]['transaction'](function(_0x143f21){return _0xc093e6[_0x6faf('0x68')](_0x17ce4c,{'transaction':_0x143f21})[_0x6faf('0x2d')](function(){return BPromise[_0x6faf('0x71')](_0x2aead2,function(_0x309257){return db[_0x6faf('0x59')]['findOrCreate']({'where':{'UserId':_0x309257['id'],'SmsQueueId':_0x552136[_0x6faf('0x4d')]['id']},'transaction':_0x143f21});});})[_0x6faf('0x2d')](function(){_0x2aead2[_0x6faf('0x72')](function(_0x4e9e25){socket['emit'](_0x6faf('0x73'),{'UserId':_0x4e9e25['id'],'SmsQueueId':_0xc093e6['id']});});});});});}})[_0x6faf('0x2d')](respondWithStatusCode(_0x26bcc3,null))[_0x6faf('0x4b')](handleError(_0x26bcc3,null));};exports[_0x6faf('0x74')]=function(_0x39b27e,_0x3da993,_0x141cb0){return db[_0x6faf('0x6a')][_0x6faf('0x4a')]({'where':{'id':_0x39b27e[_0x6faf('0x3c')][_0x6faf('0x69')]},'attributes':['id'],'include':[{'model':db[_0x6faf('0x5c')],'as':_0x6faf('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x6faf('0x2d')](handleEntityNotFound(_0x3da993,null))[_0x6faf('0x2d')](function(_0x472f39){var _0x787fe3=_[_0x6faf('0x3b')](_0x472f39,'id');var _0xe42a80=[];var _0x4ae87a=[];var _0x277db1=squel[_0x6faf('0x75')]();_0x277db1[_0x6faf('0x76')](_0x6faf('0x77'))['from'](_0x6faf('0x78'),'tq')['join'](_0x6faf('0x79'),'ut',_0x6faf('0x7a'))['where']('SmsQueueId\x20=\x20?',_0x39b27e[_0x6faf('0x4d')]['id']);for(var _0x14ff05=0x0;_0x14ff05<_0x472f39['length'];_0x14ff05+=0x1){let _0x38d6cd=_0x472f39[_0x14ff05];for(var _0x3ead64=0x0;_0x3ead64<_0x38d6cd['Agents']['length'];_0x3ead64+=0x1){let _0x32d7b4=_0x38d6cd[_0x6faf('0x6b')][_0x3ead64];var _0x9d8f13=_0x277db1['clone']();_0x9d8f13['where'](_0x6faf('0x7b'),_0x32d7b4['id']);_0x4ae87a[_0x6faf('0x7c')](db['sequelize'][_0x6faf('0x3c')](_0x9d8f13[_0x6faf('0x7d')](),{'type':db['sequelize'][_0x6faf('0x7e')][_0x6faf('0x7f')]})['then'](function(_0x34ca2a){if(_0x34ca2a['length']===0x1){return _0x32d7b4['id'];}else{var _0x4d243f=_[_0x6faf('0x80')](_[_0x6faf('0x3b')](_0x34ca2a,_0x6faf('0x81')),function(_0x1991e3){return _[_0x6faf('0x82')](_0x787fe3,_0x1991e3);});if(_0x4d243f){return _0x32d7b4['id'];}}}));}}return BPromise[_0x6faf('0x83')](_0x4ae87a)[_0x6faf('0x2d')](function(_0x4e131d){_0xe42a80=_(_0xe42a80)[_0x6faf('0x84')](_0x4e131d)[_0x6faf('0x85')]()[_0x6faf('0x86')]();return db[_0x6faf('0x36')]['find']({'where':{'id':_0x39b27e[_0x6faf('0x4d')]['id']}})[_0x6faf('0x2d')](function(_0x3c5953){return db[_0x6faf('0x70')][_0x6faf('0x87')](function(_0x436a2d){return _0x3c5953[_0x6faf('0x74')](_0x39b27e[_0x6faf('0x3c')][_0x6faf('0x69')],{'transaction':_0x436a2d})[_0x6faf('0x2d')](function(){if(!_['isEmpty'](_0xe42a80)){return _0x3c5953[_0x6faf('0x88')](_0xe42a80,{'transaction':_0x436a2d});}})[_0x6faf('0x2d')](function(){_0xe42a80['forEach'](function(_0x5de405){socket['emit'](_0x6faf('0x89'),{'UserId':_0x5de405,'SmsQueueId':_0x3c5953['id']});});});});});});})[_0x6faf('0x2d')](respondWithStatusCode(_0x3da993,null))[_0x6faf('0x4b')](handleError(_0x3da993,null));};exports['addAgents']=function(_0x148215,_0x2f1dbe,_0x284253){return db['SmsQueue'][_0x6faf('0x50')]({'where':{'id':_0x148215[_0x6faf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f1dbe,null))[_0x6faf('0x2d')](function(_0xd2736){if(_0xd2736){return _0xd2736[_0x6faf('0x8a')](_0x148215[_0x6faf('0x52')]['ids'],_[_0x6faf('0x8b')](_0x148215['body'],[_0x6faf('0x69'),'id'])||{})[_0x6faf('0x8c')](function(_0x342d31){for(var _0x3a329e=0x0;_0x3a329e<_0x148215[_0x6faf('0x52')][_0x6faf('0x69')][_0x6faf('0x40')];_0x3a329e+=0x1){socket[_0x6faf('0x8d')]('userSmsQueue:save',{'UserId':Number(_0x148215[_0x6faf('0x52')][_0x6faf('0x69')][_0x3a329e]),'SmsQueueId':Number(_0x148215[_0x6faf('0x4d')]['id'])});}return _0x342d31;});}})['then'](respondWithResult(_0x2f1dbe,null))[_0x6faf('0x4b')](handleError(_0x2f1dbe,null));};exports[_0x6faf('0x88')]=function(_0x329c64,_0x5b5e94,_0x7b4db6){return db['SmsQueue'][_0x6faf('0x50')]({'where':{'id':_0x329c64['params']['id']}})[_0x6faf('0x2d')](handleEntityNotFound(_0x5b5e94,null))[_0x6faf('0x2d')](function(_0x49b7fe){if(_0x49b7fe){return _0x49b7fe[_0x6faf('0x88')](_0x329c64[_0x6faf('0x3c')][_0x6faf('0x69')])[_0x6faf('0x2d')](function(){if(_[_0x6faf('0x8e')](_0x329c64['query'][_0x6faf('0x69')])){for(var _0x3b9f65=0x0;_0x3b9f65<_0x329c64[_0x6faf('0x3c')][_0x6faf('0x69')]['length'];_0x3b9f65+=0x1){socket[_0x6faf('0x8d')](_0x6faf('0x89'),{'UserId':Number(_0x329c64[_0x6faf('0x3c')][_0x6faf('0x69')][_0x3b9f65]),'SmsQueueId':Number(_0x329c64[_0x6faf('0x4d')]['id'])});}}else{socket['emit'](_0x6faf('0x89'),{'UserId':Number(_0x329c64['query'][_0x6faf('0x69')]),'SmsQueueId':Number(_0x329c64['params']['id'])});}});}})[_0x6faf('0x2d')](respondWithStatusCode(_0x5b5e94,null))['catch'](handleError(_0x5b5e94,null));};exports[_0x6faf('0x8f')]=function(_0x420f62,_0x212439,_0x3541f3){var _0x42c6fd={};var _0x9e8906={};var _0xd90f15;var _0x5c7aea;return db[_0x6faf('0x36')][_0x6faf('0x65')]({'where':{'id':_0x420f62[_0x6faf('0x4d')]['id']}})[_0x6faf('0x2d')](handleEntityNotFound(_0x212439,null))[_0x6faf('0x2d')](function(_0x365e6d){if(_0x365e6d){_0xd90f15=_0x365e6d;_0x9e8906[_0x6faf('0x3a')]=_['keys'](db['User']['rawAttributes']);_0x9e8906[_0x6faf('0x3c')]=_[_0x6faf('0x3d')](_0x420f62[_0x6faf('0x3c')]);_0x9e8906['filters']=_[_0x6faf('0x4f')](_0x9e8906['model'],_0x9e8906[_0x6faf('0x3c')]);_0x42c6fd[_0x6faf('0x3e')]=_[_0x6faf('0x4f')](_0x9e8906[_0x6faf('0x3a')],qs['fields'](_0x420f62[_0x6faf('0x3c')][_0x6faf('0x3f')]));_0x42c6fd[_0x6faf('0x3e')]=_0x42c6fd['attributes'][_0x6faf('0x40')]?_0x42c6fd[_0x6faf('0x3e')]:_0x9e8906['model'];_0x42c6fd[_0x6faf('0x5a')]=qs[_0x6faf('0x42')](_0x420f62[_0x6faf('0x3c')][_0x6faf('0x42')]);_0x42c6fd[_0x6faf('0x43')]=qs[_0x6faf('0x4e')](_[_0x6faf('0x44')](_0x420f62[_0x6faf('0x3c')],_0x9e8906[_0x6faf('0x4e')]));if(_0x420f62[_0x6faf('0x3c')][_0x6faf('0x47')]){_0x42c6fd[_0x6faf('0x43')]=_[_0x6faf('0x45')](_0x42c6fd['where'],{'$or':_['map'](_0x42c6fd[_0x6faf('0x3e')],function(_0x530f48){var _0x34f4ef={};_0x34f4ef[_0x530f48]={'$like':'%'+_0x420f62[_0x6faf('0x3c')][_0x6faf('0x47')]+'%'};return _0x34f4ef;})});}_0x42c6fd=_[_0x6faf('0x45')]({},_0x42c6fd,_0x420f62[_0x6faf('0x5b')]);return _0xd90f15[_0x6faf('0x8f')](_0x42c6fd);}})[_0x6faf('0x2d')](function(_0xd3bf0e){if(_0xd3bf0e){_0x5c7aea=_0xd3bf0e[_0x6faf('0x40')];if(!_0x420f62[_0x6faf('0x3c')][_0x6faf('0x41')](_0x6faf('0x66'))){_0x42c6fd['limit']=qs[_0x6faf('0x25')](_0x420f62[_0x6faf('0x3c')][_0x6faf('0x25')]);_0x42c6fd[_0x6faf('0x23')]=qs[_0x6faf('0x23')](_0x420f62[_0x6faf('0x3c')][_0x6faf('0x23')]);}return _0xd90f15[_0x6faf('0x8f')](_0x42c6fd);}})[_0x6faf('0x2d')](function(_0x13cafb){if(_0x13cafb){return _0x13cafb?{'count':_0x5c7aea,'rows':_0x13cafb}:null;}})[_0x6faf('0x2d')](respondWithResult(_0x212439,null))[_0x6faf('0x4b')](handleError(_0x212439,null));}; \ No newline at end of file +var _0x61f1=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserSmsQueue','order','SmsQueueId','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','each','forEach','userSmsQueue:save','removeTeams','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5ac950,_0x4126ed){var _0x44f7b4=function(_0x3707ba){while(--_0x3707ba){_0x5ac950['push'](_0x5ac950['shift']());}};_0x44f7b4(++_0x4126ed);}(_0x61f1,0x18a));var _0x161f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61f1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x161f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x161f('0x1'));var rp=require(_0x161f('0x2'));var moment=require(_0x161f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x161f('0x4'));var path=require(_0x161f('0x5'));var sox=require('sox');var csv=require(_0x161f('0x6'));var ejs=require(_0x161f('0x7'));var fs=require('fs');var fs_extra=require(_0x161f('0x8'));var _=require(_0x161f('0x9'));var squel=require(_0x161f('0xa'));var crypto=require('crypto');var jsforce=require(_0x161f('0xb'));var deskjs=require(_0x161f('0xc'));var toCsv=require(_0x161f('0x6'));var querystring=require(_0x161f('0xd'));var Papa=require(_0x161f('0xe'));var Redis=require(_0x161f('0xf'));var authService=require(_0x161f('0x10'));var qs=require(_0x161f('0x11'));var as=require(_0x161f('0x12'));var hardwareService=require(_0x161f('0x13'));var logger=require(_0x161f('0x14'))('api');var utils=require(_0x161f('0x15'));var config=require(_0x161f('0x16'));var licenseUtil=require(_0x161f('0x17'));var db=require(_0x161f('0x18'))['db'];config[_0x161f('0x19')]=_['defaults'](config[_0x161f('0x19')],{'host':_0x161f('0x1a'),'port':0x18eb});var socket=require(_0x161f('0x1b'))(new Redis(config[_0x161f('0x19')]));require('./smsQueue.socket')[_0x161f('0x1c')](socket);function respondWithStatusCode(_0x3a80c4,_0x2189e0){_0x2189e0=_0x2189e0||0xcc;return function(_0x17fcd7){if(_0x17fcd7){return _0x3a80c4[_0x161f('0x1d')](_0x2189e0);}return _0x3a80c4[_0x161f('0x1e')](_0x2189e0)['end']();};}function respondWithResult(_0x486261,_0x3270f3){_0x3270f3=_0x3270f3||0xc8;return function(_0x49dffc){if(_0x49dffc){return _0x486261[_0x161f('0x1e')](_0x3270f3)['json'](_0x49dffc);}};}function respondWithFilteredResult(_0x325d4c,_0x11ff25){return function(_0x2cf920){if(_0x2cf920){var _0x561a13=typeof _0x11ff25[_0x161f('0x1f')]==='undefined'&&typeof _0x11ff25[_0x161f('0x20')]===_0x161f('0x21');var _0x10fd8e=_0x2cf920[_0x161f('0x22')];var _0x266e1a=_0x561a13?0x0:_0x11ff25[_0x161f('0x1f')];var _0x2ddab0=_0x561a13?_0x2cf920[_0x161f('0x22')]:_0x11ff25[_0x161f('0x1f')]+_0x11ff25[_0x161f('0x20')];var _0xdba48d;if(_0x2ddab0>=_0x10fd8e){_0x2ddab0=_0x10fd8e;_0xdba48d=0xc8;}else{_0xdba48d=0xce;}_0x325d4c[_0x161f('0x1e')](_0xdba48d);return _0x325d4c[_0x161f('0x23')]('Content-Range',_0x266e1a+'-'+_0x2ddab0+'/'+_0x10fd8e)[_0x161f('0x24')](_0x2cf920);}return null;};}function patchUpdates(_0xc6fc5e){return function(_0x3cd9f3){try{jsonpatch['apply'](_0x3cd9f3,_0xc6fc5e,!![]);}catch(_0x5966d6){return BPromise[_0x161f('0x25')](_0x5966d6);}return _0x3cd9f3[_0x161f('0x26')]();};}function saveUpdates(_0x161d91,_0x17ecd5){return function(_0x2a1f5f){if(_0x2a1f5f){return _0x2a1f5f['update'](_0x161d91)[_0x161f('0x27')](function(_0x2b501f){return _0x2b501f;});}return null;};}function removeEntity(_0x2ad3d2,_0x4c1cac){return function(_0x157709){if(_0x157709){return _0x157709[_0x161f('0x28')]()[_0x161f('0x27')](function(){var _0x413c75=_0x157709[_0x161f('0x29')]({'plain':!![]});var _0x2470ba='SmsQueues';return db[_0x161f('0x2a')][_0x161f('0x28')]({'where':{'type':_0x2470ba,'resourceId':_0x413c75['id']}})[_0x161f('0x27')](function(){return _0x157709;});})[_0x161f('0x27')](function(){_0x2ad3d2[_0x161f('0x1e')](0xcc)[_0x161f('0x2b')]();});}};}function handleEntityNotFound(_0x589793,_0x18e910){return function(_0x3c5717){if(!_0x3c5717){_0x589793[_0x161f('0x1d')](0x194);}return _0x3c5717;};}function handleError(_0x4fbf5f,_0x2583dc){_0x2583dc=_0x2583dc||0x1f4;return function(_0x2f4d71){logger[_0x161f('0x2c')](_0x2f4d71[_0x161f('0x2d')]);if(_0x2f4d71[_0x161f('0x2e')]){delete _0x2f4d71[_0x161f('0x2e')];}_0x4fbf5f[_0x161f('0x1e')](_0x2583dc)[_0x161f('0x2f')](_0x2f4d71);};}exports['index']=function(_0x494d8c,_0xae1111){var _0x3d4dd0={},_0x259e5c={},_0x47b26b={'count':0x0,'rows':[]};var _0x5b24b3=_['map'](db[_0x161f('0x30')][_0x161f('0x31')],function(_0x4c6555){return{'name':_0x4c6555[_0x161f('0x32')],'type':_0x4c6555[_0x161f('0x33')][_0x161f('0x34')]};});_0x259e5c[_0x161f('0x35')]=_['map'](_0x5b24b3,_0x161f('0x2e'));_0x259e5c['query']=_[_0x161f('0x36')](_0x494d8c[_0x161f('0x37')]);_0x259e5c[_0x161f('0x38')]=_[_0x161f('0x39')](_0x259e5c[_0x161f('0x35')],_0x259e5c[_0x161f('0x37')]);_0x3d4dd0[_0x161f('0x3a')]=_[_0x161f('0x39')](_0x259e5c[_0x161f('0x35')],qs[_0x161f('0x3b')](_0x494d8c['query'][_0x161f('0x3b')]));_0x3d4dd0['attributes']=_0x3d4dd0[_0x161f('0x3a')][_0x161f('0x3c')]?_0x3d4dd0['attributes']:_0x259e5c[_0x161f('0x35')];if(!_0x494d8c[_0x161f('0x37')][_0x161f('0x3d')](_0x161f('0x3e'))){_0x3d4dd0['limit']=qs[_0x161f('0x20')](_0x494d8c[_0x161f('0x37')]['limit']);_0x3d4dd0['offset']=qs['offset'](_0x494d8c[_0x161f('0x37')][_0x161f('0x1f')]);}_0x3d4dd0['order']=qs[_0x161f('0x3f')](_0x494d8c['query']['sort']);_0x3d4dd0[_0x161f('0x40')]=qs[_0x161f('0x38')](_[_0x161f('0x41')](_0x494d8c['query'],_0x259e5c[_0x161f('0x38')]),_0x5b24b3);if(_0x494d8c[_0x161f('0x37')][_0x161f('0x42')]){_0x3d4dd0[_0x161f('0x40')]=_[_0x161f('0x43')](_0x3d4dd0[_0x161f('0x40')],{'$or':_[_0x161f('0x44')](_0x5b24b3,function(_0x33854c){if(_0x33854c[_0x161f('0x33')]!==_0x161f('0x45')){var _0x1553d5={};_0x1553d5[_0x33854c[_0x161f('0x2e')]]={'$like':'%'+_0x494d8c[_0x161f('0x37')]['filter']+'%'};return _0x1553d5;}})});}_0x3d4dd0=_['merge']({},_0x3d4dd0,_0x494d8c[_0x161f('0x46')]);var _0x7670d1={'where':_0x3d4dd0[_0x161f('0x40')]};return db[_0x161f('0x30')]['count'](_0x7670d1)[_0x161f('0x27')](function(_0x2972d3){_0x47b26b[_0x161f('0x22')]=_0x2972d3;if(_0x494d8c[_0x161f('0x37')][_0x161f('0x47')]){_0x3d4dd0[_0x161f('0x48')]=[{'all':!![]}];}return db[_0x161f('0x30')]['findAll'](_0x3d4dd0);})[_0x161f('0x27')](function(_0xb00462){_0x47b26b['rows']=_0xb00462;return _0x47b26b;})['then'](respondWithFilteredResult(_0xae1111,_0x3d4dd0))[_0x161f('0x49')](handleError(_0xae1111,null));};exports['show']=function(_0x40b7e7,_0x3162d5){var _0x40808c={'raw':!![],'where':{'id':_0x40b7e7[_0x161f('0x4a')]['id']}},_0x413316={};_0x413316[_0x161f('0x35')]=_[_0x161f('0x36')](db[_0x161f('0x30')]['rawAttributes']);_0x413316[_0x161f('0x37')]=_[_0x161f('0x36')](_0x40b7e7[_0x161f('0x37')]);_0x413316[_0x161f('0x38')]=_[_0x161f('0x39')](_0x413316[_0x161f('0x35')],_0x413316['query']);_0x40808c[_0x161f('0x3a')]=_[_0x161f('0x39')](_0x413316[_0x161f('0x35')],qs[_0x161f('0x3b')](_0x40b7e7[_0x161f('0x37')]['fields']));_0x40808c['attributes']=_0x40808c['attributes']['length']?_0x40808c[_0x161f('0x3a')]:_0x413316['model'];if(_0x40b7e7[_0x161f('0x37')]['includeAll']){_0x40808c[_0x161f('0x48')]=[{'all':!![]}];}_0x40808c=_[_0x161f('0x43')]({},_0x40808c,_0x40b7e7[_0x161f('0x46')]);return db['SmsQueue'][_0x161f('0x4b')](_0x40808c)[_0x161f('0x27')](handleEntityNotFound(_0x3162d5,null))['then'](respondWithResult(_0x3162d5,null))['catch'](handleError(_0x3162d5,null));};exports[_0x161f('0x4c')]=function(_0x53c52d,_0x171304){return db['SmsQueue'][_0x161f('0x4c')](_0x53c52d[_0x161f('0x4d')],{})[_0x161f('0x27')](function(_0x3f2ebb){var _0x14cea7=_0x53c52d[_0x161f('0x4e')][_0x161f('0x29')]({'plain':!![]});if(!_0x14cea7)throw new Error(_0x161f('0x4f'));if(_0x14cea7[_0x161f('0x50')]===_0x161f('0x4e')){var _0x1a052b=_0x3f2ebb[_0x161f('0x29')]({'plain':!![]});var _0x26623f=_0x161f('0x51');return db[_0x161f('0x52')][_0x161f('0x4b')]({'where':{'name':_0x26623f,'userProfileId':_0x14cea7[_0x161f('0x53')]},'raw':!![]})['then'](function(_0x48a938){if(_0x48a938&&_0x48a938['autoAssociation']===0x0){return db[_0x161f('0x2a')][_0x161f('0x4c')]({'name':_0x1a052b[_0x161f('0x2e')],'resourceId':_0x1a052b['id'],'type':_0x48a938[_0x161f('0x2e')],'sectionId':_0x48a938['id']},{})[_0x161f('0x27')](function(){return _0x3f2ebb;});}else{return _0x3f2ebb;}})[_0x161f('0x49')](function(_0xa34fa0){logger[_0x161f('0x2c')](_0x161f('0x54'),_0xa34fa0);throw _0xa34fa0;});}return _0x3f2ebb;})[_0x161f('0x27')](respondWithResult(_0x171304,0xc9))[_0x161f('0x49')](handleError(_0x171304,null));};exports['update']=function(_0x6f438f,_0x45cfff){if(_0x6f438f['body']['id']){delete _0x6f438f[_0x161f('0x4d')]['id'];}return db[_0x161f('0x30')][_0x161f('0x4b')]({'where':{'id':_0x6f438f[_0x161f('0x4a')]['id']}})[_0x161f('0x27')](handleEntityNotFound(_0x45cfff,null))[_0x161f('0x27')](saveUpdates(_0x6f438f[_0x161f('0x4d')],null))[_0x161f('0x27')](respondWithResult(_0x45cfff,null))[_0x161f('0x49')](handleError(_0x45cfff,null));};exports['destroy']=function(_0x27e5f4,_0x2b5611){return db[_0x161f('0x30')][_0x161f('0x4b')]({'where':{'id':_0x27e5f4['params']['id']}})['then'](handleEntityNotFound(_0x2b5611,null))[_0x161f('0x27')](removeEntity(_0x2b5611,null))[_0x161f('0x49')](handleError(_0x2b5611,null));};exports['describe']=function(_0x3e2a7c,_0x12d503){return db[_0x161f('0x30')]['describe']()[_0x161f('0x27')](respondWithResult(_0x12d503,null))[_0x161f('0x49')](handleError(_0x12d503,null));};exports[_0x161f('0x55')]=function(_0x536c7f,_0x20e9e8,_0x192bda){var _0x4b3388={'raw':!![],'where':{}},_0x444dad={},_0x10bc18;return db['SmsQueue'][_0x161f('0x56')]({'where':{'id':_0x536c7f[_0x161f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20e9e8,null))['then'](function(_0x1dc957){if(_0x1dc957){_0x10bc18=_0x1dc957[_0x161f('0x29')]({'plain':!![]});_0x444dad[_0x161f('0x35')]=_['keys'](db[_0x161f('0x57')][_0x161f('0x31')]);_0x444dad['query']=_[_0x161f('0x36')](_0x536c7f['query']);_0x444dad[_0x161f('0x38')]=_[_0x161f('0x39')](_0x444dad['model'],_0x444dad[_0x161f('0x37')]);_0x4b3388[_0x161f('0x3a')]=_[_0x161f('0x39')](_0x444dad[_0x161f('0x35')],qs[_0x161f('0x3b')](_0x536c7f[_0x161f('0x37')][_0x161f('0x3b')]));_0x4b3388[_0x161f('0x3a')]=_0x4b3388[_0x161f('0x3a')][_0x161f('0x3c')]?_0x4b3388[_0x161f('0x3a')]:_0x444dad['model'];if(!_0x536c7f[_0x161f('0x37')][_0x161f('0x3d')](_0x161f('0x3e'))){_0x4b3388['limit']=qs['limit'](_0x536c7f[_0x161f('0x37')][_0x161f('0x20')]);_0x4b3388[_0x161f('0x1f')]=qs[_0x161f('0x1f')](_0x536c7f['query'][_0x161f('0x1f')]);}_0x4b3388[_0x161f('0x58')]=qs[_0x161f('0x3f')](_0x536c7f[_0x161f('0x37')]['sort']);_0x4b3388[_0x161f('0x40')]=qs[_0x161f('0x38')](_[_0x161f('0x41')](_0x536c7f[_0x161f('0x37')],_0x444dad[_0x161f('0x38')]));_0x4b3388[_0x161f('0x40')][_0x161f('0x59')]=_0x1dc957['id'];if(_0x536c7f[_0x161f('0x37')][_0x161f('0x42')]){_0x4b3388['where']=_[_0x161f('0x43')](_0x4b3388[_0x161f('0x40')],{'$or':_[_0x161f('0x44')](_0x4b3388[_0x161f('0x3a')],function(_0x3ee08b){var _0x53f793={};_0x53f793[_0x3ee08b]={'$like':'%'+_0x536c7f['query'][_0x161f('0x42')]+'%'};return _0x53f793;})});}_0x4b3388=_[_0x161f('0x43')]({},_0x4b3388,_0x536c7f['options']);return db['UserSmsQueue'][_0x161f('0x5a')](_0x4b3388);}})['then'](function(_0x39a798){if(_0x39a798){return db[_0x161f('0x5b')]['findAndCountAll']({'where':{'id':_[_0x161f('0x44')](_0x39a798,_0x161f('0x5c')),'role':_0x161f('0x5d')},'attributes':['id',_0x161f('0x2e'),_0x161f('0x5e'),_0x161f('0x5f'),_0x161f('0x60')]});}})[_0x161f('0x27')](function(_0x236caf){if(_0x236caf){return{'count':_0x236caf['count'],'rows':_['map'](_0x236caf[_0x161f('0x61')],function(_0x5e3796){return{'membername':_0x5e3796[_0x161f('0x2e')],'UserId':_0x5e3796['id'],'queue_name':_0x10bc18['name'],'SmsQueueId':_0x10bc18['id'],'interface':util[_0x161f('0x62')](_0x161f('0x63'),_0x161f('0x64'),_0x5e3796[_0x161f('0x2e')]),'penalty':0x0,'paused':_0x5e3796[_0x161f('0x5e')],'createdAt':_0x5e3796['createdAt'],'updatedAt':_0x5e3796[_0x161f('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x161f('0x27')](respondWithFilteredResult(_0x20e9e8,_0x4b3388))['catch'](handleError(_0x20e9e8,null));};exports[_0x161f('0x65')]=function(_0x69d8c8,_0x315287,_0x1999ef){var _0x5d769e={};var _0x35e3a3={};var _0xc15c8d;var _0x81add;return db[_0x161f('0x30')][_0x161f('0x56')]({'where':{'id':_0x69d8c8['params']['id']}})['then'](handleEntityNotFound(_0x315287,null))['then'](function(_0x46dcd3){if(_0x46dcd3){_0xc15c8d=_0x46dcd3;_0x35e3a3['model']=_[_0x161f('0x36')](db[_0x161f('0x66')]['rawAttributes']);_0x35e3a3[_0x161f('0x37')]=_[_0x161f('0x36')](_0x69d8c8[_0x161f('0x37')]);_0x35e3a3[_0x161f('0x38')]=_[_0x161f('0x39')](_0x35e3a3['model'],_0x35e3a3[_0x161f('0x37')]);_0x5d769e[_0x161f('0x3a')]=_['intersection'](_0x35e3a3[_0x161f('0x35')],qs['fields'](_0x69d8c8[_0x161f('0x37')][_0x161f('0x3b')]));_0x5d769e[_0x161f('0x3a')]=_0x5d769e['attributes'][_0x161f('0x3c')]?_0x5d769e['attributes']:_0x35e3a3[_0x161f('0x35')];_0x5d769e[_0x161f('0x58')]=qs['sort'](_0x69d8c8[_0x161f('0x37')][_0x161f('0x3f')]);_0x5d769e[_0x161f('0x40')]=qs[_0x161f('0x38')](_['pick'](_0x69d8c8[_0x161f('0x37')],_0x35e3a3[_0x161f('0x38')]));if(_0x69d8c8[_0x161f('0x37')][_0x161f('0x42')]){_0x5d769e[_0x161f('0x40')]=_['merge'](_0x5d769e[_0x161f('0x40')],{'$or':_['map'](_0x5d769e[_0x161f('0x3a')],function(_0x1a302d){var _0x5733a0={};_0x5733a0[_0x1a302d]={'$like':'%'+_0x69d8c8['query'][_0x161f('0x42')]+'%'};return _0x5733a0;})});}_0x5d769e=_[_0x161f('0x43')]({},_0x5d769e,_0x69d8c8[_0x161f('0x46')]);return _0xc15c8d['getTeams'](_0x5d769e);}})['then'](function(_0x3bbeca){if(_0x3bbeca){_0x81add=_0x3bbeca['length'];if(!_0x69d8c8[_0x161f('0x37')][_0x161f('0x3d')](_0x161f('0x3e'))){_0x5d769e[_0x161f('0x20')]=qs[_0x161f('0x20')](_0x69d8c8[_0x161f('0x37')][_0x161f('0x20')]);_0x5d769e[_0x161f('0x1f')]=qs[_0x161f('0x1f')](_0x69d8c8[_0x161f('0x37')][_0x161f('0x1f')]);}return _0xc15c8d[_0x161f('0x65')](_0x5d769e);}})['then'](function(_0x3ba2d5){if(_0x3ba2d5){return _0x3ba2d5?{'count':_0x81add,'rows':_0x3ba2d5}:null;}})[_0x161f('0x27')](respondWithResult(_0x315287,null))['catch'](handleError(_0x315287,null));};exports['addTeams']=function(_0x280cdf,_0x3339af,_0x379df4){var _0x4b2afe=_0x280cdf[_0x161f('0x4d')][_0x161f('0x67')];return db[_0x161f('0x66')][_0x161f('0x5a')]({'where':{'id':_0x4b2afe},'attributes':['id'],'include':[{'model':db[_0x161f('0x5b')],'as':'Agents','attributes':['id',_0x161f('0x2e'),_0x161f('0x68'),_0x161f('0x69'),_0x161f('0x6a')],'raw':!![]}]})[_0x161f('0x27')](function(_0x2c7bdc){if(_0x2c7bdc){var _0xa3b5b4=_[_0x161f('0x6b')](_0x2c7bdc,function(_0x33845a){var _0x4808cc=_0x33845a[_0x161f('0x29')]({'plain':!![]});return _0x4808cc[_0x161f('0x6c')];});return db[_0x161f('0x30')]['find']({'where':{'id':_0x280cdf[_0x161f('0x4a')]['id']}})[_0x161f('0x27')](function(_0x5b43c7){return db['sequelize']['transaction'](function(_0x481b11){return _0x5b43c7['addTeams'](_0x4b2afe,{'transaction':_0x481b11})[_0x161f('0x27')](function(){return BPromise[_0x161f('0x6d')](_0xa3b5b4,function(_0x388f5d){return db[_0x161f('0x57')]['findOrCreate']({'where':{'UserId':_0x388f5d['id'],'SmsQueueId':_0x280cdf[_0x161f('0x4a')]['id']},'transaction':_0x481b11});});})[_0x161f('0x27')](function(){_0xa3b5b4[_0x161f('0x6e')](function(_0x479ece){socket['emit'](_0x161f('0x6f'),{'UserId':_0x479ece['id'],'SmsQueueId':_0x5b43c7['id']});});});});});}})['then'](respondWithStatusCode(_0x3339af,null))[_0x161f('0x49')](handleError(_0x3339af,null));};exports[_0x161f('0x70')]=function(_0x51b652,_0x168f30,_0x3bd09f){return db[_0x161f('0x66')][_0x161f('0x5a')]({'where':{'id':_0x51b652[_0x161f('0x37')][_0x161f('0x67')]},'attributes':['id'],'include':[{'model':db[_0x161f('0x5b')],'as':_0x161f('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x161f('0x27')](handleEntityNotFound(_0x168f30,null))[_0x161f('0x27')](function(_0x2cabbe){var _0x19a304=_['map'](_0x2cabbe,'id');var _0x4b2275=[];var _0x2fd349=[];var _0x5ec211=squel['select']();_0x5ec211[_0x161f('0x71')]('tq.TeamId')[_0x161f('0x72')]('team_has_sms_queues','tq')['join'](_0x161f('0x73'),'ut',_0x161f('0x74'))[_0x161f('0x40')](_0x161f('0x75'),_0x51b652['params']['id']);for(var _0x575cb6=0x0;_0x575cb6<_0x2cabbe[_0x161f('0x3c')];_0x575cb6+=0x1){let _0x298c1e=_0x2cabbe[_0x575cb6];for(var _0x17b1e0=0x0;_0x17b1e0<_0x298c1e[_0x161f('0x6c')][_0x161f('0x3c')];_0x17b1e0+=0x1){let _0x1e86ff=_0x298c1e['Agents'][_0x17b1e0];var _0x319589=_0x5ec211[_0x161f('0x76')]();_0x319589[_0x161f('0x40')](_0x161f('0x77'),_0x1e86ff['id']);_0x2fd349[_0x161f('0x78')](db[_0x161f('0x79')][_0x161f('0x37')](_0x319589['toString'](),{'type':db[_0x161f('0x79')][_0x161f('0x7a')]['SELECT']})[_0x161f('0x27')](function(_0x13dc85){if(_0x13dc85[_0x161f('0x3c')]===0x1){return _0x1e86ff['id'];}else{var _0xc07ae1=_[_0x161f('0x7b')](_['map'](_0x13dc85,_0x161f('0x7c')),function(_0x225315){return _[_0x161f('0x7d')](_0x19a304,_0x225315);});if(_0xc07ae1){return _0x1e86ff['id'];}}}));}}return BPromise[_0x161f('0x7e')](_0x2fd349)[_0x161f('0x27')](function(_0xaf0bfc){_0x4b2275=_(_0x4b2275)[_0x161f('0x7f')](_0xaf0bfc)[_0x161f('0x80')]()[_0x161f('0x81')]();return db[_0x161f('0x30')][_0x161f('0x4b')]({'where':{'id':_0x51b652[_0x161f('0x4a')]['id']}})['then'](function(_0x27a53d){return db[_0x161f('0x79')]['transaction'](function(_0x3210c9){return _0x27a53d[_0x161f('0x70')](_0x51b652[_0x161f('0x37')][_0x161f('0x67')],{'transaction':_0x3210c9})[_0x161f('0x27')](function(){if(!_[_0x161f('0x82')](_0x4b2275)){return _0x27a53d[_0x161f('0x83')](_0x4b2275,{'transaction':_0x3210c9});}})['then'](function(){_0x4b2275['forEach'](function(_0x4e3fd8){socket[_0x161f('0x84')](_0x161f('0x85'),{'UserId':_0x4e3fd8,'SmsQueueId':_0x27a53d['id']});});});});});});})[_0x161f('0x27')](respondWithStatusCode(_0x168f30,null))['catch'](handleError(_0x168f30,null));};exports[_0x161f('0x86')]=function(_0x68bc2e,_0x3ee0bf,_0x146738){return db[_0x161f('0x30')][_0x161f('0x4b')]({'where':{'id':_0x68bc2e['params']['id']}})[_0x161f('0x27')](handleEntityNotFound(_0x3ee0bf,null))['then'](function(_0x3bcb81){if(_0x3bcb81){return _0x3bcb81[_0x161f('0x86')](_0x68bc2e['body'][_0x161f('0x67')],_[_0x161f('0x87')](_0x68bc2e[_0x161f('0x4d')],[_0x161f('0x67'),'id'])||{})['spread'](function(_0x2a6f32){for(var _0x68a27=0x0;_0x68a27<_0x68bc2e['body'][_0x161f('0x67')]['length'];_0x68a27+=0x1){socket[_0x161f('0x84')](_0x161f('0x6f'),{'UserId':Number(_0x68bc2e[_0x161f('0x4d')]['ids'][_0x68a27]),'SmsQueueId':Number(_0x68bc2e[_0x161f('0x4a')]['id'])});}return _0x2a6f32;});}})[_0x161f('0x27')](respondWithResult(_0x3ee0bf,null))[_0x161f('0x49')](handleError(_0x3ee0bf,null));};exports[_0x161f('0x83')]=function(_0x1d5e16,_0x689449,_0x538611){return db[_0x161f('0x30')][_0x161f('0x4b')]({'where':{'id':_0x1d5e16[_0x161f('0x4a')]['id']}})[_0x161f('0x27')](handleEntityNotFound(_0x689449,null))['then'](function(_0x4bb250){if(_0x4bb250){return _0x4bb250['removeAgents'](_0x1d5e16[_0x161f('0x37')][_0x161f('0x67')])[_0x161f('0x27')](function(){if(_[_0x161f('0x88')](_0x1d5e16[_0x161f('0x37')][_0x161f('0x67')])){for(var _0x1fef81=0x0;_0x1fef81<_0x1d5e16[_0x161f('0x37')][_0x161f('0x67')][_0x161f('0x3c')];_0x1fef81+=0x1){socket[_0x161f('0x84')](_0x161f('0x85'),{'UserId':Number(_0x1d5e16[_0x161f('0x37')][_0x161f('0x67')][_0x1fef81]),'SmsQueueId':Number(_0x1d5e16[_0x161f('0x4a')]['id'])});}}else{socket[_0x161f('0x84')](_0x161f('0x85'),{'UserId':Number(_0x1d5e16[_0x161f('0x37')][_0x161f('0x67')]),'SmsQueueId':Number(_0x1d5e16['params']['id'])});}});}})['then'](respondWithStatusCode(_0x689449,null))['catch'](handleError(_0x689449,null));};exports[_0x161f('0x89')]=function(_0x3b3dcb,_0x46f779,_0x2c7e8a){var _0x42a992={};var _0x733677={};var _0x2d6773;var _0x2a084e;return db[_0x161f('0x30')][_0x161f('0x56')]({'where':{'id':_0x3b3dcb[_0x161f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46f779,null))['then'](function(_0x5a9cfe){if(_0x5a9cfe){_0x2d6773=_0x5a9cfe;_0x733677['model']=_[_0x161f('0x36')](db['User'][_0x161f('0x31')]);_0x733677[_0x161f('0x37')]=_[_0x161f('0x36')](_0x3b3dcb['query']);_0x733677['filters']=_[_0x161f('0x39')](_0x733677[_0x161f('0x35')],_0x733677[_0x161f('0x37')]);_0x42a992[_0x161f('0x3a')]=_[_0x161f('0x39')](_0x733677[_0x161f('0x35')],qs[_0x161f('0x3b')](_0x3b3dcb['query'][_0x161f('0x3b')]));_0x42a992['attributes']=_0x42a992[_0x161f('0x3a')][_0x161f('0x3c')]?_0x42a992['attributes']:_0x733677[_0x161f('0x35')];_0x42a992[_0x161f('0x58')]=qs[_0x161f('0x3f')](_0x3b3dcb['query'][_0x161f('0x3f')]);_0x42a992[_0x161f('0x40')]=qs[_0x161f('0x38')](_[_0x161f('0x41')](_0x3b3dcb[_0x161f('0x37')],_0x733677[_0x161f('0x38')]));if(_0x3b3dcb[_0x161f('0x37')][_0x161f('0x42')]){_0x42a992['where']=_[_0x161f('0x43')](_0x42a992['where'],{'$or':_[_0x161f('0x44')](_0x42a992[_0x161f('0x3a')],function(_0x284dfb){var _0x36bd84={};_0x36bd84[_0x284dfb]={'$like':'%'+_0x3b3dcb[_0x161f('0x37')][_0x161f('0x42')]+'%'};return _0x36bd84;})});}_0x42a992=_[_0x161f('0x43')]({},_0x42a992,_0x3b3dcb['options']);return _0x2d6773[_0x161f('0x89')](_0x42a992);}})['then'](function(_0x5b6239){if(_0x5b6239){_0x2a084e=_0x5b6239['length'];if(!_0x3b3dcb[_0x161f('0x37')][_0x161f('0x3d')](_0x161f('0x3e'))){_0x42a992[_0x161f('0x20')]=qs[_0x161f('0x20')](_0x3b3dcb[_0x161f('0x37')][_0x161f('0x20')]);_0x42a992[_0x161f('0x1f')]=qs['offset'](_0x3b3dcb[_0x161f('0x37')][_0x161f('0x1f')]);}return _0x2d6773[_0x161f('0x89')](_0x42a992);}})[_0x161f('0x27')](function(_0x47d9b1){if(_0x47d9b1){return _0x47d9b1?{'count':_0x2a084e,'rows':_0x47d9b1}:null;}})[_0x161f('0x27')](respondWithResult(_0x46f779,null))[_0x161f('0x49')](handleError(_0x46f779,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bc714a1..ca1b113 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 _0x769a=['update','remove','emit','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0xd97ecc,_0x5d6a2f){var _0xa70368=function(_0x480cee){while(--_0x480cee){_0xd97ecc['push'](_0xd97ecc['shift']());}};_0xa70368(++_0x5d6a2f);}(_0x769a,0x199));var _0xa769=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0x769a[_0x414655];return _0x237884;};'use strict';var EventEmitter=require(_0xa769('0x0'));var SmsQueue=require(_0xa769('0x1'))['db'][_0xa769('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa769('0x3')](0x0);var events={'afterCreate':_0xa769('0x4'),'afterUpdate':_0xa769('0x5'),'afterDestroy':_0xa769('0x6')};function emitEvent(_0xc42200){return function(_0x4a38e6,_0x5c703f,_0x2a8124){SmsQueueEvents[_0xa769('0x7')](_0xc42200+':'+_0x4a38e6['id'],_0x4a38e6);SmsQueueEvents['emit'](_0xc42200,_0x4a38e6);_0x2a8124(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xa769('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x6d7f=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x31b4d1,_0x10f746){var _0x5b8e63=function(_0x250178){while(--_0x250178){_0x31b4d1['push'](_0x31b4d1['shift']());}};_0x5b8e63(++_0x10f746);}(_0x6d7f,0x1e1));var _0xf6d7=function(_0x88a7f6,_0x2a6ec0){_0x88a7f6=_0x88a7f6-0x0;var _0x5e0f39=_0x6d7f[_0x88a7f6];return _0x5e0f39;};'use strict';var EventEmitter=require(_0xf6d7('0x0'));var SmsQueue=require(_0xf6d7('0x1'))['db'][_0xf6d7('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf6d7('0x3')](0x0);var events={'afterCreate':_0xf6d7('0x4'),'afterUpdate':_0xf6d7('0x5'),'afterDestroy':_0xf6d7('0x6')};function emitEvent(_0x38f58e){return function(_0x480881,_0x2c494c,_0x1951e7){SmsQueueEvents[_0xf6d7('0x7')](_0x38f58e+':'+_0x480881['id'],_0x480881);SmsQueueEvents[_0xf6d7('0x7')](_0x38f58e,_0x480881);_0x1951e7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xf6d7('0x8')](e,emitEvent(event));}}module[_0xf6d7('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 9522661..3afcf22 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 _0xeaa6=['rimraf','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0xcdc568,_0x153b6b){var _0x2c750d=function(_0x577f8a){while(--_0x577f8a){_0xcdc568['push'](_0xcdc568['shift']());}};_0x2c750d(++_0x153b6b);}(_0xeaa6,0xcc));var _0x6eaa=function(_0x308584,_0x25e443){_0x308584=_0x308584-0x0;var _0x57060f=_0xeaa6[_0x308584];return _0x57060f;};'use strict';var _=require(_0x6eaa('0x0'));var util=require(_0x6eaa('0x1'));var logger=require(_0x6eaa('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6eaa('0x3'));var rp=require(_0x6eaa('0x4'));var fs=require('fs');var path=require(_0x6eaa('0x5'));var rimraf=require(_0x6eaa('0x6'));var config=require('../../config/environment');var attributes=require(_0x6eaa('0x7'));module['exports']=function(_0x2aa7e1,_0x5d597f){return _0x2aa7e1[_0x6eaa('0x8')](_0x6eaa('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d7e=['api','moment','request-promise','path','rimraf','./smsQueue.attributes','sms_queues','lodash','util'];(function(_0x50441f,_0x531ddf){var _0x295f23=function(_0x28fc2a){while(--_0x28fc2a){_0x50441f['push'](_0x50441f['shift']());}};_0x295f23(++_0x531ddf);}(_0x3d7e,0x97));var _0xe3d7=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x3d7e[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0xe3d7('0x0'));var util=require(_0xe3d7('0x1'));var logger=require('../../config/logger')(_0xe3d7('0x2'));var moment=require(_0xe3d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3d7('0x4'));var fs=require('fs');var path=require(_0xe3d7('0x5'));var rimraf=require(_0xe3d7('0x6'));var config=require('../../config/environment');var attributes=require(_0xe3d7('0x7'));module['exports']=function(_0x344a0c,_0x299203){return _0x344a0c['define']('SmsQueue',attributes,{'tableName':_0xe3d7('0x8'),'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 e5002ee..5c487de 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 _0xea03=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','find','ShowSmsQueue','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd2be,_0x29d74f){var _0x4415d0=function(_0x169119){while(--_0x169119){_0x3dd2be['push'](_0x3dd2be['shift']());}};_0x4415d0(++_0x29d74f);}(_0xea03,0x6d));var _0x3ea0=function(_0x2f0f90,_0x411945){_0x2f0f90=_0x2f0f90-0x0;var _0x3da03a=_0xea03[_0x2f0f90];return _0x3da03a;};'use strict';var _=require('lodash');var util=require(_0x3ea0('0x0'));var moment=require(_0x3ea0('0x1'));var BPromise=require(_0x3ea0('0x2'));var rs=require(_0x3ea0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ea0('0x4'))['db'];var utils=require(_0x3ea0('0x5'));var logger=require(_0x3ea0('0x6'))('rpc');var config=require(_0x3ea0('0x7'));var jayson=require(_0x3ea0('0x8'));var client=jayson['client'][_0x3ea0('0x9')]({'port':0x232a});config[_0x3ea0('0xa')]=_[_0x3ea0('0xb')](config[_0x3ea0('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ea0('0xa')]));require(_0x3ea0('0xc'))[_0x3ea0('0xd')](socket);function respondWithRpcPromise(_0x1f9fa6,_0x1d0bf9,_0x364d28){return new BPromise(function(_0x378645,_0x39081f){return client[_0x3ea0('0xe')](_0x1f9fa6,_0x364d28)[_0x3ea0('0xf')](function(_0x406c81){logger[_0x3ea0('0x10')](_0x3ea0('0x11'),_0x1d0bf9,_0x3ea0('0x12'));logger[_0x3ea0('0x13')](_0x3ea0('0x14'),_0x1d0bf9,_0x3ea0('0x12'),JSON[_0x3ea0('0x15')](_0x406c81));if(_0x406c81[_0x3ea0('0x16')]){if(_0x406c81[_0x3ea0('0x16')]['code']===0x1f4){logger[_0x3ea0('0x16')](_0x3ea0('0x11'),_0x1d0bf9,_0x406c81[_0x3ea0('0x16')]['message']);return _0x39081f(_0x406c81[_0x3ea0('0x16')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x1d0bf9,_0x406c81[_0x3ea0('0x16')]['message']);return _0x378645(_0x406c81[_0x3ea0('0x16')][_0x3ea0('0x17')]);}else{logger['info'](_0x3ea0('0x11'),_0x1d0bf9,'request\x20sent');_0x378645(_0x406c81[_0x3ea0('0x18')][_0x3ea0('0x17')]);}})[_0x3ea0('0x19')](function(_0x4bcd17){logger[_0x3ea0('0x16')](_0x3ea0('0x11'),_0x1d0bf9,_0x4bcd17);_0x39081f(_0x4bcd17);});});}exports[_0x3ea0('0x1a')]=function(_0x1c6afd){var _0x4db365=this;return new Promise(function(_0x4b4aa5,_0x40fd9e){return db[_0x3ea0('0x1b')][_0x3ea0('0x1c')]({'raw':_0x1c6afd['options']?_0x1c6afd[_0x3ea0('0x1d')][_0x3ea0('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c6afd[_0x3ea0('0x1d')]?_0x1c6afd['options'][_0x3ea0('0x1f')]||null:null,'attributes':_0x1c6afd['options']?_0x1c6afd[_0x3ea0('0x1d')][_0x3ea0('0x20')]||null:null,'limit':_0x1c6afd[_0x3ea0('0x1d')]?_0x1c6afd['options']['limit']||null:null,'include':_0x1c6afd[_0x3ea0('0x1d')]?_0x1c6afd[_0x3ea0('0x1d')][_0x3ea0('0x21')]?_[_0x3ea0('0x22')](_0x1c6afd['options']['include'],function(_0xb08b60){return{'model':db[_0xb08b60['model']],'as':_0xb08b60['as'],'attributes':_0xb08b60['attributes'],'include':_0xb08b60[_0x3ea0('0x21')]?_[_0x3ea0('0x22')](_0xb08b60['include'],function(_0x40c632){return{'model':db[_0x40c632[_0x3ea0('0x23')]],'as':_0x40c632['as'],'attributes':_0x40c632[_0x3ea0('0x20')],'include':_0x40c632['include']?_[_0x3ea0('0x22')](_0x40c632[_0x3ea0('0x21')],function(_0x38f398){return{'model':db[_0x38f398[_0x3ea0('0x23')]],'as':_0x38f398['as'],'attributes':_0x38f398[_0x3ea0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3ea0('0xf')](function(_0x3de3a9){logger[_0x3ea0('0x10')](_0x3ea0('0x1a'),_0x1c6afd);logger[_0x3ea0('0x13')](_0x3ea0('0x1a'),_0x1c6afd,JSON[_0x3ea0('0x15')](_0x3de3a9));_0x4b4aa5(_0x3de3a9);})[_0x3ea0('0x19')](function(_0x2cba81){logger['error'](_0x3ea0('0x1a'),_0x2cba81[_0x3ea0('0x17')],_0x1c6afd);_0x40fd9e(_0x4db365[_0x3ea0('0x16')](0x1f4,_0x2cba81['message']));});});};exports['ShowSmsQueue']=function(_0x1d177c){var _0x484449=this;return new Promise(function(_0x321eb8,_0x316270){return db['SmsQueue'][_0x3ea0('0x24')]({'raw':_0x1d177c[_0x3ea0('0x1d')]?_0x1d177c[_0x3ea0('0x1d')][_0x3ea0('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d177c['options']?_0x1d177c[_0x3ea0('0x1d')]['where']||null:null,'attributes':_0x1d177c['options']?_0x1d177c['options'][_0x3ea0('0x20')]||null:null,'include':_0x1d177c[_0x3ea0('0x1d')]?_0x1d177c[_0x3ea0('0x1d')][_0x3ea0('0x21')]?_[_0x3ea0('0x22')](_0x1d177c['options'][_0x3ea0('0x21')],function(_0x532945){return{'model':db[_0x532945[_0x3ea0('0x23')]],'as':_0x532945['as'],'attributes':_0x532945['attributes'],'include':_0x532945['include']?_['map'](_0x532945[_0x3ea0('0x21')],function(_0x5c632b){return{'model':db[_0x5c632b[_0x3ea0('0x23')]],'as':_0x5c632b['as'],'attributes':_0x5c632b[_0x3ea0('0x20')],'include':_0x5c632b['include']?_['map'](_0x5c632b[_0x3ea0('0x21')],function(_0x1e6bd6){return{'model':db[_0x1e6bd6[_0x3ea0('0x23')]],'as':_0x1e6bd6['as'],'attributes':_0x1e6bd6[_0x3ea0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3ea0('0xf')](function(_0x3b1145){logger[_0x3ea0('0x10')](_0x3ea0('0x25'),_0x1d177c);logger[_0x3ea0('0x13')](_0x3ea0('0x25'),_0x1d177c,JSON[_0x3ea0('0x15')](_0x3b1145));_0x321eb8(_0x3b1145);})[_0x3ea0('0x19')](function(_0x516b81){logger[_0x3ea0('0x16')](_0x3ea0('0x25'),_0x516b81['message'],_0x1d177c);_0x316270(_0x484449[_0x3ea0('0x16')](0x1f4,_0x516b81[_0x3ea0('0x17')]));});});}; \ No newline at end of file +var _0xa36a=['map','model','ShowSmsQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa36a,0x122));var _0xaa36=function(_0x4ef984,_0x13968f){_0x4ef984=_0x4ef984-0x0;var _0x349a98=_0xa36a[_0x4ef984];return _0x349a98;};'use strict';var _=require('lodash');var util=require(_0xaa36('0x0'));var moment=require(_0xaa36('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa36('0x2'));var fs=require('fs');var Redis=require(_0xaa36('0x3'));var db=require(_0xaa36('0x4'))['db'];var utils=require(_0xaa36('0x5'));var logger=require(_0xaa36('0x6'))('rpc');var config=require(_0xaa36('0x7'));var jayson=require(_0xaa36('0x8'));var client=jayson[_0xaa36('0x9')][_0xaa36('0xa')]({'port':0x232a});config[_0xaa36('0xb')]=_['defaults'](config[_0xaa36('0xb')],{'host':_0xaa36('0xc'),'port':0x18eb});var socket=require(_0xaa36('0xd'))(new Redis(config[_0xaa36('0xb')]));require(_0xaa36('0xe'))[_0xaa36('0xf')](socket);function respondWithRpcPromise(_0xac4708,_0x1f3687,_0x8e52d4){return new BPromise(function(_0x3cdcf3,_0x1bad72){return client[_0xaa36('0x10')](_0xac4708,_0x8e52d4)[_0xaa36('0x11')](function(_0x1c43c7){logger['info'](_0xaa36('0x12'),_0x1f3687,_0xaa36('0x13'));logger[_0xaa36('0x14')](_0xaa36('0x15'),_0x1f3687,_0xaa36('0x13'),JSON[_0xaa36('0x16')](_0x1c43c7));if(_0x1c43c7[_0xaa36('0x17')]){if(_0x1c43c7[_0xaa36('0x17')][_0xaa36('0x18')]===0x1f4){logger[_0xaa36('0x17')](_0xaa36('0x12'),_0x1f3687,_0x1c43c7[_0xaa36('0x17')][_0xaa36('0x19')]);return _0x1bad72(_0x1c43c7[_0xaa36('0x17')][_0xaa36('0x19')]);}logger[_0xaa36('0x17')](_0xaa36('0x12'),_0x1f3687,_0x1c43c7[_0xaa36('0x17')]['message']);return _0x3cdcf3(_0x1c43c7[_0xaa36('0x17')]['message']);}else{logger[_0xaa36('0x1a')](_0xaa36('0x12'),_0x1f3687,_0xaa36('0x13'));_0x3cdcf3(_0x1c43c7[_0xaa36('0x1b')][_0xaa36('0x19')]);}})[_0xaa36('0x1c')](function(_0x42e713){logger[_0xaa36('0x17')](_0xaa36('0x12'),_0x1f3687,_0x42e713);_0x1bad72(_0x42e713);});});}exports[_0xaa36('0x1d')]=function(_0x191170){var _0x3aec4e=this;return new Promise(function(_0x16a4b0,_0x1e3d1c){return db[_0xaa36('0x1e')][_0xaa36('0x1f')]({'raw':_0x191170[_0xaa36('0x20')]?_0x191170[_0xaa36('0x20')][_0xaa36('0x21')]===undefined?!![]:![]:!![],'where':_0x191170[_0xaa36('0x20')]?_0x191170[_0xaa36('0x20')][_0xaa36('0x22')]||null:null,'attributes':_0x191170[_0xaa36('0x20')]?_0x191170[_0xaa36('0x20')][_0xaa36('0x23')]||null:null,'limit':_0x191170[_0xaa36('0x20')]?_0x191170['options'][_0xaa36('0x24')]||null:null,'include':_0x191170[_0xaa36('0x20')]?_0x191170['options'][_0xaa36('0x25')]?_[_0xaa36('0x26')](_0x191170['options']['include'],function(_0x256621){return{'model':db[_0x256621['model']],'as':_0x256621['as'],'attributes':_0x256621['attributes'],'include':_0x256621[_0xaa36('0x25')]?_[_0xaa36('0x26')](_0x256621[_0xaa36('0x25')],function(_0x689883){return{'model':db[_0x689883['model']],'as':_0x689883['as'],'attributes':_0x689883['attributes'],'include':_0x689883[_0xaa36('0x25')]?_[_0xaa36('0x26')](_0x689883[_0xaa36('0x25')],function(_0x52637c){return{'model':db[_0x52637c[_0xaa36('0x27')]],'as':_0x52637c['as'],'attributes':_0x52637c[_0xaa36('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa36('0x11')](function(_0x3f5ee7){logger[_0xaa36('0x1a')](_0xaa36('0x1d'),_0x191170);logger[_0xaa36('0x14')](_0xaa36('0x1d'),_0x191170,JSON[_0xaa36('0x16')](_0x3f5ee7));_0x16a4b0(_0x3f5ee7);})[_0xaa36('0x1c')](function(_0x2ccec2){logger[_0xaa36('0x17')](_0xaa36('0x1d'),_0x2ccec2[_0xaa36('0x19')],_0x191170);_0x1e3d1c(_0x3aec4e[_0xaa36('0x17')](0x1f4,_0x2ccec2['message']));});});};exports[_0xaa36('0x28')]=function(_0x3c4878){var _0x3a8b30=this;return new Promise(function(_0x54b92b,_0x5ec268){return db['SmsQueue']['find']({'raw':_0x3c4878[_0xaa36('0x20')]?_0x3c4878[_0xaa36('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3c4878[_0xaa36('0x20')]?_0x3c4878[_0xaa36('0x20')][_0xaa36('0x22')]||null:null,'attributes':_0x3c4878['options']?_0x3c4878[_0xaa36('0x20')][_0xaa36('0x23')]||null:null,'include':_0x3c4878[_0xaa36('0x20')]?_0x3c4878[_0xaa36('0x20')][_0xaa36('0x25')]?_[_0xaa36('0x26')](_0x3c4878['options'][_0xaa36('0x25')],function(_0x27a4b0){return{'model':db[_0x27a4b0[_0xaa36('0x27')]],'as':_0x27a4b0['as'],'attributes':_0x27a4b0[_0xaa36('0x23')],'include':_0x27a4b0[_0xaa36('0x25')]?_[_0xaa36('0x26')](_0x27a4b0[_0xaa36('0x25')],function(_0x309ef0){return{'model':db[_0x309ef0[_0xaa36('0x27')]],'as':_0x309ef0['as'],'attributes':_0x309ef0['attributes'],'include':_0x309ef0['include']?_['map'](_0x309ef0['include'],function(_0x474909){return{'model':db[_0x474909['model']],'as':_0x474909['as'],'attributes':_0x474909[_0xaa36('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa36('0x11')](function(_0x86e7c){logger['info'](_0xaa36('0x28'),_0x3c4878);logger['debug'](_0xaa36('0x28'),_0x3c4878,JSON[_0xaa36('0x16')](_0x86e7c));_0x54b92b(_0x86e7c);})['catch'](function(_0x569085){logger[_0xaa36('0x17')](_0xaa36('0x28'),_0x569085[_0xaa36('0x19')],_0x3c4878);_0x5ec268(_0x3a8b30[_0xaa36('0x17')](0x1f4,_0x569085[_0xaa36('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index bd68fe3..88d563d 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 _0xa3d9=['removeListener','smsQueue:','save','remove','emit'];(function(_0x56af79,_0x1175dd){var _0x1d09aa=function(_0x2cc015){while(--_0x2cc015){_0x56af79['push'](_0x56af79['shift']());}};_0x1d09aa(++_0x1175dd);}(_0xa3d9,0x6b));var _0x9a3d=function(_0x436366,_0x4e627d){_0x436366=_0x436366-0x0;var _0x2c3b6e=_0xa3d9[_0x436366];return _0x2c3b6e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9a3d('0x0'),_0x9a3d('0x1'),'update'];function createListener(_0x3a5dd5,_0x470b65){return function(_0x2e22f6){_0x470b65[_0x9a3d('0x2')](_0x3a5dd5,_0x2e22f6);};}function removeListener(_0x2459aa,_0x6ba964){return function(){SmsQueueEvents[_0x9a3d('0x3')](_0x2459aa,_0x6ba964);};}exports['register']=function(_0xfeda77){for(var _0x439050=0x0,_0x2d46eb=events['length'];_0x439050<_0x2d46eb;_0x439050++){var _0x59a639=events[_0x439050];var _0x4b3158=createListener(_0x9a3d('0x4')+_0x59a639,_0xfeda77);SmsQueueEvents['on'](_0x59a639,_0x4b3158);}}; \ No newline at end of file +var _0x9d71=['removeListener','register','length','smsQueue:','./smsQueue.events','save','update','emit'];(function(_0x1dbd96,_0xb8b383){var _0x37f5bc=function(_0x5c8bb4){while(--_0x5c8bb4){_0x1dbd96['push'](_0x1dbd96['shift']());}};_0x37f5bc(++_0xb8b383);}(_0x9d71,0x134));var _0x19d7=function(_0x1bdb34,_0x1bb9c4){_0x1bdb34=_0x1bdb34-0x0;var _0x582629=_0x9d71[_0x1bdb34];return _0x582629;};'use strict';var SmsQueueEvents=require(_0x19d7('0x0'));var events=[_0x19d7('0x1'),'remove',_0x19d7('0x2')];function createListener(_0x28ba50,_0x1c28d0){return function(_0x26e2f5){_0x1c28d0[_0x19d7('0x3')](_0x28ba50,_0x26e2f5);};}function removeListener(_0x1104d7,_0x392e9f){return function(){SmsQueueEvents[_0x19d7('0x4')](_0x1104d7,_0x392e9f);};}exports[_0x19d7('0x5')]=function(_0x261242){for(var _0x4e43c8=0x0,_0x26e626=events[_0x19d7('0x6')];_0x4e43c8<_0x26e626;_0x4e43c8++){var _0x41d082=events[_0x4e43c8];var _0x537487=createListener(_0x19d7('0x7')+_0x41d082,_0x261242);SmsQueueEvents['on'](_0x41d082,_0x537487);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a505521..2ac92c0 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 _0x49c4=['/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x3f1c2b,_0xc288d6){var _0xd5e7be=function(_0x1575e7){while(--_0x1575e7){_0x3f1c2b['push'](_0x3f1c2b['shift']());}};_0xd5e7be(++_0xc288d6);}(_0x49c4,0x9b));var _0x449c=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x49c4[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x449c('0x0'));var util=require('util');var path=require(_0x449c('0x1'));var timeout=require(_0x449c('0x2'));var express=require(_0x449c('0x3'));var router=express[_0x449c('0x4')]();var fs_extra=require(_0x449c('0x5'));var auth=require(_0x449c('0x6'));var interaction=require(_0x449c('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x449c('0x8')]('/',auth[_0x449c('0x9')](),controller[_0x449c('0xa')]);router[_0x449c('0x8')](_0x449c('0xb'),auth[_0x449c('0x9')](),controller[_0x449c('0xc')]);router[_0x449c('0x8')](_0x449c('0xd'),auth[_0x449c('0x9')](),controller[_0x449c('0xe')]);router[_0x449c('0xf')]('/',auth[_0x449c('0x9')](),controller[_0x449c('0x10')]);router[_0x449c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x449c('0x12')]);router[_0x449c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x449c('0x14')]=router; \ No newline at end of file +var _0xf37f=['isAuthenticated','index','/describe','describe','show','post','put','/:id','update','destroy','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x2062e5,_0x20051e){var _0x3bcf3d=function(_0x139bae){while(--_0x139bae){_0x2062e5['push'](_0x2062e5['shift']());}};_0x3bcf3d(++_0x20051e);}(_0xf37f,0x11a));var _0xff37=function(_0x369bdf,_0x56da7d){_0x369bdf=_0x369bdf-0x0;var _0x5492bf=_0xf37f[_0x369bdf];return _0x5492bf;};'use strict';var multer=require('multer');var util=require(_0xff37('0x0'));var path=require('path');var timeout=require(_0xff37('0x1'));var express=require(_0xff37('0x2'));var router=express['Router']();var fs_extra=require(_0xff37('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xff37('0x4'));var config=require(_0xff37('0x5'));var controller=require('./smsQueueReport.controller');router[_0xff37('0x6')]('/',auth[_0xff37('0x7')](),controller[_0xff37('0x8')]);router['get'](_0xff37('0x9'),auth[_0xff37('0x7')](),controller[_0xff37('0xa')]);router['get']('/:id',auth[_0xff37('0x7')](),controller[_0xff37('0xb')]);router[_0xff37('0xc')]('/',auth[_0xff37('0x7')](),controller['create']);router[_0xff37('0xd')](_0xff37('0xe'),auth[_0xff37('0x7')](),controller[_0xff37('0xf')]);router['delete'](_0xff37('0xe'),auth[_0xff37('0x7')](),controller[_0xff37('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 24c19da..b248df0 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 _0xb3f3=['sequelize','STRING','DATE'];(function(_0xcd0e3c,_0x50ac64){var _0x333329=function(_0x59d4f1){while(--_0x59d4f1){_0xcd0e3c['push'](_0xcd0e3c['shift']());}};_0x333329(++_0x50ac64);}(_0xb3f3,0xcf));var _0x3b3f=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0xb3f3[_0x2136a6];return _0x55b948;};'use strict';var moment=require('moment');var Sequelize=require(_0x3b3f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3b3f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3b3f('0x1')]},'joinAt':{'type':Sequelize[_0x3b3f('0x2')]},'leaveAt':{'type':Sequelize[_0x3b3f('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3b3f('0x1')]}}; \ No newline at end of file +var _0xf768=['moment','exports','STRING','DATE'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf768,0x1dc));var _0x8f76=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf768[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x8f76('0x0'));var Sequelize=require('sequelize');module[_0x8f76('0x1')]={'uniqueid':{'type':Sequelize[_0x8f76('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8f76('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8f76('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8f76('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5b13631..9abf899 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 _0x4dd4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','name','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','SmsQueueReport','rawAttributes','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3573d7,_0x228649){var _0x43a51b=function(_0x154727){while(--_0x154727){_0x3573d7['push'](_0x3573d7['shift']());}};_0x43a51b(++_0x228649);}(_0x4dd4,0xd9));var _0x44dd=function(_0x4e7a44,_0x3c3f5e){_0x4e7a44=_0x4e7a44-0x0;var _0x328515=_0x4dd4[_0x4e7a44];return _0x328515;};'use strict';var emlformat=require(_0x44dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44dd('0x2'));var moment=require('moment');var BPromise=require(_0x44dd('0x3'));var Mustache=require(_0x44dd('0x4'));var util=require(_0x44dd('0x5'));var path=require(_0x44dd('0x6'));var sox=require(_0x44dd('0x7'));var csv=require('to-csv');var ejs=require(_0x44dd('0x8'));var fs=require('fs');var fs_extra=require(_0x44dd('0x9'));var _=require(_0x44dd('0xa'));var squel=require(_0x44dd('0xb'));var crypto=require('crypto');var jsforce=require(_0x44dd('0xc'));var deskjs=require(_0x44dd('0xd'));var toCsv=require(_0x44dd('0xe'));var querystring=require(_0x44dd('0xf'));var Papa=require(_0x44dd('0x10'));var Redis=require(_0x44dd('0x11'));var authService=require(_0x44dd('0x12'));var qs=require(_0x44dd('0x13'));var as=require(_0x44dd('0x14'));var hardwareService=require(_0x44dd('0x15'));var logger=require(_0x44dd('0x16'))('api');var utils=require(_0x44dd('0x17'));var config=require(_0x44dd('0x18'));var licenseUtil=require(_0x44dd('0x19'));var db=require(_0x44dd('0x1a'))['db'];function respondWithStatusCode(_0x14e775,_0x3d3283){_0x3d3283=_0x3d3283||0xcc;return function(_0x5a279d){if(_0x5a279d){return _0x14e775[_0x44dd('0x1b')](_0x3d3283);}return _0x14e775['status'](_0x3d3283)[_0x44dd('0x1c')]();};}function respondWithResult(_0x2dec2f,_0x46fac8){_0x46fac8=_0x46fac8||0xc8;return function(_0x14439f){if(_0x14439f){return _0x2dec2f[_0x44dd('0x1d')](_0x46fac8)[_0x44dd('0x1e')](_0x14439f);}};}function respondWithFilteredResult(_0x2bdc91,_0x3cbb3f){return function(_0x2d5ee9){if(_0x2d5ee9){var _0x508268=typeof _0x3cbb3f[_0x44dd('0x1f')]===_0x44dd('0x20')&&typeof _0x3cbb3f[_0x44dd('0x21')]===_0x44dd('0x20');var _0x31b258=_0x2d5ee9['count'];var _0x6df1fe=_0x508268?0x0:_0x3cbb3f[_0x44dd('0x1f')];var _0x3ec7d6=_0x508268?_0x2d5ee9['count']:_0x3cbb3f['offset']+_0x3cbb3f[_0x44dd('0x21')];var _0x1f558b;if(_0x3ec7d6>=_0x31b258){_0x3ec7d6=_0x31b258;_0x1f558b=0xc8;}else{_0x1f558b=0xce;}_0x2bdc91[_0x44dd('0x1d')](_0x1f558b);return _0x2bdc91[_0x44dd('0x22')](_0x44dd('0x23'),_0x6df1fe+'-'+_0x3ec7d6+'/'+_0x31b258)[_0x44dd('0x1e')](_0x2d5ee9);}return null;};}function patchUpdates(_0x17de41){return function(_0x2e0ec1){try{jsonpatch['apply'](_0x2e0ec1,_0x17de41,!![]);}catch(_0x20d918){return BPromise[_0x44dd('0x24')](_0x20d918);}return _0x2e0ec1[_0x44dd('0x25')]();};}function saveUpdates(_0x3c3647,_0x2027ec){return function(_0x32be94){if(_0x32be94){return _0x32be94[_0x44dd('0x26')](_0x3c3647)[_0x44dd('0x27')](function(_0x3c05fd){return _0x3c05fd;});}return null;};}function removeEntity(_0x23cfd0,_0x5be802){return function(_0x3ebc3b){if(_0x3ebc3b){return _0x3ebc3b[_0x44dd('0x28')]()['then'](function(){_0x23cfd0['status'](0xcc)[_0x44dd('0x1c')]();});}};}function handleEntityNotFound(_0x4bb0c7,_0x2cea7b){return function(_0x36b4c6){if(!_0x36b4c6){_0x4bb0c7['sendStatus'](0x194);}return _0x36b4c6;};}function handleError(_0x2cabb2,_0xa7671e){_0xa7671e=_0xa7671e||0x1f4;return function(_0x2a19c4){logger[_0x44dd('0x29')](_0x2a19c4['stack']);if(_0x2a19c4[_0x44dd('0x2a')]){delete _0x2a19c4[_0x44dd('0x2a')];}_0x2cabb2[_0x44dd('0x1d')](_0xa7671e)['send'](_0x2a19c4);};}exports['index']=function(_0xe0869a,_0x3537e1){var _0x1ea01e={},_0x30181f={},_0x5a7640={'count':0x0,'rows':[]};var _0x3d14e2=_[_0x44dd('0x2b')](db['SmsQueueReport']['rawAttributes'],function(_0x42a778){return{'name':_0x42a778[_0x44dd('0x2c')],'type':_0x42a778[_0x44dd('0x2d')][_0x44dd('0x2e')]};});_0x30181f['model']=_[_0x44dd('0x2b')](_0x3d14e2,_0x44dd('0x2a'));_0x30181f['query']=_['keys'](_0xe0869a[_0x44dd('0x2f')]);_0x30181f[_0x44dd('0x30')]=_[_0x44dd('0x31')](_0x30181f[_0x44dd('0x32')],_0x30181f[_0x44dd('0x2f')]);_0x1ea01e[_0x44dd('0x33')]=_[_0x44dd('0x31')](_0x30181f[_0x44dd('0x32')],qs[_0x44dd('0x34')](_0xe0869a[_0x44dd('0x2f')][_0x44dd('0x34')]));_0x1ea01e['attributes']=_0x1ea01e[_0x44dd('0x33')][_0x44dd('0x35')]?_0x1ea01e[_0x44dd('0x33')]:_0x30181f[_0x44dd('0x32')];if(!_0xe0869a[_0x44dd('0x2f')][_0x44dd('0x36')](_0x44dd('0x37'))){_0x1ea01e['limit']=qs[_0x44dd('0x21')](_0xe0869a[_0x44dd('0x2f')][_0x44dd('0x21')]);_0x1ea01e['offset']=qs[_0x44dd('0x1f')](_0xe0869a[_0x44dd('0x2f')]['offset']);}_0x1ea01e['order']=qs[_0x44dd('0x38')](_0xe0869a['query'][_0x44dd('0x38')]);_0x1ea01e['where']=qs[_0x44dd('0x30')](_[_0x44dd('0x39')](_0xe0869a[_0x44dd('0x2f')],_0x30181f['filters']),_0x3d14e2);if(_0xe0869a['query'][_0x44dd('0x3a')]){_0x1ea01e[_0x44dd('0x3b')]=_['merge'](_0x1ea01e[_0x44dd('0x3b')],{'$or':_[_0x44dd('0x2b')](_0x3d14e2,function(_0x1dcc0b){if(_0x1dcc0b[_0x44dd('0x2d')]!==_0x44dd('0x3c')){var _0x1d9918={};_0x1d9918[_0x1dcc0b[_0x44dd('0x2a')]]={'$like':'%'+_0xe0869a[_0x44dd('0x2f')][_0x44dd('0x3a')]+'%'};return _0x1d9918;}})});}_0x1ea01e=_[_0x44dd('0x3d')]({},_0x1ea01e,_0xe0869a[_0x44dd('0x3e')]);var _0x2eccad={'where':_0x1ea01e[_0x44dd('0x3b')]};return db['SmsQueueReport']['count'](_0x2eccad)['then'](function(_0x286c56){_0x5a7640[_0x44dd('0x3f')]=_0x286c56;if(_0xe0869a[_0x44dd('0x2f')][_0x44dd('0x40')]){_0x1ea01e[_0x44dd('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x44dd('0x42')](_0x1ea01e);})[_0x44dd('0x27')](function(_0x5f3252){_0x5a7640[_0x44dd('0x43')]=_0x5f3252;return _0x5a7640;})['then'](respondWithFilteredResult(_0x3537e1,_0x1ea01e))[_0x44dd('0x44')](handleError(_0x3537e1,null));};exports[_0x44dd('0x45')]=function(_0x3e239b,_0x50f8ab){var _0xa6c852={'raw':!![],'where':{'id':_0x3e239b[_0x44dd('0x46')]['id']}},_0x556e7f={};_0x556e7f[_0x44dd('0x32')]=_[_0x44dd('0x47')](db[_0x44dd('0x48')][_0x44dd('0x49')]);_0x556e7f['query']=_[_0x44dd('0x47')](_0x3e239b[_0x44dd('0x2f')]);_0x556e7f[_0x44dd('0x30')]=_[_0x44dd('0x31')](_0x556e7f[_0x44dd('0x32')],_0x556e7f[_0x44dd('0x2f')]);_0xa6c852[_0x44dd('0x33')]=_[_0x44dd('0x31')](_0x556e7f['model'],qs[_0x44dd('0x34')](_0x3e239b[_0x44dd('0x2f')][_0x44dd('0x34')]));_0xa6c852['attributes']=_0xa6c852[_0x44dd('0x33')][_0x44dd('0x35')]?_0xa6c852[_0x44dd('0x33')]:_0x556e7f[_0x44dd('0x32')];if(_0x3e239b['query'][_0x44dd('0x40')]){_0xa6c852[_0x44dd('0x41')]=[{'all':!![]}];}_0xa6c852=_[_0x44dd('0x3d')]({},_0xa6c852,_0x3e239b[_0x44dd('0x3e')]);return db[_0x44dd('0x48')][_0x44dd('0x4a')](_0xa6c852)['then'](handleEntityNotFound(_0x50f8ab,null))['then'](respondWithResult(_0x50f8ab,null))[_0x44dd('0x44')](handleError(_0x50f8ab,null));};exports['create']=function(_0x348f21,_0x5e6886){return db['SmsQueueReport'][_0x44dd('0x4b')](_0x348f21[_0x44dd('0x4c')],{})['then'](respondWithResult(_0x5e6886,0xc9))[_0x44dd('0x44')](handleError(_0x5e6886,null));};exports[_0x44dd('0x26')]=function(_0x5b9c70,_0x3e1fdb){if(_0x5b9c70['body']['id']){delete _0x5b9c70[_0x44dd('0x4c')]['id'];}return db[_0x44dd('0x48')][_0x44dd('0x4a')]({'where':{'id':_0x5b9c70['params']['id']}})[_0x44dd('0x27')](handleEntityNotFound(_0x3e1fdb,null))['then'](saveUpdates(_0x5b9c70[_0x44dd('0x4c')],null))['then'](respondWithResult(_0x3e1fdb,null))[_0x44dd('0x44')](handleError(_0x3e1fdb,null));};exports[_0x44dd('0x28')]=function(_0x49e7a0,_0x527826){return db[_0x44dd('0x48')][_0x44dd('0x4a')]({'where':{'id':_0x49e7a0[_0x44dd('0x46')]['id']}})['then'](handleEntityNotFound(_0x527826,null))[_0x44dd('0x27')](removeEntity(_0x527826,null))[_0x44dd('0x44')](handleError(_0x527826,null));};exports[_0x44dd('0x4d')]=function(_0x20e0bb,_0x25642e){return db[_0x44dd('0x48')][_0x44dd('0x4d')]()[_0x44dd('0x27')](respondWithResult(_0x25642e,null))[_0x44dd('0x44')](handleError(_0x25642e,null));}; \ No newline at end of file +var _0x0ea0=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','rows','params','fields','includeAll','include','options','find','create','catch','body','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0ea0,0x11f));var _0x00ea=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x0ea0[_0x40b3f2];return _0x4ce90c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00ea('0x0'));var zipdir=require(_0x00ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00ea('0x2'));var moment=require('moment');var BPromise=require(_0x00ea('0x3'));var Mustache=require(_0x00ea('0x4'));var util=require(_0x00ea('0x5'));var path=require(_0x00ea('0x6'));var sox=require(_0x00ea('0x7'));var csv=require(_0x00ea('0x8'));var ejs=require(_0x00ea('0x9'));var fs=require('fs');var fs_extra=require(_0x00ea('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x00ea('0xb'));var deskjs=require(_0x00ea('0xc'));var toCsv=require(_0x00ea('0x8'));var querystring=require(_0x00ea('0xd'));var Papa=require('papaparse');var Redis=require(_0x00ea('0xe'));var authService=require(_0x00ea('0xf'));var qs=require(_0x00ea('0x10'));var as=require(_0x00ea('0x11'));var hardwareService=require(_0x00ea('0x12'));var logger=require(_0x00ea('0x13'))(_0x00ea('0x14'));var utils=require(_0x00ea('0x15'));var config=require(_0x00ea('0x16'));var licenseUtil=require(_0x00ea('0x17'));var db=require(_0x00ea('0x18'))['db'];function respondWithStatusCode(_0x25eb89,_0x3ee12a){_0x3ee12a=_0x3ee12a||0xcc;return function(_0x46db42){if(_0x46db42){return _0x25eb89[_0x00ea('0x19')](_0x3ee12a);}return _0x25eb89['status'](_0x3ee12a)[_0x00ea('0x1a')]();};}function respondWithResult(_0x194d2e,_0xd07925){_0xd07925=_0xd07925||0xc8;return function(_0x2e38fb){if(_0x2e38fb){return _0x194d2e[_0x00ea('0x1b')](_0xd07925)[_0x00ea('0x1c')](_0x2e38fb);}};}function respondWithFilteredResult(_0x1cc20f,_0x3a98c4){return function(_0x176bd8){if(_0x176bd8){var _0x6774a5=typeof _0x3a98c4[_0x00ea('0x1d')]===_0x00ea('0x1e')&&typeof _0x3a98c4[_0x00ea('0x1f')]===_0x00ea('0x1e');var _0x4db4aa=_0x176bd8['count'];var _0x22f5d6=_0x6774a5?0x0:_0x3a98c4[_0x00ea('0x1d')];var _0x5c3b12=_0x6774a5?_0x176bd8['count']:_0x3a98c4[_0x00ea('0x1d')]+_0x3a98c4['limit'];var _0x413496;if(_0x5c3b12>=_0x4db4aa){_0x5c3b12=_0x4db4aa;_0x413496=0xc8;}else{_0x413496=0xce;}_0x1cc20f[_0x00ea('0x1b')](_0x413496);return _0x1cc20f[_0x00ea('0x20')](_0x00ea('0x21'),_0x22f5d6+'-'+_0x5c3b12+'/'+_0x4db4aa)[_0x00ea('0x1c')](_0x176bd8);}return null;};}function patchUpdates(_0x3357b7){return function(_0x12f148){try{jsonpatch[_0x00ea('0x22')](_0x12f148,_0x3357b7,!![]);}catch(_0x3ffd3d){return BPromise[_0x00ea('0x23')](_0x3ffd3d);}return _0x12f148[_0x00ea('0x24')]();};}function saveUpdates(_0x37ef89,_0x42334d){return function(_0x265642){if(_0x265642){return _0x265642[_0x00ea('0x25')](_0x37ef89)[_0x00ea('0x26')](function(_0x213551){return _0x213551;});}return null;};}function removeEntity(_0x3c4b99,_0x129079){return function(_0x25a9a0){if(_0x25a9a0){return _0x25a9a0['destroy']()[_0x00ea('0x26')](function(){_0x3c4b99[_0x00ea('0x1b')](0xcc)[_0x00ea('0x1a')]();});}};}function handleEntityNotFound(_0x11cad9,_0x1ff798){return function(_0xe3367a){if(!_0xe3367a){_0x11cad9['sendStatus'](0x194);}return _0xe3367a;};}function handleError(_0x26bb23,_0x318909){_0x318909=_0x318909||0x1f4;return function(_0x5cae0f){logger[_0x00ea('0x27')](_0x5cae0f['stack']);if(_0x5cae0f[_0x00ea('0x28')]){delete _0x5cae0f[_0x00ea('0x28')];}_0x26bb23['status'](_0x318909)[_0x00ea('0x29')](_0x5cae0f);};}exports[_0x00ea('0x2a')]=function(_0x3145f5,_0x414dad){var _0x2a266a={},_0x484677={},_0xc1041c={'count':0x0,'rows':[]};var _0x19ddac=_[_0x00ea('0x2b')](db[_0x00ea('0x2c')][_0x00ea('0x2d')],function(_0x120fb9){return{'name':_0x120fb9[_0x00ea('0x2e')],'type':_0x120fb9[_0x00ea('0x2f')][_0x00ea('0x30')]};});_0x484677[_0x00ea('0x31')]=_[_0x00ea('0x2b')](_0x19ddac,_0x00ea('0x28'));_0x484677[_0x00ea('0x32')]=_[_0x00ea('0x33')](_0x3145f5[_0x00ea('0x32')]);_0x484677[_0x00ea('0x34')]=_[_0x00ea('0x35')](_0x484677[_0x00ea('0x31')],_0x484677[_0x00ea('0x32')]);_0x2a266a[_0x00ea('0x36')]=_[_0x00ea('0x35')](_0x484677[_0x00ea('0x31')],qs['fields'](_0x3145f5[_0x00ea('0x32')]['fields']));_0x2a266a[_0x00ea('0x36')]=_0x2a266a[_0x00ea('0x36')][_0x00ea('0x37')]?_0x2a266a[_0x00ea('0x36')]:_0x484677[_0x00ea('0x31')];if(!_0x3145f5[_0x00ea('0x32')][_0x00ea('0x38')](_0x00ea('0x39'))){_0x2a266a['limit']=qs['limit'](_0x3145f5[_0x00ea('0x32')]['limit']);_0x2a266a[_0x00ea('0x1d')]=qs[_0x00ea('0x1d')](_0x3145f5[_0x00ea('0x32')][_0x00ea('0x1d')]);}_0x2a266a['order']=qs[_0x00ea('0x3a')](_0x3145f5[_0x00ea('0x32')][_0x00ea('0x3a')]);_0x2a266a[_0x00ea('0x3b')]=qs[_0x00ea('0x34')](_[_0x00ea('0x3c')](_0x3145f5[_0x00ea('0x32')],_0x484677['filters']),_0x19ddac);if(_0x3145f5[_0x00ea('0x32')][_0x00ea('0x3d')]){_0x2a266a[_0x00ea('0x3b')]=_[_0x00ea('0x3e')](_0x2a266a[_0x00ea('0x3b')],{'$or':_['map'](_0x19ddac,function(_0x4fb2a8){if(_0x4fb2a8['type']!==_0x00ea('0x3f')){var _0x3255a8={};_0x3255a8[_0x4fb2a8[_0x00ea('0x28')]]={'$like':'%'+_0x3145f5[_0x00ea('0x32')][_0x00ea('0x3d')]+'%'};return _0x3255a8;}})});}_0x2a266a=_['merge']({},_0x2a266a,_0x3145f5['options']);var _0x36dd53={'where':_0x2a266a[_0x00ea('0x3b')]};return db[_0x00ea('0x2c')][_0x00ea('0x40')](_0x36dd53)[_0x00ea('0x26')](function(_0x221f55){_0xc1041c[_0x00ea('0x40')]=_0x221f55;if(_0x3145f5['query']['includeAll']){_0x2a266a['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x2a266a);})['then'](function(_0x2ee133){_0xc1041c[_0x00ea('0x41')]=_0x2ee133;return _0xc1041c;})[_0x00ea('0x26')](respondWithFilteredResult(_0x414dad,_0x2a266a))['catch'](handleError(_0x414dad,null));};exports['show']=function(_0x3961a4,_0x2a5b04){var _0x1026cd={'raw':!![],'where':{'id':_0x3961a4[_0x00ea('0x42')]['id']}},_0x41dec4={};_0x41dec4['model']=_[_0x00ea('0x33')](db[_0x00ea('0x2c')][_0x00ea('0x2d')]);_0x41dec4['query']=_['keys'](_0x3961a4[_0x00ea('0x32')]);_0x41dec4['filters']=_['intersection'](_0x41dec4[_0x00ea('0x31')],_0x41dec4[_0x00ea('0x32')]);_0x1026cd[_0x00ea('0x36')]=_[_0x00ea('0x35')](_0x41dec4[_0x00ea('0x31')],qs[_0x00ea('0x43')](_0x3961a4[_0x00ea('0x32')][_0x00ea('0x43')]));_0x1026cd['attributes']=_0x1026cd[_0x00ea('0x36')]['length']?_0x1026cd[_0x00ea('0x36')]:_0x41dec4[_0x00ea('0x31')];if(_0x3961a4['query'][_0x00ea('0x44')]){_0x1026cd[_0x00ea('0x45')]=[{'all':!![]}];}_0x1026cd=_[_0x00ea('0x3e')]({},_0x1026cd,_0x3961a4[_0x00ea('0x46')]);return db[_0x00ea('0x2c')][_0x00ea('0x47')](_0x1026cd)[_0x00ea('0x26')](handleEntityNotFound(_0x2a5b04,null))[_0x00ea('0x26')](respondWithResult(_0x2a5b04,null))['catch'](handleError(_0x2a5b04,null));};exports[_0x00ea('0x48')]=function(_0x4738b8,_0x5147ff){return db[_0x00ea('0x2c')][_0x00ea('0x48')](_0x4738b8['body'],{})[_0x00ea('0x26')](respondWithResult(_0x5147ff,0xc9))[_0x00ea('0x49')](handleError(_0x5147ff,null));};exports[_0x00ea('0x25')]=function(_0x26f186,_0xecb798){if(_0x26f186[_0x00ea('0x4a')]['id']){delete _0x26f186[_0x00ea('0x4a')]['id'];}return db[_0x00ea('0x2c')][_0x00ea('0x47')]({'where':{'id':_0x26f186['params']['id']}})[_0x00ea('0x26')](handleEntityNotFound(_0xecb798,null))['then'](saveUpdates(_0x26f186['body'],null))['then'](respondWithResult(_0xecb798,null))[_0x00ea('0x49')](handleError(_0xecb798,null));};exports[_0x00ea('0x4b')]=function(_0x2340f5,_0x5681af){return db[_0x00ea('0x2c')][_0x00ea('0x47')]({'where':{'id':_0x2340f5[_0x00ea('0x42')]['id']}})[_0x00ea('0x26')](handleEntityNotFound(_0x5681af,null))[_0x00ea('0x26')](removeEntity(_0x5681af,null))[_0x00ea('0x49')](handleError(_0x5681af,null));};exports[_0x00ea('0x4c')]=function(_0x248057,_0x3465a7){return db[_0x00ea('0x2c')][_0x00ea('0x4c')]()['then'](respondWithResult(_0x3465a7,null))['catch'](handleError(_0x3465a7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bf68d73..c00490f 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2fc284,_0x5d271c){var _0x221234=function(_0x39fb00){while(--_0x39fb00){_0x2fc284['push'](_0x2fc284['shift']());}};_0x221234(++_0x5d271c);}(_0xe706,0xa3));var _0x6e70=function(_0x3ee8b1,_0x375088){_0x3ee8b1=_0x3ee8b1-0x0;var _0x53aa77=_0xe706[_0x3ee8b1];return _0x53aa77;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x5f195d,_0x2b7e9b){var _0xd73352=function(_0x57b2df){while(--_0x57b2df){_0x5f195d['push'](_0x5f195d['shift']());}};_0xd73352(++_0x2b7e9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'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 f3b6079..a89f698 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 _0xb141=['jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x49f8c4,_0xfaa8d4){var _0x1c60b3=function(_0x3bf9db){while(--_0x3bf9db){_0x49f8c4['push'](_0x49f8c4['shift']());}};_0x1c60b3(++_0xfaa8d4);}(_0xb141,0xf9));var _0x1b14=function(_0x1f0efb,_0x4556f9){_0x1f0efb=_0x1f0efb-0x0;var _0x374d15=_0xb141[_0x1f0efb];return _0x374d15;};'use strict';var _=require(_0x1b14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1b14('0x1'));var rs=require(_0x1b14('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b14('0x3'))['db'];var utils=require(_0x1b14('0x4'));var logger=require('../../config/logger')(_0x1b14('0x5'));var config=require(_0x1b14('0x6'));var jayson=require(_0x1b14('0x7'));var client=jayson['client'][_0x1b14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12062c,_0x3bba13,_0x581a73){return new BPromise(function(_0x28afec,_0x27d44f){return client[_0x1b14('0x9')](_0x12062c,_0x581a73)[_0x1b14('0xa')](function(_0x34b20a){logger[_0x1b14('0xb')](_0x1b14('0xc'),_0x3bba13,_0x1b14('0xd'));logger[_0x1b14('0xe')](_0x1b14('0xf'),_0x3bba13,_0x1b14('0xd'),JSON[_0x1b14('0x10')](_0x34b20a));if(_0x34b20a[_0x1b14('0x11')]){if(_0x34b20a[_0x1b14('0x11')][_0x1b14('0x12')]===0x1f4){logger[_0x1b14('0x11')](_0x1b14('0xc'),_0x3bba13,_0x34b20a['error'][_0x1b14('0x13')]);return _0x27d44f(_0x34b20a[_0x1b14('0x11')]['message']);}logger[_0x1b14('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x3bba13,_0x34b20a['error'][_0x1b14('0x13')]);return _0x28afec(_0x34b20a[_0x1b14('0x11')][_0x1b14('0x13')]);}else{logger[_0x1b14('0xb')](_0x1b14('0xc'),_0x3bba13,_0x1b14('0xd'));_0x28afec(_0x34b20a['result']['message']);}})['catch'](function(_0x1330a5){logger[_0x1b14('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x3bba13,_0x1330a5);_0x27d44f(_0x1330a5);});});}exports[_0x1b14('0x14')]=function(_0x3b0e48){var _0x147e7f=this;return new Promise(function(_0x48d108,_0x3bb4b6){return db[_0x1b14('0x15')][_0x1b14('0x16')](_0x3b0e48[_0x1b14('0x17')],{'raw':_0x3b0e48[_0x1b14('0x18')]?_0x3b0e48['options'][_0x1b14('0x19')]===undefined?!![]:![]:!![]})[_0x1b14('0xa')](function(_0x2c8d8b){logger[_0x1b14('0xb')]('CreateSmsQueueReport',_0x3b0e48);logger[_0x1b14('0xe')](_0x1b14('0x14'),_0x3b0e48,JSON[_0x1b14('0x10')](_0x2c8d8b));_0x48d108(_0x2c8d8b);})[_0x1b14('0x1a')](function(_0x11b61d){logger[_0x1b14('0x11')](_0x1b14('0x14'),_0x11b61d[_0x1b14('0x13')],_0x3b0e48);_0x3bb4b6(_0x147e7f[_0x1b14('0x11')](0x1f4,_0x11b61d[_0x1b14('0x13')]));});});};exports[_0x1b14('0x1b')]=function(_0x4215d7){var _0x1dc867=this;return new Promise(function(_0x2ace65,_0x414e29){return db['SmsQueueReport'][_0x1b14('0x1c')](_0x4215d7[_0x1b14('0x17')],{'raw':_0x4215d7[_0x1b14('0x18')]?_0x4215d7[_0x1b14('0x18')][_0x1b14('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4215d7['options']?_0x4215d7[_0x1b14('0x18')][_0x1b14('0x1d')]||null:null,'attributes':_0x4215d7[_0x1b14('0x18')]?_0x4215d7[_0x1b14('0x18')][_0x1b14('0x1e')]||null:null,'limit':_0x4215d7['options']?_0x4215d7[_0x1b14('0x18')][_0x1b14('0x1f')]||null:null})['then'](function(_0x86f8d7){logger[_0x1b14('0xb')](_0x1b14('0x1b'),_0x4215d7);logger['debug']('UpdateSmsQueueReport',_0x4215d7,JSON[_0x1b14('0x10')](_0x86f8d7));_0x2ace65(_0x86f8d7);})[_0x1b14('0x1a')](function(_0x4ff080){logger[_0x1b14('0x11')](_0x1b14('0x1b'),_0x4ff080['message'],_0x4215d7);_0x414e29(_0x1dc867[_0x1b14('0x11')](0x1f4,_0x4ff080[_0x1b14('0x13')]));});});}; \ No newline at end of file +var _0xd74c=['debug','UpdateSmsQueueReport','update','where','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0xd74c,0x140));var _0xcd74=function(_0x5ba507,_0x14deb3){_0x5ba507=_0x5ba507-0x0;var _0x849c12=_0xd74c[_0x5ba507];return _0x849c12;};'use strict';var _=require(_0xcd74('0x0'));var util=require('util');var moment=require(_0xcd74('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd74('0x2'));var fs=require('fs');var Redis=require(_0xcd74('0x3'));var db=require(_0xcd74('0x4'))['db'];var utils=require(_0xcd74('0x5'));var logger=require(_0xcd74('0x6'))(_0xcd74('0x7'));var config=require(_0xcd74('0x8'));var jayson=require(_0xcd74('0x9'));var client=jayson[_0xcd74('0xa')][_0xcd74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543e60,_0x2e5d39,_0x2af38d){return new BPromise(function(_0x479291,_0x4ab53f){return client[_0xcd74('0xc')](_0x543e60,_0x2af38d)[_0xcd74('0xd')](function(_0x1504cc){logger[_0xcd74('0xe')](_0xcd74('0xf'),_0x2e5d39,'request\x20sent');logger['debug'](_0xcd74('0x10'),_0x2e5d39,_0xcd74('0x11'),JSON[_0xcd74('0x12')](_0x1504cc));if(_0x1504cc['error']){if(_0x1504cc[_0xcd74('0x13')][_0xcd74('0x14')]===0x1f4){logger[_0xcd74('0x13')](_0xcd74('0xf'),_0x2e5d39,_0x1504cc['error']['message']);return _0x4ab53f(_0x1504cc['error'][_0xcd74('0x15')]);}logger[_0xcd74('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x2e5d39,_0x1504cc['error'][_0xcd74('0x15')]);return _0x479291(_0x1504cc[_0xcd74('0x13')][_0xcd74('0x15')]);}else{logger[_0xcd74('0xe')](_0xcd74('0xf'),_0x2e5d39,_0xcd74('0x11'));_0x479291(_0x1504cc[_0xcd74('0x16')][_0xcd74('0x15')]);}})[_0xcd74('0x17')](function(_0x25eda6){logger['error'](_0xcd74('0xf'),_0x2e5d39,_0x25eda6);_0x4ab53f(_0x25eda6);});});}exports[_0xcd74('0x18')]=function(_0x5bc5c4){var _0x51cead=this;return new Promise(function(_0x1b7303,_0xb771a9){return db[_0xcd74('0x19')][_0xcd74('0x1a')](_0x5bc5c4[_0xcd74('0x1b')],{'raw':_0x5bc5c4[_0xcd74('0x1c')]?_0x5bc5c4['options'][_0xcd74('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4761fc){logger['info'](_0xcd74('0x18'),_0x5bc5c4);logger[_0xcd74('0x1e')](_0xcd74('0x18'),_0x5bc5c4,JSON[_0xcd74('0x12')](_0x4761fc));_0x1b7303(_0x4761fc);})[_0xcd74('0x17')](function(_0x7b004f){logger[_0xcd74('0x13')]('CreateSmsQueueReport',_0x7b004f[_0xcd74('0x15')],_0x5bc5c4);_0xb771a9(_0x51cead[_0xcd74('0x13')](0x1f4,_0x7b004f['message']));});});};exports[_0xcd74('0x1f')]=function(_0x1224ee){var _0x233b28=this;return new Promise(function(_0x3c3528,_0x550ab3){return db[_0xcd74('0x19')][_0xcd74('0x20')](_0x1224ee[_0xcd74('0x1b')],{'raw':_0x1224ee[_0xcd74('0x1c')]?_0x1224ee[_0xcd74('0x1c')][_0xcd74('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1224ee['options']?_0x1224ee[_0xcd74('0x1c')][_0xcd74('0x21')]||null:null,'attributes':_0x1224ee[_0xcd74('0x1c')]?_0x1224ee['options'][_0xcd74('0x22')]||null:null,'limit':_0x1224ee[_0xcd74('0x1c')]?_0x1224ee['options']['limit']||null:null})[_0xcd74('0xd')](function(_0x34731a){logger[_0xcd74('0xe')](_0xcd74('0x1f'),_0x1224ee);logger['debug'](_0xcd74('0x1f'),_0x1224ee,JSON[_0xcd74('0x12')](_0x34731a));_0x3c3528(_0x34731a);})[_0xcd74('0x17')](function(_0x366368){logger[_0xcd74('0x13')](_0xcd74('0x1f'),_0x366368[_0xcd74('0x15')],_0x1224ee);_0x550ab3(_0x233b28['error'](0x1f4,_0x366368[_0xcd74('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index dbafcdc..3f13d02 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 _0x8ece=['describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x385f7b,_0x4761d3){var _0x534f59=function(_0x39073c){while(--_0x39073c){_0x385f7b['push'](_0x385f7b['shift']());}};_0x534f59(++_0x4761d3);}(_0x8ece,0x195));var _0xe8ec=function(_0x4fd905,_0x529ac1){_0x4fd905=_0x4fd905-0x0;var _0x2d3204=_0x8ece[_0x4fd905];return _0x2d3204;};'use strict';var multer=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var path=require(_0xe8ec('0x2'));var timeout=require(_0xe8ec('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe8ec('0x4'));var auth=require(_0xe8ec('0x5'));var interaction=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var controller=require(_0xe8ec('0x8'));router['get']('/',auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xa')]);router[_0xe8ec('0xb')](_0xe8ec('0xc'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xd')]);router[_0xe8ec('0xb')]('/:id',auth[_0xe8ec('0x9')](),controller['show']);router[_0xe8ec('0xe')]('/',auth['isAuthenticated'](),controller[_0xe8ec('0xf')]);router[_0xe8ec('0x10')](_0xe8ec('0x11'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0x12')]);router[_0xe8ec('0x13')](_0xe8ec('0x11'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0x14')]);module[_0xe8ec('0x15')]=router; \ No newline at end of file +var _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1befd7,_0x272bff){var _0x45b3a9=function(_0x5951b3){while(--_0x5951b3){_0x1befd7['push'](_0x1befd7['shift']());}};_0x45b3a9(++_0x272bff);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2582be3..87f3c0e 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x3b2c47,_0x1157a9){var _0x2af12f=function(_0x8b1865){while(--_0x8b1865){_0x3b2c47['push'](_0x3b2c47['shift']());}};_0x2af12f(++_0x1157a9);}(_0xe706,0xa3));var _0x6e70=function(_0x38cbdf,_0x4eb95f){_0x38cbdf=_0x38cbdf-0x0;var _0x20ebce=_0xe706[_0x38cbdf];return _0x20ebce;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x280fce,_0x3e5171){var _0x45ae5f=function(_0x4c85c6){while(--_0x4c85c6){_0x280fce['push'](_0x280fce['shift']());}};_0x45ae5f(++_0x3e5171);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 89d2183..f95713e 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 _0x3e0c=['show','params','includeAll','merge','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','send','index','SmsTransferReport','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','findAll','rows','catch'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x3e0c,0x19a));var _0xc3e0=function(_0x532850,_0x3a100a){_0x532850=_0x532850-0x0;var _0x4ea53f=_0x3e0c[_0x532850];return _0x4ea53f;};'use strict';var emlformat=require(_0xc3e0('0x0'));var rimraf=require(_0xc3e0('0x1'));var zipdir=require(_0xc3e0('0x2'));var jsonpatch=require(_0xc3e0('0x3'));var rp=require(_0xc3e0('0x4'));var moment=require(_0xc3e0('0x5'));var BPromise=require(_0xc3e0('0x6'));var Mustache=require(_0xc3e0('0x7'));var util=require(_0xc3e0('0x8'));var path=require('path');var sox=require(_0xc3e0('0x9'));var csv=require(_0xc3e0('0xa'));var ejs=require(_0xc3e0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3e0('0xc'));var squel=require(_0xc3e0('0xd'));var crypto=require(_0xc3e0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc3e0('0x10'));var Papa=require(_0xc3e0('0x11'));var Redis=require(_0xc3e0('0x12'));var authService=require(_0xc3e0('0x13'));var qs=require(_0xc3e0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e0('0x15'));var logger=require(_0xc3e0('0x16'))(_0xc3e0('0x17'));var utils=require(_0xc3e0('0x18'));var config=require(_0xc3e0('0x19'));var licenseUtil=require(_0xc3e0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493652,_0x54aabc){_0x54aabc=_0x54aabc||0xcc;return function(_0x286a40){if(_0x286a40){return _0x493652[_0xc3e0('0x1b')](_0x54aabc);}return _0x493652[_0xc3e0('0x1c')](_0x54aabc)[_0xc3e0('0x1d')]();};}function respondWithResult(_0x38e64f,_0x18bb19){_0x18bb19=_0x18bb19||0xc8;return function(_0x3e1f4e){if(_0x3e1f4e){return _0x38e64f['status'](_0x18bb19)['json'](_0x3e1f4e);}};}function respondWithFilteredResult(_0x1923df,_0x38e9f0){return function(_0xd41a2e){if(_0xd41a2e){var _0x226210=typeof _0x38e9f0[_0xc3e0('0x1e')]==='undefined'&&typeof _0x38e9f0['limit']===_0xc3e0('0x1f');var _0x39fa5f=_0xd41a2e[_0xc3e0('0x20')];var _0x53325f=_0x226210?0x0:_0x38e9f0[_0xc3e0('0x1e')];var _0x5c35ee=_0x226210?_0xd41a2e['count']:_0x38e9f0[_0xc3e0('0x1e')]+_0x38e9f0[_0xc3e0('0x21')];var _0x51409b;if(_0x5c35ee>=_0x39fa5f){_0x5c35ee=_0x39fa5f;_0x51409b=0xc8;}else{_0x51409b=0xce;}_0x1923df[_0xc3e0('0x1c')](_0x51409b);return _0x1923df[_0xc3e0('0x22')](_0xc3e0('0x23'),_0x53325f+'-'+_0x5c35ee+'/'+_0x39fa5f)[_0xc3e0('0x24')](_0xd41a2e);}return null;};}function patchUpdates(_0x356890){return function(_0x57af67){try{jsonpatch[_0xc3e0('0x25')](_0x57af67,_0x356890,!![]);}catch(_0x1f8ad5){return BPromise[_0xc3e0('0x26')](_0x1f8ad5);}return _0x57af67[_0xc3e0('0x27')]();};}function saveUpdates(_0x325d57,_0x33f24f){return function(_0x41d639){if(_0x41d639){return _0x41d639[_0xc3e0('0x28')](_0x325d57)[_0xc3e0('0x29')](function(_0xcfd4f4){return _0xcfd4f4;});}return null;};}function removeEntity(_0x2c0d0a,_0x4d917a){return function(_0x27272c){if(_0x27272c){return _0x27272c['destroy']()[_0xc3e0('0x29')](function(){_0x2c0d0a[_0xc3e0('0x1c')](0xcc)[_0xc3e0('0x1d')]();});}};}function handleEntityNotFound(_0x1d3bcf,_0x2a376c){return function(_0xf59c38){if(!_0xf59c38){_0x1d3bcf[_0xc3e0('0x1b')](0x194);}return _0xf59c38;};}function handleError(_0x31d370,_0x2e666f){_0x2e666f=_0x2e666f||0x1f4;return function(_0x30a2d8){logger[_0xc3e0('0x2a')](_0x30a2d8['stack']);if(_0x30a2d8['name']){delete _0x30a2d8['name'];}_0x31d370[_0xc3e0('0x1c')](_0x2e666f)[_0xc3e0('0x2b')](_0x30a2d8);};}exports[_0xc3e0('0x2c')]=function(_0x496e3a,_0x3620c5){var _0x33ba7a={},_0x1b2bcf={},_0x41ba74={'count':0x0,'rows':[]};var _0x9f74d3=_['map'](db[_0xc3e0('0x2d')][_0xc3e0('0x2e')],function(_0x1877df){return{'name':_0x1877df[_0xc3e0('0x2f')],'type':_0x1877df[_0xc3e0('0x30')]['key']};});_0x1b2bcf[_0xc3e0('0x31')]=_[_0xc3e0('0x32')](_0x9f74d3,_0xc3e0('0x33'));_0x1b2bcf[_0xc3e0('0x34')]=_[_0xc3e0('0x35')](_0x496e3a[_0xc3e0('0x34')]);_0x1b2bcf['filters']=_[_0xc3e0('0x36')](_0x1b2bcf[_0xc3e0('0x31')],_0x1b2bcf['query']);_0x33ba7a[_0xc3e0('0x37')]=_[_0xc3e0('0x36')](_0x1b2bcf[_0xc3e0('0x31')],qs[_0xc3e0('0x38')](_0x496e3a[_0xc3e0('0x34')][_0xc3e0('0x38')]));_0x33ba7a[_0xc3e0('0x37')]=_0x33ba7a[_0xc3e0('0x37')][_0xc3e0('0x39')]?_0x33ba7a[_0xc3e0('0x37')]:_0x1b2bcf[_0xc3e0('0x31')];if(!_0x496e3a['query'][_0xc3e0('0x3a')](_0xc3e0('0x3b'))){_0x33ba7a[_0xc3e0('0x21')]=qs[_0xc3e0('0x21')](_0x496e3a[_0xc3e0('0x34')]['limit']);_0x33ba7a['offset']=qs[_0xc3e0('0x1e')](_0x496e3a[_0xc3e0('0x34')]['offset']);}_0x33ba7a[_0xc3e0('0x3c')]=qs[_0xc3e0('0x3d')](_0x496e3a['query'][_0xc3e0('0x3d')]);_0x33ba7a[_0xc3e0('0x3e')]=qs[_0xc3e0('0x3f')](_[_0xc3e0('0x40')](_0x496e3a[_0xc3e0('0x34')],_0x1b2bcf[_0xc3e0('0x3f')]),_0x9f74d3);if(_0x496e3a[_0xc3e0('0x34')]['filter']){_0x33ba7a[_0xc3e0('0x3e')]=_['merge'](_0x33ba7a[_0xc3e0('0x3e')],{'$or':_[_0xc3e0('0x32')](_0x9f74d3,function(_0x514d65){if(_0x514d65[_0xc3e0('0x30')]!==_0xc3e0('0x41')){var _0xd1a84a={};_0xd1a84a[_0x514d65[_0xc3e0('0x33')]]={'$like':'%'+_0x496e3a['query'][_0xc3e0('0x42')]+'%'};return _0xd1a84a;}})});}_0x33ba7a=_['merge']({},_0x33ba7a,_0x496e3a['options']);var _0x3c86f4={'where':_0x33ba7a[_0xc3e0('0x3e')]};return db['SmsTransferReport'][_0xc3e0('0x20')](_0x3c86f4)[_0xc3e0('0x29')](function(_0x437b91){_0x41ba74[_0xc3e0('0x20')]=_0x437b91;if(_0x496e3a[_0xc3e0('0x34')]['includeAll']){_0x33ba7a['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xc3e0('0x43')](_0x33ba7a);})[_0xc3e0('0x29')](function(_0x533828){_0x41ba74[_0xc3e0('0x44')]=_0x533828;return _0x41ba74;})[_0xc3e0('0x29')](respondWithFilteredResult(_0x3620c5,_0x33ba7a))[_0xc3e0('0x45')](handleError(_0x3620c5,null));};exports[_0xc3e0('0x46')]=function(_0x50f85c,_0x12695c){var _0xa5840e={'raw':!![],'where':{'id':_0x50f85c[_0xc3e0('0x47')]['id']}},_0x18b1cb={};_0x18b1cb[_0xc3e0('0x31')]=_[_0xc3e0('0x35')](db['SmsTransferReport']['rawAttributes']);_0x18b1cb['query']=_[_0xc3e0('0x35')](_0x50f85c['query']);_0x18b1cb[_0xc3e0('0x3f')]=_[_0xc3e0('0x36')](_0x18b1cb[_0xc3e0('0x31')],_0x18b1cb[_0xc3e0('0x34')]);_0xa5840e['attributes']=_[_0xc3e0('0x36')](_0x18b1cb['model'],qs[_0xc3e0('0x38')](_0x50f85c[_0xc3e0('0x34')][_0xc3e0('0x38')]));_0xa5840e[_0xc3e0('0x37')]=_0xa5840e[_0xc3e0('0x37')][_0xc3e0('0x39')]?_0xa5840e['attributes']:_0x18b1cb[_0xc3e0('0x31')];if(_0x50f85c[_0xc3e0('0x34')][_0xc3e0('0x48')]){_0xa5840e['include']=[{'all':!![]}];}_0xa5840e=_[_0xc3e0('0x49')]({},_0xa5840e,_0x50f85c[_0xc3e0('0x4a')]);return db[_0xc3e0('0x2d')][_0xc3e0('0x4b')](_0xa5840e)[_0xc3e0('0x29')](handleEntityNotFound(_0x12695c,null))['then'](respondWithResult(_0x12695c,null))[_0xc3e0('0x45')](handleError(_0x12695c,null));};exports[_0xc3e0('0x4c')]=function(_0x41c805,_0x127368){return db['SmsTransferReport']['create'](_0x41c805['body'],{})[_0xc3e0('0x29')](respondWithResult(_0x127368,0xc9))[_0xc3e0('0x45')](handleError(_0x127368,null));};exports[_0xc3e0('0x28')]=function(_0x2f1794,_0xa4aab2){if(_0x2f1794['body']['id']){delete _0x2f1794[_0xc3e0('0x4d')]['id'];}return db[_0xc3e0('0x2d')][_0xc3e0('0x4b')]({'where':{'id':_0x2f1794[_0xc3e0('0x47')]['id']}})[_0xc3e0('0x29')](handleEntityNotFound(_0xa4aab2,null))[_0xc3e0('0x29')](saveUpdates(_0x2f1794['body'],null))[_0xc3e0('0x29')](respondWithResult(_0xa4aab2,null))[_0xc3e0('0x45')](handleError(_0xa4aab2,null));};exports[_0xc3e0('0x4e')]=function(_0x17b6a1,_0x34ae19){return db[_0xc3e0('0x2d')][_0xc3e0('0x4b')]({'where':{'id':_0x17b6a1['params']['id']}})[_0xc3e0('0x29')](handleEntityNotFound(_0x34ae19,null))[_0xc3e0('0x29')](removeEntity(_0x34ae19,null))[_0xc3e0('0x45')](handleError(_0x34ae19,null));};exports[_0xc3e0('0x4f')]=function(_0x4e72de,_0x1cb11c){return db[_0xc3e0('0x2d')][_0xc3e0('0x4f')]()[_0xc3e0('0x29')](respondWithResult(_0x1cb11c,null))[_0xc3e0('0x45')](handleError(_0x1cb11c,null));}; \ No newline at end of file +var _0x0c64=['destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then'];(function(_0x376da1,_0x44127f){var _0x1d9f50=function(_0x3c6790){while(--_0x3c6790){_0x376da1['push'](_0x376da1['shift']());}};_0x1d9f50(++_0x44127f);}(_0x0c64,0x1b6));var _0x40c6=function(_0x5d4289,_0x5b8576){_0x5d4289=_0x5d4289-0x0;var _0x556c28=_0x0c64[_0x5d4289];return _0x556c28;};'use strict';var emlformat=require(_0x40c6('0x0'));var rimraf=require(_0x40c6('0x1'));var zipdir=require(_0x40c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c6('0x3'));var moment=require(_0x40c6('0x4'));var BPromise=require(_0x40c6('0x5'));var Mustache=require(_0x40c6('0x6'));var util=require(_0x40c6('0x7'));var path=require(_0x40c6('0x8'));var sox=require('sox');var csv=require(_0x40c6('0x9'));var ejs=require(_0x40c6('0xa'));var fs=require('fs');var fs_extra=require(_0x40c6('0xb'));var _=require(_0x40c6('0xc'));var squel=require(_0x40c6('0xd'));var crypto=require(_0x40c6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x40c6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x40c6('0x10'));var Papa=require('papaparse');var Redis=require(_0x40c6('0x11'));var authService=require(_0x40c6('0x12'));var qs=require(_0x40c6('0x13'));var as=require(_0x40c6('0x14'));var hardwareService=require(_0x40c6('0x15'));var logger=require(_0x40c6('0x16'))(_0x40c6('0x17'));var utils=require(_0x40c6('0x18'));var config=require(_0x40c6('0x19'));var licenseUtil=require(_0x40c6('0x1a'));var db=require(_0x40c6('0x1b'))['db'];function respondWithStatusCode(_0x3bac13,_0x3b0cf0){_0x3b0cf0=_0x3b0cf0||0xcc;return function(_0x5dc67d){if(_0x5dc67d){return _0x3bac13[_0x40c6('0x1c')](_0x3b0cf0);}return _0x3bac13[_0x40c6('0x1d')](_0x3b0cf0)[_0x40c6('0x1e')]();};}function respondWithResult(_0x8da38f,_0x1f3061){_0x1f3061=_0x1f3061||0xc8;return function(_0x7f2c82){if(_0x7f2c82){return _0x8da38f[_0x40c6('0x1d')](_0x1f3061)[_0x40c6('0x1f')](_0x7f2c82);}};}function respondWithFilteredResult(_0x29ccc3,_0x577600){return function(_0x2d6022){if(_0x2d6022){var _0x354b16=typeof _0x577600[_0x40c6('0x20')]==='undefined'&&typeof _0x577600[_0x40c6('0x21')]===_0x40c6('0x22');var _0x400092=_0x2d6022[_0x40c6('0x23')];var _0x2b1e30=_0x354b16?0x0:_0x577600['offset'];var _0x11757e=_0x354b16?_0x2d6022[_0x40c6('0x23')]:_0x577600[_0x40c6('0x20')]+_0x577600[_0x40c6('0x21')];var _0x1cbca4;if(_0x11757e>=_0x400092){_0x11757e=_0x400092;_0x1cbca4=0xc8;}else{_0x1cbca4=0xce;}_0x29ccc3[_0x40c6('0x1d')](_0x1cbca4);return _0x29ccc3[_0x40c6('0x24')](_0x40c6('0x25'),_0x2b1e30+'-'+_0x11757e+'/'+_0x400092)[_0x40c6('0x1f')](_0x2d6022);}return null;};}function patchUpdates(_0x3a42d2){return function(_0x2c1614){try{jsonpatch['apply'](_0x2c1614,_0x3a42d2,!![]);}catch(_0x3fd152){return BPromise[_0x40c6('0x26')](_0x3fd152);}return _0x2c1614[_0x40c6('0x27')]();};}function saveUpdates(_0x28a3dc,_0x5b8a1b){return function(_0x10ed6c){if(_0x10ed6c){return _0x10ed6c[_0x40c6('0x28')](_0x28a3dc)[_0x40c6('0x29')](function(_0x18a1fd){return _0x18a1fd;});}return null;};}function removeEntity(_0x32e1b0,_0x4d8a01){return function(_0x477e82){if(_0x477e82){return _0x477e82[_0x40c6('0x2a')]()[_0x40c6('0x29')](function(){_0x32e1b0['status'](0xcc)[_0x40c6('0x1e')]();});}};}function handleEntityNotFound(_0xcac45,_0x294179){return function(_0x558aeb){if(!_0x558aeb){_0xcac45[_0x40c6('0x1c')](0x194);}return _0x558aeb;};}function handleError(_0x5a1189,_0x233ef8){_0x233ef8=_0x233ef8||0x1f4;return function(_0x145fb1){logger[_0x40c6('0x2b')](_0x145fb1[_0x40c6('0x2c')]);if(_0x145fb1[_0x40c6('0x2d')]){delete _0x145fb1[_0x40c6('0x2d')];}_0x5a1189[_0x40c6('0x1d')](_0x233ef8)[_0x40c6('0x2e')](_0x145fb1);};}exports['index']=function(_0x172b2a,_0x4f20b1){var _0x43a7f2={},_0x2de0c7={},_0x1ab69d={'count':0x0,'rows':[]};var _0x307e28=_[_0x40c6('0x2f')](db['SmsTransferReport'][_0x40c6('0x30')],function(_0xe12fce){return{'name':_0xe12fce[_0x40c6('0x31')],'type':_0xe12fce[_0x40c6('0x32')]['key']};});_0x2de0c7[_0x40c6('0x33')]=_[_0x40c6('0x2f')](_0x307e28,_0x40c6('0x2d'));_0x2de0c7[_0x40c6('0x34')]=_[_0x40c6('0x35')](_0x172b2a[_0x40c6('0x34')]);_0x2de0c7['filters']=_[_0x40c6('0x36')](_0x2de0c7[_0x40c6('0x33')],_0x2de0c7['query']);_0x43a7f2['attributes']=_[_0x40c6('0x36')](_0x2de0c7['model'],qs['fields'](_0x172b2a[_0x40c6('0x34')]['fields']));_0x43a7f2[_0x40c6('0x37')]=_0x43a7f2['attributes'][_0x40c6('0x38')]?_0x43a7f2[_0x40c6('0x37')]:_0x2de0c7['model'];if(!_0x172b2a['query'][_0x40c6('0x39')](_0x40c6('0x3a'))){_0x43a7f2['limit']=qs[_0x40c6('0x21')](_0x172b2a[_0x40c6('0x34')][_0x40c6('0x21')]);_0x43a7f2[_0x40c6('0x20')]=qs['offset'](_0x172b2a[_0x40c6('0x34')][_0x40c6('0x20')]);}_0x43a7f2[_0x40c6('0x3b')]=qs[_0x40c6('0x3c')](_0x172b2a[_0x40c6('0x34')][_0x40c6('0x3c')]);_0x43a7f2[_0x40c6('0x3d')]=qs[_0x40c6('0x3e')](_[_0x40c6('0x3f')](_0x172b2a['query'],_0x2de0c7[_0x40c6('0x3e')]),_0x307e28);if(_0x172b2a[_0x40c6('0x34')][_0x40c6('0x40')]){_0x43a7f2[_0x40c6('0x3d')]=_['merge'](_0x43a7f2['where'],{'$or':_['map'](_0x307e28,function(_0x2c2eb9){if(_0x2c2eb9[_0x40c6('0x32')]!==_0x40c6('0x41')){var _0x5e924d={};_0x5e924d[_0x2c2eb9[_0x40c6('0x2d')]]={'$like':'%'+_0x172b2a['query'][_0x40c6('0x40')]+'%'};return _0x5e924d;}})});}_0x43a7f2=_['merge']({},_0x43a7f2,_0x172b2a[_0x40c6('0x42')]);var _0x4cb900={'where':_0x43a7f2[_0x40c6('0x3d')]};return db[_0x40c6('0x43')][_0x40c6('0x23')](_0x4cb900)['then'](function(_0xe06384){_0x1ab69d[_0x40c6('0x23')]=_0xe06384;if(_0x172b2a[_0x40c6('0x34')][_0x40c6('0x44')]){_0x43a7f2[_0x40c6('0x45')]=[{'all':!![]}];}return db[_0x40c6('0x43')][_0x40c6('0x46')](_0x43a7f2);})[_0x40c6('0x29')](function(_0x47f5dc){_0x1ab69d[_0x40c6('0x47')]=_0x47f5dc;return _0x1ab69d;})[_0x40c6('0x29')](respondWithFilteredResult(_0x4f20b1,_0x43a7f2))[_0x40c6('0x48')](handleError(_0x4f20b1,null));};exports[_0x40c6('0x49')]=function(_0x28131f,_0x47a92d){var _0x3fea32={'raw':!![],'where':{'id':_0x28131f['params']['id']}},_0x5612a9={};_0x5612a9[_0x40c6('0x33')]=_[_0x40c6('0x35')](db[_0x40c6('0x43')][_0x40c6('0x30')]);_0x5612a9[_0x40c6('0x34')]=_[_0x40c6('0x35')](_0x28131f[_0x40c6('0x34')]);_0x5612a9['filters']=_[_0x40c6('0x36')](_0x5612a9[_0x40c6('0x33')],_0x5612a9[_0x40c6('0x34')]);_0x3fea32[_0x40c6('0x37')]=_[_0x40c6('0x36')](_0x5612a9[_0x40c6('0x33')],qs[_0x40c6('0x4a')](_0x28131f[_0x40c6('0x34')][_0x40c6('0x4a')]));_0x3fea32['attributes']=_0x3fea32['attributes']['length']?_0x3fea32['attributes']:_0x5612a9[_0x40c6('0x33')];if(_0x28131f[_0x40c6('0x34')][_0x40c6('0x44')]){_0x3fea32[_0x40c6('0x45')]=[{'all':!![]}];}_0x3fea32=_['merge']({},_0x3fea32,_0x28131f[_0x40c6('0x42')]);return db['SmsTransferReport'][_0x40c6('0x4b')](_0x3fea32)[_0x40c6('0x29')](handleEntityNotFound(_0x47a92d,null))['then'](respondWithResult(_0x47a92d,null))['catch'](handleError(_0x47a92d,null));};exports[_0x40c6('0x4c')]=function(_0x578716,_0x2267d4){return db[_0x40c6('0x43')][_0x40c6('0x4c')](_0x578716[_0x40c6('0x4d')],{})[_0x40c6('0x29')](respondWithResult(_0x2267d4,0xc9))[_0x40c6('0x48')](handleError(_0x2267d4,null));};exports['update']=function(_0x318f55,_0x151b32){if(_0x318f55[_0x40c6('0x4d')]['id']){delete _0x318f55[_0x40c6('0x4d')]['id'];}return db[_0x40c6('0x43')]['find']({'where':{'id':_0x318f55['params']['id']}})['then'](handleEntityNotFound(_0x151b32,null))[_0x40c6('0x29')](saveUpdates(_0x318f55[_0x40c6('0x4d')],null))[_0x40c6('0x29')](respondWithResult(_0x151b32,null))[_0x40c6('0x48')](handleError(_0x151b32,null));};exports[_0x40c6('0x2a')]=function(_0x42af61,_0x32e42f){return db['SmsTransferReport']['find']({'where':{'id':_0x42af61[_0x40c6('0x4e')]['id']}})[_0x40c6('0x29')](handleEntityNotFound(_0x32e42f,null))['then'](removeEntity(_0x32e42f,null))[_0x40c6('0x48')](handleError(_0x32e42f,null));};exports[_0x40c6('0x4f')]=function(_0x1e1686,_0x539ddc){return db['SmsTransferReport'][_0x40c6('0x4f')]()[_0x40c6('0x29')](respondWithResult(_0x539ddc,null))[_0x40c6('0x48')](handleError(_0x539ddc,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e02318d..dcd6623 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 _0xf150=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','uniqueid','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf150,0x196));var _0x0f15=function(_0x9f4261,_0x18adea){_0x9f4261=_0x9f4261-0x0;var _0x4175b4=_0xf150[_0x9f4261];return _0x4175b4;};'use strict';var _=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var logger=require(_0x0f15('0x2'))(_0x0f15('0x3'));var moment=require(_0x0f15('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f15('0x5'));var rimraf=require(_0x0f15('0x6'));var config=require(_0x0f15('0x7'));var attributes=require(_0x0f15('0x8'));module['exports']=function(_0xd88f20,_0x437b6f){return _0xd88f20['define'](_0x0f15('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x0f15('0xa'),'fields':[_0x0f15('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3dc=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x424351,_0x156ec0){var _0x26fc2b=function(_0x38743e){while(--_0x38743e){_0x424351['push'](_0x424351['shift']());}};_0x26fc2b(++_0x156ec0);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x3d5db9,_0x2dbe0a){_0x3d5db9=_0x3d5db9-0x0;var _0x3c114c=_0xf3dc[_0x3d5db9];return _0x3c114c;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var logger=require(_0xcf3d('0x2'))('api');var moment=require(_0xcf3d('0x3'));var BPromise=require(_0xcf3d('0x4'));var rp=require(_0xcf3d('0x5'));var fs=require('fs');var path=require(_0xcf3d('0x6'));var rimraf=require(_0xcf3d('0x7'));var config=require(_0xcf3d('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x55074b,_0x5b1441){return _0x55074b['define']('SmsTransferReport',attributes,{'tableName':_0xcf3d('0x9'),'paranoid':![],'indexes':[{'name':_0xcf3d('0xa'),'fields':[_0xcf3d('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 94edad2..35e6a49 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 _0xbe22=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xbe22,0x1c1));var _0x2be2=function(_0x554e96,_0x2eea80){_0x554e96=_0x554e96-0x0;var _0x449d9c=_0xbe22[_0x554e96];return _0x449d9c;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2be2('0x2'));var fs=require('fs');var Redis=require(_0x2be2('0x3'));var db=require(_0x2be2('0x4'))['db'];var utils=require(_0x2be2('0x5'));var logger=require(_0x2be2('0x6'))(_0x2be2('0x7'));var config=require(_0x2be2('0x8'));var jayson=require(_0x2be2('0x9'));var client=jayson[_0x2be2('0xa')][_0x2be2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59740c,_0x1fd9fc,_0x27e1a9){return new BPromise(function(_0x12d9b4,_0x4855fa){return client[_0x2be2('0xc')](_0x59740c,_0x27e1a9)[_0x2be2('0xd')](function(_0x1d20f1){logger[_0x2be2('0xe')](_0x2be2('0xf'),_0x1fd9fc,_0x2be2('0x10'));logger[_0x2be2('0x11')](_0x2be2('0x12'),_0x1fd9fc,'request\x20sent',JSON[_0x2be2('0x13')](_0x1d20f1));if(_0x1d20f1[_0x2be2('0x14')]){if(_0x1d20f1['error'][_0x2be2('0x15')]===0x1f4){logger[_0x2be2('0x14')](_0x2be2('0xf'),_0x1fd9fc,_0x1d20f1['error'][_0x2be2('0x16')]);return _0x4855fa(_0x1d20f1[_0x2be2('0x14')]['message']);}logger[_0x2be2('0x14')](_0x2be2('0xf'),_0x1fd9fc,_0x1d20f1[_0x2be2('0x14')]['message']);return _0x12d9b4(_0x1d20f1[_0x2be2('0x14')][_0x2be2('0x16')]);}else{logger['info'](_0x2be2('0xf'),_0x1fd9fc,_0x2be2('0x10'));_0x12d9b4(_0x1d20f1['result'][_0x2be2('0x16')]);}})['catch'](function(_0x435664){logger[_0x2be2('0x14')](_0x2be2('0xf'),_0x1fd9fc,_0x435664);_0x4855fa(_0x435664);});});} \ No newline at end of file +var _0xac4f=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x36c99d,_0x472d83){var _0x3d12ec=function(_0xe3f8e4){while(--_0xe3f8e4){_0x36c99d['push'](_0x36c99d['shift']());}};_0x3d12ec(++_0x472d83);}(_0xac4f,0x122));var _0xfac4=function(_0x1d453f,_0x5793a9){_0x1d453f=_0x1d453f-0x0;var _0x50996a=_0xac4f[_0x1d453f];return _0x50996a;};'use strict';var _=require(_0xfac4('0x0'));var util=require('util');var moment=require(_0xfac4('0x1'));var BPromise=require('bluebird');var rs=require(_0xfac4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfac4('0x3'));var logger=require(_0xfac4('0x4'))('rpc');var config=require(_0xfac4('0x5'));var jayson=require(_0xfac4('0x6'));var client=jayson[_0xfac4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342b8c,_0x8599e2,_0xdd64ea){return new BPromise(function(_0x2ad59f,_0x2e7774){return client[_0xfac4('0x8')](_0x342b8c,_0xdd64ea)['then'](function(_0x6c46e8){logger[_0xfac4('0x9')](_0xfac4('0xa'),_0x8599e2,_0xfac4('0xb'));logger[_0xfac4('0xc')](_0xfac4('0xd'),_0x8599e2,_0xfac4('0xb'),JSON[_0xfac4('0xe')](_0x6c46e8));if(_0x6c46e8[_0xfac4('0xf')]){if(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x10')]===0x1f4){logger[_0xfac4('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x8599e2,_0x6c46e8[_0xfac4('0xf')]['message']);return _0x2e7774(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);}logger[_0xfac4('0xf')](_0xfac4('0xa'),_0x8599e2,_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);return _0x2ad59f(_0x6c46e8[_0xfac4('0xf')][_0xfac4('0x11')]);}else{logger['info'](_0xfac4('0xa'),_0x8599e2,_0xfac4('0xb'));_0x2ad59f(_0x6c46e8[_0xfac4('0x12')][_0xfac4('0x11')]);}})[_0xfac4('0x13')](function(_0x3ce345){logger[_0xfac4('0xf')](_0xfac4('0xa'),_0x8599e2,_0x3ce345);_0x2e7774(_0x3ce345);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0de2de5..f27a0e5 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 _0x345a=['server/files/sounds/original/','originalname','format','basename','extname','now','single','file','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','diskStorage','root'];(function(_0x35de6f,_0x42689b){var _0x478c89=function(_0x39015f){while(--_0x39015f){_0x35de6f['push'](_0x35de6f['shift']());}};_0x478c89(++_0x42689b);}(_0x345a,0xba));var _0xa345=function(_0x5eb21b,_0x43da7c){_0x5eb21b=_0x5eb21b-0x0;var _0x36b304=_0x345a[_0x5eb21b];return _0x36b304;};'use strict';var multer=require(_0xa345('0x0'));var util=require(_0xa345('0x1'));var path=require(_0xa345('0x2'));var timeout=require(_0xa345('0x3'));var express=require('express');var router=express[_0xa345('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa345('0x5'));var interaction=require(_0xa345('0x6'));var config=require(_0xa345('0x7'));var controller=require(_0xa345('0x8'));router['get']('/',auth[_0xa345('0x9')](),controller[_0xa345('0xa')]);router[_0xa345('0xb')](_0xa345('0xc'),auth['isAuthenticated'](),controller[_0xa345('0xd')]);router[_0xa345('0xb')](_0xa345('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xa345('0xf')]({'destination':function(_0x5a9e22,_0x46646d,_0x4c2647){_0x4c2647(null,path['join'](config[_0xa345('0x10')],_0xa345('0x11')));},'filename':function(_0x45c5ee,_0x1a26f6,_0x56e6a9){_0x1a26f6[_0xa345('0x12')]=_0x1a26f6[_0xa345('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56e6a9(null,util[_0xa345('0x13')]('%s-%s%s',path[_0xa345('0x14')](_0x1a26f6['originalname'],path[_0xa345('0x15')](_0x1a26f6[_0xa345('0x12')])),Date[_0xa345('0x16')](),path[_0xa345('0x15')](_0x1a26f6[_0xa345('0x12')])));}})});router['post']('/',upload[_0xa345('0x17')](_0xa345('0x18')),controller['create']);router[_0xa345('0x19')](_0xa345('0xc'),auth[_0xa345('0x9')](),controller[_0xa345('0x1a')]);router[_0xa345('0x1b')](_0xa345('0xc'),auth['isAuthenticated'](),controller['delete']);module[_0xa345('0x1c')]=router; \ No newline at end of file +var _0x75a6=['../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','join','originalname','replace','format','extname','now','single','file','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x75a6,0x70));var _0x675a=function(_0x4d2cb8,_0x2e3492){_0x4d2cb8=_0x4d2cb8-0x0;var _0x2cb37f=_0x75a6[_0x4d2cb8];return _0x2cb37f;};'use strict';var multer=require(_0x675a('0x0'));var util=require(_0x675a('0x1'));var path=require(_0x675a('0x2'));var timeout=require('connect-timeout');var express=require(_0x675a('0x3'));var router=express[_0x675a('0x4')]();var fs_extra=require(_0x675a('0x5'));var auth=require(_0x675a('0x6'));var interaction=require(_0x675a('0x7'));var config=require(_0x675a('0x8'));var controller=require(_0x675a('0x9'));router[_0x675a('0xa')]('/',auth[_0x675a('0xb')](),controller[_0x675a('0xc')]);router['get'](_0x675a('0xd'),auth['isAuthenticated'](),controller[_0x675a('0xe')]);router[_0x675a('0xa')](_0x675a('0xf'),auth[_0x675a('0xb')](),controller[_0x675a('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45b34d,_0x5d790f,_0x4c5e36){_0x4c5e36(null,path[_0x675a('0x11')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x31c218,_0x25f7e4,_0x195208){_0x25f7e4[_0x675a('0x12')]=_0x25f7e4[_0x675a('0x12')][_0x675a('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x195208(null,util[_0x675a('0x14')]('%s-%s%s',path['basename'](_0x25f7e4[_0x675a('0x12')],path[_0x675a('0x15')](_0x25f7e4[_0x675a('0x12')])),Date[_0x675a('0x16')](),path['extname'](_0x25f7e4[_0x675a('0x12')])));}})});router['post']('/',upload[_0x675a('0x17')](_0x675a('0x18')),controller[_0x675a('0x19')]);router[_0x675a('0x1a')](_0x675a('0xd'),auth[_0x675a('0xb')](),controller[_0x675a('0x1b')]);router[_0x675a('0x1c')]('/:id',auth[_0x675a('0xb')](),controller[_0x675a('0x1c')]);module[_0x675a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index e073b44..cab1b31 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 _0x611e=['STRING','FLOAT','INTEGER','BIGINT','sequelize','exports'];(function(_0x3232ed,_0x3160f1){var _0x47756b=function(_0x5e7b13){while(--_0x5e7b13){_0x3232ed['push'](_0x3232ed['shift']());}};_0x47756b(++_0x3160f1);}(_0x611e,0xa6));var _0xe611=function(_0x209459,_0x4b088b){_0x209459=_0x209459-0x0;var _0x3a8736=_0x611e[_0x209459];return _0x3a8736;};'use strict';var Sequelize=require(_0xe611('0x0'));module[_0xe611('0x1')]={'name':{'type':Sequelize[_0xe611('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xe611('0x2')]},'display_name':{'type':Sequelize[_0xe611('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe611('0x2')]},'original_format':{'type':Sequelize[_0xe611('0x2')]},'original_duration':{'type':Sequelize[_0xe611('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xe611('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xe611('0x5')]},'converted_channelCount':{'type':Sequelize[_0xe611('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xe611('0x4')]}}; \ No newline at end of file +var _0x0b75=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x4e025d,_0x27c072){var _0xc32613=function(_0x473889){while(--_0x473889){_0x4e025d['push'](_0x4e025d['shift']());}};_0xc32613(++_0x27c072);}(_0x0b75,0x1aa));var _0x50b7=function(_0x11e74c,_0xdd197a){_0x11e74c=_0x11e74c-0x0;var _0x2cace2=_0x0b75[_0x11e74c];return _0x2cace2;};'use strict';var Sequelize=require(_0x50b7('0x0'));module[_0x50b7('0x1')]={'name':{'type':Sequelize[_0x50b7('0x2')],'unique':_0x50b7('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x50b7('0x2')]},'display_name':{'type':Sequelize[_0x50b7('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x50b7('0x4')]},'original_sampleCount':{'type':Sequelize[_0x50b7('0x5')]},'original_channelCount':{'type':Sequelize[_0x50b7('0x6')]},'original_bitRate':{'type':Sequelize[_0x50b7('0x5')]},'original_sampleRate':{'type':Sequelize[_0x50b7('0x6')]},'converted_format':{'type':Sequelize[_0x50b7('0x2')]},'converted_duration':{'type':Sequelize[_0x50b7('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x50b7('0x5')]},'converted_channelCount':{'type':Sequelize[_0x50b7('0x6')]},'converted_bitRate':{'type':Sequelize[_0x50b7('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x50b7('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a3f92e8..3f266aa 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 _0x7635=['user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','then','get','name','map','Sound','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','download','find','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','ValidationError','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','error','unlinkSync','send','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x57303c,_0x249ded){var _0x45d104=function(_0x534bae){while(--_0x534bae){_0x57303c['push'](_0x57303c['shift']());}};_0x45d104(++_0x249ded);}(_0x7635,0xf9));var _0x5763=function(_0x5d9830,_0x1d20ba){_0x5d9830=_0x5d9830-0x0;var _0x1aa0e5=_0x7635[_0x5d9830];return _0x1aa0e5;};'use strict';var emlformat=require(_0x5763('0x0'));var rimraf=require(_0x5763('0x1'));var zipdir=require(_0x5763('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5763('0x3'));var moment=require('moment');var BPromise=require(_0x5763('0x4'));var Mustache=require(_0x5763('0x5'));var util=require(_0x5763('0x6'));var path=require('path');var sox=require(_0x5763('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5763('0x8'));var _=require(_0x5763('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5763('0xa'));var deskjs=require(_0x5763('0xb'));var toCsv=require(_0x5763('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5763('0xd'));var authService=require(_0x5763('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5763('0xf'));var logger=require(_0x5763('0x10'))(_0x5763('0x11'));var utils=require(_0x5763('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5763('0x13'));var db=require(_0x5763('0x14'))['db'];function respondWithStatusCode(_0x3af00d,_0x24cf52){_0x24cf52=_0x24cf52||0xcc;return function(_0x67eded){if(_0x67eded){return _0x3af00d[_0x5763('0x15')](_0x24cf52);}return _0x3af00d[_0x5763('0x16')](_0x24cf52)[_0x5763('0x17')]();};}function respondWithResult(_0x1cf924,_0x29100a){_0x29100a=_0x29100a||0xc8;return function(_0x34cf3){if(_0x34cf3){return _0x1cf924[_0x5763('0x16')](_0x29100a)['json'](_0x34cf3);}};}function respondWithFilteredResult(_0x4d03a6,_0x156c50){return function(_0xd4c5fc){if(_0xd4c5fc){var _0x4a39e7=typeof _0x156c50[_0x5763('0x18')]===_0x5763('0x19')&&typeof _0x156c50[_0x5763('0x1a')]===_0x5763('0x19');var _0x5315d0=_0xd4c5fc['count'];var _0x4a8b26=_0x4a39e7?0x0:_0x156c50[_0x5763('0x18')];var _0x1a5b62=_0x4a39e7?_0xd4c5fc[_0x5763('0x1b')]:_0x156c50[_0x5763('0x18')]+_0x156c50['limit'];var _0x57de39;if(_0x1a5b62>=_0x5315d0){_0x1a5b62=_0x5315d0;_0x57de39=0xc8;}else{_0x57de39=0xce;}_0x4d03a6['status'](_0x57de39);return _0x4d03a6['set'](_0x5763('0x1c'),_0x4a8b26+'-'+_0x1a5b62+'/'+_0x5315d0)[_0x5763('0x1d')](_0xd4c5fc);}return null;};}function patchUpdates(_0x581094){return function(_0x3fb496){try{jsonpatch[_0x5763('0x1e')](_0x3fb496,_0x581094,!![]);}catch(_0x12d1cc){return BPromise['reject'](_0x12d1cc);}return _0x3fb496[_0x5763('0x1f')]();};}function saveUpdates(_0x3f39eb,_0xa2d36a){return function(_0x3a98c7){if(_0x3a98c7){return _0x3a98c7[_0x5763('0x20')](_0x3f39eb)['then'](function(_0x564dd9){return _0x564dd9;});}return null;};}function removeEntity(_0x342f02,_0xb3f6e6){return function(_0x2c504b){if(_0x2c504b){return _0x2c504b[_0x5763('0x21')]()[_0x5763('0x22')](function(){var _0xee87a0=_0x2c504b[_0x5763('0x23')]({'plain':!![]});var _0x5f4ffd='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0x5f4ffd,'resourceId':_0xee87a0['id']}})['then'](function(){return _0x2c504b;});})[_0x5763('0x22')](function(){_0x342f02[_0x5763('0x16')](0xcc)[_0x5763('0x17')]();});}};}function handleEntityNotFound(_0x30f402,_0x350433){return function(_0x5a2319){if(!_0x5a2319){_0x30f402['sendStatus'](0x194);}return _0x5a2319;};}function handleError(_0x1fa159,_0x4cf489){_0x4cf489=_0x4cf489||0x1f4;return function(_0x4d36ef){logger['error'](_0x4d36ef['stack']);if(_0x4d36ef[_0x5763('0x24')]){delete _0x4d36ef[_0x5763('0x24')];}_0x1fa159['status'](_0x4cf489)['send'](_0x4d36ef);};}exports['index']=function(_0x53743d,_0x46a002){var _0x349db8={},_0x24c973={},_0x1d53de={'count':0x0,'rows':[]};var _0x4a6f82=_[_0x5763('0x25')](db[_0x5763('0x26')][_0x5763('0x27')],function(_0x63e046){return{'name':_0x63e046['fieldName'],'type':_0x63e046[_0x5763('0x28')][_0x5763('0x29')]};});_0x24c973[_0x5763('0x2a')]=_[_0x5763('0x25')](_0x4a6f82,_0x5763('0x24'));_0x24c973[_0x5763('0x2b')]=_['keys'](_0x53743d['query']);_0x24c973['filters']=_[_0x5763('0x2c')](_0x24c973[_0x5763('0x2a')],_0x24c973[_0x5763('0x2b')]);_0x349db8[_0x5763('0x2d')]=_[_0x5763('0x2c')](_0x24c973[_0x5763('0x2a')],qs[_0x5763('0x2e')](_0x53743d['query'][_0x5763('0x2e')]));_0x349db8[_0x5763('0x2d')]=_0x349db8[_0x5763('0x2d')][_0x5763('0x2f')]?_0x349db8[_0x5763('0x2d')]:_0x24c973['model'];if(!_0x53743d[_0x5763('0x2b')][_0x5763('0x30')]('nolimit')){_0x349db8[_0x5763('0x1a')]=qs[_0x5763('0x1a')](_0x53743d[_0x5763('0x2b')]['limit']);_0x349db8[_0x5763('0x18')]=qs[_0x5763('0x18')](_0x53743d[_0x5763('0x2b')][_0x5763('0x18')]);}_0x349db8[_0x5763('0x31')]=qs[_0x5763('0x32')](_0x53743d[_0x5763('0x2b')][_0x5763('0x32')]);_0x349db8[_0x5763('0x33')]=qs[_0x5763('0x34')](_[_0x5763('0x35')](_0x53743d[_0x5763('0x2b')],_0x24c973[_0x5763('0x34')]),_0x4a6f82);if(_0x53743d[_0x5763('0x2b')][_0x5763('0x36')]){_0x349db8[_0x5763('0x33')]=_[_0x5763('0x37')](_0x349db8[_0x5763('0x33')],{'$or':_[_0x5763('0x25')](_0x4a6f82,function(_0x1fc7a3){if(_0x1fc7a3[_0x5763('0x28')]!=='VIRTUAL'){var _0x57cd2e={};_0x57cd2e[_0x1fc7a3[_0x5763('0x24')]]={'$like':'%'+_0x53743d[_0x5763('0x2b')]['filter']+'%'};return _0x57cd2e;}})});}_0x349db8=_[_0x5763('0x37')]({},_0x349db8,_0x53743d[_0x5763('0x38')]);var _0x41a2c6={'where':_0x349db8[_0x5763('0x33')]};return db['Sound'][_0x5763('0x1b')](_0x41a2c6)[_0x5763('0x22')](function(_0x418c90){_0x1d53de['count']=_0x418c90;if(_0x53743d[_0x5763('0x2b')][_0x5763('0x39')]){_0x349db8[_0x5763('0x3a')]=[{'all':!![]}];}return db[_0x5763('0x26')][_0x5763('0x3b')](_0x349db8);})[_0x5763('0x22')](function(_0x13eb1f){_0x1d53de[_0x5763('0x3c')]=_0x13eb1f;return _0x1d53de;})[_0x5763('0x22')](respondWithFilteredResult(_0x46a002,_0x349db8))[_0x5763('0x3d')](handleError(_0x46a002,null));};exports['show']=function(_0x32a23a,_0x1df800){var _0x1b2c8f={'raw':!![],'where':{'id':_0x32a23a[_0x5763('0x3e')]['id']}},_0x4b9c29={};_0x4b9c29['model']=_['keys'](db[_0x5763('0x26')][_0x5763('0x27')]);_0x4b9c29[_0x5763('0x2b')]=_[_0x5763('0x3f')](_0x32a23a[_0x5763('0x2b')]);_0x4b9c29[_0x5763('0x34')]=_['intersection'](_0x4b9c29[_0x5763('0x2a')],_0x4b9c29['query']);_0x1b2c8f['attributes']=_[_0x5763('0x2c')](_0x4b9c29[_0x5763('0x2a')],qs[_0x5763('0x2e')](_0x32a23a[_0x5763('0x2b')][_0x5763('0x2e')]));_0x1b2c8f[_0x5763('0x2d')]=_0x1b2c8f[_0x5763('0x2d')][_0x5763('0x2f')]?_0x1b2c8f[_0x5763('0x2d')]:_0x4b9c29[_0x5763('0x2a')];if(_0x32a23a[_0x5763('0x2b')][_0x5763('0x39')]){_0x1b2c8f[_0x5763('0x3a')]=[{'all':!![]}];}_0x1b2c8f=_[_0x5763('0x37')]({},_0x1b2c8f,_0x32a23a[_0x5763('0x38')]);return db[_0x5763('0x26')]['find'](_0x1b2c8f)['then'](handleEntityNotFound(_0x1df800,null))[_0x5763('0x22')](respondWithResult(_0x1df800,null))[_0x5763('0x3d')](handleError(_0x1df800,null));};exports[_0x5763('0x40')]=function(_0x51d366,_0x8ec27a,_0x4d6d4f){return db['Sound'][_0x5763('0x41')]({'where':{'id':_0x51d366['params']['id']},'attributes':[_0x5763('0x24'),'save_name',_0x5763('0x42')],'raw':!![]})[_0x5763('0x22')](handleEntityNotFound(_0x8ec27a,null))[_0x5763('0x22')](function(_0x40e24){if(_0x40e24){if(!fs[_0x5763('0x43')](path[_0x5763('0x44')](config[_0x5763('0x45')],_0x5763('0x46'),_0x40e24[_0x5763('0x47')]+'.'+_0x40e24[_0x5763('0x42')]))){throw new db['Sequelize'][(_0x5763('0x48'))]('Sound\x20not\x20found');}return _0x8ec27a[_0x5763('0x40')](path[_0x5763('0x44')](config['root'],'server/files/sounds/converted',util[_0x5763('0x49')](_0x5763('0x4a'),_0x40e24[_0x5763('0x47')],_0x40e24[_0x5763('0x42')])),util[_0x5763('0x49')](_0x5763('0x4a'),_0x40e24[_0x5763('0x24')],_0x40e24[_0x5763('0x42')]));}return null;})['catch'](handleError(_0x8ec27a,null));};exports[_0x5763('0x4b')]=function(_0x44d987,_0x5f21d5,_0x50471e){var _0x15b788={'name':path[_0x5763('0x4c')](_0x44d987[_0x5763('0x4d')][_0x5763('0x4e')],path[_0x5763('0x4f')](_0x44d987['file'][_0x5763('0x4e')])),'save_name':path[_0x5763('0x4c')](_0x44d987[_0x5763('0x4d')][_0x5763('0x50')],path[_0x5763('0x4f')](_0x44d987['file']['filename'])),'original_format':path['extname'](_0x44d987[_0x5763('0x4d')][_0x5763('0x4e')])[_0x5763('0x51')](0x1),'converted_format':'wav'};var _0x1ddf3a=path['join'](config[_0x5763('0x45')],_0x5763('0x52'),_0x44d987[_0x5763('0x4d')]['filename']);var _0x4396bf=path[_0x5763('0x44')](config[_0x5763('0x45')],_0x5763('0x46'),util['format'](_0x5763('0x4a'),path['basename'](_0x44d987[_0x5763('0x4d')][_0x5763('0x50')],path[_0x5763('0x4f')](_0x44d987[_0x5763('0x4d')]['filename'])),_0x15b788['converted_format']));logger[_0x5763('0x53')](_0x5763('0x54'),_0x1ddf3a);logger[_0x5763('0x53')](_0x5763('0x55'),_0x4396bf);try{fs[_0x5763('0x56')](_0x1ddf3a,parseInt(_0x5763('0x57'),0x8));var _0x46084c=sox[_0x5763('0x58')](_0x1ddf3a,_0x4396bf,{'sampleRate':0x1f40,'format':_0x5763('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x46084c['on'](_0x5763('0x5a'),function(_0x2111f0){fs[_0x5763('0x5b')](_0x1ddf3a);_0x5f21d5[_0x5763('0x16')](0x1f4)[_0x5763('0x5c')](_0x2111f0);});_0x46084c['on']('src',function(_0x259013){_0x15b788[_0x5763('0x5d')]=isNaN(_0x259013[_0x5763('0x5e')])?null:_0x259013[_0x5763('0x5e')]*0x3e8;_0x15b788['original_sampleCount']=isNaN(_0x259013['sampleCount'])?null:_0x259013[_0x5763('0x5f')];_0x15b788[_0x5763('0x60')]=isNaN(_0x259013[_0x5763('0x61')])?null:_0x259013[_0x5763('0x61')];_0x15b788[_0x5763('0x62')]=isNaN(_0x259013[_0x5763('0x63')])?null:_0x259013[_0x5763('0x63')];_0x15b788[_0x5763('0x64')]=isNaN(_0x259013[_0x5763('0x65')])?null:_0x259013[_0x5763('0x65')];});_0x46084c['on']('dest',function(_0x1f8784){_0x15b788[_0x5763('0x66')]=isNaN(_0x1f8784[_0x5763('0x5e')])?null:_0x1f8784[_0x5763('0x5e')]*0x3e8;_0x15b788[_0x5763('0x67')]=isNaN(_0x1f8784['sampleCount'])?null:_0x1f8784[_0x5763('0x5f')];_0x15b788[_0x5763('0x68')]=isNaN(_0x1f8784[_0x5763('0x61')])?null:_0x1f8784[_0x5763('0x61')];_0x15b788[_0x5763('0x69')]=isNaN(_0x1f8784[_0x5763('0x63')])?null:_0x1f8784[_0x5763('0x63')];_0x15b788[_0x5763('0x6a')]=isNaN(_0x1f8784['sampleRate'])?null:_0x1f8784[_0x5763('0x65')];});_0x46084c['on']('end',function(){fs[_0x5763('0x56')](_0x4396bf,parseInt('0777',0x8));return db[_0x5763('0x26')][_0x5763('0x4b')](_0x15b788)[_0x5763('0x22')](function(_0x1760e3){var _0x2c4154={'role':_0x44d987['body'][_0x5763('0x6b')],'userProfileId':_0x44d987[_0x5763('0x6c')][_0x5763('0x6d')]};if(!_0x2c4154)throw new Error(_0x5763('0x6e'));if(_0x2c4154[_0x5763('0x6b')]===_0x5763('0x6f')){var _0x190c58=_0x1760e3[_0x5763('0x23')]({'plain':!![]});return db[_0x5763('0x70')]['find']({'where':{'name':_0x5763('0x71'),'userProfileId':_0x2c4154['userProfileId']},'raw':!![]})[_0x5763('0x22')](function(_0x232efe){if(_0x232efe&&_0x232efe[_0x5763('0x72')]===0x0){return db['UserProfileResource'][_0x5763('0x4b')]({'name':_0x190c58[_0x5763('0x24')],'resourceId':_0x190c58['id'],'type':_0x232efe[_0x5763('0x24')],'sectionId':_0x232efe['id']},{})['then'](function(){return _0x1760e3;});}else{return _0x1760e3;}})['catch'](function(_0x37be9e){logger[_0x5763('0x5a')](_0x5763('0x73'),_0x37be9e);throw _0x37be9e;});}return _0x1760e3;})[_0x5763('0x22')](respondWithResult(_0x5f21d5,null))['catch'](handleError(_0x5f21d5,null));});_0x46084c[_0x5763('0x74')]();}catch(_0x27b358){_0x5f21d5[_0x5763('0x16')](0x1f4)[_0x5763('0x5c')](_0x27b358);}};exports['update']=function(_0x2bacd3,_0x465c1f,_0x793288){return db['Sound'][_0x5763('0x41')]({'where':{'id':_0x2bacd3[_0x5763('0x3e')]['id']}})[_0x5763('0x22')](handleEntityNotFound(_0x465c1f,null))[_0x5763('0x22')](saveUpdates(_['pick'](_0x2bacd3[_0x5763('0x6c')],[_0x5763('0x24'),_0x5763('0x75')]),null))['then'](respondWithResult(_0x465c1f,null))[_0x5763('0x3d')](handleError(_0x465c1f,null));};exports[_0x5763('0x76')]=function(_0x593482,_0x281620,_0x8202d3){return db[_0x5763('0x26')][_0x5763('0x41')]({'where':{'id':_0x593482[_0x5763('0x3e')]['id']}})[_0x5763('0x22')](function(_0x44cbaf){if(_0x44cbaf){return _0x44cbaf[_0x5763('0x21')]();}})[_0x5763('0x22')](function(_0x256f18){var _0x20e862=path[_0x5763('0x44')](config[_0x5763('0x45')],_0x5763('0x52'),util[_0x5763('0x49')](_0x5763('0x4a'),_0x256f18[_0x5763('0x47')],_0x256f18[_0x5763('0x77')]));var _0xe4bf5c=path['join'](config[_0x5763('0x45')],_0x5763('0x46'),util[_0x5763('0x49')](_0x5763('0x4a'),_0x256f18['save_name'],_0x256f18['converted_format']));fs['unlinkSync'](_0x20e862);fs[_0x5763('0x5b')](_0xe4bf5c);return _0x256f18;})[_0x5763('0x22')](function(_0xf8b1d0){if(_0xf8b1d0){return _0x281620[_0x5763('0x16')](0xcc)[_0x5763('0x17')]();}})[_0x5763('0x22')](handleEntityNotFound(_0x281620,null))['catch'](handleError(_0x281620,null));}; \ No newline at end of file +var _0x5343=['reject','save','update','then','destroy','get','Sounds','end','error','stack','name','send','map','Sound','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','unlinkSync','src','original_duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','start','description','delete','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5343,0x1d5));var _0x3534=function(_0x2dbf0c,_0x1a610a){_0x2dbf0c=_0x2dbf0c-0x0;var _0x3286d8=_0x5343[_0x2dbf0c];return _0x3286d8;};'use strict';var emlformat=require(_0x3534('0x0'));var rimraf=require(_0x3534('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3534('0x2'));var rp=require(_0x3534('0x3'));var moment=require(_0x3534('0x4'));var BPromise=require(_0x3534('0x5'));var Mustache=require(_0x3534('0x6'));var util=require(_0x3534('0x7'));var path=require(_0x3534('0x8'));var sox=require('sox');var csv=require(_0x3534('0x9'));var ejs=require(_0x3534('0xa'));var fs=require('fs');var fs_extra=require(_0x3534('0xb'));var _=require(_0x3534('0xc'));var squel=require('squel');var crypto=require(_0x3534('0xd'));var jsforce=require(_0x3534('0xe'));var deskjs=require(_0x3534('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3534('0x10'));var Papa=require(_0x3534('0x11'));var Redis=require(_0x3534('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3534('0x13'));var as=require(_0x3534('0x14'));var hardwareService=require(_0x3534('0x15'));var logger=require(_0x3534('0x16'))(_0x3534('0x17'));var utils=require(_0x3534('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3534('0x19'));var db=require(_0x3534('0x1a'))['db'];function respondWithStatusCode(_0x2a7a16,_0x427251){_0x427251=_0x427251||0xcc;return function(_0xdcf6f6){if(_0xdcf6f6){return _0x2a7a16[_0x3534('0x1b')](_0x427251);}return _0x2a7a16[_0x3534('0x1c')](_0x427251)['end']();};}function respondWithResult(_0x4d2d7a,_0x2e7b97){_0x2e7b97=_0x2e7b97||0xc8;return function(_0x49d39b){if(_0x49d39b){return _0x4d2d7a[_0x3534('0x1c')](_0x2e7b97)[_0x3534('0x1d')](_0x49d39b);}};}function respondWithFilteredResult(_0x41841a,_0x83ce40){return function(_0x28ef3b){if(_0x28ef3b){var _0x237159=typeof _0x83ce40[_0x3534('0x1e')]===_0x3534('0x1f')&&typeof _0x83ce40[_0x3534('0x20')]==='undefined';var _0x4061bd=_0x28ef3b[_0x3534('0x21')];var _0x4acc7c=_0x237159?0x0:_0x83ce40[_0x3534('0x1e')];var _0x590f15=_0x237159?_0x28ef3b[_0x3534('0x21')]:_0x83ce40[_0x3534('0x1e')]+_0x83ce40[_0x3534('0x20')];var _0x36c5c8;if(_0x590f15>=_0x4061bd){_0x590f15=_0x4061bd;_0x36c5c8=0xc8;}else{_0x36c5c8=0xce;}_0x41841a[_0x3534('0x1c')](_0x36c5c8);return _0x41841a['set']('Content-Range',_0x4acc7c+'-'+_0x590f15+'/'+_0x4061bd)['json'](_0x28ef3b);}return null;};}function patchUpdates(_0x55d79c){return function(_0x3af564){try{jsonpatch[_0x3534('0x22')](_0x3af564,_0x55d79c,!![]);}catch(_0x198e59){return BPromise[_0x3534('0x23')](_0x198e59);}return _0x3af564[_0x3534('0x24')]();};}function saveUpdates(_0x33a36c,_0x2a1279){return function(_0x5625bc){if(_0x5625bc){return _0x5625bc[_0x3534('0x25')](_0x33a36c)[_0x3534('0x26')](function(_0x22edba){return _0x22edba;});}return null;};}function removeEntity(_0x3ef25b,_0x31bc04){return function(_0x2db977){if(_0x2db977){return _0x2db977[_0x3534('0x27')]()['then'](function(){var _0x20124d=_0x2db977[_0x3534('0x28')]({'plain':!![]});var _0x59a6d6=_0x3534('0x29');return db['UserProfileResource'][_0x3534('0x27')]({'where':{'type':_0x59a6d6,'resourceId':_0x20124d['id']}})['then'](function(){return _0x2db977;});})[_0x3534('0x26')](function(){_0x3ef25b['status'](0xcc)[_0x3534('0x2a')]();});}};}function handleEntityNotFound(_0xfb8e70,_0x19909e){return function(_0x3b7f72){if(!_0x3b7f72){_0xfb8e70[_0x3534('0x1b')](0x194);}return _0x3b7f72;};}function handleError(_0x2880d7,_0x4d2344){_0x4d2344=_0x4d2344||0x1f4;return function(_0x16cb4e){logger[_0x3534('0x2b')](_0x16cb4e[_0x3534('0x2c')]);if(_0x16cb4e[_0x3534('0x2d')]){delete _0x16cb4e['name'];}_0x2880d7['status'](_0x4d2344)[_0x3534('0x2e')](_0x16cb4e);};}exports['index']=function(_0x19ab9a,_0x28230a){var _0x3f8675={},_0x32fde2={},_0x388d1f={'count':0x0,'rows':[]};var _0xe7a32e=_[_0x3534('0x2f')](db[_0x3534('0x30')]['rawAttributes'],function(_0x4f13c6){return{'name':_0x4f13c6[_0x3534('0x31')],'type':_0x4f13c6[_0x3534('0x32')]['key']};});_0x32fde2['model']=_[_0x3534('0x2f')](_0xe7a32e,_0x3534('0x2d'));_0x32fde2['query']=_[_0x3534('0x33')](_0x19ab9a[_0x3534('0x34')]);_0x32fde2[_0x3534('0x35')]=_[_0x3534('0x36')](_0x32fde2[_0x3534('0x37')],_0x32fde2[_0x3534('0x34')]);_0x3f8675[_0x3534('0x38')]=_[_0x3534('0x36')](_0x32fde2[_0x3534('0x37')],qs[_0x3534('0x39')](_0x19ab9a[_0x3534('0x34')]['fields']));_0x3f8675[_0x3534('0x38')]=_0x3f8675['attributes'][_0x3534('0x3a')]?_0x3f8675['attributes']:_0x32fde2[_0x3534('0x37')];if(!_0x19ab9a[_0x3534('0x34')][_0x3534('0x3b')]('nolimit')){_0x3f8675[_0x3534('0x20')]=qs['limit'](_0x19ab9a[_0x3534('0x34')][_0x3534('0x20')]);_0x3f8675[_0x3534('0x1e')]=qs['offset'](_0x19ab9a['query']['offset']);}_0x3f8675[_0x3534('0x3c')]=qs[_0x3534('0x3d')](_0x19ab9a[_0x3534('0x34')][_0x3534('0x3d')]);_0x3f8675[_0x3534('0x3e')]=qs['filters'](_[_0x3534('0x3f')](_0x19ab9a[_0x3534('0x34')],_0x32fde2[_0x3534('0x35')]),_0xe7a32e);if(_0x19ab9a[_0x3534('0x34')][_0x3534('0x40')]){_0x3f8675[_0x3534('0x3e')]=_[_0x3534('0x41')](_0x3f8675[_0x3534('0x3e')],{'$or':_[_0x3534('0x2f')](_0xe7a32e,function(_0x2485fb){if(_0x2485fb[_0x3534('0x32')]!==_0x3534('0x42')){var _0x23cd43={};_0x23cd43[_0x2485fb[_0x3534('0x2d')]]={'$like':'%'+_0x19ab9a['query'][_0x3534('0x40')]+'%'};return _0x23cd43;}})});}_0x3f8675=_[_0x3534('0x41')]({},_0x3f8675,_0x19ab9a[_0x3534('0x43')]);var _0x42d03a={'where':_0x3f8675[_0x3534('0x3e')]};return db[_0x3534('0x30')][_0x3534('0x21')](_0x42d03a)[_0x3534('0x26')](function(_0x16c269){_0x388d1f['count']=_0x16c269;if(_0x19ab9a['query'][_0x3534('0x44')]){_0x3f8675['include']=[{'all':!![]}];}return db[_0x3534('0x30')][_0x3534('0x45')](_0x3f8675);})[_0x3534('0x26')](function(_0x1cd14c){_0x388d1f['rows']=_0x1cd14c;return _0x388d1f;})[_0x3534('0x26')](respondWithFilteredResult(_0x28230a,_0x3f8675))[_0x3534('0x46')](handleError(_0x28230a,null));};exports['show']=function(_0x324fe5,_0x241bed){var _0x46f111={'raw':!![],'where':{'id':_0x324fe5[_0x3534('0x47')]['id']}},_0x3f2cb4={};_0x3f2cb4[_0x3534('0x37')]=_[_0x3534('0x33')](db[_0x3534('0x30')][_0x3534('0x48')]);_0x3f2cb4[_0x3534('0x34')]=_[_0x3534('0x33')](_0x324fe5[_0x3534('0x34')]);_0x3f2cb4[_0x3534('0x35')]=_[_0x3534('0x36')](_0x3f2cb4[_0x3534('0x37')],_0x3f2cb4[_0x3534('0x34')]);_0x46f111[_0x3534('0x38')]=_[_0x3534('0x36')](_0x3f2cb4['model'],qs[_0x3534('0x39')](_0x324fe5['query']['fields']));_0x46f111[_0x3534('0x38')]=_0x46f111['attributes'][_0x3534('0x3a')]?_0x46f111[_0x3534('0x38')]:_0x3f2cb4['model'];if(_0x324fe5[_0x3534('0x34')][_0x3534('0x44')]){_0x46f111[_0x3534('0x49')]=[{'all':!![]}];}_0x46f111=_[_0x3534('0x41')]({},_0x46f111,_0x324fe5['options']);return db[_0x3534('0x30')][_0x3534('0x4a')](_0x46f111)[_0x3534('0x26')](handleEntityNotFound(_0x241bed,null))[_0x3534('0x26')](respondWithResult(_0x241bed,null))[_0x3534('0x46')](handleError(_0x241bed,null));};exports[_0x3534('0x4b')]=function(_0x47ca21,_0x5a1437,_0x100541){return db[_0x3534('0x30')][_0x3534('0x4a')]({'where':{'id':_0x47ca21['params']['id']},'attributes':[_0x3534('0x2d'),_0x3534('0x4c'),_0x3534('0x4d')],'raw':!![]})[_0x3534('0x26')](handleEntityNotFound(_0x5a1437,null))[_0x3534('0x26')](function(_0x384a42){if(_0x384a42){if(!fs[_0x3534('0x4e')](path[_0x3534('0x4f')](config[_0x3534('0x50')],_0x3534('0x51'),_0x384a42['save_name']+'.'+_0x384a42[_0x3534('0x4d')]))){throw new db[(_0x3534('0x52'))]['ValidationError'](_0x3534('0x53'));}return _0x5a1437['download'](path[_0x3534('0x4f')](config[_0x3534('0x50')],'server/files/sounds/converted',util[_0x3534('0x54')](_0x3534('0x55'),_0x384a42[_0x3534('0x4c')],_0x384a42[_0x3534('0x4d')])),util[_0x3534('0x54')](_0x3534('0x55'),_0x384a42[_0x3534('0x2d')],_0x384a42[_0x3534('0x4d')]));}return null;})[_0x3534('0x46')](handleError(_0x5a1437,null));};exports[_0x3534('0x56')]=function(_0x3383da,_0xf017a9,_0xd5d060){var _0x186d83={'name':path[_0x3534('0x57')](_0x3383da[_0x3534('0x58')][_0x3534('0x59')],path[_0x3534('0x5a')](_0x3383da['file'][_0x3534('0x59')])),'save_name':path['basename'](_0x3383da['file'][_0x3534('0x5b')],path[_0x3534('0x5a')](_0x3383da[_0x3534('0x58')][_0x3534('0x5b')])),'original_format':path[_0x3534('0x5a')](_0x3383da[_0x3534('0x58')][_0x3534('0x59')])[_0x3534('0x5c')](0x1),'converted_format':_0x3534('0x5d')};var _0x2e0ef2=path[_0x3534('0x4f')](config[_0x3534('0x50')],_0x3534('0x5e'),_0x3383da[_0x3534('0x58')]['filename']);var _0x574f93=path[_0x3534('0x4f')](config[_0x3534('0x50')],_0x3534('0x51'),util[_0x3534('0x54')](_0x3534('0x55'),path['basename'](_0x3383da[_0x3534('0x58')]['filename'],path[_0x3534('0x5a')](_0x3383da[_0x3534('0x58')]['filename'])),_0x186d83[_0x3534('0x4d')]));logger[_0x3534('0x5f')](_0x3534('0x60'),_0x2e0ef2);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x574f93);try{fs[_0x3534('0x61')](_0x2e0ef2,parseInt('0777',0x8));var _0x2ddb25=sox['transcode'](_0x2e0ef2,_0x574f93,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2ddb25['on'](_0x3534('0x2b'),function(_0x1d0e9f){fs[_0x3534('0x62')](_0x2e0ef2);_0xf017a9[_0x3534('0x1c')](0x1f4)[_0x3534('0x2e')](_0x1d0e9f);});_0x2ddb25['on'](_0x3534('0x63'),function(_0x44bcad){_0x186d83[_0x3534('0x64')]=isNaN(_0x44bcad['duration'])?null:_0x44bcad['duration']*0x3e8;_0x186d83['original_sampleCount']=isNaN(_0x44bcad[_0x3534('0x65')])?null:_0x44bcad['sampleCount'];_0x186d83[_0x3534('0x66')]=isNaN(_0x44bcad[_0x3534('0x67')])?null:_0x44bcad[_0x3534('0x67')];_0x186d83[_0x3534('0x68')]=isNaN(_0x44bcad[_0x3534('0x69')])?null:_0x44bcad[_0x3534('0x69')];_0x186d83[_0x3534('0x6a')]=isNaN(_0x44bcad['sampleRate'])?null:_0x44bcad[_0x3534('0x6b')];});_0x2ddb25['on'](_0x3534('0x6c'),function(_0x5e769d){_0x186d83['converted_duration']=isNaN(_0x5e769d[_0x3534('0x6d')])?null:_0x5e769d['duration']*0x3e8;_0x186d83[_0x3534('0x6e')]=isNaN(_0x5e769d[_0x3534('0x65')])?null:_0x5e769d[_0x3534('0x65')];_0x186d83[_0x3534('0x6f')]=isNaN(_0x5e769d[_0x3534('0x67')])?null:_0x5e769d[_0x3534('0x67')];_0x186d83[_0x3534('0x70')]=isNaN(_0x5e769d['bitRate'])?null:_0x5e769d[_0x3534('0x69')];_0x186d83[_0x3534('0x71')]=isNaN(_0x5e769d['sampleRate'])?null:_0x5e769d[_0x3534('0x6b')];});_0x2ddb25['on']('end',function(){fs[_0x3534('0x61')](_0x574f93,parseInt(_0x3534('0x72'),0x8));return db[_0x3534('0x30')][_0x3534('0x56')](_0x186d83)[_0x3534('0x26')](function(_0x42c4ea){var _0x3f695a={'role':_0x3383da[_0x3534('0x73')][_0x3534('0x74')],'userProfileId':_0x3383da[_0x3534('0x73')][_0x3534('0x75')]};if(!_0x3f695a)throw new Error(_0x3534('0x76'));if(_0x3f695a['role']===_0x3534('0x77')){var _0x4939b4=_0x42c4ea[_0x3534('0x28')]({'plain':!![]});return db[_0x3534('0x78')][_0x3534('0x4a')]({'where':{'name':_0x3534('0x29'),'userProfileId':_0x3f695a[_0x3534('0x75')]},'raw':!![]})['then'](function(_0x3b5cf1){if(_0x3b5cf1&&_0x3b5cf1[_0x3534('0x79')]===0x0){return db[_0x3534('0x7a')][_0x3534('0x56')]({'name':_0x4939b4[_0x3534('0x2d')],'resourceId':_0x4939b4['id'],'type':_0x3b5cf1[_0x3534('0x2d')],'sectionId':_0x3b5cf1['id']},{})[_0x3534('0x26')](function(){return _0x42c4ea;});}else{return _0x42c4ea;}})['catch'](function(_0x2c6743){logger[_0x3534('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c6743);throw _0x2c6743;});}return _0x42c4ea;})[_0x3534('0x26')](respondWithResult(_0xf017a9,null))[_0x3534('0x46')](handleError(_0xf017a9,null));});_0x2ddb25[_0x3534('0x7b')]();}catch(_0x399798){_0xf017a9['status'](0x1f4)[_0x3534('0x2e')](_0x399798);}};exports['update']=function(_0x9e15c8,_0x5d52e7,_0x799d29){return db[_0x3534('0x30')][_0x3534('0x4a')]({'where':{'id':_0x9e15c8[_0x3534('0x47')]['id']}})[_0x3534('0x26')](handleEntityNotFound(_0x5d52e7,null))[_0x3534('0x26')](saveUpdates(_[_0x3534('0x3f')](_0x9e15c8[_0x3534('0x73')],['name',_0x3534('0x7c')]),null))[_0x3534('0x26')](respondWithResult(_0x5d52e7,null))[_0x3534('0x46')](handleError(_0x5d52e7,null));};exports[_0x3534('0x7d')]=function(_0x49778f,_0x56a051,_0x56d8cc){return db[_0x3534('0x30')][_0x3534('0x4a')]({'where':{'id':_0x49778f[_0x3534('0x47')]['id']}})[_0x3534('0x26')](function(_0xfe6e5){if(_0xfe6e5){return _0xfe6e5[_0x3534('0x27')]();}})[_0x3534('0x26')](function(_0x1615c0){var _0x5be279=path[_0x3534('0x4f')](config[_0x3534('0x50')],'server/files/sounds/original',util[_0x3534('0x54')](_0x3534('0x55'),_0x1615c0[_0x3534('0x4c')],_0x1615c0['original_format']));var _0x421fa8=path[_0x3534('0x4f')](config[_0x3534('0x50')],'server/files/sounds/converted',util[_0x3534('0x54')](_0x3534('0x55'),_0x1615c0['save_name'],_0x1615c0['converted_format']));fs[_0x3534('0x62')](_0x5be279);fs[_0x3534('0x62')](_0x421fa8);return _0x1615c0;})[_0x3534('0x26')](function(_0x5bce59){if(_0x5bce59){return _0x56a051[_0x3534('0x1c')](0xcc)[_0x3534('0x2a')]();}})[_0x3534('0x26')](handleEntityNotFound(_0x56a051,null))['catch'](handleError(_0x56a051,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c6aef39..e25383f 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 _0xb674=['exports','define','Sound','lodash','util','bluebird','request-promise','path'];(function(_0x2d5dcd,_0x550287){var _0x53076d=function(_0xcfc43a){while(--_0xcfc43a){_0x2d5dcd['push'](_0x2d5dcd['shift']());}};_0x53076d(++_0x550287);}(_0xb674,0x1d3));var _0x4b67=function(_0x96c265,_0x269a5e){_0x96c265=_0x96c265-0x0;var _0x24a383=_0xb674[_0x96c265];return _0x24a383;};'use strict';var _=require(_0x4b67('0x0'));var util=require(_0x4b67('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b67('0x2'));var rp=require(_0x4b67('0x3'));var fs=require('fs');var path=require(_0x4b67('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x4b67('0x5')]=function(_0x5924d7,_0x1990c2){return _0x5924d7[_0x4b67('0x6')](_0x4b67('0x7'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99f8=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x99f8,0x1cd));var _0x899f=function(_0x552714,_0x4db666){_0x552714=_0x552714-0x0;var _0x2e4512=_0x99f8[_0x552714];return _0x2e4512;};'use strict';var _=require(_0x899f('0x0'));var util=require(_0x899f('0x1'));var logger=require(_0x899f('0x2'))('api');var moment=require(_0x899f('0x3'));var BPromise=require(_0x899f('0x4'));var rp=require(_0x899f('0x5'));var fs=require('fs');var path=require(_0x899f('0x6'));var rimraf=require(_0x899f('0x7'));var config=require(_0x899f('0x8'));var attributes=require(_0x899f('0x9'));module[_0x899f('0xa')]=function(_0x3a375d,_0x453001){return _0x3a375d[_0x899f('0xb')](_0x899f('0xc'),attributes,{'tableName':_0x899f('0xd'),'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 f3688a7..6ba1236 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 _0x702f=['options','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','Sound','find'];(function(_0x576f83,_0x3ed865){var _0x1cab7e=function(_0x452078){while(--_0x452078){_0x576f83['push'](_0x576f83['shift']());}};_0x1cab7e(++_0x3ed865);}(_0x702f,0x85));var _0xf702=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x702f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xf702('0x0'));var moment=require(_0xf702('0x1'));var BPromise=require(_0xf702('0x2'));var rs=require(_0xf702('0x3'));var fs=require('fs');var Redis=require(_0xf702('0x4'));var db=require(_0xf702('0x5'))['db'];var utils=require(_0xf702('0x6'));var logger=require('../../config/logger')(_0xf702('0x7'));var config=require('../../config/environment');var jayson=require(_0xf702('0x8'));var client=jayson[_0xf702('0x9')][_0xf702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20a113,_0x36bb11,_0x2b2430){return new BPromise(function(_0x3384b3,_0x63f278){return client[_0xf702('0xb')](_0x20a113,_0x2b2430)[_0xf702('0xc')](function(_0x24b12f){logger['info'](_0xf702('0xd'),_0x36bb11,_0xf702('0xe'));logger[_0xf702('0xf')](_0xf702('0x10'),_0x36bb11,_0xf702('0xe'),JSON[_0xf702('0x11')](_0x24b12f));if(_0x24b12f[_0xf702('0x12')]){if(_0x24b12f['error'][_0xf702('0x13')]===0x1f4){logger['error'](_0xf702('0xd'),_0x36bb11,_0x24b12f[_0xf702('0x12')][_0xf702('0x14')]);return _0x63f278(_0x24b12f[_0xf702('0x12')][_0xf702('0x14')]);}logger[_0xf702('0x12')](_0xf702('0xd'),_0x36bb11,_0x24b12f[_0xf702('0x12')][_0xf702('0x14')]);return _0x3384b3(_0x24b12f['error'][_0xf702('0x14')]);}else{logger[_0xf702('0x15')](_0xf702('0xd'),_0x36bb11,_0xf702('0xe'));_0x3384b3(_0x24b12f[_0xf702('0x16')][_0xf702('0x14')]);}})[_0xf702('0x17')](function(_0x29586e){logger[_0xf702('0x12')](_0xf702('0xd'),_0x36bb11,_0x29586e);_0x63f278(_0x29586e);});});}exports[_0xf702('0x18')]=function(_0x30ea2f){var _0x967867=this;return new Promise(function(_0x286cdd,_0x3d9e34){return db[_0xf702('0x19')][_0xf702('0x1a')]({'raw':_0x30ea2f['options']?_0x30ea2f[_0xf702('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x30ea2f[_0xf702('0x1b')]?_0x30ea2f[_0xf702('0x1b')]['where']||null:null,'attributes':_0x30ea2f['options']?_0x30ea2f[_0xf702('0x1b')][_0xf702('0x1c')]||null:null,'include':_0x30ea2f[_0xf702('0x1b')]?_0x30ea2f[_0xf702('0x1b')][_0xf702('0x1d')]?_[_0xf702('0x1e')](_0x30ea2f['options'][_0xf702('0x1d')],function(_0x12dab2){return{'model':db[_0x12dab2['model']],'as':_0x12dab2['as'],'attributes':_0x12dab2[_0xf702('0x1c')],'include':_0x12dab2[_0xf702('0x1d')]?_[_0xf702('0x1e')](_0x12dab2[_0xf702('0x1d')],function(_0x54a34c){return{'model':db[_0x54a34c[_0xf702('0x1f')]],'as':_0x54a34c['as'],'attributes':_0x54a34c[_0xf702('0x1c')],'include':_0x54a34c['include']?_[_0xf702('0x1e')](_0x54a34c[_0xf702('0x1d')],function(_0x28d97c){return{'model':db[_0x28d97c['model']],'as':_0x28d97c['as'],'attributes':_0x28d97c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf702('0xc')](function(_0x13ae9b){logger[_0xf702('0x15')](_0xf702('0x18'),_0x30ea2f);logger[_0xf702('0xf')](_0xf702('0x18'),_0x30ea2f,JSON['stringify'](_0x13ae9b));_0x286cdd(_0x13ae9b);})[_0xf702('0x17')](function(_0x4e3af9){logger[_0xf702('0x12')](_0xf702('0x18'),_0x4e3af9[_0xf702('0x14')],_0x30ea2f);_0x3d9e34(_0x967867[_0xf702('0x12')](0x1f4,_0x4e3af9[_0xf702('0x14')]));});});}; \ No newline at end of file +var _0x4994=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSound','Sound','find','options','where','attributes','map','include','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x58b5d7,_0x79ca8a){var _0x817269=function(_0x58dd9f){while(--_0x58dd9f){_0x58b5d7['push'](_0x58b5d7['shift']());}};_0x817269(++_0x79ca8a);}(_0x4994,0x1d1));var _0x4499=function(_0xdecf6d,_0x2752ec){_0xdecf6d=_0xdecf6d-0x0;var _0x16a5da=_0x4994[_0xdecf6d];return _0x16a5da;};'use strict';var _=require(_0x4499('0x0'));var util=require(_0x4499('0x1'));var moment=require(_0x4499('0x2'));var BPromise=require('bluebird');var rs=require(_0x4499('0x3'));var fs=require('fs');var Redis=require(_0x4499('0x4'));var db=require(_0x4499('0x5'))['db'];var utils=require(_0x4499('0x6'));var logger=require(_0x4499('0x7'))(_0x4499('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4499('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x144e28,_0x310997,_0xa853cc){return new BPromise(function(_0x377602,_0x53f4c5){return client[_0x4499('0xa')](_0x144e28,_0xa853cc)[_0x4499('0xb')](function(_0x509b54){logger[_0x4499('0xc')](_0x4499('0xd'),_0x310997,_0x4499('0xe'));logger[_0x4499('0xf')](_0x4499('0x10'),_0x310997,_0x4499('0xe'),JSON[_0x4499('0x11')](_0x509b54));if(_0x509b54[_0x4499('0x12')]){if(_0x509b54[_0x4499('0x12')][_0x4499('0x13')]===0x1f4){logger['error'](_0x4499('0xd'),_0x310997,_0x509b54[_0x4499('0x12')][_0x4499('0x14')]);return _0x53f4c5(_0x509b54[_0x4499('0x12')]['message']);}logger[_0x4499('0x12')](_0x4499('0xd'),_0x310997,_0x509b54[_0x4499('0x12')]['message']);return _0x377602(_0x509b54['error'][_0x4499('0x14')]);}else{logger[_0x4499('0xc')](_0x4499('0xd'),_0x310997,_0x4499('0xe'));_0x377602(_0x509b54[_0x4499('0x15')]['message']);}})['catch'](function(_0x2e8941){logger['error']('Sound,\x20%s,\x20%s',_0x310997,_0x2e8941);_0x53f4c5(_0x2e8941);});});}exports[_0x4499('0x16')]=function(_0xecfe5b){var _0x32d2de=this;return new Promise(function(_0x2aab2e,_0x5b9359){return db[_0x4499('0x17')][_0x4499('0x18')]({'raw':_0xecfe5b[_0x4499('0x19')]?_0xecfe5b[_0x4499('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xecfe5b[_0x4499('0x19')]?_0xecfe5b['options'][_0x4499('0x1a')]||null:null,'attributes':_0xecfe5b[_0x4499('0x19')]?_0xecfe5b[_0x4499('0x19')][_0x4499('0x1b')]||null:null,'include':_0xecfe5b[_0x4499('0x19')]?_0xecfe5b[_0x4499('0x19')]['include']?_[_0x4499('0x1c')](_0xecfe5b[_0x4499('0x19')][_0x4499('0x1d')],function(_0x10d9b8){return{'model':db[_0x10d9b8[_0x4499('0x1e')]],'as':_0x10d9b8['as'],'attributes':_0x10d9b8[_0x4499('0x1b')],'include':_0x10d9b8['include']?_[_0x4499('0x1c')](_0x10d9b8[_0x4499('0x1d')],function(_0xe2d0dc){return{'model':db[_0xe2d0dc['model']],'as':_0xe2d0dc['as'],'attributes':_0xe2d0dc[_0x4499('0x1b')],'include':_0xe2d0dc[_0x4499('0x1d')]?_[_0x4499('0x1c')](_0xe2d0dc['include'],function(_0x13ac35){return{'model':db[_0x13ac35[_0x4499('0x1e')]],'as':_0x13ac35['as'],'attributes':_0x13ac35[_0x4499('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4499('0xb')](function(_0x5b0e0d){logger[_0x4499('0xc')](_0x4499('0x16'),_0xecfe5b);logger['debug'](_0x4499('0x16'),_0xecfe5b,JSON[_0x4499('0x11')](_0x5b0e0d));_0x2aab2e(_0x5b0e0d);})[_0x4499('0x1f')](function(_0x1fcd70){logger['error'](_0x4499('0x16'),_0x1fcd70[_0x4499('0x14')],_0xecfe5b);_0x5b9359(_0x32d2de[_0x4499('0x12')](0x1f4,_0x1fcd70[_0x4499('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f7a2c14..1511e1f 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x57dd90,_0x58ddc4){var _0x34abca=function(_0x166d60){while(--_0x166d60){_0x57dd90['push'](_0x57dd90['shift']());}};_0x34abca(++_0x58ddc4);}(_0xda3f,0xec));var _0xfda3=function(_0x56543e,_0x7fb94f){_0x56543e=_0x56543e-0x0;var _0x1f5487=_0xda3f[_0x56543e];return _0x1f5487;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x27a0a9,_0x1e7dd1){var _0x11cb3b=function(_0x5a9aa3){while(--_0x5a9aa3){_0x27a0a9['push'](_0x27a0a9['shift']());}};_0x11cb3b(++_0x1e7dd1);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x5eb8[_0x3653c7];return _0x58a021;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2cebea5..a916ed5 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 _0xec0c=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0xa9fdc4,_0x3a59db){var _0x3874da=function(_0x2f64ae){while(--_0x2f64ae){_0xa9fdc4['push'](_0xa9fdc4['shift']());}};_0x3874da(++_0x3a59db);}(_0xec0c,0x7f));var _0xcec0=function(_0x5cc8d0,_0x1bfedf){_0x5cc8d0=_0x5cc8d0-0x0;var _0x11beb9=_0xec0c[_0x5cc8d0];return _0x11beb9;};'use strict';var Sequelize=require(_0xcec0('0x0'));module[_0xcec0('0x1')]={'uniqueid':{'type':Sequelize[_0xcec0('0x2')]},'body':{'type':Sequelize[_0xcec0('0x3')](_0xcec0('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xcec0('0x5')]('in',_0xcec0('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xcec0('0x2')]},'providerResponse':{'type':Sequelize[_0xcec0('0x3')]}}; \ No newline at end of file +var _0x5c70=['STRING','TEXT','sequelize','medium','ENUM','out'];(function(_0x30b02d,_0x1c4268){var _0x69edfb=function(_0x3f8a71){while(--_0x3f8a71){_0x30b02d['push'](_0x30b02d['shift']());}};_0x69edfb(++_0x1c4268);}(_0x5c70,0x1ac));var _0x05c7=function(_0x3e0296,_0x466147){_0x3e0296=_0x3e0296-0x0;var _0x29a629=_0x5c70[_0x3e0296];return _0x29a629;};'use strict';var Sequelize=require(_0x05c7('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x05c7('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x05c7('0x2')]('in',_0x05c7('0x3')),'defaultValue':_0x05c7('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x05c7('0x4')]},'providerResponse':{'type':Sequelize[_0x05c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6a507cc..497842b 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 _0x1956=['stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error'];(function(_0x18d0ec,_0x494303){var _0xcc9a8e=function(_0x31e58b){while(--_0x31e58b){_0x18d0ec['push'](_0x18d0ec['shift']());}};_0xcc9a8e(++_0x494303);}(_0x1956,0x15c));var _0x6195=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x1956[_0x49a57c];return _0x4e0316;};'use strict';var emlformat=require(_0x6195('0x0'));var rimraf=require(_0x6195('0x1'));var zipdir=require(_0x6195('0x2'));var jsonpatch=require(_0x6195('0x3'));var rp=require(_0x6195('0x4'));var moment=require(_0x6195('0x5'));var BPromise=require(_0x6195('0x6'));var Mustache=require('mustache');var util=require(_0x6195('0x7'));var path=require(_0x6195('0x8'));var sox=require(_0x6195('0x9'));var csv=require(_0x6195('0xa'));var ejs=require(_0x6195('0xb'));var fs=require('fs');var fs_extra=require(_0x6195('0xc'));var _=require(_0x6195('0xd'));var squel=require(_0x6195('0xe'));var crypto=require(_0x6195('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6195('0x10'));var toCsv=require(_0x6195('0xa'));var querystring=require(_0x6195('0x11'));var Papa=require(_0x6195('0x12'));var Redis=require(_0x6195('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6195('0x14'));var as=require(_0x6195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6195('0x16'))(_0x6195('0x17'));var utils=require(_0x6195('0x18'));var config=require(_0x6195('0x19'));var licenseUtil=require(_0x6195('0x1a'));var db=require(_0x6195('0x1b'))['db'];function respondWithStatusCode(_0x1282f5,_0x96b635){_0x96b635=_0x96b635||0xcc;return function(_0x51b975){if(_0x51b975){return _0x1282f5[_0x6195('0x1c')](_0x96b635);}return _0x1282f5[_0x6195('0x1d')](_0x96b635)['end']();};}function respondWithResult(_0x29c5e0,_0x431b3d){_0x431b3d=_0x431b3d||0xc8;return function(_0x5320f7){if(_0x5320f7){return _0x29c5e0[_0x6195('0x1d')](_0x431b3d)[_0x6195('0x1e')](_0x5320f7);}};}function respondWithFilteredResult(_0x1af54a,_0x397370){return function(_0x6653b7){if(_0x6653b7){var _0x1a555f=typeof _0x397370[_0x6195('0x1f')]===_0x6195('0x20')&&typeof _0x397370['limit']==='undefined';var _0x21bf76=_0x6653b7[_0x6195('0x21')];var _0x6174a3=_0x1a555f?0x0:_0x397370[_0x6195('0x1f')];var _0x3b42a0=_0x1a555f?_0x6653b7['count']:_0x397370[_0x6195('0x1f')]+_0x397370['limit'];var _0x40134d;if(_0x3b42a0>=_0x21bf76){_0x3b42a0=_0x21bf76;_0x40134d=0xc8;}else{_0x40134d=0xce;}_0x1af54a[_0x6195('0x1d')](_0x40134d);return _0x1af54a[_0x6195('0x22')](_0x6195('0x23'),_0x6174a3+'-'+_0x3b42a0+'/'+_0x21bf76)[_0x6195('0x1e')](_0x6653b7);}return null;};}function patchUpdates(_0x4e9673){return function(_0x4cadf3){try{jsonpatch['apply'](_0x4cadf3,_0x4e9673,!![]);}catch(_0x5595e0){return BPromise[_0x6195('0x24')](_0x5595e0);}return _0x4cadf3[_0x6195('0x25')]();};}function saveUpdates(_0xc1e5d9,_0x4f2d43){return function(_0x5bed95){if(_0x5bed95){return _0x5bed95[_0x6195('0x26')](_0xc1e5d9)['then'](function(_0x4181f3){return _0x4181f3;});}return null;};}function removeEntity(_0x11cc46,_0x184080){return function(_0x5dbe2c){if(_0x5dbe2c){return _0x5dbe2c[_0x6195('0x27')]()[_0x6195('0x28')](function(){_0x11cc46[_0x6195('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b83dc,_0x5d3859){return function(_0x449360){if(!_0x449360){_0x5b83dc[_0x6195('0x1c')](0x194);}return _0x449360;};}function handleError(_0x320de9,_0x2aa569){_0x2aa569=_0x2aa569||0x1f4;return function(_0x283829){logger[_0x6195('0x29')](_0x283829[_0x6195('0x2a')]);if(_0x283829[_0x6195('0x2b')]){delete _0x283829[_0x6195('0x2b')];}_0x320de9[_0x6195('0x1d')](_0x2aa569)['send'](_0x283829);};}exports[_0x6195('0x2c')]=function(_0x5af2af,_0x126409){var _0x47563b={},_0x418144={},_0x3688d6={'count':0x0,'rows':[]};var _0x1402b9=_[_0x6195('0x2d')](db[_0x6195('0x2e')][_0x6195('0x2f')],function(_0x217ac1){return{'name':_0x217ac1[_0x6195('0x30')],'type':_0x217ac1[_0x6195('0x31')]['key']};});_0x418144[_0x6195('0x32')]=_[_0x6195('0x2d')](_0x1402b9,_0x6195('0x2b'));_0x418144[_0x6195('0x33')]=_['keys'](_0x5af2af[_0x6195('0x33')]);_0x418144['filters']=_[_0x6195('0x34')](_0x418144[_0x6195('0x32')],_0x418144['query']);_0x47563b[_0x6195('0x35')]=_[_0x6195('0x34')](_0x418144['model'],qs[_0x6195('0x36')](_0x5af2af[_0x6195('0x33')][_0x6195('0x36')]));_0x47563b[_0x6195('0x35')]=_0x47563b[_0x6195('0x35')][_0x6195('0x37')]?_0x47563b[_0x6195('0x35')]:_0x418144[_0x6195('0x32')];if(!_0x5af2af[_0x6195('0x33')]['hasOwnProperty'](_0x6195('0x38'))){_0x47563b[_0x6195('0x39')]=qs[_0x6195('0x39')](_0x5af2af['query'][_0x6195('0x39')]);_0x47563b[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x5af2af[_0x6195('0x33')]['offset']);}_0x47563b[_0x6195('0x3a')]=qs[_0x6195('0x3b')](_0x5af2af[_0x6195('0x33')][_0x6195('0x3b')]);_0x47563b['where']=qs['filters'](_[_0x6195('0x3c')](_0x5af2af[_0x6195('0x33')],_0x418144['filters']),_0x1402b9);if(_0x5af2af[_0x6195('0x33')][_0x6195('0x3d')]){_0x47563b['where']=_[_0x6195('0x3e')](_0x47563b[_0x6195('0x3f')],{'$or':_[_0x6195('0x2d')](_0x1402b9,function(_0x1840e5){if(_0x1840e5[_0x6195('0x31')]!==_0x6195('0x40')){var _0x9d8efb={};_0x9d8efb[_0x1840e5[_0x6195('0x2b')]]={'$like':'%'+_0x5af2af['query'][_0x6195('0x3d')]+'%'};return _0x9d8efb;}})});}_0x47563b=_[_0x6195('0x3e')]({},_0x47563b,_0x5af2af[_0x6195('0x41')]);var _0x5e7b6b={'where':_0x47563b[_0x6195('0x3f')]};return db[_0x6195('0x2e')][_0x6195('0x21')](_0x5e7b6b)[_0x6195('0x28')](function(_0x39cb9b){_0x3688d6['count']=_0x39cb9b;if(_0x5af2af[_0x6195('0x33')][_0x6195('0x42')]){_0x47563b[_0x6195('0x43')]=[{'all':!![]}];}return db[_0x6195('0x2e')][_0x6195('0x44')](_0x47563b);})[_0x6195('0x28')](function(_0x353a65){_0x3688d6[_0x6195('0x45')]=_0x353a65;return _0x3688d6;})[_0x6195('0x28')](respondWithFilteredResult(_0x126409,_0x47563b))[_0x6195('0x46')](handleError(_0x126409,null));};exports[_0x6195('0x47')]=function(_0x51b4f3,_0x2dc47b){var _0x2f7895={'raw':!![],'where':{'id':_0x51b4f3[_0x6195('0x48')]['id']}},_0x45a188={};_0x45a188[_0x6195('0x32')]=_['keys'](db[_0x6195('0x2e')][_0x6195('0x2f')]);_0x45a188[_0x6195('0x33')]=_[_0x6195('0x49')](_0x51b4f3[_0x6195('0x33')]);_0x45a188[_0x6195('0x4a')]=_[_0x6195('0x34')](_0x45a188[_0x6195('0x32')],_0x45a188['query']);_0x2f7895[_0x6195('0x35')]=_[_0x6195('0x34')](_0x45a188[_0x6195('0x32')],qs[_0x6195('0x36')](_0x51b4f3[_0x6195('0x33')][_0x6195('0x36')]));_0x2f7895['attributes']=_0x2f7895[_0x6195('0x35')][_0x6195('0x37')]?_0x2f7895[_0x6195('0x35')]:_0x45a188[_0x6195('0x32')];if(_0x51b4f3[_0x6195('0x33')][_0x6195('0x42')]){_0x2f7895[_0x6195('0x43')]=[{'all':!![]}];}_0x2f7895=_['merge']({},_0x2f7895,_0x51b4f3[_0x6195('0x41')]);return db[_0x6195('0x2e')][_0x6195('0x4b')](_0x2f7895)[_0x6195('0x28')](handleEntityNotFound(_0x2dc47b,null))['then'](respondWithResult(_0x2dc47b,null))['catch'](handleError(_0x2dc47b,null));};exports[_0x6195('0x4c')]=function(_0x4a43f9,_0x2182fc){return db[_0x6195('0x2e')][_0x6195('0x4c')](_0x4a43f9[_0x6195('0x4d')],{})['then'](respondWithResult(_0x2182fc,0xc9))[_0x6195('0x46')](handleError(_0x2182fc,null));};exports[_0x6195('0x26')]=function(_0x3feac1,_0x1ea3e7){if(_0x3feac1['body']['id']){delete _0x3feac1[_0x6195('0x4d')]['id'];}return db[_0x6195('0x2e')]['find']({'where':{'id':_0x3feac1['params']['id']}})[_0x6195('0x28')](handleEntityNotFound(_0x1ea3e7,null))['then'](saveUpdates(_0x3feac1[_0x6195('0x4d')],null))[_0x6195('0x28')](respondWithResult(_0x1ea3e7,null))['catch'](handleError(_0x1ea3e7,null));};exports['destroy']=function(_0x589bad,_0x2f7e29){return db[_0x6195('0x2e')][_0x6195('0x4b')]({'where':{'id':_0x589bad['params']['id']}})[_0x6195('0x28')](handleEntityNotFound(_0x2f7e29,null))[_0x6195('0x28')](removeEntity(_0x2f7e29,null))['catch'](handleError(_0x2f7e29,null));}; \ No newline at end of file +var _0x81d4=['include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','index','SquareMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x81d4,0x1ca));var _0x481d=function(_0x107f1b,_0xef399a){_0x107f1b=_0x107f1b-0x0;var _0x30d109=_0x81d4[_0x107f1b];return _0x30d109;};'use strict';var emlformat=require(_0x481d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x481d('0x1'));var jsonpatch=require(_0x481d('0x2'));var rp=require(_0x481d('0x3'));var moment=require(_0x481d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x481d('0x5'));var util=require(_0x481d('0x6'));var path=require(_0x481d('0x7'));var sox=require(_0x481d('0x8'));var csv=require('to-csv');var ejs=require(_0x481d('0x9'));var fs=require('fs');var fs_extra=require(_0x481d('0xa'));var _=require(_0x481d('0xb'));var squel=require(_0x481d('0xc'));var crypto=require(_0x481d('0xd'));var jsforce=require(_0x481d('0xe'));var deskjs=require(_0x481d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x481d('0x10'));var Redis=require(_0x481d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x481d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x481d('0x13'));var logger=require(_0x481d('0x14'))(_0x481d('0x15'));var utils=require(_0x481d('0x16'));var config=require(_0x481d('0x17'));var licenseUtil=require(_0x481d('0x18'));var db=require(_0x481d('0x19'))['db'];function respondWithStatusCode(_0x253324,_0x348f18){_0x348f18=_0x348f18||0xcc;return function(_0x1a29f){if(_0x1a29f){return _0x253324[_0x481d('0x1a')](_0x348f18);}return _0x253324[_0x481d('0x1b')](_0x348f18)[_0x481d('0x1c')]();};}function respondWithResult(_0x101eb0,_0x137193){_0x137193=_0x137193||0xc8;return function(_0x531f45){if(_0x531f45){return _0x101eb0[_0x481d('0x1b')](_0x137193)[_0x481d('0x1d')](_0x531f45);}};}function respondWithFilteredResult(_0x2aa561,_0xe25d67){return function(_0x4e25af){if(_0x4e25af){var _0x4e9e98=typeof _0xe25d67[_0x481d('0x1e')]===_0x481d('0x1f')&&typeof _0xe25d67[_0x481d('0x20')]===_0x481d('0x1f');var _0x1f6410=_0x4e25af['count'];var _0x5269b2=_0x4e9e98?0x0:_0xe25d67[_0x481d('0x1e')];var _0x49ec0a=_0x4e9e98?_0x4e25af[_0x481d('0x21')]:_0xe25d67[_0x481d('0x1e')]+_0xe25d67[_0x481d('0x20')];var _0x2ce432;if(_0x49ec0a>=_0x1f6410){_0x49ec0a=_0x1f6410;_0x2ce432=0xc8;}else{_0x2ce432=0xce;}_0x2aa561[_0x481d('0x1b')](_0x2ce432);return _0x2aa561[_0x481d('0x22')](_0x481d('0x23'),_0x5269b2+'-'+_0x49ec0a+'/'+_0x1f6410)[_0x481d('0x1d')](_0x4e25af);}return null;};}function patchUpdates(_0x59f24f){return function(_0x378fd0){try{jsonpatch['apply'](_0x378fd0,_0x59f24f,!![]);}catch(_0x129b91){return BPromise[_0x481d('0x24')](_0x129b91);}return _0x378fd0['save']();};}function saveUpdates(_0x1dff91,_0x11ab9d){return function(_0x109a87){if(_0x109a87){return _0x109a87[_0x481d('0x25')](_0x1dff91)[_0x481d('0x26')](function(_0x3da368){return _0x3da368;});}return null;};}function removeEntity(_0x3c184f,_0x2d3de7){return function(_0x5080df){if(_0x5080df){return _0x5080df[_0x481d('0x27')]()[_0x481d('0x26')](function(){_0x3c184f[_0x481d('0x1b')](0xcc)[_0x481d('0x1c')]();});}};}function handleEntityNotFound(_0xffb9f9,_0x69507f){return function(_0x3dd2ce){if(!_0x3dd2ce){_0xffb9f9['sendStatus'](0x194);}return _0x3dd2ce;};}function handleError(_0x5387d6,_0x4db983){_0x4db983=_0x4db983||0x1f4;return function(_0xc81350){logger[_0x481d('0x28')](_0xc81350[_0x481d('0x29')]);if(_0xc81350[_0x481d('0x2a')]){delete _0xc81350[_0x481d('0x2a')];}_0x5387d6[_0x481d('0x1b')](_0x4db983)['send'](_0xc81350);};}exports[_0x481d('0x2b')]=function(_0x246592,_0x786969){var _0x1e8682={},_0x2ec7dd={},_0x379a0d={'count':0x0,'rows':[]};var _0x2218b7=_['map'](db[_0x481d('0x2c')][_0x481d('0x2d')],function(_0xfc2e94){return{'name':_0xfc2e94[_0x481d('0x2e')],'type':_0xfc2e94['type'][_0x481d('0x2f')]};});_0x2ec7dd[_0x481d('0x30')]=_['map'](_0x2218b7,_0x481d('0x2a'));_0x2ec7dd[_0x481d('0x31')]=_[_0x481d('0x32')](_0x246592[_0x481d('0x31')]);_0x2ec7dd['filters']=_[_0x481d('0x33')](_0x2ec7dd[_0x481d('0x30')],_0x2ec7dd[_0x481d('0x31')]);_0x1e8682[_0x481d('0x34')]=_['intersection'](_0x2ec7dd[_0x481d('0x30')],qs[_0x481d('0x35')](_0x246592[_0x481d('0x31')][_0x481d('0x35')]));_0x1e8682[_0x481d('0x34')]=_0x1e8682['attributes'][_0x481d('0x36')]?_0x1e8682[_0x481d('0x34')]:_0x2ec7dd[_0x481d('0x30')];if(!_0x246592['query'][_0x481d('0x37')]('nolimit')){_0x1e8682[_0x481d('0x20')]=qs['limit'](_0x246592[_0x481d('0x31')]['limit']);_0x1e8682[_0x481d('0x1e')]=qs[_0x481d('0x1e')](_0x246592[_0x481d('0x31')][_0x481d('0x1e')]);}_0x1e8682[_0x481d('0x38')]=qs[_0x481d('0x39')](_0x246592[_0x481d('0x31')][_0x481d('0x39')]);_0x1e8682[_0x481d('0x3a')]=qs[_0x481d('0x3b')](_[_0x481d('0x3c')](_0x246592[_0x481d('0x31')],_0x2ec7dd['filters']),_0x2218b7);if(_0x246592[_0x481d('0x31')][_0x481d('0x3d')]){_0x1e8682[_0x481d('0x3a')]=_[_0x481d('0x3e')](_0x1e8682[_0x481d('0x3a')],{'$or':_['map'](_0x2218b7,function(_0xc09b4b){if(_0xc09b4b[_0x481d('0x3f')]!==_0x481d('0x40')){var _0x394288={};_0x394288[_0xc09b4b[_0x481d('0x2a')]]={'$like':'%'+_0x246592[_0x481d('0x31')][_0x481d('0x3d')]+'%'};return _0x394288;}})});}_0x1e8682=_[_0x481d('0x3e')]({},_0x1e8682,_0x246592[_0x481d('0x41')]);var _0x44f96f={'where':_0x1e8682[_0x481d('0x3a')]};return db[_0x481d('0x2c')][_0x481d('0x21')](_0x44f96f)[_0x481d('0x26')](function(_0x2fe39e){_0x379a0d[_0x481d('0x21')]=_0x2fe39e;if(_0x246592['query'][_0x481d('0x42')]){_0x1e8682[_0x481d('0x43')]=[{'all':!![]}];}return db[_0x481d('0x2c')]['findAll'](_0x1e8682);})[_0x481d('0x26')](function(_0x543cba){_0x379a0d[_0x481d('0x44')]=_0x543cba;return _0x379a0d;})[_0x481d('0x26')](respondWithFilteredResult(_0x786969,_0x1e8682))[_0x481d('0x45')](handleError(_0x786969,null));};exports[_0x481d('0x46')]=function(_0x18d5dd,_0x646ef3){var _0x1cc5e3={'raw':!![],'where':{'id':_0x18d5dd[_0x481d('0x47')]['id']}},_0x4ab98b={};_0x4ab98b[_0x481d('0x30')]=_[_0x481d('0x32')](db[_0x481d('0x2c')][_0x481d('0x2d')]);_0x4ab98b[_0x481d('0x31')]=_[_0x481d('0x32')](_0x18d5dd[_0x481d('0x31')]);_0x4ab98b['filters']=_[_0x481d('0x33')](_0x4ab98b[_0x481d('0x30')],_0x4ab98b[_0x481d('0x31')]);_0x1cc5e3[_0x481d('0x34')]=_['intersection'](_0x4ab98b[_0x481d('0x30')],qs['fields'](_0x18d5dd[_0x481d('0x31')][_0x481d('0x35')]));_0x1cc5e3['attributes']=_0x1cc5e3[_0x481d('0x34')][_0x481d('0x36')]?_0x1cc5e3['attributes']:_0x4ab98b['model'];if(_0x18d5dd[_0x481d('0x31')]['includeAll']){_0x1cc5e3[_0x481d('0x43')]=[{'all':!![]}];}_0x1cc5e3=_['merge']({},_0x1cc5e3,_0x18d5dd[_0x481d('0x41')]);return db[_0x481d('0x2c')][_0x481d('0x48')](_0x1cc5e3)[_0x481d('0x26')](handleEntityNotFound(_0x646ef3,null))['then'](respondWithResult(_0x646ef3,null))[_0x481d('0x45')](handleError(_0x646ef3,null));};exports['create']=function(_0x2655a8,_0x50789d){return db[_0x481d('0x2c')][_0x481d('0x49')](_0x2655a8[_0x481d('0x4a')],{})['then'](respondWithResult(_0x50789d,0xc9))[_0x481d('0x45')](handleError(_0x50789d,null));};exports[_0x481d('0x25')]=function(_0x26823b,_0x478852){if(_0x26823b[_0x481d('0x4a')]['id']){delete _0x26823b['body']['id'];}return db[_0x481d('0x2c')]['find']({'where':{'id':_0x26823b[_0x481d('0x47')]['id']}})['then'](handleEntityNotFound(_0x478852,null))['then'](saveUpdates(_0x26823b[_0x481d('0x4a')],null))[_0x481d('0x26')](respondWithResult(_0x478852,null))[_0x481d('0x45')](handleError(_0x478852,null));};exports['destroy']=function(_0x151f79,_0x32adf2){return db['SquareMessage'][_0x481d('0x48')]({'where':{'id':_0x151f79[_0x481d('0x47')]['id']}})[_0x481d('0x26')](handleEntityNotFound(_0x32adf2,null))[_0x481d('0x26')](removeEntity(_0x32adf2,null))[_0x481d('0x45')](handleError(_0x32adf2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 291aa09..684c5dc 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 _0xa89d=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x39a5f3,_0x2d783a){var _0x2c42c2=function(_0x7051e){while(--_0x7051e){_0x39a5f3['push'](_0x39a5f3['shift']());}};_0x2c42c2(++_0x2d783a);}(_0xa89d,0x78));var _0xda89=function(_0x26bc1f,_0xca1d90){_0x26bc1f=_0x26bc1f-0x0;var _0x332a38=_0xa89d[_0x26bc1f];return _0x332a38;};'use strict';var _=require(_0xda89('0x0'));var util=require(_0xda89('0x1'));var logger=require(_0xda89('0x2'))(_0xda89('0x3'));var moment=require(_0xda89('0x4'));var BPromise=require(_0xda89('0x5'));var rp=require(_0xda89('0x6'));var fs=require('fs');var path=require(_0xda89('0x7'));var rimraf=require(_0xda89('0x8'));var config=require(_0xda89('0x9'));var attributes=require(_0xda89('0xa'));module[_0xda89('0xb')]=function(_0x54c07d,_0x16d4d7){return _0x54c07d[_0xda89('0xc')](_0xda89('0xd'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47fe=['request-promise','path','rimraf','./squareMessage.attributes','exports','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x47fe,0x7f));var _0xe47f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x47fe[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xe47f('0x0'));var logger=require(_0xe47f('0x1'))(_0xe47f('0x2'));var moment=require(_0xe47f('0x3'));var BPromise=require(_0xe47f('0x4'));var rp=require(_0xe47f('0x5'));var fs=require('fs');var path=require(_0xe47f('0x6'));var rimraf=require(_0xe47f('0x7'));var config=require('../../config/environment');var attributes=require(_0xe47f('0x8'));module[_0xe47f('0x9')]=function(_0x407986,_0x342da4){return _0x407986['define'](_0xe47f('0xa'),attributes,{'tableName':_0xe47f('0xb'),'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 b62012b..e1eb489 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 _0x12a9=['then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x327dfe,_0x40e0e){var _0xfa20e6=function(_0x183511){while(--_0x183511){_0x327dfe['push'](_0x327dfe['shift']());}};_0xfa20e6(++_0x40e0e);}(_0x12a9,0x1d4));var _0x912a=function(_0x3491a4,_0x5ec02d){_0x3491a4=_0x3491a4-0x0;var _0x33fcb8=_0x12a9[_0x3491a4];return _0x33fcb8;};'use strict';var _=require(_0x912a('0x0'));var util=require(_0x912a('0x1'));var moment=require(_0x912a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x912a('0x3'));var db=require(_0x912a('0x4'))['db'];var utils=require(_0x912a('0x5'));var logger=require(_0x912a('0x6'))(_0x912a('0x7'));var config=require(_0x912a('0x8'));var jayson=require(_0x912a('0x9'));var client=jayson['client'][_0x912a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230d03,_0x55de68,_0xea2179){return new BPromise(function(_0x4d5e0e,_0x160536){return client[_0x912a('0xb')](_0x230d03,_0xea2179)[_0x912a('0xc')](function(_0x4fb38c){logger[_0x912a('0xd')](_0x912a('0xe'),_0x55de68,'request\x20sent');logger[_0x912a('0xf')](_0x912a('0x10'),_0x55de68,'request\x20sent',JSON['stringify'](_0x4fb38c));if(_0x4fb38c['error']){if(_0x4fb38c[_0x912a('0x11')][_0x912a('0x12')]===0x1f4){logger[_0x912a('0x11')](_0x912a('0xe'),_0x55de68,_0x4fb38c[_0x912a('0x11')][_0x912a('0x13')]);return _0x160536(_0x4fb38c[_0x912a('0x11')]['message']);}logger[_0x912a('0x11')]('SquareMessage,\x20%s,\x20%s',_0x55de68,_0x4fb38c['error'][_0x912a('0x13')]);return _0x4d5e0e(_0x4fb38c[_0x912a('0x11')][_0x912a('0x13')]);}else{logger[_0x912a('0xd')]('SquareMessage,\x20%s,\x20%s',_0x55de68,_0x912a('0x14'));_0x4d5e0e(_0x4fb38c[_0x912a('0x15')][_0x912a('0x13')]);}})['catch'](function(_0x108812){logger[_0x912a('0x11')](_0x912a('0xe'),_0x55de68,_0x108812);_0x160536(_0x108812);});});}exports['CreateSquareMessage']=function(_0x1d1f8c){var _0x3c343b=this;return new Promise(function(_0x1c0f97,_0x3e324e){return db[_0x912a('0x16')][_0x912a('0x17')](_0x1d1f8c[_0x912a('0x18')],{'raw':_0x1d1f8c['options']?_0x1d1f8c[_0x912a('0x19')][_0x912a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5c1475){logger[_0x912a('0xd')](_0x912a('0x1b'),_0x1d1f8c);logger[_0x912a('0xf')](_0x912a('0x1b'),_0x1d1f8c,JSON[_0x912a('0x1c')](_0x5c1475));_0x1c0f97(_0x5c1475);})[_0x912a('0x1d')](function(_0x1538b6){logger[_0x912a('0x11')]('CreateSquareMessage',_0x1538b6[_0x912a('0x13')],_0x1d1f8c);_0x3e324e(_0x3c343b[_0x912a('0x11')](0x1f4,_0x1538b6['message']));});});}; \ No newline at end of file +var _0x3d00=['CreateSquareMessage','SquareMessage','create','body','options','raw','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x313157,_0x29c7c7){var _0x35c0b8=function(_0x58e5f){while(--_0x58e5f){_0x313157['push'](_0x313157['shift']());}};_0x35c0b8(++_0x29c7c7);}(_0x3d00,0x9c));var _0x03d0=function(_0x227b61,_0x43d699){_0x227b61=_0x227b61-0x0;var _0xa5c06c=_0x3d00[_0x227b61];return _0xa5c06c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x03d0('0x0'));var BPromise=require(_0x03d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d0('0x2'));var db=require(_0x03d0('0x3'))['db'];var utils=require(_0x03d0('0x4'));var logger=require(_0x03d0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x03d0('0x6')][_0x03d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x310f04,_0x49c942,_0x4dbe90){return new BPromise(function(_0x2e2121,_0x50b0f9){return client['request'](_0x310f04,_0x4dbe90)[_0x03d0('0x8')](function(_0x224f65){logger[_0x03d0('0x9')]('SquareMessage,\x20%s,\x20%s',_0x49c942,_0x03d0('0xa'));logger['debug'](_0x03d0('0xb'),_0x49c942,_0x03d0('0xa'),JSON[_0x03d0('0xc')](_0x224f65));if(_0x224f65['error']){if(_0x224f65['error'][_0x03d0('0xd')]===0x1f4){logger[_0x03d0('0xe')](_0x03d0('0xf'),_0x49c942,_0x224f65[_0x03d0('0xe')][_0x03d0('0x10')]);return _0x50b0f9(_0x224f65[_0x03d0('0xe')]['message']);}logger[_0x03d0('0xe')]('SquareMessage,\x20%s,\x20%s',_0x49c942,_0x224f65['error']['message']);return _0x2e2121(_0x224f65[_0x03d0('0xe')][_0x03d0('0x10')]);}else{logger[_0x03d0('0x9')](_0x03d0('0xf'),_0x49c942,_0x03d0('0xa'));_0x2e2121(_0x224f65[_0x03d0('0x11')][_0x03d0('0x10')]);}})[_0x03d0('0x12')](function(_0x13cb5b){logger[_0x03d0('0xe')](_0x03d0('0xf'),_0x49c942,_0x13cb5b);_0x50b0f9(_0x13cb5b);});});}exports[_0x03d0('0x13')]=function(_0xadc69e){var _0x2c8d98=this;return new Promise(function(_0x33adef,_0x414db1){return db[_0x03d0('0x14')][_0x03d0('0x15')](_0xadc69e[_0x03d0('0x16')],{'raw':_0xadc69e[_0x03d0('0x17')]?_0xadc69e[_0x03d0('0x17')][_0x03d0('0x18')]===undefined?!![]:![]:!![]})[_0x03d0('0x8')](function(_0x54716b){logger[_0x03d0('0x9')](_0x03d0('0x13'),_0xadc69e);logger['debug'](_0x03d0('0x13'),_0xadc69e,JSON[_0x03d0('0xc')](_0x54716b));_0x33adef(_0x54716b);})[_0x03d0('0x12')](function(_0x406221){logger['error'](_0x03d0('0x13'),_0x406221[_0x03d0('0x10')],_0xadc69e);_0x414db1(_0x2c8d98['error'](0x1f4,_0x406221[_0x03d0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 6ffb967..4bb5ea0 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 _0xeda7=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s','test','post','create','put','/:id','update','delete','multer','util'];(function(_0x536e5a,_0x32b912){var _0x4c7d63=function(_0x4e29d2){while(--_0x4e29d2){_0x536e5a['push'](_0x536e5a['shift']());}};_0x4c7d63(++_0x32b912);}(_0xeda7,0x1cc));var _0x7eda=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xeda7[_0x1eda20];return _0x31b953;};'use strict';var multer=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var path=require(_0x7eda('0x2'));var timeout=require(_0x7eda('0x3'));var express=require(_0x7eda('0x4'));var router=express[_0x7eda('0x5')]();var fs_extra=require(_0x7eda('0x6'));var auth=require(_0x7eda('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7eda('0x8'));var controller=require(_0x7eda('0x9'));router[_0x7eda('0xa')]('/',auth[_0x7eda('0xb')](),controller[_0x7eda('0xc')]);router['get']('/:id',auth[_0x7eda('0xb')](),controller[_0x7eda('0xd')]);router[_0x7eda('0xa')]('/:id/test',auth[_0x7eda('0xb')](),timeout(_0x7eda('0xe')),controller[_0x7eda('0xf')]);router[_0x7eda('0x10')]('/',auth[_0x7eda('0xb')](),controller[_0x7eda('0x11')]);router[_0x7eda('0x12')](_0x7eda('0x13'),auth['isAuthenticated'](),controller[_0x7eda('0x14')]);router[_0x7eda('0x15')](_0x7eda('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0bf0=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','post','create','update','delete'];(function(_0x2ca0cf,_0x2f56c3){var _0x12e852=function(_0x3ac096){while(--_0x3ac096){_0x2ca0cf['push'](_0x2ca0cf['shift']());}};_0x12e852(++_0x2f56c3);}(_0x0bf0,0xaa));var _0x00bf=function(_0x13a228,_0x22010e){_0x13a228=_0x13a228-0x0;var _0x34eaa3=_0x0bf0[_0x13a228];return _0x34eaa3;};'use strict';var multer=require(_0x00bf('0x0'));var util=require(_0x00bf('0x1'));var path=require(_0x00bf('0x2'));var timeout=require(_0x00bf('0x3'));var express=require(_0x00bf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00bf('0x5'));var interaction=require(_0x00bf('0x6'));var config=require(_0x00bf('0x7'));var controller=require(_0x00bf('0x8'));router[_0x00bf('0x9')]('/',auth[_0x00bf('0xa')](),controller[_0x00bf('0xb')]);router[_0x00bf('0x9')](_0x00bf('0xc'),auth[_0x00bf('0xa')](),controller[_0x00bf('0xd')]);router[_0x00bf('0x9')]('/:id/test',auth[_0x00bf('0xa')](),timeout('15s'),controller[_0x00bf('0xe')]);router[_0x00bf('0xf')]('/',auth[_0x00bf('0xa')](),controller[_0x00bf('0x10')]);router['put'](_0x00bf('0xc'),auth['isAuthenticated'](),controller[_0x00bf('0x11')]);router[_0x00bf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x00bf('0x13')]);module[_0x00bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c326573..5732a84 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 _0x9508=['name','STRING','sequelize','exports'];(function(_0x420fc9,_0x1a6ba5){var _0x4984b8=function(_0x3a4819){while(--_0x3a4819){_0x420fc9['push'](_0x420fc9['shift']());}};_0x4984b8(++_0x1a6ba5);}(_0x9508,0x1ce));var _0x8950=function(_0xe8433c,_0x2a91fe){_0xe8433c=_0xe8433c-0x0;var _0x53ddd6=_0x9508[_0xe8433c];return _0x53ddd6;};'use strict';var Sequelize=require(_0x8950('0x0'));module[_0x8950('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8950('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8950('0x3')]},'description':{'type':Sequelize[_0x8950('0x3')]}}; \ No newline at end of file +var _0xb4d1=['exports','STRING','name'];(function(_0x1dacd0,_0x666b8e){var _0x1b2506=function(_0x1ad10c){while(--_0x1ad10c){_0x1dacd0['push'](_0x1dacd0['shift']());}};_0x1b2506(++_0x666b8e);}(_0xb4d1,0x1c5));var _0x1b4d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xb4d1[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require('sequelize');module[_0x1b4d('0x0')]={'name':{'type':Sequelize[_0x1b4d('0x1')],'unique':_0x1b4d('0x2'),'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 d5d2b48..5c9b521 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 _0xc1c2=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','options','includeAll','SquareOdbc','findAll','rows','catch','show','params','create','body','get','role','user','ODBC','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xc1c2,0x1bd));var _0x2c1c=function(_0x40cd79,_0x2f6e96){_0x40cd79=_0x40cd79-0x0;var _0x1a5e87=_0xc1c2[_0x40cd79];return _0x1a5e87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c1c('0x0'));var zipdir=require(_0x2c1c('0x1'));var jsonpatch=require(_0x2c1c('0x2'));var rp=require(_0x2c1c('0x3'));var moment=require('moment');var BPromise=require(_0x2c1c('0x4'));var Mustache=require(_0x2c1c('0x5'));var util=require(_0x2c1c('0x6'));var path=require(_0x2c1c('0x7'));var sox=require(_0x2c1c('0x8'));var csv=require(_0x2c1c('0x9'));var ejs=require(_0x2c1c('0xa'));var fs=require('fs');var fs_extra=require(_0x2c1c('0xb'));var _=require(_0x2c1c('0xc'));var squel=require(_0x2c1c('0xd'));var crypto=require(_0x2c1c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c1c('0xf'));var Papa=require(_0x2c1c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2c1c('0x11'));var as=require(_0x2c1c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c1c('0x13'))(_0x2c1c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c1c('0x15'));var db=require(_0x2c1c('0x16'))['db'];function respondWithStatusCode(_0x44405b,_0x3a424c){_0x3a424c=_0x3a424c||0xcc;return function(_0x4bf207){if(_0x4bf207){return _0x44405b[_0x2c1c('0x17')](_0x3a424c);}return _0x44405b['status'](_0x3a424c)['end']();};}function respondWithResult(_0x41b4c8,_0x2216da){_0x2216da=_0x2216da||0xc8;return function(_0x151910){if(_0x151910){return _0x41b4c8['status'](_0x2216da)[_0x2c1c('0x18')](_0x151910);}};}function respondWithFilteredResult(_0x42910c,_0x555d19){return function(_0x51d855){if(_0x51d855){var _0x5b2512=typeof _0x555d19[_0x2c1c('0x19')]===_0x2c1c('0x1a')&&typeof _0x555d19[_0x2c1c('0x1b')]==='undefined';var _0x38dc4d=_0x51d855['count'];var _0x2fac55=_0x5b2512?0x0:_0x555d19[_0x2c1c('0x19')];var _0x133336=_0x5b2512?_0x51d855[_0x2c1c('0x1c')]:_0x555d19[_0x2c1c('0x19')]+_0x555d19[_0x2c1c('0x1b')];var _0x47e03a;if(_0x133336>=_0x38dc4d){_0x133336=_0x38dc4d;_0x47e03a=0xc8;}else{_0x47e03a=0xce;}_0x42910c[_0x2c1c('0x1d')](_0x47e03a);return _0x42910c[_0x2c1c('0x1e')](_0x2c1c('0x1f'),_0x2fac55+'-'+_0x133336+'/'+_0x38dc4d)['json'](_0x51d855);}return null;};}function patchUpdates(_0x3391f4){return function(_0x7815b){try{jsonpatch[_0x2c1c('0x20')](_0x7815b,_0x3391f4,!![]);}catch(_0x1331f0){return BPromise[_0x2c1c('0x21')](_0x1331f0);}return _0x7815b[_0x2c1c('0x22')]();};}function saveUpdates(_0x15e35c,_0x6810bd){return function(_0x24954d){if(_0x24954d){return _0x24954d[_0x2c1c('0x23')](_0x15e35c)[_0x2c1c('0x24')](function(_0x2071d8){return _0x2071d8;});}return null;};}function removeEntity(_0x3e6e30,_0x9392a6){return function(_0x5758e5){if(_0x5758e5){return _0x5758e5['destroy']()['then'](function(){var _0xef5451=_0x5758e5['get']({'plain':!![]});var _0x3002c8='ODBC';return db[_0x2c1c('0x25')][_0x2c1c('0x26')]({'where':{'type':_0x3002c8,'resourceId':_0xef5451['id']}})[_0x2c1c('0x24')](function(){return _0x5758e5;});})['then'](function(){_0x3e6e30[_0x2c1c('0x1d')](0xcc)[_0x2c1c('0x27')]();});}};}function handleEntityNotFound(_0x3849f8,_0x49ed6f){return function(_0x5fac03){if(!_0x5fac03){_0x3849f8[_0x2c1c('0x17')](0x194);}return _0x5fac03;};}function handleError(_0x5b24dc,_0x5f23e5){_0x5f23e5=_0x5f23e5||0x1f4;return function(_0x9e5a8e){logger[_0x2c1c('0x28')](_0x9e5a8e[_0x2c1c('0x29')]);if(_0x9e5a8e[_0x2c1c('0x2a')]){delete _0x9e5a8e[_0x2c1c('0x2a')];}_0x5b24dc['status'](_0x5f23e5)[_0x2c1c('0x2b')](_0x9e5a8e);};}exports[_0x2c1c('0x2c')]=function(_0x2dcdf8,_0xb25ced){var _0x4cfd92={},_0x1821e5={},_0x25b5d7={'count':0x0,'rows':[]};var _0x1d2c7d=_[_0x2c1c('0x2d')](db['SquareOdbc'][_0x2c1c('0x2e')],function(_0x320f67){return{'name':_0x320f67[_0x2c1c('0x2f')],'type':_0x320f67['type'][_0x2c1c('0x30')]};});_0x1821e5[_0x2c1c('0x31')]=_['map'](_0x1d2c7d,_0x2c1c('0x2a'));_0x1821e5['query']=_[_0x2c1c('0x32')](_0x2dcdf8[_0x2c1c('0x33')]);_0x1821e5[_0x2c1c('0x34')]=_['intersection'](_0x1821e5[_0x2c1c('0x31')],_0x1821e5[_0x2c1c('0x33')]);_0x4cfd92[_0x2c1c('0x35')]=_[_0x2c1c('0x36')](_0x1821e5[_0x2c1c('0x31')],qs['fields'](_0x2dcdf8[_0x2c1c('0x33')][_0x2c1c('0x37')]));_0x4cfd92[_0x2c1c('0x35')]=_0x4cfd92[_0x2c1c('0x35')][_0x2c1c('0x38')]?_0x4cfd92['attributes']:_0x1821e5[_0x2c1c('0x31')];if(!_0x2dcdf8['query'][_0x2c1c('0x39')](_0x2c1c('0x3a'))){_0x4cfd92['limit']=qs['limit'](_0x2dcdf8[_0x2c1c('0x33')][_0x2c1c('0x1b')]);_0x4cfd92[_0x2c1c('0x19')]=qs[_0x2c1c('0x19')](_0x2dcdf8[_0x2c1c('0x33')]['offset']);}_0x4cfd92[_0x2c1c('0x3b')]=qs[_0x2c1c('0x3c')](_0x2dcdf8[_0x2c1c('0x33')][_0x2c1c('0x3c')]);_0x4cfd92['where']=qs['filters'](_[_0x2c1c('0x3d')](_0x2dcdf8[_0x2c1c('0x33')],_0x1821e5[_0x2c1c('0x34')]),_0x1d2c7d);if(_0x2dcdf8[_0x2c1c('0x33')]['filter']){_0x4cfd92[_0x2c1c('0x3e')]=_['merge'](_0x4cfd92[_0x2c1c('0x3e')],{'$or':_['map'](_0x1d2c7d,function(_0x5cd4c4){if(_0x5cd4c4[_0x2c1c('0x3f')]!==_0x2c1c('0x40')){var _0x48fd96={};_0x48fd96[_0x5cd4c4['name']]={'$like':'%'+_0x2dcdf8['query']['filter']+'%'};return _0x48fd96;}})});}_0x4cfd92=_['merge']({},_0x4cfd92,_0x2dcdf8[_0x2c1c('0x41')]);var _0x5b84a6={'where':_0x4cfd92[_0x2c1c('0x3e')]};return db['SquareOdbc'][_0x2c1c('0x1c')](_0x5b84a6)[_0x2c1c('0x24')](function(_0x3c9331){_0x25b5d7['count']=_0x3c9331;if(_0x2dcdf8['query'][_0x2c1c('0x42')]){_0x4cfd92['include']=[{'all':!![]}];}return db[_0x2c1c('0x43')][_0x2c1c('0x44')](_0x4cfd92);})[_0x2c1c('0x24')](function(_0x802f7b){_0x25b5d7[_0x2c1c('0x45')]=_0x802f7b;return _0x25b5d7;})[_0x2c1c('0x24')](respondWithFilteredResult(_0xb25ced,_0x4cfd92))[_0x2c1c('0x46')](handleError(_0xb25ced,null));};exports[_0x2c1c('0x47')]=function(_0x5c621c,_0x1f0c21){var _0x12b3fd={'raw':!![],'where':{'id':_0x5c621c[_0x2c1c('0x48')]['id']}},_0x28e46e={};_0x28e46e[_0x2c1c('0x31')]=_[_0x2c1c('0x32')](db[_0x2c1c('0x43')]['rawAttributes']);_0x28e46e[_0x2c1c('0x33')]=_['keys'](_0x5c621c[_0x2c1c('0x33')]);_0x28e46e[_0x2c1c('0x34')]=_[_0x2c1c('0x36')](_0x28e46e[_0x2c1c('0x31')],_0x28e46e[_0x2c1c('0x33')]);_0x12b3fd['attributes']=_[_0x2c1c('0x36')](_0x28e46e[_0x2c1c('0x31')],qs['fields'](_0x5c621c[_0x2c1c('0x33')]['fields']));_0x12b3fd[_0x2c1c('0x35')]=_0x12b3fd['attributes'][_0x2c1c('0x38')]?_0x12b3fd[_0x2c1c('0x35')]:_0x28e46e[_0x2c1c('0x31')];if(_0x5c621c[_0x2c1c('0x33')][_0x2c1c('0x42')]){_0x12b3fd['include']=[{'all':!![]}];}_0x12b3fd=_['merge']({},_0x12b3fd,_0x5c621c['options']);return db['SquareOdbc']['find'](_0x12b3fd)[_0x2c1c('0x24')](handleEntityNotFound(_0x1f0c21,null))[_0x2c1c('0x24')](respondWithResult(_0x1f0c21,null))['catch'](handleError(_0x1f0c21,null));};exports['create']=function(_0x5340b0,_0x1c7f47){return db[_0x2c1c('0x43')][_0x2c1c('0x49')](_0x5340b0[_0x2c1c('0x4a')],{})[_0x2c1c('0x24')](function(_0xbf4450){var _0x45fd42=_0x5340b0['user'][_0x2c1c('0x4b')]({'plain':!![]});if(!_0x45fd42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45fd42[_0x2c1c('0x4c')]===_0x2c1c('0x4d')){var _0x13c0b5=_0xbf4450[_0x2c1c('0x4b')]({'plain':!![]});var _0x4721a5=_0x2c1c('0x4e');return db[_0x2c1c('0x4f')][_0x2c1c('0x50')]({'where':{'name':_0x4721a5,'userProfileId':_0x45fd42[_0x2c1c('0x51')]},'raw':!![]})[_0x2c1c('0x24')](function(_0x32e6d6){if(_0x32e6d6&&_0x32e6d6[_0x2c1c('0x52')]===0x0){return db[_0x2c1c('0x25')]['create']({'name':_0x13c0b5[_0x2c1c('0x2a')],'resourceId':_0x13c0b5['id'],'type':_0x32e6d6[_0x2c1c('0x2a')],'sectionId':_0x32e6d6['id']},{})[_0x2c1c('0x24')](function(){return _0xbf4450;});}else{return _0xbf4450;}})[_0x2c1c('0x46')](function(_0x44ed0b){logger[_0x2c1c('0x28')](_0x2c1c('0x53'),_0x44ed0b);throw _0x44ed0b;});}return _0xbf4450;})[_0x2c1c('0x24')](respondWithResult(_0x1c7f47,0xc9))['catch'](handleError(_0x1c7f47,null));};exports[_0x2c1c('0x23')]=function(_0x2584a6,_0xe53820){if(_0x2584a6[_0x2c1c('0x4a')]['id']){delete _0x2584a6[_0x2c1c('0x4a')]['id'];}return db[_0x2c1c('0x43')][_0x2c1c('0x50')]({'where':{'id':_0x2584a6[_0x2c1c('0x48')]['id']}})[_0x2c1c('0x24')](handleEntityNotFound(_0xe53820,null))[_0x2c1c('0x24')](saveUpdates(_0x2584a6[_0x2c1c('0x4a')],null))[_0x2c1c('0x24')](respondWithResult(_0xe53820,null))[_0x2c1c('0x46')](handleError(_0xe53820,null));};exports[_0x2c1c('0x26')]=function(_0x484b7b,_0x519c57){return db[_0x2c1c('0x43')][_0x2c1c('0x50')]({'where':{'id':_0x484b7b[_0x2c1c('0x48')]['id']}})[_0x2c1c('0x24')](handleEntityNotFound(_0x519c57,null))['then'](removeEntity(_0x519c57,null))[_0x2c1c('0x46')](handleError(_0x519c57,null));};exports[_0x2c1c('0x54')]=function(_0x57c898,_0x4f3b21,_0x5a1b78){var _0x4cf91e;return db[_0x2c1c('0x43')][_0x2c1c('0x50')]({'where':{'id':_0x57c898[_0x2c1c('0x48')]['id']},'attributes':['id','dsn']})[_0x2c1c('0x24')](handleEntityNotFound(_0x4f3b21,null))[_0x2c1c('0x24')](function(_0x357e81){if(_0x357e81){var _0x5eaffb=require(_0x2c1c('0x55'))();_0x5eaffb[_0x2c1c('0x56')](_0x357e81['dsn']);_0x5eaffb[_0x2c1c('0x57')]();return _0x357e81;}})['then'](respondWithResult(_0x4f3b21,null))[_0x2c1c('0x46')](handleError(_0x4f3b21,null));}; \ No newline at end of file +var _0x09c6=['squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','set','apply','reject','save','destroy','then','get','ODBC','UserProfileResource','end','error','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x28cb3f,_0x1621eb){var _0x26ebbc=function(_0x15c473){while(--_0x15c473){_0x28cb3f['push'](_0x28cb3f['shift']());}};_0x26ebbc(++_0x1621eb);}(_0x09c6,0xf8));var _0x609c=function(_0x2d35ff,_0x6f1a09){_0x2d35ff=_0x2d35ff-0x0;var _0x240396=_0x09c6[_0x2d35ff];return _0x240396;};'use strict';var emlformat=require(_0x609c('0x0'));var rimraf=require(_0x609c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x609c('0x2'));var rp=require(_0x609c('0x3'));var moment=require(_0x609c('0x4'));var BPromise=require(_0x609c('0x5'));var Mustache=require(_0x609c('0x6'));var util=require(_0x609c('0x7'));var path=require(_0x609c('0x8'));var sox=require('sox');var csv=require(_0x609c('0x9'));var ejs=require(_0x609c('0xa'));var fs=require('fs');var fs_extra=require(_0x609c('0xb'));var _=require(_0x609c('0xc'));var squel=require(_0x609c('0xd'));var crypto=require(_0x609c('0xe'));var jsforce=require(_0x609c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x609c('0x10'));var Papa=require(_0x609c('0x11'));var Redis=require('ioredis');var authService=require(_0x609c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x609c('0x13'));var logger=require(_0x609c('0x14'))(_0x609c('0x15'));var utils=require(_0x609c('0x16'));var config=require(_0x609c('0x17'));var licenseUtil=require(_0x609c('0x18'));var db=require(_0x609c('0x19'))['db'];function respondWithStatusCode(_0x4a5f20,_0x818337){_0x818337=_0x818337||0xcc;return function(_0x14b2cd){if(_0x14b2cd){return _0x4a5f20[_0x609c('0x1a')](_0x818337);}return _0x4a5f20['status'](_0x818337)['end']();};}function respondWithResult(_0x235df7,_0x491333){_0x491333=_0x491333||0xc8;return function(_0x54f1f1){if(_0x54f1f1){return _0x235df7[_0x609c('0x1b')](_0x491333)[_0x609c('0x1c')](_0x54f1f1);}};}function respondWithFilteredResult(_0x533a6f,_0x2e021c){return function(_0x1d837a){if(_0x1d837a){var _0xfafb48=typeof _0x2e021c['offset']===_0x609c('0x1d')&&typeof _0x2e021c['limit']===_0x609c('0x1d');var _0x1973c2=_0x1d837a['count'];var _0x495325=_0xfafb48?0x0:_0x2e021c[_0x609c('0x1e')];var _0x27c773=_0xfafb48?_0x1d837a[_0x609c('0x1f')]:_0x2e021c[_0x609c('0x1e')]+_0x2e021c['limit'];var _0x38f103;if(_0x27c773>=_0x1973c2){_0x27c773=_0x1973c2;_0x38f103=0xc8;}else{_0x38f103=0xce;}_0x533a6f[_0x609c('0x1b')](_0x38f103);return _0x533a6f[_0x609c('0x20')]('Content-Range',_0x495325+'-'+_0x27c773+'/'+_0x1973c2)[_0x609c('0x1c')](_0x1d837a);}return null;};}function patchUpdates(_0x4e86d4){return function(_0x3fdd19){try{jsonpatch[_0x609c('0x21')](_0x3fdd19,_0x4e86d4,!![]);}catch(_0x26666e){return BPromise[_0x609c('0x22')](_0x26666e);}return _0x3fdd19[_0x609c('0x23')]();};}function saveUpdates(_0x3c4147,_0x30df73){return function(_0x2657f7){if(_0x2657f7){return _0x2657f7['update'](_0x3c4147)['then'](function(_0x5978ce){return _0x5978ce;});}return null;};}function removeEntity(_0x505c2e,_0x382ffe){return function(_0x5edc67){if(_0x5edc67){return _0x5edc67[_0x609c('0x24')]()[_0x609c('0x25')](function(){var _0x39db0d=_0x5edc67[_0x609c('0x26')]({'plain':!![]});var _0x2a8b0b=_0x609c('0x27');return db[_0x609c('0x28')][_0x609c('0x24')]({'where':{'type':_0x2a8b0b,'resourceId':_0x39db0d['id']}})['then'](function(){return _0x5edc67;});})[_0x609c('0x25')](function(){_0x505c2e[_0x609c('0x1b')](0xcc)[_0x609c('0x29')]();});}};}function handleEntityNotFound(_0x2a75a4,_0x50728a){return function(_0x5082d2){if(!_0x5082d2){_0x2a75a4[_0x609c('0x1a')](0x194);}return _0x5082d2;};}function handleError(_0x542b43,_0x23ae89){_0x23ae89=_0x23ae89||0x1f4;return function(_0x758806){logger[_0x609c('0x2a')](_0x758806['stack']);if(_0x758806[_0x609c('0x2b')]){delete _0x758806['name'];}_0x542b43['status'](_0x23ae89)[_0x609c('0x2c')](_0x758806);};}exports['index']=function(_0x5eb363,_0x24c306){var _0x26b751={},_0x2fbea4={},_0x2b31d6={'count':0x0,'rows':[]};var _0x4cdbab=_[_0x609c('0x2d')](db[_0x609c('0x2e')][_0x609c('0x2f')],function(_0x53c95a){return{'name':_0x53c95a[_0x609c('0x30')],'type':_0x53c95a['type'][_0x609c('0x31')]};});_0x2fbea4[_0x609c('0x32')]=_[_0x609c('0x2d')](_0x4cdbab,_0x609c('0x2b'));_0x2fbea4['query']=_[_0x609c('0x33')](_0x5eb363['query']);_0x2fbea4['filters']=_[_0x609c('0x34')](_0x2fbea4[_0x609c('0x32')],_0x2fbea4['query']);_0x26b751[_0x609c('0x35')]=_[_0x609c('0x34')](_0x2fbea4[_0x609c('0x32')],qs[_0x609c('0x36')](_0x5eb363[_0x609c('0x37')]['fields']));_0x26b751[_0x609c('0x35')]=_0x26b751[_0x609c('0x35')]['length']?_0x26b751[_0x609c('0x35')]:_0x2fbea4['model'];if(!_0x5eb363[_0x609c('0x37')][_0x609c('0x38')](_0x609c('0x39'))){_0x26b751[_0x609c('0x3a')]=qs[_0x609c('0x3a')](_0x5eb363['query'][_0x609c('0x3a')]);_0x26b751[_0x609c('0x1e')]=qs[_0x609c('0x1e')](_0x5eb363[_0x609c('0x37')][_0x609c('0x1e')]);}_0x26b751[_0x609c('0x3b')]=qs[_0x609c('0x3c')](_0x5eb363[_0x609c('0x37')]['sort']);_0x26b751[_0x609c('0x3d')]=qs[_0x609c('0x3e')](_[_0x609c('0x3f')](_0x5eb363['query'],_0x2fbea4[_0x609c('0x3e')]),_0x4cdbab);if(_0x5eb363[_0x609c('0x37')][_0x609c('0x40')]){_0x26b751[_0x609c('0x3d')]=_[_0x609c('0x41')](_0x26b751[_0x609c('0x3d')],{'$or':_[_0x609c('0x2d')](_0x4cdbab,function(_0x1dfacb){if(_0x1dfacb[_0x609c('0x42')]!==_0x609c('0x43')){var _0x212f72={};_0x212f72[_0x1dfacb[_0x609c('0x2b')]]={'$like':'%'+_0x5eb363[_0x609c('0x37')][_0x609c('0x40')]+'%'};return _0x212f72;}})});}_0x26b751=_['merge']({},_0x26b751,_0x5eb363[_0x609c('0x44')]);var _0x159e1f={'where':_0x26b751[_0x609c('0x3d')]};return db[_0x609c('0x2e')]['count'](_0x159e1f)[_0x609c('0x25')](function(_0x1e924a){_0x2b31d6[_0x609c('0x1f')]=_0x1e924a;if(_0x5eb363[_0x609c('0x37')]['includeAll']){_0x26b751[_0x609c('0x45')]=[{'all':!![]}];}return db[_0x609c('0x2e')]['findAll'](_0x26b751);})[_0x609c('0x25')](function(_0x41b85d){_0x2b31d6['rows']=_0x41b85d;return _0x2b31d6;})[_0x609c('0x25')](respondWithFilteredResult(_0x24c306,_0x26b751))[_0x609c('0x46')](handleError(_0x24c306,null));};exports['show']=function(_0x5e7dc1,_0x5e0692){var _0x9f92={'raw':!![],'where':{'id':_0x5e7dc1[_0x609c('0x47')]['id']}},_0x54eb5f={};_0x54eb5f[_0x609c('0x32')]=_['keys'](db[_0x609c('0x2e')]['rawAttributes']);_0x54eb5f['query']=_['keys'](_0x5e7dc1[_0x609c('0x37')]);_0x54eb5f[_0x609c('0x3e')]=_[_0x609c('0x34')](_0x54eb5f[_0x609c('0x32')],_0x54eb5f[_0x609c('0x37')]);_0x9f92[_0x609c('0x35')]=_[_0x609c('0x34')](_0x54eb5f[_0x609c('0x32')],qs[_0x609c('0x36')](_0x5e7dc1[_0x609c('0x37')][_0x609c('0x36')]));_0x9f92[_0x609c('0x35')]=_0x9f92['attributes']['length']?_0x9f92['attributes']:_0x54eb5f['model'];if(_0x5e7dc1[_0x609c('0x37')][_0x609c('0x48')]){_0x9f92[_0x609c('0x45')]=[{'all':!![]}];}_0x9f92=_[_0x609c('0x41')]({},_0x9f92,_0x5e7dc1[_0x609c('0x44')]);return db[_0x609c('0x2e')][_0x609c('0x49')](_0x9f92)['then'](handleEntityNotFound(_0x5e0692,null))[_0x609c('0x25')](respondWithResult(_0x5e0692,null))['catch'](handleError(_0x5e0692,null));};exports[_0x609c('0x4a')]=function(_0x547b90,_0x2bf814){return db['SquareOdbc']['create'](_0x547b90[_0x609c('0x4b')],{})[_0x609c('0x25')](function(_0x245b6c){var _0xb5188c=_0x547b90[_0x609c('0x4c')]['get']({'plain':!![]});if(!_0xb5188c)throw new Error(_0x609c('0x4d'));if(_0xb5188c[_0x609c('0x4e')]===_0x609c('0x4c')){var _0x3605e5=_0x245b6c[_0x609c('0x26')]({'plain':!![]});var _0x4b0b74=_0x609c('0x27');return db[_0x609c('0x4f')][_0x609c('0x49')]({'where':{'name':_0x4b0b74,'userProfileId':_0xb5188c['userProfileId']},'raw':!![]})['then'](function(_0x5e47ac){if(_0x5e47ac&&_0x5e47ac[_0x609c('0x50')]===0x0){return db[_0x609c('0x28')][_0x609c('0x4a')]({'name':_0x3605e5[_0x609c('0x2b')],'resourceId':_0x3605e5['id'],'type':_0x5e47ac[_0x609c('0x2b')],'sectionId':_0x5e47ac['id']},{})[_0x609c('0x25')](function(){return _0x245b6c;});}else{return _0x245b6c;}})['catch'](function(_0x2aaf27){logger[_0x609c('0x2a')](_0x609c('0x51'),_0x2aaf27);throw _0x2aaf27;});}return _0x245b6c;})['then'](respondWithResult(_0x2bf814,0xc9))[_0x609c('0x46')](handleError(_0x2bf814,null));};exports[_0x609c('0x52')]=function(_0x38544c,_0x4ab6ad){if(_0x38544c['body']['id']){delete _0x38544c[_0x609c('0x4b')]['id'];}return db[_0x609c('0x2e')][_0x609c('0x49')]({'where':{'id':_0x38544c[_0x609c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ab6ad,null))['then'](saveUpdates(_0x38544c[_0x609c('0x4b')],null))['then'](respondWithResult(_0x4ab6ad,null))[_0x609c('0x46')](handleError(_0x4ab6ad,null));};exports['destroy']=function(_0x2bc803,_0x4706e2){return db[_0x609c('0x2e')][_0x609c('0x49')]({'where':{'id':_0x2bc803[_0x609c('0x47')]['id']}})[_0x609c('0x25')](handleEntityNotFound(_0x4706e2,null))['then'](removeEntity(_0x4706e2,null))['catch'](handleError(_0x4706e2,null));};exports[_0x609c('0x53')]=function(_0x50d17b,_0x4f3ff8,_0x595fc3){var _0x2b4b6d;return db[_0x609c('0x2e')]['find']({'where':{'id':_0x50d17b[_0x609c('0x47')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x4f3ff8,null))[_0x609c('0x25')](function(_0x24b064){if(_0x24b064){var _0xc12da2=require(_0x609c('0x54'))();_0xc12da2[_0x609c('0x55')](_0x24b064['dsn']);_0xc12da2[_0x609c('0x56')]();return _0x24b064;}})[_0x609c('0x25')](respondWithResult(_0x4f3ff8,null))['catch'](handleError(_0x4f3ff8,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index dae73a3..76de5f9 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 _0xc4fb=['exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','request-promise','rimraf','./squareOdbc.attributes'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xc4fb,0x1ce));var _0xbc4f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc4fb[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xbc4f('0x0'));var util=require(_0xbc4f('0x1'));var logger=require(_0xbc4f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbc4f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc4f('0x4'));var config=require('../../config/environment');var attributes=require(_0xbc4f('0x5'));module[_0xbc4f('0x6')]=function(_0x4ba17e,_0x6ef591){return _0x4ba17e['define'](_0xbc4f('0x7'),attributes,{'tableName':_0xbc4f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd798=['SquareOdbc','square_odbc','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x551745,_0x28bb8f){var _0x1d37cc=function(_0x1f51c9){while(--_0x1f51c9){_0x551745['push'](_0x551745['shift']());}};_0x1d37cc(++_0x28bb8f);}(_0xd798,0x77));var _0x8d79=function(_0x465f20,_0x43d842){_0x465f20=_0x465f20-0x0;var _0x19d8ac=_0xd798[_0x465f20];return _0x19d8ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d79('0x0'));var moment=require(_0x8d79('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d79('0x2'));var rimraf=require(_0x8d79('0x3'));var config=require(_0x8d79('0x4'));var attributes=require('./squareOdbc.attributes');module[_0x8d79('0x5')]=function(_0x310be1,_0x3306e9){return _0x310be1[_0x8d79('0x6')](_0x8d79('0x7'),attributes,{'tableName':_0x8d79('0x8'),'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 fd9fe0d..7e4f3ff 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 _0x0678=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model'];(function(_0x302d8e,_0x284c8a){var _0xe0ce3b=function(_0x2d2537){while(--_0x2d2537){_0x302d8e['push'](_0x302d8e['shift']());}};_0xe0ce3b(++_0x284c8a);}(_0x0678,0xa6));var _0x8067=function(_0x4b8abf,_0x2ca0b7){_0x4b8abf=_0x4b8abf-0x0;var _0x5b5168=_0x0678[_0x4b8abf];return _0x5b5168;};'use strict';var _=require(_0x8067('0x0'));var util=require('util');var moment=require(_0x8067('0x1'));var BPromise=require(_0x8067('0x2'));var rs=require(_0x8067('0x3'));var fs=require('fs');var Redis=require(_0x8067('0x4'));var db=require(_0x8067('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8067('0x6'))('rpc');var config=require(_0x8067('0x7'));var jayson=require(_0x8067('0x8'));var client=jayson['client'][_0x8067('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10937e,_0x4a1b50,_0x4d1e89){return new BPromise(function(_0x3f4463,_0x2713a1){return client[_0x8067('0xa')](_0x10937e,_0x4d1e89)[_0x8067('0xb')](function(_0x4fa49a){logger[_0x8067('0xc')](_0x8067('0xd'),_0x4a1b50,_0x8067('0xe'));logger[_0x8067('0xf')](_0x8067('0x10'),_0x4a1b50,'request\x20sent',JSON[_0x8067('0x11')](_0x4fa49a));if(_0x4fa49a[_0x8067('0x12')]){if(_0x4fa49a[_0x8067('0x12')][_0x8067('0x13')]===0x1f4){logger[_0x8067('0x12')](_0x8067('0xd'),_0x4a1b50,_0x4fa49a[_0x8067('0x12')][_0x8067('0x14')]);return _0x2713a1(_0x4fa49a[_0x8067('0x12')][_0x8067('0x14')]);}logger[_0x8067('0x12')](_0x8067('0xd'),_0x4a1b50,_0x4fa49a[_0x8067('0x12')][_0x8067('0x14')]);return _0x3f4463(_0x4fa49a[_0x8067('0x12')][_0x8067('0x14')]);}else{logger[_0x8067('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x4a1b50,_0x8067('0xe'));_0x3f4463(_0x4fa49a[_0x8067('0x15')][_0x8067('0x14')]);}})['catch'](function(_0x2984c7){logger[_0x8067('0x12')](_0x8067('0xd'),_0x4a1b50,_0x2984c7);_0x2713a1(_0x2984c7);});});}exports[_0x8067('0x16')]=function(_0x4c738f){var _0x30d2a3=this;return new Promise(function(_0x217bc1,_0x4d8ce8){return db[_0x8067('0x17')][_0x8067('0x18')]({'raw':_0x4c738f['options']?_0x4c738f[_0x8067('0x19')][_0x8067('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c738f[_0x8067('0x19')]?_0x4c738f['options'][_0x8067('0x1b')]||null:null,'attributes':_0x4c738f[_0x8067('0x19')]?_0x4c738f[_0x8067('0x19')][_0x8067('0x1c')]||null:null,'include':_0x4c738f[_0x8067('0x19')]?_0x4c738f[_0x8067('0x19')][_0x8067('0x1d')]?_[_0x8067('0x1e')](_0x4c738f[_0x8067('0x19')][_0x8067('0x1d')],function(_0x35b048){return{'model':db[_0x35b048[_0x8067('0x1f')]],'as':_0x35b048['as'],'attributes':_0x35b048[_0x8067('0x1c')],'include':_0x35b048['include']?_[_0x8067('0x1e')](_0x35b048[_0x8067('0x1d')],function(_0x19a7dd){return{'model':db[_0x19a7dd[_0x8067('0x1f')]],'as':_0x19a7dd['as'],'attributes':_0x19a7dd[_0x8067('0x1c')],'include':_0x19a7dd['include']?_[_0x8067('0x1e')](_0x19a7dd[_0x8067('0x1d')],function(_0x1b03d0){return{'model':db[_0x1b03d0[_0x8067('0x1f')]],'as':_0x1b03d0['as'],'attributes':_0x1b03d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8067('0xb')](function(_0x3c4195){logger['info'](_0x8067('0x16'),_0x4c738f);logger[_0x8067('0xf')]('ShowSquareOdbc',_0x4c738f,JSON['stringify'](_0x3c4195));_0x217bc1(_0x3c4195);})[_0x8067('0x20')](function(_0x5d81f2){logger[_0x8067('0x12')](_0x8067('0x16'),_0x5d81f2[_0x8067('0x14')],_0x4c738f);_0x4d8ce8(_0x30d2a3['error'](0x1f4,_0x5d81f2['message']));});});}; \ No newline at end of file +var _0x7b36=['result','catch','SquareOdbc','find','options','where','attributes','map','include','model','then','ShowSquareOdbc','debug','util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x39ec76,_0x1281ad){var _0x551f50=function(_0x10cf67){while(--_0x10cf67){_0x39ec76['push'](_0x39ec76['shift']());}};_0x551f50(++_0x1281ad);}(_0x7b36,0x15d));var _0x67b3=function(_0xb01bd0,_0x218c09){_0xb01bd0=_0xb01bd0-0x0;var _0x2e1de7=_0x7b36[_0xb01bd0];return _0x2e1de7;};'use strict';var _=require('lodash');var util=require(_0x67b3('0x0'));var moment=require(_0x67b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x67b3('0x3'));var logger=require(_0x67b3('0x4'))(_0x67b3('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x67b3('0x6')][_0x67b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5150bb,_0x5adc39,_0x52be08){return new BPromise(function(_0x34adab,_0x19683d){return client[_0x67b3('0x8')](_0x5150bb,_0x52be08)['then'](function(_0x55d1ae){logger[_0x67b3('0x9')](_0x67b3('0xa'),_0x5adc39,_0x67b3('0xb'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x5adc39,_0x67b3('0xb'),JSON[_0x67b3('0xc')](_0x55d1ae));if(_0x55d1ae[_0x67b3('0xd')]){if(_0x55d1ae[_0x67b3('0xd')]['code']===0x1f4){logger[_0x67b3('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x5adc39,_0x55d1ae['error']['message']);return _0x19683d(_0x55d1ae[_0x67b3('0xd')][_0x67b3('0xe')]);}logger['error'](_0x67b3('0xa'),_0x5adc39,_0x55d1ae['error'][_0x67b3('0xe')]);return _0x34adab(_0x55d1ae[_0x67b3('0xd')][_0x67b3('0xe')]);}else{logger[_0x67b3('0x9')](_0x67b3('0xa'),_0x5adc39,'request\x20sent');_0x34adab(_0x55d1ae[_0x67b3('0xf')][_0x67b3('0xe')]);}})[_0x67b3('0x10')](function(_0x33eda5){logger[_0x67b3('0xd')](_0x67b3('0xa'),_0x5adc39,_0x33eda5);_0x19683d(_0x33eda5);});});}exports['ShowSquareOdbc']=function(_0x1f744c){var _0xe4af6a=this;return new Promise(function(_0x49c201,_0x570cad){return db[_0x67b3('0x11')][_0x67b3('0x12')]({'raw':_0x1f744c[_0x67b3('0x13')]?_0x1f744c[_0x67b3('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x1f744c[_0x67b3('0x13')]?_0x1f744c[_0x67b3('0x13')][_0x67b3('0x14')]||null:null,'attributes':_0x1f744c[_0x67b3('0x13')]?_0x1f744c[_0x67b3('0x13')][_0x67b3('0x15')]||null:null,'include':_0x1f744c['options']?_0x1f744c[_0x67b3('0x13')]['include']?_[_0x67b3('0x16')](_0x1f744c[_0x67b3('0x13')][_0x67b3('0x17')],function(_0x25f759){return{'model':db[_0x25f759[_0x67b3('0x18')]],'as':_0x25f759['as'],'attributes':_0x25f759['attributes'],'include':_0x25f759[_0x67b3('0x17')]?_['map'](_0x25f759['include'],function(_0x15a2b4){return{'model':db[_0x15a2b4[_0x67b3('0x18')]],'as':_0x15a2b4['as'],'attributes':_0x15a2b4['attributes'],'include':_0x15a2b4['include']?_['map'](_0x15a2b4[_0x67b3('0x17')],function(_0x233867){return{'model':db[_0x233867['model']],'as':_0x233867['as'],'attributes':_0x233867[_0x67b3('0x15')]};}):[]};}):[]};}):[]:[]})[_0x67b3('0x19')](function(_0xeb91f7){logger[_0x67b3('0x9')](_0x67b3('0x1a'),_0x1f744c);logger[_0x67b3('0x1b')](_0x67b3('0x1a'),_0x1f744c,JSON[_0x67b3('0xc')](_0xeb91f7));_0x49c201(_0xeb91f7);})[_0x67b3('0x10')](function(_0x1123a5){logger['error']('ShowSquareOdbc',_0x1123a5[_0x67b3('0xe')],_0x1f744c);_0x570cad(_0xe4af6a[_0x67b3('0xd')](0x1f4,_0x1123a5[_0x67b3('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f7243a0..3258234 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 _0xfd49=['put','/:id','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./squareProject.controller','isAuthenticated','index','get','show','/:id/users','getUsers','post','addUsers'];(function(_0x15e51c,_0x1eff92){var _0x16e2a4=function(_0x5b1d57){while(--_0x5b1d57){_0x15e51c['push'](_0x15e51c['shift']());}};_0x16e2a4(++_0x1eff92);}(_0xfd49,0x91));var _0x9fd4=function(_0x4d372a,_0x3cd10c){_0x4d372a=_0x4d372a-0x0;var _0x4c649c=_0xfd49[_0x4d372a];return _0x4c649c;};'use strict';var multer=require(_0x9fd4('0x0'));var util=require(_0x9fd4('0x1'));var path=require(_0x9fd4('0x2'));var timeout=require(_0x9fd4('0x3'));var express=require(_0x9fd4('0x4'));var router=express[_0x9fd4('0x5')]();var fs_extra=require(_0x9fd4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9fd4('0x7'));router['get']('/',auth[_0x9fd4('0x8')](),controller[_0x9fd4('0x9')]);router[_0x9fd4('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9fd4('0xb')]);router[_0x9fd4('0xa')](_0x9fd4('0xc'),auth[_0x9fd4('0x8')](),controller[_0x9fd4('0xd')]);router['post']('/',auth[_0x9fd4('0x8')](),controller['create']);router[_0x9fd4('0xe')](_0x9fd4('0xc'),auth[_0x9fd4('0x8')](),controller[_0x9fd4('0xf')]);router[_0x9fd4('0x10')](_0x9fd4('0x11'),auth['isAuthenticated'](),controller[_0x9fd4('0x12')]);router[_0x9fd4('0x13')](_0x9fd4('0x11'),auth[_0x9fd4('0x8')](),controller[_0x9fd4('0x14')]);router[_0x9fd4('0x13')]('/:id/users',auth[_0x9fd4('0x8')](),controller[_0x9fd4('0x15')]);module[_0x9fd4('0x16')]=router; \ No newline at end of file +var _0x64e6=['./squareProject.controller','get','index','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','addUsers','delete','destroy','removeUsers','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x64e6,0x1b2));var _0x664e=function(_0x340bc2,_0x4d3764){_0x340bc2=_0x340bc2-0x0;var _0x3c0e00=_0x64e6[_0x340bc2];return _0x3c0e00;};'use strict';var multer=require(_0x664e('0x0'));var util=require('util');var path=require(_0x664e('0x1'));var timeout=require(_0x664e('0x2'));var express=require(_0x664e('0x3'));var router=express[_0x664e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x664e('0x5'));var config=require('../../config/environment');var controller=require(_0x664e('0x6'));router[_0x664e('0x7')]('/',auth['isAuthenticated'](),controller[_0x664e('0x8')]);router[_0x664e('0x7')](_0x664e('0x9'),auth['isAuthenticated'](),controller[_0x664e('0xa')]);router[_0x664e('0x7')](_0x664e('0xb'),auth[_0x664e('0xc')](),controller[_0x664e('0xd')]);router[_0x664e('0xe')]('/',auth['isAuthenticated'](),controller[_0x664e('0xf')]);router[_0x664e('0xe')](_0x664e('0xb'),auth[_0x664e('0xc')](),controller[_0x664e('0x10')]);router['put'](_0x664e('0x9'),auth[_0x664e('0xc')](),controller['update']);router[_0x664e('0x11')]('/:id',auth[_0x664e('0xc')](),controller[_0x664e('0x12')]);router['delete']('/:id/users',auth[_0x664e('0xc')](),controller[_0x664e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cf6d768..1b71dea 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 _0x48f5=['BLOB','long','getDataValue','preproduction','production','toString','utf8','DATE','sequelize','exports','STRING','name'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x48f5,0x68));var _0x548f=function(_0x506f1c,_0x459028){_0x506f1c=_0x506f1c-0x0;var _0x4ed523=_0x48f5[_0x506f1c];return _0x4ed523;};'use strict';var Sequelize=require(_0x548f('0x0'));module[_0x548f('0x1')]={'name':{'type':Sequelize[_0x548f('0x2')],'unique':_0x548f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x548f('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x548f('0x4')](_0x548f('0x5')),'get':function(){if(this[_0x548f('0x6')]('preproduction')){return this[_0x548f('0x6')](_0x548f('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0x548f('0x8'))){return this['getDataValue']('production')[_0x548f('0x9')](_0x548f('0xa'));}}},'savedAt':{'type':Sequelize[_0x548f('0xb')]},'publishedAt':{'type':Sequelize[_0x548f('0xb')]}}; \ No newline at end of file +var _0xaeb3=['BLOB','long','getDataValue','preproduction','toString','production','utf8','DATE','sequelize','exports','STRING','TEXT'];(function(_0x3de4b4,_0x1bf830){var _0x2ad6c5=function(_0x2c4a4){while(--_0x2c4a4){_0x3de4b4['push'](_0x3de4b4['shift']());}};_0x2ad6c5(++_0x1bf830);}(_0xaeb3,0x128));var _0x3aeb=function(_0x455633,_0x3e63ef){_0x455633=_0x455633-0x0;var _0x3daa1b=_0xaeb3[_0x455633];return _0x3daa1b;};'use strict';var Sequelize=require(_0x3aeb('0x0'));module[_0x3aeb('0x1')]={'name':{'type':Sequelize[_0x3aeb('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3aeb('0x2')]},'notes':{'type':Sequelize[_0x3aeb('0x3')]},'preproduction':{'type':Sequelize[_0x3aeb('0x4')](_0x3aeb('0x5')),'get':function(){if(this[_0x3aeb('0x6')](_0x3aeb('0x7'))){return this[_0x3aeb('0x6')](_0x3aeb('0x7'))[_0x3aeb('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x3aeb('0x5')),'get':function(){if(this['getDataValue'](_0x3aeb('0x9'))){return this[_0x3aeb('0x6')](_0x3aeb('0x9'))[_0x3aeb('0x8')](_0x3aeb('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x3aeb('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 380a89e..638f781 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 _0xd943=['catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','pick','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','UserProfileResource','publish','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys'];(function(_0x69618f,_0x2bd428){var _0x49df9a=function(_0x48a2b2){while(--_0x48a2b2){_0x69618f['push'](_0x69618f['shift']());}};_0x49df9a(++_0x2bd428);}(_0xd943,0x15d));var _0x3d94=function(_0x38d2dc,_0x5cf7b6){_0x38d2dc=_0x38d2dc-0x0;var _0x2726ec=_0xd943[_0x38d2dc];return _0x2726ec;};'use strict';var _=require(_0x3d94('0x0'));var Redis=require(_0x3d94('0x1'));var qs=require(_0x3d94('0x2'));var logger=require(_0x3d94('0x3'))('api');var config=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];config[_0x3d94('0x6')]=_[_0x3d94('0x7')](config[_0x3d94('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x4d29e7,_0x20f4d1){_0x20f4d1=_0x20f4d1||0xcc;return function(_0x35d36a){if(_0x35d36a){return _0x4d29e7['sendStatus'](_0x20f4d1);}return _0x4d29e7['status'](_0x20f4d1)[_0x3d94('0x8')]();};}function respondWithResult(_0x27e381,_0x1cc58c){_0x1cc58c=_0x1cc58c||0xc8;return function(_0x5908a7){if(_0x5908a7){return _0x27e381[_0x3d94('0x9')](_0x1cc58c)['json'](_0x5908a7);}};}function respondWithFilteredResult(_0x39e2fa,_0x301536){return function(_0x5f5041){if(_0x5f5041){var _0x1897de=typeof _0x301536[_0x3d94('0xa')]===_0x3d94('0xb')&&typeof _0x301536[_0x3d94('0xc')]===_0x3d94('0xb');var _0x548b89=_0x5f5041[_0x3d94('0xd')];var _0x2e9af0=_0x1897de?0x0:_0x301536[_0x3d94('0xa')];var _0x4c167c=_0x1897de?_0x5f5041[_0x3d94('0xd')]:_0x301536[_0x3d94('0xa')]+_0x301536[_0x3d94('0xc')];var _0x5d9366;if(_0x4c167c>=_0x548b89){_0x4c167c=_0x548b89;_0x5d9366=0xc8;}else{_0x5d9366=0xce;}_0x39e2fa[_0x3d94('0x9')](_0x5d9366);return _0x39e2fa[_0x3d94('0xe')](_0x3d94('0xf'),_0x2e9af0+'-'+_0x4c167c+'/'+_0x548b89)[_0x3d94('0x10')](_0x5f5041);}return null;};}function saveUpdates(_0xaf939a){return function(_0xd8efaa){if(_0xd8efaa){return _0xd8efaa[_0x3d94('0x11')](_0xaf939a)[_0x3d94('0x12')](function(_0x540658){return _0x540658;});}return null;};}function removeEntity(_0x22676a){return function(_0x1a9315){if(_0x1a9315){return _0x1a9315[_0x3d94('0x13')]()[_0x3d94('0x12')](function(){var _0x4afc92=_0x1a9315[_0x3d94('0x14')]({'plain':!![]});var _0xef8b3='SquareProjects';return db[_0x3d94('0x15')]['destroy']({'where':{'type':_0xef8b3,'resourceId':_0x4afc92['id']}})[_0x3d94('0x12')](function(){return _0x1a9315;});})[_0x3d94('0x12')](function(){var _0x16a6d0=new Redis(config[_0x3d94('0x6')]);_0x16a6d0[_0x3d94('0x16')]('agi',JSON['stringify']({'id':_0x1a9315['id'],'deleted':!![]}));})[_0x3d94('0x12')](function(){_0x22676a[_0x3d94('0x9')](0xcc)[_0x3d94('0x8')]();});}};}function handleEntityNotFound(_0x4edee4){return function(_0x30af25){if(!_0x30af25){_0x4edee4[_0x3d94('0x17')](0x194);}return _0x30af25;};}function handleError(_0x123adc,_0x384f76){_0x384f76=_0x384f76||0x1f4;return function(_0x395133){logger[_0x3d94('0x18')](_0x395133[_0x3d94('0x19')]);if(_0x395133[_0x3d94('0x1a')]){delete _0x395133[_0x3d94('0x1a')];}_0x123adc[_0x3d94('0x9')](_0x384f76)[_0x3d94('0x1b')](_0x395133);};}exports[_0x3d94('0x1c')]=function(_0x292976,_0x3496c3){var _0x2945d2={},_0x5b3b31={},_0x123183={'count':0x0,'rows':[]};var _0x558fd2=_[_0x3d94('0x1d')](db[_0x3d94('0x1e')][_0x3d94('0x1f')],function(_0x439173){return{'name':_0x439173[_0x3d94('0x20')],'type':_0x439173[_0x3d94('0x21')][_0x3d94('0x22')]};});_0x5b3b31['model']=_['map'](_0x558fd2,_0x3d94('0x1a'));_0x5b3b31['query']=_['keys'](_0x292976[_0x3d94('0x23')]);_0x5b3b31['filters']=_[_0x3d94('0x24')](_0x5b3b31[_0x3d94('0x25')],_0x5b3b31[_0x3d94('0x23')]);_0x2945d2['attributes']=_[_0x3d94('0x24')](_0x5b3b31['model'],qs[_0x3d94('0x26')](_0x292976['query'][_0x3d94('0x26')]));_0x2945d2[_0x3d94('0x27')]=_0x2945d2[_0x3d94('0x27')][_0x3d94('0x28')]?_0x2945d2['attributes']:_0x5b3b31[_0x3d94('0x25')];if(!_0x292976['query'][_0x3d94('0x29')](_0x3d94('0x2a'))){_0x2945d2['limit']=qs['limit'](_0x292976[_0x3d94('0x23')][_0x3d94('0xc')]);_0x2945d2[_0x3d94('0xa')]=qs['offset'](_0x292976[_0x3d94('0x23')][_0x3d94('0xa')]);}_0x2945d2['order']=qs[_0x3d94('0x2b')](_0x292976[_0x3d94('0x23')][_0x3d94('0x2b')]);_0x2945d2[_0x3d94('0x2c')]=qs[_0x3d94('0x2d')](_['pick'](_0x292976[_0x3d94('0x23')],_0x5b3b31[_0x3d94('0x2d')]),_0x558fd2);if(_0x292976[_0x3d94('0x23')][_0x3d94('0x2e')]){_0x2945d2[_0x3d94('0x2c')]=_[_0x3d94('0x2f')](_0x2945d2['where'],{'$or':_['map'](_0x558fd2,function(_0xfe58eb){if(_0xfe58eb[_0x3d94('0x21')]!==_0x3d94('0x30')){var _0x438ba3={};_0x438ba3[_0xfe58eb[_0x3d94('0x1a')]]={'$like':'%'+_0x292976[_0x3d94('0x23')][_0x3d94('0x2e')]+'%'};return _0x438ba3;}})});}_0x2945d2=_[_0x3d94('0x2f')]({},_0x2945d2,_0x292976[_0x3d94('0x31')]);var _0x2235f9={'where':_0x2945d2['where']};return db[_0x3d94('0x1e')][_0x3d94('0xd')](_0x2235f9)[_0x3d94('0x12')](function(_0xcc289a){_0x123183['count']=_0xcc289a;if(_0x292976[_0x3d94('0x23')][_0x3d94('0x32')]){_0x2945d2[_0x3d94('0x33')]=[{'all':!![]}];}return db[_0x3d94('0x1e')][_0x3d94('0x34')](_0x2945d2);})['then'](function(_0x217e5e){_0x123183[_0x3d94('0x35')]=_0x217e5e;return _0x123183;})[_0x3d94('0x12')](respondWithFilteredResult(_0x3496c3,_0x2945d2))['catch'](handleError(_0x3496c3,null));};exports['show']=function(_0x4d8a8f,_0x47905e){var _0x3b3550={'raw':![],'where':{'id':_0x4d8a8f[_0x3d94('0x36')]['id']}},_0x22f52c={};_0x22f52c[_0x3d94('0x25')]=_[_0x3d94('0x37')](db[_0x3d94('0x1e')][_0x3d94('0x1f')]);_0x22f52c['query']=_['keys'](_0x4d8a8f[_0x3d94('0x23')]);_0x22f52c[_0x3d94('0x2d')]=_['intersection'](_0x22f52c[_0x3d94('0x25')],_0x22f52c['query']);_0x3b3550[_0x3d94('0x27')]=_[_0x3d94('0x24')](_0x22f52c[_0x3d94('0x25')],qs[_0x3d94('0x26')](_0x4d8a8f[_0x3d94('0x23')]['fields']));_0x3b3550[_0x3d94('0x27')]=_0x3b3550[_0x3d94('0x27')][_0x3d94('0x28')]?_0x3b3550['attributes']:_0x22f52c[_0x3d94('0x25')];if(_0x4d8a8f['query']['includeAll']){_0x3b3550[_0x3d94('0x33')]=[{'all':!![]}];}_0x3b3550=_[_0x3d94('0x2f')]({},_0x3b3550,_0x4d8a8f[_0x3d94('0x31')]);return db[_0x3d94('0x1e')]['find'](_0x3b3550)[_0x3d94('0x12')](handleEntityNotFound(_0x47905e,null))['then'](respondWithResult(_0x47905e,null))[_0x3d94('0x38')](handleError(_0x47905e,null));};exports[_0x3d94('0x39')]=function(_0x35c911,_0x15c8e7){return db[_0x3d94('0x1e')][_0x3d94('0x39')](_0x35c911[_0x3d94('0x3a')],{})['then'](function(_0x10a377){var _0x19dabb=_0x35c911['user']['get']({'plain':!![]});if(!_0x19dabb)throw new Error(_0x3d94('0x3b'));if(_0x19dabb[_0x3d94('0x3c')]==='user'){var _0x3c8571=_0x10a377[_0x3d94('0x14')]({'plain':!![]});var _0x16d505=_0x3d94('0x3d');return db[_0x3d94('0x3e')][_0x3d94('0x3f')]({'where':{'name':_0x16d505,'userProfileId':_0x19dabb[_0x3d94('0x40')]},'raw':!![]})[_0x3d94('0x12')](function(_0x60279f){if(_0x60279f&&_0x60279f[_0x3d94('0x41')]===0x0){return db[_0x3d94('0x15')][_0x3d94('0x39')]({'name':_0x3c8571[_0x3d94('0x1a')],'resourceId':_0x3c8571['id'],'type':_0x60279f[_0x3d94('0x1a')],'sectionId':_0x60279f['id']},{})[_0x3d94('0x12')](function(){return _0x10a377;});}else{return _0x10a377;}})['catch'](function(_0x44df82){logger[_0x3d94('0x18')](_0x3d94('0x42'),_0x44df82);throw _0x44df82;});}return _0x10a377;})[_0x3d94('0x12')](respondWithResult(_0x15c8e7,0xc9))[_0x3d94('0x38')](handleError(_0x15c8e7,null));};exports[_0x3d94('0x11')]=function(_0x129783,_0x33db0a){if(_0x129783[_0x3d94('0x3a')]['id']){delete _0x129783['body']['id'];}return db[_0x3d94('0x1e')]['find']({'where':{'id':_0x129783[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x33db0a,null))['then'](saveUpdates(_0x129783[_0x3d94('0x3a')],null))['then'](function(_0x567751){if(!_0x567751)return;var _0x335247=_0x567751['get']({'plain':!![]});return _0x335247;})[_0x3d94('0x12')](function(_0x132e0b){var _0x5b6061=new Redis(config[_0x3d94('0x6')]);_0x5b6061['publish']('agi',JSON[_0x3d94('0x43')](_[_0x3d94('0x44')](_0x132e0b,['id',_0x3d94('0x1a'),_0x3d94('0x45')])));return _0x132e0b;})[_0x3d94('0x12')](respondWithResult(_0x33db0a,null))[_0x3d94('0x38')](handleError(_0x33db0a,null));};exports[_0x3d94('0x13')]=function(_0x2b1168,_0xae892){return db['SquareProject'][_0x3d94('0x3f')]({'where':{'id':_0x2b1168[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0xae892,null))[_0x3d94('0x12')](removeEntity(_0xae892,null))[_0x3d94('0x38')](handleError(_0xae892,null));};exports[_0x3d94('0x46')]=function(_0x39e9db,_0x126894){return db[_0x3d94('0x1e')][_0x3d94('0x3f')]({'where':{'id':_0x39e9db[_0x3d94('0x36')]['id']}})['then'](handleEntityNotFound(_0x126894,null))[_0x3d94('0x12')](function(_0x55580d){if(_0x55580d){return _0x55580d[_0x3d94('0x46')](_0x39e9db[_0x3d94('0x3a')][_0x3d94('0x47')],_[_0x3d94('0x48')](_0x39e9db[_0x3d94('0x3a')],[_0x3d94('0x47'),'id'])||{});}})[_0x3d94('0x12')](respondWithResult(_0x126894,null))[_0x3d94('0x38')](handleError(_0x126894,null));};exports[_0x3d94('0x49')]=function(_0x5da38c,_0x519ada){return db[_0x3d94('0x1e')]['find']({'where':{'id':_0x5da38c[_0x3d94('0x36')]['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x519ada,null))['then'](function(_0x211f0e){if(_0x211f0e){return _0x211f0e[_0x3d94('0x49')](_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')])[_0x3d94('0x12')](function(){if(_[_0x3d94('0x4a')](_0x5da38c[_0x3d94('0x23')]['ids'])){for(var _0x22dbf9=0x0;_0x22dbf9<_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')]['length'];_0x22dbf9+=0x1){socket[_0x3d94('0x4b')](_0x3d94('0x4c'),{'UserId':Number(_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')][_0x22dbf9]),'SquareProjectId':Number(_0x5da38c['params']['id'])});}}else{socket['emit'](_0x3d94('0x4c'),{'UserId':Number(_0x5da38c[_0x3d94('0x23')][_0x3d94('0x47')]),'SquareProjectId':Number(_0x5da38c[_0x3d94('0x36')]['id'])});}});}})['then'](respondWithStatusCode(_0x519ada,null))[_0x3d94('0x38')](handleError(_0x519ada,null));};exports[_0x3d94('0x4d')]=function(_0x49bfb0,_0x5ba865){var _0x250c87={};var _0x336e36={};var _0x4eee2b;var _0x3135f3;return db[_0x3d94('0x1e')][_0x3d94('0x4e')]({'where':{'id':_0x49bfb0['params']['id']}})[_0x3d94('0x12')](handleEntityNotFound(_0x5ba865,null))[_0x3d94('0x12')](function(_0x5c7aac){if(_0x5c7aac){_0x4eee2b=_0x5c7aac;_0x336e36['model']=_['keys'](db[_0x3d94('0x4f')][_0x3d94('0x1f')]);_0x336e36[_0x3d94('0x23')]=_[_0x3d94('0x37')](_0x49bfb0[_0x3d94('0x23')]);_0x336e36['filters']=_[_0x3d94('0x24')](_0x336e36[_0x3d94('0x25')],_0x336e36[_0x3d94('0x23')]);_0x250c87[_0x3d94('0x27')]=_[_0x3d94('0x24')](_0x336e36[_0x3d94('0x25')],qs['fields'](_0x49bfb0[_0x3d94('0x23')]['fields']));_0x250c87[_0x3d94('0x27')]=_0x250c87[_0x3d94('0x27')][_0x3d94('0x28')]?_0x250c87[_0x3d94('0x27')]:_0x336e36[_0x3d94('0x25')];_0x250c87[_0x3d94('0x50')]=qs['sort'](_0x49bfb0['query'][_0x3d94('0x2b')]);_0x250c87['where']=qs['filters'](_['pick'](_0x49bfb0[_0x3d94('0x23')],_0x336e36[_0x3d94('0x2d')]));if(_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x2e')]){_0x250c87[_0x3d94('0x2c')]=_[_0x3d94('0x2f')](_0x250c87[_0x3d94('0x2c')],{'$or':_[_0x3d94('0x1d')](_0x250c87['attributes'],function(_0x22917e){var _0x5e55a4={};_0x5e55a4[_0x22917e]={'$like':'%'+_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x2e')]+'%'};return _0x5e55a4;})});}_0x250c87=_[_0x3d94('0x2f')]({},_0x250c87,_0x49bfb0['options']);return _0x4eee2b['getUsers'](_0x250c87);}})['then'](function(_0x426ef5){if(_0x426ef5){_0x3135f3=_0x426ef5[_0x3d94('0x28')];if(!_0x49bfb0[_0x3d94('0x23')][_0x3d94('0x29')](_0x3d94('0x2a'))){_0x250c87['limit']=qs['limit'](_0x49bfb0[_0x3d94('0x23')][_0x3d94('0xc')]);_0x250c87[_0x3d94('0xa')]=qs['offset'](_0x49bfb0[_0x3d94('0x23')]['offset']);}return _0x4eee2b[_0x3d94('0x4d')](_0x250c87);}})[_0x3d94('0x12')](function(_0x15adf7){if(_0x15adf7){return _0x15adf7?{'count':_0x3135f3,'rows':_0x15adf7}:null;}})[_0x3d94('0x12')](respondWithResult(_0x5ba865,null))[_0x3d94('0x38')](handleError(_0x5ba865,null));}; \ No newline at end of file +var _0x7880=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','destroy','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','order','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','UserProfileResource','publish','agi','stringify','sendStatus','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','options','includeAll','include','catch','show','params','merge','find'];(function(_0x12efa0,_0x579590){var _0x158c02=function(_0x311422){while(--_0x311422){_0x12efa0['push'](_0x12efa0['shift']());}};_0x158c02(++_0x579590);}(_0x7880,0x1f4));var _0x0788=function(_0x4e9df2,_0x36818e){_0x4e9df2=_0x4e9df2-0x0;var _0x9fe790=_0x7880[_0x4e9df2];return _0x9fe790;};'use strict';var _=require('lodash');var Redis=require(_0x0788('0x0'));var qs=require(_0x0788('0x1'));var logger=require(_0x0788('0x2'))(_0x0788('0x3'));var config=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];config['redis']=_[_0x0788('0x6')](config[_0x0788('0x7')],{'host':_0x0788('0x8'),'port':0x18eb});var socket=require(_0x0788('0x9'))(new Redis(config[_0x0788('0x7')]));require(_0x0788('0xa'))[_0x0788('0xb')](socket);function respondWithStatusCode(_0x44bbb5,_0x3c29f3){_0x3c29f3=_0x3c29f3||0xcc;return function(_0x422f8b){if(_0x422f8b){return _0x44bbb5['sendStatus'](_0x3c29f3);}return _0x44bbb5[_0x0788('0xc')](_0x3c29f3)['end']();};}function respondWithResult(_0xabaf81,_0x53b2f2){_0x53b2f2=_0x53b2f2||0xc8;return function(_0x433c26){if(_0x433c26){return _0xabaf81[_0x0788('0xc')](_0x53b2f2)[_0x0788('0xd')](_0x433c26);}};}function respondWithFilteredResult(_0xee8670,_0x469ebe){return function(_0x5d747c){if(_0x5d747c){var _0x1920b3=typeof _0x469ebe[_0x0788('0xe')]===_0x0788('0xf')&&typeof _0x469ebe[_0x0788('0x10')]===_0x0788('0xf');var _0xce4342=_0x5d747c[_0x0788('0x11')];var _0x47a244=_0x1920b3?0x0:_0x469ebe[_0x0788('0xe')];var _0x7e3407=_0x1920b3?_0x5d747c[_0x0788('0x11')]:_0x469ebe[_0x0788('0xe')]+_0x469ebe['limit'];var _0x43ca01;if(_0x7e3407>=_0xce4342){_0x7e3407=_0xce4342;_0x43ca01=0xc8;}else{_0x43ca01=0xce;}_0xee8670['status'](_0x43ca01);return _0xee8670[_0x0788('0x12')](_0x0788('0x13'),_0x47a244+'-'+_0x7e3407+'/'+_0xce4342)[_0x0788('0xd')](_0x5d747c);}return null;};}function saveUpdates(_0xb406fb){return function(_0x2ddd1a){if(_0x2ddd1a){return _0x2ddd1a[_0x0788('0x14')](_0xb406fb)['then'](function(_0x573822){return _0x573822;});}return null;};}function removeEntity(_0x17d805){return function(_0x461d9d){if(_0x461d9d){return _0x461d9d['destroy']()[_0x0788('0x15')](function(){var _0x415f19=_0x461d9d[_0x0788('0x16')]({'plain':!![]});var _0x52c339=_0x0788('0x17');return db[_0x0788('0x18')]['destroy']({'where':{'type':_0x52c339,'resourceId':_0x415f19['id']}})[_0x0788('0x15')](function(){return _0x461d9d;});})['then'](function(){var _0x7d0869=new Redis(config['redis']);_0x7d0869[_0x0788('0x19')](_0x0788('0x1a'),JSON[_0x0788('0x1b')]({'id':_0x461d9d['id'],'deleted':!![]}));})[_0x0788('0x15')](function(){_0x17d805[_0x0788('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48ec43){return function(_0x2270d4){if(!_0x2270d4){_0x48ec43[_0x0788('0x1c')](0x194);}return _0x2270d4;};}function handleError(_0x645320,_0x7a99a1){_0x7a99a1=_0x7a99a1||0x1f4;return function(_0x5ba1da){logger['error'](_0x5ba1da[_0x0788('0x1d')]);if(_0x5ba1da[_0x0788('0x1e')]){delete _0x5ba1da[_0x0788('0x1e')];}_0x645320['status'](_0x7a99a1)['send'](_0x5ba1da);};}exports[_0x0788('0x1f')]=function(_0xa1f7dc,_0x5f2dda){var _0x48816a={},_0x5a54a5={},_0x44798c={'count':0x0,'rows':[]};var _0x57fda1=_[_0x0788('0x20')](db[_0x0788('0x21')][_0x0788('0x22')],function(_0x18fc0e){return{'name':_0x18fc0e[_0x0788('0x23')],'type':_0x18fc0e[_0x0788('0x24')][_0x0788('0x25')]};});_0x5a54a5[_0x0788('0x26')]=_['map'](_0x57fda1,'name');_0x5a54a5[_0x0788('0x27')]=_[_0x0788('0x28')](_0xa1f7dc['query']);_0x5a54a5['filters']=_[_0x0788('0x29')](_0x5a54a5[_0x0788('0x26')],_0x5a54a5[_0x0788('0x27')]);_0x48816a[_0x0788('0x2a')]=_[_0x0788('0x29')](_0x5a54a5[_0x0788('0x26')],qs[_0x0788('0x2b')](_0xa1f7dc[_0x0788('0x27')][_0x0788('0x2b')]));_0x48816a[_0x0788('0x2a')]=_0x48816a['attributes'][_0x0788('0x2c')]?_0x48816a[_0x0788('0x2a')]:_0x5a54a5[_0x0788('0x26')];if(!_0xa1f7dc[_0x0788('0x27')][_0x0788('0x2d')](_0x0788('0x2e'))){_0x48816a[_0x0788('0x10')]=qs[_0x0788('0x10')](_0xa1f7dc[_0x0788('0x27')][_0x0788('0x10')]);_0x48816a['offset']=qs['offset'](_0xa1f7dc['query']['offset']);}_0x48816a['order']=qs['sort'](_0xa1f7dc[_0x0788('0x27')][_0x0788('0x2f')]);_0x48816a[_0x0788('0x30')]=qs['filters'](_[_0x0788('0x31')](_0xa1f7dc[_0x0788('0x27')],_0x5a54a5[_0x0788('0x32')]),_0x57fda1);if(_0xa1f7dc[_0x0788('0x27')]['filter']){_0x48816a[_0x0788('0x30')]=_['merge'](_0x48816a[_0x0788('0x30')],{'$or':_['map'](_0x57fda1,function(_0x9d1edb){if(_0x9d1edb[_0x0788('0x24')]!=='VIRTUAL'){var _0x16f053={};_0x16f053[_0x9d1edb[_0x0788('0x1e')]]={'$like':'%'+_0xa1f7dc['query'][_0x0788('0x33')]+'%'};return _0x16f053;}})});}_0x48816a=_['merge']({},_0x48816a,_0xa1f7dc[_0x0788('0x34')]);var _0x5576c4={'where':_0x48816a[_0x0788('0x30')]};return db['SquareProject'][_0x0788('0x11')](_0x5576c4)['then'](function(_0x5dc77e){_0x44798c[_0x0788('0x11')]=_0x5dc77e;if(_0xa1f7dc[_0x0788('0x27')][_0x0788('0x35')]){_0x48816a[_0x0788('0x36')]=[{'all':!![]}];}return db[_0x0788('0x21')]['findAll'](_0x48816a);})['then'](function(_0x530d83){_0x44798c['rows']=_0x530d83;return _0x44798c;})[_0x0788('0x15')](respondWithFilteredResult(_0x5f2dda,_0x48816a))[_0x0788('0x37')](handleError(_0x5f2dda,null));};exports[_0x0788('0x38')]=function(_0x358a22,_0x362c49){var _0x5993ad={'raw':![],'where':{'id':_0x358a22[_0x0788('0x39')]['id']}},_0x4c7833={};_0x4c7833[_0x0788('0x26')]=_[_0x0788('0x28')](db[_0x0788('0x21')][_0x0788('0x22')]);_0x4c7833[_0x0788('0x27')]=_[_0x0788('0x28')](_0x358a22[_0x0788('0x27')]);_0x4c7833[_0x0788('0x32')]=_['intersection'](_0x4c7833['model'],_0x4c7833[_0x0788('0x27')]);_0x5993ad[_0x0788('0x2a')]=_[_0x0788('0x29')](_0x4c7833['model'],qs['fields'](_0x358a22['query'][_0x0788('0x2b')]));_0x5993ad[_0x0788('0x2a')]=_0x5993ad[_0x0788('0x2a')][_0x0788('0x2c')]?_0x5993ad[_0x0788('0x2a')]:_0x4c7833[_0x0788('0x26')];if(_0x358a22[_0x0788('0x27')][_0x0788('0x35')]){_0x5993ad['include']=[{'all':!![]}];}_0x5993ad=_[_0x0788('0x3a')]({},_0x5993ad,_0x358a22[_0x0788('0x34')]);return db[_0x0788('0x21')][_0x0788('0x3b')](_0x5993ad)['then'](handleEntityNotFound(_0x362c49,null))[_0x0788('0x15')](respondWithResult(_0x362c49,null))[_0x0788('0x37')](handleError(_0x362c49,null));};exports['create']=function(_0x5b5481,_0x524b43){return db[_0x0788('0x21')]['create'](_0x5b5481[_0x0788('0x3c')],{})[_0x0788('0x15')](function(_0x127ab4){var _0x329508=_0x5b5481[_0x0788('0x3d')][_0x0788('0x16')]({'plain':!![]});if(!_0x329508)throw new Error(_0x0788('0x3e'));if(_0x329508[_0x0788('0x3f')]==='user'){var _0x4c6366=_0x127ab4[_0x0788('0x16')]({'plain':!![]});var _0xe7dfdc=_0x0788('0x17');return db['UserProfileSection'][_0x0788('0x3b')]({'where':{'name':_0xe7dfdc,'userProfileId':_0x329508[_0x0788('0x40')]},'raw':!![]})[_0x0788('0x15')](function(_0x4563cd){if(_0x4563cd&&_0x4563cd[_0x0788('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c6366[_0x0788('0x1e')],'resourceId':_0x4c6366['id'],'type':_0x4563cd[_0x0788('0x1e')],'sectionId':_0x4563cd['id']},{})['then'](function(){return _0x127ab4;});}else{return _0x127ab4;}})[_0x0788('0x37')](function(_0x4a6cde){logger[_0x0788('0x42')](_0x0788('0x43'),_0x4a6cde);throw _0x4a6cde;});}return _0x127ab4;})[_0x0788('0x15')](respondWithResult(_0x524b43,0xc9))[_0x0788('0x37')](handleError(_0x524b43,null));};exports[_0x0788('0x14')]=function(_0x379928,_0x1722d4){if(_0x379928[_0x0788('0x3c')]['id']){delete _0x379928['body']['id'];}return db[_0x0788('0x21')][_0x0788('0x3b')]({'where':{'id':_0x379928[_0x0788('0x39')]['id']}})['then'](handleEntityNotFound(_0x1722d4,null))[_0x0788('0x15')](saveUpdates(_0x379928[_0x0788('0x3c')],null))['then'](function(_0x18e55e){if(!_0x18e55e)return;var _0x41110d=_0x18e55e[_0x0788('0x16')]({'plain':!![]});return _0x41110d;})[_0x0788('0x15')](function(_0x137e24){var _0x347cc8=new Redis(config['redis']);_0x347cc8['publish'](_0x0788('0x1a'),JSON[_0x0788('0x1b')](_['pick'](_0x137e24,['id',_0x0788('0x1e'),_0x0788('0x44')])));return _0x137e24;})[_0x0788('0x15')](respondWithResult(_0x1722d4,null))[_0x0788('0x37')](handleError(_0x1722d4,null));};exports[_0x0788('0x45')]=function(_0x226517,_0x112870){return db[_0x0788('0x21')][_0x0788('0x3b')]({'where':{'id':_0x226517[_0x0788('0x39')]['id']}})[_0x0788('0x15')](handleEntityNotFound(_0x112870,null))[_0x0788('0x15')](removeEntity(_0x112870,null))['catch'](handleError(_0x112870,null));};exports[_0x0788('0x46')]=function(_0x223036,_0x301a5b){return db['SquareProject'][_0x0788('0x3b')]({'where':{'id':_0x223036[_0x0788('0x39')]['id']}})['then'](handleEntityNotFound(_0x301a5b,null))['then'](function(_0x2f997e){if(_0x2f997e){return _0x2f997e[_0x0788('0x46')](_0x223036[_0x0788('0x3c')][_0x0788('0x47')],_[_0x0788('0x48')](_0x223036[_0x0788('0x3c')],['ids','id'])||{});}})[_0x0788('0x15')](respondWithResult(_0x301a5b,null))[_0x0788('0x37')](handleError(_0x301a5b,null));};exports[_0x0788('0x49')]=function(_0x47be71,_0x533f71){return db[_0x0788('0x21')]['find']({'where':{'id':_0x47be71[_0x0788('0x39')]['id']}})[_0x0788('0x15')](handleEntityNotFound(_0x533f71,null))[_0x0788('0x15')](function(_0x13a021){if(_0x13a021){return _0x13a021[_0x0788('0x49')](_0x47be71[_0x0788('0x27')][_0x0788('0x47')])[_0x0788('0x15')](function(){if(_[_0x0788('0x4a')](_0x47be71[_0x0788('0x27')]['ids'])){for(var _0xe1a934=0x0;_0xe1a934<_0x47be71[_0x0788('0x27')][_0x0788('0x47')][_0x0788('0x2c')];_0xe1a934+=0x1){socket['emit'](_0x0788('0x4b'),{'UserId':Number(_0x47be71[_0x0788('0x27')][_0x0788('0x47')][_0xe1a934]),'SquareProjectId':Number(_0x47be71[_0x0788('0x39')]['id'])});}}else{socket[_0x0788('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x47be71[_0x0788('0x27')]['ids']),'SquareProjectId':Number(_0x47be71[_0x0788('0x39')]['id'])});}});}})[_0x0788('0x15')](respondWithStatusCode(_0x533f71,null))[_0x0788('0x37')](handleError(_0x533f71,null));};exports[_0x0788('0x4d')]=function(_0x3baf23,_0x348cbf){var _0xdc7103={};var _0x150403={};var _0x17266c;var _0x4ac573;return db[_0x0788('0x21')][_0x0788('0x4e')]({'where':{'id':_0x3baf23[_0x0788('0x39')]['id']}})['then'](handleEntityNotFound(_0x348cbf,null))['then'](function(_0x6d255b){if(_0x6d255b){_0x17266c=_0x6d255b;_0x150403[_0x0788('0x26')]=_[_0x0788('0x28')](db['User'][_0x0788('0x22')]);_0x150403[_0x0788('0x27')]=_[_0x0788('0x28')](_0x3baf23[_0x0788('0x27')]);_0x150403['filters']=_['intersection'](_0x150403['model'],_0x150403[_0x0788('0x27')]);_0xdc7103[_0x0788('0x2a')]=_[_0x0788('0x29')](_0x150403['model'],qs['fields'](_0x3baf23[_0x0788('0x27')]['fields']));_0xdc7103[_0x0788('0x2a')]=_0xdc7103[_0x0788('0x2a')][_0x0788('0x2c')]?_0xdc7103[_0x0788('0x2a')]:_0x150403[_0x0788('0x26')];_0xdc7103[_0x0788('0x4f')]=qs[_0x0788('0x2f')](_0x3baf23[_0x0788('0x27')][_0x0788('0x2f')]);_0xdc7103[_0x0788('0x30')]=qs['filters'](_[_0x0788('0x31')](_0x3baf23[_0x0788('0x27')],_0x150403['filters']));if(_0x3baf23['query'][_0x0788('0x33')]){_0xdc7103[_0x0788('0x30')]=_[_0x0788('0x3a')](_0xdc7103[_0x0788('0x30')],{'$or':_[_0x0788('0x20')](_0xdc7103[_0x0788('0x2a')],function(_0x489277){var _0x384401={};_0x384401[_0x489277]={'$like':'%'+_0x3baf23[_0x0788('0x27')][_0x0788('0x33')]+'%'};return _0x384401;})});}_0xdc7103=_[_0x0788('0x3a')]({},_0xdc7103,_0x3baf23['options']);return _0x17266c[_0x0788('0x4d')](_0xdc7103);}})[_0x0788('0x15')](function(_0x3f3616){if(_0x3f3616){_0x4ac573=_0x3f3616[_0x0788('0x2c')];if(!_0x3baf23['query']['hasOwnProperty'](_0x0788('0x2e'))){_0xdc7103[_0x0788('0x10')]=qs[_0x0788('0x10')](_0x3baf23[_0x0788('0x27')][_0x0788('0x10')]);_0xdc7103[_0x0788('0xe')]=qs[_0x0788('0xe')](_0x3baf23[_0x0788('0x27')][_0x0788('0xe')]);}return _0x17266c['getUsers'](_0xdc7103);}})[_0x0788('0x15')](function(_0x334408){if(_0x334408){return _0x334408?{'count':_0x4ac573,'rows':_0x334408}:null;}})[_0x0788('0x15')](respondWithResult(_0x348cbf,null))['catch'](handleError(_0x348cbf,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9f3c498..0fa0f96 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 _0x62b8=['SquareProject','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x37d59b,_0x421a04){var _0x49b827=function(_0x57fb5d){while(--_0x57fb5d){_0x37d59b['push'](_0x37d59b['shift']());}};_0x49b827(++_0x421a04);}(_0x62b8,0x16e));var _0x862b=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x62b8[_0x14fad0];return _0x5c665f;};'use strict';var EventEmitter=require(_0x862b('0x0'));var SquareProject=require(_0x862b('0x1'))['db'][_0x862b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x862b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x862b('0x4')};function emitEvent(_0x699e39){return function(_0x55f9fe,_0x3e59b3,_0x114bd1){SquareProjectEvents[_0x862b('0x5')](_0x699e39+':'+_0x55f9fe['id'],_0x55f9fe);SquareProjectEvents[_0x862b('0x5')](_0x699e39,_0x55f9fe);_0x114bd1(null);};}for(var e in events){if(events[_0x862b('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x862b('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x1a8a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1a8a,0xbb));var _0xa1a8=function(_0x33a6bd,_0x564362){_0x33a6bd=_0x33a6bd-0x0;var _0x339aff=_0x1a8a[_0x33a6bd];return _0x339aff;};'use strict';var EventEmitter=require(_0xa1a8('0x0'));var SquareProject=require(_0xa1a8('0x1'))['db'][_0xa1a8('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa1a8('0x3')](0x0);var events={'afterCreate':_0xa1a8('0x4'),'afterUpdate':_0xa1a8('0x5'),'afterDestroy':_0xa1a8('0x6')};function emitEvent(_0x37592a){return function(_0x1d5f90,_0x654a79,_0x151db3){SquareProjectEvents['emit'](_0x37592a+':'+_0x1d5f90['id'],_0x1d5f90);SquareProjectEvents[_0xa1a8('0x7')](_0x37592a,_0x1d5f90);_0x151db3(null);};}for(var e in events){if(events[_0xa1a8('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa1a8('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2279c53..e101692 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 _0x8fe9=['SquareProject','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x25d5e9,_0x340fda){var _0xa351e2=function(_0x14bc4a){while(--_0x14bc4a){_0x25d5e9['push'](_0x25d5e9['shift']());}};_0xa351e2(++_0x340fda);}(_0x8fe9,0x181));var _0x98fe=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0x8fe9[_0x594e11];return _0x5418ad;};'use strict';var _=require(_0x98fe('0x0'));var util=require('util');var logger=require(_0x98fe('0x1'))(_0x98fe('0x2'));var moment=require(_0x98fe('0x3'));var BPromise=require(_0x98fe('0x4'));var rp=require(_0x98fe('0x5'));var fs=require('fs');var path=require(_0x98fe('0x6'));var rimraf=require(_0x98fe('0x7'));var config=require(_0x98fe('0x8'));var attributes=require(_0x98fe('0x9'));module[_0x98fe('0xa')]=function(_0x465341,_0x5755de){return _0x465341['define'](_0x98fe('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40a989,_0x153b4a,_0x3b97f0){if(_0x40a989[_0x98fe('0xc')]('preproduction')){_0x40a989[_0x98fe('0xd')]=moment()['format'](_0x98fe('0xe'));}if(_0x40a989['changed'](_0x98fe('0xf'))){_0x40a989[_0x98fe('0x10')]=moment()[_0x98fe('0x11')](_0x98fe('0xe'));}_0x3b97f0(null,_0x40a989);}}});}; \ No newline at end of file +var _0xf6f8=['publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','production'];(function(_0x3f9f92,_0x2133f0){var _0x1003fc=function(_0x1f3e9a){while(--_0x1f3e9a){_0x3f9f92['push'](_0x3f9f92['shift']());}};_0x1003fc(++_0x2133f0);}(_0xf6f8,0xc8));var _0x8f6f=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xf6f8[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x8f6f('0x0'));var util=require(_0x8f6f('0x1'));var logger=require(_0x8f6f('0x2'))(_0x8f6f('0x3'));var moment=require(_0x8f6f('0x4'));var BPromise=require(_0x8f6f('0x5'));var rp=require(_0x8f6f('0x6'));var fs=require('fs');var path=require(_0x8f6f('0x7'));var rimraf=require(_0x8f6f('0x8'));var config=require(_0x8f6f('0x9'));var attributes=require(_0x8f6f('0xa'));module[_0x8f6f('0xb')]=function(_0x4d1932,_0x1beb5b){return _0x4d1932[_0x8f6f('0xc')](_0x8f6f('0xd'),attributes,{'tableName':_0x8f6f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe29161,_0x3ba196,_0x28b141){if(_0xe29161[_0x8f6f('0xf')](_0x8f6f('0x10'))){_0xe29161[_0x8f6f('0x11')]=moment()[_0x8f6f('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xe29161['changed'](_0x8f6f('0x13'))){_0xe29161[_0x8f6f('0x14')]=moment()['format'](_0x8f6f('0x15'));}_0x28b141(null,_0xe29161);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a0d5bea..1f5f4e2 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 _0x3239=['attributes','limit','map','include','model','then','info','debug','stringify','error','message','ShowSquareProject','catch','lodash','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x3239,0x7d));var _0x9323=function(_0x176362,_0xc54a7f){_0x176362=_0x176362-0x0;var _0x352765=_0x3239[_0x176362];return _0x352765;};'use strict';var _=require(_0x9323('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x9323('0x1'))(_0x9323('0x2'));var config=require(_0x9323('0x3'));config[_0x9323('0x4')]=_[_0x9323('0x5')](config[_0x9323('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x9323('0x6'))(new Redis(config[_0x9323('0x4')]));require(_0x9323('0x7'))[_0x9323('0x8')](socket);exports[_0x9323('0x9')]=function(_0x20087b){var _0x50c5f3=this;return new Promise(function(_0x270d1d,_0x3f61db){return db[_0x9323('0xa')][_0x9323('0xb')]({'raw':_0x20087b[_0x9323('0xc')]?_0x20087b[_0x9323('0xc')][_0x9323('0xd')]===undefined?!![]:![]:!![],'where':_0x20087b['options']?_0x20087b[_0x9323('0xc')][_0x9323('0xe')]||null:null,'attributes':_0x20087b[_0x9323('0xc')]?_0x20087b[_0x9323('0xc')][_0x9323('0xf')]||null:null,'limit':_0x20087b[_0x9323('0xc')]?_0x20087b[_0x9323('0xc')][_0x9323('0x10')]||null:null,'include':_0x20087b['options']?_0x20087b[_0x9323('0xc')]['include']?_[_0x9323('0x11')](_0x20087b[_0x9323('0xc')][_0x9323('0x12')],function(_0x349774){return{'model':db[_0x349774[_0x9323('0x13')]],'as':_0x349774['as'],'attributes':_0x349774['attributes'],'include':_0x349774[_0x9323('0x12')]?_['map'](_0x349774['include'],function(_0x31c0fb){return{'model':db[_0x31c0fb[_0x9323('0x13')]],'as':_0x31c0fb['as'],'attributes':_0x31c0fb[_0x9323('0xf')],'include':_0x31c0fb[_0x9323('0x12')]?_[_0x9323('0x11')](_0x31c0fb['include'],function(_0x346018){return{'model':db[_0x346018[_0x9323('0x13')]],'as':_0x346018['as'],'attributes':_0x346018[_0x9323('0xf')]};}):[]};}):[]};}):[]:[]})[_0x9323('0x14')](function(_0x3f2dea){logger[_0x9323('0x15')]('GetSquareProjects',_0x20087b);logger[_0x9323('0x16')](_0x9323('0x9'),_0x20087b,JSON[_0x9323('0x17')](_0x3f2dea));_0x270d1d(_0x3f2dea);})['catch'](function(_0x37d10d){logger[_0x9323('0x18')]('GetSquareProjects',_0x37d10d[_0x9323('0x19')],_0x20087b);_0x3f61db(_0x50c5f3['error'](0x1f4,_0x37d10d[_0x9323('0x19')]));});});};exports[_0x9323('0x1a')]=function(_0x2b7000){var _0x3a37e0=this;return new Promise(function(_0x54b8af,_0x2594c1){return db[_0x9323('0xa')]['find']({'raw':_0x2b7000[_0x9323('0xc')]?_0x2b7000[_0x9323('0xc')][_0x9323('0xd')]===undefined?!![]:![]:!![],'where':_0x2b7000['options']?_0x2b7000[_0x9323('0xc')][_0x9323('0xe')]||null:null,'attributes':_0x2b7000[_0x9323('0xc')]?_0x2b7000[_0x9323('0xc')][_0x9323('0xf')]||null:null,'include':_0x2b7000[_0x9323('0xc')]?_0x2b7000[_0x9323('0xc')][_0x9323('0x12')]?_[_0x9323('0x11')](_0x2b7000[_0x9323('0xc')][_0x9323('0x12')],function(_0x5a0d48){return{'model':db[_0x5a0d48[_0x9323('0x13')]],'as':_0x5a0d48['as'],'attributes':_0x5a0d48[_0x9323('0xf')],'include':_0x5a0d48[_0x9323('0x12')]?_['map'](_0x5a0d48[_0x9323('0x12')],function(_0x5a49b1){return{'model':db[_0x5a49b1['model']],'as':_0x5a49b1['as'],'attributes':_0x5a49b1['attributes'],'include':_0x5a49b1[_0x9323('0x12')]?_[_0x9323('0x11')](_0x5a49b1[_0x9323('0x12')],function(_0x4ef7cc){return{'model':db[_0x4ef7cc[_0x9323('0x13')]],'as':_0x4ef7cc['as'],'attributes':_0x4ef7cc[_0x9323('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dcb80){logger['info']('ShowSquareProject',_0x2b7000);logger[_0x9323('0x16')](_0x9323('0x1a'),_0x2b7000,JSON[_0x9323('0x17')](_0x1dcb80));_0x54b8af(_0x1dcb80);})[_0x9323('0x1b')](function(_0xf7c4e4){logger[_0x9323('0x18')](_0x9323('0x1a'),_0xf7c4e4['message'],_0x2b7000);_0x2594c1(_0x3a37e0[_0x9323('0x18')](0x1f4,_0xf7c4e4[_0x9323('0x19')]));});});}; \ No newline at end of file +var _0x7a34=['lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','catch','error','message','find','ShowSquareProject','stringify'];(function(_0x9e525d,_0x4254e4){var _0x4fdff7=function(_0x2bd283){while(--_0x2bd283){_0x9e525d['push'](_0x9e525d['shift']());}};_0x4fdff7(++_0x4254e4);}(_0x7a34,0x1f0));var _0x47a3=function(_0x206bde,_0x2bc75f){_0x206bde=_0x206bde-0x0;var _0x368007=_0x7a34[_0x206bde];return _0x368007;};'use strict';var _=require(_0x47a3('0x0'));var Redis=require(_0x47a3('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x47a3('0x2'))(_0x47a3('0x3'));var config=require(_0x47a3('0x4'));config[_0x47a3('0x5')]=_[_0x47a3('0x6')](config[_0x47a3('0x5')],{'host':_0x47a3('0x7'),'port':0x18eb});var socket=require(_0x47a3('0x8'))(new Redis(config[_0x47a3('0x5')]));require(_0x47a3('0x9'))[_0x47a3('0xa')](socket);exports[_0x47a3('0xb')]=function(_0x5beb66){var _0x4c6050=this;return new Promise(function(_0x3b7f2b,_0xddedb6){return db[_0x47a3('0xc')][_0x47a3('0xd')]({'raw':_0x5beb66[_0x47a3('0xe')]?_0x5beb66[_0x47a3('0xe')][_0x47a3('0xf')]===undefined?!![]:![]:!![],'where':_0x5beb66[_0x47a3('0xe')]?_0x5beb66[_0x47a3('0xe')][_0x47a3('0x10')]||null:null,'attributes':_0x5beb66[_0x47a3('0xe')]?_0x5beb66[_0x47a3('0xe')][_0x47a3('0x11')]||null:null,'limit':_0x5beb66[_0x47a3('0xe')]?_0x5beb66[_0x47a3('0xe')][_0x47a3('0x12')]||null:null,'include':_0x5beb66[_0x47a3('0xe')]?_0x5beb66[_0x47a3('0xe')]['include']?_[_0x47a3('0x13')](_0x5beb66[_0x47a3('0xe')][_0x47a3('0x14')],function(_0x2925e8){return{'model':db[_0x2925e8[_0x47a3('0x15')]],'as':_0x2925e8['as'],'attributes':_0x2925e8['attributes'],'include':_0x2925e8['include']?_[_0x47a3('0x13')](_0x2925e8[_0x47a3('0x14')],function(_0x50efb1){return{'model':db[_0x50efb1[_0x47a3('0x15')]],'as':_0x50efb1['as'],'attributes':_0x50efb1[_0x47a3('0x11')],'include':_0x50efb1['include']?_[_0x47a3('0x13')](_0x50efb1[_0x47a3('0x14')],function(_0x15afab){return{'model':db[_0x15afab[_0x47a3('0x15')]],'as':_0x15afab['as'],'attributes':_0x15afab[_0x47a3('0x11')]};}):[]};}):[]};}):[]:[]})[_0x47a3('0x16')](function(_0x2a73c3){logger[_0x47a3('0x17')]('GetSquareProjects',_0x5beb66);logger[_0x47a3('0x18')](_0x47a3('0xb'),_0x5beb66,JSON['stringify'](_0x2a73c3));_0x3b7f2b(_0x2a73c3);})[_0x47a3('0x19')](function(_0x2e876b){logger[_0x47a3('0x1a')](_0x47a3('0xb'),_0x2e876b['message'],_0x5beb66);_0xddedb6(_0x4c6050['error'](0x1f4,_0x2e876b[_0x47a3('0x1b')]));});});};exports['ShowSquareProject']=function(_0x26d4fb){var _0x4b4f59=this;return new Promise(function(_0x4c5edf,_0x1bffe7){return db[_0x47a3('0xc')][_0x47a3('0x1c')]({'raw':_0x26d4fb[_0x47a3('0xe')]?_0x26d4fb['options'][_0x47a3('0xf')]===undefined?!![]:![]:!![],'where':_0x26d4fb['options']?_0x26d4fb[_0x47a3('0xe')][_0x47a3('0x10')]||null:null,'attributes':_0x26d4fb[_0x47a3('0xe')]?_0x26d4fb['options']['attributes']||null:null,'include':_0x26d4fb[_0x47a3('0xe')]?_0x26d4fb[_0x47a3('0xe')][_0x47a3('0x14')]?_['map'](_0x26d4fb['options']['include'],function(_0x406aef){return{'model':db[_0x406aef[_0x47a3('0x15')]],'as':_0x406aef['as'],'attributes':_0x406aef['attributes'],'include':_0x406aef['include']?_[_0x47a3('0x13')](_0x406aef[_0x47a3('0x14')],function(_0x36077c){return{'model':db[_0x36077c[_0x47a3('0x15')]],'as':_0x36077c['as'],'attributes':_0x36077c['attributes'],'include':_0x36077c[_0x47a3('0x14')]?_[_0x47a3('0x13')](_0x36077c['include'],function(_0x242337){return{'model':db[_0x242337[_0x47a3('0x15')]],'as':_0x242337['as'],'attributes':_0x242337[_0x47a3('0x11')]};}):[]};}):[]};}):[]:[]})[_0x47a3('0x16')](function(_0x368b12){logger[_0x47a3('0x17')](_0x47a3('0x1d'),_0x26d4fb);logger[_0x47a3('0x18')](_0x47a3('0x1d'),_0x26d4fb,JSON[_0x47a3('0x1e')](_0x368b12));_0x4c5edf(_0x368b12);})[_0x47a3('0x19')](function(_0x26dbe2){logger['error'](_0x47a3('0x1d'),_0x26dbe2[_0x47a3('0x1b')],_0x26d4fb);_0x1bffe7(_0x4b4f59[_0x47a3('0x1a')](0x1f4,_0x26dbe2[_0x47a3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f8dacdb..766ba5a 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 _0xf77f=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x290e55,_0x16e72c){var _0x682dba=function(_0x125c17){while(--_0x125c17){_0x290e55['push'](_0x290e55['shift']());}};_0x682dba(++_0x16e72c);}(_0xf77f,0x1d0));var _0xff77=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xf77f[_0x152121];return _0x592a85;};'use strict';var SquareProjectEvents=require(_0xff77('0x0'));var events=[_0xff77('0x1'),_0xff77('0x2'),_0xff77('0x3')];function createListener(_0x3d57dd,_0x47c9e0){return function(_0x328b49){_0x47c9e0[_0xff77('0x4')](_0x3d57dd,_0x328b49);};}function removeListener(_0x239355,_0x3644e8){return function(){SquareProjectEvents[_0xff77('0x5')](_0x239355,_0x3644e8);};}exports[_0xff77('0x6')]=function(_0x5948f2){for(var _0x4000bb=0x0,_0xad924=events[_0xff77('0x7')];_0x4000bb<_0xad924;_0x4000bb++){var _0xc53c0f=events[_0x4000bb];var _0x4077da=createListener(_0xff77('0x8')+_0xc53c0f,_0x5948f2);SquareProjectEvents['on'](_0xc53c0f,_0x4077da);}}; \ No newline at end of file +var _0xf1a4=['length','squareProject:','./squareProject.events','save','remove','register'];(function(_0x8fff14,_0x336c04){var _0xaaaeac=function(_0x30ab1e){while(--_0x30ab1e){_0x8fff14['push'](_0x8fff14['shift']());}};_0xaaaeac(++_0x336c04);}(_0xf1a4,0x6e));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x4f1a('0x0'));var events=[_0x4f1a('0x1'),_0x4f1a('0x2'),'update'];function createListener(_0x1303bf,_0x341904){return function(_0x511769){_0x341904['emit'](_0x1303bf,_0x511769);};}function removeListener(_0x24dc67,_0x130578){return function(){SquareProjectEvents['removeListener'](_0x24dc67,_0x130578);};}exports[_0x4f1a('0x3')]=function(_0x4a9724){for(var _0x4091c0=0x0,_0x5841fd=events[_0x4f1a('0x4')];_0x4091c0<_0x5841fd;_0x4091c0++){var _0xbe04ba=events[_0x4091c0];var _0x1083d4=createListener(_0x4f1a('0x5')+_0xbe04ba,_0x4a9724);SquareProjectEvents['on'](_0xbe04ba,_0x1083d4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index acd5f95..f33fea1 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x2a9efd,_0x46b3a6){var _0x551323=function(_0x35e206){while(--_0x35e206){_0x2a9efd['push'](_0x2a9efd['shift']());}};_0x551323(++_0x46b3a6);}(_0x1261,0x144));var _0x1126=function(_0x5bf992,_0x533b26){_0x5bf992=_0x5bf992-0x0;var _0x288176=_0x1261[_0x5bf992];return _0x288176;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x511ec7,_0x5d2ef5){var _0x59536d=function(_0x2fccb9){while(--_0x2fccb9){_0x511ec7['push'](_0x511ec7['shift']());}};_0x59536d(++_0x5d2ef5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0x7fbe[_0x2b0690];return _0x82be1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 67b151c..db67367 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 _0x46ed=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x3aedc3,_0x5aa449){var _0x48400e=function(_0x184f0d){while(--_0x184f0d){_0x3aedc3['push'](_0x3aedc3['shift']());}};_0x48400e(++_0x5aa449);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd46e('0x2')]},'saveName':{'type':Sequelize[_0xd46e('0x2')]},'filename':{'type':Sequelize[_0xd46e('0x2')]},'savePath':{'type':Sequelize[_0xd46e('0x2')]},'format':{'type':Sequelize[_0xd46e('0x3')],'get':function(){var _0x855f24='';var _0x437ea0=this[_0xd46e('0x4')](_0xd46e('0x5'));if(_0x437ea0){_0x855f24=_0x437ea0[_0xd46e('0x6')](_0x437ea0[_0xd46e('0x7')]('.'));}return _0x855f24;}}}; \ No newline at end of file +var _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x3dfa0e,_0x3c6144){var _0x505fa0=function(_0x287ca1){while(--_0x287ca1){_0x3dfa0e['push'](_0x3dfa0e['shift']());}};_0x505fa0(++_0x3c6144);}(_0xa41a,0x6b));var _0xaa41=function(_0x359cc0,_0x48cf69){_0x359cc0=_0x359cc0-0x0;var _0x1f9ad9=_0xa41a[_0x359cc0];return _0x1f9ad9;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 20ad922..f5e191c 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 _0x4ad5=['extname','unlink','message','send','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','end','stack','index','map','SquareRecording','rawAttributes','fieldName','type','key','name','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','model','length','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download'];(function(_0x275ae6,_0x51d1cb){var _0x4e6bd3=function(_0x507fea){while(--_0x507fea){_0x275ae6['push'](_0x275ae6['shift']());}};_0x4e6bd3(++_0x51d1cb);}(_0x4ad5,0x6c));var _0x54ad=function(_0x5ddc18,_0x4762b8){_0x5ddc18=_0x5ddc18-0x0;var _0x3fbecc=_0x4ad5[_0x5ddc18];return _0x3fbecc;};'use strict';var emlformat=require(_0x54ad('0x0'));var rimraf=require(_0x54ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54ad('0x2'));var rp=require('request-promise');var moment=require(_0x54ad('0x3'));var BPromise=require(_0x54ad('0x4'));var Mustache=require(_0x54ad('0x5'));var util=require(_0x54ad('0x6'));var path=require('path');var sox=require(_0x54ad('0x7'));var csv=require('to-csv');var ejs=require(_0x54ad('0x8'));var fs=require('fs');var fs_extra=require(_0x54ad('0x9'));var _=require(_0x54ad('0xa'));var squel=require('squel');var crypto=require(_0x54ad('0xb'));var jsforce=require(_0x54ad('0xc'));var deskjs=require(_0x54ad('0xd'));var toCsv=require(_0x54ad('0xe'));var querystring=require(_0x54ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x54ad('0x10'));var authService=require(_0x54ad('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x54ad('0x12'));var hardwareService=require(_0x54ad('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x54ad('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f083e,_0x285851){_0x285851=_0x285851||0xcc;return function(_0x6b12d1){if(_0x6b12d1){return _0x5f083e[_0x54ad('0x15')](_0x285851);}return _0x5f083e[_0x54ad('0x16')](_0x285851)['end']();};}function respondWithResult(_0x59a570,_0xa6f8ab){_0xa6f8ab=_0xa6f8ab||0xc8;return function(_0x5c7123){if(_0x5c7123){return _0x59a570[_0x54ad('0x16')](_0xa6f8ab)[_0x54ad('0x17')](_0x5c7123);}};}function respondWithFilteredResult(_0x32b25e,_0x3f7454){return function(_0x56c1ca){if(_0x56c1ca){var _0x1fe57e=typeof _0x3f7454[_0x54ad('0x18')]==='undefined'&&typeof _0x3f7454[_0x54ad('0x19')]===_0x54ad('0x1a');var _0x519d48=_0x56c1ca['count'];var _0x2eb18c=_0x1fe57e?0x0:_0x3f7454[_0x54ad('0x18')];var _0x6bf863=_0x1fe57e?_0x56c1ca['count']:_0x3f7454[_0x54ad('0x18')]+_0x3f7454['limit'];var _0x1034f7;if(_0x6bf863>=_0x519d48){_0x6bf863=_0x519d48;_0x1034f7=0xc8;}else{_0x1034f7=0xce;}_0x32b25e[_0x54ad('0x16')](_0x1034f7);return _0x32b25e[_0x54ad('0x1b')](_0x54ad('0x1c'),_0x2eb18c+'-'+_0x6bf863+'/'+_0x519d48)['json'](_0x56c1ca);}return null;};}function patchUpdates(_0x3b108e){return function(_0x3d7303){try{jsonpatch[_0x54ad('0x1d')](_0x3d7303,_0x3b108e,!![]);}catch(_0x95dff1){return BPromise[_0x54ad('0x1e')](_0x95dff1);}return _0x3d7303['save']();};}function saveUpdates(_0xa5d4d6,_0x5237ee){return function(_0x10ca36){if(_0x10ca36){return _0x10ca36[_0x54ad('0x1f')](_0xa5d4d6)[_0x54ad('0x20')](function(_0x184677){return _0x184677;});}return null;};}function removeEntity(_0x2f899a,_0x47599e){return function(_0x1d443b){if(_0x1d443b){return _0x1d443b[_0x54ad('0x21')]()[_0x54ad('0x20')](function(){_0x2f899a['status'](0xcc)[_0x54ad('0x22')]();});}};}function handleEntityNotFound(_0x49b7fa,_0x5d746c){return function(_0x1fcbb1){if(!_0x1fcbb1){_0x49b7fa['sendStatus'](0x194);}return _0x1fcbb1;};}function handleError(_0x3e1398,_0x4f15c3){_0x4f15c3=_0x4f15c3||0x1f4;return function(_0x5ae427){logger['error'](_0x5ae427[_0x54ad('0x23')]);if(_0x5ae427['name']){delete _0x5ae427['name'];}_0x3e1398['status'](_0x4f15c3)['send'](_0x5ae427);};}exports[_0x54ad('0x24')]=function(_0x2696e1,_0x231037){var _0x232afe={},_0x5c8eed={},_0x2eff70={'count':0x0,'rows':[]};var _0x311c7e=_[_0x54ad('0x25')](db[_0x54ad('0x26')][_0x54ad('0x27')],function(_0x125b33){return{'name':_0x125b33[_0x54ad('0x28')],'type':_0x125b33[_0x54ad('0x29')][_0x54ad('0x2a')]};});_0x5c8eed['model']=_[_0x54ad('0x25')](_0x311c7e,_0x54ad('0x2b'));_0x5c8eed[_0x54ad('0x2c')]=_[_0x54ad('0x2d')](_0x2696e1[_0x54ad('0x2c')]);_0x5c8eed['filters']=_['intersection'](_0x5c8eed['model'],_0x5c8eed[_0x54ad('0x2c')]);_0x232afe[_0x54ad('0x2e')]=_[_0x54ad('0x2f')](_0x5c8eed['model'],qs[_0x54ad('0x30')](_0x2696e1[_0x54ad('0x2c')][_0x54ad('0x30')]));_0x232afe[_0x54ad('0x2e')]=_0x232afe[_0x54ad('0x2e')]['length']?_0x232afe[_0x54ad('0x2e')]:_0x5c8eed['model'];if(!_0x2696e1['query'][_0x54ad('0x31')](_0x54ad('0x32'))){_0x232afe[_0x54ad('0x19')]=qs[_0x54ad('0x19')](_0x2696e1[_0x54ad('0x2c')]['limit']);_0x232afe[_0x54ad('0x18')]=qs[_0x54ad('0x18')](_0x2696e1[_0x54ad('0x2c')]['offset']);}_0x232afe[_0x54ad('0x33')]=qs['sort'](_0x2696e1[_0x54ad('0x2c')][_0x54ad('0x34')]);_0x232afe[_0x54ad('0x35')]=qs['filters'](_[_0x54ad('0x36')](_0x2696e1[_0x54ad('0x2c')],_0x5c8eed[_0x54ad('0x37')]),_0x311c7e);if(_0x2696e1['query']['filter']){_0x232afe[_0x54ad('0x35')]=_[_0x54ad('0x38')](_0x232afe[_0x54ad('0x35')],{'$or':_[_0x54ad('0x25')](_0x311c7e,function(_0x3e2036){if(_0x3e2036[_0x54ad('0x29')]!==_0x54ad('0x39')){var _0x983fc5={};_0x983fc5[_0x3e2036[_0x54ad('0x2b')]]={'$like':'%'+_0x2696e1['query'][_0x54ad('0x3a')]+'%'};return _0x983fc5;}})});}_0x232afe=_[_0x54ad('0x38')]({},_0x232afe,_0x2696e1[_0x54ad('0x3b')]);var _0x4bda4f={'where':_0x232afe[_0x54ad('0x35')]};return db[_0x54ad('0x26')][_0x54ad('0x3c')](_0x4bda4f)['then'](function(_0x47b0f1){_0x2eff70['count']=_0x47b0f1;if(_0x2696e1['query'][_0x54ad('0x3d')]){_0x232afe[_0x54ad('0x3e')]=[{'all':!![]}];}return db[_0x54ad('0x26')][_0x54ad('0x3f')](_0x232afe);})[_0x54ad('0x20')](function(_0x32c289){_0x2eff70[_0x54ad('0x40')]=_0x32c289;return _0x2eff70;})[_0x54ad('0x20')](respondWithFilteredResult(_0x231037,_0x232afe))[_0x54ad('0x41')](handleError(_0x231037,null));};exports['show']=function(_0x2800dc,_0x5509d4){var _0x12ac86={'raw':!![],'where':{'id':_0x2800dc[_0x54ad('0x42')]['id']}},_0x20259b={};_0x20259b[_0x54ad('0x43')]=_[_0x54ad('0x2d')](db['SquareRecording'][_0x54ad('0x27')]);_0x20259b[_0x54ad('0x2c')]=_['keys'](_0x2800dc[_0x54ad('0x2c')]);_0x20259b[_0x54ad('0x37')]=_[_0x54ad('0x2f')](_0x20259b[_0x54ad('0x43')],_0x20259b['query']);_0x12ac86[_0x54ad('0x2e')]=_[_0x54ad('0x2f')](_0x20259b[_0x54ad('0x43')],qs[_0x54ad('0x30')](_0x2800dc[_0x54ad('0x2c')][_0x54ad('0x30')]));_0x12ac86[_0x54ad('0x2e')]=_0x12ac86[_0x54ad('0x2e')][_0x54ad('0x44')]?_0x12ac86['attributes']:_0x20259b[_0x54ad('0x43')];if(_0x2800dc[_0x54ad('0x2c')][_0x54ad('0x3d')]){_0x12ac86[_0x54ad('0x3e')]=[{'all':!![]}];}_0x12ac86=_['merge']({},_0x12ac86,_0x2800dc[_0x54ad('0x3b')]);return db[_0x54ad('0x26')][_0x54ad('0x45')](_0x12ac86)['then'](handleEntityNotFound(_0x5509d4,null))[_0x54ad('0x20')](respondWithResult(_0x5509d4,null))[_0x54ad('0x41')](handleError(_0x5509d4,null));};exports[_0x54ad('0x46')]=function(_0x1603b8,_0x2fe0c4){return db[_0x54ad('0x26')]['create'](_0x1603b8[_0x54ad('0x47')],{})[_0x54ad('0x20')](respondWithResult(_0x2fe0c4,0xc9))['catch'](handleError(_0x2fe0c4,null));};exports['update']=function(_0x5d6096,_0xfe6a97){if(_0x5d6096[_0x54ad('0x47')]['id']){delete _0x5d6096[_0x54ad('0x47')]['id'];}return db['SquareRecording'][_0x54ad('0x45')]({'where':{'id':_0x5d6096['params']['id']}})[_0x54ad('0x20')](handleEntityNotFound(_0xfe6a97,null))['then'](saveUpdates(_0x5d6096[_0x54ad('0x47')],null))[_0x54ad('0x20')](respondWithResult(_0xfe6a97,null))[_0x54ad('0x41')](handleError(_0xfe6a97,null));};exports['download']=function(_0x3cc964,_0x1208b0,_0x347054){var _0x3e37af=require(_0x54ad('0x48'));var _0x35cf57=![];var _0x12a953={};if(_0x3cc964['query'][_0x54ad('0x29')]&&_0x3cc964[_0x54ad('0x2c')][_0x54ad('0x29')]===_0x54ad('0x49')){_0x12a953[_0x54ad('0x49')]=_0x3cc964[_0x54ad('0x42')]['id'];}else{_0x12a953['id']=_0x3cc964[_0x54ad('0x42')]['id'];}return db[_0x54ad('0x26')][_0x54ad('0x45')]({'where':_0x12a953,'attributes':['id',_0x54ad('0x4a'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x1208b0,null))[_0x54ad('0x20')](function(_0x4fd535){if(_0x4fd535){var _0x1d74a5=_0x4fd535[_0x54ad('0x4a')];var _0x2224ec=util[_0x54ad('0x4b')](_0x54ad('0x4c'),_0x1d74a5);if(fs[_0x54ad('0x4d')](_0x2224ec)){_0x35cf57=!![];return _0x3e37af['decryptFile'](_0x2224ec,_0x1d74a5,config[_0x54ad('0x4e')]['recording'])[_0x54ad('0x20')](function(){return _0x4fd535;});}return _0x4fd535;}})[_0x54ad('0x20')](function(_0x50636e){if(_0x50636e){var _0x1c4972=_0x50636e[_0x54ad('0x4a')];if(!fs[_0x54ad('0x4d')](_0x1c4972)){throw new db[(_0x54ad('0x4f'))][(_0x54ad('0x50'))](_0x54ad('0x51'));}if(_0x50636e[_0x54ad('0x52')]){return _0x1208b0[_0x54ad('0x53')](_0x1c4972,_0x50636e[_0x54ad('0x52')]+path[_0x54ad('0x54')](_0x1c4972),function(){if(_0x35cf57){fs['unlink'](_0x1c4972);}});}else{return _0x1208b0[_0x54ad('0x53')](_0x1c4972,function(_0x27667b){if(_0x35cf57){fs[_0x54ad('0x55')](_0x1c4972);}});}}})['catch'](function(_0x43c5ae){if(_0x43c5ae[_0x54ad('0x56')]===_0x54ad('0x51')){_0x1208b0[_0x54ad('0x16')](0x194)[_0x54ad('0x57')]('Not\x20found');}else{return handleError(_0x1208b0,null);}});};exports['destroy']=function(_0x78234c,_0x8c9ecb){return db[_0x54ad('0x26')][_0x54ad('0x45')]({'where':{'id':_0x78234c[_0x54ad('0x42')]['id']}})['then'](function(_0x48958b){if(_[_0x54ad('0x58')](_0x48958b)){throw new ReferenceError(_0x54ad('0x59'));}return _0x48958b;})[_0x54ad('0x20')](function(_0x348b8b){var _0x48ec9a=_0x348b8b['savePath'];logger[_0x54ad('0x5a')](_0x54ad('0x5b'),_0x48ec9a);if(!_['isNil'](_0x348b8b[_0x54ad('0x4a')])&&fs['existsSync'](_0x48ec9a)){logger[_0x54ad('0x5a')]('File:\x20\x22'+_0x48ec9a+_0x54ad('0x5c'));fs[_0x54ad('0x5d')](_0x48ec9a);}_0x48ec9a=_0x48ec9a+_0x54ad('0x5e');if(!_[_0x54ad('0x58')](_0x348b8b['savePath'])&&fs['existsSync'](_0x48ec9a)){logger['info'](_0x54ad('0x5f')+_0x48ec9a+_0x54ad('0x5c'));fs[_0x54ad('0x5d')](_0x48ec9a);}return _0x348b8b;})['then'](function(_0x5e8033){if(!_0x5e8033)throw new InternalError();return _0x5e8033[_0x54ad('0x21')]();})['then'](function(){_0x8c9ecb[_0x54ad('0x16')](0xcc)[_0x54ad('0x22')]();})[_0x54ad('0x41')](handleError(_0x8c9ecb,null));}; \ No newline at end of file +var _0xce71=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','isNil','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','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'];(function(_0x427e61,_0x4ff8fc){var _0x584cfd=function(_0x46008b){while(--_0x46008b){_0x427e61['push'](_0x427e61['shift']());}};_0x584cfd(++_0x4ff8fc);}(_0xce71,0x171));var _0x1ce7=function(_0x3c82c9,_0xa929d7){_0x3c82c9=_0x3c82c9-0x0;var _0x114c17=_0xce71[_0x3c82c9];return _0x114c17;};'use strict';var emlformat=require(_0x1ce7('0x0'));var rimraf=require(_0x1ce7('0x1'));var zipdir=require(_0x1ce7('0x2'));var jsonpatch=require(_0x1ce7('0x3'));var rp=require(_0x1ce7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ce7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1ce7('0x6'));var ejs=require(_0x1ce7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ce7('0x8'));var squel=require(_0x1ce7('0x9'));var crypto=require(_0x1ce7('0xa'));var jsforce=require(_0x1ce7('0xb'));var deskjs=require(_0x1ce7('0xc'));var toCsv=require(_0x1ce7('0x6'));var querystring=require(_0x1ce7('0xd'));var Papa=require(_0x1ce7('0xe'));var Redis=require(_0x1ce7('0xf'));var authService=require(_0x1ce7('0x10'));var qs=require(_0x1ce7('0x11'));var as=require(_0x1ce7('0x12'));var hardwareService=require(_0x1ce7('0x13'));var logger=require('../../config/logger')(_0x1ce7('0x14'));var utils=require(_0x1ce7('0x15'));var config=require(_0x1ce7('0x16'));var licenseUtil=require(_0x1ce7('0x17'));var db=require(_0x1ce7('0x18'))['db'];function respondWithStatusCode(_0x351698,_0x362013){_0x362013=_0x362013||0xcc;return function(_0x46a568){if(_0x46a568){return _0x351698[_0x1ce7('0x19')](_0x362013);}return _0x351698['status'](_0x362013)['end']();};}function respondWithResult(_0x2e8169,_0x3ce803){_0x3ce803=_0x3ce803||0xc8;return function(_0x161d60){if(_0x161d60){return _0x2e8169[_0x1ce7('0x1a')](_0x3ce803)[_0x1ce7('0x1b')](_0x161d60);}};}function respondWithFilteredResult(_0x41cc83,_0x12a7f7){return function(_0x9239a8){if(_0x9239a8){var _0x48201c=typeof _0x12a7f7[_0x1ce7('0x1c')]===_0x1ce7('0x1d')&&typeof _0x12a7f7[_0x1ce7('0x1e')]==='undefined';var _0x4f15d3=_0x9239a8[_0x1ce7('0x1f')];var _0x5032f7=_0x48201c?0x0:_0x12a7f7[_0x1ce7('0x1c')];var _0x49fffe=_0x48201c?_0x9239a8['count']:_0x12a7f7[_0x1ce7('0x1c')]+_0x12a7f7[_0x1ce7('0x1e')];var _0x41d3eb;if(_0x49fffe>=_0x4f15d3){_0x49fffe=_0x4f15d3;_0x41d3eb=0xc8;}else{_0x41d3eb=0xce;}_0x41cc83[_0x1ce7('0x1a')](_0x41d3eb);return _0x41cc83[_0x1ce7('0x20')](_0x1ce7('0x21'),_0x5032f7+'-'+_0x49fffe+'/'+_0x4f15d3)['json'](_0x9239a8);}return null;};}function patchUpdates(_0x2603af){return function(_0x26fd1d){try{jsonpatch[_0x1ce7('0x22')](_0x26fd1d,_0x2603af,!![]);}catch(_0x42a7e6){return BPromise[_0x1ce7('0x23')](_0x42a7e6);}return _0x26fd1d[_0x1ce7('0x24')]();};}function saveUpdates(_0x40653e,_0x3eb554){return function(_0x44339b){if(_0x44339b){return _0x44339b[_0x1ce7('0x25')](_0x40653e)['then'](function(_0x5058dc){return _0x5058dc;});}return null;};}function removeEntity(_0x492eec,_0x61b458){return function(_0x57bd07){if(_0x57bd07){return _0x57bd07['destroy']()[_0x1ce7('0x26')](function(){_0x492eec[_0x1ce7('0x1a')](0xcc)[_0x1ce7('0x27')]();});}};}function handleEntityNotFound(_0x309968,_0x45276d){return function(_0x519240){if(!_0x519240){_0x309968[_0x1ce7('0x19')](0x194);}return _0x519240;};}function handleError(_0x2608ec,_0x1ed511){_0x1ed511=_0x1ed511||0x1f4;return function(_0x562136){logger[_0x1ce7('0x28')](_0x562136[_0x1ce7('0x29')]);if(_0x562136['name']){delete _0x562136[_0x1ce7('0x2a')];}_0x2608ec[_0x1ce7('0x1a')](_0x1ed511)['send'](_0x562136);};}exports[_0x1ce7('0x2b')]=function(_0x2474ea,_0x21c360){var _0x456ff0={},_0x418cb4={},_0x4172ab={'count':0x0,'rows':[]};var _0x4992e2=_[_0x1ce7('0x2c')](db[_0x1ce7('0x2d')][_0x1ce7('0x2e')],function(_0x47c41d){return{'name':_0x47c41d[_0x1ce7('0x2f')],'type':_0x47c41d[_0x1ce7('0x30')][_0x1ce7('0x31')]};});_0x418cb4[_0x1ce7('0x32')]=_[_0x1ce7('0x2c')](_0x4992e2,'name');_0x418cb4['query']=_[_0x1ce7('0x33')](_0x2474ea[_0x1ce7('0x34')]);_0x418cb4[_0x1ce7('0x35')]=_[_0x1ce7('0x36')](_0x418cb4[_0x1ce7('0x32')],_0x418cb4['query']);_0x456ff0[_0x1ce7('0x37')]=_[_0x1ce7('0x36')](_0x418cb4[_0x1ce7('0x32')],qs['fields'](_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x38')]));_0x456ff0[_0x1ce7('0x37')]=_0x456ff0[_0x1ce7('0x37')][_0x1ce7('0x39')]?_0x456ff0['attributes']:_0x418cb4[_0x1ce7('0x32')];if(!_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x3a')](_0x1ce7('0x3b'))){_0x456ff0[_0x1ce7('0x1e')]=qs[_0x1ce7('0x1e')](_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x1e')]);_0x456ff0[_0x1ce7('0x1c')]=qs[_0x1ce7('0x1c')](_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x1c')]);}_0x456ff0[_0x1ce7('0x3c')]=qs[_0x1ce7('0x3d')](_0x2474ea['query']['sort']);_0x456ff0[_0x1ce7('0x3e')]=qs[_0x1ce7('0x35')](_[_0x1ce7('0x3f')](_0x2474ea['query'],_0x418cb4[_0x1ce7('0x35')]),_0x4992e2);if(_0x2474ea[_0x1ce7('0x34')]['filter']){_0x456ff0[_0x1ce7('0x3e')]=_[_0x1ce7('0x40')](_0x456ff0['where'],{'$or':_[_0x1ce7('0x2c')](_0x4992e2,function(_0x2bf06e){if(_0x2bf06e[_0x1ce7('0x30')]!==_0x1ce7('0x41')){var _0xd4df8d={};_0xd4df8d[_0x2bf06e['name']]={'$like':'%'+_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x42')]+'%'};return _0xd4df8d;}})});}_0x456ff0=_['merge']({},_0x456ff0,_0x2474ea[_0x1ce7('0x43')]);var _0x5ac6dc={'where':_0x456ff0[_0x1ce7('0x3e')]};return db[_0x1ce7('0x2d')]['count'](_0x5ac6dc)['then'](function(_0x166fbf){_0x4172ab[_0x1ce7('0x1f')]=_0x166fbf;if(_0x2474ea[_0x1ce7('0x34')][_0x1ce7('0x44')]){_0x456ff0[_0x1ce7('0x45')]=[{'all':!![]}];}return db[_0x1ce7('0x2d')][_0x1ce7('0x46')](_0x456ff0);})['then'](function(_0x199dc6){_0x4172ab[_0x1ce7('0x47')]=_0x199dc6;return _0x4172ab;})[_0x1ce7('0x26')](respondWithFilteredResult(_0x21c360,_0x456ff0))[_0x1ce7('0x48')](handleError(_0x21c360,null));};exports[_0x1ce7('0x49')]=function(_0x4a8e91,_0x1ddd77){var _0x5c03cf={'raw':!![],'where':{'id':_0x4a8e91[_0x1ce7('0x4a')]['id']}},_0x39b3c4={};_0x39b3c4['model']=_['keys'](db['SquareRecording'][_0x1ce7('0x2e')]);_0x39b3c4[_0x1ce7('0x34')]=_[_0x1ce7('0x33')](_0x4a8e91[_0x1ce7('0x34')]);_0x39b3c4[_0x1ce7('0x35')]=_['intersection'](_0x39b3c4[_0x1ce7('0x32')],_0x39b3c4['query']);_0x5c03cf[_0x1ce7('0x37')]=_[_0x1ce7('0x36')](_0x39b3c4[_0x1ce7('0x32')],qs[_0x1ce7('0x38')](_0x4a8e91[_0x1ce7('0x34')][_0x1ce7('0x38')]));_0x5c03cf[_0x1ce7('0x37')]=_0x5c03cf[_0x1ce7('0x37')][_0x1ce7('0x39')]?_0x5c03cf[_0x1ce7('0x37')]:_0x39b3c4[_0x1ce7('0x32')];if(_0x4a8e91[_0x1ce7('0x34')][_0x1ce7('0x44')]){_0x5c03cf['include']=[{'all':!![]}];}_0x5c03cf=_['merge']({},_0x5c03cf,_0x4a8e91[_0x1ce7('0x43')]);return db[_0x1ce7('0x2d')][_0x1ce7('0x4b')](_0x5c03cf)[_0x1ce7('0x26')](handleEntityNotFound(_0x1ddd77,null))[_0x1ce7('0x26')](respondWithResult(_0x1ddd77,null))[_0x1ce7('0x48')](handleError(_0x1ddd77,null));};exports[_0x1ce7('0x4c')]=function(_0x4f09f7,_0x2dbcf6){return db[_0x1ce7('0x2d')][_0x1ce7('0x4c')](_0x4f09f7[_0x1ce7('0x4d')],{})[_0x1ce7('0x26')](respondWithResult(_0x2dbcf6,0xc9))['catch'](handleError(_0x2dbcf6,null));};exports['update']=function(_0x961511,_0x1f470b){if(_0x961511[_0x1ce7('0x4d')]['id']){delete _0x961511[_0x1ce7('0x4d')]['id'];}return db[_0x1ce7('0x2d')][_0x1ce7('0x4b')]({'where':{'id':_0x961511[_0x1ce7('0x4a')]['id']}})[_0x1ce7('0x26')](handleEntityNotFound(_0x1f470b,null))[_0x1ce7('0x26')](saveUpdates(_0x961511[_0x1ce7('0x4d')],null))[_0x1ce7('0x26')](respondWithResult(_0x1f470b,null))[_0x1ce7('0x48')](handleError(_0x1f470b,null));};exports[_0x1ce7('0x4e')]=function(_0x3be185,_0x204a88,_0x56bdbf){var _0x4710f7=require('../../components/encryptor');var _0x515360=![];var _0x128f17={};if(_0x3be185['query'][_0x1ce7('0x30')]&&_0x3be185[_0x1ce7('0x34')][_0x1ce7('0x30')]===_0x1ce7('0x4f')){_0x128f17[_0x1ce7('0x4f')]=_0x3be185[_0x1ce7('0x4a')]['id'];}else{_0x128f17['id']=_0x3be185[_0x1ce7('0x4a')]['id'];}return db[_0x1ce7('0x2d')][_0x1ce7('0x4b')]({'where':_0x128f17,'attributes':['id','savePath',_0x1ce7('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x204a88,null))[_0x1ce7('0x26')](function(_0x415362){if(_0x415362){var _0x5298f0=_0x415362[_0x1ce7('0x51')];var _0x340d3b=util[_0x1ce7('0x52')](_0x1ce7('0x53'),_0x5298f0);if(fs[_0x1ce7('0x54')](_0x340d3b)){_0x515360=!![];return _0x4710f7[_0x1ce7('0x55')](_0x340d3b,_0x5298f0,config[_0x1ce7('0x56')][_0x1ce7('0x57')])[_0x1ce7('0x26')](function(){return _0x415362;});}return _0x415362;}})[_0x1ce7('0x26')](function(_0x1fe41d){if(_0x1fe41d){var _0x9f9822=_0x1fe41d[_0x1ce7('0x51')];if(!fs[_0x1ce7('0x54')](_0x9f9822)){throw new db[(_0x1ce7('0x58'))]['ValidationError'](_0x1ce7('0x59'));}if(_0x1fe41d[_0x1ce7('0x50')]){return _0x204a88['download'](_0x9f9822,_0x1fe41d['filename']+path[_0x1ce7('0x5a')](_0x9f9822),function(){if(_0x515360){fs[_0x1ce7('0x5b')](_0x9f9822);}});}else{return _0x204a88[_0x1ce7('0x4e')](_0x9f9822,function(_0x4edd0e){if(_0x515360){fs['unlink'](_0x9f9822);}});}}})[_0x1ce7('0x48')](function(_0x3cd46a){if(_0x3cd46a[_0x1ce7('0x5c')]===_0x1ce7('0x59')){_0x204a88[_0x1ce7('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x204a88,null);}});};exports['destroy']=function(_0x196cde,_0x3d0af3){return db['SquareRecording']['find']({'where':{'id':_0x196cde[_0x1ce7('0x4a')]['id']}})[_0x1ce7('0x26')](function(_0x428da0){if(_[_0x1ce7('0x5d')](_0x428da0)){throw new ReferenceError('Entity\x20not\x20found');}return _0x428da0;})[_0x1ce7('0x26')](function(_0x9ad4c4){var _0x477052=_0x9ad4c4[_0x1ce7('0x51')];logger[_0x1ce7('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x477052);if(!_[_0x1ce7('0x5d')](_0x9ad4c4['savePath'])&&fs[_0x1ce7('0x54')](_0x477052)){logger[_0x1ce7('0x5e')](_0x1ce7('0x5f')+_0x477052+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x477052);}_0x477052=_0x477052+_0x1ce7('0x60');if(!_['isNil'](_0x9ad4c4[_0x1ce7('0x51')])&&fs['existsSync'](_0x477052)){logger['info'](_0x1ce7('0x5f')+_0x477052+_0x1ce7('0x61'));fs['unlinkSync'](_0x477052);}return _0x9ad4c4;})['then'](function(_0x2d09a6){if(!_0x2d09a6)throw new InternalError();return _0x2d09a6[_0x1ce7('0x62')]();})[_0x1ce7('0x26')](function(){_0x3d0af3['status'](0xcc)[_0x1ce7('0x27')]();})[_0x1ce7('0x48')](handleError(_0x3d0af3,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 6b2031d..762354a 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 _0x8969=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','define','SquareRecording','lodash','../../config/logger','api','moment'];(function(_0x3f95c4,_0xfe7a1){var _0x3425d7=function(_0x1d2703){while(--_0x1d2703){_0x3f95c4['push'](_0x3f95c4['shift']());}};_0x3425d7(++_0xfe7a1);}(_0x8969,0x130));var _0x9896=function(_0x1b2f16,_0x2ff9b1){_0x1b2f16=_0x1b2f16-0x0;var _0x3c8968=_0x8969[_0x1b2f16];return _0x3c8968;};'use strict';var _=require(_0x9896('0x0'));var util=require('util');var logger=require(_0x9896('0x1'))(_0x9896('0x2'));var moment=require(_0x9896('0x3'));var BPromise=require(_0x9896('0x4'));var rp=require(_0x9896('0x5'));var fs=require('fs');var path=require(_0x9896('0x6'));var rimraf=require(_0x9896('0x7'));var config=require('../../config/environment');var attributes=require(_0x9896('0x8'));module['exports']=function(_0x4d1a83,_0xd26a8b){return _0x4d1a83[_0x9896('0x9')](_0x9896('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4279=['moment','bluebird','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','util','../../config/logger'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0x4279,0x8d));var _0x9427=function(_0x5955a1,_0x226f12){_0x5955a1=_0x5955a1-0x0;var _0x9d8304=_0x4279[_0x5955a1];return _0x9d8304;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var logger=require(_0x9427('0x1'))('api');var moment=require(_0x9427('0x2'));var BPromise=require(_0x9427('0x3'));var rp=require(_0x9427('0x4'));var fs=require('fs');var path=require(_0x9427('0x5'));var rimraf=require('rimraf');var config=require(_0x9427('0x6'));var attributes=require('./squareRecording.attributes');module[_0x9427('0x7')]=function(_0x2a0b3e,_0x5e9d1e){return _0x2a0b3e[_0x9427('0x8')](_0x9427('0x9'),attributes,{'tableName':_0x9427('0xa'),'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 e4d70e8..c233bdb 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 _0xc6a0=['result','catch','CreateSquareRecording','SquareRecording','create','options','then','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc6a0,0x70));var _0x0c6a=function(_0x37f5fa,_0x234aea){_0x37f5fa=_0x37f5fa-0x0;var _0x40441d=_0xc6a0[_0x37f5fa];return _0x40441d;};'use strict';var _=require(_0x0c6a('0x0'));var util=require(_0x0c6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c6a('0x2'));var fs=require('fs');var Redis=require(_0x0c6a('0x3'));var db=require(_0x0c6a('0x4'))['db'];var utils=require(_0x0c6a('0x5'));var logger=require(_0x0c6a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c6a('0x7')][_0x0c6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c5c9a,_0x278872,_0x522860){return new BPromise(function(_0x24c6a0,_0x4a8e33){return client[_0x0c6a('0x9')](_0x5c5c9a,_0x522860)['then'](function(_0x33a382){logger[_0x0c6a('0xa')]('SquareRecording,\x20%s,\x20%s',_0x278872,_0x0c6a('0xb'));logger['debug'](_0x0c6a('0xc'),_0x278872,_0x0c6a('0xb'),JSON[_0x0c6a('0xd')](_0x33a382));if(_0x33a382['error']){if(_0x33a382[_0x0c6a('0xe')][_0x0c6a('0xf')]===0x1f4){logger[_0x0c6a('0xe')](_0x0c6a('0x10'),_0x278872,_0x33a382[_0x0c6a('0xe')][_0x0c6a('0x11')]);return _0x4a8e33(_0x33a382[_0x0c6a('0xe')][_0x0c6a('0x11')]);}logger[_0x0c6a('0xe')]('SquareRecording,\x20%s,\x20%s',_0x278872,_0x33a382['error'][_0x0c6a('0x11')]);return _0x24c6a0(_0x33a382['error'][_0x0c6a('0x11')]);}else{logger['info'](_0x0c6a('0x10'),_0x278872,'request\x20sent');_0x24c6a0(_0x33a382[_0x0c6a('0x12')][_0x0c6a('0x11')]);}})[_0x0c6a('0x13')](function(_0x437450){logger[_0x0c6a('0xe')](_0x0c6a('0x10'),_0x278872,_0x437450);_0x4a8e33(_0x437450);});});}exports[_0x0c6a('0x14')]=function(_0x78fd26){var _0x2a84b6=this;return new Promise(function(_0x375241,_0x2bda58){return db[_0x0c6a('0x15')][_0x0c6a('0x16')](_0x78fd26['body'],{'raw':_0x78fd26['options']?_0x78fd26[_0x0c6a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0c6a('0x18')](function(_0x2e3a55){logger[_0x0c6a('0xa')](_0x0c6a('0x14'),_0x78fd26);logger[_0x0c6a('0x19')](_0x0c6a('0x14'),_0x78fd26,JSON['stringify'](_0x2e3a55));_0x375241(_0x2e3a55);})['catch'](function(_0x5898e8){logger[_0x0c6a('0xe')]('CreateSquareRecording',_0x5898e8[_0x0c6a('0x11')],_0x78fd26);_0x2bda58(_0x2a84b6[_0x0c6a('0xe')](0x1f4,_0x5898e8[_0x0c6a('0x11')]));});});}; \ No newline at end of file +var _0xe94d=['SquareRecording','body','options','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','CreateSquareRecording'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe94d,0xac));var _0xde94=function(_0x53a17e,_0x4da47e){_0x53a17e=_0x53a17e-0x0;var _0x13379e=_0xe94d[_0x53a17e];return _0x13379e;};'use strict';var _=require('lodash');var util=require(_0xde94('0x0'));var moment=require(_0xde94('0x1'));var BPromise=require(_0xde94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde94('0x3'))['db'];var utils=require(_0xde94('0x4'));var logger=require(_0xde94('0x5'))(_0xde94('0x6'));var config=require(_0xde94('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xde94('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe49800,_0x274f1f,_0x35aa9e){return new BPromise(function(_0x310420,_0x41101c){return client[_0xde94('0x9')](_0xe49800,_0x35aa9e)[_0xde94('0xa')](function(_0x141d43){logger['info'](_0xde94('0xb'),_0x274f1f,_0xde94('0xc'));logger[_0xde94('0xd')](_0xde94('0xe'),_0x274f1f,'request\x20sent',JSON[_0xde94('0xf')](_0x141d43));if(_0x141d43[_0xde94('0x10')]){if(_0x141d43[_0xde94('0x10')]['code']===0x1f4){logger[_0xde94('0x10')](_0xde94('0xb'),_0x274f1f,_0x141d43[_0xde94('0x10')][_0xde94('0x11')]);return _0x41101c(_0x141d43[_0xde94('0x10')][_0xde94('0x11')]);}logger[_0xde94('0x10')](_0xde94('0xb'),_0x274f1f,_0x141d43['error']['message']);return _0x310420(_0x141d43[_0xde94('0x10')][_0xde94('0x11')]);}else{logger[_0xde94('0x12')](_0xde94('0xb'),_0x274f1f,_0xde94('0xc'));_0x310420(_0x141d43['result']['message']);}})['catch'](function(_0x4f8518){logger[_0xde94('0x10')]('SquareRecording,\x20%s,\x20%s',_0x274f1f,_0x4f8518);_0x41101c(_0x4f8518);});});}exports[_0xde94('0x13')]=function(_0x58cd67){var _0x4ae048=this;return new Promise(function(_0x4e21f5,_0xaf6b4d){return db[_0xde94('0x14')]['create'](_0x58cd67[_0xde94('0x15')],{'raw':_0x58cd67[_0xde94('0x16')]?_0x58cd67[_0xde94('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xde94('0xa')](function(_0x1d06f0){logger[_0xde94('0x12')]('CreateSquareRecording',_0x58cd67);logger['debug'](_0xde94('0x13'),_0x58cd67,JSON[_0xde94('0xf')](_0x1d06f0));_0x4e21f5(_0x1d06f0);})[_0xde94('0x17')](function(_0x499389){logger['error'](_0xde94('0x13'),_0x499389[_0xde94('0x11')],_0x58cd67);_0xaf6b4d(_0x4ae048[_0xde94('0x10')](0x1f4,_0x499389[_0xde94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9cfebdb..a1573ca 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5f5497,_0x50803a){var _0x10e943=function(_0x2f5faa){while(--_0x2f5faa){_0x5f5497['push'](_0x5f5497['shift']());}};_0x10e943(++_0x50803a);}(_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'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x45c129,_0x7c3cfc){var _0x2d7623=function(_0x1a711d){while(--_0x1a711d){_0x45c129['push'](_0x45c129['shift']());}};_0x2d7623(++_0x7c3cfc);}(_0xe706,0xa3));var _0x6e70=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xe706[_0x5b3950];return _0x41e436;};'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 e42ec0d..e9d9218 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 _0xde05=['DATE','sequelize','exports','STRING'];(function(_0x197d5c,_0x1936b0){var _0x13dc71=function(_0x332d07){while(--_0x332d07){_0x197d5c['push'](_0x197d5c['shift']());}};_0x13dc71(++_0x1936b0);}(_0xde05,0xe5));var _0x5de0=function(_0x48457e,_0x5cdad4){_0x48457e=_0x48457e-0x0;var _0x3edbb8=_0xde05[_0x48457e];return _0x3edbb8;};'use strict';var Sequelize=require(_0x5de0('0x0'));module[_0x5de0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x5de0('0x2')]},'request':{'type':Sequelize[_0x5de0('0x2')]},'channel':{'type':Sequelize[_0x5de0('0x2')]},'language':{'type':Sequelize[_0x5de0('0x2')]},'type':{'type':Sequelize[_0x5de0('0x2')]},'uniqueid':{'type':Sequelize[_0x5de0('0x2')]},'version':{'type':Sequelize[_0x5de0('0x2')]},'callerid':{'type':Sequelize[_0x5de0('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x5de0('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5de0('0x2')]},'rdnis':{'type':Sequelize[_0x5de0('0x2')]},'context':{'type':Sequelize[_0x5de0('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5de0('0x2')]},'enhanced':{'type':Sequelize[_0x5de0('0x2')]},'accountcode':{'type':Sequelize[_0x5de0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5de0('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7dea=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4c4a67,_0x438f20){var _0x14236c=function(_0x106e14){while(--_0x106e14){_0x4c4a67['push'](_0x4c4a67['shift']());}};_0x14236c(++_0x438f20);}(_0x7dea,0x16b));var _0xa7de=function(_0x3626d4,_0x5e531){_0x3626d4=_0x3626d4-0x0;var _0x82c4f8=_0x7dea[_0x3626d4];return _0x82c4f8;};'use strict';var Sequelize=require(_0xa7de('0x0'));module[_0xa7de('0x1')]={'network':{'type':Sequelize[_0xa7de('0x2')]},'network_script':{'type':Sequelize[_0xa7de('0x2')]},'request':{'type':Sequelize[_0xa7de('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa7de('0x2')]},'calleridname':{'type':Sequelize[_0xa7de('0x2')]},'callingpres':{'type':Sequelize[_0xa7de('0x2')]},'callingani2':{'type':Sequelize[_0xa7de('0x2')]},'callington':{'type':Sequelize[_0xa7de('0x2')]},'callingtns':{'type':Sequelize[_0xa7de('0x2')]},'dnid':{'type':Sequelize[_0xa7de('0x2')]},'rdnis':{'type':Sequelize[_0xa7de('0x2')]},'context':{'type':Sequelize[_0xa7de('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa7de('0x2')]},'enhanced':{'type':Sequelize[_0xa7de('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xa7de('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa7de('0x3')]},'leaveAt':{'type':Sequelize[_0xa7de('0x3')]},'bot':{'type':Sequelize[_0xa7de('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 6bd76ec..51ce9f7 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 _0xca4c=['save','update','then','destroy','end','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','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','limit','undefined','count','reject'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0xca4c,0xf7));var _0xcca4=function(_0x2aac7a,_0x14ec04){_0x2aac7a=_0x2aac7a-0x0;var _0x491766=_0xca4c[_0x2aac7a];return _0x491766;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcca4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcca4('0x1'));var moment=require(_0xcca4('0x2'));var BPromise=require(_0xcca4('0x3'));var Mustache=require(_0xcca4('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcca4('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcca4('0x6'));var squel=require(_0xcca4('0x7'));var crypto=require(_0xcca4('0x8'));var jsforce=require(_0xcca4('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcca4('0xa'));var Redis=require(_0xcca4('0xb'));var authService=require(_0xcca4('0xc'));var qs=require(_0xcca4('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcca4('0xe'));var logger=require(_0xcca4('0xf'))(_0xcca4('0x10'));var utils=require(_0xcca4('0x11'));var config=require(_0xcca4('0x12'));var licenseUtil=require(_0xcca4('0x13'));var db=require(_0xcca4('0x14'))['db'];function respondWithStatusCode(_0x3ee954,_0x5f3d0f){_0x5f3d0f=_0x5f3d0f||0xcc;return function(_0x25744a){if(_0x25744a){return _0x3ee954[_0xcca4('0x15')](_0x5f3d0f);}return _0x3ee954['status'](_0x5f3d0f)['end']();};}function respondWithResult(_0x4edb70,_0x3bc1b9){_0x3bc1b9=_0x3bc1b9||0xc8;return function(_0x72b4b9){if(_0x72b4b9){return _0x4edb70[_0xcca4('0x16')](_0x3bc1b9)[_0xcca4('0x17')](_0x72b4b9);}};}function respondWithFilteredResult(_0x43737c,_0x482148){return function(_0x34b17b){if(_0x34b17b){var _0x5a0dfa=typeof _0x482148[_0xcca4('0x18')]==='undefined'&&typeof _0x482148[_0xcca4('0x19')]===_0xcca4('0x1a');var _0x477335=_0x34b17b[_0xcca4('0x1b')];var _0x4bae2f=_0x5a0dfa?0x0:_0x482148['offset'];var _0x255103=_0x5a0dfa?_0x34b17b[_0xcca4('0x1b')]:_0x482148['offset']+_0x482148[_0xcca4('0x19')];var _0x2f39f2;if(_0x255103>=_0x477335){_0x255103=_0x477335;_0x2f39f2=0xc8;}else{_0x2f39f2=0xce;}_0x43737c[_0xcca4('0x16')](_0x2f39f2);return _0x43737c['set']('Content-Range',_0x4bae2f+'-'+_0x255103+'/'+_0x477335)[_0xcca4('0x17')](_0x34b17b);}return null;};}function patchUpdates(_0x2e4a99){return function(_0x5b20c9){try{jsonpatch['apply'](_0x5b20c9,_0x2e4a99,!![]);}catch(_0x40deca){return BPromise[_0xcca4('0x1c')](_0x40deca);}return _0x5b20c9[_0xcca4('0x1d')]();};}function saveUpdates(_0x442c9e,_0x59b0e6){return function(_0x37905e){if(_0x37905e){return _0x37905e[_0xcca4('0x1e')](_0x442c9e)[_0xcca4('0x1f')](function(_0x3d0b4a){return _0x3d0b4a;});}return null;};}function removeEntity(_0x4eae83,_0x59351e){return function(_0xa76162){if(_0xa76162){return _0xa76162[_0xcca4('0x20')]()[_0xcca4('0x1f')](function(){_0x4eae83[_0xcca4('0x16')](0xcc)[_0xcca4('0x21')]();});}};}function handleEntityNotFound(_0x282ec5,_0x3943e9){return function(_0x879048){if(!_0x879048){_0x282ec5[_0xcca4('0x15')](0x194);}return _0x879048;};}function handleError(_0x58262f,_0x30743b){_0x30743b=_0x30743b||0x1f4;return function(_0x151130){logger[_0xcca4('0x22')](_0x151130[_0xcca4('0x23')]);if(_0x151130[_0xcca4('0x24')]){delete _0x151130[_0xcca4('0x24')];}_0x58262f['status'](_0x30743b)[_0xcca4('0x25')](_0x151130);};}exports[_0xcca4('0x26')]=function(_0x3852d7,_0x303ed8){var _0x3846a8={},_0x22456f={},_0x2569dd={'count':0x0,'rows':[]};var _0x559423=_[_0xcca4('0x27')](db[_0xcca4('0x28')]['rawAttributes'],function(_0x47e7dd){return{'name':_0x47e7dd[_0xcca4('0x29')],'type':_0x47e7dd[_0xcca4('0x2a')][_0xcca4('0x2b')]};});_0x22456f[_0xcca4('0x2c')]=_['map'](_0x559423,_0xcca4('0x24'));_0x22456f[_0xcca4('0x2d')]=_[_0xcca4('0x2e')](_0x3852d7['query']);_0x22456f[_0xcca4('0x2f')]=_[_0xcca4('0x30')](_0x22456f[_0xcca4('0x2c')],_0x22456f[_0xcca4('0x2d')]);_0x3846a8[_0xcca4('0x31')]=_[_0xcca4('0x30')](_0x22456f[_0xcca4('0x2c')],qs[_0xcca4('0x32')](_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x32')]));_0x3846a8['attributes']=_0x3846a8[_0xcca4('0x31')][_0xcca4('0x33')]?_0x3846a8[_0xcca4('0x31')]:_0x22456f['model'];if(!_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x34')]('nolimit')){_0x3846a8[_0xcca4('0x19')]=qs[_0xcca4('0x19')](_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x19')]);_0x3846a8[_0xcca4('0x18')]=qs[_0xcca4('0x18')](_0x3852d7['query'][_0xcca4('0x18')]);}_0x3846a8['order']=qs[_0xcca4('0x35')](_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x35')]);_0x3846a8[_0xcca4('0x36')]=qs[_0xcca4('0x2f')](_['pick'](_0x3852d7[_0xcca4('0x2d')],_0x22456f['filters']),_0x559423);if(_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x37')]){_0x3846a8[_0xcca4('0x36')]=_['merge'](_0x3846a8[_0xcca4('0x36')],{'$or':_[_0xcca4('0x27')](_0x559423,function(_0x500a87){if(_0x500a87[_0xcca4('0x2a')]!=='VIRTUAL'){var _0x317d86={};_0x317d86[_0x500a87[_0xcca4('0x24')]]={'$like':'%'+_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x37')]+'%'};return _0x317d86;}})});}_0x3846a8=_[_0xcca4('0x38')]({},_0x3846a8,_0x3852d7[_0xcca4('0x39')]);var _0x34fca8={'where':_0x3846a8['where']};return db[_0xcca4('0x28')][_0xcca4('0x1b')](_0x34fca8)[_0xcca4('0x1f')](function(_0x37ef32){_0x2569dd[_0xcca4('0x1b')]=_0x37ef32;if(_0x3852d7[_0xcca4('0x2d')][_0xcca4('0x3a')]){_0x3846a8[_0xcca4('0x3b')]=[{'all':!![]}];}return db[_0xcca4('0x28')][_0xcca4('0x3c')](_0x3846a8);})[_0xcca4('0x1f')](function(_0x3bcc8d){_0x2569dd[_0xcca4('0x3d')]=_0x3bcc8d;return _0x2569dd;})[_0xcca4('0x1f')](respondWithFilteredResult(_0x303ed8,_0x3846a8))[_0xcca4('0x3e')](handleError(_0x303ed8,null));};exports[_0xcca4('0x3f')]=function(_0x15e2e2,_0x207806){var _0x4fb886={'raw':!![],'where':{'id':_0x15e2e2[_0xcca4('0x40')]['id']}},_0x1d5ef4={};_0x1d5ef4[_0xcca4('0x2c')]=_[_0xcca4('0x2e')](db['SquareReport']['rawAttributes']);_0x1d5ef4[_0xcca4('0x2d')]=_['keys'](_0x15e2e2[_0xcca4('0x2d')]);_0x1d5ef4[_0xcca4('0x2f')]=_[_0xcca4('0x30')](_0x1d5ef4[_0xcca4('0x2c')],_0x1d5ef4['query']);_0x4fb886[_0xcca4('0x31')]=_[_0xcca4('0x30')](_0x1d5ef4[_0xcca4('0x2c')],qs['fields'](_0x15e2e2[_0xcca4('0x2d')][_0xcca4('0x32')]));_0x4fb886[_0xcca4('0x31')]=_0x4fb886[_0xcca4('0x31')]['length']?_0x4fb886[_0xcca4('0x31')]:_0x1d5ef4[_0xcca4('0x2c')];if(_0x15e2e2[_0xcca4('0x2d')][_0xcca4('0x3a')]){_0x4fb886[_0xcca4('0x3b')]=[{'all':!![]}];}_0x4fb886=_['merge']({},_0x4fb886,_0x15e2e2['options']);return db['SquareReport'][_0xcca4('0x41')](_0x4fb886)[_0xcca4('0x1f')](handleEntityNotFound(_0x207806,null))[_0xcca4('0x1f')](respondWithResult(_0x207806,null))['catch'](handleError(_0x207806,null));};exports[_0xcca4('0x42')]=function(_0xe0d26b,_0x5e13a6){return db[_0xcca4('0x28')][_0xcca4('0x42')](_0xe0d26b[_0xcca4('0x43')],{})[_0xcca4('0x1f')](respondWithResult(_0x5e13a6,0xc9))[_0xcca4('0x3e')](handleError(_0x5e13a6,null));};exports[_0xcca4('0x1e')]=function(_0x3ca92c,_0x268ab9){if(_0x3ca92c[_0xcca4('0x43')]['id']){delete _0x3ca92c['body']['id'];}return db[_0xcca4('0x28')]['find']({'where':{'id':_0x3ca92c[_0xcca4('0x40')]['id']}})[_0xcca4('0x1f')](handleEntityNotFound(_0x268ab9,null))[_0xcca4('0x1f')](saveUpdates(_0x3ca92c[_0xcca4('0x43')],null))['then'](respondWithResult(_0x268ab9,null))[_0xcca4('0x3e')](handleError(_0x268ab9,null));};exports[_0xcca4('0x20')]=function(_0x20b85b,_0xe0443c){return db[_0xcca4('0x28')][_0xcca4('0x41')]({'where':{'id':_0x20b85b[_0xcca4('0x40')]['id']}})['then'](handleEntityNotFound(_0xe0443c,null))[_0xcca4('0x1f')](removeEntity(_0xe0443c,null))[_0xcca4('0x3e')](handleError(_0xe0443c,null));};exports[_0xcca4('0x44')]=function(_0x464718,_0x3e2369){return db[_0xcca4('0x28')][_0xcca4('0x44')]()[_0xcca4('0x1f')](respondWithResult(_0x3e2369,null))[_0xcca4('0x3e')](handleError(_0x3e2369,null));}; \ No newline at end of file +var _0x336a=['moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','SquareReport','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','body','params','describe','rimraf','fast-json-patch','request-promise'];(function(_0x17891b,_0x2bd1ff){var _0x2b4fcf=function(_0x46fb80){while(--_0x46fb80){_0x17891b['push'](_0x17891b['shift']());}};_0x2b4fcf(++_0x2bd1ff);}(_0x336a,0x1d7));var _0xa336=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x336a[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa336('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa336('0x1'));var rp=require(_0xa336('0x2'));var moment=require(_0xa336('0x3'));var BPromise=require(_0xa336('0x4'));var Mustache=require(_0xa336('0x5'));var util=require(_0xa336('0x6'));var path=require(_0xa336('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa336('0x8'));var fs=require('fs');var fs_extra=require(_0xa336('0x9'));var _=require(_0xa336('0xa'));var squel=require(_0xa336('0xb'));var crypto=require(_0xa336('0xc'));var jsforce=require(_0xa336('0xd'));var deskjs=require(_0xa336('0xe'));var toCsv=require(_0xa336('0xf'));var querystring=require(_0xa336('0x10'));var Papa=require(_0xa336('0x11'));var Redis=require(_0xa336('0x12'));var authService=require(_0xa336('0x13'));var qs=require(_0xa336('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa336('0x15'));var logger=require(_0xa336('0x16'))(_0xa336('0x17'));var utils=require(_0xa336('0x18'));var config=require(_0xa336('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa336('0x1a'))['db'];function respondWithStatusCode(_0x1ff648,_0x3c65bd){_0x3c65bd=_0x3c65bd||0xcc;return function(_0x1ddbe4){if(_0x1ddbe4){return _0x1ff648[_0xa336('0x1b')](_0x3c65bd);}return _0x1ff648[_0xa336('0x1c')](_0x3c65bd)[_0xa336('0x1d')]();};}function respondWithResult(_0x4c4f6f,_0x30fc18){_0x30fc18=_0x30fc18||0xc8;return function(_0x17c1a2){if(_0x17c1a2){return _0x4c4f6f[_0xa336('0x1c')](_0x30fc18)[_0xa336('0x1e')](_0x17c1a2);}};}function respondWithFilteredResult(_0x438405,_0x357e2e){return function(_0x5855ad){if(_0x5855ad){var _0x4f7f9e=typeof _0x357e2e[_0xa336('0x1f')]===_0xa336('0x20')&&typeof _0x357e2e[_0xa336('0x21')]===_0xa336('0x20');var _0x4db252=_0x5855ad[_0xa336('0x22')];var _0x44fb30=_0x4f7f9e?0x0:_0x357e2e[_0xa336('0x1f')];var _0x9f4841=_0x4f7f9e?_0x5855ad[_0xa336('0x22')]:_0x357e2e[_0xa336('0x1f')]+_0x357e2e[_0xa336('0x21')];var _0x20170a;if(_0x9f4841>=_0x4db252){_0x9f4841=_0x4db252;_0x20170a=0xc8;}else{_0x20170a=0xce;}_0x438405[_0xa336('0x1c')](_0x20170a);return _0x438405[_0xa336('0x23')](_0xa336('0x24'),_0x44fb30+'-'+_0x9f4841+'/'+_0x4db252)[_0xa336('0x1e')](_0x5855ad);}return null;};}function patchUpdates(_0x54446d){return function(_0x101ab4){try{jsonpatch['apply'](_0x101ab4,_0x54446d,!![]);}catch(_0x33564c){return BPromise[_0xa336('0x25')](_0x33564c);}return _0x101ab4[_0xa336('0x26')]();};}function saveUpdates(_0x4bdd7c,_0x4ce313){return function(_0xa6fb){if(_0xa6fb){return _0xa6fb[_0xa336('0x27')](_0x4bdd7c)[_0xa336('0x28')](function(_0x42fb49){return _0x42fb49;});}return null;};}function removeEntity(_0x3c9839,_0xb65fc9){return function(_0xebd9bb){if(_0xebd9bb){return _0xebd9bb[_0xa336('0x29')]()[_0xa336('0x28')](function(){_0x3c9839[_0xa336('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93853d,_0x3e6a33){return function(_0x17934c){if(!_0x17934c){_0x93853d['sendStatus'](0x194);}return _0x17934c;};}function handleError(_0x12f5da,_0x4a313b){_0x4a313b=_0x4a313b||0x1f4;return function(_0x459cbe){logger[_0xa336('0x2a')](_0x459cbe[_0xa336('0x2b')]);if(_0x459cbe[_0xa336('0x2c')]){delete _0x459cbe[_0xa336('0x2c')];}_0x12f5da[_0xa336('0x1c')](_0x4a313b)[_0xa336('0x2d')](_0x459cbe);};}exports[_0xa336('0x2e')]=function(_0x306f12,_0x2c0f66){var _0x489412={},_0x2f8c2b={},_0x2678ed={'count':0x0,'rows':[]};var _0x384d7a=_['map'](db['SquareReport']['rawAttributes'],function(_0x37bdee){return{'name':_0x37bdee[_0xa336('0x2f')],'type':_0x37bdee[_0xa336('0x30')][_0xa336('0x31')]};});_0x2f8c2b[_0xa336('0x32')]=_[_0xa336('0x33')](_0x384d7a,_0xa336('0x2c'));_0x2f8c2b[_0xa336('0x34')]=_[_0xa336('0x35')](_0x306f12[_0xa336('0x34')]);_0x2f8c2b[_0xa336('0x36')]=_[_0xa336('0x37')](_0x2f8c2b[_0xa336('0x32')],_0x2f8c2b[_0xa336('0x34')]);_0x489412[_0xa336('0x38')]=_[_0xa336('0x37')](_0x2f8c2b[_0xa336('0x32')],qs['fields'](_0x306f12[_0xa336('0x34')][_0xa336('0x39')]));_0x489412[_0xa336('0x38')]=_0x489412[_0xa336('0x38')][_0xa336('0x3a')]?_0x489412['attributes']:_0x2f8c2b[_0xa336('0x32')];if(!_0x306f12['query'][_0xa336('0x3b')](_0xa336('0x3c'))){_0x489412[_0xa336('0x21')]=qs['limit'](_0x306f12[_0xa336('0x34')][_0xa336('0x21')]);_0x489412[_0xa336('0x1f')]=qs[_0xa336('0x1f')](_0x306f12['query'][_0xa336('0x1f')]);}_0x489412['order']=qs[_0xa336('0x3d')](_0x306f12[_0xa336('0x34')][_0xa336('0x3d')]);_0x489412[_0xa336('0x3e')]=qs[_0xa336('0x36')](_['pick'](_0x306f12[_0xa336('0x34')],_0x2f8c2b[_0xa336('0x36')]),_0x384d7a);if(_0x306f12[_0xa336('0x34')]['filter']){_0x489412[_0xa336('0x3e')]=_[_0xa336('0x3f')](_0x489412[_0xa336('0x3e')],{'$or':_[_0xa336('0x33')](_0x384d7a,function(_0xdfcfe2){if(_0xdfcfe2[_0xa336('0x30')]!==_0xa336('0x40')){var _0x4953b8={};_0x4953b8[_0xdfcfe2[_0xa336('0x2c')]]={'$like':'%'+_0x306f12[_0xa336('0x34')][_0xa336('0x41')]+'%'};return _0x4953b8;}})});}_0x489412=_[_0xa336('0x3f')]({},_0x489412,_0x306f12['options']);var _0x29cd1e={'where':_0x489412['where']};return db[_0xa336('0x42')][_0xa336('0x22')](_0x29cd1e)[_0xa336('0x28')](function(_0x3fde50){_0x2678ed[_0xa336('0x22')]=_0x3fde50;if(_0x306f12['query'][_0xa336('0x43')]){_0x489412[_0xa336('0x44')]=[{'all':!![]}];}return db[_0xa336('0x42')][_0xa336('0x45')](_0x489412);})['then'](function(_0x47eaea){_0x2678ed[_0xa336('0x46')]=_0x47eaea;return _0x2678ed;})[_0xa336('0x28')](respondWithFilteredResult(_0x2c0f66,_0x489412))[_0xa336('0x47')](handleError(_0x2c0f66,null));};exports[_0xa336('0x48')]=function(_0xfb9d0f,_0x4e5c43){var _0xf149b={'raw':!![],'where':{'id':_0xfb9d0f['params']['id']}},_0x41077e={};_0x41077e[_0xa336('0x32')]=_['keys'](db['SquareReport'][_0xa336('0x49')]);_0x41077e['query']=_[_0xa336('0x35')](_0xfb9d0f[_0xa336('0x34')]);_0x41077e[_0xa336('0x36')]=_[_0xa336('0x37')](_0x41077e[_0xa336('0x32')],_0x41077e[_0xa336('0x34')]);_0xf149b[_0xa336('0x38')]=_[_0xa336('0x37')](_0x41077e[_0xa336('0x32')],qs[_0xa336('0x39')](_0xfb9d0f[_0xa336('0x34')][_0xa336('0x39')]));_0xf149b['attributes']=_0xf149b[_0xa336('0x38')][_0xa336('0x3a')]?_0xf149b['attributes']:_0x41077e[_0xa336('0x32')];if(_0xfb9d0f[_0xa336('0x34')][_0xa336('0x43')]){_0xf149b['include']=[{'all':!![]}];}_0xf149b=_[_0xa336('0x3f')]({},_0xf149b,_0xfb9d0f[_0xa336('0x4a')]);return db[_0xa336('0x42')][_0xa336('0x4b')](_0xf149b)[_0xa336('0x28')](handleEntityNotFound(_0x4e5c43,null))['then'](respondWithResult(_0x4e5c43,null))[_0xa336('0x47')](handleError(_0x4e5c43,null));};exports['create']=function(_0x293ece,_0x501e99){return db[_0xa336('0x42')]['create'](_0x293ece[_0xa336('0x4c')],{})[_0xa336('0x28')](respondWithResult(_0x501e99,0xc9))[_0xa336('0x47')](handleError(_0x501e99,null));};exports[_0xa336('0x27')]=function(_0x885f5b,_0x3713d4){if(_0x885f5b['body']['id']){delete _0x885f5b['body']['id'];}return db['SquareReport'][_0xa336('0x4b')]({'where':{'id':_0x885f5b[_0xa336('0x4d')]['id']}})[_0xa336('0x28')](handleEntityNotFound(_0x3713d4,null))['then'](saveUpdates(_0x885f5b[_0xa336('0x4c')],null))[_0xa336('0x28')](respondWithResult(_0x3713d4,null))[_0xa336('0x47')](handleError(_0x3713d4,null));};exports['destroy']=function(_0x4cbb72,_0x56c802){return db['SquareReport'][_0xa336('0x4b')]({'where':{'id':_0x4cbb72[_0xa336('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56c802,null))[_0xa336('0x28')](removeEntity(_0x56c802,null))[_0xa336('0x47')](handleError(_0x56c802,null));};exports[_0xa336('0x4e')]=function(_0xf2273c,_0x5b9b24){return db[_0xa336('0x42')][_0xa336('0x4e')]()[_0xa336('0x28')](respondWithResult(_0x5b9b24,null))[_0xa336('0x47')](handleError(_0x5b9b24,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 41f43fd..bd50870 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 _0x2b02=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x5af779,_0x59fd66){var _0xc90b90=function(_0x3a1155){while(--_0x3a1155){_0x5af779['push'](_0x5af779['shift']());}};_0xc90b90(++_0x59fd66);}(_0x2b02,0xc0));var _0x22b0=function(_0x59198e,_0x3c0420){_0x59198e=_0x59198e-0x0;var _0x58954d=_0x2b02[_0x59198e];return _0x58954d;};'use strict';var _=require(_0x22b0('0x0'));var util=require(_0x22b0('0x1'));var logger=require(_0x22b0('0x2'))('api');var moment=require(_0x22b0('0x3'));var BPromise=require(_0x22b0('0x4'));var rp=require(_0x22b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22b0('0x6'));var config=require(_0x22b0('0x7'));var attributes=require(_0x22b0('0x8'));module[_0x22b0('0x9')]=function(_0x11510,_0x553cd9){return _0x11510[_0x22b0('0xa')](_0x22b0('0xb'),attributes,{'tableName':_0x22b0('0xc'),'paranoid':![],'indexes':[{'name':_0x22b0('0xd'),'fields':[_0x22b0('0xe'),_0x22b0('0xf')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe825=['project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','uniqueid'];(function(_0x318448,_0x5cc7ac){var _0x3d499f=function(_0x3cb7b3){while(--_0x3cb7b3){_0x318448['push'](_0x318448['shift']());}};_0x3d499f(++_0x5cc7ac);}(_0xe825,0x198));var _0x5e82=function(_0x450a52,_0x202397){_0x450a52=_0x450a52-0x0;var _0x51d259=_0xe825[_0x450a52];return _0x51d259;};'use strict';var _=require(_0x5e82('0x0'));var util=require(_0x5e82('0x1'));var logger=require(_0x5e82('0x2'))(_0x5e82('0x3'));var moment=require(_0x5e82('0x4'));var BPromise=require(_0x5e82('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e82('0x6'));var attributes=require(_0x5e82('0x7'));module['exports']=function(_0x436f22,_0x33e03f){return _0x436f22[_0x5e82('0x8')]('SquareReport',attributes,{'tableName':_0x5e82('0x9'),'paranoid':![],'indexes':[{'name':_0x5e82('0xa'),'fields':[_0x5e82('0xb'),_0x5e82('0xc')]},{'name':_0x5e82('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 6f152c0..7330e01 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 _0xa82a=['rpc','../../config/environment','jayson/promise','client','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareReport','create','body','options','CreateSquareReport','UpdateSquareReport','update','raw','attributes','limit','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5158b3,_0x389178){var _0x4c8a0e=function(_0x5f5043){while(--_0x5f5043){_0x5158b3['push'](_0x5158b3['shift']());}};_0x4c8a0e(++_0x389178);}(_0xa82a,0x1da));var _0xaa82=function(_0x458282,_0xf8fca1){_0x458282=_0x458282-0x0;var _0x4d86f5=_0xa82a[_0x458282];return _0x4d86f5;};'use strict';var _=require(_0xaa82('0x0'));var util=require(_0xaa82('0x1'));var moment=require('moment');var BPromise=require(_0xaa82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa82('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa82('0x4'));var logger=require(_0xaa82('0x5'))(_0xaa82('0x6'));var config=require(_0xaa82('0x7'));var jayson=require(_0xaa82('0x8'));var client=jayson[_0xaa82('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bcc68,_0x5de143,_0x20890a){return new BPromise(function(_0x1ac370,_0x19fcb1){return client['request'](_0x3bcc68,_0x20890a)[_0xaa82('0xa')](function(_0x29ae51){logger['info'](_0xaa82('0xb'),_0x5de143,_0xaa82('0xc'));logger[_0xaa82('0xd')](_0xaa82('0xe'),_0x5de143,'request\x20sent',JSON[_0xaa82('0xf')](_0x29ae51));if(_0x29ae51['error']){if(_0x29ae51[_0xaa82('0x10')][_0xaa82('0x11')]===0x1f4){logger[_0xaa82('0x10')](_0xaa82('0xb'),_0x5de143,_0x29ae51['error'][_0xaa82('0x12')]);return _0x19fcb1(_0x29ae51['error'][_0xaa82('0x12')]);}logger['error'](_0xaa82('0xb'),_0x5de143,_0x29ae51['error']['message']);return _0x1ac370(_0x29ae51['error'][_0xaa82('0x12')]);}else{logger[_0xaa82('0x13')](_0xaa82('0xb'),_0x5de143,'request\x20sent');_0x1ac370(_0x29ae51[_0xaa82('0x14')][_0xaa82('0x12')]);}})[_0xaa82('0x15')](function(_0x59354b){logger[_0xaa82('0x10')](_0xaa82('0xb'),_0x5de143,_0x59354b);_0x19fcb1(_0x59354b);});});}exports['CreateSquareReport']=function(_0x4a3d0c){var _0x2173c2=this;return new Promise(function(_0x1b4864,_0x279e47){return db[_0xaa82('0x16')][_0xaa82('0x17')](_0x4a3d0c[_0xaa82('0x18')],{'raw':_0x4a3d0c[_0xaa82('0x19')]?_0x4a3d0c[_0xaa82('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xaa82('0xa')](function(_0x3b95ae){logger[_0xaa82('0x13')](_0xaa82('0x1a'),_0x4a3d0c);logger[_0xaa82('0xd')](_0xaa82('0x1a'),_0x4a3d0c,JSON['stringify'](_0x3b95ae));_0x1b4864(_0x3b95ae);})[_0xaa82('0x15')](function(_0x261e5c){logger[_0xaa82('0x10')](_0xaa82('0x1a'),_0x261e5c['message'],_0x4a3d0c);_0x279e47(_0x2173c2[_0xaa82('0x10')](0x1f4,_0x261e5c[_0xaa82('0x12')]));});});};exports[_0xaa82('0x1b')]=function(_0x129efe){var _0x15b352=this;return new Promise(function(_0x904d7b,_0x37305d){return db[_0xaa82('0x16')][_0xaa82('0x1c')](_0x129efe['body'],{'raw':_0x129efe['options']?_0x129efe[_0xaa82('0x19')][_0xaa82('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129efe['options']?_0x129efe[_0xaa82('0x19')]['where']||null:null,'attributes':_0x129efe[_0xaa82('0x19')]?_0x129efe[_0xaa82('0x19')][_0xaa82('0x1e')]||null:null,'limit':_0x129efe[_0xaa82('0x19')]?_0x129efe[_0xaa82('0x19')][_0xaa82('0x1f')]||null:null})[_0xaa82('0xa')](function(_0x2d92ef){logger[_0xaa82('0x13')]('UpdateSquareReport',_0x129efe);logger[_0xaa82('0xd')]('UpdateSquareReport',_0x129efe,JSON['stringify'](_0x2d92ef));_0x904d7b(_0x2d92ef);})[_0xaa82('0x15')](function(_0xa1713f){logger[_0xaa82('0x10')](_0xaa82('0x1b'),_0xa1713f['message'],_0x129efe);_0x37305d(_0x15b352['error'](0x1f4,_0xa1713f['message']));});});}; \ No newline at end of file +var _0x51cd=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','UpdateSquareReport','update','raw','attributes','limit','lodash'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x51cd,0xd8));var _0xd51c=function(_0x28aa4c,_0x327d24){_0x28aa4c=_0x28aa4c-0x0;var _0x5dfed7=_0x51cd[_0x28aa4c];return _0x5dfed7;};'use strict';var _=require(_0xd51c('0x0'));var util=require(_0xd51c('0x1'));var moment=require('moment');var BPromise=require(_0xd51c('0x2'));var rs=require(_0xd51c('0x3'));var fs=require('fs');var Redis=require(_0xd51c('0x4'));var db=require(_0xd51c('0x5'))['db'];var utils=require(_0xd51c('0x6'));var logger=require(_0xd51c('0x7'))('rpc');var config=require(_0xd51c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5534b3,_0x3666b9,_0x1b5bcb){return new BPromise(function(_0x27377b,_0x5cd872){return client['request'](_0x5534b3,_0x1b5bcb)[_0xd51c('0x9')](function(_0xd6bb8c){logger[_0xd51c('0xa')](_0xd51c('0xb'),_0x3666b9,_0xd51c('0xc'));logger[_0xd51c('0xd')](_0xd51c('0xe'),_0x3666b9,'request\x20sent',JSON[_0xd51c('0xf')](_0xd6bb8c));if(_0xd6bb8c[_0xd51c('0x10')]){if(_0xd6bb8c[_0xd51c('0x10')][_0xd51c('0x11')]===0x1f4){logger[_0xd51c('0x10')](_0xd51c('0xb'),_0x3666b9,_0xd6bb8c['error']['message']);return _0x5cd872(_0xd6bb8c[_0xd51c('0x10')][_0xd51c('0x12')]);}logger[_0xd51c('0x10')](_0xd51c('0xb'),_0x3666b9,_0xd6bb8c[_0xd51c('0x10')][_0xd51c('0x12')]);return _0x27377b(_0xd6bb8c[_0xd51c('0x10')][_0xd51c('0x12')]);}else{logger['info'](_0xd51c('0xb'),_0x3666b9,_0xd51c('0xc'));_0x27377b(_0xd6bb8c[_0xd51c('0x13')]['message']);}})[_0xd51c('0x14')](function(_0x3b36d4){logger['error'](_0xd51c('0xb'),_0x3666b9,_0x3b36d4);_0x5cd872(_0x3b36d4);});});}exports[_0xd51c('0x15')]=function(_0x2722e3){var _0x422cb3=this;return new Promise(function(_0x1a40cb,_0x133f2f){return db[_0xd51c('0x16')][_0xd51c('0x17')](_0x2722e3[_0xd51c('0x18')],{'raw':_0x2722e3[_0xd51c('0x19')]?_0x2722e3['options']['raw']===undefined?!![]:![]:!![]})[_0xd51c('0x9')](function(_0x5a3a32){logger[_0xd51c('0xa')](_0xd51c('0x15'),_0x2722e3);logger['debug']('CreateSquareReport',_0x2722e3,JSON[_0xd51c('0xf')](_0x5a3a32));_0x1a40cb(_0x5a3a32);})['catch'](function(_0x169ebf){logger[_0xd51c('0x10')](_0xd51c('0x15'),_0x169ebf['message'],_0x2722e3);_0x133f2f(_0x422cb3['error'](0x1f4,_0x169ebf['message']));});});};exports[_0xd51c('0x1a')]=function(_0x2e2b47){var _0x3632fb=this;return new Promise(function(_0x22d924,_0x2e5eb3){return db[_0xd51c('0x16')][_0xd51c('0x1b')](_0x2e2b47[_0xd51c('0x18')],{'raw':_0x2e2b47[_0xd51c('0x19')]?_0x2e2b47[_0xd51c('0x19')][_0xd51c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e2b47[_0xd51c('0x19')]?_0x2e2b47[_0xd51c('0x19')]['where']||null:null,'attributes':_0x2e2b47[_0xd51c('0x19')]?_0x2e2b47[_0xd51c('0x19')][_0xd51c('0x1d')]||null:null,'limit':_0x2e2b47[_0xd51c('0x19')]?_0x2e2b47[_0xd51c('0x19')][_0xd51c('0x1e')]||null:null})['then'](function(_0x47df68){logger[_0xd51c('0xa')](_0xd51c('0x1a'),_0x2e2b47);logger['debug']('UpdateSquareReport',_0x2e2b47,JSON[_0xd51c('0xf')](_0x47df68));_0x22d924(_0x47df68);})[_0xd51c('0x14')](function(_0x4e3444){logger['error']('UpdateSquareReport',_0x4e3444[_0xd51c('0x12')],_0x2e2b47);_0x2e5eb3(_0x3632fb[_0xd51c('0x10')](0x1f4,_0x4e3444[_0xd51c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f5b0df9..fa3f6f6 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 _0x997e=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post'];(function(_0x49f94b,_0x3574a8){var _0xb5d760=function(_0x2b627d){while(--_0x2b627d){_0x49f94b['push'](_0x49f94b['shift']());}};_0xb5d760(++_0x3574a8);}(_0x997e,0x159));var _0xe997=function(_0x867a42,_0x5093df){_0x867a42=_0x867a42-0x0;var _0x1c2543=_0x997e[_0x867a42];return _0x1c2543;};'use strict';var multer=require(_0xe997('0x0'));var util=require(_0xe997('0x1'));var path=require(_0xe997('0x2'));var timeout=require(_0xe997('0x3'));var express=require(_0xe997('0x4'));var router=express['Router']();var fs_extra=require(_0xe997('0x5'));var auth=require(_0xe997('0x6'));var interaction=require(_0xe997('0x7'));var config=require(_0xe997('0x8'));var controller=require('./squareReportDetail.controller');router[_0xe997('0x9')]('/',auth[_0xe997('0xa')](),controller['index']);router[_0xe997('0x9')](_0xe997('0xb'),auth[_0xe997('0xa')](),controller[_0xe997('0xc')]);router[_0xe997('0x9')]('/:id',auth[_0xe997('0xa')](),controller[_0xe997('0xd')]);router[_0xe997('0xe')]('/',auth[_0xe997('0xa')](),controller['create']);router[_0xe997('0xf')](_0xe997('0x10'),auth[_0xe997('0xa')](),controller[_0xe997('0x11')]);router[_0xe997('0x12')]('/:id',auth[_0xe997('0xa')](),controller['destroy']);module[_0xe997('0x13')]=router; \ No newline at end of file +var _0xfa21=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0x5ac82a,_0x3491ae){var _0x1a835b=function(_0x50e077){while(--_0x50e077){_0x5ac82a['push'](_0x5ac82a['shift']());}};_0x1a835b(++_0x3491ae);}(_0xfa21,0x75));var _0x1fa2=function(_0x3b6dff,_0x211326){_0x3b6dff=_0x3b6dff-0x0;var _0x48aab4=_0xfa21[_0x3b6dff];return _0x48aab4;};'use strict';var multer=require('multer');var util=require(_0x1fa2('0x0'));var path=require(_0x1fa2('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa2('0x2'));var router=express[_0x1fa2('0x3')]();var fs_extra=require(_0x1fa2('0x4'));var auth=require(_0x1fa2('0x5'));var interaction=require(_0x1fa2('0x6'));var config=require(_0x1fa2('0x7'));var controller=require(_0x1fa2('0x8'));router[_0x1fa2('0x9')]('/',auth[_0x1fa2('0xa')](),controller[_0x1fa2('0xb')]);router['get']('/describe',auth[_0x1fa2('0xa')](),controller['describe']);router[_0x1fa2('0x9')](_0x1fa2('0xc'),auth['isAuthenticated'](),controller[_0x1fa2('0xd')]);router[_0x1fa2('0xe')]('/',auth[_0x1fa2('0xa')](),controller[_0x1fa2('0xf')]);router[_0x1fa2('0x10')](_0x1fa2('0xc'),auth[_0x1fa2('0xa')](),controller[_0x1fa2('0x11')]);router[_0x1fa2('0x12')]('/:id',auth[_0x1fa2('0xa')](),controller[_0x1fa2('0x13')]);module[_0x1fa2('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 69beafe..71e400a 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 _0x7893=['STRING','TEXT','exports'];(function(_0x16480b,_0x390f4e){var _0x5b7375=function(_0xfd00bb){while(--_0xfd00bb){_0x16480b['push'](_0x16480b['shift']());}};_0x5b7375(++_0x390f4e);}(_0x7893,0x92));var _0x3789=function(_0x3e3e38,_0x27563){_0x3e3e38=_0x3e3e38-0x0;var _0x72c6fb=_0x7893[_0x3e3e38];return _0x72c6fb;};'use strict';var Sequelize=require('sequelize');module[_0x3789('0x0')]={'uniqueid':{'type':Sequelize[_0x3789('0x1')]},'node':{'type':Sequelize[_0x3789('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x3789('0x2')]},'project_name':{'type':Sequelize[_0x3789('0x1')]},'callerid':{'type':Sequelize[_0x3789('0x1')]}}; \ No newline at end of file +var _0x8b70=['STRING','TEXT','sequelize','exports'];(function(_0x5bb97e,_0x4245bd){var _0x3aa3d6=function(_0x1897c1){while(--_0x1897c1){_0x5bb97e['push'](_0x5bb97e['shift']());}};_0x3aa3d6(++_0x4245bd);}(_0x8b70,0xb6));var _0x08b7=function(_0x25fe20,_0x5c4098){_0x25fe20=_0x25fe20-0x0;var _0x5684d0=_0x8b70[_0x25fe20];return _0x5684d0;};'use strict';var Sequelize=require(_0x08b7('0x0'));module[_0x08b7('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x08b7('0x2')]},'application':{'type':Sequelize[_0x08b7('0x2')]},'data':{'type':Sequelize[_0x08b7('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x08b7('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9c1fb7c..b264e00 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 _0x4aec=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','findAll','rows','catch','params','intersection','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1d102c,_0x1bbef1){var _0x45b606=function(_0x571877){while(--_0x571877){_0x1d102c['push'](_0x1d102c['shift']());}};_0x45b606(++_0x1bbef1);}(_0x4aec,0xc6));var _0xc4ae=function(_0x522619,_0x54f584){_0x522619=_0x522619-0x0;var _0x252aa4=_0x4aec[_0x522619];return _0x252aa4;};'use strict';var emlformat=require(_0xc4ae('0x0'));var rimraf=require(_0xc4ae('0x1'));var zipdir=require(_0xc4ae('0x2'));var jsonpatch=require(_0xc4ae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc4ae('0x4'));var path=require('path');var sox=require(_0xc4ae('0x5'));var csv=require('to-csv');var ejs=require(_0xc4ae('0x6'));var fs=require('fs');var fs_extra=require(_0xc4ae('0x7'));var _=require(_0xc4ae('0x8'));var squel=require(_0xc4ae('0x9'));var crypto=require(_0xc4ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc4ae('0xb'));var toCsv=require(_0xc4ae('0xc'));var querystring=require(_0xc4ae('0xd'));var Papa=require('papaparse');var Redis=require(_0xc4ae('0xe'));var authService=require(_0xc4ae('0xf'));var qs=require(_0xc4ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4ae('0x11'));var logger=require('../../config/logger')(_0xc4ae('0x12'));var utils=require(_0xc4ae('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc4ae('0x14'));var db=require(_0xc4ae('0x15'))['db'];function respondWithStatusCode(_0x5c90d9,_0x4fb657){_0x4fb657=_0x4fb657||0xcc;return function(_0xde1eee){if(_0xde1eee){return _0x5c90d9[_0xc4ae('0x16')](_0x4fb657);}return _0x5c90d9['status'](_0x4fb657)[_0xc4ae('0x17')]();};}function respondWithResult(_0x10108a,_0x5a0cc6){_0x5a0cc6=_0x5a0cc6||0xc8;return function(_0x3e8f20){if(_0x3e8f20){return _0x10108a[_0xc4ae('0x18')](_0x5a0cc6)[_0xc4ae('0x19')](_0x3e8f20);}};}function respondWithFilteredResult(_0x569b3c,_0x4fb991){return function(_0xb88173){if(_0xb88173){var _0x10a0af=typeof _0x4fb991[_0xc4ae('0x1a')]===_0xc4ae('0x1b')&&typeof _0x4fb991[_0xc4ae('0x1c')]===_0xc4ae('0x1b');var _0x5ecf6f=_0xb88173[_0xc4ae('0x1d')];var _0x30166c=_0x10a0af?0x0:_0x4fb991[_0xc4ae('0x1a')];var _0x2792b9=_0x10a0af?_0xb88173['count']:_0x4fb991['offset']+_0x4fb991[_0xc4ae('0x1c')];var _0x5b8f32;if(_0x2792b9>=_0x5ecf6f){_0x2792b9=_0x5ecf6f;_0x5b8f32=0xc8;}else{_0x5b8f32=0xce;}_0x569b3c['status'](_0x5b8f32);return _0x569b3c[_0xc4ae('0x1e')](_0xc4ae('0x1f'),_0x30166c+'-'+_0x2792b9+'/'+_0x5ecf6f)['json'](_0xb88173);}return null;};}function patchUpdates(_0x1de74c){return function(_0x47c25d){try{jsonpatch[_0xc4ae('0x20')](_0x47c25d,_0x1de74c,!![]);}catch(_0x3e662b){return BPromise[_0xc4ae('0x21')](_0x3e662b);}return _0x47c25d[_0xc4ae('0x22')]();};}function saveUpdates(_0x1c9cf7,_0x2ab8e4){return function(_0x1a1c82){if(_0x1a1c82){return _0x1a1c82[_0xc4ae('0x23')](_0x1c9cf7)[_0xc4ae('0x24')](function(_0x45fec9){return _0x45fec9;});}return null;};}function removeEntity(_0x106f17,_0x3c68fd){return function(_0x432525){if(_0x432525){return _0x432525[_0xc4ae('0x25')]()[_0xc4ae('0x24')](function(){_0x106f17['status'](0xcc)[_0xc4ae('0x17')]();});}};}function handleEntityNotFound(_0x3e72c6,_0x57fb1f){return function(_0x3934a7){if(!_0x3934a7){_0x3e72c6[_0xc4ae('0x16')](0x194);}return _0x3934a7;};}function handleError(_0x1c4234,_0x13e973){_0x13e973=_0x13e973||0x1f4;return function(_0x24fdf4){logger['error'](_0x24fdf4[_0xc4ae('0x26')]);if(_0x24fdf4['name']){delete _0x24fdf4[_0xc4ae('0x27')];}_0x1c4234[_0xc4ae('0x18')](_0x13e973)[_0xc4ae('0x28')](_0x24fdf4);};}exports[_0xc4ae('0x29')]=function(_0x2a5416,_0x4cad5e){var _0x2febcd={},_0x10ee91={},_0x496b9c={'count':0x0,'rows':[]};var _0xa3bc98=_['map'](db[_0xc4ae('0x2a')][_0xc4ae('0x2b')],function(_0x4710e4){return{'name':_0x4710e4[_0xc4ae('0x2c')],'type':_0x4710e4[_0xc4ae('0x2d')]['key']};});_0x10ee91[_0xc4ae('0x2e')]=_[_0xc4ae('0x2f')](_0xa3bc98,_0xc4ae('0x27'));_0x10ee91['query']=_[_0xc4ae('0x30')](_0x2a5416[_0xc4ae('0x31')]);_0x10ee91[_0xc4ae('0x32')]=_['intersection'](_0x10ee91[_0xc4ae('0x2e')],_0x10ee91[_0xc4ae('0x31')]);_0x2febcd[_0xc4ae('0x33')]=_['intersection'](_0x10ee91[_0xc4ae('0x2e')],qs[_0xc4ae('0x34')](_0x2a5416[_0xc4ae('0x31')][_0xc4ae('0x34')]));_0x2febcd[_0xc4ae('0x33')]=_0x2febcd[_0xc4ae('0x33')][_0xc4ae('0x35')]?_0x2febcd['attributes']:_0x10ee91[_0xc4ae('0x2e')];if(!_0x2a5416[_0xc4ae('0x31')][_0xc4ae('0x36')](_0xc4ae('0x37'))){_0x2febcd[_0xc4ae('0x1c')]=qs[_0xc4ae('0x1c')](_0x2a5416['query'][_0xc4ae('0x1c')]);_0x2febcd['offset']=qs[_0xc4ae('0x1a')](_0x2a5416['query'][_0xc4ae('0x1a')]);}_0x2febcd['order']=qs[_0xc4ae('0x38')](_0x2a5416[_0xc4ae('0x31')]['sort']);_0x2febcd['where']=qs[_0xc4ae('0x32')](_[_0xc4ae('0x39')](_0x2a5416[_0xc4ae('0x31')],_0x10ee91[_0xc4ae('0x32')]),_0xa3bc98);if(_0x2a5416[_0xc4ae('0x31')][_0xc4ae('0x3a')]){_0x2febcd[_0xc4ae('0x3b')]=_['merge'](_0x2febcd[_0xc4ae('0x3b')],{'$or':_[_0xc4ae('0x2f')](_0xa3bc98,function(_0x434c24){if(_0x434c24[_0xc4ae('0x2d')]!==_0xc4ae('0x3c')){var _0x351483={};_0x351483[_0x434c24[_0xc4ae('0x27')]]={'$like':'%'+_0x2a5416['query'][_0xc4ae('0x3a')]+'%'};return _0x351483;}})});}_0x2febcd=_['merge']({},_0x2febcd,_0x2a5416[_0xc4ae('0x3d')]);var _0x311c92={'where':_0x2febcd[_0xc4ae('0x3b')]};return db[_0xc4ae('0x2a')][_0xc4ae('0x1d')](_0x311c92)[_0xc4ae('0x24')](function(_0x2492ef){_0x496b9c['count']=_0x2492ef;if(_0x2a5416[_0xc4ae('0x31')]['includeAll']){_0x2febcd['include']=[{'all':!![]}];}return db[_0xc4ae('0x2a')][_0xc4ae('0x3e')](_0x2febcd);})[_0xc4ae('0x24')](function(_0x3675ab){_0x496b9c[_0xc4ae('0x3f')]=_0x3675ab;return _0x496b9c;})[_0xc4ae('0x24')](respondWithFilteredResult(_0x4cad5e,_0x2febcd))[_0xc4ae('0x40')](handleError(_0x4cad5e,null));};exports['show']=function(_0x32e8f2,_0x515072){var _0x55e77f={'raw':!![],'where':{'id':_0x32e8f2[_0xc4ae('0x41')]['id']}},_0x550029={};_0x550029['model']=_[_0xc4ae('0x30')](db['SquareDetailsReport'][_0xc4ae('0x2b')]);_0x550029['query']=_[_0xc4ae('0x30')](_0x32e8f2[_0xc4ae('0x31')]);_0x550029[_0xc4ae('0x32')]=_[_0xc4ae('0x42')](_0x550029[_0xc4ae('0x2e')],_0x550029[_0xc4ae('0x31')]);_0x55e77f[_0xc4ae('0x33')]=_[_0xc4ae('0x42')](_0x550029['model'],qs[_0xc4ae('0x34')](_0x32e8f2[_0xc4ae('0x31')][_0xc4ae('0x34')]));_0x55e77f[_0xc4ae('0x33')]=_0x55e77f[_0xc4ae('0x33')][_0xc4ae('0x35')]?_0x55e77f[_0xc4ae('0x33')]:_0x550029[_0xc4ae('0x2e')];if(_0x32e8f2[_0xc4ae('0x31')]['includeAll']){_0x55e77f['include']=[{'all':!![]}];}_0x55e77f=_[_0xc4ae('0x43')]({},_0x55e77f,_0x32e8f2[_0xc4ae('0x3d')]);return db[_0xc4ae('0x2a')][_0xc4ae('0x44')](_0x55e77f)['then'](handleEntityNotFound(_0x515072,null))[_0xc4ae('0x24')](respondWithResult(_0x515072,null))[_0xc4ae('0x40')](handleError(_0x515072,null));};exports['create']=function(_0x33c95e,_0x118761){return db[_0xc4ae('0x2a')][_0xc4ae('0x45')](_0x33c95e[_0xc4ae('0x46')],{})['then'](respondWithResult(_0x118761,0xc9))[_0xc4ae('0x40')](handleError(_0x118761,null));};exports[_0xc4ae('0x23')]=function(_0x22bc53,_0x55be1a){if(_0x22bc53[_0xc4ae('0x46')]['id']){delete _0x22bc53[_0xc4ae('0x46')]['id'];}return db[_0xc4ae('0x2a')][_0xc4ae('0x44')]({'where':{'id':_0x22bc53['params']['id']}})[_0xc4ae('0x24')](handleEntityNotFound(_0x55be1a,null))[_0xc4ae('0x24')](saveUpdates(_0x22bc53[_0xc4ae('0x46')],null))[_0xc4ae('0x24')](respondWithResult(_0x55be1a,null))[_0xc4ae('0x40')](handleError(_0x55be1a,null));};exports[_0xc4ae('0x25')]=function(_0x15a3cd,_0x3416ae){return db[_0xc4ae('0x2a')][_0xc4ae('0x44')]({'where':{'id':_0x15a3cd[_0xc4ae('0x41')]['id']}})[_0xc4ae('0x24')](handleEntityNotFound(_0x3416ae,null))[_0xc4ae('0x24')](removeEntity(_0x3416ae,null))[_0xc4ae('0x40')](handleError(_0x3416ae,null));};exports[_0xc4ae('0x47')]=function(_0x3bfeea,_0x50624b){return db[_0xc4ae('0x2a')][_0xc4ae('0x47')]()['then'](respondWithResult(_0x50624b,null))['catch'](handleError(_0x50624b,null));}; \ No newline at end of file +var _0xd099=['describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','SquareDetailsReport','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body','update'];(function(_0x232c41,_0x3250b1){var _0x9be496=function(_0x10c3a6){while(--_0x10c3a6){_0x232c41['push'](_0x232c41['shift']());}};_0x9be496(++_0x3250b1);}(_0xd099,0x1bd));var _0x9d09=function(_0x1df210,_0x3abe68){_0x1df210=_0x1df210-0x0;var _0x4a5027=_0xd099[_0x1df210];return _0x4a5027;};'use strict';var emlformat=require(_0x9d09('0x0'));var rimraf=require(_0x9d09('0x1'));var zipdir=require(_0x9d09('0x2'));var jsonpatch=require(_0x9d09('0x3'));var rp=require('request-promise');var moment=require(_0x9d09('0x4'));var BPromise=require(_0x9d09('0x5'));var Mustache=require(_0x9d09('0x6'));var util=require(_0x9d09('0x7'));var path=require(_0x9d09('0x8'));var sox=require('sox');var csv=require(_0x9d09('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d09('0xa'));var _=require(_0x9d09('0xb'));var squel=require(_0x9d09('0xc'));var crypto=require(_0x9d09('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d09('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d09('0xf'));var Papa=require(_0x9d09('0x10'));var Redis=require(_0x9d09('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9d09('0x12'));var as=require(_0x9d09('0x13'));var hardwareService=require(_0x9d09('0x14'));var logger=require(_0x9d09('0x15'))('api');var utils=require(_0x9d09('0x16'));var config=require(_0x9d09('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df2ad,_0x52a3a3){_0x52a3a3=_0x52a3a3||0xcc;return function(_0x1547ad){if(_0x1547ad){return _0x2df2ad[_0x9d09('0x18')](_0x52a3a3);}return _0x2df2ad[_0x9d09('0x19')](_0x52a3a3)[_0x9d09('0x1a')]();};}function respondWithResult(_0x53b0e9,_0x1533d1){_0x1533d1=_0x1533d1||0xc8;return function(_0x27c9d1){if(_0x27c9d1){return _0x53b0e9[_0x9d09('0x19')](_0x1533d1)[_0x9d09('0x1b')](_0x27c9d1);}};}function respondWithFilteredResult(_0x485c53,_0x29c9c6){return function(_0x16e11b){if(_0x16e11b){var _0x4ecaa8=typeof _0x29c9c6[_0x9d09('0x1c')]==='undefined'&&typeof _0x29c9c6[_0x9d09('0x1d')]==='undefined';var _0x80927e=_0x16e11b['count'];var _0xd25cf8=_0x4ecaa8?0x0:_0x29c9c6[_0x9d09('0x1c')];var _0x4ebb27=_0x4ecaa8?_0x16e11b[_0x9d09('0x1e')]:_0x29c9c6[_0x9d09('0x1c')]+_0x29c9c6[_0x9d09('0x1d')];var _0x500f39;if(_0x4ebb27>=_0x80927e){_0x4ebb27=_0x80927e;_0x500f39=0xc8;}else{_0x500f39=0xce;}_0x485c53[_0x9d09('0x19')](_0x500f39);return _0x485c53[_0x9d09('0x1f')](_0x9d09('0x20'),_0xd25cf8+'-'+_0x4ebb27+'/'+_0x80927e)[_0x9d09('0x1b')](_0x16e11b);}return null;};}function patchUpdates(_0x442e61){return function(_0x1140ae){try{jsonpatch[_0x9d09('0x21')](_0x1140ae,_0x442e61,!![]);}catch(_0x5000ea){return BPromise[_0x9d09('0x22')](_0x5000ea);}return _0x1140ae['save']();};}function saveUpdates(_0x9848a5,_0x81eddf){return function(_0x29f351){if(_0x29f351){return _0x29f351['update'](_0x9848a5)[_0x9d09('0x23')](function(_0x400eb7){return _0x400eb7;});}return null;};}function removeEntity(_0x5f47e2,_0x5f120e){return function(_0x10dc26){if(_0x10dc26){return _0x10dc26[_0x9d09('0x24')]()[_0x9d09('0x23')](function(){_0x5f47e2['status'](0xcc)[_0x9d09('0x1a')]();});}};}function handleEntityNotFound(_0x391bda,_0x21193d){return function(_0x142ddd){if(!_0x142ddd){_0x391bda[_0x9d09('0x18')](0x194);}return _0x142ddd;};}function handleError(_0x307298,_0x59a63d){_0x59a63d=_0x59a63d||0x1f4;return function(_0x5bec6a){logger[_0x9d09('0x25')](_0x5bec6a[_0x9d09('0x26')]);if(_0x5bec6a[_0x9d09('0x27')]){delete _0x5bec6a['name'];}_0x307298[_0x9d09('0x19')](_0x59a63d)['send'](_0x5bec6a);};}exports[_0x9d09('0x28')]=function(_0x5f3a01,_0x3668d2){var _0xe03819={},_0x1a568c={},_0x12c25d={'count':0x0,'rows':[]};var _0x98f6f0=_[_0x9d09('0x29')](db['SquareDetailsReport'][_0x9d09('0x2a')],function(_0x4da6bf){return{'name':_0x4da6bf[_0x9d09('0x2b')],'type':_0x4da6bf[_0x9d09('0x2c')][_0x9d09('0x2d')]};});_0x1a568c[_0x9d09('0x2e')]=_['map'](_0x98f6f0,_0x9d09('0x27'));_0x1a568c[_0x9d09('0x2f')]=_['keys'](_0x5f3a01[_0x9d09('0x2f')]);_0x1a568c[_0x9d09('0x30')]=_[_0x9d09('0x31')](_0x1a568c[_0x9d09('0x2e')],_0x1a568c[_0x9d09('0x2f')]);_0xe03819[_0x9d09('0x32')]=_[_0x9d09('0x31')](_0x1a568c['model'],qs['fields'](_0x5f3a01[_0x9d09('0x2f')][_0x9d09('0x33')]));_0xe03819[_0x9d09('0x32')]=_0xe03819[_0x9d09('0x32')][_0x9d09('0x34')]?_0xe03819[_0x9d09('0x32')]:_0x1a568c[_0x9d09('0x2e')];if(!_0x5f3a01['query'][_0x9d09('0x35')](_0x9d09('0x36'))){_0xe03819['limit']=qs[_0x9d09('0x1d')](_0x5f3a01[_0x9d09('0x2f')][_0x9d09('0x1d')]);_0xe03819[_0x9d09('0x1c')]=qs[_0x9d09('0x1c')](_0x5f3a01[_0x9d09('0x2f')][_0x9d09('0x1c')]);}_0xe03819['order']=qs[_0x9d09('0x37')](_0x5f3a01[_0x9d09('0x2f')][_0x9d09('0x37')]);_0xe03819[_0x9d09('0x38')]=qs[_0x9d09('0x30')](_[_0x9d09('0x39')](_0x5f3a01[_0x9d09('0x2f')],_0x1a568c[_0x9d09('0x30')]),_0x98f6f0);if(_0x5f3a01[_0x9d09('0x2f')]['filter']){_0xe03819[_0x9d09('0x38')]=_[_0x9d09('0x3a')](_0xe03819[_0x9d09('0x38')],{'$or':_[_0x9d09('0x29')](_0x98f6f0,function(_0x1b53a1){if(_0x1b53a1[_0x9d09('0x2c')]!==_0x9d09('0x3b')){var _0x3cd565={};_0x3cd565[_0x1b53a1[_0x9d09('0x27')]]={'$like':'%'+_0x5f3a01[_0x9d09('0x2f')]['filter']+'%'};return _0x3cd565;}})});}_0xe03819=_[_0x9d09('0x3a')]({},_0xe03819,_0x5f3a01['options']);var _0x4ff5d1={'where':_0xe03819[_0x9d09('0x38')]};return db[_0x9d09('0x3c')]['count'](_0x4ff5d1)[_0x9d09('0x23')](function(_0xb6ad5f){_0x12c25d[_0x9d09('0x1e')]=_0xb6ad5f;if(_0x5f3a01[_0x9d09('0x2f')][_0x9d09('0x3d')]){_0xe03819['include']=[{'all':!![]}];}return db[_0x9d09('0x3c')][_0x9d09('0x3e')](_0xe03819);})[_0x9d09('0x23')](function(_0x12f3a1){_0x12c25d[_0x9d09('0x3f')]=_0x12f3a1;return _0x12c25d;})[_0x9d09('0x23')](respondWithFilteredResult(_0x3668d2,_0xe03819))[_0x9d09('0x40')](handleError(_0x3668d2,null));};exports[_0x9d09('0x41')]=function(_0x1a57bb,_0x2139e3){var _0x432bf5={'raw':!![],'where':{'id':_0x1a57bb[_0x9d09('0x42')]['id']}},_0x3ffa98={};_0x3ffa98[_0x9d09('0x2e')]=_['keys'](db[_0x9d09('0x3c')]['rawAttributes']);_0x3ffa98[_0x9d09('0x2f')]=_[_0x9d09('0x43')](_0x1a57bb[_0x9d09('0x2f')]);_0x3ffa98[_0x9d09('0x30')]=_[_0x9d09('0x31')](_0x3ffa98['model'],_0x3ffa98[_0x9d09('0x2f')]);_0x432bf5[_0x9d09('0x32')]=_[_0x9d09('0x31')](_0x3ffa98[_0x9d09('0x2e')],qs['fields'](_0x1a57bb[_0x9d09('0x2f')][_0x9d09('0x33')]));_0x432bf5[_0x9d09('0x32')]=_0x432bf5[_0x9d09('0x32')][_0x9d09('0x34')]?_0x432bf5['attributes']:_0x3ffa98['model'];if(_0x1a57bb['query'][_0x9d09('0x3d')]){_0x432bf5[_0x9d09('0x44')]=[{'all':!![]}];}_0x432bf5=_['merge']({},_0x432bf5,_0x1a57bb[_0x9d09('0x45')]);return db[_0x9d09('0x3c')][_0x9d09('0x46')](_0x432bf5)['then'](handleEntityNotFound(_0x2139e3,null))[_0x9d09('0x23')](respondWithResult(_0x2139e3,null))[_0x9d09('0x40')](handleError(_0x2139e3,null));};exports['create']=function(_0x43066e,_0x2b2d0a){return db[_0x9d09('0x3c')]['create'](_0x43066e[_0x9d09('0x47')],{})[_0x9d09('0x23')](respondWithResult(_0x2b2d0a,0xc9))['catch'](handleError(_0x2b2d0a,null));};exports[_0x9d09('0x48')]=function(_0x108008,_0x357fc2){if(_0x108008['body']['id']){delete _0x108008[_0x9d09('0x47')]['id'];}return db[_0x9d09('0x3c')][_0x9d09('0x46')]({'where':{'id':_0x108008['params']['id']}})[_0x9d09('0x23')](handleEntityNotFound(_0x357fc2,null))[_0x9d09('0x23')](saveUpdates(_0x108008[_0x9d09('0x47')],null))[_0x9d09('0x23')](respondWithResult(_0x357fc2,null))[_0x9d09('0x40')](handleError(_0x357fc2,null));};exports[_0x9d09('0x24')]=function(_0x2178c6,_0x7293f1){return db[_0x9d09('0x3c')]['find']({'where':{'id':_0x2178c6[_0x9d09('0x42')]['id']}})['then'](handleEntityNotFound(_0x7293f1,null))[_0x9d09('0x23')](removeEntity(_0x7293f1,null))[_0x9d09('0x40')](handleError(_0x7293f1,null));};exports[_0x9d09('0x49')]=function(_0x22ae40,_0x4f0ff3){return db[_0x9d09('0x3c')][_0x9d09('0x49')]()[_0x9d09('0x23')](respondWithResult(_0x4f0ff3,null))[_0x9d09('0x40')](handleError(_0x4f0ff3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index ee6c78c..beeb614 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 _0x62f9=['request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','define','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xa1f7d7,_0x5e2227){var _0x113647=function(_0x133294){while(--_0x133294){_0xa1f7d7['push'](_0xa1f7d7['shift']());}};_0x113647(++_0x5e2227);}(_0x62f9,0xc6));var _0x962f=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x62f9[_0x55daf2];return _0x1c8500;};'use strict';var _=require(_0x962f('0x0'));var util=require(_0x962f('0x1'));var logger=require(_0x962f('0x2'))(_0x962f('0x3'));var moment=require(_0x962f('0x4'));var BPromise=require(_0x962f('0x5'));var rp=require(_0x962f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x962f('0x7'));var config=require(_0x962f('0x8'));var attributes=require(_0x962f('0x9'));module['exports']=function(_0x1c0216,_0x51f21a){return _0x1c0216[_0x962f('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x962f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf80f=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a6bd9,_0x56d3e7){var _0x51dd9e=function(_0x554872){while(--_0x554872){_0x4a6bd9['push'](_0x4a6bd9['shift']());}};_0x51dd9e(++_0x56d3e7);}(_0xf80f,0x1ac));var _0xff80=function(_0x263448,_0xaf8917){_0x263448=_0x263448-0x0;var _0x404c96=_0xf80f[_0x263448];return _0x404c96;};'use strict';var _=require(_0xff80('0x0'));var util=require(_0xff80('0x1'));var logger=require(_0xff80('0x2'))(_0xff80('0x3'));var moment=require(_0xff80('0x4'));var BPromise=require(_0xff80('0x5'));var rp=require(_0xff80('0x6'));var fs=require('fs');var path=require(_0xff80('0x7'));var rimraf=require(_0xff80('0x8'));var config=require(_0xff80('0x9'));var attributes=require(_0xff80('0xa'));module[_0xff80('0xb')]=function(_0x17ebd4,_0x127c9b){return _0x17ebd4['define'](_0xff80('0xc'),attributes,{'tableName':_0xff80('0xd'),'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 0e13794..a91b24b 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 _0x2f3a=['request\x20sent','debug','stringify','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s'];(function(_0x43c261,_0x344bef){var _0x3ee801=function(_0x5850fc){while(--_0x5850fc){_0x43c261['push'](_0x43c261['shift']());}};_0x3ee801(++_0x344bef);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4ac106,_0x194ce5){_0x4ac106=_0x4ac106-0x0;var _0x319160=_0x2f3a[_0x4ac106];return _0x319160;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db21d,_0x521ddf,_0x2faf36){return new BPromise(function(_0x3944a0,_0x4405a2){return client[_0xa2f3('0xa')](_0x4db21d,_0x2faf36)['then'](function(_0x358263){logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));logger[_0xa2f3('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x521ddf,_0xa2f3('0xd'),JSON[_0xa2f3('0xf')](_0x358263));if(_0x358263['error']){if(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x11')]===0x1f4){logger[_0xa2f3('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x4405a2(_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);}logger[_0xa2f3('0x10')](_0xa2f3('0xc'),_0x521ddf,_0x358263[_0xa2f3('0x10')][_0xa2f3('0x12')]);return _0x3944a0(_0x358263[_0xa2f3('0x10')]['message']);}else{logger[_0xa2f3('0xb')](_0xa2f3('0xc'),_0x521ddf,_0xa2f3('0xd'));_0x3944a0(_0x358263['result'][_0xa2f3('0x12')]);}})[_0xa2f3('0x13')](function(_0x4b138b){logger['error'](_0xa2f3('0xc'),_0x521ddf,_0x4b138b);_0x4405a2(_0x4b138b);});});}exports[_0xa2f3('0x14')]=function(_0x2db0d2){var _0x1c5c62=this;return new Promise(function(_0x205578,_0x23309e){return db[_0xa2f3('0x15')][_0xa2f3('0x16')](_0x2db0d2['body'],{'raw':_0x2db0d2[_0xa2f3('0x17')]?_0x2db0d2[_0xa2f3('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2f74a0){logger['info'](_0xa2f3('0x14'),_0x2db0d2);logger[_0xa2f3('0xe')]('CreateSquareDetailsReport',_0x2db0d2,JSON[_0xa2f3('0xf')](_0x2f74a0));_0x205578(_0x2f74a0);})[_0xa2f3('0x13')](function(_0x14d989){logger[_0xa2f3('0x10')](_0xa2f3('0x14'),_0x14d989[_0xa2f3('0x12')],_0x2db0d2);_0x23309e(_0x1c5c62[_0xa2f3('0x10')](0x1f4,_0x14d989[_0xa2f3('0x12')]));});});}; \ No newline at end of file +var _0x97c1=['create','body','options','raw','then','CreateSquareDetailsReport','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareDetailsReport'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateSquareDetailsReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index ae5c0a4..6fe4e03 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 _0x8700=['isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x14dad5,_0x11bade){var _0x99903a=function(_0x196f23){while(--_0x196f23){_0x14dad5['push'](_0x14dad5['shift']());}};_0x99903a(++_0x11bade);}(_0x8700,0x112));var _0x0870=function(_0x56d036,_0x475943){_0x56d036=_0x56d036-0x0;var _0x3e776d=_0x8700[_0x56d036];return _0x3e776d;};'use strict';var express=require(_0x0870('0x0'));var router=express[_0x0870('0x1')]();var auth=require(_0x0870('0x2'));var controller=require(_0x0870('0x3'));router[_0x0870('0x4')]('/',auth[_0x0870('0x5')](),controller['index']);router['get'](_0x0870('0x6'),auth[_0x0870('0x5')](),controller[_0x0870('0x7')]);module[_0x0870('0x8')]=router; \ No newline at end of file +var _0xa1f8=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports'];(function(_0x52e2a3,_0x45ba83){var _0x4af452=function(_0x15fc43){while(--_0x15fc43){_0x52e2a3['push'](_0x52e2a3['shift']());}};_0x4af452(++_0x45ba83);}(_0xa1f8,0x1a8));var _0x8a1f=function(_0x5e6834,_0x2cee2b){_0x5e6834=_0x5e6834-0x0;var _0x320e22=_0xa1f8[_0x5e6834];return _0x320e22;};'use strict';var express=require('express');var router=express[_0x8a1f('0x0')]();var auth=require(_0x8a1f('0x1'));var controller=require(_0x8a1f('0x2'));router[_0x8a1f('0x3')]('/',auth[_0x8a1f('0x4')](),controller[_0x8a1f('0x5')]);router[_0x8a1f('0x3')](_0x8a1f('0x6'),auth[_0x8a1f('0x4')](),controller['killProcess']);module[_0x8a1f('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 06f0aab..f876b63 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 _0xefe9=['params','systeminformation','exec','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','status','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xefe9,0x83));var _0x9efe=function(_0x488fa6,_0x567d40){_0x488fa6=_0x488fa6-0x0;var _0x2d3045=_0xefe9[_0x488fa6];return _0x2d3045;};'use strict';var info=require(_0x9efe('0x0'));var exec=require('child_process')[_0x9efe('0x1')];var logger=require('../../config/logger')(_0x9efe('0x2'));var util=require(_0x9efe('0x3'));var BPromise=require('bluebird');var _=require(_0x9efe('0x4'));function handleError(_0x51b705,_0x13af43,_0x215663){_0x13af43=_0x13af43||0x1f4;return function(_0x159b4e){logger[_0x9efe('0x5')](_0x9efe('0x6'),_0x215663,_0x13af43,util[_0x9efe('0x7')](_0x159b4e,{'showHidden':![],'depth':null}));delete _0x159b4e[_0x9efe('0x8')];_0x51b705['status'](_0x13af43)[_0x9efe('0x9')](_0x159b4e);};}exports[_0x9efe('0xa')]=function(_0x25e36e,_0x1b3801){return info[_0x9efe('0xb')]()[_0x9efe('0xc')](function(_0x1d3a65){return _0x1b3801[_0x9efe('0xd')](0xc8)[_0x9efe('0xe')](_0x1d3a65);})[_0x9efe('0xf')](function(_0x512054){return _0x1b3801[_0x9efe('0xd')](0x1f4)[_0x9efe('0xe')](_0x512054);});};exports['killProcess']=function(_0x5e3473,_0x5336b5){var _0x2a7dad=[_0x9efe('0x10')];return new BPromise(function(_0x249453,_0x2b2a75){return exec(util[_0x9efe('0x11')](_0x9efe('0x12'),_0x5e3473['params'][_0x9efe('0x13')]),function(_0x54df74,_0x199594,_0x2e78f8){if(_0x54df74){return _0x2b2a75(_0x54df74);}return _0x249453(_0x199594);});})[_0x9efe('0xc')](function(_0x577595){var _0x46d54b=![];var _0x31e30b=_0x577595[_0x9efe('0x14')](/\n/);for(var _0x10ea32=0x0,_0x529357=_0x2a7dad['length'];_0x10ea32<_0x529357,_0x46d54b===![];_0x10ea32+=0x1){if(_0x577595[_0x9efe('0x15')](_0x2a7dad[_0x10ea32])>=0x0){_0x46d54b=!![];}}if(!_0x46d54b){throw new Error(util[_0x9efe('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5e3473['params'][_0x9efe('0x13')]));}process[_0x9efe('0x16')](_0x5e3473['params']['pid'],_0x9efe('0x17'));return _0x5336b5[_0x9efe('0xd')](0xc8)[_0x9efe('0xe')]({'message':util[_0x9efe('0x11')](_0x9efe('0x18'),_0x5e3473[_0x9efe('0x19')][_0x9efe('0x13')])});})[_0x9efe('0xf')](handleError(_0x5336b5,null,'killProcess'));}; \ No newline at end of file +var _0xdf9c=['bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','status','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdf9c,0x193));var _0xcdf9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdf9c[_0x42cae2];return _0x5f256f;};'use strict';var info=require(_0xcdf9('0x0'));var exec=require(_0xcdf9('0x1'))[_0xcdf9('0x2')];var logger=require('../../config/logger')(_0xcdf9('0x3'));var util=require(_0xcdf9('0x4'));var BPromise=require(_0xcdf9('0x5'));var _=require(_0xcdf9('0x6'));function handleError(_0x5ab497,_0x54daed,_0x305fc4){_0x54daed=_0x54daed||0x1f4;return function(_0x55008b){logger['error'](_0xcdf9('0x7'),_0x305fc4,_0x54daed,util['inspect'](_0x55008b,{'showHidden':![],'depth':null}));delete _0x55008b[_0xcdf9('0x8')];_0x5ab497['status'](_0x54daed)[_0xcdf9('0x9')](_0x55008b);};}exports['index']=function(_0x1eb4de,_0x17554d){return info[_0xcdf9('0xa')]()['then'](function(_0x27b72f){return _0x17554d[_0xcdf9('0xb')](0xc8)[_0xcdf9('0xc')](_0x27b72f);})[_0xcdf9('0xd')](function(_0x432838){return _0x17554d['status'](0x1f4)[_0xcdf9('0xc')](_0x432838);});};exports[_0xcdf9('0xe')]=function(_0x56bdf6,_0x51873c){var _0x4a3fae=['components/import/cm'];return new BPromise(function(_0x229444,_0x32edd0){return exec(util[_0xcdf9('0xf')](_0xcdf9('0x10'),_0x56bdf6[_0xcdf9('0x11')]['pid']),function(_0x1d1104,_0x487603,_0x3d92ba){if(_0x1d1104){return _0x32edd0(_0x1d1104);}return _0x229444(_0x487603);});})[_0xcdf9('0x12')](function(_0x58f80f){var _0x26c89a=![];var _0x4636cd=_0x58f80f[_0xcdf9('0x13')](/\n/);for(var _0x4b444c=0x0,_0x13e1e5=_0x4a3fae[_0xcdf9('0x14')];_0x4b444c<_0x13e1e5,_0x26c89a===![];_0x4b444c+=0x1){if(_0x58f80f['indexOf'](_0x4a3fae[_0x4b444c])>=0x0){_0x26c89a=!![];}}if(!_0x26c89a){throw new Error(util[_0xcdf9('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x56bdf6[_0xcdf9('0x11')][_0xcdf9('0x15')]));}process[_0xcdf9('0x16')](_0x56bdf6[_0xcdf9('0x11')][_0xcdf9('0x15')],'SIGINT');return _0x51873c['status'](0xc8)[_0xcdf9('0xc')]({'message':util[_0xcdf9('0xf')](_0xcdf9('0x17'),_0x56bdf6[_0xcdf9('0x11')]['pid'])});})['catch'](handleError(_0x51873c,null,_0xcdf9('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 56d9409..8b73a5c 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 _0x287f=['get','isAuthenticated','index','show','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x287f,0xc7));var _0xf287=function(_0x43448d,_0x4f82e8){_0x43448d=_0x43448d-0x0;var _0x3e5844=_0x287f[_0x43448d];return _0x3e5844;};'use strict';var multer=require(_0xf287('0x0'));var util=require(_0xf287('0x1'));var path=require(_0xf287('0x2'));var timeout=require(_0xf287('0x3'));var express=require(_0xf287('0x4'));var router=express[_0xf287('0x5')]();var fs_extra=require(_0xf287('0x6'));var auth=require(_0xf287('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf287('0x8'));var controller=require(_0xf287('0x9'));router[_0xf287('0xa')]('/',auth[_0xf287('0xb')](),controller[_0xf287('0xc')]);router['get']('/:id',auth[_0xf287('0xb')](),controller[_0xf287('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf287('0xe'),auth[_0xf287('0xb')](),controller[_0xf287('0xf')]);router[_0xf287('0x10')](_0xf287('0xe'),auth[_0xf287('0xb')](),controller[_0xf287('0x11')]);module[_0xf287('0x12')]=router; \ No newline at end of file +var _0x95ef=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer'];(function(_0x3945fc,_0x2d3f05){var _0x220a03=function(_0x2bcce0){while(--_0x2bcce0){_0x3945fc['push'](_0x3945fc['shift']());}};_0x220a03(++_0x2d3f05);}(_0x95ef,0x12a));var _0xf95e=function(_0x196ccc,_0x3460eb){_0x196ccc=_0x196ccc-0x0;var _0x25a939=_0x95ef[_0x196ccc];return _0x25a939;};'use strict';var multer=require(_0xf95e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf95e('0x1'));var auth=require(_0xf95e('0x2'));var interaction=require(_0xf95e('0x3'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xf95e('0x4')]('/',auth[_0xf95e('0x5')](),controller[_0xf95e('0x6')]);router[_0xf95e('0x4')](_0xf95e('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xf95e('0x8')]('/',auth['isAuthenticated'](),controller[_0xf95e('0x9')]);router['put'](_0xf95e('0x7'),auth[_0xf95e('0x5')](),controller[_0xf95e('0xa')]);router[_0xf95e('0xb')](_0xf95e('0x7'),auth[_0xf95e('0x5')](),controller['destroy']);module[_0xf95e('0xc')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 930336a..8dbc16a 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 _0xb84e=['STRING','name','exports'];(function(_0xe3fa84,_0x5350e1){var _0xcd29fe=function(_0x2bcc60){while(--_0x2bcc60){_0xe3fa84['push'](_0xe3fa84['shift']());}};_0xcd29fe(++_0x5350e1);}(_0xb84e,0xbf));var _0xeb84=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xb84e[_0x50a004];return _0x5e9992;};'use strict';var Sequelize=require('sequelize');module[_0xeb84('0x0')]={'name':{'type':Sequelize[_0xeb84('0x1')],'unique':_0xeb84('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb84('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x81fa=['#0091EA','sequelize','exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81fa,0xdd));var _0xa81f=function(_0x26a490,_0x1d54cf){_0x26a490=_0x26a490-0x0;var _0x4f14c1=_0x81fa[_0x26a490];return _0x4f14c1;};'use strict';var Sequelize=require(_0xa81f('0x0'));module[_0xa81f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa81f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa81f('0x3')],'defaultValue':_0xa81f('0x4')},'description':{'type':Sequelize[_0xa81f('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1a7108b..453560f 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 _0xb4e6=['findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','get','UserProfileResource','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Tag','includeAll','include'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xb4e6[_0x3b4b1d];return _0x488c36;};'use strict';var emlformat=require(_0x6b4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b4e('0x1'));var jsonpatch=require(_0x6b4e('0x2'));var rp=require(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var Mustache=require(_0x6b4e('0x6'));var util=require(_0x6b4e('0x7'));var path=require('path');var sox=require(_0x6b4e('0x8'));var csv=require(_0x6b4e('0x9'));var ejs=require(_0x6b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var as=require(_0x6b4e('0x12'));var hardwareService=require(_0x6b4e('0x13'));var logger=require('../../config/logger')(_0x6b4e('0x14'));var utils=require(_0x6b4e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b4e('0x16'));var db=require(_0x6b4e('0x17'))['db'];function respondWithStatusCode(_0x432399,_0x2b2ce0){_0x2b2ce0=_0x2b2ce0||0xcc;return function(_0x9f8f6c){if(_0x9f8f6c){return _0x432399[_0x6b4e('0x18')](_0x2b2ce0);}return _0x432399[_0x6b4e('0x19')](_0x2b2ce0)['end']();};}function respondWithResult(_0x36f8a5,_0x29bdee){_0x29bdee=_0x29bdee||0xc8;return function(_0x4788cf){if(_0x4788cf){return _0x36f8a5[_0x6b4e('0x19')](_0x29bdee)['json'](_0x4788cf);}};}function respondWithFilteredResult(_0x355f10,_0x2195c1){return function(_0x3ba513){if(_0x3ba513){var _0x42e265=typeof _0x2195c1[_0x6b4e('0x1a')]===_0x6b4e('0x1b')&&typeof _0x2195c1['limit']==='undefined';var _0x67496d=_0x3ba513[_0x6b4e('0x1c')];var _0x10d2b1=_0x42e265?0x0:_0x2195c1[_0x6b4e('0x1a')];var _0x101d0a=_0x42e265?_0x3ba513[_0x6b4e('0x1c')]:_0x2195c1[_0x6b4e('0x1a')]+_0x2195c1[_0x6b4e('0x1d')];var _0x35aee1;if(_0x101d0a>=_0x67496d){_0x101d0a=_0x67496d;_0x35aee1=0xc8;}else{_0x35aee1=0xce;}_0x355f10[_0x6b4e('0x19')](_0x35aee1);return _0x355f10[_0x6b4e('0x1e')]('Content-Range',_0x10d2b1+'-'+_0x101d0a+'/'+_0x67496d)[_0x6b4e('0x1f')](_0x3ba513);}return null;};}function patchUpdates(_0x248fea){return function(_0x31fb9d){try{jsonpatch[_0x6b4e('0x20')](_0x31fb9d,_0x248fea,!![]);}catch(_0x5e5dcd){return BPromise[_0x6b4e('0x21')](_0x5e5dcd);}return _0x31fb9d['save']();};}function saveUpdates(_0x2503a5,_0x163dea){return function(_0x165a99){if(_0x165a99){return _0x165a99[_0x6b4e('0x22')](_0x2503a5)[_0x6b4e('0x23')](function(_0x346566){return _0x346566;});}return null;};}function removeEntity(_0x3e636f,_0x5c33be){return function(_0x2e36db){if(_0x2e36db){return _0x2e36db['destroy']()[_0x6b4e('0x23')](function(){var _0x884b7e=_0x2e36db[_0x6b4e('0x24')]({'plain':!![]});var _0xdba4fe='Tags';return db[_0x6b4e('0x25')][_0x6b4e('0x26')]({'where':{'type':_0xdba4fe,'resourceId':_0x884b7e['id']}})['then'](function(){return _0x2e36db;});})[_0x6b4e('0x23')](function(){_0x3e636f[_0x6b4e('0x19')](0xcc)[_0x6b4e('0x27')]();});}};}function handleEntityNotFound(_0x44b399,_0x5bfe9e){return function(_0x2d42be){if(!_0x2d42be){_0x44b399[_0x6b4e('0x18')](0x194);}return _0x2d42be;};}function handleError(_0x57650d,_0x130c21){_0x130c21=_0x130c21||0x1f4;return function(_0x453beb){logger[_0x6b4e('0x28')](_0x453beb[_0x6b4e('0x29')]);if(_0x453beb['name']){delete _0x453beb[_0x6b4e('0x2a')];}_0x57650d[_0x6b4e('0x19')](_0x130c21)['send'](_0x453beb);};}exports[_0x6b4e('0x2b')]=function(_0x3f9868,_0x37b636){var _0x53c242={},_0x5c2200={},_0x11156e={'count':0x0,'rows':[]};var _0x2e6414=_[_0x6b4e('0x2c')](db['Tag'][_0x6b4e('0x2d')],function(_0x421177){return{'name':_0x421177[_0x6b4e('0x2e')],'type':_0x421177['type']['key']};});_0x5c2200[_0x6b4e('0x2f')]=_['map'](_0x2e6414,_0x6b4e('0x2a'));_0x5c2200[_0x6b4e('0x30')]=_['keys'](_0x3f9868[_0x6b4e('0x30')]);_0x5c2200[_0x6b4e('0x31')]=_[_0x6b4e('0x32')](_0x5c2200[_0x6b4e('0x2f')],_0x5c2200['query']);_0x53c242['attributes']=_[_0x6b4e('0x32')](_0x5c2200[_0x6b4e('0x2f')],qs[_0x6b4e('0x33')](_0x3f9868[_0x6b4e('0x30')][_0x6b4e('0x33')]));_0x53c242[_0x6b4e('0x34')]=_0x53c242[_0x6b4e('0x34')][_0x6b4e('0x35')]?_0x53c242[_0x6b4e('0x34')]:_0x5c2200[_0x6b4e('0x2f')];if(!_0x3f9868[_0x6b4e('0x30')][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x53c242['limit']=qs[_0x6b4e('0x1d')](_0x3f9868[_0x6b4e('0x30')][_0x6b4e('0x1d')]);_0x53c242['offset']=qs[_0x6b4e('0x1a')](_0x3f9868['query'][_0x6b4e('0x1a')]);}_0x53c242[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x3f9868['query']['sort']);_0x53c242[_0x6b4e('0x3a')]=qs[_0x6b4e('0x31')](_['pick'](_0x3f9868['query'],_0x5c2200[_0x6b4e('0x31')]),_0x2e6414);if(_0x3f9868[_0x6b4e('0x30')][_0x6b4e('0x3b')]){_0x53c242[_0x6b4e('0x3a')]=_[_0x6b4e('0x3c')](_0x53c242[_0x6b4e('0x3a')],{'$or':_[_0x6b4e('0x2c')](_0x2e6414,function(_0xc3f4e4){if(_0xc3f4e4[_0x6b4e('0x3d')]!==_0x6b4e('0x3e')){var _0x1f2c38={};_0x1f2c38[_0xc3f4e4['name']]={'$like':'%'+_0x3f9868[_0x6b4e('0x30')][_0x6b4e('0x3b')]+'%'};return _0x1f2c38;}})});}_0x53c242=_['merge']({},_0x53c242,_0x3f9868[_0x6b4e('0x3f')]);var _0x29353b={'where':_0x53c242[_0x6b4e('0x3a')]};return db[_0x6b4e('0x40')][_0x6b4e('0x1c')](_0x29353b)['then'](function(_0x4e545c){_0x11156e[_0x6b4e('0x1c')]=_0x4e545c;if(_0x3f9868['query'][_0x6b4e('0x41')]){_0x53c242[_0x6b4e('0x42')]=[{'all':!![]}];}return db['Tag'][_0x6b4e('0x43')](_0x53c242);})['then'](function(_0x3dec0f){_0x11156e['rows']=_0x3dec0f;return _0x11156e;})[_0x6b4e('0x23')](respondWithFilteredResult(_0x37b636,_0x53c242))[_0x6b4e('0x44')](handleError(_0x37b636,null));};exports[_0x6b4e('0x45')]=function(_0x30401b,_0x555be1){var _0x17185e={'raw':!![],'where':{'id':_0x30401b[_0x6b4e('0x46')]['id']}},_0x244a9f={};_0x244a9f['model']=_[_0x6b4e('0x47')](db[_0x6b4e('0x40')][_0x6b4e('0x2d')]);_0x244a9f[_0x6b4e('0x30')]=_[_0x6b4e('0x47')](_0x30401b[_0x6b4e('0x30')]);_0x244a9f[_0x6b4e('0x31')]=_[_0x6b4e('0x32')](_0x244a9f[_0x6b4e('0x2f')],_0x244a9f['query']);_0x17185e[_0x6b4e('0x34')]=_[_0x6b4e('0x32')](_0x244a9f[_0x6b4e('0x2f')],qs[_0x6b4e('0x33')](_0x30401b[_0x6b4e('0x30')]['fields']));_0x17185e[_0x6b4e('0x34')]=_0x17185e['attributes'][_0x6b4e('0x35')]?_0x17185e[_0x6b4e('0x34')]:_0x244a9f[_0x6b4e('0x2f')];if(_0x30401b[_0x6b4e('0x30')]['includeAll']){_0x17185e[_0x6b4e('0x42')]=[{'all':!![]}];}_0x17185e=_[_0x6b4e('0x3c')]({},_0x17185e,_0x30401b[_0x6b4e('0x3f')]);return db['Tag'][_0x6b4e('0x48')](_0x17185e)[_0x6b4e('0x23')](handleEntityNotFound(_0x555be1,null))[_0x6b4e('0x23')](respondWithResult(_0x555be1,null))[_0x6b4e('0x44')](handleError(_0x555be1,null));};exports[_0x6b4e('0x49')]=function(_0x33c797,_0x289dfa){return db[_0x6b4e('0x40')][_0x6b4e('0x49')](_0x33c797[_0x6b4e('0x4a')],{})['then'](function(_0x2106fb){var _0x1527f1=_0x33c797[_0x6b4e('0x4b')]['get']({'plain':!![]});if(!_0x1527f1)throw new Error(_0x6b4e('0x4c'));if(_0x1527f1[_0x6b4e('0x4d')]===_0x6b4e('0x4b')){var _0x738ee5=_0x2106fb[_0x6b4e('0x24')]({'plain':!![]});var _0x104c2a=_0x6b4e('0x4e');return db[_0x6b4e('0x4f')][_0x6b4e('0x48')]({'where':{'name':_0x104c2a,'userProfileId':_0x1527f1[_0x6b4e('0x50')]},'raw':!![]})[_0x6b4e('0x23')](function(_0x49f81a){if(_0x49f81a&&_0x49f81a['autoAssociation']===0x0){return db[_0x6b4e('0x25')][_0x6b4e('0x49')]({'name':_0x738ee5[_0x6b4e('0x2a')],'resourceId':_0x738ee5['id'],'type':_0x49f81a[_0x6b4e('0x2a')],'sectionId':_0x49f81a['id']},{})['then'](function(){return _0x2106fb;});}else{return _0x2106fb;}})[_0x6b4e('0x44')](function(_0x31071f){logger[_0x6b4e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31071f);throw _0x31071f;});}return _0x2106fb;})[_0x6b4e('0x23')](respondWithResult(_0x289dfa,0xc9))[_0x6b4e('0x44')](handleError(_0x289dfa,null));};exports[_0x6b4e('0x22')]=function(_0x282c4d,_0x3ce7b8){if(_0x282c4d['body']['id']){delete _0x282c4d[_0x6b4e('0x4a')]['id'];}return db['Tag'][_0x6b4e('0x48')]({'where':{'id':_0x282c4d[_0x6b4e('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ce7b8,null))[_0x6b4e('0x23')](saveUpdates(_0x282c4d['body'],null))[_0x6b4e('0x23')](respondWithResult(_0x3ce7b8,null))[_0x6b4e('0x44')](handleError(_0x3ce7b8,null));};exports[_0x6b4e('0x26')]=function(_0x3bd916,_0x11b868){return db['Tag'][_0x6b4e('0x48')]({'where':{'id':_0x3bd916[_0x6b4e('0x46')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x11b868,null))['then'](removeEntity(_0x11b868,null))['catch'](handleError(_0x11b868,null));}; \ No newline at end of file +var _0xc3fe=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','status','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','body','params'];(function(_0x35bb83,_0x58b2e5){var _0x502be6=function(_0x34463b){while(--_0x34463b){_0x35bb83['push'](_0x35bb83['shift']());}};_0x502be6(++_0x58b2e5);}(_0xc3fe,0xff));var _0xec3f=function(_0x301ba4,_0x5d6c25){_0x301ba4=_0x301ba4-0x0;var _0x581a9d=_0xc3fe[_0x301ba4];return _0x581a9d;};'use strict';var emlformat=require(_0xec3f('0x0'));var rimraf=require(_0xec3f('0x1'));var zipdir=require(_0xec3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3f('0x3'));var moment=require(_0xec3f('0x4'));var BPromise=require(_0xec3f('0x5'));var Mustache=require('mustache');var util=require(_0xec3f('0x6'));var path=require(_0xec3f('0x7'));var sox=require(_0xec3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3f('0x9'));var _=require(_0xec3f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec3f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec3f('0xc'));var querystring=require(_0xec3f('0xd'));var Papa=require(_0xec3f('0xe'));var Redis=require(_0xec3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec3f('0x10'));var as=require(_0xec3f('0x11'));var hardwareService=require(_0xec3f('0x12'));var logger=require(_0xec3f('0x13'))(_0xec3f('0x14'));var utils=require(_0xec3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec3f('0x16'));var db=require(_0xec3f('0x17'))['db'];function respondWithStatusCode(_0x367c5e,_0x57891d){_0x57891d=_0x57891d||0xcc;return function(_0x5367df){if(_0x5367df){return _0x367c5e[_0xec3f('0x18')](_0x57891d);}return _0x367c5e['status'](_0x57891d)['end']();};}function respondWithResult(_0x209ffa,_0x4318bd){_0x4318bd=_0x4318bd||0xc8;return function(_0x113d16){if(_0x113d16){return _0x209ffa['status'](_0x4318bd)['json'](_0x113d16);}};}function respondWithFilteredResult(_0x5509ec,_0x5ad65a){return function(_0x37d688){if(_0x37d688){var _0x10ff81=typeof _0x5ad65a['offset']===_0xec3f('0x19')&&typeof _0x5ad65a[_0xec3f('0x1a')]===_0xec3f('0x19');var _0x3b7393=_0x37d688['count'];var _0x7805c=_0x10ff81?0x0:_0x5ad65a[_0xec3f('0x1b')];var _0x2d338=_0x10ff81?_0x37d688[_0xec3f('0x1c')]:_0x5ad65a[_0xec3f('0x1b')]+_0x5ad65a['limit'];var _0x2f8bc8;if(_0x2d338>=_0x3b7393){_0x2d338=_0x3b7393;_0x2f8bc8=0xc8;}else{_0x2f8bc8=0xce;}_0x5509ec['status'](_0x2f8bc8);return _0x5509ec[_0xec3f('0x1d')](_0xec3f('0x1e'),_0x7805c+'-'+_0x2d338+'/'+_0x3b7393)[_0xec3f('0x1f')](_0x37d688);}return null;};}function patchUpdates(_0x47b6f9){return function(_0x526ff){try{jsonpatch[_0xec3f('0x20')](_0x526ff,_0x47b6f9,!![]);}catch(_0x4fdfc3){return BPromise[_0xec3f('0x21')](_0x4fdfc3);}return _0x526ff[_0xec3f('0x22')]();};}function saveUpdates(_0x1f173f,_0x395b9a){return function(_0x4d9598){if(_0x4d9598){return _0x4d9598[_0xec3f('0x23')](_0x1f173f)[_0xec3f('0x24')](function(_0x2f45bb){return _0x2f45bb;});}return null;};}function removeEntity(_0x4e4770,_0xfc9c0d){return function(_0x4b5932){if(_0x4b5932){return _0x4b5932[_0xec3f('0x25')]()['then'](function(){var _0x56ecc3=_0x4b5932[_0xec3f('0x26')]({'plain':!![]});var _0x482bf2=_0xec3f('0x27');return db[_0xec3f('0x28')][_0xec3f('0x25')]({'where':{'type':_0x482bf2,'resourceId':_0x56ecc3['id']}})['then'](function(){return _0x4b5932;});})[_0xec3f('0x24')](function(){_0x4e4770[_0xec3f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53cc0d,_0x3e5244){return function(_0x48e166){if(!_0x48e166){_0x53cc0d[_0xec3f('0x18')](0x194);}return _0x48e166;};}function handleError(_0x1b3155,_0x358fcd){_0x358fcd=_0x358fcd||0x1f4;return function(_0x2eac8d){logger[_0xec3f('0x2a')](_0x2eac8d[_0xec3f('0x2b')]);if(_0x2eac8d[_0xec3f('0x2c')]){delete _0x2eac8d[_0xec3f('0x2c')];}_0x1b3155['status'](_0x358fcd)[_0xec3f('0x2d')](_0x2eac8d);};}exports[_0xec3f('0x2e')]=function(_0x4bfff2,_0x91c11a){var _0xb6da0={},_0x328284={},_0x185b20={'count':0x0,'rows':[]};var _0x26fb2a=_[_0xec3f('0x2f')](db[_0xec3f('0x30')][_0xec3f('0x31')],function(_0x32a522){return{'name':_0x32a522[_0xec3f('0x32')],'type':_0x32a522[_0xec3f('0x33')][_0xec3f('0x34')]};});_0x328284[_0xec3f('0x35')]=_[_0xec3f('0x2f')](_0x26fb2a,_0xec3f('0x2c'));_0x328284['query']=_[_0xec3f('0x36')](_0x4bfff2[_0xec3f('0x37')]);_0x328284[_0xec3f('0x38')]=_[_0xec3f('0x39')](_0x328284[_0xec3f('0x35')],_0x328284['query']);_0xb6da0[_0xec3f('0x3a')]=_[_0xec3f('0x39')](_0x328284[_0xec3f('0x35')],qs['fields'](_0x4bfff2['query'][_0xec3f('0x3b')]));_0xb6da0['attributes']=_0xb6da0[_0xec3f('0x3a')]['length']?_0xb6da0[_0xec3f('0x3a')]:_0x328284['model'];if(!_0x4bfff2['query'][_0xec3f('0x3c')](_0xec3f('0x3d'))){_0xb6da0[_0xec3f('0x1a')]=qs[_0xec3f('0x1a')](_0x4bfff2[_0xec3f('0x37')][_0xec3f('0x1a')]);_0xb6da0['offset']=qs['offset'](_0x4bfff2[_0xec3f('0x37')][_0xec3f('0x1b')]);}_0xb6da0[_0xec3f('0x3e')]=qs[_0xec3f('0x3f')](_0x4bfff2[_0xec3f('0x37')][_0xec3f('0x3f')]);_0xb6da0[_0xec3f('0x40')]=qs['filters'](_[_0xec3f('0x41')](_0x4bfff2['query'],_0x328284[_0xec3f('0x38')]),_0x26fb2a);if(_0x4bfff2[_0xec3f('0x37')][_0xec3f('0x42')]){_0xb6da0[_0xec3f('0x40')]=_[_0xec3f('0x43')](_0xb6da0[_0xec3f('0x40')],{'$or':_[_0xec3f('0x2f')](_0x26fb2a,function(_0x17722c){if(_0x17722c[_0xec3f('0x33')]!==_0xec3f('0x44')){var _0x38a9e3={};_0x38a9e3[_0x17722c[_0xec3f('0x2c')]]={'$like':'%'+_0x4bfff2[_0xec3f('0x37')]['filter']+'%'};return _0x38a9e3;}})});}_0xb6da0=_[_0xec3f('0x43')]({},_0xb6da0,_0x4bfff2[_0xec3f('0x45')]);var _0x4b416d={'where':_0xb6da0[_0xec3f('0x40')]};return db[_0xec3f('0x30')]['count'](_0x4b416d)[_0xec3f('0x24')](function(_0xae1b8a){_0x185b20[_0xec3f('0x1c')]=_0xae1b8a;if(_0x4bfff2[_0xec3f('0x37')][_0xec3f('0x46')]){_0xb6da0[_0xec3f('0x47')]=[{'all':!![]}];}return db['Tag'][_0xec3f('0x48')](_0xb6da0);})[_0xec3f('0x24')](function(_0x1c6494){_0x185b20[_0xec3f('0x49')]=_0x1c6494;return _0x185b20;})[_0xec3f('0x24')](respondWithFilteredResult(_0x91c11a,_0xb6da0))[_0xec3f('0x4a')](handleError(_0x91c11a,null));};exports[_0xec3f('0x4b')]=function(_0x18c560,_0x42d1ae){var _0x5f4033={'raw':!![],'where':{'id':_0x18c560['params']['id']}},_0x8d0f18={};_0x8d0f18[_0xec3f('0x35')]=_[_0xec3f('0x36')](db[_0xec3f('0x30')][_0xec3f('0x31')]);_0x8d0f18[_0xec3f('0x37')]=_[_0xec3f('0x36')](_0x18c560[_0xec3f('0x37')]);_0x8d0f18[_0xec3f('0x38')]=_[_0xec3f('0x39')](_0x8d0f18[_0xec3f('0x35')],_0x8d0f18[_0xec3f('0x37')]);_0x5f4033[_0xec3f('0x3a')]=_['intersection'](_0x8d0f18[_0xec3f('0x35')],qs[_0xec3f('0x3b')](_0x18c560['query'][_0xec3f('0x3b')]));_0x5f4033[_0xec3f('0x3a')]=_0x5f4033[_0xec3f('0x3a')][_0xec3f('0x4c')]?_0x5f4033['attributes']:_0x8d0f18['model'];if(_0x18c560[_0xec3f('0x37')][_0xec3f('0x46')]){_0x5f4033['include']=[{'all':!![]}];}_0x5f4033=_[_0xec3f('0x43')]({},_0x5f4033,_0x18c560[_0xec3f('0x45')]);return db[_0xec3f('0x30')]['find'](_0x5f4033)[_0xec3f('0x24')](handleEntityNotFound(_0x42d1ae,null))['then'](respondWithResult(_0x42d1ae,null))['catch'](handleError(_0x42d1ae,null));};exports['create']=function(_0x97c57d,_0x1b7cf6){return db[_0xec3f('0x30')][_0xec3f('0x4d')](_0x97c57d['body'],{})[_0xec3f('0x24')](function(_0x54673e){var _0x5af435=_0x97c57d[_0xec3f('0x4e')][_0xec3f('0x26')]({'plain':!![]});if(!_0x5af435)throw new Error(_0xec3f('0x4f'));if(_0x5af435[_0xec3f('0x50')]===_0xec3f('0x4e')){var _0x515bf2=_0x54673e[_0xec3f('0x26')]({'plain':!![]});var _0x56e5c2=_0xec3f('0x27');return db['UserProfileSection'][_0xec3f('0x51')]({'where':{'name':_0x56e5c2,'userProfileId':_0x5af435['userProfileId']},'raw':!![]})[_0xec3f('0x24')](function(_0x370660){if(_0x370660&&_0x370660[_0xec3f('0x52')]===0x0){return db[_0xec3f('0x28')][_0xec3f('0x4d')]({'name':_0x515bf2[_0xec3f('0x2c')],'resourceId':_0x515bf2['id'],'type':_0x370660[_0xec3f('0x2c')],'sectionId':_0x370660['id']},{})[_0xec3f('0x24')](function(){return _0x54673e;});}else{return _0x54673e;}})['catch'](function(_0x230aad){logger[_0xec3f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x230aad);throw _0x230aad;});}return _0x54673e;})[_0xec3f('0x24')](respondWithResult(_0x1b7cf6,0xc9))['catch'](handleError(_0x1b7cf6,null));};exports[_0xec3f('0x23')]=function(_0x4cc474,_0x3d1767){if(_0x4cc474['body']['id']){delete _0x4cc474[_0xec3f('0x53')]['id'];}return db['Tag'][_0xec3f('0x51')]({'where':{'id':_0x4cc474[_0xec3f('0x54')]['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x3d1767,null))[_0xec3f('0x24')](saveUpdates(_0x4cc474[_0xec3f('0x53')],null))[_0xec3f('0x24')](respondWithResult(_0x3d1767,null))['catch'](handleError(_0x3d1767,null));};exports[_0xec3f('0x25')]=function(_0x584c68,_0x13825e){return db[_0xec3f('0x30')][_0xec3f('0x51')]({'where':{'id':_0x584c68[_0xec3f('0x54')]['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x13825e,null))[_0xec3f('0x24')](removeEntity(_0x13825e,null))[_0xec3f('0x4a')](handleError(_0x13825e,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 50106c7..60a3e6e 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 _0x2617=['tools_tags','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','Tag'];(function(_0x3ee9b1,_0xbc78c7){var _0x583028=function(_0x20f6da){while(--_0x20f6da){_0x3ee9b1['push'](_0x3ee9b1['shift']());}};_0x583028(++_0xbc78c7);}(_0x2617,0x175));var _0x7261=function(_0x13e758,_0x231d3c){_0x13e758=_0x13e758-0x0;var _0x55df43=_0x2617[_0x13e758];return _0x55df43;};'use strict';var _=require(_0x7261('0x0'));var util=require('util');var logger=require(_0x7261('0x1'))(_0x7261('0x2'));var moment=require(_0x7261('0x3'));var BPromise=require(_0x7261('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7261('0x5'));var rimraf=require(_0x7261('0x6'));var config=require(_0x7261('0x7'));var attributes=require(_0x7261('0x8'));module[_0x7261('0x9')]=function(_0xd9f836,_0x6f8c17){return _0xd9f836['define'](_0x7261('0xa'),attributes,{'tableName':_0x7261('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc534=['request-promise','rimraf','./tag.attributes','exports','define','Tag','tools_tags','util','../../config/logger','moment','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc534,0x1ca));var _0x4c53=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0xc534[_0x294726];return _0x39e2e3;};'use strict';var _=require('lodash');var util=require(_0x4c53('0x0'));var logger=require(_0x4c53('0x1'))('api');var moment=require(_0x4c53('0x2'));var BPromise=require(_0x4c53('0x3'));var rp=require(_0x4c53('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c53('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c53('0x6'));module[_0x4c53('0x7')]=function(_0x424af0,_0x4432cd){return _0x424af0[_0x4c53('0x8')](_0x4c53('0x9'),attributes,{'tableName':_0x4c53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 47396f2..313cc52 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 _0x3140=['jayson/promise','client','http','request','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d145c,_0x2e9c93){var _0x4382c6=function(_0x172729){while(--_0x172729){_0x2d145c['push'](_0x2d145c['shift']());}};_0x4382c6(++_0x2e9c93);}(_0x3140,0xaf));var _0x0314=function(_0x5c2c72,_0x22cf09){_0x5c2c72=_0x5c2c72-0x0;var _0x11c44c=_0x3140[_0x5c2c72];return _0x11c44c;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Tag,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});} \ No newline at end of file +var _0xfa2b=['jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ff56f,_0x5305c1){var _0x21da2e=function(_0xbe72bb){while(--_0xbe72bb){_0x3ff56f['push'](_0x3ff56f['shift']());}};_0x21da2e(++_0x5305c1);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2bbe76,_0x240581){_0x2bbe76=_0x2bbe76-0x0;var _0x324ebf=_0xfa2b[_0x2bbe76];return _0x324ebf;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Tag,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Tag,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 46530a2..7360b34 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 beb9af8..f82d9c9 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 _0x0713=['STRING','name'];(function(_0x2f98d4,_0x533fd7){var _0xf199dc=function(_0x4efa7f){while(--_0x4efa7f){_0x2f98d4['push'](_0x2f98d4['shift']());}};_0xf199dc(++_0x533fd7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_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/team/team.controller.js b/server/api/team/team.controller.js index a07d4de..db7fff4 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 _0x9629=['save','update','then','name','send','index','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','Team','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','channel','ValidationError','Unknown\x20channel','keys','capitalize','Queue','toLowerCase','Queues','addQueues','findOne','isValidChannel','removeQueues','ids','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','through','penalty','Voice','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','online','voicePause','interface','upsert','isNil','SIP/%s','all','TeamVoicePrefix','spread','removeAgents','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject'];(function(_0x30bc55,_0x86c98f){var _0x58d155=function(_0x451e81){while(--_0x451e81){_0x30bc55['push'](_0x30bc55['shift']());}};_0x58d155(++_0x86c98f);}(_0x9629,0x71));var _0x9962=function(_0x5e29a4,_0x20b60e){_0x5e29a4=_0x5e29a4-0x0;var _0x47f669=_0x9629[_0x5e29a4];return _0x47f669;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9962('0x0'));var zipdir=require(_0x9962('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9962('0x2'));var moment=require('moment');var BPromise=require(_0x9962('0x3'));var Mustache=require('mustache');var util=require(_0x9962('0x4'));var path=require(_0x9962('0x5'));var sox=require(_0x9962('0x6'));var csv=require(_0x9962('0x7'));var ejs=require(_0x9962('0x8'));var fs=require('fs');var fs_extra=require(_0x9962('0x9'));var _=require('lodash');var squel=require(_0x9962('0xa'));var crypto=require(_0x9962('0xb'));var jsforce=require(_0x9962('0xc'));var deskjs=require(_0x9962('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9962('0xe'));var Papa=require('papaparse');var Redis=require(_0x9962('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9962('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9962('0x11'))(_0x9962('0x12'));var utils=require('../../config/utils');var config=require(_0x9962('0x13'));var licenseUtil=require(_0x9962('0x14'));var db=require('../../mysqldb')['db'];config[_0x9962('0x15')]=_[_0x9962('0x16')](config[_0x9962('0x15')],{'host':_0x9962('0x17'),'port':0x18eb});var socket=require(_0x9962('0x18'))(new Redis(config[_0x9962('0x15')]));require('./team.socket')[_0x9962('0x19')](socket);function respondWithStatusCode(_0x55f405,_0x216c8e){_0x216c8e=_0x216c8e||0xcc;return function(_0x4941b1){if(_0x4941b1){return _0x55f405[_0x9962('0x1a')](_0x216c8e);}return _0x55f405['status'](_0x216c8e)[_0x9962('0x1b')]();};}function respondWithResult(_0x220c2d,_0x5a2217){_0x5a2217=_0x5a2217||0xc8;return function(_0x12759f){if(_0x12759f){return _0x220c2d[_0x9962('0x1c')](_0x5a2217)[_0x9962('0x1d')](_0x12759f);}};}function respondWithFilteredResult(_0x556364,_0x3afcb0){return function(_0x4d43ff){if(_0x4d43ff){var _0x4eff98=typeof _0x3afcb0[_0x9962('0x1e')]===_0x9962('0x1f')&&typeof _0x3afcb0['limit']===_0x9962('0x1f');var _0x475964=_0x4d43ff[_0x9962('0x20')];var _0x534271=_0x4eff98?0x0:_0x3afcb0[_0x9962('0x1e')];var _0x58b779=_0x4eff98?_0x4d43ff[_0x9962('0x20')]:_0x3afcb0[_0x9962('0x1e')]+_0x3afcb0[_0x9962('0x21')];var _0x5aea11;if(_0x58b779>=_0x475964){_0x58b779=_0x475964;_0x5aea11=0xc8;}else{_0x5aea11=0xce;}_0x556364['status'](_0x5aea11);return _0x556364['set'](_0x9962('0x22'),_0x534271+'-'+_0x58b779+'/'+_0x475964)[_0x9962('0x1d')](_0x4d43ff);}return null;};}function patchUpdates(_0x1e240c){return function(_0x4e5e93){try{jsonpatch['apply'](_0x4e5e93,_0x1e240c,!![]);}catch(_0x3478c1){return BPromise[_0x9962('0x23')](_0x3478c1);}return _0x4e5e93[_0x9962('0x24')]();};}function saveUpdates(_0x45c446,_0x38d95a){return function(_0x33c8fd){if(_0x33c8fd){return _0x33c8fd[_0x9962('0x25')](_0x45c446)[_0x9962('0x26')](function(_0x55ae1e){return _0x55ae1e;});}return null;};}function handleEntityNotFound(_0x4cb6e6,_0x224a4a){return function(_0x4b98c5){if(!_0x4b98c5){_0x4cb6e6[_0x9962('0x1a')](0x194);}return _0x4b98c5;};}function handleError(_0x508e1e,_0x1d6734){_0x1d6734=_0x1d6734||0x1f4;return function(_0x512872){logger['error'](_0x512872['stack']);if(_0x512872[_0x9962('0x27')]){delete _0x512872[_0x9962('0x27')];}_0x508e1e[_0x9962('0x1c')](_0x1d6734)[_0x9962('0x28')](_0x512872);};}exports[_0x9962('0x29')]=function(_0x494ac3,_0x2a3ef0){var _0x38e986={},_0xcb5e87={},_0x243003={'count':0x0,'rows':[]};var _0x4107b1=_['map'](db['Team'][_0x9962('0x2a')],function(_0x9be9d5){return{'name':_0x9be9d5[_0x9962('0x2b')],'type':_0x9be9d5['type']['key']};});_0xcb5e87['model']=_[_0x9962('0x2c')](_0x4107b1,_0x9962('0x27'));_0xcb5e87[_0x9962('0x2d')]=_['keys'](_0x494ac3[_0x9962('0x2d')]);_0xcb5e87[_0x9962('0x2e')]=_[_0x9962('0x2f')](_0xcb5e87[_0x9962('0x30')],_0xcb5e87[_0x9962('0x2d')]);_0x38e986[_0x9962('0x31')]=_['intersection'](_0xcb5e87[_0x9962('0x30')],qs['fields'](_0x494ac3[_0x9962('0x2d')][_0x9962('0x32')]));_0x38e986[_0x9962('0x31')]=_0x38e986[_0x9962('0x31')][_0x9962('0x33')]?_0x38e986[_0x9962('0x31')]:_0xcb5e87[_0x9962('0x30')];if(!_0x494ac3[_0x9962('0x2d')][_0x9962('0x34')](_0x9962('0x35'))){_0x38e986[_0x9962('0x21')]=qs['limit'](_0x494ac3[_0x9962('0x2d')]['limit']);_0x38e986[_0x9962('0x1e')]=qs[_0x9962('0x1e')](_0x494ac3[_0x9962('0x2d')][_0x9962('0x1e')]);}_0x38e986[_0x9962('0x36')]=qs[_0x9962('0x37')](_0x494ac3[_0x9962('0x2d')][_0x9962('0x37')]);_0x38e986['where']=qs['filters'](_[_0x9962('0x38')](_0x494ac3[_0x9962('0x2d')],_0xcb5e87[_0x9962('0x2e')]),_0x4107b1);if(_0x494ac3[_0x9962('0x2d')]['filter']){_0x38e986[_0x9962('0x39')]=_['merge'](_0x38e986['where'],{'$or':_[_0x9962('0x2c')](_0x4107b1,function(_0x299b16){if(_0x299b16[_0x9962('0x3a')]!==_0x9962('0x3b')){var _0x3f5f12={};_0x3f5f12[_0x299b16[_0x9962('0x27')]]={'$like':'%'+_0x494ac3[_0x9962('0x2d')][_0x9962('0x3c')]+'%'};return _0x3f5f12;}})});}_0x38e986=_[_0x9962('0x3d')]({},_0x38e986,_0x494ac3['options']);var _0xf49537={'where':_0x38e986['where']};return db['Team'][_0x9962('0x20')](_0xf49537)[_0x9962('0x26')](function(_0x2cf408){_0x243003[_0x9962('0x20')]=_0x2cf408;if(_0x494ac3[_0x9962('0x2d')][_0x9962('0x3e')]){_0x38e986[_0x9962('0x3f')]=[{'all':!![]}];}return db['Team'][_0x9962('0x40')](_0x38e986);})[_0x9962('0x26')](function(_0x447037){_0x243003[_0x9962('0x41')]=_0x447037;return _0x243003;})['then'](respondWithFilteredResult(_0x2a3ef0,_0x38e986))[_0x9962('0x42')](handleError(_0x2a3ef0,null));};exports[_0x9962('0x43')]=function(_0x2d54fe,_0x87d1c9){var _0x38782b={'raw':![],'where':{'id':_0x2d54fe[_0x9962('0x44')]['id']}},_0x41dbad={};_0x41dbad[_0x9962('0x30')]=_['keys'](db[_0x9962('0x45')]['rawAttributes']);_0x41dbad[_0x9962('0x2d')]=_['keys'](_0x2d54fe[_0x9962('0x2d')]);_0x41dbad[_0x9962('0x2e')]=_[_0x9962('0x2f')](_0x41dbad[_0x9962('0x30')],_0x41dbad[_0x9962('0x2d')]);_0x38782b[_0x9962('0x31')]=_[_0x9962('0x2f')](_0x41dbad[_0x9962('0x30')],qs[_0x9962('0x32')](_0x2d54fe[_0x9962('0x2d')][_0x9962('0x32')]));_0x38782b[_0x9962('0x31')]=_0x38782b['attributes']['length']?_0x38782b['attributes']:_0x41dbad[_0x9962('0x30')];if(_0x2d54fe[_0x9962('0x2d')][_0x9962('0x3e')]){_0x38782b['include']=[{'all':!![]}];}_0x38782b=_['merge']({},_0x38782b,_0x2d54fe[_0x9962('0x46')]);return db[_0x9962('0x45')][_0x9962('0x47')](_0x38782b)[_0x9962('0x26')](handleEntityNotFound(_0x87d1c9,null))[_0x9962('0x26')](respondWithResult(_0x87d1c9,null))[_0x9962('0x42')](handleError(_0x87d1c9,null));};exports[_0x9962('0x48')]=function(_0x139312,_0x4f24a4){return db[_0x9962('0x45')][_0x9962('0x48')](_0x139312['body'],{})[_0x9962('0x26')](function(_0xef71a){var _0x421ed3=_0x139312[_0x9962('0x49')]['get']({'plain':!![]});if(!_0x421ed3)throw new Error(_0x9962('0x4a'));if(_0x421ed3[_0x9962('0x4b')]===_0x9962('0x49')){var _0x11a1f2=_0xef71a[_0x9962('0x4c')]({'plain':!![]});var _0x16c6cb=_0x9962('0x4d');return db['UserProfileSection'][_0x9962('0x47')]({'where':{'name':_0x16c6cb,'userProfileId':_0x421ed3['userProfileId']},'raw':!![]})[_0x9962('0x26')](function(_0x755ef0){if(_0x755ef0&&_0x755ef0[_0x9962('0x4e')]===0x0){return db[_0x9962('0x4f')]['create']({'name':_0x11a1f2['name'],'resourceId':_0x11a1f2['id'],'type':_0x755ef0['name'],'sectionId':_0x755ef0['id']},{})[_0x9962('0x26')](function(){return _0xef71a;});}else{return _0xef71a;}})[_0x9962('0x42')](function(_0x44f54b){logger['error'](_0x9962('0x50'),_0x44f54b);throw _0x44f54b;});}return _0xef71a;})['then'](respondWithResult(_0x4f24a4,0xc9))[_0x9962('0x42')](handleError(_0x4f24a4,null));};exports['update']=function(_0x15960c,_0x113934){if(_0x15960c[_0x9962('0x51')]['id']){delete _0x15960c[_0x9962('0x51')]['id'];}return db[_0x9962('0x45')][_0x9962('0x47')]({'where':{'id':_0x15960c['params']['id']}})[_0x9962('0x26')](handleEntityNotFound(_0x113934,null))['then'](saveUpdates(_0x15960c[_0x9962('0x51')],null))[_0x9962('0x26')](respondWithResult(_0x113934,null))['catch'](handleError(_0x113934,null));};exports['destroy']=function(_0x1b5198,_0x2c7225){var _0x268455=_0x1b5198[_0x9962('0x44')]['id'];var _0x4092d6=[];return db[_0x9962('0x52')][_0x9962('0x53')](function(_0x507950){var _0x2f17c1=_0x9962('0x54')+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0x2f17c1,{'type':db[_0x9962('0x55')][_0x9962('0x56')][_0x9962('0x57')],'raw':!![],'transaction':_0x507950})[_0x9962('0x26')](function(_0x4f9eae){_0x4092d6=_[_0x9962('0x2c')](_0x4f9eae,function(_0x4ceb86){return Number(_0x4ceb86[_0x9962('0x58')]);});})['then'](function(){var _0x49d169=_0x9962('0x59')+_0x268455;return db['sequelize'][_0x9962('0x2d')](_0x49d169,{'type':db[_0x9962('0x55')][_0x9962('0x56')][_0x9962('0x57')],'raw':!![],'transaction':_0x507950});})[_0x9962('0x26')](function(_0x580840){var _0x3c69a0=_[_0x9962('0x2c')](_0x580840,function(_0x48c72c){return Number(_0x48c72c['VoiceQueueId']);});return db[_0x9962('0x5a')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'VoiceQueueId':{'$in':_0x3c69a0}},'transaction':_0x507950});})[_0x9962('0x26')](function(){var _0x14725b=_0x9962('0x5c')+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0x14725b,{'type':db[_0x9962('0x55')][_0x9962('0x56')]['SELECT'],'raw':!![],'transaction':_0x507950});})['then'](function(_0x4a6563){var _0x44bba8=_[_0x9962('0x2c')](_0x4a6563,function(_0x2b7aed){return Number(_0x2b7aed[_0x9962('0x5d')]);});return db[_0x9962('0x5e')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'MailQueueId':{'$in':_0x44bba8}},'transaction':_0x507950});})[_0x9962('0x26')](function(){var _0x1d1b10=_0x9962('0x5f')+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0x1d1b10,{'type':db['Sequelize']['QueryTypes'][_0x9962('0x57')],'raw':!![],'transaction':_0x507950});})['then'](function(_0x2e5cfb){var _0x5a22ce=_[_0x9962('0x2c')](_0x2e5cfb,function(_0x1eea80){return Number(_0x1eea80[_0x9962('0x60')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x4092d6},'SmsQueueId':{'$in':_0x5a22ce}},'transaction':_0x507950});})['then'](function(){var _0x571ad1='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x268455;return db['sequelize'][_0x9962('0x2d')](_0x571ad1,{'type':db['Sequelize']['QueryTypes'][_0x9962('0x57')],'raw':!![],'transaction':_0x507950});})[_0x9962('0x26')](function(_0x3a7099){var _0x51bb22=_[_0x9962('0x2c')](_0x3a7099,function(_0x1fa049){return Number(_0x1fa049[_0x9962('0x61')]);});return db[_0x9962('0x62')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'ChatQueueId':{'$in':_0x51bb22}},'transaction':_0x507950});})[_0x9962('0x26')](function(){var _0xf0fa78='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0xf0fa78,{'type':db[_0x9962('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x507950});})[_0x9962('0x26')](function(_0x3977de){var _0x19724f=_['map'](_0x3977de,function(_0x4d7f81){return Number(_0x4d7f81[_0x9962('0x63')]);});return db[_0x9962('0x64')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'FaxQueueId':{'$in':_0x19724f}},'transaction':_0x507950});})['then'](function(){var _0x25a2f0='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0x25a2f0,{'type':db[_0x9962('0x55')][_0x9962('0x56')][_0x9962('0x57')],'raw':!![],'transaction':_0x507950});})['then'](function(_0x403dd4){var _0x357e61=_[_0x9962('0x2c')](_0x403dd4,function(_0x11d0c3){return Number(_0x11d0c3[_0x9962('0x65')]);});return db['UserOpenchannelQueue'][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'OpenchannelQueueId':{'$in':_0x357e61}},'transaction':_0x507950});})[_0x9962('0x26')](function(){var _0x2ae1bb='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x268455;return db[_0x9962('0x52')][_0x9962('0x2d')](_0x2ae1bb,{'type':db['Sequelize'][_0x9962('0x56')][_0x9962('0x57')],'raw':!![],'transaction':_0x507950});})[_0x9962('0x26')](function(_0x2d752c){var _0x5780c3=_[_0x9962('0x2c')](_0x2d752c,function(_0x274646){return Number(_0x274646[_0x9962('0x66')]);});return db[_0x9962('0x67')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'WhatsappQueueId':{'$in':_0x5780c3}},'transaction':_0x507950});})[_0x9962('0x26')](function(){return db['TeamVoicePrefix'][_0x9962('0x47')]({'where':{'TeamId':_0x268455}});})['then'](function(_0x13720f){if(_0x13720f===null){return;}return db[_0x9962('0x68')][_0x9962('0x5b')]({'where':{'UserId':{'$in':_0x4092d6},'VoicePrefixId':_0x13720f[_0x9962('0x69')]},'transaction':_0x507950});})[_0x9962('0x26')](function(){return db[_0x9962('0x45')]['destroy']({'where':{'id':_0x268455},'cascade':!![],'transaction':_0x507950});})[_0x9962('0x26')](function(_0x35a9da){if(_0x35a9da===0x0){_0x2c7225[_0x9962('0x1a')](0x194);}else{return db[_0x9962('0x4f')]['destroy']({'where':{'type':'Teams','resourceId':_0x268455},'cascade':!![],'transaction':_0x507950})[_0x9962('0x26')](function(){_0x2c7225[_0x9962('0x1c')](0xcc)['end']();});}})[_0x9962('0x42')](function(_0x1ac3ba){_0x2c7225[_0x9962('0x1c')](0x1f4)[_0x9962('0x28')](_0x1ac3ba);});});};exports['getQueues']=function(_0x48b668,_0x4cff5b,_0xc2c50d){return db[_0x9962('0x45')]['findOne']({'where':{'id':_0x48b668[_0x9962('0x44')]['id']}})[_0x9962('0x26')](handleEntityNotFound(_0x4cff5b,null))[_0x9962('0x26')](function(_0x425938){if(!_0x48b668[_0x9962('0x2d')][_0x9962('0x6a')]||!utils['isValidChannel'](_0x48b668[_0x9962('0x2d')]['channel'])){throw new db[(_0x9962('0x55'))][(_0x9962('0x6b'))](_0x9962('0x6c'));}var _0x5d81cd={};var _0xc8b39b={};_0xc8b39b[_0x9962('0x30')]=_[_0x9962('0x6d')](db[_[_0x9962('0x6e')](_0x48b668[_0x9962('0x2d')]['channel']['toLowerCase']())+_0x9962('0x6f')]['rawAttributes']);_0xc8b39b[_0x9962('0x2d')]=_[_0x9962('0x6d')](_0x48b668[_0x9962('0x2d')]);_0xc8b39b[_0x9962('0x2e')]=_['intersection'](_0xc8b39b[_0x9962('0x30')],_0xc8b39b['query']);_0x5d81cd[_0x9962('0x31')]=_['intersection'](_0xc8b39b[_0x9962('0x30')],qs[_0x9962('0x32')](_0x48b668[_0x9962('0x2d')]['fields']));_0x5d81cd[_0x9962('0x31')]=_0x5d81cd[_0x9962('0x31')][_0x9962('0x33')]?_0x5d81cd['attributes']:_0xc8b39b[_0x9962('0x30')];_0x5d81cd['limit']=qs[_0x9962('0x21')](_0x48b668[_0x9962('0x2d')][_0x9962('0x21')]);_0x5d81cd['offset']=qs['offset'](_0x48b668[_0x9962('0x2d')][_0x9962('0x1e')]);_0x5d81cd[_0x9962('0x36')]=qs[_0x9962('0x37')](_0x48b668[_0x9962('0x2d')][_0x9962('0x37')]);_0x5d81cd[_0x9962('0x39')]=qs[_0x9962('0x2e')](_[_0x9962('0x38')](_0x48b668['query'],_0xc8b39b[_0x9962('0x2e')]));_0x5d81cd=_['merge']({},_0x5d81cd,_0x48b668[_0x9962('0x46')]);return _0x425938['get'+_[_0x9962('0x6e')](_0x48b668['query'][_0x9962('0x6a')][_0x9962('0x70')]())+_0x9962('0x71')](_0x5d81cd);})['then'](respondWithResult(_0x4cff5b,null))[_0x9962('0x42')](handleError(_0x4cff5b,null));};exports[_0x9962('0x72')]=function(_0x54ff12,_0x2a256c,_0x57d929){return db[_0x9962('0x45')][_0x9962('0x73')]({'where':{'id':_0x54ff12[_0x9962('0x44')]['id']}})[_0x9962('0x26')](function(_0x4f2860){if(_0x4f2860){if(!_0x54ff12[_0x9962('0x51')][_0x9962('0x6a')]||!utils[_0x9962('0x74')](_0x54ff12[_0x9962('0x51')][_0x9962('0x6a')])){throw new db[(_0x9962('0x55'))]['ValidationError'](_0x9962('0x6c'));}return _0x4f2860['add'+_[_0x9962('0x6e')](_0x54ff12['body'][_0x9962('0x6a')]['toLowerCase']())+_0x9962('0x71')](_0x54ff12[_0x9962('0x51')]['ids']);}return null;})[_0x9962('0x26')](handleEntityNotFound(_0x2a256c,null))[_0x9962('0x26')](respondWithStatusCode(_0x2a256c,null))[_0x9962('0x42')](handleError(_0x2a256c,null));};exports[_0x9962('0x75')]=function(_0x597457,_0x2dfbff,_0x33703e){return db[_0x9962('0x45')][_0x9962('0x73')]({'where':{'id':_0x597457[_0x9962('0x44')]['id']}})[_0x9962('0x26')](function(_0x312bb2){if(_0x312bb2){if(!_0x597457[_0x9962('0x2d')][_0x9962('0x6a')]||!utils['isValidChannel'](_0x597457['query']['channel'])){throw new db[(_0x9962('0x55'))]['ValidationError'](_0x9962('0x6c'));}return _0x312bb2['remove'+_['capitalize'](_0x597457['query'][_0x9962('0x6a')]['toLowerCase']())+'Queues'](_0x597457['query'][_0x9962('0x76')]);}return null;})[_0x9962('0x26')](handleEntityNotFound(_0x2dfbff,null))['then'](respondWithStatusCode(_0x2dfbff,null))[_0x9962('0x42')](handleError(_0x2dfbff,null));};exports[_0x9962('0x77')]=function(_0xb9188b,_0x139648){var _0x1fc298=_[_0x9962('0x78')](_0xb9188b[_0x9962('0x51')]['ids'])?_0xb9188b[_0x9962('0x51')]['ids']:[_0xb9188b[_0x9962('0x51')][_0x9962('0x76')]];var _0x2dc1ef=_0xb9188b[_0x9962('0x44')]['id'];return db[_0x9962('0x45')][_0x9962('0x47')]({'where':{'id':_0x2dc1ef}})['then'](handleEntityNotFound(_0x139648,null))[_0x9962('0x26')](function(_0x315cf3){if(_0x315cf3){var _0x18825f=['Voice',_0x9962('0x79'),_0x9962('0x7a'),_0x9962('0x7b'),_0x9962('0x7c'),_0x9962('0x7d'),'Whatsapp'];return db[_0x9962('0x52')]['transaction'](function(_0x4d0693){var _0x3f5ad7=_[_0x9962('0x2c')](_0x18825f,function(_0x46e6b8){var _0x2fae87={'attributes':['id',_0x9962('0x27')]};if(_0x46e6b8==='Voice'){_0x2fae87[_0x9962('0x7e')]={'attributes':[_0x9962('0x7f')]};}return _0x315cf3[_0x9962('0x4c')+_0x46e6b8+'Queues'](_0x2fae87)['then'](function(_0x1b5a9b){var _0x4f670c=_['map'](_0x1b5a9b,function(_0x25dd64){var _0x175591=_['map'](_0x1fc298,function(_0x300dec){var _0x1db5b3={'where':{'UserId':_0x300dec,[_0x46e6b8+'QueueId']:_0x25dd64['id']},'transaction':_0x4d0693};if(_0x46e6b8===_0x9962('0x80')){_0x1db5b3[_0x9962('0x16')]={'penalty':_0x25dd64[_0x9962('0x81')][_0x9962('0x7f')]};}return db[_0x9962('0x82')+_0x46e6b8+_0x9962('0x6f')][_0x9962('0x83')](_0x1db5b3)['then'](function(){socket[_0x9962('0x84')](_0x9962('0x49')+_0x46e6b8+_0x9962('0x85'),{'UserId':_0x300dec,[_0x46e6b8+_0x9962('0x86')]:_0x25dd64['id']});if(_0x46e6b8!==_0x9962('0x80')){return;}return db[_0x9962('0x82')][_0x9962('0x40')]({'where':{'id':_0x1fc298,'online':0x1},'attributes':['id','name',_0x9962('0x87'),_0x9962('0x88'),_0x9962('0x89')],'raw':!![]})[_0x9962('0x26')](function(_0x573d53){var _0x213322=_['map'](_0x573d53,function(_0x1f3e05){return db['UserVoiceQueueRt'][_0x9962('0x8a')]({'membername':_0x1f3e05['name'],'UserId':_0x1f3e05['id'],'queue_name':_0x25dd64['name'],'VoiceQueueId':_0x25dd64['id'],'interface':_[_0x9962('0x8b')](_0x1f3e05['interface'])?util['format'](_0x9962('0x8c'),_0x1f3e05['name']):_0x1f3e05[_0x9962('0x89')],'paused':_0x1f3e05[_0x9962('0x88')]||![],'penalty':_0x25dd64[_0x9962('0x81')][_0x9962('0x7f')]},{'transaction':_0x4d0693});});return Promise[_0x9962('0x8d')](_0x213322);});});});return Promise[_0x9962('0x8d')](_0x175591);});return Promise['all'](_0x4f670c);})[_0x9962('0x26')](function(){return db[_0x9962('0x8e')]['findOne']({'where':{'teamId':_0x2dc1ef}})[_0x9962('0x26')](function(_0xd9d9e0){if(_0xd9d9e0){var _0x2ed440=_['map'](_0x1fc298,function(_0xefdbc8){db[_0x9962('0x68')][_0x9962('0x8a')]({'UserId':_0xefdbc8,'VoicePrefixId':_0xd9d9e0[_0x9962('0x69')]});});return Promise[_0x9962('0x8d')](_0x2ed440);}});});});return Promise[_0x9962('0x8d')](_0x3f5ad7)['then'](function(){return _0x315cf3[_0x9962('0x77')](_0x1fc298,{'transaction':_0x4d0693})[_0x9962('0x8f')](function(_0x4f6723){return _0x4f6723;});});});}})[_0x9962('0x26')](respondWithResult(_0x139648,null))['catch'](handleError(_0x139648,null));};exports[_0x9962('0x90')]=function(_0x94389a,_0x29bb07){var _0x56aea3=_[_0x9962('0x78')](_0x94389a['query'][_0x9962('0x76')])?_0x94389a['query'][_0x9962('0x76')]:[_0x94389a[_0x9962('0x2d')][_0x9962('0x76')]];var _0x553490=_0x94389a[_0x9962('0x44')]['id'];return db[_0x9962('0x45')][_0x9962('0x47')]({'where':{'id':_0x553490}})[_0x9962('0x26')](handleEntityNotFound(_0x29bb07,null))['then'](function(_0x347516){if(_0x347516){var _0x25a560=['Voice',_0x9962('0x79'),_0x9962('0x7a'),'Sms',_0x9962('0x7c'),_0x9962('0x7d'),_0x9962('0x91')];return db[_0x9962('0x52')][_0x9962('0x53')](function(_0x1b0f2f){var _0x546a7d=_['map'](_0x25a560,function(_0x3c6373){var _0xb2c57={'attributes':['id',_0x9962('0x27')]};return _0x347516[_0x9962('0x4c')+_0x3c6373+'Queues'](_0xb2c57)[_0x9962('0x26')](function(_0x75b135){var _0x33ddb2=_['map'](_0x75b135,function(_0x20a562){return _0x20a562[_0x9962('0x90')](_0x56aea3,{'transaction':_0x1b0f2f})[_0x9962('0x26')](function(){var _0x40027b=_[_0x9962('0x2c')](_0x56aea3,function(_0x46c0ed){socket['emit']('user'+_0x3c6373+_0x9962('0x92'),{'UserId':Number(_0x46c0ed),[_0x3c6373+_0x9962('0x86')]:_0x20a562['id']});if(_0x3c6373!==_0x9962('0x80')){return;}return db[_0x9962('0x93')]['destroy']({'where':{'VoiceQueueId':_0x20a562['id'],'UserId':_0x46c0ed},'transaction':_0x1b0f2f});});return Promise[_0x9962('0x8d')](_0x40027b);});});return Promise['all'](_0x33ddb2);});});return Promise[_0x9962('0x8d')](_0x546a7d)[_0x9962('0x26')](function(){return _0x347516[_0x9962('0x90')](_0x56aea3,{'transaction':_0x1b0f2f});})[_0x9962('0x26')](function(){return db['TeamVoicePrefix'][_0x9962('0x73')]({'where':{'teamId':_0x553490}})[_0x9962('0x26')](function(_0x596aa2){if(_0x596aa2){var _0x567743=_[_0x9962('0x2c')](_0x56aea3,function(_0xce30bd){db[_0x9962('0x68')][_0x9962('0x5b')]({'where':{'UserId':_0xce30bd,'VoicePrefixId':_0x596aa2[_0x9962('0x69')]}});});return Promise['all'](_0x567743);}});});});}})['then'](respondWithStatusCode(_0x29bb07,null))[_0x9962('0x42')](handleError(_0x29bb07,null));};exports[_0x9962('0x94')]=function(_0x2eeea2,_0x1e2458,_0x5b8769){var _0x2d204f={};var _0xb28922={};var _0x193a4a;var _0x43b0fc;return db[_0x9962('0x45')][_0x9962('0x73')]({'where':{'id':_0x2eeea2[_0x9962('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e2458,null))['then'](function(_0x30c63c){if(_0x30c63c){_0x193a4a=_0x30c63c;_0xb28922[_0x9962('0x30')]=_['keys'](db[_0x9962('0x82')][_0x9962('0x2a')]);_0xb28922[_0x9962('0x2d')]=_[_0x9962('0x6d')](_0x2eeea2[_0x9962('0x2d')]);_0xb28922['filters']=_[_0x9962('0x2f')](_0xb28922['model'],_0xb28922[_0x9962('0x2d')]);_0x2d204f[_0x9962('0x31')]=_[_0x9962('0x2f')](_0xb28922[_0x9962('0x30')],qs[_0x9962('0x32')](_0x2eeea2[_0x9962('0x2d')]['fields']));_0x2d204f[_0x9962('0x31')]=_0x2d204f[_0x9962('0x31')]['length']?_0x2d204f['attributes']:_0xb28922['model'];_0x2d204f['order']=qs['sort'](_0x2eeea2[_0x9962('0x2d')][_0x9962('0x37')]);_0x2d204f['where']=qs['filters'](_['pick'](_0x2eeea2[_0x9962('0x2d')],_0xb28922[_0x9962('0x2e')]));if(_0x2eeea2[_0x9962('0x2d')][_0x9962('0x3c')]){_0x2d204f['where']=_[_0x9962('0x3d')](_0x2d204f[_0x9962('0x39')],{'$or':_[_0x9962('0x2c')](_0x2d204f['attributes'],function(_0x375153){var _0x519eae={};_0x519eae[_0x375153]={'$like':'%'+_0x2eeea2[_0x9962('0x2d')][_0x9962('0x3c')]+'%'};return _0x519eae;})});}_0x2d204f=_[_0x9962('0x3d')]({},_0x2d204f,_0x2eeea2[_0x9962('0x46')]);return _0x193a4a[_0x9962('0x94')](_0x2d204f);}})[_0x9962('0x26')](function(_0x364278){if(_0x364278){_0x43b0fc=_0x364278[_0x9962('0x33')];if(!_0x2eeea2['query'][_0x9962('0x34')](_0x9962('0x35'))){_0x2d204f[_0x9962('0x21')]=qs['limit'](_0x2eeea2[_0x9962('0x2d')][_0x9962('0x21')]);_0x2d204f[_0x9962('0x1e')]=qs[_0x9962('0x1e')](_0x2eeea2[_0x9962('0x2d')][_0x9962('0x1e')]);}return _0x193a4a[_0x9962('0x94')](_0x2d204f);}})[_0x9962('0x26')](function(_0x48e74f){if(_0x48e74f){return _0x48e74f?{'count':_0x43b0fc,'rows':_0x48e74f}:null;}})[_0x9962('0x26')](respondWithResult(_0x1e2458,null))[_0x9962('0x42')](handleError(_0x1e2458,null));}; \ No newline at end of file +var _0x7faa=['params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','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','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','UserWhatsappQueue','TeamVoicePrefix','UserProfileResource','end','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','Queue','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','findOne','UserVoicePrefix','VoicePrefixId','spread','isArray','removeAgents','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation'];(function(_0x4588a5,_0x147379){var _0x49c1fe=function(_0x42591c){while(--_0x42591c){_0x4588a5['push'](_0x4588a5['shift']());}};_0x49c1fe(++_0x147379);}(_0x7faa,0xe9));var _0xa7fa=function(_0x164e35,_0x1c226e){_0x164e35=_0x164e35-0x0;var _0x11e43a=_0x7faa[_0x164e35];return _0x11e43a;};'use strict';var emlformat=require(_0xa7fa('0x0'));var rimraf=require(_0xa7fa('0x1'));var zipdir=require(_0xa7fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7fa('0x3'));var moment=require(_0xa7fa('0x4'));var BPromise=require(_0xa7fa('0x5'));var Mustache=require(_0xa7fa('0x6'));var util=require(_0xa7fa('0x7'));var path=require('path');var sox=require(_0xa7fa('0x8'));var csv=require(_0xa7fa('0x9'));var ejs=require(_0xa7fa('0xa'));var fs=require('fs');var fs_extra=require(_0xa7fa('0xb'));var _=require(_0xa7fa('0xc'));var squel=require(_0xa7fa('0xd'));var crypto=require(_0xa7fa('0xe'));var jsforce=require(_0xa7fa('0xf'));var deskjs=require(_0xa7fa('0x10'));var toCsv=require(_0xa7fa('0x9'));var querystring=require(_0xa7fa('0x11'));var Papa=require('papaparse');var Redis=require(_0xa7fa('0x12'));var authService=require(_0xa7fa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa7fa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7fa('0x15'))(_0xa7fa('0x16'));var utils=require('../../config/utils');var config=require(_0xa7fa('0x17'));var licenseUtil=require(_0xa7fa('0x18'));var db=require(_0xa7fa('0x19'))['db'];config['redis']=_[_0xa7fa('0x1a')](config[_0xa7fa('0x1b')],{'host':_0xa7fa('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7fa('0x1b')]));require('./team.socket')[_0xa7fa('0x1d')](socket);function respondWithStatusCode(_0x2d9110,_0x52f341){_0x52f341=_0x52f341||0xcc;return function(_0x64c0f4){if(_0x64c0f4){return _0x2d9110[_0xa7fa('0x1e')](_0x52f341);}return _0x2d9110[_0xa7fa('0x1f')](_0x52f341)['end']();};}function respondWithResult(_0x37eab8,_0x3dd874){_0x3dd874=_0x3dd874||0xc8;return function(_0x463a54){if(_0x463a54){return _0x37eab8[_0xa7fa('0x1f')](_0x3dd874)[_0xa7fa('0x20')](_0x463a54);}};}function respondWithFilteredResult(_0x4d5c8e,_0x25ec74){return function(_0x2c4679){if(_0x2c4679){var _0x174e5a=typeof _0x25ec74['offset']===_0xa7fa('0x21')&&typeof _0x25ec74[_0xa7fa('0x22')]===_0xa7fa('0x21');var _0x569c13=_0x2c4679[_0xa7fa('0x23')];var _0x3f6e05=_0x174e5a?0x0:_0x25ec74['offset'];var _0x190692=_0x174e5a?_0x2c4679[_0xa7fa('0x23')]:_0x25ec74[_0xa7fa('0x24')]+_0x25ec74[_0xa7fa('0x22')];var _0x47860f;if(_0x190692>=_0x569c13){_0x190692=_0x569c13;_0x47860f=0xc8;}else{_0x47860f=0xce;}_0x4d5c8e['status'](_0x47860f);return _0x4d5c8e[_0xa7fa('0x25')]('Content-Range',_0x3f6e05+'-'+_0x190692+'/'+_0x569c13)[_0xa7fa('0x20')](_0x2c4679);}return null;};}function patchUpdates(_0x2622e5){return function(_0x772a34){try{jsonpatch[_0xa7fa('0x26')](_0x772a34,_0x2622e5,!![]);}catch(_0x17b900){return BPromise[_0xa7fa('0x27')](_0x17b900);}return _0x772a34[_0xa7fa('0x28')]();};}function saveUpdates(_0x4cd5bb,_0x40fca7){return function(_0x3311ac){if(_0x3311ac){return _0x3311ac[_0xa7fa('0x29')](_0x4cd5bb)[_0xa7fa('0x2a')](function(_0x2a9bd7){return _0x2a9bd7;});}return null;};}function handleEntityNotFound(_0x26b57d,_0x1ca2b7){return function(_0x49076f){if(!_0x49076f){_0x26b57d['sendStatus'](0x194);}return _0x49076f;};}function handleError(_0x6ba723,_0x37c0c5){_0x37c0c5=_0x37c0c5||0x1f4;return function(_0x5a2685){logger[_0xa7fa('0x2b')](_0x5a2685['stack']);if(_0x5a2685[_0xa7fa('0x2c')]){delete _0x5a2685['name'];}_0x6ba723[_0xa7fa('0x1f')](_0x37c0c5)[_0xa7fa('0x2d')](_0x5a2685);};}exports[_0xa7fa('0x2e')]=function(_0x4d2a7f,_0xaf6f28){var _0x5757bd={},_0x4e619c={},_0x504db2={'count':0x0,'rows':[]};var _0x5442cd=_[_0xa7fa('0x2f')](db[_0xa7fa('0x30')][_0xa7fa('0x31')],function(_0xe5992c){return{'name':_0xe5992c[_0xa7fa('0x32')],'type':_0xe5992c[_0xa7fa('0x33')][_0xa7fa('0x34')]};});_0x4e619c[_0xa7fa('0x35')]=_[_0xa7fa('0x2f')](_0x5442cd,_0xa7fa('0x2c'));_0x4e619c[_0xa7fa('0x36')]=_[_0xa7fa('0x37')](_0x4d2a7f[_0xa7fa('0x36')]);_0x4e619c[_0xa7fa('0x38')]=_[_0xa7fa('0x39')](_0x4e619c['model'],_0x4e619c['query']);_0x5757bd['attributes']=_[_0xa7fa('0x39')](_0x4e619c['model'],qs[_0xa7fa('0x3a')](_0x4d2a7f[_0xa7fa('0x36')][_0xa7fa('0x3a')]));_0x5757bd[_0xa7fa('0x3b')]=_0x5757bd['attributes'][_0xa7fa('0x3c')]?_0x5757bd[_0xa7fa('0x3b')]:_0x4e619c[_0xa7fa('0x35')];if(!_0x4d2a7f['query']['hasOwnProperty'](_0xa7fa('0x3d'))){_0x5757bd[_0xa7fa('0x22')]=qs[_0xa7fa('0x22')](_0x4d2a7f[_0xa7fa('0x36')][_0xa7fa('0x22')]);_0x5757bd[_0xa7fa('0x24')]=qs[_0xa7fa('0x24')](_0x4d2a7f[_0xa7fa('0x36')][_0xa7fa('0x24')]);}_0x5757bd[_0xa7fa('0x3e')]=qs[_0xa7fa('0x3f')](_0x4d2a7f['query'][_0xa7fa('0x3f')]);_0x5757bd[_0xa7fa('0x40')]=qs['filters'](_[_0xa7fa('0x41')](_0x4d2a7f[_0xa7fa('0x36')],_0x4e619c[_0xa7fa('0x38')]),_0x5442cd);if(_0x4d2a7f['query'][_0xa7fa('0x42')]){_0x5757bd[_0xa7fa('0x40')]=_[_0xa7fa('0x43')](_0x5757bd[_0xa7fa('0x40')],{'$or':_[_0xa7fa('0x2f')](_0x5442cd,function(_0x215862){if(_0x215862[_0xa7fa('0x33')]!==_0xa7fa('0x44')){var _0x433f50={};_0x433f50[_0x215862['name']]={'$like':'%'+_0x4d2a7f[_0xa7fa('0x36')][_0xa7fa('0x42')]+'%'};return _0x433f50;}})});}_0x5757bd=_[_0xa7fa('0x43')]({},_0x5757bd,_0x4d2a7f['options']);var _0x841816={'where':_0x5757bd[_0xa7fa('0x40')]};return db[_0xa7fa('0x30')][_0xa7fa('0x23')](_0x841816)[_0xa7fa('0x2a')](function(_0xbcd55c){_0x504db2[_0xa7fa('0x23')]=_0xbcd55c;if(_0x4d2a7f[_0xa7fa('0x36')][_0xa7fa('0x45')]){_0x5757bd[_0xa7fa('0x46')]=[{'all':!![]}];}return db[_0xa7fa('0x30')][_0xa7fa('0x47')](_0x5757bd);})[_0xa7fa('0x2a')](function(_0x88286b){_0x504db2[_0xa7fa('0x48')]=_0x88286b;return _0x504db2;})['then'](respondWithFilteredResult(_0xaf6f28,_0x5757bd))[_0xa7fa('0x49')](handleError(_0xaf6f28,null));};exports[_0xa7fa('0x4a')]=function(_0x5caa63,_0x23d166){var _0x523415={'raw':![],'where':{'id':_0x5caa63['params']['id']}},_0x56509f={};_0x56509f[_0xa7fa('0x35')]=_[_0xa7fa('0x37')](db[_0xa7fa('0x30')][_0xa7fa('0x31')]);_0x56509f[_0xa7fa('0x36')]=_[_0xa7fa('0x37')](_0x5caa63[_0xa7fa('0x36')]);_0x56509f[_0xa7fa('0x38')]=_[_0xa7fa('0x39')](_0x56509f[_0xa7fa('0x35')],_0x56509f[_0xa7fa('0x36')]);_0x523415['attributes']=_['intersection'](_0x56509f[_0xa7fa('0x35')],qs[_0xa7fa('0x3a')](_0x5caa63[_0xa7fa('0x36')][_0xa7fa('0x3a')]));_0x523415[_0xa7fa('0x3b')]=_0x523415['attributes']['length']?_0x523415[_0xa7fa('0x3b')]:_0x56509f[_0xa7fa('0x35')];if(_0x5caa63[_0xa7fa('0x36')][_0xa7fa('0x45')]){_0x523415[_0xa7fa('0x46')]=[{'all':!![]}];}_0x523415=_[_0xa7fa('0x43')]({},_0x523415,_0x5caa63[_0xa7fa('0x4b')]);return db[_0xa7fa('0x30')][_0xa7fa('0x4c')](_0x523415)['then'](handleEntityNotFound(_0x23d166,null))[_0xa7fa('0x2a')](respondWithResult(_0x23d166,null))[_0xa7fa('0x49')](handleError(_0x23d166,null));};exports['create']=function(_0x2262f9,_0x54f892){return db['Team'][_0xa7fa('0x4d')](_0x2262f9[_0xa7fa('0x4e')],{})[_0xa7fa('0x2a')](function(_0x226274){var _0x332da9=_0x2262f9[_0xa7fa('0x4f')][_0xa7fa('0x50')]({'plain':!![]});if(!_0x332da9)throw new Error(_0xa7fa('0x51'));if(_0x332da9[_0xa7fa('0x52')]===_0xa7fa('0x4f')){var _0x1af0fb=_0x226274[_0xa7fa('0x50')]({'plain':!![]});var _0x1c6b78=_0xa7fa('0x53');return db[_0xa7fa('0x54')]['find']({'where':{'name':_0x1c6b78,'userProfileId':_0x332da9[_0xa7fa('0x55')]},'raw':!![]})[_0xa7fa('0x2a')](function(_0x211fb2){if(_0x211fb2&&_0x211fb2[_0xa7fa('0x56')]===0x0){return db['UserProfileResource'][_0xa7fa('0x4d')]({'name':_0x1af0fb[_0xa7fa('0x2c')],'resourceId':_0x1af0fb['id'],'type':_0x211fb2[_0xa7fa('0x2c')],'sectionId':_0x211fb2['id']},{})[_0xa7fa('0x2a')](function(){return _0x226274;});}else{return _0x226274;}})[_0xa7fa('0x49')](function(_0x4ed8d7){logger[_0xa7fa('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ed8d7);throw _0x4ed8d7;});}return _0x226274;})[_0xa7fa('0x2a')](respondWithResult(_0x54f892,0xc9))[_0xa7fa('0x49')](handleError(_0x54f892,null));};exports[_0xa7fa('0x29')]=function(_0xbd18ea,_0x133be6){if(_0xbd18ea[_0xa7fa('0x4e')]['id']){delete _0xbd18ea[_0xa7fa('0x4e')]['id'];}return db['Team'][_0xa7fa('0x4c')]({'where':{'id':_0xbd18ea[_0xa7fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x133be6,null))[_0xa7fa('0x2a')](saveUpdates(_0xbd18ea[_0xa7fa('0x4e')],null))[_0xa7fa('0x2a')](respondWithResult(_0x133be6,null))[_0xa7fa('0x49')](handleError(_0x133be6,null));};exports[_0xa7fa('0x58')]=function(_0x16ed63,_0x37e468){var _0x1a69a2=_0x16ed63[_0xa7fa('0x57')]['id'];var _0x2ee94e=[];return db[_0xa7fa('0x59')][_0xa7fa('0x5a')](function(_0x389c1d){var _0x584930=_0xa7fa('0x5b')+_0x1a69a2;return db[_0xa7fa('0x59')][_0xa7fa('0x36')](_0x584930,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')][_0xa7fa('0x5e')],'raw':!![],'transaction':_0x389c1d})[_0xa7fa('0x2a')](function(_0x1c7bb2){_0x2ee94e=_[_0xa7fa('0x2f')](_0x1c7bb2,function(_0x199886){return Number(_0x199886[_0xa7fa('0x5f')]);});})[_0xa7fa('0x2a')](function(){var _0x4abfa6=_0xa7fa('0x60')+_0x1a69a2;return db['sequelize'][_0xa7fa('0x36')](_0x4abfa6,{'type':db[_0xa7fa('0x5c')]['QueryTypes'][_0xa7fa('0x5e')],'raw':!![],'transaction':_0x389c1d});})['then'](function(_0x3e99e5){var _0x39294c=_[_0xa7fa('0x2f')](_0x3e99e5,function(_0x1436d1){return Number(_0x1436d1[_0xa7fa('0x61')]);});return db['UserVoiceQueue'][_0xa7fa('0x58')]({'where':{'UserId':{'$in':_0x2ee94e},'VoiceQueueId':{'$in':_0x39294c}},'transaction':_0x389c1d});})['then'](function(){var _0x5d55ff=_0xa7fa('0x62')+_0x1a69a2;return db[_0xa7fa('0x59')][_0xa7fa('0x36')](_0x5d55ff,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')][_0xa7fa('0x5e')],'raw':!![],'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(_0x3ec743){var _0x295615=_[_0xa7fa('0x2f')](_0x3ec743,function(_0x47bdda){return Number(_0x47bdda[_0xa7fa('0x63')]);});return db[_0xa7fa('0x64')]['destroy']({'where':{'UserId':{'$in':_0x2ee94e},'MailQueueId':{'$in':_0x295615}},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){var _0x239620='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1a69a2;return db[_0xa7fa('0x59')][_0xa7fa('0x36')](_0x239620,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')]['SELECT'],'raw':!![],'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(_0x1039c6){var _0x234deb=_[_0xa7fa('0x2f')](_0x1039c6,function(_0x3ec27d){return Number(_0x3ec27d[_0xa7fa('0x65')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x2ee94e},'SmsQueueId':{'$in':_0x234deb}},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){var _0x438b1d=_0xa7fa('0x66')+_0x1a69a2;return db[_0xa7fa('0x59')]['query'](_0x438b1d,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')]['SELECT'],'raw':!![],'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(_0x581851){var _0x22174f=_[_0xa7fa('0x2f')](_0x581851,function(_0xc3a723){return Number(_0xc3a723[_0xa7fa('0x67')]);});return db[_0xa7fa('0x68')][_0xa7fa('0x58')]({'where':{'UserId':{'$in':_0x2ee94e},'ChatQueueId':{'$in':_0x22174f}},'transaction':_0x389c1d});})['then'](function(){var _0x38a6fa=_0xa7fa('0x69')+_0x1a69a2;return db['sequelize'][_0xa7fa('0x36')](_0x38a6fa,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')][_0xa7fa('0x5e')],'raw':!![],'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(_0x46c30d){var _0x3cb1f3=_['map'](_0x46c30d,function(_0x4ac46b){return Number(_0x4ac46b[_0xa7fa('0x6a')]);});return db[_0xa7fa('0x6b')][_0xa7fa('0x58')]({'where':{'UserId':{'$in':_0x2ee94e},'FaxQueueId':{'$in':_0x3cb1f3}},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){var _0x526a49=_0xa7fa('0x6c')+_0x1a69a2;return db['sequelize']['query'](_0x526a49,{'type':db['Sequelize'][_0xa7fa('0x5d')][_0xa7fa('0x5e')],'raw':!![],'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(_0x1e144f){var _0x2be94d=_[_0xa7fa('0x2f')](_0x1e144f,function(_0x5051c1){return Number(_0x5051c1['OpenchannelQueueId']);});return db[_0xa7fa('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x2ee94e},'OpenchannelQueueId':{'$in':_0x2be94d}},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){var _0x2214fe='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1a69a2;return db['sequelize']['query'](_0x2214fe,{'type':db[_0xa7fa('0x5c')][_0xa7fa('0x5d')]['SELECT'],'raw':!![],'transaction':_0x389c1d});})['then'](function(_0x227df8){var _0x36ccf9=_['map'](_0x227df8,function(_0x5160c4){return Number(_0x5160c4['WhatsappQueueId']);});return db[_0xa7fa('0x6e')][_0xa7fa('0x58')]({'where':{'UserId':{'$in':_0x2ee94e},'WhatsappQueueId':{'$in':_0x36ccf9}},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){return db[_0xa7fa('0x6f')][_0xa7fa('0x4c')]({'where':{'TeamId':_0x1a69a2}});})[_0xa7fa('0x2a')](function(_0x373b82){if(_0x373b82===null){return;}return db['UserVoicePrefix'][_0xa7fa('0x58')]({'where':{'UserId':{'$in':_0x2ee94e},'VoicePrefixId':_0x373b82['VoicePrefixId']},'transaction':_0x389c1d});})[_0xa7fa('0x2a')](function(){return db[_0xa7fa('0x30')][_0xa7fa('0x58')]({'where':{'id':_0x1a69a2},'cascade':!![],'transaction':_0x389c1d});})['then'](function(_0x35f7a3){if(_0x35f7a3===0x0){_0x37e468[_0xa7fa('0x1e')](0x194);}else{return db[_0xa7fa('0x70')][_0xa7fa('0x58')]({'where':{'type':'Teams','resourceId':_0x1a69a2},'cascade':!![],'transaction':_0x389c1d})[_0xa7fa('0x2a')](function(){_0x37e468[_0xa7fa('0x1f')](0xcc)[_0xa7fa('0x71')]();});}})[_0xa7fa('0x49')](function(_0x47a5fa){_0x37e468[_0xa7fa('0x1f')](0x1f4)[_0xa7fa('0x2d')](_0x47a5fa);});});};exports['getQueues']=function(_0x2c4a3b,_0x55df99,_0x50d7d7){return db[_0xa7fa('0x30')]['findOne']({'where':{'id':_0x2c4a3b[_0xa7fa('0x57')]['id']}})[_0xa7fa('0x2a')](handleEntityNotFound(_0x55df99,null))[_0xa7fa('0x2a')](function(_0x421fc3){if(!_0x2c4a3b[_0xa7fa('0x36')]['channel']||!utils[_0xa7fa('0x72')](_0x2c4a3b['query']['channel'])){throw new db['Sequelize'][(_0xa7fa('0x73'))](_0xa7fa('0x74'));}var _0x33fbae={};var _0x4a27be={};_0x4a27be[_0xa7fa('0x35')]=_[_0xa7fa('0x37')](db[_[_0xa7fa('0x75')](_0x2c4a3b[_0xa7fa('0x36')][_0xa7fa('0x76')]['toLowerCase']())+_0xa7fa('0x77')]['rawAttributes']);_0x4a27be[_0xa7fa('0x36')]=_[_0xa7fa('0x37')](_0x2c4a3b['query']);_0x4a27be['filters']=_[_0xa7fa('0x39')](_0x4a27be['model'],_0x4a27be[_0xa7fa('0x36')]);_0x33fbae[_0xa7fa('0x3b')]=_['intersection'](_0x4a27be[_0xa7fa('0x35')],qs[_0xa7fa('0x3a')](_0x2c4a3b[_0xa7fa('0x36')]['fields']));_0x33fbae[_0xa7fa('0x3b')]=_0x33fbae[_0xa7fa('0x3b')]['length']?_0x33fbae[_0xa7fa('0x3b')]:_0x4a27be[_0xa7fa('0x35')];_0x33fbae[_0xa7fa('0x22')]=qs[_0xa7fa('0x22')](_0x2c4a3b[_0xa7fa('0x36')][_0xa7fa('0x22')]);_0x33fbae[_0xa7fa('0x24')]=qs[_0xa7fa('0x24')](_0x2c4a3b[_0xa7fa('0x36')][_0xa7fa('0x24')]);_0x33fbae[_0xa7fa('0x3e')]=qs[_0xa7fa('0x3f')](_0x2c4a3b[_0xa7fa('0x36')]['sort']);_0x33fbae[_0xa7fa('0x40')]=qs[_0xa7fa('0x38')](_['pick'](_0x2c4a3b[_0xa7fa('0x36')],_0x4a27be[_0xa7fa('0x38')]));_0x33fbae=_['merge']({},_0x33fbae,_0x2c4a3b[_0xa7fa('0x4b')]);return _0x421fc3[_0xa7fa('0x50')+_[_0xa7fa('0x75')](_0x2c4a3b[_0xa7fa('0x36')]['channel'][_0xa7fa('0x78')]())+_0xa7fa('0x79')](_0x33fbae);})[_0xa7fa('0x2a')](respondWithResult(_0x55df99,null))[_0xa7fa('0x49')](handleError(_0x55df99,null));};exports[_0xa7fa('0x7a')]=function(_0x582e19,_0xb05e0b,_0x1d77d3){return db[_0xa7fa('0x30')]['findOne']({'where':{'id':_0x582e19[_0xa7fa('0x57')]['id']}})[_0xa7fa('0x2a')](function(_0x17ab9f){if(_0x17ab9f){if(!_0x582e19[_0xa7fa('0x4e')][_0xa7fa('0x76')]||!utils[_0xa7fa('0x72')](_0x582e19[_0xa7fa('0x4e')]['channel'])){throw new db[(_0xa7fa('0x5c'))]['ValidationError']('Unknown\x20channel');}return _0x17ab9f[_0xa7fa('0x7b')+_[_0xa7fa('0x75')](_0x582e19[_0xa7fa('0x4e')]['channel']['toLowerCase']())+_0xa7fa('0x79')](_0x582e19[_0xa7fa('0x4e')][_0xa7fa('0x7c')]);}return null;})[_0xa7fa('0x2a')](handleEntityNotFound(_0xb05e0b,null))[_0xa7fa('0x2a')](respondWithStatusCode(_0xb05e0b,null))[_0xa7fa('0x49')](handleError(_0xb05e0b,null));};exports[_0xa7fa('0x7d')]=function(_0x317b8d,_0x2eb472,_0x3b87c0){return db[_0xa7fa('0x30')]['findOne']({'where':{'id':_0x317b8d[_0xa7fa('0x57')]['id']}})[_0xa7fa('0x2a')](function(_0xbbc707){if(_0xbbc707){if(!_0x317b8d['query'][_0xa7fa('0x76')]||!utils[_0xa7fa('0x72')](_0x317b8d[_0xa7fa('0x36')][_0xa7fa('0x76')])){throw new db[(_0xa7fa('0x5c'))]['ValidationError']('Unknown\x20channel');}return _0xbbc707[_0xa7fa('0x7e')+_[_0xa7fa('0x75')](_0x317b8d['query'][_0xa7fa('0x76')]['toLowerCase']())+_0xa7fa('0x79')](_0x317b8d[_0xa7fa('0x36')]['ids']);}return null;})[_0xa7fa('0x2a')](handleEntityNotFound(_0x2eb472,null))[_0xa7fa('0x2a')](respondWithStatusCode(_0x2eb472,null))[_0xa7fa('0x49')](handleError(_0x2eb472,null));};exports[_0xa7fa('0x7f')]=function(_0x5aa371,_0x38b8be){var _0x2c6e85=_['isArray'](_0x5aa371[_0xa7fa('0x4e')][_0xa7fa('0x7c')])?_0x5aa371['body'][_0xa7fa('0x7c')]:[_0x5aa371[_0xa7fa('0x4e')][_0xa7fa('0x7c')]];var _0x1256ad=_0x5aa371[_0xa7fa('0x57')]['id'];return db[_0xa7fa('0x30')][_0xa7fa('0x4c')]({'where':{'id':_0x1256ad}})[_0xa7fa('0x2a')](handleEntityNotFound(_0x38b8be,null))[_0xa7fa('0x2a')](function(_0x598e57){if(_0x598e57){var _0x42b0d1=[_0xa7fa('0x80'),_0xa7fa('0x81'),_0xa7fa('0x82'),_0xa7fa('0x83'),_0xa7fa('0x84'),_0xa7fa('0x85'),_0xa7fa('0x86')];return db['sequelize'][_0xa7fa('0x5a')](function(_0x57618f){var _0x99970d=_[_0xa7fa('0x2f')](_0x42b0d1,function(_0x202af8){var _0x23a645={'attributes':['id',_0xa7fa('0x2c')]};if(_0x202af8===_0xa7fa('0x80')){_0x23a645[_0xa7fa('0x87')]={'attributes':['penalty']};}return _0x598e57[_0xa7fa('0x50')+_0x202af8+_0xa7fa('0x79')](_0x23a645)['then'](function(_0x270d7d){var _0x45909d=_[_0xa7fa('0x2f')](_0x270d7d,function(_0x2df86a){var _0x241e58=_[_0xa7fa('0x2f')](_0x2c6e85,function(_0x4b1fe8){var _0x4c2c62={'where':{'UserId':_0x4b1fe8,[_0x202af8+_0xa7fa('0x88')]:_0x2df86a['id']},'transaction':_0x57618f};if(_0x202af8==='Voice'){_0x4c2c62['defaults']={'penalty':_0x2df86a[_0xa7fa('0x89')][_0xa7fa('0x8a')]};}return db[_0xa7fa('0x8b')+_0x202af8+_0xa7fa('0x77')]['findOrCreate'](_0x4c2c62)['then'](function(){socket[_0xa7fa('0x8c')](_0xa7fa('0x4f')+_0x202af8+_0xa7fa('0x8d'),{'UserId':_0x4b1fe8,[_0x202af8+_0xa7fa('0x88')]:_0x2df86a['id']});if(_0x202af8!==_0xa7fa('0x80')){return;}return db[_0xa7fa('0x8b')]['findAll']({'where':{'id':_0x2c6e85,'online':0x1},'attributes':['id','name',_0xa7fa('0x8e'),_0xa7fa('0x8f'),_0xa7fa('0x90')],'raw':!![]})[_0xa7fa('0x2a')](function(_0x27bdcd){var _0x2fdbe9=_[_0xa7fa('0x2f')](_0x27bdcd,function(_0x255d19){return db[_0xa7fa('0x91')][_0xa7fa('0x92')]({'membername':_0x255d19[_0xa7fa('0x2c')],'UserId':_0x255d19['id'],'queue_name':_0x2df86a[_0xa7fa('0x2c')],'VoiceQueueId':_0x2df86a['id'],'interface':_[_0xa7fa('0x93')](_0x255d19[_0xa7fa('0x90')])?util[_0xa7fa('0x94')](_0xa7fa('0x95'),_0x255d19[_0xa7fa('0x2c')]):_0x255d19[_0xa7fa('0x90')],'paused':_0x255d19[_0xa7fa('0x8f')]||![],'penalty':_0x2df86a[_0xa7fa('0x89')][_0xa7fa('0x8a')]},{'transaction':_0x57618f});});return Promise[_0xa7fa('0x96')](_0x2fdbe9);});});});return Promise[_0xa7fa('0x96')](_0x241e58);});return Promise['all'](_0x45909d);})[_0xa7fa('0x2a')](function(){return db['TeamVoicePrefix'][_0xa7fa('0x97')]({'where':{'teamId':_0x1256ad}})[_0xa7fa('0x2a')](function(_0xecf8a8){if(_0xecf8a8){var _0x3040d9=_['map'](_0x2c6e85,function(_0x58a315){db[_0xa7fa('0x98')]['upsert']({'UserId':_0x58a315,'VoicePrefixId':_0xecf8a8[_0xa7fa('0x99')]});});return Promise[_0xa7fa('0x96')](_0x3040d9);}});});});return Promise[_0xa7fa('0x96')](_0x99970d)[_0xa7fa('0x2a')](function(){return _0x598e57['addAgents'](_0x2c6e85,{'transaction':_0x57618f})[_0xa7fa('0x9a')](function(_0x10bb8f){return _0x10bb8f;});});});}})[_0xa7fa('0x2a')](respondWithResult(_0x38b8be,null))[_0xa7fa('0x49')](handleError(_0x38b8be,null));};exports['removeAgents']=function(_0x391148,_0x437b20){var _0x7d9536=_[_0xa7fa('0x9b')](_0x391148[_0xa7fa('0x36')]['ids'])?_0x391148['query'][_0xa7fa('0x7c')]:[_0x391148[_0xa7fa('0x36')][_0xa7fa('0x7c')]];var _0x4bbf7e=_0x391148[_0xa7fa('0x57')]['id'];return db['Team'][_0xa7fa('0x4c')]({'where':{'id':_0x4bbf7e}})[_0xa7fa('0x2a')](handleEntityNotFound(_0x437b20,null))[_0xa7fa('0x2a')](function(_0x16fead){if(_0x16fead){var _0x23efcb=['Voice',_0xa7fa('0x81'),_0xa7fa('0x82'),_0xa7fa('0x83'),_0xa7fa('0x84'),'Openchannel',_0xa7fa('0x86')];return db[_0xa7fa('0x59')][_0xa7fa('0x5a')](function(_0x18dfc6){var _0x57580e=_[_0xa7fa('0x2f')](_0x23efcb,function(_0x40427d){var _0x2ef7fc={'attributes':['id','name']};return _0x16fead[_0xa7fa('0x50')+_0x40427d+_0xa7fa('0x79')](_0x2ef7fc)[_0xa7fa('0x2a')](function(_0x4b3fd7){var _0x4511a5=_[_0xa7fa('0x2f')](_0x4b3fd7,function(_0x498709){return _0x498709[_0xa7fa('0x9c')](_0x7d9536,{'transaction':_0x18dfc6})[_0xa7fa('0x2a')](function(){var _0x48d45b=_['map'](_0x7d9536,function(_0x5955cc){socket[_0xa7fa('0x8c')](_0xa7fa('0x4f')+_0x40427d+_0xa7fa('0x9d'),{'UserId':Number(_0x5955cc),[_0x40427d+_0xa7fa('0x88')]:_0x498709['id']});if(_0x40427d!=='Voice'){return;}return db[_0xa7fa('0x91')][_0xa7fa('0x58')]({'where':{'VoiceQueueId':_0x498709['id'],'UserId':_0x5955cc},'transaction':_0x18dfc6});});return Promise[_0xa7fa('0x96')](_0x48d45b);});});return Promise[_0xa7fa('0x96')](_0x4511a5);});});return Promise[_0xa7fa('0x96')](_0x57580e)[_0xa7fa('0x2a')](function(){return _0x16fead['removeAgents'](_0x7d9536,{'transaction':_0x18dfc6});})['then'](function(){return db[_0xa7fa('0x6f')][_0xa7fa('0x97')]({'where':{'teamId':_0x4bbf7e}})[_0xa7fa('0x2a')](function(_0x2771af){if(_0x2771af){var _0x1a0e41=_[_0xa7fa('0x2f')](_0x7d9536,function(_0x88b8f6){db[_0xa7fa('0x98')][_0xa7fa('0x58')]({'where':{'UserId':_0x88b8f6,'VoicePrefixId':_0x2771af[_0xa7fa('0x99')]}});});return Promise[_0xa7fa('0x96')](_0x1a0e41);}});});});}})[_0xa7fa('0x2a')](respondWithStatusCode(_0x437b20,null))[_0xa7fa('0x49')](handleError(_0x437b20,null));};exports[_0xa7fa('0x9e')]=function(_0x3a5798,_0x5c8e67,_0x288ab7){var _0x239aae={};var _0x13d2bb={};var _0x291912;var _0x4c6d8d;return db[_0xa7fa('0x30')][_0xa7fa('0x97')]({'where':{'id':_0x3a5798['params']['id']}})[_0xa7fa('0x2a')](handleEntityNotFound(_0x5c8e67,null))['then'](function(_0x20010c){if(_0x20010c){_0x291912=_0x20010c;_0x13d2bb[_0xa7fa('0x35')]=_[_0xa7fa('0x37')](db[_0xa7fa('0x8b')][_0xa7fa('0x31')]);_0x13d2bb[_0xa7fa('0x36')]=_[_0xa7fa('0x37')](_0x3a5798[_0xa7fa('0x36')]);_0x13d2bb[_0xa7fa('0x38')]=_['intersection'](_0x13d2bb[_0xa7fa('0x35')],_0x13d2bb[_0xa7fa('0x36')]);_0x239aae[_0xa7fa('0x3b')]=_['intersection'](_0x13d2bb['model'],qs[_0xa7fa('0x3a')](_0x3a5798[_0xa7fa('0x36')][_0xa7fa('0x3a')]));_0x239aae['attributes']=_0x239aae[_0xa7fa('0x3b')][_0xa7fa('0x3c')]?_0x239aae[_0xa7fa('0x3b')]:_0x13d2bb[_0xa7fa('0x35')];_0x239aae[_0xa7fa('0x3e')]=qs['sort'](_0x3a5798[_0xa7fa('0x36')][_0xa7fa('0x3f')]);_0x239aae['where']=qs[_0xa7fa('0x38')](_[_0xa7fa('0x41')](_0x3a5798['query'],_0x13d2bb['filters']));if(_0x3a5798[_0xa7fa('0x36')][_0xa7fa('0x42')]){_0x239aae[_0xa7fa('0x40')]=_['merge'](_0x239aae[_0xa7fa('0x40')],{'$or':_[_0xa7fa('0x2f')](_0x239aae[_0xa7fa('0x3b')],function(_0x1395ec){var _0x5add2a={};_0x5add2a[_0x1395ec]={'$like':'%'+_0x3a5798['query']['filter']+'%'};return _0x5add2a;})});}_0x239aae=_[_0xa7fa('0x43')]({},_0x239aae,_0x3a5798[_0xa7fa('0x4b')]);return _0x291912[_0xa7fa('0x9e')](_0x239aae);}})[_0xa7fa('0x2a')](function(_0x49d053){if(_0x49d053){_0x4c6d8d=_0x49d053[_0xa7fa('0x3c')];if(!_0x3a5798[_0xa7fa('0x36')][_0xa7fa('0x9f')](_0xa7fa('0x3d'))){_0x239aae[_0xa7fa('0x22')]=qs[_0xa7fa('0x22')](_0x3a5798[_0xa7fa('0x36')][_0xa7fa('0x22')]);_0x239aae[_0xa7fa('0x24')]=qs[_0xa7fa('0x24')](_0x3a5798['query'][_0xa7fa('0x24')]);}return _0x291912['getAgents'](_0x239aae);}})['then'](function(_0x5de05d){if(_0x5de05d){return _0x5de05d?{'count':_0x4c6d8d,'rows':_0x5de05d}:null;}})[_0xa7fa('0x2a')](respondWithResult(_0x5c8e67,null))['catch'](handleError(_0x5c8e67,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d96d91c..1c095c4 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 _0x8140=['save','update','remove','emit','exports','events','Team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8140,0x16a));var _0x0814=function(_0xa871b3,_0x15c9c5){_0xa871b3=_0xa871b3-0x0;var _0x5e42ce=_0x8140[_0xa871b3];return _0x5e42ce;};'use strict';var EventEmitter=require(_0x0814('0x0'));var Team=require('../../mysqldb')['db'][_0x0814('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0814('0x2'),'afterUpdate':_0x0814('0x3'),'afterDestroy':_0x0814('0x4')};function emitEvent(_0x1a9843){return function(_0x4752b6,_0x42ba50,_0x4ac8c9){TeamEvents[_0x0814('0x5')](_0x1a9843+':'+_0x4752b6['id'],_0x4752b6);TeamEvents['emit'](_0x1a9843,_0x4752b6);_0x4ac8c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x0814('0x6')]=TeamEvents; \ No newline at end of file +var _0x99c8=['emit','hasOwnProperty','setMaxListeners','save','update'];(function(_0x55a337,_0x3528a2){var _0x1edcd4=function(_0x195448){while(--_0x195448){_0x55a337['push'](_0x55a337['shift']());}};_0x1edcd4(++_0x3528a2);}(_0x99c8,0x138));var _0x899c=function(_0x4653c7,_0x38862d){_0x4653c7=_0x4653c7-0x0;var _0x2bbaed=_0x99c8[_0x4653c7];return _0x2bbaed;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x899c('0x0')](0x0);var events={'afterCreate':_0x899c('0x1'),'afterUpdate':_0x899c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4f7a3d){return function(_0x388324,_0x42b336,_0x4921cd){TeamEvents[_0x899c('0x3')](_0x4f7a3d+':'+_0x388324['id'],_0x388324);TeamEvents['emit'](_0x4f7a3d,_0x388324);_0x4921cd(null);};}for(var e in events){if(events[_0x899c('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ee8225c..970a9c6 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 _0x37b3=['Chat','Fax','Mail','Openchannel','Sms','Whatsapp','./team.attributes','get','Queues','then','map','catch','exports','Team','teams'];(function(_0x15d700,_0x1e0998){var _0x252c7a=function(_0x5ea9b1){while(--_0x5ea9b1){_0x15d700['push'](_0x15d700['shift']());}};_0x252c7a(++_0x1e0998);}(_0x37b3,0x15f));var _0x337b=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x37b3[_0x2179f1];return _0x176ec9;};'use strict';var _=require('lodash');var attributes=require(_0x337b('0x0'));function getQueuesByChannel(_0x1a1d36,_0x3b2478){var _0x3b326c=_0x337b('0x1')+_0x3b2478+_0x337b('0x2');return _0x1a1d36[_0x3b326c]()[_0x337b('0x3')](function(_0x3aa4af){return _[_0x337b('0x4')](_0x3aa4af,function(_0xd649e6){_0xd649e6['setDataValue']('channel',_0x3b2478);return _0xd649e6;});})[_0x337b('0x5')](function(_0x150419){throw _0x150419;});}module[_0x337b('0x6')]=function(_0x131a40){return _0x131a40['define'](_0x337b('0x7'),attributes,{'tableName':_0x337b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x34e30f=this;var _0x55bcc4=[_0x337b('0x9'),_0x337b('0xa'),_0x337b('0xb'),_0x337b('0xc'),_0x337b('0xd'),'Voice',_0x337b('0xe')];return Promise['resolve']()[_0x337b('0x3')](function(){var _0x225e28=_[_0x337b('0x4')](_0x55bcc4,function(_0x10b383){return getQueuesByChannel(_0x34e30f,_0x10b383);});return Promise['all'](_0x225e28);})[_0x337b('0x5')](function(_0x2651f9){throw _0x2651f9;});}}});}; \ No newline at end of file +var _0xfe2d=['Queues','then','map','setDataValue','channel','exports','define','teams','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','all','catch','lodash','./team.attributes'];(function(_0x3ec154,_0x2bd690){var _0x388953=function(_0x3989f0){while(--_0x3989f0){_0x3ec154['push'](_0x3ec154['shift']());}};_0x388953(++_0x2bd690);}(_0xfe2d,0x1c0));var _0xdfe2=function(_0x3d488a,_0x313210){_0x3d488a=_0x3d488a-0x0;var _0x33e9c2=_0xfe2d[_0x3d488a];return _0x33e9c2;};'use strict';var _=require(_0xdfe2('0x0'));var attributes=require(_0xdfe2('0x1'));function getQueuesByChannel(_0x34420a,_0x43c8a3){var _0x5cd15e='get'+_0x43c8a3+_0xdfe2('0x2');return _0x34420a[_0x5cd15e]()[_0xdfe2('0x3')](function(_0x3eaf79){return _[_0xdfe2('0x4')](_0x3eaf79,function(_0x28f990){_0x28f990[_0xdfe2('0x5')](_0xdfe2('0x6'),_0x43c8a3);return _0x28f990;});})['catch'](function(_0x43a93b){throw _0x43a93b;});}module[_0xdfe2('0x7')]=function(_0x5c6c3f){return _0x5c6c3f[_0xdfe2('0x8')]('Team',attributes,{'tableName':_0xdfe2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x36526e=this;var _0x4d2658=['Chat',_0xdfe2('0xa'),_0xdfe2('0xb'),_0xdfe2('0xc'),_0xdfe2('0xd'),'Voice',_0xdfe2('0xe')];return Promise[_0xdfe2('0xf')]()['then'](function(){var _0x2f8e13=_[_0xdfe2('0x4')](_0x4d2658,function(_0x3ce2c4){return getQueuesByChannel(_0x36526e,_0x3ce2c4);});return Promise[_0xdfe2('0x10')](_0x2f8e13);})[_0xdfe2('0x11')](function(_0xe74f5f){throw _0xe74f5f;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 71440d0..58a9617 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 _0x05b6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0xfadbb0,_0x2986f5){var _0x4d7a6d=function(_0x216ac3){while(--_0x216ac3){_0xfadbb0['push'](_0xfadbb0['shift']());}};_0x4d7a6d(++_0x2986f5);}(_0x05b6,0x112));var _0x605b=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x05b6[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x605b('0x0'));var util=require(_0x605b('0x1'));var moment=require(_0x605b('0x2'));var BPromise=require(_0x605b('0x3'));var rs=require(_0x605b('0x4'));var fs=require('fs');var Redis=require(_0x605b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x605b('0x6'));var logger=require(_0x605b('0x7'))(_0x605b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x605b('0x9')][_0x605b('0xa')]({'port':0x232a});config[_0x605b('0xb')]=_['defaults'](config[_0x605b('0xb')],{'host':_0x605b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x605b('0xb')]));require('./team.socket')[_0x605b('0xd')](socket);function respondWithRpcPromise(_0x435a55,_0x449417,_0x119af3){return new BPromise(function(_0x112c49,_0x580a2e){return client['request'](_0x435a55,_0x119af3)[_0x605b('0xe')](function(_0x4c4f4f){logger[_0x605b('0xf')](_0x605b('0x10'),_0x449417,_0x605b('0x11'));logger[_0x605b('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x449417,_0x605b('0x11'),JSON[_0x605b('0x13')](_0x4c4f4f));if(_0x4c4f4f[_0x605b('0x14')]){if(_0x4c4f4f[_0x605b('0x14')][_0x605b('0x15')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x449417,_0x4c4f4f[_0x605b('0x14')][_0x605b('0x16')]);return _0x580a2e(_0x4c4f4f[_0x605b('0x14')][_0x605b('0x16')]);}logger[_0x605b('0x14')]('Team,\x20%s,\x20%s',_0x449417,_0x4c4f4f[_0x605b('0x14')][_0x605b('0x16')]);return _0x112c49(_0x4c4f4f[_0x605b('0x14')]['message']);}else{logger[_0x605b('0xf')](_0x605b('0x10'),_0x449417,_0x605b('0x11'));_0x112c49(_0x4c4f4f[_0x605b('0x17')]['message']);}})[_0x605b('0x18')](function(_0x4d6ba9){logger[_0x605b('0x14')](_0x605b('0x10'),_0x449417,_0x4d6ba9);_0x580a2e(_0x4d6ba9);});});} \ No newline at end of file +var _0x100e=['info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then'];(function(_0x2238ba,_0xfeb953){var _0x33032f=function(_0x337e44){while(--_0x337e44){_0x2238ba['push'](_0x2238ba['shift']());}};_0x33032f(++_0xfeb953);}(_0x100e,0xe4));var _0xe100=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x100e[_0x26efac];return _0x8482e4;};'use strict';var _=require(_0xe100('0x0'));var util=require(_0xe100('0x1'));var moment=require(_0xe100('0x2'));var BPromise=require(_0xe100('0x3'));var rs=require(_0xe100('0x4'));var fs=require('fs');var Redis=require(_0xe100('0x5'));var db=require(_0xe100('0x6'))['db'];var utils=require(_0xe100('0x7'));var logger=require(_0xe100('0x8'))('rpc');var config=require(_0xe100('0x9'));var jayson=require(_0xe100('0xa'));var client=jayson[_0xe100('0xb')][_0xe100('0xc')]({'port':0x232a});config[_0xe100('0xd')]=_[_0xe100('0xe')](config[_0xe100('0xd')],{'host':_0xe100('0xf'),'port':0x18eb});var socket=require(_0xe100('0x10'))(new Redis(config[_0xe100('0xd')]));require(_0xe100('0x11'))['register'](socket);function respondWithRpcPromise(_0x536248,_0x259868,_0x3860b2){return new BPromise(function(_0xe805f2,_0x514c6b){return client[_0xe100('0x12')](_0x536248,_0x3860b2)[_0xe100('0x13')](function(_0x976136){logger[_0xe100('0x14')](_0xe100('0x15'),_0x259868,_0xe100('0x16'));logger[_0xe100('0x17')](_0xe100('0x18'),_0x259868,_0xe100('0x16'),JSON[_0xe100('0x19')](_0x976136));if(_0x976136[_0xe100('0x1a')]){if(_0x976136[_0xe100('0x1a')][_0xe100('0x1b')]===0x1f4){logger[_0xe100('0x1a')]('Team,\x20%s,\x20%s',_0x259868,_0x976136[_0xe100('0x1a')][_0xe100('0x1c')]);return _0x514c6b(_0x976136['error']['message']);}logger[_0xe100('0x1a')](_0xe100('0x15'),_0x259868,_0x976136[_0xe100('0x1a')][_0xe100('0x1c')]);return _0xe805f2(_0x976136[_0xe100('0x1a')][_0xe100('0x1c')]);}else{logger[_0xe100('0x14')](_0xe100('0x15'),_0x259868,_0xe100('0x16'));_0xe805f2(_0x976136[_0xe100('0x1d')][_0xe100('0x1c')]);}})[_0xe100('0x1e')](function(_0x409ba3){logger['error'](_0xe100('0x15'),_0x259868,_0x409ba3);_0x514c6b(_0x409ba3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f8d8b20..ba91820 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 _0xec53=['team:','remove','emit','removeListener','register'];(function(_0x3256fa,_0x5b614d){var _0x23be9d=function(_0x514cb2){while(--_0x514cb2){_0x3256fa['push'](_0x3256fa['shift']());}};_0x23be9d(++_0x5b614d);}(_0xec53,0x1e6));var _0x3ec5=function(_0xbcf269,_0x45e444){_0xbcf269=_0xbcf269-0x0;var _0x255efd=_0xec53[_0xbcf269];return _0x255efd;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x3ec5('0x0'),'update'];function createListener(_0x1df5b8,_0x440e6f){return function(_0x5f0dd5){_0x440e6f[_0x3ec5('0x1')](_0x1df5b8,_0x5f0dd5);};}function removeListener(_0x45da39,_0x4ecbe4){return function(){TeamEvents[_0x3ec5('0x2')](_0x45da39,_0x4ecbe4);};}exports[_0x3ec5('0x3')]=function(_0x53abe3){for(var _0x4c4448=0x0,_0x5013bd=events['length'];_0x4c4448<_0x5013bd;_0x4c4448++){var _0x577d64=events[_0x4c4448];var _0x16e56a=createListener(_0x3ec5('0x4')+_0x577d64,_0x53abe3);TeamEvents['on'](_0x577d64,_0x16e56a);}}; \ No newline at end of file +var _0xe884=['save','remove','update','emit','removeListener','length','team:'];(function(_0x44b26c,_0x4ed68a){var _0x54ee3b=function(_0x37f984){while(--_0x37f984){_0x44b26c['push'](_0x44b26c['shift']());}};_0x54ee3b(++_0x4ed68a);}(_0xe884,0x11f));var _0x4e88=function(_0x3ba6f7,_0x11bb2e){_0x3ba6f7=_0x3ba6f7-0x0;var _0x4be6ab=_0xe884[_0x3ba6f7];return _0x4be6ab;};'use strict';var TeamEvents=require('./team.events');var events=[_0x4e88('0x0'),_0x4e88('0x1'),_0x4e88('0x2')];function createListener(_0x479edd,_0x3e6243){return function(_0x401815){_0x3e6243[_0x4e88('0x3')](_0x479edd,_0x401815);};}function removeListener(_0xaf7b72,_0x26b9a2){return function(){TeamEvents[_0x4e88('0x4')](_0xaf7b72,_0x26b9a2);};}exports['register']=function(_0x473d2d){for(var _0x5b487c=0x0,_0x1e1897=events[_0x4e88('0x5')];_0x5b487c<_0x1e1897;_0x5b487c++){var _0x3b4279=events[_0x5b487c];var _0x34ce8c=createListener(_0x4e88('0x6')+_0x3b4279,_0x473d2d);TeamEvents['on'](_0x3b4279,_0x34ce8c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e8823e6..a0d4a5b 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 _0x4058=['sequelize','exports','INTEGER'];(function(_0x5f1483,_0x1a3362){var _0x402149=function(_0x30ba68){while(--_0x30ba68){_0x5f1483['push'](_0x5f1483['shift']());}};_0x402149(++_0x1a3362);}(_0x4058,0x129));var _0x8405=function(_0x4947f0,_0x138314){_0x4947f0=_0x4947f0-0x0;var _0x11ad58=_0x4058[_0x4947f0];return _0x11ad58;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'TeamId':{'type':Sequelize[_0x8405('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x8405('0x2')]}}; \ No newline at end of file +var _0x418f=['INTEGER','sequelize','exports'];(function(_0x2a59af,_0x18d558){var _0x3af243=function(_0x5480d6){while(--_0x5480d6){_0x2a59af['push'](_0x2a59af['shift']());}};_0x3af243(++_0x18d558);}(_0x418f,0xdf));var _0xf418=function(_0xb8ab46,_0x38c556){_0xb8ab46=_0xb8ab46-0x0;var _0x28ce92=_0x418f[_0xb8ab46];return _0x28ce92;};'use strict';var Sequelize=require(_0xf418('0x0'));module[_0xf418('0x1')]={'TeamId':{'type':Sequelize[_0xf418('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xf418('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 4a7ea1b..bdbdc9b 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 _0x4e34=['../../config/logger','api','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x588852,_0x220867){var _0x2e9324=function(_0x5d2b8a){while(--_0x5d2b8a){_0x588852['push'](_0x588852['shift']());}};_0x2e9324(++_0x220867);}(_0x4e34,0x19e));var _0x44e3=function(_0x29c9c8,_0x458494){_0x29c9c8=_0x29c9c8-0x0;var _0x1f1340=_0x4e34[_0x29c9c8];return _0x1f1340;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44e3('0x0'))(_0x44e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x44e3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44e3('0x3'));var config=require(_0x44e3('0x4'));var attributes=require(_0x44e3('0x5'));module['exports']=function(_0x50805a,_0x162bd9){return _0x50805a[_0x44e3('0x6')](_0x44e3('0x7'),attributes,{'tableName':_0x44e3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4058=['api','moment','bluebird','request-promise','path','rimraf','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x4058,0x129));var _0x8405=function(_0x3e7524,_0x558896){_0x3e7524=_0x3e7524-0x0;var _0x41ff44=_0x4058[_0x3e7524];return _0x41ff44;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var logger=require(_0x8405('0x2'))(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var BPromise=require(_0x8405('0x5'));var rp=require(_0x8405('0x6'));var fs=require('fs');var path=require(_0x8405('0x7'));var rimraf=require(_0x8405('0x8'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x1db7ea,_0x257d43){return _0x1db7ea[_0x8405('0x9')](_0x8405('0xa'),attributes,{'tableName':_0x8405('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5b043a1..55db087 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14e386,_0x40fe52){var _0x394660=function(_0x575241){while(--_0x575241){_0x14e386['push'](_0x14e386['shift']());}};_0x394660(++_0x40fe52);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 53ac03f..b7a2435 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 _0xd3cd=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3cd,0x188));var _0xdd3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd3cd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xdd3c('0x0')]={'penalty':{'type':Sequelize[_0xdd3c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xedab=['exports','INTEGER','sequelize'];(function(_0x406566,_0x172b4d){var _0x28c7c0=function(_0x46a372){while(--_0x46a372){_0x406566['push'](_0x406566['shift']());}};_0x28c7c0(++_0x172b4d);}(_0xedab,0x164));var _0xbeda=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0xedab[_0x5e7514];return _0x12f472;};'use strict';var Sequelize=require(_0xbeda('0x0'));module[_0xbeda('0x1')]={'penalty':{'type':Sequelize[_0xbeda('0x2')],'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 dd9d9b3..aff14b8 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 _0xd84b=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','util'];(function(_0x173cf3,_0x3c8cab){var _0x55f3ba=function(_0x3ec66b){while(--_0x3ec66b){_0x173cf3['push'](_0x173cf3['shift']());}};_0x55f3ba(++_0x3c8cab);}(_0xd84b,0x177));var _0xbd84=function(_0x281e96,_0x4f5943){_0x281e96=_0x281e96-0x0;var _0x2bdab8=_0xd84b[_0x281e96];return _0x2bdab8;};'use strict';var _=require('lodash');var util=require(_0xbd84('0x0'));var logger=require(_0xbd84('0x1'))(_0xbd84('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd84('0x3'));var fs=require('fs');var path=require(_0xbd84('0x4'));var rimraf=require(_0xbd84('0x5'));var config=require(_0xbd84('0x6'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x394af9,_0x11dbbc){return _0x394af9[_0xbd84('0x7')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x833b=['../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','util','api','bluebird','path','rimraf'];(function(_0x2d89e0,_0xe6a00b){var _0x22e20d=function(_0x266212){while(--_0x266212){_0x2d89e0['push'](_0x2d89e0['shift']());}};_0x22e20d(++_0xe6a00b);}(_0x833b,0x131));var _0xb833=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x833b[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var logger=require('../../config/logger')(_0xb833('0x1'));var moment=require('moment');var BPromise=require(_0xb833('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb833('0x3'));var rimraf=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var attributes=require(_0xb833('0x6'));module[_0xb833('0x7')]=function(_0x35b3f0,_0x4422a2){return _0x35b3f0['define'](_0xb833('0x8'),attributes,{'tableName':_0xb833('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 3d169c1..b54b273 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 _0x038d=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','moment','bluebird'];(function(_0x426ab4,_0x3aa799){var _0x290c07=function(_0x41ffe4){while(--_0x41ffe4){_0x426ab4['push'](_0x426ab4['shift']());}};_0x290c07(++_0x3aa799);}(_0x038d,0xae));var _0xd038=function(_0x4d477a,_0x1b3ab8){_0x4d477a=_0x4d477a-0x0;var _0xfec158=_0x038d[_0x4d477a];return _0xfec158;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd038('0x0'));var BPromise=require(_0xd038('0x1'));var rs=require(_0xd038('0x2'));var fs=require('fs');var Redis=require(_0xd038('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd038('0x4'))(_0xd038('0x5'));var config=require(_0xd038('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x457b2f,_0x1f2511,_0x5d4b85){return new BPromise(function(_0x61a8fb,_0xd847cf){return client['request'](_0x457b2f,_0x5d4b85)[_0xd038('0x7')](function(_0x23703d){logger[_0xd038('0x8')](_0xd038('0x9'),_0x1f2511,'request\x20sent');logger['debug'](_0xd038('0xa'),_0x1f2511,_0xd038('0xb'),JSON['stringify'](_0x23703d));if(_0x23703d[_0xd038('0xc')]){if(_0x23703d[_0xd038('0xc')][_0xd038('0xd')]===0x1f4){logger['error'](_0xd038('0x9'),_0x1f2511,_0x23703d[_0xd038('0xc')][_0xd038('0xe')]);return _0xd847cf(_0x23703d['error'][_0xd038('0xe')]);}logger[_0xd038('0xc')](_0xd038('0x9'),_0x1f2511,_0x23703d['error']['message']);return _0x61a8fb(_0x23703d['error'][_0xd038('0xe')]);}else{logger[_0xd038('0x8')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1f2511,_0xd038('0xb'));_0x61a8fb(_0x23703d['result']['message']);}})[_0xd038('0xf')](function(_0x4ff355){logger[_0xd038('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1f2511,_0x4ff355);_0xd847cf(_0x4ff355);});});} \ No newline at end of file +var _0xd2ba=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x44b73a,_0xc9c07f){var _0x8622b3=function(_0xbed4a9){while(--_0xbed4a9){_0x44b73a['push'](_0x44b73a['shift']());}};_0x8622b3(++_0xc9c07f);}(_0xd2ba,0x108));var _0xad2b=function(_0x4b1573,_0x2d7e3b){_0x4b1573=_0x4b1573-0x0;var _0x5898dc=_0xd2ba[_0x4b1573];return _0x5898dc;};'use strict';var _=require(_0xad2b('0x0'));var util=require(_0xad2b('0x1'));var moment=require(_0xad2b('0x2'));var BPromise=require(_0xad2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad2b('0x4'));var db=require(_0xad2b('0x5'))['db'];var utils=require(_0xad2b('0x6'));var logger=require(_0xad2b('0x7'))(_0xad2b('0x8'));var config=require('../../config/environment');var jayson=require(_0xad2b('0x9'));var client=jayson[_0xad2b('0xa')][_0xad2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x874e33,_0x1cb5f7,_0x35d4ec){return new BPromise(function(_0xb9e4b4,_0x3945c5){return client[_0xad2b('0xc')](_0x874e33,_0x35d4ec)[_0xad2b('0xd')](function(_0x52488c){logger[_0xad2b('0xe')](_0xad2b('0xf'),_0x1cb5f7,_0xad2b('0x10'));logger[_0xad2b('0x11')](_0xad2b('0x12'),_0x1cb5f7,_0xad2b('0x10'),JSON[_0xad2b('0x13')](_0x52488c));if(_0x52488c[_0xad2b('0x14')]){if(_0x52488c[_0xad2b('0x14')][_0xad2b('0x15')]===0x1f4){logger['error'](_0xad2b('0xf'),_0x1cb5f7,_0x52488c[_0xad2b('0x14')][_0xad2b('0x16')]);return _0x3945c5(_0x52488c[_0xad2b('0x14')][_0xad2b('0x16')]);}logger[_0xad2b('0x14')](_0xad2b('0xf'),_0x1cb5f7,_0x52488c[_0xad2b('0x14')]['message']);return _0xb9e4b4(_0x52488c['error'][_0xad2b('0x16')]);}else{logger[_0xad2b('0xe')](_0xad2b('0xf'),_0x1cb5f7,'request\x20sent');_0xb9e4b4(_0x52488c[_0xad2b('0x17')][_0xad2b('0x16')]);}})['catch'](function(_0x441d99){logger[_0xad2b('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1cb5f7,_0x441d99);_0x3945c5(_0x441d99);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 74f63b4..06d2984 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 _0x7e74=['index','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x7e74,0xbd));var _0x47e7=function(_0x5eaa4d,_0xa552bd){_0x5eaa4d=_0x5eaa4d-0x0;var _0x1a6079=_0x7e74[_0x5eaa4d];return _0x1a6079;};'use strict';var multer=require(_0x47e7('0x0'));var util=require('util');var path=require(_0x47e7('0x1'));var timeout=require(_0x47e7('0x2'));var express=require(_0x47e7('0x3'));var router=express[_0x47e7('0x4')]();var fs_extra=require(_0x47e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47e7('0x6'));var config=require(_0x47e7('0x7'));var controller=require(_0x47e7('0x8'));router[_0x47e7('0x9')]('/',auth[_0x47e7('0xa')](),controller[_0x47e7('0xb')]);router[_0x47e7('0x9')]('/:id',auth[_0x47e7('0xa')](),controller['show']);router[_0x47e7('0xc')]('/',auth[_0x47e7('0xa')](),controller[_0x47e7('0xd')]);router[_0x47e7('0xe')](_0x47e7('0xf'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x10')]);router[_0x47e7('0x11')](_0x47e7('0xf'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x12')]);module[_0x47e7('0x13')]=router; \ No newline at end of file +var _0x56b9=['isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./template.controller','get','index','/:id'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x56b9,0x196));var _0x956b=function(_0x402ad6,_0x57ed1a){_0x402ad6=_0x402ad6-0x0;var _0x472740=_0x56b9[_0x402ad6];return _0x472740;};'use strict';var multer=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var path=require(_0x956b('0x2'));var timeout=require(_0x956b('0x3'));var express=require(_0x956b('0x4'));var router=express[_0x956b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x956b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x956b('0x7'));var controller=require(_0x956b('0x8'));router[_0x956b('0x9')]('/',auth['isAuthenticated'](),controller[_0x956b('0xa')]);router[_0x956b('0x9')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0xd')]);router[_0x956b('0xe')]('/',auth[_0x956b('0xc')](),controller[_0x956b('0xf')]);router['put'](_0x956b('0xb'),auth[_0x956b('0xc')](),controller['update']);router[_0x956b('0x10')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0x11')]);module[_0x956b('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 3906d3e..377033c 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 _0xbd64=['TEXT','exports','STRING'];(function(_0xf746ac,_0x146b0f){var _0x3a2369=function(_0x367445){while(--_0x367445){_0xf746ac['push'](_0xf746ac['shift']());}};_0x3a2369(++_0x146b0f);}(_0xbd64,0x1d8));var _0x4bd6=function(_0x16164c,_0x4c777d){_0x16164c=_0x16164c-0x0;var _0x340256=_0xbd64[_0x16164c];return _0x340256;};'use strict';var Sequelize=require('sequelize');module[_0x4bd6('0x0')]={'name':{'type':Sequelize[_0x4bd6('0x1')]},'description':{'type':Sequelize[_0x4bd6('0x1')]},'html':{'type':Sequelize[_0x4bd6('0x2')]}}; \ No newline at end of file +var _0x2ddc=['sequelize','exports','TEXT'];(function(_0x2d13c2,_0x1fab3e){var _0x1e2638=function(_0x37f64f){while(--_0x37f64f){_0x2d13c2['push'](_0x2d13c2['shift']());}};_0x1e2638(++_0x1fab3e);}(_0x2ddc,0x195));var _0xc2dd=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2ddc[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xc2dd('0x0'));module[_0xc2dd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xc2dd('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index eced253..c8d520b 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 _0x4c11=['api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','name','send','map','Template','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','params','rawAttributes','length','find','catch','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x38065b,_0x39133c){var _0x3cb11a=function(_0x4b8f7c){while(--_0x4b8f7c){_0x38065b['push'](_0x38065b['shift']());}};_0x3cb11a(++_0x39133c);}(_0x4c11,0x89));var _0x14c1=function(_0x1237b5,_0x4786ad){_0x1237b5=_0x1237b5-0x0;var _0x5a2b68=_0x4c11[_0x1237b5];return _0x5a2b68;};'use strict';var emlformat=require(_0x14c1('0x0'));var rimraf=require(_0x14c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14c1('0x2'));var rp=require('request-promise');var moment=require(_0x14c1('0x3'));var BPromise=require(_0x14c1('0x4'));var Mustache=require(_0x14c1('0x5'));var util=require(_0x14c1('0x6'));var path=require(_0x14c1('0x7'));var sox=require(_0x14c1('0x8'));var csv=require(_0x14c1('0x9'));var ejs=require(_0x14c1('0xa'));var fs=require('fs');var fs_extra=require(_0x14c1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x14c1('0xc'));var jsforce=require(_0x14c1('0xd'));var deskjs=require(_0x14c1('0xe'));var toCsv=require(_0x14c1('0x9'));var querystring=require(_0x14c1('0xf'));var Papa=require('papaparse');var Redis=require(_0x14c1('0x10'));var authService=require(_0x14c1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x14c1('0x12'));var hardwareService=require(_0x14c1('0x13'));var logger=require(_0x14c1('0x14'))(_0x14c1('0x15'));var utils=require(_0x14c1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x14c1('0x17'))['db'];function respondWithStatusCode(_0x3a2327,_0x487ab1){_0x487ab1=_0x487ab1||0xcc;return function(_0x4efed4){if(_0x4efed4){return _0x3a2327[_0x14c1('0x18')](_0x487ab1);}return _0x3a2327[_0x14c1('0x19')](_0x487ab1)[_0x14c1('0x1a')]();};}function respondWithResult(_0x137450,_0x1adaa9){_0x1adaa9=_0x1adaa9||0xc8;return function(_0x4755eb){if(_0x4755eb){return _0x137450[_0x14c1('0x19')](_0x1adaa9)['json'](_0x4755eb);}};}function respondWithFilteredResult(_0x586701,_0x1a25b0){return function(_0x2fe428){if(_0x2fe428){var _0x107cf2=typeof _0x1a25b0['offset']===_0x14c1('0x1b')&&typeof _0x1a25b0[_0x14c1('0x1c')]===_0x14c1('0x1b');var _0x24d582=_0x2fe428[_0x14c1('0x1d')];var _0xa90a57=_0x107cf2?0x0:_0x1a25b0[_0x14c1('0x1e')];var _0x10bf07=_0x107cf2?_0x2fe428[_0x14c1('0x1d')]:_0x1a25b0[_0x14c1('0x1e')]+_0x1a25b0[_0x14c1('0x1c')];var _0x28bb18;if(_0x10bf07>=_0x24d582){_0x10bf07=_0x24d582;_0x28bb18=0xc8;}else{_0x28bb18=0xce;}_0x586701[_0x14c1('0x19')](_0x28bb18);return _0x586701[_0x14c1('0x1f')](_0x14c1('0x20'),_0xa90a57+'-'+_0x10bf07+'/'+_0x24d582)[_0x14c1('0x21')](_0x2fe428);}return null;};}function patchUpdates(_0x2c6cb1){return function(_0x1e8c23){try{jsonpatch[_0x14c1('0x22')](_0x1e8c23,_0x2c6cb1,!![]);}catch(_0x35a908){return BPromise[_0x14c1('0x23')](_0x35a908);}return _0x1e8c23[_0x14c1('0x24')]();};}function saveUpdates(_0x540436,_0x56c159){return function(_0x2f7f8e){if(_0x2f7f8e){return _0x2f7f8e[_0x14c1('0x25')](_0x540436)[_0x14c1('0x26')](function(_0x3b8fb6){return _0x3b8fb6;});}return null;};}function removeEntity(_0x5216fd,_0x940690){return function(_0x44a94f){if(_0x44a94f){return _0x44a94f[_0x14c1('0x27')]()['then'](function(){var _0x4ea63e=_0x44a94f[_0x14c1('0x28')]({'plain':!![]});var _0x90bdba=_0x14c1('0x29');return db[_0x14c1('0x2a')][_0x14c1('0x27')]({'where':{'type':_0x90bdba,'resourceId':_0x4ea63e['id']}})['then'](function(){return _0x44a94f;});})[_0x14c1('0x26')](function(){_0x5216fd[_0x14c1('0x19')](0xcc)[_0x14c1('0x1a')]();});}};}function handleEntityNotFound(_0x328ffd,_0x49b55d){return function(_0x5913d1){if(!_0x5913d1){_0x328ffd['sendStatus'](0x194);}return _0x5913d1;};}function handleError(_0x5ab95f,_0x5540c0){_0x5540c0=_0x5540c0||0x1f4;return function(_0x301a28){logger[_0x14c1('0x2b')](_0x301a28['stack']);if(_0x301a28['name']){delete _0x301a28[_0x14c1('0x2c')];}_0x5ab95f['status'](_0x5540c0)[_0x14c1('0x2d')](_0x301a28);};}exports['index']=function(_0x4a913a,_0x10adac){var _0x3fbd1b={},_0xa4f1ec={},_0x2b1c0e={'count':0x0,'rows':[]};var _0xc4d457=_[_0x14c1('0x2e')](db[_0x14c1('0x2f')]['rawAttributes'],function(_0x266750){return{'name':_0x266750[_0x14c1('0x30')],'type':_0x266750[_0x14c1('0x31')]['key']};});_0xa4f1ec['model']=_[_0x14c1('0x2e')](_0xc4d457,_0x14c1('0x2c'));_0xa4f1ec[_0x14c1('0x32')]=_[_0x14c1('0x33')](_0x4a913a[_0x14c1('0x32')]);_0xa4f1ec[_0x14c1('0x34')]=_[_0x14c1('0x35')](_0xa4f1ec[_0x14c1('0x36')],_0xa4f1ec[_0x14c1('0x32')]);_0x3fbd1b[_0x14c1('0x37')]=_['intersection'](_0xa4f1ec[_0x14c1('0x36')],qs[_0x14c1('0x38')](_0x4a913a['query'][_0x14c1('0x38')]));_0x3fbd1b[_0x14c1('0x37')]=_0x3fbd1b[_0x14c1('0x37')]['length']?_0x3fbd1b['attributes']:_0xa4f1ec[_0x14c1('0x36')];if(!_0x4a913a[_0x14c1('0x32')]['hasOwnProperty'](_0x14c1('0x39'))){_0x3fbd1b[_0x14c1('0x1c')]=qs[_0x14c1('0x1c')](_0x4a913a['query'][_0x14c1('0x1c')]);_0x3fbd1b[_0x14c1('0x1e')]=qs['offset'](_0x4a913a[_0x14c1('0x32')][_0x14c1('0x1e')]);}_0x3fbd1b[_0x14c1('0x3a')]=qs[_0x14c1('0x3b')](_0x4a913a[_0x14c1('0x32')][_0x14c1('0x3b')]);_0x3fbd1b[_0x14c1('0x3c')]=qs[_0x14c1('0x34')](_[_0x14c1('0x3d')](_0x4a913a[_0x14c1('0x32')],_0xa4f1ec[_0x14c1('0x34')]),_0xc4d457);if(_0x4a913a[_0x14c1('0x32')]['filter']){_0x3fbd1b['where']=_[_0x14c1('0x3e')](_0x3fbd1b[_0x14c1('0x3c')],{'$or':_[_0x14c1('0x2e')](_0xc4d457,function(_0x45f1a5){if(_0x45f1a5[_0x14c1('0x31')]!==_0x14c1('0x3f')){var _0x1ab935={};_0x1ab935[_0x45f1a5[_0x14c1('0x2c')]]={'$like':'%'+_0x4a913a[_0x14c1('0x32')][_0x14c1('0x40')]+'%'};return _0x1ab935;}})});}_0x3fbd1b=_[_0x14c1('0x3e')]({},_0x3fbd1b,_0x4a913a[_0x14c1('0x41')]);var _0x16e0f7={'where':_0x3fbd1b[_0x14c1('0x3c')]};return db[_0x14c1('0x2f')][_0x14c1('0x1d')](_0x16e0f7)['then'](function(_0x4613d8){_0x2b1c0e[_0x14c1('0x1d')]=_0x4613d8;if(_0x4a913a[_0x14c1('0x32')]['includeAll']){_0x3fbd1b[_0x14c1('0x42')]=[{'all':!![]}];}return db[_0x14c1('0x2f')]['findAll'](_0x3fbd1b);})[_0x14c1('0x26')](function(_0x10c6f4){_0x2b1c0e['rows']=_0x10c6f4;return _0x2b1c0e;})[_0x14c1('0x26')](respondWithFilteredResult(_0x10adac,_0x3fbd1b))['catch'](handleError(_0x10adac,null));};exports['show']=function(_0x34a9f0,_0x5909e8){var _0x533690={'raw':!![],'where':{'id':_0x34a9f0[_0x14c1('0x43')]['id']}},_0xf4be59={};_0xf4be59[_0x14c1('0x36')]=_[_0x14c1('0x33')](db[_0x14c1('0x2f')][_0x14c1('0x44')]);_0xf4be59[_0x14c1('0x32')]=_['keys'](_0x34a9f0['query']);_0xf4be59['filters']=_[_0x14c1('0x35')](_0xf4be59['model'],_0xf4be59[_0x14c1('0x32')]);_0x533690[_0x14c1('0x37')]=_[_0x14c1('0x35')](_0xf4be59[_0x14c1('0x36')],qs[_0x14c1('0x38')](_0x34a9f0[_0x14c1('0x32')][_0x14c1('0x38')]));_0x533690['attributes']=_0x533690[_0x14c1('0x37')][_0x14c1('0x45')]?_0x533690[_0x14c1('0x37')]:_0xf4be59[_0x14c1('0x36')];if(_0x34a9f0[_0x14c1('0x32')]['includeAll']){_0x533690[_0x14c1('0x42')]=[{'all':!![]}];}_0x533690=_[_0x14c1('0x3e')]({},_0x533690,_0x34a9f0['options']);return db[_0x14c1('0x2f')][_0x14c1('0x46')](_0x533690)[_0x14c1('0x26')](handleEntityNotFound(_0x5909e8,null))[_0x14c1('0x26')](respondWithResult(_0x5909e8,null))[_0x14c1('0x47')](handleError(_0x5909e8,null));};exports['create']=function(_0x3305c7,_0x583182){return db[_0x14c1('0x2f')][_0x14c1('0x48')](_0x3305c7['body'],{})['then'](function(_0x50673d){var _0x2106b7=_0x3305c7[_0x14c1('0x49')][_0x14c1('0x28')]({'plain':!![]});if(!_0x2106b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2106b7[_0x14c1('0x4a')]==='user'){var _0x125c62=_0x50673d[_0x14c1('0x28')]({'plain':!![]});var _0x3bd116='Templates';return db['UserProfileSection'][_0x14c1('0x46')]({'where':{'name':_0x3bd116,'userProfileId':_0x2106b7[_0x14c1('0x4b')]},'raw':!![]})[_0x14c1('0x26')](function(_0x563be4){if(_0x563be4&&_0x563be4[_0x14c1('0x4c')]===0x0){return db[_0x14c1('0x2a')][_0x14c1('0x48')]({'name':_0x125c62['name'],'resourceId':_0x125c62['id'],'type':_0x563be4[_0x14c1('0x2c')],'sectionId':_0x563be4['id']},{})[_0x14c1('0x26')](function(){return _0x50673d;});}else{return _0x50673d;}})[_0x14c1('0x47')](function(_0x30287d){logger[_0x14c1('0x2b')](_0x14c1('0x4d'),_0x30287d);throw _0x30287d;});}return _0x50673d;})[_0x14c1('0x26')](respondWithResult(_0x583182,0xc9))[_0x14c1('0x47')](handleError(_0x583182,null));};exports['update']=function(_0x28e71b,_0x419204){if(_0x28e71b['body']['id']){delete _0x28e71b[_0x14c1('0x4e')]['id'];}return db['Template'][_0x14c1('0x46')]({'where':{'id':_0x28e71b[_0x14c1('0x43')]['id']}})[_0x14c1('0x26')](handleEntityNotFound(_0x419204,null))[_0x14c1('0x26')](saveUpdates(_0x28e71b[_0x14c1('0x4e')],null))[_0x14c1('0x26')](respondWithResult(_0x419204,null))[_0x14c1('0x47')](handleError(_0x419204,null));};exports[_0x14c1('0x27')]=function(_0x92cc16,_0x188172){return db['Template'][_0x14c1('0x46')]({'where':{'id':_0x92cc16[_0x14c1('0x43')]['id']}})[_0x14c1('0x26')](handleEntityNotFound(_0x188172,null))[_0x14c1('0x26')](removeEntity(_0x188172,null))['catch'](handleError(_0x188172,null));}; \ No newline at end of file +var _0x1794=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','count','includeAll','rows','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','offset','limit','set','Content-Range','apply','reject','then','destroy','Templates','UserProfileResource','status','end','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x5937c8,_0x179dbd){var _0x3e4bf3=function(_0x144feb){while(--_0x144feb){_0x5937c8['push'](_0x5937c8['shift']());}};_0x3e4bf3(++_0x179dbd);}(_0x1794,0x165));var _0x4179=function(_0x110624,_0x3ab97a){_0x110624=_0x110624-0x0;var _0x4b015b=_0x1794[_0x110624];return _0x4b015b;};'use strict';var emlformat=require(_0x4179('0x0'));var rimraf=require(_0x4179('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4179('0x2'));var rp=require(_0x4179('0x3'));var moment=require(_0x4179('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4179('0x5'));var util=require(_0x4179('0x6'));var path=require(_0x4179('0x7'));var sox=require(_0x4179('0x8'));var csv=require(_0x4179('0x9'));var ejs=require(_0x4179('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4179('0xb'));var squel=require(_0x4179('0xc'));var crypto=require(_0x4179('0xd'));var jsforce=require(_0x4179('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4179('0x9'));var querystring=require('querystring');var Papa=require(_0x4179('0xf'));var Redis=require(_0x4179('0x10'));var authService=require(_0x4179('0x11'));var qs=require(_0x4179('0x12'));var as=require(_0x4179('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4179('0x14'))(_0x4179('0x15'));var utils=require('../../config/utils');var config=require(_0x4179('0x16'));var licenseUtil=require(_0x4179('0x17'));var db=require(_0x4179('0x18'))['db'];function respondWithStatusCode(_0x52ddec,_0x167911){_0x167911=_0x167911||0xcc;return function(_0x38ec3e){if(_0x38ec3e){return _0x52ddec[_0x4179('0x19')](_0x167911);}return _0x52ddec['status'](_0x167911)['end']();};}function respondWithResult(_0x3a3c36,_0x2ec686){_0x2ec686=_0x2ec686||0xc8;return function(_0xab950d){if(_0xab950d){return _0x3a3c36['status'](_0x2ec686)[_0x4179('0x1a')](_0xab950d);}};}function respondWithFilteredResult(_0x82a9c5,_0x200c8d){return function(_0x47c666){if(_0x47c666){var _0x105646=typeof _0x200c8d['offset']===_0x4179('0x1b')&&typeof _0x200c8d['limit']==='undefined';var _0x5b59c8=_0x47c666['count'];var _0xb5066f=_0x105646?0x0:_0x200c8d[_0x4179('0x1c')];var _0x2f9a65=_0x105646?_0x47c666['count']:_0x200c8d[_0x4179('0x1c')]+_0x200c8d[_0x4179('0x1d')];var _0x5b3378;if(_0x2f9a65>=_0x5b59c8){_0x2f9a65=_0x5b59c8;_0x5b3378=0xc8;}else{_0x5b3378=0xce;}_0x82a9c5['status'](_0x5b3378);return _0x82a9c5[_0x4179('0x1e')](_0x4179('0x1f'),_0xb5066f+'-'+_0x2f9a65+'/'+_0x5b59c8)['json'](_0x47c666);}return null;};}function patchUpdates(_0x3cc2ce){return function(_0x433bce){try{jsonpatch[_0x4179('0x20')](_0x433bce,_0x3cc2ce,!![]);}catch(_0x3a9314){return BPromise[_0x4179('0x21')](_0x3a9314);}return _0x433bce['save']();};}function saveUpdates(_0xd44b0f,_0x45ff99){return function(_0x5aa048){if(_0x5aa048){return _0x5aa048['update'](_0xd44b0f)[_0x4179('0x22')](function(_0x5a2758){return _0x5a2758;});}return null;};}function removeEntity(_0x541027,_0x55cf4d){return function(_0x1974cf){if(_0x1974cf){return _0x1974cf[_0x4179('0x23')]()['then'](function(){var _0x3605b6=_0x1974cf['get']({'plain':!![]});var _0x44ddc2=_0x4179('0x24');return db[_0x4179('0x25')][_0x4179('0x23')]({'where':{'type':_0x44ddc2,'resourceId':_0x3605b6['id']}})[_0x4179('0x22')](function(){return _0x1974cf;});})[_0x4179('0x22')](function(){_0x541027[_0x4179('0x26')](0xcc)[_0x4179('0x27')]();});}};}function handleEntityNotFound(_0x2699a0,_0x584058){return function(_0x55723e){if(!_0x55723e){_0x2699a0[_0x4179('0x19')](0x194);}return _0x55723e;};}function handleError(_0x319963,_0x5d62b7){_0x5d62b7=_0x5d62b7||0x1f4;return function(_0x173406){logger['error'](_0x173406[_0x4179('0x28')]);if(_0x173406[_0x4179('0x29')]){delete _0x173406['name'];}_0x319963[_0x4179('0x26')](_0x5d62b7)[_0x4179('0x2a')](_0x173406);};}exports[_0x4179('0x2b')]=function(_0x2f6662,_0xa39568){var _0x45ad22={},_0x5c665f={},_0xd432a6={'count':0x0,'rows':[]};var _0x4c6fb3=_[_0x4179('0x2c')](db[_0x4179('0x2d')][_0x4179('0x2e')],function(_0x53d573){return{'name':_0x53d573[_0x4179('0x2f')],'type':_0x53d573[_0x4179('0x30')][_0x4179('0x31')]};});_0x5c665f[_0x4179('0x32')]=_['map'](_0x4c6fb3,_0x4179('0x29'));_0x5c665f['query']=_[_0x4179('0x33')](_0x2f6662[_0x4179('0x34')]);_0x5c665f[_0x4179('0x35')]=_[_0x4179('0x36')](_0x5c665f['model'],_0x5c665f[_0x4179('0x34')]);_0x45ad22[_0x4179('0x37')]=_[_0x4179('0x36')](_0x5c665f[_0x4179('0x32')],qs[_0x4179('0x38')](_0x2f6662['query']['fields']));_0x45ad22[_0x4179('0x37')]=_0x45ad22[_0x4179('0x37')][_0x4179('0x39')]?_0x45ad22[_0x4179('0x37')]:_0x5c665f[_0x4179('0x32')];if(!_0x2f6662[_0x4179('0x34')][_0x4179('0x3a')](_0x4179('0x3b'))){_0x45ad22[_0x4179('0x1d')]=qs[_0x4179('0x1d')](_0x2f6662[_0x4179('0x34')]['limit']);_0x45ad22[_0x4179('0x1c')]=qs[_0x4179('0x1c')](_0x2f6662['query'][_0x4179('0x1c')]);}_0x45ad22[_0x4179('0x3c')]=qs[_0x4179('0x3d')](_0x2f6662['query'][_0x4179('0x3d')]);_0x45ad22[_0x4179('0x3e')]=qs['filters'](_['pick'](_0x2f6662[_0x4179('0x34')],_0x5c665f[_0x4179('0x35')]),_0x4c6fb3);if(_0x2f6662[_0x4179('0x34')]['filter']){_0x45ad22[_0x4179('0x3e')]=_[_0x4179('0x3f')](_0x45ad22['where'],{'$or':_[_0x4179('0x2c')](_0x4c6fb3,function(_0x5d2450){if(_0x5d2450[_0x4179('0x30')]!=='VIRTUAL'){var _0x3a8828={};_0x3a8828[_0x5d2450[_0x4179('0x29')]]={'$like':'%'+_0x2f6662[_0x4179('0x34')]['filter']+'%'};return _0x3a8828;}})});}_0x45ad22=_[_0x4179('0x3f')]({},_0x45ad22,_0x2f6662[_0x4179('0x40')]);var _0x22b9b8={'where':_0x45ad22[_0x4179('0x3e')]};return db[_0x4179('0x2d')][_0x4179('0x41')](_0x22b9b8)[_0x4179('0x22')](function(_0x328055){_0xd432a6[_0x4179('0x41')]=_0x328055;if(_0x2f6662[_0x4179('0x34')][_0x4179('0x42')]){_0x45ad22['include']=[{'all':!![]}];}return db[_0x4179('0x2d')]['findAll'](_0x45ad22);})[_0x4179('0x22')](function(_0x15ece6){_0xd432a6[_0x4179('0x43')]=_0x15ece6;return _0xd432a6;})['then'](respondWithFilteredResult(_0xa39568,_0x45ad22))['catch'](handleError(_0xa39568,null));};exports['show']=function(_0x59fd88,_0x2e232b){var _0x336aa2={'raw':!![],'where':{'id':_0x59fd88[_0x4179('0x44')]['id']}},_0x32207b={};_0x32207b[_0x4179('0x32')]=_['keys'](db[_0x4179('0x2d')][_0x4179('0x2e')]);_0x32207b[_0x4179('0x34')]=_[_0x4179('0x33')](_0x59fd88[_0x4179('0x34')]);_0x32207b['filters']=_['intersection'](_0x32207b[_0x4179('0x32')],_0x32207b[_0x4179('0x34')]);_0x336aa2['attributes']=_[_0x4179('0x36')](_0x32207b[_0x4179('0x32')],qs['fields'](_0x59fd88[_0x4179('0x34')]['fields']));_0x336aa2[_0x4179('0x37')]=_0x336aa2[_0x4179('0x37')][_0x4179('0x39')]?_0x336aa2[_0x4179('0x37')]:_0x32207b[_0x4179('0x32')];if(_0x59fd88['query'][_0x4179('0x42')]){_0x336aa2[_0x4179('0x45')]=[{'all':!![]}];}_0x336aa2=_['merge']({},_0x336aa2,_0x59fd88['options']);return db[_0x4179('0x2d')][_0x4179('0x46')](_0x336aa2)[_0x4179('0x22')](handleEntityNotFound(_0x2e232b,null))[_0x4179('0x22')](respondWithResult(_0x2e232b,null))['catch'](handleError(_0x2e232b,null));};exports['create']=function(_0x4b88f9,_0x1e2c90){return db['Template']['create'](_0x4b88f9[_0x4179('0x47')],{})[_0x4179('0x22')](function(_0x4f77d8){var _0x41b597=_0x4b88f9[_0x4179('0x48')]['get']({'plain':!![]});if(!_0x41b597)throw new Error(_0x4179('0x49'));if(_0x41b597['role']===_0x4179('0x48')){var _0x168b57=_0x4f77d8[_0x4179('0x4a')]({'plain':!![]});var _0x5e0310=_0x4179('0x24');return db[_0x4179('0x4b')]['find']({'where':{'name':_0x5e0310,'userProfileId':_0x41b597[_0x4179('0x4c')]},'raw':!![]})[_0x4179('0x22')](function(_0x27f1e1){if(_0x27f1e1&&_0x27f1e1[_0x4179('0x4d')]===0x0){return db['UserProfileResource'][_0x4179('0x4e')]({'name':_0x168b57[_0x4179('0x29')],'resourceId':_0x168b57['id'],'type':_0x27f1e1['name'],'sectionId':_0x27f1e1['id']},{})[_0x4179('0x22')](function(){return _0x4f77d8;});}else{return _0x4f77d8;}})[_0x4179('0x4f')](function(_0x191d23){logger['error'](_0x4179('0x50'),_0x191d23);throw _0x191d23;});}return _0x4f77d8;})[_0x4179('0x22')](respondWithResult(_0x1e2c90,0xc9))[_0x4179('0x4f')](handleError(_0x1e2c90,null));};exports[_0x4179('0x51')]=function(_0x2e7ede,_0x4d885e){if(_0x2e7ede['body']['id']){delete _0x2e7ede['body']['id'];}return db['Template']['find']({'where':{'id':_0x2e7ede[_0x4179('0x44')]['id']}})[_0x4179('0x22')](handleEntityNotFound(_0x4d885e,null))[_0x4179('0x22')](saveUpdates(_0x2e7ede['body'],null))[_0x4179('0x22')](respondWithResult(_0x4d885e,null))[_0x4179('0x4f')](handleError(_0x4d885e,null));};exports[_0x4179('0x23')]=function(_0x1d3d2f,_0x1f7d7f){return db[_0x4179('0x2d')]['find']({'where':{'id':_0x1d3d2f[_0x4179('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f7d7f,null))['then'](removeEntity(_0x1f7d7f,null))['catch'](handleError(_0x1f7d7f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c245f73..b53f1fd 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 _0x1a7e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1a7e,0xc0));var _0xe1a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1a7('0x0'));var util=require(_0xe1a7('0x1'));var logger=require(_0xe1a7('0x2'))(_0xe1a7('0x3'));var moment=require(_0xe1a7('0x4'));var BPromise=require(_0xe1a7('0x5'));var rp=require(_0xe1a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1a7('0x7'));var config=require(_0xe1a7('0x8'));var attributes=require(_0xe1a7('0x9'));module[_0xe1a7('0xa')]=function(_0x4b17c2,_0x45319b){return _0x4b17c2['define'](_0xe1a7('0xb'),attributes,{'tableName':_0xe1a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3a3=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x245e2d,_0x1515a6){var _0x2d1b6f=function(_0xd5b890){while(--_0xd5b890){_0x245e2d['push'](_0x245e2d['shift']());}};_0x2d1b6f(++_0x1515a6);}(_0xf3a3,0x65));var _0x3f3a=function(_0x455a0f,_0x590780){_0x455a0f=_0x455a0f-0x0;var _0x36701b=_0xf3a3[_0x455a0f];return _0x36701b;};'use strict';var _=require(_0x3f3a('0x0'));var util=require(_0x3f3a('0x1'));var logger=require(_0x3f3a('0x2'))(_0x3f3a('0x3'));var moment=require(_0x3f3a('0x4'));var BPromise=require(_0x3f3a('0x5'));var rp=require(_0x3f3a('0x6'));var fs=require('fs');var path=require(_0x3f3a('0x7'));var rimraf=require(_0x3f3a('0x8'));var config=require(_0x3f3a('0x9'));var attributes=require('./template.attributes');module[_0x3f3a('0xa')]=function(_0xd7474f,_0x2d508d){return _0xd7474f[_0x3f3a('0xb')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index ede4007..3d6032c 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 _0xb5d5=['stringify','error','code','message','info','result','catch','Template','findAll','options','raw','where','limit','include','model','attributes','map','GetTemplate','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s'];(function(_0x2f14f1,_0x28306e){var _0x5bb933=function(_0x4db4e0){while(--_0x4db4e0){_0x2f14f1['push'](_0x2f14f1['shift']());}};_0x5bb933(++_0x28306e);}(_0xb5d5,0x1c0));var _0x5b5d=function(_0x3351b7,_0x5d203f){_0x3351b7=_0x3351b7-0x0;var _0x294669=_0xb5d5[_0x3351b7];return _0x294669;};'use strict';var _=require('lodash');var util=require(_0x5b5d('0x0'));var moment=require('moment');var BPromise=require(_0x5b5d('0x1'));var rs=require(_0x5b5d('0x2'));var fs=require('fs');var Redis=require(_0x5b5d('0x3'));var db=require(_0x5b5d('0x4'))['db'];var utils=require(_0x5b5d('0x5'));var logger=require(_0x5b5d('0x6'))(_0x5b5d('0x7'));var config=require(_0x5b5d('0x8'));var jayson=require(_0x5b5d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34a891,_0x53a339,_0x34ce00){return new BPromise(function(_0x2f592f,_0x261ebe){return client['request'](_0x34a891,_0x34ce00)[_0x5b5d('0xa')](function(_0xfe6325){logger['info'](_0x5b5d('0xb'),_0x53a339,_0x5b5d('0xc'));logger['debug'](_0x5b5d('0xd'),_0x53a339,_0x5b5d('0xc'),JSON[_0x5b5d('0xe')](_0xfe6325));if(_0xfe6325[_0x5b5d('0xf')]){if(_0xfe6325[_0x5b5d('0xf')][_0x5b5d('0x10')]===0x1f4){logger[_0x5b5d('0xf')](_0x5b5d('0xb'),_0x53a339,_0xfe6325['error'][_0x5b5d('0x11')]);return _0x261ebe(_0xfe6325[_0x5b5d('0xf')][_0x5b5d('0x11')]);}logger[_0x5b5d('0xf')](_0x5b5d('0xb'),_0x53a339,_0xfe6325['error']['message']);return _0x2f592f(_0xfe6325[_0x5b5d('0xf')][_0x5b5d('0x11')]);}else{logger[_0x5b5d('0x12')](_0x5b5d('0xb'),_0x53a339,_0x5b5d('0xc'));_0x2f592f(_0xfe6325[_0x5b5d('0x13')][_0x5b5d('0x11')]);}})[_0x5b5d('0x14')](function(_0x63e205){logger[_0x5b5d('0xf')](_0x5b5d('0xb'),_0x53a339,_0x63e205);_0x261ebe(_0x63e205);});});}exports['GetTemplate']=function(_0x2e2c47){var _0x56b449=this;return new Promise(function(_0x38276f,_0x34d95c){return db[_0x5b5d('0x15')][_0x5b5d('0x16')]({'raw':_0x2e2c47[_0x5b5d('0x17')]?_0x2e2c47[_0x5b5d('0x17')][_0x5b5d('0x18')]===undefined?!![]:![]:!![],'where':_0x2e2c47['options']?_0x2e2c47[_0x5b5d('0x17')][_0x5b5d('0x19')]||null:null,'attributes':_0x2e2c47[_0x5b5d('0x17')]?_0x2e2c47[_0x5b5d('0x17')]['attributes']||null:null,'limit':_0x2e2c47[_0x5b5d('0x17')]?_0x2e2c47[_0x5b5d('0x17')][_0x5b5d('0x1a')]||null:null,'include':_0x2e2c47[_0x5b5d('0x17')]?_0x2e2c47['options'][_0x5b5d('0x1b')]?_['map'](_0x2e2c47[_0x5b5d('0x17')][_0x5b5d('0x1b')],function(_0x26e47b){return{'model':db[_0x26e47b[_0x5b5d('0x1c')]],'as':_0x26e47b['as'],'attributes':_0x26e47b[_0x5b5d('0x1d')],'include':_0x26e47b[_0x5b5d('0x1b')]?_[_0x5b5d('0x1e')](_0x26e47b[_0x5b5d('0x1b')],function(_0x223816){return{'model':db[_0x223816['model']],'as':_0x223816['as'],'attributes':_0x223816['attributes'],'include':_0x223816[_0x5b5d('0x1b')]?_[_0x5b5d('0x1e')](_0x223816[_0x5b5d('0x1b')],function(_0x413795){return{'model':db[_0x413795[_0x5b5d('0x1c')]],'as':_0x413795['as'],'attributes':_0x413795[_0x5b5d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x272587){logger[_0x5b5d('0x12')](_0x5b5d('0x1f'),_0x2e2c47);logger[_0x5b5d('0x20')](_0x5b5d('0x1f'),_0x2e2c47,JSON[_0x5b5d('0xe')](_0x272587));_0x38276f(_0x272587);})[_0x5b5d('0x14')](function(_0x504ec3){logger[_0x5b5d('0xf')](_0x5b5d('0x1f'),_0x504ec3[_0x5b5d('0x11')],_0x2e2c47);_0x34d95c(_0x56b449[_0x5b5d('0xf')](0x1f4,_0x504ec3[_0x5b5d('0x11')]));});});}; \ No newline at end of file +var _0x0037=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x0037,0x127));var _0x7003=function(_0x2e00f6,_0x34b472){_0x2e00f6=_0x2e00f6-0x0;var _0x38e987=_0x0037[_0x2e00f6];return _0x38e987;};'use strict';var _=require(_0x7003('0x0'));var util=require(_0x7003('0x1'));var moment=require(_0x7003('0x2'));var BPromise=require(_0x7003('0x3'));var rs=require(_0x7003('0x4'));var fs=require('fs');var Redis=require(_0x7003('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7003('0x6'))(_0x7003('0x7'));var config=require(_0x7003('0x8'));var jayson=require(_0x7003('0x9'));var client=jayson[_0x7003('0xa')][_0x7003('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x248fb5,_0xd5c1d2,_0x417ae9){return new BPromise(function(_0x34db6a,_0x2c43eb){return client[_0x7003('0xc')](_0x248fb5,_0x417ae9)[_0x7003('0xd')](function(_0x1dee8a){logger[_0x7003('0xe')](_0x7003('0xf'),_0xd5c1d2,'request\x20sent');logger[_0x7003('0x10')](_0x7003('0x11'),_0xd5c1d2,'request\x20sent',JSON[_0x7003('0x12')](_0x1dee8a));if(_0x1dee8a[_0x7003('0x13')]){if(_0x1dee8a[_0x7003('0x13')]['code']===0x1f4){logger[_0x7003('0x13')]('Template,\x20%s,\x20%s',_0xd5c1d2,_0x1dee8a['error']['message']);return _0x2c43eb(_0x1dee8a[_0x7003('0x13')]['message']);}logger[_0x7003('0x13')]('Template,\x20%s,\x20%s',_0xd5c1d2,_0x1dee8a[_0x7003('0x13')][_0x7003('0x14')]);return _0x34db6a(_0x1dee8a[_0x7003('0x13')]['message']);}else{logger['info'](_0x7003('0xf'),_0xd5c1d2,'request\x20sent');_0x34db6a(_0x1dee8a[_0x7003('0x15')]['message']);}})['catch'](function(_0x330973){logger['error']('Template,\x20%s,\x20%s',_0xd5c1d2,_0x330973);_0x2c43eb(_0x330973);});});}exports[_0x7003('0x16')]=function(_0x4bab8d){var _0x5f0a54=this;return new Promise(function(_0x12ef04,_0x48333c){return db[_0x7003('0x17')][_0x7003('0x18')]({'raw':_0x4bab8d[_0x7003('0x19')]?_0x4bab8d[_0x7003('0x19')][_0x7003('0x1a')]===undefined?!![]:![]:!![],'where':_0x4bab8d['options']?_0x4bab8d[_0x7003('0x19')][_0x7003('0x1b')]||null:null,'attributes':_0x4bab8d[_0x7003('0x19')]?_0x4bab8d[_0x7003('0x19')][_0x7003('0x1c')]||null:null,'limit':_0x4bab8d[_0x7003('0x19')]?_0x4bab8d[_0x7003('0x19')][_0x7003('0x1d')]||null:null,'include':_0x4bab8d[_0x7003('0x19')]?_0x4bab8d[_0x7003('0x19')][_0x7003('0x1e')]?_[_0x7003('0x1f')](_0x4bab8d[_0x7003('0x19')][_0x7003('0x1e')],function(_0x5af131){return{'model':db[_0x5af131[_0x7003('0x20')]],'as':_0x5af131['as'],'attributes':_0x5af131[_0x7003('0x1c')],'include':_0x5af131['include']?_[_0x7003('0x1f')](_0x5af131[_0x7003('0x1e')],function(_0x18a627){return{'model':db[_0x18a627[_0x7003('0x20')]],'as':_0x18a627['as'],'attributes':_0x18a627[_0x7003('0x1c')],'include':_0x18a627[_0x7003('0x1e')]?_[_0x7003('0x1f')](_0x18a627[_0x7003('0x1e')],function(_0x204588){return{'model':db[_0x204588[_0x7003('0x20')]],'as':_0x204588['as'],'attributes':_0x204588[_0x7003('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7003('0xd')](function(_0x3809f7){logger[_0x7003('0xe')](_0x7003('0x16'),_0x4bab8d);logger[_0x7003('0x10')](_0x7003('0x16'),_0x4bab8d,JSON['stringify'](_0x3809f7));_0x12ef04(_0x3809f7);})['catch'](function(_0x2a2ea7){logger[_0x7003('0x13')](_0x7003('0x16'),_0x2a2ea7[_0x7003('0x14')],_0x4bab8d);_0x48333c(_0x5f0a54['error'](0x1f4,_0x2a2ea7['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d08bc2d..91d8027 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 _0x6b74=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAction','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/all_conditions'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x6b74,0xcc));var _0x46b7=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x6b74[_0x5bfb78];return _0x4efd00;};'use strict';var multer=require(_0x46b7('0x0'));var util=require(_0x46b7('0x1'));var path=require('path');var timeout=require(_0x46b7('0x2'));var express=require(_0x46b7('0x3'));var router=express['Router']();var fs_extra=require(_0x46b7('0x4'));var auth=require(_0x46b7('0x5'));var interaction=require(_0x46b7('0x6'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x46b7('0x7')]('/',auth[_0x46b7('0x8')](),controller['index']);router[_0x46b7('0x7')](_0x46b7('0x9'),auth['isAuthenticated'](),controller[_0x46b7('0xa')]);router[_0x46b7('0x7')](_0x46b7('0xb'),auth[_0x46b7('0x8')](),controller['getAllConditions']);router[_0x46b7('0x7')](_0x46b7('0xc'),auth[_0x46b7('0x8')](),controller[_0x46b7('0xd')]);router[_0x46b7('0x7')](_0x46b7('0xe'),auth[_0x46b7('0x8')](),controller[_0x46b7('0xf')]);router[_0x46b7('0x10')]('/',auth[_0x46b7('0x8')](),controller['create']);router[_0x46b7('0x10')](_0x46b7('0xb'),auth[_0x46b7('0x8')](),controller[_0x46b7('0x11')]);router[_0x46b7('0x10')]('/:id/any_conditions',auth[_0x46b7('0x8')](),controller['addAnyCondition']);router[_0x46b7('0x10')](_0x46b7('0xe'),auth[_0x46b7('0x8')](),controller[_0x46b7('0x12')]);router[_0x46b7('0x13')]('/:id',auth[_0x46b7('0x8')](),controller[_0x46b7('0x14')]);router[_0x46b7('0x15')](_0x46b7('0x9'),auth[_0x46b7('0x8')](),controller[_0x46b7('0x16')]);module[_0x46b7('0x17')]=router; \ No newline at end of file +var _0x60d7=['get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAction','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5f2415,_0x503018){var _0x55f63d=function(_0x2d8ac2){while(--_0x2d8ac2){_0x5f2415['push'](_0x5f2415['shift']());}};_0x55f63d(++_0x503018);}(_0x60d7,0x149));var _0x760d=function(_0x1c478b,_0x36f77b){_0x1c478b=_0x1c478b-0x0;var _0x410de3=_0x60d7[_0x1c478b];return _0x410de3;};'use strict';var multer=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var path=require(_0x760d('0x2'));var timeout=require(_0x760d('0x3'));var express=require(_0x760d('0x4'));var router=express[_0x760d('0x5')]();var fs_extra=require(_0x760d('0x6'));var auth=require(_0x760d('0x7'));var interaction=require(_0x760d('0x8'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x760d('0x9')]('/',auth[_0x760d('0xa')](),controller[_0x760d('0xb')]);router[_0x760d('0x9')](_0x760d('0xc'),auth[_0x760d('0xa')](),controller[_0x760d('0xd')]);router[_0x760d('0x9')](_0x760d('0xe'),auth[_0x760d('0xa')](),controller[_0x760d('0xf')]);router[_0x760d('0x9')](_0x760d('0x10'),auth['isAuthenticated'](),controller[_0x760d('0x11')]);router[_0x760d('0x9')](_0x760d('0x12'),auth[_0x760d('0xa')](),controller[_0x760d('0x13')]);router['post']('/',auth[_0x760d('0xa')](),controller[_0x760d('0x14')]);router[_0x760d('0x15')](_0x760d('0xe'),auth[_0x760d('0xa')](),controller[_0x760d('0x16')]);router[_0x760d('0x15')](_0x760d('0x10'),auth[_0x760d('0xa')](),controller['addAnyCondition']);router['post'](_0x760d('0x12'),auth['isAuthenticated'](),controller[_0x760d('0x17')]);router['put'](_0x760d('0xc'),auth['isAuthenticated'](),controller[_0x760d('0x18')]);router['delete'](_0x760d('0xc'),auth[_0x760d('0xa')](),controller[_0x760d('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ffd0e81..5200395 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 _0x0400=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3eb017,_0x145f85){var _0x54f041=function(_0x1a65bf){while(--_0x1a65bf){_0x3eb017['push'](_0x3eb017['shift']());}};_0x54f041(++_0x145f85);}(_0x0400,0x1b8));var _0x0040=function(_0x47cd19,_0x32c8b6){_0x47cd19=_0x47cd19-0x0;var _0x13f174=_0x0400[_0x47cd19];return _0x13f174;};'use strict';var Sequelize=require(_0x0040('0x0'));module[_0x0040('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0040('0x2')]},'status':{'type':Sequelize[_0x0040('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x623e=['STRING','sequelize','exports'];(function(_0x5c6516,_0x4c312f){var _0x274744=function(_0x4bbf32){while(--_0x4bbf32){_0x5c6516['push'](_0x5c6516['shift']());}};_0x274744(++_0x4c312f);}(_0x623e,0x1c6));var _0xe623=function(_0x3955a9,_0x20a7b1){_0x3955a9=_0x3955a9-0x0;var _0x29d523=_0x623e[_0x3955a9];return _0x29d523;};'use strict';var Sequelize=require(_0xe623('0x0'));module[_0xe623('0x1')]={'name':{'type':Sequelize[_0xe623('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe623('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 80a0d93..31e1a62 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 _0x9127=['index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Trigger','includeAll','include','findAll','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','reject','save','update','then','destroy','get','Triggers','UserProfileResource','stack','name'];(function(_0xf45231,_0x4b18ff){var _0x5cc87e=function(_0x335f51){while(--_0x335f51){_0xf45231['push'](_0xf45231['shift']());}};_0x5cc87e(++_0x4b18ff);}(_0x9127,0x157));var _0x7912=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x9127[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x7912('0x0'));var rimraf=require(_0x7912('0x1'));var zipdir=require(_0x7912('0x2'));var jsonpatch=require(_0x7912('0x3'));var rp=require(_0x7912('0x4'));var moment=require(_0x7912('0x5'));var BPromise=require(_0x7912('0x6'));var Mustache=require(_0x7912('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7912('0x8'));var csv=require(_0x7912('0x9'));var ejs=require(_0x7912('0xa'));var fs=require('fs');var fs_extra=require(_0x7912('0xb'));var _=require(_0x7912('0xc'));var squel=require('squel');var crypto=require(_0x7912('0xd'));var jsforce=require(_0x7912('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7912('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7912('0xf'));var authService=require(_0x7912('0x10'));var qs=require(_0x7912('0x11'));var as=require(_0x7912('0x12'));var hardwareService=require(_0x7912('0x13'));var logger=require(_0x7912('0x14'))(_0x7912('0x15'));var utils=require(_0x7912('0x16'));var config=require(_0x7912('0x17'));var licenseUtil=require(_0x7912('0x18'));var db=require(_0x7912('0x19'))['db'];function respondWithStatusCode(_0x25eaeb,_0xbee06a){_0xbee06a=_0xbee06a||0xcc;return function(_0xc08e16){if(_0xc08e16){return _0x25eaeb[_0x7912('0x1a')](_0xbee06a);}return _0x25eaeb['status'](_0xbee06a)[_0x7912('0x1b')]();};}function respondWithResult(_0x118359,_0x5cfd69){_0x5cfd69=_0x5cfd69||0xc8;return function(_0x1edc22){if(_0x1edc22){return _0x118359['status'](_0x5cfd69)[_0x7912('0x1c')](_0x1edc22);}};}function respondWithFilteredResult(_0x3a83ed,_0x5331ab){return function(_0x3ac417){if(_0x3ac417){var _0x2c58bc=typeof _0x5331ab[_0x7912('0x1d')]==='undefined'&&typeof _0x5331ab[_0x7912('0x1e')]===_0x7912('0x1f');var _0x59eec2=_0x3ac417['count'];var _0x3e1ced=_0x2c58bc?0x0:_0x5331ab[_0x7912('0x1d')];var _0x4e6bd1=_0x2c58bc?_0x3ac417[_0x7912('0x20')]:_0x5331ab[_0x7912('0x1d')]+_0x5331ab[_0x7912('0x1e')];var _0x504b53;if(_0x4e6bd1>=_0x59eec2){_0x4e6bd1=_0x59eec2;_0x504b53=0xc8;}else{_0x504b53=0xce;}_0x3a83ed[_0x7912('0x21')](_0x504b53);return _0x3a83ed['set'](_0x7912('0x22'),_0x3e1ced+'-'+_0x4e6bd1+'/'+_0x59eec2)[_0x7912('0x1c')](_0x3ac417);}return null;};}function patchUpdates(_0x1e9b0d){return function(_0x291fc1){try{jsonpatch['apply'](_0x291fc1,_0x1e9b0d,!![]);}catch(_0x263503){return BPromise[_0x7912('0x23')](_0x263503);}return _0x291fc1[_0x7912('0x24')]();};}function saveUpdates(_0x548b21,_0x13be3a){return function(_0x2022d6){if(_0x2022d6){return _0x2022d6[_0x7912('0x25')](_0x548b21)[_0x7912('0x26')](function(_0x491cd5){return _0x491cd5;});}return null;};}function removeEntity(_0x10c1d6,_0x2129cd){return function(_0x5a0e65){if(_0x5a0e65){return _0x5a0e65[_0x7912('0x27')]()[_0x7912('0x26')](function(){var _0x12a460=_0x5a0e65[_0x7912('0x28')]({'plain':!![]});var _0x5cb5e2=_0x7912('0x29');return db[_0x7912('0x2a')]['destroy']({'where':{'type':_0x5cb5e2,'resourceId':_0x12a460['id']}})[_0x7912('0x26')](function(){return _0x5a0e65;});})[_0x7912('0x26')](function(){_0x10c1d6['status'](0xcc)[_0x7912('0x1b')]();});}};}function handleEntityNotFound(_0x1f2428,_0x3e3037){return function(_0x51d467){if(!_0x51d467){_0x1f2428[_0x7912('0x1a')](0x194);}return _0x51d467;};}function handleError(_0x501505,_0x3a7aac){_0x3a7aac=_0x3a7aac||0x1f4;return function(_0x126403){logger['error'](_0x126403[_0x7912('0x2b')]);if(_0x126403[_0x7912('0x2c')]){delete _0x126403[_0x7912('0x2c')];}_0x501505[_0x7912('0x21')](_0x3a7aac)['send'](_0x126403);};}exports[_0x7912('0x2d')]=function(_0x2d84af,_0x53f99f){var _0x2d49a0={},_0x2e9d57={},_0x5a38f0={'count':0x0,'rows':[]};var _0x191a64=_['map'](db['Trigger'][_0x7912('0x2e')],function(_0x2b65ad){return{'name':_0x2b65ad[_0x7912('0x2f')],'type':_0x2b65ad['type'][_0x7912('0x30')]};});_0x2e9d57[_0x7912('0x31')]=_[_0x7912('0x32')](_0x191a64,'name');_0x2e9d57[_0x7912('0x33')]=_[_0x7912('0x34')](_0x2d84af['query']);_0x2e9d57[_0x7912('0x35')]=_[_0x7912('0x36')](_0x2e9d57[_0x7912('0x31')],_0x2e9d57[_0x7912('0x33')]);_0x2d49a0[_0x7912('0x37')]=_['intersection'](_0x2e9d57[_0x7912('0x31')],qs[_0x7912('0x38')](_0x2d84af[_0x7912('0x33')][_0x7912('0x38')]));_0x2d49a0[_0x7912('0x37')]=_0x2d49a0['attributes'][_0x7912('0x39')]?_0x2d49a0[_0x7912('0x37')]:_0x2e9d57[_0x7912('0x31')];if(!_0x2d84af[_0x7912('0x33')][_0x7912('0x3a')](_0x7912('0x3b'))){_0x2d49a0[_0x7912('0x1e')]=qs['limit'](_0x2d84af[_0x7912('0x33')][_0x7912('0x1e')]);_0x2d49a0[_0x7912('0x1d')]=qs[_0x7912('0x1d')](_0x2d84af[_0x7912('0x33')]['offset']);}_0x2d49a0[_0x7912('0x3c')]=qs[_0x7912('0x3d')](_0x2d84af[_0x7912('0x33')][_0x7912('0x3d')]);_0x2d49a0[_0x7912('0x3e')]=qs[_0x7912('0x35')](_[_0x7912('0x3f')](_0x2d84af['query'],_0x2e9d57[_0x7912('0x35')]),_0x191a64);if(_0x2d84af[_0x7912('0x33')][_0x7912('0x40')]){_0x2d49a0[_0x7912('0x3e')]=_[_0x7912('0x41')](_0x2d49a0['where'],{'$or':_['map'](_0x191a64,function(_0x129262){if(_0x129262[_0x7912('0x42')]!==_0x7912('0x43')){var _0x1c1b4c={};_0x1c1b4c[_0x129262[_0x7912('0x2c')]]={'$like':'%'+_0x2d84af[_0x7912('0x33')][_0x7912('0x40')]+'%'};return _0x1c1b4c;}})});}_0x2d49a0=_['merge']({},_0x2d49a0,_0x2d84af['options']);var _0x342eca={'where':_0x2d49a0[_0x7912('0x3e')]};return db[_0x7912('0x44')][_0x7912('0x20')](_0x342eca)['then'](function(_0x2864a9){_0x5a38f0[_0x7912('0x20')]=_0x2864a9;if(_0x2d84af[_0x7912('0x33')][_0x7912('0x45')]){_0x2d49a0[_0x7912('0x46')]=[{'all':!![]}];}return db[_0x7912('0x44')][_0x7912('0x47')](_0x2d49a0);})[_0x7912('0x26')](function(_0x1e89d2){_0x5a38f0['rows']=_0x1e89d2;return _0x5a38f0;})[_0x7912('0x26')](respondWithFilteredResult(_0x53f99f,_0x2d49a0))[_0x7912('0x48')](handleError(_0x53f99f,null));};exports['show']=function(_0x54a409,_0x2bcbc0){var _0x483c72={'raw':![],'where':{'id':_0x54a409['params']['id']}},_0xce96d7={};_0xce96d7[_0x7912('0x31')]=_[_0x7912('0x34')](db['Trigger'][_0x7912('0x2e')]);_0xce96d7[_0x7912('0x33')]=_['keys'](_0x54a409['query']);_0xce96d7[_0x7912('0x35')]=_[_0x7912('0x36')](_0xce96d7[_0x7912('0x31')],_0xce96d7[_0x7912('0x33')]);_0x483c72[_0x7912('0x37')]=_['intersection'](_0xce96d7[_0x7912('0x31')],qs[_0x7912('0x38')](_0x54a409['query'][_0x7912('0x38')]));_0x483c72[_0x7912('0x37')]=_0x483c72[_0x7912('0x37')][_0x7912('0x39')]?_0x483c72[_0x7912('0x37')]:_0xce96d7[_0x7912('0x31')];if(_0x54a409['query']['includeAll']){_0x483c72['include']=[{'all':!![]}];}_0x483c72=_[_0x7912('0x41')]({},_0x483c72,_0x54a409[_0x7912('0x49')]);return db[_0x7912('0x44')][_0x7912('0x4a')](_0x483c72)['then'](handleEntityNotFound(_0x2bcbc0,null))[_0x7912('0x26')](respondWithResult(_0x2bcbc0,null))[_0x7912('0x48')](handleError(_0x2bcbc0,null));};exports[_0x7912('0x4b')]=function(_0x5ecf52,_0x3d5d2f){return db[_0x7912('0x44')]['create'](_0x5ecf52['body'],{})[_0x7912('0x26')](function(_0x3fb9b6){var _0x39934b=_0x5ecf52[_0x7912('0x4c')][_0x7912('0x28')]({'plain':!![]});if(!_0x39934b)throw new Error(_0x7912('0x4d'));if(_0x39934b[_0x7912('0x4e')]===_0x7912('0x4c')){var _0x111113=_0x3fb9b6['get']({'plain':!![]});var _0x2d1c19=_0x7912('0x29');return db[_0x7912('0x4f')][_0x7912('0x4a')]({'where':{'name':_0x2d1c19,'userProfileId':_0x39934b[_0x7912('0x50')]},'raw':!![]})['then'](function(_0x261a6a){if(_0x261a6a&&_0x261a6a[_0x7912('0x51')]===0x0){return db[_0x7912('0x2a')][_0x7912('0x4b')]({'name':_0x111113[_0x7912('0x2c')],'resourceId':_0x111113['id'],'type':_0x261a6a[_0x7912('0x2c')],'sectionId':_0x261a6a['id']},{})['then'](function(){return _0x3fb9b6;});}else{return _0x3fb9b6;}})[_0x7912('0x48')](function(_0x5d9b51){logger[_0x7912('0x52')](_0x7912('0x53'),_0x5d9b51);throw _0x5d9b51;});}return _0x3fb9b6;})[_0x7912('0x26')](respondWithResult(_0x3d5d2f,0xc9))['catch'](handleError(_0x3d5d2f,null));};exports['update']=function(_0x533237,_0x38288f){if(_0x533237[_0x7912('0x54')]['id']){delete _0x533237[_0x7912('0x54')]['id'];}return db[_0x7912('0x44')]['find']({'where':{'id':_0x533237[_0x7912('0x55')]['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x38288f,null))['then'](saveUpdates(_0x533237[_0x7912('0x54')],null))['then'](respondWithResult(_0x38288f,null))['catch'](handleError(_0x38288f,null));};exports['destroy']=function(_0x55d5c9,_0x2fd628){return db['Trigger']['find']({'where':{'id':_0x55d5c9['params']['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x2fd628,null))[_0x7912('0x26')](removeEntity(_0x2fd628,null))[_0x7912('0x48')](handleError(_0x2fd628,null));};exports[_0x7912('0x56')]=function(_0x384da7,_0x348a1e,_0x14b35d){if(_0x384da7[_0x7912('0x54')]['id']){delete _0x384da7[_0x7912('0x54')]['id'];}return db[_0x7912('0x44')][_0x7912('0x4a')]({'where':{'id':_0x384da7[_0x7912('0x55')]['id']}})['then'](handleEntityNotFound(_0x348a1e,null))['then'](function(_0xbec05c){if(_0xbec05c){_0x384da7['body'][_0x7912('0x57')]=_0xbec05c['id'];return db[_0x7912('0x58')][_0x7912('0x4b')](_0x384da7['body']);}})[_0x7912('0x26')](respondWithResult(_0x348a1e,null))['catch'](handleError(_0x348a1e,null));};exports[_0x7912('0x59')]=function(_0x53c5a5,_0x67cc3c,_0x59db37){if(_0x53c5a5[_0x7912('0x54')]['id']){delete _0x53c5a5[_0x7912('0x54')]['id'];}return db[_0x7912('0x44')][_0x7912('0x4a')]({'where':{'id':_0x53c5a5[_0x7912('0x55')]['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x67cc3c,null))[_0x7912('0x26')](function(_0xa417df){if(_0xa417df){_0x53c5a5['body'][_0x7912('0x5a')]=_0xa417df['id'];return db[_0x7912('0x58')][_0x7912('0x4b')](_0x53c5a5[_0x7912('0x54')]);}})[_0x7912('0x26')](respondWithResult(_0x67cc3c,null))['catch'](handleError(_0x67cc3c,null));};exports[_0x7912('0x5b')]=function(_0x4d4d2d,_0x20f22d,_0x3046b3){var _0x4c40a5={};var _0x1a2e0b={};var _0x125eff;var _0x3baeb1;return db[_0x7912('0x44')]['findOne']({'where':{'id':_0x4d4d2d[_0x7912('0x55')]['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x20f22d,null))[_0x7912('0x26')](function(_0x3fd16b){if(_0x3fd16b){_0x125eff=_0x3fd16b;_0x1a2e0b[_0x7912('0x31')]=_[_0x7912('0x34')](db['Condition'][_0x7912('0x2e')]);_0x1a2e0b[_0x7912('0x33')]=_['keys'](_0x4d4d2d[_0x7912('0x33')]);_0x1a2e0b[_0x7912('0x35')]=_[_0x7912('0x36')](_0x1a2e0b[_0x7912('0x31')],_0x1a2e0b['query']);_0x4c40a5[_0x7912('0x37')]=_[_0x7912('0x36')](_0x1a2e0b['model'],qs['fields'](_0x4d4d2d[_0x7912('0x33')]['fields']));_0x4c40a5[_0x7912('0x37')]=_0x4c40a5[_0x7912('0x37')][_0x7912('0x39')]?_0x4c40a5['attributes']:_0x1a2e0b[_0x7912('0x31')];_0x4c40a5[_0x7912('0x3c')]=qs[_0x7912('0x3d')](_0x4d4d2d[_0x7912('0x33')][_0x7912('0x3d')]);_0x4c40a5[_0x7912('0x3e')]=qs[_0x7912('0x35')](_['pick'](_0x4d4d2d[_0x7912('0x33')],_0x1a2e0b['filters']));if(_0x4d4d2d[_0x7912('0x33')]['filter']){_0x4c40a5[_0x7912('0x3e')]=_[_0x7912('0x41')](_0x4c40a5['where'],{'$or':_[_0x7912('0x32')](_0x4c40a5[_0x7912('0x37')],function(_0x318865){var _0x16a553={};_0x16a553[_0x318865]={'$like':'%'+_0x4d4d2d['query']['filter']+'%'};return _0x16a553;})});}_0x4c40a5=_['merge']({},_0x4c40a5,_0x4d4d2d['options']);return _0x125eff[_0x7912('0x5b')](_0x4c40a5);}})['then'](function(_0x1729b3){if(_0x1729b3){_0x3baeb1=_0x1729b3[_0x7912('0x39')];if(!_0x4d4d2d[_0x7912('0x33')]['hasOwnProperty'](_0x7912('0x3b'))){_0x4c40a5['limit']=qs[_0x7912('0x1e')](_0x4d4d2d[_0x7912('0x33')][_0x7912('0x1e')]);_0x4c40a5[_0x7912('0x1d')]=qs[_0x7912('0x1d')](_0x4d4d2d[_0x7912('0x33')]['offset']);}return _0x125eff[_0x7912('0x5b')](_0x4c40a5);}})['then'](function(_0x414a23){if(_0x414a23){return _0x414a23?{'count':_0x3baeb1,'rows':_0x414a23}:null;}})[_0x7912('0x26')](respondWithResult(_0x20f22d,null))[_0x7912('0x48')](handleError(_0x20f22d,null));};exports[_0x7912('0x5c')]=function(_0x53a4db,_0x2a6ac3,_0x463dcc){var _0x541af1={};var _0x5098dd={};var _0x551a3d;var _0x27eac0;return db[_0x7912('0x44')][_0x7912('0x5d')]({'where':{'id':_0x53a4db[_0x7912('0x55')]['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x2a6ac3,null))[_0x7912('0x26')](function(_0x4cf16a){if(_0x4cf16a){_0x551a3d=_0x4cf16a;_0x5098dd[_0x7912('0x31')]=_[_0x7912('0x34')](db[_0x7912('0x58')]['rawAttributes']);_0x5098dd['query']=_[_0x7912('0x34')](_0x53a4db[_0x7912('0x33')]);_0x5098dd[_0x7912('0x35')]=_[_0x7912('0x36')](_0x5098dd['model'],_0x5098dd[_0x7912('0x33')]);_0x541af1[_0x7912('0x37')]=_[_0x7912('0x36')](_0x5098dd[_0x7912('0x31')],qs['fields'](_0x53a4db[_0x7912('0x33')][_0x7912('0x38')]));_0x541af1[_0x7912('0x37')]=_0x541af1[_0x7912('0x37')][_0x7912('0x39')]?_0x541af1[_0x7912('0x37')]:_0x5098dd[_0x7912('0x31')];_0x541af1[_0x7912('0x3c')]=qs['sort'](_0x53a4db['query'][_0x7912('0x3d')]);_0x541af1['where']=qs[_0x7912('0x35')](_[_0x7912('0x3f')](_0x53a4db[_0x7912('0x33')],_0x5098dd[_0x7912('0x35')]));if(_0x53a4db[_0x7912('0x33')][_0x7912('0x40')]){_0x541af1[_0x7912('0x3e')]=_['merge'](_0x541af1[_0x7912('0x3e')],{'$or':_['map'](_0x541af1[_0x7912('0x37')],function(_0xc1251c){var _0x47d396={};_0x47d396[_0xc1251c]={'$like':'%'+_0x53a4db[_0x7912('0x33')][_0x7912('0x40')]+'%'};return _0x47d396;})});}_0x541af1=_[_0x7912('0x41')]({},_0x541af1,_0x53a4db[_0x7912('0x49')]);return _0x551a3d[_0x7912('0x5c')](_0x541af1);}})[_0x7912('0x26')](function(_0x10f4c9){if(_0x10f4c9){_0x27eac0=_0x10f4c9['length'];if(!_0x53a4db[_0x7912('0x33')][_0x7912('0x3a')](_0x7912('0x3b'))){_0x541af1[_0x7912('0x1e')]=qs[_0x7912('0x1e')](_0x53a4db[_0x7912('0x33')]['limit']);_0x541af1[_0x7912('0x1d')]=qs[_0x7912('0x1d')](_0x53a4db['query']['offset']);}return _0x551a3d[_0x7912('0x5c')](_0x541af1);}})[_0x7912('0x26')](function(_0x191c59){if(_0x191c59){return _0x191c59?{'count':_0x27eac0,'rows':_0x191c59}:null;}})[_0x7912('0x26')](respondWithResult(_0x2a6ac3,null))['catch'](handleError(_0x2a6ac3,null));};exports['addAction']=function(_0xe471a2,_0x3033c3,_0x37cd95){if(_0xe471a2[_0x7912('0x54')]['id']){delete _0xe471a2[_0x7912('0x54')]['id'];}return db['Trigger'][_0x7912('0x4a')]({'where':{'id':_0xe471a2['params']['id']}})['then'](handleEntityNotFound(_0x3033c3,null))[_0x7912('0x26')](function(_0x3863f7){if(_0x3863f7){_0xe471a2[_0x7912('0x54')][_0x7912('0x5e')]=_0x3863f7['id'];return db[_0x7912('0x5f')][_0x7912('0x4b')](_0xe471a2[_0x7912('0x54')]);}})[_0x7912('0x26')](respondWithResult(_0x3033c3,null))[_0x7912('0x48')](handleError(_0x3033c3,null));};exports[_0x7912('0x60')]=function(_0x5ec02d,_0x41c4d4,_0x251c3f){var _0x1b3aaf={};var _0x122657={};var _0x56e9fb;var _0x4aa2d4;return db['Trigger'][_0x7912('0x5d')]({'where':{'id':_0x5ec02d[_0x7912('0x55')]['id']}})[_0x7912('0x26')](handleEntityNotFound(_0x41c4d4,null))[_0x7912('0x26')](function(_0x4a395c){if(_0x4a395c){_0x56e9fb=_0x4a395c;_0x122657[_0x7912('0x31')]=_[_0x7912('0x34')](db[_0x7912('0x5f')]['rawAttributes']);_0x122657[_0x7912('0x33')]=_['keys'](_0x5ec02d[_0x7912('0x33')]);_0x122657[_0x7912('0x35')]=_[_0x7912('0x36')](_0x122657[_0x7912('0x31')],_0x122657[_0x7912('0x33')]);_0x1b3aaf[_0x7912('0x37')]=_['intersection'](_0x122657[_0x7912('0x31')],qs[_0x7912('0x38')](_0x5ec02d[_0x7912('0x33')][_0x7912('0x38')]));_0x1b3aaf[_0x7912('0x37')]=_0x1b3aaf[_0x7912('0x37')][_0x7912('0x39')]?_0x1b3aaf[_0x7912('0x37')]:_0x122657[_0x7912('0x31')];_0x1b3aaf[_0x7912('0x3c')]=qs[_0x7912('0x3d')](_0x5ec02d[_0x7912('0x33')][_0x7912('0x3d')]);_0x1b3aaf['where']=qs['filters'](_[_0x7912('0x3f')](_0x5ec02d['query'],_0x122657['filters']));if(_0x5ec02d[_0x7912('0x33')][_0x7912('0x40')]){_0x1b3aaf[_0x7912('0x3e')]=_['merge'](_0x1b3aaf[_0x7912('0x3e')],{'$or':_['map'](_0x1b3aaf[_0x7912('0x37')],function(_0x3c9981){var _0x412375={};_0x412375[_0x3c9981]={'$like':'%'+_0x5ec02d[_0x7912('0x33')][_0x7912('0x40')]+'%'};return _0x412375;})});}_0x1b3aaf=_[_0x7912('0x41')]({},_0x1b3aaf,_0x5ec02d[_0x7912('0x49')]);return _0x56e9fb[_0x7912('0x60')](_0x1b3aaf);}})[_0x7912('0x26')](function(_0x11ccde){if(_0x11ccde){_0x4aa2d4=_0x11ccde['length'];if(!_0x5ec02d[_0x7912('0x33')]['hasOwnProperty'](_0x7912('0x3b'))){_0x1b3aaf[_0x7912('0x1e')]=qs[_0x7912('0x1e')](_0x5ec02d[_0x7912('0x33')][_0x7912('0x1e')]);_0x1b3aaf[_0x7912('0x1d')]=qs[_0x7912('0x1d')](_0x5ec02d[_0x7912('0x33')][_0x7912('0x1d')]);}return _0x56e9fb[_0x7912('0x60')](_0x1b3aaf);}})['then'](function(_0x58369d){if(_0x58369d){return _0x58369d?{'count':_0x4aa2d4,'rows':_0x58369d}:null;}})[_0x7912('0x26')](respondWithResult(_0x41c4d4,null))['catch'](handleError(_0x41c4d4,null));}; \ No newline at end of file +var _0x48ca=['count','includeAll','include','rows','catch','length','merge','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','get','Triggers','UserProfileResource','end','sendStatus','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x48ca,0x7d));var _0xa48c=function(_0x387cb,_0x2151bc){_0x387cb=_0x387cb-0x0;var _0x50595a=_0x48ca[_0x387cb];return _0x50595a;};'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('moment');var BPromise=require(_0xa48c('0x0'));var Mustache=require(_0xa48c('0x1'));var util=require(_0xa48c('0x2'));var path=require(_0xa48c('0x3'));var sox=require(_0xa48c('0x4'));var csv=require(_0xa48c('0x5'));var ejs=require(_0xa48c('0x6'));var fs=require('fs');var fs_extra=require(_0xa48c('0x7'));var _=require(_0xa48c('0x8'));var squel=require('squel');var crypto=require(_0xa48c('0x9'));var jsforce=require(_0xa48c('0xa'));var deskjs=require(_0xa48c('0xb'));var toCsv=require(_0xa48c('0x5'));var querystring=require(_0xa48c('0xc'));var Papa=require(_0xa48c('0xd'));var Redis=require(_0xa48c('0xe'));var authService=require(_0xa48c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa48c('0x10'));var logger=require(_0xa48c('0x11'))(_0xa48c('0x12'));var utils=require(_0xa48c('0x13'));var config=require(_0xa48c('0x14'));var licenseUtil=require(_0xa48c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305001,_0x26553f){_0x26553f=_0x26553f||0xcc;return function(_0x547666){if(_0x547666){return _0x305001['sendStatus'](_0x26553f);}return _0x305001['status'](_0x26553f)['end']();};}function respondWithResult(_0x33b02f,_0x249d0c){_0x249d0c=_0x249d0c||0xc8;return function(_0x5c5bad){if(_0x5c5bad){return _0x33b02f[_0xa48c('0x16')](_0x249d0c)[_0xa48c('0x17')](_0x5c5bad);}};}function respondWithFilteredResult(_0x4ce2d9,_0x299a37){return function(_0x307e43){if(_0x307e43){var _0x5cf397=typeof _0x299a37[_0xa48c('0x18')]===_0xa48c('0x19')&&typeof _0x299a37[_0xa48c('0x1a')]==='undefined';var _0x3ab6a=_0x307e43['count'];var _0x528a32=_0x5cf397?0x0:_0x299a37[_0xa48c('0x18')];var _0x8fa2b0=_0x5cf397?_0x307e43['count']:_0x299a37[_0xa48c('0x18')]+_0x299a37[_0xa48c('0x1a')];var _0x2faa18;if(_0x8fa2b0>=_0x3ab6a){_0x8fa2b0=_0x3ab6a;_0x2faa18=0xc8;}else{_0x2faa18=0xce;}_0x4ce2d9[_0xa48c('0x16')](_0x2faa18);return _0x4ce2d9[_0xa48c('0x1b')](_0xa48c('0x1c'),_0x528a32+'-'+_0x8fa2b0+'/'+_0x3ab6a)[_0xa48c('0x17')](_0x307e43);}return null;};}function patchUpdates(_0x2f47e3){return function(_0x933026){try{jsonpatch[_0xa48c('0x1d')](_0x933026,_0x2f47e3,!![]);}catch(_0x187891){return BPromise['reject'](_0x187891);}return _0x933026[_0xa48c('0x1e')]();};}function saveUpdates(_0x3da1d4,_0x5f0432){return function(_0x45565b){if(_0x45565b){return _0x45565b[_0xa48c('0x1f')](_0x3da1d4)['then'](function(_0x27399a){return _0x27399a;});}return null;};}function removeEntity(_0x5dd244,_0x588bb8){return function(_0x3876a0){if(_0x3876a0){return _0x3876a0[_0xa48c('0x20')]()[_0xa48c('0x21')](function(){var _0x37a48e=_0x3876a0[_0xa48c('0x22')]({'plain':!![]});var _0x59bc77=_0xa48c('0x23');return db[_0xa48c('0x24')]['destroy']({'where':{'type':_0x59bc77,'resourceId':_0x37a48e['id']}})[_0xa48c('0x21')](function(){return _0x3876a0;});})['then'](function(){_0x5dd244[_0xa48c('0x16')](0xcc)[_0xa48c('0x25')]();});}};}function handleEntityNotFound(_0x3535d9,_0x40a518){return function(_0x1ea5be){if(!_0x1ea5be){_0x3535d9[_0xa48c('0x26')](0x194);}return _0x1ea5be;};}function handleError(_0x2c04d7,_0x147d54){_0x147d54=_0x147d54||0x1f4;return function(_0x2a66f0){logger['error'](_0x2a66f0[_0xa48c('0x27')]);if(_0x2a66f0['name']){delete _0x2a66f0[_0xa48c('0x28')];}_0x2c04d7[_0xa48c('0x16')](_0x147d54)[_0xa48c('0x29')](_0x2a66f0);};}exports[_0xa48c('0x2a')]=function(_0x39a8c9,_0x58d23a){var _0x21900e={},_0x2bdcf9={},_0xd336a6={'count':0x0,'rows':[]};var _0x33952c=_[_0xa48c('0x2b')](db[_0xa48c('0x2c')][_0xa48c('0x2d')],function(_0x48c329){return{'name':_0x48c329[_0xa48c('0x2e')],'type':_0x48c329[_0xa48c('0x2f')][_0xa48c('0x30')]};});_0x2bdcf9['model']=_['map'](_0x33952c,_0xa48c('0x28'));_0x2bdcf9[_0xa48c('0x31')]=_[_0xa48c('0x32')](_0x39a8c9[_0xa48c('0x31')]);_0x2bdcf9['filters']=_[_0xa48c('0x33')](_0x2bdcf9[_0xa48c('0x34')],_0x2bdcf9['query']);_0x21900e[_0xa48c('0x35')]=_[_0xa48c('0x33')](_0x2bdcf9[_0xa48c('0x34')],qs[_0xa48c('0x36')](_0x39a8c9[_0xa48c('0x31')]['fields']));_0x21900e[_0xa48c('0x35')]=_0x21900e[_0xa48c('0x35')]['length']?_0x21900e[_0xa48c('0x35')]:_0x2bdcf9[_0xa48c('0x34')];if(!_0x39a8c9['query'][_0xa48c('0x37')](_0xa48c('0x38'))){_0x21900e[_0xa48c('0x1a')]=qs['limit'](_0x39a8c9[_0xa48c('0x31')][_0xa48c('0x1a')]);_0x21900e['offset']=qs['offset'](_0x39a8c9['query']['offset']);}_0x21900e[_0xa48c('0x39')]=qs[_0xa48c('0x3a')](_0x39a8c9[_0xa48c('0x31')]['sort']);_0x21900e['where']=qs[_0xa48c('0x3b')](_[_0xa48c('0x3c')](_0x39a8c9[_0xa48c('0x31')],_0x2bdcf9['filters']),_0x33952c);if(_0x39a8c9['query'][_0xa48c('0x3d')]){_0x21900e[_0xa48c('0x3e')]=_['merge'](_0x21900e[_0xa48c('0x3e')],{'$or':_[_0xa48c('0x2b')](_0x33952c,function(_0x5a7d81){if(_0x5a7d81['type']!==_0xa48c('0x3f')){var _0x484f8a={};_0x484f8a[_0x5a7d81[_0xa48c('0x28')]]={'$like':'%'+_0x39a8c9['query']['filter']+'%'};return _0x484f8a;}})});}_0x21900e=_['merge']({},_0x21900e,_0x39a8c9[_0xa48c('0x40')]);var _0x1b664e={'where':_0x21900e['where']};return db[_0xa48c('0x2c')][_0xa48c('0x41')](_0x1b664e)[_0xa48c('0x21')](function(_0x83a023){_0xd336a6[_0xa48c('0x41')]=_0x83a023;if(_0x39a8c9['query'][_0xa48c('0x42')]){_0x21900e[_0xa48c('0x43')]=[{'all':!![]}];}return db[_0xa48c('0x2c')]['findAll'](_0x21900e);})[_0xa48c('0x21')](function(_0x34069d){_0xd336a6[_0xa48c('0x44')]=_0x34069d;return _0xd336a6;})[_0xa48c('0x21')](respondWithFilteredResult(_0x58d23a,_0x21900e))[_0xa48c('0x45')](handleError(_0x58d23a,null));};exports['show']=function(_0xfcff5,_0x3c93ac){var _0x317d5e={'raw':![],'where':{'id':_0xfcff5['params']['id']}},_0x3642cf={};_0x3642cf[_0xa48c('0x34')]=_[_0xa48c('0x32')](db[_0xa48c('0x2c')][_0xa48c('0x2d')]);_0x3642cf[_0xa48c('0x31')]=_[_0xa48c('0x32')](_0xfcff5[_0xa48c('0x31')]);_0x3642cf[_0xa48c('0x3b')]=_[_0xa48c('0x33')](_0x3642cf[_0xa48c('0x34')],_0x3642cf[_0xa48c('0x31')]);_0x317d5e[_0xa48c('0x35')]=_[_0xa48c('0x33')](_0x3642cf[_0xa48c('0x34')],qs[_0xa48c('0x36')](_0xfcff5[_0xa48c('0x31')][_0xa48c('0x36')]));_0x317d5e[_0xa48c('0x35')]=_0x317d5e[_0xa48c('0x35')][_0xa48c('0x46')]?_0x317d5e['attributes']:_0x3642cf[_0xa48c('0x34')];if(_0xfcff5['query'][_0xa48c('0x42')]){_0x317d5e[_0xa48c('0x43')]=[{'all':!![]}];}_0x317d5e=_[_0xa48c('0x47')]({},_0x317d5e,_0xfcff5['options']);return db[_0xa48c('0x2c')]['find'](_0x317d5e)[_0xa48c('0x21')](handleEntityNotFound(_0x3c93ac,null))['then'](respondWithResult(_0x3c93ac,null))[_0xa48c('0x45')](handleError(_0x3c93ac,null));};exports[_0xa48c('0x48')]=function(_0x244009,_0x228c19){return db[_0xa48c('0x2c')][_0xa48c('0x48')](_0x244009['body'],{})[_0xa48c('0x21')](function(_0x4e4b89){var _0x9724d9=_0x244009['user'][_0xa48c('0x22')]({'plain':!![]});if(!_0x9724d9)throw new Error(_0xa48c('0x49'));if(_0x9724d9[_0xa48c('0x4a')]===_0xa48c('0x4b')){var _0x689a47=_0x4e4b89['get']({'plain':!![]});var _0x1a21e7=_0xa48c('0x23');return db[_0xa48c('0x4c')][_0xa48c('0x4d')]({'where':{'name':_0x1a21e7,'userProfileId':_0x9724d9[_0xa48c('0x4e')]},'raw':!![]})[_0xa48c('0x21')](function(_0x221ed8){if(_0x221ed8&&_0x221ed8[_0xa48c('0x4f')]===0x0){return db[_0xa48c('0x24')][_0xa48c('0x48')]({'name':_0x689a47[_0xa48c('0x28')],'resourceId':_0x689a47['id'],'type':_0x221ed8['name'],'sectionId':_0x221ed8['id']},{})[_0xa48c('0x21')](function(){return _0x4e4b89;});}else{return _0x4e4b89;}})[_0xa48c('0x45')](function(_0x372a51){logger[_0xa48c('0x50')](_0xa48c('0x51'),_0x372a51);throw _0x372a51;});}return _0x4e4b89;})[_0xa48c('0x21')](respondWithResult(_0x228c19,0xc9))[_0xa48c('0x45')](handleError(_0x228c19,null));};exports[_0xa48c('0x1f')]=function(_0xa8ebcb,_0x270cdb){if(_0xa8ebcb[_0xa48c('0x52')]['id']){delete _0xa8ebcb[_0xa48c('0x52')]['id'];}return db[_0xa48c('0x2c')]['find']({'where':{'id':_0xa8ebcb[_0xa48c('0x53')]['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x270cdb,null))['then'](saveUpdates(_0xa8ebcb[_0xa48c('0x52')],null))[_0xa48c('0x21')](respondWithResult(_0x270cdb,null))[_0xa48c('0x45')](handleError(_0x270cdb,null));};exports[_0xa48c('0x20')]=function(_0x58941d,_0x2bb5fa){return db[_0xa48c('0x2c')][_0xa48c('0x4d')]({'where':{'id':_0x58941d[_0xa48c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2bb5fa,null))[_0xa48c('0x21')](removeEntity(_0x2bb5fa,null))['catch'](handleError(_0x2bb5fa,null));};exports[_0xa48c('0x54')]=function(_0x1977bb,_0x412f06,_0x24269b){if(_0x1977bb[_0xa48c('0x52')]['id']){delete _0x1977bb[_0xa48c('0x52')]['id'];}return db[_0xa48c('0x2c')]['find']({'where':{'id':_0x1977bb['params']['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x412f06,null))[_0xa48c('0x21')](function(_0x335e08){if(_0x335e08){_0x1977bb[_0xa48c('0x52')][_0xa48c('0x55')]=_0x335e08['id'];return db[_0xa48c('0x56')][_0xa48c('0x48')](_0x1977bb[_0xa48c('0x52')]);}})[_0xa48c('0x21')](respondWithResult(_0x412f06,null))[_0xa48c('0x45')](handleError(_0x412f06,null));};exports['addAnyCondition']=function(_0x1a59c9,_0x5b20ee,_0x566103){if(_0x1a59c9[_0xa48c('0x52')]['id']){delete _0x1a59c9[_0xa48c('0x52')]['id'];}return db[_0xa48c('0x2c')][_0xa48c('0x4d')]({'where':{'id':_0x1a59c9[_0xa48c('0x53')]['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x5b20ee,null))[_0xa48c('0x21')](function(_0x3be72a){if(_0x3be72a){_0x1a59c9[_0xa48c('0x52')][_0xa48c('0x57')]=_0x3be72a['id'];return db['Condition'][_0xa48c('0x48')](_0x1a59c9[_0xa48c('0x52')]);}})[_0xa48c('0x21')](respondWithResult(_0x5b20ee,null))['catch'](handleError(_0x5b20ee,null));};exports[_0xa48c('0x58')]=function(_0x33314a,_0x277010,_0x140218){var _0x13430b={};var _0x51025c={};var _0x403506;var _0x278f15;return db[_0xa48c('0x2c')][_0xa48c('0x59')]({'where':{'id':_0x33314a[_0xa48c('0x53')]['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x277010,null))[_0xa48c('0x21')](function(_0xe302d4){if(_0xe302d4){_0x403506=_0xe302d4;_0x51025c[_0xa48c('0x34')]=_['keys'](db[_0xa48c('0x56')][_0xa48c('0x2d')]);_0x51025c[_0xa48c('0x31')]=_[_0xa48c('0x32')](_0x33314a[_0xa48c('0x31')]);_0x51025c[_0xa48c('0x3b')]=_['intersection'](_0x51025c[_0xa48c('0x34')],_0x51025c[_0xa48c('0x31')]);_0x13430b['attributes']=_[_0xa48c('0x33')](_0x51025c['model'],qs[_0xa48c('0x36')](_0x33314a[_0xa48c('0x31')]['fields']));_0x13430b[_0xa48c('0x35')]=_0x13430b[_0xa48c('0x35')][_0xa48c('0x46')]?_0x13430b[_0xa48c('0x35')]:_0x51025c[_0xa48c('0x34')];_0x13430b['order']=qs[_0xa48c('0x3a')](_0x33314a[_0xa48c('0x31')][_0xa48c('0x3a')]);_0x13430b[_0xa48c('0x3e')]=qs['filters'](_['pick'](_0x33314a[_0xa48c('0x31')],_0x51025c[_0xa48c('0x3b')]));if(_0x33314a[_0xa48c('0x31')][_0xa48c('0x3d')]){_0x13430b['where']=_[_0xa48c('0x47')](_0x13430b[_0xa48c('0x3e')],{'$or':_[_0xa48c('0x2b')](_0x13430b['attributes'],function(_0xe269f0){var _0x515390={};_0x515390[_0xe269f0]={'$like':'%'+_0x33314a[_0xa48c('0x31')]['filter']+'%'};return _0x515390;})});}_0x13430b=_['merge']({},_0x13430b,_0x33314a[_0xa48c('0x40')]);return _0x403506[_0xa48c('0x58')](_0x13430b);}})['then'](function(_0x4c2d1f){if(_0x4c2d1f){_0x278f15=_0x4c2d1f['length'];if(!_0x33314a[_0xa48c('0x31')][_0xa48c('0x37')](_0xa48c('0x38'))){_0x13430b['limit']=qs[_0xa48c('0x1a')](_0x33314a['query'][_0xa48c('0x1a')]);_0x13430b[_0xa48c('0x18')]=qs[_0xa48c('0x18')](_0x33314a['query'][_0xa48c('0x18')]);}return _0x403506[_0xa48c('0x58')](_0x13430b);}})[_0xa48c('0x21')](function(_0x296776){if(_0x296776){return _0x296776?{'count':_0x278f15,'rows':_0x296776}:null;}})[_0xa48c('0x21')](respondWithResult(_0x277010,null))[_0xa48c('0x45')](handleError(_0x277010,null));};exports[_0xa48c('0x5a')]=function(_0x41624f,_0x2f39ff,_0xd58ef5){var _0x3d73b3={};var _0x3f9985={};var _0x28d3fa;var _0x1058c0;return db[_0xa48c('0x2c')]['findOne']({'where':{'id':_0x41624f['params']['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x2f39ff,null))[_0xa48c('0x21')](function(_0x467a7c){if(_0x467a7c){_0x28d3fa=_0x467a7c;_0x3f9985[_0xa48c('0x34')]=_[_0xa48c('0x32')](db['Condition'][_0xa48c('0x2d')]);_0x3f9985[_0xa48c('0x31')]=_[_0xa48c('0x32')](_0x41624f['query']);_0x3f9985[_0xa48c('0x3b')]=_['intersection'](_0x3f9985[_0xa48c('0x34')],_0x3f9985[_0xa48c('0x31')]);_0x3d73b3[_0xa48c('0x35')]=_[_0xa48c('0x33')](_0x3f9985[_0xa48c('0x34')],qs['fields'](_0x41624f['query'][_0xa48c('0x36')]));_0x3d73b3['attributes']=_0x3d73b3[_0xa48c('0x35')]['length']?_0x3d73b3['attributes']:_0x3f9985[_0xa48c('0x34')];_0x3d73b3[_0xa48c('0x39')]=qs['sort'](_0x41624f[_0xa48c('0x31')][_0xa48c('0x3a')]);_0x3d73b3[_0xa48c('0x3e')]=qs[_0xa48c('0x3b')](_[_0xa48c('0x3c')](_0x41624f[_0xa48c('0x31')],_0x3f9985[_0xa48c('0x3b')]));if(_0x41624f[_0xa48c('0x31')][_0xa48c('0x3d')]){_0x3d73b3[_0xa48c('0x3e')]=_[_0xa48c('0x47')](_0x3d73b3[_0xa48c('0x3e')],{'$or':_[_0xa48c('0x2b')](_0x3d73b3[_0xa48c('0x35')],function(_0x1a00d5){var _0x1f27d9={};_0x1f27d9[_0x1a00d5]={'$like':'%'+_0x41624f[_0xa48c('0x31')][_0xa48c('0x3d')]+'%'};return _0x1f27d9;})});}_0x3d73b3=_['merge']({},_0x3d73b3,_0x41624f['options']);return _0x28d3fa[_0xa48c('0x5a')](_0x3d73b3);}})[_0xa48c('0x21')](function(_0x3ef693){if(_0x3ef693){_0x1058c0=_0x3ef693[_0xa48c('0x46')];if(!_0x41624f[_0xa48c('0x31')][_0xa48c('0x37')](_0xa48c('0x38'))){_0x3d73b3[_0xa48c('0x1a')]=qs['limit'](_0x41624f['query'][_0xa48c('0x1a')]);_0x3d73b3[_0xa48c('0x18')]=qs[_0xa48c('0x18')](_0x41624f[_0xa48c('0x31')][_0xa48c('0x18')]);}return _0x28d3fa[_0xa48c('0x5a')](_0x3d73b3);}})[_0xa48c('0x21')](function(_0x2a84b0){if(_0x2a84b0){return _0x2a84b0?{'count':_0x1058c0,'rows':_0x2a84b0}:null;}})['then'](respondWithResult(_0x2f39ff,null))[_0xa48c('0x45')](handleError(_0x2f39ff,null));};exports[_0xa48c('0x5b')]=function(_0x922919,_0x3f3e6a,_0x94bcf3){if(_0x922919[_0xa48c('0x52')]['id']){delete _0x922919[_0xa48c('0x52')]['id'];}return db[_0xa48c('0x2c')][_0xa48c('0x4d')]({'where':{'id':_0x922919[_0xa48c('0x53')]['id']}})[_0xa48c('0x21')](handleEntityNotFound(_0x3f3e6a,null))[_0xa48c('0x21')](function(_0x4bf526){if(_0x4bf526){_0x922919[_0xa48c('0x52')][_0xa48c('0x5c')]=_0x4bf526['id'];return db[_0xa48c('0x5d')][_0xa48c('0x48')](_0x922919[_0xa48c('0x52')]);}})[_0xa48c('0x21')](respondWithResult(_0x3f3e6a,null))[_0xa48c('0x45')](handleError(_0x3f3e6a,null));};exports[_0xa48c('0x5e')]=function(_0x26410b,_0x1885cd,_0x4e3bc3){var _0x6b820d={};var _0x792871={};var _0x41b9c9;var _0x3058a9;return db[_0xa48c('0x2c')][_0xa48c('0x59')]({'where':{'id':_0x26410b[_0xa48c('0x53')]['id']}})['then'](handleEntityNotFound(_0x1885cd,null))['then'](function(_0x54abd4){if(_0x54abd4){_0x41b9c9=_0x54abd4;_0x792871[_0xa48c('0x34')]=_[_0xa48c('0x32')](db[_0xa48c('0x5d')]['rawAttributes']);_0x792871[_0xa48c('0x31')]=_[_0xa48c('0x32')](_0x26410b[_0xa48c('0x31')]);_0x792871[_0xa48c('0x3b')]=_['intersection'](_0x792871[_0xa48c('0x34')],_0x792871['query']);_0x6b820d[_0xa48c('0x35')]=_[_0xa48c('0x33')](_0x792871[_0xa48c('0x34')],qs['fields'](_0x26410b[_0xa48c('0x31')]['fields']));_0x6b820d[_0xa48c('0x35')]=_0x6b820d[_0xa48c('0x35')][_0xa48c('0x46')]?_0x6b820d[_0xa48c('0x35')]:_0x792871[_0xa48c('0x34')];_0x6b820d['order']=qs[_0xa48c('0x3a')](_0x26410b[_0xa48c('0x31')][_0xa48c('0x3a')]);_0x6b820d[_0xa48c('0x3e')]=qs[_0xa48c('0x3b')](_[_0xa48c('0x3c')](_0x26410b['query'],_0x792871[_0xa48c('0x3b')]));if(_0x26410b['query'][_0xa48c('0x3d')]){_0x6b820d['where']=_[_0xa48c('0x47')](_0x6b820d[_0xa48c('0x3e')],{'$or':_[_0xa48c('0x2b')](_0x6b820d['attributes'],function(_0x35f99b){var _0x213d5f={};_0x213d5f[_0x35f99b]={'$like':'%'+_0x26410b['query'][_0xa48c('0x3d')]+'%'};return _0x213d5f;})});}_0x6b820d=_['merge']({},_0x6b820d,_0x26410b[_0xa48c('0x40')]);return _0x41b9c9[_0xa48c('0x5e')](_0x6b820d);}})['then'](function(_0x12be69){if(_0x12be69){_0x3058a9=_0x12be69[_0xa48c('0x46')];if(!_0x26410b['query'][_0xa48c('0x37')](_0xa48c('0x38'))){_0x6b820d[_0xa48c('0x1a')]=qs[_0xa48c('0x1a')](_0x26410b[_0xa48c('0x31')][_0xa48c('0x1a')]);_0x6b820d['offset']=qs['offset'](_0x26410b[_0xa48c('0x31')][_0xa48c('0x18')]);}return _0x41b9c9[_0xa48c('0x5e')](_0x6b820d);}})['then'](function(_0x3f22e5){if(_0x3f22e5){return _0x3f22e5?{'count':_0x3058a9,'rows':_0x3f22e5}:null;}})['then'](respondWithResult(_0x1885cd,null))['catch'](handleError(_0x1885cd,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d91405d..bdb45f9 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 _0xce50=['rimraf','exports','define','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x2e8dec,_0x1f7f60){var _0x54b607=function(_0x19e7d8){while(--_0x19e7d8){_0x2e8dec['push'](_0x2e8dec['shift']());}};_0x54b607(++_0x1f7f60);}(_0xce50,0x1d8));var _0x0ce5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xce50[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x0ce5('0x0'));var logger=require(_0x0ce5('0x1'))(_0x0ce5('0x2'));var moment=require(_0x0ce5('0x3'));var BPromise=require(_0x0ce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce5('0x5'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x0ce5('0x6')]=function(_0x42fadd,_0x69892c){return _0x42fadd[_0x0ce5('0x7')]('Trigger',attributes,{'tableName':_0x0ce5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','Trigger','tools_triggers','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b1f,0x195));var _0xf4b1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4b1f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'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 9726f6b..b8414ed 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 _0xf58c=['info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','GetTrigger','Trigger','options','raw','where','attributes','include','map','model','ShowTrigger','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf58c,0x134));var _0xcf58=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xf58c[_0x406696];return _0x10e35c;};'use strict';var _=require(_0xcf58('0x0'));var util=require(_0xcf58('0x1'));var moment=require(_0xcf58('0x2'));var BPromise=require(_0xcf58('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf58('0x4'))['db'];var utils=require(_0xcf58('0x5'));var logger=require(_0xcf58('0x6'))(_0xcf58('0x7'));var config=require(_0xcf58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcf58('0x9')][_0xcf58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x264dc5,_0x4fe809,_0x47ef03){return new BPromise(function(_0x36382b,_0x1bb1e9){return client['request'](_0x264dc5,_0x47ef03)[_0xcf58('0xb')](function(_0x4b0d13){logger[_0xcf58('0xc')](_0xcf58('0xd'),_0x4fe809,'request\x20sent');logger[_0xcf58('0xe')](_0xcf58('0xf'),_0x4fe809,_0xcf58('0x10'),JSON[_0xcf58('0x11')](_0x4b0d13));if(_0x4b0d13['error']){if(_0x4b0d13['error'][_0xcf58('0x12')]===0x1f4){logger['error'](_0xcf58('0xd'),_0x4fe809,_0x4b0d13[_0xcf58('0x13')][_0xcf58('0x14')]);return _0x1bb1e9(_0x4b0d13[_0xcf58('0x13')][_0xcf58('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x4fe809,_0x4b0d13['error'][_0xcf58('0x14')]);return _0x36382b(_0x4b0d13[_0xcf58('0x13')][_0xcf58('0x14')]);}else{logger[_0xcf58('0xc')](_0xcf58('0xd'),_0x4fe809,_0xcf58('0x10'));_0x36382b(_0x4b0d13['result'][_0xcf58('0x14')]);}})[_0xcf58('0x15')](function(_0xe512a9){logger[_0xcf58('0x13')]('Trigger,\x20%s,\x20%s',_0x4fe809,_0xe512a9);_0x1bb1e9(_0xe512a9);});});}exports[_0xcf58('0x16')]=function(_0x4d0950){var _0x56fcee=this;return new Promise(function(_0x5e4d95,_0x7de80f){return db[_0xcf58('0x17')]['findAll']({'raw':_0x4d0950[_0xcf58('0x18')]?_0x4d0950[_0xcf58('0x18')][_0xcf58('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0950['options']?_0x4d0950[_0xcf58('0x18')][_0xcf58('0x1a')]||null:null,'attributes':_0x4d0950[_0xcf58('0x18')]?_0x4d0950[_0xcf58('0x18')][_0xcf58('0x1b')]||null:null,'limit':_0x4d0950['options']?_0x4d0950[_0xcf58('0x18')]['limit']||null:null,'include':_0x4d0950[_0xcf58('0x18')]?_0x4d0950['options'][_0xcf58('0x1c')]?_[_0xcf58('0x1d')](_0x4d0950[_0xcf58('0x18')][_0xcf58('0x1c')],function(_0x8f58c8){return{'model':db[_0x8f58c8[_0xcf58('0x1e')]],'as':_0x8f58c8['as'],'attributes':_0x8f58c8[_0xcf58('0x1b')],'include':_0x8f58c8[_0xcf58('0x1c')]?_[_0xcf58('0x1d')](_0x8f58c8[_0xcf58('0x1c')],function(_0x4c0bd7){return{'model':db[_0x4c0bd7[_0xcf58('0x1e')]],'as':_0x4c0bd7['as'],'attributes':_0x4c0bd7[_0xcf58('0x1b')],'include':_0x4c0bd7[_0xcf58('0x1c')]?_[_0xcf58('0x1d')](_0x4c0bd7[_0xcf58('0x1c')],function(_0x7200fe){return{'model':db[_0x7200fe['model']],'as':_0x7200fe['as'],'attributes':_0x7200fe['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf58('0xb')](function(_0x52ba5c){logger['info']('GetTrigger',_0x4d0950);logger[_0xcf58('0xe')]('GetTrigger',_0x4d0950,JSON[_0xcf58('0x11')](_0x52ba5c));_0x5e4d95(_0x52ba5c);})[_0xcf58('0x15')](function(_0x1395e6){logger[_0xcf58('0x13')]('GetTrigger',_0x1395e6[_0xcf58('0x14')],_0x4d0950);_0x7de80f(_0x56fcee['error'](0x1f4,_0x1395e6[_0xcf58('0x14')]));});});};exports[_0xcf58('0x1f')]=function(_0x13964f){var _0x3c9cb6=this;return new Promise(function(_0x3af761,_0x5f0b23){return db[_0xcf58('0x17')]['find']({'raw':_0x13964f[_0xcf58('0x18')]?_0x13964f['options'][_0xcf58('0x19')]===undefined?!![]:![]:!![],'where':_0x13964f['options']?_0x13964f[_0xcf58('0x18')][_0xcf58('0x1a')]||null:null,'attributes':_0x13964f[_0xcf58('0x18')]?_0x13964f['options'][_0xcf58('0x1b')]||null:null,'include':_0x13964f[_0xcf58('0x18')]?_0x13964f[_0xcf58('0x18')][_0xcf58('0x1c')]?_['map'](_0x13964f[_0xcf58('0x18')][_0xcf58('0x1c')],function(_0x1bfc8e){return{'model':db[_0x1bfc8e[_0xcf58('0x1e')]],'as':_0x1bfc8e['as'],'attributes':_0x1bfc8e['attributes'],'include':_0x1bfc8e[_0xcf58('0x1c')]?_['map'](_0x1bfc8e['include'],function(_0x18581e){return{'model':db[_0x18581e['model']],'as':_0x18581e['as'],'attributes':_0x18581e[_0xcf58('0x1b')],'include':_0x18581e[_0xcf58('0x1c')]?_[_0xcf58('0x1d')](_0x18581e['include'],function(_0x4bc2a4){return{'model':db[_0x4bc2a4[_0xcf58('0x1e')]],'as':_0x4bc2a4['as'],'attributes':_0x4bc2a4[_0xcf58('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf58('0xb')](function(_0x592552){logger['info'](_0xcf58('0x1f'),_0x13964f);logger['debug'](_0xcf58('0x1f'),_0x13964f,JSON[_0xcf58('0x11')](_0x592552));_0x3af761(_0x592552);})[_0xcf58('0x15')](function(_0x549085){logger[_0xcf58('0x13')]('ShowTrigger',_0x549085[_0xcf58('0x14')],_0x13964f);_0x5f0b23(_0x3c9cb6[_0xcf58('0x13')](0x1f4,_0x549085[_0xcf58('0x14')]));});});}; \ No newline at end of file +var _0x9f02=['findAll','options','raw','attributes','limit','include','map','model','debug','stringify','catch','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent','code','error','message','result','GetTrigger','Trigger'];(function(_0x2eb2f4,_0x262b32){var _0x594f54=function(_0x13774f){while(--_0x13774f){_0x2eb2f4['push'](_0x2eb2f4['shift']());}};_0x594f54(++_0x262b32);}(_0x9f02,0xc7));var _0x29f0=function(_0x490054,_0x3b0c19){_0x490054=_0x490054-0x0;var _0x138800=_0x9f02[_0x490054];return _0x138800;};'use strict';var _=require(_0x29f0('0x0'));var util=require(_0x29f0('0x1'));var moment=require(_0x29f0('0x2'));var BPromise=require(_0x29f0('0x3'));var rs=require(_0x29f0('0x4'));var fs=require('fs');var Redis=require(_0x29f0('0x5'));var db=require(_0x29f0('0x6'))['db'];var utils=require(_0x29f0('0x7'));var logger=require(_0x29f0('0x8'))(_0x29f0('0x9'));var config=require(_0x29f0('0xa'));var jayson=require(_0x29f0('0xb'));var client=jayson[_0x29f0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462d12,_0x1bf0b1,_0x5c582e){return new BPromise(function(_0x5de822,_0x13fbb9){return client['request'](_0x462d12,_0x5c582e)[_0x29f0('0xd')](function(_0x4299dd){logger[_0x29f0('0xe')](_0x29f0('0xf'),_0x1bf0b1,_0x29f0('0x10'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x1bf0b1,_0x29f0('0x10'),JSON['stringify'](_0x4299dd));if(_0x4299dd['error']){if(_0x4299dd['error'][_0x29f0('0x11')]===0x1f4){logger[_0x29f0('0x12')]('Trigger,\x20%s,\x20%s',_0x1bf0b1,_0x4299dd['error'][_0x29f0('0x13')]);return _0x13fbb9(_0x4299dd['error']['message']);}logger['error'](_0x29f0('0xf'),_0x1bf0b1,_0x4299dd[_0x29f0('0x12')][_0x29f0('0x13')]);return _0x5de822(_0x4299dd[_0x29f0('0x12')][_0x29f0('0x13')]);}else{logger[_0x29f0('0xe')](_0x29f0('0xf'),_0x1bf0b1,_0x29f0('0x10'));_0x5de822(_0x4299dd[_0x29f0('0x14')]['message']);}})['catch'](function(_0x5b2661){logger['error'](_0x29f0('0xf'),_0x1bf0b1,_0x5b2661);_0x13fbb9(_0x5b2661);});});}exports[_0x29f0('0x15')]=function(_0xf1522d){var _0x48c885=this;return new Promise(function(_0x597e80,_0x2e10b1){return db[_0x29f0('0x16')][_0x29f0('0x17')]({'raw':_0xf1522d[_0x29f0('0x18')]?_0xf1522d['options'][_0x29f0('0x19')]===undefined?!![]:![]:!![],'where':_0xf1522d[_0x29f0('0x18')]?_0xf1522d[_0x29f0('0x18')]['where']||null:null,'attributes':_0xf1522d[_0x29f0('0x18')]?_0xf1522d[_0x29f0('0x18')][_0x29f0('0x1a')]||null:null,'limit':_0xf1522d['options']?_0xf1522d['options'][_0x29f0('0x1b')]||null:null,'include':_0xf1522d[_0x29f0('0x18')]?_0xf1522d['options'][_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0xf1522d[_0x29f0('0x18')][_0x29f0('0x1c')],function(_0x27fdd0){return{'model':db[_0x27fdd0[_0x29f0('0x1e')]],'as':_0x27fdd0['as'],'attributes':_0x27fdd0[_0x29f0('0x1a')],'include':_0x27fdd0[_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0x27fdd0[_0x29f0('0x1c')],function(_0x3f18a0){return{'model':db[_0x3f18a0[_0x29f0('0x1e')]],'as':_0x3f18a0['as'],'attributes':_0x3f18a0[_0x29f0('0x1a')],'include':_0x3f18a0['include']?_[_0x29f0('0x1d')](_0x3f18a0[_0x29f0('0x1c')],function(_0x41bf4b){return{'model':db[_0x41bf4b[_0x29f0('0x1e')]],'as':_0x41bf4b['as'],'attributes':_0x41bf4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x29f0('0xd')](function(_0x5cb0b3){logger[_0x29f0('0xe')](_0x29f0('0x15'),_0xf1522d);logger[_0x29f0('0x1f')](_0x29f0('0x15'),_0xf1522d,JSON[_0x29f0('0x20')](_0x5cb0b3));_0x597e80(_0x5cb0b3);})[_0x29f0('0x21')](function(_0x13fc4a){logger[_0x29f0('0x12')]('GetTrigger',_0x13fc4a[_0x29f0('0x13')],_0xf1522d);_0x2e10b1(_0x48c885['error'](0x1f4,_0x13fc4a[_0x29f0('0x13')]));});});};exports[_0x29f0('0x22')]=function(_0x15d58a){var _0x46a501=this;return new Promise(function(_0x10aeca,_0x5bdc95){return db[_0x29f0('0x16')][_0x29f0('0x23')]({'raw':_0x15d58a[_0x29f0('0x18')]?_0x15d58a[_0x29f0('0x18')][_0x29f0('0x19')]===undefined?!![]:![]:!![],'where':_0x15d58a[_0x29f0('0x18')]?_0x15d58a[_0x29f0('0x18')][_0x29f0('0x24')]||null:null,'attributes':_0x15d58a[_0x29f0('0x18')]?_0x15d58a[_0x29f0('0x18')][_0x29f0('0x1a')]||null:null,'include':_0x15d58a['options']?_0x15d58a[_0x29f0('0x18')][_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0x15d58a['options'][_0x29f0('0x1c')],function(_0x193217){return{'model':db[_0x193217[_0x29f0('0x1e')]],'as':_0x193217['as'],'attributes':_0x193217[_0x29f0('0x1a')],'include':_0x193217['include']?_[_0x29f0('0x1d')](_0x193217[_0x29f0('0x1c')],function(_0x8f1ece){return{'model':db[_0x8f1ece['model']],'as':_0x8f1ece['as'],'attributes':_0x8f1ece[_0x29f0('0x1a')],'include':_0x8f1ece['include']?_[_0x29f0('0x1d')](_0x8f1ece[_0x29f0('0x1c')],function(_0x4b9991){return{'model':db[_0x4b9991['model']],'as':_0x4b9991['as'],'attributes':_0x4b9991[_0x29f0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x29f0('0xd')](function(_0x3da117){logger[_0x29f0('0xe')](_0x29f0('0x22'),_0x15d58a);logger[_0x29f0('0x1f')]('ShowTrigger',_0x15d58a,JSON[_0x29f0('0x20')](_0x3da117));_0x10aeca(_0x3da117);})[_0x29f0('0x21')](function(_0xf6dd11){logger[_0x29f0('0x12')](_0x29f0('0x22'),_0xf6dd11[_0x29f0('0x13')],_0x15d58a);_0x5bdc95(_0x46a501[_0x29f0('0x12')](0x1f4,_0xf6dd11[_0x29f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index bf7d326..d296a6c 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 _0x754d=['/:id','post','/:id/clone','create','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1ff6b4,_0x56296e){var _0x57f725=function(_0x3467ce){while(--_0x3467ce){_0x1ff6b4['push'](_0x1ff6b4['shift']());}};_0x57f725(++_0x56296e);}(_0x754d,0xd3));var _0xd754=function(_0x210f26,_0x8ba116){_0x210f26=_0x210f26-0x0;var _0x18839f=_0x754d[_0x210f26];return _0x18839f;};'use strict';var multer=require(_0xd754('0x0'));var util=require('util');var path=require(_0xd754('0x1'));var timeout=require(_0xd754('0x2'));var express=require('express');var router=express[_0xd754('0x3')]();var fs_extra=require(_0xd754('0x4'));var auth=require(_0xd754('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd754('0x6'));var controller=require('./trunk.controller');router[_0xd754('0x7')]('/',auth[_0xd754('0x8')](),controller[_0xd754('0x9')]);router[_0xd754('0x7')](_0xd754('0xa'),auth[_0xd754('0x8')](),controller['show']);router[_0xd754('0xb')](_0xd754('0xc'),auth['isAuthenticated'](),controller['clone']);router[_0xd754('0xb')]('/',auth[_0xd754('0x8')](),controller[_0xd754('0xd')]);router['put'](_0xd754('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd754('0xe')](_0xd754('0xa'),auth['isAuthenticated'](),controller[_0xd754('0xf')]);module[_0xd754('0x10')]=router; \ No newline at end of file +var _0xf46e=['/:id/clone','clone','isAuthenticated','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./trunk.controller','index','get','/:id','post'];(function(_0x5652e3,_0xcc6587){var _0x487e3d=function(_0x2ac30f){while(--_0x2ac30f){_0x5652e3['push'](_0x5652e3['shift']());}};_0x487e3d(++_0xcc6587);}(_0xf46e,0x11f));var _0xef46=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf46e[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xef46('0x0'));var util=require(_0xef46('0x1'));var path=require(_0xef46('0x2'));var timeout=require(_0xef46('0x3'));var express=require(_0xef46('0x4'));var router=express[_0xef46('0x5')]();var fs_extra=require(_0xef46('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xef46('0x7'));var config=require('../../config/environment');var controller=require(_0xef46('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xef46('0x9')]);router[_0xef46('0xa')](_0xef46('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xef46('0xc')](_0xef46('0xd'),auth['isAuthenticated'](),controller[_0xef46('0xe')]);router['post']('/',auth[_0xef46('0xf')](),controller[_0xef46('0x10')]);router[_0xef46('0x11')](_0xef46('0xb'),auth['isAuthenticated'](),controller[_0xef46('0x12')]);router[_0xef46('0x13')](_0xef46('0xb'),auth[_0xef46('0xf')](),controller['destroy']);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 1dcad5d..62a9c80 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 _0xc5d7=['rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x4077e9,_0x479afc){var _0x3673b8=function(_0x331eb3){while(--_0x331eb3){_0x4077e9['push'](_0x4077e9['shift']());}};_0x3673b8(++_0x479afc);}(_0xc5d7,0x185));var _0x7c5d=function(_0x15c147,_0x4a3398){_0x15c147=_0x15c147-0x0;var _0x3acb04=_0xc5d7[_0x15c147];return _0x3acb04;};'use strict';var Sequelize=require(_0x7c5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c5d('0x1')],'allowNull':![],'unique':_0x7c5d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7c5d('0x3'),_0x7c5d('0x4'),_0x7c5d('0x5')),'allowNull':![],'defaultValue':_0x7c5d('0x3')},'context':{'type':Sequelize[_0x7c5d('0x1')],'allowNull':![],'defaultValue':_0x7c5d('0x6')},'callingpres':{'type':Sequelize[_0x7c5d('0x7')]('ALLOWED_NOT_SCREENED',_0x7c5d('0x8'),'ALLOWED_FAILED_SCREEN',_0x7c5d('0x9'),_0x7c5d('0xa'),'PROHIB_PASSED_SCREEN',_0x7c5d('0xb'),_0x7c5d('0xc'))},'deny':{'type':Sequelize[_0x7c5d('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x7c5d('0x1')]},'md5secret':{'type':Sequelize[_0x7c5d('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':_0x7c5d('0xd'),'set':function(_0x1c553c){this['setDataValue']('transport',_0x1c553c?_0x1c553c[_0x7c5d('0xe')](','):null);},'get':function(){return this[_0x7c5d('0xf')](_0x7c5d('0x10'))?this[_0x7c5d('0xf')](_0x7c5d('0x10'))[_0x7c5d('0x11')](','):null;},'comment':_0x7c5d('0x12')},'dtmfmode':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x13'),_0x7c5d('0x14'),_0x7c5d('0x15'),_0x7c5d('0x16'),_0x7c5d('0x17')),'defaultValue':_0x7c5d('0x13')},'directmedia':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no',_0x7c5d('0x19'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':_0x7c5d('0x1a'),'set':function(_0x1fd9d4){this[_0x7c5d('0x1b')]('nat',_0x1fd9d4?_0x1fd9d4[_0x7c5d('0xe')](','):null);},'get':function(){return this[_0x7c5d('0xf')](_0x7c5d('0x1c'))?this[_0x7c5d('0xf')]('nat')[_0x7c5d('0x11')](','):null;},'comment':_0x7c5d('0x1d')},'callgroup':{'type':Sequelize[_0x7c5d('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7c5d('0x1')]},'pickupgroup':{'type':Sequelize[_0x7c5d('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7c5d('0x1')]},'language':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7c5d('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x7c5d('0x1e')},'allow':{'type':Sequelize[_0x7c5d('0x1')],'allowNull':![],'defaultValue':_0x7c5d('0x1f'),'set':function(_0x388915){this[_0x7c5d('0x1b')](_0x7c5d('0x20'),_0x388915?_0x388915[_0x7c5d('0xe')](';'):_0x7c5d('0x1f'));},'get':function(){return this['getDataValue'](_0x7c5d('0x20'))?this['getDataValue'](_0x7c5d('0x20'))['split'](';'):null;},'comment':_0x7c5d('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0x7c5d('0x18'),'no')},'insecure':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':'port,invite','set':function(_0x45cd8a){this[_0x7c5d('0x1b')](_0x7c5d('0x22'),_0x45cd8a?_0x45cd8a[_0x7c5d('0xe')](','):null);},'get':function(){return this[_0x7c5d('0xf')](_0x7c5d('0x22'))?this[_0x7c5d('0xf')]('insecure')[_0x7c5d('0x11')](','):null;},'comment':_0x7c5d('0x23')},'trustrpid':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x7c5d('0x24'))},'promiscredir':{'type':Sequelize[_0x7c5d('0x7')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x7c5d('0x18'),'no')},'accountcode':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':_0x7c5d('0x26')},'amaflags':{'type':Sequelize[_0x7c5d('0x1')]},'callcounter':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':_0x7c5d('0x18')},'busylevel':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x7c5d('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x7c5d('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7c5d('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x7c5d('0x1')]},'template':{'type':Sequelize[_0x7c5d('0x1')]},'videosupport':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no',_0x7c5d('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no')},'mailbox':{'type':Sequelize[_0x7c5d('0x1')]},'session_timers':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x28'),_0x7c5d('0x29'),_0x7c5d('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x7c5d('0x7')]('uac',_0x7c5d('0x2b')),'defaultValue':_0x7c5d('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x7c5d('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x7c5d('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7c5d('0x25')](0x5)},'qualify':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x7c5d('0x1')]},'defaultuser':{'type':Sequelize[_0x7c5d('0x1')]},'rtptimeout':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7c5d('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'timerb':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x7c5d('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x7c5d('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7c5d('0x1')]},'maxforwards':{'type':Sequelize[_0x7c5d('0x25')](0xb)},'encryption':{'type':Sequelize[_0x7c5d('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no')},'force_avp':{'type':Sequelize[_0x7c5d('0x7')]('yes','no')},'icesupport':{'type':Sequelize[_0x7c5d('0x7')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no','fingerprint',_0x7c5d('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7c5d('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x7c5d('0x1')]},'dtlscapath':{'type':Sequelize[_0x7c5d('0x1')]},'dtlssetup':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x2d'),_0x7c5d('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7c5d('0x1')]},'usereqphone':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7c5d('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x7c5d('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no')},'vmexten':{'type':Sequelize[_0x7c5d('0x1')]},'mohinterpret':{'type':Sequelize[_0x7c5d('0x1')]},'mohsuggest':{'type':Sequelize[_0x7c5d('0x1')]},'parkinglot':{'type':Sequelize[_0x7c5d('0x1')]},'description':{'type':Sequelize[_0x7c5d('0x1')]},'host':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':_0x7c5d('0x2f')},'canreinvite':{'type':Sequelize[_0x7c5d('0x7')](_0x7c5d('0x18'),'no',_0x7c5d('0x19'),_0x7c5d('0x30'),_0x7c5d('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7c5d('0x1')]},'otherFields':{'type':Sequelize[_0x7c5d('0x1')]},'active':{'type':Sequelize[_0x7c5d('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7c5d('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xdac4=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','pai','certificate','actpass','update,nonat','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','port,invite','insecure'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xdac4,0x74));var _0x4dac=function(_0x3f9e48,_0xe329b){_0x3f9e48=_0x3f9e48-0x0;var _0x280edd=_0xdac4[_0x3f9e48];return _0x280edd;};'use strict';var Sequelize=require(_0x4dac('0x0'));module[_0x4dac('0x1')]={'name':{'type':Sequelize[_0x4dac('0x2')],'allowNull':![],'unique':_0x4dac('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4dac('0x4'),_0x4dac('0x5'),_0x4dac('0x6')),'allowNull':![],'defaultValue':_0x4dac('0x4')},'context':{'type':Sequelize[_0x4dac('0x2')],'allowNull':![],'defaultValue':_0x4dac('0x7')},'callingpres':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x9'),_0x4dac('0xa'),_0x4dac('0xb'),_0x4dac('0xc'),_0x4dac('0xd'),'PROHIB_PASSED_SCREEN',_0x4dac('0xe'),_0x4dac('0xf'))},'deny':{'type':Sequelize[_0x4dac('0x2')]},'permit':{'type':Sequelize[_0x4dac('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4dac('0x2')]},'remotesecret':{'type':Sequelize[_0x4dac('0x2')]},'transport':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':_0x4dac('0x10'),'set':function(_0x3d2e05){this[_0x4dac('0x11')](_0x4dac('0x12'),_0x3d2e05?_0x3d2e05[_0x4dac('0x13')](','):null);},'get':function(){return this['getDataValue'](_0x4dac('0x12'))?this[_0x4dac('0x14')]('transport')['split'](','):null;},'comment':_0x4dac('0x15')},'dtmfmode':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x16'),_0x4dac('0x17'),'shortinfo',_0x4dac('0x18'),_0x4dac('0x19')),'defaultValue':_0x4dac('0x16')},'directmedia':{'type':Sequelize[_0x4dac('0x8')]('yes','no',_0x4dac('0x1a'),'update',_0x4dac('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4dac('0x8')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4dac('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':_0x4dac('0x1c'),'set':function(_0x2313c4){this[_0x4dac('0x11')](_0x4dac('0x1d'),_0x2313c4?_0x2313c4[_0x4dac('0x13')](','):null);},'get':function(){return this[_0x4dac('0x14')](_0x4dac('0x1d'))?this[_0x4dac('0x14')](_0x4dac('0x1d'))['split'](','):null;},'comment':_0x4dac('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4dac('0x2')]},'pickupgroup':{'type':Sequelize[_0x4dac('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4dac('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x4dac('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4dac('0x20'),'set':function(_0x532cc3){this['setDataValue'](_0x4dac('0x21'),_0x532cc3?_0x532cc3[_0x4dac('0x13')](';'):_0x4dac('0x20'));},'get':function(){return this[_0x4dac('0x14')](_0x4dac('0x21'))?this[_0x4dac('0x14')]('allow')[_0x4dac('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x4dac('0x8')]('yes','no')},'insecure':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':_0x4dac('0x23'),'set':function(_0x2a13f8){this[_0x4dac('0x11')](_0x4dac('0x24'),_0x2a13f8?_0x2a13f8[_0x4dac('0x13')](','):null);},'get':function(){return this[_0x4dac('0x14')]('insecure')?this[_0x4dac('0x14')](_0x4dac('0x24'))[_0x4dac('0x22')](','):null;},'comment':_0x4dac('0x25')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4dac('0x8')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no',_0x4dac('0x27'))},'promiscredir':{'type':Sequelize[_0x4dac('0x8')]('yes','no')},'useclientcode':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x4dac('0x2')]},'callerid':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':_0x4dac('0x28')},'amaflags':{'type':Sequelize[_0x4dac('0x2')]},'callcounter':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x4dac('0x29')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x4dac('0x26'),'no')},'allowsubscribe':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4dac('0x26'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x4dac('0x2')]},'videosupport':{'type':Sequelize[_0x4dac('0x8')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'mailbox':{'type':Sequelize[_0x4dac('0x2')]},'session_timers':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x2a'),_0x4dac('0x2b'),_0x4dac('0x2c'))},'session_expires':{'type':Sequelize[_0x4dac('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x4dac('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x2d'),'uas'),'defaultValue':_0x4dac('0x2e')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4dac('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x4dac('0x26'),'no'),'defaultValue':_0x4dac('0x26')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4dac('0x2')]},'defaultuser':{'type':Sequelize[_0x4dac('0x2')]},'rtptimeout':{'type':Sequelize[_0x4dac('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4dac('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4dac('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no',_0x4dac('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4dac('0x2')]},'callbackextension':{'type':Sequelize[_0x4dac('0x2')]},'timert1':{'type':Sequelize[_0x4dac('0x29')](0xb)},'timerb':{'type':Sequelize[_0x4dac('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4dac('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0x4dac('0x2')]},'contactdeny':{'type':Sequelize[_0x4dac('0x2')]},'contactacl':{'type':Sequelize[_0x4dac('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4dac('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4dac('0x2')]},'maxforwards':{'type':Sequelize[_0x4dac('0x29')](0xb)},'encryption':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x4dac('0x26'),'no')},'dtlsverify':{'type':Sequelize[_0x4dac('0x8')]('yes','no','fingerprint',_0x4dac('0x30'))},'dtlsrekey':{'type':Sequelize[_0x4dac('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4dac('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4dac('0x2')]},'dtlscipher':{'type':Sequelize[_0x4dac('0x2')]},'dtlscafile':{'type':Sequelize[_0x4dac('0x2')]},'dtlscapath':{'type':Sequelize[_0x4dac('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x4dac('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4dac('0x2')]},'usereqphone':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4dac('0x2')]},'recordofffeature':{'type':Sequelize[_0x4dac('0x2')]},'call_limit':{'type':Sequelize[_0x4dac('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4dac('0x26'),'no')},'vmexten':{'type':Sequelize[_0x4dac('0x2')]},'mohinterpret':{'type':Sequelize[_0x4dac('0x2')]},'mohsuggest':{'type':Sequelize[_0x4dac('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4dac('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x4dac('0x8')](_0x4dac('0x26'),'no','nonat','update',_0x4dac('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4dac('0x2')],'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 2ff074b..ffb3a25 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 _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1ceedc,_0x17e4c9){_0x1ceedc=_0x1ceedc-0x0;var _0xfef10d=_0xe5b3[_0x1ceedc];return _0xfef10d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x3801d0,_0x3b3aa8){var _0x4483a9=function(_0x43eba2){while(--_0x43eba2){_0x3801d0['push'](_0x3801d0['shift']());}};_0x4483a9(++_0x3b3aa8);}(_0x425d,0x1e0));var _0xd425=function(_0xfc9121,_0x38e193){_0xfc9121=_0xfc9121-0x0;var _0x4e9f47=_0x425d[_0xfc9121];return _0x4e9f47;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 62ac447..a5ea030 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 _0x6919=['./trunk.attributes','exports','define','tools_trunks','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6919,0x148));var _0x9691=function(_0x398d85,_0x2465d7){_0x398d85=_0x398d85-0x0;var _0x33c2bb=_0x6919[_0x398d85];return _0x33c2bb;};'use strict';var _=require(_0x9691('0x0'));var util=require(_0x9691('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9691('0x2'));var BPromise=require(_0x9691('0x3'));var rp=require(_0x9691('0x4'));var fs=require('fs');var path=require(_0x9691('0x5'));var rimraf=require(_0x9691('0x6'));var config=require(_0x9691('0x7'));var attributes=require(_0x9691('0x8'));module[_0x9691('0x9')]=function(_0x5cf674,_0x12b75a){return _0x5cf674[_0x9691('0xa')]('Trunk',attributes,{'tableName':_0x9691('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1ed=['./trunk.attributes','define','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x455f15,_0x133f2d){var _0x9c8d0f=function(_0x17a8e4){while(--_0x17a8e4){_0x455f15['push'](_0x455f15['shift']());}};_0x9c8d0f(++_0x133f2d);}(_0xf1ed,0x173));var _0xdf1e=function(_0x1cd6ea,_0x416bdb){_0x1cd6ea=_0x1cd6ea-0x0;var _0x525fc2=_0xf1ed[_0x1cd6ea];return _0x525fc2;};'use strict';var _=require(_0xdf1e('0x0'));var util=require(_0xdf1e('0x1'));var logger=require(_0xdf1e('0x2'))('api');var moment=require(_0xdf1e('0x3'));var BPromise=require(_0xdf1e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf1e('0x5'));var rimraf=require('rimraf');var config=require(_0xdf1e('0x6'));var attributes=require(_0xdf1e('0x7'));module['exports']=function(_0x3770ca,_0xb2f0b9){return _0x3770ca[_0xdf1e('0x8')]('Trunk',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 4bb7a54..c1fca80 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 _0xc795=['map','model','find','where','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','http','request','then','request\x20sent','debug','stringify','error','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','options','raw','attributes','limit','include'];(function(_0x32e6ce,_0x171dba){var _0x3a7853=function(_0x16fdb8){while(--_0x16fdb8){_0x32e6ce['push'](_0x32e6ce['shift']());}};_0x3a7853(++_0x171dba);}(_0xc795,0x1a5));var _0x5c79=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc795[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5c79('0x0'));var util=require(_0x5c79('0x1'));var moment=require(_0x5c79('0x2'));var BPromise=require(_0x5c79('0x3'));var rs=require(_0x5c79('0x4'));var fs=require('fs');var Redis=require(_0x5c79('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5c79('0x6'));var config=require(_0x5c79('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x576377,_0x3911c3,_0x871d04){return new BPromise(function(_0x3bde84,_0x1514cd){return client[_0x5c79('0x9')](_0x576377,_0x871d04)[_0x5c79('0xa')](function(_0x538a1a){logger['info']('Trunk,\x20%s,\x20%s',_0x3911c3,_0x5c79('0xb'));logger[_0x5c79('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3911c3,_0x5c79('0xb'),JSON[_0x5c79('0xd')](_0x538a1a));if(_0x538a1a[_0x5c79('0xe')]){if(_0x538a1a['error']['code']===0x1f4){logger[_0x5c79('0xe')](_0x5c79('0xf'),_0x3911c3,_0x538a1a[_0x5c79('0xe')][_0x5c79('0x10')]);return _0x1514cd(_0x538a1a[_0x5c79('0xe')]['message']);}logger[_0x5c79('0xe')](_0x5c79('0xf'),_0x3911c3,_0x538a1a['error'][_0x5c79('0x10')]);return _0x3bde84(_0x538a1a['error'][_0x5c79('0x10')]);}else{logger[_0x5c79('0x11')](_0x5c79('0xf'),_0x3911c3,_0x5c79('0xb'));_0x3bde84(_0x538a1a[_0x5c79('0x12')][_0x5c79('0x10')]);}})[_0x5c79('0x13')](function(_0x58122f){logger[_0x5c79('0xe')](_0x5c79('0xf'),_0x3911c3,_0x58122f);_0x1514cd(_0x58122f);});});}exports[_0x5c79('0x14')]=function(_0x13113e){var _0x3f1ee1=this;return new Promise(function(_0x5f239d,_0x2a114c){return db[_0x5c79('0x15')]['findAll']({'raw':_0x13113e[_0x5c79('0x16')]?_0x13113e[_0x5c79('0x16')][_0x5c79('0x17')]===undefined?!![]:![]:!![],'where':_0x13113e[_0x5c79('0x16')]?_0x13113e[_0x5c79('0x16')]['where']||null:null,'attributes':_0x13113e[_0x5c79('0x16')]?_0x13113e[_0x5c79('0x16')][_0x5c79('0x18')]||null:null,'limit':_0x13113e[_0x5c79('0x16')]?_0x13113e['options'][_0x5c79('0x19')]||null:null,'include':_0x13113e[_0x5c79('0x16')]?_0x13113e[_0x5c79('0x16')][_0x5c79('0x1a')]?_[_0x5c79('0x1b')](_0x13113e[_0x5c79('0x16')][_0x5c79('0x1a')],function(_0x50031d){return{'model':db[_0x50031d['model']],'as':_0x50031d['as'],'attributes':_0x50031d[_0x5c79('0x18')],'include':_0x50031d[_0x5c79('0x1a')]?_[_0x5c79('0x1b')](_0x50031d[_0x5c79('0x1a')],function(_0x40d79a){return{'model':db[_0x40d79a[_0x5c79('0x1c')]],'as':_0x40d79a['as'],'attributes':_0x40d79a[_0x5c79('0x18')],'include':_0x40d79a['include']?_['map'](_0x40d79a[_0x5c79('0x1a')],function(_0x381b87){return{'model':db[_0x381b87[_0x5c79('0x1c')]],'as':_0x381b87['as'],'attributes':_0x381b87[_0x5c79('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x352817){logger[_0x5c79('0x11')](_0x5c79('0x14'),_0x13113e);logger[_0x5c79('0xc')](_0x5c79('0x14'),_0x13113e,JSON[_0x5c79('0xd')](_0x352817));_0x5f239d(_0x352817);})[_0x5c79('0x13')](function(_0x4f989e){logger['error'](_0x5c79('0x14'),_0x4f989e['message'],_0x13113e);_0x2a114c(_0x3f1ee1[_0x5c79('0xe')](0x1f4,_0x4f989e[_0x5c79('0x10')]));});});};exports['ShowTrunk']=function(_0x345b13){var _0x236ec0=this;return new Promise(function(_0x4d1ed6,_0x373a94){return db[_0x5c79('0x15')][_0x5c79('0x1d')]({'raw':_0x345b13[_0x5c79('0x16')]?_0x345b13[_0x5c79('0x16')][_0x5c79('0x17')]===undefined?!![]:![]:!![],'where':_0x345b13['options']?_0x345b13[_0x5c79('0x16')][_0x5c79('0x1e')]||null:null,'attributes':_0x345b13[_0x5c79('0x16')]?_0x345b13['options'][_0x5c79('0x18')]||null:null,'include':_0x345b13['options']?_0x345b13[_0x5c79('0x16')][_0x5c79('0x1a')]?_[_0x5c79('0x1b')](_0x345b13[_0x5c79('0x16')][_0x5c79('0x1a')],function(_0xf1746){return{'model':db[_0xf1746['model']],'as':_0xf1746['as'],'attributes':_0xf1746[_0x5c79('0x18')],'include':_0xf1746[_0x5c79('0x1a')]?_['map'](_0xf1746['include'],function(_0x18fad0){return{'model':db[_0x18fad0['model']],'as':_0x18fad0['as'],'attributes':_0x18fad0[_0x5c79('0x18')],'include':_0x18fad0[_0x5c79('0x1a')]?_[_0x5c79('0x1b')](_0x18fad0['include'],function(_0x9a19c7){return{'model':db[_0x9a19c7[_0x5c79('0x1c')]],'as':_0x9a19c7['as'],'attributes':_0x9a19c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5c79('0xa')](function(_0x3df2d1){logger[_0x5c79('0x11')]('ShowTrunk',_0x345b13);logger[_0x5c79('0xc')](_0x5c79('0x1f'),_0x345b13,JSON[_0x5c79('0xd')](_0x3df2d1));_0x4d1ed6(_0x3df2d1);})['catch'](function(_0x3d34a6){logger[_0x5c79('0xe')](_0x5c79('0x1f'),_0x3d34a6[_0x5c79('0x10')],_0x345b13);_0x373a94(_0x236ec0['error'](0x1f4,_0x3d34a6['message']));});});}; \ No newline at end of file +var _0xc05c=['Trunk','findAll','options','raw','where','attributes','limit','include','model','map','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk'];(function(_0x1abbe6,_0x2685d1){var _0x32c903=function(_0x5f3ae4){while(--_0x5f3ae4){_0x1abbe6['push'](_0x1abbe6['shift']());}};_0x32c903(++_0x2685d1);}(_0xc05c,0x192));var _0xcc05=function(_0x3b8256,_0xdf9a6b){_0x3b8256=_0x3b8256-0x0;var _0x255f75=_0xc05c[_0x3b8256];return _0x255f75;};'use strict';var _=require(_0xcc05('0x0'));var util=require(_0xcc05('0x1'));var moment=require(_0xcc05('0x2'));var BPromise=require(_0xcc05('0x3'));var rs=require(_0xcc05('0x4'));var fs=require('fs');var Redis=require(_0xcc05('0x5'));var db=require(_0xcc05('0x6'))['db'];var utils=require(_0xcc05('0x7'));var logger=require(_0xcc05('0x8'))(_0xcc05('0x9'));var config=require(_0xcc05('0xa'));var jayson=require(_0xcc05('0xb'));var client=jayson[_0xcc05('0xc')][_0xcc05('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28c39f,_0x2a0013,_0x22c589){return new BPromise(function(_0x186556,_0x2e4fe2){return client['request'](_0x28c39f,_0x22c589)[_0xcc05('0xe')](function(_0x15a0fe){logger[_0xcc05('0xf')](_0xcc05('0x10'),_0x2a0013,_0xcc05('0x11'));logger[_0xcc05('0x12')](_0xcc05('0x13'),_0x2a0013,_0xcc05('0x11'),JSON[_0xcc05('0x14')](_0x15a0fe));if(_0x15a0fe['error']){if(_0x15a0fe[_0xcc05('0x15')][_0xcc05('0x16')]===0x1f4){logger[_0xcc05('0x15')](_0xcc05('0x10'),_0x2a0013,_0x15a0fe[_0xcc05('0x15')][_0xcc05('0x17')]);return _0x2e4fe2(_0x15a0fe[_0xcc05('0x15')][_0xcc05('0x17')]);}logger[_0xcc05('0x15')]('Trunk,\x20%s,\x20%s',_0x2a0013,_0x15a0fe[_0xcc05('0x15')][_0xcc05('0x17')]);return _0x186556(_0x15a0fe[_0xcc05('0x15')][_0xcc05('0x17')]);}else{logger[_0xcc05('0xf')](_0xcc05('0x10'),_0x2a0013,_0xcc05('0x11'));_0x186556(_0x15a0fe[_0xcc05('0x18')][_0xcc05('0x17')]);}})[_0xcc05('0x19')](function(_0x36cbdc){logger[_0xcc05('0x15')](_0xcc05('0x10'),_0x2a0013,_0x36cbdc);_0x2e4fe2(_0x36cbdc);});});}exports[_0xcc05('0x1a')]=function(_0x4e20e0){var _0x4b5882=this;return new Promise(function(_0x1601c2,_0x57e85e){return db[_0xcc05('0x1b')][_0xcc05('0x1c')]({'raw':_0x4e20e0[_0xcc05('0x1d')]?_0x4e20e0[_0xcc05('0x1d')][_0xcc05('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e20e0[_0xcc05('0x1d')]?_0x4e20e0[_0xcc05('0x1d')][_0xcc05('0x1f')]||null:null,'attributes':_0x4e20e0[_0xcc05('0x1d')]?_0x4e20e0[_0xcc05('0x1d')][_0xcc05('0x20')]||null:null,'limit':_0x4e20e0[_0xcc05('0x1d')]?_0x4e20e0['options'][_0xcc05('0x21')]||null:null,'include':_0x4e20e0[_0xcc05('0x1d')]?_0x4e20e0['options'][_0xcc05('0x22')]?_['map'](_0x4e20e0[_0xcc05('0x1d')][_0xcc05('0x22')],function(_0x48a145){return{'model':db[_0x48a145[_0xcc05('0x23')]],'as':_0x48a145['as'],'attributes':_0x48a145['attributes'],'include':_0x48a145[_0xcc05('0x22')]?_['map'](_0x48a145[_0xcc05('0x22')],function(_0x57f018){return{'model':db[_0x57f018[_0xcc05('0x23')]],'as':_0x57f018['as'],'attributes':_0x57f018[_0xcc05('0x20')],'include':_0x57f018[_0xcc05('0x22')]?_[_0xcc05('0x24')](_0x57f018[_0xcc05('0x22')],function(_0x52f91c){return{'model':db[_0x52f91c[_0xcc05('0x23')]],'as':_0x52f91c['as'],'attributes':_0x52f91c[_0xcc05('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcc05('0xe')](function(_0x458ed7){logger[_0xcc05('0xf')](_0xcc05('0x1a'),_0x4e20e0);logger['debug']('GetTrunk',_0x4e20e0,JSON[_0xcc05('0x14')](_0x458ed7));_0x1601c2(_0x458ed7);})['catch'](function(_0xd75ca1){logger[_0xcc05('0x15')](_0xcc05('0x1a'),_0xd75ca1['message'],_0x4e20e0);_0x57e85e(_0x4b5882[_0xcc05('0x15')](0x1f4,_0xd75ca1[_0xcc05('0x17')]));});});};exports[_0xcc05('0x25')]=function(_0xb56edd){var _0x42b4a3=this;return new Promise(function(_0x394feb,_0x67f3fc){return db['Trunk'][_0xcc05('0x26')]({'raw':_0xb56edd['options']?_0xb56edd[_0xcc05('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xb56edd['options']?_0xb56edd[_0xcc05('0x1d')][_0xcc05('0x1f')]||null:null,'attributes':_0xb56edd[_0xcc05('0x1d')]?_0xb56edd[_0xcc05('0x1d')][_0xcc05('0x20')]||null:null,'include':_0xb56edd['options']?_0xb56edd[_0xcc05('0x1d')][_0xcc05('0x22')]?_[_0xcc05('0x24')](_0xb56edd[_0xcc05('0x1d')][_0xcc05('0x22')],function(_0x23142b){return{'model':db[_0x23142b[_0xcc05('0x23')]],'as':_0x23142b['as'],'attributes':_0x23142b[_0xcc05('0x20')],'include':_0x23142b[_0xcc05('0x22')]?_[_0xcc05('0x24')](_0x23142b[_0xcc05('0x22')],function(_0x1bdd35){return{'model':db[_0x1bdd35[_0xcc05('0x23')]],'as':_0x1bdd35['as'],'attributes':_0x1bdd35[_0xcc05('0x20')],'include':_0x1bdd35[_0xcc05('0x22')]?_[_0xcc05('0x24')](_0x1bdd35[_0xcc05('0x22')],function(_0x7d925b){return{'model':db[_0x7d925b[_0xcc05('0x23')]],'as':_0x7d925b['as'],'attributes':_0x7d925b[_0xcc05('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48aace){logger[_0xcc05('0xf')](_0xcc05('0x25'),_0xb56edd);logger['debug'](_0xcc05('0x25'),_0xb56edd,JSON[_0xcc05('0x14')](_0x48aace));_0x394feb(_0x48aace);})[_0xcc05('0x19')](function(_0x2930f2){logger[_0xcc05('0x15')](_0xcc05('0x25'),_0x2930f2['message'],_0xb56edd);_0x67f3fc(_0x42b4a3[_0xcc05('0x15')](0x1f4,_0x2930f2[_0xcc05('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 85a38c9..f970202 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 _0x4a70=['../../components/auth/service','put','isAuthenticated','update','exports','express','Router'];(function(_0x2ca794,_0x3e0030){var _0x27b67b=function(_0x40f96b){while(--_0x40f96b){_0x2ca794['push'](_0x2ca794['shift']());}};_0x27b67b(++_0x3e0030);}(_0x4a70,0x15c));var _0x04a7=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x4a70[_0x1f99a0];return _0x1e0849;};'use strict';var express=require(_0x04a7('0x0'));var router=express[_0x04a7('0x1')]();var auth=require(_0x04a7('0x2'));var controller=require('./user-setting.controller');router[_0x04a7('0x3')]('/:id',auth[_0x04a7('0x4')](),controller[_0x04a7('0x5')]);module[_0x04a7('0x6')]=router; \ No newline at end of file +var _0x435d=['express','../../components/auth/service','put','/:id','isAuthenticated','update','exports'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x435d,0x1b2));var _0xd435=function(_0x4df359,_0x41f7d2){_0x4df359=_0x4df359-0x0;var _0x239f00=_0x435d[_0x4df359];return _0x239f00;};'use strict';var express=require(_0xd435('0x0'));var router=express['Router']();var auth=require(_0xd435('0x1'));var controller=require('./user-setting.controller');router[_0xd435('0x2')](_0xd435('0x3'),auth[_0xd435('0x4')](),controller[_0xd435('0x5')]);module[_0xd435('0x6')]=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 2911183..5fecc12 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 _0xedba=['warning','info','debug','exports','ENUM','TEXT','DATE','INTEGER','UserId','error'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xedba,0x6d));var _0xaedb=function(_0x169e28,_0x351183){_0x169e28=_0x169e28-0x0;var _0x32ac67=_0xedba[_0x169e28];return _0x32ac67;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xaedb('0x0'),_0xaedb('0x1'),_0xaedb('0x2'),_0xaedb('0x3')];module[_0xaedb('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xaedb('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xaedb('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xaedb('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xaedb('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xaedb('0x8')],'unique':_0xaedb('0x9')}}; \ No newline at end of file +var _0x9402=['warning','info','debug','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x122493,_0x347b6c){var _0x17a149=function(_0x16828b){while(--_0x16828b){_0x122493['push'](_0x122493['shift']());}};_0x17a149(++_0x347b6c);}(_0x9402,0xee));var _0x2940=function(_0xc52585,_0xa2ac69){_0xc52585=_0xc52585-0x0;var _0x4c6b34=_0x9402[_0xc52585];return _0x4c6b34;};'use strict';var Sequelize=require(_0x2940('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x2940('0x1'),_0x2940('0x2'),_0x2940('0x3'),_0x2940('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2940('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2940('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x2940('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2940('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2940('0x8')],'unique':_0x2940('0x9')}}; \ 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 574fb3e..0a11395 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 _0x7ee1=['then','sendStatus','error','stack','name','send','update','role','admin','Unauthorized','params','UserSetting','find','body','catch','lodash','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','defaults','redis','localhost','status'];(function(_0x4635e5,_0x5590a9){var _0x5a187b=function(_0x4e4f0c){while(--_0x4e4f0c){_0x4635e5['push'](_0x4635e5['shift']());}};_0x5a187b(++_0x5590a9);}(_0x7ee1,0xab));var _0x17ee=function(_0x2eaeec,_0x377c1b){_0x2eaeec=_0x2eaeec-0x0;var _0x134134=_0x7ee1[_0x2eaeec];return _0x134134;};'use strict';var _=require(_0x17ee('0x0'));var Redis=require('ioredis');var logger=require(_0x17ee('0x1'))(_0x17ee('0x2'));var config=require(_0x17ee('0x3'));var db=require(_0x17ee('0x4'))['db'];var socket=require(_0x17ee('0x5'))(new Redis(config['redis']));require(_0x17ee('0x6'))['register'](socket);config['redis']=_[_0x17ee('0x7')](config[_0x17ee('0x8')],{'host':_0x17ee('0x9'),'port':0x18eb});function respondWithResult(_0x3e6b4c,_0x28cc37){_0x28cc37=_0x28cc37||0xc8;return function(_0x59b876){if(_0x59b876){return _0x3e6b4c[_0x17ee('0xa')](_0x28cc37)['json'](_0x59b876);}};}function saveUpdates(_0x274eb5){return function(_0x45fe06){if(_0x45fe06){return _0x45fe06['update'](_0x274eb5)[_0x17ee('0xb')](function(_0x36d73a){return _0x36d73a;});}return null;};}function handleEntityNotFound(_0xa9902e){return function(_0x3c879d){if(!_0x3c879d){_0xa9902e[_0x17ee('0xc')](0x194);}return _0x3c879d;};}function handleError(_0x352d60,_0xac3906){_0xac3906=_0xac3906||0x1f4;return function(_0xcb2375){logger[_0x17ee('0xd')](_0xcb2375[_0x17ee('0xe')]);if(_0xcb2375[_0x17ee('0xf')]){delete _0xcb2375[_0x17ee('0xf')];}_0x352d60['status'](_0xac3906)[_0x17ee('0x10')](_0xcb2375);};}exports[_0x17ee('0x11')]=function(_0x4bdbdf,_0x1b3857){if(_0x4bdbdf['user'][_0x17ee('0x12')]!==_0x17ee('0x13'))throw new Error(_0x17ee('0x14'));if(isNaN(Number(_0x4bdbdf[_0x17ee('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x17ee('0x16')][_0x17ee('0x17')]({'where':{'id':_0x4bdbdf[_0x17ee('0x15')]['id']}})['then'](handleEntityNotFound(_0x1b3857,null))[_0x17ee('0xb')](saveUpdates(_0x4bdbdf[_0x17ee('0x18')],null))[_0x17ee('0xb')](respondWithResult(_0x1b3857,null))[_0x17ee('0x19')](handleError(_0x1b3857,null));}; \ No newline at end of file +var _0xcb18=['localhost','json','update','then','stack','name','status','send','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','catch','../../config/logger','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults'];(function(_0x11908c,_0x547af6){var _0x10cd4e=function(_0x2c0d66){while(--_0x2c0d66){_0x11908c['push'](_0x11908c['shift']());}};_0x10cd4e(++_0x547af6);}(_0xcb18,0x159));var _0x8cb1=function(_0x2f5ddd,_0x1ed5ac){_0x2f5ddd=_0x2f5ddd-0x0;var _0x1003e0=_0xcb18[_0x2f5ddd];return _0x1003e0;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x8cb1('0x0'))('api');var config=require(_0x8cb1('0x1'));var db=require('../../mysqldb')['db'];var socket=require(_0x8cb1('0x2'))(new Redis(config[_0x8cb1('0x3')]));require(_0x8cb1('0x4'))[_0x8cb1('0x5')](socket);config[_0x8cb1('0x3')]=_[_0x8cb1('0x6')](config['redis'],{'host':_0x8cb1('0x7'),'port':0x18eb});function respondWithResult(_0x335e41,_0x55ca24){_0x55ca24=_0x55ca24||0xc8;return function(_0x186f71){if(_0x186f71){return _0x335e41['status'](_0x55ca24)[_0x8cb1('0x8')](_0x186f71);}};}function saveUpdates(_0x428b70){return function(_0x5de23d){if(_0x5de23d){return _0x5de23d[_0x8cb1('0x9')](_0x428b70)[_0x8cb1('0xa')](function(_0x1a89e7){return _0x1a89e7;});}return null;};}function handleEntityNotFound(_0x1b62e7){return function(_0x2e8ccf){if(!_0x2e8ccf){_0x1b62e7['sendStatus'](0x194);}return _0x2e8ccf;};}function handleError(_0x5ef3d0,_0x19f26a){_0x19f26a=_0x19f26a||0x1f4;return function(_0x42b5be){logger['error'](_0x42b5be[_0x8cb1('0xb')]);if(_0x42b5be[_0x8cb1('0xc')]){delete _0x42b5be[_0x8cb1('0xc')];}_0x5ef3d0[_0x8cb1('0xd')](_0x19f26a)[_0x8cb1('0xe')](_0x42b5be);};}exports[_0x8cb1('0x9')]=function(_0x4a0bfc,_0x1f132f){if(_0x4a0bfc['user'][_0x8cb1('0xf')]!==_0x8cb1('0x10'))throw new Error(_0x8cb1('0x11'));if(isNaN(Number(_0x4a0bfc[_0x8cb1('0x12')]['id'])))throw new Error(_0x8cb1('0x13'));return db[_0x8cb1('0x14')]['find']({'where':{'id':_0x4a0bfc[_0x8cb1('0x12')]['id']}})['then'](handleEntityNotFound(_0x1f132f,null))['then'](saveUpdates(_0x4a0bfc['body'],null))[_0x8cb1('0xa')](respondWithResult(_0x1f132f,null))[_0x8cb1('0x15')](handleError(_0x1f132f,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 adeaf08..b672505 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 _0x6d69=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserSetting'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x6d69,0x7c));var _0x96d6=function(_0x333253,_0x31f200){_0x333253=_0x333253-0x0;var _0x56587e=_0x6d69[_0x333253];return _0x56587e;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x96d6('0x0'))['db'][_0x96d6('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x96d6('0x2')](0x0);var events={'afterCreate':_0x96d6('0x3'),'afterUpdate':'update','afterDestroy':_0x96d6('0x4')};function emitEvent(_0x3a7d54){return function(_0x5e8f56,_0x347a1c,_0x3814e2){UserSettingEvents[_0x96d6('0x5')](_0x3a7d54+':'+_0x5e8f56['id'],_0x5e8f56);UserSettingEvents[_0x96d6('0x5')](_0x3a7d54,_0x5e8f56);_0x3814e2(null);};}for(var e in events){if(events[_0x96d6('0x6')](e)){var event=events[e];UserSetting[_0x96d6('0x7')](e,emitEvent(event));}}module[_0x96d6('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x7f9d=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7f9d,0x183));var _0xd7f9=function(_0x48ac9d,_0x5e192d){_0x48ac9d=_0x48ac9d-0x0;var _0x579e9f=_0x7f9d[_0x48ac9d];return _0x579e9f;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xd7f9('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd7f9('0x1')](0x0);var events={'afterCreate':_0xd7f9('0x2'),'afterUpdate':'update','afterDestroy':_0xd7f9('0x3')};function emitEvent(_0x41848d){return function(_0x3f3bb4,_0x265efd,_0x4722af){UserSettingEvents['emit'](_0x41848d+':'+_0x3f3bb4['id'],_0x3f3bb4);UserSettingEvents[_0xd7f9('0x4')](_0x41848d,_0x3f3bb4);_0x4722af(null);};}for(var e in events){if(events[_0xd7f9('0x5')](e)){var event=events[e];UserSetting[_0xd7f9('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 e9b32d7..dd76bd7 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 _0xa477=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0xa477,0xe6));var _0x7a47=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa477[_0x2b4411];return _0x8e41ef;};'use strict';var attributes=require(_0x7a47('0x0'));module[_0x7a47('0x1')]=function(_0x576699){return _0x576699[_0x7a47('0x2')](_0x7a47('0x3'),attributes,{'tableName':_0x7a47('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19697b){if(!_0x19697b[_0x7a47('0x5')])_0x19697b[_0x7a47('0x6')]=null;else if(_0x19697b[_0x7a47('0x6')]===null)_0x19697b['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x83e1=['exports','define','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x188ad3,_0x6ed96d){var _0x376d4c=function(_0x3d53a6){while(--_0x3d53a6){_0x188ad3['push'](_0x188ad3['shift']());}};_0x376d4c(++_0x6ed96d);}(_0x83e1,0x1ad));var _0x183e=function(_0x1eef8b,_0x1f8ab9){_0x1eef8b=_0x1eef8b-0x0;var _0x3c3368=_0x83e1[_0x1eef8b];return _0x3c3368;};'use strict';var attributes=require(_0x183e('0x0'));module[_0x183e('0x1')]=function(_0x5f5222){return _0x5f5222[_0x183e('0x2')]('UserSetting',attributes,{'tableName':_0x183e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59d53f){if(!_0x59d53f['clientSideLoggingEnabled'])_0x59d53f[_0x183e('0x4')]=null;else if(_0x59d53f[_0x183e('0x4')]===null)_0x59d53f['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index c6b041c..f962d5a 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 _0xd5d2=['user-setting:update','register','length','./user-setting.events','save','remove','update','emit'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd5d2,0x19b));var _0x2d5d=function(_0x15fa45,_0x132622){_0x15fa45=_0x15fa45-0x0;var _0x3e7413=_0xd5d2[_0x15fa45];return _0x3e7413;};'use strict';var UserSettingEvents=require(_0x2d5d('0x0'));var events=[_0x2d5d('0x1'),_0x2d5d('0x2'),_0x2d5d('0x3')];function createListener(_0x48b44b,_0x5996cd){return function(_0x2557f7){_0x5996cd[_0x2d5d('0x4')](_0x48b44b,_0x2557f7);if(_0x48b44b===_0x2d5d('0x5')){_0x5996cd[_0x2d5d('0x4')]('user-setting:update:user-'+_0x2557f7['UserId'],_0x2557f7);}};}exports[_0x2d5d('0x6')]=function(_0x29c380){for(var _0x3b8b81=0x0,_0x508447=events[_0x2d5d('0x7')];_0x3b8b81<_0x508447;_0x3b8b81++){var _0x5299c3=events[_0x3b8b81];var _0x49dfa8=createListener('user-setting:'+_0x5299c3,_0x29c380);UserSettingEvents['on'](_0x5299c3,_0x49dfa8);}}; \ No newline at end of file +var _0xc0fd=['save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','./user-setting.events'];(function(_0x3e8559,_0x41fe9f){var _0x5a212a=function(_0x5c2116){while(--_0x5c2116){_0x3e8559['push'](_0x3e8559['shift']());}};_0x5a212a(++_0x41fe9f);}(_0xc0fd,0x17b));var _0xdc0f=function(_0x4f11bb,_0x2fcf65){_0x4f11bb=_0x4f11bb-0x0;var _0x4d5900=_0xc0fd[_0x4f11bb];return _0x4d5900;};'use strict';var UserSettingEvents=require(_0xdc0f('0x0'));var events=[_0xdc0f('0x1'),_0xdc0f('0x2'),_0xdc0f('0x3')];function createListener(_0x4afb27,_0x1508f6){return function(_0x211a1f){_0x1508f6[_0xdc0f('0x4')](_0x4afb27,_0x211a1f);if(_0x4afb27===_0xdc0f('0x5')){_0x1508f6[_0xdc0f('0x4')](_0xdc0f('0x6')+_0x211a1f[_0xdc0f('0x7')],_0x211a1f);}};}exports[_0xdc0f('0x8')]=function(_0xcd25b2){for(var _0x3a6783=0x0,_0x46d831=events[_0xdc0f('0x9')];_0x3a6783<_0x46d831;_0x3a6783++){var _0x362a14=events[_0x3a6783];var _0x3d8450=createListener('user-setting:'+_0x362a14,_0xcd25b2);UserSettingEvents['on'](_0x362a14,_0x3d8450);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 57ce57f..86d67e5 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 _0xd05d=['/:id','update','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getFaxAccounts','getMailAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','originalname','single','file','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put'];(function(_0x545bcd,_0x343e09){var _0x25f876=function(_0x3a0e4d){while(--_0x3a0e4d){_0x545bcd['push'](_0x545bcd['shift']());}};_0x25f876(++_0x343e09);}(_0xd05d,0x8f));var _0xdd05=function(_0x847c62,_0xf701f5){_0x847c62=_0x847c62-0x0;var _0x79a926=_0xd05d[_0x847c62];return _0x79a926;};'use strict';var multer=require(_0xdd05('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdd05('0x1'));var express=require(_0xdd05('0x2'));var router=express['Router']();var fs_extra=require(_0xdd05('0x3'));var auth=require(_0xdd05('0x4'));var interaction=require(_0xdd05('0x5'));var config=require(_0xdd05('0x6'));var controller=require('./user.controller');router[_0xdd05('0x7')]('/',auth[_0xdd05('0x8')](),controller[_0xdd05('0x9')]);router['get'](_0xdd05('0xa'),auth[_0xdd05('0x8')](),controller[_0xdd05('0xb')]);router['get'](_0xdd05('0xc'),auth[_0xdd05('0x8')](),controller[_0xdd05('0xd')]);router[_0xdd05('0x7')](_0xdd05('0xe'),auth[_0xdd05('0x8')](),controller['getPresence']);router['get']('/:id',auth[_0xdd05('0x8')](),controller[_0xdd05('0xf')]);router[_0xdd05('0x7')](_0xdd05('0x10'),controller['getAvatar']);router[_0xdd05('0x7')](_0xdd05('0x11'),auth['isAuthenticated'](),controller[_0xdd05('0x12')]);router['get'](_0xdd05('0x13'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x14')]);router[_0xdd05('0x7')]('/:id/queues',auth['isAuthenticated'](),controller[_0xdd05('0x15')]);router[_0xdd05('0x7')](_0xdd05('0x16'),auth[_0xdd05('0x8')](),controller['getVoiceQueuesRt']);router['get'](_0xdd05('0x17'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x18')]);router['get'](_0xdd05('0x19'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x1a')]);router[_0xdd05('0x7')](_0xdd05('0x1b'),auth[_0xdd05('0x8')](),controller['getScreenRecordings']);router[_0xdd05('0x7')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xdd05('0x1c')]);router['get'](_0xdd05('0x1d'),auth[_0xdd05('0x8')](),controller['getOpenchannelInteractions']);router[_0xdd05('0x7')](_0xdd05('0x1e'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x1f')]);router[_0xdd05('0x7')](_0xdd05('0x20'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x21')]);router[_0xdd05('0x7')](_0xdd05('0x22'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x23')]);router[_0xdd05('0x7')]('/:id/whatsapp/interactions',auth[_0xdd05('0x8')](),controller['getWhatsappInteractions']);router[_0xdd05('0x7')](_0xdd05('0x24'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x25')]);router[_0xdd05('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xdd05('0x26')]);router[_0xdd05('0x7')](_0xdd05('0x27'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x28')]);router[_0xdd05('0x7')]('/:id/prefixes',auth[_0xdd05('0x8')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0xdd05('0x8')](),controller[_0xdd05('0x29')]);router[_0xdd05('0x7')]('/:id/mail_accounts',auth[_0xdd05('0x8')](),controller[_0xdd05('0x2a')]);router[_0xdd05('0x7')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xdd05('0x7')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xdd05('0x2b')]);router[_0xdd05('0x7')]('/:id/chat_websites',auth[_0xdd05('0x8')](),controller[_0xdd05('0x2c')]);router[_0xdd05('0x7')](_0xdd05('0x2d'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x2e')]);router['get'](_0xdd05('0x2f'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x30')]);router[_0xdd05('0x7')](_0xdd05('0x31'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x32')]);router[_0xdd05('0x7')](_0xdd05('0x33'),auth[_0xdd05('0x8')](),controller['getApiKey']);router['post']('/:id/contacts',auth[_0xdd05('0x8')](),controller[_0xdd05('0x34')]);router[_0xdd05('0x35')]('/',auth[_0xdd05('0x8')](),controller[_0xdd05('0x36')]);router[_0xdd05('0x35')]('/create_many',auth[_0xdd05('0x8')](),controller[_0xdd05('0x37')]);router[_0xdd05('0x35')](_0xdd05('0x38'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x39')]);var upload=multer({'storage':multer[_0xdd05('0x3a')]({'destination':function(_0x519a94,_0x55cae2,_0x21c080){_0x21c080(null,path[_0xdd05('0x3b')](config[_0xdd05('0x3c')],_0xdd05('0x3d')));},'filename':function(_0x3ee8a6,_0x3079b4,_0x15de16){_0x15de16(null,util[_0xdd05('0x3e')]('%s-%s',Date['now'](),_0x3079b4[_0xdd05('0x3f')]));}})});router[_0xdd05('0x35')](_0xdd05('0x10'),upload[_0xdd05('0x40')](_0xdd05('0x41')),controller['addAvatar']);router[_0xdd05('0x35')](_0xdd05('0x42'),auth['isAuthenticated'](),controller['login']);router[_0xdd05('0x35')](_0xdd05('0x43'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x44')]);router[_0xdd05('0x35')](_0xdd05('0x45'),auth['isAuthenticated'](),controller[_0xdd05('0x46')]);router[_0xdd05('0x35')](_0xdd05('0x47'),auth['isAuthenticated'](),controller[_0xdd05('0x48')]);router['post']('/:id/teams',auth[_0xdd05('0x8')](),controller[_0xdd05('0x49')]);router[_0xdd05('0x35')]('/:id/chat_interactions',auth[_0xdd05('0x8')](),controller[_0xdd05('0x4a')]);router[_0xdd05('0x35')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xdd05('0x4b')]);router['post'](_0xdd05('0x4c'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x4d')]);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xdd05('0x4e')]);router[_0xdd05('0x35')]('/:id/openchannel_interactions',auth[_0xdd05('0x8')](),controller[_0xdd05('0x4f')]);router['post'](_0xdd05('0x50'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x51')]);router['post'](_0xdd05('0x52'),auth['isAuthenticated'](),controller[_0xdd05('0x53')]);router[_0xdd05('0x35')](_0xdd05('0x54'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x55')]);router[_0xdd05('0x35')](_0xdd05('0x56'),auth['isAuthenticated'](),controller[_0xdd05('0x57')]);router['post'](_0xdd05('0x58'),auth[_0xdd05('0x8')](),controller['addSmsAccounts']);router[_0xdd05('0x35')](_0xdd05('0x59'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x5a')]);router[_0xdd05('0x35')]('/:id/whatsapp_accounts',auth[_0xdd05('0x8')](),controller[_0xdd05('0x5b')]);router['post'](_0xdd05('0x2f'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x5c')]);router[_0xdd05('0x35')](_0xdd05('0x33'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x5d')]);router[_0xdd05('0x5e')](_0xdd05('0x5f'),auth['isAuthenticated'](),controller[_0xdd05('0x60')]);router['put']('/:id/password',auth['isAuthenticated'](),controller[_0xdd05('0x61')]);router[_0xdd05('0x62')](_0xdd05('0x38'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x63')]);router['delete']('/:id/teams',auth[_0xdd05('0x8')](),controller[_0xdd05('0x64')]);router[_0xdd05('0x62')](_0xdd05('0x5f'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x65')]);router[_0xdd05('0x62')](_0xdd05('0x66'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x67')]);router[_0xdd05('0x62')](_0xdd05('0x68'),auth['isAuthenticated'](),controller[_0xdd05('0x69')]);router['delete'](_0xdd05('0x4c'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x6a')]);router[_0xdd05('0x62')](_0xdd05('0x6b'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x6c')]);router[_0xdd05('0x62')]('/:id/openchannel_interactions',auth[_0xdd05('0x8')](),controller[_0xdd05('0x6d')]);router['delete'](_0xdd05('0x50'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x6e')]);router[_0xdd05('0x62')](_0xdd05('0x52'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x6f')]);router[_0xdd05('0x62')](_0xdd05('0x54'),auth['isAuthenticated'](),controller[_0xdd05('0x70')]);router['delete'](_0xdd05('0x56'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xdd05('0x62')](_0xdd05('0x58'),auth['isAuthenticated'](),controller[_0xdd05('0x71')]);router[_0xdd05('0x62')]('/:id/chat_websites',auth[_0xdd05('0x8')](),controller[_0xdd05('0x72')]);router['delete']('/:id/whatsapp_accounts',auth[_0xdd05('0x8')](),controller[_0xdd05('0x73')]);router[_0xdd05('0x62')](_0xdd05('0x2f'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x74')]);router['delete'](_0xdd05('0x33'),auth[_0xdd05('0x8')](),controller[_0xdd05('0x75')]);module[_0xdd05('0x76')]=router; \ No newline at end of file +var _0x51ab=['addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','/:id/password','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','Router','fs-extra','../../components/interaction/service','index','get','/describe','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','now','originalname','addAvatar','/:id/login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts'];(function(_0x1f95be,_0x4b0670){var _0x5d37e6=function(_0x2f0313){while(--_0x2f0313){_0x1f95be['push'](_0x1f95be['shift']());}};_0x5d37e6(++_0x4b0670);}(_0x51ab,0x16f));var _0xb51a=function(_0x3ea4f0,_0x11e72c){_0x3ea4f0=_0x3ea4f0-0x0;var _0x285840=_0x51ab[_0x3ea4f0];return _0x285840;};'use strict';var multer=require('multer');var util=require(_0xb51a('0x0'));var path=require(_0xb51a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb51a('0x2')]();var fs_extra=require(_0xb51a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb51a('0x4'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb51a('0x5')]);router[_0xb51a('0x6')](_0xb51a('0x7'),auth['isAuthenticated'](),controller[_0xb51a('0x8')]);router[_0xb51a('0x6')](_0xb51a('0x9'),auth[_0xb51a('0xa')](),controller[_0xb51a('0xb')]);router[_0xb51a('0x6')](_0xb51a('0xc'),auth[_0xb51a('0xa')](),controller[_0xb51a('0xd')]);router[_0xb51a('0x6')](_0xb51a('0xe'),auth['isAuthenticated'](),controller[_0xb51a('0xf')]);router['get'](_0xb51a('0x10'),controller[_0xb51a('0x11')]);router[_0xb51a('0x6')](_0xb51a('0x12'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x13')]);router['get'](_0xb51a('0x14'),auth['isAuthenticated'](),controller[_0xb51a('0x15')]);router[_0xb51a('0x6')](_0xb51a('0x16'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x17')]);router[_0xb51a('0x6')](_0xb51a('0x18'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x19')]);router['get'](_0xb51a('0x1a'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x1b')]);router[_0xb51a('0x6')]('/:id/recordings',auth['isAuthenticated'](),controller[_0xb51a('0x1c')]);router[_0xb51a('0x6')]('/:id/screen_recordings',auth[_0xb51a('0xa')](),controller[_0xb51a('0x1d')]);router['get'](_0xb51a('0x1e'),auth['isAuthenticated'](),controller[_0xb51a('0x1f')]);router['get'](_0xb51a('0x20'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x21')]);router[_0xb51a('0x6')](_0xb51a('0x22'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x23')]);router[_0xb51a('0x6')](_0xb51a('0x24'),auth[_0xb51a('0xa')](),controller['getSmsInteractions']);router[_0xb51a('0x6')](_0xb51a('0x25'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x26')]);router[_0xb51a('0x6')]('/:id/whatsapp/interactions',auth[_0xb51a('0xa')](),controller[_0xb51a('0x27')]);router[_0xb51a('0x6')](_0xb51a('0x28'),auth[_0xb51a('0xa')](),controller['getTeams']);router[_0xb51a('0x6')]('/:id/lists',auth['isAuthenticated'](),controller[_0xb51a('0x29')]);router['get'](_0xb51a('0x2a'),auth[_0xb51a('0xa')](),controller['getAgents']);router[_0xb51a('0x6')](_0xb51a('0x2b'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x2c')]);router[_0xb51a('0x6')](_0xb51a('0x2d'),auth[_0xb51a('0xa')](),controller['getFaxAccounts']);router[_0xb51a('0x6')](_0xb51a('0x2e'),auth['isAuthenticated'](),controller[_0xb51a('0x2f')]);router[_0xb51a('0x6')]('/:id/openchannel_accounts',auth[_0xb51a('0xa')](),controller[_0xb51a('0x30')]);router[_0xb51a('0x6')](_0xb51a('0x31'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x32')]);router[_0xb51a('0x6')](_0xb51a('0x33'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x34')]);router[_0xb51a('0x6')](_0xb51a('0x35'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x36')]);router[_0xb51a('0x6')]('/:id/square_projects',auth[_0xb51a('0xa')](),controller[_0xb51a('0x37')]);router[_0xb51a('0x6')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xb51a('0x6')](_0xb51a('0x38'),auth[_0xb51a('0xa')](),controller['getApiKey']);router['post'](_0xb51a('0x14'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x39')]);router[_0xb51a('0x3a')]('/',auth[_0xb51a('0xa')](),controller[_0xb51a('0x3b')]);router[_0xb51a('0x3a')](_0xb51a('0x3c'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x3d')]);router[_0xb51a('0x3a')](_0xb51a('0x16'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x3e')]);var upload=multer({'storage':multer[_0xb51a('0x3f')]({'destination':function(_0x393660,_0x24434b,_0x582165){_0x582165(null,path['join'](config[_0xb51a('0x40')],_0xb51a('0x41')));},'filename':function(_0x487a90,_0x10c5c0,_0x4b9819){_0x4b9819(null,util[_0xb51a('0x42')]('%s-%s',Date[_0xb51a('0x43')](),_0x10c5c0[_0xb51a('0x44')]));}})});router[_0xb51a('0x3a')]('/:id/avatar',upload['single']('file'),controller[_0xb51a('0x45')]);router['post'](_0xb51a('0x46'),auth['isAuthenticated'](),controller['login']);router[_0xb51a('0x3a')]('/:id/logout',auth['isAuthenticated'](),controller[_0xb51a('0x47')]);router[_0xb51a('0x3a')](_0xb51a('0x48'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x49')]);router[_0xb51a('0x3a')](_0xb51a('0x4a'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x4b')]);router[_0xb51a('0x3a')](_0xb51a('0x28'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x4c')]);router[_0xb51a('0x3a')](_0xb51a('0x4d'),auth[_0xb51a('0xa')](),controller['addChatInteractions']);router[_0xb51a('0x3a')](_0xb51a('0x4e'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x4f')]);router[_0xb51a('0x3a')](_0xb51a('0x50'),auth['isAuthenticated'](),controller[_0xb51a('0x51')]);router[_0xb51a('0x3a')](_0xb51a('0x52'),auth['isAuthenticated'](),controller[_0xb51a('0x53')]);router[_0xb51a('0x3a')](_0xb51a('0x54'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x55')]);router[_0xb51a('0x3a')](_0xb51a('0x56'),auth['isAuthenticated'](),controller[_0xb51a('0x57')]);router[_0xb51a('0x3a')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xb51a('0x58')]);router[_0xb51a('0x3a')](_0xb51a('0x2e'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x59')]);router[_0xb51a('0x3a')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xb51a('0x5a')]);router[_0xb51a('0x3a')]('/:id/sms_accounts',auth[_0xb51a('0xa')](),controller['addSmsAccounts']);router['post'](_0xb51a('0x33'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x5b')]);router[_0xb51a('0x3a')](_0xb51a('0x35'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x5c')]);router[_0xb51a('0x3a')](_0xb51a('0x5d'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x5e')]);router[_0xb51a('0x3a')](_0xb51a('0x38'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x5f')]);router[_0xb51a('0x60')](_0xb51a('0xe'),auth[_0xb51a('0xa')](),controller['update']);router[_0xb51a('0x60')](_0xb51a('0x61'),auth[_0xb51a('0xa')](),controller['changePassword']);router[_0xb51a('0x62')](_0xb51a('0x16'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xb51a('0x62')](_0xb51a('0x28'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x63')]);router[_0xb51a('0x62')](_0xb51a('0xe'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x64')]);router['delete'](_0xb51a('0x4d'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x65')]);router[_0xb51a('0x62')]('/:id/mail_interactions',auth[_0xb51a('0xa')](),controller[_0xb51a('0x66')]);router[_0xb51a('0x62')](_0xb51a('0x50'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x67')]);router[_0xb51a('0x62')](_0xb51a('0x52'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x68')]);router[_0xb51a('0x62')]('/:id/openchannel_interactions',auth[_0xb51a('0xa')](),controller['removeOpenchannelInteractions']);router[_0xb51a('0x62')](_0xb51a('0x56'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x69')]);router[_0xb51a('0x62')](_0xb51a('0x2d'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x6a')]);router['delete'](_0xb51a('0x2e'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xb51a('0x62')](_0xb51a('0x6b'),auth['isAuthenticated'](),controller[_0xb51a('0x6c')]);router[_0xb51a('0x62')](_0xb51a('0x31'),auth[_0xb51a('0xa')](),controller[_0xb51a('0x6d')]);router['delete'](_0xb51a('0x33'),auth['isAuthenticated'](),controller[_0xb51a('0x6e')]);router['delete']('/:id/whatsapp_accounts',auth[_0xb51a('0xa')](),controller[_0xb51a('0x6f')]);router[_0xb51a('0x62')](_0xb51a('0x5d'),auth[_0xb51a('0xa')](),controller['removeSquareProjects']);router[_0xb51a('0x62')](_0xb51a('0x38'),auth['isAuthenticated'](),controller[_0xb51a('0x70')]);module[_0xb51a('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7566aff..b75cb52 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x2894dd,_0x32ac13){var _0x4504c4=function(_0x21d79b){while(--_0x21d79b){_0x2894dd['push'](_0x2894dd['shift']());}};_0x4504c4(++_0x32ac13);}(_0x34e8,0x12c));var _0x834e=function(_0x1da067,_0x4b16a4){_0x1da067=_0x1da067-0x0;var _0xc003a=_0x34e8[_0x1da067];return _0xc003a;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x4d068d,_0x26361c){var _0x1d6185=function(_0x3d2104){while(--_0x3d2104){_0x4d068d['push'](_0x4d068d['shift']());}};_0x1d6185(++_0x26361c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb91[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'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 917bcc4..cc2083a 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 _0x6512=['params','model','keys','intersection','fields','length','merge','options','body','describe','addContacts','ids','omit','Setting','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','email','101','103','105','106','107','108','109','100','111','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','userProfileId','VoiceMail','UserProfileSection','Agents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','telephone','isEmpty','autoAssociation','compact','changePassword','newPassword','Sequelize','ValidationError','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','get','format','SIP/%s','UserVoiceQueueRt','removeQueues','Unknown\x20channel','remove','isArray','Queue:remove','addAvatar','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','where','filters','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getQueues','findOne','Queue','Unknown\x20role','getVoiceQueuesRt','rawAttributes','nolimit','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','resolve','pause','QueuePause','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getLists','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$gte','$lte','$ne','$eq','$between','$notBetween','$like','$iLike','$notILike','$contained','$any','firstName','lastName','phone','Contact','dialActive','VoiceQueue','CmHopper','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','getUserSetting','getPresence','queues','teams','inbound','flatten','lower','col','asc','desc','substring','uniqBy','orderBy','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','redis','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','emit','destroy','role','admin','user','agent','Telephones','map','value','find','name','UserProfileResource','stack','send','index','User','fieldName','key','filter','includes','password','salt','getOptions','query','includeAll','userSetting','true','include','UserSetting','attributes','push','findAll','rows','openTabs','chat','sms','dataValues','fax','mail','openchannel','whatsapp'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x6512,0x139));var _0x2651=function(_0x1cc6d1,_0x4b3cfa){_0x1cc6d1=_0x1cc6d1-0x0;var _0x3dc97b=_0x6512[_0x1cc6d1];return _0x3dc97b;};'use strict';var moment=require('moment');var util=require('util');var path=require(_0x2651('0x0'));var fs=require('fs');var _=require(_0x2651('0x1'));var squel=require(_0x2651('0x2'));var jayson=require(_0x2651('0x3'));var Redis=require(_0x2651('0x4'));var authService=require('../../components/auth/service');var qs=require(_0x2651('0x5'));var logger=require(_0x2651('0x6'))(_0x2651('0x7'));var utils=require(_0x2651('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0x2651('0x9'));var APIBadRequestError=require(_0x2651('0xa'))[_0x2651('0xb')];var APINotFoundError=require(_0x2651('0xa'))['APINotFoundError'];var APIHandleError=require(_0x2651('0xa'))['handleError'];var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')['register'](socket);config[_0x2651('0xc')]=_['defaults'](config['redis'],{'host':_0x2651('0xd'),'port':0x18eb});var amiClient=jayson['client'][_0x2651('0xe')]({'port':0x232a});var values;function respondWithRpcPromise(_0x322119,_0x443bdf,_0x16b3c1,_0x3daa0c){return new Promise(function(_0x193a7b,_0x4d8586){var _0x539d54=_0x3daa0c||amiClient;return _0x539d54[_0x2651('0xf')](_0x322119,_0x16b3c1)[_0x2651('0x10')](function(_0x458d1d){logger[_0x2651('0x11')](_0x2651('0x12'),_0x443bdf,_0x2651('0x13'));logger['debug'](_0x2651('0x14'),_0x443bdf,_0x2651('0x13'),JSON[_0x2651('0x15')](_0x458d1d));if(_0x458d1d['error']){if(_0x458d1d[_0x2651('0x16')][_0x2651('0x17')]===0x1f4){logger['error'](_0x2651('0x12'),_0x443bdf,_0x458d1d['error']['message']);return _0x4d8586(_0x458d1d[_0x2651('0x16')][_0x2651('0x18')]);}logger['error'](_0x2651('0x12'),_0x443bdf,_0x458d1d[_0x2651('0x16')][_0x2651('0x18')]);return _0x193a7b(_0x458d1d['error'][_0x2651('0x18')]);}else{logger[_0x2651('0x11')](_0x2651('0x12'),_0x443bdf,_0x2651('0x13'));_0x193a7b(_0x458d1d['result']['message']);}})[_0x2651('0x19')](function(_0x17e219){logger[_0x2651('0x16')](_0x2651('0x12'),_0x443bdf,_0x17e219);_0x4d8586(_0x17e219);});});}function respondWithStatusCode(_0x32c2d6,_0x59f3fc){_0x59f3fc=_0x59f3fc||0xcc;return function(_0x16455a){if(_0x16455a){return _0x32c2d6[_0x2651('0x1a')](_0x59f3fc);}return _0x32c2d6[_0x2651('0x1b')](_0x59f3fc)[_0x2651('0x1c')]();};}function respondWithResult(_0x4bc2c2,_0x1f4f58){_0x1f4f58=_0x1f4f58||0xc8;return function(_0x10b22b){if(_0x10b22b){return _0x4bc2c2[_0x2651('0x1b')](_0x1f4f58)[_0x2651('0x1d')](_0x10b22b);}};}function respondWithFilteredResult(_0x29b8b8,_0x4b38de){return function(_0x4be7a0){if(_0x4be7a0){var _0x4a235f=typeof _0x4b38de[_0x2651('0x1e')]===_0x2651('0x1f')&&typeof _0x4b38de['limit']==='undefined';var _0x5a9036=_0x4be7a0[_0x2651('0x20')];var _0x3280e7=_0x4a235f?0x0:_0x4b38de[_0x2651('0x1e')];var _0x2a4154=_0x4a235f?_0x4be7a0[_0x2651('0x20')]:_0x4b38de[_0x2651('0x1e')]+_0x4b38de[_0x2651('0x21')];var _0xcd3f0a;if(_0x2a4154>=_0x5a9036){_0x2a4154=_0x5a9036;_0xcd3f0a=0xc8;}else{_0xcd3f0a=0xce;}_0x29b8b8[_0x2651('0x1b')](_0xcd3f0a);return _0x29b8b8[_0x2651('0x22')](_0x2651('0x23'),_0x3280e7+'-'+_0x2a4154+'/'+_0x5a9036)['json'](_0x4be7a0);}return null;};}function saveUpdates(_0x2f8e94){return function(_0x1d3c58){if(_0x1d3c58){return _0x1d3c58[_0x2651('0x24')](_0x2f8e94)['then'](function(_0x1befc9){socket[_0x2651('0x25')]('userNotification:recalc:'+_0x1befc9['id'],{});return _0x1befc9;});}return null;};}function removeEntity(_0x57f6f1){return function(_0x303884){if(_0x303884){return _0x303884[_0x2651('0x26')]()[_0x2651('0x10')](function(){var _0x2793c6=_0x303884['get']({'plain':!![]});if(_0x2793c6[_0x2651('0x27')]===_0x2651('0x28'))return;var _0x33ff8e=[{'name':'Users','value':_0x2651('0x29'),'ignore':!![]},{'name':'Agents','value':_0x2651('0x2a'),'ignore':![]},{'name':_0x2651('0x2b'),'value':'telephone','ignore':![]}];var _0x2e5553=_(_0x33ff8e)['filter']('ignore')[_0x2651('0x2c')](_0x2651('0x2d'))['value']();if(_['includes'](_0x2e5553,_0x2793c6[_0x2651('0x27')])){return;}var _0x6d4f77=_[_0x2651('0x2e')](_0x33ff8e,[_0x2651('0x2d'),_0x2793c6[_0x2651('0x27')]])[_0x2651('0x2f')];return db[_0x2651('0x30')][_0x2651('0x26')]({'where':{'type':_0x6d4f77,'resourceId':_0x2793c6['id']}})['then'](function(){return _0x303884;});})[_0x2651('0x10')](function(){_0x57f6f1['status'](0xcc)[_0x2651('0x1c')]();});}};}function handleEntityNotFound(_0x536120){return function(_0x46bda1){if(!_0x46bda1){_0x536120[_0x2651('0x1a')](0x194);}return _0x46bda1;};}function handleError(_0x26ec4b,_0x25c7ed){_0x25c7ed=_0x25c7ed||0x1f4;return function(_0x54fe07){logger[_0x2651('0x16')](_0x54fe07[_0x2651('0x31')]);if(_0x54fe07[_0x2651('0x2f')]){delete _0x54fe07[_0x2651('0x2f')];}_0x26ec4b['status'](_0x25c7ed)[_0x2651('0x32')](_0x54fe07);};}exports[_0x2651('0x33')]=function(_0x4e2712,_0x5f3de0){var _0x29cccf={},_0x19b3f1={'count':0x0,'rows':[]};var _0x48636c=_(db[_0x2651('0x34')]['rawAttributes'])[_0x2651('0x2c')](function(_0x976b8e){return{'name':_0x976b8e[_0x2651('0x35')],'type':_0x976b8e['type'][_0x2651('0x36')]};})[_0x2651('0x37')](function(_0x155303){return!_[_0x2651('0x38')]([_0x2651('0x39'),_0x2651('0x3a')],_0x155303[_0x2651('0x2f')]);})[_0x2651('0x2d')]();_0x29cccf=qs[_0x2651('0x3b')](_0x48636c,_0x4e2712);var _0x772fa4={'where':_0x29cccf['where']};return db[_0x2651('0x34')][_0x2651('0x20')](_0x772fa4)['then'](function(_0x5a9524){_0x19b3f1[_0x2651('0x20')]=_0x5a9524;if(_0x4e2712[_0x2651('0x3c')][_0x2651('0x3d')]){_0x29cccf['include']=[{'all':!![]}];}if(_0x4e2712['query'][_0x2651('0x3e')]===_0x2651('0x3f')){_0x29cccf[_0x2651('0x40')]=[{'model':db[_0x2651('0x41')],'as':_0x2651('0x3e')}];}if(!_['includes'](_0x29cccf[_0x2651('0x42')],'id')){_0x29cccf[_0x2651('0x42')][_0x2651('0x43')]('id');}return db[_0x2651('0x34')][_0x2651('0x44')](_0x29cccf);})[_0x2651('0x10')](function(_0x28b46c){_0x19b3f1[_0x2651('0x45')]=_0x28b46c;if(_0x4e2712['query'][_0x2651('0x46')]===_0x2651('0x3f')){var _0x20c1cb=[];for(var _0x51a575=0x0;_0x51a575<_0x19b3f1['rows']['length'];_0x51a575++){_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x47'),_0x19b3f1['rows'][_0x51a575]['dataValues']));_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x48'),_0x19b3f1[_0x2651('0x45')][_0x51a575][_0x2651('0x49')]));_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x4a'),_0x19b3f1[_0x2651('0x45')][_0x51a575][_0x2651('0x49')]));_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x4b'),_0x19b3f1[_0x2651('0x45')][_0x51a575]['dataValues']));_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x4c'),_0x19b3f1[_0x2651('0x45')][_0x51a575][_0x2651('0x49')]));_0x20c1cb[_0x2651('0x43')](get_open_tabs(_0x2651('0x4d'),_0x19b3f1['rows'][_0x51a575][_0x2651('0x49')]));}return Promise['all'](_0x20c1cb)[_0x2651('0x10')](function(){return _0x19b3f1;});}else{return _0x19b3f1;}})[_0x2651('0x10')](respondWithFilteredResult(_0x5f3de0,_0x29cccf))[_0x2651('0x19')](handleError(_0x5f3de0,null));};exports['show']=function(_0x3a2de1,_0x1c04ae){var _0x3cf2f4={'raw':![],'where':{'id':_0x3a2de1[_0x2651('0x4e')]['id']}},_0x50849c={};_0x50849c[_0x2651('0x4f')]=_['differenceBy'](_[_0x2651('0x50')](db['User']['rawAttributes']),[_0x2651('0x39'),_0x2651('0x3a')]);_0x50849c['query']=_[_0x2651('0x50')](_0x3a2de1[_0x2651('0x3c')]);_0x50849c['filters']=_[_0x2651('0x51')](_0x50849c[_0x2651('0x4f')],_0x50849c['query']);_0x3cf2f4[_0x2651('0x42')]=_['intersection'](_0x50849c[_0x2651('0x4f')],qs[_0x2651('0x52')](_0x3a2de1[_0x2651('0x3c')]['fields']));_0x3cf2f4[_0x2651('0x42')]=_0x3cf2f4['attributes'][_0x2651('0x53')]?_0x3cf2f4['attributes']:_0x50849c['model'];if(_0x3a2de1['query'][_0x2651('0x3d')]){_0x3cf2f4[_0x2651('0x40')]=[{'all':!![]}];}if(_0x3a2de1[_0x2651('0x3c')][_0x2651('0x3e')]===_0x2651('0x3f')){_0x3cf2f4[_0x2651('0x40')]=[{'model':db[_0x2651('0x41')],'as':_0x2651('0x3e')}];}_0x3cf2f4=_[_0x2651('0x54')]({},_0x3cf2f4,_0x3a2de1[_0x2651('0x55')]);if(!_['includes'](_0x3cf2f4['attributes'],'id')){_0x3cf2f4['attributes'][_0x2651('0x43')]('id');}return db['User'][_0x2651('0x2e')](_0x3cf2f4)[_0x2651('0x10')](handleEntityNotFound(_0x1c04ae,null))[_0x2651('0x10')](function(_0x1cff11){var _0x24f668=[];values=_0x1cff11;if(_0x3a2de1[_0x2651('0x3c')][_0x2651('0x46')]==='true'){_0x24f668[_0x2651('0x43')](get_open_tabs(_0x2651('0x47'),_0x1cff11[_0x2651('0x49')]));_0x24f668[_0x2651('0x43')](get_open_tabs('sms',_0x1cff11[_0x2651('0x49')]));_0x24f668['push'](get_open_tabs(_0x2651('0x4c'),_0x1cff11[_0x2651('0x49')]));_0x24f668[_0x2651('0x43')](get_open_tabs(_0x2651('0x4d'),_0x1cff11[_0x2651('0x49')]));_0x24f668[_0x2651('0x43')](get_open_tabs(_0x2651('0x4a'),_0x1cff11[_0x2651('0x49')]));_0x24f668[_0x2651('0x43')](get_open_tabs('mail',_0x1cff11[_0x2651('0x49')]));return Promise['all'](_0x24f668);}else{return values;}})['then'](function(){return values;})[_0x2651('0x10')](respondWithResult(_0x1c04ae,null))[_0x2651('0x19')](handleError(_0x1c04ae,null));};exports[_0x2651('0x24')]=function(_0xfb5677,_0x315eab){if(_0xfb5677[_0x2651('0x56')]['id']){delete _0xfb5677[_0x2651('0x56')]['id'];}delete _0xfb5677[_0x2651('0x56')][_0x2651('0x27')];return db[_0x2651('0x34')][_0x2651('0x2e')]({'where':{'id':_0xfb5677['params']['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x315eab,null))[_0x2651('0x10')](saveUpdates(_0xfb5677['body'],null))[_0x2651('0x10')](respondWithResult(_0x315eab,null))[_0x2651('0x19')](handleError(_0x315eab,null));};exports['describe']=function(_0x54ebc7,_0x2b1231){return db['User'][_0x2651('0x57')]()[_0x2651('0x10')](respondWithResult(_0x2b1231,null))[_0x2651('0x19')](handleError(_0x2b1231,null));};exports[_0x2651('0x58')]=function(_0x30058f,_0x48c9f3){return db[_0x2651('0x34')]['find']({'where':{'id':_0x30058f[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x48c9f3,null))[_0x2651('0x10')](function(_0x1bc435){if(_0x1bc435){return _0x1bc435[_0x2651('0x58')](_0x30058f[_0x2651('0x56')][_0x2651('0x59')],_[_0x2651('0x5a')](_0x30058f[_0x2651('0x56')],[_0x2651('0x59'),'id'])||{});}})[_0x2651('0x10')](respondWithResult(_0x48c9f3,null))[_0x2651('0x19')](handleError(_0x48c9f3,null));};function validateUser(_0x5129c8){return new Promise(function(_0x1ceaf9,_0x342b9b){if(_0x5129c8['internal'])return _0x1ceaf9(_0x5129c8);return db[_0x2651('0x5b')]['findById'](0x1)[_0x2651('0x10')](function(_0xcd9ffa){if(_0xcd9ffa['securePassword'])authService[_0x2651('0x5c')](_0x5129c8[_0x2651('0x39')]);db[_0x2651('0x34')][_0x2651('0x5d')](_0x2651('0x5e'))[_0x2651('0x10')](function(_0x31af7d){if(_[_0x2651('0x5f')](_0x31af7d)){_0x5129c8['internal']=_0xcd9ffa[_0x2651('0x60')]||0x1;return;}if(_['isNil'](_0xcd9ffa[_0x2651('0x60')])||_0xcd9ffa['min_internal']===_0x31af7d){_0x5129c8[_0x2651('0x5e')]=_0x31af7d+0x1;return;}if(_0xcd9ffa[_0x2651('0x60')]>_0x31af7d){_0x5129c8[_0x2651('0x5e')]=_0xcd9ffa[_0x2651('0x60')];return;}return db[_0x2651('0x61')][_0x2651('0x3c')](_0x2651('0x62'),{'type':db[_0x2651('0x61')][_0x2651('0x63')][_0x2651('0x64')]})['then'](function(_0xfd8ff9){if(_0xfd8ff9&&_0xfd8ff9[_0x2651('0x53')]){for(var _0x18fb5b=0x0,_0x567afe=_0xfd8ff9[_0x2651('0x53')];_0x18fb5b<_0x567afe&&_['isNil'](_0x5129c8['internal']);_0x18fb5b++){if(_0xcd9ffa[_0x2651('0x60')]<=_0xfd8ff9[_0x18fb5b][_0x2651('0x65')]){_0x5129c8[_0x2651('0x5e')]=_0xfd8ff9[_0x18fb5b][_0x2651('0x65')];}else if(_0xcd9ffa[_0x2651('0x60')]>_0xfd8ff9[_0x18fb5b][_0x2651('0x65')]&&_0xcd9ffa[_0x2651('0x60')]<=_0xfd8ff9[_0x18fb5b]['to']){_0x5129c8['internal']=_0xcd9ffa[_0x2651('0x60')];}}}if(_['isNil'](_0x5129c8[_0x2651('0x5e')])){_0x5129c8[_0x2651('0x5e')]=_0x31af7d+0x1;}return _0x1ceaf9(_0x5129c8);});});})['catch'](function(_0x30f0ec){_0x342b9b(_0x30f0ec);});});}function updateUser(_0x54fdec){return new Promise(function(_0x97b54,_0x178ce3){try{if(_0x54fdec[_0x2651('0x66')]){_0x54fdec[_0x2651('0x67')]=_0x54fdec[_0x2651('0x5e')];_0x54fdec['VoiceMail']={'mailbox':_0x54fdec['internal'],'password':_0x54fdec[_0x2651('0x39')],'fullname':_0x54fdec['fullname'],'email':_0x54fdec[_0x2651('0x68')]};}if(_0x54fdec['role']===_0x2651('0x2a')){if(!_0x54fdec['permissions'])_0x54fdec['permissions']=[_0x2651('0x69'),'102',_0x2651('0x6a'),'113','110','104',_0x2651('0x6b'),_0x2651('0x6c'),_0x2651('0x6d'),_0x2651('0x6e'),_0x2651('0x6f'),_0x2651('0x70'),_0x2651('0x71'),_0x2651('0x72'),_0x2651('0x73')];}_0x97b54(_0x54fdec);}catch(_0x5514ec){_0x178ce3(_0x5514ec);}});}exports[_0x2651('0x74')]=function(_0x2bf848,_0x579b7a){if(_0x2bf848[_0x2651('0x29')][_0x2651('0x27')]===_0x2651('0x2a'))throw new Error('Unauthorized');if(_0x2bf848[_0x2651('0x56')][_0x2651('0x27')]==='user'&&_0x2bf848[_0x2651('0x29')][_0x2651('0x27')]!==_0x2651('0x28')){throw new Error(_0x2651('0x75'));}if(_0x2bf848['body']['role']===_0x2651('0x28')&&_0x2bf848[_0x2651('0x29')][_0x2651('0x27')]!==_0x2651('0x28')){throw new Error(_0x2651('0x76'));}return licenseUtil[_0x2651('0x77')]([_0x2bf848[_0x2651('0x56')]])[_0x2651('0x10')](function(){return validateUser(_0x2bf848[_0x2651('0x56')]);})['then'](function(_0x86be3e){return updateUser(_0x86be3e)['then'](function(_0x14ee15){if(_0x14ee15[_0x2651('0x27')]===_0x2651('0x28')){_0x14ee15[_0x2651('0x78')]=_0x2bf848[_0x2651('0x29')][_0x2651('0x78')];delete _0x14ee15[_0x2651('0x79')];}return _0x14ee15;});})[_0x2651('0x10')](function(_0x2e0bf1){return db['User'][_0x2651('0x74')](_0x2e0bf1,{'include':[{'model':db['VoiceMail'],'as':_0x2651('0x7a')}]});})[_0x2651('0x10')](function(_0x4371dc){if(_0x2bf848['body']['role']==='user')return _0x4371dc;if(_0x2bf848[_0x2651('0x29')][_0x2651('0x27')]!==_0x2651('0x29'))return _0x4371dc;return db[_0x2651('0x7b')][_0x2651('0x2e')]({'where':{'name':_0x4371dc[_0x2651('0x27')]===_0x2651('0x2a')?_0x2651('0x7c'):_0x2651('0x2b'),'userProfileId':_0x2bf848[_0x2651('0x29')][_0x2651('0x79')]},'raw':!![]})[_0x2651('0x10')](function(_0x390d4a){if(!_0x390d4a||_0x390d4a['autoAssociation']!=0x0)return _0x4371dc;return db[_0x2651('0x30')][_0x2651('0x74')]({'name':_0x4371dc[_0x2651('0x2f')],'resourceId':_0x4371dc['id'],'type':_0x390d4a['name'],'sectionId':_0x390d4a['id']},{})[_0x2651('0x10')](function(){return _0x4371dc;});})[_0x2651('0x19')](function(_0x87bca0){logger[_0x2651('0x16')](_0x2651('0x7d'),_0x87bca0);throw _0x87bca0;});})[_0x2651('0x10')](respondWithResult(_0x579b7a,0xc9))[_0x2651('0x19')](handleError(_0x579b7a,null));};exports[_0x2651('0x7e')]=function(_0x5acf9d,_0x3ca4f9){var _0x232229=_0x5acf9d[_0x2651('0x56')];var _0x3ba280=[];if(_0x5acf9d[_0x2651('0x29')][_0x2651('0x27')]===_0x2651('0x2a'))throw new Error(_0x2651('0x7f'));if(_[_0x2651('0x80')](_0x232229,[_0x2651('0x27'),'user'])&&_0x5acf9d[_0x2651('0x29')][_0x2651('0x27')]!==_0x2651('0x28')){throw new Error(_0x2651('0x75'));}if(_['some'](_0x232229,[_0x2651('0x27'),_0x2651('0x28')])&&_0x5acf9d['user']['role']!=='admin'){throw new Error(_0x2651('0x81'));}return licenseUtil['checkUserLimits'](_0x232229)[_0x2651('0x10')](function(){return validateUser(_0x232229[0x0]);})[_0x2651('0x10')](function(){for(var _0x2e112f=0x1;_0x2e112f<_0x232229['length'];_0x2e112f++){var _0x2196a4=_0x232229[_0x2e112f-0x1][_0x2651('0x5e')];if(!_0x232229[_0x2e112f][_0x2651('0x5e')])_0x232229[_0x2e112f][_0x2651('0x5e')]=_0x2196a4+0x1;_0x3ba280['push'](validateUser(_0x232229[_0x2e112f]));}return Promise['all'](_0x3ba280);})[_0x2651('0x10')](function(){_0x3ba280=[];for(var _0x39e00a=0x0;_0x39e00a<_0x232229[_0x2651('0x53')];_0x39e00a++){_0x3ba280[_0x2651('0x43')](updateUser(_0x232229[_0x39e00a]));}return Promise[_0x2651('0x82')](_0x3ba280);})[_0x2651('0x10')](function(){_0x3ba280=_0x232229[_0x2651('0x2c')](function(_0x31a80a){return db['User']['create'](_0x31a80a,{'include':[{'model':db[_0x2651('0x7a')],'as':'VoiceMail'}]})[_0x2651('0x10')](function(_0x3e1cd7){_0x31a80a['id']=_0x3e1cd7['id'];return _0x31a80a;});});return Promise[_0x2651('0x82')](_0x3ba280);})[_0x2651('0x10')](function(_0xfb89b1){if(_0x5acf9d[_0x2651('0x56')][_0x2651('0x27')]===_0x2651('0x29'))return _0xfb89b1;if(_0x5acf9d[_0x2651('0x29')][_0x2651('0x27')]!=='user')return _0xfb89b1;var _0x19c41f=_[_0x2651('0x80')](_0xfb89b1,function(_0x5aa8ef){return _0x5aa8ef[_0x2651('0x27')]===_0x2651('0x2a')||_0x5aa8ef[_0x2651('0x27')]===_0x2651('0x83');});if(!_0x19c41f)return _0xfb89b1;return db[_0x2651('0x7b')][_0x2651('0x44')]({'where':{'name':{'$or':['Agents',_0x2651('0x2b')]},'userProfileId':_0x5acf9d[_0x2651('0x29')][_0x2651('0x79')]},'raw':!![]})[_0x2651('0x10')](function(_0x33141a){if(_[_0x2651('0x84')](_0x33141a)||!_[_0x2651('0x80')](_0x33141a,[_0x2651('0x85'),0x0]))return _0xfb89b1;_0x3ba280=[];var _0x19a2e4=_(_0x33141a)[_0x2651('0x2c')](function(_0x2c7541){if(_0x2c7541[_0x2651('0x85')]===0x1)return;return _0x2c7541[_0x2651('0x2f')]===_0x2651('0x7c')?_0x2651('0x2a'):'telephone';})[_0x2651('0x86')]()[_0x2651('0x2d')]();for(var _0x1eaa92=0x0;_0x1eaa92<_0xfb89b1[_0x2651('0x53')];_0x1eaa92++){if(!_[_0x2651('0x38')](_0x19a2e4,_0xfb89b1[_0x1eaa92]['role']))return;var _0x4bebaf=_0xfb89b1[_0x1eaa92][_0x2651('0x27')]===_0x2651('0x2a')?'Agents':_0x2651('0x2b');_0x3ba280[_0x2651('0x43')](db[_0x2651('0x30')][_0x2651('0x74')]({'name':_0xfb89b1[_0x1eaa92][_0x2651('0x2f')],'resourceId':_0xfb89b1[_0x1eaa92]['id'],'type':_0x4bebaf,'sectionId':_[_0x2651('0x2e')](_0x33141a,['name',_0x4bebaf])['id']},{}));}return Promise[_0x2651('0x82')](_0x3ba280);});})['then'](respondWithResult(_0x3ca4f9,0xc9))[_0x2651('0x19')](handleError(_0x3ca4f9,null));};exports[_0x2651('0x87')]=function(_0x3e64a1,_0x353d4c){if(_0x3e64a1[_0x2651('0x56')]['id']){delete _0x3e64a1[_0x2651('0x56')]['id'];}return db[_0x2651('0x34')][_0x2651('0x2e')]({'where':{'id':_0x3e64a1[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](function(_0x18789b){if(!_0x18789b)return null;if(_0x18789b['id']===_0x3e64a1[_0x2651('0x29')]['id']){if(!_0x3e64a1[_0x2651('0x56')]['oldPassword']||!_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')]){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x18789b['authenticate'](_0x3e64a1[_0x2651('0x56')][_0x2651('0x8b')])){throw new db['Sequelize'][(_0x2651('0x8a'))](_0x2651('0x8c'));}if(_0x3e64a1[_0x2651('0x56')][_0x2651('0x8b')]===_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')]){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))](_0x2651('0x8d'));}}else if(_0x3e64a1[_0x2651('0x29')]['role']===_0x2651('0x28')){if(!_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')]){throw new db['Sequelize'][(_0x2651('0x8a'))](_0x2651('0x8e'));}}else if(_0x3e64a1[_0x2651('0x29')][_0x2651('0x27')]===_0x2651('0x29')){if(!_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')]){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))](_0x2651('0x8e'));}if(_0x18789b['role']!=='agent'){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))](_0x2651('0x7f'));}}else{throw new db[(_0x2651('0x89'))]['ValidationError'](_0x2651('0x7f'));}return _0x18789b;})['then'](handleEntityNotFound(_0x353d4c,null))[_0x2651('0x10')](function(_0x3d9801){return db[_0x2651('0x5b')]['findOne']({'attributes':['id',_0x2651('0x8f'),_0x2651('0x90'),'passwordHistoryLimit']})['then'](function(_0x4f91dd){if(_0x4f91dd[_0x2651('0x8f')])authService[_0x2651('0x5c')](_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')]);if(!_0x4f91dd[_0x2651('0x90')]||!_0x3d9801[_0x2651('0x91')])return _0x3d9801;authService[_0x2651('0x92')](_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')],_0x3d9801[_0x2651('0x91')],_0x4f91dd['passwordHistoryLimit']);return _0x3d9801;})[_0x2651('0x10')](saveUpdates({'password':_0x3e64a1[_0x2651('0x56')]['newPassword'],'passwordResetAt':_0x3e64a1['user']['id']==_0x3e64a1['params']['id']?moment():null,'previousPasswords':authService[_0x2651('0x93')](_0x3e64a1[_0x2651('0x56')][_0x2651('0x88')],_0x3d9801[_0x2651('0x91')])},null));})[_0x2651('0x10')](respondWithResult(_0x353d4c,null))[_0x2651('0x19')](handleError(_0x353d4c,null));};exports['addQueues']=function(_0x4633d7,_0x187ba9){var _0x19dd3c=_0x4633d7[_0x2651('0x56')][_0x2651('0x94')];return db[_0x2651('0x34')][_0x2651('0x2e')]({'where':{'id':_0x4633d7[_0x2651('0x4e')]['id']},'attributes':['id',_0x2651('0x2f'),_0x2651('0x27'),_0x2651('0x95'),_0x2651('0x96'),_0x2651('0x97'),_0x2651('0x98')]})[_0x2651('0x10')](handleEntityNotFound(_0x187ba9,null))['then'](function(_0x5adc56){if(_0x5adc56){if(!utils[_0x2651('0x99')](_0x19dd3c)){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))]('Unknown\x20channel');}return _0x5adc56[_0x2651('0x9a')+_[_0x2651('0x9b')](_0x19dd3c[_0x2651('0x9c')]())+_0x2651('0x9d')](_0x4633d7[_0x2651('0x56')][_0x2651('0x59')],{'penalty':_0x4633d7['body'][_0x2651('0x9e')]||0x0})[_0x2651('0x9f')](function(_0x230bf5){for(var _0x537358=0x0;_0x537358<_0x4633d7['body'][_0x2651('0x59')][_0x2651('0x53')];_0x537358+=0x1){var _0x35020e={'UserId':Number(_0x4633d7[_0x2651('0x4e')]['id'])};_0x35020e[_[_0x2651('0x9b')](_0x19dd3c['toLowerCase']())+_0x2651('0xa0')]=Number(_0x4633d7[_0x2651('0x56')][_0x2651('0x59')][_0x537358]);socket[_0x2651('0x25')](_0x2651('0x29')+_[_0x2651('0x9b')](_0x19dd3c[_0x2651('0x9c')]())+_0x2651('0xa1'),_0x35020e);}return _0x230bf5;})[_0x2651('0x10')](function(){if(_0x19dd3c===_0x2651('0xa2')){return db['VoiceQueue']['findAll']({'where':{'id':_0x4633d7['body']['ids']||[]},'raw':!![],'attributes':['id',_0x2651('0x2f')]});}})[_0x2651('0x10')](function(_0x3c2d0b){var _0x1d39e0=_0x5adc56[_0x2651('0xa3')]({'plain':!![]});var _0x54667e=[];if(_0x19dd3c==='voice'&&_0x1d39e0['role']===_0x2651('0x2a')&&_0x1d39e0[_0x2651('0x95')]){for(let _0xfd4b9a=0x0;_0xfd4b9a<_0x3c2d0b[_0x2651('0x53')];_0xfd4b9a+=0x1){_0x54667e['push']({'membername':_0x1d39e0[_0x2651('0x2f')],'UserId':_0x1d39e0['id'],'queue_name':_0x3c2d0b[_0xfd4b9a][_0x2651('0x2f')],'VoiceQueueId':_0x3c2d0b[_0xfd4b9a]['id'],'interface':_['isNil'](_0x1d39e0[_0x2651('0x98')])?util[_0x2651('0xa4')](_0x2651('0xa5'),_0x1d39e0[_0x2651('0x2f')]):_0x1d39e0[_0x2651('0x98')],'paused':_0x1d39e0[_0x2651('0x97')]||![],'penalty':_0x4633d7[_0x2651('0x56')][_0x2651('0x9e')]||0x0});}return Promise[_0x2651('0x82')](_0x54667e[_0x2651('0x2c')](function(_0x150698){return db[_0x2651('0xa6')]['upsert'](_0x150698);}));}return _0x5adc56;});}})[_0x2651('0x10')](respondWithStatusCode(_0x187ba9,null))[_0x2651('0x19')](handleError(_0x187ba9,null));};exports[_0x2651('0xa7')]=function(_0xdeab4d,_0x6f9714){var _0x10e521,_0x1392ce;return db[_0x2651('0x34')]['find']({'where':{'id':_0xdeab4d['params']['id']},'attributes':['id','name','role']})[_0x2651('0x10')](handleEntityNotFound(_0x6f9714,null))[_0x2651('0x10')](function(_0xc783ee){if(_0xc783ee){_0x10e521=_0xc783ee;if(!_0xdeab4d['query'][_0x2651('0x94')]||!utils[_0x2651('0x99')](_0xdeab4d[_0x2651('0x3c')][_0x2651('0x94')])){throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))](_0x2651('0xa8'));}return _0xc783ee[_0x2651('0xa9')+_[_0x2651('0x9b')](_0xdeab4d[_0x2651('0x3c')]['channel'][_0x2651('0x9c')]())+_0x2651('0x9d')](_0xdeab4d['query'][_0x2651('0x59')]);}})['then'](function(_0x1486dc){if(_[_0x2651('0xaa')](_0xdeab4d['query'][_0x2651('0x59')])){for(var _0x5eb20c=0x0;_0x5eb20c<_0xdeab4d[_0x2651('0x3c')][_0x2651('0x59')][_0x2651('0x53')];_0x5eb20c+=0x1){_0x1392ce={'UserId':Number(_0xdeab4d[_0x2651('0x4e')]['id'])};_0x1392ce[_[_0x2651('0x9b')](_0xdeab4d[_0x2651('0x3c')][_0x2651('0x94')][_0x2651('0x9c')]())+_0x2651('0xa0')]=Number(_0xdeab4d['query']['ids'][_0x5eb20c]);socket[_0x2651('0x25')](_0x2651('0x29')+_[_0x2651('0x9b')](_0xdeab4d['query'][_0x2651('0x94')][_0x2651('0x9c')]())+_0x2651('0xab'),_0x1392ce);}}else{_0x1392ce={'UserId':Number(_0xdeab4d['params']['id'])};_0x1392ce[_[_0x2651('0x9b')](_0xdeab4d['query'][_0x2651('0x94')]['toLowerCase']())+'QueueId']=Number(_0xdeab4d[_0x2651('0x3c')][_0x2651('0x59')]);socket[_0x2651('0x25')](_0x2651('0x29')+_[_0x2651('0x9b')](_0xdeab4d[_0x2651('0x3c')][_0x2651('0x94')][_0x2651('0x9c')]())+_0x2651('0xab'),_0x1392ce);}return _0x1486dc;})[_0x2651('0x10')](function(){if(_0xdeab4d[_0x2651('0x3c')][_0x2651('0x94')]===_0x2651('0xa2')){return db[_0x2651('0xa6')][_0x2651('0x26')]({'where':{'UserId':_0xdeab4d[_0x2651('0x4e')]['id'],'VoiceQueueId':_0xdeab4d[_0x2651('0x3c')][_0x2651('0x59')]},'individualHooks':!![]})['then'](function(){return _0x10e521;});}return _0x10e521;})[_0x2651('0x10')](respondWithStatusCode(_0x6f9714,null))['catch'](handleError(_0x6f9714,null));};exports[_0x2651('0xac')]=function(_0x35fbce,_0x3e9762){_0x35fbce[_0x2651('0x56')][_0x2651('0xad')]=_0x35fbce[_0x2651('0xae')][_0x2651('0xaf')];return db[_0x2651('0x34')]['find']({'where':{'id':_0x35fbce['params']['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x3e9762,null))[_0x2651('0x10')](saveUpdates(_0x35fbce['body'],null))[_0x2651('0x10')](respondWithResult(_0x3e9762,null))[_0x2651('0x19')](handleError(_0x3e9762,null));};exports['getAvatar']=function(_0x566bde,_0x1b84e7){var _0x2ea8cc=path[_0x2651('0xb0')](config[_0x2651('0xb1')],_0x2651('0xb2'));return db['User'][_0x2651('0x2e')]({'where':{'id':_0x566bde['params']['id']},'attributes':['id',_0x2651('0xad')],'raw':!![]})[_0x2651('0x10')](handleEntityNotFound(_0x1b84e7,null))[_0x2651('0x10')](function(_0x107fe1){if(_0x107fe1){if(_['isNil'](_0x107fe1[_0x2651('0xad')])){return _0x1b84e7[_0x2651('0xb3')](_0x2ea8cc);}else{if(!fs[_0x2651('0xb4')](path[_0x2651('0xb0')](config[_0x2651('0xb1')],_0x2651('0xb5'),_0x107fe1[_0x2651('0xad')]))){return _0x1b84e7[_0x2651('0xb3')](_0x2ea8cc);}return _0x1b84e7[_0x2651('0xb3')](path[_0x2651('0xb0')](config[_0x2651('0xb1')],_0x2651('0xb5'),_0x107fe1['userpic']));}}})[_0x2651('0x19')](handleError(_0x1b84e7,null));};exports[_0x2651('0xb6')]=function(_0x572aca,_0x29cdf1){return db['User']['find']({'where':{'id':_0x572aca[_0x2651('0x4e')]['id']},'attributes':['id']})[_0x2651('0x10')](handleEntityNotFound(_0x29cdf1,null))[_0x2651('0x10')](function(_0x693333){var _0x258272=[];values=_0x693333[_0x2651('0x49')];_0x258272[_0x2651('0x43')](get_open_tabs('chat',_0x693333['dataValues']));_0x258272[_0x2651('0x43')](get_open_tabs(_0x2651('0x48'),_0x693333[_0x2651('0x49')]));_0x258272[_0x2651('0x43')](get_open_tabs('openchannel',_0x693333['dataValues']));_0x258272[_0x2651('0x43')](get_open_tabs(_0x2651('0x4d'),_0x693333[_0x2651('0x49')]));_0x258272['push'](get_open_tabs(_0x2651('0x4a'),_0x693333[_0x2651('0x49')]));_0x258272[_0x2651('0x43')](get_open_tabs(_0x2651('0x4b'),_0x693333[_0x2651('0x49')]));return Promise[_0x2651('0x82')](_0x258272);})['then'](function(_0x509467){if(_0x509467){var _0x1c9dfd=_[_0x2651('0x2c')](values[_0x2651('0xb7')],function(_0x23eaa5){return{'channel':_0x2651('0xb8'),'id':_0x23eaa5['id'],'createdAt':_0x23eaa5[_0x2651('0xb9')]};});var _0x498588=_[_0x2651('0x2c')](values[_0x2651('0xba')],function(_0x410701){return{'channel':_0x2651('0xbb'),'id':_0x410701['id'],'createdAt':_0x410701['createdAt']};});var _0x69d25e=_[_0x2651('0x2c')](values[_0x2651('0xbc')],function(_0x588deb){return{'channel':'OPENCHANNEL','id':_0x588deb['id'],'createdAt':_0x588deb['createdAt']};});var _0x18a544=_['map'](values['MailOpenTabs'],function(_0x3a10f8){return{'channel':_0x2651('0xbd'),'id':_0x3a10f8['id'],'createdAt':_0x3a10f8[_0x2651('0xb9')]};});var _0x1feea0=_[_0x2651('0x2c')](values[_0x2651('0xbe')],function(_0x1b4c01){return{'channel':_0x2651('0xbf'),'id':_0x1b4c01['id'],'createdAt':_0x1b4c01[_0x2651('0xb9')]};});var _0x51e488=_['map'](values[_0x2651('0xc0')],function(_0x2af043){return{'channel':_0x2651('0xc1'),'id':_0x2af043['id'],'createdAt':_0x2af043[_0x2651('0xb9')]};});var _0x59d17c=_[_0x2651('0xc2')](_0x1c9dfd,_0x498588,_0x69d25e,_0x18a544,_0x1feea0,_0x51e488);var _0x2a4ca0={'count':_0x59d17c['length'],'rows':_0x59d17c};return _0x2a4ca0;}else return null;})['then'](respondWithResult(_0x29cdf1,null))[_0x2651('0x19')](handleError(_0x29cdf1,null));};exports[_0x2651('0xc3')]=function(_0x57ff7a,_0x1457ee){var _0x2076e7={};var _0x219282={};var _0x5a09cd;var _0x362608;return db[_0x2651('0x34')]['findOne']({'where':{'id':_0x57ff7a['params']['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x1457ee,null))['then'](function(_0x15fe3a){if(_0x15fe3a){_0x5a09cd=_0x15fe3a;_0x219282[_0x2651('0x4f')]=_['keys'](db[_0x2651('0xc4')]['rawAttributes']);_0x219282[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x57ff7a[_0x2651('0x3c')]);_0x219282['filters']=_[_0x2651('0x51')](_0x219282['model'],_0x219282[_0x2651('0x3c')]);_0x2076e7['attributes']=_[_0x2651('0x51')](_0x219282[_0x2651('0x4f')],qs[_0x2651('0x52')](_0x57ff7a[_0x2651('0x3c')][_0x2651('0x52')]));_0x2076e7[_0x2651('0x42')]=_0x2076e7[_0x2651('0x42')][_0x2651('0x53')]?_0x2076e7[_0x2651('0x42')]:_0x219282[_0x2651('0x4f')];_0x2076e7[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x57ff7a[_0x2651('0x3c')][_0x2651('0xc6')]);_0x2076e7[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x57ff7a['query'],_0x219282['filters']));if(_0x57ff7a[_0x2651('0x3c')][_0x2651('0x37')]){_0x2076e7['where']=_[_0x2651('0x54')](_0x2076e7['where'],{'$or':_['map'](_0x2076e7[_0x2651('0x42')],function(_0x38246b){var _0x37c420={};_0x37c420[_0x38246b]={'$like':'%'+_0x57ff7a[_0x2651('0x3c')][_0x2651('0x37')]+'%'};return _0x37c420;})});}_0x2076e7=_[_0x2651('0x54')]({},_0x2076e7,_0x57ff7a[_0x2651('0x55')]);return _0x5a09cd[_0x2651('0xc3')](_0x2076e7);}})['then'](function(_0x5ef4c6){if(_0x5ef4c6){_0x362608=_0x5ef4c6[_0x2651('0x53')];if(_0x57ff7a[_0x2651('0x3c')][_0x2651('0xca')](_0x2651('0x3d'))){_0x2076e7['include']=[{'model':db[_0x2651('0xcb')],'as':_0x2651('0xcc'),'required':![]},{'model':db[_0x2651('0xcd')],'as':_0x2651('0xce'),'attributes':['id',_0x2651('0x2f'),_0x2651('0xcf')],'where':_0x57ff7a['query']['tag']?{'id':_0x57ff7a[_0x2651('0x3c')][_0x2651('0xd0')]}:undefined,'required':_0x57ff7a[_0x2651('0x3c')][_0x2651('0xd0')]?!![]:![]}];}if(!_0x57ff7a[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0x2076e7[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x57ff7a[_0x2651('0x3c')][_0x2651('0x21')]);_0x2076e7['offset']=qs[_0x2651('0x1e')](_0x57ff7a[_0x2651('0x3c')]['offset']);}return _0x5a09cd[_0x2651('0xc3')](_0x2076e7);}})[_0x2651('0x10')](function(_0x30aa3c){if(_0x30aa3c){return _0x30aa3c?{'count':_0x362608,'rows':_0x30aa3c}:null;}})[_0x2651('0x10')](respondWithResult(_0x1457ee,null))[_0x2651('0x19')](handleError(_0x1457ee,null));};exports[_0x2651('0xd1')]=function(_0x47b340,_0x857e48){var _0x432ba1;var _0xab74f4={};var _0x1386b8;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x47b340[_0x2651('0x4e')]['id']},'attributes':['id',_0x2651('0x2f'),_0x2651('0x27')]})[_0x2651('0x10')](handleEntityNotFound(_0x857e48,null))['then'](function(_0x28b906){if(!utils[_0x2651('0x99')](_0x47b340[_0x2651('0x3c')][_0x2651('0x94')])){throw new db['Sequelize'][(_0x2651('0x8a'))](_0x2651('0xa8'));}_0x432ba1=_0x28b906;var _0x4b91b6={};_0x4b91b6['model']=_[_0x2651('0x50')](db[_[_0x2651('0x9b')](_0x47b340[_0x2651('0x3c')][_0x2651('0x94')])+'Queue']['rawAttributes']);_0x4b91b6['query']=_[_0x2651('0x50')](_0x47b340[_0x2651('0x3c')]);_0x4b91b6['filters']=_[_0x2651('0x51')](_0x4b91b6[_0x2651('0x4f')],_0x4b91b6[_0x2651('0x3c')]);_0xab74f4[_0x2651('0x42')]=_['intersection'](_0x4b91b6[_0x2651('0x4f')],qs[_0x2651('0x52')](_0x47b340[_0x2651('0x3c')][_0x2651('0x52')]));_0xab74f4[_0x2651('0x42')]=_0xab74f4[_0x2651('0x42')][_0x2651('0x53')]?_0xab74f4[_0x2651('0x42')]:_0x4b91b6[_0x2651('0x4f')];_0xab74f4[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x47b340[_0x2651('0x3c')][_0x2651('0xc6')]);_0xab74f4[_0x2651('0xc7')]=qs['filters'](_[_0x2651('0xc9')](_0x47b340[_0x2651('0x3c')],_0x4b91b6[_0x2651('0xc8')]));if(_0x47b340['query'][_0x2651('0x37')]){_0xab74f4[_0x2651('0xc7')]=_[_0x2651('0x54')](_0xab74f4[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0xab74f4[_0x2651('0x42')],function(_0x2e60af){var _0x545db7={};_0x545db7[_0x2e60af]={'$like':'%'+_0x47b340['query'][_0x2651('0x37')]+'%'};return _0x545db7;})});}_0xab74f4=_[_0x2651('0x54')]({},_0xab74f4,_0x47b340[_0x2651('0x55')]);switch(_0x432ba1['role']){case _0x2651('0x28'):return db[_[_0x2651('0x9b')](_0x47b340[_0x2651('0x3c')][_0x2651('0x94')])+_0x2651('0xd3')][_0x2651('0x44')](_0xab74f4);case _0x2651('0x29'):case _0x2651('0x2a'):return _0x432ba1['get'+_[_0x2651('0x9b')](_0x47b340[_0x2651('0x3c')][_0x2651('0x94')])+_0x2651('0x9d')](_0xab74f4);default:throw new db['Sequelize'][(_0x2651('0x8a'))](_0x2651('0xd4'));}})[_0x2651('0x10')](function(_0x105487){_0x1386b8=_0x105487[_0x2651('0x53')];if(!_0x47b340[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0xab74f4[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x47b340[_0x2651('0x3c')][_0x2651('0x21')]);_0xab74f4[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x47b340[_0x2651('0x3c')][_0x2651('0x1e')]);}switch(_0x432ba1['role']){case _0x2651('0x28'):return db[_[_0x2651('0x9b')](_0x47b340[_0x2651('0x3c')][_0x2651('0x94')])+'Queue'][_0x2651('0x44')](_0xab74f4);case'user':case _0x2651('0x2a'):return _0x432ba1[_0x2651('0xa3')+_['capitalize'](_0x47b340['query'][_0x2651('0x94')])+_0x2651('0x9d')](_0xab74f4);}})[_0x2651('0x10')](function(_0x5ee172){return{'count':_0x1386b8,'rows':_0x5ee172};})[_0x2651('0x10')](respondWithResult(_0x857e48,null))[_0x2651('0x19')](handleError(_0x857e48,null));};exports[_0x2651('0xd5')]=function(_0x1184cd,_0x2b3f09){var _0x1b4ecf={};var _0x45523f={};var _0x2cb0eb;var _0x1f2512;return db['User'][_0x2651('0xd2')]({'where':{'id':_0x1184cd[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x2b3f09,null))[_0x2651('0x10')](function(_0x480c2b){if(_0x480c2b){_0x2cb0eb=_0x480c2b;_0x45523f[_0x2651('0x4f')]=_['keys'](db[_0x2651('0xa6')][_0x2651('0xd6')]);_0x45523f['query']=_['keys'](_0x1184cd['query']);_0x45523f[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x45523f[_0x2651('0x4f')],_0x45523f[_0x2651('0x3c')]);_0x1b4ecf[_0x2651('0x42')]=_[_0x2651('0x51')](_0x45523f[_0x2651('0x4f')],qs[_0x2651('0x52')](_0x1184cd[_0x2651('0x3c')][_0x2651('0x52')]));_0x1b4ecf[_0x2651('0x42')]=_0x1b4ecf[_0x2651('0x42')][_0x2651('0x53')]?_0x1b4ecf[_0x2651('0x42')]:_0x45523f[_0x2651('0x4f')];_0x1b4ecf[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x1184cd[_0x2651('0x3c')]['sort']);_0x1b4ecf[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_['pick'](_0x1184cd[_0x2651('0x3c')],_0x45523f[_0x2651('0xc8')]));if(_0x1184cd[_0x2651('0x3c')]['filter']){_0x1b4ecf['where']=_[_0x2651('0x54')](_0x1b4ecf[_0x2651('0xc7')],{'$or':_['map'](_0x1b4ecf[_0x2651('0x42')],function(_0x3b82ba){var _0x33477b={};_0x33477b[_0x3b82ba]={'$like':'%'+_0x1184cd[_0x2651('0x3c')][_0x2651('0x37')]+'%'};return _0x33477b;})});}_0x1b4ecf=_[_0x2651('0x54')]({},_0x1b4ecf,_0x1184cd[_0x2651('0x55')]);return _0x2cb0eb[_0x2651('0xd5')](_0x1b4ecf);}})[_0x2651('0x10')](function(_0x42db62){if(_0x42db62){_0x1f2512=_0x42db62[_0x2651('0x53')];if(!_0x1184cd[_0x2651('0x3c')]['hasOwnProperty'](_0x2651('0xd7'))){_0x1b4ecf[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x1184cd[_0x2651('0x3c')][_0x2651('0x21')]);_0x1b4ecf[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x1184cd[_0x2651('0x3c')][_0x2651('0x1e')]);}return _0x2cb0eb[_0x2651('0xd5')](_0x1b4ecf);}})['then'](function(_0x5a175a){if(_0x5a175a){return _0x5a175a?{'count':_0x1f2512,'rows':_0x5a175a}:null;}})['then'](respondWithResult(_0x2b3f09,null))['catch'](handleError(_0x2b3f09,null));};exports[_0x2651('0xd8')]=function(_0x1d9c03,_0x343486){var _0xe32756={};var _0x2b799d={};var _0x5dd275;var _0x57601e;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x1d9c03[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x343486,null))[_0x2651('0x10')](function(_0x2d9f98){if(_0x2d9f98){_0x5dd275=_0x2d9f98;_0x2b799d[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0xd9')][_0x2651('0xd6')]);_0x2b799d[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x1d9c03['query']);_0x2b799d[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x2b799d[_0x2651('0x4f')],_0x2b799d[_0x2651('0x3c')]);_0xe32756['attributes']=_[_0x2651('0x51')](_0x2b799d['model'],qs[_0x2651('0x52')](_0x1d9c03[_0x2651('0x3c')][_0x2651('0x52')]));_0xe32756['attributes']=_0xe32756[_0x2651('0x42')]['length']?_0xe32756[_0x2651('0x42')]:_0x2b799d['model'];_0xe32756['order']=qs[_0x2651('0xc6')](_0x1d9c03[_0x2651('0x3c')][_0x2651('0xc6')]);_0xe32756['where']=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x1d9c03['query'],_0x2b799d['filters']));if(_0x1d9c03[_0x2651('0x3c')]['filter']){_0xe32756[_0x2651('0xc7')]=_[_0x2651('0x54')](_0xe32756[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0xe32756['attributes'],function(_0x2a790d){var _0x10eb3f={};_0x10eb3f[_0x2a790d]={'$like':'%'+_0x1d9c03[_0x2651('0x3c')]['filter']+'%'};return _0x10eb3f;})});}_0xe32756=_[_0x2651('0x54')]({},_0xe32756,_0x1d9c03[_0x2651('0x55')]);return _0x5dd275[_0x2651('0xd8')](_0xe32756);}})[_0x2651('0x10')](function(_0x3343e1){if(_0x3343e1){_0x57601e=_0x3343e1[_0x2651('0x53')];if(!_0x1d9c03[_0x2651('0x3c')]['hasOwnProperty']('nolimit')){_0xe32756[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x1d9c03[_0x2651('0x3c')][_0x2651('0x21')]);_0xe32756[_0x2651('0x1e')]=qs['offset'](_0x1d9c03[_0x2651('0x3c')][_0x2651('0x1e')]);}return _0x5dd275[_0x2651('0xd8')](_0xe32756);}})[_0x2651('0x10')](function(_0x28eef3){if(_0x28eef3){return _0x28eef3?{'count':_0x57601e,'rows':_0x28eef3}:null;}})[_0x2651('0x10')](respondWithResult(_0x343486,null))[_0x2651('0x19')](handleError(_0x343486,null));};exports[_0x2651('0xda')]=function(_0x48ab77,_0x416ae9){var _0x5ed5d6={'raw':!![],'where':{}};var _0x2b53ec={};var _0x2ed1b2={'count':0x0,'rows':[]};return db[_0x2651('0x34')]['findOne']({'where':{'id':_0x48ab77[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x416ae9,null))[_0x2651('0x10')](function(_0x36e976){if(_0x36e976){_0x2b53ec[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0xdb')]['rawAttributes']);_0x2b53ec[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x48ab77[_0x2651('0x3c')]);_0x2b53ec[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x2b53ec[_0x2651('0x4f')],_0x2b53ec[_0x2651('0x3c')]);_0x5ed5d6[_0x2651('0x42')]=_['intersection'](_0x2b53ec[_0x2651('0x4f')],qs['fields'](_0x48ab77[_0x2651('0x3c')][_0x2651('0x52')]));_0x5ed5d6[_0x2651('0x42')]=_0x5ed5d6['attributes']['length']?_0x5ed5d6['attributes']:_0x2b53ec[_0x2651('0x4f')];if(!_0x48ab77[_0x2651('0x3c')][_0x2651('0xca')](_0x2651('0xd7'))){_0x5ed5d6[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x48ab77[_0x2651('0x3c')][_0x2651('0x21')]);_0x5ed5d6[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x48ab77[_0x2651('0x3c')][_0x2651('0x1e')]);}_0x5ed5d6[_0x2651('0xc5')]=qs['sort'](_0x48ab77['query']['sort']);_0x5ed5d6[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x48ab77[_0x2651('0x3c')],_0x2b53ec[_0x2651('0xc8')]));_0x5ed5d6[_0x2651('0xc7')]['UserId']=_0x36e976['id'];if(_0x48ab77['query'][_0x2651('0x37')]){_0x5ed5d6[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x5ed5d6[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0x5ed5d6['attributes'],function(_0x5ae3b8){var _0x43d35e={};_0x43d35e[_0x5ae3b8]={'$like':'%'+_0x48ab77[_0x2651('0x3c')]['filter']+'%'};return _0x43d35e;})});}_0x5ed5d6=_[_0x2651('0x54')]({},_0x5ed5d6,_0x48ab77[_0x2651('0x55')]);return db['VoiceRecording'][_0x2651('0x20')]({'where':_0x5ed5d6[_0x2651('0xc7')]})[_0x2651('0x10')](function(_0x1a21f9){_0x2ed1b2[_0x2651('0x20')]=_0x1a21f9;if(_0x48ab77['query'][_0x2651('0x3d')]){_0x5ed5d6[_0x2651('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x2651('0x44')](_0x5ed5d6);})[_0x2651('0x10')](function(_0x336eff){_0x2ed1b2['rows']=_0x336eff;return _0x2ed1b2;});}})['then'](respondWithFilteredResult(_0x416ae9,_0x5ed5d6))[_0x2651('0x19')](handleError(_0x416ae9,null));};exports[_0x2651('0xdc')]=function(_0x4b432a,_0x11fafe){var _0x1b982b={'raw':!![],'where':{}};var _0x787cb5={};var _0x102b82={'count':0x0,'rows':[]};return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x4b432a[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x11fafe,null))[_0x2651('0x10')](function(_0x166439){if(_0x166439){_0x787cb5[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0xdd')]['rawAttributes']);_0x787cb5[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x4b432a['query']);_0x787cb5['filters']=_[_0x2651('0x51')](_0x787cb5['model'],_0x787cb5['query']);_0x1b982b[_0x2651('0x42')]=_[_0x2651('0x51')](_0x787cb5[_0x2651('0x4f')],qs['fields'](_0x4b432a[_0x2651('0x3c')][_0x2651('0x52')]));_0x1b982b[_0x2651('0x42')]=_0x1b982b[_0x2651('0x42')][_0x2651('0x53')]?_0x1b982b[_0x2651('0x42')]:_0x787cb5[_0x2651('0x4f')];if(!_0x4b432a[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0x1b982b['limit']=qs['limit'](_0x4b432a[_0x2651('0x3c')][_0x2651('0x21')]);_0x1b982b[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x4b432a['query'][_0x2651('0x1e')]);}_0x1b982b['order']=qs[_0x2651('0xc6')](_0x4b432a[_0x2651('0x3c')]['sort']);_0x1b982b[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_['pick'](_0x4b432a[_0x2651('0x3c')],_0x787cb5[_0x2651('0xc8')]));_0x1b982b[_0x2651('0xc7')][_0x2651('0xde')]=_0x166439['id'];if(_0x4b432a['query'][_0x2651('0x37')]){_0x1b982b[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x1b982b[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0x1b982b[_0x2651('0x42')],function(_0x1238e4){var _0x522ec1={};_0x522ec1[_0x1238e4]={'$like':'%'+_0x4b432a[_0x2651('0x3c')][_0x2651('0x37')]+'%'};return _0x522ec1;})});}_0x1b982b=_[_0x2651('0x54')]({},_0x1b982b,_0x4b432a[_0x2651('0x55')]);return db[_0x2651('0xdd')][_0x2651('0x20')]({'where':_0x1b982b['where']})['then'](function(_0x21f404){_0x102b82['count']=_0x21f404;if(_0x4b432a[_0x2651('0x3c')]['includeAll']){_0x1b982b[_0x2651('0x40')]=[{'all':!![]}];}return db[_0x2651('0xdd')][_0x2651('0x44')](_0x1b982b);})[_0x2651('0x10')](function(_0x41cad2){_0x102b82['rows']=_0x41cad2;return _0x102b82;});}})[_0x2651('0x10')](respondWithFilteredResult(_0x11fafe,_0x1b982b))[_0x2651('0x19')](handleError(_0x11fafe,null));};exports[_0x2651('0xdf')]=function(_0x50037a,_0x11ba84){var _0x9c60d6={};var _0x2f85fe={};var _0x352f59;var _0x267270;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x50037a[_0x2651('0x4e')]['id']}})['then'](handleEntityNotFound(_0x11ba84,null))[_0x2651('0x10')](function(_0x5266ef){if(_0x5266ef){_0x352f59=_0x5266ef;_0x2f85fe[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0xe0')]['rawAttributes']);_0x2f85fe[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x50037a[_0x2651('0x3c')]);_0x2f85fe[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x2f85fe['model'],_0x2f85fe[_0x2651('0x3c')]);_0x9c60d6[_0x2651('0x42')]=_[_0x2651('0x51')](_0x2f85fe[_0x2651('0x4f')],qs['fields'](_0x50037a[_0x2651('0x3c')][_0x2651('0x52')]));_0x9c60d6[_0x2651('0x42')]=_0x9c60d6[_0x2651('0x42')]['length']?_0x9c60d6[_0x2651('0x42')]:_0x2f85fe['model'];_0x9c60d6['order']=qs[_0x2651('0xc6')](_0x50037a[_0x2651('0x3c')][_0x2651('0xc6')]);_0x9c60d6[_0x2651('0xc7')]=qs['filters'](_[_0x2651('0xc9')](_0x50037a['query'],_0x2f85fe[_0x2651('0xc8')]));if(_0x50037a[_0x2651('0x3c')][_0x2651('0x37')]){_0x9c60d6[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x9c60d6['where'],{'$or':_[_0x2651('0x2c')](_0x9c60d6[_0x2651('0x42')],function(_0xc900e0){var _0x44236b={};_0x44236b[_0xc900e0]={'$like':'%'+_0x50037a['query'][_0x2651('0x37')]+'%'};return _0x44236b;})});}_0x9c60d6=_['merge']({},_0x9c60d6,_0x50037a[_0x2651('0x55')]);return _0x352f59['getChatInteractions'](_0x9c60d6);}})['then'](function(_0x8726a8){if(_0x8726a8){_0x267270=_0x8726a8['length'];if(!_0x50037a[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0x9c60d6[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x50037a['query']['limit']);_0x9c60d6['offset']=qs[_0x2651('0x1e')](_0x50037a[_0x2651('0x3c')][_0x2651('0x1e')]);}return _0x352f59[_0x2651('0xdf')](_0x9c60d6);}})[_0x2651('0x10')](function(_0x2bec8d){if(_0x2bec8d){return _0x2bec8d?{'count':_0x267270,'rows':_0x2bec8d}:null;}})['then'](respondWithResult(_0x11ba84,null))['catch'](handleError(_0x11ba84,null));};exports[_0x2651('0xe1')]=function(_0x4264cd,_0x1b45cb){var _0x4cd473={};var _0x385c99={};var _0x4a71fb;var _0x1c6f1c;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x4264cd[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x1b45cb,null))[_0x2651('0x10')](function(_0x5e094e){if(_0x5e094e){_0x4a71fb=_0x5e094e;_0x385c99[_0x2651('0x4f')]=_['keys'](db[_0x2651('0xe2')]['rawAttributes']);_0x385c99[_0x2651('0x3c')]=_['keys'](_0x4264cd[_0x2651('0x3c')]);_0x385c99[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x385c99[_0x2651('0x4f')],_0x385c99[_0x2651('0x3c')]);_0x4cd473[_0x2651('0x42')]=_[_0x2651('0x51')](_0x385c99[_0x2651('0x4f')],qs['fields'](_0x4264cd[_0x2651('0x3c')]['fields']));_0x4cd473['attributes']=_0x4cd473['attributes'][_0x2651('0x53')]?_0x4cd473[_0x2651('0x42')]:_0x385c99['model'];_0x4cd473[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x4264cd[_0x2651('0x3c')][_0x2651('0xc6')]);_0x4cd473['where']=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x4264cd['query'],_0x385c99[_0x2651('0xc8')]));if(_0x4264cd[_0x2651('0x3c')][_0x2651('0x37')]){_0x4cd473[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x4cd473[_0x2651('0xc7')],{'$or':_['map'](_0x4cd473[_0x2651('0x42')],function(_0x58763e){var _0xdea186={};_0xdea186[_0x58763e]={'$like':'%'+_0x4264cd['query']['filter']+'%'};return _0xdea186;})});}_0x4cd473=_[_0x2651('0x54')]({},_0x4cd473,_0x4264cd[_0x2651('0x55')]);return _0x4a71fb[_0x2651('0xe1')](_0x4cd473);}})[_0x2651('0x10')](function(_0x4bca68){if(_0x4bca68){_0x1c6f1c=_0x4bca68[_0x2651('0x53')];if(!_0x4264cd['query'][_0x2651('0xca')](_0x2651('0xd7'))){_0x4cd473[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x4264cd[_0x2651('0x3c')][_0x2651('0x21')]);_0x4cd473[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x4264cd['query'][_0x2651('0x1e')]);}return _0x4a71fb[_0x2651('0xe1')](_0x4cd473);}})[_0x2651('0x10')](function(_0xfd225d){if(_0xfd225d){return _0xfd225d?{'count':_0x1c6f1c,'rows':_0xfd225d}:null;}})[_0x2651('0x10')](respondWithResult(_0x1b45cb,null))[_0x2651('0x19')](handleError(_0x1b45cb,null));};exports[_0x2651('0xe3')]=function(_0xb27669,_0x5384d6){var _0x2948dd={'raw':!![],'where':{}};var _0x1f9e55={};var _0x10e67a={'count':0x0,'rows':[]};return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0xb27669[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x5384d6,null))['then'](function(_0x1b89cf){if(_0x1b89cf){_0x1f9e55['model']=_[_0x2651('0x50')](db[_0x2651('0xe4')]['rawAttributes']);_0x1f9e55['query']=_[_0x2651('0x50')](_0xb27669[_0x2651('0x3c')]);_0x1f9e55['filters']=_[_0x2651('0x51')](_0x1f9e55[_0x2651('0x4f')],_0x1f9e55[_0x2651('0x3c')]);_0x2948dd[_0x2651('0x42')]=_[_0x2651('0x51')](_0x1f9e55[_0x2651('0x4f')],qs['fields'](_0xb27669[_0x2651('0x3c')][_0x2651('0x52')]));_0x2948dd[_0x2651('0x42')]=_0x2948dd[_0x2651('0x42')][_0x2651('0x53')]?_0x2948dd[_0x2651('0x42')]:_0x1f9e55['model'];if(!_0xb27669[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0x2948dd[_0x2651('0x21')]=qs[_0x2651('0x21')](_0xb27669['query'][_0x2651('0x21')]);_0x2948dd['offset']=qs[_0x2651('0x1e')](_0xb27669[_0x2651('0x3c')][_0x2651('0x1e')]);}_0x2948dd[_0x2651('0xc5')]=qs['sort'](_0xb27669[_0x2651('0x3c')][_0x2651('0xc6')]);_0x2948dd['where']=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0xb27669['query'],_0x1f9e55[_0x2651('0xc8')]));_0x2948dd[_0x2651('0xc7')][_0x2651('0xde')]=_0x1b89cf['id'];if(_0xb27669[_0x2651('0x3c')][_0x2651('0x37')]){_0x2948dd[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x2948dd[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0x2948dd[_0x2651('0x42')],function(_0x2d7eb9){var _0x6c4025={};_0x6c4025[_0x2d7eb9]={'$like':'%'+_0xb27669[_0x2651('0x3c')]['filter']+'%'};return _0x6c4025;})});}_0x2948dd=_[_0x2651('0x54')]({},_0x2948dd,_0xb27669[_0x2651('0x55')]);return db[_0x2651('0xe4')][_0x2651('0x20')]({'where':_0x2948dd[_0x2651('0xc7')]})[_0x2651('0x10')](function(_0x21a6a3){_0x10e67a[_0x2651('0x20')]=_0x21a6a3;if(_0xb27669['query'][_0x2651('0x3d')]){_0x2948dd[_0x2651('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0x2651('0x44')](_0x2948dd);})[_0x2651('0x10')](function(_0x254b17){_0x10e67a[_0x2651('0x45')]=_0x254b17;return _0x10e67a;});}})[_0x2651('0x10')](respondWithFilteredResult(_0x5384d6,_0x2948dd))['catch'](handleError(_0x5384d6,null));};exports[_0x2651('0xe5')]=function(_0x5b2f24,_0x168d9d){var _0x79b4d5={};var _0x3bee89={};var _0x5a1a93;var _0x36c585;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x5b2f24['params']['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x168d9d,null))[_0x2651('0x10')](function(_0x205600){if(_0x205600){_0x5a1a93=_0x205600;_0x3bee89[_0x2651('0x4f')]=_['keys'](db['SmsInteraction'][_0x2651('0xd6')]);_0x3bee89[_0x2651('0x3c')]=_['keys'](_0x5b2f24[_0x2651('0x3c')]);_0x3bee89[_0x2651('0xc8')]=_['intersection'](_0x3bee89[_0x2651('0x4f')],_0x3bee89[_0x2651('0x3c')]);_0x79b4d5[_0x2651('0x42')]=_[_0x2651('0x51')](_0x3bee89[_0x2651('0x4f')],qs['fields'](_0x5b2f24[_0x2651('0x3c')][_0x2651('0x52')]));_0x79b4d5[_0x2651('0x42')]=_0x79b4d5[_0x2651('0x42')][_0x2651('0x53')]?_0x79b4d5[_0x2651('0x42')]:_0x3bee89[_0x2651('0x4f')];_0x79b4d5[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x5b2f24[_0x2651('0x3c')][_0x2651('0xc6')]);_0x79b4d5['where']=qs['filters'](_['pick'](_0x5b2f24[_0x2651('0x3c')],_0x3bee89[_0x2651('0xc8')]));if(_0x5b2f24[_0x2651('0x3c')][_0x2651('0x37')]){_0x79b4d5[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x79b4d5[_0x2651('0xc7')],{'$or':_['map'](_0x79b4d5['attributes'],function(_0x4526e8){var _0x4b924d={};_0x4b924d[_0x4526e8]={'$like':'%'+_0x5b2f24[_0x2651('0x3c')][_0x2651('0x37')]+'%'};return _0x4b924d;})});}_0x79b4d5=_[_0x2651('0x54')]({},_0x79b4d5,_0x5b2f24[_0x2651('0x55')]);return _0x5a1a93[_0x2651('0xe5')](_0x79b4d5);}})[_0x2651('0x10')](function(_0x305109){if(_0x305109){_0x36c585=_0x305109[_0x2651('0x53')];if(!_0x5b2f24['query']['hasOwnProperty'](_0x2651('0xd7'))){_0x79b4d5['limit']=qs[_0x2651('0x21')](_0x5b2f24[_0x2651('0x3c')][_0x2651('0x21')]);_0x79b4d5[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x5b2f24[_0x2651('0x3c')][_0x2651('0x1e')]);}return _0x5a1a93[_0x2651('0xe5')](_0x79b4d5);}})['then'](function(_0x2882db){if(_0x2882db){return _0x2882db?{'count':_0x36c585,'rows':_0x2882db}:null;}})[_0x2651('0x10')](respondWithResult(_0x168d9d,null))[_0x2651('0x19')](handleError(_0x168d9d,null));};exports[_0x2651('0xe6')]=function(_0x4df6b0,_0x3b746f){var _0xba5989={};var _0x4986a0={};var _0x1e2e62;var _0x125fd8;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x4df6b0[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x3b746f,null))[_0x2651('0x10')](function(_0x56c35e){if(_0x56c35e){_0x1e2e62=_0x56c35e;_0x4986a0[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0xe7')][_0x2651('0xd6')]);_0x4986a0[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x4df6b0['query']);_0x4986a0['filters']=_[_0x2651('0x51')](_0x4986a0['model'],_0x4986a0['query']);_0xba5989[_0x2651('0x42')]=_['intersection'](_0x4986a0['model'],qs[_0x2651('0x52')](_0x4df6b0[_0x2651('0x3c')]['fields']));_0xba5989['attributes']=_0xba5989[_0x2651('0x42')]['length']?_0xba5989[_0x2651('0x42')]:_0x4986a0['model'];_0xba5989[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x4df6b0[_0x2651('0x3c')][_0x2651('0xc6')]);_0xba5989[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x4df6b0['query'],_0x4986a0[_0x2651('0xc8')]));if(_0x4df6b0[_0x2651('0x3c')][_0x2651('0x37')]){_0xba5989[_0x2651('0xc7')]=_[_0x2651('0x54')](_0xba5989[_0x2651('0xc7')],{'$or':_['map'](_0xba5989[_0x2651('0x42')],function(_0x492248){var _0x1d5178={};_0x1d5178[_0x492248]={'$like':'%'+_0x4df6b0['query'][_0x2651('0x37')]+'%'};return _0x1d5178;})});}_0xba5989=_[_0x2651('0x54')]({},_0xba5989,_0x4df6b0[_0x2651('0x55')]);return _0x1e2e62[_0x2651('0xe6')](_0xba5989);}})[_0x2651('0x10')](function(_0x577446){if(_0x577446){_0x125fd8=_0x577446[_0x2651('0x53')];if(!_0x4df6b0[_0x2651('0x3c')][_0x2651('0xca')](_0x2651('0xd7'))){_0xba5989[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x4df6b0['query']['limit']);_0xba5989[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x4df6b0['query'][_0x2651('0x1e')]);}return _0x1e2e62['getFaxInteractions'](_0xba5989);}})['then'](function(_0x5bc179){if(_0x5bc179){return _0x5bc179?{'count':_0x125fd8,'rows':_0x5bc179}:null;}})[_0x2651('0x10')](respondWithResult(_0x3b746f,null))[_0x2651('0x19')](handleError(_0x3b746f,null));};exports[_0x2651('0xe8')]=function(_0x246bd1,_0x250646){var _0x4dc5b6={};var _0x1f3a30={};var _0x3620c5;var _0x4992d2;return db['User'][_0x2651('0xd2')]({'where':{'id':_0x246bd1[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x250646,null))[_0x2651('0x10')](function(_0x2cfbeb){if(_0x2cfbeb){_0x3620c5=_0x2cfbeb;_0x1f3a30['model']=_[_0x2651('0x50')](db[_0x2651('0xe9')][_0x2651('0xd6')]);_0x1f3a30[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x246bd1[_0x2651('0x3c')]);_0x1f3a30[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x1f3a30[_0x2651('0x4f')],_0x1f3a30[_0x2651('0x3c')]);_0x4dc5b6[_0x2651('0x42')]=_[_0x2651('0x51')](_0x1f3a30[_0x2651('0x4f')],qs['fields'](_0x246bd1[_0x2651('0x3c')][_0x2651('0x52')]));_0x4dc5b6[_0x2651('0x42')]=_0x4dc5b6[_0x2651('0x42')][_0x2651('0x53')]?_0x4dc5b6[_0x2651('0x42')]:_0x1f3a30[_0x2651('0x4f')];_0x4dc5b6[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x246bd1[_0x2651('0x3c')][_0x2651('0xc6')]);_0x4dc5b6['where']=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x246bd1[_0x2651('0x3c')],_0x1f3a30[_0x2651('0xc8')]));if(_0x246bd1['query'][_0x2651('0x37')]){_0x4dc5b6[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x4dc5b6[_0x2651('0xc7')],{'$or':_['map'](_0x4dc5b6['attributes'],function(_0x5675a1){var _0x3a1b52={};_0x3a1b52[_0x5675a1]={'$like':'%'+_0x246bd1[_0x2651('0x3c')]['filter']+'%'};return _0x3a1b52;})});}_0x4dc5b6=_[_0x2651('0x54')]({},_0x4dc5b6,_0x246bd1['options']);return _0x3620c5[_0x2651('0xe8')](_0x4dc5b6);}})['then'](function(_0x7b5d54){if(_0x7b5d54){_0x4992d2=_0x7b5d54['length'];if(!_0x246bd1[_0x2651('0x3c')][_0x2651('0xca')](_0x2651('0xd7'))){_0x4dc5b6['limit']=qs[_0x2651('0x21')](_0x246bd1[_0x2651('0x3c')][_0x2651('0x21')]);_0x4dc5b6[_0x2651('0x1e')]=qs['offset'](_0x246bd1[_0x2651('0x3c')]['offset']);}return _0x3620c5[_0x2651('0xe8')](_0x4dc5b6);}})[_0x2651('0x10')](function(_0x500c17){if(_0x500c17){return _0x500c17?{'count':_0x4992d2,'rows':_0x500c17}:null;}})[_0x2651('0x10')](respondWithResult(_0x250646,null))[_0x2651('0x19')](handleError(_0x250646,null));};exports[_0x2651('0xea')]=function(_0x391168,_0x11a07b,_0x47d335){var _0xd41d59;var _0x5b092b;var _0x53a529;var _0x4627a9=!_[_0x2651('0x5f')](_0x391168[_0x2651('0x4e')]['id'])?_0x391168[_0x2651('0x4e')]['id']:!_[_0x2651('0x5f')](_0x391168['user']['id'])?_0x391168[_0x2651('0x29')]['id']:null;return db['User'][_0x2651('0x2e')]({'where':{'id':_0x4627a9,'role':{'$or':[_0x2651('0x28'),_0x2651('0x29'),_0x2651('0x2a')]}},'attributes':['id',_0x2651('0x2f'),'phone','mobile',_0x2651('0x27'),_0x2651('0x5e'),_0x2651('0x96')]})[_0x2651('0x10')](function(_0xa1e760){if(_0xa1e760){if(_0xa1e760[_0x2651('0x27')]===_0x2651('0x2a')){_0xd41d59=_0xa1e760;if(_0x391168[_0x2651('0x56')][_0x2651('0x98')]){_0x53a529=util[_0x2651('0xa4')](_0x2651('0xeb'),_0xd41d59[_0x391168[_0x2651('0x56')][_0x2651('0x98')]]);}else if(_0x391168[_0x2651('0x56')]['intrf']){_0x53a529=util[_0x2651('0xa4')](_0x2651('0xa5'),_0x391168[_0x2651('0x56')][_0x2651('0xec')]);}else{_0x53a529=util[_0x2651('0xa4')](_0x2651('0xa5'),_0xd41d59[_0x2651('0x2f')]);}socket['to'](util['format']('user:%s',_0xd41d59[_0x2651('0x2f')]))[_0x2651('0x25')](_0x2651('0xed'),{'user':{'id':_0xd41d59['id'],'name':_0xd41d59['name']},'ip':_0x391168[_0x2651('0xee')]['x-forwarded-for']||_0x391168[_0x2651('0xef')][_0x2651('0xf0')]||_0x391168[_0x2651('0xf1')][_0x2651('0xf0')]||_0x391168[_0x2651('0xef')]['socket'][_0x2651('0xf0')]});return db[_0x2651('0xa6')][_0x2651('0x26')]({'where':{'membername':_0xd41d59[_0x2651('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0x2651('0x89'))][(_0x2651('0x8a'))](_0x2651('0xf2'));}})[_0x2651('0x10')](function(){if(_0xd41d59){return _0xd41d59[_0x2651('0xf3')]({'raw':!![]});}})['then'](function(_0x2f9174){if(_0xd41d59){if(_0x2f9174){_0x5b092b=_0x2f9174;if(_0x5b092b['length']){var _0x28104b=_0x5b092b[_0x2651('0x2c')](function(_0xce0657){var _0x5d62a1={'membername':_0xd41d59[_0x2651('0x2f')],'UserId':_0xd41d59['id'],'queue_name':_0xce0657[_0x2651('0x2f')],'VoiceQueueId':_0xce0657['id'],'interface':_0x53a529,'paused':_0xd41d59[_0x2651('0x96')]||![],'penalty':_0xce0657[_0x2651('0xf4')]||0x0};return db[_0x2651('0xa6')][_0x2651('0xf5')](_0x5d62a1);});return Promise[_0x2651('0x82')](_0x28104b);}}}})[_0x2651('0x10')](function(){if(_0xd41d59){return db[_0x2651('0xf6')][_0x2651('0x44')]({'where':{'membername':_0xd41d59[_0x2651('0x2f')],'exitAt':null}});}})[_0x2651('0x10')](function(_0x18c886){if(_0xd41d59){var _0x196b11=[];_0x18c886[_0x2651('0xf7')](function(_0x19cdc0){_0x196b11[_0x2651('0x43')](_0x19cdc0['update']({'exitAt':moment()[_0x2651('0xa4')](_0x2651('0xf8'))}));});return Promise[_0x2651('0x82')](_0x196b11);}})[_0x2651('0x10')](function(){if(_0xd41d59){var _0x422eef=[];var _0x3ff537=[];var _0x1a84f2=utils['getChannels']();var _0x98dd49={'membername':_0xd41d59['name'],'interface':_0x53a529,'enterAt':moment()[_0x2651('0xa4')](_0x2651('0xf8')),'role':_0xd41d59[_0x2651('0x27')],'internal':_0xd41d59[_0x2651('0x5e')]};_0x1a84f2['forEach'](function(_0x3b9987){_0x422eef[_0x2651('0x43')](_[_0x2651('0x54')]({'channel':_0x3b9987,'type':'LOGIN','data1':_0x391168[_0x2651('0x56')][_0x2651('0xf9')],'data2':_0x53a529},_0x98dd49));if(_0xd41d59['loginInPause']){_0x3ff537['push'](_[_0x2651('0x54')]({'channel':_0x3b9987,'type':_0x2651('0xfa'),'data1':_0x2651('0xfb')},_0x98dd49));}});return db['MemberReport']['bulkCreate'](_0x422eef[_0x2651('0xc2')](_0x3ff537),{'individualHooks':!![]});}})[_0x2651('0x10')](function(){if(_0xd41d59){return _0xd41d59[_0x2651('0x24')]({'online':!![],'lastLoginAt':moment()[_0x2651('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xd41d59[_0x2651('0x96')]||![],'mailPause':_0xd41d59[_0x2651('0x96')]||![],'chatPause':_0xd41d59['loginInPause']||![],'faxPause':_0xd41d59[_0x2651('0x96')]||![],'smsPause':_0xd41d59[_0x2651('0x96')]||![],'openchannelPause':_0xd41d59[_0x2651('0x96')]||![],'whatsappPause':_0xd41d59[_0x2651('0x96')]||![],'pauseType':_0xd41d59['loginInPause']?_0x2651('0xfb'):null,'interface':_0x53a529,'lastPauseAt':moment()[_0x2651('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x3f86c4){if(_0x391168['isMiddleware']){return _0x47d335();}else{return Promise[_0x2651('0xfc')](_0x3f86c4)[_0x2651('0x10')](respondWithResult(_0x11a07b,null));}})[_0x2651('0x19')](handleError(_0x11a07b,null));};exports['logout']=function(_0xf85fee,_0x384b53){var _0x43e3b2;return db[_0x2651('0x34')][_0x2651('0x2e')]({'where':{'id':_0xf85fee[_0x2651('0x4e')]['id'],'role':_0x2651('0x2a')},'attributes':['id','name',_0x2651('0x27')]})[_0x2651('0x10')](handleEntityNotFound(_0x384b53,null))[_0x2651('0x10')](function(_0x59aa22){if(_0x59aa22){_0x43e3b2=_0x59aa22;return db[_0x2651('0xa6')][_0x2651('0x26')]({'where':{'membername':_0x43e3b2[_0x2651('0x2f')]},'individualHooks':!![]});}})[_0x2651('0x10')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x43e3b2[_0x2651('0x2f')],'exitAt':null}});})[_0x2651('0x10')](function(_0x585f97){var _0x177b90=[];_0x585f97[_0x2651('0xf7')](function(_0x53861f){_0x177b90[_0x2651('0x43')](_0x53861f[_0x2651('0x24')]({'exitAt':moment()['format'](_0x2651('0xf8'))}));});return Promise[_0x2651('0x82')](_0x177b90);})[_0x2651('0x10')](function(){return _0x43e3b2[_0x2651('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2651('0x10')](respondWithResult(_0x384b53,null))[_0x2651('0x19')](handleError(_0x384b53,null));};exports[_0x2651('0xfd')]=function(_0x3e4d35,_0x2b9027){var _0x5e3408;return db[_0x2651('0xa6')]['update']({'paused':0x1},{'where':{'UserId':_0x3e4d35[_0x2651('0x4e')]['id']},'individualHooks':!![]})[_0x2651('0x10')](function(){return db[_0x2651('0x34')]['find']({'where':{'id':_0x3e4d35['params']['id'],'role':'agent'},'attributes':['id',_0x2651('0x2f'),_0x2651('0x27'),_0x2651('0x5e'),_0x2651('0x98'),_0x2651('0x95')]});})[_0x2651('0x10')](handleEntityNotFound(_0x2b9027,null))[_0x2651('0x10')](function(_0x4c53bb){if(_0x4c53bb){_0x5e3408=_0x4c53bb;return respondWithRpcPromise(_0x2651('0xfe'),_0x2651('0xfd'),{'id':_0x5e3408['id'],'name':_0x5e3408['name'],'pause':!![]});}})[_0x2651('0x10')](function(){if(_0x5e3408){return db[_0x2651('0xf6')][_0x2651('0x44')]({'where':{'membername':_0x5e3408['name'],'type':_0x2651('0xfa'),'exitAt':null}});}})[_0x2651('0x10')](function(_0x3adc74){if(_0x3adc74[_0x2651('0x53')]){var _0x114ace=moment()[_0x2651('0xa4')](_0x2651('0xf8'));for(var _0x2e6513=0x0,_0x997a37=_0x3adc74[_0x2651('0x53')];_0x2e6513<_0x997a37;_0x2e6513++){_0x3adc74[_0x2e6513][_0x2651('0xff')]({'exitAt':_0x114ace});}}})[_0x2651('0x10')](function(){var _0x4eb622=[];var _0x49286b=utils[_0x2651('0x100')]();_0x49286b['forEach'](function(_0x4a76cf){_0x4eb622[_0x2651('0x43')]({'channel':_0x4a76cf,'membername':_0x5e3408[_0x2651('0x2f')],'interface':_[_0x2651('0x5f')](_0x5e3408['interface'])?util[_0x2651('0xa4')](_0x2651('0xa5'),_0x5e3408['name']):_0x5e3408[_0x2651('0x98')],'type':_0x2651('0xfa'),'enterAt':moment()[_0x2651('0xa4')](_0x2651('0xf8')),'data1':_0x3e4d35[_0x2651('0x56')][_0x2651('0x101')]||_0x2651('0x102'),'role':_0x5e3408['role'],'internal':_0x5e3408[_0x2651('0x5e')]});});return db[_0x2651('0xf6')][_0x2651('0x7e')](_0x4eb622,{'individualHooks':!![]});})['then'](function(){return _0x5e3408['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3e4d35[_0x2651('0x56')]['type']||_0x2651('0x102'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x2651('0x10')](respondWithResult(_0x2b9027,null))[_0x2651('0x19')](handleError(_0x2b9027,null));};exports[_0x2651('0x103')]=function(_0x49545e,_0x21934c){if(_0x49545e[_0x2651('0x56')][_0x2651('0x94')]&&!utils[_0x2651('0x99')](_0x49545e[_0x2651('0x56')][_0x2651('0x94')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x49545e[_0x2651('0x56')]['channel']));}return db[_0x2651('0x34')][_0x2651('0x2e')]({'where':{'id':_0x49545e[_0x2651('0x4e')]['id']},'attributes':['id',_0x2651('0x2f'),'role',_0x2651('0x5e'),'interface',_0x2651('0x95'),_0x2651('0x97'),_0x2651('0x104'),'chatPause',_0x2651('0x105'),'openchannelPause','smsPause',_0x2651('0x106'),'pauseType',_0x2651('0x107')]})[_0x2651('0x10')](function(_0xc3b524){if(!_0xc3b524){throw new APINotFoundError(util[_0x2651('0xa4')](_0x2651('0x108'),_0x49545e[_0x2651('0x4e')]['id']));}return _0xc3b524['unpause'](_0x49545e[_0x2651('0x56')][_0x2651('0x94')]);})[_0x2651('0x10')](respondWithResult(_0x21934c,null))[_0x2651('0x19')](APIHandleError(_0x21934c));};exports[_0x2651('0x109')]=function(_0x285002,_0x18cd5f){var _0xb23bf7={};var _0x14d7ba={};var _0x48ad36;var _0x25c42a;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x285002[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x18cd5f,null))[_0x2651('0x10')](function(_0x209a45){if(_0x209a45){_0x48ad36=_0x209a45;_0x14d7ba[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0x10a')][_0x2651('0xd6')]);_0x14d7ba[_0x2651('0x3c')]=_['keys'](_0x285002['query']);_0x14d7ba[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x14d7ba[_0x2651('0x4f')],_0x14d7ba[_0x2651('0x3c')]);_0xb23bf7[_0x2651('0x42')]=_[_0x2651('0x51')](_0x14d7ba[_0x2651('0x4f')],qs['fields'](_0x285002[_0x2651('0x3c')]['fields']));_0xb23bf7[_0x2651('0x42')]=_0xb23bf7[_0x2651('0x42')][_0x2651('0x53')]?_0xb23bf7[_0x2651('0x42')]:_0x14d7ba[_0x2651('0x4f')];_0xb23bf7[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x285002[_0x2651('0x3c')][_0x2651('0xc6')]);_0xb23bf7[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_['pick'](_0x285002['query'],_0x14d7ba[_0x2651('0xc8')]));if(_0x285002[_0x2651('0x3c')][_0x2651('0x37')]){_0xb23bf7[_0x2651('0xc7')]=_[_0x2651('0x54')](_0xb23bf7[_0x2651('0xc7')],{'$or':_['map'](_0xb23bf7['attributes'],function(_0x166dc6){var _0x3db146={};_0x3db146[_0x166dc6]={'$like':'%'+_0x285002['query'][_0x2651('0x37')]+'%'};return _0x3db146;})});}_0xb23bf7=_[_0x2651('0x54')]({},_0xb23bf7,_0x285002['options']);return _0x48ad36[_0x2651('0x109')](_0xb23bf7);}})[_0x2651('0x10')](function(_0x1c39dd){if(_0x1c39dd){_0x25c42a=_0x1c39dd[_0x2651('0x53')];if(!_0x285002[_0x2651('0x3c')]['hasOwnProperty'](_0x2651('0xd7'))){_0xb23bf7[_0x2651('0x21')]=qs['limit'](_0x285002[_0x2651('0x3c')][_0x2651('0x21')]);_0xb23bf7[_0x2651('0x1e')]=qs[_0x2651('0x1e')](_0x285002['query'][_0x2651('0x1e')]);}return _0x48ad36[_0x2651('0x109')](_0xb23bf7);}})['then'](function(_0x1f8d84){if(_0x1f8d84){return _0x1f8d84?{'count':_0x25c42a,'rows':_0x1f8d84}:null;}})['then'](respondWithResult(_0x18cd5f,null))[_0x2651('0x19')](handleError(_0x18cd5f,null));};exports[_0x2651('0x10b')]=function(_0x209920,_0x4562e3){var _0x13c5fb=_0x209920[_0x2651('0x4e')]['id'];var _0x57421f=_0x209920[_0x2651('0x56')]?_0x209920['body'][_0x2651('0x59')]:null;var _0x39ec3c=[];return Promise[_0x2651('0xfc')]()[_0x2651('0x10')](function(){if(!_0x57421f)throw new APIBadRequestError(_0x2651('0x10c'));})['then'](function(){return db[_0x2651('0x34')]['findOne']({'where':{'id':_0x13c5fb}});})[_0x2651('0x10')](function(_0x2aad57){if(!_0x2aad57)throw new APINotFoundError(util[_0x2651('0xa4')](_0x2651('0x108'),_0x209920['params']['id']));return db[_0x2651('0x61')][_0x2651('0x10d')](function(_0x40b02c){return _0x2aad57[_0x2651('0x10b')](_0x57421f,{'transaction':_0x40b02c})[_0x2651('0x10')](function(){return db[_0x2651('0x10a')][_0x2651('0x44')]({'where':{'id':{'$in':_0x57421f}}});})[_0x2651('0x10')](function(_0x11fc24){var _0x318749=_['map'](_0x11fc24,function(_0x477333){return _0x477333[_0x2651('0x10e')]();});return Promise[_0x2651('0x82')](_0x318749);})['then'](function(_0x1d5888){_0x39ec3c=_[_0x2651('0x10f')](_0x1d5888);var _0x2d3e77=_[_0x2651('0x2c')](_0x39ec3c,function(_0x30731d){return _0x30731d['addAgent'](_0x2aad57['id'],{'transaction':_0x40b02c});});return Promise[_0x2651('0x82')](_0x2d3e77);})[_0x2651('0x10')](function(){if(!_0x2aad57[_0x2651('0x95')])return;var _0x3cd00d=_['filter'](_0x39ec3c,function(_0x46dac6){return _0x46dac6[_0x2651('0x110')](_0x2651('0x94'))===_0x2651('0x111');});var _0x4759c8=_[_0x2651('0x2c')](_0x3cd00d,function(_0x5bb359){return db['UserVoiceQueueRt'][_0x2651('0xf5')]({'membername':_0x2aad57['name'],'UserId':_0x2aad57['id'],'queue_name':_0x5bb359['name'],'VoiceQueueId':_0x5bb359['id'],'interface':_[_0x2651('0x5f')](_0x2aad57[_0x2651('0x98')])?util[_0x2651('0xa4')](_0x2651('0xa5'),_0x2aad57[_0x2651('0x2f')]):_0x2aad57['interface'],'paused':_0x2aad57['voicePause']||![],'penalty':_0x2aad57[_0x2651('0x9e')]},{'transaction':_0x40b02c});});return Promise['all'](_0x4759c8);})[_0x2651('0x10')](function(){return db[_0x2651('0x112')][_0x2651('0x44')]({'where':{'teamId':{'$in':_0x57421f}}});})[_0x2651('0x10')](function(_0x41deac){var _0x48d3f3=_[_0x2651('0x2c')](_0x41deac,function(_0x4b49ac){return db[_0x2651('0x113')][_0x2651('0x74')]({'UserId':_0x2aad57['id'],'VoicePrefixId':_0x4b49ac[_0x2651('0x114')]},{'transaction':_0x40b02c});});return Promise['all'](_0x48d3f3);});});})[_0x2651('0x10')](function(){for(var _0x1236cd=0x0;_0x1236cd<_0x39ec3c[_0x2651('0x53')];_0x1236cd++){var _0x3bd6d4=_0x39ec3c[_0x1236cd]['getDataValue'](_0x2651('0x94'));var _0x589a04=_0x3bd6d4+_0x2651('0xa0');socket[_0x2651('0x25')](_0x2651('0x29')+_0x3bd6d4+'Queue:save',{'UserId':_0x13c5fb,['queueField']:_0x39ec3c[_0x1236cd]['id']});}})[_0x2651('0x10')](respondWithStatusCode(_0x4562e3,null))['catch'](APIHandleError(_0x4562e3));};exports[_0x2651('0x115')]=function(_0x4e3ebd,_0x34881f){var _0x50b4e9=_0x4e3ebd['params']['id'];var _0x1e6079=null;if(_0x4e3ebd[_0x2651('0x3c')][_0x2651('0x59')]){_0x1e6079=_[_0x2651('0xaa')](_0x4e3ebd[_0x2651('0x3c')][_0x2651('0x59')])?_0x4e3ebd['query'][_0x2651('0x59')]:[_0x4e3ebd[_0x2651('0x3c')][_0x2651('0x59')]];}var _0x3357a4=[];return Promise[_0x2651('0xfc')]()['then'](function(){if(!_0x1e6079)throw new APIBadRequestError(_0x2651('0x116'));})[_0x2651('0x10')](function(){return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x50b4e9}});})[_0x2651('0x10')](function(_0x5b770e){if(!_0x5b770e)throw new APINotFoundError(util[_0x2651('0xa4')](_0x2651('0x108'),_0x4e3ebd[_0x2651('0x4e')]['id']));return db['sequelize']['transaction'](function(_0x4a5427){return _0x5b770e[_0x2651('0x115')](_0x1e6079,{'transaction':_0x4a5427})[_0x2651('0x10')](function(){return db[_0x2651('0x10a')][_0x2651('0x44')]({'where':{'id':{'$in':_0x1e6079}}});})['then'](function(_0x1107f0){var _0x4affed=_['map'](_0x1107f0,function(_0x6261b4){return _0x6261b4[_0x2651('0x10e')]();});return Promise['all'](_0x4affed);})['then'](function(_0x365e63){_0x3357a4=_[_0x2651('0x10f')](_0x365e63);var _0x4081d4=_['map'](_0x3357a4,function(_0x5504bb){return _0x5504bb['removeAgent'](_0x5b770e['id'],{'transaction':_0x4a5427});});return Promise[_0x2651('0x82')](_0x4081d4);})[_0x2651('0x10')](function(){if(!_0x5b770e[_0x2651('0x95')])return;var _0x55836d=_[_0x2651('0x37')](_0x3357a4,function(_0x4a991e){return _0x4a991e[_0x2651('0x110')](_0x2651('0x94'))===_0x2651('0x111');});var _0x4d613c=_['map'](_0x55836d,function(_0x38d180){return db[_0x2651('0xa6')][_0x2651('0x26')]({'where':{'VoiceQueueId':_0x38d180['id'],'UserId':_0x5b770e['id']},'transaction':_0x4a5427});});return Promise[_0x2651('0x82')](_0x4d613c);})[_0x2651('0x10')](function(){return db[_0x2651('0x112')]['findAll']({'where':{'teamId':{'$in':_0x1e6079}}});})[_0x2651('0x10')](function(_0x2542e1){var _0x51ed80=_[_0x2651('0x2c')](_0x2542e1,function(_0x2867a0){return db[_0x2651('0x113')][_0x2651('0x26')]({'where':{'UserId':_0x5b770e['id'],'VoicePrefixId':_0x2867a0[_0x2651('0x114')]}},{'transaction':_0x4a5427});});return Promise[_0x2651('0x82')](_0x51ed80);});});})[_0x2651('0x10')](function(){for(var _0x28424e=0x0;_0x28424e<_0x3357a4[_0x2651('0x53')];_0x28424e++){var _0x55adf7=_0x3357a4[_0x28424e][_0x2651('0x110')]('channel');var _0x30372d=_0x55adf7+_0x2651('0xa0');socket['emit']('user'+_0x55adf7+_0x2651('0xab'),{'UserId':_0x50b4e9,['queueField']:_0x3357a4[_0x28424e]['id']});}})[_0x2651('0x10')](respondWithStatusCode(_0x34881f,null))[_0x2651('0x19')](APIHandleError(_0x34881f));};exports[_0x2651('0x117')]=function(_0x46cc2e,_0xa2018d){var _0x154c81={};var _0x52ca98={};var _0x1f6f27;var _0x201943;return db[_0x2651('0x34')]['findOne']({'where':{'id':_0x46cc2e[_0x2651('0x4e')]['id']}})[_0x2651('0x10')](handleEntityNotFound(_0xa2018d,null))['then'](function(_0x7faa15){if(_0x7faa15){_0x1f6f27=_0x7faa15;_0x52ca98[_0x2651('0x4f')]=_['keys'](db['CmList']['rawAttributes']);_0x52ca98['query']=_['keys'](_0x46cc2e[_0x2651('0x3c')]);_0x52ca98[_0x2651('0xc8')]=_[_0x2651('0x51')](_0x52ca98['model'],_0x52ca98[_0x2651('0x3c')]);_0x154c81[_0x2651('0x42')]=_[_0x2651('0x51')](_0x52ca98['model'],qs[_0x2651('0x52')](_0x46cc2e[_0x2651('0x3c')]['fields']));_0x154c81['attributes']=_0x154c81[_0x2651('0x42')]['length']?_0x154c81[_0x2651('0x42')]:_0x52ca98[_0x2651('0x4f')];_0x154c81[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x46cc2e[_0x2651('0x3c')][_0x2651('0xc6')]);_0x154c81['where']=qs[_0x2651('0xc8')](_['pick'](_0x46cc2e[_0x2651('0x3c')],_0x52ca98['filters']));if(_0x46cc2e[_0x2651('0x3c')][_0x2651('0x37')]){_0x154c81[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x154c81[_0x2651('0xc7')],{'$or':_[_0x2651('0x2c')](_0x154c81[_0x2651('0x42')],function(_0x2412d9){var _0x28941c={};_0x28941c[_0x2412d9]={'$like':'%'+_0x46cc2e[_0x2651('0x3c')]['filter']+'%'};return _0x28941c;})});}_0x154c81=_['merge']({},_0x154c81,_0x46cc2e[_0x2651('0x55')]);return _0x1f6f27['getLists'](_0x154c81);}})['then'](function(_0x3f0ece){if(_0x3f0ece){_0x201943=_0x3f0ece[_0x2651('0x53')];if(!_0x46cc2e[_0x2651('0x3c')][_0x2651('0xca')]('nolimit')){_0x154c81[_0x2651('0x21')]=qs[_0x2651('0x21')](_0x46cc2e[_0x2651('0x3c')]['limit']);_0x154c81['offset']=qs[_0x2651('0x1e')](_0x46cc2e['query'][_0x2651('0x1e')]);}return _0x1f6f27['getLists'](_0x154c81);}})[_0x2651('0x10')](function(_0x5f3655){if(_0x5f3655){return _0x5f3655?{'count':_0x201943,'rows':_0x5f3655}:null;}})[_0x2651('0x10')](respondWithResult(_0xa2018d,null))[_0x2651('0x19')](handleError(_0xa2018d,null));};exports['getAgents']=function(_0x24b05f,_0x3f8b4a){var _0x1c142c={};var _0x15babe={};var _0x470a68;return db[_0x2651('0x34')][_0x2651('0xd2')]({'where':{'id':_0x24b05f['params']['id']}})[_0x2651('0x10')](handleEntityNotFound(_0x3f8b4a,null))[_0x2651('0x10')](function(_0x19ca04){if(_0x19ca04){_0x470a68=_0x19ca04;_0x15babe[_0x2651('0x4f')]=_[_0x2651('0x50')](db[_0x2651('0x34')][_0x2651('0xd6')]);_0x15babe[_0x2651('0x3c')]=_[_0x2651('0x50')](_0x24b05f[_0x2651('0x3c')]);_0x15babe[_0x2651('0xc8')]=_['intersection'](_0x15babe[_0x2651('0x4f')],_0x15babe[_0x2651('0x3c')]);_0x1c142c['attributes']=_[_0x2651('0x51')](_0x15babe[_0x2651('0x4f')],qs[_0x2651('0x52')](_0x24b05f[_0x2651('0x3c')]['fields']));_0x1c142c[_0x2651('0x42')]=_0x1c142c[_0x2651('0x42')][_0x2651('0x53')]?_0x1c142c[_0x2651('0x42')]:_0x15babe[_0x2651('0x4f')];_0x1c142c[_0x2651('0xc5')]=qs[_0x2651('0xc6')](_0x24b05f['query'][_0x2651('0xc6')]);_0x1c142c[_0x2651('0xc7')]=qs[_0x2651('0xc8')](_[_0x2651('0xc9')](_0x24b05f['query'],_0x15babe[_0x2651('0xc8')]));if(_0x24b05f[_0x2651('0x3c')][_0x2651('0x37')]){_0x1c142c[_0x2651('0xc7')]=_[_0x2651('0x54')](_0x1c142c[_0x2651('0xc7')],{'$or':_['map'](_0x1c142c[_0x2651('0x42')],function(_0x3a13ca){var _0x29414f={};_0x29414f[_0x3a13ca]={'$like':'%'+_0x24b05f[_0x2651('0x3c')][_0x2651('0x37')]+'%'};return _0x29414f;})});}_0x1c142c[_0x2651('0x4f')]=db[_0x2651('0x34')];_0x1c142c['as']=_0x2651('0x7c');_0x1c142c=_[_0x2651('0x54')]({},_0x1c142c,_0x24b05f[_0x2651('0x55')]);return _0x470a68[_0x2651('0xf3')]({'include':[_0x1c142c]});}})[_0x2651('0x10')](function(_0x33b1a4){if(_0x33b1a4){var _0x404e2c={},_0x251a68=[];for(var _0x32c0fc=0x0;_0x32c0fc<_0x33b1a4[_0x2651('0x53')];_0x32c0fc+=0x1){for(var _0x531175=0x0,_0x45466f;_0x531175<_0x33b1a4[_0x32c0fc]['Agents'][_0x2651('0x53')];_0x531175+=0x1){_0x45466f=_0x33b1a4[_0x32c0fc][_0x2651('0x7c')][_0x531175]['get']({'plain':!![]});_0x404e2c[_0x45466f['id']]=_0x45466f;}}_0x404e2c=_[_0x2651('0x118')](_0x404e2c);for(var _0x120823=qs[_0x2651('0x1e')](_0x24b05f[_0x2651('0x3c')][_0x2651('0x1e')]);_0x120823<_0x404e2c[_0x2651('0x53')]&&_0x251a68[_0x2651('0x53')]=_0x3ff4a3){_0x4fd6d6=_0x3ff4a3;_0x312f48=0xc8;}else{_0x312f48=0xce;}_0x20bf1a[_0xcfca('0x20')](_0x312f48);return _0x20bf1a[_0xcfca('0x27')](_0xcfca('0x28'),_0x3de5f9+'-'+_0x4fd6d6+'/'+_0x3ff4a3)[_0xcfca('0x22')](_0x485d11);}return null;};}function saveUpdates(_0x6d641){return function(_0x229aef){if(_0x229aef){return _0x229aef[_0xcfca('0x29')](_0x6d641)['then'](function(_0x237f64){socket[_0xcfca('0x2a')](_0xcfca('0x2b')+_0x237f64['id'],{});return _0x237f64;});}return null;};}function removeEntity(_0x4328c9){return function(_0x4dda5a){if(_0x4dda5a){return _0x4dda5a[_0xcfca('0x2c')]()[_0xcfca('0x2d')](function(){var _0x30b232=_0x4dda5a[_0xcfca('0x2e')]({'plain':!![]});if(_0x30b232[_0xcfca('0x2f')]==='admin')return;var _0x300b9f=[{'name':_0xcfca('0x30'),'value':_0xcfca('0x31'),'ignore':!![]},{'name':'Agents','value':_0xcfca('0x32'),'ignore':![]},{'name':'Telephones','value':_0xcfca('0x33'),'ignore':![]}];var _0x4e77ee=_(_0x300b9f)['filter'](_0xcfca('0x34'))[_0xcfca('0x35')](_0xcfca('0x36'))[_0xcfca('0x36')]();if(_['includes'](_0x4e77ee,_0x30b232[_0xcfca('0x2f')])){return;}var _0x1bc52d=_[_0xcfca('0x37')](_0x300b9f,[_0xcfca('0x36'),_0x30b232['role']])[_0xcfca('0x38')];return db[_0xcfca('0x39')][_0xcfca('0x2c')]({'where':{'type':_0x1bc52d,'resourceId':_0x30b232['id']}})['then'](function(){return _0x4dda5a;});})[_0xcfca('0x2d')](function(){_0x4328c9[_0xcfca('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2df305){return function(_0x30b281){if(!_0x30b281){_0x2df305[_0xcfca('0x1f')](0x194);}return _0x30b281;};}function handleError(_0x11753f,_0x3bee46){_0x3bee46=_0x3bee46||0x1f4;return function(_0x57cbba){logger['error'](_0x57cbba[_0xcfca('0x3a')]);if(_0x57cbba['name']){delete _0x57cbba[_0xcfca('0x38')];}_0x11753f[_0xcfca('0x20')](_0x3bee46)[_0xcfca('0x3b')](_0x57cbba);};}exports['index']=function(_0x1c8dd5,_0x264b6b){var _0x2d03ab={},_0x22a528={'count':0x0,'rows':[]};var _0x51249a=_(db[_0xcfca('0x3c')][_0xcfca('0x3d')])[_0xcfca('0x35')](function(_0x49a247){return{'name':_0x49a247[_0xcfca('0x3e')],'type':_0x49a247[_0xcfca('0x3f')]['key']};})['filter'](function(_0x15a7c8){return!_[_0xcfca('0x40')]([_0xcfca('0x41'),_0xcfca('0x42')],_0x15a7c8[_0xcfca('0x38')]);})[_0xcfca('0x36')]();_0x2d03ab=qs[_0xcfca('0x43')](_0x51249a,_0x1c8dd5);var _0x8a62da={'where':_0x2d03ab[_0xcfca('0x44')]};return db['User'][_0xcfca('0x26')](_0x8a62da)['then'](function(_0x484405){_0x22a528[_0xcfca('0x26')]=_0x484405;if(_0x1c8dd5[_0xcfca('0x45')][_0xcfca('0x46')]){_0x2d03ab[_0xcfca('0x47')]=[{'all':!![]}];}if(_0x1c8dd5[_0xcfca('0x45')]['userSetting']===_0xcfca('0x48')){_0x2d03ab[_0xcfca('0x47')]=[{'model':db['UserSetting'],'as':_0xcfca('0x49')}];}if(!_[_0xcfca('0x40')](_0x2d03ab[_0xcfca('0x4a')],'id')){_0x2d03ab[_0xcfca('0x4a')][_0xcfca('0x4b')]('id');}return db[_0xcfca('0x3c')][_0xcfca('0x4c')](_0x2d03ab);})[_0xcfca('0x2d')](function(_0x2fd2fe){_0x22a528[_0xcfca('0x4d')]=_0x2fd2fe;if(_0x1c8dd5[_0xcfca('0x45')]['openTabs']==='true'){var _0x32d3e0=[];for(var _0x23d0d8=0x0;_0x23d0d8<_0x22a528[_0xcfca('0x4d')]['length'];_0x23d0d8++){_0x32d3e0[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x4e'),_0x22a528[_0xcfca('0x4d')][_0x23d0d8][_0xcfca('0x4f')]));_0x32d3e0[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x50'),_0x22a528['rows'][_0x23d0d8]['dataValues']));_0x32d3e0[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x51'),_0x22a528[_0xcfca('0x4d')][_0x23d0d8]['dataValues']));_0x32d3e0[_0xcfca('0x4b')](get_open_tabs('mail',_0x22a528[_0xcfca('0x4d')][_0x23d0d8]['dataValues']));_0x32d3e0[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x52'),_0x22a528[_0xcfca('0x4d')][_0x23d0d8][_0xcfca('0x4f')]));_0x32d3e0['push'](get_open_tabs('whatsapp',_0x22a528[_0xcfca('0x4d')][_0x23d0d8]['dataValues']));}return Promise[_0xcfca('0x53')](_0x32d3e0)['then'](function(){return _0x22a528;});}else{return _0x22a528;}})[_0xcfca('0x2d')](respondWithFilteredResult(_0x264b6b,_0x2d03ab))[_0xcfca('0x1e')](handleError(_0x264b6b,null));};exports[_0xcfca('0x54')]=function(_0x260698,_0x46330e){var _0x2d15c0={'raw':![],'where':{'id':_0x260698[_0xcfca('0x55')]['id']}},_0x586dbd={};_0x586dbd['model']=_[_0xcfca('0x56')](_[_0xcfca('0x57')](db[_0xcfca('0x3c')][_0xcfca('0x3d')]),['password',_0xcfca('0x42')]);_0x586dbd[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x260698[_0xcfca('0x45')]);_0x586dbd[_0xcfca('0x58')]=_[_0xcfca('0x59')](_0x586dbd['model'],_0x586dbd[_0xcfca('0x45')]);_0x2d15c0[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x586dbd[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x260698[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x2d15c0['attributes']=_0x2d15c0[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x2d15c0[_0xcfca('0x4a')]:_0x586dbd[_0xcfca('0x5a')];if(_0x260698[_0xcfca('0x45')]['includeAll']){_0x2d15c0[_0xcfca('0x47')]=[{'all':!![]}];}if(_0x260698[_0xcfca('0x45')][_0xcfca('0x49')]==='true'){_0x2d15c0[_0xcfca('0x47')]=[{'model':db[_0xcfca('0x5d')],'as':_0xcfca('0x49')}];}_0x2d15c0=_[_0xcfca('0x5e')]({},_0x2d15c0,_0x260698[_0xcfca('0x5f')]);if(!_[_0xcfca('0x40')](_0x2d15c0['attributes'],'id')){_0x2d15c0[_0xcfca('0x4a')][_0xcfca('0x4b')]('id');}return db['User']['find'](_0x2d15c0)[_0xcfca('0x2d')](handleEntityNotFound(_0x46330e,null))[_0xcfca('0x2d')](function(_0x49a42e){var _0x519388=[];values=_0x49a42e;if(_0x260698[_0xcfca('0x45')]['openTabs']===_0xcfca('0x48')){_0x519388[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x4e'),_0x49a42e[_0xcfca('0x4f')]));_0x519388['push'](get_open_tabs('sms',_0x49a42e[_0xcfca('0x4f')]));_0x519388[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x52'),_0x49a42e[_0xcfca('0x4f')]));_0x519388[_0xcfca('0x4b')](get_open_tabs('whatsapp',_0x49a42e[_0xcfca('0x4f')]));_0x519388[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x51'),_0x49a42e[_0xcfca('0x4f')]));_0x519388['push'](get_open_tabs('mail',_0x49a42e[_0xcfca('0x4f')]));return Promise[_0xcfca('0x53')](_0x519388);}else{return values;}})[_0xcfca('0x2d')](function(){return values;})[_0xcfca('0x2d')](respondWithResult(_0x46330e,null))[_0xcfca('0x1e')](handleError(_0x46330e,null));};exports[_0xcfca('0x29')]=function(_0x5e2ca4,_0x1d9013){if(_0x5e2ca4['body']['id']){delete _0x5e2ca4[_0xcfca('0x60')]['id'];}delete _0x5e2ca4['body'][_0xcfca('0x2f')];return db[_0xcfca('0x3c')]['find']({'where':{'id':_0x5e2ca4[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x1d9013,null))[_0xcfca('0x2d')](saveUpdates(_0x5e2ca4['body'],null))[_0xcfca('0x2d')](respondWithResult(_0x1d9013,null))[_0xcfca('0x1e')](handleError(_0x1d9013,null));};exports['describe']=function(_0x5b671c,_0x259d88){return db[_0xcfca('0x3c')][_0xcfca('0x61')]()[_0xcfca('0x2d')](respondWithResult(_0x259d88,null))[_0xcfca('0x1e')](handleError(_0x259d88,null));};exports[_0xcfca('0x62')]=function(_0x54caa9,_0x3b18ba){return db['User']['find']({'where':{'id':_0x54caa9['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x3b18ba,null))[_0xcfca('0x2d')](function(_0x560cb8){if(_0x560cb8){return _0x560cb8[_0xcfca('0x62')](_0x54caa9['body'][_0xcfca('0x63')],_[_0xcfca('0x64')](_0x54caa9['body'],['ids','id'])||{});}})[_0xcfca('0x2d')](respondWithResult(_0x3b18ba,null))[_0xcfca('0x1e')](handleError(_0x3b18ba,null));};function validateUser(_0x1ecfc3){return new Promise(function(_0x5a8362,_0x439d5e){if(_0x1ecfc3[_0xcfca('0x65')])return _0x5a8362(_0x1ecfc3);return db['Setting'][_0xcfca('0x66')](0x1)[_0xcfca('0x2d')](function(_0x3fe3b9){if(_0x3fe3b9[_0xcfca('0x67')])authService[_0xcfca('0x68')](_0x1ecfc3['password']);db[_0xcfca('0x3c')][_0xcfca('0x69')](_0xcfca('0x65'))[_0xcfca('0x2d')](function(_0x3d1dde){if(_['isNil'](_0x3d1dde)){_0x1ecfc3[_0xcfca('0x65')]=_0x3fe3b9[_0xcfca('0x6a')]||0x1;return;}if(_[_0xcfca('0x6b')](_0x3fe3b9[_0xcfca('0x6a')])||_0x3fe3b9[_0xcfca('0x6a')]===_0x3d1dde){_0x1ecfc3['internal']=_0x3d1dde+0x1;return;}if(_0x3fe3b9[_0xcfca('0x6a')]>_0x3d1dde){_0x1ecfc3['internal']=_0x3fe3b9[_0xcfca('0x6a')];return;}return db['sequelize'][_0xcfca('0x45')](_0xcfca('0x6c'),{'type':db[_0xcfca('0x6d')][_0xcfca('0x6e')][_0xcfca('0x6f')]})['then'](function(_0x5d7619){if(_0x5d7619&&_0x5d7619[_0xcfca('0x5c')]){for(var _0xfedb8e=0x0,_0x445a51=_0x5d7619[_0xcfca('0x5c')];_0xfedb8e<_0x445a51&&_['isNil'](_0x1ecfc3['internal']);_0xfedb8e++){if(_0x3fe3b9[_0xcfca('0x6a')]<=_0x5d7619[_0xfedb8e][_0xcfca('0x70')]){_0x1ecfc3[_0xcfca('0x65')]=_0x5d7619[_0xfedb8e][_0xcfca('0x70')];}else if(_0x3fe3b9[_0xcfca('0x6a')]>_0x5d7619[_0xfedb8e][_0xcfca('0x70')]&&_0x3fe3b9[_0xcfca('0x6a')]<=_0x5d7619[_0xfedb8e]['to']){_0x1ecfc3[_0xcfca('0x65')]=_0x3fe3b9[_0xcfca('0x6a')];}}}if(_['isNil'](_0x1ecfc3[_0xcfca('0x65')])){_0x1ecfc3[_0xcfca('0x65')]=_0x3d1dde+0x1;}return _0x5a8362(_0x1ecfc3);});});})[_0xcfca('0x1e')](function(_0x28af3e){_0x439d5e(_0x28af3e);});});}function updateUser(_0x2f58ca){return new Promise(function(_0x1356e2,_0x53e4ee){try{if(_0x2f58ca[_0xcfca('0x71')]){_0x2f58ca[_0xcfca('0x72')]=_0x2f58ca[_0xcfca('0x65')];_0x2f58ca[_0xcfca('0x73')]={'mailbox':_0x2f58ca[_0xcfca('0x65')],'password':_0x2f58ca['password'],'fullname':_0x2f58ca[_0xcfca('0x74')],'email':_0x2f58ca[_0xcfca('0x75')]};}if(_0x2f58ca[_0xcfca('0x2f')]===_0xcfca('0x32')){if(!_0x2f58ca[_0xcfca('0x76')])_0x2f58ca[_0xcfca('0x76')]=['101','102',_0xcfca('0x77'),_0xcfca('0x78'),_0xcfca('0x79'),'104','105',_0xcfca('0x7a'),_0xcfca('0x7b'),_0xcfca('0x7c'),'109',_0xcfca('0x7d'),_0xcfca('0x7e'),_0xcfca('0x7f'),_0xcfca('0x80')];}_0x1356e2(_0x2f58ca);}catch(_0x209f70){_0x53e4ee(_0x209f70);}});}exports['create']=function(_0xab3081,_0x1822f6){if(_0xab3081[_0xcfca('0x31')][_0xcfca('0x2f')]===_0xcfca('0x32'))throw new Error(_0xcfca('0x81'));if(_0xab3081[_0xcfca('0x60')][_0xcfca('0x2f')]==='user'&&_0xab3081['user'][_0xcfca('0x2f')]!==_0xcfca('0x82')){throw new Error(_0xcfca('0x83'));}if(_0xab3081['body']['role']===_0xcfca('0x82')&&_0xab3081[_0xcfca('0x31')][_0xcfca('0x2f')]!==_0xcfca('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0xab3081[_0xcfca('0x60')]])[_0xcfca('0x2d')](function(){return validateUser(_0xab3081[_0xcfca('0x60')]);})[_0xcfca('0x2d')](function(_0x25474c){return updateUser(_0x25474c)[_0xcfca('0x2d')](function(_0x5cf00d){if(_0x5cf00d[_0xcfca('0x2f')]===_0xcfca('0x82')){_0x5cf00d['settingsEnabled']=_0xab3081['user'][_0xcfca('0x84')];delete _0x5cf00d[_0xcfca('0x85')];}return _0x5cf00d;});})[_0xcfca('0x2d')](function(_0x2df7ed){return db[_0xcfca('0x3c')]['create'](_0x2df7ed,{'include':[{'model':db[_0xcfca('0x73')],'as':_0xcfca('0x73')}]});})['then'](function(_0x4a61fc){if(_0xab3081['body']['role']===_0xcfca('0x31'))return _0x4a61fc;if(_0xab3081[_0xcfca('0x31')][_0xcfca('0x2f')]!==_0xcfca('0x31'))return _0x4a61fc;return db['UserProfileSection']['find']({'where':{'name':_0x4a61fc[_0xcfca('0x2f')]==='agent'?_0xcfca('0x86'):_0xcfca('0x87'),'userProfileId':_0xab3081[_0xcfca('0x31')]['userProfileId']},'raw':!![]})['then'](function(_0x19ae01){if(!_0x19ae01||_0x19ae01['autoAssociation']!=0x0)return _0x4a61fc;return db['UserProfileResource'][_0xcfca('0x88')]({'name':_0x4a61fc[_0xcfca('0x38')],'resourceId':_0x4a61fc['id'],'type':_0x19ae01[_0xcfca('0x38')],'sectionId':_0x19ae01['id']},{})[_0xcfca('0x2d')](function(){return _0x4a61fc;});})['catch'](function(_0x2110e0){logger['error'](_0xcfca('0x89'),_0x2110e0);throw _0x2110e0;});})[_0xcfca('0x2d')](respondWithResult(_0x1822f6,0xc9))[_0xcfca('0x1e')](handleError(_0x1822f6,null));};exports['bulkCreate']=function(_0x2070e0,_0x52854b){var _0x58f4c6=_0x2070e0[_0xcfca('0x60')];var _0x33b6ff=[];if(_0x2070e0[_0xcfca('0x31')][_0xcfca('0x2f')]===_0xcfca('0x32'))throw new Error(_0xcfca('0x81'));if(_[_0xcfca('0x8a')](_0x58f4c6,[_0xcfca('0x2f'),_0xcfca('0x31')])&&_0x2070e0[_0xcfca('0x31')][_0xcfca('0x2f')]!==_0xcfca('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xcfca('0x8a')](_0x58f4c6,[_0xcfca('0x2f'),_0xcfca('0x82')])&&_0x2070e0['user'][_0xcfca('0x2f')]!=='admin'){throw new Error(_0xcfca('0x8b'));}return licenseUtil[_0xcfca('0x8c')](_0x58f4c6)[_0xcfca('0x2d')](function(){return validateUser(_0x58f4c6[0x0]);})[_0xcfca('0x2d')](function(){for(var _0x1fbfd9=0x1;_0x1fbfd9<_0x58f4c6[_0xcfca('0x5c')];_0x1fbfd9++){var _0x3eea5c=_0x58f4c6[_0x1fbfd9-0x1]['internal'];if(!_0x58f4c6[_0x1fbfd9][_0xcfca('0x65')])_0x58f4c6[_0x1fbfd9][_0xcfca('0x65')]=_0x3eea5c+0x1;_0x33b6ff['push'](validateUser(_0x58f4c6[_0x1fbfd9]));}return Promise['all'](_0x33b6ff);})['then'](function(){_0x33b6ff=[];for(var _0xd4dd1=0x0;_0xd4dd1<_0x58f4c6[_0xcfca('0x5c')];_0xd4dd1++){_0x33b6ff[_0xcfca('0x4b')](updateUser(_0x58f4c6[_0xd4dd1]));}return Promise[_0xcfca('0x53')](_0x33b6ff);})[_0xcfca('0x2d')](function(){_0x33b6ff=_0x58f4c6[_0xcfca('0x35')](function(_0x3370fe){return db['User'][_0xcfca('0x88')](_0x3370fe,{'include':[{'model':db[_0xcfca('0x73')],'as':_0xcfca('0x73')}]})[_0xcfca('0x2d')](function(_0x2c4ace){_0x3370fe['id']=_0x2c4ace['id'];return _0x3370fe;});});return Promise[_0xcfca('0x53')](_0x33b6ff);})[_0xcfca('0x2d')](function(_0x2aba41){if(_0x2070e0[_0xcfca('0x60')][_0xcfca('0x2f')]===_0xcfca('0x31'))return _0x2aba41;if(_0x2070e0[_0xcfca('0x31')][_0xcfca('0x2f')]!==_0xcfca('0x31'))return _0x2aba41;var _0x502547=_[_0xcfca('0x8a')](_0x2aba41,function(_0x259e9f){return _0x259e9f[_0xcfca('0x2f')]===_0xcfca('0x32')||_0x259e9f[_0xcfca('0x2f')]===_0xcfca('0x33');});if(!_0x502547)return _0x2aba41;return db[_0xcfca('0x8d')]['findAll']({'where':{'name':{'$or':[_0xcfca('0x86'),_0xcfca('0x87')]},'userProfileId':_0x2070e0[_0xcfca('0x31')][_0xcfca('0x85')]},'raw':!![]})[_0xcfca('0x2d')](function(_0x2dd3ca){if(_[_0xcfca('0x8e')](_0x2dd3ca)||!_['some'](_0x2dd3ca,[_0xcfca('0x8f'),0x0]))return _0x2aba41;_0x33b6ff=[];var _0x6d899=_(_0x2dd3ca)[_0xcfca('0x35')](function(_0x469011){if(_0x469011[_0xcfca('0x8f')]===0x1)return;return _0x469011[_0xcfca('0x38')]===_0xcfca('0x86')?_0xcfca('0x32'):_0xcfca('0x33');})[_0xcfca('0x90')]()[_0xcfca('0x36')]();for(var _0x429c36=0x0;_0x429c36<_0x2aba41[_0xcfca('0x5c')];_0x429c36++){if(!_[_0xcfca('0x40')](_0x6d899,_0x2aba41[_0x429c36]['role']))return;var _0x44e077=_0x2aba41[_0x429c36][_0xcfca('0x2f')]===_0xcfca('0x32')?_0xcfca('0x86'):_0xcfca('0x87');_0x33b6ff['push'](db[_0xcfca('0x39')][_0xcfca('0x88')]({'name':_0x2aba41[_0x429c36][_0xcfca('0x38')],'resourceId':_0x2aba41[_0x429c36]['id'],'type':_0x44e077,'sectionId':_[_0xcfca('0x37')](_0x2dd3ca,['name',_0x44e077])['id']},{}));}return Promise['all'](_0x33b6ff);});})[_0xcfca('0x2d')](respondWithResult(_0x52854b,0xc9))[_0xcfca('0x1e')](handleError(_0x52854b,null));};exports['changePassword']=function(_0x1bfb58,_0x5b49a2){if(_0x1bfb58[_0xcfca('0x60')]['id']){delete _0x1bfb58[_0xcfca('0x60')]['id'];}return db[_0xcfca('0x3c')][_0xcfca('0x37')]({'where':{'id':_0x1bfb58[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](function(_0x528c52){if(!_0x528c52)return null;if(_0x528c52['id']===_0x1bfb58[_0xcfca('0x31')]['id']){if(!_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x91')]||!_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x92')]){throw new db['Sequelize']['ValidationError'](_0xcfca('0x93'));}if(!_0x528c52[_0xcfca('0x94')](_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x91')])){throw new db['Sequelize'][(_0xcfca('0x95'))]('Wrong\x20credentials');}if(_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x91')]===_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x92')]){throw new db[(_0xcfca('0x96'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x1bfb58['user'][_0xcfca('0x2f')]===_0xcfca('0x82')){if(!_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x92')]){throw new db['Sequelize'][(_0xcfca('0x95'))](_0xcfca('0x97'));}}else if(_0x1bfb58[_0xcfca('0x31')][_0xcfca('0x2f')]==='user'){if(!_0x1bfb58[_0xcfca('0x60')]['newPassword']){throw new db[(_0xcfca('0x96'))][(_0xcfca('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x528c52[_0xcfca('0x2f')]!=='agent'){throw new db[(_0xcfca('0x96'))][(_0xcfca('0x95'))](_0xcfca('0x81'));}}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0x528c52;})[_0xcfca('0x2d')](handleEntityNotFound(_0x5b49a2,null))[_0xcfca('0x2d')](function(_0x5d4bdc){return db['Setting'][_0xcfca('0x98')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xcfca('0x99')]})[_0xcfca('0x2d')](function(_0x14cd03){if(_0x14cd03[_0xcfca('0x67')])authService[_0xcfca('0x68')](_0x1bfb58[_0xcfca('0x60')][_0xcfca('0x92')]);if(!_0x14cd03[_0xcfca('0x9a')]||!_0x5d4bdc[_0xcfca('0x9b')])return _0x5d4bdc;authService[_0xcfca('0x9c')](_0x1bfb58[_0xcfca('0x60')]['newPassword'],_0x5d4bdc[_0xcfca('0x9b')],_0x14cd03['passwordHistoryLimit']);return _0x5d4bdc;})['then'](saveUpdates({'password':_0x1bfb58[_0xcfca('0x60')]['newPassword'],'passwordResetAt':_0x1bfb58['user']['id']==_0x1bfb58[_0xcfca('0x55')]['id']?moment():null,'previousPasswords':authService[_0xcfca('0x9d')](_0x1bfb58['body']['newPassword'],_0x5d4bdc['previousPasswords'])},null));})[_0xcfca('0x2d')](respondWithResult(_0x5b49a2,null))['catch'](handleError(_0x5b49a2,null));};exports[_0xcfca('0x9e')]=function(_0x5a7002,_0x16dd49){var _0x5bd096=_0x5a7002[_0xcfca('0x60')][_0xcfca('0x9f')];return db[_0xcfca('0x3c')][_0xcfca('0x37')]({'where':{'id':_0x5a7002[_0xcfca('0x55')]['id']},'attributes':['id',_0xcfca('0x38'),_0xcfca('0x2f'),_0xcfca('0xa0'),_0xcfca('0xa1'),'voicePause',_0xcfca('0xa2')]})[_0xcfca('0x2d')](handleEntityNotFound(_0x16dd49,null))['then'](function(_0x2923ef){if(_0x2923ef){if(!utils[_0xcfca('0xa3')](_0x5bd096)){throw new db[(_0xcfca('0x96'))][(_0xcfca('0x95'))](_0xcfca('0xa4'));}return _0x2923ef[_0xcfca('0xa5')+_['capitalize'](_0x5bd096[_0xcfca('0xa6')]())+'Queues'](_0x5a7002[_0xcfca('0x60')][_0xcfca('0x63')],{'penalty':_0x5a7002['body'][_0xcfca('0xa7')]||0x0})[_0xcfca('0xa8')](function(_0x3be346){for(var _0x24c812=0x0;_0x24c812<_0x5a7002[_0xcfca('0x60')]['ids'][_0xcfca('0x5c')];_0x24c812+=0x1){var _0x7b9957={'UserId':Number(_0x5a7002[_0xcfca('0x55')]['id'])};_0x7b9957[_[_0xcfca('0xa9')](_0x5bd096[_0xcfca('0xa6')]())+_0xcfca('0xaa')]=Number(_0x5a7002[_0xcfca('0x60')][_0xcfca('0x63')][_0x24c812]);socket[_0xcfca('0x2a')](_0xcfca('0x31')+_[_0xcfca('0xa9')](_0x5bd096['toLowerCase']())+_0xcfca('0xab'),_0x7b9957);}return _0x3be346;})[_0xcfca('0x2d')](function(){if(_0x5bd096==='voice'){return db[_0xcfca('0xac')][_0xcfca('0x4c')]({'where':{'id':_0x5a7002[_0xcfca('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0xcfca('0x38')]});}})[_0xcfca('0x2d')](function(_0x170d46){var _0x190bac=_0x2923ef[_0xcfca('0x2e')]({'plain':!![]});var _0x245638=[];if(_0x5bd096===_0xcfca('0xad')&&_0x190bac[_0xcfca('0x2f')]===_0xcfca('0x32')&&_0x190bac['online']){for(let _0x36110f=0x0;_0x36110f<_0x170d46[_0xcfca('0x5c')];_0x36110f+=0x1){_0x245638[_0xcfca('0x4b')]({'membername':_0x190bac[_0xcfca('0x38')],'UserId':_0x190bac['id'],'queue_name':_0x170d46[_0x36110f][_0xcfca('0x38')],'VoiceQueueId':_0x170d46[_0x36110f]['id'],'interface':_[_0xcfca('0x6b')](_0x190bac[_0xcfca('0xa2')])?util[_0xcfca('0xae')](_0xcfca('0xaf'),_0x190bac[_0xcfca('0x38')]):_0x190bac[_0xcfca('0xa2')],'paused':_0x190bac[_0xcfca('0xb0')]||![],'penalty':_0x5a7002[_0xcfca('0x60')][_0xcfca('0xa7')]||0x0});}return Promise[_0xcfca('0x53')](_0x245638[_0xcfca('0x35')](function(_0x3adf8b){return db[_0xcfca('0xb1')][_0xcfca('0xb2')](_0x3adf8b);}));}return _0x2923ef;});}})[_0xcfca('0x2d')](respondWithStatusCode(_0x16dd49,null))[_0xcfca('0x1e')](handleError(_0x16dd49,null));};exports[_0xcfca('0xb3')]=function(_0x55ea65,_0x44e138){var _0x1146da,_0x3ae2f9;return db[_0xcfca('0x3c')][_0xcfca('0x37')]({'where':{'id':_0x55ea65[_0xcfca('0x55')]['id']},'attributes':['id',_0xcfca('0x38'),'role']})['then'](handleEntityNotFound(_0x44e138,null))['then'](function(_0x3f9175){if(_0x3f9175){_0x1146da=_0x3f9175;if(!_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')]||!utils[_0xcfca('0xa3')](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')])){throw new db['Sequelize'][(_0xcfca('0x95'))](_0xcfca('0xa4'));}return _0x3f9175[_0xcfca('0xb4')+_['capitalize'](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')]['toLowerCase']())+_0xcfca('0xb5')](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x63')]);}})['then'](function(_0x42ad8f){if(_[_0xcfca('0xb6')](_0x55ea65[_0xcfca('0x45')]['ids'])){for(var _0x5e6099=0x0;_0x5e6099<_0x55ea65[_0xcfca('0x45')][_0xcfca('0x63')][_0xcfca('0x5c')];_0x5e6099+=0x1){_0x3ae2f9={'UserId':Number(_0x55ea65[_0xcfca('0x55')]['id'])};_0x3ae2f9[_[_0xcfca('0xa9')](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')][_0xcfca('0xa6')]())+_0xcfca('0xaa')]=Number(_0x55ea65[_0xcfca('0x45')][_0xcfca('0x63')][_0x5e6099]);socket[_0xcfca('0x2a')](_0xcfca('0x31')+_['capitalize'](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')][_0xcfca('0xa6')]())+_0xcfca('0xb7'),_0x3ae2f9);}}else{_0x3ae2f9={'UserId':Number(_0x55ea65[_0xcfca('0x55')]['id'])};_0x3ae2f9[_[_0xcfca('0xa9')](_0x55ea65[_0xcfca('0x45')]['channel']['toLowerCase']())+_0xcfca('0xaa')]=Number(_0x55ea65['query'][_0xcfca('0x63')]);socket['emit'](_0xcfca('0x31')+_[_0xcfca('0xa9')](_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')][_0xcfca('0xa6')]())+'Queue:remove',_0x3ae2f9);}return _0x42ad8f;})[_0xcfca('0x2d')](function(){if(_0x55ea65[_0xcfca('0x45')][_0xcfca('0x9f')]===_0xcfca('0xad')){return db[_0xcfca('0xb1')][_0xcfca('0x2c')]({'where':{'UserId':_0x55ea65['params']['id'],'VoiceQueueId':_0x55ea65['query'][_0xcfca('0x63')]},'individualHooks':!![]})['then'](function(){return _0x1146da;});}return _0x1146da;})['then'](respondWithStatusCode(_0x44e138,null))[_0xcfca('0x1e')](handleError(_0x44e138,null));};exports['addAvatar']=function(_0x2fde0b,_0x1e8aee){_0x2fde0b[_0xcfca('0x60')][_0xcfca('0xb8')]=_0x2fde0b[_0xcfca('0xb9')][_0xcfca('0xba')];return db[_0xcfca('0x3c')]['find']({'where':{'id':_0x2fde0b[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x1e8aee,null))[_0xcfca('0x2d')](saveUpdates(_0x2fde0b[_0xcfca('0x60')],null))[_0xcfca('0x2d')](respondWithResult(_0x1e8aee,null))[_0xcfca('0x1e')](handleError(_0x1e8aee,null));};exports[_0xcfca('0xbb')]=function(_0x146119,_0x5f37b7){var _0x12b413=path[_0xcfca('0xbc')](config[_0xcfca('0xbd')],_0xcfca('0xbe'));return db['User'][_0xcfca('0x37')]({'where':{'id':_0x146119[_0xcfca('0x55')]['id']},'attributes':['id',_0xcfca('0xb8')],'raw':!![]})[_0xcfca('0x2d')](handleEntityNotFound(_0x5f37b7,null))['then'](function(_0x4e170b){if(_0x4e170b){if(_['isNil'](_0x4e170b[_0xcfca('0xb8')])){return _0x5f37b7[_0xcfca('0xbf')](_0x12b413);}else{if(!fs[_0xcfca('0xc0')](path[_0xcfca('0xbc')](config[_0xcfca('0xbd')],_0xcfca('0xc1'),_0x4e170b[_0xcfca('0xb8')]))){return _0x5f37b7[_0xcfca('0xbf')](_0x12b413);}return _0x5f37b7['download'](path[_0xcfca('0xbc')](config[_0xcfca('0xbd')],_0xcfca('0xc1'),_0x4e170b[_0xcfca('0xb8')]));}}})[_0xcfca('0x1e')](handleError(_0x5f37b7,null));};exports[_0xcfca('0xc2')]=function(_0xeea056,_0x427594){return db['User'][_0xcfca('0x37')]({'where':{'id':_0xeea056[_0xcfca('0x55')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x427594,null))[_0xcfca('0x2d')](function(_0x3491b2){var _0x5e23ac=[];values=_0x3491b2[_0xcfca('0x4f')];_0x5e23ac[_0xcfca('0x4b')](get_open_tabs('chat',_0x3491b2['dataValues']));_0x5e23ac[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x50'),_0x3491b2['dataValues']));_0x5e23ac[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0x52'),_0x3491b2[_0xcfca('0x4f')]));_0x5e23ac[_0xcfca('0x4b')](get_open_tabs('whatsapp',_0x3491b2['dataValues']));_0x5e23ac['push'](get_open_tabs(_0xcfca('0x51'),_0x3491b2['dataValues']));_0x5e23ac[_0xcfca('0x4b')](get_open_tabs(_0xcfca('0xc3'),_0x3491b2[_0xcfca('0x4f')]));return Promise['all'](_0x5e23ac);})[_0xcfca('0x2d')](function(_0x3b822b){if(_0x3b822b){var _0x524a4c=_[_0xcfca('0x35')](values[_0xcfca('0xc4')],function(_0x327d40){return{'channel':'CHAT','id':_0x327d40['id'],'createdAt':_0x327d40[_0xcfca('0xc5')]};});var _0x17ee21=_[_0xcfca('0x35')](values[_0xcfca('0xc6')],function(_0x50de41){return{'channel':_0xcfca('0xc7'),'id':_0x50de41['id'],'createdAt':_0x50de41['createdAt']};});var _0x28570e=_[_0xcfca('0x35')](values[_0xcfca('0xc8')],function(_0x471ea3){return{'channel':_0xcfca('0xc9'),'id':_0x471ea3['id'],'createdAt':_0x471ea3[_0xcfca('0xc5')]};});var _0x125293=_[_0xcfca('0x35')](values['MailOpenTabs'],function(_0x47fded){return{'channel':_0xcfca('0xca'),'id':_0x47fded['id'],'createdAt':_0x47fded['createdAt']};});var _0x3c461c=_[_0xcfca('0x35')](values['SmsOpenTabs'],function(_0x1b57c9){return{'channel':_0xcfca('0xcb'),'id':_0x1b57c9['id'],'createdAt':_0x1b57c9[_0xcfca('0xc5')]};});var _0x1c6932=_['map'](values[_0xcfca('0xcc')],function(_0x9fc543){return{'channel':_0xcfca('0xcd'),'id':_0x9fc543['id'],'createdAt':_0x9fc543[_0xcfca('0xc5')]};});var _0x4f9b28=_[_0xcfca('0xce')](_0x524a4c,_0x17ee21,_0x28570e,_0x125293,_0x3c461c,_0x1c6932);var _0x42eac5={'count':_0x4f9b28[_0xcfca('0x5c')],'rows':_0x4f9b28};return _0x42eac5;}else return null;})[_0xcfca('0x2d')](respondWithResult(_0x427594,null))[_0xcfca('0x1e')](handleError(_0x427594,null));};exports['getContacts']=function(_0x57ce5a,_0x39fee4){var _0x53f3f4={};var _0x50671f={};var _0x515930;var _0x322a64;return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x57ce5a[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x39fee4,null))[_0xcfca('0x2d')](function(_0x2bd597){if(_0x2bd597){_0x515930=_0x2bd597;_0x50671f['model']=_[_0xcfca('0x57')](db[_0xcfca('0xcf')][_0xcfca('0x3d')]);_0x50671f['query']=_[_0xcfca('0x57')](_0x57ce5a['query']);_0x50671f[_0xcfca('0x58')]=_[_0xcfca('0x59')](_0x50671f['model'],_0x50671f[_0xcfca('0x45')]);_0x53f3f4[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x50671f[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x57ce5a['query'][_0xcfca('0x5b')]));_0x53f3f4['attributes']=_0x53f3f4[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x53f3f4['attributes']:_0x50671f['model'];_0x53f3f4[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x57ce5a[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x53f3f4['where']=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x57ce5a[_0xcfca('0x45')],_0x50671f['filters']));if(_0x57ce5a[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x53f3f4[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x53f3f4[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x53f3f4[_0xcfca('0x4a')],function(_0x5bd672){var _0x13e591={};_0x13e591[_0x5bd672]={'$like':'%'+_0x57ce5a['query']['filter']+'%'};return _0x13e591;})});}_0x53f3f4=_[_0xcfca('0x5e')]({},_0x53f3f4,_0x57ce5a['options']);return _0x515930['getContacts'](_0x53f3f4);}})[_0xcfca('0x2d')](function(_0xf3e7c3){if(_0xf3e7c3){_0x322a64=_0xf3e7c3['length'];if(_0x57ce5a[_0xcfca('0x45')][_0xcfca('0xd4')](_0xcfca('0x46'))){_0x53f3f4[_0xcfca('0x47')]=[{'model':db[_0xcfca('0xd5')],'as':'List','required':![]},{'model':db[_0xcfca('0xd6')],'as':_0xcfca('0xd7'),'attributes':['id',_0xcfca('0x38'),_0xcfca('0xd8')],'where':_0x57ce5a['query'][_0xcfca('0xd9')]?{'id':_0x57ce5a[_0xcfca('0x45')][_0xcfca('0xd9')]}:undefined,'required':_0x57ce5a[_0xcfca('0x45')][_0xcfca('0xd9')]?!![]:![]}];}if(!_0x57ce5a[_0xcfca('0x45')]['hasOwnProperty'](_0xcfca('0xda'))){_0x53f3f4['limit']=qs[_0xcfca('0x25')](_0x57ce5a['query'][_0xcfca('0x25')]);_0x53f3f4[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x57ce5a['query'][_0xcfca('0x23')]);}return _0x515930[_0xcfca('0xdb')](_0x53f3f4);}})[_0xcfca('0x2d')](function(_0x2d6d5f){if(_0x2d6d5f){return _0x2d6d5f?{'count':_0x322a64,'rows':_0x2d6d5f}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x39fee4,null))[_0xcfca('0x1e')](handleError(_0x39fee4,null));};exports[_0xcfca('0xdc')]=function(_0x24f55d,_0x20c1c1){var _0xf49f51;var _0x19c92c={};var _0x5466b7;return db[_0xcfca('0x3c')]['findOne']({'where':{'id':_0x24f55d[_0xcfca('0x55')]['id']},'attributes':['id',_0xcfca('0x38'),_0xcfca('0x2f')]})['then'](handleEntityNotFound(_0x20c1c1,null))[_0xcfca('0x2d')](function(_0x3cd84a){if(!utils[_0xcfca('0xa3')](_0x24f55d[_0xcfca('0x45')]['channel'])){throw new db['Sequelize'][(_0xcfca('0x95'))](_0xcfca('0xa4'));}_0xf49f51=_0x3cd84a;var _0x9397c5={};_0x9397c5[_0xcfca('0x5a')]=_[_0xcfca('0x57')](db[_[_0xcfca('0xa9')](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x9f')])+_0xcfca('0xdd')]['rawAttributes']);_0x9397c5[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x24f55d[_0xcfca('0x45')]);_0x9397c5['filters']=_['intersection'](_0x9397c5[_0xcfca('0x5a')],_0x9397c5['query']);_0x19c92c[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x9397c5['model'],qs[_0xcfca('0x5b')](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x19c92c['attributes']=_0x19c92c['attributes'][_0xcfca('0x5c')]?_0x19c92c['attributes']:_0x9397c5['model'];_0x19c92c['order']=qs['sort'](_0x24f55d[_0xcfca('0x45')]['sort']);_0x19c92c[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x24f55d[_0xcfca('0x45')],_0x9397c5['filters']));if(_0x24f55d[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x19c92c[_0xcfca('0x44')]=_['merge'](_0x19c92c['where'],{'$or':_['map'](_0x19c92c['attributes'],function(_0x4e1ebb){var _0x1c0437={};_0x1c0437[_0x4e1ebb]={'$like':'%'+_0x24f55d['query'][_0xcfca('0xd3')]+'%'};return _0x1c0437;})});}_0x19c92c=_[_0xcfca('0x5e')]({},_0x19c92c,_0x24f55d[_0xcfca('0x5f')]);switch(_0xf49f51[_0xcfca('0x2f')]){case _0xcfca('0x82'):return db[_[_0xcfca('0xa9')](_0x24f55d['query'][_0xcfca('0x9f')])+'Queue'][_0xcfca('0x4c')](_0x19c92c);case _0xcfca('0x31'):case'agent':return _0xf49f51[_0xcfca('0x2e')+_[_0xcfca('0xa9')](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x9f')])+_0xcfca('0xb5')](_0x19c92c);default:throw new db['Sequelize'][(_0xcfca('0x95'))]('Unknown\x20role');}})[_0xcfca('0x2d')](function(_0x56caff){_0x5466b7=_0x56caff[_0xcfca('0x5c')];if(!_0x24f55d[_0xcfca('0x45')][_0xcfca('0xd4')]('nolimit')){_0x19c92c['limit']=qs['limit'](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x25')]);_0x19c92c[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x23')]);}switch(_0xf49f51[_0xcfca('0x2f')]){case _0xcfca('0x82'):return db[_['capitalize'](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x9f')])+_0xcfca('0xdd')][_0xcfca('0x4c')](_0x19c92c);case _0xcfca('0x31'):case _0xcfca('0x32'):return _0xf49f51[_0xcfca('0x2e')+_['capitalize'](_0x24f55d[_0xcfca('0x45')][_0xcfca('0x9f')])+_0xcfca('0xb5')](_0x19c92c);}})['then'](function(_0x2424db){return{'count':_0x5466b7,'rows':_0x2424db};})['then'](respondWithResult(_0x20c1c1,null))[_0xcfca('0x1e')](handleError(_0x20c1c1,null));};exports['getVoiceQueuesRt']=function(_0x5306c4,_0x3dcc22){var _0x5033e2={};var _0x243c24={};var _0x3ce790;var _0x53e233;return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x5306c4[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x3dcc22,null))['then'](function(_0x2eff3a){if(_0x2eff3a){_0x3ce790=_0x2eff3a;_0x243c24['model']=_['keys'](db[_0xcfca('0xb1')][_0xcfca('0x3d')]);_0x243c24[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x5306c4['query']);_0x243c24[_0xcfca('0x58')]=_['intersection'](_0x243c24['model'],_0x243c24[_0xcfca('0x45')]);_0x5033e2[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x243c24['model'],qs['fields'](_0x5306c4[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x5033e2[_0xcfca('0x4a')]=_0x5033e2[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x5033e2[_0xcfca('0x4a')]:_0x243c24[_0xcfca('0x5a')];_0x5033e2[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x5306c4['query'][_0xcfca('0xd1')]);_0x5033e2[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x5306c4['query'],_0x243c24['filters']));if(_0x5306c4[_0xcfca('0x45')]['filter']){_0x5033e2[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x5033e2['where'],{'$or':_['map'](_0x5033e2[_0xcfca('0x4a')],function(_0x324b3c){var _0x2b60f1={};_0x2b60f1[_0x324b3c]={'$like':'%'+_0x5306c4[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x2b60f1;})});}_0x5033e2=_[_0xcfca('0x5e')]({},_0x5033e2,_0x5306c4[_0xcfca('0x5f')]);return _0x3ce790[_0xcfca('0xde')](_0x5033e2);}})[_0xcfca('0x2d')](function(_0x599f01){if(_0x599f01){_0x53e233=_0x599f01[_0xcfca('0x5c')];if(!_0x5306c4[_0xcfca('0x45')]['hasOwnProperty'](_0xcfca('0xda'))){_0x5033e2[_0xcfca('0x25')]=qs['limit'](_0x5306c4['query'][_0xcfca('0x25')]);_0x5033e2['offset']=qs['offset'](_0x5306c4[_0xcfca('0x45')][_0xcfca('0x23')]);}return _0x3ce790[_0xcfca('0xde')](_0x5033e2);}})[_0xcfca('0x2d')](function(_0x1ad228){if(_0x1ad228){return _0x1ad228?{'count':_0x53e233,'rows':_0x1ad228}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x3dcc22,null))['catch'](handleError(_0x3dcc22,null));};exports[_0xcfca('0xdf')]=function(_0x373e0c,_0x4f821b){var _0x490929={};var _0x24e39f={};var _0xc7c735;var _0x2c621c;return db['User'][_0xcfca('0x98')]({'where':{'id':_0x373e0c[_0xcfca('0x55')]['id']}})['then'](handleEntityNotFound(_0x4f821b,null))['then'](function(_0x15da19){if(_0x15da19){_0xc7c735=_0x15da19;_0x24e39f[_0xcfca('0x5a')]=_[_0xcfca('0x57')](db[_0xcfca('0xe0')][_0xcfca('0x3d')]);_0x24e39f[_0xcfca('0x45')]=_['keys'](_0x373e0c[_0xcfca('0x45')]);_0x24e39f[_0xcfca('0x58')]=_[_0xcfca('0x59')](_0x24e39f[_0xcfca('0x5a')],_0x24e39f['query']);_0x490929[_0xcfca('0x4a')]=_['intersection'](_0x24e39f[_0xcfca('0x5a')],qs['fields'](_0x373e0c['query']['fields']));_0x490929[_0xcfca('0x4a')]=_0x490929[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x490929['attributes']:_0x24e39f[_0xcfca('0x5a')];_0x490929[_0xcfca('0xd0')]=qs['sort'](_0x373e0c[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x490929['where']=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x373e0c['query'],_0x24e39f[_0xcfca('0x58')]));if(_0x373e0c[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x490929[_0xcfca('0x44')]=_['merge'](_0x490929['where'],{'$or':_['map'](_0x490929[_0xcfca('0x4a')],function(_0xf59484){var _0x12b42a={};_0x12b42a[_0xf59484]={'$like':'%'+_0x373e0c[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x12b42a;})});}_0x490929=_['merge']({},_0x490929,_0x373e0c[_0xcfca('0x5f')]);return _0xc7c735[_0xcfca('0xdf')](_0x490929);}})[_0xcfca('0x2d')](function(_0x32a0f0){if(_0x32a0f0){_0x2c621c=_0x32a0f0[_0xcfca('0x5c')];if(!_0x373e0c['query']['hasOwnProperty'](_0xcfca('0xda'))){_0x490929[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0x373e0c[_0xcfca('0x45')][_0xcfca('0x25')]);_0x490929[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x373e0c['query'][_0xcfca('0x23')]);}return _0xc7c735['getGroups'](_0x490929);}})[_0xcfca('0x2d')](function(_0x956f26){if(_0x956f26){return _0x956f26?{'count':_0x2c621c,'rows':_0x956f26}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x4f821b,null))['catch'](handleError(_0x4f821b,null));};exports[_0xcfca('0xe1')]=function(_0x16ae3b,_0x285489){var _0x5a5c8d={'raw':!![],'where':{}};var _0x2b651e={};var _0x5e9451={'count':0x0,'rows':[]};return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x16ae3b['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x285489,null))['then'](function(_0x465540){if(_0x465540){_0x2b651e['model']=_[_0xcfca('0x57')](db[_0xcfca('0xe2')][_0xcfca('0x3d')]);_0x2b651e[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x16ae3b[_0xcfca('0x45')]);_0x2b651e[_0xcfca('0x58')]=_['intersection'](_0x2b651e[_0xcfca('0x5a')],_0x2b651e['query']);_0x5a5c8d['attributes']=_[_0xcfca('0x59')](_0x2b651e[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x16ae3b[_0xcfca('0x45')]['fields']));_0x5a5c8d[_0xcfca('0x4a')]=_0x5a5c8d[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x5a5c8d[_0xcfca('0x4a')]:_0x2b651e[_0xcfca('0x5a')];if(!_0x16ae3b[_0xcfca('0x45')]['hasOwnProperty'](_0xcfca('0xda'))){_0x5a5c8d['limit']=qs[_0xcfca('0x25')](_0x16ae3b[_0xcfca('0x45')][_0xcfca('0x25')]);_0x5a5c8d['offset']=qs[_0xcfca('0x23')](_0x16ae3b[_0xcfca('0x45')][_0xcfca('0x23')]);}_0x5a5c8d['order']=qs[_0xcfca('0xd1')](_0x16ae3b[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x5a5c8d['where']=qs['filters'](_[_0xcfca('0xd2')](_0x16ae3b[_0xcfca('0x45')],_0x2b651e[_0xcfca('0x58')]));_0x5a5c8d['where']['UserId']=_0x465540['id'];if(_0x16ae3b[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x5a5c8d['where']=_['merge'](_0x5a5c8d[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x5a5c8d[_0xcfca('0x4a')],function(_0x18546c){var _0x4ed730={};_0x4ed730[_0x18546c]={'$like':'%'+_0x16ae3b[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x4ed730;})});}_0x5a5c8d=_[_0xcfca('0x5e')]({},_0x5a5c8d,_0x16ae3b[_0xcfca('0x5f')]);return db[_0xcfca('0xe2')][_0xcfca('0x26')]({'where':_0x5a5c8d[_0xcfca('0x44')]})[_0xcfca('0x2d')](function(_0x4769ad){_0x5e9451['count']=_0x4769ad;if(_0x16ae3b[_0xcfca('0x45')][_0xcfca('0x46')]){_0x5a5c8d['include']=[{'all':!![]}];}return db[_0xcfca('0xe2')]['findAll'](_0x5a5c8d);})[_0xcfca('0x2d')](function(_0x208c89){_0x5e9451[_0xcfca('0x4d')]=_0x208c89;return _0x5e9451;});}})[_0xcfca('0x2d')](respondWithFilteredResult(_0x285489,_0x5a5c8d))[_0xcfca('0x1e')](handleError(_0x285489,null));};exports[_0xcfca('0xe3')]=function(_0x408fe2,_0x5d5894){var _0x45e4a7={'raw':!![],'where':{}};var _0x45f186={};var _0x1a7933={'count':0x0,'rows':[]};return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x408fe2['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x5d5894,null))[_0xcfca('0x2d')](function(_0x441e43){if(_0x441e43){_0x45f186[_0xcfca('0x5a')]=_['keys'](db[_0xcfca('0xe4')][_0xcfca('0x3d')]);_0x45f186['query']=_[_0xcfca('0x57')](_0x408fe2['query']);_0x45f186['filters']=_['intersection'](_0x45f186[_0xcfca('0x5a')],_0x45f186[_0xcfca('0x45')]);_0x45e4a7[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x45f186['model'],qs[_0xcfca('0x5b')](_0x408fe2['query']['fields']));_0x45e4a7[_0xcfca('0x4a')]=_0x45e4a7['attributes'][_0xcfca('0x5c')]?_0x45e4a7[_0xcfca('0x4a')]:_0x45f186[_0xcfca('0x5a')];if(!_0x408fe2[_0xcfca('0x45')]['hasOwnProperty']('nolimit')){_0x45e4a7['limit']=qs[_0xcfca('0x25')](_0x408fe2[_0xcfca('0x45')][_0xcfca('0x25')]);_0x45e4a7[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x408fe2[_0xcfca('0x45')][_0xcfca('0x23')]);}_0x45e4a7[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x408fe2[_0xcfca('0x45')]['sort']);_0x45e4a7['where']=qs['filters'](_[_0xcfca('0xd2')](_0x408fe2[_0xcfca('0x45')],_0x45f186[_0xcfca('0x58')]));_0x45e4a7[_0xcfca('0x44')][_0xcfca('0xe5')]=_0x441e43['id'];if(_0x408fe2['query'][_0xcfca('0xd3')]){_0x45e4a7['where']=_[_0xcfca('0x5e')](_0x45e4a7['where'],{'$or':_['map'](_0x45e4a7[_0xcfca('0x4a')],function(_0x4306a6){var _0x343947={};_0x343947[_0x4306a6]={'$like':'%'+_0x408fe2['query'][_0xcfca('0xd3')]+'%'};return _0x343947;})});}_0x45e4a7=_[_0xcfca('0x5e')]({},_0x45e4a7,_0x408fe2[_0xcfca('0x5f')]);return db[_0xcfca('0xe4')][_0xcfca('0x26')]({'where':_0x45e4a7[_0xcfca('0x44')]})[_0xcfca('0x2d')](function(_0x281a32){_0x1a7933['count']=_0x281a32;if(_0x408fe2[_0xcfca('0x45')][_0xcfca('0x46')]){_0x45e4a7[_0xcfca('0x47')]=[{'all':!![]}];}return db[_0xcfca('0xe4')]['findAll'](_0x45e4a7);})['then'](function(_0x39d589){_0x1a7933[_0xcfca('0x4d')]=_0x39d589;return _0x1a7933;});}})[_0xcfca('0x2d')](respondWithFilteredResult(_0x5d5894,_0x45e4a7))[_0xcfca('0x1e')](handleError(_0x5d5894,null));};exports['getChatInteractions']=function(_0xe1305,_0xf6d5fd){var _0x4134ed={};var _0x2d4be4={};var _0x25a479;var _0x1e8621;return db['User'][_0xcfca('0x98')]({'where':{'id':_0xe1305['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0xf6d5fd,null))['then'](function(_0xa1a2df){if(_0xa1a2df){_0x25a479=_0xa1a2df;_0x2d4be4[_0xcfca('0x5a')]=_[_0xcfca('0x57')](db['ChatInteraction'][_0xcfca('0x3d')]);_0x2d4be4[_0xcfca('0x45')]=_['keys'](_0xe1305[_0xcfca('0x45')]);_0x2d4be4['filters']=_[_0xcfca('0x59')](_0x2d4be4[_0xcfca('0x5a')],_0x2d4be4[_0xcfca('0x45')]);_0x4134ed[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x2d4be4[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0xe1305['query'][_0xcfca('0x5b')]));_0x4134ed[_0xcfca('0x4a')]=_0x4134ed[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x4134ed[_0xcfca('0x4a')]:_0x2d4be4[_0xcfca('0x5a')];_0x4134ed[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0xe1305[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x4134ed[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_['pick'](_0xe1305[_0xcfca('0x45')],_0x2d4be4[_0xcfca('0x58')]));if(_0xe1305[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x4134ed[_0xcfca('0x44')]=_['merge'](_0x4134ed['where'],{'$or':_['map'](_0x4134ed['attributes'],function(_0x38f70c){var _0x39ba31={};_0x39ba31[_0x38f70c]={'$like':'%'+_0xe1305['query']['filter']+'%'};return _0x39ba31;})});}_0x4134ed=_['merge']({},_0x4134ed,_0xe1305[_0xcfca('0x5f')]);return _0x25a479[_0xcfca('0xe6')](_0x4134ed);}})[_0xcfca('0x2d')](function(_0x5ca874){if(_0x5ca874){_0x1e8621=_0x5ca874[_0xcfca('0x5c')];if(!_0xe1305[_0xcfca('0x45')][_0xcfca('0xd4')](_0xcfca('0xda'))){_0x4134ed[_0xcfca('0x25')]=qs['limit'](_0xe1305[_0xcfca('0x45')][_0xcfca('0x25')]);_0x4134ed[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0xe1305[_0xcfca('0x45')]['offset']);}return _0x25a479[_0xcfca('0xe6')](_0x4134ed);}})['then'](function(_0x2951db){if(_0x2951db){return _0x2951db?{'count':_0x1e8621,'rows':_0x2951db}:null;}})[_0xcfca('0x2d')](respondWithResult(_0xf6d5fd,null))[_0xcfca('0x1e')](handleError(_0xf6d5fd,null));};exports[_0xcfca('0xe7')]=function(_0x4efc23,_0x121b67){var _0x5efbc0={};var _0x45c52f={};var _0x56fc62;var _0x18e636;return db['User']['findOne']({'where':{'id':_0x4efc23[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x121b67,null))['then'](function(_0x2e27c3){if(_0x2e27c3){_0x56fc62=_0x2e27c3;_0x45c52f[_0xcfca('0x5a')]=_[_0xcfca('0x57')](db[_0xcfca('0xe8')][_0xcfca('0x3d')]);_0x45c52f[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x4efc23['query']);_0x45c52f[_0xcfca('0x58')]=_[_0xcfca('0x59')](_0x45c52f[_0xcfca('0x5a')],_0x45c52f[_0xcfca('0x45')]);_0x5efbc0[_0xcfca('0x4a')]=_['intersection'](_0x45c52f[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x4efc23[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x5efbc0['attributes']=_0x5efbc0[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x5efbc0['attributes']:_0x45c52f[_0xcfca('0x5a')];_0x5efbc0[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x4efc23[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x5efbc0['where']=qs['filters'](_['pick'](_0x4efc23[_0xcfca('0x45')],_0x45c52f['filters']));if(_0x4efc23[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x5efbc0[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x5efbc0[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x5efbc0['attributes'],function(_0x4b5030){var _0x414ec1={};_0x414ec1[_0x4b5030]={'$like':'%'+_0x4efc23[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x414ec1;})});}_0x5efbc0=_['merge']({},_0x5efbc0,_0x4efc23['options']);return _0x56fc62[_0xcfca('0xe7')](_0x5efbc0);}})[_0xcfca('0x2d')](function(_0x4c010d){if(_0x4c010d){_0x18e636=_0x4c010d[_0xcfca('0x5c')];if(!_0x4efc23[_0xcfca('0x45')][_0xcfca('0xd4')](_0xcfca('0xda'))){_0x5efbc0[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0x4efc23[_0xcfca('0x45')][_0xcfca('0x25')]);_0x5efbc0[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x4efc23['query'][_0xcfca('0x23')]);}return _0x56fc62[_0xcfca('0xe7')](_0x5efbc0);}})[_0xcfca('0x2d')](function(_0x9cc614){if(_0x9cc614){return _0x9cc614?{'count':_0x18e636,'rows':_0x9cc614}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x121b67,null))[_0xcfca('0x1e')](handleError(_0x121b67,null));};exports[_0xcfca('0xe9')]=function(_0x52a50a,_0x474701){var _0x3dc3e5={'raw':!![],'where':{}};var _0x1d2d6c={};var _0xa93ba6={'count':0x0,'rows':[]};return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x52a50a['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x474701,null))[_0xcfca('0x2d')](function(_0x3c6bd5){if(_0x3c6bd5){_0x1d2d6c[_0xcfca('0x5a')]=_['keys'](db[_0xcfca('0xea')]['rawAttributes']);_0x1d2d6c['query']=_[_0xcfca('0x57')](_0x52a50a[_0xcfca('0x45')]);_0x1d2d6c['filters']=_[_0xcfca('0x59')](_0x1d2d6c[_0xcfca('0x5a')],_0x1d2d6c[_0xcfca('0x45')]);_0x3dc3e5[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x1d2d6c[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x52a50a['query'][_0xcfca('0x5b')]));_0x3dc3e5[_0xcfca('0x4a')]=_0x3dc3e5['attributes'][_0xcfca('0x5c')]?_0x3dc3e5[_0xcfca('0x4a')]:_0x1d2d6c['model'];if(!_0x52a50a['query'][_0xcfca('0xd4')](_0xcfca('0xda'))){_0x3dc3e5['limit']=qs[_0xcfca('0x25')](_0x52a50a[_0xcfca('0x45')][_0xcfca('0x25')]);_0x3dc3e5[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x52a50a[_0xcfca('0x45')][_0xcfca('0x23')]);}_0x3dc3e5[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x52a50a[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x3dc3e5[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_['pick'](_0x52a50a[_0xcfca('0x45')],_0x1d2d6c[_0xcfca('0x58')]));_0x3dc3e5[_0xcfca('0x44')]['UserId']=_0x3c6bd5['id'];if(_0x52a50a[_0xcfca('0x45')]['filter']){_0x3dc3e5['where']=_[_0xcfca('0x5e')](_0x3dc3e5[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x3dc3e5[_0xcfca('0x4a')],function(_0x210e1e){var _0x9275f9={};_0x9275f9[_0x210e1e]={'$like':'%'+_0x52a50a[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x9275f9;})});}_0x3dc3e5=_[_0xcfca('0x5e')]({},_0x3dc3e5,_0x52a50a[_0xcfca('0x5f')]);return db[_0xcfca('0xea')][_0xcfca('0x26')]({'where':_0x3dc3e5[_0xcfca('0x44')]})[_0xcfca('0x2d')](function(_0x94d8fd){_0xa93ba6[_0xcfca('0x26')]=_0x94d8fd;if(_0x52a50a[_0xcfca('0x45')][_0xcfca('0x46')]){_0x3dc3e5['include']=[{'all':!![]}];}return db[_0xcfca('0xea')]['findAll'](_0x3dc3e5);})[_0xcfca('0x2d')](function(_0x3550f6){_0xa93ba6['rows']=_0x3550f6;return _0xa93ba6;});}})['then'](respondWithFilteredResult(_0x474701,_0x3dc3e5))[_0xcfca('0x1e')](handleError(_0x474701,null));};exports[_0xcfca('0xeb')]=function(_0x3a96ee,_0x5ebb80){var _0x37aa4f={};var _0x28e489={};var _0x1e4768;var _0x531e1b;return db[_0xcfca('0x3c')]['findOne']({'where':{'id':_0x3a96ee[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x5ebb80,null))['then'](function(_0xb36872){if(_0xb36872){_0x1e4768=_0xb36872;_0x28e489[_0xcfca('0x5a')]=_[_0xcfca('0x57')](db[_0xcfca('0xec')][_0xcfca('0x3d')]);_0x28e489[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x3a96ee['query']);_0x28e489[_0xcfca('0x58')]=_['intersection'](_0x28e489[_0xcfca('0x5a')],_0x28e489[_0xcfca('0x45')]);_0x37aa4f[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x28e489[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x3a96ee['query']['fields']));_0x37aa4f[_0xcfca('0x4a')]=_0x37aa4f[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x37aa4f[_0xcfca('0x4a')]:_0x28e489[_0xcfca('0x5a')];_0x37aa4f['order']=qs['sort'](_0x3a96ee[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x37aa4f[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x3a96ee[_0xcfca('0x45')],_0x28e489[_0xcfca('0x58')]));if(_0x3a96ee[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x37aa4f[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x37aa4f[_0xcfca('0x44')],{'$or':_['map'](_0x37aa4f['attributes'],function(_0x307975){var _0x64c825={};_0x64c825[_0x307975]={'$like':'%'+_0x3a96ee[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x64c825;})});}_0x37aa4f=_['merge']({},_0x37aa4f,_0x3a96ee[_0xcfca('0x5f')]);return _0x1e4768[_0xcfca('0xeb')](_0x37aa4f);}})[_0xcfca('0x2d')](function(_0x5808fb){if(_0x5808fb){_0x531e1b=_0x5808fb[_0xcfca('0x5c')];if(!_0x3a96ee[_0xcfca('0x45')]['hasOwnProperty']('nolimit')){_0x37aa4f[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0x3a96ee['query'][_0xcfca('0x25')]);_0x37aa4f['offset']=qs[_0xcfca('0x23')](_0x3a96ee[_0xcfca('0x45')]['offset']);}return _0x1e4768['getSmsInteractions'](_0x37aa4f);}})[_0xcfca('0x2d')](function(_0xa10021){if(_0xa10021){return _0xa10021?{'count':_0x531e1b,'rows':_0xa10021}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x5ebb80,null))['catch'](handleError(_0x5ebb80,null));};exports[_0xcfca('0xed')]=function(_0x2c1e82,_0x91eaad){var _0x216d20={};var _0x32895b={};var _0x3254f5;var _0x3e460d;return db[_0xcfca('0x3c')]['findOne']({'where':{'id':_0x2c1e82[_0xcfca('0x55')]['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x91eaad,null))[_0xcfca('0x2d')](function(_0x58f877){if(_0x58f877){_0x3254f5=_0x58f877;_0x32895b['model']=_[_0xcfca('0x57')](db[_0xcfca('0xee')][_0xcfca('0x3d')]);_0x32895b['query']=_[_0xcfca('0x57')](_0x2c1e82['query']);_0x32895b['filters']=_[_0xcfca('0x59')](_0x32895b['model'],_0x32895b[_0xcfca('0x45')]);_0x216d20[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x32895b['model'],qs[_0xcfca('0x5b')](_0x2c1e82[_0xcfca('0x45')]['fields']));_0x216d20['attributes']=_0x216d20[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x216d20[_0xcfca('0x4a')]:_0x32895b['model'];_0x216d20[_0xcfca('0xd0')]=qs['sort'](_0x2c1e82[_0xcfca('0x45')]['sort']);_0x216d20[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_['pick'](_0x2c1e82[_0xcfca('0x45')],_0x32895b[_0xcfca('0x58')]));if(_0x2c1e82[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x216d20[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x216d20['where'],{'$or':_[_0xcfca('0x35')](_0x216d20[_0xcfca('0x4a')],function(_0x7f5a0){var _0x43319e={};_0x43319e[_0x7f5a0]={'$like':'%'+_0x2c1e82[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x43319e;})});}_0x216d20=_[_0xcfca('0x5e')]({},_0x216d20,_0x2c1e82[_0xcfca('0x5f')]);return _0x3254f5['getFaxInteractions'](_0x216d20);}})[_0xcfca('0x2d')](function(_0x39f99d){if(_0x39f99d){_0x3e460d=_0x39f99d['length'];if(!_0x2c1e82[_0xcfca('0x45')][_0xcfca('0xd4')](_0xcfca('0xda'))){_0x216d20[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0x2c1e82['query'][_0xcfca('0x25')]);_0x216d20[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x2c1e82[_0xcfca('0x45')][_0xcfca('0x23')]);}return _0x3254f5[_0xcfca('0xed')](_0x216d20);}})[_0xcfca('0x2d')](function(_0x55e65e){if(_0x55e65e){return _0x55e65e?{'count':_0x3e460d,'rows':_0x55e65e}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x91eaad,null))['catch'](handleError(_0x91eaad,null));};exports[_0xcfca('0xef')]=function(_0x1f086e,_0xc95ac5){var _0x2519be={};var _0x5028e0={};var _0x1e00c2;var _0x3cef8f;return db[_0xcfca('0x3c')]['findOne']({'where':{'id':_0x1f086e['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0xc95ac5,null))[_0xcfca('0x2d')](function(_0x3daf39){if(_0x3daf39){_0x1e00c2=_0x3daf39;_0x5028e0[_0xcfca('0x5a')]=_['keys'](db[_0xcfca('0xf0')][_0xcfca('0x3d')]);_0x5028e0[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x1f086e[_0xcfca('0x45')]);_0x5028e0['filters']=_['intersection'](_0x5028e0['model'],_0x5028e0[_0xcfca('0x45')]);_0x2519be[_0xcfca('0x4a')]=_['intersection'](_0x5028e0[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x1f086e['query'][_0xcfca('0x5b')]));_0x2519be[_0xcfca('0x4a')]=_0x2519be[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x2519be['attributes']:_0x5028e0[_0xcfca('0x5a')];_0x2519be[_0xcfca('0xd0')]=qs['sort'](_0x1f086e[_0xcfca('0x45')]['sort']);_0x2519be[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x1f086e['query'],_0x5028e0[_0xcfca('0x58')]));if(_0x1f086e[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x2519be[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x2519be[_0xcfca('0x44')],{'$or':_['map'](_0x2519be['attributes'],function(_0x518f37){var _0x394fae={};_0x394fae[_0x518f37]={'$like':'%'+_0x1f086e[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x394fae;})});}_0x2519be=_[_0xcfca('0x5e')]({},_0x2519be,_0x1f086e[_0xcfca('0x5f')]);return _0x1e00c2[_0xcfca('0xef')](_0x2519be);}})['then'](function(_0x4b9e1c){if(_0x4b9e1c){_0x3cef8f=_0x4b9e1c[_0xcfca('0x5c')];if(!_0x1f086e[_0xcfca('0x45')]['hasOwnProperty'](_0xcfca('0xda'))){_0x2519be[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0x1f086e[_0xcfca('0x45')]['limit']);_0x2519be[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0x1f086e[_0xcfca('0x45')][_0xcfca('0x23')]);}return _0x1e00c2[_0xcfca('0xef')](_0x2519be);}})['then'](function(_0x50eab0){if(_0x50eab0){return _0x50eab0?{'count':_0x3cef8f,'rows':_0x50eab0}:null;}})[_0xcfca('0x2d')](respondWithResult(_0xc95ac5,null))[_0xcfca('0x1e')](handleError(_0xc95ac5,null));};exports[_0xcfca('0xf1')]=function(_0x4e771c,_0xe5c352,_0x13b592){var _0x2b65d9;var _0x11b4ee;var _0x31fea3;var _0x177954=!_[_0xcfca('0x6b')](_0x4e771c[_0xcfca('0x55')]['id'])?_0x4e771c['params']['id']:!_[_0xcfca('0x6b')](_0x4e771c[_0xcfca('0x31')]['id'])?_0x4e771c['user']['id']:null;return db[_0xcfca('0x3c')][_0xcfca('0x37')]({'where':{'id':_0x177954,'role':{'$or':[_0xcfca('0x82'),_0xcfca('0x31'),_0xcfca('0x32')]}},'attributes':['id',_0xcfca('0x38'),_0xcfca('0xf2'),_0xcfca('0xf3'),'role',_0xcfca('0x65'),_0xcfca('0xa1')]})['then'](function(_0x1db613){if(_0x1db613){if(_0x1db613[_0xcfca('0x2f')]===_0xcfca('0x32')){_0x2b65d9=_0x1db613;if(_0x4e771c[_0xcfca('0x60')][_0xcfca('0xa2')]){_0x31fea3=util['format'](_0xcfca('0xf4'),_0x2b65d9[_0x4e771c[_0xcfca('0x60')]['interface']]);}else if(_0x4e771c[_0xcfca('0x60')]['intrf']){_0x31fea3=util[_0xcfca('0xae')](_0xcfca('0xaf'),_0x4e771c['body'][_0xcfca('0xf5')]);}else{_0x31fea3=util[_0xcfca('0xae')](_0xcfca('0xaf'),_0x2b65d9[_0xcfca('0x38')]);}socket['to'](util[_0xcfca('0xae')](_0xcfca('0xf6'),_0x2b65d9[_0xcfca('0x38')]))['emit'](_0xcfca('0xf7'),{'user':{'id':_0x2b65d9['id'],'name':_0x2b65d9[_0xcfca('0x38')]},'ip':_0x4e771c[_0xcfca('0xf8')]['x-forwarded-for']||_0x4e771c[_0xcfca('0xf9')][_0xcfca('0xfa')]||_0x4e771c[_0xcfca('0xfb')][_0xcfca('0xfa')]||_0x4e771c[_0xcfca('0xf9')][_0xcfca('0xfb')][_0xcfca('0xfa')]});return db[_0xcfca('0xb1')][_0xcfca('0x2c')]({'where':{'membername':_0x2b65d9['name']},'individualHooks':!![]});}}else{throw new db[(_0xcfca('0x96'))][(_0xcfca('0x95'))](_0xcfca('0xfc'));}})[_0xcfca('0x2d')](function(){if(_0x2b65d9){return _0x2b65d9[_0xcfca('0xfd')]({'raw':!![]});}})[_0xcfca('0x2d')](function(_0x344120){if(_0x2b65d9){if(_0x344120){_0x11b4ee=_0x344120;if(_0x11b4ee['length']){var _0x2d7b4b=_0x11b4ee[_0xcfca('0x35')](function(_0x4161d6){var _0x3217b4={'membername':_0x2b65d9[_0xcfca('0x38')],'UserId':_0x2b65d9['id'],'queue_name':_0x4161d6[_0xcfca('0x38')],'VoiceQueueId':_0x4161d6['id'],'interface':_0x31fea3,'paused':_0x2b65d9['loginInPause']||![],'penalty':_0x4161d6[_0xcfca('0xfe')]||0x0};return db[_0xcfca('0xb1')]['upsert'](_0x3217b4);});return Promise[_0xcfca('0x53')](_0x2d7b4b);}}}})[_0xcfca('0x2d')](function(){if(_0x2b65d9){return db[_0xcfca('0xff')]['findAll']({'where':{'membername':_0x2b65d9[_0xcfca('0x38')],'exitAt':null}});}})[_0xcfca('0x2d')](function(_0x5016a9){if(_0x2b65d9){var _0x2dee25=[];_0x5016a9[_0xcfca('0x100')](function(_0x490e75){_0x2dee25[_0xcfca('0x4b')](_0x490e75[_0xcfca('0x29')]({'exitAt':moment()[_0xcfca('0xae')](_0xcfca('0x101'))}));});return Promise[_0xcfca('0x53')](_0x2dee25);}})['then'](function(){if(_0x2b65d9){var _0x469abc=[];var _0x30a4d5=[];var _0x1f23bb=utils[_0xcfca('0x102')]();var _0x5d79e4={'membername':_0x2b65d9[_0xcfca('0x38')],'interface':_0x31fea3,'enterAt':moment()[_0xcfca('0xae')](_0xcfca('0x101')),'role':_0x2b65d9[_0xcfca('0x2f')],'internal':_0x2b65d9[_0xcfca('0x65')]};_0x1f23bb[_0xcfca('0x100')](function(_0x3bb3ee){_0x469abc['push'](_[_0xcfca('0x5e')]({'channel':_0x3bb3ee,'type':'LOGIN','data1':_0x4e771c[_0xcfca('0x60')]['device'],'data2':_0x31fea3},_0x5d79e4));if(_0x2b65d9[_0xcfca('0xa1')]){_0x30a4d5[_0xcfca('0x4b')](_[_0xcfca('0x5e')]({'channel':_0x3bb3ee,'type':_0xcfca('0x103'),'data1':_0xcfca('0x104')},_0x5d79e4));}});return db[_0xcfca('0xff')][_0xcfca('0x105')](_0x469abc[_0xcfca('0xce')](_0x30a4d5),{'individualHooks':!![]});}})[_0xcfca('0x2d')](function(){if(_0x2b65d9){return _0x2b65d9[_0xcfca('0x29')]({'online':!![],'lastLoginAt':moment()[_0xcfca('0xae')](_0xcfca('0x101')),'voicePause':_0x2b65d9['loginInPause']||![],'mailPause':_0x2b65d9[_0xcfca('0xa1')]||![],'chatPause':_0x2b65d9[_0xcfca('0xa1')]||![],'faxPause':_0x2b65d9[_0xcfca('0xa1')]||![],'smsPause':_0x2b65d9[_0xcfca('0xa1')]||![],'openchannelPause':_0x2b65d9['loginInPause']||![],'whatsappPause':_0x2b65d9[_0xcfca('0xa1')]||![],'pauseType':_0x2b65d9[_0xcfca('0xa1')]?_0xcfca('0x104'):null,'interface':_0x31fea3,'lastPauseAt':moment()[_0xcfca('0xae')](_0xcfca('0x101'))});}})['then'](function(_0xec8f71){if(_0x4e771c[_0xcfca('0x106')]){return _0x13b592();}else{return Promise[_0xcfca('0x107')](_0xec8f71)[_0xcfca('0x2d')](respondWithResult(_0xe5c352,null));}})[_0xcfca('0x1e')](handleError(_0xe5c352,null));};exports[_0xcfca('0x108')]=function(_0x8b49fc,_0x5e33b0){var _0x256405;return db['User'][_0xcfca('0x37')]({'where':{'id':_0x8b49fc[_0xcfca('0x55')]['id'],'role':_0xcfca('0x32')},'attributes':['id',_0xcfca('0x38'),_0xcfca('0x2f')]})[_0xcfca('0x2d')](handleEntityNotFound(_0x5e33b0,null))[_0xcfca('0x2d')](function(_0x288ff9){if(_0x288ff9){_0x256405=_0x288ff9;return db['UserVoiceQueueRt'][_0xcfca('0x2c')]({'where':{'membername':_0x256405[_0xcfca('0x38')]},'individualHooks':!![]});}})[_0xcfca('0x2d')](function(){return db[_0xcfca('0xff')][_0xcfca('0x4c')]({'where':{'membername':_0x256405[_0xcfca('0x38')],'exitAt':null}});})['then'](function(_0x1426b4){var _0x5bc9de=[];_0x1426b4['forEach'](function(_0x2bb34c){_0x5bc9de[_0xcfca('0x4b')](_0x2bb34c[_0xcfca('0x29')]({'exitAt':moment()[_0xcfca('0xae')](_0xcfca('0x101'))}));});return Promise[_0xcfca('0x53')](_0x5bc9de);})[_0xcfca('0x2d')](function(){return _0x256405[_0xcfca('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x5e33b0,null))['catch'](handleError(_0x5e33b0,null));};exports[_0xcfca('0x109')]=function(_0x57d247,_0x58375e){var _0x112c60;return db[_0xcfca('0xb1')][_0xcfca('0x29')]({'paused':0x1},{'where':{'UserId':_0x57d247['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xcfca('0x3c')]['find']({'where':{'id':_0x57d247[_0xcfca('0x55')]['id'],'role':'agent'},'attributes':['id',_0xcfca('0x38'),'role',_0xcfca('0x65'),_0xcfca('0xa2'),_0xcfca('0xa0')]});})[_0xcfca('0x2d')](handleEntityNotFound(_0x58375e,null))[_0xcfca('0x2d')](function(_0x1194e6){if(_0x1194e6){_0x112c60=_0x1194e6;return respondWithRpcPromise('QueuePause',_0xcfca('0x109'),{'id':_0x112c60['id'],'name':_0x112c60['name'],'pause':!![]});}})[_0xcfca('0x2d')](function(){if(_0x112c60){return db[_0xcfca('0xff')][_0xcfca('0x4c')]({'where':{'membername':_0x112c60[_0xcfca('0x38')],'type':_0xcfca('0x103'),'exitAt':null}});}})[_0xcfca('0x2d')](function(_0x2b0aa8){if(_0x2b0aa8[_0xcfca('0x5c')]){var _0x1bb443=moment()[_0xcfca('0xae')](_0xcfca('0x101'));for(var _0x1d4f47=0x0,_0x10a7cf=_0x2b0aa8[_0xcfca('0x5c')];_0x1d4f47<_0x10a7cf;_0x1d4f47++){_0x2b0aa8[_0x1d4f47][_0xcfca('0x10a')]({'exitAt':_0x1bb443});}}})[_0xcfca('0x2d')](function(){var _0x11813d=[];var _0x3f05ff=utils['getChannels']();_0x3f05ff[_0xcfca('0x100')](function(_0x2c05d4){_0x11813d[_0xcfca('0x4b')]({'channel':_0x2c05d4,'membername':_0x112c60[_0xcfca('0x38')],'interface':_[_0xcfca('0x6b')](_0x112c60[_0xcfca('0xa2')])?util[_0xcfca('0xae')](_0xcfca('0xaf'),_0x112c60['name']):_0x112c60[_0xcfca('0xa2')],'type':'PAUSE','enterAt':moment()[_0xcfca('0xae')](_0xcfca('0x101')),'data1':_0x57d247['body'][_0xcfca('0x3f')]||_0xcfca('0x10b'),'role':_0x112c60[_0xcfca('0x2f')],'internal':_0x112c60[_0xcfca('0x65')]});});return db['MemberReport'][_0xcfca('0x105')](_0x11813d,{'individualHooks':!![]});})[_0xcfca('0x2d')](function(){return _0x112c60[_0xcfca('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x57d247['body']['type']||_0xcfca('0x10b'),'lastPauseAt':moment()[_0xcfca('0xae')](_0xcfca('0x101'))});})[_0xcfca('0x2d')](respondWithResult(_0x58375e,null))['catch'](handleError(_0x58375e,null));};exports[_0xcfca('0x10c')]=function(_0x111755,_0xad45d0){if(_0x111755['body']['channel']&&!utils[_0xcfca('0xa3')](_0x111755[_0xcfca('0x60')][_0xcfca('0x9f')])){throw new APIBadRequestError(util['format'](_0xcfca('0x10d'),_0x111755[_0xcfca('0x60')][_0xcfca('0x9f')]));}return db['User']['find']({'where':{'id':_0x111755[_0xcfca('0x55')]['id']},'attributes':['id',_0xcfca('0x38'),_0xcfca('0x2f'),_0xcfca('0x65'),'interface',_0xcfca('0xa0'),'voicePause',_0xcfca('0x10e'),_0xcfca('0x10f'),_0xcfca('0x110'),_0xcfca('0x111'),_0xcfca('0x112'),_0xcfca('0x113'),'pauseType','lastPauseAt']})[_0xcfca('0x2d')](function(_0x2331d9){if(!_0x2331d9){throw new APINotFoundError(util[_0xcfca('0xae')](_0xcfca('0x114'),_0x111755[_0xcfca('0x55')]['id']));}return _0x2331d9[_0xcfca('0x10c')](_0x111755[_0xcfca('0x60')][_0xcfca('0x9f')]);})[_0xcfca('0x2d')](respondWithResult(_0xad45d0,null))['catch'](APIHandleError(_0xad45d0));};exports[_0xcfca('0x115')]=function(_0x48308f,_0x2efcec){var _0x383967={};var _0x270171={};var _0x52ba1a;var _0x30f846;return db[_0xcfca('0x3c')]['findOne']({'where':{'id':_0x48308f['params']['id']}})['then'](handleEntityNotFound(_0x2efcec,null))[_0xcfca('0x2d')](function(_0x524dd0){if(_0x524dd0){_0x52ba1a=_0x524dd0;_0x270171[_0xcfca('0x5a')]=_['keys'](db[_0xcfca('0x116')][_0xcfca('0x3d')]);_0x270171[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x48308f[_0xcfca('0x45')]);_0x270171['filters']=_[_0xcfca('0x59')](_0x270171[_0xcfca('0x5a')],_0x270171[_0xcfca('0x45')]);_0x383967[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x270171[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x48308f['query'][_0xcfca('0x5b')]));_0x383967[_0xcfca('0x4a')]=_0x383967[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x383967[_0xcfca('0x4a')]:_0x270171[_0xcfca('0x5a')];_0x383967[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0x48308f[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x383967[_0xcfca('0x44')]=qs[_0xcfca('0x58')](_[_0xcfca('0xd2')](_0x48308f[_0xcfca('0x45')],_0x270171[_0xcfca('0x58')]));if(_0x48308f['query'][_0xcfca('0xd3')]){_0x383967[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x383967[_0xcfca('0x44')],{'$or':_['map'](_0x383967[_0xcfca('0x4a')],function(_0x1c094d){var _0x540bf6={};_0x540bf6[_0x1c094d]={'$like':'%'+_0x48308f[_0xcfca('0x45')]['filter']+'%'};return _0x540bf6;})});}_0x383967=_[_0xcfca('0x5e')]({},_0x383967,_0x48308f['options']);return _0x52ba1a['getTeams'](_0x383967);}})[_0xcfca('0x2d')](function(_0x1f3149){if(_0x1f3149){_0x30f846=_0x1f3149[_0xcfca('0x5c')];if(!_0x48308f[_0xcfca('0x45')][_0xcfca('0xd4')](_0xcfca('0xda'))){_0x383967[_0xcfca('0x25')]=qs['limit'](_0x48308f[_0xcfca('0x45')][_0xcfca('0x25')]);_0x383967[_0xcfca('0x23')]=qs['offset'](_0x48308f[_0xcfca('0x45')]['offset']);}return _0x52ba1a['getTeams'](_0x383967);}})[_0xcfca('0x2d')](function(_0x2b4263){if(_0x2b4263){return _0x2b4263?{'count':_0x30f846,'rows':_0x2b4263}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x2efcec,null))[_0xcfca('0x1e')](handleError(_0x2efcec,null));};exports[_0xcfca('0x117')]=function(_0x1bebe9,_0x31f7b4){var _0x3946fb=_0x1bebe9[_0xcfca('0x55')]['id'];var _0x2eca88=_0x1bebe9['body']?_0x1bebe9[_0xcfca('0x60')][_0xcfca('0x63')]:null;var _0x219bdb=[];return Promise[_0xcfca('0x107')]()[_0xcfca('0x2d')](function(){if(!_0x2eca88)throw new APIBadRequestError(_0xcfca('0x118'));})['then'](function(){return db['User'][_0xcfca('0x98')]({'where':{'id':_0x3946fb}});})[_0xcfca('0x2d')](function(_0x2c651a){if(!_0x2c651a)throw new APINotFoundError(util[_0xcfca('0xae')](_0xcfca('0x114'),_0x1bebe9[_0xcfca('0x55')]['id']));return db['sequelize'][_0xcfca('0x119')](function(_0xd1c0d6){return _0x2c651a[_0xcfca('0x117')](_0x2eca88,{'transaction':_0xd1c0d6})['then'](function(){return db[_0xcfca('0x116')][_0xcfca('0x4c')]({'where':{'id':{'$in':_0x2eca88}}});})[_0xcfca('0x2d')](function(_0x5c6166){var _0x16c4e9=_['map'](_0x5c6166,function(_0xfa8a4){return _0xfa8a4[_0xcfca('0x11a')]();});return Promise[_0xcfca('0x53')](_0x16c4e9);})[_0xcfca('0x2d')](function(_0x4c3dba){_0x219bdb=_[_0xcfca('0x11b')](_0x4c3dba);var _0x1ccc90=_[_0xcfca('0x35')](_0x219bdb,function(_0x1fe978){return _0x1fe978[_0xcfca('0x11c')](_0x2c651a['id'],{'transaction':_0xd1c0d6});});return Promise[_0xcfca('0x53')](_0x1ccc90);})[_0xcfca('0x2d')](function(){if(!_0x2c651a[_0xcfca('0xa0')])return;var _0x238dfa=_[_0xcfca('0xd3')](_0x219bdb,function(_0x37940a){return _0x37940a['getDataValue']('channel')===_0xcfca('0x11d');});var _0x383254=_['map'](_0x238dfa,function(_0x4507ed){return db[_0xcfca('0xb1')][_0xcfca('0xb2')]({'membername':_0x2c651a[_0xcfca('0x38')],'UserId':_0x2c651a['id'],'queue_name':_0x4507ed[_0xcfca('0x38')],'VoiceQueueId':_0x4507ed['id'],'interface':_['isNil'](_0x2c651a[_0xcfca('0xa2')])?util[_0xcfca('0xae')](_0xcfca('0xaf'),_0x2c651a[_0xcfca('0x38')]):_0x2c651a[_0xcfca('0xa2')],'paused':_0x2c651a[_0xcfca('0xb0')]||![],'penalty':_0x2c651a['penalty']},{'transaction':_0xd1c0d6});});return Promise[_0xcfca('0x53')](_0x383254);})[_0xcfca('0x2d')](function(){return db[_0xcfca('0x11e')][_0xcfca('0x4c')]({'where':{'teamId':{'$in':_0x2eca88}}});})['then'](function(_0x4c6d20){var _0xa35424=_[_0xcfca('0x35')](_0x4c6d20,function(_0x2287e7){return db[_0xcfca('0x11f')][_0xcfca('0x88')]({'UserId':_0x2c651a['id'],'VoicePrefixId':_0x2287e7['VoicePrefixId']},{'transaction':_0xd1c0d6});});return Promise[_0xcfca('0x53')](_0xa35424);});});})['then'](function(){for(var _0x355958=0x0;_0x355958<_0x219bdb[_0xcfca('0x5c')];_0x355958++){var _0x2a311c=_0x219bdb[_0x355958]['getDataValue'](_0xcfca('0x9f'));var _0x40b02c=_0x2a311c+'QueueId';socket[_0xcfca('0x2a')](_0xcfca('0x31')+_0x2a311c+'Queue:save',{'UserId':_0x3946fb,['queueField']:_0x219bdb[_0x355958]['id']});}})['then'](respondWithStatusCode(_0x31f7b4,null))['catch'](APIHandleError(_0x31f7b4));};exports[_0xcfca('0x120')]=function(_0x97930d,_0x14c510){var _0x308c18=_0x97930d[_0xcfca('0x55')]['id'];var _0x151636=null;if(_0x97930d[_0xcfca('0x45')][_0xcfca('0x63')]){_0x151636=_[_0xcfca('0xb6')](_0x97930d[_0xcfca('0x45')][_0xcfca('0x63')])?_0x97930d[_0xcfca('0x45')][_0xcfca('0x63')]:[_0x97930d[_0xcfca('0x45')][_0xcfca('0x63')]];}var _0x3e097c=[];return Promise['resolve']()[_0xcfca('0x2d')](function(){if(!_0x151636)throw new APIBadRequestError(_0xcfca('0x121'));})[_0xcfca('0x2d')](function(){return db['User']['findOne']({'where':{'id':_0x308c18}});})[_0xcfca('0x2d')](function(_0x3ab452){if(!_0x3ab452)throw new APINotFoundError(util[_0xcfca('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0x97930d[_0xcfca('0x55')]['id']));return db['sequelize']['transaction'](function(_0x3f493e){return _0x3ab452['removeTeams'](_0x151636,{'transaction':_0x3f493e})[_0xcfca('0x2d')](function(){return db[_0xcfca('0x116')][_0xcfca('0x4c')]({'where':{'id':{'$in':_0x151636}}});})['then'](function(_0x72abe){var _0x4ff7b8=_[_0xcfca('0x35')](_0x72abe,function(_0x10483e){return _0x10483e['getAssociatedQueues']();});return Promise[_0xcfca('0x53')](_0x4ff7b8);})[_0xcfca('0x2d')](function(_0x17a810){_0x3e097c=_[_0xcfca('0x11b')](_0x17a810);var _0x44e5b2=_[_0xcfca('0x35')](_0x3e097c,function(_0x44a728){return _0x44a728[_0xcfca('0x122')](_0x3ab452['id'],{'transaction':_0x3f493e});});return Promise[_0xcfca('0x53')](_0x44e5b2);})['then'](function(){if(!_0x3ab452[_0xcfca('0xa0')])return;var _0xdfb707=_['filter'](_0x3e097c,function(_0xc78fa9){return _0xc78fa9[_0xcfca('0x123')](_0xcfca('0x9f'))===_0xcfca('0x11d');});var _0x33a715=_[_0xcfca('0x35')](_0xdfb707,function(_0xa0d9b6){return db[_0xcfca('0xb1')][_0xcfca('0x2c')]({'where':{'VoiceQueueId':_0xa0d9b6['id'],'UserId':_0x3ab452['id']},'transaction':_0x3f493e});});return Promise[_0xcfca('0x53')](_0x33a715);})[_0xcfca('0x2d')](function(){return db[_0xcfca('0x11e')][_0xcfca('0x4c')]({'where':{'teamId':{'$in':_0x151636}}});})[_0xcfca('0x2d')](function(_0x38fa48){var _0x57ab73=_['map'](_0x38fa48,function(_0x456a7c){return db[_0xcfca('0x11f')]['destroy']({'where':{'UserId':_0x3ab452['id'],'VoicePrefixId':_0x456a7c['VoicePrefixId']}},{'transaction':_0x3f493e});});return Promise['all'](_0x57ab73);});});})[_0xcfca('0x2d')](function(){for(var _0x5d3654=0x0;_0x5d3654<_0x3e097c['length'];_0x5d3654++){var _0x2c0fe7=_0x3e097c[_0x5d3654]['getDataValue'](_0xcfca('0x9f'));var _0x4dd4c0=_0x2c0fe7+_0xcfca('0xaa');socket[_0xcfca('0x2a')]('user'+_0x2c0fe7+_0xcfca('0xb7'),{'UserId':_0x308c18,['queueField']:_0x3e097c[_0x5d3654]['id']});}})[_0xcfca('0x2d')](respondWithStatusCode(_0x14c510,null))[_0xcfca('0x1e')](APIHandleError(_0x14c510));};exports['getLists']=function(_0xed8ce4,_0x29f70f){var _0x153933={};var _0x2c7cb1={};var _0x4f5faf;var _0x5c86d7;return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0xed8ce4['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x29f70f,null))[_0xcfca('0x2d')](function(_0x566c5b){if(_0x566c5b){_0x4f5faf=_0x566c5b;_0x2c7cb1[_0xcfca('0x5a')]=_['keys'](db[_0xcfca('0xd5')][_0xcfca('0x3d')]);_0x2c7cb1[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0xed8ce4[_0xcfca('0x45')]);_0x2c7cb1[_0xcfca('0x58')]=_[_0xcfca('0x59')](_0x2c7cb1[_0xcfca('0x5a')],_0x2c7cb1['query']);_0x153933[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x2c7cb1[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0xed8ce4[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x153933['attributes']=_0x153933['attributes'][_0xcfca('0x5c')]?_0x153933[_0xcfca('0x4a')]:_0x2c7cb1[_0xcfca('0x5a')];_0x153933[_0xcfca('0xd0')]=qs[_0xcfca('0xd1')](_0xed8ce4['query'][_0xcfca('0xd1')]);_0x153933[_0xcfca('0x44')]=qs['filters'](_[_0xcfca('0xd2')](_0xed8ce4[_0xcfca('0x45')],_0x2c7cb1[_0xcfca('0x58')]));if(_0xed8ce4[_0xcfca('0x45')]['filter']){_0x153933[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x153933[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x153933[_0xcfca('0x4a')],function(_0xdce8b8){var _0x1986ab={};_0x1986ab[_0xdce8b8]={'$like':'%'+_0xed8ce4['query'][_0xcfca('0xd3')]+'%'};return _0x1986ab;})});}_0x153933=_[_0xcfca('0x5e')]({},_0x153933,_0xed8ce4[_0xcfca('0x5f')]);return _0x4f5faf[_0xcfca('0x124')](_0x153933);}})[_0xcfca('0x2d')](function(_0x20e895){if(_0x20e895){_0x5c86d7=_0x20e895['length'];if(!_0xed8ce4['query']['hasOwnProperty'](_0xcfca('0xda'))){_0x153933[_0xcfca('0x25')]=qs[_0xcfca('0x25')](_0xed8ce4[_0xcfca('0x45')][_0xcfca('0x25')]);_0x153933[_0xcfca('0x23')]=qs[_0xcfca('0x23')](_0xed8ce4[_0xcfca('0x45')][_0xcfca('0x23')]);}return _0x4f5faf['getLists'](_0x153933);}})[_0xcfca('0x2d')](function(_0x37b2c9){if(_0x37b2c9){return _0x37b2c9?{'count':_0x5c86d7,'rows':_0x37b2c9}:null;}})[_0xcfca('0x2d')](respondWithResult(_0x29f70f,null))[_0xcfca('0x1e')](handleError(_0x29f70f,null));};exports['getAgents']=function(_0x4d73c5,_0x367938){var _0x125c42={};var _0x317a7d={};var _0x4a5def;return db[_0xcfca('0x3c')][_0xcfca('0x98')]({'where':{'id':_0x4d73c5['params']['id']}})[_0xcfca('0x2d')](handleEntityNotFound(_0x367938,null))[_0xcfca('0x2d')](function(_0x2a037d){if(_0x2a037d){_0x4a5def=_0x2a037d;_0x317a7d['model']=_[_0xcfca('0x57')](db[_0xcfca('0x3c')][_0xcfca('0x3d')]);_0x317a7d[_0xcfca('0x45')]=_[_0xcfca('0x57')](_0x4d73c5[_0xcfca('0x45')]);_0x317a7d['filters']=_['intersection'](_0x317a7d[_0xcfca('0x5a')],_0x317a7d[_0xcfca('0x45')]);_0x125c42[_0xcfca('0x4a')]=_[_0xcfca('0x59')](_0x317a7d[_0xcfca('0x5a')],qs[_0xcfca('0x5b')](_0x4d73c5[_0xcfca('0x45')][_0xcfca('0x5b')]));_0x125c42[_0xcfca('0x4a')]=_0x125c42[_0xcfca('0x4a')][_0xcfca('0x5c')]?_0x125c42[_0xcfca('0x4a')]:_0x317a7d[_0xcfca('0x5a')];_0x125c42[_0xcfca('0xd0')]=qs['sort'](_0x4d73c5[_0xcfca('0x45')][_0xcfca('0xd1')]);_0x125c42[_0xcfca('0x44')]=qs['filters'](_[_0xcfca('0xd2')](_0x4d73c5[_0xcfca('0x45')],_0x317a7d['filters']));if(_0x4d73c5[_0xcfca('0x45')][_0xcfca('0xd3')]){_0x125c42[_0xcfca('0x44')]=_[_0xcfca('0x5e')](_0x125c42[_0xcfca('0x44')],{'$or':_[_0xcfca('0x35')](_0x125c42[_0xcfca('0x4a')],function(_0x350e52){var _0x5403ec={};_0x5403ec[_0x350e52]={'$like':'%'+_0x4d73c5[_0xcfca('0x45')][_0xcfca('0xd3')]+'%'};return _0x5403ec;})});}_0x125c42[_0xcfca('0x5a')]=db[_0xcfca('0x3c')];_0x125c42['as']='Agents';_0x125c42=_[_0xcfca('0x5e')]({},_0x125c42,_0x4d73c5[_0xcfca('0x5f')]);return _0x4a5def[_0xcfca('0xfd')]({'include':[_0x125c42]});}})[_0xcfca('0x2d')](function(_0x348799){if(_0x348799){var _0x2b6ae2={},_0x6ad89f=[];for(var _0x1c0110=0x0;_0x1c0110<_0x348799['length'];_0x1c0110+=0x1){for(var _0x40611e=0x0,_0x2e4338;_0x40611e<_0x348799[_0x1c0110][_0xcfca('0x86')][_0xcfca('0x5c')];_0x40611e+=0x1){_0x2e4338=_0x348799[_0x1c0110][_0xcfca('0x86')][_0x40611e][_0xcfca('0x2e')]({'plain':!![]});_0x2b6ae2[_0x2e4338['id']]=_0x2e4338;}}_0x2b6ae2=_['values'](_0x2b6ae2);for(var _0x5f1a6e=qs['offset'](_0x4d73c5[_0xcfca('0x45')]['offset']);_0x5f1a6e<_0x2b6ae2[_0xcfca('0x5c')]&&_0x6ad89f[_0xcfca('0x5c')]=_0x854f3b['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4e50('0x11')](function(){if(_0x4a2182){return db[_0x4e50('0x1f')][_0x4e50('0x40')]({'where':{'membername':_0x4a2182[_0x4e50('0x1c')]},'individualHooks':!![]});}})['then'](function(){if(_0x4a2182){return _0x4a2182['getVoiceQueues']({'raw':!![]});}})[_0x4e50('0x11')](function(_0x27d47f){if(_0x4a2182){if(_0x27d47f){var _0x3b6d36=[];_0x5b4bfa=_0x27d47f;if(_0x5b4bfa[_0x4e50('0x41')]){for(var _0x93889f=0x0;_0x93889f<_0x5b4bfa[_0x4e50('0x41')];_0x93889f++){_0x3b6d36[_0x4e50('0x26')](db[_0x4e50('0x1f')][_0x4e50('0x4a')]({'membername':_0x4a2182['name'],'UserId':_0x4a2182['id'],'queue_name':_0x5b4bfa[_0x93889f][_0x4e50('0x1c')],'VoiceQueueId':_0x5b4bfa[_0x93889f]['id'],'interface':_0x3ec0d7,'paused':_0x4a2182[_0x4e50('0x45')]||![],'penalty':_0x5b4bfa[_0x93889f][_0x4e50('0x4b')]||0x0}));}return BPromise[_0x4e50('0x42')](_0x3b6d36);}}}})['then'](function(){if(_0x4a2182){return db[_0x4e50('0x20')][_0x4e50('0x21')]({'where':{'membername':_0x4a2182[_0x4e50('0x1c')],'exitAt':null}});}})[_0x4e50('0x11')](function(_0x47d509){if(_0x4a2182){if(_0x47d509&&_0x47d509[_0x4e50('0x41')]){var _0x93553=[];_0x47d509[_0x4e50('0x25')](function(_0x507695){_0x93553[_0x4e50('0x26')](_0x507695[_0x4e50('0x2e')]({'exitAt':moment()[_0x4e50('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x93553);}}})['then'](function(){if(_0x4a2182){var _0x35848c=[];var _0x281edf=[];var _0x2cf27b=utils[_0x4e50('0x4c')]();var _0x212e99={'membername':_0x4a2182[_0x4e50('0x1c')],'interface':_0x3ec0d7,'enterAt':moment()['format'](_0x4e50('0x23')),'role':_0x4a2182[_0x4e50('0x2b')],'internal':_0x4a2182[_0x4e50('0x1d')]};_0x2cf27b[_0x4e50('0x25')](function(_0x2ca734){_0x35848c[_0x4e50('0x26')](_[_0x4e50('0x4d')]({'channel':_0x2ca734,'type':_0x4e50('0x4e'),'data1':_0x4e50('0x4f'),'data2':_0x3ec0d7},_0x212e99));if(_0x4a2182['loginInPause']){_0x281edf[_0x4e50('0x26')](_[_0x4e50('0x4d')]({'channel':_0x2ca734,'type':_0x4e50('0x27'),'data1':_0x4e50('0x50')},_0x212e99));}});return db[_0x4e50('0x20')]['bulkCreate'](_0x35848c[_0x4e50('0x51')](_0x281edf),{'individualHooks':!![]});}})[_0x4e50('0x11')](function(){if(_0x4a2182){return _0x4a2182[_0x4e50('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x4e50('0x22')](_0x4e50('0x23')),'voicePause':_0x4a2182[_0x4e50('0x45')]||![],'mailPause':_0x4a2182[_0x4e50('0x45')]||![],'chatPause':_0x4a2182['loginInPause']||![],'faxPause':_0x4a2182[_0x4e50('0x45')]||![],'smsPause':_0x4a2182['loginInPause']||![],'openchannelPause':_0x4a2182[_0x4e50('0x45')]||![],'pauseType':_0x4a2182[_0x4e50('0x45')]?_0x4e50('0x50'):null,'lastPauseAt':moment()['format'](_0x4e50('0x23')),'interface':_0x3ec0d7});}})[_0x4e50('0x11')](function(_0x24a244){_0x4d7aac(_0x24a244);})[_0x4e50('0x14')](function(_0x20e501){_0x17196f(_0xe94a6d['error'](0x1f4,_0x20e501['message']));});});}; \ No newline at end of file +var _0x41e0=['internal','interface','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','format','SIP/%s','body','type','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','system','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','redis','defaults','socket.io-emitter','register','GetUser','User','options','raw','where','attributes','include','map','model','then','info','stringify','catch','error','message','ShowUser','find','debug','PauseUser','name','role'];(function(_0x1ca282,_0x38ad9b){var _0x3c92eb=function(_0x1a3a63){while(--_0x1a3a63){_0x1ca282['push'](_0x1ca282['shift']());}};_0x3c92eb(++_0x38ad9b);}(_0x41e0,0x91));var _0x041e=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x41e0[_0x2b8347];return _0x15e93e;};'use strict';var _=require(_0x041e('0x0'));var util=require('util');var moment=require(_0x041e('0x1'));var BPromise=require(_0x041e('0x2'));var Redis=require(_0x041e('0x3'));var db=require(_0x041e('0x4'))['db'];var utils=require(_0x041e('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config[_0x041e('0x6')]=_[_0x041e('0x7')](config[_0x041e('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x041e('0x8'))(new Redis(config[_0x041e('0x6')]));require('./user.socket')[_0x041e('0x9')](socket);exports[_0x041e('0xa')]=function(_0x4590dd){var _0x2eca8f=this;return new Promise(function(_0x1f710f,_0x374422){return db[_0x041e('0xb')]['findAll']({'raw':_0x4590dd['options']?_0x4590dd[_0x041e('0xc')][_0x041e('0xd')]===undefined?!![]:![]:!![],'where':_0x4590dd[_0x041e('0xc')]?_0x4590dd[_0x041e('0xc')][_0x041e('0xe')]||null:null,'attributes':_0x4590dd[_0x041e('0xc')]?_0x4590dd[_0x041e('0xc')][_0x041e('0xf')]||null:null,'limit':_0x4590dd[_0x041e('0xc')]?_0x4590dd[_0x041e('0xc')]['limit']||null:null,'include':_0x4590dd['options']?_0x4590dd[_0x041e('0xc')][_0x041e('0x10')]?_[_0x041e('0x11')](_0x4590dd[_0x041e('0xc')]['include'],function(_0x28ea51){return{'model':db[_0x28ea51[_0x041e('0x12')]],'as':_0x28ea51['as'],'attributes':_0x28ea51[_0x041e('0xf')],'include':_0x28ea51[_0x041e('0x10')]?_[_0x041e('0x11')](_0x28ea51[_0x041e('0x10')],function(_0x5bc9a6){return{'model':db[_0x5bc9a6[_0x041e('0x12')]],'as':_0x5bc9a6['as'],'attributes':_0x5bc9a6['attributes'],'include':_0x5bc9a6[_0x041e('0x10')]?_['map'](_0x5bc9a6[_0x041e('0x10')],function(_0x4eefc6){return{'model':db[_0x4eefc6[_0x041e('0x12')]],'as':_0x4eefc6['as'],'attributes':_0x4eefc6[_0x041e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x041e('0x13')](function(_0x527275){logger[_0x041e('0x14')](_0x041e('0xa'),_0x4590dd);logger['debug'](_0x041e('0xa'),_0x4590dd,JSON[_0x041e('0x15')](_0x527275));_0x1f710f(_0x527275);})[_0x041e('0x16')](function(_0x35d5b1){logger[_0x041e('0x17')]('GetUser',_0x35d5b1[_0x041e('0x18')],_0x4590dd);_0x374422(_0x2eca8f[_0x041e('0x17')](0x1f4,_0x35d5b1[_0x041e('0x18')]));});});};exports[_0x041e('0x19')]=function(_0x5804e1){var _0x3897c6=this;return new Promise(function(_0x4d19f9,_0x22284a){return db[_0x041e('0xb')][_0x041e('0x1a')]({'raw':_0x5804e1[_0x041e('0xc')]?_0x5804e1[_0x041e('0xc')][_0x041e('0xd')]===undefined?!![]:![]:!![],'where':_0x5804e1[_0x041e('0xc')]?_0x5804e1[_0x041e('0xc')]['where']||null:null,'attributes':_0x5804e1['options']?_0x5804e1[_0x041e('0xc')][_0x041e('0xf')]||null:null,'include':_0x5804e1[_0x041e('0xc')]?_0x5804e1[_0x041e('0xc')][_0x041e('0x10')]?_[_0x041e('0x11')](_0x5804e1[_0x041e('0xc')][_0x041e('0x10')],function(_0x45f712){return{'model':db[_0x45f712['model']],'as':_0x45f712['as'],'attributes':_0x45f712[_0x041e('0xf')],'include':_0x45f712['include']?_[_0x041e('0x11')](_0x45f712[_0x041e('0x10')],function(_0x4f00c5){return{'model':db[_0x4f00c5[_0x041e('0x12')]],'as':_0x4f00c5['as'],'attributes':_0x4f00c5[_0x041e('0xf')],'include':_0x4f00c5[_0x041e('0x10')]?_[_0x041e('0x11')](_0x4f00c5[_0x041e('0x10')],function(_0x440ce0){return{'model':db[_0x440ce0[_0x041e('0x12')]],'as':_0x440ce0['as'],'attributes':_0x440ce0[_0x041e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x041e('0x13')](function(_0x22268b){logger[_0x041e('0x14')](_0x041e('0x19'),_0x5804e1);logger[_0x041e('0x1b')]('ShowUser',_0x5804e1,JSON[_0x041e('0x15')](_0x22268b));_0x4d19f9(_0x22268b);})['catch'](function(_0x21aaa7){logger['error'](_0x041e('0x19'),_0x21aaa7[_0x041e('0x18')],_0x5804e1);_0x22284a(_0x3897c6[_0x041e('0x17')](0x1f4,_0x21aaa7['message']));});});};exports[_0x041e('0x1c')]=function(_0x2d07d3){var _0x247cc7=this;return new Promise(function(_0x3ddb76,_0x42e0b5){var _0x40706c;return db[_0x041e('0xb')][_0x041e('0x1a')]({'where':_0x2d07d3[_0x041e('0xc')][_0x041e('0xe')]||{},'attributes':['id',_0x041e('0x1d'),_0x041e('0x1e'),_0x041e('0x1f'),_0x041e('0x20')]})[_0x041e('0x13')](function(_0x55f1d4){if(_0x55f1d4){_0x40706c=_0x55f1d4;return db[_0x041e('0x21')][_0x041e('0x22')]({'paused':0x1},{'where':{'UserId':_0x40706c['id']},'individualHooks':!![]});}})[_0x041e('0x13')](function(){if(_0x40706c){return db[_0x041e('0x23')][_0x041e('0x24')]({'where':{'membername':_0x40706c['name'],'type':_0x041e('0x25'),'exitAt':null}});}})[_0x041e('0x13')](function(_0x569663){if(_0x40706c){if(_0x569663&&_0x569663['length']){var _0x14bff6=moment()['format'](_0x041e('0x26'));for(var _0x40fe9f=0x0,_0x3859ae=_0x569663[_0x041e('0x27')];_0x40fe9f<_0x3859ae;_0x40fe9f++){_0x569663[_0x40fe9f][_0x041e('0x28')]({'exitAt':_0x14bff6});}}}})[_0x041e('0x13')](function(){if(_0x40706c){var _0x3ec542=[];var _0x2b8893=utils[_0x041e('0x29')]();_0x2b8893[_0x041e('0x2a')](function(_0x4cf5c4){_0x3ec542[_0x041e('0x2b')]({'channel':_0x4cf5c4,'membername':_0x40706c[_0x041e('0x1d')],'interface':_[_0x041e('0x2c')](_0x40706c['interface'])?util[_0x041e('0x2d')](_0x041e('0x2e'),_0x40706c[_0x041e('0x1d')]):_0x40706c[_0x041e('0x20')],'type':_0x041e('0x25'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2d07d3[_0x041e('0x2f')][_0x041e('0x30')]||'DEFAULT\x20PAUSE','role':_0x40706c[_0x041e('0x1e')],'internal':_0x40706c[_0x041e('0x1f')],'uniqueid':_0x2d07d3[_0x041e('0x2f')]['uniqueid']||null});});return db[_0x041e('0x23')][_0x041e('0x31')](_0x3ec542,{'individualHooks':!![]});}})[_0x041e('0x13')](function(){if(_0x40706c){return _0x40706c[_0x041e('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2d07d3[_0x041e('0x2f')][_0x041e('0x30')]||_0x041e('0x32'),'lastPauseAt':moment()[_0x041e('0x2d')](_0x041e('0x26'))});}})[_0x041e('0x13')](function(_0x10c731){_0x3ddb76(_0x10c731);})[_0x041e('0x16')](function(_0x29b385){_0x42e0b5(_0x247cc7[_0x041e('0x17')](0x1f4,_0x29b385[_0x041e('0x18')]));});});};exports[_0x041e('0x33')]=function(_0x2e81b7){var _0xff54c4=this;return new Promise(function(_0x24a96b,_0x51825a){if(_0x2e81b7[_0x041e('0x2f')][_0x041e('0x34')]&&!utils[_0x041e('0x35')](_0x2e81b7[_0x041e('0x2f')]['channel'])){throw new Error(util['format'](_0x041e('0x36'),_0x2e81b7[_0x041e('0x2f')][_0x041e('0x34')]));}return db['User'][_0x041e('0x37')]({'where':_0x2e81b7[_0x041e('0xc')][_0x041e('0xe')]||{},'attributes':['id',_0x041e('0x1d'),'role',_0x041e('0x1f'),_0x041e('0x20'),'online',_0x041e('0x38'),_0x041e('0x39'),_0x041e('0x3a'),_0x041e('0x3b'),_0x041e('0x3c'),_0x041e('0x3d'),_0x041e('0x3e'),_0x041e('0x3f'),_0x041e('0x40')]})[_0x041e('0x13')](function(_0x1c9460){if(!_0x1c9460){throw new Error(util['format'](_0x041e('0x41'),_0x2e81b7[_0x041e('0x42')]['id']));}return _0x1c9460[_0x041e('0x43')](_0x2e81b7[_0x041e('0x2f')][_0x041e('0x34')],_0x041e('0x44'));})[_0x041e('0x13')](function(_0x3c763a){_0x24a96b(_0x3c763a);})[_0x041e('0x16')](function(_0x294968){_0x51825a(_0xff54c4[_0x041e('0x17')](0x1f4,_0x294968[_0x041e('0x18')]));});});};exports[_0x041e('0x45')]=function(_0x3337fa){var _0x28f930=this;return new Promise(function(_0xad8519,_0x1b9351){var _0x121281;return db[_0x041e('0xb')][_0x041e('0x37')]({'where':_0x3337fa[_0x041e('0xc')][_0x041e('0xe')]||{},'attributes':['id',_0x041e('0x1d')]})[_0x041e('0x13')](function(_0x30b0cd){if(_0x30b0cd){_0x121281=_0x30b0cd;return db[_0x041e('0x21')][_0x041e('0x46')]({'where':{'membername':_0x121281[_0x041e('0x1d')]},'individualHooks':!![]});}})[_0x041e('0x13')](function(){if(_0x121281){return db['MemberReport'][_0x041e('0x24')]({'where':{'membername':_0x121281[_0x041e('0x1d')],'exitAt':null}});}})[_0x041e('0x13')](function(_0x35a9e3){if(_0x121281){if(_0x35a9e3&&_0x35a9e3[_0x041e('0x27')]){var _0x1ad5fe=[];_0x35a9e3[_0x041e('0x2a')](function(_0x206dbe){_0x1ad5fe[_0x041e('0x2b')](_0x206dbe[_0x041e('0x22')]({'exitAt':moment()[_0x041e('0x2d')](_0x041e('0x26'))}));});return BPromise[_0x041e('0x47')](_0x1ad5fe);}}})[_0x041e('0x13')](function(){if(_0x121281){return _0x121281[_0x041e('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x041e('0x13')](function(_0x22aa7a){_0xad8519(_0x22aa7a);})[_0x041e('0x16')](function(_0x5e4ac0){_0x1b9351(_0x28f930[_0x041e('0x17')](0x1f4,_0x5e4ac0[_0x041e('0x18')]));});});};exports[_0x041e('0x48')]=function(_0x44e7a5){var _0x46e877=this;return new Promise(function(_0x5827e8,_0x39ca37){var _0x1d4d14;var _0x3cc68e;var _0x2207f4;var _0x3fdf94;return db[_0x041e('0xb')][_0x041e('0x37')]({'where':_0x44e7a5[_0x041e('0xc')]['where']||{},'attributes':['id',_0x041e('0x1d'),_0x041e('0x1e'),_0x041e('0x49'),_0x041e('0x4a'),_0x041e('0x1f'),_0x041e('0x4b'),_0x041e('0x20')]})['then'](function(_0x20bd34){if(_0x20bd34){_0x1d4d14=_0x20bd34;_0x3fdf94=_0x44e7a5[_0x041e('0x2f')]['interface']?_0x44e7a5[_0x041e('0x2f')][_0x041e('0x20')]:util[_0x041e('0x2d')](_0x041e('0x2e'),_0x1d4d14[_0x041e('0x1d')]);return db[_0x041e('0xb')][_0x041e('0x4c')]({'where':{'role':_0x041e('0x4d'),'online':!![],'id':{'$ne':_0x1d4d14['id']}}});}})[_0x041e('0x13')](function(_0x22fc93){if(_0x22fc93){_0x2207f4=_0x22fc93;return require(_0x041e('0x4e'))['getLicense']();}})[_0x041e('0x13')](function(_0x40b7bb){if(_0x40b7bb&&_0x40b7bb[_0x041e('0x4f')]&&_0x2207f4>=_0x40b7bb[_0x041e('0x4f')]){throw new Error(_0x041e('0x50'));}})['then'](function(){if(_0x1d4d14){return db[_0x041e('0x21')][_0x041e('0x46')]({'where':{'membername':_0x1d4d14[_0x041e('0x1d')]},'individualHooks':!![]});}})[_0x041e('0x13')](function(){if(_0x1d4d14){return _0x1d4d14[_0x041e('0x51')]({'raw':!![]});}})[_0x041e('0x13')](function(_0x41585f){if(_0x1d4d14){if(_0x41585f){var _0x1d2eeb=[];_0x3cc68e=_0x41585f;if(_0x3cc68e['length']){for(var _0x59b8ea=0x0;_0x59b8ea<_0x3cc68e[_0x041e('0x27')];_0x59b8ea++){_0x1d2eeb[_0x041e('0x2b')](db[_0x041e('0x21')][_0x041e('0x52')]({'membername':_0x1d4d14['name'],'UserId':_0x1d4d14['id'],'queue_name':_0x3cc68e[_0x59b8ea][_0x041e('0x1d')],'VoiceQueueId':_0x3cc68e[_0x59b8ea]['id'],'interface':_0x3fdf94,'paused':_0x1d4d14[_0x041e('0x4b')]||![],'penalty':_0x3cc68e[_0x59b8ea][_0x041e('0x53')]||0x0}));}return BPromise['all'](_0x1d2eeb);}}}})[_0x041e('0x13')](function(){if(_0x1d4d14){return db[_0x041e('0x23')][_0x041e('0x24')]({'where':{'membername':_0x1d4d14['name'],'exitAt':null}});}})[_0x041e('0x13')](function(_0x18b9f8){if(_0x1d4d14){if(_0x18b9f8&&_0x18b9f8['length']){var _0x3840f3=[];_0x18b9f8[_0x041e('0x2a')](function(_0x14e1f3){_0x3840f3[_0x041e('0x2b')](_0x14e1f3[_0x041e('0x22')]({'exitAt':moment()[_0x041e('0x2d')](_0x041e('0x26'))}));});return BPromise[_0x041e('0x47')](_0x3840f3);}}})['then'](function(){if(_0x1d4d14){var _0x1adaac=[];var _0x225b7a=[];var _0x3861c0=utils[_0x041e('0x29')]();var _0x12ebfb={'membername':_0x1d4d14[_0x041e('0x1d')],'interface':_0x3fdf94,'enterAt':moment()[_0x041e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1d4d14[_0x041e('0x1e')],'internal':_0x1d4d14[_0x041e('0x1f')]};_0x3861c0[_0x041e('0x2a')](function(_0xfbd435){_0x1adaac[_0x041e('0x2b')](_[_0x041e('0x54')]({'channel':_0xfbd435,'type':_0x041e('0x55'),'data1':_0x041e('0x56'),'data2':_0x3fdf94},_0x12ebfb));if(_0x1d4d14[_0x041e('0x4b')]){_0x225b7a[_0x041e('0x2b')](_['merge']({'channel':_0xfbd435,'type':'PAUSE','data1':_0x041e('0x57')},_0x12ebfb));}});return db[_0x041e('0x23')][_0x041e('0x31')](_0x1adaac['concat'](_0x225b7a),{'individualHooks':!![]});}})[_0x041e('0x13')](function(){if(_0x1d4d14){return _0x1d4d14[_0x041e('0x22')]({'online':!![],'lastLoginAt':moment()[_0x041e('0x2d')](_0x041e('0x26')),'voicePause':_0x1d4d14[_0x041e('0x4b')]||![],'mailPause':_0x1d4d14[_0x041e('0x4b')]||![],'chatPause':_0x1d4d14[_0x041e('0x4b')]||![],'faxPause':_0x1d4d14[_0x041e('0x4b')]||![],'smsPause':_0x1d4d14[_0x041e('0x4b')]||![],'openchannelPause':_0x1d4d14['loginInPause']||![],'pauseType':_0x1d4d14['loginInPause']?_0x041e('0x57'):null,'lastPauseAt':moment()[_0x041e('0x2d')](_0x041e('0x26')),'interface':_0x3fdf94});}})['then'](function(_0x3a0a82){_0x5827e8(_0x3a0a82);})['catch'](function(_0x41862b){_0x39ca37(_0x46e877[_0x041e('0x17')](0x1f4,_0x41862b['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 4939165..58a82f3 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 _0xed01=['register','length','save','remove','update','removeListener'];(function(_0x1c02f6,_0x4c1130){var _0xd2fbe3=function(_0x34a758){while(--_0x34a758){_0x1c02f6['push'](_0x1c02f6['shift']());}};_0xd2fbe3(++_0x4c1130);}(_0xed01,0x158));var _0x1ed0=function(_0x51916e,_0x1c627e){_0x51916e=_0x51916e-0x0;var _0x450daf=_0xed01[_0x51916e];return _0x450daf;};'use strict';var UserEvents=require('./user.events');var events=[_0x1ed0('0x0'),_0x1ed0('0x1'),_0x1ed0('0x2')];function createListener(_0x415f9f,_0x3afbcd){return function(_0x58a925){_0x3afbcd['emit'](_0x415f9f,_0x58a925);};}function removeListener(_0x2bb486,_0x2a5bec){return function(){UserEvents[_0x1ed0('0x3')](_0x2bb486,_0x2a5bec);};}exports[_0x1ed0('0x4')]=function(_0x12c8d7){for(var _0x3272c2=0x0,_0x321685=events[_0x1ed0('0x5')];_0x3272c2<_0x321685;_0x3272c2++){var _0x1c515c=events[_0x3272c2];var _0x4bd246=createListener('user:'+_0x1c515c,_0x12c8d7);UserEvents['on'](_0x1c515c,_0x4bd246);}}; \ No newline at end of file +var _0xebf9=['length','user:','./user.events','save','update','emit','removeListener','register'];(function(_0x560589,_0x3889f0){var _0x386054=function(_0x3cba96){while(--_0x3cba96){_0x560589['push'](_0x560589['shift']());}};_0x386054(++_0x3889f0);}(_0xebf9,0x8a));var _0x9ebf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xebf9[_0x20a584];return _0x4b41a8;};'use strict';var UserEvents=require(_0x9ebf('0x0'));var events=[_0x9ebf('0x1'),'remove',_0x9ebf('0x2')];function createListener(_0x21b0c6,_0x5ea77b){return function(_0xd68db5){_0x5ea77b[_0x9ebf('0x3')](_0x21b0c6,_0xd68db5);};}function removeListener(_0x29b8af,_0x18dfb2){return function(){UserEvents[_0x9ebf('0x4')](_0x29b8af,_0x18dfb2);};}exports[_0x9ebf('0x5')]=function(_0x5e375d){for(var _0x860296=0x0,_0x41bf2c=events[_0x9ebf('0x6')];_0x860296<_0x41bf2c;_0x860296++){var _0x25a91b=events[_0x860296];var _0x5ca2e6=createListener(_0x9ebf('0x7')+_0x25a91b,_0x5e375d);UserEvents['on'](_0x25a91b,_0x5ca2e6);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6e551be..7260fa8 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x253cb0,_0x1bdd2d){var _0x7be9d6=function(_0x2ffe4c){while(--_0x2ffe4c){_0x253cb0['push'](_0x253cb0['shift']());}};_0x7be9d6(++_0x1bdd2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x38deb6,_0x587445){var _0x3cf12e=function(_0x4d178b){while(--_0x4d178b){_0x38deb6['push'](_0x38deb6['shift']());}};_0x3cf12e(++_0x587445);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index c5e7498..e1b8618 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 _0x8fda=['INTEGER'];(function(_0x4c43d0,_0x18f21b){var _0x403852=function(_0x34cac4){while(--_0x34cac4){_0x4c43d0['push'](_0x4c43d0['shift']());}};_0x403852(++_0x18f21b);}(_0x8fda,0x1eb));var _0xa8fd=function(_0x261a3d,_0x5925a9){_0x261a3d=_0x261a3d-0x0;var _0xdef77b=_0x8fda[_0x261a3d];return _0xdef77b;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa8fd('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd29f=['exports','sequelize'];(function(_0x20ede6,_0x5659fc){var _0x16efbd=function(_0x30378f){while(--_0x30378f){_0x20ede6['push'](_0x20ede6['shift']());}};_0x16efbd(++_0x5659fc);}(_0xd29f,0x13d));var _0xfd29=function(_0x45862f,_0xf5f0a6){_0x45862f=_0x45862f-0x0;var _0x35b20b=_0xd29f[_0x45862f];return _0x35b20b;};'use strict';var Sequelize=require(_0xfd29('0x0'));module[_0xfd29('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 0fa642a..e668f1b 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 _0xc3dd=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','lodash','util'];(function(_0x245d65,_0xe6ae06){var _0xd651af=function(_0xc48dfc){while(--_0xc48dfc){_0x245d65['push'](_0x245d65['shift']());}};_0xd651af(++_0xe6ae06);}(_0xc3dd,0x8e));var _0xdc3d=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xc3dd[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0xdc3d('0x0'));var util=require(_0xdc3d('0x1'));var logger=require(_0xdc3d('0x2'))(_0xdc3d('0x3'));var moment=require(_0xdc3d('0x4'));var BPromise=require(_0xdc3d('0x5'));var rp=require(_0xdc3d('0x6'));var fs=require('fs');var path=require(_0xdc3d('0x7'));var rimraf=require('rimraf');var config=require(_0xdc3d('0x8'));var attributes=require(_0xdc3d('0x9'));module[_0xdc3d('0xa')]=function(_0x10f48f,_0x40dd68){return _0x10f48f['define'](_0xdc3d('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger'];(function(_0x1c9196,_0x3fb9cc){var _0x15afb3=function(_0x1aa273){while(--_0x1aa273){_0x1c9196['push'](_0x1c9196['shift']());}};_0x15afb3(++_0x3fb9cc);}(_0xafc1,0x136));var _0x1afc=function(_0xc297f0,_0x341738){_0xc297f0=_0xc297f0-0x0;var _0x2579b4=_0xafc1[_0xc297f0];return _0x2579b4;};'use strict';var _=require(_0x1afc('0x0'));var util=require('util');var logger=require(_0x1afc('0x1'))('api');var moment=require(_0x1afc('0x2'));var BPromise=require(_0x1afc('0x3'));var rp=require(_0x1afc('0x4'));var fs=require('fs');var path=require(_0x1afc('0x5'));var rimraf=require(_0x1afc('0x6'));var config=require(_0x1afc('0x7'));var attributes=require(_0x1afc('0x8'));module[_0x1afc('0x9')]=function(_0x6caecd,_0x3139e8){return _0x6caecd[_0x1afc('0xa')](_0x1afc('0xb'),attributes,{'tableName':_0x1afc('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 b7ab751..635477e 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 _0x1d71=['code','UserChatQueue,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x4edcf8,_0x27c91b){var _0x3c3c65=function(_0xa3df4b){while(--_0xa3df4b){_0x4edcf8['push'](_0x4edcf8['shift']());}};_0x3c3c65(++_0x27c91b);}(_0x1d71,0x11c));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11d7('0x0'));var util=require('util');var moment=require(_0x11d7('0x1'));var BPromise=require(_0x11d7('0x2'));var rs=require(_0x11d7('0x3'));var fs=require('fs');var Redis=require(_0x11d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11d7('0x5'));var logger=require(_0x11d7('0x6'))(_0x11d7('0x7'));var config=require(_0x11d7('0x8'));var jayson=require(_0x11d7('0x9'));var client=jayson[_0x11d7('0xa')][_0x11d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42901a,_0x2714da,_0x4ff523){return new BPromise(function(_0x54f7f5,_0x463768){return client['request'](_0x42901a,_0x4ff523)[_0x11d7('0xc')](function(_0x40f02a){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x2714da,_0x11d7('0xd'));logger['debug'](_0x11d7('0xe'),_0x2714da,_0x11d7('0xd'),JSON['stringify'](_0x40f02a));if(_0x40f02a[_0x11d7('0xf')]){if(_0x40f02a[_0x11d7('0xf')][_0x11d7('0x10')]===0x1f4){logger['error'](_0x11d7('0x11'),_0x2714da,_0x40f02a['error'][_0x11d7('0x12')]);return _0x463768(_0x40f02a['error'][_0x11d7('0x12')]);}logger[_0x11d7('0xf')](_0x11d7('0x11'),_0x2714da,_0x40f02a['error'][_0x11d7('0x12')]);return _0x54f7f5(_0x40f02a['error']['message']);}else{logger[_0x11d7('0x13')](_0x11d7('0x11'),_0x2714da,_0x11d7('0xd'));_0x54f7f5(_0x40f02a['result'][_0x11d7('0x12')]);}})['catch'](function(_0x328daa){logger[_0x11d7('0xf')](_0x11d7('0x11'),_0x2714da,_0x328daa);_0x463768(_0x328daa);});});} \ No newline at end of file +var _0xa248=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x2730da,_0x221542){var _0x635782=function(_0x46a75c){while(--_0x46a75c){_0x2730da['push'](_0x2730da['shift']());}};_0x635782(++_0x221542);}(_0xa248,0xbb));var _0x8a24=function(_0x145fd1,_0x11540f){_0x145fd1=_0x145fd1-0x0;var _0x40e08c=_0xa248[_0x145fd1];return _0x40e08c;};'use strict';var _=require(_0x8a24('0x0'));var util=require(_0x8a24('0x1'));var moment=require(_0x8a24('0x2'));var BPromise=require(_0x8a24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a24('0x4'));var db=require(_0x8a24('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8a24('0x6'));var jayson=require(_0x8a24('0x7'));var client=jayson[_0x8a24('0x8')][_0x8a24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5923e9,_0x50b4d5,_0x5d10ef){return new BPromise(function(_0x52774a,_0x292ea4){return client[_0x8a24('0xa')](_0x5923e9,_0x5d10ef)[_0x8a24('0xb')](function(_0x539b1b){logger[_0x8a24('0xc')](_0x8a24('0xd'),_0x50b4d5,_0x8a24('0xe'));logger[_0x8a24('0xf')](_0x8a24('0x10'),_0x50b4d5,'request\x20sent',JSON[_0x8a24('0x11')](_0x539b1b));if(_0x539b1b['error']){if(_0x539b1b[_0x8a24('0x12')]['code']===0x1f4){logger[_0x8a24('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x50b4d5,_0x539b1b[_0x8a24('0x12')][_0x8a24('0x13')]);return _0x292ea4(_0x539b1b[_0x8a24('0x12')]['message']);}logger[_0x8a24('0x12')](_0x8a24('0xd'),_0x50b4d5,_0x539b1b[_0x8a24('0x12')][_0x8a24('0x13')]);return _0x52774a(_0x539b1b[_0x8a24('0x12')][_0x8a24('0x13')]);}else{logger[_0x8a24('0xc')](_0x8a24('0xd'),_0x50b4d5,_0x8a24('0xe'));_0x52774a(_0x539b1b[_0x8a24('0x14')][_0x8a24('0x13')]);}})[_0x8a24('0x15')](function(_0x5314d9){logger[_0x8a24('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x50b4d5,_0x5314d9);_0x292ea4(_0x5314d9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ab4e5e4..bedbeb5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x428380,_0x19372a){var _0x298f8a=function(_0x2a60e3){while(--_0x2a60e3){_0x428380['push'](_0x428380['shift']());}};_0x298f8a(++_0x19372a);}(_0xe706,0xa3));var _0x6e70=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0xe706[_0x4ca6a4];return _0x120555;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x265d8d,_0x2ef29f){var _0x210a0a=function(_0x5480f9){while(--_0x5480f9){_0x265d8d['push'](_0x265d8d['shift']());}};_0x210a0a(++_0x2ef29f);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e253bb8..546f7da 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 _0x0feb=['sequelize','exports','INTEGER'];(function(_0x4e9de3,_0x108fc8){var _0x42132b=function(_0x8b4fef){while(--_0x8b4fef){_0x4e9de3['push'](_0x4e9de3['shift']());}};_0x42132b(++_0x108fc8);}(_0x0feb,0x141));var _0xb0fe=function(_0x38cc94,_0x5756e9){_0x38cc94=_0x38cc94-0x0;var _0x4ac45c=_0x0feb[_0x38cc94];return _0x4ac45c;};'use strict';var Sequelize=require(_0xb0fe('0x0'));module[_0xb0fe('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb0fe('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x73a3=['exports','INTEGER'];(function(_0x553451,_0x1d5349){var _0x4e4e50=function(_0x416727){while(--_0x416727){_0x553451['push'](_0x553451['shift']());}};_0x4e4e50(++_0x1d5349);}(_0x73a3,0xac));var _0x373a=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x73a3[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require('sequelize');module[_0x373a('0x0')]={'penalty':{'type':Sequelize[_0x373a('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x373a('0x1')],'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 4682d7d..724cea9 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 _0x74fe=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./userFaxQueue.attributes','define'];(function(_0x2bb198,_0x16c4bc){var _0x2af343=function(_0x58fedd){while(--_0x58fedd){_0x2bb198['push'](_0x2bb198['shift']());}};_0x2af343(++_0x16c4bc);}(_0x74fe,0x178));var _0xe74f=function(_0x5b9280,_0x240763){_0x5b9280=_0x5b9280-0x0;var _0xef44a3=_0x74fe[_0x5b9280];return _0xef44a3;};'use strict';var _=require(_0xe74f('0x0'));var util=require(_0xe74f('0x1'));var logger=require(_0xe74f('0x2'))('api');var moment=require(_0xe74f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe74f('0x4'));var fs=require('fs');var path=require(_0xe74f('0x5'));var rimraf=require(_0xe74f('0x6'));var config=require('../../config/environment');var attributes=require(_0xe74f('0x7'));module['exports']=function(_0x3f02cc,_0x3e2935){return _0x3f02cc[_0xe74f('0x8')](_0xe74f('0x9'),attributes,{'tableName':_0xe74f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9092=['request-promise','path','rimraf','./userFaxQueue.attributes','define','user_has_fax_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x4af3c6,_0x5e72ff){var _0x2c8a73=function(_0x31457d){while(--_0x31457d){_0x4af3c6['push'](_0x4af3c6['shift']());}};_0x2c8a73(++_0x5e72ff);}(_0x9092,0x1b3));var _0x2909=function(_0x331129,_0x26cae0){_0x331129=_0x331129-0x0;var _0x2c02ff=_0x9092[_0x331129];return _0x2c02ff;};'use strict';var _=require('lodash');var util=require(_0x2909('0x0'));var logger=require(_0x2909('0x1'))(_0x2909('0x2'));var moment=require(_0x2909('0x3'));var BPromise=require(_0x2909('0x4'));var rp=require(_0x2909('0x5'));var fs=require('fs');var path=require(_0x2909('0x6'));var rimraf=require(_0x2909('0x7'));var config=require('../../config/environment');var attributes=require(_0x2909('0x8'));module['exports']=function(_0x3de226,_0x1bb691){return _0x3de226[_0x2909('0x9')]('UserFaxQueue',attributes,{'tableName':_0x2909('0xa'),'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 4d5e6b9..29950b1 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 _0xcb7b=['stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x41f3f5,_0x4efe8f){var _0x1a0ed8=function(_0x1eaf46){while(--_0x1eaf46){_0x41f3f5['push'](_0x41f3f5['shift']());}};_0x1a0ed8(++_0x4efe8f);}(_0xcb7b,0xdf));var _0xbcb7=function(_0x48c45b,_0x592d0c){_0x48c45b=_0x48c45b-0x0;var _0x1b7a6e=_0xcb7b[_0x48c45b];return _0x1b7a6e;};'use strict';var _=require(_0xbcb7('0x0'));var util=require(_0xbcb7('0x1'));var moment=require(_0xbcb7('0x2'));var BPromise=require(_0xbcb7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcb7('0x4'))['db'];var utils=require(_0xbcb7('0x5'));var logger=require(_0xbcb7('0x6'))(_0xbcb7('0x7'));var config=require(_0xbcb7('0x8'));var jayson=require(_0xbcb7('0x9'));var client=jayson[_0xbcb7('0xa')][_0xbcb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31fde4,_0x2214f2,_0x5d5af2){return new BPromise(function(_0x3bf8e5,_0x488ea3){return client[_0xbcb7('0xc')](_0x31fde4,_0x5d5af2)[_0xbcb7('0xd')](function(_0x5e2a28){logger['info'](_0xbcb7('0xe'),_0x2214f2,'request\x20sent');logger[_0xbcb7('0xf')](_0xbcb7('0x10'),_0x2214f2,'request\x20sent',JSON[_0xbcb7('0x11')](_0x5e2a28));if(_0x5e2a28['error']){if(_0x5e2a28[_0xbcb7('0x12')][_0xbcb7('0x13')]===0x1f4){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x2214f2,_0x5e2a28['error'][_0xbcb7('0x14')]);return _0x488ea3(_0x5e2a28[_0xbcb7('0x12')]['message']);}logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x2214f2,_0x5e2a28[_0xbcb7('0x12')][_0xbcb7('0x14')]);return _0x3bf8e5(_0x5e2a28[_0xbcb7('0x12')][_0xbcb7('0x14')]);}else{logger[_0xbcb7('0x15')](_0xbcb7('0xe'),_0x2214f2,_0xbcb7('0x16'));_0x3bf8e5(_0x5e2a28[_0xbcb7('0x17')][_0xbcb7('0x14')]);}})['catch'](function(_0x2dc5ea){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x2214f2,_0x2dc5ea);_0x488ea3(_0x2dc5ea);});});} \ No newline at end of file +var _0xd165=['UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info'];(function(_0xb32170,_0x5f1629){var _0x1396e8=function(_0x5bf513){while(--_0x5bf513){_0xb32170['push'](_0xb32170['shift']());}};_0x1396e8(++_0x5f1629);}(_0xd165,0x9b));var _0x5d16=function(_0x54582f,_0x41995f){_0x54582f=_0x54582f-0x0;var _0x5c14ba=_0xd165[_0x54582f];return _0x5c14ba;};'use strict';var _=require(_0x5d16('0x0'));var util=require(_0x5d16('0x1'));var moment=require(_0x5d16('0x2'));var BPromise=require(_0x5d16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d16('0x4'));var db=require(_0x5d16('0x5'))['db'];var utils=require(_0x5d16('0x6'));var logger=require('../../config/logger')(_0x5d16('0x7'));var config=require(_0x5d16('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5d16('0x9')][_0x5d16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bcf15,_0x224b41,_0x1bde50){return new BPromise(function(_0x2ae059,_0x45adfb){return client['request'](_0x5bcf15,_0x1bde50)[_0x5d16('0xb')](function(_0x1e889d){logger[_0x5d16('0xc')](_0x5d16('0xd'),_0x224b41,'request\x20sent');logger[_0x5d16('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x224b41,_0x5d16('0xf'),JSON[_0x5d16('0x10')](_0x1e889d));if(_0x1e889d[_0x5d16('0x11')]){if(_0x1e889d[_0x5d16('0x11')]['code']===0x1f4){logger[_0x5d16('0x11')](_0x5d16('0xd'),_0x224b41,_0x1e889d[_0x5d16('0x11')][_0x5d16('0x12')]);return _0x45adfb(_0x1e889d['error']['message']);}logger[_0x5d16('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x224b41,_0x1e889d[_0x5d16('0x11')][_0x5d16('0x12')]);return _0x2ae059(_0x1e889d[_0x5d16('0x11')][_0x5d16('0x12')]);}else{logger[_0x5d16('0xc')](_0x5d16('0xd'),_0x224b41,_0x5d16('0xf'));_0x2ae059(_0x1e889d[_0x5d16('0x13')][_0x5d16('0x12')]);}})[_0x5d16('0x14')](function(_0x547708){logger[_0x5d16('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x224b41,_0x547708);_0x45adfb(_0x547708);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 061d174..6330eed 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ac3b8,_0x44e80a){var _0x3e05ef=function(_0x167885){while(--_0x167885){_0x1ac3b8['push'](_0x1ac3b8['shift']());}};_0x3e05ef(++_0x44e80a);}(_0x70e0,0x17b));var _0x070e=function(_0x4db71d,_0x2eeb2c){_0x4db71d=_0x4db71d-0x0;var _0x5bf7b5=_0x70e0[_0x4db71d];return _0x5bf7b5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a94bf,_0x2b69e3){var _0x3c7d37=function(_0x466a00){while(--_0x466a00){_0x4a94bf['push'](_0x4a94bf['shift']());}};_0x3c7d37(++_0x2b69e3);}(_0xe706,0xa3));var _0x6e70=function(_0x47cfb2,_0x550212){_0x47cfb2=_0x47cfb2-0x0;var _0x1d5212=_0xe706[_0x47cfb2];return _0x1d5212;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 56cc33c..df7ca23 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 _0x02d8=['INTEGER'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x02d8,0x11f));var _0x802d=function(_0x197abd,_0x1a5aee){_0x197abd=_0x197abd-0x0;var _0x54e9d7=_0x02d8[_0x197abd];return _0x54e9d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x802d('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8679=['sequelize','exports','INTEGER'];(function(_0x995e46,_0x11fa78){var _0x3d4583=function(_0x551762){while(--_0x551762){_0x995e46['push'](_0x995e46['shift']());}};_0x3d4583(++_0x11fa78);}(_0x8679,0x19e));var _0x9867=function(_0xa88c9,_0x2a0513){_0xa88c9=_0xa88c9-0x0;var _0x28c628=_0x8679[_0xa88c9];return _0x28c628;};'use strict';var Sequelize=require(_0x9867('0x0'));module[_0x9867('0x1')]={'penalty':{'type':Sequelize[_0x9867('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 574d14a..42476fd 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 _0xb6c1=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb6c1,0xcc));var _0x1b6c=function(_0x3b024c,_0x3a70bd){_0x3b024c=_0x3b024c-0x0;var _0x410e1f=_0xb6c1[_0x3b024c];return _0x410e1f;};'use strict';var _=require(_0x1b6c('0x0'));var util=require(_0x1b6c('0x1'));var logger=require(_0x1b6c('0x2'))(_0x1b6c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b6c('0x4'));var fs=require('fs');var path=require(_0x1b6c('0x5'));var rimraf=require(_0x1b6c('0x6'));var config=require(_0x1b6c('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x1b6c('0x8')]=function(_0xcb27dd,_0x13ac8b){return _0xcb27dd[_0x1b6c('0x9')](_0x1b6c('0xa'),attributes,{'tableName':_0x1b6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x543b=['moment','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x586dfc,_0x3e2591){var _0x471ad6=function(_0x348d2f){while(--_0x348d2f){_0x586dfc['push'](_0x586dfc['shift']());}};_0x471ad6(++_0x3e2591);}(_0x543b,0x64));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var logger=require(_0xb543('0x2'))(_0xb543('0x3'));var moment=require(_0xb543('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb543('0x5'));var rimraf=require(_0xb543('0x6'));var config=require(_0xb543('0x7'));var attributes=require(_0xb543('0x8'));module[_0xb543('0x9')]=function(_0x5001fc,_0x82ac38){return _0x5001fc[_0xb543('0xa')](_0xb543('0xb'),attributes,{'tableName':_0xb543('0xc'),'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 8658ffa..b17075e 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x18e411,_0x1239af){var _0x374a67=function(_0x3ad685){while(--_0x3ad685){_0x18e411['push'](_0x18e411['shift']());}};_0x374a67(++_0x1239af);}(_0x34e8,0x12c));var _0x834e=function(_0x90815e,_0x4d5619){_0x90815e=_0x90815e-0x0;var _0x506ba4=_0x34e8[_0x90815e];return _0x506ba4;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ 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(_0x1b7216,_0x2ce1d9){var _0x48c261=function(_0x434650){while(--_0x434650){_0x1b7216['push'](_0x1b7216['shift']());}};_0x48c261(++_0x2ce1d9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'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 bf99729..b227413 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 _0xfa2c=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','exports'];(function(_0x1d476f,_0x63d2e7){var _0x463e2c=function(_0x21ffd2){while(--_0x21ffd2){_0x1d476f['push'](_0x1d476f['shift']());}};_0x463e2c(++_0x63d2e7);}(_0xfa2c,0xfa));var _0xcfa2=function(_0x1827ef,_0x4b531f){_0x1827ef=_0x1827ef-0x0;var _0x1b8e39=_0xfa2c[_0x1827ef];return _0x1b8e39;};'use strict';var multer=require('multer');var util=require(_0xcfa2('0x0'));var path=require(_0xcfa2('0x1'));var timeout=require('connect-timeout');var express=require(_0xcfa2('0x2'));var router=express[_0xcfa2('0x3')]();var fs_extra=require(_0xcfa2('0x4'));var auth=require(_0xcfa2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcfa2('0x6'));var controller=require('./userNotification.controller');router[_0xcfa2('0x7')]('/',auth[_0xcfa2('0x8')](),controller['sendUserNotification']);module[_0xcfa2('0x9')]=router; \ No newline at end of file +var _0x8b71=['sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8b71,0xd4));var _0x18b7=function(_0x3df0fb,_0x2ecd0c){_0x3df0fb=_0x3df0fb-0x0;var _0x520ac6=_0x8b71[_0x3df0fb];return _0x520ac6;};'use strict';var multer=require(_0x18b7('0x0'));var util=require(_0x18b7('0x1'));var path=require(_0x18b7('0x2'));var timeout=require(_0x18b7('0x3'));var express=require(_0x18b7('0x4'));var router=express[_0x18b7('0x5')]();var fs_extra=require(_0x18b7('0x6'));var auth=require(_0x18b7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x18b7('0x8'));var controller=require(_0x18b7('0x9'));router[_0x18b7('0xa')]('/',auth[_0x18b7('0xb')](),controller[_0x18b7('0xc')]);module[_0x18b7('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index b6a8984..617e199 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 _0xf18a=['STRING','sequelize','TEXT'];(function(_0x4593c8,_0x4c9259){var _0x3a3839=function(_0x4b1963){while(--_0x4b1963){_0x4593c8['push'](_0x4593c8['shift']());}};_0x3a3839(++_0x4c9259);}(_0xf18a,0x1bd));var _0xaf18=function(_0x22288b,_0x3155bf){_0x22288b=_0x22288b-0x0;var _0x25179e=_0xf18a[_0x22288b];return _0x25179e;};'use strict';var Sequelize=require(_0xaf18('0x0'));module['exports']={'body':{'type':Sequelize[_0xaf18('0x1')]},'senderName':{'type':Sequelize[_0xaf18('0x2')]},'recipientsId':{'type':Sequelize[_0xaf18('0x1')]},'recipientsDescription':{'type':Sequelize[_0xaf18('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xc3f7=['STRING','TEXT','BOOLEAN','sequelize'];(function(_0x26a561,_0x478cc3){var _0x2cfb51=function(_0x3c8647){while(--_0x3c8647){_0x26a561['push'](_0x26a561['shift']());}};_0x2cfb51(++_0x478cc3);}(_0xc3f7,0x7b));var _0x7c3f=function(_0x437560,_0xc5d67f){_0x437560=_0x437560-0x0;var _0x278361=_0xc3f7[_0x437560];return _0x278361;};'use strict';var Sequelize=require(_0x7c3f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x7c3f('0x1')]},'recipientsId':{'type':Sequelize[_0x7c3f('0x2')]},'recipientsDescription':{'type':Sequelize[_0x7c3f('0x1')]},'beep':{'type':Sequelize[_0x7c3f('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 56dad6a..feed8aa 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 _0x3fad=['UserNotification','create','recipient','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','forEach','User','ids','queue','push','all','union','flatten','findOne','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','recipients','parse','chatqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','model','toLowerCase','senderName','fullname','recipientsDescription','beep','recipientsId','join'];(function(_0x5e1048,_0x5dd984){var _0x37aac1=function(_0x35bdf9){while(--_0x35bdf9){_0x5e1048['push'](_0x5e1048['shift']());}};_0x37aac1(++_0x5dd984);}(_0x3fad,0x123));var _0xd3fa=function(_0x4c9890,_0x462102){_0x4c9890=_0x4c9890-0x0;var _0x4248d9=_0x3fad[_0x4c9890];return _0x4248d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3fa('0x0'));var zipdir=require(_0xd3fa('0x1'));var jsonpatch=require(_0xd3fa('0x2'));var rp=require(_0xd3fa('0x3'));var moment=require(_0xd3fa('0x4'));var BPromise=require(_0xd3fa('0x5'));var Mustache=require(_0xd3fa('0x6'));var util=require(_0xd3fa('0x7'));var path=require('path');var sox=require(_0xd3fa('0x8'));var csv=require(_0xd3fa('0x9'));var ejs=require(_0xd3fa('0xa'));var fs=require('fs');var fs_extra=require(_0xd3fa('0xb'));var _=require(_0xd3fa('0xc'));var squel=require(_0xd3fa('0xd'));var crypto=require(_0xd3fa('0xe'));var jsforce=require(_0xd3fa('0xf'));var deskjs=require(_0xd3fa('0x10'));var toCsv=require(_0xd3fa('0x9'));var querystring=require(_0xd3fa('0x11'));var Papa=require(_0xd3fa('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd3fa('0x13'));var as=require(_0xd3fa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3fa('0x15'))(_0xd3fa('0x16'));var utils=require('../../config/utils');var config=require(_0xd3fa('0x17'));var licenseUtil=require(_0xd3fa('0x18'));var db=require(_0xd3fa('0x19'))['db'];config[_0xd3fa('0x1a')]=_[_0xd3fa('0x1b')](config[_0xd3fa('0x1a')],{'host':_0xd3fa('0x1c'),'port':0x18eb});var socket=require(_0xd3fa('0x1d'))(new Redis(config[_0xd3fa('0x1a')]));require(_0xd3fa('0x1e'))['register'](socket);function respondWithStatusCode(_0x3fadbe,_0xa9a41a){_0xa9a41a=_0xa9a41a||0xcc;return function(_0x57d5af){if(_0x57d5af){return _0x3fadbe['sendStatus'](_0xa9a41a);}return _0x3fadbe['status'](_0xa9a41a)[_0xd3fa('0x1f')]();};}function respondWithResult(_0x43bc96,_0x5b5b73){_0x5b5b73=_0x5b5b73||0xc8;return function(_0x322688){if(_0x322688){return _0x43bc96['status'](_0x5b5b73)[_0xd3fa('0x20')](_0x322688);}};}function respondWithFilteredResult(_0x396383,_0x565114){return function(_0x5ad882){if(_0x5ad882){var _0x5001c4=typeof _0x565114[_0xd3fa('0x21')]===_0xd3fa('0x22')&&typeof _0x565114[_0xd3fa('0x23')]===_0xd3fa('0x22');var _0x2ebb08=_0x5ad882[_0xd3fa('0x24')];var _0x245439=_0x5001c4?0x0:_0x565114[_0xd3fa('0x21')];var _0x87bd58=_0x5001c4?_0x5ad882[_0xd3fa('0x24')]:_0x565114[_0xd3fa('0x21')]+_0x565114[_0xd3fa('0x23')];var _0x23d897;if(_0x87bd58>=_0x2ebb08){_0x87bd58=_0x2ebb08;_0x23d897=0xc8;}else{_0x23d897=0xce;}_0x396383[_0xd3fa('0x25')](_0x23d897);return _0x396383[_0xd3fa('0x26')](_0xd3fa('0x27'),_0x245439+'-'+_0x87bd58+'/'+_0x2ebb08)['json'](_0x5ad882);}return null;};}function patchUpdates(_0x5594a9){return function(_0x42f07a){try{jsonpatch['apply'](_0x42f07a,_0x5594a9,!![]);}catch(_0x3d3b5d){return BPromise[_0xd3fa('0x28')](_0x3d3b5d);}return _0x42f07a[_0xd3fa('0x29')]();};}function saveUpdates(_0x42d925,_0x372016){return function(_0x11e69f){if(_0x11e69f){return _0x11e69f[_0xd3fa('0x2a')](_0x42d925)[_0xd3fa('0x2b')](function(_0x23a446){return _0x23a446;});}return null;};}function removeEntity(_0x2dc0c2,_0x3aec48){return function(_0x2a8c3a){if(_0x2a8c3a){return _0x2a8c3a[_0xd3fa('0x2c')]()['then'](function(){_0x2dc0c2[_0xd3fa('0x25')](0xcc)[_0xd3fa('0x1f')]();});}};}function handleEntityNotFound(_0x327405,_0x3d8ac9){return function(_0x232b26){if(!_0x232b26){_0x327405['sendStatus'](0x194);}return _0x232b26;};}function handleError(_0x2e55cc,_0x5ac00f){_0x5ac00f=_0x5ac00f||0x1f4;return function(_0x319443){logger[_0xd3fa('0x2d')](_0x319443[_0xd3fa('0x2e')]);if(_0x319443['name']){delete _0x319443[_0xd3fa('0x2f')];}_0x2e55cc[_0xd3fa('0x25')](_0x5ac00f)[_0xd3fa('0x30')](_0x319443);};}exports['sendUserNotification']=function(_0x1c9f09,_0x38c968,_0x69f435){if(!_0x1c9f09[_0xd3fa('0x31')]['hasOwnProperty'](_0xd3fa('0x32'))&&!_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x33')](_0xd3fa('0x34'))){throw new db[(_0xd3fa('0x35'))][(_0xd3fa('0x36'))](_0xd3fa('0x37'));}else{if(_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x33')](_0xd3fa('0x34'))&&!_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x33')]('view')){throw new db[(_0xd3fa('0x35'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x1c9f09[_0xd3fa('0x31')]['hasOwnProperty'](_0xd3fa('0x38'))){throw new db[(_0xd3fa('0x35'))][(_0xd3fa('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x43f82c=JSON[_0xd3fa('0x39')](_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x38')]);}catch(_0x38f7b0){logger[_0xd3fa('0x2d')](_0x38f7b0);throw new db[(_0xd3fa('0x35'))][(_0xd3fa('0x36'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4ee009=[_0xd3fa('0x3a'),'faxqueue','mailqueue',_0xd3fa('0x3b'),_0xd3fa('0x3c'),_0xd3fa('0x3d'),_0xd3fa('0x3e'),_0xd3fa('0x3f'),_0xd3fa('0x40')];if(_['some'](_0x43f82c,function(_0x532e48){return!_['includes'](_0x4ee009,_0x532e48[_0xd3fa('0x41')][_0xd3fa('0x42')]());})){throw new db[(_0xd3fa('0x35'))][(_0xd3fa('0x36'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x3d8ba3={};_0x3d8ba3[_0xd3fa('0x43')]=_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x33')](_0xd3fa('0x43'))?_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x43')]:_0x1c9f09[_0xd3fa('0x40')][_0xd3fa('0x44')];_0x3d8ba3['recipientsDescription']=_['isEmpty'](_0x1c9f09[_0xd3fa('0x31')]['recipientsDescription'])?null:_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x45')];_0x3d8ba3['beep']=_0x1c9f09[_0xd3fa('0x31')][_0xd3fa('0x46')]||![];_0x3d8ba3['SenderId']=_0x1c9f09['user']['id'];return getContent(_0x1c9f09[_0xd3fa('0x31')])['then'](function(_0x2525c0){_0x3d8ba3[_0xd3fa('0x31')]=_0x2525c0;return getRecipients(_0x43f82c);})[_0xd3fa('0x2b')](function(_0x2e2f07){_0x3d8ba3[_0xd3fa('0x47')]=_['sortBy'](_0x2e2f07)[_0xd3fa('0x48')](',');return db['sequelize']['transaction'](function(_0x411c1d){return db[_0xd3fa('0x49')][_0xd3fa('0x4a')](_0x3d8ba3,{'raw':!![],'transaction':_0x411c1d})['then'](function(_0x152b58){var _0x431deb={'sender':_0x3d8ba3[_0xd3fa('0x43')],'description':_0x3d8ba3[_0xd3fa('0x45')],'content':_0x3d8ba3['body'],'beep':_0x3d8ba3[_0xd3fa('0x46')]};_0x2e2f07['forEach'](function(_0x331928){_0x431deb[_0xd3fa('0x4b')]=_0x331928;socket['emit'](_0xd3fa('0x4c'),_0x431deb);});return _0x152b58;});});})['then'](respondWithResult(_0x38c968,0xc9))[_0xd3fa('0x4d')](handleError(_0x38c968,null));};function getContent(_0x38a903){return new BPromise(function(_0x2ee0f6,_0x416165){if(_0x38a903[_0xd3fa('0x32')]){_0x2ee0f6(_0x38a903[_0xd3fa('0x32')]);return;}return db['Template']['findOne']({'attributes':[_0xd3fa('0x4e')],'where':{'id':_0x38a903[_0xd3fa('0x34')]},'raw':!![]})[_0xd3fa('0x2b')](function(_0x8ae414){if(!_0x8ae414)throw new db['Sequelize'][(_0xd3fa('0x36'))](_0xd3fa('0x4f'));var _0x362794=Mustache['render'](_0x8ae414[_0xd3fa('0x4e')],_0x38a903[_0xd3fa('0x50')]);_0x2ee0f6(_0x362794);})['catch'](function(_0x42329a){_0x416165(_0x42329a);});});}function getRecipients(_0x9cd750){return new BPromise(function(_0x34b9c6,_0x2ff670){var _0x1c4f85=[];var _0x2fc6f=[];_0x9cd750[_0xd3fa('0x51')](function(_0x310d76){var _0x2fd7a8=_['startCase'](_0x310d76[_0xd3fa('0x41')][_0xd3fa('0x42')]());if(_0x2fd7a8===_0xd3fa('0x52')){_0x1c4f85=_['union'](_0x1c4f85,_0x310d76[_0xd3fa('0x53')]);}else{if(_['includes'](_0x2fd7a8,_0xd3fa('0x54')))_0x2fd7a8=_0x2fd7a8['replace']('queue','Queue');_0x310d76[_0xd3fa('0x53')][_0xd3fa('0x51')](function(_0x2a2c81){_0x2fc6f[_0xd3fa('0x55')](getAgents(_0x2fd7a8,_0x2a2c81));});}});return BPromise[_0xd3fa('0x56')](_0x2fc6f)[_0xd3fa('0x2b')](function(_0x167440){_0x1c4f85=_[_0xd3fa('0x57')](_0x1c4f85,_[_0xd3fa('0x58')](_0x167440));_0x34b9c6(_0x1c4f85);})[_0xd3fa('0x4d')](function(_0x543fb9){_0x2ff670(_0x543fb9);});});}function getAgents(_0xbdfcc4,_0x487ac7){return new BPromise(function(_0x502b1e,_0xe1910){return db[_0xbdfcc4][_0xd3fa('0x59')]({'where':{'id':_0x487ac7}})[_0xd3fa('0x2b')](function(_0x182738){return _0x182738['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x30fa7f){var _0x256e5c=_[_0xd3fa('0x5a')](_0x30fa7f,'id');_0x502b1e(_0x256e5c);});})['catch'](function(_0x1c67e4){_0xe1910(_0x1c67e4);});});} \ No newline at end of file +var _0x2f30=['join','sequelize','UserNotification','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','queue','Queue','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','json','offset','undefined','limit','count','set','apply','reject','save','then','status','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2f30,0x75));var _0x02f3=function(_0x4c8bdd,_0x253da0){_0x4c8bdd=_0x4c8bdd-0x0;var _0x279071=_0x2f30[_0x4c8bdd];return _0x279071;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f3('0x0'));var zipdir=require(_0x02f3('0x1'));var jsonpatch=require(_0x02f3('0x2'));var rp=require('request-promise');var moment=require(_0x02f3('0x3'));var BPromise=require(_0x02f3('0x4'));var Mustache=require('mustache');var util=require(_0x02f3('0x5'));var path=require(_0x02f3('0x6'));var sox=require(_0x02f3('0x7'));var csv=require(_0x02f3('0x8'));var ejs=require(_0x02f3('0x9'));var fs=require('fs');var fs_extra=require(_0x02f3('0xa'));var _=require('lodash');var squel=require(_0x02f3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x02f3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x02f3('0xd'));var Papa=require('papaparse');var Redis=require(_0x02f3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x02f3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02f3('0x10'));var logger=require(_0x02f3('0x11'))(_0x02f3('0x12'));var utils=require(_0x02f3('0x13'));var config=require(_0x02f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f3('0x15'))['db'];config['redis']=_['defaults'](config[_0x02f3('0x16')],{'host':_0x02f3('0x17'),'port':0x18eb});var socket=require(_0x02f3('0x18'))(new Redis(config[_0x02f3('0x16')]));require(_0x02f3('0x19'))[_0x02f3('0x1a')](socket);function respondWithStatusCode(_0x5c85e1,_0x39083f){_0x39083f=_0x39083f||0xcc;return function(_0x336960){if(_0x336960){return _0x5c85e1[_0x02f3('0x1b')](_0x39083f);}return _0x5c85e1['status'](_0x39083f)[_0x02f3('0x1c')]();};}function respondWithResult(_0x206cb7,_0x556bb8){_0x556bb8=_0x556bb8||0xc8;return function(_0x364882){if(_0x364882){return _0x206cb7['status'](_0x556bb8)[_0x02f3('0x1d')](_0x364882);}};}function respondWithFilteredResult(_0x4c927e,_0x36bfaf){return function(_0x580718){if(_0x580718){var _0x242865=typeof _0x36bfaf[_0x02f3('0x1e')]===_0x02f3('0x1f')&&typeof _0x36bfaf[_0x02f3('0x20')]===_0x02f3('0x1f');var _0x25eb69=_0x580718['count'];var _0x27a24e=_0x242865?0x0:_0x36bfaf[_0x02f3('0x1e')];var _0x3336a3=_0x242865?_0x580718[_0x02f3('0x21')]:_0x36bfaf[_0x02f3('0x1e')]+_0x36bfaf[_0x02f3('0x20')];var _0x404a00;if(_0x3336a3>=_0x25eb69){_0x3336a3=_0x25eb69;_0x404a00=0xc8;}else{_0x404a00=0xce;}_0x4c927e['status'](_0x404a00);return _0x4c927e[_0x02f3('0x22')]('Content-Range',_0x27a24e+'-'+_0x3336a3+'/'+_0x25eb69)[_0x02f3('0x1d')](_0x580718);}return null;};}function patchUpdates(_0x5410e1){return function(_0x172b5b){try{jsonpatch[_0x02f3('0x23')](_0x172b5b,_0x5410e1,!![]);}catch(_0x511126){return BPromise[_0x02f3('0x24')](_0x511126);}return _0x172b5b[_0x02f3('0x25')]();};}function saveUpdates(_0x1d6d5a,_0x566790){return function(_0x49c4c6){if(_0x49c4c6){return _0x49c4c6['update'](_0x1d6d5a)[_0x02f3('0x26')](function(_0x373eff){return _0x373eff;});}return null;};}function removeEntity(_0xc52025,_0x4213c2){return function(_0xf2a50a){if(_0xf2a50a){return _0xf2a50a['destroy']()[_0x02f3('0x26')](function(){_0xc52025[_0x02f3('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc37798,_0x400c18){return function(_0x53748f){if(!_0x53748f){_0xc37798[_0x02f3('0x1b')](0x194);}return _0x53748f;};}function handleError(_0x2f7d70,_0x42120d){_0x42120d=_0x42120d||0x1f4;return function(_0xa3faa9){logger[_0x02f3('0x28')](_0xa3faa9['stack']);if(_0xa3faa9[_0x02f3('0x29')]){delete _0xa3faa9['name'];}_0x2f7d70[_0x02f3('0x27')](_0x42120d)[_0x02f3('0x2a')](_0xa3faa9);};}exports[_0x02f3('0x2b')]=function(_0x10f37f,_0x596560,_0x586858){if(!_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x2d')](_0x02f3('0x2e'))&&!_0x10f37f['body'][_0x02f3('0x2d')](_0x02f3('0x2f'))){throw new db[(_0x02f3('0x30'))][(_0x02f3('0x31'))](_0x02f3('0x32'));}else{if(_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x2d')](_0x02f3('0x2f'))&&!_0x10f37f[_0x02f3('0x2c')]['hasOwnProperty'](_0x02f3('0x33'))){throw new db[(_0x02f3('0x30'))]['ValidationError'](_0x02f3('0x34'));}if(!_0x10f37f[_0x02f3('0x2c')]['hasOwnProperty'](_0x02f3('0x35'))){throw new db[(_0x02f3('0x30'))][(_0x02f3('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4b2e85=JSON[_0x02f3('0x36')](_0x10f37f['body'][_0x02f3('0x35')]);}catch(_0x397a93){logger[_0x02f3('0x28')](_0x397a93);throw new db[(_0x02f3('0x30'))]['ValidationError'](_0x02f3('0x37'));}var _0x28a9aa=[_0x02f3('0x38'),_0x02f3('0x39'),_0x02f3('0x3a'),_0x02f3('0x3b'),_0x02f3('0x3c'),_0x02f3('0x3d'),_0x02f3('0x3e'),_0x02f3('0x3f'),_0x02f3('0x40')];if(_[_0x02f3('0x41')](_0x4b2e85,function(_0x21e53a){return!_[_0x02f3('0x42')](_0x28a9aa,_0x21e53a[_0x02f3('0x43')][_0x02f3('0x44')]());})){throw new db[(_0x02f3('0x30'))][(_0x02f3('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x49fcac={};_0x49fcac[_0x02f3('0x45')]=_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x2d')]('senderName')?_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x45')]:_0x10f37f[_0x02f3('0x40')]['fullname'];_0x49fcac[_0x02f3('0x46')]=_['isEmpty'](_0x10f37f['body']['recipientsDescription'])?null:_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x46')];_0x49fcac['beep']=_0x10f37f[_0x02f3('0x2c')][_0x02f3('0x47')]||![];_0x49fcac[_0x02f3('0x48')]=_0x10f37f['user']['id'];return getContent(_0x10f37f[_0x02f3('0x2c')])[_0x02f3('0x26')](function(_0x1c54f8){_0x49fcac['body']=_0x1c54f8;return getRecipients(_0x4b2e85);})['then'](function(_0x1e5671){_0x49fcac[_0x02f3('0x49')]=_[_0x02f3('0x4a')](_0x1e5671)[_0x02f3('0x4b')](',');return db[_0x02f3('0x4c')]['transaction'](function(_0x5d980d){return db[_0x02f3('0x4d')]['create'](_0x49fcac,{'raw':!![],'transaction':_0x5d980d})[_0x02f3('0x26')](function(_0x6d502){var _0x32a308={'sender':_0x49fcac[_0x02f3('0x45')],'description':_0x49fcac[_0x02f3('0x46')],'content':_0x49fcac[_0x02f3('0x2c')],'beep':_0x49fcac[_0x02f3('0x47')]};_0x1e5671[_0x02f3('0x4e')](function(_0x251834){_0x32a308[_0x02f3('0x4f')]=_0x251834;socket['emit'](_0x02f3('0x50'),_0x32a308);});return _0x6d502;});});})['then'](respondWithResult(_0x596560,0xc9))[_0x02f3('0x51')](handleError(_0x596560,null));};function getContent(_0x55a95c){return new BPromise(function(_0xcf0e2f,_0x10450d){if(_0x55a95c[_0x02f3('0x2e')]){_0xcf0e2f(_0x55a95c['text']);return;}return db[_0x02f3('0x52')][_0x02f3('0x53')]({'attributes':[_0x02f3('0x54')],'where':{'id':_0x55a95c[_0x02f3('0x2f')]},'raw':!![]})['then'](function(_0x35a0ba){if(!_0x35a0ba)throw new db[(_0x02f3('0x30'))][(_0x02f3('0x31'))](_0x02f3('0x55'));var _0x92640=Mustache[_0x02f3('0x56')](_0x35a0ba['html'],_0x55a95c['view']);_0xcf0e2f(_0x92640);})['catch'](function(_0x288dcc){_0x10450d(_0x288dcc);});});}function getRecipients(_0x3eb176){return new BPromise(function(_0x319e8a,_0x16c426){var _0x2ad55b=[];var _0x3ea872=[];_0x3eb176[_0x02f3('0x4e')](function(_0x200d4a){var _0x42d030=_[_0x02f3('0x57')](_0x200d4a[_0x02f3('0x43')][_0x02f3('0x44')]());if(_0x42d030===_0x02f3('0x58')){_0x2ad55b=_[_0x02f3('0x59')](_0x2ad55b,_0x200d4a['ids']);}else{if(_['includes'](_0x42d030,_0x02f3('0x5a')))_0x42d030=_0x42d030['replace'](_0x02f3('0x5a'),_0x02f3('0x5b'));_0x200d4a['ids'][_0x02f3('0x4e')](function(_0xb56a83){_0x3ea872['push'](getAgents(_0x42d030,_0xb56a83));});}});return BPromise[_0x02f3('0x5c')](_0x3ea872)[_0x02f3('0x26')](function(_0x4bda1b){_0x2ad55b=_[_0x02f3('0x59')](_0x2ad55b,_[_0x02f3('0x5d')](_0x4bda1b));_0x319e8a(_0x2ad55b);})[_0x02f3('0x51')](function(_0xa7c2b1){_0x16c426(_0xa7c2b1);});});}function getAgents(_0x1e26b3,_0x4a0e06){return new BPromise(function(_0x93078,_0x311bc6){return db[_0x1e26b3]['findOne']({'where':{'id':_0x4a0e06}})['then'](function(_0x59206f){return _0x59206f[_0x02f3('0x5e')]({'attributes':['id'],'raw':!![]})[_0x02f3('0x26')](function(_0x46c276){var _0x16b656=_[_0x02f3('0x5f')](_0x46c276,'id');_0x93078(_0x16b656);});})[_0x02f3('0x51')](function(_0x471717){_0x311bc6(_0x471717);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 773f153..6b86adf 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 _0x3e4b=['UserNotification','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x84cc6c,_0x3d0495){var _0x139006=function(_0x53e0f6){while(--_0x53e0f6){_0x84cc6c['push'](_0x84cc6c['shift']());}};_0x139006(++_0x3d0495);}(_0x3e4b,0x10c));var _0xb3e4=function(_0x28d9ad,_0x3af957){_0x28d9ad=_0x28d9ad-0x0;var _0x47fb23=_0x3e4b[_0x28d9ad];return _0x47fb23;};'use strict';var EventEmitter=require(_0xb3e4('0x0'));var UserNotification=require(_0xb3e4('0x1'))['db'][_0xb3e4('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb3e4('0x3')](0x0);var events={'afterCreate':_0xb3e4('0x4'),'afterUpdate':_0xb3e4('0x5'),'afterDestroy':_0xb3e4('0x6')};function emitEvent(_0x122e53){return function(_0x5ce3f5,_0x38e90e,_0x4b583f){UserNotificationEvents['emit'](_0x122e53+':'+_0x5ce3f5['id'],_0x5ce3f5);UserNotificationEvents[_0xb3e4('0x7')](_0x122e53,_0x5ce3f5);_0x4b583f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xb3e4('0x8')](e,emitEvent(event));}}module[_0xb3e4('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x989a=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x58f52c,_0x57ee43){var _0x3d4dc6=function(_0x51effe){while(--_0x51effe){_0x58f52c['push'](_0x58f52c['shift']());}};_0x3d4dc6(++_0x57ee43);}(_0x989a,0x1e4));var _0xa989=function(_0x458f39,_0x2a98a5){_0x458f39=_0x458f39-0x0;var _0x3d4a4c=_0x989a[_0x458f39];return _0x3d4a4c;};'use strict';var EventEmitter=require(_0xa989('0x0'));var UserNotification=require(_0xa989('0x1'))['db'][_0xa989('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa989('0x3')](0x0);var events={'afterCreate':_0xa989('0x4'),'afterUpdate':_0xa989('0x5'),'afterDestroy':_0xa989('0x6')};function emitEvent(_0x5a0713){return function(_0x30f1d5,_0x5a9ef2,_0x51e662){UserNotificationEvents[_0xa989('0x7')](_0x5a0713+':'+_0x30f1d5['id'],_0x30f1d5);UserNotificationEvents[_0xa989('0x7')](_0x5a0713,_0x30f1d5);_0x51e662(null);};}for(var e in events){if(events[_0xa989('0x8')](e)){var event=events[e];UserNotification[_0xa989('0x9')](e,emitEvent(event));}}module[_0xa989('0xa')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index de68559..c1bb1e1 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 _0xfbcb=['define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0xfbcb,0x93));var _0xbfbc=function(_0x3b67cd,_0x325527){_0x3b67cd=_0x3b67cd-0x0;var _0x1ac6ec=_0xfbcb[_0x3b67cd];return _0x1ac6ec;};'use strict';var _=require(_0xbfbc('0x0'));var util=require(_0xbfbc('0x1'));var logger=require(_0xbfbc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbfbc('0x3'));var fs=require('fs');var path=require(_0xbfbc('0x4'));var rimraf=require(_0xbfbc('0x5'));var config=require(_0xbfbc('0x6'));var attributes=require(_0xbfbc('0x7'));module[_0xbfbc('0x8')]=function(_0x2b280d,_0x3536e5){return _0x2b280d[_0xbfbc('0x9')]('UserNotification',attributes,{'tableName':_0xbfbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbfbc('0xb'),'collate':_0xbfbc('0xc')});}; \ No newline at end of file +var _0x2f08=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','define'];(function(_0x1f212d,_0x281e62){var _0x20a048=function(_0x3bd432){while(--_0x3bd432){_0x1f212d['push'](_0x1f212d['shift']());}};_0x20a048(++_0x281e62);}(_0x2f08,0x91));var _0x82f0=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0x2f08[_0x1cb0b4];return _0x525b60;};'use strict';var _=require(_0x82f0('0x0'));var util=require(_0x82f0('0x1'));var logger=require(_0x82f0('0x2'))(_0x82f0('0x3'));var moment=require(_0x82f0('0x4'));var BPromise=require(_0x82f0('0x5'));var rp=require(_0x82f0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82f0('0x7'));var config=require(_0x82f0('0x8'));var attributes=require(_0x82f0('0x9'));module['exports']=function(_0x9fd210,_0xaf3fe9){return _0x9fd210[_0x82f0('0xa')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x82f0('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b75d82b..ca6fdc3 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 _0x616b=['register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','jayson/promise','client','http','defaults','redis','./userNotification.socket'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x616b,0x68));var _0xb616=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x616b[_0x4ac424];return _0xe1b890;};'use strict';var _=require(_0xb616('0x0'));var util=require(_0xb616('0x1'));var moment=require(_0xb616('0x2'));var BPromise=require(_0xb616('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb616('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb616('0x5'));var client=jayson[_0xb616('0x6')][_0xb616('0x7')]({'port':0x232a});config['redis']=_[_0xb616('0x8')](config[_0xb616('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb616('0x9')]));require(_0xb616('0xa'))[_0xb616('0xb')](socket);function respondWithRpcPromise(_0x2a7225,_0x1a52d2,_0x409502){return new BPromise(function(_0x293cfa,_0x4a0070){return client['request'](_0x2a7225,_0x409502)[_0xb616('0xc')](function(_0x568720){logger['info'](_0xb616('0xd'),_0x1a52d2,_0xb616('0xe'));logger[_0xb616('0xf')](_0xb616('0x10'),_0x1a52d2,'request\x20sent',JSON[_0xb616('0x11')](_0x568720));if(_0x568720[_0xb616('0x12')]){if(_0x568720[_0xb616('0x12')][_0xb616('0x13')]===0x1f4){logger[_0xb616('0x12')](_0xb616('0xd'),_0x1a52d2,_0x568720['error']['message']);return _0x4a0070(_0x568720[_0xb616('0x12')][_0xb616('0x14')]);}logger[_0xb616('0x12')](_0xb616('0xd'),_0x1a52d2,_0x568720[_0xb616('0x12')][_0xb616('0x14')]);return _0x293cfa(_0x568720['error']['message']);}else{logger['info'](_0xb616('0xd'),_0x1a52d2,'request\x20sent');_0x293cfa(_0x568720[_0xb616('0x15')]['message']);}})[_0xb616('0x16')](function(_0x2f5489){logger['error']('UserNotification,\x20%s,\x20%s',_0x1a52d2,_0x2f5489);_0x4a0070(_0x2f5489);});});} \ No newline at end of file +var _0x41ec=['stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./userNotification.socket','register','request','debug','request\x20sent'];(function(_0x35c049,_0x1f7c6a){var _0x568290=function(_0x5920f4){while(--_0x5920f4){_0x35c049['push'](_0x35c049['shift']());}};_0x568290(++_0x1f7c6a);}(_0x41ec,0x1a7));var _0xc41e=function(_0x55c47b,_0x30e816){_0x55c47b=_0x55c47b-0x0;var _0x10b1cf=_0x41ec[_0x55c47b];return _0x10b1cf;};'use strict';var _=require(_0xc41e('0x0'));var util=require('util');var moment=require(_0xc41e('0x1'));var BPromise=require(_0xc41e('0x2'));var rs=require(_0xc41e('0x3'));var fs=require('fs');var Redis=require(_0xc41e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc41e('0x5'));var logger=require(_0xc41e('0x6'))(_0xc41e('0x7'));var config=require(_0xc41e('0x8'));var jayson=require(_0xc41e('0x9'));var client=jayson['client'][_0xc41e('0xa')]({'port':0x232a});config[_0xc41e('0xb')]=_[_0xc41e('0xc')](config[_0xc41e('0xb')],{'host':_0xc41e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc41e('0xb')]));require(_0xc41e('0xe'))[_0xc41e('0xf')](socket);function respondWithRpcPromise(_0x28b4f9,_0xbec9ca,_0x3cf5f1){return new BPromise(function(_0x28ac74,_0x3aa238){return client[_0xc41e('0x10')](_0x28b4f9,_0x3cf5f1)['then'](function(_0x348f82){logger['info']('UserNotification,\x20%s,\x20%s',_0xbec9ca,'request\x20sent');logger[_0xc41e('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xbec9ca,_0xc41e('0x12'),JSON[_0xc41e('0x13')](_0x348f82));if(_0x348f82[_0xc41e('0x14')]){if(_0x348f82[_0xc41e('0x14')][_0xc41e('0x15')]===0x1f4){logger[_0xc41e('0x14')](_0xc41e('0x16'),_0xbec9ca,_0x348f82[_0xc41e('0x14')][_0xc41e('0x17')]);return _0x3aa238(_0x348f82['error'][_0xc41e('0x17')]);}logger[_0xc41e('0x14')](_0xc41e('0x16'),_0xbec9ca,_0x348f82['error'][_0xc41e('0x17')]);return _0x28ac74(_0x348f82[_0xc41e('0x14')][_0xc41e('0x17')]);}else{logger[_0xc41e('0x18')]('UserNotification,\x20%s,\x20%s',_0xbec9ca,_0xc41e('0x12'));_0x28ac74(_0x348f82['result'][_0xc41e('0x17')]);}})[_0xc41e('0x19')](function(_0x29c770){logger[_0xc41e('0x14')](_0xc41e('0x16'),_0xbec9ca,_0x29c770);_0x3aa238(_0x29c770);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4189438..f6aadc5 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 _0x4f71=['save','update','removeListener','length','userNotification:','./userNotification.events'];(function(_0x5f2a46,_0x3fd5ee){var _0x551bc6=function(_0xb22adc){while(--_0xb22adc){_0x5f2a46['push'](_0x5f2a46['shift']());}};_0x551bc6(++_0x3fd5ee);}(_0x4f71,0x185));var _0x14f7=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4f71[_0x173d7e];return _0x2220d6;};'use strict';var UserNotificationEvents=require(_0x14f7('0x0'));var events=[_0x14f7('0x1'),'remove',_0x14f7('0x2')];function createListener(_0x37a956,_0x101ff7){return function(_0x4d6f10){_0x101ff7['emit'](_0x37a956,_0x4d6f10);};}function removeListener(_0x27da3a,_0x33eea4){return function(){UserNotificationEvents[_0x14f7('0x3')](_0x27da3a,_0x33eea4);};}exports['register']=function(_0x531f4c){for(var _0x412ad7=0x0,_0x5d4cd9=events[_0x14f7('0x4')];_0x412ad7<_0x5d4cd9;_0x412ad7++){var _0x45bdf7=events[_0x412ad7];var _0x52705d=createListener(_0x14f7('0x5')+_0x45bdf7,_0x531f4c);UserNotificationEvents['on'](_0x45bdf7,_0x52705d);}}; \ No newline at end of file +var _0xd065=['removeListener','register','length','userNotification:','./userNotification.events','emit'];(function(_0xc5d6bb,_0x231bbe){var _0x50dd36=function(_0x39515f){while(--_0x39515f){_0xc5d6bb['push'](_0xc5d6bb['shift']());}};_0x50dd36(++_0x231bbe);}(_0xd065,0xe2));var _0x5d06=function(_0x45a962,_0x148ba9){_0x45a962=_0x45a962-0x0;var _0x58c6fb=_0xd065[_0x45a962];return _0x58c6fb;};'use strict';var UserNotificationEvents=require(_0x5d06('0x0'));var events=['save','remove','update'];function createListener(_0x4bab58,_0x380fc9){return function(_0x347137){_0x380fc9[_0x5d06('0x1')](_0x4bab58,_0x347137);};}function removeListener(_0x4a2450,_0x356607){return function(){UserNotificationEvents[_0x5d06('0x2')](_0x4a2450,_0x356607);};}exports[_0x5d06('0x3')]=function(_0x7a6a85){for(var _0x3e3c86=0x0,_0x234c7a=events[_0x5d06('0x4')];_0x3e3c86<_0x234c7a;_0x3e3c86++){var _0x3c324b=events[_0x3e3c86];var _0x5e7116=createListener(_0x5d06('0x5')+_0x3c324b,_0x7a6a85);UserNotificationEvents['on'](_0x3c324b,_0x5e7116);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 1679b34..2b66af9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5d5c4a,_0x2d5858){var _0x3fdc68=function(_0x404ecc){while(--_0x404ecc){_0x5d5c4a['push'](_0x5d5c4a['shift']());}};_0x3fdc68(++_0x2d5858);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x59b207,_0x3b6935){var _0x3f62e4=function(_0x2d63c4){while(--_0x2d63c4){_0x59b207['push'](_0x59b207['shift']());}};_0x3f62e4(++_0x3b6935);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xcb91[_0x5f5cce];return _0x705ecf;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index c7cf8b9..0b49067 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 _0x09b1=['INTEGER','sequelize'];(function(_0x55ceed,_0x23f3c8){var _0x607c76=function(_0x3db762){while(--_0x3db762){_0x55ceed['push'](_0x55ceed['shift']());}};_0x607c76(++_0x23f3c8);}(_0x09b1,0x167));var _0x109b=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x09b1[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x109b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x109b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbe48=['INTEGER','sequelize','exports'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xbe48,0x121));var _0x8be4=function(_0x348efd,_0x40f15a){_0x348efd=_0x348efd-0x0;var _0xb2376e=_0xbe48[_0x348efd];return _0xb2376e;};'use strict';var Sequelize=require(_0x8be4('0x0'));module[_0x8be4('0x1')]={'penalty':{'type':Sequelize[_0x8be4('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 3851737..2c71df1 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 _0xbea5=['user_has_openchannel_queues','lodash','util','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xbea5,0x91));var _0x5bea=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0xbea5[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bea('0x2'));var BPromise=require(_0x5bea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bea('0x4'));var rimraf=require(_0x5bea('0x5'));var config=require(_0x5bea('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x3abd88,_0x5b4d0b){return _0x3abd88[_0x5bea('0x7')]('UserOpenchannelQueue',attributes,{'tableName':_0x5bea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e57=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2bafd2,_0x1bd0d9){var _0x30abff=function(_0x135eba){while(--_0x135eba){_0x2bafd2['push'](_0x2bafd2['shift']());}};_0x30abff(++_0x1bd0d9);}(_0x7e57,0x182));var _0x77e5=function(_0xf5444f,_0x486085){_0xf5444f=_0xf5444f-0x0;var _0x3fd533=_0x7e57[_0xf5444f];return _0x3fd533;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var logger=require('../../config/logger')(_0x77e5('0x2'));var moment=require('moment');var BPromise=require(_0x77e5('0x3'));var rp=require(_0x77e5('0x4'));var fs=require('fs');var path=require(_0x77e5('0x5'));var rimraf=require(_0x77e5('0x6'));var config=require(_0x77e5('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x77e5('0x8')]=function(_0x25e55d,_0x53fd9c){return _0x25e55d[_0x77e5('0x9')](_0x77e5('0xa'),attributes,{'tableName':_0x77e5('0xb'),'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 2039c99..ba08d98 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 _0x2ffc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x2ffc,0xa0));var _0xc2ff=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x2ffc[_0x55d58f];return _0x1ad6e6;};'use strict';var _=require(_0xc2ff('0x0'));var util=require(_0xc2ff('0x1'));var moment=require(_0xc2ff('0x2'));var BPromise=require(_0xc2ff('0x3'));var rs=require(_0xc2ff('0x4'));var fs=require('fs');var Redis=require(_0xc2ff('0x5'));var db=require(_0xc2ff('0x6'))['db'];var utils=require(_0xc2ff('0x7'));var logger=require('../../config/logger')(_0xc2ff('0x8'));var config=require('../../config/environment');var jayson=require(_0xc2ff('0x9'));var client=jayson[_0xc2ff('0xa')][_0xc2ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x583963,_0x2b6047,_0x36097a){return new BPromise(function(_0x5d273b,_0x5bf499){return client['request'](_0x583963,_0x36097a)[_0xc2ff('0xc')](function(_0x3b9346){logger[_0xc2ff('0xd')](_0xc2ff('0xe'),_0x2b6047,_0xc2ff('0xf'));logger['debug'](_0xc2ff('0x10'),_0x2b6047,_0xc2ff('0xf'),JSON[_0xc2ff('0x11')](_0x3b9346));if(_0x3b9346[_0xc2ff('0x12')]){if(_0x3b9346[_0xc2ff('0x12')][_0xc2ff('0x13')]===0x1f4){logger[_0xc2ff('0x12')](_0xc2ff('0xe'),_0x2b6047,_0x3b9346['error'][_0xc2ff('0x14')]);return _0x5bf499(_0x3b9346['error'][_0xc2ff('0x14')]);}logger[_0xc2ff('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2b6047,_0x3b9346[_0xc2ff('0x12')][_0xc2ff('0x14')]);return _0x5d273b(_0x3b9346[_0xc2ff('0x12')][_0xc2ff('0x14')]);}else{logger[_0xc2ff('0xd')](_0xc2ff('0xe'),_0x2b6047,_0xc2ff('0xf'));_0x5d273b(_0x3b9346[_0xc2ff('0x15')]['message']);}})[_0xc2ff('0x16')](function(_0x469224){logger[_0xc2ff('0x12')](_0xc2ff('0xe'),_0x2b6047,_0x469224);_0x5bf499(_0x469224);});});} \ No newline at end of file +var _0xb6d7=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x114c1c,_0x5bfd6d){var _0x50a0a6=function(_0x4f97f0){while(--_0x4f97f0){_0x114c1c['push'](_0x114c1c['shift']());}};_0x50a0a6(++_0x5bfd6d);}(_0xb6d7,0x1b0));var _0x7b6d=function(_0x5429c5,_0x331b58){_0x5429c5=_0x5429c5-0x0;var _0x44138d=_0xb6d7[_0x5429c5];return _0x44138d;};'use strict';var _=require('lodash');var util=require(_0x7b6d('0x0'));var moment=require(_0x7b6d('0x1'));var BPromise=require(_0x7b6d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b6d('0x3'));var db=require(_0x7b6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b6d('0x5'));var config=require(_0x7b6d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7b6d('0x7')][_0x7b6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd947eb,_0x403f76,_0x42116b){return new BPromise(function(_0x1e5c0b,_0x5a4c2f){return client[_0x7b6d('0x9')](_0xd947eb,_0x42116b)[_0x7b6d('0xa')](function(_0x3ae726){logger[_0x7b6d('0xb')](_0x7b6d('0xc'),_0x403f76,'request\x20sent');logger[_0x7b6d('0xd')](_0x7b6d('0xe'),_0x403f76,_0x7b6d('0xf'),JSON['stringify'](_0x3ae726));if(_0x3ae726[_0x7b6d('0x10')]){if(_0x3ae726[_0x7b6d('0x10')][_0x7b6d('0x11')]===0x1f4){logger[_0x7b6d('0x10')](_0x7b6d('0xc'),_0x403f76,_0x3ae726[_0x7b6d('0x10')][_0x7b6d('0x12')]);return _0x5a4c2f(_0x3ae726[_0x7b6d('0x10')][_0x7b6d('0x12')]);}logger[_0x7b6d('0x10')](_0x7b6d('0xc'),_0x403f76,_0x3ae726[_0x7b6d('0x10')]['message']);return _0x1e5c0b(_0x3ae726['error']['message']);}else{logger[_0x7b6d('0xb')](_0x7b6d('0xc'),_0x403f76,_0x7b6d('0xf'));_0x1e5c0b(_0x3ae726[_0x7b6d('0x13')]['message']);}})[_0x7b6d('0x14')](function(_0x4b0e45){logger[_0x7b6d('0x10')](_0x7b6d('0xc'),_0x403f76,_0x4b0e45);_0x5a4c2f(_0x4b0e45);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b8c472f..48512c3 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 _0x2448=['./userProfile.controller','get','index','isAuthenticated','describe','/:id','show','getSections','/:id/resources','post','create','/:id/clone','clone','addResources','put','destroy','delete','/:id/sections','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router'];(function(_0x5e146f,_0x5c04f9){var _0x44ce4d=function(_0xb4744f){while(--_0xb4744f){_0x5e146f['push'](_0x5e146f['shift']());}};_0x44ce4d(++_0x5c04f9);}(_0x2448,0x167));var _0x8244=function(_0x3362a9,_0x987616){_0x3362a9=_0x3362a9-0x0;var _0x32a591=_0x2448[_0x3362a9];return _0x32a591;};'use strict';var multer=require(_0x8244('0x0'));var util=require(_0x8244('0x1'));var path=require(_0x8244('0x2'));var timeout=require(_0x8244('0x3'));var express=require('express');var router=express[_0x8244('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8244('0x5'));router[_0x8244('0x6')]('/',auth['isAuthenticated'](),controller[_0x8244('0x7')]);router[_0x8244('0x6')]('/describe',auth[_0x8244('0x8')](),controller[_0x8244('0x9')]);router[_0x8244('0x6')](_0x8244('0xa'),auth[_0x8244('0x8')](),controller[_0x8244('0xb')]);router[_0x8244('0x6')]('/:id/sections',auth[_0x8244('0x8')](),controller[_0x8244('0xc')]);router[_0x8244('0x6')](_0x8244('0xd'),auth[_0x8244('0x8')](),controller['getResources']);router[_0x8244('0xe')]('/',auth[_0x8244('0x8')](),controller[_0x8244('0xf')]);router['post'](_0x8244('0x10'),auth['isAuthenticated'](),controller[_0x8244('0x11')]);router[_0x8244('0xe')]('/:id/sections',auth[_0x8244('0x8')](),controller['addSections']);router[_0x8244('0xe')](_0x8244('0xd'),auth[_0x8244('0x8')](),controller[_0x8244('0x12')]);router[_0x8244('0x13')](_0x8244('0xa'),auth[_0x8244('0x8')](),controller['update']);router['delete'](_0x8244('0xa'),auth[_0x8244('0x8')](),controller[_0x8244('0x14')]);router[_0x8244('0x15')](_0x8244('0x16'),auth[_0x8244('0x8')](),controller[_0x8244('0x17')]);router[_0x8244('0x15')](_0x8244('0xd'),auth[_0x8244('0x8')](),controller[_0x8244('0x18')]);module[_0x8244('0x19')]=router; \ No newline at end of file +var _0x88a2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getSections','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88a2,0x167));var _0x288a=function(_0x4224c9,_0x4715b4){_0x4224c9=_0x4224c9-0x0;var _0xa815d=_0x88a2[_0x4224c9];return _0xa815d;};'use strict';var multer=require(_0x288a('0x0'));var util=require(_0x288a('0x1'));var path=require(_0x288a('0x2'));var timeout=require(_0x288a('0x3'));var express=require(_0x288a('0x4'));var router=express[_0x288a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x288a('0x6'));var interaction=require(_0x288a('0x7'));var config=require(_0x288a('0x8'));var controller=require('./userProfile.controller');router[_0x288a('0x9')]('/',auth[_0x288a('0xa')](),controller[_0x288a('0xb')]);router[_0x288a('0x9')](_0x288a('0xc'),auth[_0x288a('0xa')](),controller[_0x288a('0xd')]);router[_0x288a('0x9')](_0x288a('0xe'),auth[_0x288a('0xa')](),controller['show']);router['get']('/:id/sections',auth[_0x288a('0xa')](),controller[_0x288a('0xf')]);router[_0x288a('0x9')](_0x288a('0x10'),auth['isAuthenticated'](),controller[_0x288a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x288a('0x12')](_0x288a('0x13'),auth[_0x288a('0xa')](),controller[_0x288a('0x14')]);router[_0x288a('0x12')](_0x288a('0x15'),auth[_0x288a('0xa')](),controller[_0x288a('0x16')]);router[_0x288a('0x12')](_0x288a('0x10'),auth[_0x288a('0xa')](),controller[_0x288a('0x17')]);router[_0x288a('0x18')](_0x288a('0xe'),auth['isAuthenticated'](),controller[_0x288a('0x19')]);router[_0x288a('0x1a')]('/:id',auth[_0x288a('0xa')](),controller['destroy']);router[_0x288a('0x1a')](_0x288a('0x15'),auth[_0x288a('0xa')](),controller['removeSections']);router[_0x288a('0x1a')](_0x288a('0x10'),auth['isAuthenticated'](),controller['removeResources']);module[_0x288a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f52511f..bfed90a 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 _0x7b61=['setDataValue','crudPermissions','getDataValue','BOOLEAN','exports','STRING'];(function(_0x3ecbe0,_0x3e89ae){var _0x5ac858=function(_0x1856de){while(--_0x1856de){_0x3ecbe0['push'](_0x3ecbe0['shift']());}};_0x5ac858(++_0x3e89ae);}(_0x7b61,0x154));var _0x17b6=function(_0x461e00,_0x5d2b8f){_0x461e00=_0x461e00-0x0;var _0x4dbe74=_0x7b61[_0x461e00];return _0x4dbe74;};'use strict';var Sequelize=require('sequelize');module[_0x17b6('0x0')]={'name':{'type':Sequelize[_0x17b6('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3d46c2){this[_0x17b6('0x2')](_0x17b6('0x3'),_0x3d46c2?_0x3d46c2['join'](''):[]);},'get':function(){return this[_0x17b6('0x4')]('crudPermissions')?this['getDataValue'](_0x17b6('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x17b6('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6e10=['crudPermissions','split','BOOLEAN','STRING','name','join','getDataValue'];(function(_0xb41148,_0x120d1a){var _0x4e97cd=function(_0x1e88c8){while(--_0x1e88c8){_0xb41148['push'](_0xb41148['shift']());}};_0x4e97cd(++_0x120d1a);}(_0x6e10,0x145));var _0x06e1=function(_0x5b9639,_0x1c3296){_0x5b9639=_0x5b9639-0x0;var _0x14c112=_0x6e10[_0x5b9639];return _0x14c112;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x06e1('0x0')],'allowNull':![],'unique':_0x06e1('0x1')},'crudPermissions':{'type':Sequelize[_0x06e1('0x0')],'set':function(_0x5b74ef){this['setDataValue']('crudPermissions',_0x5b74ef?_0x5b74ef[_0x06e1('0x2')](''):[]);},'get':function(){return this[_0x06e1('0x3')](_0x06e1('0x4'))?this['getDataValue'](_0x06e1('0x4'))[_0x06e1('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x06e1('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x06e1('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x06e1('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x06e1('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d1f4060..4ca7170 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 _0x0a93=['mustache','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','include','UserProfile','rows','catch','params','includeAll','options','find','create','clone','get','omit','createdAt','updatedAt','body','sequelize','transaction','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','each','push','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0a93,0x6a));var _0x30a9=function(_0x342574,_0x4cbff8){_0x342574=_0x342574-0x0;var _0x41181f=_0x0a93[_0x342574];return _0x41181f;};'use strict';var emlformat=require(_0x30a9('0x0'));var rimraf=require(_0x30a9('0x1'));var zipdir=require(_0x30a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30a9('0x3'));var moment=require(_0x30a9('0x4'));var BPromise=require(_0x30a9('0x5'));var Mustache=require(_0x30a9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a9('0x7'));var _=require(_0x30a9('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x30a9('0x9'));var deskjs=require(_0x30a9('0xa'));var toCsv=require(_0x30a9('0xb'));var querystring=require('querystring');var Papa=require(_0x30a9('0xc'));var Redis=require(_0x30a9('0xd'));var authService=require(_0x30a9('0xe'));var qs=require(_0x30a9('0xf'));var as=require(_0x30a9('0x10'));var hardwareService=require(_0x30a9('0x11'));var logger=require(_0x30a9('0x12'))(_0x30a9('0x13'));var utils=require(_0x30a9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x30a9('0x15'));var db=require(_0x30a9('0x16'))['db'];config[_0x30a9('0x17')]=_[_0x30a9('0x18')](config['redis'],{'host':_0x30a9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30a9('0x17')]));require(_0x30a9('0x1a'))['register'](socket);function respondWithStatusCode(_0x58a4f3,_0x44fdd4){_0x44fdd4=_0x44fdd4||0xcc;return function(_0x3d96ee){if(_0x3d96ee){return _0x58a4f3['sendStatus'](_0x44fdd4);}return _0x58a4f3[_0x30a9('0x1b')](_0x44fdd4)[_0x30a9('0x1c')]();};}function respondWithResult(_0x3c50d1,_0x17fec2){_0x17fec2=_0x17fec2||0xc8;return function(_0x39cee7){if(_0x39cee7){return _0x3c50d1[_0x30a9('0x1b')](_0x17fec2)['json'](_0x39cee7);}};}function respondWithFilteredResult(_0x22521d,_0x2be156){return function(_0x1a3c7a){if(_0x1a3c7a){var _0x145868=typeof _0x2be156[_0x30a9('0x1d')]===_0x30a9('0x1e')&&typeof _0x2be156[_0x30a9('0x1f')]===_0x30a9('0x1e');var _0x1c412c=_0x1a3c7a[_0x30a9('0x20')];var _0x5129cc=_0x145868?0x0:_0x2be156[_0x30a9('0x1d')];var _0x57605=_0x145868?_0x1a3c7a[_0x30a9('0x20')]:_0x2be156[_0x30a9('0x1d')]+_0x2be156['limit'];var _0x510594;if(_0x57605>=_0x1c412c){_0x57605=_0x1c412c;_0x510594=0xc8;}else{_0x510594=0xce;}_0x22521d[_0x30a9('0x1b')](_0x510594);return _0x22521d[_0x30a9('0x21')]('Content-Range',_0x5129cc+'-'+_0x57605+'/'+_0x1c412c)[_0x30a9('0x22')](_0x1a3c7a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x58d8b7){try{jsonpatch[_0x30a9('0x23')](_0x58d8b7,_0x4c92e8,!![]);}catch(_0x5a6e49){return BPromise[_0x30a9('0x24')](_0x5a6e49);}return _0x58d8b7[_0x30a9('0x25')]();};}function saveUpdates(_0x4e9bca,_0x25eb85){return function(_0x54e545){if(_0x54e545){return _0x54e545[_0x30a9('0x26')](_0x4e9bca)[_0x30a9('0x27')](function(_0x20b2c7){return _0x20b2c7;});}return null;};}function removeEntity(_0x609046,_0x405744){return function(_0x45cfc3){if(_0x45cfc3){return _0x45cfc3[_0x30a9('0x28')]()['then'](function(){_0x609046[_0x30a9('0x1b')](0xcc)[_0x30a9('0x1c')]();});}};}function handleEntityNotFound(_0x1bf9a3,_0x31c411){return function(_0x9d7e73){if(!_0x9d7e73){_0x1bf9a3[_0x30a9('0x29')](0x194);}return _0x9d7e73;};}function handleError(_0x41956c,_0xddd59b){_0xddd59b=_0xddd59b||0x1f4;return function(_0x294aa8){logger[_0x30a9('0x2a')](_0x294aa8['stack']);if(_0x294aa8[_0x30a9('0x2b')]){delete _0x294aa8['name'];}_0x41956c[_0x30a9('0x1b')](_0xddd59b)[_0x30a9('0x2c')](_0x294aa8);};}exports[_0x30a9('0x2d')]=function(_0x1eed14,_0x1259db){var _0xdf878e={},_0x2f9a5c={},_0x44e4d9={'count':0x0,'rows':[]};var _0x15f6ea=_[_0x30a9('0x2e')](db['UserProfile'][_0x30a9('0x2f')],function(_0x52c5cc){return{'name':_0x52c5cc[_0x30a9('0x30')],'type':_0x52c5cc[_0x30a9('0x31')][_0x30a9('0x32')]};});_0x2f9a5c['model']=_[_0x30a9('0x2e')](_0x15f6ea,_0x30a9('0x2b'));_0x2f9a5c[_0x30a9('0x33')]=_[_0x30a9('0x34')](_0x1eed14['query']);_0x2f9a5c[_0x30a9('0x35')]=_['intersection'](_0x2f9a5c['model'],_0x2f9a5c[_0x30a9('0x33')]);_0xdf878e['attributes']=_[_0x30a9('0x36')](_0x2f9a5c[_0x30a9('0x37')],qs[_0x30a9('0x38')](_0x1eed14['query'][_0x30a9('0x38')]));_0xdf878e[_0x30a9('0x39')]=_0xdf878e[_0x30a9('0x39')][_0x30a9('0x3a')]?_0xdf878e['attributes']:_0x2f9a5c[_0x30a9('0x37')];if(!_0x1eed14[_0x30a9('0x33')]['hasOwnProperty'](_0x30a9('0x3b'))){_0xdf878e[_0x30a9('0x1f')]=qs[_0x30a9('0x1f')](_0x1eed14['query'][_0x30a9('0x1f')]);_0xdf878e['offset']=qs[_0x30a9('0x1d')](_0x1eed14[_0x30a9('0x33')][_0x30a9('0x1d')]);}_0xdf878e[_0x30a9('0x3c')]=qs[_0x30a9('0x3d')](_0x1eed14['query'][_0x30a9('0x3d')]);_0xdf878e[_0x30a9('0x3e')]=qs['filters'](_[_0x30a9('0x3f')](_0x1eed14[_0x30a9('0x33')],_0x2f9a5c[_0x30a9('0x35')]),_0x15f6ea);if(_0x1eed14[_0x30a9('0x33')][_0x30a9('0x40')]){_0xdf878e['where']=_[_0x30a9('0x41')](_0xdf878e[_0x30a9('0x3e')],{'$or':_['map'](_0x15f6ea,function(_0x20aab6){if(_0x20aab6['type']!=='VIRTUAL'){var _0x204879={};_0x204879[_0x20aab6[_0x30a9('0x2b')]]={'$like':'%'+_0x1eed14[_0x30a9('0x33')]['filter']+'%'};return _0x204879;}})});}_0xdf878e=_[_0x30a9('0x41')]({},_0xdf878e,_0x1eed14['options']);var _0x252a85={'where':_0xdf878e[_0x30a9('0x3e')]};return db['UserProfile'][_0x30a9('0x20')](_0x252a85)[_0x30a9('0x27')](function(_0x144946){_0x44e4d9[_0x30a9('0x20')]=_0x144946;if(_0x1eed14[_0x30a9('0x33')]['includeAll']){_0xdf878e[_0x30a9('0x42')]=[{'all':!![]}];}return db[_0x30a9('0x43')]['findAll'](_0xdf878e);})[_0x30a9('0x27')](function(_0x210085){_0x44e4d9[_0x30a9('0x44')]=_0x210085;return _0x44e4d9;})[_0x30a9('0x27')](respondWithFilteredResult(_0x1259db,_0xdf878e))[_0x30a9('0x45')](handleError(_0x1259db,null));};exports['show']=function(_0x4c1f4a,_0x35a173){var _0x5d68f9={'raw':![],'where':{'id':_0x4c1f4a[_0x30a9('0x46')]['id']}},_0x1dad07={};_0x1dad07[_0x30a9('0x37')]=_[_0x30a9('0x34')](db[_0x30a9('0x43')][_0x30a9('0x2f')]);_0x1dad07[_0x30a9('0x33')]=_[_0x30a9('0x34')](_0x4c1f4a[_0x30a9('0x33')]);_0x1dad07[_0x30a9('0x35')]=_[_0x30a9('0x36')](_0x1dad07[_0x30a9('0x37')],_0x1dad07[_0x30a9('0x33')]);_0x5d68f9[_0x30a9('0x39')]=_[_0x30a9('0x36')](_0x1dad07['model'],qs[_0x30a9('0x38')](_0x4c1f4a[_0x30a9('0x33')][_0x30a9('0x38')]));_0x5d68f9['attributes']=_0x5d68f9[_0x30a9('0x39')][_0x30a9('0x3a')]?_0x5d68f9[_0x30a9('0x39')]:_0x1dad07[_0x30a9('0x37')];if(_0x4c1f4a['query'][_0x30a9('0x47')]){_0x5d68f9[_0x30a9('0x42')]=[{'all':!![]}];}_0x5d68f9=_['merge']({},_0x5d68f9,_0x4c1f4a[_0x30a9('0x48')]);return db[_0x30a9('0x43')][_0x30a9('0x49')](_0x5d68f9)[_0x30a9('0x27')](handleEntityNotFound(_0x35a173,null))[_0x30a9('0x27')](respondWithResult(_0x35a173,null))['catch'](handleError(_0x35a173,null));};exports['create']=function(_0x2d902b,_0x3fa36c){return db['UserProfile'][_0x30a9('0x4a')](_0x2d902b['body'],{})[_0x30a9('0x27')](respondWithResult(_0x3fa36c,0xc9))[_0x30a9('0x45')](handleError(_0x3fa36c,null));};exports[_0x30a9('0x4b')]=function(_0x594133,_0x4ce93e){var _0x16a3c9={'where':{'id':_0x594133[_0x30a9('0x46')]['id']}},_0x27c6bc={};_0x27c6bc[_0x30a9('0x37')]=_[_0x30a9('0x34')](db[_0x30a9('0x43')][_0x30a9('0x2f')]);_0x16a3c9[_0x30a9('0x39')]=_['intersection'](_0x27c6bc['model'],qs[_0x30a9('0x38')](_0x594133['query'][_0x30a9('0x38')]));_0x16a3c9['attributes']=_0x16a3c9['attributes']['length']?_0x16a3c9[_0x30a9('0x39')]:_0x27c6bc[_0x30a9('0x37')];if(_0x594133[_0x30a9('0x33')][_0x30a9('0x47')]){_0x16a3c9[_0x30a9('0x42')]=[{'all':!![]}];}_0x16a3c9=_['merge']({},_0x16a3c9,_0x594133[_0x30a9('0x48')]);return db[_0x30a9('0x43')][_0x30a9('0x49')](_0x16a3c9)[_0x30a9('0x27')](handleEntityNotFound(_0x4ce93e,null))[_0x30a9('0x27')](function(_0x2dd276){if(_0x2dd276){var _0xfbfbfb=_0x2dd276[_0x30a9('0x4c')]({'plain':!![]});_0xfbfbfb=qs[_0x30a9('0x4d')](_0xfbfbfb,['id',_0x30a9('0x4e'),_0x30a9('0x4f'),'crudPermissions']);_0x594133[_0x30a9('0x50')]=_['omit'](_0x594133[_0x30a9('0x50')],['id',_0x30a9('0x4e'),_0x30a9('0x4f')]);return db[_0x30a9('0x51')][_0x30a9('0x52')](function(_0x535344){return db[_0x30a9('0x43')][_0x30a9('0x4a')](_['merge'](_0xfbfbfb,_0x594133[_0x30a9('0x50')]),{'include':_0x594133[_0x30a9('0x33')][_0x30a9('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x535344})[_0x30a9('0x27')](function(_0x401397){var _0x114a63=_0x401397[_0x30a9('0x4c')]({'plain':!![]});return db[_0x30a9('0x53')][_0x30a9('0x54')]({'where':{'userProfileId':_0x594133[_0x30a9('0x46')]['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x3685fb){if(_0x3685fb){return BPromise['each'](_0x3685fb,function(_0x5d37cc){return new BPromise(function(_0x5176cd,_0x13c66f){if(_0x5d37cc[_0x30a9('0x55')]===null||_0x5d37cc[_0x30a9('0x55')]===0x1)_0x5176cd(null);return db[_0x30a9('0x56')][_0x30a9('0x54')]({'where':{'sectionId':_0x5d37cc['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x533dce){var _0x5da981=_[_0x30a9('0x2e')](_0x533dce,function(_0x24b858){return qs[_0x30a9('0x4d')](_0x24b858,['id',_0x30a9('0x4e'),_0x30a9('0x4f'),_0x30a9('0x57')]);});_0x5176cd(_0x5da981);})[_0x30a9('0x45')](function(_0x137aca){_0x13c66f(_0x137aca);});})[_0x30a9('0x27')](function(_0x1d3baa){var _0x677746=qs[_0x30a9('0x4d')](_0x5d37cc,['id','createdAt',_0x30a9('0x4f')]);_0x677746[_0x30a9('0x58')]=_0x114a63['id'];if(_0x1d3baa)_0x677746['Resources']=_0x1d3baa;return _0x677746;})[_0x30a9('0x27')](function(_0x2e97d4){return db[_0x30a9('0x53')][_0x30a9('0x4a')](_0x2e97d4,{'include':[{'model':db['UserProfileResource'],'as':_0x30a9('0x59')}],'raw':!![],'transaction':_0x535344});});})[_0x30a9('0x27')](function(){return _0x114a63;});}});});});}})[_0x30a9('0x27')](respondWithResult(_0x4ce93e,0xc9))['catch'](handleError(_0x4ce93e,null));};exports['update']=function(_0xdf8e3f,_0x3ce04a){if(_0xdf8e3f['body']['id']){delete _0xdf8e3f[_0x30a9('0x50')]['id'];}return db['UserProfile'][_0x30a9('0x49')]({'where':{'id':_0xdf8e3f[_0x30a9('0x46')]['id']}})[_0x30a9('0x27')](handleEntityNotFound(_0x3ce04a,null))[_0x30a9('0x27')](saveUpdates(_0xdf8e3f[_0x30a9('0x50')],null))['then'](respondWithResult(_0x3ce04a,null))[_0x30a9('0x45')](handleError(_0x3ce04a,null));};exports[_0x30a9('0x28')]=function(_0x359b30,_0xb96f7b){return db[_0x30a9('0x43')][_0x30a9('0x49')]({'where':{'id':_0x359b30[_0x30a9('0x46')]['id']}})['then'](handleEntityNotFound(_0xb96f7b,null))[_0x30a9('0x27')](removeEntity(_0xb96f7b,null))['catch'](handleError(_0xb96f7b,null));};exports[_0x30a9('0x5a')]=function(_0x59e9d5,_0x377c9b){return db[_0x30a9('0x43')]['describe']()[_0x30a9('0x27')](respondWithResult(_0x377c9b,null))[_0x30a9('0x45')](handleError(_0x377c9b,null));};exports[_0x30a9('0x5b')]=function(_0x58533d,_0x5d837a){var _0x1e69fc=_0x58533d[_0x30a9('0x50')];return db['UserProfile'][_0x30a9('0x49')]({'where':{'id':_0x58533d[_0x30a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d837a,null))[_0x30a9('0x27')](function(_0x434bd7){if(_0x434bd7){return db[_0x30a9('0x51')][_0x30a9('0x52')](function(_0x9a3315){return db[_0x30a9('0x53')]['destroy']({'where':{'userProfileId':_0x58533d[_0x30a9('0x46')]['id'],'sectionId':_['map'](_0x1e69fc,function(_0x5a375d){return _0x5a375d[_0x30a9('0x57')];})},'transaction':_0x9a3315})[_0x30a9('0x27')](function(){var _0x248d1e=_[_0x30a9('0x2e')](_0x1e69fc,function(_0x2a4aef){_0x2a4aef[_0x30a9('0x58')]=_0x58533d[_0x30a9('0x46')]['id'];return _0x2a4aef;});var _0xd4fb3b=[];return BPromise[_0x30a9('0x5c')](_0x248d1e,function(_0x54cbf5){return db[_0x30a9('0x53')]['create'](_0x54cbf5,{'include':[{'model':db[_0x30a9('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x9a3315})['then'](function(_0x5ab892){_0xd4fb3b[_0x30a9('0x5d')](_0x5ab892[_0x30a9('0x4c')]({'plain':!![]}));});})[_0x30a9('0x27')](function(){return _0xd4fb3b;});});});}})[_0x30a9('0x27')](function(_0x5c4577){return _0x5c4577;})[_0x30a9('0x27')](respondWithResult(_0x5d837a,null))['catch'](handleError(_0x5d837a,null));};exports['removeSections']=function(_0x233669,_0x2a3525){var _0x12b59b;return db[_0x30a9('0x43')][_0x30a9('0x49')]({'where':{'id':_0x233669['params']['id']},'attributes':['id',_0x30a9('0x2b')]})[_0x30a9('0x27')](handleEntityNotFound(_0x2a3525,null))[_0x30a9('0x27')](function(_0x50f8af){if(_0x50f8af){_0x12b59b=_0x50f8af;return db[_0x30a9('0x53')][_0x30a9('0x28')]({'where':{'userProfileId':_0x233669[_0x30a9('0x46')]['id'],'sectionId':_0x233669[_0x30a9('0x33')][_0x30a9('0x5e')]}});}})[_0x30a9('0x27')](function(){return _0x12b59b;})[_0x30a9('0x27')](respondWithStatusCode(_0x2a3525,null))[_0x30a9('0x45')](handleError(_0x2a3525,null));};exports[_0x30a9('0x5f')]=function(_0x19ee01,_0x5ce48e){var _0x3c2785=[];var _0x153a84=[];return db[_0x30a9('0x53')]['findAll']({'where':{'userProfileId':_0x19ee01[_0x30a9('0x46')]['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x487f14){_0x3c2785=_[_0x30a9('0x40')](_0x487f14,function(_0xdd2b21){return _0xdd2b21[_0x30a9('0x60')]===0x1||_['includes']([0x3eb,0x709],_0xdd2b21[_0x30a9('0x57')]);});if(!_[_0x30a9('0x61')](_0x3c2785)){return _[_0x30a9('0x2e')](_0x3c2785,function(_0x29c4f2){return _0x29c4f2[_0x30a9('0x57')];});}else{return;}})[_0x30a9('0x27')](function(_0x2ca9d7){if(_0x2ca9d7)_0x153a84=_0x2ca9d7;if(_['includes'](_0x153a84,0x64)){var _0x4e2511=_['find'](_0x3c2785,{'sectionId':0x64});return hasDefaultDashboard(_0x4e2511)[_0x30a9('0x27')](function(_0x4212ef){return _[_0x30a9('0x2e')](_0x3c2785,function(_0x3cca5c){if(_0x3cca5c[_0x30a9('0x57')]===0x64){_0x3cca5c['subsections']=_0x4212ef;}return _0x3cca5c;});});}else{return;}})[_0x30a9('0x27')](function(_0x414194){if(_0x414194)_0x3c2785=_0x414194;if(_[_0x30a9('0x62')](_0x153a84,0x3eb)){var _0x12f5d3=_[_0x30a9('0x49')](_0x3c2785,{'sectionId':0x3eb});return getCustomDashboards(_0x12f5d3)[_0x30a9('0x27')](function(_0x2e3acc){return _[_0x30a9('0x2e')](_0x3c2785,function(_0x3adabc){if(_0x12f5d3[_0x30a9('0x60')]){if(_0x3adabc[_0x30a9('0x57')]===0x3eb){_0x3adabc[_0x30a9('0x63')]=_0x2e3acc;}}else{if(_0x3adabc[_0x30a9('0x57')]===0x64){_0x3adabc[_0x30a9('0x63')]=_0x2e3acc;}}return _0x3adabc;});});}else{return;}})[_0x30a9('0x27')](function(_0x43d165){if(_0x43d165)_0x3c2785=_0x43d165;if(_[_0x30a9('0x62')](_0x153a84,0x709)){var _0x3546d0=_[_0x30a9('0x49')](_0x3c2785,{'sectionId':0x709});return getPlugins(_0x3546d0)[_0x30a9('0x27')](function(_0x43ddff){if(_0x3546d0[_0x30a9('0x60')]){return _[_0x30a9('0x2e')](_0x3c2785,function(_0x4f6015){if(_0x4f6015[_0x30a9('0x57')]===0x709){_0x4f6015[_0x30a9('0x63')]=_0x43ddff;}return _0x4f6015;});}else{var _0x128b6c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x43ddff};var _0x27acd4=_[_0x30a9('0x2e')](_0x3c2785);_0x27acd4['push'](_0x128b6c);return _0x27acd4;}});}else{return;}})[_0x30a9('0x27')](function(_0x21220c){if(_0x21220c)_0x3c2785=_0x21220c;return _['filter'](_0x3c2785,[_0x30a9('0x60'),0x1]);})[_0x30a9('0x27')](respondWithResult(_0x5ce48e,null))['catch'](handleError(_0x5ce48e,null));};function hasDefaultDashboard(_0x844555){var _0x51edf8=[0x65];return new BPromise(function(_0x13fd01,_0x4f5c83){try{if(_0x844555['autoAssociation']){_0x13fd01(_0x51edf8);}else{return db[_0x30a9('0x56')][_0x30a9('0x64')]({'where':{'sectionId':_0x844555['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x1cdfd0){_0x1cdfd0?_0x13fd01(_0x51edf8):_0x13fd01();});}}catch(_0x5deb65){_0x4f5c83(_0x5deb65);}});}function getCustomDashboards(_0x1ae55f){var _0x3b76ef=[];return new BPromise(function(_0x47c12d,_0x2a2ce4){try{if(_0x1ae55f[_0x30a9('0x55')]){return db[_0x30a9('0x65')][_0x30a9('0x54')]({'raw':!![]})[_0x30a9('0x27')](function(_0x3e291f){_0x3e291f[_0x30a9('0x66')](function(_0x11fe92){_0x3b76ef[_0x30a9('0x5d')](_0x11fe92['id']+0x1869f);});_0x47c12d(_0x3b76ef);});}else{return db['UserProfileResource'][_0x30a9('0x54')]({'where':{'sectionId':_0x1ae55f['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x1282fd){_0x1282fd[_0x30a9('0x66')](function(_0x449700){_0x3b76ef[_0x30a9('0x5d')](_0x449700[_0x30a9('0x67')]+0x1869f);});_0x47c12d(_0x3b76ef);});}}catch(_0x2ee971){_0x2a2ce4(_0x2ee971);}});}function getPlugins(_0x40a6ba){var _0xc41f03=[];return new BPromise(function(_0x26aedf,_0x1bca6c){try{if(_0x40a6ba['autoAssociation']){return db['Plugin'][_0x30a9('0x54')]({'raw':!![]})[_0x30a9('0x27')](function(_0x2cd102){_0x2cd102[_0x30a9('0x66')](function(_0x4b10cf){_0xc41f03[_0x30a9('0x5d')](_0x4b10cf['id']+0x15b38);});_0x26aedf(_0xc41f03);});}else{return db[_0x30a9('0x56')][_0x30a9('0x54')]({'where':{'sectionId':_0x40a6ba['id']},'raw':!![]})[_0x30a9('0x27')](function(_0x231fae){_0x231fae[_0x30a9('0x66')](function(_0x5b45fb){_0xc41f03[_0x30a9('0x5d')](_0x5b45fb[_0x30a9('0x67')]+0x15b38);});_0x26aedf(_0xc41f03);});}}catch(_0x426259){_0x1bca6c(_0x426259);}});}exports[_0x30a9('0x68')]=function(_0x2ec0ac,_0x675390){return db[_0x30a9('0x43')]['find']({'where':{'id':_0x2ec0ac[_0x30a9('0x46')]['id']}})[_0x30a9('0x27')](handleEntityNotFound(_0x675390,null))[_0x30a9('0x27')](function(_0x3b5d6c){if(_0x3b5d6c){return db[_0x30a9('0x51')][_0x30a9('0x52')](function(_0x3e358c){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2ec0ac['params']['id']},'attributes':['id'],'raw':!![]})[_0x30a9('0x27')](function(_0x1e145d){if(_0x1e145d){return db[_0x30a9('0x53')][_0x30a9('0x28')]({'where':{'userProfileId':_0x2ec0ac[_0x30a9('0x46')]['id'],'id':_['map'](_0x1e145d,function(_0xd5f06d){return _0xd5f06d['id'];})},'transaction':_0x3e358c});}})[_0x30a9('0x27')](function(_0x20b3b1){var _0x2f4084=_[_0x30a9('0x2e')](_0x2ec0ac[_0x30a9('0x50')],function(_0xaf2b2e){_0xaf2b2e[_0x30a9('0x58')]=_0x2ec0ac['params']['id'];return _0xaf2b2e;});return db[_0x30a9('0x53')][_0x30a9('0x69')](_0x2f4084,{'raw':!![],'transaction':_0x3e358c});})[_0x30a9('0x27')](function(_0x5a7ec1){var _0x512666=_[_0x30a9('0x40')](_['map'](_0x5a7ec1,function(_0x4861b5){return _0x4861b5[_0x30a9('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x512666){return db['UserProfileSection'][_0x30a9('0x54')]({'where':{'userProfileId':_0x2ec0ac[_0x30a9('0x46')]['id'],'sectionId':_['map'](_0x512666,function(_0x3856a0){return _0x3856a0[_0x30a9('0x57')];})},'attributes':['id',_0x30a9('0x57')],'raw':!![]})[_0x30a9('0x27')](function(_0x5c3204){var _0x4e8562=_[_0x30a9('0x2e')](_0x2ec0ac['body'],function(_0x48dec8){_0x48dec8[_0x30a9('0x58')]=_0x2ec0ac['params']['id'];return _0x48dec8;});return db[_0x30a9('0x56')]['bulkCreate'](_0x4e8562,{'raw':!![],'transaction':_0x3e358c});});}})[_0x30a9('0x45')](handleError(_0x675390,null));});}})[_0x30a9('0x27')](function(_0x27f640){var _0x2056b7=_[_0x30a9('0x2e')](_0x27f640,function(_0xfd8051){return _0xfd8051['get']({'plain':!![]});});})['then'](respondWithResult(_0x675390,null))[_0x30a9('0x45')](handleError(_0x675390,null));};exports['removeResources']=function(_0x1f07f3,_0x33dd6f,_0x3242d6){return db[_0x30a9('0x43')][_0x30a9('0x49')]({'where':{'id':_0x1f07f3['params']['id']}})[_0x30a9('0x27')](handleEntityNotFound(_0x33dd6f,null))['then'](function(_0x25f0a0){if(_0x25f0a0){return _0x25f0a0[_0x30a9('0x6a')](_0x1f07f3[_0x30a9('0x33')]['ids']);}})[_0x30a9('0x27')](respondWithStatusCode(_0x33dd6f,null))['catch'](handleError(_0x33dd6f,null));};exports[_0x30a9('0x6b')]=function(_0x5c8b72,_0x2b3907){var _0x4abdff={};if(!_0x5c8b72[_0x30a9('0x33')][_0x30a9('0x6c')])throw new Error(_0x30a9('0x6d'));if(!_0x5c8b72[_0x30a9('0x33')][_0x30a9('0x6e')](_0x30a9('0x3b'))){_0x4abdff[_0x30a9('0x1f')]=qs[_0x30a9('0x1f')](_0x5c8b72['query'][_0x30a9('0x1f')]);_0x4abdff[_0x30a9('0x1d')]=qs[_0x30a9('0x1d')](_0x5c8b72[_0x30a9('0x33')]['offset']);}return db[_0x30a9('0x43')][_0x30a9('0x49')]({'where':{'id':_0x5c8b72[_0x30a9('0x46')]['id']}})[_0x30a9('0x27')](function(_0x3d6cb1){if(!_0x3d6cb1)throw new Error(_0x30a9('0x6f')+_0x5c8b72[_0x30a9('0x46')]['id']);return db[_0x30a9('0x43')][_0x30a9('0x6b')](_0x5c8b72);})[_0x30a9('0x27')](respondWithFilteredResult(_0x2b3907,_0x4abdff))[_0x30a9('0x45')](handleError(_0x2b3907,null));}; \ No newline at end of file +var _0x0ffc=['params','keys','find','create','clone','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','removeSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','UserProfile','rawAttributes','fieldName','key','name','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x1bbdff,_0x4ad87e){var _0x17a43d=function(_0x2aac11){while(--_0x2aac11){_0x1bbdff['push'](_0x1bbdff['shift']());}};_0x17a43d(++_0x4ad87e);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x2a4000,_0x3c88d7){_0x2a4000=_0x2a4000-0x0;var _0x226381=_0x0ffc[_0x2a4000];return _0x226381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0ff('0x0'));var zipdir=require(_0xc0ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0ff('0x2'));var moment=require('moment');var BPromise=require(_0xc0ff('0x3'));var Mustache=require(_0xc0ff('0x4'));var util=require(_0xc0ff('0x5'));var path=require(_0xc0ff('0x6'));var sox=require(_0xc0ff('0x7'));var csv=require(_0xc0ff('0x8'));var ejs=require(_0xc0ff('0x9'));var fs=require('fs');var fs_extra=require(_0xc0ff('0xa'));var _=require(_0xc0ff('0xb'));var squel=require('squel');var crypto=require(_0xc0ff('0xc'));var jsforce=require(_0xc0ff('0xd'));var deskjs=require(_0xc0ff('0xe'));var toCsv=require(_0xc0ff('0x8'));var querystring=require(_0xc0ff('0xf'));var Papa=require(_0xc0ff('0x10'));var Redis=require(_0xc0ff('0x11'));var authService=require(_0xc0ff('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0ff('0x13'));var logger=require('../../config/logger')(_0xc0ff('0x14'));var utils=require(_0xc0ff('0x15'));var config=require(_0xc0ff('0x16'));var licenseUtil=require(_0xc0ff('0x17'));var db=require('../../mysqldb')['db'];config[_0xc0ff('0x18')]=_[_0xc0ff('0x19')](config['redis'],{'host':_0xc0ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0xc0ff('0x1b')](socket);function respondWithStatusCode(_0xa91369,_0x22c91d){_0x22c91d=_0x22c91d||0xcc;return function(_0x4badd1){if(_0x4badd1){return _0xa91369[_0xc0ff('0x1c')](_0x22c91d);}return _0xa91369[_0xc0ff('0x1d')](_0x22c91d)[_0xc0ff('0x1e')]();};}function respondWithResult(_0x3ab92b,_0x2752f1){_0x2752f1=_0x2752f1||0xc8;return function(_0x1363b3){if(_0x1363b3){return _0x3ab92b[_0xc0ff('0x1d')](_0x2752f1)[_0xc0ff('0x1f')](_0x1363b3);}};}function respondWithFilteredResult(_0x136b31,_0x11014a){return function(_0x265a63){if(_0x265a63){var _0x4e8a36=typeof _0x11014a[_0xc0ff('0x20')]==='undefined'&&typeof _0x11014a[_0xc0ff('0x21')]===_0xc0ff('0x22');var _0x42a70a=_0x265a63['count'];var _0x3f8d83=_0x4e8a36?0x0:_0x11014a[_0xc0ff('0x20')];var _0x423b17=_0x4e8a36?_0x265a63[_0xc0ff('0x23')]:_0x11014a[_0xc0ff('0x20')]+_0x11014a[_0xc0ff('0x21')];var _0x19c320;if(_0x423b17>=_0x42a70a){_0x423b17=_0x42a70a;_0x19c320=0xc8;}else{_0x19c320=0xce;}_0x136b31[_0xc0ff('0x1d')](_0x19c320);return _0x136b31[_0xc0ff('0x24')](_0xc0ff('0x25'),_0x3f8d83+'-'+_0x423b17+'/'+_0x42a70a)[_0xc0ff('0x1f')](_0x265a63);}return null;};}function patchUpdates(_0x219be9){return function(_0xee982d){try{jsonpatch[_0xc0ff('0x26')](_0xee982d,_0x219be9,!![]);}catch(_0x43e745){return BPromise[_0xc0ff('0x27')](_0x43e745);}return _0xee982d['save']();};}function saveUpdates(_0x4200d4,_0x5ba2c3){return function(_0x6d4cd5){if(_0x6d4cd5){return _0x6d4cd5[_0xc0ff('0x28')](_0x4200d4)[_0xc0ff('0x29')](function(_0x3fc9c3){return _0x3fc9c3;});}return null;};}function removeEntity(_0x25f8a0,_0x3b4609){return function(_0x4a62b4){if(_0x4a62b4){return _0x4a62b4[_0xc0ff('0x2a')]()[_0xc0ff('0x29')](function(){_0x25f8a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d97c,_0x1ea3a9){return function(_0x2509ce){if(!_0x2509ce){_0x37d97c[_0xc0ff('0x1c')](0x194);}return _0x2509ce;};}function handleError(_0x2f590f,_0xd0115e){_0xd0115e=_0xd0115e||0x1f4;return function(_0x3d5699){logger[_0xc0ff('0x2b')](_0x3d5699[_0xc0ff('0x2c')]);if(_0x3d5699['name']){delete _0x3d5699['name'];}_0x2f590f['status'](_0xd0115e)[_0xc0ff('0x2d')](_0x3d5699);};}exports[_0xc0ff('0x2e')]=function(_0x34a65c,_0xf60f5a){var _0x5c17ff={},_0x773814={},_0x1cd2d4={'count':0x0,'rows':[]};var _0x327822=_[_0xc0ff('0x2f')](db[_0xc0ff('0x30')][_0xc0ff('0x31')],function(_0x29f43e){return{'name':_0x29f43e[_0xc0ff('0x32')],'type':_0x29f43e['type'][_0xc0ff('0x33')]};});_0x773814['model']=_['map'](_0x327822,_0xc0ff('0x34'));_0x773814[_0xc0ff('0x35')]=_['keys'](_0x34a65c[_0xc0ff('0x35')]);_0x773814[_0xc0ff('0x36')]=_[_0xc0ff('0x37')](_0x773814[_0xc0ff('0x38')],_0x773814[_0xc0ff('0x35')]);_0x5c17ff[_0xc0ff('0x39')]=_[_0xc0ff('0x37')](_0x773814['model'],qs[_0xc0ff('0x3a')](_0x34a65c[_0xc0ff('0x35')]['fields']));_0x5c17ff[_0xc0ff('0x39')]=_0x5c17ff[_0xc0ff('0x39')][_0xc0ff('0x3b')]?_0x5c17ff[_0xc0ff('0x39')]:_0x773814[_0xc0ff('0x38')];if(!_0x34a65c['query']['hasOwnProperty']('nolimit')){_0x5c17ff[_0xc0ff('0x21')]=qs[_0xc0ff('0x21')](_0x34a65c[_0xc0ff('0x35')][_0xc0ff('0x21')]);_0x5c17ff[_0xc0ff('0x20')]=qs['offset'](_0x34a65c[_0xc0ff('0x35')]['offset']);}_0x5c17ff['order']=qs[_0xc0ff('0x3c')](_0x34a65c[_0xc0ff('0x35')]['sort']);_0x5c17ff[_0xc0ff('0x3d')]=qs['filters'](_[_0xc0ff('0x3e')](_0x34a65c[_0xc0ff('0x35')],_0x773814[_0xc0ff('0x36')]),_0x327822);if(_0x34a65c[_0xc0ff('0x35')][_0xc0ff('0x3f')]){_0x5c17ff[_0xc0ff('0x3d')]=_['merge'](_0x5c17ff['where'],{'$or':_['map'](_0x327822,function(_0x7d270e){if(_0x7d270e[_0xc0ff('0x40')]!==_0xc0ff('0x41')){var _0x6f8b63={};_0x6f8b63[_0x7d270e[_0xc0ff('0x34')]]={'$like':'%'+_0x34a65c['query'][_0xc0ff('0x3f')]+'%'};return _0x6f8b63;}})});}_0x5c17ff=_[_0xc0ff('0x42')]({},_0x5c17ff,_0x34a65c[_0xc0ff('0x43')]);var _0x8fe69={'where':_0x5c17ff[_0xc0ff('0x3d')]};return db[_0xc0ff('0x30')][_0xc0ff('0x23')](_0x8fe69)[_0xc0ff('0x29')](function(_0x249eb7){_0x1cd2d4[_0xc0ff('0x23')]=_0x249eb7;if(_0x34a65c[_0xc0ff('0x35')][_0xc0ff('0x44')]){_0x5c17ff[_0xc0ff('0x45')]=[{'all':!![]}];}return db[_0xc0ff('0x30')][_0xc0ff('0x46')](_0x5c17ff);})['then'](function(_0x3c48cd){_0x1cd2d4[_0xc0ff('0x47')]=_0x3c48cd;return _0x1cd2d4;})['then'](respondWithFilteredResult(_0xf60f5a,_0x5c17ff))[_0xc0ff('0x48')](handleError(_0xf60f5a,null));};exports[_0xc0ff('0x49')]=function(_0xfb3815,_0x1bd6a1){var _0x3bc88d={'raw':![],'where':{'id':_0xfb3815[_0xc0ff('0x4a')]['id']}},_0x125335={};_0x125335['model']=_[_0xc0ff('0x4b')](db[_0xc0ff('0x30')][_0xc0ff('0x31')]);_0x125335[_0xc0ff('0x35')]=_[_0xc0ff('0x4b')](_0xfb3815[_0xc0ff('0x35')]);_0x125335['filters']=_[_0xc0ff('0x37')](_0x125335[_0xc0ff('0x38')],_0x125335[_0xc0ff('0x35')]);_0x3bc88d[_0xc0ff('0x39')]=_[_0xc0ff('0x37')](_0x125335[_0xc0ff('0x38')],qs[_0xc0ff('0x3a')](_0xfb3815[_0xc0ff('0x35')][_0xc0ff('0x3a')]));_0x3bc88d[_0xc0ff('0x39')]=_0x3bc88d[_0xc0ff('0x39')][_0xc0ff('0x3b')]?_0x3bc88d[_0xc0ff('0x39')]:_0x125335[_0xc0ff('0x38')];if(_0xfb3815[_0xc0ff('0x35')]['includeAll']){_0x3bc88d[_0xc0ff('0x45')]=[{'all':!![]}];}_0x3bc88d=_[_0xc0ff('0x42')]({},_0x3bc88d,_0xfb3815['options']);return db[_0xc0ff('0x30')][_0xc0ff('0x4c')](_0x3bc88d)[_0xc0ff('0x29')](handleEntityNotFound(_0x1bd6a1,null))[_0xc0ff('0x29')](respondWithResult(_0x1bd6a1,null))[_0xc0ff('0x48')](handleError(_0x1bd6a1,null));};exports['create']=function(_0x3113c7,_0xf67716){return db['UserProfile'][_0xc0ff('0x4d')](_0x3113c7['body'],{})[_0xc0ff('0x29')](respondWithResult(_0xf67716,0xc9))['catch'](handleError(_0xf67716,null));};exports[_0xc0ff('0x4e')]=function(_0x3d9159,_0x4e7768){var _0x13924d={'where':{'id':_0x3d9159[_0xc0ff('0x4a')]['id']}},_0x1f9f5f={};_0x1f9f5f[_0xc0ff('0x38')]=_[_0xc0ff('0x4b')](db['UserProfile'][_0xc0ff('0x31')]);_0x13924d[_0xc0ff('0x39')]=_['intersection'](_0x1f9f5f[_0xc0ff('0x38')],qs[_0xc0ff('0x3a')](_0x3d9159[_0xc0ff('0x35')]['fields']));_0x13924d[_0xc0ff('0x39')]=_0x13924d['attributes'][_0xc0ff('0x3b')]?_0x13924d[_0xc0ff('0x39')]:_0x1f9f5f[_0xc0ff('0x38')];if(_0x3d9159[_0xc0ff('0x35')][_0xc0ff('0x44')]){_0x13924d[_0xc0ff('0x45')]=[{'all':!![]}];}_0x13924d=_[_0xc0ff('0x42')]({},_0x13924d,_0x3d9159[_0xc0ff('0x43')]);return db[_0xc0ff('0x30')][_0xc0ff('0x4c')](_0x13924d)[_0xc0ff('0x29')](handleEntityNotFound(_0x4e7768,null))[_0xc0ff('0x29')](function(_0x210ffb){if(_0x210ffb){var _0x85cc70=_0x210ffb['get']({'plain':!![]});_0x85cc70=qs[_0xc0ff('0x4f')](_0x85cc70,['id',_0xc0ff('0x50'),_0xc0ff('0x51'),_0xc0ff('0x52')]);_0x3d9159[_0xc0ff('0x53')]=_['omit'](_0x3d9159[_0xc0ff('0x53')],['id',_0xc0ff('0x50'),_0xc0ff('0x51')]);return db[_0xc0ff('0x54')][_0xc0ff('0x55')](function(_0x53fcef){return db['UserProfile']['create'](_[_0xc0ff('0x42')](_0x85cc70,_0x3d9159[_0xc0ff('0x53')]),{'include':_0x3d9159[_0xc0ff('0x35')][_0xc0ff('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x53fcef})['then'](function(_0x27a18d){var _0x501c79=_0x27a18d[_0xc0ff('0x56')]({'plain':!![]});return db[_0xc0ff('0x57')][_0xc0ff('0x46')]({'where':{'userProfileId':_0x3d9159[_0xc0ff('0x4a')]['id']},'raw':!![]})[_0xc0ff('0x29')](function(_0x568de9){if(_0x568de9){return BPromise[_0xc0ff('0x58')](_0x568de9,function(_0x43c2f7){return new BPromise(function(_0x2f8122,_0x2ab795){if(_0x43c2f7[_0xc0ff('0x59')]===null||_0x43c2f7['autoAssociation']===0x1)_0x2f8122(null);return db[_0xc0ff('0x5a')][_0xc0ff('0x46')]({'where':{'sectionId':_0x43c2f7['id']},'raw':!![]})['then'](function(_0x2cda14){var _0x52ec67=_[_0xc0ff('0x2f')](_0x2cda14,function(_0x166733){return qs[_0xc0ff('0x4f')](_0x166733,['id',_0xc0ff('0x50'),_0xc0ff('0x51'),_0xc0ff('0x5b')]);});_0x2f8122(_0x52ec67);})[_0xc0ff('0x48')](function(_0x303ff1){_0x2ab795(_0x303ff1);});})[_0xc0ff('0x29')](function(_0xa74316){var _0x5a7256=qs['omit'](_0x43c2f7,['id',_0xc0ff('0x50'),'updatedAt']);_0x5a7256[_0xc0ff('0x5c')]=_0x501c79['id'];if(_0xa74316)_0x5a7256[_0xc0ff('0x5d')]=_0xa74316;return _0x5a7256;})[_0xc0ff('0x29')](function(_0xb93952){return db[_0xc0ff('0x57')][_0xc0ff('0x4d')](_0xb93952,{'include':[{'model':db[_0xc0ff('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x53fcef});});})['then'](function(){return _0x501c79;});}});});});}})[_0xc0ff('0x29')](respondWithResult(_0x4e7768,0xc9))['catch'](handleError(_0x4e7768,null));};exports[_0xc0ff('0x28')]=function(_0x3e9887,_0x5cb9c5){if(_0x3e9887[_0xc0ff('0x53')]['id']){delete _0x3e9887[_0xc0ff('0x53')]['id'];}return db['UserProfile'][_0xc0ff('0x4c')]({'where':{'id':_0x3e9887[_0xc0ff('0x4a')]['id']}})[_0xc0ff('0x29')](handleEntityNotFound(_0x5cb9c5,null))[_0xc0ff('0x29')](saveUpdates(_0x3e9887[_0xc0ff('0x53')],null))['then'](respondWithResult(_0x5cb9c5,null))['catch'](handleError(_0x5cb9c5,null));};exports[_0xc0ff('0x2a')]=function(_0x33f7aa,_0xeb6ab1){return db[_0xc0ff('0x30')][_0xc0ff('0x4c')]({'where':{'id':_0x33f7aa[_0xc0ff('0x4a')]['id']}})[_0xc0ff('0x29')](handleEntityNotFound(_0xeb6ab1,null))[_0xc0ff('0x29')](removeEntity(_0xeb6ab1,null))[_0xc0ff('0x48')](handleError(_0xeb6ab1,null));};exports[_0xc0ff('0x5e')]=function(_0x30e961,_0x2f1888){return db['UserProfile']['describe']()[_0xc0ff('0x29')](respondWithResult(_0x2f1888,null))[_0xc0ff('0x48')](handleError(_0x2f1888,null));};exports['addSections']=function(_0x5e23a3,_0x30b6c4){var _0x3186de=_0x5e23a3[_0xc0ff('0x53')];return db[_0xc0ff('0x30')][_0xc0ff('0x4c')]({'where':{'id':_0x5e23a3[_0xc0ff('0x4a')]['id']}})[_0xc0ff('0x29')](handleEntityNotFound(_0x30b6c4,null))[_0xc0ff('0x29')](function(_0x1621f6){if(_0x1621f6){return db[_0xc0ff('0x54')]['transaction'](function(_0x2ab0ca){return db[_0xc0ff('0x57')]['destroy']({'where':{'userProfileId':_0x5e23a3[_0xc0ff('0x4a')]['id'],'sectionId':_[_0xc0ff('0x2f')](_0x3186de,function(_0xc6e870){return _0xc6e870[_0xc0ff('0x5b')];})},'transaction':_0x2ab0ca})[_0xc0ff('0x29')](function(){var _0x5a359b=_['map'](_0x3186de,function(_0x44d972){_0x44d972['userProfileId']=_0x5e23a3[_0xc0ff('0x4a')]['id'];return _0x44d972;});var _0x30c86a=[];return BPromise[_0xc0ff('0x58')](_0x5a359b,function(_0x5acdd6){return db[_0xc0ff('0x57')]['create'](_0x5acdd6,{'include':[{'model':db['UserProfileResource'],'as':_0xc0ff('0x5d')}],'raw':!![],'transaction':_0x2ab0ca})[_0xc0ff('0x29')](function(_0x5c3bac){_0x30c86a['push'](_0x5c3bac[_0xc0ff('0x56')]({'plain':!![]}));});})[_0xc0ff('0x29')](function(){return _0x30c86a;});});});}})[_0xc0ff('0x29')](function(_0x428d01){return _0x428d01;})[_0xc0ff('0x29')](respondWithResult(_0x30b6c4,null))[_0xc0ff('0x48')](handleError(_0x30b6c4,null));};exports[_0xc0ff('0x5f')]=function(_0x28270b,_0x198cd3){var _0xce9727;return db[_0xc0ff('0x30')][_0xc0ff('0x4c')]({'where':{'id':_0x28270b[_0xc0ff('0x4a')]['id']},'attributes':['id','name']})[_0xc0ff('0x29')](handleEntityNotFound(_0x198cd3,null))[_0xc0ff('0x29')](function(_0x3793f1){if(_0x3793f1){_0xce9727=_0x3793f1;return db['UserProfileSection'][_0xc0ff('0x2a')]({'where':{'userProfileId':_0x28270b['params']['id'],'sectionId':_0x28270b[_0xc0ff('0x35')]['ids']}});}})[_0xc0ff('0x29')](function(){return _0xce9727;})[_0xc0ff('0x29')](respondWithStatusCode(_0x198cd3,null))[_0xc0ff('0x48')](handleError(_0x198cd3,null));};exports['getSections']=function(_0x394a14,_0x1c2a64){var _0x57b13d=[];var _0x27b2e1=[];return db['UserProfileSection'][_0xc0ff('0x46')]({'where':{'userProfileId':_0x394a14['params']['id']},'raw':!![]})['then'](function(_0x342a0b){_0x57b13d=_[_0xc0ff('0x3f')](_0x342a0b,function(_0x5da797){return _0x5da797[_0xc0ff('0x60')]===0x1||_[_0xc0ff('0x61')]([0x3eb,0x709],_0x5da797['sectionId']);});if(!_[_0xc0ff('0x62')](_0x57b13d)){return _['map'](_0x57b13d,function(_0x176f2f){return _0x176f2f[_0xc0ff('0x5b')];});}else{return;}})['then'](function(_0x27adca){if(_0x27adca)_0x27b2e1=_0x27adca;if(_['includes'](_0x27b2e1,0x64)){var _0x3d90dc=_['find'](_0x57b13d,{'sectionId':0x64});return hasDefaultDashboard(_0x3d90dc)[_0xc0ff('0x29')](function(_0x20da33){return _[_0xc0ff('0x2f')](_0x57b13d,function(_0x9e6c1a){if(_0x9e6c1a[_0xc0ff('0x5b')]===0x64){_0x9e6c1a['subsections']=_0x20da33;}return _0x9e6c1a;});});}else{return;}})[_0xc0ff('0x29')](function(_0x527cac){if(_0x527cac)_0x57b13d=_0x527cac;if(_[_0xc0ff('0x61')](_0x27b2e1,0x3eb)){var _0x5a8f96=_[_0xc0ff('0x4c')](_0x57b13d,{'sectionId':0x3eb});return getCustomDashboards(_0x5a8f96)[_0xc0ff('0x29')](function(_0x3324e6){return _[_0xc0ff('0x2f')](_0x57b13d,function(_0x2bb8de){if(_0x5a8f96[_0xc0ff('0x60')]){if(_0x2bb8de[_0xc0ff('0x5b')]===0x3eb){_0x2bb8de[_0xc0ff('0x63')]=_0x3324e6;}}else{if(_0x2bb8de[_0xc0ff('0x5b')]===0x64){_0x2bb8de[_0xc0ff('0x63')]=_0x3324e6;}}return _0x2bb8de;});});}else{return;}})[_0xc0ff('0x29')](function(_0x456549){if(_0x456549)_0x57b13d=_0x456549;if(_[_0xc0ff('0x61')](_0x27b2e1,0x709)){var _0x2f5e67=_['find'](_0x57b13d,{'sectionId':0x709});return getPlugins(_0x2f5e67)[_0xc0ff('0x29')](function(_0x42590f){if(_0x2f5e67['enabled']){return _[_0xc0ff('0x2f')](_0x57b13d,function(_0x3804eb){if(_0x3804eb[_0xc0ff('0x5b')]===0x709){_0x3804eb[_0xc0ff('0x63')]=_0x42590f;}return _0x3804eb;});}else{var _0x1cf297={'sectionId':0x76c,'enabled':0x1,'subsections':_0x42590f};var _0x10611d=_['map'](_0x57b13d);_0x10611d[_0xc0ff('0x64')](_0x1cf297);return _0x10611d;}});}else{return;}})[_0xc0ff('0x29')](function(_0x18b4da){if(_0x18b4da)_0x57b13d=_0x18b4da;return _['filter'](_0x57b13d,[_0xc0ff('0x60'),0x1]);})['then'](respondWithResult(_0x1c2a64,null))[_0xc0ff('0x48')](handleError(_0x1c2a64,null));};function hasDefaultDashboard(_0x4e302c){var _0x2ca0cc=[0x65];return new BPromise(function(_0x5ccc19,_0x238e4a){try{if(_0x4e302c[_0xc0ff('0x59')]){_0x5ccc19(_0x2ca0cc);}else{return db['UserProfileResource'][_0xc0ff('0x65')]({'where':{'sectionId':_0x4e302c['id']},'raw':!![]})[_0xc0ff('0x29')](function(_0x6ecb8c){_0x6ecb8c?_0x5ccc19(_0x2ca0cc):_0x5ccc19();});}}catch(_0x2ef30d){_0x238e4a(_0x2ef30d);}});}function getCustomDashboards(_0x854297){var _0x3e11e2=[];return new BPromise(function(_0x4ba15c,_0x1493e6){try{if(_0x854297[_0xc0ff('0x59')]){return db[_0xc0ff('0x66')][_0xc0ff('0x46')]({'raw':!![]})[_0xc0ff('0x29')](function(_0x474683){_0x474683[_0xc0ff('0x67')](function(_0x18db41){_0x3e11e2['push'](_0x18db41['id']+0x1869f);});_0x4ba15c(_0x3e11e2);});}else{return db[_0xc0ff('0x5a')][_0xc0ff('0x46')]({'where':{'sectionId':_0x854297['id']},'raw':!![]})[_0xc0ff('0x29')](function(_0x5a2096){_0x5a2096['forEach'](function(_0x31f30c){_0x3e11e2[_0xc0ff('0x64')](_0x31f30c[_0xc0ff('0x68')]+0x1869f);});_0x4ba15c(_0x3e11e2);});}}catch(_0x302850){_0x1493e6(_0x302850);}});}function getPlugins(_0x4e3543){var _0x41dfe6=[];return new BPromise(function(_0x2fca3d,_0x1bcb63){try{if(_0x4e3543[_0xc0ff('0x59')]){return db[_0xc0ff('0x69')][_0xc0ff('0x46')]({'raw':!![]})[_0xc0ff('0x29')](function(_0x240bef){_0x240bef[_0xc0ff('0x67')](function(_0xa7e379){_0x41dfe6['push'](_0xa7e379['id']+0x15b38);});_0x2fca3d(_0x41dfe6);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x4e3543['id']},'raw':!![]})[_0xc0ff('0x29')](function(_0x59d9da){_0x59d9da[_0xc0ff('0x67')](function(_0x2f0b96){_0x41dfe6[_0xc0ff('0x64')](_0x2f0b96[_0xc0ff('0x68')]+0x15b38);});_0x2fca3d(_0x41dfe6);});}}catch(_0x3ebb6a){_0x1bcb63(_0x3ebb6a);}});}exports[_0xc0ff('0x6a')]=function(_0x41a0b1,_0x499859){return db['UserProfile'][_0xc0ff('0x4c')]({'where':{'id':_0x41a0b1['params']['id']}})[_0xc0ff('0x29')](handleEntityNotFound(_0x499859,null))['then'](function(_0x20d27b){if(_0x20d27b){return db[_0xc0ff('0x54')][_0xc0ff('0x55')](function(_0x36c1a6){return db[_0xc0ff('0x57')][_0xc0ff('0x46')]({'where':{'userProfileId':_0x41a0b1[_0xc0ff('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xc0ff('0x29')](function(_0x2c6cda){if(_0x2c6cda){return db[_0xc0ff('0x57')][_0xc0ff('0x2a')]({'where':{'userProfileId':_0x41a0b1['params']['id'],'id':_[_0xc0ff('0x2f')](_0x2c6cda,function(_0x2b3980){return _0x2b3980['id'];})},'transaction':_0x36c1a6});}})[_0xc0ff('0x29')](function(_0x4adb41){var _0x10553f=_[_0xc0ff('0x2f')](_0x41a0b1[_0xc0ff('0x53')],function(_0x27f389){_0x27f389[_0xc0ff('0x5c')]=_0x41a0b1[_0xc0ff('0x4a')]['id'];return _0x27f389;});return db[_0xc0ff('0x57')][_0xc0ff('0x6b')](_0x10553f,{'raw':!![],'transaction':_0x36c1a6});})[_0xc0ff('0x29')](function(_0x1862c3){var _0x2bfcf8=_['filter'](_[_0xc0ff('0x2f')](_0x1862c3,function(_0xfc0251){return _0xfc0251[_0xc0ff('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x2bfcf8){return db[_0xc0ff('0x57')]['findAll']({'where':{'userProfileId':_0x41a0b1[_0xc0ff('0x4a')]['id'],'sectionId':_['map'](_0x2bfcf8,function(_0x5cf81d){return _0x5cf81d[_0xc0ff('0x5b')];})},'attributes':['id',_0xc0ff('0x5b')],'raw':!![]})[_0xc0ff('0x29')](function(_0x1665b3){var _0x4aa5d4=_[_0xc0ff('0x2f')](_0x41a0b1['body'],function(_0x117976){_0x117976[_0xc0ff('0x5c')]=_0x41a0b1[_0xc0ff('0x4a')]['id'];return _0x117976;});return db[_0xc0ff('0x5a')]['bulkCreate'](_0x4aa5d4,{'raw':!![],'transaction':_0x36c1a6});});}})['catch'](handleError(_0x499859,null));});}})[_0xc0ff('0x29')](function(_0x58d3ce){var _0xc63605=_[_0xc0ff('0x2f')](_0x58d3ce,function(_0x2f583b){return _0x2f583b[_0xc0ff('0x56')]({'plain':!![]});});})[_0xc0ff('0x29')](respondWithResult(_0x499859,null))[_0xc0ff('0x48')](handleError(_0x499859,null));};exports[_0xc0ff('0x6c')]=function(_0x41e026,_0xccacf4,_0x1668c7){return db[_0xc0ff('0x30')][_0xc0ff('0x4c')]({'where':{'id':_0x41e026['params']['id']}})[_0xc0ff('0x29')](handleEntityNotFound(_0xccacf4,null))[_0xc0ff('0x29')](function(_0x5e3513){if(_0x5e3513){return _0x5e3513[_0xc0ff('0x6c')](_0x41e026[_0xc0ff('0x35')][_0xc0ff('0x6d')]);}})['then'](respondWithStatusCode(_0xccacf4,null))[_0xc0ff('0x48')](handleError(_0xccacf4,null));};exports[_0xc0ff('0x6e')]=function(_0xed2f2c,_0x5ccdf6){var _0x1976d3={};if(!_0xed2f2c[_0xc0ff('0x35')][_0xc0ff('0x6f')])throw new Error(_0xc0ff('0x70'));if(!_0xed2f2c['query'][_0xc0ff('0x71')](_0xc0ff('0x72'))){_0x1976d3[_0xc0ff('0x21')]=qs[_0xc0ff('0x21')](_0xed2f2c[_0xc0ff('0x35')][_0xc0ff('0x21')]);_0x1976d3[_0xc0ff('0x20')]=qs[_0xc0ff('0x20')](_0xed2f2c[_0xc0ff('0x35')][_0xc0ff('0x20')]);}return db[_0xc0ff('0x30')][_0xc0ff('0x4c')]({'where':{'id':_0xed2f2c[_0xc0ff('0x4a')]['id']}})[_0xc0ff('0x29')](function(_0x32ead7){if(!_0x32ead7)throw new Error(_0xc0ff('0x73')+_0xed2f2c['params']['id']);return db[_0xc0ff('0x30')]['getResources'](_0xed2f2c);})['then'](respondWithFilteredResult(_0x5ccdf6,_0x1976d3))[_0xc0ff('0x48')](handleError(_0x5ccdf6,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b1023dd..2e047bd 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 _0x781d=['hasOwnProperty','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0xd781('0x0'));var UserProfile=require(_0xd781('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd781('0x2'),'afterUpdate':_0xd781('0x3'),'afterDestroy':_0xd781('0x4')};function emitEvent(_0x1a9f94){return function(_0xfd915d,_0x42258e,_0x446534){UserProfileEvents[_0xd781('0x5')](_0x1a9f94+':'+_0xfd915d['id'],_0xfd915d);UserProfileEvents[_0xd781('0x5')](_0x1a9f94,_0xfd915d);_0x446534(null);};}for(var e in events){if(events[_0xd781('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xd781('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1893=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x1893,0xa2));var _0x3189=function(_0x3a852a,_0xf3f1d3){_0x3a852a=_0x3a852a-0x0;var _0x48c902=_0x1893[_0x3a852a];return _0x48c902;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x3189('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3189('0x1')](0x0);var events={'afterCreate':_0x3189('0x2'),'afterUpdate':_0x3189('0x3'),'afterDestroy':_0x3189('0x4')};function emitEvent(_0x36a7b0){return function(_0x3953a2,_0x5371db,_0x27445){UserProfileEvents[_0x3189('0x5')](_0x36a7b0+':'+_0x3953a2['id'],_0x3953a2);UserProfileEvents[_0x3189('0x5')](_0x36a7b0,_0x3953a2);_0x27445(null);};}for(var e in events){if(events[_0x3189('0x6')](e)){var event=events[e];UserProfile[_0x3189('0x7')](e,emitEvent(event));}}module[_0x3189('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 98717b2..7c47ec2 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 _0x2812=['SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','VoiceQueues','queue','VoiceQueue','type','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','toString','define','UserProfile','user_profiles','raw','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','params','all','union','length','find','ignore','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','merge','VIRTUAL','foreignKey','forEach','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','map','model','associatedResources','name','catch','resolve','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections'];(function(_0x49f47b,_0x1000ad){var _0x5e488e=function(_0x2c3e51){while(--_0x2c3e51){_0x49f47b['push'](_0x49f47b['shift']());}};_0x5e488e(++_0x1000ad);}(_0x2812,0x15e));var _0x2281=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x2812[_0x156a0d];return _0x98a9ba;};'use strict';var _=require(_0x2281('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x2281('0x1'));var squel=require('squel');module[_0x2281('0x2')]=function(_0x5302fd){var _0x6d8c05=_0x5302fd[_0x2281('0x3')];function _0xcf0bf3(_0x301c15,_0x5aff43){return new Promise(function(_0x421d20,_0x44c641){if(!_0x5aff43)return _0x421d20(null);var _0x20a13d=_0x5aff43['filter']?{[_0x5aff43[_0x2281('0x4')][_0x2281('0x5')]]:_0x5aff43['filter'][_0x2281('0x6')]}:undefined;return _0x6d8c05[_0x301c15][_0x2281('0x7')]({'where':_0x20a13d,'raw':!![]})[_0x2281('0x8')](function(_0x1dbded){_0x5aff43['associatedResources']=_[_0x2281('0x9')](_0x1dbded,'id');_0x421d20(_0x5aff43);})['catch'](function(_0x439d94){_0x44c641(_0x439d94);});});}function _0x31d1ba(_0x5bfeeb,_0x3e4eab){return new Promise(function(_0x16b94f,_0x53d92a){var _0x5d2762=_0x5bfeeb[_0x2281('0x4')]?{[_0x5bfeeb['filter']['field']]:_0x5bfeeb['filter'][_0x2281('0x6')]}:undefined;return _0x6d8c05[_0x5bfeeb[_0x2281('0xa')]][_0x2281('0x7')]({'where':_0x5d2762,'raw':!![]})[_0x2281('0x8')](function(_0x494bc8){_0x3e4eab[_0x2281('0xb')]=_[_0x2281('0x9')](_0x494bc8,function(_0x59a944){return _0x59a944[_0x2281('0xc')];});_0x16b94f(_0x3e4eab);})[_0x2281('0xd')](function(_0x3b12fd){_0x53d92a(_0x3b12fd);});});}function _0x58d580(_0x20282a,_0x5d1abd,_0x375a3e){if(!_0x5d1abd)return Promise[_0x2281('0xe')](null);return new Promise(function(_0x337704,_0x3cbc15){return _0x6d8c05['UserProfileResource'][_0x2281('0x7')]({'where':{'sectionId':_0x5d1abd['id']},'raw':!![]})[_0x2281('0x8')](function(_0x51632b){if(_0x20282a[_0x2281('0x5')]&&_0x20282a[_0x2281('0x5')]!=='id'){_0x5d1abd['associatedResources']=_[_0x2281('0x9')](_0x51632b,function(_0x52f37d){return _0x52f37d[_0x20282a[_0x2281('0x5')]];});}else{if(_0x375a3e==='AnalyticExtractedReport'){_0x5d1abd[_0x2281('0xb')]=_[_0x2281('0x9')](_0x51632b,function(_0x392194){return{'id':_0x392194['resourceId'],'type':_0x392194['type']};});}else{_0x5d1abd['associatedResources']=_['map'](_0x51632b,function(_0x41dd72){return _0x41dd72[_0x2281('0xf')];});}}_0x337704(_0x5d1abd);})[_0x2281('0xd')](function(_0x963c80){_0x3cbc15(_0x963c80);});});}function _0x20d9a2(_0x32bac4,_0x2f02cf){var _0x101312={'parentSections':[]};switch(_0x32bac4[_0x2281('0x10')]()){case _0x2281('0x11'):_0x101312[_0x2281('0x12')]='SquareProject';break;case _0x2281('0x13'):_0x101312[_0x2281('0x12')]=_0x2281('0x14');break;case _0x2281('0x15'):_0x101312[_0x2281('0x12')]=_0x2281('0x16');_0x101312[_0x2281('0x17')]=[{'name':_0x2281('0x18'),'field':_0x2281('0xc'),'foreignKey':_0x2281('0x19')}];break;case _0x2281('0x1a'):_0x101312[_0x2281('0x12')]=_0x2281('0x1b');break;case _0x2281('0x1c'):_0x101312['childModel']=_0x2281('0x1d');_0x101312[_0x2281('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0x2281('0x1e')}];break;case _0x2281('0x1f'):_0x101312[_0x2281('0x12')]=_0x2281('0x20');break;case'companies':_0x101312[_0x2281('0x12')]=_0x2281('0x21');break;case _0x2281('0x22'):_0x101312[_0x2281('0x12')]='CmCustomField';break;case _0x2281('0x23'):_0x101312[_0x2281('0x12')]='ChatQueue';break;case'chatwebsites':_0x101312['childModel']=_0x2281('0x24');break;case _0x2281('0x25'):_0x101312[_0x2281('0x12')]='FaxQueue';break;case _0x2281('0x26'):_0x101312['childModel']=_0x2281('0x27');break;case _0x2281('0x28'):case _0x2281('0x29'):case'outboundroutes':_0x101312[_0x2281('0x12')]=_0x2281('0x2a');break;case _0x2281('0x2b'):_0x101312[_0x2281('0x12')]=_0x2281('0x2c');break;case _0x2281('0x2d'):_0x101312[_0x2281('0x12')]=_0x2281('0x2e');break;case _0x2281('0x2f'):_0x101312[_0x2281('0x12')]=_0x2281('0x30');_0x101312['parentSections']=[{'name':_0x2281('0x31'),'field':_0x2281('0xc'),'foreignKey':_0x2281('0x32'),'model':_0x2281('0x33'),'filter':{'field':_0x2281('0x34'),'value':['agent']}},{'name':_0x2281('0x35'),'field':_0x2281('0xc'),'foreignKey':_0x2281('0x32'),'model':_0x2281('0x33'),'filter':{'field':_0x2281('0x34'),'value':['telephone']}},{'name':_0x2281('0x36'),'field':_0x2281('0xc'),'foreignKey':_0x2281('0x37'),'model':_0x2281('0x38'),'filter':{'field':_0x2281('0x39'),'value':['inbound']}},{'name':_0x2281('0x3a'),'field':_0x2281('0xc'),'foreignKey':_0x2281('0x37'),'model':_0x2281('0x38'),'filter':{'field':_0x2281('0x39'),'value':[_0x2281('0x3b')]}}];break;case'musiconholds':_0x101312[_0x2281('0x12')]=_0x2281('0x3c');break;case'chanspies':_0x101312[_0x2281('0x12')]=_0x2281('0x3d');break;case _0x2281('0x3e'):_0x101312[_0x2281('0x12')]=_0x2281('0x3f');break;case'ivrcampaigns':_0x101312[_0x2281('0x12')]=_0x2281('0x40');break;case _0x2281('0x41'):_0x101312['childModel']='MailQueue';break;case _0x2281('0x42'):_0x101312['childModel']=_0x2281('0x43');break;case _0x2281('0x44'):_0x101312['childModel']='MailSubstatus';break;case _0x2281('0x45'):_0x101312['childModel']='OpenchannelQueue';break;case _0x2281('0x46'):_0x101312[_0x2281('0x12')]=_0x2281('0x47');break;case _0x2281('0x48'):_0x101312[_0x2281('0x12')]=_0x2281('0x49');break;case'smsaccounts':_0x101312[_0x2281('0x12')]='SmsAccount';break;case _0x2281('0x4a'):_0x101312[_0x2281('0x12')]='WhatsappQueue';break;case _0x2281('0x4b'):_0x101312[_0x2281('0x12')]=_0x2281('0x4c');break;case _0x2281('0x4d'):_0x101312[_0x2281('0x12')]='Team';break;case _0x2281('0x4e'):case _0x2281('0x4f'):_0x101312[_0x2281('0x12')]=_0x2281('0x38');if(_0x2f02cf){_0x101312[_0x2281('0x17')]=[{'name':_0x2281('0x36')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case'telephones':_0x101312[_0x2281('0x12')]=_0x2281('0x33');if(_0x2f02cf){_0x101312[_0x2281('0x17')]=[{'name':_0x2281('0x50'),'filter':{'field':_0x2281('0x34'),'value':[_0x2281('0x51'),'user']},'ignore':!![]},{'name':_0x2281('0x31')},{'name':'Telephones'}];}break;case _0x2281('0x52'):_0x101312['childModel']=_0x2281('0x53');break;case _0x2281('0x54'):_0x101312[_0x2281('0x12')]=_0x2281('0x55');break;case _0x2281('0x56'):_0x101312['childModel']=_0x2281('0x57');break;case _0x2281('0x58'):_0x101312[_0x2281('0x12')]=_0x2281('0x59');break;case _0x2281('0x5a'):_0x101312[_0x2281('0x12')]=_0x2281('0x5b');break;case'zohoaccounts':_0x101312[_0x2281('0x12')]=_0x2281('0x5c');break;case'vtigeraccounts':_0x101312[_0x2281('0x12')]=_0x2281('0x33');break;case _0x2281('0x5d'):_0x101312['childModel']=_0x2281('0x5e');break;case _0x2281('0x5f'):_0x101312[_0x2281('0x12')]=_0x2281('0x60');break;case _0x2281('0x61'):_0x101312[_0x2281('0x12')]=_0x2281('0x62');break;case _0x2281('0x63'):_0x101312[_0x2281('0x12')]=_0x2281('0x64');break;case _0x2281('0x65'):_0x101312[_0x2281('0x12')]='Pause';break;case _0x2281('0x66'):_0x101312['childModel']='Schedule';break;case _0x2281('0x67'):_0x101312[_0x2281('0x12')]=_0x2281('0x68');break;case'tags':_0x101312[_0x2281('0x12')]=_0x2281('0x69');break;case _0x2281('0x6a'):_0x101312[_0x2281('0x12')]=_0x2281('0x6b');break;case'triggers':_0x101312[_0x2281('0x12')]=_0x2281('0x6c');break;case _0x2281('0x6d'):_0x101312[_0x2281('0x12')]=_0x2281('0x6e');break;case'variables':_0x101312[_0x2281('0x12')]='Variable';break;case _0x2281('0x6f'):_0x101312[_0x2281('0x12')]=_0x2281('0x70');break;case _0x2281('0x71'):_0x101312['childModel']=_0x2281('0x72');_0x101312[_0x2281('0x17')]=[{'name':_0x2281('0x73'),'field':'id','foreignKey':_0x2281('0x74')}];break;case _0x2281('0x75'):_0x101312['childModel']=_0x2281('0x76');break;}return _0x101312;}function _0x4203cd(_0x2239aa,_0x205810){var _0x1db0d2=_0x2239aa['charAt'](0x0)[_0x2281('0x77')]()+_0x2239aa[_0x2281('0x78')](0x1);var _0x2e7121={'type':_0x6d8c05['Sequelize']['QueryTypes'][_0x2281('0x79')],'raw':!![]};return new Promise(function(_0x48ce5d,_0x2e032b){var _0x3ea849=squel[_0x2281('0x7a')]()[_0x2281('0x5')](_0x2281('0x7b')+_0x1db0d2+_0x2281('0x7c'),'id')[_0x2281('0x5')](_0x2281('0x7d'))[_0x2281('0x7e')](_0x2281('0x7f')+_0x2239aa+_0x2281('0x80'),'ui')[_0x2281('0x81')](_0x2281('0x82'),_0x205810['id']);return _0x6d8c05['sequelize']['query'](_0x3ea849[_0x2281('0x83')](),_0x2e7121)[_0x2281('0x8')](function(_0x44d76d){_0x205810[_0x1db0d2+'OpenTabs']=_0x44d76d;_0x48ce5d(_0x44d76d);})[_0x2281('0xd')](function(_0x9b1971){_0x2e032b(_0x9b1971);});});}return _0x5302fd[_0x2281('0x84')](_0x2281('0x85'),attributes,{'tableName':_0x2281('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3c89ab){var _0x405c41={'raw':_0x3c89ab['query'][_0x2281('0x87')],'where':{}};var _0x4d0121={};var _0x27a1c6={'count':0x0,'rows':[]};var _0x400c5c=_0x3c89ab[_0x2281('0x88')][_0x2281('0x89')];var _0x47d3f0=_0x3c89ab[_0x2281('0x88')][_0x2281('0x8a')]||![];var _0x3b0fc5=_0x20d9a2(_0x400c5c,_0x47d3f0);if(!_0x3b0fc5[_0x2281('0x12')])throw new Error(_0x2281('0x8b')+_0x400c5c+'\x27');var _0x2e8e9b=[{'name':_0x400c5c}];if(!_[_0x2281('0x8c')](_0x3b0fc5['parentSections']))_0x2e8e9b=_0x3b0fc5['parentSections'];var _0xb23b5a=[];for(var _0x4cc542=0x0;_0x4cc542<_0x2e8e9b['length'];_0x4cc542++){_0xb23b5a[_0x2281('0x8d')](_0x6d8c05['UserProfileSection']['find']({'where':{'userProfileId':_0x3c89ab[_0x2281('0x8e')]['id'],'name':_0x2e8e9b[_0x4cc542]['name']},'raw':!![]}));}return Promise[_0x2281('0x8f')](_0xb23b5a)[_0x2281('0x8')](function(_0x304931){var _0x10c1b8=_[_0x2281('0x4')](_0x304931,function(_0x373396){return _0x373396?_0x373396:undefined;});var _0x4aeff9=_[_0x2281('0x4')](_0x2e8e9b,['ignore',!![]]);var _0x1b4516=_[_0x2281('0x8c')](_0x10c1b8)&&_[_0x2281('0x8c')](_0x4aeff9)?null:_[_0x2281('0x90')](_0x4aeff9,_0x10c1b8);if(!_0x1b4516)return null;var _0x37ca5b=[];for(var _0x389583=0x0;_0x389583<_0x1b4516[_0x2281('0x91')];_0x389583++){var _0x50fe4e=_[_0x2281('0x92')](_0x2e8e9b,function(_0x2e3062){return _0x1b4516[_0x389583]?_0x2e3062[_0x2281('0xc')]===_0x1b4516[_0x389583][_0x2281('0xc')]:null;});if(_0x50fe4e){if(_0x1b4516[_0x389583][_0x2281('0x93')]){_0x37ca5b[_0x2281('0x8d')](_0xcf0bf3(_0x3b0fc5[_0x2281('0x12')],_0x1b4516[_0x389583]));}else{if(!_0x1b4516[_0x389583][_0x2281('0x94')]){_0x37ca5b[_0x2281('0x8d')](_0x58d580(_0x50fe4e,_0x1b4516[_0x389583],_0x3b0fc5[_0x2281('0x12')]));}else{if(_0x50fe4e[_0x2281('0xa')]){_0x37ca5b['push'](_0x31d1ba(_0x50fe4e,_0x1b4516[_0x389583]));}}}}}return Promise['all'](_0x37ca5b);})[_0x2281('0x8')](function(_0x268c42){var _0x5bfd9a=_0x268c42;var _0x25ae1b=null;if(_0x5bfd9a){_0x25ae1b=_0x5bfd9a['length']===0x1?_0x5bfd9a[0x0]:null;}if(!_0x25ae1b&&!_0x5bfd9a)return _0x27a1c6;var _0x4dbd61=_0x6d8c05[_0x3b0fc5[_0x2281('0x12')]]['rawAttributes'];_0x4d0121['model']=_['keys'](_0x4dbd61);_0x4d0121[_0x2281('0x88')]=_[_0x2281('0x95')](_0x3c89ab[_0x2281('0x88')]);_0x4d0121[_0x2281('0x96')]=_[_0x2281('0x97')](_0x4d0121['model'],_0x4d0121[_0x2281('0x88')]);_0x405c41['attributes']=_['intersection'](_0x4d0121[_0x2281('0xa')],qs['fields'](_0x3c89ab[_0x2281('0x88')][_0x2281('0x98')]));_0x405c41[_0x2281('0x99')]=_0x405c41['attributes'][_0x2281('0x91')]?_0x405c41[_0x2281('0x99')]:_0x4d0121['model'];if(!_0x3c89ab[_0x2281('0x88')][_0x2281('0x9a')](_0x2281('0x9b'))){_0x405c41[_0x2281('0x9c')]=qs[_0x2281('0x9c')](_0x3c89ab['query']['limit']);_0x405c41['offset']=qs['offset'](_0x3c89ab[_0x2281('0x88')]['offset']);}_0x405c41[_0x2281('0x9d')]=qs[_0x2281('0x9e')](_0x3c89ab[_0x2281('0x88')][_0x2281('0x9e')]);_0x405c41[_0x2281('0x81')]=qs[_0x2281('0x96')](_['pick'](_0x3c89ab[_0x2281('0x88')],_0x4d0121[_0x2281('0x96')]));if(_0x3c89ab[_0x2281('0x88')]['filter']){_0x405c41[_0x2281('0x81')]=_[_0x2281('0x9f')](_0x405c41[_0x2281('0x81')],{'$or':_['map'](_0x4dbd61,function(_0xeed4eb){if(_0xeed4eb['type']['key']!==_0x2281('0xa0')){var _0x26f41d={};_0x26f41d[_0xeed4eb[_0x2281('0x5')]]={'$like':'%'+_0x3c89ab[_0x2281('0x88')]['filter']+'%'};return _0x26f41d;}})});}var _0x280746=[];var _0x429b25=null;var _0x3affc5={};if(_0x25ae1b){_0x429b25=_[_0x2281('0x92')](_0x2e8e9b,[_0x2281('0xc'),_0x25ae1b[_0x2281('0xc')]]);if(_0x429b25[_0x2281('0x5')]){_0x3affc5={};if(_0x3b0fc5[_0x2281('0x12')]==='AnalyticExtractedReport'){_0x3affc5[_0x429b25[_0x2281('0xa1')]]=_[_0x2281('0x9')](_0x25ae1b[_0x2281('0xb')],'id');}else{_0x3affc5[_0x429b25[_0x2281('0xa1')]]=_0x25ae1b['associatedResources'];}_0x280746[_0x2281('0x8d')](_0x3affc5);}else{_0x405c41['where']['id']=_0x25ae1b['associatedResources'];}}else{for(var _0x40a6c9=0x0;_0x40a6c9<_0x5bfd9a[_0x2281('0x91')];_0x40a6c9++){_0x429b25=_[_0x2281('0x92')](_0x2e8e9b,['name',_0x5bfd9a[_0x40a6c9][_0x2281('0xc')]]);if(_0x429b25[_0x2281('0x5')]){_0x3affc5={};_0x3affc5[_0x429b25[_0x2281('0xa1')]]=_0x5bfd9a[_0x40a6c9][_0x2281('0xb')];_0x280746[_0x2281('0x8d')](_0x3affc5);}else{if(!_0x405c41['where']['id'])_0x405c41[_0x2281('0x81')]['id']=[];_0x5bfd9a[_0x40a6c9]['associatedResources'][_0x2281('0xa2')](function(_0x5590c8){_0x405c41[_0x2281('0x81')]['id'][_0x2281('0x8d')](_0x5590c8);});}}}if(!_[_0x2281('0x8c')](_0x280746)){_0x405c41['where']=_['merge'](_0x405c41['where'],{'$and':{'$or':_0x280746}});}_0x405c41=_[_0x2281('0x9f')]({},_0x405c41,_0x3c89ab['options']);if(_0x25ae1b&&!_0x25ae1b['autoAssociation']&&_0x3b0fc5[_0x2281('0x12')]==='AnalyticExtractedReport'){if(_0x3c89ab[_0x2281('0x88')]['includeAll']){_0x405c41[_0x2281('0xa3')]=[{'all':!![]}];}return _0x6d8c05[_0x3b0fc5[_0x2281('0x12')]][_0x2281('0x7')](_0x405c41)[_0x2281('0x8')](function(_0x46d081){var _0x10012f=[];_0x46d081[_0x2281('0xa2')](function(_0x190b73){var _0x171d8d;switch(_0x190b73[_0x2281('0xa4')]){case'default':_0x171d8d=_[_0x2281('0x92')](_0x25ae1b[_0x2281('0xb')],function(_0x357982){return _0x357982['id']===_0x190b73[_0x2281('0x74')]&&_0x357982['type']===_0x2281('0xa5');});break;case _0x2281('0xa6'):_0x171d8d=_['find'](_0x25ae1b[_0x2281('0xb')],function(_0x3ff39b){return _0x3ff39b['id']===_0x190b73[_0x2281('0x74')]&&_0x3ff39b[_0x2281('0x39')]===_0x2281('0xa7');});break;}if(_0x171d8d)_0x10012f[_0x2281('0x8d')](_0x190b73);});_0x27a1c6[_0x2281('0xa8')]=_0x10012f['length'];_0x27a1c6[_0x2281('0xa9')]=_0x10012f;return _0x27a1c6;});}else{if(!_[_0x2281('0x8c')](_0x3c89ab[_0x2281('0x88')][_0x2281('0xaa')])){_0x405c41[_0x2281('0x81')]['id']=_0x405c41[_0x2281('0x81')]['id']?_[_0x2281('0x97')](_0x405c41[_0x2281('0x81')]['id'],_0x3c89ab['query'][_0x2281('0xaa')]):_0x3c89ab[_0x2281('0x88')][_0x2281('0xaa')];if(_0x3c89ab['query'][_0x2281('0xab')]){_0x405c41[_0x2281('0x9d')]=_0x3c89ab[_0x2281('0x88')][_0x2281('0xab')];}}if(_0x3c89ab[_0x2281('0x88')][_0x2281('0xac')]){_0x405c41[_0x2281('0x81')]=_['merge'](_0x405c41[_0x2281('0x81')],{'$and':_0x3c89ab['query'][_0x2281('0xac')]});}return _0x6d8c05[_0x3b0fc5[_0x2281('0x12')]][_0x2281('0xa8')]({'where':_0x405c41[_0x2281('0x81')]})[_0x2281('0x8')](function(_0x3e9a84){_0x27a1c6[_0x2281('0xa8')]=_0x3e9a84;if(_0x3c89ab[_0x2281('0x88')][_0x2281('0xad')]){if(_0x3b0fc5[_0x2281('0x12')]==='CmContact'){_0x405c41[_0x2281('0xa3')]=[{'model':_0x6d8c05[_0x2281('0x69')],'as':_0x2281('0xae'),'attributes':['id',_0x2281('0xc'),_0x2281('0xaf')],'required':_0x3c89ab[_0x2281('0x88')][_0x2281('0xb0')]?!![]:![]},{'model':_0x6d8c05['Tag'],'as':_0x2281('0xb1'),'attributes':['id',_0x2281('0xc'),'color'],'through':_0x3c89ab['query']['tag']?{'attributes':[],'where':{'TagId':_0x3c89ab[_0x2281('0x88')]['tag']||undefined}}:{},'required':_0x3c89ab[_0x2281('0x88')][_0x2281('0xb0')]?!![]:![]}];}else{_0x405c41[_0x2281('0xa3')]=[{'all':!![]}];}}return _0x6d8c05[_0x3b0fc5[_0x2281('0x12')]]['findAll'](_0x405c41);})[_0x2281('0x8')](function(_0x502dc2){_0x27a1c6[_0x2281('0xa9')]=_0x502dc2;if(_0x400c5c===_0x2281('0x31')&&_0x3c89ab[_0x2281('0x88')][_0x2281('0xb2')]===_0x2281('0xb3')){var _0x5ca583=[];for(var _0x2df5d2=0x0;_0x2df5d2<_0x27a1c6[_0x2281('0xa9')][_0x2281('0x91')];_0x2df5d2++){_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xb4'),_0x27a1c6[_0x2281('0xa9')][_0x2df5d2][_0x2281('0xb5')]));_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xb6'),_0x27a1c6[_0x2281('0xa9')][_0x2df5d2]['dataValues']));_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xb7'),_0x27a1c6[_0x2281('0xa9')][_0x2df5d2][_0x2281('0xb5')]));_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xb8'),_0x27a1c6[_0x2281('0xa9')][_0x2df5d2][_0x2281('0xb5')]));_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xb9'),_0x27a1c6['rows'][_0x2df5d2][_0x2281('0xb5')]));_0x5ca583[_0x2281('0x8d')](_0x4203cd(_0x2281('0xba'),_0x27a1c6['rows'][_0x2df5d2][_0x2281('0xb5')]));}return Promise[_0x2281('0x8f')](_0x5ca583)[_0x2281('0x8')](function(){return _0x27a1c6;});}return _0x27a1c6;});}});}}});}; \ No newline at end of file +var _0x9356=['agents','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','intervals','Interval','pauses','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','extractedreports','AnalyticExtractedReport','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','raw','query','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','includeAll','include','reportType','reportId','DefaultReports','custom','count','rows','ids','order','customSorting','extraQueryConditions','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','./userProfile.attributes','../../components/parsers/qs','models','filter','field','then','associatedResources','catch','model','findAll','map','name','resolve','UserProfileResource','type','resourceId','toLowerCase','childModel','SquareProject','odbc','parentSections','SquareProjects','projectName','projects','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users'];(function(_0xfcb11,_0x57e66f){var _0x42936c=function(_0x4e9848){while(--_0x4e9848){_0xfcb11['push'](_0xfcb11['shift']());}};_0x42936c(++_0x57e66f);}(_0x9356,0x134));var _0x6935=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x9356[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var attributes=require(_0x6935('0x0'));var qs=require(_0x6935('0x1'));var squel=require('squel');module['exports']=function(_0x4a374c){var _0x1cddfc=_0x4a374c[_0x6935('0x2')];function _0x23c4f7(_0x2b9b56,_0x1ff933){return new Promise(function(_0x1531d3,_0x2f27e7){if(!_0x1ff933)return _0x1531d3(null);var _0x3557cf=_0x1ff933[_0x6935('0x3')]?{[_0x1ff933['filter'][_0x6935('0x4')]]:_0x1ff933['filter']['value']}:undefined;return _0x1cddfc[_0x2b9b56]['findAll']({'where':_0x3557cf,'raw':!![]})[_0x6935('0x5')](function(_0x48188d){_0x1ff933[_0x6935('0x6')]=_['map'](_0x48188d,'id');_0x1531d3(_0x1ff933);})[_0x6935('0x7')](function(_0x40976b){_0x2f27e7(_0x40976b);});});}function _0x21b720(_0x12ad39,_0x2f5db8){return new Promise(function(_0x1ed366,_0x168c7f){var _0xf309a1=_0x12ad39[_0x6935('0x3')]?{[_0x12ad39['filter'][_0x6935('0x4')]]:_0x12ad39[_0x6935('0x3')]['value']}:undefined;return _0x1cddfc[_0x12ad39[_0x6935('0x8')]][_0x6935('0x9')]({'where':_0xf309a1,'raw':!![]})[_0x6935('0x5')](function(_0x51de3c){_0x2f5db8[_0x6935('0x6')]=_[_0x6935('0xa')](_0x51de3c,function(_0x6b594b){return _0x6b594b[_0x6935('0xb')];});_0x1ed366(_0x2f5db8);})[_0x6935('0x7')](function(_0x1a886b){_0x168c7f(_0x1a886b);});});}function _0x55c0d0(_0x220da9,_0x248396,_0x2b2975){if(!_0x248396)return Promise[_0x6935('0xc')](null);return new Promise(function(_0x9b566a,_0x43799e){return _0x1cddfc[_0x6935('0xd')][_0x6935('0x9')]({'where':{'sectionId':_0x248396['id']},'raw':!![]})[_0x6935('0x5')](function(_0x6bcb3f){if(_0x220da9['field']&&_0x220da9['field']!=='id'){_0x248396[_0x6935('0x6')]=_[_0x6935('0xa')](_0x6bcb3f,function(_0x4339b4){return _0x4339b4[_0x220da9[_0x6935('0x4')]];});}else{if(_0x2b2975==='AnalyticExtractedReport'){_0x248396[_0x6935('0x6')]=_[_0x6935('0xa')](_0x6bcb3f,function(_0x24801a){return{'id':_0x24801a['resourceId'],'type':_0x24801a[_0x6935('0xe')]};});}else{_0x248396[_0x6935('0x6')]=_['map'](_0x6bcb3f,function(_0x4a0154){return _0x4a0154[_0x6935('0xf')];});}}_0x9b566a(_0x248396);})[_0x6935('0x7')](function(_0x3632d7){_0x43799e(_0x3632d7);});});}function _0x47064a(_0x455842,_0x148ddd){var _0x33c8f9={'parentSections':[]};switch(_0x455842[_0x6935('0x10')]()){case'squareprojects':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x12');break;case _0x6935('0x13'):_0x33c8f9[_0x6935('0x11')]='SquareOdbc';break;case'squarerecordings':_0x33c8f9[_0x6935('0x11')]='SquareRecording';_0x33c8f9[_0x6935('0x14')]=[{'name':_0x6935('0x15'),'field':_0x6935('0xb'),'foreignKey':_0x6935('0x16')}];break;case _0x6935('0x17'):_0x33c8f9[_0x6935('0x11')]='JscriptyProject';break;case'contacts':_0x33c8f9[_0x6935('0x11')]='CmContact';_0x33c8f9[_0x6935('0x14')]=[{'name':_0x6935('0x18'),'field':'id','foreignKey':_0x6935('0x19')}];break;case _0x6935('0x1a'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x1b');break;case _0x6935('0x1c'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x1d');break;case _0x6935('0x1e'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x1f');break;case _0x6935('0x20'):_0x33c8f9['childModel']='ChatQueue';break;case _0x6935('0x21'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x22');break;case _0x6935('0x23'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x24');break;case _0x6935('0x25'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x26');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x27');break;case _0x6935('0x28'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x29');break;case _0x6935('0x2a'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x2b');break;case'voicerecordings':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x2c');_0x33c8f9[_0x6935('0x14')]=[{'name':_0x6935('0x2d'),'field':_0x6935('0xb'),'foreignKey':_0x6935('0x2e'),'model':'User','filter':{'field':_0x6935('0x2f'),'value':[_0x6935('0x30')]}},{'name':_0x6935('0x31'),'field':_0x6935('0xb'),'foreignKey':_0x6935('0x2e'),'model':_0x6935('0x32'),'filter':{'field':_0x6935('0x2f'),'value':[_0x6935('0x33')]}},{'name':'VoiceQueues','field':_0x6935('0xb'),'foreignKey':_0x6935('0x34'),'model':_0x6935('0x35'),'filter':{'field':_0x6935('0xe'),'value':[_0x6935('0x36')]}},{'name':_0x6935('0x37'),'field':'name','foreignKey':_0x6935('0x34'),'model':_0x6935('0x35'),'filter':{'field':_0x6935('0xe'),'value':[_0x6935('0x38')]}}];break;case _0x6935('0x39'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x3a');break;case _0x6935('0x3b'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x3c');break;case _0x6935('0x3d'):_0x33c8f9['childModel']=_0x6935('0x3e');break;case _0x6935('0x3f'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x40');break;case'mailqueues':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x41');break;case _0x6935('0x42'):_0x33c8f9[_0x6935('0x11')]='MailAccount';break;case'mailsubstatuses':_0x33c8f9[_0x6935('0x11')]='MailSubstatus';break;case _0x6935('0x43'):_0x33c8f9['childModel']=_0x6935('0x44');break;case _0x6935('0x45'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x46');break;case _0x6935('0x47'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x48');break;case _0x6935('0x49'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x4a');break;case'whatsappqueues':_0x33c8f9['childModel']=_0x6935('0x4b');break;case _0x6935('0x4c'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x4d');break;case _0x6935('0x4e'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x4f');break;case'voicequeues':case _0x6935('0x50'):_0x33c8f9[_0x6935('0x11')]='VoiceQueue';if(_0x148ddd){_0x33c8f9['parentSections']=[{'name':'VoiceQueues'},{'name':_0x6935('0x37')}];}break;case _0x6935('0x51'):case _0x6935('0x52'):case'telephones':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x32');if(_0x148ddd){_0x33c8f9[_0x6935('0x14')]=[{'name':_0x6935('0x53'),'filter':{'field':_0x6935('0x2f'),'value':[_0x6935('0x54'),_0x6935('0x55')]},'ignore':!![]},{'name':_0x6935('0x2d')},{'name':_0x6935('0x31')}];}break;case _0x6935('0x56'):_0x33c8f9['childModel']=_0x6935('0x57');break;case'salesforceaccounts':_0x33c8f9[_0x6935('0x11')]=_0x6935('0x58');break;case _0x6935('0x59'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x5a');break;case _0x6935('0x5b'):_0x33c8f9['childModel']=_0x6935('0x5c');break;case _0x6935('0x5d'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x5e');break;case _0x6935('0x5f'):_0x33c8f9[_0x6935('0x11')]='ZohoAccount';break;case _0x6935('0x60'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x32');break;case _0x6935('0x61'):_0x33c8f9[_0x6935('0x11')]='CannedAnswer';break;case _0x6935('0x62'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x63');break;case'customdashboards':_0x33c8f9[_0x6935('0x11')]='Dashboard';break;case _0x6935('0x64'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x65');break;case _0x6935('0x66'):_0x33c8f9[_0x6935('0x11')]='Pause';break;case _0x6935('0x67'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x68');break;case _0x6935('0x69'):_0x33c8f9[_0x6935('0x11')]='Sound';break;case _0x6935('0x6a'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x6b');break;case _0x6935('0x6c'):_0x33c8f9['childModel']=_0x6935('0x6d');break;case _0x6935('0x6e'):_0x33c8f9['childModel']=_0x6935('0x6f');break;case _0x6935('0x70'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x71');break;case'variables':_0x33c8f9['childModel']=_0x6935('0x72');break;case _0x6935('0x73'):_0x33c8f9[_0x6935('0x11')]='Plugin';break;case _0x6935('0x74'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x75');_0x33c8f9[_0x6935('0x14')]=[{'name':_0x6935('0x76'),'field':'id','foreignKey':'reportId'}];break;case _0x6935('0x77'):_0x33c8f9[_0x6935('0x11')]=_0x6935('0x78');break;}return _0x33c8f9;}function _0x3cc715(_0x2aee15,_0x116842){var _0x3b9064=_0x2aee15[_0x6935('0x79')](0x0)[_0x6935('0x7a')]()+_0x2aee15[_0x6935('0x7b')](0x1);var _0x562987={'type':_0x1cddfc[_0x6935('0x7c')][_0x6935('0x7d')][_0x6935('0x7e')],'raw':!![]};return new Promise(function(_0x504ce8,_0x16f54a){var _0x1d9e03=squel[_0x6935('0x7f')]()[_0x6935('0x4')](_0x6935('0x80')+_0x3b9064+_0x6935('0x81'),'id')[_0x6935('0x4')](_0x6935('0x82'))[_0x6935('0x83')](_0x6935('0x84')+_0x2aee15+_0x6935('0x85'),'ui')[_0x6935('0x86')]('ui.UserId\x20=\x20?',_0x116842['id']);return _0x1cddfc[_0x6935('0x87')]['query'](_0x1d9e03[_0x6935('0x88')](),_0x562987)['then'](function(_0x4c004a){_0x116842[_0x3b9064+_0x6935('0x89')]=_0x4c004a;_0x504ce8(_0x4c004a);})['catch'](function(_0x37c080){_0x16f54a(_0x37c080);});});}return _0x4a374c[_0x6935('0x8a')](_0x6935('0x8b'),attributes,{'tableName':_0x6935('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x47e57a){var _0x386a46={'raw':_0x47e57a['query'][_0x6935('0x8d')],'where':{}};var _0x3e304e={};var _0x4c350b={'count':0x0,'rows':[]};var _0x119879=_0x47e57a[_0x6935('0x8e')]['section'];var _0x351baf=_0x47e57a[_0x6935('0x8e')]['mergeResources']||![];var _0x4073fd=_0x47064a(_0x119879,_0x351baf);if(!_0x4073fd[_0x6935('0x11')])throw new Error(_0x6935('0x8f')+_0x119879+'\x27');var _0x30567b=[{'name':_0x119879}];if(!_[_0x6935('0x90')](_0x4073fd['parentSections']))_0x30567b=_0x4073fd[_0x6935('0x14')];var _0x153ee1=[];for(var _0x36e8f8=0x0;_0x36e8f8<_0x30567b[_0x6935('0x91')];_0x36e8f8++){_0x153ee1[_0x6935('0x92')](_0x1cddfc[_0x6935('0x93')][_0x6935('0x94')]({'where':{'userProfileId':_0x47e57a[_0x6935('0x95')]['id'],'name':_0x30567b[_0x36e8f8][_0x6935('0xb')]},'raw':!![]}));}return Promise['all'](_0x153ee1)['then'](function(_0x422656){var _0x2e7353=_[_0x6935('0x3')](_0x422656,function(_0x2eefc6){return _0x2eefc6?_0x2eefc6:undefined;});var _0x2cc2ef=_['filter'](_0x30567b,[_0x6935('0x96'),!![]]);var _0xab9aae=_['isEmpty'](_0x2e7353)&&_[_0x6935('0x90')](_0x2cc2ef)?null:_['union'](_0x2cc2ef,_0x2e7353);if(!_0xab9aae)return null;var _0xf1251f=[];for(var _0xbfcf71=0x0;_0xbfcf71<_0xab9aae['length'];_0xbfcf71++){var _0x2d174f=_[_0x6935('0x94')](_0x30567b,function(_0x44d24c){return _0xab9aae[_0xbfcf71]?_0x44d24c[_0x6935('0xb')]===_0xab9aae[_0xbfcf71][_0x6935('0xb')]:null;});if(_0x2d174f){if(_0xab9aae[_0xbfcf71][_0x6935('0x96')]){_0xf1251f[_0x6935('0x92')](_0x23c4f7(_0x4073fd[_0x6935('0x11')],_0xab9aae[_0xbfcf71]));}else{if(!_0xab9aae[_0xbfcf71][_0x6935('0x97')]){_0xf1251f[_0x6935('0x92')](_0x55c0d0(_0x2d174f,_0xab9aae[_0xbfcf71],_0x4073fd[_0x6935('0x11')]));}else{if(_0x2d174f[_0x6935('0x8')]){_0xf1251f[_0x6935('0x92')](_0x21b720(_0x2d174f,_0xab9aae[_0xbfcf71]));}}}}}return Promise['all'](_0xf1251f);})[_0x6935('0x5')](function(_0x10c031){var _0x52e0f9=_0x10c031;var _0x256fea=null;if(_0x52e0f9){_0x256fea=_0x52e0f9[_0x6935('0x91')]===0x1?_0x52e0f9[0x0]:null;}if(!_0x256fea&&!_0x52e0f9)return _0x4c350b;var _0x1e7e28=_0x1cddfc[_0x4073fd[_0x6935('0x11')]][_0x6935('0x98')];_0x3e304e[_0x6935('0x8')]=_['keys'](_0x1e7e28);_0x3e304e['query']=_[_0x6935('0x99')](_0x47e57a[_0x6935('0x8e')]);_0x3e304e[_0x6935('0x9a')]=_[_0x6935('0x9b')](_0x3e304e['model'],_0x3e304e[_0x6935('0x8e')]);_0x386a46[_0x6935('0x9c')]=_['intersection'](_0x3e304e[_0x6935('0x8')],qs[_0x6935('0x9d')](_0x47e57a['query'][_0x6935('0x9d')]));_0x386a46['attributes']=_0x386a46['attributes'][_0x6935('0x91')]?_0x386a46[_0x6935('0x9c')]:_0x3e304e[_0x6935('0x8')];if(!_0x47e57a[_0x6935('0x8e')][_0x6935('0x9e')](_0x6935('0x9f'))){_0x386a46['limit']=qs[_0x6935('0xa0')](_0x47e57a['query'][_0x6935('0xa0')]);_0x386a46[_0x6935('0xa1')]=qs[_0x6935('0xa1')](_0x47e57a[_0x6935('0x8e')][_0x6935('0xa1')]);}_0x386a46['order']=qs[_0x6935('0xa2')](_0x47e57a[_0x6935('0x8e')]['sort']);_0x386a46[_0x6935('0x86')]=qs[_0x6935('0x9a')](_[_0x6935('0xa3')](_0x47e57a[_0x6935('0x8e')],_0x3e304e[_0x6935('0x9a')]));if(_0x47e57a[_0x6935('0x8e')][_0x6935('0x3')]){_0x386a46['where']=_['merge'](_0x386a46[_0x6935('0x86')],{'$or':_[_0x6935('0xa')](_0x1e7e28,function(_0xa0a0d4){if(_0xa0a0d4[_0x6935('0xe')][_0x6935('0xa4')]!==_0x6935('0xa5')){var _0x4e0316={};_0x4e0316[_0xa0a0d4[_0x6935('0x4')]]={'$like':'%'+_0x47e57a[_0x6935('0x8e')][_0x6935('0x3')]+'%'};return _0x4e0316;}})});}var _0x29f6bd=[];var _0x57bc35=null;var _0xacd41a={};if(_0x256fea){_0x57bc35=_[_0x6935('0x94')](_0x30567b,[_0x6935('0xb'),_0x256fea[_0x6935('0xb')]]);if(_0x57bc35['field']){_0xacd41a={};if(_0x4073fd['childModel']===_0x6935('0x75')){_0xacd41a[_0x57bc35[_0x6935('0xa6')]]=_[_0x6935('0xa')](_0x256fea[_0x6935('0x6')],'id');}else{_0xacd41a[_0x57bc35['foreignKey']]=_0x256fea['associatedResources'];}_0x29f6bd[_0x6935('0x92')](_0xacd41a);}else{_0x386a46['where']['id']=_0x256fea[_0x6935('0x6')];}}else{for(var _0x15bf93=0x0;_0x15bf93<_0x52e0f9[_0x6935('0x91')];_0x15bf93++){_0x57bc35=_[_0x6935('0x94')](_0x30567b,[_0x6935('0xb'),_0x52e0f9[_0x15bf93][_0x6935('0xb')]]);if(_0x57bc35[_0x6935('0x4')]){_0xacd41a={};_0xacd41a[_0x57bc35[_0x6935('0xa6')]]=_0x52e0f9[_0x15bf93][_0x6935('0x6')];_0x29f6bd[_0x6935('0x92')](_0xacd41a);}else{if(!_0x386a46[_0x6935('0x86')]['id'])_0x386a46[_0x6935('0x86')]['id']=[];_0x52e0f9[_0x15bf93]['associatedResources'][_0x6935('0xa7')](function(_0x2ebe32){_0x386a46[_0x6935('0x86')]['id'][_0x6935('0x92')](_0x2ebe32);});}}}if(!_['isEmpty'](_0x29f6bd)){_0x386a46[_0x6935('0x86')]=_[_0x6935('0xa8')](_0x386a46[_0x6935('0x86')],{'$and':{'$or':_0x29f6bd}});}_0x386a46=_[_0x6935('0xa8')]({},_0x386a46,_0x47e57a['options']);if(_0x256fea&&!_0x256fea[_0x6935('0x97')]&&_0x4073fd[_0x6935('0x11')]==='AnalyticExtractedReport'){if(_0x47e57a[_0x6935('0x8e')][_0x6935('0xa9')]){_0x386a46[_0x6935('0xaa')]=[{'all':!![]}];}return _0x1cddfc[_0x4073fd[_0x6935('0x11')]][_0x6935('0x9')](_0x386a46)[_0x6935('0x5')](function(_0x3d71c3){var _0x4be132=[];_0x3d71c3['forEach'](function(_0x4561a5){var _0x2afd1c;switch(_0x4561a5[_0x6935('0xab')]){case'default':_0x2afd1c=_[_0x6935('0x94')](_0x256fea[_0x6935('0x6')],function(_0x57c5dd){return _0x57c5dd['id']===_0x4561a5[_0x6935('0xac')]&&_0x57c5dd[_0x6935('0xe')]===_0x6935('0xad');});break;case _0x6935('0xae'):_0x2afd1c=_[_0x6935('0x94')](_0x256fea['associatedResources'],function(_0x4b60a4){return _0x4b60a4['id']===_0x4561a5[_0x6935('0xac')]&&_0x4b60a4[_0x6935('0xe')]==='CustomReports';});break;}if(_0x2afd1c)_0x4be132[_0x6935('0x92')](_0x4561a5);});_0x4c350b[_0x6935('0xaf')]=_0x4be132['length'];_0x4c350b[_0x6935('0xb0')]=_0x4be132;return _0x4c350b;});}else{if(!_[_0x6935('0x90')](_0x47e57a[_0x6935('0x8e')][_0x6935('0xb1')])){_0x386a46[_0x6935('0x86')]['id']=_0x386a46['where']['id']?_[_0x6935('0x9b')](_0x386a46[_0x6935('0x86')]['id'],_0x47e57a[_0x6935('0x8e')][_0x6935('0xb1')]):_0x47e57a[_0x6935('0x8e')][_0x6935('0xb1')];if(_0x47e57a[_0x6935('0x8e')]['customSorting']){_0x386a46[_0x6935('0xb2')]=_0x47e57a[_0x6935('0x8e')][_0x6935('0xb3')];}}if(_0x47e57a['query']['extraQueryConditions']){_0x386a46[_0x6935('0x86')]=_[_0x6935('0xa8')](_0x386a46[_0x6935('0x86')],{'$and':_0x47e57a['query'][_0x6935('0xb4')]});}return _0x1cddfc[_0x4073fd[_0x6935('0x11')]][_0x6935('0xaf')]({'where':_0x386a46[_0x6935('0x86')]})['then'](function(_0x527b1a){_0x4c350b[_0x6935('0xaf')]=_0x527b1a;if(_0x47e57a[_0x6935('0x8e')][_0x6935('0xa9')]){if(_0x4073fd[_0x6935('0x11')]==='CmContact'){_0x386a46['include']=[{'model':_0x1cddfc[_0x6935('0x6b')],'as':_0x6935('0xb5'),'attributes':['id','name',_0x6935('0xb6')],'required':_0x47e57a['query']['tag']?!![]:![]},{'model':_0x1cddfc[_0x6935('0x6b')],'as':_0x6935('0xb7'),'attributes':['id',_0x6935('0xb'),_0x6935('0xb6')],'through':_0x47e57a[_0x6935('0x8e')][_0x6935('0xb8')]?{'attributes':[],'where':{'TagId':_0x47e57a['query'][_0x6935('0xb8')]||undefined}}:{},'required':_0x47e57a[_0x6935('0x8e')][_0x6935('0xb8')]?!![]:![]}];}else{_0x386a46['include']=[{'all':!![]}];}}return _0x1cddfc[_0x4073fd[_0x6935('0x11')]][_0x6935('0x9')](_0x386a46);})[_0x6935('0x5')](function(_0x12df9d){_0x4c350b['rows']=_0x12df9d;if(_0x119879===_0x6935('0x2d')&&_0x47e57a['query'][_0x6935('0xb9')]===_0x6935('0xba')){var _0x5a800d=[];for(var _0x7c6c2a=0x0;_0x7c6c2a<_0x4c350b[_0x6935('0xb0')][_0x6935('0x91')];_0x7c6c2a++){_0x5a800d['push'](_0x3cc715(_0x6935('0xbb'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a][_0x6935('0xbc')]));_0x5a800d[_0x6935('0x92')](_0x3cc715(_0x6935('0xbd'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a][_0x6935('0xbc')]));_0x5a800d[_0x6935('0x92')](_0x3cc715(_0x6935('0xbe'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a][_0x6935('0xbc')]));_0x5a800d[_0x6935('0x92')](_0x3cc715(_0x6935('0xbf'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a][_0x6935('0xbc')]));_0x5a800d['push'](_0x3cc715(_0x6935('0xc0'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a]['dataValues']));_0x5a800d[_0x6935('0x92')](_0x3cc715(_0x6935('0xc1'),_0x4c350b[_0x6935('0xb0')][_0x7c6c2a][_0x6935('0xbc')]));}return Promise[_0x6935('0xc2')](_0x5a800d)[_0x6935('0x5')](function(){return _0x4c350b;});}return _0x4c350b;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0269362..0bfd0a4 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 _0x5324=['UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x310eb9,_0x1aed15){var _0x28915c=function(_0x457fd6){while(--_0x457fd6){_0x310eb9['push'](_0x310eb9['shift']());}};_0x28915c(++_0x1aed15);}(_0x5324,0x154));var _0x4532=function(_0xeae11a,_0x94e239){_0xeae11a=_0xeae11a-0x0;var _0x45c252=_0x5324[_0xeae11a];return _0x45c252;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var moment=require(_0x4532('0x2'));var BPromise=require(_0x4532('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4532('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4532('0x5'));var logger=require(_0x4532('0x6'))(_0x4532('0x7'));var config=require(_0x4532('0x8'));var jayson=require(_0x4532('0x9'));var client=jayson[_0x4532('0xa')][_0x4532('0xb')]({'port':0x232a});config[_0x4532('0xc')]=_['defaults'](config[_0x4532('0xc')],{'host':_0x4532('0xd'),'port':0x18eb});var socket=require(_0x4532('0xe'))(new Redis(config[_0x4532('0xc')]));require(_0x4532('0xf'))[_0x4532('0x10')](socket);function respondWithRpcPromise(_0x342da6,_0x2f1b8c,_0x23ad90){return new BPromise(function(_0x3f9647,_0x314e97){return client[_0x4532('0x11')](_0x342da6,_0x23ad90)['then'](function(_0x511ac6){logger[_0x4532('0x12')]('UserProfile,\x20%s,\x20%s',_0x2f1b8c,_0x4532('0x13'));logger[_0x4532('0x14')](_0x4532('0x15'),_0x2f1b8c,_0x4532('0x13'),JSON['stringify'](_0x511ac6));if(_0x511ac6[_0x4532('0x16')]){if(_0x511ac6[_0x4532('0x16')][_0x4532('0x17')]===0x1f4){logger[_0x4532('0x16')](_0x4532('0x18'),_0x2f1b8c,_0x511ac6['error']['message']);return _0x314e97(_0x511ac6['error'][_0x4532('0x19')]);}logger[_0x4532('0x16')](_0x4532('0x18'),_0x2f1b8c,_0x511ac6[_0x4532('0x16')][_0x4532('0x19')]);return _0x3f9647(_0x511ac6[_0x4532('0x16')][_0x4532('0x19')]);}else{logger[_0x4532('0x12')](_0x4532('0x18'),_0x2f1b8c,'request\x20sent');_0x3f9647(_0x511ac6[_0x4532('0x1a')][_0x4532('0x19')]);}})[_0x4532('0x1b')](function(_0x530ce0){logger[_0x4532('0x16')](_0x4532('0x18'),_0x2f1b8c,_0x530ce0);_0x314e97(_0x530ce0);});});} \ No newline at end of file +var _0x964b=['result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x47abc0,_0x5d849a){var _0x3929a1=function(_0x59f5c3){while(--_0x59f5c3){_0x47abc0['push'](_0x47abc0['shift']());}};_0x3929a1(++_0x5d849a);}(_0x964b,0x112));var _0xb964=function(_0x5da2d7,_0x472c4b){_0x5da2d7=_0x5da2d7-0x0;var _0x155973=_0x964b[_0x5da2d7];return _0x155973;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});config[_0xb964('0xa')]=_[_0xb964('0xb')](config[_0xb964('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb964('0xa')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x295392,_0x4df011,_0x4433a5){return new BPromise(function(_0x38247c,_0x38bae5){return client[_0xb964('0xc')](_0x295392,_0x4433a5)['then'](function(_0x442595){logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));logger['debug'](_0xb964('0x10'),_0x4df011,'request\x20sent',JSON['stringify'](_0x442595));if(_0x442595[_0xb964('0x11')]){if(_0x442595[_0xb964('0x11')][_0xb964('0x12')]===0x1f4){logger[_0xb964('0x11')](_0xb964('0xe'),_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38bae5(_0x442595['error'][_0xb964('0x13')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38247c(_0x442595[_0xb964('0x11')][_0xb964('0x13')]);}else{logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));_0x38247c(_0x442595[_0xb964('0x14')][_0xb964('0x13')]);}})['catch'](function(_0x54da04){logger['error'](_0xb964('0xe'),_0x4df011,_0x54da04);_0x38bae5(_0x54da04);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 46d9bd0..7897e05 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 _0x134a=['length','userProfile:','remove','emit','removeListener'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x134a,0x16f));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xa134('0x0'),'update'];function createListener(_0x1f2899,_0x3b96e4){return function(_0x5374da){_0x3b96e4[_0xa134('0x1')](_0x1f2899,_0x5374da);};}function removeListener(_0x358d0e,_0x2e3108){return function(){UserProfileEvents[_0xa134('0x2')](_0x358d0e,_0x2e3108);};}exports['register']=function(_0x49ea7f){for(var _0x233c94=0x0,_0x44a006=events[_0xa134('0x3')];_0x233c94<_0x44a006;_0x233c94++){var _0x18af0f=events[_0x233c94];var _0x3ebd14=createListener(_0xa134('0x4')+_0x18af0f,_0x49ea7f);UserProfileEvents['on'](_0x18af0f,_0x3ebd14);}}; \ No newline at end of file +var _0x3b0d=['save','remove','update','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0xcd31d8,_0x3295f4){var _0x550408=function(_0x17b0f0){while(--_0x17b0f0){_0xcd31d8['push'](_0xcd31d8['shift']());}};_0x550408(++_0x3295f4);}(_0x3b0d,0x13a));var _0xd3b0=function(_0x4fab58,_0x4e9f09){_0x4fab58=_0x4fab58-0x0;var _0xcebea3=_0x3b0d[_0x4fab58];return _0xcebea3;};'use strict';var UserProfileEvents=require(_0xd3b0('0x0'));var events=[_0xd3b0('0x1'),_0xd3b0('0x2'),_0xd3b0('0x3')];function createListener(_0x505ff2,_0x182f80){return function(_0x20ef61){_0x182f80[_0xd3b0('0x4')](_0x505ff2,_0x20ef61);};}function removeListener(_0xfa195d,_0x41c1e8){return function(){UserProfileEvents[_0xd3b0('0x5')](_0xfa195d,_0x41c1e8);};}exports[_0xd3b0('0x6')]=function(_0x46c035){for(var _0x1a3ff0=0x0,_0x1c68cd=events[_0xd3b0('0x7')];_0x1a3ff0<_0x1c68cd;_0x1a3ff0++){var _0x1c57ef=events[_0x1a3ff0];var _0x928eae=createListener(_0xd3b0('0x8')+_0x1c57ef,_0x46c035);UserProfileEvents['on'](_0x1c57ef,_0x928eae);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 9a73602..0e6d2e5 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 _0xcb70=['./userProfileResource.controller','get','isAuthenticated','index','describe','post','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x12f9e3,_0x3fadc1){var _0x2de0c8=function(_0x31b5c5){while(--_0x31b5c5){_0x12f9e3['push'](_0x12f9e3['shift']());}};_0x2de0c8(++_0x3fadc1);}(_0xcb70,0x187));var _0x0cb7=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xcb70[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require('util');var path=require(_0x0cb7('0x1'));var timeout=require(_0x0cb7('0x2'));var express=require(_0x0cb7('0x3'));var router=express[_0x0cb7('0x4')]();var fs_extra=require(_0x0cb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0cb7('0x6'));var config=require(_0x0cb7('0x7'));var controller=require(_0x0cb7('0x8'));router[_0x0cb7('0x9')]('/',auth[_0x0cb7('0xa')](),controller[_0x0cb7('0xb')]);router[_0x0cb7('0x9')]('/describe',auth[_0x0cb7('0xa')](),controller[_0x0cb7('0xc')]);router['get']('/:id',auth[_0x0cb7('0xa')](),controller['show']);router[_0x0cb7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0cb7('0xe')](_0x0cb7('0xf'),auth[_0x0cb7('0xa')](),controller[_0x0cb7('0x10')]);router['delete'](_0x0cb7('0xf'),auth['isAuthenticated'](),controller[_0x0cb7('0x11')]);module[_0x0cb7('0x12')]=router; \ No newline at end of file +var _0xece2=['get','index','describe','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x258721,_0x5ef0e8){var _0x85f95c=function(_0x32c4d6){while(--_0x32c4d6){_0x258721['push'](_0x258721['shift']());}};_0x85f95c(++_0x5ef0e8);}(_0xece2,0x173));var _0x2ece=function(_0x17f99e,_0xcf2256){_0x17f99e=_0x17f99e-0x0;var _0x423721=_0xece2[_0x17f99e];return _0x423721;};'use strict';var multer=require(_0x2ece('0x0'));var util=require(_0x2ece('0x1'));var path=require(_0x2ece('0x2'));var timeout=require(_0x2ece('0x3'));var express=require('express');var router=express[_0x2ece('0x4')]();var fs_extra=require(_0x2ece('0x5'));var auth=require(_0x2ece('0x6'));var interaction=require(_0x2ece('0x7'));var config=require(_0x2ece('0x8'));var controller=require('./userProfileResource.controller');router[_0x2ece('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ece('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2ece('0xb')]);router[_0x2ece('0x9')](_0x2ece('0xc'),auth[_0x2ece('0xd')](),controller[_0x2ece('0xe')]);router[_0x2ece('0xf')]('/',auth['isAuthenticated'](),controller[_0x2ece('0x10')]);router['put'](_0x2ece('0xc'),auth['isAuthenticated'](),controller[_0x2ece('0x11')]);router['delete'](_0x2ece('0xc'),auth[_0x2ece('0xd')](),controller[_0x2ece('0x12')]);module[_0x2ece('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0891b4d..5069ba1 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 _0x6210=['sequelize','exports','STRING'];(function(_0x59ca95,_0xae88f5){var _0xb71b80=function(_0x5d018b){while(--_0x5d018b){_0x59ca95['push'](_0x59ca95['shift']());}};_0xb71b80(++_0xae88f5);}(_0x6210,0x1d4));var _0x0621=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x6210[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require(_0x0621('0x0'));module[_0x0621('0x1')]={'name':{'type':Sequelize[_0x0621('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x0621('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xff76=['sequelize','exports','STRING'];(function(_0x57f7d7,_0x41443c){var _0x11b297=function(_0x2783ce){while(--_0x2783ce){_0x57f7d7['push'](_0x57f7d7['shift']());}};_0x11b297(++_0x41443c);}(_0xff76,0x102));var _0x6ff7=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xff76[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x6ff7('0x0'));module[_0x6ff7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x6ff7('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 89d0210..069b640 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 _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x39a177,_0x4b56f6){var _0x48e98d=function(_0x44b61a){while(--_0x44b61a){_0x39a177['push'](_0x39a177['shift']());}};_0x48e98d(++_0x4b56f6);}(_0xd943,0x15d));var _0x3d94=function(_0x26dc7f,_0x35547c){_0x26dc7f=_0x26dc7f-0x0;var _0x1c3d28=_0xd943[_0x26dc7f];return _0x1c3d28;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file +var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x11601f,_0x53c4f4){var _0x22ecd4=function(_0x4e3705){while(--_0x4e3705){_0x11601f['push'](_0x11601f['shift']());}};_0x22ecd4(++_0x53c4f4);}(_0x2542,0x169));var _0x2254=function(_0x2a1262,_0x88e43c){_0x2a1262=_0x2a1262-0x0;var _0xc03934=_0x2542[_0x2a1262];return _0xc03934;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['UserProfileResource'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 9cc4691..493866d 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 _0xff8a=['lodash','../../config/logger','api','moment','request-promise','exports','define','user_profile_has_resources','compositeIndex','sectionId'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xff8a,0x172));var _0xaff8=function(_0x59146d,_0x10b58e){_0x59146d=_0x59146d-0x0;var _0x592260=_0xff8a[_0x59146d];return _0x592260;};'use strict';var _=require(_0xaff8('0x0'));var util=require('util');var logger=require(_0xaff8('0x1'))(_0xaff8('0x2'));var moment=require(_0xaff8('0x3'));var BPromise=require('bluebird');var rp=require(_0xaff8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xaff8('0x5')]=function(_0x43d551,_0x130efb){return _0x43d551[_0xaff8('0x6')]('UserProfileResource',attributes,{'tableName':_0xaff8('0x7'),'paranoid':![],'indexes':[{'name':_0xaff8('0x8'),'fields':['resourceId',_0xaff8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3f4=['compositeIndex','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x50bc44,_0x3f9843){var _0x33eff9=function(_0x557412){while(--_0x557412){_0x50bc44['push'](_0x50bc44['shift']());}};_0x33eff9(++_0x3f9843);}(_0xd3f4,0x145));var _0x4d3f=function(_0x4cb5e9,_0x4ef5b3){_0x4cb5e9=_0x4cb5e9-0x0;var _0x2d9528=_0xd3f4[_0x4cb5e9];return _0x2d9528;};'use strict';var _=require(_0x4d3f('0x0'));var util=require(_0x4d3f('0x1'));var logger=require(_0x4d3f('0x2'))(_0x4d3f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d3f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d3f('0x5'));var config=require(_0x4d3f('0x6'));var attributes=require(_0x4d3f('0x7'));module[_0x4d3f('0x8')]=function(_0x1780b1,_0x249760){return _0x1780b1[_0x4d3f('0x9')](_0x4d3f('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x4d3f('0xb'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e3a1baa..cc2ac30 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 _0x686b=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x4a7fe7,_0x5b3daf){var _0x2aabb7=function(_0x35ce2b){while(--_0x35ce2b){_0x4a7fe7['push'](_0x4a7fe7['shift']());}};_0x2aabb7(++_0x5b3daf);}(_0x686b,0xc8));var _0xb686=function(_0x118b91,_0xd7ab5){_0x118b91=_0x118b91-0x0;var _0x4e8498=_0x686b[_0x118b91];return _0x4e8498;};'use strict';var _=require(_0xb686('0x0'));var util=require(_0xb686('0x1'));var moment=require(_0xb686('0x2'));var BPromise=require('bluebird');var rs=require(_0xb686('0x3'));var fs=require('fs');var Redis=require(_0xb686('0x4'));var db=require(_0xb686('0x5'))['db'];var utils=require(_0xb686('0x6'));var logger=require('../../config/logger')(_0xb686('0x7'));var config=require(_0xb686('0x8'));var jayson=require(_0xb686('0x9'));var client=jayson[_0xb686('0xa')][_0xb686('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22ec29,_0x58cc0e,_0x154e0e){return new BPromise(function(_0x29529c,_0x3c13c5){return client[_0xb686('0xc')](_0x22ec29,_0x154e0e)['then'](function(_0x3f4070){logger[_0xb686('0xd')](_0xb686('0xe'),_0x58cc0e,_0xb686('0xf'));logger[_0xb686('0x10')](_0xb686('0x11'),_0x58cc0e,_0xb686('0xf'),JSON[_0xb686('0x12')](_0x3f4070));if(_0x3f4070[_0xb686('0x13')]){if(_0x3f4070[_0xb686('0x13')][_0xb686('0x14')]===0x1f4){logger[_0xb686('0x13')](_0xb686('0xe'),_0x58cc0e,_0x3f4070[_0xb686('0x13')]['message']);return _0x3c13c5(_0x3f4070[_0xb686('0x13')]['message']);}logger[_0xb686('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x58cc0e,_0x3f4070[_0xb686('0x13')]['message']);return _0x29529c(_0x3f4070[_0xb686('0x13')][_0xb686('0x15')]);}else{logger[_0xb686('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x58cc0e,_0xb686('0xf'));_0x29529c(_0x3f4070[_0xb686('0x16')][_0xb686('0x15')]);}})[_0xb686('0x17')](function(_0x3d6763){logger[_0xb686('0x13')](_0xb686('0xe'),_0x58cc0e,_0x3d6763);_0x3c13c5(_0x3d6763);});});} \ No newline at end of file +var _0x89f5=['stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','http','request','then','request\x20sent','debug'];(function(_0x27456c,_0x2de858){var _0x446b02=function(_0x28dc04){while(--_0x28dc04){_0x27456c['push'](_0x27456c['shift']());}};_0x446b02(++_0x2de858);}(_0x89f5,0x15b));var _0x589f=function(_0x1952a8,_0x3fc535){_0x1952a8=_0x1952a8-0x0;var _0x1d9015=_0x89f5[_0x1952a8];return _0x1d9015;};'use strict';var _=require(_0x589f('0x0'));var util=require(_0x589f('0x1'));var moment=require(_0x589f('0x2'));var BPromise=require(_0x589f('0x3'));var rs=require(_0x589f('0x4'));var fs=require('fs');var Redis=require(_0x589f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x589f('0x6'))(_0x589f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x589f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1029e6,_0x5c243c,_0x249df1){return new BPromise(function(_0x1b9e98,_0x10ba83){return client[_0x589f('0x9')](_0x1029e6,_0x249df1)[_0x589f('0xa')](function(_0x462bdb){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5c243c,_0x589f('0xb'));logger[_0x589f('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x5c243c,_0x589f('0xb'),JSON[_0x589f('0xd')](_0x462bdb));if(_0x462bdb['error']){if(_0x462bdb[_0x589f('0xe')][_0x589f('0xf')]===0x1f4){logger[_0x589f('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x5c243c,_0x462bdb[_0x589f('0xe')]['message']);return _0x10ba83(_0x462bdb[_0x589f('0xe')][_0x589f('0x10')]);}logger[_0x589f('0xe')](_0x589f('0x11'),_0x5c243c,_0x462bdb[_0x589f('0xe')][_0x589f('0x10')]);return _0x1b9e98(_0x462bdb[_0x589f('0xe')]['message']);}else{logger[_0x589f('0x12')](_0x589f('0x11'),_0x5c243c,_0x589f('0xb'));_0x1b9e98(_0x462bdb[_0x589f('0x13')]['message']);}})['catch'](function(_0x4c7302){logger['error'](_0x589f('0x11'),_0x5c243c,_0x4c7302);_0x10ba83(_0x4c7302);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9618b51..2b1d099 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 _0xb523=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x45b100,_0x29a4b1){var _0x1b41f8=function(_0x5a48b4){while(--_0x5a48b4){_0x45b100['push'](_0x45b100['shift']());}};_0x1b41f8(++_0x29a4b1);}(_0xb523,0x186));var _0x3b52=function(_0xe96fc4,_0x4e04d5){_0xe96fc4=_0xe96fc4-0x0;var _0x5b65c5=_0xb523[_0xe96fc4];return _0x5b65c5;};'use strict';var multer=require('multer');var util=require(_0x3b52('0x0'));var path=require(_0x3b52('0x1'));var timeout=require(_0x3b52('0x2'));var express=require(_0x3b52('0x3'));var router=express[_0x3b52('0x4')]();var fs_extra=require(_0x3b52('0x5'));var auth=require(_0x3b52('0x6'));var interaction=require(_0x3b52('0x7'));var config=require(_0x3b52('0x8'));var controller=require(_0x3b52('0x9'));router[_0x3b52('0xa')]('/',auth[_0x3b52('0xb')](),controller['index']);router[_0x3b52('0xa')](_0x3b52('0xc'),auth[_0x3b52('0xb')](),controller[_0x3b52('0xd')]);router[_0x3b52('0xa')](_0x3b52('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3b52('0xf')]('/',auth[_0x3b52('0xb')](),controller[_0x3b52('0x10')]);router[_0x3b52('0x11')](_0x3b52('0xe'),auth[_0x3b52('0xb')](),controller[_0x3b52('0x12')]);router[_0x3b52('0x13')](_0x3b52('0xe'),auth['isAuthenticated'](),controller[_0x3b52('0x14')]);module[_0x3b52('0x15')]=router; \ No newline at end of file +var _0x4b62=['describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x4ab816,_0x5b75cb){var _0x5e741b=function(_0x150384){while(--_0x150384){_0x4ab816['push'](_0x4ab816['shift']());}};_0x5e741b(++_0x5b75cb);}(_0x4b62,0x97));var _0x24b6=function(_0x5c2b81,_0x19c0f4){_0x5c2b81=_0x5c2b81-0x0;var _0x5bed2f=_0x4b62[_0x5c2b81];return _0x5bed2f;};'use strict';var multer=require('multer');var util=require(_0x24b6('0x0'));var path=require(_0x24b6('0x1'));var timeout=require(_0x24b6('0x2'));var express=require(_0x24b6('0x3'));var router=express[_0x24b6('0x4')]();var fs_extra=require(_0x24b6('0x5'));var auth=require(_0x24b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24b6('0x7'));var controller=require(_0x24b6('0x8'));router[_0x24b6('0x9')]('/',auth[_0x24b6('0xa')](),controller['index']);router[_0x24b6('0x9')]('/describe',auth[_0x24b6('0xa')](),controller[_0x24b6('0xb')]);router[_0x24b6('0x9')](_0x24b6('0xc'),auth[_0x24b6('0xa')](),controller[_0x24b6('0xd')]);router['post']('/',auth[_0x24b6('0xa')](),controller['create']);router[_0x24b6('0xe')]('/:id',auth[_0x24b6('0xa')](),controller['update']);router[_0x24b6('0xf')](_0x24b6('0xc'),auth['isAuthenticated'](),controller[_0x24b6('0x10')]);module[_0x24b6('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7f405fa..f90a051 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 _0xeb3b=['sequelize','exports','STRING','INTEGER','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x2a537d,_0x3f7c58){var _0xf3db87=function(_0x4e3a9e){while(--_0x4e3a9e){_0x2a537d['push'](_0x2a537d['shift']());}};_0xf3db87(++_0x3f7c58);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xeb3b[_0x4551f6];return _0x581dc2;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'name':{'type':Sequelize[_0xbeb3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xbeb3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xbeb3('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xbeb3('0x2')],'set':function(_0x5b0e3b){this[_0xbeb3('0x4')]('crudPermissions',_0x5b0e3b?_0x5b0e3b[_0xbeb3('0x5')](''):[]);},'get':function(){return this[_0xbeb3('0x6')](_0xbeb3('0x7'))?this[_0xbeb3('0x6')](_0xbeb3('0x7'))[_0xbeb3('0x8')](''):[];}}}; \ No newline at end of file +var _0x351d=['sequelize','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x244e2d,_0x473d3f){var _0x154dee=function(_0x507b72){while(--_0x507b72){_0x244e2d['push'](_0x244e2d['shift']());}};_0x154dee(++_0x473d3f);}(_0x351d,0x90));var _0xd351=function(_0x323e4f,_0x188e99){_0x323e4f=_0x323e4f-0x0;var _0x33d6bc=_0x351d[_0x323e4f];return _0x33d6bc;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'name':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd351('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd351('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41d16d){this[_0xd351('0x4')]('crudPermissions',_0x41d16d?_0x41d16d[_0xd351('0x5')](''):[]);},'get':function(){return this[_0xd351('0x6')](_0xd351('0x7'))?this['getDataValue'](_0xd351('0x7'))[_0xd351('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3d2e0fe..84c7877 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 _0xda71=['fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','show','keys','find','catch','create','body','params','describe','eml-format','zip-dir'];(function(_0x2e17f0,_0xacc452){var _0x16b4e7=function(_0x4ca85a){while(--_0x4ca85a){_0x2e17f0['push'](_0x2e17f0['shift']());}};_0x16b4e7(++_0xacc452);}(_0xda71,0x16b));var _0x1da7=function(_0x545496,_0x175f48){_0x545496=_0x545496-0x0;var _0x20a7f5=_0xda71[_0x545496];return _0x20a7f5;};'use strict';var emlformat=require(_0x1da7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1da7('0x1'));var jsonpatch=require(_0x1da7('0x2'));var rp=require(_0x1da7('0x3'));var moment=require('moment');var BPromise=require(_0x1da7('0x4'));var Mustache=require('mustache');var util=require(_0x1da7('0x5'));var path=require(_0x1da7('0x6'));var sox=require(_0x1da7('0x7'));var csv=require(_0x1da7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1da7('0x9'));var crypto=require(_0x1da7('0xa'));var jsforce=require(_0x1da7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1da7('0x8'));var querystring=require(_0x1da7('0xc'));var Papa=require('papaparse');var Redis=require(_0x1da7('0xd'));var authService=require(_0x1da7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da7('0xf'));var hardwareService=require(_0x1da7('0x10'));var logger=require(_0x1da7('0x11'))(_0x1da7('0x12'));var utils=require('../../config/utils');var config=require(_0x1da7('0x13'));var licenseUtil=require(_0x1da7('0x14'));var db=require(_0x1da7('0x15'))['db'];function respondWithStatusCode(_0x15278d,_0x31e5ad){_0x31e5ad=_0x31e5ad||0xcc;return function(_0x25828d){if(_0x25828d){return _0x15278d[_0x1da7('0x16')](_0x31e5ad);}return _0x15278d[_0x1da7('0x17')](_0x31e5ad)[_0x1da7('0x18')]();};}function respondWithResult(_0x596b81,_0x529ea1){_0x529ea1=_0x529ea1||0xc8;return function(_0x5399c0){if(_0x5399c0){return _0x596b81['status'](_0x529ea1)[_0x1da7('0x19')](_0x5399c0);}};}function respondWithFilteredResult(_0x596e2c,_0x2f1ed0){return function(_0x3e4cbf){if(_0x3e4cbf){var _0x2502a5=typeof _0x2f1ed0[_0x1da7('0x1a')]==='undefined'&&typeof _0x2f1ed0['limit']===_0x1da7('0x1b');var _0xf6b659=_0x3e4cbf['count'];var _0x2b7c98=_0x2502a5?0x0:_0x2f1ed0[_0x1da7('0x1a')];var _0x1d8e50=_0x2502a5?_0x3e4cbf['count']:_0x2f1ed0[_0x1da7('0x1a')]+_0x2f1ed0[_0x1da7('0x1c')];var _0x5cea64;if(_0x1d8e50>=_0xf6b659){_0x1d8e50=_0xf6b659;_0x5cea64=0xc8;}else{_0x5cea64=0xce;}_0x596e2c[_0x1da7('0x17')](_0x5cea64);return _0x596e2c[_0x1da7('0x1d')](_0x1da7('0x1e'),_0x2b7c98+'-'+_0x1d8e50+'/'+_0xf6b659)[_0x1da7('0x19')](_0x3e4cbf);}return null;};}function patchUpdates(_0x59ed6a){return function(_0x126869){try{jsonpatch[_0x1da7('0x1f')](_0x126869,_0x59ed6a,!![]);}catch(_0x483bdb){return BPromise['reject'](_0x483bdb);}return _0x126869[_0x1da7('0x20')]();};}function saveUpdates(_0x1770d2,_0x23ceb8){return function(_0xd2a41b){if(_0xd2a41b){return _0xd2a41b[_0x1da7('0x21')](_0x1770d2)[_0x1da7('0x22')](function(_0x4c77f4){return _0x4c77f4;});}return null;};}function removeEntity(_0x2fa0c8,_0x9e5105){return function(_0x98feb2){if(_0x98feb2){return _0x98feb2[_0x1da7('0x23')]()[_0x1da7('0x22')](function(){_0x2fa0c8[_0x1da7('0x17')](0xcc)[_0x1da7('0x18')]();});}};}function handleEntityNotFound(_0x53eed0,_0x4da058){return function(_0x448e5e){if(!_0x448e5e){_0x53eed0[_0x1da7('0x16')](0x194);}return _0x448e5e;};}function handleError(_0x22ac1c,_0x3f6475){_0x3f6475=_0x3f6475||0x1f4;return function(_0x559695){logger[_0x1da7('0x24')](_0x559695[_0x1da7('0x25')]);if(_0x559695['name']){delete _0x559695[_0x1da7('0x26')];}_0x22ac1c[_0x1da7('0x17')](_0x3f6475)[_0x1da7('0x27')](_0x559695);};}exports[_0x1da7('0x28')]=function(_0x23f585,_0x357e38){var _0x16c374={},_0x3521f8={},_0x2051e2={'count':0x0,'rows':[]};var _0x31a8db=_[_0x1da7('0x29')](db[_0x1da7('0x2a')][_0x1da7('0x2b')],function(_0x2513a7){return{'name':_0x2513a7[_0x1da7('0x2c')],'type':_0x2513a7[_0x1da7('0x2d')]['key']};});_0x3521f8['model']=_[_0x1da7('0x29')](_0x31a8db,_0x1da7('0x26'));_0x3521f8[_0x1da7('0x2e')]=_['keys'](_0x23f585[_0x1da7('0x2e')]);_0x3521f8[_0x1da7('0x2f')]=_['intersection'](_0x3521f8[_0x1da7('0x30')],_0x3521f8[_0x1da7('0x2e')]);_0x16c374[_0x1da7('0x31')]=_[_0x1da7('0x32')](_0x3521f8[_0x1da7('0x30')],qs['fields'](_0x23f585['query'][_0x1da7('0x33')]));_0x16c374['attributes']=_0x16c374[_0x1da7('0x31')][_0x1da7('0x34')]?_0x16c374[_0x1da7('0x31')]:_0x3521f8[_0x1da7('0x30')];if(!_0x23f585[_0x1da7('0x2e')][_0x1da7('0x35')]('nolimit')){_0x16c374[_0x1da7('0x1c')]=qs[_0x1da7('0x1c')](_0x23f585[_0x1da7('0x2e')][_0x1da7('0x1c')]);_0x16c374[_0x1da7('0x1a')]=qs[_0x1da7('0x1a')](_0x23f585['query']['offset']);}_0x16c374[_0x1da7('0x36')]=qs[_0x1da7('0x37')](_0x23f585[_0x1da7('0x2e')]['sort']);_0x16c374[_0x1da7('0x38')]=qs[_0x1da7('0x2f')](_[_0x1da7('0x39')](_0x23f585[_0x1da7('0x2e')],_0x3521f8[_0x1da7('0x2f')]),_0x31a8db);if(_0x23f585[_0x1da7('0x2e')][_0x1da7('0x3a')]){_0x16c374[_0x1da7('0x38')]=_[_0x1da7('0x3b')](_0x16c374[_0x1da7('0x38')],{'$or':_[_0x1da7('0x29')](_0x31a8db,function(_0x5b4ed2){if(_0x5b4ed2['type']!=='VIRTUAL'){var _0xcfe312={};_0xcfe312[_0x5b4ed2[_0x1da7('0x26')]]={'$like':'%'+_0x23f585[_0x1da7('0x2e')][_0x1da7('0x3a')]+'%'};return _0xcfe312;}})});}_0x16c374=_[_0x1da7('0x3b')]({},_0x16c374,_0x23f585[_0x1da7('0x3c')]);var _0x1db21a={'where':_0x16c374[_0x1da7('0x38')]};return db[_0x1da7('0x2a')][_0x1da7('0x3d')](_0x1db21a)[_0x1da7('0x22')](function(_0xabca22){_0x2051e2['count']=_0xabca22;if(_0x23f585[_0x1da7('0x2e')]['includeAll']){_0x16c374[_0x1da7('0x3e')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1da7('0x3f')](_0x16c374);})[_0x1da7('0x22')](function(_0x54ee77){_0x2051e2[_0x1da7('0x40')]=_0x54ee77;return _0x2051e2;})[_0x1da7('0x22')](respondWithFilteredResult(_0x357e38,_0x16c374))['catch'](handleError(_0x357e38,null));};exports[_0x1da7('0x41')]=function(_0x4c8422,_0x198c85){var _0x143a2a={'raw':![],'where':{'id':_0x4c8422['params']['id']}},_0x5cc90f={};_0x5cc90f[_0x1da7('0x30')]=_['keys'](db['UserProfileSection'][_0x1da7('0x2b')]);_0x5cc90f[_0x1da7('0x2e')]=_[_0x1da7('0x42')](_0x4c8422['query']);_0x5cc90f[_0x1da7('0x2f')]=_[_0x1da7('0x32')](_0x5cc90f[_0x1da7('0x30')],_0x5cc90f['query']);_0x143a2a[_0x1da7('0x31')]=_[_0x1da7('0x32')](_0x5cc90f['model'],qs[_0x1da7('0x33')](_0x4c8422[_0x1da7('0x2e')][_0x1da7('0x33')]));_0x143a2a[_0x1da7('0x31')]=_0x143a2a[_0x1da7('0x31')][_0x1da7('0x34')]?_0x143a2a[_0x1da7('0x31')]:_0x5cc90f[_0x1da7('0x30')];if(_0x4c8422[_0x1da7('0x2e')]['includeAll']){_0x143a2a[_0x1da7('0x3e')]=[{'all':!![]}];}_0x143a2a=_[_0x1da7('0x3b')]({},_0x143a2a,_0x4c8422[_0x1da7('0x3c')]);return db[_0x1da7('0x2a')][_0x1da7('0x43')](_0x143a2a)['then'](handleEntityNotFound(_0x198c85,null))[_0x1da7('0x22')](respondWithResult(_0x198c85,null))[_0x1da7('0x44')](handleError(_0x198c85,null));};exports[_0x1da7('0x45')]=function(_0x2e618c,_0x398ff5){return db[_0x1da7('0x2a')][_0x1da7('0x45')](_0x2e618c[_0x1da7('0x46')],{})[_0x1da7('0x22')](respondWithResult(_0x398ff5,0xc9))[_0x1da7('0x44')](handleError(_0x398ff5,null));};exports[_0x1da7('0x21')]=function(_0x47cbab,_0x11e30f){if(_0x47cbab['body']['id']){delete _0x47cbab[_0x1da7('0x46')]['id'];}return db[_0x1da7('0x2a')][_0x1da7('0x43')]({'where':{'id':_0x47cbab[_0x1da7('0x47')]['id']}})['then'](handleEntityNotFound(_0x11e30f,null))[_0x1da7('0x22')](saveUpdates(_0x47cbab[_0x1da7('0x46')],null))[_0x1da7('0x22')](respondWithResult(_0x11e30f,null))[_0x1da7('0x44')](handleError(_0x11e30f,null));};exports[_0x1da7('0x23')]=function(_0x26a61c,_0xe79e3f){return db[_0x1da7('0x2a')][_0x1da7('0x43')]({'where':{'id':_0x26a61c[_0x1da7('0x47')]['id']}})[_0x1da7('0x22')](handleEntityNotFound(_0xe79e3f,null))[_0x1da7('0x22')](removeEntity(_0xe79e3f,null))[_0x1da7('0x44')](handleError(_0xe79e3f,null));};exports[_0x1da7('0x48')]=function(_0x5537a6,_0x37aa48){return db[_0x1da7('0x2a')]['describe']()[_0x1da7('0x22')](respondWithResult(_0x37aa48,null))[_0x1da7('0x44')](handleError(_0x37aa48,null));}; \ No newline at end of file +var _0xad31=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','model','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','UserProfileSection','fieldName','type','key','keys','query','filters','intersection','attributes','fields'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xad31,0xf3));var _0x1ad3=function(_0x3c859a,_0x2dc62a){_0x3c859a=_0x3c859a-0x0;var _0x129006=_0xad31[_0x3c859a];return _0x129006;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ad3('0x0'));var zipdir=require(_0x1ad3('0x1'));var jsonpatch=require(_0x1ad3('0x2'));var rp=require(_0x1ad3('0x3'));var moment=require('moment');var BPromise=require(_0x1ad3('0x4'));var Mustache=require('mustache');var util=require(_0x1ad3('0x5'));var path=require(_0x1ad3('0x6'));var sox=require(_0x1ad3('0x7'));var csv=require(_0x1ad3('0x8'));var ejs=require(_0x1ad3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ad3('0xa'));var _=require(_0x1ad3('0xb'));var squel=require(_0x1ad3('0xc'));var crypto=require(_0x1ad3('0xd'));var jsforce=require(_0x1ad3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1ad3('0x8'));var querystring=require(_0x1ad3('0xf'));var Papa=require(_0x1ad3('0x10'));var Redis=require(_0x1ad3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ad3('0x12'));var as=require(_0x1ad3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ad3('0x14'));var utils=require(_0x1ad3('0x15'));var config=require(_0x1ad3('0x16'));var licenseUtil=require(_0x1ad3('0x17'));var db=require(_0x1ad3('0x18'))['db'];function respondWithStatusCode(_0x243cdc,_0x2df6ee){_0x2df6ee=_0x2df6ee||0xcc;return function(_0x48352e){if(_0x48352e){return _0x243cdc['sendStatus'](_0x2df6ee);}return _0x243cdc[_0x1ad3('0x19')](_0x2df6ee)[_0x1ad3('0x1a')]();};}function respondWithResult(_0x3f08a3,_0x477bad){_0x477bad=_0x477bad||0xc8;return function(_0x11ad00){if(_0x11ad00){return _0x3f08a3[_0x1ad3('0x19')](_0x477bad)[_0x1ad3('0x1b')](_0x11ad00);}};}function respondWithFilteredResult(_0x25fffb,_0x34db3c){return function(_0x541a3c){if(_0x541a3c){var _0x4ac2cc=typeof _0x34db3c[_0x1ad3('0x1c')]==='undefined'&&typeof _0x34db3c[_0x1ad3('0x1d')]==='undefined';var _0x2bea6c=_0x541a3c['count'];var _0x275f66=_0x4ac2cc?0x0:_0x34db3c[_0x1ad3('0x1c')];var _0x412a7f=_0x4ac2cc?_0x541a3c[_0x1ad3('0x1e')]:_0x34db3c[_0x1ad3('0x1c')]+_0x34db3c[_0x1ad3('0x1d')];var _0x35f1bf;if(_0x412a7f>=_0x2bea6c){_0x412a7f=_0x2bea6c;_0x35f1bf=0xc8;}else{_0x35f1bf=0xce;}_0x25fffb['status'](_0x35f1bf);return _0x25fffb[_0x1ad3('0x1f')](_0x1ad3('0x20'),_0x275f66+'-'+_0x412a7f+'/'+_0x2bea6c)[_0x1ad3('0x1b')](_0x541a3c);}return null;};}function patchUpdates(_0x17a058){return function(_0x40a327){try{jsonpatch['apply'](_0x40a327,_0x17a058,!![]);}catch(_0x579b64){return BPromise[_0x1ad3('0x21')](_0x579b64);}return _0x40a327[_0x1ad3('0x22')]();};}function saveUpdates(_0x3cfcea,_0x14738f){return function(_0x333056){if(_0x333056){return _0x333056[_0x1ad3('0x23')](_0x3cfcea)[_0x1ad3('0x24')](function(_0x24ef01){return _0x24ef01;});}return null;};}function removeEntity(_0x40f56c,_0x50ee59){return function(_0x26ae6e){if(_0x26ae6e){return _0x26ae6e[_0x1ad3('0x25')]()[_0x1ad3('0x24')](function(){_0x40f56c['status'](0xcc)[_0x1ad3('0x1a')]();});}};}function handleEntityNotFound(_0x53f1d2,_0x401e20){return function(_0x140fb5){if(!_0x140fb5){_0x53f1d2[_0x1ad3('0x26')](0x194);}return _0x140fb5;};}function handleError(_0x4e4b59,_0x4c1354){_0x4c1354=_0x4c1354||0x1f4;return function(_0x4a284){logger['error'](_0x4a284[_0x1ad3('0x27')]);if(_0x4a284[_0x1ad3('0x28')]){delete _0x4a284[_0x1ad3('0x28')];}_0x4e4b59['status'](_0x4c1354)[_0x1ad3('0x29')](_0x4a284);};}exports['index']=function(_0x430942,_0x41a304){var _0x44ec42={},_0x103cac={},_0x31ffe7={'count':0x0,'rows':[]};var _0x4f40f9=_[_0x1ad3('0x2a')](db[_0x1ad3('0x2b')]['rawAttributes'],function(_0xe4ce98){return{'name':_0xe4ce98[_0x1ad3('0x2c')],'type':_0xe4ce98[_0x1ad3('0x2d')][_0x1ad3('0x2e')]};});_0x103cac['model']=_[_0x1ad3('0x2a')](_0x4f40f9,'name');_0x103cac['query']=_[_0x1ad3('0x2f')](_0x430942[_0x1ad3('0x30')]);_0x103cac[_0x1ad3('0x31')]=_[_0x1ad3('0x32')](_0x103cac['model'],_0x103cac['query']);_0x44ec42[_0x1ad3('0x33')]=_[_0x1ad3('0x32')](_0x103cac['model'],qs['fields'](_0x430942[_0x1ad3('0x30')][_0x1ad3('0x34')]));_0x44ec42[_0x1ad3('0x33')]=_0x44ec42[_0x1ad3('0x33')][_0x1ad3('0x35')]?_0x44ec42[_0x1ad3('0x33')]:_0x103cac['model'];if(!_0x430942[_0x1ad3('0x30')][_0x1ad3('0x36')](_0x1ad3('0x37'))){_0x44ec42[_0x1ad3('0x1d')]=qs['limit'](_0x430942['query']['limit']);_0x44ec42[_0x1ad3('0x1c')]=qs['offset'](_0x430942['query']['offset']);}_0x44ec42['order']=qs[_0x1ad3('0x38')](_0x430942[_0x1ad3('0x30')]['sort']);_0x44ec42[_0x1ad3('0x39')]=qs['filters'](_[_0x1ad3('0x3a')](_0x430942['query'],_0x103cac[_0x1ad3('0x31')]),_0x4f40f9);if(_0x430942['query'][_0x1ad3('0x3b')]){_0x44ec42[_0x1ad3('0x39')]=_[_0x1ad3('0x3c')](_0x44ec42[_0x1ad3('0x39')],{'$or':_[_0x1ad3('0x2a')](_0x4f40f9,function(_0x44497c){if(_0x44497c['type']!=='VIRTUAL'){var _0x1144ad={};_0x1144ad[_0x44497c[_0x1ad3('0x28')]]={'$like':'%'+_0x430942['query'][_0x1ad3('0x3b')]+'%'};return _0x1144ad;}})});}_0x44ec42=_[_0x1ad3('0x3c')]({},_0x44ec42,_0x430942[_0x1ad3('0x3d')]);var _0x415798={'where':_0x44ec42[_0x1ad3('0x39')]};return db[_0x1ad3('0x2b')][_0x1ad3('0x1e')](_0x415798)[_0x1ad3('0x24')](function(_0x5beab1){_0x31ffe7[_0x1ad3('0x1e')]=_0x5beab1;if(_0x430942['query'][_0x1ad3('0x3e')]){_0x44ec42[_0x1ad3('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1ad3('0x40')](_0x44ec42);})[_0x1ad3('0x24')](function(_0x19d293){_0x31ffe7['rows']=_0x19d293;return _0x31ffe7;})['then'](respondWithFilteredResult(_0x41a304,_0x44ec42))[_0x1ad3('0x41')](handleError(_0x41a304,null));};exports[_0x1ad3('0x42')]=function(_0x2e6696,_0x54603f){var _0x298c03={'raw':![],'where':{'id':_0x2e6696[_0x1ad3('0x43')]['id']}},_0x171931={};_0x171931[_0x1ad3('0x44')]=_[_0x1ad3('0x2f')](db[_0x1ad3('0x2b')][_0x1ad3('0x45')]);_0x171931['query']=_[_0x1ad3('0x2f')](_0x2e6696[_0x1ad3('0x30')]);_0x171931[_0x1ad3('0x31')]=_['intersection'](_0x171931[_0x1ad3('0x44')],_0x171931['query']);_0x298c03['attributes']=_[_0x1ad3('0x32')](_0x171931['model'],qs['fields'](_0x2e6696[_0x1ad3('0x30')][_0x1ad3('0x34')]));_0x298c03[_0x1ad3('0x33')]=_0x298c03[_0x1ad3('0x33')][_0x1ad3('0x35')]?_0x298c03[_0x1ad3('0x33')]:_0x171931['model'];if(_0x2e6696[_0x1ad3('0x30')]['includeAll']){_0x298c03[_0x1ad3('0x3f')]=[{'all':!![]}];}_0x298c03=_[_0x1ad3('0x3c')]({},_0x298c03,_0x2e6696[_0x1ad3('0x3d')]);return db['UserProfileSection'][_0x1ad3('0x46')](_0x298c03)[_0x1ad3('0x24')](handleEntityNotFound(_0x54603f,null))[_0x1ad3('0x24')](respondWithResult(_0x54603f,null))['catch'](handleError(_0x54603f,null));};exports[_0x1ad3('0x47')]=function(_0x2bce78,_0xed333b){return db['UserProfileSection']['create'](_0x2bce78[_0x1ad3('0x48')],{})[_0x1ad3('0x24')](respondWithResult(_0xed333b,0xc9))[_0x1ad3('0x41')](handleError(_0xed333b,null));};exports[_0x1ad3('0x23')]=function(_0x33d231,_0x288b81){if(_0x33d231[_0x1ad3('0x48')]['id']){delete _0x33d231[_0x1ad3('0x48')]['id'];}return db[_0x1ad3('0x2b')][_0x1ad3('0x46')]({'where':{'id':_0x33d231[_0x1ad3('0x43')]['id']}})[_0x1ad3('0x24')](handleEntityNotFound(_0x288b81,null))[_0x1ad3('0x24')](saveUpdates(_0x33d231['body'],null))[_0x1ad3('0x24')](respondWithResult(_0x288b81,null))[_0x1ad3('0x41')](handleError(_0x288b81,null));};exports['destroy']=function(_0x420785,_0x1dd18a){return db[_0x1ad3('0x2b')][_0x1ad3('0x46')]({'where':{'id':_0x420785[_0x1ad3('0x43')]['id']}})[_0x1ad3('0x24')](handleEntityNotFound(_0x1dd18a,null))[_0x1ad3('0x24')](removeEntity(_0x1dd18a,null))[_0x1ad3('0x41')](handleError(_0x1dd18a,null));};exports[_0x1ad3('0x49')]=function(_0x1f3fcb,_0x27fc13){return db[_0x1ad3('0x2b')]['describe']()[_0x1ad3('0x24')](respondWithResult(_0x27fc13,null))[_0x1ad3('0x41')](handleError(_0x27fc13,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9cef2a0..58fa461 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 _0x7794=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x44dec5,_0x4a52d8){var _0x462428=function(_0x5b7952){while(--_0x5b7952){_0x44dec5['push'](_0x44dec5['shift']());}};_0x462428(++_0x4a52d8);}(_0x7794,0xbf));var _0x4779=function(_0x3b266d,_0x2b9222){_0x3b266d=_0x3b266d-0x0;var _0x5f3dbb=_0x7794[_0x3b266d];return _0x5f3dbb;};'use strict';var _=require(_0x4779('0x0'));var util=require(_0x4779('0x1'));var logger=require(_0x4779('0x2'))(_0x4779('0x3'));var moment=require(_0x4779('0x4'));var BPromise=require(_0x4779('0x5'));var rp=require(_0x4779('0x6'));var fs=require('fs');var path=require(_0x4779('0x7'));var rimraf=require(_0x4779('0x8'));var config=require(_0x4779('0x9'));var attributes=require(_0x4779('0xa'));module[_0x4779('0xb')]=function(_0x237cfc,_0x55c82a){return _0x237cfc[_0x4779('0xc')]('UserProfileSection',attributes,{'tableName':_0x4779('0xd'),'paranoid':![],'indexes':[{'name':_0x4779('0xe'),'fields':[_0x4779('0xf'),_0x4779('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fa7=['user_profile_has_sections','compositeIndex','util','../../config/logger','api','moment','bluebird','path','exports'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x8fa7,0x17c));var _0x78fa=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x8fa7[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0x78fa('0x0'));var logger=require(_0x78fa('0x1'))(_0x78fa('0x2'));var moment=require(_0x78fa('0x3'));var BPromise=require(_0x78fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78fa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x78fa('0x6')]=function(_0x16ded8,_0x1a50a7){return _0x16ded8['define']('UserProfileSection',attributes,{'tableName':_0x78fa('0x7'),'paranoid':![],'indexes':[{'name':_0x78fa('0x8'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 5096913..b2c9966 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 _0xa265=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa265,0x18b));var _0x5a26=function(_0x5c6b98,_0x23ed87){_0x5c6b98=_0x5c6b98-0x0;var _0x325be8=_0xa265[_0x5c6b98];return _0x325be8;};'use strict';var _=require(_0x5a26('0x0'));var util=require(_0x5a26('0x1'));var moment=require(_0x5a26('0x2'));var BPromise=require(_0x5a26('0x3'));var rs=require(_0x5a26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a26('0x5'))['db'];var utils=require(_0x5a26('0x6'));var logger=require('../../config/logger')(_0x5a26('0x7'));var config=require(_0x5a26('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5a26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364503,_0x181270,_0x53843c){return new BPromise(function(_0x26236f,_0x1a220c){return client[_0x5a26('0xa')](_0x364503,_0x53843c)[_0x5a26('0xb')](function(_0x32af4c){logger[_0x5a26('0xc')](_0x5a26('0xd'),_0x181270,_0x5a26('0xe'));logger[_0x5a26('0xf')](_0x5a26('0x10'),_0x181270,'request\x20sent',JSON['stringify'](_0x32af4c));if(_0x32af4c[_0x5a26('0x11')]){if(_0x32af4c[_0x5a26('0x11')]['code']===0x1f4){logger[_0x5a26('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x181270,_0x32af4c[_0x5a26('0x11')]['message']);return _0x1a220c(_0x32af4c['error']['message']);}logger[_0x5a26('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x181270,_0x32af4c['error']['message']);return _0x26236f(_0x32af4c[_0x5a26('0x11')][_0x5a26('0x12')]);}else{logger['info'](_0x5a26('0xd'),_0x181270,_0x5a26('0xe'));_0x26236f(_0x32af4c['result']['message']);}})[_0x5a26('0x13')](function(_0xfed1b1){logger['error'](_0x5a26('0xd'),_0x181270,_0xfed1b1);_0x1a220c(_0xfed1b1);});});} \ No newline at end of file +var _0x7420=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2adf4,_0x5df6de){var _0x45d47d=function(_0x903910){while(--_0x903910){_0x2adf4['push'](_0x2adf4['shift']());}};_0x45d47d(++_0x5df6de);}(_0x7420,0x16e));var _0x0742=function(_0x55ffa0,_0x3c8d0e){_0x55ffa0=_0x55ffa0-0x0;var _0x644bfc=_0x7420[_0x55ffa0];return _0x644bfc;};'use strict';var _=require(_0x0742('0x0'));var util=require(_0x0742('0x1'));var moment=require(_0x0742('0x2'));var BPromise=require(_0x0742('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0742('0x4'));var db=require(_0x0742('0x5'))['db'];var utils=require(_0x0742('0x6'));var logger=require(_0x0742('0x7'))(_0x0742('0x8'));var config=require('../../config/environment');var jayson=require(_0x0742('0x9'));var client=jayson[_0x0742('0xa')][_0x0742('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5712bf,_0x4e5dba,_0x4bdefd){return new BPromise(function(_0x3f1081,_0x202d8f){return client[_0x0742('0xc')](_0x5712bf,_0x4bdefd)[_0x0742('0xd')](function(_0x5dcd2d){logger[_0x0742('0xe')](_0x0742('0xf'),_0x4e5dba,_0x0742('0x10'));logger[_0x0742('0x11')](_0x0742('0x12'),_0x4e5dba,'request\x20sent',JSON[_0x0742('0x13')](_0x5dcd2d));if(_0x5dcd2d[_0x0742('0x14')]){if(_0x5dcd2d[_0x0742('0x14')][_0x0742('0x15')]===0x1f4){logger[_0x0742('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x4e5dba,_0x5dcd2d[_0x0742('0x14')][_0x0742('0x16')]);return _0x202d8f(_0x5dcd2d[_0x0742('0x14')][_0x0742('0x16')]);}logger[_0x0742('0x14')](_0x0742('0xf'),_0x4e5dba,_0x5dcd2d[_0x0742('0x14')][_0x0742('0x16')]);return _0x3f1081(_0x5dcd2d[_0x0742('0x14')]['message']);}else{logger[_0x0742('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4e5dba,_0x0742('0x10'));_0x3f1081(_0x5dcd2d['result'][_0x0742('0x16')]);}})[_0x0742('0x17')](function(_0x37b8e2){logger[_0x0742('0x14')](_0x0742('0xf'),_0x4e5dba,_0x37b8e2);_0x202d8f(_0x37b8e2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1db793f..27aedbd 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x480455,_0x449bb4){var _0x9105e4=function(_0xd6fdcd){while(--_0xd6fdcd){_0x480455['push'](_0x480455['shift']());}};_0x9105e4(++_0x449bb4);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3cdbe7,_0x3d6df1){var _0x38886e=function(_0x49bd6d){while(--_0x49bd6d){_0x3cdbe7['push'](_0x3cdbe7['shift']());}};_0x38886e(++_0x3d6df1);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b53c945..1b054bb 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 _0x004d=['INTEGER','sequelize','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x004d,0x124));var _0xd004=function(_0x146143,_0x87c4b5){_0x146143=_0x146143-0x0;var _0x488d70=_0x004d[_0x146143];return _0x488d70;};'use strict';var Sequelize=require(_0xd004('0x0'));module[_0xd004('0x1')]={'penalty':{'type':Sequelize[_0xd004('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe11f=['sequelize'];(function(_0x82043d,_0x457d09){var _0x4a155f=function(_0x3edf1a){while(--_0x3edf1a){_0x82043d['push'](_0x82043d['shift']());}};_0x4a155f(++_0x457d09);}(_0xe11f,0x176));var _0xfe11=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xe11f[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0xfe11('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 1d91d2f..0f3bd90 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 _0xd481=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xd481,0x1e4));var _0x1d48=function(_0x57e92f,_0x18ad40){_0x57e92f=_0x57e92f-0x0;var _0x3b2e43=_0xd481[_0x57e92f];return _0x3b2e43;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['exports','UserSmsQueue','user_has_sms_queues','lodash','util','request-promise','path','rimraf','./userSmsQueue.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed1c,0xe4));var _0xced1=function(_0x41c31b,_0xdda69e){_0x41c31b=_0x41c31b-0x0;var _0x356ace=_0xed1c[_0x41c31b];return _0x356ace;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'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 6912046..99eb45b 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 _0x695b=['randomstring','ioredis','../../config/utils','rpc','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x695b,0x10c));var _0xb695=function(_0x15b276,_0x13b140){_0x15b276=_0x15b276-0x0;var _0x46f7cc=_0x695b[_0x15b276];return _0x46f7cc;};'use strict';var _=require(_0xb695('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb695('0x1'));var rs=require(_0xb695('0x2'));var fs=require('fs');var Redis=require(_0xb695('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb695('0x4'));var logger=require('../../config/logger')(_0xb695('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb695('0x6')][_0xb695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x145cd7,_0x571ccb,_0x5a7398){return new BPromise(function(_0x148712,_0x24cb02){return client['request'](_0x145cd7,_0x5a7398)[_0xb695('0x8')](function(_0x42b783){logger['info'](_0xb695('0x9'),_0x571ccb,_0xb695('0xa'));logger[_0xb695('0xb')](_0xb695('0xc'),_0x571ccb,_0xb695('0xa'),JSON[_0xb695('0xd')](_0x42b783));if(_0x42b783[_0xb695('0xe')]){if(_0x42b783[_0xb695('0xe')]['code']===0x1f4){logger['error'](_0xb695('0x9'),_0x571ccb,_0x42b783[_0xb695('0xe')]['message']);return _0x24cb02(_0x42b783[_0xb695('0xe')]['message']);}logger[_0xb695('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x571ccb,_0x42b783[_0xb695('0xe')][_0xb695('0xf')]);return _0x148712(_0x42b783[_0xb695('0xe')]['message']);}else{logger[_0xb695('0x10')](_0xb695('0x9'),_0x571ccb,'request\x20sent');_0x148712(_0x42b783['result'][_0xb695('0xf')]);}})[_0xb695('0x11')](function(_0x12a21f){logger[_0xb695('0xe')](_0xb695('0x9'),_0x571ccb,_0x12a21f);_0x24cb02(_0x12a21f);});});} \ No newline at end of file +var _0x5896=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5896,0x1bd));var _0x6589=function(_0x5de757,_0x1f85f7){_0x5de757=_0x5de757-0x0;var _0x594b6c=_0x5896[_0x5de757];return _0x594b6c;};'use strict';var _=require('lodash');var util=require(_0x6589('0x0'));var moment=require('moment');var BPromise=require(_0x6589('0x1'));var rs=require(_0x6589('0x2'));var fs=require('fs');var Redis=require(_0x6589('0x3'));var db=require(_0x6589('0x4'))['db'];var utils=require(_0x6589('0x5'));var logger=require(_0x6589('0x6'))(_0x6589('0x7'));var config=require(_0x6589('0x8'));var jayson=require(_0x6589('0x9'));var client=jayson[_0x6589('0xa')][_0x6589('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x433f42,_0x8e53c4,_0x4ceca3){return new BPromise(function(_0x1ac070,_0x43f972){return client[_0x6589('0xc')](_0x433f42,_0x4ceca3)[_0x6589('0xd')](function(_0x6e626a){logger[_0x6589('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x8e53c4,_0x6589('0xf'));logger[_0x6589('0x10')](_0x6589('0x11'),_0x8e53c4,_0x6589('0xf'),JSON[_0x6589('0x12')](_0x6e626a));if(_0x6e626a[_0x6589('0x13')]){if(_0x6e626a[_0x6589('0x13')][_0x6589('0x14')]===0x1f4){logger[_0x6589('0x13')](_0x6589('0x15'),_0x8e53c4,_0x6e626a[_0x6589('0x13')][_0x6589('0x16')]);return _0x43f972(_0x6e626a[_0x6589('0x13')][_0x6589('0x16')]);}logger[_0x6589('0x13')](_0x6589('0x15'),_0x8e53c4,_0x6e626a[_0x6589('0x13')]['message']);return _0x1ac070(_0x6e626a[_0x6589('0x13')]['message']);}else{logger[_0x6589('0xe')](_0x6589('0x15'),_0x8e53c4,'request\x20sent');_0x1ac070(_0x6e626a[_0x6589('0x17')][_0x6589('0x16')]);}})[_0x6589('0x18')](function(_0x2f7522){logger[_0x6589('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x8e53c4,_0x2f7522);_0x43f972(_0x2f7522);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ac444e5..a0787db 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 _0x950c=['exports','INTEGER','sequelize'];(function(_0x522560,_0x5939bb){var _0x1f1691=function(_0x3f8b17){while(--_0x3f8b17){_0x522560['push'](_0x522560['shift']());}};_0x1f1691(++_0x5939bb);}(_0x950c,0x143));var _0xc950=function(_0x30694d,_0x42c3ce){_0x30694d=_0x30694d-0x0;var _0x5f2351=_0x950c[_0x30694d];return _0x5f2351;};'use strict';var Sequelize=require(_0xc950('0x0'));module[_0xc950('0x1')]={'UserId':{'type':Sequelize[_0xc950('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc950('0x2')]}}; \ No newline at end of file +var _0x9e14=['INTEGER','sequelize','exports'];(function(_0x4fa2ef,_0x1e3088){var _0x8610f4=function(_0x35a139){while(--_0x35a139){_0x4fa2ef['push'](_0x4fa2ef['shift']());}};_0x8610f4(++_0x1e3088);}(_0x9e14,0x1d2));var _0x49e1=function(_0x197ee8,_0x4400f6){_0x197ee8=_0x197ee8-0x0;var _0x5987a7=_0x9e14[_0x197ee8];return _0x5987a7;};'use strict';var Sequelize=require(_0x49e1('0x0'));module[_0x49e1('0x1')]={'UserId':{'type':Sequelize[_0x49e1('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 77a4549..cd34e90 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(_0x11305d,_0x36ccf2){var _0x5ef296=function(_0x1d8800){while(--_0x1d8800){_0x11305d['push'](_0x11305d['shift']());}};_0x5ef296(++_0x36ccf2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x41f8e4,_0x1333bd){var _0x39c346=function(_0x4a3f5f){while(--_0x4a3f5f){_0x41f8e4['push'](_0x41f8e4['shift']());}};_0x39c346(++_0x1333bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 b42b321..18bbab3 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x49c3b9,_0x1e3272){var _0x5981c1=function(_0x265191){while(--_0x265191){_0x49c3b9['push'](_0x49c3b9['shift']());}};_0x5981c1(++_0x1e3272);}(_0x70e0,0x17b));var _0x070e=function(_0x309461,_0x32350f){_0x309461=_0x309461-0x0;var _0x36bd82=_0x70e0[_0x309461];return _0x36bd82;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x49c335,_0x482bc3){var _0xab0bd2=function(_0x24f2b8){while(--_0x24f2b8){_0x49c335['push'](_0x49c335['shift']());}};_0xab0bd2(++_0x482bc3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 783cdda..3f2f289 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 _0x976e=['exports'];(function(_0x2442a8,_0x3e0d90){var _0x105340=function(_0x1fd248){while(--_0x1fd248){_0x2442a8['push'](_0x2442a8['shift']());}};_0x105340(++_0x3e0d90);}(_0x976e,0x1a7));var _0xe976=function(_0x4c9915,_0x406b1a){_0x4c9915=_0x4c9915-0x0;var _0x473218=_0x976e[_0x4c9915];return _0x473218;};'use strict';var Sequelize=require('sequelize');module[_0xe976('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1159=['sequelize'];(function(_0x53907c,_0x4f7e48){var _0x1dd5b6=function(_0x2f360c){while(--_0x2f360c){_0x53907c['push'](_0x53907c['shift']());}};_0x1dd5b6(++_0x4f7e48);}(_0x1159,0xf3));var _0x9115=function(_0x36cb17,_0x1b38a0){_0x36cb17=_0x36cb17-0x0;var _0x55bcb0=_0x1159[_0x36cb17];return _0x55bcb0;};'use strict';var Sequelize=require(_0x9115('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 41255f6..498e88d 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 _0x90e7=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x3d39b1,_0x180c7c){var _0x81ccf3=function(_0x391fb3){while(--_0x391fb3){_0x3d39b1['push'](_0x3d39b1['shift']());}};_0x81ccf3(++_0x180c7c);}(_0x90e7,0x75));var _0x790e=function(_0x1e5aac,_0x132857){_0x1e5aac=_0x1e5aac-0x0;var _0x18ffec=_0x90e7[_0x1e5aac];return _0x18ffec;};'use strict';var _=require(_0x790e('0x0'));var util=require(_0x790e('0x1'));var logger=require(_0x790e('0x2'))('api');var moment=require(_0x790e('0x3'));var BPromise=require(_0x790e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x790e('0x5'));var rimraf=require(_0x790e('0x6'));var config=require(_0x790e('0x7'));var attributes=require(_0x790e('0x8'));module[_0x790e('0x9')]=function(_0x42fde5,_0x6e095b){return _0x42fde5[_0x790e('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x790e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe308=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','util','../../config/logger','api','bluebird','path'];(function(_0x2bdab0,_0x438d82){var _0x33196f=function(_0x1e282d){while(--_0x1e282d){_0x2bdab0['push'](_0x2bdab0['shift']());}};_0x33196f(++_0x438d82);}(_0xe308,0xdc));var _0x8e30=function(_0x3fa380,_0x5ea7a9){_0x3fa380=_0x3fa380-0x0;var _0x53b5cb=_0xe308[_0x3fa380];return _0x53b5cb;};'use strict';var _=require('lodash');var util=require(_0x8e30('0x0'));var logger=require(_0x8e30('0x1'))(_0x8e30('0x2'));var moment=require('moment');var BPromise=require(_0x8e30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e30('0x4'));var rimraf=require(_0x8e30('0x5'));var config=require(_0x8e30('0x6'));var attributes=require(_0x8e30('0x7'));module['exports']=function(_0x5185b6,_0x418b11){return _0x5185b6[_0x8e30('0x8')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index a7b499b..73298a7 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 _0xe0b4=['lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x245ff8,_0x2e81f8){var _0x5a4faa=function(_0x26af9e){while(--_0x26af9e){_0x245ff8['push'](_0x245ff8['shift']());}};_0x5a4faa(++_0x2e81f8);}(_0xe0b4,0x1a2));var _0x4e0b=function(_0x55b170,_0x4de763){_0x55b170=_0x55b170-0x0;var _0x11ac38=_0xe0b4[_0x55b170];return _0x11ac38;};'use strict';var _=require(_0x4e0b('0x0'));var util=require('util');var moment=require(_0x4e0b('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e0b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e0b('0x3'));var logger=require(_0x4e0b('0x4'))(_0x4e0b('0x5'));var config=require(_0x4e0b('0x6'));var jayson=require(_0x4e0b('0x7'));var client=jayson[_0x4e0b('0x8')][_0x4e0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x400c10,_0x3d8fc3,_0xefac5b){return new BPromise(function(_0x1f09a8,_0x5d9b8d){return client[_0x4e0b('0xa')](_0x400c10,_0xefac5b)[_0x4e0b('0xb')](function(_0x12ce44){logger[_0x4e0b('0xc')](_0x4e0b('0xd'),_0x3d8fc3,_0x4e0b('0xe'));logger[_0x4e0b('0xf')](_0x4e0b('0x10'),_0x3d8fc3,'request\x20sent',JSON[_0x4e0b('0x11')](_0x12ce44));if(_0x12ce44[_0x4e0b('0x12')]){if(_0x12ce44[_0x4e0b('0x12')][_0x4e0b('0x13')]===0x1f4){logger[_0x4e0b('0x12')](_0x4e0b('0xd'),_0x3d8fc3,_0x12ce44['error'][_0x4e0b('0x14')]);return _0x5d9b8d(_0x12ce44['error'][_0x4e0b('0x14')]);}logger[_0x4e0b('0x12')](_0x4e0b('0xd'),_0x3d8fc3,_0x12ce44['error'][_0x4e0b('0x14')]);return _0x1f09a8(_0x12ce44[_0x4e0b('0x12')][_0x4e0b('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x3d8fc3,_0x4e0b('0xe'));_0x1f09a8(_0x12ce44['result'][_0x4e0b('0x14')]);}})[_0x4e0b('0x15')](function(_0x5b0f2b){logger[_0x4e0b('0x12')](_0x4e0b('0xd'),_0x3d8fc3,_0x5b0f2b);_0x5d9b8d(_0x5b0f2b);});});} \ No newline at end of file +var _0x3253=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','lodash'];(function(_0x5b1533,_0x27e66c){var _0x1ea41d=function(_0x56d2d7){while(--_0x56d2d7){_0x5b1533['push'](_0x5b1533['shift']());}};_0x1ea41d(++_0x27e66c);}(_0x3253,0xd0));var _0x3325=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0x3253[_0x5e6cb8];return _0x41754f;};'use strict';var _=require(_0x3325('0x0'));var util=require('util');var moment=require(_0x3325('0x1'));var BPromise=require(_0x3325('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3325('0x3'));var db=require(_0x3325('0x4'))['db'];var utils=require(_0x3325('0x5'));var logger=require('../../config/logger')(_0x3325('0x6'));var config=require(_0x3325('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3325('0x8')][_0x3325('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e1ece,_0x211088,_0x194142){return new BPromise(function(_0x2ba543,_0x3008aa){return client['request'](_0x1e1ece,_0x194142)[_0x3325('0xa')](function(_0x563c81){logger['info'](_0x3325('0xb'),_0x211088,'request\x20sent');logger[_0x3325('0xc')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x211088,_0x3325('0xd'),JSON['stringify'](_0x563c81));if(_0x563c81[_0x3325('0xe')]){if(_0x563c81[_0x3325('0xe')][_0x3325('0xf')]===0x1f4){logger[_0x3325('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x211088,_0x563c81[_0x3325('0xe')][_0x3325('0x10')]);return _0x3008aa(_0x563c81[_0x3325('0xe')][_0x3325('0x10')]);}logger[_0x3325('0xe')](_0x3325('0xb'),_0x211088,_0x563c81['error'][_0x3325('0x10')]);return _0x2ba543(_0x563c81[_0x3325('0xe')]['message']);}else{logger[_0x3325('0x11')](_0x3325('0xb'),_0x211088,_0x3325('0xd'));_0x2ba543(_0x563c81[_0x3325('0x12')][_0x3325('0x10')]);}})['catch'](function(_0x1b8d73){logger['error'](_0x3325('0xb'),_0x211088,_0x1b8d73);_0x3008aa(_0x1b8d73);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9462696..3226446 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3560b2,_0x1fa80a){var _0x4f459c=function(_0x31561c){while(--_0x31561c){_0x3560b2['push'](_0x3560b2['shift']());}};_0x4f459c(++_0x1fa80a);}(_0xe706,0xa3));var _0x6e70=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xe706[_0x17c483];return _0x112bdb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4d88be,_0x10fce5){var _0x5641a9=function(_0x44d419){while(--_0x44d419){_0x4d88be['push'](_0x4d88be['shift']());}};_0x5641a9(++_0x10fce5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index fb5ff50..09bd4c3 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 _0xb77c=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x293659,_0x2eda58){var _0x4257c9=function(_0x4622c1){while(--_0x4622c1){_0x293659['push'](_0x293659['shift']());}};_0x4257c9(++_0x2eda58);}(_0xb77c,0x89));var _0xcb77=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb77c[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0xcb77('0x0'));module[_0xcb77('0x1')]={'uniqueid':{'type':Sequelize[_0xcb77('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xcb77('0x3')],'allowNull':![],'comment':_0xcb77('0x4')},'UserId':{'type':Sequelize[_0xcb77('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb77('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xcb77('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xcb77('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcb77('0x4')},'paused':{'type':Sequelize[_0xcb77('0x2')](0xb),'defaultValue':0x0,'comment':_0xcb77('0x4')}}; \ No newline at end of file +var _0x07d1=['sequelize','exports','STRING','Required\x20by\x20Asterisk','INTEGER','queue_interface'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x07d1,0xf0));var _0x107d=function(_0x261318,_0x47ca22){_0x261318=_0x261318-0x0;var _0x3a479b=_0x07d1[_0x261318];return _0x3a479b;};'use strict';var Sequelize=require(_0x107d('0x0'));module[_0x107d('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x107d('0x2')],'allowNull':![],'comment':_0x107d('0x3')},'UserId':{'type':Sequelize[_0x107d('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x107d('0x5'),'comment':_0x107d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x107d('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x107d('0x5'),'comment':_0x107d('0x3')},'penalty':{'type':Sequelize[_0x107d('0x4')](0xb),'defaultValue':0x0,'comment':_0x107d('0x3')},'paused':{'type':Sequelize[_0x107d('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 68bffad..ab13a96 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 _0xc2f9=['exports','events','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x51de6e,_0x3a3de1){var _0x100339=function(_0x4f93f0){while(--_0x4f93f0){_0x51de6e['push'](_0x51de6e['shift']());}};_0x100339(++_0x3a3de1);}(_0xc2f9,0x1c3));var _0x9c2f=function(_0x2507fb,_0x8a56f3){_0x2507fb=_0x2507fb-0x0;var _0x1cea60=_0xc2f9[_0x2507fb];return _0x1cea60;};'use strict';var EventEmitter=require(_0x9c2f('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x9c2f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9c2f('0x2')](0x0);var events={'afterCreate':_0x9c2f('0x3'),'afterUpdate':'update','afterDestroy':_0x9c2f('0x4')};function emitEvent(_0x41e45a){return function(_0x3cf1e8,_0x215b09,_0x3465b0){UserVoiceQueueRtEvents[_0x9c2f('0x5')](_0x41e45a+':'+_0x3cf1e8['id'],_0x3cf1e8);UserVoiceQueueRtEvents['emit'](_0x41e45a,_0x3cf1e8);_0x3465b0(null);};}for(var e in events){if(events[_0x9c2f('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x9c2f('0x7')](e,emitEvent(event));}}module[_0x9c2f('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0fc8=['UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x0fc8,0xe8));var _0x80fc=function(_0x4318fa,_0x319ba4){_0x4318fa=_0x4318fa-0x0;var _0x5401ca=_0x0fc8[_0x4318fa];return _0x5401ca;};'use strict';var EventEmitter=require(_0x80fc('0x0'));var UserVoiceQueueRt=require(_0x80fc('0x1'))['db'][_0x80fc('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x80fc('0x3'),'afterUpdate':_0x80fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3190f6){return function(_0x21e5de,_0x116eb7,_0x3f5f74){UserVoiceQueueRtEvents[_0x80fc('0x5')](_0x3190f6+':'+_0x21e5de['id'],_0x21e5de);UserVoiceQueueRtEvents[_0x80fc('0x5')](_0x3190f6,_0x21e5de);_0x3f5f74(null);};}for(var e in events){if(events[_0x80fc('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x80fc('0x7')](e,emitEvent(event));}}module[_0x80fc('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 110223e..63017c4 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 _0x8671=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x266b6c,_0x572095){var _0xcd1dbe=function(_0x388795){while(--_0x388795){_0x266b6c['push'](_0x266b6c['shift']());}};_0xcd1dbe(++_0x572095);}(_0x8671,0x90));var _0x1867=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8671[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x1867('0x0'));var util=require(_0x1867('0x1'));var logger=require(_0x1867('0x2'))(_0x1867('0x3'));var moment=require(_0x1867('0x4'));var BPromise=require(_0x1867('0x5'));var rp=require(_0x1867('0x6'));var fs=require('fs');var path=require(_0x1867('0x7'));var rimraf=require(_0x1867('0x8'));var config=require(_0x1867('0x9'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x1867('0xa')]=function(_0x3c5fff,_0x1be8b6){return _0x3c5fff[_0x1867('0xb')]('UserVoiceQueueRt',attributes,{'tableName':_0x1867('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f5d=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x1cc822,_0x44701f){var _0x3bb947=function(_0x184f28){while(--_0x184f28){_0x1cc822['push'](_0x1cc822['shift']());}};_0x3bb947(++_0x44701f);}(_0x9f5d,0xb0));var _0xd9f5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9f5d[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd9f5('0x0'));var util=require(_0xd9f5('0x1'));var logger=require(_0xd9f5('0x2'))(_0xd9f5('0x3'));var moment=require(_0xd9f5('0x4'));var BPromise=require(_0xd9f5('0x5'));var rp=require(_0xd9f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9f5('0x7'));var config=require(_0xd9f5('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xd9f5('0x9')]=function(_0x12d287,_0x22f6b2){return _0x12d287[_0xd9f5('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0xd9f5('0xb'),'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 e3454d2..fe003f7 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 _0x054e=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','COUNT','sequelize','literal','outboundQueuePauses','then','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request'];(function(_0x24e9f8,_0x1b0073){var _0x5f0d3d=function(_0x23011a){while(--_0x23011a){_0x24e9f8['push'](_0x24e9f8['shift']());}};_0x5f0d3d(++_0x1b0073);}(_0x054e,0xd3));var _0xe054=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x054e[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xe054('0x0'));var util=require(_0xe054('0x1'));var moment=require(_0xe054('0x2'));var BPromise=require(_0xe054('0x3'));var rs=require(_0xe054('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe054('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe054('0x6'));var client=jayson['client'][_0xe054('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe054('0x8')],{'host':_0xe054('0x9'),'port':0x18eb});var socket=require(_0xe054('0xa'))(new Redis(config[_0xe054('0x8')]));require(_0xe054('0xb'))['register'](socket);function respondWithRpcPromise(_0x3f1bd5,_0x202dfb,_0x226e8e){return new BPromise(function(_0x2e9fcb,_0x15557a){return client[_0xe054('0xc')](_0x3f1bd5,_0x226e8e)['then'](function(_0x4e9324){logger['info'](_0xe054('0xd'),_0x202dfb,_0xe054('0xe'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x202dfb,_0xe054('0xe'),JSON[_0xe054('0xf')](_0x4e9324));if(_0x4e9324[_0xe054('0x10')]){if(_0x4e9324[_0xe054('0x10')][_0xe054('0x11')]===0x1f4){logger[_0xe054('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x202dfb,_0x4e9324[_0xe054('0x10')]['message']);return _0x15557a(_0x4e9324[_0xe054('0x10')]['message']);}logger[_0xe054('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x202dfb,_0x4e9324[_0xe054('0x10')][_0xe054('0x12')]);return _0x2e9fcb(_0x4e9324[_0xe054('0x10')][_0xe054('0x12')]);}else{logger[_0xe054('0x13')](_0xe054('0xd'),_0x202dfb,_0xe054('0xe'));_0x2e9fcb(_0x4e9324[_0xe054('0x14')][_0xe054('0x12')]);}})['catch'](function(_0x1ebcb1){logger[_0xe054('0x10')](_0xe054('0xd'),_0x202dfb,_0x1ebcb1);_0x15557a(_0x1ebcb1);});});}exports[_0xe054('0x15')]=function(_0x507416){var _0x424327=this;return new Promise(function(_0x2d34db,_0x1d9192){return db[_0xe054('0x16')][_0xe054('0x17')]({'raw':_0x507416[_0xe054('0x18')]?_0x507416[_0xe054('0x18')][_0xe054('0x19')]===undefined?!![]:![]:!![],'where':_0x507416[_0xe054('0x18')]?_0x507416[_0xe054('0x18')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xe054('0x1a'),db[_0xe054('0x1b')]['fn']('IF',db[_0xe054('0x1b')][_0xe054('0x1c')]('`paused`\x20=\x201,\x201,\x20null'))),_0xe054('0x1d')]]})[_0xe054('0x1e')](function(_0x469d82){logger[_0xe054('0x13')](_0xe054('0x15'),_0x507416);logger[_0xe054('0x1f')]('GetVoiceQueueRtPauses',_0x507416,JSON['stringify'](_0x469d82));_0x2d34db(_0x469d82);})['catch'](function(_0xc21a3d){logger[_0xe054('0x10')](_0xe054('0x15'),_0xc21a3d[_0xe054('0x12')],_0x507416);_0x1d9192(_0x424327[_0xe054('0x10')](0x1f4,_0xc21a3d['message']));});});}; \ No newline at end of file +var _0xbf85=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','util','moment','bluebird','randomstring'];(function(_0x4a7145,_0x14c18b){var _0x9e46d5=function(_0x1602fe){while(--_0x1602fe){_0x4a7145['push'](_0x4a7145['shift']());}};_0x9e46d5(++_0x14c18b);}(_0xbf85,0x164));var _0x5bf8=function(_0x6266ea,_0x3e020b){_0x6266ea=_0x6266ea-0x0;var _0xaae983=_0xbf85[_0x6266ea];return _0xaae983;};'use strict';var _=require('lodash');var util=require(_0x5bf8('0x0'));var moment=require(_0x5bf8('0x1'));var BPromise=require(_0x5bf8('0x2'));var rs=require(_0x5bf8('0x3'));var fs=require('fs');var Redis=require(_0x5bf8('0x4'));var db=require(_0x5bf8('0x5'))['db'];var utils=require(_0x5bf8('0x6'));var logger=require('../../config/logger')(_0x5bf8('0x7'));var config=require(_0x5bf8('0x8'));var jayson=require(_0x5bf8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x5bf8('0xa')]=_[_0x5bf8('0xb')](config[_0x5bf8('0xa')],{'host':_0x5bf8('0xc'),'port':0x18eb});var socket=require(_0x5bf8('0xd'))(new Redis(config[_0x5bf8('0xa')]));require('./userVoiceQueueRt.socket')[_0x5bf8('0xe')](socket);function respondWithRpcPromise(_0x1f48aa,_0x2c5596,_0x1b40d4){return new BPromise(function(_0x31050f,_0x3c2632){return client[_0x5bf8('0xf')](_0x1f48aa,_0x1b40d4)[_0x5bf8('0x10')](function(_0x46c88c){logger[_0x5bf8('0x11')](_0x5bf8('0x12'),_0x2c5596,'request\x20sent');logger[_0x5bf8('0x13')](_0x5bf8('0x14'),_0x2c5596,_0x5bf8('0x15'),JSON[_0x5bf8('0x16')](_0x46c88c));if(_0x46c88c[_0x5bf8('0x17')]){if(_0x46c88c[_0x5bf8('0x17')][_0x5bf8('0x18')]===0x1f4){logger['error'](_0x5bf8('0x12'),_0x2c5596,_0x46c88c[_0x5bf8('0x17')][_0x5bf8('0x19')]);return _0x3c2632(_0x46c88c['error']['message']);}logger['error'](_0x5bf8('0x12'),_0x2c5596,_0x46c88c[_0x5bf8('0x17')][_0x5bf8('0x19')]);return _0x31050f(_0x46c88c[_0x5bf8('0x17')][_0x5bf8('0x19')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c5596,_0x5bf8('0x15'));_0x31050f(_0x46c88c['result'][_0x5bf8('0x19')]);}})[_0x5bf8('0x1a')](function(_0x25d037){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c5596,_0x25d037);_0x3c2632(_0x25d037);});});}exports[_0x5bf8('0x1b')]=function(_0x2500a4){var _0x32f7c0=this;return new Promise(function(_0x130428,_0x351898){return db[_0x5bf8('0x1c')][_0x5bf8('0x1d')]({'raw':_0x2500a4[_0x5bf8('0x1e')]?_0x2500a4[_0x5bf8('0x1e')][_0x5bf8('0x1f')]===undefined?!![]:![]:!![],'where':_0x2500a4[_0x5bf8('0x1e')]?_0x2500a4[_0x5bf8('0x1e')][_0x5bf8('0x20')]||null:null,'attributes':[[db[_0x5bf8('0x21')]['fn']('COUNT',db[_0x5bf8('0x21')]['fn']('IF',db[_0x5bf8('0x21')][_0x5bf8('0x22')](_0x5bf8('0x23')))),'outboundQueuePauses']]})[_0x5bf8('0x10')](function(_0x2260c5){logger['info'](_0x5bf8('0x1b'),_0x2500a4);logger[_0x5bf8('0x13')](_0x5bf8('0x1b'),_0x2500a4,JSON[_0x5bf8('0x16')](_0x2260c5));_0x130428(_0x2260c5);})['catch'](function(_0x59a90c){logger[_0x5bf8('0x17')]('GetVoiceQueueRtPauses',_0x59a90c['message'],_0x2500a4);_0x351898(_0x32f7c0[_0x5bf8('0x17')](0x1f4,_0x59a90c['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1e7e401..53d2774 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 _0xb138=['update','removeListener','length','./userVoiceQueueRt.events','save','remove'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xb138,0x1dd));var _0x8b13=function(_0x730f5b,_0x44b24f){_0x730f5b=_0x730f5b-0x0;var _0x2e07a5=_0xb138[_0x730f5b];return _0x2e07a5;};'use strict';var UserVoiceQueueRtEvents=require(_0x8b13('0x0'));var events=[_0x8b13('0x1'),_0x8b13('0x2'),_0x8b13('0x3')];function createListener(_0xadad70,_0x185752){return function(_0x20c65c){_0x185752['emit'](_0xadad70,_0x20c65c);};}function removeListener(_0x4411a0,_0x241acb){return function(){UserVoiceQueueRtEvents[_0x8b13('0x4')](_0x4411a0,_0x241acb);};}exports['register']=function(_0xd19a0f){for(var _0x13f7bd=0x0,_0x5d51b1=events[_0x8b13('0x5')];_0x13f7bd<_0x5d51b1;_0x13f7bd++){var _0x33d1a7=events[_0x13f7bd];var _0x22e157=createListener('userVoiceQueueRt:'+_0x33d1a7,_0xd19a0f);UserVoiceQueueRtEvents['on'](_0x33d1a7,_0x22e157);}}; \ No newline at end of file +var _0x5a4f=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','emit','removeListener'];(function(_0x35a9f4,_0x28f704){var _0x11476d=function(_0x5bce98){while(--_0x5bce98){_0x35a9f4['push'](_0x35a9f4['shift']());}};_0x11476d(++_0x28f704);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x5a4f[_0x45d3f0];return _0x314b79;};'use strict';var UserVoiceQueueRtEvents=require(_0xf5a4('0x0'));var events=['save',_0xf5a4('0x1'),'update'];function createListener(_0x22548a,_0x582a25){return function(_0x35d241){_0x582a25[_0xf5a4('0x2')](_0x22548a,_0x35d241);};}function removeListener(_0x28a5e3,_0x2b45a3){return function(){UserVoiceQueueRtEvents[_0xf5a4('0x3')](_0x28a5e3,_0x2b45a3);};}exports[_0xf5a4('0x4')]=function(_0x431162){for(var _0x5d2a8c=0x0,_0x354c7d=events[_0xf5a4('0x5')];_0x5d2a8c<_0x354c7d;_0x5d2a8c++){var _0x3ef3da=events[_0x5d2a8c];var _0x1e7821=createListener(_0xf5a4('0x6')+_0x3ef3da,_0x431162);UserVoiceQueueRtEvents['on'](_0x3ef3da,_0x1e7821);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index eb7c0e2..bcb2a97 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2a89cd,_0x58e05d){var _0x3f9b28=function(_0x1d2899){while(--_0x1d2899){_0x2a89cd['push'](_0x2a89cd['shift']());}};_0x3f9b28(++_0x58e05d);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4bae77,_0x2f3cf7){var _0x3115=function(_0x1337b0){while(--_0x1337b0){_0x4bae77['push'](_0x4bae77['shift']());}};_0x3115(++_0x2f3cf7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 94fab66..294a5b8 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 _0x4bc8=['sequelize'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x4bc8,0xb1));var _0x84bc=function(_0x269698,_0x56edec){_0x269698=_0x269698-0x0;var _0x48cd0a=_0x4bc8[_0x269698];return _0x48cd0a;};'use strict';var Sequelize=require(_0x84bc('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc284=['sequelize','exports','INTEGER'];(function(_0xd1dda8,_0x5956f3){var _0x392060=function(_0x2c13ae){while(--_0x2c13ae){_0xd1dda8['push'](_0xd1dda8['shift']());}};_0x392060(++_0x5956f3);}(_0xc284,0x1d1));var _0x4c28=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0xc284[_0x6acb69];return _0x29a021;};'use strict';var Sequelize=require(_0x4c28('0x0'));module[_0x4c28('0x1')]={'penalty':{'type':Sequelize[_0x4c28('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index d93f884..c96071f 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 _0x9b0f=['user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x9b0f,0x187));var _0xf9b0=function(_0x3f7e8b,_0x7291d1){_0x3f7e8b=_0x3f7e8b-0x0;var _0x4eb892=_0x9b0f[_0x3f7e8b];return _0x4eb892;};'use strict';var _=require(_0xf9b0('0x0'));var util=require(_0xf9b0('0x1'));var logger=require(_0xf9b0('0x2'))(_0xf9b0('0x3'));var moment=require(_0xf9b0('0x4'));var BPromise=require('bluebird');var rp=require(_0xf9b0('0x5'));var fs=require('fs');var path=require(_0xf9b0('0x6'));var rimraf=require(_0xf9b0('0x7'));var config=require(_0xf9b0('0x8'));var attributes=require(_0xf9b0('0x9'));module[_0xf9b0('0xa')]=function(_0x152f95,_0x2c45f7){return _0x152f95['define'](_0xf9b0('0xb'),attributes,{'tableName':_0xf9b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe953=['bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment'];(function(_0x5ebe34,_0x421337){var _0x36a3ee=function(_0x1d3306){while(--_0x1d3306){_0x5ebe34['push'](_0x5ebe34['shift']());}};_0x36a3ee(++_0x421337);}(_0xe953,0xa5));var _0x3e95=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xe953[_0x30bd4d];return _0x306915;};'use strict';var _=require('lodash');var util=require(_0x3e95('0x0'));var logger=require(_0x3e95('0x1'))('api');var moment=require(_0x3e95('0x2'));var BPromise=require(_0x3e95('0x3'));var rp=require(_0x3e95('0x4'));var fs=require('fs');var path=require(_0x3e95('0x5'));var rimraf=require('rimraf');var config=require(_0x3e95('0x6'));var attributes=require(_0x3e95('0x7'));module[_0x3e95('0x8')]=function(_0x36bad5,_0x82dcf3){return _0x36bad5[_0x3e95('0x9')](_0x3e95('0xa'),attributes,{'tableName':_0x3e95('0xb'),'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 9f333fb..b27927c 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 _0xa39f=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x10ff12,_0x4d9db5){var _0x5c4a7d=function(_0x4792c6){while(--_0x4792c6){_0x10ff12['push'](_0x10ff12['shift']());}};_0x5c4a7d(++_0x4d9db5);}(_0xa39f,0x152));var _0xfa39=function(_0x3cfe76,_0x1d9d61){_0x3cfe76=_0x3cfe76-0x0;var _0x1f6f12=_0xa39f[_0x3cfe76];return _0x1f6f12;};'use strict';var _=require(_0xfa39('0x0'));var util=require(_0xfa39('0x1'));var moment=require(_0xfa39('0x2'));var BPromise=require(_0xfa39('0x3'));var rs=require(_0xfa39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa39('0x5'))['db'];var utils=require(_0xfa39('0x6'));var logger=require('../../config/logger')(_0xfa39('0x7'));var config=require(_0xfa39('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e58c,_0x1768a9,_0x3086d7){return new BPromise(function(_0x24532b,_0x199cd7){return client[_0xfa39('0xa')](_0x11e58c,_0x3086d7)[_0xfa39('0xb')](function(_0x5e69bd){logger[_0xfa39('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1768a9,_0xfa39('0xd'));logger['debug'](_0xfa39('0xe'),_0x1768a9,_0xfa39('0xd'),JSON[_0xfa39('0xf')](_0x5e69bd));if(_0x5e69bd[_0xfa39('0x10')]){if(_0x5e69bd[_0xfa39('0x10')][_0xfa39('0x11')]===0x1f4){logger[_0xfa39('0x10')](_0xfa39('0x12'),_0x1768a9,_0x5e69bd['error'][_0xfa39('0x13')]);return _0x199cd7(_0x5e69bd[_0xfa39('0x10')][_0xfa39('0x13')]);}logger['error'](_0xfa39('0x12'),_0x1768a9,_0x5e69bd[_0xfa39('0x10')][_0xfa39('0x13')]);return _0x24532b(_0x5e69bd[_0xfa39('0x10')][_0xfa39('0x13')]);}else{logger[_0xfa39('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1768a9,_0xfa39('0xd'));_0x24532b(_0x5e69bd[_0xfa39('0x14')][_0xfa39('0x13')]);}})['catch'](function(_0x4a47fb){logger['error'](_0xfa39('0x12'),_0x1768a9,_0x4a47fb);_0x199cd7(_0x4a47fb);});});} \ No newline at end of file +var _0xe646=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xe646,0x9d));var _0x6e64=function(_0x2211ff,_0x44cb7b){_0x2211ff=_0x2211ff-0x0;var _0x307e33=_0xe646[_0x2211ff];return _0x307e33;};'use strict';var _=require(_0x6e64('0x0'));var util=require(_0x6e64('0x1'));var moment=require('moment');var BPromise=require(_0x6e64('0x2'));var rs=require(_0x6e64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e64('0x4'));var logger=require(_0x6e64('0x5'))(_0x6e64('0x6'));var config=require(_0x6e64('0x7'));var jayson=require(_0x6e64('0x8'));var client=jayson[_0x6e64('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x518720,_0x1f863a,_0x408bb8){return new BPromise(function(_0x1d4677,_0x10c6c7){return client[_0x6e64('0xa')](_0x518720,_0x408bb8)['then'](function(_0x4888dc){logger[_0x6e64('0xb')](_0x6e64('0xc'),_0x1f863a,_0x6e64('0xd'));logger['debug'](_0x6e64('0xe'),_0x1f863a,_0x6e64('0xd'),JSON[_0x6e64('0xf')](_0x4888dc));if(_0x4888dc[_0x6e64('0x10')]){if(_0x4888dc[_0x6e64('0x10')][_0x6e64('0x11')]===0x1f4){logger[_0x6e64('0x10')](_0x6e64('0xc'),_0x1f863a,_0x4888dc[_0x6e64('0x10')][_0x6e64('0x12')]);return _0x10c6c7(_0x4888dc['error'][_0x6e64('0x12')]);}logger[_0x6e64('0x10')](_0x6e64('0xc'),_0x1f863a,_0x4888dc['error'][_0x6e64('0x12')]);return _0x1d4677(_0x4888dc[_0x6e64('0x10')][_0x6e64('0x12')]);}else{logger[_0x6e64('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1f863a,'request\x20sent');_0x1d4677(_0x4888dc[_0x6e64('0x13')][_0x6e64('0x12')]);}})['catch'](function(_0x515539){logger[_0x6e64('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1f863a,_0x515539);_0x10c6c7(_0x515539);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 81de116..d202f18 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 _0x32ff=['./variable.controller','get','isAuthenticated','show','post','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33d134,_0x37d4e7){var _0x30115e=function(_0xc0560a){while(--_0xc0560a){_0x33d134['push'](_0x33d134['shift']());}};_0x30115e(++_0x37d4e7);}(_0x32ff,0xc7));var _0xf32f=function(_0x29e302,_0x55ecb2){_0x29e302=_0x29e302-0x0;var _0x37bb71=_0x32ff[_0x29e302];return _0x37bb71;};'use strict';var multer=require(_0xf32f('0x0'));var util=require(_0xf32f('0x1'));var path=require(_0xf32f('0x2'));var timeout=require(_0xf32f('0x3'));var express=require(_0xf32f('0x4'));var router=express[_0xf32f('0x5')]();var fs_extra=require(_0xf32f('0x6'));var auth=require(_0xf32f('0x7'));var interaction=require(_0xf32f('0x8'));var config=require(_0xf32f('0x9'));var controller=require(_0xf32f('0xa'));router[_0xf32f('0xb')]('/',auth[_0xf32f('0xc')](),controller['index']);router[_0xf32f('0xb')]('/:id',auth[_0xf32f('0xc')](),controller[_0xf32f('0xd')]);router[_0xf32f('0xe')]('/',auth[_0xf32f('0xc')](),controller[_0xf32f('0xf')]);router[_0xf32f('0x10')](_0xf32f('0x11'),auth[_0xf32f('0xc')](),controller['update']);router['delete'](_0xf32f('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xf32f('0x12')]=router; \ No newline at end of file +var _0x9585=['get','/:id','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated'];(function(_0x455bd5,_0x13d60e){var _0x4001aa=function(_0x30d663){while(--_0x30d663){_0x455bd5['push'](_0x455bd5['shift']());}};_0x4001aa(++_0x13d60e);}(_0x9585,0x15e));var _0x5958=function(_0x304e53,_0x16bf03){_0x304e53=_0x304e53-0x0;var _0x4867ac=_0x9585[_0x304e53];return _0x4867ac;};'use strict';var multer=require('multer');var util=require(_0x5958('0x0'));var path=require('path');var timeout=require(_0x5958('0x1'));var express=require(_0x5958('0x2'));var router=express[_0x5958('0x3')]();var fs_extra=require(_0x5958('0x4'));var auth=require(_0x5958('0x5'));var interaction=require(_0x5958('0x6'));var config=require(_0x5958('0x7'));var controller=require(_0x5958('0x8'));router['get']('/',auth[_0x5958('0x9')](),controller['index']);router[_0x5958('0xa')](_0x5958('0xb'),auth[_0x5958('0x9')](),controller['show']);router[_0x5958('0xc')]('/',auth['isAuthenticated'](),controller[_0x5958('0xd')]);router[_0x5958('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5958('0xf')]);router[_0x5958('0x10')](_0x5958('0xb'),auth[_0x5958('0x9')](),controller[_0x5958('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 84ce1f0..5eef696 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 _0xa366=['sequelize','STRING','name'];(function(_0x1786e0,_0x19dc8c){var _0x4a6229=function(_0x151bdd){while(--_0x151bdd){_0x1786e0['push'](_0x1786e0['shift']());}};_0x4a6229(++_0x19dc8c);}(_0xa366,0x1e0));var _0x6a36=function(_0x3b5538,_0x2cdc1a){_0x3b5538=_0x3b5538-0x0;var _0xe6981b=_0xa366[_0x3b5538];return _0xe6981b;};'use strict';var Sequelize=require(_0x6a36('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a36('0x1')],'unique':_0x6a36('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6a36('0x1')]}}; \ No newline at end of file +var _0xe181=['STRING','name','sequelize'];(function(_0x115ee0,_0x5b6a45){var _0xafcc82=function(_0x5c2bcc){while(--_0x5c2bcc){_0x115ee0['push'](_0x115ee0['shift']());}};_0xafcc82(++_0x5b6a45);}(_0xe181,0x68));var _0x1e18=function(_0xe8b9c7,_0x534838){_0xe8b9c7=_0xe8b9c7-0x0;var _0x4b606f=_0xe181[_0xe8b9c7];return _0x4b606f;};'use strict';var Sequelize=require(_0x1e18('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e18('0x1')],'unique':_0x1e18('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1e18('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7b8bb6b..e9cc31b 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 _0x8e1b=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','get','Variables','error','name','send','Variable','rawAttributes','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43f7ed,_0x527b08){var _0x24c9de=function(_0x4c215f){while(--_0x4c215f){_0x43f7ed['push'](_0x43f7ed['shift']());}};_0x24c9de(++_0x527b08);}(_0x8e1b,0x90));var _0xb8e1=function(_0x4bdd13,_0x645ddb){_0x4bdd13=_0x4bdd13-0x0;var _0x3ca85e=_0x8e1b[_0x4bdd13];return _0x3ca85e;};'use strict';var emlformat=require(_0xb8e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8e1('0x1'));var jsonpatch=require(_0xb8e1('0x2'));var rp=require('request-promise');var moment=require(_0xb8e1('0x3'));var BPromise=require(_0xb8e1('0x4'));var Mustache=require('mustache');var util=require(_0xb8e1('0x5'));var path=require(_0xb8e1('0x6'));var sox=require('sox');var csv=require(_0xb8e1('0x7'));var ejs=require(_0xb8e1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8e1('0x9'));var squel=require(_0xb8e1('0xa'));var crypto=require(_0xb8e1('0xb'));var jsforce=require(_0xb8e1('0xc'));var deskjs=require(_0xb8e1('0xd'));var toCsv=require(_0xb8e1('0x7'));var querystring=require(_0xb8e1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb8e1('0xf'));var qs=require(_0xb8e1('0x10'));var as=require(_0xb8e1('0x11'));var hardwareService=require(_0xb8e1('0x12'));var logger=require(_0xb8e1('0x13'))(_0xb8e1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb8e1('0x15'));var db=require(_0xb8e1('0x16'))['db'];function respondWithStatusCode(_0x400e5e,_0x325c43){_0x325c43=_0x325c43||0xcc;return function(_0x196633){if(_0x196633){return _0x400e5e[_0xb8e1('0x17')](_0x325c43);}return _0x400e5e[_0xb8e1('0x18')](_0x325c43)[_0xb8e1('0x19')]();};}function respondWithResult(_0x3ee0de,_0xcc72ce){_0xcc72ce=_0xcc72ce||0xc8;return function(_0x250396){if(_0x250396){return _0x3ee0de['status'](_0xcc72ce)[_0xb8e1('0x1a')](_0x250396);}};}function respondWithFilteredResult(_0x3e2bb5,_0xd7376f){return function(_0x1a01d8){if(_0x1a01d8){var _0x4a8854=typeof _0xd7376f['offset']===_0xb8e1('0x1b')&&typeof _0xd7376f[_0xb8e1('0x1c')]===_0xb8e1('0x1b');var _0x3f7a8d=_0x1a01d8['count'];var _0x168d5f=_0x4a8854?0x0:_0xd7376f[_0xb8e1('0x1d')];var _0x481aa7=_0x4a8854?_0x1a01d8[_0xb8e1('0x1e')]:_0xd7376f[_0xb8e1('0x1d')]+_0xd7376f[_0xb8e1('0x1c')];var _0x1ff7eb;if(_0x481aa7>=_0x3f7a8d){_0x481aa7=_0x3f7a8d;_0x1ff7eb=0xc8;}else{_0x1ff7eb=0xce;}_0x3e2bb5[_0xb8e1('0x18')](_0x1ff7eb);return _0x3e2bb5[_0xb8e1('0x1f')](_0xb8e1('0x20'),_0x168d5f+'-'+_0x481aa7+'/'+_0x3f7a8d)['json'](_0x1a01d8);}return null;};}function patchUpdates(_0x1a0222){return function(_0xa8f25){try{jsonpatch[_0xb8e1('0x21')](_0xa8f25,_0x1a0222,!![]);}catch(_0x535a9e){return BPromise['reject'](_0x535a9e);}return _0xa8f25[_0xb8e1('0x22')]();};}function saveUpdates(_0x578b58,_0x1f30d4){return function(_0x573046){if(_0x573046){return _0x573046['update'](_0x578b58)[_0xb8e1('0x23')](function(_0x1e67ba){return _0x1e67ba;});}return null;};}function removeEntity(_0x53067e,_0x242ae5){return function(_0x401ee6){if(_0x401ee6){return _0x401ee6[_0xb8e1('0x24')]()[_0xb8e1('0x23')](function(){var _0x4054c8=_0x401ee6[_0xb8e1('0x25')]({'plain':!![]});var _0x5ac997=_0xb8e1('0x26');return db['UserProfileResource'][_0xb8e1('0x24')]({'where':{'type':_0x5ac997,'resourceId':_0x4054c8['id']}})[_0xb8e1('0x23')](function(){return _0x401ee6;});})[_0xb8e1('0x23')](function(){_0x53067e[_0xb8e1('0x18')](0xcc)[_0xb8e1('0x19')]();});}};}function handleEntityNotFound(_0x3062ca,_0x24cee2){return function(_0x491241){if(!_0x491241){_0x3062ca[_0xb8e1('0x17')](0x194);}return _0x491241;};}function handleError(_0x6578f8,_0x2d0b33){_0x2d0b33=_0x2d0b33||0x1f4;return function(_0x414aec){logger[_0xb8e1('0x27')](_0x414aec['stack']);if(_0x414aec[_0xb8e1('0x28')]){delete _0x414aec['name'];}_0x6578f8[_0xb8e1('0x18')](_0x2d0b33)[_0xb8e1('0x29')](_0x414aec);};}exports['index']=function(_0x53c85d,_0x31175c){var _0x9b7374={},_0x15168d={},_0x14ccf1={'count':0x0,'rows':[]};var _0x18c03c=_['map'](db[_0xb8e1('0x2a')][_0xb8e1('0x2b')],function(_0x377f24){return{'name':_0x377f24['fieldName'],'type':_0x377f24['type'][_0xb8e1('0x2c')]};});_0x15168d['model']=_[_0xb8e1('0x2d')](_0x18c03c,_0xb8e1('0x28'));_0x15168d[_0xb8e1('0x2e')]=_[_0xb8e1('0x2f')](_0x53c85d['query']);_0x15168d['filters']=_[_0xb8e1('0x30')](_0x15168d[_0xb8e1('0x31')],_0x15168d['query']);_0x9b7374[_0xb8e1('0x32')]=_[_0xb8e1('0x30')](_0x15168d[_0xb8e1('0x31')],qs[_0xb8e1('0x33')](_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x33')]));_0x9b7374[_0xb8e1('0x32')]=_0x9b7374[_0xb8e1('0x32')][_0xb8e1('0x34')]?_0x9b7374[_0xb8e1('0x32')]:_0x15168d[_0xb8e1('0x31')];if(!_0x53c85d['query'][_0xb8e1('0x35')](_0xb8e1('0x36'))){_0x9b7374[_0xb8e1('0x1c')]=qs[_0xb8e1('0x1c')](_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x1c')]);_0x9b7374['offset']=qs[_0xb8e1('0x1d')](_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x1d')]);}_0x9b7374[_0xb8e1('0x37')]=qs[_0xb8e1('0x38')](_0x53c85d[_0xb8e1('0x2e')]['sort']);_0x9b7374[_0xb8e1('0x39')]=qs[_0xb8e1('0x3a')](_[_0xb8e1('0x3b')](_0x53c85d['query'],_0x15168d[_0xb8e1('0x3a')]),_0x18c03c);if(_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x3c')]){_0x9b7374[_0xb8e1('0x39')]=_[_0xb8e1('0x3d')](_0x9b7374['where'],{'$or':_['map'](_0x18c03c,function(_0x4b617d){if(_0x4b617d[_0xb8e1('0x3e')]!==_0xb8e1('0x3f')){var _0x5ba653={};_0x5ba653[_0x4b617d['name']]={'$like':'%'+_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x3c')]+'%'};return _0x5ba653;}})});}_0x9b7374=_[_0xb8e1('0x3d')]({},_0x9b7374,_0x53c85d[_0xb8e1('0x40')]);var _0x59c761={'where':_0x9b7374[_0xb8e1('0x39')]};return db['Variable'][_0xb8e1('0x1e')](_0x59c761)[_0xb8e1('0x23')](function(_0x117f78){_0x14ccf1['count']=_0x117f78;if(_0x53c85d[_0xb8e1('0x2e')][_0xb8e1('0x41')]){_0x9b7374[_0xb8e1('0x42')]=[{'all':!![]}];}return db[_0xb8e1('0x2a')]['findAll'](_0x9b7374);})[_0xb8e1('0x23')](function(_0x31b3a9){_0x14ccf1[_0xb8e1('0x43')]=_0x31b3a9;return _0x14ccf1;})['then'](respondWithFilteredResult(_0x31175c,_0x9b7374))[_0xb8e1('0x44')](handleError(_0x31175c,null));};exports['show']=function(_0x3ac593,_0x5bc71e){var _0x29f70c={'raw':!![],'where':{'id':_0x3ac593['params']['id']}},_0x22094c={};_0x22094c['model']=_[_0xb8e1('0x2f')](db[_0xb8e1('0x2a')]['rawAttributes']);_0x22094c[_0xb8e1('0x2e')]=_[_0xb8e1('0x2f')](_0x3ac593[_0xb8e1('0x2e')]);_0x22094c[_0xb8e1('0x3a')]=_[_0xb8e1('0x30')](_0x22094c['model'],_0x22094c['query']);_0x29f70c['attributes']=_[_0xb8e1('0x30')](_0x22094c[_0xb8e1('0x31')],qs[_0xb8e1('0x33')](_0x3ac593['query'][_0xb8e1('0x33')]));_0x29f70c[_0xb8e1('0x32')]=_0x29f70c[_0xb8e1('0x32')][_0xb8e1('0x34')]?_0x29f70c[_0xb8e1('0x32')]:_0x22094c[_0xb8e1('0x31')];if(_0x3ac593[_0xb8e1('0x2e')]['includeAll']){_0x29f70c[_0xb8e1('0x42')]=[{'all':!![]}];}_0x29f70c=_[_0xb8e1('0x3d')]({},_0x29f70c,_0x3ac593['options']);return db['Variable'][_0xb8e1('0x45')](_0x29f70c)[_0xb8e1('0x23')](handleEntityNotFound(_0x5bc71e,null))[_0xb8e1('0x23')](respondWithResult(_0x5bc71e,null))['catch'](handleError(_0x5bc71e,null));};exports[_0xb8e1('0x46')]=function(_0x3c7322,_0xa1468c){return db[_0xb8e1('0x2a')]['create'](_0x3c7322['body'],{})['then'](function(_0x5f32e8){var _0x47df76=_0x3c7322[_0xb8e1('0x47')][_0xb8e1('0x25')]({'plain':!![]});if(!_0x47df76)throw new Error(_0xb8e1('0x48'));if(_0x47df76[_0xb8e1('0x49')]==='user'){var _0x1b9165=_0x5f32e8[_0xb8e1('0x25')]({'plain':!![]});var _0x219408=_0xb8e1('0x26');return db[_0xb8e1('0x4a')][_0xb8e1('0x45')]({'where':{'name':_0x219408,'userProfileId':_0x47df76[_0xb8e1('0x4b')]},'raw':!![]})[_0xb8e1('0x23')](function(_0x457644){if(_0x457644&&_0x457644['autoAssociation']===0x0){return db['UserProfileResource'][_0xb8e1('0x46')]({'name':_0x1b9165[_0xb8e1('0x28')],'resourceId':_0x1b9165['id'],'type':_0x457644[_0xb8e1('0x28')],'sectionId':_0x457644['id']},{})[_0xb8e1('0x23')](function(){return _0x5f32e8;});}else{return _0x5f32e8;}})[_0xb8e1('0x44')](function(_0x154ac5){logger[_0xb8e1('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x154ac5);throw _0x154ac5;});}return _0x5f32e8;})[_0xb8e1('0x23')](respondWithResult(_0xa1468c,0xc9))[_0xb8e1('0x44')](handleError(_0xa1468c,null));};exports[_0xb8e1('0x4c')]=function(_0x268c57,_0x4d0236){if(_0x268c57[_0xb8e1('0x4d')]['id']){delete _0x268c57[_0xb8e1('0x4d')]['id'];}return db[_0xb8e1('0x2a')][_0xb8e1('0x45')]({'where':{'id':_0x268c57[_0xb8e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d0236,null))[_0xb8e1('0x23')](saveUpdates(_0x268c57[_0xb8e1('0x4d')],null))[_0xb8e1('0x23')](respondWithResult(_0x4d0236,null))[_0xb8e1('0x44')](handleError(_0x4d0236,null));};exports[_0xb8e1('0x24')]=function(_0x5aaa63,_0x330801){return db['Variable'][_0xb8e1('0x45')]({'where':{'id':_0x5aaa63[_0xb8e1('0x4e')]['id']}})[_0xb8e1('0x23')](handleEntityNotFound(_0x330801,null))[_0xb8e1('0x23')](removeEntity(_0x330801,null))[_0xb8e1('0x44')](handleError(_0x330801,null));}; \ No newline at end of file +var _0x3ab3=['show','params','keys','create','body','user','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Variables','destroy','end','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x5d967b,_0x32b32b){var _0x319e03=function(_0x2d014e){while(--_0x2d014e){_0x5d967b['push'](_0x5d967b['shift']());}};_0x319e03(++_0x32b32b);}(_0x3ab3,0x156));var _0x33ab=function(_0x4a6b92,_0x53929c){_0x4a6b92=_0x4a6b92-0x0;var _0x303f17=_0x3ab3[_0x4a6b92];return _0x303f17;};'use strict';var emlformat=require(_0x33ab('0x0'));var rimraf=require(_0x33ab('0x1'));var zipdir=require(_0x33ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33ab('0x3'));var moment=require('moment');var BPromise=require(_0x33ab('0x4'));var Mustache=require(_0x33ab('0x5'));var util=require('util');var path=require(_0x33ab('0x6'));var sox=require(_0x33ab('0x7'));var csv=require(_0x33ab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33ab('0x9'));var squel=require(_0x33ab('0xa'));var crypto=require(_0x33ab('0xb'));var jsforce=require(_0x33ab('0xc'));var deskjs=require(_0x33ab('0xd'));var toCsv=require(_0x33ab('0x8'));var querystring=require(_0x33ab('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x33ab('0xf'));var qs=require(_0x33ab('0x10'));var as=require(_0x33ab('0x11'));var hardwareService=require(_0x33ab('0x12'));var logger=require(_0x33ab('0x13'))(_0x33ab('0x14'));var utils=require(_0x33ab('0x15'));var config=require(_0x33ab('0x16'));var licenseUtil=require(_0x33ab('0x17'));var db=require(_0x33ab('0x18'))['db'];function respondWithStatusCode(_0x27efe3,_0x40d75f){_0x40d75f=_0x40d75f||0xcc;return function(_0x1c63d3){if(_0x1c63d3){return _0x27efe3[_0x33ab('0x19')](_0x40d75f);}return _0x27efe3[_0x33ab('0x1a')](_0x40d75f)['end']();};}function respondWithResult(_0xfd2073,_0x4527d1){_0x4527d1=_0x4527d1||0xc8;return function(_0x1b362b){if(_0x1b362b){return _0xfd2073[_0x33ab('0x1a')](_0x4527d1)[_0x33ab('0x1b')](_0x1b362b);}};}function respondWithFilteredResult(_0x12e309,_0x496323){return function(_0x2a3555){if(_0x2a3555){var _0x5defd9=typeof _0x496323[_0x33ab('0x1c')]===_0x33ab('0x1d')&&typeof _0x496323[_0x33ab('0x1e')]==='undefined';var _0x5a5adf=_0x2a3555[_0x33ab('0x1f')];var _0xb126d6=_0x5defd9?0x0:_0x496323[_0x33ab('0x1c')];var _0x5d3e43=_0x5defd9?_0x2a3555[_0x33ab('0x1f')]:_0x496323[_0x33ab('0x1c')]+_0x496323[_0x33ab('0x1e')];var _0x5915fa;if(_0x5d3e43>=_0x5a5adf){_0x5d3e43=_0x5a5adf;_0x5915fa=0xc8;}else{_0x5915fa=0xce;}_0x12e309[_0x33ab('0x1a')](_0x5915fa);return _0x12e309[_0x33ab('0x20')](_0x33ab('0x21'),_0xb126d6+'-'+_0x5d3e43+'/'+_0x5a5adf)[_0x33ab('0x1b')](_0x2a3555);}return null;};}function patchUpdates(_0x83ff7e){return function(_0x10e59f){try{jsonpatch['apply'](_0x10e59f,_0x83ff7e,!![]);}catch(_0x36ccee){return BPromise[_0x33ab('0x22')](_0x36ccee);}return _0x10e59f[_0x33ab('0x23')]();};}function saveUpdates(_0x3705c9,_0x6af47f){return function(_0x586c04){if(_0x586c04){return _0x586c04[_0x33ab('0x24')](_0x3705c9)[_0x33ab('0x25')](function(_0x3b6662){return _0x3b6662;});}return null;};}function removeEntity(_0x44558f,_0xa7cf4c){return function(_0x24a504){if(_0x24a504){return _0x24a504['destroy']()['then'](function(){var _0x3e93e4=_0x24a504[_0x33ab('0x26')]({'plain':!![]});var _0x3a0690=_0x33ab('0x27');return db['UserProfileResource'][_0x33ab('0x28')]({'where':{'type':_0x3a0690,'resourceId':_0x3e93e4['id']}})['then'](function(){return _0x24a504;});})[_0x33ab('0x25')](function(){_0x44558f[_0x33ab('0x1a')](0xcc)[_0x33ab('0x29')]();});}};}function handleEntityNotFound(_0x398fb9,_0x94fdfe){return function(_0x238b63){if(!_0x238b63){_0x398fb9['sendStatus'](0x194);}return _0x238b63;};}function handleError(_0x2c07c6,_0x474ac6){_0x474ac6=_0x474ac6||0x1f4;return function(_0x2b3b97){logger[_0x33ab('0x2a')](_0x2b3b97[_0x33ab('0x2b')]);if(_0x2b3b97['name']){delete _0x2b3b97[_0x33ab('0x2c')];}_0x2c07c6['status'](_0x474ac6)[_0x33ab('0x2d')](_0x2b3b97);};}exports[_0x33ab('0x2e')]=function(_0x103d29,_0x34ed28){var _0x2ba944={},_0x5a8a9f={},_0x5655e9={'count':0x0,'rows':[]};var _0x24cadb=_[_0x33ab('0x2f')](db[_0x33ab('0x30')][_0x33ab('0x31')],function(_0x51adcd){return{'name':_0x51adcd[_0x33ab('0x32')],'type':_0x51adcd[_0x33ab('0x33')][_0x33ab('0x34')]};});_0x5a8a9f[_0x33ab('0x35')]=_['map'](_0x24cadb,_0x33ab('0x2c'));_0x5a8a9f['query']=_['keys'](_0x103d29[_0x33ab('0x36')]);_0x5a8a9f[_0x33ab('0x37')]=_[_0x33ab('0x38')](_0x5a8a9f['model'],_0x5a8a9f[_0x33ab('0x36')]);_0x2ba944[_0x33ab('0x39')]=_[_0x33ab('0x38')](_0x5a8a9f[_0x33ab('0x35')],qs[_0x33ab('0x3a')](_0x103d29[_0x33ab('0x36')][_0x33ab('0x3a')]));_0x2ba944[_0x33ab('0x39')]=_0x2ba944[_0x33ab('0x39')][_0x33ab('0x3b')]?_0x2ba944[_0x33ab('0x39')]:_0x5a8a9f[_0x33ab('0x35')];if(!_0x103d29[_0x33ab('0x36')]['hasOwnProperty'](_0x33ab('0x3c'))){_0x2ba944['limit']=qs['limit'](_0x103d29[_0x33ab('0x36')][_0x33ab('0x1e')]);_0x2ba944[_0x33ab('0x1c')]=qs['offset'](_0x103d29[_0x33ab('0x36')][_0x33ab('0x1c')]);}_0x2ba944[_0x33ab('0x3d')]=qs[_0x33ab('0x3e')](_0x103d29['query'][_0x33ab('0x3e')]);_0x2ba944[_0x33ab('0x3f')]=qs[_0x33ab('0x37')](_[_0x33ab('0x40')](_0x103d29['query'],_0x5a8a9f[_0x33ab('0x37')]),_0x24cadb);if(_0x103d29[_0x33ab('0x36')][_0x33ab('0x41')]){_0x2ba944['where']=_[_0x33ab('0x42')](_0x2ba944[_0x33ab('0x3f')],{'$or':_[_0x33ab('0x2f')](_0x24cadb,function(_0x375d99){if(_0x375d99[_0x33ab('0x33')]!==_0x33ab('0x43')){var _0x442c4c={};_0x442c4c[_0x375d99[_0x33ab('0x2c')]]={'$like':'%'+_0x103d29[_0x33ab('0x36')][_0x33ab('0x41')]+'%'};return _0x442c4c;}})});}_0x2ba944=_[_0x33ab('0x42')]({},_0x2ba944,_0x103d29[_0x33ab('0x44')]);var _0x43251c={'where':_0x2ba944[_0x33ab('0x3f')]};return db[_0x33ab('0x30')][_0x33ab('0x1f')](_0x43251c)[_0x33ab('0x25')](function(_0x4d8fd8){_0x5655e9[_0x33ab('0x1f')]=_0x4d8fd8;if(_0x103d29[_0x33ab('0x36')][_0x33ab('0x45')]){_0x2ba944[_0x33ab('0x46')]=[{'all':!![]}];}return db[_0x33ab('0x30')][_0x33ab('0x47')](_0x2ba944);})[_0x33ab('0x25')](function(_0x4977fb){_0x5655e9['rows']=_0x4977fb;return _0x5655e9;})[_0x33ab('0x25')](respondWithFilteredResult(_0x34ed28,_0x2ba944))[_0x33ab('0x48')](handleError(_0x34ed28,null));};exports[_0x33ab('0x49')]=function(_0x498175,_0x1a6d9a){var _0x1db78c={'raw':!![],'where':{'id':_0x498175[_0x33ab('0x4a')]['id']}},_0x887c5f={};_0x887c5f[_0x33ab('0x35')]=_[_0x33ab('0x4b')](db[_0x33ab('0x30')][_0x33ab('0x31')]);_0x887c5f['query']=_[_0x33ab('0x4b')](_0x498175[_0x33ab('0x36')]);_0x887c5f[_0x33ab('0x37')]=_[_0x33ab('0x38')](_0x887c5f[_0x33ab('0x35')],_0x887c5f[_0x33ab('0x36')]);_0x1db78c[_0x33ab('0x39')]=_[_0x33ab('0x38')](_0x887c5f[_0x33ab('0x35')],qs[_0x33ab('0x3a')](_0x498175[_0x33ab('0x36')][_0x33ab('0x3a')]));_0x1db78c[_0x33ab('0x39')]=_0x1db78c['attributes'][_0x33ab('0x3b')]?_0x1db78c[_0x33ab('0x39')]:_0x887c5f[_0x33ab('0x35')];if(_0x498175[_0x33ab('0x36')][_0x33ab('0x45')]){_0x1db78c[_0x33ab('0x46')]=[{'all':!![]}];}_0x1db78c=_[_0x33ab('0x42')]({},_0x1db78c,_0x498175[_0x33ab('0x44')]);return db[_0x33ab('0x30')]['find'](_0x1db78c)[_0x33ab('0x25')](handleEntityNotFound(_0x1a6d9a,null))[_0x33ab('0x25')](respondWithResult(_0x1a6d9a,null))[_0x33ab('0x48')](handleError(_0x1a6d9a,null));};exports[_0x33ab('0x4c')]=function(_0x3a1aac,_0x3e163f){return db[_0x33ab('0x30')][_0x33ab('0x4c')](_0x3a1aac[_0x33ab('0x4d')],{})['then'](function(_0x19202b){var _0xe39dcb=_0x3a1aac[_0x33ab('0x4e')]['get']({'plain':!![]});if(!_0xe39dcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe39dcb['role']===_0x33ab('0x4e')){var _0x12b880=_0x19202b['get']({'plain':!![]});var _0x73bac1=_0x33ab('0x27');return db[_0x33ab('0x4f')][_0x33ab('0x50')]({'where':{'name':_0x73bac1,'userProfileId':_0xe39dcb['userProfileId']},'raw':!![]})[_0x33ab('0x25')](function(_0x512208){if(_0x512208&&_0x512208['autoAssociation']===0x0){return db[_0x33ab('0x51')][_0x33ab('0x4c')]({'name':_0x12b880['name'],'resourceId':_0x12b880['id'],'type':_0x512208[_0x33ab('0x2c')],'sectionId':_0x512208['id']},{})[_0x33ab('0x25')](function(){return _0x19202b;});}else{return _0x19202b;}})['catch'](function(_0x183b07){logger['error'](_0x33ab('0x52'),_0x183b07);throw _0x183b07;});}return _0x19202b;})[_0x33ab('0x25')](respondWithResult(_0x3e163f,0xc9))[_0x33ab('0x48')](handleError(_0x3e163f,null));};exports[_0x33ab('0x24')]=function(_0x2e7ede,_0x511620){if(_0x2e7ede[_0x33ab('0x4d')]['id']){delete _0x2e7ede[_0x33ab('0x4d')]['id'];}return db[_0x33ab('0x30')][_0x33ab('0x50')]({'where':{'id':_0x2e7ede[_0x33ab('0x4a')]['id']}})['then'](handleEntityNotFound(_0x511620,null))['then'](saveUpdates(_0x2e7ede['body'],null))[_0x33ab('0x25')](respondWithResult(_0x511620,null))[_0x33ab('0x48')](handleError(_0x511620,null));};exports[_0x33ab('0x28')]=function(_0x299873,_0x43a571){return db[_0x33ab('0x30')]['find']({'where':{'id':_0x299873['params']['id']}})['then'](handleEntityNotFound(_0x43a571,null))[_0x33ab('0x25')](removeEntity(_0x43a571,null))[_0x33ab('0x48')](handleError(_0x43a571,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c2b8737..bd3317f 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 _0x9be8=['exports','Variable','lodash','../../config/logger','moment','request-promise','path','rimraf','./variable.attributes'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x9be8,0x16a));var _0x89be=function(_0x111692,_0x19f8a9){_0x111692=_0x111692-0x0;var _0x11836f=_0x9be8[_0x111692];return _0x11836f;};'use strict';var _=require(_0x89be('0x0'));var util=require('util');var logger=require(_0x89be('0x1'))('api');var moment=require(_0x89be('0x2'));var BPromise=require('bluebird');var rp=require(_0x89be('0x3'));var fs=require('fs');var path=require(_0x89be('0x4'));var rimraf=require(_0x89be('0x5'));var config=require('../../config/environment');var attributes=require(_0x89be('0x6'));module[_0x89be('0x7')]=function(_0x10b979,_0x45669f){return _0x10b979['define'](_0x89be('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cb2=['exports','define','Variable','tools_variables','lodash','util','api','moment','bluebird','request-promise','path','./variable.attributes'];(function(_0x1d72e2,_0x10ccd8){var _0xcdcbb2=function(_0x2ddfc9){while(--_0x2ddfc9){_0x1d72e2['push'](_0x1d72e2['shift']());}};_0xcdcbb2(++_0x10ccd8);}(_0x6cb2,0xd0));var _0x26cb=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x6cb2[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x26cb('0x0'));var util=require(_0x26cb('0x1'));var logger=require('../../config/logger')(_0x26cb('0x2'));var moment=require(_0x26cb('0x3'));var BPromise=require(_0x26cb('0x4'));var rp=require(_0x26cb('0x5'));var fs=require('fs');var path=require(_0x26cb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26cb('0x7'));module[_0x26cb('0x8')]=function(_0x3ff4de,_0x19affd){return _0x3ff4de[_0x26cb('0x9')](_0x26cb('0xa'),attributes,{'tableName':_0x26cb('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 8630eaa..cbbe682 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 _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(_0x5a6e7b,_0x3dabdc){var _0x5bef75=function(_0x2fa93b){while(--_0x2fa93b){_0x5a6e7b['push'](_0x5a6e7b['shift']());}};_0x5bef75(++_0x3dabdc);}(_0x55ca,0x126));var _0xa55c=function(_0x3a3a6a,_0x5eb6a9){_0x3a3a6a=_0x3a3a6a-0x0;var _0xa89294=_0x55ca[_0x3a3a6a];return _0xa89294;};'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 +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x3c1736,_0xd18482){var _0x42bee2=function(_0x31eb22){while(--_0x31eb22){_0x3c1736['push'](_0x3c1736['shift']());}};_0x42bee2(++_0xd18482);}(_0x814b,0x1a2));var _0xb814=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x814b[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f937f4e..5b96a56 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 _0x7639=['exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','restart','/migrations','migrations'];(function(_0x311ae7,_0x14a755){var _0x409b7d=function(_0x4b45c6){while(--_0x4b45c6){_0x311ae7['push'](_0x311ae7['shift']());}};_0x409b7d(++_0x14a755);}(_0x7639,0x89));var _0x9763=function(_0x3364cc,_0x3ab3fe){_0x3364cc=_0x3364cc-0x0;var _0x59053c=_0x7639[_0x3364cc];return _0x59053c;};'use strict';var express=require('express');var router=express[_0x9763('0x0')]();var auth=require(_0x9763('0x1'));var controller=require(_0x9763('0x2'));router[_0x9763('0x3')]('/',controller[_0x9763('0x4')]);router['get'](_0x9763('0x5'),auth[_0x9763('0x6')](),auth['canUpdate'](),controller[_0x9763('0x7')]);router[_0x9763('0x3')](_0x9763('0x8'),auth[_0x9763('0x6')](),auth[_0x9763('0x9')](),controller[_0x9763('0xa')]);router[_0x9763('0x3')](_0x9763('0xb'),auth[_0x9763('0x6')](),auth[_0x9763('0x9')](),controller[_0x9763('0xc')]);router[_0x9763('0x3')]('/restart',auth[_0x9763('0x6')](),controller[_0x9763('0xd')]);router[_0x9763('0x3')](_0x9763('0xe'),controller[_0x9763('0xf')]);module[_0x9763('0x10')]=router; \ No newline at end of file +var _0x5057=['isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x30d0ad,_0x5e091a){var _0x4dd2b8=function(_0x363c64){while(--_0x363c64){_0x30d0ad['push'](_0x30d0ad['shift']());}};_0x4dd2b8(++_0x5e091a);}(_0x5057,0x185));var _0x7505=function(_0xf2d998,_0x3f10c4){_0xf2d998=_0xf2d998-0x0;var _0x5dd2eb=_0x5057[_0xf2d998];return _0x5dd2eb;};'use strict';var express=require(_0x7505('0x0'));var router=express[_0x7505('0x1')]();var auth=require(_0x7505('0x2'));var controller=require(_0x7505('0x3'));router[_0x7505('0x4')]('/',controller[_0x7505('0x5')]);router[_0x7505('0x4')](_0x7505('0x6'),auth[_0x7505('0x7')](),auth[_0x7505('0x8')](),controller['fetch']);router[_0x7505('0x4')](_0x7505('0x9'),auth[_0x7505('0x7')](),auth[_0x7505('0x8')](),controller[_0x7505('0xa')]);router['get'](_0x7505('0xb'),auth['isAuthenticated'](),auth[_0x7505('0x8')](),controller[_0x7505('0xc')]);router[_0x7505('0x4')](_0x7505('0xd'),auth['isAuthenticated'](),controller[_0x7505('0xe')]);router[_0x7505('0x4')](_0x7505('0xf'),controller[_0x7505('0x10')]);module[_0x7505('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a28a981..412b1e8 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 _0x1f80=['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.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','version','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','migrations','join','server','replace','.js'];(function(_0x102789,_0x24217f){var _0x4aeb4f=function(_0x48bbcb){while(--_0x48bbcb){_0x102789['push'](_0x102789['shift']());}};_0x4aeb4f(++_0x24217f);}(_0x1f80,0x1e1));var _0x01f8=function(_0x37d4f2,_0x160d5b){_0x37d4f2=_0x37d4f2-0x0;var _0x572e89=_0x1f80[_0x37d4f2];return _0x572e89;};'use strict';var Umzug=require('umzug');var path=require(_0x01f8('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x01f8('0x1'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x01f8('0x2'))[_0x01f8('0x3')];var db=require(_0x01f8('0x4'))['db'];var config=require('../../config/environment');var pm2=require(_0x01f8('0x5'));var logger=require(_0x01f8('0x6'))(_0x01f8('0x7'));var git=require(_0x01f8('0x8'))(config[_0x01f8('0x9')]);exports[_0x01f8('0xa')]=function(_0x5c5e86,_0x1def14){var _0x35f355={'current':module[_0x01f8('0xb')]['version'],'phonebar':0x2};if(_0x5c5e86['query']&&_0x5c5e86[_0x01f8('0xc')][_0x01f8('0xd')]){return git[_0x01f8('0xe')]()['tags'](function(_0x1fdbd7,_0x447a38){_0x35f355[_0x01f8('0xd')]=(_0x1fdbd7?module[_0x01f8('0xb')][_0x01f8('0xf')]:_0x447a38[_0x01f8('0xd')])||'2.0.0';return _0x1def14[_0x01f8('0x10')](0xc8)['json'](_0x35f355);});}else{return _0x1def14[_0x01f8('0x10')](0xc8)[_0x01f8('0x11')](_0x35f355);}};exports[_0x01f8('0xe')]=function(_0x1eccf8,_0x171f73){return git['fetch'](['origin',_0x01f8('0x12')],function(_0x5a0d1d){if(_0x5a0d1d){logger[_0x01f8('0x13')](_0x5a0d1d);return _0x171f73[_0x01f8('0x10')](0x1f4)[_0x01f8('0x11')](_0x5a0d1d);}logger[_0x01f8('0x14')](_0x01f8('0x15'));return _0x171f73[_0x01f8('0x10')](0xc8)[_0x01f8('0x11')]({'output':_0x01f8('0x16')});});};exports[_0x01f8('0x17')]=function(_0xedf545,_0x33d8eb){return git['reset']([_0x01f8('0x18'),_0x01f8('0x19')],function(_0x59a775){if(_0x59a775){logger[_0x01f8('0x13')](_0x59a775);return _0x33d8eb['status'](0x1f4)[_0x01f8('0x11')](_0x59a775);}logger[_0x01f8('0x14')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x33d8eb[_0x01f8('0x10')](0xc8)['json']({'output':_0x01f8('0x1a')});});};exports[_0x01f8('0x1b')]=function(_0x3f1aa9,_0x47000d){exec(_0x01f8('0x1c'),function(_0x117a6d,_0x67877c,_0x4e98b6){logger[_0x01f8('0x14')](_0x67877c);logger['info'](_0x4e98b6);if(_0x117a6d){logger[_0x01f8('0x13')](_0x117a6d);return _0x47000d[_0x01f8('0x10')](0x1f4)[_0x01f8('0x11')](_0x117a6d);}return _0x47000d['status'](0xc8)['json']({'output':_0x67877c});});};exports[_0x01f8('0x1d')]=function(_0x2f130b,_0x33b2e0){return pm2[_0x01f8('0x1d')]('motion2')[_0x01f8('0x1e')](function(_0x1f850f){logger[_0x01f8('0x14')]('pm2\x20restart\x20motion\x20%s',_0x1f850f);return _0x33b2e0['status'](0xc8)[_0x01f8('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x53ca06){logger['error'](_0x53ca06);return _0x33b2e0[_0x01f8('0x10')](0x1f4)[_0x01f8('0x11')](_0x53ca06);});};exports[_0x01f8('0x1f')]=function(_0xbde4db,_0x2a090e){var _0x167064=fs['readdirSync'](path[_0x01f8('0x20')](config[_0x01f8('0x9')],_0x01f8('0x21'),_0x01f8('0x1f')));var _0x571ec3=[];for(var _0x51fe61=0x0;_0x51fe61<_0x167064['length'];_0x51fe61++){var _0x4fdc63=_0x167064[_0x51fe61][_0x01f8('0x22')](_0x01f8('0x23'),'');if(compareVersions(module['exports'][_0x01f8('0xf')],_0x4fdc63)===-0x1){_0x571ec3['push'](_0x4fdc63);}}if(_0x571ec3['length']){var _0x15c5b7=_0x571ec3[_0x01f8('0x24')](compareVersions);var _0x20ed74=new Umzug({'storage':_0x01f8('0x25'),'storageOptions':{'model':db[_0x01f8('0x26')],'modelName':_0x01f8('0x26'),'columnName':_0x01f8('0xf')},'migrations':{'params':[db[_0x01f8('0x25')][_0x01f8('0x27')](),db['sequelize'][_0x01f8('0x28')],function(){throw new Error(_0x01f8('0x29'));}],'path':path[_0x01f8('0x20')](config['root'],'server',_0x01f8('0x1f')),'pattern':/\.js$/}});_0x20ed74['up']({'migrations':_['map'](_0x15c5b7,function(_0x305402){return _0x305402+_0x01f8('0x23');})})[_0x01f8('0x1e')](function(){return _0x2a090e['status'](0xc8)['json']({'output':_0x01f8('0x2a')+module['exports'][_0x01f8('0xf')]+_0x01f8('0x2b')+_['last'](_0x15c5b7),'migrations':_[_0x01f8('0x20')](_0x15c5b7)});})[_0x01f8('0x2c')](function(_0x181970){if(_0x181970 instanceof db[_0x01f8('0x25')][_0x01f8('0x2d')]){return _0x2a090e[_0x01f8('0x10')](0xc8)[_0x01f8('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2a090e['status'](0x1f4)[_0x01f8('0x11')](_0x181970);}});}else{return _0x2a090e[_0x01f8('0x10')](0xc8)['json']({'output':_0x01f8('0x2e')});}}; \ No newline at end of file +var _0xc684=['exports','query','latest','fetch','tags','2.0.0','json','origin','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','server','migrations','length','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index'];(function(_0x1ce95e,_0x5aebfe){var _0x270377=function(_0x51a961){while(--_0x51a961){_0x1ce95e['push'](_0x1ce95e['shift']());}};_0x270377(++_0x5aebfe);}(_0xc684,0x19d));var _0x4c68=function(_0x400aaa,_0x38d8e5){_0x400aaa=_0x400aaa-0x0;var _0x4af484=_0xc684[_0x400aaa];return _0x4af484;};'use strict';var Umzug=require('umzug');var path=require(_0x4c68('0x0'));var fs=require('fs');var _=require(_0x4c68('0x1'));var pkginfo=require('pkginfo')(module,_0x4c68('0x2'));var compareVersions=require(_0x4c68('0x3'));var exec=require(_0x4c68('0x4'))['exec'];var db=require(_0x4c68('0x5'))['db'];var config=require(_0x4c68('0x6'));var pm2=require(_0x4c68('0x7'));var logger=require(_0x4c68('0x8'))('update');var git=require(_0x4c68('0x9'))(config['root']);exports[_0x4c68('0xa')]=function(_0x4eab68,_0x59771a){var _0x143b28={'current':module[_0x4c68('0xb')][_0x4c68('0x2')],'phonebar':0x2};if(_0x4eab68[_0x4c68('0xc')]&&_0x4eab68[_0x4c68('0xc')][_0x4c68('0xd')]){return git[_0x4c68('0xe')]()[_0x4c68('0xf')](function(_0x47920d,_0x310b01){_0x143b28[_0x4c68('0xd')]=(_0x47920d?module[_0x4c68('0xb')][_0x4c68('0x2')]:_0x310b01[_0x4c68('0xd')])||_0x4c68('0x10');return _0x59771a['status'](0xc8)[_0x4c68('0x11')](_0x143b28);});}else{return _0x59771a['status'](0xc8)['json'](_0x143b28);}};exports[_0x4c68('0xe')]=function(_0x13033b,_0x4d0901){return git[_0x4c68('0xe')]([_0x4c68('0x12'),'master'],function(_0x50033e){if(_0x50033e){logger[_0x4c68('0x13')](_0x50033e);return _0x4d0901[_0x4c68('0x14')](0x1f4)['json'](_0x50033e);}logger[_0x4c68('0x15')](_0x4c68('0x16'));return _0x4d0901[_0x4c68('0x14')](0xc8)[_0x4c68('0x11')]({'output':_0x4c68('0x17')});});};exports[_0x4c68('0x18')]=function(_0x25b80c,_0x4931bc){return git[_0x4c68('0x18')]([_0x4c68('0x19'),_0x4c68('0x1a')],function(_0x31fe3b){if(_0x31fe3b){logger[_0x4c68('0x13')](_0x31fe3b);return _0x4931bc[_0x4c68('0x14')](0x1f4)[_0x4c68('0x11')](_0x31fe3b);}logger[_0x4c68('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4931bc['status'](0xc8)['json']({'output':_0x4c68('0x1b')});});};exports[_0x4c68('0x1c')]=function(_0x2fbe71,_0x481902){exec('npm\x20install\x20--production',function(_0x41faa8,_0x16cad2,_0x344242){logger['info'](_0x16cad2);logger[_0x4c68('0x15')](_0x344242);if(_0x41faa8){logger['error'](_0x41faa8);return _0x481902[_0x4c68('0x14')](0x1f4)[_0x4c68('0x11')](_0x41faa8);}return _0x481902[_0x4c68('0x14')](0xc8)['json']({'output':_0x16cad2});});};exports[_0x4c68('0x1d')]=function(_0x16d880,_0x4c2f3b){return pm2[_0x4c68('0x1d')](_0x4c68('0x1e'))[_0x4c68('0x1f')](function(_0x439ab5){logger['info'](_0x4c68('0x20'),_0x439ab5);return _0x4c2f3b['status'](0xc8)[_0x4c68('0x11')]({'output':_0x4c68('0x21')});})[_0x4c68('0x22')](function(_0xaacfeb){logger['error'](_0xaacfeb);return _0x4c2f3b['status'](0x1f4)[_0x4c68('0x11')](_0xaacfeb);});};exports['migrations']=function(_0x3ff051,_0x476ed1){var _0x38123f=fs[_0x4c68('0x23')](path[_0x4c68('0x24')](config[_0x4c68('0x25')],_0x4c68('0x26'),_0x4c68('0x27')));var _0x9d3387=[];for(var _0x545fd7=0x0;_0x545fd7<_0x38123f[_0x4c68('0x28')];_0x545fd7++){var _0x5a92a8=_0x38123f[_0x545fd7]['replace'](_0x4c68('0x29'),'');if(compareVersions(module[_0x4c68('0xb')][_0x4c68('0x2')],_0x5a92a8)===-0x1){_0x9d3387[_0x4c68('0x2a')](_0x5a92a8);}}if(_0x9d3387['length']){var _0x35b0ec=_0x9d3387[_0x4c68('0x2b')](compareVersions);var _0x320775=new Umzug({'storage':_0x4c68('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':_0x4c68('0x2d'),'columnName':_0x4c68('0x2')},'migrations':{'params':[db[_0x4c68('0x2c')]['getQueryInterface'](),db['sequelize'][_0x4c68('0x2e')],function(){throw new Error(_0x4c68('0x2f'));}],'path':path[_0x4c68('0x24')](config['root'],_0x4c68('0x26'),_0x4c68('0x27')),'pattern':/\.js$/}});_0x320775['up']({'migrations':_['map'](_0x35b0ec,function(_0x1125da){return _0x1125da+_0x4c68('0x29');})})['then'](function(){return _0x476ed1[_0x4c68('0x14')](0xc8)[_0x4c68('0x11')]({'output':_0x4c68('0x30')+module[_0x4c68('0xb')][_0x4c68('0x2')]+_0x4c68('0x31')+_[_0x4c68('0x32')](_0x35b0ec),'migrations':_[_0x4c68('0x24')](_0x35b0ec)});})[_0x4c68('0x22')](function(_0x1b29d7){if(_0x1b29d7 instanceof db[_0x4c68('0x2c')][_0x4c68('0x33')]){return _0x476ed1['status'](0xc8)[_0x4c68('0x11')]({'output':_0x4c68('0x34')});}else{return _0x476ed1[_0x4c68('0x14')](0x1f4)[_0x4c68('0x11')](_0x1b29d7);}});}else{return _0x476ed1[_0x4c68('0x14')](0xc8)[_0x4c68('0x11')]({'output':_0x4c68('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e7c4995..36f0fbc 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 _0xb449=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x622933,_0x223217){var _0xd7ff71=function(_0x49d246){while(--_0x49d246){_0x622933['push'](_0x622933['shift']());}};_0xd7ff71(++_0x223217);}(_0xb449,0xf3));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var path=require(_0x9b44('0x2'));var timeout=require(_0x9b44('0x3'));var express=require('express');var router=express[_0x9b44('0x4')]();var fs_extra=require(_0x9b44('0x5'));var auth=require(_0x9b44('0x6'));var interaction=require(_0x9b44('0x7'));var config=require(_0x9b44('0x8'));var controller=require(_0x9b44('0x9'));router[_0x9b44('0xa')]('/',auth[_0x9b44('0xb')](),controller[_0x9b44('0xc')]);router[_0x9b44('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x9b44('0xd'),auth['isAuthenticated'](),controller[_0x9b44('0xe')]);router[_0x9b44('0xf')]('/',auth[_0x9b44('0xb')](),controller[_0x9b44('0x10')]);router[_0x9b44('0x11')]('/:id',auth[_0x9b44('0xb')](),controller[_0x9b44('0x12')]);router[_0x9b44('0x13')](_0x9b44('0xd'),auth[_0x9b44('0xb')](),controller[_0x9b44('0x14')]);module[_0x9b44('0x15')]=router; \ No newline at end of file +var _0x0f3a=['put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','post'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x0f3a,0x1bb));var _0xa0f3=function(_0x1cbda3,_0x410186){_0x1cbda3=_0x1cbda3-0x0;var _0x1e3f73=_0x0f3a[_0x1cbda3];return _0x1e3f73;};'use strict';var multer=require('multer');var util=require(_0xa0f3('0x0'));var path=require('path');var timeout=require(_0xa0f3('0x1'));var express=require(_0xa0f3('0x2'));var router=express[_0xa0f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa0f3('0x4'));var interaction=require(_0xa0f3('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xa0f3('0x6')]('/',auth['isAuthenticated'](),controller[_0xa0f3('0x7')]);router['get'](_0xa0f3('0x8'),auth[_0xa0f3('0x9')](),controller[_0xa0f3('0xa')]);router[_0xa0f3('0x6')]('/:id',auth[_0xa0f3('0x9')](),controller[_0xa0f3('0xb')]);router[_0xa0f3('0xc')]('/',auth[_0xa0f3('0x9')](),controller['create']);router[_0xa0f3('0xd')](_0xa0f3('0xe'),auth[_0xa0f3('0x9')](),controller[_0xa0f3('0xf')]);router[_0xa0f3('0x10')](_0xa0f3('0xe'),auth['isAuthenticated'](),controller[_0xa0f3('0x11')]);module[_0xa0f3('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 76a27c9..e63d6bc 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 _0xc7da=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x3a92db,_0x5192bf){var _0x339c8f=function(_0x172b2f){while(--_0x172b2f){_0x3a92db['push'](_0x3a92db['shift']());}};_0x339c8f(++_0x5192bf);}(_0xc7da,0xf2));var _0xac7d=function(_0x5c18d,_0x3a37dc){_0x5c18d=_0x5c18d-0x0;var _0x5e4672=_0xc7da[_0x5c18d];return _0x5e4672;};'use strict';var Sequelize=require(_0xac7d('0x0'));module[_0xac7d('0x1')]={'type':{'type':Sequelize[_0xac7d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xac7d('0x2')]},'calleridname':{'type':Sequelize[_0xac7d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xac7d('0x2')]},'membername':{'type':Sequelize[_0xac7d('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xac7d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xac7d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xac7d('0x3')]},'agentdumpAt':{'type':Sequelize[_0xac7d('0x3')]},'holdtime':{'type':Sequelize[_0xac7d('0x4')]},'agentcomplete':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xac7d('0x4')]},'agentacw':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xac7d('0x4')]},'reason':{'type':Sequelize[_0xac7d('0x2')]},'lastevent':{'type':Sequelize[_0xac7d('0x2')]},'channel':{'type':Sequelize[_0xac7d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xac7d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xac7d('0x2')]},'connectedlinename':{'type':Sequelize[_0xac7d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xac7d('0x2')]},'context':{'type':Sequelize[_0xac7d('0x2')]},'exten':{'type':Sequelize[_0xac7d('0x2')]},'priority':{'type':Sequelize[_0xac7d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xac7d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xac7d('0x2')]},'destcalleridnum':{'type':Sequelize[_0xac7d('0x2')]},'destcalleridname':{'type':Sequelize[_0xac7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xac7d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xac7d('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xac7d('0x2')]},'destexten':{'type':Sequelize[_0xac7d('0x2')]},'destpriority':{'type':Sequelize[_0xac7d('0x2')]},'destuniqueid':{'type':Sequelize[_0xac7d('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xac7d('0x2')]},'transfer':{'type':Sequelize[_0xac7d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xac7d('0x2')],'comment':_0xac7d('0x6')},'transferexten':{'type':Sequelize[_0xac7d('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xac7d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9af6=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9af6,0x1d7));var _0x69af=function(_0x29bee7,_0x48895c){_0x29bee7=_0x29bee7-0x0;var _0xc912f3=_0x9af6[_0x29bee7];return _0xc912f3;};'use strict';var Sequelize=require(_0x69af('0x0'));module[_0x69af('0x1')]={'type':{'type':Sequelize[_0x69af('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x69af('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x69af('0x2')]},'agentcalledAt':{'type':Sequelize[_0x69af('0x3')]},'agentconnectAt':{'type':Sequelize[_0x69af('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x69af('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x69af('0x4')]},'agentcomplete':{'type':Sequelize[_0x69af('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x69af('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x69af('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x69af('0x4')]},'agentacw':{'type':Sequelize[_0x69af('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x69af('0x4')]},'reason':{'type':Sequelize[_0x69af('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x69af('0x4')]},'channelstatedesc':{'type':Sequelize[_0x69af('0x2')]},'connectedlinenum':{'type':Sequelize[_0x69af('0x2')]},'connectedlinename':{'type':Sequelize[_0x69af('0x2')]},'language':{'type':Sequelize[_0x69af('0x2')]},'accountcode':{'type':Sequelize[_0x69af('0x2')]},'context':{'type':Sequelize[_0x69af('0x2')]},'exten':{'type':Sequelize[_0x69af('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x69af('0x2')]},'destchannelstate':{'type':Sequelize[_0x69af('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x69af('0x2')]},'destcalleridnum':{'type':Sequelize[_0x69af('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x69af('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x69af('0x2')]},'destlanguage':{'type':Sequelize[_0x69af('0x2')]},'destaccountcode':{'type':Sequelize[_0x69af('0x2')]},'destcontext':{'type':Sequelize[_0x69af('0x2')]},'destexten':{'type':Sequelize[_0x69af('0x2')]},'destpriority':{'type':Sequelize[_0x69af('0x2')]},'destuniqueid':{'type':Sequelize[_0x69af('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x69af('0x2')]},'transfer':{'type':Sequelize[_0x69af('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x69af('0x2')],'comment':_0x69af('0x6')},'transferexten':{'type':Sequelize[_0x69af('0x2')]},'transferuniqueid':{'type':Sequelize[_0x69af('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 e56db76..6774736 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(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 a44a0f3..cf2af94 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 _0xc3a8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util'];(function(_0x200184,_0x50134a){var _0x18a4ca=function(_0x1c7c71){while(--_0x1c7c71){_0x200184['push'](_0x200184['shift']());}};_0x18a4ca(++_0x50134a);}(_0xc3a8,0xe8));var _0x8c3a=function(_0xc298fe,_0x53be01){_0xc298fe=_0xc298fe-0x0;var _0x2096d3=_0xc3a8[_0xc298fe];return _0x2096d3;};'use strict';var _=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var logger=require(_0x8c3a('0x2'))('api');var moment=require(_0x8c3a('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c3a('0x4'));var fs=require('fs');var path=require(_0x8c3a('0x5'));var rimraf=require(_0x8c3a('0x6'));var config=require(_0x8c3a('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x8c3a('0x8')]=function(_0x2477f9,_0x18a92a){return _0x2477f9[_0x8c3a('0x9')](_0x8c3a('0xa'),attributes,{'tableName':_0x8c3a('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x8c3a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4006=['../../config/environment','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','api','moment','path'];(function(_0x4b9aea,_0x85deeb){var _0x34fd47=function(_0x282b51){while(--_0x282b51){_0x4b9aea['push'](_0x4b9aea['shift']());}};_0x34fd47(++_0x85deeb);}(_0x4006,0x1c7));var _0x6400=function(_0x5dbe18,_0x270102){_0x5dbe18=_0x5dbe18-0x0;var _0x4b0f47=_0x4006[_0x5dbe18];return _0x4b0f47;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var logger=require(_0x6400('0x1'))(_0x6400('0x2'));var moment=require(_0x6400('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6400('0x4'));var rimraf=require('rimraf');var config=require(_0x6400('0x5'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x2dbd03,_0x599e6f){return _0x2dbd03[_0x6400('0x6')](_0x6400('0x7'),attributes,{'tableName':_0x6400('0x8'),'paranoid':![],'indexes':[{'fields':[_0x6400('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1953a8a..5ee0d35 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 _0xab1d=['catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','then','UpdateVoiceAgentReport','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x52c702,_0x541811){var _0x10a9aa=function(_0x8a9de2){while(--_0x8a9de2){_0x52c702['push'](_0x52c702['shift']());}};_0x10a9aa(++_0x541811);}(_0xab1d,0x1da));var _0xdab1=function(_0x424fdc,_0x5e508d){_0x424fdc=_0x424fdc-0x0;var _0x1c366d=_0xab1d[_0x424fdc];return _0x1c366d;};'use strict';var _=require('lodash');var util=require(_0xdab1('0x0'));var moment=require(_0xdab1('0x1'));var BPromise=require(_0xdab1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdab1('0x3'));var db=require(_0xdab1('0x4'))['db'];var utils=require(_0xdab1('0x5'));var logger=require(_0xdab1('0x6'))(_0xdab1('0x7'));var config=require(_0xdab1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdab1('0x9')][_0xdab1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x872fa,_0x346391,_0x50e47e){return new BPromise(function(_0x125c59,_0x2f4c63){return client[_0xdab1('0xb')](_0x872fa,_0x50e47e)['then'](function(_0x2e0d3d){logger[_0xdab1('0xc')](_0xdab1('0xd'),_0x346391,_0xdab1('0xe'));logger[_0xdab1('0xf')](_0xdab1('0x10'),_0x346391,'request\x20sent',JSON[_0xdab1('0x11')](_0x2e0d3d));if(_0x2e0d3d[_0xdab1('0x12')]){if(_0x2e0d3d['error']['code']===0x1f4){logger[_0xdab1('0x12')](_0xdab1('0xd'),_0x346391,_0x2e0d3d[_0xdab1('0x12')][_0xdab1('0x13')]);return _0x2f4c63(_0x2e0d3d['error']['message']);}logger[_0xdab1('0x12')](_0xdab1('0xd'),_0x346391,_0x2e0d3d[_0xdab1('0x12')][_0xdab1('0x13')]);return _0x125c59(_0x2e0d3d[_0xdab1('0x12')][_0xdab1('0x13')]);}else{logger[_0xdab1('0xc')](_0xdab1('0xd'),_0x346391,_0xdab1('0xe'));_0x125c59(_0x2e0d3d[_0xdab1('0x14')][_0xdab1('0x13')]);}})[_0xdab1('0x15')](function(_0xd47389){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x346391,_0xd47389);_0x2f4c63(_0xd47389);});});}exports[_0xdab1('0x16')]=function(_0x146037){var _0x16ae6f=this;return new Promise(function(_0x16e39d,_0x20e8f1){return db[_0xdab1('0x17')][_0xdab1('0x18')](_0x146037[_0xdab1('0x19')],{'raw':_0x146037[_0xdab1('0x1a')]?_0x146037[_0xdab1('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xdab1('0x1b')](function(_0x25a07c){logger[_0xdab1('0xc')](_0xdab1('0x16'),_0x146037);logger['debug'](_0xdab1('0x16'),_0x146037,JSON[_0xdab1('0x11')](_0x25a07c));_0x16e39d(_0x25a07c);})['catch'](function(_0x3647e8){logger[_0xdab1('0x12')](_0xdab1('0x16'),_0x3647e8[_0xdab1('0x13')],_0x146037);_0x20e8f1(_0x16ae6f[_0xdab1('0x12')](0x1f4,_0x3647e8[_0xdab1('0x13')]));});});};exports[_0xdab1('0x1c')]=function(_0x485cca){var _0x18f1ad=this;return new Promise(function(_0x154351,_0x41a708){return db[_0xdab1('0x17')]['update'](_0x485cca[_0xdab1('0x19')],{'raw':_0x485cca['options']?_0x485cca[_0xdab1('0x1a')][_0xdab1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485cca[_0xdab1('0x1a')]?_0x485cca['options'][_0xdab1('0x1e')]||null:null,'attributes':_0x485cca['options']?_0x485cca[_0xdab1('0x1a')][_0xdab1('0x1f')]||null:null,'limit':_0x485cca[_0xdab1('0x1a')]?_0x485cca[_0xdab1('0x1a')][_0xdab1('0x20')]||null:null})[_0xdab1('0x1b')](function(_0x281f96){logger[_0xdab1('0xc')](_0xdab1('0x1c'),_0x485cca);logger[_0xdab1('0xf')](_0xdab1('0x1c'),_0x485cca,JSON[_0xdab1('0x11')](_0x281f96));_0x154351(_0x281f96);})[_0xdab1('0x15')](function(_0xb4f08a){logger[_0xdab1('0x12')](_0xdab1('0x1c'),_0xb4f08a[_0xdab1('0x13')],_0x485cca);_0x41a708(_0x18f1ad[_0xdab1('0x12')](0x1f4,_0xb4f08a[_0xdab1('0x13')]));});});}; \ No newline at end of file +var _0xa929=['catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x26d9d6,_0x4f7c27){var _0x72af86=function(_0x49ec89){while(--_0x49ec89){_0x26d9d6['push'](_0x26d9d6['shift']());}};_0x72af86(++_0x4f7c27);}(_0xa929,0x1c7));var _0x9a92=function(_0x176340,_0x426eaa){_0x176340=_0x176340-0x0;var _0x41e539=_0xa929[_0x176340];return _0x41e539;};'use strict';var _=require(_0x9a92('0x0'));var util=require(_0x9a92('0x1'));var moment=require(_0x9a92('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a92('0x3'));var fs=require('fs');var Redis=require(_0x9a92('0x4'));var db=require(_0x9a92('0x5'))['db'];var utils=require(_0x9a92('0x6'));var logger=require(_0x9a92('0x7'))(_0x9a92('0x8'));var config=require('../../config/environment');var jayson=require(_0x9a92('0x9'));var client=jayson['client'][_0x9a92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1f1e,_0x1e679a,_0x4a8ded){return new BPromise(function(_0x8fe381,_0x3015a1){return client['request'](_0x1f1f1e,_0x4a8ded)[_0x9a92('0xb')](function(_0x5de012){logger[_0x9a92('0xc')](_0x9a92('0xd'),_0x1e679a,_0x9a92('0xe'));logger[_0x9a92('0xf')](_0x9a92('0x10'),_0x1e679a,_0x9a92('0xe'),JSON['stringify'](_0x5de012));if(_0x5de012[_0x9a92('0x11')]){if(_0x5de012[_0x9a92('0x11')][_0x9a92('0x12')]===0x1f4){logger['error'](_0x9a92('0xd'),_0x1e679a,_0x5de012[_0x9a92('0x11')]['message']);return _0x3015a1(_0x5de012[_0x9a92('0x11')][_0x9a92('0x13')]);}logger[_0x9a92('0x11')](_0x9a92('0xd'),_0x1e679a,_0x5de012[_0x9a92('0x11')][_0x9a92('0x13')]);return _0x8fe381(_0x5de012[_0x9a92('0x11')]['message']);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x1e679a,'request\x20sent');_0x8fe381(_0x5de012[_0x9a92('0x14')]['message']);}})[_0x9a92('0x15')](function(_0x2565d1){logger[_0x9a92('0x11')](_0x9a92('0xd'),_0x1e679a,_0x2565d1);_0x3015a1(_0x2565d1);});});}exports[_0x9a92('0x16')]=function(_0x364e4b){var _0x2c3f02=this;return new Promise(function(_0x649e3f,_0x1e1160){return db[_0x9a92('0x17')][_0x9a92('0x18')](_0x364e4b[_0x9a92('0x19')],{'raw':_0x364e4b[_0x9a92('0x1a')]?_0x364e4b[_0x9a92('0x1a')][_0x9a92('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x155d7d){logger[_0x9a92('0xc')](_0x9a92('0x16'),_0x364e4b);logger['debug'](_0x9a92('0x16'),_0x364e4b,JSON['stringify'](_0x155d7d));_0x649e3f(_0x155d7d);})[_0x9a92('0x15')](function(_0x46989d){logger[_0x9a92('0x11')](_0x9a92('0x16'),_0x46989d[_0x9a92('0x13')],_0x364e4b);_0x1e1160(_0x2c3f02[_0x9a92('0x11')](0x1f4,_0x46989d[_0x9a92('0x13')]));});});};exports[_0x9a92('0x1c')]=function(_0x531020){var _0x57ab84=this;return new Promise(function(_0x1bf245,_0x455ec8){return db[_0x9a92('0x17')][_0x9a92('0x1d')](_0x531020[_0x9a92('0x19')],{'raw':_0x531020[_0x9a92('0x1a')]?_0x531020[_0x9a92('0x1a')][_0x9a92('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531020[_0x9a92('0x1a')]?_0x531020['options'][_0x9a92('0x1e')]||null:null,'attributes':_0x531020[_0x9a92('0x1a')]?_0x531020[_0x9a92('0x1a')][_0x9a92('0x1f')]||null:null,'limit':_0x531020['options']?_0x531020[_0x9a92('0x1a')][_0x9a92('0x20')]||null:null})[_0x9a92('0xb')](function(_0x1ba3ee){logger[_0x9a92('0xc')](_0x9a92('0x1c'),_0x531020);logger[_0x9a92('0xf')](_0x9a92('0x1c'),_0x531020,JSON[_0x9a92('0x21')](_0x1ba3ee));_0x1bf245(_0x1ba3ee);})[_0x9a92('0x15')](function(_0x37f785){logger[_0x9a92('0x11')]('UpdateVoiceAgentReport',_0x37f785[_0x9a92('0x13')],_0x531020);_0x455ec8(_0x57ab84['error'](0x1f4,_0x37f785['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 89dfc05..35e030a 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 _0x885a=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x885a,0x180));var _0xa885=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x885a[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0xf')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x12')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller['update']);router[_0xa885('0x13')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller[_0xa885('0x14')]);module[_0xa885('0x15')]=router; \ No newline at end of file +var _0x207c=['/:id','show','post','isAuthenticated','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x207c,0x1e8));var _0xc207=function(_0x5244bc,_0xbeed11){_0x5244bc=_0x5244bc-0x0;var _0x3ae51c=_0x207c[_0x5244bc];return _0x3ae51c;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0x9')](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0xd')]);router[_0xc207('0xe')]('/',auth[_0xc207('0xf')](),controller[_0xc207('0x10')]);router[_0xc207('0x11')](_0xc207('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0x12')]);module[_0xc207('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 545c553..eba1365 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 _0xc900=['ENUM','inbound','outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','STRING'];(function(_0x170b0b,_0x4aa600){var _0x33cd22=function(_0x35263c){while(--_0x35263c){_0x170b0b['push'](_0x170b0b['shift']());}};_0x33cd22(++_0x4aa600);}(_0xc900,0xb3));var _0x0c90=function(_0x8bd38f,_0x5e9afc){_0x8bd38f=_0x8bd38f-0x0;var _0x583f61=_0xc900[_0x8bd38f];return _0x583f61;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0c90('0x0')]},'type':{'type':Sequelize[_0x0c90('0x1')](_0x0c90('0x2'),'internal',_0x0c90('0x3'),_0x0c90('0x4'),'outbound-fax',_0x0c90('0x5'))},'tag':{'type':Sequelize[_0x0c90('0x0')]},'accountcode':{'type':Sequelize[_0x0c90('0x0')]},'source':{'type':Sequelize[_0x0c90('0x0')]},'destination':{'type':Sequelize[_0x0c90('0x0')]},'destinationcontext':{'type':Sequelize[_0x0c90('0x0')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0c90('0x0')]},'destinationchannel':{'type':Sequelize[_0x0c90('0x0')]},'lastapplication':{'type':Sequelize[_0x0c90('0x0')]},'lastdata':{'type':Sequelize[_0x0c90('0x6')]},'starttime':{'type':Sequelize[_0x0c90('0x7')]},'systemanswertime':{'type':Sequelize[_0x0c90('0x7')]},'answertime':{'type':Sequelize[_0x0c90('0x7')]},'endtime':{'type':Sequelize[_0x0c90('0x7')]},'duration':{'type':Sequelize[_0x0c90('0x8')]},'billableseconds':{'type':Sequelize[_0x0c90('0x8')]},'mohtime':{'type':Sequelize[_0x0c90('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c90('0x0')]},'amaflags':{'type':Sequelize[_0x0c90('0x0')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x0c90('0x0')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x0c90('0x0')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0c90('0x0')]},'routeid':{'type':Sequelize[_0x0c90('0x8')]},'sipcallid':{'type':Sequelize[_0x0c90('0x0')]}}; \ No newline at end of file +var _0xb886=['internal','outbound','inbound-fax','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0xb886,0xf5));var _0x6b88=function(_0xe01854,_0x1c02b3){_0xe01854=_0xe01854-0x0;var _0x2f9e6a=_0xb886[_0xe01854];return _0x2f9e6a;};'use strict';var Sequelize=require(_0x6b88('0x0'));module[_0x6b88('0x1')]={'uniqueid':{'type':Sequelize[_0x6b88('0x2')]},'type':{'type':Sequelize[_0x6b88('0x3')](_0x6b88('0x4'),_0x6b88('0x5'),_0x6b88('0x6'),_0x6b88('0x7'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x6b88('0x2')]},'accountcode':{'type':Sequelize[_0x6b88('0x2')]},'source':{'type':Sequelize[_0x6b88('0x2')]},'destination':{'type':Sequelize[_0x6b88('0x2')]},'destinationcontext':{'type':Sequelize[_0x6b88('0x2')]},'callerid':{'type':Sequelize[_0x6b88('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x6b88('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x6b88('0x8')]},'systemanswertime':{'type':Sequelize[_0x6b88('0x8')]},'answertime':{'type':Sequelize[_0x6b88('0x8')]},'endtime':{'type':Sequelize[_0x6b88('0x8')]},'duration':{'type':Sequelize[_0x6b88('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6b88('0x2')]},'amaflags':{'type':Sequelize[_0x6b88('0x2')]},'userfield':{'type':Sequelize[_0x6b88('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x6b88('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x6b88('0x2')]},'note':{'type':Sequelize[_0x6b88('0x2')]},'prefix':{'type':Sequelize[_0x6b88('0x2')]},'routeid':{'type':Sequelize[_0x6b88('0x9')]},'sipcallid':{'type':Sequelize[_0x6b88('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9c210e0..5cbe672 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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x2c0091,_0x1b9567){_0x2c0091=_0x2c0091-0x0;var _0x33fb4f=_0x2032[_0x2c0091];return _0x33fb4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x2ef3,0xba));var _0x32ef=function(_0x35cff1,_0x3b486d){_0x35cff1=_0x35cff1-0x0;var _0x5c04e4=_0x2ef3[_0x35cff1];return _0x5c04e4;};'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 27e8108..602d7fb 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 _0x4449=['lodash','../../config/logger','moment','bluebird','path','./voiceCallReport.attributes','define','report_call','uniqueid'];(function(_0x257297,_0x3f62b9){var _0x3a454e=function(_0x8d9c58){while(--_0x8d9c58){_0x257297['push'](_0x257297['shift']());}};_0x3a454e(++_0x3f62b9);}(_0x4449,0x1c2));var _0x9444=function(_0x1c658a,_0xfac721){_0x1c658a=_0x1c658a-0x0;var _0x424736=_0x4449[_0x1c658a];return _0x424736;};'use strict';var _=require(_0x9444('0x0'));var util=require('util');var logger=require(_0x9444('0x1'))('api');var moment=require(_0x9444('0x2'));var BPromise=require(_0x9444('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9444('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9444('0x5'));module['exports']=function(_0x448a4a,_0x5d1422){return _0x448a4a[_0x9444('0x6')]('VoiceCallReport',attributes,{'tableName':_0x9444('0x7'),'paranoid':![],'indexes':[{'fields':[_0x9444('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb69=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x15716a,_0x3e6958){var _0x548da0=function(_0xc42439){while(--_0xc42439){_0x15716a['push'](_0x15716a['shift']());}};_0x548da0(++_0x3e6958);}(_0xfb69,0x8e));var _0x9fb6=function(_0x15d8ee,_0x3af7c2){_0x15d8ee=_0x15d8ee-0x0;var _0x2d8051=_0xfb69[_0x15d8ee];return _0x2d8051;};'use strict';var _=require(_0x9fb6('0x0'));var util=require(_0x9fb6('0x1'));var logger=require(_0x9fb6('0x2'))(_0x9fb6('0x3'));var moment=require('moment');var BPromise=require(_0x9fb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fb6('0x5'));var rimraf=require(_0x9fb6('0x6'));var config=require(_0x9fb6('0x7'));var attributes=require(_0x9fb6('0x8'));module['exports']=function(_0x180ed3,_0x22dfd8){return _0x180ed3[_0x9fb6('0x9')](_0x9fb6('0xa'),attributes,{'tableName':_0x9fb6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9fb6('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 175eac8..7d520ee 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 _0x3123=['code','message','result','GetVoiceCallReport','options','raw','limit','include','map','attributes','model','catch','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0x3123,0x1f3));var _0x3312=function(_0x4267a7,_0x40173b){_0x4267a7=_0x4267a7-0x0;var _0xb30092=_0x3123[_0x4267a7];return _0xb30092;};'use strict';var _=require(_0x3312('0x0'));var util=require(_0x3312('0x1'));var moment=require('moment');var BPromise=require(_0x3312('0x2'));var rs=require(_0x3312('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3312('0x4'))['db'];var utils=require(_0x3312('0x5'));var logger=require(_0x3312('0x6'))(_0x3312('0x7'));var config=require(_0x3312('0x8'));var jayson=require(_0x3312('0x9'));var client=jayson[_0x3312('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11211f,_0x5e033c,_0x22b78d){return new BPromise(function(_0x537d5d,_0x485e83){return client['request'](_0x11211f,_0x22b78d)[_0x3312('0xb')](function(_0x72edac){logger[_0x3312('0xc')](_0x3312('0xd'),_0x5e033c,_0x3312('0xe'));logger[_0x3312('0xf')](_0x3312('0x10'),_0x5e033c,_0x3312('0xe'),JSON[_0x3312('0x11')](_0x72edac));if(_0x72edac[_0x3312('0x12')]){if(_0x72edac[_0x3312('0x12')][_0x3312('0x13')]===0x1f4){logger[_0x3312('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5e033c,_0x72edac[_0x3312('0x12')]['message']);return _0x485e83(_0x72edac['error'][_0x3312('0x14')]);}logger[_0x3312('0x12')](_0x3312('0xd'),_0x5e033c,_0x72edac[_0x3312('0x12')][_0x3312('0x14')]);return _0x537d5d(_0x72edac['error']['message']);}else{logger[_0x3312('0xc')](_0x3312('0xd'),_0x5e033c,_0x3312('0xe'));_0x537d5d(_0x72edac[_0x3312('0x15')][_0x3312('0x14')]);}})['catch'](function(_0x4ae4a2){logger[_0x3312('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5e033c,_0x4ae4a2);_0x485e83(_0x4ae4a2);});});}exports[_0x3312('0x16')]=function(_0x55579b){var _0x3412c0=this;return new Promise(function(_0x2bbd1d,_0x121cca){return db['VoiceCallReport']['findAll']({'raw':_0x55579b[_0x3312('0x17')]?_0x55579b[_0x3312('0x17')][_0x3312('0x18')]===undefined?!![]:![]:!![],'where':_0x55579b[_0x3312('0x17')]?_0x55579b[_0x3312('0x17')]['where']||null:null,'attributes':_0x55579b[_0x3312('0x17')]?_0x55579b['options']['attributes']||null:null,'limit':_0x55579b[_0x3312('0x17')]?_0x55579b[_0x3312('0x17')][_0x3312('0x19')]||null:null,'include':_0x55579b['options']?_0x55579b[_0x3312('0x17')][_0x3312('0x1a')]?_[_0x3312('0x1b')](_0x55579b['options'][_0x3312('0x1a')],function(_0x158f68){return{'model':db[_0x158f68['model']],'as':_0x158f68['as'],'attributes':_0x158f68[_0x3312('0x1c')],'include':_0x158f68['include']?_['map'](_0x158f68['include'],function(_0xeebca){return{'model':db[_0xeebca[_0x3312('0x1d')]],'as':_0xeebca['as'],'attributes':_0xeebca[_0x3312('0x1c')],'include':_0xeebca[_0x3312('0x1a')]?_[_0x3312('0x1b')](_0xeebca['include'],function(_0x237e8e){return{'model':db[_0x237e8e[_0x3312('0x1d')]],'as':_0x237e8e['as'],'attributes':_0x237e8e[_0x3312('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3312('0xb')](function(_0x5ed50b){logger[_0x3312('0xc')](_0x3312('0x16'),_0x55579b);logger['debug'](_0x3312('0x16'),_0x55579b,JSON[_0x3312('0x11')](_0x5ed50b));_0x2bbd1d(_0x5ed50b);})[_0x3312('0x1e')](function(_0x1ab67e){logger[_0x3312('0x12')](_0x3312('0x16'),_0x1ab67e[_0x3312('0x14')],_0x55579b);_0x121cca(_0x3412c0[_0x3312('0x12')](0x1f4,_0x1ab67e[_0x3312('0x14')]));});});};exports[_0x3312('0x1f')]=function(_0x2d83f8){var _0x4730c0=this;return new Promise(function(_0x198c7d,_0x2c28fe){return db[_0x3312('0x20')][_0x3312('0x21')](_0x2d83f8[_0x3312('0x22')],{'raw':_0x2d83f8['options']?_0x2d83f8[_0x3312('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x172566){logger[_0x3312('0xc')](_0x3312('0x1f'),_0x2d83f8);logger[_0x3312('0xf')](_0x3312('0x1f'),_0x2d83f8,JSON[_0x3312('0x11')](_0x172566));_0x198c7d(_0x172566);})[_0x3312('0x1e')](function(_0x8dfdfc){logger[_0x3312('0x12')](_0x3312('0x1f'),_0x8dfdfc['message'],_0x2d83f8);_0x2c28fe(_0x4730c0[_0x3312('0x12')](0x1f4,_0x8dfdfc['message']));});});};exports[_0x3312('0x23')]=function(_0x6c7d38){var _0x426b09=this;return new Promise(function(_0x414f40,_0x277274){return db['VoiceCallReport'][_0x3312('0x24')](_0x6c7d38[_0x3312('0x22')],{'raw':_0x6c7d38['options']?_0x6c7d38[_0x3312('0x17')][_0x3312('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6c7d38['options']?_0x6c7d38[_0x3312('0x17')]['where']||null:null,'attributes':_0x6c7d38[_0x3312('0x17')]?_0x6c7d38[_0x3312('0x17')][_0x3312('0x1c')]||null:null,'limit':_0x6c7d38['options']?_0x6c7d38[_0x3312('0x17')][_0x3312('0x19')]||null:null})['then'](function(_0x3c5b05){logger[_0x3312('0xc')](_0x3312('0x23'),_0x6c7d38);logger[_0x3312('0xf')](_0x3312('0x23'),_0x6c7d38,JSON['stringify'](_0x3c5b05));_0x414f40(_0x3c5b05);})[_0x3312('0x1e')](function(_0x359fb0){logger['error'](_0x3312('0x23'),_0x359fb0[_0x3312('0x14')],_0x6c7d38);_0x277274(_0x426b09[_0x3312('0x12')](0x1f4,_0x359fb0[_0x3312('0x14')]));});});}; \ No newline at end of file +var _0x858e=['map','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','model'];(function(_0x3235b1,_0x5933fd){var _0xc3d401=function(_0x1a3a3b){while(--_0x1a3a3b){_0x3235b1['push'](_0x3235b1['shift']());}};_0xc3d401(++_0x5933fd);}(_0x858e,0x136));var _0xe858=function(_0x2d323f,_0x231fe6){_0x2d323f=_0x2d323f-0x0;var _0x11e018=_0x858e[_0x2d323f];return _0x11e018;};'use strict';var _=require(_0xe858('0x0'));var util=require('util');var moment=require(_0xe858('0x1'));var BPromise=require('bluebird');var rs=require(_0xe858('0x2'));var fs=require('fs');var Redis=require(_0xe858('0x3'));var db=require(_0xe858('0x4'))['db'];var utils=require(_0xe858('0x5'));var logger=require(_0xe858('0x6'))('rpc');var config=require(_0xe858('0x7'));var jayson=require(_0xe858('0x8'));var client=jayson['client'][_0xe858('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cd8f7,_0x117b95,_0x24349b){return new BPromise(function(_0x4ef981,_0x1c1752){return client[_0xe858('0xa')](_0x5cd8f7,_0x24349b)[_0xe858('0xb')](function(_0xd64ac){logger['info'](_0xe858('0xc'),_0x117b95,'request\x20sent');logger[_0xe858('0xd')](_0xe858('0xe'),_0x117b95,_0xe858('0xf'),JSON[_0xe858('0x10')](_0xd64ac));if(_0xd64ac[_0xe858('0x11')]){if(_0xd64ac[_0xe858('0x11')][_0xe858('0x12')]===0x1f4){logger[_0xe858('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x117b95,_0xd64ac[_0xe858('0x11')][_0xe858('0x13')]);return _0x1c1752(_0xd64ac[_0xe858('0x11')][_0xe858('0x13')]);}logger[_0xe858('0x11')](_0xe858('0xc'),_0x117b95,_0xd64ac[_0xe858('0x11')][_0xe858('0x13')]);return _0x4ef981(_0xd64ac['error'][_0xe858('0x13')]);}else{logger[_0xe858('0x14')](_0xe858('0xc'),_0x117b95,_0xe858('0xf'));_0x4ef981(_0xd64ac[_0xe858('0x15')]['message']);}})[_0xe858('0x16')](function(_0x5e09d9){logger[_0xe858('0x11')](_0xe858('0xc'),_0x117b95,_0x5e09d9);_0x1c1752(_0x5e09d9);});});}exports[_0xe858('0x17')]=function(_0x2d01a8){var _0x14c1f2=this;return new Promise(function(_0x21ac02,_0x41f2e0){return db[_0xe858('0x18')][_0xe858('0x19')]({'raw':_0x2d01a8[_0xe858('0x1a')]?_0x2d01a8[_0xe858('0x1a')][_0xe858('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d01a8[_0xe858('0x1a')]?_0x2d01a8[_0xe858('0x1a')]['where']||null:null,'attributes':_0x2d01a8[_0xe858('0x1a')]?_0x2d01a8[_0xe858('0x1a')][_0xe858('0x1c')]||null:null,'limit':_0x2d01a8[_0xe858('0x1a')]?_0x2d01a8[_0xe858('0x1a')][_0xe858('0x1d')]||null:null,'include':_0x2d01a8[_0xe858('0x1a')]?_0x2d01a8[_0xe858('0x1a')]['include']?_['map'](_0x2d01a8[_0xe858('0x1a')][_0xe858('0x1e')],function(_0x236b31){return{'model':db[_0x236b31[_0xe858('0x1f')]],'as':_0x236b31['as'],'attributes':_0x236b31['attributes'],'include':_0x236b31[_0xe858('0x1e')]?_[_0xe858('0x20')](_0x236b31[_0xe858('0x1e')],function(_0x4bcd7b){return{'model':db[_0x4bcd7b[_0xe858('0x1f')]],'as':_0x4bcd7b['as'],'attributes':_0x4bcd7b['attributes'],'include':_0x4bcd7b[_0xe858('0x1e')]?_[_0xe858('0x20')](_0x4bcd7b[_0xe858('0x1e')],function(_0x1b5496){return{'model':db[_0x1b5496[_0xe858('0x1f')]],'as':_0x1b5496['as'],'attributes':_0x1b5496[_0xe858('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe858('0xb')](function(_0x2f230b){logger[_0xe858('0x14')]('GetVoiceCallReport',_0x2d01a8);logger['debug'](_0xe858('0x17'),_0x2d01a8,JSON['stringify'](_0x2f230b));_0x21ac02(_0x2f230b);})['catch'](function(_0x3c9ad5){logger[_0xe858('0x11')]('GetVoiceCallReport',_0x3c9ad5[_0xe858('0x13')],_0x2d01a8);_0x41f2e0(_0x14c1f2[_0xe858('0x11')](0x1f4,_0x3c9ad5['message']));});});};exports[_0xe858('0x21')]=function(_0x57753b){var _0x4cac9c=this;return new Promise(function(_0x369d22,_0x234c43){return db[_0xe858('0x18')][_0xe858('0x22')](_0x57753b['body'],{'raw':_0x57753b['options']?_0x57753b[_0xe858('0x1a')][_0xe858('0x1b')]===undefined?!![]:![]:!![]})[_0xe858('0xb')](function(_0x112d76){logger[_0xe858('0x14')](_0xe858('0x21'),_0x57753b);logger[_0xe858('0xd')]('CreateVoiceCallReport',_0x57753b,JSON['stringify'](_0x112d76));_0x369d22(_0x112d76);})[_0xe858('0x16')](function(_0xcd6ba6){logger[_0xe858('0x11')](_0xe858('0x21'),_0xcd6ba6[_0xe858('0x13')],_0x57753b);_0x234c43(_0x4cac9c[_0xe858('0x11')](0x1f4,_0xcd6ba6[_0xe858('0x13')]));});});};exports[_0xe858('0x23')]=function(_0x1c0351){var _0x4fb512=this;return new Promise(function(_0xd12447,_0x264582){return db['VoiceCallReport'][_0xe858('0x24')](_0x1c0351['body'],{'raw':_0x1c0351[_0xe858('0x1a')]?_0x1c0351[_0xe858('0x1a')][_0xe858('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c0351['options']?_0x1c0351[_0xe858('0x1a')][_0xe858('0x25')]||null:null,'attributes':_0x1c0351['options']?_0x1c0351[_0xe858('0x1a')]['attributes']||null:null,'limit':_0x1c0351[_0xe858('0x1a')]?_0x1c0351[_0xe858('0x1a')][_0xe858('0x1d')]||null:null})[_0xe858('0xb')](function(_0x316b59){logger[_0xe858('0x14')](_0xe858('0x23'),_0x1c0351);logger[_0xe858('0xd')]('UpdateVoiceCallReport',_0x1c0351,JSON[_0xe858('0x10')](_0x316b59));_0xd12447(_0x316b59);})['catch'](function(_0x2306a){logger[_0xe858('0x11')](_0xe858('0x23'),_0x2306a['message'],_0x1c0351);_0x264582(_0x4fb512['error'](0x1f4,_0x2306a[_0xe858('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 5a37202..c7b5aa4 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 _0xc960=['show','post','create','put','update','delete','isAuthenticated','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id'];(function(_0x1ed8c7,_0x498766){var _0x40e193=function(_0x1880d3){while(--_0x1880d3){_0x1ed8c7['push'](_0x1ed8c7['shift']());}};_0x40e193(++_0x498766);}(_0xc960,0x8d));var _0x0c96=function(_0x3c657e,_0x24ff4d){_0x3c657e=_0x3c657e-0x0;var _0x89d7c2=_0xc960[_0x3c657e];return _0x89d7c2;};'use strict';var multer=require(_0x0c96('0x0'));var util=require('util');var path=require(_0x0c96('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c96('0x2'));var router=express[_0x0c96('0x3')]();var fs_extra=require(_0x0c96('0x4'));var auth=require(_0x0c96('0x5'));var interaction=require(_0x0c96('0x6'));var config=require(_0x0c96('0x7'));var controller=require(_0x0c96('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0c96('0x9')](_0x0c96('0xa'),auth['isAuthenticated'](),controller[_0x0c96('0xb')]);router[_0x0c96('0xc')]('/',auth['isAuthenticated'](),controller[_0x0c96('0xd')]);router[_0x0c96('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0c96('0xf')]);router[_0x0c96('0x10')](_0x0c96('0xa'),auth[_0x0c96('0x11')](),controller[_0x0c96('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3172=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x58beaa,_0x41a8f0){var _0x478b2a=function(_0x499abf){while(--_0x499abf){_0x58beaa['push'](_0x58beaa['shift']());}};_0x478b2a(++_0x41a8f0);}(_0x3172,0x179));var _0x2317=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x3172[_0x6d6a66];return _0x11eb6e;};'use strict';var multer=require(_0x2317('0x0'));var util=require(_0x2317('0x1'));var path=require(_0x2317('0x2'));var timeout=require(_0x2317('0x3'));var express=require('express');var router=express[_0x2317('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2317('0x5'));var config=require('../../config/environment');var controller=require(_0x2317('0x6'));router['get']('/',auth[_0x2317('0x7')](),controller[_0x2317('0x8')]);router['get'](_0x2317('0x9'),auth[_0x2317('0x7')](),controller['show']);router[_0x2317('0xa')]('/',auth[_0x2317('0x7')](),controller[_0x2317('0xb')]);router[_0x2317('0xc')](_0x2317('0x9'),auth['isAuthenticated'](),controller[_0x2317('0xd')]);router[_0x2317('0xe')]('/:id',auth[_0x2317('0x7')](),controller[_0x2317('0xf')]);module[_0x2317('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 9512e76..e185bce 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 _0x3f0e=['exports','STRING','name','options','join','getDataValue','BOOLEAN','sequelize'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x3f0e,0x1cf));var _0xe3f0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3f0e[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xe3f0('0x0'));module[_0xe3f0('0x1')]={'name':{'type':Sequelize[_0xe3f0('0x2')]},'prefix':{'type':Sequelize[_0xe3f0('0x2')],'unique':_0xe3f0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe3f0('0x2')],'set':function(_0x417b10){this['setDataValue'](_0xe3f0('0x4'),_0x417b10?_0x417b10[_0xe3f0('0x5')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0xe3f0('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xe3f0('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xe3f0('0x2')]},'record':{'type':Sequelize[_0xe3f0('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe3f0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6eac=['sequelize','exports','name','STRING','setDataValue','join','options','BOOLEAN'];(function(_0x427be6,_0x5e0b93){var _0x43cdf5=function(_0x2832f4){while(--_0x2832f4){_0x427be6['push'](_0x427be6['shift']());}};_0x43cdf5(++_0x5e0b93);}(_0x6eac,0x148));var _0xc6ea=function(_0x389d7d,_0xfeba1a){_0x389d7d=_0x389d7d-0x0;var _0x4d64e3=_0x6eac[_0x389d7d];return _0x4d64e3;};'use strict';var Sequelize=require(_0xc6ea('0x0'));module[_0xc6ea('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xc6ea('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xc6ea('0x3')],'set':function(_0x3128b5){this[_0xc6ea('0x4')]('options',_0x3128b5?_0x3128b5[_0xc6ea('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xc6ea('0x6'))?this['getDataValue'](_0xc6ea('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc6ea('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xc6ea('0x3')]},'record':{'type':Sequelize[_0xc6ea('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc6ea('0x3')]},'description':{'type':Sequelize[_0xc6ea('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 64a464d..7eeebce 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 _0x639a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','count','set','Content-Range','apply','then','ChanSpies','UserProfileResource','destroy','sendStatus','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','keys','filters','model','query','attributes','fields','length','nolimit','limit','order','sort','where','merge','type','filter','includeAll','findAll','rows','catch','show','params','intersection','include','find','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','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x2079ae,_0x3a65f6){var _0x1655b7=function(_0x491b31){while(--_0x491b31){_0x2079ae['push'](_0x2079ae['shift']());}};_0x1655b7(++_0x3a65f6);}(_0x639a,0xec));var _0xa639=function(_0x54c08f,_0x2eb354){_0x54c08f=_0x54c08f-0x0;var _0x2db736=_0x639a[_0x54c08f];return _0x2db736;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba862,_0x2bf30f){_0x2bf30f=_0x2bf30f||0xcc;return function(_0xbd7aec){if(_0xbd7aec){return _0x5ba862['sendStatus'](_0x2bf30f);}return _0x5ba862['status'](_0x2bf30f)[_0xa639('0x1b')]();};}function respondWithResult(_0x1bdc46,_0x4d4b66){_0x4d4b66=_0x4d4b66||0xc8;return function(_0x1df5dd){if(_0x1df5dd){return _0x1bdc46[_0xa639('0x1c')](_0x4d4b66)[_0xa639('0x1d')](_0x1df5dd);}};}function respondWithFilteredResult(_0x49e770,_0xb15138){return function(_0x24f1a9){if(_0x24f1a9){var _0x96a92f=typeof _0xb15138[_0xa639('0x1e')]===_0xa639('0x1f')&&typeof _0xb15138['limit']===_0xa639('0x1f');var _0x4c6311=_0x24f1a9[_0xa639('0x20')];var _0x2e23a9=_0x96a92f?0x0:_0xb15138[_0xa639('0x1e')];var _0x229545=_0x96a92f?_0x24f1a9[_0xa639('0x20')]:_0xb15138['offset']+_0xb15138['limit'];var _0x2a36df;if(_0x229545>=_0x4c6311){_0x229545=_0x4c6311;_0x2a36df=0xc8;}else{_0x2a36df=0xce;}_0x49e770[_0xa639('0x1c')](_0x2a36df);return _0x49e770[_0xa639('0x21')](_0xa639('0x22'),_0x2e23a9+'-'+_0x229545+'/'+_0x4c6311)[_0xa639('0x1d')](_0x24f1a9);}return null;};}function patchUpdates(_0x52500b){return function(_0x5a939f){try{jsonpatch[_0xa639('0x23')](_0x5a939f,_0x52500b,!![]);}catch(_0x5d732c){return BPromise['reject'](_0x5d732c);}return _0x5a939f['save']();};}function saveUpdates(_0x43f85f,_0x28a11c){return function(_0x13592d){if(_0x13592d){return _0x13592d['update'](_0x43f85f)[_0xa639('0x24')](function(_0x562d03){return _0x562d03;});}return null;};}function removeEntity(_0xe89eb9,_0x351a33){return function(_0x55189d){if(_0x55189d){return _0x55189d['destroy']()['then'](function(){var _0x2aeae7=_0x55189d['get']({'plain':!![]});var _0x42b5d8=_0xa639('0x25');return db[_0xa639('0x26')][_0xa639('0x27')]({'where':{'type':_0x42b5d8,'resourceId':_0x2aeae7['id']}})['then'](function(){return _0x55189d;});})[_0xa639('0x24')](function(){_0xe89eb9[_0xa639('0x1c')](0xcc)[_0xa639('0x1b')]();});}};}function handleEntityNotFound(_0x9187a1,_0x3a5dcb){return function(_0x398055){if(!_0x398055){_0x9187a1[_0xa639('0x28')](0x194);}return _0x398055;};}function handleError(_0x48ed86,_0x46caf2){_0x46caf2=_0x46caf2||0x1f4;return function(_0x3cda24){logger['error'](_0x3cda24[_0xa639('0x29')]);if(_0x3cda24[_0xa639('0x2a')]){delete _0x3cda24[_0xa639('0x2a')];}_0x48ed86[_0xa639('0x1c')](_0x46caf2)[_0xa639('0x2b')](_0x3cda24);};}exports['index']=function(_0xd3b825,_0x3e249c){var _0x4e1fc8={},_0x390229={},_0x252b62={'count':0x0,'rows':[]};var _0x39abe7=_[_0xa639('0x2c')](db[_0xa639('0x2d')][_0xa639('0x2e')],function(_0x160d88){return{'name':_0x160d88[_0xa639('0x2f')],'type':_0x160d88['type'][_0xa639('0x30')]};});_0x390229['model']=_[_0xa639('0x2c')](_0x39abe7,_0xa639('0x2a'));_0x390229['query']=_[_0xa639('0x31')](_0xd3b825['query']);_0x390229[_0xa639('0x32')]=_['intersection'](_0x390229[_0xa639('0x33')],_0x390229[_0xa639('0x34')]);_0x4e1fc8[_0xa639('0x35')]=_['intersection'](_0x390229[_0xa639('0x33')],qs[_0xa639('0x36')](_0xd3b825[_0xa639('0x34')][_0xa639('0x36')]));_0x4e1fc8[_0xa639('0x35')]=_0x4e1fc8[_0xa639('0x35')][_0xa639('0x37')]?_0x4e1fc8[_0xa639('0x35')]:_0x390229['model'];if(!_0xd3b825[_0xa639('0x34')]['hasOwnProperty'](_0xa639('0x38'))){_0x4e1fc8[_0xa639('0x39')]=qs['limit'](_0xd3b825[_0xa639('0x34')][_0xa639('0x39')]);_0x4e1fc8[_0xa639('0x1e')]=qs['offset'](_0xd3b825['query'][_0xa639('0x1e')]);}_0x4e1fc8[_0xa639('0x3a')]=qs['sort'](_0xd3b825['query'][_0xa639('0x3b')]);_0x4e1fc8[_0xa639('0x3c')]=qs['filters'](_['pick'](_0xd3b825['query'],_0x390229['filters']),_0x39abe7);if(_0xd3b825[_0xa639('0x34')]['filter']){_0x4e1fc8[_0xa639('0x3c')]=_[_0xa639('0x3d')](_0x4e1fc8[_0xa639('0x3c')],{'$or':_['map'](_0x39abe7,function(_0x4dda49){if(_0x4dda49[_0xa639('0x3e')]!=='VIRTUAL'){var _0x378c5a={};_0x378c5a[_0x4dda49[_0xa639('0x2a')]]={'$like':'%'+_0xd3b825[_0xa639('0x34')][_0xa639('0x3f')]+'%'};return _0x378c5a;}})});}_0x4e1fc8=_[_0xa639('0x3d')]({},_0x4e1fc8,_0xd3b825['options']);var _0x2fd6d3={'where':_0x4e1fc8[_0xa639('0x3c')]};return db[_0xa639('0x2d')][_0xa639('0x20')](_0x2fd6d3)[_0xa639('0x24')](function(_0x4ab7e2){_0x252b62['count']=_0x4ab7e2;if(_0xd3b825[_0xa639('0x34')][_0xa639('0x40')]){_0x4e1fc8['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa639('0x41')](_0x4e1fc8);})[_0xa639('0x24')](function(_0x32805c){_0x252b62[_0xa639('0x42')]=_0x32805c;return _0x252b62;})[_0xa639('0x24')](respondWithFilteredResult(_0x3e249c,_0x4e1fc8))[_0xa639('0x43')](handleError(_0x3e249c,null));};exports[_0xa639('0x44')]=function(_0x288401,_0x3b72c3){var _0x4c93ee={'raw':![],'where':{'id':_0x288401[_0xa639('0x45')]['id']}},_0x1e4f3a={};_0x1e4f3a[_0xa639('0x33')]=_[_0xa639('0x31')](db[_0xa639('0x2d')][_0xa639('0x2e')]);_0x1e4f3a[_0xa639('0x34')]=_['keys'](_0x288401[_0xa639('0x34')]);_0x1e4f3a[_0xa639('0x32')]=_[_0xa639('0x46')](_0x1e4f3a['model'],_0x1e4f3a['query']);_0x4c93ee['attributes']=_[_0xa639('0x46')](_0x1e4f3a['model'],qs[_0xa639('0x36')](_0x288401[_0xa639('0x34')][_0xa639('0x36')]));_0x4c93ee[_0xa639('0x35')]=_0x4c93ee[_0xa639('0x35')][_0xa639('0x37')]?_0x4c93ee[_0xa639('0x35')]:_0x1e4f3a[_0xa639('0x33')];if(_0x288401[_0xa639('0x34')][_0xa639('0x40')]){_0x4c93ee[_0xa639('0x47')]=[{'all':!![]}];}_0x4c93ee=_[_0xa639('0x3d')]({},_0x4c93ee,_0x288401['options']);return db[_0xa639('0x2d')][_0xa639('0x48')](_0x4c93ee)[_0xa639('0x24')](handleEntityNotFound(_0x3b72c3,null))[_0xa639('0x24')](respondWithResult(_0x3b72c3,null))[_0xa639('0x43')](handleError(_0x3b72c3,null));};exports[_0xa639('0x49')]=function(_0x5b3be2,_0x1532ac){return db['VoiceChanSpy'][_0xa639('0x49')](_0x5b3be2[_0xa639('0x4a')],{})['then'](function(_0x46dbd9){var _0x4e3ac9=_0x5b3be2[_0xa639('0x4b')][_0xa639('0x4c')]({'plain':!![]});if(!_0x4e3ac9)throw new Error(_0xa639('0x4d'));if(_0x4e3ac9[_0xa639('0x4e')]===_0xa639('0x4b')){var _0x4dde6c=_0x46dbd9['get']({'plain':!![]});var _0x3d0fef='ChanSpies';return db[_0xa639('0x4f')][_0xa639('0x48')]({'where':{'name':_0x3d0fef,'userProfileId':_0x4e3ac9[_0xa639('0x50')]},'raw':!![]})['then'](function(_0x3e1a96){if(_0x3e1a96&&_0x3e1a96[_0xa639('0x51')]===0x0){return db[_0xa639('0x26')]['create']({'name':_0x4dde6c[_0xa639('0x2a')],'resourceId':_0x4dde6c['id'],'type':_0x3e1a96[_0xa639('0x2a')],'sectionId':_0x3e1a96['id']},{})['then'](function(){return _0x46dbd9;});}else{return _0x46dbd9;}})[_0xa639('0x43')](function(_0x14457c){logger[_0xa639('0x52')](_0xa639('0x53'),_0x14457c);throw _0x14457c;});}return _0x46dbd9;})[_0xa639('0x24')](respondWithResult(_0x1532ac,0xc9))[_0xa639('0x43')](handleError(_0x1532ac,null));};exports[_0xa639('0x54')]=function(_0x24b37e,_0x37e7b2){if(_0x24b37e['body']['id']){delete _0x24b37e[_0xa639('0x4a')]['id'];}return db[_0xa639('0x2d')][_0xa639('0x48')]({'where':{'id':_0x24b37e['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x37e7b2,null))[_0xa639('0x24')](saveUpdates(_0x24b37e[_0xa639('0x4a')],null))[_0xa639('0x24')](respondWithResult(_0x37e7b2,null))['catch'](handleError(_0x37e7b2,null));};exports[_0xa639('0x27')]=function(_0x46a393,_0x599af5){return db[_0xa639('0x2d')]['find']({'where':{'id':_0x46a393[_0xa639('0x45')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x599af5,null))['then'](removeEntity(_0x599af5,null))['catch'](handleError(_0x599af5,null));}; \ No newline at end of file +var _0x8fcf=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','ChanSpies','UserProfileResource','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','util'];(function(_0xf563ca,_0x344253){var _0x39ede2=function(_0x295999){while(--_0x295999){_0xf563ca['push'](_0xf563ca['shift']());}};_0x39ede2(++_0x344253);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x6165ca,_0xd5fb61){_0x6165ca=_0x6165ca-0x0;var _0x453206=_0x8fcf[_0x6165ca];return _0x453206;};'use strict';var emlformat=require(_0xf8fc('0x0'));var rimraf=require(_0xf8fc('0x1'));var zipdir=require(_0xf8fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf8fc('0x4'));var path=require(_0xf8fc('0x5'));var sox=require(_0xf8fc('0x6'));var csv=require(_0xf8fc('0x7'));var ejs=require(_0xf8fc('0x8'));var fs=require('fs');var fs_extra=require(_0xf8fc('0x9'));var _=require(_0xf8fc('0xa'));var squel=require(_0xf8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xf8fc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf8fc('0x7'));var querystring=require(_0xf8fc('0xd'));var Papa=require(_0xf8fc('0xe'));var Redis=require(_0xf8fc('0xf'));var authService=require(_0xf8fc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf8fc('0x11'));var hardwareService=require(_0xf8fc('0x12'));var logger=require('../../config/logger')(_0xf8fc('0x13'));var utils=require(_0xf8fc('0x14'));var config=require(_0xf8fc('0x15'));var licenseUtil=require(_0xf8fc('0x16'));var db=require(_0xf8fc('0x17'))['db'];function respondWithStatusCode(_0x21635e,_0x5714e2){_0x5714e2=_0x5714e2||0xcc;return function(_0x4591a8){if(_0x4591a8){return _0x21635e[_0xf8fc('0x18')](_0x5714e2);}return _0x21635e[_0xf8fc('0x19')](_0x5714e2)[_0xf8fc('0x1a')]();};}function respondWithResult(_0x58a6ee,_0x5f1cc6){_0x5f1cc6=_0x5f1cc6||0xc8;return function(_0x512e4b){if(_0x512e4b){return _0x58a6ee['status'](_0x5f1cc6)[_0xf8fc('0x1b')](_0x512e4b);}};}function respondWithFilteredResult(_0x34c6f7,_0x210078){return function(_0x419930){if(_0x419930){var _0x2742e4=typeof _0x210078['offset']===_0xf8fc('0x1c')&&typeof _0x210078[_0xf8fc('0x1d')]===_0xf8fc('0x1c');var _0x2829f7=_0x419930[_0xf8fc('0x1e')];var _0xe2770c=_0x2742e4?0x0:_0x210078[_0xf8fc('0x1f')];var _0x396cf5=_0x2742e4?_0x419930[_0xf8fc('0x1e')]:_0x210078[_0xf8fc('0x1f')]+_0x210078[_0xf8fc('0x1d')];var _0x4a0907;if(_0x396cf5>=_0x2829f7){_0x396cf5=_0x2829f7;_0x4a0907=0xc8;}else{_0x4a0907=0xce;}_0x34c6f7['status'](_0x4a0907);return _0x34c6f7[_0xf8fc('0x20')](_0xf8fc('0x21'),_0xe2770c+'-'+_0x396cf5+'/'+_0x2829f7)[_0xf8fc('0x1b')](_0x419930);}return null;};}function patchUpdates(_0x4a4cfa){return function(_0x3816d3){try{jsonpatch['apply'](_0x3816d3,_0x4a4cfa,!![]);}catch(_0x197912){return BPromise[_0xf8fc('0x22')](_0x197912);}return _0x3816d3[_0xf8fc('0x23')]();};}function saveUpdates(_0x56ea0f,_0x9965ab){return function(_0x17dca8){if(_0x17dca8){return _0x17dca8[_0xf8fc('0x24')](_0x56ea0f)[_0xf8fc('0x25')](function(_0x2e700b){return _0x2e700b;});}return null;};}function removeEntity(_0x529d68,_0x4e0ea1){return function(_0x5de910){if(_0x5de910){return _0x5de910[_0xf8fc('0x26')]()[_0xf8fc('0x25')](function(){var _0x55b415=_0x5de910['get']({'plain':!![]});var _0x429b7a=_0xf8fc('0x27');return db[_0xf8fc('0x28')][_0xf8fc('0x26')]({'where':{'type':_0x429b7a,'resourceId':_0x55b415['id']}})[_0xf8fc('0x25')](function(){return _0x5de910;});})[_0xf8fc('0x25')](function(){_0x529d68[_0xf8fc('0x19')](0xcc)[_0xf8fc('0x1a')]();});}};}function handleEntityNotFound(_0x2322fa,_0x3c538d){return function(_0x47c92c){if(!_0x47c92c){_0x2322fa[_0xf8fc('0x18')](0x194);}return _0x47c92c;};}function handleError(_0x3520d3,_0x3400ca){_0x3400ca=_0x3400ca||0x1f4;return function(_0x456cc1){logger['error'](_0x456cc1[_0xf8fc('0x29')]);if(_0x456cc1['name']){delete _0x456cc1[_0xf8fc('0x2a')];}_0x3520d3[_0xf8fc('0x19')](_0x3400ca)['send'](_0x456cc1);};}exports[_0xf8fc('0x2b')]=function(_0x32b6e1,_0x5826c1){var _0x3edb6f={},_0x51918b={},_0x3688eb={'count':0x0,'rows':[]};var _0x248932=_[_0xf8fc('0x2c')](db[_0xf8fc('0x2d')][_0xf8fc('0x2e')],function(_0x11a1d3){return{'name':_0x11a1d3[_0xf8fc('0x2f')],'type':_0x11a1d3[_0xf8fc('0x30')]['key']};});_0x51918b['model']=_[_0xf8fc('0x2c')](_0x248932,_0xf8fc('0x2a'));_0x51918b[_0xf8fc('0x31')]=_[_0xf8fc('0x32')](_0x32b6e1[_0xf8fc('0x31')]);_0x51918b[_0xf8fc('0x33')]=_[_0xf8fc('0x34')](_0x51918b[_0xf8fc('0x35')],_0x51918b[_0xf8fc('0x31')]);_0x3edb6f[_0xf8fc('0x36')]=_[_0xf8fc('0x34')](_0x51918b[_0xf8fc('0x35')],qs[_0xf8fc('0x37')](_0x32b6e1[_0xf8fc('0x31')]['fields']));_0x3edb6f[_0xf8fc('0x36')]=_0x3edb6f['attributes']['length']?_0x3edb6f[_0xf8fc('0x36')]:_0x51918b['model'];if(!_0x32b6e1[_0xf8fc('0x31')]['hasOwnProperty']('nolimit')){_0x3edb6f[_0xf8fc('0x1d')]=qs[_0xf8fc('0x1d')](_0x32b6e1[_0xf8fc('0x31')][_0xf8fc('0x1d')]);_0x3edb6f[_0xf8fc('0x1f')]=qs[_0xf8fc('0x1f')](_0x32b6e1[_0xf8fc('0x31')][_0xf8fc('0x1f')]);}_0x3edb6f['order']=qs['sort'](_0x32b6e1['query'][_0xf8fc('0x38')]);_0x3edb6f[_0xf8fc('0x39')]=qs[_0xf8fc('0x33')](_['pick'](_0x32b6e1[_0xf8fc('0x31')],_0x51918b['filters']),_0x248932);if(_0x32b6e1['query'][_0xf8fc('0x3a')]){_0x3edb6f[_0xf8fc('0x39')]=_[_0xf8fc('0x3b')](_0x3edb6f[_0xf8fc('0x39')],{'$or':_[_0xf8fc('0x2c')](_0x248932,function(_0x39ac5a){if(_0x39ac5a[_0xf8fc('0x30')]!==_0xf8fc('0x3c')){var _0x2b946f={};_0x2b946f[_0x39ac5a[_0xf8fc('0x2a')]]={'$like':'%'+_0x32b6e1['query'][_0xf8fc('0x3a')]+'%'};return _0x2b946f;}})});}_0x3edb6f=_[_0xf8fc('0x3b')]({},_0x3edb6f,_0x32b6e1[_0xf8fc('0x3d')]);var _0xc424c9={'where':_0x3edb6f[_0xf8fc('0x39')]};return db[_0xf8fc('0x2d')][_0xf8fc('0x1e')](_0xc424c9)[_0xf8fc('0x25')](function(_0x55f45b){_0x3688eb[_0xf8fc('0x1e')]=_0x55f45b;if(_0x32b6e1[_0xf8fc('0x31')][_0xf8fc('0x3e')]){_0x3edb6f[_0xf8fc('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xf8fc('0x40')](_0x3edb6f);})[_0xf8fc('0x25')](function(_0x41b835){_0x3688eb[_0xf8fc('0x41')]=_0x41b835;return _0x3688eb;})['then'](respondWithFilteredResult(_0x5826c1,_0x3edb6f))['catch'](handleError(_0x5826c1,null));};exports[_0xf8fc('0x42')]=function(_0x17d5be,_0x5ec48b){var _0x3784c4={'raw':![],'where':{'id':_0x17d5be[_0xf8fc('0x43')]['id']}},_0x1ce9d0={};_0x1ce9d0[_0xf8fc('0x35')]=_['keys'](db[_0xf8fc('0x2d')][_0xf8fc('0x2e')]);_0x1ce9d0[_0xf8fc('0x31')]=_[_0xf8fc('0x32')](_0x17d5be[_0xf8fc('0x31')]);_0x1ce9d0['filters']=_[_0xf8fc('0x34')](_0x1ce9d0[_0xf8fc('0x35')],_0x1ce9d0['query']);_0x3784c4[_0xf8fc('0x36')]=_[_0xf8fc('0x34')](_0x1ce9d0['model'],qs[_0xf8fc('0x37')](_0x17d5be[_0xf8fc('0x31')][_0xf8fc('0x37')]));_0x3784c4[_0xf8fc('0x36')]=_0x3784c4['attributes'][_0xf8fc('0x44')]?_0x3784c4[_0xf8fc('0x36')]:_0x1ce9d0[_0xf8fc('0x35')];if(_0x17d5be[_0xf8fc('0x31')][_0xf8fc('0x3e')]){_0x3784c4['include']=[{'all':!![]}];}_0x3784c4=_[_0xf8fc('0x3b')]({},_0x3784c4,_0x17d5be[_0xf8fc('0x3d')]);return db[_0xf8fc('0x2d')][_0xf8fc('0x45')](_0x3784c4)[_0xf8fc('0x25')](handleEntityNotFound(_0x5ec48b,null))[_0xf8fc('0x25')](respondWithResult(_0x5ec48b,null))[_0xf8fc('0x46')](handleError(_0x5ec48b,null));};exports['create']=function(_0x39f4e3,_0x3d2d1e){return db[_0xf8fc('0x2d')][_0xf8fc('0x47')](_0x39f4e3[_0xf8fc('0x48')],{})[_0xf8fc('0x25')](function(_0x6216b2){var _0xa995ef=_0x39f4e3[_0xf8fc('0x49')][_0xf8fc('0x4a')]({'plain':!![]});if(!_0xa995ef)throw new Error(_0xf8fc('0x4b'));if(_0xa995ef[_0xf8fc('0x4c')]===_0xf8fc('0x49')){var _0x4d08ec=_0x6216b2[_0xf8fc('0x4a')]({'plain':!![]});var _0x754588='ChanSpies';return db['UserProfileSection'][_0xf8fc('0x45')]({'where':{'name':_0x754588,'userProfileId':_0xa995ef[_0xf8fc('0x4d')]},'raw':!![]})[_0xf8fc('0x25')](function(_0x408330){if(_0x408330&&_0x408330[_0xf8fc('0x4e')]===0x0){return db[_0xf8fc('0x28')][_0xf8fc('0x47')]({'name':_0x4d08ec[_0xf8fc('0x2a')],'resourceId':_0x4d08ec['id'],'type':_0x408330[_0xf8fc('0x2a')],'sectionId':_0x408330['id']},{})[_0xf8fc('0x25')](function(){return _0x6216b2;});}else{return _0x6216b2;}})[_0xf8fc('0x46')](function(_0x22b4ec){logger['error'](_0xf8fc('0x4f'),_0x22b4ec);throw _0x22b4ec;});}return _0x6216b2;})[_0xf8fc('0x25')](respondWithResult(_0x3d2d1e,0xc9))[_0xf8fc('0x46')](handleError(_0x3d2d1e,null));};exports[_0xf8fc('0x24')]=function(_0x3d8285,_0x38db58){if(_0x3d8285[_0xf8fc('0x48')]['id']){delete _0x3d8285[_0xf8fc('0x48')]['id'];}return db[_0xf8fc('0x2d')][_0xf8fc('0x45')]({'where':{'id':_0x3d8285['params']['id']}})[_0xf8fc('0x25')](handleEntityNotFound(_0x38db58,null))['then'](saveUpdates(_0x3d8285['body'],null))[_0xf8fc('0x25')](respondWithResult(_0x38db58,null))['catch'](handleError(_0x38db58,null));};exports[_0xf8fc('0x26')]=function(_0x130105,_0x16af7a){return db[_0xf8fc('0x2d')][_0xf8fc('0x45')]({'where':{'id':_0x130105['params']['id']}})['then'](handleEntityNotFound(_0x16af7a,null))[_0xf8fc('0x25')](removeEntity(_0x16af7a,null))['catch'](handleError(_0x16af7a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8e45790..474d7f4 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 _0xe646=['voice_chanspy','then','bulkCreate','VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','recordingFormat','Authenticate','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','findAll','agent','catch','exports','models','define'];(function(_0x488c02,_0x556605){var _0x3cad29=function(_0x3b3146){while(--_0x3b3146){_0x488c02['push'](_0x488c02['shift']());}};_0x3cad29(++_0x556605);}(_0xe646,0x191));var _0x6e64=function(_0x24f7ce,_0x51322a){_0x24f7ce=_0x24f7ce-0x0;var _0x3e910d=_0xe646[_0x24f7ce];return _0x3e910d;};'use strict';var _=require(_0x6e64('0x0'));var util=require('util');var BPromise=require(_0x6e64('0x1'));var attributes=require(_0x6e64('0x2'));var getUserApplications=function(_0x45e6a0,_0x4ec8f6,_0x28eb7f){var _0x59be75=0x1;var _0x106a71=[];var _0x132728={'context':_0x4ec8f6[_0x6e64('0x3')]||_0x6e64('0x4'),'exten':util['format']('%s%s',_0x45e6a0[_0x6e64('0x5')],_0x28eb7f),'type':_0x6e64('0x6'),'isApp':![],'ChanSpyId':_0x45e6a0['id'],'UserId':_0x4ec8f6['id']};_0x106a71[_0x6e64('0x7')](_[_0x6e64('0x8')]({'app':_0x6e64('0x9'),'appdata':util[_0x6e64('0xa')](_0x6e64('0xb'),_0x6e64('0xc')),'priority':_0x59be75++},_0x132728));if(_0x45e6a0[_0x6e64('0xd')]){_0x106a71[_0x6e64('0x7')](_[_0x6e64('0x8')]({'app':'MixMonitor','appdata':util[_0x6e64('0xa')]('${UNIQUEID}.%s,a',_0x45e6a0[_0x6e64('0xe')]),'priority':_0x59be75++},_0x132728));}if(_0x45e6a0['auth']){_0x106a71[_0x6e64('0x7')](_[_0x6e64('0x8')]({'app':_0x6e64('0xf'),'appdata':_0x45e6a0['password'],'priority':_0x59be75++},_0x132728));}_0x106a71[_0x6e64('0x7')](_[_0x6e64('0x8')]({'app':'ChanSpy','appdata':util[_0x6e64('0xa')](_0x6e64('0x10'),_0x4ec8f6[_0x6e64('0x11')],_0x45e6a0[_0x6e64('0x12')]?_0x45e6a0[_0x6e64('0x12')][_0x6e64('0x13')](''):''),'priority':_0x59be75++},_0x132728));if(_0x45e6a0['record']){_0x106a71[_0x6e64('0x7')](_[_0x6e64('0x8')]({'app':_0x6e64('0x14'),'priority':_0x59be75++},_0x132728));}return _0x106a71;};var getChanSpyApplications=function(_0x3aa268,_0x49b1b1){var _0x717f1b=[];for(var _0x202f6c=0x0,_0x1fd357=0x1;_0x202f6c<_0x49b1b1[_0x6e64('0x15')];_0x202f6c++,_0x1fd357=0x1){_0x717f1b=_0x717f1b['concat'](getUserApplications(_0x3aa268,_0x49b1b1[_0x202f6c],_0x49b1b1[_0x202f6c][_0x6e64('0x16')]));if(_0x49b1b1[_0x202f6c]['internal']!=_0x49b1b1[_0x202f6c][_0x6e64('0x11')]){_0x717f1b=_0x717f1b[_0x6e64('0x17')](getUserApplications(_0x3aa268,_0x49b1b1[_0x202f6c],_0x49b1b1[_0x202f6c][_0x6e64('0x11')]));}}return _0x717f1b;};var getChanSpyPromise=function(_0x48a6d6,_0x400adf){return new BPromise(function(_0x452a05,_0x10c2c9){return _0x48a6d6[_0x6e64('0x18')][_0x6e64('0x19')]({'attributes':['id',_0x6e64('0x11'),'internal'],'where':{'role':_0x6e64('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x174743){if(_0x174743){return _0x452a05(getChanSpyApplications(_0x400adf,_0x174743));}return _0x452a05([]);})[_0x6e64('0x1b')](function(_0x4b5107){_0x10c2c9(_0x4b5107);});});};module[_0x6e64('0x1c')]=function(_0x3226b5,_0x2e67f6){var _0x313fa1=_0x3226b5[_0x6e64('0x1d')];return _0x3226b5[_0x6e64('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x6e64('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e87e4,_0x2094fe,_0x2e42f6){return getChanSpyPromise(_0x313fa1,_0x5e87e4)[_0x6e64('0x20')](function(_0x2e2889){if(_0x2e2889&&_0x2e2889[_0x6e64('0x15')]){return _0x313fa1['VoiceExtension'][_0x6e64('0x21')](_0x2e2889);}})[_0x6e64('0x20')](function(){_0x2e42f6();})[_0x6e64('0x1b')](function(_0x556b7a){_0x2e42f6(_0x556b7a);});},'afterUpdate':function(_0xaac5ba,_0x16ed55,_0x189d34){return _0x313fa1['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0xaac5ba['id']}})['then'](function(){return getChanSpyPromise(_0x313fa1,_0xaac5ba);})[_0x6e64('0x20')](function(_0x423789){if(_0x423789&&_0x423789[_0x6e64('0x15')]){return _0x313fa1[_0x6e64('0x22')][_0x6e64('0x21')](_0x423789);}})[_0x6e64('0x20')](function(){_0x189d34();})[_0x6e64('0x1b')](function(_0x1ced2d){_0x189d34(_0x1ced2d);});},'afterDestroy':function(_0x1d150a,_0x4a57ce,_0x3404e8){return _0x313fa1[_0x6e64('0x22')][_0x6e64('0x23')]({'where':{'ChanSpyId':_0x1d150a['id']}})[_0x6e64('0x20')](function(){_0x3404e8();})[_0x6e64('0x1b')](function(_0x1e7115){_0x3404e8(_0x1e7115);});}}});}; \ No newline at end of file +var _0xd276=['voice_chanspy','length','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','concat','internal','User','findAll','then','catch','exports','models','VoiceChanSpy'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xd276,0x1cd));var _0x6d27=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xd276[_0x43b584];return _0x48f27b;};'use strict';var _=require('lodash');var util=require(_0x6d27('0x0'));var BPromise=require(_0x6d27('0x1'));var attributes=require(_0x6d27('0x2'));var getUserApplications=function(_0x2bc3a7,_0x59b10b,_0x1fe4cd){var _0x16ee49=0x1;var _0x22a72d=[];var _0x4f268a={'context':_0x59b10b[_0x6d27('0x3')]||_0x6d27('0x4'),'exten':util[_0x6d27('0x5')](_0x6d27('0x6'),_0x2bc3a7['prefix'],_0x1fe4cd),'type':_0x6d27('0x7'),'isApp':![],'ChanSpyId':_0x2bc3a7['id'],'UserId':_0x59b10b['id']};_0x22a72d[_0x6d27('0x8')](_[_0x6d27('0x9')]({'app':'Set','appdata':util['format'](_0x6d27('0xa'),_0x6d27('0xb')),'priority':_0x16ee49++},_0x4f268a));if(_0x2bc3a7['record']){_0x22a72d[_0x6d27('0x8')](_[_0x6d27('0x9')]({'app':_0x6d27('0xc'),'appdata':util[_0x6d27('0x5')](_0x6d27('0xd'),_0x2bc3a7[_0x6d27('0xe')]),'priority':_0x16ee49++},_0x4f268a));}if(_0x2bc3a7[_0x6d27('0xf')]){_0x22a72d[_0x6d27('0x8')](_[_0x6d27('0x9')]({'app':_0x6d27('0x10'),'appdata':_0x2bc3a7[_0x6d27('0x11')],'priority':_0x16ee49++},_0x4f268a));}_0x22a72d[_0x6d27('0x8')](_['merge']({'app':_0x6d27('0x12'),'appdata':util[_0x6d27('0x5')](_0x6d27('0x13'),_0x59b10b[_0x6d27('0x14')],_0x2bc3a7[_0x6d27('0x15')]?_0x2bc3a7['options'][_0x6d27('0x16')](''):''),'priority':_0x16ee49++},_0x4f268a));if(_0x2bc3a7[_0x6d27('0x17')]){_0x22a72d[_0x6d27('0x8')](_[_0x6d27('0x9')]({'app':'StopMixMonitor','priority':_0x16ee49++},_0x4f268a));}return _0x22a72d;};var getChanSpyApplications=function(_0x5d43a0,_0x54d551){var _0x244b46=[];for(var _0x1b9baa=0x0,_0xb67223=0x1;_0x1b9baa<_0x54d551['length'];_0x1b9baa++,_0xb67223=0x1){_0x244b46=_0x244b46[_0x6d27('0x18')](getUserApplications(_0x5d43a0,_0x54d551[_0x1b9baa],_0x54d551[_0x1b9baa][_0x6d27('0x19')]));if(_0x54d551[_0x1b9baa][_0x6d27('0x19')]!=_0x54d551[_0x1b9baa][_0x6d27('0x14')]){_0x244b46=_0x244b46[_0x6d27('0x18')](getUserApplications(_0x5d43a0,_0x54d551[_0x1b9baa],_0x54d551[_0x1b9baa][_0x6d27('0x14')]));}}return _0x244b46;};var getChanSpyPromise=function(_0x4c5790,_0x1ff1af){return new BPromise(function(_0x2f1e04,_0x7acd3f){return _0x4c5790[_0x6d27('0x1a')][_0x6d27('0x1b')]({'attributes':['id',_0x6d27('0x14'),_0x6d27('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x6d27('0x1c')](function(_0x232c92){if(_0x232c92){return _0x2f1e04(getChanSpyApplications(_0x1ff1af,_0x232c92));}return _0x2f1e04([]);})[_0x6d27('0x1d')](function(_0x25f5da){_0x7acd3f(_0x25f5da);});});};module[_0x6d27('0x1e')]=function(_0x4bed50,_0x35213e){var _0x526429=_0x4bed50[_0x6d27('0x1f')];return _0x4bed50['define'](_0x6d27('0x20'),attributes,{'tableName':_0x6d27('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xaadd9b,_0x7d5cb6,_0x1a63c0){return getChanSpyPromise(_0x526429,_0xaadd9b)[_0x6d27('0x1c')](function(_0x24ff11){if(_0x24ff11&&_0x24ff11[_0x6d27('0x22')]){return _0x526429[_0x6d27('0x23')][_0x6d27('0x24')](_0x24ff11);}})[_0x6d27('0x1c')](function(){_0x1a63c0();})['catch'](function(_0x27e5cc){_0x1a63c0(_0x27e5cc);});},'afterUpdate':function(_0x3a860e,_0x1bd20f,_0x166113){return _0x526429[_0x6d27('0x23')][_0x6d27('0x25')]({'where':{'ChanSpyId':_0x3a860e['id']}})['then'](function(){return getChanSpyPromise(_0x526429,_0x3a860e);})[_0x6d27('0x1c')](function(_0x4f984e){if(_0x4f984e&&_0x4f984e[_0x6d27('0x22')]){return _0x526429[_0x6d27('0x23')][_0x6d27('0x24')](_0x4f984e);}})['then'](function(){_0x166113();})[_0x6d27('0x1d')](function(_0x4acdd6){_0x166113(_0x4acdd6);});},'afterDestroy':function(_0x7b2454,_0x5055f5,_0x2a7f70){return _0x526429['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x7b2454['id']}})['then'](function(){_0x2a7f70();})[_0x6d27('0x1d')](function(_0x52517c){_0x2a7f70(_0x52517c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 15d771c..bbd3116 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 _0x878f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x562bd3,_0x1f567d){var _0x3d5347=function(_0x5d9063){while(--_0x5d9063){_0x562bd3['push'](_0x562bd3['shift']());}};_0x3d5347(++_0x1f567d);}(_0x878f,0x173));var _0xf878=function(_0x48d642,_0x179383){_0x48d642=_0x48d642-0x0;var _0x1aca0e=_0x878f[_0x48d642];return _0x1aca0e;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});} \ No newline at end of file +var _0x98e5=['request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98e5,0x8a));var _0x598e=function(_0x105702,_0x3d4a6c){_0x105702=_0x105702-0x0;var _0x10ff6b=_0x98e5[_0x105702];return _0x10ff6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x598e('0x0'));var rs=require(_0x598e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x598e('0x2'))['db'];var utils=require(_0x598e('0x3'));var logger=require('../../config/logger')(_0x598e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x598e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4292c3,_0x1fc8b5,_0x10bf8e){return new BPromise(function(_0x3e0212,_0x9dc046){return client[_0x598e('0x6')](_0x4292c3,_0x10bf8e)[_0x598e('0x7')](function(_0x2550b9){logger[_0x598e('0x8')](_0x598e('0x9'),_0x1fc8b5,_0x598e('0xa'));logger['debug'](_0x598e('0xb'),_0x1fc8b5,_0x598e('0xa'),JSON['stringify'](_0x2550b9));if(_0x2550b9[_0x598e('0xc')]){if(_0x2550b9['error'][_0x598e('0xd')]===0x1f4){logger[_0x598e('0xc')](_0x598e('0x9'),_0x1fc8b5,_0x2550b9[_0x598e('0xc')][_0x598e('0xe')]);return _0x9dc046(_0x2550b9['error'][_0x598e('0xe')]);}logger['error'](_0x598e('0x9'),_0x1fc8b5,_0x2550b9[_0x598e('0xc')]['message']);return _0x3e0212(_0x2550b9[_0x598e('0xc')][_0x598e('0xe')]);}else{logger[_0x598e('0x8')](_0x598e('0x9'),_0x1fc8b5,_0x598e('0xa'));_0x3e0212(_0x2550b9[_0x598e('0xf')][_0x598e('0xe')]);}})['catch'](function(_0x9ba324){logger[_0x598e('0xc')](_0x598e('0x9'),_0x1fc8b5,_0x9ba324);_0x9dc046(_0x9ba324);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f8769b6..5e06c76 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 _0x84d2=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x591080,_0x51c610){var _0x21c172=function(_0x2a688e){while(--_0x2a688e){_0x591080['push'](_0x591080['shift']());}};_0x21c172(++_0x51c610);}(_0x84d2,0xcf));var _0x284d=function(_0x3ad619,_0x121015){_0x3ad619=_0x3ad619-0x0;var _0x3a6a69=_0x84d2[_0x3ad619];return _0x3a6a69;};'use strict';var multer=require(_0x284d('0x0'));var util=require(_0x284d('0x1'));var path=require(_0x284d('0x2'));var timeout=require('connect-timeout');var express=require(_0x284d('0x3'));var router=express[_0x284d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x284d('0x5'));var interaction=require(_0x284d('0x6'));var config=require(_0x284d('0x7'));var controller=require(_0x284d('0x8'));router['get']('/',auth[_0x284d('0x9')](),controller[_0x284d('0xa')]);router[_0x284d('0xb')](_0x284d('0xc'),auth[_0x284d('0x9')](),controller[_0x284d('0xd')]);router[_0x284d('0xe')]('/',auth[_0x284d('0x9')](),controller[_0x284d('0xf')]);router[_0x284d('0x10')]('/:id',auth[_0x284d('0x9')](),controller[_0x284d('0x11')]);router[_0x284d('0x12')](_0x284d('0xc'),auth[_0x284d('0x9')](),controller[_0x284d('0x13')]);module[_0x284d('0x14')]=router; \ No newline at end of file +var _0x1344=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','put','delete','destroy','exports'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x1344,0x1b0));var _0x4134=function(_0x3ad2e5,_0x94d414){_0x3ad2e5=_0x3ad2e5-0x0;var _0xc4e565=_0x1344[_0x3ad2e5];return _0xc4e565;};'use strict';var multer=require(_0x4134('0x0'));var util=require('util');var path=require(_0x4134('0x1'));var timeout=require(_0x4134('0x2'));var express=require(_0x4134('0x3'));var router=express['Router']();var fs_extra=require(_0x4134('0x4'));var auth=require(_0x4134('0x5'));var interaction=require(_0x4134('0x6'));var config=require(_0x4134('0x7'));var controller=require(_0x4134('0x8'));router['get']('/',auth[_0x4134('0x9')](),controller[_0x4134('0xa')]);router[_0x4134('0xb')](_0x4134('0xc'),auth[_0x4134('0x9')](),controller[_0x4134('0xd')]);router['post']('/',auth[_0x4134('0x9')](),controller['create']);router[_0x4134('0xe')]('/:id',auth[_0x4134('0x9')](),controller['update']);router[_0x4134('0xf')](_0x4134('0xc'),auth['isAuthenticated'](),controller[_0x4134('0x10')]);module[_0x4134('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6e69916..a4151a4 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 _0xe909=['STRING','name','exports'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xe909,0x1df));var _0x9e90=function(_0x401204,_0x53e4de){_0x401204=_0x401204-0x0;var _0x337b84=_0xe909[_0x401204];return _0x337b84;};'use strict';var Sequelize=require('sequelize');module[_0x9e90('0x0')]={'name':{'type':Sequelize[_0x9e90('0x1')],'unique':_0x9e90('0x2')},'description':{'type':Sequelize[_0x9e90('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x58eb=['sequelize','exports','STRING','BOOLEAN'];(function(_0x58f374,_0x532fc0){var _0x234232=function(_0x41f6fa){while(--_0x41f6fa){_0x58f374['push'](_0x58f374['shift']());}};_0x234232(++_0x532fc0);}(_0x58eb,0x1bc));var _0xb58e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x58eb[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require(_0xb58e('0x0'));module[_0xb58e('0x1')]={'name':{'type':Sequelize[_0xb58e('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xb58e('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb58e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 7ea4a2a..41769ba 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 _0xa34e=['writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','render','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','count','Content-Range','apply','save','update','destroy','then','get','Contexts','UserProfileResource','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','find','readFileSync','join','root','utf8'];(function(_0x315c8a,_0x3551e1){var _0x4f617d=function(_0x254bb7){while(--_0x254bb7){_0x315c8a['push'](_0x315c8a['shift']());}};_0x4f617d(++_0x3551e1);}(_0xa34e,0x19e));var _0xea34=function(_0x15da5f,_0x3fce0e){_0x15da5f=_0x15da5f-0x0;var _0x1992f1=_0xa34e[_0x15da5f];return _0x1992f1;};'use strict';var emlformat=require(_0xea34('0x0'));var rimraf=require(_0xea34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea34('0x2'));var rp=require(_0xea34('0x3'));var moment=require(_0xea34('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xea34('0x5'));var csv=require(_0xea34('0x6'));var ejs=require(_0xea34('0x7'));var fs=require('fs');var fs_extra=require(_0xea34('0x8'));var _=require(_0xea34('0x9'));var squel=require(_0xea34('0xa'));var crypto=require(_0xea34('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xea34('0xc'));var toCsv=require('to-csv');var querystring=require(_0xea34('0xd'));var Papa=require(_0xea34('0xe'));var Redis=require(_0xea34('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea34('0x10'));var hardwareService=require(_0xea34('0x11'));var logger=require(_0xea34('0x12'))(_0xea34('0x13'));var utils=require('../../config/utils');var config=require(_0xea34('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xea34('0x15'));var client=jayson[_0xea34('0x16')][_0xea34('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xfd7f30,_0x44f9da,_0x5bcad6,_0x2fba47){return new BPromise(function(_0x57e1d7,_0x31e320){var _0x2d0a44=_0x2fba47||client;return _0x2d0a44[_0xea34('0x18')](_0xfd7f30,_0x5bcad6)['then'](function(_0x462c23){logger[_0xea34('0x19')]('VoiceContext,\x20%s,\x20%s',_0x44f9da,_0xea34('0x1a'));logger[_0xea34('0x1b')](_0xea34('0x1c'),_0x44f9da,'request\x20sent',JSON[_0xea34('0x1d')](_0x462c23));if(_0x462c23['error']){if(_0x462c23[_0xea34('0x1e')][_0xea34('0x1f')]===0x1f4){logger[_0xea34('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x44f9da,_0x462c23[_0xea34('0x1e')][_0xea34('0x20')]);return _0x31e320(_0x462c23[_0xea34('0x1e')][_0xea34('0x20')]);}logger['error'](_0xea34('0x21'),_0x44f9da,_0x462c23[_0xea34('0x1e')][_0xea34('0x20')]);return _0x57e1d7(_0x462c23[_0xea34('0x1e')]['message']);}else{logger[_0xea34('0x19')](_0xea34('0x21'),_0x44f9da,_0xea34('0x1a'));_0x57e1d7(_0x462c23[_0xea34('0x22')]['message']);}})[_0xea34('0x23')](function(_0x261d55){logger[_0xea34('0x1e')](_0xea34('0x21'),_0x44f9da,_0x261d55);_0x31e320(_0x261d55);});});}function respondWithStatusCode(_0x409b90,_0xb1ad45){_0xb1ad45=_0xb1ad45||0xcc;return function(_0x223547){if(_0x223547){return _0x409b90['sendStatus'](_0xb1ad45);}return _0x409b90[_0xea34('0x24')](_0xb1ad45)[_0xea34('0x25')]();};}function respondWithResult(_0x141577,_0xb5bf97){_0xb5bf97=_0xb5bf97||0xc8;return function(_0x4656f3){if(_0x4656f3){return _0x141577['status'](_0xb5bf97)[_0xea34('0x26')](_0x4656f3);}};}function respondWithFilteredResult(_0x549118,_0x71cb02){return function(_0x2dde30){if(_0x2dde30){var _0x29e4d0=typeof _0x71cb02[_0xea34('0x27')]===_0xea34('0x28')&&typeof _0x71cb02['limit']==='undefined';var _0x56b8a3=_0x2dde30[_0xea34('0x29')];var _0xda6f5c=_0x29e4d0?0x0:_0x71cb02[_0xea34('0x27')];var _0x2baa2e=_0x29e4d0?_0x2dde30[_0xea34('0x29')]:_0x71cb02[_0xea34('0x27')]+_0x71cb02['limit'];var _0x41db90;if(_0x2baa2e>=_0x56b8a3){_0x2baa2e=_0x56b8a3;_0x41db90=0xc8;}else{_0x41db90=0xce;}_0x549118['status'](_0x41db90);return _0x549118['set'](_0xea34('0x2a'),_0xda6f5c+'-'+_0x2baa2e+'/'+_0x56b8a3)[_0xea34('0x26')](_0x2dde30);}return null;};}function patchUpdates(_0x2d875f){return function(_0x4c0888){try{jsonpatch[_0xea34('0x2b')](_0x4c0888,_0x2d875f,!![]);}catch(_0x34cc91){return BPromise['reject'](_0x34cc91);}return _0x4c0888[_0xea34('0x2c')]();};}function saveUpdates(_0xb3417d,_0x5a3c08){return function(_0x3d497c){if(_0x3d497c){return _0x3d497c[_0xea34('0x2d')](_0xb3417d)['then'](function(_0x48e642){return _0x48e642;});}return null;};}function removeEntity(_0x28c9aa,_0x3f1097){return function(_0x123ae4){if(_0x123ae4){return _0x123ae4[_0xea34('0x2e')]()[_0xea34('0x2f')](function(){var _0x2f2cb3=_0x123ae4[_0xea34('0x30')]({'plain':!![]});var _0x4d6ba5=_0xea34('0x31');return db[_0xea34('0x32')][_0xea34('0x2e')]({'where':{'type':_0x4d6ba5,'resourceId':_0x2f2cb3['id']}})[_0xea34('0x2f')](function(){return _0x123ae4;});})[_0xea34('0x2f')](function(){_0x28c9aa[_0xea34('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea4b4,_0x22bd4a){return function(_0x476b35){if(!_0x476b35){_0x1ea4b4[_0xea34('0x33')](0x194);}return _0x476b35;};}function handleError(_0x4d0a4b,_0x9ed34e){_0x9ed34e=_0x9ed34e||0x1f4;return function(_0x4e2a50){logger['error'](_0x4e2a50['stack']);if(_0x4e2a50[_0xea34('0x34')]){delete _0x4e2a50[_0xea34('0x34')];}_0x4d0a4b[_0xea34('0x24')](_0x9ed34e)[_0xea34('0x35')](_0x4e2a50);};}exports[_0xea34('0x36')]=function(_0x4433ad,_0x23410f){var _0x87e209={},_0x50216a={},_0x55833d={'count':0x0,'rows':[]};var _0x53c6ca=_[_0xea34('0x37')](db[_0xea34('0x38')][_0xea34('0x39')],function(_0x53c739){return{'name':_0x53c739[_0xea34('0x3a')],'type':_0x53c739['type'][_0xea34('0x3b')]};});_0x50216a[_0xea34('0x3c')]=_[_0xea34('0x37')](_0x53c6ca,_0xea34('0x34'));_0x50216a['query']=_['keys'](_0x4433ad['query']);_0x50216a[_0xea34('0x3d')]=_['intersection'](_0x50216a['model'],_0x50216a['query']);_0x87e209['attributes']=_[_0xea34('0x3e')](_0x50216a[_0xea34('0x3c')],qs[_0xea34('0x3f')](_0x4433ad[_0xea34('0x40')][_0xea34('0x3f')]));_0x87e209[_0xea34('0x41')]=_0x87e209[_0xea34('0x41')][_0xea34('0x42')]?_0x87e209[_0xea34('0x41')]:_0x50216a[_0xea34('0x3c')];if(!_0x4433ad[_0xea34('0x40')][_0xea34('0x43')](_0xea34('0x44'))){_0x87e209[_0xea34('0x45')]=qs[_0xea34('0x45')](_0x4433ad['query'][_0xea34('0x45')]);_0x87e209[_0xea34('0x27')]=qs[_0xea34('0x27')](_0x4433ad['query']['offset']);}_0x87e209['order']=qs[_0xea34('0x46')](_0x4433ad['query'][_0xea34('0x46')]);_0x87e209['where']=qs[_0xea34('0x3d')](_['pick'](_0x4433ad[_0xea34('0x40')],_0x50216a[_0xea34('0x3d')]),_0x53c6ca);if(_0x4433ad[_0xea34('0x40')][_0xea34('0x47')]){_0x87e209[_0xea34('0x48')]=_[_0xea34('0x49')](_0x87e209[_0xea34('0x48')],{'$or':_[_0xea34('0x37')](_0x53c6ca,function(_0x6d455d){if(_0x6d455d['type']!==_0xea34('0x4a')){var _0x28a58e={};_0x28a58e[_0x6d455d[_0xea34('0x34')]]={'$like':'%'+_0x4433ad[_0xea34('0x40')][_0xea34('0x47')]+'%'};return _0x28a58e;}})});}_0x87e209=_['merge']({},_0x87e209,_0x4433ad[_0xea34('0x4b')]);var _0x4650ca={'where':_0x87e209[_0xea34('0x48')]};return db[_0xea34('0x38')][_0xea34('0x29')](_0x4650ca)[_0xea34('0x2f')](function(_0x26ea97){_0x55833d[_0xea34('0x29')]=_0x26ea97;if(_0x4433ad[_0xea34('0x40')]['includeAll']){_0x87e209[_0xea34('0x4c')]=[{'all':!![]}];}return db[_0xea34('0x38')][_0xea34('0x4d')](_0x87e209);})['then'](function(_0x5b3df0){_0x55833d[_0xea34('0x4e')]=_0x5b3df0;return _0x55833d;})[_0xea34('0x2f')](respondWithFilteredResult(_0x23410f,_0x87e209))[_0xea34('0x23')](handleError(_0x23410f,null));};exports['show']=function(_0x3f179f,_0xc08f9c){var _0x2248c7={'raw':![],'where':{'id':_0x3f179f['params']['id']}},_0x24211d={};_0x24211d[_0xea34('0x3c')]=_[_0xea34('0x4f')](db[_0xea34('0x38')][_0xea34('0x39')]);_0x24211d[_0xea34('0x40')]=_[_0xea34('0x4f')](_0x3f179f['query']);_0x24211d[_0xea34('0x3d')]=_[_0xea34('0x3e')](_0x24211d[_0xea34('0x3c')],_0x24211d[_0xea34('0x40')]);_0x2248c7[_0xea34('0x41')]=_[_0xea34('0x3e')](_0x24211d[_0xea34('0x3c')],qs[_0xea34('0x3f')](_0x3f179f[_0xea34('0x40')][_0xea34('0x3f')]));_0x2248c7['attributes']=_0x2248c7[_0xea34('0x41')][_0xea34('0x42')]?_0x2248c7['attributes']:_0x24211d[_0xea34('0x3c')];if(_0x3f179f[_0xea34('0x40')][_0xea34('0x50')]){_0x2248c7[_0xea34('0x4c')]=[{'all':!![]}];}_0x2248c7=_[_0xea34('0x49')]({},_0x2248c7,_0x3f179f['options']);return db[_0xea34('0x38')][_0xea34('0x51')](_0x2248c7)[_0xea34('0x2f')](handleEntityNotFound(_0xc08f9c,null))['then'](respondWithResult(_0xc08f9c,null))[_0xea34('0x23')](handleError(_0xc08f9c,null));};exports['create']=function(_0x9e410e,_0x541c95,_0x39b563){var _0x1a93f0;return db[_0xea34('0x38')]['create'](_0x9e410e['body'],{'raw':!![]})[_0xea34('0x2f')](function(_0x5abadf){_0x1a93f0=_0x5abadf;return db[_0xea34('0x38')]['findAll']({'raw':!![]});})[_0xea34('0x2f')](function(_0x429e16){var _0xc98a60=fs[_0xea34('0x52')](path[_0xea34('0x53')](config[_0xea34('0x54')],'server/files/templates/context.ejs'),_0xea34('0x55'));var _0x4a1bc9=ejs['render'](_0xc98a60,{'contexts':_0x429e16||[]});fs[_0xea34('0x56')](_0xea34('0x57'),_0x4a1bc9);})['then'](function(){return respondWithRpcPromise(_0xea34('0x58'),'create',{'module':_0xea34('0x59')});})[_0xea34('0x2f')](function(){var _0x242b5a=_0x9e410e['user'][_0xea34('0x30')]({'plain':!![]});if(!_0x242b5a)throw new Error(_0xea34('0x5a'));if(_0x242b5a[_0xea34('0x5b')]===_0xea34('0x5c')){var _0x1138ca=_0x1a93f0[_0xea34('0x30')]({'plain':!![]});return db[_0xea34('0x5d')][_0xea34('0x51')]({'where':{'name':_0xea34('0x31'),'userProfileId':_0x242b5a['userProfileId']},'raw':!![]})[_0xea34('0x2f')](function(_0x295259){if(_0x295259&&_0x295259[_0xea34('0x5e')]===0x0){return db[_0xea34('0x32')][_0xea34('0x5f')]({'name':_0x1138ca[_0xea34('0x34')],'resourceId':_0x1138ca['id'],'type':_0x295259[_0xea34('0x34')],'sectionId':_0x295259['id']},{})[_0xea34('0x2f')](function(){return _0x1a93f0;});}else{return _0x1a93f0;}})[_0xea34('0x23')](function(_0x4b48c2){logger[_0xea34('0x1e')](_0xea34('0x60'),_0x4b48c2);throw _0x4b48c2;});}return _0x1a93f0;})[_0xea34('0x2f')](respondWithResult(_0x541c95,0xc9))[_0xea34('0x23')](handleError(_0x541c95,null));};exports[_0xea34('0x2d')]=function(_0x5a805b,_0x525c73,_0x517919){var _0x493f82;return db[_0xea34('0x38')][_0xea34('0x51')]({'where':{'id':_0x5a805b[_0xea34('0x61')]['id']}})[_0xea34('0x2f')](handleEntityNotFound(_0x525c73,null))[_0xea34('0x2f')](saveUpdates(_0x5a805b[_0xea34('0x62')],null))[_0xea34('0x2f')](function(_0x3f24ff){if(_0x3f24ff){_0x493f82=_0x3f24ff;return db[_0xea34('0x38')][_0xea34('0x4d')]({'raw':!![]});}})['then'](function(_0x316841){var _0x519b6d=fs['readFileSync'](path[_0xea34('0x53')](config[_0xea34('0x54')],'server/files/templates/context.ejs'),_0xea34('0x55'));var _0xa0f391=ejs['render'](_0x519b6d,{'contexts':_0x316841||[]});fs[_0xea34('0x56')](_0xea34('0x57'),_0xa0f391);})[_0xea34('0x2f')](function(){return respondWithRpcPromise(_0xea34('0x58'),_0xea34('0x2d'),{'module':_0xea34('0x59')});})['then'](function(){return _0x493f82;})[_0xea34('0x2f')](respondWithResult(_0x525c73,null))[_0xea34('0x23')](handleError(_0x525c73,null));};exports[_0xea34('0x2e')]=function(_0x2fb50e,_0x10adeb,_0x54d4cf){var _0x209a23;return db[_0xea34('0x38')]['find']({'where':{'id':_0x2fb50e[_0xea34('0x61')]['id']}})[_0xea34('0x2f')](handleEntityNotFound(_0x10adeb,null))['then'](removeEntity(_0x10adeb,null))[_0xea34('0x2f')](function(){return db[_0xea34('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x2f83dd){var _0x1b2834=fs[_0xea34('0x52')](path[_0xea34('0x53')](config['root'],'server/files/templates/context.ejs'),_0xea34('0x55'));var _0x1ebc9e=ejs[_0xea34('0x63')](_0x1b2834,{'contexts':_0x2f83dd});fs[_0xea34('0x56')](_0xea34('0x57'),_0x1ebc9e);return respondWithRpcPromise(_0xea34('0x58'),_0xea34('0x2e'),{'module':_0xea34('0x59')});})[_0xea34('0x23')](handleError(_0x10adeb,null));}; \ No newline at end of file +var _0x0ee0=['show','params','rawAttributes','find','create','body','root','render','writeFileSync','Reload','user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','utf8','/etc/asterisk/extensions_xcally_contexts.conf','server/files/templates/context.ejs','chan_sip.so','eml-format','zip-dir','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','send','index','map','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceContext','findAll','rows'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x0ee0,0x1b6));var _0x00ee=function(_0x579a74,_0x5ddef4){_0x579a74=_0x579a74-0x0;var _0x43b37e=_0x0ee0[_0x579a74];return _0x43b37e;};'use strict';var emlformat=require(_0x00ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x00ee('0x2'));var BPromise=require(_0x00ee('0x3'));var Mustache=require(_0x00ee('0x4'));var util=require('util');var path=require(_0x00ee('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x00ee('0x6'));var fs=require('fs');var fs_extra=require(_0x00ee('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x00ee('0x8'));var jsforce=require(_0x00ee('0x9'));var deskjs=require(_0x00ee('0xa'));var toCsv=require(_0x00ee('0xb'));var querystring=require(_0x00ee('0xc'));var Papa=require('papaparse');var Redis=require(_0x00ee('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x00ee('0xe'));var as=require(_0x00ee('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00ee('0x10'))(_0x00ee('0x11'));var utils=require(_0x00ee('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x00ee('0x13'));var db=require(_0x00ee('0x14'))['db'];var jayson=require(_0x00ee('0x15'));var client=jayson[_0x00ee('0x16')][_0x00ee('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x880057,_0x5b8560,_0xef13f6,_0x5c64d7){return new BPromise(function(_0x1cd271,_0x596ee9){var _0xdde134=_0x5c64d7||client;return _0xdde134[_0x00ee('0x18')](_0x880057,_0xef13f6)[_0x00ee('0x19')](function(_0x50a478){logger[_0x00ee('0x1a')](_0x00ee('0x1b'),_0x5b8560,_0x00ee('0x1c'));logger[_0x00ee('0x1d')](_0x00ee('0x1e'),_0x5b8560,'request\x20sent',JSON['stringify'](_0x50a478));if(_0x50a478[_0x00ee('0x1f')]){if(_0x50a478[_0x00ee('0x1f')][_0x00ee('0x20')]===0x1f4){logger[_0x00ee('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x5b8560,_0x50a478[_0x00ee('0x1f')][_0x00ee('0x21')]);return _0x596ee9(_0x50a478['error'][_0x00ee('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b8560,_0x50a478[_0x00ee('0x1f')][_0x00ee('0x21')]);return _0x1cd271(_0x50a478[_0x00ee('0x1f')]['message']);}else{logger['info'](_0x00ee('0x1b'),_0x5b8560,_0x00ee('0x1c'));_0x1cd271(_0x50a478[_0x00ee('0x22')][_0x00ee('0x21')]);}})[_0x00ee('0x23')](function(_0x2bad47){logger[_0x00ee('0x1f')](_0x00ee('0x1b'),_0x5b8560,_0x2bad47);_0x596ee9(_0x2bad47);});});}function respondWithStatusCode(_0x15388a,_0x59d951){_0x59d951=_0x59d951||0xcc;return function(_0x46f98b){if(_0x46f98b){return _0x15388a[_0x00ee('0x24')](_0x59d951);}return _0x15388a['status'](_0x59d951)['end']();};}function respondWithResult(_0x3b3740,_0x38102b){_0x38102b=_0x38102b||0xc8;return function(_0x1a8e49){if(_0x1a8e49){return _0x3b3740[_0x00ee('0x25')](_0x38102b)['json'](_0x1a8e49);}};}function respondWithFilteredResult(_0x455f51,_0x551fb0){return function(_0x4081e1){if(_0x4081e1){var _0x219e2e=typeof _0x551fb0[_0x00ee('0x26')]===_0x00ee('0x27')&&typeof _0x551fb0[_0x00ee('0x28')]===_0x00ee('0x27');var _0x3278eb=_0x4081e1['count'];var _0xa4ea0b=_0x219e2e?0x0:_0x551fb0['offset'];var _0x2d0868=_0x219e2e?_0x4081e1[_0x00ee('0x29')]:_0x551fb0['offset']+_0x551fb0[_0x00ee('0x28')];var _0x3d26a9;if(_0x2d0868>=_0x3278eb){_0x2d0868=_0x3278eb;_0x3d26a9=0xc8;}else{_0x3d26a9=0xce;}_0x455f51['status'](_0x3d26a9);return _0x455f51[_0x00ee('0x2a')](_0x00ee('0x2b'),_0xa4ea0b+'-'+_0x2d0868+'/'+_0x3278eb)[_0x00ee('0x2c')](_0x4081e1);}return null;};}function patchUpdates(_0xdc85de){return function(_0x5d2a99){try{jsonpatch[_0x00ee('0x2d')](_0x5d2a99,_0xdc85de,!![]);}catch(_0x24d35d){return BPromise[_0x00ee('0x2e')](_0x24d35d);}return _0x5d2a99[_0x00ee('0x2f')]();};}function saveUpdates(_0x28d3af,_0x344063){return function(_0x437e1b){if(_0x437e1b){return _0x437e1b[_0x00ee('0x30')](_0x28d3af)['then'](function(_0x48a09c){return _0x48a09c;});}return null;};}function removeEntity(_0x3522f4,_0x54478f){return function(_0x3a5f12){if(_0x3a5f12){return _0x3a5f12[_0x00ee('0x31')]()[_0x00ee('0x19')](function(){var _0xf34b07=_0x3a5f12['get']({'plain':!![]});var _0x1a8bd4=_0x00ee('0x32');return db[_0x00ee('0x33')][_0x00ee('0x31')]({'where':{'type':_0x1a8bd4,'resourceId':_0xf34b07['id']}})[_0x00ee('0x19')](function(){return _0x3a5f12;});})['then'](function(){_0x3522f4[_0x00ee('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x957da8){return function(_0x1d5c28){if(!_0x1d5c28){_0x24fcf7[_0x00ee('0x24')](0x194);}return _0x1d5c28;};}function handleError(_0x44c440,_0x245528){_0x245528=_0x245528||0x1f4;return function(_0x1b31c3){logger[_0x00ee('0x1f')](_0x1b31c3[_0x00ee('0x34')]);if(_0x1b31c3[_0x00ee('0x35')]){delete _0x1b31c3[_0x00ee('0x35')];}_0x44c440['status'](_0x245528)[_0x00ee('0x36')](_0x1b31c3);};}exports[_0x00ee('0x37')]=function(_0x1b01f2,_0x5da61f){var _0x4ffb10={},_0x393f12={},_0x218706={'count':0x0,'rows':[]};var _0x2bd244=_[_0x00ee('0x38')](db['VoiceContext']['rawAttributes'],function(_0xdb5d72){return{'name':_0xdb5d72[_0x00ee('0x39')],'type':_0xdb5d72[_0x00ee('0x3a')]['key']};});_0x393f12['model']=_[_0x00ee('0x38')](_0x2bd244,_0x00ee('0x35'));_0x393f12['query']=_[_0x00ee('0x3b')](_0x1b01f2[_0x00ee('0x3c')]);_0x393f12[_0x00ee('0x3d')]=_[_0x00ee('0x3e')](_0x393f12['model'],_0x393f12[_0x00ee('0x3c')]);_0x4ffb10[_0x00ee('0x3f')]=_[_0x00ee('0x3e')](_0x393f12[_0x00ee('0x40')],qs[_0x00ee('0x41')](_0x1b01f2[_0x00ee('0x3c')][_0x00ee('0x41')]));_0x4ffb10[_0x00ee('0x3f')]=_0x4ffb10[_0x00ee('0x3f')][_0x00ee('0x42')]?_0x4ffb10[_0x00ee('0x3f')]:_0x393f12[_0x00ee('0x40')];if(!_0x1b01f2[_0x00ee('0x3c')][_0x00ee('0x43')](_0x00ee('0x44'))){_0x4ffb10[_0x00ee('0x28')]=qs[_0x00ee('0x28')](_0x1b01f2['query'][_0x00ee('0x28')]);_0x4ffb10[_0x00ee('0x26')]=qs[_0x00ee('0x26')](_0x1b01f2[_0x00ee('0x3c')]['offset']);}_0x4ffb10[_0x00ee('0x45')]=qs[_0x00ee('0x46')](_0x1b01f2[_0x00ee('0x3c')][_0x00ee('0x46')]);_0x4ffb10[_0x00ee('0x47')]=qs['filters'](_[_0x00ee('0x48')](_0x1b01f2['query'],_0x393f12[_0x00ee('0x3d')]),_0x2bd244);if(_0x1b01f2[_0x00ee('0x3c')][_0x00ee('0x49')]){_0x4ffb10['where']=_[_0x00ee('0x4a')](_0x4ffb10[_0x00ee('0x47')],{'$or':_['map'](_0x2bd244,function(_0xeb6887){if(_0xeb6887['type']!==_0x00ee('0x4b')){var _0x533b3a={};_0x533b3a[_0xeb6887['name']]={'$like':'%'+_0x1b01f2[_0x00ee('0x3c')]['filter']+'%'};return _0x533b3a;}})});}_0x4ffb10=_[_0x00ee('0x4a')]({},_0x4ffb10,_0x1b01f2[_0x00ee('0x4c')]);var _0xc55af8={'where':_0x4ffb10[_0x00ee('0x47')]};return db['VoiceContext'][_0x00ee('0x29')](_0xc55af8)['then'](function(_0x30517d){_0x218706[_0x00ee('0x29')]=_0x30517d;if(_0x1b01f2['query'][_0x00ee('0x4d')]){_0x4ffb10[_0x00ee('0x4e')]=[{'all':!![]}];}return db[_0x00ee('0x4f')][_0x00ee('0x50')](_0x4ffb10);})['then'](function(_0x2e211b){_0x218706[_0x00ee('0x51')]=_0x2e211b;return _0x218706;})[_0x00ee('0x19')](respondWithFilteredResult(_0x5da61f,_0x4ffb10))[_0x00ee('0x23')](handleError(_0x5da61f,null));};exports[_0x00ee('0x52')]=function(_0x20dcf1,_0x38b6cc){var _0x5e8172={'raw':![],'where':{'id':_0x20dcf1[_0x00ee('0x53')]['id']}},_0x4738e2={};_0x4738e2[_0x00ee('0x40')]=_[_0x00ee('0x3b')](db['VoiceContext'][_0x00ee('0x54')]);_0x4738e2[_0x00ee('0x3c')]=_['keys'](_0x20dcf1['query']);_0x4738e2[_0x00ee('0x3d')]=_[_0x00ee('0x3e')](_0x4738e2[_0x00ee('0x40')],_0x4738e2[_0x00ee('0x3c')]);_0x5e8172[_0x00ee('0x3f')]=_[_0x00ee('0x3e')](_0x4738e2[_0x00ee('0x40')],qs['fields'](_0x20dcf1[_0x00ee('0x3c')]['fields']));_0x5e8172[_0x00ee('0x3f')]=_0x5e8172[_0x00ee('0x3f')][_0x00ee('0x42')]?_0x5e8172[_0x00ee('0x3f')]:_0x4738e2[_0x00ee('0x40')];if(_0x20dcf1['query']['includeAll']){_0x5e8172['include']=[{'all':!![]}];}_0x5e8172=_['merge']({},_0x5e8172,_0x20dcf1[_0x00ee('0x4c')]);return db['VoiceContext'][_0x00ee('0x55')](_0x5e8172)[_0x00ee('0x19')](handleEntityNotFound(_0x38b6cc,null))['then'](respondWithResult(_0x38b6cc,null))[_0x00ee('0x23')](handleError(_0x38b6cc,null));};exports[_0x00ee('0x56')]=function(_0x2a867e,_0x2a8fac,_0x5cb57b){var _0x27a94e;return db['VoiceContext'][_0x00ee('0x56')](_0x2a867e[_0x00ee('0x57')],{'raw':!![]})['then'](function(_0x176110){_0x27a94e=_0x176110;return db[_0x00ee('0x4f')][_0x00ee('0x50')]({'raw':!![]});})[_0x00ee('0x19')](function(_0x4e7884){var _0x924ff3=fs['readFileSync'](path['join'](config[_0x00ee('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x10e463=ejs[_0x00ee('0x59')](_0x924ff3,{'contexts':_0x4e7884||[]});fs[_0x00ee('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x10e463);})[_0x00ee('0x19')](function(){return respondWithRpcPromise(_0x00ee('0x5b'),_0x00ee('0x56'),{'module':'chan_sip.so'});})[_0x00ee('0x19')](function(){var _0x449200=_0x2a867e[_0x00ee('0x5c')]['get']({'plain':!![]});if(!_0x449200)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x449200[_0x00ee('0x5d')]===_0x00ee('0x5c')){var _0x14fc96=_0x27a94e[_0x00ee('0x5e')]({'plain':!![]});return db['UserProfileSection'][_0x00ee('0x55')]({'where':{'name':_0x00ee('0x32'),'userProfileId':_0x449200[_0x00ee('0x5f')]},'raw':!![]})['then'](function(_0x52df28){if(_0x52df28&&_0x52df28[_0x00ee('0x60')]===0x0){return db[_0x00ee('0x33')][_0x00ee('0x56')]({'name':_0x14fc96[_0x00ee('0x35')],'resourceId':_0x14fc96['id'],'type':_0x52df28[_0x00ee('0x35')],'sectionId':_0x52df28['id']},{})[_0x00ee('0x19')](function(){return _0x27a94e;});}else{return _0x27a94e;}})['catch'](function(_0x28919c){logger['error'](_0x00ee('0x61'),_0x28919c);throw _0x28919c;});}return _0x27a94e;})[_0x00ee('0x19')](respondWithResult(_0x2a8fac,0xc9))[_0x00ee('0x23')](handleError(_0x2a8fac,null));};exports['update']=function(_0x2b89c6,_0x48689f,_0x20e1a3){var _0xa04c49;return db['VoiceContext'][_0x00ee('0x55')]({'where':{'id':_0x2b89c6[_0x00ee('0x53')]['id']}})[_0x00ee('0x19')](handleEntityNotFound(_0x48689f,null))['then'](saveUpdates(_0x2b89c6['body'],null))[_0x00ee('0x19')](function(_0x383edc){if(_0x383edc){_0xa04c49=_0x383edc;return db[_0x00ee('0x4f')][_0x00ee('0x50')]({'raw':!![]});}})['then'](function(_0x5583fb){var _0x6de3bf=fs[_0x00ee('0x62')](path[_0x00ee('0x63')](config[_0x00ee('0x58')],'server/files/templates/context.ejs'),_0x00ee('0x64'));var _0x918814=ejs[_0x00ee('0x59')](_0x6de3bf,{'contexts':_0x5583fb||[]});fs[_0x00ee('0x5a')](_0x00ee('0x65'),_0x918814);})['then'](function(){return respondWithRpcPromise(_0x00ee('0x5b'),_0x00ee('0x30'),{'module':'chan_sip.so'});})[_0x00ee('0x19')](function(){return _0xa04c49;})[_0x00ee('0x19')](respondWithResult(_0x48689f,null))[_0x00ee('0x23')](handleError(_0x48689f,null));};exports[_0x00ee('0x31')]=function(_0x5b05c1,_0x2f1bb4,_0x3e1a47){var _0x46b1e0;return db[_0x00ee('0x4f')][_0x00ee('0x55')]({'where':{'id':_0x5b05c1[_0x00ee('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f1bb4,null))['then'](removeEntity(_0x2f1bb4,null))[_0x00ee('0x19')](function(){return db['VoiceContext'][_0x00ee('0x50')]({'raw':!![]});})[_0x00ee('0x19')](function(_0x1818e0){var _0x3d50e9=fs[_0x00ee('0x62')](path['join'](config['root'],_0x00ee('0x66')),_0x00ee('0x64'));var _0x38cf34=ejs[_0x00ee('0x59')](_0x3d50e9,{'contexts':_0x1818e0});fs[_0x00ee('0x5a')](_0x00ee('0x65'),_0x38cf34);return respondWithRpcPromise(_0x00ee('0x5b'),_0x00ee('0x31'),{'module':_0x00ee('0x67')});})[_0x00ee('0x23')](handleError(_0x2f1bb4,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7333498..fda5a3c 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 _0x16d5=['rimraf','../../config/environment','./voiceContext.attributes','define','voice_contexts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x16d5,0xe9));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x516d('0x0'));var util=require(_0x516d('0x1'));var logger=require('../../config/logger')(_0x516d('0x2'));var moment=require(_0x516d('0x3'));var BPromise=require(_0x516d('0x4'));var rp=require(_0x516d('0x5'));var fs=require('fs');var path=require(_0x516d('0x6'));var rimraf=require(_0x516d('0x7'));var config=require(_0x516d('0x8'));var attributes=require(_0x516d('0x9'));module['exports']=function(_0x389dfc,_0x11a6b4){return _0x389dfc[_0x516d('0xa')]('VoiceContext',attributes,{'tableName':_0x516d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e07=['moment','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger'];(function(_0x5667c2,_0x501aef){var _0x1b3f4a=function(_0x56f69d){while(--_0x56f69d){_0x5667c2['push'](_0x5667c2['shift']());}};_0x1b3f4a(++_0x501aef);}(_0x9e07,0xb1));var _0x79e0=function(_0x3e91d1,_0x20f9d8){_0x3e91d1=_0x3e91d1-0x0;var _0x41b4d2=_0x9e07[_0x3e91d1];return _0x41b4d2;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var logger=require(_0x79e0('0x2'))('api');var moment=require(_0x79e0('0x3'));var BPromise=require(_0x79e0('0x4'));var rp=require(_0x79e0('0x5'));var fs=require('fs');var path=require(_0x79e0('0x6'));var rimraf=require('rimraf');var config=require(_0x79e0('0x7'));var attributes=require(_0x79e0('0x8'));module[_0x79e0('0x9')]=function(_0x5437ba,_0x1c6735){return _0x5437ba[_0x79e0('0xa')](_0x79e0('0xb'),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 53dab36..11601e4 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 _0x6f24=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x291f8b,_0x3a761f){var _0xac740e=function(_0x37289e){while(--_0x37289e){_0x291f8b['push'](_0x291f8b['shift']());}};_0xac740e(++_0x3a761f);}(_0x6f24,0x76));var _0x46f2=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x6f24[_0x934425];return _0x31d596;};'use strict';var _=require(_0x46f2('0x0'));var util=require(_0x46f2('0x1'));var moment=require('moment');var BPromise=require(_0x46f2('0x2'));var rs=require(_0x46f2('0x3'));var fs=require('fs');var Redis=require(_0x46f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46f2('0x5'));var logger=require('../../config/logger')(_0x46f2('0x6'));var config=require(_0x46f2('0x7'));var jayson=require(_0x46f2('0x8'));var client=jayson[_0x46f2('0x9')][_0x46f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51d8b6,_0x12d539,_0xd8ec3d){return new BPromise(function(_0x246924,_0x5082c5){return client[_0x46f2('0xb')](_0x51d8b6,_0xd8ec3d)[_0x46f2('0xc')](function(_0x364fc8){logger[_0x46f2('0xd')]('VoiceContext,\x20%s,\x20%s',_0x12d539,'request\x20sent');logger[_0x46f2('0xe')](_0x46f2('0xf'),_0x12d539,_0x46f2('0x10'),JSON[_0x46f2('0x11')](_0x364fc8));if(_0x364fc8['error']){if(_0x364fc8[_0x46f2('0x12')][_0x46f2('0x13')]===0x1f4){logger[_0x46f2('0x12')](_0x46f2('0x14'),_0x12d539,_0x364fc8['error'][_0x46f2('0x15')]);return _0x5082c5(_0x364fc8[_0x46f2('0x12')][_0x46f2('0x15')]);}logger[_0x46f2('0x12')](_0x46f2('0x14'),_0x12d539,_0x364fc8[_0x46f2('0x12')][_0x46f2('0x15')]);return _0x246924(_0x364fc8[_0x46f2('0x12')][_0x46f2('0x15')]);}else{logger[_0x46f2('0xd')](_0x46f2('0x14'),_0x12d539,_0x46f2('0x10'));_0x246924(_0x364fc8[_0x46f2('0x16')][_0x46f2('0x15')]);}})[_0x46f2('0x17')](function(_0x4125db){logger[_0x46f2('0x12')](_0x46f2('0x14'),_0x12d539,_0x4125db);_0x5082c5(_0x4125db);});});} \ No newline at end of file +var _0x3609=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1138bc,_0x5dcb6c){var _0x3b6952=function(_0x279490){while(--_0x279490){_0x1138bc['push'](_0x1138bc['shift']());}};_0x3b6952(++_0x5dcb6c);}(_0x3609,0x101));var _0x9360=function(_0xd75320,_0x302459){_0xd75320=_0xd75320-0x0;var _0x332199=_0x3609[_0xd75320];return _0x332199;};'use strict';var _=require(_0x9360('0x0'));var util=require(_0x9360('0x1'));var moment=require(_0x9360('0x2'));var BPromise=require(_0x9360('0x3'));var rs=require(_0x9360('0x4'));var fs=require('fs');var Redis=require(_0x9360('0x5'));var db=require(_0x9360('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9360('0x7'))(_0x9360('0x8'));var config=require(_0x9360('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11fe15,_0xf4e840,_0x50e967){return new BPromise(function(_0x2a67be,_0x3a08e5){return client[_0x9360('0xa')](_0x11fe15,_0x50e967)[_0x9360('0xb')](function(_0x2d951e){logger[_0x9360('0xc')](_0x9360('0xd'),_0xf4e840,_0x9360('0xe'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0xf4e840,_0x9360('0xe'),JSON[_0x9360('0xf')](_0x2d951e));if(_0x2d951e[_0x9360('0x10')]){if(_0x2d951e['error'][_0x9360('0x11')]===0x1f4){logger[_0x9360('0x10')](_0x9360('0xd'),_0xf4e840,_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);return _0x3a08e5(_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0xf4e840,_0x2d951e[_0x9360('0x10')]['message']);return _0x2a67be(_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);}else{logger[_0x9360('0xc')](_0x9360('0xd'),_0xf4e840,'request\x20sent');_0x2a67be(_0x2d951e[_0x9360('0x13')][_0x9360('0x12')]);}})[_0x9360('0x14')](function(_0x1e0316){logger[_0x9360('0x10')](_0x9360('0xd'),_0xf4e840,_0x1e0316);_0x3a08e5(_0x1e0316);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 98adc74..95213f4 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 _0x1e1a=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1e1a,0x86));var _0xa1e1=function(_0x31bde6,_0x2f8709){_0x31bde6=_0x31bde6-0x0;var _0x23a0d3=_0x1e1a[_0x31bde6];return _0x23a0d3;};'use strict';var multer=require(_0xa1e1('0x0'));var util=require(_0xa1e1('0x1'));var path=require(_0xa1e1('0x2'));var timeout=require(_0xa1e1('0x3'));var express=require('express');var router=express[_0xa1e1('0x4')]();var fs_extra=require(_0xa1e1('0x5'));var auth=require(_0xa1e1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa1e1('0x7'));var controller=require('./voiceDialReport.controller');router[_0xa1e1('0x8')]('/',auth['isAuthenticated'](),controller[_0xa1e1('0x9')]);router['get'](_0xa1e1('0xa'),auth[_0xa1e1('0xb')](),controller[_0xa1e1('0xc')]);router[_0xa1e1('0x8')](_0xa1e1('0xd'),auth[_0xa1e1('0xb')](),controller[_0xa1e1('0xe')]);router[_0xa1e1('0xf')]('/',auth[_0xa1e1('0xb')](),controller[_0xa1e1('0x10')]);router[_0xa1e1('0x11')](_0xa1e1('0xd'),auth[_0xa1e1('0xb')](),controller[_0xa1e1('0x12')]);router[_0xa1e1('0x13')](_0xa1e1('0xd'),auth[_0xa1e1('0xb')](),controller[_0xa1e1('0x14')]);module[_0xa1e1('0x15')]=router; \ No newline at end of file +var _0xa311=['/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe'];(function(_0x24c15a,_0x261c48){var _0x2a3137=function(_0x25096a){while(--_0x25096a){_0x24c15a['push'](_0x24c15a['shift']());}};_0x2a3137(++_0x261c48);}(_0xa311,0x118));var _0x1a31=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0xa311[_0x10a212];return _0x23c82b;};'use strict';var multer=require(_0x1a31('0x0'));var util=require(_0x1a31('0x1'));var path=require(_0x1a31('0x2'));var timeout=require(_0x1a31('0x3'));var express=require('express');var router=express[_0x1a31('0x4')]();var fs_extra=require(_0x1a31('0x5'));var auth=require(_0x1a31('0x6'));var interaction=require(_0x1a31('0x7'));var config=require(_0x1a31('0x8'));var controller=require(_0x1a31('0x9'));router[_0x1a31('0xa')]('/',auth[_0x1a31('0xb')](),controller[_0x1a31('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1a31('0xd')]);router[_0x1a31('0xa')](_0x1a31('0xe'),auth['isAuthenticated'](),controller[_0x1a31('0xf')]);router[_0x1a31('0x10')]('/',auth[_0x1a31('0xb')](),controller['create']);router[_0x1a31('0x11')]('/:id',auth[_0x1a31('0xb')](),controller[_0x1a31('0x12')]);router['delete'](_0x1a31('0xe'),auth['isAuthenticated'](),controller[_0x1a31('0x13')]);module[_0x1a31('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 63ef365..1433e4e 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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x5d6f53,_0x7c7514){var _0x50d4b1=function(_0x542420){while(--_0x542420){_0x5d6f53['push'](_0x5d6f53['shift']());}};_0x50d4b1(++_0x7c7514);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x2e6ce7,_0x5346c9){var _0x9d4176=function(_0x5d476e){while(--_0x5d476e){_0x2e6ce7['push'](_0x2e6ce7['shift']());}};_0x9d4176(++_0x5346c9);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x466410,_0x4069d9){_0x466410=_0x466410-0x0;var _0x3d758e=_0xf2ca[_0x466410];return _0x3d758e;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 88f26c5..578a09d 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 _0x90f3=['fast-json-patch','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x2ddf26,_0x226182){var _0x24c484=function(_0xd3f3a5){while(--_0xd3f3a5){_0x2ddf26['push'](_0x2ddf26['shift']());}};_0x24c484(++_0x226182);}(_0x90f3,0x16f));var _0x390f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x90f3[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x390f('0x0'));var rimraf=require(_0x390f('0x1'));var zipdir=require(_0x390f('0x2'));var jsonpatch=require(_0x390f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x390f('0x4'));var util=require(_0x390f('0x5'));var path=require('path');var sox=require(_0x390f('0x6'));var csv=require('to-csv');var ejs=require(_0x390f('0x7'));var fs=require('fs');var fs_extra=require(_0x390f('0x8'));var _=require(_0x390f('0x9'));var squel=require('squel');var crypto=require(_0x390f('0xa'));var jsforce=require(_0x390f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x390f('0xc'));var querystring=require(_0x390f('0xd'));var Papa=require(_0x390f('0xe'));var Redis=require(_0x390f('0xf'));var authService=require(_0x390f('0x10'));var qs=require(_0x390f('0x11'));var as=require(_0x390f('0x12'));var hardwareService=require(_0x390f('0x13'));var logger=require(_0x390f('0x14'))(_0x390f('0x15'));var utils=require('../../config/utils');var config=require(_0x390f('0x16'));var licenseUtil=require(_0x390f('0x17'));var db=require(_0x390f('0x18'))['db'];function respondWithStatusCode(_0x15f421,_0x76517e){_0x76517e=_0x76517e||0xcc;return function(_0xa8071a){if(_0xa8071a){return _0x15f421[_0x390f('0x19')](_0x76517e);}return _0x15f421['status'](_0x76517e)['end']();};}function respondWithResult(_0xd6cadd,_0x596a45){_0x596a45=_0x596a45||0xc8;return function(_0x51efe9){if(_0x51efe9){return _0xd6cadd[_0x390f('0x1a')](_0x596a45)['json'](_0x51efe9);}};}function respondWithFilteredResult(_0x39fd31,_0x2331d1){return function(_0xc59f74){if(_0xc59f74){var _0x26176c=typeof _0x2331d1[_0x390f('0x1b')]===_0x390f('0x1c')&&typeof _0x2331d1['limit']==='undefined';var _0x12b998=_0xc59f74['count'];var _0x280be2=_0x26176c?0x0:_0x2331d1['offset'];var _0x1d01a6=_0x26176c?_0xc59f74[_0x390f('0x1d')]:_0x2331d1['offset']+_0x2331d1[_0x390f('0x1e')];var _0x4b0799;if(_0x1d01a6>=_0x12b998){_0x1d01a6=_0x12b998;_0x4b0799=0xc8;}else{_0x4b0799=0xce;}_0x39fd31[_0x390f('0x1a')](_0x4b0799);return _0x39fd31['set'](_0x390f('0x1f'),_0x280be2+'-'+_0x1d01a6+'/'+_0x12b998)[_0x390f('0x20')](_0xc59f74);}return null;};}function patchUpdates(_0x36cc6d){return function(_0x156755){try{jsonpatch[_0x390f('0x21')](_0x156755,_0x36cc6d,!![]);}catch(_0x3ef1f4){return BPromise['reject'](_0x3ef1f4);}return _0x156755[_0x390f('0x22')]();};}function saveUpdates(_0x46546a,_0x5215ee){return function(_0x2a2eeb){if(_0x2a2eeb){return _0x2a2eeb[_0x390f('0x23')](_0x46546a)[_0x390f('0x24')](function(_0xfeb16d){return _0xfeb16d;});}return null;};}function removeEntity(_0x1f46cd,_0x4591d3){return function(_0x426303){if(_0x426303){return _0x426303[_0x390f('0x25')]()[_0x390f('0x24')](function(){_0x1f46cd[_0x390f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4775,_0x1cdeb3){return function(_0x4c9019){if(!_0x4c9019){_0x3f4775[_0x390f('0x19')](0x194);}return _0x4c9019;};}function handleError(_0x44983f,_0x1d5f52){_0x1d5f52=_0x1d5f52||0x1f4;return function(_0x103e0b){logger[_0x390f('0x26')](_0x103e0b[_0x390f('0x27')]);if(_0x103e0b[_0x390f('0x28')]){delete _0x103e0b[_0x390f('0x28')];}_0x44983f[_0x390f('0x1a')](_0x1d5f52)[_0x390f('0x29')](_0x103e0b);};}exports[_0x390f('0x2a')]=function(_0x460a5b,_0x5a7af2){var _0x524b4b={},_0x4f3130={},_0x1f9876={'count':0x0,'rows':[]};var _0x287444=_['map'](db[_0x390f('0x2b')]['rawAttributes'],function(_0x40649e){return{'name':_0x40649e['fieldName'],'type':_0x40649e[_0x390f('0x2c')][_0x390f('0x2d')]};});_0x4f3130[_0x390f('0x2e')]=_[_0x390f('0x2f')](_0x287444,_0x390f('0x28'));_0x4f3130[_0x390f('0x30')]=_[_0x390f('0x31')](_0x460a5b[_0x390f('0x30')]);_0x4f3130[_0x390f('0x32')]=_['intersection'](_0x4f3130[_0x390f('0x2e')],_0x4f3130[_0x390f('0x30')]);_0x524b4b[_0x390f('0x33')]=_[_0x390f('0x34')](_0x4f3130[_0x390f('0x2e')],qs['fields'](_0x460a5b[_0x390f('0x30')][_0x390f('0x35')]));_0x524b4b[_0x390f('0x33')]=_0x524b4b[_0x390f('0x33')][_0x390f('0x36')]?_0x524b4b[_0x390f('0x33')]:_0x4f3130[_0x390f('0x2e')];if(!_0x460a5b[_0x390f('0x30')]['hasOwnProperty'](_0x390f('0x37'))){_0x524b4b['limit']=qs['limit'](_0x460a5b['query'][_0x390f('0x1e')]);_0x524b4b['offset']=qs[_0x390f('0x1b')](_0x460a5b[_0x390f('0x30')][_0x390f('0x1b')]);}_0x524b4b[_0x390f('0x38')]=qs[_0x390f('0x39')](_0x460a5b[_0x390f('0x30')]['sort']);_0x524b4b['where']=qs[_0x390f('0x32')](_['pick'](_0x460a5b[_0x390f('0x30')],_0x4f3130[_0x390f('0x32')]),_0x287444);if(_0x460a5b[_0x390f('0x30')][_0x390f('0x3a')]){_0x524b4b['where']=_[_0x390f('0x3b')](_0x524b4b[_0x390f('0x3c')],{'$or':_[_0x390f('0x2f')](_0x287444,function(_0x3081d2){if(_0x3081d2[_0x390f('0x2c')]!==_0x390f('0x3d')){var _0x23e84e={};_0x23e84e[_0x3081d2[_0x390f('0x28')]]={'$like':'%'+_0x460a5b['query'][_0x390f('0x3a')]+'%'};return _0x23e84e;}})});}_0x524b4b=_[_0x390f('0x3b')]({},_0x524b4b,_0x460a5b[_0x390f('0x3e')]);var _0x3e8046={'where':_0x524b4b[_0x390f('0x3c')]};return db[_0x390f('0x2b')]['count'](_0x3e8046)[_0x390f('0x24')](function(_0x15bc0a){_0x1f9876[_0x390f('0x1d')]=_0x15bc0a;if(_0x460a5b['query'][_0x390f('0x3f')]){_0x524b4b[_0x390f('0x40')]=[{'all':!![]}];}return db[_0x390f('0x2b')]['findAll'](_0x524b4b);})[_0x390f('0x24')](function(_0x5e7a1c){_0x1f9876[_0x390f('0x41')]=_0x5e7a1c;return _0x1f9876;})[_0x390f('0x24')](respondWithFilteredResult(_0x5a7af2,_0x524b4b))['catch'](handleError(_0x5a7af2,null));};exports[_0x390f('0x42')]=function(_0xfab477,_0x38cc38){var _0x59f55d={'raw':!![],'where':{'id':_0xfab477[_0x390f('0x43')]['id']}},_0x237d45={};_0x237d45[_0x390f('0x2e')]=_['keys'](db[_0x390f('0x2b')][_0x390f('0x44')]);_0x237d45[_0x390f('0x30')]=_['keys'](_0xfab477[_0x390f('0x30')]);_0x237d45[_0x390f('0x32')]=_[_0x390f('0x34')](_0x237d45[_0x390f('0x2e')],_0x237d45['query']);_0x59f55d[_0x390f('0x33')]=_['intersection'](_0x237d45[_0x390f('0x2e')],qs[_0x390f('0x35')](_0xfab477[_0x390f('0x30')][_0x390f('0x35')]));_0x59f55d[_0x390f('0x33')]=_0x59f55d[_0x390f('0x33')][_0x390f('0x36')]?_0x59f55d[_0x390f('0x33')]:_0x237d45[_0x390f('0x2e')];if(_0xfab477['query']['includeAll']){_0x59f55d[_0x390f('0x40')]=[{'all':!![]}];}_0x59f55d=_['merge']({},_0x59f55d,_0xfab477['options']);return db[_0x390f('0x2b')]['find'](_0x59f55d)[_0x390f('0x24')](handleEntityNotFound(_0x38cc38,null))[_0x390f('0x24')](respondWithResult(_0x38cc38,null))[_0x390f('0x45')](handleError(_0x38cc38,null));};exports[_0x390f('0x46')]=function(_0x3aa070,_0x5f527e){return db[_0x390f('0x2b')][_0x390f('0x46')](_0x3aa070[_0x390f('0x47')],{})[_0x390f('0x24')](respondWithResult(_0x5f527e,0xc9))[_0x390f('0x45')](handleError(_0x5f527e,null));};exports[_0x390f('0x23')]=function(_0x5a02bc,_0x378ff5){if(_0x5a02bc[_0x390f('0x47')]['id']){delete _0x5a02bc['body']['id'];}return db[_0x390f('0x2b')][_0x390f('0x48')]({'where':{'id':_0x5a02bc[_0x390f('0x43')]['id']}})[_0x390f('0x24')](handleEntityNotFound(_0x378ff5,null))['then'](saveUpdates(_0x5a02bc[_0x390f('0x47')],null))['then'](respondWithResult(_0x378ff5,null))[_0x390f('0x45')](handleError(_0x378ff5,null));};exports['destroy']=function(_0x1f9c77,_0x78126){return db[_0x390f('0x2b')][_0x390f('0x48')]({'where':{'id':_0x1f9c77[_0x390f('0x43')]['id']}})[_0x390f('0x24')](handleEntityNotFound(_0x78126,null))['then'](removeEntity(_0x78126,null))[_0x390f('0x45')](handleError(_0x78126,null));};exports['describe']=function(_0x29a538,_0x346f51){return db[_0x390f('0x2b')][_0x390f('0x49')]()[_0x390f('0x24')](respondWithResult(_0x346f51,null))[_0x390f('0x45')](handleError(_0x346f51,null));}; \ No newline at end of file +var _0x4d86=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','merge','where','VIRTUAL','filter','includeAll','findAll','rows','catch','params','length','include','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x4d86,0x1b8));var _0x64d8=function(_0x2d5260,_0x2bdbc2){_0x2d5260=_0x2d5260-0x0;var _0x427c38=_0x4d86[_0x2d5260];return _0x427c38;};'use strict';var emlformat=require(_0x64d8('0x0'));var rimraf=require(_0x64d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64d8('0x2'));var rp=require(_0x64d8('0x3'));var moment=require(_0x64d8('0x4'));var BPromise=require(_0x64d8('0x5'));var Mustache=require(_0x64d8('0x6'));var util=require(_0x64d8('0x7'));var path=require(_0x64d8('0x8'));var sox=require('sox');var csv=require(_0x64d8('0x9'));var ejs=require(_0x64d8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64d8('0xb'));var squel=require(_0x64d8('0xc'));var crypto=require(_0x64d8('0xd'));var jsforce=require(_0x64d8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x64d8('0xf'));var Papa=require(_0x64d8('0x10'));var Redis=require(_0x64d8('0x11'));var authService=require(_0x64d8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x64d8('0x13'));var hardwareService=require(_0x64d8('0x14'));var logger=require(_0x64d8('0x15'))(_0x64d8('0x16'));var utils=require(_0x64d8('0x17'));var config=require(_0x64d8('0x18'));var licenseUtil=require(_0x64d8('0x19'));var db=require(_0x64d8('0x1a'))['db'];function respondWithStatusCode(_0x9945a9,_0x2d8c3b){_0x2d8c3b=_0x2d8c3b||0xcc;return function(_0x1b7b5e){if(_0x1b7b5e){return _0x9945a9[_0x64d8('0x1b')](_0x2d8c3b);}return _0x9945a9[_0x64d8('0x1c')](_0x2d8c3b)[_0x64d8('0x1d')]();};}function respondWithResult(_0x323457,_0x27ba2f){_0x27ba2f=_0x27ba2f||0xc8;return function(_0x5b3b75){if(_0x5b3b75){return _0x323457[_0x64d8('0x1c')](_0x27ba2f)[_0x64d8('0x1e')](_0x5b3b75);}};}function respondWithFilteredResult(_0x44f462,_0x5967b4){return function(_0x1af27d){if(_0x1af27d){var _0x5e206b=typeof _0x5967b4[_0x64d8('0x1f')]===_0x64d8('0x20')&&typeof _0x5967b4[_0x64d8('0x21')]===_0x64d8('0x20');var _0x518844=_0x1af27d[_0x64d8('0x22')];var _0x343267=_0x5e206b?0x0:_0x5967b4[_0x64d8('0x1f')];var _0x12a2e0=_0x5e206b?_0x1af27d[_0x64d8('0x22')]:_0x5967b4[_0x64d8('0x1f')]+_0x5967b4[_0x64d8('0x21')];var _0x56f099;if(_0x12a2e0>=_0x518844){_0x12a2e0=_0x518844;_0x56f099=0xc8;}else{_0x56f099=0xce;}_0x44f462['status'](_0x56f099);return _0x44f462['set']('Content-Range',_0x343267+'-'+_0x12a2e0+'/'+_0x518844)[_0x64d8('0x1e')](_0x1af27d);}return null;};}function patchUpdates(_0x508edb){return function(_0x3a6420){try{jsonpatch['apply'](_0x3a6420,_0x508edb,!![]);}catch(_0x4181ce){return BPromise[_0x64d8('0x23')](_0x4181ce);}return _0x3a6420[_0x64d8('0x24')]();};}function saveUpdates(_0x5cf832,_0x75362b){return function(_0x3e474b){if(_0x3e474b){return _0x3e474b['update'](_0x5cf832)[_0x64d8('0x25')](function(_0x1a6965){return _0x1a6965;});}return null;};}function removeEntity(_0x2e6f20,_0x20064c){return function(_0x2dfa27){if(_0x2dfa27){return _0x2dfa27[_0x64d8('0x26')]()[_0x64d8('0x25')](function(){_0x2e6f20[_0x64d8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16280e,_0x5048a8){return function(_0x54a0d0){if(!_0x54a0d0){_0x16280e[_0x64d8('0x1b')](0x194);}return _0x54a0d0;};}function handleError(_0x586124,_0x4c3c54){_0x4c3c54=_0x4c3c54||0x1f4;return function(_0x407ae9){logger[_0x64d8('0x27')](_0x407ae9[_0x64d8('0x28')]);if(_0x407ae9[_0x64d8('0x29')]){delete _0x407ae9[_0x64d8('0x29')];}_0x586124['status'](_0x4c3c54)[_0x64d8('0x2a')](_0x407ae9);};}exports[_0x64d8('0x2b')]=function(_0xd598f1,_0x156230){var _0x343fcc={},_0x91822b={},_0x45af30={'count':0x0,'rows':[]};var _0x5692b8=_[_0x64d8('0x2c')](db[_0x64d8('0x2d')][_0x64d8('0x2e')],function(_0x473353){return{'name':_0x473353[_0x64d8('0x2f')],'type':_0x473353[_0x64d8('0x30')][_0x64d8('0x31')]};});_0x91822b['model']=_[_0x64d8('0x2c')](_0x5692b8,_0x64d8('0x29'));_0x91822b[_0x64d8('0x32')]=_[_0x64d8('0x33')](_0xd598f1[_0x64d8('0x32')]);_0x91822b[_0x64d8('0x34')]=_[_0x64d8('0x35')](_0x91822b[_0x64d8('0x36')],_0x91822b['query']);_0x343fcc[_0x64d8('0x37')]=_['intersection'](_0x91822b['model'],qs[_0x64d8('0x38')](_0xd598f1[_0x64d8('0x32')][_0x64d8('0x38')]));_0x343fcc['attributes']=_0x343fcc[_0x64d8('0x37')]['length']?_0x343fcc[_0x64d8('0x37')]:_0x91822b[_0x64d8('0x36')];if(!_0xd598f1[_0x64d8('0x32')]['hasOwnProperty'](_0x64d8('0x39'))){_0x343fcc[_0x64d8('0x21')]=qs[_0x64d8('0x21')](_0xd598f1['query'][_0x64d8('0x21')]);_0x343fcc['offset']=qs[_0x64d8('0x1f')](_0xd598f1[_0x64d8('0x32')]['offset']);}_0x343fcc[_0x64d8('0x3a')]=qs[_0x64d8('0x3b')](_0xd598f1[_0x64d8('0x32')][_0x64d8('0x3b')]);_0x343fcc['where']=qs[_0x64d8('0x34')](_['pick'](_0xd598f1[_0x64d8('0x32')],_0x91822b['filters']),_0x5692b8);if(_0xd598f1['query']['filter']){_0x343fcc['where']=_[_0x64d8('0x3c')](_0x343fcc[_0x64d8('0x3d')],{'$or':_['map'](_0x5692b8,function(_0x57c00d){if(_0x57c00d[_0x64d8('0x30')]!==_0x64d8('0x3e')){var _0xb45492={};_0xb45492[_0x57c00d[_0x64d8('0x29')]]={'$like':'%'+_0xd598f1[_0x64d8('0x32')][_0x64d8('0x3f')]+'%'};return _0xb45492;}})});}_0x343fcc=_[_0x64d8('0x3c')]({},_0x343fcc,_0xd598f1['options']);var _0x4b17af={'where':_0x343fcc[_0x64d8('0x3d')]};return db[_0x64d8('0x2d')][_0x64d8('0x22')](_0x4b17af)[_0x64d8('0x25')](function(_0x8a0ab0){_0x45af30[_0x64d8('0x22')]=_0x8a0ab0;if(_0xd598f1['query'][_0x64d8('0x40')]){_0x343fcc['include']=[{'all':!![]}];}return db[_0x64d8('0x2d')][_0x64d8('0x41')](_0x343fcc);})[_0x64d8('0x25')](function(_0x438d5e){_0x45af30[_0x64d8('0x42')]=_0x438d5e;return _0x45af30;})[_0x64d8('0x25')](respondWithFilteredResult(_0x156230,_0x343fcc))[_0x64d8('0x43')](handleError(_0x156230,null));};exports['show']=function(_0x24f5ea,_0x55b378){var _0x460bce={'raw':!![],'where':{'id':_0x24f5ea[_0x64d8('0x44')]['id']}},_0x77eef0={};_0x77eef0[_0x64d8('0x36')]=_[_0x64d8('0x33')](db[_0x64d8('0x2d')][_0x64d8('0x2e')]);_0x77eef0['query']=_[_0x64d8('0x33')](_0x24f5ea[_0x64d8('0x32')]);_0x77eef0['filters']=_[_0x64d8('0x35')](_0x77eef0[_0x64d8('0x36')],_0x77eef0[_0x64d8('0x32')]);_0x460bce[_0x64d8('0x37')]=_['intersection'](_0x77eef0['model'],qs[_0x64d8('0x38')](_0x24f5ea[_0x64d8('0x32')]['fields']));_0x460bce[_0x64d8('0x37')]=_0x460bce['attributes'][_0x64d8('0x45')]?_0x460bce[_0x64d8('0x37')]:_0x77eef0[_0x64d8('0x36')];if(_0x24f5ea[_0x64d8('0x32')][_0x64d8('0x40')]){_0x460bce[_0x64d8('0x46')]=[{'all':!![]}];}_0x460bce=_[_0x64d8('0x3c')]({},_0x460bce,_0x24f5ea[_0x64d8('0x47')]);return db[_0x64d8('0x2d')][_0x64d8('0x48')](_0x460bce)[_0x64d8('0x25')](handleEntityNotFound(_0x55b378,null))[_0x64d8('0x25')](respondWithResult(_0x55b378,null))[_0x64d8('0x43')](handleError(_0x55b378,null));};exports[_0x64d8('0x49')]=function(_0x576728,_0x1694cb){return db[_0x64d8('0x2d')][_0x64d8('0x49')](_0x576728[_0x64d8('0x4a')],{})[_0x64d8('0x25')](respondWithResult(_0x1694cb,0xc9))['catch'](handleError(_0x1694cb,null));};exports[_0x64d8('0x4b')]=function(_0x3d1651,_0x15fac6){if(_0x3d1651[_0x64d8('0x4a')]['id']){delete _0x3d1651['body']['id'];}return db[_0x64d8('0x2d')][_0x64d8('0x48')]({'where':{'id':_0x3d1651['params']['id']}})['then'](handleEntityNotFound(_0x15fac6,null))[_0x64d8('0x25')](saveUpdates(_0x3d1651[_0x64d8('0x4a')],null))[_0x64d8('0x25')](respondWithResult(_0x15fac6,null))['catch'](handleError(_0x15fac6,null));};exports[_0x64d8('0x26')]=function(_0x1f7020,_0x452ad3){return db[_0x64d8('0x2d')][_0x64d8('0x48')]({'where':{'id':_0x1f7020[_0x64d8('0x44')]['id']}})[_0x64d8('0x25')](handleEntityNotFound(_0x452ad3,null))[_0x64d8('0x25')](removeEntity(_0x452ad3,null))['catch'](handleError(_0x452ad3,null));};exports[_0x64d8('0x4c')]=function(_0x22af40,_0x555f47){return db[_0x64d8('0x2d')][_0x64d8('0x4c')]()['then'](respondWithResult(_0x555f47,null))['catch'](handleError(_0x555f47,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0b94886..303908c 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 _0x19a5=['./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x262f47,_0x300945){var _0x557f7c=function(_0x8988d0){while(--_0x8988d0){_0x262f47['push'](_0x262f47['shift']());}};_0x557f7c(++_0x300945);}(_0x19a5,0x1cc));var _0x519a=function(_0x580bbb,_0x41f7ab){_0x580bbb=_0x580bbb-0x0;var _0x2922f6=_0x19a5[_0x580bbb];return _0x2922f6;};'use strict';var _=require(_0x519a('0x0'));var util=require(_0x519a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x519a('0x2'));var BPromise=require(_0x519a('0x3'));var rp=require(_0x519a('0x4'));var fs=require('fs');var path=require(_0x519a('0x5'));var rimraf=require(_0x519a('0x6'));var config=require(_0x519a('0x7'));var attributes=require(_0x519a('0x8'));module[_0x519a('0x9')]=function(_0x1fe543,_0x501568){return _0x1fe543[_0x519a('0xa')](_0x519a('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a29=['bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','api','moment'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x3a29,0x101));var _0x93a2=function(_0x411516,_0x396c3e){_0x411516=_0x411516-0x0;var _0x1cbec0=_0x3a29[_0x411516];return _0x1cbec0;};'use strict';var _=require(_0x93a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x93a2('0x1'));var moment=require(_0x93a2('0x2'));var BPromise=require(_0x93a2('0x3'));var rp=require(_0x93a2('0x4'));var fs=require('fs');var path=require(_0x93a2('0x5'));var rimraf=require('rimraf');var config=require(_0x93a2('0x6'));var attributes=require(_0x93a2('0x7'));module[_0x93a2('0x8')]=function(_0x31ba70,_0x6d4769){return _0x31ba70[_0x93a2('0x9')](_0x93a2('0xa'),attributes,{'tableName':_0x93a2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x93a2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index aebc59c..07b3dac 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 _0x0ff2=['result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2a7ca2,_0x3aa628){var _0xc13d26=function(_0xe2806d){while(--_0xe2806d){_0x2a7ca2['push'](_0x2a7ca2['shift']());}};_0xc13d26(++_0x3aa628);}(_0x0ff2,0x87));var _0x20ff=function(_0x57c57e,_0x144734){_0x57c57e=_0x57c57e-0x0;var _0x4b72c8=_0x0ff2[_0x57c57e];return _0x4b72c8;};'use strict';var _=require(_0x20ff('0x0'));var util=require('util');var moment=require(_0x20ff('0x1'));var BPromise=require('bluebird');var rs=require(_0x20ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x20ff('0x4'))(_0x20ff('0x5'));var config=require(_0x20ff('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x20ff('0x7')][_0x20ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27ab74,_0x270dcd,_0x21e8ec){return new BPromise(function(_0x55957a,_0xe29340){return client[_0x20ff('0x9')](_0x27ab74,_0x21e8ec)[_0x20ff('0xa')](function(_0x1cc40c){logger['info'](_0x20ff('0xb'),_0x270dcd,_0x20ff('0xc'));logger[_0x20ff('0xd')](_0x20ff('0xe'),_0x270dcd,_0x20ff('0xc'),JSON[_0x20ff('0xf')](_0x1cc40c));if(_0x1cc40c[_0x20ff('0x10')]){if(_0x1cc40c[_0x20ff('0x10')][_0x20ff('0x11')]===0x1f4){logger[_0x20ff('0x10')](_0x20ff('0xb'),_0x270dcd,_0x1cc40c[_0x20ff('0x10')][_0x20ff('0x12')]);return _0xe29340(_0x1cc40c[_0x20ff('0x10')][_0x20ff('0x12')]);}logger[_0x20ff('0x10')](_0x20ff('0xb'),_0x270dcd,_0x1cc40c[_0x20ff('0x10')][_0x20ff('0x12')]);return _0x55957a(_0x1cc40c['error'][_0x20ff('0x12')]);}else{logger[_0x20ff('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x270dcd,_0x20ff('0xc'));_0x55957a(_0x1cc40c[_0x20ff('0x14')]['message']);}})[_0x20ff('0x15')](function(_0x1c794c){logger[_0x20ff('0x10')](_0x20ff('0xb'),_0x270dcd,_0x1c794c);_0xe29340(_0x1c794c);});});}exports[_0x20ff('0x16')]=function(_0x2e3fde){var _0x173612=this;return new Promise(function(_0x512bc8,_0xd5a4c3){return db[_0x20ff('0x17')]['create'](_0x2e3fde[_0x20ff('0x18')],{'raw':_0x2e3fde[_0x20ff('0x19')]?_0x2e3fde[_0x20ff('0x19')][_0x20ff('0x1a')]===undefined?!![]:![]:!![]})[_0x20ff('0xa')](function(_0x1ed798){logger[_0x20ff('0x13')](_0x20ff('0x16'),_0x2e3fde);logger['debug'](_0x20ff('0x16'),_0x2e3fde,JSON['stringify'](_0x1ed798));_0x512bc8(_0x1ed798);})[_0x20ff('0x15')](function(_0x1b582b){logger[_0x20ff('0x10')]('CreateVoiceDialReport',_0x1b582b[_0x20ff('0x12')],_0x2e3fde);_0xd5a4c3(_0x173612[_0x20ff('0x10')](0x1f4,_0x1b582b[_0x20ff('0x12')]));});});};exports[_0x20ff('0x1b')]=function(_0x5c4d7d){var _0x27aa45=this;return new Promise(function(_0x3a7bb2,_0x4c64ed){return db[_0x20ff('0x17')][_0x20ff('0x1c')](_0x5c4d7d[_0x20ff('0x18')],{'raw':_0x5c4d7d[_0x20ff('0x19')]?_0x5c4d7d['options'][_0x20ff('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c4d7d[_0x20ff('0x19')]?_0x5c4d7d[_0x20ff('0x19')]['where']||null:null,'attributes':_0x5c4d7d[_0x20ff('0x19')]?_0x5c4d7d[_0x20ff('0x19')][_0x20ff('0x1d')]||null:null,'limit':_0x5c4d7d['options']?_0x5c4d7d[_0x20ff('0x19')][_0x20ff('0x1e')]||null:null})[_0x20ff('0xa')](function(_0x17b8af){logger[_0x20ff('0x13')](_0x20ff('0x1b'),_0x5c4d7d);logger[_0x20ff('0xd')](_0x20ff('0x1b'),_0x5c4d7d,JSON['stringify'](_0x17b8af));_0x3a7bb2(_0x17b8af);})[_0x20ff('0x15')](function(_0x37b60a){logger['error'](_0x20ff('0x1b'),_0x37b60a['message'],_0x5c4d7d);_0x4c64ed(_0x27aa45[_0x20ff('0x10')](0x1f4,_0x37b60a['message']));});});}; \ No newline at end of file +var _0xd313=['info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','stringify','UpdateVoiceDialReport','update','body','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x18df92,_0x2156f1){var _0x4282f4=function(_0x2dd49f){while(--_0x2dd49f){_0x18df92['push'](_0x18df92['shift']());}};_0x4282f4(++_0x2156f1);}(_0xd313,0x17f));var _0x3d31=function(_0x541fdf,_0x268606){_0x541fdf=_0x541fdf-0x0;var _0x3f11cf=_0xd313[_0x541fdf];return _0x3f11cf;};'use strict';var _=require(_0x3d31('0x0'));var util=require(_0x3d31('0x1'));var moment=require(_0x3d31('0x2'));var BPromise=require(_0x3d31('0x3'));var rs=require(_0x3d31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d31('0x5'))['db'];var utils=require(_0x3d31('0x6'));var logger=require(_0x3d31('0x7'))(_0x3d31('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d31('0x9'));var client=jayson[_0x3d31('0xa')][_0x3d31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f188d,_0x227abf,_0x351dcb){return new BPromise(function(_0x33941b,_0x41a1e1){return client['request'](_0x5f188d,_0x351dcb)[_0x3d31('0xc')](function(_0x436564){logger[_0x3d31('0xd')](_0x3d31('0xe'),_0x227abf,'request\x20sent');logger[_0x3d31('0xf')](_0x3d31('0x10'),_0x227abf,'request\x20sent',JSON['stringify'](_0x436564));if(_0x436564[_0x3d31('0x11')]){if(_0x436564[_0x3d31('0x11')]['code']===0x1f4){logger[_0x3d31('0x11')](_0x3d31('0xe'),_0x227abf,_0x436564[_0x3d31('0x11')][_0x3d31('0x12')]);return _0x41a1e1(_0x436564[_0x3d31('0x11')][_0x3d31('0x12')]);}logger[_0x3d31('0x11')](_0x3d31('0xe'),_0x227abf,_0x436564[_0x3d31('0x11')][_0x3d31('0x12')]);return _0x33941b(_0x436564[_0x3d31('0x11')][_0x3d31('0x12')]);}else{logger[_0x3d31('0xd')](_0x3d31('0xe'),_0x227abf,_0x3d31('0x13'));_0x33941b(_0x436564[_0x3d31('0x14')][_0x3d31('0x12')]);}})[_0x3d31('0x15')](function(_0x48f0b5){logger[_0x3d31('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x227abf,_0x48f0b5);_0x41a1e1(_0x48f0b5);});});}exports[_0x3d31('0x16')]=function(_0x1ad648){var _0x5ddcb9=this;return new Promise(function(_0x454636,_0x19ed99){return db[_0x3d31('0x17')][_0x3d31('0x18')](_0x1ad648['body'],{'raw':_0x1ad648['options']?_0x1ad648[_0x3d31('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3d31('0xc')](function(_0x490b4a){logger[_0x3d31('0xd')](_0x3d31('0x16'),_0x1ad648);logger[_0x3d31('0xf')](_0x3d31('0x16'),_0x1ad648,JSON[_0x3d31('0x1a')](_0x490b4a));_0x454636(_0x490b4a);})[_0x3d31('0x15')](function(_0x295e76){logger['error'](_0x3d31('0x16'),_0x295e76[_0x3d31('0x12')],_0x1ad648);_0x19ed99(_0x5ddcb9[_0x3d31('0x11')](0x1f4,_0x295e76[_0x3d31('0x12')]));});});};exports[_0x3d31('0x1b')]=function(_0x4a0983){var _0x5294eb=this;return new Promise(function(_0x5cd772,_0x3529bd){return db[_0x3d31('0x17')][_0x3d31('0x1c')](_0x4a0983[_0x3d31('0x1d')],{'raw':_0x4a0983[_0x3d31('0x19')]?_0x4a0983[_0x3d31('0x19')][_0x3d31('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0983[_0x3d31('0x19')]?_0x4a0983[_0x3d31('0x19')]['where']||null:null,'attributes':_0x4a0983[_0x3d31('0x19')]?_0x4a0983[_0x3d31('0x19')][_0x3d31('0x1f')]||null:null,'limit':_0x4a0983['options']?_0x4a0983[_0x3d31('0x19')][_0x3d31('0x20')]||null:null})[_0x3d31('0xc')](function(_0x17b3a4){logger[_0x3d31('0xd')](_0x3d31('0x1b'),_0x4a0983);logger['debug']('UpdateVoiceDialReport',_0x4a0983,JSON['stringify'](_0x17b3a4));_0x5cd772(_0x17b3a4);})[_0x3d31('0x15')](function(_0x4db3a1){logger[_0x3d31('0x11')](_0x3d31('0x1b'),_0x4db3a1[_0x3d31('0x12')],_0x4a0983);_0x3529bd(_0x5294eb[_0x3d31('0x11')](0x1f4,_0x4db3a1[_0x3d31('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 3dbe972..e4fbaad 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 _0xc412=['exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy'];(function(_0x373595,_0x18c512){var _0x5ae0ff=function(_0x40a21a){while(--_0x40a21a){_0x373595['push'](_0x373595['shift']());}};_0x5ae0ff(++_0x18c512);}(_0xc412,0x79));var _0x2c41=function(_0x17a5f4,_0x3920d){_0x17a5f4=_0x17a5f4-0x0;var _0x5c27ff=_0xc412[_0x17a5f4];return _0x5c27ff;};'use strict';var multer=require('multer');var util=require(_0x2c41('0x0'));var path=require(_0x2c41('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c41('0x2')]();var fs_extra=require(_0x2c41('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c41('0x4'));var config=require(_0x2c41('0x5'));var controller=require(_0x2c41('0x6'));router[_0x2c41('0x7')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0x9')]);router[_0x2c41('0x7')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller[_0x2c41('0xb')]);router[_0x2c41('0xc')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0xd')]);router['post'](_0x2c41('0xe'),auth['isAuthenticated'](),controller[_0x2c41('0xf')]);router[_0x2c41('0x10')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller[_0x2c41('0x11')]);router['delete'](_0x2c41('0xa'),auth['isAuthenticated'](),controller[_0x2c41('0x12')]);module[_0x2c41('0x13')]=router; \ No newline at end of file +var _0xa68e=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','/:id/applications','addApplications','update','delete','destroy','exports'];(function(_0x8a6fd6,_0x1a64d3){var _0x1775a1=function(_0x78942d){while(--_0x78942d){_0x8a6fd6['push'](_0x8a6fd6['shift']());}};_0x1775a1(++_0x1a64d3);}(_0xa68e,0x111));var _0xea68=function(_0x4be3e7,_0x3a7f05){_0x4be3e7=_0x4be3e7-0x0;var _0x4d44a0=_0xa68e[_0x4be3e7];return _0x4d44a0;};'use strict';var multer=require(_0xea68('0x0'));var util=require(_0xea68('0x1'));var path=require(_0xea68('0x2'));var timeout=require(_0xea68('0x3'));var express=require('express');var router=express[_0xea68('0x4')]();var fs_extra=require(_0xea68('0x5'));var auth=require(_0xea68('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea68('0x7'));router[_0xea68('0x8')]('/',auth[_0xea68('0x9')](),controller[_0xea68('0xa')]);router[_0xea68('0x8')](_0xea68('0xb'),auth[_0xea68('0x9')](),controller[_0xea68('0xc')]);router['post']('/',auth[_0xea68('0x9')](),controller[_0xea68('0xd')]);router[_0xea68('0xe')](_0xea68('0xf'),auth[_0xea68('0x9')](),controller[_0xea68('0x10')]);router['put'](_0xea68('0xb'),auth[_0xea68('0x9')](),controller[_0xea68('0x11')]);router[_0xea68('0x12')](_0xea68('0xb'),auth['isAuthenticated'](),controller[_0xea68('0x13')]);module[_0xea68('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index e0cd6e2..864c7e5 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 _0x519d=['exten','sequelize','exports','STRING','compositeIndex','inbound','outbound','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue'];(function(_0x437e3a,_0x49527b){var _0x619f93=function(_0x3eff2a){while(--_0x3eff2a){_0x437e3a['push'](_0x437e3a['shift']());}};_0x619f93(++_0x49527b);}(_0x519d,0x1b4));var _0xd519=function(_0x2388b1,_0x337850){_0x2388b1=_0x2388b1-0x0;var _0x4187cc=_0x519d[_0x2388b1];return _0x4187cc;};'use strict';var Sequelize=require(_0xd519('0x0'));module[_0xd519('0x1')]={'context':{'type':Sequelize[_0xd519('0x2')],'allowNull':![],'unique':_0xd519('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xd519('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd519('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd519('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xd519('0x4'),_0xd519('0x5'),'internal','inbound-fax',_0xd519('0x6'),'system',_0xd519('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xd519('0x2')]},'interval':{'type':Sequelize[_0xd519('0x2')],'allowNull':![],'defaultValue':_0xd519('0x8')},'IntervalId':{'type':Sequelize[_0xd519('0x9')]},'isApp':{'type':Sequelize[_0xd519('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xd519('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd519('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd519('0x9')]},'recordingFormat':{'type':Sequelize[_0xd519('0x2')],'defaultValue':_0xd519('0xb')},'answer':{'type':Sequelize[_0xd519('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd519('0xc')],'get':function(_0x3d438c){return this[_0xd519('0xd')](_0xd519('0xe'));}},'alias':{'type':Sequelize[_0xd519('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc2f5=['getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','internal','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2f5,0x15b));var _0x5c2f=function(_0x4d305d,_0x294171){_0x4d305d=_0x4d305d-0x0;var _0xdd9891=_0xc2f5[_0x4d305d];return _0xdd9891;};'use strict';var Sequelize=require(_0x5c2f('0x0'));module['exports']={'context':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':![],'unique':_0x5c2f('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x5c2f('0x2')},'tag':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':![],'defaultValue':_0x5c2f('0x3')},'appdata':{'type':Sequelize[_0x5c2f('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5c2f('0x4')]('inbound','outbound',_0x5c2f('0x5'),'inbound-fax','outbound-fax',_0x5c2f('0x6'),_0x5c2f('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0x5c2f('0x1')]},'interval':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':![],'defaultValue':_0x5c2f('0x8')},'IntervalId':{'type':Sequelize[_0x5c2f('0x9')]},'isApp':{'type':Sequelize[_0x5c2f('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5c2f('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5c2f('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x5c2f('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5c2f('0x9')]},'recordingFormat':{'type':Sequelize[_0x5c2f('0x1')],'defaultValue':_0x5c2f('0xb')},'answer':{'type':Sequelize[_0x5c2f('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5c2f('0xc')],'get':function(_0x481ce0){return this[_0x5c2f('0xd')](_0x5c2f('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 7b7e945..617a07a 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 _0xa4ef=['body','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','mandatoryDisposition','alias','addApplications','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','finally','json','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','value','type','find','name','stack','send','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','options','VoiceExtension','includeAll','findAll','rows','catch','params','include','startsWith'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0xa4ef,0x12b));var _0xfa4e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xa4ef[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var Redis=require(_0xfa4e('0x0'));var qs=require(_0xfa4e('0x1'));var logger=require('../../config/logger')(_0xfa4e('0x2'));var config=require(_0xfa4e('0x3'));var db=require(_0xfa4e('0x4'))['db'];config[_0xfa4e('0x5')]=_[_0xfa4e('0x6')](config[_0xfa4e('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa4e('0x7'))(new Redis(config[_0xfa4e('0x5')]));require('./voiceExtension.socket')[_0xfa4e('0x8')](socket);function respondWithStatusCode(_0x4f3038,_0x21794c){_0x21794c=_0x21794c||0xcc;return function(_0x3b982f){if(_0x3b982f){return _0x4f3038[_0xfa4e('0x9')](_0x21794c);}return _0x4f3038['status'](_0x21794c)[_0xfa4e('0xa')]();};}function respondWithResult(_0x2b2054,_0x1e88c0){_0x1e88c0=_0x1e88c0||0xc8;return function(_0x1855e9){if(_0x1855e9){return _0x2b2054[_0xfa4e('0xb')](_0x1e88c0)['json'](_0x1855e9);}};}function respondWithFilteredResult(_0x617f88,_0x4cfc8f){return function(_0x908cb4){if(_0x908cb4){var _0x51bf61=typeof _0x4cfc8f['offset']===_0xfa4e('0xc')&&typeof _0x4cfc8f[_0xfa4e('0xd')]==='undefined';var _0x191276=_0x908cb4[_0xfa4e('0xe')];var _0x40cf09=_0x51bf61?0x0:_0x4cfc8f[_0xfa4e('0xf')];var _0x553d1e=_0x51bf61?_0x908cb4[_0xfa4e('0xe')]:_0x4cfc8f[_0xfa4e('0xf')]+_0x4cfc8f[_0xfa4e('0xd')];var _0x4a48f1;if(_0x553d1e>=_0x191276){_0x553d1e=_0x191276;_0x4a48f1=0xc8;}else{_0x4a48f1=0xce;}_0x617f88[_0xfa4e('0xb')](_0x4a48f1);return _0x617f88[_0xfa4e('0x10')](_0xfa4e('0x11'),_0x40cf09+'-'+_0x553d1e+'/'+_0x191276)['json'](_0x908cb4);}return null;};}function removeEntity(_0xcb7ecc){return function(_0x6ba25a){if(_0x6ba25a){return _0x6ba25a[_0xfa4e('0x12')]()[_0xfa4e('0x13')](function(){var _0x5d5119=_0x6ba25a['get']({'plain':!![]});var _0x19128c=[{'name':_0xfa4e('0x14'),'value':_0xfa4e('0x15'),'ignore':![]},{'name':_0xfa4e('0x16'),'value':_0xfa4e('0x17'),'ignore':![]},{'name':_0xfa4e('0x18'),'value':_0xfa4e('0x19'),'ignore':![]}];var _0x5954e3=_(_0x19128c)['filter']('ignore')['map'](_0xfa4e('0x1a'))[_0xfa4e('0x1a')]();if(_['includes'](_0x5954e3,_0x5d5119[_0xfa4e('0x1b')])){return;}var _0x4fe7c0=_[_0xfa4e('0x1c')](_0x19128c,['value',_0x5d5119[_0xfa4e('0x1b')]])[_0xfa4e('0x1d')];return db['UserProfileResource']['destroy']({'where':{'type':_0x4fe7c0,'resourceId':_0x5d5119['id']}})[_0xfa4e('0x13')](function(){return _0x6ba25a;});})[_0xfa4e('0x13')](function(){_0xcb7ecc[_0xfa4e('0xb')](0xcc)[_0xfa4e('0xa')]();});}};}function handleEntityNotFound(_0x44e8f3){return function(_0xf8e318){if(!_0xf8e318){_0x44e8f3[_0xfa4e('0x9')](0x194);}return _0xf8e318;};}function handleError(_0x4172b6,_0x35d244){_0x35d244=_0x35d244||0x1f4;return function(_0xdfc574){logger['error'](_0xdfc574[_0xfa4e('0x1e')]);if(_0xdfc574[_0xfa4e('0x1d')]){delete _0xdfc574[_0xfa4e('0x1d')];}_0x4172b6[_0xfa4e('0xb')](_0x35d244)[_0xfa4e('0x1f')](_0xdfc574);};}exports[_0xfa4e('0x20')]=function(_0x53d4c1,_0x26a885){var _0x5429d1={},_0x36bed6={},_0x155ef2={'count':0x0,'rows':[]};var _0x227c2d=_['map'](db['VoiceExtension'][_0xfa4e('0x21')],function(_0x36c3b3){return{'name':_0x36c3b3[_0xfa4e('0x22')],'type':_0x36c3b3[_0xfa4e('0x1b')][_0xfa4e('0x23')]};});_0x36bed6['model']=_['map'](_0x227c2d,_0xfa4e('0x1d'));_0x36bed6[_0xfa4e('0x24')]=_[_0xfa4e('0x25')](_0x53d4c1[_0xfa4e('0x24')]);_0x36bed6[_0xfa4e('0x26')]=_[_0xfa4e('0x27')](_0x36bed6[_0xfa4e('0x28')],_0x36bed6[_0xfa4e('0x24')]);_0x5429d1[_0xfa4e('0x29')]=_[_0xfa4e('0x27')](_0x36bed6[_0xfa4e('0x28')],qs[_0xfa4e('0x2a')](_0x53d4c1[_0xfa4e('0x24')][_0xfa4e('0x2a')]));_0x5429d1[_0xfa4e('0x29')]=_0x5429d1[_0xfa4e('0x29')][_0xfa4e('0x2b')]?_0x5429d1[_0xfa4e('0x29')]:_0x36bed6[_0xfa4e('0x28')];if(!_0x53d4c1['query']['hasOwnProperty'](_0xfa4e('0x2c'))){_0x5429d1[_0xfa4e('0xd')]=qs[_0xfa4e('0xd')](_0x53d4c1[_0xfa4e('0x24')][_0xfa4e('0xd')]);_0x5429d1['offset']=qs[_0xfa4e('0xf')](_0x53d4c1['query'][_0xfa4e('0xf')]);}_0x5429d1[_0xfa4e('0x2d')]=qs[_0xfa4e('0x2e')](_0x53d4c1[_0xfa4e('0x24')]['sort']);_0x5429d1['where']=qs['filters'](_[_0xfa4e('0x2f')](_0x53d4c1[_0xfa4e('0x24')],_0x36bed6[_0xfa4e('0x26')]),_0x227c2d);if(_0x53d4c1[_0xfa4e('0x24')][_0xfa4e('0x30')]){_0x5429d1[_0xfa4e('0x31')]=_[_0xfa4e('0x32')](_0x5429d1[_0xfa4e('0x31')],{'$or':_[_0xfa4e('0x33')](_0x227c2d,function(_0x8c6af7){if(_0x8c6af7[_0xfa4e('0x1b')]!=='VIRTUAL'){var _0x78f031={};_0x78f031[_0x8c6af7['name']]={'$like':'%'+_0x53d4c1[_0xfa4e('0x24')][_0xfa4e('0x30')]+'%'};return _0x78f031;}})});}_0x5429d1=_[_0xfa4e('0x32')]({},_0x5429d1,_0x53d4c1[_0xfa4e('0x34')]);var _0x4b64c3={'where':_0x5429d1[_0xfa4e('0x31')]};return db[_0xfa4e('0x35')][_0xfa4e('0xe')](_0x4b64c3)[_0xfa4e('0x13')](function(_0x43b877){_0x155ef2[_0xfa4e('0xe')]=_0x43b877;if(_0x53d4c1[_0xfa4e('0x24')][_0xfa4e('0x36')]){_0x5429d1['include']=[{'all':!![]}];}return db[_0xfa4e('0x35')][_0xfa4e('0x37')](_0x5429d1);})[_0xfa4e('0x13')](function(_0x2510cf){_0x155ef2[_0xfa4e('0x38')]=_0x2510cf;return _0x155ef2;})['then'](respondWithFilteredResult(_0x26a885,_0x5429d1))[_0xfa4e('0x39')](handleError(_0x26a885,null));};exports['show']=function(_0x8ad6e7,_0x22eba9){var _0x48b8a8={'raw':![],'where':{'id':_0x8ad6e7[_0xfa4e('0x3a')]['id']}},_0x3ae001={};_0x3ae001[_0xfa4e('0x28')]=_[_0xfa4e('0x25')](db[_0xfa4e('0x35')][_0xfa4e('0x21')]);_0x3ae001['query']=_[_0xfa4e('0x25')](_0x8ad6e7[_0xfa4e('0x24')]);_0x3ae001[_0xfa4e('0x26')]=_[_0xfa4e('0x27')](_0x3ae001[_0xfa4e('0x28')],_0x3ae001[_0xfa4e('0x24')]);_0x48b8a8[_0xfa4e('0x29')]=_[_0xfa4e('0x27')](_0x3ae001[_0xfa4e('0x28')],qs[_0xfa4e('0x2a')](_0x8ad6e7[_0xfa4e('0x24')][_0xfa4e('0x2a')]));_0x48b8a8[_0xfa4e('0x29')]=_0x48b8a8[_0xfa4e('0x29')]['length']?_0x48b8a8[_0xfa4e('0x29')]:_0x3ae001[_0xfa4e('0x28')];if(_0x8ad6e7[_0xfa4e('0x24')][_0xfa4e('0x36')]){_0x48b8a8[_0xfa4e('0x3b')]=[{'all':!![]}];}_0x48b8a8=_[_0xfa4e('0x32')]({},_0x48b8a8,_0x8ad6e7[_0xfa4e('0x34')]);return db[_0xfa4e('0x35')]['find'](_0x48b8a8)[_0xfa4e('0x13')](handleEntityNotFound(_0x22eba9,null))[_0xfa4e('0x13')](respondWithResult(_0x22eba9,null))[_0xfa4e('0x39')](handleError(_0x22eba9,null));};exports[_0xfa4e('0x12')]=function(_0x3089c0,_0x526405){return db[_0xfa4e('0x35')]['find']({'where':{'id':_0x3089c0[_0xfa4e('0x3a')]['id']}})[_0xfa4e('0x13')](handleEntityNotFound(_0x526405,null))[_0xfa4e('0x13')](removeEntity(_0x526405,null))[_0xfa4e('0x39')](handleError(_0x526405,null));};exports['create']=function(_0x38a1a2,_0x45de31){if(_0x38a1a2['body'][_0xfa4e('0x1b')]===_0xfa4e('0x17')&&!_[_0xfa4e('0x3c')](_0x38a1a2[_0xfa4e('0x3d')][_0xfa4e('0x3e')],'_')){_0x38a1a2[_0xfa4e('0x3d')][_0xfa4e('0x3e')]='_'[_0xfa4e('0x3f')](_0x38a1a2['body']['exten']);}return db[_0xfa4e('0x35')][_0xfa4e('0x40')](_0x38a1a2['body'],{'raw':![]})['then'](function(_0x19e861){var _0x34da59=_0x38a1a2[_0xfa4e('0x41')][_0xfa4e('0x42')]({'plain':!![]});if(!_0x34da59)throw new Error(_0xfa4e('0x43'));if(_0x34da59[_0xfa4e('0x44')]===_0xfa4e('0x41')){var _0x19819=_0x19e861[_0xfa4e('0x42')]({'plain':!![]});var _0xfd58=[{'name':_0xfa4e('0x14'),'value':'inbound'},{'name':_0xfa4e('0x16'),'value':_0xfa4e('0x17')},{'name':'InternalRoutes','value':_0xfa4e('0x19')}];var _0x1fbd0e=_[_0xfa4e('0x1c')](_0xfd58,[_0xfa4e('0x1a'),_0x19819[_0xfa4e('0x1b')]])['name'];return db[_0xfa4e('0x45')]['find']({'where':{'name':_0x1fbd0e,'userProfileId':_0x34da59['userProfileId']},'raw':!![]})[_0xfa4e('0x13')](function(_0x55a98c){if(_0x55a98c&&_0x55a98c[_0xfa4e('0x46')]===0x0){return db[_0xfa4e('0x47')][_0xfa4e('0x40')]({'name':_0x19819[_0xfa4e('0x1d')],'resourceId':_0x19819['id'],'type':_0x55a98c[_0xfa4e('0x1d')],'sectionId':_0x55a98c['id']},{})[_0xfa4e('0x13')](function(){return _0x19e861;});}else{return _0x19e861;}})[_0xfa4e('0x39')](function(_0x5309c6){logger[_0xfa4e('0x48')](_0xfa4e('0x49'),_0x5309c6);throw _0x5309c6;});}return _0x19e861;})[_0xfa4e('0x13')](respondWithResult(_0x45de31,0xc9))[_0xfa4e('0x39')](handleError(_0x45de31,null));};exports[_0xfa4e('0x4a')]=function(_0x5622f1,_0x9c3e8f){if(_0x5622f1['body']['id']){delete _0x5622f1['body']['id'];}return db[_0xfa4e('0x35')][_0xfa4e('0x1c')]({'where':{'id':_0x5622f1['params']['id']}})['then'](handleEntityNotFound(_0x9c3e8f,null))[_0xfa4e('0x13')](function(_0x103946){if(_0x103946){return db[_0xfa4e('0x35')][_0xfa4e('0x4a')](_[_0xfa4e('0x2f')](_0x5622f1[_0xfa4e('0x3d')],[_0xfa4e('0x3e'),_0xfa4e('0x4b'),'description',_0xfa4e('0x4c'),'cutdigits',_0xfa4e('0x4d'),_0xfa4e('0x4e')]),{'where':{'context':_0x103946[_0xfa4e('0x4b')],'exten':_0x103946[_0xfa4e('0x3e')]},'individualHooks':!![]})[_0xfa4e('0x13')](function(_0x58fd04){return _0x58fd04;});}return null;})[_0xfa4e('0x13')](respondWithStatusCode(_0x9c3e8f,null))['catch'](handleError(_0x9c3e8f,null));};exports[_0xfa4e('0x4f')]=function(_0x55a43f,_0x2179fe){var _0x5c761e=_0x55a43f[_0xfa4e('0x3a')]['id'];var _0x2457bc=_0x55a43f['body'];var _0x354e90=0xc8;var _0x3e7012=null;return db['sequelize'][_0xfa4e('0x50')]({'isolationLevel':db['sequelize'][_0xfa4e('0x51')][_0xfa4e('0x52')]['READ_COMMITTED']},function(_0x7cfda0){return db[_0xfa4e('0x35')][_0xfa4e('0x53')]({'where':{'id':_0x5c761e},'transaction':_0x7cfda0})[_0xfa4e('0x13')](function(_0x3d016c){if(_0x3d016c){return db[_0xfa4e('0x35')]['destroy']({'where':{'VoiceExtensionId':_0x5c761e},'transaction':_0x7cfda0})[_0xfa4e('0x13')](function(){var _0x1b39bf=_[_0xfa4e('0x33')](_0x2457bc,function(_0x5019aa){_0x5019aa[_0xfa4e('0x54')]=_0x5c761e;_0x5019aa[_0xfa4e('0x55')]=!![];return _0x5019aa;});return _0x3d016c[_0xfa4e('0x56')](_0x1b39bf);})[_0xfa4e('0x13')](function(_0x96992e){return db[_0xfa4e('0x35')][_0xfa4e('0x57')](_0x96992e,{'transaction':_0x7cfda0});});}else{_0x354e90=0x194;_0x3e7012=[];}});})[_0xfa4e('0x13')](function(){if(_0x354e90!==0x194){return db[_0xfa4e('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5c761e},'order':'cast(priority\x20as\x20unsigned)'})[_0xfa4e('0x13')](function(_0x214b46){_0x3e7012=_0x214b46;});}})['catch'](function(_0x20b675){_0x354e90=0x1f4;logger[_0xfa4e('0x48')](_0x20b675[_0xfa4e('0x1e')]);if(_0x20b675[_0xfa4e('0x1d')]){delete _0x20b675[_0xfa4e('0x1d')];}_0x3e7012=_0x20b675;})[_0xfa4e('0x58')](function(){if(_0x3e7012===null){_0x2179fe[_0xfa4e('0x9')](_0x354e90);}else{if(_0x354e90===0x1f4){_0x2179fe[_0xfa4e('0xb')](_0x354e90)[_0xfa4e('0x1f')](_0x3e7012);}else{_0x2179fe[_0xfa4e('0xb')](_0x354e90)[_0xfa4e('0x59')](_0x3e7012);}}});}; \ No newline at end of file +var _0xb800=['count','set','destroy','then','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','end','stack','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','undefined','limit','offset'];(function(_0x5746a1,_0x11eab1){var _0x551a43=function(_0x7ddcbe){while(--_0x7ddcbe){_0x5746a1['push'](_0x5746a1['shift']());}};_0x551a43(++_0x11eab1);}(_0xb800,0x1d4));var _0x0b80=function(_0x43d092,_0x2aaec8){_0x43d092=_0x43d092-0x0;var _0x3ef3ca=_0xb800[_0x43d092];return _0x3ef3ca;};'use strict';var _=require(_0x0b80('0x0'));var Redis=require(_0x0b80('0x1'));var qs=require(_0x0b80('0x2'));var logger=require(_0x0b80('0x3'))(_0x0b80('0x4'));var config=require(_0x0b80('0x5'));var db=require(_0x0b80('0x6'))['db'];config[_0x0b80('0x7')]=_[_0x0b80('0x8')](config[_0x0b80('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b80('0x9'))(new Redis(config[_0x0b80('0x7')]));require('./voiceExtension.socket')[_0x0b80('0xa')](socket);function respondWithStatusCode(_0x91119,_0x52992b){_0x52992b=_0x52992b||0xcc;return function(_0x6edadb){if(_0x6edadb){return _0x91119[_0x0b80('0xb')](_0x52992b);}return _0x91119[_0x0b80('0xc')](_0x52992b)['end']();};}function respondWithResult(_0x4845cb,_0x2cce2f){_0x2cce2f=_0x2cce2f||0xc8;return function(_0x1c46b5){if(_0x1c46b5){return _0x4845cb[_0x0b80('0xc')](_0x2cce2f)[_0x0b80('0xd')](_0x1c46b5);}};}function respondWithFilteredResult(_0x3aec80,_0xa62f14){return function(_0x39b3cd){if(_0x39b3cd){var _0x3950b0=typeof _0xa62f14['offset']===_0x0b80('0xe')&&typeof _0xa62f14[_0x0b80('0xf')]===_0x0b80('0xe');var _0x39b970=_0x39b3cd['count'];var _0x24b72e=_0x3950b0?0x0:_0xa62f14[_0x0b80('0x10')];var _0x3213ba=_0x3950b0?_0x39b3cd[_0x0b80('0x11')]:_0xa62f14[_0x0b80('0x10')]+_0xa62f14['limit'];var _0x437566;if(_0x3213ba>=_0x39b970){_0x3213ba=_0x39b970;_0x437566=0xc8;}else{_0x437566=0xce;}_0x3aec80['status'](_0x437566);return _0x3aec80[_0x0b80('0x12')]('Content-Range',_0x24b72e+'-'+_0x3213ba+'/'+_0x39b970)[_0x0b80('0xd')](_0x39b3cd);}return null;};}function removeEntity(_0x3bb48f){return function(_0x4b39f3){if(_0x4b39f3){return _0x4b39f3[_0x0b80('0x13')]()[_0x0b80('0x14')](function(){var _0x143a7a=_0x4b39f3[_0x0b80('0x15')]({'plain':!![]});var _0x276552=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x0b80('0x16'),'value':_0x0b80('0x17'),'ignore':![]},{'name':_0x0b80('0x18'),'value':_0x0b80('0x19'),'ignore':![]}];var _0x285f63=_(_0x276552)[_0x0b80('0x1a')](_0x0b80('0x1b'))[_0x0b80('0x1c')](_0x0b80('0x1d'))[_0x0b80('0x1d')]();if(_[_0x0b80('0x1e')](_0x285f63,_0x143a7a[_0x0b80('0x1f')])){return;}var _0x18155c=_[_0x0b80('0x20')](_0x276552,[_0x0b80('0x1d'),_0x143a7a['type']])[_0x0b80('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x18155c,'resourceId':_0x143a7a['id']}})[_0x0b80('0x14')](function(){return _0x4b39f3;});})['then'](function(){_0x3bb48f[_0x0b80('0xc')](0xcc)[_0x0b80('0x22')]();});}};}function handleEntityNotFound(_0x2de3ce){return function(_0x5a0af8){if(!_0x5a0af8){_0x2de3ce[_0x0b80('0xb')](0x194);}return _0x5a0af8;};}function handleError(_0x391b5e,_0x28f90e){_0x28f90e=_0x28f90e||0x1f4;return function(_0x5ac84f){logger['error'](_0x5ac84f[_0x0b80('0x23')]);if(_0x5ac84f[_0x0b80('0x21')]){delete _0x5ac84f[_0x0b80('0x21')];}_0x391b5e['status'](_0x28f90e)[_0x0b80('0x24')](_0x5ac84f);};}exports[_0x0b80('0x25')]=function(_0x4b123a,_0x313d33){var _0x4e6762={},_0x1c269e={},_0x5ded61={'count':0x0,'rows':[]};var _0x7673e1=_[_0x0b80('0x1c')](db['VoiceExtension'][_0x0b80('0x26')],function(_0x2614f7){return{'name':_0x2614f7[_0x0b80('0x27')],'type':_0x2614f7[_0x0b80('0x1f')][_0x0b80('0x28')]};});_0x1c269e[_0x0b80('0x29')]=_[_0x0b80('0x1c')](_0x7673e1,'name');_0x1c269e[_0x0b80('0x2a')]=_[_0x0b80('0x2b')](_0x4b123a['query']);_0x1c269e[_0x0b80('0x2c')]=_[_0x0b80('0x2d')](_0x1c269e['model'],_0x1c269e[_0x0b80('0x2a')]);_0x4e6762[_0x0b80('0x2e')]=_[_0x0b80('0x2d')](_0x1c269e[_0x0b80('0x29')],qs[_0x0b80('0x2f')](_0x4b123a['query']['fields']));_0x4e6762[_0x0b80('0x2e')]=_0x4e6762[_0x0b80('0x2e')][_0x0b80('0x30')]?_0x4e6762['attributes']:_0x1c269e[_0x0b80('0x29')];if(!_0x4b123a['query'][_0x0b80('0x31')](_0x0b80('0x32'))){_0x4e6762['limit']=qs[_0x0b80('0xf')](_0x4b123a[_0x0b80('0x2a')][_0x0b80('0xf')]);_0x4e6762[_0x0b80('0x10')]=qs[_0x0b80('0x10')](_0x4b123a['query']['offset']);}_0x4e6762[_0x0b80('0x33')]=qs[_0x0b80('0x34')](_0x4b123a[_0x0b80('0x2a')]['sort']);_0x4e6762['where']=qs['filters'](_[_0x0b80('0x35')](_0x4b123a[_0x0b80('0x2a')],_0x1c269e[_0x0b80('0x2c')]),_0x7673e1);if(_0x4b123a[_0x0b80('0x2a')][_0x0b80('0x1a')]){_0x4e6762[_0x0b80('0x36')]=_['merge'](_0x4e6762['where'],{'$or':_[_0x0b80('0x1c')](_0x7673e1,function(_0x37e064){if(_0x37e064['type']!==_0x0b80('0x37')){var _0x2d910a={};_0x2d910a[_0x37e064[_0x0b80('0x21')]]={'$like':'%'+_0x4b123a[_0x0b80('0x2a')]['filter']+'%'};return _0x2d910a;}})});}_0x4e6762=_[_0x0b80('0x38')]({},_0x4e6762,_0x4b123a[_0x0b80('0x39')]);var _0x15ed68={'where':_0x4e6762[_0x0b80('0x36')]};return db[_0x0b80('0x3a')][_0x0b80('0x11')](_0x15ed68)[_0x0b80('0x14')](function(_0x567448){_0x5ded61[_0x0b80('0x11')]=_0x567448;if(_0x4b123a['query'][_0x0b80('0x3b')]){_0x4e6762[_0x0b80('0x3c')]=[{'all':!![]}];}return db[_0x0b80('0x3a')][_0x0b80('0x3d')](_0x4e6762);})[_0x0b80('0x14')](function(_0x55cd8e){_0x5ded61[_0x0b80('0x3e')]=_0x55cd8e;return _0x5ded61;})[_0x0b80('0x14')](respondWithFilteredResult(_0x313d33,_0x4e6762))[_0x0b80('0x3f')](handleError(_0x313d33,null));};exports[_0x0b80('0x40')]=function(_0x57ffe5,_0x5a5751){var _0x441ca8={'raw':![],'where':{'id':_0x57ffe5[_0x0b80('0x41')]['id']}},_0x2a7acb={};_0x2a7acb[_0x0b80('0x29')]=_[_0x0b80('0x2b')](db[_0x0b80('0x3a')][_0x0b80('0x26')]);_0x2a7acb[_0x0b80('0x2a')]=_[_0x0b80('0x2b')](_0x57ffe5[_0x0b80('0x2a')]);_0x2a7acb['filters']=_[_0x0b80('0x2d')](_0x2a7acb[_0x0b80('0x29')],_0x2a7acb[_0x0b80('0x2a')]);_0x441ca8[_0x0b80('0x2e')]=_[_0x0b80('0x2d')](_0x2a7acb[_0x0b80('0x29')],qs[_0x0b80('0x2f')](_0x57ffe5['query'][_0x0b80('0x2f')]));_0x441ca8[_0x0b80('0x2e')]=_0x441ca8[_0x0b80('0x2e')][_0x0b80('0x30')]?_0x441ca8[_0x0b80('0x2e')]:_0x2a7acb[_0x0b80('0x29')];if(_0x57ffe5['query'][_0x0b80('0x3b')]){_0x441ca8['include']=[{'all':!![]}];}_0x441ca8=_[_0x0b80('0x38')]({},_0x441ca8,_0x57ffe5[_0x0b80('0x39')]);return db[_0x0b80('0x3a')][_0x0b80('0x20')](_0x441ca8)[_0x0b80('0x14')](handleEntityNotFound(_0x5a5751,null))[_0x0b80('0x14')](respondWithResult(_0x5a5751,null))[_0x0b80('0x3f')](handleError(_0x5a5751,null));};exports[_0x0b80('0x13')]=function(_0x146c3f,_0x385273){return db['VoiceExtension']['find']({'where':{'id':_0x146c3f[_0x0b80('0x41')]['id']}})[_0x0b80('0x14')](handleEntityNotFound(_0x385273,null))['then'](removeEntity(_0x385273,null))[_0x0b80('0x3f')](handleError(_0x385273,null));};exports[_0x0b80('0x42')]=function(_0xb89faa,_0x2e8106){if(_0xb89faa[_0x0b80('0x43')][_0x0b80('0x1f')]==='outbound'&&!_[_0x0b80('0x44')](_0xb89faa['body'][_0x0b80('0x45')],'_')){_0xb89faa[_0x0b80('0x43')]['exten']='_'[_0x0b80('0x46')](_0xb89faa['body'][_0x0b80('0x45')]);}return db[_0x0b80('0x3a')][_0x0b80('0x42')](_0xb89faa[_0x0b80('0x43')],{'raw':![]})[_0x0b80('0x14')](function(_0x5a473c){var _0x313d4d=_0xb89faa['user'][_0x0b80('0x15')]({'plain':!![]});if(!_0x313d4d)throw new Error(_0x0b80('0x47'));if(_0x313d4d[_0x0b80('0x48')]===_0x0b80('0x49')){var _0x1d3bff=_0x5a473c['get']({'plain':!![]});var _0x318da5=[{'name':'InboundRoutes','value':_0x0b80('0x4a')},{'name':_0x0b80('0x16'),'value':_0x0b80('0x17')},{'name':_0x0b80('0x18'),'value':_0x0b80('0x19')}];var _0x48c826=_[_0x0b80('0x20')](_0x318da5,[_0x0b80('0x1d'),_0x1d3bff[_0x0b80('0x1f')]])[_0x0b80('0x21')];return db[_0x0b80('0x4b')][_0x0b80('0x20')]({'where':{'name':_0x48c826,'userProfileId':_0x313d4d[_0x0b80('0x4c')]},'raw':!![]})[_0x0b80('0x14')](function(_0x266352){if(_0x266352&&_0x266352[_0x0b80('0x4d')]===0x0){return db[_0x0b80('0x4e')][_0x0b80('0x42')]({'name':_0x1d3bff['name'],'resourceId':_0x1d3bff['id'],'type':_0x266352[_0x0b80('0x21')],'sectionId':_0x266352['id']},{})[_0x0b80('0x14')](function(){return _0x5a473c;});}else{return _0x5a473c;}})['catch'](function(_0x15318c){logger[_0x0b80('0x4f')](_0x0b80('0x50'),_0x15318c);throw _0x15318c;});}return _0x5a473c;})[_0x0b80('0x14')](respondWithResult(_0x2e8106,0xc9))[_0x0b80('0x3f')](handleError(_0x2e8106,null));};exports['update']=function(_0x2078cc,_0x35dc03){if(_0x2078cc['body']['id']){delete _0x2078cc[_0x0b80('0x43')]['id'];}return db[_0x0b80('0x3a')][_0x0b80('0x20')]({'where':{'id':_0x2078cc[_0x0b80('0x41')]['id']}})[_0x0b80('0x14')](handleEntityNotFound(_0x35dc03,null))[_0x0b80('0x14')](function(_0x9aa483){if(_0x9aa483){return db['VoiceExtension'][_0x0b80('0x51')](_[_0x0b80('0x35')](_0x2078cc['body'],['exten',_0x0b80('0x52'),_0x0b80('0x53'),'recordingFormat',_0x0b80('0x54'),_0x0b80('0x55'),_0x0b80('0x56')]),{'where':{'context':_0x9aa483['context'],'exten':_0x9aa483[_0x0b80('0x45')]},'individualHooks':!![]})[_0x0b80('0x14')](function(_0x4491b5){return _0x4491b5;});}return null;})[_0x0b80('0x14')](respondWithStatusCode(_0x35dc03,null))['catch'](handleError(_0x35dc03,null));};exports[_0x0b80('0x57')]=function(_0x3bb3b5,_0x4d6870){var _0x462db5=_0x3bb3b5[_0x0b80('0x41')]['id'];var _0x42cd09=_0x3bb3b5[_0x0b80('0x43')];var _0x3aadca=0xc8;var _0x4be928=null;return db[_0x0b80('0x58')]['transaction']({'isolationLevel':db[_0x0b80('0x58')]['Transaction'][_0x0b80('0x59')][_0x0b80('0x5a')]},function(_0x5630a2){return db[_0x0b80('0x3a')][_0x0b80('0x5b')]({'where':{'id':_0x462db5},'transaction':_0x5630a2})[_0x0b80('0x14')](function(_0x21be39){if(_0x21be39){return db[_0x0b80('0x3a')][_0x0b80('0x13')]({'where':{'VoiceExtensionId':_0x462db5},'transaction':_0x5630a2})[_0x0b80('0x14')](function(){var _0x196963=_[_0x0b80('0x1c')](_0x42cd09,function(_0x51311e){_0x51311e[_0x0b80('0x5c')]=_0x462db5;_0x51311e[_0x0b80('0x5d')]=!![];return _0x51311e;});return _0x21be39[_0x0b80('0x5e')](_0x196963);})['then'](function(_0x47ee70){return db['VoiceExtension']['bulkCreate'](_0x47ee70,{'transaction':_0x5630a2});});}else{_0x3aadca=0x194;_0x4be928=[];}});})[_0x0b80('0x14')](function(){if(_0x3aadca!==0x194){return db[_0x0b80('0x3a')][_0x0b80('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x462db5},'order':_0x0b80('0x60')})[_0x0b80('0x14')](function(_0x33be6e){_0x4be928=_0x33be6e;});}})[_0x0b80('0x3f')](function(_0x9273e6){_0x3aadca=0x1f4;logger[_0x0b80('0x4f')](_0x9273e6[_0x0b80('0x23')]);if(_0x9273e6['name']){delete _0x9273e6[_0x0b80('0x21')];}_0x4be928=_0x9273e6;})['finally'](function(){if(_0x4be928===null){_0x4d6870[_0x0b80('0xb')](_0x3aadca);}else{if(_0x3aadca===0x1f4){_0x4d6870[_0x0b80('0xc')](_0x3aadca)['send'](_0x4be928);}else{_0x4d6870[_0x0b80('0xc')](_0x3aadca)['json'](_0x4be928);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ac5a0a0..4d94d77 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 _0x497e=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2d761e,_0x29832c){var _0x291add=function(_0x15de59){while(--_0x15de59){_0x2d761e['push'](_0x2d761e['shift']());}};_0x291add(++_0x29832c);}(_0x497e,0xb0));var _0xe497=function(_0x38b711,_0xf3473d){_0x38b711=_0x38b711-0x0;var _0x49b9e9=_0x497e[_0x38b711];return _0x49b9e9;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xe497('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe497('0x1')](0x0);var events={'afterCreate':_0xe497('0x2'),'afterUpdate':_0xe497('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38197b){return function(_0x4a69fd,_0x24345a,_0x5b8cc9){VoiceExtensionEvents[_0xe497('0x4')](_0x38197b+':'+_0x4a69fd['id'],_0x4a69fd);VoiceExtensionEvents[_0xe497('0x4')](_0x38197b,_0x4a69fd);_0x5b8cc9(null);};}for(var e in events){if(events[_0xe497('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xe497('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xfea8=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','update','remove','emit'];(function(_0x174583,_0x468485){var _0x14e46f=function(_0x227127){while(--_0x227127){_0x174583['push'](_0x174583['shift']());}};_0x14e46f(++_0x468485);}(_0xfea8,0x159));var _0x8fea=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0xfea8[_0x12d951];return _0x44de17;};'use strict';var EventEmitter=require(_0x8fea('0x0'));var VoiceExtension=require(_0x8fea('0x1'))['db'][_0x8fea('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fea('0x3'),'afterDestroy':_0x8fea('0x4')};function emitEvent(_0x21aba7){return function(_0x29ea45,_0x52c4b5,_0x5408d1){VoiceExtensionEvents['emit'](_0x21aba7+':'+_0x29ea45['id'],_0x29ea45);VoiceExtensionEvents[_0x8fea('0x5')](_0x21aba7,_0x29ea45);_0x5408d1(null);};}for(var e in events){if(events[_0x8fea('0x6')](e)){var event=events[e];VoiceExtension[_0x8fea('0x7')](e,emitEvent(event));}}module[_0x8fea('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 7ebb1f9..8462f7b 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 _0x4d61=['catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','NoOp','CDR(routeAlias)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','url','split','length','param','prefix','phone','${EXTEN:','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','interval','then','*,*,*,*','intervals','IntervalId','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue','includes','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','last','priority'];(function(_0x160dce,_0x321c50){var _0x50865a=function(_0x354d10){while(--_0x354d10){_0x160dce['push'](_0x160dce['shift']());}};_0x50865a(++_0x321c50);}(_0x4d61,0x147));var _0x14d6=function(_0x325d36,_0x7c6b84){_0x325d36=_0x325d36-0x0;var _0x27193e=_0x4d61[_0x325d36];return _0x27193e;};'use strict';var _=require(_0x14d6('0x0'));var attributes=require(_0x14d6('0x1'));module[_0x14d6('0x2')]=function(_0x24999b){var _0x128a58=_0x24999b[_0x14d6('0x3')];function _0x1f4d14(_0x455bd7){var _0x2950b7=0x2;var _0x5da268=[{'type':_0x455bd7[_0x14d6('0x4')],'app':_0x14d6('0x5'),'appdata':_0x14d6('0x6')+_0x455bd7[_0x14d6('0x4')],'context':_0x455bd7[_0x14d6('0x7')],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']},{'type':_0x455bd7[_0x14d6('0x4')],'app':_0x455bd7['alias']?_0x14d6('0x5'):'NoOp','appdata':_0x455bd7[_0x14d6('0x9')]?'CDR(routeAlias)='+_0x455bd7[_0x14d6('0x9')]:_0x14d6('0xa'),'context':_0x455bd7['context'],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']}];if(_0x455bd7[_0x14d6('0x4')]===_0x14d6('0xb')){_0x5da268[_0x14d6('0xc')]({'type':_0x14d6('0xb'),'app':_0x14d6('0x5'),'appdata':_0x14d6('0xd')+_0x455bd7['id'],'context':_0x455bd7[_0x14d6('0x7')],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']});}_0x5da268[_0x14d6('0xc')]({'type':_0x455bd7[_0x14d6('0x4')],'app':'Set','appdata':_0x14d6('0xe'),'context':_0x455bd7[_0x14d6('0x7')],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']},{'type':_0x455bd7[_0x14d6('0x4')],'app':_0x14d6('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x455bd7[_0x14d6('0x7')],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']},{'type':_0x455bd7[_0x14d6('0x4')],'app':_0x14d6('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x455bd7[_0x14d6('0x7')],'exten':_0x455bd7[_0x14d6('0x8')],'priority':_0x2950b7++,'VoiceExtensionId':_0x455bd7['id']});return _0x5da268;}function _0x19464f(_0x5cfc1d){var _0x463487=0x2;var _0x31cc63=[{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':_0x14d6('0x10'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x5cfc1d[_0x14d6('0x9')]?_0x14d6('0x5'):_0x14d6('0x11'),'appdata':_0x5cfc1d['alias']?_0x14d6('0x12')+_0x5cfc1d[_0x14d6('0x9')]:_0x14d6('0xa'),'context':_0x5cfc1d['context'],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0x5cfc1d[_0x14d6('0x13')]?'${EXTEN:'+_0x5cfc1d['cutdigits']+'}':_0x14d6('0x14')),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':_0x14d6('0xd')+_0x5cfc1d['id'],'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d['exten'],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x15'),'appdata':_0x14d6('0x16')+(_0x463487+0x2)+'):Goto('+(_0x463487+0x1)+')','context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':_0x5cfc1d[_0x14d6('0x13')]?_0x14d6('0x17')+_0x5cfc1d[_0x14d6('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':_0x14d6('0xe'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':'outbound','app':'Set','appdata':_0x14d6('0x18'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':'Set','appdata':_0x14d6('0x19'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':'outboundrouteid='+_0x5cfc1d['id'],'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d['exten'],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']}];if(_0x5cfc1d[_0x14d6('0x1a')](_0x14d6('0x1b'))&&_0x5cfc1d[_0x14d6('0x1b')]!==_0x14d6('0x1c')){_0x31cc63[_0x14d6('0xc')]({'type':_0x14d6('0xf'),'app':'Set','appdata':_0x14d6('0x1d'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']},{'type':_0x14d6('0xf'),'app':_0x14d6('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5cfc1d[_0x14d6('0x1b')]||_0x14d6('0x1e'),'context':_0x5cfc1d[_0x14d6('0x7')],'exten':_0x5cfc1d[_0x14d6('0x8')],'priority':_0x463487++,'VoiceExtensionId':_0x5cfc1d['id']});}return _0x31cc63;}function _0x216070(_0x27c52d,_0x174670){var _0x9f9c15=[{'name':_0x14d6('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x14d6('0x20'),'param':0x3}];var _0x54f3ea={};var _0xbeefa3=_0x174670[_0x14d6('0x21')](',');var _0x4b104e=[];for(var _0x47eaa8=0x0;_0x47eaa8<_0x9f9c15[_0x14d6('0x22')];_0x47eaa8++){switch(_0x9f9c15[_0x47eaa8]['name']){case _0x14d6('0x1f'):_0x54f3ea[_0x14d6('0x1f')]=_0xbeefa3[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]][_0x14d6('0x21')]('/')[0x1];_0x54f3ea['phone']=_0xbeefa3[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]][_0x14d6('0x21')]('/')[0x2];_0x54f3ea[_0x14d6('0x24')]=_0x54f3ea[_0x14d6('0x25')]?_0x54f3ea['phone'][_0x14d6('0x21')]('$')[0x0]:undefined;_0x54f3ea['phone']=_0x27c52d['cutdigits']?(_0x54f3ea[_0x14d6('0x24')]||'')+_0x14d6('0x26')+_0x27c52d[_0x14d6('0x13')]+'}':(_0x54f3ea[_0x14d6('0x24')]||'')+_0x14d6('0x14');_0x4b104e[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]]=[_0x14d6('0x27'),_0x54f3ea[_0x14d6('0x1f')],_0x54f3ea[_0x14d6('0x25')]][_0x14d6('0x28')]('/');break;case _0x14d6('0x29'):_0x54f3ea[_0x14d6('0x29')]=_0xbeefa3[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]];if(_0x27c52d[_0x14d6('0x1b')]!==_0x14d6('0x1c')){if(_0x54f3ea[_0x14d6('0x29')][_0x14d6('0x2a')](_0x14d6('0x2b'))<0x0){_0x54f3ea[_0x14d6('0x29')]+=_0x14d6('0x2b');}}else{_0x54f3ea[_0x14d6('0x29')]=_0x54f3ea[_0x14d6('0x29')][_0x14d6('0x2c')](_0x14d6('0x2b'),'');}_0x4b104e[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]]=_0x54f3ea[_0x14d6('0x29')];break;default:_0x4b104e[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]]=_0xbeefa3[_0x9f9c15[_0x47eaa8][_0x14d6('0x23')]];}}return _0x4b104e[_0x14d6('0x28')](',');}function _0x39b796(_0x35c6f0,_0x4f7bce,_0x4e7a4b){return new Promise(function(_0x5328c2,_0x18c3bf){var _0x344224=[];if(_[_0x14d6('0x2d')](_0x4f7bce))return _0x5328c2(_0x344224);_0x128a58['Interval']['findAll']({'attributes':['id',_0x14d6('0x2e'),'IntervalId'],'raw':!![]})[_0x14d6('0x2f')](function(_0x4720aa){for(var _0x3b4263=0x0,_0x40c1d3=0x0;_0x3b4263<_0x4f7bce[_0x14d6('0x22')];_0x3b4263++,_0x40c1d3=0x0){var _0x23dd77=_0x4f7bce[_0x3b4263];var _0x5012af=[];var _0x181f83=[];delete _0x23dd77['id'];if(_0x23dd77[_0x14d6('0x2e')]!==_0x14d6('0x30')){_0x23dd77[_0x14d6('0x31')]=[_0x23dd77[_0x14d6('0x2e')]];}else{_0x23dd77[_0x14d6('0x31')]=_0x23dd77[_0x14d6('0x32')]?_['map'](_[_0x14d6('0x33')](_0x4720aa,{'IntervalId':_0x23dd77[_0x14d6('0x32')]}),_0x14d6('0x2e')):[];}_0x23dd77[_0x14d6('0x7')]=_0x35c6f0['context'];_0x23dd77[_0x14d6('0x8')]=_0x35c6f0[_0x14d6('0x8')];if(_0x23dd77[_0x14d6('0x4')])_0x23dd77[_0x14d6('0x4')]=_0x23dd77[_0x14d6('0x4')][_0x14d6('0x34')]();if(_0x35c6f0[_0x14d6('0x4')]==='outbound'){if(_0x23dd77[_0x14d6('0x1a')](_0x14d6('0x35'))&&_0x23dd77[_0x14d6('0x35')]&&_0x23dd77[_0x14d6('0x35')]!=='--'){_0x5012af[_0x14d6('0xc')]({'type':_0x23dd77['type'][_0x14d6('0x34')](),'app':_0x14d6('0x5'),'appdata':_0x14d6('0x36')+_0x23dd77['tag'],'context':_0x35c6f0[_0x14d6('0x7')],'exten':_0x35c6f0[_0x14d6('0x8')],'priority':_0x23dd77[_0x14d6('0x31')]['length']+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});}_0x5012af['push']({'type':_0x23dd77['type'][_0x14d6('0x34')](),'app':_0x14d6('0x15'),'appdata':_0x14d6('0x37')+(_0x23dd77['callerID']?'Set(CALLERID(all)='+_0x23dd77[_0x14d6('0x38')]+')':_0x14d6('0x39')),'context':_0x35c6f0[_0x14d6('0x7')],'exten':_0x35c6f0[_0x14d6('0x8')],'priority':_0x23dd77[_0x14d6('0x31')][_0x14d6('0x22')]+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});}else{if(_0x23dd77[_0x14d6('0x1a')]('answer')){if([_0x14d6('0x3a'),'playback'][_0x14d6('0x3b')](_0x23dd77['app']['toLowerCase']())&&_0x23dd77['appType']!==_0x14d6('0x3c')){if(_0x23dd77[_0x14d6('0x3d')]){_0x5012af[_0x14d6('0xc')]({'type':_0x23dd77[_0x14d6('0x4')]['toLowerCase'](),'app':_0x14d6('0x15'),'appdata':_0x14d6('0x3e'),'context':_0x35c6f0[_0x14d6('0x7')],'exten':_0x35c6f0[_0x14d6('0x8')],'priority':_0x23dd77[_0x14d6('0x31')]['length']+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});_0x5012af[_0x14d6('0xc')]({'type':_0x23dd77['type'][_0x14d6('0x34')](),'app':_0x14d6('0x5'),'appdata':_0x14d6('0x3f'),'context':_0x35c6f0['context'],'exten':_0x35c6f0[_0x14d6('0x8')],'priority':_0x23dd77[_0x14d6('0x31')][_0x14d6('0x22')]+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});}else{_0x5012af[_0x14d6('0xc')]({'type':_0x23dd77[_0x14d6('0x4')][_0x14d6('0x34')](),'app':_0x14d6('0x15'),'appdata':_0x14d6('0x40'),'context':_0x35c6f0['context'],'exten':_0x35c6f0[_0x14d6('0x8')],'priority':_0x23dd77[_0x14d6('0x31')]['length']+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});_0x5012af[_0x14d6('0xc')]({'type':_0x23dd77[_0x14d6('0x4')][_0x14d6('0x34')](),'app':_0x14d6('0x5'),'appdata':_0x14d6('0x41'),'context':_0x35c6f0['context'],'exten':_0x35c6f0['exten'],'priority':_0x23dd77[_0x14d6('0x31')][_0x14d6('0x22')]+_0x4e7a4b+_0x40c1d3++,'VoiceExtensionId':_0x35c6f0['id']});}}}}for(var _0x20555d=0x0;_0x20555d<_0x23dd77[_0x14d6('0x31')][_0x14d6('0x22')];_0x20555d++){var _0x43bcf3=_0x4e7a4b+_0x23dd77[_0x14d6('0x31')][_0x14d6('0x22')];var _0x1cf02a=_0x20555d===_0x23dd77['intervals'][_0x14d6('0x22')]-0x1?_0x4e7a4b+_0x5012af['length']+_0x181f83[_0x14d6('0x22')]+0x2:_0x4e7a4b+_0x20555d+0x1;_0x5012af['splice'](_0x20555d,0x0,{'type':_0x35c6f0[_0x14d6('0x4')],'app':_0x14d6('0x42'),'appdata':_0x23dd77['intervals'][_0x20555d]+'?'+_0x35c6f0[_0x14d6('0x7')]+',${EXTEN},'+_0x43bcf3+':'+_0x35c6f0[_0x14d6('0x7')]+_0x14d6('0x43')+_0x1cf02a,'exten':_0x35c6f0[_0x14d6('0x8')],'context':_0x35c6f0[_0x14d6('0x7')],'priority':_0x4e7a4b+_0x20555d,'VoiceExtensionId':_0x35c6f0['id']});}if(_0x23dd77[_0x14d6('0x44')]===_0x14d6('0x45'))_0x23dd77[_0x14d6('0x46')]=_0x216070(_0x35c6f0,_0x23dd77[_0x14d6('0x46')]);_0x23dd77['priority']=_0x5012af[_0x14d6('0x22')]?_[_0x14d6('0x47')](_0x5012af)[_0x14d6('0x48')]+0x1:_0x4e7a4b;_0x344224=_['concat'](_0x344224,_0x5012af,[_0x23dd77],_0x181f83);_0x4e7a4b=_[_0x14d6('0x47')](_0x344224)['priority']+0x1;}return _0x5328c2(_0x344224);})[_0x14d6('0x49')](function(_0x1cedb9){_0x18c3bf(_0x1cedb9);});});}return _0x24999b[_0x14d6('0x4a')](_0x14d6('0x4b'),attributes,{'tableName':_0x14d6('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x351135){var _0x5f5044=this[_0x14d6('0x4d')]({'plain':!![]});var _0x403420=_0x5f5044[_0x14d6('0x4')]===_0x14d6('0xf')?_0x19464f(_0x5f5044):_0x1f4d14(_0x5f5044);return _0x39b796(_0x5f5044,_0x351135,_[_0x14d6('0x47')](_0x403420)[_0x14d6('0x48')]+0x1)[_0x14d6('0x2f')](function(_0x27375c){var _0x47b823=_[_0x14d6('0x4e')](_0x403420,_0x27375c);_0x47b823[_0x14d6('0xc')]({'type':_0x5f5044[_0x14d6('0x4')],'app':_0x14d6('0x4f'),'exten':_0x5f5044['exten'],'context':_0x5f5044[_0x14d6('0x7')],'priority':_['last'](_0x47b823)[_0x14d6('0x48')]+0x1,'VoiceExtensionId':_0x5f5044['id']});return _0x47b823;});}}});}; \ No newline at end of file +var _0x2975=['length','*,*,*,*','intervals','filter','interval','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','outboundDial','appdata','priority','catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','name','param','phone','prefix','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then'];(function(_0x96a606,_0x54795f){var _0x4243a2=function(_0x2659a6){while(--_0x2659a6){_0x96a606['push'](_0x96a606['shift']());}};_0x4243a2(++_0x54795f);}(_0x2975,0x1c5));var _0x5297=function(_0x526800,_0x5ced0c){_0x526800=_0x526800-0x0;var _0xa8ec2c=_0x2975[_0x526800];return _0xa8ec2c;};'use strict';var _=require('lodash');var attributes=require(_0x5297('0x0'));module[_0x5297('0x1')]=function(_0x44137e){var _0x1a511b=_0x44137e[_0x5297('0x2')];function _0x178801(_0x5b6624){var _0x56371f=0x2;var _0x5e9de3=[{'type':_0x5b6624[_0x5297('0x3')],'app':_0x5297('0x4'),'appdata':_0x5297('0x5')+_0x5b6624[_0x5297('0x3')],'context':_0x5b6624[_0x5297('0x6')],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']},{'type':_0x5b6624[_0x5297('0x3')],'app':_0x5b6624['alias']?_0x5297('0x4'):_0x5297('0x8'),'appdata':_0x5b6624[_0x5297('0x9')]?_0x5297('0xa')+_0x5b6624[_0x5297('0x9')]:'No\x20alias\x20set','context':_0x5b6624[_0x5297('0x6')],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']}];if(_0x5b6624[_0x5297('0x3')]==='inbound'){_0x5e9de3[_0x5297('0xb')]({'type':_0x5297('0xc'),'app':_0x5297('0x4'),'appdata':'CDR(routeid)='+_0x5b6624['id'],'context':_0x5b6624[_0x5297('0x6')],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']});}_0x5e9de3['push']({'type':_0x5b6624['type'],'app':_0x5297('0x4'),'appdata':_0x5297('0xd'),'context':_0x5b6624['context'],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']},{'type':_0x5b6624['type'],'app':_0x5297('0x4'),'appdata':_0x5297('0xe'),'context':_0x5b6624['context'],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']},{'type':_0x5b6624[_0x5297('0x3')],'app':_0x5297('0x4'),'appdata':_0x5297('0xf'),'context':_0x5b6624[_0x5297('0x6')],'exten':_0x5b6624[_0x5297('0x7')],'priority':_0x56371f++,'VoiceExtensionId':_0x5b6624['id']});return _0x5e9de3;}function _0x1fb138(_0x262a9f){var _0x4ae2fe=0x2;var _0x23474a=[{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':_0x5297('0x11'),'context':_0x262a9f['context'],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x262a9f['alias']?_0x5297('0x4'):'NoOp','appdata':_0x262a9f[_0x5297('0x9')]?_0x5297('0xa')+_0x262a9f[_0x5297('0x9')]:_0x5297('0x12'),'context':_0x262a9f['context'],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':'Set','appdata':_0x5297('0x13')+(_0x262a9f[_0x5297('0x14')]?'${EXTEN:'+_0x262a9f[_0x5297('0x14')]+'}':_0x5297('0x15')),'context':_0x262a9f['context'],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':'CDR(routeid)='+_0x262a9f['id'],'context':_0x262a9f['context'],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4ae2fe+0x2)+_0x5297('0x17')+(_0x4ae2fe+0x1)+')','context':_0x262a9f['context'],'exten':_0x262a9f['exten'],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':_0x262a9f[_0x5297('0x14')]?_0x5297('0x18')+_0x262a9f['cutdigits']+'}':_0x5297('0x19'),'context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':_0x5297('0xd'),'context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':'Set','appdata':_0x5297('0xe'),'context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':'outbound','app':_0x5297('0x4'),'appdata':_0x5297('0xf'),'context':_0x262a9f['context'],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':_0x5297('0x1a')+_0x262a9f['id'],'context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f['exten'],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']}];if(_0x262a9f[_0x5297('0x1b')](_0x5297('0x1c'))&&_0x262a9f[_0x5297('0x1c')]!==_0x5297('0x1d')){_0x23474a['push']({'type':_0x5297('0x10'),'app':'Set','appdata':_0x5297('0x1e'),'context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f['exten'],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']},{'type':_0x5297('0x10'),'app':_0x5297('0x4'),'appdata':_0x5297('0x1f')+_0x262a9f[_0x5297('0x1c')]||'wav','context':_0x262a9f[_0x5297('0x6')],'exten':_0x262a9f[_0x5297('0x7')],'priority':_0x4ae2fe++,'VoiceExtensionId':_0x262a9f['id']});}return _0x23474a;}function _0xd618c4(_0xeb1099,_0x5d546a){var _0x276c25=[{'name':_0x5297('0x20'),'param':0x0},{'name':_0x5297('0x21'),'param':0x1},{'name':_0x5297('0x22'),'param':0x2},{'name':_0x5297('0x23'),'param':0x3}];var _0x42b0ca={};var _0x3573a7=_0x5d546a[_0x5297('0x24')](',');var _0x209c21=[];for(var _0x1409cc=0x0;_0x1409cc<_0x276c25['length'];_0x1409cc++){switch(_0x276c25[_0x1409cc][_0x5297('0x25')]){case _0x5297('0x20'):_0x42b0ca[_0x5297('0x20')]=_0x3573a7[_0x276c25[_0x1409cc][_0x5297('0x26')]][_0x5297('0x24')]('/')[0x1];_0x42b0ca[_0x5297('0x27')]=_0x3573a7[_0x276c25[_0x1409cc]['param']][_0x5297('0x24')]('/')[0x2];_0x42b0ca['prefix']=_0x42b0ca[_0x5297('0x27')]?_0x42b0ca[_0x5297('0x27')][_0x5297('0x24')]('$')[0x0]:undefined;_0x42b0ca['phone']=_0xeb1099['cutdigits']?(_0x42b0ca[_0x5297('0x28')]||'')+_0x5297('0x29')+_0xeb1099[_0x5297('0x14')]+'}':(_0x42b0ca['prefix']||'')+_0x5297('0x15');_0x209c21[_0x276c25[_0x1409cc]['param']]=['SIP',_0x42b0ca[_0x5297('0x20')],_0x42b0ca[_0x5297('0x27')]][_0x5297('0x2a')]('/');break;case _0x5297('0x22'):_0x42b0ca[_0x5297('0x22')]=_0x3573a7[_0x276c25[_0x1409cc][_0x5297('0x26')]];if(_0xeb1099['recordingFormat']!==_0x5297('0x1d')){if(_0x42b0ca[_0x5297('0x22')][_0x5297('0x2b')](_0x5297('0x2c'))<0x0){_0x42b0ca[_0x5297('0x22')]+=_0x5297('0x2c');}}else{_0x42b0ca['options']=_0x42b0ca['options'][_0x5297('0x2d')](_0x5297('0x2c'),'');}_0x209c21[_0x276c25[_0x1409cc]['param']]=_0x42b0ca['options'];break;default:_0x209c21[_0x276c25[_0x1409cc][_0x5297('0x26')]]=_0x3573a7[_0x276c25[_0x1409cc][_0x5297('0x26')]];}}return _0x209c21['join'](',');}function _0x167f18(_0x4f7dac,_0x269359,_0x2854ef){return new Promise(function(_0x469a0d,_0x50c9ed){var _0x34ddee=[];if(_[_0x5297('0x2e')](_0x269359))return _0x469a0d(_0x34ddee);_0x1a511b[_0x5297('0x2f')][_0x5297('0x30')]({'attributes':['id','interval',_0x5297('0x31')],'raw':!![]})[_0x5297('0x32')](function(_0x246fe1){for(var _0x215716=0x0,_0x149def=0x0;_0x215716<_0x269359[_0x5297('0x33')];_0x215716++,_0x149def=0x0){var _0x28cf31=_0x269359[_0x215716];var _0x58d76c=[];var _0x42018c=[];delete _0x28cf31['id'];if(_0x28cf31['interval']!==_0x5297('0x34')){_0x28cf31['intervals']=[_0x28cf31['interval']];}else{_0x28cf31[_0x5297('0x35')]=_0x28cf31[_0x5297('0x31')]?_['map'](_[_0x5297('0x36')](_0x246fe1,{'IntervalId':_0x28cf31[_0x5297('0x31')]}),_0x5297('0x37')):[];}_0x28cf31[_0x5297('0x6')]=_0x4f7dac[_0x5297('0x6')];_0x28cf31[_0x5297('0x7')]=_0x4f7dac['exten'];if(_0x28cf31[_0x5297('0x3')])_0x28cf31[_0x5297('0x3')]=_0x28cf31['type'][_0x5297('0x38')]();if(_0x4f7dac[_0x5297('0x3')]===_0x5297('0x10')){if(_0x28cf31[_0x5297('0x1b')]('tag')&&_0x28cf31[_0x5297('0x39')]&&_0x28cf31[_0x5297('0x39')]!=='--'){_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31[_0x5297('0x3')]['toLowerCase'](),'app':_0x5297('0x4'),'appdata':_0x5297('0x3a')+_0x28cf31[_0x5297('0x39')],'context':_0x4f7dac['context'],'exten':_0x4f7dac[_0x5297('0x7')],'priority':_0x28cf31[_0x5297('0x35')][_0x5297('0x33')]+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});}_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31[_0x5297('0x3')]['toLowerCase'](),'app':_0x5297('0x16'),'appdata':_0x5297('0x3b')+(_0x28cf31[_0x5297('0x3c')]?_0x5297('0x3d')+_0x28cf31[_0x5297('0x3c')]+')':_0x5297('0x3e')),'context':_0x4f7dac[_0x5297('0x6')],'exten':_0x4f7dac[_0x5297('0x7')],'priority':_0x28cf31['intervals'][_0x5297('0x33')]+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});}else{if(_0x28cf31[_0x5297('0x1b')](_0x5297('0x3f'))){if([_0x5297('0x40'),_0x5297('0x41')][_0x5297('0x42')](_0x28cf31['app']['toLowerCase']())&&_0x28cf31[_0x5297('0x43')]!==_0x5297('0x44')){if(_0x28cf31[_0x5297('0x3f')]){_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31['type'][_0x5297('0x38')](),'app':_0x5297('0x16'),'appdata':_0x5297('0x45'),'context':_0x4f7dac[_0x5297('0x6')],'exten':_0x4f7dac['exten'],'priority':_0x28cf31[_0x5297('0x35')]['length']+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31[_0x5297('0x3')][_0x5297('0x38')](),'app':_0x5297('0x4'),'appdata':_0x5297('0x46'),'context':_0x4f7dac[_0x5297('0x6')],'exten':_0x4f7dac[_0x5297('0x7')],'priority':_0x28cf31['intervals'][_0x5297('0x33')]+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});}else{_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31['type'][_0x5297('0x38')](),'app':'ExecIf','appdata':_0x5297('0x47'),'context':_0x4f7dac['context'],'exten':_0x4f7dac['exten'],'priority':_0x28cf31['intervals'][_0x5297('0x33')]+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});_0x58d76c[_0x5297('0xb')]({'type':_0x28cf31[_0x5297('0x3')]['toLowerCase'](),'app':_0x5297('0x4'),'appdata':_0x5297('0x48'),'context':_0x4f7dac[_0x5297('0x6')],'exten':_0x4f7dac['exten'],'priority':_0x28cf31[_0x5297('0x35')]['length']+_0x2854ef+_0x149def++,'VoiceExtensionId':_0x4f7dac['id']});}}}}for(var _0x524d77=0x0;_0x524d77<_0x28cf31['intervals']['length'];_0x524d77++){var _0x193864=_0x2854ef+_0x28cf31[_0x5297('0x35')][_0x5297('0x33')];var _0x47865a=_0x524d77===_0x28cf31[_0x5297('0x35')][_0x5297('0x33')]-0x1?_0x2854ef+_0x58d76c[_0x5297('0x33')]+_0x42018c[_0x5297('0x33')]+0x2:_0x2854ef+_0x524d77+0x1;_0x58d76c['splice'](_0x524d77,0x0,{'type':_0x4f7dac[_0x5297('0x3')],'app':'GotoIfTime','appdata':_0x28cf31[_0x5297('0x35')][_0x524d77]+'?'+_0x4f7dac[_0x5297('0x6')]+_0x5297('0x49')+_0x193864+':'+_0x4f7dac['context']+_0x5297('0x49')+_0x47865a,'exten':_0x4f7dac[_0x5297('0x7')],'context':_0x4f7dac[_0x5297('0x6')],'priority':_0x2854ef+_0x524d77,'VoiceExtensionId':_0x4f7dac['id']});}if(_0x28cf31['appType']===_0x5297('0x4a'))_0x28cf31[_0x5297('0x4b')]=_0xd618c4(_0x4f7dac,_0x28cf31[_0x5297('0x4b')]);_0x28cf31[_0x5297('0x4c')]=_0x58d76c['length']?_['last'](_0x58d76c)['priority']+0x1:_0x2854ef;_0x34ddee=_['concat'](_0x34ddee,_0x58d76c,[_0x28cf31],_0x42018c);_0x2854ef=_['last'](_0x34ddee)[_0x5297('0x4c')]+0x1;}return _0x469a0d(_0x34ddee);})[_0x5297('0x4d')](function(_0x440b74){_0x50c9ed(_0x440b74);});});}return _0x44137e[_0x5297('0x4e')](_0x5297('0x4f'),attributes,{'tableName':_0x5297('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1066cb){var _0x48642b=this[_0x5297('0x51')]({'plain':!![]});var _0x5f7080=_0x48642b[_0x5297('0x3')]===_0x5297('0x10')?_0x1fb138(_0x48642b):_0x178801(_0x48642b);return _0x167f18(_0x48642b,_0x1066cb,_['last'](_0x5f7080)[_0x5297('0x4c')]+0x1)[_0x5297('0x32')](function(_0x354cd){var _0x2ae61d=_[_0x5297('0x52')](_0x5f7080,_0x354cd);_0x2ae61d[_0x5297('0xb')]({'type':_0x48642b[_0x5297('0x3')],'app':_0x5297('0x53'),'exten':_0x48642b['exten'],'context':_0x48642b['context'],'priority':_['last'](_0x2ae61d)[_0x5297('0x4c')]+0x1,'VoiceExtensionId':_0x48642b['id']});return _0x2ae61d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fa0fd73..7d492ba 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 _0x02ca=['options','raw','attributes','include','map','model','GetVoiceExtension','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll'];(function(_0x289a1b,_0x226faa){var _0x568f82=function(_0x371a48){while(--_0x371a48){_0x289a1b['push'](_0x289a1b['shift']());}};_0x568f82(++_0x226faa);}(_0x02ca,0x97));var _0xa02c=function(_0x2fa9d8,_0x23c7ae){_0x2fa9d8=_0x2fa9d8-0x0;var _0x5cab9e=_0x02ca[_0x2fa9d8];return _0x5cab9e;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require(_0xa02c('0x3'));var fs=require('fs');var Redis=require(_0xa02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa02c('0x5'));var logger=require(_0xa02c('0x6'))(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var jayson=require(_0xa02c('0x9'));var client=jayson[_0xa02c('0xa')][_0xa02c('0xb')]({'port':0x232a});config[_0xa02c('0xc')]=_[_0xa02c('0xd')](config[_0xa02c('0xc')],{'host':_0xa02c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa02c('0xc')]));require(_0xa02c('0xf'))[_0xa02c('0x10')](socket);function respondWithRpcPromise(_0x30e1aa,_0x14ffc2,_0x565373){return new BPromise(function(_0x5c553f,_0x50df17){return client['request'](_0x30e1aa,_0x565373)[_0xa02c('0x11')](function(_0x14c96f){logger[_0xa02c('0x12')](_0xa02c('0x13'),_0x14ffc2,'request\x20sent');logger[_0xa02c('0x14')](_0xa02c('0x15'),_0x14ffc2,_0xa02c('0x16'),JSON[_0xa02c('0x17')](_0x14c96f));if(_0x14c96f['error']){if(_0x14c96f[_0xa02c('0x18')][_0xa02c('0x19')]===0x1f4){logger[_0xa02c('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x50df17(_0x14c96f['error'][_0xa02c('0x1a')]);}logger[_0xa02c('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x5c553f(_0x14c96f[_0xa02c('0x18')]['message']);}else{logger[_0xa02c('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x14ffc2,'request\x20sent');_0x5c553f(_0x14c96f['result'][_0xa02c('0x1a')]);}})[_0xa02c('0x1b')](function(_0x16ac46){logger['error'](_0xa02c('0x13'),_0x14ffc2,_0x16ac46);_0x50df17(_0x16ac46);});});}exports['GetVoiceExtension']=function(_0x3311d2){var _0x12ff75=this;return new Promise(function(_0x38c479,_0x476777){return db['VoiceExtension'][_0xa02c('0x1c')]({'raw':_0x3311d2['options']?_0x3311d2[_0xa02c('0x1d')][_0xa02c('0x1e')]===undefined?!![]:![]:!![],'where':_0x3311d2[_0xa02c('0x1d')]?_0x3311d2['options']['where']||null:null,'attributes':_0x3311d2['options']?_0x3311d2[_0xa02c('0x1d')][_0xa02c('0x1f')]||null:null,'limit':_0x3311d2[_0xa02c('0x1d')]?_0x3311d2['options']['limit']||null:null,'include':_0x3311d2[_0xa02c('0x1d')]?_0x3311d2[_0xa02c('0x1d')][_0xa02c('0x20')]?_[_0xa02c('0x21')](_0x3311d2[_0xa02c('0x1d')]['include'],function(_0x4de358){return{'model':db[_0x4de358[_0xa02c('0x22')]],'as':_0x4de358['as'],'attributes':_0x4de358[_0xa02c('0x1f')],'include':_0x4de358[_0xa02c('0x20')]?_[_0xa02c('0x21')](_0x4de358[_0xa02c('0x20')],function(_0x3f4e0d){return{'model':db[_0x3f4e0d[_0xa02c('0x22')]],'as':_0x3f4e0d['as'],'attributes':_0x3f4e0d[_0xa02c('0x1f')],'include':_0x3f4e0d['include']?_[_0xa02c('0x21')](_0x3f4e0d[_0xa02c('0x20')],function(_0x31b520){return{'model':db[_0x31b520[_0xa02c('0x22')]],'as':_0x31b520['as'],'attributes':_0x31b520[_0xa02c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa02c('0x11')](function(_0x19f1c9){logger[_0xa02c('0x12')](_0xa02c('0x23'),_0x3311d2);logger['debug'](_0xa02c('0x23'),_0x3311d2,JSON[_0xa02c('0x17')](_0x19f1c9));_0x38c479(_0x19f1c9);})[_0xa02c('0x1b')](function(_0x4de1ac){logger['error'](_0xa02c('0x23'),_0x4de1ac[_0xa02c('0x1a')],_0x3311d2);_0x476777(_0x12ff75[_0xa02c('0x18')](0x1f4,_0x4de1ac[_0xa02c('0x1a')]));});});}; \ No newline at end of file +var _0x36b2=['socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','VoiceExtension','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceExtension','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x3feee2,_0x1fdf65){var _0x127ee9=function(_0x22fe20){while(--_0x22fe20){_0x3feee2['push'](_0x3feee2['shift']());}};_0x127ee9(++_0x1fdf65);}(_0x36b2,0x6b));var _0x236b=function(_0x56d45f,_0x3f7282){_0x56d45f=_0x56d45f-0x0;var _0x29fe97=_0x36b2[_0x56d45f];return _0x29fe97;};'use strict';var _=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var moment=require(_0x236b('0x2'));var BPromise=require('bluebird');var rs=require(_0x236b('0x3'));var fs=require('fs');var Redis=require(_0x236b('0x4'));var db=require(_0x236b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x236b('0x6'))(_0x236b('0x7'));var config=require('../../config/environment');var jayson=require(_0x236b('0x8'));var client=jayson[_0x236b('0x9')][_0x236b('0xa')]({'port':0x232a});config[_0x236b('0xb')]=_[_0x236b('0xc')](config[_0x236b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x236b('0xd'))(new Redis(config[_0x236b('0xb')]));require(_0x236b('0xe'))[_0x236b('0xf')](socket);function respondWithRpcPromise(_0x4ba1f6,_0x16c515,_0x13db74){return new BPromise(function(_0x2fd270,_0x53e6f6){return client[_0x236b('0x10')](_0x4ba1f6,_0x13db74)[_0x236b('0x11')](function(_0xd2312a){logger['info'](_0x236b('0x12'),_0x16c515,'request\x20sent');logger['debug'](_0x236b('0x13'),_0x16c515,'request\x20sent',JSON[_0x236b('0x14')](_0xd2312a));if(_0xd2312a[_0x236b('0x15')]){if(_0xd2312a[_0x236b('0x15')][_0x236b('0x16')]===0x1f4){logger[_0x236b('0x15')](_0x236b('0x12'),_0x16c515,_0xd2312a[_0x236b('0x15')]['message']);return _0x53e6f6(_0xd2312a['error'][_0x236b('0x17')]);}logger[_0x236b('0x15')](_0x236b('0x12'),_0x16c515,_0xd2312a[_0x236b('0x15')][_0x236b('0x17')]);return _0x2fd270(_0xd2312a['error']['message']);}else{logger[_0x236b('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x16c515,_0x236b('0x19'));_0x2fd270(_0xd2312a[_0x236b('0x1a')]['message']);}})['catch'](function(_0x16e68a){logger['error'](_0x236b('0x12'),_0x16c515,_0x16e68a);_0x53e6f6(_0x16e68a);});});}exports['GetVoiceExtension']=function(_0x4e739f){var _0x17882c=this;return new Promise(function(_0x1ed30f,_0x3f4ed3){return db[_0x236b('0x1b')][_0x236b('0x1c')]({'raw':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')][_0x236b('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')][_0x236b('0x1f')]||null:null,'attributes':_0x4e739f[_0x236b('0x1d')]?_0x4e739f['options'][_0x236b('0x20')]||null:null,'limit':_0x4e739f[_0x236b('0x1d')]?_0x4e739f['options'][_0x236b('0x21')]||null:null,'include':_0x4e739f[_0x236b('0x1d')]?_0x4e739f[_0x236b('0x1d')]['include']?_[_0x236b('0x22')](_0x4e739f[_0x236b('0x1d')][_0x236b('0x23')],function(_0x154905){return{'model':db[_0x154905[_0x236b('0x24')]],'as':_0x154905['as'],'attributes':_0x154905[_0x236b('0x20')],'include':_0x154905[_0x236b('0x23')]?_['map'](_0x154905[_0x236b('0x23')],function(_0x4dbe16){return{'model':db[_0x4dbe16[_0x236b('0x24')]],'as':_0x4dbe16['as'],'attributes':_0x4dbe16[_0x236b('0x20')],'include':_0x4dbe16[_0x236b('0x23')]?_[_0x236b('0x22')](_0x4dbe16[_0x236b('0x23')],function(_0x1b5a50){return{'model':db[_0x1b5a50[_0x236b('0x24')]],'as':_0x1b5a50['as'],'attributes':_0x1b5a50[_0x236b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x236b('0x11')](function(_0xa7cf2f){logger[_0x236b('0x18')](_0x236b('0x25'),_0x4e739f);logger[_0x236b('0x26')](_0x236b('0x25'),_0x4e739f,JSON['stringify'](_0xa7cf2f));_0x1ed30f(_0xa7cf2f);})[_0x236b('0x27')](function(_0x24abb8){logger[_0x236b('0x15')]('GetVoiceExtension',_0x24abb8[_0x236b('0x17')],_0x4e739f);_0x3f4ed3(_0x17882c[_0x236b('0x15')](0x1f4,_0x24abb8[_0x236b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d0ab04a..0d0033d 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x933190,_0x6d6251){var _0x121fa8=function(_0x174fe7){while(--_0x174fe7){_0x933190['push'](_0x933190['shift']());}};_0x121fa8(++_0x6d6251);}(_0x0295,0x1f0));var _0x5029=function(_0x20c757,_0xf1f53b){_0x20c757=_0x20c757-0x0;var _0x2720f3=_0x0295[_0x20c757];return _0x2720f3;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x37edaa,_0x4ed62a){var _0x3bcda0=function(_0x16e822){while(--_0x16e822){_0x37edaa['push'](_0x37edaa['shift']());}};_0x3bcda0(++_0x4ed62a);}(_0xf494,0x1c6));var _0x4f49=function(_0x419d5f,_0xb04a60){_0x419d5f=_0x419d5f-0x0;var _0x4c84b0=_0xf494[_0x419d5f];return _0x4c84b0;};'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 eae5795..b092ca0 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 _0x583c=['fs-extra','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','getMessages','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0xee588,_0x368239){var _0x58dd1a=function(_0x3fd2b1){while(--_0x3fd2b1){_0xee588['push'](_0xee588['shift']());}};_0x58dd1a(++_0x368239);}(_0x583c,0x12b));var _0xc583=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x583c[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id/messages',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0xf')]);router['put'](_0xc583('0xb'),auth[_0xc583('0x8')](),controller['update']);router[_0xc583('0x10')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0x11')]);module[_0xc583('0x12')]=router; \ No newline at end of file +var _0xfb11=['index','/:id','show','get','/:id/messages','getMessages','post','create','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated'];(function(_0x56b9d8,_0x39657d){var _0x342313=function(_0x2b12e5){while(--_0x2b12e5){_0x56b9d8['push'](_0x56b9d8['shift']());}};_0x342313(++_0x39657d);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xfb11[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xe')]('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xf')]);router['put'](_0x1fb1('0x9'),auth['isAuthenticated'](),controller[_0x1fb1('0x10')]);router['delete'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x11')]);module[_0x1fb1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 50cb6a9..fdeb3eb 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 _0x6afc=['mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0x6afc,0x111));var _0xc6af=function(_0x2034c6,_0x30c939){_0x2034c6=_0x2034c6-0x0;var _0x52bad0=_0x6afc[_0x2034c6];return _0x52bad0;};'use strict';var Sequelize=require(_0xc6af('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xc6af('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xc6af('0x2'),'unique':_0xc6af('0x3')},'mailbox':{'type':Sequelize[_0xc6af('0x1')],'defaultValue':'','allowNull':![],'unique':_0xc6af('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xc6af('0x1')]},'email':{'type':Sequelize[_0xc6af('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3fc553){this[_0xc6af('0x4')]('email',typeof _0x3fc553===_0xc6af('0x5')&&_0x3fc553['trim']()?_0x3fc553['trim']():null);}},'pager':{'type':Sequelize[_0xc6af('0x1')]},'tz':{'type':Sequelize[_0xc6af('0x1')],'defaultValue':_0xc6af('0x6')},'attach':{'type':Sequelize[_0xc6af('0x7')]('yes','no'),'defaultValue':_0xc6af('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':_0xc6af('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc6af('0x1')]},'callback':{'type':Sequelize[_0xc6af('0x1')]},'review':{'type':Sequelize['ENUM'](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc6af('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':_0xc6af('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc6af('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc6af('0x7')](_0xc6af('0x8'),'no'),'defaultValue':_0xc6af('0x8'),'allowNull':![]},'stamp':{'type':_0xc6af('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc6af('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc6af('0xc')](_0xc6af('0xd'))+_0xc6af('0xe')+this['getDataValue'](_0xc6af('0xf'));}}}; \ No newline at end of file +var _0x1a58=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','STRING','from-voicemail'];(function(_0x20099a,_0x2bf584){var _0x2c3649=function(_0x3c2f4b){while(--_0x3c2f4b){_0x20099a['push'](_0x20099a['shift']());}};_0x2c3649(++_0x2bf584);}(_0x1a58,0x11a));var _0x81a5=function(_0xf63918,_0xa2cf81){_0xf63918=_0xf63918-0x0;var _0x2f57be=_0x1a58[_0xf63918];return _0x2f57be;};'use strict';var Sequelize=require(_0x81a5('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x81a5('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x81a5('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x81a5('0x3')},'password':{'type':Sequelize[_0x81a5('0x1')]},'fullname':{'type':Sequelize[_0x81a5('0x1')]},'email':{'type':Sequelize[_0x81a5('0x1')],'validate':{'isEmail':!![]},'set':function(_0x29dab0){this[_0x81a5('0x4')](_0x81a5('0x5'),typeof _0x29dab0==='string'&&_0x29dab0['trim']()?_0x29dab0[_0x81a5('0x6')]():null);}},'pager':{'type':Sequelize[_0x81a5('0x1')]},'tz':{'type':Sequelize[_0x81a5('0x1')],'defaultValue':_0x81a5('0x7')},'attach':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':_0x81a5('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x81a5('0x9'),'no'),'defaultValue':_0x81a5('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x81a5('0x1')]},'callback':{'type':Sequelize[_0x81a5('0x1')]},'review':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x81a5('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':_0x81a5('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x81a5('0x8')](_0x81a5('0x9'),'no'),'defaultValue':_0x81a5('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x81a5('0x1')]},'emailbody':{'type':Sequelize[_0x81a5('0x1')]},'maxsecs':{'type':Sequelize[_0x81a5('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x81a5('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x81a5('0xc')],'get':function(){return this[_0x81a5('0xd')]('fullname')+'\x20-\x20'+this[_0x81a5('0xd')](_0x81a5('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d891516..7371e07 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 _0xed3c=['body','getMessages','findOne','order','sort','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2904ad,_0x25177c){var _0x1e15eb=function(_0x4a7ce1){while(--_0x4a7ce1){_0x2904ad['push'](_0x2904ad['shift']());}};_0x1e15eb(++_0x25177c);}(_0xed3c,0x1a6));var _0xced3=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0xed3c[_0x329905];return _0x3aa42;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){var _0x50f7c1=_0x101708[_0xced3('0x23')]({'plain':!![]});var _0x23f92b='Voicemails';return db[_0xced3('0x24')]['destroy']({'where':{'type':_0x23f92b,'resourceId':_0x50f7c1['id']}})[_0xced3('0x21')](function(){return _0x101708;});})[_0xced3('0x21')](function(){_0x559fa2[_0xced3('0x17')](0xcc)[_0xced3('0x25')]();});}};}function handleEntityNotFound(_0x2ec2c4,_0x502cf1){return function(_0x5454c0){if(!_0x5454c0){_0x2ec2c4[_0xced3('0x16')](0x194);}return _0x5454c0;};}function handleError(_0x5bb425,_0x2ab8a8){_0x2ab8a8=_0x2ab8a8||0x1f4;return function(_0x1e6923){logger['error'](_0x1e6923[_0xced3('0x26')]);if(_0x1e6923[_0xced3('0x27')]){delete _0x1e6923[_0xced3('0x27')];}_0x5bb425[_0xced3('0x17')](_0x2ab8a8)[_0xced3('0x28')](_0x1e6923);};}exports[_0xced3('0x29')]=function(_0x895a32,_0x41d003){var _0x116cc7={},_0x559b8e={},_0xa78899={'count':0x0,'rows':[]};var _0x1b8baa=_[_0xced3('0x2a')](db[_0xced3('0x2b')][_0xced3('0x2c')],function(_0x21e4a2){return{'name':_0x21e4a2[_0xced3('0x2d')],'type':_0x21e4a2[_0xced3('0x2e')][_0xced3('0x2f')]};});_0x559b8e[_0xced3('0x30')]=_[_0xced3('0x2a')](_0x1b8baa,_0xced3('0x27'));_0x559b8e[_0xced3('0x31')]=_[_0xced3('0x32')](_0x895a32[_0xced3('0x31')]);_0x559b8e[_0xced3('0x33')]=_[_0xced3('0x34')](_0x559b8e[_0xced3('0x30')],_0x559b8e[_0xced3('0x31')]);_0x116cc7[_0xced3('0x35')]=_[_0xced3('0x34')](_0x559b8e['model'],qs[_0xced3('0x36')](_0x895a32['query'][_0xced3('0x36')]));_0x116cc7[_0xced3('0x35')]=_0x116cc7[_0xced3('0x35')][_0xced3('0x37')]?_0x116cc7[_0xced3('0x35')]:_0x559b8e[_0xced3('0x30')];if(!_0x895a32[_0xced3('0x31')][_0xced3('0x38')](_0xced3('0x39'))){_0x116cc7[_0xced3('0x1a')]=qs['limit'](_0x895a32[_0xced3('0x31')][_0xced3('0x1a')]);_0x116cc7['offset']=qs[_0xced3('0x1c')](_0x895a32[_0xced3('0x31')][_0xced3('0x1c')]);}_0x116cc7['order']=qs['sort'](_0x895a32[_0xced3('0x31')]['sort']);_0x116cc7[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x895a32[_0xced3('0x31')],_0x559b8e[_0xced3('0x33')]),_0x1b8baa);if(_0x895a32[_0xced3('0x31')]['filter']){_0x116cc7[_0xced3('0x3a')]=_['merge'](_0x116cc7['where'],{'$or':_[_0xced3('0x2a')](_0x1b8baa,function(_0x31e281){if(_0x31e281[_0xced3('0x2e')]!=='VIRTUAL'){var _0xb2cf20={};_0xb2cf20[_0x31e281[_0xced3('0x27')]]={'$like':'%'+_0x895a32[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0xb2cf20;}})});}_0x116cc7=_[_0xced3('0x3c')]({},_0x116cc7,_0x895a32[_0xced3('0x3d')]);var _0x30e890={'where':_0x116cc7[_0xced3('0x3a')]};return db[_0xced3('0x2b')][_0xced3('0x1b')](_0x30e890)[_0xced3('0x21')](function(_0x38855f){_0xa78899[_0xced3('0x1b')]=_0x38855f;if(_0x895a32[_0xced3('0x31')][_0xced3('0x3e')]){_0x116cc7['include']=[{'all':!![]}];}return db[_0xced3('0x2b')][_0xced3('0x3f')](_0x116cc7);})[_0xced3('0x21')](function(_0x1a6c1f){_0xa78899[_0xced3('0x40')]=_0x1a6c1f;return _0xa78899;})[_0xced3('0x21')](respondWithFilteredResult(_0x41d003,_0x116cc7))[_0xced3('0x41')](handleError(_0x41d003,null));};exports[_0xced3('0x42')]=function(_0x1ab7e0,_0x4cea5c){var _0x6c0238={'raw':!![],'where':{'id':_0x1ab7e0[_0xced3('0x43')]['id']}},_0x47ab23={};_0x47ab23[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMail'][_0xced3('0x2c')]);_0x47ab23[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1ab7e0[_0xced3('0x31')]);_0x47ab23['filters']=_[_0xced3('0x34')](_0x47ab23[_0xced3('0x30')],_0x47ab23[_0xced3('0x31')]);_0x6c0238[_0xced3('0x35')]=_[_0xced3('0x34')](_0x47ab23['model'],qs[_0xced3('0x36')](_0x1ab7e0[_0xced3('0x31')][_0xced3('0x36')]));_0x6c0238[_0xced3('0x35')]=_0x6c0238[_0xced3('0x35')][_0xced3('0x37')]?_0x6c0238[_0xced3('0x35')]:_0x47ab23['model'];if(_0x1ab7e0[_0xced3('0x31')][_0xced3('0x3e')]){_0x6c0238['include']=[{'all':!![]}];}_0x6c0238=_['merge']({},_0x6c0238,_0x1ab7e0[_0xced3('0x3d')]);return db['VoiceMail'][_0xced3('0x44')](_0x6c0238)[_0xced3('0x21')](handleEntityNotFound(_0x4cea5c,null))[_0xced3('0x21')](respondWithResult(_0x4cea5c,null))[_0xced3('0x41')](handleError(_0x4cea5c,null));};exports[_0xced3('0x45')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x2b')][_0xced3('0x45')](_0x1b3396['body'],{})[_0xced3('0x21')](function(_0x8df206){var _0x2aa876=_0x1b3396[_0xced3('0x46')][_0xced3('0x23')]({'plain':!![]});if(!_0x2aa876)throw new Error(_0xced3('0x47'));if(_0x2aa876['role']===_0xced3('0x46')){var _0x629ecf=_0x8df206[_0xced3('0x23')]({'plain':!![]});var _0x409da0=_0xced3('0x48');return db[_0xced3('0x49')][_0xced3('0x44')]({'where':{'name':_0x409da0,'userProfileId':_0x2aa876[_0xced3('0x4a')]},'raw':!![]})[_0xced3('0x21')](function(_0x44d779){if(_0x44d779&&_0x44d779[_0xced3('0x4b')]===0x0){return db[_0xced3('0x24')]['create']({'name':_0x629ecf[_0xced3('0x27')],'resourceId':_0x629ecf['id'],'type':_0x44d779['name'],'sectionId':_0x44d779['id']},{})[_0xced3('0x21')](function(){return _0x8df206;});}else{return _0x8df206;}})[_0xced3('0x41')](function(_0xc93e05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc93e05);throw _0xc93e05;});}return _0x8df206;})[_0xced3('0x21')](respondWithResult(_0x3700ed,0xc9))[_0xced3('0x41')](handleError(_0x3700ed,null));};exports['update']=function(_0x3f41cc,_0x4ae67d){if(_0x3f41cc[_0xced3('0x4c')]['id']){delete _0x3f41cc[_0xced3('0x4c')]['id'];}return db['VoiceMail'][_0xced3('0x44')]({'where':{'id':_0x3f41cc[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x4ae67d,null))['then'](saveUpdates(_0x3f41cc[_0xced3('0x4c')],null))['then'](respondWithResult(_0x4ae67d,null))[_0xced3('0x41')](handleError(_0x4ae67d,null));};exports[_0xced3('0x22')]=function(_0x4694b8,_0x168c36){return db[_0xced3('0x2b')][_0xced3('0x44')]({'where':{'id':_0x4694b8[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x168c36,null))[_0xced3('0x21')](removeEntity(_0x168c36,null))[_0xced3('0x41')](handleError(_0x168c36,null));};exports[_0xced3('0x4d')]=function(_0x4b14dd,_0x3859e8,_0x3de35d){return db[_0xced3('0x2b')][_0xced3('0x4e')]({'where':{'id':_0x4b14dd[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3859e8,null))['then'](function(_0x9db425){var _0x171081;var _0x21ea6a={},_0x440a0f={};_0x440a0f[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMailMessage'][_0xced3('0x2c')]);_0x440a0f['query']=_[_0xced3('0x32')](_0x4b14dd['query']);_0x440a0f[_0xced3('0x33')]=_[_0xced3('0x34')](_0x440a0f['model'],_0x440a0f[_0xced3('0x31')]);_0x21ea6a[_0xced3('0x35')]=_[_0xced3('0x34')](_0x440a0f[_0xced3('0x30')],qs[_0xced3('0x36')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x36')]));_0x21ea6a[_0xced3('0x35')]=_0x21ea6a[_0xced3('0x35')][_0xced3('0x37')]?_0x21ea6a[_0xced3('0x35')]:_0x440a0f[_0xced3('0x30')];if(!_0x4b14dd[_0xced3('0x31')]['hasOwnProperty'](_0xced3('0x39'))){_0x21ea6a[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x4b14dd[_0xced3('0x31')]['limit']);_0x21ea6a[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x1c')]);}_0x21ea6a[_0xced3('0x4f')]=qs[_0xced3('0x50')](_0x4b14dd[_0xced3('0x31')]['sort']);_0x21ea6a[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x4b14dd[_0xced3('0x31')],_0x440a0f[_0xced3('0x33')]));if(_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]){_0x21ea6a['where']=_[_0xced3('0x3c')](_0x21ea6a[_0xced3('0x3a')],{'$or':_[_0xced3('0x2a')](_0x21ea6a[_0xced3('0x35')],function(_0x3992d2){var _0x385d45={};_0x385d45[_0x3992d2]={'$like':'%'+_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0x385d45;})});}_0x21ea6a[_0xced3('0x3a')]=_[_0xced3('0x3c')](_0x21ea6a['where'],{'mailboxuser':_0x9db425[_0xced3('0x51')]});_0x21ea6a=_[_0xced3('0x3c')]({},_0x21ea6a,_0x4b14dd['options']);return db['VoiceMailMessage'][_0xced3('0x52')](_0x21ea6a)['then'](respondWithFilteredResult(_0x3859e8,_0x21ea6a));})[_0xced3('0x41')](handleError(_0x3859e8,null));}; \ No newline at end of file +var _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x16c7d4,_0x1fd6a5){var _0x54c042=function(_0x2ef67c){while(--_0x2ef67c){_0x16c7d4['push'](_0x16c7d4['shift']());}};_0x54c042(++_0x1fd6a5);}(_0x5eb8,0xb0));var _0x85eb=function(_0x230639,_0x20f428){_0x230639=_0x230639-0x0;var _0x5248d7=_0x5eb8[_0x230639];return _0x5248d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 801bdd9..acd3a86 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 _0x7657=['request-promise','path','../../config/environment','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x575e18,_0x25a520){var _0x5626c0=function(_0x3bd81e){while(--_0x3bd81e){_0x575e18['push'](_0x575e18['shift']());}};_0x5626c0(++_0x25a520);}(_0x7657,0x108));var _0x7765=function(_0x453acf,_0x3c10c6){_0x453acf=_0x453acf-0x0;var _0x49c3c1=_0x7657[_0x453acf];return _0x49c3c1;};'use strict';var _=require(_0x7765('0x0'));var util=require(_0x7765('0x1'));var logger=require(_0x7765('0x2'))(_0x7765('0x3'));var moment=require(_0x7765('0x4'));var BPromise=require(_0x7765('0x5'));var rp=require(_0x7765('0x6'));var fs=require('fs');var path=require(_0x7765('0x7'));var rimraf=require('rimraf');var config=require(_0x7765('0x8'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x46c500,_0x8b18){return _0x46c500[_0x7765('0x9')](_0x7765('0xa'),attributes,{'tableName':_0x7765('0xb'),'paranoid':![],'indexes':[{'name':_0x7765('0xc'),'fields':[_0x7765('0xd'),_0x7765('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1e0=['define','mailbox','context','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd1e0,0x85));var _0x0d1e=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xd1e0[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x0d1e('0x0'));var util=require('util');var logger=require(_0x0d1e('0x1'))(_0x0d1e('0x2'));var moment=require(_0x0d1e('0x3'));var BPromise=require(_0x0d1e('0x4'));var rp=require(_0x0d1e('0x5'));var fs=require('fs');var path=require(_0x0d1e('0x6'));var rimraf=require('rimraf');var config=require(_0x0d1e('0x7'));var attributes=require(_0x0d1e('0x8'));module[_0x0d1e('0x9')]=function(_0x482b89,_0x4a00b5){return _0x482b89[_0x0d1e('0xa')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x0d1e('0xb'),_0x0d1e('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 4c68724..5c0466d 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 _0x50ac=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x231a53,_0x328649){var _0x587a55=function(_0x3331b2){while(--_0x3331b2){_0x231a53['push'](_0x231a53['shift']());}};_0x587a55(++_0x328649);}(_0x50ac,0x170));var _0xc50a=function(_0x1c42f1,_0x18e091){_0x1c42f1=_0x1c42f1-0x0;var _0x4f151d=_0x50ac[_0x1c42f1];return _0x4f151d;};'use strict';var _=require('lodash');var util=require(_0xc50a('0x0'));var moment=require(_0xc50a('0x1'));var BPromise=require(_0xc50a('0x2'));var rs=require(_0xc50a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc50a('0x4'))['db'];var utils=require(_0xc50a('0x5'));var logger=require(_0xc50a('0x6'))(_0xc50a('0x7'));var config=require(_0xc50a('0x8'));var jayson=require(_0xc50a('0x9'));var client=jayson[_0xc50a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cd42,_0x48dbab,_0xdb9560){return new BPromise(function(_0x5c0c83,_0x22e48f){return client[_0xc50a('0xb')](_0x27cd42,_0xdb9560)[_0xc50a('0xc')](function(_0x4470b1){logger['info'](_0xc50a('0xd'),_0x48dbab,'request\x20sent');logger[_0xc50a('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x48dbab,_0xc50a('0xf'),JSON[_0xc50a('0x10')](_0x4470b1));if(_0x4470b1[_0xc50a('0x11')]){if(_0x4470b1[_0xc50a('0x11')][_0xc50a('0x12')]===0x1f4){logger[_0xc50a('0x11')](_0xc50a('0xd'),_0x48dbab,_0x4470b1[_0xc50a('0x11')][_0xc50a('0x13')]);return _0x22e48f(_0x4470b1[_0xc50a('0x11')][_0xc50a('0x13')]);}logger['error'](_0xc50a('0xd'),_0x48dbab,_0x4470b1[_0xc50a('0x11')][_0xc50a('0x13')]);return _0x5c0c83(_0x4470b1[_0xc50a('0x11')][_0xc50a('0x13')]);}else{logger[_0xc50a('0x14')](_0xc50a('0xd'),_0x48dbab,'request\x20sent');_0x5c0c83(_0x4470b1['result']['message']);}})[_0xc50a('0x15')](function(_0x33fc05){logger['error'](_0xc50a('0xd'),_0x48dbab,_0x33fc05);_0x22e48f(_0x33fc05);});});} \ No newline at end of file +var _0x33a2=['VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','debug'];(function(_0x5abca6,_0x307f19){var _0x561b27=function(_0x1fd009){while(--_0x1fd009){_0x5abca6['push'](_0x5abca6['shift']());}};_0x561b27(++_0x307f19);}(_0x33a2,0x104));var _0x233a=function(_0x3026b7,_0x170774){_0x3026b7=_0x3026b7-0x0;var _0x2064cc=_0x33a2[_0x3026b7];return _0x2064cc;};'use strict';var _=require('lodash');var util=require(_0x233a('0x0'));var moment=require(_0x233a('0x1'));var BPromise=require(_0x233a('0x2'));var rs=require(_0x233a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x233a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x233a('0x5'));var config=require(_0x233a('0x6'));var jayson=require(_0x233a('0x7'));var client=jayson[_0x233a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157842,_0x569523,_0x384b83){return new BPromise(function(_0x4f4501,_0x3401ae){return client['request'](_0x157842,_0x384b83)[_0x233a('0x9')](function(_0xa049d9){logger[_0x233a('0xa')](_0x233a('0xb'),_0x569523,'request\x20sent');logger[_0x233a('0xc')](_0x233a('0xd'),_0x569523,_0x233a('0xe'),JSON[_0x233a('0xf')](_0xa049d9));if(_0xa049d9[_0x233a('0x10')]){if(_0xa049d9[_0x233a('0x10')][_0x233a('0x11')]===0x1f4){logger[_0x233a('0x10')](_0x233a('0xb'),_0x569523,_0xa049d9[_0x233a('0x10')][_0x233a('0x12')]);return _0x3401ae(_0xa049d9[_0x233a('0x10')][_0x233a('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x569523,_0xa049d9[_0x233a('0x10')][_0x233a('0x12')]);return _0x4f4501(_0xa049d9[_0x233a('0x10')][_0x233a('0x12')]);}else{logger[_0x233a('0xa')]('VoiceMail,\x20%s,\x20%s',_0x569523,_0x233a('0xe'));_0x4f4501(_0xa049d9[_0x233a('0x13')]['message']);}})[_0x233a('0x14')](function(_0xda8348){logger[_0x233a('0x10')]('VoiceMail,\x20%s,\x20%s',_0x569523,_0xda8348);_0x3401ae(_0xda8348);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a4dc9c1..2673852 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 _0xe9f4=['download','post','put','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download'];(function(_0x5b1d80,_0x4230ba){var _0x4f344c=function(_0x50d40b){while(--_0x50d40b){_0x5b1d80['push'](_0x5b1d80['shift']());}};_0x4f344c(++_0x4230ba);}(_0xe9f4,0x1e1));var _0x4e9f=function(_0xc532f1,_0x2b11aa){_0xc532f1=_0xc532f1-0x0;var _0x2f7edc=_0xe9f4[_0xc532f1];return _0x2f7edc;};'use strict';var multer=require(_0x4e9f('0x0'));var util=require(_0x4e9f('0x1'));var path=require(_0x4e9f('0x2'));var timeout=require(_0x4e9f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4e9f('0x4'));var interaction=require(_0x4e9f('0x5'));var config=require('../../config/environment');var controller=require(_0x4e9f('0x6'));router[_0x4e9f('0x7')]('/',auth[_0x4e9f('0x8')](),controller['index']);router[_0x4e9f('0x7')](_0x4e9f('0x9'),auth[_0x4e9f('0x8')](),controller[_0x4e9f('0xa')]);router[_0x4e9f('0x7')](_0x4e9f('0xb'),auth[_0x4e9f('0x8')](),controller[_0x4e9f('0xc')]);router[_0x4e9f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4e9f('0xe')](_0x4e9f('0x9'),auth[_0x4e9f('0x8')](),controller['update']);router[_0x4e9f('0xf')](_0x4e9f('0x9'),auth[_0x4e9f('0x8')](),controller['destroy']);module[_0x4e9f('0x10')]=router; \ No newline at end of file +var _0x5d75=['/:id/download','download','create','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d75,0x169));var _0x55d7=function(_0x4934d6,_0x36e9b2){_0x4934d6=_0x4934d6-0x0;var _0x5cc8cb=_0x5d75[_0x4934d6];return _0x5cc8cb;};'use strict';var multer=require('multer');var util=require(_0x55d7('0x0'));var path=require(_0x55d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x55d7('0x2'));var router=express[_0x55d7('0x3')]();var fs_extra=require(_0x55d7('0x4'));var auth=require(_0x55d7('0x5'));var interaction=require(_0x55d7('0x6'));var config=require(_0x55d7('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x55d7('0x8')](),controller[_0x55d7('0x9')]);router[_0x55d7('0xa')](_0x55d7('0xb'),auth[_0x55d7('0x8')](),controller[_0x55d7('0xc')]);router[_0x55d7('0xa')](_0x55d7('0xd'),auth[_0x55d7('0x8')](),controller[_0x55d7('0xe')]);router['post']('/',auth[_0x55d7('0x8')](),controller[_0x55d7('0xf')]);router['put'](_0x55d7('0xb'),auth[_0x55d7('0x8')](),controller['update']);router['delete'](_0x55d7('0xb'),auth[_0x55d7('0x8')](),controller['destroy']);module[_0x55d7('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7deba7e..b5c4725 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 _0x5b5d=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x1c2262,_0x2011ce){var _0x288795=function(_0x3bc3a3){while(--_0x3bc3a3){_0x1c2262['push'](_0x1c2262['shift']());}};_0x288795(++_0x2011ce);}(_0x5b5d,0x100));var _0xd5b5=function(_0x9a6574,_0x10bb70){_0x9a6574=_0x9a6574-0x0;var _0x4ec2bb=_0x5b5d[_0x9a6574];return _0x4ec2bb;};'use strict';var Sequelize=require(_0xd5b5('0x0'));module[_0xd5b5('0x1')]={'name':{'type':Sequelize[_0xd5b5('0x2')],'get':function(_0x4499e5){return this[_0xd5b5('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xd5b5('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xd5b5('0x6')](_0xd5b5('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xd5b5('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xd5b5('0x8'),'defaultValue':Sequelize[_0xd5b5('0x9')](_0xd5b5('0xa'))}}; \ No newline at end of file +var _0x82e6=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','literal'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0x82e6,0x19b));var _0x682e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x82e6[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x682e('0x0'));module[_0x682e('0x1')]={'name':{'type':Sequelize[_0x682e('0x2')],'get':function(_0x2c4526){return this[_0x682e('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x682e('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x682e('0x6')](_0x682e('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x682e('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x682e('0x8')](_0x682e('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c00d6b7..9e9adf0 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 _0xa75d=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','update','then','stack','name','index','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceMailMessage','findAll','catch','show','params','rawAttributes','length','find','create','body','destroy','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','send','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x54c889,_0x5a11e7){var _0x5c733c=function(_0x1dced5){while(--_0x1dced5){_0x54c889['push'](_0x54c889['shift']());}};_0x5c733c(++_0x5a11e7);}(_0xa75d,0xe8));var _0xda75=function(_0x34b734,_0xe0fba2){_0x34b734=_0x34b734-0x0;var _0x464f44=_0xa75d[_0x34b734];return _0x464f44;};'use strict';var emlformat=require(_0xda75('0x0'));var rimraf=require(_0xda75('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xda75('0x2'));var moment=require(_0xda75('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xda75('0x4'));var util=require(_0xda75('0x5'));var path=require(_0xda75('0x6'));var sox=require(_0xda75('0x7'));var csv=require(_0xda75('0x8'));var ejs=require(_0xda75('0x9'));var fs=require('fs');var fs_extra=require(_0xda75('0xa'));var _=require(_0xda75('0xb'));var squel=require(_0xda75('0xc'));var crypto=require(_0xda75('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda75('0xe'));var toCsv=require('to-csv');var querystring=require(_0xda75('0xf'));var Papa=require(_0xda75('0x10'));var Redis=require('ioredis');var authService=require(_0xda75('0x11'));var qs=require(_0xda75('0x12'));var as=require(_0xda75('0x13'));var hardwareService=require(_0xda75('0x14'));var logger=require('../../config/logger')(_0xda75('0x15'));var utils=require(_0xda75('0x16'));var config=require(_0xda75('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xda75('0x18'))['db'];function respondWithStatusCode(_0x368c1d,_0x5d0d8d){_0x5d0d8d=_0x5d0d8d||0xcc;return function(_0x5e23c4){if(_0x5e23c4){return _0x368c1d[_0xda75('0x19')](_0x5d0d8d);}return _0x368c1d[_0xda75('0x1a')](_0x5d0d8d)[_0xda75('0x1b')]();};}function respondWithResult(_0x3b5065,_0x3eaff0){_0x3eaff0=_0x3eaff0||0xc8;return function(_0xf3f207){if(_0xf3f207){return _0x3b5065['status'](_0x3eaff0)[_0xda75('0x1c')](_0xf3f207);}};}function respondWithFilteredResult(_0xff0275,_0x5cd713){return function(_0x28c262){if(_0x28c262){var _0x34772d=typeof _0x5cd713[_0xda75('0x1d')]==='undefined'&&typeof _0x5cd713[_0xda75('0x1e')]==='undefined';var _0xcd91d9=_0x28c262[_0xda75('0x1f')];var _0x126721=_0x34772d?0x0:_0x5cd713[_0xda75('0x1d')];var _0x19b101=_0x34772d?_0x28c262[_0xda75('0x1f')]:_0x5cd713['offset']+_0x5cd713[_0xda75('0x1e')];var _0x206c06;if(_0x19b101>=_0xcd91d9){_0x19b101=_0xcd91d9;_0x206c06=0xc8;}else{_0x206c06=0xce;}_0xff0275[_0xda75('0x1a')](_0x206c06);return _0xff0275['set']('Content-Range',_0x126721+'-'+_0x19b101+'/'+_0xcd91d9)[_0xda75('0x1c')](_0x28c262);}return null;};}function patchUpdates(_0x2f544f){return function(_0x45ddff){try{jsonpatch[_0xda75('0x20')](_0x45ddff,_0x2f544f,!![]);}catch(_0x3d9df5){return BPromise['reject'](_0x3d9df5);}return _0x45ddff['save']();};}function saveUpdates(_0x3ab0db,_0x2eb34e){return function(_0x1032d9){if(_0x1032d9){return _0x1032d9[_0xda75('0x21')](_0x3ab0db)[_0xda75('0x22')](function(_0x18d843){return _0x18d843;});}return null;};}function removeEntity(_0x1c1a3c,_0x3befbe){return function(_0x47c692){if(_0x47c692){return _0x47c692['destroy']()['then'](function(){_0x1c1a3c[_0xda75('0x1a')](0xcc)[_0xda75('0x1b')]();});}};}function handleEntityNotFound(_0x113f5e,_0x41afb2){return function(_0x313472){if(!_0x313472){_0x113f5e[_0xda75('0x19')](0x194);}return _0x313472;};}function handleError(_0x3d39f4,_0x4a75d4){_0x4a75d4=_0x4a75d4||0x1f4;return function(_0x42616f){logger['error'](_0x42616f[_0xda75('0x23')]);if(_0x42616f[_0xda75('0x24')]){delete _0x42616f[_0xda75('0x24')];}_0x3d39f4[_0xda75('0x1a')](_0x4a75d4)['send'](_0x42616f);};}exports[_0xda75('0x25')]=function(_0x367205,_0x6cfac9){var _0x3a33cd={},_0x5a6243={},_0x586ed8={'count':0x0,'rows':[]};var _0x2ff04e=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x5e646f){return{'name':_0x5e646f[_0xda75('0x26')],'type':_0x5e646f[_0xda75('0x27')][_0xda75('0x28')]};});_0x5a6243[_0xda75('0x29')]=_[_0xda75('0x2a')](_[_0xda75('0x2b')](_0x2ff04e,_0xda75('0x24')),[_0xda75('0x24')]);_0x5a6243[_0xda75('0x2c')]=_[_0xda75('0x2d')](_0x367205['query']);_0x5a6243[_0xda75('0x2e')]=_[_0xda75('0x2f')](_0x5a6243[_0xda75('0x29')],_0x5a6243['query']);_0x3a33cd[_0xda75('0x30')]=_[_0xda75('0x2f')](_0x5a6243['model'],qs[_0xda75('0x31')](_0x367205[_0xda75('0x2c')][_0xda75('0x31')]));_0x3a33cd[_0xda75('0x30')]=_0x3a33cd['attributes']['length']?_0x3a33cd[_0xda75('0x30')]:_0x5a6243['model'];if(!_0x367205[_0xda75('0x2c')][_0xda75('0x32')](_0xda75('0x33'))){_0x3a33cd['limit']=qs[_0xda75('0x1e')](_0x367205[_0xda75('0x2c')][_0xda75('0x1e')]);_0x3a33cd[_0xda75('0x1d')]=qs[_0xda75('0x1d')](_0x367205[_0xda75('0x2c')][_0xda75('0x1d')]);}_0x3a33cd[_0xda75('0x34')]=qs[_0xda75('0x35')](_0x367205['query'][_0xda75('0x35')]);_0x3a33cd[_0xda75('0x36')]=qs['filters'](_['pick'](_0x367205['query'],_0x5a6243[_0xda75('0x2e')]),_0x2ff04e);if(_0x367205[_0xda75('0x2c')][_0xda75('0x37')]){_0x3a33cd[_0xda75('0x36')]=_[_0xda75('0x38')](_0x3a33cd[_0xda75('0x36')],{'$or':_[_0xda75('0x2b')](_0x2ff04e,function(_0x475921){if(_0x475921[_0xda75('0x27')]!==_0xda75('0x39')){var _0x491ebf={};_0x491ebf[_0x475921[_0xda75('0x24')]]={'$like':'%'+_0x367205[_0xda75('0x2c')]['filter']+'%'};return _0x491ebf;}})});}_0x3a33cd=_[_0xda75('0x38')]({},_0x3a33cd,_0x367205[_0xda75('0x3a')]);var _0x50bc57={'where':_0x3a33cd[_0xda75('0x36')]};return db['VoiceMailMessage'][_0xda75('0x1f')](_0x50bc57)[_0xda75('0x22')](function(_0x5e9324){_0x586ed8[_0xda75('0x1f')]=_0x5e9324;if(_0x367205[_0xda75('0x2c')][_0xda75('0x3b')]){_0x3a33cd[_0xda75('0x3c')]=[{'all':!![]}];}return db[_0xda75('0x3d')][_0xda75('0x3e')](_0x3a33cd);})['then'](function(_0x22f46f){_0x586ed8['rows']=_0x22f46f;return _0x586ed8;})[_0xda75('0x22')](respondWithFilteredResult(_0x6cfac9,_0x3a33cd))[_0xda75('0x3f')](handleError(_0x6cfac9,null));};exports[_0xda75('0x40')]=function(_0xd229ff,_0x1b7df9){var _0xc0fb7c={'raw':!![],'where':{'id':_0xd229ff[_0xda75('0x41')]['id']}},_0x558dc1={};_0x558dc1[_0xda75('0x29')]=_['keys'](db[_0xda75('0x3d')][_0xda75('0x42')]);_0x558dc1[_0xda75('0x2c')]=_[_0xda75('0x2d')](_0xd229ff[_0xda75('0x2c')]);_0x558dc1[_0xda75('0x2e')]=_['intersection'](_0x558dc1['model'],_0x558dc1[_0xda75('0x2c')]);_0xc0fb7c[_0xda75('0x30')]=_['intersection'](_0x558dc1['model'],qs[_0xda75('0x31')](_0xd229ff[_0xda75('0x2c')]['fields']));_0xc0fb7c[_0xda75('0x30')]=_0xc0fb7c['attributes'][_0xda75('0x43')]?_0xc0fb7c[_0xda75('0x30')]:_0x558dc1['model'];if(_0xd229ff['query'][_0xda75('0x3b')]){_0xc0fb7c[_0xda75('0x3c')]=[{'all':!![]}];}_0xc0fb7c=_[_0xda75('0x38')]({},_0xc0fb7c,_0xd229ff[_0xda75('0x3a')]);return db[_0xda75('0x3d')][_0xda75('0x44')](_0xc0fb7c)['then'](handleEntityNotFound(_0x1b7df9,null))[_0xda75('0x22')](respondWithResult(_0x1b7df9,null))[_0xda75('0x3f')](handleError(_0x1b7df9,null));};exports[_0xda75('0x45')]=function(_0x474b9b,_0x239e99){return db[_0xda75('0x3d')][_0xda75('0x45')](_0x474b9b[_0xda75('0x46')],{})[_0xda75('0x22')](respondWithResult(_0x239e99,0xc9))['catch'](handleError(_0x239e99,null));};exports[_0xda75('0x21')]=function(_0x572b0b,_0x4c79b1){if(_0x572b0b['body']['id']){delete _0x572b0b['body']['id'];}return db[_0xda75('0x3d')][_0xda75('0x44')]({'where':{'id':_0x572b0b['params']['id']}})[_0xda75('0x22')](handleEntityNotFound(_0x4c79b1,null))['then'](saveUpdates(_0x572b0b['body'],null))[_0xda75('0x22')](respondWithResult(_0x4c79b1,null))['catch'](handleError(_0x4c79b1,null));};exports[_0xda75('0x47')]=function(_0x3e9412,_0x52c05b){return db[_0xda75('0x3d')][_0xda75('0x44')]({'where':{'id':_0x3e9412[_0xda75('0x41')]['id']}})[_0xda75('0x22')](handleEntityNotFound(_0x52c05b,null))[_0xda75('0x22')](removeEntity(_0x52c05b,null))[_0xda75('0x3f')](handleError(_0x52c05b,null));};exports['download']=function(_0x3b1e98,_0x1d9a2c,_0xf6fea4){return db[_0xda75('0x3d')]['find']({'where':{'id':_0x3b1e98[_0xda75('0x41')]['id']},'attributes':['id','recording','msg_id']})[_0xda75('0x22')](handleEntityNotFound(_0x1d9a2c,null))[_0xda75('0x22')](function(_0x5bc092){if(_0x5bc092){if(!_0x5bc092[_0xda75('0x48')]){throw new db[(_0xda75('0x49'))]['ValidationError'](_0xda75('0x4a'));}var _0x2bc277={'Content-Type':_0xda75('0x4b'),'Content-Disposition':'attachment'};if(_0x5bc092['msg_id']){_0x2bc277[_0xda75('0x4c')]=_0xda75('0x4d')+_0x5bc092[_0xda75('0x4e')]+_0xda75('0x4f');}_0x1d9a2c['set'](_0x2bc277);return _0x1d9a2c[_0xda75('0x50')](new Buffer(_0x5bc092[_0xda75('0x48')]));}})[_0xda75('0x3f')](handleError(_0x1d9a2c,null));}; \ No newline at end of file +var _0x6e7a=['params','includeAll','options','find','catch','create','body','destroy','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','rawAttributes','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','VoiceMailMessage','include','findAll','rows'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x6e7a,0x101));var _0xa6e7=function(_0x1877e2,_0x2b76d4){_0x1877e2=_0x1877e2-0x0;var _0x44e96a=_0x6e7a[_0x1877e2];return _0x44e96a;};'use strict';var emlformat=require(_0xa6e7('0x0'));var rimraf=require(_0xa6e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6e7('0x2'));var rp=require('request-promise');var moment=require(_0xa6e7('0x3'));var BPromise=require(_0xa6e7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa6e7('0x5'));var sox=require(_0xa6e7('0x6'));var csv=require(_0xa6e7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6e7('0x8'));var squel=require(_0xa6e7('0x9'));var crypto=require(_0xa6e7('0xa'));var jsforce=require(_0xa6e7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa6e7('0x7'));var querystring=require(_0xa6e7('0xc'));var Papa=require(_0xa6e7('0xd'));var Redis=require(_0xa6e7('0xe'));var authService=require(_0xa6e7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa6e7('0x10'));var hardwareService=require(_0xa6e7('0x11'));var logger=require(_0xa6e7('0x12'))(_0xa6e7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa6e7('0x14'));var db=require(_0xa6e7('0x15'))['db'];function respondWithStatusCode(_0x3acfe2,_0x322a95){_0x322a95=_0x322a95||0xcc;return function(_0x577d94){if(_0x577d94){return _0x3acfe2[_0xa6e7('0x16')](_0x322a95);}return _0x3acfe2[_0xa6e7('0x17')](_0x322a95)['end']();};}function respondWithResult(_0x43b11e,_0x54b0af){_0x54b0af=_0x54b0af||0xc8;return function(_0x285874){if(_0x285874){return _0x43b11e['status'](_0x54b0af)[_0xa6e7('0x18')](_0x285874);}};}function respondWithFilteredResult(_0xf00d3,_0x385956){return function(_0x4d6569){if(_0x4d6569){var _0x167e30=typeof _0x385956[_0xa6e7('0x19')]===_0xa6e7('0x1a')&&typeof _0x385956[_0xa6e7('0x1b')]==='undefined';var _0x202e1e=_0x4d6569[_0xa6e7('0x1c')];var _0x1d335f=_0x167e30?0x0:_0x385956[_0xa6e7('0x19')];var _0x3741a8=_0x167e30?_0x4d6569[_0xa6e7('0x1c')]:_0x385956['offset']+_0x385956[_0xa6e7('0x1b')];var _0x266831;if(_0x3741a8>=_0x202e1e){_0x3741a8=_0x202e1e;_0x266831=0xc8;}else{_0x266831=0xce;}_0xf00d3['status'](_0x266831);return _0xf00d3['set'](_0xa6e7('0x1d'),_0x1d335f+'-'+_0x3741a8+'/'+_0x202e1e)[_0xa6e7('0x18')](_0x4d6569);}return null;};}function patchUpdates(_0x5c002f){return function(_0x5d6317){try{jsonpatch[_0xa6e7('0x1e')](_0x5d6317,_0x5c002f,!![]);}catch(_0x261999){return BPromise[_0xa6e7('0x1f')](_0x261999);}return _0x5d6317[_0xa6e7('0x20')]();};}function saveUpdates(_0x4785bd,_0x20d079){return function(_0x5e4283){if(_0x5e4283){return _0x5e4283[_0xa6e7('0x21')](_0x4785bd)[_0xa6e7('0x22')](function(_0x24101c){return _0x24101c;});}return null;};}function removeEntity(_0x3760a4,_0x48c480){return function(_0x4c41f2){if(_0x4c41f2){return _0x4c41f2['destroy']()[_0xa6e7('0x22')](function(){_0x3760a4[_0xa6e7('0x17')](0xcc)[_0xa6e7('0x23')]();});}};}function handleEntityNotFound(_0x334a71,_0x3589ff){return function(_0x2305a6){if(!_0x2305a6){_0x334a71[_0xa6e7('0x16')](0x194);}return _0x2305a6;};}function handleError(_0x45581b,_0x5f0fb9){_0x5f0fb9=_0x5f0fb9||0x1f4;return function(_0x3e934b){logger['error'](_0x3e934b[_0xa6e7('0x24')]);if(_0x3e934b[_0xa6e7('0x25')]){delete _0x3e934b[_0xa6e7('0x25')];}_0x45581b[_0xa6e7('0x17')](_0x5f0fb9)[_0xa6e7('0x26')](_0x3e934b);};}exports['index']=function(_0x2dd322,_0x1642c1){var _0x3b63d4={},_0x8090db={},_0x5f00b1={'count':0x0,'rows':[]};var _0x17e6f1=_['map'](db['VoiceMailMessage'][_0xa6e7('0x27')],function(_0x1b2d18){return{'name':_0x1b2d18[_0xa6e7('0x28')],'type':_0x1b2d18['type'][_0xa6e7('0x29')]};});_0x8090db[_0xa6e7('0x2a')]=_[_0xa6e7('0x2b')](_[_0xa6e7('0x2c')](_0x17e6f1,_0xa6e7('0x25')),[_0xa6e7('0x25')]);_0x8090db[_0xa6e7('0x2d')]=_[_0xa6e7('0x2e')](_0x2dd322[_0xa6e7('0x2d')]);_0x8090db[_0xa6e7('0x2f')]=_[_0xa6e7('0x30')](_0x8090db[_0xa6e7('0x2a')],_0x8090db[_0xa6e7('0x2d')]);_0x3b63d4[_0xa6e7('0x31')]=_[_0xa6e7('0x30')](_0x8090db[_0xa6e7('0x2a')],qs[_0xa6e7('0x32')](_0x2dd322[_0xa6e7('0x2d')]['fields']));_0x3b63d4[_0xa6e7('0x31')]=_0x3b63d4[_0xa6e7('0x31')][_0xa6e7('0x33')]?_0x3b63d4[_0xa6e7('0x31')]:_0x8090db[_0xa6e7('0x2a')];if(!_0x2dd322[_0xa6e7('0x2d')][_0xa6e7('0x34')](_0xa6e7('0x35'))){_0x3b63d4[_0xa6e7('0x1b')]=qs[_0xa6e7('0x1b')](_0x2dd322[_0xa6e7('0x2d')][_0xa6e7('0x1b')]);_0x3b63d4[_0xa6e7('0x19')]=qs[_0xa6e7('0x19')](_0x2dd322['query']['offset']);}_0x3b63d4['order']=qs['sort'](_0x2dd322[_0xa6e7('0x2d')]['sort']);_0x3b63d4[_0xa6e7('0x36')]=qs[_0xa6e7('0x2f')](_[_0xa6e7('0x37')](_0x2dd322[_0xa6e7('0x2d')],_0x8090db[_0xa6e7('0x2f')]),_0x17e6f1);if(_0x2dd322[_0xa6e7('0x2d')][_0xa6e7('0x38')]){_0x3b63d4[_0xa6e7('0x36')]=_[_0xa6e7('0x39')](_0x3b63d4[_0xa6e7('0x36')],{'$or':_['map'](_0x17e6f1,function(_0x2aee05){if(_0x2aee05['type']!==_0xa6e7('0x3a')){var _0x49dea9={};_0x49dea9[_0x2aee05[_0xa6e7('0x25')]]={'$like':'%'+_0x2dd322[_0xa6e7('0x2d')][_0xa6e7('0x38')]+'%'};return _0x49dea9;}})});}_0x3b63d4=_[_0xa6e7('0x39')]({},_0x3b63d4,_0x2dd322['options']);var _0x2f9db3={'where':_0x3b63d4[_0xa6e7('0x36')]};return db[_0xa6e7('0x3b')]['count'](_0x2f9db3)[_0xa6e7('0x22')](function(_0xa18b55){_0x5f00b1[_0xa6e7('0x1c')]=_0xa18b55;if(_0x2dd322[_0xa6e7('0x2d')]['includeAll']){_0x3b63d4[_0xa6e7('0x3c')]=[{'all':!![]}];}return db[_0xa6e7('0x3b')][_0xa6e7('0x3d')](_0x3b63d4);})[_0xa6e7('0x22')](function(_0x164785){_0x5f00b1[_0xa6e7('0x3e')]=_0x164785;return _0x5f00b1;})[_0xa6e7('0x22')](respondWithFilteredResult(_0x1642c1,_0x3b63d4))['catch'](handleError(_0x1642c1,null));};exports['show']=function(_0x3733cb,_0x112997){var _0x90d074={'raw':!![],'where':{'id':_0x3733cb[_0xa6e7('0x3f')]['id']}},_0xa2fea3={};_0xa2fea3[_0xa6e7('0x2a')]=_[_0xa6e7('0x2e')](db['VoiceMailMessage'][_0xa6e7('0x27')]);_0xa2fea3['query']=_[_0xa6e7('0x2e')](_0x3733cb[_0xa6e7('0x2d')]);_0xa2fea3[_0xa6e7('0x2f')]=_[_0xa6e7('0x30')](_0xa2fea3[_0xa6e7('0x2a')],_0xa2fea3[_0xa6e7('0x2d')]);_0x90d074['attributes']=_[_0xa6e7('0x30')](_0xa2fea3['model'],qs['fields'](_0x3733cb[_0xa6e7('0x2d')]['fields']));_0x90d074[_0xa6e7('0x31')]=_0x90d074[_0xa6e7('0x31')][_0xa6e7('0x33')]?_0x90d074[_0xa6e7('0x31')]:_0xa2fea3[_0xa6e7('0x2a')];if(_0x3733cb[_0xa6e7('0x2d')][_0xa6e7('0x40')]){_0x90d074[_0xa6e7('0x3c')]=[{'all':!![]}];}_0x90d074=_[_0xa6e7('0x39')]({},_0x90d074,_0x3733cb[_0xa6e7('0x41')]);return db[_0xa6e7('0x3b')][_0xa6e7('0x42')](_0x90d074)['then'](handleEntityNotFound(_0x112997,null))[_0xa6e7('0x22')](respondWithResult(_0x112997,null))[_0xa6e7('0x43')](handleError(_0x112997,null));};exports[_0xa6e7('0x44')]=function(_0x31f34c,_0x27c4cc){return db[_0xa6e7('0x3b')][_0xa6e7('0x44')](_0x31f34c[_0xa6e7('0x45')],{})[_0xa6e7('0x22')](respondWithResult(_0x27c4cc,0xc9))[_0xa6e7('0x43')](handleError(_0x27c4cc,null));};exports[_0xa6e7('0x21')]=function(_0x4c03f4,_0x4bc17a){if(_0x4c03f4[_0xa6e7('0x45')]['id']){delete _0x4c03f4['body']['id'];}return db[_0xa6e7('0x3b')][_0xa6e7('0x42')]({'where':{'id':_0x4c03f4[_0xa6e7('0x3f')]['id']}})[_0xa6e7('0x22')](handleEntityNotFound(_0x4bc17a,null))[_0xa6e7('0x22')](saveUpdates(_0x4c03f4[_0xa6e7('0x45')],null))[_0xa6e7('0x22')](respondWithResult(_0x4bc17a,null))[_0xa6e7('0x43')](handleError(_0x4bc17a,null));};exports[_0xa6e7('0x46')]=function(_0x5ba03b,_0x330d0b){return db[_0xa6e7('0x3b')]['find']({'where':{'id':_0x5ba03b[_0xa6e7('0x3f')]['id']}})[_0xa6e7('0x22')](handleEntityNotFound(_0x330d0b,null))['then'](removeEntity(_0x330d0b,null))[_0xa6e7('0x43')](handleError(_0x330d0b,null));};exports['download']=function(_0x595bfb,_0x5b820b,_0x3dac5c){return db['VoiceMailMessage'][_0xa6e7('0x42')]({'where':{'id':_0x595bfb[_0xa6e7('0x3f')]['id']},'attributes':['id',_0xa6e7('0x47'),_0xa6e7('0x48')]})[_0xa6e7('0x22')](handleEntityNotFound(_0x5b820b,null))[_0xa6e7('0x22')](function(_0x2719f0){if(_0x2719f0){if(!_0x2719f0['recording']){throw new db[(_0xa6e7('0x49'))][(_0xa6e7('0x4a'))](_0xa6e7('0x4b'));}var _0x41f4fd={'Content-Type':_0xa6e7('0x4c'),'Content-Disposition':'attachment'};if(_0x2719f0[_0xa6e7('0x48')]){_0x41f4fd['Content-Disposition']=_0xa6e7('0x4d')+_0x2719f0['msg_id']+_0xa6e7('0x4e');}_0x5b820b[_0xa6e7('0x4f')](_0x41f4fd);return _0x5b820b['send'](new Buffer(_0x2719f0[_0xa6e7('0x47')]));}})[_0xa6e7('0x43')](handleError(_0x5b820b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index bb427c7..14b67fb 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 _0xe877=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util'];(function(_0x35209f,_0xa03777){var _0x2f32be=function(_0x1bf183){while(--_0x1bf183){_0x35209f['push'](_0x35209f['shift']());}};_0x2f32be(++_0xa03777);}(_0xe877,0x16b));var _0x7e87=function(_0x5bf742,_0x340f3a){_0x5bf742=_0x5bf742-0x0;var _0x161d3a=_0xe877[_0x5bf742];return _0x161d3a;};'use strict';var _=require('lodash');var util=require(_0x7e87('0x0'));var logger=require(_0x7e87('0x1'))(_0x7e87('0x2'));var moment=require(_0x7e87('0x3'));var BPromise=require(_0x7e87('0x4'));var rp=require(_0x7e87('0x5'));var fs=require('fs');var path=require(_0x7e87('0x6'));var rimraf=require('rimraf');var config=require(_0x7e87('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x7e87('0x8')]=function(_0x42869b,_0x5da31e){return _0x42869b[_0x7e87('0x9')](_0x7e87('0xa'),attributes,{'tableName':_0x7e87('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x7e87('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9981=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment'];(function(_0x1834e0,_0x30ddba){var _0x52c0ee=function(_0x46a167){while(--_0x46a167){_0x1834e0['push'](_0x1834e0['shift']());}};_0x52c0ee(++_0x30ddba);}(_0x9981,0xbf));var _0x1998=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x9981[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0x1998('0x0'));var util=require(_0x1998('0x1'));var logger=require(_0x1998('0x2'))(_0x1998('0x3'));var moment=require(_0x1998('0x4'));var BPromise=require(_0x1998('0x5'));var rp=require(_0x1998('0x6'));var fs=require('fs');var path=require(_0x1998('0x7'));var rimraf=require(_0x1998('0x8'));var config=require(_0x1998('0x9'));var attributes=require(_0x1998('0xa'));module[_0x1998('0xb')]=function(_0x13eec1,_0x2f87c5){return _0x13eec1['define']('VoiceMailMessage',attributes,{'tableName':_0x1998('0xc'),'paranoid':![],'indexes':[{'name':_0x1998('0xd'),'fields':[_0x1998('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 25adeb9..3f15e0f 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 _0x5ad5=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1073bc,_0x145656){var _0x2f27a9=function(_0x19bcae){while(--_0x19bcae){_0x1073bc['push'](_0x1073bc['shift']());}};_0x2f27a9(++_0x145656);}(_0x5ad5,0x107));var _0x55ad=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5ad5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x55ad('0x0'));var util=require(_0x55ad('0x1'));var moment=require(_0x55ad('0x2'));var BPromise=require(_0x55ad('0x3'));var rs=require(_0x55ad('0x4'));var fs=require('fs');var Redis=require(_0x55ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x55ad('0x6'));var config=require(_0x55ad('0x7'));var jayson=require(_0x55ad('0x8'));var client=jayson[_0x55ad('0x9')][_0x55ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x183b66,_0x565eac,_0x3031fe){return new BPromise(function(_0x3f9561,_0x2bfa0d){return client[_0x55ad('0xb')](_0x183b66,_0x3031fe)['then'](function(_0x499ef6){logger[_0x55ad('0xc')](_0x55ad('0xd'),_0x565eac,_0x55ad('0xe'));logger[_0x55ad('0xf')](_0x55ad('0x10'),_0x565eac,_0x55ad('0xe'),JSON[_0x55ad('0x11')](_0x499ef6));if(_0x499ef6[_0x55ad('0x12')]){if(_0x499ef6[_0x55ad('0x12')][_0x55ad('0x13')]===0x1f4){logger['error'](_0x55ad('0xd'),_0x565eac,_0x499ef6[_0x55ad('0x12')]['message']);return _0x2bfa0d(_0x499ef6[_0x55ad('0x12')]['message']);}logger[_0x55ad('0x12')](_0x55ad('0xd'),_0x565eac,_0x499ef6[_0x55ad('0x12')][_0x55ad('0x14')]);return _0x3f9561(_0x499ef6[_0x55ad('0x12')]['message']);}else{logger[_0x55ad('0xc')](_0x55ad('0xd'),_0x565eac,_0x55ad('0xe'));_0x3f9561(_0x499ef6[_0x55ad('0x15')][_0x55ad('0x14')]);}})[_0x55ad('0x16')](function(_0x463609){logger[_0x55ad('0x12')](_0x55ad('0xd'),_0x565eac,_0x463609);_0x2bfa0d(_0x463609);});});} \ No newline at end of file +var _0x4b0f=['rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ea9bb,_0x41a73f){var _0x3f0084=function(_0x599ab7){while(--_0x599ab7){_0x2ea9bb['push'](_0x2ea9bb['shift']());}};_0x3f0084(++_0x41a73f);}(_0x4b0f,0x176));var _0xf4b0=function(_0x4c8992,_0x20a7f2){_0x4c8992=_0x4c8992-0x0;var _0x2f2e5d=_0x4b0f[_0x4c8992];return _0x2f2e5d;};'use strict';var _=require(_0xf4b0('0x0'));var util=require(_0xf4b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf4b0('0x2'));var fs=require('fs');var Redis=require(_0xf4b0('0x3'));var db=require(_0xf4b0('0x4'))['db'];var utils=require(_0xf4b0('0x5'));var logger=require('../../config/logger')(_0xf4b0('0x6'));var config=require(_0xf4b0('0x7'));var jayson=require(_0xf4b0('0x8'));var client=jayson[_0xf4b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338816,_0x3a2515,_0x42ab6c){return new BPromise(function(_0x11f773,_0x2126fb){return client['request'](_0x338816,_0x42ab6c)[_0xf4b0('0xa')](function(_0x1d0cb6){logger[_0xf4b0('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x3a2515,_0xf4b0('0xc'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3a2515,_0xf4b0('0xc'),JSON[_0xf4b0('0xd')](_0x1d0cb6));if(_0x1d0cb6[_0xf4b0('0xe')]){if(_0x1d0cb6[_0xf4b0('0xe')][_0xf4b0('0xf')]===0x1f4){logger[_0xf4b0('0xe')](_0xf4b0('0x10'),_0x3a2515,_0x1d0cb6['error'][_0xf4b0('0x11')]);return _0x2126fb(_0x1d0cb6[_0xf4b0('0xe')][_0xf4b0('0x11')]);}logger[_0xf4b0('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x3a2515,_0x1d0cb6[_0xf4b0('0xe')]['message']);return _0x11f773(_0x1d0cb6[_0xf4b0('0xe')][_0xf4b0('0x11')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x3a2515,_0xf4b0('0xc'));_0x11f773(_0x1d0cb6[_0xf4b0('0x12')][_0xf4b0('0x11')]);}})[_0xf4b0('0x13')](function(_0x2338dc){logger['error'](_0xf4b0('0x10'),_0x3a2515,_0x2338dc);_0x2126fb(_0x2338dc);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9dbc8d0..4044c09 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 _0xd34a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0xd34a,0xcc));var _0xad34=function(_0x57a79a,_0x54bdf9){_0x57a79a=_0x57a79a-0x0;var _0x47f63e=_0xd34a[_0x57a79a];return _0x47f63e;};'use strict';var multer=require(_0xad34('0x0'));var util=require(_0xad34('0x1'));var path=require(_0xad34('0x2'));var timeout=require(_0xad34('0x3'));var express=require(_0xad34('0x4'));var router=express[_0xad34('0x5')]();var fs_extra=require(_0xad34('0x6'));var auth=require(_0xad34('0x7'));var interaction=require(_0xad34('0x8'));var config=require(_0xad34('0x9'));var controller=require(_0xad34('0xa'));router['get']('/',auth[_0xad34('0xb')](),controller['index']);router[_0xad34('0xc')](_0xad34('0xd'),auth['isAuthenticated'](),controller[_0xad34('0xe')]);router[_0xad34('0xc')](_0xad34('0xf'),auth['isAuthenticated'](),controller[_0xad34('0x10')]);router[_0xad34('0x11')]('/',auth[_0xad34('0xb')](),controller[_0xad34('0x12')]);router[_0xad34('0x11')](_0xad34('0xf'),auth[_0xad34('0xb')](),controller[_0xad34('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xad34('0x14')]);router[_0xad34('0x15')](_0xad34('0xd'),auth[_0xad34('0xb')](),controller[_0xad34('0x16')]);router[_0xad34('0x15')](_0xad34('0x17'),auth[_0xad34('0xb')](),controller[_0xad34('0x18')]);module[_0xad34('0x19')]=router; \ No newline at end of file +var _0x7f43=['get','/:id','isAuthenticated','/:id/sounds','getSounds','post','create','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x7f43,0xff));var _0x37f4=function(_0x3aa720,_0x1eeee3){_0x3aa720=_0x3aa720-0x0;var _0x16049e=_0x7f43[_0x3aa720];return _0x16049e;};'use strict';var multer=require('multer');var util=require(_0x37f4('0x0'));var path=require(_0x37f4('0x1'));var timeout=require(_0x37f4('0x2'));var express=require('express');var router=express[_0x37f4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x37f4('0x4'));var interaction=require(_0x37f4('0x5'));var config=require(_0x37f4('0x6'));var controller=require(_0x37f4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x37f4('0x8')]);router[_0x37f4('0x9')](_0x37f4('0xa'),auth[_0x37f4('0xb')](),controller['show']);router[_0x37f4('0x9')](_0x37f4('0xc'),auth[_0x37f4('0xb')](),controller[_0x37f4('0xd')]);router[_0x37f4('0xe')]('/',auth[_0x37f4('0xb')](),controller[_0x37f4('0xf')]);router['post']('/:id/sounds',auth[_0x37f4('0xb')](),controller['addSound']);router[_0x37f4('0x10')](_0x37f4('0xa'),auth[_0x37f4('0xb')](),controller['update']);router['delete'](_0x37f4('0xa'),auth[_0x37f4('0xb')](),controller[_0x37f4('0x11')]);router[_0x37f4('0x12')](_0x37f4('0x13'),auth[_0x37f4('0xb')](),controller[_0x37f4('0x14')]);module[_0x37f4('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8c279bc..4dfa566 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 _0x7126=['STRING','name','ENUM','custom','quietmp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x2d1850,_0x4f9e1a){var _0x3ce0d9=function(_0x40aaa9){while(--_0x40aaa9){_0x2d1850['push'](_0x2d1850['shift']());}};_0x3ce0d9(++_0x4f9e1a);}(_0x7126,0xa6));var _0x6712=function(_0x8e4015,_0x1d4e1d){_0x8e4015=_0x8e4015-0x0;var _0x410814=_0x7126[_0x8e4015];return _0x410814;};'use strict';var Sequelize=require(_0x6712('0x0'));module[_0x6712('0x1')]={'name':{'type':Sequelize[_0x6712('0x2')],'allowNull':![],'unique':_0x6712('0x3')},'mode':{'type':Sequelize[_0x6712('0x4')](_0x6712('0x5'),'files','mp3nb',_0x6712('0x6'),_0x6712('0x7'),_0x6712('0x8')),'allowNull':!![],'defaultValue':_0x6712('0x9')},'directory':{'type':Sequelize[_0x6712('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x6712('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x6712('0x2')],'allowNull':!![]},'stamp':{'type':_0x6712('0xa')},'defaultEntry':{'type':Sequelize[_0x6712('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4db1=['STRING','name','ENUM','mp3nb','quietmp3nb','mp3','files','alpha','TIMESTAMP','exports'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x4db1,0x1ad));var _0x14db=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x4db1[_0x5ed54b];return _0x4b58c7;};'use strict';var Sequelize=require('sequelize');module[_0x14db('0x0')]={'name':{'type':Sequelize[_0x14db('0x1')],'allowNull':![],'unique':_0x14db('0x2')},'mode':{'type':Sequelize[_0x14db('0x3')]('custom','files',_0x14db('0x4'),_0x14db('0x5'),'quietmp3',_0x14db('0x6')),'allowNull':!![],'defaultValue':_0x14db('0x7')},'directory':{'type':Sequelize[_0x14db('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x14db('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x14db('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x14db('0x1')],'allowNull':!![],'defaultValue':_0x14db('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x14db('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 98bf54e..5c24a82 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 _0x81de=['unlinkSync','getSounds','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','show','params','find','body','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','user','UserProfileSection','userProfileId','UserProfileResource','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','removeSound','id2'];(function(_0x425d7c,_0x5a4c75){var _0x80c16d=function(_0x231005){while(--_0x231005){_0x425d7c['push'](_0x425d7c['shift']());}};_0x80c16d(++_0x5a4c75);}(_0x81de,0x6c));var _0xe81d=function(_0x4a501a,_0x25fc65){_0x4a501a=_0x4a501a-0x0;var _0x20579c=_0x81de[_0x4a501a];return _0x20579c;};'use strict';var emlformat=require(_0xe81d('0x0'));var rimraf=require(_0xe81d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe81d('0x2'));var rp=require('request-promise');var moment=require(_0xe81d('0x3'));var BPromise=require(_0xe81d('0x4'));var Mustache=require(_0xe81d('0x5'));var util=require('util');var path=require(_0xe81d('0x6'));var sox=require(_0xe81d('0x7'));var csv=require(_0xe81d('0x8'));var ejs=require(_0xe81d('0x9'));var fs=require('fs');var fs_extra=require(_0xe81d('0xa'));var _=require(_0xe81d('0xb'));var squel=require(_0xe81d('0xc'));var crypto=require(_0xe81d('0xd'));var jsforce=require(_0xe81d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe81d('0x8'));var querystring=require(_0xe81d('0xf'));var Papa=require('papaparse');var Redis=require(_0xe81d('0x10'));var authService=require(_0xe81d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe81d('0x12'));var logger=require(_0xe81d('0x13'))(_0xe81d('0x14'));var utils=require(_0xe81d('0x15'));var config=require(_0xe81d('0x16'));var licenseUtil=require(_0xe81d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245590,_0xc9ea){_0xc9ea=_0xc9ea||0xcc;return function(_0x37eccc){if(_0x37eccc){return _0x245590['sendStatus'](_0xc9ea);}return _0x245590[_0xe81d('0x18')](_0xc9ea)[_0xe81d('0x19')]();};}function respondWithResult(_0x274588,_0x230c9b){_0x230c9b=_0x230c9b||0xc8;return function(_0x2ddf53){if(_0x2ddf53){return _0x274588['status'](_0x230c9b)['json'](_0x2ddf53);}};}function respondWithFilteredResult(_0x4d0e9a,_0x37a74c){return function(_0x367c81){if(_0x367c81){var _0x8192b9=typeof _0x37a74c[_0xe81d('0x1a')]===_0xe81d('0x1b')&&typeof _0x37a74c[_0xe81d('0x1c')]===_0xe81d('0x1b');var _0x58e6f4=_0x367c81[_0xe81d('0x1d')];var _0xc723b8=_0x8192b9?0x0:_0x37a74c[_0xe81d('0x1a')];var _0x386517=_0x8192b9?_0x367c81[_0xe81d('0x1d')]:_0x37a74c[_0xe81d('0x1a')]+_0x37a74c[_0xe81d('0x1c')];var _0x356237;if(_0x386517>=_0x58e6f4){_0x386517=_0x58e6f4;_0x356237=0xc8;}else{_0x356237=0xce;}_0x4d0e9a[_0xe81d('0x18')](_0x356237);return _0x4d0e9a[_0xe81d('0x1e')]('Content-Range',_0xc723b8+'-'+_0x386517+'/'+_0x58e6f4)[_0xe81d('0x1f')](_0x367c81);}return null;};}function patchUpdates(_0x556009){return function(_0x52a84c){try{jsonpatch['apply'](_0x52a84c,_0x556009,!![]);}catch(_0x336fab){return BPromise['reject'](_0x336fab);}return _0x52a84c[_0xe81d('0x20')]();};}function saveUpdates(_0x4c7633,_0x8747fd){return function(_0x2ee41c){if(_0x2ee41c){return _0x2ee41c[_0xe81d('0x21')](_0x4c7633)[_0xe81d('0x22')](function(_0x420c46){return _0x420c46;});}return null;};}function removeEntity(_0x54a75d,_0x337b19){return function(_0x1497c1){if(_0x1497c1){return _0x1497c1[_0xe81d('0x23')]()[_0xe81d('0x22')](function(){var _0x183d07=_0x1497c1[_0xe81d('0x24')]({'plain':!![]});var _0x82c010=_0xe81d('0x25');return db['UserProfileResource'][_0xe81d('0x23')]({'where':{'type':_0x82c010,'resourceId':_0x183d07['id']}})[_0xe81d('0x22')](function(){return _0x1497c1;});})['then'](function(){_0x54a75d[_0xe81d('0x18')](0xcc)[_0xe81d('0x19')]();});}};}function handleEntityNotFound(_0x3aa0d1,_0x261c18){return function(_0x104b5c){if(!_0x104b5c){_0x3aa0d1[_0xe81d('0x26')](0x194);}return _0x104b5c;};}function handleError(_0x51c30e,_0x2afee6){_0x2afee6=_0x2afee6||0x1f4;return function(_0x524395){logger[_0xe81d('0x27')](_0x524395['stack']);if(_0x524395[_0xe81d('0x28')]){delete _0x524395['name'];}_0x51c30e[_0xe81d('0x18')](_0x2afee6)[_0xe81d('0x29')](_0x524395);};}exports['index']=function(_0x31fadd,_0x2c506b){var _0x35c640={},_0x39b9c9={},_0x43066a={'count':0x0,'rows':[]};var _0xb3ed0b=_[_0xe81d('0x2a')](db['VoiceMusicOnHold'][_0xe81d('0x2b')],function(_0x20ce3b){return{'name':_0x20ce3b['fieldName'],'type':_0x20ce3b[_0xe81d('0x2c')][_0xe81d('0x2d')]};});_0x39b9c9[_0xe81d('0x2e')]=_[_0xe81d('0x2a')](_0xb3ed0b,_0xe81d('0x28'));_0x39b9c9['query']=_[_0xe81d('0x2f')](_0x31fadd[_0xe81d('0x30')]);_0x39b9c9[_0xe81d('0x31')]=_[_0xe81d('0x32')](_0x39b9c9['model'],_0x39b9c9[_0xe81d('0x30')]);_0x35c640[_0xe81d('0x33')]=_['intersection'](_0x39b9c9[_0xe81d('0x2e')],qs[_0xe81d('0x34')](_0x31fadd[_0xe81d('0x30')]['fields']));_0x35c640[_0xe81d('0x33')]=_0x35c640['attributes'][_0xe81d('0x35')]?_0x35c640[_0xe81d('0x33')]:_0x39b9c9[_0xe81d('0x2e')];if(!_0x31fadd[_0xe81d('0x30')][_0xe81d('0x36')](_0xe81d('0x37'))){_0x35c640['limit']=qs[_0xe81d('0x1c')](_0x31fadd[_0xe81d('0x30')]['limit']);_0x35c640[_0xe81d('0x1a')]=qs['offset'](_0x31fadd[_0xe81d('0x30')][_0xe81d('0x1a')]);}_0x35c640[_0xe81d('0x38')]=qs[_0xe81d('0x39')](_0x31fadd['query'][_0xe81d('0x39')]);delete _0x31fadd['query'][_0xe81d('0x39')];_0x35c640['where']=qs[_0xe81d('0x31')](_[_0xe81d('0x3a')](_0x31fadd[_0xe81d('0x30')],_0x39b9c9[_0xe81d('0x31')]),_0xb3ed0b);if(_0x31fadd[_0xe81d('0x30')][_0xe81d('0x3b')]){_0x35c640[_0xe81d('0x3c')]=_[_0xe81d('0x3d')](_0x35c640[_0xe81d('0x3c')],{'$or':_[_0xe81d('0x2a')](_0xb3ed0b,function(_0x5b623b){if(_0x5b623b['type']!=='VIRTUAL'){var _0x48e2c0={};_0x48e2c0[_0x5b623b[_0xe81d('0x28')]]={'$like':'%'+_0x31fadd[_0xe81d('0x30')][_0xe81d('0x3b')]+'%'};return _0x48e2c0;}})});}_0x35c640=_[_0xe81d('0x3d')]({},_0x35c640,_0x31fadd[_0xe81d('0x3e')]);var _0x1a6a4b={'where':_0x35c640[_0xe81d('0x3c')]};return db[_0xe81d('0x3f')][_0xe81d('0x1d')](_0x1a6a4b)['then'](function(_0x240d8d){_0x43066a['count']=_0x240d8d;if(_0x31fadd[_0xe81d('0x30')][_0xe81d('0x40')]){_0x35c640[_0xe81d('0x41')]=[{'all':!![]}];}return db[_0xe81d('0x3f')][_0xe81d('0x42')](_0x35c640);})[_0xe81d('0x22')](function(_0x4fd751){_0x43066a[_0xe81d('0x43')]=_0x4fd751;return _0x43066a;})[_0xe81d('0x22')](respondWithFilteredResult(_0x2c506b,_0x35c640))[_0xe81d('0x44')](handleError(_0x2c506b,null));};exports[_0xe81d('0x45')]=function(_0xccbe7a,_0x358295){var _0xc9523={'raw':![],'where':{'id':_0xccbe7a[_0xe81d('0x46')]['id']}},_0x2089f6={};_0x2089f6[_0xe81d('0x2e')]=_[_0xe81d('0x2f')](db[_0xe81d('0x3f')]['rawAttributes']);_0x2089f6[_0xe81d('0x30')]=_[_0xe81d('0x2f')](_0xccbe7a[_0xe81d('0x30')]);_0x2089f6['filters']=_['intersection'](_0x2089f6['model'],_0x2089f6['query']);_0xc9523[_0xe81d('0x33')]=_['intersection'](_0x2089f6[_0xe81d('0x2e')],qs[_0xe81d('0x34')](_0xccbe7a[_0xe81d('0x30')][_0xe81d('0x34')]));_0xc9523[_0xe81d('0x33')]=_0xc9523[_0xe81d('0x33')]['length']?_0xc9523['attributes']:_0x2089f6[_0xe81d('0x2e')];if(_0xccbe7a[_0xe81d('0x30')][_0xe81d('0x40')]){_0xc9523[_0xe81d('0x41')]=[{'all':!![]}];}_0xc9523=_[_0xe81d('0x3d')]({},_0xc9523,_0xccbe7a[_0xe81d('0x3e')]);return db['VoiceMusicOnHold'][_0xe81d('0x47')](_0xc9523)[_0xe81d('0x22')](handleEntityNotFound(_0x358295,null))[_0xe81d('0x22')](respondWithResult(_0x358295,null))[_0xe81d('0x44')](handleError(_0x358295,null));};exports[_0xe81d('0x21')]=function(_0x3b952f,_0x38c992){if(_0x3b952f[_0xe81d('0x48')]['id']){delete _0x3b952f[_0xe81d('0x48')]['id'];}return db[_0xe81d('0x3f')]['find']({'where':{'id':_0x3b952f['params']['id']}})['then'](handleEntityNotFound(_0x38c992,null))[_0xe81d('0x22')](saveUpdates(_0x3b952f[_0xe81d('0x48')],null))[_0xe81d('0x22')](respondWithResult(_0x38c992,null))[_0xe81d('0x44')](handleError(_0x38c992,null));};exports['create']=function(_0x593036,_0x1e64ab,_0x41a330){return db['sequelize'][_0xe81d('0x49')](function(_0x98cf22){if(_0x593036[_0xe81d('0x48')][_0xe81d('0x4a')]===_0xe81d('0x4b')){_0x593036[_0xe81d('0x48')][_0xe81d('0x4c')]=path[_0xe81d('0x4d')](config[_0xe81d('0x4e')],_0xe81d('0x4f'),_0x593036[_0xe81d('0x48')][_0xe81d('0x28')]);}return db[_0xe81d('0x3f')][_0xe81d('0x50')](_0x593036[_0xe81d('0x48')],{'transaction':_0x98cf22})[_0xe81d('0x22')](function(_0x4ed6e2){if(_0x593036[_0xe81d('0x48')][_0xe81d('0x4a')]==='files'){fs[_0xe81d('0x51')](_0x4ed6e2[_0xe81d('0x4c')],parseInt('0777',0x8));}var _0x592779=_0x593036[_0xe81d('0x52')][_0xe81d('0x24')]({'plain':!![]});if(!_0x592779)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x592779['role']===_0xe81d('0x52')){var _0x417cdc=_0x4ed6e2[_0xe81d('0x24')]({'plain':!![]});return db[_0xe81d('0x53')][_0xe81d('0x47')]({'where':{'name':_0xe81d('0x25'),'userProfileId':_0x592779[_0xe81d('0x54')]},'raw':!![]})['then'](function(_0x321853){if(_0x321853&&_0x321853['autoAssociation']===0x0){return db[_0xe81d('0x55')][_0xe81d('0x50')]({'name':_0x417cdc[_0xe81d('0x28')],'resourceId':_0x417cdc['id'],'type':_0x321853[_0xe81d('0x28')],'sectionId':_0x321853['id']},{})[_0xe81d('0x22')](function(){return _0x4ed6e2;});}else{return _0x4ed6e2;}})[_0xe81d('0x44')](function(_0x572278){logger[_0xe81d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572278);});}return _0x4ed6e2;});})[_0xe81d('0x22')](respondWithResult(_0x1e64ab,0xc9))[_0xe81d('0x44')](handleError(_0x1e64ab,null));};exports[_0xe81d('0x23')]=function(_0x4c2de6,_0x452bcc,_0x14410b){var _0xdfb65f;return db[_0xe81d('0x3f')][_0xe81d('0x47')]({'where':{'id':_0x4c2de6[_0xe81d('0x46')]['id']}})['then'](function(_0x24a058){if(_0x24a058){return db['sequelize']['transaction'](function(_0x309af7){return _0x24a058[_0xe81d('0x23')]({'transaction':_0x309af7,'raw':!![]})['then'](function(_0xe662e6){if(_0xe662e6[_0xe81d('0x4c')]){fs[_0xe81d('0x56')](_0xe662e6[_0xe81d('0x4c')])[_0xe81d('0x57')](function(_0x55baa1){fs['unlinkSync'](path[_0xe81d('0x4d')](_0xe662e6['directory'],_0x55baa1));});fs[_0xe81d('0x58')](_0xe662e6[_0xe81d('0x4c')]);}return _0xe662e6;});})[_0xe81d('0x44')](function(_0x1dec39){throw new db[(_0xe81d('0x59'))][(_0xe81d('0x5a'))](_0x1dec39[_0xe81d('0x5b')]);});}})[_0xe81d('0x22')](handleEntityNotFound(_0x452bcc,null))[_0xe81d('0x22')](removeEntity(_0x452bcc,null))[_0xe81d('0x44')](handleError(_0x452bcc,null));};exports[_0xe81d('0x5c')]=function(_0x1722c1,_0x42e069,_0x24f1bc){return db[_0xe81d('0x5d')][_0xe81d('0x49')](function(_0xbca368){var _0xa35566;return db[_0xe81d('0x3f')][_0xe81d('0x47')]({'where':{'id':_0x1722c1['params']['id']}})['then'](function(_0x426e4a){if(_0x426e4a){_0xa35566=_0x426e4a;return _0x426e4a[_0xe81d('0x5c')](_0x1722c1['body']['id'],{'transaction':_0xbca368});}})[_0xe81d('0x22')](function(_0x526748){if(_0x526748){return db[_0xe81d('0x5e')][_0xe81d('0x5f')]({'where':{'id':_0x1722c1[_0xe81d('0x48')]['id']},'attributes':['id',_0xe81d('0x28'),_0xe81d('0x60'),_0xe81d('0x61'),_0xe81d('0x62')],'raw':!![]});}})[_0xe81d('0x22')](function(_0xf2d1ec){if(_0xf2d1ec){var _0x3039e0=path[_0xe81d('0x4d')](config[_0xe81d('0x4e')],_0xe81d('0x63'),util[_0xe81d('0x64')](_0xe81d('0x65'),path['basename'](_0xf2d1ec[_0xe81d('0x60')],path['extname'](_0xf2d1ec[_0xe81d('0x60')])),_0xf2d1ec['converted_format']));var _0xe20efc=path['join'](config[_0xe81d('0x4e')],'server/files/moh',_0xa35566[_0xe81d('0x28')],util[_0xe81d('0x64')](_0xe81d('0x65'),_0xf2d1ec[_0xe81d('0x28')],_0xf2d1ec[_0xe81d('0x61')]));fs['symlinkSync'](_0x3039e0,_0xe20efc);return _0xf2d1ec;}})[_0xe81d('0x44')](function(_0x1dcb8e){throw new db[(_0xe81d('0x59'))][(_0xe81d('0x5a'))](_0x1dcb8e[_0xe81d('0x5b')]);});})['then'](handleEntityNotFound(_0x42e069,null))[_0xe81d('0x22')](respondWithResult(_0x42e069,0xc9))['catch'](handleError(_0x42e069,null));};exports[_0xe81d('0x66')]=function(_0x4e2c98,_0x339fad,_0x585069){return db[_0xe81d('0x5d')][_0xe81d('0x49')](function(_0x21d943){var _0x1435ee;return db[_0xe81d('0x3f')][_0xe81d('0x5f')]({'where':{'id':_0x4e2c98[_0xe81d('0x46')]['id']}})[_0xe81d('0x22')](handleEntityNotFound(_0x339fad,null))[_0xe81d('0x22')](function(_0x475245){if(_0x475245){_0x1435ee=_0x475245;return _0x475245[_0xe81d('0x66')](_0x4e2c98['params'][_0xe81d('0x67')]);}})['then'](function(_0x36057f){if(_0x36057f){return db[_0xe81d('0x5e')][_0xe81d('0x5f')]({'where':{'id':_0x4e2c98['params']['id2']},'attributes':['id',_0xe81d('0x28'),_0xe81d('0x60'),_0xe81d('0x61'),'createdAt'],'raw':!![]});}})[_0xe81d('0x22')](function(_0x3269d0){if(_0x3269d0){fs[_0xe81d('0x68')](path[_0xe81d('0x4d')](_0x1435ee[_0xe81d('0x4c')],util['format'](_0xe81d('0x65'),_0x3269d0['name'],_0x3269d0[_0xe81d('0x61')])));return _0x3269d0;}})['catch'](function(_0x465651){throw new db['Sequelize'][(_0xe81d('0x5a'))](_0x465651[_0xe81d('0x5b')]);});})[_0xe81d('0x22')](handleEntityNotFound(_0x339fad,null))[_0xe81d('0x22')](respondWithStatusCode(_0x339fad,0xcc))[_0xe81d('0x44')](handleError(_0x339fad,null));};exports[_0xe81d('0x69')]=function(_0x284e2a,_0x3479a1,_0x428624){var _0x22fc9b={};var _0x1711c8={};var _0x331fed;var _0x4af15b;return db[_0xe81d('0x3f')][_0xe81d('0x5f')]({'where':{'id':_0x284e2a[_0xe81d('0x46')]['id']}})[_0xe81d('0x22')](handleEntityNotFound(_0x3479a1,null))['then'](function(_0x1c481f){if(_0x1c481f){_0x331fed=_0x1c481f;_0x1711c8[_0xe81d('0x2e')]=_[_0xe81d('0x2f')](db[_0xe81d('0x5e')][_0xe81d('0x2b')]);_0x1711c8[_0xe81d('0x30')]=_[_0xe81d('0x2f')](_0x284e2a['query']);_0x1711c8['filters']=_['intersection'](_0x1711c8[_0xe81d('0x2e')],_0x1711c8[_0xe81d('0x30')]);_0x22fc9b['attributes']=_[_0xe81d('0x32')](_0x1711c8[_0xe81d('0x2e')],qs[_0xe81d('0x34')](_0x284e2a['query'][_0xe81d('0x34')]));_0x22fc9b[_0xe81d('0x33')]=_0x22fc9b['attributes'][_0xe81d('0x35')]?_0x22fc9b['attributes']:_0x1711c8[_0xe81d('0x2e')];_0x22fc9b[_0xe81d('0x38')]=qs[_0xe81d('0x39')](_0x284e2a['query'][_0xe81d('0x39')]);_0x22fc9b[_0xe81d('0x3c')]=qs['filters'](_['pick'](_0x284e2a[_0xe81d('0x30')],_0x1711c8[_0xe81d('0x31')]));if(_0x284e2a[_0xe81d('0x30')][_0xe81d('0x3b')]){_0x22fc9b['where']=_[_0xe81d('0x3d')](_0x22fc9b[_0xe81d('0x3c')],{'$or':_[_0xe81d('0x2a')](_0x22fc9b[_0xe81d('0x33')],function(_0x334c29){var _0x1b6434={};_0x1b6434[_0x334c29]={'$like':'%'+_0x284e2a['query'][_0xe81d('0x3b')]+'%'};return _0x1b6434;})});}_0x22fc9b=_[_0xe81d('0x3d')]({},_0x22fc9b,_0x284e2a['options']);return _0x331fed[_0xe81d('0x69')](_0x22fc9b);}})[_0xe81d('0x22')](function(_0xcdb6f1){if(_0xcdb6f1){_0x4af15b=_0xcdb6f1[_0xe81d('0x35')];if(!_0x284e2a[_0xe81d('0x30')][_0xe81d('0x36')](_0xe81d('0x37'))){_0x22fc9b[_0xe81d('0x1c')]=qs[_0xe81d('0x1c')](_0x284e2a[_0xe81d('0x30')][_0xe81d('0x1c')]);_0x22fc9b[_0xe81d('0x1a')]=qs[_0xe81d('0x1a')](_0x284e2a[_0xe81d('0x30')]['offset']);}return _0x331fed['getSounds'](_0x22fc9b);}})['then'](function(_0x519aa2){if(_0x519aa2){return _0x519aa2?{'count':_0x4af15b,'rows':_0x519aa2}:null;}})[_0xe81d('0x22')](respondWithResult(_0x3479a1,null))[_0xe81d('0x44')](handleError(_0x3479a1,null));}; \ No newline at end of file +var _0xcc79=['removeSound','id2','format','getSounds','pick','options','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','VoiceMusicOnHold','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','includeAll','rows','catch','params','include','find','body','create','sequelize','transaction','files','join','root','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','basename','extname','server/files/moh','%s.%s','symlinkSync','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcc79,0xed));var _0x9cc7=function(_0x214156,_0x50a451){_0x214156=_0x214156-0x0;var _0x15dd0a=_0xcc79[_0x214156];return _0x15dd0a;};'use strict';var emlformat=require(_0x9cc7('0x0'));var rimraf=require(_0x9cc7('0x1'));var zipdir=require(_0x9cc7('0x2'));var jsonpatch=require(_0x9cc7('0x3'));var rp=require(_0x9cc7('0x4'));var moment=require(_0x9cc7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cc7('0x6'));var util=require(_0x9cc7('0x7'));var path=require(_0x9cc7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9cc7('0x9'));var fs=require('fs');var fs_extra=require(_0x9cc7('0xa'));var _=require(_0x9cc7('0xb'));var squel=require(_0x9cc7('0xc'));var crypto=require(_0x9cc7('0xd'));var jsforce=require(_0x9cc7('0xe'));var deskjs=require(_0x9cc7('0xf'));var toCsv=require(_0x9cc7('0x10'));var querystring=require(_0x9cc7('0x11'));var Papa=require(_0x9cc7('0x12'));var Redis=require(_0x9cc7('0x13'));var authService=require(_0x9cc7('0x14'));var qs=require(_0x9cc7('0x15'));var as=require(_0x9cc7('0x16'));var hardwareService=require(_0x9cc7('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x9cc7('0x18'));var config=require(_0x9cc7('0x19'));var licenseUtil=require(_0x9cc7('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d74ab,_0x5d1055){_0x5d1055=_0x5d1055||0xcc;return function(_0x5d1485){if(_0x5d1485){return _0x4d74ab['sendStatus'](_0x5d1055);}return _0x4d74ab[_0x9cc7('0x1b')](_0x5d1055)[_0x9cc7('0x1c')]();};}function respondWithResult(_0x5a172e,_0x5831a7){_0x5831a7=_0x5831a7||0xc8;return function(_0x35a2d3){if(_0x35a2d3){return _0x5a172e[_0x9cc7('0x1b')](_0x5831a7)['json'](_0x35a2d3);}};}function respondWithFilteredResult(_0x5863ad,_0xe8bba8){return function(_0x5f1e81){if(_0x5f1e81){var _0x1b735e=typeof _0xe8bba8[_0x9cc7('0x1d')]===_0x9cc7('0x1e')&&typeof _0xe8bba8[_0x9cc7('0x1f')]===_0x9cc7('0x1e');var _0x49967a=_0x5f1e81[_0x9cc7('0x20')];var _0x494e0f=_0x1b735e?0x0:_0xe8bba8['offset'];var _0x473d73=_0x1b735e?_0x5f1e81[_0x9cc7('0x20')]:_0xe8bba8[_0x9cc7('0x1d')]+_0xe8bba8[_0x9cc7('0x1f')];var _0x2a7974;if(_0x473d73>=_0x49967a){_0x473d73=_0x49967a;_0x2a7974=0xc8;}else{_0x2a7974=0xce;}_0x5863ad[_0x9cc7('0x1b')](_0x2a7974);return _0x5863ad[_0x9cc7('0x21')](_0x9cc7('0x22'),_0x494e0f+'-'+_0x473d73+'/'+_0x49967a)[_0x9cc7('0x23')](_0x5f1e81);}return null;};}function patchUpdates(_0x1d9d02){return function(_0x3cebd8){try{jsonpatch[_0x9cc7('0x24')](_0x3cebd8,_0x1d9d02,!![]);}catch(_0x5317e8){return BPromise['reject'](_0x5317e8);}return _0x3cebd8[_0x9cc7('0x25')]();};}function saveUpdates(_0x30a3b4,_0x464b57){return function(_0x21630c){if(_0x21630c){return _0x21630c[_0x9cc7('0x26')](_0x30a3b4)[_0x9cc7('0x27')](function(_0x3be5f0){return _0x3be5f0;});}return null;};}function removeEntity(_0x3612c8,_0x196652){return function(_0x1027e6){if(_0x1027e6){return _0x1027e6[_0x9cc7('0x28')]()['then'](function(){var _0x10fbb7=_0x1027e6[_0x9cc7('0x29')]({'plain':!![]});var _0x4479ab='MusicOnHolds';return db[_0x9cc7('0x2a')][_0x9cc7('0x28')]({'where':{'type':_0x4479ab,'resourceId':_0x10fbb7['id']}})[_0x9cc7('0x27')](function(){return _0x1027e6;});})[_0x9cc7('0x27')](function(){_0x3612c8[_0x9cc7('0x1b')](0xcc)[_0x9cc7('0x1c')]();});}};}function handleEntityNotFound(_0x48cbdb,_0x30a824){return function(_0x12b7b4){if(!_0x12b7b4){_0x48cbdb[_0x9cc7('0x2b')](0x194);}return _0x12b7b4;};}function handleError(_0x3f808b,_0xe0eace){_0xe0eace=_0xe0eace||0x1f4;return function(_0x5cf03b){logger[_0x9cc7('0x2c')](_0x5cf03b[_0x9cc7('0x2d')]);if(_0x5cf03b[_0x9cc7('0x2e')]){delete _0x5cf03b[_0x9cc7('0x2e')];}_0x3f808b[_0x9cc7('0x1b')](_0xe0eace)['send'](_0x5cf03b);};}exports[_0x9cc7('0x2f')]=function(_0x4122db,_0x10948d){var _0x2137c2={},_0x468bdd={},_0x76e0a0={'count':0x0,'rows':[]};var _0x1204fd=_['map'](db[_0x9cc7('0x30')]['rawAttributes'],function(_0x47ebe6){return{'name':_0x47ebe6['fieldName'],'type':_0x47ebe6[_0x9cc7('0x31')][_0x9cc7('0x32')]};});_0x468bdd[_0x9cc7('0x33')]=_['map'](_0x1204fd,_0x9cc7('0x2e'));_0x468bdd['query']=_[_0x9cc7('0x34')](_0x4122db[_0x9cc7('0x35')]);_0x468bdd[_0x9cc7('0x36')]=_[_0x9cc7('0x37')](_0x468bdd[_0x9cc7('0x33')],_0x468bdd[_0x9cc7('0x35')]);_0x2137c2['attributes']=_['intersection'](_0x468bdd['model'],qs['fields'](_0x4122db[_0x9cc7('0x35')][_0x9cc7('0x38')]));_0x2137c2[_0x9cc7('0x39')]=_0x2137c2[_0x9cc7('0x39')][_0x9cc7('0x3a')]?_0x2137c2[_0x9cc7('0x39')]:_0x468bdd['model'];if(!_0x4122db['query'][_0x9cc7('0x3b')]('nolimit')){_0x2137c2['limit']=qs[_0x9cc7('0x1f')](_0x4122db[_0x9cc7('0x35')][_0x9cc7('0x1f')]);_0x2137c2[_0x9cc7('0x1d')]=qs[_0x9cc7('0x1d')](_0x4122db[_0x9cc7('0x35')]['offset']);}_0x2137c2[_0x9cc7('0x3c')]=qs[_0x9cc7('0x3d')](_0x4122db[_0x9cc7('0x35')]['sort']);delete _0x4122db[_0x9cc7('0x35')][_0x9cc7('0x3d')];_0x2137c2[_0x9cc7('0x3e')]=qs[_0x9cc7('0x36')](_['pick'](_0x4122db['query'],_0x468bdd[_0x9cc7('0x36')]),_0x1204fd);if(_0x4122db[_0x9cc7('0x35')]['filter']){_0x2137c2['where']=_[_0x9cc7('0x3f')](_0x2137c2[_0x9cc7('0x3e')],{'$or':_[_0x9cc7('0x40')](_0x1204fd,function(_0x21020f){if(_0x21020f[_0x9cc7('0x31')]!==_0x9cc7('0x41')){var _0x400360={};_0x400360[_0x21020f[_0x9cc7('0x2e')]]={'$like':'%'+_0x4122db[_0x9cc7('0x35')][_0x9cc7('0x42')]+'%'};return _0x400360;}})});}_0x2137c2=_[_0x9cc7('0x3f')]({},_0x2137c2,_0x4122db['options']);var _0x5e3bf7={'where':_0x2137c2[_0x9cc7('0x3e')]};return db[_0x9cc7('0x30')][_0x9cc7('0x20')](_0x5e3bf7)['then'](function(_0xcc50c0){_0x76e0a0[_0x9cc7('0x20')]=_0xcc50c0;if(_0x4122db[_0x9cc7('0x35')][_0x9cc7('0x43')]){_0x2137c2['include']=[{'all':!![]}];}return db[_0x9cc7('0x30')]['findAll'](_0x2137c2);})[_0x9cc7('0x27')](function(_0x2c7283){_0x76e0a0[_0x9cc7('0x44')]=_0x2c7283;return _0x76e0a0;})[_0x9cc7('0x27')](respondWithFilteredResult(_0x10948d,_0x2137c2))[_0x9cc7('0x45')](handleError(_0x10948d,null));};exports['show']=function(_0x3b1ce3,_0x563871){var _0x5b7ae8={'raw':![],'where':{'id':_0x3b1ce3[_0x9cc7('0x46')]['id']}},_0x4b590e={};_0x4b590e[_0x9cc7('0x33')]=_[_0x9cc7('0x34')](db[_0x9cc7('0x30')]['rawAttributes']);_0x4b590e[_0x9cc7('0x35')]=_[_0x9cc7('0x34')](_0x3b1ce3[_0x9cc7('0x35')]);_0x4b590e[_0x9cc7('0x36')]=_[_0x9cc7('0x37')](_0x4b590e[_0x9cc7('0x33')],_0x4b590e['query']);_0x5b7ae8['attributes']=_[_0x9cc7('0x37')](_0x4b590e[_0x9cc7('0x33')],qs['fields'](_0x3b1ce3[_0x9cc7('0x35')][_0x9cc7('0x38')]));_0x5b7ae8['attributes']=_0x5b7ae8[_0x9cc7('0x39')][_0x9cc7('0x3a')]?_0x5b7ae8[_0x9cc7('0x39')]:_0x4b590e['model'];if(_0x3b1ce3['query']['includeAll']){_0x5b7ae8[_0x9cc7('0x47')]=[{'all':!![]}];}_0x5b7ae8=_['merge']({},_0x5b7ae8,_0x3b1ce3['options']);return db['VoiceMusicOnHold'][_0x9cc7('0x48')](_0x5b7ae8)[_0x9cc7('0x27')](handleEntityNotFound(_0x563871,null))['then'](respondWithResult(_0x563871,null))[_0x9cc7('0x45')](handleError(_0x563871,null));};exports[_0x9cc7('0x26')]=function(_0x119276,_0x4f6160){if(_0x119276['body']['id']){delete _0x119276[_0x9cc7('0x49')]['id'];}return db[_0x9cc7('0x30')][_0x9cc7('0x48')]({'where':{'id':_0x119276[_0x9cc7('0x46')]['id']}})[_0x9cc7('0x27')](handleEntityNotFound(_0x4f6160,null))[_0x9cc7('0x27')](saveUpdates(_0x119276[_0x9cc7('0x49')],null))[_0x9cc7('0x27')](respondWithResult(_0x4f6160,null))[_0x9cc7('0x45')](handleError(_0x4f6160,null));};exports[_0x9cc7('0x4a')]=function(_0xc23446,_0x85ba20,_0x53352c){return db[_0x9cc7('0x4b')][_0x9cc7('0x4c')](function(_0x26c655){if(_0xc23446[_0x9cc7('0x49')]['mode']===_0x9cc7('0x4d')){_0xc23446['body']['directory']=path[_0x9cc7('0x4e')](config[_0x9cc7('0x4f')],'server/files/moh',_0xc23446[_0x9cc7('0x49')]['name']);}return db['VoiceMusicOnHold'][_0x9cc7('0x4a')](_0xc23446[_0x9cc7('0x49')],{'transaction':_0x26c655})[_0x9cc7('0x27')](function(_0x1c59d2){if(_0xc23446[_0x9cc7('0x49')][_0x9cc7('0x50')]===_0x9cc7('0x4d')){fs[_0x9cc7('0x51')](_0x1c59d2['directory'],parseInt(_0x9cc7('0x52'),0x8));}var _0x311b3b=_0xc23446['user'][_0x9cc7('0x29')]({'plain':!![]});if(!_0x311b3b)throw new Error(_0x9cc7('0x53'));if(_0x311b3b[_0x9cc7('0x54')]===_0x9cc7('0x55')){var _0x1b0b97=_0x1c59d2['get']({'plain':!![]});return db[_0x9cc7('0x56')]['find']({'where':{'name':_0x9cc7('0x57'),'userProfileId':_0x311b3b[_0x9cc7('0x58')]},'raw':!![]})[_0x9cc7('0x27')](function(_0x33a175){if(_0x33a175&&_0x33a175['autoAssociation']===0x0){return db[_0x9cc7('0x2a')][_0x9cc7('0x4a')]({'name':_0x1b0b97['name'],'resourceId':_0x1b0b97['id'],'type':_0x33a175[_0x9cc7('0x2e')],'sectionId':_0x33a175['id']},{})[_0x9cc7('0x27')](function(){return _0x1c59d2;});}else{return _0x1c59d2;}})[_0x9cc7('0x45')](function(_0x1472e8){logger[_0x9cc7('0x2c')](_0x9cc7('0x59'),_0x1472e8);});}return _0x1c59d2;});})[_0x9cc7('0x27')](respondWithResult(_0x85ba20,0xc9))[_0x9cc7('0x45')](handleError(_0x85ba20,null));};exports[_0x9cc7('0x28')]=function(_0x107af4,_0x2479e1,_0x265edd){var _0x5b12ff;return db[_0x9cc7('0x30')][_0x9cc7('0x48')]({'where':{'id':_0x107af4[_0x9cc7('0x46')]['id']}})[_0x9cc7('0x27')](function(_0x1ddbbc){if(_0x1ddbbc){return db[_0x9cc7('0x4b')][_0x9cc7('0x4c')](function(_0x4eeb8c){return _0x1ddbbc[_0x9cc7('0x28')]({'transaction':_0x4eeb8c,'raw':!![]})['then'](function(_0x40c3c2){if(_0x40c3c2[_0x9cc7('0x5a')]){fs['readdirSync'](_0x40c3c2[_0x9cc7('0x5a')])[_0x9cc7('0x5b')](function(_0x267237){fs[_0x9cc7('0x5c')](path['join'](_0x40c3c2[_0x9cc7('0x5a')],_0x267237));});fs[_0x9cc7('0x5d')](_0x40c3c2[_0x9cc7('0x5a')]);}return _0x40c3c2;});})[_0x9cc7('0x45')](function(_0x281450){throw new db[(_0x9cc7('0x5e'))][(_0x9cc7('0x5f'))](_0x281450['message']);});}})[_0x9cc7('0x27')](handleEntityNotFound(_0x2479e1,null))[_0x9cc7('0x27')](removeEntity(_0x2479e1,null))[_0x9cc7('0x45')](handleError(_0x2479e1,null));};exports[_0x9cc7('0x60')]=function(_0x325fed,_0x534614,_0x5a73ae){return db['sequelize']['transaction'](function(_0x275634){var _0xe6f60d;return db[_0x9cc7('0x30')][_0x9cc7('0x48')]({'where':{'id':_0x325fed[_0x9cc7('0x46')]['id']}})[_0x9cc7('0x27')](function(_0x25e4a1){if(_0x25e4a1){_0xe6f60d=_0x25e4a1;return _0x25e4a1[_0x9cc7('0x60')](_0x325fed[_0x9cc7('0x49')]['id'],{'transaction':_0x275634});}})['then'](function(_0x174fee){if(_0x174fee){return db[_0x9cc7('0x61')][_0x9cc7('0x62')]({'where':{'id':_0x325fed[_0x9cc7('0x49')]['id']},'attributes':['id','name',_0x9cc7('0x63'),_0x9cc7('0x64'),_0x9cc7('0x65')],'raw':!![]});}})[_0x9cc7('0x27')](function(_0x13ba38){if(_0x13ba38){var _0x1f12dc=path[_0x9cc7('0x4e')](config[_0x9cc7('0x4f')],'server/files/sounds/converted',util['format']('%s.%s',path[_0x9cc7('0x66')](_0x13ba38[_0x9cc7('0x63')],path[_0x9cc7('0x67')](_0x13ba38['save_name'])),_0x13ba38[_0x9cc7('0x64')]));var _0x111a56=path[_0x9cc7('0x4e')](config[_0x9cc7('0x4f')],_0x9cc7('0x68'),_0xe6f60d[_0x9cc7('0x2e')],util['format'](_0x9cc7('0x69'),_0x13ba38['name'],_0x13ba38[_0x9cc7('0x64')]));fs[_0x9cc7('0x6a')](_0x1f12dc,_0x111a56);return _0x13ba38;}})[_0x9cc7('0x45')](function(_0x201fa6){throw new db['Sequelize'][(_0x9cc7('0x5f'))](_0x201fa6[_0x9cc7('0x6b')]);});})[_0x9cc7('0x27')](handleEntityNotFound(_0x534614,null))[_0x9cc7('0x27')](respondWithResult(_0x534614,0xc9))['catch'](handleError(_0x534614,null));};exports[_0x9cc7('0x6c')]=function(_0x4a2289,_0xce50fc,_0x2dcbca){return db[_0x9cc7('0x4b')][_0x9cc7('0x4c')](function(_0x985531){var _0x238d9d;return db['VoiceMusicOnHold'][_0x9cc7('0x62')]({'where':{'id':_0x4a2289['params']['id']}})[_0x9cc7('0x27')](handleEntityNotFound(_0xce50fc,null))['then'](function(_0x1e9b5c){if(_0x1e9b5c){_0x238d9d=_0x1e9b5c;return _0x1e9b5c['removeSound'](_0x4a2289[_0x9cc7('0x46')][_0x9cc7('0x6d')]);}})[_0x9cc7('0x27')](function(_0x113807){if(_0x113807){return db[_0x9cc7('0x61')][_0x9cc7('0x62')]({'where':{'id':_0x4a2289[_0x9cc7('0x46')][_0x9cc7('0x6d')]},'attributes':['id',_0x9cc7('0x2e'),_0x9cc7('0x63'),_0x9cc7('0x64'),_0x9cc7('0x65')],'raw':!![]});}})[_0x9cc7('0x27')](function(_0x3a4080){if(_0x3a4080){fs[_0x9cc7('0x5c')](path['join'](_0x238d9d[_0x9cc7('0x5a')],util[_0x9cc7('0x6e')](_0x9cc7('0x69'),_0x3a4080['name'],_0x3a4080[_0x9cc7('0x64')])));return _0x3a4080;}})[_0x9cc7('0x45')](function(_0x4456e8){throw new db[(_0x9cc7('0x5e'))][(_0x9cc7('0x5f'))](_0x4456e8[_0x9cc7('0x6b')]);});})[_0x9cc7('0x27')](handleEntityNotFound(_0xce50fc,null))[_0x9cc7('0x27')](respondWithStatusCode(_0xce50fc,0xcc))[_0x9cc7('0x45')](handleError(_0xce50fc,null));};exports[_0x9cc7('0x6f')]=function(_0x56489e,_0x17a72f,_0x2251b8){var _0x5e6c39={};var _0x458bd5={};var _0x4c7326;var _0x4fa10d;return db['VoiceMusicOnHold'][_0x9cc7('0x62')]({'where':{'id':_0x56489e[_0x9cc7('0x46')]['id']}})['then'](handleEntityNotFound(_0x17a72f,null))[_0x9cc7('0x27')](function(_0x2f8811){if(_0x2f8811){_0x4c7326=_0x2f8811;_0x458bd5[_0x9cc7('0x33')]=_[_0x9cc7('0x34')](db['Sound']['rawAttributes']);_0x458bd5['query']=_[_0x9cc7('0x34')](_0x56489e['query']);_0x458bd5['filters']=_[_0x9cc7('0x37')](_0x458bd5[_0x9cc7('0x33')],_0x458bd5[_0x9cc7('0x35')]);_0x5e6c39[_0x9cc7('0x39')]=_[_0x9cc7('0x37')](_0x458bd5[_0x9cc7('0x33')],qs[_0x9cc7('0x38')](_0x56489e[_0x9cc7('0x35')]['fields']));_0x5e6c39[_0x9cc7('0x39')]=_0x5e6c39[_0x9cc7('0x39')][_0x9cc7('0x3a')]?_0x5e6c39['attributes']:_0x458bd5[_0x9cc7('0x33')];_0x5e6c39[_0x9cc7('0x3c')]=qs['sort'](_0x56489e[_0x9cc7('0x35')]['sort']);_0x5e6c39[_0x9cc7('0x3e')]=qs[_0x9cc7('0x36')](_[_0x9cc7('0x70')](_0x56489e[_0x9cc7('0x35')],_0x458bd5[_0x9cc7('0x36')]));if(_0x56489e[_0x9cc7('0x35')][_0x9cc7('0x42')]){_0x5e6c39['where']=_[_0x9cc7('0x3f')](_0x5e6c39['where'],{'$or':_[_0x9cc7('0x40')](_0x5e6c39['attributes'],function(_0x7654aa){var _0x56561c={};_0x56561c[_0x7654aa]={'$like':'%'+_0x56489e[_0x9cc7('0x35')][_0x9cc7('0x42')]+'%'};return _0x56561c;})});}_0x5e6c39=_['merge']({},_0x5e6c39,_0x56489e[_0x9cc7('0x71')]);return _0x4c7326[_0x9cc7('0x6f')](_0x5e6c39);}})[_0x9cc7('0x27')](function(_0x164964){if(_0x164964){_0x4fa10d=_0x164964[_0x9cc7('0x3a')];if(!_0x56489e[_0x9cc7('0x35')][_0x9cc7('0x3b')](_0x9cc7('0x72'))){_0x5e6c39[_0x9cc7('0x1f')]=qs[_0x9cc7('0x1f')](_0x56489e[_0x9cc7('0x35')][_0x9cc7('0x1f')]);_0x5e6c39[_0x9cc7('0x1d')]=qs[_0x9cc7('0x1d')](_0x56489e[_0x9cc7('0x35')][_0x9cc7('0x1d')]);}return _0x4c7326[_0x9cc7('0x6f')](_0x5e6c39);}})[_0x9cc7('0x27')](function(_0x4e7d90){if(_0x4e7d90){return _0x4e7d90?{'count':_0x4fa10d,'rows':_0x4e7d90}:null;}})[_0x9cc7('0x27')](respondWithResult(_0x17a72f,null))[_0x9cc7('0x45')](handleError(_0x17a72f,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1138c5c..52d3dc7 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 _0x935e=['exports','VoiceMusicOnHold','voice_musiconhold','api','moment','path','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x3f73f9,_0x36df24){var _0x1e63ad=function(_0x1a1f5c){while(--_0x1a1f5c){_0x3f73f9['push'](_0x3f73f9['shift']());}};_0x1e63ad(++_0x36df24);}(_0x935e,0xb3));var _0xe935=function(_0x1abd69,_0x27540f){_0x1abd69=_0x1abd69-0x0;var _0x48f4bb=_0x935e[_0x1abd69];return _0x48f4bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe935('0x0'));var moment=require(_0xe935('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe935('0x2'));var rimraf=require('rimraf');var config=require(_0xe935('0x3'));var attributes=require(_0xe935('0x4'));module[_0xe935('0x5')]=function(_0x55a27d,_0x200ba4){return _0x55a27d['define'](_0xe935('0x6'),attributes,{'tableName':_0xe935('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ca3=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x496285,_0x297d87){var _0x2f7996=function(_0x4d8a0e){while(--_0x4d8a0e){_0x496285['push'](_0x496285['shift']());}};_0x2f7996(++_0x297d87);}(_0x6ca3,0xf2));var _0x36ca=function(_0x2627c5,_0x3a0394){_0x2627c5=_0x2627c5-0x0;var _0x4f11fd=_0x6ca3[_0x2627c5];return _0x4f11fd;};'use strict';var _=require(_0x36ca('0x0'));var util=require(_0x36ca('0x1'));var logger=require(_0x36ca('0x2'))('api');var moment=require(_0x36ca('0x3'));var BPromise=require(_0x36ca('0x4'));var rp=require(_0x36ca('0x5'));var fs=require('fs');var path=require(_0x36ca('0x6'));var rimraf=require(_0x36ca('0x7'));var config=require(_0x36ca('0x8'));var attributes=require(_0x36ca('0x9'));module[_0x36ca('0xa')]=function(_0x33946f,_0x1cec78){return _0x33946f[_0x36ca('0xb')](_0x36ca('0xc'),attributes,{'tableName':_0x36ca('0xd'),'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 878efc3..b8ac5bd 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf7b0e,_0x1f7088){var _0x2e95aa=function(_0x45a76c){while(--_0x45a76c){_0xf7b0e['push'](_0xf7b0e['shift']());}};_0x2e95aa(++_0x1f7088);}(_0x70e0,0x17b));var _0x070e=function(_0x221584,_0x183542){_0x221584=_0x221584-0x0;var _0x2a782d=_0x70e0[_0x221584];return _0x2a782d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x37b2cb,_0x80568f){var _0x19ffb2=function(_0x490d2b){while(--_0x490d2b){_0x37b2cb['push'](_0x37b2cb['shift']());}};_0x19ffb2(++_0x80568f);}(_0x70e0,0x17b));var _0x070e=function(_0x58dabb,_0x40a7b1){_0x58dabb=_0x58dabb-0x0;var _0x3ca682=_0x70e0[_0x58dabb];return _0x3ca682;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e60364a..f2017a1 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 _0xb2ff=['/describe','describe','/:id','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2ff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2f('0x4'));var controller=require(_0xfb2f('0x5'));router[_0xfb2f('0x6')]('/',auth[_0xfb2f('0x7')](),controller['index']);router['get'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0x9')]);router[_0xfb2f('0x6')](_0xfb2f('0xa'),auth[_0xfb2f('0x7')](),controller['show']);router[_0xfb2f('0x6')]('/:id/users',auth[_0xfb2f('0x7')](),controller['getAgents']);router[_0xfb2f('0x6')](_0xfb2f('0xb'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xc')]);router[_0xfb2f('0xd')]('/',auth['isAuthenticated'](),controller[_0xfb2f('0xe')]);router[_0xfb2f('0xd')](_0xfb2f('0xf'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0x10')]);router[_0xfb2f('0xd')](_0xfb2f('0xb'),auth[_0xfb2f('0x7')](),controller['addTeams']);router[_0xfb2f('0x11')](_0xfb2f('0xa'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0x12')]);router[_0xfb2f('0x13')]('/:id',auth[_0xfb2f('0x7')](),controller[_0xfb2f('0x14')]);router[_0xfb2f('0x13')](_0xfb2f('0xf'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0x15')]);router['delete'](_0xfb2f('0xb'),auth[_0xfb2f('0x7')](),controller['removeTeams']);module[_0xfb2f('0x16')]=router; \ No newline at end of file +var _0x46f4=['addTeams','put','update','delete','destroy','removeAgents','removeTeams','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents'];(function(_0x5d5ec6,_0x5019ad){var _0x526c4b=function(_0x3eff6f){while(--_0x3eff6f){_0x5d5ec6['push'](_0x5d5ec6['shift']());}};_0x526c4b(++_0x5019ad);}(_0x46f4,0x115));var _0x446f=function(_0x1fbc2f,_0x54cd04){_0x1fbc2f=_0x1fbc2f-0x0;var _0x22dcc8=_0x46f4[_0x1fbc2f];return _0x22dcc8;};'use strict';var multer=require(_0x446f('0x0'));var util=require(_0x446f('0x1'));var path=require(_0x446f('0x2'));var timeout=require(_0x446f('0x3'));var express=require(_0x446f('0x4'));var router=express[_0x446f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x446f('0x6'));var interaction=require(_0x446f('0x7'));var config=require('../../config/environment');var controller=require(_0x446f('0x8'));router['get']('/',auth[_0x446f('0x9')](),controller[_0x446f('0xa')]);router[_0x446f('0xb')](_0x446f('0xc'),auth[_0x446f('0x9')](),controller[_0x446f('0xd')]);router[_0x446f('0xb')](_0x446f('0xe'),auth[_0x446f('0x9')](),controller[_0x446f('0xf')]);router[_0x446f('0xb')](_0x446f('0x10'),auth[_0x446f('0x9')](),controller[_0x446f('0x11')]);router[_0x446f('0xb')](_0x446f('0x12'),auth[_0x446f('0x9')](),controller[_0x446f('0x13')]);router[_0x446f('0x14')]('/',auth['isAuthenticated'](),controller[_0x446f('0x15')]);router[_0x446f('0x14')](_0x446f('0x10'),auth[_0x446f('0x9')](),controller[_0x446f('0x16')]);router[_0x446f('0x14')](_0x446f('0x12'),auth[_0x446f('0x9')](),controller[_0x446f('0x17')]);router[_0x446f('0x18')]('/:id',auth[_0x446f('0x9')](),controller[_0x446f('0x19')]);router[_0x446f('0x1a')](_0x446f('0xe'),auth[_0x446f('0x9')](),controller[_0x446f('0x1b')]);router[_0x446f('0x1a')](_0x446f('0x10'),auth[_0x446f('0x9')](),controller[_0x446f('0x1c')]);router[_0x446f('0x1a')](_0x446f('0x12'),auth[_0x446f('0x9')](),controller[_0x446f('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index e555b72..258f7b9 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 _0x7acc=['getDataValue','INTEGER','sequelize','exports','STRING','name','system-'];(function(_0x9d3c56,_0x569898){var _0x460d1c=function(_0x3458d1){while(--_0x3458d1){_0x9d3c56['push'](_0x9d3c56['shift']());}};_0x460d1c(++_0x569898);}(_0x7acc,0xfe));var _0xc7ac=function(_0x5eab95,_0x3719f6){_0x5eab95=_0x5eab95-0x0;var _0x2ee708=_0x7acc[_0x5eab95];return _0x2ee708;};'use strict';var Sequelize=require(_0xc7ac('0x0'));module[_0xc7ac('0x1')]={'name':{'type':Sequelize[_0xc7ac('0x2')],'allowNull':![],'unique':_0xc7ac('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x31aa79){return _0xc7ac('0x4')+this[_0xc7ac('0x5')](_0xc7ac('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xc7ac('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xc7ac('0x6')]}}; \ No newline at end of file +var _0xaf00=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0xaf00,0x13b));var _0x0af0=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0xaf00[_0x25d2fb];return _0x1ded53;};'use strict';var Sequelize=require(_0x0af0('0x0'));module[_0x0af0('0x1')]={'name':{'type':Sequelize[_0x0af0('0x2')],'allowNull':![],'unique':_0x0af0('0x3')},'prefix':{'type':Sequelize[_0x0af0('0x4')],'get':function(_0x459b12){return _0x0af0('0x5')+this[_0x0af0('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x0af0('0x2')]},'callerIdAll':{'type':Sequelize[_0x0af0('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 952ab86..6262c3d 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 _0xb78e=['userVoicePrefix:remove','eml-format','rimraf','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','get','VoicePrefixes','destroy','sendStatus','name','index','map','VoicePrefix','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','catch','params','keys','rawAttributes','length','includeAll','find','create','sequelize','transaction','body','VoiceExtension','user','userProfileId','autoAssociation','error','exten','app','system','description','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','emit','removeAgents','getAgents','User','pick','merge','getTeams','findOne','Team','addTeams','Agents','online','interface','flatMap','each','upsert','UserVoicePrefix','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty'];(function(_0x41da6a,_0xb6ad1c){var _0x2cbd52=function(_0x42d34e){while(--_0x42d34e){_0x41da6a['push'](_0x41da6a['shift']());}};_0x2cbd52(++_0xb6ad1c);}(_0xb78e,0x1c9));var _0xeb78=function(_0x38ef85,_0x317bcc){_0x38ef85=_0x38ef85-0x0;var _0x1ffa8d=_0xb78e[_0x38ef85];return _0x1ffa8d;};'use strict';var emlformat=require(_0xeb78('0x0'));var rimraf=require(_0xeb78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb78('0x2'));var rp=require(_0xeb78('0x3'));var moment=require(_0xeb78('0x4'));var BPromise=require(_0xeb78('0x5'));var Mustache=require(_0xeb78('0x6'));var util=require(_0xeb78('0x7'));var path=require(_0xeb78('0x8'));var sox=require(_0xeb78('0x9'));var csv=require('to-csv');var ejs=require(_0xeb78('0xa'));var fs=require('fs');var fs_extra=require(_0xeb78('0xb'));var _=require(_0xeb78('0xc'));var squel=require(_0xeb78('0xd'));var crypto=require(_0xeb78('0xe'));var jsforce=require(_0xeb78('0xf'));var deskjs=require(_0xeb78('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeb78('0x11'));var Papa=require(_0xeb78('0x12'));var Redis=require(_0xeb78('0x13'));var authService=require(_0xeb78('0x14'));var qs=require(_0xeb78('0x15'));var as=require(_0xeb78('0x16'));var hardwareService=require(_0xeb78('0x17'));var logger=require(_0xeb78('0x18'))(_0xeb78('0x19'));var utils=require('../../config/utils');var config=require(_0xeb78('0x1a'));var licenseUtil=require(_0xeb78('0x1b'));var db=require(_0xeb78('0x1c'))['db'];config[_0xeb78('0x1d')]=_[_0xeb78('0x1e')](config[_0xeb78('0x1d')],{'host':_0xeb78('0x1f'),'port':0x18eb});var socket=require(_0xeb78('0x20'))(new Redis(config[_0xeb78('0x1d')]));require(_0xeb78('0x21'))['register'](socket);function respondWithStatusCode(_0x315914,_0x3e4d24){_0x3e4d24=_0x3e4d24||0xcc;return function(_0x4e8b8c){if(_0x4e8b8c){return _0x315914['sendStatus'](_0x3e4d24);}return _0x315914['status'](_0x3e4d24)[_0xeb78('0x22')]();};}function respondWithResult(_0x50ebae,_0xa28d5e){_0xa28d5e=_0xa28d5e||0xc8;return function(_0x247cb1){if(_0x247cb1){return _0x50ebae['status'](_0xa28d5e)[_0xeb78('0x23')](_0x247cb1);}};}function respondWithFilteredResult(_0x53c811,_0x21c521){return function(_0x92e410){if(_0x92e410){var _0x576802=typeof _0x21c521[_0xeb78('0x24')]===_0xeb78('0x25')&&typeof _0x21c521[_0xeb78('0x26')]==='undefined';var _0x24d845=_0x92e410[_0xeb78('0x27')];var _0x4ab933=_0x576802?0x0:_0x21c521['offset'];var _0x455e30=_0x576802?_0x92e410[_0xeb78('0x27')]:_0x21c521[_0xeb78('0x24')]+_0x21c521[_0xeb78('0x26')];var _0x432b18;if(_0x455e30>=_0x24d845){_0x455e30=_0x24d845;_0x432b18=0xc8;}else{_0x432b18=0xce;}_0x53c811[_0xeb78('0x28')](_0x432b18);return _0x53c811[_0xeb78('0x29')](_0xeb78('0x2a'),_0x4ab933+'-'+_0x455e30+'/'+_0x24d845)[_0xeb78('0x23')](_0x92e410);}return null;};}function patchUpdates(_0x52b8c1){return function(_0x5d3cf8){try{jsonpatch['apply'](_0x5d3cf8,_0x52b8c1,!![]);}catch(_0x5c9e0d){return BPromise[_0xeb78('0x2b')](_0x5c9e0d);}return _0x5d3cf8['save']();};}function saveUpdates(_0x2159c1,_0x1fbf2f){return function(_0x566336){if(_0x566336){return _0x566336[_0xeb78('0x2c')](_0x2159c1)['then'](function(_0x9a00b){return _0x9a00b;});}return null;};}function removeEntity(_0x5fc575,_0x315f98){return function(_0x12b3b2){if(_0x12b3b2){return _0x12b3b2['destroy']()[_0xeb78('0x2d')](function(){var _0x515158=_0x12b3b2[_0xeb78('0x2e')]({'plain':!![]});var _0x23295a=_0xeb78('0x2f');return db['UserProfileResource'][_0xeb78('0x30')]({'where':{'type':_0x23295a,'resourceId':_0x515158['id']}})[_0xeb78('0x2d')](function(){return _0x12b3b2;});})[_0xeb78('0x2d')](function(){_0x5fc575[_0xeb78('0x28')](0xcc)[_0xeb78('0x22')]();});}};}function handleEntityNotFound(_0x3516b8,_0x1131a9){return function(_0x22c25f){if(!_0x22c25f){_0x3516b8[_0xeb78('0x31')](0x194);}return _0x22c25f;};}function handleError(_0x19ad00,_0x1f3a14){_0x1f3a14=_0x1f3a14||0x1f4;return function(_0x505468){logger['error'](_0x505468['stack']);if(_0x505468[_0xeb78('0x32')]){delete _0x505468[_0xeb78('0x32')];}_0x19ad00[_0xeb78('0x28')](_0x1f3a14)['send'](_0x505468);};}exports[_0xeb78('0x33')]=function(_0x1ecdfb,_0x3de59f){var _0x83b35d={},_0x4e720c={},_0x1a0ce6={'count':0x0,'rows':[]};var _0x1ec0bc=_[_0xeb78('0x34')](db[_0xeb78('0x35')]['rawAttributes'],function(_0x3ff33f){return{'name':_0x3ff33f['fieldName'],'type':_0x3ff33f[_0xeb78('0x36')][_0xeb78('0x37')]};});_0x4e720c[_0xeb78('0x38')]=_[_0xeb78('0x34')](_0x1ec0bc,_0xeb78('0x32'));_0x4e720c[_0xeb78('0x39')]=_['keys'](_0x1ecdfb['query']);_0x4e720c[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x4e720c[_0xeb78('0x38')],_0x4e720c[_0xeb78('0x39')]);_0x83b35d[_0xeb78('0x3c')]=_['intersection'](_0x4e720c[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x83b35d[_0xeb78('0x3c')]=_0x83b35d[_0xeb78('0x3c')]['length']?_0x83b35d['attributes']:_0x4e720c['model'];if(!_0x1ecdfb['query'][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x83b35d[_0xeb78('0x26')]=qs['limit'](_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x26')]);_0x83b35d['offset']=qs['offset'](_0x1ecdfb['query'][_0xeb78('0x24')]);}_0x83b35d[_0xeb78('0x40')]=qs[_0xeb78('0x41')](_0x1ecdfb['query'][_0xeb78('0x41')]);_0x83b35d[_0xeb78('0x42')]=qs[_0xeb78('0x3a')](_['pick'](_0x1ecdfb[_0xeb78('0x39')],_0x4e720c[_0xeb78('0x3a')]),_0x1ec0bc);if(_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x43')]){_0x83b35d['where']=_['merge'](_0x83b35d[_0xeb78('0x42')],{'$or':_[_0xeb78('0x34')](_0x1ec0bc,function(_0x2e416b){if(_0x2e416b[_0xeb78('0x36')]!==_0xeb78('0x44')){var _0x2fbdb4={};_0x2fbdb4[_0x2e416b[_0xeb78('0x32')]]={'$like':'%'+_0x1ecdfb[_0xeb78('0x39')][_0xeb78('0x43')]+'%'};return _0x2fbdb4;}})});}_0x83b35d=_['merge']({},_0x83b35d,_0x1ecdfb[_0xeb78('0x45')]);var _0xa02a32={'where':_0x83b35d[_0xeb78('0x42')]};return db['VoicePrefix'][_0xeb78('0x27')](_0xa02a32)['then'](function(_0x21f81b){_0x1a0ce6[_0xeb78('0x27')]=_0x21f81b;if(_0x1ecdfb[_0xeb78('0x39')]['includeAll']){_0x83b35d[_0xeb78('0x46')]=[{'all':!![]}];}return db[_0xeb78('0x35')][_0xeb78('0x47')](_0x83b35d);})[_0xeb78('0x2d')](function(_0x2dc9f7){_0x1a0ce6['rows']=_0x2dc9f7;return _0x1a0ce6;})[_0xeb78('0x2d')](respondWithFilteredResult(_0x3de59f,_0x83b35d))[_0xeb78('0x48')](handleError(_0x3de59f,null));};exports['show']=function(_0xece1cb,_0x31a146){var _0x1f2610={'raw':![],'where':{'id':_0xece1cb[_0xeb78('0x49')]['id']}},_0x51dfbc={};_0x51dfbc[_0xeb78('0x38')]=_[_0xeb78('0x4a')](db[_0xeb78('0x35')][_0xeb78('0x4b')]);_0x51dfbc[_0xeb78('0x39')]=_['keys'](_0xece1cb['query']);_0x51dfbc[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x51dfbc['model'],_0x51dfbc[_0xeb78('0x39')]);_0x1f2610[_0xeb78('0x3c')]=_[_0xeb78('0x3b')](_0x51dfbc[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0xece1cb[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x1f2610[_0xeb78('0x3c')]=_0x1f2610[_0xeb78('0x3c')][_0xeb78('0x4c')]?_0x1f2610[_0xeb78('0x3c')]:_0x51dfbc[_0xeb78('0x38')];if(_0xece1cb[_0xeb78('0x39')][_0xeb78('0x4d')]){_0x1f2610[_0xeb78('0x46')]=[{'all':!![]}];}_0x1f2610=_['merge']({},_0x1f2610,_0xece1cb[_0xeb78('0x45')]);return db[_0xeb78('0x35')][_0xeb78('0x4e')](_0x1f2610)[_0xeb78('0x2d')](handleEntityNotFound(_0x31a146,null))['then'](respondWithResult(_0x31a146,null))[_0xeb78('0x48')](handleError(_0x31a146,null));};exports[_0xeb78('0x30')]=function(_0xcaccc5,_0x3d30a4){return db[_0xeb78('0x35')]['find']({'where':{'id':_0xcaccc5['params']['id']}})['then'](handleEntityNotFound(_0x3d30a4,null))[_0xeb78('0x2d')](removeEntity(_0x3d30a4,null))[_0xeb78('0x48')](handleError(_0x3d30a4,null));};exports['describe']=function(_0x10efdb,_0x43164f){return db[_0xeb78('0x35')]['describe']()['then'](respondWithResult(_0x43164f,null))[_0xeb78('0x48')](handleError(_0x43164f,null));};exports[_0xeb78('0x4f')]=function(_0x1f5b67,_0x4e3f1a){var _0x3c7214;return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x4a3c91){return db['VoicePrefix']['create'](_0x1f5b67[_0xeb78('0x52')],{'transaction':_0x4a3c91})[_0xeb78('0x2d')](function(_0x55c643){_0x3c7214=_0x55c643[_0xeb78('0x2e')]({'plain':!![]});return db[_0xeb78('0x53')][_0xeb78('0x4e')]({'where':{'id':_0x3c7214['VoiceExtensionId']},'raw':!![]})[_0xeb78('0x2d')](function(_0x572aaf){return createVoicePrefixExtensions(_0x3c7214,_0x572aaf,_0x4a3c91);});});})[_0xeb78('0x2d')](function(){var _0x151083=_0x1f5b67[_0xeb78('0x54')]['get']({'plain':!![]});if(!_0x151083)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x151083['role']==='user'){var _0x3238e9=_0x3c7214;return db['UserProfileSection'][_0xeb78('0x4e')]({'where':{'name':_0xeb78('0x2f'),'userProfileId':_0x151083[_0xeb78('0x55')]},'raw':!![]})[_0xeb78('0x2d')](function(_0x2a1f7f){if(_0x2a1f7f&&_0x2a1f7f[_0xeb78('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x3238e9[_0xeb78('0x32')],'resourceId':_0x3238e9['id'],'type':_0x2a1f7f[_0xeb78('0x32')],'sectionId':_0x2a1f7f['id']},{})[_0xeb78('0x2d')](function(){return _0x3c7214;});}else{return _0x3c7214;}})[_0xeb78('0x48')](function(_0x480093){logger[_0xeb78('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x480093);throw _0x480093;});}return _0x3c7214;})[_0xeb78('0x2d')](respondWithResult(_0x4e3f1a,null))[_0xeb78('0x48')](handleError(_0x4e3f1a,null));};function Extension(_0x1d4761,_0x5b4998,_0x363cec,_0x37649c){this['context']='from-sip';this[_0xeb78('0x58')]=_0x1d4761;this[_0xeb78('0x59')]=_0x363cec;this['type']=_0xeb78('0x5a');this[_0xeb78('0x5b')]='Voice\x20Prefix\x20Extension';this['priority']=_0x5b4998;this[_0xeb78('0x5c')]=_0x37649c;}function createVoicePrefixExtensions(_0x5baf31,_0x539ad7,_0x2029ea){return new BPromise(function(_0x486899,_0x27b425){var _0x42c249=new Extension(formatPrefixName(_0x5baf31[_0xeb78('0x5d')]),0x1,'NoOp',_0xeb78('0x5e'));_0x42c249[_0xeb78('0x5f')]=_0x5baf31['id'];return db[_0xeb78('0x53')]['create'](_0x42c249,{'transaction':_0x2029ea})[_0xeb78('0x2d')](function(_0x4ec4ec){var _0xd61214=_0x4ec4ec[_0xeb78('0x2e')]({'plain':!![]});var _0x45aeaf=_[_0xeb78('0x34')](addVoicePrefixExtensions(_0x5baf31,_0x539ad7),function(_0x50d38d){_0x50d38d[_0xeb78('0x60')]=_0xd61214['id'];_0x50d38d['VoicePrefixId']=_0x5baf31['id'];return _0x50d38d;});return db[_0xeb78('0x53')][_0xeb78('0x61')](_0x45aeaf,{'transaction':_0x2029ea})[_0xeb78('0x2d')](function(_0x442fa7){if(!_0x442fa7){return _0x27b425(_0xeb78('0x62'));}else{return _0x486899(_0x442fa7);}})['catch'](function(_0x2ffe3b){return _0x27b425(_0x2ffe3b);});});;});};function addVoicePrefixExtensions(_0x2bf5a8,_0xf7eebe){var _0x22aa3a=[];var _0x3eb9c5=formatPrefixName(_0x2bf5a8[_0xeb78('0x5d')]);_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x2,_0xeb78('0x64'),_0xeb78('0x65')+_0x2bf5a8[_0xeb78('0x32')]));if(_0x2bf5a8[_0xeb78('0x66')]){_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x3,_0xeb78('0x64'),_0xeb78('0x67')+_0x2bf5a8[_0xeb78('0x66')]));}else{_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x3,'NoOp',_0xeb78('0x68')));}_0x22aa3a[_0xeb78('0x63')](new Extension(_0x3eb9c5,0x4,_0xeb78('0x69'),_0xf7eebe['context']+','+_0xeb78('0x6a')+(0x8+_0x2bf5a8[_0xeb78('0x32')][_0xeb78('0x4c')])+'}'+','+0x1));return _0x22aa3a;}function formatPrefixName(_0x2208c2){var _0xe88f54='_';for(var _0x2d6f67=0x0;_0x2d6f67<_0x2208c2[_0xeb78('0x4c')];_0x2d6f67++){if(_0x2208c2[_0xeb78('0x6b')](_0x2d6f67)=='-'){_0xe88f54+=_0x2208c2[_0xeb78('0x6b')](_0x2d6f67);}else{_0xe88f54+='['+_0x2208c2['charAt'](_0x2d6f67)+']';}}_0xe88f54+='.';return _0xe88f54;}exports['update']=function(_0x2bf610,_0x129e0e,_0x44a2c8){var _0x30c186=_0x2bf610[_0xeb78('0x52')];_0x30c186[_0xeb78('0x5d')]=_0xeb78('0x6c')+_0x30c186[_0xeb78('0x32')]+'-';return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x5c27de){return db[_0xeb78('0x35')][_0xeb78('0x2c')](_0x30c186,{'where':{'id':_0x30c186['id']},'transaction':_0x5c27de})[_0xeb78('0x2d')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x30c186['id']},'transaction':_0x5c27de})['then'](function(){return db['VoiceExtension'][_0xeb78('0x4e')]({'where':{'id':_0x30c186[_0xeb78('0x60')]},'raw':!![]})[_0xeb78('0x2d')](function(_0xf89f26){return createVoicePrefixExtensions(_0x30c186,_0xf89f26,_0x5c27de);});});});})[_0xeb78('0x2d')](function(){return db[_0xeb78('0x35')][_0xeb78('0x6d')](_0x30c186['id']);})[_0xeb78('0x2d')](respondWithResult(_0x129e0e,null))[_0xeb78('0x48')](handleError(_0x129e0e,null));};exports[_0xeb78('0x6e')]=function(_0x259525,_0x53cf73,_0x42cfd1){return db['VoicePrefix'][_0xeb78('0x4e')]({'where':{'id':_0x259525['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x53cf73,null))[_0xeb78('0x2d')](function(_0x2a9d4d){if(_0x2a9d4d){return _0x2a9d4d[_0xeb78('0x6e')](_0x259525[_0xeb78('0x52')]['ids'],_[_0xeb78('0x6f')](_0x259525[_0xeb78('0x52')],[_0xeb78('0x70'),'id'])||{})[_0xeb78('0x71')](function(_0x3896a1){for(var _0x2da098=0x0;_0x2da098<_0x259525[_0xeb78('0x52')][_0xeb78('0x70')][_0xeb78('0x4c')];_0x2da098+=0x1){socket[_0xeb78('0x72')]('userVoicePrefix:save',{'UserId':Number(_0x259525[_0xeb78('0x52')][_0xeb78('0x70')][_0x2da098]),'VoicePrefixId':Number(_0x259525[_0xeb78('0x49')]['id'])});}return _0x3896a1;});}})[_0xeb78('0x2d')](respondWithResult(_0x53cf73,null))[_0xeb78('0x48')](handleError(_0x53cf73,null));};exports[_0xeb78('0x73')]=function(_0x37217c,_0x5dbfef,_0x37a587){return db['VoicePrefix'][_0xeb78('0x4e')]({'where':{'id':_0x37217c[_0xeb78('0x49')]['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x5dbfef,null))['then'](function(_0x1732e5){if(_0x1732e5){return _0x1732e5[_0xeb78('0x73')](_0x37217c['query'][_0xeb78('0x70')])[_0xeb78('0x2d')](function(){if(_['isArray'](_0x37217c[_0xeb78('0x39')][_0xeb78('0x70')])){for(var _0x1f000b=0x0;_0x1f000b<_0x37217c['query'][_0xeb78('0x70')][_0xeb78('0x4c')];_0x1f000b+=0x1){socket[_0xeb78('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x37217c[_0xeb78('0x39')][_0xeb78('0x70')][_0x1f000b]),'VoicePrefixId':Number(_0x37217c['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x37217c['query'][_0xeb78('0x70')]),'VoicePrefixId':Number(_0x37217c[_0xeb78('0x49')]['id'])});}});}})[_0xeb78('0x2d')](respondWithStatusCode(_0x5dbfef,null))[_0xeb78('0x48')](handleError(_0x5dbfef,null));};exports[_0xeb78('0x74')]=function(_0x468483,_0x7fc774,_0x34a1f3){var _0x3232a8={};var _0xd3ed51={};var _0x3386f3;var _0x21e3ac;return db[_0xeb78('0x35')]['findOne']({'where':{'id':_0x468483['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x7fc774,null))[_0xeb78('0x2d')](function(_0x39f1cc){if(_0x39f1cc){_0x3386f3=_0x39f1cc;_0xd3ed51[_0xeb78('0x38')]=_[_0xeb78('0x4a')](db[_0xeb78('0x75')]['rawAttributes']);_0xd3ed51[_0xeb78('0x39')]=_[_0xeb78('0x4a')](_0x468483['query']);_0xd3ed51[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0xd3ed51[_0xeb78('0x38')],_0xd3ed51[_0xeb78('0x39')]);_0x3232a8[_0xeb78('0x3c')]=_[_0xeb78('0x3b')](_0xd3ed51[_0xeb78('0x38')],qs['fields'](_0x468483[_0xeb78('0x39')]['fields']));_0x3232a8[_0xeb78('0x3c')]=_0x3232a8[_0xeb78('0x3c')][_0xeb78('0x4c')]?_0x3232a8[_0xeb78('0x3c')]:_0xd3ed51['model'];_0x3232a8[_0xeb78('0x40')]=qs['sort'](_0x468483['query'][_0xeb78('0x41')]);_0x3232a8[_0xeb78('0x42')]=qs[_0xeb78('0x3a')](_[_0xeb78('0x76')](_0x468483[_0xeb78('0x39')],_0xd3ed51[_0xeb78('0x3a')]));if(_0x468483[_0xeb78('0x39')][_0xeb78('0x43')]){_0x3232a8[_0xeb78('0x42')]=_['merge'](_0x3232a8['where'],{'$or':_[_0xeb78('0x34')](_0x3232a8[_0xeb78('0x3c')],function(_0x2ea1fe){var _0x49936c={};_0x49936c[_0x2ea1fe]={'$like':'%'+_0x468483[_0xeb78('0x39')][_0xeb78('0x43')]+'%'};return _0x49936c;})});}_0x3232a8=_[_0xeb78('0x77')]({},_0x3232a8,_0x468483[_0xeb78('0x45')]);return _0x3386f3['getAgents'](_0x3232a8);}})['then'](function(_0x493f82){if(_0x493f82){_0x21e3ac=_0x493f82['length'];if(!_0x468483[_0xeb78('0x39')][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x3232a8[_0xeb78('0x26')]=qs[_0xeb78('0x26')](_0x468483[_0xeb78('0x39')]['limit']);_0x3232a8[_0xeb78('0x24')]=qs[_0xeb78('0x24')](_0x468483[_0xeb78('0x39')][_0xeb78('0x24')]);}return _0x3386f3[_0xeb78('0x74')](_0x3232a8);}})[_0xeb78('0x2d')](function(_0x51a349){if(_0x51a349){return _0x51a349?{'count':_0x21e3ac,'rows':_0x51a349}:null;}})[_0xeb78('0x2d')](respondWithResult(_0x7fc774,null))['catch'](handleError(_0x7fc774,null));};exports[_0xeb78('0x78')]=function(_0x506734,_0x30eb7c,_0x43637d){var _0x1ad737={};var _0x25cb1c={};var _0x335008;var _0x5d6506;return db[_0xeb78('0x35')][_0xeb78('0x79')]({'where':{'id':_0x506734['params']['id']}})[_0xeb78('0x2d')](handleEntityNotFound(_0x30eb7c,null))['then'](function(_0x2e9eb9){if(_0x2e9eb9){_0x335008=_0x2e9eb9;_0x25cb1c['model']=_[_0xeb78('0x4a')](db[_0xeb78('0x7a')][_0xeb78('0x4b')]);_0x25cb1c[_0xeb78('0x39')]=_[_0xeb78('0x4a')](_0x506734[_0xeb78('0x39')]);_0x25cb1c[_0xeb78('0x3a')]=_[_0xeb78('0x3b')](_0x25cb1c['model'],_0x25cb1c[_0xeb78('0x39')]);_0x1ad737[_0xeb78('0x3c')]=_['intersection'](_0x25cb1c[_0xeb78('0x38')],qs[_0xeb78('0x3d')](_0x506734[_0xeb78('0x39')][_0xeb78('0x3d')]));_0x1ad737[_0xeb78('0x3c')]=_0x1ad737['attributes'][_0xeb78('0x4c')]?_0x1ad737[_0xeb78('0x3c')]:_0x25cb1c['model'];_0x1ad737[_0xeb78('0x40')]=qs[_0xeb78('0x41')](_0x506734['query'][_0xeb78('0x41')]);_0x1ad737[_0xeb78('0x42')]=qs['filters'](_[_0xeb78('0x76')](_0x506734['query'],_0x25cb1c['filters']));if(_0x506734[_0xeb78('0x39')][_0xeb78('0x43')]){_0x1ad737[_0xeb78('0x42')]=_[_0xeb78('0x77')](_0x1ad737[_0xeb78('0x42')],{'$or':_[_0xeb78('0x34')](_0x1ad737[_0xeb78('0x3c')],function(_0x2da372){var _0x1a929b={};_0x1a929b[_0x2da372]={'$like':'%'+_0x506734[_0xeb78('0x39')]['filter']+'%'};return _0x1a929b;})});}_0x1ad737=_['merge']({},_0x1ad737,_0x506734[_0xeb78('0x45')]);return _0x335008[_0xeb78('0x78')](_0x1ad737);}})[_0xeb78('0x2d')](function(_0x3f99a1){if(_0x3f99a1){_0x5d6506=_0x3f99a1[_0xeb78('0x4c')];if(!_0x506734[_0xeb78('0x39')][_0xeb78('0x3e')](_0xeb78('0x3f'))){_0x1ad737[_0xeb78('0x26')]=qs[_0xeb78('0x26')](_0x506734[_0xeb78('0x39')][_0xeb78('0x26')]);_0x1ad737['offset']=qs['offset'](_0x506734[_0xeb78('0x39')]['offset']);}return _0x335008[_0xeb78('0x78')](_0x1ad737);}})['then'](function(_0x577f5f){if(_0x577f5f){return _0x577f5f?{'count':_0x5d6506,'rows':_0x577f5f}:null;}})[_0xeb78('0x2d')](respondWithResult(_0x30eb7c,null))[_0xeb78('0x48')](handleError(_0x30eb7c,null));};exports[_0xeb78('0x7b')]=function(_0x371c1d,_0x29a90d,_0xb69f0e){var _0x370f7a=_0x371c1d[_0xeb78('0x52')]['ids'];var _0x12773a;return db[_0xeb78('0x7a')]['findAll']({'where':{'id':_0x370f7a},'attributes':['id'],'include':[{'model':db[_0xeb78('0x75')],'as':_0xeb78('0x7c'),'attributes':['id',_0xeb78('0x32'),_0xeb78('0x7d'),'voicePause',_0xeb78('0x7e')],'raw':!![]}]})['then'](function(_0x64848b){if(_0x64848b){_0x12773a=_0x64848b;var _0x15b7d3=_[_0xeb78('0x7f')](_0x64848b,function(_0x523dc9){var _0x2401c8=_0x523dc9[_0xeb78('0x2e')]({'plain':!![]});return _0x2401c8[_0xeb78('0x7c')];});return db[_0xeb78('0x35')][_0xeb78('0x4e')]({'where':{'id':_0x371c1d[_0xeb78('0x49')]['id']}})[_0xeb78('0x2d')](function(_0x12b7d7){return db[_0xeb78('0x50')][_0xeb78('0x51')](function(_0x3e7088){return _0x12b7d7[_0xeb78('0x7b')](_0x370f7a,{'transaction':_0x3e7088})[_0xeb78('0x2d')](function(){return BPromise[_0xeb78('0x80')](_0x12773a,function(_0x5b1d20){return db['TeamVoicePrefix'][_0xeb78('0x81')]({'TeamId':_0x5b1d20['id'],'VoicePrefixId':_0x371c1d[_0xeb78('0x49')]['id']},{'transaction':_0x3e7088});});})[_0xeb78('0x2d')](function(){return BPromise[_0xeb78('0x80')](_0x15b7d3,function(_0x4c2c7e){return db[_0xeb78('0x82')]['findOrCreate']({'where':{'UserId':_0x4c2c7e['id'],'VoicePrefixId':_0x371c1d['params']['id']},'transaction':_0x3e7088});});})['then'](function(){_0x15b7d3[_0xeb78('0x83')](function(_0x1f5d36){socket['emit']('userVoicePrefix:save',{'UserId':_0x1f5d36['id'],'VoicePrefixId':_0x12b7d7['id']});});});});});}})['then'](respondWithStatusCode(_0x29a90d,null))[_0xeb78('0x48')](handleError(_0x29a90d,null));};exports[_0xeb78('0x84')]=function(_0x5fb310,_0x5553cf,_0x3d4163){return db[_0xeb78('0x7a')][_0xeb78('0x47')]({'where':{'id':_0x5fb310[_0xeb78('0x39')][_0xeb78('0x70')]},'attributes':['id'],'include':[{'model':db[_0xeb78('0x75')],'as':_0xeb78('0x7c'),'attributes':['id'],'raw':!![]}]})[_0xeb78('0x2d')](handleEntityNotFound(_0x5553cf,null))[_0xeb78('0x2d')](function(_0x502af6){var _0x32f23a=_[_0xeb78('0x34')](_0x502af6,'id');var _0x5a1c25=[];var _0x3e2374=[];var _0x3a80b7=squel[_0xeb78('0x85')]();_0x3a80b7[_0xeb78('0x86')](_0xeb78('0x87'))[_0xeb78('0x88')](_0xeb78('0x89'),'tq')[_0xeb78('0x8a')]('user_has_teams','ut',_0xeb78('0x8b'))[_0xeb78('0x42')](_0xeb78('0x8c'),_0x5fb310['params']['id']);for(var _0x55515a=0x0;_0x55515a<_0x502af6[_0xeb78('0x4c')];_0x55515a+=0x1){let _0x207202=_0x502af6[_0x55515a];for(var _0x5edbef=0x0;_0x5edbef<_0x207202[_0xeb78('0x7c')][_0xeb78('0x4c')];_0x5edbef+=0x1){let _0x55041b=_0x207202[_0xeb78('0x7c')][_0x5edbef];var _0x13d95b=_0x3a80b7['clone']();_0x13d95b[_0xeb78('0x42')](_0xeb78('0x8d'),_0x55041b['id']);_0x3e2374['push'](db[_0xeb78('0x50')][_0xeb78('0x39')](_0x13d95b[_0xeb78('0x8e')](),{'type':db[_0xeb78('0x50')][_0xeb78('0x8f')][_0xeb78('0x90')]})[_0xeb78('0x2d')](function(_0x5df43e){if(_0x5df43e[_0xeb78('0x4c')]===0x1){return _0x55041b['id'];}else{var _0x399b9c=_[_0xeb78('0x91')](_[_0xeb78('0x34')](_0x5df43e,_0xeb78('0x92')),function(_0x4beb24){return _['includes'](_0x32f23a,_0x4beb24);});if(_0x399b9c){return _0x55041b['id'];}}}));}}return BPromise[_0xeb78('0x93')](_0x3e2374)[_0xeb78('0x2d')](function(_0x497b99){_0x5a1c25=_(_0x5a1c25)['union'](_0x497b99)[_0xeb78('0x94')]()[_0xeb78('0x95')]();return db[_0xeb78('0x35')][_0xeb78('0x4e')]({'where':{'id':_0x5fb310[_0xeb78('0x49')]['id']}})['then'](function(_0x326468){return db['sequelize']['transaction'](function(_0x1170d3){return _0x326468['removeTeams'](_0x5fb310[_0xeb78('0x39')]['ids'],{'transaction':_0x1170d3})['then'](function(){if(!_[_0xeb78('0x96')](_0x5a1c25)){return _0x326468[_0xeb78('0x73')](_0x5a1c25,{'transaction':_0x1170d3});}})['then'](function(){_0x5a1c25[_0xeb78('0x83')](function(_0x10f23e){socket['emit'](_0xeb78('0x97'),{'UserId':_0x10f23e,'VoicePrefixId':_0x326468['id']});});});});});});})[_0xeb78('0x2d')](respondWithStatusCode(_0x5553cf,null))[_0xeb78('0x48')](handleError(_0x5553cf,null));}; \ No newline at end of file +var _0xd914=['Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','sequelize','findById','addAgents','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','hasOwnProperty','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','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','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','type','system','description'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd914,0x17f));var _0x4d91=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xd914[_0xfb0281];return _0x408dd3;};'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'];config[_0x4d91('0x1b')]=_[_0x4d91('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4d91('0x1d'))(new Redis(config[_0x4d91('0x1b')]));require(_0x4d91('0x1e'))[_0x4d91('0x1f')](socket);function respondWithStatusCode(_0x33fbd4,_0x25bafc){_0x25bafc=_0x25bafc||0xcc;return function(_0x36f606){if(_0x36f606){return _0x33fbd4['sendStatus'](_0x25bafc);}return _0x33fbd4[_0x4d91('0x20')](_0x25bafc)[_0x4d91('0x21')]();};}function respondWithResult(_0x1e2ef7,_0xb92681){_0xb92681=_0xb92681||0xc8;return function(_0x280e80){if(_0x280e80){return _0x1e2ef7['status'](_0xb92681)[_0x4d91('0x22')](_0x280e80);}};}function respondWithFilteredResult(_0xb75abf,_0x241564){return function(_0x44b9a7){if(_0x44b9a7){var _0x4cfa40=typeof _0x241564[_0x4d91('0x23')]===_0x4d91('0x24')&&typeof _0x241564[_0x4d91('0x25')]==='undefined';var _0x13ef2c=_0x44b9a7[_0x4d91('0x26')];var _0x351388=_0x4cfa40?0x0:_0x241564[_0x4d91('0x23')];var _0x10b767=_0x4cfa40?_0x44b9a7[_0x4d91('0x26')]:_0x241564[_0x4d91('0x23')]+_0x241564[_0x4d91('0x25')];var _0x30d911;if(_0x10b767>=_0x13ef2c){_0x10b767=_0x13ef2c;_0x30d911=0xc8;}else{_0x30d911=0xce;}_0xb75abf[_0x4d91('0x20')](_0x30d911);return _0xb75abf['set'](_0x4d91('0x27'),_0x351388+'-'+_0x10b767+'/'+_0x13ef2c)['json'](_0x44b9a7);}return null;};}function patchUpdates(_0x57913e){return function(_0x74a697){try{jsonpatch[_0x4d91('0x28')](_0x74a697,_0x57913e,!![]);}catch(_0x341d18){return BPromise[_0x4d91('0x29')](_0x341d18);}return _0x74a697[_0x4d91('0x2a')]();};}function saveUpdates(_0x12b722,_0x100cd4){return function(_0x123606){if(_0x123606){return _0x123606['update'](_0x12b722)['then'](function(_0x1ee6b3){return _0x1ee6b3;});}return null;};}function removeEntity(_0x112923,_0x3bed98){return function(_0x45fc91){if(_0x45fc91){return _0x45fc91[_0x4d91('0x2b')]()[_0x4d91('0x2c')](function(){var _0x14bdb4=_0x45fc91['get']({'plain':!![]});var _0x3dc353=_0x4d91('0x2d');return db[_0x4d91('0x2e')]['destroy']({'where':{'type':_0x3dc353,'resourceId':_0x14bdb4['id']}})['then'](function(){return _0x45fc91;});})[_0x4d91('0x2c')](function(){_0x112923[_0x4d91('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50fe76,_0x42d5a0){return function(_0x2d6981){if(!_0x2d6981){_0x50fe76[_0x4d91('0x2f')](0x194);}return _0x2d6981;};}function handleError(_0x17c7bc,_0x4f23dd){_0x4f23dd=_0x4f23dd||0x1f4;return function(_0x2587a1){logger[_0x4d91('0x30')](_0x2587a1[_0x4d91('0x31')]);if(_0x2587a1[_0x4d91('0x32')]){delete _0x2587a1[_0x4d91('0x32')];}_0x17c7bc[_0x4d91('0x20')](_0x4f23dd)[_0x4d91('0x33')](_0x2587a1);};}exports['index']=function(_0x82f585,_0x4f44ff){var _0x4ad7bf={},_0x292808={},_0x3a2780={'count':0x0,'rows':[]};var _0x4f95f0=_[_0x4d91('0x34')](db[_0x4d91('0x35')][_0x4d91('0x36')],function(_0x2be3f5){return{'name':_0x2be3f5[_0x4d91('0x37')],'type':_0x2be3f5['type'][_0x4d91('0x38')]};});_0x292808[_0x4d91('0x39')]=_[_0x4d91('0x34')](_0x4f95f0,_0x4d91('0x32'));_0x292808[_0x4d91('0x3a')]=_[_0x4d91('0x3b')](_0x82f585['query']);_0x292808[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x292808['model'],_0x292808[_0x4d91('0x3a')]);_0x4ad7bf[_0x4d91('0x3e')]=_[_0x4d91('0x3d')](_0x292808['model'],qs[_0x4d91('0x3f')](_0x82f585[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x4ad7bf[_0x4d91('0x3e')]=_0x4ad7bf['attributes'][_0x4d91('0x40')]?_0x4ad7bf[_0x4d91('0x3e')]:_0x292808[_0x4d91('0x39')];if(!_0x82f585[_0x4d91('0x3a')]['hasOwnProperty']('nolimit')){_0x4ad7bf[_0x4d91('0x25')]=qs[_0x4d91('0x25')](_0x82f585['query'][_0x4d91('0x25')]);_0x4ad7bf[_0x4d91('0x23')]=qs[_0x4d91('0x23')](_0x82f585[_0x4d91('0x3a')]['offset']);}_0x4ad7bf[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x82f585['query'][_0x4d91('0x42')]);_0x4ad7bf['where']=qs[_0x4d91('0x3c')](_['pick'](_0x82f585[_0x4d91('0x3a')],_0x292808['filters']),_0x4f95f0);if(_0x82f585[_0x4d91('0x3a')][_0x4d91('0x43')]){_0x4ad7bf[_0x4d91('0x44')]=_[_0x4d91('0x45')](_0x4ad7bf['where'],{'$or':_['map'](_0x4f95f0,function(_0x25e0f5){if(_0x25e0f5['type']!==_0x4d91('0x46')){var _0x282d64={};_0x282d64[_0x25e0f5['name']]={'$like':'%'+_0x82f585[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x282d64;}})});}_0x4ad7bf=_[_0x4d91('0x45')]({},_0x4ad7bf,_0x82f585[_0x4d91('0x47')]);var _0x1c6d0b={'where':_0x4ad7bf[_0x4d91('0x44')]};return db[_0x4d91('0x35')]['count'](_0x1c6d0b)[_0x4d91('0x2c')](function(_0x4c70af){_0x3a2780[_0x4d91('0x26')]=_0x4c70af;if(_0x82f585[_0x4d91('0x3a')][_0x4d91('0x48')]){_0x4ad7bf[_0x4d91('0x49')]=[{'all':!![]}];}return db[_0x4d91('0x35')][_0x4d91('0x4a')](_0x4ad7bf);})['then'](function(_0x4ffc08){_0x3a2780[_0x4d91('0x4b')]=_0x4ffc08;return _0x3a2780;})[_0x4d91('0x2c')](respondWithFilteredResult(_0x4f44ff,_0x4ad7bf))['catch'](handleError(_0x4f44ff,null));};exports[_0x4d91('0x4c')]=function(_0x164658,_0x342de1){var _0x3f8659={'raw':![],'where':{'id':_0x164658[_0x4d91('0x4d')]['id']}},_0x31f21a={};_0x31f21a[_0x4d91('0x39')]=_[_0x4d91('0x3b')](db[_0x4d91('0x35')]['rawAttributes']);_0x31f21a['query']=_[_0x4d91('0x3b')](_0x164658['query']);_0x31f21a[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x31f21a[_0x4d91('0x39')],_0x31f21a[_0x4d91('0x3a')]);_0x3f8659['attributes']=_[_0x4d91('0x3d')](_0x31f21a['model'],qs['fields'](_0x164658[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x3f8659[_0x4d91('0x3e')]=_0x3f8659[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x3f8659[_0x4d91('0x3e')]:_0x31f21a['model'];if(_0x164658[_0x4d91('0x3a')][_0x4d91('0x48')]){_0x3f8659[_0x4d91('0x49')]=[{'all':!![]}];}_0x3f8659=_[_0x4d91('0x45')]({},_0x3f8659,_0x164658[_0x4d91('0x47')]);return db[_0x4d91('0x35')][_0x4d91('0x4e')](_0x3f8659)[_0x4d91('0x2c')](handleEntityNotFound(_0x342de1,null))[_0x4d91('0x2c')](respondWithResult(_0x342de1,null))[_0x4d91('0x4f')](handleError(_0x342de1,null));};exports[_0x4d91('0x2b')]=function(_0x5a67fa,_0xa5c630){return db['VoicePrefix'][_0x4d91('0x4e')]({'where':{'id':_0x5a67fa[_0x4d91('0x4d')]['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0xa5c630,null))[_0x4d91('0x2c')](removeEntity(_0xa5c630,null))[_0x4d91('0x4f')](handleError(_0xa5c630,null));};exports[_0x4d91('0x50')]=function(_0x3028b1,_0x22b341){return db['VoicePrefix'][_0x4d91('0x50')]()[_0x4d91('0x2c')](respondWithResult(_0x22b341,null))[_0x4d91('0x4f')](handleError(_0x22b341,null));};exports[_0x4d91('0x51')]=function(_0x26ecd7,_0x19e57e){var _0x5765ce;return db['sequelize'][_0x4d91('0x52')](function(_0x2159e4){return db[_0x4d91('0x35')][_0x4d91('0x51')](_0x26ecd7[_0x4d91('0x53')],{'transaction':_0x2159e4})[_0x4d91('0x2c')](function(_0x2875f4){_0x5765ce=_0x2875f4[_0x4d91('0x54')]({'plain':!![]});return db[_0x4d91('0x55')][_0x4d91('0x4e')]({'where':{'id':_0x5765ce[_0x4d91('0x56')]},'raw':!![]})[_0x4d91('0x2c')](function(_0x280c41){return createVoicePrefixExtensions(_0x5765ce,_0x280c41,_0x2159e4);});});})[_0x4d91('0x2c')](function(){var _0x3e9154=_0x26ecd7[_0x4d91('0x57')][_0x4d91('0x54')]({'plain':!![]});if(!_0x3e9154)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9154['role']==='user'){var _0x45cf4e=_0x5765ce;return db[_0x4d91('0x58')][_0x4d91('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9154[_0x4d91('0x59')]},'raw':!![]})[_0x4d91('0x2c')](function(_0x3985f3){if(_0x3985f3&&_0x3985f3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x45cf4e[_0x4d91('0x32')],'resourceId':_0x45cf4e['id'],'type':_0x3985f3[_0x4d91('0x32')],'sectionId':_0x3985f3['id']},{})[_0x4d91('0x2c')](function(){return _0x5765ce;});}else{return _0x5765ce;}})[_0x4d91('0x4f')](function(_0x31d6e5){logger['error'](_0x4d91('0x5a'),_0x31d6e5);throw _0x31d6e5;});}return _0x5765ce;})[_0x4d91('0x2c')](respondWithResult(_0x19e57e,null))['catch'](handleError(_0x19e57e,null));};function Extension(_0x563558,_0x3f4f24,_0x544711,_0x3fda50){this[_0x4d91('0x5b')]=_0x4d91('0x5c');this['exten']=_0x563558;this[_0x4d91('0x5d')]=_0x544711;this[_0x4d91('0x5e')]=_0x4d91('0x5f');this[_0x4d91('0x60')]=_0x4d91('0x61');this[_0x4d91('0x62')]=_0x3f4f24;this[_0x4d91('0x63')]=_0x3fda50;}function createVoicePrefixExtensions(_0x524b4f,_0x533572,_0x5eeba8){return new BPromise(function(_0x4bd66d,_0x83395){var _0x8d6db2=new Extension(formatPrefixName(_0x524b4f[_0x4d91('0x64')]),0x1,'NoOp',_0x4d91('0x65'));_0x8d6db2['VoicePrefixId']=_0x524b4f['id'];return db[_0x4d91('0x55')][_0x4d91('0x51')](_0x8d6db2,{'transaction':_0x5eeba8})['then'](function(_0x51a594){var _0x1a707f=_0x51a594[_0x4d91('0x54')]({'plain':!![]});var _0x31150f=_[_0x4d91('0x34')](addVoicePrefixExtensions(_0x524b4f,_0x533572),function(_0x24661a){_0x24661a[_0x4d91('0x56')]=_0x1a707f['id'];_0x24661a[_0x4d91('0x66')]=_0x524b4f['id'];return _0x24661a;});return db[_0x4d91('0x55')][_0x4d91('0x67')](_0x31150f,{'transaction':_0x5eeba8})[_0x4d91('0x2c')](function(_0x5bfb08){if(!_0x5bfb08){return _0x83395('Extensions\x20creation\x20failed');}else{return _0x4bd66d(_0x5bfb08);}})[_0x4d91('0x4f')](function(_0x7e26c2){return _0x83395(_0x7e26c2);});});;});};function addVoicePrefixExtensions(_0x2049ca,_0x13281d){var _0x16ba26=[];var _0x16d384=formatPrefixName(_0x2049ca[_0x4d91('0x64')]);_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x2,_0x4d91('0x69'),'CDR(prefix)='+_0x2049ca['name']));if(_0x2049ca['callerIdAll']){_0x16ba26['push'](new Extension(_0x16d384,0x3,_0x4d91('0x69'),_0x4d91('0x6a')+_0x2049ca[_0x4d91('0x6b')]));}else{_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x3,_0x4d91('0x6c'),_0x4d91('0x6d')));}_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x4,_0x4d91('0x6e'),_0x13281d[_0x4d91('0x5b')]+','+_0x4d91('0x6f')+(0x8+_0x2049ca[_0x4d91('0x32')][_0x4d91('0x40')])+'}'+','+0x1));return _0x16ba26;}function formatPrefixName(_0x4444a2){var _0xef787='_';for(var _0x3bc828=0x0;_0x3bc828<_0x4444a2[_0x4d91('0x40')];_0x3bc828++){if(_0x4444a2[_0x4d91('0x70')](_0x3bc828)=='-'){_0xef787+=_0x4444a2['charAt'](_0x3bc828);}else{_0xef787+='['+_0x4444a2[_0x4d91('0x70')](_0x3bc828)+']';}}_0xef787+='.';return _0xef787;}exports[_0x4d91('0x71')]=function(_0xc4ef10,_0x2e2105,_0x1cad5b){var _0x5ab447=_0xc4ef10[_0x4d91('0x53')];_0x5ab447[_0x4d91('0x64')]='system-'+_0x5ab447[_0x4d91('0x32')]+'-';return db[_0x4d91('0x72')][_0x4d91('0x52')](function(_0xa469a4){return db[_0x4d91('0x35')]['update'](_0x5ab447,{'where':{'id':_0x5ab447['id']},'transaction':_0xa469a4})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x55')]['destroy']({'where':{'VoicePrefixId':_0x5ab447['id']},'transaction':_0xa469a4})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x55')][_0x4d91('0x4e')]({'where':{'id':_0x5ab447['VoiceExtensionId']},'raw':!![]})[_0x4d91('0x2c')](function(_0x403e0c){return createVoicePrefixExtensions(_0x5ab447,_0x403e0c,_0xa469a4);});});});})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x35')][_0x4d91('0x73')](_0x5ab447['id']);})[_0x4d91('0x2c')](respondWithResult(_0x2e2105,null))[_0x4d91('0x4f')](handleError(_0x2e2105,null));};exports['addAgents']=function(_0xdbb484,_0x2e014b,_0x4e7994){return db[_0x4d91('0x35')]['find']({'where':{'id':_0xdbb484['params']['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0x2e014b,null))['then'](function(_0x1a5376){if(_0x1a5376){return _0x1a5376[_0x4d91('0x74')](_0xdbb484[_0x4d91('0x53')][_0x4d91('0x75')],_[_0x4d91('0x76')](_0xdbb484[_0x4d91('0x53')],[_0x4d91('0x75'),'id'])||{})['spread'](function(_0x485da1){for(var _0x1c27e7=0x0;_0x1c27e7<_0xdbb484[_0x4d91('0x53')][_0x4d91('0x75')][_0x4d91('0x40')];_0x1c27e7+=0x1){socket[_0x4d91('0x77')]('userVoicePrefix:save',{'UserId':Number(_0xdbb484['body'][_0x4d91('0x75')][_0x1c27e7]),'VoicePrefixId':Number(_0xdbb484['params']['id'])});}return _0x485da1;});}})['then'](respondWithResult(_0x2e014b,null))[_0x4d91('0x4f')](handleError(_0x2e014b,null));};exports['removeAgents']=function(_0x585a8d,_0x216c33,_0x1b813c){return db[_0x4d91('0x35')]['find']({'where':{'id':_0x585a8d['params']['id']}})['then'](handleEntityNotFound(_0x216c33,null))[_0x4d91('0x2c')](function(_0x8d84f3){if(_0x8d84f3){return _0x8d84f3[_0x4d91('0x78')](_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')])[_0x4d91('0x2c')](function(){if(_[_0x4d91('0x79')](_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')])){for(var _0x542f58=0x0;_0x542f58<_0x585a8d[_0x4d91('0x3a')]['ids']['length'];_0x542f58+=0x1){socket[_0x4d91('0x77')](_0x4d91('0x7a'),{'UserId':Number(_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')][_0x542f58]),'VoicePrefixId':Number(_0x585a8d['params']['id'])});}}else{socket[_0x4d91('0x77')](_0x4d91('0x7a'),{'UserId':Number(_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')]),'VoicePrefixId':Number(_0x585a8d[_0x4d91('0x4d')]['id'])});}});}})[_0x4d91('0x2c')](respondWithStatusCode(_0x216c33,null))[_0x4d91('0x4f')](handleError(_0x216c33,null));};exports['getAgents']=function(_0x28322e,_0x24376e,_0x7bc606){var _0x49d81c={};var _0xc37e2e={};var _0x45a628;var _0x2cf518;return db[_0x4d91('0x35')][_0x4d91('0x7b')]({'where':{'id':_0x28322e[_0x4d91('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24376e,null))[_0x4d91('0x2c')](function(_0x582bee){if(_0x582bee){_0x45a628=_0x582bee;_0xc37e2e[_0x4d91('0x39')]=_['keys'](db[_0x4d91('0x7c')][_0x4d91('0x36')]);_0xc37e2e['query']=_['keys'](_0x28322e['query']);_0xc37e2e[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0xc37e2e[_0x4d91('0x39')],_0xc37e2e[_0x4d91('0x3a')]);_0x49d81c[_0x4d91('0x3e')]=_['intersection'](_0xc37e2e['model'],qs[_0x4d91('0x3f')](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x49d81c[_0x4d91('0x3e')]=_0x49d81c[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x49d81c[_0x4d91('0x3e')]:_0xc37e2e['model'];_0x49d81c[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x42')]);_0x49d81c[_0x4d91('0x44')]=qs[_0x4d91('0x3c')](_[_0x4d91('0x7d')](_0x28322e[_0x4d91('0x3a')],_0xc37e2e[_0x4d91('0x3c')]));if(_0x28322e['query'][_0x4d91('0x43')]){_0x49d81c[_0x4d91('0x44')]=_[_0x4d91('0x45')](_0x49d81c[_0x4d91('0x44')],{'$or':_[_0x4d91('0x34')](_0x49d81c[_0x4d91('0x3e')],function(_0x4682a8){var _0x51a30d={};_0x51a30d[_0x4682a8]={'$like':'%'+_0x28322e[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x51a30d;})});}_0x49d81c=_['merge']({},_0x49d81c,_0x28322e[_0x4d91('0x47')]);return _0x45a628[_0x4d91('0x7e')](_0x49d81c);}})['then'](function(_0x22cd5a){if(_0x22cd5a){_0x2cf518=_0x22cd5a[_0x4d91('0x40')];if(!_0x28322e[_0x4d91('0x3a')][_0x4d91('0x7f')](_0x4d91('0x80'))){_0x49d81c[_0x4d91('0x25')]=qs['limit'](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x25')]);_0x49d81c[_0x4d91('0x23')]=qs[_0x4d91('0x23')](_0x28322e[_0x4d91('0x3a')]['offset']);}return _0x45a628[_0x4d91('0x7e')](_0x49d81c);}})[_0x4d91('0x2c')](function(_0x3b0ab3){if(_0x3b0ab3){return _0x3b0ab3?{'count':_0x2cf518,'rows':_0x3b0ab3}:null;}})[_0x4d91('0x2c')](respondWithResult(_0x24376e,null))[_0x4d91('0x4f')](handleError(_0x24376e,null));};exports[_0x4d91('0x81')]=function(_0x18f844,_0x3e93d0,_0x53d973){var _0x367c30={};var _0x28b505={};var _0x451e14;var _0x37fe62;return db[_0x4d91('0x35')][_0x4d91('0x7b')]({'where':{'id':_0x18f844[_0x4d91('0x4d')]['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0x3e93d0,null))[_0x4d91('0x2c')](function(_0x5abc1d){if(_0x5abc1d){_0x451e14=_0x5abc1d;_0x28b505[_0x4d91('0x39')]=_[_0x4d91('0x3b')](db[_0x4d91('0x82')][_0x4d91('0x36')]);_0x28b505['query']=_['keys'](_0x18f844[_0x4d91('0x3a')]);_0x28b505[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x28b505[_0x4d91('0x39')],_0x28b505['query']);_0x367c30[_0x4d91('0x3e')]=_[_0x4d91('0x3d')](_0x28b505[_0x4d91('0x39')],qs[_0x4d91('0x3f')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x367c30[_0x4d91('0x3e')]=_0x367c30[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x367c30['attributes']:_0x28b505[_0x4d91('0x39')];_0x367c30[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x42')]);_0x367c30[_0x4d91('0x44')]=qs[_0x4d91('0x3c')](_[_0x4d91('0x7d')](_0x18f844[_0x4d91('0x3a')],_0x28b505[_0x4d91('0x3c')]));if(_0x18f844[_0x4d91('0x3a')][_0x4d91('0x43')]){_0x367c30['where']=_[_0x4d91('0x45')](_0x367c30[_0x4d91('0x44')],{'$or':_[_0x4d91('0x34')](_0x367c30[_0x4d91('0x3e')],function(_0x3e57a1){var _0x41fbc7={};_0x41fbc7[_0x3e57a1]={'$like':'%'+_0x18f844[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x41fbc7;})});}_0x367c30=_[_0x4d91('0x45')]({},_0x367c30,_0x18f844[_0x4d91('0x47')]);return _0x451e14[_0x4d91('0x81')](_0x367c30);}})[_0x4d91('0x2c')](function(_0x5a241a){if(_0x5a241a){_0x37fe62=_0x5a241a['length'];if(!_0x18f844[_0x4d91('0x3a')]['hasOwnProperty'](_0x4d91('0x80'))){_0x367c30[_0x4d91('0x25')]=qs[_0x4d91('0x25')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x25')]);_0x367c30[_0x4d91('0x23')]=qs['offset'](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x23')]);}return _0x451e14[_0x4d91('0x81')](_0x367c30);}})[_0x4d91('0x2c')](function(_0x1419c5){if(_0x1419c5){return _0x1419c5?{'count':_0x37fe62,'rows':_0x1419c5}:null;}})[_0x4d91('0x2c')](respondWithResult(_0x3e93d0,null))[_0x4d91('0x4f')](handleError(_0x3e93d0,null));};exports[_0x4d91('0x83')]=function(_0x47cbca,_0x1df276,_0x3e2771){var _0x15d270=_0x47cbca[_0x4d91('0x53')][_0x4d91('0x75')];var _0x17e3bc;return db[_0x4d91('0x82')][_0x4d91('0x4a')]({'where':{'id':_0x15d270},'attributes':['id'],'include':[{'model':db[_0x4d91('0x7c')],'as':_0x4d91('0x84'),'attributes':['id','name',_0x4d91('0x85'),_0x4d91('0x86'),'interface'],'raw':!![]}]})[_0x4d91('0x2c')](function(_0x1f836b){if(_0x1f836b){_0x17e3bc=_0x1f836b;var _0x455dd6=_['flatMap'](_0x1f836b,function(_0x46ccf4){var _0xcc22a2=_0x46ccf4['get']({'plain':!![]});return _0xcc22a2['Agents'];});return db[_0x4d91('0x35')][_0x4d91('0x4e')]({'where':{'id':_0x47cbca[_0x4d91('0x4d')]['id']}})['then'](function(_0x352e84){return db[_0x4d91('0x72')][_0x4d91('0x52')](function(_0x3b2e36){return _0x352e84[_0x4d91('0x83')](_0x15d270,{'transaction':_0x3b2e36})[_0x4d91('0x2c')](function(){return BPromise[_0x4d91('0x87')](_0x17e3bc,function(_0x185ded){return db[_0x4d91('0x88')][_0x4d91('0x89')]({'TeamId':_0x185ded['id'],'VoicePrefixId':_0x47cbca[_0x4d91('0x4d')]['id']},{'transaction':_0x3b2e36});});})['then'](function(){return BPromise[_0x4d91('0x87')](_0x455dd6,function(_0x2a9069){return db[_0x4d91('0x8a')][_0x4d91('0x8b')]({'where':{'UserId':_0x2a9069['id'],'VoicePrefixId':_0x47cbca[_0x4d91('0x4d')]['id']},'transaction':_0x3b2e36});});})[_0x4d91('0x2c')](function(){_0x455dd6[_0x4d91('0x8c')](function(_0xb67bd3){socket[_0x4d91('0x77')](_0x4d91('0x8d'),{'UserId':_0xb67bd3['id'],'VoicePrefixId':_0x352e84['id']});});});});});}})[_0x4d91('0x2c')](respondWithStatusCode(_0x1df276,null))[_0x4d91('0x4f')](handleError(_0x1df276,null));};exports[_0x4d91('0x8e')]=function(_0xbadba4,_0xe88619,_0x44f21b){return db[_0x4d91('0x82')]['findAll']({'where':{'id':_0xbadba4['query'][_0x4d91('0x75')]},'attributes':['id'],'include':[{'model':db[_0x4d91('0x7c')],'as':_0x4d91('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe88619,null))[_0x4d91('0x2c')](function(_0x2882d5){var _0x2678e7=_[_0x4d91('0x34')](_0x2882d5,'id');var _0x236a61=[];var _0x54f720=[];var _0x5f2ce4=squel['select']();_0x5f2ce4['field'](_0x4d91('0x8f'))[_0x4d91('0x90')]('team_has_voice_prefixes','tq')[_0x4d91('0x91')](_0x4d91('0x92'),'ut',_0x4d91('0x93'))['where'](_0x4d91('0x94'),_0xbadba4[_0x4d91('0x4d')]['id']);for(var _0x237074=0x0;_0x237074<_0x2882d5['length'];_0x237074+=0x1){let _0x3b4804=_0x2882d5[_0x237074];for(var _0x20212f=0x0;_0x20212f<_0x3b4804[_0x4d91('0x84')][_0x4d91('0x40')];_0x20212f+=0x1){let _0x39de93=_0x3b4804['Agents'][_0x20212f];var _0xe60b6=_0x5f2ce4[_0x4d91('0x95')]();_0xe60b6[_0x4d91('0x44')](_0x4d91('0x96'),_0x39de93['id']);_0x54f720['push'](db[_0x4d91('0x72')][_0x4d91('0x3a')](_0xe60b6[_0x4d91('0x97')](),{'type':db[_0x4d91('0x72')][_0x4d91('0x98')][_0x4d91('0x99')]})['then'](function(_0x12e226){if(_0x12e226[_0x4d91('0x40')]===0x1){return _0x39de93['id'];}else{var _0x448a12=_[_0x4d91('0x9a')](_[_0x4d91('0x34')](_0x12e226,_0x4d91('0x9b')),function(_0x2c5ccc){return _['includes'](_0x2678e7,_0x2c5ccc);});if(_0x448a12){return _0x39de93['id'];}}}));}}return BPromise['all'](_0x54f720)[_0x4d91('0x2c')](function(_0x4026b3){_0x236a61=_(_0x236a61)[_0x4d91('0x9c')](_0x4026b3)[_0x4d91('0x9d')]()[_0x4d91('0x9e')]();return db[_0x4d91('0x35')]['find']({'where':{'id':_0xbadba4[_0x4d91('0x4d')]['id']}})['then'](function(_0x3e23df){return db[_0x4d91('0x72')]['transaction'](function(_0x9d7ff1){return _0x3e23df[_0x4d91('0x8e')](_0xbadba4['query']['ids'],{'transaction':_0x9d7ff1})['then'](function(){if(!_[_0x4d91('0x9f')](_0x236a61)){return _0x3e23df['removeAgents'](_0x236a61,{'transaction':_0x9d7ff1});}})[_0x4d91('0x2c')](function(){_0x236a61[_0x4d91('0x8c')](function(_0x4da3b1){socket['emit'](_0x4d91('0x7a'),{'UserId':_0x4da3b1,'VoicePrefixId':_0x3e23df['id']});});});});});});})[_0x4d91('0x2c')](respondWithStatusCode(_0xe88619,null))[_0x4d91('0x4f')](handleError(_0xe88619,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index eee0431..f3e46dd 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 _0xa358=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x1414b3,_0x477031){var _0x5761ab=function(_0x4017cd){while(--_0x4017cd){_0x1414b3['push'](_0x1414b3['shift']());}};_0x5761ab(++_0x477031);}(_0xa358,0x133));var _0x8a35=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa358[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8a35('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8a35('0x1')](0x0);var events={'afterCreate':_0x8a35('0x2'),'afterUpdate':_0x8a35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x51d552){return function(_0x48080c,_0x4ebc1b,_0x3b5c00){VoicePrefixEvents[_0x8a35('0x4')](_0x51d552+':'+_0x48080c['id'],_0x48080c);VoicePrefixEvents['emit'](_0x51d552,_0x48080c);_0x3b5c00(null);};}for(var e in events){if(events[_0x8a35('0x5')](e)){var event=events[e];VoicePrefix[_0x8a35('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x155e=['save','update','remove','emit','hook','../../mysqldb'];(function(_0x2ce5e3,_0x429426){var _0xe1e73c=function(_0x4a1c38){while(--_0x4a1c38){_0x2ce5e3['push'](_0x2ce5e3['shift']());}};_0xe1e73c(++_0x429426);}(_0x155e,0x143));var _0xe155=function(_0x104811,_0x5a1e88){_0x104811=_0x104811-0x0;var _0xe11ec=_0x155e[_0x104811];return _0xe11ec;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xe155('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe155('0x1'),'afterUpdate':_0xe155('0x2'),'afterDestroy':_0xe155('0x3')};function emitEvent(_0x52fb6d){return function(_0x232a29,_0x34e8d2,_0x4550ba){VoicePrefixEvents[_0xe155('0x4')](_0x52fb6d+':'+_0x232a29['id'],_0x232a29);VoicePrefixEvents[_0xe155('0x4')](_0x52fb6d,_0x232a29);_0x4550ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xe155('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 14df299..353e51a 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 _0x66a1=['../../config/environment','./voicePrefix.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0xa8347,_0xfaaf22){var _0x5b4401=function(_0x1d6be8){while(--_0x1d6be8){_0xa8347['push'](_0xa8347['shift']());}};_0x5b4401(++_0xfaaf22);}(_0x66a1,0x1c7));var _0x166a=function(_0x2ff6d0,_0x5153dd){_0x2ff6d0=_0x2ff6d0-0x0;var _0xb65808=_0x66a1[_0x2ff6d0];return _0xb65808;};'use strict';var _=require(_0x166a('0x0'));var util=require(_0x166a('0x1'));var logger=require(_0x166a('0x2'))(_0x166a('0x3'));var moment=require('moment');var BPromise=require(_0x166a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x166a('0x5'));var rimraf=require(_0x166a('0x6'));var config=require(_0x166a('0x7'));var attributes=require(_0x166a('0x8'));module[_0x166a('0x9')]=function(_0x4a8009,_0x102b00){return _0x4a8009[_0x166a('0xa')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7eb=['moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xc7eb,0x8d));var _0xbc7e=function(_0x47bc5e,_0x6fc500){_0x47bc5e=_0x47bc5e-0x0;var _0x323a59=_0xc7eb[_0x47bc5e];return _0x323a59;};'use strict';var _=require('lodash');var util=require(_0xbc7e('0x0'));var logger=require(_0xbc7e('0x1'))(_0xbc7e('0x2'));var moment=require(_0xbc7e('0x3'));var BPromise=require(_0xbc7e('0x4'));var rp=require(_0xbc7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc7e('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc7e('0x7'));module[_0xbc7e('0x8')]=function(_0x2eb39b,_0x2a96d0){return _0x2eb39b[_0xbc7e('0x9')](_0xbc7e('0xa'),attributes,{'tableName':_0xbc7e('0xb'),'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 1851361..0e546f8 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 _0x229c=['util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x229c,0xcf));var _0xc229=function(_0x39e0c7,_0x5970c8){_0x39e0c7=_0x39e0c7-0x0;var _0x215cd9=_0x229c[_0x39e0c7];return _0x215cd9;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});config['redis']=_[_0xc229('0x7')](config[_0xc229('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc229('0x9'))(new Redis(config[_0xc229('0x8')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x1dc38f,_0x5a5d9b,_0x4abe4c){return new BPromise(function(_0x36263a,_0x1434a3){return client[_0xc229('0xa')](_0x1dc38f,_0x4abe4c)[_0xc229('0xb')](function(_0x25fd05){logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,_0xc229('0xe'));logger[_0xc229('0xf')](_0xc229('0x10'),_0x5a5d9b,_0xc229('0xe'),JSON[_0xc229('0x11')](_0x25fd05));if(_0x25fd05[_0xc229('0x12')]){if(_0x25fd05['error'][_0xc229('0x13')]===0x1f4){logger['error'](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x1434a3(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x36263a(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}else{logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,'request\x20sent');_0x36263a(_0x25fd05[_0xc229('0x15')][_0xc229('0x14')]);}})[_0xc229('0x16')](function(_0x193c75){logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x193c75);_0x1434a3(_0x193c75);});});} \ No newline at end of file +var _0x4753=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x495b10,_0x5ae303){var _0x4ce17c=function(_0x5b0727){while(--_0x5b0727){_0x495b10['push'](_0x495b10['shift']());}};_0x4ce17c(++_0x5ae303);}(_0x4753,0x1f4));var _0x3475=function(_0x81d747,_0x4ca94a){_0x81d747=_0x81d747-0x0;var _0x500251=_0x4753[_0x81d747];return _0x500251;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require(_0x3475('0x2'));var BPromise=require('bluebird');var rs=require(_0x3475('0x3'));var fs=require('fs');var Redis=require(_0x3475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3475('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3475('0x6')][_0x3475('0x7')]({'port':0x232a});config['redis']=_[_0x3475('0x8')](config[_0x3475('0x9')],{'host':_0x3475('0xa'),'port':0x18eb});var socket=require(_0x3475('0xb'))(new Redis(config[_0x3475('0x9')]));require(_0x3475('0xc'))[_0x3475('0xd')](socket);function respondWithRpcPromise(_0x2b9258,_0x14454e,_0xf56f7d){return new BPromise(function(_0x5a0fba,_0x30f276){return client[_0x3475('0xe')](_0x2b9258,_0xf56f7d)[_0x3475('0xf')](function(_0x4cb55a){logger[_0x3475('0x10')](_0x3475('0x11'),_0x14454e,'request\x20sent');logger[_0x3475('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x14454e,_0x3475('0x13'),JSON[_0x3475('0x14')](_0x4cb55a));if(_0x4cb55a[_0x3475('0x15')]){if(_0x4cb55a['error'][_0x3475('0x16')]===0x1f4){logger[_0x3475('0x15')](_0x3475('0x11'),_0x14454e,_0x4cb55a[_0x3475('0x15')]['message']);return _0x30f276(_0x4cb55a[_0x3475('0x15')]['message']);}logger['error'](_0x3475('0x11'),_0x14454e,_0x4cb55a[_0x3475('0x15')][_0x3475('0x17')]);return _0x5a0fba(_0x4cb55a[_0x3475('0x15')][_0x3475('0x17')]);}else{logger['info'](_0x3475('0x11'),_0x14454e,'request\x20sent');_0x5a0fba(_0x4cb55a[_0x3475('0x18')][_0x3475('0x17')]);}})[_0x3475('0x19')](function(_0x36a5b8){logger['error'](_0x3475('0x11'),_0x14454e,_0x36a5b8);_0x30f276(_0x36a5b8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 718ca41..d3821be 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 _0xd87e=['save','update','emit','removeListener','length','voicePrefix:','./voicePrefix.events'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xd87e,0x1bf));var _0xed87=function(_0x5366e7,_0x1b8be9){_0x5366e7=_0x5366e7-0x0;var _0x1b7106=_0xd87e[_0x5366e7];return _0x1b7106;};'use strict';var VoicePrefixEvents=require(_0xed87('0x0'));var events=[_0xed87('0x1'),'remove',_0xed87('0x2')];function createListener(_0x189fdd,_0x16509b){return function(_0x5901be){_0x16509b[_0xed87('0x3')](_0x189fdd,_0x5901be);};}function removeListener(_0x5e960f,_0x11a5d9){return function(){VoicePrefixEvents[_0xed87('0x4')](_0x5e960f,_0x11a5d9);};}exports['register']=function(_0x17adfe){for(var _0x589fb9=0x0,_0x5da793=events[_0xed87('0x5')];_0x589fb9<_0x5da793;_0x589fb9++){var _0x42fef6=events[_0x589fb9];var _0x33e1c1=createListener(_0xed87('0x6')+_0x42fef6,_0x17adfe);VoicePrefixEvents['on'](_0x42fef6,_0x33e1c1);}}; \ No newline at end of file +var _0x8278=['remove','update','emit','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require(_0x8827('0x0'));var events=[_0x8827('0x1'),_0x8827('0x2'),_0x8827('0x3')];function createListener(_0x4d6de2,_0x5be177){return function(_0x1b1dff){_0x5be177[_0x8827('0x4')](_0x4d6de2,_0x1b1dff);};}function removeListener(_0x9a5311,_0xf4c10){return function(){VoicePrefixEvents['removeListener'](_0x9a5311,_0xf4c10);};}exports[_0x8827('0x5')]=function(_0x4342d7){for(var _0x11797a=0x0,_0x31d236=events[_0x8827('0x6')];_0x11797a<_0x31d236;_0x11797a++){var _0xfb36a9=events[_0x11797a];var _0xb78af=createListener(_0x8827('0x7')+_0xfb36a9,_0x4342d7);VoicePrefixEvents['on'](_0xfb36a9,_0xb78af);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6205f55..65364a1 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(_0x23d494,_0x545dd9){var _0x7c8b34=function(_0x3333a4){while(--_0x3333a4){_0x23d494['push'](_0x23d494['shift']());}};_0x7c8b34(++_0x545dd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cd65a,_0x301f8f){_0x5cd65a=_0x5cd65a-0x0;var _0x1606f8=_0xb10b[_0x5cd65a];return _0x1606f8;};'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 3cbe1a0..497edda 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 _0x72dc=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default','ENUM','ringall','leastrecent','random','rrmemory','linear','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','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).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x72dc,0xc4));var _0xc72d=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0x72dc[_0x31dde9];return _0x1fbf2d;};'use strict';var Sequelize=require(_0xc72d('0x0'));module[_0xc72d('0x1')]={'name':{'type':Sequelize[_0xc72d('0x2')],'allowNull':![],'unique':_0xc72d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc72d('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xc72d('0x4')},'musiconhold':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':_0xc72d('0x5')},'announce':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc72d('0x6')]('rr',_0xc72d('0x7'),_0xc72d('0x8'),'fewestcalls',_0xc72d('0x9'),_0xc72d('0xa'),_0xc72d('0xb'),'wrandom',_0xc72d('0xc')),'allowNull':![],'defaultValue':_0xc72d('0x7'),'set':function(_0x5a24af){this[_0xc72d('0xd')]('strategy',_0x5a24af?_0x5a24af:_0xc72d('0xa'));},'get':function(){var _0x4ff9ab=this[_0xc72d('0xe')](_0xc72d('0xf'));var _0x38709f=this[_0xc72d('0xe')](_0xc72d('0x10'));var _0x1d821e=this[_0xc72d('0xe')](_0xc72d('0x11'));if(_0x4ff9ab===_0xc72d('0x4')){return _0x1d821e;}if(_0x38709f==='booked'&&_0x1d821e===_0xc72d('0xa')||_0x38709f===_0xc72d('0x12')&&_0x1d821e===_0xc72d('0x13')){return _0x1d821e;}if(_0x38709f==='progressive'||_0x38709f===_0xc72d('0x14')||_0x38709f===_0xc72d('0x15')){return _0x1d821e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc72d('0x16')](0xb)},'timeout':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc72d('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no'),'defaultValue':_0xc72d('0x17')},'autopause':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc72d('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xc72d('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc72d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xc72d('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xc72d('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc72d('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc72d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc72d('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xc72d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xc72d('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xc72d('0x19')],'set':function(_0x3dfeda){this[_0xc72d('0xd')](_0xc72d('0x1a'),_0x3dfeda?_0x3dfeda['join'](','):[]);},'get':function(){return this[_0xc72d('0xe')](_0xc72d('0x1a'))?this['getDataValue'](_0xc72d('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':'yes','set':function(_0x4af5e6){this[_0xc72d('0xd')](_0xc72d('0x1b'),_0x4af5e6?_0x4af5e6[_0xc72d('0x1c')](','):undefined);},'get':function(){return this[_0xc72d('0xe')]('joinempty')?this['getDataValue'](_0xc72d('0x1b'))[_0xc72d('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':'no','set':function(_0x2d90b4){this[_0xc72d('0xd')](_0xc72d('0x1e'),_0x2d90b4?_0x2d90b4[_0xc72d('0x1c')](','):undefined);},'get':function(){return this[_0xc72d('0xe')](_0xc72d('0x1e'))?this[_0xc72d('0xe')](_0xc72d('0x1e'))[_0xc72d('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xc72d('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc72d('0x2')]},'description':{'type':Sequelize[_0xc72d('0x2')]},'acw':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':0x0,'set':function(_0x112c49){this[_0xc72d('0xd')](_0xc72d('0x20'),_0x112c49);if(_0x112c49){if(this[_0xc72d('0xe')](_0xc72d('0x21'))<0x2){this['setDataValue'](_0xc72d('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc72d('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x22'),_0xc72d('0x23'),_0xc72d('0x15'),'predictive',_0xc72d('0x12')),'defaultValue':_0xc72d('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xc72d('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc72d('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xc72d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc72d('0x26')},'dialPowerLevel':{'type':Sequelize[_0xc72d('0x27')](0x2)[_0xc72d('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc72d('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xc72d('0x29'),_0xc72d('0x2a')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc72d('0x27')](0x2)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc72d('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc72d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc72d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':_0xc72d('0x2d'),'comment':_0xc72d('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x2f')},'dialQueueProject':{'type':Sequelize[_0xc72d('0x2')],'comment':_0xc72d('0x30')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)[_0xc72d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'comment':_0xc72d('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc72d('0x37')},'dialTimezone':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc72d('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc72d('0x6')](_0xc72d('0x38'),_0xc72d('0x39'),_0xc72d('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':0x0,'comment':_0xc72d('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc72d('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc72d('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc72d('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc72d('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc72d('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc72d('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc72d('0x16')](0x5)[_0xc72d('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc72d('0x16')](0x9)[_0xc72d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc72d('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xc72d('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc72d('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc72d('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc72d('0x6')]('DESC',_0xc72d('0x45')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xc72d('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc72d('0x46')},'dialCutDigit':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc72d('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)[_0xc72d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc72d('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc72d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc72d('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xc72d('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53c0af){if(!_0x53c0af)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc72d('0xd')](_0xc72d('0x50'),_0x53c0af);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xc72d('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xc72d('0x16')](0x3)[_0xc72d('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xc72d('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x294b=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','ENUM','STRING','default','ringall','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','inbound','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never'];(function(_0x151732,_0x82b764){var _0x1cda86=function(_0x2f8406){while(--_0x2f8406){_0x151732['push'](_0x151732['shift']());}};_0x1cda86(++_0x82b764);}(_0x294b,0x194));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));module[_0xb294('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb294('0x2')]('inbound','outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xb294('0x3')],'defaultValue':_0xb294('0x4')},'announce':{'type':Sequelize[_0xb294('0x3')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb294('0x5'),'leastrecent',_0xb294('0x6'),'random',_0xb294('0x7'),_0xb294('0x8'),_0xb294('0x9'),_0xb294('0xa')),'allowNull':![],'defaultValue':_0xb294('0x5'),'set':function(_0xfb643d){this[_0xb294('0xb')](_0xb294('0xc'),_0xfb643d?_0xfb643d:'rrmemory');},'get':function(){var _0x34d9d4=this[_0xb294('0xd')]('type');var _0xed31a5=this[_0xb294('0xd')](_0xb294('0xe'));var _0x2cdb01=this[_0xb294('0xd')](_0xb294('0xc'));if(_0x34d9d4===_0xb294('0xf')){return _0x2cdb01;}if(_0xed31a5==='booked'&&_0x2cdb01===_0xb294('0x7')||_0xed31a5===_0xb294('0x10')&&_0x2cdb01===_0xb294('0x11')){return _0x2cdb01;}if(_0xed31a5==='progressive'||_0xed31a5===_0xb294('0x12')||_0xed31a5===_0xb294('0x13')){return _0x2cdb01;}return null;}},'servicelevel':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb294('0x14')](0xb)},'timeout':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb294('0x3')]},'weight':{'type':Sequelize[_0xb294('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defaultValue':_0xb294('0x15')},'autopause':{'type':Sequelize[_0xb294('0x2')]('yes','no',_0xb294('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb294('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xb294('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb294('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb294('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb294('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb294('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb294('0x15'),'no'),'defaultValue':_0xb294('0x15')},'announce_holdtime':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no',_0xb294('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb294('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb294('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb294('0x3')]},'queue_youarenext':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb294('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb294('0x3')]},'queue_quantity1':{'type':Sequelize[_0xb294('0x3')]},'queue_quantity2':{'type':Sequelize[_0xb294('0x3')]},'queue_periodic_announce':{'type':Sequelize[_0xb294('0x3')]},'queue_less_than':{'type':Sequelize[_0xb294('0x3')]},'periodic_announce':{'type':Sequelize[_0xb294('0x18')],'set':function(_0x3e7a6f){this[_0xb294('0xb')]('periodic_announce',_0x3e7a6f?_0x3e7a6f['join'](','):[]);},'get':function(){return this[_0xb294('0xd')]('periodic_announce')?this[_0xb294('0xd')](_0xb294('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xb294('0x3')],'defaultValue':'yes','set':function(_0x556ee5){this['setDataValue'](_0xb294('0x1a'),_0x556ee5?_0x556ee5[_0xb294('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xb294('0x1a'))?this[_0xb294('0xd')](_0xb294('0x1a'))[_0xb294('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb294('0x3')],'defaultValue':'no','set':function(_0x4e27e6){this[_0xb294('0xb')](_0xb294('0x1d'),_0x4e27e6?_0x4e27e6['join'](','):undefined);},'get':function(){return this[_0xb294('0xd')](_0xb294('0x1d'))?this[_0xb294('0xd')]('leavewhenempty')[_0xb294('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb294('0x3')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xb294('0x1e')],'defaultValue':0x0,'set':function(_0x4dc184){this['setDataValue'](_0xb294('0x1f'),_0x4dc184);if(_0x4dc184){if(this[_0xb294('0xd')](_0xb294('0x20'))<0x2){this[_0xb294('0xb')](_0xb294('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb294('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb294('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xb294('0x21'),_0xb294('0x22'),'power',_0xb294('0x12'),'booked'),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xb294('0x14')](0x4)[_0xb294('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb294('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb294('0x24')},'dialPowerLevel':{'type':Sequelize[_0xb294('0x25')](0x2)[_0xb294('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xb294('0x26'),_0xb294('0x27')),'defaultValue':_0xb294('0x27'),'comment':_0xb294('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb294('0x25')](0x2)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb294('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb294('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb294('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb294('0x3')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb294('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xb294('0x3')],'defaultValue':_0xb294('0x2b'),'comment':_0xb294('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x2d')},'dialQueueProject':{'type':Sequelize[_0xb294('0x3')],'comment':_0xb294('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb294('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)[_0xb294('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb294('0x23')],'defaultValue':0x3,'comment':_0xb294('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb294('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb294('0x31')},'dialTimezone':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb294('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xb294('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb294('0x32'),_0xb294('0x33'),_0xb294('0x34')),'defaultValue':_0xb294('0x32')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb294('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xb294('0x14')](0x9)[_0xb294('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb294('0x36')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xb294('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb294('0x14')](0x9)[_0xb294('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb294('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb294('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb294('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0xb294('0x14')](0x9)[_0xb294('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb294('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb294('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb294('0x14')](0x5)[_0xb294('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb294('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb294('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb294('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xb294('0x14')](0x5)[_0xb294('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb294('0x3d')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb294('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb294('0x2')](_0xb294('0x3f'),_0xb294('0x40')),'defaultValue':_0xb294('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xb294('0x3')],'comment':_0xb294('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb294('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)[_0xb294('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb294('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb294('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)[_0xb294('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb294('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb294('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb294('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb294('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xb294('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xb294('0x1e')],'defaultValue':![],'comment':_0xb294('0x4a'),'set':function(_0x13af56){if(!_0x13af56)this[_0xb294('0xb')]('mandatoryDispositionPauseId',null);this[_0xb294('0xb')](_0xb294('0x4b'),_0x13af56);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb294('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xb294('0x14')](0x3)[_0xb294('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xb294('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9214197..7b3eccb 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 _0x90ec=['getHoppers','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueueRt','format','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','userVoiceQueue:save','online','isNil','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ListId','select','phone','ContactId','CmListId','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','scheduledAt','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','CmHopperId','OrderBy','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','offset','count','status','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','value','includes','type','find','name','UserProfileResource','send','index','map','VoiceQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','role','userProfileId'];(function(_0x505a6a,_0x26eb35){var _0x2f0202=function(_0x3b340f){while(--_0x3b340f){_0x505a6a['push'](_0x505a6a['shift']());}};_0x2f0202(++_0x26eb35);}(_0x90ec,0x1d4));var _0xc90e=function(_0x44af47,_0x596cf2){_0x44af47=_0x44af47-0x0;var _0x232cc9=_0x90ec[_0x44af47];return _0x232cc9;};'use strict';var emlformat=require(_0xc90e('0x0'));var rimraf=require(_0xc90e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc90e('0x2'));var rp=require(_0xc90e('0x3'));var moment=require(_0xc90e('0x4'));var BPromise=require(_0xc90e('0x5'));var Mustache=require(_0xc90e('0x6'));var util=require('util');var path=require(_0xc90e('0x7'));var sox=require(_0xc90e('0x8'));var csv=require(_0xc90e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc90e('0xa'));var _=require('lodash');var squel=require(_0xc90e('0xb'));var crypto=require(_0xc90e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc90e('0xd'));var toCsv=require(_0xc90e('0x9'));var querystring=require(_0xc90e('0xe'));var Papa=require(_0xc90e('0xf'));var Redis=require(_0xc90e('0x10'));var authService=require(_0xc90e('0x11'));var qs=require(_0xc90e('0x12'));var as=require(_0xc90e('0x13'));var hardwareService=require(_0xc90e('0x14'));var logger=require('../../config/logger')(_0xc90e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc90e('0x16')]=_[_0xc90e('0x17')](config['redis'],{'host':_0xc90e('0x18'),'port':0x18eb});var socket=require(_0xc90e('0x19'))(new Redis(config['redis']));require(_0xc90e('0x1a'))[_0xc90e('0x1b')](socket);function respondWithStatusCode(_0x274876,_0x2758bb){_0x2758bb=_0x2758bb||0xcc;return function(_0x1de265){if(_0x1de265){return _0x274876[_0xc90e('0x1c')](_0x2758bb);}return _0x274876['status'](_0x2758bb)[_0xc90e('0x1d')]();};}function respondWithResult(_0x2ada5a,_0x4ff295){_0x4ff295=_0x4ff295||0xc8;return function(_0xd16172){if(_0xd16172){return _0x2ada5a['status'](_0x4ff295)[_0xc90e('0x1e')](_0xd16172);}};}function respondWithFilteredResult(_0x153415,_0x558b22){return function(_0x934f8b){if(_0x934f8b){var _0xe0e0bc=typeof _0x558b22[_0xc90e('0x1f')]==='undefined'&&typeof _0x558b22['limit']==='undefined';var _0x161a3a=_0x934f8b[_0xc90e('0x20')];var _0x25b1d7=_0xe0e0bc?0x0:_0x558b22[_0xc90e('0x1f')];var _0x8fb1ef=_0xe0e0bc?_0x934f8b['count']:_0x558b22[_0xc90e('0x1f')]+_0x558b22['limit'];var _0x3ae806;if(_0x8fb1ef>=_0x161a3a){_0x8fb1ef=_0x161a3a;_0x3ae806=0xc8;}else{_0x3ae806=0xce;}_0x153415[_0xc90e('0x21')](_0x3ae806);return _0x153415['set'](_0xc90e('0x22'),_0x25b1d7+'-'+_0x8fb1ef+'/'+_0x161a3a)[_0xc90e('0x1e')](_0x934f8b);}return null;};}function patchUpdates(_0x957d1e){return function(_0x114042){try{jsonpatch[_0xc90e('0x23')](_0x114042,_0x957d1e,!![]);}catch(_0x282c53){return BPromise[_0xc90e('0x24')](_0x282c53);}return _0x114042[_0xc90e('0x25')]();};}function saveUpdates(_0x1cff73,_0x52aa00){return function(_0x1d700a){if(_0x1d700a){return _0x1d700a[_0xc90e('0x26')](_0x1cff73)[_0xc90e('0x27')](function(_0x380f3f){return _0x380f3f;});}return null;};}function removeEntity(_0x3371aa,_0x59d731){return function(_0x2e4d0c){if(_0x2e4d0c){return _0x2e4d0c[_0xc90e('0x28')]()[_0xc90e('0x27')](function(){var _0x4fde04=_0x2e4d0c[_0xc90e('0x29')]({'plain':!![]});var _0x2ea6e6=[{'name':_0xc90e('0x2a'),'value':_0xc90e('0x2b'),'ignore':![]},{'name':_0xc90e('0x2c'),'value':_0xc90e('0x2d'),'ignore':![]}];var _0x5ab0af=_(_0x2ea6e6)['filter'](_0xc90e('0x2e'))['map'](_0xc90e('0x2f'))[_0xc90e('0x2f')]();if(_[_0xc90e('0x30')](_0x5ab0af,_0x4fde04[_0xc90e('0x31')])){return;}var _0x2c9ced=_[_0xc90e('0x32')](_0x2ea6e6,[_0xc90e('0x2f'),_0x4fde04['type']])[_0xc90e('0x33')];return db[_0xc90e('0x34')]['destroy']({'where':{'type':_0x2c9ced,'resourceId':_0x4fde04['id']}})[_0xc90e('0x27')](function(){return _0x2e4d0c;});})['then'](function(){_0x3371aa[_0xc90e('0x21')](0xcc)[_0xc90e('0x1d')]();});}};}function handleEntityNotFound(_0xad857d,_0x3ecbc1){return function(_0x297498){if(!_0x297498){_0xad857d[_0xc90e('0x1c')](0x194);}return _0x297498;};}function handleError(_0xc65f5b,_0x14f534){_0x14f534=_0x14f534||0x1f4;return function(_0x89462e){logger['error'](_0x89462e['stack']);if(_0x89462e[_0xc90e('0x33')]){delete _0x89462e[_0xc90e('0x33')];}_0xc65f5b[_0xc90e('0x21')](_0x14f534)[_0xc90e('0x35')](_0x89462e);};}exports[_0xc90e('0x36')]=function(_0x314644,_0x5924fa){var _0x1f7d4c={},_0x42b216={},_0x186db4={'count':0x0,'rows':[]};var _0x4fc508=_[_0xc90e('0x37')](db[_0xc90e('0x38')][_0xc90e('0x39')],function(_0x437d26){return{'name':_0x437d26['fieldName'],'type':_0x437d26['type']['key']};});_0x42b216[_0xc90e('0x3a')]=_[_0xc90e('0x37')](_0x4fc508,_0xc90e('0x33'));_0x42b216[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x314644['query']);_0x42b216[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0x42b216[_0xc90e('0x3a')],_0x42b216[_0xc90e('0x3b')]);_0x1f7d4c[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x42b216[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x314644[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x1f7d4c[_0xc90e('0x3f')]=_0x1f7d4c[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x1f7d4c['attributes']:_0x42b216[_0xc90e('0x3a')];if(!_0x314644[_0xc90e('0x3b')]['hasOwnProperty']('nolimit')){_0x1f7d4c[_0xc90e('0x42')]=qs['limit'](_0x314644[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x1f7d4c['offset']=qs[_0xc90e('0x1f')](_0x314644['query']['offset']);}_0x1f7d4c[_0xc90e('0x43')]=qs['sort'](_0x314644['query'][_0xc90e('0x44')]);_0x1f7d4c[_0xc90e('0x45')]=qs['filters'](_[_0xc90e('0x46')](_0x314644[_0xc90e('0x3b')],_0x42b216[_0xc90e('0x3d')]),_0x4fc508);if(_0x314644[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x1f7d4c[_0xc90e('0x45')]=_[_0xc90e('0x48')](_0x1f7d4c[_0xc90e('0x45')],{'$or':_['map'](_0x4fc508,function(_0xd8113c){if(_0xd8113c['type']!=='VIRTUAL'){var _0x36f1f7={};_0x36f1f7[_0xd8113c['name']]={'$like':'%'+_0x314644[_0xc90e('0x3b')]['filter']+'%'};return _0x36f1f7;}})});}_0x1f7d4c=_[_0xc90e('0x48')]({},_0x1f7d4c,_0x314644[_0xc90e('0x49')]);var _0x15f492={'where':_0x1f7d4c[_0xc90e('0x45')]};return db[_0xc90e('0x38')][_0xc90e('0x20')](_0x15f492)[_0xc90e('0x27')](function(_0x260520){_0x186db4[_0xc90e('0x20')]=_0x260520;if(_0x314644['query'][_0xc90e('0x4a')]){_0x1f7d4c[_0xc90e('0x4b')]=[{'all':!![]}];}return db[_0xc90e('0x38')][_0xc90e('0x4c')](_0x1f7d4c);})['then'](function(_0x21408a){_0x186db4[_0xc90e('0x4d')]=_0x21408a;return _0x186db4;})[_0xc90e('0x27')](respondWithFilteredResult(_0x5924fa,_0x1f7d4c))['catch'](handleError(_0x5924fa,null));};exports[_0xc90e('0x4e')]=function(_0x49c8ab,_0x45f816){var _0x4c547c={'raw':![],'where':{'id':_0x49c8ab['params']['id']}},_0x130263={};_0x130263[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x38')][_0xc90e('0x39')]);_0x130263[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x49c8ab[_0xc90e('0x3b')]);_0x130263[_0xc90e('0x3d')]=_['intersection'](_0x130263[_0xc90e('0x3a')],_0x130263[_0xc90e('0x3b')]);_0x4c547c['attributes']=_['intersection'](_0x130263[_0xc90e('0x3a')],qs['fields'](_0x49c8ab[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x4c547c[_0xc90e('0x3f')]=_0x4c547c[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x4c547c['attributes']:_0x130263[_0xc90e('0x3a')];if(_0x49c8ab[_0xc90e('0x3b')]['includeAll']){_0x4c547c[_0xc90e('0x4b')]=[{'all':!![]}];}_0x4c547c=_['merge']({},_0x4c547c,_0x49c8ab[_0xc90e('0x49')]);return db['VoiceQueue'][_0xc90e('0x32')](_0x4c547c)[_0xc90e('0x27')](handleEntityNotFound(_0x45f816,null))[_0xc90e('0x27')](respondWithResult(_0x45f816,null))[_0xc90e('0x4f')](handleError(_0x45f816,null));};exports[_0xc90e('0x50')]=function(_0x3b8ec8,_0xa8b8b6){return db[_0xc90e('0x38')][_0xc90e('0x50')](_0x3b8ec8[_0xc90e('0x51')],{})[_0xc90e('0x27')](function(_0x38e86c){var _0x13f306=_0x3b8ec8[_0xc90e('0x52')][_0xc90e('0x29')]({'plain':!![]});if(!_0x13f306)throw new Error(_0xc90e('0x53'));if(_0x13f306['role']===_0xc90e('0x52')){var _0x1e0ef8=_0x38e86c[_0xc90e('0x29')]({'plain':!![]});var _0x2dadfe=[{'name':_0xc90e('0x2a'),'value':_0xc90e('0x2b')},{'name':_0xc90e('0x2c'),'value':'outbound'}];var _0x1ec7f2=_['find'](_0x2dadfe,[_0xc90e('0x2f'),_0x1e0ef8[_0xc90e('0x31')]])[_0xc90e('0x33')];return db[_0xc90e('0x54')][_0xc90e('0x32')]({'where':{'name':_0x1ec7f2,'userProfileId':_0x13f306['userProfileId']},'raw':!![]})[_0xc90e('0x27')](function(_0x26f06f){if(_0x26f06f&&_0x26f06f['autoAssociation']===0x0){return db[_0xc90e('0x34')][_0xc90e('0x50')]({'name':_0x1e0ef8[_0xc90e('0x33')],'resourceId':_0x1e0ef8['id'],'type':_0x26f06f[_0xc90e('0x33')],'sectionId':_0x26f06f['id']},{})['then'](function(){return _0x38e86c;});}else{return _0x38e86c;}})['catch'](function(_0x308b22){logger[_0xc90e('0x55')](_0xc90e('0x56'),_0x308b22);throw _0x308b22;});}return _0x38e86c;})[_0xc90e('0x27')](respondWithResult(_0xa8b8b6,0xc9))[_0xc90e('0x4f')](handleError(_0xa8b8b6,null));};exports['clone']=function(_0x3e8c0d,_0x40b61e){var _0x4aa069={'where':{'id':_0x3e8c0d[_0xc90e('0x57')]['id']}},_0x4a0f64={};_0x4a0f64[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x38')]['rawAttributes']);_0x4aa069[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x4a0f64[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x3e8c0d[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x4aa069[_0xc90e('0x3f')]=_0x4aa069[_0xc90e('0x3f')]['length']?_0x4aa069[_0xc90e('0x3f')]:_0x4a0f64[_0xc90e('0x3a')];if(_0x3e8c0d[_0xc90e('0x3b')][_0xc90e('0x4a')]){_0x4aa069[_0xc90e('0x4b')]=[{'all':!![]}];}_0x4aa069=_['merge']({},_0x4aa069,_0x3e8c0d[_0xc90e('0x49')]);return db[_0xc90e('0x38')][_0xc90e('0x32')](_0x4aa069)['then'](handleEntityNotFound(_0x40b61e,null))['then'](function(_0x31bca6){if(_0x31bca6){var _0x52691a=_0x31bca6[_0xc90e('0x29')]({'plain':!![]});_0x52691a=qs['omit'](_0x52691a,['id',_0xc90e('0x58'),_0xc90e('0x59')]);_0x3e8c0d[_0xc90e('0x51')]=_[_0xc90e('0x5a')](_0x3e8c0d[_0xc90e('0x51')],['id',_0xc90e('0x58'),_0xc90e('0x59')]);return db[_0xc90e('0x38')][_0xc90e('0x50')](_[_0xc90e('0x48')](_0x52691a,_0x3e8c0d[_0xc90e('0x51')]),{'include':_0x3e8c0d[_0xc90e('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0xc90e('0x27')](function(_0x511e33){var _0x5c4441=_0x3e8c0d['user']['get']({'plain':!![]});if(!_0x5c4441)throw new Error(_0xc90e('0x53'));if(_0x5c4441[_0xc90e('0x5b')]==='user'){var _0x5c6240=_0x511e33[_0xc90e('0x29')]({'plain':!![]});var _0x1e4477=[{'name':_0xc90e('0x2a'),'value':_0xc90e('0x2b')},{'name':_0xc90e('0x2c'),'value':'outbound'}];var _0x371ba6=_[_0xc90e('0x32')](_0x1e4477,[_0xc90e('0x2f'),_0x5c6240[_0xc90e('0x31')]])[_0xc90e('0x33')];return db[_0xc90e('0x54')]['find']({'where':{'name':_0x371ba6,'userProfileId':_0x5c4441[_0xc90e('0x5c')]},'raw':!![]})['then'](function(_0x1b92e3){if(_0x1b92e3&&_0x1b92e3['autoAssociation']===0x0){return db['UserProfileResource'][_0xc90e('0x50')]({'name':_0x5c6240[_0xc90e('0x33')],'resourceId':_0x5c6240['id'],'type':_0x1b92e3['name'],'sectionId':_0x1b92e3['id']},{})[_0xc90e('0x27')](function(){return _0x511e33;});}else{return _0x511e33;}})['catch'](function(_0x555e41){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x555e41);throw _0x555e41;});}return _0x511e33;});}})[_0xc90e('0x27')](respondWithResult(_0x40b61e,0xc9))[_0xc90e('0x4f')](handleError(_0x40b61e,null));};exports['update']=function(_0x104288,_0x115f53){if(_0x104288[_0xc90e('0x51')]['id']){delete _0x104288[_0xc90e('0x51')]['id'];}return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x104288[_0xc90e('0x57')]['id']}})['then'](handleEntityNotFound(_0x115f53,null))[_0xc90e('0x27')](saveUpdates(_0x104288[_0xc90e('0x51')],null))['then'](respondWithResult(_0x115f53,null))['catch'](handleError(_0x115f53,null));};exports[_0xc90e('0x28')]=function(_0x4c37ab,_0x4ce773){return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x4c37ab[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x4ce773,null))[_0xc90e('0x27')](removeEntity(_0x4ce773,null))[_0xc90e('0x4f')](handleError(_0x4ce773,null));};exports[_0xc90e('0x5d')]=function(_0x4a081e,_0x1225a4,_0x3eafba){var _0x56f2be={'raw':![],'where':{}};var _0x29619f={};var _0xefb790={'count':0x0,'rows':[]};return db[_0xc90e('0x38')]['findOne']({'where':{'id':_0x4a081e['params']['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x1225a4,null))['then'](function(_0x2db8af){if(_0x2db8af){_0x29619f[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x5e')]['rawAttributes']);_0x29619f[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x4a081e[_0xc90e('0x3b')]);_0x29619f[_0xc90e('0x3d')]=_['intersection'](_0x29619f[_0xc90e('0x3a')],_0x29619f['query']);_0x56f2be[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x29619f[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x4a081e[_0xc90e('0x3b')]['fields']));_0x56f2be[_0xc90e('0x3f')]=_0x56f2be[_0xc90e('0x3f')]['length']?_0x56f2be[_0xc90e('0x3f')]:_0x29619f[_0xc90e('0x3a')];if(!_0x4a081e[_0xc90e('0x3b')][_0xc90e('0x5f')](_0xc90e('0x60'))){_0x56f2be[_0xc90e('0x42')]=qs['limit'](_0x4a081e['query'][_0xc90e('0x42')]);_0x56f2be[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x4a081e[_0xc90e('0x3b')]['offset']);}_0x56f2be[_0xc90e('0x43')]=qs['sort'](_0x4a081e['query'][_0xc90e('0x44')]);_0x56f2be[_0xc90e('0x45')]=qs[_0xc90e('0x3d')](_['pick'](_0x4a081e[_0xc90e('0x3b')],_0x29619f[_0xc90e('0x3d')]));_0x56f2be[_0xc90e('0x45')][_0xc90e('0x61')]=_0x2db8af['id'];if(_0x4a081e[_0xc90e('0x3b')]['filter']){_0x56f2be[_0xc90e('0x45')]=_[_0xc90e('0x48')](_0x56f2be[_0xc90e('0x45')],{'$or':_[_0xc90e('0x37')](_0x56f2be[_0xc90e('0x3f')],function(_0x51eee0){var _0x4316c3={};_0x4316c3[_0x51eee0]={'$like':'%'+_0x4a081e[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x4316c3;})});}_0x56f2be=_[_0xc90e('0x48')]({},_0x56f2be,_0x4a081e['options']);return db[_0xc90e('0x5e')][_0xc90e('0x20')]({'where':_0x56f2be[_0xc90e('0x45')]})[_0xc90e('0x27')](function(_0x57b031){_0xefb790[_0xc90e('0x20')]=_0x57b031;if(_0x4a081e[_0xc90e('0x3b')][_0xc90e('0x4a')]){_0x56f2be[_0xc90e('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0xc90e('0x4c')](_0x56f2be);})['then'](function(_0x466275){_0xefb790[_0xc90e('0x4d')]=_0x466275;return _0xefb790;});}})['then'](respondWithFilteredResult(_0x1225a4,_0x56f2be))[_0xc90e('0x4f')](handleError(_0x1225a4,null));};exports[_0xc90e('0x62')]=function(_0x159835,_0x474b17,_0x169cf2){var _0x51c8c5={'raw':!![],'where':{}};var _0x1054dc={};var _0x1ffcab={'count':0x0,'rows':[]};return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x159835[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x474b17,null))[_0xc90e('0x27')](function(_0x20adcb){if(_0x20adcb){_0x1054dc[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x64')]['rawAttributes']);_0x1054dc[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x159835['query']);_0x1054dc['filters']=_[_0xc90e('0x3e')](_0x1054dc[_0xc90e('0x3a')],_0x1054dc['query']);_0x51c8c5['attributes']=_['intersection'](_0x1054dc['model'],qs['fields'](_0x159835[_0xc90e('0x3b')]['fields']));_0x51c8c5[_0xc90e('0x3f')]=_0x51c8c5[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x51c8c5['attributes']:_0x1054dc['model'];if(!_0x159835[_0xc90e('0x3b')][_0xc90e('0x5f')](_0xc90e('0x60'))){_0x51c8c5[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x159835['query'][_0xc90e('0x42')]);_0x51c8c5[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x159835['query'][_0xc90e('0x1f')]);}_0x51c8c5[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x159835['query'][_0xc90e('0x44')]);_0x51c8c5['where']=qs['filters'](_[_0xc90e('0x46')](_0x159835[_0xc90e('0x3b')],_0x1054dc[_0xc90e('0x3d')]));_0x51c8c5[_0xc90e('0x45')][_0xc90e('0x61')]=_0x20adcb['id'];if(_0x159835[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x51c8c5[_0xc90e('0x45')]=_[_0xc90e('0x48')](_0x51c8c5[_0xc90e('0x45')],{'$or':_[_0xc90e('0x37')](_0x51c8c5['attributes'],function(_0x2c01f5){var _0x5c12e2={};_0x5c12e2[_0x2c01f5]={'$like':'%'+_0x159835[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x5c12e2;})});}_0x51c8c5=_[_0xc90e('0x48')]({},_0x51c8c5,_0x159835['options']);return db[_0xc90e('0x64')][_0xc90e('0x20')]({'where':_0x51c8c5[_0xc90e('0x45')]})[_0xc90e('0x27')](function(_0x24735b){_0x1ffcab[_0xc90e('0x20')]=_0x24735b;if(_0x159835[_0xc90e('0x3b')][_0xc90e('0x4a')]){_0x51c8c5[_0xc90e('0x4b')]=[{'all':!![]}];}return db[_0xc90e('0x64')][_0xc90e('0x4c')](_0x51c8c5);})['then'](function(_0x104005){_0x1ffcab[_0xc90e('0x4d')]=_0x104005;return _0x1ffcab;});}})[_0xc90e('0x27')](respondWithFilteredResult(_0x474b17,_0x51c8c5))[_0xc90e('0x4f')](handleError(_0x474b17,null));};exports[_0xc90e('0x65')]=function(_0x2bedad,_0x3922f5,_0x393231){var _0x3fcfa7={'raw':!![],'where':{}};var _0x1d10eb={};var _0x590b13={'count':0x0,'rows':[]};return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x2bedad['params']['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x3922f5,null))[_0xc90e('0x27')](function(_0x29a281){if(_0x29a281){_0x1d10eb[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x66')]['rawAttributes']);_0x1d10eb[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x2bedad[_0xc90e('0x3b')]);_0x1d10eb[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0x1d10eb[_0xc90e('0x3a')],_0x1d10eb['query']);_0x3fcfa7[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x1d10eb[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x3fcfa7[_0xc90e('0x3f')]=_0x3fcfa7['attributes']['length']?_0x3fcfa7['attributes']:_0x1d10eb[_0xc90e('0x3a')];if(!_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x5f')]('nolimit')){_0x3fcfa7['limit']=qs[_0xc90e('0x42')](_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x3fcfa7[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x2bedad['query'][_0xc90e('0x1f')]);}_0x3fcfa7[_0xc90e('0x43')]=qs['sort'](_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x44')]);_0x3fcfa7[_0xc90e('0x45')]=qs[_0xc90e('0x3d')](_['pick'](_0x2bedad[_0xc90e('0x3b')],_0x1d10eb['filters']));_0x3fcfa7[_0xc90e('0x45')][_0xc90e('0x61')]=_0x29a281['id'];if(_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x3fcfa7['where']=_['merge'](_0x3fcfa7[_0xc90e('0x45')],{'$or':_[_0xc90e('0x37')](_0x3fcfa7[_0xc90e('0x3f')],function(_0x221bc4){var _0x20b6df={};_0x20b6df[_0x221bc4]={'$like':'%'+_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x20b6df;})});}_0x3fcfa7=_[_0xc90e('0x48')]({},_0x3fcfa7,_0x2bedad[_0xc90e('0x49')]);return db[_0xc90e('0x66')]['count']({'where':_0x3fcfa7[_0xc90e('0x45')]})[_0xc90e('0x27')](function(_0x1a2ad1){_0x590b13['count']=_0x1a2ad1;if(_0x2bedad[_0xc90e('0x3b')][_0xc90e('0x4a')]){_0x3fcfa7['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xc90e('0x4c')](_0x3fcfa7);})[_0xc90e('0x27')](function(_0x5626e1){_0x590b13[_0xc90e('0x4d')]=_0x5626e1;return _0x590b13;});}})['then'](respondWithFilteredResult(_0x3922f5,_0x3fcfa7))['catch'](handleError(_0x3922f5,null));};exports['getHopperBlacks']=function(_0x41febe,_0x40d552,_0x77d99a){var _0x350070={'raw':!![],'where':{}};var _0x337775={};var _0x5e004c={'count':0x0,'rows':[]};return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x41febe[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x40d552,null))['then'](function(_0x3ec332){if(_0x3ec332){_0x337775[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db[_0xc90e('0x67')]['rawAttributes']);_0x337775['query']=_[_0xc90e('0x3c')](_0x41febe[_0xc90e('0x3b')]);_0x337775[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0x337775[_0xc90e('0x3a')],_0x337775[_0xc90e('0x3b')]);_0x350070[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x337775[_0xc90e('0x3a')],qs['fields'](_0x41febe[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x350070[_0xc90e('0x3f')]=_0x350070[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x350070[_0xc90e('0x3f')]:_0x337775['model'];if(!_0x41febe[_0xc90e('0x3b')][_0xc90e('0x5f')](_0xc90e('0x60'))){_0x350070[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x41febe[_0xc90e('0x3b')]['limit']);_0x350070[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x41febe[_0xc90e('0x3b')]['offset']);}_0x350070[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x41febe[_0xc90e('0x3b')]['sort']);_0x350070[_0xc90e('0x45')]=qs['filters'](_[_0xc90e('0x46')](_0x41febe[_0xc90e('0x3b')],_0x337775[_0xc90e('0x3d')]));_0x350070[_0xc90e('0x45')]['VoiceQueueId']=_0x3ec332['id'];if(_0x41febe[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x350070[_0xc90e('0x45')]=_['merge'](_0x350070[_0xc90e('0x45')],{'$or':_['map'](_0x350070[_0xc90e('0x3f')],function(_0x4d7b5d){var _0x5b6ae5={};_0x5b6ae5[_0x4d7b5d]={'$like':'%'+_0x41febe[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x5b6ae5;})});}_0x350070=_[_0xc90e('0x48')]({},_0x350070,_0x41febe[_0xc90e('0x49')]);return db['CmHopperBlack']['count']({'where':_0x350070[_0xc90e('0x45')]})[_0xc90e('0x27')](function(_0xbf1725){_0x5e004c[_0xc90e('0x20')]=_0xbf1725;if(_0x41febe[_0xc90e('0x3b')][_0xc90e('0x4a')]){_0x350070[_0xc90e('0x4b')]=[{'all':!![]}];}return db[_0xc90e('0x67')]['findAll'](_0x350070);})['then'](function(_0x312306){_0x5e004c['rows']=_0x312306;return _0x5e004c;});}})[_0xc90e('0x27')](respondWithFilteredResult(_0x40d552,_0x350070))[_0xc90e('0x4f')](handleError(_0x40d552,null));};exports['getTeams']=function(_0x226701,_0x4bb7d2,_0x35fdea){var _0x476261={};var _0x4512fa={};var _0x5dfe4f;var _0x304616;return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x226701[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x4bb7d2,null))['then'](function(_0x5c81fc){if(_0x5c81fc){_0x5dfe4f=_0x5c81fc;_0x4512fa['model']=_[_0xc90e('0x3c')](db[_0xc90e('0x68')][_0xc90e('0x39')]);_0x4512fa[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x226701['query']);_0x4512fa[_0xc90e('0x3d')]=_['intersection'](_0x4512fa[_0xc90e('0x3a')],_0x4512fa[_0xc90e('0x3b')]);_0x476261[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x4512fa[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x226701[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x476261['attributes']=_0x476261[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x476261[_0xc90e('0x3f')]:_0x4512fa[_0xc90e('0x3a')];_0x476261[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x226701['query'][_0xc90e('0x44')]);_0x476261[_0xc90e('0x45')]=qs[_0xc90e('0x3d')](_[_0xc90e('0x46')](_0x226701[_0xc90e('0x3b')],_0x4512fa[_0xc90e('0x3d')]));if(_0x226701[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x476261['where']=_[_0xc90e('0x48')](_0x476261[_0xc90e('0x45')],{'$or':_['map'](_0x476261[_0xc90e('0x3f')],function(_0x569664){var _0x1a83af={};_0x1a83af[_0x569664]={'$like':'%'+_0x226701['query'][_0xc90e('0x47')]+'%'};return _0x1a83af;})});}_0x476261=_['merge']({},_0x476261,_0x226701[_0xc90e('0x49')]);return _0x5dfe4f[_0xc90e('0x69')](_0x476261);}})[_0xc90e('0x27')](function(_0x4966db){if(_0x4966db){_0x304616=_0x4966db['length'];if(!_0x226701[_0xc90e('0x3b')]['hasOwnProperty'](_0xc90e('0x60'))){_0x476261[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x226701[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x476261[_0xc90e('0x1f')]=qs['offset'](_0x226701['query'][_0xc90e('0x1f')]);}return _0x5dfe4f['getTeams'](_0x476261);}})[_0xc90e('0x27')](function(_0x3dd719){if(_0x3dd719){return _0x3dd719?{'count':_0x304616,'rows':_0x3dd719}:null;}})['then'](respondWithResult(_0x4bb7d2,null))[_0xc90e('0x4f')](handleError(_0x4bb7d2,null));};exports[_0xc90e('0x6a')]=function(_0x1c42ae,_0x4f4904,_0x59a7f1){var _0x1069d1=_0x1c42ae[_0xc90e('0x51')]['teams'];var _0x1a4883=_['map'](_0x1069d1,'id');return db[_0xc90e('0x68')][_0xc90e('0x4c')]({'where':{'id':_0x1a4883},'attributes':['id'],'include':[{'model':db[_0xc90e('0x6b')],'as':'Agents','attributes':['id',_0xc90e('0x33'),'online',_0xc90e('0x6c'),_0xc90e('0x6d')],'raw':!![]}]})['then'](function(_0x140331){if(_0x140331){var _0x4055e5=_[_0xc90e('0x6e')](_0x140331,function(_0xd85f0f){var _0x350c4a=_0xd85f0f['get']({'plain':!![]});_0x350c4a[_0xc90e('0x6f')][_0xc90e('0x70')](function(_0x2646c6){_0x2646c6[_0xc90e('0x71')]=_['find'](_0x1069d1,{'id':_0x350c4a['id']})['penalty'];});return _0x350c4a[_0xc90e('0x6f')];});return db['VoiceQueue'][_0xc90e('0x32')]({'where':{'id':_0x1c42ae[_0xc90e('0x57')]['id']}})['then'](function(_0x1204bd){return db[_0xc90e('0x72')][_0xc90e('0x73')](function(_0x8439c6){return _0x1204bd[_0xc90e('0x6a')](_0x1a4883,{'transaction':_0x8439c6})['then'](function(){return BPromise[_0xc90e('0x74')](_0x1069d1,function(_0x20f863){return db['TeamVoiceQueue'][_0xc90e('0x75')]({'TeamId':_0x20f863['id'],'VoiceQueueId':_0x1c42ae[_0xc90e('0x57')]['id'],'penalty':_0x20f863[_0xc90e('0x71')]},{'transaction':_0x8439c6});});})['then'](function(){return BPromise[_0xc90e('0x74')](_0x4055e5,function(_0x3195aa){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x3195aa['id'],'VoiceQueueId':_0x1c42ae['params']['id']},'defaults':{'penalty':_0x3195aa[_0xc90e('0x71')]},'transaction':_0x8439c6});});})[_0xc90e('0x27')](function(){return BPromise[_0xc90e('0x74')](_['filter'](_0x4055e5,{'online':!![]}),function(_0x3a4f74){return db[_0xc90e('0x76')][_0xc90e('0x75')]({'membername':_0x3a4f74[_0xc90e('0x33')],'UserId':_0x3a4f74['id'],'queue_name':_0x1204bd[_0xc90e('0x33')],'VoiceQueueId':_0x1204bd['id'],'interface':_['isNil'](_0x3a4f74[_0xc90e('0x6d')])?util[_0xc90e('0x77')]('SIP/%s',_0x3a4f74['name']):_0x3a4f74['interface'],'paused':_0x3a4f74[_0xc90e('0x6c')]||![],'penalty':_0x3a4f74[_0xc90e('0x71')]},{'transaction':_0x8439c6});});})[_0xc90e('0x27')](function(){_0x4055e5['forEach'](function(_0x1d50c1){socket['emit']('userVoiceQueue:save',{'UserId':_0x1d50c1['id'],'VoiceQueueId':_0x1204bd['id']});});});});});}})[_0xc90e('0x27')](respondWithStatusCode(_0x4f4904,null))['catch'](handleError(_0x4f4904,null));};exports[_0xc90e('0x78')]=function(_0x3083f5,_0x55ffd8,_0x2c2d6a){return db[_0xc90e('0x68')][_0xc90e('0x4c')]({'where':{'id':_0x3083f5[_0xc90e('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc90e('0x6b')],'as':_0xc90e('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xc90e('0x27')](handleEntityNotFound(_0x55ffd8,null))[_0xc90e('0x27')](function(_0x450fd2){var _0x39af19=_['map'](_0x450fd2,'id');var _0x40a1e2=[];var _0x1c6c3c=[];var _0x405359=squel['select']();_0x405359[_0xc90e('0x79')](_0xc90e('0x7a'))[_0xc90e('0x7b')]('team_has_voice_queues','tq')[_0xc90e('0x7c')](_0xc90e('0x7d'),'ut',_0xc90e('0x7e'))['where']('VoiceQueueId\x20=\x20?',_0x3083f5[_0xc90e('0x57')]['id']);for(var _0x4c3fc2=0x0;_0x4c3fc2<_0x450fd2[_0xc90e('0x41')];_0x4c3fc2+=0x1){let _0x4b8b0e=_0x450fd2[_0x4c3fc2];for(var _0x2cc4c9=0x0;_0x2cc4c9<_0x4b8b0e[_0xc90e('0x6f')][_0xc90e('0x41')];_0x2cc4c9+=0x1){let _0x29a154=_0x4b8b0e[_0xc90e('0x6f')][_0x2cc4c9];var _0x96b3f7=_0x405359[_0xc90e('0x7f')]();_0x96b3f7[_0xc90e('0x45')](_0xc90e('0x80'),_0x29a154['id']);_0x1c6c3c[_0xc90e('0x81')](db[_0xc90e('0x72')]['query'](_0x96b3f7[_0xc90e('0x82')](),{'type':db[_0xc90e('0x72')][_0xc90e('0x83')][_0xc90e('0x84')]})['then'](function(_0x3f17bb){if(_0x3f17bb['length']===0x1){return _0x29a154['id'];}else{var _0x492df6=_[_0xc90e('0x85')](_['map'](_0x3f17bb,_0xc90e('0x86')),function(_0x398528){return _[_0xc90e('0x30')](_0x39af19,_0x398528);});if(_0x492df6){return _0x29a154['id'];}}}));}}return BPromise[_0xc90e('0x87')](_0x1c6c3c)['then'](function(_0x163e0c){_0x40a1e2=_(_0x40a1e2)[_0xc90e('0x88')](_0x163e0c)['compact']()[_0xc90e('0x2f')]();return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x3083f5[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](function(_0x2e3f34){return db[_0xc90e('0x72')][_0xc90e('0x73')](function(_0x41a212){return _0x2e3f34[_0xc90e('0x78')](_0x3083f5['query'][_0xc90e('0x89')],{'transaction':_0x41a212})[_0xc90e('0x27')](function(){if(!_[_0xc90e('0x8a')](_0x40a1e2)){return _0x2e3f34[_0xc90e('0x8b')](_0x40a1e2,{'transaction':_0x41a212})['then'](function(){return db[_0xc90e('0x76')][_0xc90e('0x28')]({'where':{'VoiceQueueId':_0x3083f5['params']['id'],'UserId':_0x40a1e2},'transaction':_0x41a212});});}})['then'](function(){_0x40a1e2['forEach'](function(_0x218969){socket['emit'](_0xc90e('0x8c'),{'UserId':_0x218969,'VoiceQueueId':_0x2e3f34['id']});});});});});});})[_0xc90e('0x27')](respondWithStatusCode(_0x55ffd8,null))['catch'](handleError(_0x55ffd8,null));};exports[_0xc90e('0x8d')]=function(_0x4f7c46,_0x54d74b,_0x3a6572){var _0x121da6,_0xa5764c;return db['VoiceQueue'][_0xc90e('0x32')]({'where':{'id':_0x4f7c46['params']['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x54d74b,null))[_0xc90e('0x27')](function(_0x4a23c8){if(_0x4a23c8){_0xa5764c=_0x4a23c8;return _0x4a23c8['addAgents'](_0x4f7c46[_0xc90e('0x51')][_0xc90e('0x89')],_[_0xc90e('0x5a')](_0x4f7c46['body'],[_0xc90e('0x89'),'id'])||{})[_0xc90e('0x8e')](function(_0x4ab394){for(var _0x3231b6=0x0;_0x3231b6<_0x4f7c46['body']['ids'][_0xc90e('0x41')];_0x3231b6+=0x1){socket[_0xc90e('0x8f')](_0xc90e('0x90'),{'UserId':Number(_0x4f7c46[_0xc90e('0x51')]['ids'][_0x3231b6]),'VoiceQueueId':Number(_0x4f7c46[_0xc90e('0x57')]['id'])});}return _0x4ab394;});}})[_0xc90e('0x27')](function(_0x28fc0c){_0x121da6=_0x28fc0c||[];if(_0xa5764c){return db[_0xc90e('0x6b')]['findAll']({'where':{'id':_0x4f7c46[_0xc90e('0x51')][_0xc90e('0x89')]},'attributes':['id',_0xc90e('0x33'),_0xc90e('0x91'),_0xc90e('0x6c'),_0xc90e('0x6d')],'raw':!![]});}})[_0xc90e('0x27')](function(_0x931c7e){if(!_[_0xc90e('0x8a')](_0x931c7e)){var _0x4292db=[];for(var _0x2614da=0x0;_0x2614da<_0x931c7e[_0xc90e('0x41')];_0x2614da++){if(_0x931c7e[_0x2614da][_0xc90e('0x91')]){_0x4292db[_0xc90e('0x81')](db[_0xc90e('0x76')][_0xc90e('0x75')]({'membername':_0x931c7e[_0x2614da][_0xc90e('0x33')],'UserId':_0x931c7e[_0x2614da]['id'],'queue_name':_0xa5764c[_0xc90e('0x33')],'VoiceQueueId':_0xa5764c['id'],'interface':_[_0xc90e('0x92')](_0x931c7e[_0x2614da][_0xc90e('0x6d')])?util['format']('SIP/%s',_0x931c7e[_0x2614da]['name']):_0x931c7e[_0x2614da][_0xc90e('0x6d')],'paused':_0x931c7e[_0x2614da]['voicePause']||![],'penalty':_0x4f7c46[_0xc90e('0x51')][_0xc90e('0x71')]||0x0}));}}return BPromise['all'](_0x4292db);}})['then'](function(){return _0x121da6;})[_0xc90e('0x27')](respondWithResult(_0x54d74b,null))[_0xc90e('0x4f')](handleError(_0x54d74b,null));};exports[_0xc90e('0x8b')]=function(_0x15de20,_0xa646cf,_0x290e46){return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x15de20['params']['id']}})['then'](handleEntityNotFound(_0xa646cf,null))[_0xc90e('0x27')](function(_0x53229b){if(_0x53229b){return _0x53229b[_0xc90e('0x8b')](_0x15de20[_0xc90e('0x3b')]['ids'])[_0xc90e('0x27')](function(){if(_[_0xc90e('0x93')](_0x15de20[_0xc90e('0x3b')]['ids'])){for(var _0x5386be=0x0;_0x5386be<_0x15de20['query']['ids'][_0xc90e('0x41')];_0x5386be+=0x1){socket[_0xc90e('0x8f')](_0xc90e('0x8c'),{'UserId':Number(_0x15de20['query'][_0xc90e('0x89')][_0x5386be]),'VoiceQueueId':Number(_0x15de20['params']['id'])});}}else{socket[_0xc90e('0x8f')](_0xc90e('0x8c'),{'UserId':Number(_0x15de20[_0xc90e('0x3b')][_0xc90e('0x89')]),'VoiceQueueId':Number(_0x15de20[_0xc90e('0x57')]['id'])});}});}})[_0xc90e('0x27')](function(_0x1c218e){return db[_0xc90e('0x76')]['destroy']({'where':{'VoiceQueueId':_0x15de20[_0xc90e('0x57')]['id'],'UserId':_0x15de20[_0xc90e('0x3b')][_0xc90e('0x89')]}})[_0xc90e('0x27')](function(){return _0x1c218e;});})['then'](respondWithStatusCode(_0xa646cf,null))[_0xc90e('0x4f')](handleError(_0xa646cf,null));};exports[_0xc90e('0x94')]=function(_0x3712e9,_0xc6f721,_0x59860a){var _0x2748b1={};var _0x48ada1={};var _0x11b2f0;var _0x24e3f0;return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x3712e9[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0xc6f721,null))[_0xc90e('0x27')](function(_0x3d4e2e){if(_0x3d4e2e){_0x11b2f0=_0x3d4e2e;_0x48ada1['model']=_['keys'](db[_0xc90e('0x6b')][_0xc90e('0x39')]);_0x48ada1[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x3712e9[_0xc90e('0x3b')]);_0x48ada1['filters']=_['intersection'](_0x48ada1[_0xc90e('0x3a')],_0x48ada1[_0xc90e('0x3b')]);_0x2748b1[_0xc90e('0x3f')]=_['intersection'](_0x48ada1[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x3712e9[_0xc90e('0x3b')]['fields']));_0x2748b1[_0xc90e('0x3f')]=_0x2748b1[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x2748b1[_0xc90e('0x3f')]:_0x48ada1[_0xc90e('0x3a')];_0x2748b1[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x3712e9[_0xc90e('0x3b')][_0xc90e('0x44')]);_0x2748b1['where']=qs[_0xc90e('0x3d')](_[_0xc90e('0x46')](_0x3712e9['query'],_0x48ada1[_0xc90e('0x3d')]));if(_0x3712e9[_0xc90e('0x3b')]['filter']){_0x2748b1['where']=_[_0xc90e('0x48')](_0x2748b1[_0xc90e('0x45')],{'$or':_['map'](_0x2748b1[_0xc90e('0x3f')],function(_0x2a08f4){var _0x44cabb={};_0x44cabb[_0x2a08f4]={'$like':'%'+_0x3712e9[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x44cabb;})});}_0x2748b1=_[_0xc90e('0x48')]({},_0x2748b1,_0x3712e9[_0xc90e('0x49')]);return _0x11b2f0['getAgents'](_0x2748b1);}})[_0xc90e('0x27')](function(_0x696bb6){if(_0x696bb6){_0x24e3f0=_0x696bb6[_0xc90e('0x41')];if(!_0x3712e9[_0xc90e('0x3b')]['hasOwnProperty'](_0xc90e('0x60'))){_0x2748b1[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x3712e9[_0xc90e('0x3b')]['limit']);_0x2748b1[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x3712e9[_0xc90e('0x3b')][_0xc90e('0x1f')]);}return _0x11b2f0['getAgents'](_0x2748b1);}})['then'](function(_0x128ea8){if(_0x128ea8){return _0x128ea8?{'count':_0x24e3f0,'rows':_0x128ea8}:null;}})['then'](respondWithResult(_0xc6f721,null))[_0xc90e('0x4f')](handleError(_0xc6f721,null));};exports[_0xc90e('0x95')]=function(_0x4910ea,_0x1b1733,_0x1cae9f){var _0x6ede9c={};var _0x4e6b69={};var _0x3a6352;var _0x2d76d0;return db[_0xc90e('0x38')]['findOne']({'where':{'id':_0x4910ea[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x1b1733,null))[_0xc90e('0x27')](function(_0x222fbd){if(_0x222fbd){_0x3a6352=_0x222fbd;_0x4e6b69[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db['UserVoiceQueueRt'][_0xc90e('0x39')]);_0x4e6b69[_0xc90e('0x3b')]=_[_0xc90e('0x3c')](_0x4910ea[_0xc90e('0x3b')]);_0x4e6b69[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0x4e6b69['model'],_0x4e6b69[_0xc90e('0x3b')]);_0x6ede9c[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x4e6b69[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x4910ea[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x6ede9c[_0xc90e('0x3f')]=_0x6ede9c[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x6ede9c[_0xc90e('0x3f')]:_0x4e6b69[_0xc90e('0x3a')];_0x6ede9c[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x4910ea[_0xc90e('0x3b')][_0xc90e('0x44')]);_0x6ede9c[_0xc90e('0x45')]=qs['filters'](_[_0xc90e('0x46')](_0x4910ea[_0xc90e('0x3b')],_0x4e6b69[_0xc90e('0x3d')]));if(_0x4910ea[_0xc90e('0x3b')]['filter']){_0x6ede9c[_0xc90e('0x45')]=_['merge'](_0x6ede9c[_0xc90e('0x45')],{'$or':_['map'](_0x6ede9c['attributes'],function(_0x472f4d){var _0x1d56cf={};_0x1d56cf[_0x472f4d]={'$like':'%'+_0x4910ea[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x1d56cf;})});}_0x6ede9c=_[_0xc90e('0x48')]({},_0x6ede9c,_0x4910ea[_0xc90e('0x49')]);return _0x3a6352['getMembers'](_0x6ede9c);}})[_0xc90e('0x27')](function(_0x2c13ad){if(_0x2c13ad){_0x2d76d0=_0x2c13ad['length'];if(!_0x4910ea['query'][_0xc90e('0x5f')](_0xc90e('0x60'))){_0x6ede9c[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x4910ea[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x6ede9c['offset']=qs[_0xc90e('0x1f')](_0x4910ea['query']['offset']);}return _0x3a6352[_0xc90e('0x95')](_0x6ede9c);}})[_0xc90e('0x27')](function(_0x25bd9f){return _0x25bd9f?{'count':_0x2d76d0,'rows':_0x25bd9f}:null;})[_0xc90e('0x27')](respondWithResult(_0x1b1733,null))[_0xc90e('0x4f')](handleError(_0x1b1733,null));};exports['getLists']=function(_0x1c7a36,_0x46b5e2,_0x58b8a8){var _0x435360={};var _0xaa739c={};var _0x10a5fe;var _0x8da189;return db[_0xc90e('0x38')][_0xc90e('0x63')]({'where':{'id':_0x1c7a36[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x46b5e2,null))[_0xc90e('0x27')](function(_0x1abdcf){if(_0x1abdcf){_0x10a5fe=_0x1abdcf;_0xaa739c[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db['CmList'][_0xc90e('0x39')]);_0xaa739c['query']=_[_0xc90e('0x3c')](_0x1c7a36[_0xc90e('0x3b')]);_0xaa739c[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0xaa739c[_0xc90e('0x3a')],_0xaa739c[_0xc90e('0x3b')]);_0x435360[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0xaa739c[_0xc90e('0x3a')],qs['fields'](_0x1c7a36[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x435360[_0xc90e('0x3f')]=_0x435360[_0xc90e('0x3f')]['length']?_0x435360[_0xc90e('0x3f')]:_0xaa739c[_0xc90e('0x3a')];_0x435360[_0xc90e('0x43')]=qs[_0xc90e('0x44')](_0x1c7a36['query'][_0xc90e('0x44')]);_0x435360['where']=qs[_0xc90e('0x3d')](_[_0xc90e('0x46')](_0x1c7a36[_0xc90e('0x3b')],_0xaa739c[_0xc90e('0x3d')]));if(_0x1c7a36[_0xc90e('0x3b')][_0xc90e('0x47')]){_0x435360['where']=_['merge'](_0x435360[_0xc90e('0x45')],{'$or':_[_0xc90e('0x37')](_0x435360[_0xc90e('0x3f')],function(_0xb13ab2){var _0x256cc0={};_0x256cc0[_0xb13ab2]={'$like':'%'+_0x1c7a36[_0xc90e('0x3b')][_0xc90e('0x47')]+'%'};return _0x256cc0;})});}_0x435360=_['merge']({},_0x435360,_0x1c7a36['options']);return _0x10a5fe['getLists'](_0x435360);}})[_0xc90e('0x27')](function(_0x326ed8){if(_0x326ed8){_0x8da189=_0x326ed8[_0xc90e('0x41')];if(!_0x1c7a36[_0xc90e('0x3b')][_0xc90e('0x5f')](_0xc90e('0x60'))){_0x435360[_0xc90e('0x42')]=qs[_0xc90e('0x42')](_0x1c7a36[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x435360[_0xc90e('0x1f')]=qs[_0xc90e('0x1f')](_0x1c7a36[_0xc90e('0x3b')]['offset']);}return _0x10a5fe[_0xc90e('0x96')](_0x435360);}})[_0xc90e('0x27')](function(_0x4bedb7){if(_0x4bedb7){return _0x4bedb7?{'count':_0x8da189,'rows':_0x4bedb7}:null;}})[_0xc90e('0x27')](respondWithResult(_0x46b5e2,null))[_0xc90e('0x4f')](handleError(_0x46b5e2,null));};exports[_0xc90e('0x97')]=function(_0x2d6eaa,_0x42ad22,_0x1045d1){var _0x165886=moment()[_0xc90e('0x77')](_0xc90e('0x98'));var _0x1a413c,_0x4565e7;return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x2d6eaa[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x42ad22,null))[_0xc90e('0x27')](function(_0x34fcdf){if(_0x34fcdf){_0x4565e7=_0x34fcdf;return _0x34fcdf[_0xc90e('0x97')](_0x2d6eaa['body']['ids'],_['omit'](_0x2d6eaa['body'],[_0xc90e('0x89'),'id'])||{});}return null;})[_0xc90e('0x8e')](function(_0x5d50e1){var _0x4ca33c;_0x1a413c=_0x5d50e1||[];var _0xe2c837=[];if(_0x5d50e1){for(var _0x218efa=0x0;_0x218efa<_0x5d50e1['length'];_0x218efa+=0x1){var _0x2e5249=_0x5d50e1[_0x218efa]['get']({'plain':!![]});_0x4565e7[_0xc90e('0x99')]=_0x2d6eaa[_0xc90e('0x51')][_0xc90e('0x99')]?_0x2d6eaa[_0xc90e('0x51')][_0xc90e('0x99')]:_0x4565e7[_0xc90e('0x99')];switch(_0x4565e7[_0xc90e('0x99')]){case _0xc90e('0x9a'):_0x4ca33c=squel[_0xc90e('0x9b')]()[_0xc90e('0x9c')](_0xc90e('0x9d'))[_0xc90e('0x9e')](['phone','scheduledAt','ContactId',_0xc90e('0x9f'),_0xc90e('0x61'),_0xc90e('0x58'),_0xc90e('0x59')],squel[_0xc90e('0xa0')]()[_0xc90e('0x79')](_0xc90e('0xa1'),_0xc90e('0xa1'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27','scheduledAt')[_0xc90e('0x79')]('id',_0xc90e('0xa2'))['field'](_0x2e5249[_0xc90e('0xa3')]['toString'](),_0xc90e('0x9f'))[_0xc90e('0x79')](_0x2d6eaa[_0xc90e('0x57')]['id'][_0xc90e('0x82')](),_0xc90e('0x61'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0x58'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0x59'))[_0xc90e('0x7b')]('cm_contacts')[_0xc90e('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0xc90e('0xa4'),_0x2e5249[_0xc90e('0xa3')]['toString']())[_0xc90e('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xc90e('0x45')](_0xc90e('0xa5'),squel[_0xc90e('0xa0')]()[_0xc90e('0x79')](_0xc90e('0xa6'))[_0xc90e('0x7b')](_0xc90e('0xa7'))[_0xc90e('0x45')](_0xc90e('0xa8'),_0x2d6eaa[_0xc90e('0x57')]['id'][_0xc90e('0x82')]()))[_0xc90e('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc90e('0xa0')]()[_0xc90e('0x79')](_0xc90e('0xa9'))[_0xc90e('0x7b')]('cm_hopper')[_0xc90e('0x45')](_0xc90e('0xa8'),_0x2d6eaa[_0xc90e('0x57')]['id'][_0xc90e('0x82')]())))[_0xc90e('0x82')]();break;case'onlyIfOpen':_0x4ca33c=squel[_0xc90e('0x9b')]()[_0xc90e('0x9c')]('cm_hopper')[_0xc90e('0x9e')]([_0xc90e('0xa1'),'scheduledAt',_0xc90e('0xa2'),_0xc90e('0x9f'),'VoiceQueueId',_0xc90e('0x58'),_0xc90e('0x59')],squel[_0xc90e('0xa0')]()[_0xc90e('0x79')]('phone',_0xc90e('0xa1'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0xaa'))['field']('id',_0xc90e('0xa2'))[_0xc90e('0x79')](_0x2e5249[_0xc90e('0xa3')][_0xc90e('0x82')](),_0xc90e('0x9f'))[_0xc90e('0x79')](_0x2d6eaa['params']['id'][_0xc90e('0x82')](),_0xc90e('0x61'))['field']('\x27'+_0x165886+'\x27',_0xc90e('0x58'))['field']('\x27'+_0x165886+'\x27','updatedAt')[_0xc90e('0x7b')](_0xc90e('0xab'))[_0xc90e('0x45')](_0xc90e('0xac'))[_0xc90e('0x45')](_0xc90e('0xa4'),_0x2e5249[_0xc90e('0xa3')]['toString']())[_0xc90e('0x45')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xc90e('0xa5'),squel['select']()[_0xc90e('0x79')](_0xc90e('0xa9'))[_0xc90e('0x7b')](_0xc90e('0x9d'))[_0xc90e('0x45')](_0xc90e('0xa8'),_0x2d6eaa['params']['id'][_0xc90e('0x82')]())))[_0xc90e('0x82')]();break;default:_0x4ca33c=squel['insert']()['into'](_0xc90e('0x9d'))[_0xc90e('0x9e')](['phone',_0xc90e('0xaa'),_0xc90e('0xa2'),_0xc90e('0x9f'),_0xc90e('0x61'),_0xc90e('0x58'),_0xc90e('0x59')],squel[_0xc90e('0xa0')]()[_0xc90e('0x79')](_0xc90e('0xa1'),_0xc90e('0xa1'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27','scheduledAt')['field']('id',_0xc90e('0xa2'))['field'](_0x2e5249[_0xc90e('0xa3')]['toString'](),_0xc90e('0x9f'))[_0xc90e('0x79')](_0x2d6eaa['params']['id']['toString'](),_0xc90e('0x61'))['field']('\x27'+_0x165886+'\x27',_0xc90e('0x58'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0x59'))[_0xc90e('0x7b')](_0xc90e('0xab'))[_0xc90e('0x45')](_0xc90e('0xac'))[_0xc90e('0x45')](_0xc90e('0xa4'),_0x2e5249['CmListId'][_0xc90e('0x82')]())[_0xc90e('0x45')](_0xc90e('0xad')))[_0xc90e('0x82')]();}_0xe2c837[_0xc90e('0x81')](db[_0xc90e('0x72')][_0xc90e('0x3b')](_0x4ca33c));}return BPromise['all'](_0xe2c837);}})[_0xc90e('0x27')](function(){var _0x41d7ae=[];var _0x552205=squel['insert']()[_0xc90e('0x9c')]('cm_hopper_additional_phones')[_0xc90e('0x9e')]([_0xc90e('0xae'),_0xc90e('0xa1'),_0xc90e('0xaf'),_0xc90e('0x58'),_0xc90e('0x59')],squel[_0xc90e('0xa0')]()[_0xc90e('0x79')](_0xc90e('0xb0'))['field']('ci.item')[_0xc90e('0x79')]('ci.OrderBy+1')[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0x58'))[_0xc90e('0x79')]('\x27'+_0x165886+'\x27',_0xc90e('0x59'))[_0xc90e('0x7b')](_0xc90e('0xb1'),'ci')[_0xc90e('0x7c')]('cm_hopper','h',_0xc90e('0xb2'))[_0xc90e('0x45')](_0xc90e('0xb3'),_0x165886)[_0xc90e('0x45')](_0xc90e('0xb4'),_0xc90e('0xb5')))[_0xc90e('0x82')]();_0x41d7ae['push'](db[_0xc90e('0x72')]['query'](_0x552205));return BPromise[_0xc90e('0x87')](_0x41d7ae);})[_0xc90e('0x27')](function(){return _0x1a413c;})[_0xc90e('0x27')](respondWithResult(_0x42ad22,null))['catch'](handleError(_0x42ad22,null));};exports[_0xc90e('0xb6')]=function(_0x1fac05,_0x1f3519,_0x274794){return db[_0xc90e('0x38')][_0xc90e('0x32')]({'where':{'id':_0x1fac05['params']['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x1f3519,null))[_0xc90e('0x27')](function(_0x21d868){if(_0x21d868){return _0x21d868[_0xc90e('0xb6')](_0x1fac05['query'][_0xc90e('0x89')]);}})[_0xc90e('0x27')](function(_0x590269){if(_0x590269){return db['CmHopper'][_0xc90e('0x28')]({'where':{'ListId':_0x1fac05[_0xc90e('0x3b')][_0xc90e('0x89')],'VoiceQueueId':_0x1fac05[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](function(){return _0x590269;});}})[_0xc90e('0x27')](respondWithStatusCode(_0x1f3519,null))['catch'](handleError(_0x1f3519,null));};exports[_0xc90e('0xb7')]=function(_0x5fc2a9,_0x29602e,_0x3eb0e2){var _0x6b049a={};var _0x366cca={};var _0x4d569a;var _0x1f4224;return db['VoiceQueue'][_0xc90e('0x63')]({'where':{'id':_0x5fc2a9['params']['id']}})['then'](handleEntityNotFound(_0x29602e,null))['then'](function(_0x4a86b8){if(_0x4a86b8){_0x4d569a=_0x4a86b8;_0x366cca[_0xc90e('0x3a')]=_[_0xc90e('0x3c')](db['CmList']['rawAttributes']);_0x366cca['query']=_['keys'](_0x5fc2a9['query']);_0x366cca[_0xc90e('0x3d')]=_[_0xc90e('0x3e')](_0x366cca[_0xc90e('0x3a')],_0x366cca[_0xc90e('0x3b')]);_0x6b049a[_0xc90e('0x3f')]=_[_0xc90e('0x3e')](_0x366cca[_0xc90e('0x3a')],qs[_0xc90e('0x40')](_0x5fc2a9[_0xc90e('0x3b')][_0xc90e('0x40')]));_0x6b049a['attributes']=_0x6b049a[_0xc90e('0x3f')][_0xc90e('0x41')]?_0x6b049a[_0xc90e('0x3f')]:_0x366cca['model'];_0x6b049a['order']=qs[_0xc90e('0x44')](_0x5fc2a9[_0xc90e('0x3b')][_0xc90e('0x44')]);_0x6b049a[_0xc90e('0x45')]=qs[_0xc90e('0x3d')](_[_0xc90e('0x46')](_0x5fc2a9[_0xc90e('0x3b')],_0x366cca[_0xc90e('0x3d')]));if(_0x5fc2a9['query'][_0xc90e('0x47')]){_0x6b049a[_0xc90e('0x45')]=_[_0xc90e('0x48')](_0x6b049a[_0xc90e('0x45')],{'$or':_['map'](_0x6b049a[_0xc90e('0x3f')],function(_0x5bfcdd){var _0x3c3c1e={};_0x3c3c1e[_0x5bfcdd]={'$like':'%'+_0x5fc2a9['query']['filter']+'%'};return _0x3c3c1e;})});}_0x6b049a=_[_0xc90e('0x48')]({},_0x6b049a,_0x5fc2a9[_0xc90e('0x49')]);return _0x4d569a[_0xc90e('0xb7')](_0x6b049a);}})['then'](function(_0x3c935b){if(_0x3c935b){_0x1f4224=_0x3c935b[_0xc90e('0x41')];if(!_0x5fc2a9[_0xc90e('0x3b')]['hasOwnProperty'](_0xc90e('0x60'))){_0x6b049a[_0xc90e('0x42')]=qs['limit'](_0x5fc2a9[_0xc90e('0x3b')][_0xc90e('0x42')]);_0x6b049a['offset']=qs[_0xc90e('0x1f')](_0x5fc2a9[_0xc90e('0x3b')][_0xc90e('0x1f')]);}return _0x4d569a['getBlackLists'](_0x6b049a);}})['then'](function(_0x7ddb9){if(_0x7ddb9){return _0x7ddb9?{'count':_0x1f4224,'rows':_0x7ddb9}:null;}})[_0xc90e('0x27')](respondWithResult(_0x29602e,null))['catch'](handleError(_0x29602e,null));};exports['addBlackLists']=function(_0xd11328,_0x1ab33a,_0x17ebd9){var _0x58c112,_0x39a7dc;return db['VoiceQueue'][_0xc90e('0x32')]({'where':{'id':_0xd11328['params']['id']}})[_0xc90e('0x27')](handleEntityNotFound(_0x1ab33a,null))[_0xc90e('0x27')](function(_0x58ab9b){if(_0x58ab9b){_0x39a7dc=_0x58ab9b;return _0x58ab9b['addBlackLists'](_0xd11328[_0xc90e('0x51')][_0xc90e('0x89')],_[_0xc90e('0x5a')](_0xd11328['body'],['ids','id'])||{});}return null;})[_0xc90e('0x8e')](function(_0x2f05c6){var _0x2162ed;_0x58c112=_0x2f05c6||[];var _0x2689a7=[];if(_0x2f05c6){for(var _0x441a6c=0x0;_0x441a6c<_0x2f05c6[_0xc90e('0x41')];_0x441a6c+=0x1){var _0x5b3649=_0x2f05c6[_0x441a6c][_0xc90e('0x29')]({'plain':!![]});_0x2162ed=squel['insert']()[_0xc90e('0x9c')](_0xc90e('0xb8'))[_0xc90e('0x9e')]([_0xc90e('0xa1'),_0xc90e('0xa2'),_0xc90e('0x9f'),_0xc90e('0x61'),_0xc90e('0x58'),_0xc90e('0x59')],squel['select']()[_0xc90e('0x79')](_0xc90e('0xa1'),'phone')[_0xc90e('0x79')]('id',_0xc90e('0xa2'))['field'](_0x5b3649['CmListId'][_0xc90e('0x82')](),_0xc90e('0x9f'))[_0xc90e('0x79')](_0xd11328['params']['id']['toString'](),'VoiceQueueId')['field'](_0xc90e('0xb9'),'createdAt')[_0xc90e('0x79')](_0xc90e('0xb9'),_0xc90e('0x59'))[_0xc90e('0x7b')](_0xc90e('0xab'))[_0xc90e('0x45')]('deletedAt\x20IS\x20NULL')[_0xc90e('0x45')](_0xc90e('0xa4'),_0x5b3649[_0xc90e('0xa3')]['toString']())['where'](_0xc90e('0xad')))['toString']();_0x2689a7[_0xc90e('0x81')](db['sequelize'][_0xc90e('0x3b')](_0x2162ed));}return BPromise[_0xc90e('0x87')](_0x2689a7);}})[_0xc90e('0x27')](function(){return _0x58c112;})[_0xc90e('0x27')](respondWithResult(_0x1ab33a,null))[_0xc90e('0x4f')](handleError(_0x1ab33a,null));};exports[_0xc90e('0xba')]=function(_0x2604d7,_0x1f0fc1,_0x45c307){return db[_0xc90e('0x38')]['find']({'where':{'id':_0x2604d7['params']['id']}})['then'](handleEntityNotFound(_0x1f0fc1,null))[_0xc90e('0x27')](function(_0x36bbf3){if(_0x36bbf3){return _0x36bbf3[_0xc90e('0xba')](_0x2604d7[_0xc90e('0x3b')][_0xc90e('0x89')]);}})[_0xc90e('0x27')](function(_0x47fdb2){if(_0x47fdb2){return db[_0xc90e('0x67')][_0xc90e('0x28')]({'where':{'ListId':_0x2604d7[_0xc90e('0x3b')][_0xc90e('0x89')],'VoiceQueueId':_0x2604d7[_0xc90e('0x57')]['id']}})[_0xc90e('0x27')](function(){return _0x47fdb2;});}})[_0xc90e('0x27')](respondWithStatusCode(_0x1f0fc1,null))[_0xc90e('0x4f')](handleError(_0x1f0fc1,null));}; \ No newline at end of file +var _0xd2f5=['hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','autoAssociation','findOne','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','interface','SIP/%s','emit','removeTeams','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','ids','isEmpty','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','isNil','format','removeAgents','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','createdAt','CmListId','ListId','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','type','name','sendStatus','error','stack','send','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2099d9,_0x192dbc){var _0x3f71dd=function(_0x2020d1){while(--_0x2020d1){_0x2099d9['push'](_0x2099d9['shift']());}};_0x3f71dd(++_0x192dbc);}(_0xd2f5,0x144));var _0x5d2f=function(_0x3e9af2,_0x23da00){_0x3e9af2=_0x3e9af2-0x0;var _0x9dc1da=_0xd2f5[_0x3e9af2];return _0x9dc1da;};'use strict';var emlformat=require(_0x5d2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d2f('0x2'));var moment=require('moment');var BPromise=require(_0x5d2f('0x3'));var Mustache=require(_0x5d2f('0x4'));var util=require(_0x5d2f('0x5'));var path=require(_0x5d2f('0x6'));var sox=require(_0x5d2f('0x7'));var csv=require(_0x5d2f('0x8'));var ejs=require(_0x5d2f('0x9'));var fs=require('fs');var fs_extra=require(_0x5d2f('0xa'));var _=require('lodash');var squel=require(_0x5d2f('0xb'));var crypto=require(_0x5d2f('0xc'));var jsforce=require(_0x5d2f('0xd'));var deskjs=require(_0x5d2f('0xe'));var toCsv=require(_0x5d2f('0x8'));var querystring=require(_0x5d2f('0xf'));var Papa=require('papaparse');var Redis=require(_0x5d2f('0x10'));var authService=require(_0x5d2f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d2f('0x12'));var hardwareService=require(_0x5d2f('0x13'));var logger=require(_0x5d2f('0x14'))('api');var utils=require(_0x5d2f('0x15'));var config=require(_0x5d2f('0x16'));var licenseUtil=require(_0x5d2f('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5d2f('0x18')](config['redis'],{'host':_0x5d2f('0x19'),'port':0x18eb});var socket=require(_0x5d2f('0x1a'))(new Redis(config['redis']));require(_0x5d2f('0x1b'))['register'](socket);function respondWithStatusCode(_0x6ce2d1,_0x158375){_0x158375=_0x158375||0xcc;return function(_0x309985){if(_0x309985){return _0x6ce2d1['sendStatus'](_0x158375);}return _0x6ce2d1[_0x5d2f('0x1c')](_0x158375)[_0x5d2f('0x1d')]();};}function respondWithResult(_0x1ca388,_0x2876fb){_0x2876fb=_0x2876fb||0xc8;return function(_0x1536ee){if(_0x1536ee){return _0x1ca388['status'](_0x2876fb)[_0x5d2f('0x1e')](_0x1536ee);}};}function respondWithFilteredResult(_0x33a931,_0x11aa8e){return function(_0x454782){if(_0x454782){var _0x5a79f1=typeof _0x11aa8e[_0x5d2f('0x1f')]===_0x5d2f('0x20')&&typeof _0x11aa8e[_0x5d2f('0x21')]===_0x5d2f('0x20');var _0x172106=_0x454782[_0x5d2f('0x22')];var _0x1bf6c6=_0x5a79f1?0x0:_0x11aa8e['offset'];var _0x47fe97=_0x5a79f1?_0x454782['count']:_0x11aa8e[_0x5d2f('0x1f')]+_0x11aa8e[_0x5d2f('0x21')];var _0xffb46f;if(_0x47fe97>=_0x172106){_0x47fe97=_0x172106;_0xffb46f=0xc8;}else{_0xffb46f=0xce;}_0x33a931[_0x5d2f('0x1c')](_0xffb46f);return _0x33a931[_0x5d2f('0x23')]('Content-Range',_0x1bf6c6+'-'+_0x47fe97+'/'+_0x172106)['json'](_0x454782);}return null;};}function patchUpdates(_0x368693){return function(_0x572365){try{jsonpatch[_0x5d2f('0x24')](_0x572365,_0x368693,!![]);}catch(_0xea19f2){return BPromise[_0x5d2f('0x25')](_0xea19f2);}return _0x572365[_0x5d2f('0x26')]();};}function saveUpdates(_0x6d4ad2,_0x39f30d){return function(_0x25e953){if(_0x25e953){return _0x25e953[_0x5d2f('0x27')](_0x6d4ad2)['then'](function(_0x3e5ef5){return _0x3e5ef5;});}return null;};}function removeEntity(_0x207d88,_0x1ebfbd){return function(_0x203e45){if(_0x203e45){return _0x203e45[_0x5d2f('0x28')]()[_0x5d2f('0x29')](function(){var _0x2ff7cc=_0x203e45[_0x5d2f('0x2a')]({'plain':!![]});var _0x51ca6a=[{'name':_0x5d2f('0x2b'),'value':_0x5d2f('0x2c'),'ignore':![]},{'name':_0x5d2f('0x2d'),'value':_0x5d2f('0x2e'),'ignore':![]}];var _0x185a2b=_(_0x51ca6a)['filter'](_0x5d2f('0x2f'))[_0x5d2f('0x30')](_0x5d2f('0x31'))[_0x5d2f('0x31')]();if(_['includes'](_0x185a2b,_0x2ff7cc[_0x5d2f('0x32')])){return;}var _0x45c1d5=_['find'](_0x51ca6a,[_0x5d2f('0x31'),_0x2ff7cc[_0x5d2f('0x32')]])[_0x5d2f('0x33')];return db['UserProfileResource'][_0x5d2f('0x28')]({'where':{'type':_0x45c1d5,'resourceId':_0x2ff7cc['id']}})[_0x5d2f('0x29')](function(){return _0x203e45;});})[_0x5d2f('0x29')](function(){_0x207d88[_0x5d2f('0x1c')](0xcc)[_0x5d2f('0x1d')]();});}};}function handleEntityNotFound(_0x28a404,_0x53c987){return function(_0x20f2d4){if(!_0x20f2d4){_0x28a404[_0x5d2f('0x34')](0x194);}return _0x20f2d4;};}function handleError(_0x37cc21,_0x4c3737){_0x4c3737=_0x4c3737||0x1f4;return function(_0x5b7c0b){logger[_0x5d2f('0x35')](_0x5b7c0b[_0x5d2f('0x36')]);if(_0x5b7c0b[_0x5d2f('0x33')]){delete _0x5b7c0b[_0x5d2f('0x33')];}_0x37cc21[_0x5d2f('0x1c')](_0x4c3737)[_0x5d2f('0x37')](_0x5b7c0b);};}exports[_0x5d2f('0x38')]=function(_0x3bcdc9,_0x321fbc){var _0xd231c4={},_0xfdd81={},_0x68ee1={'count':0x0,'rows':[]};var _0x34534b=_[_0x5d2f('0x30')](db[_0x5d2f('0x39')]['rawAttributes'],function(_0x25e71c){return{'name':_0x25e71c[_0x5d2f('0x3a')],'type':_0x25e71c[_0x5d2f('0x32')][_0x5d2f('0x3b')]};});_0xfdd81[_0x5d2f('0x3c')]=_[_0x5d2f('0x30')](_0x34534b,_0x5d2f('0x33'));_0xfdd81[_0x5d2f('0x3d')]=_[_0x5d2f('0x3e')](_0x3bcdc9['query']);_0xfdd81[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0xfdd81[_0x5d2f('0x3c')],_0xfdd81[_0x5d2f('0x3d')]);_0xd231c4[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0xfdd81[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x3bcdc9['query'][_0x5d2f('0x42')]));_0xd231c4['attributes']=_0xd231c4[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0xd231c4[_0x5d2f('0x41')]:_0xfdd81[_0x5d2f('0x3c')];if(!_0x3bcdc9[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0xd231c4[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x3bcdc9['query'][_0x5d2f('0x21')]);_0xd231c4['offset']=qs['offset'](_0x3bcdc9[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}_0xd231c4[_0x5d2f('0x46')]=qs[_0x5d2f('0x47')](_0x3bcdc9[_0x5d2f('0x3d')][_0x5d2f('0x47')]);_0xd231c4[_0x5d2f('0x48')]=qs['filters'](_['pick'](_0x3bcdc9['query'],_0xfdd81[_0x5d2f('0x3f')]),_0x34534b);if(_0x3bcdc9[_0x5d2f('0x3d')][_0x5d2f('0x49')]){_0xd231c4[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0xd231c4['where'],{'$or':_[_0x5d2f('0x30')](_0x34534b,function(_0x26dc7f){if(_0x26dc7f[_0x5d2f('0x32')]!=='VIRTUAL'){var _0x3a505a={};_0x3a505a[_0x26dc7f[_0x5d2f('0x33')]]={'$like':'%'+_0x3bcdc9[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x3a505a;}})});}_0xd231c4=_[_0x5d2f('0x4a')]({},_0xd231c4,_0x3bcdc9[_0x5d2f('0x4b')]);var _0x57572b={'where':_0xd231c4[_0x5d2f('0x48')]};return db['VoiceQueue']['count'](_0x57572b)[_0x5d2f('0x29')](function(_0x3c9f2a){_0x68ee1[_0x5d2f('0x22')]=_0x3c9f2a;if(_0x3bcdc9['query'][_0x5d2f('0x4c')]){_0xd231c4[_0x5d2f('0x4d')]=[{'all':!![]}];}return db[_0x5d2f('0x39')][_0x5d2f('0x4e')](_0xd231c4);})['then'](function(_0x3216e5){_0x68ee1[_0x5d2f('0x4f')]=_0x3216e5;return _0x68ee1;})[_0x5d2f('0x29')](respondWithFilteredResult(_0x321fbc,_0xd231c4))[_0x5d2f('0x50')](handleError(_0x321fbc,null));};exports[_0x5d2f('0x51')]=function(_0x22b252,_0xe63f1f){var _0x301f46={'raw':![],'where':{'id':_0x22b252[_0x5d2f('0x52')]['id']}},_0x3ceacd={};_0x3ceacd['model']=_['keys'](db['VoiceQueue'][_0x5d2f('0x53')]);_0x3ceacd['query']=_[_0x5d2f('0x3e')](_0x22b252[_0x5d2f('0x3d')]);_0x3ceacd[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x3ceacd[_0x5d2f('0x3c')],_0x3ceacd[_0x5d2f('0x3d')]);_0x301f46['attributes']=_['intersection'](_0x3ceacd[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x22b252[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x301f46[_0x5d2f('0x41')]=_0x301f46[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0x301f46['attributes']:_0x3ceacd[_0x5d2f('0x3c')];if(_0x22b252[_0x5d2f('0x3d')]['includeAll']){_0x301f46[_0x5d2f('0x4d')]=[{'all':!![]}];}_0x301f46=_[_0x5d2f('0x4a')]({},_0x301f46,_0x22b252[_0x5d2f('0x4b')]);return db[_0x5d2f('0x39')]['find'](_0x301f46)[_0x5d2f('0x29')](handleEntityNotFound(_0xe63f1f,null))[_0x5d2f('0x29')](respondWithResult(_0xe63f1f,null))[_0x5d2f('0x50')](handleError(_0xe63f1f,null));};exports[_0x5d2f('0x54')]=function(_0x29ef71,_0xebbb29){return db[_0x5d2f('0x39')]['create'](_0x29ef71[_0x5d2f('0x55')],{})[_0x5d2f('0x29')](function(_0x795b70){var _0x4e7128=_0x29ef71['user'][_0x5d2f('0x2a')]({'plain':!![]});if(!_0x4e7128)throw new Error(_0x5d2f('0x56'));if(_0x4e7128[_0x5d2f('0x57')]===_0x5d2f('0x58')){var _0x452e52=_0x795b70[_0x5d2f('0x2a')]({'plain':!![]});var _0x45e779=[{'name':_0x5d2f('0x2b'),'value':_0x5d2f('0x2c')},{'name':_0x5d2f('0x2d'),'value':_0x5d2f('0x2e')}];var _0x30e9c3=_[_0x5d2f('0x59')](_0x45e779,['value',_0x452e52['type']])['name'];return db[_0x5d2f('0x5a')][_0x5d2f('0x59')]({'where':{'name':_0x30e9c3,'userProfileId':_0x4e7128[_0x5d2f('0x5b')]},'raw':!![]})[_0x5d2f('0x29')](function(_0x37ce30){if(_0x37ce30&&_0x37ce30['autoAssociation']===0x0){return db[_0x5d2f('0x5c')][_0x5d2f('0x54')]({'name':_0x452e52[_0x5d2f('0x33')],'resourceId':_0x452e52['id'],'type':_0x37ce30[_0x5d2f('0x33')],'sectionId':_0x37ce30['id']},{})['then'](function(){return _0x795b70;});}else{return _0x795b70;}})[_0x5d2f('0x50')](function(_0x44bd66){logger['error'](_0x5d2f('0x5d'),_0x44bd66);throw _0x44bd66;});}return _0x795b70;})['then'](respondWithResult(_0xebbb29,0xc9))[_0x5d2f('0x50')](handleError(_0xebbb29,null));};exports[_0x5d2f('0x5e')]=function(_0x1c2f2d,_0x9ea084){var _0x582d13={'where':{'id':_0x1c2f2d[_0x5d2f('0x52')]['id']}},_0x18b40a={};_0x18b40a['model']=_[_0x5d2f('0x3e')](db[_0x5d2f('0x39')]['rawAttributes']);_0x582d13[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x18b40a['model'],qs[_0x5d2f('0x42')](_0x1c2f2d[_0x5d2f('0x3d')]['fields']));_0x582d13[_0x5d2f('0x41')]=_0x582d13[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0x582d13[_0x5d2f('0x41')]:_0x18b40a['model'];if(_0x1c2f2d[_0x5d2f('0x3d')][_0x5d2f('0x4c')]){_0x582d13['include']=[{'all':!![]}];}_0x582d13=_['merge']({},_0x582d13,_0x1c2f2d[_0x5d2f('0x4b')]);return db[_0x5d2f('0x39')][_0x5d2f('0x59')](_0x582d13)[_0x5d2f('0x29')](handleEntityNotFound(_0x9ea084,null))[_0x5d2f('0x29')](function(_0x545507){if(_0x545507){var _0x5226ff=_0x545507[_0x5d2f('0x2a')]({'plain':!![]});_0x5226ff=qs[_0x5d2f('0x5f')](_0x5226ff,['id','createdAt','updatedAt']);_0x1c2f2d[_0x5d2f('0x55')]=_[_0x5d2f('0x5f')](_0x1c2f2d[_0x5d2f('0x55')],['id','createdAt','updatedAt']);return db[_0x5d2f('0x39')][_0x5d2f('0x54')](_['merge'](_0x5226ff,_0x1c2f2d[_0x5d2f('0x55')]),{'include':_0x1c2f2d['query'][_0x5d2f('0x4c')]?[{'all':!![]}]:undefined})[_0x5d2f('0x29')](function(_0x216c6c){var _0x50549b=_0x1c2f2d[_0x5d2f('0x58')][_0x5d2f('0x2a')]({'plain':!![]});if(!_0x50549b)throw new Error(_0x5d2f('0x56'));if(_0x50549b[_0x5d2f('0x57')]==='user'){var _0x338417=_0x216c6c['get']({'plain':!![]});var _0x218703=[{'name':_0x5d2f('0x2b'),'value':'inbound'},{'name':_0x5d2f('0x2d'),'value':_0x5d2f('0x2e')}];var _0x4d0928=_['find'](_0x218703,[_0x5d2f('0x31'),_0x338417[_0x5d2f('0x32')]])['name'];return db['UserProfileSection'][_0x5d2f('0x59')]({'where':{'name':_0x4d0928,'userProfileId':_0x50549b[_0x5d2f('0x5b')]},'raw':!![]})['then'](function(_0x296608){if(_0x296608&&_0x296608[_0x5d2f('0x60')]===0x0){return db[_0x5d2f('0x5c')][_0x5d2f('0x54')]({'name':_0x338417[_0x5d2f('0x33')],'resourceId':_0x338417['id'],'type':_0x296608['name'],'sectionId':_0x296608['id']},{})[_0x5d2f('0x29')](function(){return _0x216c6c;});}else{return _0x216c6c;}})[_0x5d2f('0x50')](function(_0x40ad5c){logger[_0x5d2f('0x35')](_0x5d2f('0x5d'),_0x40ad5c);throw _0x40ad5c;});}return _0x216c6c;});}})[_0x5d2f('0x29')](respondWithResult(_0x9ea084,0xc9))[_0x5d2f('0x50')](handleError(_0x9ea084,null));};exports[_0x5d2f('0x27')]=function(_0x54fe7d,_0x130674){if(_0x54fe7d[_0x5d2f('0x55')]['id']){delete _0x54fe7d[_0x5d2f('0x55')]['id'];}return db[_0x5d2f('0x39')]['find']({'where':{'id':_0x54fe7d[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x130674,null))[_0x5d2f('0x29')](saveUpdates(_0x54fe7d[_0x5d2f('0x55')],null))[_0x5d2f('0x29')](respondWithResult(_0x130674,null))[_0x5d2f('0x50')](handleError(_0x130674,null));};exports['destroy']=function(_0x5a58da,_0x1a5a20){return db[_0x5d2f('0x39')][_0x5d2f('0x59')]({'where':{'id':_0x5a58da[_0x5d2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x1a5a20,null))[_0x5d2f('0x29')](removeEntity(_0x1a5a20,null))[_0x5d2f('0x50')](handleError(_0x1a5a20,null));};exports['getHoppers']=function(_0x15f0aa,_0x3007f7,_0x389c93){var _0x29805b={'raw':![],'where':{}};var _0x2febfc={};var _0x286208={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5d2f('0x61')]({'where':{'id':_0x15f0aa[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x3007f7,null))[_0x5d2f('0x29')](function(_0x57238b){if(_0x57238b){_0x2febfc['model']=_[_0x5d2f('0x3e')](db['CmHopper'][_0x5d2f('0x53')]);_0x2febfc['query']=_[_0x5d2f('0x3e')](_0x15f0aa[_0x5d2f('0x3d')]);_0x2febfc[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x2febfc[_0x5d2f('0x3c')],_0x2febfc['query']);_0x29805b[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x2febfc[_0x5d2f('0x3c')],qs['fields'](_0x15f0aa[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x29805b['attributes']=_0x29805b[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0x29805b[_0x5d2f('0x41')]:_0x2febfc[_0x5d2f('0x3c')];if(!_0x15f0aa[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0x29805b[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x15f0aa[_0x5d2f('0x3d')][_0x5d2f('0x21')]);_0x29805b[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x15f0aa[_0x5d2f('0x3d')]['offset']);}_0x29805b[_0x5d2f('0x46')]=qs['sort'](_0x15f0aa['query'][_0x5d2f('0x47')]);_0x29805b[_0x5d2f('0x48')]=qs['filters'](_[_0x5d2f('0x62')](_0x15f0aa[_0x5d2f('0x3d')],_0x2febfc[_0x5d2f('0x3f')]));_0x29805b[_0x5d2f('0x48')][_0x5d2f('0x63')]=_0x57238b['id'];if(_0x15f0aa[_0x5d2f('0x3d')][_0x5d2f('0x49')]){_0x29805b[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0x29805b[_0x5d2f('0x48')],{'$or':_[_0x5d2f('0x30')](_0x29805b[_0x5d2f('0x41')],function(_0x3c7782){var _0x400c94={};_0x400c94[_0x3c7782]={'$like':'%'+_0x15f0aa[_0x5d2f('0x3d')]['filter']+'%'};return _0x400c94;})});}_0x29805b=_[_0x5d2f('0x4a')]({},_0x29805b,_0x15f0aa['options']);return db['CmHopper'][_0x5d2f('0x22')]({'where':_0x29805b[_0x5d2f('0x48')]})[_0x5d2f('0x29')](function(_0x2764d1){_0x286208['count']=_0x2764d1;if(_0x15f0aa[_0x5d2f('0x3d')][_0x5d2f('0x4c')]){_0x29805b[_0x5d2f('0x4d')]=[{'all':!![]}];}return db[_0x5d2f('0x64')][_0x5d2f('0x4e')](_0x29805b);})['then'](function(_0x2f739e){_0x286208[_0x5d2f('0x4f')]=_0x2f739e;return _0x286208;});}})[_0x5d2f('0x29')](respondWithFilteredResult(_0x3007f7,_0x29805b))[_0x5d2f('0x50')](handleError(_0x3007f7,null));};exports[_0x5d2f('0x65')]=function(_0x4ed279,_0x1a2fae,_0x471d12){var _0x5758c8={'raw':!![],'where':{}};var _0xa66712={};var _0xcc347f={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5d2f('0x61')]({'where':{'id':_0x4ed279[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x1a2fae,null))[_0x5d2f('0x29')](function(_0x17744b){if(_0x17744b){_0xa66712[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db[_0x5d2f('0x66')]['rawAttributes']);_0xa66712[_0x5d2f('0x3d')]=_[_0x5d2f('0x3e')](_0x4ed279[_0x5d2f('0x3d')]);_0xa66712[_0x5d2f('0x3f')]=_['intersection'](_0xa66712[_0x5d2f('0x3c')],_0xa66712[_0x5d2f('0x3d')]);_0x5758c8[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0xa66712[_0x5d2f('0x3c')],qs['fields'](_0x4ed279[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x5758c8['attributes']=_0x5758c8[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0x5758c8[_0x5d2f('0x41')]:_0xa66712[_0x5d2f('0x3c')];if(!_0x4ed279[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0x5758c8[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x4ed279['query']['limit']);_0x5758c8[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x4ed279[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}_0x5758c8[_0x5d2f('0x46')]=qs[_0x5d2f('0x47')](_0x4ed279[_0x5d2f('0x3d')][_0x5d2f('0x47')]);_0x5758c8[_0x5d2f('0x48')]=qs[_0x5d2f('0x3f')](_['pick'](_0x4ed279[_0x5d2f('0x3d')],_0xa66712[_0x5d2f('0x3f')]));_0x5758c8['where'][_0x5d2f('0x63')]=_0x17744b['id'];if(_0x4ed279['query']['filter']){_0x5758c8['where']=_[_0x5d2f('0x4a')](_0x5758c8[_0x5d2f('0x48')],{'$or':_[_0x5d2f('0x30')](_0x5758c8[_0x5d2f('0x41')],function(_0x395da7){var _0x2811fd={};_0x2811fd[_0x395da7]={'$like':'%'+_0x4ed279[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x2811fd;})});}_0x5758c8=_[_0x5d2f('0x4a')]({},_0x5758c8,_0x4ed279[_0x5d2f('0x4b')]);return db['CmHopperHistory'][_0x5d2f('0x22')]({'where':_0x5758c8[_0x5d2f('0x48')]})[_0x5d2f('0x29')](function(_0x5bf987){_0xcc347f['count']=_0x5bf987;if(_0x4ed279[_0x5d2f('0x3d')]['includeAll']){_0x5758c8[_0x5d2f('0x4d')]=[{'all':!![]}];}return db[_0x5d2f('0x66')]['findAll'](_0x5758c8);})['then'](function(_0x4d4600){_0xcc347f[_0x5d2f('0x4f')]=_0x4d4600;return _0xcc347f;});}})[_0x5d2f('0x29')](respondWithFilteredResult(_0x1a2fae,_0x5758c8))['catch'](handleError(_0x1a2fae,null));};exports[_0x5d2f('0x67')]=function(_0x114bb8,_0x2da689,_0x2f266a){var _0x40b4f9={'raw':!![],'where':{}};var _0x5de00a={};var _0x2a77af={'count':0x0,'rows':[]};return db[_0x5d2f('0x39')][_0x5d2f('0x61')]({'where':{'id':_0x114bb8[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x2da689,null))['then'](function(_0x4b2f3d){if(_0x4b2f3d){_0x5de00a[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db['CmHopperFinal']['rawAttributes']);_0x5de00a[_0x5d2f('0x3d')]=_['keys'](_0x114bb8[_0x5d2f('0x3d')]);_0x5de00a[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x5de00a[_0x5d2f('0x3c')],_0x5de00a['query']);_0x40b4f9[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x5de00a[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x114bb8[_0x5d2f('0x3d')]['fields']));_0x40b4f9['attributes']=_0x40b4f9[_0x5d2f('0x41')]['length']?_0x40b4f9[_0x5d2f('0x41')]:_0x5de00a[_0x5d2f('0x3c')];if(!_0x114bb8[_0x5d2f('0x3d')][_0x5d2f('0x44')]('nolimit')){_0x40b4f9[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x114bb8['query'][_0x5d2f('0x21')]);_0x40b4f9['offset']=qs[_0x5d2f('0x1f')](_0x114bb8[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}_0x40b4f9[_0x5d2f('0x46')]=qs[_0x5d2f('0x47')](_0x114bb8[_0x5d2f('0x3d')]['sort']);_0x40b4f9[_0x5d2f('0x48')]=qs['filters'](_['pick'](_0x114bb8[_0x5d2f('0x3d')],_0x5de00a[_0x5d2f('0x3f')]));_0x40b4f9['where'][_0x5d2f('0x63')]=_0x4b2f3d['id'];if(_0x114bb8[_0x5d2f('0x3d')]['filter']){_0x40b4f9[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0x40b4f9['where'],{'$or':_['map'](_0x40b4f9[_0x5d2f('0x41')],function(_0x209cb8){var _0x2732e0={};_0x2732e0[_0x209cb8]={'$like':'%'+_0x114bb8[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x2732e0;})});}_0x40b4f9=_[_0x5d2f('0x4a')]({},_0x40b4f9,_0x114bb8[_0x5d2f('0x4b')]);return db[_0x5d2f('0x68')]['count']({'where':_0x40b4f9[_0x5d2f('0x48')]})['then'](function(_0x3b018c){_0x2a77af[_0x5d2f('0x22')]=_0x3b018c;if(_0x114bb8[_0x5d2f('0x3d')][_0x5d2f('0x4c')]){_0x40b4f9[_0x5d2f('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5d2f('0x4e')](_0x40b4f9);})[_0x5d2f('0x29')](function(_0x5f3d02){_0x2a77af[_0x5d2f('0x4f')]=_0x5f3d02;return _0x2a77af;});}})[_0x5d2f('0x29')](respondWithFilteredResult(_0x2da689,_0x40b4f9))[_0x5d2f('0x50')](handleError(_0x2da689,null));};exports[_0x5d2f('0x69')]=function(_0x96a192,_0x2998f1,_0x1dca33){var _0x336a91={'raw':!![],'where':{}};var _0x350b7d={};var _0x5e1097={'count':0x0,'rows':[]};return db[_0x5d2f('0x39')][_0x5d2f('0x61')]({'where':{'id':_0x96a192[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x2998f1,null))[_0x5d2f('0x29')](function(_0x59b959){if(_0x59b959){_0x350b7d['model']=_['keys'](db['CmHopperBlack'][_0x5d2f('0x53')]);_0x350b7d['query']=_['keys'](_0x96a192[_0x5d2f('0x3d')]);_0x350b7d['filters']=_[_0x5d2f('0x40')](_0x350b7d[_0x5d2f('0x3c')],_0x350b7d[_0x5d2f('0x3d')]);_0x336a91[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x350b7d[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x336a91[_0x5d2f('0x41')]=_0x336a91[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0x336a91[_0x5d2f('0x41')]:_0x350b7d[_0x5d2f('0x3c')];if(!_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0x336a91[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x96a192['query'][_0x5d2f('0x21')]);_0x336a91[_0x5d2f('0x1f')]=qs['offset'](_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}_0x336a91[_0x5d2f('0x46')]=qs[_0x5d2f('0x47')](_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x47')]);_0x336a91[_0x5d2f('0x48')]=qs[_0x5d2f('0x3f')](_['pick'](_0x96a192[_0x5d2f('0x3d')],_0x350b7d['filters']));_0x336a91[_0x5d2f('0x48')][_0x5d2f('0x63')]=_0x59b959['id'];if(_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x49')]){_0x336a91[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0x336a91[_0x5d2f('0x48')],{'$or':_['map'](_0x336a91[_0x5d2f('0x41')],function(_0x4637ed){var _0x3e43e3={};_0x3e43e3[_0x4637ed]={'$like':'%'+_0x96a192[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x3e43e3;})});}_0x336a91=_['merge']({},_0x336a91,_0x96a192[_0x5d2f('0x4b')]);return db['CmHopperBlack'][_0x5d2f('0x22')]({'where':_0x336a91[_0x5d2f('0x48')]})['then'](function(_0x177c73){_0x5e1097[_0x5d2f('0x22')]=_0x177c73;if(_0x96a192[_0x5d2f('0x3d')]['includeAll']){_0x336a91['include']=[{'all':!![]}];}return db[_0x5d2f('0x6a')][_0x5d2f('0x4e')](_0x336a91);})[_0x5d2f('0x29')](function(_0x4bf8bc){_0x5e1097[_0x5d2f('0x4f')]=_0x4bf8bc;return _0x5e1097;});}})[_0x5d2f('0x29')](respondWithFilteredResult(_0x2998f1,_0x336a91))[_0x5d2f('0x50')](handleError(_0x2998f1,null));};exports['getTeams']=function(_0x46c230,_0x4f994a,_0x5f2f05){var _0x551bed={};var _0x56f51a={};var _0x5899ad;var _0x11e481;return db[_0x5d2f('0x39')]['findOne']({'where':{'id':_0x46c230[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x4f994a,null))[_0x5d2f('0x29')](function(_0x3f8138){if(_0x3f8138){_0x5899ad=_0x3f8138;_0x56f51a['model']=_[_0x5d2f('0x3e')](db[_0x5d2f('0x6b')]['rawAttributes']);_0x56f51a[_0x5d2f('0x3d')]=_[_0x5d2f('0x3e')](_0x46c230[_0x5d2f('0x3d')]);_0x56f51a[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x56f51a['model'],_0x56f51a[_0x5d2f('0x3d')]);_0x551bed[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x56f51a[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x46c230[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x551bed[_0x5d2f('0x41')]=_0x551bed['attributes']['length']?_0x551bed['attributes']:_0x56f51a[_0x5d2f('0x3c')];_0x551bed[_0x5d2f('0x46')]=qs[_0x5d2f('0x47')](_0x46c230[_0x5d2f('0x3d')][_0x5d2f('0x47')]);_0x551bed[_0x5d2f('0x48')]=qs[_0x5d2f('0x3f')](_['pick'](_0x46c230[_0x5d2f('0x3d')],_0x56f51a[_0x5d2f('0x3f')]));if(_0x46c230['query'][_0x5d2f('0x49')]){_0x551bed[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0x551bed[_0x5d2f('0x48')],{'$or':_['map'](_0x551bed[_0x5d2f('0x41')],function(_0x4c2ab6){var _0x2cc866={};_0x2cc866[_0x4c2ab6]={'$like':'%'+_0x46c230[_0x5d2f('0x3d')]['filter']+'%'};return _0x2cc866;})});}_0x551bed=_[_0x5d2f('0x4a')]({},_0x551bed,_0x46c230[_0x5d2f('0x4b')]);return _0x5899ad[_0x5d2f('0x6c')](_0x551bed);}})[_0x5d2f('0x29')](function(_0x938c77){if(_0x938c77){_0x11e481=_0x938c77['length'];if(!_0x46c230[_0x5d2f('0x3d')][_0x5d2f('0x44')]('nolimit')){_0x551bed[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x46c230[_0x5d2f('0x3d')][_0x5d2f('0x21')]);_0x551bed['offset']=qs[_0x5d2f('0x1f')](_0x46c230[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}return _0x5899ad[_0x5d2f('0x6c')](_0x551bed);}})[_0x5d2f('0x29')](function(_0x604dc8){if(_0x604dc8){return _0x604dc8?{'count':_0x11e481,'rows':_0x604dc8}:null;}})[_0x5d2f('0x29')](respondWithResult(_0x4f994a,null))['catch'](handleError(_0x4f994a,null));};exports[_0x5d2f('0x6d')]=function(_0x1623f2,_0x5026f8,_0x3be8f9){var _0x3749bc=_0x1623f2[_0x5d2f('0x55')][_0x5d2f('0x6e')];var _0x1a383e=_['map'](_0x3749bc,'id');return db[_0x5d2f('0x6b')][_0x5d2f('0x4e')]({'where':{'id':_0x1a383e},'attributes':['id'],'include':[{'model':db[_0x5d2f('0x6f')],'as':_0x5d2f('0x70'),'attributes':['id',_0x5d2f('0x33'),_0x5d2f('0x71'),_0x5d2f('0x72'),'interface'],'raw':!![]}]})[_0x5d2f('0x29')](function(_0x519041){if(_0x519041){var _0x297d4e=_[_0x5d2f('0x73')](_0x519041,function(_0x1e7b4b){var _0xbdb177=_0x1e7b4b[_0x5d2f('0x2a')]({'plain':!![]});_0xbdb177[_0x5d2f('0x70')][_0x5d2f('0x74')](function(_0x492785){_0x492785[_0x5d2f('0x75')]=_['find'](_0x3749bc,{'id':_0xbdb177['id']})[_0x5d2f('0x75')];});return _0xbdb177['Agents'];});return db[_0x5d2f('0x39')][_0x5d2f('0x59')]({'where':{'id':_0x1623f2[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](function(_0x73a4b){return db['sequelize'][_0x5d2f('0x76')](function(_0x431c5c){return _0x73a4b[_0x5d2f('0x6d')](_0x1a383e,{'transaction':_0x431c5c})[_0x5d2f('0x29')](function(){return BPromise[_0x5d2f('0x77')](_0x3749bc,function(_0x893106){return db[_0x5d2f('0x78')][_0x5d2f('0x79')]({'TeamId':_0x893106['id'],'VoiceQueueId':_0x1623f2['params']['id'],'penalty':_0x893106[_0x5d2f('0x75')]},{'transaction':_0x431c5c});});})[_0x5d2f('0x29')](function(){return BPromise[_0x5d2f('0x77')](_0x297d4e,function(_0x29f017){return db[_0x5d2f('0x7a')][_0x5d2f('0x7b')]({'where':{'UserId':_0x29f017['id'],'VoiceQueueId':_0x1623f2[_0x5d2f('0x52')]['id']},'defaults':{'penalty':_0x29f017['penalty']},'transaction':_0x431c5c});});})['then'](function(){return BPromise[_0x5d2f('0x77')](_[_0x5d2f('0x49')](_0x297d4e,{'online':!![]}),function(_0x3fb6d1){return db[_0x5d2f('0x7c')][_0x5d2f('0x79')]({'membername':_0x3fb6d1[_0x5d2f('0x33')],'UserId':_0x3fb6d1['id'],'queue_name':_0x73a4b[_0x5d2f('0x33')],'VoiceQueueId':_0x73a4b['id'],'interface':_['isNil'](_0x3fb6d1[_0x5d2f('0x7d')])?util['format'](_0x5d2f('0x7e'),_0x3fb6d1[_0x5d2f('0x33')]):_0x3fb6d1[_0x5d2f('0x7d')],'paused':_0x3fb6d1[_0x5d2f('0x72')]||![],'penalty':_0x3fb6d1[_0x5d2f('0x75')]},{'transaction':_0x431c5c});});})['then'](function(){_0x297d4e[_0x5d2f('0x74')](function(_0xf424e7){socket[_0x5d2f('0x7f')]('userVoiceQueue:save',{'UserId':_0xf424e7['id'],'VoiceQueueId':_0x73a4b['id']});});});});});}})['then'](respondWithStatusCode(_0x5026f8,null))[_0x5d2f('0x50')](handleError(_0x5026f8,null));};exports[_0x5d2f('0x80')]=function(_0x54c555,_0x37ba44,_0x431a5d){return db[_0x5d2f('0x6b')][_0x5d2f('0x4e')]({'where':{'id':_0x54c555[_0x5d2f('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5d2f('0x6f')],'as':_0x5d2f('0x70'),'attributes':['id'],'raw':!![]}]})[_0x5d2f('0x29')](handleEntityNotFound(_0x37ba44,null))[_0x5d2f('0x29')](function(_0x1ea84d){var _0x355078=_[_0x5d2f('0x30')](_0x1ea84d,'id');var _0x4f8a78=[];var _0x27cfed=[];var _0xf7048=squel[_0x5d2f('0x81')]();_0xf7048[_0x5d2f('0x82')]('tq.TeamId')[_0x5d2f('0x83')](_0x5d2f('0x84'),'tq')[_0x5d2f('0x85')](_0x5d2f('0x86'),'ut',_0x5d2f('0x87'))[_0x5d2f('0x48')](_0x5d2f('0x88'),_0x54c555[_0x5d2f('0x52')]['id']);for(var _0x504aa7=0x0;_0x504aa7<_0x1ea84d[_0x5d2f('0x43')];_0x504aa7+=0x1){let _0x22f228=_0x1ea84d[_0x504aa7];for(var _0x3f305d=0x0;_0x3f305d<_0x22f228['Agents'][_0x5d2f('0x43')];_0x3f305d+=0x1){let _0x461d87=_0x22f228['Agents'][_0x3f305d];var _0x2d8c2f=_0xf7048[_0x5d2f('0x5e')]();_0x2d8c2f[_0x5d2f('0x48')](_0x5d2f('0x89'),_0x461d87['id']);_0x27cfed[_0x5d2f('0x8a')](db[_0x5d2f('0x8b')]['query'](_0x2d8c2f[_0x5d2f('0x8c')](),{'type':db['sequelize'][_0x5d2f('0x8d')][_0x5d2f('0x8e')]})[_0x5d2f('0x29')](function(_0x4693e9){if(_0x4693e9['length']===0x1){return _0x461d87['id'];}else{var _0x271586=_['every'](_[_0x5d2f('0x30')](_0x4693e9,_0x5d2f('0x8f')),function(_0x2a2c23){return _[_0x5d2f('0x90')](_0x355078,_0x2a2c23);});if(_0x271586){return _0x461d87['id'];}}}));}}return BPromise[_0x5d2f('0x91')](_0x27cfed)[_0x5d2f('0x29')](function(_0x26f65f){_0x4f8a78=_(_0x4f8a78)[_0x5d2f('0x92')](_0x26f65f)['compact']()[_0x5d2f('0x31')]();return db['VoiceQueue'][_0x5d2f('0x59')]({'where':{'id':_0x54c555[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](function(_0xe58f8f){return db[_0x5d2f('0x8b')]['transaction'](function(_0x5ac138){return _0xe58f8f[_0x5d2f('0x80')](_0x54c555[_0x5d2f('0x3d')][_0x5d2f('0x93')],{'transaction':_0x5ac138})[_0x5d2f('0x29')](function(){if(!_[_0x5d2f('0x94')](_0x4f8a78)){return _0xe58f8f['removeAgents'](_0x4f8a78,{'transaction':_0x5ac138})[_0x5d2f('0x29')](function(){return db['UserVoiceQueueRt'][_0x5d2f('0x28')]({'where':{'VoiceQueueId':_0x54c555['params']['id'],'UserId':_0x4f8a78},'transaction':_0x5ac138});});}})[_0x5d2f('0x29')](function(){_0x4f8a78[_0x5d2f('0x74')](function(_0x452909){socket[_0x5d2f('0x7f')](_0x5d2f('0x95'),{'UserId':_0x452909,'VoiceQueueId':_0xe58f8f['id']});});});});});});})['then'](respondWithStatusCode(_0x37ba44,null))[_0x5d2f('0x50')](handleError(_0x37ba44,null));};exports[_0x5d2f('0x96')]=function(_0x5981c3,_0xf95f73,_0x54c2bf){var _0x50b800,_0x4f469e;return db[_0x5d2f('0x39')][_0x5d2f('0x59')]({'where':{'id':_0x5981c3[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0xf95f73,null))[_0x5d2f('0x29')](function(_0x30643f){if(_0x30643f){_0x4f469e=_0x30643f;return _0x30643f[_0x5d2f('0x96')](_0x5981c3[_0x5d2f('0x55')][_0x5d2f('0x93')],_[_0x5d2f('0x5f')](_0x5981c3[_0x5d2f('0x55')],['ids','id'])||{})[_0x5d2f('0x97')](function(_0x47237f){for(var _0x4ca57f=0x0;_0x4ca57f<_0x5981c3[_0x5d2f('0x55')][_0x5d2f('0x93')]['length'];_0x4ca57f+=0x1){socket['emit'](_0x5d2f('0x98'),{'UserId':Number(_0x5981c3[_0x5d2f('0x55')][_0x5d2f('0x93')][_0x4ca57f]),'VoiceQueueId':Number(_0x5981c3[_0x5d2f('0x52')]['id'])});}return _0x47237f;});}})[_0x5d2f('0x29')](function(_0x30125e){_0x50b800=_0x30125e||[];if(_0x4f469e){return db[_0x5d2f('0x6f')][_0x5d2f('0x4e')]({'where':{'id':_0x5981c3[_0x5d2f('0x55')][_0x5d2f('0x93')]},'attributes':['id',_0x5d2f('0x33'),_0x5d2f('0x71'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x209052){if(!_[_0x5d2f('0x94')](_0x209052)){var _0x3f0aff=[];for(var _0x2ac4b6=0x0;_0x2ac4b6<_0x209052[_0x5d2f('0x43')];_0x2ac4b6++){if(_0x209052[_0x2ac4b6][_0x5d2f('0x71')]){_0x3f0aff[_0x5d2f('0x8a')](db['UserVoiceQueueRt'][_0x5d2f('0x79')]({'membername':_0x209052[_0x2ac4b6][_0x5d2f('0x33')],'UserId':_0x209052[_0x2ac4b6]['id'],'queue_name':_0x4f469e['name'],'VoiceQueueId':_0x4f469e['id'],'interface':_[_0x5d2f('0x99')](_0x209052[_0x2ac4b6][_0x5d2f('0x7d')])?util[_0x5d2f('0x9a')]('SIP/%s',_0x209052[_0x2ac4b6]['name']):_0x209052[_0x2ac4b6]['interface'],'paused':_0x209052[_0x2ac4b6][_0x5d2f('0x72')]||![],'penalty':_0x5981c3['body'][_0x5d2f('0x75')]||0x0}));}}return BPromise[_0x5d2f('0x91')](_0x3f0aff);}})['then'](function(){return _0x50b800;})['then'](respondWithResult(_0xf95f73,null))[_0x5d2f('0x50')](handleError(_0xf95f73,null));};exports['removeAgents']=function(_0x30d105,_0x2e8802,_0x5c417b){return db[_0x5d2f('0x39')]['find']({'where':{'id':_0x30d105[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x2e8802,null))['then'](function(_0xea592){if(_0xea592){return _0xea592[_0x5d2f('0x9b')](_0x30d105[_0x5d2f('0x3d')][_0x5d2f('0x93')])[_0x5d2f('0x29')](function(){if(_['isArray'](_0x30d105[_0x5d2f('0x3d')][_0x5d2f('0x93')])){for(var _0x1b7bd2=0x0;_0x1b7bd2<_0x30d105[_0x5d2f('0x3d')][_0x5d2f('0x93')]['length'];_0x1b7bd2+=0x1){socket[_0x5d2f('0x7f')](_0x5d2f('0x95'),{'UserId':Number(_0x30d105[_0x5d2f('0x3d')]['ids'][_0x1b7bd2]),'VoiceQueueId':Number(_0x30d105[_0x5d2f('0x52')]['id'])});}}else{socket[_0x5d2f('0x7f')](_0x5d2f('0x95'),{'UserId':Number(_0x30d105[_0x5d2f('0x3d')][_0x5d2f('0x93')]),'VoiceQueueId':Number(_0x30d105['params']['id'])});}});}})[_0x5d2f('0x29')](function(_0x842355){return db[_0x5d2f('0x7c')][_0x5d2f('0x28')]({'where':{'VoiceQueueId':_0x30d105[_0x5d2f('0x52')]['id'],'UserId':_0x30d105[_0x5d2f('0x3d')][_0x5d2f('0x93')]}})[_0x5d2f('0x29')](function(){return _0x842355;});})[_0x5d2f('0x29')](respondWithStatusCode(_0x2e8802,null))[_0x5d2f('0x50')](handleError(_0x2e8802,null));};exports['getAgents']=function(_0x2ae24e,_0x49c758,_0x1baa35){var _0x5b8f4a={};var _0x36a90b={};var _0x1c946a;var _0x566498;return db[_0x5d2f('0x39')]['findOne']({'where':{'id':_0x2ae24e[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x49c758,null))[_0x5d2f('0x29')](function(_0x29b302){if(_0x29b302){_0x1c946a=_0x29b302;_0x36a90b[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db['User'][_0x5d2f('0x53')]);_0x36a90b['query']=_['keys'](_0x2ae24e[_0x5d2f('0x3d')]);_0x36a90b[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x36a90b[_0x5d2f('0x3c')],_0x36a90b[_0x5d2f('0x3d')]);_0x5b8f4a[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x36a90b[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x2ae24e['query']['fields']));_0x5b8f4a['attributes']=_0x5b8f4a['attributes']['length']?_0x5b8f4a[_0x5d2f('0x41')]:_0x36a90b[_0x5d2f('0x3c')];_0x5b8f4a['order']=qs['sort'](_0x2ae24e[_0x5d2f('0x3d')]['sort']);_0x5b8f4a[_0x5d2f('0x48')]=qs[_0x5d2f('0x3f')](_[_0x5d2f('0x62')](_0x2ae24e['query'],_0x36a90b['filters']));if(_0x2ae24e['query'][_0x5d2f('0x49')]){_0x5b8f4a[_0x5d2f('0x48')]=_['merge'](_0x5b8f4a[_0x5d2f('0x48')],{'$or':_['map'](_0x5b8f4a[_0x5d2f('0x41')],function(_0x4daa3f){var _0x212a9a={};_0x212a9a[_0x4daa3f]={'$like':'%'+_0x2ae24e[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x212a9a;})});}_0x5b8f4a=_[_0x5d2f('0x4a')]({},_0x5b8f4a,_0x2ae24e[_0x5d2f('0x4b')]);return _0x1c946a[_0x5d2f('0x9c')](_0x5b8f4a);}})['then'](function(_0x51347e){if(_0x51347e){_0x566498=_0x51347e[_0x5d2f('0x43')];if(!_0x2ae24e[_0x5d2f('0x3d')]['hasOwnProperty']('nolimit')){_0x5b8f4a['limit']=qs[_0x5d2f('0x21')](_0x2ae24e[_0x5d2f('0x3d')]['limit']);_0x5b8f4a[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x2ae24e[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}return _0x1c946a[_0x5d2f('0x9c')](_0x5b8f4a);}})[_0x5d2f('0x29')](function(_0x4cd856){if(_0x4cd856){return _0x4cd856?{'count':_0x566498,'rows':_0x4cd856}:null;}})[_0x5d2f('0x29')](respondWithResult(_0x49c758,null))[_0x5d2f('0x50')](handleError(_0x49c758,null));};exports[_0x5d2f('0x9d')]=function(_0x411c43,_0x42bc2b,_0x357baf){var _0x22fabc={};var _0x36e941={};var _0x581f02;var _0x88f047;return db['VoiceQueue'][_0x5d2f('0x61')]({'where':{'id':_0x411c43[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x42bc2b,null))['then'](function(_0xfc9d){if(_0xfc9d){_0x581f02=_0xfc9d;_0x36e941[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db[_0x5d2f('0x7c')][_0x5d2f('0x53')]);_0x36e941[_0x5d2f('0x3d')]=_['keys'](_0x411c43['query']);_0x36e941[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x36e941['model'],_0x36e941['query']);_0x22fabc['attributes']=_[_0x5d2f('0x40')](_0x36e941[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x411c43['query']['fields']));_0x22fabc[_0x5d2f('0x41')]=_0x22fabc['attributes'][_0x5d2f('0x43')]?_0x22fabc['attributes']:_0x36e941['model'];_0x22fabc['order']=qs[_0x5d2f('0x47')](_0x411c43[_0x5d2f('0x3d')][_0x5d2f('0x47')]);_0x22fabc[_0x5d2f('0x48')]=qs[_0x5d2f('0x3f')](_[_0x5d2f('0x62')](_0x411c43['query'],_0x36e941['filters']));if(_0x411c43['query'][_0x5d2f('0x49')]){_0x22fabc[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0x22fabc[_0x5d2f('0x48')],{'$or':_[_0x5d2f('0x30')](_0x22fabc[_0x5d2f('0x41')],function(_0x5f3c80){var _0x25bdf4={};_0x25bdf4[_0x5f3c80]={'$like':'%'+_0x411c43[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x25bdf4;})});}_0x22fabc=_[_0x5d2f('0x4a')]({},_0x22fabc,_0x411c43[_0x5d2f('0x4b')]);return _0x581f02[_0x5d2f('0x9d')](_0x22fabc);}})[_0x5d2f('0x29')](function(_0x1af754){if(_0x1af754){_0x88f047=_0x1af754['length'];if(!_0x411c43['query'][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0x22fabc[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x411c43['query'][_0x5d2f('0x21')]);_0x22fabc[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x411c43['query'][_0x5d2f('0x1f')]);}return _0x581f02[_0x5d2f('0x9d')](_0x22fabc);}})[_0x5d2f('0x29')](function(_0x1e24fc){return _0x1e24fc?{'count':_0x88f047,'rows':_0x1e24fc}:null;})[_0x5d2f('0x29')](respondWithResult(_0x42bc2b,null))[_0x5d2f('0x50')](handleError(_0x42bc2b,null));};exports[_0x5d2f('0x9e')]=function(_0x4fad5f,_0x56f2de,_0x4b7323){var _0xd1455f={};var _0x53c24a={};var _0x3ba188;var _0x18a90f;return db[_0x5d2f('0x39')]['findOne']({'where':{'id':_0x4fad5f[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x56f2de,null))['then'](function(_0x44e9a3){if(_0x44e9a3){_0x3ba188=_0x44e9a3;_0x53c24a[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db[_0x5d2f('0x9f')][_0x5d2f('0x53')]);_0x53c24a[_0x5d2f('0x3d')]=_[_0x5d2f('0x3e')](_0x4fad5f[_0x5d2f('0x3d')]);_0x53c24a[_0x5d2f('0x3f')]=_[_0x5d2f('0x40')](_0x53c24a[_0x5d2f('0x3c')],_0x53c24a[_0x5d2f('0x3d')]);_0xd1455f[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x53c24a[_0x5d2f('0x3c')],qs['fields'](_0x4fad5f['query'][_0x5d2f('0x42')]));_0xd1455f[_0x5d2f('0x41')]=_0xd1455f[_0x5d2f('0x41')][_0x5d2f('0x43')]?_0xd1455f[_0x5d2f('0x41')]:_0x53c24a[_0x5d2f('0x3c')];_0xd1455f[_0x5d2f('0x46')]=qs['sort'](_0x4fad5f['query'][_0x5d2f('0x47')]);_0xd1455f['where']=qs[_0x5d2f('0x3f')](_[_0x5d2f('0x62')](_0x4fad5f['query'],_0x53c24a['filters']));if(_0x4fad5f['query'][_0x5d2f('0x49')]){_0xd1455f[_0x5d2f('0x48')]=_[_0x5d2f('0x4a')](_0xd1455f[_0x5d2f('0x48')],{'$or':_[_0x5d2f('0x30')](_0xd1455f['attributes'],function(_0x503b4a){var _0x59b514={};_0x59b514[_0x503b4a]={'$like':'%'+_0x4fad5f[_0x5d2f('0x3d')][_0x5d2f('0x49')]+'%'};return _0x59b514;})});}_0xd1455f=_[_0x5d2f('0x4a')]({},_0xd1455f,_0x4fad5f['options']);return _0x3ba188['getLists'](_0xd1455f);}})[_0x5d2f('0x29')](function(_0x2abbea){if(_0x2abbea){_0x18a90f=_0x2abbea[_0x5d2f('0x43')];if(!_0x4fad5f[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0xd1455f[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x4fad5f[_0x5d2f('0x3d')][_0x5d2f('0x21')]);_0xd1455f[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x4fad5f[_0x5d2f('0x3d')][_0x5d2f('0x1f')]);}return _0x3ba188[_0x5d2f('0x9e')](_0xd1455f);}})[_0x5d2f('0x29')](function(_0x4d29d2){if(_0x4d29d2){return _0x4d29d2?{'count':_0x18a90f,'rows':_0x4d29d2}:null;}})[_0x5d2f('0x29')](respondWithResult(_0x56f2de,null))[_0x5d2f('0x50')](handleError(_0x56f2de,null));};exports[_0x5d2f('0xa0')]=function(_0x299178,_0x30b2da,_0x59f556){var _0x332ba9=moment()[_0x5d2f('0x9a')](_0x5d2f('0xa1'));var _0x1de220,_0x44d7bc;return db[_0x5d2f('0x39')][_0x5d2f('0x59')]({'where':{'id':_0x299178[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x30b2da,null))[_0x5d2f('0x29')](function(_0x18be1a){if(_0x18be1a){_0x44d7bc=_0x18be1a;return _0x18be1a[_0x5d2f('0xa0')](_0x299178['body'][_0x5d2f('0x93')],_[_0x5d2f('0x5f')](_0x299178['body'],[_0x5d2f('0x93'),'id'])||{});}return null;})[_0x5d2f('0x97')](function(_0x39fbd6){var _0x37a85c;_0x1de220=_0x39fbd6||[];var _0x18965c=[];if(_0x39fbd6){for(var _0x26e5dc=0x0;_0x26e5dc<_0x39fbd6[_0x5d2f('0x43')];_0x26e5dc+=0x1){var _0x3168f7=_0x39fbd6[_0x26e5dc][_0x5d2f('0x2a')]({'plain':!![]});_0x44d7bc['dialCheckDuplicateType']=_0x299178['body'][_0x5d2f('0xa2')]?_0x299178['body'][_0x5d2f('0xa2')]:_0x44d7bc[_0x5d2f('0xa2')];switch(_0x44d7bc['dialCheckDuplicateType']){case _0x5d2f('0xa3'):_0x37a85c=squel['insert']()[_0x5d2f('0xa4')]('cm_hopper')[_0x5d2f('0xa5')]([_0x5d2f('0xa6'),_0x5d2f('0xa7'),_0x5d2f('0xa8'),'ListId','VoiceQueueId',_0x5d2f('0xa9'),'updatedAt'],squel[_0x5d2f('0x81')]()[_0x5d2f('0x82')]('phone',_0x5d2f('0xa6'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27','scheduledAt')[_0x5d2f('0x82')]('id',_0x5d2f('0xa8'))[_0x5d2f('0x82')](_0x3168f7[_0x5d2f('0xaa')][_0x5d2f('0x8c')](),_0x5d2f('0xab'))[_0x5d2f('0x82')](_0x299178[_0x5d2f('0x52')]['id'][_0x5d2f('0x8c')](),_0x5d2f('0x63'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27','createdAt')[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xac'))['from'](_0x5d2f('0xad'))[_0x5d2f('0x48')](_0x5d2f('0xae'))[_0x5d2f('0x48')](_0x5d2f('0xaf'),_0x3168f7['CmListId'][_0x5d2f('0x8c')]())[_0x5d2f('0x48')](_0x5d2f('0xb0'))[_0x5d2f('0x48')](_0x5d2f('0xb1'),squel['select']()[_0x5d2f('0x82')](_0x5d2f('0xb2'))[_0x5d2f('0x83')](_0x5d2f('0xb3'))[_0x5d2f('0x48')](_0x5d2f('0x88'),_0x299178['params']['id'][_0x5d2f('0x8c')]()))[_0x5d2f('0x48')](_0x5d2f('0xb1'),squel[_0x5d2f('0x81')]()[_0x5d2f('0x82')](_0x5d2f('0xb4'))[_0x5d2f('0x83')](_0x5d2f('0xb5'))[_0x5d2f('0x48')](_0x5d2f('0x88'),_0x299178[_0x5d2f('0x52')]['id'][_0x5d2f('0x8c')]())))[_0x5d2f('0x8c')]();break;case _0x5d2f('0xb6'):_0x37a85c=squel['insert']()[_0x5d2f('0xa4')](_0x5d2f('0xb5'))[_0x5d2f('0xa5')]([_0x5d2f('0xa6'),_0x5d2f('0xa7'),_0x5d2f('0xa8'),_0x5d2f('0xab'),_0x5d2f('0x63'),'createdAt',_0x5d2f('0xac')],squel[_0x5d2f('0x81')]()['field'](_0x5d2f('0xa6'),_0x5d2f('0xa6'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xa7'))[_0x5d2f('0x82')]('id','ContactId')[_0x5d2f('0x82')](_0x3168f7['CmListId']['toString'](),_0x5d2f('0xab'))['field'](_0x299178['params']['id'][_0x5d2f('0x8c')](),_0x5d2f('0x63'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xa9'))['field']('\x27'+_0x332ba9+'\x27',_0x5d2f('0xac'))[_0x5d2f('0x83')]('cm_contacts')[_0x5d2f('0x48')](_0x5d2f('0xae'))[_0x5d2f('0x48')](_0x5d2f('0xaf'),_0x3168f7[_0x5d2f('0xaa')][_0x5d2f('0x8c')]())[_0x5d2f('0x48')](_0x5d2f('0xb0'))[_0x5d2f('0x48')](_0x5d2f('0xb1'),squel[_0x5d2f('0x81')]()[_0x5d2f('0x82')](_0x5d2f('0xb4'))[_0x5d2f('0x83')](_0x5d2f('0xb5'))['where'](_0x5d2f('0x88'),_0x299178[_0x5d2f('0x52')]['id'][_0x5d2f('0x8c')]())))[_0x5d2f('0x8c')]();break;default:_0x37a85c=squel[_0x5d2f('0xb7')]()['into'](_0x5d2f('0xb5'))['fromQuery']([_0x5d2f('0xa6'),_0x5d2f('0xa7'),_0x5d2f('0xa8'),_0x5d2f('0xab'),'VoiceQueueId',_0x5d2f('0xa9'),_0x5d2f('0xac')],squel[_0x5d2f('0x81')]()['field'](_0x5d2f('0xa6'),_0x5d2f('0xa6'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xa7'))[_0x5d2f('0x82')]('id',_0x5d2f('0xa8'))[_0x5d2f('0x82')](_0x3168f7[_0x5d2f('0xaa')][_0x5d2f('0x8c')](),_0x5d2f('0xab'))['field'](_0x299178[_0x5d2f('0x52')]['id'][_0x5d2f('0x8c')](),_0x5d2f('0x63'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xa9'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27',_0x5d2f('0xac'))[_0x5d2f('0x83')](_0x5d2f('0xad'))['where']('deletedAt\x20IS\x20NULL')[_0x5d2f('0x48')]('ListId\x20=\x20?',_0x3168f7[_0x5d2f('0xaa')][_0x5d2f('0x8c')]())[_0x5d2f('0x48')](_0x5d2f('0xb0')))[_0x5d2f('0x8c')]();}_0x18965c[_0x5d2f('0x8a')](db['sequelize'][_0x5d2f('0x3d')](_0x37a85c));}return BPromise[_0x5d2f('0x91')](_0x18965c);}})[_0x5d2f('0x29')](function(){var _0x3de5c4=[];var _0x2b9338=squel[_0x5d2f('0xb7')]()[_0x5d2f('0xa4')]('cm_hopper_additional_phones')[_0x5d2f('0xa5')](['CmHopperId',_0x5d2f('0xa6'),_0x5d2f('0xb8'),_0x5d2f('0xa9'),_0x5d2f('0xac')],squel[_0x5d2f('0x81')]()[_0x5d2f('0x82')](_0x5d2f('0xb9'))[_0x5d2f('0x82')](_0x5d2f('0xba'))[_0x5d2f('0x82')](_0x5d2f('0xbb'))['field']('\x27'+_0x332ba9+'\x27',_0x5d2f('0xa9'))[_0x5d2f('0x82')]('\x27'+_0x332ba9+'\x27','updatedAt')[_0x5d2f('0x83')](_0x5d2f('0xbc'),'ci')[_0x5d2f('0x85')](_0x5d2f('0xb5'),'h','h.ContactId=ci.CmContactId')['where'](_0x5d2f('0xbd'),_0x332ba9)[_0x5d2f('0x48')](_0x5d2f('0xbe'),'PHONE'))[_0x5d2f('0x8c')]();_0x3de5c4[_0x5d2f('0x8a')](db[_0x5d2f('0x8b')][_0x5d2f('0x3d')](_0x2b9338));return BPromise[_0x5d2f('0x91')](_0x3de5c4);})['then'](function(){return _0x1de220;})[_0x5d2f('0x29')](respondWithResult(_0x30b2da,null))[_0x5d2f('0x50')](handleError(_0x30b2da,null));};exports[_0x5d2f('0xbf')]=function(_0x31a510,_0x549036,_0x464a52){return db['VoiceQueue'][_0x5d2f('0x59')]({'where':{'id':_0x31a510['params']['id']}})['then'](handleEntityNotFound(_0x549036,null))['then'](function(_0x514d6e){if(_0x514d6e){return _0x514d6e[_0x5d2f('0xbf')](_0x31a510['query']['ids']);}})[_0x5d2f('0x29')](function(_0x1e4f9a){if(_0x1e4f9a){return db[_0x5d2f('0x64')][_0x5d2f('0x28')]({'where':{'ListId':_0x31a510[_0x5d2f('0x3d')][_0x5d2f('0x93')],'VoiceQueueId':_0x31a510[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](function(){return _0x1e4f9a;});}})[_0x5d2f('0x29')](respondWithStatusCode(_0x549036,null))[_0x5d2f('0x50')](handleError(_0x549036,null));};exports[_0x5d2f('0xc0')]=function(_0x270e2d,_0x1da08c,_0x4b73c2){var _0x27d0a6={};var _0x43b52f={};var _0x832339;var _0x3516ce;return db[_0x5d2f('0x39')][_0x5d2f('0x61')]({'where':{'id':_0x270e2d[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x1da08c,null))[_0x5d2f('0x29')](function(_0x4d9857){if(_0x4d9857){_0x832339=_0x4d9857;_0x43b52f[_0x5d2f('0x3c')]=_[_0x5d2f('0x3e')](db[_0x5d2f('0x9f')][_0x5d2f('0x53')]);_0x43b52f[_0x5d2f('0x3d')]=_[_0x5d2f('0x3e')](_0x270e2d[_0x5d2f('0x3d')]);_0x43b52f['filters']=_[_0x5d2f('0x40')](_0x43b52f[_0x5d2f('0x3c')],_0x43b52f[_0x5d2f('0x3d')]);_0x27d0a6[_0x5d2f('0x41')]=_[_0x5d2f('0x40')](_0x43b52f[_0x5d2f('0x3c')],qs[_0x5d2f('0x42')](_0x270e2d[_0x5d2f('0x3d')][_0x5d2f('0x42')]));_0x27d0a6[_0x5d2f('0x41')]=_0x27d0a6['attributes'][_0x5d2f('0x43')]?_0x27d0a6[_0x5d2f('0x41')]:_0x43b52f[_0x5d2f('0x3c')];_0x27d0a6[_0x5d2f('0x46')]=qs['sort'](_0x270e2d[_0x5d2f('0x3d')]['sort']);_0x27d0a6[_0x5d2f('0x48')]=qs['filters'](_[_0x5d2f('0x62')](_0x270e2d['query'],_0x43b52f[_0x5d2f('0x3f')]));if(_0x270e2d['query'][_0x5d2f('0x49')]){_0x27d0a6[_0x5d2f('0x48')]=_['merge'](_0x27d0a6[_0x5d2f('0x48')],{'$or':_[_0x5d2f('0x30')](_0x27d0a6[_0x5d2f('0x41')],function(_0x3ee6c0){var _0x501c13={};_0x501c13[_0x3ee6c0]={'$like':'%'+_0x270e2d['query']['filter']+'%'};return _0x501c13;})});}_0x27d0a6=_[_0x5d2f('0x4a')]({},_0x27d0a6,_0x270e2d[_0x5d2f('0x4b')]);return _0x832339[_0x5d2f('0xc0')](_0x27d0a6);}})[_0x5d2f('0x29')](function(_0x2e49a8){if(_0x2e49a8){_0x3516ce=_0x2e49a8[_0x5d2f('0x43')];if(!_0x270e2d[_0x5d2f('0x3d')][_0x5d2f('0x44')](_0x5d2f('0x45'))){_0x27d0a6[_0x5d2f('0x21')]=qs[_0x5d2f('0x21')](_0x270e2d[_0x5d2f('0x3d')][_0x5d2f('0x21')]);_0x27d0a6[_0x5d2f('0x1f')]=qs[_0x5d2f('0x1f')](_0x270e2d['query'][_0x5d2f('0x1f')]);}return _0x832339[_0x5d2f('0xc0')](_0x27d0a6);}})[_0x5d2f('0x29')](function(_0x1e23ea){if(_0x1e23ea){return _0x1e23ea?{'count':_0x3516ce,'rows':_0x1e23ea}:null;}})[_0x5d2f('0x29')](respondWithResult(_0x1da08c,null))['catch'](handleError(_0x1da08c,null));};exports[_0x5d2f('0xc1')]=function(_0x4dbc0e,_0x268e8b,_0x11859e){var _0x583868,_0x185ad7;return db[_0x5d2f('0x39')]['find']({'where':{'id':_0x4dbc0e[_0x5d2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x268e8b,null))[_0x5d2f('0x29')](function(_0x4676a0){if(_0x4676a0){_0x185ad7=_0x4676a0;return _0x4676a0['addBlackLists'](_0x4dbc0e[_0x5d2f('0x55')][_0x5d2f('0x93')],_[_0x5d2f('0x5f')](_0x4dbc0e['body'],[_0x5d2f('0x93'),'id'])||{});}return null;})['spread'](function(_0x179020){var _0x1bf310;_0x583868=_0x179020||[];var _0x3956b7=[];if(_0x179020){for(var _0x50b3d8=0x0;_0x50b3d8<_0x179020[_0x5d2f('0x43')];_0x50b3d8+=0x1){var _0x118791=_0x179020[_0x50b3d8][_0x5d2f('0x2a')]({'plain':!![]});_0x1bf310=squel[_0x5d2f('0xb7')]()[_0x5d2f('0xa4')]('cm_hopper_black')['fromQuery'](['phone','ContactId',_0x5d2f('0xab'),_0x5d2f('0x63'),_0x5d2f('0xa9'),'updatedAt'],squel[_0x5d2f('0x81')]()[_0x5d2f('0x82')](_0x5d2f('0xa6'),_0x5d2f('0xa6'))[_0x5d2f('0x82')]('id',_0x5d2f('0xa8'))[_0x5d2f('0x82')](_0x118791['CmListId'][_0x5d2f('0x8c')](),'ListId')['field'](_0x4dbc0e[_0x5d2f('0x52')]['id']['toString'](),_0x5d2f('0x63'))[_0x5d2f('0x82')](_0x5d2f('0xc2'),_0x5d2f('0xa9'))[_0x5d2f('0x82')]('NOW()','updatedAt')['from'](_0x5d2f('0xad'))[_0x5d2f('0x48')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x118791[_0x5d2f('0xaa')]['toString']())[_0x5d2f('0x48')](_0x5d2f('0xb0')))[_0x5d2f('0x8c')]();_0x3956b7[_0x5d2f('0x8a')](db[_0x5d2f('0x8b')]['query'](_0x1bf310));}return BPromise[_0x5d2f('0x91')](_0x3956b7);}})['then'](function(){return _0x583868;})[_0x5d2f('0x29')](respondWithResult(_0x268e8b,null))[_0x5d2f('0x50')](handleError(_0x268e8b,null));};exports[_0x5d2f('0xc3')]=function(_0x1fc3cb,_0x3932ff,_0x28e0b2){return db[_0x5d2f('0x39')][_0x5d2f('0x59')]({'where':{'id':_0x1fc3cb[_0x5d2f('0x52')]['id']}})[_0x5d2f('0x29')](handleEntityNotFound(_0x3932ff,null))[_0x5d2f('0x29')](function(_0x59178b){if(_0x59178b){return _0x59178b[_0x5d2f('0xc3')](_0x1fc3cb[_0x5d2f('0x3d')]['ids']);}})[_0x5d2f('0x29')](function(_0xb39e96){if(_0xb39e96){return db[_0x5d2f('0x6a')][_0x5d2f('0x28')]({'where':{'ListId':_0x1fc3cb['query'][_0x5d2f('0x93')],'VoiceQueueId':_0x1fc3cb['params']['id']}})[_0x5d2f('0x29')](function(){return _0xb39e96;});}})['then'](respondWithStatusCode(_0x3932ff,null))[_0x5d2f('0x50')](handleError(_0x3932ff,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 4a347ca..abef568 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 _0xfa76=['remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x3a6194,_0x4574e2){var _0x298116=function(_0x27297c){while(--_0x27297c){_0x3a6194['push'](_0x3a6194['shift']());}};_0x298116(++_0x4574e2);}(_0xfa76,0xb8));var _0x6fa7=function(_0x1a0f4f,_0xc30484){_0x1a0f4f=_0x1a0f4f-0x0;var _0x4af487=_0xfa76[_0x1a0f4f];return _0x4af487;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x6fa7('0x0'))['db'][_0x6fa7('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6fa7('0x2')](0x0);var events={'afterCreate':_0x6fa7('0x3'),'afterUpdate':_0x6fa7('0x4'),'afterDestroy':_0x6fa7('0x5')};function emitEvent(_0x5bed83){return function(_0x3760e9,_0x46060b,_0x436723){VoiceQueueEvents[_0x6fa7('0x6')](_0x5bed83+':'+_0x3760e9['id'],_0x3760e9);VoiceQueueEvents[_0x6fa7('0x6')](_0x5bed83,_0x3760e9);_0x436723(null);};}for(var e in events){if(events[_0x6fa7('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x6fa7('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x672d=['update','remove','emit','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save'];(function(_0x45dd76,_0x37e8b6){var _0x21f607=function(_0x6868c9){while(--_0x6868c9){_0x45dd76['push'](_0x45dd76['shift']());}};_0x21f607(++_0x37e8b6);}(_0x672d,0xca));var _0xd672=function(_0x1785cd,_0x1e4753){_0x1785cd=_0x1785cd-0x0;var _0x10a79d=_0x672d[_0x1785cd];return _0x10a79d;};'use strict';var EventEmitter=require(_0xd672('0x0'));var VoiceQueue=require(_0xd672('0x1'))['db'][_0xd672('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd672('0x3')](0x0);var events={'afterCreate':_0xd672('0x4'),'afterUpdate':_0xd672('0x5'),'afterDestroy':_0xd672('0x6')};function emitEvent(_0x154a34){return function(_0x5e32e3,_0x1c989c,_0x5512ae){VoiceQueueEvents[_0xd672('0x7')](_0x154a34+':'+_0x5e32e3['id'],_0x5e32e3);VoiceQueueEvents[_0xd672('0x7')](_0x154a34,_0x5e32e3);_0x5512ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xd672('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 73ec416..2f5517f 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x364252,_0x12fd50){var _0x7eb8f5=function(_0x439cc6){while(--_0x439cc6){_0x364252['push'](_0x364252['shift']());}};_0x7eb8f5(++_0x12fd50);}(_0x34e8,0x12c));var _0x834e=function(_0x406a0f,_0x1e964d){_0x406a0f=_0x406a0f-0x0;var _0x2aef1a=_0x34e8[_0x406a0f];return _0x2aef1a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x3f517e,_0x3fb6de){var _0x220216=function(_0x353171){while(--_0x353171){_0x3f517e['push'](_0x3f517e['shift']());}};_0x220216(++_0x3fb6de);}(_0x70e0,0x17b));var _0x070e=function(_0x42f50d,_0x3d9acb){_0x42f50d=_0x42f50d-0x0;var _0x3624c7=_0x70e0[_0x42f50d];return _0x3624c7;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 72ac6f9..979f079 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 _0xbd9f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','find','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x37a1bd,_0x4bc832){var _0x42f356=function(_0x2122f4){while(--_0x2122f4){_0x37a1bd['push'](_0x37a1bd['shift']());}};_0x42f356(++_0x4bc832);}(_0xbd9f,0x121));var _0xfbd9=function(_0x5ac45b,_0x5b1f51){_0x5ac45b=_0x5ac45b-0x0;var _0x67fb=_0xbd9f[_0x5ac45b];return _0x67fb;};'use strict';var _=require(_0xfbd9('0x0'));var util=require(_0xfbd9('0x1'));var moment=require('moment');var BPromise=require(_0xfbd9('0x2'));var rs=require(_0xfbd9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbd9('0x4'))['db'];var utils=require(_0xfbd9('0x5'));var logger=require(_0xfbd9('0x6'))(_0xfbd9('0x7'));var config=require(_0xfbd9('0x8'));var jayson=require(_0xfbd9('0x9'));var client=jayson[_0xfbd9('0xa')]['http']({'port':0x232a});config[_0xfbd9('0xb')]=_[_0xfbd9('0xc')](config[_0xfbd9('0xb')],{'host':_0xfbd9('0xd'),'port':0x18eb});var socket=require(_0xfbd9('0xe'))(new Redis(config[_0xfbd9('0xb')]));require(_0xfbd9('0xf'))[_0xfbd9('0x10')](socket);function respondWithRpcPromise(_0x86e030,_0x1f0888,_0x3abd8b){return new BPromise(function(_0xa68664,_0x1cb9be){return client[_0xfbd9('0x11')](_0x86e030,_0x3abd8b)[_0xfbd9('0x12')](function(_0x14fec0){logger[_0xfbd9('0x13')](_0xfbd9('0x14'),_0x1f0888,'request\x20sent');logger[_0xfbd9('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1f0888,_0xfbd9('0x16'),JSON[_0xfbd9('0x17')](_0x14fec0));if(_0x14fec0[_0xfbd9('0x18')]){if(_0x14fec0[_0xfbd9('0x18')][_0xfbd9('0x19')]===0x1f4){logger[_0xfbd9('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x1f0888,_0x14fec0['error'][_0xfbd9('0x1a')]);return _0x1cb9be(_0x14fec0[_0xfbd9('0x18')][_0xfbd9('0x1a')]);}logger['error'](_0xfbd9('0x14'),_0x1f0888,_0x14fec0[_0xfbd9('0x18')]['message']);return _0xa68664(_0x14fec0['error']['message']);}else{logger[_0xfbd9('0x13')](_0xfbd9('0x14'),_0x1f0888,_0xfbd9('0x16'));_0xa68664(_0x14fec0[_0xfbd9('0x1b')][_0xfbd9('0x1a')]);}})['catch'](function(_0x41557e){logger['error'](_0xfbd9('0x14'),_0x1f0888,_0x41557e);_0x1cb9be(_0x41557e);});});}exports[_0xfbd9('0x1c')]=function(_0x126474){var _0x419477=this;return new Promise(function(_0x3dc68e,_0x43e045){return db[_0xfbd9('0x1d')][_0xfbd9('0x1e')]({'raw':_0x126474[_0xfbd9('0x1f')]?_0x126474[_0xfbd9('0x1f')][_0xfbd9('0x20')]===undefined?!![]:![]:!![],'where':_0x126474[_0xfbd9('0x1f')]?_0x126474[_0xfbd9('0x1f')][_0xfbd9('0x21')]||null:null,'attributes':_0x126474['options']?_0x126474['options'][_0xfbd9('0x22')]||null:null,'limit':_0x126474['options']?_0x126474[_0xfbd9('0x1f')][_0xfbd9('0x23')]||null:null,'include':_0x126474[_0xfbd9('0x1f')]?_0x126474[_0xfbd9('0x1f')][_0xfbd9('0x24')]?_[_0xfbd9('0x25')](_0x126474['options'][_0xfbd9('0x24')],function(_0x4531f7){return{'model':db[_0x4531f7['model']],'as':_0x4531f7['as'],'attributes':_0x4531f7[_0xfbd9('0x22')],'include':_0x4531f7[_0xfbd9('0x24')]?_['map'](_0x4531f7[_0xfbd9('0x24')],function(_0x1fa857){return{'model':db[_0x1fa857['model']],'as':_0x1fa857['as'],'attributes':_0x1fa857['attributes'],'include':_0x1fa857[_0xfbd9('0x24')]?_[_0xfbd9('0x25')](_0x1fa857[_0xfbd9('0x24')],function(_0x4ea97f){return{'model':db[_0x4ea97f[_0xfbd9('0x26')]],'as':_0x4ea97f['as'],'attributes':_0x4ea97f[_0xfbd9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfbd9('0x12')](function(_0x4cd25e){logger[_0xfbd9('0x13')]('GetVoiceQueue',_0x126474);logger[_0xfbd9('0x15')]('GetVoiceQueue',_0x126474,JSON[_0xfbd9('0x17')](_0x4cd25e));_0x3dc68e(_0x4cd25e);})[_0xfbd9('0x27')](function(_0x3aa3c3){logger[_0xfbd9('0x18')]('GetVoiceQueue',_0x3aa3c3['message'],_0x126474);_0x43e045(_0x419477['error'](0x1f4,_0x3aa3c3['message']));});});};exports[_0xfbd9('0x28')]=function(_0x49afc6){var _0x1469af=this;return new Promise(function(_0x10b5fe,_0x4c025e){return db[_0xfbd9('0x1d')][_0xfbd9('0x29')]({'raw':_0x49afc6[_0xfbd9('0x1f')]?_0x49afc6['options'][_0xfbd9('0x20')]===undefined?!![]:![]:!![],'where':_0x49afc6['options']?_0x49afc6[_0xfbd9('0x1f')][_0xfbd9('0x21')]||null:null,'attributes':_0x49afc6[_0xfbd9('0x1f')]?_0x49afc6[_0xfbd9('0x1f')][_0xfbd9('0x22')]||null:null,'include':_0x49afc6[_0xfbd9('0x1f')]?_0x49afc6['options'][_0xfbd9('0x24')]?_['map'](_0x49afc6[_0xfbd9('0x1f')][_0xfbd9('0x24')],function(_0x16d97b){return{'model':db[_0x16d97b['model']],'as':_0x16d97b['as'],'attributes':_0x16d97b['attributes'],'include':_0x16d97b[_0xfbd9('0x24')]?_[_0xfbd9('0x25')](_0x16d97b[_0xfbd9('0x24')],function(_0x59b42f){return{'model':db[_0x59b42f[_0xfbd9('0x26')]],'as':_0x59b42f['as'],'attributes':_0x59b42f[_0xfbd9('0x22')],'include':_0x59b42f[_0xfbd9('0x24')]?_[_0xfbd9('0x25')](_0x59b42f[_0xfbd9('0x24')],function(_0x30610e){return{'model':db[_0x30610e[_0xfbd9('0x26')]],'as':_0x30610e['as'],'attributes':_0x30610e[_0xfbd9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bda09){logger[_0xfbd9('0x13')]('ShowVoiceQueue',_0x49afc6);logger[_0xfbd9('0x15')](_0xfbd9('0x28'),_0x49afc6,JSON['stringify'](_0x2bda09));_0x10b5fe(_0x2bda09);})[_0xfbd9('0x27')](function(_0x4ed3dc){logger[_0xfbd9('0x18')](_0xfbd9('0x28'),_0x4ed3dc['message'],_0x49afc6);_0x4c025e(_0x1469af[_0xfbd9('0x18')](0x1f4,_0x4ed3dc['message']));});});}; \ No newline at end of file +var _0x3244=['then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueue','VoiceQueue','options','where','attributes','limit','include','map','model','ShowVoiceQueue','find','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request'];(function(_0x24ffb8,_0x234c98){var _0x1f285c=function(_0x21d9e0){while(--_0x21d9e0){_0x24ffb8['push'](_0x24ffb8['shift']());}};_0x1f285c(++_0x234c98);}(_0x3244,0x17e));var _0x4324=function(_0x228078,_0x5691b6){_0x228078=_0x228078-0x0;var _0x4c9c12=_0x3244[_0x228078];return _0x4c9c12;};'use strict';var _=require('lodash');var util=require(_0x4324('0x0'));var moment=require(_0x4324('0x1'));var BPromise=require(_0x4324('0x2'));var rs=require(_0x4324('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4324('0x4'))['db'];var utils=require(_0x4324('0x5'));var logger=require(_0x4324('0x6'))(_0x4324('0x7'));var config=require(_0x4324('0x8'));var jayson=require(_0x4324('0x9'));var client=jayson[_0x4324('0xa')]['http']({'port':0x232a});config[_0x4324('0xb')]=_[_0x4324('0xc')](config[_0x4324('0xb')],{'host':_0x4324('0xd'),'port':0x18eb});var socket=require(_0x4324('0xe'))(new Redis(config[_0x4324('0xb')]));require(_0x4324('0xf'))[_0x4324('0x10')](socket);function respondWithRpcPromise(_0x4f1ba9,_0x38c8e0,_0x500ed3){return new BPromise(function(_0x1197ae,_0x39c251){return client[_0x4324('0x11')](_0x4f1ba9,_0x500ed3)[_0x4324('0x12')](function(_0x56e9a7){logger[_0x4324('0x13')](_0x4324('0x14'),_0x38c8e0,_0x4324('0x15'));logger[_0x4324('0x16')](_0x4324('0x17'),_0x38c8e0,_0x4324('0x15'),JSON[_0x4324('0x18')](_0x56e9a7));if(_0x56e9a7[_0x4324('0x19')]){if(_0x56e9a7[_0x4324('0x19')]['code']===0x1f4){logger[_0x4324('0x19')](_0x4324('0x14'),_0x38c8e0,_0x56e9a7[_0x4324('0x19')]['message']);return _0x39c251(_0x56e9a7[_0x4324('0x19')][_0x4324('0x1a')]);}logger['error'](_0x4324('0x14'),_0x38c8e0,_0x56e9a7['error'][_0x4324('0x1a')]);return _0x1197ae(_0x56e9a7['error'][_0x4324('0x1a')]);}else{logger[_0x4324('0x13')](_0x4324('0x14'),_0x38c8e0,_0x4324('0x15'));_0x1197ae(_0x56e9a7['result'][_0x4324('0x1a')]);}})[_0x4324('0x1b')](function(_0x1e6b8f){logger['error'](_0x4324('0x14'),_0x38c8e0,_0x1e6b8f);_0x39c251(_0x1e6b8f);});});}exports[_0x4324('0x1c')]=function(_0x4a9cc6){var _0x46b6d1=this;return new Promise(function(_0x25f3df,_0x5ee28c){return db[_0x4324('0x1d')]['findAll']({'raw':_0x4a9cc6['options']?_0x4a9cc6['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a9cc6['options']?_0x4a9cc6[_0x4324('0x1e')][_0x4324('0x1f')]||null:null,'attributes':_0x4a9cc6[_0x4324('0x1e')]?_0x4a9cc6[_0x4324('0x1e')][_0x4324('0x20')]||null:null,'limit':_0x4a9cc6[_0x4324('0x1e')]?_0x4a9cc6['options'][_0x4324('0x21')]||null:null,'include':_0x4a9cc6[_0x4324('0x1e')]?_0x4a9cc6[_0x4324('0x1e')][_0x4324('0x22')]?_[_0x4324('0x23')](_0x4a9cc6[_0x4324('0x1e')]['include'],function(_0x45d6d2){return{'model':db[_0x45d6d2['model']],'as':_0x45d6d2['as'],'attributes':_0x45d6d2['attributes'],'include':_0x45d6d2[_0x4324('0x22')]?_['map'](_0x45d6d2['include'],function(_0x1b410b){return{'model':db[_0x1b410b[_0x4324('0x24')]],'as':_0x1b410b['as'],'attributes':_0x1b410b[_0x4324('0x20')],'include':_0x1b410b[_0x4324('0x22')]?_[_0x4324('0x23')](_0x1b410b[_0x4324('0x22')],function(_0x1f78fa){return{'model':db[_0x1f78fa[_0x4324('0x24')]],'as':_0x1f78fa['as'],'attributes':_0x1f78fa[_0x4324('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4324('0x12')](function(_0x5d35af){logger['info'](_0x4324('0x1c'),_0x4a9cc6);logger['debug'](_0x4324('0x1c'),_0x4a9cc6,JSON[_0x4324('0x18')](_0x5d35af));_0x25f3df(_0x5d35af);})[_0x4324('0x1b')](function(_0xbea974){logger[_0x4324('0x19')]('GetVoiceQueue',_0xbea974[_0x4324('0x1a')],_0x4a9cc6);_0x5ee28c(_0x46b6d1[_0x4324('0x19')](0x1f4,_0xbea974[_0x4324('0x1a')]));});});};exports[_0x4324('0x25')]=function(_0x36b4b6){var _0x46bf56=this;return new Promise(function(_0x16043b,_0x29309b){return db[_0x4324('0x1d')][_0x4324('0x26')]({'raw':_0x36b4b6[_0x4324('0x1e')]?_0x36b4b6[_0x4324('0x1e')][_0x4324('0x27')]===undefined?!![]:![]:!![],'where':_0x36b4b6[_0x4324('0x1e')]?_0x36b4b6[_0x4324('0x1e')]['where']||null:null,'attributes':_0x36b4b6[_0x4324('0x1e')]?_0x36b4b6[_0x4324('0x1e')]['attributes']||null:null,'include':_0x36b4b6['options']?_0x36b4b6['options'][_0x4324('0x22')]?_[_0x4324('0x23')](_0x36b4b6['options'][_0x4324('0x22')],function(_0x36165b){return{'model':db[_0x36165b['model']],'as':_0x36165b['as'],'attributes':_0x36165b[_0x4324('0x20')],'include':_0x36165b[_0x4324('0x22')]?_[_0x4324('0x23')](_0x36165b[_0x4324('0x22')],function(_0x200f53){return{'model':db[_0x200f53[_0x4324('0x24')]],'as':_0x200f53['as'],'attributes':_0x200f53['attributes'],'include':_0x200f53[_0x4324('0x22')]?_[_0x4324('0x23')](_0x200f53['include'],function(_0x5be94a){return{'model':db[_0x5be94a[_0x4324('0x24')]],'as':_0x5be94a['as'],'attributes':_0x5be94a['attributes']};}):[]};}):[]};}):[]:[]})[_0x4324('0x12')](function(_0x4c7f4f){logger[_0x4324('0x13')](_0x4324('0x25'),_0x36b4b6);logger[_0x4324('0x16')](_0x4324('0x25'),_0x36b4b6,JSON[_0x4324('0x18')](_0x4c7f4f));_0x16043b(_0x4c7f4f);})[_0x4324('0x1b')](function(_0x565e19){logger['error'](_0x4324('0x25'),_0x565e19[_0x4324('0x1a')],_0x36b4b6);_0x29309b(_0x46bf56[_0x4324('0x19')](0x1f4,_0x565e19[_0x4324('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 22df888..25367d7 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 _0x0e07=['./voiceQueue.events','save','update','emit','register','voiceQueue:'];(function(_0x340737,_0x4e773c){var _0x41e24b=function(_0x51fe2f){while(--_0x51fe2f){_0x340737['push'](_0x340737['shift']());}};_0x41e24b(++_0x4e773c);}(_0x0e07,0x150));var _0x70e0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0e07[_0x160c73];return _0xd9302;};'use strict';var VoiceQueueEvents=require(_0x70e0('0x0'));var events=[_0x70e0('0x1'),'remove',_0x70e0('0x2')];function createListener(_0x46b502,_0x33f9f7){return function(_0x4af05b){_0x33f9f7[_0x70e0('0x3')](_0x46b502,_0x4af05b);};}function removeListener(_0x29a6a0,_0xdac50c){return function(){VoiceQueueEvents['removeListener'](_0x29a6a0,_0xdac50c);};}exports[_0x70e0('0x4')]=function(_0x362d10){for(var _0x54c9e3=0x0,_0xf47254=events['length'];_0x54c9e3<_0xf47254;_0x54c9e3++){var _0x31770d=events[_0x54c9e3];var _0x3fe016=createListener(_0x70e0('0x5')+_0x31770d,_0x362d10);VoiceQueueEvents['on'](_0x31770d,_0x3fe016);}}; \ No newline at end of file +var _0x1ce3=['length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x1ce3,0x134));var _0x31ce=function(_0x1dd164,_0x2ef34b){_0x1dd164=_0x1dd164-0x0;var _0x3d4bbd=_0x1ce3[_0x1dd164];return _0x3d4bbd;};'use strict';var VoiceQueueEvents=require(_0x31ce('0x0'));var events=['save',_0x31ce('0x1'),_0x31ce('0x2')];function createListener(_0x1139d8,_0xa8e224){return function(_0x58c4b9){_0xa8e224[_0x31ce('0x3')](_0x1139d8,_0x58c4b9);};}function removeListener(_0x3871a3,_0x469179){return function(){VoiceQueueEvents['removeListener'](_0x3871a3,_0x469179);};}exports['register']=function(_0x3e2a96){for(var _0x466b56=0x0,_0xa5a952=events[_0x31ce('0x4')];_0x466b56<_0xa5a952;_0x466b56++){var _0x419105=events[_0x466b56];var _0x58cad2=createListener(_0x31ce('0x5')+_0x419105,_0x3e2a96);VoiceQueueEvents['on'](_0x419105,_0x58cad2);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 03d8bdf..9fdfe99 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 _0x3556=['util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','destroy','multer'];(function(_0xf2c6bb,_0x3ebb2c){var _0x4cde19=function(_0x47ce13){while(--_0x47ce13){_0xf2c6bb['push'](_0xf2c6bb['shift']());}};_0x4cde19(++_0x3ebb2c);}(_0x3556,0xa7));var _0x6355=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x3556[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x6355('0x0'));var util=require(_0x6355('0x1'));var path=require(_0x6355('0x2'));var timeout=require(_0x6355('0x3'));var express=require(_0x6355('0x4'));var router=express[_0x6355('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6355('0x6'));var config=require('../../config/environment');var controller=require(_0x6355('0x7'));router['get']('/',auth[_0x6355('0x8')](),controller[_0x6355('0x9')]);router[_0x6355('0xa')](_0x6355('0xb'),auth[_0x6355('0x8')](),controller[_0x6355('0xc')]);router[_0x6355('0xa')](_0x6355('0xd'),auth[_0x6355('0x8')](),controller[_0x6355('0xe')]);router[_0x6355('0xa')](_0x6355('0xf'),auth[_0x6355('0x8')](),controller[_0x6355('0x10')]);router[_0x6355('0x11')]('/',auth[_0x6355('0x8')](),controller[_0x6355('0x12')]);router[_0x6355('0x13')](_0x6355('0xf'),auth[_0x6355('0x8')](),controller['update']);router['delete'](_0x6355('0xf'),auth[_0x6355('0x8')](),controller[_0x6355('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc617=['post','create','put','update','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','getVoiceQueuesReport','/:id','show'];(function(_0x508e7a,_0x57e8bc){var _0x54df90=function(_0x4cbb3c){while(--_0x4cbb3c){_0x508e7a['push'](_0x508e7a['shift']());}};_0x54df90(++_0x57e8bc);}(_0xc617,0x110));var _0x7c61=function(_0x289c3e,_0x3614b5){_0x289c3e=_0x289c3e-0x0;var _0x25a4b3=_0xc617[_0x289c3e];return _0x25a4b3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7c61('0x0'));var timeout=require('connect-timeout');var express=require(_0x7c61('0x1'));var router=express[_0x7c61('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7c61('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7c61('0x4'));var controller=require('./voiceQueueReport.controller');router[_0x7c61('0x5')]('/',auth['isAuthenticated'](),controller[_0x7c61('0x6')]);router['get'](_0x7c61('0x7'),auth[_0x7c61('0x8')](),controller[_0x7c61('0x9')]);router[_0x7c61('0x5')]('/index',auth['isAuthenticated'](),controller[_0x7c61('0xa')]);router[_0x7c61('0x5')](_0x7c61('0xb'),auth['isAuthenticated'](),controller[_0x7c61('0xc')]);router[_0x7c61('0xd')]('/',auth[_0x7c61('0x8')](),controller[_0x7c61('0xe')]);router[_0x7c61('0xf')](_0x7c61('0xb'),auth['isAuthenticated'](),controller[_0x7c61('0x10')]);router['delete'](_0x7c61('0xb'),auth['isAuthenticated'](),controller[_0x7c61('0x11')]);module[_0x7c61('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8f31f22..e162dbd 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 _0x4897=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x9a62de,_0x127f28){var _0x14d7b3=function(_0x23d73f){while(--_0x23d73f){_0x9a62de['push'](_0x9a62de['shift']());}};_0x14d7b3(++_0x127f28);}(_0x4897,0x72));var _0x7489=function(_0x64c9ab,_0x26dfc0){_0x64c9ab=_0x64c9ab-0x0;var _0x286546=_0x4897[_0x64c9ab];return _0x286546;};'use strict';var Sequelize=require(_0x7489('0x0'));var moment=require(_0x7489('0x1'));module['exports']={'type':{'type':Sequelize[_0x7489('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7489('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x7489('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x7489('0x3')],'set':function(_0x5b8cff){var _0x409390=moment(_0x5b8cff);var _0x233b4d=moment(this[_0x7489('0x4')](_0x7489('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xc9761f=_0x409390[_0x7489('0x6')](_0x233b4d,'seconds');this[_0x7489('0x7')](_0x7489('0x8'),_0x5b8cff);this['setDataValue'](_0x7489('0x9'),_0xc9761f||null);}},'position':{'type':Sequelize[_0x7489('0xa')]},'count':{'type':Sequelize[_0x7489('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x7489('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x7489('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7489('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7489('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7489('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x7489('0xc')},'originalposition':{'type':Sequelize[_0x7489('0xa')]},'channel':{'type':Sequelize[_0x7489('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7489('0x2')]},'connectedlinename':{'type':Sequelize[_0x7489('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7489('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7489('0x2')]},'holdtime':{'type':Sequelize[_0x7489('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7489('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7489('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7489('0x2')],'comment':_0x7489('0xd')},'transferexten':{'type':Sequelize[_0x7489('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7489('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7489('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7489('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x7489('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9531=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x9531,0x1ef));var _0x1953=function(_0x81c2fc,_0x2cfaba){_0x81c2fc=_0x81c2fc-0x0;var _0x366538=_0x9531[_0x81c2fc];return _0x366538;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1953('0x0'));module[_0x1953('0x1')]={'type':{'type':Sequelize[_0x1953('0x2')]},'uniqueid':{'type':Sequelize[_0x1953('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x1953('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x1953('0x3')],'set':function(_0x2977b4){var _0x28f6dd=moment(_0x2977b4);var _0x339ca4=moment(this[_0x1953('0x4')](_0x1953('0x5')))[_0x1953('0x6')](_0x1953('0x7'));var _0x324e0a=_0x28f6dd[_0x1953('0x8')](_0x339ca4,_0x1953('0x9'));this[_0x1953('0xa')]('queuecallerleaveAt',_0x2977b4);this[_0x1953('0xa')](_0x1953('0xb'),_0x324e0a||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x1953('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1953('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x1953('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1953('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x1953('0x2')],'comment':_0x1953('0xd')},'originalposition':{'type':Sequelize[_0x1953('0xe')]},'channel':{'type':Sequelize[_0x1953('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1953('0x2')]},'connectedlinename':{'type':Sequelize[_0x1953('0x2')]},'accountcode':{'type':Sequelize[_0x1953('0x2')]},'context':{'type':Sequelize[_0x1953('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x1953('0xe')]},'mohtime':{'type':Sequelize[_0x1953('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1953('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1953('0x2')]},'transfer':{'type':Sequelize[_0x1953('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1953('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1953('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1953('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x1953('0xe')],'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 e5319fc..9b39967 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 _0x4fc6=['../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','destroy','params','describe','getVoiceQueuesReport','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x4fc6,0x1bc));var _0x64fc=function(_0x16e007,_0x214a1c){_0x16e007=_0x16e007-0x0;var _0x5daeac=_0x4fc6[_0x16e007];return _0x5daeac;};'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(_0x64fc('0x0'));var moment=require(_0x64fc('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x64fc('0x2'));var util=require(_0x64fc('0x3'));var path=require(_0x64fc('0x4'));var sox=require('sox');var csv=require(_0x64fc('0x5'));var ejs=require(_0x64fc('0x6'));var fs=require('fs');var fs_extra=require(_0x64fc('0x7'));var _=require(_0x64fc('0x8'));var squel=require(_0x64fc('0x9'));var crypto=require(_0x64fc('0xa'));var jsforce=require(_0x64fc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x64fc('0x5'));var querystring=require(_0x64fc('0xc'));var Papa=require('papaparse');var Redis=require(_0x64fc('0xd'));var authService=require(_0x64fc('0xe'));var qs=require(_0x64fc('0xf'));var as=require(_0x64fc('0x10'));var hardwareService=require(_0x64fc('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x64fc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x64fc('0x13'));var db=require('../../mysqldb')['db'];config[_0x64fc('0x14')]=_[_0x64fc('0x15')](config[_0x64fc('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x64fc('0x16'))(new Redis(config[_0x64fc('0x14')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x5f20ee,_0x50e2a0){_0x50e2a0=_0x50e2a0||0xcc;return function(_0x46e809){if(_0x46e809){return _0x5f20ee[_0x64fc('0x17')](_0x50e2a0);}return _0x5f20ee[_0x64fc('0x18')](_0x50e2a0)[_0x64fc('0x19')]();};}function respondWithResult(_0x49bd68,_0x175846){_0x175846=_0x175846||0xc8;return function(_0x2e24e8){if(_0x2e24e8){return _0x49bd68['status'](_0x175846)[_0x64fc('0x1a')](_0x2e24e8);}};}function respondWithFilteredResult(_0x2ad7a3,_0x48c8e2){return function(_0x33937f){if(_0x33937f){var _0x31b414=typeof _0x48c8e2[_0x64fc('0x1b')]===_0x64fc('0x1c')&&typeof _0x48c8e2[_0x64fc('0x1d')]===_0x64fc('0x1c');var _0x25c231=_0x33937f[_0x64fc('0x1e')];var _0x365588=_0x31b414?0x0:_0x48c8e2['offset'];var _0x2b5528=_0x31b414?_0x33937f[_0x64fc('0x1e')]:_0x48c8e2[_0x64fc('0x1b')]+_0x48c8e2[_0x64fc('0x1d')];var _0xfb09ed;if(_0x2b5528>=_0x25c231){_0x2b5528=_0x25c231;_0xfb09ed=0xc8;}else{_0xfb09ed=0xce;}_0x2ad7a3[_0x64fc('0x18')](_0xfb09ed);return _0x2ad7a3[_0x64fc('0x1f')](_0x64fc('0x20'),_0x365588+'-'+_0x2b5528+'/'+_0x25c231)[_0x64fc('0x1a')](_0x33937f);}return null;};}function patchUpdates(_0x4fa6ca){return function(_0xa77470){try{jsonpatch['apply'](_0xa77470,_0x4fa6ca,!![]);}catch(_0x36b6f3){return BPromise[_0x64fc('0x21')](_0x36b6f3);}return _0xa77470[_0x64fc('0x22')]();};}function saveUpdates(_0x3706c5,_0x5e170d){return function(_0x101b46){if(_0x101b46){return _0x101b46[_0x64fc('0x23')](_0x3706c5)[_0x64fc('0x24')](function(_0x466835){return _0x466835;});}return null;};}function removeEntity(_0x3fc81b,_0x1682b4){return function(_0xbec66c){if(_0xbec66c){return _0xbec66c['destroy']()[_0x64fc('0x24')](function(){_0x3fc81b[_0x64fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe5588,_0x2c325c){return function(_0x353f3f){if(!_0x353f3f){_0xfe5588['sendStatus'](0x194);}return _0x353f3f;};}function handleError(_0x5dbbc2,_0x28623e){_0x28623e=_0x28623e||0x1f4;return function(_0x496f62){logger[_0x64fc('0x25')](_0x496f62[_0x64fc('0x26')]);if(_0x496f62['name']){delete _0x496f62['name'];}_0x5dbbc2[_0x64fc('0x18')](_0x28623e)[_0x64fc('0x27')](_0x496f62);};}exports[_0x64fc('0x28')]=function(_0x216daa,_0x247cb2){var _0x1271d8={},_0x160a61={},_0x17d273={'count':0x0,'rows':[]};var _0x3253ac=_[_0x64fc('0x29')](db['VoiceQueueReport'][_0x64fc('0x2a')],function(_0x543662){return{'name':_0x543662[_0x64fc('0x2b')],'type':_0x543662[_0x64fc('0x2c')][_0x64fc('0x2d')]};});_0x160a61[_0x64fc('0x2e')]=_['map'](_0x3253ac,_0x64fc('0x2f'));_0x160a61['query']=_[_0x64fc('0x30')](_0x216daa[_0x64fc('0x31')]);_0x160a61[_0x64fc('0x32')]=_['intersection'](_0x160a61[_0x64fc('0x2e')],_0x160a61[_0x64fc('0x31')]);_0x1271d8[_0x64fc('0x33')]=_['intersection'](_0x160a61[_0x64fc('0x2e')],qs[_0x64fc('0x34')](_0x216daa['query'][_0x64fc('0x34')]));_0x1271d8[_0x64fc('0x33')]=_0x1271d8[_0x64fc('0x33')]['length']?_0x1271d8[_0x64fc('0x33')]:_0x160a61[_0x64fc('0x2e')];if(!_0x216daa[_0x64fc('0x31')][_0x64fc('0x35')](_0x64fc('0x36'))){_0x1271d8[_0x64fc('0x1d')]=qs[_0x64fc('0x1d')](_0x216daa['query'][_0x64fc('0x1d')]);_0x1271d8[_0x64fc('0x1b')]=qs[_0x64fc('0x1b')](_0x216daa[_0x64fc('0x31')]['offset']);}_0x1271d8[_0x64fc('0x37')]=qs[_0x64fc('0x38')](_0x216daa[_0x64fc('0x31')][_0x64fc('0x38')]);_0x1271d8[_0x64fc('0x39')]=qs[_0x64fc('0x32')](_[_0x64fc('0x3a')](_0x216daa[_0x64fc('0x31')],_0x160a61[_0x64fc('0x32')]),_0x3253ac);if(_0x216daa[_0x64fc('0x31')]['filter']){_0x1271d8['where']=_['merge'](_0x1271d8['where'],{'$or':_[_0x64fc('0x29')](_0x3253ac,function(_0x30de97){if(_0x30de97[_0x64fc('0x2c')]!=='VIRTUAL'){var _0x5f19fa={};_0x5f19fa[_0x30de97[_0x64fc('0x2f')]]={'$like':'%'+_0x216daa[_0x64fc('0x31')][_0x64fc('0x3b')]+'%'};return _0x5f19fa;}})});}_0x1271d8=_[_0x64fc('0x3c')]({},_0x1271d8,_0x216daa[_0x64fc('0x3d')]);var _0x4b3538={'where':_0x1271d8[_0x64fc('0x39')]};return db[_0x64fc('0x3e')][_0x64fc('0x1e')](_0x4b3538)['then'](function(_0x1a26bc){_0x17d273[_0x64fc('0x1e')]=_0x1a26bc;if(_0x216daa['query'][_0x64fc('0x3f')]){_0x1271d8[_0x64fc('0x40')]=[{'all':!![]}];}return db[_0x64fc('0x3e')][_0x64fc('0x41')](_0x1271d8);})[_0x64fc('0x24')](function(_0x3c341d){_0x17d273[_0x64fc('0x42')]=_0x3c341d;return _0x17d273;})[_0x64fc('0x24')](respondWithFilteredResult(_0x247cb2,_0x1271d8))[_0x64fc('0x43')](handleError(_0x247cb2,null));};exports[_0x64fc('0x44')]=function(_0x2f1404,_0x45e4bb){var _0x9692d7={'raw':![],'where':{'id':_0x2f1404['params']['id']}},_0x8dc950={};_0x8dc950[_0x64fc('0x2e')]=_[_0x64fc('0x30')](db[_0x64fc('0x3e')][_0x64fc('0x2a')]);_0x8dc950[_0x64fc('0x31')]=_[_0x64fc('0x30')](_0x2f1404[_0x64fc('0x31')]);_0x8dc950[_0x64fc('0x32')]=_[_0x64fc('0x45')](_0x8dc950[_0x64fc('0x2e')],_0x8dc950[_0x64fc('0x31')]);_0x9692d7[_0x64fc('0x33')]=_[_0x64fc('0x45')](_0x8dc950[_0x64fc('0x2e')],qs[_0x64fc('0x34')](_0x2f1404[_0x64fc('0x31')][_0x64fc('0x34')]));_0x9692d7[_0x64fc('0x33')]=_0x9692d7['attributes']['length']?_0x9692d7[_0x64fc('0x33')]:_0x8dc950[_0x64fc('0x2e')];if(_0x2f1404['query']['includeAll']){_0x9692d7[_0x64fc('0x40')]=[{'all':!![]}];}_0x9692d7=_[_0x64fc('0x3c')]({},_0x9692d7,_0x2f1404[_0x64fc('0x3d')]);return db[_0x64fc('0x3e')][_0x64fc('0x46')](_0x9692d7)[_0x64fc('0x24')](handleEntityNotFound(_0x45e4bb,null))[_0x64fc('0x24')](respondWithResult(_0x45e4bb,null))[_0x64fc('0x43')](handleError(_0x45e4bb,null));};exports[_0x64fc('0x47')]=function(_0x2cfa26,_0x22aab7){return db[_0x64fc('0x3e')][_0x64fc('0x47')](_0x2cfa26[_0x64fc('0x48')],{})[_0x64fc('0x24')](respondWithResult(_0x22aab7,0xc9))['catch'](handleError(_0x22aab7,null));};exports[_0x64fc('0x23')]=function(_0x501d59,_0x326efe){if(_0x501d59[_0x64fc('0x48')]['id']){delete _0x501d59[_0x64fc('0x48')]['id'];}return db[_0x64fc('0x3e')][_0x64fc('0x46')]({'where':{'id':_0x501d59['params']['id']}})[_0x64fc('0x24')](handleEntityNotFound(_0x326efe,null))['then'](saveUpdates(_0x501d59[_0x64fc('0x48')],null))[_0x64fc('0x24')](respondWithResult(_0x326efe,null))[_0x64fc('0x43')](handleError(_0x326efe,null));};exports[_0x64fc('0x49')]=function(_0x24d6a5,_0x191e67){return db['VoiceQueueReport'][_0x64fc('0x46')]({'where':{'id':_0x24d6a5[_0x64fc('0x4a')]['id']}})[_0x64fc('0x24')](handleEntityNotFound(_0x191e67,null))[_0x64fc('0x24')](removeEntity(_0x191e67,null))['catch'](handleError(_0x191e67,null));};exports[_0x64fc('0x4b')]=function(_0x3423d4,_0x23339e){return db[_0x64fc('0x3e')][_0x64fc('0x4b')]()[_0x64fc('0x24')](respondWithResult(_0x23339e,null))[_0x64fc('0x43')](handleError(_0x23339e,null));};exports[_0x64fc('0x4c')]=function(_0x354e74,_0x25e96f){var _0x651ee3={},_0x2e9b1d={},_0x55730f={'count':0x0,'rows':[]};_0x2e9b1d['model']=_[_0x64fc('0x30')](db[_0x64fc('0x3e')][_0x64fc('0x2a')]);_0x2e9b1d[_0x64fc('0x31')]=_[_0x64fc('0x30')](_0x354e74[_0x64fc('0x31')]);_0x2e9b1d[_0x64fc('0x32')]=_[_0x64fc('0x45')](_0x2e9b1d[_0x64fc('0x2e')],_0x2e9b1d[_0x64fc('0x31')]);_0x651ee3['attributes']=_[_0x64fc('0x45')](_0x2e9b1d[_0x64fc('0x2e')],qs['fields'](_0x354e74[_0x64fc('0x31')][_0x64fc('0x34')]));_0x651ee3[_0x64fc('0x33')]=_0x651ee3[_0x64fc('0x33')]['length']?_0x651ee3[_0x64fc('0x33')]:_0x2e9b1d[_0x64fc('0x2e')];if(!_0x354e74[_0x64fc('0x31')][_0x64fc('0x35')](_0x64fc('0x36'))){_0x651ee3[_0x64fc('0x1d')]=qs[_0x64fc('0x1d')](_0x354e74['query'][_0x64fc('0x1d')]);_0x651ee3[_0x64fc('0x1b')]=qs['offset'](_0x354e74['query']['offset']);}_0x651ee3['order']=qs['sort'](_0x354e74[_0x64fc('0x31')][_0x64fc('0x38')]);_0x651ee3[_0x64fc('0x39')]=qs[_0x64fc('0x32')](_[_0x64fc('0x3a')](_0x354e74[_0x64fc('0x31')],_0x2e9b1d[_0x64fc('0x32')]));if(_0x354e74[_0x64fc('0x31')][_0x64fc('0x3b')]){_0x651ee3[_0x64fc('0x39')]=_[_0x64fc('0x3c')](_0x651ee3[_0x64fc('0x39')],{'$or':_[_0x64fc('0x29')](_0x651ee3[_0x64fc('0x33')],function(_0x52b4f0){var _0x40bb97={};_0x40bb97[_0x52b4f0]={'$like':'%'+_0x354e74[_0x64fc('0x31')]['filter']+'%'};return _0x40bb97;})});}_0x651ee3=_[_0x64fc('0x3c')]({},_0x651ee3,_0x354e74['options']);var _0x29341e={'where':_0x651ee3[_0x64fc('0x39')]};return db[_0x64fc('0x3e')][_0x64fc('0x1e')](_0x29341e)[_0x64fc('0x24')](function(_0x5ea29f){_0x55730f[_0x64fc('0x1e')]=_0x5ea29f;if(_0x354e74[_0x64fc('0x31')][_0x64fc('0x3f')]){_0x651ee3[_0x64fc('0x40')]=[{'all':!![]}];}return db[_0x64fc('0x3e')][_0x64fc('0x41')](_0x651ee3);})[_0x64fc('0x24')](function(_0x38a4bb){_0x55730f[_0x64fc('0x42')]=_0x38a4bb;return _0x55730f;})['then'](respondWithFilteredResult(_0x25e96f,_0x651ee3,_0x64fc('0x4c')))[_0x64fc('0x43')](handleError(_0x25e96f,null,_0x64fc('0x4c')));}; \ No newline at end of file +var _0xfd72=['path','sox','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','VoiceQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','getVoiceQueuesReport','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfd72,0x140));var _0x2fd7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xfd72[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fd7('0x0'));var zipdir=require(_0x2fd7('0x1'));var jsonpatch=require(_0x2fd7('0x2'));var rp=require(_0x2fd7('0x3'));var moment=require(_0x2fd7('0x4'));var BPromise=require(_0x2fd7('0x5'));var Mustache=require(_0x2fd7('0x6'));var util=require(_0x2fd7('0x7'));var path=require(_0x2fd7('0x8'));var sox=require(_0x2fd7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fd7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2fd7('0xb'));var deskjs=require(_0x2fd7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2fd7('0xd'));var Redis=require(_0x2fd7('0xe'));var authService=require(_0x2fd7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2fd7('0x10'));var hardwareService=require(_0x2fd7('0x11'));var logger=require('../../config/logger')(_0x2fd7('0x12'));var utils=require('../../config/utils');var config=require(_0x2fd7('0x13'));var licenseUtil=require(_0x2fd7('0x14'));var db=require(_0x2fd7('0x15'))['db'];config[_0x2fd7('0x16')]=_[_0x2fd7('0x17')](config[_0x2fd7('0x16')],{'host':_0x2fd7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fd7('0x16')]));require(_0x2fd7('0x19'))[_0x2fd7('0x1a')](socket);function respondWithStatusCode(_0x25da30,_0x15a88a){_0x15a88a=_0x15a88a||0xcc;return function(_0xcb9966){if(_0xcb9966){return _0x25da30[_0x2fd7('0x1b')](_0x15a88a);}return _0x25da30[_0x2fd7('0x1c')](_0x15a88a)[_0x2fd7('0x1d')]();};}function respondWithResult(_0x4121d4,_0x288798){_0x288798=_0x288798||0xc8;return function(_0x550967){if(_0x550967){return _0x4121d4[_0x2fd7('0x1c')](_0x288798)['json'](_0x550967);}};}function respondWithFilteredResult(_0x591505,_0x525f91){return function(_0x3c73a9){if(_0x3c73a9){var _0x424a2a=typeof _0x525f91[_0x2fd7('0x1e')]===_0x2fd7('0x1f')&&typeof _0x525f91['limit']===_0x2fd7('0x1f');var _0x143506=_0x3c73a9[_0x2fd7('0x20')];var _0x24a6c7=_0x424a2a?0x0:_0x525f91[_0x2fd7('0x1e')];var _0x5450d9=_0x424a2a?_0x3c73a9['count']:_0x525f91[_0x2fd7('0x1e')]+_0x525f91['limit'];var _0x42e1e0;if(_0x5450d9>=_0x143506){_0x5450d9=_0x143506;_0x42e1e0=0xc8;}else{_0x42e1e0=0xce;}_0x591505[_0x2fd7('0x1c')](_0x42e1e0);return _0x591505[_0x2fd7('0x21')](_0x2fd7('0x22'),_0x24a6c7+'-'+_0x5450d9+'/'+_0x143506)[_0x2fd7('0x23')](_0x3c73a9);}return null;};}function patchUpdates(_0xc4b57a){return function(_0x444c64){try{jsonpatch[_0x2fd7('0x24')](_0x444c64,_0xc4b57a,!![]);}catch(_0x44ec71){return BPromise[_0x2fd7('0x25')](_0x44ec71);}return _0x444c64[_0x2fd7('0x26')]();};}function saveUpdates(_0xa4efd5,_0xfc0d7e){return function(_0x1766e9){if(_0x1766e9){return _0x1766e9[_0x2fd7('0x27')](_0xa4efd5)[_0x2fd7('0x28')](function(_0x3a50d4){return _0x3a50d4;});}return null;};}function removeEntity(_0x162459,_0x5b27e8){return function(_0x50fccb){if(_0x50fccb){return _0x50fccb['destroy']()[_0x2fd7('0x28')](function(){_0x162459['status'](0xcc)[_0x2fd7('0x1d')]();});}};}function handleEntityNotFound(_0x1a613d,_0x3c6c08){return function(_0x406350){if(!_0x406350){_0x1a613d['sendStatus'](0x194);}return _0x406350;};}function handleError(_0x5f232a,_0x1ebf3d){_0x1ebf3d=_0x1ebf3d||0x1f4;return function(_0x3d07da){logger[_0x2fd7('0x29')](_0x3d07da[_0x2fd7('0x2a')]);if(_0x3d07da[_0x2fd7('0x2b')]){delete _0x3d07da['name'];}_0x5f232a[_0x2fd7('0x1c')](_0x1ebf3d)[_0x2fd7('0x2c')](_0x3d07da);};}exports[_0x2fd7('0x2d')]=function(_0x1d66b7,_0x88d7b6){var _0x2974ef={},_0x407331={},_0x3b25db={'count':0x0,'rows':[]};var _0x2de9a6=_['map'](db[_0x2fd7('0x2e')][_0x2fd7('0x2f')],function(_0x4b4543){return{'name':_0x4b4543['fieldName'],'type':_0x4b4543[_0x2fd7('0x30')][_0x2fd7('0x31')]};});_0x407331[_0x2fd7('0x32')]=_['map'](_0x2de9a6,_0x2fd7('0x2b'));_0x407331[_0x2fd7('0x33')]=_[_0x2fd7('0x34')](_0x1d66b7[_0x2fd7('0x33')]);_0x407331['filters']=_[_0x2fd7('0x35')](_0x407331[_0x2fd7('0x32')],_0x407331[_0x2fd7('0x33')]);_0x2974ef[_0x2fd7('0x36')]=_[_0x2fd7('0x35')](_0x407331['model'],qs['fields'](_0x1d66b7[_0x2fd7('0x33')][_0x2fd7('0x37')]));_0x2974ef[_0x2fd7('0x36')]=_0x2974ef[_0x2fd7('0x36')][_0x2fd7('0x38')]?_0x2974ef['attributes']:_0x407331[_0x2fd7('0x32')];if(!_0x1d66b7[_0x2fd7('0x33')][_0x2fd7('0x39')](_0x2fd7('0x3a'))){_0x2974ef[_0x2fd7('0x3b')]=qs['limit'](_0x1d66b7[_0x2fd7('0x33')]['limit']);_0x2974ef[_0x2fd7('0x1e')]=qs[_0x2fd7('0x1e')](_0x1d66b7['query'][_0x2fd7('0x1e')]);}_0x2974ef[_0x2fd7('0x3c')]=qs['sort'](_0x1d66b7[_0x2fd7('0x33')][_0x2fd7('0x3d')]);_0x2974ef[_0x2fd7('0x3e')]=qs[_0x2fd7('0x3f')](_['pick'](_0x1d66b7[_0x2fd7('0x33')],_0x407331[_0x2fd7('0x3f')]),_0x2de9a6);if(_0x1d66b7[_0x2fd7('0x33')][_0x2fd7('0x40')]){_0x2974ef[_0x2fd7('0x3e')]=_[_0x2fd7('0x41')](_0x2974ef[_0x2fd7('0x3e')],{'$or':_[_0x2fd7('0x42')](_0x2de9a6,function(_0x486209){if(_0x486209[_0x2fd7('0x30')]!==_0x2fd7('0x43')){var _0x3e2534={};_0x3e2534[_0x486209[_0x2fd7('0x2b')]]={'$like':'%'+_0x1d66b7['query']['filter']+'%'};return _0x3e2534;}})});}_0x2974ef=_['merge']({},_0x2974ef,_0x1d66b7['options']);var _0x3dfc39={'where':_0x2974ef[_0x2fd7('0x3e')]};return db[_0x2fd7('0x2e')][_0x2fd7('0x20')](_0x3dfc39)[_0x2fd7('0x28')](function(_0x4ea55d){_0x3b25db[_0x2fd7('0x20')]=_0x4ea55d;if(_0x1d66b7[_0x2fd7('0x33')][_0x2fd7('0x44')]){_0x2974ef[_0x2fd7('0x45')]=[{'all':!![]}];}return db[_0x2fd7('0x2e')][_0x2fd7('0x46')](_0x2974ef);})[_0x2fd7('0x28')](function(_0x499935){_0x3b25db[_0x2fd7('0x47')]=_0x499935;return _0x3b25db;})[_0x2fd7('0x28')](respondWithFilteredResult(_0x88d7b6,_0x2974ef))[_0x2fd7('0x48')](handleError(_0x88d7b6,null));};exports['show']=function(_0x5d6266,_0x2199bc){var _0x3c2d07={'raw':![],'where':{'id':_0x5d6266[_0x2fd7('0x49')]['id']}},_0x158eff={};_0x158eff[_0x2fd7('0x32')]=_[_0x2fd7('0x34')](db['VoiceQueueReport'][_0x2fd7('0x2f')]);_0x158eff[_0x2fd7('0x33')]=_[_0x2fd7('0x34')](_0x5d6266[_0x2fd7('0x33')]);_0x158eff[_0x2fd7('0x3f')]=_[_0x2fd7('0x35')](_0x158eff[_0x2fd7('0x32')],_0x158eff[_0x2fd7('0x33')]);_0x3c2d07[_0x2fd7('0x36')]=_[_0x2fd7('0x35')](_0x158eff['model'],qs[_0x2fd7('0x37')](_0x5d6266[_0x2fd7('0x33')][_0x2fd7('0x37')]));_0x3c2d07[_0x2fd7('0x36')]=_0x3c2d07[_0x2fd7('0x36')][_0x2fd7('0x38')]?_0x3c2d07[_0x2fd7('0x36')]:_0x158eff[_0x2fd7('0x32')];if(_0x5d6266[_0x2fd7('0x33')][_0x2fd7('0x44')]){_0x3c2d07[_0x2fd7('0x45')]=[{'all':!![]}];}_0x3c2d07=_[_0x2fd7('0x41')]({},_0x3c2d07,_0x5d6266[_0x2fd7('0x4a')]);return db['VoiceQueueReport'][_0x2fd7('0x4b')](_0x3c2d07)[_0x2fd7('0x28')](handleEntityNotFound(_0x2199bc,null))['then'](respondWithResult(_0x2199bc,null))[_0x2fd7('0x48')](handleError(_0x2199bc,null));};exports[_0x2fd7('0x4c')]=function(_0x497115,_0x2212bd){return db['VoiceQueueReport'][_0x2fd7('0x4c')](_0x497115['body'],{})['then'](respondWithResult(_0x2212bd,0xc9))[_0x2fd7('0x48')](handleError(_0x2212bd,null));};exports['update']=function(_0x42aa36,_0x3ff911){if(_0x42aa36[_0x2fd7('0x4d')]['id']){delete _0x42aa36[_0x2fd7('0x4d')]['id'];}return db['VoiceQueueReport'][_0x2fd7('0x4b')]({'where':{'id':_0x42aa36[_0x2fd7('0x49')]['id']}})[_0x2fd7('0x28')](handleEntityNotFound(_0x3ff911,null))['then'](saveUpdates(_0x42aa36[_0x2fd7('0x4d')],null))['then'](respondWithResult(_0x3ff911,null))[_0x2fd7('0x48')](handleError(_0x3ff911,null));};exports[_0x2fd7('0x4e')]=function(_0x7ccfb4,_0x3a45f7){return db[_0x2fd7('0x2e')][_0x2fd7('0x4b')]({'where':{'id':_0x7ccfb4[_0x2fd7('0x49')]['id']}})[_0x2fd7('0x28')](handleEntityNotFound(_0x3a45f7,null))[_0x2fd7('0x28')](removeEntity(_0x3a45f7,null))[_0x2fd7('0x48')](handleError(_0x3a45f7,null));};exports[_0x2fd7('0x4f')]=function(_0x58c1e0,_0x5694ba){return db[_0x2fd7('0x2e')][_0x2fd7('0x4f')]()['then'](respondWithResult(_0x5694ba,null))[_0x2fd7('0x48')](handleError(_0x5694ba,null));};exports[_0x2fd7('0x50')]=function(_0x93f6d,_0x407a17){var _0x2ae39b={},_0x22127d={},_0x38f9c5={'count':0x0,'rows':[]};_0x22127d[_0x2fd7('0x32')]=_[_0x2fd7('0x34')](db[_0x2fd7('0x2e')]['rawAttributes']);_0x22127d[_0x2fd7('0x33')]=_[_0x2fd7('0x34')](_0x93f6d[_0x2fd7('0x33')]);_0x22127d['filters']=_[_0x2fd7('0x35')](_0x22127d[_0x2fd7('0x32')],_0x22127d['query']);_0x2ae39b[_0x2fd7('0x36')]=_[_0x2fd7('0x35')](_0x22127d[_0x2fd7('0x32')],qs['fields'](_0x93f6d[_0x2fd7('0x33')][_0x2fd7('0x37')]));_0x2ae39b['attributes']=_0x2ae39b[_0x2fd7('0x36')]['length']?_0x2ae39b[_0x2fd7('0x36')]:_0x22127d[_0x2fd7('0x32')];if(!_0x93f6d[_0x2fd7('0x33')][_0x2fd7('0x39')](_0x2fd7('0x3a'))){_0x2ae39b[_0x2fd7('0x3b')]=qs[_0x2fd7('0x3b')](_0x93f6d[_0x2fd7('0x33')][_0x2fd7('0x3b')]);_0x2ae39b['offset']=qs[_0x2fd7('0x1e')](_0x93f6d['query']['offset']);}_0x2ae39b[_0x2fd7('0x3c')]=qs['sort'](_0x93f6d[_0x2fd7('0x33')][_0x2fd7('0x3d')]);_0x2ae39b['where']=qs[_0x2fd7('0x3f')](_[_0x2fd7('0x51')](_0x93f6d[_0x2fd7('0x33')],_0x22127d[_0x2fd7('0x3f')]));if(_0x93f6d[_0x2fd7('0x33')]['filter']){_0x2ae39b[_0x2fd7('0x3e')]=_[_0x2fd7('0x41')](_0x2ae39b[_0x2fd7('0x3e')],{'$or':_[_0x2fd7('0x42')](_0x2ae39b[_0x2fd7('0x36')],function(_0x27e473){var _0x50510c={};_0x50510c[_0x27e473]={'$like':'%'+_0x93f6d['query'][_0x2fd7('0x40')]+'%'};return _0x50510c;})});}_0x2ae39b=_[_0x2fd7('0x41')]({},_0x2ae39b,_0x93f6d['options']);var _0x24761d={'where':_0x2ae39b['where']};return db[_0x2fd7('0x2e')][_0x2fd7('0x20')](_0x24761d)[_0x2fd7('0x28')](function(_0x4435f2){_0x38f9c5[_0x2fd7('0x20')]=_0x4435f2;if(_0x93f6d[_0x2fd7('0x33')][_0x2fd7('0x44')]){_0x2ae39b[_0x2fd7('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2fd7('0x46')](_0x2ae39b);})[_0x2fd7('0x28')](function(_0x48516a){_0x38f9c5['rows']=_0x48516a;return _0x38f9c5;})[_0x2fd7('0x28')](respondWithFilteredResult(_0x407a17,_0x2ae39b,_0x2fd7('0x50')))[_0x2fd7('0x48')](handleError(_0x407a17,null,_0x2fd7('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index da45269..2cf2099 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 _0x25e4=['hasOwnProperty','events','../../mysqldb','VoiceQueueReport','save','remove','emit'];(function(_0x433e29,_0x14b418){var _0x84abd4=function(_0x232635){while(--_0x232635){_0x433e29['push'](_0x433e29['shift']());}};_0x84abd4(++_0x14b418);}(_0x25e4,0x135));var _0x425e=function(_0x40293e,_0x3f86cd){_0x40293e=_0x40293e-0x0;var _0x10ec22=_0x25e4[_0x40293e];return _0x10ec22;};'use strict';var EventEmitter=require(_0x425e('0x0'));var VoiceQueueReport=require(_0x425e('0x1'))['db'][_0x425e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x425e('0x3'),'afterUpdate':'update','afterDestroy':_0x425e('0x4')};function emitEvent(_0x58e262){return function(_0x201ea4,_0x1bf8dd,_0x380b36){VoiceQueueReportEvents[_0x425e('0x5')](_0x58e262+':'+_0x201ea4['id'],_0x201ea4);VoiceQueueReportEvents[_0x425e('0x5')](_0x58e262,_0x201ea4);_0x380b36(null);};}for(var e in events){if(events[_0x425e('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x13ef=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x13ef,0x19c));var _0xf13e=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x13ef[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0xf13e('0x0'));var VoiceQueueReport=require(_0xf13e('0x1'))['db'][_0xf13e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf13e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x235545){return function(_0x5bd42d,_0xdb684e,_0x383ee8){VoiceQueueReportEvents[_0xf13e('0x4')](_0x235545+':'+_0x5bd42d['id'],_0x5bd42d);VoiceQueueReportEvents['emit'](_0x235545,_0x5bd42d);_0x383ee8(null);};}for(var e in events){if(events[_0xf13e('0x5')](e)){var event=events[e];VoiceQueueReport[_0xf13e('0x6')](e,emitEvent(event));}}module[_0xf13e('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 46476ba..ee8fba9 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 _0xcb31=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','report_queue','uniqueid','lodash'];(function(_0x2265e6,_0x131794){var _0x50c937=function(_0x31a78b){while(--_0x31a78b){_0x2265e6['push'](_0x2265e6['shift']());}};_0x50c937(++_0x131794);}(_0xcb31,0xe6));var _0x1cb3=function(_0x366c46,_0x2132fd){_0x366c46=_0x366c46-0x0;var _0x53b39c=_0xcb31[_0x366c46];return _0x53b39c;};'use strict';var _=require(_0x1cb3('0x0'));var util=require(_0x1cb3('0x1'));var logger=require(_0x1cb3('0x2'))(_0x1cb3('0x3'));var moment=require('moment');var BPromise=require(_0x1cb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1cb3('0x5'));var config=require(_0x1cb3('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x1cb3('0x7')]=function(_0x263a7d,_0xd1cc36){return _0x263a7d[_0x1cb3('0x8')]('VoiceQueueReport',attributes,{'tableName':_0x1cb3('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1cb3('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e1d=['report_queue','uniqueid','calleridnum','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define'];(function(_0x3b78c1,_0x239a07){var _0x429584=function(_0x2a2ed9){while(--_0x2a2ed9){_0x3b78c1['push'](_0x3b78c1['shift']());}};_0x429584(++_0x239a07);}(_0x8e1d,0x65));var _0xd8e1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8e1d[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xd8e1('0x0'));var util=require(_0xd8e1('0x1'));var logger=require('../../config/logger')(_0xd8e1('0x2'));var moment=require('moment');var BPromise=require(_0xd8e1('0x3'));var rp=require(_0xd8e1('0x4'));var fs=require('fs');var path=require(_0xd8e1('0x5'));var rimraf=require(_0xd8e1('0x6'));var config=require(_0xd8e1('0x7'));var attributes=require(_0xd8e1('0x8'));module[_0xd8e1('0x9')]=function(_0x1d294c,_0x6092bd){return _0x1d294c[_0xd8e1('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xd8e1('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd8e1('0xc')]},{'fields':[_0xd8e1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index aa74877..e88071b 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 _0x1078=['stringify','UpdateVoiceQueueReport','update','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','VoiceQueueReport,\x20%s,\x20%s','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','model','map','include','CreateVoiceQueueReport','create','body','raw'];(function(_0x136628,_0xdd3206){var _0x35aad7=function(_0x542332){while(--_0x542332){_0x136628['push'](_0x136628['shift']());}};_0x35aad7(++_0xdd3206);}(_0x1078,0x174));var _0x8107=function(_0x550e26,_0x1e1050){_0x550e26=_0x550e26-0x0;var _0x5b0782=_0x1078[_0x550e26];return _0x5b0782;};'use strict';var _=require(_0x8107('0x0'));var util=require('util');var moment=require(_0x8107('0x1'));var BPromise=require(_0x8107('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8107('0x3'));var db=require(_0x8107('0x4'))['db'];var utils=require(_0x8107('0x5'));var logger=require(_0x8107('0x6'))(_0x8107('0x7'));var config=require('../../config/environment');var jayson=require(_0x8107('0x8'));var client=jayson[_0x8107('0x9')][_0x8107('0xa')]({'port':0x232a});config[_0x8107('0xb')]=_['defaults'](config[_0x8107('0xb')],{'host':_0x8107('0xc'),'port':0x18eb});var socket=require(_0x8107('0xd'))(new Redis(config[_0x8107('0xb')]));require(_0x8107('0xe'))['register'](socket);function respondWithRpcPromise(_0x1a347e,_0x4d4418,_0x3baae1){return new BPromise(function(_0x11950f,_0x27558d){return client['request'](_0x1a347e,_0x3baae1)[_0x8107('0xf')](function(_0x849a9a){logger[_0x8107('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d4418,_0x8107('0x11'));logger[_0x8107('0x12')](_0x8107('0x13'),_0x4d4418,'request\x20sent',JSON['stringify'](_0x849a9a));if(_0x849a9a[_0x8107('0x14')]){if(_0x849a9a[_0x8107('0x14')]['code']===0x1f4){logger[_0x8107('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d4418,_0x849a9a[_0x8107('0x14')][_0x8107('0x15')]);return _0x27558d(_0x849a9a[_0x8107('0x14')][_0x8107('0x15')]);}logger[_0x8107('0x14')](_0x8107('0x16'),_0x4d4418,_0x849a9a[_0x8107('0x14')]['message']);return _0x11950f(_0x849a9a[_0x8107('0x14')][_0x8107('0x15')]);}else{logger['info'](_0x8107('0x16'),_0x4d4418,_0x8107('0x11'));_0x11950f(_0x849a9a['result'][_0x8107('0x15')]);}})[_0x8107('0x17')](function(_0x3e9df0){logger[_0x8107('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d4418,_0x3e9df0);_0x27558d(_0x3e9df0);});});}exports[_0x8107('0x18')]=function(_0x460c1b){var _0x2a5746=this;return new Promise(function(_0x2f023d,_0x3962ef){return db[_0x8107('0x19')][_0x8107('0x1a')]({'raw':_0x460c1b[_0x8107('0x1b')]?_0x460c1b[_0x8107('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x460c1b[_0x8107('0x1b')]?_0x460c1b[_0x8107('0x1b')][_0x8107('0x1c')]||null:null,'attributes':_0x460c1b[_0x8107('0x1b')]?_0x460c1b[_0x8107('0x1b')][_0x8107('0x1d')]||null:null,'limit':_0x460c1b['options']?_0x460c1b[_0x8107('0x1b')][_0x8107('0x1e')]||null:null,'include':_0x460c1b[_0x8107('0x1b')]?_0x460c1b[_0x8107('0x1b')]['include']?_['map'](_0x460c1b[_0x8107('0x1b')]['include'],function(_0x3254ce){return{'model':db[_0x3254ce[_0x8107('0x1f')]],'as':_0x3254ce['as'],'attributes':_0x3254ce[_0x8107('0x1d')],'include':_0x3254ce['include']?_[_0x8107('0x20')](_0x3254ce[_0x8107('0x21')],function(_0x55144b){return{'model':db[_0x55144b[_0x8107('0x1f')]],'as':_0x55144b['as'],'attributes':_0x55144b[_0x8107('0x1d')],'include':_0x55144b['include']?_[_0x8107('0x20')](_0x55144b[_0x8107('0x21')],function(_0x5d0431){return{'model':db[_0x5d0431[_0x8107('0x1f')]],'as':_0x5d0431['as'],'attributes':_0x5d0431[_0x8107('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x362a74){logger[_0x8107('0x10')]('GetVoiceQueueReport',_0x460c1b);logger[_0x8107('0x12')](_0x8107('0x18'),_0x460c1b,JSON['stringify'](_0x362a74));_0x2f023d(_0x362a74);})['catch'](function(_0x511b09){logger[_0x8107('0x14')](_0x8107('0x18'),_0x511b09[_0x8107('0x15')],_0x460c1b);_0x3962ef(_0x2a5746[_0x8107('0x14')](0x1f4,_0x511b09[_0x8107('0x15')]));});});};exports[_0x8107('0x22')]=function(_0x41425f){var _0x29556b=this;return new Promise(function(_0x447bce,_0x4944ad){return db['VoiceQueueReport'][_0x8107('0x23')](_0x41425f[_0x8107('0x24')],{'raw':_0x41425f[_0x8107('0x1b')]?_0x41425f[_0x8107('0x1b')][_0x8107('0x25')]===undefined?!![]:![]:!![]})[_0x8107('0xf')](function(_0x1c9593){logger[_0x8107('0x10')](_0x8107('0x22'),_0x41425f);logger[_0x8107('0x12')](_0x8107('0x22'),_0x41425f,JSON[_0x8107('0x26')](_0x1c9593));_0x447bce(_0x1c9593);})[_0x8107('0x17')](function(_0x48d0cd){logger['error']('CreateVoiceQueueReport',_0x48d0cd['message'],_0x41425f);_0x4944ad(_0x29556b[_0x8107('0x14')](0x1f4,_0x48d0cd[_0x8107('0x15')]));});});};exports[_0x8107('0x27')]=function(_0x3ed7d8){var _0x382edc=this;return new Promise(function(_0x5bb65d,_0x5c169b){return db['VoiceQueueReport'][_0x8107('0x28')](_0x3ed7d8[_0x8107('0x24')],{'raw':_0x3ed7d8['options']?_0x3ed7d8[_0x8107('0x1b')][_0x8107('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed7d8[_0x8107('0x1b')]?_0x3ed7d8[_0x8107('0x1b')][_0x8107('0x1c')]||null:null,'attributes':_0x3ed7d8[_0x8107('0x1b')]?_0x3ed7d8[_0x8107('0x1b')][_0x8107('0x1d')]||null:null,'limit':_0x3ed7d8[_0x8107('0x1b')]?_0x3ed7d8[_0x8107('0x1b')][_0x8107('0x1e')]||null:null})[_0x8107('0xf')](function(_0x1ce762){logger[_0x8107('0x10')](_0x8107('0x27'),_0x3ed7d8);logger[_0x8107('0x12')]('UpdateVoiceQueueReport',_0x3ed7d8,JSON[_0x8107('0x26')](_0x1ce762));_0x5bb65d(_0x1ce762);})[_0x8107('0x17')](function(_0xc81232){logger[_0x8107('0x14')](_0x8107('0x27'),_0xc81232[_0x8107('0x15')],_0x3ed7d8);_0x5c169b(_0x382edc[_0x8107('0x14')](0x1f4,_0xc81232[_0x8107('0x15')]));});});}; \ No newline at end of file +var _0xeb18=['create','body','UpdateVoiceQueueReport','update','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','socket.io-emitter','redis','./voiceQueueReport.socket','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','limit','map','model','attributes','include','then','stringify','CreateVoiceQueueReport'];(function(_0x31b68a,_0xb75be5){var _0x5443a6=function(_0x10bcb7){while(--_0x10bcb7){_0x31b68a['push'](_0x31b68a['shift']());}};_0x5443a6(++_0xb75be5);}(_0xeb18,0xd6));var _0x8eb1=function(_0x13c63c,_0x424da1){_0x13c63c=_0x13c63c-0x0;var _0x10719f=_0xeb18[_0x13c63c];return _0x10719f;};'use strict';var _=require(_0x8eb1('0x0'));var util=require(_0x8eb1('0x1'));var moment=require(_0x8eb1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8eb1('0x3'));var db=require(_0x8eb1('0x4'))['db'];var utils=require(_0x8eb1('0x5'));var logger=require(_0x8eb1('0x6'))(_0x8eb1('0x7'));var config=require(_0x8eb1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eb1('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8eb1('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8eb1('0xb'))(new Redis(config[_0x8eb1('0xc')]));require(_0x8eb1('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f8cd5,_0x45b837,_0x7c51b){return new BPromise(function(_0x509ab6,_0xced2fc){return client[_0x8eb1('0xe')](_0x2f8cd5,_0x7c51b)['then'](function(_0x28f9e0){logger[_0x8eb1('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x45b837,_0x8eb1('0x10'));logger[_0x8eb1('0x11')](_0x8eb1('0x12'),_0x45b837,_0x8eb1('0x10'),JSON['stringify'](_0x28f9e0));if(_0x28f9e0[_0x8eb1('0x13')]){if(_0x28f9e0['error'][_0x8eb1('0x14')]===0x1f4){logger[_0x8eb1('0x13')](_0x8eb1('0x15'),_0x45b837,_0x28f9e0['error'][_0x8eb1('0x16')]);return _0xced2fc(_0x28f9e0[_0x8eb1('0x13')][_0x8eb1('0x16')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x45b837,_0x28f9e0[_0x8eb1('0x13')][_0x8eb1('0x16')]);return _0x509ab6(_0x28f9e0[_0x8eb1('0x13')][_0x8eb1('0x16')]);}else{logger[_0x8eb1('0xf')](_0x8eb1('0x15'),_0x45b837,_0x8eb1('0x10'));_0x509ab6(_0x28f9e0[_0x8eb1('0x17')][_0x8eb1('0x16')]);}})[_0x8eb1('0x18')](function(_0x3fd2ef){logger[_0x8eb1('0x13')](_0x8eb1('0x15'),_0x45b837,_0x3fd2ef);_0xced2fc(_0x3fd2ef);});});}exports[_0x8eb1('0x19')]=function(_0x4490f1){var _0x32f572=this;return new Promise(function(_0x54ed4e,_0x2b08b6){return db['VoiceQueueReport'][_0x8eb1('0x1a')]({'raw':_0x4490f1[_0x8eb1('0x1b')]?_0x4490f1['options'][_0x8eb1('0x1c')]===undefined?!![]:![]:!![],'where':_0x4490f1[_0x8eb1('0x1b')]?_0x4490f1[_0x8eb1('0x1b')][_0x8eb1('0x1d')]||null:null,'attributes':_0x4490f1['options']?_0x4490f1['options']['attributes']||null:null,'limit':_0x4490f1['options']?_0x4490f1[_0x8eb1('0x1b')][_0x8eb1('0x1e')]||null:null,'include':_0x4490f1[_0x8eb1('0x1b')]?_0x4490f1[_0x8eb1('0x1b')]['include']?_[_0x8eb1('0x1f')](_0x4490f1[_0x8eb1('0x1b')]['include'],function(_0x2592ef){return{'model':db[_0x2592ef[_0x8eb1('0x20')]],'as':_0x2592ef['as'],'attributes':_0x2592ef[_0x8eb1('0x21')],'include':_0x2592ef[_0x8eb1('0x22')]?_[_0x8eb1('0x1f')](_0x2592ef[_0x8eb1('0x22')],function(_0x496fb9){return{'model':db[_0x496fb9['model']],'as':_0x496fb9['as'],'attributes':_0x496fb9['attributes'],'include':_0x496fb9[_0x8eb1('0x22')]?_[_0x8eb1('0x1f')](_0x496fb9[_0x8eb1('0x22')],function(_0x228f3b){return{'model':db[_0x228f3b[_0x8eb1('0x20')]],'as':_0x228f3b['as'],'attributes':_0x228f3b[_0x8eb1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8eb1('0x23')](function(_0xf54b41){logger[_0x8eb1('0xf')]('GetVoiceQueueReport',_0x4490f1);logger[_0x8eb1('0x11')](_0x8eb1('0x19'),_0x4490f1,JSON[_0x8eb1('0x24')](_0xf54b41));_0x54ed4e(_0xf54b41);})[_0x8eb1('0x18')](function(_0x464cd2){logger[_0x8eb1('0x13')](_0x8eb1('0x19'),_0x464cd2[_0x8eb1('0x16')],_0x4490f1);_0x2b08b6(_0x32f572[_0x8eb1('0x13')](0x1f4,_0x464cd2[_0x8eb1('0x16')]));});});};exports[_0x8eb1('0x25')]=function(_0x5cacf2){var _0x42d146=this;return new Promise(function(_0x24f458,_0x12dae7){return db['VoiceQueueReport'][_0x8eb1('0x26')](_0x5cacf2[_0x8eb1('0x27')],{'raw':_0x5cacf2[_0x8eb1('0x1b')]?_0x5cacf2[_0x8eb1('0x1b')][_0x8eb1('0x1c')]===undefined?!![]:![]:!![]})[_0x8eb1('0x23')](function(_0x2d5e37){logger[_0x8eb1('0xf')](_0x8eb1('0x25'),_0x5cacf2);logger[_0x8eb1('0x11')]('CreateVoiceQueueReport',_0x5cacf2,JSON['stringify'](_0x2d5e37));_0x24f458(_0x2d5e37);})['catch'](function(_0x4bcb9a){logger[_0x8eb1('0x13')](_0x8eb1('0x25'),_0x4bcb9a[_0x8eb1('0x16')],_0x5cacf2);_0x12dae7(_0x42d146[_0x8eb1('0x13')](0x1f4,_0x4bcb9a['message']));});});};exports[_0x8eb1('0x28')]=function(_0x30710f){var _0x3a49fe=this;return new Promise(function(_0x14155e,_0x4cdcf1){return db['VoiceQueueReport'][_0x8eb1('0x29')](_0x30710f[_0x8eb1('0x27')],{'raw':_0x30710f[_0x8eb1('0x1b')]?_0x30710f['options'][_0x8eb1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30710f[_0x8eb1('0x1b')]?_0x30710f[_0x8eb1('0x1b')][_0x8eb1('0x1d')]||null:null,'attributes':_0x30710f['options']?_0x30710f[_0x8eb1('0x1b')][_0x8eb1('0x21')]||null:null,'limit':_0x30710f[_0x8eb1('0x1b')]?_0x30710f[_0x8eb1('0x1b')][_0x8eb1('0x1e')]||null:null})[_0x8eb1('0x23')](function(_0x136b47){logger[_0x8eb1('0xf')](_0x8eb1('0x28'),_0x30710f);logger[_0x8eb1('0x11')](_0x8eb1('0x28'),_0x30710f,JSON[_0x8eb1('0x24')](_0x136b47));_0x14155e(_0x136b47);})['catch'](function(_0x19bf3d){logger[_0x8eb1('0x13')](_0x8eb1('0x28'),_0x19bf3d[_0x8eb1('0x16')],_0x30710f);_0x4cdcf1(_0x3a49fe[_0x8eb1('0x13')](0x1f4,_0x19bf3d[_0x8eb1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index ea8ffb7..41f30ec 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 _0x24dc=['register','remove','update','emit','removeListener'];(function(_0x33fb32,_0x53d280){var _0x45fc18=function(_0x463b69){while(--_0x463b69){_0x33fb32['push'](_0x33fb32['shift']());}};_0x45fc18(++_0x53d280);}(_0x24dc,0x65));var _0xc24d=function(_0x295089,_0x50ae46){_0x295089=_0x295089-0x0;var _0x364472=_0x24dc[_0x295089];return _0x364472;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0xc24d('0x0'),_0xc24d('0x1')];function createListener(_0x31a8df,_0x292770){return function(_0x1fa05b){_0x292770[_0xc24d('0x2')](_0x31a8df,_0x1fa05b);};}function removeListener(_0x707559,_0x2737e1){return function(){VoiceQueueReportEvents[_0xc24d('0x3')](_0x707559,_0x2737e1);};}exports[_0xc24d('0x4')]=function(_0x1c833b){for(var _0x17ec2e=0x0,_0x1d5829=events['length'];_0x17ec2e<_0x1d5829;_0x17ec2e++){var _0x42b44d=events[_0x17ec2e];var _0x2e6391=createListener('voiceQueueReport:'+_0x42b44d,_0x1c833b);VoiceQueueReportEvents['on'](_0x42b44d,_0x2e6391);}}; \ No newline at end of file +var _0x6cca=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x35895a,_0x520db0){var _0x52fe0f=function(_0x2aed05){while(--_0x2aed05){_0x35895a['push'](_0x35895a['shift']());}};_0x52fe0f(++_0x520db0);}(_0x6cca,0x10e));var _0xa6cc=function(_0x365e11,_0x13ab8f){_0x365e11=_0x365e11-0x0;var _0x229eaa=_0x6cca[_0x365e11];return _0x229eaa;};'use strict';var VoiceQueueReportEvents=require(_0xa6cc('0x0'));var events=[_0xa6cc('0x1'),'remove',_0xa6cc('0x2')];function createListener(_0x31c58a,_0x18e32d){return function(_0x1eea60){_0x18e32d['emit'](_0x31c58a,_0x1eea60);};}function removeListener(_0x370421,_0x1c7564){return function(){VoiceQueueReportEvents[_0xa6cc('0x3')](_0x370421,_0x1c7564);};}exports[_0xa6cc('0x4')]=function(_0x22e3c5){for(var _0x4e2cd5=0x0,_0x36a793=events[_0xa6cc('0x5')];_0x4e2cd5<_0x36a793;_0x4e2cd5++){var _0xb1a7b0=events[_0x4e2cd5];var _0x12845d=createListener(_0xa6cc('0x6')+_0xb1a7b0,_0x22e3c5);VoiceQueueReportEvents['on'](_0xb1a7b0,_0x12845d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 943cb92..380153a 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 _0x906c=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','update','delete'];(function(_0x1afbbb,_0x1f7c5d){var _0x59054e=function(_0x150e9e){while(--_0x150e9e){_0x1afbbb['push'](_0x1afbbb['shift']());}};_0x59054e(++_0x1f7c5d);}(_0x906c,0x17d));var _0xc906=function(_0xa37ec8,_0x49be74){_0xa37ec8=_0xa37ec8-0x0;var _0x466115=_0x906c[_0xa37ec8];return _0x466115;};'use strict';var multer=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var path=require(_0xc906('0x2'));var timeout=require(_0xc906('0x3'));var express=require(_0xc906('0x4'));var router=express[_0xc906('0x5')]();var fs_extra=require(_0xc906('0x6'));var auth=require(_0xc906('0x7'));var interaction=require(_0xc906('0x8'));var config=require(_0xc906('0x9'));var controller=require(_0xc906('0xa'));router[_0xc906('0xb')]('/',auth[_0xc906('0xc')](),controller[_0xc906('0xd')]);router[_0xc906('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xc906('0xe')]);router[_0xc906('0xf')]('/',auth[_0xc906('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc906('0x10')]);router[_0xc906('0x11')](_0xc906('0x12'),auth[_0xc906('0xc')](),controller[_0xc906('0x13')]);module[_0xc906('0x14')]=router; \ No newline at end of file +var _0x28f9=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x2db294,_0x248a78){var _0x1e292d=function(_0x4398da){while(--_0x4398da){_0x2db294['push'](_0x2db294['shift']());}};_0x1e292d(++_0x248a78);}(_0x28f9,0x1ba));var _0x928f=function(_0x4bce8b,_0x5dae42){_0x4bce8b=_0x4bce8b-0x0;var _0x688138=_0x28f9[_0x4bce8b];return _0x688138;};'use strict';var multer=require(_0x928f('0x0'));var util=require(_0x928f('0x1'));var path=require(_0x928f('0x2'));var timeout=require('connect-timeout');var express=require(_0x928f('0x3'));var router=express[_0x928f('0x4')]();var fs_extra=require(_0x928f('0x5'));var auth=require(_0x928f('0x6'));var interaction=require(_0x928f('0x7'));var config=require(_0x928f('0x8'));var controller=require(_0x928f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x928f('0xa')]);router[_0x928f('0xb')](_0x928f('0xc'),auth[_0x928f('0xd')](),controller[_0x928f('0xe')]);router[_0x928f('0xf')]('/',auth[_0x928f('0xd')](),controller[_0x928f('0x10')]);router[_0x928f('0x11')](_0x928f('0xc'),auth[_0x928f('0xd')](),controller[_0x928f('0x12')]);router[_0x928f('0x13')](_0x928f('0xc'),auth[_0x928f('0xd')](),controller[_0x928f('0x14')]);module[_0x928f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8b5c9f7..2204cb9 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 _0xee3c=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xee3c,0x14a));var _0xcee3=function(_0x2a03b5,_0x4d4427){_0x2a03b5=_0x2a03b5-0x0;var _0x34bdae=_0xee3c[_0x2a03b5];return _0x34bdae;};'use strict';var Sequelize=require(_0xcee3('0x0'));var moment=require(_0xcee3('0x1'));module[_0xcee3('0x2')]={'time':{'type':Sequelize[_0xcee3('0x3')]},'callid':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xcee3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcee3('0x4')],'allowNull':![],'defaultValue':moment()[_0xcee3('0x5')](_0xcee3('0x6'))}}; \ No newline at end of file +var _0x1584=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x38730f,_0x3c4a9c){var _0x5e702a=function(_0xcb0b0e){while(--_0xcb0b0e){_0x38730f['push'](_0x38730f['shift']());}};_0x5e702a(++_0x3c4a9c);}(_0x1584,0x193));var _0x4158=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x1584[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x4158('0x0'));var moment=require(_0x4158('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4158('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x4158('0x3')](_0x4158('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 735f5a1..6abc3cf 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 _0x88d6=['catch','show','create','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','json','reject','save','then','end','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x88d6,0x99));var _0x688d=function(_0x1cda37,_0x2f894c){_0x1cda37=_0x1cda37-0x0;var _0x461e79=_0x88d6[_0x1cda37];return _0x461e79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x688d('0x0'));var zipdir=require(_0x688d('0x1'));var jsonpatch=require(_0x688d('0x2'));var rp=require(_0x688d('0x3'));var moment=require(_0x688d('0x4'));var BPromise=require(_0x688d('0x5'));var Mustache=require(_0x688d('0x6'));var util=require(_0x688d('0x7'));var path=require('path');var sox=require(_0x688d('0x8'));var csv=require(_0x688d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x688d('0xa'));var _=require(_0x688d('0xb'));var squel=require(_0x688d('0xc'));var crypto=require(_0x688d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x688d('0xe'));var toCsv=require(_0x688d('0x9'));var querystring=require(_0x688d('0xf'));var Papa=require(_0x688d('0x10'));var Redis=require(_0x688d('0x11'));var authService=require(_0x688d('0x12'));var qs=require(_0x688d('0x13'));var as=require(_0x688d('0x14'));var hardwareService=require(_0x688d('0x15'));var logger=require(_0x688d('0x16'))(_0x688d('0x17'));var utils=require(_0x688d('0x18'));var config=require(_0x688d('0x19'));var licenseUtil=require(_0x688d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x534ec3,_0x7cf37e){_0x7cf37e=_0x7cf37e||0xcc;return function(_0x1fe364){if(_0x1fe364){return _0x534ec3[_0x688d('0x1b')](_0x7cf37e);}return _0x534ec3['status'](_0x7cf37e)['end']();};}function respondWithResult(_0x4fc9f0,_0xfc0baf){_0xfc0baf=_0xfc0baf||0xc8;return function(_0x49e656){if(_0x49e656){return _0x4fc9f0[_0x688d('0x1c')](_0xfc0baf)['json'](_0x49e656);}};}function respondWithFilteredResult(_0x58dbf3,_0x3a0691){return function(_0xf88ecc){if(_0xf88ecc){var _0x1121a6=typeof _0x3a0691[_0x688d('0x1d')]===_0x688d('0x1e')&&typeof _0x3a0691[_0x688d('0x1f')]===_0x688d('0x1e');var _0x3c1761=_0xf88ecc[_0x688d('0x20')];var _0x154319=_0x1121a6?0x0:_0x3a0691['offset'];var _0x162e6e=_0x1121a6?_0xf88ecc[_0x688d('0x20')]:_0x3a0691['offset']+_0x3a0691[_0x688d('0x1f')];var _0x6698ce;if(_0x162e6e>=_0x3c1761){_0x162e6e=_0x3c1761;_0x6698ce=0xc8;}else{_0x6698ce=0xce;}_0x58dbf3[_0x688d('0x1c')](_0x6698ce);return _0x58dbf3['set']('Content-Range',_0x154319+'-'+_0x162e6e+'/'+_0x3c1761)[_0x688d('0x21')](_0xf88ecc);}return null;};}function patchUpdates(_0x102327){return function(_0x2912f7){try{jsonpatch['apply'](_0x2912f7,_0x102327,!![]);}catch(_0x27cef3){return BPromise[_0x688d('0x22')](_0x27cef3);}return _0x2912f7[_0x688d('0x23')]();};}function saveUpdates(_0x35a423,_0x1591f6){return function(_0x4339bd){if(_0x4339bd){return _0x4339bd['update'](_0x35a423)[_0x688d('0x24')](function(_0x2d1326){return _0x2d1326;});}return null;};}function removeEntity(_0x153c11,_0x5b4586){return function(_0x572714){if(_0x572714){return _0x572714['destroy']()['then'](function(){_0x153c11[_0x688d('0x1c')](0xcc)[_0x688d('0x25')]();});}};}function handleEntityNotFound(_0x50d856,_0x236b81){return function(_0xb5441b){if(!_0xb5441b){_0x50d856[_0x688d('0x1b')](0x194);}return _0xb5441b;};}function handleError(_0x530056,_0x5478ee){_0x5478ee=_0x5478ee||0x1f4;return function(_0x544ad9){logger['error'](_0x544ad9[_0x688d('0x26')]);if(_0x544ad9[_0x688d('0x27')]){delete _0x544ad9[_0x688d('0x27')];}_0x530056[_0x688d('0x1c')](_0x5478ee)[_0x688d('0x28')](_0x544ad9);};}exports[_0x688d('0x29')]=function(_0x5ba4c8,_0x2ce22b){var _0xa5778={},_0x32ce7a={},_0xf05ea3={'count':0x0,'rows':[]};var _0x28eadb=_[_0x688d('0x2a')](db[_0x688d('0x2b')][_0x688d('0x2c')],function(_0x24f959){return{'name':_0x24f959[_0x688d('0x2d')],'type':_0x24f959['type'][_0x688d('0x2e')]};});_0x32ce7a[_0x688d('0x2f')]=_[_0x688d('0x2a')](_0x28eadb,'name');_0x32ce7a[_0x688d('0x30')]=_[_0x688d('0x31')](_0x5ba4c8[_0x688d('0x30')]);_0x32ce7a[_0x688d('0x32')]=_[_0x688d('0x33')](_0x32ce7a[_0x688d('0x2f')],_0x32ce7a['query']);_0xa5778['attributes']=_['intersection'](_0x32ce7a[_0x688d('0x2f')],qs['fields'](_0x5ba4c8[_0x688d('0x30')][_0x688d('0x34')]));_0xa5778[_0x688d('0x35')]=_0xa5778[_0x688d('0x35')]['length']?_0xa5778[_0x688d('0x35')]:_0x32ce7a[_0x688d('0x2f')];if(!_0x5ba4c8[_0x688d('0x30')]['hasOwnProperty']('nolimit')){_0xa5778[_0x688d('0x1f')]=qs[_0x688d('0x1f')](_0x5ba4c8[_0x688d('0x30')]['limit']);_0xa5778[_0x688d('0x1d')]=qs[_0x688d('0x1d')](_0x5ba4c8[_0x688d('0x30')][_0x688d('0x1d')]);}_0xa5778[_0x688d('0x36')]=qs[_0x688d('0x37')](_0x5ba4c8[_0x688d('0x30')][_0x688d('0x37')]);_0xa5778[_0x688d('0x38')]=qs[_0x688d('0x32')](_[_0x688d('0x39')](_0x5ba4c8[_0x688d('0x30')],_0x32ce7a[_0x688d('0x32')]),_0x28eadb);if(_0x5ba4c8[_0x688d('0x30')][_0x688d('0x3a')]){_0xa5778['where']=_[_0x688d('0x3b')](_0xa5778[_0x688d('0x38')],{'$or':_[_0x688d('0x2a')](_0x28eadb,function(_0x1d2fbe){if(_0x1d2fbe[_0x688d('0x3c')]!==_0x688d('0x3d')){var _0x5450d7={};_0x5450d7[_0x1d2fbe[_0x688d('0x27')]]={'$like':'%'+_0x5ba4c8[_0x688d('0x30')]['filter']+'%'};return _0x5450d7;}})});}_0xa5778=_[_0x688d('0x3b')]({},_0xa5778,_0x5ba4c8[_0x688d('0x3e')]);var _0x4cfbe3={'where':_0xa5778[_0x688d('0x38')]};return db[_0x688d('0x2b')][_0x688d('0x20')](_0x4cfbe3)['then'](function(_0x306b92){_0xf05ea3['count']=_0x306b92;if(_0x5ba4c8[_0x688d('0x30')][_0x688d('0x3f')]){_0xa5778[_0x688d('0x40')]=[{'all':!![]}];}return db[_0x688d('0x2b')]['findAll'](_0xa5778);})[_0x688d('0x24')](function(_0x5d930f){_0xf05ea3[_0x688d('0x41')]=_0x5d930f;return _0xf05ea3;})['then'](respondWithFilteredResult(_0x2ce22b,_0xa5778))[_0x688d('0x42')](handleError(_0x2ce22b,null));};exports[_0x688d('0x43')]=function(_0x4ff541,_0x5c665d){var _0x1aa347={'raw':!![],'where':{'id':_0x4ff541['params']['id']}},_0x1f7021={};_0x1f7021[_0x688d('0x2f')]=_['keys'](db['VoiceQueuesLog'][_0x688d('0x2c')]);_0x1f7021['query']=_[_0x688d('0x31')](_0x4ff541['query']);_0x1f7021['filters']=_['intersection'](_0x1f7021[_0x688d('0x2f')],_0x1f7021['query']);_0x1aa347[_0x688d('0x35')]=_[_0x688d('0x33')](_0x1f7021[_0x688d('0x2f')],qs[_0x688d('0x34')](_0x4ff541[_0x688d('0x30')][_0x688d('0x34')]));_0x1aa347['attributes']=_0x1aa347[_0x688d('0x35')]['length']?_0x1aa347[_0x688d('0x35')]:_0x1f7021[_0x688d('0x2f')];if(_0x4ff541[_0x688d('0x30')][_0x688d('0x3f')]){_0x1aa347[_0x688d('0x40')]=[{'all':!![]}];}_0x1aa347=_[_0x688d('0x3b')]({},_0x1aa347,_0x4ff541[_0x688d('0x3e')]);return db[_0x688d('0x2b')]['find'](_0x1aa347)[_0x688d('0x24')](handleEntityNotFound(_0x5c665d,null))['then'](respondWithResult(_0x5c665d,null))[_0x688d('0x42')](handleError(_0x5c665d,null));};exports[_0x688d('0x44')]=function(_0x28743e,_0x4219b8){return db[_0x688d('0x2b')][_0x688d('0x44')](_0x28743e['body'],{})[_0x688d('0x24')](respondWithResult(_0x4219b8,0xc9))['catch'](handleError(_0x4219b8,null));};exports['update']=function(_0x4c7fad,_0x5c4afd){if(_0x4c7fad[_0x688d('0x45')]['id']){delete _0x4c7fad['body']['id'];}return db[_0x688d('0x2b')][_0x688d('0x46')]({'where':{'id':_0x4c7fad[_0x688d('0x47')]['id']}})[_0x688d('0x24')](handleEntityNotFound(_0x5c4afd,null))[_0x688d('0x24')](saveUpdates(_0x4c7fad['body'],null))[_0x688d('0x24')](respondWithResult(_0x5c4afd,null))[_0x688d('0x42')](handleError(_0x5c4afd,null));};exports[_0x688d('0x48')]=function(_0x3556de,_0x3ecc5f){return db['VoiceQueuesLog']['find']({'where':{'id':_0x3556de[_0x688d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ecc5f,null))['then'](removeEntity(_0x3ecc5f,null))['catch'](handleError(_0x3ecc5f,null));}; \ No newline at end of file +var _0x6551=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','type'];(function(_0x539d65,_0x38f082){var _0x3c19f9=function(_0x5c24a5){while(--_0x5c24a5){_0x539d65['push'](_0x539d65['shift']());}};_0x3c19f9(++_0x38f082);}(_0x6551,0x19d));var _0x1655=function(_0x2ff43c,_0x2d1d43){_0x2ff43c=_0x2ff43c-0x0;var _0x279849=_0x6551[_0x2ff43c];return _0x279849;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1655('0x0'));var jsonpatch=require(_0x1655('0x1'));var rp=require(_0x1655('0x2'));var moment=require(_0x1655('0x3'));var BPromise=require(_0x1655('0x4'));var Mustache=require(_0x1655('0x5'));var util=require('util');var path=require(_0x1655('0x6'));var sox=require(_0x1655('0x7'));var csv=require('to-csv');var ejs=require(_0x1655('0x8'));var fs=require('fs');var fs_extra=require(_0x1655('0x9'));var _=require(_0x1655('0xa'));var squel=require(_0x1655('0xb'));var crypto=require(_0x1655('0xc'));var jsforce=require(_0x1655('0xd'));var deskjs=require(_0x1655('0xe'));var toCsv=require(_0x1655('0xf'));var querystring=require(_0x1655('0x10'));var Papa=require(_0x1655('0x11'));var Redis=require('ioredis');var authService=require(_0x1655('0x12'));var qs=require(_0x1655('0x13'));var as=require(_0x1655('0x14'));var hardwareService=require(_0x1655('0x15'));var logger=require(_0x1655('0x16'))(_0x1655('0x17'));var utils=require(_0x1655('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1655('0x19'));var db=require(_0x1655('0x1a'))['db'];function respondWithStatusCode(_0xcf27fc,_0x23fddf){_0x23fddf=_0x23fddf||0xcc;return function(_0x2e765e){if(_0x2e765e){return _0xcf27fc[_0x1655('0x1b')](_0x23fddf);}return _0xcf27fc[_0x1655('0x1c')](_0x23fddf)[_0x1655('0x1d')]();};}function respondWithResult(_0x49c719,_0x6c518d){_0x6c518d=_0x6c518d||0xc8;return function(_0x39f8a3){if(_0x39f8a3){return _0x49c719['status'](_0x6c518d)[_0x1655('0x1e')](_0x39f8a3);}};}function respondWithFilteredResult(_0x145f98,_0x2282f3){return function(_0x1c76fc){if(_0x1c76fc){var _0x38f825=typeof _0x2282f3[_0x1655('0x1f')]==='undefined'&&typeof _0x2282f3['limit']===_0x1655('0x20');var _0x3c2e72=_0x1c76fc[_0x1655('0x21')];var _0x4bb124=_0x38f825?0x0:_0x2282f3['offset'];var _0x2f8eab=_0x38f825?_0x1c76fc[_0x1655('0x21')]:_0x2282f3[_0x1655('0x1f')]+_0x2282f3['limit'];var _0x1cda36;if(_0x2f8eab>=_0x3c2e72){_0x2f8eab=_0x3c2e72;_0x1cda36=0xc8;}else{_0x1cda36=0xce;}_0x145f98['status'](_0x1cda36);return _0x145f98[_0x1655('0x22')](_0x1655('0x23'),_0x4bb124+'-'+_0x2f8eab+'/'+_0x3c2e72)[_0x1655('0x1e')](_0x1c76fc);}return null;};}function patchUpdates(_0x5b3c95){return function(_0x184384){try{jsonpatch[_0x1655('0x24')](_0x184384,_0x5b3c95,!![]);}catch(_0x50e66){return BPromise[_0x1655('0x25')](_0x50e66);}return _0x184384['save']();};}function saveUpdates(_0x2cd2a0,_0x5d7461){return function(_0x3b631d){if(_0x3b631d){return _0x3b631d[_0x1655('0x26')](_0x2cd2a0)[_0x1655('0x27')](function(_0x28ef56){return _0x28ef56;});}return null;};}function removeEntity(_0xfd5a82,_0x4c9662){return function(_0x15e843){if(_0x15e843){return _0x15e843[_0x1655('0x28')]()[_0x1655('0x27')](function(){_0xfd5a82[_0x1655('0x1c')](0xcc)[_0x1655('0x1d')]();});}};}function handleEntityNotFound(_0x54a981,_0x5cd619){return function(_0x38ae6e){if(!_0x38ae6e){_0x54a981[_0x1655('0x1b')](0x194);}return _0x38ae6e;};}function handleError(_0x20730c,_0x4c0a0f){_0x4c0a0f=_0x4c0a0f||0x1f4;return function(_0x1b927c){logger[_0x1655('0x29')](_0x1b927c[_0x1655('0x2a')]);if(_0x1b927c[_0x1655('0x2b')]){delete _0x1b927c[_0x1655('0x2b')];}_0x20730c[_0x1655('0x1c')](_0x4c0a0f)['send'](_0x1b927c);};}exports['index']=function(_0x3755ce,_0x49d9c7){var _0x58f48f={},_0x2e111a={},_0x2767b3={'count':0x0,'rows':[]};var _0x565fef=_[_0x1655('0x2c')](db[_0x1655('0x2d')][_0x1655('0x2e')],function(_0x53f1a1){return{'name':_0x53f1a1[_0x1655('0x2f')],'type':_0x53f1a1[_0x1655('0x30')][_0x1655('0x31')]};});_0x2e111a[_0x1655('0x32')]=_['map'](_0x565fef,'name');_0x2e111a[_0x1655('0x33')]=_[_0x1655('0x34')](_0x3755ce[_0x1655('0x33')]);_0x2e111a['filters']=_[_0x1655('0x35')](_0x2e111a[_0x1655('0x32')],_0x2e111a[_0x1655('0x33')]);_0x58f48f['attributes']=_[_0x1655('0x35')](_0x2e111a['model'],qs['fields'](_0x3755ce[_0x1655('0x33')][_0x1655('0x36')]));_0x58f48f['attributes']=_0x58f48f[_0x1655('0x37')][_0x1655('0x38')]?_0x58f48f[_0x1655('0x37')]:_0x2e111a[_0x1655('0x32')];if(!_0x3755ce[_0x1655('0x33')][_0x1655('0x39')](_0x1655('0x3a'))){_0x58f48f[_0x1655('0x3b')]=qs[_0x1655('0x3b')](_0x3755ce[_0x1655('0x33')][_0x1655('0x3b')]);_0x58f48f[_0x1655('0x1f')]=qs['offset'](_0x3755ce[_0x1655('0x33')]['offset']);}_0x58f48f['order']=qs[_0x1655('0x3c')](_0x3755ce[_0x1655('0x33')]['sort']);_0x58f48f[_0x1655('0x3d')]=qs[_0x1655('0x3e')](_[_0x1655('0x3f')](_0x3755ce[_0x1655('0x33')],_0x2e111a[_0x1655('0x3e')]),_0x565fef);if(_0x3755ce[_0x1655('0x33')][_0x1655('0x40')]){_0x58f48f[_0x1655('0x3d')]=_[_0x1655('0x41')](_0x58f48f[_0x1655('0x3d')],{'$or':_[_0x1655('0x2c')](_0x565fef,function(_0x4846b1){if(_0x4846b1['type']!=='VIRTUAL'){var _0x53eb66={};_0x53eb66[_0x4846b1[_0x1655('0x2b')]]={'$like':'%'+_0x3755ce[_0x1655('0x33')][_0x1655('0x40')]+'%'};return _0x53eb66;}})});}_0x58f48f=_[_0x1655('0x41')]({},_0x58f48f,_0x3755ce[_0x1655('0x42')]);var _0x1fd0bd={'where':_0x58f48f[_0x1655('0x3d')]};return db[_0x1655('0x2d')][_0x1655('0x21')](_0x1fd0bd)['then'](function(_0x419c30){_0x2767b3[_0x1655('0x21')]=_0x419c30;if(_0x3755ce['query'][_0x1655('0x43')]){_0x58f48f[_0x1655('0x44')]=[{'all':!![]}];}return db[_0x1655('0x2d')][_0x1655('0x45')](_0x58f48f);})[_0x1655('0x27')](function(_0x22935d){_0x2767b3[_0x1655('0x46')]=_0x22935d;return _0x2767b3;})[_0x1655('0x27')](respondWithFilteredResult(_0x49d9c7,_0x58f48f))[_0x1655('0x47')](handleError(_0x49d9c7,null));};exports[_0x1655('0x48')]=function(_0x248a71,_0x2b31a3){var _0x23e7e3={'raw':!![],'where':{'id':_0x248a71['params']['id']}},_0x5e0d40={};_0x5e0d40[_0x1655('0x32')]=_[_0x1655('0x34')](db['VoiceQueuesLog'][_0x1655('0x2e')]);_0x5e0d40[_0x1655('0x33')]=_['keys'](_0x248a71[_0x1655('0x33')]);_0x5e0d40[_0x1655('0x3e')]=_[_0x1655('0x35')](_0x5e0d40['model'],_0x5e0d40['query']);_0x23e7e3[_0x1655('0x37')]=_[_0x1655('0x35')](_0x5e0d40[_0x1655('0x32')],qs[_0x1655('0x36')](_0x248a71[_0x1655('0x33')][_0x1655('0x36')]));_0x23e7e3['attributes']=_0x23e7e3[_0x1655('0x37')]['length']?_0x23e7e3['attributes']:_0x5e0d40['model'];if(_0x248a71[_0x1655('0x33')][_0x1655('0x43')]){_0x23e7e3[_0x1655('0x44')]=[{'all':!![]}];}_0x23e7e3=_[_0x1655('0x41')]({},_0x23e7e3,_0x248a71[_0x1655('0x42')]);return db[_0x1655('0x2d')]['find'](_0x23e7e3)[_0x1655('0x27')](handleEntityNotFound(_0x2b31a3,null))[_0x1655('0x27')](respondWithResult(_0x2b31a3,null))[_0x1655('0x47')](handleError(_0x2b31a3,null));};exports['create']=function(_0x4307a2,_0xbb13c6){return db[_0x1655('0x2d')][_0x1655('0x49')](_0x4307a2[_0x1655('0x4a')],{})['then'](respondWithResult(_0xbb13c6,0xc9))[_0x1655('0x47')](handleError(_0xbb13c6,null));};exports['update']=function(_0x4efa22,_0x4babf0){if(_0x4efa22[_0x1655('0x4a')]['id']){delete _0x4efa22[_0x1655('0x4a')]['id'];}return db['VoiceQueuesLog'][_0x1655('0x4b')]({'where':{'id':_0x4efa22[_0x1655('0x4c')]['id']}})[_0x1655('0x27')](handleEntityNotFound(_0x4babf0,null))[_0x1655('0x27')](saveUpdates(_0x4efa22[_0x1655('0x4a')],null))['then'](respondWithResult(_0x4babf0,null))[_0x1655('0x47')](handleError(_0x4babf0,null));};exports[_0x1655('0x28')]=function(_0x4f6022,_0x4897b0){return db[_0x1655('0x2d')][_0x1655('0x4b')]({'where':{'id':_0x4f6022[_0x1655('0x4c')]['id']}})[_0x1655('0x27')](handleEntityNotFound(_0x4897b0,null))[_0x1655('0x27')](removeEntity(_0x4897b0,null))[_0x1655('0x47')](handleError(_0x4897b0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 591e3ae..484b282 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 _0x1e43=['bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','dtm','lodash','util','moment'];(function(_0x5d3afa,_0x584768){var _0x230dd9=function(_0x5ca224){while(--_0x5ca224){_0x5d3afa['push'](_0x5d3afa['shift']());}};_0x230dd9(++_0x584768);}(_0x1e43,0x1d1));var _0x31e4=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x1e43[_0x55e1d1];return _0x1165db;};'use strict';var _=require(_0x31e4('0x0'));var util=require(_0x31e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x31e4('0x2'));var BPromise=require(_0x31e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x31e4('0x4'));var config=require(_0x31e4('0x5'));var attributes=require(_0x31e4('0x6'));module[_0x31e4('0x7')]=function(_0x274a52,_0x6e71fe){return _0x274a52[_0x31e4('0x8')](_0x31e4('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x31e4('0xa'),'fields':['event',_0x31e4('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xceef=['VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceef,0x13f));var _0xfcee=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xceef[_0x2fd69d];return _0x5d5ef3;};'use strict';var _=require(_0xfcee('0x0'));var util=require(_0xfcee('0x1'));var logger=require(_0xfcee('0x2'))(_0xfcee('0x3'));var moment=require(_0xfcee('0x4'));var BPromise=require(_0xfcee('0x5'));var rp=require(_0xfcee('0x6'));var fs=require('fs');var path=require(_0xfcee('0x7'));var rimraf=require(_0xfcee('0x8'));var config=require('../../config/environment');var attributes=require(_0xfcee('0x9'));module['exports']=function(_0x31c1c7,_0x50a12c){return _0x31c1c7[_0xfcee('0xa')](_0xfcee('0xb'),attributes,{'tableName':_0xfcee('0xc'),'paranoid':![],'indexes':[{'name':_0xfcee('0xd'),'fields':['event',_0xfcee('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 38c6ee1..97e21d9 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 _0x11cd=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x11cd,0x194));var _0xd11c=function(_0x265eef,_0x41e803){_0x265eef=_0x265eef-0x0;var _0x22a7a0=_0x11cd[_0x265eef];return _0x22a7a0;};'use strict';var _=require('lodash');var util=require(_0xd11c('0x0'));var moment=require('moment');var BPromise=require(_0xd11c('0x1'));var rs=require(_0xd11c('0x2'));var fs=require('fs');var Redis=require(_0xd11c('0x3'));var db=require(_0xd11c('0x4'))['db'];var utils=require(_0xd11c('0x5'));var logger=require('../../config/logger')(_0xd11c('0x6'));var config=require(_0xd11c('0x7'));var jayson=require(_0xd11c('0x8'));var client=jayson['client'][_0xd11c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569a3e,_0x24c207,_0x243e49){return new BPromise(function(_0x32bb3e,_0x1d7a55){return client[_0xd11c('0xa')](_0x569a3e,_0x243e49)[_0xd11c('0xb')](function(_0x4ae757){logger[_0xd11c('0xc')](_0xd11c('0xd'),_0x24c207,_0xd11c('0xe'));logger[_0xd11c('0xf')](_0xd11c('0x10'),_0x24c207,'request\x20sent',JSON[_0xd11c('0x11')](_0x4ae757));if(_0x4ae757[_0xd11c('0x12')]){if(_0x4ae757[_0xd11c('0x12')][_0xd11c('0x13')]===0x1f4){logger['error'](_0xd11c('0xd'),_0x24c207,_0x4ae757[_0xd11c('0x12')][_0xd11c('0x14')]);return _0x1d7a55(_0x4ae757['error'][_0xd11c('0x14')]);}logger[_0xd11c('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24c207,_0x4ae757[_0xd11c('0x12')][_0xd11c('0x14')]);return _0x32bb3e(_0x4ae757[_0xd11c('0x12')][_0xd11c('0x14')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x24c207,'request\x20sent');_0x32bb3e(_0x4ae757[_0xd11c('0x15')][_0xd11c('0x14')]);}})[_0xd11c('0x16')](function(_0x1b25fb){logger[_0xd11c('0x12')](_0xd11c('0xd'),_0x24c207,_0x1b25fb);_0x1d7a55(_0x1b25fb);});});} \ No newline at end of file +var _0x0a67=['client','request','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3cb63a,_0x5c8360){var _0x56830b=function(_0x1c3667){while(--_0x1c3667){_0x3cb63a['push'](_0x3cb63a['shift']());}};_0x56830b(++_0x5c8360);}(_0x0a67,0x1c4));var _0x70a6=function(_0x3e74ae,_0x5177d6){_0x3e74ae=_0x3e74ae-0x0;var _0x86f3e3=_0x0a67[_0x3e74ae];return _0x86f3e3;};'use strict';var _=require(_0x70a6('0x0'));var util=require(_0x70a6('0x1'));var moment=require(_0x70a6('0x2'));var BPromise=require(_0x70a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70a6('0x5'));var logger=require(_0x70a6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70a6('0x7'));var client=jayson[_0x70a6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca3cd,_0x26caee,_0x46dc31){return new BPromise(function(_0x4947fd,_0x100d9d){return client[_0x70a6('0x9')](_0x3ca3cd,_0x46dc31)[_0x70a6('0xa')](function(_0x403743){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x26caee,_0x70a6('0xb'));logger[_0x70a6('0xc')](_0x70a6('0xd'),_0x26caee,_0x70a6('0xb'),JSON['stringify'](_0x403743));if(_0x403743[_0x70a6('0xe')]){if(_0x403743[_0x70a6('0xe')][_0x70a6('0xf')]===0x1f4){logger[_0x70a6('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x26caee,_0x403743[_0x70a6('0xe')]['message']);return _0x100d9d(_0x403743['error'][_0x70a6('0x10')]);}logger[_0x70a6('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x26caee,_0x403743['error'][_0x70a6('0x10')]);return _0x4947fd(_0x403743[_0x70a6('0xe')][_0x70a6('0x10')]);}else{logger['info'](_0x70a6('0x11'),_0x26caee,_0x70a6('0xb'));_0x4947fd(_0x403743[_0x70a6('0x12')][_0x70a6('0x10')]);}})[_0x70a6('0x13')](function(_0x3314cb){logger[_0x70a6('0xe')](_0x70a6('0x11'),_0x26caee,_0x3314cb);_0x100d9d(_0x3314cb);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1c967e0..fb0d48f 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 _0x537f=['/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x537f,0x15b));var _0xf537=function(_0x16cdec,_0x4359f2){_0x16cdec=_0x16cdec-0x0;var _0x2f827b=_0x537f[_0x16cdec];return _0x2f827b;};'use strict';var multer=require(_0xf537('0x0'));var util=require(_0xf537('0x1'));var path=require(_0xf537('0x2'));var timeout=require('connect-timeout');var express=require(_0xf537('0x3'));var router=express['Router']();var fs_extra=require(_0xf537('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf537('0x5'));var config=require(_0xf537('0x6'));var controller=require(_0xf537('0x7'));router['get']('/',auth[_0xf537('0x8')](),controller[_0xf537('0x9')]);router['get'](_0xf537('0xa'),auth[_0xf537('0x8')](),controller[_0xf537('0xb')]);router[_0xf537('0xc')](_0xf537('0xd'),auth['isAuthenticated'](),controller[_0xf537('0xe')]);router[_0xf537('0xc')](_0xf537('0xf'),auth['isAuthenticated'](),controller[_0xf537('0x10')]);router[_0xf537('0xc')](_0xf537('0x11'),controller[_0xf537('0x12')]);router[_0xf537('0xc')](_0xf537('0x13'),auth['isAuthenticated'](),controller[_0xf537('0x14')]);router[_0xf537('0x15')]('/',auth['isAuthenticated'](),controller[_0xf537('0x16')]);router[_0xf537('0x15')](_0xf537('0x13'),auth[_0xf537('0x8')](),controller[_0xf537('0x17')]);router[_0xf537('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xf537('0x19')]);router[_0xf537('0x1a')](_0xf537('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xf537('0x1b')]=router; \ No newline at end of file +var _0xbda6=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x22d5dc,_0x55143e){var _0x97a52f=function(_0x5d741f){while(--_0x5d741f){_0x22d5dc['push'](_0x22d5dc['shift']());}};_0x97a52f(++_0x55143e);}(_0xbda6,0x100));var _0x6bda=function(_0x250b76,_0x3e1e6b){_0x250b76=_0x250b76-0x0;var _0x3fa5f3=_0xbda6[_0x250b76];return _0x3fa5f3;};'use strict';var multer=require(_0x6bda('0x0'));var util=require(_0x6bda('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6bda('0x2'));var router=express[_0x6bda('0x3')]();var fs_extra=require(_0x6bda('0x4'));var auth=require(_0x6bda('0x5'));var interaction=require(_0x6bda('0x6'));var config=require('../../config/environment');var controller=require(_0x6bda('0x7'));router[_0x6bda('0x8')]('/',auth[_0x6bda('0x9')](),controller['index']);router['get'](_0x6bda('0xa'),auth[_0x6bda('0x9')](),controller[_0x6bda('0xb')]);router['get'](_0x6bda('0xc'),auth[_0x6bda('0x9')](),controller[_0x6bda('0xd')]);router[_0x6bda('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x6bda('0xe')]);router[_0x6bda('0x8')](_0x6bda('0xf'),controller[_0x6bda('0x10')]);router['get'](_0x6bda('0x11'),auth[_0x6bda('0x9')](),controller[_0x6bda('0x12')]);router[_0x6bda('0x13')]('/',auth[_0x6bda('0x9')](),controller[_0x6bda('0x14')]);router[_0x6bda('0x13')](_0x6bda('0x11'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0x6bda('0x15')]('/:id',auth[_0x6bda('0x9')](),controller[_0x6bda('0x16')]);router[_0x6bda('0x17')]('/:id',auth[_0x6bda('0x9')](),controller[_0x6bda('0x18')]);module[_0x6bda('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 74e7d40..1c59f09 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 fe89bd8..a150254 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 _0x1b24=['VoiceRecording','rawAttributes','fieldName','type','differenceBy','format','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','length','find','catch','create','body','update','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','../../components/encryptor','sequelize','MD5','col','token','$and','push','recording','Sequelize','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','secrets','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','destroy','then','end','error','stack','name','index','map'];(function(_0x2dc46e,_0x22c800){var _0x4eb52c=function(_0x235e58){while(--_0x235e58){_0x2dc46e['push'](_0x2dc46e['shift']());}};_0x4eb52c(++_0x22c800);}(_0x1b24,0x1a0));var _0x41b2=function(_0x132e1f,_0x29d247){_0x132e1f=_0x132e1f-0x0;var _0x20a853=_0x1b24[_0x132e1f];return _0x20a853;};'use strict';var emlformat=require(_0x41b2('0x0'));var rimraf=require(_0x41b2('0x1'));var zipdir=require(_0x41b2('0x2'));var jsonpatch=require(_0x41b2('0x3'));var rp=require(_0x41b2('0x4'));var moment=require(_0x41b2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x41b2('0x6'));var util=require(_0x41b2('0x7'));var path=require(_0x41b2('0x8'));var sox=require(_0x41b2('0x9'));var csv=require(_0x41b2('0xa'));var ejs=require(_0x41b2('0xb'));var fs=require('fs');var fs_extra=require(_0x41b2('0xc'));var _=require(_0x41b2('0xd'));var squel=require(_0x41b2('0xe'));var crypto=require(_0x41b2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x41b2('0x10'));var toCsv=require(_0x41b2('0xa'));var querystring=require(_0x41b2('0x11'));var Papa=require(_0x41b2('0x12'));var AWS=require(_0x41b2('0x13'));var uuidv4=require('uuid/v4');var Redis=require(_0x41b2('0x14'));var authService=require(_0x41b2('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x41b2('0x16'));var hardwareService=require(_0x41b2('0x17'));var logger=require(_0x41b2('0x18'))(_0x41b2('0x19'));var utils=require('../../config/utils');var config=require(_0x41b2('0x1a'));var licenseUtil=require(_0x41b2('0x1b'));var db=require(_0x41b2('0x1c'))['db'];function respondWithStatusCode(_0xa9bdf4,_0x42e776){_0x42e776=_0x42e776||0xcc;return function(_0x4faf14){if(_0x4faf14){return _0xa9bdf4[_0x41b2('0x1d')](_0x42e776);}return _0xa9bdf4[_0x41b2('0x1e')](_0x42e776)['end']();};}function respondWithResult(_0x31f580,_0x459e33){_0x459e33=_0x459e33||0xc8;return function(_0x562b2c){if(_0x562b2c){return _0x31f580[_0x41b2('0x1e')](_0x459e33)[_0x41b2('0x1f')](_0x562b2c);}};}function respondWithFilteredResult(_0xc23fb8,_0x529a18){return function(_0x485670){if(_0x485670){var _0x405b6c=typeof _0x529a18[_0x41b2('0x20')]===_0x41b2('0x21')&&typeof _0x529a18[_0x41b2('0x22')]==='undefined';var _0x32880d=_0x485670['count'];var _0x1010d7=_0x405b6c?0x0:_0x529a18[_0x41b2('0x20')];var _0x25c538=_0x405b6c?_0x485670['count']:_0x529a18[_0x41b2('0x20')]+_0x529a18[_0x41b2('0x22')];var _0x3fd377;if(_0x25c538>=_0x32880d){_0x25c538=_0x32880d;_0x3fd377=0xc8;}else{_0x3fd377=0xce;}_0xc23fb8[_0x41b2('0x1e')](_0x3fd377);return _0xc23fb8[_0x41b2('0x23')](_0x41b2('0x24'),_0x1010d7+'-'+_0x25c538+'/'+_0x32880d)[_0x41b2('0x1f')](_0x485670);}return null;};}function patchUpdates(_0x40edb2){return function(_0x2f5120){try{jsonpatch[_0x41b2('0x25')](_0x2f5120,_0x40edb2,!![]);}catch(_0x45b8a9){return BPromise['reject'](_0x45b8a9);}return _0x2f5120['save']();};}function saveUpdates(_0x594417,_0x500ccd){return function(_0x11b2ea){if(_0x11b2ea){return _0x11b2ea['update'](_0x594417)['then'](function(_0x12b2dd){return _0x12b2dd;});}return null;};}function removeEntity(_0x665e0c,_0x45096f){return function(_0x47db2f){if(_0x47db2f){return _0x47db2f[_0x41b2('0x26')]()[_0x41b2('0x27')](function(){_0x665e0c['status'](0xcc)[_0x41b2('0x28')]();});}};}function handleEntityNotFound(_0x562bc5,_0x2955a1){return function(_0x5ddcff){if(!_0x5ddcff){_0x562bc5[_0x41b2('0x1d')](0x194);}return _0x5ddcff;};}function handleError(_0x4df0c4,_0x96ec58){_0x96ec58=_0x96ec58||0x1f4;return function(_0xa58d9){logger[_0x41b2('0x29')](_0xa58d9[_0x41b2('0x2a')]);if(_0xa58d9[_0x41b2('0x2b')]){delete _0xa58d9['name'];}_0x4df0c4[_0x41b2('0x1e')](_0x96ec58)['send'](_0xa58d9);};}exports[_0x41b2('0x2c')]=function(_0x365aae,_0x5e78b5){var _0x19eaaa={},_0x2aef7b={},_0x3f774c={'count':0x0,'rows':[]};var _0xe5ce4c=_[_0x41b2('0x2d')](db[_0x41b2('0x2e')][_0x41b2('0x2f')],function(_0x1e4c6b){return{'name':_0x1e4c6b[_0x41b2('0x30')],'type':_0x1e4c6b[_0x41b2('0x31')]['key']};});_0x2aef7b['model']=_[_0x41b2('0x32')](_[_0x41b2('0x2d')](_0xe5ce4c,_0x41b2('0x2b')),[_0x41b2('0x33')]);_0x2aef7b['query']=_[_0x41b2('0x34')](_0x365aae[_0x41b2('0x35')]);_0x2aef7b[_0x41b2('0x36')]=_[_0x41b2('0x37')](_0x2aef7b[_0x41b2('0x38')],_0x2aef7b[_0x41b2('0x35')]);_0x19eaaa['attributes']=_[_0x41b2('0x37')](_0x2aef7b[_0x41b2('0x38')],qs['fields'](_0x365aae[_0x41b2('0x35')][_0x41b2('0x39')]));_0x19eaaa[_0x41b2('0x3a')]=_0x19eaaa['attributes']['length']?_0x19eaaa['attributes']:_0x2aef7b['model'];if(!_0x365aae['query']['hasOwnProperty'](_0x41b2('0x3b'))){_0x19eaaa['limit']=qs[_0x41b2('0x22')](_0x365aae['query'][_0x41b2('0x22')]);_0x19eaaa[_0x41b2('0x20')]=qs[_0x41b2('0x20')](_0x365aae[_0x41b2('0x35')][_0x41b2('0x20')]);}_0x19eaaa[_0x41b2('0x3c')]=qs[_0x41b2('0x3d')](_0x365aae['query'][_0x41b2('0x3d')]);_0x19eaaa[_0x41b2('0x3e')]=qs[_0x41b2('0x36')](_[_0x41b2('0x3f')](_0x365aae[_0x41b2('0x35')],_0x2aef7b[_0x41b2('0x36')]),_0xe5ce4c);if(_0x365aae[_0x41b2('0x35')][_0x41b2('0x40')]){_0x19eaaa[_0x41b2('0x3e')]=_[_0x41b2('0x41')](_0x19eaaa[_0x41b2('0x3e')],{'$or':_[_0x41b2('0x2d')](_0xe5ce4c,function(_0x5e5bfe){if(_0x5e5bfe['type']!==_0x41b2('0x42')){var _0x4f41e9={};_0x4f41e9[_0x5e5bfe[_0x41b2('0x2b')]]={'$like':'%'+_0x365aae[_0x41b2('0x35')][_0x41b2('0x40')]+'%'};return _0x4f41e9;}})});}_0x19eaaa=_[_0x41b2('0x41')]({},_0x19eaaa,_0x365aae[_0x41b2('0x43')]);var _0x1c679c={'where':_0x19eaaa[_0x41b2('0x3e')]};return db['VoiceRecording'][_0x41b2('0x44')](_0x1c679c)['then'](function(_0x508d0f){_0x3f774c[_0x41b2('0x44')]=_0x508d0f;if(_0x365aae['query'][_0x41b2('0x45')]){_0x19eaaa[_0x41b2('0x46')]=[{'all':!![]}];}return db[_0x41b2('0x2e')]['findAll'](_0x19eaaa);})[_0x41b2('0x27')](function(_0x4b1d1e){_0x3f774c[_0x41b2('0x47')]=_0x4b1d1e;return _0x3f774c;})['then'](respondWithFilteredResult(_0x5e78b5,_0x19eaaa))['catch'](handleError(_0x5e78b5,null));};exports[_0x41b2('0x48')]=function(_0x147b37,_0x140007){var _0x34ad0b={'raw':![],'where':{'id':_0x147b37[_0x41b2('0x49')]['id']}},_0x1f79bf={};_0x1f79bf[_0x41b2('0x38')]=_[_0x41b2('0x34')](db['VoiceRecording']['rawAttributes']);_0x1f79bf[_0x41b2('0x35')]=_[_0x41b2('0x34')](_0x147b37[_0x41b2('0x35')]);_0x1f79bf['filters']=_[_0x41b2('0x37')](_0x1f79bf[_0x41b2('0x38')],_0x1f79bf[_0x41b2('0x35')]);_0x34ad0b[_0x41b2('0x3a')]=_[_0x41b2('0x37')](_0x1f79bf['model'],qs[_0x41b2('0x39')](_0x147b37[_0x41b2('0x35')]['fields']));_0x34ad0b[_0x41b2('0x3a')]=_0x34ad0b[_0x41b2('0x3a')][_0x41b2('0x4a')]?_0x34ad0b[_0x41b2('0x3a')]:_0x1f79bf[_0x41b2('0x38')];if(_0x147b37['query'][_0x41b2('0x45')]){_0x34ad0b[_0x41b2('0x46')]=[{'all':!![]}];}_0x34ad0b=_[_0x41b2('0x41')]({},_0x34ad0b,_0x147b37[_0x41b2('0x43')]);return db[_0x41b2('0x2e')][_0x41b2('0x4b')](_0x34ad0b)[_0x41b2('0x27')](handleEntityNotFound(_0x140007,null))[_0x41b2('0x27')](respondWithResult(_0x140007,null))[_0x41b2('0x4c')](handleError(_0x140007,null));};exports[_0x41b2('0x4d')]=function(_0xce150a,_0x15bc6){return db['VoiceRecording']['create'](_0xce150a[_0x41b2('0x4e')],{})['then'](respondWithResult(_0x15bc6,0xc9))[_0x41b2('0x4c')](handleError(_0x15bc6,null));};exports[_0x41b2('0x4f')]=function(_0x4aa73e,_0x444595){if(_0x4aa73e['body']['id']){delete _0x4aa73e[_0x41b2('0x4e')]['id'];}return db[_0x41b2('0x2e')][_0x41b2('0x4b')]({'where':{'id':_0x4aa73e['params']['id']}})[_0x41b2('0x27')](handleEntityNotFound(_0x444595,null))[_0x41b2('0x27')](saveUpdates(_0x4aa73e[_0x41b2('0x4e')],null))[_0x41b2('0x27')](respondWithResult(_0x444595,null))[_0x41b2('0x4c')](handleError(_0x444595,null));};exports[_0x41b2('0x50')]=function(_0x5252c0,_0x39b37e){return db['VoiceRecording']['describe']()[_0x41b2('0x27')](respondWithResult(_0x39b37e,null))['catch'](handleError(_0x39b37e,null));};exports[_0x41b2('0x51')]=function(_0x4879a9,_0xb281dd,_0x291a06){var _0x18930a=require('../../components/encryptor');var _0x3ed6a9=![];var _0x5b2ce1={};if(_0x4879a9[_0x41b2('0x35')][_0x41b2('0x31')]&&_0x4879a9['query'][_0x41b2('0x31')]===_0x41b2('0x52')){_0x5b2ce1[_0x41b2('0x52')]=_0x4879a9['params']['id'];}else{_0x5b2ce1['id']=_0x4879a9[_0x41b2('0x49')]['id'];}return db['VoiceRecording'][_0x41b2('0x4b')]({'where':_0x5b2ce1,'attributes':['id',_0x41b2('0x53')],'raw':!![]})[_0x41b2('0x27')](handleEntityNotFound(_0xb281dd,null))['then'](function(_0x104259){if(_0x104259){var _0x1359be=_0x104259[_0x41b2('0x53')];var _0x274886=util['format'](_0x41b2('0x54'),_0x1359be);if(fs[_0x41b2('0x55')](_0x274886)){_0x3ed6a9=!![];return _0x18930a[_0x41b2('0x56')](_0x274886,_0x1359be,config['secrets']['recording'])[_0x41b2('0x27')](function(){return _0x104259;});}return _0x104259;}})[_0x41b2('0x27')](function(_0x5d685d){if(_0x5d685d){var _0x248d8b=_0x5d685d[_0x41b2('0x53')];if(!fs['existsSync'](_0x248d8b)){throw new db['Sequelize'][(_0x41b2('0x57'))](_0x41b2('0x58'));}if(_0x5d685d[_0x41b2('0x59')]){return _0xb281dd[_0x41b2('0x51')](_0x248d8b,_0x5d685d[_0x41b2('0x59')]+path[_0x41b2('0x5a')](_0x248d8b),function(){if(_0x3ed6a9){fs[_0x41b2('0x5b')](_0x248d8b);}});}else{return _0xb281dd[_0x41b2('0x51')](_0x248d8b,function(_0x3e5688){if(_0x3ed6a9){fs[_0x41b2('0x5b')](_0x248d8b);}});}}})[_0x41b2('0x4c')](function(_0x5aa3ef){if(_0x5aa3ef['message']==='VoiceRecording\x20not\x20found'){_0xb281dd[_0x41b2('0x1e')](0x194)[_0x41b2('0x5c')](_0x41b2('0x5d'));}else{return handleError(_0xb281dd,null);}});};exports['downloads']=function(_0x5cbba2,_0x3b6c30,_0x2bb85f){var _0x546bb3=require(_0x41b2('0x5e'));var _0x205f95=![];var _0xed44d6={'$and':[db[_0x41b2('0x5f')]['where'](db[_0x41b2('0x5f')]['fn'](_0x41b2('0x60'),db[_0x41b2('0x5f')][_0x41b2('0x61')](_0x41b2('0x52'))),_0x5cbba2['query'][_0x41b2('0x62')])]};if(_0x5cbba2[_0x41b2('0x35')][_0x41b2('0x31')]&&_0x5cbba2['query'][_0x41b2('0x31')]==='uniqueid'){_0xed44d6[_0x41b2('0x63')]['push']({'uniqueid':_0x5cbba2[_0x41b2('0x49')]['id']});}else{_0xed44d6[_0x41b2('0x63')][_0x41b2('0x64')]({'id':_0x5cbba2[_0x41b2('0x49')]['id']});}return db[_0x41b2('0x2e')][_0x41b2('0x4b')]({'where':_0xed44d6,'attributes':['id','value'],'raw':!![]})[_0x41b2('0x27')](handleEntityNotFound(_0x3b6c30,null))[_0x41b2('0x27')](function(_0x3d0a18){if(_0x3d0a18){var _0x12808f=util['format'](_0x41b2('0x54'),_0x3d0a18['value']);if(fs['existsSync'](_0x12808f)){_0x205f95=!![];return _0x546bb3[_0x41b2('0x56')](_0x12808f,_0x3d0a18[_0x41b2('0x53')],config['secrets'][_0x41b2('0x65')])['then'](function(){return _0x3d0a18;});}return _0x3d0a18;}})[_0x41b2('0x27')](function(_0x3a877f){if(_0x3a877f){if(!fs[_0x41b2('0x55')](_0x3a877f['value'])){throw new db[(_0x41b2('0x66'))][(_0x41b2('0x57'))](_0x41b2('0x58'));}if(_0x3a877f[_0x41b2('0x59')]){return _0x3b6c30[_0x41b2('0x51')](_0x3a877f[_0x41b2('0x53')],_0x3a877f['filename']+path[_0x41b2('0x5a')](_0x3a877f[_0x41b2('0x53')]),function(){if(_0x205f95){fs['unlink'](_0x3a877f[_0x41b2('0x53')]);}});}else{return _0x3b6c30['download'](_0x3a877f[_0x41b2('0x53')],function(_0x58b34e){if(_0x205f95){fs[_0x41b2('0x5b')](_0x3a877f['value']);}});}}})['catch'](handleError(_0x3b6c30,null));};exports[_0x41b2('0x26')]=function(_0x27abe7,_0x4e09dd){return db[_0x41b2('0x2e')][_0x41b2('0x4b')]({'where':{'id':_0x27abe7[_0x41b2('0x49')]['id']}})[_0x41b2('0x27')](function(_0x24f457){if(_[_0x41b2('0x67')](_0x24f457)){throw new ReferenceError(_0x41b2('0x68'));}return _0x24f457;})[_0x41b2('0x27')](function(_0x3e2c5d){var _0x25d36e=_0x3e2c5d['value'];logger['info'](_0x41b2('0x69'),_0x25d36e);if(!_['isNil'](_0x3e2c5d['value'])&&fs[_0x41b2('0x55')](_0x25d36e)){logger[_0x41b2('0x6a')](_0x41b2('0x6b')+_0x25d36e+_0x41b2('0x6c'));fs['unlinkSync'](_0x25d36e);}_0x25d36e=_0x25d36e+'.cypher';if(!_['isNil'](_0x3e2c5d[_0x41b2('0x53')])&&fs['existsSync'](_0x25d36e)){logger[_0x41b2('0x6a')](_0x41b2('0x6b')+_0x25d36e+_0x41b2('0x6c'));fs['unlinkSync'](_0x25d36e);}return _0x3e2c5d;})[_0x41b2('0x27')](function(_0x3574df){if(!_0x3574df)throw new InternalError();return _0x3574df[_0x41b2('0x26')]();})[_0x41b2('0x27')](function(){_0x4e09dd[_0x41b2('0x1e')](0xcc)[_0x41b2('0x28')]();})[_0x41b2('0x4c')](handleError(_0x4e09dd,null));};function getBucketslist(_0xd4de45,_0x4e7269,_0x2e4477){return new Promise(function(_0x46fbaf,_0x169a24){var _0x31e1df=new AWS['S3']({'accessKeyId':_0x4e7269,'secretAccessKey':_0xd4de45,'region':_0x2e4477});_0x31e1df['listBuckets']({},function(_0xfcec16,_0x175081){if(_0xfcec16){return _0x169a24(_0xfcec16);}else{return _0x46fbaf(_0x175081);}});});}function createBucket(_0x569cdb,_0x33d8dd,_0x3c3745,_0x1e85df){return new Promise(function(_0x30965a,_0x161c2a){var _0x8e5570=new AWS['S3']({'accessKeyId':_0x33d8dd,'secretAccessKey':_0x569cdb,'region':_0x3c3745});_0x8e5570[_0x41b2('0x6d')]({'Bucket':_0x1e85df},function(_0x405d20,_0x518870){if(_0x405d20){return _0x161c2a(_0x405d20);}else{return _0x30965a(_0x518870);}});});}function uploadFile(_0x1183ec,_0x425a71,_0x1a3bd0,_0x382348,_0x1dd41e,_0x148b3a){return new Promise(function(_0x52530d,_0x3efc14){var _0x176186=new AWS['S3']({'accessKeyId':_0x425a71,'secretAccessKey':_0x1183ec,'region':_0x1a3bd0});_0x176186[_0x41b2('0x6e')]({'Bucket':_0x382348,'Key':_0x1dd41e,'Body':_0x148b3a},function(_0x404c5e,_0x18b76f){if(_0x404c5e){return _0x3efc14(_0x404c5e);}else{return _0x52530d(_0x18b76f);}});});}function startTranscribe(_0x12dd90,_0x5a4e28,_0x2eca47,_0x1020d0,_0x120f34,_0x3be3df){return new Promise(function(_0x5254e7,_0x52e823){var _0x11de43=new AWS[(_0x41b2('0x6f'))]({'accessKeyId':_0x5a4e28,'secretAccessKey':_0x12dd90,'region':_0x2eca47});_0x11de43['startTranscriptionJob']({'TranscriptionJobName':_0x1020d0,'LanguageCode':_0x120f34,'Media':{'MediaFileUri':_0x3be3df}},function(_0x1b3ece,_0x3d5753){if(_0x1b3ece){return _0x52e823(_0x1b3ece);}else{return _0x5254e7(_0x3d5753);}});});}function transcribe(_0x5c2298,_0x2e1d3d,_0x2af284,_0x24fd8a,_0x1b25b6,_0x2b3398,_0x48faeb){return new Promise(function(_0x55eca4,_0x1de389){var _0x1791a8={};logger['info'](util[_0x41b2('0x33')](_0x41b2('0x70'),_0x5c2298,_0x1b25b6));return uploadFile(_0x2e1d3d,_0x2af284,_0x24fd8a,_0x1b25b6,path[_0x41b2('0x71')](_0x2b3398),fs[_0x41b2('0x72')](_0x2b3398))[_0x41b2('0x27')](function(_0x42a088){logger[_0x41b2('0x6a')](util[_0x41b2('0x33')](_0x41b2('0x73'),_0x5c2298,_0x1b25b6,_0x42a088[_0x41b2('0x74')]));_0x1791a8[_0x41b2('0x75')]=_0x42a088[_0x41b2('0x76')];_0x1791a8[_0x41b2('0x77')]=_0x42a088[_0x41b2('0x74')];logger['info'](util[_0x41b2('0x33')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x5c2298));return startTranscribe(_0x2e1d3d,_0x2af284,_0x24fd8a,uuidv4(),_0x48faeb,_0x42a088[_0x41b2('0x74')]);})['then'](function(_0x445c2f){logger[_0x41b2('0x6a')](util[_0x41b2('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x5c2298,_0x445c2f['TranscriptionJob'][_0x41b2('0x78')]));_0x1791a8[_0x41b2('0x79')]=_0x445c2f[_0x41b2('0x7a')][_0x41b2('0x78')];_0x1791a8[_0x41b2('0x7b')]=_0x445c2f[_0x41b2('0x7a')][_0x41b2('0x7c')];return _0x55eca4(_0x1791a8);})[_0x41b2('0x4c')](function(_0x523293){return _0x1de389(_0x523293);});});}exports[_0x41b2('0x7d')]=function(_0x28e081,_0x33d916,_0x1566f6){var _0x122018;var _0x412952;var _0x473122;var _0x291a11=require(_0x41b2('0x5e'));return db[_0x41b2('0x2e')][_0x41b2('0x7e')]({'where':{'id':_0x28e081[_0x41b2('0x49')]['id']}})[_0x41b2('0x27')](function(_0x598088){if(_0x598088){var _0x566d9c=util[_0x41b2('0x33')](_0x41b2('0x54'),_0x598088[_0x41b2('0x53')]);if(fs[_0x41b2('0x55')](_0x566d9c)){cypher=!![];return _0x291a11[_0x41b2('0x56')](_0x566d9c,_0x598088[_0x41b2('0x53')],config[_0x41b2('0x7f')][_0x41b2('0x65')])[_0x41b2('0x27')](function(){return _0x598088;});}return _0x598088;}})['then'](function(_0x2761ca){if(!_0x2761ca){throw new db['Sequelize'][(_0x41b2('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x412952=_0x2761ca;return db[_0x41b2('0x80')]['findOne']({'where':{'id':0x1}});})[_0x41b2('0x27')](handleEntityNotFound(_0x33d916,null))[_0x41b2('0x27')](function(_0x52ef13){if(_0x52ef13){_0x122018=_0x52ef13;if(!_0x122018[_0x41b2('0x81')]||!_0x122018[_0x41b2('0x82')]||!_0x122018['transcribeRegion']||!_0x122018['language']||!_0x122018[_0x41b2('0x75')]){throw new db[(_0x41b2('0x66'))]['ValidationError'](_0x41b2('0x83'));}if(_0x28e081['body'][_0x41b2('0x84')]&&(!_0x122018[_0x41b2('0x85')]||!_0x122018[_0x41b2('0x86')]||!_0x122018['sentimentRegion']||!_0x122018['language']||!_0x122018[_0x41b2('0x75')])){throw new db['Sequelize'][(_0x41b2('0x57'))](_0x41b2('0x87'));}return db['CloudProvider']['findOne']({'where':{'id':_0x122018[_0x41b2('0x82')]}});}})['then'](function(_0x12e5f3){if(!_0x12e5f3){throw new db[(_0x41b2('0x66'))]['ValidationError'](_0x41b2('0x88'));}if(!_0x12e5f3['data1']||!_0x12e5f3[_0x41b2('0x89')]){throw new db[(_0x41b2('0x66'))]['ValidationError'](_0x41b2('0x8a'));}_0x473122=_0x12e5f3;return getBucketslist(_0x473122[_0x41b2('0x8b')],_0x473122['data2'],_0x122018[_0x41b2('0x8c')]);})['then'](function(_0x595a1e){if(_0x595a1e&&_0x595a1e[_0x41b2('0x8d')]){var _0x1a53e2=_[_0x41b2('0x4b')](_0x595a1e[_0x41b2('0x8d')],function(_0x30fbec){return _0x30fbec[_0x41b2('0x8e')]===_0x122018[_0x41b2('0x75')];});if(!_0x1a53e2){logger[_0x41b2('0x6a')](util[_0x41b2('0x33')](_0x41b2('0x8f'),_0x28e081['params']['id'],_0x122018['bucket']));return createBucket(_0x473122[_0x41b2('0x8b')],_0x473122['data2'],_0x122018[_0x41b2('0x8c')],_0x122018['bucket']);}logger['info'](util[_0x41b2('0x33')](_0x41b2('0x90'),_0x28e081[_0x41b2('0x49')]['id'],_0x122018[_0x41b2('0x75')]));return;}})['then'](function(_0x3efd83){if(_0x412952['transcribeStatus']===_0x41b2('0x91')){return transcribe(_0x28e081['params']['id'],_0x473122[_0x41b2('0x8b')],_0x473122[_0x41b2('0x89')],_0x122018[_0x41b2('0x8c')],_0x122018[_0x41b2('0x75')],_0x412952[_0x41b2('0x53')],_0x122018['language']);}else{logger[_0x41b2('0x6a')](util[_0x41b2('0x33')](_0x41b2('0x92'),_0x28e081['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x264a64){if(_0x264a64){_0x264a64[_0x41b2('0x93')]=_0x28e081[_0x41b2('0x4e')][_0x41b2('0x84')];return _0x412952[_0x41b2('0x94')](_0x264a64);}})[_0x41b2('0x27')](respondWithResult(_0x33d916,null))[_0x41b2('0x4c')](handleError(_0x33d916,null));};function writeFile(_0x32380c,_0x3d7064){return new Promise(function(_0x5009be,_0x4dc6b4){fs['writeFile'](_0x3d7064,_0x32380c,function(_0x4fbb03,_0x20cfce){if(_0x4fbb03){return _0x4dc6b4(_0x4fbb03);}else{return _0x5009be(_0x20cfce);}});});}exports[_0x41b2('0x95')]=function(_0x3e428f,_0x5f5c17,_0x3b56c1){return db['VoiceRecording'][_0x41b2('0x7e')]({'where':{'id':_0x3e428f[_0x41b2('0x49')]['id']}})[_0x41b2('0x27')](handleEntityNotFound(_0x5f5c17))['then'](function(_0x36b650){if(_0x36b650&&_0x36b650[_0x41b2('0x96')]){var _0x5f2816=_0x36b650[_0x41b2('0x96')];var _0x2fef1b=config[_0x41b2('0x97')]+_0x41b2('0x98')+_0x36b650['id']+'.txt';if(fs[_0x41b2('0x55')](_0x2fef1b)){return _0x2fef1b;}return writeFile(_0x5f2816,_0x2fef1b)['then'](function(){return _0x2fef1b;});}else{throw new db[(_0x41b2('0x66'))]['ValidationError'](_0x41b2('0x99'));}})[_0x41b2('0x27')](function(_0x50ea22){return _0x5f5c17[_0x41b2('0x51')](_0x50ea22);})[_0x41b2('0x4c')](handleError(_0x5f5c17));}; \ No newline at end of file +var _0xf1dd=['destroy','sendStatus','error','stack','send','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','download','value','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','uniqueid','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','decryptFile','ValidationError','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','writeFile','downloadTranscribe','findOne','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xf1dd,0x102));var _0xdf1d=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xf1dd[_0x3a0ebd];return _0x51a660;};'use strict';var emlformat=require(_0xdf1d('0x0'));var rimraf=require(_0xdf1d('0x1'));var zipdir=require(_0xdf1d('0x2'));var jsonpatch=require(_0xdf1d('0x3'));var rp=require(_0xdf1d('0x4'));var moment=require('moment');var BPromise=require(_0xdf1d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf1d('0x6'));var csv=require(_0xdf1d('0x7'));var ejs=require(_0xdf1d('0x8'));var fs=require('fs');var fs_extra=require(_0xdf1d('0x9'));var _=require('lodash');var squel=require(_0xdf1d('0xa'));var crypto=require('crypto');var jsforce=require(_0xdf1d('0xb'));var deskjs=require(_0xdf1d('0xc'));var toCsv=require(_0xdf1d('0x7'));var querystring=require(_0xdf1d('0xd'));var Papa=require('papaparse');var AWS=require(_0xdf1d('0xe'));var uuidv4=require(_0xdf1d('0xf'));var Redis=require('ioredis');var authService=require(_0xdf1d('0x10'));var qs=require(_0xdf1d('0x11'));var as=require(_0xdf1d('0x12'));var hardwareService=require(_0xdf1d('0x13'));var logger=require(_0xdf1d('0x14'))(_0xdf1d('0x15'));var utils=require(_0xdf1d('0x16'));var config=require(_0xdf1d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1c24,_0x3887a7){_0x3887a7=_0x3887a7||0xcc;return function(_0x40319e){if(_0x40319e){return _0x5f1c24['sendStatus'](_0x3887a7);}return _0x5f1c24[_0xdf1d('0x18')](_0x3887a7)[_0xdf1d('0x19')]();};}function respondWithResult(_0x23c2b8,_0x2f39aa){_0x2f39aa=_0x2f39aa||0xc8;return function(_0x57e381){if(_0x57e381){return _0x23c2b8[_0xdf1d('0x18')](_0x2f39aa)[_0xdf1d('0x1a')](_0x57e381);}};}function respondWithFilteredResult(_0x2b41e2,_0x182a20){return function(_0x213d53){if(_0x213d53){var _0x7e0dc5=typeof _0x182a20['offset']==='undefined'&&typeof _0x182a20[_0xdf1d('0x1b')]===_0xdf1d('0x1c');var _0x146b93=_0x213d53[_0xdf1d('0x1d')];var _0x11d257=_0x7e0dc5?0x0:_0x182a20[_0xdf1d('0x1e')];var _0x1f5533=_0x7e0dc5?_0x213d53[_0xdf1d('0x1d')]:_0x182a20[_0xdf1d('0x1e')]+_0x182a20[_0xdf1d('0x1b')];var _0x5a58fe;if(_0x1f5533>=_0x146b93){_0x1f5533=_0x146b93;_0x5a58fe=0xc8;}else{_0x5a58fe=0xce;}_0x2b41e2[_0xdf1d('0x18')](_0x5a58fe);return _0x2b41e2[_0xdf1d('0x1f')](_0xdf1d('0x20'),_0x11d257+'-'+_0x1f5533+'/'+_0x146b93)['json'](_0x213d53);}return null;};}function patchUpdates(_0x2c7fb3){return function(_0x49769d){try{jsonpatch[_0xdf1d('0x21')](_0x49769d,_0x2c7fb3,!![]);}catch(_0x317ecc){return BPromise['reject'](_0x317ecc);}return _0x49769d['save']();};}function saveUpdates(_0x10300d,_0x3b3563){return function(_0x3e6980){if(_0x3e6980){return _0x3e6980[_0xdf1d('0x22')](_0x10300d)[_0xdf1d('0x23')](function(_0x1aa998){return _0x1aa998;});}return null;};}function removeEntity(_0x218a05,_0x42e2f6){return function(_0x27d001){if(_0x27d001){return _0x27d001[_0xdf1d('0x24')]()['then'](function(){_0x218a05[_0xdf1d('0x18')](0xcc)[_0xdf1d('0x19')]();});}};}function handleEntityNotFound(_0x3ca949,_0x3f63e7){return function(_0x627fa){if(!_0x627fa){_0x3ca949[_0xdf1d('0x25')](0x194);}return _0x627fa;};}function handleError(_0x4c7a88,_0x39c89d){_0x39c89d=_0x39c89d||0x1f4;return function(_0x77aff0){logger[_0xdf1d('0x26')](_0x77aff0[_0xdf1d('0x27')]);if(_0x77aff0['name']){delete _0x77aff0['name'];}_0x4c7a88[_0xdf1d('0x18')](_0x39c89d)[_0xdf1d('0x28')](_0x77aff0);};}exports['index']=function(_0x184467,_0x3e09d7){var _0x18ce73={},_0x5f561f={},_0x11993a={'count':0x0,'rows':[]};var _0x3cdb8a=_[_0xdf1d('0x29')](db[_0xdf1d('0x2a')][_0xdf1d('0x2b')],function(_0x15c943){return{'name':_0x15c943[_0xdf1d('0x2c')],'type':_0x15c943[_0xdf1d('0x2d')][_0xdf1d('0x2e')]};});_0x5f561f['model']=_[_0xdf1d('0x2f')](_[_0xdf1d('0x29')](_0x3cdb8a,'name'),[_0xdf1d('0x30')]);_0x5f561f['query']=_[_0xdf1d('0x31')](_0x184467[_0xdf1d('0x32')]);_0x5f561f[_0xdf1d('0x33')]=_[_0xdf1d('0x34')](_0x5f561f['model'],_0x5f561f[_0xdf1d('0x32')]);_0x18ce73['attributes']=_['intersection'](_0x5f561f[_0xdf1d('0x35')],qs['fields'](_0x184467['query'][_0xdf1d('0x36')]));_0x18ce73[_0xdf1d('0x37')]=_0x18ce73['attributes'][_0xdf1d('0x38')]?_0x18ce73['attributes']:_0x5f561f['model'];if(!_0x184467[_0xdf1d('0x32')][_0xdf1d('0x39')](_0xdf1d('0x3a'))){_0x18ce73[_0xdf1d('0x1b')]=qs[_0xdf1d('0x1b')](_0x184467['query'][_0xdf1d('0x1b')]);_0x18ce73[_0xdf1d('0x1e')]=qs[_0xdf1d('0x1e')](_0x184467[_0xdf1d('0x32')][_0xdf1d('0x1e')]);}_0x18ce73[_0xdf1d('0x3b')]=qs[_0xdf1d('0x3c')](_0x184467[_0xdf1d('0x32')][_0xdf1d('0x3c')]);_0x18ce73['where']=qs[_0xdf1d('0x33')](_[_0xdf1d('0x3d')](_0x184467[_0xdf1d('0x32')],_0x5f561f['filters']),_0x3cdb8a);if(_0x184467['query'][_0xdf1d('0x3e')]){_0x18ce73[_0xdf1d('0x3f')]=_[_0xdf1d('0x40')](_0x18ce73[_0xdf1d('0x3f')],{'$or':_[_0xdf1d('0x29')](_0x3cdb8a,function(_0x445fbf){if(_0x445fbf[_0xdf1d('0x2d')]!==_0xdf1d('0x41')){var _0x4174d9={};_0x4174d9[_0x445fbf[_0xdf1d('0x42')]]={'$like':'%'+_0x184467[_0xdf1d('0x32')][_0xdf1d('0x3e')]+'%'};return _0x4174d9;}})});}_0x18ce73=_[_0xdf1d('0x40')]({},_0x18ce73,_0x184467[_0xdf1d('0x43')]);var _0x218b64={'where':_0x18ce73[_0xdf1d('0x3f')]};return db['VoiceRecording'][_0xdf1d('0x1d')](_0x218b64)['then'](function(_0x3e3807){_0x11993a['count']=_0x3e3807;if(_0x184467[_0xdf1d('0x32')][_0xdf1d('0x44')]){_0x18ce73[_0xdf1d('0x45')]=[{'all':!![]}];}return db[_0xdf1d('0x2a')][_0xdf1d('0x46')](_0x18ce73);})['then'](function(_0x3e3eb0){_0x11993a[_0xdf1d('0x47')]=_0x3e3eb0;return _0x11993a;})[_0xdf1d('0x23')](respondWithFilteredResult(_0x3e09d7,_0x18ce73))['catch'](handleError(_0x3e09d7,null));};exports[_0xdf1d('0x48')]=function(_0x5bcacb,_0x271b2c){var _0x4f3283={'raw':![],'where':{'id':_0x5bcacb['params']['id']}},_0x3a3f1c={};_0x3a3f1c['model']=_[_0xdf1d('0x31')](db['VoiceRecording']['rawAttributes']);_0x3a3f1c[_0xdf1d('0x32')]=_['keys'](_0x5bcacb[_0xdf1d('0x32')]);_0x3a3f1c['filters']=_[_0xdf1d('0x34')](_0x3a3f1c[_0xdf1d('0x35')],_0x3a3f1c[_0xdf1d('0x32')]);_0x4f3283[_0xdf1d('0x37')]=_['intersection'](_0x3a3f1c[_0xdf1d('0x35')],qs[_0xdf1d('0x36')](_0x5bcacb['query'][_0xdf1d('0x36')]));_0x4f3283[_0xdf1d('0x37')]=_0x4f3283[_0xdf1d('0x37')][_0xdf1d('0x38')]?_0x4f3283[_0xdf1d('0x37')]:_0x3a3f1c[_0xdf1d('0x35')];if(_0x5bcacb['query'][_0xdf1d('0x44')]){_0x4f3283[_0xdf1d('0x45')]=[{'all':!![]}];}_0x4f3283=_['merge']({},_0x4f3283,_0x5bcacb[_0xdf1d('0x43')]);return db[_0xdf1d('0x2a')][_0xdf1d('0x49')](_0x4f3283)[_0xdf1d('0x23')](handleEntityNotFound(_0x271b2c,null))[_0xdf1d('0x23')](respondWithResult(_0x271b2c,null))[_0xdf1d('0x4a')](handleError(_0x271b2c,null));};exports[_0xdf1d('0x4b')]=function(_0x5f21f1,_0x5eff8b){return db[_0xdf1d('0x2a')]['create'](_0x5f21f1[_0xdf1d('0x4c')],{})[_0xdf1d('0x23')](respondWithResult(_0x5eff8b,0xc9))[_0xdf1d('0x4a')](handleError(_0x5eff8b,null));};exports[_0xdf1d('0x22')]=function(_0x58a0ee,_0x3501ce){if(_0x58a0ee[_0xdf1d('0x4c')]['id']){delete _0x58a0ee['body']['id'];}return db['VoiceRecording'][_0xdf1d('0x49')]({'where':{'id':_0x58a0ee[_0xdf1d('0x4d')]['id']}})[_0xdf1d('0x23')](handleEntityNotFound(_0x3501ce,null))[_0xdf1d('0x23')](saveUpdates(_0x58a0ee['body'],null))[_0xdf1d('0x23')](respondWithResult(_0x3501ce,null))[_0xdf1d('0x4a')](handleError(_0x3501ce,null));};exports[_0xdf1d('0x4e')]=function(_0x106a15,_0x300f08){return db[_0xdf1d('0x2a')][_0xdf1d('0x4e')]()[_0xdf1d('0x23')](respondWithResult(_0x300f08,null))['catch'](handleError(_0x300f08,null));};exports[_0xdf1d('0x4f')]=function(_0x568ab5,_0x463faa,_0x7b5523){var _0x1b12f0=require('../../components/encryptor');var _0x3e86d0=![];var _0x17e065={};if(_0x568ab5['query'][_0xdf1d('0x2d')]&&_0x568ab5[_0xdf1d('0x32')][_0xdf1d('0x2d')]==='uniqueid'){_0x17e065['uniqueid']=_0x568ab5['params']['id'];}else{_0x17e065['id']=_0x568ab5['params']['id'];}return db[_0xdf1d('0x2a')][_0xdf1d('0x49')]({'where':_0x17e065,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x463faa,null))['then'](function(_0x44aa41){if(_0x44aa41){var _0x13bac0=_0x44aa41[_0xdf1d('0x50')];var _0x4067d6=util[_0xdf1d('0x30')]('%s.cypher',_0x13bac0);if(fs['existsSync'](_0x4067d6)){_0x3e86d0=!![];return _0x1b12f0['decryptFile'](_0x4067d6,_0x13bac0,config[_0xdf1d('0x51')][_0xdf1d('0x52')])[_0xdf1d('0x23')](function(){return _0x44aa41;});}return _0x44aa41;}})['then'](function(_0x408f4e){if(_0x408f4e){var _0x3f4981=_0x408f4e['value'];if(!fs['existsSync'](_0x3f4981)){throw new db[(_0xdf1d('0x53'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x408f4e[_0xdf1d('0x54')]){return _0x463faa[_0xdf1d('0x4f')](_0x3f4981,_0x408f4e['filename']+path[_0xdf1d('0x55')](_0x3f4981),function(){if(_0x3e86d0){fs[_0xdf1d('0x56')](_0x3f4981);}});}else{return _0x463faa[_0xdf1d('0x4f')](_0x3f4981,function(_0x2709d7){if(_0x3e86d0){fs[_0xdf1d('0x56')](_0x3f4981);}});}}})[_0xdf1d('0x4a')](function(_0x2b4447){if(_0x2b4447[_0xdf1d('0x57')]===_0xdf1d('0x58')){_0x463faa[_0xdf1d('0x18')](0x194)[_0xdf1d('0x28')](_0xdf1d('0x59'));}else{return handleError(_0x463faa,null);}});};exports[_0xdf1d('0x5a')]=function(_0x3f6fb1,_0x451176,_0x59c46a){var _0x5d4a12=require(_0xdf1d('0x5b'));var _0x5b2ea7=![];var _0x149317={'$and':[db[_0xdf1d('0x5c')][_0xdf1d('0x3f')](db[_0xdf1d('0x5c')]['fn'](_0xdf1d('0x5d'),db[_0xdf1d('0x5c')]['col'](_0xdf1d('0x5e'))),_0x3f6fb1[_0xdf1d('0x32')]['token'])]};if(_0x3f6fb1[_0xdf1d('0x32')][_0xdf1d('0x2d')]&&_0x3f6fb1[_0xdf1d('0x32')][_0xdf1d('0x2d')]===_0xdf1d('0x5e')){_0x149317[_0xdf1d('0x5f')][_0xdf1d('0x60')]({'uniqueid':_0x3f6fb1['params']['id']});}else{_0x149317[_0xdf1d('0x5f')][_0xdf1d('0x60')]({'id':_0x3f6fb1[_0xdf1d('0x4d')]['id']});}return db['VoiceRecording'][_0xdf1d('0x49')]({'where':_0x149317,'attributes':['id',_0xdf1d('0x50')],'raw':!![]})[_0xdf1d('0x23')](handleEntityNotFound(_0x451176,null))[_0xdf1d('0x23')](function(_0x31963d){if(_0x31963d){var _0x4f2563=util[_0xdf1d('0x30')](_0xdf1d('0x61'),_0x31963d[_0xdf1d('0x50')]);if(fs['existsSync'](_0x4f2563)){_0x5b2ea7=!![];return _0x5d4a12['decryptFile'](_0x4f2563,_0x31963d[_0xdf1d('0x50')],config[_0xdf1d('0x51')][_0xdf1d('0x52')])[_0xdf1d('0x23')](function(){return _0x31963d;});}return _0x31963d;}})[_0xdf1d('0x23')](function(_0x2da126){if(_0x2da126){if(!fs['existsSync'](_0x2da126[_0xdf1d('0x50')])){throw new db[(_0xdf1d('0x53'))]['ValidationError'](_0xdf1d('0x58'));}if(_0x2da126[_0xdf1d('0x54')]){return _0x451176['download'](_0x2da126[_0xdf1d('0x50')],_0x2da126[_0xdf1d('0x54')]+path['extname'](_0x2da126[_0xdf1d('0x50')]),function(){if(_0x5b2ea7){fs['unlink'](_0x2da126[_0xdf1d('0x50')]);}});}else{return _0x451176[_0xdf1d('0x4f')](_0x2da126['value'],function(_0x54fc7c){if(_0x5b2ea7){fs['unlink'](_0x2da126[_0xdf1d('0x50')]);}});}}})[_0xdf1d('0x4a')](handleError(_0x451176,null));};exports['destroy']=function(_0x3e1378,_0x476093){return db['VoiceRecording'][_0xdf1d('0x49')]({'where':{'id':_0x3e1378[_0xdf1d('0x4d')]['id']}})['then'](function(_0x11b498){if(_[_0xdf1d('0x62')](_0x11b498)){throw new ReferenceError(_0xdf1d('0x63'));}return _0x11b498;})[_0xdf1d('0x23')](function(_0x551534){var _0x5ded3c=_0x551534[_0xdf1d('0x50')];logger[_0xdf1d('0x64')](_0xdf1d('0x65'),_0x5ded3c);if(!_[_0xdf1d('0x62')](_0x551534[_0xdf1d('0x50')])&&fs[_0xdf1d('0x66')](_0x5ded3c)){logger[_0xdf1d('0x64')](_0xdf1d('0x67')+_0x5ded3c+_0xdf1d('0x68'));fs[_0xdf1d('0x69')](_0x5ded3c);}_0x5ded3c=_0x5ded3c+_0xdf1d('0x6a');if(!_[_0xdf1d('0x62')](_0x551534[_0xdf1d('0x50')])&&fs['existsSync'](_0x5ded3c)){logger['info'](_0xdf1d('0x67')+_0x5ded3c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdf1d('0x69')](_0x5ded3c);}return _0x551534;})[_0xdf1d('0x23')](function(_0x11ae0c){if(!_0x11ae0c)throw new InternalError();return _0x11ae0c[_0xdf1d('0x24')]();})[_0xdf1d('0x23')](function(){_0x476093[_0xdf1d('0x18')](0xcc)[_0xdf1d('0x19')]();})['catch'](handleError(_0x476093,null));};function getBucketslist(_0x5aaf1e,_0x1e3bb8,_0x19b479){return new Promise(function(_0x5cbf8c,_0x4d9649){var _0xf40f5=new AWS['S3']({'accessKeyId':_0x1e3bb8,'secretAccessKey':_0x5aaf1e,'region':_0x19b479});_0xf40f5['listBuckets']({},function(_0x315282,_0x38fac0){if(_0x315282){return _0x4d9649(_0x315282);}else{return _0x5cbf8c(_0x38fac0);}});});}function createBucket(_0x2f006c,_0x6dddc4,_0x52334e,_0x4950b3){return new Promise(function(_0x5006a5,_0x49c974){var _0x3b9ef4=new AWS['S3']({'accessKeyId':_0x6dddc4,'secretAccessKey':_0x2f006c,'region':_0x52334e});_0x3b9ef4[_0xdf1d('0x6b')]({'Bucket':_0x4950b3},function(_0x4c5405,_0x231c98){if(_0x4c5405){return _0x49c974(_0x4c5405);}else{return _0x5006a5(_0x231c98);}});});}function uploadFile(_0x52ab57,_0x418706,_0xcc29be,_0x59716a,_0x47dc86,_0x55e75c){return new Promise(function(_0x211eff,_0x41de7d){var _0x59273d=new AWS['S3']({'accessKeyId':_0x418706,'secretAccessKey':_0x52ab57,'region':_0xcc29be});_0x59273d[_0xdf1d('0x6c')]({'Bucket':_0x59716a,'Key':_0x47dc86,'Body':_0x55e75c},function(_0x51cfa8,_0x466a2d){if(_0x51cfa8){return _0x41de7d(_0x51cfa8);}else{return _0x211eff(_0x466a2d);}});});}function startTranscribe(_0x9d0c1e,_0x19ab7a,_0x4dca3a,_0x54915b,_0x7a38cf,_0x407d2e){return new Promise(function(_0x3e9c68,_0x52415d){var _0x34b7d2=new AWS['TranscribeService']({'accessKeyId':_0x19ab7a,'secretAccessKey':_0x9d0c1e,'region':_0x4dca3a});_0x34b7d2[_0xdf1d('0x6d')]({'TranscriptionJobName':_0x54915b,'LanguageCode':_0x7a38cf,'Media':{'MediaFileUri':_0x407d2e}},function(_0x3788b9,_0x4723db){if(_0x3788b9){return _0x52415d(_0x3788b9);}else{return _0x3e9c68(_0x4723db);}});});}function transcribe(_0x5b94e3,_0x1c0612,_0x4ec822,_0x3e627b,_0x53cbd4,_0x473248,_0x4a6aed){return new Promise(function(_0x987b75,_0x1310a5){var _0x51221d={};logger['info'](util[_0xdf1d('0x30')](_0xdf1d('0x6e'),_0x5b94e3,_0x53cbd4));return uploadFile(_0x1c0612,_0x4ec822,_0x3e627b,_0x53cbd4,path[_0xdf1d('0x6f')](_0x473248),fs['readFileSync'](_0x473248))[_0xdf1d('0x23')](function(_0x1cc4ba){logger[_0xdf1d('0x64')](util[_0xdf1d('0x30')](_0xdf1d('0x70'),_0x5b94e3,_0x53cbd4,_0x1cc4ba[_0xdf1d('0x71')]));_0x51221d[_0xdf1d('0x72')]=_0x1cc4ba[_0xdf1d('0x73')];_0x51221d[_0xdf1d('0x74')]=_0x1cc4ba['Location'];logger[_0xdf1d('0x64')](util[_0xdf1d('0x30')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x5b94e3));return startTranscribe(_0x1c0612,_0x4ec822,_0x3e627b,uuidv4(),_0x4a6aed,_0x1cc4ba[_0xdf1d('0x71')]);})[_0xdf1d('0x23')](function(_0xec4fbe){logger[_0xdf1d('0x64')](util[_0xdf1d('0x30')](_0xdf1d('0x75'),_0x5b94e3,_0xec4fbe[_0xdf1d('0x76')]['TranscriptionJobName']));_0x51221d[_0xdf1d('0x77')]=_0xec4fbe[_0xdf1d('0x76')]['TranscriptionJobName'];_0x51221d[_0xdf1d('0x78')]=_0xec4fbe['TranscriptionJob']['TranscriptionJobStatus'];return _0x987b75(_0x51221d);})['catch'](function(_0x562d0b){return _0x1310a5(_0x562d0b);});});}exports['runTranscribe']=function(_0xa83579,_0xa1b29c,_0x344c97){var _0x29777e;var _0x58dcfe;var _0x14b358;var _0x283b08=require(_0xdf1d('0x5b'));return db[_0xdf1d('0x2a')]['findOne']({'where':{'id':_0xa83579['params']['id']}})[_0xdf1d('0x23')](function(_0x24937b){if(_0x24937b){var _0x4921e0=util['format']('%s.cypher',_0x24937b[_0xdf1d('0x50')]);if(fs[_0xdf1d('0x66')](_0x4921e0)){cypher=!![];return _0x283b08[_0xdf1d('0x79')](_0x4921e0,_0x24937b[_0xdf1d('0x50')],config[_0xdf1d('0x51')]['recording'])[_0xdf1d('0x23')](function(){return _0x24937b;});}return _0x24937b;}})[_0xdf1d('0x23')](function(_0x1366bd){if(!_0x1366bd){throw new db[(_0xdf1d('0x53'))][(_0xdf1d('0x7a'))]('Voice\x20Recording\x20not\x20found');}_0x58dcfe=_0x1366bd;return db[_0xdf1d('0x7b')]['findOne']({'where':{'id':0x1}});})[_0xdf1d('0x23')](handleEntityNotFound(_0xa1b29c,null))[_0xdf1d('0x23')](function(_0xb88e88){if(_0xb88e88){_0x29777e=_0xb88e88;if(!_0x29777e[_0xdf1d('0x7c')]||!_0x29777e[_0xdf1d('0x7d')]||!_0x29777e[_0xdf1d('0x7e')]||!_0x29777e[_0xdf1d('0x7f')]||!_0x29777e[_0xdf1d('0x72')]){throw new db[(_0xdf1d('0x53'))][(_0xdf1d('0x7a'))](_0xdf1d('0x80'));}if(_0xa83579['body']['runSentiment']&&(!_0x29777e[_0xdf1d('0x81')]||!_0x29777e[_0xdf1d('0x82')]||!_0x29777e['sentimentRegion']||!_0x29777e[_0xdf1d('0x7f')]||!_0x29777e[_0xdf1d('0x72')])){throw new db[(_0xdf1d('0x53'))][(_0xdf1d('0x7a'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x29777e[_0xdf1d('0x7d')]}});}})[_0xdf1d('0x23')](function(_0xe416c7){if(!_0xe416c7){throw new db['Sequelize']['ValidationError'](_0xdf1d('0x83'));}if(!_0xe416c7['data1']||!_0xe416c7['data2']){throw new db[(_0xdf1d('0x53'))][(_0xdf1d('0x7a'))]('Cloud\x20Provider\x20not\x20configured');}_0x14b358=_0xe416c7;return getBucketslist(_0x14b358[_0xdf1d('0x84')],_0x14b358[_0xdf1d('0x85')],_0x29777e[_0xdf1d('0x7e')]);})[_0xdf1d('0x23')](function(_0x2b5440){if(_0x2b5440&&_0x2b5440[_0xdf1d('0x86')]){var _0x292b13=_[_0xdf1d('0x49')](_0x2b5440[_0xdf1d('0x86')],function(_0x57820f){return _0x57820f['Name']===_0x29777e[_0xdf1d('0x72')];});if(!_0x292b13){logger['info'](util[_0xdf1d('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xa83579[_0xdf1d('0x4d')]['id'],_0x29777e[_0xdf1d('0x72')]));return createBucket(_0x14b358[_0xdf1d('0x84')],_0x14b358['data2'],_0x29777e[_0xdf1d('0x7e')],_0x29777e[_0xdf1d('0x72')]);}logger['info'](util[_0xdf1d('0x30')](_0xdf1d('0x87'),_0xa83579[_0xdf1d('0x4d')]['id'],_0x29777e['bucket']));return;}})[_0xdf1d('0x23')](function(_0x11dcb1){if(_0x58dcfe['transcribeStatus']===_0xdf1d('0x88')){return transcribe(_0xa83579[_0xdf1d('0x4d')]['id'],_0x14b358[_0xdf1d('0x84')],_0x14b358[_0xdf1d('0x85')],_0x29777e[_0xdf1d('0x7e')],_0x29777e[_0xdf1d('0x72')],_0x58dcfe[_0xdf1d('0x50')],_0x29777e[_0xdf1d('0x7f')]);}else{logger[_0xdf1d('0x64')](util[_0xdf1d('0x30')](_0xdf1d('0x89'),_0xa83579['params']['id']));return{'transcribeStatus':_0xdf1d('0x8a')};}})['then'](function(_0x1464ce){if(_0x1464ce){_0x1464ce['tempSentiment']=_0xa83579[_0xdf1d('0x4c')][_0xdf1d('0x8b')];return _0x58dcfe[_0xdf1d('0x8c')](_0x1464ce);}})[_0xdf1d('0x23')](respondWithResult(_0xa1b29c,null))['catch'](handleError(_0xa1b29c,null));};function writeFile(_0x3d1b90,_0x172350){return new Promise(function(_0x27290c,_0x88bfd2){fs[_0xdf1d('0x8d')](_0x172350,_0x3d1b90,function(_0x2f00fa,_0x22235d){if(_0x2f00fa){return _0x88bfd2(_0x2f00fa);}else{return _0x27290c(_0x22235d);}});});}exports[_0xdf1d('0x8e')]=function(_0x57b0ef,_0x3c809a,_0x89d7a3){return db['VoiceRecording'][_0xdf1d('0x8f')]({'where':{'id':_0x57b0ef['params']['id']}})[_0xdf1d('0x23')](handleEntityNotFound(_0x3c809a))[_0xdf1d('0x23')](function(_0x16a59e){if(_0x16a59e&&_0x16a59e[_0xdf1d('0x90')]){var _0x535b22=_0x16a59e[_0xdf1d('0x90')];var _0x78bb7c=config['root']+_0xdf1d('0x91')+_0x16a59e['id']+'.txt';if(fs['existsSync'](_0x78bb7c)){return _0x78bb7c;}return writeFile(_0x535b22,_0x78bb7c)[_0xdf1d('0x23')](function(){return _0x78bb7c;});}else{throw new db[(_0xdf1d('0x53'))]['ValidationError'](_0xdf1d('0x92'));}})[_0xdf1d('0x23')](function(_0x368219){return _0x3c809a[_0xdf1d('0x4f')](_0x368219);})[_0xdf1d('0x4a')](handleError(_0x3c809a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index def39a5..594735b 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 _0xa7dc=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x56f4ac,_0x14785b){var _0x4a7623=function(_0x241ead){while(--_0x241ead){_0x56f4ac['push'](_0x56f4ac['shift']());}};_0x4a7623(++_0x14785b);}(_0xa7dc,0x11d));var _0xca7d=function(_0x49194c,_0x208554){_0x49194c=_0x49194c-0x0;var _0x362b56=_0xa7dc[_0x49194c];return _0x362b56;};'use strict';var attributes=require(_0xca7d('0x0'));module[_0xca7d('0x1')]=function(_0x150001,_0x4ea9c6){return _0x150001[_0xca7d('0x2')]('VoiceRecording',attributes,{'tableName':_0xca7d('0x3'),'paranoid':![],'indexes':[{'name':_0xca7d('0x4'),'fields':[_0xca7d('0x4')]},{'name':_0xca7d('0x5'),'fields':[_0xca7d('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d55=['exports','define','voice_recordings','uniqueid','transcribeStatus'];(function(_0x4595fd,_0x5c25b9){var _0xece29=function(_0x11f2c4){while(--_0x11f2c4){_0x4595fd['push'](_0x4595fd['shift']());}};_0xece29(++_0x5c25b9);}(_0x5d55,0x1a4));var _0x55d5=function(_0x502996,_0x524d05){_0x502996=_0x502996-0x0;var _0x4406da=_0x5d55[_0x502996];return _0x4406da;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x55d5('0x0')]=function(_0x4cd0e2,_0x1de575){return _0x4cd0e2[_0x55d5('0x1')]('VoiceRecording',attributes,{'tableName':_0x55d5('0x2'),'paranoid':![],'indexes':[{'name':_0x55d5('0x3'),'fields':[_0x55d5('0x3')]},{'name':'transcribeStatus','fields':[_0x55d5('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index a49415d..68d63cf 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 _0x47c5=['secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceRecording','update','body','options','raw','where','attributes','limit','UpdateVoiceRecording','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher'];(function(_0x2fc3ee,_0x56ab8c){var _0x2ad3f4=function(_0x101eca){while(--_0x101eca){_0x2fc3ee['push'](_0x2fc3ee['shift']());}};_0x2ad3f4(++_0x56ab8c);}(_0x47c5,0x165));var _0x547c=function(_0x57dc4e,_0x480ebb){_0x57dc4e=_0x57dc4e-0x0;var _0x58bed7=_0x47c5[_0x57dc4e];return _0x58bed7;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['UpdateVoiceRecording']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23fa9e['options']?_0x23fa9e['options'][_0x547c('0x1d')]||null:null,'attributes':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1e')]||null:null,'limit':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1f')]||null:null})[_0x547c('0xc')](function(_0x436e67){logger['info'](_0x547c('0x20'),_0x23fa9e);logger[_0x547c('0x10')](_0x547c('0x20'),_0x23fa9e,JSON[_0x547c('0x12')](_0x436e67));_0xeb059e(_0x436e67);})[_0x547c('0x17')](function(_0x2663bc){logger[_0x547c('0x13')](_0x547c('0x20'),_0x2663bc['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2663bc['message']));});});};exports['CreateVoiceRecording']=function(_0x4855fd){var _0x478f04=this;return new Promise(function(_0x2c725d,_0x4c5256){var _0x93985c=require('../../components/encryptor');var _0x3ea493;return db['Setting'][_0x547c('0x21')]({'attributes':['id',_0x547c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x547c('0xc')](function(_0x30a96c){_0x3ea493=_0x30a96c;return db[_0x547c('0x18')]['create'](_0x4855fd['body']);})[_0x547c('0xc')](function(_0x54de6f){if(_0x3ea493[_0x547c('0x22')]&&fs[_0x547c('0x23')](_0x54de6f[_0x547c('0x24')])){var _0x1695be=util[_0x547c('0x25')](_0x547c('0x26'),_0x54de6f[_0x547c('0x24')]);return _0x93985c['encryptFile'](_0x54de6f['value'],_0x1695be,config[_0x547c('0x27')][_0x547c('0x28')])[_0x547c('0xc')](function(){fs[_0x547c('0x29')](_0x54de6f[_0x547c('0x24')]);logger[_0x547c('0xd')](_0x547c('0x2a'));return _0x54de6f;});}return _0x54de6f;})[_0x547c('0xc')](function(_0x378bac){logger[_0x547c('0xd')](_0x547c('0x2b'),_0x4855fd);logger[_0x547c('0x10')](_0x547c('0x2b'),_0x4855fd,JSON[_0x547c('0x12')](_0x378bac));_0x2c725d(_0x378bac);})['catch'](function(_0x3afc28){logger['error']('CreateVoiceRecording',_0x3afc28['message'],_0x4855fd);_0x4c5256(_0x478f04[_0x547c('0x13')](0x1f4,_0x3afc28[_0x547c('0x15')]));});});}; \ No newline at end of file +var _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x4975,0x86));var _0x5497=function(_0x484e0c,_0x473ae4){_0x484e0c=_0x484e0c-0x0;var _0x5c0367=_0x4975[_0x484e0c];return _0x5c0367;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1f68686..cbceb90 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 _0xc0d3=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0xc0d3,0x9d));var _0x3c0d=function(_0x1dcbfa,_0x3df713){_0x1dcbfa=_0x1dcbfa-0x0;var _0x55fb42=_0xc0d3[_0x1dcbfa];return _0x55fb42;};'use strict';var multer=require(_0x3c0d('0x0'));var util=require(_0x3c0d('0x1'));var path=require('path');var timeout=require(_0x3c0d('0x2'));var express=require(_0x3c0d('0x3'));var router=express[_0x3c0d('0x4')]();var fs_extra=require(_0x3c0d('0x5'));var auth=require(_0x3c0d('0x6'));var interaction=require(_0x3c0d('0x7'));var config=require(_0x3c0d('0x8'));var controller=require(_0x3c0d('0x9'));router['get']('/',auth[_0x3c0d('0xa')](),controller[_0x3c0d('0xb')]);router[_0x3c0d('0xc')]('/describe',auth[_0x3c0d('0xa')](),controller[_0x3c0d('0xd')]);router[_0x3c0d('0xc')](_0x3c0d('0xe'),auth[_0x3c0d('0xa')](),controller[_0x3c0d('0xf')]);router[_0x3c0d('0x10')]('/',auth['isAuthenticated'](),controller[_0x3c0d('0x11')]);router[_0x3c0d('0x12')](_0x3c0d('0xe'),auth['isAuthenticated'](),controller[_0x3c0d('0x13')]);router[_0x3c0d('0x14')](_0x3c0d('0xe'),auth[_0x3c0d('0xa')](),controller['destroy']);module[_0x3c0d('0x15')]=router; \ No newline at end of file +var _0xe44f=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','get','/describe'];(function(_0x1598f1,_0x56b427){var _0x12d575=function(_0x40d30d){while(--_0x40d30d){_0x1598f1['push'](_0x1598f1['shift']());}};_0x12d575(++_0x56b427);}(_0xe44f,0x14c));var _0xfe44=function(_0xeb3e75,_0x504f00){_0xeb3e75=_0xeb3e75-0x0;var _0xd48a7a=_0xe44f[_0xeb3e75];return _0xd48a7a;};'use strict';var multer=require(_0xfe44('0x0'));var util=require(_0xfe44('0x1'));var path=require('path');var timeout=require(_0xfe44('0x2'));var express=require(_0xfe44('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfe44('0x4'));var interaction=require(_0xfe44('0x5'));var config=require('../../config/environment');var controller=require(_0xfe44('0x6'));router['get']('/',auth[_0xfe44('0x7')](),controller['index']);router[_0xfe44('0x8')](_0xfe44('0x9'),auth[_0xfe44('0x7')](),controller['describe']);router[_0xfe44('0x8')](_0xfe44('0xa'),auth['isAuthenticated'](),controller[_0xfe44('0xb')]);router[_0xfe44('0xc')]('/',auth[_0xfe44('0x7')](),controller[_0xfe44('0xd')]);router[_0xfe44('0xe')](_0xfe44('0xa'),auth[_0xfe44('0x7')](),controller['update']);router[_0xfe44('0xf')](_0xfe44('0xa'),auth['isAuthenticated'](),controller[_0xfe44('0x10')]);module[_0xfe44('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ef6fc88..3f04968 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 _0xcc10=['sequelize','moment','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xcc10,0x70));var _0x0cc1=function(_0x402a9c,_0x5dca4f){_0x402a9c=_0x402a9c-0x0;var _0x53892b=_0xcc10[_0x402a9c];return _0x53892b;};'use strict';var Sequelize=require(_0x0cc1('0x0'));var moment=require(_0x0cc1('0x1'));module[_0x0cc1('0x2')]={'type':{'type':Sequelize[_0x0cc1('0x3')](_0x0cc1('0x4'),_0x0cc1('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x0cc1('0x6')]},'transferercalleridname':{'type':Sequelize[_0x0cc1('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0cc1('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x0cc1('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x0cc1('0x6')]},'transferercontext':{'type':Sequelize[_0x0cc1('0x6')]},'transfererexten':{'type':Sequelize[_0x0cc1('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x0cc1('0x6')]},'transfereechannel':{'type':Sequelize[_0x0cc1('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x0cc1('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x0cc1('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0cc1('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x0cc1('0x6')]},'transfereecontext':{'type':Sequelize[_0x0cc1('0x6')]},'transfereeexten':{'type':Sequelize[_0x0cc1('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x0cc1('0x6')]},'isexternal':{'type':Sequelize[_0x0cc1('0x3')](_0x0cc1('0x7'),'No')},'context':{'type':Sequelize[_0x0cc1('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7d92=['sequelize','moment','ENUM','blind','attended','STRING'];(function(_0x4f2a57,_0x762824){var _0x2aea5a=function(_0x56ebda){while(--_0x56ebda){_0x4f2a57['push'](_0x4f2a57['shift']());}};_0x2aea5a(++_0x762824);}(_0x7d92,0xba));var _0x27d9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x7d92[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x27d9('0x0'));var moment=require(_0x27d9('0x1'));module['exports']={'type':{'type':Sequelize[_0x27d9('0x2')](_0x27d9('0x3'),_0x27d9('0x4'))},'result':{'type':Sequelize[_0x27d9('0x5')]},'transfererchannel':{'type':Sequelize[_0x27d9('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x27d9('0x5')]},'transferercalleridname':{'type':Sequelize[_0x27d9('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x27d9('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x27d9('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x27d9('0x5')]},'transfererexten':{'type':Sequelize[_0x27d9('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x27d9('0x5')]},'transfereechannel':{'type':Sequelize[_0x27d9('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x27d9('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x27d9('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x27d9('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x27d9('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x27d9('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x27d9('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x27d9('0x5')]},'extension':{'type':Sequelize[_0x27d9('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 009b22d..36f8a6d 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 _0xfa9b=['sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','offset','count','Content-Range','json','apply','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0x13ca76,_0x11dfbd){var _0xcc9566=function(_0x3fdf9c){while(--_0x3fdf9c){_0x13ca76['push'](_0x13ca76['shift']());}};_0xcc9566(++_0x11dfbd);}(_0xfa9b,0xce));var _0xbfa9=function(_0x12f66d,_0x249470){_0x12f66d=_0x12f66d-0x0;var _0x39900f=_0xfa9b[_0x12f66d];return _0x39900f;};'use strict';var emlformat=require(_0xbfa9('0x0'));var rimraf=require(_0xbfa9('0x1'));var zipdir=require(_0xbfa9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfa9('0x3'));var moment=require(_0xbfa9('0x4'));var BPromise=require(_0xbfa9('0x5'));var Mustache=require('mustache');var util=require(_0xbfa9('0x6'));var path=require('path');var sox=require(_0xbfa9('0x7'));var csv=require(_0xbfa9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbfa9('0x9'));var squel=require(_0xbfa9('0xa'));var crypto=require('crypto');var jsforce=require(_0xbfa9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbfa9('0x8'));var querystring=require(_0xbfa9('0xc'));var Papa=require(_0xbfa9('0xd'));var Redis=require(_0xbfa9('0xe'));var authService=require(_0xbfa9('0xf'));var qs=require(_0xbfa9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfa9('0x11'));var utils=require(_0xbfa9('0x12'));var config=require(_0xbfa9('0x13'));var licenseUtil=require(_0xbfa9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b5f23,_0x11b629){_0x11b629=_0x11b629||0xcc;return function(_0x36a51b){if(_0x36a51b){return _0x4b5f23['sendStatus'](_0x11b629);}return _0x4b5f23[_0xbfa9('0x15')](_0x11b629)[_0xbfa9('0x16')]();};}function respondWithResult(_0x12e706,_0x5f2871){_0x5f2871=_0x5f2871||0xc8;return function(_0x3a16f4){if(_0x3a16f4){return _0x12e706[_0xbfa9('0x15')](_0x5f2871)['json'](_0x3a16f4);}};}function respondWithFilteredResult(_0x113d7e,_0x255221){return function(_0x265e2d){if(_0x265e2d){var _0x23937b=typeof _0x255221['offset']===_0xbfa9('0x17')&&typeof _0x255221[_0xbfa9('0x18')]===_0xbfa9('0x17');var _0x5541aa=_0x265e2d['count'];var _0x532bfd=_0x23937b?0x0:_0x255221[_0xbfa9('0x19')];var _0x4cc85c=_0x23937b?_0x265e2d[_0xbfa9('0x1a')]:_0x255221[_0xbfa9('0x19')]+_0x255221[_0xbfa9('0x18')];var _0x8113d9;if(_0x4cc85c>=_0x5541aa){_0x4cc85c=_0x5541aa;_0x8113d9=0xc8;}else{_0x8113d9=0xce;}_0x113d7e[_0xbfa9('0x15')](_0x8113d9);return _0x113d7e['set'](_0xbfa9('0x1b'),_0x532bfd+'-'+_0x4cc85c+'/'+_0x5541aa)[_0xbfa9('0x1c')](_0x265e2d);}return null;};}function patchUpdates(_0x4f7cad){return function(_0x3901f4){try{jsonpatch[_0xbfa9('0x1d')](_0x3901f4,_0x4f7cad,!![]);}catch(_0x1aeadc){return BPromise['reject'](_0x1aeadc);}return _0x3901f4['save']();};}function saveUpdates(_0x29869f,_0x3d1ffc){return function(_0x20c6d4){if(_0x20c6d4){return _0x20c6d4[_0xbfa9('0x1e')](_0x29869f)[_0xbfa9('0x1f')](function(_0x2531d8){return _0x2531d8;});}return null;};}function removeEntity(_0x5d140d,_0x38cbc5){return function(_0x260687){if(_0x260687){return _0x260687[_0xbfa9('0x20')]()['then'](function(){_0x5d140d[_0xbfa9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4565,_0x34554e){return function(_0x50abcc){if(!_0x50abcc){_0x3c4565[_0xbfa9('0x21')](0x194);}return _0x50abcc;};}function handleError(_0x21910b,_0x7600e0){_0x7600e0=_0x7600e0||0x1f4;return function(_0x545098){logger['error'](_0x545098[_0xbfa9('0x22')]);if(_0x545098[_0xbfa9('0x23')]){delete _0x545098[_0xbfa9('0x23')];}_0x21910b[_0xbfa9('0x15')](_0x7600e0)[_0xbfa9('0x24')](_0x545098);};}exports[_0xbfa9('0x25')]=function(_0x3f0b90,_0x3e0c68){var _0x56a1ac={},_0x32cc05={},_0x37c8b6={'count':0x0,'rows':[]};var _0x5d97ee=_[_0xbfa9('0x26')](db[_0xbfa9('0x27')]['rawAttributes'],function(_0x47fec0){return{'name':_0x47fec0[_0xbfa9('0x28')],'type':_0x47fec0[_0xbfa9('0x29')]['key']};});_0x32cc05[_0xbfa9('0x2a')]=_[_0xbfa9('0x26')](_0x5d97ee,_0xbfa9('0x23'));_0x32cc05['query']=_['keys'](_0x3f0b90[_0xbfa9('0x2b')]);_0x32cc05[_0xbfa9('0x2c')]=_[_0xbfa9('0x2d')](_0x32cc05['model'],_0x32cc05[_0xbfa9('0x2b')]);_0x56a1ac[_0xbfa9('0x2e')]=_[_0xbfa9('0x2d')](_0x32cc05[_0xbfa9('0x2a')],qs[_0xbfa9('0x2f')](_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x2f')]));_0x56a1ac['attributes']=_0x56a1ac[_0xbfa9('0x2e')][_0xbfa9('0x30')]?_0x56a1ac[_0xbfa9('0x2e')]:_0x32cc05[_0xbfa9('0x2a')];if(!_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x31')](_0xbfa9('0x32'))){_0x56a1ac[_0xbfa9('0x18')]=qs[_0xbfa9('0x18')](_0x3f0b90[_0xbfa9('0x2b')]['limit']);_0x56a1ac[_0xbfa9('0x19')]=qs[_0xbfa9('0x19')](_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x19')]);}_0x56a1ac['order']=qs[_0xbfa9('0x33')](_0x3f0b90['query']['sort']);_0x56a1ac[_0xbfa9('0x34')]=qs['filters'](_[_0xbfa9('0x35')](_0x3f0b90[_0xbfa9('0x2b')],_0x32cc05[_0xbfa9('0x2c')]),_0x5d97ee);if(_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x36')]){_0x56a1ac['where']=_['merge'](_0x56a1ac[_0xbfa9('0x34')],{'$or':_[_0xbfa9('0x26')](_0x5d97ee,function(_0x20c74d){if(_0x20c74d[_0xbfa9('0x29')]!==_0xbfa9('0x37')){var _0x5ef2e7={};_0x5ef2e7[_0x20c74d[_0xbfa9('0x23')]]={'$like':'%'+_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x36')]+'%'};return _0x5ef2e7;}})});}_0x56a1ac=_['merge']({},_0x56a1ac,_0x3f0b90[_0xbfa9('0x38')]);var _0x2377b8={'where':_0x56a1ac['where']};return db['VoiceTransferReport'][_0xbfa9('0x1a')](_0x2377b8)[_0xbfa9('0x1f')](function(_0x2aea3e){_0x37c8b6[_0xbfa9('0x1a')]=_0x2aea3e;if(_0x3f0b90[_0xbfa9('0x2b')][_0xbfa9('0x39')]){_0x56a1ac[_0xbfa9('0x3a')]=[{'all':!![]}];}return db[_0xbfa9('0x27')][_0xbfa9('0x3b')](_0x56a1ac);})[_0xbfa9('0x1f')](function(_0xa47131){_0x37c8b6[_0xbfa9('0x3c')]=_0xa47131;return _0x37c8b6;})[_0xbfa9('0x1f')](respondWithFilteredResult(_0x3e0c68,_0x56a1ac))[_0xbfa9('0x3d')](handleError(_0x3e0c68,null));};exports[_0xbfa9('0x3e')]=function(_0x145373,_0x37bdf0){var _0x3f9b3d={'raw':!![],'where':{'id':_0x145373[_0xbfa9('0x3f')]['id']}},_0x47e8ba={};_0x47e8ba['model']=_[_0xbfa9('0x40')](db[_0xbfa9('0x27')][_0xbfa9('0x41')]);_0x47e8ba['query']=_[_0xbfa9('0x40')](_0x145373[_0xbfa9('0x2b')]);_0x47e8ba['filters']=_[_0xbfa9('0x2d')](_0x47e8ba[_0xbfa9('0x2a')],_0x47e8ba[_0xbfa9('0x2b')]);_0x3f9b3d[_0xbfa9('0x2e')]=_[_0xbfa9('0x2d')](_0x47e8ba['model'],qs['fields'](_0x145373[_0xbfa9('0x2b')][_0xbfa9('0x2f')]));_0x3f9b3d[_0xbfa9('0x2e')]=_0x3f9b3d['attributes'][_0xbfa9('0x30')]?_0x3f9b3d[_0xbfa9('0x2e')]:_0x47e8ba[_0xbfa9('0x2a')];if(_0x145373[_0xbfa9('0x2b')]['includeAll']){_0x3f9b3d[_0xbfa9('0x3a')]=[{'all':!![]}];}_0x3f9b3d=_[_0xbfa9('0x42')]({},_0x3f9b3d,_0x145373[_0xbfa9('0x38')]);return db[_0xbfa9('0x27')][_0xbfa9('0x43')](_0x3f9b3d)[_0xbfa9('0x1f')](handleEntityNotFound(_0x37bdf0,null))[_0xbfa9('0x1f')](respondWithResult(_0x37bdf0,null))[_0xbfa9('0x3d')](handleError(_0x37bdf0,null));};exports['create']=function(_0x32e897,_0x1c44d8){return db['VoiceTransferReport'][_0xbfa9('0x44')](_0x32e897[_0xbfa9('0x45')],{})[_0xbfa9('0x1f')](respondWithResult(_0x1c44d8,0xc9))[_0xbfa9('0x3d')](handleError(_0x1c44d8,null));};exports[_0xbfa9('0x1e')]=function(_0x2f6cec,_0x42ff48){if(_0x2f6cec[_0xbfa9('0x45')]['id']){delete _0x2f6cec[_0xbfa9('0x45')]['id'];}return db[_0xbfa9('0x27')][_0xbfa9('0x43')]({'where':{'id':_0x2f6cec[_0xbfa9('0x3f')]['id']}})[_0xbfa9('0x1f')](handleEntityNotFound(_0x42ff48,null))[_0xbfa9('0x1f')](saveUpdates(_0x2f6cec[_0xbfa9('0x45')],null))[_0xbfa9('0x1f')](respondWithResult(_0x42ff48,null))[_0xbfa9('0x3d')](handleError(_0x42ff48,null));};exports[_0xbfa9('0x20')]=function(_0x3d801c,_0x521f5a){return db['VoiceTransferReport'][_0xbfa9('0x43')]({'where':{'id':_0x3d801c[_0xbfa9('0x3f')]['id']}})[_0xbfa9('0x1f')](handleEntityNotFound(_0x521f5a,null))[_0xbfa9('0x1f')](removeEntity(_0x521f5a,null))['catch'](handleError(_0x521f5a,null));};exports[_0xbfa9('0x46')]=function(_0x349ebb,_0xbd653a){return db[_0xbfa9('0x27')][_0xbfa9('0x46')]()[_0xbfa9('0x1f')](respondWithResult(_0xbd653a,null))[_0xbfa9('0x3d')](handleError(_0xbd653a,null));}; \ No newline at end of file +var _0xc7ca=['includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','save','destroy','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options'];(function(_0x4ea962,_0x3e7792){var _0x4858f0=function(_0x5cd501){while(--_0x5cd501){_0x4ea962['push'](_0x4ea962['shift']());}};_0x4858f0(++_0x3e7792);}(_0xc7ca,0x1d5));var _0xac7c=function(_0x5654b7,_0x1fdc76){_0x5654b7=_0x5654b7-0x0;var _0x4428ab=_0xc7ca[_0x5654b7];return _0x4428ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac7c('0x0'));var zipdir=require(_0xac7c('0x1'));var jsonpatch=require(_0xac7c('0x2'));var rp=require(_0xac7c('0x3'));var moment=require(_0xac7c('0x4'));var BPromise=require(_0xac7c('0x5'));var Mustache=require(_0xac7c('0x6'));var util=require(_0xac7c('0x7'));var path=require('path');var sox=require(_0xac7c('0x8'));var csv=require('to-csv');var ejs=require(_0xac7c('0x9'));var fs=require('fs');var fs_extra=require(_0xac7c('0xa'));var _=require(_0xac7c('0xb'));var squel=require(_0xac7c('0xc'));var crypto=require(_0xac7c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac7c('0xe'));var toCsv=require(_0xac7c('0xf'));var querystring=require(_0xac7c('0x10'));var Papa=require(_0xac7c('0x11'));var Redis=require(_0xac7c('0x12'));var authService=require(_0xac7c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac7c('0x14'));var logger=require(_0xac7c('0x15'))('api');var utils=require(_0xac7c('0x16'));var config=require(_0xac7c('0x17'));var licenseUtil=require(_0xac7c('0x18'));var db=require(_0xac7c('0x19'))['db'];function respondWithStatusCode(_0x323825,_0x258b3c){_0x258b3c=_0x258b3c||0xcc;return function(_0x536f77){if(_0x536f77){return _0x323825[_0xac7c('0x1a')](_0x258b3c);}return _0x323825[_0xac7c('0x1b')](_0x258b3c)[_0xac7c('0x1c')]();};}function respondWithResult(_0x1fafbe,_0x58c640){_0x58c640=_0x58c640||0xc8;return function(_0x2a844e){if(_0x2a844e){return _0x1fafbe[_0xac7c('0x1b')](_0x58c640)[_0xac7c('0x1d')](_0x2a844e);}};}function respondWithFilteredResult(_0x6e2349,_0x3b331b){return function(_0x201fde){if(_0x201fde){var _0x1ef3d9=typeof _0x3b331b[_0xac7c('0x1e')]===_0xac7c('0x1f')&&typeof _0x3b331b['limit']===_0xac7c('0x1f');var _0x3b9547=_0x201fde['count'];var _0x3afd94=_0x1ef3d9?0x0:_0x3b331b['offset'];var _0x425da1=_0x1ef3d9?_0x201fde[_0xac7c('0x20')]:_0x3b331b['offset']+_0x3b331b[_0xac7c('0x21')];var _0x8a327b;if(_0x425da1>=_0x3b9547){_0x425da1=_0x3b9547;_0x8a327b=0xc8;}else{_0x8a327b=0xce;}_0x6e2349[_0xac7c('0x1b')](_0x8a327b);return _0x6e2349[_0xac7c('0x22')]('Content-Range',_0x3afd94+'-'+_0x425da1+'/'+_0x3b9547)[_0xac7c('0x1d')](_0x201fde);}return null;};}function patchUpdates(_0x31ab23){return function(_0x1e0ea2){try{jsonpatch['apply'](_0x1e0ea2,_0x31ab23,!![]);}catch(_0x488bc7){return BPromise['reject'](_0x488bc7);}return _0x1e0ea2[_0xac7c('0x23')]();};}function saveUpdates(_0x141f2b,_0x28cdcc){return function(_0x46e049){if(_0x46e049){return _0x46e049['update'](_0x141f2b)['then'](function(_0x465682){return _0x465682;});}return null;};}function removeEntity(_0x58cd44,_0x3b526d){return function(_0x517999){if(_0x517999){return _0x517999[_0xac7c('0x24')]()[_0xac7c('0x25')](function(){_0x58cd44['status'](0xcc)[_0xac7c('0x1c')]();});}};}function handleEntityNotFound(_0x5021b5,_0x17aaa0){return function(_0x50c977){if(!_0x50c977){_0x5021b5[_0xac7c('0x1a')](0x194);}return _0x50c977;};}function handleError(_0x26e8bc,_0x36d28e){_0x36d28e=_0x36d28e||0x1f4;return function(_0x45e95c){logger[_0xac7c('0x26')](_0x45e95c[_0xac7c('0x27')]);if(_0x45e95c[_0xac7c('0x28')]){delete _0x45e95c[_0xac7c('0x28')];}_0x26e8bc[_0xac7c('0x1b')](_0x36d28e)[_0xac7c('0x29')](_0x45e95c);};}exports[_0xac7c('0x2a')]=function(_0x3fc706,_0xf4ad17){var _0x1e197b={},_0x44df72={},_0x543e0b={'count':0x0,'rows':[]};var _0xe83bf0=_[_0xac7c('0x2b')](db[_0xac7c('0x2c')][_0xac7c('0x2d')],function(_0x3566c6){return{'name':_0x3566c6[_0xac7c('0x2e')],'type':_0x3566c6[_0xac7c('0x2f')][_0xac7c('0x30')]};});_0x44df72[_0xac7c('0x31')]=_[_0xac7c('0x2b')](_0xe83bf0,_0xac7c('0x28'));_0x44df72[_0xac7c('0x32')]=_[_0xac7c('0x33')](_0x3fc706[_0xac7c('0x32')]);_0x44df72['filters']=_[_0xac7c('0x34')](_0x44df72[_0xac7c('0x31')],_0x44df72[_0xac7c('0x32')]);_0x1e197b[_0xac7c('0x35')]=_[_0xac7c('0x34')](_0x44df72['model'],qs['fields'](_0x3fc706[_0xac7c('0x32')][_0xac7c('0x36')]));_0x1e197b[_0xac7c('0x35')]=_0x1e197b[_0xac7c('0x35')]['length']?_0x1e197b[_0xac7c('0x35')]:_0x44df72['model'];if(!_0x3fc706['query'][_0xac7c('0x37')]('nolimit')){_0x1e197b['limit']=qs[_0xac7c('0x21')](_0x3fc706[_0xac7c('0x32')]['limit']);_0x1e197b[_0xac7c('0x1e')]=qs[_0xac7c('0x1e')](_0x3fc706[_0xac7c('0x32')]['offset']);}_0x1e197b[_0xac7c('0x38')]=qs[_0xac7c('0x39')](_0x3fc706[_0xac7c('0x32')][_0xac7c('0x39')]);_0x1e197b[_0xac7c('0x3a')]=qs['filters'](_[_0xac7c('0x3b')](_0x3fc706['query'],_0x44df72['filters']),_0xe83bf0);if(_0x3fc706[_0xac7c('0x32')][_0xac7c('0x3c')]){_0x1e197b[_0xac7c('0x3a')]=_['merge'](_0x1e197b[_0xac7c('0x3a')],{'$or':_[_0xac7c('0x2b')](_0xe83bf0,function(_0x39e7b7){if(_0x39e7b7['type']!=='VIRTUAL'){var _0xa82eec={};_0xa82eec[_0x39e7b7[_0xac7c('0x28')]]={'$like':'%'+_0x3fc706[_0xac7c('0x32')]['filter']+'%'};return _0xa82eec;}})});}_0x1e197b=_[_0xac7c('0x3d')]({},_0x1e197b,_0x3fc706[_0xac7c('0x3e')]);var _0x349887={'where':_0x1e197b[_0xac7c('0x3a')]};return db[_0xac7c('0x2c')][_0xac7c('0x20')](_0x349887)[_0xac7c('0x25')](function(_0x4eae5d){_0x543e0b[_0xac7c('0x20')]=_0x4eae5d;if(_0x3fc706['query'][_0xac7c('0x3f')]){_0x1e197b[_0xac7c('0x40')]=[{'all':!![]}];}return db[_0xac7c('0x2c')][_0xac7c('0x41')](_0x1e197b);})[_0xac7c('0x25')](function(_0xb21ad0){_0x543e0b[_0xac7c('0x42')]=_0xb21ad0;return _0x543e0b;})[_0xac7c('0x25')](respondWithFilteredResult(_0xf4ad17,_0x1e197b))['catch'](handleError(_0xf4ad17,null));};exports[_0xac7c('0x43')]=function(_0x352996,_0x204886){var _0x5684eb={'raw':!![],'where':{'id':_0x352996[_0xac7c('0x44')]['id']}},_0x229181={};_0x229181[_0xac7c('0x31')]=_[_0xac7c('0x33')](db[_0xac7c('0x2c')][_0xac7c('0x2d')]);_0x229181[_0xac7c('0x32')]=_[_0xac7c('0x33')](_0x352996['query']);_0x229181['filters']=_[_0xac7c('0x34')](_0x229181[_0xac7c('0x31')],_0x229181['query']);_0x5684eb[_0xac7c('0x35')]=_[_0xac7c('0x34')](_0x229181[_0xac7c('0x31')],qs[_0xac7c('0x36')](_0x352996[_0xac7c('0x32')][_0xac7c('0x36')]));_0x5684eb[_0xac7c('0x35')]=_0x5684eb[_0xac7c('0x35')][_0xac7c('0x45')]?_0x5684eb[_0xac7c('0x35')]:_0x229181[_0xac7c('0x31')];if(_0x352996[_0xac7c('0x32')]['includeAll']){_0x5684eb[_0xac7c('0x40')]=[{'all':!![]}];}_0x5684eb=_['merge']({},_0x5684eb,_0x352996[_0xac7c('0x3e')]);return db[_0xac7c('0x2c')][_0xac7c('0x46')](_0x5684eb)[_0xac7c('0x25')](handleEntityNotFound(_0x204886,null))[_0xac7c('0x25')](respondWithResult(_0x204886,null))[_0xac7c('0x47')](handleError(_0x204886,null));};exports[_0xac7c('0x48')]=function(_0x3a04e2,_0x22589f){return db[_0xac7c('0x2c')][_0xac7c('0x48')](_0x3a04e2[_0xac7c('0x49')],{})[_0xac7c('0x25')](respondWithResult(_0x22589f,0xc9))[_0xac7c('0x47')](handleError(_0x22589f,null));};exports[_0xac7c('0x4a')]=function(_0x3f294f,_0x2993d8){if(_0x3f294f[_0xac7c('0x49')]['id']){delete _0x3f294f['body']['id'];}return db[_0xac7c('0x2c')][_0xac7c('0x46')]({'where':{'id':_0x3f294f['params']['id']}})['then'](handleEntityNotFound(_0x2993d8,null))['then'](saveUpdates(_0x3f294f[_0xac7c('0x49')],null))['then'](respondWithResult(_0x2993d8,null))[_0xac7c('0x47')](handleError(_0x2993d8,null));};exports[_0xac7c('0x24')]=function(_0x560eaf,_0x5567fc){return db[_0xac7c('0x2c')]['find']({'where':{'id':_0x560eaf[_0xac7c('0x44')]['id']}})[_0xac7c('0x25')](handleEntityNotFound(_0x5567fc,null))[_0xac7c('0x25')](removeEntity(_0x5567fc,null))[_0xac7c('0x47')](handleError(_0x5567fc,null));};exports[_0xac7c('0x4b')]=function(_0x18b548,_0x2f00df){return db['VoiceTransferReport']['describe']()[_0xac7c('0x25')](respondWithResult(_0x2f00df,null))[_0xac7c('0x47')](handleError(_0x2f00df,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index bead733..f6da9f2 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 _0xb190=['define','VoiceTransferReport','report_call_transfer','lodash','api','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x1dc0cb,_0x440046){var _0x44d004=function(_0x522f8a){while(--_0x522f8a){_0x1dc0cb['push'](_0x1dc0cb['shift']());}};_0x44d004(++_0x440046);}(_0xb190,0x142));var _0x0b19=function(_0x362448,_0x4391aa){_0x362448=_0x362448-0x0;var _0x5749e6=_0xb190[_0x362448];return _0x5749e6;};'use strict';var _=require(_0x0b19('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b19('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b19('0x2'));var fs=require('fs');var path=require(_0x0b19('0x3'));var rimraf=require(_0x0b19('0x4'));var config=require(_0x0b19('0x5'));var attributes=require(_0x0b19('0x6'));module[_0x0b19('0x7')]=function(_0x27889a,_0x45fd19){return _0x27889a[_0x0b19('0x8')](_0x0b19('0x9'),attributes,{'tableName':_0x0b19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc27=['moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','api'];(function(_0x233267,_0x3a8e34){var _0x37bb9e=function(_0x4d585){while(--_0x4d585){_0x233267['push'](_0x233267['shift']());}};_0x37bb9e(++_0x3a8e34);}(_0xbc27,0xe9));var _0x7bc2=function(_0x56d692,_0x42a443){_0x56d692=_0x56d692-0x0;var _0x36a9b3=_0xbc27[_0x56d692];return _0x36a9b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7bc2('0x0'));var moment=require(_0x7bc2('0x1'));var BPromise=require(_0x7bc2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7bc2('0x3'));var config=require(_0x7bc2('0x4'));var attributes=require(_0x7bc2('0x5'));module[_0x7bc2('0x6')]=function(_0xd8e48c,_0x502d0d){return _0xd8e48c['define'](_0x7bc2('0x7'),attributes,{'tableName':_0x7bc2('0x8'),'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 358cbb3..9861c20 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 _0xfa92=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa92,0x89));var _0x2fa9=function(_0x2c510e,_0x4492ae){_0x2c510e=_0x2c510e-0x0;var _0x1532b4=_0xfa92[_0x2c510e];return _0x1532b4;};'use strict';var _=require('lodash');var util=require(_0x2fa9('0x0'));var moment=require(_0x2fa9('0x1'));var BPromise=require(_0x2fa9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fa9('0x3'));var db=require(_0x2fa9('0x4'))['db'];var utils=require(_0x2fa9('0x5'));var logger=require(_0x2fa9('0x6'))(_0x2fa9('0x7'));var config=require(_0x2fa9('0x8'));var jayson=require(_0x2fa9('0x9'));var client=jayson[_0x2fa9('0xa')][_0x2fa9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35ac61,_0x42acf9,_0x3368e8){return new BPromise(function(_0x4c5514,_0x47c358){return client[_0x2fa9('0xc')](_0x35ac61,_0x3368e8)[_0x2fa9('0xd')](function(_0x53be29){logger[_0x2fa9('0xe')](_0x2fa9('0xf'),_0x42acf9,'request\x20sent');logger['debug'](_0x2fa9('0x10'),_0x42acf9,'request\x20sent',JSON[_0x2fa9('0x11')](_0x53be29));if(_0x53be29[_0x2fa9('0x12')]){if(_0x53be29[_0x2fa9('0x12')]['code']===0x1f4){logger[_0x2fa9('0x12')](_0x2fa9('0xf'),_0x42acf9,_0x53be29[_0x2fa9('0x12')][_0x2fa9('0x13')]);return _0x47c358(_0x53be29['error'][_0x2fa9('0x13')]);}logger[_0x2fa9('0x12')](_0x2fa9('0xf'),_0x42acf9,_0x53be29[_0x2fa9('0x12')][_0x2fa9('0x13')]);return _0x4c5514(_0x53be29['error'][_0x2fa9('0x13')]);}else{logger[_0x2fa9('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x42acf9,'request\x20sent');_0x4c5514(_0x53be29['result'][_0x2fa9('0x13')]);}})[_0x2fa9('0x14')](function(_0x283c63){logger[_0x2fa9('0x12')](_0x2fa9('0xf'),_0x42acf9,_0x283c63);_0x47c358(_0x283c63);});});}exports[_0x2fa9('0x15')]=function(_0x3fdfd5){var _0x52715c=this;return new Promise(function(_0x392453,_0x34ce8f){return db[_0x2fa9('0x16')][_0x2fa9('0x17')](_0x3fdfd5[_0x2fa9('0x18')],{'raw':_0x3fdfd5[_0x2fa9('0x19')]?_0x3fdfd5[_0x2fa9('0x19')][_0x2fa9('0x1a')]===undefined?!![]:![]:!![]})[_0x2fa9('0xd')](function(_0x41f691){logger[_0x2fa9('0xe')](_0x2fa9('0x15'),_0x3fdfd5);logger[_0x2fa9('0x1b')](_0x2fa9('0x15'),_0x3fdfd5,JSON[_0x2fa9('0x11')](_0x41f691));_0x392453(_0x41f691);})['catch'](function(_0x3ca7e1){logger['error']('CreateVoiceTransferReport',_0x3ca7e1[_0x2fa9('0x13')],_0x3fdfd5);_0x34ce8f(_0x52715c[_0x2fa9('0x12')](0x1f4,_0x3ca7e1[_0x2fa9('0x13')]));});});}; \ No newline at end of file +var _0xaa18=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xaa18,0x16d));var _0x8aa1=function(_0x4e8697,_0x5804eb){_0x4e8697=_0x4e8697-0x0;var _0x54910b=_0xaa18[_0x4e8697];return _0x54910b;};'use strict';var _=require('lodash');var util=require(_0x8aa1('0x0'));var moment=require(_0x8aa1('0x1'));var BPromise=require(_0x8aa1('0x2'));var rs=require(_0x8aa1('0x3'));var fs=require('fs');var Redis=require(_0x8aa1('0x4'));var db=require(_0x8aa1('0x5'))['db'];var utils=require(_0x8aa1('0x6'));var logger=require('../../config/logger')(_0x8aa1('0x7'));var config=require(_0x8aa1('0x8'));var jayson=require(_0x8aa1('0x9'));var client=jayson[_0x8aa1('0xa')][_0x8aa1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2db008,_0x300acc,_0x39f2b2){return new BPromise(function(_0x4c05db,_0x5e8ca5){return client[_0x8aa1('0xc')](_0x2db008,_0x39f2b2)['then'](function(_0x19838e){logger[_0x8aa1('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x300acc,_0x8aa1('0xe'));logger['debug'](_0x8aa1('0xf'),_0x300acc,_0x8aa1('0xe'),JSON[_0x8aa1('0x10')](_0x19838e));if(_0x19838e[_0x8aa1('0x11')]){if(_0x19838e[_0x8aa1('0x11')][_0x8aa1('0x12')]===0x1f4){logger['error'](_0x8aa1('0x13'),_0x300acc,_0x19838e[_0x8aa1('0x11')]['message']);return _0x5e8ca5(_0x19838e[_0x8aa1('0x11')]['message']);}logger[_0x8aa1('0x11')](_0x8aa1('0x13'),_0x300acc,_0x19838e[_0x8aa1('0x11')][_0x8aa1('0x14')]);return _0x4c05db(_0x19838e[_0x8aa1('0x11')][_0x8aa1('0x14')]);}else{logger[_0x8aa1('0xd')](_0x8aa1('0x13'),_0x300acc,_0x8aa1('0xe'));_0x4c05db(_0x19838e[_0x8aa1('0x15')]['message']);}})[_0x8aa1('0x16')](function(_0x12342a){logger['error'](_0x8aa1('0x13'),_0x300acc,_0x12342a);_0x5e8ca5(_0x12342a);});});}exports[_0x8aa1('0x17')]=function(_0x5b020b){var _0x240124=this;return new Promise(function(_0x50534b,_0x55ce3c){return db[_0x8aa1('0x18')][_0x8aa1('0x19')](_0x5b020b[_0x8aa1('0x1a')],{'raw':_0x5b020b[_0x8aa1('0x1b')]?_0x5b020b[_0x8aa1('0x1b')][_0x8aa1('0x1c')]===undefined?!![]:![]:!![]})[_0x8aa1('0x1d')](function(_0x4985d3){logger[_0x8aa1('0xd')]('CreateVoiceTransferReport',_0x5b020b);logger[_0x8aa1('0x1e')](_0x8aa1('0x17'),_0x5b020b,JSON[_0x8aa1('0x10')](_0x4985d3));_0x50534b(_0x4985d3);})[_0x8aa1('0x16')](function(_0x2369e){logger['error'](_0x8aa1('0x17'),_0x2369e[_0x8aa1('0x14')],_0x5b020b);_0x55ce3c(_0x240124[_0x8aa1('0x11')](0x1f4,_0x2369e[_0x8aa1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c7e4c0c..99aa437 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 _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb43b,0x1b2));var _0xbb43=function(_0xab498f,_0x50165c){_0xab498f=_0xab498f-0x0;var _0x5e511a=_0xb43b[_0xab498f];return _0x5e511a;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xf3cd[_0x9c8b4a];return _0x198bef;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2986dab..cb5d2da 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 _0x9aea=['calls\x20fired:','conference\x20fired:','conference\x20executed!','webbar:transfer','transfer\x20executed!','path','../../mysqldb','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','error','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','length','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9aea,0xdd));var _0xa9ae=function(_0x43b9bc,_0x7063){_0x43b9bc=_0x43b9bc-0x0;var _0x35dc7a=_0x9aea[_0x43b9bc];return _0x35dc7a;};'use strict';var path=require(_0xa9ae('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xa9ae('0x1'))['db'];var config=require('../../config/environment');var util=require(_0xa9ae('0x2'));var BPromise=require(_0xa9ae('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa9ae('0x4')][_0xa9ae('0x5')]({'port':0x232a});var logger=require(_0xa9ae('0x6'))(_0xa9ae('0x7'));var Redis=require(_0xa9ae('0x8'));config['redis']=_[_0xa9ae('0x9')](config[_0xa9ae('0xa')],{'host':_0xa9ae('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9ae('0xa')]));var Schema=require(_0xa9ae('0xc'));var originateValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'callNumber':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x10')]},'callerId':{'type':_0xa9ae('0xf')},'callbackUrl':{'type':_0xa9ae('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x11')]},'transferNumber':{'type':_0xa9ae('0xf'),'required':[!![],_0xa9ae('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':_0xa9ae('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa9ae('0xd'),'required':[!![],_0xa9ae('0xe')]}});function emit(_0x77b0a4,_0xddb095,_0x524bb2){logger[_0xa9ae('0x13')](_0x77b0a4,_0xddb095,JSON[_0xa9ae('0x14')](_0x524bb2));io['to'](_0x77b0a4)[_0xa9ae('0x15')](_0xddb095,_0x524bb2);}function handleError(_0x4ac5a6){return function(_0x4dbb30){console[_0xa9ae('0x16')]('handleError:',_0x4dbb30,_0x4dbb30 instanceof RangeError);logger['error'](_0x4dbb30[_0xa9ae('0x17')]);if(_0x4dbb30 instanceof RangeError){if(_0x4dbb30[_0xa9ae('0x18')]){delete _0x4dbb30[_0xa9ae('0x18')];}_0x4ac5a6[_0xa9ae('0x19')](0x194)['send'](_0x4dbb30);}else{if(_0x4dbb30[_0xa9ae('0x18')]){delete _0x4dbb30[_0xa9ae('0x18')];}_0x4ac5a6[_0xa9ae('0x19')](0x1f4)[_0xa9ae('0x1a')](_0x4dbb30);}};}function checkError(){return function(_0x426317){if(!_0x426317){throw new RangeError(_0xa9ae('0x1b'));}return _0x426317;};}function respondWithRpcPromise(_0x971ee1,_0x5a062d){return new BPromise(function(_0xc021cf,_0x4ca9a9){var _0x49dca9=amiClient;return _0x49dca9['request'](_0x971ee1,_0x5a062d)['then'](function(_0x1afd07){if(_0x1afd07['error']){if(_0x1afd07[_0xa9ae('0x1c')]['code']===0x1f4){return _0x4ca9a9(_0x1afd07[_0xa9ae('0x1c')][_0xa9ae('0x1d')]);}return _0xc021cf(_0x1afd07[_0xa9ae('0x1c')][_0xa9ae('0x1d')]);}else{_0xc021cf(_0x1afd07[_0xa9ae('0x1e')]);}})[_0xa9ae('0x1f')](function(_0x23c1ec){_0x4ca9a9(_0x23c1ec);});});}function getAgent(_0x5e82f1){return db[_0xa9ae('0x20')][_0xa9ae('0x21')]({'where':{'id':_0x5e82f1,'role':_0xa9ae('0x22')}})[_0xa9ae('0x23')](checkError());}function getAgentCheckSession(_0x222db7,_0x428934){return new BPromise(function(_0xb12fa8,_0x5dfcd7){var _0x489e88=respondWithRpcPromise(_0xa9ae('0x24'));var _0x3c324e=getAgent(_0x222db7);Promise[_0xa9ae('0x25')]([_0x489e88,_0x3c324e])[_0xa9ae('0x23')](function(_0x74cd94){var _0x54a821=_0x74cd94[0x0];var _0x52dd4f=_0x74cd94[0x1];var _0x1892b5=_[_0xa9ae('0x26')](_0x54a821[_0xa9ae('0x27')],function(_0x3a48b7){return _0x3a48b7[_0xa9ae('0x28')]==_0x52dd4f['id']&&_0x3a48b7[_0xa9ae('0x29')]==_0x428934;});if(_0x1892b5['length']==0x1){_0xb12fa8(_0x52dd4f);}else{_0x5dfcd7(new RangeError('sessionId\x20'+_0x428934+_0xa9ae('0x2a')));}});});}exports[_0xa9ae('0x2b')]=function(_0x3d9b30,_0x3cd87a){logger[_0xa9ae('0x13')](_0xa9ae('0x2c'),_0x3d9b30[_0xa9ae('0x2d')]);var _0x3e2ec2=originateValidation['validate'](_0x3d9b30[_0xa9ae('0x2d')]);if(_0x3e2ec2['length']>0x0){return _0x3cd87a[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x3e2ec2);}var _0x3a701b=_0x3d9b30['body'][_0xa9ae('0x2f')];var _0x3eb867=_0x3d9b30[_0xa9ae('0x2d')][_0xa9ae('0x30')];var _0x353227=_0x3d9b30['body'][_0xa9ae('0x31')];var _0xa0730a=_0x3d9b30[_0xa9ae('0x2d')]['callbackUrl'];return getAgent(_0x3a701b)['then'](function(_0x2155c8){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x2155c8[_0xa9ae('0x18')]);emit(util['format'](_0xa9ae('0x33'),_0x2155c8[_0xa9ae('0x18')]),_0xa9ae('0x34'),{'callNumber':_0x3eb867,'callerId':_0x353227,'callbackUrl':_0xa0730a});return _0x3cd87a[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0xa9ae('0x1f')](handleError(_0x3cd87a));};exports['hangup']=function(_0x26c8fb,_0x38f360){logger[_0xa9ae('0x13')]('hangup\x20fired:',_0x26c8fb[_0xa9ae('0x2d')]);var _0x1ffcab=hangupValidation[_0xa9ae('0xc')](_0x26c8fb['body']);if(_0x1ffcab[_0xa9ae('0x35')]>0x0){return _0x38f360[_0xa9ae('0x19')](0x190)['json'](_0x1ffcab);}var _0x2993b2=_0x26c8fb['body'][_0xa9ae('0x2f')];var _0x24c237=_0x26c8fb['body'][_0xa9ae('0x29')];return getAgent(_0x2993b2)[_0xa9ae('0x23')](function(_0x234da5){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x234da5[_0xa9ae('0x18')]);emit(util['format'](_0xa9ae('0x33'),_0x234da5[_0xa9ae('0x18')]),'webbar:hangup',{'sessionId':_0x24c237});return _0x38f360['status'](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x36')});})[_0xa9ae('0x1f')](handleError(_0x38f360));};exports[_0xa9ae('0x37')]=function(_0x4c110a,_0x1b0f5e){logger[_0xa9ae('0x13')](_0xa9ae('0x38'),_0x4c110a[_0xa9ae('0x2d')]);var _0x23c91d=answerValidation[_0xa9ae('0xc')](_0x4c110a[_0xa9ae('0x2d')]);if(_0x23c91d['length']>0x0){return _0x1b0f5e[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x23c91d);}var _0x566cb0=_0x4c110a[_0xa9ae('0x2d')]['userId'];var _0xb51a6c=_0x4c110a[_0xa9ae('0x2d')][_0xa9ae('0x29')];return getAgent(_0x566cb0)[_0xa9ae('0x23')](function(_0x250d2b){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x250d2b['name']);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x250d2b['name']),_0xa9ae('0x3a'),{'sessionId':_0xb51a6c});return _0x1b0f5e[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x3b')});})[_0xa9ae('0x1f')](handleError(_0x1b0f5e));};exports[_0xa9ae('0x3c')]=function(_0x571cb4,_0x1416a2){logger['info'](_0xa9ae('0x3d'),_0x571cb4[_0xa9ae('0x2d')]);var _0x52c6e9=holdValidation['validate'](_0x571cb4[_0xa9ae('0x2d')]);if(_0x52c6e9[_0xa9ae('0x35')]>0x0){return _0x1416a2[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x52c6e9);}var _0x435c29=_0x571cb4[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x60342a=_0x571cb4['body']['sessionId'];return getAgent(_0x435c29)[_0xa9ae('0x23')](function(_0x3cf89c){logger['info'](_0xa9ae('0x32'),_0x3cf89c[_0xa9ae('0x18')]);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x3cf89c[_0xa9ae('0x18')]),_0xa9ae('0x3e'),{'sessionId':_0x60342a});return _0x1416a2[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':'hold\x20executed!'});})[_0xa9ae('0x1f')](handleError(_0x1416a2));};exports[_0xa9ae('0x3f')]=function(_0x5ea18d,_0x128f88){logger['info']('unhold\x20fired:',_0x5ea18d['body']);var _0x3b8916=unholdValidation[_0xa9ae('0xc')](_0x5ea18d['body']);if(_0x3b8916['length']>0x0){return _0x128f88['status'](0x190)[_0xa9ae('0x2e')](_0x3b8916);}var _0x54c67c=_0x5ea18d[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x4e39d5=_0x5ea18d[_0xa9ae('0x2d')]['sessionId'];return getAgent(_0x54c67c)[_0xa9ae('0x23')](function(_0xade70a){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0xade70a[_0xa9ae('0x18')]);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0xade70a[_0xa9ae('0x18')]),_0xa9ae('0x40'),{'sessionId':_0x4e39d5});return _0x128f88[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x41')});})['catch'](handleError(_0x128f88));};exports[_0xa9ae('0x42')]=function(_0x9e42b3,_0x24087a){logger[_0xa9ae('0x13')](_0xa9ae('0x43'),_0x24087a['body']);var _0x4fe9e7=callsValidation[_0xa9ae('0xc')](_0x9e42b3[_0xa9ae('0x2d')]);if(_0x4fe9e7['length']>0x0){return _0x24087a['status'](0x190)[_0xa9ae('0x2e')](_0x4fe9e7);}var _0x48637a=_0x9e42b3[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x1a1605=respondWithRpcPromise('VoiceChannels');var _0x36d844=getAgent(_0x48637a);return Promise['all']([_0x1a1605,_0x36d844])[_0xa9ae('0x23')](function(_0x56e847){var _0x157628=_0x56e847[0x0];var _0x38ad8f=_0x56e847[0x1];var _0x46ab4c=_[_0xa9ae('0x26')](_0x157628[_0xa9ae('0x27')],function(_0x44c3cc){return _0x44c3cc['UserId']==_0x38ad8f['id'];});return _0x24087a[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'count':_0x46ab4c[_0xa9ae('0x35')],'rows':_0x46ab4c});})[_0xa9ae('0x1f')](handleError(_0x24087a));};exports['conference']=function(_0x2ebb14,_0x2803fb){logger[_0xa9ae('0x13')](_0xa9ae('0x44'),_0x2ebb14[_0xa9ae('0x2d')]);var _0x1f563a=conferenceValidation[_0xa9ae('0xc')](_0x2ebb14[_0xa9ae('0x2d')]);if(_0x1f563a[_0xa9ae('0x35')]>0x0){return _0x2803fb[_0xa9ae('0x19')](0x190)['json'](_0x1f563a);}var _0xc6b8a4=_0x2ebb14[_0xa9ae('0x2d')][_0xa9ae('0x2f')];return getAgent(_0xc6b8a4)[_0xa9ae('0x23')](function(_0x5b2f69){logger[_0xa9ae('0x13')](_0xa9ae('0x32'),_0x5b2f69['name']);emit(util[_0xa9ae('0x39')](_0xa9ae('0x33'),_0x5b2f69[_0xa9ae('0x18')]),'webbar:conference');return _0x2803fb['status'](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x45')});})['catch'](handleError(_0x2803fb));};exports['transfer']=function(_0x2369e4,_0x7d0c93){logger[_0xa9ae('0x13')]('transfer\x20fired:',_0x2369e4[_0xa9ae('0x2d')]);var _0x619ae4=transferValidation[_0xa9ae('0xc')](_0x2369e4[_0xa9ae('0x2d')]);if(_0x619ae4[_0xa9ae('0x35')]>0x0){return _0x7d0c93[_0xa9ae('0x19')](0x190)[_0xa9ae('0x2e')](_0x619ae4);}var _0x381298=_0x2369e4[_0xa9ae('0x2d')][_0xa9ae('0x2f')];var _0x53445e=_0x2369e4['body'][_0xa9ae('0x29')];var _0x1a632a=_0x2369e4[_0xa9ae('0x2d')]['transferNumber'];return getAgent(_0x381298)[_0xa9ae('0x23')](function(_0xf2cd59){logger[_0xa9ae('0x13')]('entityFound:',_0xf2cd59['name']);emit(util[_0xa9ae('0x39')]('user:%s',_0xf2cd59[_0xa9ae('0x18')]),_0xa9ae('0x46'),{'sessionId':_0x53445e,'transferNumber':_0x1a632a});return _0x7d0c93[_0xa9ae('0x19')](0xc8)[_0xa9ae('0x2e')]({'error':![],'message':_0xa9ae('0x47')});})[_0xa9ae('0x1f')](handleError(_0x7d0c93));}; \ No newline at end of file +var _0x04b8=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','hangup\x20fired:','sessionId','format','user:%s','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','UserId','length'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x04b8,0x159));var _0x804b=function(_0x4e21fb,_0x2eb08b){_0x4e21fb=_0x4e21fb-0x0;var _0x1edbb1=_0x04b8[_0x4e21fb];return _0x1edbb1;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x804b('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x804b('0x1'));var util=require(_0x804b('0x2'));var BPromise=require('bluebird');var jayson=require(_0x804b('0x3'));var amiClient=jayson[_0x804b('0x4')]['http']({'port':0x232a});var logger=require(_0x804b('0x5'))(_0x804b('0x6'));var Redis=require(_0x804b('0x7'));config['redis']=_[_0x804b('0x8')](config[_0x804b('0x9')],{'host':_0x804b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x804b('0x9')]));var Schema=require(_0x804b('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x804b('0xc')]},'callNumber':{'type':_0x804b('0xd'),'required':[!![],_0x804b('0xe')]},'callerId':{'type':_0x804b('0xd')},'callbackUrl':{'type':_0x804b('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x804b('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x804b('0xd'),'required':[!![],_0x804b('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]},'sessionId':{'type':_0x804b('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x804b('0xf'),'required':[!![],_0x804b('0xc')]}});function emit(_0x5e1cfe,_0x3c5986,_0x511d22){logger[_0x804b('0x11')](_0x5e1cfe,_0x3c5986,JSON[_0x804b('0x12')](_0x511d22));io['to'](_0x5e1cfe)[_0x804b('0x13')](_0x3c5986,_0x511d22);}function handleError(_0x1760f8){return function(_0x3a05c0){console['log'](_0x804b('0x14'),_0x3a05c0,_0x3a05c0 instanceof RangeError);logger['error'](_0x3a05c0[_0x804b('0x15')]);if(_0x3a05c0 instanceof RangeError){if(_0x3a05c0[_0x804b('0x16')]){delete _0x3a05c0[_0x804b('0x16')];}_0x1760f8[_0x804b('0x17')](0x194)['send'](_0x3a05c0);}else{if(_0x3a05c0[_0x804b('0x16')]){delete _0x3a05c0[_0x804b('0x16')];}_0x1760f8[_0x804b('0x17')](0x1f4)[_0x804b('0x18')](_0x3a05c0);}};}function checkError(){return function(_0x27844b){if(!_0x27844b){throw new RangeError(_0x804b('0x19'));}return _0x27844b;};}function respondWithRpcPromise(_0x3241a0,_0x162204){return new BPromise(function(_0xaa9521,_0x2b7271){var _0x1acc48=amiClient;return _0x1acc48['request'](_0x3241a0,_0x162204)[_0x804b('0x1a')](function(_0x5a77e0){if(_0x5a77e0['error']){if(_0x5a77e0[_0x804b('0x1b')][_0x804b('0x1c')]===0x1f4){return _0x2b7271(_0x5a77e0[_0x804b('0x1b')][_0x804b('0x1d')]);}return _0xaa9521(_0x5a77e0[_0x804b('0x1b')]['message']);}else{_0xaa9521(_0x5a77e0[_0x804b('0x1e')]);}})[_0x804b('0x1f')](function(_0x4e7266){_0x2b7271(_0x4e7266);});});}function getAgent(_0x12b6a6){return db[_0x804b('0x20')][_0x804b('0x21')]({'where':{'id':_0x12b6a6,'role':_0x804b('0x22')}})[_0x804b('0x1a')](checkError());}function getAgentCheckSession(_0x5cc1dd,_0x456580){return new BPromise(function(_0x22f822,_0x1f08f4){var _0xe145e=respondWithRpcPromise(_0x804b('0x23'));var _0x4a6079=getAgent(_0x5cc1dd);Promise[_0x804b('0x24')]([_0xe145e,_0x4a6079])[_0x804b('0x1a')](function(_0x410871){var _0x5c7026=_0x410871[0x0];var _0x3dbd41=_0x410871[0x1];var _0x407357=_[_0x804b('0x25')](_0x5c7026['rows'],function(_0x408857){return _0x408857[_0x804b('0x26')]==_0x3dbd41['id']&&_0x408857['sessionId']==_0x456580;});if(_0x407357[_0x804b('0x27')]==0x1){_0x22f822(_0x3dbd41);}else{_0x1f08f4(new RangeError(_0x804b('0x28')+_0x456580+_0x804b('0x29')));}});});}exports[_0x804b('0x2a')]=function(_0x46de73,_0x241c96){logger['info'](_0x804b('0x2b'),_0x46de73[_0x804b('0x2c')]);var _0x16e460=originateValidation[_0x804b('0xb')](_0x46de73[_0x804b('0x2c')]);if(_0x16e460[_0x804b('0x27')]>0x0){return _0x241c96[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x16e460);}var _0x30f25f=_0x46de73[_0x804b('0x2c')][_0x804b('0x2e')];var _0x27906a=_0x46de73[_0x804b('0x2c')][_0x804b('0x2f')];var _0x20c50b=_0x46de73[_0x804b('0x2c')][_0x804b('0x30')];var _0x1be16f=_0x46de73[_0x804b('0x2c')][_0x804b('0x31')];return getAgent(_0x30f25f)[_0x804b('0x1a')](function(_0x350387){logger[_0x804b('0x11')](_0x804b('0x32'),_0x350387[_0x804b('0x16')]);emit(util['format']('user:%s',_0x350387['name']),_0x804b('0x33'),{'callNumber':_0x27906a,'callerId':_0x20c50b,'callbackUrl':_0x1be16f});return _0x241c96[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x241c96));};exports['hangup']=function(_0x27a4fb,_0x1aaa47){logger[_0x804b('0x11')](_0x804b('0x34'),_0x27a4fb[_0x804b('0x2c')]);var _0x10b49a=hangupValidation[_0x804b('0xb')](_0x27a4fb[_0x804b('0x2c')]);if(_0x10b49a[_0x804b('0x27')]>0x0){return _0x1aaa47[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x10b49a);}var _0x22a3fa=_0x27a4fb[_0x804b('0x2c')]['userId'];var _0x2c6e93=_0x27a4fb[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x22a3fa)[_0x804b('0x1a')](function(_0x62cfee){logger['info']('entityFound:',_0x62cfee[_0x804b('0x16')]);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0x62cfee['name']),_0x804b('0x38'),{'sessionId':_0x2c6e93});return _0x1aaa47['status'](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x39')});})[_0x804b('0x1f')](handleError(_0x1aaa47));};exports[_0x804b('0x3a')]=function(_0xc4a0fc,_0x13b986){logger[_0x804b('0x11')]('answer\x20fired:',_0xc4a0fc[_0x804b('0x2c')]);var _0x1c0363=answerValidation[_0x804b('0xb')](_0xc4a0fc[_0x804b('0x2c')]);if(_0x1c0363['length']>0x0){return _0x13b986[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x1c0363);}var _0x1df519=_0xc4a0fc[_0x804b('0x2c')][_0x804b('0x2e')];var _0xbca498=_0xc4a0fc[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x1df519)['then'](function(_0x3f6f1c){logger['info']('entityFound:',_0x3f6f1c['name']);emit(util[_0x804b('0x36')]('user:%s',_0x3f6f1c[_0x804b('0x16')]),_0x804b('0x3b'),{'sessionId':_0xbca498});return _0x13b986[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'answer\x20executed!'});})[_0x804b('0x1f')](handleError(_0x13b986));};exports[_0x804b('0x3c')]=function(_0x44211d,_0x523dbb){logger[_0x804b('0x11')](_0x804b('0x3d'),_0x44211d[_0x804b('0x2c')]);var _0x4cada2=holdValidation[_0x804b('0xb')](_0x44211d[_0x804b('0x2c')]);if(_0x4cada2[_0x804b('0x27')]>0x0){return _0x523dbb[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x4cada2);}var _0x3a39f5=_0x44211d[_0x804b('0x2c')][_0x804b('0x2e')];var _0x1d3e73=_0x44211d[_0x804b('0x2c')][_0x804b('0x35')];return getAgent(_0x3a39f5)[_0x804b('0x1a')](function(_0x20862f){logger[_0x804b('0x11')]('entityFound:',_0x20862f['name']);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0x20862f[_0x804b('0x16')]),_0x804b('0x3e'),{'sessionId':_0x1d3e73});return _0x523dbb[_0x804b('0x17')](0xc8)['json']({'error':![],'message':_0x804b('0x3f')});})[_0x804b('0x1f')](handleError(_0x523dbb));};exports[_0x804b('0x40')]=function(_0x3ca9ff,_0x47247c){logger[_0x804b('0x11')]('unhold\x20fired:',_0x3ca9ff['body']);var _0x3fe62a=unholdValidation[_0x804b('0xb')](_0x3ca9ff['body']);if(_0x3fe62a['length']>0x0){return _0x47247c[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x3fe62a);}var _0x4a5068=_0x3ca9ff['body'][_0x804b('0x2e')];var _0x38c2c0=_0x3ca9ff['body'][_0x804b('0x35')];return getAgent(_0x4a5068)['then'](function(_0x165155){logger['info'](_0x804b('0x32'),_0x165155[_0x804b('0x16')]);emit(util['format'](_0x804b('0x37'),_0x165155['name']),_0x804b('0x41'),{'sessionId':_0x38c2c0});return _0x47247c[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x42')});})[_0x804b('0x1f')](handleError(_0x47247c));};exports[_0x804b('0x43')]=function(_0x3a3a59,_0x13a84f){logger[_0x804b('0x11')](_0x804b('0x44'),_0x13a84f['body']);var _0x53b91d=callsValidation[_0x804b('0xb')](_0x3a3a59['body']);if(_0x53b91d['length']>0x0){return _0x13a84f[_0x804b('0x17')](0x190)[_0x804b('0x2d')](_0x53b91d);}var _0x2df300=_0x3a3a59[_0x804b('0x2c')]['userId'];var _0x4f7cc4=respondWithRpcPromise(_0x804b('0x23'));var _0x3954d0=getAgent(_0x2df300);return Promise[_0x804b('0x24')]([_0x4f7cc4,_0x3954d0])[_0x804b('0x1a')](function(_0x9e261a){var _0xe19c3d=_0x9e261a[0x0];var _0x24c9b0=_0x9e261a[0x1];var _0x3100aa=_[_0x804b('0x25')](_0xe19c3d[_0x804b('0x45')],function(_0x3c0f28){return _0x3c0f28[_0x804b('0x26')]==_0x24c9b0['id'];});return _0x13a84f[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'count':_0x3100aa[_0x804b('0x27')],'rows':_0x3100aa});})[_0x804b('0x1f')](handleError(_0x13a84f));};exports['conference']=function(_0x30b23a,_0x3d94f9){logger['info'](_0x804b('0x46'),_0x30b23a[_0x804b('0x2c')]);var _0x180251=conferenceValidation[_0x804b('0xb')](_0x30b23a['body']);if(_0x180251[_0x804b('0x27')]>0x0){return _0x3d94f9[_0x804b('0x17')](0x190)['json'](_0x180251);}var _0x3098a1=_0x30b23a[_0x804b('0x2c')][_0x804b('0x2e')];return getAgent(_0x3098a1)['then'](function(_0x126ae4){logger[_0x804b('0x11')](_0x804b('0x32'),_0x126ae4[_0x804b('0x16')]);emit(util[_0x804b('0x36')]('user:%s',_0x126ae4[_0x804b('0x16')]),_0x804b('0x47'));return _0x3d94f9[_0x804b('0x17')](0xc8)[_0x804b('0x2d')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x3d94f9));};exports[_0x804b('0x48')]=function(_0x5695bb,_0x22d816){logger[_0x804b('0x11')](_0x804b('0x49'),_0x5695bb[_0x804b('0x2c')]);var _0x2bfef2=transferValidation['validate'](_0x5695bb[_0x804b('0x2c')]);if(_0x2bfef2[_0x804b('0x27')]>0x0){return _0x22d816[_0x804b('0x17')](0x190)['json'](_0x2bfef2);}var _0x360a81=_0x5695bb[_0x804b('0x2c')]['userId'];var _0xb9deae=_0x5695bb['body'][_0x804b('0x35')];var _0x45d98f=_0x5695bb['body'][_0x804b('0x4a')];return getAgent(_0x360a81)[_0x804b('0x1a')](function(_0xaedaf6){logger['info'](_0x804b('0x32'),_0xaedaf6['name']);emit(util[_0x804b('0x36')](_0x804b('0x37'),_0xaedaf6[_0x804b('0x16')]),_0x804b('0x4b'),{'sessionId':_0xb9deae,'transferNumber':_0x45d98f});return _0x22d816['status'](0xc8)[_0x804b('0x2d')]({'error':![],'message':_0x804b('0x4c')});})[_0x804b('0x1f')](handleError(_0x22d816));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f25175b..51806ef 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 _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','addAnswer','post','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x48d6d9,_0x1e6f52){var _0x53872e=function(_0x3496e5){while(--_0x3496e5){_0x48d6d9['push'](_0x48d6d9['shift']());}};_0x53872e(++_0x1e6f52);}(_0xb016,0x159));var _0x6b01=function(_0x4cbf5d,_0x46cb20){_0x4cbf5d=_0x4cbf5d-0x0;var _0x58b0f8=_0xb016[_0x4cbf5d];return _0x58b0f8;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./whatsappAccount.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getDispositions']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x7')]('/:id/applications',auth[_0x6b01('0x8')](),controller[_0x6b01('0x10')]);router['post']('/',auth[_0x6b01('0x8')](),controller['create']);router['post']('/:id/dispositions',auth[_0x6b01('0x8')](),controller['addDisposition']);router['post'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x11')]);router[_0x6b01('0x12')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x12')](_0x6b01('0x14'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router['post'](_0x6b01('0x16'),controller[_0x6b01('0x17')]);router[_0x6b01('0x12')](_0x6b01('0x18'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x19')]);router[_0x6b01('0x1a')](_0x6b01('0x1b'),auth['isAuthenticated'](),controller[_0x6b01('0x1c')]);router[_0x6b01('0x1d')](_0x6b01('0x1b'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x1e')]);router[_0x6b01('0x1d')](_0x6b01('0xc'),auth['isAuthenticated'](),controller[_0x6b01('0x1f')]);router[_0x6b01('0x1d')](_0x6b01('0xd'),auth['isAuthenticated'](),controller[_0x6b01('0x20')]);router[_0x6b01('0x1d')](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x21')]);module[_0x6b01('0x22')]=router; \ No newline at end of file +var _0xc1c6=['addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','post','create'];(function(_0x423010,_0x5d6abc){var _0x4755ef=function(_0x202377){while(--_0x202377){_0x423010['push'](_0x423010['shift']());}};_0x4755ef(++_0x5d6abc);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x400482,_0x52d081){_0x400482=_0x400482-0x0;var _0x413c87=_0xc1c6[_0x400482];return _0x413c87;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x7')]('/:id/canned_answers',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x7')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x7')]('/:id/applications',auth[_0x6c1c('0xa')](),controller['getApplications']);router[_0x6c1c('0x11')]('/',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x12')]);router[_0x6c1c('0x11')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x13')]);router[_0x6c1c('0x11')](_0x6c1c('0x14'),auth['isAuthenticated'](),controller[_0x6c1c('0x15')]);router[_0x6c1c('0x11')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x16')]);router['post'](_0x6c1c('0x17'),auth['isAuthenticated'](),controller[_0x6c1c('0x18')]);router[_0x6c1c('0x11')]('/:id/notify',controller[_0x6c1c('0x19')]);router['post'](_0x6c1c('0x1a'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1b')]);router[_0x6c1c('0x1c')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1e')]);router[_0x6c1c('0x1f')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x20')]);router[_0x6c1c('0x1f')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x21')]);router[_0x6c1c('0x1f')](_0x6c1c('0x14'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x22')]);router[_0x6c1c('0x1f')](_0x6c1c('0x23'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x24')]);module[_0x6c1c('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 f51db6c..5ad9266 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 _0x6f7b=['sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio'];(function(_0x2506d4,_0xd953b5){var _0x95feaa=function(_0x3c2bbf){while(--_0x3c2bbf){_0x2506d4['push'](_0x2506d4['shift']());}};_0x95feaa(++_0xd953b5);}(_0x6f7b,0x125));var _0xb6f7=function(_0x4b0589,_0x46e130){_0x4b0589=_0x4b0589-0x0;var _0x5ef78c=_0x6f7b[_0x4b0589];return _0x5ef78c;};'use strict';var Sequelize=require(_0xb6f7('0x0'));var rs=require(_0xb6f7('0x1'));module[_0xb6f7('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xb6f7('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb6f7('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xb6f7('0x3')],'defaultValue':function(){return rs[_0xb6f7('0x4')]();}},'phone':{'type':Sequelize[_0xb6f7('0x3')]},'type':{'type':Sequelize[_0xb6f7('0x5')](_0xb6f7('0x6'),_0xb6f7('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xb6f7('0x3')]},'authToken':{'type':Sequelize[_0xb6f7('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb6f7('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb6f7('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb6f7('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb6f7('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb6f7('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb6f7('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb6f7('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xb6f7('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xde5964){if(!_0xde5964){this[_0xb6f7('0xc')](_0xb6f7('0xd'),null);}this['setDataValue'](_0xb6f7('0xe'),_0xde5964);}},'description':{'type':Sequelize[_0xb6f7('0x3')]}}; \ No newline at end of file +var _0x9e92=['STRING','name','generate','sinch','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','sequelize','randomstring'];(function(_0x166203,_0x1910af){var _0x3fe0e7=function(_0x4ed548){while(--_0x4ed548){_0x166203['push'](_0x166203['shift']());}};_0x3fe0e7(++_0x1910af);}(_0x9e92,0x108));var _0x29e9=function(_0x5bb58c,_0xe736cd){_0x5bb58c=_0x5bb58c-0x0;var _0x44fbe6=_0x9e92[_0x5bb58c];return _0x44fbe6;};'use strict';var Sequelize=require(_0x29e9('0x0'));var rs=require(_0x29e9('0x1'));module['exports']={'name':{'type':Sequelize[_0x29e9('0x2')],'unique':_0x29e9('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x29e9('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x29e9('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x29e9('0x4')]();}},'phone':{'type':Sequelize[_0x29e9('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x29e9('0x5'))},'accountSid':{'type':Sequelize[_0x29e9('0x2')]},'baseUrl':{'type':Sequelize[_0x29e9('0x2')]},'authToken':{'type':Sequelize[_0x29e9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x29e9('0x6')],'defaultValue':function(){return _0x29e9('0x7');}},'notificationSound':{'type':Sequelize[_0x29e9('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x29e9('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x29e9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x29e9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29e9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29e9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x29e9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29e9('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29e9('0x8')],'defaultValue':![],'comment':_0x29e9('0xa'),'set':function(_0xa7eebb){if(!_0xa7eebb){this[_0x29e9('0xb')](_0x29e9('0xc'),null);}this[_0x29e9('0xb')](_0x29e9('0xd'),_0xa7eebb);}},'description':{'type':Sequelize[_0x29e9('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 37e0391..87fa7c6 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 _0x66b8=['messageId','MessageSid','notifications','message_id','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','WhatsappInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','Messages','push','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','WhatsappAccounts','destroy','stack','name','send','index','Pause','map','WhatsappAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','type','VIRTUAL','filter','merge','includeAll','include','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','options','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','findAll','removeAnswers','ids','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','sequelize','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','whatsapp','account','sinch','statuses','state','read','timestamp','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','replace','whatsapp:','Body'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x66b8,0x1ad));var _0x866b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x66b8[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x866b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x866b('0x1'));var jsonpatch=require(_0x866b('0x2'));var rp=require(_0x866b('0x3'));var moment=require(_0x866b('0x4'));var BPromise=require(_0x866b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x866b('0x6'));var sox=require(_0x866b('0x7'));var csv=require('to-csv');var ejs=require(_0x866b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x866b('0x9'));var crypto=require('crypto');var jsforce=require(_0x866b('0xa'));var deskjs=require(_0x866b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x866b('0xc'));var Redis=require(_0x866b('0xd'));var authService=require(_0x866b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x866b('0xf'));var hardwareService=require(_0x866b('0x10'));var logger=require(_0x866b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x866b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x866b('0x13'))['db'];config[_0x866b('0x14')]=_[_0x866b('0x15')](config[_0x866b('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x866b('0x16'))(new Redis(config[_0x866b('0x14')]));require(_0x866b('0x17'))[_0x866b('0x18')](socket);var jayson=require(_0x866b('0x19'));var client=jayson[_0x866b('0x1a')][_0x866b('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xb5b2d9,_0xe04316,_0xffffbc,_0x277aed){return new BPromise(function(_0x1ecce8,_0x124954){var _0x33c49c=_0x277aed||client;return _0x33c49c[_0x866b('0x1c')](_0xb5b2d9,_0xffffbc)['then'](function(_0x295cc6){logger[_0x866b('0x1d')](_0x866b('0x1e'),_0xe04316,_0x866b('0x1f'));logger[_0x866b('0x20')](_0x866b('0x21'),_0xe04316,'request\x20sent',JSON['stringify'](_0x295cc6));if(_0x295cc6[_0x866b('0x22')]){if(_0x295cc6[_0x866b('0x22')]['code']===0x1f4){logger[_0x866b('0x22')](_0x866b('0x1e'),_0xe04316,_0x295cc6[_0x866b('0x22')][_0x866b('0x23')]);return _0x124954(_0x295cc6[_0x866b('0x22')][_0x866b('0x23')]);}logger[_0x866b('0x22')](_0x866b('0x1e'),_0xe04316,_0x295cc6[_0x866b('0x22')][_0x866b('0x23')]);return _0x1ecce8(_0x295cc6['error']['message']);}else{logger['info'](_0x866b('0x1e'),_0xe04316,_0x866b('0x1f'));_0x1ecce8(_0x295cc6[_0x866b('0x24')][_0x866b('0x23')]);}})[_0x866b('0x25')](function(_0x2aaead){logger[_0x866b('0x22')](_0x866b('0x1e'),_0xe04316,_0x2aaead);_0x124954(_0x2aaead);});});}function respondWithStatusCode(_0x2291cb,_0x2f6bfe){_0x2f6bfe=_0x2f6bfe||0xcc;return function(_0x11e99e){if(_0x11e99e){return _0x2291cb[_0x866b('0x26')](_0x2f6bfe);}return _0x2291cb[_0x866b('0x27')](_0x2f6bfe)[_0x866b('0x28')]();};}function respondWithResult(_0x154f4e,_0xb8d891){_0xb8d891=_0xb8d891||0xc8;return function(_0x4bf6fe){if(_0x4bf6fe){return _0x154f4e['status'](_0xb8d891)[_0x866b('0x29')](_0x4bf6fe);}};}function respondWithFilteredResult(_0x2c38a2,_0x3aa9b9){return function(_0x46a24a){if(_0x46a24a){var _0x5ae5b1=typeof _0x3aa9b9[_0x866b('0x2a')]===_0x866b('0x2b')&&typeof _0x3aa9b9['limit']===_0x866b('0x2b');var _0x409ab9=_0x46a24a[_0x866b('0x2c')];var _0x4d4ab1=_0x5ae5b1?0x0:_0x3aa9b9[_0x866b('0x2a')];var _0x300e68=_0x5ae5b1?_0x46a24a[_0x866b('0x2c')]:_0x3aa9b9[_0x866b('0x2a')]+_0x3aa9b9['limit'];var _0x55e9c0;if(_0x300e68>=_0x409ab9){_0x300e68=_0x409ab9;_0x55e9c0=0xc8;}else{_0x55e9c0=0xce;}_0x2c38a2['status'](_0x55e9c0);return _0x2c38a2[_0x866b('0x2d')](_0x866b('0x2e'),_0x4d4ab1+'-'+_0x300e68+'/'+_0x409ab9)[_0x866b('0x29')](_0x46a24a);}return null;};}function patchUpdates(_0x5f2bae){return function(_0x55b8a9){try{jsonpatch[_0x866b('0x2f')](_0x55b8a9,_0x5f2bae,!![]);}catch(_0x19af6d){return BPromise[_0x866b('0x30')](_0x19af6d);}return _0x55b8a9[_0x866b('0x31')]();};}function saveUpdates(_0x27ecee,_0x3dbc08){return function(_0x376d78){if(_0x376d78){return _0x376d78[_0x866b('0x32')](_0x27ecee)[_0x866b('0x33')](function(_0x1851c8){return _0x1851c8;});}return null;};}function removeEntity(_0x24372a,_0x14eb1b){return function(_0x559cc2){if(_0x559cc2){return _0x559cc2['destroy']()[_0x866b('0x33')](function(){var _0x11ea81=_0x559cc2[_0x866b('0x34')]({'plain':!![]});var _0x5020e5=_0x866b('0x35');return db['UserProfileResource'][_0x866b('0x36')]({'where':{'type':_0x5020e5,'resourceId':_0x11ea81['id']}})[_0x866b('0x33')](function(){return _0x559cc2;});})[_0x866b('0x33')](function(){_0x24372a[_0x866b('0x27')](0xcc)[_0x866b('0x28')]();});}};}function handleEntityNotFound(_0x5d341a,_0x17265c){return function(_0x1ec46d){if(!_0x1ec46d){_0x5d341a[_0x866b('0x26')](0x194);}return _0x1ec46d;};}function handleError(_0x23e4ff,_0x1f7a82){_0x1f7a82=_0x1f7a82||0x1f4;return function(_0x556276){logger[_0x866b('0x22')](_0x556276[_0x866b('0x37')]);if(_0x556276['name']){delete _0x556276[_0x866b('0x38')];}_0x23e4ff['status'](_0x1f7a82)[_0x866b('0x39')](_0x556276);};}exports[_0x866b('0x3a')]=function(_0x438a85,_0x1f2202){var _0x5ea7ac={'include':[{'model':db[_0x866b('0x3b')],'as':'mandatoryDispositionPause'}]},_0x4118cf={},_0xc6c5f={'count':0x0,'rows':[]};var _0x373337=_[_0x866b('0x3c')](db[_0x866b('0x3d')]['rawAttributes'],function(_0x8d520a){return{'name':_0x8d520a[_0x866b('0x3e')],'type':_0x8d520a['type'][_0x866b('0x3f')]};});_0x4118cf[_0x866b('0x40')]=_[_0x866b('0x3c')](_0x373337,_0x866b('0x38'));_0x4118cf[_0x866b('0x41')]=_[_0x866b('0x42')](_0x438a85['query']);_0x4118cf[_0x866b('0x43')]=_[_0x866b('0x44')](_0x4118cf[_0x866b('0x40')],_0x4118cf[_0x866b('0x41')]);_0x5ea7ac[_0x866b('0x45')]=_[_0x866b('0x44')](_0x4118cf[_0x866b('0x40')],qs[_0x866b('0x46')](_0x438a85[_0x866b('0x41')][_0x866b('0x46')]));_0x5ea7ac['attributes']=_0x5ea7ac['attributes'][_0x866b('0x47')]?_0x5ea7ac[_0x866b('0x45')]:_0x4118cf[_0x866b('0x40')];if(!_0x438a85[_0x866b('0x41')]['hasOwnProperty'](_0x866b('0x48'))){_0x5ea7ac[_0x866b('0x49')]=qs[_0x866b('0x49')](_0x438a85[_0x866b('0x41')][_0x866b('0x49')]);_0x5ea7ac[_0x866b('0x2a')]=qs[_0x866b('0x2a')](_0x438a85[_0x866b('0x41')][_0x866b('0x2a')]);}_0x5ea7ac[_0x866b('0x4a')]=qs[_0x866b('0x4b')](_0x438a85['query'][_0x866b('0x4b')]);_0x5ea7ac['where']=qs[_0x866b('0x43')](_['pick'](_0x438a85[_0x866b('0x41')],_0x4118cf['filters']),_0x373337);if(_0x438a85['query']['filter']){_0x5ea7ac[_0x866b('0x4c')]=_['merge'](_0x5ea7ac[_0x866b('0x4c')],{'$or':_['map'](_0x373337,function(_0x520f53){if(_0x520f53[_0x866b('0x4d')]!==_0x866b('0x4e')){var _0x877d64={};_0x877d64[_0x520f53[_0x866b('0x38')]]={'$like':'%'+_0x438a85['query'][_0x866b('0x4f')]+'%'};return _0x877d64;}})});}_0x5ea7ac=_[_0x866b('0x50')]({},_0x5ea7ac,_0x438a85['options']);var _0x23654b={'where':_0x5ea7ac[_0x866b('0x4c')]};return db[_0x866b('0x3d')]['count'](_0x23654b)['then'](function(_0x22c396){_0xc6c5f['count']=_0x22c396;if(_0x438a85['query'][_0x866b('0x51')]){_0x5ea7ac[_0x866b('0x52')]=[{'all':!![]}];}return db[_0x866b('0x3d')]['findAll'](_0x5ea7ac);})['then'](function(_0x5c381e){_0xc6c5f[_0x866b('0x53')]=_0x5c381e;return _0xc6c5f;})[_0x866b('0x33')](respondWithFilteredResult(_0x1f2202,_0x5ea7ac))['catch'](handleError(_0x1f2202,null));};exports[_0x866b('0x54')]=function(_0x40513d,_0x8187a6){var _0x1f9b86={'raw':![],'where':{'id':_0x40513d[_0x866b('0x55')]['id']},'include':[{'model':db[_0x866b('0x3b')],'as':_0x866b('0x56')}]},_0x3a2963={};_0x3a2963[_0x866b('0x40')]=_['keys'](db['WhatsappAccount'][_0x866b('0x57')]);_0x3a2963[_0x866b('0x41')]=_['keys'](_0x40513d[_0x866b('0x41')]);_0x3a2963[_0x866b('0x43')]=_[_0x866b('0x44')](_0x3a2963['model'],_0x3a2963['query']);_0x1f9b86[_0x866b('0x45')]=_[_0x866b('0x44')](_0x3a2963[_0x866b('0x40')],qs[_0x866b('0x46')](_0x40513d['query'][_0x866b('0x46')]));_0x1f9b86['attributes']=_0x1f9b86['attributes'][_0x866b('0x47')]?_0x1f9b86[_0x866b('0x45')]:_0x3a2963[_0x866b('0x40')];if(_0x40513d[_0x866b('0x41')][_0x866b('0x51')]){_0x1f9b86[_0x866b('0x52')]=[{'all':!![]}];}_0x1f9b86=_['merge']({},_0x1f9b86,_0x40513d['options']);return db[_0x866b('0x3d')][_0x866b('0x58')](_0x1f9b86)[_0x866b('0x33')](handleEntityNotFound(_0x8187a6,null))[_0x866b('0x33')](respondWithResult(_0x8187a6,null))[_0x866b('0x25')](handleError(_0x8187a6,null));};exports[_0x866b('0x59')]=function(_0x189cb1,_0x33f6c3){return db[_0x866b('0x3d')][_0x866b('0x59')](_0x189cb1['body'],{})['then'](function(_0x2e319e){var _0x42d966=_0x189cb1[_0x866b('0x5a')][_0x866b('0x34')]({'plain':!![]});if(!_0x42d966)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42d966[_0x866b('0x5b')]===_0x866b('0x5a')){var _0x551af9=_0x2e319e[_0x866b('0x34')]({'plain':!![]});var _0xeabe09=_0x866b('0x35');return db[_0x866b('0x5c')]['find']({'where':{'name':_0xeabe09,'userProfileId':_0x42d966[_0x866b('0x5d')]},'raw':!![]})[_0x866b('0x33')](function(_0x4c51be){if(_0x4c51be&&_0x4c51be[_0x866b('0x5e')]===0x0){return db[_0x866b('0x5f')][_0x866b('0x59')]({'name':_0x551af9[_0x866b('0x38')],'resourceId':_0x551af9['id'],'type':_0x4c51be[_0x866b('0x38')],'sectionId':_0x4c51be['id']},{})['then'](function(){return _0x2e319e;});}else{return _0x2e319e;}})[_0x866b('0x25')](function(_0x33b4c0){logger[_0x866b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33b4c0);throw _0x33b4c0;});}return _0x2e319e;})[_0x866b('0x33')](respondWithResult(_0x33f6c3,0xc9))['catch'](handleError(_0x33f6c3,null));};exports[_0x866b('0x32')]=function(_0x503fcf,_0x29ae7c){if(_0x503fcf[_0x866b('0x60')]['id']){delete _0x503fcf[_0x866b('0x60')]['id'];}return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x503fcf[_0x866b('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x29ae7c,null))['then'](saveUpdates(_0x503fcf[_0x866b('0x60')],null))['then'](respondWithResult(_0x29ae7c,null))[_0x866b('0x25')](handleError(_0x29ae7c,null));};exports[_0x866b('0x36')]=function(_0x94542b,_0x23b688){return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x94542b[_0x866b('0x55')]['id']}})['then'](handleEntityNotFound(_0x23b688,null))[_0x866b('0x33')](removeEntity(_0x23b688,null))[_0x866b('0x25')](handleError(_0x23b688,null));};exports[_0x866b('0x61')]=function(_0x4d3d4e,_0x3bec99){return db['WhatsappAccount'][_0x866b('0x61')]()[_0x866b('0x33')](respondWithResult(_0x3bec99,null))[_0x866b('0x25')](handleError(_0x3bec99,null));};exports[_0x866b('0x62')]=function(_0x216e69,_0x2f733d,_0x485ba4){if(_0x216e69[_0x866b('0x60')]['id']){delete _0x216e69['body']['id'];}return db['WhatsappAccount'][_0x866b('0x58')]({'where':{'id':_0x216e69[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x2f733d,null))[_0x866b('0x33')](function(_0x525e3e){if(_0x525e3e){_0x216e69[_0x866b('0x60')][_0x866b('0x63')]=_0x525e3e['id'];return db[_0x866b('0x64')][_0x866b('0x59')](_0x216e69[_0x866b('0x60')]);}})['then'](respondWithResult(_0x2f733d,null))['catch'](handleError(_0x2f733d,null));};exports[_0x866b('0x65')]=function(_0x521d1a,_0x2c17e1,_0x4f9f3d){var _0x1a4277={'raw':![],'where':{}};var _0x31b102={};var _0x552360={'count':0x0,'rows':[]};return db[_0x866b('0x3d')][_0x866b('0x66')]({'where':{'id':_0x521d1a[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x2c17e1,null))[_0x866b('0x33')](function(_0x1b8b85){if(_0x1b8b85){_0x31b102['model']=_['keys'](db[_0x866b('0x64')]['rawAttributes']);_0x31b102[_0x866b('0x41')]=_['keys'](_0x521d1a['query']);_0x31b102[_0x866b('0x43')]=_[_0x866b('0x44')](_0x31b102[_0x866b('0x40')],_0x31b102[_0x866b('0x41')]);_0x1a4277['attributes']=_[_0x866b('0x44')](_0x31b102[_0x866b('0x40')],qs[_0x866b('0x46')](_0x521d1a['query']['fields']));_0x1a4277[_0x866b('0x45')]=_0x1a4277[_0x866b('0x45')]['length']?_0x1a4277[_0x866b('0x45')]:_0x31b102[_0x866b('0x40')];if(!_0x521d1a[_0x866b('0x41')][_0x866b('0x67')](_0x866b('0x48'))){_0x1a4277[_0x866b('0x49')]=qs[_0x866b('0x49')](_0x521d1a[_0x866b('0x41')][_0x866b('0x49')]);_0x1a4277[_0x866b('0x2a')]=qs['offset'](_0x521d1a[_0x866b('0x41')][_0x866b('0x2a')]);}_0x1a4277[_0x866b('0x4a')]=qs['sort'](_0x521d1a[_0x866b('0x41')][_0x866b('0x4b')]);_0x1a4277[_0x866b('0x4c')]=qs['filters'](_['pick'](_0x521d1a[_0x866b('0x41')],_0x31b102[_0x866b('0x43')]));_0x1a4277[_0x866b('0x4c')][_0x866b('0x63')]=_0x1b8b85['id'];if(_0x521d1a[_0x866b('0x41')][_0x866b('0x4f')]){_0x1a4277[_0x866b('0x4c')]=_['merge'](_0x1a4277['where'],{'$or':_['map'](_0x1a4277[_0x866b('0x45')],function(_0x2fa52c){var _0xb369d2={};_0xb369d2[_0x2fa52c]={'$like':'%'+_0x521d1a[_0x866b('0x41')][_0x866b('0x4f')]+'%'};return _0xb369d2;})});}_0x1a4277=_['merge']({},_0x1a4277,_0x521d1a[_0x866b('0x68')]);return db['Disposition'][_0x866b('0x2c')]({'where':_0x1a4277[_0x866b('0x4c')]})['then'](function(_0x29365c){_0x552360[_0x866b('0x2c')]=_0x29365c;if(_0x521d1a[_0x866b('0x41')][_0x866b('0x51')]){_0x1a4277['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1a4277);})[_0x866b('0x33')](function(_0x4f5f1e){_0x552360[_0x866b('0x53')]=_0x4f5f1e;return _0x552360;});}})[_0x866b('0x33')](respondWithFilteredResult(_0x2c17e1,_0x1a4277))[_0x866b('0x25')](handleError(_0x2c17e1,null));};exports[_0x866b('0x69')]=function(_0x1dae07,_0x4d7e0d,_0x55295e){return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x1dae07[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x4d7e0d,null))[_0x866b('0x33')](function(_0x15669f){if(_0x15669f){return _0x15669f[_0x866b('0x69')](_0x1dae07['query']['ids']);}})[_0x866b('0x33')](respondWithStatusCode(_0x4d7e0d,null))[_0x866b('0x25')](handleError(_0x4d7e0d,null));};exports[_0x866b('0x6a')]=function(_0x308b8f,_0x4ec3e0,_0x4db18e){if(_0x308b8f[_0x866b('0x60')]['id']){delete _0x308b8f['body']['id'];}return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x308b8f[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x4ec3e0,null))[_0x866b('0x33')](function(_0x5c0505){if(_0x5c0505){_0x308b8f[_0x866b('0x60')]['WhatsappAccountId']=_0x5c0505['id'];return db[_0x866b('0x6b')][_0x866b('0x59')](_0x308b8f['body']);}})['then'](respondWithResult(_0x4ec3e0,null))[_0x866b('0x25')](handleError(_0x4ec3e0,null));};exports[_0x866b('0x6c')]=function(_0x501f80,_0x11cdae,_0x24787e){var _0x128d93={'raw':![],'where':{}};var _0x245469={};var _0x140db7={'count':0x0,'rows':[]};return db[_0x866b('0x3d')][_0x866b('0x66')]({'where':{'id':_0x501f80[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x11cdae,null))[_0x866b('0x33')](function(_0x22e02f){if(_0x22e02f){_0x245469[_0x866b('0x40')]=_[_0x866b('0x42')](db['CannedAnswer'][_0x866b('0x57')]);_0x245469['query']=_['keys'](_0x501f80[_0x866b('0x41')]);_0x245469[_0x866b('0x43')]=_[_0x866b('0x44')](_0x245469[_0x866b('0x40')],_0x245469[_0x866b('0x41')]);_0x128d93['attributes']=_[_0x866b('0x44')](_0x245469[_0x866b('0x40')],qs[_0x866b('0x46')](_0x501f80[_0x866b('0x41')][_0x866b('0x46')]));_0x128d93[_0x866b('0x45')]=_0x128d93[_0x866b('0x45')][_0x866b('0x47')]?_0x128d93[_0x866b('0x45')]:_0x245469[_0x866b('0x40')];if(!_0x501f80[_0x866b('0x41')][_0x866b('0x67')](_0x866b('0x48'))){_0x128d93['limit']=qs['limit'](_0x501f80['query']['limit']);_0x128d93[_0x866b('0x2a')]=qs[_0x866b('0x2a')](_0x501f80[_0x866b('0x41')]['offset']);}_0x128d93[_0x866b('0x4a')]=qs[_0x866b('0x4b')](_0x501f80['query'][_0x866b('0x4b')]);_0x128d93[_0x866b('0x4c')]=qs[_0x866b('0x43')](_[_0x866b('0x6d')](_0x501f80['query'],_0x245469[_0x866b('0x43')]));_0x128d93[_0x866b('0x4c')]['WhatsappAccountId']=_0x22e02f['id'];if(_0x501f80['query'][_0x866b('0x4f')]){_0x128d93[_0x866b('0x4c')]=_[_0x866b('0x50')](_0x128d93['where'],{'$or':_[_0x866b('0x3c')](_0x128d93['attributes'],function(_0x38b873){var _0x38764f={};_0x38764f[_0x38b873]={'$like':'%'+_0x501f80[_0x866b('0x41')][_0x866b('0x4f')]+'%'};return _0x38764f;})});}_0x128d93=_[_0x866b('0x50')]({},_0x128d93,_0x501f80['options']);return db['CannedAnswer']['count']({'where':_0x128d93[_0x866b('0x4c')]})[_0x866b('0x33')](function(_0x279036){_0x140db7[_0x866b('0x2c')]=_0x279036;if(_0x501f80['query'][_0x866b('0x51')]){_0x128d93['include']=[{'all':!![]}];}return db[_0x866b('0x6b')][_0x866b('0x6e')](_0x128d93);})[_0x866b('0x33')](function(_0x2a8e38){_0x140db7[_0x866b('0x53')]=_0x2a8e38;return _0x140db7;});}})[_0x866b('0x33')](respondWithFilteredResult(_0x11cdae,_0x128d93))[_0x866b('0x25')](handleError(_0x11cdae,null));};exports['removeAnswers']=function(_0x1d158a,_0xda0028,_0x46fc26){return db[_0x866b('0x3d')]['find']({'where':{'id':_0x1d158a['params']['id']}})[_0x866b('0x33')](handleEntityNotFound(_0xda0028,null))[_0x866b('0x33')](function(_0x21ae6b){if(_0x21ae6b){return _0x21ae6b[_0x866b('0x6f')](_0x1d158a[_0x866b('0x41')][_0x866b('0x70')]);}})[_0x866b('0x33')](respondWithStatusCode(_0xda0028,null))[_0x866b('0x25')](handleError(_0xda0028,null));};exports[_0x866b('0x71')]=function(_0x3b3dc4,_0x52b82f,_0x3bace7){return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x3b3dc4['params']['id']}})['then'](handleEntityNotFound(_0x52b82f,null))[_0x866b('0x33')](function(_0x45ff4e){if(_0x45ff4e){return _0x45ff4e[_0x866b('0x71')](_0x3b3dc4[_0x866b('0x60')][_0x866b('0x70')],_['omit'](_0x3b3dc4[_0x866b('0x60')],[_0x866b('0x70'),'id'])||{})[_0x866b('0x72')](function(_0x4ecc9f){for(var _0x140daf=0x0;_0x140daf<_0x3b3dc4[_0x866b('0x60')][_0x866b('0x70')][_0x866b('0x47')];_0x140daf+=0x1){socket[_0x866b('0x73')](_0x866b('0x74'),{'UserId':Number(_0x3b3dc4[_0x866b('0x60')][_0x866b('0x70')][_0x140daf]),'WhatsappAccountId':Number(_0x3b3dc4['params']['id'])});}return _0x4ecc9f;});}})[_0x866b('0x33')](respondWithResult(_0x52b82f,null))[_0x866b('0x25')](handleError(_0x52b82f,null));};exports[_0x866b('0x75')]=function(_0x5f4a45,_0x4dcc2e,_0x5b7267){return db['WhatsappAccount'][_0x866b('0x58')]({'where':{'id':_0x5f4a45[_0x866b('0x55')]['id']}})['then'](handleEntityNotFound(_0x4dcc2e,null))[_0x866b('0x33')](function(_0x56a09a){if(_0x56a09a){return _0x56a09a[_0x866b('0x75')](_0x5f4a45['query'][_0x866b('0x70')])['then'](function(){if(_[_0x866b('0x76')](_0x5f4a45[_0x866b('0x41')]['ids'])){for(var _0x5d7c45=0x0;_0x5d7c45<_0x5f4a45['query'][_0x866b('0x70')][_0x866b('0x47')];_0x5d7c45+=0x1){socket[_0x866b('0x73')](_0x866b('0x77'),{'UserId':Number(_0x5f4a45[_0x866b('0x41')]['ids'][_0x5d7c45]),'WhatsappAccountId':Number(_0x5f4a45[_0x866b('0x55')]['id'])});}}else{socket['emit'](_0x866b('0x77'),{'UserId':Number(_0x5f4a45[_0x866b('0x41')][_0x866b('0x70')]),'WhatsappAccountId':Number(_0x5f4a45['params']['id'])});}});}})[_0x866b('0x33')](respondWithStatusCode(_0x4dcc2e,null))[_0x866b('0x25')](handleError(_0x4dcc2e,null));};exports['getAgents']=function(_0x4c199b,_0x1c6198,_0x740e42){var _0x32c62d={};var _0x35dc55={};var _0x4dc5ba;var _0x266c07;return db['WhatsappAccount']['findOne']({'where':{'id':_0x4c199b[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x1c6198,null))[_0x866b('0x33')](function(_0x189f37){if(_0x189f37){_0x4dc5ba=_0x189f37;_0x35dc55[_0x866b('0x40')]=_[_0x866b('0x42')](db[_0x866b('0x78')][_0x866b('0x57')]);_0x35dc55[_0x866b('0x41')]=_[_0x866b('0x42')](_0x4c199b['query']);_0x35dc55[_0x866b('0x43')]=_['intersection'](_0x35dc55[_0x866b('0x40')],_0x35dc55[_0x866b('0x41')]);_0x32c62d['attributes']=_[_0x866b('0x44')](_0x35dc55[_0x866b('0x40')],qs[_0x866b('0x46')](_0x4c199b['query'][_0x866b('0x46')]));_0x32c62d['attributes']=_0x32c62d[_0x866b('0x45')][_0x866b('0x47')]?_0x32c62d[_0x866b('0x45')]:_0x35dc55[_0x866b('0x40')];_0x32c62d[_0x866b('0x4a')]=qs['sort'](_0x4c199b[_0x866b('0x41')][_0x866b('0x4b')]);_0x32c62d[_0x866b('0x4c')]=qs[_0x866b('0x43')](_[_0x866b('0x6d')](_0x4c199b[_0x866b('0x41')],_0x35dc55[_0x866b('0x43')]));if(_0x4c199b['query'][_0x866b('0x4f')]){_0x32c62d[_0x866b('0x4c')]=_[_0x866b('0x50')](_0x32c62d[_0x866b('0x4c')],{'$or':_['map'](_0x32c62d[_0x866b('0x45')],function(_0x450d16){var _0xcf4470={};_0xcf4470[_0x450d16]={'$like':'%'+_0x4c199b[_0x866b('0x41')][_0x866b('0x4f')]+'%'};return _0xcf4470;})});}_0x32c62d=_[_0x866b('0x50')]({},_0x32c62d,_0x4c199b[_0x866b('0x68')]);return _0x4dc5ba[_0x866b('0x79')](_0x32c62d);}})[_0x866b('0x33')](function(_0x560097){if(_0x560097){_0x266c07=_0x560097[_0x866b('0x47')];if(!_0x4c199b[_0x866b('0x41')][_0x866b('0x67')]('nolimit')){_0x32c62d['limit']=qs[_0x866b('0x49')](_0x4c199b[_0x866b('0x41')]['limit']);_0x32c62d[_0x866b('0x2a')]=qs[_0x866b('0x2a')](_0x4c199b[_0x866b('0x41')][_0x866b('0x2a')]);}return _0x4dc5ba[_0x866b('0x79')](_0x32c62d);}})[_0x866b('0x33')](function(_0x2185ea){if(_0x2185ea){return _0x2185ea?{'count':_0x266c07,'rows':_0x2185ea}:null;}})['then'](respondWithResult(_0x1c6198,null))['catch'](handleError(_0x1c6198,null));};exports['addApplications']=function(_0x48e4fc,_0x2a8e36){var _0xf6cddd=_0x48e4fc[_0x866b('0x55')]['id'];var _0x280641=_0x48e4fc[_0x866b('0x60')];var _0x2006c9=0xc8;var _0x23feb4=null;return db[_0x866b('0x7a')]['transaction']({'isolationLevel':db[_0x866b('0x7a')][_0x866b('0x7b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x22f117){return db[_0x866b('0x3d')]['findOne']({'where':{'id':_0xf6cddd},'transaction':_0x22f117})[_0x866b('0x33')](function(_0x3c86fb){if(_0x3c86fb){return db[_0x866b('0x7c')][_0x866b('0x36')]({'where':{'WhatsappAccountId':_0xf6cddd},'transaction':_0x22f117})[_0x866b('0x33')](function(){var _0x3c3106=_[_0x866b('0x3c')](_0x280641,function(_0x3c6c06){_0x3c6c06[_0x866b('0x63')]=_0xf6cddd;return _0x3c6c06;});return db['WhatsappApplication'][_0x866b('0x7d')](_0x3c3106,{'transaction':_0x22f117});});}else{_0x2006c9=0x194;_0x23feb4=[];}});})[_0x866b('0x33')](function(){if(_0x2006c9!==0x194){return db[_0x866b('0x7c')][_0x866b('0x7e')]({'where':{'WhatsappAccountId':_0xf6cddd},'order':_0x866b('0x7f')})['then'](function(_0x271769){_0x23feb4=_0x271769;});}})[_0x866b('0x25')](function(_0x4872bf){_0x2006c9=0x1f4;logger['error'](_0x4872bf[_0x866b('0x37')]);if(_0x4872bf['name']){delete _0x4872bf[_0x866b('0x38')];}_0x23feb4=_0x4872bf;})[_0x866b('0x80')](function(){if(_0x23feb4===null){_0x2a8e36[_0x866b('0x26')](_0x2006c9);}else{if(_0x2006c9===0x1f4){_0x2a8e36[_0x866b('0x27')](_0x2006c9)[_0x866b('0x39')](_0x23feb4);}else{_0x2a8e36[_0x866b('0x27')](_0x2006c9)[_0x866b('0x29')](_0x23feb4);}}});};exports[_0x866b('0x81')]=function(_0x544281,_0x19d933,_0x35129b){var _0x4bf26f={};var _0x7d0948={};var _0x23ffad;var _0x221b3f;return db[_0x866b('0x3d')]['findOne']({'where':{'id':_0x544281[_0x866b('0x55')]['id']}})[_0x866b('0x33')](handleEntityNotFound(_0x19d933,null))['then'](function(_0x55a30a){if(_0x55a30a){_0x23ffad=_0x55a30a;_0x7d0948[_0x866b('0x40')]=_[_0x866b('0x42')](db[_0x866b('0x7c')][_0x866b('0x57')]);_0x7d0948[_0x866b('0x41')]=_[_0x866b('0x42')](_0x544281[_0x866b('0x41')]);_0x7d0948[_0x866b('0x43')]=_[_0x866b('0x44')](_0x7d0948[_0x866b('0x40')],_0x7d0948['query']);_0x4bf26f[_0x866b('0x45')]=_[_0x866b('0x44')](_0x7d0948[_0x866b('0x40')],qs['fields'](_0x544281[_0x866b('0x41')][_0x866b('0x46')]));_0x4bf26f['attributes']=_0x4bf26f[_0x866b('0x45')][_0x866b('0x47')]?_0x4bf26f[_0x866b('0x45')]:_0x7d0948['model'];_0x4bf26f['order']=qs[_0x866b('0x4b')](_0x544281[_0x866b('0x41')][_0x866b('0x4b')]);_0x4bf26f['where']=qs[_0x866b('0x43')](_['pick'](_0x544281[_0x866b('0x41')],_0x7d0948[_0x866b('0x43')]));if(_0x544281[_0x866b('0x41')][_0x866b('0x4f')]){_0x4bf26f[_0x866b('0x4c')]=_[_0x866b('0x50')](_0x4bf26f['where'],{'$or':_[_0x866b('0x3c')](_0x4bf26f[_0x866b('0x45')],function(_0x38fa97){var _0x15f372={};_0x15f372[_0x38fa97]={'$like':'%'+_0x544281['query'][_0x866b('0x4f')]+'%'};return _0x15f372;})});}_0x4bf26f=_['merge']({},_0x4bf26f,_0x544281[_0x866b('0x68')]);return _0x23ffad[_0x866b('0x81')](_0x4bf26f);}})[_0x866b('0x33')](function(_0x353ca2){if(_0x353ca2){_0x221b3f=_0x353ca2[_0x866b('0x47')];if(!_0x544281['query'][_0x866b('0x67')](_0x866b('0x48'))){_0x4bf26f[_0x866b('0x49')]=qs['limit'](_0x544281[_0x866b('0x41')][_0x866b('0x49')]);_0x4bf26f[_0x866b('0x2a')]=qs['offset'](_0x544281['query'][_0x866b('0x2a')]);}return _0x23ffad[_0x866b('0x81')](_0x4bf26f);}})[_0x866b('0x33')](function(_0x5d7f48){if(_0x5d7f48){return _0x5d7f48?{'count':_0x221b3f,'rows':_0x5d7f48}:null;}})['then'](respondWithResult(_0x19d933,null))[_0x866b('0x25')](handleError(_0x19d933,null));};exports['notify']=function(_0x329a44,_0x20528b,_0x334e5e){var _0x2ddb05={'channel':_0x866b('0x82')};var _0x272258=[];var _0x9a7453=[];var _0x174210={};return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x329a44[_0x866b('0x55')]['id']},'include':[{'model':db[_0x866b('0x7c')],'as':'Applications'}]})[_0x866b('0x33')](handleEntityNotFound(_0x20528b,null))[_0x866b('0x33')](function(_0x3f328c){_0x2ddb05[_0x866b('0x83')]=_0x3f328c;if(_0x2ddb05[_0x866b('0x83')]&&_0x2ddb05['account'][_0x866b('0x4d')]===_0x866b('0x84')&&_0x329a44['body']['statuses']){if(_0x329a44['body']['statuses'][_0x866b('0x47')]===0x0)return;if(_0x329a44[_0x866b('0x60')][_0x866b('0x85')][0x0][_0x866b('0x86')]!==_0x866b('0x87'))return;return db['WhatsappMessage'][_0x866b('0x32')]({'read':!![],'readAt':_0x329a44['body'][_0x866b('0x85')][0x0][_0x866b('0x88')]},{'where':{'messageId':_0x329a44['body'][_0x866b('0x85')][0x0]['message_id']},'individualHooks':!![]})[_0x866b('0x33')](function(_0x3cea40){return _0x20528b[_0x866b('0x27')](0xc8)[_0x866b('0x29')](_0x3cea40);});}_0x2ddb05['applications']=_[_0x866b('0x89')](_0x3f328c[_0x866b('0x8a')],['priority'],[_0x866b('0x8b')]);if(_0x2ddb05[_0x866b('0x83')][_0x866b('0x8a')]){delete _0x2ddb05[_0x866b('0x83')][_0x866b('0x8a')];}return db[_0x866b('0x8c')][_0x866b('0x61')]()['then'](function(_0x2fa74d){if(!_0x2fa74d){throw new db[(_0x866b('0x8d'))][(_0x866b('0x8e'))](_0x866b('0x8f'));}_0x272258=_[_0x866b('0x90')](_['keys'](_0x2fa74d),[_0x866b('0x91'),_0x866b('0x92')]);_0x9a7453=_[_0x866b('0x90')](_[_0x866b('0x42')](_0x2fa74d),[_0x866b('0x91'),_0x866b('0x92'),_0x866b('0x93'),_0x866b('0x94')]);_0x2ddb05[_0x866b('0x60')]={'mapKey':'mobile'};if(_0x2ddb05[_0x866b('0x83')]&&_0x2ddb05['account']['type']===_0x866b('0x95')){_0x2ddb05['body']['from']=_0x329a44[_0x866b('0x60')]['From'][_0x866b('0x96')](_0x866b('0x97'),'');_0x2ddb05[_0x866b('0x60')]['body']=_0x329a44[_0x866b('0x60')][_0x866b('0x98')];_0x2ddb05[_0x866b('0x60')][_0x866b('0x99')]=_0x329a44[_0x866b('0x60')][_0x866b('0x9a')];}if(_0x2ddb05[_0x866b('0x83')]&&_0x2ddb05[_0x866b('0x83')][_0x866b('0x4d')]==='sinch'){_0x2ddb05[_0x866b('0x60')]['from']=_0x329a44[_0x866b('0x60')][_0x866b('0x9b')][0x0]['from'];_0x2ddb05[_0x866b('0x60')][_0x866b('0x60')]=_0x329a44[_0x866b('0x60')]['notifications'][0x0][_0x866b('0x23')]['body'];_0x2ddb05[_0x866b('0x60')][_0x866b('0x99')]=_0x329a44[_0x866b('0x60')][_0x866b('0x9b')][0x0][_0x866b('0x9c')];}if(_0x2ddb05['body']['id']){delete _0x2ddb05[_0x866b('0x60')]['id'];}if(_[_0x866b('0x9d')](_0x2ddb05['body'][_0x866b('0x9e')])){throw new db['Sequelize'][(_0x866b('0x8e'))](_0x866b('0x9f'));}if(_['isNil'](_0x2ddb05[_0x866b('0x60')][_0x866b('0x60')])||_0x2ddb05[_0x866b('0x60')][_0x866b('0x60')]===''){throw new db[(_0x866b('0x8d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2ddb05[_0x866b('0x60')][_0x866b('0xa0')])){throw new db['Sequelize'][(_0x866b('0x8e'))](_0x866b('0xa1')+_0x9a7453);}if(!_[_0x866b('0xa2')](_0x9a7453,_0x2ddb05['body'][_0x866b('0xa0')])){throw new db['Sequelize'][(_0x866b('0x8e'))](_0x866b('0xa3')+_0x9a7453);}_0x174210[_0x2ddb05[_0x866b('0x60')][_0x866b('0xa0')]]=_0x2ddb05['body'][_0x866b('0x9e')];return db[_0x866b('0xa4')][_0x866b('0x58')]({'where':{'id':_0x2ddb05[_0x866b('0x83')][_0x866b('0x94')]},'include':[{'model':db[_0x866b('0x8c')],'as':_0x866b('0xa5'),'where':_0x174210,'limit':0x1,'order':[[_0x866b('0x92'),_0x866b('0xa6')]]}]});})[_0x866b('0x33')](handleEntityNotFound(_0x20528b,null))[_0x866b('0x33')](function(_0x127b75){if(_0x127b75){_0x2ddb05[_0x866b('0xa7')]=_[_0x866b('0xa8')](_0x127b75,[_0x866b('0xa5')]);if(_0x127b75['Contacts'][_0x866b('0x47')]){return _0x127b75[_0x866b('0xa5')][0x0];}var _0x1ab6ea=_[_0x866b('0x15')](_0x2ddb05['body'],{'firstName':_0x2ddb05['body'][_0x866b('0x9e')],'ListId':_0x127b75['id']});_0x1ab6ea[_0x2ddb05[_0x866b('0x60')]['mapKey']]=_0x2ddb05[_0x866b('0x60')]['from'];return db[_0x866b('0x8c')][_0x866b('0x59')](_0x1ab6ea,{'fields':_0x272258,'raw':!![]});}})['then'](handleEntityNotFound(_0x20528b,null))[_0x866b('0x33')](function(_0x3d81ae){if(_0x3d81ae){_0x2ddb05['contact']=_0x3d81ae;var _0x426d21={'ContactId':_0x3d81ae['id'],'phone':_0x2ddb05['body'][_0x866b('0x9e')],'WhatsappAccountId':_0x329a44[_0x866b('0x55')]['id']};var _0x4d42e8={'ContactId':_0x3d81ae['id'],'WhatsappAccountId':_0x329a44['params']['id'],'closed':![]};return db[_0x866b('0xa9')][_0x866b('0x58')]({'where':_0x4d42e8})[_0x866b('0x33')](function(_0x3163bc){if(_0x3163bc){return[_0x3163bc,![]];}return db[_0x866b('0xa9')]['create'](_0x426d21)[_0x866b('0x33')](function(_0x173bf2){return[_0x173bf2,!![]];});});}})['spread'](function(_0x2f39a5,_0x47b0d6){_0x2ddb05['interaction']=_0x2f39a5[_0x866b('0x34')]({'plain':!![]});_0x2ddb05[_0x866b('0xaa')][_0x866b('0xab')]=![];if(_0x47b0d6){if(_0x2ddb05[_0x866b('0x83')]['autoclose']){_0x2ddb05[_0x866b('0xac')]['push']({'id':0x0,'priority':_0x2ddb05['applications']['length']+0x1,'app':_0x866b('0xad'),'appdata':_0x866b('0xae'),'interval':_0x866b('0xaf')});}_0x2ddb05[_0x866b('0xaa')][_0x866b('0xab')]=!![];}return db[_0x866b('0xb0')][_0x866b('0x59')]({'phone':_0x2ddb05[_0x866b('0x60')][_0x866b('0x9e')],'messageId':_0x2ddb05[_0x866b('0x60')][_0x866b('0x99')],'body':_0x2ddb05[_0x866b('0x60')][_0x866b('0x60')],'WhatsappAccountId':_0x329a44[_0x866b('0x55')]['id'],'WhatsappInteractionId':_0x2f39a5['id'],'direction':'in','ContactId':_0x2f39a5[_0x866b('0xb1')],'AttachmentId':_0x2ddb05[_0x866b('0x60')]['AttachmentId']});})[_0x866b('0x33')](function(_0x1961c9){_0x2ddb05[_0x866b('0x23')]=_0x1961c9;if(_0x2ddb05[_0x866b('0xaa')][_0x866b('0xb2')]){return db[_0x866b('0x78')][_0x866b('0x58')]({'attributes':['id',_0x866b('0x38')],'where':{'id':_0x2ddb05['interaction'][_0x866b('0xb2')]}})[_0x866b('0x33')](function(_0x55efc8){if(_0x55efc8){_0x2ddb05[_0x866b('0xac')][_0x866b('0xb3')]({'id':0x0,'priority':0x0,'app':_0x866b('0xb4'),'appdata':_0x55efc8[_0x866b('0x38')]+','+(_0x2ddb05[_0x866b('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x866b('0xaf')});}return respondWithRpcPromise(_0x866b('0xb5'),_0x866b('0xb6'),_0x2ddb05);});}return respondWithRpcPromise('Start',_0x866b('0xb6'),_0x2ddb05);})[_0x866b('0x33')](function(_0x31422a){if(_0x31422a){var _0x1cba2f=0xc8;var _0x8aff1d=_0x866b('0xb7');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x8aff1d,_0x1cba2f,_0x866b('0xb8'));logger['debug'](_0x866b('0xb9'),_0x8aff1d,_0x1cba2f,_0x866b('0xb8'),JSON[_0x866b('0xba')](_0x31422a));if(_0x2ddb05[_0x866b('0x83')]['type']==='twilio'){return _0x20528b[_0x866b('0x27')](_0x1cba2f)['set']('Content-Type',_0x866b('0xbb'))[_0x866b('0x39')](_0x866b('0xbc'));}else{return _0x20528b[_0x866b('0x27')](_0x1cba2f)[_0x866b('0x29')](_0x31422a);}}});})[_0x866b('0x25')](handleError(_0x20528b,null));};exports[_0x866b('0x39')]=function(_0x31455e,_0x38094b,_0x1a6517){var _0x32b0d3,_0x101edb,_0xe7e08;if(_[_0x866b('0x9d')](_0x31455e[_0x866b('0x60')][_0x866b('0x60')])||_0x31455e[_0x866b('0x60')]['body']===''){throw new db[(_0x866b('0x8d'))]['ValidationError'](_0x866b('0xbd'));}if(_[_0x866b('0x9d')](_0x31455e['body']['to'])){throw new db[(_0x866b('0x8d'))][(_0x866b('0x8e'))]('to\x20is\x20mandatory');}_0x32b0d3=_0x31455e[_0x866b('0x60')]['to'];return db[_0x866b('0x3d')][_0x866b('0x58')]({'where':{'id':_0x31455e[_0x866b('0x55')]['id']},'include':[{'model':db[_0x866b('0xa4')],'as':_0x866b('0xbe'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x32b0d3},'limit':0x1,'order':[[_0x866b('0x92'),_0x866b('0xa6')]]}]}]})[_0x866b('0x33')](handleEntityNotFound(_0x38094b,null))['then'](function(_0x15ebc1){if(_0x15ebc1&&_0x15ebc1[_0x866b('0xbe')]){_0x101edb=_0x15ebc1[_0x866b('0x34')]({'plain':!![]});if(_0x101edb['List']&&_0x101edb[_0x866b('0xbe')][_0x866b('0xa5')][_0x866b('0x47')]){return _0x101edb[_0x866b('0xbe')][_0x866b('0xa5')][0x0];}return db[_0x866b('0x8c')][_0x866b('0x59')](_['defaults'](_0x31455e[_0x866b('0x60')],{'firstName':_0x32b0d3,'mobile':_0x32b0d3,'phone':_0x32b0d3,'ListId':_0x101edb[_0x866b('0x94')]}));}})[_0x866b('0x33')](handleEntityNotFound(_0x38094b,null))['then'](function(_0x480d21){if(_0x480d21){_0xe7e08=_0x480d21;return db[_0x866b('0xa9')][_0x866b('0x58')]({'where':{'ContactId':_0xe7e08['id'],'closed':![],'WhatsappAccountId':_0x101edb['id']}})[_0x866b('0x33')](function(_0x510ef1){if(_0x510ef1){return[_0x510ef1,![]];}return db[_0x866b('0xa9')]['create']({'UserId':_0x31455e[_0x866b('0x5a')]['id'],'ContactId':_0xe7e08['id'],'WhatsappAccountId':_0x101edb['id'],'phone':_0x32b0d3,'firstMsgDirection':'out','Messages':[_[_0x866b('0x50')](_0x31455e[_0x866b('0x60')],{'read':![],'body':_0x31455e[_0x866b('0x60')][_0x866b('0x60')],'phone':_0x32b0d3,'WhatsappAccountId':_0x101edb['id'],'UserId':_0x31455e['user']['id'],'ContactId':_0xe7e08['id']})]},{'include':[{'model':db[_0x866b('0xb0')],'as':_0x866b('0xbf')}]})[_0x866b('0x33')](function(_0x3d3444){return[_0x3d3444,!![]];});});}})[_0x866b('0x72')](function(_0x76683a,_0x355b50){if(_0x355b50){return _0x76683a;}return db['WhatsappMessage']['create'](_[_0x866b('0x50')](_0x31455e[_0x866b('0x60')],{'read':![],'body':_0x31455e[_0x866b('0x60')]['body'],'phone':_0x32b0d3,'WhatsappAccountId':_0x101edb['id'],'WhatsappInteractionId':_0x76683a['id'],'UserId':_0x31455e[_0x866b('0x5a')]['id'],'ContactId':_0xe7e08['id']}))[_0x866b('0x33')](function(_0x5f4558){_0x76683a['dataValues'][_0x866b('0xbf')]=[];_0x76683a['dataValues'][_0x866b('0xbf')][_0x866b('0xc0')](_0x5f4558[_0x866b('0xc1')]);return _0x76683a;});})[_0x866b('0x33')](respondWithResult(_0x38094b,null))['catch'](handleError(_0x38094b,null));}; \ No newline at end of file +var _0x59a8=['Applications','account','sinch','statuses','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','list','contact','WhatsappInteraction','interaction','autoclose','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','stringify','set','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','push','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','request\x20sent','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','save','update','destroy','get','WhatsappAccounts','name','send','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','WhatsappAccount','include','findAll','rows','catch','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','includeAll','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp'];(function(_0x19499a,_0x211fac){var _0x71ec31=function(_0x23531d){while(--_0x23531d){_0x19499a['push'](_0x19499a['shift']());}};_0x71ec31(++_0x211fac);}(_0x59a8,0x1c3));var _0x859a=function(_0x57294d,_0x502696){_0x57294d=_0x57294d-0x0;var _0xd1fcfe=_0x59a8[_0x57294d];return _0xd1fcfe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x859a('0x0'));var jsonpatch=require(_0x859a('0x1'));var rp=require(_0x859a('0x2'));var moment=require(_0x859a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x859a('0x4'));var util=require(_0x859a('0x5'));var path=require(_0x859a('0x6'));var sox=require('sox');var csv=require(_0x859a('0x7'));var ejs=require(_0x859a('0x8'));var fs=require('fs');var fs_extra=require(_0x859a('0x9'));var _=require(_0x859a('0xa'));var squel=require(_0x859a('0xb'));var crypto=require(_0x859a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x859a('0xd'));var toCsv=require(_0x859a('0x7'));var querystring=require(_0x859a('0xe'));var Papa=require('papaparse');var Redis=require(_0x859a('0xf'));var authService=require(_0x859a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x859a('0x11'));var hardwareService=require(_0x859a('0x12'));var logger=require(_0x859a('0x13'))(_0x859a('0x14'));var utils=require('../../config/utils');var config=require(_0x859a('0x15'));var licenseUtil=require(_0x859a('0x16'));var db=require(_0x859a('0x17'))['db'];config[_0x859a('0x18')]=_[_0x859a('0x19')](config[_0x859a('0x18')],{'host':_0x859a('0x1a'),'port':0x18eb});var socket=require(_0x859a('0x1b'))(new Redis(config['redis']));require(_0x859a('0x1c'))[_0x859a('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x859a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x509544,_0xa19df8,_0x53cc5d,_0x2084c2){return new BPromise(function(_0x448168,_0x364b0a){var _0x3ff634=_0x2084c2||client;return _0x3ff634['request'](_0x509544,_0x53cc5d)[_0x859a('0x1f')](function(_0x11a52b){logger[_0x859a('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0xa19df8,'request\x20sent');logger[_0x859a('0x21')](_0x859a('0x22'),_0xa19df8,'request\x20sent',JSON['stringify'](_0x11a52b));if(_0x11a52b[_0x859a('0x23')]){if(_0x11a52b[_0x859a('0x23')][_0x859a('0x24')]===0x1f4){logger[_0x859a('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0xa19df8,_0x11a52b[_0x859a('0x23')]['message']);return _0x364b0a(_0x11a52b[_0x859a('0x23')][_0x859a('0x25')]);}logger[_0x859a('0x23')](_0x859a('0x26'),_0xa19df8,_0x11a52b[_0x859a('0x23')]['message']);return _0x448168(_0x11a52b[_0x859a('0x23')][_0x859a('0x25')]);}else{logger['info'](_0x859a('0x26'),_0xa19df8,_0x859a('0x27'));_0x448168(_0x11a52b['result'][_0x859a('0x25')]);}})['catch'](function(_0x56e02f){logger[_0x859a('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0xa19df8,_0x56e02f);_0x364b0a(_0x56e02f);});});}function respondWithStatusCode(_0x21a9f1,_0x7eede7){_0x7eede7=_0x7eede7||0xcc;return function(_0x992242){if(_0x992242){return _0x21a9f1[_0x859a('0x28')](_0x7eede7);}return _0x21a9f1[_0x859a('0x29')](_0x7eede7)[_0x859a('0x2a')]();};}function respondWithResult(_0xaac985,_0x4ae5fe){_0x4ae5fe=_0x4ae5fe||0xc8;return function(_0x21fd83){if(_0x21fd83){return _0xaac985[_0x859a('0x29')](_0x4ae5fe)['json'](_0x21fd83);}};}function respondWithFilteredResult(_0x39a9da,_0x430a8a){return function(_0x26b757){if(_0x26b757){var _0x8ae141=typeof _0x430a8a['offset']===_0x859a('0x2b')&&typeof _0x430a8a['limit']==='undefined';var _0x543d44=_0x26b757[_0x859a('0x2c')];var _0x3e403d=_0x8ae141?0x0:_0x430a8a[_0x859a('0x2d')];var _0x26c014=_0x8ae141?_0x26b757[_0x859a('0x2c')]:_0x430a8a[_0x859a('0x2d')]+_0x430a8a[_0x859a('0x2e')];var _0x31bdca;if(_0x26c014>=_0x543d44){_0x26c014=_0x543d44;_0x31bdca=0xc8;}else{_0x31bdca=0xce;}_0x39a9da['status'](_0x31bdca);return _0x39a9da['set'](_0x859a('0x2f'),_0x3e403d+'-'+_0x26c014+'/'+_0x543d44)[_0x859a('0x30')](_0x26b757);}return null;};}function patchUpdates(_0x2802ec){return function(_0x3b5b18){try{jsonpatch['apply'](_0x3b5b18,_0x2802ec,!![]);}catch(_0x449837){return BPromise['reject'](_0x449837);}return _0x3b5b18[_0x859a('0x31')]();};}function saveUpdates(_0x55e68a,_0x1af01d){return function(_0x46b28d){if(_0x46b28d){return _0x46b28d[_0x859a('0x32')](_0x55e68a)[_0x859a('0x1f')](function(_0x37dcdf){return _0x37dcdf;});}return null;};}function removeEntity(_0x5bd551,_0x33664c){return function(_0x4cd2c9){if(_0x4cd2c9){return _0x4cd2c9[_0x859a('0x33')]()[_0x859a('0x1f')](function(){var _0x3b9c2c=_0x4cd2c9[_0x859a('0x34')]({'plain':!![]});var _0x66f902=_0x859a('0x35');return db['UserProfileResource'][_0x859a('0x33')]({'where':{'type':_0x66f902,'resourceId':_0x3b9c2c['id']}})[_0x859a('0x1f')](function(){return _0x4cd2c9;});})['then'](function(){_0x5bd551['status'](0xcc)[_0x859a('0x2a')]();});}};}function handleEntityNotFound(_0x13292d,_0x6abf23){return function(_0x4c3207){if(!_0x4c3207){_0x13292d['sendStatus'](0x194);}return _0x4c3207;};}function handleError(_0x5033e0,_0x5194e1){_0x5194e1=_0x5194e1||0x1f4;return function(_0x5cb481){logger[_0x859a('0x23')](_0x5cb481['stack']);if(_0x5cb481[_0x859a('0x36')]){delete _0x5cb481[_0x859a('0x36')];}_0x5033e0['status'](_0x5194e1)[_0x859a('0x37')](_0x5cb481);};}exports['index']=function(_0xb3d79a,_0x4f6e5f){var _0x537031={'include':[{'model':db[_0x859a('0x38')],'as':_0x859a('0x39')}]},_0x23e0fb={},_0x519a1a={'count':0x0,'rows':[]};var _0x249152=_['map'](db['WhatsappAccount'][_0x859a('0x3a')],function(_0x432be8){return{'name':_0x432be8[_0x859a('0x3b')],'type':_0x432be8[_0x859a('0x3c')][_0x859a('0x3d')]};});_0x23e0fb[_0x859a('0x3e')]=_['map'](_0x249152,'name');_0x23e0fb[_0x859a('0x3f')]=_[_0x859a('0x40')](_0xb3d79a[_0x859a('0x3f')]);_0x23e0fb[_0x859a('0x41')]=_['intersection'](_0x23e0fb[_0x859a('0x3e')],_0x23e0fb[_0x859a('0x3f')]);_0x537031[_0x859a('0x42')]=_['intersection'](_0x23e0fb[_0x859a('0x3e')],qs[_0x859a('0x43')](_0xb3d79a['query'][_0x859a('0x43')]));_0x537031['attributes']=_0x537031[_0x859a('0x42')]['length']?_0x537031['attributes']:_0x23e0fb[_0x859a('0x3e')];if(!_0xb3d79a[_0x859a('0x3f')][_0x859a('0x44')](_0x859a('0x45'))){_0x537031[_0x859a('0x2e')]=qs['limit'](_0xb3d79a[_0x859a('0x3f')]['limit']);_0x537031['offset']=qs[_0x859a('0x2d')](_0xb3d79a[_0x859a('0x3f')]['offset']);}_0x537031[_0x859a('0x46')]=qs['sort'](_0xb3d79a['query'][_0x859a('0x47')]);_0x537031['where']=qs[_0x859a('0x41')](_[_0x859a('0x48')](_0xb3d79a['query'],_0x23e0fb[_0x859a('0x41')]),_0x249152);if(_0xb3d79a[_0x859a('0x3f')][_0x859a('0x49')]){_0x537031[_0x859a('0x4a')]=_[_0x859a('0x4b')](_0x537031[_0x859a('0x4a')],{'$or':_[_0x859a('0x4c')](_0x249152,function(_0x5cd202){if(_0x5cd202[_0x859a('0x3c')]!==_0x859a('0x4d')){var _0x27abfe={};_0x27abfe[_0x5cd202[_0x859a('0x36')]]={'$like':'%'+_0xb3d79a[_0x859a('0x3f')][_0x859a('0x49')]+'%'};return _0x27abfe;}})});}_0x537031=_[_0x859a('0x4b')]({},_0x537031,_0xb3d79a[_0x859a('0x4e')]);var _0x4cf081={'where':_0x537031[_0x859a('0x4a')]};return db[_0x859a('0x4f')][_0x859a('0x2c')](_0x4cf081)[_0x859a('0x1f')](function(_0x526c20){_0x519a1a[_0x859a('0x2c')]=_0x526c20;if(_0xb3d79a['query']['includeAll']){_0x537031[_0x859a('0x50')]=[{'all':!![]}];}return db[_0x859a('0x4f')][_0x859a('0x51')](_0x537031);})['then'](function(_0x427937){_0x519a1a[_0x859a('0x52')]=_0x427937;return _0x519a1a;})[_0x859a('0x1f')](respondWithFilteredResult(_0x4f6e5f,_0x537031))[_0x859a('0x53')](handleError(_0x4f6e5f,null));};exports['show']=function(_0x523231,_0x1a047d){var _0xca986a={'raw':![],'where':{'id':_0x523231[_0x859a('0x54')]['id']},'include':[{'model':db[_0x859a('0x38')],'as':_0x859a('0x39')}]},_0x4faaaf={};_0x4faaaf[_0x859a('0x3e')]=_[_0x859a('0x40')](db[_0x859a('0x4f')][_0x859a('0x3a')]);_0x4faaaf[_0x859a('0x3f')]=_[_0x859a('0x40')](_0x523231[_0x859a('0x3f')]);_0x4faaaf[_0x859a('0x41')]=_[_0x859a('0x55')](_0x4faaaf[_0x859a('0x3e')],_0x4faaaf['query']);_0xca986a[_0x859a('0x42')]=_[_0x859a('0x55')](_0x4faaaf[_0x859a('0x3e')],qs[_0x859a('0x43')](_0x523231[_0x859a('0x3f')][_0x859a('0x43')]));_0xca986a[_0x859a('0x42')]=_0xca986a[_0x859a('0x42')][_0x859a('0x56')]?_0xca986a[_0x859a('0x42')]:_0x4faaaf[_0x859a('0x3e')];if(_0x523231[_0x859a('0x3f')]['includeAll']){_0xca986a['include']=[{'all':!![]}];}_0xca986a=_[_0x859a('0x4b')]({},_0xca986a,_0x523231[_0x859a('0x4e')]);return db[_0x859a('0x4f')][_0x859a('0x57')](_0xca986a)[_0x859a('0x1f')](handleEntityNotFound(_0x1a047d,null))[_0x859a('0x1f')](respondWithResult(_0x1a047d,null))[_0x859a('0x53')](handleError(_0x1a047d,null));};exports[_0x859a('0x58')]=function(_0x15ed96,_0x41e205){return db[_0x859a('0x4f')][_0x859a('0x58')](_0x15ed96[_0x859a('0x59')],{})[_0x859a('0x1f')](function(_0x4b526d){var _0x4d7a51=_0x15ed96[_0x859a('0x5a')]['get']({'plain':!![]});if(!_0x4d7a51)throw new Error(_0x859a('0x5b'));if(_0x4d7a51[_0x859a('0x5c')]===_0x859a('0x5a')){var _0x68734d=_0x4b526d[_0x859a('0x34')]({'plain':!![]});var _0x4adda4='WhatsappAccounts';return db['UserProfileSection'][_0x859a('0x57')]({'where':{'name':_0x4adda4,'userProfileId':_0x4d7a51[_0x859a('0x5d')]},'raw':!![]})['then'](function(_0x4a2d28){if(_0x4a2d28&&_0x4a2d28[_0x859a('0x5e')]===0x0){return db[_0x859a('0x5f')]['create']({'name':_0x68734d[_0x859a('0x36')],'resourceId':_0x68734d['id'],'type':_0x4a2d28[_0x859a('0x36')],'sectionId':_0x4a2d28['id']},{})[_0x859a('0x1f')](function(){return _0x4b526d;});}else{return _0x4b526d;}})[_0x859a('0x53')](function(_0x404402){logger[_0x859a('0x23')](_0x859a('0x60'),_0x404402);throw _0x404402;});}return _0x4b526d;})[_0x859a('0x1f')](respondWithResult(_0x41e205,0xc9))['catch'](handleError(_0x41e205,null));};exports[_0x859a('0x32')]=function(_0x3abc9a,_0x215995){if(_0x3abc9a['body']['id']){delete _0x3abc9a[_0x859a('0x59')]['id'];}return db[_0x859a('0x4f')]['find']({'where':{'id':_0x3abc9a['params']['id']},'include':[{'model':db[_0x859a('0x38')],'as':_0x859a('0x39')}]})[_0x859a('0x1f')](handleEntityNotFound(_0x215995,null))[_0x859a('0x1f')](saveUpdates(_0x3abc9a[_0x859a('0x59')],null))[_0x859a('0x1f')](respondWithResult(_0x215995,null))[_0x859a('0x53')](handleError(_0x215995,null));};exports[_0x859a('0x33')]=function(_0x3cd8a4,_0x5de339){return db[_0x859a('0x4f')][_0x859a('0x57')]({'where':{'id':_0x3cd8a4[_0x859a('0x54')]['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x5de339,null))[_0x859a('0x1f')](removeEntity(_0x5de339,null))[_0x859a('0x53')](handleError(_0x5de339,null));};exports['describe']=function(_0x39ca0f,_0xaf61df){return db[_0x859a('0x4f')][_0x859a('0x61')]()[_0x859a('0x1f')](respondWithResult(_0xaf61df,null))[_0x859a('0x53')](handleError(_0xaf61df,null));};exports[_0x859a('0x62')]=function(_0x3f6f50,_0x23c8eb,_0xaccae3){if(_0x3f6f50[_0x859a('0x59')]['id']){delete _0x3f6f50[_0x859a('0x59')]['id'];}return db['WhatsappAccount'][_0x859a('0x57')]({'where':{'id':_0x3f6f50[_0x859a('0x54')]['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x23c8eb,null))[_0x859a('0x1f')](function(_0x45e5bb){if(_0x45e5bb){_0x3f6f50[_0x859a('0x59')][_0x859a('0x63')]=_0x45e5bb['id'];return db[_0x859a('0x64')][_0x859a('0x58')](_0x3f6f50[_0x859a('0x59')]);}})[_0x859a('0x1f')](respondWithResult(_0x23c8eb,null))[_0x859a('0x53')](handleError(_0x23c8eb,null));};exports[_0x859a('0x65')]=function(_0x2d65dd,_0x2065f1,_0x46dd11){var _0x4739de={'raw':![],'where':{}};var _0x3358be={};var _0x2eb701={'count':0x0,'rows':[]};return db[_0x859a('0x4f')][_0x859a('0x66')]({'where':{'id':_0x2d65dd['params']['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x2065f1,null))[_0x859a('0x1f')](function(_0x260d7e){if(_0x260d7e){_0x3358be[_0x859a('0x3e')]=_[_0x859a('0x40')](db[_0x859a('0x64')][_0x859a('0x3a')]);_0x3358be[_0x859a('0x3f')]=_[_0x859a('0x40')](_0x2d65dd[_0x859a('0x3f')]);_0x3358be[_0x859a('0x41')]=_[_0x859a('0x55')](_0x3358be[_0x859a('0x3e')],_0x3358be[_0x859a('0x3f')]);_0x4739de[_0x859a('0x42')]=_[_0x859a('0x55')](_0x3358be[_0x859a('0x3e')],qs[_0x859a('0x43')](_0x2d65dd[_0x859a('0x3f')][_0x859a('0x43')]));_0x4739de[_0x859a('0x42')]=_0x4739de[_0x859a('0x42')][_0x859a('0x56')]?_0x4739de['attributes']:_0x3358be[_0x859a('0x3e')];if(!_0x2d65dd[_0x859a('0x3f')][_0x859a('0x44')](_0x859a('0x45'))){_0x4739de['limit']=qs[_0x859a('0x2e')](_0x2d65dd['query']['limit']);_0x4739de[_0x859a('0x2d')]=qs[_0x859a('0x2d')](_0x2d65dd[_0x859a('0x3f')][_0x859a('0x2d')]);}_0x4739de[_0x859a('0x46')]=qs[_0x859a('0x47')](_0x2d65dd[_0x859a('0x3f')][_0x859a('0x47')]);_0x4739de[_0x859a('0x4a')]=qs[_0x859a('0x41')](_[_0x859a('0x48')](_0x2d65dd[_0x859a('0x3f')],_0x3358be[_0x859a('0x41')]));_0x4739de['where']['WhatsappAccountId']=_0x260d7e['id'];if(_0x2d65dd['query'][_0x859a('0x49')]){_0x4739de[_0x859a('0x4a')]=_[_0x859a('0x4b')](_0x4739de[_0x859a('0x4a')],{'$or':_[_0x859a('0x4c')](_0x4739de[_0x859a('0x42')],function(_0x5b1a24){var _0x527218={};_0x527218[_0x5b1a24]={'$like':'%'+_0x2d65dd[_0x859a('0x3f')][_0x859a('0x49')]+'%'};return _0x527218;})});}_0x4739de=_[_0x859a('0x4b')]({},_0x4739de,_0x2d65dd['options']);return db['Disposition']['count']({'where':_0x4739de[_0x859a('0x4a')]})[_0x859a('0x1f')](function(_0x2f95ff){_0x2eb701[_0x859a('0x2c')]=_0x2f95ff;if(_0x2d65dd[_0x859a('0x3f')]['includeAll']){_0x4739de[_0x859a('0x50')]=[{'all':!![]}];}return db[_0x859a('0x64')][_0x859a('0x51')](_0x4739de);})[_0x859a('0x1f')](function(_0x187c21){_0x2eb701[_0x859a('0x52')]=_0x187c21;return _0x2eb701;});}})[_0x859a('0x1f')](respondWithFilteredResult(_0x2065f1,_0x4739de))['catch'](handleError(_0x2065f1,null));};exports['removeDispositions']=function(_0x1b98e2,_0x377484,_0x2df390){return db[_0x859a('0x4f')]['find']({'where':{'id':_0x1b98e2[_0x859a('0x54')]['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x377484,null))[_0x859a('0x1f')](function(_0x827456){if(_0x827456){return _0x827456[_0x859a('0x67')](_0x1b98e2[_0x859a('0x3f')][_0x859a('0x68')]);}})[_0x859a('0x1f')](respondWithStatusCode(_0x377484,null))['catch'](handleError(_0x377484,null));};exports[_0x859a('0x69')]=function(_0x5df639,_0x2ba8c5,_0x88e4f7){if(_0x5df639[_0x859a('0x59')]['id']){delete _0x5df639['body']['id'];}return db[_0x859a('0x4f')][_0x859a('0x57')]({'where':{'id':_0x5df639[_0x859a('0x54')]['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x2ba8c5,null))[_0x859a('0x1f')](function(_0x40df3a){if(_0x40df3a){_0x5df639[_0x859a('0x59')][_0x859a('0x63')]=_0x40df3a['id'];return db[_0x859a('0x6a')][_0x859a('0x58')](_0x5df639[_0x859a('0x59')]);}})[_0x859a('0x1f')](respondWithResult(_0x2ba8c5,null))[_0x859a('0x53')](handleError(_0x2ba8c5,null));};exports['getAnswers']=function(_0x2a5011,_0x5ce038,_0x47cbeb){var _0x138893={'raw':![],'where':{}};var _0x35b29d={};var _0x5163e0={'count':0x0,'rows':[]};return db[_0x859a('0x4f')][_0x859a('0x66')]({'where':{'id':_0x2a5011['params']['id']}})['then'](handleEntityNotFound(_0x5ce038,null))[_0x859a('0x1f')](function(_0x463cb1){if(_0x463cb1){_0x35b29d[_0x859a('0x3e')]=_[_0x859a('0x40')](db[_0x859a('0x6a')][_0x859a('0x3a')]);_0x35b29d[_0x859a('0x3f')]=_[_0x859a('0x40')](_0x2a5011[_0x859a('0x3f')]);_0x35b29d[_0x859a('0x41')]=_[_0x859a('0x55')](_0x35b29d[_0x859a('0x3e')],_0x35b29d['query']);_0x138893[_0x859a('0x42')]=_[_0x859a('0x55')](_0x35b29d[_0x859a('0x3e')],qs[_0x859a('0x43')](_0x2a5011[_0x859a('0x3f')][_0x859a('0x43')]));_0x138893[_0x859a('0x42')]=_0x138893['attributes']['length']?_0x138893[_0x859a('0x42')]:_0x35b29d['model'];if(!_0x2a5011[_0x859a('0x3f')][_0x859a('0x44')]('nolimit')){_0x138893[_0x859a('0x2e')]=qs[_0x859a('0x2e')](_0x2a5011[_0x859a('0x3f')][_0x859a('0x2e')]);_0x138893[_0x859a('0x2d')]=qs[_0x859a('0x2d')](_0x2a5011['query'][_0x859a('0x2d')]);}_0x138893[_0x859a('0x46')]=qs[_0x859a('0x47')](_0x2a5011[_0x859a('0x3f')][_0x859a('0x47')]);_0x138893['where']=qs['filters'](_['pick'](_0x2a5011[_0x859a('0x3f')],_0x35b29d[_0x859a('0x41')]));_0x138893['where']['WhatsappAccountId']=_0x463cb1['id'];if(_0x2a5011[_0x859a('0x3f')][_0x859a('0x49')]){_0x138893['where']=_[_0x859a('0x4b')](_0x138893['where'],{'$or':_[_0x859a('0x4c')](_0x138893['attributes'],function(_0x571dae){var _0x2a5a20={};_0x2a5a20[_0x571dae]={'$like':'%'+_0x2a5011['query'][_0x859a('0x49')]+'%'};return _0x2a5a20;})});}_0x138893=_[_0x859a('0x4b')]({},_0x138893,_0x2a5011[_0x859a('0x4e')]);return db[_0x859a('0x6a')][_0x859a('0x2c')]({'where':_0x138893['where']})['then'](function(_0x4450d0){_0x5163e0[_0x859a('0x2c')]=_0x4450d0;if(_0x2a5011[_0x859a('0x3f')][_0x859a('0x6b')]){_0x138893['include']=[{'all':!![]}];}return db[_0x859a('0x6a')][_0x859a('0x51')](_0x138893);})['then'](function(_0xe037f){_0x5163e0['rows']=_0xe037f;return _0x5163e0;});}})[_0x859a('0x1f')](respondWithFilteredResult(_0x5ce038,_0x138893))[_0x859a('0x53')](handleError(_0x5ce038,null));};exports[_0x859a('0x6c')]=function(_0x36519e,_0x5661b0,_0x1468c5){return db[_0x859a('0x4f')]['find']({'where':{'id':_0x36519e[_0x859a('0x54')]['id']}})['then'](handleEntityNotFound(_0x5661b0,null))[_0x859a('0x1f')](function(_0x12f30c){if(_0x12f30c){return _0x12f30c[_0x859a('0x6c')](_0x36519e[_0x859a('0x3f')][_0x859a('0x68')]);}})[_0x859a('0x1f')](respondWithStatusCode(_0x5661b0,null))[_0x859a('0x53')](handleError(_0x5661b0,null));};exports[_0x859a('0x6d')]=function(_0x1a509b,_0x1a9e33,_0x3dc46d){return db[_0x859a('0x4f')]['find']({'where':{'id':_0x1a509b['params']['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x1a9e33,null))['then'](function(_0x93f02c){if(_0x93f02c){return _0x93f02c[_0x859a('0x6d')](_0x1a509b['body'][_0x859a('0x68')],_[_0x859a('0x6e')](_0x1a509b[_0x859a('0x59')],[_0x859a('0x68'),'id'])||{})[_0x859a('0x6f')](function(_0x35ac6b){for(var _0x5e9c5b=0x0;_0x5e9c5b<_0x1a509b[_0x859a('0x59')][_0x859a('0x68')][_0x859a('0x56')];_0x5e9c5b+=0x1){socket[_0x859a('0x70')](_0x859a('0x71'),{'UserId':Number(_0x1a509b[_0x859a('0x59')][_0x859a('0x68')][_0x5e9c5b]),'WhatsappAccountId':Number(_0x1a509b['params']['id'])});}return _0x35ac6b;});}})[_0x859a('0x1f')](respondWithResult(_0x1a9e33,null))['catch'](handleError(_0x1a9e33,null));};exports['removeAgents']=function(_0x15ec55,_0x522652,_0x472114){return db['WhatsappAccount'][_0x859a('0x57')]({'where':{'id':_0x15ec55['params']['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x522652,null))[_0x859a('0x1f')](function(_0x28acf0){if(_0x28acf0){return _0x28acf0[_0x859a('0x72')](_0x15ec55['query'][_0x859a('0x68')])[_0x859a('0x1f')](function(){if(_[_0x859a('0x73')](_0x15ec55[_0x859a('0x3f')][_0x859a('0x68')])){for(var _0x54f571=0x0;_0x54f571<_0x15ec55[_0x859a('0x3f')][_0x859a('0x68')][_0x859a('0x56')];_0x54f571+=0x1){socket[_0x859a('0x70')](_0x859a('0x74'),{'UserId':Number(_0x15ec55['query']['ids'][_0x54f571]),'WhatsappAccountId':Number(_0x15ec55[_0x859a('0x54')]['id'])});}}else{socket[_0x859a('0x70')](_0x859a('0x74'),{'UserId':Number(_0x15ec55[_0x859a('0x3f')][_0x859a('0x68')]),'WhatsappAccountId':Number(_0x15ec55[_0x859a('0x54')]['id'])});}});}})[_0x859a('0x1f')](respondWithStatusCode(_0x522652,null))[_0x859a('0x53')](handleError(_0x522652,null));};exports[_0x859a('0x75')]=function(_0x48da7a,_0x367cf5,_0x1e3a20){var _0x4f438e={};var _0x342b09={};var _0x31114f;var _0x383862;return db[_0x859a('0x4f')]['findOne']({'where':{'id':_0x48da7a[_0x859a('0x54')]['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x367cf5,null))['then'](function(_0x2bfa06){if(_0x2bfa06){_0x31114f=_0x2bfa06;_0x342b09[_0x859a('0x3e')]=_[_0x859a('0x40')](db[_0x859a('0x76')]['rawAttributes']);_0x342b09[_0x859a('0x3f')]=_['keys'](_0x48da7a[_0x859a('0x3f')]);_0x342b09[_0x859a('0x41')]=_[_0x859a('0x55')](_0x342b09[_0x859a('0x3e')],_0x342b09['query']);_0x4f438e[_0x859a('0x42')]=_[_0x859a('0x55')](_0x342b09['model'],qs[_0x859a('0x43')](_0x48da7a[_0x859a('0x3f')][_0x859a('0x43')]));_0x4f438e[_0x859a('0x42')]=_0x4f438e[_0x859a('0x42')][_0x859a('0x56')]?_0x4f438e[_0x859a('0x42')]:_0x342b09[_0x859a('0x3e')];_0x4f438e[_0x859a('0x46')]=qs[_0x859a('0x47')](_0x48da7a[_0x859a('0x3f')]['sort']);_0x4f438e[_0x859a('0x4a')]=qs['filters'](_[_0x859a('0x48')](_0x48da7a['query'],_0x342b09[_0x859a('0x41')]));if(_0x48da7a['query'][_0x859a('0x49')]){_0x4f438e[_0x859a('0x4a')]=_[_0x859a('0x4b')](_0x4f438e[_0x859a('0x4a')],{'$or':_['map'](_0x4f438e[_0x859a('0x42')],function(_0x4d8c4a){var _0x303ddc={};_0x303ddc[_0x4d8c4a]={'$like':'%'+_0x48da7a[_0x859a('0x3f')][_0x859a('0x49')]+'%'};return _0x303ddc;})});}_0x4f438e=_[_0x859a('0x4b')]({},_0x4f438e,_0x48da7a[_0x859a('0x4e')]);return _0x31114f['getAgents'](_0x4f438e);}})[_0x859a('0x1f')](function(_0x33fd99){if(_0x33fd99){_0x383862=_0x33fd99[_0x859a('0x56')];if(!_0x48da7a[_0x859a('0x3f')]['hasOwnProperty'](_0x859a('0x45'))){_0x4f438e[_0x859a('0x2e')]=qs[_0x859a('0x2e')](_0x48da7a[_0x859a('0x3f')][_0x859a('0x2e')]);_0x4f438e[_0x859a('0x2d')]=qs['offset'](_0x48da7a[_0x859a('0x3f')]['offset']);}return _0x31114f['getAgents'](_0x4f438e);}})['then'](function(_0x5d5177){if(_0x5d5177){return _0x5d5177?{'count':_0x383862,'rows':_0x5d5177}:null;}})[_0x859a('0x1f')](respondWithResult(_0x367cf5,null))[_0x859a('0x53')](handleError(_0x367cf5,null));};exports[_0x859a('0x77')]=function(_0x9c2a95,_0x51f737){var _0x40d245=_0x9c2a95[_0x859a('0x54')]['id'];var _0x593bc6=_0x9c2a95[_0x859a('0x59')];var _0x51636f=0xc8;var _0xfa2c8=null;return db[_0x859a('0x78')]['transaction']({'isolationLevel':db[_0x859a('0x78')][_0x859a('0x79')][_0x859a('0x7a')][_0x859a('0x7b')]},function(_0x4e5fb3){return db[_0x859a('0x4f')]['findOne']({'where':{'id':_0x40d245},'transaction':_0x4e5fb3})[_0x859a('0x1f')](function(_0x44fec2){if(_0x44fec2){return db[_0x859a('0x7c')][_0x859a('0x33')]({'where':{'WhatsappAccountId':_0x40d245},'transaction':_0x4e5fb3})['then'](function(){var _0x12eabc=_[_0x859a('0x4c')](_0x593bc6,function(_0x1edcad){_0x1edcad[_0x859a('0x63')]=_0x40d245;return _0x1edcad;});return db[_0x859a('0x7c')]['bulkCreate'](_0x12eabc,{'transaction':_0x4e5fb3});});}else{_0x51636f=0x194;_0xfa2c8=[];}});})['then'](function(){if(_0x51636f!==0x194){return db['WhatsappApplication'][_0x859a('0x7d')]({'where':{'WhatsappAccountId':_0x40d245},'order':_0x859a('0x7e')})[_0x859a('0x1f')](function(_0x402c12){_0xfa2c8=_0x402c12;});}})['catch'](function(_0x6322c8){_0x51636f=0x1f4;logger[_0x859a('0x23')](_0x6322c8['stack']);if(_0x6322c8[_0x859a('0x36')]){delete _0x6322c8[_0x859a('0x36')];}_0xfa2c8=_0x6322c8;})[_0x859a('0x7f')](function(){if(_0xfa2c8===null){_0x51f737[_0x859a('0x28')](_0x51636f);}else{if(_0x51636f===0x1f4){_0x51f737[_0x859a('0x29')](_0x51636f)['send'](_0xfa2c8);}else{_0x51f737[_0x859a('0x29')](_0x51636f)[_0x859a('0x30')](_0xfa2c8);}}});};exports[_0x859a('0x80')]=function(_0x1cd355,_0x317943,_0x35234a){var _0x4652dd={};var _0x3bded8={};var _0xd070;var _0x29cd5a;return db[_0x859a('0x4f')][_0x859a('0x66')]({'where':{'id':_0x1cd355['params']['id']}})[_0x859a('0x1f')](handleEntityNotFound(_0x317943,null))[_0x859a('0x1f')](function(_0x3363c3){if(_0x3363c3){_0xd070=_0x3363c3;_0x3bded8[_0x859a('0x3e')]=_['keys'](db['WhatsappApplication'][_0x859a('0x3a')]);_0x3bded8['query']=_[_0x859a('0x40')](_0x1cd355['query']);_0x3bded8[_0x859a('0x41')]=_[_0x859a('0x55')](_0x3bded8['model'],_0x3bded8['query']);_0x4652dd[_0x859a('0x42')]=_[_0x859a('0x55')](_0x3bded8[_0x859a('0x3e')],qs[_0x859a('0x43')](_0x1cd355[_0x859a('0x3f')][_0x859a('0x43')]));_0x4652dd['attributes']=_0x4652dd[_0x859a('0x42')][_0x859a('0x56')]?_0x4652dd[_0x859a('0x42')]:_0x3bded8[_0x859a('0x3e')];_0x4652dd[_0x859a('0x46')]=qs[_0x859a('0x47')](_0x1cd355[_0x859a('0x3f')][_0x859a('0x47')]);_0x4652dd['where']=qs[_0x859a('0x41')](_[_0x859a('0x48')](_0x1cd355[_0x859a('0x3f')],_0x3bded8[_0x859a('0x41')]));if(_0x1cd355[_0x859a('0x3f')][_0x859a('0x49')]){_0x4652dd['where']=_[_0x859a('0x4b')](_0x4652dd[_0x859a('0x4a')],{'$or':_[_0x859a('0x4c')](_0x4652dd[_0x859a('0x42')],function(_0x5b43e9){var _0x585941={};_0x585941[_0x5b43e9]={'$like':'%'+_0x1cd355[_0x859a('0x3f')]['filter']+'%'};return _0x585941;})});}_0x4652dd=_['merge']({},_0x4652dd,_0x1cd355['options']);return _0xd070[_0x859a('0x80')](_0x4652dd);}})[_0x859a('0x1f')](function(_0x3a6252){if(_0x3a6252){_0x29cd5a=_0x3a6252[_0x859a('0x56')];if(!_0x1cd355['query'][_0x859a('0x44')](_0x859a('0x45'))){_0x4652dd['limit']=qs[_0x859a('0x2e')](_0x1cd355[_0x859a('0x3f')][_0x859a('0x2e')]);_0x4652dd[_0x859a('0x2d')]=qs[_0x859a('0x2d')](_0x1cd355[_0x859a('0x3f')][_0x859a('0x2d')]);}return _0xd070[_0x859a('0x80')](_0x4652dd);}})[_0x859a('0x1f')](function(_0x5c705f){if(_0x5c705f){return _0x5c705f?{'count':_0x29cd5a,'rows':_0x5c705f}:null;}})[_0x859a('0x1f')](respondWithResult(_0x317943,null))['catch'](handleError(_0x317943,null));};exports[_0x859a('0x81')]=function(_0x2ab9d8,_0x5b216b,_0x5508ab){var _0x5d88dc={'channel':_0x859a('0x82')};var _0x54f6cc=[];var _0x1be167=[];var _0x27977f={};return db[_0x859a('0x4f')][_0x859a('0x57')]({'where':{'id':_0x2ab9d8['params']['id']},'include':[{'model':db[_0x859a('0x7c')],'as':_0x859a('0x83')}]})[_0x859a('0x1f')](handleEntityNotFound(_0x5b216b,null))['then'](function(_0x9f9430){_0x5d88dc['account']=_0x9f9430;if(_0x5d88dc[_0x859a('0x84')]&&_0x5d88dc['account'][_0x859a('0x3c')]===_0x859a('0x85')&&_0x2ab9d8[_0x859a('0x59')][_0x859a('0x86')]){if(_0x2ab9d8['body'][_0x859a('0x86')]['length']===0x0)return;if(_0x2ab9d8[_0x859a('0x59')]['statuses'][0x0]['state']!=='read')return;return db[_0x859a('0x87')][_0x859a('0x32')]({'read':!![],'readAt':_0x2ab9d8[_0x859a('0x59')][_0x859a('0x86')][0x0][_0x859a('0x88')]},{'where':{'messageId':_0x2ab9d8['body'][_0x859a('0x86')][0x0][_0x859a('0x89')]},'individualHooks':!![]})[_0x859a('0x1f')](function(_0xfe243f){return _0x5b216b[_0x859a('0x29')](0xc8)[_0x859a('0x30')](_0xfe243f);});}_0x5d88dc[_0x859a('0x8a')]=_[_0x859a('0x8b')](_0x9f9430['Applications'],[_0x859a('0x7e')],[_0x859a('0x8c')]);if(_0x5d88dc['account'][_0x859a('0x83')]){delete _0x5d88dc[_0x859a('0x84')]['Applications'];}return db['CmContact']['describe']()[_0x859a('0x1f')](function(_0x367ae2){if(!_0x367ae2){throw new db[(_0x859a('0x8d'))][(_0x859a('0x8e'))](_0x859a('0x8f'));}_0x54f6cc=_['difference'](_['keys'](_0x367ae2),[_0x859a('0x90'),_0x859a('0x91')]);_0x1be167=_[_0x859a('0x92')](_[_0x859a('0x40')](_0x367ae2),[_0x859a('0x90'),_0x859a('0x91'),_0x859a('0x93'),_0x859a('0x94')]);_0x5d88dc[_0x859a('0x59')]={'mapKey':_0x859a('0x95')};if(_0x5d88dc[_0x859a('0x84')]&&_0x5d88dc[_0x859a('0x84')][_0x859a('0x3c')]===_0x859a('0x96')){_0x5d88dc[_0x859a('0x59')]['from']=_0x2ab9d8[_0x859a('0x59')]['From'][_0x859a('0x97')](_0x859a('0x98'),'');_0x5d88dc[_0x859a('0x59')]['body']=_0x2ab9d8[_0x859a('0x59')][_0x859a('0x99')];_0x5d88dc[_0x859a('0x59')][_0x859a('0x9a')]=_0x2ab9d8[_0x859a('0x59')][_0x859a('0x9b')];}if(_0x5d88dc[_0x859a('0x84')]&&_0x5d88dc[_0x859a('0x84')][_0x859a('0x3c')]===_0x859a('0x85')){_0x5d88dc[_0x859a('0x59')]['from']=_0x2ab9d8[_0x859a('0x59')]['notifications'][0x0][_0x859a('0x9c')];_0x5d88dc[_0x859a('0x59')]['body']=_0x2ab9d8['body'][_0x859a('0x9d')][0x0][_0x859a('0x25')][_0x859a('0x59')];_0x5d88dc[_0x859a('0x59')][_0x859a('0x9a')]=_0x2ab9d8[_0x859a('0x59')][_0x859a('0x9d')][0x0][_0x859a('0x89')];}if(_0x5d88dc[_0x859a('0x59')]['id']){delete _0x5d88dc[_0x859a('0x59')]['id'];}if(_['isNil'](_0x5d88dc['body'][_0x859a('0x9c')])){throw new db[(_0x859a('0x8d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x859a('0x9e')](_0x5d88dc[_0x859a('0x59')][_0x859a('0x59')])||_0x5d88dc[_0x859a('0x59')][_0x859a('0x59')]===''){throw new db[(_0x859a('0x8d'))][(_0x859a('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5d88dc[_0x859a('0x59')]['mapKey'])){throw new db['Sequelize'][(_0x859a('0x8e'))](_0x859a('0x9f')+_0x1be167);}if(!_['includes'](_0x1be167,_0x5d88dc[_0x859a('0x59')][_0x859a('0xa0')])){throw new db['Sequelize'][(_0x859a('0x8e'))](_0x859a('0xa1')+_0x1be167);}_0x27977f[_0x5d88dc['body'][_0x859a('0xa0')]]=_0x5d88dc[_0x859a('0x59')][_0x859a('0x9c')];return db['CmList'][_0x859a('0x57')]({'where':{'id':_0x5d88dc[_0x859a('0x84')]['ListId']},'include':[{'model':db[_0x859a('0xa2')],'as':_0x859a('0xa3'),'where':_0x27977f,'limit':0x1,'order':[[_0x859a('0x91'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5b216b,null))[_0x859a('0x1f')](function(_0x216814){if(_0x216814){_0x5d88dc[_0x859a('0xa4')]=_[_0x859a('0x6e')](_0x216814,[_0x859a('0xa3')]);if(_0x216814['Contacts'][_0x859a('0x56')]){return _0x216814['Contacts'][0x0];}var _0x54691a=_['defaults'](_0x5d88dc[_0x859a('0x59')],{'firstName':_0x5d88dc[_0x859a('0x59')]['from'],'ListId':_0x216814['id']});_0x54691a[_0x5d88dc['body'][_0x859a('0xa0')]]=_0x5d88dc[_0x859a('0x59')][_0x859a('0x9c')];return db['CmContact'][_0x859a('0x58')](_0x54691a,{'fields':_0x54f6cc,'raw':!![]});}})['then'](handleEntityNotFound(_0x5b216b,null))[_0x859a('0x1f')](function(_0xefdf86){if(_0xefdf86){_0x5d88dc[_0x859a('0xa5')]=_0xefdf86;var _0x11b3f0={'ContactId':_0xefdf86['id'],'phone':_0x5d88dc['body'][_0x859a('0x9c')],'WhatsappAccountId':_0x2ab9d8['params']['id']};var _0x23a5d2={'ContactId':_0xefdf86['id'],'WhatsappAccountId':_0x2ab9d8[_0x859a('0x54')]['id'],'closed':![]};return db[_0x859a('0xa6')][_0x859a('0x57')]({'where':_0x23a5d2})[_0x859a('0x1f')](function(_0x58c9a3){if(_0x58c9a3){return[_0x58c9a3,![]];}return db['WhatsappInteraction'][_0x859a('0x58')](_0x11b3f0)['then'](function(_0x5b223b){return[_0x5b223b,!![]];});});}})['spread'](function(_0x41a0a6,_0x3fd441){_0x5d88dc[_0x859a('0xa7')]=_0x41a0a6['get']({'plain':!![]});_0x5d88dc['interaction']['created']=![];if(_0x3fd441){if(_0x5d88dc[_0x859a('0x84')][_0x859a('0xa8')]){_0x5d88dc[_0x859a('0x8a')]['push']({'id':0x0,'priority':_0x5d88dc[_0x859a('0x8a')][_0x859a('0x56')]+0x1,'app':'close','appdata':_0x859a('0xa9'),'interval':_0x859a('0xaa')});}_0x5d88dc['interaction'][_0x859a('0xab')]=!![];}return db[_0x859a('0x87')][_0x859a('0x58')]({'phone':_0x5d88dc[_0x859a('0x59')][_0x859a('0x9c')],'messageId':_0x5d88dc['body'][_0x859a('0x9a')],'body':_0x5d88dc[_0x859a('0x59')]['body'],'WhatsappAccountId':_0x2ab9d8['params']['id'],'WhatsappInteractionId':_0x41a0a6['id'],'direction':'in','ContactId':_0x41a0a6[_0x859a('0xac')],'AttachmentId':_0x5d88dc[_0x859a('0x59')][_0x859a('0xad')]});})[_0x859a('0x1f')](function(_0x3b3968){_0x5d88dc[_0x859a('0x25')]=_0x3b3968;if(_0x5d88dc['interaction'][_0x859a('0xae')]){return db[_0x859a('0x76')][_0x859a('0x57')]({'attributes':['id',_0x859a('0x36')],'where':{'id':_0x5d88dc[_0x859a('0xa7')][_0x859a('0xae')]}})['then'](function(_0x439e37){if(_0x439e37){_0x5d88dc['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x439e37['name']+','+(_0x5d88dc[_0x859a('0x84')][_0x859a('0xaf')]||0xa),'interval':_0x859a('0xaa')});}return respondWithRpcPromise(_0x859a('0xb0'),_0x859a('0xb1'),_0x5d88dc);});}return respondWithRpcPromise(_0x859a('0xb0'),'startRouting',_0x5d88dc);})['then'](function(_0x4a476d){if(_0x4a476d){var _0x4f73bd=0xc8;var _0xb0dea0=_0x859a('0xb2');logger[_0x859a('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xb0dea0,_0x4f73bd,_0x859a('0xb3'));logger[_0x859a('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xb0dea0,_0x4f73bd,_0x859a('0xb3'),JSON[_0x859a('0xb4')](_0x4a476d));if(_0x5d88dc[_0x859a('0x84')][_0x859a('0x3c')]===_0x859a('0x96')){return _0x5b216b[_0x859a('0x29')](_0x4f73bd)[_0x859a('0xb5')](_0x859a('0xb6'),_0x859a('0xb7'))[_0x859a('0x37')](_0x859a('0xb8'));}else{return _0x5b216b[_0x859a('0x29')](_0x4f73bd)[_0x859a('0x30')](_0x4a476d);}}});})[_0x859a('0x53')](handleError(_0x5b216b,null));};exports[_0x859a('0x37')]=function(_0x67848e,_0x41ba0d,_0x36ee33){var _0x502f32,_0x5b1352,_0x27fd8b;if(_['isNil'](_0x67848e[_0x859a('0x59')]['body'])||_0x67848e[_0x859a('0x59')]['body']===''){throw new db[(_0x859a('0x8d'))][(_0x859a('0x8e'))](_0x859a('0xb9'));}if(_[_0x859a('0x9e')](_0x67848e[_0x859a('0x59')]['to'])){throw new db[(_0x859a('0x8d'))][(_0x859a('0x8e'))](_0x859a('0xba'));}_0x502f32=_0x67848e['body']['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x67848e[_0x859a('0x54')]['id']},'include':[{'model':db[_0x859a('0xbb')],'as':_0x859a('0xbc'),'include':[{'model':db['CmContact'],'as':_0x859a('0xa3'),'where':{'mobile':_0x502f32},'limit':0x1,'order':[['updatedAt',_0x859a('0xbd')]]}]}]})['then'](handleEntityNotFound(_0x41ba0d,null))[_0x859a('0x1f')](function(_0x1dfbc5){if(_0x1dfbc5&&_0x1dfbc5[_0x859a('0xbc')]){_0x5b1352=_0x1dfbc5[_0x859a('0x34')]({'plain':!![]});if(_0x5b1352[_0x859a('0xbc')]&&_0x5b1352[_0x859a('0xbc')][_0x859a('0xa3')]['length']){return _0x5b1352[_0x859a('0xbc')][_0x859a('0xa3')][0x0];}return db[_0x859a('0xa2')][_0x859a('0x58')](_['defaults'](_0x67848e['body'],{'firstName':_0x502f32,'mobile':_0x502f32,'phone':_0x502f32,'ListId':_0x5b1352[_0x859a('0x94')]}));}})[_0x859a('0x1f')](handleEntityNotFound(_0x41ba0d,null))[_0x859a('0x1f')](function(_0x16b65a){if(_0x16b65a){_0x27fd8b=_0x16b65a;return db[_0x859a('0xa6')][_0x859a('0x57')]({'where':{'ContactId':_0x27fd8b['id'],'closed':![],'WhatsappAccountId':_0x5b1352['id']}})[_0x859a('0x1f')](function(_0x5b0ba5){if(_0x5b0ba5){return[_0x5b0ba5,![]];}return db[_0x859a('0xa6')][_0x859a('0x58')]({'UserId':_0x67848e['user']['id'],'ContactId':_0x27fd8b['id'],'WhatsappAccountId':_0x5b1352['id'],'phone':_0x502f32,'firstMsgDirection':_0x859a('0xbe'),'Messages':[_['merge'](_0x67848e[_0x859a('0x59')],{'read':![],'body':_0x67848e[_0x859a('0x59')]['body'],'phone':_0x502f32,'WhatsappAccountId':_0x5b1352['id'],'UserId':_0x67848e[_0x859a('0x5a')]['id'],'ContactId':_0x27fd8b['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x859a('0xbf')}]})['then'](function(_0x2fbfaf){return[_0x2fbfaf,!![]];});});}})[_0x859a('0x6f')](function(_0xa0f75c,_0x36c96d){if(_0x36c96d){return _0xa0f75c;}return db['WhatsappMessage']['create'](_[_0x859a('0x4b')](_0x67848e[_0x859a('0x59')],{'read':![],'body':_0x67848e[_0x859a('0x59')]['body'],'phone':_0x502f32,'WhatsappAccountId':_0x5b1352['id'],'WhatsappInteractionId':_0xa0f75c['id'],'UserId':_0x67848e['user']['id'],'ContactId':_0x27fd8b['id']}))['then'](function(_0x276a32){_0xa0f75c['dataValues'][_0x859a('0xbf')]=[];_0xa0f75c[_0x859a('0xc0')][_0x859a('0xbf')][_0x859a('0xc1')](_0x276a32['dataValues']);return _0xa0f75c;});})[_0x859a('0x1f')](respondWithResult(_0x41ba0d,null))[_0x859a('0x53')](handleError(_0x41ba0d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3d28531..357a8cb 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 _0x930f=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x529bd2,_0x967f08){var _0x1a0972=function(_0x12d1c2){while(--_0x12d1c2){_0x529bd2['push'](_0x529bd2['shift']());}};_0x1a0972(++_0x967f08);}(_0x930f,0x147));var _0xf930=function(_0x4d6766,_0x33b8f1){_0x4d6766=_0x4d6766-0x0;var _0x4b171c=_0x930f[_0x4d6766];return _0x4b171c;};'use strict';var EventEmitter=require(_0xf930('0x0'));var WhatsappAccount=require(_0xf930('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf930('0x2')](0x0);var events={'afterCreate':_0xf930('0x3'),'afterUpdate':'update','afterDestroy':_0xf930('0x4')};function emitEvent(_0x5d7730){return function(_0x33b318,_0xcee7d2,_0x330e50){WhatsappAccountEvents[_0xf930('0x5')](_0x5d7730+':'+_0x33b318['id'],_0x33b318);WhatsappAccountEvents[_0xf930('0x5')](_0x5d7730,_0x33b318);_0x330e50(null);};}for(var e in events){if(events[_0xf930('0x6')](e)){var event=events[e];WhatsappAccount[_0xf930('0x7')](e,emitEvent(event));}}module[_0xf930('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x64f5=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5ca1f6,_0x42713c){var _0x2225ac=function(_0x372397){while(--_0x372397){_0x5ca1f6['push'](_0x5ca1f6['shift']());}};_0x2225ac(++_0x42713c);}(_0x64f5,0xcd));var _0x564f=function(_0x6af1b1,_0x4ccf9e){_0x6af1b1=_0x6af1b1-0x0;var _0x139dae=_0x64f5[_0x6af1b1];return _0x139dae;};'use strict';var EventEmitter=require(_0x564f('0x0'));var WhatsappAccount=require(_0x564f('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x564f('0x2')](0x0);var events={'afterCreate':_0x564f('0x3'),'afterUpdate':_0x564f('0x4'),'afterDestroy':_0x564f('0x5')};function emitEvent(_0x1cc922){return function(_0x21d068,_0x1fea5f,_0x2cbdd7){WhatsappAccountEvents[_0x564f('0x6')](_0x1cc922+':'+_0x21d068['id'],_0x21d068);WhatsappAccountEvents[_0x564f('0x6')](_0x1cc922,_0x21d068);_0x2cbdd7(null);};}for(var e in events){if(events[_0x564f('0x7')](e)){var event=events[e];WhatsappAccount[_0x564f('0x8')](e,emitEvent(event));}}module[_0x564f('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index cb6c4a8..dab14e9 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 _0x6a29=['./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6a29,0x6c));var _0x96a2=function(_0x5f0183,_0x8b3cf){_0x5f0183=_0x5f0183-0x0;var _0x45653d=_0x6a29[_0x5f0183];return _0x45653d;};'use strict';var _=require(_0x96a2('0x0'));var util=require(_0x96a2('0x1'));var logger=require('../../config/logger')(_0x96a2('0x2'));var moment=require(_0x96a2('0x3'));var BPromise=require(_0x96a2('0x4'));var rp=require(_0x96a2('0x5'));var fs=require('fs');var path=require(_0x96a2('0x6'));var rimraf=require(_0x96a2('0x7'));var config=require(_0x96a2('0x8'));var attributes=require(_0x96a2('0x9'));module['exports']=function(_0x555bca,_0xec60e9){return _0x555bca[_0x96a2('0xa')](_0x96a2('0xb'),attributes,{'tableName':_0x96a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd06=['request-promise','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird'];(function(_0x8b97b4,_0x382038){var _0x2ed10e=function(_0x21842e){while(--_0x21842e){_0x8b97b4['push'](_0x8b97b4['shift']());}};_0x2ed10e(++_0x382038);}(_0xbd06,0x11b));var _0x6bd0=function(_0x123e60,_0xca8bb3){_0x123e60=_0x123e60-0x0;var _0xe8bb3e=_0xbd06[_0x123e60];return _0xe8bb3e;};'use strict';var _=require(_0x6bd0('0x0'));var util=require(_0x6bd0('0x1'));var logger=require('../../config/logger')(_0x6bd0('0x2'));var moment=require(_0x6bd0('0x3'));var BPromise=require(_0x6bd0('0x4'));var rp=require(_0x6bd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bd0('0x6'));var config=require(_0x6bd0('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x6bd0('0x8')]=function(_0x27685d,_0x129d9c){return _0x27685d[_0x6bd0('0x9')](_0x6bd0('0xa'),attributes,{'tableName':_0x6bd0('0xb'),'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 3d97c21..298de81 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 _0xfc8f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x188610,_0x48fe4a){var _0x4acec6=function(_0x14a6ea){while(--_0x14a6ea){_0x188610['push'](_0x188610['shift']());}};_0x4acec6(++_0x48fe4a);}(_0xfc8f,0xa0));var _0xffc8=function(_0x43d4f8,_0x50783e){_0x43d4f8=_0x43d4f8-0x0;var _0x1c7b84=_0xfc8f[_0x43d4f8];return _0x1c7b84;};'use strict';var _=require(_0xffc8('0x0'));var util=require(_0xffc8('0x1'));var moment=require(_0xffc8('0x2'));var BPromise=require(_0xffc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffc8('0x4'));var db=require(_0xffc8('0x5'))['db'];var utils=require(_0xffc8('0x6'));var logger=require(_0xffc8('0x7'))(_0xffc8('0x8'));var config=require(_0xffc8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xffc8('0xa')]['http']({'port':0x232a});config['redis']=_[_0xffc8('0xb')](config[_0xffc8('0xc')],{'host':_0xffc8('0xd'),'port':0x18eb});var socket=require(_0xffc8('0xe'))(new Redis(config['redis']));require(_0xffc8('0xf'))[_0xffc8('0x10')](socket);function respondWithRpcPromise(_0x47df96,_0x4f69f2,_0x59f254){return new BPromise(function(_0x4a1354,_0x21230a){return client[_0xffc8('0x11')](_0x47df96,_0x59f254)[_0xffc8('0x12')](function(_0x10d770){logger[_0xffc8('0x13')](_0xffc8('0x14'),_0x4f69f2,_0xffc8('0x15'));logger[_0xffc8('0x16')](_0xffc8('0x17'),_0x4f69f2,_0xffc8('0x15'),JSON[_0xffc8('0x18')](_0x10d770));if(_0x10d770['error']){if(_0x10d770[_0xffc8('0x19')][_0xffc8('0x1a')]===0x1f4){logger[_0xffc8('0x19')](_0xffc8('0x14'),_0x4f69f2,_0x10d770['error']['message']);return _0x21230a(_0x10d770[_0xffc8('0x19')][_0xffc8('0x1b')]);}logger[_0xffc8('0x19')](_0xffc8('0x14'),_0x4f69f2,_0x10d770[_0xffc8('0x19')]['message']);return _0x4a1354(_0x10d770[_0xffc8('0x19')][_0xffc8('0x1b')]);}else{logger[_0xffc8('0x13')](_0xffc8('0x14'),_0x4f69f2,_0xffc8('0x15'));_0x4a1354(_0x10d770[_0xffc8('0x1c')][_0xffc8('0x1b')]);}})[_0xffc8('0x1d')](function(_0x4b9ac9){logger[_0xffc8('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x4f69f2,_0x4b9ac9);_0x21230a(_0x4b9ac9);});});}exports[_0xffc8('0x1e')]=function(_0x2baba7){var _0x252aab=this;return new Promise(function(_0x106514,_0xc3ad2e){return db[_0xffc8('0x1f')][_0xffc8('0x20')]({'raw':_0x2baba7[_0xffc8('0x21')]?_0x2baba7['options'][_0xffc8('0x22')]===undefined?!![]:![]:!![],'where':_0x2baba7['options']?_0x2baba7[_0xffc8('0x21')][_0xffc8('0x23')]||null:null,'attributes':_0x2baba7['options']?_0x2baba7[_0xffc8('0x21')][_0xffc8('0x24')]||null:null,'include':_0x2baba7[_0xffc8('0x21')]?_0x2baba7[_0xffc8('0x21')][_0xffc8('0x25')]?_['map'](_0x2baba7[_0xffc8('0x21')][_0xffc8('0x25')],function(_0x3beb60){return{'model':db[_0x3beb60['model']],'as':_0x3beb60['as'],'attributes':_0x3beb60['attributes'],'include':_0x3beb60[_0xffc8('0x25')]?_[_0xffc8('0x26')](_0x3beb60[_0xffc8('0x25')],function(_0x1115ae){return{'model':db[_0x1115ae[_0xffc8('0x27')]],'as':_0x1115ae['as'],'attributes':_0x1115ae[_0xffc8('0x24')],'include':_0x1115ae[_0xffc8('0x25')]?_[_0xffc8('0x26')](_0x1115ae[_0xffc8('0x25')],function(_0x48e931){return{'model':db[_0x48e931[_0xffc8('0x27')]],'as':_0x48e931['as'],'attributes':_0x48e931[_0xffc8('0x24')]};}):[]};}):[]};}):[]:[]})[_0xffc8('0x12')](function(_0x393caa){logger[_0xffc8('0x13')](_0xffc8('0x1e'),_0x2baba7);logger[_0xffc8('0x16')](_0xffc8('0x1e'),_0x2baba7,JSON[_0xffc8('0x18')](_0x393caa));_0x106514(_0x393caa);})[_0xffc8('0x1d')](function(_0xcc295){logger[_0xffc8('0x19')](_0xffc8('0x1e'),_0xcc295['message'],_0x2baba7);_0xc3ad2e(_0x252aab[_0xffc8('0x19')](0x1f4,_0xcc295[_0xffc8('0x1b')]));});});}; \ No newline at end of file +var _0x8c28=['defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10f79a,_0x520cfa){var _0xf84f98=function(_0x5c77bb){while(--_0x5c77bb){_0x10f79a['push'](_0x10f79a['shift']());}};_0xf84f98(++_0x520cfa);}(_0x8c28,0x1c8));var _0x88c2=function(_0x218e81,_0xc77e8c){_0x218e81=_0x218e81-0x0;var _0x53877c=_0x8c28[_0x218e81];return _0x53877c;};'use strict';var _=require(_0x88c2('0x0'));var util=require(_0x88c2('0x1'));var moment=require(_0x88c2('0x2'));var BPromise=require(_0x88c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88c2('0x4'));var db=require(_0x88c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88c2('0x6'))(_0x88c2('0x7'));var config=require(_0x88c2('0x8'));var jayson=require(_0x88c2('0x9'));var client=jayson[_0x88c2('0xa')][_0x88c2('0xb')]({'port':0x232a});config['redis']=_[_0x88c2('0xc')](config[_0x88c2('0xd')],{'host':_0x88c2('0xe'),'port':0x18eb});var socket=require(_0x88c2('0xf'))(new Redis(config[_0x88c2('0xd')]));require(_0x88c2('0x10'))[_0x88c2('0x11')](socket);function respondWithRpcPromise(_0x22a76f,_0x2d4d53,_0x1624fc){return new BPromise(function(_0x31146e,_0x56aa98){return client[_0x88c2('0x12')](_0x22a76f,_0x1624fc)['then'](function(_0x17c1e5){logger[_0x88c2('0x13')](_0x88c2('0x14'),_0x2d4d53,_0x88c2('0x15'));logger[_0x88c2('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2d4d53,_0x88c2('0x15'),JSON[_0x88c2('0x17')](_0x17c1e5));if(_0x17c1e5['error']){if(_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x19')]===0x1f4){logger[_0x88c2('0x18')](_0x88c2('0x14'),_0x2d4d53,_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);return _0x56aa98(_0x17c1e5['error'][_0x88c2('0x1a')]);}logger[_0x88c2('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x2d4d53,_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);return _0x31146e(_0x17c1e5[_0x88c2('0x18')][_0x88c2('0x1a')]);}else{logger['info'](_0x88c2('0x14'),_0x2d4d53,_0x88c2('0x15'));_0x31146e(_0x17c1e5[_0x88c2('0x1b')][_0x88c2('0x1a')]);}})[_0x88c2('0x1c')](function(_0xd3e60c){logger['error'](_0x88c2('0x14'),_0x2d4d53,_0xd3e60c);_0x56aa98(_0xd3e60c);});});}exports[_0x88c2('0x1d')]=function(_0x419311){var _0x22cef4=this;return new Promise(function(_0x2e2ce4,_0x25e651){return db['WhatsappAccount'][_0x88c2('0x1e')]({'raw':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')][_0x88c2('0x20')]===undefined?!![]:![]:!![],'where':_0x419311['options']?_0x419311[_0x88c2('0x1f')][_0x88c2('0x21')]||null:null,'attributes':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')]['attributes']||null:null,'include':_0x419311[_0x88c2('0x1f')]?_0x419311[_0x88c2('0x1f')][_0x88c2('0x22')]?_[_0x88c2('0x23')](_0x419311[_0x88c2('0x1f')][_0x88c2('0x22')],function(_0x50eabb){return{'model':db[_0x50eabb[_0x88c2('0x24')]],'as':_0x50eabb['as'],'attributes':_0x50eabb[_0x88c2('0x25')],'include':_0x50eabb[_0x88c2('0x22')]?_[_0x88c2('0x23')](_0x50eabb[_0x88c2('0x22')],function(_0x45cfdb){return{'model':db[_0x45cfdb[_0x88c2('0x24')]],'as':_0x45cfdb['as'],'attributes':_0x45cfdb[_0x88c2('0x25')],'include':_0x45cfdb[_0x88c2('0x22')]?_[_0x88c2('0x23')](_0x45cfdb[_0x88c2('0x22')],function(_0x18e3f4){return{'model':db[_0x18e3f4[_0x88c2('0x24')]],'as':_0x18e3f4['as'],'attributes':_0x18e3f4[_0x88c2('0x25')]};}):[]};}):[]};}):[]:[]})[_0x88c2('0x26')](function(_0x157bc8){logger[_0x88c2('0x13')](_0x88c2('0x1d'),_0x419311);logger[_0x88c2('0x16')](_0x88c2('0x1d'),_0x419311,JSON[_0x88c2('0x17')](_0x157bc8));_0x2e2ce4(_0x157bc8);})[_0x88c2('0x1c')](function(_0x92cbad){logger['error'](_0x88c2('0x1d'),_0x92cbad['message'],_0x419311);_0x25e651(_0x22cef4[_0x88c2('0x18')](0x1f4,_0x92cbad['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e47e6b4..6ee81f5 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 _0x562e=['save','remove','update','removeListener','whatsappAccount:','./whatsappAccount.events'];(function(_0x5ed1e6,_0x49000a){var _0x40ddc3=function(_0x632780){while(--_0x632780){_0x5ed1e6['push'](_0x5ed1e6['shift']());}};_0x40ddc3(++_0x49000a);}(_0x562e,0x131));var _0xe562=function(_0xd31fbc,_0x43222a){_0xd31fbc=_0xd31fbc-0x0;var _0x5c9d58=_0x562e[_0xd31fbc];return _0x5c9d58;};'use strict';var WhatsappAccountEvents=require(_0xe562('0x0'));var events=[_0xe562('0x1'),_0xe562('0x2'),_0xe562('0x3')];function createListener(_0x4fd070,_0x222b3f){return function(_0x3a8a35){_0x222b3f['emit'](_0x4fd070,_0x3a8a35);};}function removeListener(_0x36560e,_0x4ed407){return function(){WhatsappAccountEvents[_0xe562('0x4')](_0x36560e,_0x4ed407);};}exports['register']=function(_0x73418c){for(var _0x32cea0=0x0,_0x507c69=events['length'];_0x32cea0<_0x507c69;_0x32cea0++){var _0x1ccde9=events[_0x32cea0];var _0x52f8e0=createListener(_0xe562('0x5')+_0x1ccde9,_0x73418c);WhatsappAccountEvents['on'](_0x1ccde9,_0x52f8e0);}}; \ No newline at end of file +var _0x72af=['emit','removeListener','register','length','./whatsappAccount.events','save','remove','update'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0x72af,0xac));var _0xf72a=function(_0x3d74c6,_0x1476fc){_0x3d74c6=_0x3d74c6-0x0;var _0x58c199=_0x72af[_0x3d74c6];return _0x58c199;};'use strict';var WhatsappAccountEvents=require(_0xf72a('0x0'));var events=[_0xf72a('0x1'),_0xf72a('0x2'),_0xf72a('0x3')];function createListener(_0x12851d,_0x11210a){return function(_0x1f01c9){_0x11210a[_0xf72a('0x4')](_0x12851d,_0x1f01c9);};}function removeListener(_0x49ba01,_0x1a5889){return function(){WhatsappAccountEvents[_0xf72a('0x5')](_0x49ba01,_0x1a5889);};}exports[_0xf72a('0x6')]=function(_0x70cb69){for(var _0x55f167=0x0,_0x59e572=events[_0xf72a('0x7')];_0x55f167<_0x59e572;_0x55f167++){var _0x465024=events[_0x55f167];var _0x394699=createListener('whatsappAccount:'+_0x465024,_0x70cb69);WhatsappAccountEvents['on'](_0x465024,_0x394699);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index c901145..cc13ca1 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 _0xf497=['../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x305c2f,_0x306f52){var _0x1ad4fc=function(_0x39f06e){while(--_0x39f06e){_0x305c2f['push'](_0x305c2f['shift']());}};_0x1ad4fc(++_0x306f52);}(_0xf497,0xa4));var _0x7f49=function(_0x2e845e,_0x36ef70){_0x2e845e=_0x2e845e-0x0;var _0x52c24e=_0xf497[_0x2e845e];return _0x52c24e;};'use strict';var multer=require(_0x7f49('0x0'));var util=require('util');var path=require(_0x7f49('0x1'));var timeout=require(_0x7f49('0x2'));var express=require(_0x7f49('0x3'));var router=express[_0x7f49('0x4')]();var fs_extra=require(_0x7f49('0x5'));var auth=require(_0x7f49('0x6'));var interaction=require(_0x7f49('0x7'));var config=require('../../config/environment');var controller=require(_0x7f49('0x8'));router[_0x7f49('0x9')]('/',auth[_0x7f49('0xa')](),controller[_0x7f49('0xb')]);router[_0x7f49('0x9')](_0x7f49('0xc'),auth['isAuthenticated'](),controller[_0x7f49('0xd')]);router['post']('/',auth[_0x7f49('0xa')](),controller[_0x7f49('0xe')]);router[_0x7f49('0xf')](_0x7f49('0xc'),auth[_0x7f49('0xa')](),controller[_0x7f49('0x10')]);router[_0x7f49('0x11')](_0x7f49('0xc'),auth[_0x7f49('0xa')](),controller[_0x7f49('0x12')]);module['exports']=router; \ No newline at end of file +var _0x37b7=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x37b7,0x156));var _0x737b=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x37b7[_0x324012];return _0x435cf2;};'use strict';var multer=require(_0x737b('0x0'));var util=require('util');var path=require(_0x737b('0x1'));var timeout=require(_0x737b('0x2'));var express=require(_0x737b('0x3'));var router=express[_0x737b('0x4')]();var fs_extra=require(_0x737b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x737b('0x6'));var controller=require('./whatsappApplication.controller');router[_0x737b('0x7')]('/',auth[_0x737b('0x8')](),controller['index']);router[_0x737b('0x7')](_0x737b('0x9'),auth[_0x737b('0x8')](),controller[_0x737b('0xa')]);router[_0x737b('0xb')]('/',auth[_0x737b('0x8')](),controller[_0x737b('0xc')]);router[_0x737b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x737b('0xe')]);router['delete']('/:id',auth[_0x737b('0x8')](),controller[_0x737b('0xf')]);module[_0x737b('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 896abcd..8f3cfff 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 _0x7a4f=['noop','TEXT','sequelize','exports','STRING'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x7a4f,0x156));var _0xf7a4=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x7a4f[_0xe0b81f];return _0x290e5e;};'use strict';var Sequelize=require(_0xf7a4('0x0'));module[_0xf7a4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf7a4('0x2')],'allowNull':![],'defaultValue':_0xf7a4('0x3')},'appdata':{'type':Sequelize[_0xf7a4('0x4')]()},'description':{'type':Sequelize[_0xf7a4('0x2')]},'interval':{'type':Sequelize[_0xf7a4('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7672=['STRING','*,*,*,*','INTEGER'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x7672,0x89));var _0x2767=function(_0x1a2ad0,_0x3dbd7d){_0x1a2ad0=_0x1a2ad0-0x0;var _0x37946e=_0x7672[_0x1a2ad0];return _0x37946e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2767('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2767('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2767('0x1')]},'interval':{'type':Sequelize[_0x2767('0x1')],'defaultValue':_0x2767('0x2')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 21f9ffe..bf11c61 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 _0xc14a=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','WhatsappApplication','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','map','query','keys','filters','model'];(function(_0xd2bf1f,_0x2b84fe){var _0x1d32eb=function(_0x1e5e38){while(--_0x1e5e38){_0xd2bf1f['push'](_0xd2bf1f['shift']());}};_0x1d32eb(++_0x2b84fe);}(_0xc14a,0xa9));var _0xac14=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc14a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xac14('0x0'));var rimraf=require(_0xac14('0x1'));var zipdir=require(_0xac14('0x2'));var jsonpatch=require(_0xac14('0x3'));var rp=require(_0xac14('0x4'));var moment=require('moment');var BPromise=require(_0xac14('0x5'));var Mustache=require(_0xac14('0x6'));var util=require('util');var path=require(_0xac14('0x7'));var sox=require('sox');var csv=require(_0xac14('0x8'));var ejs=require(_0xac14('0x9'));var fs=require('fs');var fs_extra=require(_0xac14('0xa'));var _=require('lodash');var squel=require(_0xac14('0xb'));var crypto=require(_0xac14('0xc'));var jsforce=require(_0xac14('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xac14('0x8'));var querystring=require(_0xac14('0xe'));var Papa=require(_0xac14('0xf'));var Redis=require(_0xac14('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac14('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac14('0x12'));var logger=require(_0xac14('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xac14('0x14'));var licenseUtil=require(_0xac14('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d522,_0x394952){_0x394952=_0x394952||0xcc;return function(_0x5920f7){if(_0x5920f7){return _0x11d522[_0xac14('0x16')](_0x394952);}return _0x11d522['status'](_0x394952)[_0xac14('0x17')]();};}function respondWithResult(_0x3a171d,_0x44e80d){_0x44e80d=_0x44e80d||0xc8;return function(_0x5a80ed){if(_0x5a80ed){return _0x3a171d['status'](_0x44e80d)[_0xac14('0x18')](_0x5a80ed);}};}function respondWithFilteredResult(_0x5c00df,_0xe50537){return function(_0x497be2){if(_0x497be2){var _0x270284=typeof _0xe50537[_0xac14('0x19')]===_0xac14('0x1a')&&typeof _0xe50537[_0xac14('0x1b')]===_0xac14('0x1a');var _0x4d7f22=_0x497be2[_0xac14('0x1c')];var _0x219ee6=_0x270284?0x0:_0xe50537[_0xac14('0x19')];var _0x1682b1=_0x270284?_0x497be2[_0xac14('0x1c')]:_0xe50537[_0xac14('0x19')]+_0xe50537[_0xac14('0x1b')];var _0x572d08;if(_0x1682b1>=_0x4d7f22){_0x1682b1=_0x4d7f22;_0x572d08=0xc8;}else{_0x572d08=0xce;}_0x5c00df[_0xac14('0x1d')](_0x572d08);return _0x5c00df[_0xac14('0x1e')](_0xac14('0x1f'),_0x219ee6+'-'+_0x1682b1+'/'+_0x4d7f22)[_0xac14('0x18')](_0x497be2);}return null;};}function patchUpdates(_0x14b2a0){return function(_0x52d9d2){try{jsonpatch['apply'](_0x52d9d2,_0x14b2a0,!![]);}catch(_0x1cbb67){return BPromise[_0xac14('0x20')](_0x1cbb67);}return _0x52d9d2['save']();};}function saveUpdates(_0x44a533,_0x492f37){return function(_0x528406){if(_0x528406){return _0x528406['update'](_0x44a533)[_0xac14('0x21')](function(_0x4c6580){return _0x4c6580;});}return null;};}function removeEntity(_0x1b863e,_0x8e5979){return function(_0x272b46){if(_0x272b46){return _0x272b46[_0xac14('0x22')]()['then'](function(){_0x1b863e[_0xac14('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186a10,_0xa2c069){return function(_0x536eb3){if(!_0x536eb3){_0x186a10[_0xac14('0x16')](0x194);}return _0x536eb3;};}function handleError(_0x34f641,_0x3d2eeb){_0x3d2eeb=_0x3d2eeb||0x1f4;return function(_0x1c581b){logger[_0xac14('0x23')](_0x1c581b[_0xac14('0x24')]);if(_0x1c581b['name']){delete _0x1c581b[_0xac14('0x25')];}_0x34f641['status'](_0x3d2eeb)['send'](_0x1c581b);};}exports['index']=function(_0x23a5b3,_0x25b07e){var _0x2f6914={},_0x53584e={},_0x4b72e0={'count':0x0,'rows':[]};var _0x506837=_['map'](db['WhatsappApplication'][_0xac14('0x26')],function(_0x568024){return{'name':_0x568024[_0xac14('0x27')],'type':_0x568024[_0xac14('0x28')][_0xac14('0x29')]};});_0x53584e['model']=_[_0xac14('0x2a')](_0x506837,'name');_0x53584e[_0xac14('0x2b')]=_[_0xac14('0x2c')](_0x23a5b3[_0xac14('0x2b')]);_0x53584e[_0xac14('0x2d')]=_['intersection'](_0x53584e[_0xac14('0x2e')],_0x53584e[_0xac14('0x2b')]);_0x2f6914[_0xac14('0x2f')]=_[_0xac14('0x30')](_0x53584e[_0xac14('0x2e')],qs[_0xac14('0x31')](_0x23a5b3['query']['fields']));_0x2f6914['attributes']=_0x2f6914[_0xac14('0x2f')][_0xac14('0x32')]?_0x2f6914[_0xac14('0x2f')]:_0x53584e[_0xac14('0x2e')];if(!_0x23a5b3['query'][_0xac14('0x33')](_0xac14('0x34'))){_0x2f6914[_0xac14('0x1b')]=qs['limit'](_0x23a5b3[_0xac14('0x2b')][_0xac14('0x1b')]);_0x2f6914['offset']=qs['offset'](_0x23a5b3['query'][_0xac14('0x19')]);}_0x2f6914[_0xac14('0x35')]=qs[_0xac14('0x36')](_0x23a5b3[_0xac14('0x2b')][_0xac14('0x36')]);_0x2f6914[_0xac14('0x37')]=qs[_0xac14('0x2d')](_[_0xac14('0x38')](_0x23a5b3['query'],_0x53584e[_0xac14('0x2d')]),_0x506837);if(_0x23a5b3[_0xac14('0x2b')]['filter']){_0x2f6914[_0xac14('0x37')]=_[_0xac14('0x39')](_0x2f6914[_0xac14('0x37')],{'$or':_[_0xac14('0x2a')](_0x506837,function(_0x561a70){if(_0x561a70[_0xac14('0x28')]!==_0xac14('0x3a')){var _0x296644={};_0x296644[_0x561a70[_0xac14('0x25')]]={'$like':'%'+_0x23a5b3[_0xac14('0x2b')]['filter']+'%'};return _0x296644;}})});}_0x2f6914=_[_0xac14('0x39')]({},_0x2f6914,_0x23a5b3[_0xac14('0x3b')]);var _0x116a5a={'where':_0x2f6914[_0xac14('0x37')]};return db['WhatsappApplication'][_0xac14('0x1c')](_0x116a5a)['then'](function(_0x35f359){_0x4b72e0[_0xac14('0x1c')]=_0x35f359;if(_0x23a5b3[_0xac14('0x2b')][_0xac14('0x3c')]){_0x2f6914[_0xac14('0x3d')]=[{'all':!![]}];}return db[_0xac14('0x3e')][_0xac14('0x3f')](_0x2f6914);})['then'](function(_0x375712){_0x4b72e0[_0xac14('0x40')]=_0x375712;return _0x4b72e0;})[_0xac14('0x21')](respondWithFilteredResult(_0x25b07e,_0x2f6914))['catch'](handleError(_0x25b07e,null));};exports[_0xac14('0x41')]=function(_0x46b7ea,_0x515b58){var _0x160621={'raw':!![],'where':{'id':_0x46b7ea[_0xac14('0x42')]['id']}},_0x34932e={};_0x34932e[_0xac14('0x2e')]=_['keys'](db[_0xac14('0x3e')][_0xac14('0x26')]);_0x34932e[_0xac14('0x2b')]=_[_0xac14('0x2c')](_0x46b7ea['query']);_0x34932e['filters']=_[_0xac14('0x30')](_0x34932e[_0xac14('0x2e')],_0x34932e[_0xac14('0x2b')]);_0x160621[_0xac14('0x2f')]=_[_0xac14('0x30')](_0x34932e['model'],qs[_0xac14('0x31')](_0x46b7ea[_0xac14('0x2b')]['fields']));_0x160621[_0xac14('0x2f')]=_0x160621[_0xac14('0x2f')]['length']?_0x160621[_0xac14('0x2f')]:_0x34932e['model'];if(_0x46b7ea[_0xac14('0x2b')][_0xac14('0x3c')]){_0x160621[_0xac14('0x3d')]=[{'all':!![]}];}_0x160621=_[_0xac14('0x39')]({},_0x160621,_0x46b7ea[_0xac14('0x3b')]);return db[_0xac14('0x3e')][_0xac14('0x43')](_0x160621)[_0xac14('0x21')](handleEntityNotFound(_0x515b58,null))[_0xac14('0x21')](respondWithResult(_0x515b58,null))[_0xac14('0x44')](handleError(_0x515b58,null));};exports[_0xac14('0x45')]=function(_0x43d34e,_0x1ba97c){return db['WhatsappApplication'][_0xac14('0x45')](_0x43d34e[_0xac14('0x46')],{})[_0xac14('0x21')](respondWithResult(_0x1ba97c,0xc9))[_0xac14('0x44')](handleError(_0x1ba97c,null));};exports[_0xac14('0x47')]=function(_0x19b9a2,_0x24764b){if(_0x19b9a2[_0xac14('0x46')]['id']){delete _0x19b9a2[_0xac14('0x46')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x19b9a2[_0xac14('0x42')]['id']}})[_0xac14('0x21')](handleEntityNotFound(_0x24764b,null))[_0xac14('0x21')](saveUpdates(_0x19b9a2['body'],null))[_0xac14('0x21')](respondWithResult(_0x24764b,null))[_0xac14('0x44')](handleError(_0x24764b,null));};exports[_0xac14('0x22')]=function(_0x5d817a,_0x33b158){return db[_0xac14('0x3e')]['find']({'where':{'id':_0x5d817a[_0xac14('0x42')]['id']}})[_0xac14('0x21')](handleEntityNotFound(_0x33b158,null))[_0xac14('0x21')](removeEntity(_0x33b158,null))['catch'](handleError(_0x33b158,null));}; \ No newline at end of file +var _0x6dc0=['../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','then','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x597e7f,_0x4ab7a3){var _0x6f4f93=function(_0x2e92f8){while(--_0x2e92f8){_0x597e7f['push'](_0x597e7f['shift']());}};_0x6f4f93(++_0x4ab7a3);}(_0x6dc0,0xb6));var _0x06dc=function(_0x58dbee,_0x4be613){_0x58dbee=_0x58dbee-0x0;var _0x3fdc98=_0x6dc0[_0x58dbee];return _0x3fdc98;};'use strict';var emlformat=require(_0x06dc('0x0'));var rimraf=require(_0x06dc('0x1'));var zipdir=require(_0x06dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06dc('0x3'));var moment=require(_0x06dc('0x4'));var BPromise=require(_0x06dc('0x5'));var Mustache=require(_0x06dc('0x6'));var util=require('util');var path=require(_0x06dc('0x7'));var sox=require(_0x06dc('0x8'));var csv=require('to-csv');var ejs=require(_0x06dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06dc('0xa'));var squel=require(_0x06dc('0xb'));var crypto=require(_0x06dc('0xc'));var jsforce=require(_0x06dc('0xd'));var deskjs=require(_0x06dc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x06dc('0xf'));var authService=require(_0x06dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x06dc('0x11'));var hardwareService=require(_0x06dc('0x12'));var logger=require(_0x06dc('0x13'))(_0x06dc('0x14'));var utils=require('../../config/utils');var config=require(_0x06dc('0x15'));var licenseUtil=require(_0x06dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527806,_0x534c07){_0x534c07=_0x534c07||0xcc;return function(_0x4f086f){if(_0x4f086f){return _0x527806[_0x06dc('0x17')](_0x534c07);}return _0x527806['status'](_0x534c07)['end']();};}function respondWithResult(_0x4874ce,_0x196cfd){_0x196cfd=_0x196cfd||0xc8;return function(_0x47753d){if(_0x47753d){return _0x4874ce[_0x06dc('0x18')](_0x196cfd)['json'](_0x47753d);}};}function respondWithFilteredResult(_0x183302,_0x1d92c2){return function(_0x145a07){if(_0x145a07){var _0x3da2c5=typeof _0x1d92c2['offset']===_0x06dc('0x19')&&typeof _0x1d92c2[_0x06dc('0x1a')]===_0x06dc('0x19');var _0x2478b9=_0x145a07[_0x06dc('0x1b')];var _0x51df31=_0x3da2c5?0x0:_0x1d92c2[_0x06dc('0x1c')];var _0x1d6ec8=_0x3da2c5?_0x145a07[_0x06dc('0x1b')]:_0x1d92c2[_0x06dc('0x1c')]+_0x1d92c2[_0x06dc('0x1a')];var _0x152ed2;if(_0x1d6ec8>=_0x2478b9){_0x1d6ec8=_0x2478b9;_0x152ed2=0xc8;}else{_0x152ed2=0xce;}_0x183302['status'](_0x152ed2);return _0x183302['set'](_0x06dc('0x1d'),_0x51df31+'-'+_0x1d6ec8+'/'+_0x2478b9)['json'](_0x145a07);}return null;};}function patchUpdates(_0x21c8c3){return function(_0x5088f3){try{jsonpatch[_0x06dc('0x1e')](_0x5088f3,_0x21c8c3,!![]);}catch(_0x369c60){return BPromise[_0x06dc('0x1f')](_0x369c60);}return _0x5088f3[_0x06dc('0x20')]();};}function saveUpdates(_0x8aaf2,_0x427f39){return function(_0x577284){if(_0x577284){return _0x577284['update'](_0x8aaf2)[_0x06dc('0x21')](function(_0x426260){return _0x426260;});}return null;};}function removeEntity(_0x56c345,_0x95dab2){return function(_0x5eab9b){if(_0x5eab9b){return _0x5eab9b['destroy']()['then'](function(){_0x56c345['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd3e42b,_0x5edc7b){return function(_0xfa043e){if(!_0xfa043e){_0xd3e42b['sendStatus'](0x194);}return _0xfa043e;};}function handleError(_0x52afcf,_0xa85ffc){_0xa85ffc=_0xa85ffc||0x1f4;return function(_0x26bbfe){logger['error'](_0x26bbfe['stack']);if(_0x26bbfe[_0x06dc('0x22')]){delete _0x26bbfe['name'];}_0x52afcf[_0x06dc('0x18')](_0xa85ffc)[_0x06dc('0x23')](_0x26bbfe);};}exports[_0x06dc('0x24')]=function(_0xfd5611,_0x1d98b8){var _0x31f5cd={},_0x164554={},_0x33ff4c={'count':0x0,'rows':[]};var _0x3f0e2d=_[_0x06dc('0x25')](db[_0x06dc('0x26')][_0x06dc('0x27')],function(_0x43e689){return{'name':_0x43e689['fieldName'],'type':_0x43e689['type'][_0x06dc('0x28')]};});_0x164554[_0x06dc('0x29')]=_[_0x06dc('0x25')](_0x3f0e2d,_0x06dc('0x22'));_0x164554[_0x06dc('0x2a')]=_[_0x06dc('0x2b')](_0xfd5611[_0x06dc('0x2a')]);_0x164554[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],_0x164554['query']);_0x31f5cd[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0xfd5611[_0x06dc('0x2a')]['fields']));_0x31f5cd[_0x06dc('0x2e')]=_0x31f5cd[_0x06dc('0x2e')][_0x06dc('0x30')]?_0x31f5cd['attributes']:_0x164554[_0x06dc('0x29')];if(!_0xfd5611[_0x06dc('0x2a')]['hasOwnProperty'](_0x06dc('0x31'))){_0x31f5cd[_0x06dc('0x1a')]=qs['limit'](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1a')]);_0x31f5cd[_0x06dc('0x1c')]=qs[_0x06dc('0x1c')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1c')]);}_0x31f5cd[_0x06dc('0x32')]=qs[_0x06dc('0x33')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x33')]);_0x31f5cd['where']=qs['filters'](_['pick'](_0xfd5611[_0x06dc('0x2a')],_0x164554[_0x06dc('0x2c')]),_0x3f0e2d);if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]){_0x31f5cd['where']=_['merge'](_0x31f5cd[_0x06dc('0x35')],{'$or':_[_0x06dc('0x25')](_0x3f0e2d,function(_0xdc718a){if(_0xdc718a[_0x06dc('0x36')]!==_0x06dc('0x37')){var _0xe65d69={};_0xe65d69[_0xdc718a[_0x06dc('0x22')]]={'$like':'%'+_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]+'%'};return _0xe65d69;}})});}_0x31f5cd=_[_0x06dc('0x38')]({},_0x31f5cd,_0xfd5611[_0x06dc('0x39')]);var _0x11e2f6={'where':_0x31f5cd[_0x06dc('0x35')]};return db[_0x06dc('0x26')][_0x06dc('0x1b')](_0x11e2f6)[_0x06dc('0x21')](function(_0x3e9434){_0x33ff4c[_0x06dc('0x1b')]=_0x3e9434;if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x31f5cd['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0x06dc('0x3b')](_0x31f5cd);})[_0x06dc('0x21')](function(_0x4250fd){_0x33ff4c[_0x06dc('0x3c')]=_0x4250fd;return _0x33ff4c;})[_0x06dc('0x21')](respondWithFilteredResult(_0x1d98b8,_0x31f5cd))['catch'](handleError(_0x1d98b8,null));};exports[_0x06dc('0x3d')]=function(_0x37ec58,_0x64f6f3){var _0x59d4a0={'raw':!![],'where':{'id':_0x37ec58[_0x06dc('0x3e')]['id']}},_0x164684={};_0x164684['model']=_[_0x06dc('0x2b')](db[_0x06dc('0x26')][_0x06dc('0x27')]);_0x164684[_0x06dc('0x2a')]=_['keys'](_0x37ec58['query']);_0x164684[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],_0x164684['query']);_0x59d4a0[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0x37ec58[_0x06dc('0x2a')]['fields']));_0x59d4a0[_0x06dc('0x2e')]=_0x59d4a0['attributes']['length']?_0x59d4a0[_0x06dc('0x2e')]:_0x164684[_0x06dc('0x29')];if(_0x37ec58[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x59d4a0[_0x06dc('0x3f')]=[{'all':!![]}];}_0x59d4a0=_['merge']({},_0x59d4a0,_0x37ec58[_0x06dc('0x39')]);return db[_0x06dc('0x26')][_0x06dc('0x40')](_0x59d4a0)[_0x06dc('0x21')](handleEntityNotFound(_0x64f6f3,null))[_0x06dc('0x21')](respondWithResult(_0x64f6f3,null))[_0x06dc('0x41')](handleError(_0x64f6f3,null));};exports[_0x06dc('0x42')]=function(_0x6a5800,_0x1081a9){return db[_0x06dc('0x26')][_0x06dc('0x42')](_0x6a5800['body'],{})[_0x06dc('0x21')](respondWithResult(_0x1081a9,0xc9))[_0x06dc('0x41')](handleError(_0x1081a9,null));};exports['update']=function(_0xb9c6a2,_0x39e42a){if(_0xb9c6a2[_0x06dc('0x43')]['id']){delete _0xb9c6a2['body']['id'];}return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0xb9c6a2['params']['id']}})['then'](handleEntityNotFound(_0x39e42a,null))['then'](saveUpdates(_0xb9c6a2[_0x06dc('0x43')],null))[_0x06dc('0x21')](respondWithResult(_0x39e42a,null))[_0x06dc('0x41')](handleError(_0x39e42a,null));};exports['destroy']=function(_0x5dd2c2,_0x1d759b){return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0x5dd2c2[_0x06dc('0x3e')]['id']}})[_0x06dc('0x21')](handleEntityNotFound(_0x1d759b,null))['then'](removeEntity(_0x1d759b,null))[_0x06dc('0x41')](handleError(_0x1d759b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index d73919f..47d72d3 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 _0x6334=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4'];(function(_0x2a3efd,_0x5a516a){var _0x1ec226=function(_0x1f5996){while(--_0x1f5996){_0x2a3efd['push'](_0x2a3efd['shift']());}};_0x1ec226(++_0x5a516a);}(_0x6334,0x119));var _0x4633=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x6334[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4633('0x6'));var rimraf=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var attributes=require(_0x4633('0x9'));module[_0x4633('0xa')]=function(_0x6493dc,_0x175e14){return _0x6493dc['define'](_0x4633('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4633('0xc'),'collate':_0x4633('0xd')});}; \ No newline at end of file +var _0xf25a=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x25dd3b,_0x27e043){var _0x3084aa=function(_0x45f3c1){while(--_0x45f3c1){_0x25dd3b['push'](_0x25dd3b['shift']());}};_0x3084aa(++_0x27e043);}(_0xf25a,0x195));var _0xaf25=function(_0x1163ac,_0xcb94be){_0x1163ac=_0x1163ac-0x0;var _0x219795=_0xf25a[_0x1163ac];return _0x219795;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var moment=require(_0xaf25('0x3'));var BPromise=require(_0xaf25('0x4'));var rp=require(_0xaf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf25('0x6'));var config=require(_0xaf25('0x7'));var attributes=require(_0xaf25('0x8'));module['exports']=function(_0x49281b,_0x30eaae){return _0x49281b['define']('WhatsappApplication',attributes,{'tableName':_0xaf25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf25('0xa'),'collate':_0xaf25('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 0d8a2a1..51e0d30 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x008c,0x188));var _0xc008=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x008c[_0x4a3acd];return _0x3efdaa;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x5c12,0x188));var _0x25c1=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x5c12[_0x1304c6];return _0x2e6654;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index da7cd81..e1e5575 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 _0x9206=['whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x48186a,_0x228fb5){var _0x57fdd1=function(_0x58a273){while(--_0x58a273){_0x48186a['push'](_0x48186a['shift']());}};_0x57fdd1(++_0x228fb5);}(_0x9206,0x176));var _0x6920=function(_0x2678c9,_0x57bd25){_0x2678c9=_0x2678c9-0x0;var _0x6b9c15=_0x9206[_0x2678c9];return _0x6b9c15;};'use strict';var multer=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var path=require(_0x6920('0x2'));var timeout=require(_0x6920('0x3'));var express=require(_0x6920('0x4'));var router=express[_0x6920('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x6920('0x8')](),controller['index']);router[_0x6920('0x9')](_0x6920('0xa'),auth[_0x6920('0x8')](),controller[_0x6920('0xb')]);router['get']('/:id',auth[_0x6920('0x8')](),controller[_0x6920('0xc')]);router[_0x6920('0x9')](_0x6920('0xd'),auth[_0x6920('0x8')](),controller[_0x6920('0xe')]);router[_0x6920('0x9')](_0x6920('0xf'),auth[_0x6920('0x8')](),controller[_0x6920('0x10')]);router[_0x6920('0x11')]('/',auth[_0x6920('0x8')](),controller[_0x6920('0x12')]);router['post']('/:id/messages',auth[_0x6920('0x8')](),controller[_0x6920('0x13')]);router['post'](_0x6920('0x14'),auth[_0x6920('0x8')](),interaction[_0x6920('0x15')](_0x6920('0x16'),_0x6920('0x17')),controller['addTags']);router[_0x6920('0x18')](_0x6920('0x19'),auth[_0x6920('0x8')](),interaction[_0x6920('0x15')](_0x6920('0x16'),_0x6920('0x1a')),controller[_0x6920('0x1b')]);router[_0x6920('0x1c')](_0x6920('0x19'),auth[_0x6920('0x8')](),interaction[_0x6920('0x15')](_0x6920('0x16'),_0x6920('0x1d')),controller[_0x6920('0x1e')]);router[_0x6920('0x1c')]('/:id/tags',auth[_0x6920('0x8')](),controller[_0x6920('0x1f')]);module[_0x6920('0x20')]=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe'];(function(_0x482399,_0x1aaea5){var _0x19df90=function(_0x899434){while(--_0x899434){_0x482399['push'](_0x482399['shift']());}};_0x19df90(++_0x1aaea5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x113adf,_0x28cfff){_0x113adf=_0x113adf-0x0;var _0x262b72=_0x9c5a[_0x113adf];return _0x262b72;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['get'](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller['getMessages']);router['get'](_0xa9c5('0xe'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xf')]);router[_0xa9c5('0x10')]('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x10')](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x12')]);router['post'](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x16')),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0x19'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')]('whatsapp',_0xa9c5('0x1a')),controller[_0xa9c5('0x1b')]);router[_0xa9c5('0x1c')]('/:id',auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x1d')),controller[_0xa9c5('0x1e')]);router[_0xa9c5('0x1c')](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x1f')]);module[_0xa9c5('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 97a88ea..a6edb4e 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 _0xcf71=['ENUM','out','sequelize','moment','exports','BOOLEAN','STRING','DATE'];(function(_0x31be33,_0x55945d){var _0x1ae217=function(_0x33fb3e){while(--_0x33fb3e){_0x31be33['push'](_0x31be33['shift']());}};_0x1ae217(++_0x55945d);}(_0xcf71,0xba));var _0x1cf7=function(_0x7f5123,_0x3062c5){_0x7f5123=_0x7f5123-0x0;var _0x10a02a=_0xcf71[_0x7f5123];return _0x10a02a;};'use strict';var Sequelize=require(_0x1cf7('0x0'));var moment=require(_0x1cf7('0x1'));module[_0x1cf7('0x2')]={'closed':{'type':Sequelize[_0x1cf7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1cf7('0x4')]},'secondDisposition':{'type':Sequelize[_0x1cf7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1cf7('0x4')]},'note':{'type':Sequelize[_0x1cf7('0x4')]},'phone':{'type':Sequelize[_0x1cf7('0x4')]},'read1stAt':{'type':Sequelize[_0x1cf7('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x1cf7('0x6')]('in',_0x1cf7('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cf7('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x1cf7('0x6')]('in',_0x1cf7('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1cf7('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x38e4=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x38e4,0x9e));var _0x438e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x38e4[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x438e('0x0'));var moment=require(_0x438e('0x1'));module['exports']={'closed':{'type':Sequelize[_0x438e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x438e('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x438e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x438e('0x4')]},'note':{'type':Sequelize[_0x438e('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x438e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x438e('0x5')]('in',_0x438e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x438e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x438e('0x5')]('in',_0x438e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index bc0a690..47c1af7 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 _0xcdde=['includeAll','include','merge','create','body','find','describe','addMessage','WhatsappMessage','ids','omit','findOne','keys','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','Owner','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','read','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','params','model','WhatsappInteraction','filters','intersection','fields','attributes','length'];(function(_0xe323e3,_0x110473){var _0x208a43=function(_0x18695c){while(--_0x18695c){_0xe323e3['push'](_0xe323e3['shift']());}};_0x208a43(++_0x110473);}(_0xcdde,0x1c1));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xecdd('0x0'));var BPromise=require(_0xecdd('0x1'));var util=require(_0xecdd('0x2'));var path=require(_0xecdd('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xecdd('0x4'));var Redis=require(_0xecdd('0x5'));var interaction=require(_0xecdd('0x6'));var qs=require(_0xecdd('0x7'));var pdf=require(_0xecdd('0x8'));var logger=require(_0xecdd('0x9'))(_0xecdd('0xa'));var config=require(_0xecdd('0xb'));var db=require(_0xecdd('0xc'))['db'];config['redis']=_[_0xecdd('0xd')](config[_0xecdd('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xecdd('0xf'))(new Redis(config[_0xecdd('0xe')]));require(_0xecdd('0x10'))['register'](socket);function respondWithStatusCode(_0x53f783,_0x32ece2){_0x32ece2=_0x32ece2||0xcc;return function(_0x46862d){if(_0x46862d){return _0x53f783[_0xecdd('0x11')](_0x32ece2);}return _0x53f783[_0xecdd('0x12')](_0x32ece2)[_0xecdd('0x13')]();};}function respondWithResult(_0x490b01,_0x2b5dc2){_0x2b5dc2=_0x2b5dc2||0xc8;return function(_0x585b16){if(_0x585b16){return _0x490b01[_0xecdd('0x12')](_0x2b5dc2)['json'](_0x585b16);}};}function respondWithFilteredResult(_0x299635,_0x5a9709){return function(_0x4fa0ce){if(_0x4fa0ce){var _0x2b45a7=typeof _0x5a9709['offset']===_0xecdd('0x14')&&typeof _0x5a9709[_0xecdd('0x15')]===_0xecdd('0x14');var _0x5a7240=_0x4fa0ce[_0xecdd('0x16')];var _0x46205d=_0x2b45a7?0x0:_0x5a9709[_0xecdd('0x17')];var _0x5cc1dd=_0x2b45a7?_0x4fa0ce[_0xecdd('0x16')]:_0x5a9709[_0xecdd('0x17')]+_0x5a9709[_0xecdd('0x15')];var _0x5015cf;if(_0x5cc1dd>=_0x5a7240){_0x5cc1dd=_0x5a7240;_0x5015cf=0xc8;}else{_0x5015cf=0xce;}_0x299635['status'](_0x5015cf);return _0x299635['set'](_0xecdd('0x18'),_0x46205d+'-'+_0x5cc1dd+'/'+_0x5a7240)[_0xecdd('0x19')](_0x4fa0ce);}return null;};}function saveUpdates(_0x353668){return function(_0xb918b0){if(_0xb918b0){return _0xb918b0[_0xecdd('0x1a')](_0x353668)[_0xecdd('0x1b')](function(_0x352209){return _0x352209;});}return null;};}function removeEntity(_0x29f969){return function(_0x5128c5){if(_0x5128c5){return _0x5128c5[_0xecdd('0x1c')]()[_0xecdd('0x1b')](function(){_0x29f969[_0xecdd('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3b55){return function(_0x13ecfe){if(!_0x13ecfe){_0x2b3b55[_0xecdd('0x11')](0x194);}return _0x13ecfe;};}function handleError(_0x1af152,_0x32bded){_0x32bded=_0x32bded||0x1f4;return function(_0x2ccdae){logger[_0xecdd('0x1d')](_0x2ccdae[_0xecdd('0x1e')]);if(_0x2ccdae[_0xecdd('0x1f')]){delete _0x2ccdae[_0xecdd('0x1f')];}_0x1af152[_0xecdd('0x12')](_0x32bded)['send'](_0x2ccdae);};}exports[_0xecdd('0x20')]=function(_0x444026,_0x44dbb3){var _0x3c68de={};var _0x2d903d=_[_0xecdd('0x21')](db['WhatsappInteraction'][_0xecdd('0x22')],function(_0x2b6e75){return{'name':_0x2b6e75[_0xecdd('0x23')],'type':_0x2b6e75[_0xecdd('0x24')][_0xecdd('0x25')]};});_0x3c68de=qs['getOptions'](_0x2d903d,_0x444026);return interaction[_0xecdd('0x26')]('whatsapp',_0x444026[_0xecdd('0x27')],_0x444026[_0xecdd('0x28')],_0x3c68de,_0x2d903d)[_0xecdd('0x1b')](respondWithFilteredResult(_0x44dbb3,_0x3c68de))[_0xecdd('0x29')](handleError(_0x44dbb3,null));};exports[_0xecdd('0x2a')]=function(_0x2d8289,_0x446de1){var _0x42a1b9={'raw':![],'where':{'id':_0x2d8289[_0xecdd('0x2b')]['id']}},_0x200bf3={};_0x200bf3[_0xecdd('0x2c')]=_['keys'](db[_0xecdd('0x2d')]['rawAttributes']);_0x200bf3[_0xecdd('0x27')]=_['keys'](_0x2d8289[_0xecdd('0x27')]);_0x200bf3[_0xecdd('0x2e')]=_[_0xecdd('0x2f')](_0x200bf3['model'],_0x200bf3['query']);_0x42a1b9['attributes']=_[_0xecdd('0x2f')](_0x200bf3[_0xecdd('0x2c')],qs[_0xecdd('0x30')](_0x2d8289[_0xecdd('0x27')][_0xecdd('0x30')]));_0x42a1b9[_0xecdd('0x31')]=_0x42a1b9['attributes'][_0xecdd('0x32')]?_0x42a1b9[_0xecdd('0x31')]:_0x200bf3[_0xecdd('0x2c')];if(_0x2d8289[_0xecdd('0x27')][_0xecdd('0x33')]){_0x42a1b9[_0xecdd('0x34')]=[{'all':!![]}];}_0x42a1b9=_[_0xecdd('0x35')]({},_0x42a1b9,_0x2d8289['options']);return db[_0xecdd('0x2d')]['find'](_0x42a1b9)['then'](handleEntityNotFound(_0x446de1,null))[_0xecdd('0x1b')](respondWithResult(_0x446de1,null))[_0xecdd('0x29')](handleError(_0x446de1,null));};exports[_0xecdd('0x36')]=function(_0x1883dd,_0x1ff3d5){return db[_0xecdd('0x2d')][_0xecdd('0x36')](_0x1883dd[_0xecdd('0x37')],{})['then'](respondWithResult(_0x1ff3d5,0xc9))[_0xecdd('0x29')](handleError(_0x1ff3d5,null));};exports['update']=function(_0x402f57,_0x3b70d3){if(_0x402f57[_0xecdd('0x37')]['id']){delete _0x402f57[_0xecdd('0x37')]['id'];}return db['WhatsappInteraction'][_0xecdd('0x38')]({'where':{'id':_0x402f57[_0xecdd('0x2b')]['id']}})[_0xecdd('0x1b')](handleEntityNotFound(_0x3b70d3,null))[_0xecdd('0x1b')](saveUpdates(_0x402f57[_0xecdd('0x37')],null))[_0xecdd('0x1b')](respondWithResult(_0x3b70d3,null))[_0xecdd('0x29')](handleError(_0x3b70d3,null));};exports[_0xecdd('0x1c')]=function(_0x346fe4,_0x26a664){return db[_0xecdd('0x2d')][_0xecdd('0x38')]({'where':{'id':_0x346fe4[_0xecdd('0x2b')]['id']}})[_0xecdd('0x1b')](handleEntityNotFound(_0x26a664,null))[_0xecdd('0x1b')](removeEntity(_0x26a664,null))[_0xecdd('0x29')](handleError(_0x26a664,null));};exports[_0xecdd('0x39')]=function(_0x24ebaa,_0x44b546){return db[_0xecdd('0x2d')]['describe']()[_0xecdd('0x1b')](respondWithResult(_0x44b546,null))['catch'](handleError(_0x44b546,null));};exports[_0xecdd('0x3a')]=function(_0x5705a5,_0x3c2b2e){return db[_0xecdd('0x3b')][_0xecdd('0x38')]({'where':{'id':_0x5705a5[_0xecdd('0x2b')]['id']}})[_0xecdd('0x1b')](handleEntityNotFound(_0x3c2b2e,null))[_0xecdd('0x1b')](function(_0x16ee45){if(_0x16ee45){return _0x16ee45[_0xecdd('0x3a')](_0x5705a5[_0xecdd('0x37')][_0xecdd('0x3c')],_[_0xecdd('0x3d')](_0x5705a5[_0xecdd('0x37')],[_0xecdd('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x3c2b2e,null))['catch'](handleError(_0x3c2b2e,null));};exports['getMessages']=function(_0x48f711,_0x5116fe){var _0x2cfd49={'raw':![],'where':{}};var _0x360dcd={};var _0x1e0753={'count':0x0,'rows':[]};return db[_0xecdd('0x2d')][_0xecdd('0x3e')]({'where':{'id':_0x48f711[_0xecdd('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5116fe,null))[_0xecdd('0x1b')](function(_0x4ecb4d){if(_0x4ecb4d){_0x360dcd[_0xecdd('0x2c')]=_[_0xecdd('0x3f')](db['WhatsappMessage']['rawAttributes']);_0x360dcd[_0xecdd('0x27')]=_['keys'](_0x48f711[_0xecdd('0x27')]);_0x360dcd[_0xecdd('0x2e')]=_[_0xecdd('0x2f')](_0x360dcd['model'],_0x360dcd[_0xecdd('0x27')]);_0x2cfd49[_0xecdd('0x31')]=_['intersection'](_0x360dcd[_0xecdd('0x2c')],qs[_0xecdd('0x30')](_0x48f711['query'][_0xecdd('0x30')]));_0x2cfd49['attributes']=_0x2cfd49[_0xecdd('0x31')]['length']?_0x2cfd49[_0xecdd('0x31')]:_0x360dcd['model'];if(!_0x48f711['query'][_0xecdd('0x40')](_0xecdd('0x41'))){_0x2cfd49['limit']=qs[_0xecdd('0x15')](_0x48f711[_0xecdd('0x27')][_0xecdd('0x15')]);_0x2cfd49[_0xecdd('0x17')]=qs[_0xecdd('0x17')](_0x48f711[_0xecdd('0x27')][_0xecdd('0x17')]);}_0x2cfd49['order']=qs[_0xecdd('0x42')](_0x48f711['query']['sort']);_0x2cfd49[_0xecdd('0x43')]=qs['filters'](_[_0xecdd('0x44')](_0x48f711['query'],_0x360dcd[_0xecdd('0x2e')]));_0x2cfd49['where']['WhatsappInteractionId']=_0x4ecb4d['id'];if(_0x48f711[_0xecdd('0x27')][_0xecdd('0x45')]){_0x2cfd49[_0xecdd('0x43')]=_['merge'](_0x2cfd49[_0xecdd('0x43')],{'$or':_['map'](_0x2cfd49[_0xecdd('0x31')],function(_0x4cf9cc){var _0x2b00c8={};_0x2b00c8[_0x4cf9cc]={'$like':'%'+_0x48f711[_0xecdd('0x27')][_0xecdd('0x45')]+'%'};return _0x2b00c8;})});}if(_0x48f711[_0xecdd('0x27')]['$gte']){var _0x1d2652=_0x48f711[_0xecdd('0x27')][_0xecdd('0x46')][_0xecdd('0x47')](',');var _0x24efd4={};_0x24efd4[_0x1d2652[0x0]]={'$gte':moment(_0x1d2652[0x1])[_0xecdd('0x48')](_0xecdd('0x49'))};_0x2cfd49['where']=_[_0xecdd('0x35')](_0x2cfd49['where'],_0x24efd4);}_0x2cfd49=_['merge']({},_0x2cfd49,_0x48f711[_0xecdd('0x4a')]);return db[_0xecdd('0x3b')][_0xecdd('0x16')]({'where':_0x2cfd49['where']})[_0xecdd('0x1b')](function(_0x8bfffc){_0x1e0753[_0xecdd('0x16')]=_0x8bfffc;if(_0x48f711['query'][_0xecdd('0x33')]){_0x2cfd49['include']=[{'all':!![]}];}return db[_0xecdd('0x3b')][_0xecdd('0x26')](_0x2cfd49);})['then'](function(_0x44e865){_0x1e0753[_0xecdd('0x4b')]=_0x44e865;return _0x1e0753;});}})[_0xecdd('0x1b')](respondWithFilteredResult(_0x5116fe,_0x2cfd49))[_0xecdd('0x29')](handleError(_0x5116fe,null));};exports[_0xecdd('0x4c')]=function(_0x11c9ce,_0x443ff8){return db[_0xecdd('0x2d')]['find']({'where':{'id':_0x11c9ce[_0xecdd('0x2b')]['id']}})[_0xecdd('0x1b')](handleEntityNotFound(_0x443ff8,null))[_0xecdd('0x1b')](function(_0x5083fb){if(_0x5083fb){return _0x5083fb[_0xecdd('0x4d')](_0x11c9ce[_0xecdd('0x37')][_0xecdd('0x3c')],_[_0xecdd('0x3d')](_0x11c9ce['body'],[_0xecdd('0x3c'),'id'])||{})['spread'](function(){return db[_0xecdd('0x4e')][_0xecdd('0x26')]({'attributes':['id',_0xecdd('0x1f'),_0xecdd('0x4f')],'where':{'id':_0x11c9ce[_0xecdd('0x37')]['ids']}});})['then'](function(_0x5e6e88){socket[_0xecdd('0x50')](_0xecdd('0x51'),{'id':Number(_0x11c9ce[_0xecdd('0x2b')]['id']),'tags':_0x5e6e88||[]});return{'id':Number(_0x11c9ce[_0xecdd('0x2b')]['id']),'tags':_0x5e6e88||[]};});}})[_0xecdd('0x1b')](respondWithResult(_0x443ff8,null))['catch'](handleError(_0x443ff8,null));};exports[_0xecdd('0x52')]=function(_0x34055a,_0x5439b0){return db[_0xecdd('0x2d')][_0xecdd('0x38')]({'where':{'id':_0x34055a[_0xecdd('0x2b')]['id']}})[_0xecdd('0x1b')](handleEntityNotFound(_0x5439b0,null))[_0xecdd('0x1b')](function(_0x492fa0){if(_0x492fa0){return _0x492fa0['removeTags'](_0x34055a[_0xecdd('0x27')]['ids']);}})[_0xecdd('0x1b')](respondWithStatusCode(_0x5439b0,null))[_0xecdd('0x29')](handleError(_0x5439b0,null));};exports[_0xecdd('0x53')]=function(_0x59fe6f,_0x24bbb9){var _0x279d4a=moment()[_0xecdd('0x54')]()[_0xecdd('0x55')]();var _0x24fde6=path[_0xecdd('0x56')](config[_0xecdd('0x57')],_0xecdd('0x58'),_0xecdd('0x59'),'tmp');var _0x409e6a=path[_0xecdd('0x56')](config[_0xecdd('0x57')],'server',_0xecdd('0x59'),_0xecdd('0x5a'));var _0x254077=path['join'](_0x24fde6,_0x279d4a);var _0x47d038=util['format'](_0xecdd('0x5b'),_0x59fe6f[_0xecdd('0x2b')]['id'],_0x279d4a);var _0x5dfddd=path[_0xecdd('0x56')](_0x24fde6,_0x47d038);var _0x4dfb00=[];_0x4dfb00[_0xecdd('0x5c')]({'model':db[_0xecdd('0x5d')],'as':_0xecdd('0x5d'),'attributes':['id',_0xecdd('0x5e')],'raw':!![]});_0x4dfb00[_0xecdd('0x5c')]({'model':db['CmContact'],'as':_0xecdd('0x5f'),'attributes':['id',_0xecdd('0x60'),_0xecdd('0x61')],'raw':!![]});if(_0x59fe6f['query'][_0xecdd('0x5a')]){_0x4dfb00[_0xecdd('0x5c')]({'model':db[_0xecdd('0x62')],'as':_0xecdd('0x62'),'raw':!![]});}var _0x581947=[{'model':db['WhatsappMessage'],'as':_0xecdd('0x63'),'attributes':['id',_0xecdd('0x37'),_0xecdd('0x64'),_0xecdd('0x65'),_0xecdd('0x66'),'read'],'include':_0x4dfb00}];_0x581947[_0xecdd('0x5c')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xecdd('0x1f')]});_0x581947[_0xecdd('0x5c')]({'model':db[_0xecdd('0x5d')],'as':_0xecdd('0x67'),'attributes':['id','fullname']});return db[_0xecdd('0x2d')]['find']({'where':{'id':_0x59fe6f[_0xecdd('0x2b')]['id']},'include':_0x581947})[_0xecdd('0x1b')](handleEntityNotFound(_0x24bbb9,null))[_0xecdd('0x1b')](function(_0x1f7096){if(_0x1f7096){var _0x58eb8d=_0x1f7096['get']({'plain':!![]});fs[_0xecdd('0x68')](_0x254077);var _0xe57922={'channel':_0xecdd('0x69'),'account':_0x58eb8d['Account'][_0xecdd('0x1f')],'agent':_0x58eb8d['Owner']?_0x58eb8d[_0xecdd('0x67')][_0xecdd('0x5e')]:_0xecdd('0x6a'),'createdAt':moment(_0x58eb8d[_0xecdd('0x64')])[_0xecdd('0x48')](_0xecdd('0x49'))[_0xecdd('0x55')](),'closedAt':_0x58eb8d['closed']?moment(_0x58eb8d[_0xecdd('0x6b')])[_0xecdd('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xecdd('0x55')]():'','disposition':_0x58eb8d[_0xecdd('0x6c')],'messages':_(_0x58eb8d[_0xecdd('0x63')])[_0xecdd('0x45')]({'secret':![]})[_0xecdd('0x21')](function(_0x38a9ce){if(_0x38a9ce[_0xecdd('0x62')]){var _0x273587=path[_0xecdd('0x56')](_0x409e6a,_0x38a9ce[_0xecdd('0x62')][_0xecdd('0x6d')]);if(fs[_0xecdd('0x6e')](_0x273587)){fs[_0xecdd('0x6f')](_0x273587)[_0xecdd('0x70')](fs[_0xecdd('0x71')](path[_0xecdd('0x56')](_0x254077,_0x38a9ce[_0xecdd('0x62')]['basename'])));}}return{'date':moment(_0x38a9ce[_0xecdd('0x64')])[_0xecdd('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xecdd('0x55')](),'sender':_0x38a9ce[_0xecdd('0x65')]===_0xecdd('0x72')?_0x38a9ce[_0xecdd('0x5d')]?_0x38a9ce[_0xecdd('0x5d')]['fullname']:_0xecdd('0x73'):_0x38a9ce[_0xecdd('0x5f')][_0xecdd('0x60')]+(_0x38a9ce[_0xecdd('0x5f')][_0xecdd('0x61')]?'\x20'+_0x38a9ce[_0xecdd('0x5f')]['lastName']:''),'body':_0x38a9ce['Attachment']?_0x38a9ce[_0xecdd('0x62')][_0xecdd('0x6d')]:_0x38a9ce[_0xecdd('0x37')],'direction':_0x38a9ce[_0xecdd('0x65')]===_0xecdd('0x72')?'A':'C','secret':_0x38a9ce[_0xecdd('0x66')],'read':_0x38a9ce[_0xecdd('0x74')],'attachment':_0x38a9ce[_0xecdd('0x62')]};})['value']()};return ejs[_0xecdd('0x75')](path[_0xecdd('0x56')](config[_0xecdd('0x57')],_0xecdd('0x58'),_0xecdd('0x76'),_0xecdd('0x77')),{'interaction':_0xe57922})[_0xecdd('0x1b')](function(_0x26fe44){var _0x4ac015=path[_0xecdd('0x56')](_0x254077,_0xecdd('0x78')+_0x58eb8d['id']+'-'+_0x279d4a+_0xecdd('0x79'));var _0x8a9b86={'path':_0x4ac015,'channel':'Whatsapp','interactionId':_0x58eb8d['id']};return pdf[_0xecdd('0x7a')](_0x26fe44,_0x8a9b86);})[_0xecdd('0x1b')](function(){return new BPromise(function(_0x4c8e55,_0x22e720){zipdir(_0x254077,{'saveTo':_0x5dfddd},function(_0x2abfdf,_0x311987){if(_0x2abfdf)return _0x22e720(_0x2abfdf);return _0x4c8e55(_0x311987);});})[_0xecdd('0x1b')](function(){return new BPromise(function(_0x5f357e,_0x42289f){rimraf(_0x254077,function(_0x3ce8e7){if(_0x3ce8e7)_0x42289f(_0x3ce8e7);return _0x5f357e();});});})['then'](function(){return _0x24bbb9[_0xecdd('0x53')](_0x5dfddd,_0x47d038,function(_0x2691d7){if(_0x2691d7){console['log'](_0xecdd('0x7b'),_0x2691d7);}else{fs[_0xecdd('0x7c')](_0x5dfddd);}});});});}else{return _0x24bbb9[_0xecdd('0x11')](0xc8);}})[_0xecdd('0x29')](handleError(_0x24bbb9,null));}; \ No newline at end of file +var _0x4668=['basename','existsSync','createReadStream','pipe','createWriteStream','System','out','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','bluebird','path','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','whatsapp','catch','show','model','keys','query','filters','attributes','fields','length','include','merge','WhatsappInteraction','find','create','body','params','describe','addMessage','WhatsappMessage','ids','intersection','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','color','whatsappInteractionTags:save','removeTags','download','unix','join','server','root','files','attachments','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','fullname','get','Whatsapp','N.A.','toString','closed','disposition'];(function(_0x35b37e,_0x4e663d){var _0x376f5e=function(_0x4bcad9){while(--_0x4bcad9){_0x35b37e['push'](_0x35b37e['shift']());}};_0x376f5e(++_0x4e663d);}(_0x4668,0x101));var _0x8466=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4668[_0x321bb2];return _0x9c12ed;};'use strict';var rimraf=require(_0x8466('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8466('0x1'));var BPromise=require(_0x8466('0x2'));var util=require('util');var path=require(_0x8466('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8466('0x4'));var Redis=require(_0x8466('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x8466('0x6'));var logger=require(_0x8466('0x7'))(_0x8466('0x8'));var config=require(_0x8466('0x9'));var db=require('../../mysqldb')['db'];config[_0x8466('0xa')]=_[_0x8466('0xb')](config['redis'],{'host':_0x8466('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8466('0xa')]));require(_0x8466('0xd'))[_0x8466('0xe')](socket);function respondWithStatusCode(_0x14401d,_0x34804f){_0x34804f=_0x34804f||0xcc;return function(_0x4cc61e){if(_0x4cc61e){return _0x14401d[_0x8466('0xf')](_0x34804f);}return _0x14401d[_0x8466('0x10')](_0x34804f)[_0x8466('0x11')]();};}function respondWithResult(_0x4e1330,_0x55d96f){_0x55d96f=_0x55d96f||0xc8;return function(_0xb6ca7b){if(_0xb6ca7b){return _0x4e1330['status'](_0x55d96f)[_0x8466('0x12')](_0xb6ca7b);}};}function respondWithFilteredResult(_0x35d7fb,_0x545dcf){return function(_0x510776){if(_0x510776){var _0x4c7de1=typeof _0x545dcf[_0x8466('0x13')]==='undefined'&&typeof _0x545dcf[_0x8466('0x14')]===_0x8466('0x15');var _0x474bd4=_0x510776['count'];var _0x41c887=_0x4c7de1?0x0:_0x545dcf[_0x8466('0x13')];var _0x371621=_0x4c7de1?_0x510776[_0x8466('0x16')]:_0x545dcf[_0x8466('0x13')]+_0x545dcf[_0x8466('0x14')];var _0x400722;if(_0x371621>=_0x474bd4){_0x371621=_0x474bd4;_0x400722=0xc8;}else{_0x400722=0xce;}_0x35d7fb[_0x8466('0x10')](_0x400722);return _0x35d7fb[_0x8466('0x17')]('Content-Range',_0x41c887+'-'+_0x371621+'/'+_0x474bd4)[_0x8466('0x12')](_0x510776);}return null;};}function saveUpdates(_0x548053){return function(_0xa813e1){if(_0xa813e1){return _0xa813e1[_0x8466('0x18')](_0x548053)[_0x8466('0x19')](function(_0x468981){return _0x468981;});}return null;};}function removeEntity(_0x421ec0){return function(_0xe35396){if(_0xe35396){return _0xe35396[_0x8466('0x1a')]()[_0x8466('0x19')](function(){_0x421ec0[_0x8466('0x10')](0xcc)[_0x8466('0x11')]();});}};}function handleEntityNotFound(_0x5947c2){return function(_0x7223f4){if(!_0x7223f4){_0x5947c2[_0x8466('0xf')](0x194);}return _0x7223f4;};}function handleError(_0x351d47,_0x437e8d){_0x437e8d=_0x437e8d||0x1f4;return function(_0x1a9072){logger[_0x8466('0x1b')](_0x1a9072[_0x8466('0x1c')]);if(_0x1a9072[_0x8466('0x1d')]){delete _0x1a9072['name'];}_0x351d47[_0x8466('0x10')](_0x437e8d)[_0x8466('0x1e')](_0x1a9072);};}exports[_0x8466('0x1f')]=function(_0x3ed544,_0x21b56a){var _0x277ce2={};var _0x353a21=_[_0x8466('0x20')](db['WhatsappInteraction'][_0x8466('0x21')],function(_0x267509){return{'name':_0x267509[_0x8466('0x22')],'type':_0x267509['type'][_0x8466('0x23')]};});_0x277ce2=qs[_0x8466('0x24')](_0x353a21,_0x3ed544);return interaction['findAll'](_0x8466('0x25'),_0x3ed544['query'],_0x3ed544['user'],_0x277ce2,_0x353a21)[_0x8466('0x19')](respondWithFilteredResult(_0x21b56a,_0x277ce2))[_0x8466('0x26')](handleError(_0x21b56a,null));};exports[_0x8466('0x27')]=function(_0x57e33e,_0x14eb21){var _0x5ee4e5={'raw':![],'where':{'id':_0x57e33e['params']['id']}},_0x4c9aa2={};_0x4c9aa2[_0x8466('0x28')]=_[_0x8466('0x29')](db['WhatsappInteraction'][_0x8466('0x21')]);_0x4c9aa2['query']=_[_0x8466('0x29')](_0x57e33e[_0x8466('0x2a')]);_0x4c9aa2[_0x8466('0x2b')]=_['intersection'](_0x4c9aa2[_0x8466('0x28')],_0x4c9aa2[_0x8466('0x2a')]);_0x5ee4e5[_0x8466('0x2c')]=_['intersection'](_0x4c9aa2['model'],qs[_0x8466('0x2d')](_0x57e33e[_0x8466('0x2a')][_0x8466('0x2d')]));_0x5ee4e5[_0x8466('0x2c')]=_0x5ee4e5[_0x8466('0x2c')][_0x8466('0x2e')]?_0x5ee4e5[_0x8466('0x2c')]:_0x4c9aa2[_0x8466('0x28')];if(_0x57e33e[_0x8466('0x2a')]['includeAll']){_0x5ee4e5[_0x8466('0x2f')]=[{'all':!![]}];}_0x5ee4e5=_[_0x8466('0x30')]({},_0x5ee4e5,_0x57e33e['options']);return db[_0x8466('0x31')][_0x8466('0x32')](_0x5ee4e5)[_0x8466('0x19')](handleEntityNotFound(_0x14eb21,null))[_0x8466('0x19')](respondWithResult(_0x14eb21,null))[_0x8466('0x26')](handleError(_0x14eb21,null));};exports[_0x8466('0x33')]=function(_0x95ad0f,_0x40e5af){return db['WhatsappInteraction']['create'](_0x95ad0f[_0x8466('0x34')],{})[_0x8466('0x19')](respondWithResult(_0x40e5af,0xc9))[_0x8466('0x26')](handleError(_0x40e5af,null));};exports[_0x8466('0x18')]=function(_0x14552a,_0x241e45){if(_0x14552a[_0x8466('0x34')]['id']){delete _0x14552a[_0x8466('0x34')]['id'];}return db['WhatsappInteraction'][_0x8466('0x32')]({'where':{'id':_0x14552a[_0x8466('0x35')]['id']}})[_0x8466('0x19')](handleEntityNotFound(_0x241e45,null))['then'](saveUpdates(_0x14552a[_0x8466('0x34')],null))['then'](respondWithResult(_0x241e45,null))[_0x8466('0x26')](handleError(_0x241e45,null));};exports['destroy']=function(_0x5e734f,_0x417302){return db[_0x8466('0x31')]['find']({'where':{'id':_0x5e734f[_0x8466('0x35')]['id']}})[_0x8466('0x19')](handleEntityNotFound(_0x417302,null))['then'](removeEntity(_0x417302,null))[_0x8466('0x26')](handleError(_0x417302,null));};exports[_0x8466('0x36')]=function(_0x3dc843,_0x432d62){return db[_0x8466('0x31')][_0x8466('0x36')]()[_0x8466('0x19')](respondWithResult(_0x432d62,null))[_0x8466('0x26')](handleError(_0x432d62,null));};exports[_0x8466('0x37')]=function(_0x47544a,_0x1fc220){return db[_0x8466('0x38')][_0x8466('0x32')]({'where':{'id':_0x47544a[_0x8466('0x35')]['id']}})['then'](handleEntityNotFound(_0x1fc220,null))[_0x8466('0x19')](function(_0x1ce899){if(_0x1ce899){return _0x1ce899[_0x8466('0x37')](_0x47544a[_0x8466('0x34')][_0x8466('0x39')],_['omit'](_0x47544a[_0x8466('0x34')],[_0x8466('0x39'),'id'])||{});}})[_0x8466('0x19')](respondWithResult(_0x1fc220,null))[_0x8466('0x26')](handleError(_0x1fc220,null));};exports['getMessages']=function(_0x5b9929,_0x241bf9){var _0x5944ae={'raw':![],'where':{}};var _0x24ad47={};var _0x53d2d2={'count':0x0,'rows':[]};return db[_0x8466('0x31')]['findOne']({'where':{'id':_0x5b9929[_0x8466('0x35')]['id']}})['then'](handleEntityNotFound(_0x241bf9,null))[_0x8466('0x19')](function(_0xfa7787){if(_0xfa7787){_0x24ad47[_0x8466('0x28')]=_[_0x8466('0x29')](db[_0x8466('0x38')]['rawAttributes']);_0x24ad47[_0x8466('0x2a')]=_[_0x8466('0x29')](_0x5b9929[_0x8466('0x2a')]);_0x24ad47[_0x8466('0x2b')]=_[_0x8466('0x3a')](_0x24ad47[_0x8466('0x28')],_0x24ad47[_0x8466('0x2a')]);_0x5944ae['attributes']=_['intersection'](_0x24ad47[_0x8466('0x28')],qs['fields'](_0x5b9929[_0x8466('0x2a')][_0x8466('0x2d')]));_0x5944ae[_0x8466('0x2c')]=_0x5944ae[_0x8466('0x2c')][_0x8466('0x2e')]?_0x5944ae[_0x8466('0x2c')]:_0x24ad47[_0x8466('0x28')];if(!_0x5b9929['query'][_0x8466('0x3b')](_0x8466('0x3c'))){_0x5944ae[_0x8466('0x14')]=qs[_0x8466('0x14')](_0x5b9929[_0x8466('0x2a')]['limit']);_0x5944ae['offset']=qs[_0x8466('0x13')](_0x5b9929['query'][_0x8466('0x13')]);}_0x5944ae[_0x8466('0x3d')]=qs[_0x8466('0x3e')](_0x5b9929[_0x8466('0x2a')][_0x8466('0x3e')]);_0x5944ae[_0x8466('0x3f')]=qs[_0x8466('0x2b')](_['pick'](_0x5b9929[_0x8466('0x2a')],_0x24ad47[_0x8466('0x2b')]));_0x5944ae[_0x8466('0x3f')][_0x8466('0x40')]=_0xfa7787['id'];if(_0x5b9929[_0x8466('0x2a')]['filter']){_0x5944ae[_0x8466('0x3f')]=_[_0x8466('0x30')](_0x5944ae[_0x8466('0x3f')],{'$or':_['map'](_0x5944ae[_0x8466('0x2c')],function(_0x284434){var _0x42a2be={};_0x42a2be[_0x284434]={'$like':'%'+_0x5b9929['query'][_0x8466('0x41')]+'%'};return _0x42a2be;})});}if(_0x5b9929[_0x8466('0x2a')][_0x8466('0x42')]){var _0x5dd0bc=_0x5b9929[_0x8466('0x2a')][_0x8466('0x42')][_0x8466('0x43')](',');var _0x38f417={};_0x38f417[_0x5dd0bc[0x0]]={'$gte':moment(_0x5dd0bc[0x1])[_0x8466('0x44')](_0x8466('0x45'))};_0x5944ae['where']=_[_0x8466('0x30')](_0x5944ae[_0x8466('0x3f')],_0x38f417);}_0x5944ae=_[_0x8466('0x30')]({},_0x5944ae,_0x5b9929['options']);return db['WhatsappMessage']['count']({'where':_0x5944ae['where']})['then'](function(_0x59d834){_0x53d2d2[_0x8466('0x16')]=_0x59d834;if(_0x5b9929[_0x8466('0x2a')][_0x8466('0x46')]){_0x5944ae[_0x8466('0x2f')]=[{'all':!![]}];}return db[_0x8466('0x38')][_0x8466('0x47')](_0x5944ae);})[_0x8466('0x19')](function(_0x54f551){_0x53d2d2['rows']=_0x54f551;return _0x53d2d2;});}})[_0x8466('0x19')](respondWithFilteredResult(_0x241bf9,_0x5944ae))[_0x8466('0x26')](handleError(_0x241bf9,null));};exports['addTags']=function(_0x25fd21,_0x3931e9){return db['WhatsappInteraction'][_0x8466('0x32')]({'where':{'id':_0x25fd21[_0x8466('0x35')]['id']}})['then'](handleEntityNotFound(_0x3931e9,null))[_0x8466('0x19')](function(_0x14a728){if(_0x14a728){return _0x14a728[_0x8466('0x48')](_0x25fd21[_0x8466('0x34')]['ids'],_['omit'](_0x25fd21['body'],[_0x8466('0x39'),'id'])||{})[_0x8466('0x49')](function(){return db['Tag'][_0x8466('0x47')]({'attributes':['id',_0x8466('0x1d'),_0x8466('0x4a')],'where':{'id':_0x25fd21['body'][_0x8466('0x39')]}});})[_0x8466('0x19')](function(_0x3aab0b){socket['emit'](_0x8466('0x4b'),{'id':Number(_0x25fd21['params']['id']),'tags':_0x3aab0b||[]});return{'id':Number(_0x25fd21[_0x8466('0x35')]['id']),'tags':_0x3aab0b||[]};});}})['then'](respondWithResult(_0x3931e9,null))['catch'](handleError(_0x3931e9,null));};exports['removeTags']=function(_0x33ac1e,_0x48b29c){return db[_0x8466('0x31')]['find']({'where':{'id':_0x33ac1e[_0x8466('0x35')]['id']}})['then'](handleEntityNotFound(_0x48b29c,null))[_0x8466('0x19')](function(_0x2eb449){if(_0x2eb449){return _0x2eb449[_0x8466('0x4c')](_0x33ac1e[_0x8466('0x2a')][_0x8466('0x39')]);}})[_0x8466('0x19')](respondWithStatusCode(_0x48b29c,null))[_0x8466('0x26')](handleError(_0x48b29c,null));};exports[_0x8466('0x4d')]=function(_0x589a50,_0x2a1aa6){var _0x5a8d90=moment()[_0x8466('0x4e')]()['toString']();var _0x377dee=path[_0x8466('0x4f')](config['root'],_0x8466('0x50'),'files','tmp');var _0x5d8fac=path[_0x8466('0x4f')](config[_0x8466('0x51')],_0x8466('0x50'),_0x8466('0x52'),_0x8466('0x53'));var _0x440ef6=path[_0x8466('0x4f')](_0x377dee,_0x5a8d90);var _0x2c993e=util['format']('transcript-%d-%s.zip',_0x589a50[_0x8466('0x35')]['id'],_0x5a8d90);var _0x3837a6=path['join'](_0x377dee,_0x2c993e);var _0x29a601=[];_0x29a601[_0x8466('0x54')]({'model':db[_0x8466('0x55')],'as':_0x8466('0x55'),'attributes':['id','fullname'],'raw':!![]});_0x29a601[_0x8466('0x54')]({'model':db[_0x8466('0x56')],'as':_0x8466('0x57'),'attributes':['id',_0x8466('0x58'),_0x8466('0x59')],'raw':!![]});if(_0x589a50[_0x8466('0x2a')]['attachments']){_0x29a601[_0x8466('0x54')]({'model':db[_0x8466('0x5a')],'as':'Attachment','raw':!![]});}var _0xe0f851=[{'model':db[_0x8466('0x38')],'as':_0x8466('0x5b'),'attributes':['id',_0x8466('0x34'),_0x8466('0x5c'),_0x8466('0x5d'),_0x8466('0x5e'),_0x8466('0x5f')],'include':_0x29a601}];_0xe0f851[_0x8466('0x54')]({'model':db[_0x8466('0x60')],'as':_0x8466('0x61'),'attributes':['id',_0x8466('0x1d')]});_0xe0f851[_0x8466('0x54')]({'model':db[_0x8466('0x55')],'as':_0x8466('0x62'),'attributes':['id',_0x8466('0x63')]});return db[_0x8466('0x31')][_0x8466('0x32')]({'where':{'id':_0x589a50[_0x8466('0x35')]['id']},'include':_0xe0f851})['then'](handleEntityNotFound(_0x2a1aa6,null))[_0x8466('0x19')](function(_0x480b46){if(_0x480b46){var _0x6ef52f=_0x480b46[_0x8466('0x64')]({'plain':!![]});fs['mkdirSync'](_0x440ef6);var _0x13daf4={'channel':_0x8466('0x65'),'account':_0x6ef52f[_0x8466('0x61')]['name'],'agent':_0x6ef52f[_0x8466('0x62')]?_0x6ef52f[_0x8466('0x62')][_0x8466('0x63')]:_0x8466('0x66'),'createdAt':moment(_0x6ef52f[_0x8466('0x5c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8466('0x67')](),'closedAt':_0x6ef52f[_0x8466('0x68')]?moment(_0x6ef52f['closedAt'])[_0x8466('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x6ef52f[_0x8466('0x69')],'messages':_(_0x6ef52f[_0x8466('0x5b')])[_0x8466('0x41')]({'secret':![]})[_0x8466('0x20')](function(_0x1d248a){if(_0x1d248a[_0x8466('0x5a')]){var _0x376b52=path[_0x8466('0x4f')](_0x5d8fac,_0x1d248a[_0x8466('0x5a')][_0x8466('0x6a')]);if(fs[_0x8466('0x6b')](_0x376b52)){fs[_0x8466('0x6c')](_0x376b52)[_0x8466('0x6d')](fs[_0x8466('0x6e')](path[_0x8466('0x4f')](_0x440ef6,_0x1d248a[_0x8466('0x5a')]['basename'])));}}return{'date':moment(_0x1d248a['createdAt'])['format'](_0x8466('0x45'))['toString'](),'sender':_0x1d248a[_0x8466('0x5d')]==='out'?_0x1d248a['User']?_0x1d248a[_0x8466('0x55')][_0x8466('0x63')]:_0x8466('0x6f'):_0x1d248a[_0x8466('0x57')][_0x8466('0x58')]+(_0x1d248a[_0x8466('0x57')]['lastName']?'\x20'+_0x1d248a[_0x8466('0x57')][_0x8466('0x59')]:''),'body':_0x1d248a[_0x8466('0x5a')]?_0x1d248a[_0x8466('0x5a')][_0x8466('0x6a')]:_0x1d248a['body'],'direction':_0x1d248a[_0x8466('0x5d')]===_0x8466('0x70')?'A':'C','secret':_0x1d248a['secret'],'read':_0x1d248a[_0x8466('0x5f')],'attachment':_0x1d248a[_0x8466('0x5a')]};})[_0x8466('0x71')]()};return ejs[_0x8466('0x72')](path[_0x8466('0x4f')](config[_0x8466('0x51')],_0x8466('0x50'),'views',_0x8466('0x73')),{'interaction':_0x13daf4})[_0x8466('0x19')](function(_0x5bd5ce){var _0x5a2284=path['join'](_0x440ef6,'transcript-'+_0x6ef52f['id']+'-'+_0x5a8d90+_0x8466('0x74'));var _0x4dc1a1={'path':_0x5a2284,'channel':_0x8466('0x65'),'interactionId':_0x6ef52f['id']};return pdf[_0x8466('0x75')](_0x5bd5ce,_0x4dc1a1);})[_0x8466('0x19')](function(){return new BPromise(function(_0x34b08f,_0x4dd9c6){zipdir(_0x440ef6,{'saveTo':_0x3837a6},function(_0x1c4b2b,_0x1f4ef1){if(_0x1c4b2b)return _0x4dd9c6(_0x1c4b2b);return _0x34b08f(_0x1f4ef1);});})[_0x8466('0x19')](function(){return new BPromise(function(_0x1d3295,_0x4d4f98){rimraf(_0x440ef6,function(_0x2cfa){if(_0x2cfa)_0x4d4f98(_0x2cfa);return _0x1d3295();});});})[_0x8466('0x19')](function(){return _0x2a1aa6[_0x8466('0x4d')](_0x3837a6,_0x2c993e,function(_0x22e67c){if(_0x22e67c){console[_0x8466('0x76')](_0x8466('0x77'),_0x22e67c);}else{fs[_0x8466('0x78')](_0x3837a6);}});});});}else{return _0x2a1aa6['sendStatus'](0xc8);}})[_0x8466('0x26')](handleError(_0x2a1aa6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 917d686..894fe12 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 _0x8482=['length','emit','catch','hasOwnProperty','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','map','findAll','unreadMessages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8482,0x14e));var _0x2848=function(_0x866d4f,_0x7eda41){_0x866d4f=_0x866d4f-0x0;var _0x225134=_0x8482[_0x866d4f];return _0x225134;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x2848('0x0'))['db'][_0x2848('0x1')];var WhatsappMessage=require(_0x2848('0x0'))['db'][_0x2848('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2848('0x3')](0x0);var events={'afterCreate':_0x2848('0x4'),'afterUpdate':_0x2848('0x5'),'afterDestroy':_0x2848('0x6')};function emitEvent(_0x467ee5){return function(_0x391cad,_0x5cc8e1,_0x1eb602){_0x391cad[_0x2848('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xeca507){_0x391cad['setDataValue']('Users',_0xeca507[_0x2848('0x8')](function(_0x582500){return{'id':_0x582500['id']};}));return WhatsappMessage[_0x2848('0x9')]({'where':{'WhatsappInteractionId':_0x391cad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5bcc65){_0x391cad['setDataValue'](_0x2848('0xa'),_0x5bcc65[_0x2848('0xb')]);WhatsappInteractionEvents[_0x2848('0xc')](_0x467ee5+':'+_0x391cad['id'],_0x391cad);WhatsappInteractionEvents[_0x2848('0xc')](_0x467ee5,_0x391cad);_0x1eb602(null);})[_0x2848('0xd')](_0x1eb602(null));};}for(var e in events){if(events[_0x2848('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x644a=['WhatsappInteraction','WhatsappMessage','save','update','then','Users','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x5c8ebb,_0x2180e5){var _0x5aca81=function(_0x40b7c6){while(--_0x40b7c6){_0x5c8ebb['push'](_0x5c8ebb['shift']());}};_0x5aca81(++_0x2180e5);}(_0x644a,0xfd));var _0xa644=function(_0x34f756,_0x1ea7ab){_0x34f756=_0x34f756-0x0;var _0x26e745=_0x644a[_0x34f756];return _0x26e745;};'use strict';var EventEmitter=require(_0xa644('0x0'));var WhatsappInteraction=require(_0xa644('0x1'))['db'][_0xa644('0x2')];var WhatsappMessage=require(_0xa644('0x1'))['db'][_0xa644('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa644('0x4'),'afterUpdate':_0xa644('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f6ed9){return function(_0x1ae8c0,_0x40a46b,_0x3e1ca6){_0x1ae8c0['getUsers']({'attributes':['id'],'raw':!![]})[_0xa644('0x6')](function(_0x1aaaae){_0x1ae8c0['setDataValue'](_0xa644('0x7'),_0x1aaaae[_0xa644('0x8')](function(_0x4ffdf4){return{'id':_0x4ffdf4['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1ae8c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa644('0x6')](function(_0x477e55){_0x1ae8c0['setDataValue'](_0xa644('0x9'),_0x477e55[_0xa644('0xa')]);WhatsappInteractionEvents[_0xa644('0xb')](_0x4f6ed9+':'+_0x1ae8c0['id'],_0x1ae8c0);WhatsappInteractionEvents[_0xa644('0xb')](_0x4f6ed9,_0x1ae8c0);_0x3e1ca6(null);})[_0xa644('0xc')](_0x3e1ca6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xa644('0xd')](e,emitEvent(event));}}module[_0xa644('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 1d0d195..501e0df 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 _0x28a0=['bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment'];(function(_0x3ce3bc,_0x3530af){var _0x31100b=function(_0x2a2f46){while(--_0x2a2f46){_0x3ce3bc['push'](_0x3ce3bc['shift']());}};_0x31100b(++_0x3530af);}(_0x28a0,0x155));var _0x028a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x28a0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x028a('0x0'));var util=require('util');var logger=require(_0x028a('0x1'))(_0x028a('0x2'));var moment=require(_0x028a('0x3'));var BPromise=require(_0x028a('0x4'));var rp=require(_0x028a('0x5'));var fs=require('fs');var path=require(_0x028a('0x6'));var rimraf=require('rimraf');var config=require(_0x028a('0x7'));var attributes=require(_0x028a('0x8'));module['exports']=function(_0x5055dd,_0x24b87d){return _0x5055dd[_0x028a('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x028a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51cdee,_0x2838bf,_0x2004df){if(_0x51cdee[_0x028a('0xb')](_0x028a('0xc'))){_0x51cdee[_0x028a('0xd')]=moment()[_0x028a('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2004df(null,_0x51cdee);}}});}; \ No newline at end of file +var _0x8374=['request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4f89f1,_0x3f4ec5){var _0x13f987=function(_0xeb2975){while(--_0xeb2975){_0x4f89f1['push'](_0x4f89f1['shift']());}};_0x13f987(++_0x3f4ec5);}(_0x8374,0x174));var _0x4837=function(_0x583669,_0x2a4708){_0x583669=_0x583669-0x0;var _0x5010fa=_0x8374[_0x583669];return _0x5010fa;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var logger=require(_0x4837('0x2'))(_0x4837('0x3'));var moment=require(_0x4837('0x4'));var BPromise=require(_0x4837('0x5'));var rp=require(_0x4837('0x6'));var fs=require('fs');var path=require(_0x4837('0x7'));var rimraf=require(_0x4837('0x8'));var config=require(_0x4837('0x9'));var attributes=require(_0x4837('0xa'));module[_0x4837('0xb')]=function(_0x2bd5a7,_0x425c07){return _0x2bd5a7['define'](_0x4837('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x408c14,_0x476a1d,_0x2046c1){if(_0x408c14[_0x4837('0xd')](_0x4837('0xe'))){_0x408c14[_0x4837('0xf')]=moment()[_0x4837('0x10')](_0x4837('0x11'));}_0x2046c1(null,_0x408c14);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 5e23d2f..955cd8d 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 _0x8421=['UpdateWhatsappInteraction','update','body','options','raw','where','attributes','debug','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x8421,0x106));var _0x1842=function(_0x368178,_0x2d5678){_0x368178=_0x368178-0x0;var _0x10a228=_0x8421[_0x368178];return _0x10a228;};'use strict';var _=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1842('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1842('0x3'))['db'];var utils=require(_0x1842('0x4'));var logger=require('../../config/logger')(_0x1842('0x5'));var config=require(_0x1842('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1842('0x7')][_0x1842('0x8')]({'port':0x232a});config[_0x1842('0x9')]=_[_0x1842('0xa')](config[_0x1842('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1842('0xb'))(new Redis(config[_0x1842('0x9')]));require('./whatsappInteraction.socket')[_0x1842('0xc')](socket);function respondWithRpcPromise(_0x57eb65,_0x59dddd,_0x508674){return new BPromise(function(_0x4db555,_0x1c8480){return client[_0x1842('0xd')](_0x57eb65,_0x508674)[_0x1842('0xe')](function(_0x31b87b){logger[_0x1842('0xf')](_0x1842('0x10'),_0x59dddd,_0x1842('0x11'));logger['debug'](_0x1842('0x12'),_0x59dddd,_0x1842('0x11'),JSON[_0x1842('0x13')](_0x31b87b));if(_0x31b87b[_0x1842('0x14')]){if(_0x31b87b[_0x1842('0x14')][_0x1842('0x15')]===0x1f4){logger[_0x1842('0x14')](_0x1842('0x10'),_0x59dddd,_0x31b87b['error'][_0x1842('0x16')]);return _0x1c8480(_0x31b87b[_0x1842('0x14')][_0x1842('0x16')]);}logger[_0x1842('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x59dddd,_0x31b87b[_0x1842('0x14')][_0x1842('0x16')]);return _0x4db555(_0x31b87b['error'][_0x1842('0x16')]);}else{logger[_0x1842('0xf')](_0x1842('0x10'),_0x59dddd,'request\x20sent');_0x4db555(_0x31b87b[_0x1842('0x17')][_0x1842('0x16')]);}})[_0x1842('0x18')](function(_0x158aed){logger[_0x1842('0x14')](_0x1842('0x10'),_0x59dddd,_0x158aed);_0x1c8480(_0x158aed);});});}exports[_0x1842('0x19')]=function(_0x5d5017){var _0x17cb70=this;return new Promise(function(_0x3c56a7,_0x142718){return db['WhatsappInteraction'][_0x1842('0x1a')](_0x5d5017[_0x1842('0x1b')],{'raw':_0x5d5017[_0x1842('0x1c')]?_0x5d5017[_0x1842('0x1c')][_0x1842('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d5017[_0x1842('0x1c')]?_0x5d5017['options'][_0x1842('0x1e')]||null:null,'attributes':_0x5d5017[_0x1842('0x1c')]?_0x5d5017[_0x1842('0x1c')][_0x1842('0x1f')]||null:null,'limit':_0x5d5017[_0x1842('0x1c')]?_0x5d5017[_0x1842('0x1c')]['limit']||null:null})[_0x1842('0xe')](function(_0x25d559){logger[_0x1842('0xf')](_0x1842('0x19'),_0x5d5017);logger[_0x1842('0x20')](_0x1842('0x19'),_0x5d5017,JSON[_0x1842('0x13')](_0x25d559));_0x3c56a7(_0x25d559);})['catch'](function(_0x74ac16){logger[_0x1842('0x14')](_0x1842('0x19'),_0x74ac16[_0x1842('0x16')],_0x5d5017);_0x142718(_0x17cb70[_0x1842('0x14')](0x1f4,_0x74ac16['message']));});});};exports[_0x1842('0x21')]=function(_0x3e697e){return new Promise(function(_0x1b3e63,_0x3e6199){return db[_0x1842('0x22')][_0x1842('0x23')]({'where':_0x3e697e[_0x1842('0x1c')]?_0x3e697e[_0x1842('0x1c')][_0x1842('0x1e')]||null:null})[_0x1842('0xe')](function(_0x3e8c9c){if(_0x3e8c9c){return _0x3e8c9c[_0x1842('0x24')](_0x3e697e['body'][_0x1842('0x25')],_[_0x1842('0x26')](_0x3e697e['body'],['ids','id'])||{});}})[_0x1842('0x27')](function(_0x4e4d14){logger[_0x1842('0xf')]('AddTags',_0x3e697e);logger[_0x1842('0x20')]('AddTags',_0x3e697e,JSON[_0x1842('0x13')](_0x4e4d14));_0x1b3e63(_0x4e4d14);})[_0x1842('0x18')](function(_0x527644){logger[_0x1842('0x14')](_0x1842('0x28'),_0x527644[_0x1842('0x16')],_0x3e697e);_0x3e6199(_this[_0x1842('0x14')](0x1f4,_0x527644[_0x1842('0x16')]));});});}; \ No newline at end of file +var _0xd0aa=['localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction','update','body','options','raw','where','attributes','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xd0aa,0x152));var _0xad0a=function(_0x323eb6,_0x3ce442){_0x323eb6=_0x323eb6-0x0;var _0xa83af=_0xd0aa[_0x323eb6];return _0xa83af;};'use strict';var _=require(_0xad0a('0x0'));var util=require(_0xad0a('0x1'));var moment=require(_0xad0a('0x2'));var BPromise=require(_0xad0a('0x3'));var rs=require(_0xad0a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad0a('0x5'));var logger=require(_0xad0a('0x6'))(_0xad0a('0x7'));var config=require(_0xad0a('0x8'));var jayson=require(_0xad0a('0x9'));var client=jayson[_0xad0a('0xa')][_0xad0a('0xb')]({'port':0x232a});config['redis']=_[_0xad0a('0xc')](config[_0xad0a('0xd')],{'host':_0xad0a('0xe'),'port':0x18eb});var socket=require(_0xad0a('0xf'))(new Redis(config[_0xad0a('0xd')]));require(_0xad0a('0x10'))[_0xad0a('0x11')](socket);function respondWithRpcPromise(_0x56566e,_0x36476f,_0x42add6){return new BPromise(function(_0x580503,_0xa2925){return client[_0xad0a('0x12')](_0x56566e,_0x42add6)[_0xad0a('0x13')](function(_0x4439be){logger[_0xad0a('0x14')](_0xad0a('0x15'),_0x36476f,_0xad0a('0x16'));logger[_0xad0a('0x17')](_0xad0a('0x18'),_0x36476f,_0xad0a('0x16'),JSON[_0xad0a('0x19')](_0x4439be));if(_0x4439be[_0xad0a('0x1a')]){if(_0x4439be[_0xad0a('0x1a')][_0xad0a('0x1b')]===0x1f4){logger['error'](_0xad0a('0x15'),_0x36476f,_0x4439be[_0xad0a('0x1a')]['message']);return _0xa2925(_0x4439be[_0xad0a('0x1a')][_0xad0a('0x1c')]);}logger[_0xad0a('0x1a')](_0xad0a('0x15'),_0x36476f,_0x4439be[_0xad0a('0x1a')]['message']);return _0x580503(_0x4439be[_0xad0a('0x1a')][_0xad0a('0x1c')]);}else{logger[_0xad0a('0x14')](_0xad0a('0x15'),_0x36476f,_0xad0a('0x16'));_0x580503(_0x4439be['result'][_0xad0a('0x1c')]);}})['catch'](function(_0x4a3f58){logger[_0xad0a('0x1a')](_0xad0a('0x15'),_0x36476f,_0x4a3f58);_0xa2925(_0x4a3f58);});});}exports['UpdateWhatsappInteraction']=function(_0x168eb0){var _0x4f8da0=this;return new Promise(function(_0x5beaf6,_0x233f86){return db[_0xad0a('0x1d')][_0xad0a('0x1e')](_0x168eb0[_0xad0a('0x1f')],{'raw':_0x168eb0[_0xad0a('0x20')]?_0x168eb0[_0xad0a('0x20')][_0xad0a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168eb0[_0xad0a('0x20')]?_0x168eb0[_0xad0a('0x20')][_0xad0a('0x22')]||null:null,'attributes':_0x168eb0[_0xad0a('0x20')]?_0x168eb0[_0xad0a('0x20')][_0xad0a('0x23')]||null:null,'limit':_0x168eb0[_0xad0a('0x20')]?_0x168eb0['options']['limit']||null:null})[_0xad0a('0x13')](function(_0x33b999){logger['info'](_0xad0a('0x24'),_0x168eb0);logger[_0xad0a('0x17')](_0xad0a('0x24'),_0x168eb0,JSON[_0xad0a('0x19')](_0x33b999));_0x5beaf6(_0x33b999);})['catch'](function(_0x540b07){logger['error']('UpdateWhatsappInteraction',_0x540b07[_0xad0a('0x1c')],_0x168eb0);_0x233f86(_0x4f8da0[_0xad0a('0x1a')](0x1f4,_0x540b07['message']));});});};exports[_0xad0a('0x25')]=function(_0x4d26d0){return new Promise(function(_0x1b0b5f,_0x46b809){return db[_0xad0a('0x1d')][_0xad0a('0x26')]({'where':_0x4d26d0[_0xad0a('0x20')]?_0x4d26d0[_0xad0a('0x20')][_0xad0a('0x22')]||null:null})[_0xad0a('0x13')](function(_0x2ac16f){if(_0x2ac16f){return _0x2ac16f[_0xad0a('0x27')](_0x4d26d0[_0xad0a('0x1f')][_0xad0a('0x28')],_['omit'](_0x4d26d0[_0xad0a('0x1f')],['ids','id'])||{});}})[_0xad0a('0x29')](function(_0x1916b7){logger[_0xad0a('0x14')](_0xad0a('0x2a'),_0x4d26d0);logger[_0xad0a('0x17')](_0xad0a('0x2a'),_0x4d26d0,JSON[_0xad0a('0x19')](_0x1916b7));_0x1b0b5f(_0x1916b7);})[_0xad0a('0x2b')](function(_0x32fb2e){logger[_0xad0a('0x1a')]('AddTags',_0x32fb2e[_0xad0a('0x1c')],_0x4d26d0);_0x46b809(_this[_0xad0a('0x1a')](0x1f4,_0x32fb2e[_0xad0a('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index d87e30f..e6e2a93 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 _0xb926=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x439ea9,_0x375bcf){var _0x1c1639=function(_0x1f0bd9){while(--_0x1f0bd9){_0x439ea9['push'](_0x439ea9['shift']());}};_0x1c1639(++_0x375bcf);}(_0xb926,0x133));var _0x6b92=function(_0x18cc15,_0x4b52c3){_0x18cc15=_0x18cc15-0x0;var _0x2b4185=_0xb926[_0x18cc15];return _0x2b4185;};'use strict';var WhatsappInteractionEvents=require(_0x6b92('0x0'));var events=[_0x6b92('0x1'),_0x6b92('0x2'),_0x6b92('0x3')];function createListener(_0x3ada87,_0x5bb29d){return function(_0x137170){_0x5bb29d['emit'](_0x3ada87,_0x137170);};}function removeListener(_0x2e0327,_0x3804b8){return function(){WhatsappInteractionEvents[_0x6b92('0x4')](_0x2e0327,_0x3804b8);};}exports[_0x6b92('0x5')]=function(_0x466d18){for(var _0x4183f9=0x0,_0x16597d=events[_0x6b92('0x6')];_0x4183f9<_0x16597d;_0x4183f9++){var _0x478070=events[_0x4183f9];var _0x18e5b0=createListener(_0x6b92('0x7')+_0x478070,_0x466d18);WhatsappInteractionEvents['on'](_0x478070,_0x18e5b0);}}; \ No newline at end of file +var _0xd9ff=['removeListener','length','whatsappInteraction:','save','remove','update','emit'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0xd9ff,0x106));var _0xfd9f=function(_0x3eac83,_0x255817){_0x3eac83=_0x3eac83-0x0;var _0x328727=_0xd9ff[_0x3eac83];return _0x328727;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xfd9f('0x0'),_0xfd9f('0x1'),_0xfd9f('0x2')];function createListener(_0x2da855,_0x48575e){return function(_0x33eb7f){_0x48575e[_0xfd9f('0x3')](_0x2da855,_0x33eb7f);};}function removeListener(_0x32dab1,_0x1a8d3e){return function(){WhatsappInteractionEvents[_0xfd9f('0x4')](_0x32dab1,_0x1a8d3e);};}exports['register']=function(_0x70d541){for(var _0x1fdc60=0x0,_0x4f2da1=events[_0xfd9f('0x5')];_0x1fdc60<_0x4f2da1;_0x1fdc60++){var _0x25080a=events[_0x1fdc60];var _0x40bc36=createListener(_0xfd9f('0x6')+_0x25080a,_0x70d541);WhatsappInteractionEvents['on'](_0x25080a,_0x40bc36);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f9cac72..9f4bf48 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 _0x8dbf=['tracked','whatsapp','whatsappmessage:create','create','post','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','show'];(function(_0x4f1749,_0x998e73){var _0x9a9ab3=function(_0x37ee0b){while(--_0x37ee0b){_0x4f1749['push'](_0x4f1749['shift']());}};_0x9a9ab3(++_0x998e73);}(_0x8dbf,0xca));var _0xf8db=function(_0x16a049,_0x267f3d){_0x16a049=_0x16a049-0x0;var _0x3fe723=_0x8dbf[_0x16a049];return _0x3fe723;};'use strict';var multer=require(_0xf8db('0x0'));var util=require(_0xf8db('0x1'));var path=require(_0xf8db('0x2'));var timeout=require(_0xf8db('0x3'));var express=require(_0xf8db('0x4'));var router=express[_0xf8db('0x5')]();var fs_extra=require(_0xf8db('0x6'));var auth=require(_0xf8db('0x7'));var interaction=require(_0xf8db('0x8'));var config=require(_0xf8db('0x9'));var controller=require(_0xf8db('0xa'));router[_0xf8db('0xb')]('/',auth[_0xf8db('0xc')](),controller['index']);router[_0xf8db('0xb')](_0xf8db('0xd'),auth[_0xf8db('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf8db('0xe')]);router['post']('/',auth[_0xf8db('0xc')](),interaction[_0xf8db('0xf')](_0xf8db('0x10'),_0xf8db('0x11')),controller[_0xf8db('0x12')]);router[_0xf8db('0x13')](_0xf8db('0x14'),controller['status']);router[_0xf8db('0x15')](_0xf8db('0x16'),auth[_0xf8db('0xc')](),controller[_0xf8db('0x17')]);router[_0xf8db('0x15')](_0xf8db('0x18'),auth['isAuthenticated'](),controller[_0xf8db('0x19')]);router['put'](_0xf8db('0x1a'),auth[_0xf8db('0xc')](),controller[_0xf8db('0x1b')]);router[_0xf8db('0x1c')](_0xf8db('0x16'),auth[_0xf8db('0xc')](),controller[_0xf8db('0x1d')]);module[_0xf8db('0x1e')]=router; \ No newline at end of file +var _0xddf8=['get','/describe','/:id','show','tracked','whatsappmessage:create','post','/:id/status','status','put','update','/:id/accept','accept','delete','destroy','exports','multer','Router','fs-extra','../../config/environment','./whatsappMessage.controller','isAuthenticated'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xddf8,0x1b2));var _0x8ddf=function(_0x2d0b0b,_0x1b0097){_0x2d0b0b=_0x2d0b0b-0x0;var _0xd6f2d7=_0xddf8[_0x2d0b0b];return _0xd6f2d7;};'use strict';var multer=require(_0x8ddf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8ddf('0x1')]();var fs_extra=require(_0x8ddf('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ddf('0x3'));var controller=require(_0x8ddf('0x4'));router['get']('/',auth[_0x8ddf('0x5')](),controller['index']);router[_0x8ddf('0x6')](_0x8ddf('0x7'),auth[_0x8ddf('0x5')](),controller['describe']);router['get'](_0x8ddf('0x8'),auth['isAuthenticated'](),controller[_0x8ddf('0x9')]);router['post']('/',auth[_0x8ddf('0x5')](),interaction[_0x8ddf('0xa')]('whatsapp',_0x8ddf('0xb')),controller['create']);router[_0x8ddf('0xc')](_0x8ddf('0xd'),controller[_0x8ddf('0xe')]);router[_0x8ddf('0xf')](_0x8ddf('0x8'),auth[_0x8ddf('0x5')](),controller[_0x8ddf('0x10')]);router[_0x8ddf('0xf')](_0x8ddf('0x11'),auth[_0x8ddf('0x5')](),controller[_0x8ddf('0x12')]);router[_0x8ddf('0xf')]('/:id/reject',auth[_0x8ddf('0x5')](),controller['reject']);router[_0x8ddf('0x13')](_0x8ddf('0x8'),auth[_0x8ddf('0x5')](),controller[_0x8ddf('0x14')]);module[_0x8ddf('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 01c8c8a..ea13474 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 _0x27c9=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x2ecd83,_0x3594e8){var _0x435f08=function(_0x2eb454){while(--_0x2eb454){_0x2ecd83['push'](_0x2ecd83['shift']());}};_0x435f08(++_0x3594e8);}(_0x27c9,0x1e7));var _0x927c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x27c9[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x927c('0x0'));module[_0x927c('0x1')]={'body':{'type':Sequelize[_0x927c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x927c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x927c('0x4')]('in',_0x927c('0x5')),'defaultValue':_0x927c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x927c('0x6')](0xbe)},'phone':{'type':Sequelize[_0x927c('0x6')]},'readAt':{'type':Sequelize[_0x927c('0x7')]},'secret':{'type':Sequelize[_0x927c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x927c('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x00b7=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x00b7,0x160));var _0x700b=function(_0x1d6d91,_0xa157de){_0x1d6d91=_0x1d6d91-0x0;var _0x154f7c=_0x00b7[_0x1d6d91];return _0x154f7c;};'use strict';var Sequelize=require(_0x700b('0x0'));module[_0x700b('0x1')]={'body':{'type':Sequelize[_0x700b('0x2')](_0x700b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x700b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x700b('0x5')]('in',_0x700b('0x6')),'defaultValue':_0x700b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x700b('0x7')](0xbe)},'phone':{'type':Sequelize[_0x700b('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x700b('0x7')]},'providerResponse':{'type':Sequelize[_0x700b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 6b2e193..938771f 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 _0xe298=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','sendStatus','stack','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','name','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','show','params','length','include','options','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1e5330,_0x2404eb){var _0x20376f=function(_0x34364b){while(--_0x34364b){_0x1e5330['push'](_0x1e5330['shift']());}};_0x20376f(++_0x2404eb);}(_0xe298,0x82));var _0x8e29=function(_0x139cdf,_0x2897cd){_0x139cdf=_0x139cdf-0x0;var _0x2e8d=_0xe298[_0x139cdf];return _0x2e8d;};'use strict';var emlformat=require(_0x8e29('0x0'));var rimraf=require(_0x8e29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e29('0x2'));var rp=require('request-promise');var moment=require(_0x8e29('0x3'));var BPromise=require(_0x8e29('0x4'));var Mustache=require(_0x8e29('0x5'));var util=require(_0x8e29('0x6'));var path=require(_0x8e29('0x7'));var sox=require(_0x8e29('0x8'));var csv=require(_0x8e29('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e29('0xa'));var _=require(_0x8e29('0xb'));var squel=require(_0x8e29('0xc'));var crypto=require(_0x8e29('0xd'));var jsforce=require(_0x8e29('0xe'));var deskjs=require(_0x8e29('0xf'));var toCsv=require(_0x8e29('0x9'));var querystring=require('querystring');var Papa=require(_0x8e29('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8e29('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e29('0x12'));var utils=require(_0x8e29('0x13'));var config=require(_0x8e29('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e29('0x15'))['db'];config['redis']=_['defaults'](config[_0x8e29('0x16')],{'host':_0x8e29('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e29('0x16')]));require(_0x8e29('0x18'))[_0x8e29('0x19')](socket);var jayson=require(_0x8e29('0x1a'));var client=jayson[_0x8e29('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8e29('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x169a20,_0x11b9e9,_0x2fc688,_0x5c2c06){return new BPromise(function(_0x24c786,_0x3b107e){var _0x1988cd=_0x5c2c06||client;return _0x1988cd[_0x8e29('0x1d')](_0x169a20,_0x2fc688)[_0x8e29('0x1e')](function(_0xa8da11){logger[_0x8e29('0x1f')](_0x8e29('0x20'),_0x11b9e9,'request\x20sent');logger[_0x8e29('0x21')](_0x8e29('0x22'),_0x11b9e9,_0x8e29('0x23'),JSON['stringify'](_0xa8da11));if(_0xa8da11['error']){if(_0xa8da11[_0x8e29('0x24')]['code']===0x1f4){logger[_0x8e29('0x24')](_0x8e29('0x20'),_0x11b9e9,_0xa8da11[_0x8e29('0x24')][_0x8e29('0x25')]);return _0x3b107e(_0xa8da11[_0x8e29('0x24')][_0x8e29('0x25')]);}logger['error'](_0x8e29('0x20'),_0x11b9e9,_0xa8da11[_0x8e29('0x24')][_0x8e29('0x25')]);return _0x24c786(_0xa8da11[_0x8e29('0x24')]['message']);}else{logger[_0x8e29('0x1f')](_0x8e29('0x20'),_0x11b9e9,'request\x20sent');_0x24c786(_0xa8da11[_0x8e29('0x26')]['message']);}})[_0x8e29('0x27')](function(_0xf88f28){logger[_0x8e29('0x24')](_0x8e29('0x20'),_0x11b9e9,_0xf88f28);_0x3b107e(_0xf88f28);});});}function respondWithStatusCode(_0x181748,_0x553293){_0x553293=_0x553293||0xcc;return function(_0x507fea){if(_0x507fea){return _0x181748['sendStatus'](_0x553293);}return _0x181748[_0x8e29('0x28')](_0x553293)[_0x8e29('0x29')]();};}function respondWithResult(_0x370d10,_0x1c9064){_0x1c9064=_0x1c9064||0xc8;return function(_0x5cc1d1){if(_0x5cc1d1){return _0x370d10[_0x8e29('0x28')](_0x1c9064)[_0x8e29('0x2a')](_0x5cc1d1);}};}function respondWithFilteredResult(_0x20abcf,_0xcd200f){return function(_0x5109b8){if(_0x5109b8){var _0x3c1814=typeof _0xcd200f[_0x8e29('0x2b')]===_0x8e29('0x2c')&&typeof _0xcd200f[_0x8e29('0x2d')]===_0x8e29('0x2c');var _0x20d1b5=_0x5109b8['count'];var _0x30d877=_0x3c1814?0x0:_0xcd200f['offset'];var _0x3f1e2b=_0x3c1814?_0x5109b8[_0x8e29('0x2e')]:_0xcd200f[_0x8e29('0x2b')]+_0xcd200f['limit'];var _0x4246a4;if(_0x3f1e2b>=_0x20d1b5){_0x3f1e2b=_0x20d1b5;_0x4246a4=0xc8;}else{_0x4246a4=0xce;}_0x20abcf[_0x8e29('0x28')](_0x4246a4);return _0x20abcf['set'](_0x8e29('0x2f'),_0x30d877+'-'+_0x3f1e2b+'/'+_0x20d1b5)[_0x8e29('0x2a')](_0x5109b8);}return null;};}function patchUpdates(_0x3853c0){return function(_0x586d54){try{jsonpatch['apply'](_0x586d54,_0x3853c0,!![]);}catch(_0x19abb8){return BPromise[_0x8e29('0x30')](_0x19abb8);}return _0x586d54[_0x8e29('0x31')]();};}function saveUpdates(_0x8e81c1,_0x3d9b60){return function(_0x2c0154){if(_0x2c0154){return _0x2c0154[_0x8e29('0x32')](_0x8e81c1)['then'](function(_0x346f58){return _0x346f58;});}return null;};}function removeEntity(_0x96868e,_0x32d4e3){return function(_0x1483b0){if(_0x1483b0){return _0x1483b0[_0x8e29('0x33')]()[_0x8e29('0x1e')](function(){_0x96868e[_0x8e29('0x28')](0xcc)[_0x8e29('0x29')]();});}};}function handleEntityNotFound(_0x421945,_0x592c52){return function(_0x5cddd0){if(!_0x5cddd0){_0x421945[_0x8e29('0x34')](0x194);}return _0x5cddd0;};}function handleError(_0x50ae67,_0x4a0097){_0x4a0097=_0x4a0097||0x1f4;return function(_0x2ca1e3){logger[_0x8e29('0x24')](_0x2ca1e3[_0x8e29('0x35')]);if(_0x2ca1e3['name']){delete _0x2ca1e3['name'];}_0x50ae67[_0x8e29('0x28')](_0x4a0097)[_0x8e29('0x36')](_0x2ca1e3);};}exports[_0x8e29('0x37')]=function(_0x100b71,_0x2adbfd){var _0x555054={},_0x26496a={},_0x5e81e0={'count':0x0,'rows':[]};var _0x20c1d2=_[_0x8e29('0x38')](db[_0x8e29('0x39')][_0x8e29('0x3a')],function(_0x2e949c){return{'name':_0x2e949c[_0x8e29('0x3b')],'type':_0x2e949c[_0x8e29('0x3c')][_0x8e29('0x3d')]};});_0x26496a['model']=_[_0x8e29('0x38')](_0x20c1d2,_0x8e29('0x3e'));_0x26496a['query']=_[_0x8e29('0x3f')](_0x100b71[_0x8e29('0x40')]);_0x26496a['filters']=_[_0x8e29('0x41')](_0x26496a[_0x8e29('0x42')],_0x26496a[_0x8e29('0x40')]);_0x555054['attributes']=_['intersection'](_0x26496a[_0x8e29('0x42')],qs[_0x8e29('0x43')](_0x100b71[_0x8e29('0x40')][_0x8e29('0x43')]));_0x555054[_0x8e29('0x44')]=_0x555054['attributes']['length']?_0x555054[_0x8e29('0x44')]:_0x26496a[_0x8e29('0x42')];if(!_0x100b71[_0x8e29('0x40')][_0x8e29('0x45')](_0x8e29('0x46'))){_0x555054[_0x8e29('0x2d')]=qs['limit'](_0x100b71[_0x8e29('0x40')][_0x8e29('0x2d')]);_0x555054[_0x8e29('0x2b')]=qs[_0x8e29('0x2b')](_0x100b71[_0x8e29('0x40')]['offset']);}_0x555054[_0x8e29('0x47')]=qs[_0x8e29('0x48')](_0x100b71[_0x8e29('0x40')][_0x8e29('0x48')]);_0x555054[_0x8e29('0x49')]=qs['filters'](_['pick'](_0x100b71[_0x8e29('0x40')],_0x26496a[_0x8e29('0x4a')]),_0x20c1d2);if(_0x100b71['query'][_0x8e29('0x4b')]){_0x555054[_0x8e29('0x49')]=_[_0x8e29('0x4c')](_0x555054[_0x8e29('0x49')],{'$or':_[_0x8e29('0x38')](_0x20c1d2,function(_0x55e394){if(_0x55e394['type']!==_0x8e29('0x4d')){var _0x63ac65={};_0x63ac65[_0x55e394[_0x8e29('0x3e')]]={'$like':'%'+_0x100b71[_0x8e29('0x40')]['filter']+'%'};return _0x63ac65;}})});}_0x555054=_[_0x8e29('0x4c')]({},_0x555054,_0x100b71['options']);var _0x52e743={'where':_0x555054['where']};return db[_0x8e29('0x39')][_0x8e29('0x2e')](_0x52e743)[_0x8e29('0x1e')](function(_0x3a230c){_0x5e81e0['count']=_0x3a230c;if(_0x100b71[_0x8e29('0x40')][_0x8e29('0x4e')]){_0x555054['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x555054);})[_0x8e29('0x1e')](function(_0x76a9d4){_0x5e81e0['rows']=_0x76a9d4;return _0x5e81e0;})[_0x8e29('0x1e')](respondWithFilteredResult(_0x2adbfd,_0x555054))[_0x8e29('0x27')](handleError(_0x2adbfd,null));};exports[_0x8e29('0x4f')]=function(_0x5460d2,_0x49083e){var _0xc204a2={'raw':!![],'where':{'id':_0x5460d2[_0x8e29('0x50')]['id']}},_0x26854f={};_0x26854f[_0x8e29('0x42')]=_[_0x8e29('0x3f')](db[_0x8e29('0x39')][_0x8e29('0x3a')]);_0x26854f['query']=_[_0x8e29('0x3f')](_0x5460d2[_0x8e29('0x40')]);_0x26854f['filters']=_[_0x8e29('0x41')](_0x26854f[_0x8e29('0x42')],_0x26854f[_0x8e29('0x40')]);_0xc204a2[_0x8e29('0x44')]=_[_0x8e29('0x41')](_0x26854f['model'],qs[_0x8e29('0x43')](_0x5460d2[_0x8e29('0x40')][_0x8e29('0x43')]));_0xc204a2['attributes']=_0xc204a2['attributes'][_0x8e29('0x51')]?_0xc204a2[_0x8e29('0x44')]:_0x26854f[_0x8e29('0x42')];if(_0x5460d2[_0x8e29('0x40')][_0x8e29('0x4e')]){_0xc204a2[_0x8e29('0x52')]=[{'all':!![]}];}_0xc204a2=_[_0x8e29('0x4c')]({},_0xc204a2,_0x5460d2[_0x8e29('0x53')]);return db[_0x8e29('0x39')][_0x8e29('0x54')](_0xc204a2)['then'](handleEntityNotFound(_0x49083e,null))[_0x8e29('0x1e')](respondWithResult(_0x49083e,null))[_0x8e29('0x27')](handleError(_0x49083e,null));};exports[_0x8e29('0x55')]=function(_0x26a2bb,_0x4462c3){return db[_0x8e29('0x39')][_0x8e29('0x55')](_0x26a2bb['body'],{})['then'](respondWithResult(_0x4462c3,0xc9))[_0x8e29('0x27')](handleError(_0x4462c3,null));};exports['update']=function(_0x15267b,_0x4ac357){if(_0x15267b[_0x8e29('0x56')]['id']){delete _0x15267b[_0x8e29('0x56')]['id'];}return db['WhatsappMessage'][_0x8e29('0x54')]({'where':{'id':_0x15267b['params']['id']}})[_0x8e29('0x1e')](handleEntityNotFound(_0x4ac357,null))[_0x8e29('0x1e')](saveUpdates(_0x15267b[_0x8e29('0x56')],null))['then'](respondWithResult(_0x4ac357,null))[_0x8e29('0x27')](handleError(_0x4ac357,null));};exports[_0x8e29('0x33')]=function(_0x222b50,_0x3f0fd2){return db['WhatsappMessage'][_0x8e29('0x54')]({'where':{'id':_0x222b50['params']['id']}})[_0x8e29('0x1e')](handleEntityNotFound(_0x3f0fd2,null))['then'](removeEntity(_0x3f0fd2,null))[_0x8e29('0x27')](handleError(_0x3f0fd2,null));};exports['describe']=function(_0x1fa33c,_0x4585bd){return db[_0x8e29('0x39')][_0x8e29('0x57')]()[_0x8e29('0x1e')](respondWithResult(_0x4585bd,null))['catch'](handleError(_0x4585bd,null));};var interaction_log=require(_0x8e29('0x58'))(_0x8e29('0x59'));exports[_0x8e29('0x5a')]=function(_0xfed8fd,_0x1c1ce7,_0x30bc63){var _0x43b1e2={'agent':{},'channel':_0x8e29('0x5b')};if(_0xfed8fd[_0x8e29('0x56')]['id']){delete _0xfed8fd[_0x8e29('0x56')]['id'];}_0xfed8fd[_0x8e29('0x56')]['read']=!![];_0xfed8fd[_0x8e29('0x56')][_0x8e29('0x5c')]=moment()[_0x8e29('0x5d')](_0x8e29('0x5e'));_0xfed8fd[_0x8e29('0x56')]['UserId']=_0xfed8fd[_0x8e29('0x56')]['UserId']||_0xfed8fd[_0x8e29('0x5f')]['id'];_0x43b1e2[_0x8e29('0x60')]['id']=_0xfed8fd[_0x8e29('0x56')][_0x8e29('0x61')];return db['WhatsappMessage']['find']({'where':{'id':_0xfed8fd[_0x8e29('0x50')]['id'],'UserId':null}})[_0x8e29('0x1e')](handleEntityNotFound(_0x1c1ce7,null))[_0x8e29('0x1e')](saveUpdates(_0xfed8fd[_0x8e29('0x56')],null))[_0x8e29('0x1e')](function(_0x1778f7){if(_0x1778f7){_0x43b1e2[_0x8e29('0x25')]=_0x1778f7[_0x8e29('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x8e29('0x54')]({'where':{'id':_0x1778f7[_0x8e29('0x63')]}});}return null;})[_0x8e29('0x1e')](handleEntityNotFound(_0x1c1ce7,null))[_0x8e29('0x1e')](function(_0x40cef6){if(_0x40cef6){return _0x40cef6[_0x8e29('0x32')]({'UserId':_0xfed8fd[_0x8e29('0x56')][_0x8e29('0x61')],'read1stAt':_[_0x8e29('0x64')](_0x40cef6[_0x8e29('0x65')])?moment()[_0x8e29('0x5d')](_0x8e29('0x5e')):undefined});}return null;})[_0x8e29('0x1e')](function(_0x384752){if(_0x384752){_0x43b1e2[_0x8e29('0x66')]=_0x384752['get']({'plain':!![]});interaction_log[_0x8e29('0x1f')](_0x8e29('0x67'),_0xfed8fd[_0x8e29('0x5f')]['id'],_0xfed8fd[_0x8e29('0x5f')][_0x8e29('0x3e')],_0xfed8fd[_0x8e29('0x5f')]['role'],_0x43b1e2[_0x8e29('0x66')]['id'],_0xfed8fd['body']?JSON['stringify'](_0xfed8fd[_0x8e29('0x56')]):_0x8e29('0x68'));return respondWithRpcPromise(_0x8e29('0x69'),_0x8e29('0x6a'),_0x43b1e2);}return null;})[_0x8e29('0x1e')](function(_0x269b4c){var _0x4ce7a5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x269b4c[_0x8e29('0x25')]['ContactId'];return db[_0x8e29('0x6b')][_0x8e29('0x40')](_0x4ce7a5,{'type':db[_0x8e29('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8e29('0x1e')](function(_0x12867f){return _0x12867f;});})[_0x8e29('0x1e')](function(_0x44d866){if(_0x44d866){_0x43b1e2[_0x8e29('0x25')][_0x8e29('0x6d')]=_0x44d866[0x0];if(!_0xfed8fd[_0x8e29('0x56')][_0x8e29('0x61')])return;return db[_0x8e29('0x6e')][_0x8e29('0x54')]({'where':{'id':_0xfed8fd[_0x8e29('0x56')][_0x8e29('0x61')],'role':_0x8e29('0x60')},'attributes':['id',_0x8e29('0x3e'),_0x8e29('0x6f'),_0x8e29('0x70'),_0x8e29('0x71')],'raw':!![]});}return null;})[_0x8e29('0x1e')](function(_0x4d88b8){if(!_0x4d88b8)return null;_0x43b1e2[_0x8e29('0x25')][_0x8e29('0x60')]=_0x4d88b8;return _0x43b1e2;})[_0x8e29('0x1e')](function(_0x1420e1){if(_0x1420e1){if(_0xfed8fd['body'][_0x8e29('0x72')]){_0x43b1e2[_0x8e29('0x25')][_0x8e29('0x73')]=util[_0x8e29('0x5d')](_0x8e29('0x74'),_0xfed8fd[_0x8e29('0x5f')][_0x8e29('0x3e')]);_0x43b1e2[_0x8e29('0x25')][_0x8e29('0x75')]=_0x43b1e2[_0x8e29('0x75')];_0x43b1e2['message'][_0x8e29('0x76')]=_0x43b1e2[_0x8e29('0x75')];_0x43b1e2[_0x8e29('0x25')]['event']=_0x8e29('0x5a');return respondWithRpcPromise(_0x8e29('0x77'),_0x8e29('0x77'),{'event':_0x8e29('0x78'),'message':_0x43b1e2[_0x8e29('0x25')]},client9002)[_0x8e29('0x1e')](function(){return _0x43b1e2;});}return _0x43b1e2;}return null;})[_0x8e29('0x1e')](respondWithResult(_0x1c1ce7,null))[_0x8e29('0x27')](handleError(_0x1c1ce7,null));};var interaction_log=require(_0x8e29('0x58'))(_0x8e29('0x59'));exports['reject']=function(_0x3edc38,_0x213994,_0x66b802){var _0x3e8a08={'agent':{},'channel':'whatsapp'};if(_0x3edc38[_0x8e29('0x56')]['id']){delete _0x3edc38[_0x8e29('0x56')]['id'];}_0x3edc38[_0x8e29('0x56')][_0x8e29('0x61')]=_0x3edc38[_0x8e29('0x56')][_0x8e29('0x61')]||_0x3edc38[_0x8e29('0x5f')]['id'];_0x3e8a08[_0x8e29('0x60')]['id']=_0x3edc38[_0x8e29('0x56')][_0x8e29('0x61')];return db['WhatsappMessage'][_0x8e29('0x54')]({'where':{'id':_0x3edc38[_0x8e29('0x50')]['id'],'UserId':null}})[_0x8e29('0x1e')](handleEntityNotFound(_0x213994,null))['then'](function(_0x4b3167){if(_0x4b3167){_0x3e8a08['message']=_0x4b3167[_0x8e29('0x62')]({'plain':!![]});return db[_0x8e29('0x79')][_0x8e29('0x54')]({'where':{'id':_0x4b3167[_0x8e29('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x213994,null))[_0x8e29('0x1e')](function(_0x4eee88){if(_0x4eee88){_0x3e8a08[_0x8e29('0x66')]=_0x4eee88[_0x8e29('0x62')]({'plain':!![]});interaction_log[_0x8e29('0x1f')](_0x8e29('0x7a'),_0x3edc38[_0x8e29('0x5f')]['id'],_0x3edc38[_0x8e29('0x5f')][_0x8e29('0x3e')],_0x3edc38[_0x8e29('0x5f')]['role'],_0x3e8a08[_0x8e29('0x66')]['id'],_0x3edc38['body']?JSON[_0x8e29('0x7b')](_0x3edc38[_0x8e29('0x56')]):_0x8e29('0x68'));return respondWithRpcPromise('RejectMessage',_0x8e29('0x7c'),_0x3e8a08);}return null;})[_0x8e29('0x1e')](function(_0x61fba2){var _0x468aeb=_0x8e29('0x7d')+_0x61fba2[_0x8e29('0x25')][_0x8e29('0x7e')];return db[_0x8e29('0x6b')][_0x8e29('0x40')](_0x468aeb,{'type':db['Sequelize'][_0x8e29('0x7f')]['SELECT'],'raw':!![]})[_0x8e29('0x1e')](function(_0x5a214a){return _0x5a214a;});})[_0x8e29('0x1e')](function(_0x327b4d){if(_0x327b4d){_0x3e8a08[_0x8e29('0x25')][_0x8e29('0x6d')]=_0x327b4d[0x0];if(!_0x3edc38[_0x8e29('0x56')]['UserId'])return;return db[_0x8e29('0x6e')][_0x8e29('0x54')]({'where':{'id':_0x3edc38[_0x8e29('0x56')]['UserId'],'role':_0x8e29('0x60')},'attributes':['id',_0x8e29('0x3e'),_0x8e29('0x6f'),_0x8e29('0x70'),_0x8e29('0x71')],'raw':!![]});}return null;})[_0x8e29('0x1e')](function(_0x2e6c3c){if(!_0x2e6c3c)return null;_0x3e8a08[_0x8e29('0x25')]['agent']=_0x2e6c3c;return _0x3e8a08;})[_0x8e29('0x1e')](function(_0x17f70f){if(_0x17f70f){_0x17f70f[_0x8e29('0x25')][_0x8e29('0x73')]=util['format']('SIP/%s',_0x3edc38[_0x8e29('0x5f')]['name']);_0x17f70f[_0x8e29('0x25')]['channel']=_0x3e8a08[_0x8e29('0x75')];_0x17f70f['message'][_0x8e29('0x76')]=_0x3e8a08['channel'];_0x17f70f[_0x8e29('0x25')]['event']='reject';respondWithRpcPromise(_0x8e29('0x77'),_0x8e29('0x77'),{'event':_0x8e29('0x80'),'message':_0x17f70f[_0x8e29('0x25')]},client9002);return _0x3e8a08;}return null;})[_0x8e29('0x1e')](respondWithResult(_0x213994,null))['catch'](handleError(_0x213994,null));};exports['status']=function(_0x8bdacd,_0x40bc33,_0x4f4246){if(_0x8bdacd['body']['id']){delete _0x8bdacd['body']['id'];}var _0xacec1b;return db[_0x8e29('0x39')][_0x8e29('0x54')]({'where':{'id':_0x8bdacd[_0x8e29('0x50')]['id']}})[_0x8e29('0x1e')](handleEntityNotFound(_0x40bc33,null))[_0x8e29('0x1e')](function(_0x32f766){if(_0x32f766){_0xacec1b=_0x32f766;return db[_0x8e29('0x81')][_0x8e29('0x54')]({'where':{'id':_0x32f766[_0x8e29('0x82')]}});}})[_0x8e29('0x1e')](handleEntityNotFound(_0x40bc33,null))[_0x8e29('0x1e')](function(_0x39252c){if(_0x39252c){logger['debug'](_0x8e29('0x83'),_0x8e29('0x28'),_0x8e29('0x84'),_0x39252c[_0x8e29('0x3c')],util[_0x8e29('0x85')](_0x8bdacd[_0x8e29('0x56')],{'showHidden':![],'depth':null}));switch(_0x39252c[_0x8e29('0x3c')]){case _0x8e29('0x86'):if(_0x8bdacd[_0x8e29('0x56')]['MessageSid']&&_0x8bdacd[_0x8e29('0x56')][_0x8e29('0x87')]===_0xacec1b[_0x8e29('0x88')]&&_0x8bdacd[_0x8e29('0x56')][_0x8e29('0x89')]&&_0x8bdacd[_0x8e29('0x56')][_0x8e29('0x89')]===_0x8e29('0x8a')){return _0xacec1b[_0x8e29('0x32')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x8e29('0x86'),util[_0x8e29('0x85')](_0x8bdacd[_0x8e29('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xacec1b;}})[_0x8e29('0x1e')](respondWithResult(_0x40bc33,null))[_0x8e29('0x27')](handleError(_0x40bc33,null));}; \ No newline at end of file +var _0xa5b5=['AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','SELECT','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','create','body','update','find','describe','../../config/logger','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa5b5,0x13f));var _0x5a5b=function(_0x3cb04f,_0x38c760){_0x3cb04f=_0x3cb04f-0x0;var _0x195426=_0xa5b5[_0x3cb04f];return _0x195426;};'use strict';var emlformat=require(_0x5a5b('0x0'));var rimraf=require(_0x5a5b('0x1'));var zipdir=require(_0x5a5b('0x2'));var jsonpatch=require(_0x5a5b('0x3'));var rp=require(_0x5a5b('0x4'));var moment=require(_0x5a5b('0x5'));var BPromise=require(_0x5a5b('0x6'));var Mustache=require(_0x5a5b('0x7'));var util=require('util');var path=require(_0x5a5b('0x8'));var sox=require('sox');var csv=require(_0x5a5b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a5b('0xa'));var squel=require(_0x5a5b('0xb'));var crypto=require(_0x5a5b('0xc'));var jsforce=require(_0x5a5b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5a5b('0x9'));var querystring=require(_0x5a5b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a5b('0xf'));var as=require(_0x5a5b('0x10'));var hardwareService=require(_0x5a5b('0x11'));var logger=require('../../config/logger')(_0x5a5b('0x12'));var utils=require(_0x5a5b('0x13'));var config=require(_0x5a5b('0x14'));var licenseUtil=require(_0x5a5b('0x15'));var db=require(_0x5a5b('0x16'))['db'];config[_0x5a5b('0x17')]=_[_0x5a5b('0x18')](config[_0x5a5b('0x17')],{'host':_0x5a5b('0x19'),'port':0x18eb});var socket=require(_0x5a5b('0x1a'))(new Redis(config[_0x5a5b('0x17')]));require(_0x5a5b('0x1b'))[_0x5a5b('0x1c')](socket);var jayson=require(_0x5a5b('0x1d'));var client=jayson['client'][_0x5a5b('0x1e')]({'port':0x232c});var client9002=jayson[_0x5a5b('0x1f')][_0x5a5b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x556a12,_0x4efd11,_0x253ea1,_0x312735){return new BPromise(function(_0x4dd1b7,_0x5502bf){var _0x2d800f=_0x312735||client;return _0x2d800f[_0x5a5b('0x20')](_0x556a12,_0x253ea1)[_0x5a5b('0x21')](function(_0x38f44f){logger[_0x5a5b('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x4efd11,_0x5a5b('0x23'));logger['debug'](_0x5a5b('0x24'),_0x4efd11,'request\x20sent',JSON[_0x5a5b('0x25')](_0x38f44f));if(_0x38f44f[_0x5a5b('0x26')]){if(_0x38f44f[_0x5a5b('0x26')][_0x5a5b('0x27')]===0x1f4){logger[_0x5a5b('0x26')](_0x5a5b('0x28'),_0x4efd11,_0x38f44f[_0x5a5b('0x26')][_0x5a5b('0x29')]);return _0x5502bf(_0x38f44f[_0x5a5b('0x26')][_0x5a5b('0x29')]);}logger['error'](_0x5a5b('0x28'),_0x4efd11,_0x38f44f[_0x5a5b('0x26')]['message']);return _0x4dd1b7(_0x38f44f[_0x5a5b('0x26')][_0x5a5b('0x29')]);}else{logger[_0x5a5b('0x22')](_0x5a5b('0x28'),_0x4efd11,_0x5a5b('0x23'));_0x4dd1b7(_0x38f44f[_0x5a5b('0x2a')]['message']);}})[_0x5a5b('0x2b')](function(_0x48a80a){logger[_0x5a5b('0x26')](_0x5a5b('0x28'),_0x4efd11,_0x48a80a);_0x5502bf(_0x48a80a);});});}function respondWithStatusCode(_0x2277e5,_0x51ab9e){_0x51ab9e=_0x51ab9e||0xcc;return function(_0x48542d){if(_0x48542d){return _0x2277e5[_0x5a5b('0x2c')](_0x51ab9e);}return _0x2277e5[_0x5a5b('0x2d')](_0x51ab9e)[_0x5a5b('0x2e')]();};}function respondWithResult(_0x191288,_0x172238){_0x172238=_0x172238||0xc8;return function(_0x3b41e4){if(_0x3b41e4){return _0x191288['status'](_0x172238)[_0x5a5b('0x2f')](_0x3b41e4);}};}function respondWithFilteredResult(_0x3c4bd1,_0x4c451f){return function(_0x427952){if(_0x427952){var _0x1218e7=typeof _0x4c451f[_0x5a5b('0x30')]===_0x5a5b('0x31')&&typeof _0x4c451f['limit']===_0x5a5b('0x31');var _0x5f4935=_0x427952[_0x5a5b('0x32')];var _0x99034f=_0x1218e7?0x0:_0x4c451f[_0x5a5b('0x30')];var _0xf9fc64=_0x1218e7?_0x427952[_0x5a5b('0x32')]:_0x4c451f[_0x5a5b('0x30')]+_0x4c451f[_0x5a5b('0x33')];var _0x4f4c5e;if(_0xf9fc64>=_0x5f4935){_0xf9fc64=_0x5f4935;_0x4f4c5e=0xc8;}else{_0x4f4c5e=0xce;}_0x3c4bd1['status'](_0x4f4c5e);return _0x3c4bd1[_0x5a5b('0x34')](_0x5a5b('0x35'),_0x99034f+'-'+_0xf9fc64+'/'+_0x5f4935)[_0x5a5b('0x2f')](_0x427952);}return null;};}function patchUpdates(_0x30da43){return function(_0x5538a0){try{jsonpatch['apply'](_0x5538a0,_0x30da43,!![]);}catch(_0x26cbe2){return BPromise[_0x5a5b('0x36')](_0x26cbe2);}return _0x5538a0[_0x5a5b('0x37')]();};}function saveUpdates(_0x318d34,_0xa86af1){return function(_0x291a9d){if(_0x291a9d){return _0x291a9d['update'](_0x318d34)[_0x5a5b('0x21')](function(_0xca4cd9){return _0xca4cd9;});}return null;};}function removeEntity(_0x5637c5,_0x48c49b){return function(_0x1f7cfa){if(_0x1f7cfa){return _0x1f7cfa[_0x5a5b('0x38')]()['then'](function(){_0x5637c5['status'](0xcc)[_0x5a5b('0x2e')]();});}};}function handleEntityNotFound(_0x3b9564,_0x4d674c){return function(_0x2b1dfc){if(!_0x2b1dfc){_0x3b9564[_0x5a5b('0x2c')](0x194);}return _0x2b1dfc;};}function handleError(_0x22b5eb,_0x58d126){_0x58d126=_0x58d126||0x1f4;return function(_0x481002){logger['error'](_0x481002[_0x5a5b('0x39')]);if(_0x481002[_0x5a5b('0x3a')]){delete _0x481002['name'];}_0x22b5eb[_0x5a5b('0x2d')](_0x58d126)[_0x5a5b('0x3b')](_0x481002);};}exports[_0x5a5b('0x3c')]=function(_0x4c1186,_0x24bb97){var _0x3412f7={},_0x3c7234={},_0xc894ba={'count':0x0,'rows':[]};var _0x1472ad=_[_0x5a5b('0x3d')](db[_0x5a5b('0x3e')][_0x5a5b('0x3f')],function(_0x31ba62){return{'name':_0x31ba62[_0x5a5b('0x40')],'type':_0x31ba62[_0x5a5b('0x41')][_0x5a5b('0x42')]};});_0x3c7234[_0x5a5b('0x43')]=_[_0x5a5b('0x3d')](_0x1472ad,'name');_0x3c7234['query']=_[_0x5a5b('0x44')](_0x4c1186['query']);_0x3c7234[_0x5a5b('0x45')]=_[_0x5a5b('0x46')](_0x3c7234[_0x5a5b('0x43')],_0x3c7234[_0x5a5b('0x47')]);_0x3412f7[_0x5a5b('0x48')]=_[_0x5a5b('0x46')](_0x3c7234['model'],qs[_0x5a5b('0x49')](_0x4c1186[_0x5a5b('0x47')]['fields']));_0x3412f7[_0x5a5b('0x48')]=_0x3412f7['attributes'][_0x5a5b('0x4a')]?_0x3412f7['attributes']:_0x3c7234['model'];if(!_0x4c1186[_0x5a5b('0x47')]['hasOwnProperty'](_0x5a5b('0x4b'))){_0x3412f7[_0x5a5b('0x33')]=qs['limit'](_0x4c1186[_0x5a5b('0x47')]['limit']);_0x3412f7[_0x5a5b('0x30')]=qs['offset'](_0x4c1186[_0x5a5b('0x47')][_0x5a5b('0x30')]);}_0x3412f7[_0x5a5b('0x4c')]=qs[_0x5a5b('0x4d')](_0x4c1186[_0x5a5b('0x47')]['sort']);_0x3412f7[_0x5a5b('0x4e')]=qs[_0x5a5b('0x45')](_['pick'](_0x4c1186[_0x5a5b('0x47')],_0x3c7234[_0x5a5b('0x45')]),_0x1472ad);if(_0x4c1186[_0x5a5b('0x47')][_0x5a5b('0x4f')]){_0x3412f7[_0x5a5b('0x4e')]=_[_0x5a5b('0x50')](_0x3412f7[_0x5a5b('0x4e')],{'$or':_[_0x5a5b('0x3d')](_0x1472ad,function(_0x5f2544){if(_0x5f2544[_0x5a5b('0x41')]!=='VIRTUAL'){var _0x326bdf={};_0x326bdf[_0x5f2544['name']]={'$like':'%'+_0x4c1186[_0x5a5b('0x47')][_0x5a5b('0x4f')]+'%'};return _0x326bdf;}})});}_0x3412f7=_[_0x5a5b('0x50')]({},_0x3412f7,_0x4c1186[_0x5a5b('0x51')]);var _0x416ab3={'where':_0x3412f7[_0x5a5b('0x4e')]};return db[_0x5a5b('0x3e')]['count'](_0x416ab3)[_0x5a5b('0x21')](function(_0x3cdf74){_0xc894ba[_0x5a5b('0x32')]=_0x3cdf74;if(_0x4c1186[_0x5a5b('0x47')][_0x5a5b('0x52')]){_0x3412f7[_0x5a5b('0x53')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5a5b('0x54')](_0x3412f7);})[_0x5a5b('0x21')](function(_0x22b2f8){_0xc894ba[_0x5a5b('0x55')]=_0x22b2f8;return _0xc894ba;})[_0x5a5b('0x21')](respondWithFilteredResult(_0x24bb97,_0x3412f7))['catch'](handleError(_0x24bb97,null));};exports['show']=function(_0x180c77,_0xa9af56){var _0x5af24a={'raw':!![],'where':{'id':_0x180c77[_0x5a5b('0x56')]['id']}},_0x104232={};_0x104232[_0x5a5b('0x43')]=_[_0x5a5b('0x44')](db[_0x5a5b('0x3e')][_0x5a5b('0x3f')]);_0x104232[_0x5a5b('0x47')]=_['keys'](_0x180c77[_0x5a5b('0x47')]);_0x104232[_0x5a5b('0x45')]=_['intersection'](_0x104232[_0x5a5b('0x43')],_0x104232[_0x5a5b('0x47')]);_0x5af24a[_0x5a5b('0x48')]=_[_0x5a5b('0x46')](_0x104232['model'],qs[_0x5a5b('0x49')](_0x180c77[_0x5a5b('0x47')][_0x5a5b('0x49')]));_0x5af24a['attributes']=_0x5af24a['attributes']['length']?_0x5af24a[_0x5a5b('0x48')]:_0x104232['model'];if(_0x180c77[_0x5a5b('0x47')]['includeAll']){_0x5af24a[_0x5a5b('0x53')]=[{'all':!![]}];}_0x5af24a=_[_0x5a5b('0x50')]({},_0x5af24a,_0x180c77['options']);return db['WhatsappMessage']['find'](_0x5af24a)['then'](handleEntityNotFound(_0xa9af56,null))['then'](respondWithResult(_0xa9af56,null))[_0x5a5b('0x2b')](handleError(_0xa9af56,null));};exports[_0x5a5b('0x57')]=function(_0x701f8f,_0xddaad3){return db[_0x5a5b('0x3e')][_0x5a5b('0x57')](_0x701f8f[_0x5a5b('0x58')],{})[_0x5a5b('0x21')](respondWithResult(_0xddaad3,0xc9))[_0x5a5b('0x2b')](handleError(_0xddaad3,null));};exports[_0x5a5b('0x59')]=function(_0x2d15ab,_0x2820fc){if(_0x2d15ab[_0x5a5b('0x58')]['id']){delete _0x2d15ab['body']['id'];}return db[_0x5a5b('0x3e')][_0x5a5b('0x5a')]({'where':{'id':_0x2d15ab['params']['id']}})[_0x5a5b('0x21')](handleEntityNotFound(_0x2820fc,null))[_0x5a5b('0x21')](saveUpdates(_0x2d15ab[_0x5a5b('0x58')],null))[_0x5a5b('0x21')](respondWithResult(_0x2820fc,null))[_0x5a5b('0x2b')](handleError(_0x2820fc,null));};exports[_0x5a5b('0x38')]=function(_0x17fd8d,_0x32969d){return db[_0x5a5b('0x3e')][_0x5a5b('0x5a')]({'where':{'id':_0x17fd8d[_0x5a5b('0x56')]['id']}})['then'](handleEntityNotFound(_0x32969d,null))['then'](removeEntity(_0x32969d,null))['catch'](handleError(_0x32969d,null));};exports[_0x5a5b('0x5b')]=function(_0x162db7,_0x4d31da){return db['WhatsappMessage'][_0x5a5b('0x5b')]()[_0x5a5b('0x21')](respondWithResult(_0x4d31da,null))[_0x5a5b('0x2b')](handleError(_0x4d31da,null));};var interaction_log=require(_0x5a5b('0x5c'))('whatsapp-interactions');exports[_0x5a5b('0x5d')]=function(_0xfc937e,_0x24d459,_0x1e647f){var _0x26b665={'agent':{},'channel':_0x5a5b('0x5e')};if(_0xfc937e[_0x5a5b('0x58')]['id']){delete _0xfc937e[_0x5a5b('0x58')]['id'];}_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x5f')]=!![];_0xfc937e['body'][_0x5a5b('0x60')]=moment()[_0x5a5b('0x61')](_0x5a5b('0x62'));_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')]=_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')]||_0xfc937e[_0x5a5b('0x64')]['id'];_0x26b665[_0x5a5b('0x65')]['id']=_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')];return db[_0x5a5b('0x3e')][_0x5a5b('0x5a')]({'where':{'id':_0xfc937e[_0x5a5b('0x56')]['id'],'UserId':null}})[_0x5a5b('0x21')](handleEntityNotFound(_0x24d459,null))[_0x5a5b('0x21')](saveUpdates(_0xfc937e['body'],null))[_0x5a5b('0x21')](function(_0x44551a){if(_0x44551a){_0x26b665[_0x5a5b('0x29')]=_0x44551a[_0x5a5b('0x66')]({'plain':!![]});return db[_0x5a5b('0x67')][_0x5a5b('0x5a')]({'where':{'id':_0x44551a[_0x5a5b('0x68')]}});}return null;})[_0x5a5b('0x21')](handleEntityNotFound(_0x24d459,null))[_0x5a5b('0x21')](function(_0x510742){if(_0x510742){return _0x510742[_0x5a5b('0x59')]({'UserId':_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')],'read1stAt':_[_0x5a5b('0x69')](_0x510742[_0x5a5b('0x6a')])?moment()[_0x5a5b('0x61')](_0x5a5b('0x62')):undefined});}return null;})[_0x5a5b('0x21')](function(_0x3312e3){if(_0x3312e3){_0x26b665['interaction']=_0x3312e3[_0x5a5b('0x66')]({'plain':!![]});interaction_log[_0x5a5b('0x22')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfc937e[_0x5a5b('0x64')]['id'],_0xfc937e[_0x5a5b('0x64')]['name'],_0xfc937e['user']['role'],_0x26b665['interaction']['id'],_0xfc937e[_0x5a5b('0x58')]?JSON[_0x5a5b('0x25')](_0xfc937e['body']):'null');return respondWithRpcPromise(_0x5a5b('0x6b'),'acceptMessage',_0x26b665);}return null;})[_0x5a5b('0x21')](function(_0x519c06){var _0x917f87=_0x5a5b('0x6c')+_0x519c06[_0x5a5b('0x29')]['ContactId'];return db[_0x5a5b('0x6d')][_0x5a5b('0x47')](_0x917f87,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x37b3a8){return _0x37b3a8;});})[_0x5a5b('0x21')](function(_0xbc92d1){if(_0xbc92d1){_0x26b665['message'][_0x5a5b('0x6e')]=_0xbc92d1[0x0];if(!_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')])return;return db[_0x5a5b('0x6f')]['find']({'where':{'id':_0xfc937e[_0x5a5b('0x58')][_0x5a5b('0x63')],'role':_0x5a5b('0x65')},'attributes':['id','name',_0x5a5b('0x70'),_0x5a5b('0x71'),_0x5a5b('0x72')],'raw':!![]});}return null;})['then'](function(_0x4667de){if(!_0x4667de)return null;_0x26b665[_0x5a5b('0x29')][_0x5a5b('0x65')]=_0x4667de;return _0x26b665;})[_0x5a5b('0x21')](function(_0x327b2a){if(_0x327b2a){if(_0xfc937e['body'][_0x5a5b('0x73')]){_0x26b665[_0x5a5b('0x29')][_0x5a5b('0x74')]=util[_0x5a5b('0x61')]('SIP/%s',_0xfc937e['user']['name']);_0x26b665[_0x5a5b('0x29')]['channel']=_0x26b665[_0x5a5b('0x75')];_0x26b665[_0x5a5b('0x29')][_0x5a5b('0x76')]=_0x26b665['channel'];_0x26b665[_0x5a5b('0x29')][_0x5a5b('0x77')]=_0x5a5b('0x5d');return respondWithRpcPromise('EventManager',_0x5a5b('0x78'),{'event':_0x5a5b('0x79'),'message':_0x26b665['message']},client9002)[_0x5a5b('0x21')](function(){return _0x26b665;});}return _0x26b665;}return null;})['then'](respondWithResult(_0x24d459,null))[_0x5a5b('0x2b')](handleError(_0x24d459,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x5a5b('0x36')]=function(_0x4f177e,_0x4a45af,_0x527e12){var _0x1a7a29={'agent':{},'channel':_0x5a5b('0x5e')};if(_0x4f177e['body']['id']){delete _0x4f177e[_0x5a5b('0x58')]['id'];}_0x4f177e[_0x5a5b('0x58')][_0x5a5b('0x63')]=_0x4f177e[_0x5a5b('0x58')]['UserId']||_0x4f177e[_0x5a5b('0x64')]['id'];_0x1a7a29[_0x5a5b('0x65')]['id']=_0x4f177e[_0x5a5b('0x58')][_0x5a5b('0x63')];return db[_0x5a5b('0x3e')][_0x5a5b('0x5a')]({'where':{'id':_0x4f177e[_0x5a5b('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a45af,null))[_0x5a5b('0x21')](function(_0x2e973e){if(_0x2e973e){_0x1a7a29[_0x5a5b('0x29')]=_0x2e973e['get']({'plain':!![]});return db['WhatsappInteraction'][_0x5a5b('0x5a')]({'where':{'id':_0x2e973e[_0x5a5b('0x68')]}});}return null;})[_0x5a5b('0x21')](handleEntityNotFound(_0x4a45af,null))[_0x5a5b('0x21')](function(_0x3344da){if(_0x3344da){_0x1a7a29['interaction']=_0x3344da[_0x5a5b('0x66')]({'plain':!![]});interaction_log[_0x5a5b('0x22')](_0x5a5b('0x7a'),_0x4f177e['user']['id'],_0x4f177e[_0x5a5b('0x64')][_0x5a5b('0x3a')],_0x4f177e['user']['role'],_0x1a7a29[_0x5a5b('0x7b')]['id'],_0x4f177e[_0x5a5b('0x58')]?JSON['stringify'](_0x4f177e['body']):'null');return respondWithRpcPromise(_0x5a5b('0x7c'),_0x5a5b('0x7d'),_0x1a7a29);}return null;})['then'](function(_0xd9d111){var _0x277468=_0x5a5b('0x6c')+_0xd9d111[_0x5a5b('0x29')][_0x5a5b('0x7e')];return db[_0x5a5b('0x6d')][_0x5a5b('0x47')](_0x277468,{'type':db[_0x5a5b('0x7f')][_0x5a5b('0x80')][_0x5a5b('0x81')],'raw':!![]})['then'](function(_0x140a62){return _0x140a62;});})[_0x5a5b('0x21')](function(_0x28bd25){if(_0x28bd25){_0x1a7a29[_0x5a5b('0x29')][_0x5a5b('0x6e')]=_0x28bd25[0x0];if(!_0x4f177e['body'][_0x5a5b('0x63')])return;return db['User'][_0x5a5b('0x5a')]({'where':{'id':_0x4f177e['body'][_0x5a5b('0x63')],'role':_0x5a5b('0x65')},'attributes':['id',_0x5a5b('0x3a'),'fullname',_0x5a5b('0x71'),_0x5a5b('0x72')],'raw':!![]});}return null;})[_0x5a5b('0x21')](function(_0x686954){if(!_0x686954)return null;_0x1a7a29[_0x5a5b('0x29')][_0x5a5b('0x65')]=_0x686954;return _0x1a7a29;})[_0x5a5b('0x21')](function(_0x5eb92d){if(_0x5eb92d){_0x5eb92d['message'][_0x5a5b('0x74')]=util['format']('SIP/%s',_0x4f177e[_0x5a5b('0x64')]['name']);_0x5eb92d[_0x5a5b('0x29')][_0x5a5b('0x75')]=_0x1a7a29[_0x5a5b('0x75')];_0x5eb92d[_0x5a5b('0x29')][_0x5a5b('0x76')]=_0x1a7a29[_0x5a5b('0x75')];_0x5eb92d[_0x5a5b('0x29')]['event']=_0x5a5b('0x36');respondWithRpcPromise(_0x5a5b('0x78'),'EventManager',{'event':_0x5a5b('0x82'),'message':_0x5eb92d['message']},client9002);return _0x1a7a29;}return null;})[_0x5a5b('0x21')](respondWithResult(_0x4a45af,null))['catch'](handleError(_0x4a45af,null));};exports[_0x5a5b('0x2d')]=function(_0x56ddfc,_0x1a83db,_0x33e000){if(_0x56ddfc[_0x5a5b('0x58')]['id']){delete _0x56ddfc[_0x5a5b('0x58')]['id'];}var _0x279347;return db[_0x5a5b('0x3e')]['find']({'where':{'id':_0x56ddfc[_0x5a5b('0x56')]['id']}})[_0x5a5b('0x21')](handleEntityNotFound(_0x1a83db,null))[_0x5a5b('0x21')](function(_0x392405){if(_0x392405){_0x279347=_0x392405;return db[_0x5a5b('0x83')][_0x5a5b('0x5a')]({'where':{'id':_0x392405[_0x5a5b('0x84')]}});}})[_0x5a5b('0x21')](handleEntityNotFound(_0x1a83db,null))['then'](function(_0x226e78){if(_0x226e78){logger[_0x5a5b('0x85')](_0x5a5b('0x86'),_0x5a5b('0x2d'),_0x5a5b('0x87'),_0x226e78['type'],util['inspect'](_0x56ddfc['body'],{'showHidden':![],'depth':null}));switch(_0x226e78[_0x5a5b('0x41')]){case _0x5a5b('0x88'):if(_0x56ddfc[_0x5a5b('0x58')][_0x5a5b('0x89')]&&_0x56ddfc[_0x5a5b('0x58')][_0x5a5b('0x89')]===_0x279347[_0x5a5b('0x8a')]&&_0x56ddfc[_0x5a5b('0x58')][_0x5a5b('0x8b')]&&_0x56ddfc[_0x5a5b('0x58')]['MessageStatus']===_0x5a5b('0x5f')){return _0x279347[_0x5a5b('0x59')]({'read':!![]});}else{logger['error'](_0x5a5b('0x8c'),_0x5a5b('0x2d'),_0x5a5b('0x88'),util[_0x5a5b('0x8d')](_0x56ddfc[_0x5a5b('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x279347;}})[_0x5a5b('0x21')](respondWithResult(_0x1a83db,null))['catch'](handleError(_0x1a83db,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7699f34..109afac 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 _0x5eb1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappMessage'];(function(_0xf088cb,_0x224833){var _0x1ab411=function(_0x26f8be){while(--_0x26f8be){_0xf088cb['push'](_0xf088cb['shift']());}};_0x1ab411(++_0x224833);}(_0x5eb1,0x7c));var _0x15eb=function(_0x5f4abc,_0x1692ac){_0x5f4abc=_0x5f4abc-0x0;var _0x3c29a6=_0x5eb1[_0x5f4abc];return _0x3c29a6;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x15eb('0x0'))['db'][_0x15eb('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x15eb('0x2')](0x0);var events={'afterCreate':_0x15eb('0x3'),'afterUpdate':_0x15eb('0x4'),'afterDestroy':_0x15eb('0x5')};function emitEvent(_0x5e1142){return function(_0x3ba774,_0x19d816,_0x1f38c6){WhatsappMessageEvents[_0x15eb('0x6')](_0x5e1142+':'+_0x3ba774['id'],_0x3ba774);WhatsappMessageEvents['emit'](_0x5e1142,_0x3ba774);_0x1f38c6(null);};}for(var e in events){if(events[_0x15eb('0x7')](e)){var event=events[e];WhatsappMessage[_0x15eb('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x8130=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x1f3505,_0x23fb16){var _0x330c1f=function(_0x464bbc){while(--_0x464bbc){_0x1f3505['push'](_0x1f3505['shift']());}};_0x330c1f(++_0x23fb16);}(_0x8130,0x146));var _0x0813=function(_0x474f89,_0x2790f4){_0x474f89=_0x474f89-0x0;var _0x5c9a36=_0x8130[_0x474f89];return _0x5c9a36;};'use strict';var EventEmitter=require(_0x0813('0x0'));var WhatsappMessage=require(_0x0813('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0813('0x2')](0x0);var events={'afterCreate':_0x0813('0x3'),'afterUpdate':_0x0813('0x4'),'afterDestroy':_0x0813('0x5')};function emitEvent(_0x1421d7){return function(_0x25d6c6,_0x4e66f4,_0x442a9b){WhatsappMessageEvents['emit'](_0x1421d7+':'+_0x25d6c6['id'],_0x25d6c6);WhatsappMessageEvents['emit'](_0x1421d7,_0x25d6c6);_0x442a9b(null);};}for(var e in events){if(events[_0x0813('0x6')](e)){var event=events[e];WhatsappMessage[_0x0813('0x7')](e,emitEvent(event));}}module[_0x0813('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index cff42a5..f7a0711 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 _0x0810=['isNil','UserId','WhatsappInteraction','findOne','then','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','update','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','node-fetch','../../config/environment','exports','WhatsappMessage','messageId','body','FULLTEXT','get','direction','toLowerCase','secret'];(function(_0x143019,_0x3a3d14){var _0x57dffc=function(_0x37a47e){while(--_0x37a47e){_0x143019['push'](_0x143019['shift']());}};_0x57dffc(++_0x3a3d14);}(_0x0810,0x95));var _0x0081=function(_0xdc6c34,_0x4d3202){_0xdc6c34=_0xdc6c34-0x0;var _0x1cb4d9=_0x0810[_0xdc6c34];return _0x1cb4d9;};'use strict';var _=require(_0x0081('0x0'));var util=require(_0x0081('0x1'));var logger=require(_0x0081('0x2'))(_0x0081('0x3'));var moment=require(_0x0081('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x0081('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0081('0x6'));var attributes=require('./whatsappMessage.attributes');module[_0x0081('0x7')]=function(_0x5e90a5,_0x5d17fb){return _0x5e90a5['define'](_0x0081('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0081('0x9')]},{'name':'fti_whatsapp_messages','fields':[_0x0081('0xa')],'type':_0x0081('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x322360,_0x3d8088,_0x5a1251){var _0x24378e=_0x5e90a5['models'];var _0x2f9fa5=_0x322360[_0x0081('0xc')]({'plain':!![]});if(_0x2f9fa5['direction']['toLowerCase']()==='in'||_0x2f9fa5[_0x0081('0xd')][_0x0081('0xe')]()==='out'&&!_0x2f9fa5[_0x0081('0xf')]&&!_[_0x0081('0x10')](_0x2f9fa5[_0x0081('0x11')])){_0x24378e[_0x0081('0x12')][_0x0081('0x13')]({'where':{'id':_0x2f9fa5['WhatsappInteractionId']}})[_0x0081('0x14')](function(_0x8c61a){if(_0x8c61a){_0x8c61a['update']({'lastMsgAt':_0x2f9fa5[_0x0081('0x15')],'lastMsgDirection':_0x2f9fa5[_0x0081('0xd')][_0x0081('0xe')]()});}})[_0x0081('0x16')](function(_0x144b04){console[_0x0081('0x17')](_0x144b04);});}if(_0x2f9fa5['direction']==='out'&&!_0x2f9fa5[_0x0081('0xf')]){var _0x10df08;_0x24378e[_0x0081('0x18')][_0x0081('0x19')]({'where':{'id':_0x2f9fa5[_0x0081('0x1a')]},'raw':!![]})['then'](function(_0x15e653){_0x10df08=_0x15e653;if(_0x10df08&&_0x10df08[_0x0081('0x1b')]){switch(_0x10df08[_0x0081('0x1b')]){case _0x0081('0x1c'):var _0x14e414=require('twilio');if(_0x10df08[_0x0081('0x1d')]&&_0x10df08[_0x0081('0x1e')]&&_0x10df08[_0x0081('0x1f')]){var _0x58cacc=new _0x14e414(_0x10df08[_0x0081('0x1d')],_0x10df08[_0x0081('0x1e')]);_0x58cacc['messages'][_0x0081('0x20')]({'body':_0x2f9fa5[_0x0081('0xa')],'to':_0x0081('0x21')+_0x2f9fa5[_0x0081('0x1f')],'from':_0x0081('0x21')+_0x10df08['phone'],'statusCallback':_0x10df08[_0x0081('0x22')]+'/api/whatsapp/messages/'+_0x2f9fa5['id']+_0x0081('0x23')+_0x10df08[_0x0081('0x24')]})[_0x0081('0x14')](function(_0xc45fd6){if(_0xc45fd6[_0x0081('0x25')]){return _0x322360['update']({'messageId':_0xc45fd6['sid']});}})['catch'](function(_0xd41f1c){logger['error'](_0x0081('0x26'),_0x0081('0x27'),_0x0081('0x1c'),util['inspect'](_0xd41f1c,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0081('0x1c'),_0x0081('0x28'));}break;case _0x0081('0x29'):var _0x4f7d13=_0x10df08[_0x0081('0x1d')];var _0x419e76=_0x10df08[_0x0081('0x1e')];var _0x319338=_0x10df08[_0x0081('0x2a')]+_0x0081('0x2b')+_0x4f7d13+'/messages/';var _0x2277ce={'to':[_0x2f9fa5['phone']],'message':{'type':_0x0081('0x2c'),'text':_0x2f9fa5[_0x0081('0xa')]}};var _0x1474aa={'method':_0x0081('0x2d'),'uri':_0x319338,'headers':{'Authorization':_0x0081('0x2e')+_0x419e76,'Content-Type':_0x0081('0x2f')},'body':_0x2277ce,'json':!![]};rp(_0x1474aa)[_0x0081('0x14')](function(_0x5ed9b8){if(_0x5ed9b8['statuses'][0x0]['message_id']){return _0x322360[_0x0081('0x30')]({'messageId':_0x5ed9b8[_0x0081('0x31')][0x0][_0x0081('0x32')]});}})['catch'](function(_0x46e8d6){logger['err'](_0x0081('0x33'),_0x46e8d6);});break;}}})[_0x0081('0x34')](function(){_0x5a1251();});}else{_0x5a1251();}}},'charset':_0x0081('0x35'),'collate':_0x0081('0x36')});}; \ No newline at end of file +var _0xbf99=['createdAt','catch','error','secret','WhatsappAccount','WhatsappAccountId','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','WhatsappInteraction','findOne','WhatsappInteractionId','then','update'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0xbf99,0x8e));var _0x9bf9=function(_0x59b40e,_0x11d9d4){_0x59b40e=_0x59b40e-0x0;var _0x489118=_0xbf99[_0x59b40e];return _0x489118;};'use strict';var _=require(_0x9bf9('0x0'));var util=require('util');var logger=require(_0x9bf9('0x1'))('api');var moment=require(_0x9bf9('0x2'));var BPromise=require(_0x9bf9('0x3'));var rp=require('request-promise');var fetch=require(_0x9bf9('0x4'));var fs=require('fs');var path=require(_0x9bf9('0x5'));var rimraf=require(_0x9bf9('0x6'));var config=require(_0x9bf9('0x7'));var attributes=require(_0x9bf9('0x8'));module[_0x9bf9('0x9')]=function(_0x43bff2,_0x1d8973){return _0x43bff2[_0x9bf9('0xa')](_0x9bf9('0xb'),attributes,{'tableName':_0x9bf9('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9bf9('0xd')]},{'name':_0x9bf9('0xe'),'fields':['body'],'type':_0x9bf9('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b1419,_0x2c1bb5,_0x3d7480){var _0x431a9f=_0x43bff2[_0x9bf9('0x10')];var _0x9caf16=_0x7b1419[_0x9bf9('0x11')]({'plain':!![]});if(_0x9caf16[_0x9bf9('0x12')][_0x9bf9('0x13')]()==='in'||_0x9caf16[_0x9bf9('0x12')]['toLowerCase']()===_0x9bf9('0x14')&&!_0x9caf16['secret']&&!_['isNil'](_0x9caf16['UserId'])){_0x431a9f[_0x9bf9('0x15')][_0x9bf9('0x16')]({'where':{'id':_0x9caf16[_0x9bf9('0x17')]}})[_0x9bf9('0x18')](function(_0x34da8f){if(_0x34da8f){_0x34da8f[_0x9bf9('0x19')]({'lastMsgAt':_0x9caf16[_0x9bf9('0x1a')],'lastMsgDirection':_0x9caf16['direction'][_0x9bf9('0x13')]()});}})[_0x9bf9('0x1b')](function(_0xab9a63){console[_0x9bf9('0x1c')](_0xab9a63);});}if(_0x9caf16[_0x9bf9('0x12')]===_0x9bf9('0x14')&&!_0x9caf16[_0x9bf9('0x1d')]){var _0x2429b8;_0x431a9f[_0x9bf9('0x1e')]['find']({'where':{'id':_0x9caf16[_0x9bf9('0x1f')]},'raw':!![]})['then'](function(_0x54a762){_0x2429b8=_0x54a762;if(_0x2429b8&&_0x2429b8['type']){switch(_0x2429b8['type']){case _0x9bf9('0x20'):var _0x5c1247=require('twilio');if(_0x2429b8[_0x9bf9('0x21')]&&_0x2429b8[_0x9bf9('0x22')]&&_0x2429b8[_0x9bf9('0x23')]){var _0x204889=new _0x5c1247(_0x2429b8[_0x9bf9('0x21')],_0x2429b8[_0x9bf9('0x22')]);_0x204889[_0x9bf9('0x24')][_0x9bf9('0x25')]({'body':_0x9caf16['body'],'to':_0x9bf9('0x26')+_0x9caf16[_0x9bf9('0x23')],'from':_0x9bf9('0x26')+_0x2429b8['phone'],'statusCallback':_0x2429b8[_0x9bf9('0x27')]+'/api/whatsapp/messages/'+_0x9caf16['id']+_0x9bf9('0x28')+_0x2429b8[_0x9bf9('0x29')]})[_0x9bf9('0x18')](function(_0x1d8aee){if(_0x1d8aee[_0x9bf9('0x2a')]){return _0x7b1419[_0x9bf9('0x19')]({'messageId':_0x1d8aee[_0x9bf9('0x2a')]});}})[_0x9bf9('0x1b')](function(_0x28aaa5){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9bf9('0x2b'),'twilio',util[_0x9bf9('0x2c')](_0x28aaa5,{'showHidden':![],'depth':null}));});}else{logger[_0x9bf9('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9bf9('0x2b'),_0x9bf9('0x20'),_0x9bf9('0x2d'));}break;case'sinch':var _0x5d8b8a=_0x2429b8['accountSid'];var _0x43f52d=_0x2429b8[_0x9bf9('0x22')];var _0x5804e4=_0x2429b8[_0x9bf9('0x2e')]+'/whatsapp/v1/'+_0x5d8b8a+_0x9bf9('0x2f');var _0x406717={'to':[_0x9caf16[_0x9bf9('0x23')]],'message':{'type':_0x9bf9('0x30'),'text':_0x9caf16['body']}};var _0x264822={'method':_0x9bf9('0x31'),'uri':_0x5804e4,'headers':{'Authorization':_0x9bf9('0x32')+_0x43f52d,'Content-Type':_0x9bf9('0x33')},'body':_0x406717,'json':!![]};rp(_0x264822)[_0x9bf9('0x18')](function(_0x550d32){if(_0x550d32[_0x9bf9('0x34')][0x0][_0x9bf9('0x35')]){return _0x7b1419['update']({'messageId':_0x550d32[_0x9bf9('0x34')][0x0]['message_id']});}})[_0x9bf9('0x1b')](function(_0x4c656b){logger[_0x9bf9('0x36')]('WhatsappMessage,\x20%s',_0x4c656b);});break;}}})['finally'](function(){_0x3d7480();});}else{_0x3d7480();}}},'charset':'utf8mb4','collate':_0x9bf9('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index b422c90..23e2170 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 _0xc8bc=['raw','debug','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateWhatsappMessage','body','options'];(function(_0x2bd858,_0x296750){var _0x23fa0a=function(_0x4ce0a5){while(--_0x4ce0a5){_0x2bd858['push'](_0x2bd858['shift']());}};_0x23fa0a(++_0x296750);}(_0xc8bc,0xfb));var _0xcc8b=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xc8bc[_0x39106e];return _0x892aec;};'use strict';var _=require(_0xcc8b('0x0'));var util=require(_0xcc8b('0x1'));var moment=require('moment');var BPromise=require(_0xcc8b('0x2'));var rs=require(_0xcc8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc8b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc8b('0x5'))(_0xcc8b('0x6'));var config=require(_0xcc8b('0x7'));var jayson=require(_0xcc8b('0x8'));var client=jayson[_0xcc8b('0x9')]['http']({'port':0x232a});config[_0xcc8b('0xa')]=_[_0xcc8b('0xb')](config[_0xcc8b('0xa')],{'host':_0xcc8b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc8b('0xa')]));require(_0xcc8b('0xd'))[_0xcc8b('0xe')](socket);function respondWithRpcPromise(_0x155e65,_0x21678c,_0x250321){return new BPromise(function(_0x1ca233,_0x2b170b){return client[_0xcc8b('0xf')](_0x155e65,_0x250321)[_0xcc8b('0x10')](function(_0x35c1b8){logger['info'](_0xcc8b('0x11'),_0x21678c,'request\x20sent');logger['debug'](_0xcc8b('0x12'),_0x21678c,_0xcc8b('0x13'),JSON[_0xcc8b('0x14')](_0x35c1b8));if(_0x35c1b8['error']){if(_0x35c1b8[_0xcc8b('0x15')][_0xcc8b('0x16')]===0x1f4){logger['error'](_0xcc8b('0x11'),_0x21678c,_0x35c1b8[_0xcc8b('0x15')][_0xcc8b('0x17')]);return _0x2b170b(_0x35c1b8[_0xcc8b('0x15')][_0xcc8b('0x17')]);}logger[_0xcc8b('0x15')](_0xcc8b('0x11'),_0x21678c,_0x35c1b8['error'][_0xcc8b('0x17')]);return _0x1ca233(_0x35c1b8['error'][_0xcc8b('0x17')]);}else{logger['info'](_0xcc8b('0x11'),_0x21678c,_0xcc8b('0x13'));_0x1ca233(_0x35c1b8[_0xcc8b('0x18')]['message']);}})['catch'](function(_0x28d5d8){logger['error'](_0xcc8b('0x11'),_0x21678c,_0x28d5d8);_0x2b170b(_0x28d5d8);});});}exports[_0xcc8b('0x19')]=function(_0x16638e){var _0x56f45e=this;return new Promise(function(_0x3d2655,_0xc3e8fd){return db['WhatsappMessage']['create'](_0x16638e[_0xcc8b('0x1a')],{'raw':_0x16638e[_0xcc8b('0x1b')]?_0x16638e[_0xcc8b('0x1b')][_0xcc8b('0x1c')]===undefined?!![]:![]:!![]})[_0xcc8b('0x10')](function(_0x54c98c){logger['info'](_0xcc8b('0x19'),_0x16638e);logger[_0xcc8b('0x1d')](_0xcc8b('0x19'),_0x16638e,JSON['stringify'](_0x54c98c));_0x3d2655(_0x54c98c);})[_0xcc8b('0x1e')](function(_0x445d11){logger[_0xcc8b('0x15')](_0xcc8b('0x19'),_0x445d11[_0xcc8b('0x17')],_0x16638e);_0xc3e8fd(_0x56f45e[_0xcc8b('0x15')](0x1f4,_0x445d11[_0xcc8b('0x17')]));});});}; \ No newline at end of file +var _0xecca=['debug','lodash','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','create'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xecca,0xe2));var _0xaecc=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xecca[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xaecc('0x0'));var util=require('util');var moment=require(_0xaecc('0x1'));var BPromise=require('bluebird');var rs=require(_0xaecc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaecc('0x3'));var logger=require('../../config/logger')(_0xaecc('0x4'));var config=require(_0xaecc('0x5'));var jayson=require(_0xaecc('0x6'));var client=jayson['client'][_0xaecc('0x7')]({'port':0x232a});config[_0xaecc('0x8')]=_[_0xaecc('0x9')](config[_0xaecc('0x8')],{'host':_0xaecc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x590722,_0x3ac055,_0x4ab4a9){return new BPromise(function(_0x2ad29d,_0x508078){return client[_0xaecc('0xb')](_0x590722,_0x4ab4a9)[_0xaecc('0xc')](function(_0x2a9a5c){logger[_0xaecc('0xd')](_0xaecc('0xe'),_0x3ac055,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3ac055,_0xaecc('0xf'),JSON[_0xaecc('0x10')](_0x2a9a5c));if(_0x2a9a5c[_0xaecc('0x11')]){if(_0x2a9a5c['error'][_0xaecc('0x12')]===0x1f4){logger[_0xaecc('0x11')](_0xaecc('0xe'),_0x3ac055,_0x2a9a5c[_0xaecc('0x11')]['message']);return _0x508078(_0x2a9a5c['error'][_0xaecc('0x13')]);}logger[_0xaecc('0x11')](_0xaecc('0xe'),_0x3ac055,_0x2a9a5c[_0xaecc('0x11')]['message']);return _0x2ad29d(_0x2a9a5c[_0xaecc('0x11')][_0xaecc('0x13')]);}else{logger[_0xaecc('0xd')](_0xaecc('0xe'),_0x3ac055,_0xaecc('0xf'));_0x2ad29d(_0x2a9a5c[_0xaecc('0x14')]['message']);}})[_0xaecc('0x15')](function(_0x464451){logger[_0xaecc('0x11')](_0xaecc('0xe'),_0x3ac055,_0x464451);_0x508078(_0x464451);});});}exports[_0xaecc('0x16')]=function(_0x334b22){var _0xe7d4d2=this;return new Promise(function(_0x15607b,_0x419955){return db['WhatsappMessage'][_0xaecc('0x17')](_0x334b22['body'],{'raw':_0x334b22['options']?_0x334b22['options']['raw']===undefined?!![]:![]:!![]})[_0xaecc('0xc')](function(_0x4564ac){logger[_0xaecc('0xd')](_0xaecc('0x16'),_0x334b22);logger[_0xaecc('0x18')]('CreateWhatsappMessage',_0x334b22,JSON[_0xaecc('0x10')](_0x4564ac));_0x15607b(_0x4564ac);})[_0xaecc('0x15')](function(_0x5d243d){logger[_0xaecc('0x11')](_0xaecc('0x16'),_0x5d243d[_0xaecc('0x13')],_0x334b22);_0x419955(_0xe7d4d2[_0xaecc('0x11')](0x1f4,_0x5d243d[_0xaecc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index fac3d25..25b526f 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 _0x9ba2=['./whatsappMessage.events','save','remove','emit','removeListener','register','length','whatsappMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ba2,0x150));var _0x29ba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9ba2[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappMessageEvents=require(_0x29ba('0x0'));var events=[_0x29ba('0x1'),_0x29ba('0x2'),'update'];function createListener(_0x39f736,_0x492778){return function(_0x3160c9){_0x492778[_0x29ba('0x3')](_0x39f736,_0x3160c9);};}function removeListener(_0x3f2492,_0x483e89){return function(){WhatsappMessageEvents[_0x29ba('0x4')](_0x3f2492,_0x483e89);};}exports[_0x29ba('0x5')]=function(_0x568be){for(var _0x6b9b32=0x0,_0x5403a4=events[_0x29ba('0x6')];_0x6b9b32<_0x5403a4;_0x6b9b32++){var _0x5c98f9=events[_0x6b9b32];var _0x327f8c=createListener(_0x29ba('0x7')+_0x5c98f9,_0x568be);WhatsappMessageEvents['on'](_0x5c98f9,_0x327f8c);}}; \ No newline at end of file +var _0x6f52=['./whatsappMessage.events','removeListener','whatsappMessage:'];(function(_0x4946cb,_0xf13214){var _0x2cb394=function(_0x5182a0){while(--_0x5182a0){_0x4946cb['push'](_0x4946cb['shift']());}};_0x2cb394(++_0xf13214);}(_0x6f52,0xea));var _0x26f5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6f52[_0x21a9d9];return _0x46adce;};'use strict';var WhatsappMessageEvents=require(_0x26f5('0x0'));var events=['save','remove','update'];function createListener(_0x27377f,_0x140b4c){return function(_0x4b1b99){_0x140b4c['emit'](_0x27377f,_0x4b1b99);};}function removeListener(_0x4e109b,_0x459ee3){return function(){WhatsappMessageEvents[_0x26f5('0x1')](_0x4e109b,_0x459ee3);};}exports['register']=function(_0xe4b293){for(var _0x5a81a1=0x0,_0x5a4d06=events['length'];_0x5a81a1<_0x5a4d06;_0x5a81a1++){var _0x1b406a=events[_0x5a81a1];var _0x249a74=createListener(_0x26f5('0x2')+_0x1b406a,_0xe4b293);WhatsappMessageEvents['on'](_0x1b406a,_0x249a74);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 9e28b6f..91e2cf4 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 _0x0511=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','exports','multer','path','Router'];(function(_0x5be8cc,_0x4a6037){var _0x5f1b7e=function(_0xebd8db){while(--_0xebd8db){_0x5be8cc['push'](_0x5be8cc['shift']());}};_0x5f1b7e(++_0x4a6037);}(_0x0511,0x11f));var _0x1051=function(_0x52da21,_0x242123){_0x52da21=_0x52da21-0x0;var _0x12cb79=_0x0511[_0x52da21];return _0x12cb79;};'use strict';var multer=require(_0x1051('0x0'));var util=require('util');var path=require(_0x1051('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1051('0x2')]();var fs_extra=require(_0x1051('0x3'));var auth=require(_0x1051('0x4'));var interaction=require(_0x1051('0x5'));var config=require(_0x1051('0x6'));var controller=require(_0x1051('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1051('0x8')]);router[_0x1051('0x9')](_0x1051('0xa'),auth['isAuthenticated'](),controller[_0x1051('0xb')]);router[_0x1051('0x9')](_0x1051('0xc'),auth[_0x1051('0xd')](),controller[_0x1051('0xe')]);router['get'](_0x1051('0xf'),auth[_0x1051('0xd')](),controller[_0x1051('0x10')]);router['get'](_0x1051('0x11'),auth[_0x1051('0xd')](),controller[_0x1051('0x12')]);router[_0x1051('0x9')]('/:id/users',auth[_0x1051('0xd')](),controller['getAgents']);router[_0x1051('0x13')]('/',auth[_0x1051('0xd')](),controller[_0x1051('0x14')]);router[_0x1051('0x13')]('/:id/teams',auth[_0x1051('0xd')](),controller[_0x1051('0x15')]);router['post'](_0x1051('0x16'),auth['isAuthenticated'](),controller[_0x1051('0x17')]);router[_0x1051('0x18')](_0x1051('0xc'),auth[_0x1051('0xd')](),controller[_0x1051('0x19')]);router[_0x1051('0x1a')]('/:id',auth[_0x1051('0xd')](),controller[_0x1051('0x1b')]);router[_0x1051('0x1a')](_0x1051('0x11'),auth[_0x1051('0xd')](),controller['removeTeams']);router['delete'](_0x1051('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x1051('0x1c')]=router; \ No newline at end of file +var _0x336a=['isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','addAgents','update','/:id','destroy','delete','/:id/users','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x336a,0x199));var _0xa336=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x336a[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var path=require(_0xa336('0x2'));var timeout=require(_0xa336('0x3'));var express=require(_0xa336('0x4'));var router=express[_0xa336('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa336('0x6'));var interaction=require(_0xa336('0x7'));var config=require(_0xa336('0x8'));var controller=require(_0xa336('0x9'));router[_0xa336('0xa')]('/',auth[_0xa336('0xb')](),controller[_0xa336('0xc')]);router['get'](_0xa336('0xd'),auth[_0xa336('0xb')](),controller[_0xa336('0xe')]);router['get']('/:id',auth[_0xa336('0xb')](),controller[_0xa336('0xf')]);router[_0xa336('0xa')](_0xa336('0x10'),auth[_0xa336('0xb')](),controller[_0xa336('0x11')]);router['get'](_0xa336('0x12'),auth['isAuthenticated'](),controller[_0xa336('0x13')]);router[_0xa336('0xa')]('/:id/users',auth[_0xa336('0xb')](),controller['getAgents']);router['post']('/',auth[_0xa336('0xb')](),controller[_0xa336('0x14')]);router[_0xa336('0x15')](_0xa336('0x12'),auth[_0xa336('0xb')](),controller[_0xa336('0x16')]);router[_0xa336('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xa336('0x17')]);router['put']('/:id',auth[_0xa336('0xb')](),controller[_0xa336('0x18')]);router['delete'](_0xa336('0x19'),auth['isAuthenticated'](),controller[_0xa336('0x1a')]);router['delete'](_0xa336('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xa336('0x1b')](_0xa336('0x1c'),auth[_0xa336('0xb')](),controller[_0xa336('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4c3babf..08fab31 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 _0x9b83=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x558924,_0x459768){var _0x5413a9=function(_0x345c16){while(--_0x345c16){_0x558924['push'](_0x558924['shift']());}};_0x5413a9(++_0x459768);}(_0x9b83,0x84));var _0x39b8=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x9b83[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0x39b8('0x0'));module[_0x39b8('0x1')]={'name':{'type':Sequelize[_0x39b8('0x2')],'unique':_0x39b8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x39b8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x39b8('0x5')](_0x39b8('0x6'),_0x39b8('0x7'),_0x39b8('0x8'))},'description':{'type':Sequelize[_0x39b8('0x2')]}}; \ No newline at end of file +var _0x0cee=['ENUM','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0cee,0x12f));var _0xe0ce=function(_0x30dd20,_0x4c1e28){_0x30dd20=_0x30dd20-0x0;var _0x30d13d=_0x0cee[_0x30dd20];return _0x30d13d;};'use strict';var Sequelize=require(_0xe0ce('0x0'));module[_0xe0ce('0x1')]={'name':{'type':Sequelize[_0xe0ce('0x2')],'unique':_0xe0ce('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe0ce('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe0ce('0x5')]('rrmemory','beepall',_0xe0ce('0x6'))},'description':{'type':Sequelize[_0xe0ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4c3f178..aa4e811 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 _0xe649=['userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappQueue','includeAll','include','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','ids','Agents','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','value','removeTeams','isEmpty','removeAgents','emit'];(function(_0x2db7ec,_0x4ee00d){var _0xb3020c=function(_0x458f19){while(--_0x458f19){_0x2db7ec['push'](_0x2db7ec['shift']());}};_0xb3020c(++_0x4ee00d);}(_0xe649,0x1b0));var _0x9e64=function(_0x1162a3,_0x3b760c){_0x1162a3=_0x1162a3-0x0;var _0x2ccb37=_0xe649[_0x1162a3];return _0x2ccb37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e64('0x0'));var zipdir=require(_0x9e64('0x1'));var jsonpatch=require(_0x9e64('0x2'));var rp=require(_0x9e64('0x3'));var moment=require('moment');var BPromise=require(_0x9e64('0x4'));var Mustache=require(_0x9e64('0x5'));var util=require(_0x9e64('0x6'));var path=require(_0x9e64('0x7'));var sox=require('sox');var csv=require(_0x9e64('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e64('0x9'));var _=require(_0x9e64('0xa'));var squel=require(_0x9e64('0xb'));var crypto=require(_0x9e64('0xc'));var jsforce=require(_0x9e64('0xd'));var deskjs=require(_0x9e64('0xe'));var toCsv=require(_0x9e64('0x8'));var querystring=require(_0x9e64('0xf'));var Papa=require(_0x9e64('0x10'));var Redis=require(_0x9e64('0x11'));var authService=require(_0x9e64('0x12'));var qs=require(_0x9e64('0x13'));var as=require(_0x9e64('0x14'));var hardwareService=require(_0x9e64('0x15'));var logger=require(_0x9e64('0x16'))('api');var utils=require(_0x9e64('0x17'));var config=require(_0x9e64('0x18'));var licenseUtil=require(_0x9e64('0x19'));var db=require(_0x9e64('0x1a'))['db'];config[_0x9e64('0x1b')]=_['defaults'](config[_0x9e64('0x1b')],{'host':_0x9e64('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9e64('0x1d'))[_0x9e64('0x1e')](socket);function respondWithStatusCode(_0x40e488,_0x2e7be1){_0x2e7be1=_0x2e7be1||0xcc;return function(_0xcfe4f9){if(_0xcfe4f9){return _0x40e488[_0x9e64('0x1f')](_0x2e7be1);}return _0x40e488[_0x9e64('0x20')](_0x2e7be1)[_0x9e64('0x21')]();};}function respondWithResult(_0x11d366,_0x559715){_0x559715=_0x559715||0xc8;return function(_0x1a408b){if(_0x1a408b){return _0x11d366['status'](_0x559715)[_0x9e64('0x22')](_0x1a408b);}};}function respondWithFilteredResult(_0x5dac6e,_0x45916f){return function(_0x2ef06c){if(_0x2ef06c){var _0x718f2c=typeof _0x45916f[_0x9e64('0x23')]===_0x9e64('0x24')&&typeof _0x45916f[_0x9e64('0x25')]==='undefined';var _0x2db77f=_0x2ef06c[_0x9e64('0x26')];var _0x2d26d3=_0x718f2c?0x0:_0x45916f[_0x9e64('0x23')];var _0xefe6b6=_0x718f2c?_0x2ef06c[_0x9e64('0x26')]:_0x45916f[_0x9e64('0x23')]+_0x45916f['limit'];var _0x4032e6;if(_0xefe6b6>=_0x2db77f){_0xefe6b6=_0x2db77f;_0x4032e6=0xc8;}else{_0x4032e6=0xce;}_0x5dac6e['status'](_0x4032e6);return _0x5dac6e[_0x9e64('0x27')](_0x9e64('0x28'),_0x2d26d3+'-'+_0xefe6b6+'/'+_0x2db77f)[_0x9e64('0x22')](_0x2ef06c);}return null;};}function patchUpdates(_0x2b921a){return function(_0x502c01){try{jsonpatch[_0x9e64('0x29')](_0x502c01,_0x2b921a,!![]);}catch(_0x52be41){return BPromise[_0x9e64('0x2a')](_0x52be41);}return _0x502c01['save']();};}function saveUpdates(_0x39bc09,_0xb3de1a){return function(_0x31a915){if(_0x31a915){return _0x31a915['update'](_0x39bc09)['then'](function(_0xa292da){return _0xa292da;});}return null;};}function removeEntity(_0x48fbfd,_0x57ef4b){return function(_0xb49f3a){if(_0xb49f3a){return _0xb49f3a[_0x9e64('0x2b')]()[_0x9e64('0x2c')](function(){var _0x45de2e=_0xb49f3a[_0x9e64('0x2d')]({'plain':!![]});var _0x4fa750=_0x9e64('0x2e');return db[_0x9e64('0x2f')][_0x9e64('0x2b')]({'where':{'type':_0x4fa750,'resourceId':_0x45de2e['id']}})[_0x9e64('0x2c')](function(){return _0xb49f3a;});})['then'](function(){_0x48fbfd[_0x9e64('0x20')](0xcc)[_0x9e64('0x21')]();});}};}function handleEntityNotFound(_0x340826,_0x247b6b){return function(_0x4097be){if(!_0x4097be){_0x340826[_0x9e64('0x1f')](0x194);}return _0x4097be;};}function handleError(_0x4ad5ab,_0x58658d){_0x58658d=_0x58658d||0x1f4;return function(_0x2183f0){logger[_0x9e64('0x30')](_0x2183f0[_0x9e64('0x31')]);if(_0x2183f0[_0x9e64('0x32')]){delete _0x2183f0[_0x9e64('0x32')];}_0x4ad5ab[_0x9e64('0x20')](_0x58658d)[_0x9e64('0x33')](_0x2183f0);};}exports[_0x9e64('0x34')]=function(_0x2d7d3a,_0x4f06cf){var _0x581155={},_0x37378a={},_0x63e846={'count':0x0,'rows':[]};var _0x12195d=_[_0x9e64('0x35')](db['WhatsappQueue'][_0x9e64('0x36')],function(_0x23f6fd){return{'name':_0x23f6fd['fieldName'],'type':_0x23f6fd[_0x9e64('0x37')][_0x9e64('0x38')]};});_0x37378a[_0x9e64('0x39')]=_['map'](_0x12195d,_0x9e64('0x32'));_0x37378a[_0x9e64('0x3a')]=_[_0x9e64('0x3b')](_0x2d7d3a['query']);_0x37378a[_0x9e64('0x3c')]=_[_0x9e64('0x3d')](_0x37378a['model'],_0x37378a[_0x9e64('0x3a')]);_0x581155[_0x9e64('0x3e')]=_[_0x9e64('0x3d')](_0x37378a[_0x9e64('0x39')],qs['fields'](_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x3f')]));_0x581155['attributes']=_0x581155[_0x9e64('0x3e')]['length']?_0x581155[_0x9e64('0x3e')]:_0x37378a['model'];if(!_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x40')](_0x9e64('0x41'))){_0x581155[_0x9e64('0x25')]=qs[_0x9e64('0x25')](_0x2d7d3a[_0x9e64('0x3a')]['limit']);_0x581155[_0x9e64('0x23')]=qs[_0x9e64('0x23')](_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x23')]);}_0x581155[_0x9e64('0x42')]=qs[_0x9e64('0x43')](_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x43')]);_0x581155['where']=qs[_0x9e64('0x3c')](_[_0x9e64('0x44')](_0x2d7d3a[_0x9e64('0x3a')],_0x37378a[_0x9e64('0x3c')]),_0x12195d);if(_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x45')]){_0x581155[_0x9e64('0x46')]=_[_0x9e64('0x47')](_0x581155[_0x9e64('0x46')],{'$or':_[_0x9e64('0x35')](_0x12195d,function(_0x438828){if(_0x438828['type']!==_0x9e64('0x48')){var _0xc66539={};_0xc66539[_0x438828[_0x9e64('0x32')]]={'$like':'%'+_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x45')]+'%'};return _0xc66539;}})});}_0x581155=_[_0x9e64('0x47')]({},_0x581155,_0x2d7d3a[_0x9e64('0x49')]);var _0xf6cbc0={'where':_0x581155['where']};return db[_0x9e64('0x4a')]['count'](_0xf6cbc0)[_0x9e64('0x2c')](function(_0x305a8a){_0x63e846[_0x9e64('0x26')]=_0x305a8a;if(_0x2d7d3a[_0x9e64('0x3a')][_0x9e64('0x4b')]){_0x581155[_0x9e64('0x4c')]=[{'all':!![]}];}return db[_0x9e64('0x4a')]['findAll'](_0x581155);})[_0x9e64('0x2c')](function(_0x6fd69c){_0x63e846[_0x9e64('0x4d')]=_0x6fd69c;return _0x63e846;})[_0x9e64('0x2c')](respondWithFilteredResult(_0x4f06cf,_0x581155))[_0x9e64('0x4e')](handleError(_0x4f06cf,null));};exports[_0x9e64('0x4f')]=function(_0xcbf906,_0x391a70){var _0x33f8cb={'raw':!![],'where':{'id':_0xcbf906[_0x9e64('0x50')]['id']}},_0x107958={};_0x107958[_0x9e64('0x39')]=_['keys'](db[_0x9e64('0x4a')][_0x9e64('0x36')]);_0x107958[_0x9e64('0x3a')]=_['keys'](_0xcbf906[_0x9e64('0x3a')]);_0x107958['filters']=_['intersection'](_0x107958[_0x9e64('0x39')],_0x107958[_0x9e64('0x3a')]);_0x33f8cb[_0x9e64('0x3e')]=_['intersection'](_0x107958[_0x9e64('0x39')],qs[_0x9e64('0x3f')](_0xcbf906[_0x9e64('0x3a')][_0x9e64('0x3f')]));_0x33f8cb[_0x9e64('0x3e')]=_0x33f8cb[_0x9e64('0x3e')][_0x9e64('0x51')]?_0x33f8cb[_0x9e64('0x3e')]:_0x107958[_0x9e64('0x39')];if(_0xcbf906[_0x9e64('0x3a')][_0x9e64('0x4b')]){_0x33f8cb[_0x9e64('0x4c')]=[{'all':!![]}];}_0x33f8cb=_[_0x9e64('0x47')]({},_0x33f8cb,_0xcbf906[_0x9e64('0x49')]);return db[_0x9e64('0x4a')]['find'](_0x33f8cb)['then'](handleEntityNotFound(_0x391a70,null))['then'](respondWithResult(_0x391a70,null))[_0x9e64('0x4e')](handleError(_0x391a70,null));};exports[_0x9e64('0x52')]=function(_0x16ad15,_0x2e65ed){return db[_0x9e64('0x4a')]['create'](_0x16ad15[_0x9e64('0x53')],{})[_0x9e64('0x2c')](function(_0x313e37){var _0x5c7c48=_0x16ad15['user'][_0x9e64('0x2d')]({'plain':!![]});if(!_0x5c7c48)throw new Error(_0x9e64('0x54'));if(_0x5c7c48[_0x9e64('0x55')]===_0x9e64('0x56')){var _0x5644c6=_0x313e37[_0x9e64('0x2d')]({'plain':!![]});var _0x2f53cc=_0x9e64('0x2e');return db[_0x9e64('0x57')][_0x9e64('0x58')]({'where':{'name':_0x2f53cc,'userProfileId':_0x5c7c48[_0x9e64('0x59')]},'raw':!![]})['then'](function(_0x3b11a1){if(_0x3b11a1&&_0x3b11a1[_0x9e64('0x5a')]===0x0){return db[_0x9e64('0x2f')][_0x9e64('0x52')]({'name':_0x5644c6[_0x9e64('0x32')],'resourceId':_0x5644c6['id'],'type':_0x3b11a1[_0x9e64('0x32')],'sectionId':_0x3b11a1['id']},{})[_0x9e64('0x2c')](function(){return _0x313e37;});}else{return _0x313e37;}})[_0x9e64('0x4e')](function(_0x2d236a){logger[_0x9e64('0x30')](_0x9e64('0x5b'),_0x2d236a);throw _0x2d236a;});}return _0x313e37;})['then'](respondWithResult(_0x2e65ed,0xc9))['catch'](handleError(_0x2e65ed,null));};exports['update']=function(_0x46c2f7,_0x1348b1){if(_0x46c2f7[_0x9e64('0x53')]['id']){delete _0x46c2f7['body']['id'];}return db[_0x9e64('0x4a')][_0x9e64('0x58')]({'where':{'id':_0x46c2f7[_0x9e64('0x50')]['id']}})['then'](handleEntityNotFound(_0x1348b1,null))[_0x9e64('0x2c')](saveUpdates(_0x46c2f7['body'],null))['then'](respondWithResult(_0x1348b1,null))[_0x9e64('0x4e')](handleError(_0x1348b1,null));};exports['destroy']=function(_0x591102,_0x4d3440){return db[_0x9e64('0x4a')][_0x9e64('0x58')]({'where':{'id':_0x591102[_0x9e64('0x50')]['id']}})[_0x9e64('0x2c')](handleEntityNotFound(_0x4d3440,null))[_0x9e64('0x2c')](removeEntity(_0x4d3440,null))['catch'](handleError(_0x4d3440,null));};exports[_0x9e64('0x5c')]=function(_0x2c7107,_0x4ced81){return db[_0x9e64('0x4a')][_0x9e64('0x5c')]()['then'](respondWithResult(_0x4ced81,null))[_0x9e64('0x4e')](handleError(_0x4ced81,null));};exports[_0x9e64('0x5d')]=function(_0x1cea30,_0x4c8e44,_0x459dfa){var _0xe8ad12={'raw':!![],'where':{}},_0x13cf57={},_0x251652;return db[_0x9e64('0x4a')]['findOne']({'where':{'id':_0x1cea30['params']['id']}})['then'](handleEntityNotFound(_0x4c8e44,null))[_0x9e64('0x2c')](function(_0x33d132){if(_0x33d132){_0x251652=_0x33d132[_0x9e64('0x2d')]({'plain':!![]});_0x13cf57[_0x9e64('0x39')]=_['keys'](db[_0x9e64('0x5e')]['rawAttributes']);_0x13cf57[_0x9e64('0x3a')]=_[_0x9e64('0x3b')](_0x1cea30[_0x9e64('0x3a')]);_0x13cf57['filters']=_[_0x9e64('0x3d')](_0x13cf57[_0x9e64('0x39')],_0x13cf57['query']);_0xe8ad12[_0x9e64('0x3e')]=_['intersection'](_0x13cf57[_0x9e64('0x39')],qs['fields'](_0x1cea30['query'][_0x9e64('0x3f')]));_0xe8ad12[_0x9e64('0x3e')]=_0xe8ad12[_0x9e64('0x3e')][_0x9e64('0x51')]?_0xe8ad12[_0x9e64('0x3e')]:_0x13cf57[_0x9e64('0x39')];if(!_0x1cea30[_0x9e64('0x3a')][_0x9e64('0x40')](_0x9e64('0x41'))){_0xe8ad12[_0x9e64('0x25')]=qs[_0x9e64('0x25')](_0x1cea30[_0x9e64('0x3a')][_0x9e64('0x25')]);_0xe8ad12['offset']=qs[_0x9e64('0x23')](_0x1cea30['query'][_0x9e64('0x23')]);}_0xe8ad12['order']=qs[_0x9e64('0x43')](_0x1cea30[_0x9e64('0x3a')]['sort']);_0xe8ad12['where']=qs[_0x9e64('0x3c')](_[_0x9e64('0x44')](_0x1cea30[_0x9e64('0x3a')],_0x13cf57['filters']));_0xe8ad12[_0x9e64('0x46')][_0x9e64('0x5f')]=_0x33d132['id'];if(_0x1cea30['query']['filter']){_0xe8ad12[_0x9e64('0x46')]=_[_0x9e64('0x47')](_0xe8ad12[_0x9e64('0x46')],{'$or':_['map'](_0xe8ad12[_0x9e64('0x3e')],function(_0x2f0f7b){var _0x3af4f6={};_0x3af4f6[_0x2f0f7b]={'$like':'%'+_0x1cea30[_0x9e64('0x3a')][_0x9e64('0x45')]+'%'};return _0x3af4f6;})});}_0xe8ad12=_[_0x9e64('0x47')]({},_0xe8ad12,_0x1cea30[_0x9e64('0x49')]);return db['UserWhatsappQueue']['findAll'](_0xe8ad12);}})[_0x9e64('0x2c')](function(_0x3429ea){if(_0x3429ea){return db[_0x9e64('0x60')][_0x9e64('0x61')]({'where':{'id':_['map'](_0x3429ea,'UserId'),'role':_0x9e64('0x62')},'attributes':['id',_0x9e64('0x32'),_0x9e64('0x63'),_0x9e64('0x64'),_0x9e64('0x65')]});}})[_0x9e64('0x2c')](function(_0x5b6a22){if(_0x5b6a22){return{'count':_0x5b6a22[_0x9e64('0x26')],'rows':_[_0x9e64('0x35')](_0x5b6a22[_0x9e64('0x4d')],function(_0x2f0d23){return{'membername':_0x2f0d23[_0x9e64('0x32')],'UserId':_0x2f0d23['id'],'queue_name':_0x251652[_0x9e64('0x32')],'WhatsappQueueId':_0x251652['id'],'interface':util[_0x9e64('0x66')](_0x9e64('0x67'),_0x9e64('0x68'),_0x2f0d23[_0x9e64('0x32')]),'penalty':0x0,'paused':_0x2f0d23['whatsappPause'],'createdAt':_0x2f0d23[_0x9e64('0x65')],'updatedAt':_0x2f0d23[_0x9e64('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9e64('0x2c')](respondWithFilteredResult(_0x4c8e44,_0xe8ad12))['catch'](handleError(_0x4c8e44,null));};exports[_0x9e64('0x69')]=function(_0x26aab3,_0x25b360,_0x4423ae){var _0x37eaac={};var _0x2964a8={};var _0x28100d;var _0x427581;return db['WhatsappQueue'][_0x9e64('0x6a')]({'where':{'id':_0x26aab3[_0x9e64('0x50')]['id']}})['then'](handleEntityNotFound(_0x25b360,null))[_0x9e64('0x2c')](function(_0x40db30){if(_0x40db30){_0x28100d=_0x40db30;_0x2964a8['model']=_['keys'](db[_0x9e64('0x6b')][_0x9e64('0x36')]);_0x2964a8['query']=_[_0x9e64('0x3b')](_0x26aab3[_0x9e64('0x3a')]);_0x2964a8[_0x9e64('0x3c')]=_[_0x9e64('0x3d')](_0x2964a8[_0x9e64('0x39')],_0x2964a8[_0x9e64('0x3a')]);_0x37eaac['attributes']=_[_0x9e64('0x3d')](_0x2964a8[_0x9e64('0x39')],qs['fields'](_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x3f')]));_0x37eaac[_0x9e64('0x3e')]=_0x37eaac[_0x9e64('0x3e')]['length']?_0x37eaac['attributes']:_0x2964a8[_0x9e64('0x39')];_0x37eaac[_0x9e64('0x42')]=qs[_0x9e64('0x43')](_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x43')]);_0x37eaac[_0x9e64('0x46')]=qs['filters'](_[_0x9e64('0x44')](_0x26aab3[_0x9e64('0x3a')],_0x2964a8[_0x9e64('0x3c')]));if(_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x45')]){_0x37eaac[_0x9e64('0x46')]=_[_0x9e64('0x47')](_0x37eaac[_0x9e64('0x46')],{'$or':_[_0x9e64('0x35')](_0x37eaac['attributes'],function(_0x4d5ff0){var _0x536384={};_0x536384[_0x4d5ff0]={'$like':'%'+_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x45')]+'%'};return _0x536384;})});}_0x37eaac=_[_0x9e64('0x47')]({},_0x37eaac,_0x26aab3[_0x9e64('0x49')]);return _0x28100d[_0x9e64('0x69')](_0x37eaac);}})['then'](function(_0xdd444a){if(_0xdd444a){_0x427581=_0xdd444a[_0x9e64('0x51')];if(!_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x40')](_0x9e64('0x41'))){_0x37eaac['limit']=qs[_0x9e64('0x25')](_0x26aab3['query'][_0x9e64('0x25')]);_0x37eaac[_0x9e64('0x23')]=qs[_0x9e64('0x23')](_0x26aab3[_0x9e64('0x3a')][_0x9e64('0x23')]);}return _0x28100d[_0x9e64('0x69')](_0x37eaac);}})[_0x9e64('0x2c')](function(_0x50f933){if(_0x50f933){return _0x50f933?{'count':_0x427581,'rows':_0x50f933}:null;}})[_0x9e64('0x2c')](respondWithResult(_0x25b360,null))[_0x9e64('0x4e')](handleError(_0x25b360,null));};exports['addTeams']=function(_0x69f8ea,_0x4fd4ee,_0x47064f){var _0x8d5339=_0x69f8ea[_0x9e64('0x53')][_0x9e64('0x6c')];return db['Team']['findAll']({'where':{'id':_0x8d5339},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9e64('0x6d'),'attributes':['id',_0x9e64('0x32'),'online',_0x9e64('0x6e'),_0x9e64('0x6f')],'raw':!![]}]})[_0x9e64('0x2c')](function(_0x228ce4){if(_0x228ce4){var _0x49a78f=_[_0x9e64('0x70')](_0x228ce4,function(_0x1b6e41){var _0x102a19=_0x1b6e41[_0x9e64('0x2d')]({'plain':!![]});return _0x102a19[_0x9e64('0x6d')];});return db[_0x9e64('0x4a')]['find']({'where':{'id':_0x69f8ea['params']['id']}})[_0x9e64('0x2c')](function(_0x754992){return db['sequelize'][_0x9e64('0x71')](function(_0x5e1d15){return _0x754992[_0x9e64('0x72')](_0x8d5339,{'transaction':_0x5e1d15})[_0x9e64('0x2c')](function(){return BPromise['each'](_0x49a78f,function(_0xa91c21){return db['UserWhatsappQueue'][_0x9e64('0x73')]({'where':{'UserId':_0xa91c21['id'],'WhatsappQueueId':_0x69f8ea[_0x9e64('0x50')]['id']},'transaction':_0x5e1d15});});})[_0x9e64('0x2c')](function(){_0x49a78f[_0x9e64('0x74')](function(_0x395929){socket['emit'](_0x9e64('0x75'),{'UserId':_0x395929['id'],'WhatsappQueueId':_0x754992['id']});});});});});}})[_0x9e64('0x2c')](respondWithStatusCode(_0x4fd4ee,null))['catch'](handleError(_0x4fd4ee,null));};exports['removeTeams']=function(_0x2caca5,_0x2b6848,_0x50aac3){return db['Team']['findAll']({'where':{'id':_0x2caca5[_0x9e64('0x3a')][_0x9e64('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9e64('0x2c')](handleEntityNotFound(_0x2b6848,null))[_0x9e64('0x2c')](function(_0x12f655){var _0x3537a6=_['map'](_0x12f655,'id');var _0x2bdfaa=[];var _0xa44b77=[];var _0x53d45f=squel[_0x9e64('0x76')]();_0x53d45f[_0x9e64('0x77')]('tq.TeamId')[_0x9e64('0x78')](_0x9e64('0x79'),'tq')[_0x9e64('0x7a')](_0x9e64('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9e64('0x46')](_0x9e64('0x7c'),_0x2caca5[_0x9e64('0x50')]['id']);for(var _0x2f22a1=0x0;_0x2f22a1<_0x12f655[_0x9e64('0x51')];_0x2f22a1+=0x1){let _0x4352fe=_0x12f655[_0x2f22a1];for(var _0xa20466=0x0;_0xa20466<_0x4352fe[_0x9e64('0x6d')][_0x9e64('0x51')];_0xa20466+=0x1){let _0xc47919=_0x4352fe[_0x9e64('0x6d')][_0xa20466];var _0x4e5a9a=_0x53d45f['clone']();_0x4e5a9a[_0x9e64('0x46')]('ut.UserId\x20=\x20?',_0xc47919['id']);_0xa44b77['push'](db[_0x9e64('0x7d')][_0x9e64('0x3a')](_0x4e5a9a['toString'](),{'type':db[_0x9e64('0x7d')][_0x9e64('0x7e')]['SELECT']})[_0x9e64('0x2c')](function(_0x539c65){if(_0x539c65[_0x9e64('0x51')]===0x1){return _0xc47919['id'];}else{var _0x26d714=_[_0x9e64('0x7f')](_[_0x9e64('0x35')](_0x539c65,_0x9e64('0x80')),function(_0x158c02){return _[_0x9e64('0x81')](_0x3537a6,_0x158c02);});if(_0x26d714){return _0xc47919['id'];}}}));}}return BPromise[_0x9e64('0x82')](_0xa44b77)[_0x9e64('0x2c')](function(_0x5f1202){_0x2bdfaa=_(_0x2bdfaa)['union'](_0x5f1202)['compact']()[_0x9e64('0x83')]();return db[_0x9e64('0x4a')][_0x9e64('0x58')]({'where':{'id':_0x2caca5[_0x9e64('0x50')]['id']}})[_0x9e64('0x2c')](function(_0x239fcf){return db['sequelize'][_0x9e64('0x71')](function(_0x48eb1b){return _0x239fcf[_0x9e64('0x84')](_0x2caca5[_0x9e64('0x3a')][_0x9e64('0x6c')],{'transaction':_0x48eb1b})['then'](function(){if(!_[_0x9e64('0x85')](_0x2bdfaa)){return _0x239fcf[_0x9e64('0x86')](_0x2bdfaa,{'transaction':_0x48eb1b});}})[_0x9e64('0x2c')](function(){_0x2bdfaa[_0x9e64('0x74')](function(_0x557af5){socket[_0x9e64('0x87')](_0x9e64('0x88'),{'UserId':_0x557af5,'WhatsappQueueId':_0x239fcf['id']});});});});});});})['then'](respondWithStatusCode(_0x2b6848,null))[_0x9e64('0x4e')](handleError(_0x2b6848,null));};exports[_0x9e64('0x89')]=function(_0x3e0871,_0x2644e3,_0x4b5d4f){return db[_0x9e64('0x4a')]['find']({'where':{'id':_0x3e0871[_0x9e64('0x50')]['id']}})[_0x9e64('0x2c')](handleEntityNotFound(_0x2644e3,null))[_0x9e64('0x2c')](function(_0x223ff5){if(_0x223ff5){return _0x223ff5[_0x9e64('0x89')](_0x3e0871[_0x9e64('0x53')]['ids'],_[_0x9e64('0x8a')](_0x3e0871['body'],[_0x9e64('0x6c'),'id'])||{})[_0x9e64('0x8b')](function(_0x43cf98){for(var _0x4f58f1=0x0;_0x4f58f1<_0x3e0871['body'][_0x9e64('0x6c')][_0x9e64('0x51')];_0x4f58f1+=0x1){socket[_0x9e64('0x87')](_0x9e64('0x75'),{'UserId':Number(_0x3e0871[_0x9e64('0x53')]['ids'][_0x4f58f1]),'WhatsappQueueId':Number(_0x3e0871[_0x9e64('0x50')]['id'])});}return _0x43cf98;});}})[_0x9e64('0x2c')](respondWithResult(_0x2644e3,null))[_0x9e64('0x4e')](handleError(_0x2644e3,null));};exports[_0x9e64('0x86')]=function(_0x2ab07f,_0x3eae6e,_0x5e9a08){return db[_0x9e64('0x4a')]['find']({'where':{'id':_0x2ab07f[_0x9e64('0x50')]['id']}})['then'](handleEntityNotFound(_0x3eae6e,null))[_0x9e64('0x2c')](function(_0x5bfe18){if(_0x5bfe18){return _0x5bfe18[_0x9e64('0x86')](_0x2ab07f[_0x9e64('0x3a')][_0x9e64('0x6c')])[_0x9e64('0x2c')](function(){if(_[_0x9e64('0x8c')](_0x2ab07f[_0x9e64('0x3a')][_0x9e64('0x6c')])){for(var _0x30d0dc=0x0;_0x30d0dc<_0x2ab07f[_0x9e64('0x3a')][_0x9e64('0x6c')][_0x9e64('0x51')];_0x30d0dc+=0x1){socket[_0x9e64('0x87')](_0x9e64('0x88'),{'UserId':Number(_0x2ab07f[_0x9e64('0x3a')][_0x9e64('0x6c')][_0x30d0dc]),'WhatsappQueueId':Number(_0x2ab07f[_0x9e64('0x50')]['id'])});}}else{socket[_0x9e64('0x87')](_0x9e64('0x88'),{'UserId':Number(_0x2ab07f['query'][_0x9e64('0x6c')]),'WhatsappQueueId':Number(_0x2ab07f[_0x9e64('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eae6e,null))[_0x9e64('0x4e')](handleError(_0x3eae6e,null));};exports[_0x9e64('0x8d')]=function(_0x26de12,_0x6f3018,_0x45337b){var _0x5494bc={};var _0x1bf4d1={};var _0x2c34d9;var _0x254413;return db[_0x9e64('0x4a')][_0x9e64('0x6a')]({'where':{'id':_0x26de12[_0x9e64('0x50')]['id']}})[_0x9e64('0x2c')](handleEntityNotFound(_0x6f3018,null))[_0x9e64('0x2c')](function(_0x4c4147){if(_0x4c4147){_0x2c34d9=_0x4c4147;_0x1bf4d1['model']=_[_0x9e64('0x3b')](db['User']['rawAttributes']);_0x1bf4d1[_0x9e64('0x3a')]=_[_0x9e64('0x3b')](_0x26de12[_0x9e64('0x3a')]);_0x1bf4d1['filters']=_[_0x9e64('0x3d')](_0x1bf4d1[_0x9e64('0x39')],_0x1bf4d1[_0x9e64('0x3a')]);_0x5494bc['attributes']=_[_0x9e64('0x3d')](_0x1bf4d1[_0x9e64('0x39')],qs['fields'](_0x26de12[_0x9e64('0x3a')][_0x9e64('0x3f')]));_0x5494bc[_0x9e64('0x3e')]=_0x5494bc[_0x9e64('0x3e')][_0x9e64('0x51')]?_0x5494bc[_0x9e64('0x3e')]:_0x1bf4d1['model'];_0x5494bc[_0x9e64('0x42')]=qs[_0x9e64('0x43')](_0x26de12[_0x9e64('0x3a')][_0x9e64('0x43')]);_0x5494bc[_0x9e64('0x46')]=qs[_0x9e64('0x3c')](_[_0x9e64('0x44')](_0x26de12[_0x9e64('0x3a')],_0x1bf4d1[_0x9e64('0x3c')]));if(_0x26de12[_0x9e64('0x3a')][_0x9e64('0x45')]){_0x5494bc[_0x9e64('0x46')]=_[_0x9e64('0x47')](_0x5494bc['where'],{'$or':_[_0x9e64('0x35')](_0x5494bc['attributes'],function(_0x1d039f){var _0x1784ce={};_0x1784ce[_0x1d039f]={'$like':'%'+_0x26de12[_0x9e64('0x3a')]['filter']+'%'};return _0x1784ce;})});}_0x5494bc=_['merge']({},_0x5494bc,_0x26de12['options']);return _0x2c34d9[_0x9e64('0x8d')](_0x5494bc);}})[_0x9e64('0x2c')](function(_0x3b3776){if(_0x3b3776){_0x254413=_0x3b3776[_0x9e64('0x51')];if(!_0x26de12['query'][_0x9e64('0x40')](_0x9e64('0x41'))){_0x5494bc[_0x9e64('0x25')]=qs['limit'](_0x26de12[_0x9e64('0x3a')]['limit']);_0x5494bc[_0x9e64('0x23')]=qs[_0x9e64('0x23')](_0x26de12[_0x9e64('0x3a')][_0x9e64('0x23')]);}return _0x2c34d9[_0x9e64('0x8d')](_0x5494bc);}})[_0x9e64('0x2c')](function(_0x102db0){if(_0x102db0){return _0x102db0?{'count':_0x254413,'rows':_0x102db0}:null;}})['then'](respondWithResult(_0x6f3018,null))['catch'](handleError(_0x6f3018,null));}; \ No newline at end of file +var _0xa30b=['value','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','get','WhatsappQueues','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','WhatsappQueue','include','findAll','rows','show','params','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','describe','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','sequelize','SELECT','every','TeamId','includes','all','union'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa30b,0x1ad));var _0xba30=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa30b[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xba30('0x0'));var rimraf=require(_0xba30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xba30('0x2'));var moment=require('moment');var BPromise=require(_0xba30('0x3'));var Mustache=require(_0xba30('0x4'));var util=require(_0xba30('0x5'));var path=require(_0xba30('0x6'));var sox=require(_0xba30('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba30('0x8'));var squel=require('squel');var crypto=require(_0xba30('0x9'));var jsforce=require(_0xba30('0xa'));var deskjs=require(_0xba30('0xb'));var toCsv=require(_0xba30('0xc'));var querystring=require(_0xba30('0xd'));var Papa=require('papaparse');var Redis=require(_0xba30('0xe'));var authService=require(_0xba30('0xf'));var qs=require(_0xba30('0x10'));var as=require(_0xba30('0x11'));var hardwareService=require(_0xba30('0x12'));var logger=require(_0xba30('0x13'))(_0xba30('0x14'));var utils=require(_0xba30('0x15'));var config=require(_0xba30('0x16'));var licenseUtil=require(_0xba30('0x17'));var db=require('../../mysqldb')['db'];config[_0xba30('0x18')]=_[_0xba30('0x19')](config[_0xba30('0x18')],{'host':_0xba30('0x1a'),'port':0x18eb});var socket=require(_0xba30('0x1b'))(new Redis(config[_0xba30('0x18')]));require(_0xba30('0x1c'))['register'](socket);function respondWithStatusCode(_0x494daa,_0x3609e6){_0x3609e6=_0x3609e6||0xcc;return function(_0x302118){if(_0x302118){return _0x494daa['sendStatus'](_0x3609e6);}return _0x494daa[_0xba30('0x1d')](_0x3609e6)['end']();};}function respondWithResult(_0x133f3e,_0xb5c917){_0xb5c917=_0xb5c917||0xc8;return function(_0x158d73){if(_0x158d73){return _0x133f3e[_0xba30('0x1d')](_0xb5c917)[_0xba30('0x1e')](_0x158d73);}};}function respondWithFilteredResult(_0x1dd201,_0x22ad9b){return function(_0x5a19cc){if(_0x5a19cc){var _0x24c990=typeof _0x22ad9b['offset']===_0xba30('0x1f')&&typeof _0x22ad9b[_0xba30('0x20')]===_0xba30('0x1f');var _0x518887=_0x5a19cc[_0xba30('0x21')];var _0x578fb2=_0x24c990?0x0:_0x22ad9b['offset'];var _0x48fe10=_0x24c990?_0x5a19cc[_0xba30('0x21')]:_0x22ad9b[_0xba30('0x22')]+_0x22ad9b[_0xba30('0x20')];var _0x971e78;if(_0x48fe10>=_0x518887){_0x48fe10=_0x518887;_0x971e78=0xc8;}else{_0x971e78=0xce;}_0x1dd201[_0xba30('0x1d')](_0x971e78);return _0x1dd201[_0xba30('0x23')](_0xba30('0x24'),_0x578fb2+'-'+_0x48fe10+'/'+_0x518887)[_0xba30('0x1e')](_0x5a19cc);}return null;};}function patchUpdates(_0xb69468){return function(_0x3203ef){try{jsonpatch[_0xba30('0x25')](_0x3203ef,_0xb69468,!![]);}catch(_0x493a9c){return BPromise['reject'](_0x493a9c);}return _0x3203ef['save']();};}function saveUpdates(_0x7db1bc,_0x27a5aa){return function(_0x284d44){if(_0x284d44){return _0x284d44[_0xba30('0x26')](_0x7db1bc)[_0xba30('0x27')](function(_0x15b706){return _0x15b706;});}return null;};}function removeEntity(_0x4696fa,_0x3b9c35){return function(_0x4681b9){if(_0x4681b9){return _0x4681b9['destroy']()[_0xba30('0x27')](function(){var _0x3cd863=_0x4681b9[_0xba30('0x28')]({'plain':!![]});var _0xba5369=_0xba30('0x29');return db['UserProfileResource'][_0xba30('0x2a')]({'where':{'type':_0xba5369,'resourceId':_0x3cd863['id']}})[_0xba30('0x27')](function(){return _0x4681b9;});})[_0xba30('0x27')](function(){_0x4696fa[_0xba30('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37c40c,_0x32df2c){return function(_0x127d7d){if(!_0x127d7d){_0x37c40c[_0xba30('0x2b')](0x194);}return _0x127d7d;};}function handleError(_0x5af3e8,_0x395ab8){_0x395ab8=_0x395ab8||0x1f4;return function(_0x3e5098){logger[_0xba30('0x2c')](_0x3e5098['stack']);if(_0x3e5098[_0xba30('0x2d')]){delete _0x3e5098[_0xba30('0x2d')];}_0x5af3e8[_0xba30('0x1d')](_0x395ab8)[_0xba30('0x2e')](_0x3e5098);};}exports[_0xba30('0x2f')]=function(_0x29068f,_0x596c02){var _0x521a15={},_0x1d25a6={},_0x3a1ada={'count':0x0,'rows':[]};var _0x377579=_['map'](db['WhatsappQueue'][_0xba30('0x30')],function(_0xbc2de1){return{'name':_0xbc2de1[_0xba30('0x31')],'type':_0xbc2de1[_0xba30('0x32')][_0xba30('0x33')]};});_0x1d25a6[_0xba30('0x34')]=_[_0xba30('0x35')](_0x377579,_0xba30('0x2d'));_0x1d25a6['query']=_[_0xba30('0x36')](_0x29068f[_0xba30('0x37')]);_0x1d25a6[_0xba30('0x38')]=_['intersection'](_0x1d25a6[_0xba30('0x34')],_0x1d25a6[_0xba30('0x37')]);_0x521a15[_0xba30('0x39')]=_[_0xba30('0x3a')](_0x1d25a6['model'],qs[_0xba30('0x3b')](_0x29068f[_0xba30('0x37')][_0xba30('0x3b')]));_0x521a15['attributes']=_0x521a15[_0xba30('0x39')]['length']?_0x521a15[_0xba30('0x39')]:_0x1d25a6[_0xba30('0x34')];if(!_0x29068f[_0xba30('0x37')][_0xba30('0x3c')](_0xba30('0x3d'))){_0x521a15[_0xba30('0x20')]=qs[_0xba30('0x20')](_0x29068f[_0xba30('0x37')][_0xba30('0x20')]);_0x521a15[_0xba30('0x22')]=qs['offset'](_0x29068f[_0xba30('0x37')][_0xba30('0x22')]);}_0x521a15[_0xba30('0x3e')]=qs[_0xba30('0x3f')](_0x29068f['query'][_0xba30('0x3f')]);_0x521a15[_0xba30('0x40')]=qs[_0xba30('0x38')](_[_0xba30('0x41')](_0x29068f[_0xba30('0x37')],_0x1d25a6[_0xba30('0x38')]),_0x377579);if(_0x29068f[_0xba30('0x37')]['filter']){_0x521a15[_0xba30('0x40')]=_[_0xba30('0x42')](_0x521a15[_0xba30('0x40')],{'$or':_['map'](_0x377579,function(_0x456838){if(_0x456838[_0xba30('0x32')]!==_0xba30('0x43')){var _0x16e8f2={};_0x16e8f2[_0x456838[_0xba30('0x2d')]]={'$like':'%'+_0x29068f['query'][_0xba30('0x44')]+'%'};return _0x16e8f2;}})});}_0x521a15=_[_0xba30('0x42')]({},_0x521a15,_0x29068f['options']);var _0x2ba849={'where':_0x521a15[_0xba30('0x40')]};return db[_0xba30('0x45')][_0xba30('0x21')](_0x2ba849)[_0xba30('0x27')](function(_0x2f7fb7){_0x3a1ada[_0xba30('0x21')]=_0x2f7fb7;if(_0x29068f[_0xba30('0x37')]['includeAll']){_0x521a15[_0xba30('0x46')]=[{'all':!![]}];}return db[_0xba30('0x45')][_0xba30('0x47')](_0x521a15);})[_0xba30('0x27')](function(_0x10ceab){_0x3a1ada[_0xba30('0x48')]=_0x10ceab;return _0x3a1ada;})[_0xba30('0x27')](respondWithFilteredResult(_0x596c02,_0x521a15))['catch'](handleError(_0x596c02,null));};exports[_0xba30('0x49')]=function(_0x54412a,_0x593c00){var _0x2f1944={'raw':!![],'where':{'id':_0x54412a[_0xba30('0x4a')]['id']}},_0x1078e2={};_0x1078e2[_0xba30('0x34')]=_[_0xba30('0x36')](db[_0xba30('0x45')]['rawAttributes']);_0x1078e2['query']=_['keys'](_0x54412a[_0xba30('0x37')]);_0x1078e2['filters']=_[_0xba30('0x3a')](_0x1078e2[_0xba30('0x34')],_0x1078e2[_0xba30('0x37')]);_0x2f1944[_0xba30('0x39')]=_[_0xba30('0x3a')](_0x1078e2[_0xba30('0x34')],qs[_0xba30('0x3b')](_0x54412a['query'][_0xba30('0x3b')]));_0x2f1944[_0xba30('0x39')]=_0x2f1944[_0xba30('0x39')][_0xba30('0x4b')]?_0x2f1944['attributes']:_0x1078e2[_0xba30('0x34')];if(_0x54412a['query'][_0xba30('0x4c')]){_0x2f1944[_0xba30('0x46')]=[{'all':!![]}];}_0x2f1944=_[_0xba30('0x42')]({},_0x2f1944,_0x54412a[_0xba30('0x4d')]);return db[_0xba30('0x45')][_0xba30('0x4e')](_0x2f1944)[_0xba30('0x27')](handleEntityNotFound(_0x593c00,null))[_0xba30('0x27')](respondWithResult(_0x593c00,null))[_0xba30('0x4f')](handleError(_0x593c00,null));};exports[_0xba30('0x50')]=function(_0x9343b,_0x4a7d87){return db[_0xba30('0x45')][_0xba30('0x50')](_0x9343b[_0xba30('0x51')],{})[_0xba30('0x27')](function(_0x3f0e95){var _0x25f2f2=_0x9343b[_0xba30('0x52')]['get']({'plain':!![]});if(!_0x25f2f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25f2f2[_0xba30('0x53')]===_0xba30('0x52')){var _0x187a71=_0x3f0e95['get']({'plain':!![]});var _0x235c93='WhatsappQueues';return db[_0xba30('0x54')][_0xba30('0x4e')]({'where':{'name':_0x235c93,'userProfileId':_0x25f2f2[_0xba30('0x55')]},'raw':!![]})['then'](function(_0x2da7e4){if(_0x2da7e4&&_0x2da7e4['autoAssociation']===0x0){return db['UserProfileResource'][_0xba30('0x50')]({'name':_0x187a71[_0xba30('0x2d')],'resourceId':_0x187a71['id'],'type':_0x2da7e4[_0xba30('0x2d')],'sectionId':_0x2da7e4['id']},{})[_0xba30('0x27')](function(){return _0x3f0e95;});}else{return _0x3f0e95;}})[_0xba30('0x4f')](function(_0x580482){logger[_0xba30('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x580482);throw _0x580482;});}return _0x3f0e95;})[_0xba30('0x27')](respondWithResult(_0x4a7d87,0xc9))['catch'](handleError(_0x4a7d87,null));};exports[_0xba30('0x26')]=function(_0x5b05a8,_0x29c02b){if(_0x5b05a8[_0xba30('0x51')]['id']){delete _0x5b05a8[_0xba30('0x51')]['id'];}return db[_0xba30('0x45')][_0xba30('0x4e')]({'where':{'id':_0x5b05a8[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](handleEntityNotFound(_0x29c02b,null))[_0xba30('0x27')](saveUpdates(_0x5b05a8[_0xba30('0x51')],null))[_0xba30('0x27')](respondWithResult(_0x29c02b,null))[_0xba30('0x4f')](handleError(_0x29c02b,null));};exports[_0xba30('0x2a')]=function(_0x5d28a1,_0xf3e53c){return db['WhatsappQueue'][_0xba30('0x4e')]({'where':{'id':_0x5d28a1[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](handleEntityNotFound(_0xf3e53c,null))[_0xba30('0x27')](removeEntity(_0xf3e53c,null))[_0xba30('0x4f')](handleError(_0xf3e53c,null));};exports['describe']=function(_0x48c5dd,_0x264a4d){return db['WhatsappQueue'][_0xba30('0x56')]()['then'](respondWithResult(_0x264a4d,null))[_0xba30('0x4f')](handleError(_0x264a4d,null));};exports['getMembers']=function(_0x4a7b00,_0xe9d8c1,_0x59014b){var _0x3a8073={'raw':!![],'where':{}},_0x2b8031={},_0x43613a;return db[_0xba30('0x45')]['findOne']({'where':{'id':_0x4a7b00['params']['id']}})[_0xba30('0x27')](handleEntityNotFound(_0xe9d8c1,null))[_0xba30('0x27')](function(_0x52b9fa){if(_0x52b9fa){_0x43613a=_0x52b9fa[_0xba30('0x28')]({'plain':!![]});_0x2b8031[_0xba30('0x34')]=_[_0xba30('0x36')](db[_0xba30('0x57')][_0xba30('0x30')]);_0x2b8031[_0xba30('0x37')]=_['keys'](_0x4a7b00['query']);_0x2b8031[_0xba30('0x38')]=_[_0xba30('0x3a')](_0x2b8031['model'],_0x2b8031[_0xba30('0x37')]);_0x3a8073[_0xba30('0x39')]=_[_0xba30('0x3a')](_0x2b8031[_0xba30('0x34')],qs['fields'](_0x4a7b00[_0xba30('0x37')][_0xba30('0x3b')]));_0x3a8073['attributes']=_0x3a8073[_0xba30('0x39')][_0xba30('0x4b')]?_0x3a8073['attributes']:_0x2b8031[_0xba30('0x34')];if(!_0x4a7b00['query'][_0xba30('0x3c')](_0xba30('0x3d'))){_0x3a8073[_0xba30('0x20')]=qs['limit'](_0x4a7b00[_0xba30('0x37')][_0xba30('0x20')]);_0x3a8073[_0xba30('0x22')]=qs['offset'](_0x4a7b00['query'][_0xba30('0x22')]);}_0x3a8073[_0xba30('0x3e')]=qs[_0xba30('0x3f')](_0x4a7b00[_0xba30('0x37')]['sort']);_0x3a8073[_0xba30('0x40')]=qs[_0xba30('0x38')](_[_0xba30('0x41')](_0x4a7b00[_0xba30('0x37')],_0x2b8031[_0xba30('0x38')]));_0x3a8073['where'][_0xba30('0x58')]=_0x52b9fa['id'];if(_0x4a7b00[_0xba30('0x37')]['filter']){_0x3a8073[_0xba30('0x40')]=_[_0xba30('0x42')](_0x3a8073['where'],{'$or':_[_0xba30('0x35')](_0x3a8073[_0xba30('0x39')],function(_0xf87b86){var _0x47bb24={};_0x47bb24[_0xf87b86]={'$like':'%'+_0x4a7b00[_0xba30('0x37')][_0xba30('0x44')]+'%'};return _0x47bb24;})});}_0x3a8073=_[_0xba30('0x42')]({},_0x3a8073,_0x4a7b00[_0xba30('0x4d')]);return db['UserWhatsappQueue']['findAll'](_0x3a8073);}})[_0xba30('0x27')](function(_0x2ec581){if(_0x2ec581){return db[_0xba30('0x59')][_0xba30('0x5a')]({'where':{'id':_[_0xba30('0x35')](_0x2ec581,_0xba30('0x5b')),'role':_0xba30('0x5c')},'attributes':['id',_0xba30('0x2d'),_0xba30('0x5d'),_0xba30('0x5e'),'createdAt']});}})[_0xba30('0x27')](function(_0x47b00f){if(_0x47b00f){return{'count':_0x47b00f[_0xba30('0x21')],'rows':_[_0xba30('0x35')](_0x47b00f['rows'],function(_0x4a0597){return{'membername':_0x4a0597[_0xba30('0x2d')],'UserId':_0x4a0597['id'],'queue_name':_0x43613a[_0xba30('0x2d')],'WhatsappQueueId':_0x43613a['id'],'interface':util[_0xba30('0x5f')](_0xba30('0x60'),_0xba30('0x61'),_0x4a0597[_0xba30('0x2d')]),'penalty':0x0,'paused':_0x4a0597[_0xba30('0x5d')],'createdAt':_0x4a0597[_0xba30('0x62')],'updatedAt':_0x4a0597[_0xba30('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba30('0x27')](respondWithFilteredResult(_0xe9d8c1,_0x3a8073))[_0xba30('0x4f')](handleError(_0xe9d8c1,null));};exports[_0xba30('0x63')]=function(_0xdc4d9b,_0x230d00,_0x3131a9){var _0x2136a2={};var _0x5691de={};var _0x13949c;var _0x17e437;return db[_0xba30('0x45')][_0xba30('0x64')]({'where':{'id':_0xdc4d9b[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](handleEntityNotFound(_0x230d00,null))['then'](function(_0x51b30c){if(_0x51b30c){_0x13949c=_0x51b30c;_0x5691de[_0xba30('0x34')]=_[_0xba30('0x36')](db[_0xba30('0x65')][_0xba30('0x30')]);_0x5691de[_0xba30('0x37')]=_[_0xba30('0x36')](_0xdc4d9b[_0xba30('0x37')]);_0x5691de[_0xba30('0x38')]=_[_0xba30('0x3a')](_0x5691de[_0xba30('0x34')],_0x5691de[_0xba30('0x37')]);_0x2136a2[_0xba30('0x39')]=_[_0xba30('0x3a')](_0x5691de['model'],qs['fields'](_0xdc4d9b[_0xba30('0x37')]['fields']));_0x2136a2[_0xba30('0x39')]=_0x2136a2[_0xba30('0x39')][_0xba30('0x4b')]?_0x2136a2[_0xba30('0x39')]:_0x5691de[_0xba30('0x34')];_0x2136a2[_0xba30('0x3e')]=qs[_0xba30('0x3f')](_0xdc4d9b['query'][_0xba30('0x3f')]);_0x2136a2[_0xba30('0x40')]=qs[_0xba30('0x38')](_[_0xba30('0x41')](_0xdc4d9b[_0xba30('0x37')],_0x5691de[_0xba30('0x38')]));if(_0xdc4d9b[_0xba30('0x37')]['filter']){_0x2136a2[_0xba30('0x40')]=_[_0xba30('0x42')](_0x2136a2['where'],{'$or':_[_0xba30('0x35')](_0x2136a2[_0xba30('0x39')],function(_0x5f21f4){var _0x5033be={};_0x5033be[_0x5f21f4]={'$like':'%'+_0xdc4d9b[_0xba30('0x37')][_0xba30('0x44')]+'%'};return _0x5033be;})});}_0x2136a2=_[_0xba30('0x42')]({},_0x2136a2,_0xdc4d9b[_0xba30('0x4d')]);return _0x13949c['getTeams'](_0x2136a2);}})[_0xba30('0x27')](function(_0x236a52){if(_0x236a52){_0x17e437=_0x236a52[_0xba30('0x4b')];if(!_0xdc4d9b[_0xba30('0x37')][_0xba30('0x3c')]('nolimit')){_0x2136a2['limit']=qs[_0xba30('0x20')](_0xdc4d9b[_0xba30('0x37')]['limit']);_0x2136a2[_0xba30('0x22')]=qs[_0xba30('0x22')](_0xdc4d9b[_0xba30('0x37')]['offset']);}return _0x13949c[_0xba30('0x63')](_0x2136a2);}})['then'](function(_0x30b306){if(_0x30b306){return _0x30b306?{'count':_0x17e437,'rows':_0x30b306}:null;}})[_0xba30('0x27')](respondWithResult(_0x230d00,null))[_0xba30('0x4f')](handleError(_0x230d00,null));};exports[_0xba30('0x66')]=function(_0x33f476,_0x5062b6,_0x3a8721){var _0x23a698=_0x33f476[_0xba30('0x51')][_0xba30('0x67')];return db[_0xba30('0x65')][_0xba30('0x47')]({'where':{'id':_0x23a698},'attributes':['id'],'include':[{'model':db['User'],'as':_0xba30('0x68'),'attributes':['id',_0xba30('0x2d'),'online',_0xba30('0x69'),_0xba30('0x6a')],'raw':!![]}]})['then'](function(_0x4c496b){if(_0x4c496b){var _0x4220cc=_[_0xba30('0x6b')](_0x4c496b,function(_0x3bdbe8){var _0x7cd3e2=_0x3bdbe8[_0xba30('0x28')]({'plain':!![]});return _0x7cd3e2[_0xba30('0x68')];});return db['WhatsappQueue']['find']({'where':{'id':_0x33f476[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](function(_0x54fdbb){return db['sequelize'][_0xba30('0x6c')](function(_0x390695){return _0x54fdbb[_0xba30('0x66')](_0x23a698,{'transaction':_0x390695})[_0xba30('0x27')](function(){return BPromise[_0xba30('0x6d')](_0x4220cc,function(_0x4983a6){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x4983a6['id'],'WhatsappQueueId':_0x33f476[_0xba30('0x4a')]['id']},'transaction':_0x390695});});})[_0xba30('0x27')](function(){_0x4220cc[_0xba30('0x6e')](function(_0x5b3204){socket[_0xba30('0x6f')](_0xba30('0x70'),{'UserId':_0x5b3204['id'],'WhatsappQueueId':_0x54fdbb['id']});});});});});}})[_0xba30('0x27')](respondWithStatusCode(_0x5062b6,null))[_0xba30('0x4f')](handleError(_0x5062b6,null));};exports[_0xba30('0x71')]=function(_0x4d7953,_0xfdb7d,_0x559a03){return db[_0xba30('0x65')][_0xba30('0x47')]({'where':{'id':_0x4d7953[_0xba30('0x37')][_0xba30('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xba30('0x27')](handleEntityNotFound(_0xfdb7d,null))[_0xba30('0x27')](function(_0x1b8514){var _0x1e3278=_[_0xba30('0x35')](_0x1b8514,'id');var _0x4d3ad6=[];var _0x30a2b5=[];var _0x503496=squel[_0xba30('0x72')]();_0x503496[_0xba30('0x73')](_0xba30('0x74'))[_0xba30('0x75')]('team_has_whatsapp_queues','tq')[_0xba30('0x76')](_0xba30('0x77'),'ut',_0xba30('0x78'))[_0xba30('0x40')](_0xba30('0x79'),_0x4d7953['params']['id']);for(var _0x18cb69=0x0;_0x18cb69<_0x1b8514[_0xba30('0x4b')];_0x18cb69+=0x1){let _0x1b4462=_0x1b8514[_0x18cb69];for(var _0xd64d07=0x0;_0xd64d07<_0x1b4462[_0xba30('0x68')][_0xba30('0x4b')];_0xd64d07+=0x1){let _0x1f337e=_0x1b4462[_0xba30('0x68')][_0xd64d07];var _0x3f6350=_0x503496['clone']();_0x3f6350[_0xba30('0x40')](_0xba30('0x7a'),_0x1f337e['id']);_0x30a2b5['push'](db['sequelize'][_0xba30('0x37')](_0x3f6350[_0xba30('0x7b')](),{'type':db[_0xba30('0x7c')]['QueryTypes'][_0xba30('0x7d')]})[_0xba30('0x27')](function(_0x516f97){if(_0x516f97['length']===0x1){return _0x1f337e['id'];}else{var _0x2a012a=_[_0xba30('0x7e')](_[_0xba30('0x35')](_0x516f97,_0xba30('0x7f')),function(_0x4775a8){return _[_0xba30('0x80')](_0x1e3278,_0x4775a8);});if(_0x2a012a){return _0x1f337e['id'];}}}));}}return BPromise[_0xba30('0x81')](_0x30a2b5)[_0xba30('0x27')](function(_0x11e96b){_0x4d3ad6=_(_0x4d3ad6)[_0xba30('0x82')](_0x11e96b)['compact']()[_0xba30('0x83')]();return db[_0xba30('0x45')][_0xba30('0x4e')]({'where':{'id':_0x4d7953[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](function(_0x597e87){return db[_0xba30('0x7c')][_0xba30('0x6c')](function(_0x253dc1){return _0x597e87[_0xba30('0x71')](_0x4d7953['query']['ids'],{'transaction':_0x253dc1})[_0xba30('0x27')](function(){if(!_[_0xba30('0x84')](_0x4d3ad6)){return _0x597e87['removeAgents'](_0x4d3ad6,{'transaction':_0x253dc1});}})[_0xba30('0x27')](function(){_0x4d3ad6['forEach'](function(_0x5dc306){socket[_0xba30('0x6f')](_0xba30('0x85'),{'UserId':_0x5dc306,'WhatsappQueueId':_0x597e87['id']});});});});});});})[_0xba30('0x27')](respondWithStatusCode(_0xfdb7d,null))[_0xba30('0x4f')](handleError(_0xfdb7d,null));};exports[_0xba30('0x86')]=function(_0xd6ea6a,_0x273078,_0x44b735){return db[_0xba30('0x45')][_0xba30('0x4e')]({'where':{'id':_0xd6ea6a[_0xba30('0x4a')]['id']}})[_0xba30('0x27')](handleEntityNotFound(_0x273078,null))[_0xba30('0x27')](function(_0x298290){if(_0x298290){return _0x298290[_0xba30('0x86')](_0xd6ea6a[_0xba30('0x51')][_0xba30('0x67')],_[_0xba30('0x87')](_0xd6ea6a[_0xba30('0x51')],['ids','id'])||{})[_0xba30('0x88')](function(_0x5d1095){for(var _0x1ca357=0x0;_0x1ca357<_0xd6ea6a['body'][_0xba30('0x67')][_0xba30('0x4b')];_0x1ca357+=0x1){socket[_0xba30('0x6f')](_0xba30('0x70'),{'UserId':Number(_0xd6ea6a[_0xba30('0x51')][_0xba30('0x67')][_0x1ca357]),'WhatsappQueueId':Number(_0xd6ea6a[_0xba30('0x4a')]['id'])});}return _0x5d1095;});}})['then'](respondWithResult(_0x273078,null))['catch'](handleError(_0x273078,null));};exports[_0xba30('0x89')]=function(_0x5db88a,_0x2013d2,_0x380c28){return db['WhatsappQueue'][_0xba30('0x4e')]({'where':{'id':_0x5db88a['params']['id']}})['then'](handleEntityNotFound(_0x2013d2,null))[_0xba30('0x27')](function(_0x5d1e99){if(_0x5d1e99){return _0x5d1e99[_0xba30('0x89')](_0x5db88a[_0xba30('0x37')]['ids'])[_0xba30('0x27')](function(){if(_[_0xba30('0x8a')](_0x5db88a[_0xba30('0x37')][_0xba30('0x67')])){for(var _0x2486b4=0x0;_0x2486b4<_0x5db88a[_0xba30('0x37')][_0xba30('0x67')][_0xba30('0x4b')];_0x2486b4+=0x1){socket[_0xba30('0x6f')](_0xba30('0x85'),{'UserId':Number(_0x5db88a['query'][_0xba30('0x67')][_0x2486b4]),'WhatsappQueueId':Number(_0x5db88a[_0xba30('0x4a')]['id'])});}}else{socket['emit'](_0xba30('0x85'),{'UserId':Number(_0x5db88a[_0xba30('0x37')][_0xba30('0x67')]),'WhatsappQueueId':Number(_0x5db88a[_0xba30('0x4a')]['id'])});}});}})[_0xba30('0x27')](respondWithStatusCode(_0x2013d2,null))['catch'](handleError(_0x2013d2,null));};exports['getAgents']=function(_0x417f89,_0x2d78db,_0x19ebcf){var _0x5a3470={};var _0x4d1c43={};var _0x2b9d43;var _0x1f7c18;return db[_0xba30('0x45')][_0xba30('0x64')]({'where':{'id':_0x417f89[_0xba30('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d78db,null))[_0xba30('0x27')](function(_0x52bf16){if(_0x52bf16){_0x2b9d43=_0x52bf16;_0x4d1c43[_0xba30('0x34')]=_[_0xba30('0x36')](db['User'][_0xba30('0x30')]);_0x4d1c43['query']=_[_0xba30('0x36')](_0x417f89[_0xba30('0x37')]);_0x4d1c43[_0xba30('0x38')]=_[_0xba30('0x3a')](_0x4d1c43['model'],_0x4d1c43['query']);_0x5a3470[_0xba30('0x39')]=_['intersection'](_0x4d1c43[_0xba30('0x34')],qs[_0xba30('0x3b')](_0x417f89[_0xba30('0x37')][_0xba30('0x3b')]));_0x5a3470[_0xba30('0x39')]=_0x5a3470[_0xba30('0x39')][_0xba30('0x4b')]?_0x5a3470[_0xba30('0x39')]:_0x4d1c43[_0xba30('0x34')];_0x5a3470[_0xba30('0x3e')]=qs[_0xba30('0x3f')](_0x417f89[_0xba30('0x37')]['sort']);_0x5a3470[_0xba30('0x40')]=qs[_0xba30('0x38')](_[_0xba30('0x41')](_0x417f89[_0xba30('0x37')],_0x4d1c43[_0xba30('0x38')]));if(_0x417f89['query']['filter']){_0x5a3470[_0xba30('0x40')]=_[_0xba30('0x42')](_0x5a3470[_0xba30('0x40')],{'$or':_[_0xba30('0x35')](_0x5a3470[_0xba30('0x39')],function(_0x1470df){var _0x515498={};_0x515498[_0x1470df]={'$like':'%'+_0x417f89[_0xba30('0x37')][_0xba30('0x44')]+'%'};return _0x515498;})});}_0x5a3470=_['merge']({},_0x5a3470,_0x417f89[_0xba30('0x4d')]);return _0x2b9d43[_0xba30('0x8b')](_0x5a3470);}})[_0xba30('0x27')](function(_0x22572c){if(_0x22572c){_0x1f7c18=_0x22572c[_0xba30('0x4b')];if(!_0x417f89[_0xba30('0x37')][_0xba30('0x3c')](_0xba30('0x3d'))){_0x5a3470['limit']=qs[_0xba30('0x20')](_0x417f89['query'][_0xba30('0x20')]);_0x5a3470[_0xba30('0x22')]=qs[_0xba30('0x22')](_0x417f89[_0xba30('0x37')]['offset']);}return _0x2b9d43[_0xba30('0x8b')](_0x5a3470);}})[_0xba30('0x27')](function(_0x508665){if(_0x508665){return _0x508665?{'count':_0x1f7c18,'rows':_0x508665}:null;}})[_0xba30('0x27')](respondWithResult(_0x2d78db,null))['catch'](handleError(_0x2d78db,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e072824..0aabbd4 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 _0x5aa2=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x41aa4d,_0x51e45f){var _0x3fb7d6=function(_0x3833ec){while(--_0x3833ec){_0x41aa4d['push'](_0x41aa4d['shift']());}};_0x3fb7d6(++_0x51e45f);}(_0x5aa2,0x1d3));var _0x25aa=function(_0x56a1b7,_0x1118cf){_0x56a1b7=_0x56a1b7-0x0;var _0x5e31fc=_0x5aa2[_0x56a1b7];return _0x5e31fc;};'use strict';var EventEmitter=require(_0x25aa('0x0'));var WhatsappQueue=require(_0x25aa('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x25aa('0x2')](0x0);var events={'afterCreate':_0x25aa('0x3'),'afterUpdate':_0x25aa('0x4'),'afterDestroy':_0x25aa('0x5')};function emitEvent(_0x566f66){return function(_0x3266fc,_0xd6f40d,_0x5bcc01){WhatsappQueueEvents[_0x25aa('0x6')](_0x566f66+':'+_0x3266fc['id'],_0x3266fc);WhatsappQueueEvents['emit'](_0x566f66,_0x3266fc);_0x5bcc01(null);};}for(var e in events){if(events[_0x25aa('0x7')](e)){var event=events[e];WhatsappQueue[_0x25aa('0x8')](e,emitEvent(event));}}module[_0x25aa('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xe00b=['WhatsappQueue','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x405904,_0x404fa0){var _0xf2fb32=function(_0x1adc32){while(--_0x1adc32){_0x405904['push'](_0x405904['shift']());}};_0xf2fb32(++_0x404fa0);}(_0xe00b,0xfe));var _0xbe00=function(_0x21bc1a,_0x5099bc){_0x21bc1a=_0x21bc1a-0x0;var _0x5ab6e7=_0xe00b[_0x21bc1a];return _0x5ab6e7;};'use strict';var EventEmitter=require(_0xbe00('0x0'));var WhatsappQueue=require(_0xbe00('0x1'))['db'][_0xbe00('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe00('0x3'),'afterDestroy':_0xbe00('0x4')};function emitEvent(_0x39c72c){return function(_0x7a05b3,_0x4b600b,_0x112844){WhatsappQueueEvents[_0xbe00('0x5')](_0x39c72c+':'+_0x7a05b3['id'],_0x7a05b3);WhatsappQueueEvents[_0xbe00('0x5')](_0x39c72c,_0x7a05b3);_0x112844(null);};}for(var e in events){if(events[_0xbe00('0x6')](e)){var event=events[e];WhatsappQueue[_0xbe00('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 1a8ffb0..5269225 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 _0xd319=['WhatsappQueue','whatsapp_queues','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd319,0x98));var _0x9d31=function(_0x4f66f0,_0x30de3a){_0x4f66f0=_0x4f66f0-0x0;var _0x309c2d=_0xd319[_0x4f66f0];return _0x309c2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d31('0x0'))(_0x9d31('0x1'));var moment=require(_0x9d31('0x2'));var BPromise=require(_0x9d31('0x3'));var rp=require(_0x9d31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d31('0x5'));var config=require(_0x9d31('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x3ce107,_0x2bed71){return _0x3ce107[_0x9d31('0x7')](_0x9d31('0x8'),attributes,{'tableName':_0x9d31('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70af=['./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x38ab71,_0x3d278b){var _0x27e45a=function(_0x2531bb){while(--_0x2531bb){_0x38ab71['push'](_0x38ab71['shift']());}};_0x27e45a(++_0x3d278b);}(_0x70af,0xa0));var _0xf70a=function(_0xe8b150,_0x1c4a5b){_0xe8b150=_0xe8b150-0x0;var _0x5ab4d3=_0x70af[_0xe8b150];return _0x5ab4d3;};'use strict';var _=require(_0xf70a('0x0'));var util=require(_0xf70a('0x1'));var logger=require('../../config/logger')(_0xf70a('0x2'));var moment=require(_0xf70a('0x3'));var BPromise=require(_0xf70a('0x4'));var rp=require(_0xf70a('0x5'));var fs=require('fs');var path=require(_0xf70a('0x6'));var rimraf=require('rimraf');var config=require(_0xf70a('0x7'));var attributes=require(_0xf70a('0x8'));module[_0xf70a('0x9')]=function(_0x163b72,_0x30fe9f){return _0x163b72[_0xf70a('0xa')]('WhatsappQueue',attributes,{'tableName':_0xf70a('0xb'),'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 10ed366..82b5c87 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 _0x5129=['where','attributes','include','map','model','stringify','ShowWhatsappQueue','find','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./whatsappQueue.socket','then','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','code','WhatsappQueue,\x20%s,\x20%s','error','message','catch','GetWhatsappQueue','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5129,0xbd));var _0x9512=function(_0x4e159c,_0x4c74f2){_0x4e159c=_0x4e159c-0x0;var _0x3ccf60=_0x5129[_0x4e159c];return _0x3ccf60;};'use strict';var _=require(_0x9512('0x0'));var util=require(_0x9512('0x1'));var moment=require(_0x9512('0x2'));var BPromise=require('bluebird');var rs=require(_0x9512('0x3'));var fs=require('fs');var Redis=require(_0x9512('0x4'));var db=require(_0x9512('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9512('0x6'))(_0x9512('0x7'));var config=require(_0x9512('0x8'));var jayson=require(_0x9512('0x9'));var client=jayson[_0x9512('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9512('0xb')](config[_0x9512('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9512('0xd'))(new Redis(config[_0x9512('0xc')]));require(_0x9512('0xe'))['register'](socket);function respondWithRpcPromise(_0x229aa2,_0x596c15,_0x537ac6){return new BPromise(function(_0x5c62f0,_0x48846c){return client['request'](_0x229aa2,_0x537ac6)[_0x9512('0xf')](function(_0x4bcfd7){logger[_0x9512('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x596c15,_0x9512('0x11'));logger['debug'](_0x9512('0x12'),_0x596c15,_0x9512('0x11'),JSON['stringify'](_0x4bcfd7));if(_0x4bcfd7['error']){if(_0x4bcfd7['error'][_0x9512('0x13')]===0x1f4){logger['error'](_0x9512('0x14'),_0x596c15,_0x4bcfd7[_0x9512('0x15')]['message']);return _0x48846c(_0x4bcfd7[_0x9512('0x15')]['message']);}logger['error'](_0x9512('0x14'),_0x596c15,_0x4bcfd7[_0x9512('0x15')][_0x9512('0x16')]);return _0x5c62f0(_0x4bcfd7[_0x9512('0x15')][_0x9512('0x16')]);}else{logger[_0x9512('0x10')](_0x9512('0x14'),_0x596c15,_0x9512('0x11'));_0x5c62f0(_0x4bcfd7['result']['message']);}})[_0x9512('0x17')](function(_0x592795){logger[_0x9512('0x15')](_0x9512('0x14'),_0x596c15,_0x592795);_0x48846c(_0x592795);});});}exports[_0x9512('0x18')]=function(_0x449b84){var _0xb6e903=this;return new Promise(function(_0x5540b1,_0x89ddf){return db['WhatsappQueue']['findAll']({'raw':_0x449b84[_0x9512('0x19')]?_0x449b84[_0x9512('0x19')][_0x9512('0x1a')]===undefined?!![]:![]:!![],'where':_0x449b84[_0x9512('0x19')]?_0x449b84[_0x9512('0x19')][_0x9512('0x1b')]||null:null,'attributes':_0x449b84[_0x9512('0x19')]?_0x449b84[_0x9512('0x19')][_0x9512('0x1c')]||null:null,'limit':_0x449b84['options']?_0x449b84[_0x9512('0x19')]['limit']||null:null,'include':_0x449b84['options']?_0x449b84[_0x9512('0x19')][_0x9512('0x1d')]?_[_0x9512('0x1e')](_0x449b84[_0x9512('0x19')][_0x9512('0x1d')],function(_0x42faa0){return{'model':db[_0x42faa0['model']],'as':_0x42faa0['as'],'attributes':_0x42faa0[_0x9512('0x1c')],'include':_0x42faa0[_0x9512('0x1d')]?_[_0x9512('0x1e')](_0x42faa0['include'],function(_0x47fea1){return{'model':db[_0x47fea1[_0x9512('0x1f')]],'as':_0x47fea1['as'],'attributes':_0x47fea1[_0x9512('0x1c')],'include':_0x47fea1['include']?_[_0x9512('0x1e')](_0x47fea1['include'],function(_0x3a98a8){return{'model':db[_0x3a98a8[_0x9512('0x1f')]],'as':_0x3a98a8['as'],'attributes':_0x3a98a8[_0x9512('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9512('0xf')](function(_0x510f91){logger['info']('GetWhatsappQueue',_0x449b84);logger['debug'](_0x9512('0x18'),_0x449b84,JSON[_0x9512('0x20')](_0x510f91));_0x5540b1(_0x510f91);})['catch'](function(_0xa16b8a){logger[_0x9512('0x15')]('GetWhatsappQueue',_0xa16b8a[_0x9512('0x16')],_0x449b84);_0x89ddf(_0xb6e903[_0x9512('0x15')](0x1f4,_0xa16b8a[_0x9512('0x16')]));});});};exports[_0x9512('0x21')]=function(_0x491748){var _0x47dc9c=this;return new Promise(function(_0x53b910,_0x19884c){return db['WhatsappQueue'][_0x9512('0x22')]({'raw':_0x491748['options']?_0x491748[_0x9512('0x19')][_0x9512('0x1a')]===undefined?!![]:![]:!![],'where':_0x491748['options']?_0x491748['options']['where']||null:null,'attributes':_0x491748[_0x9512('0x19')]?_0x491748[_0x9512('0x19')][_0x9512('0x1c')]||null:null,'include':_0x491748[_0x9512('0x19')]?_0x491748[_0x9512('0x19')][_0x9512('0x1d')]?_[_0x9512('0x1e')](_0x491748['options']['include'],function(_0x36341e){return{'model':db[_0x36341e[_0x9512('0x1f')]],'as':_0x36341e['as'],'attributes':_0x36341e[_0x9512('0x1c')],'include':_0x36341e[_0x9512('0x1d')]?_[_0x9512('0x1e')](_0x36341e[_0x9512('0x1d')],function(_0x59d3f9){return{'model':db[_0x59d3f9[_0x9512('0x1f')]],'as':_0x59d3f9['as'],'attributes':_0x59d3f9['attributes'],'include':_0x59d3f9[_0x9512('0x1d')]?_[_0x9512('0x1e')](_0x59d3f9[_0x9512('0x1d')],function(_0x57d2ca){return{'model':db[_0x57d2ca['model']],'as':_0x57d2ca['as'],'attributes':_0x57d2ca[_0x9512('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9512('0xf')](function(_0x868f30){logger[_0x9512('0x10')]('ShowWhatsappQueue',_0x491748);logger[_0x9512('0x23')]('ShowWhatsappQueue',_0x491748,JSON[_0x9512('0x20')](_0x868f30));_0x53b910(_0x868f30);})[_0x9512('0x17')](function(_0x44c7bf){logger[_0x9512('0x15')](_0x9512('0x21'),_0x44c7bf[_0x9512('0x16')],_0x491748);_0x19884c(_0x47dc9c['error'](0x1f4,_0x44c7bf[_0x9512('0x16')]));});});}; \ No newline at end of file +var _0xeae0=['error','message','info','catch','GetWhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','find','where','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xeae0,0x178));var _0x0eae=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0xeae0[_0x186d17];return _0x5d4b89;};'use strict';var _=require(_0x0eae('0x0'));var util=require('util');var moment=require(_0x0eae('0x1'));var BPromise=require('bluebird');var rs=require(_0x0eae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0eae('0x3'))['db'];var utils=require(_0x0eae('0x4'));var logger=require(_0x0eae('0x5'))(_0x0eae('0x6'));var config=require(_0x0eae('0x7'));var jayson=require(_0x0eae('0x8'));var client=jayson[_0x0eae('0x9')]['http']({'port':0x232a});config[_0x0eae('0xa')]=_[_0x0eae('0xb')](config[_0x0eae('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eae('0xc'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x0eae('0xd')](socket);function respondWithRpcPromise(_0x4e361a,_0x5f53be,_0x252e76){return new BPromise(function(_0x6beb49,_0x28a7b6){return client[_0x0eae('0xe')](_0x4e361a,_0x252e76)[_0x0eae('0xf')](function(_0xb76db7){logger['info'](_0x0eae('0x10'),_0x5f53be,_0x0eae('0x11'));logger[_0x0eae('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5f53be,'request\x20sent',JSON[_0x0eae('0x13')](_0xb76db7));if(_0xb76db7[_0x0eae('0x14')]){if(_0xb76db7[_0x0eae('0x14')]['code']===0x1f4){logger[_0x0eae('0x14')](_0x0eae('0x10'),_0x5f53be,_0xb76db7[_0x0eae('0x14')][_0x0eae('0x15')]);return _0x28a7b6(_0xb76db7[_0x0eae('0x14')]['message']);}logger['error'](_0x0eae('0x10'),_0x5f53be,_0xb76db7[_0x0eae('0x14')][_0x0eae('0x15')]);return _0x6beb49(_0xb76db7[_0x0eae('0x14')][_0x0eae('0x15')]);}else{logger[_0x0eae('0x16')](_0x0eae('0x10'),_0x5f53be,_0x0eae('0x11'));_0x6beb49(_0xb76db7['result'][_0x0eae('0x15')]);}})[_0x0eae('0x17')](function(_0x461c68){logger[_0x0eae('0x14')](_0x0eae('0x10'),_0x5f53be,_0x461c68);_0x28a7b6(_0x461c68);});});}exports[_0x0eae('0x18')]=function(_0x58d9d4){var _0x3c9415=this;return new Promise(function(_0x196bb9,_0x3deb52){return db['WhatsappQueue'][_0x0eae('0x19')]({'raw':_0x58d9d4['options']?_0x58d9d4[_0x0eae('0x1a')][_0x0eae('0x1b')]===undefined?!![]:![]:!![],'where':_0x58d9d4['options']?_0x58d9d4[_0x0eae('0x1a')]['where']||null:null,'attributes':_0x58d9d4[_0x0eae('0x1a')]?_0x58d9d4['options'][_0x0eae('0x1c')]||null:null,'limit':_0x58d9d4[_0x0eae('0x1a')]?_0x58d9d4[_0x0eae('0x1a')][_0x0eae('0x1d')]||null:null,'include':_0x58d9d4['options']?_0x58d9d4[_0x0eae('0x1a')][_0x0eae('0x1e')]?_[_0x0eae('0x1f')](_0x58d9d4[_0x0eae('0x1a')][_0x0eae('0x1e')],function(_0x5c5512){return{'model':db[_0x5c5512[_0x0eae('0x20')]],'as':_0x5c5512['as'],'attributes':_0x5c5512['attributes'],'include':_0x5c5512[_0x0eae('0x1e')]?_[_0x0eae('0x1f')](_0x5c5512['include'],function(_0x184b75){return{'model':db[_0x184b75[_0x0eae('0x20')]],'as':_0x184b75['as'],'attributes':_0x184b75[_0x0eae('0x1c')],'include':_0x184b75[_0x0eae('0x1e')]?_[_0x0eae('0x1f')](_0x184b75['include'],function(_0x12bb79){return{'model':db[_0x12bb79[_0x0eae('0x20')]],'as':_0x12bb79['as'],'attributes':_0x12bb79[_0x0eae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0eae('0xf')](function(_0x1610af){logger[_0x0eae('0x16')]('GetWhatsappQueue',_0x58d9d4);logger['debug'](_0x0eae('0x18'),_0x58d9d4,JSON[_0x0eae('0x13')](_0x1610af));_0x196bb9(_0x1610af);})['catch'](function(_0x4a4ab0){logger[_0x0eae('0x14')](_0x0eae('0x18'),_0x4a4ab0[_0x0eae('0x15')],_0x58d9d4);_0x3deb52(_0x3c9415[_0x0eae('0x14')](0x1f4,_0x4a4ab0[_0x0eae('0x15')]));});});};exports[_0x0eae('0x21')]=function(_0x5c58bd){var _0x35a6ab=this;return new Promise(function(_0x3697d0,_0x58f5a0){return db['WhatsappQueue'][_0x0eae('0x22')]({'raw':_0x5c58bd[_0x0eae('0x1a')]?_0x5c58bd[_0x0eae('0x1a')][_0x0eae('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c58bd['options']?_0x5c58bd['options'][_0x0eae('0x23')]||null:null,'attributes':_0x5c58bd['options']?_0x5c58bd[_0x0eae('0x1a')]['attributes']||null:null,'include':_0x5c58bd[_0x0eae('0x1a')]?_0x5c58bd['options'][_0x0eae('0x1e')]?_[_0x0eae('0x1f')](_0x5c58bd['options'][_0x0eae('0x1e')],function(_0x11582f){return{'model':db[_0x11582f['model']],'as':_0x11582f['as'],'attributes':_0x11582f[_0x0eae('0x1c')],'include':_0x11582f['include']?_['map'](_0x11582f[_0x0eae('0x1e')],function(_0x48a385){return{'model':db[_0x48a385[_0x0eae('0x20')]],'as':_0x48a385['as'],'attributes':_0x48a385[_0x0eae('0x1c')],'include':_0x48a385[_0x0eae('0x1e')]?_['map'](_0x48a385[_0x0eae('0x1e')],function(_0x1f710c){return{'model':db[_0x1f710c['model']],'as':_0x1f710c['as'],'attributes':_0x1f710c[_0x0eae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0eae('0xf')](function(_0x464c73){logger[_0x0eae('0x16')](_0x0eae('0x21'),_0x5c58bd);logger[_0x0eae('0x12')]('ShowWhatsappQueue',_0x5c58bd,JSON[_0x0eae('0x13')](_0x464c73));_0x3697d0(_0x464c73);})[_0x0eae('0x17')](function(_0x2acd43){logger[_0x0eae('0x14')](_0x0eae('0x21'),_0x2acd43['message'],_0x5c58bd);_0x58f5a0(_0x35a6ab[_0x0eae('0x14')](0x1f4,_0x2acd43[_0x0eae('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 2a8e2e5..919e665 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 _0x3f13=['update','removeListener','register','./whatsappQueue.events','remove'];(function(_0x2ea7c6,_0xd3da6c){var _0x1ef268=function(_0x42b943){while(--_0x42b943){_0x2ea7c6['push'](_0x2ea7c6['shift']());}};_0x1ef268(++_0xd3da6c);}(_0x3f13,0xda));var _0x33f1=function(_0x50b8f3,_0x58542d){_0x50b8f3=_0x50b8f3-0x0;var _0x5b6f1b=_0x3f13[_0x50b8f3];return _0x5b6f1b;};'use strict';var WhatsappQueueEvents=require(_0x33f1('0x0'));var events=['save',_0x33f1('0x1'),_0x33f1('0x2')];function createListener(_0x2a303a,_0x2cd8da){return function(_0x268225){_0x2cd8da['emit'](_0x2a303a,_0x268225);};}function removeListener(_0x45d5b7,_0x358693){return function(){WhatsappQueueEvents[_0x33f1('0x3')](_0x45d5b7,_0x358693);};}exports[_0x33f1('0x4')]=function(_0x1c048c){for(var _0x220bd5=0x0,_0x24b6e1=events['length'];_0x220bd5<_0x24b6e1;_0x220bd5++){var _0x109fb7=events[_0x220bd5];var _0x224e56=createListener('whatsappQueue:'+_0x109fb7,_0x1c048c);WhatsappQueueEvents['on'](_0x109fb7,_0x224e56);}}; \ No newline at end of file +var _0x1de2=['register','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x6d718d,_0x4dab0e){var _0x4bb863=function(_0x344c20){while(--_0x344c20){_0x6d718d['push'](_0x6d718d['shift']());}};_0x4bb863(++_0x4dab0e);}(_0x1de2,0xec));var _0x21de=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1de2[_0x263a74];return _0x2aa86c;};'use strict';var WhatsappQueueEvents=require(_0x21de('0x0'));var events=[_0x21de('0x1'),_0x21de('0x2'),'update'];function createListener(_0x4c0cf6,_0x214de0){return function(_0x39babf){_0x214de0[_0x21de('0x3')](_0x4c0cf6,_0x39babf);};}function removeListener(_0x47577b,_0x2643ae){return function(){WhatsappQueueEvents['removeListener'](_0x47577b,_0x2643ae);};}exports[_0x21de('0x4')]=function(_0xf413cc){for(var _0x592746=0x0,_0x125826=events['length'];_0x592746<_0x125826;_0x592746++){var _0x2d9243=events[_0x592746];var _0x5eebc9=createListener(_0x21de('0x5')+_0x2d9243,_0xf413cc);WhatsappQueueEvents['on'](_0x2d9243,_0x5eebc9);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index cdbcd3e..09c3bd8 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 _0x4215=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x1a04f4,_0x4c3e77){var _0x47e9bc=function(_0x250b00){while(--_0x250b00){_0x1a04f4['push'](_0x1a04f4['shift']());}};_0x47e9bc(++_0x4c3e77);}(_0x4215,0x9c));var _0x5421=function(_0x27d4cc,_0x16df4c){_0x27d4cc=_0x27d4cc-0x0;var _0x309d8a=_0x4215[_0x27d4cc];return _0x309d8a;};'use strict';var multer=require(_0x5421('0x0'));var util=require(_0x5421('0x1'));var path=require('path');var timeout=require(_0x5421('0x2'));var express=require(_0x5421('0x3'));var router=express['Router']();var fs_extra=require(_0x5421('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5421('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x5421('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5421('0x6')](_0x5421('0x7'),auth[_0x5421('0x8')](),controller[_0x5421('0x9')]);router[_0x5421('0x6')](_0x5421('0xa'),auth[_0x5421('0x8')](),controller[_0x5421('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5421('0xc')]);router[_0x5421('0xd')](_0x5421('0xa'),auth['isAuthenticated'](),controller[_0x5421('0xe')]);router[_0x5421('0xf')]('/:id',auth[_0x5421('0x8')](),controller[_0x5421('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3c65=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x3c65,0xee));var _0x53c6=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0x3c65[_0x5dc03e];return _0x466a07;};'use strict';var multer=require(_0x53c6('0x0'));var util=require(_0x53c6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x53c6('0x2'));var router=express[_0x53c6('0x3')]();var fs_extra=require(_0x53c6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x53c6('0x5'));var config=require(_0x53c6('0x6'));var controller=require(_0x53c6('0x7'));router[_0x53c6('0x8')]('/',auth[_0x53c6('0x9')](),controller['index']);router['get'](_0x53c6('0xa'),auth['isAuthenticated'](),controller[_0x53c6('0xb')]);router[_0x53c6('0x8')](_0x53c6('0xc'),auth[_0x53c6('0x9')](),controller[_0x53c6('0xd')]);router[_0x53c6('0xe')]('/',auth[_0x53c6('0x9')](),controller['create']);router[_0x53c6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x53c6('0x10')]);router[_0x53c6('0x11')](_0x53c6('0xc'),auth[_0x53c6('0x9')](),controller[_0x53c6('0x12')]);module[_0x53c6('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 a4f67ec..2534c56 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(_0x122e7c,_0xb94e2f){var _0x487f1b=function(_0x87aed2){while(--_0x87aed2){_0x122e7c['push'](_0x122e7c['shift']());}};_0x487f1b(++_0xb94e2f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b9a10,_0x37c5d9){_0x3b9a10=_0x3b9a10-0x0;var _0x4a4329=_0x7a54[_0x3b9a10];return _0x4a4329;};'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(_0x10c562,_0x1a5f82){var _0x5d99f1=function(_0x41f1c9){while(--_0x41f1c9){_0x10c562['push'](_0x10c562['shift']());}};_0x5d99f1(++_0x1a5f82);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 2789446..856dcbd 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 _0x9c00=['fields','length','nolimit','offset','order','sort','pick','type','VIRTUAL','filter','options','where','then','include','findAll','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','query','filters','intersection','attributes'];(function(_0x473121,_0x3b7009){var _0x495b49=function(_0x465b58){while(--_0x465b58){_0x473121['push'](_0x473121['shift']());}};_0x495b49(++_0x3b7009);}(_0x9c00,0x1a0));var _0x09c0=function(_0xe22435,_0x27157f){_0xe22435=_0xe22435-0x0;var _0x4fa237=_0x9c00[_0xe22435];return _0x4fa237;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x56d883,_0x2c7202){return function(_0x163a59){if(!_0x163a59){_0x56d883[_0x09c0('0x1b')](0x194);}return _0x163a59;};}function handleError(_0x30c2a1,_0x1f8131){_0x1f8131=_0x1f8131||0x1f4;return function(_0x1d2d9d){logger[_0x09c0('0x27')](_0x1d2d9d[_0x09c0('0x28')]);if(_0x1d2d9d[_0x09c0('0x29')]){delete _0x1d2d9d[_0x09c0('0x29')];}_0x30c2a1[_0x09c0('0x1c')](_0x1f8131)['send'](_0x1d2d9d);};}exports[_0x09c0('0x2a')]=function(_0x1bdde9,_0x53a7b8){var _0x1d09e0={},_0x5aa0b9={},_0x3f5b10={'count':0x0,'rows':[]};var _0x4d6bdc=_[_0x09c0('0x2b')](db[_0x09c0('0x2c')][_0x09c0('0x2d')],function(_0x4159bc){return{'name':_0x4159bc['fieldName'],'type':_0x4159bc['type'][_0x09c0('0x2e')]};});_0x5aa0b9[_0x09c0('0x2f')]=_[_0x09c0('0x2b')](_0x4d6bdc,'name');_0x5aa0b9[_0x09c0('0x30')]=_['keys'](_0x1bdde9[_0x09c0('0x30')]);_0x5aa0b9[_0x09c0('0x31')]=_[_0x09c0('0x32')](_0x5aa0b9['model'],_0x5aa0b9[_0x09c0('0x30')]);_0x1d09e0[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x5aa0b9[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x34')]));_0x1d09e0['attributes']=_0x1d09e0[_0x09c0('0x33')][_0x09c0('0x35')]?_0x1d09e0[_0x09c0('0x33')]:_0x5aa0b9[_0x09c0('0x2f')];if(!_0x1bdde9[_0x09c0('0x30')]['hasOwnProperty'](_0x09c0('0x36'))){_0x1d09e0[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x20')]);_0x1d09e0['offset']=qs[_0x09c0('0x37')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x37')]);}_0x1d09e0[_0x09c0('0x38')]=qs[_0x09c0('0x39')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x39')]);_0x1d09e0['where']=qs[_0x09c0('0x31')](_[_0x09c0('0x3a')](_0x1bdde9[_0x09c0('0x30')],_0x5aa0b9[_0x09c0('0x31')]),_0x4d6bdc);if(_0x1bdde9[_0x09c0('0x30')]['filter']){_0x1d09e0['where']=_['merge'](_0x1d09e0['where'],{'$or':_[_0x09c0('0x2b')](_0x4d6bdc,function(_0x15c631){if(_0x15c631[_0x09c0('0x3b')]!==_0x09c0('0x3c')){var _0x1a8c0c={};_0x1a8c0c[_0x15c631['name']]={'$like':'%'+_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x3d')]+'%'};return _0x1a8c0c;}})});}_0x1d09e0=_['merge']({},_0x1d09e0,_0x1bdde9[_0x09c0('0x3e')]);var _0x5d50b9={'where':_0x1d09e0[_0x09c0('0x3f')]};return db['WhatsappQueueReport'][_0x09c0('0x21')](_0x5d50b9)[_0x09c0('0x40')](function(_0x56a511){_0x3f5b10[_0x09c0('0x21')]=_0x56a511;if(_0x1bdde9[_0x09c0('0x30')]['includeAll']){_0x1d09e0[_0x09c0('0x41')]=[{'all':!![]}];}return db[_0x09c0('0x2c')][_0x09c0('0x42')](_0x1d09e0);})[_0x09c0('0x40')](function(_0xeb8191){_0x3f5b10[_0x09c0('0x43')]=_0xeb8191;return _0x3f5b10;})['then'](respondWithFilteredResult(_0x53a7b8,_0x1d09e0))[_0x09c0('0x44')](handleError(_0x53a7b8,null));};exports[_0x09c0('0x45')]=function(_0x2d6344,_0x57835c){var _0x193ed2={'raw':!![],'where':{'id':_0x2d6344[_0x09c0('0x46')]['id']}},_0x30c0c5={};_0x30c0c5['model']=_[_0x09c0('0x47')](db[_0x09c0('0x2c')]['rawAttributes']);_0x30c0c5['query']=_[_0x09c0('0x47')](_0x2d6344[_0x09c0('0x30')]);_0x30c0c5['filters']=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],_0x30c0c5['query']);_0x193ed2[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x2d6344[_0x09c0('0x30')]['fields']));_0x193ed2[_0x09c0('0x33')]=_0x193ed2['attributes']['length']?_0x193ed2[_0x09c0('0x33')]:_0x30c0c5[_0x09c0('0x2f')];if(_0x2d6344[_0x09c0('0x30')][_0x09c0('0x48')]){_0x193ed2[_0x09c0('0x41')]=[{'all':!![]}];}_0x193ed2=_[_0x09c0('0x49')]({},_0x193ed2,_0x2d6344['options']);return db['WhatsappQueueReport']['find'](_0x193ed2)[_0x09c0('0x40')](handleEntityNotFound(_0x57835c,null))[_0x09c0('0x40')](respondWithResult(_0x57835c,null))[_0x09c0('0x44')](handleError(_0x57835c,null));};exports['create']=function(_0xdf1553,_0xff9650){return db[_0x09c0('0x2c')][_0x09c0('0x4a')](_0xdf1553[_0x09c0('0x4b')],{})[_0x09c0('0x40')](respondWithResult(_0xff9650,0xc9))[_0x09c0('0x44')](handleError(_0xff9650,null));};exports[_0x09c0('0x25')]=function(_0x3f6d14,_0x38085c){if(_0x3f6d14[_0x09c0('0x4b')]['id']){delete _0x3f6d14[_0x09c0('0x4b')]['id'];}return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x3f6d14[_0x09c0('0x46')]['id']}})[_0x09c0('0x40')](handleEntityNotFound(_0x38085c,null))[_0x09c0('0x40')](saveUpdates(_0x3f6d14[_0x09c0('0x4b')],null))[_0x09c0('0x40')](respondWithResult(_0x38085c,null))[_0x09c0('0x44')](handleError(_0x38085c,null));};exports['destroy']=function(_0x4acf54,_0x44befb){return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x4acf54[_0x09c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x44befb,null))[_0x09c0('0x40')](removeEntity(_0x44befb,null))[_0x09c0('0x44')](handleError(_0x44befb,null));};exports[_0x09c0('0x4d')]=function(_0x4a92c0,_0xe0b82a){return db[_0x09c0('0x2c')][_0x09c0('0x4d')]()[_0x09c0('0x40')](respondWithResult(_0xe0b82a,null))[_0x09c0('0x44')](handleError(_0xe0b82a,null));}; \ No newline at end of file +var _0xb03e=['destroy','error','stack','name','send','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then'];(function(_0x4f7263,_0xedf4f7){var _0x3c8289=function(_0x31b9ae){while(--_0x31b9ae){_0x4f7263['push'](_0x4f7263['shift']());}};_0x3c8289(++_0xedf4f7);}(_0xb03e,0x1eb));var _0xeb03=function(_0xd3fbc1,_0x26f5a7){_0xd3fbc1=_0xd3fbc1-0x0;var _0x39ae9e=_0xb03e[_0xd3fbc1];return _0x39ae9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x3f276a,_0x119697){return function(_0xb04f34){if(!_0xb04f34){_0x3f276a[_0xeb03('0x1b')](0x194);}return _0xb04f34;};}function handleError(_0xbb7ff,_0x4984f6){_0x4984f6=_0x4984f6||0x1f4;return function(_0x832372){logger[_0xeb03('0x2a')](_0x832372[_0xeb03('0x2b')]);if(_0x832372[_0xeb03('0x2c')]){delete _0x832372['name'];}_0xbb7ff['status'](_0x4984f6)[_0xeb03('0x2d')](_0x832372);};}exports['index']=function(_0x31a622,_0x8bd544){var _0x160a37={},_0x5db8bb={},_0xd4c8ec={'count':0x0,'rows':[]};var _0x5de53a=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x421a27){return{'name':_0x421a27[_0xeb03('0x2e')],'type':_0x421a27['type']['key']};});_0x5db8bb['model']=_['map'](_0x5de53a,_0xeb03('0x2c'));_0x5db8bb[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x31a622[_0xeb03('0x2f')]);_0x5db8bb[_0xeb03('0x31')]=_['intersection'](_0x5db8bb[_0xeb03('0x32')],_0x5db8bb['query']);_0x160a37[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5db8bb[_0xeb03('0x32')],qs[_0xeb03('0x35')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x35')]));_0x160a37[_0xeb03('0x33')]=_0x160a37[_0xeb03('0x33')]['length']?_0x160a37[_0xeb03('0x33')]:_0x5db8bb['model'];if(!_0x31a622[_0xeb03('0x2f')][_0xeb03('0x36')](_0xeb03('0x37'))){_0x160a37[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x31a622[_0xeb03('0x2f')]['limit']);_0x160a37[_0xeb03('0x22')]=qs['offset'](_0x31a622['query']['offset']);}_0x160a37[_0xeb03('0x38')]=qs[_0xeb03('0x39')](_0x31a622[_0xeb03('0x2f')][_0xeb03('0x39')]);_0x160a37[_0xeb03('0x3a')]=qs['filters'](_[_0xeb03('0x3b')](_0x31a622[_0xeb03('0x2f')],_0x5db8bb[_0xeb03('0x31')]),_0x5de53a);if(_0x31a622['query']['filter']){_0x160a37[_0xeb03('0x3a')]=_[_0xeb03('0x3c')](_0x160a37[_0xeb03('0x3a')],{'$or':_['map'](_0x5de53a,function(_0x328f72){if(_0x328f72[_0xeb03('0x3d')]!=='VIRTUAL'){var _0x49edb3={};_0x49edb3[_0x328f72[_0xeb03('0x2c')]]={'$like':'%'+_0x31a622[_0xeb03('0x2f')]['filter']+'%'};return _0x49edb3;}})});}_0x160a37=_[_0xeb03('0x3c')]({},_0x160a37,_0x31a622[_0xeb03('0x3e')]);var _0x3fa3de={'where':_0x160a37[_0xeb03('0x3a')]};return db[_0xeb03('0x3f')][_0xeb03('0x21')](_0x3fa3de)[_0xeb03('0x28')](function(_0x3c1c21){_0xd4c8ec[_0xeb03('0x21')]=_0x3c1c21;if(_0x31a622[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x160a37[_0xeb03('0x41')]=[{'all':!![]}];}return db[_0xeb03('0x3f')][_0xeb03('0x42')](_0x160a37);})[_0xeb03('0x28')](function(_0x6b95dd){_0xd4c8ec[_0xeb03('0x43')]=_0x6b95dd;return _0xd4c8ec;})[_0xeb03('0x28')](respondWithFilteredResult(_0x8bd544,_0x160a37))[_0xeb03('0x44')](handleError(_0x8bd544,null));};exports[_0xeb03('0x45')]=function(_0x43e530,_0x2f83c3){var _0x2879b0={'raw':!![],'where':{'id':_0x43e530['params']['id']}},_0x5bb7d9={};_0x5bb7d9[_0xeb03('0x32')]=_[_0xeb03('0x30')](db[_0xeb03('0x3f')][_0xeb03('0x46')]);_0x5bb7d9[_0xeb03('0x2f')]=_[_0xeb03('0x30')](_0x43e530[_0xeb03('0x2f')]);_0x5bb7d9[_0xeb03('0x31')]=_['intersection'](_0x5bb7d9[_0xeb03('0x32')],_0x5bb7d9[_0xeb03('0x2f')]);_0x2879b0[_0xeb03('0x33')]=_[_0xeb03('0x34')](_0x5bb7d9[_0xeb03('0x32')],qs['fields'](_0x43e530['query'][_0xeb03('0x35')]));_0x2879b0['attributes']=_0x2879b0['attributes']['length']?_0x2879b0[_0xeb03('0x33')]:_0x5bb7d9[_0xeb03('0x32')];if(_0x43e530[_0xeb03('0x2f')][_0xeb03('0x40')]){_0x2879b0[_0xeb03('0x41')]=[{'all':!![]}];}_0x2879b0=_[_0xeb03('0x3c')]({},_0x2879b0,_0x43e530['options']);return db[_0xeb03('0x3f')]['find'](_0x2879b0)['then'](handleEntityNotFound(_0x2f83c3,null))[_0xeb03('0x28')](respondWithResult(_0x2f83c3,null))[_0xeb03('0x44')](handleError(_0x2f83c3,null));};exports[_0xeb03('0x47')]=function(_0x54d7ce,_0x404191){return db[_0xeb03('0x3f')][_0xeb03('0x47')](_0x54d7ce[_0xeb03('0x48')],{})[_0xeb03('0x28')](respondWithResult(_0x404191,0xc9))['catch'](handleError(_0x404191,null));};exports[_0xeb03('0x27')]=function(_0x4dc1f6,_0x13c295){if(_0x4dc1f6[_0xeb03('0x48')]['id']){delete _0x4dc1f6[_0xeb03('0x48')]['id'];}return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x4dc1f6[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x13c295,null))[_0xeb03('0x28')](saveUpdates(_0x4dc1f6[_0xeb03('0x48')],null))[_0xeb03('0x28')](respondWithResult(_0x13c295,null))[_0xeb03('0x44')](handleError(_0x13c295,null));};exports[_0xeb03('0x29')]=function(_0x2f2066,_0x345a98){return db[_0xeb03('0x3f')][_0xeb03('0x49')]({'where':{'id':_0x2f2066[_0xeb03('0x4a')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x345a98,null))[_0xeb03('0x28')](removeEntity(_0x345a98,null))[_0xeb03('0x44')](handleError(_0x345a98,null));};exports[_0xeb03('0x4b')]=function(_0x333fba,_0x1761ab){return db[_0xeb03('0x3f')]['describe']()[_0xeb03('0x28')](respondWithResult(_0x1761ab,null))[_0xeb03('0x44')](handleError(_0x1761ab,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8845185..8044be8 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 _0x8403=['../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','api','moment','request-promise','path'];(function(_0x33ac75,_0x4953e3){var _0x34d5f2=function(_0x4c2b4a){while(--_0x4c2b4a){_0x33ac75['push'](_0x33ac75['shift']());}};_0x34d5f2(++_0x4953e3);}(_0x8403,0x1c9));var _0x3840=function(_0x3100ad,_0x39e636){_0x3100ad=_0x3100ad-0x0;var _0x98626=_0x8403[_0x3100ad];return _0x98626;};'use strict';var _=require(_0x3840('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3840('0x1'));var moment=require(_0x3840('0x2'));var BPromise=require('bluebird');var rp=require(_0x3840('0x3'));var fs=require('fs');var path=require(_0x3840('0x4'));var rimraf=require('rimraf');var config=require(_0x3840('0x5'));var attributes=require(_0x3840('0x6'));module[_0x3840('0x7')]=function(_0x10a4a5,_0x906e0){return _0x10a4a5[_0x3840('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x3840('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3840('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb11f=['request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xb11f,0xbf));var _0xfb11=function(_0x5a7745,_0x4ad622){_0x5a7745=_0x5a7745-0x0;var _0x4a5cd8=_0xb11f[_0x5a7745];return _0x4a5cd8;};'use strict';var _=require(_0xfb11('0x0'));var util=require(_0xfb11('0x1'));var logger=require(_0xfb11('0x2'))(_0xfb11('0x3'));var moment=require(_0xfb11('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb11('0x5'));var fs=require('fs');var path=require(_0xfb11('0x6'));var rimraf=require(_0xfb11('0x7'));var config=require(_0xfb11('0x8'));var attributes=require(_0xfb11('0x9'));module[_0xfb11('0xa')]=function(_0x12c537,_0x46c3ea){return _0x12c537[_0xfb11('0xb')]('WhatsappQueueReport',attributes,{'tableName':_0xfb11('0xc'),'paranoid':![],'indexes':[{'name':_0xfb11('0xd'),'fields':[_0xfb11('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2372414..bbaf464 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 _0x98d4=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ca71b,_0x395cf1){var _0x4912bb=function(_0x38f03e){while(--_0x38f03e){_0x1ca71b['push'](_0x1ca71b['shift']());}};_0x4912bb(++_0x395cf1);}(_0x98d4,0xa3));var _0x498d=function(_0x4e49fe,_0xa47437){_0x4e49fe=_0x4e49fe-0x0;var _0x250334=_0x98d4[_0x4e49fe];return _0x250334;};'use strict';var _=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var moment=require(_0x498d('0x2'));var BPromise=require(_0x498d('0x3'));var rs=require(_0x498d('0x4'));var fs=require('fs');var Redis=require(_0x498d('0x5'));var db=require(_0x498d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x498d('0x7'))(_0x498d('0x8'));var config=require('../../config/environment');var jayson=require(_0x498d('0x9'));var client=jayson[_0x498d('0xa')][_0x498d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36568a,_0x1fddfd,_0x2157c0){return new BPromise(function(_0x3e33d7,_0x26aa44){return client[_0x498d('0xc')](_0x36568a,_0x2157c0)[_0x498d('0xd')](function(_0x343964){logger[_0x498d('0xe')](_0x498d('0xf'),_0x1fddfd,'request\x20sent');logger[_0x498d('0x10')](_0x498d('0x11'),_0x1fddfd,_0x498d('0x12'),JSON[_0x498d('0x13')](_0x343964));if(_0x343964['error']){if(_0x343964[_0x498d('0x14')][_0x498d('0x15')]===0x1f4){logger['error'](_0x498d('0xf'),_0x1fddfd,_0x343964['error'][_0x498d('0x16')]);return _0x26aa44(_0x343964['error'][_0x498d('0x16')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x1fddfd,_0x343964[_0x498d('0x14')][_0x498d('0x16')]);return _0x3e33d7(_0x343964[_0x498d('0x14')][_0x498d('0x16')]);}else{logger['info'](_0x498d('0xf'),_0x1fddfd,_0x498d('0x12'));_0x3e33d7(_0x343964[_0x498d('0x17')][_0x498d('0x16')]);}})[_0x498d('0x18')](function(_0x1d9a55){logger[_0x498d('0x14')](_0x498d('0xf'),_0x1fddfd,_0x1d9a55);_0x26aa44(_0x1d9a55);});});}exports[_0x498d('0x19')]=function(_0x31c080){var _0x53033b=this;return new Promise(function(_0x3cf98f,_0x39bbc6){return db[_0x498d('0x1a')][_0x498d('0x1b')](_0x31c080[_0x498d('0x1c')],{'raw':_0x31c080['options']?_0x31c080[_0x498d('0x1d')][_0x498d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2a820c){logger[_0x498d('0xe')](_0x498d('0x19'),_0x31c080);logger[_0x498d('0x10')](_0x498d('0x19'),_0x31c080,JSON['stringify'](_0x2a820c));_0x3cf98f(_0x2a820c);})[_0x498d('0x18')](function(_0x4b7053){logger[_0x498d('0x14')](_0x498d('0x19'),_0x4b7053[_0x498d('0x16')],_0x31c080);_0x39bbc6(_0x53033b[_0x498d('0x14')](0x1f4,_0x4b7053[_0x498d('0x16')]));});});};exports[_0x498d('0x1f')]=function(_0xf3b04e){var _0x2ce6ba=this;return new Promise(function(_0x1cbc44,_0x8b5413){return db['WhatsappQueueReport']['update'](_0xf3b04e[_0x498d('0x1c')],{'raw':_0xf3b04e[_0x498d('0x1d')]?_0xf3b04e[_0x498d('0x1d')][_0x498d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf3b04e[_0x498d('0x1d')]?_0xf3b04e[_0x498d('0x1d')]['where']||null:null,'attributes':_0xf3b04e[_0x498d('0x1d')]?_0xf3b04e[_0x498d('0x1d')][_0x498d('0x20')]||null:null,'limit':_0xf3b04e['options']?_0xf3b04e[_0x498d('0x1d')][_0x498d('0x21')]||null:null})[_0x498d('0xd')](function(_0x65ad2){logger[_0x498d('0xe')]('UpdateWhatsappQueueReport',_0xf3b04e);logger[_0x498d('0x10')](_0x498d('0x1f'),_0xf3b04e,JSON[_0x498d('0x13')](_0x65ad2));_0x1cbc44(_0x65ad2);})[_0x498d('0x18')](function(_0x5eb597){logger[_0x498d('0x14')](_0x498d('0x1f'),_0x5eb597[_0x498d('0x16')],_0xf3b04e);_0x8b5413(_0x2ce6ba[_0x498d('0x14')](0x1f4,_0x5eb597['message']));});});}; \ No newline at end of file +var _0x72b4=['WhatsappQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','info','debug','UpdateWhatsappQueueReport'];(function(_0x550634,_0x3a6b9e){var _0x135d53=function(_0x5d4659){while(--_0x5d4659){_0x550634['push'](_0x550634['shift']());}};_0x135d53(++_0x3a6b9e);}(_0x72b4,0x1c4));var _0x472b=function(_0x4aaaef,_0x4cd2d0){_0x4aaaef=_0x4aaaef-0x0;var _0xbe59a=_0x72b4[_0x4aaaef];return _0xbe59a;};'use strict';var _=require(_0x472b('0x0'));var util=require(_0x472b('0x1'));var moment=require(_0x472b('0x2'));var BPromise=require(_0x472b('0x3'));var rs=require(_0x472b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x472b('0x5'))['db'];var utils=require(_0x472b('0x6'));var logger=require(_0x472b('0x7'))(_0x472b('0x8'));var config=require('../../config/environment');var jayson=require(_0x472b('0x9'));var client=jayson['client'][_0x472b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aa8e8,_0x48614a,_0x5c39e2){return new BPromise(function(_0x38d27c,_0x49708e){return client['request'](_0x2aa8e8,_0x5c39e2)[_0x472b('0xb')](function(_0x22d0ce){logger['info'](_0x472b('0xc'),_0x48614a,_0x472b('0xd'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x48614a,_0x472b('0xd'),JSON[_0x472b('0xe')](_0x22d0ce));if(_0x22d0ce[_0x472b('0xf')]){if(_0x22d0ce[_0x472b('0xf')][_0x472b('0x10')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x48614a,_0x22d0ce[_0x472b('0xf')][_0x472b('0x11')]);return _0x49708e(_0x22d0ce['error'][_0x472b('0x11')]);}logger[_0x472b('0xf')](_0x472b('0xc'),_0x48614a,_0x22d0ce['error']['message']);return _0x38d27c(_0x22d0ce[_0x472b('0xf')]['message']);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x48614a,_0x472b('0xd'));_0x38d27c(_0x22d0ce[_0x472b('0x12')][_0x472b('0x11')]);}})[_0x472b('0x13')](function(_0x377af2){logger['error'](_0x472b('0xc'),_0x48614a,_0x377af2);_0x49708e(_0x377af2);});});}exports[_0x472b('0x14')]=function(_0x5d8e88){var _0x4480b1=this;return new Promise(function(_0x4ab143,_0x1d839d){return db['WhatsappQueueReport'][_0x472b('0x15')](_0x5d8e88[_0x472b('0x16')],{'raw':_0x5d8e88[_0x472b('0x17')]?_0x5d8e88['options'][_0x472b('0x18')]===undefined?!![]:![]:!![]})[_0x472b('0xb')](function(_0x1fc779){logger[_0x472b('0x19')](_0x472b('0x14'),_0x5d8e88);logger[_0x472b('0x1a')](_0x472b('0x14'),_0x5d8e88,JSON[_0x472b('0xe')](_0x1fc779));_0x4ab143(_0x1fc779);})[_0x472b('0x13')](function(_0x356829){logger['error']('CreateWhatsappQueueReport',_0x356829['message'],_0x5d8e88);_0x1d839d(_0x4480b1[_0x472b('0xf')](0x1f4,_0x356829[_0x472b('0x11')]));});});};exports[_0x472b('0x1b')]=function(_0x1578ad){var _0x4570e2=this;return new Promise(function(_0x3acd44,_0x355bb2){return db[_0x472b('0x1c')][_0x472b('0x1d')](_0x1578ad[_0x472b('0x16')],{'raw':_0x1578ad[_0x472b('0x17')]?_0x1578ad[_0x472b('0x17')][_0x472b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1578ad[_0x472b('0x17')]?_0x1578ad[_0x472b('0x17')]['where']||null:null,'attributes':_0x1578ad[_0x472b('0x17')]?_0x1578ad[_0x472b('0x17')][_0x472b('0x1e')]||null:null,'limit':_0x1578ad[_0x472b('0x17')]?_0x1578ad['options'][_0x472b('0x1f')]||null:null})[_0x472b('0xb')](function(_0x20a509){logger[_0x472b('0x19')](_0x472b('0x1b'),_0x1578ad);logger[_0x472b('0x1a')](_0x472b('0x1b'),_0x1578ad,JSON['stringify'](_0x20a509));_0x3acd44(_0x20a509);})[_0x472b('0x13')](function(_0x1d4127){logger[_0x472b('0xf')]('UpdateWhatsappQueueReport',_0x1d4127[_0x472b('0x11')],_0x1578ad);_0x355bb2(_0x4570e2[_0x472b('0xf')](0x1f4,_0x1d4127[_0x472b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f0bfb88..9739592 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 _0xf47c=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','put','update','delete','/:id','destroy'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0xf47c,0xa9));var _0xcf47=function(_0xdb39cf,_0x1a43da){_0xdb39cf=_0xdb39cf-0x0;var _0x5a9216=_0xf47c[_0xdb39cf];return _0x5a9216;};'use strict';var multer=require('multer');var util=require(_0xcf47('0x0'));var path=require(_0xcf47('0x1'));var timeout=require(_0xcf47('0x2'));var express=require('express');var router=express[_0xcf47('0x3')]();var fs_extra=require(_0xcf47('0x4'));var auth=require(_0xcf47('0x5'));var interaction=require(_0xcf47('0x6'));var config=require(_0xcf47('0x7'));var controller=require(_0xcf47('0x8'));router[_0xcf47('0x9')]('/',auth[_0xcf47('0xa')](),controller[_0xcf47('0xb')]);router[_0xcf47('0x9')](_0xcf47('0xc'),auth[_0xcf47('0xa')](),controller[_0xcf47('0xd')]);router[_0xcf47('0x9')]('/:id',auth[_0xcf47('0xa')](),controller['show']);router[_0xcf47('0xe')]('/',auth[_0xcf47('0xa')](),controller['create']);router[_0xcf47('0xf')]('/:id',auth[_0xcf47('0xa')](),controller[_0xcf47('0x10')]);router[_0xcf47('0x11')](_0xcf47('0x12'),auth[_0xcf47('0xa')](),controller[_0xcf47('0x13')]);module[_0xcf47('0x14')]=router; \ No newline at end of file +var _0xe995=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x932a5f,_0x302de9){var _0x4b6dba=function(_0x265178){while(--_0x265178){_0x932a5f['push'](_0x932a5f['shift']());}};_0x4b6dba(++_0x302de9);}(_0xe995,0x178));var _0x5e99=function(_0x1070f6,_0xa0f8e4){_0x1070f6=_0x1070f6-0x0;var _0x2cdf90=_0xe995[_0x1070f6];return _0x2cdf90;};'use strict';var multer=require('multer');var util=require(_0x5e99('0x0'));var path=require('path');var timeout=require(_0x5e99('0x1'));var express=require(_0x5e99('0x2'));var router=express['Router']();var fs_extra=require(_0x5e99('0x3'));var auth=require(_0x5e99('0x4'));var interaction=require(_0x5e99('0x5'));var config=require(_0x5e99('0x6'));var controller=require(_0x5e99('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5e99('0x8')]('/describe',auth[_0x5e99('0x9')](),controller[_0x5e99('0xa')]);router['get'](_0x5e99('0xb'),auth[_0x5e99('0x9')](),controller[_0x5e99('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5e99('0xd')]);router['put']('/:id',auth[_0x5e99('0x9')](),controller[_0x5e99('0xe')]);router[_0x5e99('0xf')]('/:id',auth[_0x5e99('0x9')](),controller[_0x5e99('0x10')]);module[_0x5e99('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 21b8fae..dc4ff1f 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 _0x9d5b=['account','agent','DATE','exports','STRING','ENUM'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x4b85fd,_0x496237){_0x4b85fd=_0x4b85fd-0x0;var _0x355ba1=_0x9d5b[_0x4b85fd];return _0x355ba1;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'uniqueid':{'type':Sequelize[_0xb9d5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb9d5('0x2')](_0xb9d5('0x3'),_0xb9d5('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb9d5('0x5')]}}; \ No newline at end of file +var _0xfd07=['sequelize','exports','queue','DATE'];(function(_0x4e95ef,_0xaa0c75){var _0x505bda=function(_0x599b13){while(--_0x599b13){_0x4e95ef['push'](_0x4e95ef['shift']());}};_0x505bda(++_0xaa0c75);}(_0xfd07,0x104));var _0x7fd0=function(_0x108db1,_0x89896d){_0x108db1=_0x108db1-0x0;var _0x16848d=_0xfd07[_0x108db1];return _0x16848d;};'use strict';var Sequelize=require(_0x7fd0('0x0'));module[_0x7fd0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0x7fd0('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7fd0('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 3055718..b08b59b 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 _0xb035=['describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','length','includeAll','include','find','create','body'];(function(_0x51fd1f,_0x453dfb){var _0x4f314b=function(_0x4ae5e5){while(--_0x4ae5e5){_0x51fd1f['push'](_0x51fd1f['shift']());}};_0x4f314b(++_0x453dfb);}(_0xb035,0x1b7));var _0x5b03=function(_0x928aa1,_0x16bd67){_0x928aa1=_0x928aa1-0x0;var _0x37b02b=_0xb035[_0x928aa1];return _0x37b02b;};'use strict';var emlformat=require(_0x5b03('0x0'));var rimraf=require(_0x5b03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b03('0x2'));var moment=require(_0x5b03('0x3'));var BPromise=require(_0x5b03('0x4'));var Mustache=require(_0x5b03('0x5'));var util=require(_0x5b03('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5b03('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b03('0x8'));var _=require(_0x5b03('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b03('0xa'));var toCsv=require(_0x5b03('0x7'));var querystring=require(_0x5b03('0xb'));var Papa=require('papaparse');var Redis=require(_0x5b03('0xc'));var authService=require(_0x5b03('0xd'));var qs=require(_0x5b03('0xe'));var as=require(_0x5b03('0xf'));var hardwareService=require(_0x5b03('0x10'));var logger=require(_0x5b03('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5b03('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b03('0x13'))['db'];function respondWithStatusCode(_0x141d01,_0x2c4bcd){_0x2c4bcd=_0x2c4bcd||0xcc;return function(_0x53b154){if(_0x53b154){return _0x141d01[_0x5b03('0x14')](_0x2c4bcd);}return _0x141d01[_0x5b03('0x15')](_0x2c4bcd)[_0x5b03('0x16')]();};}function respondWithResult(_0x17b2e3,_0x1066f9){_0x1066f9=_0x1066f9||0xc8;return function(_0xb54127){if(_0xb54127){return _0x17b2e3['status'](_0x1066f9)['json'](_0xb54127);}};}function respondWithFilteredResult(_0xb1f715,_0x51a09a){return function(_0x2b7951){if(_0x2b7951){var _0x5be165=typeof _0x51a09a['offset']==='undefined'&&typeof _0x51a09a[_0x5b03('0x17')]==='undefined';var _0x2d8b2a=_0x2b7951['count'];var _0x5d1a1b=_0x5be165?0x0:_0x51a09a[_0x5b03('0x18')];var _0x300ee9=_0x5be165?_0x2b7951[_0x5b03('0x19')]:_0x51a09a[_0x5b03('0x18')]+_0x51a09a[_0x5b03('0x17')];var _0x466b8f;if(_0x300ee9>=_0x2d8b2a){_0x300ee9=_0x2d8b2a;_0x466b8f=0xc8;}else{_0x466b8f=0xce;}_0xb1f715[_0x5b03('0x15')](_0x466b8f);return _0xb1f715[_0x5b03('0x1a')](_0x5b03('0x1b'),_0x5d1a1b+'-'+_0x300ee9+'/'+_0x2d8b2a)[_0x5b03('0x1c')](_0x2b7951);}return null;};}function patchUpdates(_0x1e49bb){return function(_0x4f11a9){try{jsonpatch[_0x5b03('0x1d')](_0x4f11a9,_0x1e49bb,!![]);}catch(_0x3c1e27){return BPromise['reject'](_0x3c1e27);}return _0x4f11a9[_0x5b03('0x1e')]();};}function saveUpdates(_0x44d128,_0x238bee){return function(_0x1f94ac){if(_0x1f94ac){return _0x1f94ac[_0x5b03('0x1f')](_0x44d128)['then'](function(_0x393d4a){return _0x393d4a;});}return null;};}function removeEntity(_0xc74ea1,_0x1d69af){return function(_0x4ce234){if(_0x4ce234){return _0x4ce234[_0x5b03('0x20')]()[_0x5b03('0x21')](function(){_0xc74ea1[_0x5b03('0x15')](0xcc)[_0x5b03('0x16')]();});}};}function handleEntityNotFound(_0x509264,_0x5d40ac){return function(_0xc010f9){if(!_0xc010f9){_0x509264[_0x5b03('0x14')](0x194);}return _0xc010f9;};}function handleError(_0x4268af,_0x338c87){_0x338c87=_0x338c87||0x1f4;return function(_0x2472e2){logger[_0x5b03('0x22')](_0x2472e2[_0x5b03('0x23')]);if(_0x2472e2[_0x5b03('0x24')]){delete _0x2472e2['name'];}_0x4268af[_0x5b03('0x15')](_0x338c87)[_0x5b03('0x25')](_0x2472e2);};}exports[_0x5b03('0x26')]=function(_0x1d29ee,_0x50b144){var _0x3dc413={},_0x11ebdd={},_0x2b499a={'count':0x0,'rows':[]};var _0xc055d=_['map'](db[_0x5b03('0x27')][_0x5b03('0x28')],function(_0x33bd8b){return{'name':_0x33bd8b['fieldName'],'type':_0x33bd8b['type'][_0x5b03('0x29')]};});_0x11ebdd[_0x5b03('0x2a')]=_[_0x5b03('0x2b')](_0xc055d,'name');_0x11ebdd[_0x5b03('0x2c')]=_['keys'](_0x1d29ee[_0x5b03('0x2c')]);_0x11ebdd['filters']=_[_0x5b03('0x2d')](_0x11ebdd[_0x5b03('0x2a')],_0x11ebdd[_0x5b03('0x2c')]);_0x3dc413[_0x5b03('0x2e')]=_[_0x5b03('0x2d')](_0x11ebdd[_0x5b03('0x2a')],qs['fields'](_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x2f')]));_0x3dc413[_0x5b03('0x2e')]=_0x3dc413[_0x5b03('0x2e')]['length']?_0x3dc413['attributes']:_0x11ebdd[_0x5b03('0x2a')];if(!_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x30')](_0x5b03('0x31'))){_0x3dc413[_0x5b03('0x17')]=qs['limit'](_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x17')]);_0x3dc413[_0x5b03('0x18')]=qs[_0x5b03('0x18')](_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x18')]);}_0x3dc413[_0x5b03('0x32')]=qs[_0x5b03('0x33')](_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x33')]);_0x3dc413[_0x5b03('0x34')]=qs[_0x5b03('0x35')](_[_0x5b03('0x36')](_0x1d29ee[_0x5b03('0x2c')],_0x11ebdd['filters']),_0xc055d);if(_0x1d29ee['query'][_0x5b03('0x37')]){_0x3dc413[_0x5b03('0x34')]=_[_0x5b03('0x38')](_0x3dc413[_0x5b03('0x34')],{'$or':_['map'](_0xc055d,function(_0x2eef1b){if(_0x2eef1b[_0x5b03('0x39')]!==_0x5b03('0x3a')){var _0x1de2ac={};_0x1de2ac[_0x2eef1b[_0x5b03('0x24')]]={'$like':'%'+_0x1d29ee[_0x5b03('0x2c')][_0x5b03('0x37')]+'%'};return _0x1de2ac;}})});}_0x3dc413=_[_0x5b03('0x38')]({},_0x3dc413,_0x1d29ee[_0x5b03('0x3b')]);var _0x453e51={'where':_0x3dc413[_0x5b03('0x34')]};return db[_0x5b03('0x27')]['count'](_0x453e51)[_0x5b03('0x21')](function(_0x1b028d){_0x2b499a[_0x5b03('0x19')]=_0x1b028d;if(_0x1d29ee['query']['includeAll']){_0x3dc413['include']=[{'all':!![]}];}return db[_0x5b03('0x27')][_0x5b03('0x3c')](_0x3dc413);})[_0x5b03('0x21')](function(_0x38335f){_0x2b499a[_0x5b03('0x3d')]=_0x38335f;return _0x2b499a;})[_0x5b03('0x21')](respondWithFilteredResult(_0x50b144,_0x3dc413))[_0x5b03('0x3e')](handleError(_0x50b144,null));};exports[_0x5b03('0x3f')]=function(_0x2f8190,_0xb0efbd){var _0x3c91e5={'raw':!![],'where':{'id':_0x2f8190[_0x5b03('0x40')]['id']}},_0x9dc4de={};_0x9dc4de[_0x5b03('0x2a')]=_['keys'](db[_0x5b03('0x27')][_0x5b03('0x28')]);_0x9dc4de[_0x5b03('0x2c')]=_[_0x5b03('0x41')](_0x2f8190[_0x5b03('0x2c')]);_0x9dc4de[_0x5b03('0x35')]=_[_0x5b03('0x2d')](_0x9dc4de['model'],_0x9dc4de[_0x5b03('0x2c')]);_0x3c91e5[_0x5b03('0x2e')]=_[_0x5b03('0x2d')](_0x9dc4de[_0x5b03('0x2a')],qs[_0x5b03('0x2f')](_0x2f8190[_0x5b03('0x2c')]['fields']));_0x3c91e5[_0x5b03('0x2e')]=_0x3c91e5[_0x5b03('0x2e')][_0x5b03('0x42')]?_0x3c91e5[_0x5b03('0x2e')]:_0x9dc4de[_0x5b03('0x2a')];if(_0x2f8190[_0x5b03('0x2c')][_0x5b03('0x43')]){_0x3c91e5[_0x5b03('0x44')]=[{'all':!![]}];}_0x3c91e5=_[_0x5b03('0x38')]({},_0x3c91e5,_0x2f8190[_0x5b03('0x3b')]);return db[_0x5b03('0x27')][_0x5b03('0x45')](_0x3c91e5)[_0x5b03('0x21')](handleEntityNotFound(_0xb0efbd,null))['then'](respondWithResult(_0xb0efbd,null))[_0x5b03('0x3e')](handleError(_0xb0efbd,null));};exports[_0x5b03('0x46')]=function(_0x345c14,_0x266d53){return db[_0x5b03('0x27')][_0x5b03('0x46')](_0x345c14['body'],{})[_0x5b03('0x21')](respondWithResult(_0x266d53,0xc9))[_0x5b03('0x3e')](handleError(_0x266d53,null));};exports[_0x5b03('0x1f')]=function(_0x34df77,_0x21727d){if(_0x34df77[_0x5b03('0x47')]['id']){delete _0x34df77['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x34df77[_0x5b03('0x40')]['id']}})[_0x5b03('0x21')](handleEntityNotFound(_0x21727d,null))[_0x5b03('0x21')](saveUpdates(_0x34df77[_0x5b03('0x47')],null))[_0x5b03('0x21')](respondWithResult(_0x21727d,null))[_0x5b03('0x3e')](handleError(_0x21727d,null));};exports[_0x5b03('0x20')]=function(_0x447ad4,_0x2de73d){return db['WhatsappTransferReport'][_0x5b03('0x45')]({'where':{'id':_0x447ad4['params']['id']}})['then'](handleEntityNotFound(_0x2de73d,null))['then'](removeEntity(_0x2de73d,null))[_0x5b03('0x3e')](handleError(_0x2de73d,null));};exports[_0x5b03('0x48')]=function(_0x301012,_0x56ea9b){return db[_0x5b03('0x27')][_0x5b03('0x48')]()[_0x5b03('0x21')](respondWithResult(_0x56ea9b,null))[_0x5b03('0x3e')](handleError(_0x56ea9b,null));}; \ No newline at end of file +var _0x4490=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','options','rows','show','includeAll','include','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4490,0x112));var _0x0449=function(_0x451bd4,_0x389a1b){_0x451bd4=_0x451bd4-0x0;var _0x53b944=_0x4490[_0x451bd4];return _0x53b944;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0449('0x0'));var zipdir=require(_0x0449('0x1'));var jsonpatch=require(_0x0449('0x2'));var rp=require('request-promise');var moment=require(_0x0449('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0449('0x4'));var util=require(_0x0449('0x5'));var path=require('path');var sox=require(_0x0449('0x6'));var csv=require('to-csv');var ejs=require(_0x0449('0x7'));var fs=require('fs');var fs_extra=require(_0x0449('0x8'));var _=require('lodash');var squel=require(_0x0449('0x9'));var crypto=require(_0x0449('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0449('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0449('0xc'));var Papa=require(_0x0449('0xd'));var Redis=require('ioredis');var authService=require(_0x0449('0xe'));var qs=require(_0x0449('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0449('0x10'));var logger=require(_0x0449('0x11'))(_0x0449('0x12'));var utils=require(_0x0449('0x13'));var config=require(_0x0449('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0449('0x15'))['db'];function respondWithStatusCode(_0x4838cc,_0x4cb2e4){_0x4cb2e4=_0x4cb2e4||0xcc;return function(_0xb57116){if(_0xb57116){return _0x4838cc[_0x0449('0x16')](_0x4cb2e4);}return _0x4838cc[_0x0449('0x17')](_0x4cb2e4)[_0x0449('0x18')]();};}function respondWithResult(_0x425a7e,_0x2f65eb){_0x2f65eb=_0x2f65eb||0xc8;return function(_0x3ff961){if(_0x3ff961){return _0x425a7e[_0x0449('0x17')](_0x2f65eb)[_0x0449('0x19')](_0x3ff961);}};}function respondWithFilteredResult(_0x406718,_0x32fcf7){return function(_0x2f27ff){if(_0x2f27ff){var _0x5e415b=typeof _0x32fcf7[_0x0449('0x1a')]==='undefined'&&typeof _0x32fcf7[_0x0449('0x1b')]===_0x0449('0x1c');var _0x5b3a5f=_0x2f27ff['count'];var _0x221f41=_0x5e415b?0x0:_0x32fcf7['offset'];var _0x27bec8=_0x5e415b?_0x2f27ff[_0x0449('0x1d')]:_0x32fcf7[_0x0449('0x1a')]+_0x32fcf7[_0x0449('0x1b')];var _0xa75357;if(_0x27bec8>=_0x5b3a5f){_0x27bec8=_0x5b3a5f;_0xa75357=0xc8;}else{_0xa75357=0xce;}_0x406718[_0x0449('0x17')](_0xa75357);return _0x406718[_0x0449('0x1e')](_0x0449('0x1f'),_0x221f41+'-'+_0x27bec8+'/'+_0x5b3a5f)[_0x0449('0x19')](_0x2f27ff);}return null;};}function patchUpdates(_0xf33774){return function(_0xfcc31e){try{jsonpatch[_0x0449('0x20')](_0xfcc31e,_0xf33774,!![]);}catch(_0x3b4d47){return BPromise[_0x0449('0x21')](_0x3b4d47);}return _0xfcc31e[_0x0449('0x22')]();};}function saveUpdates(_0x1aa6a4,_0x162331){return function(_0x434358){if(_0x434358){return _0x434358[_0x0449('0x23')](_0x1aa6a4)[_0x0449('0x24')](function(_0x587261){return _0x587261;});}return null;};}function removeEntity(_0x11ced2,_0x482791){return function(_0x55bc15){if(_0x55bc15){return _0x55bc15[_0x0449('0x25')]()['then'](function(){_0x11ced2[_0x0449('0x17')](0xcc)[_0x0449('0x18')]();});}};}function handleEntityNotFound(_0x43ac5,_0x37db3e){return function(_0x16f01a){if(!_0x16f01a){_0x43ac5[_0x0449('0x16')](0x194);}return _0x16f01a;};}function handleError(_0x5e344c,_0x12070c){_0x12070c=_0x12070c||0x1f4;return function(_0x19cf84){logger[_0x0449('0x26')](_0x19cf84[_0x0449('0x27')]);if(_0x19cf84[_0x0449('0x28')]){delete _0x19cf84[_0x0449('0x28')];}_0x5e344c['status'](_0x12070c)[_0x0449('0x29')](_0x19cf84);};}exports[_0x0449('0x2a')]=function(_0x144527,_0x5369f9){var _0x3f78e7={},_0x276a7d={},_0x5764e2={'count':0x0,'rows':[]};var _0x44e797=_['map'](db[_0x0449('0x2b')][_0x0449('0x2c')],function(_0x5ba656){return{'name':_0x5ba656['fieldName'],'type':_0x5ba656['type'][_0x0449('0x2d')]};});_0x276a7d[_0x0449('0x2e')]=_[_0x0449('0x2f')](_0x44e797,_0x0449('0x28'));_0x276a7d['query']=_[_0x0449('0x30')](_0x144527[_0x0449('0x31')]);_0x276a7d['filters']=_['intersection'](_0x276a7d[_0x0449('0x2e')],_0x276a7d['query']);_0x3f78e7['attributes']=_[_0x0449('0x32')](_0x276a7d[_0x0449('0x2e')],qs[_0x0449('0x33')](_0x144527[_0x0449('0x31')][_0x0449('0x33')]));_0x3f78e7[_0x0449('0x34')]=_0x3f78e7['attributes'][_0x0449('0x35')]?_0x3f78e7['attributes']:_0x276a7d[_0x0449('0x2e')];if(!_0x144527['query'][_0x0449('0x36')](_0x0449('0x37'))){_0x3f78e7[_0x0449('0x1b')]=qs[_0x0449('0x1b')](_0x144527[_0x0449('0x31')][_0x0449('0x1b')]);_0x3f78e7[_0x0449('0x1a')]=qs[_0x0449('0x1a')](_0x144527[_0x0449('0x31')][_0x0449('0x1a')]);}_0x3f78e7[_0x0449('0x38')]=qs['sort'](_0x144527[_0x0449('0x31')][_0x0449('0x39')]);_0x3f78e7[_0x0449('0x3a')]=qs['filters'](_[_0x0449('0x3b')](_0x144527[_0x0449('0x31')],_0x276a7d[_0x0449('0x3c')]),_0x44e797);if(_0x144527[_0x0449('0x31')][_0x0449('0x3d')]){_0x3f78e7['where']=_[_0x0449('0x3e')](_0x3f78e7[_0x0449('0x3a')],{'$or':_[_0x0449('0x2f')](_0x44e797,function(_0x1a56ec){if(_0x1a56ec[_0x0449('0x3f')]!=='VIRTUAL'){var _0x57aeea={};_0x57aeea[_0x1a56ec['name']]={'$like':'%'+_0x144527[_0x0449('0x31')][_0x0449('0x3d')]+'%'};return _0x57aeea;}})});}_0x3f78e7=_[_0x0449('0x3e')]({},_0x3f78e7,_0x144527[_0x0449('0x40')]);var _0x1c8de3={'where':_0x3f78e7['where']};return db[_0x0449('0x2b')]['count'](_0x1c8de3)[_0x0449('0x24')](function(_0x209bc6){_0x5764e2[_0x0449('0x1d')]=_0x209bc6;if(_0x144527[_0x0449('0x31')]['includeAll']){_0x3f78e7['include']=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x3f78e7);})[_0x0449('0x24')](function(_0x3dacf7){_0x5764e2[_0x0449('0x41')]=_0x3dacf7;return _0x5764e2;})[_0x0449('0x24')](respondWithFilteredResult(_0x5369f9,_0x3f78e7))['catch'](handleError(_0x5369f9,null));};exports[_0x0449('0x42')]=function(_0x2a87df,_0x4ca87a){var _0x2e7732={'raw':!![],'where':{'id':_0x2a87df['params']['id']}},_0x349cb4={};_0x349cb4['model']=_[_0x0449('0x30')](db[_0x0449('0x2b')][_0x0449('0x2c')]);_0x349cb4['query']=_[_0x0449('0x30')](_0x2a87df[_0x0449('0x31')]);_0x349cb4[_0x0449('0x3c')]=_[_0x0449('0x32')](_0x349cb4[_0x0449('0x2e')],_0x349cb4[_0x0449('0x31')]);_0x2e7732[_0x0449('0x34')]=_[_0x0449('0x32')](_0x349cb4[_0x0449('0x2e')],qs[_0x0449('0x33')](_0x2a87df[_0x0449('0x31')][_0x0449('0x33')]));_0x2e7732[_0x0449('0x34')]=_0x2e7732[_0x0449('0x34')][_0x0449('0x35')]?_0x2e7732[_0x0449('0x34')]:_0x349cb4[_0x0449('0x2e')];if(_0x2a87df['query'][_0x0449('0x43')]){_0x2e7732[_0x0449('0x44')]=[{'all':!![]}];}_0x2e7732=_[_0x0449('0x3e')]({},_0x2e7732,_0x2a87df['options']);return db[_0x0449('0x2b')][_0x0449('0x45')](_0x2e7732)[_0x0449('0x24')](handleEntityNotFound(_0x4ca87a,null))[_0x0449('0x24')](respondWithResult(_0x4ca87a,null))[_0x0449('0x46')](handleError(_0x4ca87a,null));};exports[_0x0449('0x47')]=function(_0x2a20b1,_0x32aca2){return db[_0x0449('0x2b')]['create'](_0x2a20b1[_0x0449('0x48')],{})[_0x0449('0x24')](respondWithResult(_0x32aca2,0xc9))['catch'](handleError(_0x32aca2,null));};exports[_0x0449('0x23')]=function(_0x3873e3,_0x2204a9){if(_0x3873e3['body']['id']){delete _0x3873e3[_0x0449('0x48')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x3873e3[_0x0449('0x49')]['id']}})[_0x0449('0x24')](handleEntityNotFound(_0x2204a9,null))[_0x0449('0x24')](saveUpdates(_0x3873e3[_0x0449('0x48')],null))[_0x0449('0x24')](respondWithResult(_0x2204a9,null))[_0x0449('0x46')](handleError(_0x2204a9,null));};exports[_0x0449('0x25')]=function(_0x5cdd78,_0xd673fa){return db['WhatsappTransferReport'][_0x0449('0x45')]({'where':{'id':_0x5cdd78[_0x0449('0x49')]['id']}})[_0x0449('0x24')](handleEntityNotFound(_0xd673fa,null))['then'](removeEntity(_0xd673fa,null))['catch'](handleError(_0xd673fa,null));};exports[_0x0449('0x4a')]=function(_0x18d3f6,_0x9436c8){return db['WhatsappTransferReport'][_0x0449('0x4a')]()['then'](respondWithResult(_0x9436c8,null))[_0x0449('0x46')](handleError(_0x9436c8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e8c32c7..9323b10 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 _0x7707=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7707,0x101));var _0x7770=function(_0x59a664,_0x216420){_0x59a664=_0x59a664-0x0;var _0x467a02=_0x7707[_0x59a664];return _0x467a02;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var logger=require(_0x7770('0x2'))(_0x7770('0x3'));var moment=require(_0x7770('0x4'));var BPromise=require(_0x7770('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7770('0x6'));var rimraf=require(_0x7770('0x7'));var config=require(_0x7770('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x7770('0x9')]=function(_0x592402,_0x42fdd3){return _0x592402[_0x7770('0xa')](_0x7770('0xb'),attributes,{'tableName':_0x7770('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7770('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8835=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x1cf870,_0x5f172d){var _0x439018=function(_0x4e0f93){while(--_0x4e0f93){_0x1cf870['push'](_0x1cf870['shift']());}};_0x439018(++_0x5f172d);}(_0x8835,0x118));var _0x5883=function(_0x5b88e6,_0x442e33){_0x5b88e6=_0x5b88e6-0x0;var _0x531715=_0x8835[_0x5b88e6];return _0x531715;};'use strict';var _=require(_0x5883('0x0'));var util=require(_0x5883('0x1'));var logger=require(_0x5883('0x2'))(_0x5883('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5883('0x4'));var fs=require('fs');var path=require(_0x5883('0x5'));var rimraf=require(_0x5883('0x6'));var config=require(_0x5883('0x7'));var attributes=require(_0x5883('0x8'));module[_0x5883('0x9')]=function(_0x2ed91c,_0x47c564){return _0x2ed91c[_0x5883('0xa')](_0x5883('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x5883('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 9ad53c4..1e8c30f 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 _0xb7a0=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x15ba36,_0x3c057e){var _0x5b4c6d=function(_0x3ecd32){while(--_0x3ecd32){_0x15ba36['push'](_0x15ba36['shift']());}};_0x5b4c6d(++_0x3c057e);}(_0xb7a0,0x143));var _0x0b7a=function(_0x142902,_0x345124){_0x142902=_0x142902-0x0;var _0x2dfc83=_0xb7a0[_0x142902];return _0x2dfc83;};'use strict';var _=require(_0x0b7a('0x0'));var util=require(_0x0b7a('0x1'));var moment=require(_0x0b7a('0x2'));var BPromise=require(_0x0b7a('0x3'));var rs=require(_0x0b7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b7a('0x6'))(_0x0b7a('0x7'));var config=require(_0x0b7a('0x8'));var jayson=require(_0x0b7a('0x9'));var client=jayson[_0x0b7a('0xa')][_0x0b7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4191c9,_0x316a3c,_0xbf54e0){return new BPromise(function(_0x5eaeb3,_0x2378af){return client[_0x0b7a('0xc')](_0x4191c9,_0xbf54e0)[_0x0b7a('0xd')](function(_0x539cdf){logger[_0x0b7a('0xe')](_0x0b7a('0xf'),_0x316a3c,'request\x20sent');logger[_0x0b7a('0x10')](_0x0b7a('0x11'),_0x316a3c,_0x0b7a('0x12'),JSON['stringify'](_0x539cdf));if(_0x539cdf[_0x0b7a('0x13')]){if(_0x539cdf[_0x0b7a('0x13')][_0x0b7a('0x14')]===0x1f4){logger[_0x0b7a('0x13')](_0x0b7a('0xf'),_0x316a3c,_0x539cdf[_0x0b7a('0x13')][_0x0b7a('0x15')]);return _0x2378af(_0x539cdf[_0x0b7a('0x13')]['message']);}logger[_0x0b7a('0x13')](_0x0b7a('0xf'),_0x316a3c,_0x539cdf[_0x0b7a('0x13')][_0x0b7a('0x15')]);return _0x5eaeb3(_0x539cdf[_0x0b7a('0x13')][_0x0b7a('0x15')]);}else{logger[_0x0b7a('0xe')](_0x0b7a('0xf'),_0x316a3c,_0x0b7a('0x12'));_0x5eaeb3(_0x539cdf['result'][_0x0b7a('0x15')]);}})['catch'](function(_0x1f4a6e){logger[_0x0b7a('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x316a3c,_0x1f4a6e);_0x2378af(_0x1f4a6e);});});} \ No newline at end of file +var _0x74fd=['client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x537488,_0x3c554e){var _0x34dd0e=function(_0x4cba82){while(--_0x4cba82){_0x537488['push'](_0x537488['shift']());}};_0x34dd0e(++_0x3c554e);}(_0x74fd,0xb0));var _0xd74f=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x74fd[_0x213518];return _0x1baf75;};'use strict';var _=require(_0xd74f('0x0'));var util=require(_0xd74f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd74f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd74f('0x3'))['db'];var utils=require(_0xd74f('0x4'));var logger=require(_0xd74f('0x5'))(_0xd74f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd74f('0x7'));var client=jayson[_0xd74f('0x8')][_0xd74f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2367e3,_0x40d21b,_0x52a8d9){return new BPromise(function(_0x4df0b7,_0x1ae704){return client[_0xd74f('0xa')](_0x2367e3,_0x52a8d9)[_0xd74f('0xb')](function(_0x475d47){logger[_0xd74f('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x40d21b,'request\x20sent');logger[_0xd74f('0xd')](_0xd74f('0xe'),_0x40d21b,'request\x20sent',JSON[_0xd74f('0xf')](_0x475d47));if(_0x475d47[_0xd74f('0x10')]){if(_0x475d47[_0xd74f('0x10')][_0xd74f('0x11')]===0x1f4){logger[_0xd74f('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x40d21b,_0x475d47['error']['message']);return _0x1ae704(_0x475d47[_0xd74f('0x10')][_0xd74f('0x12')]);}logger[_0xd74f('0x10')](_0xd74f('0x13'),_0x40d21b,_0x475d47[_0xd74f('0x10')]['message']);return _0x4df0b7(_0x475d47[_0xd74f('0x10')][_0xd74f('0x12')]);}else{logger[_0xd74f('0xc')](_0xd74f('0x13'),_0x40d21b,_0xd74f('0x14'));_0x4df0b7(_0x475d47[_0xd74f('0x15')][_0xd74f('0x12')]);}})[_0xd74f('0x16')](function(_0x4f5f30){logger[_0xd74f('0x10')](_0xd74f('0x13'),_0x40d21b,_0x4f5f30);_0x1ae704(_0x4f5f30);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 4fdc9bc..bcfc8cc 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x818f=['App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','join','status','online','None'];(function(_0x2f3092,_0x485b57){var _0x39991c=function(_0x1ccd8a){while(--_0x1ccd8a){_0x2f3092['push'](_0x2f3092['shift']());}};_0x39991c(++_0x485b57);}(_0x818f,0x1da));var _0xf818=function(_0x45e4fa,_0xe6ed3){_0x45e4fa=_0x45e4fa-0x0;var _0x27342=_0x818f[_0x45e4fa];return _0x27342;};'use strict';var _=require(_0xf818('0x0'));var db=require(_0xf818('0x1'))['db'];var seedDb=require(_0xf818('0x2'));var checkLicense=require(_0xf818('0x3'));var rpc=require(_0xf818('0x4'));var config=require(_0xf818('0x5'));var logger=require('./config/logger')(_0xf818('0x6'));var pm2=require(_0xf818('0x7'));var pm2Config=require(_0xf818('0x8'));var schedule=require(_0xf818('0x9'));var chat=require(_0xf818('0xa'));var whatsapp=require(_0xf818('0xb'));var transcribe=require(_0xf818('0xc'));var provider=require(_0xf818('0xd'));function main(){return db[_0xf818('0xe')]['sync']()[_0xf818('0xf')](function(){if(config[_0xf818('0x10')]){return seedDb[_0xf818('0x11')]();}})['then'](function(){return checkLicense['default']();})[_0xf818('0xf')](function(){return rpc[_0xf818('0x12')]();})[_0xf818('0xf')](function(_0x3386f9){logger[_0xf818('0x13')](_0x3386f9);return chat['start']();})[_0xf818('0xf')](function(){return whatsapp[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return schedule[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return transcribe['start']();})['then'](function(){return provider[_0xf818('0x14')]();})[_0xf818('0xf')](function(_0x950109){logger[_0xf818('0x13')](_0x950109);return pm2['start'](pm2Config);})[_0xf818('0xf')](function(_0x3234c5){var _0xbc3568=_0x3234c5[_0xf818('0x15')](function(_0xbfdd71){return typeof _0xbfdd71['exitCode']==='number'&&_0xbfdd71[_0xf818('0x16')]>=0x0;});if(_0xbc3568['length']>0x0){throw new Error(_0xbc3568[_0xf818('0x17')]+_0xf818('0x18')+_['map'](_0xbc3568,function(_0x2bf9f3){return'\x22'+_0x2bf9f3[_0xf818('0x19')][_0xf818('0x1a')]+'\x22';}));}logger['info'](_0xf818('0x1b'),_[_0xf818('0x1c')](_[_0xf818('0x15')](_0x3234c5,{'status':'online'}),'name')[_0xf818('0x1d')]());logger[_0xf818('0x13')]('Offline\x20apps:',_[_0xf818('0x1c')](_['filter'](_0x3234c5,function(_0x1849bf){return _0x1849bf[_0xf818('0x1e')]!==_0xf818('0x1f');}),'name')[_0xf818('0x1d')]()||_0xf818('0x20'));console['log'](_0xf818('0x21'));})[_0xf818('0x22')](function(_0x1160f4){console[_0xf818('0x23')](_0xf818('0x24'),_0x1160f4);logger[_0xf818('0x25')](_0xf818('0x26'),_0x1160f4);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x6596=['join','Offline\x20apps:','map','status','online','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','seedDB','default','then','listen','start','info','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','name'];(function(_0x6376b0,_0x52d8c1){var _0x47ac71=function(_0x4cf390){while(--_0x4cf390){_0x6376b0['push'](_0x6376b0['shift']());}};_0x47ac71(++_0x52d8c1);}(_0x6596,0x1d3));var _0x6659=function(_0x3695a6,_0x538de8){_0x3695a6=_0x3695a6-0x0;var _0x569729=_0x6596[_0x3695a6];return _0x569729;};'use strict';var _=require(_0x6659('0x0'));var db=require(_0x6659('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x6659('0x2'));var rpc=require(_0x6659('0x3'));var config=require(_0x6659('0x4'));var logger=require(_0x6659('0x5'))(_0x6659('0x6'));var pm2=require(_0x6659('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x6659('0x8'));var whatsapp=require(_0x6659('0x9'));var transcribe=require(_0x6659('0xa'));var provider=require(_0x6659('0xb'));function main(){return db[_0x6659('0xc')]['sync']()['then'](function(){if(config[_0x6659('0xd')]){return seedDb[_0x6659('0xe')]();}})[_0x6659('0xf')](function(){return checkLicense[_0x6659('0xe')]();})[_0x6659('0xf')](function(){return rpc[_0x6659('0x10')]();})['then'](function(_0xe1e51b){logger['info'](_0xe1e51b);return chat['start']();})[_0x6659('0xf')](function(){return whatsapp['start']();})[_0x6659('0xf')](function(){return schedule[_0x6659('0x11')]();})[_0x6659('0xf')](function(){return transcribe[_0x6659('0x11')]();})['then'](function(){return provider[_0x6659('0x11')]();})[_0x6659('0xf')](function(_0x518769){logger[_0x6659('0x12')](_0x518769);return pm2[_0x6659('0x11')](pm2Config);})[_0x6659('0xf')](function(_0x346cb6){var _0x47341b=_0x346cb6[_0x6659('0x13')](function(_0x5b5c16){return typeof _0x5b5c16[_0x6659('0x14')]===_0x6659('0x15')&&_0x5b5c16[_0x6659('0x14')]>=0x0;});if(_0x47341b[_0x6659('0x16')]>0x0){throw new Error(_0x47341b[_0x6659('0x16')]+_0x6659('0x17')+_['map'](_0x47341b,function(_0x5b7658){return'\x22'+_0x5b7658[_0x6659('0x18')]['name']+'\x22';}));}logger[_0x6659('0x12')](_0x6659('0x19'),_['map'](_[_0x6659('0x13')](_0x346cb6,{'status':'online'}),_0x6659('0x1a'))[_0x6659('0x1b')]());logger['info'](_0x6659('0x1c'),_[_0x6659('0x1d')](_[_0x6659('0x13')](_0x346cb6,function(_0x3e139a){return _0x3e139a[_0x6659('0x1e')]!==_0x6659('0x1f');}),_0x6659('0x1a'))['join']()||_0x6659('0x20'));console[_0x6659('0x21')](_0x6659('0x22'));})[_0x6659('0x23')](function(_0x4d079c){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x4d079c);logger['error'](_0x6659('0x24'),_0x4d079c);process[_0x6659('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index b732045..d4f1888 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 _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x2a897d,_0x29e446){var _0x5a17c3=function(_0x6b66aa){while(--_0x6b66aa){_0x2a897d['push'](_0x2a897d['shift']());}};_0x5a17c3(++_0x29e446);}(_0x4b84,0x1cc));var _0x44b8=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x4b84[_0x439d59];return _0x3670c7;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file +var _0x70e0=['express-jwt','composable-middleware','crypto','util','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','Bearer','status','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','encryptString','promisify','sign','secret','secrets','session','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x70e0,0x17b));var _0x070e=function(_0x6482fe,_0x1095c9){_0x6482fe=_0x6482fe-0x0;var _0x44006c=_0x70e0[_0x6482fe];return _0x44006c;};'use strict';var db=require(_0x070e('0x0'))['db'];var config=require(_0x070e('0x1'));var hardwareConf=require(_0x070e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x070e('0x3'));var jwt=require(_0x070e('0x4'));var expressJwt=require(_0x070e('0x5'));var compose=require(_0x070e('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x070e('0x7'));var BPromise=require('bluebird');var util=require(_0x070e('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb'),_0x070e('0xc'),_0x070e('0xd'),_0x070e('0xe'),_0x070e('0xf'),'md5secret','voicePause',_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13'),_0x070e('0x14'),_0x070e('0x15'),_0x070e('0x16'),_0x070e('0x17'),_0x070e('0x18'),_0x070e('0x19'),_0x070e('0x1a'),'passwordResetAt','alias',_0x070e('0x1b'),'phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x070e('0x1c'),_0x070e('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0x070e('0x1e'),_0x070e('0x1f'),_0x070e('0x20'),_0x070e('0x21'),'userProfileId','privacyEnabled',_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26'),'ignorePauseForPreviewCalls',_0x070e('0x27'),_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a'),_0x070e('0x2b'),'smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer',_0x070e('0x2c'),_0x070e('0x2d'),_0x070e('0x2e'),'whatsappAutoanswer',_0x070e('0x2f')];exports['isChatInteractionAuthorized']=function(){return this[_0x070e('0x30')](!![])[_0x070e('0x31')](function(_0x27a01e,_0x33e8c6,_0x28a1c3){if(_0x27a01e[_0x070e('0x32')]){_0x28a1c3();}else{return db[_0x070e('0x33')][_0x070e('0x34')]({'where':{'id':_0x27a01e['params']['id']},'attributes':['id',_0x070e('0x35'),_0x070e('0x36')],'raw':!![]})[_0x070e('0x37')](function(_0x503f4d){if(_0x503f4d&&_0x503f4d[_0x070e('0x35')]){return _0x33e8c6['status'](_0x503f4d['disposition']===_0x070e('0x38')?0x195:0x193)[_0x070e('0x39')]({'message':_0x503f4d[_0x070e('0x36')]===_0x070e('0x38')?_0x070e('0x3a'):'Forbidden.'});}else{_0x28a1c3();}})[_0x070e('0x3b')](function(_0x219e48){_0x28a1c3(_0x219e48);});}});};exports[_0x070e('0x30')]=function isAuthenticated(_0x1d2a34){return compose()[_0x070e('0x31')](function(_0x28d7f2,_0x1a1892,_0x26373b){var _0x5e8326;if(_0x28d7f2[_0x070e('0x3c')][_0x070e('0x3d')]){if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x3f'))){var _0x46065c=basicAuth(_0x28d7f2);db[_0x070e('0x40')]['find']({'where':{'name':_0x46065c[_0x070e('0xb')]}})[_0x070e('0x37')](function(_0x3a9425){if(!_0x3a9425||!_0x3a9425[_0x070e('0x41')](_0x46065c['pass'])){return _0x1a1892['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x28d7f2[_0x070e('0x32')]={'id':_0x3a9425['id']};_0x26373b();})['catch'](function(_0x1dff97){_0x26373b(_0x1dff97);});}else if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x42'))){validateJwt(_0x28d7f2,_0x1a1892,_0x26373b);}else{if(_0x1d2a34){_0x26373b();}else{return _0x1a1892[_0x070e('0x43')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x28d7f2[_0x070e('0x44')][_0x070e('0x45')]){try{var _0x444d02={'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};verifyJwt(_0x28d7f2['query']['apikey'],_0x444d02)[_0x070e('0x37')](function(_0x3011c4){return db[_0x070e('0x40')][_0x070e('0x47')]({'where':{'id':_0x3011c4[_0x070e('0x48')]}})['then'](function(_0x22f3a9){_0x5e8326=_0x22f3a9;return db[_0x070e('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x070e('0x4a'),_0x070e('0x4b')],'raw':!![]});})['then'](function(_0x4d4ee8){if(!_0x5e8326||!_['isEqual'](_0x5e8326[_0x070e('0x4c')],_0x3011c4[_0x070e('0x4d')])){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4e')});}if(_0x5e8326['disabled']){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}if(_0x5e8326['blocked']){if(_0x4d4ee8[_0x070e('0x4b')]>0x0){if(moment(_0x5e8326[_0x070e('0x50')])[_0x070e('0x51')](_0x4d4ee8['blockDuration'],_0x070e('0x52'))>moment()){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});}}else{return _0x1a1892['status'](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}}_0x28d7f2[_0x070e('0x32')]={'id':_0x5e8326['id']};_0x26373b();});})[_0x070e('0x3b')](function(){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});});}catch(_0x5db2ce){_0x26373b(_0x5db2ce);}}else if(_0x1d2a34){_0x26373b();}else{return _0x1a1892['status'](0x193)[_0x070e('0x39')]({'message':_0x070e('0x53')});}})[_0x070e('0x31')](function(_0x4d52ff,_0x2ad56c,_0x1223be){if(_0x4d52ff[_0x070e('0x32')]){db[_0x070e('0x40')]['find']({'where':{'id':_0x4d52ff[_0x070e('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x544b53){if(!_0x544b53){return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':_0x070e('0x54')});}_0x4d52ff[_0x070e('0x32')]=_0x544b53;_0x1223be();})[_0x070e('0x3b')](function(_0x34f23e){_0x1223be(_0x34f23e);});}else if(_0x1d2a34){_0x1223be();}else{return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x070e('0x55')]=function canUpdate(){return compose()[_0x070e('0x31')](function(_0xff760c,_0x52fcea,_0x54285a){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x35349f){if(_0x35349f[_0x070e('0x57')]){_0x54285a();}else{return _0x52fcea[_0x070e('0x43')](0x193)['json']({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x48d836){_0x54285a(_0x48d836);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x070e('0x31')](function(_0x945901,_0x2d43ce,_0x1fc7c4){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x20b80e){if(_0x20b80e[_0x070e('0x59')]){_0x1fc7c4();}else{return _0x2d43ce[_0x070e('0x43')](0x193)[_0x070e('0x39')]({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x1f54d5){_0x1fc7c4(_0x1f54d5);});});};exports[_0x070e('0x5a')]=function(_0xd67987,_0x66a3f3,_0x210c4d){_0xd67987[_0x070e('0x5a')]=!![];return _0x210c4d();};exports[_0x070e('0x5b')]=function signToken(_0x216d27){return signJwt(_0x216d27);};exports[_0x070e('0x5c')]=function(_0x5e051a,_0x171621){if(!_0x5e051a[_0x070e('0x32')]){return _0x171621[_0x070e('0x43')](0x194)[_0x070e('0x39')]({'message':_0x070e('0x5d')});}var _0x3bd738={'payload':{'id':_0x5e051a[_0x070e('0x32')]['id'],'role':_0x5e051a[_0x070e('0x32')][_0x070e('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3bd738)['then'](function(_0x251696){_0x171621['cookie'](_0x070e('0x5e'),_0x251696);_0x171621[_0x070e('0x5f')]('/dashboards/general');})[_0x070e('0x3b')](function(_0x130a50){return _0x171621[_0x070e('0x43')](0x1f4)[_0x070e('0x60')](_0x130a50);});};exports[_0x070e('0x61')]=function(_0x1e8a4f){if(_[_0x070e('0x62')](_0x1e8a4f['apiKeyNonce'])||_[_0x070e('0x62')](_0x1e8a4f['apiKeyIat'])){return null;}else{return createJwt(_0x1e8a4f);}};exports['generateApiKey']=function(_0x3a06c6){_0x3a06c6[_0x070e('0x4c')]=generateNonce();_0x3a06c6[_0x070e('0x63')]=generateIssuedAt();return createJwt(_0x3a06c6);};exports[_0x070e('0x64')]=function(_0x202015,_0x7948ed){var _0x440fa1=_0x202015[_0x070e('0x44')]['apikey'];if(_0x440fa1){var _0x477e69={'nonce':_0x7948ed['apiKeyNonce'],'iat':_0x7948ed['apiKeyIat'],'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};return verifyJwt(_0x440fa1,_0x477e69)['then'](function(){return generateApiKey(_0x7948ed);});}else{throw{'message':_0x070e('0x65')};}};exports[_0x070e('0x66')]=function(_0x210f4a){var _0x2f8104=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2f8104[_0x070e('0x67')](_0x210f4a))throw new db[(_0x070e('0x68'))][(_0x070e('0x69'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5943e3,_0x3087e5,_0x1948a5){var _0x29f497=encryptor[_0x070e('0x6a')](_0x3087e5)['split'](',');for(var _0x25f34c=0x0;_0x25f34c<_0x1948a5;_0x25f34c++){if(!_0x29f497[_0x25f34c])break;if(_0x5943e3['toLowerCase']()===_0x29f497[_0x25f34c][_0x070e('0x6b')]()){var _0x1cbb7e=util[_0x070e('0x6c')](_0x070e('0x6d'),_0x1948a5);if(_0x1948a5===0x1){_0x1cbb7e=_0x070e('0x6e');}throw new db[(_0x070e('0x68'))]['ValidationError'](_0x1cbb7e);}}return;};exports[_0x070e('0x6f')]=function(_0x18e8d0,_0x8aaf00){var _0x533431=_0x8aaf00?encryptor[_0x070e('0x6a')](_0x8aaf00)[_0x070e('0x70')](','):[];if(_0x533431['length']===0x5){_0x533431[_0x070e('0x71')](-0x1,0x1);}_0x533431['unshift'](_0x18e8d0);return encryptor[_0x070e('0x72')](_0x533431['join'](','));};function signJwt(_0x4cb86f){var _0x4b354d=BPromise[_0x070e('0x73')](jwt[_0x070e('0x74')],{'context':jwt});var _0x1100d8=_0x4cb86f[_0x070e('0x75')]||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x498bc6,_0x841c89){_0x4b354d(_0x4cb86f['payload'],_0x1100d8,_0x4cb86f[_0x070e('0x78')])['then'](function(_0x2e10f7){_0x498bc6(_0x2e10f7);})[_0x070e('0x3b')](function(_0x5b0b46){_0x841c89(_0x5b0b46);});});}function verifyJwt(_0x1bcdc3,_0x50399e,_0x1a9e25){var _0x139630=BPromise[_0x070e('0x73')](jwt[_0x070e('0x79')],{'context':jwt});var _0x764b06=_0x1a9e25||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x148f1d,_0x3ef9cc){_0x139630(_0x1bcdc3,_0x764b06,_0x50399e)[_0x070e('0x37')](function(_0x40c560){_0x148f1d(_0x40c560);})[_0x070e('0x3b')](function(_0x455bf2){_0x3ef9cc(_0x455bf2);});});}function generateNonce(){return crypto[_0x070e('0x7a')](0x10)['toString'](_0x070e('0x7b'));}function generateIssuedAt(){return Math[_0x070e('0x7c')](Date[_0x070e('0x7d')]()/0x3e8)[_0x070e('0x7e')]();}function createJwt(_0x5712d1){var _0x2ccd8d={'payload':{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')]},'options':{'algorithm':_0x070e('0x7f'),'subject':_0x5712d1['id'][_0x070e('0x7e')](),'issuer':hardwareConf[_0x070e('0x46')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2ccd8d)[_0x070e('0x37')](function(_0x7d154){return{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')],'token':_0x7d154};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index a1e0e82..68f0697 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','startsWith','slice','length','cf_','type','map','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','clause','tags','user'];(function(_0x4b10f0,_0x25c95d){var _0x455af5=function(_0x57526b){while(--_0x57526b){_0x4b10f0['push'](_0x4b10f0['shift']());}};_0x455af5(++_0x25c95d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var sqlUtils=require(_0x0baf('0x0'));var db=require(_0x0baf('0x1'))['db'];exports[_0x0baf('0x2')]=function(_0x263f79,_0x1688bc,_0x4d2e72,_0x5a3e42){var _0x232cc7={'count':0x0,'rows':[]};var _0x1c383e=sqlUtils[_0x0baf('0x3')](_0x1688bc,_0x263f79);if(_0x1c383e){return Promise[_0x0baf('0x4')](_0x232cc7);}var _0xe4c3c4=sqlUtils[_0x0baf('0x5')]();var _0x1a10b1={};var _0x2dcaac=![];var _0x1d0a0d=![];return Promise['resolve']()[_0x0baf('0x6')](function(){if(_0x263f79['search']){return sqlUtils[_0x0baf('0x7')](_0x263f79[_0x0baf('0x8')],_0x5a3e42);}else{return sqlUtils[_0x0baf('0x9')](_0x263f79,_0x5a3e42);}})[_0x0baf('0x6')](function(_0x7f54d4){_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xb')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xc')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xd')]);_0xe4c3c4['where'](_0x7f54d4['user'][_0x0baf('0xe')]);_0x1a10b1=_0x7f54d4[_0x0baf('0xf')];_0x1d0a0d=_0x7f54d4[_0x0baf('0x10')][_0x0baf('0x11')];return sqlUtils['checkListsRestrictions'](_0x1688bc,_0x263f79,_0x1d0a0d);})[_0x0baf('0x6')](function(_0x49e44b){_0xe4c3c4[_0x0baf('0xa')](_0x49e44b);var _0x1f50c3=_0x263f79[_0x0baf('0x8')]?_0x1a10b1[_0x0baf('0x12')]:_0x263f79[_0x0baf('0x13')];_0x2dcaac=_0x1f50c3?!![]:![];return sqlUtils[_0x0baf('0x14')](_0xe4c3c4,_0x1f50c3);})['then'](function(_0x4cd79d){_0x232cc7[_0x0baf('0x15')]=_0x4cd79d;if(_0x232cc7[_0x0baf('0x15')]===0x0){return;}return sqlUtils[_0x0baf('0x16')](_0xe4c3c4,_0x263f79[_0x0baf('0xc')],_0x4d2e72,_0x2dcaac,_0x1a10b1[_0x0baf('0xe')],_0x1d0a0d);})[_0x0baf('0x6')](function(_0x53c338){if(!_0x53c338){return[];}return sqlUtils[_0x0baf('0x17')](_0x53c338,_0x263f79,_0x4d2e72);})[_0x0baf('0x6')](function(_0x1ef0e5){_0x232cc7[_0x0baf('0x18')]=_0x1ef0e5;return _0x232cc7;})[_0x0baf('0x19')](function(_0x42b7f2){throw _0x42b7f2;});};exports['describe']=function(){var _0x5cff5d={};var _0x1410ec=[];return db[_0x0baf('0x1a')][_0x0baf('0x1b')]()[_0x0baf('0x6')](function(_0x1fa92b){_0x5cff5d=_0x1fa92b;var _0x3e3e20=Object[_0x0baf('0x1c')](_0x5cff5d)[_0x0baf('0xd')](function(_0x2c42e2){return _[_0x0baf('0x1d')](_0x2c42e2,'cf_')?_0x2c42e2:undefined;});var _0x334bd6=_0x3e3e20['map'](function(_0xf6c158){return db['CmCustomField']['findOne']({'where':{'id':_0xf6c158[_0x0baf('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x334bd6);})['then'](function(_0x47c4b){for(var _0x27b59c=0x0;_0x27b59c<_0x47c4b[_0x0baf('0x1f')];_0x27b59c++){if(_0x47c4b[_0x27b59c]){var _0x19d9fd=_0x0baf('0x20')+_0x47c4b[_0x27b59c]['id'];_0x5cff5d[_0x19d9fd]['fieldType']=_0x47c4b[_0x27b59c][_0x0baf('0x21')];}}_0x1410ec=_[_0x0baf('0x22')](Object[_0x0baf('0x1c')](_0x5cff5d),function(_0x366e71){return{'name':_0x366e71,'type':_0x5cff5d[_0x366e71][_0x0baf('0x21')]};});return _0x1410ec;})[_0x0baf('0x19')](function(_0x453525){throw _0x453525;});}; \ No newline at end of file +var _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x757a,0xde));var _0xa757=function(_0x560f65,_0x39168f){_0x560f65=_0x560f65-0x0;var _0x4e9e57=_0x757a[_0x560f65];return _0x4e9e57;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 637a0e3..7a22e60 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa755=['split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','fieldType','datetime','castTo','buildExpression','type','default','text','value','start','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','tag','filter','search','c.ListId\x20IN\x20?','select','group','c.id','limit','offset','having','order','color','QueryTypes','SELECT','CmContact','sequelize','query','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','exports','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','autocomplete','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','.id','ct.CmContactId\x20=\x20','tools_tags','firstName','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace'];(function(_0xac6c1c,_0x33804f){var _0x586dfd=function(_0x2474fd){while(--_0x2474fd){_0xac6c1c['push'](_0xac6c1c['shift']());}};_0x586dfd(++_0x33804f);}(_0xa755,0xfd));var _0x5a75=function(_0x37407b,_0x9f637e){_0x37407b=_0x37407b-0x0;var _0x15d65f=_0xa755[_0x37407b];return _0x15d65f;};'use strict';var _=require('lodash');var squel=require(_0x5a75('0x0'));var as=require(_0x5a75('0x1'));var qs=require(_0x5a75('0x2'));var utils=require('../interaction/utils');var db=require(_0x5a75('0x3'))['db'];function skipContactsQuery(_0x364e1a,_0xe0b771){var _0x44027b=![];if(_0x364e1a[_0x5a75('0x4')]===_0x5a75('0x5')&&!_0xe0b771['search']&&!_0xe0b771['ListId']&&_0xe0b771[_0x5a75('0x6')]!=='true'){_0x44027b=!![];}return _0x44027b;}function getContactsSubquery(){return squel['select']()[_0x5a75('0x7')](_0x5a75('0x8'),'c')['where'](_0x5a75('0x9'));}function applyJoinClauses(_0xa1909a,_0x4a7ede){var _0xf9e5c4=_0x4a7ede?'c':_0x5a75('0xa');_0xa1909a[_0x5a75('0xb')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0xf9e5c4+_0x5a75('0xc'))[_0x5a75('0xb')]('cm_contact_has_tags','ct',_0x5a75('0xd')+_0xf9e5c4+_0x5a75('0xc'))[_0x5a75('0xb')](_0x5a75('0xe'),'t','t.id\x20=\x20ct.TagId');return _0xa1909a;}function addFieldsToQuery(_0x1d33d5,_0x2a46de,_0xfc8158,_0x4f46cf,_0x2365e3){var _0x3fe4db=_0x2365e3?'c':_0x5a75('0xa');if(!_0x2a46de){_0x2a46de=['id',_0x5a75('0xf'),'lastName','phone',_0x5a75('0x10'),_0x5a75('0x11'),_0x5a75('0x12'),'ListId',_0x5a75('0x13'),_0x5a75('0x14'),'updatedAt',_0x5a75('0x15'),_0x5a75('0x16')];}else if(!_0x2a46de[_0x5a75('0x17')]('id')){_0x2a46de[_0x5a75('0x18')]('id');}var _0x44fe09=_0xfc8158&&_0x2365e3||!_0xfc8158&&!_0x2365e3;if(_0x4f46cf){_0x44fe09=_0x4f46cf&&_0x2365e3||!_0x4f46cf&&!_0x2365e3;}_0x2a46de[_0x5a75('0x19')](function(_0x784783){if(_0x784783===_0x5a75('0x16')){if(_0x44fe09){_0x1d33d5[_0x5a75('0x1a')](_0x5a75('0x1b'),_0x784783);}else if(_0xfc8158||_0x4f46cf){_0x1d33d5[_0x5a75('0x1a')](_0x3fe4db+'.'+_0x784783);}}else{_0x1d33d5[_0x5a75('0x1a')](_0x3fe4db+'.'+_0x784783);}});return _0x1d33d5;}function getSqlClauses(){var _0x136ed6={'default':squel[_0x5a75('0x1c')](),'fields':squel[_0x5a75('0x1c')](),'filter':squel[_0x5a75('0x1c')](),'tags':{'clause':squel[_0x5a75('0x1c')](),'ids':null},'user':{'clause':squel[_0x5a75('0x1c')](),'skip':![]}};return _0x136ed6;}function parseTagParameter(_0x1f6410){var _0x528dfd=squel['expr']();if(_0x1f6410){var _0x10bd91=utils[_0x5a75('0x1d')](_0x1f6410);_0x10bd91[_0x5a75('0x19')](function(_0x16e5a5){_0x528dfd['or'](_0x5a75('0x1e'),'%,'+_0x16e5a5+',%');});}return _0x528dfd;}function parseSearchFilter(_0x661a7d){var _0x5bef3b=squel[_0x5a75('0x1c')]();if(_0x661a7d){var _0x40a527=_0x661a7d[_0x5a75('0x1f')]('\x5c','\x5c\x5c')[_0x5a75('0x1f')](/'/g,'\x27\x27');if(_0x40a527[_0x5a75('0x20')]('\x20')['length']>0x1){_0x5bef3b['or'](_0x5a75('0x21'),qs['getFullTextValue'](_0x40a527),null);}else{if(qs['isNumeric'](_0x40a527)){_0x5bef3b['or'](_0x5a75('0x22'),_0x40a527+'%');_0x5bef3b['or'](_0x5a75('0x23'),_0x40a527+'%');_0x5bef3b['or']('c.mobile\x20LIKE\x20?',_0x40a527+'%');_0x5bef3b['or']('c.fax\x20LIKE\x20?',_0x40a527+'%');}else if(qs['isEmail'](_0x40a527)){_0x5bef3b['or'](_0x5a75('0x24'),_0x40a527+'%');}else{_0x5bef3b['or'](_0x5a75('0x25'),'%'+_0x40a527+'%');_0x5bef3b['or'](_0x5a75('0x26'),'%'+_0x40a527+'%');_0x5bef3b['or'](_0x5a75('0x24'),'%'+_0x40a527+'%');}}}return _0x5bef3b;}function parseAdvancedSearchFilter(_0x592b36,_0x5de20b){var _0x4d21a9=getSqlClauses();var _0x57b6cf=as[_0x5a75('0x27')](_0x592b36);var _0x46e90c=_0x57b6cf[_0x5a75('0x28')];for(var _0x5d18c3=0x0;_0x5d18c3<_0x57b6cf[_0x5a75('0x29')][_0x5a75('0x2a')];_0x5d18c3++){var _0x3c9faa=_0x57b6cf[_0x5a75('0x29')][_0x5d18c3];var _0x2d6efe='c';var _0x2fad7c=_[_0x5a75('0x2b')](_0x5de20b,[_0x5a75('0x2c'),_0x3c9faa[_0x5a75('0x1a')]]);if(_0x2fad7c){if(_0x3c9faa[_0x5a75('0x1a')]==='dateOfBirth'||_0x2fad7c[_0x5a75('0x2d')]===_0x5a75('0x2e')){_0x3c9faa[_0x5a75('0x2f')]='DATE';}var _0x5abb89=as[_0x5a75('0x30')](_0x2d6efe,_0x2fad7c[_0x5a75('0x31')],_0x3c9faa);_0x4d21a9[_0x5a75('0x32')][_0x46e90c](_0x5abb89[_0x5a75('0x33')],_0x5abb89[_0x5a75('0x34')][_0x5a75('0x35')],_0x5abb89[_0x5a75('0x34')]['end']);}else{if(_0x3c9faa['field']===_0x5a75('0x36')){var _0xae85e4=_0x3c9faa['value'][_0x5a75('0x20')](',')[_0x5a75('0x37')](function(_0x52e805){return Number(_0x52e805);});var _0x82f612=parseTagParameter(_0xae85e4);_0x4d21a9[_0x5a75('0x38')][_0x5a75('0x39')][_0x5a75('0x3a')](_0x82f612);_0x4d21a9[_0x5a75('0x38')][_0x5a75('0x3b')]=_0xae85e4;}else if(_0x3c9faa[_0x5a75('0x1a')]===_0x5a75('0x3c')){_0x4d21a9[_0x5a75('0x3d')][_0x5a75('0x39')]['and'](_0x5a75('0x3e'),_0x3c9faa[_0x5a75('0x34')]);_0x4d21a9[_0x5a75('0x3d')][_0x5a75('0x3f')]=!![];}}}return _0x4d21a9;}function parseModelFields(_0x99a4ff,_0x53e349){var _0x3c0a87=squel['expr']();var _0x5e3ce0=_(_0x99a4ff)[_0x5a75('0x40')]()[_0x5a75('0x37')](function(_0x484fcc){return _[_0x5a75('0x41')](_0x53e349,[_0x5a75('0x2c'),_0x484fcc])?_0x484fcc:undefined;})['compact']()['value']();if(_0x99a4ff[_0x5a75('0x42')]){_0x5e3ce0[_0x5a75('0x18')](_0x5a75('0x42'));}if(_0x5e3ce0[_0x5a75('0x2a')]>0x0){_0x5e3ce0[_0x5a75('0x19')](function(_0x24bc91){if(_0x24bc91===_0x5a75('0x43')){_0x3c0a87['and']('c.ListId\x20IN\x20?',[][_0x5a75('0x44')](_0x99a4ff[_0x24bc91]));}else if(_0x24bc91===_0x5a75('0x42')){var _0x2172cc='%'+_0x99a4ff[_0x24bc91]+'%';_0x3c0a87[_0x5a75('0x3a')](_0x5a75('0x45'),_0x2172cc);}else{_0x3c0a87['and']('c.'+_0x24bc91+'\x20=\x20?',_0x99a4ff[_0x24bc91]);}});}return _0x3c0a87;}function parseQueryParameters(_0x4ab624,_0x1134a7){var _0x596bc0=getSqlClauses();return Promise[_0x5a75('0x46')]()[_0x5a75('0x47')](function(){return parseModelFields(_0x4ab624,_0x1134a7);})[_0x5a75('0x47')](function(_0x1f5199){_0x596bc0['fields'][_0x5a75('0x3a')](_0x1f5199);return parseTagParameter(_0x4ab624[_0x5a75('0x48')]);})[_0x5a75('0x47')](function(_0x3080c3){_0x596bc0[_0x5a75('0x38')]['clause']['and'](_0x3080c3);return parseSearchFilter(_0x4ab624[_0x5a75('0x49')]);})[_0x5a75('0x47')](function(_0x3ea46d){_0x596bc0['filter']=_0x3ea46d;return _0x596bc0;});}function checkListsRestrictions(_0x4fcd4a,_0x43906e,_0xa8ac68){var _0x4eaa4f=squel[_0x5a75('0x1c')]();return Promise[_0x5a75('0x46')]()[_0x5a75('0x47')](function(){if(_0x43906e[_0x5a75('0x4a')]&&_0x4fcd4a[_0x5a75('0x4')]==='agent'&&!_0xa8ac68){return _0x4fcd4a['getLists']({'attributes':['id'],'raw':!![]});}})[_0x5a75('0x47')](function(_0x48d0ee){if(_0x48d0ee){if(_0x48d0ee[_0x5a75('0x2a')]===0x0){_0x4eaa4f[_0x5a75('0x3a')]('c.ListId\x20IS\x20NULL');}else{_0x4eaa4f['and'](_0x5a75('0x4b'),_[_0x5a75('0x37')](_0x48d0ee,'id'));}}})[_0x5a75('0x47')](function(){return _0x4eaa4f;});}function buildContactsQuery(_0x31702a,_0x5a8c68,_0x44978e,_0x260830,_0x371fed,_0x3756a3){if(_0x5a8c68){_0x5a8c68=_0x44978e['attributes'];}_0x31702a=addFieldsToQuery(_0x31702a,_0x5a8c68,_0x260830,_0x3756a3,!![]);var _0x4a4a76=squel[_0x5a75('0x4c')]();_0x4a4a76=addFieldsToQuery(_0x4a4a76,_0x5a8c68,_0x260830,_0x3756a3,![]);if(_0x260830||_0x3756a3){_0x31702a=applyJoinClauses(_0x31702a,!![]);_0x31702a[_0x5a75('0x4d')](_0x5a75('0x4e'));if(_0x44978e['limit']){_0x4a4a76[_0x5a75('0x4f')](_0x44978e['limit']);}if(_0x44978e[_0x5a75('0x50')]){_0x4a4a76[_0x5a75('0x50')](_0x44978e[_0x5a75('0x50')]);}}else{_0x4a4a76=applyJoinClauses(_0x4a4a76,![]);_0x4a4a76[_0x5a75('0x4d')]('subqry.id');if(_0x44978e[_0x5a75('0x4f')]){_0x31702a['limit'](_0x44978e['limit']);}if(_0x44978e[_0x5a75('0x50')]){_0x31702a[_0x5a75('0x50')](_0x44978e[_0x5a75('0x50')]);}}_0x4a4a76[_0x5a75('0x51')](_0x371fed);if(_0x44978e['order']){_0x44978e['order'][_0x5a75('0x19')](function(_0xdb7f41){_0x31702a['order']('c.'+_0xdb7f41[0x0],_0xdb7f41[0x1]==='DESC'?![]:!![]);_0x4a4a76[_0x5a75('0x52')]('subqry.'+_0xdb7f41[0x0],_0xdb7f41[0x1]==='DESC'?![]:!![]);});}_0x4a4a76['from'](_0x31702a,_0x5a75('0xa'));return _0x4a4a76;}function getFilteredContacts(_0x4dd7b6){var _0x4469d7=[];return db[_0x5a75('0x36')]['findAll']({'attributes':['id',_0x5a75('0x2c'),_0x5a75('0x53')],'raw':!![]})[_0x5a75('0x47')](function(_0x32d751){_0x4469d7=_['keyBy'](_0x32d751,'id');var _0x58b58e={'type':db['Sequelize'][_0x5a75('0x54')][_0x5a75('0x55')],'model':db[_0x5a75('0x56')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5a75('0x57')][_0x5a75('0x58')](_0x4dd7b6['toString'](),_0x58b58e);})[_0x5a75('0x47')](function(_0x4cf6c8){_0x4cf6c8['forEach'](function(_0x16f180){if(_0x16f180[_0x5a75('0x16')]){_0x16f180[_0x5a75('0x59')]=[];_0x16f180['TagIds']['split'](',')[_0x5a75('0x19')](function(_0x21ff72){_0x16f180[_0x5a75('0x59')][_0x5a75('0x18')](_0x4469d7[_0x21ff72]);});}delete _0x16f180[_0x5a75('0x16')];});return _0x4cf6c8;});}function countFilteredContacts(_0x424724,_0x54af8f){var _0x5bd220=_0x424724['clone']();_0x5bd220['field'](_0x5a75('0x5a'));_0x5bd220=applyJoinClauses(_0x5bd220,!![]);_0x424724['group'](_0x5a75('0x4e'));var _0xf354d8=utils[_0x5a75('0x1d')](_0x54af8f);if(!_[_0x5a75('0x5b')](_0xf354d8)){_0x5bd220['where'](_0x5a75('0x5c'),_0xf354d8);}var _0x313e48={'type':db[_0x5a75('0x5d')][_0x5a75('0x54')][_0x5a75('0x55')],'raw':!![]};return db[_0x5a75('0x57')][_0x5a75('0x58')](_0x5bd220['toString'](),_0x313e48)[_0x5a75('0x47')](function(_0x35de1f){return _0x35de1f[0x0][_0x5a75('0x5a')];});}module[_0x5a75('0x5e')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x78ae=['isEmpty','t.id\x20IN\x20?','toString','COUNT(*)','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','.id','firstName','lastName','phone','fax','createdAt','updatedAt','deletedAt','TagIds','includes','push','field','expr','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','fieldType','datetime','DATE','type','default','value','end','Tag','map','tags','clause','ids','user','and','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','then','fields','tag','filter','resolve','c.ListId\x20IS\x20NULL','c.id','limit','offset','subqry.id','having','order','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','Tags','clone','group'];(function(_0x22ada8,_0x23a7ea){var _0x506e36=function(_0xd6ed10){while(--_0xd6ed10){_0x22ada8['push'](_0x22ada8['shift']());}};_0x506e36(++_0x23a7ea);}(_0x78ae,0x68));var _0xe78a=function(_0x5670cb,_0xe6e20d){_0x5670cb=_0x5670cb-0x0;var _0x11dc29=_0x78ae[_0x5670cb];return _0x11dc29;};'use strict';var _=require('lodash');var squel=require(_0xe78a('0x0'));var as=require(_0xe78a('0x1'));var qs=require(_0xe78a('0x2'));var utils=require(_0xe78a('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x4507fb,_0x11db0b){var _0x1d45ee=![];if(_0x4507fb[_0xe78a('0x4')]===_0xe78a('0x5')&&!_0x11db0b[_0xe78a('0x6')]&&!_0x11db0b[_0xe78a('0x7')]&&_0x11db0b[_0xe78a('0x8')]!=='true'){_0x1d45ee=!![];}return _0x1d45ee;}function getContactsSubquery(){return squel[_0xe78a('0x9')]()[_0xe78a('0xa')](_0xe78a('0xb'),'c')[_0xe78a('0xc')](_0xe78a('0xd'));}function applyJoinClauses(_0x560d49,_0x12bcf0){var _0x18e289=_0x12bcf0?'c':_0xe78a('0xe');_0x560d49[_0xe78a('0xf')]('cm_user_has_contacts','uc',_0xe78a('0x10')+_0x18e289+'.id')[_0xe78a('0xf')](_0xe78a('0x11'),'ct','ct.CmContactId\x20=\x20'+_0x18e289+_0xe78a('0x12'))['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x560d49;}function addFieldsToQuery(_0x484a3f,_0x36ef87,_0x41f607,_0x1b7c2f,_0x5f0109){var _0x244477=_0x5f0109?'c':_0xe78a('0xe');if(!_0x36ef87){_0x36ef87=['id',_0xe78a('0x13'),_0xe78a('0x14'),_0xe78a('0x15'),'mobile',_0xe78a('0x16'),'email',_0xe78a('0x7'),'CompanyId',_0xe78a('0x17'),_0xe78a('0x18'),_0xe78a('0x19'),_0xe78a('0x1a')];}else if(!_0x36ef87[_0xe78a('0x1b')]('id')){_0x36ef87[_0xe78a('0x1c')]('id');}var _0x5f320d=_0x41f607&&_0x5f0109||!_0x41f607&&!_0x5f0109;if(_0x1b7c2f){_0x5f320d=_0x1b7c2f&&_0x5f0109||!_0x1b7c2f&&!_0x5f0109;}_0x36ef87['forEach'](function(_0x548e95){if(_0x548e95===_0xe78a('0x1a')){if(_0x5f320d){_0x484a3f['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x548e95);}else if(_0x41f607||_0x1b7c2f){_0x484a3f[_0xe78a('0x1d')](_0x244477+'.'+_0x548e95);}}else{_0x484a3f[_0xe78a('0x1d')](_0x244477+'.'+_0x548e95);}});return _0x484a3f;}function getSqlClauses(){var _0x2d1f84={'default':squel['expr'](),'fields':squel[_0xe78a('0x1e')](),'filter':squel['expr'](),'tags':{'clause':squel[_0xe78a('0x1e')](),'ids':null},'user':{'clause':squel[_0xe78a('0x1e')](),'skip':![]}};return _0x2d1f84;}function parseTagParameter(_0x253783){var _0x20a62c=squel[_0xe78a('0x1e')]();if(_0x253783){var _0x3cd1fa=utils['getSelectedTags'](_0x253783);_0x3cd1fa[_0xe78a('0x1f')](function(_0x3e6c2f){_0x20a62c['or'](_0xe78a('0x20'),'%,'+_0x3e6c2f+',%');});}return _0x20a62c;}function parseSearchFilter(_0x385959){var _0x4d6b93=squel['expr']();if(_0x385959){var _0x1240f8=_0x385959[_0xe78a('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x1240f8[_0xe78a('0x22')]('\x20')[_0xe78a('0x23')]>0x1){_0x4d6b93['or'](_0xe78a('0x24'),qs['getFullTextValue'](_0x1240f8),null);}else{if(qs['isNumeric'](_0x1240f8)){_0x4d6b93['or'](_0xe78a('0x25'),_0x1240f8+'%');_0x4d6b93['or'](_0xe78a('0x26'),_0x1240f8+'%');_0x4d6b93['or']('c.mobile\x20LIKE\x20?',_0x1240f8+'%');_0x4d6b93['or']('c.fax\x20LIKE\x20?',_0x1240f8+'%');}else if(qs[_0xe78a('0x27')](_0x1240f8)){_0x4d6b93['or'](_0xe78a('0x28'),_0x1240f8+'%');}else{_0x4d6b93['or'](_0xe78a('0x29'),'%'+_0x1240f8+'%');_0x4d6b93['or'](_0xe78a('0x2a'),'%'+_0x1240f8+'%');_0x4d6b93['or'](_0xe78a('0x28'),'%'+_0x1240f8+'%');}}}return _0x4d6b93;}function parseAdvancedSearchFilter(_0x21c23c,_0x492c95){var _0x4617d6=getSqlClauses();var _0x59ee39=as[_0xe78a('0x2b')](_0x21c23c);var _0x1f74da=_0x59ee39[_0xe78a('0x2c')];for(var _0x334ad8=0x0;_0x334ad8<_0x59ee39['conditions']['length'];_0x334ad8++){var _0x15ab2a=_0x59ee39[_0xe78a('0x2d')][_0x334ad8];var _0x8fc14c='c';var _0x2eb4bc=_[_0xe78a('0x2e')](_0x492c95,[_0xe78a('0x2f'),_0x15ab2a['field']]);if(_0x2eb4bc){if(_0x15ab2a['field']==='dateOfBirth'||_0x2eb4bc[_0xe78a('0x30')]===_0xe78a('0x31')){_0x15ab2a['castTo']=_0xe78a('0x32');}var _0x584fad=as['buildExpression'](_0x8fc14c,_0x2eb4bc[_0xe78a('0x33')],_0x15ab2a);_0x4617d6[_0xe78a('0x34')][_0x1f74da](_0x584fad['text'],_0x584fad[_0xe78a('0x35')]['start'],_0x584fad[_0xe78a('0x35')][_0xe78a('0x36')]);}else{if(_0x15ab2a['field']===_0xe78a('0x37')){var _0x1fc8d1=_0x15ab2a[_0xe78a('0x35')][_0xe78a('0x22')](',')[_0xe78a('0x38')](function(_0xb76a36){return Number(_0xb76a36);});var _0x5c58a6=parseTagParameter(_0x1fc8d1);_0x4617d6[_0xe78a('0x39')][_0xe78a('0x3a')]['and'](_0x5c58a6);_0x4617d6[_0xe78a('0x39')][_0xe78a('0x3b')]=_0x1fc8d1;}else if(_0x15ab2a['field']==='User'){_0x4617d6[_0xe78a('0x3c')]['clause'][_0xe78a('0x3d')](_0xe78a('0x3e'),_0x15ab2a[_0xe78a('0x35')]);_0x4617d6['user'][_0xe78a('0x3f')]=!![];}}}return _0x4617d6;}function parseModelFields(_0x2c72b2,_0x39e65d){var _0x592970=squel['expr']();var _0x4786ea=_(_0x2c72b2)[_0xe78a('0x40')]()[_0xe78a('0x38')](function(_0x45ffdc){return _[_0xe78a('0x41')](_0x39e65d,[_0xe78a('0x2f'),_0x45ffdc])?_0x45ffdc:undefined;})['compact']()[_0xe78a('0x35')]();if(_0x2c72b2['Contact']){_0x4786ea['push'](_0xe78a('0x42'));}if(_0x4786ea[_0xe78a('0x23')]>0x0){_0x4786ea[_0xe78a('0x1f')](function(_0x169afb){if(_0x169afb===_0xe78a('0x7')){_0x592970[_0xe78a('0x3d')](_0xe78a('0x43'),[][_0xe78a('0x44')](_0x2c72b2[_0x169afb]));}else if(_0x169afb===_0xe78a('0x42')){var _0x3c1c21='%'+_0x2c72b2[_0x169afb]+'%';_0x592970['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x3c1c21);}else{_0x592970[_0xe78a('0x3d')]('c.'+_0x169afb+_0xe78a('0x45'),_0x2c72b2[_0x169afb]);}});}return _0x592970;}function parseQueryParameters(_0x4182b2,_0x215882){var _0x5298b7=getSqlClauses();return Promise['resolve']()[_0xe78a('0x46')](function(){return parseModelFields(_0x4182b2,_0x215882);})[_0xe78a('0x46')](function(_0x4027a4){_0x5298b7[_0xe78a('0x47')][_0xe78a('0x3d')](_0x4027a4);return parseTagParameter(_0x4182b2[_0xe78a('0x48')]);})[_0xe78a('0x46')](function(_0x5b28d1){_0x5298b7[_0xe78a('0x39')][_0xe78a('0x3a')]['and'](_0x5b28d1);return parseSearchFilter(_0x4182b2[_0xe78a('0x49')]);})[_0xe78a('0x46')](function(_0x175f84){_0x5298b7['filter']=_0x175f84;return _0x5298b7;});}function checkListsRestrictions(_0x534203,_0x443760,_0x1a7fcc){var _0x44c54b=squel[_0xe78a('0x1e')]();return Promise[_0xe78a('0x4a')]()[_0xe78a('0x46')](function(){if(_0x443760[_0xe78a('0x6')]&&_0x534203['role']===_0xe78a('0x5')&&!_0x1a7fcc){return _0x534203['getLists']({'attributes':['id'],'raw':!![]});}})[_0xe78a('0x46')](function(_0x3cd009){if(_0x3cd009){if(_0x3cd009[_0xe78a('0x23')]===0x0){_0x44c54b[_0xe78a('0x3d')](_0xe78a('0x4b'));}else{_0x44c54b[_0xe78a('0x3d')](_0xe78a('0x43'),_[_0xe78a('0x38')](_0x3cd009,'id'));}}})[_0xe78a('0x46')](function(){return _0x44c54b;});}function buildContactsQuery(_0x2ab1c1,_0x2a31ea,_0x1cf4a5,_0x3c3305,_0x2ebab9,_0x16b877){if(_0x2a31ea){_0x2a31ea=_0x1cf4a5['attributes'];}_0x2ab1c1=addFieldsToQuery(_0x2ab1c1,_0x2a31ea,_0x3c3305,_0x16b877,!![]);var _0x18eff9=squel['select']();_0x18eff9=addFieldsToQuery(_0x18eff9,_0x2a31ea,_0x3c3305,_0x16b877,![]);if(_0x3c3305||_0x16b877){_0x2ab1c1=applyJoinClauses(_0x2ab1c1,!![]);_0x2ab1c1['group'](_0xe78a('0x4c'));if(_0x1cf4a5[_0xe78a('0x4d')]){_0x18eff9[_0xe78a('0x4d')](_0x1cf4a5[_0xe78a('0x4d')]);}if(_0x1cf4a5['offset']){_0x18eff9[_0xe78a('0x4e')](_0x1cf4a5[_0xe78a('0x4e')]);}}else{_0x18eff9=applyJoinClauses(_0x18eff9,![]);_0x18eff9['group'](_0xe78a('0x4f'));if(_0x1cf4a5[_0xe78a('0x4d')]){_0x2ab1c1['limit'](_0x1cf4a5[_0xe78a('0x4d')]);}if(_0x1cf4a5[_0xe78a('0x4e')]){_0x2ab1c1[_0xe78a('0x4e')](_0x1cf4a5[_0xe78a('0x4e')]);}}_0x18eff9[_0xe78a('0x50')](_0x2ebab9);if(_0x1cf4a5['order']){_0x1cf4a5['order'][_0xe78a('0x1f')](function(_0x1a78de){_0x2ab1c1[_0xe78a('0x51')]('c.'+_0x1a78de[0x0],_0x1a78de[0x1]==='DESC'?![]:!![]);_0x18eff9[_0xe78a('0x51')](_0xe78a('0x52')+_0x1a78de[0x0],_0x1a78de[0x1]==='DESC'?![]:!![]);});}_0x18eff9[_0xe78a('0xa')](_0x2ab1c1,_0xe78a('0xe'));return _0x18eff9;}function getFilteredContacts(_0x18e8fd){var _0x3c1193=[];return db[_0xe78a('0x37')][_0xe78a('0x53')]({'attributes':['id',_0xe78a('0x2f'),_0xe78a('0x54')],'raw':!![]})[_0xe78a('0x46')](function(_0x3dfc9b){_0x3c1193=_[_0xe78a('0x55')](_0x3dfc9b,'id');var _0x3d86f6={'type':db[_0xe78a('0x56')][_0xe78a('0x57')][_0xe78a('0x58')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xe78a('0x59')][_0xe78a('0x5a')](_0x18e8fd['toString'](),_0x3d86f6);})[_0xe78a('0x46')](function(_0x3546bd){_0x3546bd[_0xe78a('0x1f')](function(_0x5c9606){if(_0x5c9606[_0xe78a('0x1a')]){_0x5c9606[_0xe78a('0x5b')]=[];_0x5c9606['TagIds']['split'](',')[_0xe78a('0x1f')](function(_0xa06a9e){_0x5c9606[_0xe78a('0x5b')][_0xe78a('0x1c')](_0x3c1193[_0xa06a9e]);});}delete _0x5c9606[_0xe78a('0x1a')];});return _0x3546bd;});}function countFilteredContacts(_0x672558,_0x1c0aaf){var _0x723965=_0x672558[_0xe78a('0x5c')]();_0x723965[_0xe78a('0x1d')]('COUNT(*)');_0x723965=applyJoinClauses(_0x723965,!![]);_0x672558[_0xe78a('0x5d')](_0xe78a('0x4c'));var _0x128363=utils['getSelectedTags'](_0x1c0aaf);if(!_[_0xe78a('0x5e')](_0x128363)){_0x723965[_0xe78a('0xc')](_0xe78a('0x5f'),_0x128363);}var _0x46ef23={'type':db[_0xe78a('0x56')][_0xe78a('0x57')][_0xe78a('0x58')],'raw':!![]};return db[_0xe78a('0x59')][_0xe78a('0x5a')](_0x723965[_0xe78a('0x60')](),_0x46ef23)[_0xe78a('0x46')](function(_0x16ca43){return _0x16ca43[0x0][_0xe78a('0x61')];});}module[_0xe78a('0x62')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b650278..b549ae9 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 _0x638b=['bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','binary','write','end','final','close','secret','update','utf8','base64','decryptString','createDecipher','crypto'];(function(_0x1fd9d8,_0x3eee6e){var _0x48d050=function(_0x4a42e3){while(--_0x4a42e3){_0x1fd9d8['push'](_0x1fd9d8['shift']());}};_0x48d050(++_0x3eee6e);}(_0x638b,0x192));var _0xb638=function(_0x436f2c,_0x36ade1){_0x436f2c=_0x436f2c-0x0;var _0x5d6cb2=_0x638b[_0x436f2c];return _0x5d6cb2;};'use strict';var crypto=require(_0xb638('0x0'));var fs=require('fs');var BPromise=require(_0xb638('0x1'));var _=require(_0xb638('0x2'));var config=require(_0xb638('0x3'));var logger=require(_0xb638('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb638('0x5')][_0xb638('0x6')],'algorithm':_0xb638('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xb638('0x8')][_0xb638('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xb638('0x9')]=config[_0xb638('0x8')][_0xb638('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config['encrypt']['algorithm'],_0xb638('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x58305a){return AES_SUPPORTED_RX[_0xb638('0xb')](_0x58305a);}function getSupportedCiphers(){return crypto[_0xb638('0xc')]()[_0xb638('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x54ecaa){return getSupportedCiphers()[_0xb638('0xe')](_0x54ecaa)>-0x1;}function combineOptions(_0x149462){var _0x4cdae1={};for(var _0x5673e8 in fileOptions){if(fileOptions[_0xb638('0xf')](_0x5673e8)){_0x4cdae1[_0x5673e8]=fileOptions[_0x5673e8];}}if(_0x149462){for(var _0x117760 in _0x149462){if(_0x149462[_0xb638('0xf')](_0x117760)){_0x4cdae1[_0x117760]=_0x149462[_0x117760];}}}return _0x4cdae1;}exports[_0xb638('0x10')]=function(_0x5a5cde,_0x2946b2,_0x4c79ce,_0x494a50){return new BPromise(function(_0x5e1a05,_0x1e6af8){_0x494a50=combineOptions(_0x494a50);var _0x382426=new Buffer(_0x4c79ce);var _0x3a4afc=fs[_0xb638('0x11')](_0x5a5cde);var _0x21f5c4=fs['createWriteStream'](_0x2946b2);var _0x5184f6=crypto[_0xb638('0x12')](_0x494a50[_0xb638('0x9')],_0x382426);_0x3a4afc['on'](_0xb638('0x13'),function(_0x163235){var _0x5ae969=new Buffer(_0x5184f6['update'](_0x163235),_0xb638('0x14'));_0x21f5c4[_0xb638('0x15')](_0x5ae969);});_0x3a4afc['on'](_0xb638('0x16'),function(){try{var _0x5814cf=new Buffer(_0x5184f6[_0xb638('0x17')](_0xb638('0x14')),_0xb638('0x14'));_0x21f5c4[_0xb638('0x15')](_0x5814cf);_0x21f5c4[_0xb638('0x16')]();_0x21f5c4['on'](_0xb638('0x18'),function(){return _0x5e1a05(_0x2946b2);});}catch(_0x20fbb7){fs['unlink'](_0x2946b2);return _0x1e6af8(_0x20fbb7);}});});};exports['decryptFile']=function(_0x1a3b29,_0x3b9bfd,_0x5aabed,_0x34e162){return new BPromise(function(_0xa183b4,_0x1dad69){_0x34e162=combineOptions(_0x34e162);var _0x39dea6=new Buffer(_0x5aabed);var _0x6ab966=fs['createReadStream'](_0x1a3b29);var _0x5e7eda=fs['createWriteStream'](_0x3b9bfd);var _0x34c3c3=crypto['createDecipher'](_0x34e162['algorithm'],_0x39dea6);_0x6ab966['on']('data',function(_0x3f06f4){var _0x30502d=new Buffer(_0x34c3c3['update'](_0x3f06f4),'binary');_0x5e7eda['write'](_0x30502d);});_0x6ab966['on']('end',function(){try{var _0x753902=new Buffer(_0x34c3c3['final'](_0xb638('0x14')),_0xb638('0x14'));_0x5e7eda[_0xb638('0x15')](_0x753902);_0x5e7eda[_0xb638('0x16')]();_0x5e7eda['on']('close',function(){return _0xa183b4(_0x3b9bfd);});}catch(_0x344e19){fs['unlink'](_0x3b9bfd);return _0x1dad69(_0x344e19);}});});};exports['encryptString']=function(_0x1d5637,_0x378031,_0x1ff740){var _0x1d28cd=_0x1ff740||stringOptions[_0xb638('0x9')];var _0x5b2bf7=_0x378031||stringOptions[_0xb638('0x19')];var _0x3877d9=crypto[_0xb638('0x12')](_0x1d28cd,_0x5b2bf7);var _0x449c39=_0x3877d9[_0xb638('0x1a')](_0x1d5637,_0xb638('0x1b'),'base64');_0x449c39+=_0x3877d9['final'](_0xb638('0x1c'));return _0x449c39;};exports[_0xb638('0x1d')]=function(_0x4df3c2,_0x57292c,_0x439faf){var _0x342151=_0x439faf||stringOptions[_0xb638('0x9')];var _0x1a93ab=_0x57292c||stringOptions[_0xb638('0x19')];var _0x209044=crypto[_0xb638('0x1e')](_0x342151,_0x1a93ab);var _0x233af0=_0x209044[_0xb638('0x1a')](_0x4df3c2,'base64','utf8');_0x233af0+=_0x209044[_0xb638('0x17')](_0xb638('0x1b'));return _0x233af0;}; \ No newline at end of file +var _0x9cd7=['../../config/logger','app','session','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','bluebird','lodash','../../config/environment'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x9cd7,0x168));var _0x79cd=function(_0x6866e3,_0x3ddb25){_0x6866e3=_0x6866e3-0x0;var _0x394cfe=_0x9cd7[_0x6866e3];return _0x394cfe;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x79cd('0x0'));var _=require(_0x79cd('0x1'));var config=require(_0x79cd('0x2'));var logger=require(_0x79cd('0x3'))(_0x79cd('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x79cd('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x79cd('0x6')]&&config[_0x79cd('0x6')][_0x79cd('0x7')]){var isSupported=isAlgorithmSupported(config[_0x79cd('0x6')][_0x79cd('0x7')]);if(isSupported){fileOptions[_0x79cd('0x7')]=config['encrypt'][_0x79cd('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x79cd('0x8')](config[_0x79cd('0x6')][_0x79cd('0x7')],_0x79cd('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x2994b4){return AES_SUPPORTED_RX[_0x79cd('0xa')](_0x2994b4);}function getSupportedCiphers(){return crypto[_0x79cd('0xb')]()[_0x79cd('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0xb997b2){return getSupportedCiphers()[_0x79cd('0xd')](_0xb997b2)>-0x1;}function combineOptions(_0x16c3c4){var _0x3b08dd={};for(var _0x4b5fc8 in fileOptions){if(fileOptions[_0x79cd('0xe')](_0x4b5fc8)){_0x3b08dd[_0x4b5fc8]=fileOptions[_0x4b5fc8];}}if(_0x16c3c4){for(var _0x35741c in _0x16c3c4){if(_0x16c3c4[_0x79cd('0xe')](_0x35741c)){_0x3b08dd[_0x35741c]=_0x16c3c4[_0x35741c];}}}return _0x3b08dd;}exports[_0x79cd('0xf')]=function(_0xc15479,_0x2e6ba6,_0x4e16af,_0x1d4e6e){return new BPromise(function(_0x41bac3,_0x110e34){_0x1d4e6e=combineOptions(_0x1d4e6e);var _0x1af7de=new Buffer(_0x4e16af);var _0x2267f7=fs[_0x79cd('0x10')](_0xc15479);var _0x397e93=fs[_0x79cd('0x11')](_0x2e6ba6);var _0x1d9b14=crypto[_0x79cd('0x12')](_0x1d4e6e[_0x79cd('0x7')],_0x1af7de);_0x2267f7['on'](_0x79cd('0x13'),function(_0x84d24a){var _0xc0952c=new Buffer(_0x1d9b14[_0x79cd('0x14')](_0x84d24a),_0x79cd('0x15'));_0x397e93[_0x79cd('0x16')](_0xc0952c);});_0x2267f7['on'](_0x79cd('0x17'),function(){try{var _0x5cc489=new Buffer(_0x1d9b14[_0x79cd('0x18')](_0x79cd('0x15')),_0x79cd('0x15'));_0x397e93[_0x79cd('0x16')](_0x5cc489);_0x397e93['end']();_0x397e93['on'](_0x79cd('0x19'),function(){return _0x41bac3(_0x2e6ba6);});}catch(_0x157c6e){fs[_0x79cd('0x1a')](_0x2e6ba6);return _0x110e34(_0x157c6e);}});});};exports[_0x79cd('0x1b')]=function(_0x1e04be,_0xbe2c9e,_0x529cd6,_0x1aa3a1){return new BPromise(function(_0x17b41a,_0x21c6c4){_0x1aa3a1=combineOptions(_0x1aa3a1);var _0x32aa08=new Buffer(_0x529cd6);var _0x4ca0ae=fs[_0x79cd('0x10')](_0x1e04be);var _0x1989fa=fs[_0x79cd('0x11')](_0xbe2c9e);var _0x4b1e34=crypto[_0x79cd('0x1c')](_0x1aa3a1[_0x79cd('0x7')],_0x32aa08);_0x4ca0ae['on'](_0x79cd('0x13'),function(_0xf66b32){var _0xb7ea6f=new Buffer(_0x4b1e34[_0x79cd('0x14')](_0xf66b32),'binary');_0x1989fa[_0x79cd('0x16')](_0xb7ea6f);});_0x4ca0ae['on'](_0x79cd('0x17'),function(){try{var _0x329a=new Buffer(_0x4b1e34[_0x79cd('0x18')](_0x79cd('0x15')),_0x79cd('0x15'));_0x1989fa[_0x79cd('0x16')](_0x329a);_0x1989fa[_0x79cd('0x17')]();_0x1989fa['on'](_0x79cd('0x19'),function(){return _0x17b41a(_0xbe2c9e);});}catch(_0x35f5cd){fs['unlink'](_0xbe2c9e);return _0x21c6c4(_0x35f5cd);}});});};exports[_0x79cd('0x1d')]=function(_0x56d364,_0x163b9c,_0x3bb2a0){var _0x4ae8d4=_0x3bb2a0||stringOptions[_0x79cd('0x7')];var _0x442e6a=_0x163b9c||stringOptions[_0x79cd('0x1e')];var _0x2dfd23=crypto[_0x79cd('0x12')](_0x4ae8d4,_0x442e6a);var _0x4be795=_0x2dfd23[_0x79cd('0x14')](_0x56d364,_0x79cd('0x1f'),_0x79cd('0x20'));_0x4be795+=_0x2dfd23[_0x79cd('0x18')]('base64');return _0x4be795;};exports['decryptString']=function(_0x2cbc8d,_0x21da26,_0x3ebfa9){var _0x55011c=_0x3ebfa9||stringOptions[_0x79cd('0x7')];var _0xf26669=_0x21da26||stringOptions[_0x79cd('0x1e')];var _0x7d1cdf=crypto[_0x79cd('0x1c')](_0x55011c,_0xf26669);var _0x10e1a7=_0x7d1cdf[_0x79cd('0x14')](_0x2cbc8d,_0x79cd('0x20'),_0x79cd('0x1f'));_0x10e1a7+=_0x7d1cdf[_0x79cd('0x18')](_0x79cd('0x1f'));return _0x10e1a7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 70d6f3b..c9f7695 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 _0x75f4=['csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','existsSync','join','each','%s%d.%s'];(function(_0x555258,_0x2a8eda){var _0x2b8872=function(_0x214dea){while(--_0x214dea){_0x555258['push'](_0x555258['shift']());}};_0x2b8872(++_0x2a8eda);}(_0x75f4,0xd4));var _0x475f=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x75f4[_0x2675da];return _0x5e6153;};'use strict';var util=require(_0x475f('0x0'));var path=require(_0x475f('0x1'));var _=require(_0x475f('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x475f('0x3'));var zipdir=require(_0x475f('0x4'));var rimraf=require('rimraf');var db=require(_0x475f('0x5'))['db'];var dbH=require(_0x475f('0x5'))[_0x475f('0x6')];var logger=require(_0x475f('0x7'))(_0x475f('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x475f('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5966e3,_0xfb0afa){var _0x5ecb4c={'status':_0x5966e3};var _0x4431c9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xfb0afa){_0x5ecb4c[_0x475f('0xa')]=_0xfb0afa;}return db[_0x475f('0xb')][_0x475f('0xc')](_0x5ecb4c,_0x4431c9);}function main(){var _0x5ef16a=0x1388;var _0xf35c26;logger['info'](util['format'](_0x475f('0xd'),EXTRACTED_REPORT_ID,_0x475f('0xe')));return db[_0x475f('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x475f('0x10'),_0x475f('0x11')]})[_0x475f('0x12')](function(_0x5032e7){if(_0x5032e7){_0xf35c26=_0x5032e7;_0x5ef16a=_0xf35c26[_0x475f('0x11')]||0x1388;}})['then'](function(){return dbH[_0x475f('0x13')][_0x475f('0x14')](util[_0x475f('0x15')](_0x475f('0x16'),QUERY),{'type':dbH[_0x475f('0x13')][_0x475f('0x17')][_0x475f('0x18')]});})[_0x475f('0x12')](function(_0x3385a3){if(!_0x3385a3[0x0][_0x475f('0x19')]){return analyticExtractedReport(_0x475f('0x1a'));}var _0x3f8917=[];var _0x580158=0x0;if(_0xf35c26[_0x475f('0x10')]){if(_0x3385a3&&_0x3385a3['length']){var _0xeba75f=_['range'](_0x3385a3[0x0][_0x475f('0x19')]/_0x5ef16a);var _0x219594=Number[_0x475f('0x1b')](_0x3385a3[0x0]['num']/_0x5ef16a)?_0x3385a3[0x0][_0x475f('0x19')]%_0x5ef16a:0x0;_0xeba75f[_0x475f('0x1c')](function(_0x4ae890){if(_0x4ae890>0x0){_0x580158+=_0x5ef16a;}_0x3f8917[_0x475f('0x1d')](dbH[_0x475f('0x13')]['query'](util[_0x475f('0x15')](_0x475f('0x1e'),QUERY,_0x5ef16a,_0x580158),{'type':dbH[_0x475f('0x13')]['QueryTypes'][_0x475f('0x18')]}));});if(_0x219594>0x0){_0x580158+=_0x5ef16a;_0x3f8917[_0x475f('0x1d')](dbH[_0x475f('0x13')][_0x475f('0x14')](util['format'](_0x475f('0x1e'),QUERY,_0x219594,_0x580158),{'type':dbH[_0x475f('0x13')][_0x475f('0x17')][_0x475f('0x18')]}));}}}else{_0x3f8917[_0x475f('0x1d')](dbH[_0x475f('0x13')][_0x475f('0x14')](QUERY,{'type':dbH[_0x475f('0x13')][_0x475f('0x17')][_0x475f('0x18')]}));}var _0x1a1f08=path[_0x475f('0x1f')](PATH);var _0x3c9cac=path[_0x475f('0x20')](PATH,'.csv');var _0x594afd=_0xf35c26[_0x475f('0x10')]&&_0x3f8917[_0x475f('0x21')]>0x1;var _0x6d2115=[];if(!fs[_0x475f('0x22')](path[_0x475f('0x23')](_0x1a1f08,_0x3c9cac))&&_0x594afd){fs['mkdirSync'](path['join'](_0x1a1f08,_0x3c9cac));}return BPromise[_0x475f('0x24')](_0x3f8917,function(_0x20205b){_0x6d2115[_0x475f('0x1d')](_0x20205b);})[_0x475f('0x12')](function(){for(var _0x37b863=0x0;_0x37b863<_0x6d2115[_0x475f('0x21')];_0x37b863+=0x1){var _0x2fb0ae;var _0x4baee8=_0x6d2115[_0x37b863];if(_0x594afd){_0x2fb0ae=path[_0x475f('0x23')](_0x1a1f08,_0x3c9cac,util[_0x475f('0x15')](_0x475f('0x25'),_0x3c9cac,_0x37b863,_0x475f('0x26')));}else{_0x2fb0ae=path[_0x475f('0x23')](_0x1a1f08,util[_0x475f('0x15')](_0x475f('0x27'),_0x3c9cac,'csv'));}fs[_0x475f('0x28')](_0x2fb0ae,csv(_0x4baee8));}})['then'](function(){if(_0x594afd){return new Promise(function(_0x4cc098){zipdir(path[_0x475f('0x23')](_0x1a1f08,_0x3c9cac),{'saveTo':path['join'](_0x1a1f08,util['format'](_0x475f('0x27'),_0x3c9cac,_0x475f('0x29')))},function(_0x3a0976,_0x4f2184){rimraf(path['join'](_0x1a1f08,_0x3c9cac),function(){});_0x4cc098('zip\x20finished');});});}})['then'](function(){logger['info'](util['format'](_0x475f('0x2a'),EXTRACTED_REPORT_ID,_0x475f('0xe')));return analyticExtractedReport(_0x475f('0x2b'),_0x594afd?util[_0x475f('0x15')](_0x475f('0x27'),_0x3c9cac,_0x594afd?'zip':'csv'):null);});})[_0x475f('0x2c')](function(_0x29d724){logger[_0x475f('0x2d')](util['format'](_0x475f('0x2e'),EXTRACTED_REPORT_ID,_0x475f('0xe')),util[_0x475f('0x2f')](_0x29d724,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x475f('0x30'));})['finally'](function(){process[_0x475f('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2299=['existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Failed','exit','util','path','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename'];(function(_0x459b22,_0x2c15ec){var _0x9bf67d=function(_0x3c1d48){while(--_0x3c1d48){_0x459b22['push'](_0x459b22['shift']());}};_0x9bf67d(++_0x2c15ec);}(_0x2299,0xc6));var _0x9229=function(_0x4d364a,_0x1c6bf3){_0x4d364a=_0x4d364a-0x0;var _0x183a61=_0x2299[_0x4d364a];return _0x183a61;};'use strict';var util=require(_0x9229('0x0'));var path=require(_0x9229('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x9229('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x9229('0x3'));var db=require(_0x9229('0x4'))['db'];var dbH=require(_0x9229('0x4'))[_0x9229('0x5')];var logger=require(_0x9229('0x6'))(_0x9229('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9229('0x8')][0x2]);var QUERY=process[_0x9229('0x8')][0x3];var PATH=process[_0x9229('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1fa4a6,_0x218d54){var _0x28623e={'status':_0x1fa4a6};var _0x28ebcd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x218d54){_0x28623e['savename']=_0x218d54;}return db[_0x9229('0x9')][_0x9229('0xa')](_0x28623e,_0x28ebcd);}function main(){var _0x43ef32=0x1388;var _0x19e080;logger[_0x9229('0xb')](util[_0x9229('0xc')](_0x9229('0xd'),EXTRACTED_REPORT_ID,_0x9229('0xe')));return db[_0x9229('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9229('0x10'),_0x9229('0x11')]})[_0x9229('0x12')](function(_0x317372){if(_0x317372){_0x19e080=_0x317372;_0x43ef32=_0x19e080['splitSizeCsv']||0x1388;}})[_0x9229('0x12')](function(){return dbH[_0x9229('0x13')][_0x9229('0x14')](util[_0x9229('0xc')](_0x9229('0x15'),QUERY),{'type':dbH[_0x9229('0x13')][_0x9229('0x16')][_0x9229('0x17')]});})[_0x9229('0x12')](function(_0x3ae438){if(!_0x3ae438[0x0][_0x9229('0x18')]){return analyticExtractedReport(_0x9229('0x19'));}var _0x51ee05=[];var _0x3349d2=0x0;if(_0x19e080[_0x9229('0x10')]){if(_0x3ae438&&_0x3ae438[_0x9229('0x1a')]){var _0x155232=_[_0x9229('0x1b')](_0x3ae438[0x0][_0x9229('0x18')]/_0x43ef32);var _0x2a30d1=Number[_0x9229('0x1c')](_0x3ae438[0x0][_0x9229('0x18')]/_0x43ef32)?_0x3ae438[0x0][_0x9229('0x18')]%_0x43ef32:0x0;_0x155232['forEach'](function(_0xa8447e){if(_0xa8447e>0x0){_0x3349d2+=_0x43ef32;}_0x51ee05[_0x9229('0x1d')](dbH[_0x9229('0x13')][_0x9229('0x14')](util[_0x9229('0xc')](_0x9229('0x1e'),QUERY,_0x43ef32,_0x3349d2),{'type':dbH[_0x9229('0x13')][_0x9229('0x16')][_0x9229('0x17')]}));});if(_0x2a30d1>0x0){_0x3349d2+=_0x43ef32;_0x51ee05[_0x9229('0x1d')](dbH[_0x9229('0x13')][_0x9229('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2a30d1,_0x3349d2),{'type':dbH[_0x9229('0x13')][_0x9229('0x16')][_0x9229('0x17')]}));}}}else{_0x51ee05['push'](dbH[_0x9229('0x13')][_0x9229('0x14')](QUERY,{'type':dbH[_0x9229('0x13')][_0x9229('0x16')][_0x9229('0x17')]}));}var _0x193947=path['dirname'](PATH);var _0x4fc69b=path[_0x9229('0x1f')](PATH,'.csv');var _0x46f00b=_0x19e080[_0x9229('0x10')]&&_0x51ee05[_0x9229('0x1a')]>0x1;var _0x2d0c0f=[];if(!fs[_0x9229('0x20')](path[_0x9229('0x21')](_0x193947,_0x4fc69b))&&_0x46f00b){fs[_0x9229('0x22')](path[_0x9229('0x21')](_0x193947,_0x4fc69b));}return BPromise[_0x9229('0x23')](_0x51ee05,function(_0x5cd765){_0x2d0c0f['push'](_0x5cd765);})['then'](function(){for(var _0x369393=0x0;_0x369393<_0x2d0c0f[_0x9229('0x1a')];_0x369393+=0x1){var _0x4cb9a4;var _0x32cfdb=_0x2d0c0f[_0x369393];if(_0x46f00b){_0x4cb9a4=path[_0x9229('0x21')](_0x193947,_0x4fc69b,util[_0x9229('0xc')](_0x9229('0x24'),_0x4fc69b,_0x369393,_0x9229('0x25')));}else{_0x4cb9a4=path[_0x9229('0x21')](_0x193947,util[_0x9229('0xc')](_0x9229('0x26'),_0x4fc69b,_0x9229('0x25')));}fs[_0x9229('0x27')](_0x4cb9a4,csv(_0x32cfdb));}})[_0x9229('0x12')](function(){if(_0x46f00b){return new Promise(function(_0x1debd4){zipdir(path[_0x9229('0x21')](_0x193947,_0x4fc69b),{'saveTo':path[_0x9229('0x21')](_0x193947,util['format'](_0x9229('0x26'),_0x4fc69b,_0x9229('0x28')))},function(_0x5848f3,_0x3e9f2a){rimraf(path[_0x9229('0x21')](_0x193947,_0x4fc69b),function(){});_0x1debd4(_0x9229('0x29'));});});}})[_0x9229('0x12')](function(){logger[_0x9229('0xb')](util[_0x9229('0xc')](_0x9229('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9229('0x2b'),_0x46f00b?util[_0x9229('0xc')](_0x9229('0x26'),_0x4fc69b,_0x46f00b?_0x9229('0x28'):'csv'):null);});})['catch'](function(_0x3ca2c9){logger[_0x9229('0xb')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9229('0xe')),util['inspect'](_0x3ca2c9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9229('0x2c'));})['finally'](function(){process[_0x9229('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index d2f248d..885bbde 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 _0x8db6=['zip\x20finished','info','PDF','Completed','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','push','body','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','format','header','margin','landscape','right','num','Empty','Setting','find','split','then','range','isInteger','forEach','query','sequelize','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf','zip'];(function(_0x4cbcd3,_0x3b59e5){var _0x5a6eaa=function(_0x288bc3){while(--_0x288bc3){_0x4cbcd3['push'](_0x4cbcd3['shift']());}};_0x5a6eaa(++_0x3b59e5);}(_0x8db6,0x1b0));var _0x68db=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x8db6[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x68db('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x68db('0x1'));var moment=require(_0x68db('0x2'));var htmlToPdfmake=require(_0x68db('0x3'));var PdfPrinter=require(_0x68db('0x4'));var zipdir=require(_0x68db('0x5'));var rimraf=require(_0x68db('0x6'));var JSDOM=require(_0x68db('0x7'))[_0x68db('0x8')];var window=new JSDOM('')[_0x68db('0x9')];var BPromise=require(_0x68db('0xa'));var db=require(_0x68db('0xb'))['db'];var dbH=require(_0x68db('0xb'))[_0x68db('0xc')];var logger=require('../../config/logger')(_0x68db('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x68db('0xe')][0x2]);var QUERY=process[_0x68db('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x68db('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x185746,_0x7c1826){var _0x2c1b56={'status':_0x185746};var _0x4f2c4e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x7c1826){_0x2c1b56['savename']=_0x7c1826;}return db[_0x68db('0xf')][_0x68db('0x10')](_0x2c1b56,_0x4f2c4e);}function getHeaders(_0x543dac){return _[_0x68db('0x11')](_0x543dac,function(_0x4c6226){return{'text':_0x4c6226,'style':_0x68db('0x12')};});}function getRows(_0x3389af,_0x5bc2e6){return _[_0x68db('0x11')](_0x5bc2e6,function(_0x5555fe){return _(_0x5555fe)[_0x68db('0x13')](_0x3389af)[_0x68db('0x11')](function(_0x454774){return _0x454774?_[_0x68db('0x14')](_0x454774):'';})[_0x68db('0x15')]();});}function createTable(_0x8f0f86,_0x5dc8ad){var _0x1c1b3e={'widths':_[_0x68db('0x16')](Array(_0x8f0f86[_0x68db('0x17')]),0x91),'heights':function(_0x3635de){return _0x3635de===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2aa2e8=getHeaders(_0x8f0f86);_0x1c1b3e['body'][_0x68db('0x18')](_0x2aa2e8);var _0x4694bc=getRows(_0x8f0f86,_0x5dc8ad);_0x1c1b3e[_0x68db('0x19')]=_0x1c1b3e[_0x68db('0x19')]['concat'](_0x4694bc);return _0x1c1b3e;}function createTables(_0x377393){var _0x50bc51=[];var _0x94bd76=_[_0x68db('0x1a')](Object['keys'](_0x377393[0x0]),0x5);_0x94bd76['forEach'](function(_0x1e9603){_0x50bc51[_0x68db('0x18')](createTable(_0x1e9603,_0x377393));});return _0x50bc51;}function getPDFDocDefinition(_0x7d6a57){var _0x296e4d=util['format'](_0x68db('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x68db('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x68db('0x1d')])[_0x68db('0x1e')](FORMAT));var _0x12f8fd=[];for(var _0x5dd76b=0x0;_0x5dd76b<_0x7d6a57[_0x68db('0x17')];_0x5dd76b++){var _0x1c5afc=[];if(_0x5dd76b===0x0){_0x1c5afc[_0x68db('0x18')]({'text':_0x296e4d,'style':_0x68db('0x1f')});}var _0x5ac54e={'table':_0x7d6a57[_0x5dd76b]};if(_0x5dd76b>0x0){_0x5ac54e['pageBreak']='before';_0x5ac54e[_0x68db('0x20')]=[0x0,0x46,0x0,0x0];}_0x1c5afc['push'](_0x5ac54e);_0x12f8fd[_0x68db('0x18')](_0x1c5afc);}return{'pageSize':'A4','pageOrientation':_0x68db('0x21'),'content':_0x12f8fd,'footer':function(_0x1472fe,_0x357b20){return{'text':_0x1472fe[_0x68db('0x14')]()+'\x20/\x20'+_0x357b20,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x68db('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a4e1a){var _0x1c8d17=0x1388;var _0x5f049b;if(!_0x3a4e1a[0x0][_0x68db('0x23')]){return analyticExtractedReport(_0x68db('0x24'));}return db[_0x68db('0x25')][_0x68db('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x68db('0x27'),'splitSizePdf']})['then'](function(_0x1b52b7){if(_0x1b52b7){_0x5f049b=_0x1b52b7;_0x1c8d17=_0x5f049b['splitSizePdf']||0x3e8;}})[_0x68db('0x28')](function(){var _0x5f2c5c=[];var _0x54633b=0x0;if(_0x5f049b[_0x68db('0x27')]){if(_0x3a4e1a&&_0x3a4e1a[_0x68db('0x17')]){var _0x18d02f=_[_0x68db('0x29')](_0x3a4e1a[0x0][_0x68db('0x23')]/_0x1c8d17);var _0x13b435=Number[_0x68db('0x2a')](_0x3a4e1a[0x0][_0x68db('0x23')]/_0x1c8d17)?_0x3a4e1a[0x0][_0x68db('0x23')]%_0x1c8d17:0x0;_0x18d02f[_0x68db('0x2b')](function(_0x590ca2){if(_0x590ca2>0x0){_0x54633b+=_0x1c8d17;}_0x5f2c5c[_0x68db('0x18')](dbH['sequelize'][_0x68db('0x2c')](util[_0x68db('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c8d17,_0x54633b),{'type':dbH[_0x68db('0x2d')][_0x68db('0x2e')]['SELECT']}));});if(_0x13b435>0x0){_0x54633b+=_0x1c8d17;_0x5f2c5c[_0x68db('0x18')](dbH['sequelize']['query'](util[_0x68db('0x1e')](_0x68db('0x2f'),QUERY,_0x13b435,_0x54633b),{'type':dbH[_0x68db('0x2d')][_0x68db('0x2e')]['SELECT']}));}}}else{_0x5f2c5c[_0x68db('0x18')](dbH[_0x68db('0x2d')][_0x68db('0x2c')](QUERY,{'type':dbH['sequelize'][_0x68db('0x2e')][_0x68db('0x30')]}));}var _0x5cb468=path['dirname'](PATH);var _0x2afea7=path[_0x68db('0x31')](PATH,_0x68db('0x32'));var _0x3c9da3=_0x5f049b['split']&&_0x5f2c5c['length']>0x1;var _0x43da6b=[];if(!fs[_0x68db('0x33')](path[_0x68db('0x34')](_0x5cb468,_0x2afea7))&&_0x3c9da3){fs[_0x68db('0x35')](path[_0x68db('0x34')](_0x5cb468,_0x2afea7));}return BPromise[_0x68db('0x36')](_0x5f2c5c,function(_0x119c9d){_0x43da6b[_0x68db('0x18')](_0x119c9d);})[_0x68db('0x28')](function(){var _0x45db93=[];for(var _0xaf92ae=0x0;_0xaf92ae<_0x43da6b[_0x68db('0x17')];_0xaf92ae+=0x1){var _0x5bbc67=_0x43da6b[_0xaf92ae];var _0x37efb8=createTables(_[_0x68db('0x37')](_0x5bbc67));var _0x52ac66;var _0x500cdb=getPDFDocDefinition(_0x37efb8);var _0x397d23=getPDFPrinter();var _0x1d924e=_0x397d23[_0x68db('0x38')](_0x500cdb);if(_0x3c9da3){_0x52ac66=path[_0x68db('0x34')](_0x5cb468,_0x2afea7,util[_0x68db('0x1e')]('%s%d.%s',_0x2afea7,_0xaf92ae,'pdf'));}else{_0x52ac66=path[_0x68db('0x34')](_0x5cb468,util['format'](_0x68db('0x39'),_0x2afea7,_0x68db('0x3a')));}_0x45db93['push'](writePDFDocument(_0x1d924e,_0x52ac66));}return Promise['all'](_0x45db93);})[_0x68db('0x28')](function(){if(_0x3c9da3){return new Promise(function(_0x27b5e5){zipdir(path[_0x68db('0x34')](_0x5cb468,_0x2afea7),{'saveTo':path[_0x68db('0x34')](_0x5cb468,util[_0x68db('0x1e')](_0x68db('0x39'),_0x2afea7,_0x68db('0x3b')))},function(){rimraf(path[_0x68db('0x34')](_0x5cb468,_0x2afea7),function(){});_0x27b5e5(_0x68db('0x3c'));});});}})['then'](function(){if(!_0x3c9da3)return;rimraf(path[_0x68db('0x34')](_0x5cb468,_0x2afea7),function(){});})[_0x68db('0x28')](function(){logger[_0x68db('0x3d')](util[_0x68db('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x68db('0x3e')));return analyticExtractedReport(_0x68db('0x3f'),_0x3c9da3?util['format']('%s.%s',_0x2afea7,_0x3c9da3?_0x68db('0x3b'):_0x68db('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x68db('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x68db('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xbab958){EXTRACTED_REPORT=_0xbab958;return dbH['sequelize'][_0x68db('0x2c')](util[_0x68db('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x68db('0x2d')][_0x68db('0x2e')][_0x68db('0x30')]});})[_0x68db('0x28')](extractReport)['catch'](function(_0x396e67){logger['info'](util[_0x68db('0x1e')](_0x68db('0x41'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x396e67,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x68db('0x42'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x27ca9e=new PdfPrinter({'Arial':{'normal':__dirname+_0x68db('0x43'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x68db('0x44'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x27ca9e;}function getPDFDocDefinitionFromHTML(_0x2606c7,_0x11247a){var _0x3b3fa4=util[_0x68db('0x1e')](_0x68db('0x45'),_0x11247a[_0x68db('0x46')],_0x11247a[_0x68db('0x47')]);var _0x962d38=moment()[_0x68db('0x1e')](_0x68db('0x48'))[_0x68db('0x14')]();var _0x24f7aa=htmlToPdfmake(_0x2606c7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x24f7aa],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x68db('0x49'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x68db('0x49'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x68db('0x49')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x132a57,_0x5bd6a0){return[{'text':util[_0x68db('0x1e')](_0x68db('0x4a'),_0x3b3fa4,_0x132a57,_0x5bd6a0,_0x962d38),'style':_0x68db('0x4b')}];}};}function writePDFDocument(_0x39eb8d,_0x1108f3){return new Promise(function(_0x39a568,_0x3d79b4){var _0x32f462=_0x39eb8d[_0x68db('0x4c')](fs[_0x68db('0x4d')](_0x1108f3));_0x32f462['on'](_0x68db('0x4e'),function(){_0x39a568(_0x68db('0x4e'));});_0x32f462['on'](_0x68db('0x4f'),function(_0xb42655){_0x3d79b4(_0xb42655);});_0x39eb8d[_0x68db('0x50')]();});}exports[_0x68db('0x51')]=function(_0x25f514,_0x5b5261){var _0x236c87=getPDFPrinter();var _0x4ee561=getPDFDocDefinitionFromHTML(_0x25f514,_0x5b5261);var _0x3f559e=_0x236c87[_0x68db('0x38')](_0x4ee561);return writePDFDocument(_0x3f559e,_0x5b5261[_0x68db('0x1')])['catch'](function(_0x347404){throw _0x347404;});}; \ No newline at end of file +var _0xff5b=['PDF','Completed','findOne','query','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','window','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','fill','length','auto','push','body','concat','chunk','keys','format','endDate','header','before','margin','toString','\x20/\x20','footer','Arial','black','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x3f3835,_0x2eeb82){var _0x172bba=function(_0x5da44f){while(--_0x5da44f){_0x3f3835['push'](_0x3f3835['shift']());}};_0x172bba(++_0x2eeb82);}(_0xff5b,0x6e));var _0xbff5=function(_0x26738f,_0x14a02d){_0x26738f=_0x26738f-0x0;var _0x19b92b=_0xff5b[_0x26738f];return _0x19b92b;};'use strict';var _=require(_0xbff5('0x0'));var fs=require('fs');var util=require(_0xbff5('0x1'));var path=require(_0xbff5('0x2'));var moment=require(_0xbff5('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xbff5('0x4'));var zipdir=require(_0xbff5('0x5'));var rimraf=require('rimraf');var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xbff5('0x6')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0xbff5('0x7'))['dbH'];var logger=require(_0xbff5('0x8'))(_0xbff5('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xbff5('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbff5('0xa')][0x4];var NAME=process[_0xbff5('0xa')][0x5];var FORMAT=_0xbff5('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e9fc2,_0xa2c5b9){var _0x4b2c88={'status':_0x3e9fc2};var _0x4bacad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa2c5b9){_0x4b2c88['savename']=_0xa2c5b9;}return db[_0xbff5('0xc')][_0xbff5('0xd')](_0x4b2c88,_0x4bacad);}function getHeaders(_0x3af936){return _[_0xbff5('0xe')](_0x3af936,function(_0x40fe12){return{'text':_0x40fe12,'style':_0xbff5('0xf')};});}function getRows(_0xdee26c,_0x4fc159){return _['map'](_0x4fc159,function(_0x55d0cc){return _(_0x55d0cc)['pick'](_0xdee26c)[_0xbff5('0xe')](function(_0x24c6cd){return _0x24c6cd?_['toString'](_0x24c6cd):'';})['value']();});}function createTable(_0x8a9d8e,_0x46432b){var _0x5873d8={'widths':_[_0xbff5('0x10')](Array(_0x8a9d8e[_0xbff5('0x11')]),0x91),'heights':function(_0x5d2287){return _0x5d2287===0x0?_0xbff5('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x326e58=getHeaders(_0x8a9d8e);_0x5873d8['body'][_0xbff5('0x13')](_0x326e58);var _0x5d254d=getRows(_0x8a9d8e,_0x46432b);_0x5873d8[_0xbff5('0x14')]=_0x5873d8['body'][_0xbff5('0x15')](_0x5d254d);return _0x5873d8;}function createTables(_0x26f644){var _0x4511b2=[];var _0xc48c32=_[_0xbff5('0x16')](Object[_0xbff5('0x17')](_0x26f644[0x0]),0x5);_0xc48c32['forEach'](function(_0x3adf84){_0x4511b2['push'](createTable(_0x3adf84,_0x26f644));});return _0x4511b2;}function getPDFDocDefinition(_0x19029c){var _0x2cd391=util[_0xbff5('0x18')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xbff5('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0xbff5('0x19')])[_0xbff5('0x18')](FORMAT));var _0x29c4cf=[];for(var _0x50c41c=0x0;_0x50c41c<_0x19029c[_0xbff5('0x11')];_0x50c41c++){var _0x5eaa92=[];if(_0x50c41c===0x0){_0x5eaa92[_0xbff5('0x13')]({'text':_0x2cd391,'style':_0xbff5('0x1a')});}var _0x245567={'table':_0x19029c[_0x50c41c]};if(_0x50c41c>0x0){_0x245567['pageBreak']=_0xbff5('0x1b');_0x245567[_0xbff5('0x1c')]=[0x0,0x46,0x0,0x0];}_0x5eaa92[_0xbff5('0x13')](_0x245567);_0x29c4cf[_0xbff5('0x13')](_0x5eaa92);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x29c4cf,'footer':function(_0x5153c3,_0x1a4578){return{'text':_0x5153c3[_0xbff5('0x1d')]()+_0xbff5('0x1e')+_0x1a4578,'style':_0xbff5('0x1f')};},'defaultStyle':{'font':_0xbff5('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbff5('0x21')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x37e454){var _0x520566=0x1388;var _0x4b0de5;if(!_0x37e454[0x0][_0xbff5('0x22')]){return analyticExtractedReport(_0xbff5('0x23'));}return db[_0xbff5('0x24')][_0xbff5('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbff5('0x26'),_0xbff5('0x27')]})[_0xbff5('0x28')](function(_0x3f6c74){if(_0x3f6c74){_0x4b0de5=_0x3f6c74;_0x520566=_0x4b0de5[_0xbff5('0x27')]||0x3e8;}})['then'](function(){var _0xc383cd=[];var _0x428c4f=0x0;if(_0x4b0de5[_0xbff5('0x26')]){if(_0x37e454&&_0x37e454['length']){var _0xde57da=_[_0xbff5('0x29')](_0x37e454[0x0]['num']/_0x520566);var _0xfb1792=Number[_0xbff5('0x2a')](_0x37e454[0x0][_0xbff5('0x22')]/_0x520566)?_0x37e454[0x0][_0xbff5('0x22')]%_0x520566:0x0;_0xde57da[_0xbff5('0x2b')](function(_0x1592bb){if(_0x1592bb>0x0){_0x428c4f+=_0x520566;}_0xc383cd['push'](dbH[_0xbff5('0x2c')]['query'](util['format'](_0xbff5('0x2d'),QUERY,_0x520566,_0x428c4f),{'type':dbH['sequelize'][_0xbff5('0x2e')][_0xbff5('0x2f')]}));});if(_0xfb1792>0x0){_0x428c4f+=_0x520566;_0xc383cd[_0xbff5('0x13')](dbH[_0xbff5('0x2c')]['query'](util[_0xbff5('0x18')](_0xbff5('0x2d'),QUERY,_0xfb1792,_0x428c4f),{'type':dbH[_0xbff5('0x2c')][_0xbff5('0x2e')][_0xbff5('0x2f')]}));}}}else{_0xc383cd[_0xbff5('0x13')](dbH[_0xbff5('0x2c')]['query'](QUERY,{'type':dbH[_0xbff5('0x2c')][_0xbff5('0x2e')][_0xbff5('0x2f')]}));}var _0x42d70c=path['dirname'](PATH);var _0x5b8bad=path[_0xbff5('0x30')](PATH,_0xbff5('0x31'));var _0x37de8c=_0x4b0de5[_0xbff5('0x26')]&&_0xc383cd['length']>0x1;var _0x57cc3b=[];if(!fs[_0xbff5('0x32')](path['join'](_0x42d70c,_0x5b8bad))&&_0x37de8c){fs[_0xbff5('0x33')](path[_0xbff5('0x34')](_0x42d70c,_0x5b8bad));}return BPromise[_0xbff5('0x35')](_0xc383cd,function(_0x3d8172){_0x57cc3b[_0xbff5('0x13')](_0x3d8172);})[_0xbff5('0x28')](function(){var _0x5db553=[];for(var _0x12c533=0x0;_0x12c533<_0x57cc3b[_0xbff5('0x11')];_0x12c533+=0x1){var _0x1c8f58=_0x57cc3b[_0x12c533];var _0x122e1a=createTables(_[_0xbff5('0x36')](_0x1c8f58));var _0x2f00ea;var _0x4fc034=getPDFDocDefinition(_0x122e1a);var _0x4f2161=getPDFPrinter();var _0x218c78=_0x4f2161[_0xbff5('0x37')](_0x4fc034);if(_0x37de8c){_0x2f00ea=path[_0xbff5('0x34')](_0x42d70c,_0x5b8bad,util[_0xbff5('0x18')](_0xbff5('0x38'),_0x5b8bad,_0x12c533,'pdf'));}else{_0x2f00ea=path[_0xbff5('0x34')](_0x42d70c,util[_0xbff5('0x18')](_0xbff5('0x39'),_0x5b8bad,_0xbff5('0x3a')));}_0x5db553[_0xbff5('0x13')](writePDFDocument(_0x218c78,_0x2f00ea));}return Promise[_0xbff5('0x3b')](_0x5db553);})['then'](function(){if(_0x37de8c){return new Promise(function(_0x1ea238){zipdir(path[_0xbff5('0x34')](_0x42d70c,_0x5b8bad),{'saveTo':path[_0xbff5('0x34')](_0x42d70c,util[_0xbff5('0x18')]('%s.%s',_0x5b8bad,_0xbff5('0x3c')))},function(){rimraf(path[_0xbff5('0x34')](_0x42d70c,_0x5b8bad),function(){});_0x1ea238(_0xbff5('0x3d'));});});}})[_0xbff5('0x28')](function(){if(!_0x37de8c)return;rimraf(path[_0xbff5('0x34')](_0x42d70c,_0x5b8bad),function(){});})[_0xbff5('0x28')](function(){logger[_0xbff5('0x3e')](util[_0xbff5('0x18')](_0xbff5('0x3f'),EXTRACTED_REPORT_ID,_0xbff5('0x40')));return analyticExtractedReport(_0xbff5('0x41'),_0x37de8c?util[_0xbff5('0x18')](_0xbff5('0x39'),_0x5b8bad,_0x37de8c?_0xbff5('0x3c'):_0xbff5('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbff5('0x3e')](util[_0xbff5('0x18')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbff5('0x40')));return db['AnalyticExtractedReport'][_0xbff5('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbff5('0x28')](function(_0xc553bc){EXTRACTED_REPORT=_0xc553bc;return dbH[_0xbff5('0x2c')][_0xbff5('0x43')](util[_0xbff5('0x18')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbff5('0x2c')][_0xbff5('0x2e')][_0xbff5('0x2f')]});})[_0xbff5('0x28')](extractReport)['catch'](function(_0x5c70e7){logger[_0xbff5('0x3e')](util[_0xbff5('0x18')](_0xbff5('0x44'),EXTRACTED_REPORT_ID,_0xbff5('0x40')),util[_0xbff5('0x45')](_0x5c70e7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbff5('0x46'));})[_0xbff5('0x47')](function(){process[_0xbff5('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1121fb=new PdfPrinter({'Arial':{'normal':__dirname+_0xbff5('0x49'),'bold':__dirname+_0xbff5('0x4a'),'italics':__dirname+_0xbff5('0x4b'),'bolditalics':__dirname+_0xbff5('0x4c')}});return _0x1121fb;}function getPDFDocDefinitionFromHTML(_0x2d88f4,_0x46a2de){var _0xa21079=util[_0xbff5('0x18')]('%s\x20#%d',_0x46a2de[_0xbff5('0x4d')],_0x46a2de[_0xbff5('0x4e')]);var _0x15f996=moment()[_0xbff5('0x18')](_0xbff5('0x4f'))[_0xbff5('0x1d')]();var _0x4fa116=htmlToPdfmake(_0x2d88f4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4fa116],'defaultStyle':{'font':_0xbff5('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbff5('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbff5('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xbff5('0x51'),'style':'header'}];},'footer':function(_0x4929ec,_0x192c68){return[{'text':util[_0xbff5('0x18')](_0xbff5('0x52'),_0xa21079,_0x4929ec,_0x192c68,_0x15f996),'style':_0xbff5('0x1f')}];}};}function writePDFDocument(_0x1cf1de,_0x44b58){return new Promise(function(_0xe62f63,_0x5b2f26){var _0x233a3f=_0x1cf1de[_0xbff5('0x53')](fs[_0xbff5('0x54')](_0x44b58));_0x233a3f['on'](_0xbff5('0x55'),function(){_0xe62f63(_0xbff5('0x55'));});_0x233a3f['on']('error',function(_0x2a559f){_0x5b2f26(_0x2a559f);});_0x1cf1de['end']();});}exports[_0xbff5('0x56')]=function(_0x2fe080,_0x3b1e7a){var _0x290db1=getPDFPrinter();var _0x3cb816=getPDFDocDefinitionFromHTML(_0x2fe080,_0x3b1e7a);var _0x797a07=_0x290db1['createPdfKitDocument'](_0x3cb816);return writePDFDocument(_0x797a07,_0x3b1e7a[_0xbff5('0x2')])['catch'](function(_0x3f06fc){throw _0x3f06fc;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ad40233..a1e85d3 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 _0x6c1f=['writeFileSync','binary','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','QueryTypes','num','Empty','length','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6c1f,0x158));var _0xf6c1=function(_0x54cba8,_0x3e5114){_0x54cba8=_0x54cba8-0x0;var _0x324d1f=_0x6c1f[_0x54cba8];return _0x324d1f;};'use strict';var util=require('util');var path=require(_0xf6c1('0x0'));var _=require(_0xf6c1('0x1'));var fs=require('fs');var json2xls=require(_0xf6c1('0x2'));var BPromise=require(_0xf6c1('0x3'));var zipdir=require(_0xf6c1('0x4'));var rimraf=require(_0xf6c1('0x5'));var db=require(_0xf6c1('0x6'))['db'];var dbH=require(_0xf6c1('0x6'))[_0xf6c1('0x7')];var logger=require('../../config/logger')(_0xf6c1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xf6c1('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c4732,_0x2f5f21){var _0x5cd5de={'status':_0x4c4732};var _0x27da1f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f5f21){_0x5cd5de[_0xf6c1('0xa')]=_0x2f5f21;}return db[_0xf6c1('0xb')][_0xf6c1('0xc')](_0x5cd5de,_0x27da1f);}function main(){var _0x253639=0x1388;var _0x4e1b8a;logger[_0xf6c1('0xd')](util[_0xf6c1('0xe')](_0xf6c1('0xf'),EXTRACTED_REPORT_ID,_0xf6c1('0x10')));return db['Setting'][_0xf6c1('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf6c1('0x12'),_0xf6c1('0x13')]})[_0xf6c1('0x14')](function(_0x4b9afc){if(_0x4b9afc){_0x4e1b8a=_0x4b9afc;_0x253639=_0x4e1b8a[_0xf6c1('0x13')]||0x1388;}})['then'](function(){return dbH[_0xf6c1('0x15')]['query'](util[_0xf6c1('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf6c1('0x15')][_0xf6c1('0x16')]['SELECT']});})[_0xf6c1('0x14')](function(_0x226d12){if(!_0x226d12[0x0][_0xf6c1('0x17')]){return analyticExtractedReport(_0xf6c1('0x18'));}var _0x417582=[];var _0x8dab43=0x0;if(_0x4e1b8a[_0xf6c1('0x12')]){if(_0x226d12&&_0x226d12[_0xf6c1('0x19')]){var _0x2cdfa6=_['range'](_0x226d12[0x0][_0xf6c1('0x17')]/_0x253639);var _0x583fe1=Number[_0xf6c1('0x1a')](_0x226d12[0x0]['num']/_0x253639)?_0x226d12[0x0][_0xf6c1('0x17')]%_0x253639:0x0;_0x2cdfa6[_0xf6c1('0x1b')](function(_0x93cb16){if(_0x93cb16>0x0){_0x8dab43+=_0x253639;}_0x417582[_0xf6c1('0x1c')](dbH['sequelize'][_0xf6c1('0x1d')](util[_0xf6c1('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x253639,_0x8dab43),{'type':dbH[_0xf6c1('0x15')][_0xf6c1('0x16')]['SELECT']}));});if(_0x583fe1>0x0){_0x8dab43+=_0x253639;_0x417582[_0xf6c1('0x1c')](dbH[_0xf6c1('0x15')][_0xf6c1('0x1d')](util[_0xf6c1('0xe')](_0xf6c1('0x1e'),QUERY,_0x583fe1,_0x8dab43),{'type':dbH[_0xf6c1('0x15')][_0xf6c1('0x16')][_0xf6c1('0x1f')]}));}}}else{_0x417582[_0xf6c1('0x1c')](dbH['sequelize'][_0xf6c1('0x1d')](QUERY,{'type':dbH[_0xf6c1('0x15')]['QueryTypes'][_0xf6c1('0x1f')]}));}var _0x205ae3=path[_0xf6c1('0x20')](PATH);var _0x1f8443=path['basename'](PATH,'.xlsx');var _0x538554=_0x4e1b8a[_0xf6c1('0x12')]&&_0x417582[_0xf6c1('0x19')]>0x1;var _0x248d15=[];if(!fs[_0xf6c1('0x21')](path[_0xf6c1('0x22')](_0x205ae3,_0x1f8443))&&_0x538554){fs[_0xf6c1('0x23')](path[_0xf6c1('0x22')](_0x205ae3,_0x1f8443));}return BPromise[_0xf6c1('0x24')](_0x417582,function(_0x5d43b4){_0x248d15[_0xf6c1('0x1c')](_0x5d43b4);})[_0xf6c1('0x14')](function(){for(var _0x586421=0x0;_0x586421<_0x248d15[_0xf6c1('0x19')];_0x586421+=0x1){var _0x35b366;var _0x25619c=_0x248d15[_0x586421];if(_0x538554){_0x35b366=path['join'](_0x205ae3,_0x1f8443,util['format'](_0xf6c1('0x25'),_0x1f8443,_0x586421,_0xf6c1('0x26')));}else{_0x35b366=path[_0xf6c1('0x22')](_0x205ae3,util[_0xf6c1('0xe')](_0xf6c1('0x27'),_0x1f8443,_0xf6c1('0x26')));}fs[_0xf6c1('0x28')](_0x35b366,json2xls(_0x25619c),_0xf6c1('0x29'));}})['then'](function(){if(_0x538554){return new Promise(function(_0x170fd9){zipdir(path[_0xf6c1('0x22')](_0x205ae3,_0x1f8443),{'saveTo':path[_0xf6c1('0x22')](_0x205ae3,util['format']('%s.%s',_0x1f8443,_0xf6c1('0x2a')))},function(_0x4d104f,_0x5cc3f4){rimraf(path['join'](_0x205ae3,_0x1f8443),function(){});_0x170fd9('zip\x20finished');});});}})[_0xf6c1('0x14')](function(){logger[_0xf6c1('0xd')](util[_0xf6c1('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf6c1('0x10')));return analyticExtractedReport('Completed',_0x538554?util[_0xf6c1('0xe')](_0xf6c1('0x27'),_0x1f8443,_0x538554?'zip':'xlsx'):null);});})[_0xf6c1('0x2b')](function(_0x241120){logger['info'](util[_0xf6c1('0xe')](_0xf6c1('0x2c'),EXTRACTED_REPORT_ID,_0xf6c1('0x10')),util[_0xf6c1('0x2d')](_0x241120,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf6c1('0x2e'));})['finally'](function(){process[_0xf6c1('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xeeaf=['query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','length','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.xlsx','existsSync','each','join','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','sequelize'];(function(_0x11bbb0,_0x49d8d4){var _0x105826=function(_0x44e977){while(--_0x44e977){_0x11bbb0['push'](_0x11bbb0['shift']());}};_0x105826(++_0x49d8d4);}(_0xeeaf,0x150));var _0xfeea=function(_0x1899bf,_0x7f047f){_0x1899bf=_0x1899bf-0x0;var _0x323e01=_0xeeaf[_0x1899bf];return _0x323e01;};'use strict';var util=require(_0xfeea('0x0'));var path=require('path');var _=require(_0xfeea('0x1'));var fs=require('fs');var json2xls=require(_0xfeea('0x2'));var BPromise=require(_0xfeea('0x3'));var zipdir=require(_0xfeea('0x4'));var rimraf=require(_0xfeea('0x5'));var db=require(_0xfeea('0x6'))['db'];var dbH=require(_0xfeea('0x6'))[_0xfeea('0x7')];var logger=require(_0xfeea('0x8'))(_0xfeea('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xfeea('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x421507,_0x430d0e){var _0x325cf4={'status':_0x421507};var _0x313779={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x430d0e){_0x325cf4[_0xfeea('0xb')]=_0x430d0e;}return db[_0xfeea('0xc')][_0xfeea('0xd')](_0x325cf4,_0x313779);}function main(){var _0x2db305=0x1388;var _0x45ba9d;logger[_0xfeea('0xe')](util['format'](_0xfeea('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xfeea('0x10')][_0xfeea('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfeea('0x12'),_0xfeea('0x13')]})['then'](function(_0x3cf258){if(_0x3cf258){_0x45ba9d=_0x3cf258;_0x2db305=_0x45ba9d['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xfeea('0x14')][_0xfeea('0x15')](util[_0xfeea('0x16')](_0xfeea('0x17'),QUERY),{'type':dbH[_0xfeea('0x14')][_0xfeea('0x18')][_0xfeea('0x19')]});})[_0xfeea('0x1a')](function(_0x235476){if(!_0x235476[0x0][_0xfeea('0x1b')]){return analyticExtractedReport('Empty');}var _0x4be403=[];var _0x2f639a=0x0;if(_0x45ba9d[_0xfeea('0x12')]){if(_0x235476&&_0x235476[_0xfeea('0x1c')]){var _0x295c4d=_[_0xfeea('0x1d')](_0x235476[0x0][_0xfeea('0x1b')]/_0x2db305);var _0x251ad8=Number['isInteger'](_0x235476[0x0][_0xfeea('0x1b')]/_0x2db305)?_0x235476[0x0][_0xfeea('0x1b')]%_0x2db305:0x0;_0x295c4d[_0xfeea('0x1e')](function(_0x510f61){if(_0x510f61>0x0){_0x2f639a+=_0x2db305;}_0x4be403['push'](dbH[_0xfeea('0x14')][_0xfeea('0x15')](util['format'](_0xfeea('0x1f'),QUERY,_0x2db305,_0x2f639a),{'type':dbH[_0xfeea('0x14')][_0xfeea('0x18')]['SELECT']}));});if(_0x251ad8>0x0){_0x2f639a+=_0x2db305;_0x4be403[_0xfeea('0x20')](dbH[_0xfeea('0x14')]['query'](util[_0xfeea('0x16')](_0xfeea('0x1f'),QUERY,_0x251ad8,_0x2f639a),{'type':dbH[_0xfeea('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x4be403[_0xfeea('0x20')](dbH[_0xfeea('0x14')][_0xfeea('0x15')](QUERY,{'type':dbH[_0xfeea('0x14')][_0xfeea('0x18')][_0xfeea('0x19')]}));}var _0xda93e9=path[_0xfeea('0x21')](PATH);var _0x39afeb=path['basename'](PATH,_0xfeea('0x22'));var _0x48a5ae=_0x45ba9d[_0xfeea('0x12')]&&_0x4be403['length']>0x1;var _0x4804fd=[];if(!fs[_0xfeea('0x23')](path['join'](_0xda93e9,_0x39afeb))&&_0x48a5ae){fs['mkdirSync'](path['join'](_0xda93e9,_0x39afeb));}return BPromise[_0xfeea('0x24')](_0x4be403,function(_0x32c56e){_0x4804fd['push'](_0x32c56e);})[_0xfeea('0x1a')](function(){for(var _0x311690=0x0;_0x311690<_0x4804fd['length'];_0x311690+=0x1){var _0x3e9186;var _0x302e5f=_0x4804fd[_0x311690];if(_0x48a5ae){_0x3e9186=path[_0xfeea('0x25')](_0xda93e9,_0x39afeb,util['format'](_0xfeea('0x26'),_0x39afeb,_0x311690,'xlsx'));}else{_0x3e9186=path[_0xfeea('0x25')](_0xda93e9,util[_0xfeea('0x16')](_0xfeea('0x27'),_0x39afeb,_0xfeea('0x28')));}fs[_0xfeea('0x29')](_0x3e9186,json2xls(_0x302e5f),_0xfeea('0x2a'));}})['then'](function(){if(_0x48a5ae){return new Promise(function(_0x189e0a){zipdir(path[_0xfeea('0x25')](_0xda93e9,_0x39afeb),{'saveTo':path[_0xfeea('0x25')](_0xda93e9,util['format'](_0xfeea('0x27'),_0x39afeb,_0xfeea('0x2b')))},function(_0x4294c8,_0x1bb237){rimraf(path[_0xfeea('0x25')](_0xda93e9,_0x39afeb),function(){});_0x189e0a('zip\x20finished');});});}})[_0xfeea('0x1a')](function(){logger[_0xfeea('0xe')](util[_0xfeea('0x16')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfeea('0x2c')));return analyticExtractedReport(_0xfeea('0x2d'),_0x48a5ae?util[_0xfeea('0x16')](_0xfeea('0x27'),_0x39afeb,_0x48a5ae?_0xfeea('0x2b'):_0xfeea('0x28')):null);});})[_0xfeea('0x2e')](function(_0x102fbc){logger[_0xfeea('0xe')](util['format'](_0xfeea('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xfeea('0x30')](_0x102fbc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfeea('0x31'));})['finally'](function(){process[_0xfeea('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index baf07c6..1b98a4c 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 _0xedf1=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','custom','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','exten','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','recordingFormat','wav'];(function(_0x32673e,_0x5b2f4d){var _0xf8822d=function(_0x4a6792){while(--_0x4a6792){_0x32673e['push'](_0x32673e['shift']());}};_0xf8822d(++_0x5b2f4d);}(_0xedf1,0xa5));var _0x1edf=function(_0x2e99d5,_0x2bd4c3){_0x2e99d5=_0x2e99d5-0x0;var _0x35b68e=_0xedf1[_0x2e99d5];return _0x35b68e;};'use strict';var _=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));function rewrite(_0x557a02,_0xc07e57){var _0x15b0ef=this;return _0x557a02[_0x1edf('0x2')][_0x1edf('0x3')][_0x1edf('0x4')]({'raw':!![]})[_0x1edf('0x5')](function(_0x1bcbb0){_0x15b0ef['intervals']=_0x1bcbb0;return _0x557a02[_0x1edf('0x2')][_0x1edf('0x6')][_0x1edf('0x4')]({'where':{'IntervalId':_0xc07e57[_0x1edf('0x7')]},'raw':!![]});})['then'](function(_0x4bf34c){return _0x557a02['models'][_0x1edf('0x6')][_0x1edf('0x4')]({'where':{'exten':{'$in':_[_0x1edf('0x8')](_[_0x1edf('0x9')](_0x4bf34c,'exten'))}},'order':[{'raw':_0x1edf('0xa')}],'raw':!![]});})[_0x1edf('0x5')](function(_0x3da527){var _0x177687=_[_0x1edf('0xb')](_0x3da527,{'priority':'1'});var _0x401286=_[_0x1edf('0xb')](_0x3da527,{'isApp':0x1});var _0x7039d9=_[_0x1edf('0xc')](_0x401286,'exten');var _0x332a24=[_0x1edf('0xd'),'playback'];var _0x3f937d=[];var _0x194e51=[];for(var _0x5a55f8 in _0x7039d9){if(_0x7039d9[_0x1edf('0xe')](_0x5a55f8)){_0x15b0ef[_0x1edf('0xf')]=0x2;_0x15b0ef[_0x1edf('0x10')]=[];_0x15b0ef['extension']=_['find'](_0x177687,{'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')]});_0x15b0ef['extensions'][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':util[_0x1edf('0x15')](_0x1edf('0x16'),_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')]),'context':_0x7039d9[_0x5a55f8][0x0]['context'],'exten':_0x7039d9[_0x5a55f8][0x0]['exten'],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});if(_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')]===_0x1edf('0x18')){_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x19')+_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')],'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});}else if(_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')]===_0x1edf('0x1b')){if(_0x15b0ef[_0x1edf('0x1c')]){_0x15b0ef[_0x1edf('0x10')]['push']({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x1d')+(_0x15b0ef[_0x1edf('0x1c')][_0x1edf('0x1e')]?_0x1edf('0x1f')+_0x15b0ef['extension'][_0x1edf('0x1e')]+'}':_0x1edf('0x20')),'context':_0x7039d9[_0x5a55f8][0x0]['context'],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});}_0x15b0ef['extensions'][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0]['type'],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x19')+_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId'],'context':_0x7039d9[_0x5a55f8][0x0]['context'],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef['priority']++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});var _0x35d2d5=_0x15b0ef[_0x1edf('0xf')]++;_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x21'),'appdata':_0x1edf('0x22')+(_0x35d2d5+0x2)+'):Goto('+(_0x35d2d5+0x1)+')','context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x35d2d5,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});if(_0x15b0ef['extension']){_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x15b0ef[_0x1edf('0x1c')][_0x1edf('0x1e')]?_0x1edf('0x23')+_0x15b0ef[_0x1edf('0x1c')][_0x1edf('0x1e')]+'}':_0x1edf('0x24'),'context':_0x7039d9[_0x5a55f8][0x0]['context'],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});}_0x15b0ef[_0x1edf('0x10')]['push']({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':'Set','appdata':_0x1edf('0x25')+_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId'],'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});if(_0x15b0ef[_0x1edf('0x1c')]&&_0x15b0ef[_0x1edf('0x1c')][_0x1edf('0xe')]('recordingFormat')&&_0x15b0ef['extension']['recordingFormat']!==_0x1edf('0x26')){_0x15b0ef[_0x1edf('0x10')]['push']({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x27'),'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0]['exten'],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0]['type'],'app':_0x1edf('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x15b0ef[_0x1edf('0x1c')][_0x1edf('0x28')]||_0x1edf('0x29'),'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef['priority']++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});}}_0x15b0ef['extensions'][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x2a'),'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x2b'),'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]});_0x15b0ef[_0x1edf('0x10')][_0x1edf('0x12')]({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':_0x1edf('0x2c'),'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'exten':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x11')],'priority':_0x15b0ef[_0x1edf('0xf')]++,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});for(var _0x41f075=0x0,_0x3385ee=0x0;_0x41f075<_0x7039d9[_0x5a55f8][_0x1edf('0x2d')];_0x41f075+=0x1,_0x3385ee=0x0){var _0x4d715d=_0x7039d9[_0x5a55f8][_0x41f075];if(_0x4d715d[_0x1edf('0x13')]){_0x4d715d[_0x1edf('0x13')]=_0x4d715d['type'][_0x1edf('0x2e')]();}var _0xc04e9f=[];var _0x9eb0f7=[];delete _0x4d715d['id'];delete _0x4d715d[_0x1edf('0x2f')];delete _0x4d715d[_0x1edf('0x30')];var _0x3de2c1=_0x4d715d['interval']!==_0x1edf('0x31')?[_0x4d715d[_0x1edf('0x32')]]:_0x4d715d[_0x1edf('0x7')]?_[_0x1edf('0x9')](_[_0x1edf('0xb')](_0x15b0ef['intervals'],{'IntervalId':_0x4d715d[_0x1edf('0x7')]}),_0x1edf('0x32')):[];if(_0x4d715d['hasOwnProperty']('tag')){if(_0x4d715d[_0x1edf('0x33')]&&_0x4d715d[_0x1edf('0x33')]!=='--'){_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d[_0x1edf('0x13')],'app':'Set','appdata':_0x1edf('0x34')+_0x4d715d[_0x1edf('0x33')],'context':_0x4d715d['context'],'exten':_0x4d715d[_0x1edf('0x11')],'priority':_0x3de2c1[_0x1edf('0x2d')]+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d[_0x1edf('0x17')]});}}if(_0x4d715d[_0x1edf('0x13')]===_0x1edf('0x1b')&&_0x4d715d[_0x1edf('0xe')](_0x1edf('0x35'))){if(_0x4d715d[_0x1edf('0x35')]){_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d['type'],'app':_0x1edf('0x21'),'appdata':_0x1edf('0x36')+_0x4d715d[_0x1edf('0x35')]+')','context':_0x4d715d[_0x1edf('0x1a')],'exten':_0x4d715d['exten'],'priority':_0x3de2c1['length']+_0x15b0ef['priority']+_0x3385ee++,'VoiceExtensionId':_0x4d715d['VoiceExtensionId']});}else{_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d[_0x1edf('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4d715d[_0x1edf('0x1a')],'exten':_0x4d715d['exten'],'priority':_0x3de2c1[_0x1edf('0x2d')]+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d['VoiceExtensionId']});}}if(_0x4d715d['hasOwnProperty']('answer')){if(_0x332a24['indexOf'](_0x4d715d['app'][_0x1edf('0x2e')]())>=0x0&&_0x4d715d['appType']!==_0x1edf('0x37')){if(_0x4d715d[_0x1edf('0x38')]){_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d[_0x1edf('0x13')],'app':_0x1edf('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4d715d[_0x1edf('0x1a')],'exten':_0x4d715d[_0x1edf('0x11')],'priority':_0x3de2c1[_0x1edf('0x2d')]+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d[_0x1edf('0x17')]});_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d[_0x1edf('0x13')],'app':_0x1edf('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4d715d[_0x1edf('0x1a')],'exten':_0x4d715d['exten'],'priority':_0x3de2c1[_0x1edf('0x2d')]+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d[_0x1edf('0x17')]});}else{_0xc04e9f['push']({'type':_0x4d715d['type'],'app':_0x1edf('0x21'),'appdata':_0x1edf('0x39'),'context':_0x4d715d['context'],'exten':_0x4d715d[_0x1edf('0x11')],'priority':_0x3de2c1['length']+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d[_0x1edf('0x17')]});_0xc04e9f[_0x1edf('0x12')]({'type':_0x4d715d[_0x1edf('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4d715d[_0x1edf('0x1a')],'exten':_0x4d715d[_0x1edf('0x11')],'priority':_0x3de2c1[_0x1edf('0x2d')]+_0x15b0ef[_0x1edf('0xf')]+_0x3385ee++,'VoiceExtensionId':_0x4d715d[_0x1edf('0x17')]});}}}for(var _0x20f2b0=0x0;_0x20f2b0<_0x3de2c1[_0x1edf('0x2d')];_0x20f2b0+=0x1){var _0x4e7ef6=_0x15b0ef[_0x1edf('0xf')]+_0x3de2c1[_0x1edf('0x2d')];var _0x5f5baa=_0x20f2b0===_0x3de2c1[_0x1edf('0x2d')]-0x1?_0x15b0ef[_0x1edf('0xf')]+_0xc04e9f['length']+_0x9eb0f7[_0x1edf('0x2d')]+0x2:_0x15b0ef[_0x1edf('0xf')]+_0x20f2b0+0x1;_0xc04e9f[_0x1edf('0x3a')](_0x20f2b0,0x0,{'type':_0x4d715d[_0x1edf('0x13')],'app':_0x1edf('0x3b'),'appdata':_0x3de2c1[_0x20f2b0]+'?'+_0x4d715d['context']+_0x1edf('0x3c')+_0x4e7ef6+':'+_0x4d715d['context']+',${EXTEN},'+_0x5f5baa,'exten':_0x4d715d[_0x1edf('0x11')],'context':_0x4d715d[_0x1edf('0x1a')],'priority':_0x15b0ef['priority']+_0x20f2b0,'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});}_0x4d715d['priority']=_0xc04e9f['length']?_['last'](_0xc04e9f)[_0x1edf('0xf')]+0x1:_0x15b0ef[_0x1edf('0xf')];_0x15b0ef[_0x1edf('0xf')]=(_0x9eb0f7[_0x1edf('0x2d')]?_[_0x1edf('0x3d')](_0x9eb0f7)[_0x1edf('0xf')]:_0x4d715d[_0x1edf('0xf')])+0x1;_0x15b0ef['extensions']=_[_0x1edf('0x3e')](_0x15b0ef['extensions'],_0xc04e9f,[_0x4d715d],_0x9eb0f7);}_0x15b0ef[_0x1edf('0x10')]['push']({'type':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x13')],'app':'Hangup','exten':_0x7039d9[_0x5a55f8][0x0]['exten'],'context':_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x1a')],'priority':_0x15b0ef[_0x1edf('0xf')],'VoiceExtensionId':_0x7039d9[_0x5a55f8][0x0]['VoiceExtensionId']});_0x3f937d[_0x1edf('0x12')](_0x7039d9[_0x5a55f8][0x0][_0x1edf('0x17')]);_0x194e51=_[_0x1edf('0x3e')](_0x194e51,_0x15b0ef[_0x1edf('0x10')]);}}return _0x557a02['transaction'](function(_0x57020b){return _0x557a02['models']['VoiceExtension'][_0x1edf('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x3f937d}},'transaction':_0x57020b})[_0x1edf('0x5')](function(_0x47e01a){return _0x557a02[_0x1edf('0x2')][_0x1edf('0x6')][_0x1edf('0x40')](_[_0x1edf('0x41')](_0x194e51,'priority'),{'transaction':_0x57020b});});});})[_0x1edf('0x42')](function(_0x34744e){console[_0x1edf('0x43')](_0x34744e);});}exports[_0x1edf('0x44')]=rewrite; \ No newline at end of file +var _0x88c7=['uniq','map','CAST(priority\x20AS\x20UNSIGNED)','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','context','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','then','VoiceExtension','findAll','models'];(function(_0x550454,_0x1cb14a){var _0x418ad5=function(_0x56feea){while(--_0x56feea){_0x550454['push'](_0x550454['shift']());}};_0x418ad5(++_0x1cb14a);}(_0x88c7,0x1e3));var _0x788c=function(_0x15d108,_0x382bd6){_0x15d108=_0x15d108-0x0;var _0x50c044=_0x88c7[_0x15d108];return _0x50c044;};'use strict';var _=require(_0x788c('0x0'));var util=require(_0x788c('0x1'));function rewrite(_0x1d41a5,_0x5e8372){var _0x3dd17f=this;return _0x1d41a5['models'][_0x788c('0x2')]['findAll']({'raw':!![]})[_0x788c('0x3')](function(_0x599a0f){_0x3dd17f['intervals']=_0x599a0f;return _0x1d41a5['models'][_0x788c('0x4')][_0x788c('0x5')]({'where':{'IntervalId':_0x5e8372['IntervalId']},'raw':!![]});})[_0x788c('0x3')](function(_0x5819f1){return _0x1d41a5[_0x788c('0x6')][_0x788c('0x4')][_0x788c('0x5')]({'where':{'exten':{'$in':_[_0x788c('0x7')](_[_0x788c('0x8')](_0x5819f1,'exten'))}},'order':[{'raw':_0x788c('0x9')}],'raw':!![]});})[_0x788c('0x3')](function(_0x1eab97){var _0x2971e3=_['filter'](_0x1eab97,{'priority':'1'});var _0x31ed4b=_['filter'](_0x1eab97,{'isApp':0x1});var _0x5da2f8=_['groupBy'](_0x31ed4b,_0x788c('0xa'));var _0x12df6b=[_0x788c('0xb'),_0x788c('0xc')];var _0xe9e3b4=[];var _0x28c2c8=[];for(var _0x376210 in _0x5da2f8){if(_0x5da2f8[_0x788c('0xd')](_0x376210)){_0x3dd17f[_0x788c('0xe')]=0x2;_0x3dd17f[_0x788c('0xf')]=[];_0x3dd17f[_0x788c('0x10')]=_[_0x788c('0x11')](_0x2971e3,{'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')]});_0x3dd17f['extensions'][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':util[_0x788c('0x15')](_0x788c('0x16'),_0x5da2f8[_0x376210][0x0]['type']),'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f['priority']++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});if(_0x5da2f8[_0x376210][0x0]['type']===_0x788c('0x18')){_0x3dd17f[_0x788c('0xf')]['push']({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':'Set','appdata':_0x788c('0x19')+_0x5da2f8[_0x376210][0x0][_0x788c('0x17')],'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});}else if(_0x5da2f8[_0x376210][0x0][_0x788c('0x13')]===_0x788c('0x1a')){if(_0x3dd17f[_0x788c('0x10')]){_0x3dd17f[_0x788c('0xf')][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':'CDR(destination)='+(_0x3dd17f[_0x788c('0x10')][_0x788c('0x1b')]?_0x788c('0x1c')+_0x3dd17f['extension']['cutdigits']+'}':_0x788c('0x1d')),'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});}_0x3dd17f['extensions'][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':'Set','appdata':_0x788c('0x19')+_0x5da2f8[_0x376210][0x0]['VoiceExtensionId'],'context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});var _0x6b15e4=_0x3dd17f['priority']++;_0x3dd17f[_0x788c('0xf')]['push']({'type':_0x5da2f8[_0x376210][0x0]['type'],'app':_0x788c('0x1f'),'appdata':_0x788c('0x20')+(_0x6b15e4+0x2)+'):Goto('+(_0x6b15e4+0x1)+')','context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x6b15e4,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0]['VoiceExtensionId']});if(_0x3dd17f[_0x788c('0x10')]){_0x3dd17f[_0x788c('0xf')][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x3dd17f[_0x788c('0x10')][_0x788c('0x1b')]?_0x788c('0x21')+_0x3dd17f[_0x788c('0x10')][_0x788c('0x1b')]+'}':_0x788c('0x22'),'context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f['priority']++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});}_0x3dd17f[_0x788c('0xf')][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x788c('0x23')+_0x5da2f8[_0x376210][0x0]['VoiceExtensionId'],'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0]['exten'],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});if(_0x3dd17f['extension']&&_0x3dd17f[_0x788c('0x10')][_0x788c('0xd')](_0x788c('0x24'))&&_0x3dd17f[_0x788c('0x10')][_0x788c('0x24')]!==_0x788c('0x25')){_0x3dd17f['extensions'][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});_0x3dd17f['extensions'][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x788c('0x26')+_0x3dd17f[_0x788c('0x10')][_0x788c('0x24')]||_0x788c('0x27'),'context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});}}_0x3dd17f[_0x788c('0xf')][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x788c('0x28'),'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0]['VoiceExtensionId']});_0x3dd17f['extensions'][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':'Set','appdata':_0x788c('0x29'),'context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0]['VoiceExtensionId']});_0x3dd17f[_0x788c('0xf')][_0x788c('0x12')]({'type':_0x5da2f8[_0x376210][0x0][_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x788c('0x2a'),'context':_0x5da2f8[_0x376210][0x0]['context'],'exten':_0x5da2f8[_0x376210][0x0]['exten'],'priority':_0x3dd17f[_0x788c('0xe')]++,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});for(var _0x5265d4=0x0,_0x2136b7=0x0;_0x5265d4<_0x5da2f8[_0x376210][_0x788c('0x2b')];_0x5265d4+=0x1,_0x2136b7=0x0){var _0x1c2370=_0x5da2f8[_0x376210][_0x5265d4];if(_0x1c2370[_0x788c('0x13')]){_0x1c2370[_0x788c('0x13')]=_0x1c2370['type'][_0x788c('0x2c')]();}var _0x2e6285=[];var _0x357552=[];delete _0x1c2370['id'];delete _0x1c2370['createdAt'];delete _0x1c2370[_0x788c('0x2d')];var _0x45cad3=_0x1c2370[_0x788c('0x2e')]!==_0x788c('0x2f')?[_0x1c2370[_0x788c('0x2e')]]:_0x1c2370[_0x788c('0x30')]?_[_0x788c('0x8')](_[_0x788c('0x31')](_0x3dd17f['intervals'],{'IntervalId':_0x1c2370[_0x788c('0x30')]}),'interval'):[];if(_0x1c2370[_0x788c('0xd')]('tag')){if(_0x1c2370[_0x788c('0x32')]&&_0x1c2370[_0x788c('0x32')]!=='--'){_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':_0x788c('0x33')+_0x1c2370[_0x788c('0x32')],'context':_0x1c2370['context'],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});}}if(_0x1c2370['type']==='outbound'&&_0x1c2370[_0x788c('0xd')]('callerID')){if(_0x1c2370[_0x788c('0x34')]){_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x1f'),'appdata':_0x788c('0x35')+_0x1c2370[_0x788c('0x34')]+')','context':_0x1c2370['context'],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});}else{_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x1f'),'appdata':_0x788c('0x36'),'context':_0x1c2370[_0x788c('0x1e')],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f['priority']+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});}}if(_0x1c2370[_0x788c('0xd')]('answer')){if(_0x12df6b['indexOf'](_0x1c2370['app'][_0x788c('0x2c')]())>=0x0&&_0x1c2370[_0x788c('0x37')]!=='custom'){if(_0x1c2370[_0x788c('0x38')]){_0x2e6285['push']({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x1f'),'appdata':_0x788c('0x39'),'context':_0x1c2370[_0x788c('0x1e')],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1c2370['context'],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370['VoiceExtensionId']});}else{_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x1f'),'appdata':_0x788c('0x3a'),'context':_0x1c2370[_0x788c('0x1e')],'exten':_0x1c2370['exten'],'priority':_0x45cad3[_0x788c('0x2b')]+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});_0x2e6285[_0x788c('0x12')]({'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1c2370['context'],'exten':_0x1c2370[_0x788c('0xa')],'priority':_0x45cad3['length']+_0x3dd17f[_0x788c('0xe')]+_0x2136b7++,'VoiceExtensionId':_0x1c2370[_0x788c('0x17')]});}}}for(var _0x5a6d1b=0x0;_0x5a6d1b<_0x45cad3[_0x788c('0x2b')];_0x5a6d1b+=0x1){var _0x32044f=_0x3dd17f[_0x788c('0xe')]+_0x45cad3[_0x788c('0x2b')];var _0x3552ab=_0x5a6d1b===_0x45cad3[_0x788c('0x2b')]-0x1?_0x3dd17f[_0x788c('0xe')]+_0x2e6285[_0x788c('0x2b')]+_0x357552[_0x788c('0x2b')]+0x2:_0x3dd17f[_0x788c('0xe')]+_0x5a6d1b+0x1;_0x2e6285['splice'](_0x5a6d1b,0x0,{'type':_0x1c2370[_0x788c('0x13')],'app':_0x788c('0x3b'),'appdata':_0x45cad3[_0x5a6d1b]+'?'+_0x1c2370['context']+',${EXTEN},'+_0x32044f+':'+_0x1c2370[_0x788c('0x1e')]+_0x788c('0x3c')+_0x3552ab,'exten':_0x1c2370[_0x788c('0xa')],'context':_0x1c2370['context'],'priority':_0x3dd17f[_0x788c('0xe')]+_0x5a6d1b,'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});}_0x1c2370[_0x788c('0xe')]=_0x2e6285[_0x788c('0x2b')]?_[_0x788c('0x3d')](_0x2e6285)[_0x788c('0xe')]+0x1:_0x3dd17f[_0x788c('0xe')];_0x3dd17f['priority']=(_0x357552[_0x788c('0x2b')]?_[_0x788c('0x3d')](_0x357552)[_0x788c('0xe')]:_0x1c2370[_0x788c('0xe')])+0x1;_0x3dd17f[_0x788c('0xf')]=_[_0x788c('0x3e')](_0x3dd17f[_0x788c('0xf')],_0x2e6285,[_0x1c2370],_0x357552);}_0x3dd17f[_0x788c('0xf')]['push']({'type':_0x5da2f8[_0x376210][0x0]['type'],'app':'Hangup','exten':_0x5da2f8[_0x376210][0x0][_0x788c('0xa')],'context':_0x5da2f8[_0x376210][0x0][_0x788c('0x1e')],'priority':_0x3dd17f['priority'],'VoiceExtensionId':_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]});_0xe9e3b4['push'](_0x5da2f8[_0x376210][0x0][_0x788c('0x17')]);_0x28c2c8=_['concat'](_0x28c2c8,_0x3dd17f[_0x788c('0xf')]);}}return _0x1d41a5[_0x788c('0x3f')](function(_0x5d8984){return _0x1d41a5[_0x788c('0x6')][_0x788c('0x4')][_0x788c('0x40')]({'where':{'VoiceExtensionId':{'$in':_0xe9e3b4}},'transaction':_0x5d8984})[_0x788c('0x3')](function(_0x1200fd){return _0x1d41a5[_0x788c('0x6')][_0x788c('0x4')][_0x788c('0x41')](_[_0x788c('0x42')](_0x28c2c8,_0x788c('0xe')),{'transaction':_0x5d8984});});});})[_0x788c('0x43')](function(_0x2feb01){console[_0x788c('0x44')](_0x2feb01);});}exports[_0x788c('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index ba97927..f267b8f 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 _0x7990=['id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','outbound','BlackLists','get','Lists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','scheduledAt','ListId','createdAt','updatedAt','select','field','NOW()','ContactId','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper','\x20=\x20?','insert','into','fromQuery','phone\x20NOT\x20IN\x20(?)','cm_hopper_final'];(function(_0x5ab169,_0x1f690b){var _0x68aa94=function(_0x267693){while(--_0x267693){_0x5ab169['push'](_0x5ab169['shift']());}};_0x68aa94(++_0x1f690b);}(_0x7990,0x16f));var _0x0799=function(_0x50c6b7,_0x495444){_0x50c6b7=_0x50c6b7-0x0;var _0x203fbf=_0x7990[_0x50c6b7];return _0x203fbf;};'use strict';var BPromise=require('bluebird');var util=require(_0x0799('0x0'));var _=require(_0x0799('0x1'));var fs=require('fs');var squel=require(_0x0799('0x2'));var Papa=require(_0x0799('0x3'));var Redis=require(_0x0799('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x0799('0x5'));var logger=require(_0x0799('0x6'))(_0x0799('0x7'));config[_0x0799('0x8')]=_[_0x0799('0x9')](config['redis'],{'host':_0x0799('0xa'),'port':0x18eb});var socket=require(_0x0799('0xb'))(new Redis(config[_0x0799('0x8')]));require(_0x0799('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x0799('0xd')][0x2]===_0x0799('0xe')||process[_0x0799('0xd')][0x2]==='null'){throw new Error(_0x0799('0xf'));}var FILEPATH=process[_0x0799('0xd')][0x2];if(!process[_0x0799('0xd')][0x3]||process[_0x0799('0xd')][0x3]===_0x0799('0xe')||process[_0x0799('0xd')][0x3]===_0x0799('0x10')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process[_0x0799('0xd')][0x4]===_0x0799('0x10')){throw new Error(_0x0799('0x11'));}var FIELDS=_[_0x0799('0x12')](process[_0x0799('0xd')][0x3][_0x0799('0x13')](','),process[_0x0799('0xd')][0x4][_0x0799('0x13')](','));if(!process[_0x0799('0xd')][0x5]||process[_0x0799('0xd')][0x5]==='undefined'||process[_0x0799('0xd')][0x5]==='null'){throw new Error(_0x0799('0x14'));}var LISTID=process[_0x0799('0xd')][0x5];var COMPANYID=process[_0x0799('0xd')][0x6]&&process[_0x0799('0xd')][0x6]!==_0x0799('0xe')&&process['argv'][0x6]!==_0x0799('0x10')?process[_0x0799('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0799('0xd')][0x7]!=='undefined'&&process[_0x0799('0xd')][0x7]!==_0x0799('0x10')?process['argv'][0x7]:null;if(!process[_0x0799('0xd')][0x8]||process[_0x0799('0xd')][0x8]===_0x0799('0xe')||process[_0x0799('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x0799('0xd')][0x8];}catch(_0x220255){logger['error'](_0x220255);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(_0x4860b6,_0xd9373d,_0x3ff157,_0x4ae7c9){var _0xc4bb0d={'message':_0xd9373d};_0xc4bb0d[_0x4860b6]=!![];if(_0x3ff157){_0xc4bb0d[_0x0799('0x15')]=_0x3ff157;}if(_0x4ae7c9){_0xc4bb0d['index']=_0x4ae7c9;}return _0xc4bb0d;}function isEmail(_0xea20bf){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))*$/[_0x0799('0x16')](_0xea20bf);}function checkRow(_0x1e3034,_0x433c44,_0x172865){return new BPromise(function(_0x314d65,_0x4b353b){if(_[_0x0799('0x17')](_0x1e3034)){return _0x4b353b(handleCheckRowError(_0x0799('0x18'),_0x0799('0x19'),null,_0x172865));}if(_0x1e3034[_0x0799('0x1a')]&&_0x1e3034[_0x0799('0x1a')][_0x0799('0x1b')]){var _0x28e367=_[_0x0799('0x1c')](_0x1e3034[_0x0799('0x1a')],_0x0799('0x1d'))['join'](';');return _0x4b353b(handleCheckRowError(_0x0799('0x18'),_0x28e367,null,_0x172865));}var _0x1a6af4={};for(var _0x23131b in FIELDS){if(FIELDS[_0x0799('0x1e')](_0x23131b)&&FIELDS[_0x23131b]){_0x1a6af4[_0x23131b]=_0x1e3034['data'][0x0][FIELDS[_0x23131b]]||_0x1e3034[_0x0799('0x1f')][0x0]['\ufeff'+FIELDS[_0x23131b]];}}if(!_0x1a6af4[_0x0799('0x20')]){return _0x4b353b(handleCheckRowError('error',_0x0799('0x21'),null,_0x172865));}if(!_0x1a6af4[_0x0799('0x22')]){return _0x4b353b(handleCheckRowError(_0x0799('0x18'),_0x0799('0x23'),null,_0x172865));}if(_0x1a6af4[_0x0799('0x24')]){var _0x33f0bc=moment(_0x1a6af4[_0x0799('0x24')],_0x0799('0x25'));if(!_0x33f0bc['isValid']()){return _0x4b353b(handleCheckRowError(_0x0799('0x18'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x172865));}}if(_0x1a6af4[_0x0799('0x26')]){if(!isEmail(_0x1a6af4[_0x0799('0x26')])){return _0x4b353b(handleCheckRowError('error',_0x0799('0x27'),null,_0x172865));}}_0x1a6af4['ListId']=LISTID;_0x1a6af4[_0x0799('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0799('0x1b')]&&_0x433c44){var _0x2f5d99={};for(var _0x259045=0x0,_0x3782a4=DUPLICATES[_0x0799('0x1b')];_0x259045<_0x3782a4;_0x259045+=0x1){_0x2f5d99[DUPLICATES[_0x259045]]=_0x1a6af4[DUPLICATES[_0x259045]];}var _0x1d55b0=_[_0x0799('0x29')](_0x433c44,_0x2f5d99);if(_0x1d55b0){return _0x4b353b(handleCheckRowError(_0x0799('0x2a'),_0x0799('0x2b'),_0x1d55b0,_0x172865));}}return db[_0x0799('0x2c')][_0x0799('0x2d')](_0x1a6af4,{'raw':!![],'hooks':![],'fields':_[_0x0799('0x2e')](_0x1a6af4)})[_0x0799('0x2f')](function(_0x41c308){if(DUPLICATES&&DUPLICATES['length']&&_0x433c44){_0x433c44[_0x0799('0x30')](_[_0x0799('0x31')](_0x1a6af4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x41c308['id'];return _0x314d65();})[_0x0799('0x32')](function(_0x45dcca){return _0x4b353b(handleCheckRowError(_0x0799('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x45dcca[_0x0799('0x1d')]||JSON[_0x0799('0x33')](_0x45dcca)),null,_0x172865));});});}function checkHopper(){function _0x9ddb81(){return function(_0x56e39f){logger['error'](_0x0799('0x34'),_0x0799('0x35'),util[_0x0799('0x36')](_0x56e39f,{'showHidden':![],'depth':null}));};}var _0x2fe15a=function(_0x39b5c6,_0x5b2ced){var _0x214bd3=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x0799('0x37'),'ContactId',_0x0799('0x38'),_0x5b2ced,_0x0799('0x39'),_0x0799('0x3a')],squel[_0x0799('0x3b')]()[_0x0799('0x3c')]('phone','phone')[_0x0799('0x3c')](_0x0799('0x3d'),_0x0799('0x37'))[_0x0799('0x3c')]('id',_0x0799('0x3e'))['field'](LISTID[_0x0799('0x3f')](),'ListId')['field'](_0x39b5c6['id'][_0x0799('0x3f')](),_0x5b2ced)['field'](_0x0799('0x3d'),'createdAt')[_0x0799('0x3c')](_0x0799('0x3d'),_0x0799('0x3a'))['from'](_0x0799('0x40'))[_0x0799('0x41')](_0x0799('0x42'))[_0x0799('0x41')](_0x0799('0x43'),LISTID['toString']())[_0x0799('0x41')](_0x0799('0x44'))[_0x0799('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0799('0x3b')]()[_0x0799('0x3c')](_0x0799('0x22'))[_0x0799('0x45')](_0x0799('0x46'))[_0x0799('0x41')](_0x5b2ced+_0x0799('0x47'),_0x39b5c6['id'][_0x0799('0x3f')]())))['toString']();return _0x214bd3;};var _0x1376d1=function(_0x563e9d,_0x18c0fb){var _0x31a0df=squel[_0x0799('0x48')]()[_0x0799('0x49')](_0x0799('0x46'))[_0x0799('0x4a')](['phone',_0x0799('0x37'),_0x0799('0x3e'),_0x0799('0x38'),_0x18c0fb,_0x0799('0x39'),_0x0799('0x3a')],squel[_0x0799('0x3b')]()[_0x0799('0x3c')]('phone',_0x0799('0x22'))['field'](_0x0799('0x3d'),_0x0799('0x37'))[_0x0799('0x3c')]('id',_0x0799('0x3e'))[_0x0799('0x3c')](LISTID[_0x0799('0x3f')](),_0x0799('0x38'))[_0x0799('0x3c')](_0x563e9d['id']['toString'](),_0x18c0fb)[_0x0799('0x3c')](_0x0799('0x3d'),'createdAt')[_0x0799('0x3c')](_0x0799('0x3d'),_0x0799('0x3a'))[_0x0799('0x45')](_0x0799('0x40'))[_0x0799('0x41')](_0x0799('0x42'))[_0x0799('0x41')](_0x0799('0x43'),LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x0799('0x41')](_0x0799('0x44'))[_0x0799('0x41')](_0x0799('0x4b'),squel['select']()[_0x0799('0x3c')]('calleridnum')[_0x0799('0x45')](_0x0799('0x4c'))[_0x0799('0x41')](_0x18c0fb+'\x20=\x20?',_0x563e9d['id'][_0x0799('0x3f')]()))[_0x0799('0x41')](_0x0799('0x4b'),squel[_0x0799('0x3b')]()['field'](_0x0799('0x22'))[_0x0799('0x45')]('cm_hopper')[_0x0799('0x41')](_0x18c0fb+'\x20=\x20?',_0x563e9d['id']['toString']())))['toString']();return _0x31a0df;};function _0x211da6(_0x100352,_0x3599e5){var _0x4d6e0b=squel[_0x0799('0x48')]()[_0x0799('0x49')](_0x0799('0x46'))['fromQuery']([_0x0799('0x22'),_0x0799('0x37'),_0x0799('0x3e'),_0x0799('0x38'),_0x3599e5,_0x0799('0x39'),'updatedAt'],squel['select']()[_0x0799('0x3c')](_0x0799('0x22'),_0x0799('0x22'))[_0x0799('0x3c')]('NOW()',_0x0799('0x37'))[_0x0799('0x3c')]('id',_0x0799('0x3e'))[_0x0799('0x3c')](LISTID['toString'](),_0x0799('0x38'))[_0x0799('0x3c')](_0x100352['id'][_0x0799('0x3f')](),_0x3599e5)[_0x0799('0x3c')](_0x0799('0x3d'),_0x0799('0x39'))['field']('NOW()','updatedAt')[_0x0799('0x45')](_0x0799('0x40'))[_0x0799('0x41')](_0x0799('0x42'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x0799('0x41')](_0x0799('0x4d'),squel[_0x0799('0x4e')](hopperContacts))[_0x0799('0x41')](_0x0799('0x44')))[_0x0799('0x3f')]();return _0x4d6e0b;}function _0x297d15(_0x1a2041,_0x24435d){var _0x41882d=squel[_0x0799('0x48')]()[_0x0799('0x49')](_0x0799('0x4f'))[_0x0799('0x4a')]([_0x0799('0x22'),'ContactId',_0x0799('0x38'),_0x24435d,_0x0799('0x39'),_0x0799('0x3a')],squel[_0x0799('0x3b')]()[_0x0799('0x3c')](_0x0799('0x22'),_0x0799('0x22'))[_0x0799('0x3c')]('id',_0x0799('0x3e'))[_0x0799('0x3c')](LISTID[_0x0799('0x3f')](),_0x0799('0x38'))['field'](_0x1a2041['id'][_0x0799('0x3f')](),_0x24435d)['field'](_0x0799('0x3d'),_0x0799('0x39'))[_0x0799('0x3c')]('NOW()','updatedAt')[_0x0799('0x45')](_0x0799('0x40'))[_0x0799('0x41')](_0x0799('0x42'))[_0x0799('0x41')]('ListId\x20=\x20?',LISTID[_0x0799('0x3f')]())[_0x0799('0x41')]('id\x20IN\x20?',squel[_0x0799('0x4e')](hopperContacts))[_0x0799('0x41')](_0x0799('0x44')))[_0x0799('0x3f')]();return _0x41882d;}return db[_0x0799('0x50')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x0799('0x51')],'include':[{'model':db[_0x0799('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0799('0x2f')](function(_0x494992){var _0x878329=[];if(_0x494992){var _0x443b77;for(var _0x5df74b=0x0,_0x3528b3;_0x5df74b<_0x494992[_0x0799('0x1b')];_0x5df74b+=0x1){_0x3528b3=_0x494992[_0x5df74b]['get']({'plain':!![]});switch(_0x3528b3['dialCheckDuplicateType']){case'always':_0x878329[_0x0799('0x30')](db[_0x0799('0x53')][_0x0799('0x54')](_0x1376d1(_0x3528b3,_0x0799('0x55')))[_0x0799('0x2f')](function(){})[_0x0799('0x32')](_0x9ddb81()));break;case _0x0799('0x56'):_0x878329[_0x0799('0x30')](db[_0x0799('0x53')][_0x0799('0x54')](_0x2fe15a(_0x3528b3,_0x0799('0x55')))[_0x0799('0x2f')](function(){})[_0x0799('0x32')](_0x9ddb81()));break;default:_0x878329[_0x0799('0x30')](db[_0x0799('0x53')][_0x0799('0x54')](_0x211da6(_0x3528b3,_0x0799('0x55')))[_0x0799('0x2f')](function(){})[_0x0799('0x32')](_0x9ddb81()));}}}return _0x878329;})[_0x0799('0x57')]()[_0x0799('0x2f')](function(){return db['VoiceQueue'][_0x0799('0x58')]({'where':{'type':_0x0799('0x59')},'attributes':['id'],'include':[{'model':db[_0x0799('0x52')],'as':_0x0799('0x5a'),'where':{'id':LISTID}}]})[_0x0799('0x2f')](function(_0xac2d68){var _0x42f48c=[];if(_0xac2d68){var _0x2077d4;for(var _0x51304a=0x0,_0x41a629;_0x51304a<_0xac2d68[_0x0799('0x1b')];_0x51304a+=0x1){_0x41a629=_0xac2d68[_0x51304a][_0x0799('0x5b')]({'plain':!![]});_0x42f48c[_0x0799('0x30')](db['sequelize'][_0x0799('0x54')](_0x297d15(_0x41a629,_0x0799('0x55')))['then'](function(){})[_0x0799('0x32')](_0x9ddb81()));}}return _0x42f48c;})['all']();})[_0x0799('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x0799('0x51')],'include':[{'model':db[_0x0799('0x52')],'as':_0x0799('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x81a071){var _0x3cdf6d=[];if(_0x81a071){for(var _0xc6f840=0x0,_0x4bd007;_0xc6f840<_0x81a071['length'];_0xc6f840+=0x1){_0x4bd007=_0x81a071[_0xc6f840][_0x0799('0x5b')]({'plain':!![]});switch(_0x4bd007['dialCheckDuplicateType']){case'always':_0x3cdf6d[_0x0799('0x30')](db['sequelize'][_0x0799('0x54')](_0x1376d1(_0x4bd007,_0x0799('0x5d')))['then'](function(){})[_0x0799('0x32')](_0x9ddb81()));break;case _0x0799('0x56'):_0x3cdf6d[_0x0799('0x30')](db['sequelize'][_0x0799('0x54')](_0x2fe15a(_0x4bd007,_0x0799('0x5d')))[_0x0799('0x2f')](function(){})[_0x0799('0x32')](_0x9ddb81()));break;default:_0x3cdf6d[_0x0799('0x30')](db['sequelize'][_0x0799('0x54')](_0x211da6(_0x4bd007,_0x0799('0x5d')))[_0x0799('0x2f')](function(){})[_0x0799('0x32')](_0x9ddb81()));}}}return _0x3cdf6d;})[_0x0799('0x57')]();})['then'](function(){return db[_0x0799('0x5e')][_0x0799('0x58')]({'attributes':['id'],'include':[{'model':db[_0x0799('0x52')],'as':_0x0799('0x5a'),'where':{'id':LISTID}}]})[_0x0799('0x2f')](function(_0x5a595d){var _0x5beefd=[];if(_0x5a595d){for(var _0x226005=0x0,_0x28e5cf;_0x226005<_0x5a595d[_0x0799('0x1b')];_0x226005+=0x1){_0x28e5cf=_0x5a595d[_0x226005][_0x0799('0x5b')]({'plain':!![]});_0x5beefd['push'](db['sequelize'][_0x0799('0x54')](_0x297d15(_0x28e5cf,_0x0799('0x5d')))[_0x0799('0x2f')](function(){})['catch'](_0x9ddb81()));}}return _0x5beefd;})[_0x0799('0x57')]();})[_0x0799('0x32')](function(_0x141889){logger[_0x0799('0x18')](_0x0799('0x5f'),'generalCheckHopper',_0x141889[_0x0799('0x1d')]);});}var processPromises=function(_0x583aa0){return BPromise[_0x0799('0x57')](promises)[_0x0799('0x2f')](function(_0x192d56){})[_0x0799('0x32')](function(_0x11dc9e){logger[_0x0799('0x18')](_0x0799('0x60'),JSON[_0x0799('0x33')](_0x11dc9e));})[_0x0799('0x61')](function(){socket[_0x0799('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x583aa0){return _0x583aa0['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x0799('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x0799('0x2f')](function(){socket['emit'](_0x0799('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0799('0x64')](FILEPATH);}catch(_0x53b681){logger[_0x0799('0x18')](_0x0799('0x65'),JSON[_0x0799('0x33')](_0x53b681));}finally{process[_0x0799('0x66')](0x0);}});};process['on'](_0x0799('0x67'),function(){logger[_0x0799('0x68')](_0x0799('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0x0799('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0799('0x13')](',');return db['CmContact'][_0x0799('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x2515fc){var _0x2c111c=fs[_0x0799('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0799('0x6b')](_0x2c111c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x385bbc,_0x45d9bc){total+=0x1;var _0x504af3=total;promises[_0x0799('0x30')](checkRow(_0x385bbc,_0x2515fc,_0x504af3)[_0x0799('0x2f')](function(){success+=0x1;})[_0x0799('0x32')](function(_0x3f9b4a){if(_0x3f9b4a[_0x0799('0x18')]){errors+=0x1;delete _0x3f9b4a[_0x0799('0x18')];}else if(_0x3f9b4a[_0x0799('0x2a')]){duplicates+=0x1;delete _0x3f9b4a['duplicate'];}rows[_0x0799('0x30')](_0x3f9b4a);}));if(total%0xc8===0x0){_0x45d9bc[_0x0799('0x6c')]();return processPromises(_0x45d9bc);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0799('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xfbf1e2,_0x1e515a){logger[_0x0799('0x68')](_0x0799('0x6d'),JSON[_0x0799('0x33')](_0xfbf1e2));endCsv();}});})[_0x0799('0x32')](function(_0x1ba008){logger[_0x0799('0x18')](_0x0799('0x6e'),JSON['stringify'](_0x1ba008));});}main(); \ No newline at end of file +var _0xc73c=['createReadStream','duplicate','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','into','cm_hopper','scheduledAt','createdAt','updatedAt','select','field','ContactId','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','fromQuery','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','CmList','Lists','CampaignId','cmContact,\x20%s,\x20%s','stringify','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xc73c,0x72));var _0xcc73=function(_0x1c330e,_0x108592){_0x1c330e=_0x1c330e-0x0;var _0x3d7432=_0xc73c[_0x1c330e];return _0x3d7432;};'use strict';var BPromise=require(_0xcc73('0x0'));var util=require(_0xcc73('0x1'));var _=require(_0xcc73('0x2'));var fs=require('fs');var squel=require(_0xcc73('0x3'));var Papa=require(_0xcc73('0x4'));var Redis=require(_0xcc73('0x5'));var db=require(_0xcc73('0x6'))['db'];var config=require(_0xcc73('0x7'));var logger=require(_0xcc73('0x8'))(_0xcc73('0x9'));config[_0xcc73('0xa')]=_['defaults'](config[_0xcc73('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc73('0xa')]));require(_0xcc73('0xb'))[_0xcc73('0xc')](socket);try{if(!process[_0xcc73('0xd')][0x2]||process[_0xcc73('0xd')][0x2]===_0xcc73('0xe')||process[_0xcc73('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xcc73('0xd')][0x2];if(!process['argv'][0x3]||process[_0xcc73('0xd')][0x3]==='undefined'||process[_0xcc73('0xd')][0x3]===_0xcc73('0xf')||!process['argv'][0x4]||process[_0xcc73('0xd')][0x4]===_0xcc73('0xe')||process['argv'][0x4]==='null'){throw new Error(_0xcc73('0x10'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xcc73('0x11')](','),process[_0xcc73('0xd')][0x4][_0xcc73('0x11')](','));if(!process[_0xcc73('0xd')][0x5]||process['argv'][0x5]==='undefined'||process[_0xcc73('0xd')][0x5]===_0xcc73('0xf')){throw new Error(_0xcc73('0x12'));}var LISTID=process[_0xcc73('0xd')][0x5];var COMPANYID=process[_0xcc73('0xd')][0x6]&&process[_0xcc73('0xd')][0x6]!=='undefined'&&process[_0xcc73('0xd')][0x6]!==_0xcc73('0xf')?process[_0xcc73('0xd')][0x6]:null;var DUPLICATES=process[_0xcc73('0xd')][0x7]&&process[_0xcc73('0xd')][0x7]!==_0xcc73('0xe')&&process[_0xcc73('0xd')][0x7]!==_0xcc73('0xf')?process[_0xcc73('0xd')][0x7]:null;if(!process[_0xcc73('0xd')][0x8]||process['argv'][0x8]===_0xcc73('0xe')||process[_0xcc73('0xd')][0x8]===_0xcc73('0xf')){throw new Error(_0xcc73('0x13'));}var SOCKET_TIMESTAMP=process[_0xcc73('0xd')][0x8];}catch(_0x4ad3e7){logger['error'](_0x4ad3e7);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(_0x1ca391,_0x25c1fa,_0xcf73f9,_0x4499f6){var _0x20b641={'message':_0x25c1fa};_0x20b641[_0x1ca391]=!![];if(_0xcf73f9){_0x20b641['contact']=_0xcf73f9;}if(_0x4499f6){_0x20b641[_0xcc73('0x14')]=_0x4499f6;}return _0x20b641;}function isEmail(_0x43c820){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))*$/[_0xcc73('0x15')](_0x43c820);}function checkRow(_0x408009,_0x304bd0,_0x96357c){return new BPromise(function(_0x3a4084,_0x4be79c){if(_[_0xcc73('0x16')](_0x408009)){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),_0xcc73('0x18'),null,_0x96357c));}if(_0x408009[_0xcc73('0x19')]&&_0x408009['errors'][_0xcc73('0x1a')]){var _0x40d410=_[_0xcc73('0x1b')](_0x408009[_0xcc73('0x19')],_0xcc73('0x1c'))[_0xcc73('0x1d')](';');return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),_0x40d410,null,_0x96357c));}var _0x25fea0={};for(var _0x1a5a20 in FIELDS){if(FIELDS['hasOwnProperty'](_0x1a5a20)&&FIELDS[_0x1a5a20]){_0x25fea0[_0x1a5a20]=_0x408009[_0xcc73('0x1e')][0x0][FIELDS[_0x1a5a20]]||_0x408009['data'][0x0]['\ufeff'+FIELDS[_0x1a5a20]];}}if(!_0x25fea0[_0xcc73('0x1f')]){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),_0xcc73('0x20'),null,_0x96357c));}if(!_0x25fea0[_0xcc73('0x21')]){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),_0xcc73('0x22'),null,_0x96357c));}if(_0x25fea0[_0xcc73('0x23')]){var _0x1a3436=moment(_0x25fea0[_0xcc73('0x23')],_0xcc73('0x24'));if(!_0x1a3436[_0xcc73('0x25')]()){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x96357c));}}if(_0x25fea0[_0xcc73('0x26')]){if(!isEmail(_0x25fea0[_0xcc73('0x26')])){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),'email\x20format\x20is\x20not\x20valid!',null,_0x96357c));}}_0x25fea0[_0xcc73('0x27')]=LISTID;_0x25fea0[_0xcc73('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcc73('0x1a')]&&_0x304bd0){var _0x5be4b2={};for(var _0x15e8b7=0x0,_0xc43df2=DUPLICATES[_0xcc73('0x1a')];_0x15e8b7<_0xc43df2;_0x15e8b7+=0x1){_0x5be4b2[DUPLICATES[_0x15e8b7]]=_0x25fea0[DUPLICATES[_0x15e8b7]];}var _0x3c06bd=_[_0xcc73('0x29')](_0x304bd0,_0x5be4b2);if(_0x3c06bd){return _0x4be79c(handleCheckRowError('duplicate',_0xcc73('0x2a'),_0x3c06bd,_0x96357c));}}return db[_0xcc73('0x2b')]['create'](_0x25fea0,{'raw':!![],'hooks':![],'fields':_[_0xcc73('0x2c')](_0x25fea0)})[_0xcc73('0x2d')](function(_0x12bd83){if(DUPLICATES&&DUPLICATES[_0xcc73('0x1a')]&&_0x304bd0){_0x304bd0['push'](_[_0xcc73('0x2e')](_0x25fea0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x12bd83['id'];return _0x3a4084();})[_0xcc73('0x2f')](function(_0x2a82fe){return _0x4be79c(handleCheckRowError(_0xcc73('0x17'),_0xcc73('0x30')+(_0x2a82fe['message']||JSON['stringify'](_0x2a82fe)),null,_0x96357c));});});}function checkHopper(){function _0x2f9f41(){return function(_0x48c334){logger[_0xcc73('0x17')]('cmContact',_0xcc73('0x31'),util[_0xcc73('0x32')](_0x48c334,{'showHidden':![],'depth':null}));};}var _0x47f095=function(_0x44bc37,_0x81cb0c){var _0x565868=squel['insert']()[_0xcc73('0x33')](_0xcc73('0x34'))['fromQuery']([_0xcc73('0x21'),_0xcc73('0x35'),'ContactId',_0xcc73('0x27'),_0x81cb0c,_0xcc73('0x36'),_0xcc73('0x37')],squel[_0xcc73('0x38')]()[_0xcc73('0x39')](_0xcc73('0x21'),'phone')[_0xcc73('0x39')]('NOW()','scheduledAt')[_0xcc73('0x39')]('id',_0xcc73('0x3a'))[_0xcc73('0x39')](LISTID[_0xcc73('0x3b')](),_0xcc73('0x27'))['field'](_0x44bc37['id']['toString'](),_0x81cb0c)[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x36'))[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x37'))[_0xcc73('0x3d')](_0xcc73('0x3e'))[_0xcc73('0x3f')](_0xcc73('0x40'))['where'](_0xcc73('0x41'),LISTID[_0xcc73('0x3b')]())[_0xcc73('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xcc73('0x3f')](_0xcc73('0x42'),squel[_0xcc73('0x38')]()[_0xcc73('0x39')](_0xcc73('0x21'))['from']('cm_hopper')[_0xcc73('0x3f')](_0x81cb0c+_0xcc73('0x43'),_0x44bc37['id'][_0xcc73('0x3b')]())))[_0xcc73('0x3b')]();return _0x565868;};var _0x4af5da=function(_0x21acdc,_0x1a303c){var _0x2ff0b1=squel[_0xcc73('0x44')]()[_0xcc73('0x33')](_0xcc73('0x34'))[_0xcc73('0x45')]([_0xcc73('0x21'),_0xcc73('0x35'),_0xcc73('0x3a'),_0xcc73('0x27'),_0x1a303c,'createdAt',_0xcc73('0x37')],squel['select']()[_0xcc73('0x39')](_0xcc73('0x21'),'phone')[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x35'))[_0xcc73('0x39')]('id',_0xcc73('0x3a'))[_0xcc73('0x39')](LISTID[_0xcc73('0x3b')](),_0xcc73('0x27'))[_0xcc73('0x39')](_0x21acdc['id'][_0xcc73('0x3b')](),_0x1a303c)[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x36'))[_0xcc73('0x39')]('NOW()',_0xcc73('0x37'))[_0xcc73('0x3d')](_0xcc73('0x3e'))['where'](_0xcc73('0x40'))[_0xcc73('0x3f')](_0xcc73('0x41'),LISTID[_0xcc73('0x3b')]())[_0xcc73('0x3f')](_0xcc73('0x46'),squel['str'](hopperContacts))[_0xcc73('0x3f')](_0xcc73('0x47'))[_0xcc73('0x3f')](_0xcc73('0x42'),squel[_0xcc73('0x38')]()[_0xcc73('0x39')]('calleridnum')[_0xcc73('0x3d')](_0xcc73('0x48'))['where'](_0x1a303c+'\x20=\x20?',_0x21acdc['id'][_0xcc73('0x3b')]()))[_0xcc73('0x3f')](_0xcc73('0x42'),squel[_0xcc73('0x38')]()[_0xcc73('0x39')]('phone')[_0xcc73('0x3d')](_0xcc73('0x34'))['where'](_0x1a303c+_0xcc73('0x43'),_0x21acdc['id'][_0xcc73('0x3b')]())))[_0xcc73('0x3b')]();return _0x2ff0b1;};function _0x3248e4(_0x2ad769,_0x278966){var _0x1b31c3=squel[_0xcc73('0x44')]()[_0xcc73('0x33')](_0xcc73('0x34'))[_0xcc73('0x45')]([_0xcc73('0x21'),_0xcc73('0x35'),_0xcc73('0x3a'),'ListId',_0x278966,_0xcc73('0x36'),'updatedAt'],squel[_0xcc73('0x38')]()[_0xcc73('0x39')](_0xcc73('0x21'),'phone')[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x35'))['field']('id',_0xcc73('0x3a'))[_0xcc73('0x39')](LISTID['toString'](),_0xcc73('0x27'))[_0xcc73('0x39')](_0x2ad769['id']['toString'](),_0x278966)['field'](_0xcc73('0x3c'),_0xcc73('0x36'))[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x37'))[_0xcc73('0x3d')]('cm_contacts')[_0xcc73('0x3f')](_0xcc73('0x40'))[_0xcc73('0x3f')](_0xcc73('0x41'),LISTID[_0xcc73('0x3b')]())[_0xcc73('0x3f')](_0xcc73('0x46'),squel[_0xcc73('0x49')](hopperContacts))[_0xcc73('0x3f')](_0xcc73('0x47')))['toString']();return _0x1b31c3;}function _0x39048f(_0x16a6d0,_0x10c8da){var _0x471207=squel['insert']()['into'](_0xcc73('0x4a'))[_0xcc73('0x45')]([_0xcc73('0x21'),_0xcc73('0x3a'),_0xcc73('0x27'),_0x10c8da,_0xcc73('0x36'),_0xcc73('0x37')],squel[_0xcc73('0x38')]()[_0xcc73('0x39')]('phone',_0xcc73('0x21'))['field']('id','ContactId')[_0xcc73('0x39')](LISTID['toString'](),_0xcc73('0x27'))['field'](_0x16a6d0['id'][_0xcc73('0x3b')](),_0x10c8da)[_0xcc73('0x39')](_0xcc73('0x3c'),'createdAt')[_0xcc73('0x39')](_0xcc73('0x3c'),_0xcc73('0x37'))[_0xcc73('0x3d')](_0xcc73('0x3e'))[_0xcc73('0x3f')](_0xcc73('0x40'))[_0xcc73('0x3f')]('ListId\x20=\x20?',LISTID[_0xcc73('0x3b')]())[_0xcc73('0x3f')](_0xcc73('0x46'),squel[_0xcc73('0x49')](hopperContacts))[_0xcc73('0x3f')](_0xcc73('0x47')))[_0xcc73('0x3b')]();return _0x471207;}return db[_0xcc73('0x4b')][_0xcc73('0x4c')]({'where':{'type':_0xcc73('0x4d')},'attributes':['id',_0xcc73('0x4e')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xcc73('0x2d')](function(_0x5a5017){var _0x3c7100=[];if(_0x5a5017){var _0x375f23;for(var _0x16ec33=0x0,_0x31340d;_0x16ec33<_0x5a5017['length'];_0x16ec33+=0x1){_0x31340d=_0x5a5017[_0x16ec33][_0xcc73('0x4f')]({'plain':!![]});switch(_0x31340d[_0xcc73('0x4e')]){case'always':_0x3c7100[_0xcc73('0x50')](db[_0xcc73('0x51')][_0xcc73('0x52')](_0x4af5da(_0x31340d,_0xcc73('0x53')))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));break;case _0xcc73('0x54'):_0x3c7100['push'](db[_0xcc73('0x51')][_0xcc73('0x52')](_0x47f095(_0x31340d,'VoiceQueueId'))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));break;default:_0x3c7100[_0xcc73('0x50')](db[_0xcc73('0x51')]['query'](_0x3248e4(_0x31340d,_0xcc73('0x53')))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));}}}return _0x3c7100;})['all']()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xcc73('0x4d')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xcc73('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x1a7d32){var _0x5813ea=[];if(_0x1a7d32){var _0x5ad261;for(var _0x49feb3=0x0,_0xd14a00;_0x49feb3<_0x1a7d32['length'];_0x49feb3+=0x1){_0xd14a00=_0x1a7d32[_0x49feb3][_0xcc73('0x4f')]({'plain':!![]});_0x5813ea[_0xcc73('0x50')](db['sequelize'][_0xcc73('0x52')](_0x39048f(_0xd14a00,_0xcc73('0x53')))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));}}return _0x5813ea;})[_0xcc73('0x56')]();})['then'](function(){return db[_0xcc73('0x57')]['findAll']({'attributes':['id',_0xcc73('0x4e')],'include':[{'model':db[_0xcc73('0x58')],'as':_0xcc73('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x1c208c){var _0x4ea55c=[];if(_0x1c208c){for(var _0x565d6c=0x0,_0x5b81df;_0x565d6c<_0x1c208c[_0xcc73('0x1a')];_0x565d6c+=0x1){_0x5b81df=_0x1c208c[_0x565d6c][_0xcc73('0x4f')]({'plain':!![]});switch(_0x5b81df[_0xcc73('0x4e')]){case'always':_0x4ea55c[_0xcc73('0x50')](db[_0xcc73('0x51')][_0xcc73('0x52')](_0x4af5da(_0x5b81df,_0xcc73('0x5a')))['then'](function(){})[_0xcc73('0x2f')](_0x2f9f41()));break;case _0xcc73('0x54'):_0x4ea55c[_0xcc73('0x50')](db['sequelize'][_0xcc73('0x52')](_0x47f095(_0x5b81df,_0xcc73('0x5a')))['then'](function(){})[_0xcc73('0x2f')](_0x2f9f41()));break;default:_0x4ea55c[_0xcc73('0x50')](db[_0xcc73('0x51')][_0xcc73('0x52')](_0x3248e4(_0x5b81df,_0xcc73('0x5a')))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));}}}return _0x4ea55c;})[_0xcc73('0x56')]();})[_0xcc73('0x2d')](function(){return db['Campaign'][_0xcc73('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xcc73('0x58')],'as':_0xcc73('0x55'),'where':{'id':LISTID}}]})[_0xcc73('0x2d')](function(_0x1e93f9){var _0x8859ff=[];if(_0x1e93f9){for(var _0x1d72f6=0x0,_0x506fa9;_0x1d72f6<_0x1e93f9[_0xcc73('0x1a')];_0x1d72f6+=0x1){_0x506fa9=_0x1e93f9[_0x1d72f6]['get']({'plain':!![]});_0x8859ff[_0xcc73('0x50')](db[_0xcc73('0x51')][_0xcc73('0x52')](_0x39048f(_0x506fa9,_0xcc73('0x5a')))[_0xcc73('0x2d')](function(){})[_0xcc73('0x2f')](_0x2f9f41()));}}return _0x8859ff;})[_0xcc73('0x56')]();})[_0xcc73('0x2f')](function(_0x264b3d){logger['error'](_0xcc73('0x5b'),'generalCheckHopper',_0x264b3d[_0xcc73('0x1c')]);});}var processPromises=function(_0x218961){return BPromise[_0xcc73('0x56')](promises)['then'](function(_0x1a3c44){})[_0xcc73('0x2f')](function(_0xb4e70d){logger[_0xcc73('0x17')]('Error\x20processing\x20rows\x20block:',JSON[_0xcc73('0x5c')](_0xb4e70d));})[_0xcc73('0x5d')](function(){socket['emit'](_0xcc73('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x218961){return _0x218961[_0xcc73('0x5f')]();}});};var endCsv=function(){return BPromise[_0xcc73('0x60')]()[_0xcc73('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xcc73('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcc73('0x61')](FILEPATH);}catch(_0x57c8f0){logger[_0xcc73('0x17')](_0xcc73('0x62'),JSON[_0xcc73('0x5c')](_0x57c8f0));}finally{process[_0xcc73('0x63')](0x0);}});};process['on'](_0xcc73('0x64'),function(){logger['info'](_0xcc73('0x65'));endCsv();});function main(){return BPromise[_0xcc73('0x60')]()[_0xcc73('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcc73('0x11')](',');return db[_0xcc73('0x2b')][_0xcc73('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcc73('0x2d')](function(_0x5221ca){var _0x12b64e=fs[_0xcc73('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x12b64e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x380f43,_0x585cfc){total+=0x1;var _0x46c956=total;promises[_0xcc73('0x50')](checkRow(_0x380f43,_0x5221ca,_0x46c956)[_0xcc73('0x2d')](function(){success+=0x1;})['catch'](function(_0x331c35){if(_0x331c35[_0xcc73('0x17')]){errors+=0x1;delete _0x331c35[_0xcc73('0x17')];}else if(_0x331c35[_0xcc73('0x67')]){duplicates+=0x1;delete _0x331c35[_0xcc73('0x67')];}rows[_0xcc73('0x50')](_0x331c35);}));if(total%0xc8===0x0){_0x585cfc[_0xcc73('0x68')]();return processPromises(_0x585cfc);}},'complete':function(){return processPromises()['then'](function(){logger[_0xcc73('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2029ef,_0x5d5a7f){logger[_0xcc73('0x69')](_0xcc73('0x6a'),JSON[_0xcc73('0x5c')](_0x2029ef));endCsv();}});})['catch'](function(_0x1a17f0){logger[_0xcc73('0x17')](_0xcc73('0x6b'),JSON[_0xcc73('0x5c')](_0x1a17f0));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 2109ab9..7277c50 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 _0x10f9=['.offset-cm_contacts.utcOffset\x20minute)','priority','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','utcOffset','set','dialTimezone','info','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','includes','header','ContactItemType','findAll','name','_description','parse','createReadStream','data','rows','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','appendFileSync','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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()','contactId','contactTypeId','orderBy','voice_queues_has_cm_blacklists','campaigns','CampaignId','VoiceQueueId','DROP\x20TABLE\x20','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','all','split','push','isNil','filter','length','CmContactHasItem','findOne','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','cm_hopper_black','ListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20'];(function(_0x5c4139,_0x12479e){var _0x5df4b6=function(_0xb532ce){while(--_0xb532ce){_0x5c4139['push'](_0x5c4139['shift']());}};_0x5df4b6(++_0x12479e);}(_0x10f9,0x69));var _0x910f=function(_0x1047ef,_0x46905a){_0x1047ef=_0x1047ef-0x0;var _0x4aea1d=_0x10f9[_0x1047ef];return _0x4aea1d;};'use strict';var fs=require('fs');var path=require(_0x910f('0x0'));var _=require(_0x910f('0x1'));var Papa=require(_0x910f('0x2'));var util=require(_0x910f('0x3'));var BPromise=require(_0x910f('0x4'));var moment=require(_0x910f('0x5'));var squel=require(_0x910f('0x6'));var Redis=require(_0x910f('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x910f('0x8'));var shared=require(_0x910f('0x9'));var logger=require(_0x910f('0xa'))(_0x910f('0xb'));config[_0x910f('0xc')]=_[_0x910f('0xd')](config[_0x910f('0xc')],{'host':_0x910f('0xe'),'port':0x18eb});var socket=require(_0x910f('0xf'))(new Redis(config[_0x910f('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x910f('0x10')](_0x910f('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x910f('0x10')](_0x910f('0x11'));function isEmail(_0x45772b){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))*$/[_0x910f('0x12')](_0x45772b);}function selectNotIn(_0x52087b,_0x22b933,_0x1314e3,_0x3e716a,_0x1429ac){return squel[_0x910f('0x13')]()['field'](_0x910f('0x14'))[_0x910f('0x15')](_0x3e716a)[_0x910f('0x16')](_0x22b933,null,_0x22b933+_0x910f('0x17')+_0x3e716a+'.'+_0x1314e3)[_0x910f('0x18')](_0x3e716a+'.'+_0x1314e3+_0x910f('0x19')+_0x52087b+'.'+_0x1314e3)['where'](_0x22b933+_0x910f('0x1a')+_0x1429ac['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x181cfa,_0x54a58b){promisesAdditionalPhones=[];return db[_0x910f('0x1b')]['findAll']({'raw':!![],'attributes':['id',_0x910f('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x910f('0x1d')](function(_0x53c49e){if(_0x53c49e!==null){var _0x3b6611=[];for(var _0x7dcf3b=0x0;_0x7dcf3b<_0x53c49e['length'];_0x7dcf3b++){var _0x3efed8=_0x53c49e[_0x7dcf3b];_0x3b6611['push'](insertAdditionalPhones(_0x3efed8));}}Promise[_0x910f('0x1e')](_0x3b6611)[_0x910f('0x1d')](function(){_0x181cfa({'val':0x1});});});});}function insertAdditionalPhones(_0x366aef){return new Promise(function(_0x45a61d,_0x3ae156){var _0x205723=_0x366aef[_0x910f('0x1c')];var _0x599c20=_0x205723[_0x910f('0x1f')](';');var _0x30c137=[];orderBy=0x0;for(var _0x3dbf3b=0x0;_0x3dbf3b<_0x599c20['length'];_0x3dbf3b++){_0x30c137[_0x910f('0x20')](splitAdditionalPhone(_0x366aef['id'],_0x599c20[_0x3dbf3b]));}Promise[_0x910f('0x1e')](_0x30c137)['then'](function(){_0x45a61d({'val':_0x599c20['length']});});});}function splitAdditionalPhone(_0x3520e8,_0x1189f2){return new Promise(function(_0x1ba677,_0x112e3c){var _0x369b05=_0x1189f2[_0x910f('0x1f')](':');var _0x1ad83b=_0x369b05[0x0];var _0x6bce91=_0x369b05[0x1];if(!_[_0x910f('0x21')](_0x6bce91)){var _0x27f993=_0x6bce91['split']('|');var _0x17b388=[];for(var _0x5cdcf0=0x0;_0x5cdcf0<_0x27f993['length'];_0x5cdcf0++){if(_0x27f993[_0x5cdcf0]!==''){var _0x25c10b=_[_0x910f('0x22')](promisesAdditionalPhones,{'contactId':_0x3520e8,'phone':_0x27f993[_0x5cdcf0]});if(_0x25c10b[_0x910f('0x23')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3520e8,'contactTypeId':_0x1ad83b,'phone':_0x27f993[_0x5cdcf0],'orderBy':orderBy});}}}_0x1ba677({'ok':0x1});}else _0x1ba677({'res':0x0});});}function createAdditionalPhone(_0x5cb8b1,_0x3c1fee,_0x48df81,_0x1239c2){var _0x21fce0='';var _0x5c35ba='';var _0xd63646=_0x48df81['split']('§');_0x21fce0=_0xd63646[0x0];if(_0xd63646[_0x910f('0x23')]==0x2)_0x5c35ba=_0xd63646[0x1];return new Promise(function(_0x40fad8,_0x2a6f21){return db[_0x910f('0x24')][_0x910f('0x25')]({'where':{'CmContactId':_0x5cb8b1,'item':_0x21fce0}})[_0x910f('0x1d')](function(_0x21a501){if(_0x21a501){return db['CmContactHasItem']['update']({'ItemTypeId':_0x3c1fee,'description':_0x5c35ba,'OrderBy':_0x1239c2},{'where':{'CmContactId':_0x5cb8b1,'item':_0x21fce0}})[_0x910f('0x1d')](function(_0x397ff0){_0x40fad8({'res':_0x910f('0x26')});});}else{return db[_0x910f('0x24')][_0x910f('0x27')]({'CmContactId':_0x5cb8b1,'item':_0x21fce0,'description':_0x5c35ba,'ItemTypeId':_0x3c1fee,'OrderBy':_0x1239c2,'ItemClass':_0x910f('0x28')})['then'](function(_0x2d4187){_0x40fad8({'res':'inserted'});});}});});}function insertCmHopper(_0x1c27d7,_0x2f4e25,_0x2e2c74,_0x3fe079,_0x18c893){var _0x2a7f71=[_0x910f('0x29'),_0x910f('0x2a'),_0x910f('0x2b'),_0x910f('0x2c'),_0x2f4e25+'.'+_0x3fe079,_0x910f('0x2d'),_0x910f('0x2e'),_0x910f('0x2f'),_0x910f('0x30'),'\x22'+_0x18c893+'\x22'];return squel['insert']()[_0x910f('0x31')](_0x910f('0x32'))[_0x910f('0x33')](['phone',_0x910f('0x34'),_0x910f('0x35'),'ListId',_0x3fe079,_0x910f('0x36'),_0x910f('0x37'),'priority',_0x910f('0x38'),_0x910f('0x39')],squel[_0x910f('0x13')]()[_0x910f('0x3a')](_0x2a7f71)[_0x910f('0x15')](_0x2f4e25)[_0x910f('0x16')](_0x910f('0x3b'),null,_0x910f('0x3c')+_0x2f4e25+_0x910f('0x3d'))[_0x910f('0x16')](_0x2e2c74,null,_0x2e2c74+_0x910f('0x17')+_0x2f4e25+'.'+_0x3fe079)[_0x910f('0x18')](_0x2f4e25+'.CmListId\x20=\x20?',_0x1c27d7)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x910f('0x18')](_0x910f('0x3e'),selectNotIn(_0x2f4e25,_0x2e2c74,_0x3fe079,_0x910f('0x32'),[_0x910f('0x3f'),'\x22onlyIfOpen\x22']))[_0x910f('0x18')](_0x910f('0x3e'),selectNotIn(_0x2f4e25,_0x2e2c74,_0x3fe079,_0x910f('0x32'),[_0x910f('0x3f')])))[_0x910f('0x40')]();}function insertCmHopperBlack(_0x5becac,_0x584a46,_0x42c444,_0x279cc1){var _0x5f2b98=[_0x910f('0x29'),_0x910f('0x2b'),'cm_contacts.ListId',_0x584a46+'.'+_0x279cc1,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x910f('0x41')]()['into'](_0x910f('0x42'))[_0x910f('0x33')]([_0x910f('0x14'),_0x910f('0x35'),_0x910f('0x43'),_0x279cc1,_0x910f('0x36'),_0x910f('0x37')],squel['select']()['fields'](_0x5f2b98)[_0x910f('0x15')](_0x584a46)[_0x910f('0x16')](_0x910f('0x3b'),null,_0x910f('0x3c')+_0x584a46+_0x910f('0x3d'))[_0x910f('0x16')](_0x42c444,null,_0x42c444+_0x910f('0x17')+_0x584a46+'.'+_0x279cc1)[_0x910f('0x18')](_0x584a46+_0x910f('0x44'),_0x5becac)['where'](_0x910f('0x45'),NOW)[_0x910f('0x18')](_0x910f('0x3e'),squel[_0x910f('0x13')]()[_0x910f('0x46')](_0x910f('0x14'))[_0x910f('0x15')](_0x910f('0x42'))[_0x910f('0x18')](_0x910f('0x47'),_0x5becac)[_0x910f('0x18')](_0x279cc1+_0x910f('0x19')+_0x584a46+'.'+_0x279cc1)))[_0x910f('0x40')]();}function insertTzCmHopper(_0xf706c3,_0x2c7372,_0x169737,_0x3cbb10,_0x262f40,_0x49ca18){var _0x47664b=[_0x910f('0x29'),_0x910f('0x48')+_0x49ca18+_0x910f('0x49'),_0x910f('0x2b'),'cm_contacts.ListId',_0x2c7372+'.'+_0x3cbb10,_0x910f('0x2d'),_0x910f('0x2e'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x262f40+'\x22'];var _0x1c4009=squel['insert']()['into'](_0x910f('0x32'))[_0x910f('0x33')](['phone',_0x910f('0x34'),'ContactId',_0x910f('0x43'),_0x3cbb10,_0x910f('0x36'),_0x910f('0x37'),_0x910f('0x4a'),'UserId',_0x910f('0x39')],squel[_0x910f('0x13')]()['fields'](_0x47664b)[_0x910f('0x15')](_0x2c7372)['join']('cm_contacts',null,_0x910f('0x3c')+_0x2c7372+_0x910f('0x3d'))[_0x910f('0x16')](_0x169737,null,_0x169737+_0x910f('0x17')+_0x2c7372+'.'+_0x3cbb10)[_0x910f('0x16')](_0x49ca18,null,_0x49ca18+'.id\x20=\x20'+_0x2c7372+'.'+_0x3cbb10)[_0x910f('0x18')](_0x2c7372+'.CmListId\x20=\x20?',_0xf706c3)[_0x910f('0x18')](_0x910f('0x45'),NOW)[_0x910f('0x18')](_0x910f('0x3e'),selectNotIn(_0x2c7372,_0x169737,_0x3cbb10,'cm_hopper',[_0x910f('0x3f'),_0x910f('0x4b')]))['where'](_0x910f('0x3e'),selectNotIn(_0x2c7372,_0x169737,_0x3cbb10,'cm_hopper',[_0x910f('0x3f')])))[_0x910f('0x40')]();return _0x1c4009;}function insertTzCmHopperBlack(_0x3dbff6,_0x456672,_0x3794d7,_0xe67b4d){var _0x131722=[_0x910f('0x29'),_0x910f('0x2b'),_0x910f('0x2c'),_0x456672+'.'+_0xe67b4d,'cm_contacts.createdAt',_0x910f('0x2e')];return squel[_0x910f('0x41')]()[_0x910f('0x31')](_0x910f('0x42'))['fromQuery']([_0x910f('0x14'),_0x910f('0x35'),_0x910f('0x43'),_0xe67b4d,'createdAt',_0x910f('0x37')],squel[_0x910f('0x13')]()[_0x910f('0x3a')](_0x131722)['from'](_0x456672)[_0x910f('0x16')](_0x910f('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x456672+_0x910f('0x3d'))[_0x910f('0x16')](_0x3794d7,null,_0x3794d7+'.id\x20=\x20'+_0x456672+'.'+_0xe67b4d)[_0x910f('0x18')](_0x456672+_0x910f('0x44'),_0x3dbff6)[_0x910f('0x18')](_0x910f('0x45'),NOW)[_0x910f('0x18')](_0x910f('0x3e'),squel[_0x910f('0x13')]()[_0x910f('0x46')](_0x910f('0x14'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x3dbff6)['where'](_0xe67b4d+'\x20=\x20'+_0x456672+'.'+_0xe67b4d)))[_0x910f('0x40')]();}function insertCmHopperAdditionalPhones(_0x597a18){var _0x74b4a2=[_0x910f('0x4c'),_0x910f('0x4d'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x910f('0x4e')];return squel[_0x910f('0x41')]()[_0x910f('0x31')](_0x910f('0x4f'))[_0x910f('0x33')](['CmHopperId',_0x910f('0x14'),'OrderBy',_0x910f('0x36'),'updatedAt'],squel[_0x910f('0x13')]()[_0x910f('0x3a')](_0x74b4a2)[_0x910f('0x15')](_0x910f('0x32'))[_0x910f('0x16')](_0x910f('0x3b'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x910f('0x16')](_0x910f('0x50'),null,_0x910f('0x51'))[_0x910f('0x18')](_0x910f('0x52'),_0x597a18)[_0x910f('0x18')](_0x910f('0x45'),NOW))[_0x910f('0x40')]();}function insertCmContact(_0x4da5f7,_0x575f07,_0x5f4adb,_0x29a8aa){var _0x27350c=_['concat'](_[_0x910f('0x53')](_0x29a8aa),[_0x910f('0x43'),_0x910f('0x54'),'createdAt','updatedAt']);return squel[_0x910f('0x41')]()[_0x910f('0x31')](_0x910f('0x3b'))[_0x910f('0x33')](_0x27350c,squel[_0x910f('0x13')]()[_0x910f('0x3a')](_0x27350c)[_0x910f('0x15')](_0x575f07)[_0x910f('0x18')]('('+_0x5f4adb[_0x910f('0x16')](',')+_0x910f('0x55'),squel['select']()[_0x910f('0x3a')](_0x5f4adb)[_0x910f('0x15')]('cm_contacts')[_0x910f('0x18')]('ListId\x20=\x20?',_0x4da5f7)[_0x910f('0x18')](_0x910f('0x56')))[_0x910f('0x18')](_0x910f('0x57'),squel['select']()[_0x910f('0x46')](_0x910f('0x58'),'min_id')[_0x910f('0x15')](_0x575f07)[_0x910f('0x59')](_0x5f4adb[_0x910f('0x16')](','))))[_0x910f('0x40')]();}function handleStop(){logger['info'](_0x910f('0x5a'));stopped=!![];}function handleUncaughtException(_0x3f30b3){logger[_0x910f('0x5b')](_0x3f30b3[_0x910f('0x5c')]);process[_0x910f('0x5d')](0x1);}function handleError(_0x3f3cae,_0x255c83){stats[_0x910f('0x5e')][_0x910f('0x20')]({'name':_0x255c83[_0x910f('0x5f')],'message':_0x255c83[_0x910f('0x5c')],'row':_0x3f3cae});}function handleQuery(_0x30fa81){logger['info'](_0x30fa81);return db[_0x910f('0x60')][_0x910f('0x61')](_0x30fa81)[_0x910f('0x62')](function(_0x45cdd5){results[_0x910f('0x20')](_0x45cdd5);})[_0x910f('0x63')](function(_0xd62b9f){logger['error'](_0xd62b9f['message']);});}function updateTzCampaigns(_0x2458bd){return new Promise(function(_0x311505,_0x59ba1d){var _0x2db270=squel[_0x910f('0x13')]()[_0x910f('0x3a')]([_0x910f('0x64'),_0x910f('0x65')])[_0x910f('0x15')]('campaigns')[_0x910f('0x16')]('campaigns_has_cm_lists',null,_0x910f('0x66'))[_0x910f('0x18')](_0x910f('0x67')+_0x2458bd);db[_0x910f('0x60')][_0x910f('0x61')](_0x2db270[_0x910f('0x40')]())[_0x910f('0x62')](function(_0x4275c6){var _0x49c080=[];for(var _0x4ce893=0x0;_0x4ce893<_0x4275c6[_0x910f('0x23')];_0x4ce893++){_0x49c080[_0x910f('0x20')](getTimezoneData(_0x4275c6[_0x4ce893],tmp_campaigns));}BPromise[_0x910f('0x1e')](_0x49c080)[_0x910f('0x1d')](function(){_0x311505({'val':0x1});});})['catch'](function(_0x5ab917){logger[_0x910f('0x5b')](_0x5ab917[_0x910f('0x5c')]);_0x311505({'val':0x0});});});}function updateTzVoiceQueues(_0x13c9ab){return new Promise(function(_0x37a72f,_0x5f7c0e){var _0xe45e54=squel[_0x910f('0x13')]()[_0x910f('0x3a')]([_0x910f('0x68'),'voice_queues.dialTimezone'])[_0x910f('0x15')](_0x910f('0x69'))[_0x910f('0x16')](_0x910f('0x6a'),null,_0x910f('0x6b'))[_0x910f('0x18')]('voice_queues_has_cm_lists.CmListId='+_0x13c9ab);db[_0x910f('0x60')][_0x910f('0x61')](_0xe45e54[_0x910f('0x40')]())[_0x910f('0x62')](function(_0x4488c4){var _0x1e0b98=[];for(var _0x161134=0x0;_0x161134<_0x4488c4['length'];_0x161134++){_0x1e0b98[_0x910f('0x20')](getTimezoneData(_0x4488c4[_0x161134],tmp_voice_queues));}BPromise['all'](_0x1e0b98)[_0x910f('0x1d')](function(){_0x37a72f({'val':0x1});});})[_0x910f('0x63')](function(_0xa81cb3){logger['error'](_0xa81cb3['message']);_0x37a72f({'val':0x0});});});}function getTimezoneData(_0x16b6ae,_0x150728){return new Promise(function(_0x931cea,_0x279230){var _0x477c0f=shared[_0x910f('0x6c')];var _0x207be1=_0x477c0f[_0x16b6ae['dialTimezone']];if(_['isNil'](_0x207be1)){_0x931cea({'ret':0x1});}else{var _0x8c7e61=_0x207be1[_0x910f('0x6d')];var _0x5181a1=squel[_0x910f('0x41')]()[_0x910f('0x31')](_0x150728)[_0x910f('0x6e')]('id',_0x16b6ae['id'])[_0x910f('0x6e')]('offset',_0x8c7e61)[_0x910f('0x6e')](_0x910f('0x6f'),_0x16b6ae[_0x910f('0x6f')])[_0x910f('0x40')]();return db['sequelize'][_0x910f('0x61')](_0x5181a1)['spread'](function(_0x4655fb){_0x931cea({'ret':0x1});})[_0x910f('0x63')](function(_0x10cf9c){logger[_0x910f('0x5b')](_0x10cf9c[_0x910f('0x5c')]);_0x279230({'ret':0x1});});}});}function handleTZQuery(_0x184047){logger['info'](_0x184047);return db['sequelize'][_0x910f('0x61')](_0x184047)['spread'](function(_0x4fc140){})[_0x910f('0x63')](function(_0xb27ea4){logger['error'](_0xb27ea4[_0x910f('0x5c')]);});}function main(_0x313936,_0x45b39d,_0x35b55a,_0xc3e613){logger[_0x910f('0x70')](_0x910f('0x71'),_0x313936,JSON['stringify'](_0x45b39d));process[_0x910f('0x72')](_0x910f('0x73'));var _0x23cb2f=_0x45b39d[_0x910f('0x74')];var _0x52629e=_[_0x910f('0x75')](_0x23cb2f);var _0x3126ed=_0x45b39d[_0x910f('0x76')];var _0x433e86=path[_0x910f('0x16')](config[_0x910f('0x77')],_0x910f('0x78'),_0x3126ed+'.csv');hasTZ=_[_0x910f('0x53')](_0x23cb2f)[_0x910f('0x79')]('dialTimezone');var _0xe80371=_[_0x910f('0x53')](_0x23cb2f)[_0x910f('0x16')]();logger[_0x910f('0x70')](_0x910f('0x7a'),_0xe80371);db[_0x910f('0x7b')][_0x910f('0x7c')]({'raw':!![],'attributes':['id',_0x910f('0x7d')]})['then'](function(_0x4da836){for(var _0x3a1978=0x0;_0x3a1978<_0x4da836[_0x910f('0x23')];_0x3a1978++){if(_0x4da836[_0x3a1978][_0x910f('0x7d')]in _0x23cb2f){contactItemTypes[_0x910f('0x20')](_0x4da836[_0x3a1978]);delete _0x52629e[_0x4da836[_0x3a1978][_0x910f('0x7d')]];hasAdditionalPhones=!![];}for(var _0x32b9b2 in _0x23cb2f){if(_0x4da836[_0x3a1978][_0x910f('0x7d')]+_0x910f('0x7e')===_0x32b9b2){phoneDescriptions[_0x910f('0x20')]({'itemTypeId':_0x4da836[_0x3a1978]['id'],'description':_0x32b9b2});delete _0x52629e[_0x32b9b2];}}}if(hasAdditionalPhones)_0x52629e[_0x910f('0x1c')]='';var _0x56dcc3=_[_0x910f('0x53')](_0x52629e)[_0x910f('0x16')]();logger['info'](_0x910f('0x7a'),_0x56dcc3);fs['writeFileSync'](_0x433e86,_0x56dcc3+'\x0a');Papa[_0x910f('0x7f')](fs[_0x910f('0x80')](_0x313936),{'header':!![],'skipEmptyLines':!![],'step':function(_0x24cea4,_0x2b7a68){try{for(var _0x2096ac=0x0,_0x4fa064=[];_0x2096ac<_0x24cea4[_0x910f('0x81')][_0x910f('0x23')];_0x2096ac++){stats[_0x910f('0x82')]+=0x1;if(_0x24cea4[_0x910f('0x5e')][_0x2096ac]){handleError(_0x24cea4[_0x910f('0x81')][_0x2096ac],_0x24cea4[_0x910f('0x5e')][_0x2096ac]);}else{var _0x2a1df3=[];var _0x8e9570=[];var _0x38b9b2={};for(var _0x35c010 in _0x23cb2f){let _0xa91e3a=contactItemTypes[_0x910f('0x83')](_0x3ccd5f=>_0x3ccd5f[_0x910f('0x7d')]===_0x35c010);let _0x539109=contactItemTypes[_0x910f('0x83')](_0x369462=>_0x369462[_0x910f('0x7d')]+_0x910f('0x7e')===_0x35c010);if(_[_0x910f('0x21')](_0xa91e3a)&&_[_0x910f('0x21')](_0x539109)){if(_0x23cb2f['hasOwnProperty'](_0x35c010)){if(_0x24cea4['data'][_0x2096ac][_0x23cb2f[_0x35c010]]){var _0x386188=_[_0x910f('0x84')](_0x24cea4[_0x910f('0x81')][_0x2096ac][_0x23cb2f[_0x35c010]][_0x910f('0x85')](/"/g,'\x27'));switch(_0x35c010){case _0x910f('0x34'):var _0x289949=moment(_0x386188,_0x910f('0x11'),!![]);if(_0x289949['isValid']()){_0x4fa064[_0x910f('0x20')]('\x22'+_0x386188+'\x22');}else{_0x2a1df3[_0x910f('0x20')](_0x910f('0x86'));}break;case _0x910f('0x4a'):var _0x29d981=parseInt(_0x386188);_0x386188=_['isNaN'](_0x29d981)||_0x29d981<0x0||_0x29d981>0x4?_0xc3e613?0x3:0x2:_0x29d981;_0x4fa064['push']('\x22'+_0x386188+'\x22');break;case _0x910f('0x38'):var _0x5de3ec=parseInt(_0x386188);if(_['isNumber'](_0x5de3ec)&&_[_0x910f('0x79')](_0x35b55a,_0x5de3ec)){_0x4fa064[_0x910f('0x20')]('\x22'+_0x5de3ec+'\x22');}else{_0x2a1df3[_0x910f('0x20')]('agent\x20not\x20exists');}break;case _0x910f('0x87'):if(isEmail(_0x386188)){_0x4fa064['push']('\x22'+_0x386188+'\x22');}else{_0x2a1df3['push'](_0x910f('0x88'));}break;case _0x910f('0x89'):var _0x905bb7=moment(_0x386188,_0x910f('0x8a'),!![]);if(_0x905bb7[_0x910f('0x8b')]()){_0x4fa064[_0x910f('0x20')]('\x22'+_0x386188+'\x22');}else{_0x2a1df3[_0x910f('0x20')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0xa111c0=shared[_0x910f('0x6c')];var _0x29b349=_0xa111c0[_0x386188];if(!_[_0x910f('0x21')](_0x29b349)){var _0x3af32b=_0x29b349[_0x910f('0x6d')];_0x4fa064[_0x910f('0x20')]('\x22'+_0x386188+'\x22');_0x4fa064[_0x910f('0x20')]('\x22'+_0x3af32b+'\x22');}break;default:_0x4fa064[_0x910f('0x20')]('\x22'+_0x386188+'\x22');}}else{switch(_0x35c010){case _0x910f('0x8c'):case _0x910f('0x14'):_0x2a1df3[_0x910f('0x20')](_0x35c010+_0x910f('0x8d'));break;default:_0x4fa064['push']('\x22\x22');}}}}else{var _0xdd3cab='';if(!_[_0x910f('0x21')](_0xa91e3a)){if(!_0x38b9b2[_0x910f('0x8e')](_0xa91e3a['id'])){if(!_[_0x910f('0x21')](_0x24cea4[_0x910f('0x81')][_0x2096ac][_0x23cb2f[_0x35c010]])){var _0x386188=_['trim'](_0x24cea4['data'][_0x2096ac][_0x23cb2f[_0x35c010]]['replace'](/"/g,'\x27'));var _0x43ee19=phoneDescriptions[_0x910f('0x83')](_0x12a8fb=>_0x12a8fb[_0x910f('0x8f')]===_0xa91e3a['id']);if(!_['isNil'](_0x43ee19)){var _0x9187c8=_[_0x910f('0x84')](_0x24cea4['data'][_0x2096ac][_0x23cb2f[_0x43ee19['description']]][_0x910f('0x85')](/"/g,'\x27'));if(!_[_0x910f('0x21')](_0x9187c8))_0x386188=_0x386188+'§'+_0x9187c8;}if(_0xdd3cab=='')_0xdd3cab=_0x386188;else _0xdd3cab+='|'+_0x386188;}_0x8e9570['push'](_0xa91e3a['id']+':'+_0xdd3cab);_0x38b9b2[_0xa91e3a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4fa064['push']('\x22'+_0x8e9570[_0x910f('0x16')](';')+'\x22');}if(_0x2a1df3['length']){handleError(_0x24cea4[_0x910f('0x81')][_0x2096ac],{'code':'SystemRow','message':_0x2a1df3[_0x910f('0x16')]()});}else{fs[_0x910f('0x90')](_0x433e86,_0x4fa064[_0x910f('0x16')]()+'\x0a');}_0x4fa064=[];}if(!(stats[_0x910f('0x82')]%0xc8)){socket[_0x910f('0x91')](_0x910f('0x92')+_0x3126ed,stats);stats[_0x910f('0x5e')]=[];}}if(stopped){logger[_0x910f('0x70')]('Abort\x20parser');_0x2b7a68['abort']();}}catch(_0x2963b5){handleError(_0x24cea4[_0x910f('0x81')][_0x2096ac],{'code':_0x910f('0x93'),'message':_0x2963b5[_0x910f('0x5c')]});logger[_0x910f('0x5b')](_0x910f('0x94'),_0x2963b5[_0x910f('0x5c')]);}},'complete':function(){try{var _0x37dcb0=[];var _0xb92605=[];var _0x53f650=_0x910f('0x3b');if(_0x45b39d['duplicates']&&_0x45b39d[_0x910f('0x95')]['length']){_0x53f650=_0x910f('0x96')+_0x3126ed;_0x37dcb0[_0x910f('0x20')](_0x910f('0x97')+_0x53f650+_0x910f('0x98'));}tmp_campaigns='campaigns_'+_0x3126ed;tmp_voice_queues=_0x910f('0x99')+_0x3126ed;_0xb92605['push'](_0x910f('0x97')+tmp_campaigns+_0x910f('0x9a'));_0xb92605['push'](_0x910f('0x97')+tmp_voice_queues+_0x910f('0x9a'));BPromise[_0x910f('0x9b')](_0xb92605,handleTZQuery)['then'](function(_0x22ae6b){updateTzCampaigns(_0x45b39d[_0x910f('0x43')])[_0x910f('0x1d')](function(_0x1dd647){updateTzVoiceQueues(_0x45b39d[_0x910f('0x43')])[_0x910f('0x1d')](function(_0x3ceb80){if(hasTZ)_0x56dcc3=_0x56dcc3[_0x910f('0x85')](_0x910f('0x6f'),_0x910f('0x9c'));var _0x1b5289=util[_0x910f('0x10')](_0x910f('0x9d'),_0x433e86,_0x53f650,_0x56dcc3,_0x45b39d[_0x910f('0x43')],_0x45b39d[_0x910f('0x54')]||null,NOW,NOW);if(_['isNil'](_0x23cb2f['scheduledat'])){_0x1b5289+=_0x910f('0x9e');}_0x37dcb0[_0x910f('0x20')](_0x1b5289);if(_0x45b39d[_0x910f('0x95')]&&_0x45b39d[_0x910f('0x95')][_0x910f('0x23')]){_0x37dcb0[_0x910f('0x20')](insertCmContact(_0x45b39d[_0x910f('0x43')],_0x53f650,_0x45b39d[_0x910f('0x95')],_0x23cb2f));_0x37dcb0['push']('DROP\x20TABLE\x20'+_0x53f650+';');}BPromise[_0x910f('0x9b')](_0x37dcb0,handleQuery)[_0x910f('0x1d')](function(_0x1a23d9){BPromise['all']([handleAdditionalPhones()])[_0x910f('0x1d')](function(){_0x37dcb0=[];for(var _0x4af32a=0x0;_0x4af32a\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','updated','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert'];(function(_0x21e06e,_0x386fca){var _0x3cdb04=function(_0x1b6bc8){while(--_0x1b6bc8){_0x21e06e['push'](_0x21e06e['shift']());}};_0x3cdb04(++_0x386fca);}(_0x6deb,0x8c));var _0xb6de=function(_0x203320,_0x2f2a61){_0x203320=_0x203320-0x0;var _0x4ec10f=_0x6deb[_0x203320];return _0x4ec10f;};'use strict';var fs=require('fs');var path=require(_0xb6de('0x0'));var _=require(_0xb6de('0x1'));var Papa=require('papaparse');var util=require(_0xb6de('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require('squel');var Redis=require(_0xb6de('0x3'));var db=require(_0xb6de('0x4'))['db'];var config=require(_0xb6de('0x5'));var shared=require(_0xb6de('0x6'));var logger=require(_0xb6de('0x7'))('import');config[_0xb6de('0x8')]=_[_0xb6de('0x9')](config[_0xb6de('0x8')],{'host':_0xb6de('0xa'),'port':0x18eb});var socket=require(_0xb6de('0xb'))(new Redis(config[_0xb6de('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb6de('0xc')](_0xb6de('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xb6de('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x241989){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))*$/[_0xb6de('0xe')](_0x241989);}function selectNotIn(_0x156ddc,_0x1c384b,_0xfd10ed,_0x153e8e,_0x2db191){return squel['select']()[_0xb6de('0xf')](_0xb6de('0x10'))['from'](_0x153e8e)['join'](_0x1c384b,null,_0x1c384b+_0xb6de('0x11')+_0x153e8e+'.'+_0xfd10ed)[_0xb6de('0x12')](_0x153e8e+'.'+_0xfd10ed+_0xb6de('0x13')+_0x156ddc+'.'+_0xfd10ed)['where'](_0x1c384b+_0xb6de('0x14')+_0x2db191[_0xb6de('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x455cf2,_0x2365a6){promisesAdditionalPhones=[];return db['CmContact'][_0xb6de('0x16')]({'raw':!![],'attributes':['id',_0xb6de('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xb6de('0x18')](function(_0x2013e3){if(_0x2013e3!==null){var _0x56f3d7=[];for(var _0x53d2ed=0x0;_0x53d2ed<_0x2013e3[_0xb6de('0x19')];_0x53d2ed++){var _0xf9292d=_0x2013e3[_0x53d2ed];_0x56f3d7[_0xb6de('0x1a')](insertAdditionalPhones(_0xf9292d));}}Promise[_0xb6de('0x1b')](_0x56f3d7)[_0xb6de('0x18')](function(){_0x455cf2({'val':0x1});});});});}function insertAdditionalPhones(_0x2a70e0){return new Promise(function(_0x390291,_0x5910e0){var _0xe2ee7=_0x2a70e0[_0xb6de('0x17')];var _0x125d2d=_0xe2ee7[_0xb6de('0x1c')](';');var _0x4c3425=[];orderBy=0x0;for(var _0xeb2861=0x0;_0xeb2861<_0x125d2d['length'];_0xeb2861++){_0x4c3425['push'](splitAdditionalPhone(_0x2a70e0['id'],_0x125d2d[_0xeb2861]));}Promise[_0xb6de('0x1b')](_0x4c3425)[_0xb6de('0x18')](function(){_0x390291({'val':_0x125d2d[_0xb6de('0x19')]});});});}function splitAdditionalPhone(_0x2b8385,_0x35755f){return new Promise(function(_0x187407,_0x3f4ea9){var _0x28eab4=_0x35755f[_0xb6de('0x1c')](':');var _0x3eaaef=_0x28eab4[0x0];var _0x1ec150=_0x28eab4[0x1];if(!_[_0xb6de('0x1d')](_0x1ec150)){var _0xeb8ef2=_0x1ec150[_0xb6de('0x1c')]('|');var _0x3b5589=[];for(var _0x2a9017=0x0;_0x2a9017<_0xeb8ef2['length'];_0x2a9017++){if(_0xeb8ef2[_0x2a9017]!==''){var _0x4abcf9=_[_0xb6de('0x1e')](promisesAdditionalPhones,{'contactId':_0x2b8385,'phone':_0xeb8ef2[_0x2a9017]});if(_0x4abcf9[_0xb6de('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xb6de('0x1a')]({'contactId':_0x2b8385,'contactTypeId':_0x3eaaef,'phone':_0xeb8ef2[_0x2a9017],'orderBy':orderBy});}}}_0x187407({'ok':0x1});}else _0x187407({'res':0x0});});}function createAdditionalPhone(_0x47acfa,_0x3cd3bd,_0x5e0751,_0x5cee74){var _0x530fda='';var _0x267d72='';var _0x5ae36a=_0x5e0751['split']('§');_0x530fda=_0x5ae36a[0x0];if(_0x5ae36a[_0xb6de('0x19')]==0x2)_0x267d72=_0x5ae36a[0x1];return new Promise(function(_0x3bd310,_0x3e8fe7){return db[_0xb6de('0x1f')][_0xb6de('0x20')]({'where':{'CmContactId':_0x47acfa,'item':_0x530fda}})['then'](function(_0x24a733){if(_0x24a733){return db[_0xb6de('0x1f')][_0xb6de('0x21')]({'ItemTypeId':_0x3cd3bd,'description':_0x267d72,'OrderBy':_0x5cee74},{'where':{'CmContactId':_0x47acfa,'item':_0x530fda}})[_0xb6de('0x18')](function(_0x279336){_0x3bd310({'res':_0xb6de('0x22')});});}else{return db[_0xb6de('0x1f')]['create']({'CmContactId':_0x47acfa,'item':_0x530fda,'description':_0x267d72,'ItemTypeId':_0x3cd3bd,'OrderBy':_0x5cee74,'ItemClass':_0xb6de('0x23')})[_0xb6de('0x18')](function(_0x4e53ae){_0x3bd310({'res':'inserted'});});}});});}function insertCmHopper(_0x33649e,_0xfbd300,_0x471d57,_0x5a4b5d,_0x4f5525){var _0x2f0dc0=[_0xb6de('0x24'),_0xb6de('0x25'),_0xb6de('0x26'),_0xb6de('0x27'),_0xfbd300+'.'+_0x5a4b5d,_0xb6de('0x28'),'cm_contacts.updatedAt',_0xb6de('0x29'),_0xb6de('0x2a'),'\x22'+_0x4f5525+'\x22'];return squel[_0xb6de('0x2b')]()[_0xb6de('0x2c')]('cm_hopper')[_0xb6de('0x2d')]([_0xb6de('0x10'),_0xb6de('0x2e'),_0xb6de('0x2f'),_0xb6de('0x30'),_0x5a4b5d,'createdAt',_0xb6de('0x31'),_0xb6de('0x32'),_0xb6de('0x33'),_0xb6de('0x34')],squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x2f0dc0)[_0xb6de('0x37')](_0xfbd300)[_0xb6de('0x15')]('cm_contacts',null,_0xb6de('0x38')+_0xfbd300+_0xb6de('0x39'))[_0xb6de('0x15')](_0x471d57,null,_0x471d57+_0xb6de('0x11')+_0xfbd300+'.'+_0x5a4b5d)[_0xb6de('0x12')](_0xfbd300+'.CmListId\x20=\x20?',_0x33649e)[_0xb6de('0x12')](_0xb6de('0x3a'),NOW)[_0xb6de('0x12')](_0xb6de('0x3b'),selectNotIn(_0xfbd300,_0x471d57,_0x5a4b5d,_0xb6de('0x3c'),[_0xb6de('0x3d'),_0xb6de('0x3e')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xfbd300,_0x471d57,_0x5a4b5d,_0xb6de('0x3c'),[_0xb6de('0x3d')])))[_0xb6de('0x3f')]();}function insertCmHopperBlack(_0x5a5981,_0xb61255,_0x479293,_0x4af42a){var _0x5581be=[_0xb6de('0x24'),'cm_contacts.id',_0xb6de('0x27'),_0xb61255+'.'+_0x4af42a,_0xb6de('0x28'),'cm_contacts.updatedAt'];return squel[_0xb6de('0x2b')]()[_0xb6de('0x2c')](_0xb6de('0x40'))[_0xb6de('0x2d')]([_0xb6de('0x10'),'ContactId',_0xb6de('0x30'),_0x4af42a,_0xb6de('0x41'),_0xb6de('0x31')],squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x5581be)[_0xb6de('0x37')](_0xb61255)[_0xb6de('0x15')](_0xb6de('0x42'),null,_0xb6de('0x38')+_0xb61255+'.CmListId')['join'](_0x479293,null,_0x479293+_0xb6de('0x11')+_0xb61255+'.'+_0x4af42a)[_0xb6de('0x12')](_0xb61255+'.CmListId\x20=\x20?',_0x5a5981)[_0xb6de('0x12')](_0xb6de('0x3a'),NOW)['where'](_0xb6de('0x3b'),squel[_0xb6de('0x35')]()[_0xb6de('0xf')]('phone')[_0xb6de('0x37')]('cm_hopper_black')[_0xb6de('0x12')](_0xb6de('0x43'),_0x5a5981)[_0xb6de('0x12')](_0x4af42a+_0xb6de('0x13')+_0xb61255+'.'+_0x4af42a)))[_0xb6de('0x3f')]();}function insertTzCmHopper(_0x16baba,_0x448fe2,_0x76ab36,_0x3b8e92,_0x573c90,_0x1ce186){var _0x517933=['cm_contacts.phone',_0xb6de('0x44')+_0x1ce186+_0xb6de('0x45'),_0xb6de('0x26'),_0xb6de('0x27'),_0x448fe2+'.'+_0x3b8e92,_0xb6de('0x28'),_0xb6de('0x46'),'cm_contacts.priority',_0xb6de('0x2a'),'\x22'+_0x573c90+'\x22'];var _0x807d9a=squel[_0xb6de('0x2b')]()[_0xb6de('0x2c')](_0xb6de('0x3c'))[_0xb6de('0x2d')](['phone',_0xb6de('0x2e'),'ContactId',_0xb6de('0x30'),_0x3b8e92,_0xb6de('0x41'),_0xb6de('0x31'),_0xb6de('0x32'),_0xb6de('0x33'),_0xb6de('0x34')],squel['select']()['fields'](_0x517933)['from'](_0x448fe2)[_0xb6de('0x15')]('cm_contacts',null,_0xb6de('0x38')+_0x448fe2+_0xb6de('0x39'))[_0xb6de('0x15')](_0x76ab36,null,_0x76ab36+'.id\x20=\x20'+_0x448fe2+'.'+_0x3b8e92)[_0xb6de('0x15')](_0x1ce186,null,_0x1ce186+_0xb6de('0x11')+_0x448fe2+'.'+_0x3b8e92)[_0xb6de('0x12')](_0x448fe2+'.CmListId\x20=\x20?',_0x16baba)[_0xb6de('0x12')](_0xb6de('0x3a'),NOW)['where'](_0xb6de('0x3b'),selectNotIn(_0x448fe2,_0x76ab36,_0x3b8e92,_0xb6de('0x3c'),['\x22always\x22',_0xb6de('0x3e')]))[_0xb6de('0x12')](_0xb6de('0x3b'),selectNotIn(_0x448fe2,_0x76ab36,_0x3b8e92,_0xb6de('0x3c'),[_0xb6de('0x3d')])))[_0xb6de('0x3f')]();return _0x807d9a;}function insertTzCmHopperBlack(_0x749834,_0x4c483d,_0x4939da,_0x4baca2){var _0x10e123=[_0xb6de('0x24'),'cm_contacts.id','cm_contacts.ListId',_0x4c483d+'.'+_0x4baca2,'cm_contacts.createdAt',_0xb6de('0x46')];return squel[_0xb6de('0x2b')]()[_0xb6de('0x2c')](_0xb6de('0x40'))['fromQuery']([_0xb6de('0x10'),_0xb6de('0x2f'),_0xb6de('0x30'),_0x4baca2,_0xb6de('0x41'),_0xb6de('0x31')],squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x10e123)[_0xb6de('0x37')](_0x4c483d)[_0xb6de('0x15')](_0xb6de('0x42'),null,_0xb6de('0x38')+_0x4c483d+_0xb6de('0x39'))[_0xb6de('0x15')](_0x4939da,null,_0x4939da+_0xb6de('0x11')+_0x4c483d+'.'+_0x4baca2)[_0xb6de('0x12')](_0x4c483d+_0xb6de('0x47'),_0x749834)['where'](_0xb6de('0x3a'),NOW)['where'](_0xb6de('0x3b'),squel['select']()['field']('phone')[_0xb6de('0x37')](_0xb6de('0x40'))['where'](_0xb6de('0x43'),_0x749834)[_0xb6de('0x12')](_0x4baca2+_0xb6de('0x13')+_0x4c483d+'.'+_0x4baca2)))[_0xb6de('0x3f')]();}function insertCmHopperAdditionalPhones(_0x591bf8){var _0x416d17=[_0xb6de('0x48'),_0xb6de('0x49'),_0xb6de('0x4a'),_0xb6de('0x4b'),_0xb6de('0x4c')];return squel[_0xb6de('0x2b')]()[_0xb6de('0x2c')]('cm_hopper_additional_phones')['fromQuery']([_0xb6de('0x4d'),_0xb6de('0x10'),_0xb6de('0x4e'),_0xb6de('0x41'),_0xb6de('0x31')],squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x416d17)[_0xb6de('0x37')](_0xb6de('0x3c'))[_0xb6de('0x15')](_0xb6de('0x42'),null,_0xb6de('0x4f'))['join'](_0xb6de('0x50'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xb6de('0x12')](_0xb6de('0x51'),_0x591bf8)[_0xb6de('0x12')](_0xb6de('0x3a'),NOW))[_0xb6de('0x3f')]();}function insertCmContact(_0x4d67fa,_0x159229,_0x1ca8e0,_0x4766ce){var _0x5506f0=_[_0xb6de('0x52')](_[_0xb6de('0x53')](_0x4766ce),[_0xb6de('0x30'),_0xb6de('0x54'),_0xb6de('0x41'),'updatedAt']);return squel[_0xb6de('0x2b')]()['into']('cm_contacts')['fromQuery'](_0x5506f0,squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x5506f0)[_0xb6de('0x37')](_0x159229)[_0xb6de('0x12')]('('+_0x1ca8e0[_0xb6de('0x15')](',')+_0xb6de('0x55'),squel[_0xb6de('0x35')]()[_0xb6de('0x36')](_0x1ca8e0)[_0xb6de('0x37')]('cm_contacts')['where'](_0xb6de('0x43'),_0x4d67fa)[_0xb6de('0x12')](_0xb6de('0x56')))['where'](_0xb6de('0x57'),squel['select']()[_0xb6de('0xf')](_0xb6de('0x58'),_0xb6de('0x59'))['from'](_0x159229)[_0xb6de('0x5a')](_0x1ca8e0['join'](','))))[_0xb6de('0x3f')]();}function handleStop(){logger['info'](_0xb6de('0x5b'));stopped=!![];}function handleUncaughtException(_0x3b0ecd){logger[_0xb6de('0x5c')](_0x3b0ecd[_0xb6de('0x5d')]);process['exit'](0x1);}function handleError(_0x8e7881,_0x41ca5c){stats[_0xb6de('0x5e')][_0xb6de('0x1a')]({'name':_0x41ca5c[_0xb6de('0x5f')],'message':_0x41ca5c[_0xb6de('0x5d')],'row':_0x8e7881});}function handleQuery(_0x30c32c){logger[_0xb6de('0x60')](_0x30c32c);return db[_0xb6de('0x61')][_0xb6de('0x62')](_0x30c32c)[_0xb6de('0x63')](function(_0x173be9){results[_0xb6de('0x1a')](_0x173be9);})[_0xb6de('0x64')](function(_0x125f0d){logger[_0xb6de('0x5c')](_0x125f0d[_0xb6de('0x5d')]);});}function updateTzCampaigns(_0x582b23){return new Promise(function(_0x4e4ca9,_0x8ca82b){var _0x1bab20=squel[_0xb6de('0x35')]()['fields'](['campaigns.id',_0xb6de('0x65')])[_0xb6de('0x37')](_0xb6de('0x66'))['join'](_0xb6de('0x67'),null,_0xb6de('0x68'))[_0xb6de('0x12')]('campaigns_has_cm_lists.CmListId='+_0x582b23);db['sequelize'][_0xb6de('0x62')](_0x1bab20[_0xb6de('0x3f')]())[_0xb6de('0x63')](function(_0x577933){var _0x5154f3=[];for(var _0x3c8707=0x0;_0x3c8707<_0x577933['length'];_0x3c8707++){_0x5154f3[_0xb6de('0x1a')](getTimezoneData(_0x577933[_0x3c8707],tmp_campaigns));}BPromise[_0xb6de('0x1b')](_0x5154f3)[_0xb6de('0x18')](function(){_0x4e4ca9({'val':0x1});});})[_0xb6de('0x64')](function(_0x3f740d){logger[_0xb6de('0x5c')](_0x3f740d[_0xb6de('0x5d')]);_0x4e4ca9({'val':0x0});});});}function updateTzVoiceQueues(_0x1dcd95){return new Promise(function(_0x53102d,_0x238976){var _0x1508fd=squel[_0xb6de('0x35')]()[_0xb6de('0x36')](['voice_queues.id',_0xb6de('0x69')])[_0xb6de('0x37')](_0xb6de('0x6a'))[_0xb6de('0x15')]('voice_queues_has_cm_lists',null,_0xb6de('0x6b'))['where'](_0xb6de('0x6c')+_0x1dcd95);db['sequelize'][_0xb6de('0x62')](_0x1508fd['toString']())[_0xb6de('0x63')](function(_0x3479a4){var _0x4c8317=[];for(var _0x5988d0=0x0;_0x5988d0<_0x3479a4['length'];_0x5988d0++){_0x4c8317[_0xb6de('0x1a')](getTimezoneData(_0x3479a4[_0x5988d0],tmp_voice_queues));}BPromise[_0xb6de('0x1b')](_0x4c8317)['then'](function(){_0x53102d({'val':0x1});});})[_0xb6de('0x64')](function(_0x3f3186){logger['error'](_0x3f3186[_0xb6de('0x5d')]);_0x53102d({'val':0x0});});});}function getTimezoneData(_0x1d1599,_0x1e7bef){return new Promise(function(_0x2aebbb,_0x314c1c){var _0x599c5d=shared[_0xb6de('0x6d')];var _0x6e9bca=_0x599c5d[_0x1d1599[_0xb6de('0x6e')]];if(_[_0xb6de('0x1d')](_0x6e9bca)){_0x2aebbb({'ret':0x1});}else{var _0x340dda=_0x6e9bca[_0xb6de('0x6f')];var _0x1ad5ea=squel[_0xb6de('0x2b')]()['into'](_0x1e7bef)[_0xb6de('0x70')]('id',_0x1d1599['id'])[_0xb6de('0x70')]('offset',_0x340dda)[_0xb6de('0x70')](_0xb6de('0x6e'),_0x1d1599[_0xb6de('0x6e')])['toString']();return db[_0xb6de('0x61')][_0xb6de('0x62')](_0x1ad5ea)['spread'](function(_0x16ede7){_0x2aebbb({'ret':0x1});})['catch'](function(_0x3f515b){logger[_0xb6de('0x5c')](_0x3f515b['message']);_0x314c1c({'ret':0x1});});}});}function handleTZQuery(_0x347ba2){logger[_0xb6de('0x60')](_0x347ba2);return db['sequelize'][_0xb6de('0x62')](_0x347ba2)[_0xb6de('0x63')](function(_0x28129a){})[_0xb6de('0x64')](function(_0x4932fc){logger[_0xb6de('0x5c')](_0x4932fc['message']);});}function main(_0x2332e3,_0x44bd99,_0x532730,_0x1a097d){logger[_0xb6de('0x60')](_0xb6de('0x71'),_0x2332e3,JSON[_0xb6de('0x72')](_0x44bd99));process[_0xb6de('0x73')](_0xb6de('0x74'));var _0x5381ca=_0x44bd99[_0xb6de('0x75')];var _0x24190f=_[_0xb6de('0x76')](_0x5381ca);var _0x3e3731=_0x44bd99[_0xb6de('0x77')];var _0x2f7d70=path['join'](config[_0xb6de('0x78')],_0xb6de('0x79'),_0x3e3731+_0xb6de('0x7a'));hasTZ=_[_0xb6de('0x53')](_0x5381ca)['includes'](_0xb6de('0x6e'));var _0x8d7e2c=_[_0xb6de('0x53')](_0x5381ca)[_0xb6de('0x15')]();logger['info']('header',_0x8d7e2c);db[_0xb6de('0x7b')][_0xb6de('0x16')]({'raw':!![],'attributes':['id',_0xb6de('0x7c')]})['then'](function(_0xeb677f){for(var _0x20cd63=0x0;_0x20cd63<_0xeb677f[_0xb6de('0x19')];_0x20cd63++){if(_0xeb677f[_0x20cd63]['name']in _0x5381ca){contactItemTypes[_0xb6de('0x1a')](_0xeb677f[_0x20cd63]);delete _0x24190f[_0xeb677f[_0x20cd63][_0xb6de('0x7c')]];hasAdditionalPhones=!![];}for(var _0x102710 in _0x5381ca){if(_0xeb677f[_0x20cd63][_0xb6de('0x7c')]+_0xb6de('0x7d')===_0x102710){phoneDescriptions[_0xb6de('0x1a')]({'itemTypeId':_0xeb677f[_0x20cd63]['id'],'description':_0x102710});delete _0x24190f[_0x102710];}}}if(hasAdditionalPhones)_0x24190f[_0xb6de('0x17')]='';var _0x347e6e=_[_0xb6de('0x53')](_0x24190f)[_0xb6de('0x15')]();logger[_0xb6de('0x60')](_0xb6de('0x7e'),_0x347e6e);fs[_0xb6de('0x7f')](_0x2f7d70,_0x347e6e+'\x0a');Papa[_0xb6de('0x80')](fs['createReadStream'](_0x2332e3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x295018,_0x5c7ce9){try{for(var _0x57a3c3=0x0,_0x5c6e82=[];_0x57a3c3<_0x295018[_0xb6de('0x81')][_0xb6de('0x19')];_0x57a3c3++){stats['rows']+=0x1;if(_0x295018[_0xb6de('0x5e')][_0x57a3c3]){handleError(_0x295018[_0xb6de('0x81')][_0x57a3c3],_0x295018['errors'][_0x57a3c3]);}else{var _0x5a58f8=[];var _0x2e24e5=[];var _0x597525={};for(var _0x33f82c in _0x5381ca){let _0x4c3293=contactItemTypes[_0xb6de('0x82')](_0x9472cb=>_0x9472cb[_0xb6de('0x7c')]===_0x33f82c);let _0x3f8d2d=contactItemTypes['find'](_0x140fa0=>_0x140fa0[_0xb6de('0x7c')]+'_description'===_0x33f82c);if(_['isNil'](_0x4c3293)&&_['isNil'](_0x3f8d2d)){if(_0x5381ca[_0xb6de('0x83')](_0x33f82c)){if(_0x295018[_0xb6de('0x81')][_0x57a3c3][_0x5381ca[_0x33f82c]]){var _0x3a1de7=_['trim'](_0x295018[_0xb6de('0x81')][_0x57a3c3][_0x5381ca[_0x33f82c]][_0xb6de('0x84')](/"/g,'\x27'));switch(_0x33f82c){case _0xb6de('0x2e'):var _0x3d4469=moment(_0x3a1de7,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3d4469[_0xb6de('0x85')]()){_0x5c6e82[_0xb6de('0x1a')]('\x22'+_0x3a1de7+'\x22');}else{_0x5a58f8[_0xb6de('0x1a')](_0xb6de('0x86'));}break;case'priority':var _0xfe3a71=parseInt(_0x3a1de7);_0x3a1de7=_[_0xb6de('0x87')](_0xfe3a71)||_0xfe3a71<0x0||_0xfe3a71>0x4?_0x1a097d?0x3:0x2:_0xfe3a71;_0x5c6e82['push']('\x22'+_0x3a1de7+'\x22');break;case _0xb6de('0x33'):var _0xf7eab3=parseInt(_0x3a1de7);if(_['isNumber'](_0xf7eab3)&&_[_0xb6de('0x88')](_0x532730,_0xf7eab3)){_0x5c6e82[_0xb6de('0x1a')]('\x22'+_0xf7eab3+'\x22');}else{_0x5a58f8['push'](_0xb6de('0x89'));}break;case'email':if(isEmail(_0x3a1de7)){_0x5c6e82['push']('\x22'+_0x3a1de7+'\x22');}else{_0x5a58f8['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x3459fd=moment(_0x3a1de7,_0xb6de('0x8a'),!![]);if(_0x3459fd[_0xb6de('0x85')]()){_0x5c6e82['push']('\x22'+_0x3a1de7+'\x22');}else{_0x5a58f8[_0xb6de('0x1a')](_0xb6de('0x8b'));}break;case _0xb6de('0x6e'):var _0xd39dcd=shared[_0xb6de('0x6d')];var _0x53178b=_0xd39dcd[_0x3a1de7];if(!_[_0xb6de('0x1d')](_0x53178b)){var _0x59a48f=_0x53178b[_0xb6de('0x6f')];_0x5c6e82['push']('\x22'+_0x3a1de7+'\x22');_0x5c6e82[_0xb6de('0x1a')]('\x22'+_0x59a48f+'\x22');}break;default:_0x5c6e82[_0xb6de('0x1a')]('\x22'+_0x3a1de7+'\x22');}}else{switch(_0x33f82c){case'firstName':case _0xb6de('0x10'):_0x5a58f8[_0xb6de('0x1a')](_0x33f82c+_0xb6de('0x8c'));break;default:_0x5c6e82[_0xb6de('0x1a')]('\x22\x22');}}}}else{var _0x12ab15='';if(!_[_0xb6de('0x1d')](_0x4c3293)){if(!_0x597525[_0xb6de('0x83')](_0x4c3293['id'])){if(!_[_0xb6de('0x1d')](_0x295018[_0xb6de('0x81')][_0x57a3c3][_0x5381ca[_0x33f82c]])){var _0x3a1de7=_[_0xb6de('0x8d')](_0x295018['data'][_0x57a3c3][_0x5381ca[_0x33f82c]][_0xb6de('0x84')](/"/g,'\x27'));var _0x335302=phoneDescriptions[_0xb6de('0x82')](_0x5e09cf=>_0x5e09cf['itemTypeId']===_0x4c3293['id']);if(!_['isNil'](_0x335302)){var _0x7a2e99=_[_0xb6de('0x8d')](_0x295018[_0xb6de('0x81')][_0x57a3c3][_0x5381ca[_0x335302[_0xb6de('0x8e')]]]['replace'](/"/g,'\x27'));if(!_[_0xb6de('0x1d')](_0x7a2e99))_0x3a1de7=_0x3a1de7+'§'+_0x7a2e99;}if(_0x12ab15=='')_0x12ab15=_0x3a1de7;else _0x12ab15+='|'+_0x3a1de7;}_0x2e24e5[_0xb6de('0x1a')](_0x4c3293['id']+':'+_0x12ab15);_0x597525[_0x4c3293['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5c6e82[_0xb6de('0x1a')]('\x22'+_0x2e24e5[_0xb6de('0x15')](';')+'\x22');}if(_0x5a58f8[_0xb6de('0x19')]){handleError(_0x295018['data'][_0x57a3c3],{'code':_0xb6de('0x8f'),'message':_0x5a58f8[_0xb6de('0x15')]()});}else{fs[_0xb6de('0x90')](_0x2f7d70,_0x5c6e82[_0xb6de('0x15')]()+'\x0a');}_0x5c6e82=[];}if(!(stats[_0xb6de('0x91')]%0xc8)){socket[_0xb6de('0x92')](_0xb6de('0x93')+_0x3e3731,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xb6de('0x94'));_0x5c7ce9['abort']();}}catch(_0x4e19d0){handleError(_0x295018['data'][_0x57a3c3],{'code':_0xb6de('0x95'),'message':_0x4e19d0[_0xb6de('0x5d')]});logger[_0xb6de('0x5c')](_0xb6de('0x96'),_0x4e19d0[_0xb6de('0x5d')]);}},'complete':function(){try{var _0x26c6dd=[];var _0xb90f09=[];var _0x2bca94='cm_contacts';if(_0x44bd99[_0xb6de('0x97')]&&_0x44bd99['duplicates'][_0xb6de('0x19')]){_0x2bca94=_0xb6de('0x98')+_0x3e3731;_0x26c6dd[_0xb6de('0x1a')]('CREATE\x20TABLE\x20'+_0x2bca94+_0xb6de('0x99'));}tmp_campaigns=_0xb6de('0x9a')+_0x3e3731;tmp_voice_queues='voice_queues_'+_0x3e3731;_0xb90f09[_0xb6de('0x1a')](_0xb6de('0x9b')+tmp_campaigns+_0xb6de('0x9c'));_0xb90f09[_0xb6de('0x1a')](_0xb6de('0x9b')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0xb90f09,handleTZQuery)[_0xb6de('0x18')](function(_0x2a0c45){updateTzCampaigns(_0x44bd99[_0xb6de('0x30')])[_0xb6de('0x18')](function(_0x29f8e4){updateTzVoiceQueues(_0x44bd99[_0xb6de('0x30')])[_0xb6de('0x18')](function(_0x47f654){if(hasTZ)_0x347e6e=_0x347e6e[_0xb6de('0x84')](_0xb6de('0x6e'),'dialTimezone,utcOffset');var _0x4f8092=util[_0xb6de('0xc')]('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',_0x2f7d70,_0x2bca94,_0x347e6e,_0x44bd99[_0xb6de('0x30')],_0x44bd99[_0xb6de('0x54')]||null,NOW,NOW);if(_[_0xb6de('0x1d')](_0x5381ca['scheduledat'])){_0x4f8092+=_0xb6de('0x9d');}_0x26c6dd[_0xb6de('0x1a')](_0x4f8092);if(_0x44bd99[_0xb6de('0x97')]&&_0x44bd99[_0xb6de('0x97')][_0xb6de('0x19')]){_0x26c6dd[_0xb6de('0x1a')](insertCmContact(_0x44bd99[_0xb6de('0x30')],_0x2bca94,_0x44bd99[_0xb6de('0x97')],_0x5381ca));_0x26c6dd['push'](_0xb6de('0x9e')+_0x2bca94+';');}BPromise[_0xb6de('0x9f')](_0x26c6dd,handleQuery)[_0xb6de('0x18')](function(_0x10f6db){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x26c6dd=[];for(var _0x347e79=0x0;_0x347e79\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','isNil','phone','AdditionalPhones','push','all','then','catch','error','split','length','filter','CmContactHasItem','PHONE','inserted','CmContact','CmHopper','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ContactId','ListId','createdAt','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt'];(function(_0x46306f,_0x5aef14){var _0x16a27f=function(_0x5526fd){while(--_0x5526fd){_0x46306f['push'](_0x46306f['shift']());}};_0x16a27f(++_0x5aef14);}(_0x720f,0x185));var _0xf720=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x720f[_0x297fd3];return _0x2af381;};'use strict';var fs=require('fs');var path=require(_0xf720('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xf720('0x1'));var moment=require(_0xf720('0x2'));var squel=require(_0xf720('0x3'));var Redis=require(_0xf720('0x4'));var db=require(_0xf720('0x5'))['db'];var config=require(_0xf720('0x6'));var logger=require(_0xf720('0x7'))(_0xf720('0x8'));config[_0xf720('0x9')]=_[_0xf720('0xa')](config['redis'],{'host':_0xf720('0xb'),'port':0x18eb});var socket=require(_0xf720('0xc'))(new Redis(config['redis']));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'](_0xf720('0xd'));var tempTableName=_0xf720('0xe')+moment()['format'](_0xf720('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x41b251){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'](_0x41b251);}function selectNotIn(_0xddeab4,_0x4c1ccb,_0x509cb7,_0x4e995f,_0x54956e){return squel[_0xf720('0x10')]()[_0xf720('0x11')]('phone')[_0xf720('0x12')](_0x4e995f)[_0xf720('0x13')](_0x4c1ccb,null,_0x4c1ccb+_0xf720('0x14')+_0x4e995f+'.'+_0x509cb7)[_0xf720('0x15')](_0x4e995f+'.'+_0x509cb7+_0xf720('0x16')+_0xddeab4+'.'+_0x509cb7)[_0xf720('0x15')](_0x4c1ccb+_0xf720('0x17')+_0x54956e['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x381fa3,_0x4d5ba0){promisesAdditionalPhones=[];promisesContact=[];return db[_0xf720('0x18')][_0xf720('0x19')](_0xf720('0x1a')+tempTableName)['spread'](function(_0x504e8a){if(_0x504e8a!==null){var _0x59de81=[];for(var _0xa56a3d=0x0;_0xa56a3d<_0x504e8a['length'];_0xa56a3d++){var _0xe4844a=_0x504e8a[_0xa56a3d];if(!_[_0xf720('0x1b')](_0xe4844a[_0xf720('0x1c')])){if(!_[_0xf720('0x1b')](_0xe4844a[_0xf720('0x1d')]))_0x59de81[_0xf720('0x1e')](insertAdditionalPhones(_0xe4844a));promisesContact['push']({'contact':_0xe4844a});}}}Promise[_0xf720('0x1f')](_0x59de81)[_0xf720('0x20')](function(){_0x381fa3({'val':0x1});});})[_0xf720('0x21')](function(_0x4a6646){logger[_0xf720('0x22')](_0x4a6646['message']);});});}function insertAdditionalPhones(_0x22003c){return new Promise(function(_0x541b29,_0x464c75){var _0x4ab375=_0x22003c['AdditionalPhones'];if(_[_0xf720('0x1b')](_0x4ab375))_0x464c75({'val':0x0});else{var _0x5d1ed2=_0x4ab375[_0xf720('0x23')](';');var _0x2ea7de=[];orderBy=0x0;for(var _0xc8e046=0x0;_0xc8e046<_0x5d1ed2['length'];_0xc8e046++){_0x2ea7de[_0xf720('0x1e')](splitAdditionalPhone(_0x22003c['id'],_0x5d1ed2[_0xc8e046]));}Promise[_0xf720('0x1f')](_0x2ea7de)[_0xf720('0x20')](function(){_0x541b29({'val':_0x5d1ed2[_0xf720('0x24')]});});}});}function splitAdditionalPhone(_0x1afdb4,_0x39f80a){return new Promise(function(_0x1f1241,_0x5ec591){var _0x8a2e0b=_0x39f80a['split'](':');var _0x372a0f=_0x8a2e0b[0x0];var _0x45b8c1=_0x8a2e0b[0x1];if(_0x45b8c1!==''){var _0x4dda43=_0x45b8c1[_0xf720('0x23')]('|');var _0x5117f4=[];for(var _0x38db53=0x0;_0x38db53<_0x4dda43[_0xf720('0x24')];_0x38db53++){if(_0x4dda43[_0x38db53]!==''){var _0x14eb89=_[_0xf720('0x25')](promisesAdditionalPhones,{'contactId':_0x1afdb4,'phone':_0x4dda43[_0x38db53]});if(_0x14eb89[_0xf720('0x24')]==0x0){orderBy++;promisesAdditionalPhones[_0xf720('0x1e')]({'contactId':_0x1afdb4,'contactTypeId':_0x372a0f,'phone':_0x4dda43[_0x38db53],'orderBy':orderBy});}}}_0x1f1241({'ok':0x1});}else _0x1f1241({'res':0x0});});}function createAdditionalPhone(_0x375ec4,_0x10d3c9,_0x15b739,_0x52166b){var _0x178bb3='';var _0x2ccc64='';var _0x468ab9=_0x15b739['split']('§');_0x178bb3=_0x468ab9[0x0];if(_0x468ab9[_0xf720('0x24')]==0x2)_0x2ccc64=_0x468ab9[0x1];return new Promise(function(_0x2ae589,_0x223cf2){return db[_0xf720('0x26')]['findOne']({'where':{'CmContactId':_0x375ec4,'item':_0x178bb3}})['then'](function(_0x42740c){if(_0x42740c){return db[_0xf720('0x26')]['update']({'ItemTypeId':_0x10d3c9,'description':_0x2ccc64,'OrderBy':_0x52166b},{'where':{'CmContactId':_0x375ec4,'item':_0x178bb3}})[_0xf720('0x20')](function(_0x364210){_0x2ae589({'res':'updated'});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x375ec4,'item':_0x178bb3,'ItemTypeId':_0x10d3c9,'description':_0x2ccc64,'OrderBy':_0x52166b,'ItemClass':_0xf720('0x27')})[_0xf720('0x20')](function(_0xa41a78){_0x2ae589({'res':_0xf720('0x28')});});}});});}function updateContact(_0x8918c9){return new Promise(function(_0x2a4aad,_0x3468ad){var _0x1e80f4=_0x8918c9['id'];delete _0x8918c9['id'];return db[_0xf720('0x29')]['update'](_0x8918c9,{'where':{'id':_0x1e80f4}})[_0xf720('0x20')](function(_0x53ac2e){updatedRows+=0x1;return db[_0xf720('0x2a')][_0xf720('0x2b')]({'phone':_0x8918c9['phone']},{'where':{'ContactId':_0x1e80f4}})[_0xf720('0x20')](function(_0x4b32d3){_0x2a4aad({'ret':'OK'});});});});}function insertCmHopper(_0x1f715e,_0xbd457b,_0x4bd400,_0x50acf9,_0xc7ae08){var _0x4e6a83=[_0xf720('0x2c'),_0xf720('0x2d'),_0xf720('0x2e'),_0xf720('0x2f'),_0xbd457b+'.'+_0x50acf9,_0xf720('0x30'),_0xf720('0x31'),'cm_contacts.priority',_0xf720('0x32'),'\x22'+_0xc7ae08+'\x22'];return squel[_0xf720('0x33')]()[_0xf720('0x34')](_0xf720('0x35'))[_0xf720('0x36')]([_0xf720('0x1c'),_0xf720('0x37'),'ContactId','ListId',_0x50acf9,'createdAt',_0xf720('0x38'),_0xf720('0x39'),_0xf720('0x3a'),_0xf720('0x3b')],squel[_0xf720('0x10')]()[_0xf720('0x3c')](_0x4e6a83)['from'](_0xbd457b)[_0xf720('0x13')](_0xf720('0x3d'),null,_0xf720('0x3e')+_0xbd457b+_0xf720('0x3f'))[_0xf720('0x13')](_0x4bd400,null,_0x4bd400+'.id\x20=\x20'+_0xbd457b+'.'+_0x50acf9)[_0xf720('0x15')](_0xbd457b+'.CmListId\x20=\x20?',_0x1f715e)['where'](_0xf720('0x40'),NOW)[_0xf720('0x15')](_0xf720('0x41'),selectNotIn(_0xbd457b,_0x4bd400,_0x50acf9,_0xf720('0x35'),[_0xf720('0x42'),_0xf720('0x43')]))['where'](_0xf720('0x41'),selectNotIn(_0xbd457b,_0x4bd400,_0x50acf9,_0xf720('0x35'),[_0xf720('0x42')])))[_0xf720('0x44')]();}function insertCmHopperBlack(_0x267b8b,_0x52e0ae,_0x4df083,_0x1157bc){var _0x2bf442=[_0xf720('0x2c'),_0xf720('0x2e'),_0xf720('0x2f'),_0x52e0ae+'.'+_0x1157bc,_0xf720('0x30'),_0xf720('0x31')];return squel['insert']()[_0xf720('0x34')](_0xf720('0x45'))['fromQuery']([_0xf720('0x1c'),_0xf720('0x46'),_0xf720('0x47'),_0x1157bc,_0xf720('0x48'),'updatedAt'],squel[_0xf720('0x10')]()[_0xf720('0x3c')](_0x2bf442)[_0xf720('0x12')](_0x52e0ae)[_0xf720('0x13')](_0xf720('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x52e0ae+_0xf720('0x3f'))[_0xf720('0x13')](_0x4df083,null,_0x4df083+'.id\x20=\x20'+_0x52e0ae+'.'+_0x1157bc)[_0xf720('0x15')](_0x52e0ae+_0xf720('0x49'),_0x267b8b)[_0xf720('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf720('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf720('0x10')]()[_0xf720('0x11')]('phone')[_0xf720('0x12')]('cm_hopper_black')[_0xf720('0x15')](_0xf720('0x4a'),_0x267b8b)[_0xf720('0x15')](_0x1157bc+_0xf720('0x4b'),_0x52e0ae+'.'+_0x1157bc)))[_0xf720('0x44')]();}function insertCmHopperAdditionalPhones(_0x5354dd){var _0x1d5617=[_0xf720('0x4c'),'cm_contact_has_items.item',_0xf720('0x4d'),_0xf720('0x4e'),_0xf720('0x4f')];return squel[_0xf720('0x33')]()['into'](_0xf720('0x50'))['fromQuery']([_0xf720('0x51'),_0xf720('0x1c'),_0xf720('0x52'),_0xf720('0x48'),_0xf720('0x38')],squel[_0xf720('0x10')]()[_0xf720('0x3c')](_0x1d5617)[_0xf720('0x12')]('cm_hopper')['join'](_0xf720('0x3d'),null,_0xf720('0x53'))['join'](_0xf720('0x54'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xf720('0x15')](_0xf720('0x55'),_0x5354dd)[_0xf720('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xf720('0x44')]();}function insertCmContact(_0x197f57,_0x11fe04,_0x57f1ea,_0x5f3c8f){var _0x2abce2=_[_0xf720('0x56')](_['keys'](_0x5f3c8f),['ListId','CompanyId',_0xf720('0x48'),'updatedAt']);return squel[_0xf720('0x33')]()['into'](_0xf720('0x3d'))['fromQuery'](_0x2abce2,squel['select']()[_0xf720('0x3c')](_0x2abce2)[_0xf720('0x12')](_0x11fe04)[_0xf720('0x15')]('('+_0x57f1ea[_0xf720('0x13')](',')+_0xf720('0x57'),squel[_0xf720('0x10')]()['fields'](_0x57f1ea)[_0xf720('0x12')](_0xf720('0x3d'))[_0xf720('0x15')](_0xf720('0x4a'),_0x197f57))['where'](_0xf720('0x58'),squel[_0xf720('0x10')]()[_0xf720('0x11')]('MIN(id)',_0xf720('0x59'))[_0xf720('0x12')](_0x11fe04)[_0xf720('0x5a')](_0x57f1ea[_0xf720('0x13')](','))))['toString']();}function handleStop(){logger[_0xf720('0x5b')](_0xf720('0x5c'));stopped=!![];}function handleUncaughtException(_0x1638f3){logger[_0xf720('0x22')](_0x1638f3[_0xf720('0x5d')]);process[_0xf720('0x5e')](0x1);}function handleError(_0x271e8c,_0x203a6a){stats[_0xf720('0x5f')][_0xf720('0x1e')]({'name':_0x203a6a[_0xf720('0x60')],'message':_0x203a6a[_0xf720('0x5d')],'row':_0x271e8c});}function handleQuery(_0x4e9916){logger[_0xf720('0x5b')](_0x4e9916);return db[_0xf720('0x18')]['query'](_0x4e9916)['spread'](function(_0x55a9fc){results['push'](_0x55a9fc);})['catch'](function(_0x565a82){logger[_0xf720('0x22')](_0x565a82[_0xf720('0x5d')]);});}function main(_0x15ed0f,_0x13e502,_0x510541,_0x126a10){logger[_0xf720('0x5b')]('main',_0x15ed0f,JSON[_0xf720('0x61')](_0x13e502));process[_0xf720('0x62')](_0xf720('0x63'));var _0x20d767=_0x13e502[_0xf720('0x64')];var _0x4896dc=_['clone'](_0x20d767);var _0x362725=_0x13e502['socket_timestamp'];var _0x1b5231=path[_0xf720('0x13')](config['root'],_0xf720('0x65'),_0x362725+_0xf720('0x66'));logger[_0xf720('0x5b')](_0xf720('0x67'),_0x13e502);db['ContactItemType'][_0xf720('0x68')]({'raw':!![],'attributes':['id','name']})[_0xf720('0x20')](function(_0x480ef8){for(var _0x45f14f=0x0;_0x45f14f<_0x480ef8[_0xf720('0x24')];_0x45f14f++){if(_0x480ef8[_0x45f14f]['name']in _0x20d767){contactItemTypes['push'](_0x480ef8[_0x45f14f]);delete _0x4896dc[_0x480ef8[_0x45f14f]['name']];hasAdditionalPhones=!![];}for(var _0x39f8ea in _0x20d767){if(_0x480ef8[_0x45f14f][_0xf720('0x69')]+_0xf720('0x6a')===_0x39f8ea){phoneDescriptions[_0xf720('0x1e')]({'itemTypeId':_0x480ef8[_0x45f14f]['id'],'description':_0x39f8ea});delete _0x4896dc[_0x39f8ea];}}}if(hasAdditionalPhones)_0x4896dc[_0xf720('0x1d')]='';var _0x624deb=_['keys'](_0x4896dc)['join']();logger['info'](_0xf720('0x6b'),_0x624deb);fs[_0xf720('0x6c')](_0x1b5231,_0x624deb+'\x0a');Papa[_0xf720('0x6d')](fs[_0xf720('0x6e')](_0x15ed0f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x23a9bf,_0x49d1b0){try{for(var _0x37b7bf=0x0,_0x7d93da=[];_0x37b7bf<_0x23a9bf[_0xf720('0x6f')][_0xf720('0x24')];_0x37b7bf++){stats[_0xf720('0x70')]+=0x1;if(_0x23a9bf[_0xf720('0x5f')][_0x37b7bf]){handleError(_0x23a9bf[_0xf720('0x6f')][_0x37b7bf],_0x23a9bf[_0xf720('0x5f')][_0x37b7bf]);}else{var _0xc85fcc=[];var _0x121054=[];var _0x41809c={};for(var _0x5503a7 in _0x20d767){let _0x53d636=contactItemTypes['find'](_0x3cb05f=>_0x3cb05f[_0xf720('0x69')]===_0x5503a7);let _0x351400=contactItemTypes['find'](_0x394606=>_0x394606['name']+_0xf720('0x6a')===_0x5503a7);if(_[_0xf720('0x1b')](_0x53d636)&&_[_0xf720('0x1b')](_0x351400)){if(_0x20d767[_0xf720('0x71')](_0x5503a7)){if(_0x23a9bf[_0xf720('0x6f')][_0x37b7bf][_0x20d767[_0x5503a7]]){var _0x36b78e=_['trim'](_0x23a9bf[_0xf720('0x6f')][_0x37b7bf][_0x20d767[_0x5503a7]]['replace'](/"/g,'\x27'));switch(_0x5503a7){case _0xf720('0x37'):var _0x342e49=moment(_0x36b78e,_0xf720('0xd'),!![]);if(_0x342e49[_0xf720('0x72')]()){_0x7d93da['push']('\x22'+_0x36b78e+'\x22');}else{_0xc85fcc[_0xf720('0x1e')](_0xf720('0x73'));}break;case'priority':var _0x17c236=parseInt(_0x36b78e);_0x36b78e=_['isNaN'](_0x17c236)||_0x17c236<0x0||_0x17c236>0x4?_0x126a10?0x3:0x2:_0x17c236;_0x7d93da['push']('\x22'+_0x36b78e+'\x22');break;case _0xf720('0x3a'):var _0x574def=parseInt(_0x36b78e);if(_[_0xf720('0x74')](_0x574def)&&_['includes'](_0x510541,_0x574def)){_0x7d93da[_0xf720('0x1e')]('\x22'+_0x574def+'\x22');}else{_0xc85fcc['push'](_0xf720('0x75'));}break;case _0xf720('0x76'):if(isEmail(_0x36b78e)){_0x7d93da['push']('\x22'+_0x36b78e+'\x22');}else{_0xc85fcc['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x1f8051=moment(_0x36b78e,'YYYY-MM-DD',!![]);if(_0x1f8051['isValid']()){_0x7d93da[_0xf720('0x1e')]('\x22'+_0x36b78e+'\x22');}else{_0xc85fcc[_0xf720('0x1e')](_0xf720('0x77'));}break;default:_0x7d93da[_0xf720('0x1e')]('\x22'+_0x36b78e+'\x22');}}else{switch(_0x5503a7){case'firstName':case _0xf720('0x1c'):_0xc85fcc[_0xf720('0x1e')](_0x5503a7+'\x20not\x20specified');break;default:_0x7d93da[_0xf720('0x1e')]('\x22\x22');}}}}else{var _0x2ed39e='';if(!_[_0xf720('0x1b')](_0x53d636)){if(!_0x41809c[_0xf720('0x71')](_0x53d636['id'])){for(var _0x48a08a=0x0;_0x48a08a<_0x20d767[_0x5503a7]['length'];_0x48a08a++){var _0x36b78e=_['trim'](_0x23a9bf[_0xf720('0x6f')][_0x37b7bf][_0x20d767[_0x5503a7][_0x48a08a]][_0xf720('0x78')](/"/g,'\x27'));var _0x12146e=phoneDescriptions[_0xf720('0x79')](_0x4e0d0f=>_0x4e0d0f[_0xf720('0x7a')]===_0x53d636['id']);if(!_[_0xf720('0x1b')](_0x12146e)){var _0x4d799f=_[_0xf720('0x7b')](_0x23a9bf[_0xf720('0x6f')][_0x37b7bf][_0x20d767[_0x12146e['description']][0x0]][_0xf720('0x78')](/"/g,'\x27'));if(!_[_0xf720('0x1b')](_0x4d799f))_0x36b78e=_0x36b78e+'§'+_0x4d799f;}if(_0x2ed39e=='')_0x2ed39e=_0x36b78e;else _0x2ed39e+='|'+_0x36b78e;}_0x121054[_0xf720('0x1e')](_0x53d636['id']+':'+_0x2ed39e);_0x41809c[_0x53d636['id']]=0x1;}}}}if(hasAdditionalPhones){_0x7d93da[_0xf720('0x1e')]('\x22'+_0x121054['join'](';')+'\x22');}if(_0xc85fcc['length']){handleError(_0x23a9bf[_0xf720('0x6f')][_0x37b7bf],{'code':'SystemRow','message':_0xc85fcc['join']()});}else{fs[_0xf720('0x7c')](_0x1b5231,_0x7d93da['join']()+'\x0a');}_0x7d93da=[];}if(!(stats[_0xf720('0x70')]%0xc8)){socket[_0xf720('0x7d')](_0xf720('0x7e')+_0x362725,stats);stats['errors']=[];}}if(stopped){logger[_0xf720('0x5b')](_0xf720('0x7f'));_0x49d1b0[_0xf720('0x80')]();}}catch(_0x488d93){handleError(_0x23a9bf[_0xf720('0x6f')][_0x37b7bf],{'code':_0xf720('0x81'),'message':_0x488d93['message']});logger[_0xf720('0x22')](_0xf720('0x82'),_0x488d93[_0xf720('0x5d')]);}},'complete':function(){try{var _0x579682=[];var _0x22b419=tempTableName;_0x579682[_0xf720('0x1e')](_0xf720('0x83')+_0x22b419+_0xf720('0x84'));logger[_0xf720('0x5b')](_0xf720('0x85'),contactItemTypes['length']);var _0x2d6cf6=util[_0xf720('0x86')](_0xf720('0x87'),_0x1b5231,_0x22b419,_0x624deb,_0x13e502['ListId'],_0x13e502[_0xf720('0x88')]||null,NOW,NOW);if(_['isNil'](_0x20d767['scheduledat'])){_0x2d6cf6+=_0xf720('0x89');}_0x579682[_0xf720('0x1e')](_0x2d6cf6);BPromise[_0xf720('0x8a')](_0x579682,handleQuery)[_0xf720('0x20')](function(_0x5d790f){BPromise['all']([handleAdditionalPhones()])[_0xf720('0x20')](function(){_0x579682=[];for(var _0x3388ea=0x0;_0x3388ea_0x4d07ea[_0x39bb('0x62')]===_0x1db4ee);let _0x5d44b4=contactItemTypes[_0x39bb('0x6a')](_0x23899f=>_0x23899f['name']+_0x39bb('0x63')===_0x1db4ee);if(_[_0x39bb('0x1b')](_0x2c4010)&&_['isNil'](_0x5d44b4)){if(_0x1af7c1['hasOwnProperty'](_0x1db4ee)){if(_0x15a2e9[_0x39bb('0x68')][_0x50dbbb][_0x1af7c1[_0x1db4ee]]){var _0x295bdb=_['trim'](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x1db4ee]][_0x39bb('0x6b')](/"/g,'\x27'));switch(_0x1db4ee){case _0x39bb('0x32'):var _0x3f77a2=moment(_0x295bdb,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3f77a2['isValid']()){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x39bb('0x37'):var _0x1c11e6=parseInt(_0x295bdb);_0x295bdb=_['isNaN'](_0x1c11e6)||_0x1c11e6<0x0||_0x1c11e6>0x4?_0x54a3a1?0x3:0x2:_0x1c11e6;_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');break;case'UserId':var _0x10873e=parseInt(_0x295bdb);if(_['isNumber'](_0x10873e)&&_[_0x39bb('0x6c')](_0x17062e,_0x10873e)){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x10873e+'\x22');}else{_0x15d18a[_0x39bb('0x1d')](_0x39bb('0x6d'));}break;case'email':if(isEmail(_0x295bdb)){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a['push'](_0x39bb('0x6e'));}break;case'dateOfBirth':var _0x4b22a4=moment(_0x295bdb,'YYYY-MM-DD',!![]);if(_0x4b22a4[_0x39bb('0x6f')]()){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a[_0x39bb('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}}else{switch(_0x1db4ee){case'firstName':case'phone':_0x15d18a[_0x39bb('0x1d')](_0x1db4ee+_0x39bb('0x70'));break;default:_0x38cb9f[_0x39bb('0x1d')]('\x22\x22');}}}}else{var _0x4b653e='';if(!_[_0x39bb('0x1b')](_0x2c4010)){if(!_0x337bcd['hasOwnProperty'](_0x2c4010['id'])){for(var _0x22ec45=0x0;_0x22ec45<_0x1af7c1[_0x1db4ee]['length'];_0x22ec45++){var _0x295bdb=_[_0x39bb('0x71')](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x1db4ee][_0x22ec45]][_0x39bb('0x6b')](/"/g,'\x27'));var _0x402206=phoneDescriptions['find'](_0x39979a=>_0x39979a[_0x39bb('0x72')]===_0x2c4010['id']);if(!_[_0x39bb('0x1b')](_0x402206)){var _0x5d4d0d=_[_0x39bb('0x71')](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x402206[_0x39bb('0x73')]][0x0]][_0x39bb('0x6b')](/"/g,'\x27'));if(!_[_0x39bb('0x1b')](_0x5d4d0d))_0x295bdb=_0x295bdb+'§'+_0x5d4d0d;}if(_0x4b653e=='')_0x4b653e=_0x295bdb;else _0x4b653e+='|'+_0x295bdb;}_0x4c0f29[_0x39bb('0x1d')](_0x2c4010['id']+':'+_0x4b653e);_0x337bcd[_0x2c4010['id']]=0x1;}}}}if(hasAdditionalPhones){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x4c0f29[_0x39bb('0x12')](';')+'\x22');}if(_0x15d18a[_0x39bb('0x1a')]){handleError(_0x15a2e9['data'][_0x50dbbb],{'code':_0x39bb('0x74'),'message':_0x15d18a[_0x39bb('0x12')]()});}else{fs['appendFileSync'](_0x99ed06,_0x38cb9f['join']()+'\x0a');}_0x38cb9f=[];}if(!(stats[_0x39bb('0x69')]%0xc8)){socket[_0x39bb('0x75')](_0x39bb('0x76')+_0x369028,stats);stats[_0x39bb('0x59')]=[];}}if(stopped){logger[_0x39bb('0x57')]('Abort\x20parser');_0x10c647['abort']();}}catch(_0x3b385f){handleError(_0x15a2e9[_0x39bb('0x68')][_0x50dbbb],{'code':_0x39bb('0x77'),'message':_0x3b385f['message']});logger['error'](_0x39bb('0x78'),_0x3b385f[_0x39bb('0x21')]);}},'complete':function(){try{var _0x67d6d3=[];var _0x54b96e=tempTableName;_0x67d6d3[_0x39bb('0x1d')]('CREATE\x20TABLE\x20'+_0x54b96e+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0x39bb('0x1a')]);var _0x4892ae=util[_0x39bb('0xe')](_0x39bb('0x79'),_0x99ed06,_0x54b96e,_0x31ffe2,_0x196c07[_0x39bb('0x34')],_0x196c07[_0x39bb('0x52')]||null,NOW,NOW);if(_[_0x39bb('0x1b')](_0x1af7c1[_0x39bb('0x32')])){_0x4892ae+=_0x39bb('0x7a');}_0x67d6d3[_0x39bb('0x1d')](_0x4892ae);BPromise['each'](_0x67d6d3,handleQuery)[_0x39bb('0x22')](function(_0xfbc732){BPromise[_0x39bb('0x1e')]([handleAdditionalPhones()])[_0x39bb('0x22')](function(){_0x67d6d3=[];for(var _0x14a72f=0x0;_0x14a72f\x20\x20');}var _0x92b6a0=path['join'](config[_0x39bb('0x86')],_0x39bb('0x60'),process[_0x39bb('0x85')][0x2]);if(!fs[_0x39bb('0x87')](_0x92b6a0)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x10ab34={};try{_0x10ab34=JSON[_0x39bb('0x66')](process['argv'][0x3]);if(!_0x10ab34[_0x39bb('0x88')]){throw new Error(_0x39bb('0x89'));}var _0x138034=0x0;if(_0x10ab34[_0x39bb('0x88')][_0x39bb('0x38')]){_0x138034=0x1;}if(!_0x10ab34[_0x39bb('0x34')]){throw new Error(_0x39bb('0x8a'));}}catch(_0x3c112e){throw new Error(_0x39bb('0x8b'));}var _0x5d00d1=[];try{_0x5d00d1=_[_0x39bb('0x8c')](JSON[_0x39bb('0x66')](process[_0x39bb('0x85')][0x4]),'id');}catch(_0x20ee5b){logger[_0x39bb('0x57')](_0x39bb('0x8d'));}main(_0x92b6a0,_0x10ab34,_0x5d00d1,_0x138034);}validate();process['on'](_0x39bb('0x8e'),handleStop);process['on'](_0x39bb('0x8f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6eee5f5..1355707 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c28=['Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Answer\x20Time','endtime','Duration','duration'];(function(_0x1bb342,_0x55091c){var _0x5eb7c5=function(_0x5cd794){while(--_0x5cd794){_0x1bb342['push'](_0x1bb342['shift']());}};_0x5eb7c5(++_0x55091c);}(_0x1c28,0x12a));var _0x81c2=function(_0x404735,_0x1dcb5e){_0x404735=_0x404735-0x0;var _0xb02968=_0x1c28[_0x404735];return _0xb02968;};'use strict';exports[_0x81c2('0x0')]=function(_0x1459d5,_0x4cadf5){var _0x5166a5=[{'type':_0x81c2('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1459d5[_0x81c2('0x2')]()){case _0x81c2('0x3'):switch(_0x4cadf5[_0x81c2('0x2')]()){case'inbound':_0x5166a5[_0x81c2('0x4')]({'type':_0x81c2('0x5'),'content':'','variableName':_0x81c2('0x6')});_0x5166a5['push']({'type':_0x81c2('0x5'),'content':'','variableName':_0x81c2('0x7')});break;case _0x81c2('0x8'):_0x5166a5[_0x81c2('0x4')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x5166a5['push']({'type':_0x81c2('0x5'),'content':'','variableName':_0x81c2('0x9')});break;}}return _0x5166a5;};exports[_0x81c2('0xa')]=function(_0x520506,_0x195109){var _0x41f704=[];switch(_0x520506[_0x81c2('0x2')]()){case _0x81c2('0x3'):switch(_0x195109[_0x81c2('0x2')]()){case'inbound':_0x41f704=[{'type':_0x81c2('0x1'),'content':_0x81c2('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x81c2('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x81c2('0x5'),'variableName':_0x81c2('0xd')},{'type':'keyValue','content':'','key':_0x81c2('0xe'),'keyType':_0x81c2('0x5'),'variableName':_0x81c2('0xf')},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x10'),'keyType':'variable','variableName':_0x81c2('0x6')},{'type':'keyValue','content':'','key':_0x81c2('0x11'),'keyType':'variable','variableName':_0x81c2('0x12')},{'type':'keyValue','content':'','key':_0x81c2('0x13'),'keyType':'variable','variableName':_0x81c2('0x14')},{'type':_0x81c2('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x81c2('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x81c2('0x15'),'keyType':_0x81c2('0x5'),'variableName':_0x81c2('0x9')},{'type':_0x81c2('0x1'),'content':_0x81c2('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x17'),'keyType':'variable','variableName':_0x81c2('0x14')},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x18'),'keyType':_0x81c2('0x5'),'variableName':_0x81c2('0x19')},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x1a'),'keyType':'variable','variableName':_0x81c2('0x1b')},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x1c'),'keyType':_0x81c2('0x5'),'variableName':_0x81c2('0x1d')},{'type':_0x81c2('0xc'),'content':'','key':'Talk\x20Time','keyType':_0x81c2('0x5'),'variableName':_0x81c2('0x1e')}];break;case _0x81c2('0x8'):_0x41f704=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x81c2('0xc'),'content':'','key':'Called\x20Number','keyType':_0x81c2('0x5'),'keyContent':'','variableName':_0x81c2('0x9')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x11'),'keyType':_0x81c2('0x5'),'keyContent':'','variableName':_0x81c2('0x12')},{'type':'keyValue','content':'','key':_0x81c2('0x13'),'keyType':_0x81c2('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0x81c2('0x1'),'content':_0x81c2('0x16')},{'type':'keyValue','content':'','key':_0x81c2('0x1f'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x81c2('0xc'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0x81c2('0x20')},{'type':_0x81c2('0xc'),'content':'','key':_0x81c2('0x21'),'keyType':'variable','keyContent':'','variableName':_0x81c2('0x22')},{'type':'keyValue','content':'','key':_0x81c2('0x23'),'keyType':_0x81c2('0x5'),'keyContent':'','variableName':_0x81c2('0x24')}];break;}}return _0x41f704;}; \ No newline at end of file +var _0xb95b=['uniqueid','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','holdtime','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername'];(function(_0x51c764,_0x124e87){var _0x4bc23b=function(_0x5b4fdf){while(--_0x5b4fdf){_0x51c764['push'](_0x51c764['shift']());}};_0x4bc23b(++_0x124e87);}(_0xb95b,0x18c));var _0xbb95=function(_0x514299,_0x44a553){_0x514299=_0x514299-0x0;var _0x453188=_0xb95b[_0x514299];return _0x453188;};'use strict';exports['getSubjects']=function(_0x2f318c,_0x3f1fce){var _0x1336dd=[{'type':_0xbb95('0x0'),'content':_0xbb95('0x1'),'variableName':null}];switch(_0x2f318c[_0xbb95('0x2')]()){case _0xbb95('0x3'):switch(_0x3f1fce[_0xbb95('0x2')]()){case _0xbb95('0x4'):_0x1336dd[_0xbb95('0x5')]({'type':'variable','content':'','variableName':_0xbb95('0x6')});_0x1336dd['push']({'type':_0xbb95('0x7'),'content':'','variableName':_0xbb95('0x8')});break;case _0xbb95('0x9'):_0x1336dd[_0xbb95('0x5')]({'type':_0xbb95('0x0'),'content':_0xbb95('0xa'),'variableName':null});_0x1336dd['push']({'type':_0xbb95('0x7'),'content':'','variableName':_0xbb95('0xb')});break;}}return _0x1336dd;};exports['getDescriptions']=function(_0x4c02b0,_0x5855d8){var _0x3b3245=[];switch(_0x4c02b0[_0xbb95('0x2')]()){case _0xbb95('0x3'):switch(_0x5855d8[_0xbb95('0x2')]()){case _0xbb95('0x4'):_0x3b3245=[{'type':_0xbb95('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0xd'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0xe'),'keyType':_0xbb95('0x7'),'variableName':_0xbb95('0xf')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x10'),'keyType':_0xbb95('0x7'),'variableName':_0xbb95('0x11')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x12'),'keyType':_0xbb95('0x7'),'variableName':_0xbb95('0x6')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x13'),'keyType':_0xbb95('0x7'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xbb95('0x14'),'keyType':_0xbb95('0x7'),'variableName':'agentcalledAt'},{'type':'string','content':_0xbb95('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x16'),'keyType':_0xbb95('0x7'),'variableName':'destcalleridname'},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x17'),'keyType':_0xbb95('0x7'),'variableName':'destcalleridnum'},{'type':_0xbb95('0x0'),'content':_0xbb95('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x19'),'keyType':_0xbb95('0x7'),'variableName':'agentcalledAt'},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x1a'),'keyType':_0xbb95('0x7'),'variableName':_0xbb95('0x1b')},{'type':_0xbb95('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0xbb95('0x7'),'variableName':'agentcompleteAt'},{'type':_0xbb95('0xc'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0xbb95('0x1c')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xbb95('0x7'),'variableName':_0xbb95('0x1d')}];break;case _0xbb95('0x9'):_0x3b3245=[{'type':_0xbb95('0x0'),'content':_0xbb95('0x1e'),'variableName':null},{'type':'keyValue','content':'','key':_0xbb95('0x1f'),'keyType':_0xbb95('0x7'),'keyContent':'','variableName':_0xbb95('0xb')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x20'),'keyType':_0xbb95('0x7'),'keyContent':'','variableName':_0xbb95('0x21')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x13'),'keyType':_0xbb95('0x7'),'keyContent':'','variableName':_0xbb95('0x22')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x14'),'keyType':'variable','keyContent':'','variableName':_0xbb95('0x23')},{'type':'string','content':_0xbb95('0x18')},{'type':_0xbb95('0xc'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xbb95('0x24')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x25'),'keyType':_0xbb95('0x7'),'keyContent':'','variableName':_0xbb95('0x26')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x27'),'keyType':'variable','keyContent':'','variableName':_0xbb95('0x28')},{'type':_0xbb95('0xc'),'content':'','key':_0xbb95('0x29'),'keyType':'variable','keyContent':'','variableName':_0xbb95('0x2a')}];break;}}return _0x3b3245;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 216c38d..2393fd2 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x442b=['fax','mobile','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','where','body','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids','countFilteredInteractions','count','clause','order','forEach','DESC','closed','getClosedOrderClause','rows','catch','tracked','query','clone','omit','phone'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x442b,0xf2));var _0xb442=function(_0x5d992a,_0x3eafd1){_0x5d992a=_0x5d992a-0x0;var _0x41fbfd=_0x442b[_0x5d992a];return _0x41fbfd;};'use strict';var _=require('lodash');var sqlUtils=require(_0xb442('0x0'));var utils=require(_0xb442('0x1'));exports[_0xb442('0x2')]=function(_0x301bcd,_0x2fd4e6,_0x2fa82e,_0x19be28,_0x1e06c3){var _0x1041c4={'count':0x0,'rows':[]};var _0x4e5520=sqlUtils[_0xb442('0x3')](_0x301bcd,_0x2fa82e,_0x2fd4e6);if(_0x4e5520){return Promise[_0xb442('0x4')](_0x1041c4);}var _0xb8c7cf=sqlUtils[_0xb442('0x5')](_0x301bcd);var _0x2d8bef={};return Promise[_0xb442('0x4')]()[_0xb442('0x6')](function(){if(_0x2fd4e6[_0xb442('0x7')]){return sqlUtils[_0xb442('0x8')](_0x2fd4e6[_0xb442('0x7')],_0x1e06c3);}else{return sqlUtils['parseQueryParameters'](_0x301bcd,_0x2fd4e6,_0x1e06c3);}})[_0xb442('0x6')](function(_0x5350a1){_0xb8c7cf[_0xb442('0x9')](_0x5350a1[_0xb442('0xa')]);_0xb8c7cf['where'](_0x5350a1[_0xb442('0xb')]);_0xb8c7cf['where'](_0x5350a1[_0xb442('0xc')]);_0xb8c7cf[_0xb442('0x9')](_0x5350a1[_0xb442('0xd')]);_0xb8c7cf[_0xb442('0x9')](_0x5350a1[_0xb442('0xe')]);_0xb8c7cf[_0xb442('0x9')](_0x5350a1[_0xb442('0xf')]);_0xb8c7cf[_0xb442('0x10')](_0x5350a1[_0xb442('0x11')]);_0x2d8bef=_0x5350a1[_0xb442('0x12')];return sqlUtils[_0xb442('0x13')](_0x301bcd,_0x2fa82e,_0x2fd4e6);})[_0xb442('0x6')](function(_0x2841f3){_0xb8c7cf[_0xb442('0x9')](_0x2841f3);_0xb8c7cf[_0xb442('0x14')](_0xb442('0x15'));var _0x1cf58b=_0x2fd4e6[_0xb442('0x7')]?_0x2d8bef[_0xb442('0x16')]:_0x2fd4e6['tag'];return sqlUtils[_0xb442('0x17')](_0xb8c7cf,_0x1cf58b);})[_0xb442('0x6')](function(_0x5dda38){_0x1041c4[_0xb442('0x18')]=_0x5dda38['length'];if(_0x1041c4['count']===0x0){return[];}_0xb8c7cf[_0xb442('0x10')](_0x2d8bef[_0xb442('0x19')]);if(_0x19be28['order']){_0x19be28[_0xb442('0x1a')][_0xb442('0x1b')](function(_0x5b6ba6){var _0x2d76a1=_0x5b6ba6[0x0]==='contactName'?_0x5b6ba6[0x0]:'i.'+_0x5b6ba6[0x0];_0xb8c7cf['order'](_0x2d76a1,_0x5b6ba6[0x1]===_0xb442('0x1c')?![]:!![]);if(_0x5b6ba6[0x0]===_0xb442('0x1d')){var _0x51ae0f=sqlUtils[_0xb442('0x1e')](_0x301bcd,_0x2fd4e6);_0xb8c7cf[_0xb442('0x1a')](_0x51ae0f,_0x5b6ba6[0x1]===_0xb442('0x1c')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x301bcd,_0xb8c7cf,_0x2fd4e6,_0x19be28);})[_0xb442('0x6')](function(_0x401801){_0x1041c4[_0xb442('0x1f')]=_0x401801;return _0x1041c4;})[_0xb442('0x20')](function(_0x144c39){throw _0x144c39;});};exports[_0xb442('0x21')]=function(_0x3a6ae1,_0xa8524b){return function(_0x57771c,_0xa9e3fa,_0x5bdba5){var _0x2b0729=_0x57771c[_0xb442('0xf')];var _0x145977={};var _0xa5e778=_0x57771c[_0xb442('0x22')];if(_0x145977){_0x145977=_[_0xb442('0x23')](_0x57771c[_0xb442('0xa')]);_0x145977=_[_0xb442('0x24')](_0x145977,[_0xb442('0xa'),'html',_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x27')]);}utils['updateUser'](_0x2b0729,_0x145977,_0xa5e778,_0x3a6ae1,_0xa8524b);_0x5bdba5(null);};}; \ No newline at end of file +var _0xb9b5=['getFilteredInteractions','catch','tracked','clone','omit','html','phone','fax','updateUser','lodash','./utils','skipInteractionsQuery','resolve','then','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','user','having','read','tags','checkAccountsRestrictions','i.id','search','tag','countFilteredInteractions','length','count','clause','order','forEach','contactName','closed','getClosedOrderClause','DESC'];(function(_0x1df3e5,_0x2d37f1){var _0x422d0c=function(_0x51d43f){while(--_0x51d43f){_0x1df3e5['push'](_0x1df3e5['shift']());}};_0x422d0c(++_0x2d37f1);}(_0xb9b5,0x139));var _0x5b9b=function(_0x157111,_0x3a9771){_0x157111=_0x157111-0x0;var _0x5b00c4=_0xb9b5[_0x157111];return _0x5b00c4;};'use strict';var _=require(_0x5b9b('0x0'));var sqlUtils=require('./sql-utils');var utils=require(_0x5b9b('0x1'));exports['findAll']=function(_0x537967,_0x4185e9,_0x427ef8,_0x35c4f9,_0xcd27e8){var _0x537d82={'count':0x0,'rows':[]};var _0x34a351=sqlUtils[_0x5b9b('0x2')](_0x537967,_0x427ef8,_0x4185e9);if(_0x34a351){return Promise[_0x5b9b('0x3')](_0x537d82);}var _0x116ef0=sqlUtils['getInteractionsQuery'](_0x537967);var _0x1c52e8={};return Promise['resolve']()[_0x5b9b('0x4')](function(){if(_0x4185e9['search']){return sqlUtils[_0x5b9b('0x5')](_0x4185e9['search'],_0xcd27e8);}else{return sqlUtils[_0x5b9b('0x6')](_0x537967,_0x4185e9,_0xcd27e8);}})[_0x5b9b('0x4')](function(_0xf928dc){_0x116ef0[_0x5b9b('0x7')](_0xf928dc[_0x5b9b('0x8')]);_0x116ef0[_0x5b9b('0x7')](_0xf928dc[_0x5b9b('0x9')]);_0x116ef0[_0x5b9b('0x7')](_0xf928dc[_0x5b9b('0xa')]);_0x116ef0[_0x5b9b('0x7')](_0xf928dc['fields']);_0x116ef0[_0x5b9b('0x7')](_0xf928dc['filter']);_0x116ef0[_0x5b9b('0x7')](_0xf928dc[_0x5b9b('0xb')]);_0x116ef0[_0x5b9b('0xc')](_0xf928dc[_0x5b9b('0xd')]);_0x1c52e8=_0xf928dc[_0x5b9b('0xe')];return sqlUtils[_0x5b9b('0xf')](_0x537967,_0x427ef8,_0x4185e9);})[_0x5b9b('0x4')](function(_0x49ae50){_0x116ef0['where'](_0x49ae50);_0x116ef0['group'](_0x5b9b('0x10'));var _0x16944b=_0x4185e9[_0x5b9b('0x11')]?_0x1c52e8['ids']:_0x4185e9[_0x5b9b('0x12')];return sqlUtils[_0x5b9b('0x13')](_0x116ef0,_0x16944b);})[_0x5b9b('0x4')](function(_0x30fe57){_0x537d82['count']=_0x30fe57[_0x5b9b('0x14')];if(_0x537d82[_0x5b9b('0x15')]===0x0){return[];}_0x116ef0[_0x5b9b('0xc')](_0x1c52e8[_0x5b9b('0x16')]);if(_0x35c4f9[_0x5b9b('0x17')]){_0x35c4f9['order'][_0x5b9b('0x18')](function(_0x25cb2b){var _0x58734d=_0x25cb2b[0x0]===_0x5b9b('0x19')?_0x25cb2b[0x0]:'i.'+_0x25cb2b[0x0];_0x116ef0[_0x5b9b('0x17')](_0x58734d,_0x25cb2b[0x1]==='DESC'?![]:!![]);if(_0x25cb2b[0x0]===_0x5b9b('0x1a')){var _0x8611b8=sqlUtils[_0x5b9b('0x1b')](_0x537967,_0x4185e9);_0x116ef0[_0x5b9b('0x17')](_0x8611b8,_0x25cb2b[0x1]===_0x5b9b('0x1c')?![]:!![]);}});}return sqlUtils[_0x5b9b('0x1d')](_0x537967,_0x116ef0,_0x4185e9,_0x35c4f9);})['then'](function(_0xab8d88){_0x537d82['rows']=_0xab8d88;return _0x537d82;})[_0x5b9b('0x1e')](function(_0xd37050){throw _0xd37050;});};exports[_0x5b9b('0x1f')]=function(_0x2fc3e6,_0x3f4262){return function(_0x1e7d2e,_0x6e45b4,_0x1f461a){var _0x3f35ea=_0x1e7d2e[_0x5b9b('0xb')];var _0x3712ea={};var _0x566755=_0x1e7d2e['query'];if(_0x3712ea){_0x3712ea=_[_0x5b9b('0x20')](_0x1e7d2e[_0x5b9b('0x8')]);_0x3712ea=_[_0x5b9b('0x21')](_0x3712ea,['body',_0x5b9b('0x22'),_0x5b9b('0x23'),_0x5b9b('0x24'),'mobile']);}utils[_0x5b9b('0x25')](_0x3f35ea,_0x3712ea,_0x566755,_0x2fc3e6,_0x3f4262);_0x1f461a(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 51b15b8..b4ff22b 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd52a=['Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','findOne','enableEmailPreview','COUNT(*)','getSelectedTags','isEmpty','SELECT','squel','../parsers/qs','./update-interaction','updateInteraction','../../mysqldb','role','search','field','from','getInteractionFK','select','u.id','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getAccountFK','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','tools_tags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','i.id\x20LIKE\x20?','sms','whatsapp','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','buildExpression','type','default','value','start','end','unreadMessages','and','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','then','read','filter','capitalize','chat','Websites','Accounts','resolve','agent','\x20IS\x20NOT\x20NULL','i.disposition','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','sequelize','query','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key'];(function(_0x49c699,_0x314403){var _0x2853ea=function(_0x68ceb9){while(--_0x68ceb9){_0x49c699['push'](_0x49c699['shift']());}};_0x2853ea(++_0x314403);}(_0xd52a,0xca));var _0xad52=function(_0x463c8b,_0x280a03){_0x463c8b=_0x463c8b-0x0;var _0x3fad8f=_0xd52a[_0x463c8b];return _0x3fad8f;};'use strict';var _=require('lodash');var squel=require(_0xad52('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0xad52('0x1'));var updateInteraction=require(_0xad52('0x2'))[_0xad52('0x3')];var utils=require('./utils');var db=require(_0xad52('0x4'))['db'];function skipInteractionsQuery(_0x383c44,_0x130d6d,_0x27cbf3){var _0x4ed1e9=![];var _0x525806=utils['getAccountFK'](_0x383c44);if(_0x130d6d[_0xad52('0x5')]==='agent'&&!_0x27cbf3[_0xad52('0x6')]&&!_0x27cbf3[_0x525806]){_0x4ed1e9=!![];}return _0x4ed1e9;}function getTagsQuery(){return squel['select']()[_0xad52('0x7')]('id')[_0xad52('0x7')]('name')[_0xad52('0x7')]('color')[_0xad52('0x8')]('tools_tags');}function getUsersQuery(_0x125d8a,_0xfd0d43){var _0x2037fe=utils[_0xad52('0x9')](_0x125d8a);var _0x59e9e8='user_has_'+_0x125d8a+'_interactions';var _0x25c86a=squel[_0xad52('0xa')]()[_0xad52('0x7')](_0xad52('0xb'))[_0xad52('0x7')](_0xad52('0xc'))[_0xad52('0x7')](_0xad52('0xd')+_0x2037fe)[_0xad52('0x8')](_0x59e9e8,'ui')['left_join'](_0xad52('0xe'),'u',_0xad52('0xf'));if(_0xfd0d43[_0xad52('0x10')]>0x0){_0x25c86a[_0xad52('0x11')](_0xad52('0xd')+_0x2037fe+_0xad52('0x12'),_[_0xad52('0x13')](_0xfd0d43,'id'));}return _0x25c86a;}function getInteractionsQuery(_0x3aed76){var _0x450099=utils['getInteractionsTables'](_0x3aed76);var _0x4abd73=utils[_0xad52('0x14')](_0x3aed76);var _0x39128c=utils[_0xad52('0x9')](_0x3aed76);return squel[_0xad52('0xa')]()[_0xad52('0x8')](_0x450099['interactions'],'i')[_0xad52('0x15')]('cm_contacts','c',_0xad52('0x16'))[_0xad52('0x15')](_0xad52('0xe'),'o','o.id\x20=\x20i.UserId')[_0xad52('0x15')](_0x450099['accounts'],'a',_0xad52('0x17')+_0x4abd73)[_0xad52('0x15')](_0x450099[_0xad52('0x18')],'me',_0xad52('0x19')+_0x39128c+_0xad52('0x1a'))[_0xad52('0x15')](_0x450099['interactionsTags'],'it',_0xad52('0x1b')+_0x39128c+'\x20=\x20i.id')[_0xad52('0x15')](_0xad52('0x1c'),'t',_0xad52('0x1d'));}function getSqlClauses(){var _0x5bce67={'body':squel[_0xad52('0x1e')](),'contact':squel['expr'](),'default':squel['expr'](),'fields':squel[_0xad52('0x1e')](),'filter':squel['expr'](),'read':squel[_0xad52('0x1e')](),'tags':{'clause':squel[_0xad52('0x1e')](),'ids':null},'user':squel['expr']()};return _0x5bce67;}function parseTagParameter(_0x58adf5){var _0xb526bf=squel[_0xad52('0x1e')]();if(_0x58adf5){var _0x42db69=utils['getSelectedTags'](_0x58adf5);_0x42db69[_0xad52('0x1f')](function(_0x5771ce){_0xb526bf['or'](_0xad52('0x20'),'%,'+_0x5771ce+',%');});}return _0xb526bf;}function parseReadParameter(_0x3b5613){var _0x25fd54='';if(_0x3b5613){_0x25fd54=_0xad52('0x21');if(_0x3b5613==='1'){_0x25fd54=_0x25fd54['replace'](_0xad52('0x22'),'=');}else{_0x25fd54=_0x25fd54[_0xad52('0x23')]('{OPERATOR}','>');}}return _0x25fd54;}function parseSearchFilter(_0x3f5757,_0x3a0fd6){var _0x41d11b=squel[_0xad52('0x1e')]();if(_0x3a0fd6){var _0x32f4fe=_0x3a0fd6['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x32f4fe)){_0x41d11b['or'](_0xad52('0x24'),_0x32f4fe+'%');if([_0xad52('0x25'),_0xad52('0x26')]['includes'](_0x3f5757)){_0x41d11b['or']('i.phone\x20LIKE\x20?',_0x32f4fe+'%');}else if(_0x3f5757===_0xad52('0x27')){_0x41d11b['or'](_0xad52('0x28'),_0x32f4fe+'%');}else if(_0x3f5757===_0xad52('0x29')){_0x41d11b['or'](_0xad52('0x2a'),_0x32f4fe+'%');}}else if(_0x3f5757===_0xad52('0x2b')&&qs[_0xad52('0x2c')](_0x32f4fe)){_0x41d11b['or']('c.email\x20LIKE\x20?',_0x32f4fe+'%');}else{if(_0x3f5757===_0xad52('0x2b')){_0x41d11b['or'](_0xad52('0x2d'),qs[_0xad52('0x2e')](_0x32f4fe))['or'](_0xad52('0x2f'),qs[_0xad52('0x2e')](_0x32f4fe));}else{if(_0x3f5757!==_0xad52('0x27')){_0x41d11b['or'](_0xad52('0x30'),qs[_0xad52('0x2e')](_0x32f4fe));}_0x41d11b['or'](_0xad52('0x31'),_0x32f4fe+'%');}}}return _0x41d11b;}function parseAdvancedSearchFilter(_0x434762,_0x3bd0ca){var _0x5027c1=getSqlClauses();var _0x1745e0=as[_0xad52('0x32')](_0x434762);var _0x3fd2b7=_0x1745e0[_0xad52('0x33')];for(var _0x33c3e5=0x0;_0x33c3e5<_0x1745e0[_0xad52('0x34')]['length'];_0x33c3e5++){var _0x244140=_0x1745e0[_0xad52('0x34')][_0x33c3e5];var _0xc9461d='i';var _0x596a3a=_[_0xad52('0x35')](_0x3bd0ca,[_0xad52('0x36'),_0x244140[_0xad52('0x7')]]);if(_0x596a3a){var _0x4ad21c=as[_0xad52('0x37')](_0xc9461d,_0x596a3a[_0xad52('0x38')],_0x244140);_0x5027c1[_0xad52('0x39')][_0x3fd2b7](_0x4ad21c['text'],_0x4ad21c[_0xad52('0x3a')][_0xad52('0x3b')],_0x4ad21c[_0xad52('0x3a')][_0xad52('0x3c')]);}else{switch(_0x244140[_0xad52('0x7')]){case _0xad52('0x3d'):var _0x51b311=parseReadParameter(_0x244140[_0xad52('0x3a')]);_0x5027c1['read'][_0xad52('0x3e')](_0x51b311);break;case _0xad52('0x3f'):if(_0x244140[_0xad52('0x40')]===_0xad52('0x41')){if(_0x244140[_0xad52('0x3a')]['split']('\x20')[_0xad52('0x10')]>0x1){_0x5027c1[_0xad52('0x42')][_0x3fd2b7](_0xad52('0x43'),qs['getFullTextValue'](_0x244140[_0xad52('0x3a')]),null);}else{var _0x10b4d4='%'+_0x244140[_0xad52('0x3a')]+'%';_0x5027c1['contact'][_0x3fd2b7](_0xad52('0x44'),_0x10b4d4,_0x10b4d4,_0x10b4d4);}}else{_0x596a3a=_['find'](_0x3bd0ca,[_0xad52('0x36'),_0xad52('0x45')]);_0x244140[_0xad52('0x7')]=_0xad52('0x45');_0x4ad21c=as['buildExpression'](_0xc9461d,_0x596a3a[_0xad52('0x38')],_0x244140);_0x5027c1[_0xad52('0x42')][_0x3fd2b7](_0x4ad21c[_0xad52('0x46')],_0x4ad21c[_0xad52('0x3a')][_0xad52('0x3b')],_0x4ad21c[_0xad52('0x3a')][_0xad52('0x3c')]);}break;case _0xad52('0x47'):var _0x5a4fc1=_0x244140[_0xad52('0x3a')]['split'](',')[_0xad52('0x13')](function(_0x38c473){return Number(_0x38c473);});var _0x15baac=parseTagParameter(_0x5a4fc1);_0x5027c1[_0xad52('0x48')][_0xad52('0x49')][_0xad52('0x3e')](_0x15baac);_0x5027c1[_0xad52('0x48')][_0xad52('0x4a')]=_0x5a4fc1;break;case _0xad52('0x4b'):if(_0x244140[_0xad52('0x40')]===_0xad52('0x41')){_0x5027c1[_0xad52('0x4c')][_0x3fd2b7](_0xad52('0x4d'),'%'+_0x244140[_0xad52('0x3a')]+'%',null);}else{_0x596a3a=_[_0xad52('0x35')](_0x3bd0ca,[_0xad52('0x36'),_0xad52('0x4e')]);_0x244140[_0xad52('0x7')]=_0xad52('0x4e');_0x4ad21c=as[_0xad52('0x37')](_0xc9461d,_0x596a3a['type'],_0x244140);_0x5027c1[_0xad52('0x4c')][_0x3fd2b7](_0x4ad21c[_0xad52('0x46')],_0x4ad21c[_0xad52('0x3a')]['start'],_0x4ad21c[_0xad52('0x3a')]['end']);}break;case _0xad52('0x4f'):case'plainBody':_0x4ad21c=as['buildExpression']('me',null,_0x244140);_0x5027c1[_0xad52('0x4f')][_0x3fd2b7](_0x4ad21c[_0xad52('0x46')],_0x4ad21c[_0xad52('0x3a')][_0xad52('0x3b')],_0x4ad21c['value']['end']);break;}}}return _0x5027c1;}function parseModelFields(_0x254416,_0x5dede4,_0x207096){var _0x581f41=utils[_0xad52('0x14')](_0x254416);var _0x11d392=squel[_0xad52('0x1e')]();var _0x15d989=_(_0x5dede4)[_0xad52('0x50')]()[_0xad52('0x13')](function(_0x59c0d7){return _[_0xad52('0x51')](_0x207096,[_0xad52('0x36'),_0x59c0d7])?_0x59c0d7:undefined;})[_0xad52('0x52')]()[_0xad52('0x3a')]();if(_0x15d989['length']>0x0){_0x15d989[_0xad52('0x1f')](function(_0x413338){if(_0x413338===_0x581f41){_0x11d392[_0xad52('0x3e')]('i.'+_0x581f41+'\x20IN\x20?',[][_0xad52('0x53')](_0x5dede4[_0x413338]));}else if(_0x413338===_0xad52('0x54')){var _0x23400a=JSON[_0xad52('0x55')](_0x5dede4[_0x413338])['$gte'];var _0x32a6c3=JSON[_0xad52('0x55')](_0x5dede4[_0x413338])[_0xad52('0x56')];_0x11d392[_0xad52('0x3e')](_0xad52('0x57'),_0x23400a,_0x32a6c3);}else{if(_0x5dede4[_0x413338]==='null'){_0x11d392['and']('i.'+_0x413338+_0xad52('0x58'));}else{_0x11d392[_0xad52('0x3e')]('i.'+_0x413338+_0xad52('0x59'),_0x5dede4[_0x413338]);}}});}return _0x11d392;}function parseQueryParameters(_0x93114f,_0x2df920,_0x5298aa){var _0x21f850=getSqlClauses();return Promise['resolve']()[_0xad52('0x5a')](function(){return parseModelFields(_0x93114f,_0x2df920,_0x5298aa);})[_0xad52('0x5a')](function(_0x96bc15){_0x21f850['fields'][_0xad52('0x3e')](_0x96bc15);return parseReadParameter(_0x2df920['read']);})[_0xad52('0x5a')](function(_0x4218c6){_0x21f850[_0xad52('0x5b')]['and'](_0x4218c6);return parseTagParameter(_0x2df920['tag']);})[_0xad52('0x5a')](function(_0x4a5def){_0x21f850[_0xad52('0x48')][_0xad52('0x49')]['and'](_0x4a5def);return parseSearchFilter(_0x93114f,_0x2df920[_0xad52('0x5c')]);})['then'](function(_0x2d6ea9){_0x21f850[_0xad52('0x5c')]=_0x2d6ea9;return _0x21f850;});}function checkAccountsRestrictions(_0x6cce9f,_0x208eda,_0x516f43){var _0x5197d9=utils[_0xad52('0x14')](_0x6cce9f);var _0x12a38b='get'+_[_0xad52('0x5d')](_0x6cce9f)+(_0x6cce9f===_0xad52('0x5e')?_0xad52('0x5f'):_0xad52('0x60'));var _0x5b3ae8=squel[_0xad52('0x1e')]();return Promise[_0xad52('0x61')]()[_0xad52('0x5a')](function(){if(_0x516f43[_0xad52('0x6')]&&_0x208eda[_0xad52('0x5')]===_0xad52('0x62')){return _0x208eda[_0x12a38b]({'attributes':['id'],'raw':!![]});}})[_0xad52('0x5a')](function(_0x16807a){if(_0x16807a){if(_0x16807a['length']===0x0){_0x5b3ae8['and']('i.'+_0x5197d9+_0xad52('0x58'));}else{_0x5b3ae8[_0xad52('0x3e')]('i.'+_0x5197d9+_0xad52('0x12'),_['map'](_0x16807a,'id'));}}else if(!_0x516f43[_0x5197d9]){_0x5b3ae8[_0xad52('0x3e')]('i.'+_0x5197d9+_0xad52('0x63'));}})[_0xad52('0x5a')](function(){return _0x5b3ae8;});}function getClosedOrderClause(_0x54baff,_0x3be96f){var _0x5a3feb='';var _0xee30d1=['i.thirdDisposition','i.secondDisposition',_0xad52('0x64')];if(_0x54baff===_0xad52('0x2b')){_0xee30d1['unshift']('i.substatus');}if(_0x3be96f['closed']==='0'&&_0x54baff===_0xad52('0x2b')){_0x5a3feb=_0xad52('0x65');}else{if(_0x3be96f['closed']==='1'){_0xee30d1[_0xad52('0x66')]();}_0x5a3feb=_0xad52('0x67')+_0xee30d1[_0xad52('0x68')](',\x20')+')';}return _0x5a3feb;}function getFilteredInteractions(_0x529b16,_0x376187,_0x2622a4,_0x26935e){var _0x4fbcb1=utils['getInteractionFK'](_0x529b16);var _0x45a065=_[_0xad52('0x5d')](_0x529b16)+_0xad52('0x69');var _0xe22d76=[];var _0x57f90a=getTagsQuery();var _0x4d6b7a={'type':db['Sequelize'][_0xad52('0x6a')]['SELECT'],'raw':!![]};var _0x122753=[];var _0x3043f7=[];return db[_0xad52('0x6b')][_0xad52('0x6c')](_0x57f90a[_0xad52('0x6d')](),_0x4d6b7a)[_0xad52('0x5a')](function(_0xa4097c){_0xe22d76=_[_0xad52('0x6e')](_0xa4097c,'id');_0x4d6b7a=_[_0xad52('0x6f')](_0x4d6b7a,{'model':db[_0x45a065],'mapToModel':!![],'nest':!![]});if(_0x2622a4[_0xad52('0x70')]){_0x26935e[_0xad52('0x71')]['forEach'](function(_0x5c026a){_0x376187[_0xad52('0x7')]('i.'+_0x5c026a);});}else{_0x376187['field'](_0xad52('0x72'),_0xad52('0x3d'));_0x376187[_0xad52('0x7')]('a.key',_0xad52('0x73'));_0x376187['field']('a.mandatoryDisposition',_0xad52('0x74'));if(_0x529b16===_0xad52('0x2b')){_0x376187[_0xad52('0x7')](_0xad52('0x75'),_0xad52('0x76'));_0x376187['field'](_0xad52('0x77'),'contactName');_0x376187[_0xad52('0x7')](_0xad52('0x78'));_0x376187['field'](_0xad52('0x79'));_0x376187[_0xad52('0x7')](_0xad52('0x7a'));_0x376187[_0xad52('0x7')]('i.closed');_0x376187[_0xad52('0x7')](_0xad52('0x7b'));_0x376187[_0xad52('0x7')](_0xad52('0x7c'));_0x376187[_0xad52('0x7')](_0xad52('0x7d'));_0x376187[_0xad52('0x7')](_0xad52('0x7e'));_0x376187[_0xad52('0x7')](_0xad52('0x7f'));_0x376187['field'](_0xad52('0x64'));_0x376187[_0xad52('0x7')](_0xad52('0x80'));_0x376187['field'](_0xad52('0x81'));_0x376187[_0xad52('0x7')](_0xad52('0x65'));_0x376187[_0xad52('0x7')](_0xad52('0x82'));_0x376187[_0xad52('0x7')](_0xad52('0x83'));_0x376187[_0xad52('0x7')](_0xad52('0x84'));_0x376187[_0xad52('0x7')](_0xad52('0x85'));}else if(_0x529b16===_0xad52('0x29')){_0x376187[_0xad52('0x7')](_0xad52('0x86'),_0xad52('0x87'));}else{_0x376187[_0xad52('0x7')]('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',_0xad52('0x87'));}if(_0x529b16!==_0xad52('0x2b')){_0x376187[_0xad52('0x7')](_0xad52('0x88'));}_0x376187[_0xad52('0x7')](_0xad52('0x89'),_0xad52('0x8a'));_0x376187[_0xad52('0x7')](_0xad52('0x8b'),_0xad52('0x8c'));_0x376187['field'](_0xad52('0x8d'),_0xad52('0x8e'));_0x376187[_0xad52('0x7')](_0xad52('0x8f'),_0xad52('0x90'));_0x376187['field']('c.mobile','Contact.mobile');_0x376187[_0xad52('0x7')]('c.fax',_0xad52('0x91'));_0x376187['field']('o.fullname',_0xad52('0x92'));_0x376187[_0xad52('0x7')](_0xad52('0x93'),_0xad52('0x94'));_0x376187['field'](_0xad52('0x95'),'TagIds');}if(_0x26935e[_0xad52('0x96')]){_0x376187['limit'](_0x26935e[_0xad52('0x96')]);}if(_0x26935e['offset']){_0x376187[_0xad52('0x97')](_0x26935e[_0xad52('0x97')]);}return db['sequelize']['query'](_0x376187[_0xad52('0x6d')](),_0x4d6b7a);})[_0xad52('0x5a')](function(_0x5b2f8a){_0x122753=_0x5b2f8a;var _0x90ade5=getUsersQuery(_0x529b16,_0x122753);return db[_0xad52('0x6b')][_0xad52('0x6c')](_0x90ade5[_0xad52('0x6d')](),_0x4d6b7a);})[_0xad52('0x5a')](function(_0xd3cd9e){_0x3043f7=_[_0xad52('0x98')](_0xd3cd9e,_0x4fbcb1);if(_0x529b16==='mail'){return db['Setting'][_0xad52('0x99')]({'attributes':[_0xad52('0x9a')],'raw':!![]});}})[_0xad52('0x5a')](function(_0x17c2d0){var _0x4f8ebc=_0x17c2d0?_0x17c2d0[_0xad52('0x9a')]:undefined;var _0x291756=_0x122753[_0xad52('0x13')](function(_0x45b41a){return updateInteraction(_0x45b41a,_0xe22d76,_0x3043f7,_0x4f8ebc);});return Promise['all'](_0x291756);});}function countFilteredInteractions(_0xa5c2d0,_0x3cc1d9){var _0x1c310a=_0xa5c2d0['clone']();_0x1c310a[_0xad52('0x7')](_0xad52('0x9b'));_0x1c310a[_0xad52('0x7')](_0xad52('0x72'),_0xad52('0x3d'));var _0xae2453=utils[_0xad52('0x9c')](_0x3cc1d9);if(!_[_0xad52('0x9d')](_0xae2453)){_0x1c310a['where']('t.id\x20IN\x20?',_0xae2453);}var _0x52cf15={'type':db['Sequelize'][_0xad52('0x6a')][_0xad52('0x9e')],'raw':!![]};return db[_0xad52('0x6b')][_0xad52('0x6c')](_0x1c310a[_0xad52('0x6d')](),_0x52cf15);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x74f0=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','shift','join','Interaction','QueryTypes','SELECT','query','toString','merge','attributes','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.subject','i.to','i.ContactId','i.UserId','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','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','Setting','findOne','enableEmailPreview','clone','COUNT(*)','t.id\x20IN\x20?','Sequelize','exports','squel','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.id','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','name','buildExpression','type','default','value','start','end','unreadMessages','read','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','split','tags','clause','and','ids','user'];(function(_0x2ead62,_0x3a1e21){var _0x2d3d7d=function(_0x2ebfc0){while(--_0x2ebfc0){_0x2ead62['push'](_0x2ead62['shift']());}};_0x2d3d7d(++_0x3a1e21);}(_0x74f0,0xf3));var _0x074f=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0x74f0[_0x158a58];return _0x4935d9;};'use strict';var _=require('lodash');var squel=require(_0x074f('0x0'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x074f('0x1'))[_0x074f('0x2')];var utils=require(_0x074f('0x3'));var db=require(_0x074f('0x4'))['db'];function skipInteractionsQuery(_0x4e4b99,_0x51fbdc,_0x3d8d87){var _0x8965cc=![];var _0x203f47=utils[_0x074f('0x5')](_0x4e4b99);if(_0x51fbdc[_0x074f('0x6')]===_0x074f('0x7')&&!_0x3d8d87[_0x074f('0x8')]&&!_0x3d8d87[_0x203f47]){_0x8965cc=!![];}return _0x8965cc;}function getTagsQuery(){return squel['select']()[_0x074f('0x9')]('id')[_0x074f('0x9')]('name')[_0x074f('0x9')](_0x074f('0xa'))[_0x074f('0xb')](_0x074f('0xc'));}function getUsersQuery(_0x40179d,_0x4f37e1){var _0x4f0952=utils[_0x074f('0xd')](_0x40179d);var _0x41646d=_0x074f('0xe')+_0x40179d+_0x074f('0xf');var _0x148da=squel[_0x074f('0x10')]()[_0x074f('0x9')](_0x074f('0x11'))[_0x074f('0x9')]('u.fullname')[_0x074f('0x9')]('ui.'+_0x4f0952)[_0x074f('0xb')](_0x41646d,'ui')[_0x074f('0x12')](_0x074f('0x13'),'u',_0x074f('0x14'));if(_0x4f37e1[_0x074f('0x15')]>0x0){_0x148da[_0x074f('0x16')](_0x074f('0x17')+_0x4f0952+_0x074f('0x18'),_[_0x074f('0x19')](_0x4f37e1,'id'));}return _0x148da;}function getInteractionsQuery(_0x428987){var _0x40fd10=utils['getInteractionsTables'](_0x428987);var _0x111e1f=utils[_0x074f('0x5')](_0x428987);var _0x200e43=utils[_0x074f('0xd')](_0x428987);return squel[_0x074f('0x10')]()[_0x074f('0xb')](_0x40fd10['interactions'],'i')['left_join'](_0x074f('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x074f('0x13'),'o',_0x074f('0x1b'))[_0x074f('0x12')](_0x40fd10[_0x074f('0x1c')],'a',_0x074f('0x1d')+_0x111e1f)[_0x074f('0x12')](_0x40fd10[_0x074f('0x1e')],'me',_0x074f('0x1f')+_0x200e43+_0x074f('0x20'))[_0x074f('0x12')](_0x40fd10[_0x074f('0x21')],'it',_0x074f('0x22')+_0x200e43+_0x074f('0x20'))[_0x074f('0x12')](_0x074f('0xc'),'t',_0x074f('0x23'));}function getSqlClauses(){var _0xdfa2d8={'body':squel[_0x074f('0x24')](),'contact':squel[_0x074f('0x24')](),'default':squel[_0x074f('0x24')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0x074f('0x24')](),'ids':null},'user':squel[_0x074f('0x24')]()};return _0xdfa2d8;}function parseTagParameter(_0x151977){var _0x3eb67d=squel['expr']();if(_0x151977){var _0x21cec2=utils[_0x074f('0x25')](_0x151977);_0x21cec2[_0x074f('0x26')](function(_0x312119){_0x3eb67d['or'](_0x074f('0x27'),'%,'+_0x312119+',%');});}return _0x3eb67d;}function parseReadParameter(_0xb9722a){var _0x508db2='';if(_0xb9722a){_0x508db2=_0x074f('0x28');if(_0xb9722a==='1'){_0x508db2=_0x508db2[_0x074f('0x29')](_0x074f('0x2a'),'=');}else{_0x508db2=_0x508db2['replace'](_0x074f('0x2a'),'>');}}return _0x508db2;}function parseSearchFilter(_0x5d6edd,_0x4fcfb5){var _0x28cb12=squel['expr']();if(_0x4fcfb5){var _0x4aa96f=_0x4fcfb5[_0x074f('0x29')]('\x5c','\x5c\x5c')[_0x074f('0x29')](/'/g,'\x27\x27');if(qs[_0x074f('0x2b')](_0x4aa96f)){_0x28cb12['or']('i.id\x20LIKE\x20?',_0x4aa96f+'%');if([_0x074f('0x2c'),_0x074f('0x2d')][_0x074f('0x2e')](_0x5d6edd)){_0x28cb12['or']('i.phone\x20LIKE\x20?',_0x4aa96f+'%');}else if(_0x5d6edd===_0x074f('0x2f')){_0x28cb12['or'](_0x074f('0x30'),_0x4aa96f+'%');}else if(_0x5d6edd===_0x074f('0x31')){_0x28cb12['or'](_0x074f('0x32'),_0x4aa96f+'%');}}else if(_0x5d6edd===_0x074f('0x33')&&qs['isEmail'](_0x4aa96f)){_0x28cb12['or'](_0x074f('0x34'),_0x4aa96f+'%');}else{if(_0x5d6edd===_0x074f('0x33')){_0x28cb12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x074f('0x35')](_0x4aa96f))['or'](_0x074f('0x36'),qs[_0x074f('0x35')](_0x4aa96f));}else{if(_0x5d6edd!=='fax'){_0x28cb12['or'](_0x074f('0x37'),qs[_0x074f('0x35')](_0x4aa96f));}_0x28cb12['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4aa96f+'%');}}}return _0x28cb12;}function parseAdvancedSearchFilter(_0x367931,_0x1cc95d){var _0x3407bd=getSqlClauses();var _0x3c756b=as[_0x074f('0x38')](_0x367931);var _0x19f26f=_0x3c756b[_0x074f('0x39')];for(var _0x3e0586=0x0;_0x3e0586<_0x3c756b[_0x074f('0x3a')][_0x074f('0x15')];_0x3e0586++){var _0x51aa52=_0x3c756b[_0x074f('0x3a')][_0x3e0586];var _0x2834df='i';var _0x532ffc=_[_0x074f('0x3b')](_0x1cc95d,[_0x074f('0x3c'),_0x51aa52[_0x074f('0x9')]]);if(_0x532ffc){var _0xc8f80d=as[_0x074f('0x3d')](_0x2834df,_0x532ffc[_0x074f('0x3e')],_0x51aa52);_0x3407bd[_0x074f('0x3f')][_0x19f26f](_0xc8f80d['text'],_0xc8f80d[_0x074f('0x40')][_0x074f('0x41')],_0xc8f80d[_0x074f('0x40')][_0x074f('0x42')]);}else{switch(_0x51aa52[_0x074f('0x9')]){case _0x074f('0x43'):var _0x567a2a=parseReadParameter(_0x51aa52[_0x074f('0x40')]);_0x3407bd[_0x074f('0x44')]['and'](_0x567a2a);break;case _0x074f('0x45'):if(_0x51aa52[_0x074f('0x46')]===_0x074f('0x47')){if(_0x51aa52['value']['split']('\x20')['length']>0x1){_0x3407bd[_0x074f('0x48')][_0x19f26f](_0x074f('0x49'),qs[_0x074f('0x35')](_0x51aa52['value']),null);}else{var _0x3dd568='%'+_0x51aa52[_0x074f('0x40')]+'%';_0x3407bd['contact'][_0x19f26f](_0x074f('0x4a'),_0x3dd568,_0x3dd568,_0x3dd568);}}else{_0x532ffc=_[_0x074f('0x3b')](_0x1cc95d,[_0x074f('0x3c'),_0x074f('0x4b')]);_0x51aa52[_0x074f('0x9')]=_0x074f('0x4b');_0xc8f80d=as[_0x074f('0x3d')](_0x2834df,_0x532ffc[_0x074f('0x3e')],_0x51aa52);_0x3407bd[_0x074f('0x48')][_0x19f26f](_0xc8f80d[_0x074f('0x4c')],_0xc8f80d['value'][_0x074f('0x41')],_0xc8f80d['value'][_0x074f('0x42')]);}break;case'Tag':var _0x1c5a8e=_0x51aa52['value'][_0x074f('0x4d')](',')['map'](function(_0x654e6e){return Number(_0x654e6e);});var _0x84be46=parseTagParameter(_0x1c5a8e);_0x3407bd[_0x074f('0x4e')][_0x074f('0x4f')][_0x074f('0x50')](_0x84be46);_0x3407bd[_0x074f('0x4e')][_0x074f('0x51')]=_0x1c5a8e;break;case'User':if(_0x51aa52[_0x074f('0x46')]===_0x074f('0x47')){_0x3407bd[_0x074f('0x52')][_0x19f26f](_0x074f('0x53'),'%'+_0x51aa52['value']+'%',null);}else{_0x532ffc=_[_0x074f('0x3b')](_0x1cc95d,['name',_0x074f('0x54')]);_0x51aa52[_0x074f('0x9')]=_0x074f('0x54');_0xc8f80d=as['buildExpression'](_0x2834df,_0x532ffc[_0x074f('0x3e')],_0x51aa52);_0x3407bd['user'][_0x19f26f](_0xc8f80d[_0x074f('0x4c')],_0xc8f80d[_0x074f('0x40')]['start'],_0xc8f80d[_0x074f('0x40')]['end']);}break;case _0x074f('0x55'):case _0x074f('0x56'):_0xc8f80d=as['buildExpression']('me',null,_0x51aa52);_0x3407bd['body'][_0x19f26f](_0xc8f80d['text'],_0xc8f80d['value'][_0x074f('0x41')],_0xc8f80d[_0x074f('0x40')][_0x074f('0x42')]);break;}}}return _0x3407bd;}function parseModelFields(_0xdd3709,_0x53b1e5,_0x1e3364){var _0x3895c0=utils[_0x074f('0x5')](_0xdd3709);var _0xa8fac5=squel[_0x074f('0x24')]();var _0x42ab64=_(_0x53b1e5)[_0x074f('0x57')]()[_0x074f('0x19')](function(_0x53d565){return _[_0x074f('0x58')](_0x1e3364,[_0x074f('0x3c'),_0x53d565])?_0x53d565:undefined;})[_0x074f('0x59')]()[_0x074f('0x40')]();if(_0x42ab64['length']>0x0){_0x42ab64[_0x074f('0x26')](function(_0x36edd8){if(_0x36edd8===_0x3895c0){_0xa8fac5['and']('i.'+_0x3895c0+'\x20IN\x20?',[][_0x074f('0x5a')](_0x53b1e5[_0x36edd8]));}else if(_0x36edd8===_0x074f('0x5b')){var _0x1ecaf7=JSON[_0x074f('0x5c')](_0x53b1e5[_0x36edd8])['$gte'];var _0x4ed750=JSON[_0x074f('0x5c')](_0x53b1e5[_0x36edd8])[_0x074f('0x5d')];_0xa8fac5[_0x074f('0x50')](_0x074f('0x5e'),_0x1ecaf7,_0x4ed750);}else{if(_0x53b1e5[_0x36edd8]===_0x074f('0x5f')){_0xa8fac5[_0x074f('0x50')]('i.'+_0x36edd8+_0x074f('0x60'));}else{_0xa8fac5[_0x074f('0x50')]('i.'+_0x36edd8+_0x074f('0x61'),_0x53b1e5[_0x36edd8]);}}});}return _0xa8fac5;}function parseQueryParameters(_0x5bda95,_0x24d267,_0x3aa992){var _0x21dbc7=getSqlClauses();return Promise[_0x074f('0x62')]()[_0x074f('0x63')](function(){return parseModelFields(_0x5bda95,_0x24d267,_0x3aa992);})[_0x074f('0x63')](function(_0x47ba30){_0x21dbc7[_0x074f('0x64')][_0x074f('0x50')](_0x47ba30);return parseReadParameter(_0x24d267['read']);})[_0x074f('0x63')](function(_0x2130c8){_0x21dbc7[_0x074f('0x44')][_0x074f('0x50')](_0x2130c8);return parseTagParameter(_0x24d267[_0x074f('0x65')]);})[_0x074f('0x63')](function(_0x2431da){_0x21dbc7[_0x074f('0x4e')][_0x074f('0x4f')][_0x074f('0x50')](_0x2431da);return parseSearchFilter(_0x5bda95,_0x24d267['filter']);})[_0x074f('0x63')](function(_0x51ede6){_0x21dbc7['filter']=_0x51ede6;return _0x21dbc7;});}function checkAccountsRestrictions(_0x41aec7,_0x599f5c,_0x582cbe){var _0x24eb7a=utils[_0x074f('0x5')](_0x41aec7);var _0x668a47=_0x074f('0x66')+_[_0x074f('0x67')](_0x41aec7)+(_0x41aec7===_0x074f('0x68')?_0x074f('0x69'):_0x074f('0x6a'));var _0x52019b=squel['expr']();return Promise[_0x074f('0x62')]()[_0x074f('0x63')](function(){if(_0x582cbe[_0x074f('0x8')]&&_0x599f5c['role']===_0x074f('0x7')){return _0x599f5c[_0x668a47]({'attributes':['id'],'raw':!![]});}})[_0x074f('0x63')](function(_0x5af7d2){if(_0x5af7d2){if(_0x5af7d2['length']===0x0){_0x52019b[_0x074f('0x50')]('i.'+_0x24eb7a+'\x20IS\x20NULL');}else{_0x52019b[_0x074f('0x50')]('i.'+_0x24eb7a+_0x074f('0x18'),_['map'](_0x5af7d2,'id'));}}else if(!_0x582cbe[_0x24eb7a]){_0x52019b[_0x074f('0x50')]('i.'+_0x24eb7a+_0x074f('0x6b'));}})[_0x074f('0x63')](function(){return _0x52019b;});}function getClosedOrderClause(_0x2f36d4,_0x19475b){var _0x9fe79e='';var _0x2522bd=[_0x074f('0x6c'),_0x074f('0x6d'),_0x074f('0x6e')];if(_0x2f36d4===_0x074f('0x33')){_0x2522bd[_0x074f('0x6f')]('i.substatus');}if(_0x19475b['closed']==='0'&&_0x2f36d4==='mail'){_0x9fe79e=_0x074f('0x70');}else{if(_0x19475b['closed']==='1'){_0x2522bd[_0x074f('0x71')]();}_0x9fe79e='CONCAT_WS(\x27\x27,\x20'+_0x2522bd[_0x074f('0x72')](',\x20')+')';}return _0x9fe79e;}function getFilteredInteractions(_0xe3f33,_0x5af612,_0x4357b4,_0x1253f7){var _0x22f749=utils[_0x074f('0xd')](_0xe3f33);var _0x183bbf=_[_0x074f('0x67')](_0xe3f33)+_0x074f('0x73');var _0x5bb76b=[];var _0x18b9fc=getTagsQuery();var _0x439e18={'type':db['Sequelize'][_0x074f('0x74')][_0x074f('0x75')],'raw':!![]};var _0x125d07=[];var _0x3874fc=[];return db['sequelize'][_0x074f('0x76')](_0x18b9fc[_0x074f('0x77')](),_0x439e18)[_0x074f('0x63')](function(_0x4d26e5){_0x5bb76b=_['keyBy'](_0x4d26e5,'id');_0x439e18=_[_0x074f('0x78')](_0x439e18,{'model':db[_0x183bbf],'mapToModel':!![],'nest':!![]});if(_0x4357b4[_0x074f('0x64')]){_0x1253f7[_0x074f('0x79')][_0x074f('0x26')](function(_0x31d5e8){_0x5af612['field']('i.'+_0x31d5e8);});}else{_0x5af612[_0x074f('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x074f('0x43'));_0x5af612[_0x074f('0x9')](_0x074f('0x7a'),_0x074f('0x7b'));_0x5af612[_0x074f('0x9')](_0x074f('0x7c'),_0x074f('0x7d'));if(_0xe3f33===_0x074f('0x33')){_0x5af612[_0x074f('0x9')](_0x074f('0x7e'),_0x074f('0x7f'));_0x5af612['field'](_0x074f('0x80'),_0x074f('0x81'));_0x5af612['field']('i.id');_0x5af612['field'](_0x074f('0x82'));_0x5af612[_0x074f('0x9')](_0x074f('0x83'));_0x5af612[_0x074f('0x9')](_0x074f('0x84'));_0x5af612['field']('i.closedAt');_0x5af612[_0x074f('0x9')]('i.attach');_0x5af612[_0x074f('0x9')]('i.lastMsgAt');_0x5af612[_0x074f('0x9')]('i.lastMsgDirection');_0x5af612['field'](_0x074f('0x85'));_0x5af612[_0x074f('0x9')](_0x074f('0x6e'));_0x5af612[_0x074f('0x9')]('i.secondDisposition');_0x5af612[_0x074f('0x9')]('i.thirdDisposition');_0x5af612[_0x074f('0x9')](_0x074f('0x70'));_0x5af612['field'](_0x074f('0x86'));_0x5af612[_0x074f('0x9')](_0x074f('0x87'));_0x5af612['field']('i.MailAccountId');_0x5af612[_0x074f('0x9')](_0x074f('0x88'));}else if(_0xe3f33===_0x074f('0x31')){_0x5af612[_0x074f('0x9')](_0x074f('0x89'),_0x074f('0x81'));}else{_0x5af612[_0x074f('0x9')]('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',_0x074f('0x81'));}if(_0xe3f33!==_0x074f('0x33')){_0x5af612[_0x074f('0x9')]('i.*');}_0x5af612[_0x074f('0x9')]('c.firstName',_0x074f('0x8a'));_0x5af612[_0x074f('0x9')](_0x074f('0x8b'),_0x074f('0x8c'));_0x5af612[_0x074f('0x9')]('c.email',_0x074f('0x8d'));_0x5af612[_0x074f('0x9')]('c.phone','Contact.phone');_0x5af612['field'](_0x074f('0x8e'),'Contact.mobile');_0x5af612[_0x074f('0x9')](_0x074f('0x8f'),_0x074f('0x90'));_0x5af612[_0x074f('0x9')](_0x074f('0x91'),_0x074f('0x92'));_0x5af612['field'](_0x074f('0x93'),_0x074f('0x94'));_0x5af612[_0x074f('0x9')](_0x074f('0x95'),_0x074f('0x96'));}if(_0x1253f7[_0x074f('0x97')]){_0x5af612[_0x074f('0x97')](_0x1253f7[_0x074f('0x97')]);}if(_0x1253f7[_0x074f('0x98')]){_0x5af612[_0x074f('0x98')](_0x1253f7['offset']);}return db[_0x074f('0x99')][_0x074f('0x76')](_0x5af612[_0x074f('0x77')](),_0x439e18);})[_0x074f('0x63')](function(_0x4b20fa){_0x125d07=_0x4b20fa;var _0x5bfb4a=getUsersQuery(_0xe3f33,_0x125d07);return db[_0x074f('0x99')][_0x074f('0x76')](_0x5bfb4a[_0x074f('0x77')](),_0x439e18);})[_0x074f('0x63')](function(_0x4835fb){_0x3874fc=_[_0x074f('0x9a')](_0x4835fb,_0x22f749);if(_0xe3f33===_0x074f('0x33')){return db[_0x074f('0x9b')][_0x074f('0x9c')]({'attributes':[_0x074f('0x9d')],'raw':!![]});}})[_0x074f('0x63')](function(_0x395e35){var _0x52c93d=_0x395e35?_0x395e35[_0x074f('0x9d')]:undefined;var _0x3c63e9=_0x125d07[_0x074f('0x19')](function(_0x1d5ba5){return updateInteraction(_0x1d5ba5,_0x5bb76b,_0x3874fc,_0x52c93d);});return Promise['all'](_0x3c63e9);});}function countFilteredInteractions(_0x148ab3,_0x49e228){var _0x35794f=_0x148ab3[_0x074f('0x9e')]();_0x35794f[_0x074f('0x9')](_0x074f('0x9f'));_0x35794f[_0x074f('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x074f('0x43'));var _0x5de370=utils[_0x074f('0x25')](_0x49e228);if(!_['isEmpty'](_0x5de370)){_0x35794f[_0x074f('0x16')](_0x074f('0xa0'),_0x5de370);}var _0x5dcb03={'type':db[_0x074f('0xa1')]['QueryTypes'][_0x074f('0x75')],'raw':!![]};return db[_0x074f('0x99')][_0x074f('0x76')](_0x35794f[_0x074f('0x77')](),_0x5dcb03);}module[_0x074f('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index ef1401a..5d8652a 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4ac=['UserId','answered','talking','findOne','out','plainBody','-id','then','lastMsgText','trimStart','updateInteraction','Users','TagIds','Tags','lodash','map','fullname','forEach','waiting','unmanaged','abandoned','total','closed','disposition'];(function(_0x8d7443,_0x32c428){var _0x44b8a8=function(_0x2a367f){while(--_0x2a367f){_0x8d7443['push'](_0x8d7443['shift']());}};_0x44b8a8(++_0x32c428);}(_0xe4ac,0x1d6));var _0xce4a=function(_0x32c97a,_0x29b6fc){_0x32c97a=_0x32c97a-0x0;var _0x5de34d=_0xe4ac[_0x32c97a];return _0x5de34d;};'use strict';var _=require(_0xce4a('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x321516,_0x1b3804){return new Promise(function(_0x186cdf,_0x217baf){try{var _0x19bb9f=[];if(_0x1b3804[_0x321516]){_0x19bb9f=_0x1b3804[_0x321516][_0xce4a('0x1')](function(_0x1deae0){return{'id':_0x1deae0['id'],'fullname':_0x1deae0[_0xce4a('0x2')]};});}return _0x186cdf(_0x19bb9f);}catch(_0x346322){_0x217baf(_0x346322);}});}function getInteractionTags(_0x20fbb7,_0x5f3279){var _0x106db8=[];if(_0x20fbb7){_0x20fbb7['split'](',')[_0xce4a('0x3')](function(_0xe1e286){_0x106db8['push'](_0x5f3279[_0xe1e286]);});}return _0x106db8;}function updateWaitingCounter(_0x5625cf){if(_0x5625cf[_0xce4a('0x4')]){_0x5625cf[_0xce4a('0x4')]-=0x1;}}function updateInteractionCounters(_0x15a4d8){_0x15a4d8[_0xce4a('0x4')]=0x0;_0x15a4d8['talking']=0x0;_0x15a4d8['answered']=0x0;_0x15a4d8[_0xce4a('0x5')]=0x0;_0x15a4d8[_0xce4a('0x6')]=0x0;_0x15a4d8[_0xce4a('0x7')]=0x0;if(_0x15a4d8[_0xce4a('0x8')]){if(_0x15a4d8[_0xce4a('0x9')]===_0xce4a('0x6')){_0x15a4d8[_0xce4a('0x6')]+=0x1;updateWaitingCounter(_0x15a4d8);}if(_0x15a4d8[_0xce4a('0xa')]){_0x15a4d8[_0xce4a('0xb')]+=0x1;if(_0x15a4d8[_0xce4a('0xc')]){_0x15a4d8[_0xce4a('0xc')]-=0x1;}}else{if(_0x15a4d8['disposition']){_0x15a4d8[_0xce4a('0x5')]+=0x1;updateWaitingCounter(_0x15a4d8);}}}else{if(!_0x15a4d8[_0xce4a('0xa')]){_0x15a4d8[_0xce4a('0x4')]+=0x1;}if(_0x15a4d8[_0xce4a('0xa')]){_0x15a4d8[_0xce4a('0xc')]+=0x1;updateWaitingCounter(_0x15a4d8);}}_0x15a4d8[_0xce4a('0x7')]+=0x1;return _0x15a4d8;}function getLastMessageText(_0x4f5056){return db['MailMessage'][_0xce4a('0xd')]({'where':{'$and':[{'MailInteractionId':_0x4f5056['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xce4a('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xce4a('0xf')],'order':_0xce4a('0x10'),'raw':!![]})[_0xce4a('0x11')](function(_0x24a789){if(_0x24a789&&_0x24a789[_0xce4a('0xf')]){_0x4f5056[_0xce4a('0x12')]=_[_0xce4a('0x13')](_0x24a789[_0xce4a('0xf')]);}return _0x4f5056;})['catch'](function(_0xb4af5f){throw _0xb4af5f;});}exports[_0xce4a('0x14')]=function(_0x525d8e,_0x41a5c2,_0x637f9f,_0x46122b){return new Promise(function(_0x2e888a,_0x308bbc){return getInteractionUsers(_0x525d8e['id'],_0x637f9f)[_0xce4a('0x11')](function(_0x9249ea){_0x525d8e[_0xce4a('0x15')]=_0x9249ea;return getInteractionTags(_0x525d8e[_0xce4a('0x16')],_0x41a5c2);})[_0xce4a('0x11')](function(_0x61dfe7){_0x525d8e[_0xce4a('0x17')]=_0x61dfe7;delete _0x525d8e[_0xce4a('0x16')];return updateInteractionCounters(_0x525d8e);})[_0xce4a('0x11')](function(_0x5ba472){if(_0x46122b){return getLastMessageText(_0x5ba472);}else{return _0x5ba472;}})[_0xce4a('0x11')](function(_0x130964){_0x2e888a(_0x130964);})['catch'](function(_0x55d4a0){_0x308bbc(_0x55d4a0);});});}; \ No newline at end of file +var _0xb97b=['out','plainBody','lastMsgText','trimStart','catch','updateInteraction','then','Users','TagIds','lodash','../../mysqldb','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','disposition','UserId','findOne'];(function(_0x108b3e,_0x5ad3c2){var _0x5c9803=function(_0x571a3f){while(--_0x571a3f){_0x108b3e['push'](_0x108b3e['shift']());}};_0x5c9803(++_0x5ad3c2);}(_0xb97b,0xb1));var _0xbb97=function(_0x4d1569,_0x5c5a38){_0x4d1569=_0x4d1569-0x0;var _0x5e1efe=_0xb97b[_0x4d1569];return _0x5e1efe;};'use strict';var _=require(_0xbb97('0x0'));var db=require(_0xbb97('0x1'))['db'];function getInteractionUsers(_0x4fe800,_0x56522e){return new Promise(function(_0x1da55b,_0x487258){try{var _0x28c90c=[];if(_0x56522e[_0x4fe800]){_0x28c90c=_0x56522e[_0x4fe800]['map'](function(_0x42475a){return{'id':_0x42475a['id'],'fullname':_0x42475a[_0xbb97('0x2')]};});}return _0x1da55b(_0x28c90c);}catch(_0x5aa026){_0x487258(_0x5aa026);}});}function getInteractionTags(_0x4dd7c8,_0x1ad91d){var _0x25a064=[];if(_0x4dd7c8){_0x4dd7c8[_0xbb97('0x3')](',')[_0xbb97('0x4')](function(_0x52f409){_0x25a064[_0xbb97('0x5')](_0x1ad91d[_0x52f409]);});}return _0x25a064;}function updateWaitingCounter(_0x16fce6){if(_0x16fce6[_0xbb97('0x6')]){_0x16fce6[_0xbb97('0x6')]-=0x1;}}function updateInteractionCounters(_0x5d6f4b){_0x5d6f4b['waiting']=0x0;_0x5d6f4b[_0xbb97('0x7')]=0x0;_0x5d6f4b[_0xbb97('0x8')]=0x0;_0x5d6f4b[_0xbb97('0x9')]=0x0;_0x5d6f4b[_0xbb97('0xa')]=0x0;_0x5d6f4b[_0xbb97('0xb')]=0x0;if(_0x5d6f4b['closed']){if(_0x5d6f4b[_0xbb97('0xc')]===_0xbb97('0xa')){_0x5d6f4b[_0xbb97('0xa')]+=0x1;updateWaitingCounter(_0x5d6f4b);}if(_0x5d6f4b['UserId']){_0x5d6f4b[_0xbb97('0x8')]+=0x1;if(_0x5d6f4b[_0xbb97('0x7')]){_0x5d6f4b[_0xbb97('0x7')]-=0x1;}}else{if(_0x5d6f4b['disposition']){_0x5d6f4b[_0xbb97('0x9')]+=0x1;updateWaitingCounter(_0x5d6f4b);}}}else{if(!_0x5d6f4b[_0xbb97('0xd')]){_0x5d6f4b[_0xbb97('0x6')]+=0x1;}if(_0x5d6f4b['UserId']){_0x5d6f4b[_0xbb97('0x7')]+=0x1;updateWaitingCounter(_0x5d6f4b);}}_0x5d6f4b[_0xbb97('0xb')]+=0x1;return _0x5d6f4b;}function getLastMessageText(_0x522f7d){return db['MailMessage'][_0xbb97('0xe')]({'where':{'$and':[{'MailInteractionId':_0x522f7d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb97('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbb97('0x10')],'order':'-id','raw':!![]})['then'](function(_0x25696d){if(_0x25696d&&_0x25696d[_0xbb97('0x10')]){_0x522f7d[_0xbb97('0x11')]=_[_0xbb97('0x12')](_0x25696d[_0xbb97('0x10')]);}return _0x522f7d;})[_0xbb97('0x13')](function(_0x2cf2c4){throw _0x2cf2c4;});}exports[_0xbb97('0x14')]=function(_0x48f2be,_0x59beb4,_0x544edd,_0x4ec3eb){return new Promise(function(_0x589c24,_0x1124e0){return getInteractionUsers(_0x48f2be['id'],_0x544edd)[_0xbb97('0x15')](function(_0x6424ee){_0x48f2be[_0xbb97('0x16')]=_0x6424ee;return getInteractionTags(_0x48f2be[_0xbb97('0x17')],_0x59beb4);})[_0xbb97('0x15')](function(_0x4cd0c3){_0x48f2be['Tags']=_0x4cd0c3;delete _0x48f2be['TagIds'];return updateInteractionCounters(_0x48f2be);})[_0xbb97('0x15')](function(_0x6cecd){if(_0x4ec3eb){return getLastMessageText(_0x6cecd);}else{return _0x6cecd;}})[_0xbb97('0x15')](function(_0x2562db){_0x589c24(_0x2562db);})[_0xbb97('0x13')](function(_0x4d96d1){_0x1124e0(_0x4d96d1);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index fb6b66b..67a38f5 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c05=['accounts','_interaction_has_tags','_messages','user_has_','_interactions','toLowerCase','toUpperCase','role','null','upperFirst','findOne','then','update','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','capitalize','Website','InteractionId','unknown'];(function(_0x4fa6c8,_0x5ad782){var _0x166b11=function(_0xfcc77a){while(--_0xfcc77a){_0x4fa6c8['push'](_0x4fa6c8['shift']());}};_0x166b11(++_0x5ad782);}(_0x9c05,0x73));var _0x59c0=function(_0x4df719,_0x14bebc){_0x4df719=_0x4df719-0x0;var _0x599195=_0x9c05[_0x4df719];return _0x599195;};'use strict';var _=require(_0x59c0('0x0'));var db=require(_0x59c0('0x1'))['db'];var loggers={'openchannel':require(_0x59c0('0x2'))(_0x59c0('0x3')),'mail':require(_0x59c0('0x2'))('mail-interactions'),'fax':require(_0x59c0('0x2'))('fax-interactions'),'sms':require(_0x59c0('0x2'))(_0x59c0('0x4')),'chat':require(_0x59c0('0x2'))(_0x59c0('0x5')),'whatsapp':require(_0x59c0('0x2'))('whatsapp-interactions')};function getAccountFK(_0x22d581){return _[_0x59c0('0x6')](_0x22d581)+(_0x22d581==='chat'?_0x59c0('0x7'):'Account')+'Id';}function getInteractionFK(_0xffcf83){return _[_0x59c0('0x6')](_0xffcf83)+_0x59c0('0x8');}function getInteractionId(_0x2d61ab,_0x1dd234,_0x12fab4){if(_0x2d61ab&&_0x2d61ab[_['upperFirst'](_0x12fab4)+_0x59c0('0x8')]){return _0x2d61ab[_['upperFirst'](_0x12fab4)+_0x59c0('0x8')];}else if(_0x2d61ab&&_0x2d61ab['id']){return _0x2d61ab['id'];}else if(_0x1dd234&&_0x1dd234['id']){return _0x1dd234['id'];}else{return _0x59c0('0x9');}}function getInteractionsTables(_0x491adb){return{'accounts':_0x491adb+'_'+(_0x491adb==='chat'?'websites':_0x59c0('0xa')),'interactions':_0x491adb+'_interactions','interactionsTags':_0x491adb+_0x59c0('0xb'),'messages':_0x491adb+_0x59c0('0xc'),'userInteractions':_0x59c0('0xd')+_0x491adb+_0x59c0('0xe')};}function getSelectedTags(_0x3d69e0){var _0x2d0b98=[];if(_0x3d69e0){_0x2d0b98=Array['isArray'](_0x3d69e0)?_0x3d69e0:[_0x3d69e0];}return _0x2d0b98;}function log(_0x109360,_0xa1ebc,_0x31d826,_0x2e8fd4,_0x578fc3,_0x2673b6){loggers[_0x578fc3[_0x59c0('0xf')]()][_0x109360]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2673b6[_0x59c0('0x10')](),_0xa1ebc?_0xa1ebc['id']:null,_0xa1ebc?_0xa1ebc['name']:null,_0xa1ebc?_0xa1ebc[_0x59c0('0x11')]:null,getInteractionId(_0x31d826,_0x2e8fd4,_0x578fc3),_0x31d826?JSON['stringify'](_0x31d826):_0x59c0('0x12'));}function updateUser(_0x53b194,_0x57c07a,_0x1258b9,_0x136ea0,_0x21adaa){db[_[_0x59c0('0x13')](_0x136ea0)+'Interaction'][_0x59c0('0x14')]({'where':{'id':getInteractionId(_0x57c07a,_0x1258b9,_0x136ea0)}})[_0x59c0('0x15')](function(_0x4f0eaa){if(_0x4f0eaa){return _0x4f0eaa[_0x59c0('0x16')]({'UserId':_0x53b194?_0x53b194['id']:null});}})[_0x59c0('0x15')](function(_0x868e0e){if(_0x868e0e){log('info',_0x53b194,_0x57c07a,_0x1258b9,_0x136ea0,_0x21adaa);}})['catch'](function(){log(_0x59c0('0x17'),_0x53b194,_0x57c07a,_0x1258b9,_0x136ea0,_0x21adaa);});}module[_0x59c0('0x18')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe8e8=['../../config/logger','openchannel-interactions','mail-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','InteractionId','upperFirst','unknown','websites','_interaction_has_tags','_messages','_interactions','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','update','info','error','exports','lodash','../../mysqldb'];(function(_0xc91219,_0x4a6307){var _0x66d5ad=function(_0x440198){while(--_0x440198){_0xc91219['push'](_0xc91219['shift']());}};_0x66d5ad(++_0x4a6307);}(_0xe8e8,0x15a));var _0x8e8e=function(_0x5a60d7,_0x208d51){_0x5a60d7=_0x5a60d7-0x0;var _0x19e1bc=_0xe8e8[_0x5a60d7];return _0x19e1bc;};'use strict';var _=require(_0x8e8e('0x0'));var db=require(_0x8e8e('0x1'))['db'];var loggers={'openchannel':require(_0x8e8e('0x2'))(_0x8e8e('0x3')),'mail':require(_0x8e8e('0x2'))(_0x8e8e('0x4')),'fax':require(_0x8e8e('0x2'))('fax-interactions'),'sms':require(_0x8e8e('0x2'))('sms-interactions'),'chat':require(_0x8e8e('0x2'))(_0x8e8e('0x5')),'whatsapp':require(_0x8e8e('0x2'))(_0x8e8e('0x6'))};function getAccountFK(_0x5888e4){return _[_0x8e8e('0x7')](_0x5888e4)+(_0x5888e4===_0x8e8e('0x8')?'Website':_0x8e8e('0x9'))+'Id';}function getInteractionFK(_0x579138){return _[_0x8e8e('0x7')](_0x579138)+_0x8e8e('0xa');}function getInteractionId(_0x1a009e,_0x1a4e0e,_0x4bb26f){if(_0x1a009e&&_0x1a009e[_['upperFirst'](_0x4bb26f)+_0x8e8e('0xa')]){return _0x1a009e[_[_0x8e8e('0xb')](_0x4bb26f)+_0x8e8e('0xa')];}else if(_0x1a009e&&_0x1a009e['id']){return _0x1a009e['id'];}else if(_0x1a4e0e&&_0x1a4e0e['id']){return _0x1a4e0e['id'];}else{return _0x8e8e('0xc');}}function getInteractionsTables(_0x4702af){return{'accounts':_0x4702af+'_'+(_0x4702af===_0x8e8e('0x8')?_0x8e8e('0xd'):'accounts'),'interactions':_0x4702af+'_interactions','interactionsTags':_0x4702af+_0x8e8e('0xe'),'messages':_0x4702af+_0x8e8e('0xf'),'userInteractions':'user_has_'+_0x4702af+_0x8e8e('0x10')};}function getSelectedTags(_0x43d9b3){var _0xff04bf=[];if(_0x43d9b3){_0xff04bf=Array['isArray'](_0x43d9b3)?_0x43d9b3:[_0x43d9b3];}return _0xff04bf;}function log(_0x2759db,_0x4fa9ab,_0x3e2bad,_0xf4a58e,_0x5c7297,_0x13d502){loggers[_0x5c7297[_0x8e8e('0x11')]()][_0x2759db](_0x8e8e('0x12'),_0x13d502['toUpperCase'](),_0x4fa9ab?_0x4fa9ab['id']:null,_0x4fa9ab?_0x4fa9ab[_0x8e8e('0x13')]:null,_0x4fa9ab?_0x4fa9ab[_0x8e8e('0x14')]:null,getInteractionId(_0x3e2bad,_0xf4a58e,_0x5c7297),_0x3e2bad?JSON[_0x8e8e('0x15')](_0x3e2bad):_0x8e8e('0x16'));}function updateUser(_0x3d020a,_0x45a317,_0x112c12,_0x30118c,_0x1d0a42){db[_[_0x8e8e('0xb')](_0x30118c)+_0x8e8e('0x17')]['findOne']({'where':{'id':getInteractionId(_0x45a317,_0x112c12,_0x30118c)}})[_0x8e8e('0x18')](function(_0x34a9de){if(_0x34a9de){return _0x34a9de[_0x8e8e('0x19')]({'UserId':_0x3d020a?_0x3d020a['id']:null});}})[_0x8e8e('0x18')](function(_0x4e5568){if(_0x4e5568){log(_0x8e8e('0x1a'),_0x3d020a,_0x45a317,_0x112c12,_0x30118c,_0x1d0a42);}})['catch'](function(){log(_0x8e8e('0x1b'),_0x3d020a,_0x45a317,_0x112c12,_0x30118c,_0x1d0a42);});}module[_0x8e8e('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 92790e6..f17529d 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4825=['catch','users','admin','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','count','status','json'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x4825,0x148));var _0x5482=function(_0x12f080,_0x584482){_0x12f080=_0x12f080-0x0;var _0x537d59=_0x4825[_0x12f080];return _0x537d59;};'use strict';var crypto=require('crypto');var util=require(_0x5482('0x0'));var compose=require(_0x5482('0x1'));var db=require(_0x5482('0x2'))['db'];var config=require(_0x5482('0x3'));function getValueFromLicense(_0x2b343f,_0x52d345){if(_0x2b343f&&_0x52d345){if(_0x52d345[_0x5482('0x4')]&&_0x52d345[_0x5482('0x5')]){var _0x17991f=_0x52d345[_0x5482('0x4')];var _0x5adaa9=_0x52d345[_0x5482('0x5')];var _0x4c55e8=_0x17991f[_0x5482('0x6')]('-')[0x4];var _0x35ac47=_0x17991f[_0x5482('0x6')]('-')[0x0];var _0x2e9f52=crypto[_0x5482('0x7')](_0x5482('0x8'),util[_0x5482('0x9')](_0x5482('0xa'),_0x4c55e8,_0x17991f,_0x35ac47));var _0x5205a9=_0x2e9f52[_0x5482('0xb')](_0x5adaa9,_0x5482('0xc'),_0x5482('0xd'));_0x5205a9+=_0x2e9f52[_0x5482('0xe')](_0x5482('0xd'));var _0x583617=JSON[_0x5482('0xf')](_0x5205a9);return _0x583617[_0x5482('0x10')](_0x2b343f)?_0x583617[_0x2b343f]:null;}}return null;}function isLimit(_0x4df3b6,_0x4160a3,_0x42e85c,_0x125146){var _0x55adda=_0x4160a3;return compose()[_0x5482('0x11')](function(_0x1a52ea,_0x1ba88f,_0x3da2a4){return db[_0x5482('0x12')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x5482('0x13')](function(_0x5941be){var _0x2cdf2=getValueFromLicense(_0x4df3b6,_0x5941be);return _0x2cdf2?_0x2cdf2:_0x55adda;})[_0x5482('0x13')](function(_0xad9f3a){_0x55adda=_0xad9f3a;return _0x42e85c[_0x5482('0x14')](_0x125146);})['then'](function(_0x2878d6){if(_0x2878d6>=_0x55adda){return _0x1ba88f[_0x5482('0x15')](0x193)[_0x5482('0x16')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4df3b6)});}_0x3da2a4();})[_0x5482('0x17')](function(_0x46f59c){_0x3da2a4(_0x46f59c);});});}function isUserLimit(){return isLimit(_0x5482('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0x5482('0x19')},{'role':'user'}]}});}exports[_0x5482('0x1a')]=isUserLimit; \ No newline at end of file +var _0x7c88=['util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8','final','parse','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','admin','isUserLimit','crypto'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c88,0x194));var _0x87c8=function(_0xca4897,_0x2d1cd4){_0xca4897=_0xca4897-0x0;var _0x233110=_0x7c88[_0xca4897];return _0x233110;};'use strict';var crypto=require(_0x87c8('0x0'));var util=require(_0x87c8('0x1'));var compose=require(_0x87c8('0x2'));var db=require(_0x87c8('0x3'))['db'];var config=require(_0x87c8('0x4'));function getValueFromLicense(_0x2c3451,_0x211ce5){if(_0x2c3451&&_0x211ce5){if(_0x211ce5[_0x87c8('0x5')]&&_0x211ce5[_0x87c8('0x6')]){var _0x2e45a2=_0x211ce5[_0x87c8('0x5')];var _0x1b6b77=_0x211ce5[_0x87c8('0x6')];var _0x879e0f=_0x2e45a2['split']('-')[0x4];var _0x4781c4=_0x2e45a2[_0x87c8('0x7')]('-')[0x0];var _0x28c2b1=crypto[_0x87c8('0x8')](_0x87c8('0x9'),util['format'](_0x87c8('0xa'),_0x879e0f,_0x2e45a2,_0x4781c4));var _0xa55b32=_0x28c2b1[_0x87c8('0xb')](_0x1b6b77,'base64',_0x87c8('0xc'));_0xa55b32+=_0x28c2b1[_0x87c8('0xd')](_0x87c8('0xc'));var _0x41c579=JSON[_0x87c8('0xe')](_0xa55b32);return _0x41c579['hasOwnProperty'](_0x2c3451)?_0x41c579[_0x2c3451]:null;}}return null;}function isLimit(_0x4d7810,_0x37356d,_0x224dba,_0x5afead){var _0x14f245=_0x37356d;return compose()[_0x87c8('0xf')](function(_0x59b770,_0x3f2629,_0x2c397f){return db[_0x87c8('0x10')][_0x87c8('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x46149b){var _0x1378e8=getValueFromLicense(_0x4d7810,_0x46149b);return _0x1378e8?_0x1378e8:_0x14f245;})[_0x87c8('0x12')](function(_0x264fcf){_0x14f245=_0x264fcf;return _0x224dba[_0x87c8('0x13')](_0x5afead);})[_0x87c8('0x12')](function(_0x17bcc){if(_0x17bcc>=_0x14f245){return _0x3f2629[_0x87c8('0x14')](0x193)[_0x87c8('0x15')]({'message':util[_0x87c8('0x16')](_0x87c8('0x17'),_0x4d7810)});}_0x2c397f();})['catch'](function(_0x8b6e87){_0x2c397f(_0x8b6e87);});});}function isUserLimit(){return isLimit(_0x87c8('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0x87c8('0x19')},{'role':'user'}]}});}exports[_0x87c8('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index ce1abd4..230af61 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 _0x1cc9=['field','\x20AS\x20','text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','shift','pop','utcOffset','format','add','hours','minutes','moment','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo'];(function(_0x3d69f5,_0xb99af3){var _0xfc942a=function(_0x106248){while(--_0x106248){_0x3d69f5['push'](_0x3d69f5['shift']());}};_0xfc942a(++_0xb99af3);}(_0x1cc9,0x140));var _0x91cc=function(_0x37ad0c,_0x587af7){_0x37ad0c=_0x37ad0c-0x0;var _0x389e0c=_0x1cc9[_0x37ad0c];return _0x389e0c;};'use strict';var _=require('lodash');var moment=require(_0x91cc('0x0'));exports['parseSearch']=function(_0xaf91f8){var _0x4a7510={'conditions':[]};_0x4a7510[_0x91cc('0x1')]=_[_0x91cc('0x2')](_0xaf91f8,_0x91cc('0x3'))?'or':_0x91cc('0x4');var _0x261014=_0xaf91f8['replace'](_0x91cc('0x5'),'')[_0x91cc('0x6')]('[$or]','')[_0x91cc('0x7')]('||');for(var _0xf9b76b=0x0;_0xf9b76b<_0x261014['length'];_0xf9b76b++){var _0x4e5af9=_0x261014[_0xf9b76b][_0x91cc('0x7')](':=');var _0x1a052=_0x4e5af9[0x0];var _0x252e83=_0x4e5af9[_0x91cc('0x8')](0x1);_0x252e83[_0x91cc('0x9')](function(_0x557fab){var _0x5e95c2=_0x557fab[_0x91cc('0x7')]('[')['shift']();var _0xf012ff=_0x557fab[_0x91cc('0xa')](/\[(.*?)\]/g);_0xf012ff[_0x91cc('0x9')](function(_0x1907ca){var _0x521fb2=_0x1907ca[_0x91cc('0x7')]('[')[_0x91cc('0xb')](function(_0x261192){return _0x261192[_0x91cc('0xc')](']')>-0x1;})[_0x91cc('0xd')](function(_0xbb8fc1){return _0xbb8fc1[_0x91cc('0x7')](']')[0x0];})[0x0];_0x4a7510[_0x91cc('0xe')][_0x91cc('0xf')]({'field':_0x1a052,'operator':_0x5e95c2,'value':_0x521fb2});});});}return _0x4a7510;};exports[_0x91cc('0x10')]=function(_0x298d46,_0x259c7c,_0x4504ef){var _0x9a9c62={};if(_0x259c7c===_0x91cc('0x11')){if(_0x4504ef[_0x91cc('0x12')]===_0x91cc('0x13')){_0x4504ef[_0x91cc('0x12')]=_0x91cc('0x14');_0x4504ef[_0x91cc('0x15')]+=','+_0x4504ef[_0x91cc('0x15')];}else if(_[_0x91cc('0x16')]([_0x91cc('0x17'),_0x91cc('0x18')],_0x4504ef[_0x91cc('0x12')])){_0x4504ef['value']=moment(_0x4504ef['value'])['add'](0x1,_0x91cc('0x19'))['format'](_0x91cc('0x1a'));}}if(_0x4504ef[_0x91cc('0x1b')]){_0x259c7c=_0x4504ef['castTo'];_0x9a9c62['text']='CAST('+_0x298d46+'.'+_0x4504ef[_0x91cc('0x1c')]+_0x91cc('0x1d')+_0x4504ef[_0x91cc('0x1b')]+')\x20'+parseOperator(_0x4504ef[_0x91cc('0x12')]);}else{_0x9a9c62[_0x91cc('0x1e')]=_0x298d46+'.'+_0x4504ef[_0x91cc('0x1c')]+'\x20'+parseOperator(_0x4504ef['operator']);}if(_[_0x91cc('0x16')]([_0x91cc('0x1f'),_0x91cc('0x20')],_0x4504ef[_0x91cc('0x12')]))_0x9a9c62[_0x91cc('0x1e')]='('+_0x9a9c62[_0x91cc('0x1e')]+'\x20OR\x20'+_0x298d46+'.'+_0x4504ef[_0x91cc('0x1c')]+_0x91cc('0x21');_0x9a9c62['value']=parseValue(_0x259c7c,_0x4504ef[_0x91cc('0x12')],_0x4504ef[_0x91cc('0x15')]);return _0x9a9c62;};function parseOperator(_0x52fda8){var _0x39890e;switch(_0x52fda8){case _0x91cc('0x22'):_0x39890e=_0x91cc('0x23');break;case'$notIn':_0x39890e=_0x91cc('0x24');break;case'$eq':_0x39890e=_0x91cc('0x25');break;case'$ne':_0x39890e=_0x91cc('0x26');break;case _0x91cc('0x27'):case'$startsWith':case'$endsWith':_0x39890e=_0x91cc('0x28');break;case _0x91cc('0x29'):_0x39890e=_0x91cc('0x2a');break;case _0x91cc('0x17'):_0x39890e=_0x91cc('0x2b');break;case _0x91cc('0x18'):_0x39890e=_0x91cc('0x2c');break;case _0x91cc('0x2d'):_0x39890e=_0x91cc('0x2e');break;case _0x91cc('0x14'):_0x39890e=_0x91cc('0x2f');break;}return _0x39890e;}function parseValue(_0x3c79a9,_0x29259c,_0xd95629){var _0x476eeb={'start':undefined,'end':undefined};switch(_0x29259c){case'$in':case _0x91cc('0x20'):_0x476eeb[_0x91cc('0x30')]=_0xd95629['split'](',');break;case _0x91cc('0x27'):_0x476eeb[_0x91cc('0x30')]='%'+_0xd95629+'%';break;case _0x91cc('0x31'):_0x476eeb[_0x91cc('0x30')]=_0xd95629+'%';break;case _0x91cc('0x32'):_0x476eeb[_0x91cc('0x30')]='%'+_0xd95629;break;case _0x91cc('0x14'):var _0x585900=_0xd95629[_0x91cc('0x7')](',');var _0xd95629=_0x585900[_0x91cc('0x33')]();var _0x14f9de=_0x585900[_0x91cc('0x34')]();if(_0x3c79a9==='DATE'){_0xd95629=moment(_0xd95629)[_0x91cc('0x35')](0x0,!![])[_0x91cc('0x36')]();_0x14f9de=moment(_0x14f9de)['utcOffset'](0x0,!![])[_0x91cc('0x37')](0x17,_0x91cc('0x38'))[_0x91cc('0x37')](0x3b,_0x91cc('0x39'))['add'](0x3b,'seconds')[_0x91cc('0x36')]();}_0x476eeb={'start':_0xd95629,'end':_0x14f9de};break;default:_0x476eeb[_0x91cc('0x30')]=_0xd95629;break;}return _0x476eeb;} \ No newline at end of file +var _0x7197=['field','\x20AS\x20','$ne','\x20OR\x20','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$endsWith','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','forEach','shift','match','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST('];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x7197,0x1c8));var _0x7719=function(_0x39e89d,_0x120ae9){_0x39e89d=_0x39e89d-0x0;var _0x1984ee=_0x7197[_0x39e89d];return _0x1984ee;};'use strict';var _=require(_0x7719('0x0'));var moment=require(_0x7719('0x1'));exports[_0x7719('0x2')]=function(_0x59f3f7){var _0x449f7d={'conditions':[]};_0x449f7d[_0x7719('0x3')]=_[_0x7719('0x4')](_0x59f3f7,_0x7719('0x5'))?'or':_0x7719('0x6');var _0x197296=_0x59f3f7['replace']('[$and]','')[_0x7719('0x7')](_0x7719('0x5'),'')[_0x7719('0x8')]('||');for(var _0x444e8d=0x0;_0x444e8d<_0x197296[_0x7719('0x9')];_0x444e8d++){var _0x2f17ca=_0x197296[_0x444e8d][_0x7719('0x8')](':=');var _0x10148a=_0x2f17ca[0x0];var _0x17ec17=_0x2f17ca['slice'](0x1);_0x17ec17[_0x7719('0xa')](function(_0x5ea02b){var _0x4aa9e6=_0x5ea02b[_0x7719('0x8')]('[')[_0x7719('0xb')]();var _0x1c9ec9=_0x5ea02b[_0x7719('0xc')](/\[(.*?)\]/g);_0x1c9ec9[_0x7719('0xa')](function(_0x31835d){var _0x443119=_0x31835d[_0x7719('0x8')]('[')['filter'](function(_0x5d20cd){return _0x5d20cd[_0x7719('0xd')](']')>-0x1;})[_0x7719('0xe')](function(_0x4b8980){return _0x4b8980[_0x7719('0x8')](']')[0x0];})[0x0];_0x449f7d[_0x7719('0xf')][_0x7719('0x10')]({'field':_0x10148a,'operator':_0x4aa9e6,'value':_0x443119});});});}return _0x449f7d;};exports[_0x7719('0x11')]=function(_0x5777d1,_0x2f8ff1,_0x104bdc){var _0x39377b={};if(_0x2f8ff1==='DATE'){if(_0x104bdc[_0x7719('0x12')]===_0x7719('0x13')){_0x104bdc[_0x7719('0x12')]=_0x7719('0x14');_0x104bdc[_0x7719('0x15')]+=','+_0x104bdc[_0x7719('0x15')];}else if(_['includes']([_0x7719('0x16'),'$lte'],_0x104bdc[_0x7719('0x12')])){_0x104bdc[_0x7719('0x15')]=moment(_0x104bdc[_0x7719('0x15')])[_0x7719('0x17')](0x1,_0x7719('0x18'))[_0x7719('0x19')](_0x7719('0x1a'));}}if(_0x104bdc[_0x7719('0x1b')]){_0x2f8ff1=_0x104bdc['castTo'];_0x39377b[_0x7719('0x1c')]=_0x7719('0x1d')+_0x5777d1+'.'+_0x104bdc[_0x7719('0x1e')]+_0x7719('0x1f')+_0x104bdc[_0x7719('0x1b')]+')\x20'+parseOperator(_0x104bdc[_0x7719('0x12')]);}else{_0x39377b[_0x7719('0x1c')]=_0x5777d1+'.'+_0x104bdc[_0x7719('0x1e')]+'\x20'+parseOperator(_0x104bdc[_0x7719('0x12')]);}if(_['includes']([_0x7719('0x20'),'$notIn'],_0x104bdc['operator']))_0x39377b[_0x7719('0x1c')]='('+_0x39377b['text']+_0x7719('0x21')+_0x5777d1+'.'+_0x104bdc['field']+'\x20IS\x20NULL)';_0x39377b[_0x7719('0x15')]=parseValue(_0x2f8ff1,_0x104bdc['operator'],_0x104bdc[_0x7719('0x15')]);return _0x39377b;};function parseOperator(_0x58c10e){var _0x164df2;switch(_0x58c10e){case _0x7719('0x22'):_0x164df2=_0x7719('0x23');break;case _0x7719('0x24'):_0x164df2=_0x7719('0x25');break;case'$eq':_0x164df2=_0x7719('0x26');break;case _0x7719('0x20'):_0x164df2='<>\x20?';break;case _0x7719('0x27'):case'$startsWith':case _0x7719('0x28'):_0x164df2='LIKE\x20?';break;case'$lt':_0x164df2='<\x20?';break;case _0x7719('0x16'):_0x164df2=_0x7719('0x29');break;case _0x7719('0x2a'):_0x164df2=_0x7719('0x2b');break;case _0x7719('0x2c'):_0x164df2='>=\x20?';break;case _0x7719('0x14'):_0x164df2=_0x7719('0x2d');break;}return _0x164df2;}function parseValue(_0x88ff4b,_0x36c3bc,_0x174506){var _0x16dbe2={'start':undefined,'end':undefined};switch(_0x36c3bc){case _0x7719('0x22'):case _0x7719('0x24'):_0x16dbe2[_0x7719('0x2e')]=_0x174506[_0x7719('0x8')](',');break;case'$substring':_0x16dbe2[_0x7719('0x2e')]='%'+_0x174506+'%';break;case _0x7719('0x2f'):_0x16dbe2[_0x7719('0x2e')]=_0x174506+'%';break;case _0x7719('0x28'):_0x16dbe2[_0x7719('0x2e')]='%'+_0x174506;break;case'$between':var _0x3ca102=_0x174506[_0x7719('0x8')](',');var _0x174506=_0x3ca102['shift']();var _0x64667=_0x3ca102[_0x7719('0x30')]();if(_0x88ff4b===_0x7719('0x31')){_0x174506=moment(_0x174506)[_0x7719('0x32')](0x0,!![])[_0x7719('0x19')]();_0x64667=moment(_0x64667)[_0x7719('0x32')](0x0,!![])[_0x7719('0x17')](0x17,_0x7719('0x33'))[_0x7719('0x17')](0x3b,_0x7719('0x34'))[_0x7719('0x17')](0x3b,_0x7719('0x35'))[_0x7719('0x19')]();}_0x16dbe2={'start':_0x174506,'end':_0x64667};break;default:_0x16dbe2[_0x7719('0x2e')]=_0x174506;break;}return _0x16dbe2;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 5efe3a9..10e344a 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 _0x7da7=['attributes','length','nolimit','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','limit','offset','sort','map','indexOf','priority','cast','unsigned','DESC','col','ASC','isEmpty','isArray','omit','isObject','isString','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','filters'];(function(_0x588161,_0x3dfa00){var _0x32915e=function(_0x26c33b){while(--_0x26c33b){_0x588161['push'](_0x588161['shift']());}};_0x32915e(++_0x3dfa00);}(_0x7da7,0x10d));var _0x77da=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x7da7[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x77da('0x0'));var sequelize=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x571213){var _0x59892b=['ne'];try{var _0x37667b=JSON[_0x77da('0x3')](_0x571213);var _0x4f60c3=Object[_0x77da('0x4')](_0x37667b)[0x0];return _0x59892b[_0x77da('0x5')](_0x4f60c3);}catch(_0x56458c){return![];}}function getOperatorValue(_0x19331c){var _0xc54a12=JSON['parse'](_0x19331c);var _0x30afe0=Object['keys'](_0xc54a12)[0x0];var _0x1191de=_0xc54a12[_0x30afe0];return{['$'+_0x30afe0]:_0x1191de};}exports[_0x77da('0x6')]=function(_0x37c5ab){var _0x910e5b=null;if(_0x37c5ab){_0x910e5b=_0x37c5ab[_0x77da('0x7')](',');}return _0x910e5b;};exports['filters']=function(_0x40c86e,_0xb55827){var _0x172d7f={};if(!_['isEmpty'](_0x40c86e)){_[_0x77da('0x8')](_0x40c86e,function(_0x1ab717,_0x163350){try{if(_0xb55827){var _0x2a675a=_['find'](_0xb55827,{'name':_0x163350})||{};if(hasSequelizeOperator(_0x1ab717)){_0x172d7f[_0x163350]=getOperatorValue(_0x1ab717);}else if(_0x2a675a[_0x77da('0x9')]===_0x77da('0xa')&&_[_0x77da('0xb')](_0x1ab717)){var _0x5d6e2f=JSON['parse'](_0x1ab717);var _0x26e3ff={'$gte':moment(moment(_0x5d6e2f[_0x77da('0xc')])['format'](_0x77da('0xd')))[_0x77da('0xe')]()[_0x77da('0xf')](),'$lte':moment(moment(_0x5d6e2f[_0x77da('0x10')])['format'](_0x77da('0xd')))['utc']()[_0x77da('0x11')](0x1,'s')[_0x77da('0xf')]()};_0x172d7f[_0x163350]=_0x26e3ff;}else if(_0x2a675a[_0x77da('0x12')]===_0x77da('0x13')){_0x172d7f[_0x163350]=_0x1ab717;}else{_0x172d7f[_0x163350]=_['isArray'](_0x1ab717)?_0x1ab717:JSON['parse'](_0x1ab717);}}else{_0x172d7f[_0x163350]=_['isArray'](_0x1ab717)?_0x1ab717:JSON['parse'](_0x1ab717);}}catch(_0x103e46){_0x172d7f[_0x163350]=_0x1ab717[_0x77da('0x7')](',');}});}return _0x172d7f;};exports[_0x77da('0x14')]=function(_0x335dcb){_0x335dcb=parseInt(_0x335dcb,0xa);if(!_0x335dcb||_0x335dcb<0x0){_0x335dcb=LIMIT_VALUE;}return _0x335dcb;};exports[_0x77da('0x15')]=function(_0x12d2b1){_0x12d2b1=parseInt(_0x12d2b1,0xa);if(!_0x12d2b1||_0x12d2b1<0x0){_0x12d2b1=0x0;}return _0x12d2b1;};exports[_0x77da('0x16')]=function(_0x3b6dde){var _0x544104,_0x492063=null;if(_0x3b6dde){_0x544104=_0x3b6dde[_0x77da('0x7')](',');_0x492063=_[_0x77da('0x17')](_0x544104,function(_0x507979){if(_0x507979[_0x77da('0x18')]('-')===0x0){return[_0x507979===_0x77da('0x19')?sequelize[_0x77da('0x1a')](sequelize['col']('priority'),_0x77da('0x1b')):_0x507979['substr'](0x1),_0x77da('0x1c')];}else{return[_0x507979===_0x77da('0x19')?sequelize[_0x77da('0x1a')](sequelize[_0x77da('0x1d')](_0x77da('0x19')),_0x77da('0x1b')):_0x507979,_0x77da('0x1e')];}});}return _0x492063;};exports['omit']=function(_0x4885ec,_0xfd160){if(_[_0x77da('0x1f')](_0x4885ec)){return _0x4885ec;}if(_[_0x77da('0x20')](_0x4885ec)){for(var _0xbd06b7=0x0;_0xbd06b7<_0x4885ec['length'];_0xbd06b7+=0x1){_0x4885ec[_0xbd06b7]=this[_0x77da('0x21')](_0x4885ec[_0xbd06b7],_0xfd160);}return _0x4885ec;}if(!_[_0x77da('0x22')](_0x4885ec)){return _0x4885ec;}if(_[_0x77da('0x23')](_0xfd160)){_0xfd160=[_0xfd160];}if(!_[_0x77da('0x20')](_0xfd160)){return _0x4885ec;}for(var _0x446ae7=0x0;_0x446ae7<_0xfd160['length'];_0x446ae7+=0x1){_[_0x77da('0x24')](_0x4885ec,_0xfd160[_0x446ae7]);}for(var _0x3e090d in _0x4885ec){if(_0x4885ec[_0x77da('0x25')](_0x3e090d)){_0x4885ec[_0x3e090d]=this[_0x77da('0x21')](_0x4885ec[_0x3e090d],_0xfd160);}}return _0x4885ec;};exports['isNumeric']=function(_0x5b4638){return _0x5b4638['match'](RegExp(_0x77da('0x26')))?!![]:![];};exports[_0x77da('0x27')]=function(_0x410d09){return _0x410d09[_0x77da('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x77da('0x29')]=function(_0x4eeb99){var _0x350b4e=[];_0x4eeb99[_0x77da('0x7')](/[ ,]+/)[_0x77da('0x2a')](function(_0x1d381b){_0x1d381b=_0x1d381b[_0x77da('0x2b')](/([^:]")"+/g,'$1');_0x1d381b='+'+_0x1d381b+'*';var _0x46e6b4=/[ `!@#$%^&*()_\-?~]/;if(_0x1d381b['match'](_0x46e6b4))_0x1d381b='\x22'+_0x1d381b+'\x22';_0x350b4e[_0x77da('0x2c')](_0x1d381b);});return _0x350b4e[_0x77da('0x2d')]('\x20');};exports[_0x77da('0x2e')]=function(_0x38643a,_0x3c3c64,_0x12ea16){var _0x3343b4={},_0x2c790d={};if(_0x3c3c64['query']['$id']){_0x3c3c64[_0x77da('0x2f')]['id']=_0x3c3c64[_0x77da('0x2f')]['$id'];delete _0x3c3c64[_0x77da('0x2f')][_0x77da('0x30')];}_0x3343b4[_0x77da('0x31')]=_[_0x77da('0x17')](_0x38643a,_0x77da('0x12'));_0x3343b4[_0x77da('0x2f')]=_[_0x77da('0x4')](_0x3c3c64['query']);_0x3343b4[_0x77da('0x32')]=_['intersection'](_0x3343b4['model'],_0x3343b4['query']);_0x2c790d[_0x77da('0x33')]=_['intersection'](_0x3343b4[_0x77da('0x31')],this[_0x77da('0x6')](_0x3c3c64[_0x77da('0x2f')][_0x77da('0x6')]));_0x2c790d[_0x77da('0x33')]=_0x2c790d[_0x77da('0x33')][_0x77da('0x34')]?_0x2c790d['attributes']:_0x3343b4[_0x77da('0x31')];if(!_0x3c3c64[_0x77da('0x2f')][_0x77da('0x25')](_0x77da('0x35'))){_0x2c790d[_0x77da('0x14')]=this[_0x77da('0x14')](_0x3c3c64['query'][_0x77da('0x14')]);_0x2c790d[_0x77da('0x15')]=this[_0x77da('0x15')](_0x3c3c64['query'][_0x77da('0x15')]);}_0x2c790d['order']=this['sort'](_0x3c3c64['query']['sort']);_0x2c790d[_0x77da('0x36')]=this[_0x77da('0x32')](_[_0x77da('0x37')](_0x3c3c64['query'],_0x3343b4[_0x77da('0x32')]),_0x38643a);if(_0x3c3c64['query'][_0x77da('0x38')]){var _0x517bd0=_0x38643a;var _0x3c216f=_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')];if(typeof _0x3c216f===_0x77da('0x39')){_0x517bd0=_[_0x77da('0x38')](_0x38643a,function(_0x5ecf12){return _[_0x77da('0x5')](_0x3c216f[_0x77da('0x3a')],_0x5ecf12[_0x77da('0x12')]);});_0x3c216f=_0x3c216f[_0x77da('0x3b')];}_0x2c790d[_0x77da('0x36')]=_[_0x77da('0x3c')](_0x2c790d['where'],{'$or':_[_0x77da('0x17')](_0x517bd0,function(_0x2f0495){if(_0x2f0495[_0x77da('0x9')]!==_0x77da('0x3d')){if(_0x12ea16){return sequelize[_0x77da('0x36')](sequelize['fn'](_0x77da('0x3e'),sequelize['col'](_0x2f0495[_0x77da('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')]+'%')});}else{var _0x40a492={};_0x40a492[_0x2f0495['name']]={'$like':'%'+_0x3c3c64[_0x77da('0x2f')][_0x77da('0x38')]+'%'};return _0x40a492;}}})});}_0x2c790d=_[_0x77da('0x3c')]({},_0x2c790d,_0x3c3c64[_0x77da('0x3f')]);return _0x2c790d;}; \ No newline at end of file +var _0xaa3f=['offset','where','pick','filter','object','includes','columns','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','fields','filters','isEmpty','forOwn','find','DATE','format','utc','$lte','YYYY-MM-DD','name','uniqueid','isArray','sort','split','map','indexOf','priority','col','unsigned','substr','cast','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','query','$id','model','intersection','attributes','nolimit','limit'];(function(_0x12c8f2,_0x10051d){var _0x1ec7d3=function(_0x1bcb34){while(--_0x1bcb34){_0x12c8f2['push'](_0x12c8f2['shift']());}};_0x1ec7d3(++_0x10051d);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4bf0d4,_0x594635){_0x4bf0d4=_0x4bf0d4-0x0;var _0x29f6ea=_0xaa3f[_0x4bf0d4];return _0x29f6ea;};'use strict';var _=require(_0xfaa3('0x0'));var sequelize=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x9c4aab){var _0x1ebbfb=['ne'];try{var _0x1da39b=JSON[_0xfaa3('0x3')](_0x9c4aab);var _0x2b1aaf=Object[_0xfaa3('0x4')](_0x1da39b)[0x0];return _0x1ebbfb['includes'](_0x2b1aaf);}catch(_0x513eea){return![];}}function getOperatorValue(_0x2ac57f){var _0x4bac92=JSON[_0xfaa3('0x3')](_0x2ac57f);var _0xeecce5=Object[_0xfaa3('0x4')](_0x4bac92)[0x0];var _0xbf270c=_0x4bac92[_0xeecce5];return{['$'+_0xeecce5]:_0xbf270c};}exports[_0xfaa3('0x5')]=function(_0x2e422d){var _0xf420ec=null;if(_0x2e422d){_0xf420ec=_0x2e422d['split'](',');}return _0xf420ec;};exports[_0xfaa3('0x6')]=function(_0x28de66,_0x49380c){var _0x5ca0da={};if(!_[_0xfaa3('0x7')](_0x28de66)){_[_0xfaa3('0x8')](_0x28de66,function(_0x34d3dc,_0x278e6c){try{if(_0x49380c){var _0x23e4b6=_[_0xfaa3('0x9')](_0x49380c,{'name':_0x278e6c})||{};if(hasSequelizeOperator(_0x34d3dc)){_0x5ca0da[_0x278e6c]=getOperatorValue(_0x34d3dc);}else if(_0x23e4b6['type']===_0xfaa3('0xa')&&_['isPlainObject'](_0x34d3dc)){var _0x1aa8e8=JSON[_0xfaa3('0x3')](_0x34d3dc);var _0x44540f={'$gte':moment(moment(_0x1aa8e8['$gte'])[_0xfaa3('0xb')]('YYYY-MM-DD'))[_0xfaa3('0xc')]()[_0xfaa3('0xb')](),'$lte':moment(moment(_0x1aa8e8[_0xfaa3('0xd')])[_0xfaa3('0xb')](_0xfaa3('0xe')))[_0xfaa3('0xc')]()['subtract'](0x1,'s')['format']()};_0x5ca0da[_0x278e6c]=_0x44540f;}else if(_0x23e4b6[_0xfaa3('0xf')]===_0xfaa3('0x10')){_0x5ca0da[_0x278e6c]=_0x34d3dc;}else{_0x5ca0da[_0x278e6c]=_[_0xfaa3('0x11')](_0x34d3dc)?_0x34d3dc:JSON[_0xfaa3('0x3')](_0x34d3dc);}}else{_0x5ca0da[_0x278e6c]=_['isArray'](_0x34d3dc)?_0x34d3dc:JSON['parse'](_0x34d3dc);}}catch(_0x50f121){_0x5ca0da[_0x278e6c]=_0x34d3dc['split'](',');}});}return _0x5ca0da;};exports['limit']=function(_0x275a07){_0x275a07=parseInt(_0x275a07,0xa);if(!_0x275a07||_0x275a07<0x0){_0x275a07=LIMIT_VALUE;}return _0x275a07;};exports['offset']=function(_0x2a037c){_0x2a037c=parseInt(_0x2a037c,0xa);if(!_0x2a037c||_0x2a037c<0x0){_0x2a037c=0x0;}return _0x2a037c;};exports[_0xfaa3('0x12')]=function(_0x38b978){var _0x34b276,_0x1c32dd=null;if(_0x38b978){_0x34b276=_0x38b978[_0xfaa3('0x13')](',');_0x1c32dd=_[_0xfaa3('0x14')](_0x34b276,function(_0x1ab9cc){if(_0x1ab9cc[_0xfaa3('0x15')]('-')===0x0){return[_0x1ab9cc===_0xfaa3('0x16')?sequelize['cast'](sequelize[_0xfaa3('0x17')](_0xfaa3('0x16')),_0xfaa3('0x18')):_0x1ab9cc[_0xfaa3('0x19')](0x1),'DESC'];}else{return[_0x1ab9cc===_0xfaa3('0x16')?sequelize[_0xfaa3('0x1a')](sequelize[_0xfaa3('0x17')](_0xfaa3('0x16')),_0xfaa3('0x18')):_0x1ab9cc,_0xfaa3('0x1b')];}});}return _0x1c32dd;};exports[_0xfaa3('0x1c')]=function(_0x11841c,_0x5d6cdd){if(_[_0xfaa3('0x7')](_0x11841c)){return _0x11841c;}if(_[_0xfaa3('0x11')](_0x11841c)){for(var _0x699e72=0x0;_0x699e72<_0x11841c[_0xfaa3('0x1d')];_0x699e72+=0x1){_0x11841c[_0x699e72]=this[_0xfaa3('0x1c')](_0x11841c[_0x699e72],_0x5d6cdd);}return _0x11841c;}if(!_[_0xfaa3('0x1e')](_0x11841c)){return _0x11841c;}if(_[_0xfaa3('0x1f')](_0x5d6cdd)){_0x5d6cdd=[_0x5d6cdd];}if(!_[_0xfaa3('0x11')](_0x5d6cdd)){return _0x11841c;}for(var _0xd67c17=0x0;_0xd67c17<_0x5d6cdd[_0xfaa3('0x1d')];_0xd67c17+=0x1){_[_0xfaa3('0x20')](_0x11841c,_0x5d6cdd[_0xd67c17]);}for(var _0x7df1f3 in _0x11841c){if(_0x11841c[_0xfaa3('0x21')](_0x7df1f3)){_0x11841c[_0x7df1f3]=this[_0xfaa3('0x1c')](_0x11841c[_0x7df1f3],_0x5d6cdd);}}return _0x11841c;};exports[_0xfaa3('0x22')]=function(_0x5b84cd){return _0x5b84cd[_0xfaa3('0x23')](RegExp(_0xfaa3('0x24')))?!![]:![];};exports[_0xfaa3('0x25')]=function(_0x54bc09){return _0x54bc09[_0xfaa3('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2a54a3){var _0x5d37bb=[];_0x2a54a3[_0xfaa3('0x13')](/[ ,]+/)[_0xfaa3('0x26')](function(_0x3a39c3){_0x3a39c3=_0x3a39c3[_0xfaa3('0x27')](/([^:]")"+/g,'$1');_0x3a39c3='+'+_0x3a39c3+'*';var _0x209072=/[ `!@#$%^&*()_\-?~]/;if(_0x3a39c3[_0xfaa3('0x23')](_0x209072))_0x3a39c3='\x22'+_0x3a39c3+'\x22';_0x5d37bb[_0xfaa3('0x28')](_0x3a39c3);});return _0x5d37bb[_0xfaa3('0x29')]('\x20');};exports['getOptions']=function(_0x3992c5,_0xf0001b,_0x34f106){var _0x174f78={},_0x1f1656={};if(_0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x2b')]){_0xf0001b[_0xfaa3('0x2a')]['id']=_0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x2b')];delete _0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x2b')];}_0x174f78[_0xfaa3('0x2c')]=_[_0xfaa3('0x14')](_0x3992c5,_0xfaa3('0xf'));_0x174f78[_0xfaa3('0x2a')]=_['keys'](_0xf0001b[_0xfaa3('0x2a')]);_0x174f78[_0xfaa3('0x6')]=_[_0xfaa3('0x2d')](_0x174f78[_0xfaa3('0x2c')],_0x174f78[_0xfaa3('0x2a')]);_0x1f1656[_0xfaa3('0x2e')]=_[_0xfaa3('0x2d')](_0x174f78[_0xfaa3('0x2c')],this['fields'](_0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x5')]));_0x1f1656[_0xfaa3('0x2e')]=_0x1f1656['attributes'][_0xfaa3('0x1d')]?_0x1f1656[_0xfaa3('0x2e')]:_0x174f78['model'];if(!_0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x21')](_0xfaa3('0x2f'))){_0x1f1656[_0xfaa3('0x30')]=this[_0xfaa3('0x30')](_0xf0001b[_0xfaa3('0x2a')]['limit']);_0x1f1656['offset']=this[_0xfaa3('0x31')](_0xf0001b[_0xfaa3('0x2a')]['offset']);}_0x1f1656['order']=this[_0xfaa3('0x12')](_0xf0001b['query'][_0xfaa3('0x12')]);_0x1f1656[_0xfaa3('0x32')]=this[_0xfaa3('0x6')](_[_0xfaa3('0x33')](_0xf0001b[_0xfaa3('0x2a')],_0x174f78[_0xfaa3('0x6')]),_0x3992c5);if(_0xf0001b[_0xfaa3('0x2a')][_0xfaa3('0x34')]){var _0x551cd5=_0x3992c5;var _0x507cca=_0xf0001b['query']['filter'];if(typeof _0x507cca===_0xfaa3('0x35')){_0x551cd5=_[_0xfaa3('0x34')](_0x3992c5,function(_0x55c079){return _[_0xfaa3('0x36')](_0x507cca[_0xfaa3('0x37')],_0x55c079[_0xfaa3('0xf')]);});_0x507cca=_0x507cca['value'];}_0x1f1656['where']=_[_0xfaa3('0x38')](_0x1f1656['where'],{'$or':_[_0xfaa3('0x14')](_0x551cd5,function(_0x57b77c){if(_0x57b77c['type']!==_0xfaa3('0x39')){if(_0x34f106){return sequelize[_0xfaa3('0x32')](sequelize['fn']('lower',sequelize[_0xfaa3('0x17')](_0x57b77c['name'])),{'$like':sequelize['fn'](_0xfaa3('0x3a'),'%'+_0xf0001b['query'][_0xfaa3('0x34')]+'%')});}else{var _0x74d3fe={};_0x74d3fe[_0x57b77c[_0xfaa3('0xf')]]={'$like':'%'+_0xf0001b['query'][_0xfaa3('0x34')]+'%'};return _0x74d3fe;}}})});}_0x1f1656=_[_0xfaa3('0x38')]({},_0x1f1656,_0xf0001b['options']);return _0x1f1656;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index f34e9d2..0776ca8 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47f1=['filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','resolve','User','findAll','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','openchannelPause','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','whatsappStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47f1,0x1b8));var _0x147f=function(_0x2a48ea,_0x325995){_0x2a48ea=_0x2a48ea-0x0;var _0x140cbd=_0x47f1[_0x2a48ea];return _0x140cbd;};'use strict';var _=require(_0x147f('0x0'));var jayson=require('jayson/promise');var db=require(_0x147f('0x1'))['db'];var amiClient=jayson[_0x147f('0x2')][_0x147f('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x147f('0x3')]({'port':0x232c});function isAgentPaused(_0x22ba58,_0xdb5f0f){var _0x5f4104=[_0x22ba58[_0x147f('0x4')],_0x22ba58[_0x147f('0x5')],_0x22ba58[_0x147f('0x6')],_0x22ba58['openchannelPause'],_0x22ba58[_0x147f('0x7')],_0x22ba58[_0x147f('0x8')],_0x22ba58[_0x147f('0x9')]];if(!_0xdb5f0f)return _['every'](_0x5f4104);var _0x12f9cf=_[_0x147f('0xa')](_0x5f4104);return _0x12f9cf[_0x147f('0xb')]>0x0&&_0x12f9cf[_0x147f('0xb')]<_0x5f4104[_0x147f('0xb')]?!![]:![];}function isIdle(_0x59a8c9){return _0x59a8c9===_0x147f('0xc')||_0x59a8c9===_0x147f('0xd')||_0x59a8c9===_0x147f('0xe')||_0x59a8c9===_0x147f('0xf')||_[_0x147f('0x10')](_0x59a8c9);}function isAgentIdle(_0xf5cc9f){if(_0xf5cc9f[_0x147f('0x11')]!=='idle'&&_0xf5cc9f[_0x147f('0x8')]){_0xf5cc9f['voiceStatus']='pause';return![];}return _['every']([_0xf5cc9f[_0x147f('0x12')],_0xf5cc9f[_0x147f('0x13')],_0xf5cc9f[_0x147f('0x14')],_0xf5cc9f[_0x147f('0x15')],_0xf5cc9f[_0x147f('0x16')],_0xf5cc9f[_0x147f('0x11')],_0xf5cc9f['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x147f('0x17')](function(_0x308e42){if(_0x308e42['error']){throw new Error(_0x147f('0x18'));}var _0x409073=_0x308e42['result'];return routingClient['request'](_0x147f('0x19'),{})[_0x147f('0x17')](function(_0x4dddaf){if(_0x4dddaf[_0x147f('0x1a')]){throw new Error(_0x147f('0x1b'));}var _0x5a6e98=_0x4dddaf[_0x147f('0x1c')];return _[_0x147f('0x1d')]({},_0x409073,_0x5a6e98);});})[_0x147f('0x1e')](function(_0x3289cf){throw _0x3289cf;});}exports[_0x147f('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x560875){var _0x1e432e=_0x147f('0xd');if(isAgentPaused(_0x560875))_0x1e432e=_0x147f('0x20');else if(isAgentPaused(_0x560875,!![]))_0x1e432e=_0x147f('0x21');else if(isAgentIdle(_0x560875))_0x1e432e='idle';else _0x1e432e=_0x147f('0x22');return _0x1e432e;}exports[_0x147f('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x555078,_0x10a928){var _0x4f72e9=_[_0x147f('0x24')](_0x555078)?_0x555078:[_0x555078];var _0x53cf0d=_[_0x147f('0x25')](_0x10a928)+_0x147f('0x26');var _0x29afd8=_[_0x147f('0x27')](_0x4f72e9,function(_0x357d1a){return db[_0x53cf0d][_0x147f('0x28')]({'where':{'id':_0x357d1a}})[_0x147f('0x17')](function(_0x47de2d){if(!_0x47de2d)return[];return _0x47de2d['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x147f('0x29')](_0x29afd8)[_0x147f('0x17')](function(_0x5717e7){var _0x5d5eef=_(_0x5717e7)[_0x147f('0x2a')]()['map']('id')['uniq']()[_0x147f('0x2b')]();return _0x5d5eef;});}exports[_0x147f('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5d9a1a,_0x395a38,_0x5ac5ee){try{if(_0x395a38[_0x147f('0xb')]>0x0){_0x5d9a1a=_0x5d9a1a[_0x147f('0xa')](function(_0x134e18){return _0x395a38[_0x147f('0x2d')](_0x134e18['id']);});}var _0x58e38e=_0x5d9a1a[_0x147f('0xa')](function(_0x335c62){var _0x3d52f3=_0x147f('0x22');if(isAgentIdle(_0x335c62)){_0x3d52f3=_0x147f('0xc');}return _0x3d52f3===_0x5ac5ee;});return _[_0x147f('0x27')](_0x58e38e,'id');}catch(_0x2a1ba0){throw _0x2a1ba0;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5d22b8,_0x276a0d,_0x46f585){return Promise[_0x147f('0x2e')]()[_0x147f('0x17')](function(){if(_0x276a0d['length']>0x0){_0x5d22b8=_0x5d22b8[_0x147f('0xa')](function(_0x523d11){return _0x276a0d[_0x147f('0x2d')](_0x523d11['id']);});}return _0x5d22b8;})['then'](function(){return db[_0x147f('0x2f')][_0x147f('0x30')]({'attributes':['id',_0x147f('0x31'),_0x147f('0x32'),_0x147f('0x4'),_0x147f('0x5'),'mailPause','openchannelPause','smsPause','voicePause',_0x147f('0x9'),_0x147f('0x33')],'where':{'id':{'$in':_[_0x147f('0x27')](_0x5d22b8,'id')}},'raw':!![]});})['then'](function(_0x5b0104){return _0x5b0104[_0x147f('0x27')](function(_0x4a6972){var _0x2b4422=_[_0x147f('0x34')](_0x5d22b8,['id',_0x4a6972['id']]);var _0x529fff=filterAgentAttributes(_0x2b4422);_['merge'](_0x4a6972,_0x529fff);_0x4a6972['globalStatus']=getAgentStatus(_0x4a6972);return _0x4a6972;});})['then'](function(_0x747e37){var _0x1b788d=sortAgentsByStatus(_0x747e37,_0x46f585);return _['map'](_0x1b788d,'id');})[_0x147f('0x1e')](function(_0x18ff11){throw _0x18ff11;});}exports[_0x147f('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x22bc76){var _0x51e92f={'fields':[],'order':null};var _0x4f65e2=_0x22bc76[_0x147f('0x36')](',');_0x51e92f['fields']=_[_0x147f('0xa')](_0x4f65e2,function(_0x411734){if(!_0x411734[_0x147f('0x2d')](_0x147f('0x37'))){return!![];}_0x51e92f['order']=_[_0x147f('0x38')](_0x411734,'-')?_0x147f('0x39'):_0x147f('0x3a');return![];});return _0x51e92f;}exports[_0x147f('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x1d3a78){if(_0x1d3a78['includes']('fullname')&&!_0x1d3a78[_0x147f('0x2d')](_0x147f('0x3c'))){var _0x1a7a38=_0x1d3a78[_0x147f('0x3d')](0x0,_0x1d3a78[_0x147f('0x3e')]('fullname'));_0x1d3a78+=','+_0x1a7a38+'internal';}return _0x1d3a78;}exports[_0x147f('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x14e549,_0x4687c4){var _0x4b74d6=_0x14e549[_0x147f('0x40')](function(_0x4d0f03,_0x4f8cc2){if(_0x4d0f03[_0x147f('0x37')]===_0x4f8cc2['globalStatus']){if(_0x4d0f03[_0x147f('0x37')]===_0x147f('0x20')){if(_0x4687c4===_0x147f('0x39')){return(_0x4d0f03['pauseType']||'')<(_0x4f8cc2[_0x147f('0x33')]||'')||_0x4d0f03[_0x147f('0x32')][_0x147f('0x41')]()>_0x4f8cc2[_0x147f('0x32')][_0x147f('0x41')]()?0x1:-0x1;}else{return(_0x4d0f03['pauseType']||'')<(_0x4f8cc2[_0x147f('0x33')]||'')||_0x4d0f03['fullname']['toLowerCase']()>_0x4f8cc2['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x4687c4===_0x147f('0x39')){return _0x4d0f03['fullname'][_0x147f('0x41')]()<_0x4f8cc2[_0x147f('0x32')][_0x147f('0x41')]()?0x1:-0x1;}else{return _0x4d0f03[_0x147f('0x32')][_0x147f('0x41')]()<_0x4f8cc2[_0x147f('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x4687c4===_0x147f('0x39')){return _0x4d0f03['globalStatus']<_0x4f8cc2[_0x147f('0x37')]?0x1:-0x1;}else{return _0x4d0f03[_0x147f('0x37')]<_0x4f8cc2[_0x147f('0x37')]?-0x1:0x1;}}});return _0x4b74d6;}exports[_0x147f('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x5a4873){var _0x104371=[_0x147f('0x43'),'online',_0x147f('0x44'),_0x147f('0x45'),_0x147f('0x33'),_0x147f('0x45'),_0x147f('0x3c'),_0x147f('0x46'),_0x147f('0x4'),_0x147f('0x47'),_0x147f('0x6'),_0x147f('0x7'),_0x147f('0x9'),_0x147f('0x5'),_0x147f('0x8'),'chatCapacity',_0x147f('0x48'),'mailCapacity',_0x147f('0x49'),'whatsappCapacity',_0x147f('0x4a'),_0x147f('0x4b'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x147f('0x4c'),_0x147f('0x4d'),'faxCurrentCapacity','chatStatus',_0x147f('0x15'),_0x147f('0x14'),_0x147f('0x16'),_0x147f('0x4e'),_0x147f('0x13'),_0x147f('0x11'),'chatStatusTime',_0x147f('0x4f'),'mailStatusTime',_0x147f('0x50'),_0x147f('0x51'),'faxStatusTime','voiceStatusTime',_0x147f('0x52'),_0x147f('0x53'),'screenrecording',_0x147f('0x54'),_0x147f('0x55'),_0x147f('0x56')];var _0x46901e=['chatPause','openchannelPause',_0x147f('0x6'),_0x147f('0x7'),_0x147f('0x9'),'faxPause',_0x147f('0x8'),_0x147f('0x57')];var _0x34f5ca=_(_0x5a4873)[_0x147f('0x58')](_0x46901e)['pick'](_0x104371)[_0x147f('0x2b')]();return _0x34f5ca;}exports[_0x147f('0x59')]=filterAgentAttributes; \ No newline at end of file +var _0x94a9=['idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','isArray','startCase','map','findOne','getAgents','all','uniq','value','getAgentIdsByQueues','filter','busy','getAgentIdsByStatus','includes','User','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','catch','split','fields','globalStatus','order','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','toLowerCase','userpic','lastPauseAt','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','mailPause','smsPause','voicePause','every','length'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x94a9,0x172));var _0x994a=function(_0x25f641,_0x4b172b){_0x25f641=_0x25f641-0x0;var _0x21fb55=_0x94a9[_0x25f641];return _0x21fb55;};'use strict';var _=require(_0x994a('0x0'));var jayson=require(_0x994a('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x994a('0x2')][_0x994a('0x3')]({'port':0x232a});var routingClient=jayson[_0x994a('0x2')][_0x994a('0x3')]({'port':0x232c});function isAgentPaused(_0x597921,_0xfd646a){var _0xcebdfc=[_0x597921[_0x994a('0x4')],_0x597921['faxPause'],_0x597921[_0x994a('0x5')],_0x597921['openchannelPause'],_0x597921[_0x994a('0x6')],_0x597921[_0x994a('0x7')],_0x597921['whatsappPause']];if(!_0xfd646a)return _[_0x994a('0x8')](_0xcebdfc);var _0x36eca4=_['filter'](_0xcebdfc);return _0x36eca4['length']>0x0&&_0x36eca4[_0x994a('0x9')]<_0xcebdfc[_0x994a('0x9')]?!![]:![];}function isIdle(_0x33f86f){return _0x33f86f===_0x994a('0xa')||_0x33f86f===_0x994a('0xb')||_0x33f86f===_0x994a('0xc')||_0x33f86f===_0x994a('0xd')||_[_0x994a('0xe')](_0x33f86f);}function isAgentIdle(_0x124ed8){if(_0x124ed8[_0x994a('0xf')]!=='idle'&&_0x124ed8['voicePause']){_0x124ed8[_0x994a('0xf')]=_0x994a('0x10');return![];}return _[_0x994a('0x8')]([_0x124ed8[_0x994a('0x11')],_0x124ed8[_0x994a('0x12')],_0x124ed8[_0x994a('0x13')],_0x124ed8[_0x994a('0x14')],_0x124ed8[_0x994a('0x15')],_0x124ed8[_0x994a('0xf')],_0x124ed8[_0x994a('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x994a('0x17')](_0x994a('0x18'),{})[_0x994a('0x19')](function(_0x29243b){if(_0x29243b[_0x994a('0x1a')]){throw new Error(_0x994a('0x1b'));}var _0x46036c=_0x29243b[_0x994a('0x1c')];return routingClient['request']('Agents',{})['then'](function(_0x5e36de){if(_0x5e36de[_0x994a('0x1a')]){throw new Error(_0x994a('0x1d'));}var _0x1e2119=_0x5e36de[_0x994a('0x1c')];return _[_0x994a('0x1e')]({},_0x46036c,_0x1e2119);});})['catch'](function(_0x24c583){throw _0x24c583;});}exports[_0x994a('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x133a9c){var _0x206186=_0x994a('0xb');if(isAgentPaused(_0x133a9c))_0x206186='pause';else if(isAgentPaused(_0x133a9c,!![]))_0x206186=_0x994a('0x20');else if(isAgentIdle(_0x133a9c))_0x206186=_0x994a('0xa');else _0x206186='busy';return _0x206186;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x379ab2,_0xe3b7a4){var _0x500b27=_[_0x994a('0x21')](_0x379ab2)?_0x379ab2:[_0x379ab2];var _0x168626=_[_0x994a('0x22')](_0xe3b7a4)+'Queue';var _0x472123=_[_0x994a('0x23')](_0x500b27,function(_0x22d3c0){return db[_0x168626][_0x994a('0x24')]({'where':{'id':_0x22d3c0}})[_0x994a('0x19')](function(_0x517b63){if(!_0x517b63)return[];return _0x517b63[_0x994a('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x994a('0x26')](_0x472123)[_0x994a('0x19')](function(_0x5f3145){var _0x53b1ea=_(_0x5f3145)['flatten']()[_0x994a('0x23')]('id')[_0x994a('0x27')]()[_0x994a('0x28')]();return _0x53b1ea;});}exports[_0x994a('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x22c89,_0x4127cb,_0x51d634){try{if(_0x4127cb[_0x994a('0x9')]>0x0){_0x22c89=_0x22c89['filter'](function(_0x264698){return _0x4127cb['includes'](_0x264698['id']);});}var _0x3b67fa=_0x22c89[_0x994a('0x2a')](function(_0x3eaae0){var _0x132811=_0x994a('0x2b');if(isAgentIdle(_0x3eaae0)){_0x132811=_0x994a('0xa');}return _0x132811===_0x51d634;});return _[_0x994a('0x23')](_0x3b67fa,'id');}catch(_0x54e5c1){throw _0x54e5c1;}}exports[_0x994a('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x44d0f4,_0x1eab53,_0x12b93d){return Promise['resolve']()[_0x994a('0x19')](function(){if(_0x1eab53[_0x994a('0x9')]>0x0){_0x44d0f4=_0x44d0f4[_0x994a('0x2a')](function(_0x32cf7b){return _0x1eab53[_0x994a('0x2d')](_0x32cf7b['id']);});}return _0x44d0f4;})[_0x994a('0x19')](function(){return db[_0x994a('0x2e')][_0x994a('0x2f')]({'attributes':['id',_0x994a('0x30'),_0x994a('0x31'),_0x994a('0x4'),'faxPause',_0x994a('0x5'),_0x994a('0x32'),'smsPause',_0x994a('0x7'),_0x994a('0x33'),_0x994a('0x34')],'where':{'id':{'$in':_[_0x994a('0x23')](_0x44d0f4,'id')}},'raw':!![]});})[_0x994a('0x19')](function(_0x1a694f){return _0x1a694f['map'](function(_0x4b5bf7){var _0x21d537=_[_0x994a('0x35')](_0x44d0f4,['id',_0x4b5bf7['id']]);var _0x523271=filterAgentAttributes(_0x21d537);_[_0x994a('0x1e')](_0x4b5bf7,_0x523271);_0x4b5bf7['globalStatus']=getAgentStatus(_0x4b5bf7);return _0x4b5bf7;});})[_0x994a('0x19')](function(_0x52247a){var _0x3942d9=sortAgentsByStatus(_0x52247a,_0x12b93d);return _[_0x994a('0x23')](_0x3942d9,'id');})[_0x994a('0x36')](function(_0x2f013b){throw _0x2f013b;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3f5b21){var _0x22db87={'fields':[],'order':null};var _0x308839=_0x3f5b21[_0x994a('0x37')](',');_0x22db87[_0x994a('0x38')]=_[_0x994a('0x2a')](_0x308839,function(_0x4da1f0){if(!_0x4da1f0['includes'](_0x994a('0x39'))){return!![];}_0x22db87[_0x994a('0x3a')]=_[_0x994a('0x3b')](_0x4da1f0,'-')?_0x994a('0x3c'):'ASC';return![];});return _0x22db87;}exports[_0x994a('0x3d')]=getUpdatedSortOptions;function validateSortParameter(_0x5f4322){if(_0x5f4322[_0x994a('0x2d')](_0x994a('0x31'))&&!_0x5f4322[_0x994a('0x2d')](_0x994a('0x3e'))){var _0x54d499=_0x5f4322[_0x994a('0x3f')](0x0,_0x5f4322[_0x994a('0x40')](_0x994a('0x31')));_0x5f4322+=','+_0x54d499+_0x994a('0x3e');}return _0x5f4322;}exports[_0x994a('0x41')]=validateSortParameter;function sortAgentsByStatus(_0x10d902,_0x27804d){var _0x5e7fe5=_0x10d902['sort'](function(_0x2d9b8,_0x269fda){if(_0x2d9b8[_0x994a('0x39')]===_0x269fda['globalStatus']){if(_0x2d9b8['globalStatus']===_0x994a('0x10')){if(_0x27804d==='DESC'){return(_0x2d9b8[_0x994a('0x34')]||'')<(_0x269fda['pauseType']||'')||_0x2d9b8[_0x994a('0x31')][_0x994a('0x42')]()>_0x269fda[_0x994a('0x31')][_0x994a('0x42')]()?0x1:-0x1;}else{return(_0x2d9b8[_0x994a('0x34')]||'')<(_0x269fda[_0x994a('0x34')]||'')||_0x2d9b8[_0x994a('0x31')][_0x994a('0x42')]()>_0x269fda[_0x994a('0x31')][_0x994a('0x42')]()?-0x1:0x1;}}else{if(_0x27804d===_0x994a('0x3c')){return _0x2d9b8[_0x994a('0x31')]['toLowerCase']()<_0x269fda[_0x994a('0x31')][_0x994a('0x42')]()?0x1:-0x1;}else{return _0x2d9b8[_0x994a('0x31')][_0x994a('0x42')]()<_0x269fda[_0x994a('0x31')][_0x994a('0x42')]()?-0x1:0x1;}}}else{if(_0x27804d===_0x994a('0x3c')){return _0x2d9b8[_0x994a('0x39')]<_0x269fda[_0x994a('0x39')]?0x1:-0x1;}else{return _0x2d9b8[_0x994a('0x39')]<_0x269fda[_0x994a('0x39')]?-0x1:0x1;}}});return _0x5e7fe5;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x11cfa8){var _0x250293=[_0x994a('0x43'),'online','lastLoginAt',_0x994a('0x44'),'pauseType','lastPauseAt',_0x994a('0x3e'),_0x994a('0x45'),'chatPause',_0x994a('0x32'),_0x994a('0x5'),_0x994a('0x6'),_0x994a('0x33'),_0x994a('0x46'),_0x994a('0x7'),_0x994a('0x47'),_0x994a('0x48'),_0x994a('0x49'),_0x994a('0x4a'),_0x994a('0x4b'),_0x994a('0x4c'),'chatCurrentCapacity',_0x994a('0x4d'),_0x994a('0x4e'),_0x994a('0x4f'),_0x994a('0x50'),'faxCurrentCapacity',_0x994a('0x11'),'openchannelStatus','mailStatus',_0x994a('0x15'),_0x994a('0x16'),'faxStatus',_0x994a('0xf'),_0x994a('0x51'),_0x994a('0x52'),_0x994a('0x53'),'smsStatusTime','whatsappStatusTime',_0x994a('0x54'),_0x994a('0x55'),_0x994a('0x56'),_0x994a('0x57'),'screenrecording',_0x994a('0x58'),_0x994a('0x59'),_0x994a('0x5a')];var _0x305fd1=['chatPause','openchannelPause','mailPause',_0x994a('0x6'),_0x994a('0x33'),_0x994a('0x46'),_0x994a('0x7'),_0x994a('0x5b')];var _0x502dbe=_(_0x11cfa8)[_0x994a('0x5c')](_0x305fd1)[_0x994a('0x5d')](_0x250293)[_0x994a('0x28')]();return _0x502dbe;}exports[_0x994a('0x5e')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 28954a8..858075d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0xd746ed,_0x81920c){var _0x5ef2a6=function(_0x3ec97a){while(--_0x3ec97a){_0xd746ed['push'](_0xd746ed['shift']());}};_0x5ef2a6(++_0x81920c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4b6643,_0x9e4308){var _0x3dc376=function(_0x39aab1){while(--_0x39aab1){_0x4b6643['push'](_0x4b6643['shift']());}};_0x3dc376(++_0x9e4308);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a4b3693..f9847e2 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 _0x6d7f=['replace','hostname','macAddress','ipAddress','md5','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','createHash','update','digest','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x6d7f,0x14a));var _0xf6d7=function(_0x444760,_0x3539f4){_0x444760=_0x444760-0x0;var _0x4f12bf=_0x6d7f[_0x444760];return _0x4f12bf;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf6d7('0x0'));var machine=require(_0xf6d7('0x1'));var exec=require(_0xf6d7('0x2'))[_0xf6d7('0x3')];var config=require(_0xf6d7('0x4'));function getInterfaces(){var _0x29fd52=[];var _0x5e2e82=os[_0xf6d7('0x5')]();var _0x42a7fe=_[_0xf6d7('0x6')](_[_0xf6d7('0x7')](_0x5e2e82));for(var _0x1901ee=0x0;_0x1901ee<_0x42a7fe[_0xf6d7('0x8')];_0x1901ee++){var _0x3aa5db=_0x5e2e82[_0x42a7fe[_0x1901ee]]['filter'](function(_0x4355d7){return _0x4355d7[_0xf6d7('0x9')]===_0xf6d7('0xa')&&_0x4355d7[_0xf6d7('0xb')]===![];});_0x29fd52=_0x29fd52[_0xf6d7('0xc')](_0x3aa5db);}return _0x29fd52;}function getFirstInterface(){var _0x1660c1=_['head'](getInterfaces());return{'macAddress':_0x1660c1&&_0x1660c1[_0xf6d7('0xd')]?_0x1660c1[_0xf6d7('0xd')]:_0xf6d7('0xe'),'ipAddress':_0x1660c1&&_0x1660c1[_0xf6d7('0xf')]?_0x1660c1[_0xf6d7('0xf')]:_0xf6d7('0x10')};}exports[_0xf6d7('0x11')]=getFirstInterface;function getCPUhash(){var _0x19fcc6=_[_0xf6d7('0x6')](os[_0xf6d7('0x12')]()['map'](function(_0x5fd006){return _0x5fd006[_0xf6d7('0x13')];}))['join'](':');return crypto[_0xf6d7('0x14')]('md5')[_0xf6d7('0x15')](_0x19fcc6)[_0xf6d7('0x16')](_0xf6d7('0x17'));}exports[_0xf6d7('0x18')]=function(){var _0x4e039c=os[_0xf6d7('0x19')]();var _0x2f4b14=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2f4b14[_0xf6d7('0x1a')](config[_0xf6d7('0x1b')])){return config[_0xf6d7('0x1b')];}else if(_0x4e039c==='win32'){return exec(_0xf6d7('0x1c'),{'encoding':_0xf6d7('0x1d')})[_0xf6d7('0x1e')]('\x0d\x0a','');}else{var _0x29b4bf=getFirstInterface();var _0x3463a2=getCPUhash();var _0x4939e9=_0x3463a2+'|'+os[_0xf6d7('0x1f')]()+'|'+_0x29b4bf[_0xf6d7('0x20')]+'|'+_0x29b4bf[_0xf6d7('0x21')];var _0x17fa63=crypto[_0xf6d7('0x14')](_0xf6d7('0x22'))['update'](_0x4939e9)[_0xf6d7('0x16')](_0xf6d7('0x17'));return _0x17fa63[_0xf6d7('0x23')](0x0,0x8)+'-'+_0x17fa63[_0xf6d7('0x23')](0x8,0xc)+'-'+_0x17fa63['substring'](0xc,0x10)+'-'+_0x17fa63[_0xf6d7('0x23')](0x10,0x14)+'-'+_0x17fa63[_0xf6d7('0x23')](0x14);}}; \ No newline at end of file +var _0xefd7=['length','filter','IPv4','internal','concat','head','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','join','md5','digest','hex','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','keys'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xefd7,0x76));var _0x7efd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xefd7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x7efd('0x0'));var machine=require(_0x7efd('0x1'));var exec=require(_0x7efd('0x2'))['execSync'];var config=require(_0x7efd('0x3'));function getInterfaces(){var _0x132530=[];var _0x34d610=os[_0x7efd('0x4')]();var _0x11cebe=_['orderBy'](_[_0x7efd('0x5')](_0x34d610));for(var _0x2437fa=0x0;_0x2437fa<_0x11cebe[_0x7efd('0x6')];_0x2437fa++){var _0x3a9bb2=_0x34d610[_0x11cebe[_0x2437fa]][_0x7efd('0x7')](function(_0x1b2368){return _0x1b2368['family']===_0x7efd('0x8')&&_0x1b2368[_0x7efd('0x9')]===![];});_0x132530=_0x132530[_0x7efd('0xa')](_0x3a9bb2);}return _0x132530;}function getFirstInterface(){var _0x44e095=_[_0x7efd('0xb')](getInterfaces());return{'macAddress':_0x44e095&&_0x44e095['mac']?_0x44e095['mac']:'00:00:00:00:00:00','ipAddress':_0x44e095&&_0x44e095[_0x7efd('0xc')]?_0x44e095['address']:_0x7efd('0xd')};}exports[_0x7efd('0xe')]=getFirstInterface;function getCPUhash(){var _0x1f7022=_[_0x7efd('0xf')](os[_0x7efd('0x10')]()[_0x7efd('0x11')](function(_0x5619cc){return _0x5619cc['model'];}))[_0x7efd('0x12')](':');return crypto['createHash'](_0x7efd('0x13'))['update'](_0x1f7022)[_0x7efd('0x14')](_0x7efd('0x15'));}exports['getUuid']=function(){var _0x18e233=os[_0x7efd('0x16')]();var _0x294c99=/[0-9a-f-]{36}/;if(config[_0x7efd('0x17')]&&_0x294c99['test'](config['licenseToken'])){return config[_0x7efd('0x17')];}else if(_0x18e233===_0x7efd('0x18')){return exec(_0x7efd('0x19'),{'encoding':_0x7efd('0x1a')})['replace']('\x0d\x0a','');}else{var _0x43a335=getFirstInterface();var _0x48228e=getCPUhash();var _0x467dca=_0x48228e+'|'+os[_0x7efd('0x1b')]()+'|'+_0x43a335[_0x7efd('0x1c')]+'|'+_0x43a335[_0x7efd('0x1d')];var _0x3880cc=crypto['createHash'](_0x7efd('0x13'))['update'](_0x467dca)[_0x7efd('0x14')](_0x7efd('0x15'));return _0x3880cc[_0x7efd('0x1e')](0x0,0x8)+'-'+_0x3880cc[_0x7efd('0x1e')](0x8,0xc)+'-'+_0x3880cc[_0x7efd('0x1e')](0xc,0x10)+'-'+_0x3880cc[_0x7efd('0x1e')](0x10,0x14)+'-'+_0x3880cc[_0x7efd('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3b70f26..e8099a8 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 _0x0529=['../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','error','default','util','request-promise','bluebird','pkginfo','version'];(function(_0x3023c8,_0x5d734e){var _0x20bddd=function(_0x261170){while(--_0x261170){_0x3023c8['push'](_0x3023c8['shift']());}};_0x20bddd(++_0x5d734e);}(_0x0529,0xe5));var _0x9052=function(_0x57ee7a,_0x7d202b){_0x57ee7a=_0x57ee7a-0x0;var _0xdf9b8b=_0x0529[_0x57ee7a];return _0xdf9b8b;};'use strict';var util=require(_0x9052('0x0'));var moment=require('moment');var rp=require(_0x9052('0x1'));var BPromise=require(_0x9052('0x2'));var pkginfo=require(_0x9052('0x3'))(module,_0x9052('0x4'));var db=require(_0x9052('0x5'))['db'];var encryptor=require(_0x9052('0x6'));var hardware=require(_0x9052('0x7'));var logger=require(_0x9052('0x8'))(_0x9052('0x9'));var HOST=_0x9052('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x58bb71){return new BPromise(function(_0x222e32,_0x5d3b2c){var _0x293b44=util[_0x9052('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x58bb71,module[_0x9052('0xc')][_0x9052('0x4')]);if(oldToken){_0x293b44=util[_0x9052('0xb')](_0x9052('0xd'),HOST,_0x58bb71,module[_0x9052('0xc')][_0x9052('0x4')],oldToken);}var _0x4aefcc={'uri':_0x293b44,'method':_0x9052('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x4aefcc)[_0x9052('0xf')](function(_0x35fc74){_0x222e32(_0x35fc74);})[_0x9052('0x10')](function(_0x4bc7e7){_0x5d3b2c(_0x4bc7e7);});});}function manageLicense(_0x4ea69d,_0x283793){var _0x16efcd=_0x283793[_0x9052('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x16efcd['data1']!==_0x4ea69d&&!_0x16efcd[_0x9052('0x12')]){oldToken=_0x16efcd['data1'];}httpRequest(_0x4ea69d)[_0x9052('0xf')](function(_0x40eb1f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x40eb1f[_0x9052('0x13')]){isOldTokenSent=![];if(!_0x16efcd[_0x9052('0x9')]&&_0x16efcd[_0x9052('0x9')]!=_0x40eb1f[_0x9052('0x9')]||_0x16efcd[_0x9052('0x9')]&&_0x16efcd['data2']){logger[_0x9052('0x14')](_0x9052('0x15'));}if(_0x16efcd[_0x9052('0x9')]&&!_0x16efcd[_0x9052('0x12')]&&_0x16efcd[_0x9052('0x9')]!=_0x40eb1f[_0x9052('0x9')]){logger['info'](_0x9052('0x16'));}if(_0x16efcd[_0x9052('0x9')]&&!_0x16efcd[_0x9052('0x12')]&&_0x16efcd['license']==_0x40eb1f[_0x9052('0x9')]){return _0x283793;}return _0x283793['update']({'data1':_0x4ea69d,'data2':null,'license':_0x40eb1f['license']});}else{if(_0x40eb1f[_0x9052('0x9')]||_0x16efcd[_0x9052('0x9')]){if(!_0x16efcd['data2']){if(_0x16efcd[_0x9052('0x17')]==_0x4ea69d){GRAY_PERIOD_REASON='Disabled';logger[_0x9052('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x9052('0x18');logger['info'](_0x9052('0x19'),_0x16efcd[_0x9052('0x17')],_0x4ea69d);}logger['info'](_0x9052('0x1a'),GRAY_PERIOD_REASON[_0x9052('0x1b')](),moment()[_0x9052('0xb')](_0x9052('0x1c')));return _0x283793[_0x9052('0x1d')]({'data2':encryptor[_0x9052('0x1e')](moment()[_0x9052('0xb')](_0x9052('0x1c')))});}else{if(moment()['diff'](encryptor[_0x9052('0x1f')](_0x16efcd['data2']),_0x9052('0x20'))>DAYS){logger['info'](_0x9052('0x21'),moment()[_0x9052('0xb')](_0x9052('0x1c')));isOldTokenSent=![];return _0x283793[_0x9052('0x1d')]({'data1':_0x4ea69d,'data2':null,'license':null});}}}else{if(_0x16efcd[_0x9052('0x17')]!=_0x4ea69d){logger[_0x9052('0x14')](_0x9052('0x19'),_0x16efcd['data1'],_0x4ea69d);return _0x283793[_0x9052('0x1d')]({'data1':_0x4ea69d,'data2':null,'license':null});}}}return _0x283793;})['then'](function(_0x14635b){_0x283793=_0x14635b;})[_0x9052('0x10')](function(_0x368ed9){logger['error'](_0x368ed9[_0x9052('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9052('0x23')](),_0x283793);},TIME);});}function defaultLicense(){var _0x4a677f=hardware[_0x9052('0x23')]();if(_0x4a677f){return db[_0x9052('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x4a677f}})['spread'](function(_0x40e55d,_0x13de9c){logger[_0x9052('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4a677f);manageLicense(_0x4a677f,_0x40e55d);})[_0x9052('0x10')](function(_0x36767c){logger[_0x9052('0x25')](_0x36767c[_0x9052('0x22')]);});}}exports[_0x9052('0x26')]=defaultLicense; \ No newline at end of file +var _0x2b00=['days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','request-promise','version','../../components/encryptor','./hardware','license','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','catch','get','data2','data1','then','active','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x2b00,0x1c4));var _0x02b0=function(_0x269ac2,_0x139b30){_0x269ac2=_0x269ac2-0x0;var _0x288e11=_0x2b00[_0x269ac2];return _0x288e11;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x02b0('0x0'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x02b0('0x1'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x02b0('0x2'));var hardware=require(_0x02b0('0x3'));var logger=require('../logger')(_0x02b0('0x4'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x54f08b){return new BPromise(function(_0x20e535,_0x50e8c9){var _0x3de29e=util[_0x02b0('0x5')](_0x02b0('0x6'),HOST,_0x54f08b,module['exports'][_0x02b0('0x1')]);if(oldToken){_0x3de29e=util[_0x02b0('0x5')](_0x02b0('0x7'),HOST,_0x54f08b,module[_0x02b0('0x8')][_0x02b0('0x1')],oldToken);}var _0x535973={'uri':_0x3de29e,'method':_0x02b0('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x535973)['then'](function(_0x2a70b0){_0x20e535(_0x2a70b0);})[_0x02b0('0xa')](function(_0x1b61b0){_0x50e8c9(_0x1b61b0);});});}function manageLicense(_0x283224,_0x31b388){var _0x5c236f=_0x31b388[_0x02b0('0xb')]({'plain':!![]});if(!isOldTokenSent&&_0x5c236f['data1']!==_0x283224&&!_0x5c236f[_0x02b0('0xc')]){oldToken=_0x5c236f[_0x02b0('0xd')];}httpRequest(_0x283224)[_0x02b0('0xe')](function(_0xed3bab){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xed3bab[_0x02b0('0xf')]){isOldTokenSent=![];if(!_0x5c236f[_0x02b0('0x4')]&&_0x5c236f['license']!=_0xed3bab[_0x02b0('0x4')]||_0x5c236f[_0x02b0('0x4')]&&_0x5c236f[_0x02b0('0xc')]){logger[_0x02b0('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5c236f['license']&&!_0x5c236f['data2']&&_0x5c236f[_0x02b0('0x4')]!=_0xed3bab[_0x02b0('0x4')]){logger[_0x02b0('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5c236f[_0x02b0('0x4')]&&!_0x5c236f[_0x02b0('0xc')]&&_0x5c236f['license']==_0xed3bab[_0x02b0('0x4')]){return _0x31b388;}return _0x31b388[_0x02b0('0x11')]({'data1':_0x283224,'data2':null,'license':_0xed3bab[_0x02b0('0x4')]});}else{if(_0xed3bab['license']||_0x5c236f[_0x02b0('0x4')]){if(!_0x5c236f[_0x02b0('0xc')]){if(_0x5c236f[_0x02b0('0xd')]==_0x283224){GRAY_PERIOD_REASON=_0x02b0('0x12');logger[_0x02b0('0x10')](_0x02b0('0x13'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x02b0('0x14'),_0x5c236f['data1'],_0x283224);}logger[_0x02b0('0x10')](_0x02b0('0x15'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x02b0('0x5')](_0x02b0('0x16')));return _0x31b388[_0x02b0('0x11')]({'data2':encryptor[_0x02b0('0x17')](moment()[_0x02b0('0x5')](_0x02b0('0x16')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x5c236f['data2']),_0x02b0('0x18'))>DAYS){logger[_0x02b0('0x10')](_0x02b0('0x19'),moment()[_0x02b0('0x5')](_0x02b0('0x16')));isOldTokenSent=![];return _0x31b388[_0x02b0('0x11')]({'data1':_0x283224,'data2':null,'license':null});}}}else{if(_0x5c236f['data1']!=_0x283224){logger['info'](_0x02b0('0x14'),_0x5c236f[_0x02b0('0xd')],_0x283224);return _0x31b388[_0x02b0('0x11')]({'data1':_0x283224,'data2':null,'license':null});}}}return _0x31b388;})['then'](function(_0x5e4700){_0x31b388=_0x5e4700;})[_0x02b0('0xa')](function(_0x51984b){logger['error'](_0x51984b[_0x02b0('0x1a')]);})[_0x02b0('0x1b')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x31b388);},TIME);});}function defaultLicense(){var _0x1682b3=hardware[_0x02b0('0x1c')]();if(_0x1682b3){return db[_0x02b0('0x1d')][_0x02b0('0x1e')]({'where':{'id':0x1},'defaults':{'data1':_0x1682b3}})['spread'](function(_0x22e63c,_0x54b924){logger[_0x02b0('0x10')](_0x02b0('0x1f'),_0x1682b3);manageLicense(_0x1682b3,_0x22e63c);})['catch'](function(_0x2a3294){logger[_0x02b0('0x20')](_0x2a3294[_0x02b0('0x1a')]);});}}exports[_0x02b0('0x21')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0ac3e3d..1872c69 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 _0x67a0=['days','disabled','message','User','role','sequelize','COUNT','col','count','user','telephone','forEach','admin','pick','exports','util','lodash','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0x67a0,0x1b3));var _0x067a=function(_0x16a79a,_0x3550f6){_0x16a79a=_0x16a79a-0x0;var _0x3e022c=_0x67a0[_0x16a79a];return _0x3e022c;};'use strict';var util=require(_0x067a('0x0'));var _=require(_0x067a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x067a('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x067a('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x067a('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x067a('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x067a('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x067a('0x6'),'machineUuid':hardware[_0x067a('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2065de){return new BPromise(function(_0x117736,_0x571826){return db[_0x067a('0x7')][_0x067a('0x8')](_[_0x067a('0x9')](_0x2065de,{'raw':!![],'where':{'id':0x1}}))[_0x067a('0xa')](function(_0x4d59ef){return checkLicense(_0x4d59ef,null);})[_0x067a('0xa')](function(_0x43144b){_0x117736(_0x43144b);return;})[_0x067a('0xb')](function(_0x18d9de){_0x571826(_0x18d9de);});});}function checkLicense(_0x3aff35,_0x3ea4f2){if(!_0x3aff35){demoLicense[_0x067a('0xc')]=_0x3aff35[_0x067a('0xd')];return demoLicense;}try{var _0x60f0b2=_0x3ea4f2||_0x3aff35['license'];if(_[_0x067a('0xe')](_0x60f0b2)){throw new Error(_0x067a('0xf'));}var _0x720aca=_0x3aff35['data1'];var _0x1ba740=_0x3aff35[_0x067a('0x10')];var _0x462670=_0x720aca['split']('-')[0x4];var _0xe54f23=_0x720aca[_0x067a('0x11')]('-')[0x0];var _0xd2976e=encryptor[_0x067a('0x12')](_0x60f0b2,util[_0x067a('0x13')](_0x067a('0x14'),_0x462670,_0x720aca,_0xe54f23));var _0x5313b7=JSON[_0x067a('0x15')](_0xd2976e);_0x5313b7[_0x067a('0x16')]=![];_0x5313b7[_0x067a('0xc')]=_0x720aca;_0x5313b7[_0x067a('0x17')]=hardware[_0x067a('0x5')]();if(_0x1ba740){var _0x51c216=encryptor[_0x067a('0x12')](_0x1ba740);_0x5313b7[_0x067a('0x18')]=_0x51c216;_0x5313b7[_0x067a('0x19')]=moment(_0x51c216)[_0x067a('0x1a')](0x7,_0x067a('0x1b'))[_0x067a('0x13')]();_0x5313b7['grayReason']=_0x5313b7['uuid']!=_0x5313b7[_0x067a('0x17')]?'changed':_0x067a('0x1c');}return _0x5313b7;}catch(_0x4d39e8){breakingLicense[_0x067a('0xc')]=_0x3aff35[_0x067a('0xd')];breakingLicense['message']=_0x4d39e8[_0x067a('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x44f0f1,_0xb839e6){getLicense()[_0x067a('0xa')](function(_0x3732c5){return db[_0x067a('0x1e')]['findAll']({'attributes':[_0x067a('0x1f'),[db[_0x067a('0x20')]['fn'](_0x067a('0x21'),db[_0x067a('0x20')][_0x067a('0x22')](_0x067a('0x1f'))),_0x067a('0x23')]],'group':_0x067a('0x1f'),'where':{'role':{'$or':['admin',_0x067a('0x24'),_0x067a('0x25')]}},'raw':!![]})[_0x067a('0xa')](function(_0x568176){var _0x450fb7={'user':_0x3732c5['users']||0x0,'telephone':_0x3732c5['telephones']||0x0};_0x568176[_0x067a('0x26')](function(_0x388afd){var _0x4f6e70=_0x388afd[_0x067a('0x1f')]===_0x067a('0x27')?'user':_0x388afd[_0x067a('0x1f')];_0x450fb7[_0x4f6e70]-=_0x388afd[_0x067a('0x23')];if(_0x450fb7[_0x4f6e70]<0x0)_0x450fb7[_0x4f6e70]=0x0;});_0x44f0f1(_0x450fb7);return;});})[_0x067a('0xb')](function(_0xb2658){_0xb839e6(_0xb2658);});});}function checkUserLimits(_0x2789aa){return new BPromise(function(_0x902497,_0x440e8f){getLimits()['then'](function(_0x1d416c){var _0x51c38e=_[_0x067a('0x28')](_['countBy'](_0x2789aa,'role'),[_0x067a('0x27'),_0x067a('0x24'),_0x067a('0x25')]);var _0x469353=(_0x51c38e[_0x067a('0x27')]||0x0)+(_0x51c38e['user']||0x0);var _0x1debf9=_0x51c38e[_0x067a('0x25')]||0x0;if(_0x469353>_0x1d416c[_0x067a('0x24')])return _0x440e8f('License\x20limit\x20reached\x20for\x20users');if(_0x1debf9>_0x1d416c['telephone'])return _0x440e8f('License\x20limit\x20reached\x20for\x20telephones');return _0x902497();})['catch'](function(_0x50a608){_0x440e8f(_0x50a608);});});}module[_0x067a('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xdf5e=['User','findAll','sequelize','COUNT','col','role','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','changed','disabled','message'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xdf5e,0x1e6));var _0xedf5=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0xdf5e[_0x3a3b9e];return _0x148103;};'use strict';var util=require(_0xedf5('0x0'));var _=require(_0xedf5('0x1'));var moment=require(_0xedf5('0x2'));var BPromise=require(_0xedf5('0x3'));var hardware=require(_0xedf5('0x4'));var encryptor=require(_0xedf5('0x5'));var db=require(_0xedf5('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xedf5('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xedf5('0x8'),'machineUuid':hardware[_0xedf5('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xedf5('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xedf5('0xa'),'machineUuid':hardware[_0xedf5('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xc014f3){return new BPromise(function(_0x37eff2,_0x4320c3){return db[_0xedf5('0xb')][_0xedf5('0xc')](_[_0xedf5('0xd')](_0xc014f3,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5bc7d1){return checkLicense(_0x5bc7d1,null);})[_0xedf5('0xe')](function(_0x3c2d8a){_0x37eff2(_0x3c2d8a);return;})[_0xedf5('0xf')](function(_0xd5abf2){_0x4320c3(_0xd5abf2);});});}function checkLicense(_0x17fd51,_0x3ed8f2){if(!_0x17fd51){demoLicense[_0xedf5('0x10')]=_0x17fd51[_0xedf5('0x11')];return demoLicense;}try{var _0x5bcb2d=_0x3ed8f2||_0x17fd51[_0xedf5('0x12')];if(_[_0xedf5('0x13')](_0x5bcb2d)){throw new Error(_0xedf5('0x14'));}var _0xdeba04=_0x17fd51[_0xedf5('0x11')];var _0x471e87=_0x17fd51[_0xedf5('0x15')];var _0x198d20=_0xdeba04[_0xedf5('0x16')]('-')[0x4];var _0x5c7970=_0xdeba04[_0xedf5('0x16')]('-')[0x0];var _0x4a3e95=encryptor[_0xedf5('0x17')](_0x5bcb2d,util[_0xedf5('0x18')](_0xedf5('0x19'),_0x198d20,_0xdeba04,_0x5c7970));var _0x921974=JSON[_0xedf5('0x1a')](_0x4a3e95);_0x921974[_0xedf5('0x1b')]=![];_0x921974[_0xedf5('0x10')]=_0xdeba04;_0x921974[_0xedf5('0x1c')]=hardware[_0xedf5('0x9')]();if(_0x471e87){var _0x5e6920=encryptor[_0xedf5('0x17')](_0x471e87);_0x921974[_0xedf5('0x1d')]=_0x5e6920;_0x921974[_0xedf5('0x1e')]=moment(_0x5e6920)['add'](0x7,'days')['format']();_0x921974['grayReason']=_0x921974[_0xedf5('0x10')]!=_0x921974['machineUuid']?_0xedf5('0x1f'):_0xedf5('0x20');}return _0x921974;}catch(_0x401765){breakingLicense[_0xedf5('0x10')]=_0x17fd51[_0xedf5('0x11')];breakingLicense[_0xedf5('0x21')]=_0x401765[_0xedf5('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x51ef8e,_0x5cf451){getLicense()[_0xedf5('0xe')](function(_0x3dbc28){return db[_0xedf5('0x22')][_0xedf5('0x23')]({'attributes':['role',[db[_0xedf5('0x24')]['fn'](_0xedf5('0x25'),db[_0xedf5('0x24')][_0xedf5('0x26')](_0xedf5('0x27'))),'count']],'group':_0xedf5('0x27'),'where':{'role':{'$or':[_0xedf5('0x28'),_0xedf5('0x29'),_0xedf5('0x2a')]}},'raw':!![]})[_0xedf5('0xe')](function(_0x441e59){var _0x1c873d={'user':_0x3dbc28[_0xedf5('0x2b')]||0x0,'telephone':_0x3dbc28[_0xedf5('0x2c')]||0x0};_0x441e59[_0xedf5('0x2d')](function(_0x29c738){var _0x21b48f=_0x29c738['role']===_0xedf5('0x28')?_0xedf5('0x29'):_0x29c738['role'];_0x1c873d[_0x21b48f]-=_0x29c738[_0xedf5('0x2e')];if(_0x1c873d[_0x21b48f]<0x0)_0x1c873d[_0x21b48f]=0x0;});_0x51ef8e(_0x1c873d);return;});})[_0xedf5('0xf')](function(_0x5ef3d3){_0x5cf451(_0x5ef3d3);});});}function checkUserLimits(_0x1b4de9){return new BPromise(function(_0x22361e,_0x334091){getLimits()[_0xedf5('0xe')](function(_0xa71720){var _0x431f9a=_[_0xedf5('0x2f')](_[_0xedf5('0x30')](_0x1b4de9,'role'),[_0xedf5('0x28'),'user','telephone']);var _0x7ea2c9=(_0x431f9a[_0xedf5('0x28')]||0x0)+(_0x431f9a[_0xedf5('0x29')]||0x0);var _0x31c62e=_0x431f9a[_0xedf5('0x2a')]||0x0;if(_0x7ea2c9>_0xa71720[_0xedf5('0x29')])return _0x334091(_0xedf5('0x31'));if(_0x31c62e>_0xa71720[_0xedf5('0x2a')])return _0x334091(_0xedf5('0x32'));return _0x22361e();})[_0xedf5('0xf')](function(_0x11a593){_0x334091(_0x11a593);});});}module[_0xedf5('0x33')]={'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 ade7493..ec8ef2e 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 _0x28f2=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x28f2,0x193));var _0x228f=function(_0x224496,_0x4eadbd){_0x224496=_0x224496-0x0;var _0x41c108=_0x28f2[_0x224496];return _0x41c108;};'use strict';module[_0x228f('0x0')]={'DOMAIN':_0x228f('0x1'),'SESSION_SECRET':_0x228f('0x2'),'GOOGLE_ID':_0x228f('0x3'),'GOOGLE_SECRET':_0x228f('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1ab0b5,_0x42f3f9){var _0x180f06=function(_0x23e9eb){while(--_0x23e9eb){_0x1ab0b5['push'](_0x1ab0b5['shift']());}};_0x180f06(++_0x42f3f9);}(_0x77e6,0x1a6));var _0x677e=function(_0x5720ab,_0x36fe16){_0x5720ab=_0x5720ab-0x0;var _0x3546f9=_0x77e6[_0x5720ab];return _0x3546f9;};'use strict';module[_0x677e('0x0')]={'DOMAIN':_0x677e('0x1'),'SESSION_SECRET':_0x677e('0x2'),'GOOGLE_ID':_0x677e('0x3'),'GOOGLE_SECRET':_0x677e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 2da88bb..1733999 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b01=['../utils/loggers','fileLogger','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4b01,0x129));var _0x14b0=function(_0xb62f31,_0x154afd){_0xb62f31=_0xb62f31-0x0;var _0x37c2c8=_0x4b01[_0xb62f31];return _0x37c2c8;};'use strict';var fileLogger=require(_0x14b0('0x0'))[_0x14b0('0x1')];module[_0x14b0('0x2')]=fileLogger; \ No newline at end of file +var _0x83a2=['exports','../utils/loggers'];(function(_0x53a7d,_0x3df61f){var _0x1f0308=function(_0xf191c7){while(--_0xf191c7){_0x53a7d['push'](_0x53a7d['shift']());}};_0x1f0308(++_0x3df61f);}(_0x83a2,0x1d3));var _0x283a=function(_0xae9c9b,_0x1ab93a){_0xae9c9b=_0xae9c9b-0x0;var _0x46beb3=_0x83a2[_0xae9c9b];return _0x46beb3;};'use strict';var fileLogger=require(_0x283a('0x0'))['fileLogger'];module[_0x283a('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2bf3926..ff1a6e6 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 _0xe146=['ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x2ba612,_0x31ffe7){var _0x2250b7=function(_0x2b8094){while(--_0x2b8094){_0x2ba612['push'](_0x2ba612['shift']());}};_0x2250b7(++_0x31ffe7);}(_0xe146,0xdc));var _0x6e14=function(_0x58381c,_0x3b9374){_0x58381c=_0x58381c-0x0;var _0x1a7440=_0xe146[_0x58381c];return _0x1a7440;};'use strict';var path=require(_0x6e14('0x0'));var os=require('os');var config={'apps':[{'name':_0x6e14('0x1'),'script':path[_0x6e14('0x2')](__dirname,_0x6e14('0x3'))},{'name':_0x6e14('0x4'),'script':path[_0x6e14('0x2')](__dirname,_0x6e14('0x5'))},{'name':'agi','script':path[_0x6e14('0x2')](__dirname,_0x6e14('0x6'))},{'name':_0x6e14('0x7'),'script':path[_0x6e14('0x2')](__dirname,_0x6e14('0x8'))},{'name':_0x6e14('0x9'),'script':path[_0x6e14('0x2')](__dirname,_0x6e14('0xa'))},{'name':_0x6e14('0xb'),'script':path[_0x6e14('0x2')](__dirname,_0x6e14('0xc'))}]};module[_0x6e14('0xd')]=config; \ No newline at end of file +var _0x1abb=['xdr','../../services/xdr/index.js','exports','path','../../services/express/index.js','ami','join','email','../../services/email/index.js','../../services/routing/index.js'];(function(_0x2fbf3d,_0x1b1b8a){var _0x18f0c1=function(_0x4aa677){while(--_0x4aa677){_0x2fbf3d['push'](_0x2fbf3d['shift']());}};_0x18f0c1(++_0x1b1b8a);}(_0x1abb,0x17f));var _0xb1ab=function(_0x30bbfc,_0x326f7a){_0x30bbfc=_0x30bbfc-0x0;var _0x29f897=_0x1abb[_0x30bbfc];return _0x29f897;};'use strict';var path=require(_0xb1ab('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0xb1ab('0x1'))},{'name':_0xb1ab('0x2'),'script':path[_0xb1ab('0x3')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xb1ab('0x3')](__dirname,'../../services/agi/index.js')},{'name':_0xb1ab('0x4'),'script':path['join'](__dirname,_0xb1ab('0x5'))},{'name':'routing','script':path[_0xb1ab('0x3')](__dirname,_0xb1ab('0x6'))},{'name':_0xb1ab('0x7'),'script':path['join'](__dirname,_0xb1ab('0x8'))}]};module[_0xb1ab('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index d2a2269..a9e764b 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 _0x30a5=['disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config','connect','then','start'];(function(_0x3d98cf,_0x5b4aff){var _0x447d34=function(_0x1402af){while(--_0x1402af){_0x3d98cf['push'](_0x3d98cf['shift']());}};_0x447d34(++_0x5b4aff);}(_0x30a5,0xa4));var _0x530a=function(_0x1612d6,_0x5577bf){_0x1612d6=_0x1612d6-0x0;var _0x27a583=_0x30a5[_0x1612d6];return _0x27a583;};'use strict';var pm2=require(_0x530a('0x0'));var BPromise=require('bluebird');var config=require(_0x530a('0x1'));function connect(){return new BPromise(function(_0x469b3d,_0x5eb80d){return pm2[_0x530a('0x2')](function(_0x2b2ff7){if(_0x2b2ff7){return _0x5eb80d(_0x2b2ff7);}return _0x469b3d('connected');});});};exports['start']=function(_0x412746){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x25c84d,_0x19338b){return pm2[_0x530a('0x4')](_0x412746,function(_0x53858b,_0x7714b4){if(_0x53858b){return _0x19338b(_0x53858b);}pm2[_0x530a('0x5')]();return _0x25c84d(_0x7714b4);});});});};exports[_0x530a('0x6')]=function(_0x53d5a6){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x180cf8,_0x4d206b){return pm2[_0x530a('0x6')](_0x53d5a6,function(_0x12b952,_0x326aea){if(_0x12b952){return _0x4d206b(_0x12b952);}pm2[_0x530a('0x5')]();return _0x180cf8(_0x326aea);});});});};exports[_0x530a('0x7')]=function(_0x50948e){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x44cb65,_0x222e85){return pm2[_0x530a('0x7')](_0x50948e,function(_0x5ebe62,_0x189940){if(_0x5ebe62){return _0x222e85(_0x5ebe62);}pm2[_0x530a('0x5')]();return _0x44cb65(_0x189940);});});});};exports[_0x530a('0x8')]=function(){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x537fb5,_0x32e199){return pm2['list'](function(_0x355e9a,_0x59c29f){if(_0x355e9a){return _0x32e199(_0x355e9a);}pm2['disconnect']();return _0x537fb5(_0x59c29f);});});});};exports['describe']=function(_0xb1b94b){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x182365,_0x4efe3c){return pm2[_0x530a('0x9')](_0xb1b94b,function(_0x13b31d,_0x1db6b1){if(_0x13b31d){return _0x4efe3c(_0x13b31d);}pm2[_0x530a('0x5')]();return _0x182365(_0x1db6b1);});});});};exports[_0x530a('0xa')]=function(_0x2f1e44){return connect()['then'](function(){return new BPromise(function(_0x2de0bc,_0x271e07){return pm2[_0x530a('0xa')](_0x2f1e44,function(_0x29bec6,_0xe0bcbc){if(_0x29bec6){return _0x271e07(_0x29bec6);}pm2[_0x530a('0x5')]();return _0x2de0bc(_0xe0bcbc);});});});};exports['dump']=function(){return connect()[_0x530a('0x3')](function(){return new BPromise(function(_0x2d16ba,_0x2aaa42){return pm2[_0x530a('0xb')](function(_0x41e9e9){if(_0x41e9e9){return _0x2aaa42(_0x41e9e9);}return _0x2d16ba(_0x530a('0xc'));});});});}; \ No newline at end of file +var _0x01fe=['start','then','disconnect','stop','restart','list','describe','saved','pm2','bluebird','./config','connect'];(function(_0x4c03ea,_0x3465be){var _0x7a6922=function(_0xd50354){while(--_0xd50354){_0x4c03ea['push'](_0x4c03ea['shift']());}};_0x7a6922(++_0x3465be);}(_0x01fe,0x98));var _0xe01f=function(_0x4af7c1,_0x2440d7){_0x4af7c1=_0x4af7c1-0x0;var _0x444a67=_0x01fe[_0x4af7c1];return _0x444a67;};'use strict';var pm2=require(_0xe01f('0x0'));var BPromise=require(_0xe01f('0x1'));var config=require(_0xe01f('0x2'));function connect(){return new BPromise(function(_0x1118b4,_0x2f28ec){return pm2[_0xe01f('0x3')](function(_0x3ec70c){if(_0x3ec70c){return _0x2f28ec(_0x3ec70c);}return _0x1118b4('connected');});});};exports[_0xe01f('0x4')]=function(_0x20addd){return connect()[_0xe01f('0x5')](function(){return new BPromise(function(_0x42ceb2,_0x499880){return pm2[_0xe01f('0x4')](_0x20addd,function(_0x4aec9f,_0x4b98ae){if(_0x4aec9f){return _0x499880(_0x4aec9f);}pm2[_0xe01f('0x6')]();return _0x42ceb2(_0x4b98ae);});});});};exports[_0xe01f('0x7')]=function(_0x441524){return connect()[_0xe01f('0x5')](function(){return new BPromise(function(_0x1061ed,_0xa58e2c){return pm2[_0xe01f('0x7')](_0x441524,function(_0x15e2b2,_0x2bf7b7){if(_0x15e2b2){return _0xa58e2c(_0x15e2b2);}pm2[_0xe01f('0x6')]();return _0x1061ed(_0x2bf7b7);});});});};exports[_0xe01f('0x8')]=function(_0x26713e){return connect()['then'](function(){return new BPromise(function(_0x509ede,_0x43c36f){return pm2[_0xe01f('0x8')](_0x26713e,function(_0x61d986,_0x2450dc){if(_0x61d986){return _0x43c36f(_0x61d986);}pm2['disconnect']();return _0x509ede(_0x2450dc);});});});};exports[_0xe01f('0x9')]=function(){return connect()[_0xe01f('0x5')](function(){return new BPromise(function(_0x22bf78,_0x36c5f9){return pm2[_0xe01f('0x9')](function(_0x3ebb4e,_0x418b60){if(_0x3ebb4e){return _0x36c5f9(_0x3ebb4e);}pm2[_0xe01f('0x6')]();return _0x22bf78(_0x418b60);});});});};exports['describe']=function(_0x1878e7){return connect()[_0xe01f('0x5')](function(){return new BPromise(function(_0x4402a2,_0x17c602){return pm2[_0xe01f('0xa')](_0x1878e7,function(_0x561632,_0x8b624){if(_0x561632){return _0x17c602(_0x561632);}pm2['disconnect']();return _0x4402a2(_0x8b624);});});});};exports['delete']=function(_0x555c37){return connect()[_0xe01f('0x5')](function(){return new BPromise(function(_0xf1a64a,_0x116d27){return pm2['delete'](_0x555c37,function(_0x1680cf,_0x3757ee){if(_0x1680cf){return _0x116d27(_0x1680cf);}pm2[_0xe01f('0x6')]();return _0xf1a64a(_0x3757ee);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x570a41,_0x958f03){return pm2['dump'](function(_0x9b1b2c){if(_0x9b1b2c){return _0x958f03(_0x9b1b2c);}return _0x570a41(_0xe01f('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fad8978..c6d2133 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 _0xef08=['../logger','schedule','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','subtract','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb'];(function(_0x536c1e,_0x18be65){var _0x5d2b51=function(_0x4c8a38){while(--_0x4c8a38){_0x536c1e['push'](_0x536c1e['shift']());}};_0x5d2b51(++_0x18be65);}(_0xef08,0x77));var _0x8ef0=function(_0x339478,_0x246478){_0x339478=_0x339478-0x0;var _0xa696b0=_0xef08[_0x339478];return _0xa696b0;};'use strict';var _=require(_0x8ef0('0x0'));var moment=require(_0x8ef0('0x1'));var Redis=require(_0x8ef0('0x2'));var util=require(_0x8ef0('0x3'));var config=require('../../config/environment');var db=require(_0x8ef0('0x4'))['db'];var logger=require(_0x8ef0('0x5'))(_0x8ef0('0x6'));config['redis']=_[_0x8ef0('0x7')](config['redis'],{'host':_0x8ef0('0x8'),'port':0x18eb});var io=require(_0x8ef0('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x2f43cf=0x0;var _0x38251f=[];return db[_0x8ef0('0xa')][_0x8ef0('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x296769){_0x2f43cf=_0x296769[_0x8ef0('0xc')];if(_0x2f43cf){return db[_0x8ef0('0xd')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x8ef0('0xe')](_0x296769['chatTimeout'],_0x8ef0('0xf'))}}});}else{return[];}})[_0x8ef0('0x10')](function(_0x3ab4b0){if(_0x3ab4b0&&_0x3ab4b0[_0x8ef0('0x11')]){_0x38251f=_[_0x8ef0('0x12')](_0x3ab4b0||[],'id');logger[_0x8ef0('0x13')](_0x8ef0('0x14'),_0x38251f[_0x8ef0('0x15')]());return db[_0x8ef0('0xd')]['update']({'closeReason':_0x8ef0('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x8ef0('0x17'))},{'where':{'id':_0x38251f}});}})[_0x8ef0('0x10')](function(){if(_0x38251f&&_0x38251f['length']){logger['info'](_0x8ef0('0x18'),_0x38251f[_0x8ef0('0x15')]());for(var _0x1a23bf=0x0;_0x1a23bf<_0x38251f[_0x8ef0('0x11')];_0x1a23bf++){io[_0x8ef0('0x19')](_0x8ef0('0x1a'),{'id':_0x38251f[_0x1a23bf],'closed':!![]});}}})[_0x8ef0('0x1b')](function(_0x10c89d){logger['error'](_0x8ef0('0x1c'),_0x10c89d?util[_0x8ef0('0x1d')](_0x10c89d,{'showHidden':![],'depth':null}):'');});}exports[_0x8ef0('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x698b=['schedule','redis','defaults','localhost','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','../../config/environment','../../mysqldb','../logger'];(function(_0x52f459,_0x14e706){var _0xf607f1=function(_0xd1f23){while(--_0xd1f23){_0x52f459['push'](_0x52f459['shift']());}};_0xf607f1(++_0x14e706);}(_0x698b,0x19b));var _0xb698=function(_0x4c84e3,_0x4121b8){_0x4c84e3=_0x4c84e3-0x0;var _0x157c11=_0x698b[_0x4c84e3];return _0x157c11;};'use strict';var _=require('lodash');var moment=require(_0xb698('0x0'));var Redis=require(_0xb698('0x1'));var util=require('util');var config=require(_0xb698('0x2'));var db=require(_0xb698('0x3'))['db'];var logger=require(_0xb698('0x4'))(_0xb698('0x5'));config[_0xb698('0x6')]=_[_0xb698('0x7')](config[_0xb698('0x6')],{'host':_0xb698('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb698('0x6')]));function closeInteractions(){var _0x44f3ab=0x0;var _0x3d336d=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xb698('0x9')],'where':{'id':0x1}})[_0xb698('0xa')](function(_0x4ee7e5){_0x44f3ab=_0x4ee7e5[_0xb698('0x9')];if(_0x44f3ab){return db[_0xb698('0xb')][_0xb698('0xc')]({'raw':!![],'attributes':['id',_0xb698('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb698('0xe')](_0x4ee7e5[_0xb698('0x9')],_0xb698('0xf'))}}});}else{return[];}})[_0xb698('0xa')](function(_0x4d9fea){if(_0x4d9fea&&_0x4d9fea['length']){_0x3d336d=_[_0xb698('0x10')](_0x4d9fea||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x3d336d[_0xb698('0x11')]());return db['ChatInteraction'][_0xb698('0x12')]({'closeReason':_0xb698('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xb698('0x14')](_0xb698('0x15'))},{'where':{'id':_0x3d336d}});}})['then'](function(){if(_0x3d336d&&_0x3d336d[_0xb698('0x16')]){logger[_0xb698('0x17')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3d336d[_0xb698('0x11')]());for(var _0x1020fe=0x0;_0x1020fe<_0x3d336d['length'];_0x1020fe++){io['emit']('chatInteraction:update',{'id':_0x3d336d[_0x1020fe],'closed':!![]});}}})['catch'](function(_0x141ebb){logger['error'](_0xb698('0x18'),_0x141ebb?util[_0xb698('0x19')](_0x141ebb,{'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/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index a2989ea..3d7abd2 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 _0x0d5b=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x4d6db9,_0x24b29b){var _0x58f3ae=function(_0x57bce8){while(--_0x57bce8){_0x4d6db9['push'](_0x4d6db9['shift']());}};_0x58f3ae(++_0x24b29b);}(_0x0d5b,0x187));var _0xb0d5=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x0d5b[_0x24259d];return _0x5a701;};'use strict';function start(){var _0x33374f=require(_0xb0d5('0x0'));return _0x33374f[_0xb0d5('0x1')]();}module[_0xb0d5('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xe9f2=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5dae4a,_0x44934a){var _0x1a5d40=function(_0x255f46){while(--_0x255f46){_0x5dae4a['push'](_0x5dae4a['shift']());}};_0x1a5d40(++_0x44934a);}(_0xe9f2,0x100));var _0x2e9f=function(_0x37fb95,_0xc1dd1d){_0x37fb95=_0x37fb95-0x0;var _0x461cdf=_0xe9f2[_0x37fb95];return _0x461cdf;};'use strict';function start(){var _0x1aa789=require(_0x2e9f('0x0'));return _0x1aa789['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 7bfbd88..4934e32 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 _0x03fe=['runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','keys','map','difference','intersection','exists','delete\x20cron','toRun','length','toString','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','basename','extname','zip','existsSync','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','data','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId'];(function(_0x62117a,_0xe697fd){var _0x5cb735=function(_0xf56a44){while(--_0xf56a44){_0x62117a['push'](_0x62117a['shift']());}};_0x5cb735(++_0xe697fd);}(_0x03fe,0x73));var _0xe03f=function(_0x363eab,_0x466c43){_0x363eab=_0x363eab-0x0;var _0xe2916=_0x03fe[_0x363eab];return _0xe2916;};'use strict';var fs=require('fs');var util=require(_0xe03f('0x0'));var path=require(_0xe03f('0x1'));var _=require(_0xe03f('0x2'));var moment=require(_0xe03f('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xe03f('0x4'));var BPromise=require(_0xe03f('0x5'));var logger=require('../logger')(_0xe03f('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xe03f('0x7'));var client=jayson[_0xe03f('0x8')][_0xe03f('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3a3227,_0x163e08){return function(){logger['info'](_0xe03f('0xa'),_0x3a3227[_0xe03f('0xb')]);var _0x4eb71c=!![];var _0x1f9e37=_0x3a3227[_0xe03f('0xc')][_0xe03f('0xd')]();var _0x35eb55={'account':_0x1f9e37,'message':{'from':util[_0xe03f('0xe')](_0xe03f('0xf'),_0x3a3227[_0xe03f('0xc')][_0xe03f('0x10')],_0x3a3227[_0xe03f('0xc')][_0xe03f('0xb')]||_0x3a3227['MailAccount'][_0xe03f('0x11')][_0xe03f('0x12')]),'to':_0x3a3227[_0xe03f('0xb')],'cc':_0x3a3227['cc'],'bcc':_0x3a3227[_0xe03f('0x13')],'subject':util[_0xe03f('0xe')](_0xe03f('0x14'),_0x163e08[_0xe03f('0x10')],_0x3a3227[_0xe03f('0x15')],_0x3a3227[_0xe03f('0x16')])}};var _0x23ba83=path[_0xe03f('0x17')](__dirname,'../../files/reports');var _0x32ecb1=_0x163e08['savename'];var _0x2d9c34=util['format']('%s.%s',path[_0xe03f('0x18')](_0x163e08['savename'],path[_0xe03f('0x19')](_0x163e08['savename'])),_0xe03f('0x1a'));var _0x3ecf83=path[_0xe03f('0x17')](_0x23ba83,_0x32ecb1);var _0x9589ef=path[_0xe03f('0x17')](_0x23ba83,_0x2d9c34);if(fs[_0xe03f('0x1b')](_0x3ecf83)){_0x163e08[_0xe03f('0x1c')]=_0xe03f('0x1d');_0x35eb55[_0xe03f('0x1e')]['attachments']=[{'filename':_0x32ecb1,'path':_0x3ecf83}];_0x35eb55[_0xe03f('0x1e')]['text']=util[_0xe03f('0xe')](_0xe03f('0x1f'),JSON[_0xe03f('0x20')](_0x163e08,null,0x2));}else if(fs[_0xe03f('0x1b')](_0x9589ef)){_0x163e08['status']=_0xe03f('0x1d');_0x35eb55['message']['attachments']=[{'filename':_0x2d9c34,'path':_0x9589ef}];}else{_0x35eb55[_0xe03f('0x1e')][_0xe03f('0x21')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3a3227['sendIfEmpty']){_0x4eb71c=![];logger[_0xe03f('0x22')](_0xe03f('0x23'));}}if(_0x4eb71c){return client[_0xe03f('0x24')](_0xe03f('0x25'),_0x35eb55)['then'](function(_0x9a2f44){if(_0x9a2f44[_0xe03f('0x26')]){return logger['error'](_0xe03f('0x27'),JSON['stringify'](_0x9a2f44));}return logger[_0xe03f('0x22')]('email\x20sent');})['catch'](function(_0x26ba6e){return logger[_0xe03f('0x26')]('error\x20mail',JSON[_0xe03f('0x20')](_0x26ba6e));});}};}function handleError(){return function(_0x413c06){return logger['error'](JSON[_0xe03f('0x20')](_0x413c06));};}function handleResult(_0x1402ee){return function(_0x43f1a7){logger['info'](_0xe03f('0x28'),JSON[_0xe03f('0x20')](_0x43f1a7));if(_0x1402ee[_0xe03f('0xc')]&&_0x1402ee['MailAccount'][_0xe03f('0x11')]&&!_[_0xe03f('0x29')](_0x1402ee['email'])){setTimeout(handleSendEmail(_0x1402ee,_0x43f1a7),0x3c*0x3e8);}};}function handleJob(_0x3c8c43){return function(){try{if(_[_0xe03f('0x29')](_0x3c8c43[_0xe03f('0x15')])){return logger[_0xe03f('0x22')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe03f('0x29')](_0x3c8c43[_0xe03f('0x16')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x27c608={'startDate':moment()[_0xe03f('0x2a')](_0x3c8c43[_0xe03f('0x15')],_0x3c8c43[_0xe03f('0x16')])[_0xe03f('0xe')](_0xe03f('0x2b')),'endDate':moment()[_0xe03f('0xe')](_0xe03f('0x2b')),'type':_0xe03f('0x2c'),'output':_0x3c8c43[_0xe03f('0x2d')],'name':_0x3c8c43[_0xe03f('0x10')]};if(!_[_0xe03f('0x29')](_0x3c8c43[_0xe03f('0x2e')])){logger[_0xe03f('0x22')]('exec\x20defaul\x20report\x20id:%s',_0x3c8c43[_0xe03f('0x2e')]);return analyticDefaultReportController[_0xe03f('0x2f')]({'id':_0x3c8c43['DefaultReportId']},_0x27c608)[_0xe03f('0x30')](handleResult(_0x3c8c43))[_0xe03f('0x31')](handleError());}if(!_['isNil'](_0x3c8c43[_0xe03f('0x32')])){logger[_0xe03f('0x22')](_0xe03f('0x33'),_0x3c8c43[_0xe03f('0x32')]);return analyticCustomReportController[_0xe03f('0x2f')]({'id':_0x3c8c43['CustomReportId']},_0x27c608)[_0xe03f('0x30')](handleResult(_0x3c8c43))[_0xe03f('0x31')](handleError());}}catch(_0x2c20a8){logger[_0xe03f('0x26')](JSON[_0xe03f('0x20')](_0x2c20a8));}return logger['info']('no\x20report\x20id');};}function getJobs(_0xdd18e0){var _0x282a31={};if(_0xdd18e0){_0x282a31['id']=_0xdd18e0;}return db[_0xe03f('0x34')][_0xe03f('0x35')]({'where':_0x282a31,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe03f('0x10'),_0xe03f('0xb')],'include':[{'model':db[_0xe03f('0x36')],'as':_0xe03f('0x11'),'include':[{'model':db[_0xe03f('0x37')],'as':_0xe03f('0x37')}]}]}]})[_0xe03f('0x30')](function(_0x82960a){var _0x33d9ef=_[_0xe03f('0x38')](manager['jobs']);var _0xabf1ab=_[_0xe03f('0x39')](_0x82960a,function(_0x443afb){return _0x443afb['id']['toString']();});var _0x56089b=_['keyBy'](_0x82960a,function(_0x3acffa){return _0x3acffa['id']['toString']();});var _0x845807=_0xdd18e0?_0xabf1ab:_[_0xe03f('0x3a')](_0xabf1ab,_0x33d9ef);var _0x4fb5ab=_[_0xe03f('0x3b')](_0xabf1ab,_0x33d9ef);var _0x239063=_['difference'](_0x33d9ef,_0xabf1ab);var _0x407912;var _0x44d514;for(_0x407912=0x0;_0x407912<_0x239063['length']&&!_0xdd18e0;_0x407912+=0x1){_0x44d514=_0x239063[_0x407912]['toString']();if(manager[_0xe03f('0x3c')](_0x44d514)){manager['stop'](_0x44d514);manager['deleteJob'](_0x44d514);logger[_0xe03f('0x22')](_0xe03f('0x3d'),_0x44d514);}}logger[_0xe03f('0x22')](_0xe03f('0x3e'),JSON[_0xe03f('0x20')](_0x845807));for(_0x407912=0x0;_0x407912<_0x845807[_0xe03f('0x3f')];_0x407912+=0x1){_0x44d514=_0x845807[_0x407912][_0xe03f('0x40')]();logger[_0xe03f('0x22')](_0xe03f('0x41'),_0x44d514);if(_0xdd18e0){logger[_0xe03f('0x22')](_0xe03f('0x42'),_0xdd18e0);logger[_0xe03f('0x22')](JSON[_0xe03f('0x20')](_0x56089b[_0x44d514]));BPromise[_0xe03f('0x43')]()[_0xe03f('0x30')](handleJob(_0x56089b[_0x44d514]));logger[_0xe03f('0x22')](_0xe03f('0x44'),_0x56089b[_0x44d514][_0xe03f('0x10')],_0x56089b[_0x44d514][_0xe03f('0x45')]);}else if(_0x56089b[_0x44d514][_0xe03f('0x45')]&&_0x56089b[_0x44d514][_0xe03f('0x46')]&&moment()[_0xe03f('0x47')](_0x56089b[_0x44d514][_0xe03f('0x48')],_0x56089b[_0x44d514][_0xe03f('0x49')])){manager[_0xe03f('0x4a')](_0x44d514,_0x56089b[_0x44d514][_0xe03f('0x45')],handleJob(_0x56089b[_0x44d514]));manager[_0xe03f('0x4b')](_0x44d514);logger[_0xe03f('0x22')](_0xe03f('0x4c'),_0x56089b[_0x44d514][_0xe03f('0x10')],_0x56089b[_0x44d514][_0xe03f('0x45')]);}else if(manager['exists'](_0x44d514)){manager['stop'](_0x44d514);manager[_0xe03f('0x4d')](_0x44d514);logger[_0xe03f('0x22')](_0xe03f('0x4e'),_0x56089b[_0x44d514][_0xe03f('0x10')],_0x56089b[_0x44d514][_0xe03f('0x45')]);}}for(_0x407912=0x0,_0x44d514;_0x407912<_0x4fb5ab['length']&&!_0xdd18e0;_0x407912+=0x1){_0x44d514=_0x4fb5ab[_0x407912]['toString']();if(manager['exists'](_0x44d514)){if(_0x56089b[_0x44d514][_0xe03f('0x45')]&&_0x56089b[_0x44d514][_0xe03f('0x46')]&&moment()[_0xe03f('0x47')](_0x56089b[_0x44d514]['startAt'],_0x56089b[_0x44d514][_0xe03f('0x49')])){manager['update'](_0x44d514,_0x56089b[_0x44d514][_0xe03f('0x45')],handleJob(_0x56089b[_0x44d514]));logger[_0xe03f('0x22')](_0xe03f('0x4f'),_0x56089b[_0x44d514][_0xe03f('0x10')],_0x56089b[_0x44d514][_0xe03f('0x45')]);}else{manager['stop'](_0x44d514);manager['deleteJob'](_0x44d514);logger[_0xe03f('0x22')](_0xe03f('0x4e'),_0x56089b[_0x44d514][_0xe03f('0x10')],_0x56089b[_0x44d514]['cron']);}}}})['catch'](function(_0x5341a4){logger['error'](JSON[_0xe03f('0x20')](_0x5341a4));});}exports[_0xe03f('0x50')]=function(_0x1dc1a9){return getJobs(_0x1dc1a9);};exports[_0xe03f('0x4b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xcdfc=['startAt','endAt','add','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','run','start','util','lodash','moment','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','map','toString','keyBy','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xcdfc,0xba));var _0xccdf=function(_0x59a792,_0xed2fd9){_0x59a792=_0x59a792-0x0;var _0x57863c=_0xcdfc[_0x59a792];return _0x57863c;};'use strict';var fs=require('fs');var util=require(_0xccdf('0x0'));var path=require('path');var _=require(_0xccdf('0x1'));var moment=require(_0xccdf('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xccdf('0x3'));var BPromise=require(_0xccdf('0x4'));var logger=require('../logger')(_0xccdf('0x5'));var db=require(_0xccdf('0x6'))['db'];var analyticCustomReportController=require(_0xccdf('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xccdf('0x8')][_0xccdf('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2e5da9,_0x4e6833){return function(){logger[_0xccdf('0xa')](_0xccdf('0xb'),_0x2e5da9[_0xccdf('0xc')]);var _0x13b505=!![];var _0x31329b=_0x2e5da9[_0xccdf('0xd')][_0xccdf('0xe')]();var _0x156574={'account':_0x31329b,'message':{'from':util[_0xccdf('0xf')](_0xccdf('0x10'),_0x2e5da9[_0xccdf('0xd')][_0xccdf('0x11')],_0x2e5da9['MailAccount'][_0xccdf('0xc')]||_0x2e5da9[_0xccdf('0xd')][_0xccdf('0x12')][_0xccdf('0x13')]),'to':_0x2e5da9['email'],'cc':_0x2e5da9['cc'],'bcc':_0x2e5da9[_0xccdf('0x14')],'subject':util[_0xccdf('0xf')](_0xccdf('0x15'),_0x4e6833['name'],_0x2e5da9[_0xccdf('0x16')],_0x2e5da9[_0xccdf('0x17')])}};var _0x4e1ecb=path[_0xccdf('0x18')](__dirname,_0xccdf('0x19'));var _0x508249=_0x4e6833[_0xccdf('0x1a')];var _0x1ee77e=util[_0xccdf('0xf')](_0xccdf('0x1b'),path[_0xccdf('0x1c')](_0x4e6833[_0xccdf('0x1a')],path[_0xccdf('0x1d')](_0x4e6833[_0xccdf('0x1a')])),_0xccdf('0x1e'));var _0x4ba821=path[_0xccdf('0x18')](_0x4e1ecb,_0x508249);var _0x40f3b0=path[_0xccdf('0x18')](_0x4e1ecb,_0x1ee77e);if(fs[_0xccdf('0x1f')](_0x4ba821)){_0x4e6833[_0xccdf('0x20')]=_0xccdf('0x21');_0x156574[_0xccdf('0x22')]['attachments']=[{'filename':_0x508249,'path':_0x4ba821}];_0x156574['message']['text']=util[_0xccdf('0xf')](_0xccdf('0x23'),JSON[_0xccdf('0x24')](_0x4e6833,null,0x2));}else if(fs[_0xccdf('0x1f')](_0x40f3b0)){_0x4e6833[_0xccdf('0x20')]=_0xccdf('0x21');_0x156574[_0xccdf('0x22')]['attachments']=[{'filename':_0x1ee77e,'path':_0x40f3b0}];}else{_0x156574[_0xccdf('0x22')][_0xccdf('0x25')]=_0xccdf('0x26');if(!_0x2e5da9[_0xccdf('0x27')]){_0x13b505=![];logger[_0xccdf('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x13b505){return client[_0xccdf('0x28')]('SendMail',_0x156574)[_0xccdf('0x29')](function(_0x48d5d3){if(_0x48d5d3[_0xccdf('0x2a')]){return logger[_0xccdf('0x2a')](_0xccdf('0x2b'),JSON[_0xccdf('0x24')](_0x48d5d3));}return logger[_0xccdf('0xa')](_0xccdf('0x2c'));})['catch'](function(_0x3be37e){return logger[_0xccdf('0x2a')](_0xccdf('0x2b'),JSON[_0xccdf('0x24')](_0x3be37e));});}};}function handleError(){return function(_0x2045e8){return logger['error'](JSON['stringify'](_0x2045e8));};}function handleResult(_0x364f46){return function(_0x3c2ebf){logger[_0xccdf('0xa')](_0xccdf('0x2d'),JSON[_0xccdf('0x24')](_0x3c2ebf));if(_0x364f46['MailAccount']&&_0x364f46[_0xccdf('0xd')][_0xccdf('0x12')]&&!_['isNil'](_0x364f46['email'])){setTimeout(handleSendEmail(_0x364f46,_0x3c2ebf),0x3c*0x3e8);}};}function handleJob(_0x5e9dab){return function(){try{if(_[_0xccdf('0x2e')](_0x5e9dab['subtractNumber'])){return logger[_0xccdf('0xa')](_0xccdf('0x2f'));}if(_[_0xccdf('0x2e')](_0x5e9dab['subtractUnit'])){return logger[_0xccdf('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x130e1e={'startDate':moment()[_0xccdf('0x30')](_0x5e9dab[_0xccdf('0x16')],_0x5e9dab[_0xccdf('0x17')])[_0xccdf('0xf')](_0xccdf('0x31')),'endDate':moment()[_0xccdf('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xccdf('0x32'),'output':_0x5e9dab[_0xccdf('0x33')],'name':_0x5e9dab[_0xccdf('0x11')]};if(!_[_0xccdf('0x2e')](_0x5e9dab['DefaultReportId'])){logger[_0xccdf('0xa')](_0xccdf('0x34'),_0x5e9dab[_0xccdf('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x5e9dab['DefaultReportId']},_0x130e1e)['then'](handleResult(_0x5e9dab))[_0xccdf('0x36')](handleError());}if(!_['isNil'](_0x5e9dab['CustomReportId'])){logger['info'](_0xccdf('0x37'),_0x5e9dab[_0xccdf('0x38')]);return analyticCustomReportController[_0xccdf('0x39')]({'id':_0x5e9dab[_0xccdf('0x38')]},_0x130e1e)['then'](handleResult(_0x5e9dab))[_0xccdf('0x36')](handleError());}}catch(_0x5fdfc1){logger[_0xccdf('0x2a')](JSON['stringify'](_0x5fdfc1));}return logger[_0xccdf('0xa')](_0xccdf('0x3a'));};}function getJobs(_0x2732e0){var _0x8d44b9={};if(_0x2732e0){_0x8d44b9['id']=_0x2732e0;}return db[_0xccdf('0x3b')]['findAll']({'where':_0x8d44b9,'include':[{'model':db['MailAccount'],'attributes':['id',_0xccdf('0x11'),'email'],'include':[{'model':db[_0xccdf('0x3c')],'as':_0xccdf('0x12'),'include':[{'model':db[_0xccdf('0x3d')],'as':_0xccdf('0x3d')}]}]}]})[_0xccdf('0x29')](function(_0x58f98c){var _0x203e64=_['keys'](manager['jobs']);var _0x9c64b1=_[_0xccdf('0x3e')](_0x58f98c,function(_0x59c125){return _0x59c125['id'][_0xccdf('0x3f')]();});var _0x807200=_[_0xccdf('0x40')](_0x58f98c,function(_0x539337){return _0x539337['id'][_0xccdf('0x3f')]();});var _0x74017d=_0x2732e0?_0x9c64b1:_[_0xccdf('0x41')](_0x9c64b1,_0x203e64);var _0x1ea0fe=_[_0xccdf('0x42')](_0x9c64b1,_0x203e64);var _0x5da5c3=_[_0xccdf('0x41')](_0x203e64,_0x9c64b1);var _0xb381ea;var _0x1e4190;for(_0xb381ea=0x0;_0xb381ea<_0x5da5c3['length']&&!_0x2732e0;_0xb381ea+=0x1){_0x1e4190=_0x5da5c3[_0xb381ea][_0xccdf('0x3f')]();if(manager[_0xccdf('0x43')](_0x1e4190)){manager[_0xccdf('0x44')](_0x1e4190);manager['deleteJob'](_0x1e4190);logger[_0xccdf('0xa')](_0xccdf('0x45'),_0x1e4190);}}logger[_0xccdf('0xa')](_0xccdf('0x46'),JSON[_0xccdf('0x24')](_0x74017d));for(_0xb381ea=0x0;_0xb381ea<_0x74017d[_0xccdf('0x47')];_0xb381ea+=0x1){_0x1e4190=_0x74017d[_0xb381ea][_0xccdf('0x3f')]();logger[_0xccdf('0xa')](_0xccdf('0x48'),_0x1e4190);if(_0x2732e0){logger[_0xccdf('0xa')](_0xccdf('0x49'),_0x2732e0);logger[_0xccdf('0xa')](JSON[_0xccdf('0x24')](_0x807200[_0x1e4190]));BPromise['resolve']()[_0xccdf('0x29')](handleJob(_0x807200[_0x1e4190]));logger['info'](_0xccdf('0x4a'),_0x807200[_0x1e4190][_0xccdf('0x11')],_0x807200[_0x1e4190]['cron']);}else if(_0x807200[_0x1e4190][_0xccdf('0x4b')]&&_0x807200[_0x1e4190][_0xccdf('0x4c')]&&moment()[_0xccdf('0x4d')](_0x807200[_0x1e4190][_0xccdf('0x4e')],_0x807200[_0x1e4190][_0xccdf('0x4f')])){manager[_0xccdf('0x50')](_0x1e4190,_0x807200[_0x1e4190][_0xccdf('0x4b')],handleJob(_0x807200[_0x1e4190]));manager['start'](_0x1e4190);logger['info'](_0xccdf('0x51'),_0x807200[_0x1e4190]['name'],_0x807200[_0x1e4190][_0xccdf('0x4b')]);}else if(manager[_0xccdf('0x43')](_0x1e4190)){manager[_0xccdf('0x44')](_0x1e4190);manager[_0xccdf('0x52')](_0x1e4190);logger['info'](_0xccdf('0x53'),_0x807200[_0x1e4190][_0xccdf('0x11')],_0x807200[_0x1e4190][_0xccdf('0x4b')]);}}for(_0xb381ea=0x0,_0x1e4190;_0xb381ea<_0x1ea0fe[_0xccdf('0x47')]&&!_0x2732e0;_0xb381ea+=0x1){_0x1e4190=_0x1ea0fe[_0xb381ea]['toString']();if(manager[_0xccdf('0x43')](_0x1e4190)){if(_0x807200[_0x1e4190][_0xccdf('0x4b')]&&_0x807200[_0x1e4190][_0xccdf('0x4c')]&&moment()[_0xccdf('0x4d')](_0x807200[_0x1e4190]['startAt'],_0x807200[_0x1e4190][_0xccdf('0x4f')])){manager[_0xccdf('0x54')](_0x1e4190,_0x807200[_0x1e4190][_0xccdf('0x4b')],handleJob(_0x807200[_0x1e4190]));logger['info'](_0xccdf('0x55'),_0x807200[_0x1e4190]['name'],_0x807200[_0x1e4190]['cron']);}else{manager['stop'](_0x1e4190);manager[_0xccdf('0x52')](_0x1e4190);logger[_0xccdf('0xa')](_0xccdf('0x53'),_0x807200[_0x1e4190][_0xccdf('0x11')],_0x807200[_0x1e4190][_0xccdf('0x4b')]);}}}})['catch'](function(_0x33fdf7){logger['error'](JSON[_0xccdf('0x24')](_0x33fdf7));});}exports[_0xccdf('0x56')]=function(_0x174c30){return getJobs(_0x174c30);};exports[_0xccdf('0x57')]=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 35e67fd..908ffb2 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 _0xbd20=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','sentimentAccountId','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','update','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','Cloud\x20Provider\x20not\x20available','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','inspect','start','lodash','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','info','format'];(function(_0xacd3ea,_0x40ff5a){var _0x51f070=function(_0x4c0a59){while(--_0x4c0a59){_0xacd3ea['push'](_0xacd3ea['shift']());}};_0x51f070(++_0x40ff5a);}(_0xbd20,0x14a));var _0x0bd2=function(_0x39d980,_0x15c127){_0x39d980=_0x39d980-0x0;var _0x33fcbc=_0xbd20[_0x39d980];return _0x33fcbc;};var _=require(_0x0bd2('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0x0bd2('0x1'));var BPromise=require(_0x0bd2('0x2'));var db=require(_0x0bd2('0x3'))['db'];var logger=require(_0x0bd2('0x4'))(_0x0bd2('0x5'));function getTranscriptionJob(_0x5d701d,_0x231f0d,_0x1dc728,_0x1fcf74){return new Promise(function(_0x550f03,_0xe39613){var _0x45b631=new AWS['TranscribeService']({'accessKeyId':_0x231f0d,'secretAccessKey':_0x5d701d,'region':_0x1dc728});_0x45b631['getTranscriptionJob']({'TranscriptionJobName':_0x1fcf74},function(_0x377853,_0x29335c){if(_0x377853){return _0xe39613(_0x377853);}else{return _0x550f03(_0x29335c);}});});}function sentiment(_0x3d1092,_0xefa2ed,_0x473068,_0x4a0a29,_0x4c5ae4){return new Promise(function(_0x3168c6,_0x28210c){var _0x44d6f6=new AWS[(_0x0bd2('0x6'))]({'accessKeyId':_0xefa2ed,'secretAccessKey':_0x3d1092,'region':_0x473068});_0x44d6f6[_0x0bd2('0x7')]({'Text':_0x4a0a29,'LanguageCode':_0x4c5ae4['substring'](0x0,0x2)},function(_0x11e117,_0x4ff199){if(_0x11e117){return _0x28210c(_0x11e117);}else{return _0x3168c6(_0x4ff199);}});});}function checkTranscribeJob(_0x196a05,_0x20571b,_0x4c6b99){var _0x5f0205;return new BPromise(function(_0x2ca03f,_0x453ddb){logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0xa'),_0x196a05['id'],_0x196a05['transcribeName']));return getTranscriptionJob(_0x4c6b99['data1'],_0x4c6b99[_0x0bd2('0xb')],_0x20571b[_0x0bd2('0xc')],_0x196a05['transcribeName'])[_0x0bd2('0xd')](function(_0xd988bb){logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0xe'),_0x196a05['id'],_0x196a05[_0x0bd2('0xf')],_0xd988bb[_0x0bd2('0x10')]['TranscriptionJobStatus']));if(!_0x196a05['fileText']){switch(_0xd988bb[_0x0bd2('0x10')][_0x0bd2('0x11')]){case _0x0bd2('0x12'):var _0x51ddd8={'transcribeStatus':_0xd988bb[_0x0bd2('0x10')]['TranscriptionJobStatus'],'fileUri':_0xd988bb[_0x0bd2('0x10')]['Transcript'][_0x0bd2('0x13')]};logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x196a05['id']));return rp({'uri':_0xd988bb[_0x0bd2('0x10')][_0x0bd2('0x14')][_0x0bd2('0x13')],'json':!![]})[_0x0bd2('0xd')](function(_0xff78ae){logger['info'](util[_0x0bd2('0x9')](_0x0bd2('0x15'),_0x196a05['id']));if(_0xff78ae&&_0xff78ae[_0x0bd2('0x16')]&&_0xff78ae[_0x0bd2('0x16')][_0x0bd2('0x17')]&&_0xff78ae[_0x0bd2('0x16')][_0x0bd2('0x17')][_0x0bd2('0x18')]){_0x51ddd8[_0x0bd2('0x19')]='';for(var _0x272d93=0x0;_0x272d93<_0xff78ae[_0x0bd2('0x16')][_0x0bd2('0x17')][_0x0bd2('0x18')];_0x272d93++){_0x51ddd8[_0x0bd2('0x19')]+=_0xff78ae[_0x0bd2('0x16')][_0x0bd2('0x17')][_0x272d93][_0x0bd2('0x1a')]+'';}}return _0x196a05['update'](_0x51ddd8);})['then'](function(){logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x1b'),_0x196a05['id']));if(!_0x196a05[_0x0bd2('0x1c')]){throw new db[(_0x0bd2('0x1d'))][(_0x0bd2('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x20571b[_0x0bd2('0x1f')]||!_0x20571b['sentimentAccountId']||!_0x20571b[_0x0bd2('0x20')]||!_0x20571b['language']||!_0x20571b[_0x0bd2('0x21')]){throw new db['Sequelize'][(_0x0bd2('0x1e'))](_0x0bd2('0x22'));}if(!_0x51ddd8['fileText']){throw new Error(_0x0bd2('0x23'));}if(_0x20571b['sentimentAccountId']===_0x4c6b99['id']){return _0x4c6b99;}else{return db['CloudProvider'][_0x0bd2('0x24')]({'where':{'id':_settings[_0x0bd2('0x25')]}});}})[_0x0bd2('0xd')](function(_0x47b963){if(!_0x47b963){throw new db[(_0x0bd2('0x1d'))][(_0x0bd2('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x47b963[_0x0bd2('0x26')]||!_0x47b963[_0x0bd2('0xb')]){throw new db[(_0x0bd2('0x1d'))]['ValidationError'](_0x0bd2('0x27'));}_0x5f0205=_0x47b963;logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x28'),_0x196a05['id']));return sentiment(_0x5f0205[_0x0bd2('0x26')],_0x5f0205['data2'],_0x20571b[_0x0bd2('0x20')],_0x51ddd8['fileText'],_0x20571b[_0x0bd2('0x29')]);})[_0x0bd2('0xd')](function(_0x2cee45){logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x2a'),_0x196a05['id']));return _0x196a05['update']({'sentiment':_0x2cee45[_0x0bd2('0x2b')],'sPositive':_0x2cee45[_0x0bd2('0x2c')][_0x0bd2('0x2d')],'sNegative':_0x2cee45['SentimentScore']['Negative'],'sMixed':_0x2cee45[_0x0bd2('0x2c')][_0x0bd2('0x2e')],'sNeutral':_0x2cee45[_0x0bd2('0x2c')][_0x0bd2('0x2f')]});})['then'](function(){logger['info'](util[_0x0bd2('0x9')](_0x0bd2('0x1b'),_0x196a05['id']));_0x2ca03f();});case'FAILED':return _0x196a05[_0x0bd2('0x30')]({'transcribeStatus':_0x0bd2('0x31'),'failureReason':_0xd988bb[_0x0bd2('0x10')][_0x0bd2('0x32')]})[_0x0bd2('0xd')](function(){logger[_0x0bd2('0x8')](util['format'](_0x0bd2('0x1b'),_0x196a05['id']));_0x2ca03f();});default:logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x33'),_0x196a05['id']));break;}}else{return BPromise[_0x0bd2('0x34')]()[_0x0bd2('0xd')](function(){if(!_0x196a05[_0x0bd2('0x1c')]){throw new db[(_0x0bd2('0x1d'))][(_0x0bd2('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x20571b[_0x0bd2('0x1f')]||!_0x20571b[_0x0bd2('0x25')]||!_0x20571b[_0x0bd2('0x20')]||!_0x20571b['language']||!_0x20571b[_0x0bd2('0x21')]){throw new db[(_0x0bd2('0x1d'))][(_0x0bd2('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x196a05[_0x0bd2('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x20571b[_0x0bd2('0x25')]===_0x4c6b99['id']){return _0x4c6b99;}else{return db[_0x0bd2('0x35')][_0x0bd2('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x552ece){if(!_0x552ece){throw new db[(_0x0bd2('0x1d'))]['ValidationError'](_0x0bd2('0x36'));}if(!_0x552ece[_0x0bd2('0x26')]||!_0x552ece[_0x0bd2('0xb')]){throw new db[(_0x0bd2('0x1d'))][(_0x0bd2('0x1e'))](_0x0bd2('0x27'));}_0x5f0205=_0x552ece;logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x28'),_0x196a05['id']));return sentiment(_0x5f0205[_0x0bd2('0x26')],_0x5f0205[_0x0bd2('0xb')],_0x20571b[_0x0bd2('0x20')],_0x196a05[_0x0bd2('0x19')],_0x20571b[_0x0bd2('0x29')]);})[_0x0bd2('0xd')](function(_0x38ea4d){logger[_0x0bd2('0x8')](util[_0x0bd2('0x9')](_0x0bd2('0x2a'),_0x196a05['id']));return _0x196a05[_0x0bd2('0x30')]({'sentiment':_0x38ea4d['Sentiment'],'sPositive':_0x38ea4d[_0x0bd2('0x2c')][_0x0bd2('0x2d')],'sNegative':_0x38ea4d['SentimentScore']['Negative'],'sMixed':_0x38ea4d['SentimentScore'][_0x0bd2('0x2e')],'sNeutral':_0x38ea4d[_0x0bd2('0x2c')][_0x0bd2('0x2f')],'transcribeStatus':_0x0bd2('0x12')});})[_0x0bd2('0xd')](function(){logger[_0x0bd2('0x8')](util['format'](_0x0bd2('0x1b'),_0x196a05['id']));_0x2ca03f();});}})[_0x0bd2('0x37')](function(_0x2f99ba){if(_0x2f99ba){if(!_0x2f99ba[_0x0bd2('0x38')]||_0x2f99ba['name']!=='SequelizeValidationError'){logger[_0x0bd2('0x39')](util[_0x0bd2('0x9')](_0x0bd2('0x3a'),_0x196a05['id']),util['inspect'](_0x2f99ba,{'showHidden':![],'depth':null}));}}_0x2ca03f();});});}function checkTranscribe(){var _0x270b19;var _0x2c9871;var _0x3eac12;return db['VoiceRecording'][_0x0bd2('0x3b')]({'where':{'transcribeStatus':_0x0bd2('0x3c')}})[_0x0bd2('0xd')](function(_0x1c6cfb){if(!_0x1c6cfb||!_0x1c6cfb['length']){throw new db['Sequelize'][(_0x0bd2('0x1e'))](_0x0bd2('0x3d'));}_0x270b19=_0x1c6cfb;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x0bd2('0xd')](function(_0x49c69e){if(!_0x49c69e){throw new db['Sequelize'][(_0x0bd2('0x1e'))](_0x0bd2('0x3e'));}_0x2c9871=_0x49c69e;if(!_0x2c9871[_0x0bd2('0x5')]||!_0x2c9871[_0x0bd2('0x3f')]||!_0x2c9871[_0x0bd2('0xc')]||!_0x2c9871['language']||!_0x2c9871[_0x0bd2('0x21')]){throw new db[(_0x0bd2('0x1d'))]['ValidationError'](_0x0bd2('0x40'));}return db[_0x0bd2('0x35')][_0x0bd2('0x24')]({'where':{'id':_0x2c9871[_0x0bd2('0x3f')]}});})[_0x0bd2('0xd')](function(_0x30f9c9){if(!_0x30f9c9){throw new db['Sequelize'][(_0x0bd2('0x1e'))](_0x0bd2('0x36'));}if(!_0x30f9c9[_0x0bd2('0x26')]||!_0x30f9c9['data2']){throw new db[(_0x0bd2('0x1d'))]['ValidationError'](_0x0bd2('0x27'));}_0x3eac12=_0x30f9c9;var _0xab3d81=[];_0x270b19['forEach'](function(_0x37ef58){_0xab3d81[_0x0bd2('0x41')](checkTranscribeJob(_0x37ef58,_0x2c9871,_0x3eac12));});return BPromise['all'](_0xab3d81);})[_0x0bd2('0x37')](function(_0x36638c){if(_0x36638c){if(!_0x36638c['name']||_0x36638c[_0x0bd2('0x38')]!=='SequelizeValidationError'){logger[_0x0bd2('0x39')](util[_0x0bd2('0x42')](_0x36638c,{'showHidden':![],'depth':null}));}}});}exports[_0x0bd2('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x88a6=['Transcript\x20not\x20available','CloudProvider','findOne','Mixed','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeName','then','info','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','FAILED','FailureReason','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested'];(function(_0xe778de,_0x5ddc3b){var _0x2cda96=function(_0x553554){while(--_0x553554){_0xe778de['push'](_0xe778de['shift']());}};_0x2cda96(++_0x5ddc3b);}(_0x88a6,0x121));var _0x688a=function(_0x48e86c,_0x9f034d){_0x48e86c=_0x48e86c-0x0;var _0x54fa11=_0x88a6[_0x48e86c];return _0x54fa11;};var _=require('lodash');var AWS=require(_0x688a('0x0'));var rp=require(_0x688a('0x1'));var util=require('util');var BPromise=require(_0x688a('0x2'));var db=require(_0x688a('0x3'))['db'];var logger=require(_0x688a('0x4'))(_0x688a('0x5'));function getTranscriptionJob(_0x5bce1e,_0x531707,_0x429e8b,_0x4d6d79){return new Promise(function(_0x1743a3,_0x357896){var _0x138295=new AWS[(_0x688a('0x6'))]({'accessKeyId':_0x531707,'secretAccessKey':_0x5bce1e,'region':_0x429e8b});_0x138295['getTranscriptionJob']({'TranscriptionJobName':_0x4d6d79},function(_0xef723,_0x18a20b){if(_0xef723){return _0x357896(_0xef723);}else{return _0x1743a3(_0x18a20b);}});});}function sentiment(_0x5af0c2,_0x408503,_0x279aa4,_0x1290f0,_0x3c359c){return new Promise(function(_0x33aae3,_0x2b6a6b){var _0x374ca4=new AWS[(_0x688a('0x7'))]({'accessKeyId':_0x408503,'secretAccessKey':_0x5af0c2,'region':_0x279aa4});_0x374ca4['detectSentiment']({'Text':_0x1290f0,'LanguageCode':_0x3c359c['substring'](0x0,0x2)},function(_0x153c93,_0x416944){if(_0x153c93){return _0x2b6a6b(_0x153c93);}else{return _0x33aae3(_0x416944);}});});}function checkTranscribeJob(_0x330f51,_0x25736b,_0x1d053f){var _0x59f479;return new BPromise(function(_0x219729,_0x4ab26a){logger['info'](util[_0x688a('0x8')](_0x688a('0x9'),_0x330f51['id'],_0x330f51['transcribeName']));return getTranscriptionJob(_0x1d053f[_0x688a('0xa')],_0x1d053f[_0x688a('0xb')],_0x25736b['transcribeRegion'],_0x330f51[_0x688a('0xc')])[_0x688a('0xd')](function(_0x1e1c97){logger[_0x688a('0xe')](util[_0x688a('0x8')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x330f51['id'],_0x330f51[_0x688a('0xc')],_0x1e1c97[_0x688a('0xf')]['TranscriptionJobStatus']));if(!_0x330f51[_0x688a('0x10')]){switch(_0x1e1c97['TranscriptionJob'][_0x688a('0x11')]){case _0x688a('0x12'):var _0x52c536={'transcribeStatus':_0x1e1c97[_0x688a('0xf')][_0x688a('0x11')],'fileUri':_0x1e1c97[_0x688a('0xf')]['Transcript'][_0x688a('0x13')]};logger[_0x688a('0xe')](util['format'](_0x688a('0x14'),_0x330f51['id']));return rp({'uri':_0x1e1c97['TranscriptionJob']['Transcript'][_0x688a('0x13')],'json':!![]})[_0x688a('0xd')](function(_0x2c5ef6){logger[_0x688a('0xe')](util[_0x688a('0x8')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x330f51['id']));if(_0x2c5ef6&&_0x2c5ef6['results']&&_0x2c5ef6[_0x688a('0x15')][_0x688a('0x16')]&&_0x2c5ef6[_0x688a('0x15')]['transcripts'][_0x688a('0x17')]){_0x52c536[_0x688a('0x10')]='';for(var _0x2bb9b8=0x0;_0x2bb9b8<_0x2c5ef6[_0x688a('0x15')][_0x688a('0x16')]['length'];_0x2bb9b8++){_0x52c536[_0x688a('0x10')]+=_0x2c5ef6[_0x688a('0x15')][_0x688a('0x16')][_0x2bb9b8]['transcript']+'';}}return _0x330f51[_0x688a('0x18')](_0x52c536);})['then'](function(){logger[_0x688a('0xe')](util[_0x688a('0x8')](_0x688a('0x19'),_0x330f51['id']));if(!_0x330f51['tempSentiment']){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x25736b[_0x688a('0x1c')]||!_0x25736b[_0x688a('0x1d')]||!_0x25736b[_0x688a('0x1e')]||!_0x25736b['language']||!_0x25736b[_0x688a('0x1f')]){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x20'));}if(!_0x52c536[_0x688a('0x10')]){throw new Error('Transcript\x20not\x20available');}if(_0x25736b['sentimentAccountId']===_0x1d053f['id']){return _0x1d053f;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x688a('0x1d')]}});}})[_0x688a('0xd')](function(_0x491771){if(!_0x491771){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x21'));}if(!_0x491771[_0x688a('0xa')]||!_0x491771[_0x688a('0xb')]){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x22'));}_0x59f479=_0x491771;logger[_0x688a('0xe')](util[_0x688a('0x8')](_0x688a('0x23'),_0x330f51['id']));return sentiment(_0x59f479[_0x688a('0xa')],_0x59f479[_0x688a('0xb')],_0x25736b['sentimentRegion'],_0x52c536[_0x688a('0x10')],_0x25736b[_0x688a('0x24')]);})[_0x688a('0xd')](function(_0x5a42b5){logger[_0x688a('0xe')](util[_0x688a('0x8')](_0x688a('0x25'),_0x330f51['id']));return _0x330f51[_0x688a('0x18')]({'sentiment':_0x5a42b5[_0x688a('0x26')],'sPositive':_0x5a42b5[_0x688a('0x27')][_0x688a('0x28')],'sNegative':_0x5a42b5['SentimentScore']['Negative'],'sMixed':_0x5a42b5[_0x688a('0x27')]['Mixed'],'sNeutral':_0x5a42b5[_0x688a('0x27')]['Neutral']});})['then'](function(){logger[_0x688a('0xe')](util[_0x688a('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x330f51['id']));_0x219729();});case _0x688a('0x29'):return _0x330f51[_0x688a('0x18')]({'transcribeStatus':_0x688a('0x29'),'failureReason':_0x1e1c97[_0x688a('0xf')][_0x688a('0x2a')]})['then'](function(){logger[_0x688a('0xe')](util[_0x688a('0x8')](_0x688a('0x19'),_0x330f51['id']));_0x219729();});default:logger[_0x688a('0xe')](util[_0x688a('0x8')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x330f51['id']));break;}}else{return BPromise[_0x688a('0x2b')]()[_0x688a('0xd')](function(){if(!_0x330f51[_0x688a('0x2c')]){throw new db[(_0x688a('0x1a'))]['ValidationError'](_0x688a('0x2d'));}if(!_0x25736b[_0x688a('0x1c')]||!_0x25736b['sentimentAccountId']||!_0x25736b[_0x688a('0x1e')]||!_0x25736b[_0x688a('0x24')]||!_0x25736b[_0x688a('0x1f')]){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x330f51['fileText']){throw new Error(_0x688a('0x2e'));}if(_0x25736b['sentimentAccountId']===_0x1d053f['id']){return _0x1d053f;}else{return db[_0x688a('0x2f')][_0x688a('0x30')]({'where':{'id':_settings[_0x688a('0x1d')]}});}})[_0x688a('0xd')](function(_0x899fc5){if(!_0x899fc5){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x21'));}if(!_0x899fc5['data1']||!_0x899fc5[_0x688a('0xb')]){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))]('Cloud\x20Provider\x20not\x20configured');}_0x59f479=_0x899fc5;logger[_0x688a('0xe')](util['format'](_0x688a('0x23'),_0x330f51['id']));return sentiment(_0x59f479[_0x688a('0xa')],_0x59f479[_0x688a('0xb')],_0x25736b['sentimentRegion'],_0x330f51[_0x688a('0x10')],_0x25736b[_0x688a('0x24')]);})[_0x688a('0xd')](function(_0x32056d){logger[_0x688a('0xe')](util[_0x688a('0x8')](_0x688a('0x25'),_0x330f51['id']));return _0x330f51[_0x688a('0x18')]({'sentiment':_0x32056d[_0x688a('0x26')],'sPositive':_0x32056d[_0x688a('0x27')]['Positive'],'sNegative':_0x32056d[_0x688a('0x27')]['Negative'],'sMixed':_0x32056d['SentimentScore'][_0x688a('0x31')],'sNeutral':_0x32056d[_0x688a('0x27')][_0x688a('0x32')],'transcribeStatus':_0x688a('0x12')});})[_0x688a('0xd')](function(){logger['info'](util['format'](_0x688a('0x19'),_0x330f51['id']));_0x219729();});}})[_0x688a('0x33')](function(_0x26c627){if(_0x26c627){if(!_0x26c627[_0x688a('0x34')]||_0x26c627[_0x688a('0x34')]!==_0x688a('0x35')){logger[_0x688a('0x36')](util[_0x688a('0x8')](_0x688a('0x37'),_0x330f51['id']),util[_0x688a('0x38')](_0x26c627,{'showHidden':![],'depth':null}));}}_0x219729();});});}function checkTranscribe(){var _0x2913e9;var _0x49b158;var _0x1814e5;return db[_0x688a('0x39')]['findAll']({'where':{'transcribeStatus':_0x688a('0x3a')}})['then'](function(_0x1aa3b4){if(!_0x1aa3b4||!_0x1aa3b4[_0x688a('0x17')]){throw new db['Sequelize'][(_0x688a('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x2913e9=_0x1aa3b4;return db['Setting'][_0x688a('0x30')]({'where':{'id':0x1}});})[_0x688a('0xd')](function(_0x5f5382){if(!_0x5f5382){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x3b'));}_0x49b158=_0x5f5382;if(!_0x49b158[_0x688a('0x5')]||!_0x49b158[_0x688a('0x3c')]||!_0x49b158[_0x688a('0x3d')]||!_0x49b158[_0x688a('0x24')]||!_0x49b158[_0x688a('0x1f')]){throw new db[(_0x688a('0x1a'))]['ValidationError'](_0x688a('0x3e'));}return db[_0x688a('0x2f')]['findOne']({'where':{'id':_0x49b158['transcribeAccountId']}});})[_0x688a('0xd')](function(_0x5a436a){if(!_0x5a436a){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x21'));}if(!_0x5a436a[_0x688a('0xa')]||!_0x5a436a['data2']){throw new db[(_0x688a('0x1a'))][(_0x688a('0x1b'))](_0x688a('0x22'));}_0x1814e5=_0x5a436a;var _0x1fb951=[];_0x2913e9[_0x688a('0x3f')](function(_0xcb924a){_0x1fb951[_0x688a('0x40')](checkTranscribeJob(_0xcb924a,_0x49b158,_0x1814e5));});return BPromise[_0x688a('0x41')](_0x1fb951);})[_0x688a('0x33')](function(_0x48b84e){if(_0x48b84e){if(!_0x48b84e[_0x688a('0x34')]||_0x48b84e['name']!=='SequelizeValidationError'){logger[_0x688a('0x36')](util['inspect'](_0x48b84e,{'showHidden':![],'depth':null}));}}});}exports[_0x688a('0x42')]=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 2c0cf26..b2d7cfb 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 _0x7c7e=['lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7c7e,0x15f));var _0xe7c7=function(_0x502834,_0x7e96e5){_0x502834=_0x502834-0x0;var _0x22e859=_0x7c7e[_0x502834];return _0x22e859;};'use strict';var _=require(_0xe7c7('0x0'));var moment=require(_0xe7c7('0x1'));var Redis=require(_0xe7c7('0x2'));var util=require(_0xe7c7('0x3'));var config=require(_0xe7c7('0x4'));var db=require(_0xe7c7('0x5'))['db'];var logger=require(_0xe7c7('0x6'))(_0xe7c7('0x7'));config['redis']=_[_0xe7c7('0x8')](config[_0xe7c7('0x9')],{'host':_0xe7c7('0xa'),'port':0x18eb});var io=require(_0xe7c7('0xb'))(new Redis(config[_0xe7c7('0x9')]));function closeInteractions(){var _0x222f98=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xe7c7('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xe7c7('0xd'))}}})[_0xe7c7('0xe')](function(_0x59193a){if(_0x59193a&&_0x59193a[_0xe7c7('0xf')]){_0x222f98=_[_0xe7c7('0x10')](_0x59193a||[],'id');logger[_0xe7c7('0x11')](_0xe7c7('0x12'),_0x222f98[_0xe7c7('0x13')]());return db[_0xe7c7('0x14')][_0xe7c7('0x15')]({'closeReason':_0xe7c7('0x16'),'disposition':_0xe7c7('0x17'),'closed':!![],'closedAt':moment()[_0xe7c7('0x18')](_0xe7c7('0x19'))},{'where':{'id':_0x222f98}});}})[_0xe7c7('0xe')](function(){if(_0x222f98&&_0x222f98['length']){logger[_0xe7c7('0x11')](_0xe7c7('0x1a'),_0x222f98[_0xe7c7('0x13')]());for(var _0x2321c8=0x0;_0x2321c8<_0x222f98['length'];_0x2321c8++){io[_0xe7c7('0x1b')](_0xe7c7('0x1c'),{'id':_0x222f98[_0x2321c8],'closed':!![]});}}})[_0xe7c7('0x1d')](function(_0x56cd09){logger[_0xe7c7('0x1e')](_0xe7c7('0x1f'),_0x56cd09?util['inspect'](_0x56cd09,{'showHidden':![],'depth':null}):'');});}exports[_0xe7c7('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xab49=['findAll','lastMsgAt','subtract','hours','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','info','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x4d5c05,_0x527223){var _0x3819f3=function(_0x466c3e){while(--_0x466c3e){_0x4d5c05['push'](_0x4d5c05['shift']());}};_0x3819f3(++_0x527223);}(_0xab49,0xdd));var _0x9ab4=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0xab49[_0x4ec7f2];return _0x118004;};'use strict';var _=require(_0x9ab4('0x0'));var moment=require(_0x9ab4('0x1'));var Redis=require('ioredis');var util=require(_0x9ab4('0x2'));var config=require(_0x9ab4('0x3'));var db=require(_0x9ab4('0x4'))['db'];var logger=require(_0x9ab4('0x5'))('schedule');config[_0x9ab4('0x6')]=_[_0x9ab4('0x7')](config['redis'],{'host':_0x9ab4('0x8'),'port':0x18eb});var io=require(_0x9ab4('0x9'))(new Redis(config[_0x9ab4('0x6')]));function closeInteractions(){var _0x404a8e=[];return db[_0x9ab4('0xa')][_0x9ab4('0xb')]({'raw':!![],'attributes':['id',_0x9ab4('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9ab4('0xd')](0x18,_0x9ab4('0xe'))}}})[_0x9ab4('0xf')](function(_0x4694cc){if(_0x4694cc&&_0x4694cc[_0x9ab4('0x10')]){_0x404a8e=_['map'](_0x4694cc||[],'id');logger['info'](_0x9ab4('0x11'),_0x404a8e[_0x9ab4('0x12')]());return db['WhatsappInteraction']['update']({'closeReason':_0x9ab4('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9ab4('0x14')](_0x9ab4('0x15'))},{'where':{'id':_0x404a8e}});}})[_0x9ab4('0xf')](function(){if(_0x404a8e&&_0x404a8e[_0x9ab4('0x10')]){logger[_0x9ab4('0x16')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x404a8e[_0x9ab4('0x12')]());for(var _0x19d47d=0x0;_0x19d47d<_0x404a8e[_0x9ab4('0x10')];_0x19d47d++){io[_0x9ab4('0x17')](_0x9ab4('0x18'),{'id':_0x404a8e[_0x19d47d],'closed':!![]});}}})[_0x9ab4('0x19')](function(_0x383a42){logger['error'](_0x9ab4('0x1a'),_0x383a42?util[_0x9ab4('0x1b')](_0x383a42,{'showHidden':![],'depth':null}):'');});}exports[_0x9ab4('0x1c')]=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 59db5dd..f44592f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf379=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf379,0xfe));var _0x9f37=function(_0x13171a,_0x11ffff){_0x13171a=_0x13171a-0x0;var _0xc9f60c=_0xf379[_0x13171a];return _0xc9f60c;};'use strict';var util=require(_0x9f37('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9f37('0x1')]({'id':i,'firstName':_0x9f37('0x2')+i,'lastName':_0x9f37('0x3')+i,'phone':0xf879fb460+i,'email':_0x9f37('0x4')+i+_0x9f37('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x9f37('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9f37('0x6')](),'updatedAt':Date[_0x9f37('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9f37('0x1')]({'id':i,'firstName':_0x9f37('0x2')+i,'lastName':_0x9f37('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x9f37('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x9f37('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9f37('0x6')](),'updatedAt':Date['now']()});}db[_0x9f37('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0x9f37('0x7')]['bulkCreate'](contacts);})[_0x9f37('0x8')](function(){console[_0x9f37('0x9')](_0x9f37('0xa'),_0x9f37('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0x9f37('0x8')](function(){return db[_0x9f37('0xc')][_0x9f37('0xd')](hopper);})['then'](function(){console['log']('finished\x20populating',_0x9f37('0xe'));return db[_0x9f37('0x7')]['bulkCreate'](contacts2);})[_0x9f37('0x8')](function(){console[_0x9f37('0x9')]('finished\x20populating',_0x9f37('0xf'));return db['CmHopper'][_0x9f37('0xd')](hopper2);})[_0x9f37('0x8')](function(){console['log'](_0x9f37('0xa'),_0x9f37('0x10'));})['catch'](function(_0x53c6cb){console[_0x9f37('0x9')](_0x53c6cb);}); \ No newline at end of file +var _0x4113=['now','CmContact','then','finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','log','contacts2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com'];(function(_0x416326,_0xd2abb0){var _0xa70bf5=function(_0x2a2d1b){while(--_0x2a2d1b){_0x416326['push'](_0x416326['shift']());}};_0xa70bf5(++_0xd2abb0);}(_0x4113,0x7a));var _0x3411=function(_0x3622ea,_0x4d6955){_0x3622ea=_0x3622ea-0x0;var _0x51debf=_0x4113[_0x3622ea];return _0x51debf;};'use strict';var util=require(_0x3411('0x0'));var db=require(_0x3411('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3411('0x2')]({'id':i,'firstName':_0x3411('0x3')+i,'lastName':_0x3411('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x3411('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x3411('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3411('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3411('0x2')]({'id':i,'firstName':_0x3411('0x3')+i,'lastName':_0x3411('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x3411('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3411('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3411('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3411('0x6')](),'updatedAt':Date['now']()});}db[_0x3411('0x7')]['destroy']({'where':{}})[_0x3411('0x8')](function(){return db[_0x3411('0x7')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x3411('0x9'),_0x3411('0xa'));return db[_0x3411('0xb')][_0x3411('0xc')]({'where':{}});})[_0x3411('0x8')](function(){return db[_0x3411('0xb')][_0x3411('0xd')](hopper);})[_0x3411('0x8')](function(){console['log'](_0x3411('0x9'),'hopper1');return db[_0x3411('0x7')][_0x3411('0xd')](contacts2);})['then'](function(){console[_0x3411('0xe')](_0x3411('0x9'),_0x3411('0xf'));return db[_0x3411('0xb')]['bulkCreate'](hopper2);})[_0x3411('0x8')](function(){console[_0x3411('0xe')](_0x3411('0x9'),'hopper2');})['catch'](function(_0x5e3ce2){console['log'](_0x5e3ce2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0975d11..9c31cff 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa889=['push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','then','add\x20user','catch','log','util','../mysqldb'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xa889,0x1a2));var _0x9a88=function(_0x8a4aca,_0x7f0f91){_0x8a4aca=_0x8a4aca-0x0;var _0x3d2064=_0xa889[_0x8a4aca];return _0x3d2064;};'use strict';var util=require(_0x9a88('0x0'));var db=require(_0x9a88('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9a88('0x2')]({'name':util[_0x9a88('0x3')](_0x9a88('0x4'),_0x9a88('0x5'),i),'fullname':util[_0x9a88('0x3')](_0x9a88('0x4'),_0x9a88('0x5'),i),'email':util[_0x9a88('0x3')](_0x9a88('0x6'),_0x9a88('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x9a88('0x7'),'transport':[_0x9a88('0x8'),'ws',_0x9a88('0x9')],'disallow':['all'],'allow':[_0x9a88('0xa')],'defaultuser':util['format']('%s%s',_0x9a88('0x5'),i),'encryption':_0x9a88('0xb'),'avpf':_0x9a88('0xb'),'force_avp':_0x9a88('0xb'),'icesupport':_0x9a88('0xb'),'dtlsenable':_0x9a88('0xb'),'dtlsverify':'no','dtlscertfile':_0x9a88('0xc'),'dtlsprivatekey':_0x9a88('0xd'),'dtlssetup':_0x9a88('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x9a88('0x4'),_0x9a88('0x5'),i),0xfa0+i)});}db[_0x9a88('0xf')]['bulkCreate'](users)[_0x9a88('0x10')](function(){console['log'](_0x9a88('0x11'));})[_0x9a88('0x12')](function(_0x339b77){console[_0x9a88('0x13')](_0x339b77);}); \ No newline at end of file +var _0xc145=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','catch','log','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','all'];(function(_0x3b6c11,_0x3ba363){var _0x151214=function(_0x41e608){while(--_0x41e608){_0x3b6c11['push'](_0x3b6c11['shift']());}};_0x151214(++_0x3ba363);}(_0xc145,0x199));var _0x5c14=function(_0x47a46b,_0x2e7d42){_0x47a46b=_0x47a46b-0x0;var _0x1d817c=_0xc145[_0x47a46b];return _0x1d817c;};'use strict';var util=require('util');var db=require(_0x5c14('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5c14('0x1')]({'name':util[_0x5c14('0x2')](_0x5c14('0x3'),_0x5c14('0x4'),i),'fullname':util[_0x5c14('0x2')]('%s%s','agent',i),'email':util['format'](_0x5c14('0x5'),_0x5c14('0x4'),i),'role':_0x5c14('0x4'),'password':'password','internal':0xfa0+i,'type':_0x5c14('0x6'),'transport':[_0x5c14('0x7'),'ws','wss'],'disallow':[_0x5c14('0x8')],'allow':[_0x5c14('0x9')],'defaultuser':util[_0x5c14('0x2')](_0x5c14('0x3'),_0x5c14('0x4'),i),'encryption':_0x5c14('0xa'),'avpf':_0x5c14('0xa'),'force_avp':_0x5c14('0xa'),'icesupport':_0x5c14('0xa'),'dtlsenable':_0x5c14('0xa'),'dtlsverify':'no','dtlscertfile':_0x5c14('0xb'),'dtlsprivatekey':_0x5c14('0xc'),'dtlssetup':'actpass','callerid':util[_0x5c14('0x2')](_0x5c14('0xd'),util['format']('%s%s',_0x5c14('0x4'),i),0xfa0+i)});}db[_0x5c14('0xe')][_0x5c14('0xf')](users)[_0x5c14('0x10')](function(){console['log']('add\x20user');})[_0x5c14('0x11')](function(_0x13d97d){console[_0x5c14('0x12')](_0x13d97d);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 1875672..634d984 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf970=['Campaign','%s:queue:%s','length','format','query','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','voice:inbound','voice:outbound','ChatQueues','OpenchannelQueue','Trunk','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','findOne','then','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','where','role'];(function(_0x393f5f,_0x285391){var _0x1e8256=function(_0x81d325){while(--_0x81d325){_0x393f5f['push'](_0x393f5f['shift']());}};_0x1e8256(++_0x285391);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var BPromise=require(_0x0f97('0x1'));var db=require(_0x0f97('0x2'))['db'];var config=require(_0x0f97('0x3'));var queryQueues={'attributes':['id',_0x0f97('0x4')],'include':[{'as':_0x0f97('0x5'),'model':db[_0x0f97('0x6')],'attributes':['id',_0x0f97('0x4'),'role'],'raw':!![],'where':{'role':_0x0f97('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0f97('0x4')],'where':{'role':_0x0f97('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0f97('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x0f97('0x4')],'where':{'role':_0x0f97('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0f97('0x4'),_0x0f97('0x9')],'where':{'type':_0x0f97('0xa')}};function getAssociatedResources(_0x5598eb,_0x52d08e,_0x12397b){return db['UserProfileSection'][_0x0f97('0xb')]({'where':{'name':_0x5598eb,'userProfileId':_0x52d08e},'raw':!![]})[_0x0f97('0xc')](function(_0xc8aa14){if(_0xc8aa14){if(_0xc8aa14['autoAssociation']){switch(_0x5598eb){case _0x0f97('0xd'):case'ChatQueues':case _0x0f97('0xe'):case _0x0f97('0xf'):case _0x0f97('0x10'):case _0x0f97('0x11'):case _0x0f97('0x12'):return db[_0x12397b]['findAll'](queryQueues);case _0x0f97('0x13'):return db[_0x12397b][_0x0f97('0x14')](queryTelephones);case _0x0f97('0x15'):return db[_0x12397b][_0x0f97('0x14')](queryTrunks);case _0x0f97('0x16'):return db[_0x12397b][_0x0f97('0x14')](queryCampaigns);}}else{return db[_0x0f97('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0xc8aa14['id']},'raw':!![]})[_0x0f97('0xc')](function(_0x2392c0){if(_0x2392c0){var _0x1448f9={'where':{'id':_[_0x0f97('0x18')](_0x2392c0,'resourceId')},'raw':!![]};switch(_0x12397b){case'User':_0x1448f9[_0x0f97('0x19')][_0x0f97('0x1a')]=_0x0f97('0x8');break;case _0x0f97('0x1b'):_0x1448f9[_0x0f97('0x19')][_0x0f97('0x9')]='ivr';break;}return db[_0x12397b]['findAll'](_0x1448f9);}else{return[];}});}}else{return[];}})[_0x0f97('0xc')](function(_0x132d2f){return _0x132d2f;});}function joinOrLeaveQueues(_0x3b547f,_0x425d97,_0x398216,_0x3a91b4){_0x3b547f[_0x425d97](util['format'](_0x0f97('0x1c'),_0x398216,_0x3a91b4[_0x0f97('0x4')]));if(_0x3a91b4[_0x0f97('0x5')]){for(var _0x15376e=0x0;_0x15376e<_0x3a91b4[_0x0f97('0x5')][_0x0f97('0x1d')];_0x15376e+=0x1){_0x3b547f[_0x425d97](util[_0x0f97('0x1e')]('user:%s',_0x3a91b4[_0x0f97('0x5')][_0x15376e][_0x0f97('0x4')]));}}}function joinOrLeave(_0xf2dab8,_0x5c2af0,_0x31d384){var _0x25d1ef;if(_0xf2dab8['handshake'][_0x0f97('0x1f')]['id']){db[_0x0f97('0x6')]['find']({'attributes':['id','name','role',_0x0f97('0x20')],'where':{'id':_0xf2dab8[_0x0f97('0x21')]['query']['id']},'include':[{'model':db[_0x0f97('0x22')],'as':_0x0f97('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x0f97('0x24')],'as':_0x0f97('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x0f97('0x26')],'as':_0x0f97('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x0f97('0x28')],'as':_0x0f97('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x0f97('0x2a')],'as':_0x0f97('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x0f97('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x0f97('0xc')](function(_0x22cc9e){if(_0x22cc9e){_0x25d1ef=_0x22cc9e;_0xf2dab8[_0x5c2af0](util[_0x0f97('0x1e')](_0x0f97('0x2d'),_0x22cc9e[_0x0f97('0x4')]));var _0x29bcf2=[];switch(_0x22cc9e[_0x0f97('0x1a')]){case _0x0f97('0x2e'):_0xf2dab8[_0x5c2af0]('voice:inbound');_0xf2dab8[_0x5c2af0]('voice:outbound');if(queryQueues[_0x0f97('0x2f')](_0x0f97('0x30'))){delete queryQueues[_0x0f97('0x30')];}_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x32')][_0x0f97('0x14')](queryQueues));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x33')][_0x0f97('0x14')](queryQueues));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x34')]['findAll'](queryQueues));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x35')][_0x0f97('0x14')](queryQueues));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x36')]['findAll'](queryQueues));_0x29bcf2[_0x0f97('0x31')](db['OpenchannelQueue'][_0x0f97('0x14')](queryQueues));_0x29bcf2['push'](db[_0x0f97('0x37')][_0x0f97('0x14')](queryQueues));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x6')][_0x0f97('0x14')](queryTelephones));_0x29bcf2['push'](db['Trunk'][_0x0f97('0x14')](queryTrunks));_0x29bcf2[_0x0f97('0x31')](db['Campaign'][_0x0f97('0x14')](queryCampaigns));_0x29bcf2[_0x0f97('0x31')](db[_0x0f97('0x6')][_0x0f97('0x14')](queryAgents));break;case'user':_0xf2dab8[_0x5c2af0](_0x0f97('0x38'));_0xf2dab8[_0x5c2af0](_0x0f97('0x39'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0xd'),_0x22cc9e[_0x0f97('0x20')],'VoiceQueue'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x3a'),_0x22cc9e[_0x0f97('0x20')],_0x0f97('0x33')));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0xe'),_0x22cc9e['userProfileId'],'FaxQueue'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0xf'),_0x22cc9e[_0x0f97('0x20')],'SmsQueue'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x10'),_0x22cc9e[_0x0f97('0x20')],'MailQueue'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x11'),_0x22cc9e[_0x0f97('0x20')],_0x0f97('0x3b')));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x12'),_0x22cc9e[_0x0f97('0x20')],_0x0f97('0x37')));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x13'),_0x22cc9e[_0x0f97('0x20')],'User'));_0x29bcf2[_0x0f97('0x31')](getAssociatedResources(_0x0f97('0x15'),_0x22cc9e['userProfileId'],_0x0f97('0x3c')));_0x29bcf2['push'](getAssociatedResources(_0x0f97('0x16'),_0x22cc9e[_0x0f97('0x20')],_0x0f97('0x1b')));_0x29bcf2['push'](db['User'][_0x0f97('0x14')](queryAgents));break;case _0x0f97('0x7'):_0xf2dab8[_0x5c2af0](_0x0f97('0x38'));_0xf2dab8[_0x5c2af0](_0x0f97('0x39'));_0x29bcf2[_0x0f97('0x31')](_0x22cc9e['getVoiceQueues']({'attributes':['id','name']}));_0x29bcf2[_0x0f97('0x31')](_0x22cc9e[_0x0f97('0x3d')]({'attributes':['id',_0x0f97('0x4')]}));_0x29bcf2[_0x0f97('0x31')](_0x22cc9e[_0x0f97('0x3e')]({'attributes':['id',_0x0f97('0x4')]}));_0x29bcf2[_0x0f97('0x31')](_0x22cc9e[_0x0f97('0x3f')]({'attributes':['id',_0x0f97('0x4')]}));_0x29bcf2['push'](_0x22cc9e[_0x0f97('0x40')]({'attributes':['id','name']}));_0x29bcf2[_0x0f97('0x31')](_0x22cc9e[_0x0f97('0x41')]({'attributes':['id',_0x0f97('0x4')]}));_0x29bcf2['push'](_0x22cc9e['getWhatsappQueues']({'attributes':['id',_0x0f97('0x4')]}));break;}return BPromise[_0x0f97('0x42')](_0x29bcf2);}})[_0x0f97('0xc')](function(_0x4d3649){if(_0x4d3649&&_0x4d3649['length']){for(var _0x546aac=0x0;_0x546aac<_0x4d3649[_0x0f97('0x1d')];_0x546aac+=0x1){for(var _0x3cdbee=0x0;_0x3cdbee<_0x4d3649[_0x546aac][_0x0f97('0x1d')];_0x3cdbee+=0x1){switch(_0x546aac){case 0x0:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x43'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x1:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x44'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x2:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x45'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x3:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x46'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x4:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x47'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x5:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x48'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x6:joinOrLeaveQueues(_0xf2dab8,_0x5c2af0,_0x0f97('0x49'),_0x4d3649[_0x546aac][_0x3cdbee]);break;case 0x7:if(_0x25d1ef[_0x0f97('0x1a')]!=='agent')_0xf2dab8[_0x5c2af0](util[_0x0f97('0x1e')]('telephone:%s',_0x4d3649[_0x546aac][_0x3cdbee]['name']));break;case 0x8:if(_0x25d1ef[_0x0f97('0x1a')]!=='agent')_0xf2dab8[_0x5c2af0](util[_0x0f97('0x1e')](_0x0f97('0x4a'),_0x4d3649[_0x546aac][_0x3cdbee][_0x0f97('0x4')]));break;case 0x9:if(_0x25d1ef[_0x0f97('0x1a')]!==_0x0f97('0x7'))_0xf2dab8[_0x5c2af0](util['format']('campaign:%s:%s',_0x4d3649[_0x546aac][_0x3cdbee][_0x0f97('0x9')],_0x4d3649[_0x546aac][_0x3cdbee][_0x0f97('0x4')]));break;case 0xa:_0xf2dab8[_0x5c2af0](util['format'](_0x0f97('0x2d'),_0x4d3649[_0x546aac][_0x3cdbee][_0x0f97('0x4')]));break;}}}}})[_0x0f97('0xc')](function(){if(_0x5c2af0===_0x0f97('0x4b')){var _0x4c18fe=_[_0x0f97('0x18')](_0x25d1ef[_0x0f97('0x23')],'id');return _0x25d1ef[_0x0f97('0x4c')](_0x4c18fe)[_0x0f97('0xc')](function(){for(var _0x185238=0x0;_0x185238<_0x4c18fe[_0x0f97('0x1d')];_0x185238+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x4e'),{'ChatInteractionId':Number(_0x4c18fe[_0x185238]),'UserId':Number(_0x25d1ef['id'])});}});}})[_0x0f97('0xc')](function(){if(_0x5c2af0===_0x0f97('0x4b')){var _0x29d47b=_[_0x0f97('0x18')](_0x25d1ef[_0x0f97('0x25')],'id');return _0x25d1ef[_0x0f97('0x4f')](_0x29d47b)['then'](function(){for(var _0x1b757a=0x0;_0x1b757a<_0x29d47b['length'];_0x1b757a+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x50'),{'MailInteractionId':Number(_0x29d47b[_0x1b757a]),'UserId':Number(_0x25d1ef['id'])});}});}})[_0x0f97('0xc')](function(){if(_0x5c2af0==='leave'){var _0x327517=_[_0x0f97('0x18')](_0x25d1ef[_0x0f97('0x27')],'id');return _0x25d1ef['removeFaxInteractions'](_0x327517)['then'](function(){for(var _0x5f0f31=0x0;_0x5f0f31<_0x327517['length'];_0x5f0f31+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x51'),{'FaxInteractionId':Number(_0x327517[_0x5f0f31]),'UserId':Number(_0x25d1ef['id'])});}});}})[_0x0f97('0xc')](function(){if(_0x5c2af0==='leave'){var _0x3e4a26=_['map'](_0x25d1ef[_0x0f97('0x29')],'id');return _0x25d1ef[_0x0f97('0x52')](_0x3e4a26)[_0x0f97('0xc')](function(){for(var _0x8410d8=0x0;_0x8410d8<_0x3e4a26[_0x0f97('0x1d')];_0x8410d8+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x53'),{'SmsInteractionId':Number(_0x3e4a26[_0x8410d8]),'UserId':Number(_0x25d1ef['id'])});}});}})[_0x0f97('0xc')](function(){if(_0x5c2af0===_0x0f97('0x4b')){var _0x59a646=_[_0x0f97('0x18')](_0x25d1ef[_0x0f97('0x2b')],'id');return _0x25d1ef[_0x0f97('0x54')](_0x59a646)[_0x0f97('0xc')](function(){for(var _0x46c9f2=0x0;_0x46c9f2<_0x59a646[_0x0f97('0x1d')];_0x46c9f2+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x55'),{'OpenchannelInteractionId':Number(_0x59a646[_0x46c9f2]),'UserId':Number(_0x25d1ef['id'])});}});}})['then'](function(){if(_0x5c2af0===_0x0f97('0x4b')){var _0xddbd8d=_['map'](_0x25d1ef[_0x0f97('0x56')],'id');return _0x25d1ef[_0x0f97('0x57')](_0xddbd8d)[_0x0f97('0xc')](function(){for(var _0x45bbef=0x0;_0x45bbef<_0xddbd8d['length'];_0x45bbef+=0x1){_0x31d384[_0x0f97('0x4d')](_0x0f97('0x58'),{'WhatsappInteractionId':Number(_0xddbd8d[_0x45bbef]),'UserId':Number(_0x25d1ef['id'])});}});}})[_0x0f97('0x59')](function(_0x3e357d){_0xf2dab8[_0x0f97('0x5a')](_0x3e357d);});}}function onDisconnect(_0x27d98c,_0x13ce92){joinOrLeave(_0x27d98c,_0x0f97('0x4b'),_0x13ce92);}function onConnect(_0x155b5b){joinOrLeave(_0x155b5b,_0x0f97('0x5b'));}exports[_0x0f97('0x5c')]=function(_0xeddf70){_0xeddf70['on'](_0x0f97('0x5d'),function(_0x2fa000){_0x2fa000['setMaxListeners'](0x0);_0x2fa000[_0x0f97('0x5e')]=_0x2fa000[_0x0f97('0x5f')][_0x0f97('0x5d')]['remoteAddress']+':'+_0x2fa000['request'][_0x0f97('0x5d')]['remotePort'];_0x2fa000[_0x0f97('0x60')]=new Date();_0x2fa000['log']=function(_0x23bcd8){console['log'](_0x0f97('0x61')+_0x2fa000['nsp'][_0x0f97('0x4')]+'['+_0x2fa000[_0x0f97('0x5e')]+']',_0x23bcd8);};_0x2fa000['on'](_0x0f97('0x62'),function(){onDisconnect(_0x2fa000,_0xeddf70);_0x2fa000[_0x0f97('0x5a')](_0x0f97('0x63'));});onConnect(_0x2fa000);_0x2fa000[_0x0f97('0x5a')]('CONNECTED');});}; \ No newline at end of file +var _0xa329=['voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','user','voice:inbound','VoiceQueues','userProfileId','VoiceQueue','SmsQueues','MailQueues','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','request','connection','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','lodash','util','../mysqldb','name','Agents','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','User','Campaign','type','%s:queue:%s','length','format','user:%s','handshake','find','ChatInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin'];(function(_0x212efa,_0x4a19d2){var _0x14ce4b=function(_0x326243){while(--_0x326243){_0x212efa['push'](_0x212efa['shift']());}};_0x14ce4b(++_0x4a19d2);}(_0xa329,0x162));var _0x9a32=function(_0x2191f2,_0x167882){_0x2191f2=_0x2191f2-0x0;var _0x42b830=_0xa329[_0x2191f2];return _0x42b830;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var BPromise=require('bluebird');var db=require(_0x9a32('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x9a32('0x3')],'include':[{'as':_0x9a32('0x4'),'model':db['User'],'attributes':['id','name',_0x9a32('0x5')],'raw':!![],'where':{'role':_0x9a32('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9a32('0x3')],'where':{'role':_0x9a32('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9a32('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x9a32('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x9a32('0x8')}};function getAssociatedResources(_0x13f03f,_0x4d388c,_0x38f6cc){return db[_0x9a32('0x9')][_0x9a32('0xa')]({'where':{'name':_0x13f03f,'userProfileId':_0x4d388c},'raw':!![]})[_0x9a32('0xb')](function(_0x3e5cda){if(_0x3e5cda){if(_0x3e5cda[_0x9a32('0xc')]){switch(_0x13f03f){case'VoiceQueues':case _0x9a32('0xd'):case _0x9a32('0xe'):case'SmsQueues':case'MailQueues':case _0x9a32('0xf'):case _0x9a32('0x10'):return db[_0x38f6cc]['findAll'](queryQueues);case'Telephones':return db[_0x38f6cc][_0x9a32('0x11')](queryTelephones);case _0x9a32('0x12'):return db[_0x38f6cc][_0x9a32('0x11')](queryTrunks);case _0x9a32('0x13'):return db[_0x38f6cc]['findAll'](queryCampaigns);}}else{return db[_0x9a32('0x14')][_0x9a32('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x3e5cda['id']},'raw':!![]})[_0x9a32('0xb')](function(_0x96a800){if(_0x96a800){var _0x301fab={'where':{'id':_[_0x9a32('0x15')](_0x96a800,_0x9a32('0x16'))},'raw':!![]};switch(_0x38f6cc){case _0x9a32('0x17'):_0x301fab['where'][_0x9a32('0x5')]=_0x9a32('0x7');break;case _0x9a32('0x18'):_0x301fab['where'][_0x9a32('0x19')]=_0x9a32('0x8');break;}return db[_0x38f6cc]['findAll'](_0x301fab);}else{return[];}});}}else{return[];}})['then'](function(_0x3a7a89){return _0x3a7a89;});}function joinOrLeaveQueues(_0x56df79,_0x43c114,_0x42bf59,_0x112e95){_0x56df79[_0x43c114](util['format'](_0x9a32('0x1a'),_0x42bf59,_0x112e95[_0x9a32('0x3')]));if(_0x112e95[_0x9a32('0x4')]){for(var _0x4ca971=0x0;_0x4ca971<_0x112e95[_0x9a32('0x4')][_0x9a32('0x1b')];_0x4ca971+=0x1){_0x56df79[_0x43c114](util[_0x9a32('0x1c')](_0x9a32('0x1d'),_0x112e95[_0x9a32('0x4')][_0x4ca971][_0x9a32('0x3')]));}}}function joinOrLeave(_0x4a8d76,_0x4e6e68,_0x44b3b4){var _0x2cb1ff;if(_0x4a8d76[_0x9a32('0x1e')]['query']['id']){db['User'][_0x9a32('0x1f')]({'attributes':['id',_0x9a32('0x3'),_0x9a32('0x5'),'userProfileId'],'where':{'id':_0x4a8d76['handshake']['query']['id']},'include':[{'model':db[_0x9a32('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9a32('0x21')],'as':_0x9a32('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x9a32('0x23')],'as':_0x9a32('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x9a32('0x25')],'as':_0x9a32('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9a32('0x27')],'as':_0x9a32('0x28'),'attributes':['id'],'raw':!![]}]})[_0x9a32('0xb')](function(_0x35c1be){if(_0x35c1be){_0x2cb1ff=_0x35c1be;_0x4a8d76[_0x4e6e68](util[_0x9a32('0x1c')]('user:%s',_0x35c1be[_0x9a32('0x3')]));var _0x41e975=[];switch(_0x35c1be['role']){case _0x9a32('0x29'):_0x4a8d76[_0x4e6e68]('voice:inbound');_0x4a8d76[_0x4e6e68](_0x9a32('0x2a'));if(queryQueues[_0x9a32('0x2b')](_0x9a32('0x2c'))){delete queryQueues[_0x9a32('0x2c')];}_0x41e975[_0x9a32('0x2d')](db['VoiceQueue'][_0x9a32('0x11')](queryQueues));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x2e')][_0x9a32('0x11')](queryQueues));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x2f')]['findAll'](queryQueues));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x30')][_0x9a32('0x11')](queryQueues));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x31')]['findAll'](queryQueues));_0x41e975[_0x9a32('0x2d')](db['OpenchannelQueue'][_0x9a32('0x11')](queryQueues));_0x41e975['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x41e975['push'](db[_0x9a32('0x17')][_0x9a32('0x11')](queryTelephones));_0x41e975['push'](db[_0x9a32('0x32')][_0x9a32('0x11')](queryTrunks));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x18')][_0x9a32('0x11')](queryCampaigns));_0x41e975['push'](db[_0x9a32('0x17')][_0x9a32('0x11')](queryAgents));break;case _0x9a32('0x33'):_0x4a8d76[_0x4e6e68](_0x9a32('0x34'));_0x4a8d76[_0x4e6e68](_0x9a32('0x2a'));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0x35'),_0x35c1be[_0x9a32('0x36')],_0x9a32('0x37')));_0x41e975['push'](getAssociatedResources(_0x9a32('0xd'),_0x35c1be['userProfileId'],_0x9a32('0x2e')));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0xe'),_0x35c1be[_0x9a32('0x36')],_0x9a32('0x2f')));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0x38'),_0x35c1be[_0x9a32('0x36')],_0x9a32('0x30')));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0x39'),_0x35c1be[_0x9a32('0x36')],'MailQueue'));_0x41e975[_0x9a32('0x2d')](getAssociatedResources('OpenchannelQueues',_0x35c1be[_0x9a32('0x36')],_0x9a32('0x3a')));_0x41e975['push'](getAssociatedResources('WhatsappQueues',_0x35c1be['userProfileId'],_0x9a32('0x3b')));_0x41e975[_0x9a32('0x2d')](getAssociatedResources('Telephones',_0x35c1be[_0x9a32('0x36')],'User'));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0x12'),_0x35c1be[_0x9a32('0x36')],_0x9a32('0x32')));_0x41e975[_0x9a32('0x2d')](getAssociatedResources(_0x9a32('0x13'),_0x35c1be[_0x9a32('0x36')],'Campaign'));_0x41e975[_0x9a32('0x2d')](db[_0x9a32('0x17')][_0x9a32('0x11')](queryAgents));break;case'agent':_0x4a8d76[_0x4e6e68](_0x9a32('0x34'));_0x4a8d76[_0x4e6e68]('voice:outbound');_0x41e975[_0x9a32('0x2d')](_0x35c1be[_0x9a32('0x3c')]({'attributes':['id',_0x9a32('0x3')]}));_0x41e975['push'](_0x35c1be[_0x9a32('0x3d')]({'attributes':['id',_0x9a32('0x3')]}));_0x41e975[_0x9a32('0x2d')](_0x35c1be[_0x9a32('0x3e')]({'attributes':['id',_0x9a32('0x3')]}));_0x41e975[_0x9a32('0x2d')](_0x35c1be[_0x9a32('0x3f')]({'attributes':['id',_0x9a32('0x3')]}));_0x41e975['push'](_0x35c1be[_0x9a32('0x40')]({'attributes':['id','name']}));_0x41e975[_0x9a32('0x2d')](_0x35c1be[_0x9a32('0x41')]({'attributes':['id',_0x9a32('0x3')]}));_0x41e975[_0x9a32('0x2d')](_0x35c1be[_0x9a32('0x42')]({'attributes':['id',_0x9a32('0x3')]}));break;}return BPromise[_0x9a32('0x43')](_0x41e975);}})[_0x9a32('0xb')](function(_0x2a71e6){if(_0x2a71e6&&_0x2a71e6[_0x9a32('0x1b')]){for(var _0x35b7e3=0x0;_0x35b7e3<_0x2a71e6['length'];_0x35b7e3+=0x1){for(var _0x4a20e4=0x0;_0x4a20e4<_0x2a71e6[_0x35b7e3][_0x9a32('0x1b')];_0x4a20e4+=0x1){switch(_0x35b7e3){case 0x0:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,'voice',_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x1:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,_0x9a32('0x44'),_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x2:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,_0x9a32('0x45'),_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x3:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,_0x9a32('0x46'),_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x4:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,_0x9a32('0x47'),_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x5:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,'openchannel',_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x6:joinOrLeaveQueues(_0x4a8d76,_0x4e6e68,_0x9a32('0x48'),_0x2a71e6[_0x35b7e3][_0x4a20e4]);break;case 0x7:if(_0x2cb1ff[_0x9a32('0x5')]!==_0x9a32('0x6'))_0x4a8d76[_0x4e6e68](util[_0x9a32('0x1c')](_0x9a32('0x49'),_0x2a71e6[_0x35b7e3][_0x4a20e4][_0x9a32('0x3')]));break;case 0x8:if(_0x2cb1ff[_0x9a32('0x5')]!==_0x9a32('0x6'))_0x4a8d76[_0x4e6e68](util[_0x9a32('0x1c')]('trunk:%s',_0x2a71e6[_0x35b7e3][_0x4a20e4][_0x9a32('0x3')]));break;case 0x9:if(_0x2cb1ff[_0x9a32('0x5')]!==_0x9a32('0x6'))_0x4a8d76[_0x4e6e68](util[_0x9a32('0x1c')](_0x9a32('0x4a'),_0x2a71e6[_0x35b7e3][_0x4a20e4][_0x9a32('0x19')],_0x2a71e6[_0x35b7e3][_0x4a20e4]['name']));break;case 0xa:_0x4a8d76[_0x4e6e68](util[_0x9a32('0x1c')]('user:%s',_0x2a71e6[_0x35b7e3][_0x4a20e4][_0x9a32('0x3')]));break;}}}}})[_0x9a32('0xb')](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x35c6e8=_[_0x9a32('0x15')](_0x2cb1ff[_0x9a32('0x4c')],'id');return _0x2cb1ff[_0x9a32('0x4d')](_0x35c6e8)[_0x9a32('0xb')](function(){for(var _0x4f4690=0x0;_0x4f4690<_0x35c6e8[_0x9a32('0x1b')];_0x4f4690+=0x1){_0x44b3b4[_0x9a32('0x4e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x35c6e8[_0x4f4690]),'UserId':Number(_0x2cb1ff['id'])});}});}})['then'](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x2ac555=_['map'](_0x2cb1ff[_0x9a32('0x4f')],'id');return _0x2cb1ff[_0x9a32('0x50')](_0x2ac555)[_0x9a32('0xb')](function(){for(var _0x519398=0x0;_0x519398<_0x2ac555[_0x9a32('0x1b')];_0x519398+=0x1){_0x44b3b4[_0x9a32('0x4e')](_0x9a32('0x51'),{'MailInteractionId':Number(_0x2ac555[_0x519398]),'UserId':Number(_0x2cb1ff['id'])});}});}})['then'](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x5c4b72=_['map'](_0x2cb1ff[_0x9a32('0x22')],'id');return _0x2cb1ff[_0x9a32('0x52')](_0x5c4b72)[_0x9a32('0xb')](function(){for(var _0x530d63=0x0;_0x530d63<_0x5c4b72[_0x9a32('0x1b')];_0x530d63+=0x1){_0x44b3b4[_0x9a32('0x4e')](_0x9a32('0x53'),{'FaxInteractionId':Number(_0x5c4b72[_0x530d63]),'UserId':Number(_0x2cb1ff['id'])});}});}})[_0x9a32('0xb')](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x3e0f91=_[_0x9a32('0x15')](_0x2cb1ff[_0x9a32('0x24')],'id');return _0x2cb1ff['removeSmsInteractions'](_0x3e0f91)['then'](function(){for(var _0x5c67c8=0x0;_0x5c67c8<_0x3e0f91[_0x9a32('0x1b')];_0x5c67c8+=0x1){_0x44b3b4[_0x9a32('0x4e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x3e0f91[_0x5c67c8]),'UserId':Number(_0x2cb1ff['id'])});}});}})[_0x9a32('0xb')](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x219296=_[_0x9a32('0x15')](_0x2cb1ff[_0x9a32('0x26')],'id');return _0x2cb1ff[_0x9a32('0x54')](_0x219296)[_0x9a32('0xb')](function(){for(var _0x3aa8cb=0x0;_0x3aa8cb<_0x219296[_0x9a32('0x1b')];_0x3aa8cb+=0x1){_0x44b3b4['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x219296[_0x3aa8cb]),'UserId':Number(_0x2cb1ff['id'])});}});}})[_0x9a32('0xb')](function(){if(_0x4e6e68===_0x9a32('0x4b')){var _0x5a7dbd=_['map'](_0x2cb1ff[_0x9a32('0x28')],'id');return _0x2cb1ff[_0x9a32('0x55')](_0x5a7dbd)[_0x9a32('0xb')](function(){for(var _0x36e7d6=0x0;_0x36e7d6<_0x5a7dbd[_0x9a32('0x1b')];_0x36e7d6+=0x1){_0x44b3b4[_0x9a32('0x4e')](_0x9a32('0x56'),{'WhatsappInteractionId':Number(_0x5a7dbd[_0x36e7d6]),'UserId':Number(_0x2cb1ff['id'])});}});}})['catch'](function(_0x4241c5){_0x4a8d76[_0x9a32('0x57')](_0x4241c5);});}}function onDisconnect(_0x3447d9,_0x35ecaf){joinOrLeave(_0x3447d9,_0x9a32('0x4b'),_0x35ecaf);}function onConnect(_0x17a45a){joinOrLeave(_0x17a45a,_0x9a32('0x58'));}exports[_0x9a32('0x59')]=function(_0xedf6f2){_0xedf6f2['on']('connection',function(_0x2bc700){_0x2bc700[_0x9a32('0x5a')](0x0);_0x2bc700[_0x9a32('0x5b')]=_0x2bc700[_0x9a32('0x5c')][_0x9a32('0x5d')][_0x9a32('0x5e')]+':'+_0x2bc700[_0x9a32('0x5c')][_0x9a32('0x5d')]['remotePort'];_0x2bc700[_0x9a32('0x5f')]=new Date();_0x2bc700[_0x9a32('0x57')]=function(_0x188653){console[_0x9a32('0x57')]('SocketIO\x20'+_0x2bc700[_0x9a32('0x60')][_0x9a32('0x3')]+'['+_0x2bc700[_0x9a32('0x5b')]+']',_0x188653);};_0x2bc700['on'](_0x9a32('0x61'),function(){onDisconnect(_0x2bc700,_0xedf6f2);_0x2bc700[_0x9a32('0x57')](_0x9a32('0x62'));});onConnect(_0x2bc700);_0x2bc700[_0x9a32('0x57')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c1b716e..9c9ec33 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 _0xf0a7=['Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','motionChannel','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','event','opened','contact','AfterCreate','changed','closed','substatus','AfterUpdate','find','email','internal','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','http','Chat','ChatInteraction','afterUpdate','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','newinteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction'];(function(_0x59dd3b,_0x3b56e1){var _0x2ae2ad=function(_0x131feb){while(--_0x131feb){_0x59dd3b['push'](_0x59dd3b['shift']());}};_0x2ae2ad(++_0x3b56e1);}(_0xf0a7,0x1f0));var _0x7f0a=function(_0x2f1b61,_0x3b7bc5){_0x2f1b61=_0x2f1b61-0x0;var _0x23a054=_0xf0a7[_0x2f1b61];return _0x23a054;};'use strict';var util=require(_0x7f0a('0x0'));var db=require(_0x7f0a('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var client=jayson['client'][_0x7f0a('0x2')]({'port':0x232a});var triggers=[{'channel':_0x7f0a('0x3'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x7f0a('0x3'),'model':_0x7f0a('0x4'),'event':_0x7f0a('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0x7f0a('0x6'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x8'),'callback':afterCreateMessage},{'channel':_0x7f0a('0x3'),'model':_0x7f0a('0x9'),'event':'afterCreate','condition':_0x7f0a('0x8'),'callback':afterCreateOfflineMessage},{'channel':_0x7f0a('0xa'),'model':'SmsInteraction','event':_0x7f0a('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0x7f0a('0xb'),'event':_0x7f0a('0x5'),'condition':_0x7f0a('0xc'),'callback':afterUpdate},{'channel':_0x7f0a('0xa'),'model':_0x7f0a('0xd'),'event':'afterCreate','condition':_0x7f0a('0x8'),'callback':afterCreateMessage},{'channel':_0x7f0a('0xe'),'model':_0x7f0a('0xf'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x10'),'callback':afterCreate},{'channel':_0x7f0a('0xe'),'model':_0x7f0a('0xf'),'event':_0x7f0a('0x5'),'condition':_0x7f0a('0xc'),'callback':afterUpdate},{'channel':_0x7f0a('0xe'),'model':_0x7f0a('0x11'),'event':_0x7f0a('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7f0a('0x12'),'model':_0x7f0a('0x13'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x10'),'callback':afterCreate},{'channel':_0x7f0a('0x12'),'model':_0x7f0a('0x13'),'event':_0x7f0a('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7f0a('0x12'),'model':_0x7f0a('0x14'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x8'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x7f0a('0x15'),'event':'afterCreate','condition':_0x7f0a('0x10'),'callback':afterCreate},{'channel':_0x7f0a('0x16'),'model':_0x7f0a('0x15'),'event':_0x7f0a('0x5'),'condition':_0x7f0a('0xc'),'callback':afterUpdate},{'channel':'Mail','model':_0x7f0a('0x17'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x8'),'callback':afterCreateMessage},{'channel':_0x7f0a('0x18'),'model':_0x7f0a('0x19'),'event':_0x7f0a('0x7'),'condition':_0x7f0a('0x10'),'callback':afterCreate},{'channel':_0x7f0a('0x18'),'model':_0x7f0a('0x19'),'event':_0x7f0a('0x5'),'condition':_0x7f0a('0xc'),'callback':afterUpdate},{'channel':_0x7f0a('0x18'),'model':_0x7f0a('0x1a'),'event':'afterCreate','condition':_0x7f0a('0x8'),'callback':afterCreateMessage}];function request(_0x55d76e){return client[_0x7f0a('0x1b')](_0x7f0a('0x1c'),_0x55d76e)[_0x7f0a('0x1d')](function(_0xc4401e){logger[_0x7f0a('0x1e')](_0x7f0a('0x1f'),_0x7f0a('0x1c'),_0xc4401e);if(_0xc4401e[_0x7f0a('0x20')]){if(_0xc4401e[_0x7f0a('0x20')]['code']===0x1f4){logger[_0x7f0a('0x20')]('Trigger,\x20%s',_0x7f0a('0x1c'),_0xc4401e[_0x7f0a('0x20')]);}}})[_0x7f0a('0x21')](function(_0x432267){logger['error']('Trigger,\x20%s',_0x7f0a('0x1c'),_0x432267);});}function afterCreateMessage(_0x23aabf){return function(_0x371c7c){_0x371c7c=_0x371c7c[_0x7f0a('0x22')]({'plain':!![]});_0x371c7c['channel']=_0x23aabf;_0x371c7c[_0x7f0a('0x23')]=_0x23aabf;_0x371c7c['event']=_0x371c7c[_0x7f0a('0x24')];Promise['resolve']()[_0x7f0a('0x1d')](function(){if(typeof _0x371c7c[_0x7f0a('0x25')]===_0x7f0a('0x26'))return null;var _0x35d4e3=_0x7f0a('0x27')+_0x371c7c[_0x7f0a('0x25')];return db[_0x7f0a('0x28')][_0x7f0a('0x29')](_0x35d4e3,{'type':db[_0x7f0a('0x2a')][_0x7f0a('0x2b')][_0x7f0a('0x2c')],'raw':!![]});})[_0x7f0a('0x1d')](function(_0x1f5b4a){if(_0x1f5b4a){_0x371c7c['contact']=_0x1f5b4a[0x0];}if(typeof _0x371c7c[_0x7f0a('0x2d')]==='undefined')return;return getAgent(_0x371c7c['UserId']);})['then'](function(_0x53099b){if(_0x53099b){_0x371c7c[_0x7f0a('0x2e')]=util[_0x7f0a('0x2f')](_0x7f0a('0x30'),_0x53099b[_0x7f0a('0x31')]);_0x371c7c[_0x7f0a('0x32')]=_0x53099b;_0x371c7c[_0x7f0a('0x33')]=_0x23aabf;return request({'event':_0x7f0a('0x34'),'message':_0x371c7c});}else{return request({'event':_0x7f0a('0x35'),'message':_0x371c7c});}})['catch'](function(_0x8ddc7b){logger[_0x7f0a('0x20')]('Trigger,\x20%s',_0x7f0a('0x36'),_0x8ddc7b);});};}function afterCreateOfflineMessage(_0x1a4213){return function(_0x358058){_0x358058=_0x358058[_0x7f0a('0x22')]({'plain':!![]});_0x358058[_0x7f0a('0x33')]=_0x1a4213;_0x358058[_0x7f0a('0x23')]=_0x1a4213;_0x358058['event']=_0x7f0a('0x37');return request({'event':_0x358058[_0x7f0a('0x38')],'message':_0x358058});};}function afterCreate(_0x2121fc,_0x2344a0){return function(_0x5c5b8a){_0x5c5b8a=_0x5c5b8a[_0x7f0a('0x22')]({'plain':!![]});_0x5c5b8a[_0x7f0a('0x33')]=_0x2121fc;_0x5c5b8a[_0x7f0a('0x23')]=_0x2121fc;_0x5c5b8a['event']=_0x7f0a('0x39');Promise['resolve']()[_0x7f0a('0x1d')](function(){var _0x4239f4=_0x7f0a('0x27')+_0x5c5b8a[_0x7f0a('0x25')];return db[_0x7f0a('0x28')]['query'](_0x4239f4,{'type':db[_0x7f0a('0x2a')]['QueryTypes'][_0x7f0a('0x2c')],'raw':!![]});})['then'](function(_0x137ae9){if(_0x137ae9){_0x5c5b8a[_0x7f0a('0x3a')]=_0x137ae9[0x0];}if(typeof _0x5c5b8a[_0x7f0a('0x2d')]==='undefined')return;return getAgent(_0x5c5b8a[_0x7f0a('0x2d')]);})[_0x7f0a('0x1d')](function(_0x577aa4){if(_0x577aa4){_0x5c5b8a['interface']=util['format'](_0x7f0a('0x30'),_0x577aa4[_0x7f0a('0x31')]);_0x5c5b8a[_0x7f0a('0x32')]=_0x577aa4;}return request({'event':_0x2344a0,'message':_0x5c5b8a});})['catch'](function(_0x249f14){logger[_0x7f0a('0x20')](_0x7f0a('0x1f'),_0x7f0a('0x3b'),_0x249f14);});};}function afterUpdate(_0x1c87a2){return function(_0x16ec67){var _0x1d1f85=_0x16ec67[_0x7f0a('0x3c')](_0x7f0a('0x3d'))&&_0x16ec67[_0x7f0a('0x3d')];var _0x24b288=_0x16ec67['changed'](_0x7f0a('0x3e'));if(_0x1d1f85||_0x24b288){var _0x99d18a=_0x1d1f85?_0x7f0a('0xc'):_0x7f0a('0x3e');var _0x1d7598=_0x16ec67[_0x7f0a('0x22')]({'plain':!![]});_0x1d7598[_0x7f0a('0x33')]=_0x1c87a2;_0x1d7598[_0x7f0a('0x23')]=_0x1c87a2;_0x1d7598[_0x7f0a('0x38')]=_0x1d1f85?_0x7f0a('0x3d'):'substatus';var _0x470621=_0x7f0a('0x27')+_0x1d7598['ContactId'];return db[_0x7f0a('0x28')][_0x7f0a('0x29')](_0x470621,{'type':db[_0x7f0a('0x2a')][_0x7f0a('0x2b')][_0x7f0a('0x2c')],'raw':!![]})[_0x7f0a('0x1d')](function(_0x41605b){if(_0x41605b){_0x1d7598[_0x7f0a('0x3a')]=_0x41605b[0x0];}if(typeof _0x1d7598[_0x7f0a('0x2d')]===_0x7f0a('0x26'))return;return getAgent(_0x1d7598[_0x7f0a('0x2d')]);})[_0x7f0a('0x1d')](function(_0x3976a5){if(_0x3976a5){_0x1d7598['interface']=util[_0x7f0a('0x2f')]('SIP/%s',_0x3976a5[_0x7f0a('0x31')]);_0x1d7598[_0x7f0a('0x32')]=_0x3976a5;}return request({'event':_0x99d18a,'message':_0x1d7598});})[_0x7f0a('0x21')](function(_0x35e529){logger['error'](_0x7f0a('0x1f'),_0x7f0a('0x3f'),_0x35e529);});}};}function getAgent(_0x482006){return db['User'][_0x7f0a('0x40')]({'where':{'id':_0x482006},'attributes':['id',_0x7f0a('0x31'),'fullname',_0x7f0a('0x41'),_0x7f0a('0x42')],'raw':!![]})[_0x7f0a('0x1d')](function(_0x5ca976){return _0x5ca976;});}exports[_0x7f0a('0x43')]=function(){for(var _0x4b9f87=0x0;_0x4b9f87=_0x3600b9['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4ade08(_0x4a56d7);})[_0xdd05('0x14')](function(_0x597fe3){_0x4f0bd1(_0x597fe3);});});}; \ No newline at end of file +var _0x8b5c=['getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','count','then','getLicense','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','sms','whatsapp'];(function(_0x31a31c,_0x5da8f0){var _0x5867a1=function(_0x1fcdd1){while(--_0x1fcdd1){_0x31a31c['push'](_0x31a31c['shift']());}};_0x5867a1(++_0x5da8f0);}(_0x8b5c,0x91));var _0xc8b5=function(_0x3bd48d,_0x5d8e1d){_0x3bd48d=_0x3bd48d-0x0;var _0x434e6b=_0x8b5c[_0x3bd48d];return _0x434e6b;};'use strict';var _=require(_0xc8b5('0x0'));var BPromise=require(_0xc8b5('0x1'));var db=require(_0xc8b5('0x2'))['db'];var util=require(_0xc8b5('0x3'));var channels=[_0xc8b5('0x4'),_0xc8b5('0x5'),'chat',_0xc8b5('0x6'),_0xc8b5('0x7'),_0xc8b5('0x8'),'openchannel'];exports[_0xc8b5('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x5449a5){_0x5449a5=_0x5449a5[_0xc8b5('0xa')]();return _[_0xc8b5('0xb')](channels,_0x5449a5);};exports[_0xc8b5('0xc')]=function(_0x1d1eb5,_0x2024bf,_0x386eda,_0x3eb6f3){var _0xf56729={'loginAttempts':_0x2024bf,'blocked':_0x386eda};if(!_[_0xc8b5('0xd')](_0x3eb6f3)){_0xf56729[_0xc8b5('0xe')]=_0x3eb6f3;}return _0x1d1eb5[_0xc8b5('0xf')](_0xf56729);};exports['getLicense']=function(_0x464b9e){return new BPromise(function(_0x41d8e8,_0x264c49){var _0x2c9934=0x0;if(_0x464b9e['role']!==_0xc8b5('0x10')){_0x41d8e8(_0x464b9e);}db['User'][_0xc8b5('0x11')]({'where':{'role':_0xc8b5('0x10'),'online':!![],'id':{'$ne':_0x464b9e['id']}}})[_0xc8b5('0x12')](function(_0x1423bb){_0x2c9934=_0x1423bb;return util[_0xc8b5('0x13')]();})[_0xc8b5('0x12')](function(_0x21ac78){if(_0x21ac78&&_0x21ac78[_0xc8b5('0x14')]&&_0x2c9934>=_0x21ac78[_0xc8b5('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x41d8e8(_0x464b9e);})[_0xc8b5('0x15')](function(_0x32a6de){_0x264c49(_0x32a6de);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 08a9fe4..e6801e1 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['Bad\x20Request','name','Not\x20Found','Forbidden','OutOfInterval','stack','send','exports','util','message','Error','inherits'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf4eb,0xec));var _0xbf4e=function(_0x267d82,_0x2df727){_0x267d82=_0x267d82-0x0;var _0x4335aa=_0xf4eb[_0x267d82];return _0x4335aa;};'use strict';var util=require(_0xbf4e('0x0'));var logger=require('../config/logger')('api');var APIError=function(_0x479210,_0x5ed5b9){this[_0xbf4e('0x1')]=_0x479210||'Internal\x20Server\x20Error';this['name']=_0x5ed5b9||_0xbf4e('0x2');util[_0xbf4e('0x3')](APIError,Error);};var APIBadRequestError=function(_0x32d1d7){this[_0xbf4e('0x1')]=_0x32d1d7||_0xbf4e('0x4');this[_0xbf4e('0x5')]=_0xbf4e('0x4');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x449d55){this['message']=_0x449d55||'Entity\x20not\x20found';this[_0xbf4e('0x5')]=_0xbf4e('0x6');util[_0xbf4e('0x3')](APINotFoundError,APIError);};function getStatusCode(_0xc86f04){switch(_0xc86f04){case _0xbf4e('0x4'):return 0x190;case _0xbf4e('0x7'),_0xbf4e('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d9a07){return function(_0x7dfb74){logger['error'](_0x7dfb74[_0xbf4e('0x9')]);var _0xcf6ba8=getStatusCode(_0x7dfb74['name']);if(_0x7dfb74[_0xbf4e('0x5')])delete _0x7dfb74['name'];return _0x4d9a07['status'](_0xcf6ba8)[_0xbf4e('0xa')](_0x7dfb74);};}module[_0xbf4e('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x58420d,_0x28a580){var _0x142515=function(_0x50b6b9){while(--_0x50b6b9){_0x58420d['push'](_0x58420d['shift']());}};_0x142515(++_0x28a580);}(_0x153f,0x15b));var _0xf153=function(_0x23d411,_0xe1f5d8){_0x23d411=_0x23d411-0x0;var _0x439a01=_0x153f[_0x23d411];return _0x439a01;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7906c41..eaf1fa7 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93d3=['exports','status','render'];(function(_0x122796,_0x29d441){var _0x3b6f3a=function(_0x13be34){while(--_0x13be34){_0x122796['push'](_0x122796['shift']());}};_0x3b6f3a(++_0x29d441);}(_0x93d3,0x1e9));var _0x393d=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x93d3[_0x1928c9];return _0x51b5fb;};'use strict';module[_0x393d('0x0')][0x194]=function pageNotFound(_0x59f21d,_0x1b738f){var _0x4eb63c='404';var _0x530f7d=0x194;var _0x4cbd17={'status':_0x530f7d};_0x1b738f[_0x393d('0x1')](_0x4cbd17[_0x393d('0x1')]);_0x1b738f[_0x393d('0x2')](_0x4eb63c,{},function(_0x547b0b,_0x4a3ea3){if(_0x547b0b){return _0x1b738f['status'](_0x4cbd17['status'])['json'](_0x4cbd17);}_0x1b738f['send'](_0x4a3ea3);});}; \ No newline at end of file +var _0xdc65=['send','exports','status','render','json'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xdc65,0x79));var _0x5dc6=function(_0xe7e21d,_0x5aeb78){_0xe7e21d=_0xe7e21d-0x0;var _0x44429b=_0xdc65[_0xe7e21d];return _0x44429b;};'use strict';module[_0x5dc6('0x0')][0x194]=function pageNotFound(_0x303f31,_0x15e1ba){var _0x14a25b='404';var _0x1f63de=0x194;var _0x4a2c82={'status':_0x1f63de};_0x15e1ba[_0x5dc6('0x1')](_0x4a2c82[_0x5dc6('0x1')]);_0x15e1ba[_0x5dc6('0x2')](_0x14a25b,{},function(_0x213c7e,_0x9e8fd7){if(_0x213c7e){return _0x15e1ba[_0x5dc6('0x1')](_0x4a2c82[_0x5dc6('0x1')])[_0x5dc6('0x3')](_0x4a2c82);}_0x15e1ba[_0x5dc6('0x4')](_0x9e8fd7);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 68b53cb..eb84791 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd64e=['UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','hasMany','UserId','VoiceQueuesRt','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Interactions','List','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','MailApplication','IntervalId','TagId','MailQueueReport','ListId','Dashboard','DashboardItem','Items','FaxAccountId','Answers','Exntensions','FaxMessage','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsApplication','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','CmCompany','CompanyId','CmContactHasItem','Phones','CmContactId','CmHopper','JscriptySessions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','OwnerId','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Action','ParentId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','Subject','DescriptionId','Field','FieldId','Variable','VariableId','SugarcrmAccount','SugarcrmConfiguration','Description','DeskAccount','int_desk_configuration_has_tags','ZohoAccount','ZohoField','ZendeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowField','FreshsalesField','ChatInternalMessage','FromId','ToId','JscriptyQuestionReport','ProjectId','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','OpenchannelTransferReport','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','Queues','UserVoicePrefix','userProfileId','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','WhatsappQueueId','user','exports','sequelize','jstz','xcall','127.0.0.1','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','xC@LL1234','name','database','options','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile'];(function(_0x21b69b,_0x2b1ed3){var _0x2fc9c8=function(_0x3d73ae){while(--_0x3d73ae){_0x21b69b['push'](_0x21b69b['shift']());}};_0x2fc9c8(++_0x2b1ed3);}(_0xd64e,0x10c));var _0xed64=function(_0x528a2f,_0x563e1b){_0x528a2f=_0x528a2f-0x0;var _0xcb7083=_0xd64e[_0x528a2f];return _0xcb7083;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xed64('0x0'));var _=require('lodash');var jstz=require(_0xed64('0x1'));var timezone=jstz['determine']();config[_0xed64('0x0')]=_['defaultsDeep'](config[_0xed64('0x0')],{'database':'motion2','username':_0xed64('0x2'),'password':'xC@LL1234','options':{'host':_0xed64('0x3'),'port':0xcea,'dialect':_0xed64('0x4'),'dialectOptions':{'charset':_0xed64('0x5')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xed64('0x6')}}});config[_0xed64('0x7')]=_[_0xed64('0x8')](config[_0xed64('0x7')],{'database':_0xed64('0x9'),'username':_0xed64('0x2'),'password':_0xed64('0xa'),'options':{'host':_0xed64('0x3'),'port':0xcea,'dialect':_0xed64('0x4'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xed64('0xb')](),'define':{'charset':'utf8','collate':_0xed64('0x6')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xed64('0xc')],config[_0xed64('0x0')]['username'],config[_0xed64('0x0')]['password'],config[_0xed64('0x0')][_0xed64('0xd')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0xed64('0x7')][_0xed64('0xe')],config[_0xed64('0x7')][_0xed64('0xf')],config[_0xed64('0x7')][_0xed64('0xd')])};db[_0xed64('0x10')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x12'));db[_0xed64('0x13')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x14'));db[_0xed64('0x15')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/voiceContext/voiceContext.model');db[_0xed64('0x16')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/voiceExtension/voiceExtension.model');db[_0xed64('0x17')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xed64('0x18')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x19'));db[_0xed64('0x1a')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x1b'));db['ScreenRecording']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x1c'));db[_0xed64('0x1d')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x1e'));db[_0xed64('0x1f')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x20'));db[_0xed64('0x21')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x22'));db[_0xed64('0x23')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xed64('0x24')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x25'));db[_0xed64('0x26')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x27'));db[_0xed64('0x28')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x29'));db[_0xed64('0x2a')]=db[_0xed64('0x0')]['import'](_0xed64('0x2b'));db[_0xed64('0x2c')]=db[_0xed64('0x0')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xed64('0x2d')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x2e'));db[_0xed64('0x2f')]=db[_0xed64('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xed64('0x30')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0xed64('0x31')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x32'));db[_0xed64('0x33')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x34'));db['UserSmsQueue']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x35'));db[_0xed64('0x36')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x37'));db[_0xed64('0x38')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x39'));db[_0xed64('0x3a')]=db[_0xed64('0x0')]['import'](_0xed64('0x3b'));db[_0xed64('0x3c')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x3d'));db[_0xed64('0x3e')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x3f'));db[_0xed64('0x40')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x41'));db[_0xed64('0x42')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x43'));db[_0xed64('0x44')]=db[_0xed64('0x0')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xed64('0x45')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0xed64('0x11')](_0xed64('0x46'));db['MailQueueReport']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x47'));db['Dashboard']=db[_0xed64('0x0')]['import'](_0xed64('0x48'));db['DashboardItem']=db[_0xed64('0x0')][_0xed64('0x11')]('../api/dashboardItem/dashboardItem.model');db[_0xed64('0x49')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/faxAccount/faxAccount.model');db[_0xed64('0x4a')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x4b'));db['FaxInteraction']=db['sequelize'][_0xed64('0x11')](_0xed64('0x4c'));db['FaxMessage']=db[_0xed64('0x0')][_0xed64('0x11')]('../api/faxMessage/faxMessage.model');db[_0xed64('0x4d')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x4e'));db[_0xed64('0x4f')]=db['sequelize']['import'](_0xed64('0x50'));db[_0xed64('0x51')]=db[_0xed64('0x0')]['import'](_0xed64('0x52'));db['SmsApplication']=db['sequelize'][_0xed64('0x11')](_0xed64('0x53'));db[_0xed64('0x54')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x55'));db[_0xed64('0x56')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x57'));db[_0xed64('0x58')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x59'));db[_0xed64('0x5a')]=db[_0xed64('0x0')]['import'](_0xed64('0x5b'));db[_0xed64('0x5c')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x5d'));db[_0xed64('0x5e')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x5f'));db['OpenchannelMessage']=db['sequelize']['import'](_0xed64('0x60'));db[_0xed64('0x61')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x62'));db[_0xed64('0x63')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x64'));db[_0xed64('0x65')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x66'));db[_0xed64('0x67')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x68'));db['ChatInteraction']=db['sequelize'][_0xed64('0x11')](_0xed64('0x69'));db[_0xed64('0x6a')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x6b'));db[_0xed64('0x6c')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x6d'));db[_0xed64('0x6e')]=db[_0xed64('0x0')]['import'](_0xed64('0x6f'));db[_0xed64('0x70')]=db[_0xed64('0x0')]['import'](_0xed64('0x71'));db[_0xed64('0x72')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x73'));db['CmCompany']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x74'));db['CmContact']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x75'));db['CmHopper']=db['sequelize'][_0xed64('0x11')](_0xed64('0x76'));db[_0xed64('0x77')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x78'));db['CmHopperFinal']=db[_0xed64('0x0')]['import'](_0xed64('0x79'));db[_0xed64('0x7a')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xed64('0x7b')]=db['sequelize'][_0xed64('0x11')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x7c'));db['Action']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x7d'));db[_0xed64('0x7e')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x7f'));db['CannedAnswer']=db[_0xed64('0x0')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xed64('0x80')]=db[_0xed64('0x0')]['import'](_0xed64('0x81'));db[_0xed64('0x82')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x83'));db[_0xed64('0x84')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x85'));db[_0xed64('0x86')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x87'));db[_0xed64('0x88')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x89'));db[_0xed64('0x8a')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x8b'));db[_0xed64('0x8c')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x8d'));db[_0xed64('0x8e')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x8f'));db[_0xed64('0x90')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/tag/tag.model');db[_0xed64('0x91')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x92'));db['CmContactHasItem']=db[_0xed64('0x0')]['import'](_0xed64('0x93'));db['CmHopperAdditionalPhone']=db[_0xed64('0x0')]['import'](_0xed64('0x94'));db[_0xed64('0x95')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x96'));db['Trigger']=db['sequelize'][_0xed64('0x11')](_0xed64('0x97'));db['Variable']=db['sequelize'][_0xed64('0x11')](_0xed64('0x98'));db[_0xed64('0x99')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x9a'));db[_0xed64('0x9b')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x9c'));db[_0xed64('0x9d')]=db['sequelize']['import'](_0xed64('0x9e'));db[_0xed64('0x9f')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xa0'));db[_0xed64('0xa1')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xed64('0xa2')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/analyticMetric/analyticMetric.model');db[_0xed64('0xa3')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xed64('0xa4')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xa5'));db[_0xed64('0xa6')]=db['sequelize']['import'](_0xed64('0xa7'));db[_0xed64('0xa8')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xa9'));db[_0xed64('0xaa')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xab'));db['SugarcrmAccount']=db['sequelize'][_0xed64('0x11')](_0xed64('0xac'));db['SugarcrmConfiguration']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xad'));db[_0xed64('0xae')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xaf'));db['DeskAccount']=db[_0xed64('0x0')]['import'](_0xed64('0xb0'));db[_0xed64('0xb1')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xed64('0xb2')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xb3'));db['ZohoAccount']=db['sequelize'][_0xed64('0x11')]('../api/intZohoAccount/intZohoAccount.model');db[_0xed64('0xb4')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xb5'));db['ZohoField']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xb6'));db['ZendeskAccount']=db[_0xed64('0x0')][_0xed64('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xed64('0xb7')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xb8'));db[_0xed64('0xb9')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xba'));db[_0xed64('0xbb')]=db[_0xed64('0x0')]['import'](_0xed64('0xbc'));db[_0xed64('0xbd')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xbe'));db['FreshdeskField']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xbf'));db[_0xed64('0xc0')]=db[_0xed64('0x0')]['import'](_0xed64('0xc1'));db[_0xed64('0xc2')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xc3'));db[_0xed64('0xc4')]=db[_0xed64('0x0')]['import'](_0xed64('0xc5'));db[_0xed64('0xc6')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xc7'));db[_0xed64('0xc8')]=db['sequelize'][_0xed64('0x11')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xc9'));db[_0xed64('0xca')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xcb'));db[_0xed64('0xcc')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xcd'));db[_0xed64('0xce')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xcf'));db[_0xed64('0xd0')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd1'));db[_0xed64('0xd2')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd3'));db['FreshsalesField']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd4'));db[_0xed64('0x99')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x9a'));db[_0xed64('0xd5')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd6'));db[_0xed64('0xd7')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd8'));db['ChatInternalMessage']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xd9'));db[_0xed64('0xda')]=db[_0xed64('0x0')]['import'](_0xed64('0xdb'));db['JscriptyQuestionReport']=db['sequelize'][_0xed64('0x11')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xed64('0xdc')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xdd'));db[_0xed64('0xde')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xdf'));db['SquareReport']=db['sequelize'][_0xed64('0x11')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db['sequelize'][_0xed64('0x11')](_0xed64('0xe0'));db[_0xed64('0xe1')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xe2'));db[_0xed64('0xe3')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/setting/setting.model');db[_0xed64('0xe4')]=db[_0xed64('0x0')]['import'](_0xed64('0xe5'));db[_0xed64('0xe6')]=db[_0xed64('0x0')]['import'](_0xed64('0xe7'));db[_0xed64('0xe8')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/squareRecording/squareRecording.model');db[_0xed64('0xe9')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xea'));db['Team']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xeb'));db['License']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xec'));db[_0xed64('0xed')]=db[_0xed64('0x0')]['import']('../api/campaign/campaign.model');db[_0xed64('0xee')]=db['sequelize'][_0xed64('0x11')](_0xed64('0xef'));db[_0xed64('0xf0')]=db[_0xed64('0x0')]['import'](_0xed64('0xf1'));db['Plugin']=db[_0xed64('0x0')][_0xed64('0x11')]('../api/plugin/plugin.model');db[_0xed64('0xf2')]=db['sequelize']['import'](_0xed64('0xf3'));db[_0xed64('0xf4')]=db['sequelize']['import'](_0xed64('0xf5'));db[_0xed64('0xf6')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xf7'));db['OpenchannelTransferReport']=db[_0xed64('0x0')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xf8'));db[_0xed64('0xf9')]=db[_0xed64('0x0')]['import'](_0xed64('0xfa'));db[_0xed64('0xfb')]=db[_0xed64('0x0')][_0xed64('0x11')]('../api/voicePrefix/voicePrefix.model');db[_0xed64('0xfc')]=db['sequelize'][_0xed64('0x11')]('../api/userProfile/userProfile.model');db[_0xed64('0xfd')]=db[_0xed64('0x0')]['import']('../api/userProfileSection/userProfileSection.model');db[_0xed64('0xfe')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0xff'));db[_0xed64('0x100')]=db['sequelize'][_0xed64('0x11')](_0xed64('0x101'));db[_0xed64('0x102')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x103'));db['WhatsappApplication']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x104'));db[_0xed64('0x105')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x106'));db[_0xed64('0x107')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x108'));db[_0xed64('0x109')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x10a'));db[_0xed64('0x10b')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x10c'));db[_0xed64('0x10d')]=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x10e'));db[_0xed64('0x10f')]=db[_0xed64('0x0')]['import'](_0xed64('0x110'));db['TeamVoiceQueue']=db[_0xed64('0x0')][_0xed64('0x11')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xed64('0x111')]=db[_0xed64('0x0')]['import'](_0xed64('0x112'));db['UserVoicePrefix']=db[_0xed64('0x0')][_0xed64('0x11')](_0xed64('0x113'));db[_0xed64('0x114')]=db[_0xed64('0x0')]['import']('../api/user-setting/user-setting.model');db['User'][_0xed64('0x115')](db[_0xed64('0x1d')],{'as':_0xed64('0x1d'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xed64('0x10')][_0xed64('0x115')](db[_0xed64('0x114')],{'as':'userSetting','onDelete':_0xed64('0x116'),'foreignKey':'UserId'});db['User'][_0xed64('0x117')](db[_0xed64('0x1a')],{'as':'Recordings','foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db['UserVoiceQueueRt'],{'as':_0xed64('0x119'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')]['hasMany'](db[_0xed64('0x16')],{'as':'Extensions','onDelete':_0xed64('0x116'),'hooks':!![]});db['User'][_0xed64('0x117')](db[_0xed64('0x11a')],{'as':_0xed64('0x11b'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db['CmHopperHistory'],{'as':_0xed64('0x11c'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db[_0xed64('0x7b')],{'as':_0xed64('0x7b'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db[_0xed64('0x5e')],{'as':_0xed64('0x11d'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db[_0xed64('0x11e')],{'as':_0xed64('0x11f'),'foreignKey':'UserId'});db[_0xed64('0x10')][_0xed64('0x117')](db[_0xed64('0x54')],{'as':_0xed64('0x120'),'foreignKey':_0xed64('0x118')});db['User'][_0xed64('0x117')](db[_0xed64('0x121')],{'as':_0xed64('0x122'),'foreignKey':_0xed64('0x118')});db['User'][_0xed64('0x117')](db[_0xed64('0x44')],{'as':_0xed64('0x123'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x10')][_0xed64('0x117')](db[_0xed64('0x105')],{'as':_0xed64('0x124'),'foreignKey':'UserId'});db['User'][_0xed64('0x117')](db[_0xed64('0x100')],{'as':_0xed64('0x125'),'foreignKey':'SenderId'});db[_0xed64('0x10')][_0xed64('0x126')](db['UserProfile'],{'as':_0xed64('0xfc'),'foreignKey':'userProfileId'});db['User'][_0xed64('0x127')](db[_0xed64('0x70')],{'as':_0xed64('0x128'),'through':_0xed64('0x129')});db['User'][_0xed64('0x127')](db[_0xed64('0x12a')],{'as':_0xed64('0x12b'),'through':_0xed64('0x12c')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0xf9')],{'as':_0xed64('0x12d'),'through':'cm_user_has_lists'});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':_0xed64('0x12f')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x44')],{'as':_0xed64('0x123'),'through':_0xed64('0x130')});db['User'][_0xed64('0x127')](db['ChatInteraction'],{'as':_0xed64('0x11f'),'through':_0xed64('0x131')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x121')],{'as':_0xed64('0x122'),'through':_0xed64('0x132')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x54')],{'as':'SmsInteractions','through':_0xed64('0x133')});db[_0xed64('0x10')][_0xed64('0x127')](db['OpenchannelInteraction'],{'as':_0xed64('0x11d'),'through':_0xed64('0x134')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x105')],{'as':_0xed64('0x124'),'through':'user_has_whatsapp_interactions'});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x18')],{'as':_0xed64('0x135'),'through':_0xed64('0x2f'),'required':![]});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0xfb')],{'as':_0xed64('0x136'),'through':'UserVoicePrefix','required':![]});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x40')],{'as':_0xed64('0x137'),'through':_0xed64('0x31'),'required':![]});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x6e')],{'as':_0xed64('0x138'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xed64('0x127')](db[_0xed64('0x4d')],{'as':_0xed64('0x139'),'through':_0xed64('0x33'),'required':![]});db['User'][_0xed64('0x127')](db[_0xed64('0x58')],{'as':_0xed64('0x13a'),'through':_0xed64('0x13b'),'required':![]});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x61')],{'as':'OpenchannelQueues','through':_0xed64('0x36'),'required':![]});db[_0xed64('0x10')]['belongsToMany'](db[_0xed64('0x10d')],{'as':_0xed64('0x13c'),'through':_0xed64('0x38'),'required':![]});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0xf9')],{'through':_0xed64('0x13d')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x63')],{'as':_0xed64('0x13e'),'through':_0xed64('0x13f')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x49')],{'as':_0xed64('0x140'),'through':_0xed64('0x141')});db[_0xed64('0x10')][_0xed64('0x127')](db['MailAccount'],{'as':'MailAccounts','through':_0xed64('0x142')});db[_0xed64('0x10')][_0xed64('0x127')](db[_0xed64('0x5a')],{'as':_0xed64('0x143'),'through':'user_has_openchannel_accounts'});db['User'][_0xed64('0x127')](db[_0xed64('0x51')],{'as':_0xed64('0x144'),'through':'user_has_sms_accounts'});db['User']['belongsToMany'](db[_0xed64('0x102')],{'as':_0xed64('0x145'),'through':_0xed64('0x146')});db[_0xed64('0x10')][_0xed64('0x127')](db['SquareProject'],{'as':_0xed64('0x147'),'through':_0xed64('0x148')});db['VoiceChanSpy'][_0xed64('0x117')](db['VoiceExtension'],{'as':_0xed64('0x149'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x14a')});db[_0xed64('0x15')]['hasMany'](db['VoiceExtension'],{'onDelete':_0xed64('0x116')});db[_0xed64('0x16')][_0xed64('0x117')](db[_0xed64('0x16')],{'as':_0xed64('0x14b'),'onDelete':'cascade'});db[_0xed64('0x17')]['belongsToMany'](db[_0xed64('0x8e')],{'as':_0xed64('0x14c'),'through':_0xed64('0x14d')});db[_0xed64('0x18')]['hasMany'](db[_0xed64('0x2d')],{'as':_0xed64('0x14e'),'foreignKey':'VoiceQueueId'});db[_0xed64('0x18')]['hasMany'](db['CmHopper'],{'as':_0xed64('0x14f'),'foreignKey':_0xed64('0x150')});db[_0xed64('0x18')][_0xed64('0x117')](db[_0xed64('0x11a')],{'as':_0xed64('0x11b'),'foreignKey':_0xed64('0x150')});db[_0xed64('0x18')][_0xed64('0x117')](db[_0xed64('0x7a')],{'as':_0xed64('0x151'),'foreignKey':_0xed64('0x150')});db[_0xed64('0x18')]['hasMany'](db['ReportAgentPreview'],{'as':_0xed64('0x7b'),'foreignKey':_0xed64('0x150')});db[_0xed64('0x18')][_0xed64('0x117')](db[_0xed64('0x77')],{'as':_0xed64('0x152'),'foreignKey':_0xed64('0x150')});db[_0xed64('0x18')][_0xed64('0x117')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xed64('0x150')});db[_0xed64('0x18')][_0xed64('0x126')](db[_0xed64('0x2a')],{'as':_0xed64('0x2a'),'foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db[_0xed64('0x2a')],{'as':_0xed64('0x153'),'foreignKey':_0xed64('0x154')});db[_0xed64('0x18')][_0xed64('0x126')](db['Interval'],{'as':_0xed64('0x84'),'foreignKey':'IntervalId'});db[_0xed64('0x18')][_0xed64('0x126')](db[_0xed64('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xed64('0x155')});db[_0xed64('0x18')][_0xed64('0x127')](db[_0xed64('0xf9')],{'as':_0xed64('0x12d'),'through':_0xed64('0x156')});db['VoiceQueue'][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x2f')});db[_0xed64('0x18')][_0xed64('0x127')](db[_0xed64('0x12e')],{'as':_0xed64('0x158'),'through':'TeamVoiceQueue'});db[_0xed64('0x18')][_0xed64('0x127')](db[_0xed64('0xf9')],{'as':'BlackLists','through':_0xed64('0x159')});db[_0xed64('0x1a')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':_0xed64('0x10'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x15a')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':_0xed64('0x10'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x1d')][_0xed64('0x117')](db['VoiceMailMessage'],{'as':_0xed64('0x15b'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x15c'),'sourceKey':_0xed64('0x15d')});db['VoiceMailMessage']['belongsTo'](db[_0xed64('0x1d')],{'foreignKey':_0xed64('0x15c'),'targetKey':_0xed64('0x15d')});db[_0xed64('0x21')][_0xed64('0x117')](db[_0xed64('0x26')],{'as':_0xed64('0x15e'),'foreignKey':_0xed64('0x15f'),'constraints':![]});db[_0xed64('0x21')][_0xed64('0x117')](db['VoiceAgentReport'],{'as':_0xed64('0x160'),'foreignKey':_0xed64('0x15f'),'constraints':![]});db[_0xed64('0x21')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':_0xed64('0x10'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x21')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db['MailServerIn'][_0xed64('0x126')](db[_0xed64('0x3e')],{'as':_0xed64('0x3e'),'foreignKey':'MailAccountId'});db[_0xed64('0x3a')]['belongsTo'](db[_0xed64('0x10f')],{'as':'CloudProvider','foreignKey':_0xed64('0x163'),'onDelete':_0xed64('0x164')});db['MailServerOut'][_0xed64('0x126')](db[_0xed64('0x3e')],{'as':_0xed64('0x3e'),'foreignKey':_0xed64('0x165')});db[_0xed64('0x3c')][_0xed64('0x126')](db[_0xed64('0x10f')],{'as':_0xed64('0x10f'),'foreignKey':_0xed64('0x163'),'onDelete':_0xed64('0x164')});db[_0xed64('0x3e')][_0xed64('0x115')](db[_0xed64('0x3a')],{'as':_0xed64('0x166'),'onDelete':_0xed64('0x116')});db['MailAccount'][_0xed64('0x115')](db[_0xed64('0x3c')],{'as':_0xed64('0x167'),'onDelete':_0xed64('0x116')});db[_0xed64('0x3e')][_0xed64('0x117')](db[_0xed64('0x80')],{'as':_0xed64('0x168'),'foreignKey':_0xed64('0x165'),'onDelete':'cascade'});db[_0xed64('0x3e')]['hasMany'](db[_0xed64('0x169')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xed64('0x3e')]['hasMany'](db[_0xed64('0x45')],{'as':_0xed64('0x15b'),'foreignKey':_0xed64('0x165')});db['MailAccount'][_0xed64('0x117')](db[_0xed64('0x44')],{'as':_0xed64('0x16a')});db[_0xed64('0x3e')][_0xed64('0x117')](db['MailApplication'],{'as':'Applications'});db[_0xed64('0x3e')]['belongsTo'](db['CmList'],{'as':_0xed64('0x16b'),'foreignKey':'ListId'});db[_0xed64('0x3e')][_0xed64('0x126')](db[_0xed64('0x95')],{'as':'Template','foreignKey':_0xed64('0x16c')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0xed64('0x16d'),'foreignKey':_0xed64('0x155')});db[_0xed64('0x3e')]['belongsToMany'](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':'user_has_mail_accounts'});db[_0xed64('0x40')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x31')});db['MailQueue'][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':_0xed64('0x16e'),'as':_0xed64('0x158')});db[_0xed64('0x44')][_0xed64('0x117')](db[_0xed64('0x45')],{'as':'Messages','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x16f')});db[_0xed64('0x44')]['belongsTo'](db[_0xed64('0x3e')],{'as':'Account','foreignKey':_0xed64('0x165')});db[_0xed64('0x44')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':'ContactId'});db[_0xed64('0x44')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0xed64('0x44')]['belongsToMany'](db['Tag'],{'through':_0xed64('0x170'),'as':_0xed64('0x171')});db[_0xed64('0x44')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0xed64('0x44')]['belongsToMany'](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x130'),'foreignKey':_0xed64('0x16f')});db[_0xed64('0x45')][_0xed64('0x117')](db[_0xed64('0xf0')],{'as':_0xed64('0x173'),'onDelete':_0xed64('0x116')});db[_0xed64('0x45')][_0xed64('0x126')](db['User'],{'as':_0xed64('0x10')});db[_0xed64('0x45')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x161')});db[_0xed64('0x45')]['belongsTo'](db[_0xed64('0x44')],{'as':_0xed64('0x174'),'foreignKey':_0xed64('0x16f')});db[_0xed64('0x45')][_0xed64('0x126')](db[_0xed64('0x3e')],{'as':'Account','foreignKey':_0xed64('0x165')});db['MailMessage']['belongsTo'](db[_0xed64('0x63')],{'as':_0xed64('0x63'),'foreignKey':'ChatWebsiteId'});db[_0xed64('0x45')][_0xed64('0x126')](db[_0xed64('0x6c')],{'as':_0xed64('0x6c'),'foreignKey':'ChatOfflineMessageId'});db[_0xed64('0x175')][_0xed64('0x126')](db['User'],{'onDelete':_0xed64('0x164')});db[_0xed64('0x175')]['belongsTo'](db[_0xed64('0x40')],{'onDelete':'restrict'});db[_0xed64('0x175')][_0xed64('0x126')](db[_0xed64('0x3e')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x175')][_0xed64('0x126')](db[_0xed64('0x84')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x176')});db[_0xed64('0x175')][_0xed64('0x126')](db[_0xed64('0x90')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db[_0xed64('0x178')]['belongsTo'](db[_0xed64('0x3e')],{});db['MailQueueReport']['belongsTo'](db[_0xed64('0xf9')],{'as':'List','foreignKey':_0xed64('0x179')});db['MailQueueReport'][_0xed64('0x126')](db['CmContact'],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db['MailQueueReport'][_0xed64('0x126')](db['MailInteraction'],{});db[_0xed64('0x178')]['belongsTo'](db[_0xed64('0x45')],{});db['MailQueueReport']['belongsTo'](db[_0xed64('0x10')],{});db['MailQueueReport']['belongsTo'](db[_0xed64('0x40')],{});db[_0xed64('0x17a')]['hasMany'](db[_0xed64('0x17b')],{'as':_0xed64('0x17c'),'onDelete':'cascade'});db[_0xed64('0x49')][_0xed64('0x117')](db[_0xed64('0x80')],{'as':'Dispositions','foreignKey':_0xed64('0x17d'),'onDelete':_0xed64('0x116')});db[_0xed64('0x49')][_0xed64('0x117')](db[_0xed64('0x169')],{'as':_0xed64('0x17e'),'foreignKey':_0xed64('0x17d')});db[_0xed64('0x49')]['hasMany'](db[_0xed64('0x121')],{'as':_0xed64('0x16a')});db[_0xed64('0x49')]['hasMany'](db[_0xed64('0x4a')],{'as':_0xed64('0x14b')});db[_0xed64('0x49')][_0xed64('0x117')](db[_0xed64('0x16')],{'as':_0xed64('0x17f'),'onDelete':'cascade'});db['FaxAccount'][_0xed64('0x117')](db[_0xed64('0x180')],{'as':'Messages'});db['FaxAccount'][_0xed64('0x126')](db[_0xed64('0x2a')],{'as':_0xed64('0x2a')});db[_0xed64('0x49')]['belongsTo'](db[_0xed64('0xf9')],{'as':'List','foreignKey':_0xed64('0x179')});db['FaxAccount'][_0xed64('0x126')](db['Pause'],{'as':_0xed64('0x16d'),'foreignKey':_0xed64('0x155')});db[_0xed64('0x49')]['belongsToMany'](db['User'],{'as':_0xed64('0x157'),'through':_0xed64('0x141')});db[_0xed64('0x4a')][_0xed64('0x126')](db[_0xed64('0x10')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x4a')][_0xed64('0x126')](db[_0xed64('0x4d')],{'onDelete':'restrict'});db['FaxApplication'][_0xed64('0x126')](db[_0xed64('0x49')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x4a')]['belongsTo'](db['Tag'],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db['FaxInteraction'][_0xed64('0x117')](db[_0xed64('0x180')],{'as':_0xed64('0x15b'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x181')});db[_0xed64('0x121')][_0xed64('0x126')](db[_0xed64('0x49')],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x17d')});db['FaxInteraction'][_0xed64('0x126')](db['CmContact'],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db['FaxInteraction'][_0xed64('0x126')](db['User'],{'as':_0xed64('0x183'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x121')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x184'),'as':'ThroughTags'});db['FaxInteraction'][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x132'),'foreignKey':_0xed64('0x181')});db[_0xed64('0x180')][_0xed64('0x126')](db['User'],{'onDelete':_0xed64('0x116'),'as':'User'});db[_0xed64('0x180')][_0xed64('0x126')](db[_0xed64('0x121')],{'as':_0xed64('0x174'),'foreignKey':_0xed64('0x181')});db[_0xed64('0x180')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':'cascade','as':_0xed64('0x161')});db[_0xed64('0x180')][_0xed64('0x126')](db[_0xed64('0xf0')],{'as':_0xed64('0xf0'),'foreignKey':_0xed64('0x185')});db['FaxMessage'][_0xed64('0x126')](db[_0xed64('0x49')],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x17d')});db[_0xed64('0x4d')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':'UserFaxQueue'});db[_0xed64('0x4d')]['belongsToMany'](db[_0xed64('0x12e')],{'through':_0xed64('0x186'),'as':_0xed64('0x158')});db[_0xed64('0x4f')][_0xed64('0x126')](db[_0xed64('0x49')],{});db[_0xed64('0x4f')][_0xed64('0x126')](db['CmList'],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179')});db[_0xed64('0x4f')][_0xed64('0x126')](db['CmContact'],{'as':'Contact','foreignKey':_0xed64('0x162')});db[_0xed64('0x4f')]['belongsTo'](db[_0xed64('0x121')],{});db[_0xed64('0x4f')][_0xed64('0x126')](db[_0xed64('0x180')],{});db[_0xed64('0x4f')][_0xed64('0x126')](db[_0xed64('0x10')],{});db[_0xed64('0x4f')][_0xed64('0x126')](db[_0xed64('0x4d')],{});db[_0xed64('0x51')][_0xed64('0x117')](db[_0xed64('0x80')],{'as':'Dispositions','foreignKey':_0xed64('0x187'),'onDelete':_0xed64('0x116')});db[_0xed64('0x51')][_0xed64('0x117')](db[_0xed64('0x169')],{'as':'Answers','foreignKey':_0xed64('0x187')});db['SmsAccount']['hasMany'](db[_0xed64('0x56')],{'as':_0xed64('0x15b'),'foreignKey':_0xed64('0x187')});db['SmsAccount']['hasMany'](db[_0xed64('0x54')],{'as':_0xed64('0x16a')});db[_0xed64('0x51')]['hasMany'](db['SmsApplication'],{'as':_0xed64('0x14b')});db[_0xed64('0x51')][_0xed64('0x126')](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':'ListId'});db[_0xed64('0x51')][_0xed64('0x126')](db[_0xed64('0x86')],{'as':_0xed64('0x16d'),'foreignKey':_0xed64('0x155')});db['SmsAccount'][_0xed64('0x127')](db[_0xed64('0x10')],{'as':'Agents','through':_0xed64('0x188')});db[_0xed64('0x189')]['belongsTo'](db[_0xed64('0x10')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x189')]['belongsTo'](db[_0xed64('0x58')],{'onDelete':'restrict'});db['SmsApplication'][_0xed64('0x126')](db[_0xed64('0x51')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x189')]['belongsTo'](db[_0xed64('0x84')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x176')});db[_0xed64('0x189')][_0xed64('0x126')](db[_0xed64('0x90')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db[_0xed64('0x54')][_0xed64('0x117')](db[_0xed64('0x56')],{'as':_0xed64('0x15b'),'onDelete':'cascade','foreignKey':_0xed64('0x18a')});db['SmsInteraction']['belongsTo'](db[_0xed64('0x51')],{'as':'Account','foreignKey':_0xed64('0x187')});db[_0xed64('0x54')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':'ContactId'});db[_0xed64('0x54')][_0xed64('0x126')](db['User'],{'as':_0xed64('0x183'),'foreignKey':_0xed64('0x118')});db[_0xed64('0x54')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x18b'),'as':_0xed64('0x171')});db[_0xed64('0x54')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x18b'),'as':_0xed64('0x18c')});db[_0xed64('0x54')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x133'),'foreignKey':_0xed64('0x18a')});db['SmsMessage']['belongsTo'](db[_0xed64('0x10')],{'as':_0xed64('0x10')});db[_0xed64('0x56')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':'cascade','as':'Contact'});db[_0xed64('0x56')][_0xed64('0x126')](db[_0xed64('0x54')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x174'),'foreignKey':'SmsInteractionId'});db[_0xed64('0x56')][_0xed64('0x126')](db['SmsAccount'],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x187')});db[_0xed64('0x58')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x13b'),'foreignKey':_0xed64('0x18d')});db[_0xed64('0x58')][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':'team_has_sms_queues','as':_0xed64('0x158')});db['OpenchannelAccount']['hasMany'](db[_0xed64('0x80')],{'as':'Dispositions','foreignKey':_0xed64('0x18e'),'onDelete':_0xed64('0x116')});db['OpenchannelAccount'][_0xed64('0x117')](db[_0xed64('0x169')],{'as':_0xed64('0x17e'),'foreignKey':_0xed64('0x18e')});db[_0xed64('0x5a')][_0xed64('0x117')](db[_0xed64('0x5e')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0xed64('0x5a')]['hasMany'](db['OpenchannelMessage'],{'as':_0xed64('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0xed64('0x5a')]['hasMany'](db[_0xed64('0x5c')],{'as':_0xed64('0x14b'),'foreignKey':'OpenchannelAccountId'});db[_0xed64('0x5a')]['belongsTo'](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179')});db['OpenchannelAccount'][_0xed64('0x126')](db[_0xed64('0x86')],{'as':_0xed64('0x16d'),'foreignKey':_0xed64('0x155')});db['OpenchannelAccount']['belongsToMany'](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x18f')});db[_0xed64('0x5c')][_0xed64('0x126')](db['User'],{'onDelete':'restrict'});db[_0xed64('0x5c')][_0xed64('0x126')](db['OpenchannelQueue'],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x190')});db[_0xed64('0x5c')][_0xed64('0x126')](db['OpenchannelAccount'],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x18e')});db[_0xed64('0x5c')]['belongsTo'](db[_0xed64('0x84')],{'onDelete':'restrict','foreignKey':_0xed64('0x176')});db[_0xed64('0x5c')][_0xed64('0x126')](db[_0xed64('0x90')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db['OpenchannelInteraction'][_0xed64('0x117')](db[_0xed64('0x191')],{'as':_0xed64('0x15b'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x192')});db[_0xed64('0x5e')][_0xed64('0x126')](db[_0xed64('0x5a')],{'as':_0xed64('0x182'),'foreignKey':'OpenchannelAccountId'});db[_0xed64('0x5e')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x5e')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0xed64('0x5e')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':'openchannel_interaction_has_tags','as':_0xed64('0x171')});db[_0xed64('0x5e')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x193'),'as':_0xed64('0x18c')});db[_0xed64('0x5e')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x134'),'foreignKey':_0xed64('0x192')});db[_0xed64('0x191')]['belongsTo'](db[_0xed64('0x10')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x10')});db[_0xed64('0x191')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x161')});db[_0xed64('0x191')]['belongsTo'](db[_0xed64('0x5e')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x174'),'foreignKey':'OpenchannelInteractionId'});db[_0xed64('0x191')][_0xed64('0x126')](db[_0xed64('0xf0')],{'as':_0xed64('0xf0'),'foreignKey':_0xed64('0x185')});db[_0xed64('0x191')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xed64('0x18e')});db[_0xed64('0x61')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x36'),'foreignKey':_0xed64('0x190')});db[_0xed64('0x61')][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0xed64('0x117')](db[_0xed64('0x80')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xed64('0x116')});db[_0xed64('0x63')][_0xed64('0x117')](db[_0xed64('0x169')],{'as':_0xed64('0x17e'),'foreignKey':_0xed64('0x194')});db[_0xed64('0x63')][_0xed64('0x117')](db[_0xed64('0x72')],{'as':_0xed64('0x195')});db['ChatWebsite'][_0xed64('0x117')](db[_0xed64('0x11e')],{'as':_0xed64('0x16a')});db[_0xed64('0x63')]['hasMany'](db[_0xed64('0x67')],{'as':_0xed64('0x14b')});db[_0xed64('0x63')][_0xed64('0x117')](db[_0xed64('0x6a')],{'as':_0xed64('0x15b')});db['ChatWebsite']['belongsTo'](db[_0xed64('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0xed64('0x63')][_0xed64('0x126')](db[_0xed64('0x84')],{'as':_0xed64('0x84'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0xed64('0x126')](db['MailAccount'],{'as':_0xed64('0x3e'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xed64('0x126')](db[_0xed64('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xed64('0x155')});db[_0xed64('0x63')]['belongsToMany'](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x13f')});db[_0xed64('0x65')][_0xed64('0x126')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xed64('0x126')](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179')});db[_0xed64('0x65')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x65')][_0xed64('0x126')](db[_0xed64('0x5e')],{});db[_0xed64('0x65')][_0xed64('0x126')](db[_0xed64('0x191')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xed64('0x10')],{});db[_0xed64('0x65')][_0xed64('0x126')](db[_0xed64('0x61')],{});db[_0xed64('0x67')]['belongsTo'](db[_0xed64('0x10')],{'as':_0xed64('0x196'),'foreignKey':_0xed64('0x118'),'onDelete':_0xed64('0x164')});db[_0xed64('0x67')]['belongsTo'](db[_0xed64('0x6e')],{'as':_0xed64('0x197'),'foreignKey':_0xed64('0x198'),'onDelete':_0xed64('0x164')});db[_0xed64('0x67')][_0xed64('0x126')](db[_0xed64('0x63')],{'as':_0xed64('0x199'),'foreignKey':'ChatWebsiteId','onDelete':_0xed64('0x164')});db[_0xed64('0x67')][_0xed64('0x126')](db[_0xed64('0x90')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db[_0xed64('0x11e')]['hasMany'](db[_0xed64('0x6a')],{'as':_0xed64('0x15b'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x19a')});db[_0xed64('0x11e')][_0xed64('0x126')](db[_0xed64('0x63')],{'as':'Account','foreignKey':_0xed64('0x194')});db[_0xed64('0x11e')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x11e')][_0xed64('0x126')](db[_0xed64('0x10')],{'as':_0xed64('0x183'),'foreignKey':_0xed64('0x118')});db['ChatInteraction'][_0xed64('0x127')](db['Tag'],{'through':_0xed64('0x19b'),'as':_0xed64('0x171')});db[_0xed64('0x11e')][_0xed64('0x127')](db['Tag'],{'through':_0xed64('0x19b'),'as':_0xed64('0x18c')});db[_0xed64('0x11e')][_0xed64('0x127')](db['User'],{'as':_0xed64('0x172'),'through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0xed64('0x6a')][_0xed64('0x126')](db['User'],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x10')});db[_0xed64('0x6a')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':_0xed64('0x116'),'as':'Contact','foreignKey':'ContactId'});db[_0xed64('0x6a')][_0xed64('0x126')](db[_0xed64('0x11e')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x174'),'foreignKey':_0xed64('0x19a')});db[_0xed64('0x6a')][_0xed64('0x126')](db[_0xed64('0xf0')],{'as':_0xed64('0xf0'),'foreignKey':'AttachmentId'});db[_0xed64('0x6a')][_0xed64('0x126')](db[_0xed64('0x63')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xed64('0x6c')][_0xed64('0x117')](db[_0xed64('0xf0')],{'as':_0xed64('0x173'),'foreignKey':_0xed64('0x19c'),'onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x6c')][_0xed64('0x126')](db['CmContact'],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x6c')][_0xed64('0x126')](db[_0xed64('0x63')],{'as':'Account','foreignKey':_0xed64('0x194')});db[_0xed64('0x6e')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x30'),'hooks':!![]});db[_0xed64('0x6e')][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':_0xed64('0x19d'),'as':_0xed64('0x158')});db[_0xed64('0x70')][_0xed64('0x117')](db['ChatInternalMessage'],{'as':_0xed64('0x15b'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xed64('0x70')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x14e'),'through':_0xed64('0x129')});db[_0xed64('0x72')]['belongsTo'](db[_0xed64('0x63')],{'as':_0xed64('0x199'),'foreignKey':_0xed64('0x194')});db[_0xed64('0x19e')][_0xed64('0x117')](db[_0xed64('0x12a')],{'as':'Contacts','foreignKey':_0xed64('0x19f')});db[_0xed64('0x12a')][_0xed64('0x117')](db[_0xed64('0x1a0')],{'as':_0xed64('0x1a1'),'foreignKey':_0xed64('0x1a2')});db[_0xed64('0x12a')]['hasMany'](db[_0xed64('0x1a3')],{'as':_0xed64('0x14f'),'foreignKey':'ContactId'});db['CmContact'][_0xed64('0x117')](db[_0xed64('0x11a')],{'as':'HopperFinals','foreignKey':_0xed64('0x162')});db[_0xed64('0x12a')][_0xed64('0x117')](db['CmHopperHistory'],{'as':_0xed64('0x151'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x12a')][_0xed64('0x117')](db[_0xed64('0x7b')],{'as':_0xed64('0x7b'),'foreignKey':_0xed64('0x162')});db[_0xed64('0x12a')][_0xed64('0x117')](db['JscriptySessionReport'],{'as':_0xed64('0x1a4'),'foreignKey':_0xed64('0x162')});db['CmContact']['hasMany'](db['OpenchannelInteraction'],{'as':_0xed64('0x11d'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0xed64('0x117')](db[_0xed64('0x11e')],{'as':_0xed64('0x11f'),'foreignKey':_0xed64('0x162'),'onDelete':_0xed64('0x164')});db[_0xed64('0x12a')][_0xed64('0x117')](db['SmsInteraction'],{'as':_0xed64('0x120'),'foreignKey':_0xed64('0x162'),'onDelete':_0xed64('0x164')});db[_0xed64('0x12a')][_0xed64('0x117')](db[_0xed64('0x121')],{'as':'FaxInteractions','foreignKey':_0xed64('0x162'),'onDelete':_0xed64('0x164')});db[_0xed64('0x12a')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0xed64('0x164')});db[_0xed64('0x12a')][_0xed64('0x126')](db[_0xed64('0x19e')],{'as':_0xed64('0x1a5'),'foreignKey':_0xed64('0x19f')});db[_0xed64('0x12a')][_0xed64('0x126')](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179'),'onDelete':'cascade'});db[_0xed64('0x12a')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x12c')});db[_0xed64('0x12a')][_0xed64('0x127')](db['Tag'],{'as':_0xed64('0x171'),'through':'cm_contact_has_tags'});db[_0xed64('0x12a')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x1a6'),'as':_0xed64('0x18c')});db[_0xed64('0x1a3')][_0xed64('0x117')](db[_0xed64('0x1a7')],{'as':_0xed64('0x1a8'),'foreignKey':_0xed64('0x1a9')});db[_0xed64('0x1a3')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162'),'onDelete':'cascade'});db[_0xed64('0x1a3')]['belongsTo'](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179'),'onDelete':_0xed64('0x116')});db['CmHopper'][_0xed64('0x126')](db[_0xed64('0x10')],{'as':_0xed64('0x196'),'foreignKey':'UserId'});db[_0xed64('0x1a3')]['belongsTo'](db[_0xed64('0x18')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xed64('0x116')});db[_0xed64('0x1a3')][_0xed64('0x126')](db[_0xed64('0xed')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xed64('0x116')});db[_0xed64('0x1a3')]['belongsTo'](db[_0xed64('0x10')],{'as':_0xed64('0x183'),'foreignKey':_0xed64('0x1aa')});db[_0xed64('0x77')]['belongsTo'](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':'ContactId','onDelete':_0xed64('0x116')});db[_0xed64('0x77')]['belongsTo'](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xed64('0x77')][_0xed64('0x126')](db['VoiceQueue'],{'as':_0xed64('0x197'),'foreignKey':_0xed64('0x150'),'onDelete':'cascade'});db[_0xed64('0x77')][_0xed64('0x126')](db[_0xed64('0xed')],{'as':_0xed64('0xed'),'foreignKey':_0xed64('0x1ab'),'onDelete':_0xed64('0x116')});db[_0xed64('0x7e')][_0xed64('0x117')](db['Condition'],{'as':{'plural':_0xed64('0x1ac'),'singular':_0xed64('0x1ad')},'foreignKey':_0xed64('0x1ae'),'onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x7e')][_0xed64('0x117')](db['Condition'],{'as':{'plural':_0xed64('0x1af'),'singular':_0xed64('0x1b0')},'foreignKey':'AutomationAnyId','onDelete':_0xed64('0x116'),'hooks':!![]});db['Automation'][_0xed64('0x117')](db[_0xed64('0x1b1')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x80')]['hasMany'](db[_0xed64('0x80')],{'as':_0xed64('0x168'),'foreignKey':_0xed64('0x1b2'),'onDelete':'cascade'});db[_0xed64('0x84')][_0xed64('0x117')](db[_0xed64('0x84')],{'as':_0xed64('0x1b3'),'foreignKey':_0xed64('0x176'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xed64('0x84')][_0xed64('0x117')](db[_0xed64('0x16')],{'as':_0xed64('0x1b4'),'foreignKey':'IntervalId','onDelete':_0xed64('0x164')});db[_0xed64('0x84')][_0xed64('0x117')](db[_0xed64('0x175')],{'as':'MailApplications','foreignKey':_0xed64('0x176')});db[_0xed64('0x84')][_0xed64('0x117')](db['ChatApplication'],{'as':_0xed64('0x1b5'),'foreignKey':_0xed64('0x176')});db['Interval'][_0xed64('0x117')](db[_0xed64('0x4a')],{'as':_0xed64('0x1b6'),'foreignKey':_0xed64('0x176')});db[_0xed64('0x84')][_0xed64('0x117')](db['SmsApplication'],{'as':_0xed64('0x1b7'),'foreignKey':_0xed64('0x176')});db[_0xed64('0x8c')][_0xed64('0x126')](db[_0xed64('0x3e')],{});db[_0xed64('0x8c')][_0xed64('0x126')](db[_0xed64('0x9f')],{'foreignKey':_0xed64('0x1b8')});db['Schedule']['belongsTo'](db[_0xed64('0x9d')],{'foreignKey':_0xed64('0x1b9')});db[_0xed64('0x8e')][_0xed64('0x127')](db[_0xed64('0x17')],{'as':_0xed64('0x1ba'),'through':_0xed64('0x14d'),'onDelete':_0xed64('0x164')});db[_0xed64('0x90')][_0xed64('0x127')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xed64('0x90')][_0xed64('0x127')](db['ChatInteraction'],{'through':_0xed64('0x19b')});db[_0xed64('0x90')][_0xed64('0x127')](db[_0xed64('0x44')],{'through':'mail_interaction_has_tags'});db[_0xed64('0x90')]['belongsToMany'](db[_0xed64('0x54')],{'through':_0xed64('0x18b')});db[_0xed64('0x90')][_0xed64('0x127')](db['FaxInteraction'],{'through':_0xed64('0x184')});db[_0xed64('0x90')][_0xed64('0x127')](db[_0xed64('0x5e')],{'through':_0xed64('0x193')});db[_0xed64('0x90')][_0xed64('0x127')](db[_0xed64('0x105')],{'through':_0xed64('0x1bb')});db['CmContactHasItem'][_0xed64('0x126')](db[_0xed64('0x91')],{'as':_0xed64('0x1bc'),'foreignKey':_0xed64('0x1bd')});db['CmHopperAdditionalPhone']['belongsTo'](db[_0xed64('0x1a3')],{'as':'Hopper','foreignKey':_0xed64('0x1a9')});db[_0xed64('0x1a0')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':'CmContactId'});db[_0xed64('0x1be')][_0xed64('0x117')](db[_0xed64('0x82')],{'as':{'plural':_0xed64('0x1bf'),'singular':'AllCondition'},'foreignKey':_0xed64('0x1c0'),'onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x1be')][_0xed64('0x117')](db[_0xed64('0x82')],{'as':{'plural':_0xed64('0x1c1'),'singular':_0xed64('0x1c2')},'foreignKey':_0xed64('0x1c3'),'onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x1be')][_0xed64('0x117')](db['Action'],{'as':'Actions','foreignKey':_0xed64('0x1c4'),'onDelete':_0xed64('0x116'),'hooks':!![]});db[_0xed64('0x9d')][_0xed64('0x117')](db[_0xed64('0xa3')],{'as':'Fields','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1b9'),'hooks':!![]});db['AnalyticDefaultReport'][_0xed64('0x117')](db[_0xed64('0xa3')],{'as':_0xed64('0x1c5'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1b8')});db[_0xed64('0xa2')][_0xed64('0x117')](db[_0xed64('0xa3')],{'as':_0xed64('0x1c5'),'onDelete':'cascade','foreignKey':_0xed64('0x1c6')});db[_0xed64('0xa3')]['belongsTo'](db[_0xed64('0xa2')],{'foreignKey':_0xed64('0x1c6')});db[_0xed64('0xa6')][_0xed64('0x117')](db[_0xed64('0xa8')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xa8')][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':_0xed64('0x1c9'),'onDelete':'cascade','foreignKey':_0xed64('0x1ca')});db[_0xed64('0xa8')][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':_0xed64('0x1cb'),'onDelete':_0xed64('0x116'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':_0xed64('0x1c5'),'onDelete':_0xed64('0x116'),'foreignKey':'FieldId'});db[_0xed64('0xa8')][_0xed64('0x126')](db[_0xed64('0xa6')],{'as':'Account','foreignKey':_0xed64('0x1c8')});db[_0xed64('0xaa')][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':_0xed64('0x1cc'),'foreignKey':'SubjectId'});db[_0xed64('0xaa')][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db[_0xed64('0xaa')][_0xed64('0x117')](db[_0xed64('0xaa')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0xaa')]['belongsTo'](db['Variable'],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0x1d2')][_0xed64('0x117')](db[_0xed64('0x1d3')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0x1d3')][_0xed64('0x117')](db['SugarcrmField'],{'as':_0xed64('0x1c9'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0x1d3')][_0xed64('0x117')](db['SugarcrmField'],{'as':_0xed64('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xed64('0x117')](db[_0xed64('0xae')],{'as':_0xed64('0x1c5'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0x1d3')][_0xed64('0x126')](db[_0xed64('0x1d2')],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xae')][_0xed64('0x117')](db[_0xed64('0xae')],{'as':_0xed64('0x1cc'),'foreignKey':'SubjectId'});db[_0xed64('0xae')][_0xed64('0x117')](db[_0xed64('0xae')],{'as':_0xed64('0x1d4'),'foreignKey':'DescriptionId'});db[_0xed64('0xae')][_0xed64('0x117')](db[_0xed64('0xae')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0xae')][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0x1d5')][_0xed64('0x117')](db[_0xed64('0xb1')],{'as':'Configurations','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xb1')][_0xed64('0x117')](db['DeskField'],{'as':_0xed64('0x1c9'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1ca')});db['DeskConfiguration'][_0xed64('0x117')](db[_0xed64('0xb2')],{'as':_0xed64('0x1cb'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1cd')});db['DeskConfiguration']['hasMany'](db[_0xed64('0xb2')],{'as':_0xed64('0x1c5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xed64('0xb1')][_0xed64('0x126')](db['DeskAccount'],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xb1')]['belongsToMany'](db[_0xed64('0x90')],{'through':_0xed64('0x1d6')});db[_0xed64('0xb2')][_0xed64('0x117')](db[_0xed64('0xb2')],{'as':'Subject','foreignKey':_0xed64('0x1ca')});db['DeskField']['hasMany'](db[_0xed64('0xb2')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db[_0xed64('0xb2')][_0xed64('0x117')](db['DeskField'],{'as':'Field','foreignKey':_0xed64('0x1cf')});db[_0xed64('0xb2')][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0x1d7')][_0xed64('0x117')](db[_0xed64('0xb4')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xb4')]['hasMany'](db[_0xed64('0x1d8')],{'as':_0xed64('0x1c9'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0xb4')][_0xed64('0x117')](db[_0xed64('0x1d8')],{'as':_0xed64('0x1cb'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1cd')});db['ZohoConfiguration'][_0xed64('0x117')](db['ZohoField'],{'as':_0xed64('0x1c5'),'onDelete':_0xed64('0x116'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xed64('0x126')](db['ZohoAccount'],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x1c8')});db['ZohoField'][_0xed64('0x117')](db[_0xed64('0x1d8')],{'as':_0xed64('0x1cc'),'foreignKey':_0xed64('0x1ca')});db['ZohoField'][_0xed64('0x117')](db[_0xed64('0x1d8')],{'as':_0xed64('0x1d4'),'foreignKey':'DescriptionId'});db[_0xed64('0x1d8')][_0xed64('0x117')](db[_0xed64('0x1d8')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db['ZohoField'][_0xed64('0x126')](db['Variable'],{'as':'Variable','foreignKey':_0xed64('0x1d1')});db[_0xed64('0x1d9')][_0xed64('0x117')](db[_0xed64('0xb7')],{'as':'Configurations','onDelete':_0xed64('0x116'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xed64('0x117')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xed64('0x1ca')});db['ZendeskConfiguration'][_0xed64('0x117')](db[_0xed64('0xb9')],{'as':_0xed64('0x1cb'),'foreignKey':_0xed64('0x1cd')});db[_0xed64('0xb7')][_0xed64('0x117')](db[_0xed64('0xb9')],{'as':_0xed64('0x1c5'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0xb7')][_0xed64('0x126')](db[_0xed64('0x1d9')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xed64('0x127')](db[_0xed64('0x90')],{'through':'int_zendesk_configuration_has_tags'});db[_0xed64('0xb9')][_0xed64('0x117')](db[_0xed64('0xb9')],{'as':'Subject','foreignKey':_0xed64('0x1ca')});db['ZendeskField'][_0xed64('0x117')](db[_0xed64('0xb9')],{'as':_0xed64('0x1d4'),'foreignKey':_0xed64('0x1cd')});db[_0xed64('0xb9')][_0xed64('0x117')](db[_0xed64('0xb9')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField'][_0xed64('0x126')](db['Variable'],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0xbb')][_0xed64('0x117')](db[_0xed64('0xbd')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xbd')][_0xed64('0x117')](db[_0xed64('0x1da')],{'as':'Subjects','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0xbd')][_0xed64('0x117')](db[_0xed64('0x1da')],{'as':'Descriptions','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1cd')});db[_0xed64('0xbd')][_0xed64('0x117')](db[_0xed64('0x1da')],{'as':'Fields','onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0xbd')][_0xed64('0x126')](db[_0xed64('0xbb')],{'as':_0xed64('0x182'),'foreignKey':'AccountId'});db[_0xed64('0xbd')]['belongsToMany'](db[_0xed64('0x90')],{'through':_0xed64('0x1db')});db[_0xed64('0x1da')][_0xed64('0x117')](db[_0xed64('0x1da')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xed64('0x1da')]['hasMany'](db[_0xed64('0x1da')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db['FreshdeskField'][_0xed64('0x117')](db[_0xed64('0x1da')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db['FreshdeskField'][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0xc0')][_0xed64('0x117')](db[_0xed64('0xc2')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db['VtigerConfiguration'][_0xed64('0x117')](db[_0xed64('0xc4')],{'as':'Subjects','foreignKey':_0xed64('0x1ca')});db[_0xed64('0xc2')][_0xed64('0x117')](db[_0xed64('0xc4')],{'as':_0xed64('0x1cb'),'foreignKey':_0xed64('0x1cd')});db[_0xed64('0xc2')]['hasMany'](db[_0xed64('0xc4')],{'as':'Fields','foreignKey':'FieldId'});db[_0xed64('0xc2')][_0xed64('0x126')](db['VtigerAccount'],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x1c8')});db['VtigerField'][_0xed64('0x117')](db[_0xed64('0xc4')],{'as':'Subject','foreignKey':_0xed64('0x1ca')});db[_0xed64('0xc4')][_0xed64('0x117')](db[_0xed64('0xc4')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db[_0xed64('0xc4')][_0xed64('0x117')](db[_0xed64('0xc4')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db['VtigerField'][_0xed64('0x126')](db['Variable'],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db[_0xed64('0xc6')][_0xed64('0x117')](db[_0xed64('0xc8')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xc8')]['hasMany'](db[_0xed64('0x1dc')],{'as':_0xed64('0x1c9'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0xc8')][_0xed64('0x117')](db[_0xed64('0x1dc')],{'as':_0xed64('0x1cb'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xed64('0x117')](db[_0xed64('0x1dc')],{'as':'Fields','foreignKey':_0xed64('0x1cf')});db[_0xed64('0xc8')][_0xed64('0x126')](db[_0xed64('0xc6')],{'as':'Account','foreignKey':_0xed64('0x1c8')});db[_0xed64('0x1dc')][_0xed64('0x117')](db[_0xed64('0x1dc')],{'as':_0xed64('0x1cc'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0x1dc')][_0xed64('0x117')](db[_0xed64('0x1dc')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db[_0xed64('0x1dc')][_0xed64('0x117')](db['ServicenowField'],{'as':_0xed64('0x1ce'),'foreignKey':'FieldId'});db[_0xed64('0x1dc')][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db['Dynamics365Account'][_0xed64('0x117')](db[_0xed64('0xcc')],{'as':_0xed64('0x1c7'),'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0xca')][_0xed64('0x126')](db['CloudProvider'],{'as':_0xed64('0x10f'),'foreignKey':'CloudProviderId'});db[_0xed64('0xcc')][_0xed64('0x117')](db[_0xed64('0xce')],{'as':_0xed64('0x1c9'),'onDelete':_0xed64('0x116'),'foreignKey':'SubjectId'});db[_0xed64('0xcc')]['hasMany'](db[_0xed64('0xce')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0xed64('0x1c5'),'onDelete':'cascade','foreignKey':_0xed64('0x1cf')});db[_0xed64('0xcc')][_0xed64('0x126')](db[_0xed64('0xca')],{'as':'Account','foreignKey':_0xed64('0x1c8')});db[_0xed64('0xce')][_0xed64('0x117')](db[_0xed64('0xce')],{'as':_0xed64('0x1cc'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0xce')]['hasMany'](db[_0xed64('0xce')],{'as':_0xed64('0x1d4'),'foreignKey':_0xed64('0x1cd')});db['Dynamics365Field'][_0xed64('0x117')](db['Dynamics365Field'],{'as':_0xed64('0x1ce'),'foreignKey':'FieldId'});db[_0xed64('0xce')][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':'Variable','foreignKey':'VariableId'});db[_0xed64('0xd0')][_0xed64('0x117')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xed64('0x116'),'foreignKey':'AccountId'});db[_0xed64('0xd2')][_0xed64('0x117')](db[_0xed64('0x1dd')],{'as':_0xed64('0x1c9'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0xd2')][_0xed64('0x117')](db[_0xed64('0x1dd')],{'as':_0xed64('0x1cb'),'foreignKey':_0xed64('0x1cd')});db[_0xed64('0xd2')][_0xed64('0x117')](db['FreshsalesField'],{'as':_0xed64('0x1c5'),'foreignKey':'FieldId'});db[_0xed64('0xd2')]['belongsTo'](db[_0xed64('0xd0')],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x1c8')});db[_0xed64('0x1dd')]['hasMany'](db['FreshsalesField'],{'as':_0xed64('0x1cc'),'foreignKey':_0xed64('0x1ca')});db[_0xed64('0x1dd')]['hasMany'](db[_0xed64('0x1dd')],{'as':'Description','foreignKey':_0xed64('0x1cd')});db[_0xed64('0x1dd')]['hasMany'](db[_0xed64('0x1dd')],{'as':_0xed64('0x1ce'),'foreignKey':_0xed64('0x1cf')});db[_0xed64('0x1dd')][_0xed64('0x126')](db[_0xed64('0x1d0')],{'as':_0xed64('0x1d0'),'foreignKey':_0xed64('0x1d1')});db['ChatQueueReport'][_0xed64('0x126')](db['ChatWebsite'],{});db[_0xed64('0xd7')]['belongsTo'](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':'ListId'});db[_0xed64('0xd7')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0xd7')][_0xed64('0x126')](db[_0xed64('0x11e')],{});db['ChatQueueReport'][_0xed64('0x126')](db[_0xed64('0x6a')],{});db[_0xed64('0xd7')][_0xed64('0x126')](db[_0xed64('0x10')],{});db[_0xed64('0xd7')][_0xed64('0x126')](db[_0xed64('0x6e')],{});db[_0xed64('0x1de')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0xed64('0x1df')});db['ChatInternalMessage']['belongsTo'](db[_0xed64('0x10')],{'onDelete':_0xed64('0x116'),'foreignKey':_0xed64('0x1e0')});db[_0xed64('0xdc')]['hasMany'](db[_0xed64('0x1e1')],{'foreignKey':'SessionId','onDelete':_0xed64('0x116')});db[_0xed64('0xdc')][_0xed64('0x117')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0xed64('0x116')});db[_0xed64('0xde')][_0xed64('0x126')](db['SmsAccount'],{});db[_0xed64('0xde')][_0xed64('0x126')](db['CmList'],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179')});db[_0xed64('0xde')]['belongsTo'](db['CmContact'],{'as':_0xed64('0x161'),'foreignKey':_0xed64('0x162')});db[_0xed64('0xde')][_0xed64('0x126')](db['SmsInteraction'],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0xed64('0xde')][_0xed64('0x126')](db[_0xed64('0x10')],{});db[_0xed64('0xde')][_0xed64('0x126')](db['SmsQueue'],{});db['JscriptyProject'][_0xed64('0x117')](db[_0xed64('0xdc')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xed64('0x117')](db[_0xed64('0x1e1')],{'foreignKey':_0xed64('0x1e2')});db[_0xed64('0xe1')][_0xed64('0x117')](db[_0xed64('0xda')],{'foreignKey':_0xed64('0x1e2')});db[_0xed64('0xe6')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'through':_0xed64('0x148')});db[_0xed64('0x12e')][_0xed64('0x127')](db['User'],{'as':'Agents','through':_0xed64('0x12f')});db['Team']['belongsToMany'](db[_0xed64('0x18')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xed64('0x12e')][_0xed64('0x127')](db['MailQueue'],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team']['belongsToMany'](db[_0xed64('0x6e')],{'through':_0xed64('0x19d'),'as':_0xed64('0x138')});db[_0xed64('0x12e')]['belongsToMany'](db[_0xed64('0x4d')],{'through':_0xed64('0x186'),'as':_0xed64('0x139')});db['Team'][_0xed64('0x127')](db[_0xed64('0x58')],{'through':_0xed64('0x1e3'),'as':'SmsQueues'});db[_0xed64('0x12e')][_0xed64('0x127')](db[_0xed64('0x61')],{'through':_0xed64('0x1e4'),'as':'OpenchannelQueues'});db[_0xed64('0x12e')][_0xed64('0x127')](db[_0xed64('0x10d')],{'through':_0xed64('0x1e5'),'as':_0xed64('0x13c')});db['Team'][_0xed64('0x127')](db[_0xed64('0xfb')],{'through':_0xed64('0x111'),'as':'VoicePrefixes'});db['Campaign'][_0xed64('0x117')](db[_0xed64('0x1a3')],{'as':'Hoppers','foreignKey':_0xed64('0x1ab')});db['Campaign']['hasMany'](db['CmHopperFinal'],{'as':_0xed64('0x11b'),'foreignKey':'CampaignId'});db[_0xed64('0xed')][_0xed64('0x117')](db[_0xed64('0x7a')],{'as':'HopperHistories','foreignKey':_0xed64('0x1ab')});db[_0xed64('0xed')]['hasMany'](db[_0xed64('0x77')],{'as':_0xed64('0x152'),'foreignKey':_0xed64('0x1ab')});db[_0xed64('0xed')][_0xed64('0x126')](db[_0xed64('0x2a')],{'as':_0xed64('0x2a'),'foreignKey':_0xed64('0x1e6')});db[_0xed64('0xed')]['belongsTo'](db[_0xed64('0x2a')],{'as':_0xed64('0x153'),'foreignKey':_0xed64('0x154')});db[_0xed64('0xed')][_0xed64('0x126')](db[_0xed64('0x84')],{'as':_0xed64('0x84'),'foreignKey':_0xed64('0x176')});db[_0xed64('0xed')][_0xed64('0x126')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xed64('0xed')][_0xed64('0x127')](db[_0xed64('0xf9')],{'as':_0xed64('0x12d'),'through':_0xed64('0x1e7')});db[_0xed64('0xed')][_0xed64('0x127')](db[_0xed64('0xf9')],{'as':'BlackLists','through':_0xed64('0x1e8')});db['Attachment'][_0xed64('0x126')](db[_0xed64('0x6c')],{'as':_0xed64('0x6c'),'foreignKey':_0xed64('0x19c')});db[_0xed64('0xf2')]['belongsTo'](db[_0xed64('0x45')],{});db[_0xed64('0xf2')][_0xed64('0x126')](db[_0xed64('0x44')],{});db[_0xed64('0xf2')][_0xed64('0x126')](db[_0xed64('0x3e')],{'foreignKey':_0xed64('0x1e9'),'as':_0xed64('0x1ea')});db['MailTransferReport'][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':_0xed64('0x1ec')});db[_0xed64('0xf2')][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1ed'),'as':_0xed64('0x1ee')});db['MailTransferReport'][_0xed64('0x126')](db[_0xed64('0x40')],{'foreignKey':_0xed64('0x1ef'),'as':_0xed64('0x1f0')});db[_0xed64('0xf2')][_0xed64('0x126')](db[_0xed64('0x3e')],{'foreignKey':'ToMailAccountId','as':_0xed64('0x1f1')});db[_0xed64('0xf4')][_0xed64('0x126')](db[_0xed64('0x6a')],{});db['ChatTransferReport'][_0xed64('0x126')](db['ChatInteraction'],{});db[_0xed64('0xf4')]['belongsTo'](db[_0xed64('0x63')],{'foreignKey':_0xed64('0x1f2'),'as':_0xed64('0x1ea')});db['ChatTransferReport'][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':_0xed64('0x1ec')});db[_0xed64('0xf4')]['belongsTo'](db[_0xed64('0x10')],{'foreignKey':'ToUserId','as':_0xed64('0x1ee')});db[_0xed64('0xf4')]['belongsTo'](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0xed64('0xf4')][_0xed64('0x126')](db[_0xed64('0x63')],{'foreignKey':_0xed64('0x1f3'),'as':'ToAccount'});db[_0xed64('0xf6')][_0xed64('0x126')](db['FaxMessage'],{});db[_0xed64('0xf6')][_0xed64('0x126')](db[_0xed64('0x121')],{});db[_0xed64('0xf6')]['belongsTo'](db[_0xed64('0x49')],{'foreignKey':_0xed64('0x1f4'),'as':'FromAccount'});db['FaxTransferReport'][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':'FromAgent'});db['FaxTransferReport'][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1ed'),'as':_0xed64('0x1ee')});db[_0xed64('0xf6')][_0xed64('0x126')](db[_0xed64('0x4d')],{'foreignKey':_0xed64('0x1f5'),'as':_0xed64('0x1f0')});db['FaxTransferReport']['belongsTo'](db[_0xed64('0x49')],{'foreignKey':'ToFaxAccountId','as':_0xed64('0x1f1')});db['OpenchannelTransferReport'][_0xed64('0x126')](db[_0xed64('0x191')],{});db['OpenchannelTransferReport'][_0xed64('0x126')](db[_0xed64('0x5e')],{});db['OpenchannelTransferReport'][_0xed64('0x126')](db['OpenchannelAccount'],{'foreignKey':_0xed64('0x1f6'),'as':_0xed64('0x1ea')});db[_0xed64('0x1f7')]['belongsTo'](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':_0xed64('0x1ec')});db['OpenchannelTransferReport']['belongsTo'](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1ed'),'as':'ToAgent'});db[_0xed64('0x1f7')][_0xed64('0x126')](db[_0xed64('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xed64('0x1f7')]['belongsTo'](db[_0xed64('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xed64('0x1f8')]['belongsTo'](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db[_0xed64('0x54')],{});db[_0xed64('0x1f8')][_0xed64('0x126')](db[_0xed64('0x51')],{'foreignKey':_0xed64('0x1f9'),'as':'FromAccount'});db[_0xed64('0x1f8')][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':'FromAgent'});db[_0xed64('0x1f8')]['belongsTo'](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1ed'),'as':_0xed64('0x1ee')});db[_0xed64('0x1f8')]['belongsTo'](db[_0xed64('0x58')],{'foreignKey':_0xed64('0x1fa'),'as':_0xed64('0x1f0')});db[_0xed64('0x1f8')][_0xed64('0x126')](db[_0xed64('0x51')],{'foreignKey':'ToSmsAccountId','as':_0xed64('0x1f1')});db[_0xed64('0xf9')][_0xed64('0x117')](db[_0xed64('0x80')],{'as':_0xed64('0x168'),'foreignKey':'ListId','onDelete':_0xed64('0x116')});db['CmList'][_0xed64('0x117')](db[_0xed64('0x1fb')],{'as':'CustomFields','foreignKey':_0xed64('0x179')});db[_0xed64('0xf9')]['hasMany'](db['CmContact'],{'as':_0xed64('0x12b'),'onDelete':'cascade','foreignKey':_0xed64('0x179')});db['CmList'][_0xed64('0x117')](db[_0xed64('0x11a')],{'as':_0xed64('0x11b'),'foreignKey':'ListId'});db[_0xed64('0xf9')]['hasMany'](db[_0xed64('0x7a')],{'as':'HopperHistory','foreignKey':_0xed64('0x179')});db[_0xed64('0xf9')]['hasMany'](db['ReportAgentPreview'],{'as':_0xed64('0x7b'),'foreignKey':_0xed64('0x179')});db[_0xed64('0xf9')][_0xed64('0x127')](db[_0xed64('0x18')],{'as':_0xed64('0x1fc'),'through':_0xed64('0x156')});db[_0xed64('0xf9')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':'Agents','through':_0xed64('0x13d')});db[_0xed64('0xfb')][_0xed64('0x117')](db[_0xed64('0x16')],{'as':_0xed64('0x1b4'),'onDelete':_0xed64('0x116')});db[_0xed64('0xfb')][_0xed64('0x127')](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':_0xed64('0x1fd')});db[_0xed64('0xfb')][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':_0xed64('0x111'),'as':'Teams'});db['UserProfile'][_0xed64('0x117')](db[_0xed64('0x10')],{'as':_0xed64('0x172'),'foreignKey':_0xed64('0x1fe')});db['UserProfile']['hasMany'](db['UserProfileSection'],{'as':_0xed64('0x1ff'),'foreignKey':_0xed64('0x1fe'),'onDelete':_0xed64('0x116')});db['UserProfileSection'][_0xed64('0x117')](db['UserProfileResource'],{'as':_0xed64('0x200'),'foreignKey':'sectionId','onDelete':_0xed64('0x116')});db[_0xed64('0x102')]['hasMany'](db[_0xed64('0x80')],{'as':_0xed64('0x168'),'foreignKey':_0xed64('0x201'),'onDelete':'cascade'});db[_0xed64('0x102')][_0xed64('0x117')](db[_0xed64('0x169')],{'as':_0xed64('0x17e'),'foreignKey':_0xed64('0x201')});db[_0xed64('0x102')][_0xed64('0x117')](db[_0xed64('0x107')],{'as':_0xed64('0x15b'),'foreignKey':'WhatsappAccountId'});db[_0xed64('0x102')]['hasMany'](db[_0xed64('0x105')],{'as':'Interactions'});db[_0xed64('0x102')][_0xed64('0x117')](db[_0xed64('0x202')],{'as':_0xed64('0x14b')});db[_0xed64('0x102')][_0xed64('0x126')](db['CmList'],{'as':_0xed64('0x16b'),'foreignKey':'ListId'});db['WhatsappAccount'][_0xed64('0x126')](db['Pause'],{'as':_0xed64('0x16d'),'foreignKey':_0xed64('0x155')});db[_0xed64('0x102')]['belongsToMany'](db[_0xed64('0x10')],{'as':_0xed64('0x157'),'through':'user_has_whatsapp_accounts'});db[_0xed64('0x202')][_0xed64('0x126')](db['User'],{'onDelete':_0xed64('0x164')});db[_0xed64('0x202')][_0xed64('0x126')](db[_0xed64('0x10d')],{'onDelete':_0xed64('0x164')});db[_0xed64('0x202')][_0xed64('0x126')](db[_0xed64('0x102')],{'onDelete':_0xed64('0x164')});db['WhatsappApplication'][_0xed64('0x126')](db[_0xed64('0x84')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x176')});db[_0xed64('0x202')][_0xed64('0x126')](db[_0xed64('0x90')],{'onDelete':_0xed64('0x164'),'foreignKey':_0xed64('0x177')});db[_0xed64('0x105')][_0xed64('0x117')](db[_0xed64('0x107')],{'as':_0xed64('0x15b'),'onDelete':'cascade','foreignKey':_0xed64('0x203')});db[_0xed64('0x105')][_0xed64('0x126')](db['WhatsappAccount'],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x201')});db[_0xed64('0x105')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':'Contact','foreignKey':_0xed64('0x162')});db[_0xed64('0x105')][_0xed64('0x126')](db['User'],{'as':_0xed64('0x183'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0xed64('0x90')],{'through':_0xed64('0x1bb'),'as':_0xed64('0x171')});db[_0xed64('0x105')][_0xed64('0x127')](db[_0xed64('0x90')],{'through':_0xed64('0x1bb'),'as':_0xed64('0x18c')});db[_0xed64('0x105')][_0xed64('0x127')](db['User'],{'as':_0xed64('0x172'),'through':_0xed64('0x204'),'foreignKey':_0xed64('0x203')});db[_0xed64('0x107')]['belongsTo'](db[_0xed64('0x10')],{'as':'User'});db[_0xed64('0x107')][_0xed64('0x126')](db[_0xed64('0x12a')],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x161')});db[_0xed64('0x107')][_0xed64('0x126')](db['WhatsappInteraction'],{'onDelete':_0xed64('0x116'),'as':_0xed64('0x174'),'foreignKey':_0xed64('0x203')});db['WhatsappMessage'][_0xed64('0x126')](db[_0xed64('0x102')],{'as':_0xed64('0x182'),'foreignKey':_0xed64('0x201')});db[_0xed64('0x109')]['belongsTo'](db['WhatsappAccount'],{});db[_0xed64('0x109')][_0xed64('0x126')](db[_0xed64('0xf9')],{'as':_0xed64('0x16b'),'foreignKey':_0xed64('0x179')});db[_0xed64('0x109')][_0xed64('0x126')](db[_0xed64('0x12a')],{'as':_0xed64('0x161'),'foreignKey':'ContactId'});db[_0xed64('0x109')][_0xed64('0x126')](db[_0xed64('0x105')],{});db['WhatsappQueueReport'][_0xed64('0x126')](db['WhatsappQueue'],{});db[_0xed64('0x109')][_0xed64('0x126')](db[_0xed64('0x107')],{});db['WhatsappQueueReport'][_0xed64('0x126')](db[_0xed64('0x10')],{});db[_0xed64('0x10b')][_0xed64('0x126')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0xed64('0x126')](db['WhatsappInteraction'],{});db[_0xed64('0x10b')][_0xed64('0x126')](db[_0xed64('0x102')],{'foreignKey':_0xed64('0x205'),'as':_0xed64('0x1ea')});db[_0xed64('0x10b')][_0xed64('0x126')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0xed64('0x1f1')});db[_0xed64('0x10b')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xed64('0x1f0')});db[_0xed64('0x10b')][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1eb'),'as':'FromAgent'});db[_0xed64('0x10b')][_0xed64('0x126')](db[_0xed64('0x10')],{'foreignKey':_0xed64('0x1ed'),'as':'ToAgent'});db[_0xed64('0x10d')][_0xed64('0x127')](db['User'],{'as':_0xed64('0x157'),'through':_0xed64('0x38'),'foreignKey':_0xed64('0x206')});db['WhatsappQueue'][_0xed64('0x127')](db[_0xed64('0x12e')],{'through':_0xed64('0x1e5'),'as':_0xed64('0x158')});db[_0xed64('0x114')][_0xed64('0x126')](db['User'],{'as':_0xed64('0x207'),'foreignKey':_0xed64('0x118'),'onDelete':_0xed64('0x116'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xed64('0xca')],{'as':'Dynamics365Account','onDelete':_0xed64('0x164')});db['CloudProvider']['hasOne'](db['MailServerIn'],{'as':_0xed64('0x166'),'onDelete':_0xed64('0x164')});db[_0xed64('0x10f')][_0xed64('0x115')](db['MailServerOut'],{'as':_0xed64('0x167'),'onDelete':_0xed64('0x164')});module[_0xed64('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc49b=['Pause','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','../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','cascade','UserId','hasOne','UserSetting','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','Contact','ContactId','CloudProvider','restrict','MailAccountId','CloudProviderId','Imap','Smtp','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','ThroughTags','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','Items','Disposition','Dispositions','Answers','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','Tags','Attachment','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Users','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','chat_interaction_has_tags','ChatQueue','ChatGroupId','CmCompany','CmHopper','HopperHistories','ChatInteractions','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CampaignId','Automation','All','OneAll','AutomationAllId','Any','AutomationId','ParentId','MailApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','ItemType','ItemTypeId','Hopper','CmHopperId','CmContactId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','Configurations','DeskAccount','DeskField','int_desk_configuration_has_tags','Description','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','Dynamics365Account','Dynamics365Field','ToId','SessionId','ProjectId','team_has_fax_queues','campaigns_has_cm_lists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','WhatsappTransferReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','sequelizeHistory','utf8mb4','name','utf8','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model'];(function(_0xa23a42,_0x1b974f){var _0x5c3e7c=function(_0x1b4a32){while(--_0x1b4a32){_0xa23a42['push'](_0xa23a42['shift']());}};_0x5c3e7c(++_0x1b974f);}(_0xc49b,0x181));var _0xbc49=function(_0x1b4c44,_0x1149f5){_0x1b4c44=_0x1b4c44-0x0;var _0x28d604=_0xc49b[_0x1b4c44];return _0x28d604;};'use strict';var config=require(_0xbc49('0x0'));var Sequelize=require(_0xbc49('0x1'));var _=require(_0xbc49('0x2'));var jstz=require('jstz');var timezone=jstz[_0xbc49('0x3')]();config[_0xbc49('0x1')]=_[_0xbc49('0x4')](config['sequelize'],{'database':_0xbc49('0x5'),'username':_0xbc49('0x6'),'password':_0xbc49('0x7'),'options':{'host':_0xbc49('0x8'),'port':0xcea,'dialect':_0xbc49('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0xbc49('0xa')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0xbc49('0x6'),'password':_0xbc49('0x7'),'options':{'host':_0xbc49('0x8'),'port':0xcea,'dialect':_0xbc49('0x9'),'dialectOptions':{'charset':_0xbc49('0xb')},'logging':![],'timezone':timezone[_0xbc49('0xc')](),'define':{'charset':_0xbc49('0xd'),'collate':_0xbc49('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbc49('0x1')][_0xbc49('0xf')],config[_0xbc49('0x1')][_0xbc49('0x10')],config[_0xbc49('0x1')][_0xbc49('0x11')],config[_0xbc49('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xbc49('0xf')],config[_0xbc49('0xa')][_0xbc49('0x10')],config[_0xbc49('0xa')][_0xbc49('0x11')],config[_0xbc49('0xa')][_0xbc49('0x12')])};db[_0xbc49('0x13')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x15'));db[_0xbc49('0x16')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x17'));db[_0xbc49('0x18')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x19'));db['VoiceExtension']=db[_0xbc49('0x1')]['import'](_0xbc49('0x1a'));db[_0xbc49('0x1b')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x1c'));db[_0xbc49('0x1d')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x1e'));db[_0xbc49('0x1f')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x20'));db['ScreenRecording']=db[_0xbc49('0x1')]['import'](_0xbc49('0x21'));db[_0xbc49('0x22')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x23'));db[_0xbc49('0x24')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xbc49('0x1')]['import'](_0xbc49('0x25'));db[_0xbc49('0x26')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x27'));db['VoiceQueueReport']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x28'));db[_0xbc49('0x29')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x2a'));db['Trunk']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x2b'));db[_0xbc49('0x2c')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x2d'));db[_0xbc49('0x2e')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x2f'));db[_0xbc49('0x30')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x31'));db[_0xbc49('0x32')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x33'));db[_0xbc49('0x34')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x35'));db[_0xbc49('0x36')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x37'));db[_0xbc49('0x38')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x39'));db[_0xbc49('0x3a')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x3b'));db[_0xbc49('0x3c')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x3d'));db[_0xbc49('0x3e')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x3f'));db[_0xbc49('0x40')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x41'));db[_0xbc49('0x42')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x43'));db[_0xbc49('0x44')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x45'));db['MailSubstatus']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x46'));db[_0xbc49('0x47')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x48'));db[_0xbc49('0x49')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x4a'));db[_0xbc49('0x4b')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x4c'));db['MailQueueReport']=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0xbc49('0x4d')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x4e'));db[_0xbc49('0x4f')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x50'));db[_0xbc49('0x51')]=db[_0xbc49('0x1')]['import']('../api/faxAccount/faxAccount.model');db[_0xbc49('0x52')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x53'));db[_0xbc49('0x54')]=db['sequelize'][_0xbc49('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0xbc49('0x55')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x56'));db[_0xbc49('0x57')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x58'));db['FaxQueueReport']=db[_0xbc49('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0xbc49('0x59')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x5a'));db[_0xbc49('0x5b')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x5c'));db[_0xbc49('0x5d')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x5e'));db[_0xbc49('0x5f')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/smsMessage/smsMessage.model');db[_0xbc49('0x60')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x61'));db['OpenchannelAccount']=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0xbc49('0x62')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x63'));db['OpenchannelInteraction']=db[_0xbc49('0x1')]['import'](_0xbc49('0x64'));db[_0xbc49('0x65')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x66'));db[_0xbc49('0x67')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x68'));db[_0xbc49('0x69')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0xbc49('0x6a')]=db['sequelize']['import'](_0xbc49('0x6b'));db['ChatApplication']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x6c'));db[_0xbc49('0x6d')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x6e'));db['ChatMessage']=db[_0xbc49('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0xbc49('0x1')]['import'](_0xbc49('0x6f'));db[_0xbc49('0x70')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x71'));db[_0xbc49('0x72')]=db[_0xbc49('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x73'));db[_0xbc49('0x74')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x75'));db['CmHopper']=db['sequelize']['import'](_0xbc49('0x76'));db[_0xbc49('0x77')]=db['sequelize'][_0xbc49('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xbc49('0x78')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xbc49('0x79')]=db['sequelize']['import'](_0xbc49('0x7a'));db[_0xbc49('0x7b')]=db['sequelize']['import'](_0xbc49('0x7c'));db[_0xbc49('0x7d')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x7e'));db[_0xbc49('0x7f')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x80'));db['Automation']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x81'));db[_0xbc49('0x82')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x83'));db['Disposition']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x84'));db[_0xbc49('0x85')]=db['sequelize']['import'](_0xbc49('0x86'));db['Interval']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x87'));db[_0xbc49('0x88')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/pause/pause.model');db[_0xbc49('0x89')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/cdr/cdr.model');db[_0xbc49('0x8a')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x8b'));db[_0xbc49('0x8c')]=db['sequelize']['import']('../api/schedule/schedule.model');db[_0xbc49('0x8d')]=db[_0xbc49('0x1')]['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x8e'));db[_0xbc49('0x8f')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/contactItemType/contactItemType.model');db[_0xbc49('0x90')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x91'));db[_0xbc49('0x92')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x93'));db[_0xbc49('0x94')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/template/template.model');db[_0xbc49('0x95')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x96'));db[_0xbc49('0x97')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x98'));db['Integration']=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/integration/integration.model');db[_0xbc49('0x99')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x9a'));db[_0xbc49('0x9b')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x9c'));db[_0xbc49('0x9d')]=db['sequelize'][_0xbc49('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xbc49('0x9e')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x9f'));db['AnalyticMetric']=db[_0xbc49('0x1')]['import'](_0xbc49('0xa0'));db[_0xbc49('0xa1')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xa2'));db[_0xbc49('0xa3')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xbc49('0xa4')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xbc49('0xa5')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xa6'));db[_0xbc49('0xa7')]=db['sequelize']['import'](_0xbc49('0xa8'));db[_0xbc49('0xa9')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xaa'));db[_0xbc49('0xab')]=db['sequelize']['import'](_0xbc49('0xac'));db[_0xbc49('0xad')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xae'));db['DeskAccount']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xaf'));db[_0xbc49('0xb0')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xb1'));db['DeskField']=db[_0xbc49('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xbc49('0xb2')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xb3'));db[_0xbc49('0xb4')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xb5'));db[_0xbc49('0xb6')]=db['sequelize'][_0xbc49('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xbc49('0xb7')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xbc49('0xb8')]=db['sequelize']['import'](_0xbc49('0xb9'));db['FreshdeskConfiguration']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xba'));db['FreshdeskField']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xbb'));db[_0xbc49('0xbc')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xbd'));db['VtigerConfiguration']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xbe'));db[_0xbc49('0xbf')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xc0'));db['ServicenowAccount']=db['sequelize'][_0xbc49('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xbc49('0xc1')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xc2'));db[_0xbc49('0xc3')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xc4'));db['Dynamics365Account']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xc5'));db[_0xbc49('0xc6')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xc7'));db['Dynamics365Field']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xc8'));db[_0xbc49('0xc9')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xca'));db[_0xbc49('0xcb')]=db[_0xbc49('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xbc49('0xcc')]=db['sequelize']['import'](_0xbc49('0xcd'));db['Integration']=db['sequelize'][_0xbc49('0x14')]('../api/integration/integration.model');db['Network']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xce'));db[_0xbc49('0xcf')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xd0'));db[_0xbc49('0xd1')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xd2'));db[_0xbc49('0xd3')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xd4'));db[_0xbc49('0xd5')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xd6'));db[_0xbc49('0xd7')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xd8'));db[_0xbc49('0xd9')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xda'));db[_0xbc49('0xdb')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xdc'));db[_0xbc49('0xdd')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xde'));db[_0xbc49('0xdf')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe0'));db[_0xbc49('0xe1')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe2'));db[_0xbc49('0xe3')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe4'));db[_0xbc49('0xe5')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe6'));db[_0xbc49('0xe7')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe8'));db['SquareMessage']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xe9'));db[_0xbc49('0xea')]=db['sequelize']['import'](_0xbc49('0xeb'));db[_0xbc49('0xec')]=db['sequelize']['import']('../api/license/license.model');db[_0xbc49('0xed')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/campaign/campaign.model');db[_0xbc49('0xee')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xef'));db['Attachment']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xf0'));db[_0xbc49('0xf1')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xf2'));db[_0xbc49('0xf3')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xbc49('0xf4')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xf5'));db[_0xbc49('0xf6')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xf7'));db['OpenchannelTransferReport']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xf8'));db[_0xbc49('0xf9')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0xfa'));db[_0xbc49('0xfb')]=db[_0xbc49('0x1')]['import'](_0xbc49('0xfc'));db[_0xbc49('0xfd')]=db['sequelize'][_0xbc49('0x14')](_0xbc49('0xfe'));db[_0xbc49('0xff')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x100'));db['UserProfileSection']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x101'));db[_0xbc49('0x102')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x103'));db[_0xbc49('0x104')]=db['sequelize']['import'](_0xbc49('0x105'));db['WhatsappAccount']=db['sequelize'][_0xbc49('0x14')](_0xbc49('0x106'));db[_0xbc49('0x107')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x108'));db[_0xbc49('0x109')]=db[_0xbc49('0x1')][_0xbc49('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xbc49('0x10a')]=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x10b'));db[_0xbc49('0x10c')]=db[_0xbc49('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xbc49('0x1')]['import'](_0xbc49('0x10d'));db['WhatsappQueue']=db['sequelize'][_0xbc49('0x14')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x10e'));db[_0xbc49('0x10f')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x110'));db[_0xbc49('0x111')]=db['sequelize']['import'](_0xbc49('0x112'));db[_0xbc49('0x113')]=db[_0xbc49('0x1')]['import'](_0xbc49('0x114'));db['UserSetting']=db[_0xbc49('0x1')][_0xbc49('0x14')](_0xbc49('0x115'));db[_0xbc49('0x13')]['hasOne'](db[_0xbc49('0x22')],{'as':_0xbc49('0x22'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x117')});db['User'][_0xbc49('0x118')](db[_0xbc49('0x119')],{'as':_0xbc49('0x11a'),'onDelete':_0xbc49('0x116'),'foreignKey':'UserId'});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x1f')],{'as':_0xbc49('0x11c'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x2e')],{'as':_0xbc49('0x11d'),'foreignKey':_0xbc49('0x117')});db['User'][_0xbc49('0x11b')](db[_0xbc49('0x11e')],{'as':_0xbc49('0x11f'),'onDelete':'cascade','hooks':!![]});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x78')],{'as':_0xbc49('0x120'),'foreignKey':_0xbc49('0x117')});db['User'][_0xbc49('0x11b')](db[_0xbc49('0x79')],{'as':_0xbc49('0x121'),'foreignKey':'UserId'});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x7b')],{'as':_0xbc49('0x7b'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')]['hasMany'](db[_0xbc49('0x122')],{'as':_0xbc49('0x123'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x6d')],{'as':'ChatInteractions','foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x5d')],{'as':'SmsInteractions','foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x54')],{'as':_0xbc49('0x124'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db['MailInteraction'],{'as':_0xbc49('0x125'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x13')][_0xbc49('0x11b')](db['WhatsappInteraction'],{'as':_0xbc49('0x126'),'foreignKey':'UserId'});db[_0xbc49('0x13')][_0xbc49('0x11b')](db[_0xbc49('0x104')],{'as':_0xbc49('0x127'),'foreignKey':_0xbc49('0x128')});db[_0xbc49('0x13')][_0xbc49('0x129')](db['UserProfile'],{'as':_0xbc49('0xff'),'foreignKey':'userProfileId'});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x70')],{'as':_0xbc49('0x12b'),'through':_0xbc49('0x12c')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db['CmContact'],{'as':_0xbc49('0x12d'),'through':'cm_user_has_contacts'});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0xfb')],{'as':'Lists','through':'cm_user_has_lists'});db[_0xbc49('0x13')][_0xbc49('0x12a')](db['Team'],{'through':_0xbc49('0x12e')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db['MailInteraction'],{'as':_0xbc49('0x125'),'through':'user_has_mail_interactions'});db[_0xbc49('0x13')]['belongsToMany'](db[_0xbc49('0x6d')],{'as':'ChatInteractions','through':_0xbc49('0x12f')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db['FaxInteraction'],{'as':_0xbc49('0x124'),'through':_0xbc49('0x130')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x5d')],{'as':_0xbc49('0x131'),'through':_0xbc49('0x132')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x122')],{'as':_0xbc49('0x123'),'through':_0xbc49('0x133')});db['User'][_0xbc49('0x12a')](db[_0xbc49('0x109')],{'as':_0xbc49('0x126'),'through':'user_has_whatsapp_interactions'});db[_0xbc49('0x13')]['belongsToMany'](db[_0xbc49('0x1d')],{'as':_0xbc49('0x134'),'through':_0xbc49('0x30'),'required':![]});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0xfd')],{'as':_0xbc49('0x135'),'through':_0xbc49('0x113'),'required':![]});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x44')],{'as':'MailQueues','through':_0xbc49('0x34'),'required':![]});db['User'][_0xbc49('0x12a')](db['ChatQueue'],{'as':_0xbc49('0x136'),'through':_0xbc49('0x32'),'required':![],'hooks':!![]});db[_0xbc49('0x13')][_0xbc49('0x12a')](db['FaxQueue'],{'as':_0xbc49('0x137'),'through':_0xbc49('0x36'),'required':![]});db['User'][_0xbc49('0x12a')](db[_0xbc49('0x60')],{'as':_0xbc49('0x138'),'through':_0xbc49('0x38'),'required':![]});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x67')],{'as':_0xbc49('0x139'),'through':_0xbc49('0x3a'),'required':![]});db[_0xbc49('0x13')]['belongsToMany'](db[_0xbc49('0x13a')],{'as':_0xbc49('0x13b'),'through':_0xbc49('0x3c'),'required':![]});db[_0xbc49('0x13')]['belongsToMany'](db[_0xbc49('0xfb')],{'through':'cm_user_has_lists'});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x69')],{'as':_0xbc49('0x13c'),'through':_0xbc49('0x13d')});db[_0xbc49('0x13')]['belongsToMany'](db[_0xbc49('0x51')],{'as':_0xbc49('0x13e'),'through':_0xbc49('0x13f')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x42')],{'as':_0xbc49('0x140'),'through':_0xbc49('0x141')});db['User']['belongsToMany'](db[_0xbc49('0x142')],{'as':_0xbc49('0x143'),'through':_0xbc49('0x144')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x59')],{'as':_0xbc49('0x145'),'through':_0xbc49('0x146')});db[_0xbc49('0x13')][_0xbc49('0x12a')](db[_0xbc49('0x147')],{'as':'WhatsappAccounts','through':_0xbc49('0x148')});db['User'][_0xbc49('0x12a')](db[_0xbc49('0xe5')],{'as':_0xbc49('0x149'),'through':_0xbc49('0x14a')});db['VoiceChanSpy']['hasMany'](db[_0xbc49('0x11e')],{'as':_0xbc49('0x14b'),'onDelete':'cascade','foreignKey':_0xbc49('0x14c')});db[_0xbc49('0x18')][_0xbc49('0x11b')](db['VoiceExtension'],{'onDelete':_0xbc49('0x116')});db[_0xbc49('0x11e')][_0xbc49('0x11b')](db[_0xbc49('0x11e')],{'as':_0xbc49('0x14d'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1b')][_0xbc49('0x12a')](db[_0xbc49('0x8d')],{'as':_0xbc49('0x14e'),'through':_0xbc49('0x14f')});db[_0xbc49('0x1d')]['hasMany'](db[_0xbc49('0x2e')],{'as':_0xbc49('0x150'),'foreignKey':_0xbc49('0x151')});db[_0xbc49('0x1d')][_0xbc49('0x11b')](db['CmHopper'],{'as':_0xbc49('0x152'),'foreignKey':_0xbc49('0x151')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':_0xbc49('0x120'),'foreignKey':_0xbc49('0x151')});db[_0xbc49('0x1d')][_0xbc49('0x11b')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xbc49('0x151')});db[_0xbc49('0x1d')][_0xbc49('0x11b')](db[_0xbc49('0x7b')],{'as':_0xbc49('0x7b'),'foreignKey':'VoiceQueueId'});db[_0xbc49('0x1d')][_0xbc49('0x11b')](db[_0xbc49('0x77')],{'as':_0xbc49('0x153'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xbc49('0x11b')](db[_0xbc49('0xd7')],{'as':_0xbc49('0x154'),'foreignKey':_0xbc49('0x151')});db['VoiceQueue'][_0xbc49('0x129')](db['Trunk'],{'as':_0xbc49('0x155'),'foreignKey':_0xbc49('0x156')});db[_0xbc49('0x1d')]['belongsTo'](db[_0xbc49('0x155')],{'as':_0xbc49('0x157'),'foreignKey':_0xbc49('0x158')});db[_0xbc49('0x1d')][_0xbc49('0x129')](db['Interval'],{'as':_0xbc49('0x159'),'foreignKey':'IntervalId'});db[_0xbc49('0x1d')][_0xbc49('0x129')](db[_0xbc49('0x88')],{'as':_0xbc49('0x15a'),'foreignKey':_0xbc49('0x15b')});db[_0xbc49('0x1d')][_0xbc49('0x12a')](db['CmList'],{'as':_0xbc49('0x15c'),'through':_0xbc49('0x15d')});db[_0xbc49('0x1d')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':'UserVoiceQueue'});db[_0xbc49('0x1d')][_0xbc49('0x12a')](db[_0xbc49('0xea')],{'as':_0xbc49('0x15f'),'through':_0xbc49('0x10f')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0xbc49('0x160'),'through':'voice_queues_has_cm_blacklists'});db[_0xbc49('0x1f')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x13'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x161')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x13'),'foreignKey':'UserId'});db[_0xbc49('0x22')][_0xbc49('0x11b')](db[_0xbc49('0x24')],{'as':_0xbc49('0x162'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x163'),'sourceKey':_0xbc49('0x164')});db[_0xbc49('0x24')][_0xbc49('0x129')](db[_0xbc49('0x22')],{'foreignKey':_0xbc49('0x163'),'targetKey':'mailbox'});db[_0xbc49('0x165')][_0xbc49('0x11b')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xbc49('0x166'),'constraints':![]});db['VoiceCallReport'][_0xbc49('0x11b')](db[_0xbc49('0x26')],{'as':'AgentReports','foreignKey':_0xbc49('0x166'),'constraints':![]});db[_0xbc49('0x165')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':'User','foreignKey':_0xbc49('0x117')});db[_0xbc49('0x165')][_0xbc49('0x129')](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168')});db[_0xbc49('0x3e')][_0xbc49('0x129')](db[_0xbc49('0x42')],{'as':_0xbc49('0x42'),'foreignKey':'MailAccountId'});db[_0xbc49('0x3e')]['belongsTo'](db[_0xbc49('0x169')],{'as':_0xbc49('0x169'),'foreignKey':'CloudProviderId','onDelete':_0xbc49('0x16a')});db[_0xbc49('0x40')][_0xbc49('0x129')](db[_0xbc49('0x42')],{'as':_0xbc49('0x42'),'foreignKey':_0xbc49('0x16b')});db['MailServerOut'][_0xbc49('0x129')](db['CloudProvider'],{'as':_0xbc49('0x169'),'foreignKey':_0xbc49('0x16c'),'onDelete':'restrict'});db[_0xbc49('0x42')]['hasOne'](db[_0xbc49('0x3e')],{'as':_0xbc49('0x16d'),'onDelete':'cascade'});db[_0xbc49('0x42')][_0xbc49('0x118')](db[_0xbc49('0x40')],{'as':_0xbc49('0x16e'),'onDelete':'cascade'});db[_0xbc49('0x42')][_0xbc49('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xbc49('0x16b'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x42')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xbc49('0x16b')});db[_0xbc49('0x42')][_0xbc49('0x11b')](db[_0xbc49('0x49')],{'as':_0xbc49('0x162'),'foreignKey':_0xbc49('0x16b')});db[_0xbc49('0x42')][_0xbc49('0x11b')](db[_0xbc49('0x47')],{'as':_0xbc49('0x16f')});db[_0xbc49('0x42')][_0xbc49('0x11b')](db[_0xbc49('0x4b')],{'as':_0xbc49('0x14d')});db[_0xbc49('0x42')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0x42')][_0xbc49('0x129')](db['Template'],{'as':'Template','foreignKey':_0xbc49('0x172')});db['MailAccount'][_0xbc49('0x129')](db[_0xbc49('0x88')],{'as':_0xbc49('0x15a'),'foreignKey':_0xbc49('0x15b')});db[_0xbc49('0x42')]['belongsToMany'](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0xbc49('0x13')],{'as':'Agents','through':_0xbc49('0x34')});db[_0xbc49('0x44')]['belongsToMany'](db[_0xbc49('0xea')],{'through':_0xbc49('0x173'),'as':_0xbc49('0x15f')});db['MailInteraction']['hasMany'](db[_0xbc49('0x49')],{'as':_0xbc49('0x162'),'onDelete':'cascade','foreignKey':_0xbc49('0x174')});db[_0xbc49('0x47')][_0xbc49('0x129')](db[_0xbc49('0x42')],{'as':_0xbc49('0x175'),'foreignKey':'MailAccountId'});db[_0xbc49('0x47')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'as':_0xbc49('0x167'),'foreignKey':'ContactId'});db[_0xbc49('0x47')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x176'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x47')][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x178'),'as':'Tags'});db[_0xbc49('0x47')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x178'),'as':_0xbc49('0x179')});db[_0xbc49('0x47')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':'Users','through':_0xbc49('0x17a'),'foreignKey':_0xbc49('0x174')});db[_0xbc49('0x49')]['hasMany'](db['Attachment'],{'as':_0xbc49('0x17b'),'onDelete':_0xbc49('0x116')});db['MailMessage'][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x13')});db['MailMessage'][_0xbc49('0x129')](db[_0xbc49('0x74')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x167')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0xbc49('0x17c'),'foreignKey':_0xbc49('0x174')});db['MailMessage'][_0xbc49('0x129')](db[_0xbc49('0x42')],{'as':_0xbc49('0x175'),'foreignKey':'MailAccountId'});db[_0xbc49('0x49')][_0xbc49('0x129')](db[_0xbc49('0x69')],{'as':_0xbc49('0x69'),'foreignKey':_0xbc49('0x17d')});db[_0xbc49('0x49')][_0xbc49('0x129')](db[_0xbc49('0x17e')],{'as':_0xbc49('0x17e'),'foreignKey':_0xbc49('0x17f')});db[_0xbc49('0x4b')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x4b')][_0xbc49('0x129')](db['MailQueue'],{'onDelete':_0xbc49('0x16a')});db['MailApplication'][_0xbc49('0x129')](db['MailAccount'],{'onDelete':'restrict'});db[_0xbc49('0x4b')][_0xbc49('0x129')](db[_0xbc49('0x159')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x180')});db['MailApplication'][_0xbc49('0x129')](db[_0xbc49('0x177')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x181')});db[_0xbc49('0x182')]['belongsTo'](db['MailAccount'],{});db[_0xbc49('0x182')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':'List','foreignKey':_0xbc49('0x171')});db[_0xbc49('0x182')]['belongsTo'](db[_0xbc49('0x74')],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168')});db[_0xbc49('0x182')][_0xbc49('0x129')](db[_0xbc49('0x47')],{});db[_0xbc49('0x182')]['belongsTo'](db[_0xbc49('0x49')],{});db['MailQueueReport'][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db[_0xbc49('0x182')][_0xbc49('0x129')](db[_0xbc49('0x44')],{});db[_0xbc49('0x4d')]['hasMany'](db[_0xbc49('0x4f')],{'as':_0xbc49('0x183'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x51')][_0xbc49('0x11b')](db[_0xbc49('0x184')],{'as':_0xbc49('0x185'),'foreignKey':'FaxAccountId','onDelete':_0xbc49('0x116')});db[_0xbc49('0x51')][_0xbc49('0x11b')](db[_0xbc49('0x82')],{'as':_0xbc49('0x186'),'foreignKey':_0xbc49('0x187')});db[_0xbc49('0x51')]['hasMany'](db[_0xbc49('0x54')],{'as':_0xbc49('0x16f')});db[_0xbc49('0x51')][_0xbc49('0x11b')](db[_0xbc49('0x52')],{'as':_0xbc49('0x14d')});db[_0xbc49('0x51')][_0xbc49('0x11b')](db[_0xbc49('0x11e')],{'as':_0xbc49('0x188'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x51')][_0xbc49('0x11b')](db[_0xbc49('0x55')],{'as':_0xbc49('0x162')});db['FaxAccount'][_0xbc49('0x129')](db[_0xbc49('0x155')],{'as':_0xbc49('0x155')});db['FaxAccount']['belongsTo'](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db['FaxAccount']['belongsTo'](db[_0xbc49('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0xbc49('0x15b')});db['FaxAccount'][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x13f')});db['FaxApplication'][_0xbc49('0x129')](db[_0xbc49('0x13')],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x52')][_0xbc49('0x129')](db[_0xbc49('0x57')],{'onDelete':'restrict'});db[_0xbc49('0x52')][_0xbc49('0x129')](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0xbc49('0x129')](db[_0xbc49('0x177')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x181')});db[_0xbc49('0x54')]['hasMany'](db[_0xbc49('0x55')],{'as':_0xbc49('0x162'),'onDelete':'cascade','foreignKey':_0xbc49('0x189')});db[_0xbc49('0x54')][_0xbc49('0x129')](db[_0xbc49('0x51')],{'as':_0xbc49('0x175'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0xbc49('0x129')](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':'ContactId'});db[_0xbc49('0x54')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x176'),'foreignKey':'UserId'});db['FaxInteraction'][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x18a'),'as':_0xbc49('0x18b')});db[_0xbc49('0x54')][_0xbc49('0x12a')](db['Tag'],{'through':_0xbc49('0x18a'),'as':_0xbc49('0x179')});db[_0xbc49('0x54')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':'Users','through':_0xbc49('0x130'),'foreignKey':'FaxInteractionId'});db[_0xbc49('0x55')][_0xbc49('0x129')](db['User'],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0xbc49('0x129')](db[_0xbc49('0x54')],{'as':'Interaction','foreignKey':_0xbc49('0x189')});db[_0xbc49('0x55')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x167')});db[_0xbc49('0x55')]['belongsTo'](db[_0xbc49('0x18c')],{'as':_0xbc49('0x18c'),'foreignKey':_0xbc49('0x18d')});db[_0xbc49('0x55')][_0xbc49('0x129')](db[_0xbc49('0x51')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x187')});db[_0xbc49('0x57')]['belongsToMany'](db[_0xbc49('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0xbc49('0x57')]['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0xbc49('0x15f')});db[_0xbc49('0x18e')][_0xbc49('0x129')](db[_0xbc49('0x51')],{});db[_0xbc49('0x18e')]['belongsTo'](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0x18e')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'as':'Contact','foreignKey':_0xbc49('0x168')});db['FaxQueueReport'][_0xbc49('0x129')](db[_0xbc49('0x54')],{});db[_0xbc49('0x18e')][_0xbc49('0x129')](db['FaxMessage'],{});db[_0xbc49('0x18e')][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db[_0xbc49('0x18e')][_0xbc49('0x129')](db['FaxQueue'],{});db[_0xbc49('0x59')][_0xbc49('0x11b')](db[_0xbc49('0x184')],{'as':_0xbc49('0x185'),'foreignKey':_0xbc49('0x18f'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x59')][_0xbc49('0x11b')](db[_0xbc49('0x82')],{'as':_0xbc49('0x186'),'foreignKey':_0xbc49('0x18f')});db[_0xbc49('0x59')][_0xbc49('0x11b')](db['SmsMessage'],{'as':_0xbc49('0x162'),'foreignKey':_0xbc49('0x18f')});db[_0xbc49('0x59')][_0xbc49('0x11b')](db[_0xbc49('0x5d')],{'as':_0xbc49('0x16f')});db['SmsAccount'][_0xbc49('0x11b')](db[_0xbc49('0x5b')],{'as':_0xbc49('0x14d')});db['SmsAccount'][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db['SmsAccount'][_0xbc49('0x129')](db[_0xbc49('0x88')],{'as':_0xbc49('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbc49('0x59')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x146')});db[_0xbc49('0x5b')][_0xbc49('0x129')](db['User'],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x5b')][_0xbc49('0x129')](db[_0xbc49('0x60')],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x5b')]['belongsTo'](db[_0xbc49('0x59')],{'onDelete':_0xbc49('0x16a')});db['SmsApplication'][_0xbc49('0x129')](db['Interval'],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x180')});db['SmsApplication'][_0xbc49('0x129')](db['Tag'],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x181')});db['SmsInteraction']['hasMany'](db[_0xbc49('0x5f')],{'as':'Messages','onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x190')});db[_0xbc49('0x5d')][_0xbc49('0x129')](db[_0xbc49('0x59')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x18f')});db[_0xbc49('0x5d')][_0xbc49('0x129')](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168')});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xbc49('0x176'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x5d')]['belongsToMany'](db[_0xbc49('0x177')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0xbc49('0x5d')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x191'),'as':'ThroughTags'});db[_0xbc49('0x5d')]['belongsToMany'](db['User'],{'as':_0xbc49('0x192'),'through':'user_has_sms_interactions','foreignKey':_0xbc49('0x190')});db[_0xbc49('0x5f')][_0xbc49('0x129')](db['User'],{'as':'User'});db['SmsMessage'][_0xbc49('0x129')](db[_0xbc49('0x74')],{'onDelete':'cascade','as':_0xbc49('0x167')});db['SmsMessage'][_0xbc49('0x129')](db[_0xbc49('0x5d')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xbc49('0x190')});db[_0xbc49('0x5f')]['belongsTo'](db[_0xbc49('0x59')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x18f')});db[_0xbc49('0x60')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x38'),'foreignKey':_0xbc49('0x193')});db[_0xbc49('0x60')][_0xbc49('0x12a')](db['Team'],{'through':_0xbc49('0x194'),'as':_0xbc49('0x15f')});db[_0xbc49('0x142')]['hasMany'](db[_0xbc49('0x184')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xbc49('0x116')});db[_0xbc49('0x142')][_0xbc49('0x11b')](db['CannedAnswer'],{'as':_0xbc49('0x186'),'foreignKey':_0xbc49('0x195')});db['OpenchannelAccount'][_0xbc49('0x11b')](db[_0xbc49('0x122')],{'as':_0xbc49('0x16f'),'foreignKey':_0xbc49('0x195')});db[_0xbc49('0x142')][_0xbc49('0x11b')](db['OpenchannelMessage'],{'as':_0xbc49('0x162'),'foreignKey':'OpenchannelAccountId'});db[_0xbc49('0x142')][_0xbc49('0x11b')](db[_0xbc49('0x62')],{'as':_0xbc49('0x14d'),'foreignKey':'OpenchannelAccountId'});db[_0xbc49('0x142')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':'List','foreignKey':_0xbc49('0x171')});db[_0xbc49('0x142')][_0xbc49('0x129')](db[_0xbc49('0x88')],{'as':_0xbc49('0x15a'),'foreignKey':_0xbc49('0x15b')});db[_0xbc49('0x142')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x144')});db[_0xbc49('0x62')][_0xbc49('0x129')](db['User'],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x62')][_0xbc49('0x129')](db[_0xbc49('0x67')],{'onDelete':'restrict','foreignKey':_0xbc49('0x196')});db[_0xbc49('0x62')][_0xbc49('0x129')](db[_0xbc49('0x142')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x195')});db['OpenchannelApplication'][_0xbc49('0x129')](db[_0xbc49('0x159')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x180')});db[_0xbc49('0x62')][_0xbc49('0x129')](db['Tag'],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x181')});db[_0xbc49('0x122')]['hasMany'](db[_0xbc49('0x65')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xbc49('0x197')});db[_0xbc49('0x122')][_0xbc49('0x129')](db[_0xbc49('0x142')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x195')});db['OpenchannelInteraction'][_0xbc49('0x129')](db[_0xbc49('0x74')],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168')});db['OpenchannelInteraction'][_0xbc49('0x129')](db['User'],{'as':_0xbc49('0x176'),'foreignKey':'UserId'});db[_0xbc49('0x122')][_0xbc49('0x12a')](db['Tag'],{'through':_0xbc49('0x198'),'as':_0xbc49('0x18b')});db[_0xbc49('0x122')][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x198'),'as':_0xbc49('0x179')});db[_0xbc49('0x122')][_0xbc49('0x12a')](db['User'],{'as':_0xbc49('0x192'),'through':_0xbc49('0x133'),'foreignKey':'OpenchannelInteractionId'});db[_0xbc49('0x65')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'onDelete':'cascade','as':_0xbc49('0x13')});db[_0xbc49('0x65')]['belongsTo'](db[_0xbc49('0x74')],{'onDelete':'cascade','as':_0xbc49('0x167')});db[_0xbc49('0x65')]['belongsTo'](db[_0xbc49('0x122')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x17c'),'foreignKey':_0xbc49('0x197')});db['OpenchannelMessage'][_0xbc49('0x129')](db[_0xbc49('0x18c')],{'as':_0xbc49('0x18c'),'foreignKey':_0xbc49('0x18d')});db[_0xbc49('0x65')]['belongsTo'](db[_0xbc49('0x142')],{'as':'Account','foreignKey':_0xbc49('0x195')});db[_0xbc49('0x67')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':'UserOpenchannelQueue','foreignKey':_0xbc49('0x196')});db[_0xbc49('0x67')][_0xbc49('0x12a')](db[_0xbc49('0xea')],{'through':_0xbc49('0x199'),'as':_0xbc49('0x15f')});db[_0xbc49('0x69')][_0xbc49('0x11b')](db[_0xbc49('0x184')],{'as':_0xbc49('0x185'),'foreignKey':_0xbc49('0x17d'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x69')][_0xbc49('0x11b')](db[_0xbc49('0x82')],{'as':_0xbc49('0x186'),'foreignKey':'ChatWebsiteId'});db[_0xbc49('0x69')]['hasMany'](db[_0xbc49('0x72')],{'as':_0xbc49('0x19a')});db['ChatWebsite'][_0xbc49('0x11b')](db[_0xbc49('0x6d')],{'as':'Interactions'});db[_0xbc49('0x69')]['hasMany'](db[_0xbc49('0x19b')],{'as':'Applications'});db[_0xbc49('0x69')][_0xbc49('0x11b')](db['ChatMessage'],{'as':'Messages'});db[_0xbc49('0x69')]['belongsTo'](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0x69')]['belongsTo'](db[_0xbc49('0x159')],{'as':'Interval','foreignKey':_0xbc49('0x180')});db[_0xbc49('0x69')][_0xbc49('0x129')](db[_0xbc49('0x42')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xbc49('0x69')]['belongsTo'](db['Pause'],{'as':_0xbc49('0x15a'),'foreignKey':_0xbc49('0x15b')});db[_0xbc49('0x69')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xbc49('0x13d')});db[_0xbc49('0x6a')][_0xbc49('0x129')](db[_0xbc49('0x142')],{});db[_0xbc49('0x6a')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db['OpenchannelQueueReport']['belongsTo'](db[_0xbc49('0x74')],{'as':'Contact','foreignKey':_0xbc49('0x168')});db[_0xbc49('0x6a')][_0xbc49('0x129')](db[_0xbc49('0x122')],{});db[_0xbc49('0x6a')][_0xbc49('0x129')](db[_0xbc49('0x65')],{});db['OpenchannelQueueReport'][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db[_0xbc49('0x6a')][_0xbc49('0x129')](db[_0xbc49('0x67')],{});db[_0xbc49('0x19b')][_0xbc49('0x129')](db['User'],{'as':_0xbc49('0x19c'),'foreignKey':_0xbc49('0x117'),'onDelete':_0xbc49('0x16a')});db['ChatApplication'][_0xbc49('0x129')](db['ChatQueue'],{'as':_0xbc49('0x19d'),'foreignKey':_0xbc49('0x19e'),'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x19b')][_0xbc49('0x129')](db[_0xbc49('0x69')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xbc49('0x16a')});db[_0xbc49('0x19b')][_0xbc49('0x129')](db[_0xbc49('0x177')],{'onDelete':'restrict','foreignKey':_0xbc49('0x181')});db[_0xbc49('0x6d')]['hasMany'](db[_0xbc49('0x19f')],{'as':_0xbc49('0x162'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1a0')});db[_0xbc49('0x6d')][_0xbc49('0x129')](db[_0xbc49('0x69')],{'as':_0xbc49('0x175'),'foreignKey':'ChatWebsiteId'});db[_0xbc49('0x6d')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'as':_0xbc49('0x167'),'foreignKey':'ContactId'});db[_0xbc49('0x6d')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x176'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x6d')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x1a1'),'as':_0xbc49('0x18b')});db[_0xbc49('0x6d')][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x1a1'),'as':_0xbc49('0x179')});db[_0xbc49('0x6d')][_0xbc49('0x12a')](db['User'],{'as':_0xbc49('0x192'),'through':_0xbc49('0x12f'),'foreignKey':_0xbc49('0x1a0')});db[_0xbc49('0x19f')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'onDelete':_0xbc49('0x116'),'as':'User'});db[_0xbc49('0x19f')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x167'),'foreignKey':'ContactId'});db[_0xbc49('0x19f')][_0xbc49('0x129')](db[_0xbc49('0x6d')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x17c'),'foreignKey':_0xbc49('0x1a0')});db[_0xbc49('0x19f')][_0xbc49('0x129')](db[_0xbc49('0x18c')],{'as':_0xbc49('0x18c'),'foreignKey':'AttachmentId'});db[_0xbc49('0x19f')][_0xbc49('0x129')](db[_0xbc49('0x69')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x17d')});db['ChatOfflineMessage'][_0xbc49('0x11b')](db[_0xbc49('0x18c')],{'as':_0xbc49('0x17b'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xbc49('0x116'),'hooks':!![]});db[_0xbc49('0x17e')][_0xbc49('0x129')](db[_0xbc49('0x74')],{'onDelete':_0xbc49('0x116'),'as':'Contact','foreignKey':_0xbc49('0x168')});db['ChatOfflineMessage'][_0xbc49('0x129')](db[_0xbc49('0x69')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x17d')});db[_0xbc49('0x1a2')][_0xbc49('0x12a')](db['User'],{'as':'Agents','through':_0xbc49('0x32'),'hooks':!![]});db[_0xbc49('0x1a2')][_0xbc49('0x12a')](db['Team'],{'through':'team_has_chat_queues','as':'Teams'});db[_0xbc49('0x70')]['hasMany'](db[_0xbc49('0xd1')],{'as':_0xbc49('0x162'),'foreignKey':_0xbc49('0x1a3'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x70')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x150'),'through':_0xbc49('0x12c')});db['ChatProactiveAction'][_0xbc49('0x129')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xbc49('0x17d')});db[_0xbc49('0x1a4')][_0xbc49('0x11b')](db['CmContact'],{'as':_0xbc49('0x12d'),'foreignKey':'CompanyId'});db[_0xbc49('0x74')]['hasMany'](db[_0xbc49('0x90')],{'as':'Phones','foreignKey':'CmContactId'});db[_0xbc49('0x74')][_0xbc49('0x11b')](db[_0xbc49('0x1a5')],{'as':_0xbc49('0x152'),'foreignKey':'ContactId'});db[_0xbc49('0x74')]['hasMany'](db[_0xbc49('0x78')],{'as':_0xbc49('0x120'),'foreignKey':_0xbc49('0x168')});db['CmContact'][_0xbc49('0x11b')](db[_0xbc49('0x79')],{'as':_0xbc49('0x1a6'),'foreignKey':'ContactId'});db[_0xbc49('0x74')][_0xbc49('0x11b')](db[_0xbc49('0x7b')],{'as':_0xbc49('0x7b'),'foreignKey':'ContactId'});db['CmContact'][_0xbc49('0x11b')](db[_0xbc49('0xd7')],{'as':'JscriptySessions','foreignKey':_0xbc49('0x168')});db[_0xbc49('0x74')]['hasMany'](db[_0xbc49('0x122')],{'as':_0xbc49('0x123'),'foreignKey':'ContactId','onDelete':_0xbc49('0x16a')});db[_0xbc49('0x74')][_0xbc49('0x11b')](db[_0xbc49('0x6d')],{'as':_0xbc49('0x1a7'),'foreignKey':_0xbc49('0x168'),'onDelete':'restrict'});db[_0xbc49('0x74')]['hasMany'](db[_0xbc49('0x5d')],{'as':_0xbc49('0x131'),'foreignKey':_0xbc49('0x168'),'onDelete':_0xbc49('0x16a')});db['CmContact']['hasMany'](db['FaxInteraction'],{'as':_0xbc49('0x124'),'foreignKey':_0xbc49('0x168'),'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x74')][_0xbc49('0x11b')](db['MailInteraction'],{'as':_0xbc49('0x125'),'foreignKey':'ContactId','onDelete':_0xbc49('0x16a')});db[_0xbc49('0x74')]['belongsTo'](db[_0xbc49('0x1a4')],{'as':_0xbc49('0x1a8'),'foreignKey':_0xbc49('0x1a9')});db['CmContact']['belongsTo'](db['CmList'],{'as':_0xbc49('0x170'),'foreignKey':'ListId','onDelete':_0xbc49('0x116')});db[_0xbc49('0x74')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x192'),'through':_0xbc49('0x1aa')});db[_0xbc49('0x74')][_0xbc49('0x12a')](db['Tag'],{'as':_0xbc49('0x18b'),'through':_0xbc49('0x1ab')});db[_0xbc49('0x74')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x1ab'),'as':_0xbc49('0x179')});db[_0xbc49('0x1a5')]['hasMany'](db[_0xbc49('0x92')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db['CmHopper']['belongsTo'](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1a5')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':'List','foreignKey':_0xbc49('0x171'),'onDelete':_0xbc49('0x116')});db['CmHopper'][_0xbc49('0x129')](db['User'],{'as':_0xbc49('0x19c'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x1a5')][_0xbc49('0x129')](db[_0xbc49('0x1d')],{'as':_0xbc49('0x19d'),'foreignKey':_0xbc49('0x151'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1a5')][_0xbc49('0x129')](db[_0xbc49('0xed')],{'as':_0xbc49('0xed'),'foreignKey':_0xbc49('0x1ac'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1a5')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x176'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0xbc49('0x129')](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x168'),'onDelete':'cascade'});db[_0xbc49('0x77')][_0xbc49('0x129')](db['CmList'],{'as':'List','foreignKey':_0xbc49('0x171'),'onDelete':_0xbc49('0x116')});db['CmHopperBlack'][_0xbc49('0x129')](db[_0xbc49('0x1d')],{'as':_0xbc49('0x19d'),'foreignKey':_0xbc49('0x151'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x77')][_0xbc49('0x129')](db[_0xbc49('0xed')],{'as':_0xbc49('0xed'),'foreignKey':_0xbc49('0x1ac'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1ad')]['hasMany'](db['Condition'],{'as':{'plural':_0xbc49('0x1ae'),'singular':_0xbc49('0x1af')},'foreignKey':_0xbc49('0x1b0'),'onDelete':_0xbc49('0x116'),'hooks':!![]});db[_0xbc49('0x1ad')][_0xbc49('0x11b')](db['Condition'],{'as':{'plural':_0xbc49('0x1b1'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0xbc49('0x116'),'hooks':!![]});db[_0xbc49('0x1ad')][_0xbc49('0x11b')](db[_0xbc49('0x7f')],{'as':'Actions','foreignKey':_0xbc49('0x1b2'),'onDelete':_0xbc49('0x116'),'hooks':!![]});db['Disposition'][_0xbc49('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xbc49('0x1b3'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x159')]['hasMany'](db[_0xbc49('0x159')],{'as':'Intervals','foreignKey':_0xbc49('0x180'),'onDelete':_0xbc49('0x116'),'hooks':!![],'required':![]});db['Interval'][_0xbc49('0x11b')](db[_0xbc49('0x11e')],{'as':_0xbc49('0x11f'),'foreignKey':_0xbc49('0x180'),'onDelete':'restrict'});db[_0xbc49('0x159')][_0xbc49('0x11b')](db[_0xbc49('0x4b')],{'as':_0xbc49('0x1b4'),'foreignKey':_0xbc49('0x180')});db[_0xbc49('0x159')]['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xbc49('0x159')][_0xbc49('0x11b')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0xbc49('0x180')});db[_0xbc49('0x159')]['hasMany'](db[_0xbc49('0x5b')],{'as':_0xbc49('0x1b5'),'foreignKey':_0xbc49('0x180')});db[_0xbc49('0x8c')][_0xbc49('0x129')](db['MailAccount'],{});db[_0xbc49('0x8c')][_0xbc49('0x129')](db[_0xbc49('0x9d')],{'foreignKey':_0xbc49('0x1b6')});db[_0xbc49('0x8c')][_0xbc49('0x129')](db[_0xbc49('0x9b')],{'foreignKey':_0xbc49('0x1b7')});db['Sound'][_0xbc49('0x12a')](db[_0xbc49('0x1b')],{'as':_0xbc49('0x1b8'),'through':_0xbc49('0x14f'),'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x177')][_0xbc49('0x12a')](db[_0xbc49('0x74')],{'through':'cm_contact_has_tags'});db[_0xbc49('0x177')][_0xbc49('0x12a')](db[_0xbc49('0x6d')],{'through':_0xbc49('0x1a1')});db[_0xbc49('0x177')][_0xbc49('0x12a')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xbc49('0x5d')],{'through':_0xbc49('0x191')});db[_0xbc49('0x177')]['belongsToMany'](db[_0xbc49('0x54')],{'through':'fax_interaction_has_tags'});db[_0xbc49('0x177')][_0xbc49('0x12a')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xbc49('0x12a')](db[_0xbc49('0x109')],{'through':'whatsapp_interaction_has_tags'});db[_0xbc49('0x90')][_0xbc49('0x129')](db[_0xbc49('0x8f')],{'as':_0xbc49('0x1b9'),'foreignKey':_0xbc49('0x1ba')});db[_0xbc49('0x92')][_0xbc49('0x129')](db[_0xbc49('0x1a5')],{'as':_0xbc49('0x1bb'),'foreignKey':_0xbc49('0x1bc')});db[_0xbc49('0x90')]['belongsTo'](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':_0xbc49('0x1bd')});db[_0xbc49('0x95')][_0xbc49('0x11b')](db['Condition'],{'as':{'plural':_0xbc49('0x1be'),'singular':_0xbc49('0x1bf')},'foreignKey':'TriggerAllId','onDelete':_0xbc49('0x116'),'hooks':!![]});db[_0xbc49('0x95')][_0xbc49('0x11b')](db[_0xbc49('0x85')],{'as':{'plural':_0xbc49('0x1c0'),'singular':_0xbc49('0x1c1')},'foreignKey':_0xbc49('0x1c2'),'onDelete':_0xbc49('0x116'),'hooks':!![]});db['Trigger'][_0xbc49('0x11b')](db[_0xbc49('0x7f')],{'as':_0xbc49('0x1c3'),'foreignKey':_0xbc49('0x1c4'),'onDelete':_0xbc49('0x116'),'hooks':!![]});db['AnalyticCustomReport'][_0xbc49('0x11b')](db[_0xbc49('0xa1')],{'as':_0xbc49('0x1c5'),'onDelete':'cascade','foreignKey':_0xbc49('0x1b7'),'hooks':!![]});db['AnalyticDefaultReport'][_0xbc49('0x11b')](db[_0xbc49('0xa1')],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1b6')});db[_0xbc49('0x1c6')][_0xbc49('0x11b')](db[_0xbc49('0xa1')],{'as':_0xbc49('0x1c5'),'onDelete':'cascade','foreignKey':_0xbc49('0x1c7')});db['AnalyticFieldReport']['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0xbc49('0x1c7')});db[_0xbc49('0xa4')]['hasMany'](db[_0xbc49('0xa5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xa5')][_0xbc49('0x11b')](db['SalesforceField'],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xa5')][_0xbc49('0x11b')](db[_0xbc49('0xa7')],{'as':_0xbc49('0x1cb'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xa5')][_0xbc49('0x11b')](db['SalesforceField'],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0xa5')]['belongsTo'](db[_0xbc49('0xa4')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1c8')});db['SalesforceField'][_0xbc49('0x11b')](db[_0xbc49('0xa7')],{'as':_0xbc49('0x1ce'),'foreignKey':'SubjectId'});db['SalesforceField']['hasMany'](db[_0xbc49('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db['SalesforceField'][_0xbc49('0x11b')](db['SalesforceField'],{'as':_0xbc49('0x1cf'),'foreignKey':'FieldId'});db['SalesforceField'][_0xbc49('0x129')](db[_0xbc49('0x97')],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0xa9')][_0xbc49('0x11b')](db[_0xbc49('0xab')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':'AccountId'});db[_0xbc49('0xab')][_0xbc49('0x11b')](db[_0xbc49('0xad')],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0xbc49('0x11b')](db[_0xbc49('0xad')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xab')]['hasMany'](db[_0xbc49('0xad')],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cd')});db['SugarcrmConfiguration']['belongsTo'](db[_0xbc49('0xa9')],{'as':_0xbc49('0x175'),'foreignKey':'AccountId'});db[_0xbc49('0xad')][_0xbc49('0x11b')](db[_0xbc49('0xad')],{'as':_0xbc49('0x1ce'),'foreignKey':'SubjectId'});db[_0xbc49('0xad')]['hasMany'](db[_0xbc49('0xad')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xbc49('0xad')][_0xbc49('0x11b')](db[_0xbc49('0xad')],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0xad')][_0xbc49('0x129')](db['Variable'],{'as':'Variable','foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0x1d2')]['hasMany'](db[_0xbc49('0xb0')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xb0')][_0xbc49('0x11b')](db[_0xbc49('0x1d3')],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1ca')});db['DeskConfiguration'][_0xbc49('0x11b')](db[_0xbc49('0x1d3')],{'as':_0xbc49('0x1cb'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cc')});db['DeskConfiguration'][_0xbc49('0x11b')](db[_0xbc49('0x1d3')],{'as':_0xbc49('0x1c5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xbc49('0xb0')][_0xbc49('0x129')](db[_0xbc49('0x1d2')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xb0')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x1d4')});db[_0xbc49('0x1d3')][_0xbc49('0x11b')](db[_0xbc49('0x1d3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbc49('0x1d3')][_0xbc49('0x11b')](db[_0xbc49('0x1d3')],{'as':_0xbc49('0x1d5'),'foreignKey':_0xbc49('0x1cc')});db['DeskField'][_0xbc49('0x11b')](db['DeskField'],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db['DeskField']['belongsTo'](db[_0xbc49('0x97')],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0xb2')][_0xbc49('0x11b')](db[_0xbc49('0x1d6')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0x1d6')][_0xbc49('0x11b')](db[_0xbc49('0xb4')],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1ca')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xbc49('0x1cb'),'onDelete':_0xbc49('0x116'),'foreignKey':'DescriptionId'});db[_0xbc49('0x1d6')][_0xbc49('0x11b')](db['ZohoField'],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cd')});db['ZohoConfiguration'][_0xbc49('0x129')](db[_0xbc49('0xb2')],{'as':'Account','foreignKey':_0xbc49('0x1c8')});db['ZohoField'][_0xbc49('0x11b')](db[_0xbc49('0xb4')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db['ZohoField'][_0xbc49('0x11b')](db[_0xbc49('0xb4')],{'as':_0xbc49('0x1d5'),'foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xb4')][_0xbc49('0x11b')](db[_0xbc49('0xb4')],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0xb4')][_0xbc49('0x129')](db['Variable'],{'as':'Variable','foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0xb6')][_0xbc49('0x11b')](db[_0xbc49('0xb7')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xb7')][_0xbc49('0x11b')](db[_0xbc49('0x1d7')],{'as':_0xbc49('0x1c9'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xb7')][_0xbc49('0x11b')](db[_0xbc49('0x1d7')],{'as':'Descriptions','foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xb7')][_0xbc49('0x11b')](db[_0xbc49('0x1d7')],{'as':_0xbc49('0x1c5'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0xb7')][_0xbc49('0x129')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xb7')][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x1d8')});db['ZendeskField'][_0xbc49('0x11b')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbc49('0x1d7')][_0xbc49('0x11b')](db[_0xbc49('0x1d7')],{'as':'Description','foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0x1d7')][_0xbc49('0x11b')](db[_0xbc49('0x1d7')],{'as':_0xbc49('0x1cf'),'foreignKey':'FieldId'});db['ZendeskField'][_0xbc49('0x129')](db['Variable'],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0xb8')][_0xbc49('0x11b')](db['FreshdeskConfiguration'],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0x1d9')][_0xbc49('0x11b')](db[_0xbc49('0x1da')],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0x1d9')][_0xbc49('0x11b')](db[_0xbc49('0x1da')],{'as':_0xbc49('0x1cb'),'onDelete':_0xbc49('0x116'),'foreignKey':'DescriptionId'});db[_0xbc49('0x1d9')][_0xbc49('0x11b')](db['FreshdeskField'],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0x1d9')][_0xbc49('0x129')](db[_0xbc49('0xb8')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1c8')});db['FreshdeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xbc49('0x1db')});db['FreshdeskField'][_0xbc49('0x11b')](db[_0xbc49('0x1da')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0x1da')][_0xbc49('0x11b')](db[_0xbc49('0x1da')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xbc49('0x1da')][_0xbc49('0x11b')](db[_0xbc49('0x1da')],{'as':'Field','foreignKey':'FieldId'});db[_0xbc49('0x1da')][_0xbc49('0x129')](db[_0xbc49('0x97')],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0x1dc')]['hasMany'](db[_0xbc49('0xbf')],{'as':'Subjects','foreignKey':_0xbc49('0x1ca')});db['VtigerConfiguration'][_0xbc49('0x11b')](db[_0xbc49('0xbf')],{'as':_0xbc49('0x1cb'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xbc49('0x11b')](db['VtigerField'],{'as':_0xbc49('0x1c5'),'foreignKey':_0xbc49('0x1cd')});db['VtigerConfiguration'][_0xbc49('0x129')](db[_0xbc49('0xbc')],{'as':'Account','foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xbf')][_0xbc49('0x11b')](db[_0xbc49('0xbf')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xbf')][_0xbc49('0x11b')](db[_0xbc49('0xbf')],{'as':_0xbc49('0x1d5'),'foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xbf')][_0xbc49('0x11b')](db[_0xbc49('0xbf')],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db['VtigerField'][_0xbc49('0x129')](db[_0xbc49('0x97')],{'as':'Variable','foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0x1dd')][_0xbc49('0x11b')](db[_0xbc49('0xc1')],{'as':'Configurations','onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0xc1')][_0xbc49('0x11b')](db[_0xbc49('0xc3')],{'as':_0xbc49('0x1c9'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xc1')][_0xbc49('0x11b')](db[_0xbc49('0xc3')],{'as':_0xbc49('0x1cb'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xbc49('0xc3')],{'as':_0xbc49('0x1c5'),'foreignKey':_0xbc49('0x1cd')});db['ServicenowConfiguration'][_0xbc49('0x129')](db[_0xbc49('0x1dd')],{'as':'Account','foreignKey':_0xbc49('0x1c8')});db['ServicenowField'][_0xbc49('0x11b')](db[_0xbc49('0xc3')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xc3')]['hasMany'](db[_0xbc49('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xbc49('0xc3')][_0xbc49('0x11b')](db[_0xbc49('0xc3')],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0xc3')][_0xbc49('0x129')](db[_0xbc49('0x97')],{'as':'Variable','foreignKey':_0xbc49('0x1d0')});db['Dynamics365Account']['hasMany'](db[_0xbc49('0xc6')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':'AccountId'});db[_0xbc49('0x1de')][_0xbc49('0x129')](db[_0xbc49('0x169')],{'as':_0xbc49('0x169'),'foreignKey':_0xbc49('0x16c')});db['Dynamics365Configuration'][_0xbc49('0x11b')](db[_0xbc49('0x1df')],{'as':_0xbc49('0x1c9'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xc6')]['hasMany'](db[_0xbc49('0x1df')],{'as':_0xbc49('0x1cb'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xc6')][_0xbc49('0x11b')](db[_0xbc49('0x1df')],{'as':_0xbc49('0x1c5'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1cd')});db['Dynamics365Configuration'][_0xbc49('0x129')](db[_0xbc49('0x1de')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1c8')});db[_0xbc49('0x1df')][_0xbc49('0x11b')](db[_0xbc49('0x1df')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db['Dynamics365Field'][_0xbc49('0x11b')](db[_0xbc49('0x1df')],{'as':_0xbc49('0x1d5'),'foreignKey':_0xbc49('0x1cc')});db['Dynamics365Field'][_0xbc49('0x11b')](db['Dynamics365Field'],{'as':_0xbc49('0x1cf'),'foreignKey':_0xbc49('0x1cd')});db[_0xbc49('0x1df')][_0xbc49('0x129')](db[_0xbc49('0x97')],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db['FreshsalesAccount']['hasMany'](db[_0xbc49('0xcb')],{'as':_0xbc49('0x1d1'),'onDelete':_0xbc49('0x116'),'foreignKey':'AccountId'});db[_0xbc49('0xcb')][_0xbc49('0x11b')](db[_0xbc49('0xcc')],{'as':_0xbc49('0x1c9'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xcb')][_0xbc49('0x11b')](db[_0xbc49('0xcc')],{'as':_0xbc49('0x1cb'),'foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xcb')][_0xbc49('0x11b')](db[_0xbc49('0xcc')],{'as':_0xbc49('0x1c5'),'foreignKey':'FieldId'});db[_0xbc49('0xcb')][_0xbc49('0x129')](db[_0xbc49('0xc9')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1c8')});db['FreshsalesField']['hasMany'](db[_0xbc49('0xcc')],{'as':_0xbc49('0x1ce'),'foreignKey':_0xbc49('0x1ca')});db[_0xbc49('0xcc')][_0xbc49('0x11b')](db[_0xbc49('0xcc')],{'as':'Description','foreignKey':_0xbc49('0x1cc')});db[_0xbc49('0xcc')]['hasMany'](db[_0xbc49('0xcc')],{'as':_0xbc49('0x1cf'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xbc49('0x129')](db['Variable'],{'as':_0xbc49('0x97'),'foreignKey':_0xbc49('0x1d0')});db[_0xbc49('0xcf')][_0xbc49('0x129')](db[_0xbc49('0x69')],{});db['ChatQueueReport'][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xcf')][_0xbc49('0x129')](db['CmContact'],{'as':'Contact','foreignKey':_0xbc49('0x168')});db[_0xbc49('0xcf')][_0xbc49('0x129')](db[_0xbc49('0x6d')],{});db[_0xbc49('0xcf')][_0xbc49('0x129')](db['ChatMessage'],{});db[_0xbc49('0xcf')][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db['ChatQueueReport'][_0xbc49('0x129')](db[_0xbc49('0x1a2')],{});db[_0xbc49('0xd1')][_0xbc49('0x129')](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xbc49('0xd1')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x1e0')});db[_0xbc49('0xd7')][_0xbc49('0x11b')](db['JscriptyQuestionReport'],{'foreignKey':_0xbc49('0x1e1'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0xd7')]['hasMany'](db[_0xbc49('0xd3')],{'foreignKey':_0xbc49('0x1e1'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0xd9')][_0xbc49('0x129')](db['SmsAccount'],{});db[_0xbc49('0xd9')][_0xbc49('0x129')](db['CmList'],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xd9')][_0xbc49('0x129')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xbc49('0xd9')][_0xbc49('0x129')](db[_0xbc49('0x5d')],{});db[_0xbc49('0xd9')][_0xbc49('0x129')](db[_0xbc49('0x5f')],{});db['SmsQueueReport'][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db[_0xbc49('0xd9')][_0xbc49('0x129')](db[_0xbc49('0x60')],{});db[_0xbc49('0xdf')]['hasMany'](db[_0xbc49('0xd7')],{'foreignKey':_0xbc49('0x1e2')});db['JscriptyProject'][_0xbc49('0x11b')](db[_0xbc49('0xd5')],{'foreignKey':_0xbc49('0x1e2')});db[_0xbc49('0xdf')][_0xbc49('0x11b')](db[_0xbc49('0xd3')],{'foreignKey':'ProjectId'});db[_0xbc49('0xe5')][_0xbc49('0x12a')](db['User'],{'as':_0xbc49('0x192'),'through':_0xbc49('0x14a')});db[_0xbc49('0xea')][_0xbc49('0x12a')](db['User'],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x12e')});db['Team'][_0xbc49('0x12a')](db['VoiceQueue'],{'through':_0xbc49('0x10f'),'as':_0xbc49('0x134')});db[_0xbc49('0xea')][_0xbc49('0x12a')](db[_0xbc49('0x44')],{'through':_0xbc49('0x173'),'as':'MailQueues'});db[_0xbc49('0xea')][_0xbc49('0x12a')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xbc49('0x136')});db[_0xbc49('0xea')]['belongsToMany'](db[_0xbc49('0x57')],{'through':_0xbc49('0x1e3'),'as':_0xbc49('0x137')});db['Team'][_0xbc49('0x12a')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0xbc49('0x138')});db[_0xbc49('0xea')][_0xbc49('0x12a')](db[_0xbc49('0x67')],{'through':_0xbc49('0x199'),'as':_0xbc49('0x139')});db[_0xbc49('0xea')][_0xbc49('0x12a')](db[_0xbc49('0x13a')],{'through':'team_has_whatsapp_queues','as':_0xbc49('0x13b')});db[_0xbc49('0xea')]['belongsToMany'](db[_0xbc49('0xfd')],{'through':_0xbc49('0x111'),'as':_0xbc49('0x135')});db[_0xbc49('0xed')]['hasMany'](db[_0xbc49('0x1a5')],{'as':'Hoppers','foreignKey':_0xbc49('0x1ac')});db[_0xbc49('0xed')][_0xbc49('0x11b')](db[_0xbc49('0x78')],{'as':_0xbc49('0x120'),'foreignKey':_0xbc49('0x1ac')});db[_0xbc49('0xed')][_0xbc49('0x11b')](db[_0xbc49('0x79')],{'as':_0xbc49('0x1a6'),'foreignKey':_0xbc49('0x1ac')});db[_0xbc49('0xed')][_0xbc49('0x11b')](db['CmHopperBlack'],{'as':_0xbc49('0x153'),'foreignKey':_0xbc49('0x1ac')});db[_0xbc49('0xed')]['belongsTo'](db[_0xbc49('0x155')],{'as':_0xbc49('0x155'),'foreignKey':_0xbc49('0x156')});db['Campaign'][_0xbc49('0x129')](db[_0xbc49('0x155')],{'as':_0xbc49('0x157'),'foreignKey':_0xbc49('0x158')});db[_0xbc49('0xed')][_0xbc49('0x129')](db[_0xbc49('0x159')],{'as':_0xbc49('0x159'),'foreignKey':_0xbc49('0x180')});db['Campaign']['belongsTo'](db[_0xbc49('0xe5')],{'as':_0xbc49('0xe5'),'foreignKey':'SquareProjectId'});db['Campaign'][_0xbc49('0x12a')](db['CmList'],{'as':'Lists','through':_0xbc49('0x1e4')});db[_0xbc49('0xed')][_0xbc49('0x12a')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x160'),'through':'campaigns_has_cm_blacklists'});db[_0xbc49('0x18c')][_0xbc49('0x129')](db[_0xbc49('0x17e')],{'as':_0xbc49('0x17e'),'foreignKey':'ChatOfflineMessageId'});db[_0xbc49('0xf3')][_0xbc49('0x129')](db[_0xbc49('0x49')],{});db['MailTransferReport'][_0xbc49('0x129')](db[_0xbc49('0x47')],{});db['MailTransferReport'][_0xbc49('0x129')](db[_0xbc49('0x42')],{'foreignKey':_0xbc49('0x1e5'),'as':'FromAccount'});db['MailTransferReport']['belongsTo'](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e6'),'as':_0xbc49('0x1e7')});db[_0xbc49('0xf3')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e8'),'as':_0xbc49('0x1e9')});db[_0xbc49('0xf3')]['belongsTo'](db[_0xbc49('0x44')],{'foreignKey':_0xbc49('0x1ea'),'as':_0xbc49('0x1eb')});db[_0xbc49('0xf3')][_0xbc49('0x129')](db[_0xbc49('0x42')],{'foreignKey':_0xbc49('0x1ec'),'as':_0xbc49('0x1ed')});db[_0xbc49('0xf4')]['belongsTo'](db[_0xbc49('0x19f')],{});db[_0xbc49('0xf4')][_0xbc49('0x129')](db[_0xbc49('0x6d')],{});db[_0xbc49('0xf4')]['belongsTo'](db[_0xbc49('0x69')],{'foreignKey':_0xbc49('0x1ee'),'as':_0xbc49('0x1ef')});db[_0xbc49('0xf4')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e6'),'as':'FromAgent'});db[_0xbc49('0xf4')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e8'),'as':'ToAgent'});db['ChatTransferReport'][_0xbc49('0x129')](db[_0xbc49('0x1a2')],{'foreignKey':_0xbc49('0x1f0'),'as':'ToQueue'});db[_0xbc49('0xf4')][_0xbc49('0x129')](db[_0xbc49('0x69')],{'foreignKey':_0xbc49('0x1f1'),'as':_0xbc49('0x1ed')});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x55')],{});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x54')],{});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x51')],{'foreignKey':'FromFaxAccountId','as':_0xbc49('0x1ef')});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':'FromUserId','as':_0xbc49('0x1e7')});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':'ToUserId','as':_0xbc49('0x1e9')});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x57')],{'foreignKey':_0xbc49('0x1f2'),'as':_0xbc49('0x1eb')});db[_0xbc49('0xf6')][_0xbc49('0x129')](db[_0xbc49('0x51')],{'foreignKey':'ToFaxAccountId','as':_0xbc49('0x1ed')});db[_0xbc49('0x1f3')][_0xbc49('0x129')](db[_0xbc49('0x65')],{});db[_0xbc49('0x1f3')][_0xbc49('0x129')](db[_0xbc49('0x122')],{});db['OpenchannelTransferReport'][_0xbc49('0x129')](db['OpenchannelAccount'],{'foreignKey':_0xbc49('0x1f4'),'as':'FromAccount'});db[_0xbc49('0x1f3')][_0xbc49('0x129')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xbc49('0x1f3')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e8'),'as':'ToAgent'});db[_0xbc49('0x1f3')][_0xbc49('0x129')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0xbc49('0x1eb')});db['OpenchannelTransferReport'][_0xbc49('0x129')](db[_0xbc49('0x142')],{'foreignKey':_0xbc49('0x1f5'),'as':'ToAccount'});db[_0xbc49('0xf9')]['belongsTo'](db[_0xbc49('0x5f')],{});db['SmsTransferReport']['belongsTo'](db[_0xbc49('0x5d')],{});db['SmsTransferReport'][_0xbc49('0x129')](db[_0xbc49('0x59')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0xbc49('0xf9')][_0xbc49('0x129')](db['User'],{'foreignKey':_0xbc49('0x1e6'),'as':_0xbc49('0x1e7')});db[_0xbc49('0xf9')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'foreignKey':_0xbc49('0x1e8'),'as':_0xbc49('0x1e9')});db[_0xbc49('0xf9')][_0xbc49('0x129')](db['SmsQueue'],{'foreignKey':_0xbc49('0x1f6'),'as':_0xbc49('0x1eb')});db[_0xbc49('0xf9')][_0xbc49('0x129')](db['SmsAccount'],{'foreignKey':_0xbc49('0x1f7'),'as':_0xbc49('0x1ed')});db[_0xbc49('0xfb')][_0xbc49('0x11b')](db[_0xbc49('0x184')],{'as':_0xbc49('0x185'),'foreignKey':_0xbc49('0x171'),'onDelete':'cascade'});db[_0xbc49('0xfb')][_0xbc49('0x11b')](db[_0xbc49('0x7d')],{'as':_0xbc49('0x1f8'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xfb')]['hasMany'](db[_0xbc49('0x74')],{'as':_0xbc49('0x12d'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xfb')]['hasMany'](db[_0xbc49('0x78')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0xbc49('0xfb')][_0xbc49('0x11b')](db['CmHopperHistory'],{'as':_0xbc49('0x121'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xfb')]['hasMany'](db[_0xbc49('0x7b')],{'as':_0xbc49('0x7b'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0xfb')][_0xbc49('0x12a')](db['VoiceQueue'],{'as':_0xbc49('0x1f9'),'through':_0xbc49('0x15d')});db[_0xbc49('0xfb')][_0xbc49('0x12a')](db['User'],{'as':'Agents','through':_0xbc49('0x1fa')});db['VoicePrefix'][_0xbc49('0x11b')](db['VoiceExtension'],{'as':_0xbc49('0x11f'),'onDelete':_0xbc49('0x116')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x113')});db[_0xbc49('0xfd')][_0xbc49('0x12a')](db[_0xbc49('0xea')],{'through':'TeamVoicePrefix','as':_0xbc49('0x15f')});db[_0xbc49('0xff')]['hasMany'](db[_0xbc49('0x13')],{'as':_0xbc49('0x192'),'foreignKey':'userProfileId'});db['UserProfile'][_0xbc49('0x11b')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xbc49('0x1fb'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x1fc')]['hasMany'](db[_0xbc49('0x102')],{'as':_0xbc49('0x1fd'),'foreignKey':_0xbc49('0x1fe'),'onDelete':_0xbc49('0x116')});db[_0xbc49('0x147')][_0xbc49('0x11b')](db[_0xbc49('0x184')],{'as':_0xbc49('0x185'),'foreignKey':_0xbc49('0x1ff'),'onDelete':'cascade'});db['WhatsappAccount'][_0xbc49('0x11b')](db[_0xbc49('0x82')],{'as':'Answers','foreignKey':_0xbc49('0x1ff')});db[_0xbc49('0x147')][_0xbc49('0x11b')](db[_0xbc49('0x10a')],{'as':_0xbc49('0x162'),'foreignKey':_0xbc49('0x1ff')});db[_0xbc49('0x147')][_0xbc49('0x11b')](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0xbc49('0x11b')](db[_0xbc49('0x107')],{'as':'Applications'});db[_0xbc49('0x147')][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':'ListId'});db[_0xbc49('0x147')]['belongsTo'](db[_0xbc49('0x88')],{'as':_0xbc49('0x15a'),'foreignKey':_0xbc49('0x15b')});db['WhatsappAccount'][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':'user_has_whatsapp_accounts'});db[_0xbc49('0x107')]['belongsTo'](db[_0xbc49('0x13')],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x107')][_0xbc49('0x129')](db[_0xbc49('0x13a')],{'onDelete':_0xbc49('0x16a')});db['WhatsappApplication'][_0xbc49('0x129')](db[_0xbc49('0x147')],{'onDelete':_0xbc49('0x16a')});db[_0xbc49('0x107')][_0xbc49('0x129')](db['Interval'],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x180')});db[_0xbc49('0x107')][_0xbc49('0x129')](db[_0xbc49('0x177')],{'onDelete':_0xbc49('0x16a'),'foreignKey':_0xbc49('0x181')});db[_0xbc49('0x109')][_0xbc49('0x11b')](db[_0xbc49('0x10a')],{'as':_0xbc49('0x162'),'onDelete':_0xbc49('0x116'),'foreignKey':_0xbc49('0x200')});db[_0xbc49('0x109')]['belongsTo'](db[_0xbc49('0x147')],{'as':_0xbc49('0x175'),'foreignKey':_0xbc49('0x1ff')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xbc49('0x168')});db[_0xbc49('0x109')]['belongsTo'](db['User'],{'as':_0xbc49('0x176'),'foreignKey':_0xbc49('0x117')});db[_0xbc49('0x109')]['belongsToMany'](db[_0xbc49('0x177')],{'through':_0xbc49('0x201'),'as':_0xbc49('0x18b')});db[_0xbc49('0x109')][_0xbc49('0x12a')](db[_0xbc49('0x177')],{'through':_0xbc49('0x201'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db[_0xbc49('0x13')],{'as':_0xbc49('0x192'),'through':_0xbc49('0x202'),'foreignKey':_0xbc49('0x200')});db[_0xbc49('0x10a')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':_0xbc49('0x13')});db[_0xbc49('0x10a')][_0xbc49('0x129')](db['CmContact'],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x167')});db[_0xbc49('0x10a')]['belongsTo'](db[_0xbc49('0x109')],{'onDelete':_0xbc49('0x116'),'as':_0xbc49('0x17c'),'foreignKey':_0xbc49('0x200')});db[_0xbc49('0x10a')][_0xbc49('0x129')](db[_0xbc49('0x147')],{'as':'Account','foreignKey':_0xbc49('0x1ff')});db[_0xbc49('0x10c')][_0xbc49('0x129')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xbc49('0x129')](db[_0xbc49('0xfb')],{'as':_0xbc49('0x170'),'foreignKey':_0xbc49('0x171')});db[_0xbc49('0x10c')][_0xbc49('0x129')](db['CmContact'],{'as':_0xbc49('0x167'),'foreignKey':'ContactId'});db[_0xbc49('0x10c')][_0xbc49('0x129')](db[_0xbc49('0x109')],{});db[_0xbc49('0x10c')][_0xbc49('0x129')](db[_0xbc49('0x13a')],{});db[_0xbc49('0x10c')][_0xbc49('0x129')](db[_0xbc49('0x10a')],{});db[_0xbc49('0x10c')][_0xbc49('0x129')](db[_0xbc49('0x13')],{});db[_0xbc49('0x203')]['belongsTo'](db[_0xbc49('0x10a')],{});db[_0xbc49('0x203')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xbc49('0x204'),'as':_0xbc49('0x1ef')});db[_0xbc49('0x203')][_0xbc49('0x129')](db[_0xbc49('0x147')],{'foreignKey':'ToWhatsappAccountId','as':_0xbc49('0x1ed')});db[_0xbc49('0x203')][_0xbc49('0x129')](db[_0xbc49('0x13a')],{'foreignKey':_0xbc49('0x205'),'as':_0xbc49('0x1eb')});db[_0xbc49('0x203')][_0xbc49('0x129')](db['User'],{'foreignKey':'FromUserId','as':_0xbc49('0x1e7')});db['WhatsappTransferReport']['belongsTo'](db[_0xbc49('0x13')],{'foreignKey':'ToUserId','as':_0xbc49('0x1e9')});db[_0xbc49('0x13a')][_0xbc49('0x12a')](db[_0xbc49('0x13')],{'as':_0xbc49('0x15e'),'through':_0xbc49('0x3c'),'foreignKey':_0xbc49('0x206')});db[_0xbc49('0x13a')][_0xbc49('0x12a')](db[_0xbc49('0xea')],{'through':_0xbc49('0x207'),'as':_0xbc49('0x15f')});db[_0xbc49('0x119')][_0xbc49('0x129')](db[_0xbc49('0x13')],{'as':'user','foreignKey':_0xbc49('0x117'),'onDelete':'cascade','hooks':!![]});db[_0xbc49('0x169')][_0xbc49('0x118')](db[_0xbc49('0x1de')],{'as':'Dynamics365Account','onDelete':_0xbc49('0x16a')});db['CloudProvider'][_0xbc49('0x118')](db['MailServerIn'],{'as':'Imap','onDelete':'restrict'});db['CloudProvider']['hasOne'](db[_0xbc49('0x40')],{'as':_0xbc49('0x16e'),'onDelete':'restrict'});module[_0xbc49('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d0b7c5a..1e3f468 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff8f=['./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./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/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','static','root','/apidoc','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','appPath','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./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/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions'];(function(_0x31889a,_0x1d6bf6){var _0x16b798=function(_0x24c169){while(--_0x24c169){_0x31889a['push'](_0x31889a['shift']());}};_0x16b798(++_0x1d6bf6);}(_0xff8f,0x1e0));var _0xfff8=function(_0x6c9be0,_0x1bdfb3){_0x6c9be0=_0x6c9be0-0x0;var _0x2b69ba=_0xff8f[_0x6c9be0];return _0x2b69ba;};'use strict';var path=require(_0xfff8('0x0'));var express=require('express');var errors=require(_0xfff8('0x1'));var config=require(_0xfff8('0x2'));var setupLoggers=require(_0xfff8('0x3'))[_0xfff8('0x4')];var clientSideLogs=require(_0xfff8('0x5'));exports[_0xfff8('0x6')]=function(_0x237ff6){return setupLoggers(_0x237ff6)[_0xfff8('0x7')](function(){_0x237ff6['use'](_0xfff8('0x8'),require(_0xfff8('0x9')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xb'),require(_0xfff8('0xc')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xd'),require(_0xfff8('0xe')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xf'),require('./api/voiceExtension'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x10'),require(_0xfff8('0x11')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x12'),require(_0xfff8('0x13')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x14'),require(_0xfff8('0x15')));_0x237ff6['use'](_0xfff8('0x16'),require(_0xfff8('0x17')));_0x237ff6['use'](_0xfff8('0x18'),require('./api/voiceMail'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x19'),require(_0xfff8('0x1a')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x1b'),require(_0xfff8('0x1c')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x1d'),require(_0xfff8('0x1e')));_0x237ff6[_0xfff8('0xa')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x237ff6[_0xfff8('0xa')]('/api/voice/queues/reports',require(_0xfff8('0x1f')));_0x237ff6['use'](_0xfff8('0x20'),require(_0xfff8('0x21')));_0x237ff6['use'](_0xfff8('0x22'),require(_0xfff8('0x23')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x24'),require(_0xfff8('0x25')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x26'),require('./api/mailServerOut'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x27'),require('./api/mailAccount'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x28'),require(_0xfff8('0x29')));_0x237ff6[_0xfff8('0xa')]('/api/mail/substatuses',require(_0xfff8('0x2a')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x2b'),require(_0xfff8('0x2c')));_0x237ff6[_0xfff8('0xa')]('/api/mail/messages',require('./api/mailMessage'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x2d'),require('./api/mailApplication'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x2e'),require(_0xfff8('0x2f')));_0x237ff6['use']('/api/dashboards',require(_0xfff8('0x30')));_0x237ff6['use'](_0xfff8('0x31'),require('./api/dashboardItem'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x32'),require(_0xfff8('0x33')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x34'),require('./api/faxApplication'));_0x237ff6[_0xfff8('0xa')]('/api/fax/interactions',require('./api/faxInteraction'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x35'),require('./api/faxMessage'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x36'),require(_0xfff8('0x37')));_0x237ff6['use'](_0xfff8('0x38'),require('./api/faxQueueReport'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x39'),require(_0xfff8('0x3a')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x3b'),require(_0xfff8('0x3c')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x3d'),require(_0xfff8('0x3e')));_0x237ff6['use'](_0xfff8('0x3f'),require(_0xfff8('0x40')));_0x237ff6['use'](_0xfff8('0x41'),require(_0xfff8('0x42')));_0x237ff6['use'](_0xfff8('0x43'),require('./api/openchannelAccount'));_0x237ff6['use'](_0xfff8('0x44'),require('./api/openchannelApplication'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x45'),require('./api/openchannelInteraction'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x46'),require('./api/openchannelMessage'));_0x237ff6['use']('/api/openchannel/queues',require(_0xfff8('0x47')));_0x237ff6['use'](_0xfff8('0x48'),require(_0xfff8('0x49')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x4a'),require(_0xfff8('0x4b')));_0x237ff6[_0xfff8('0xa')]('/api/chat/applications',require(_0xfff8('0x4c')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x4d'),require(_0xfff8('0x4e')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x4f'),require(_0xfff8('0x50')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x51'),require(_0xfff8('0x52')));_0x237ff6['use'](_0xfff8('0x53'),require(_0xfff8('0x54')));_0x237ff6['use'](_0xfff8('0x55'),require('./api/chatGroup'));_0x237ff6[_0xfff8('0xa')]('/api/chat/proactive_actions',require(_0xfff8('0x56')));_0x237ff6[_0xfff8('0xa')]('/api/cm/companies',require(_0xfff8('0x57')));_0x237ff6[_0xfff8('0xa')]('/api/cm/contacts',require(_0xfff8('0x58')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x59'),require(_0xfff8('0x5a')));_0x237ff6['use'](_0xfff8('0x5b'),require('./api/cmHopperBlack'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x5c'),require(_0xfff8('0x5d')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x5e'),require(_0xfff8('0x5f')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x60'),require('./api/cmCustomField'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x61'),require(_0xfff8('0x62')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x63'),require(_0xfff8('0x64')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x65'),require(_0xfff8('0x66')));_0x237ff6['use']('/api/dispositions',require(_0xfff8('0x67')));_0x237ff6['use'](_0xfff8('0x68'),require('./api/condition'));_0x237ff6['use'](_0xfff8('0x69'),require('./api/interval'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x6a'),require(_0xfff8('0x6b')));_0x237ff6[_0xfff8('0xa')]('/api/cdr',require('./api/cdr'));_0x237ff6['use'](_0xfff8('0x6c'),require('./api/voiceQueuesLog'));_0x237ff6[_0xfff8('0xa')]('/api/schedules',require(_0xfff8('0x6d')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x6e'),require(_0xfff8('0x6f')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x70'),require(_0xfff8('0x71')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x72'),require(_0xfff8('0x73')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x74'),require(_0xfff8('0x75')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x76'),require(_0xfff8('0x77')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x78'),require('./api/template'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x79'),require(_0xfff8('0x7a')));_0x237ff6['use'](_0xfff8('0x7b'),require(_0xfff8('0x7c')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x7d'),require('./api/integration'));_0x237ff6['use'](_0xfff8('0x7e'),require(_0xfff8('0x7f')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x80'),require(_0xfff8('0x81')));_0x237ff6[_0xfff8('0xa')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x237ff6['use'](_0xfff8('0x82'),require(_0xfff8('0x83')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x84'),require(_0xfff8('0x85')));_0x237ff6[_0xfff8('0xa')]('/api/analytics/field_reports',require(_0xfff8('0x86')));_0x237ff6[_0xfff8('0xa')]('/api/analytics/tree_reports',require(_0xfff8('0x87')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x88'),require(_0xfff8('0x89')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x8a'),require(_0xfff8('0x8b')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xfff8('0x8c')));_0x237ff6['use'](_0xfff8('0x8d'),require(_0xfff8('0x8e')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x8f'),require('./api/intSugarcrmField'));_0x237ff6['use'](_0xfff8('0x90'),require(_0xfff8('0x91')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x92'),require('./api/intDeskConfiguration'));_0x237ff6['use'](_0xfff8('0x93'),require(_0xfff8('0x94')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x95'),require(_0xfff8('0x96')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/zoho/configurations',require(_0xfff8('0x97')));_0x237ff6['use']('/api/integrations/zoho/fields',require(_0xfff8('0x98')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/zendesk/accounts',require(_0xfff8('0x99')));_0x237ff6['use'](_0xfff8('0x9a'),require('./api/intZendeskConfiguration'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x9b'),require(_0xfff8('0x9c')));_0x237ff6['use'](_0xfff8('0x9d'),require(_0xfff8('0x9e')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x9f'),require(_0xfff8('0xa0')));_0x237ff6['use'](_0xfff8('0xa1'),require(_0xfff8('0xa2')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xa3'),require(_0xfff8('0xa4')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xa5'),require('./api/intVtigerConfiguration'));_0x237ff6[_0xfff8('0xa')]('/api/integrations/vtiger/fields',require(_0xfff8('0xa6')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xa7'),require(_0xfff8('0xa8')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/servicenow/configurations',require(_0xfff8('0xa9')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xaa'),require(_0xfff8('0xab')));_0x237ff6['use']('/api/integrations/dynamics365/accounts',require(_0xfff8('0xac')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xad'),require(_0xfff8('0xae')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xaf'),require(_0xfff8('0xb0')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/freshsales/accounts',require(_0xfff8('0xb1')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xb2'),require(_0xfff8('0xb3')));_0x237ff6[_0xfff8('0xa')]('/api/integrations/freshsales/fields',require(_0xfff8('0xb4')));_0x237ff6['use'](_0xfff8('0xb5'),require(_0xfff8('0xb6')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xb7'),require(_0xfff8('0xb8')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xb9'),require(_0xfff8('0xba')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xbb'),require('./api/jscriptyAnswerReport'));_0x237ff6[_0xfff8('0xa')]('/api/jscripty/questions/reports',require(_0xfff8('0xbc')));_0x237ff6['use']('/api/jscripty/sessions/reports',require(_0xfff8('0xbd')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xbe'),require(_0xfff8('0xbf')));_0x237ff6[_0xfff8('0xa')]('/api/square/reports',require(_0xfff8('0xc0')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xc1'),require(_0xfff8('0xc2')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xc3'),require(_0xfff8('0xc4')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xc5'),require(_0xfff8('0xc6')));_0x237ff6['use'](_0xfff8('0xc7'),require(_0xfff8('0xc8')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xc9'),require(_0xfff8('0xca')));_0x237ff6['use']('/api/square/recordings',require('./api/squareRecording'));_0x237ff6[_0xfff8('0xa')]('/api/square/messages',require(_0xfff8('0xcb')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xcc'),require('./api/team'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xcd'),require(_0xfff8('0xce')));_0x237ff6['use']('/api/campaigns',require(_0xfff8('0xcf')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xd0'),require(_0xfff8('0xd1')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xd2'),require(_0xfff8('0xd3')));_0x237ff6['use'](_0xfff8('0xd4'),require(_0xfff8('0xd5')));_0x237ff6['use']('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xd6'),require(_0xfff8('0xd7')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xd8'),require(_0xfff8('0xd9')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xda'),require('./api/openchannelTransferReport'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xdb'),require(_0xfff8('0xdc')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xdd'),require(_0xfff8('0xde')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xdf'),require('./api/voicePrefix'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xe0'),require(_0xfff8('0xe1')));_0x237ff6[_0xfff8('0xa')]('/api/userProfile/sections',require(_0xfff8('0xe2')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xe3'),require(_0xfff8('0xe4')));_0x237ff6[_0xfff8('0xa')]('/api/userNotifications',require(_0xfff8('0xe5')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xe6'),require('./api/whatsappAccount'));_0x237ff6[_0xfff8('0xa')]('/api/whatsapp/applications',require(_0xfff8('0xe7')));_0x237ff6[_0xfff8('0xa')]('/api/whatsapp/interactions',require(_0xfff8('0xe8')));_0x237ff6[_0xfff8('0xa')]('/api/whatsapp/messages',require(_0xfff8('0xe9')));_0x237ff6['use']('/api/whatsapp/reports/queue',require(_0xfff8('0xea')));_0x237ff6['use']('/api/whatsapp/reports/transfer',require(_0xfff8('0xeb')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xec'),require(_0xfff8('0xed')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xee'),require(_0xfff8('0xef')));_0x237ff6['use'](_0xfff8('0xf0'),require(_0xfff8('0xf1')));_0x237ff6['use'](_0xfff8('0xf2'),require(_0xfff8('0xf3')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xf4'),require('./api/authLocal'));_0x237ff6['use']('/api/auth/google',require(_0xfff8('0xf5')));_0x237ff6[_0xfff8('0xa')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xf6'),require(_0xfff8('0xf7')));_0x237ff6['use'](_0xfff8('0xf8'),require('./api/rpc'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xf9'),require(_0xfff8('0xfa')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xfb'),require('./api/system'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xfc'),require(_0xfff8('0xfd')));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xfe'),require('./api/webbar'));_0x237ff6[_0xfff8('0xa')](_0xfff8('0xff'),clientSideLogs);_0x237ff6[_0xfff8('0xa')]('/apidoc',express[_0xfff8('0x100')](path['join'](config[_0xfff8('0x101')],_0xfff8('0x102'))));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x103'),express['static'](path[_0xfff8('0x104')](config['root'],_0xfff8('0x103'))));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x105'),express[_0xfff8('0x100')](path['join'](config[_0xfff8('0x101')],_0xfff8('0x105'))));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x106'),express[_0xfff8('0x100')](path[_0xfff8('0x104')](config[_0xfff8('0x101')],_0xfff8('0x107'),_0xfff8('0x108'))));_0x237ff6[_0xfff8('0xa')](_0xfff8('0x109'),express[_0xfff8('0x100')](path['join'](config['root'],'/server/files/plugins')));_0x237ff6[_0xfff8('0x10a')](_0xfff8('0x10b'))[_0xfff8('0x10c')](errors[0x194]);_0x237ff6[_0xfff8('0x10a')]('/*')[_0xfff8('0x10c')](function(_0x3b9027,_0x26ffa4){_0x26ffa4['sendFile'](path['resolve'](_0x237ff6[_0xfff8('0x10c')](_0xfff8('0x10d'))+_0xfff8('0x10e')));});return _0x237ff6;});}; \ No newline at end of file +var _0xdee8=['/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./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/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/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/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/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/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/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','get','sendFile','resolve','appPath','path','./errors','./config/environment','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport'];(function(_0x115188,_0x453178){var _0x29e7c2=function(_0x29915f){while(--_0x29915f){_0x115188['push'](_0x115188['shift']());}};_0x29e7c2(++_0x453178);}(_0xdee8,0xe5));var _0x8dee=function(_0x1900cb,_0x3457f4){_0x1900cb=_0x1900cb-0x0;var _0x229cb7=_0xdee8[_0x1900cb];return _0x229cb7;};'use strict';var path=require(_0x8dee('0x0'));var express=require('express');var errors=require(_0x8dee('0x1'));var config=require(_0x8dee('0x2'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0x8dee('0x3'));exports[_0x8dee('0x4')]=function(_0x49a944){return setupLoggers(_0x49a944)[_0x8dee('0x5')](function(){_0x49a944[_0x8dee('0x6')]('/api/users',require(_0x8dee('0x7')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x8'),require(_0x8dee('0x9')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xa'),require(_0x8dee('0xb')));_0x49a944[_0x8dee('0x6')]('/api/voice/extensions',require(_0x8dee('0xc')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xd'),require(_0x8dee('0xe')));_0x49a944[_0x8dee('0x6')]('/api/voice/queues',require(_0x8dee('0xf')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x10'),require(_0x8dee('0x11')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x12'),require('./api/screenRecording'));_0x49a944['use'](_0x8dee('0x13'),require(_0x8dee('0x14')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x15'),require(_0x8dee('0x16')));_0x49a944[_0x8dee('0x6')]('/api/voice/calls/reports',require(_0x8dee('0x17')));_0x49a944['use'](_0x8dee('0x18'),require('./api/voiceDialReport'));_0x49a944['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x19'),require(_0x8dee('0x1a')));_0x49a944['use'](_0x8dee('0x1b'),require(_0x8dee('0x1c')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x1d'),require('./api/trunk'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x1e'),require(_0x8dee('0x1f')));_0x49a944['use']('/api/mail/out_servers',require(_0x8dee('0x20')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x21'),require(_0x8dee('0x22')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x23'),require(_0x8dee('0x24')));_0x49a944[_0x8dee('0x6')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x49a944[_0x8dee('0x6')]('/api/mail/interactions',require(_0x8dee('0x25')));_0x49a944['use'](_0x8dee('0x26'),require(_0x8dee('0x27')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x28'),require(_0x8dee('0x29')));_0x49a944[_0x8dee('0x6')]('/api/mail/reports/queue',require(_0x8dee('0x2a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x2b'),require(_0x8dee('0x2c')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x2d'),require('./api/dashboardItem'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x2e'),require(_0x8dee('0x2f')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x30'),require(_0x8dee('0x31')));_0x49a944['use']('/api/fax/interactions',require(_0x8dee('0x32')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x33'),require('./api/faxMessage'));_0x49a944[_0x8dee('0x6')]('/api/fax/queues',require('./api/faxQueue'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x34'),require(_0x8dee('0x35')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x36'),require(_0x8dee('0x37')));_0x49a944['use']('/api/sms/applications',require(_0x8dee('0x38')));_0x49a944[_0x8dee('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0x49a944['use'](_0x8dee('0x39'),require('./api/smsMessage'));_0x49a944['use']('/api/sms/queues',require(_0x8dee('0x3a')));_0x49a944['use'](_0x8dee('0x3b'),require(_0x8dee('0x3c')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x3d'),require(_0x8dee('0x3e')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x3f'),require('./api/openchannelInteraction'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x40'),require(_0x8dee('0x41')));_0x49a944[_0x8dee('0x6')]('/api/openchannel/queues',require(_0x8dee('0x42')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x43'),require(_0x8dee('0x44')));_0x49a944[_0x8dee('0x6')]('/api/openchannel/reports/queue',require(_0x8dee('0x45')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x46'),require(_0x8dee('0x47')));_0x49a944[_0x8dee('0x6')]('/api/chat/interactions',require(_0x8dee('0x48')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x49'),require(_0x8dee('0x4a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x4b'),require(_0x8dee('0x4c')));_0x49a944[_0x8dee('0x6')]('/api/chat/queues',require(_0x8dee('0x4d')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x4e'),require(_0x8dee('0x4f')));_0x49a944['use'](_0x8dee('0x50'),require(_0x8dee('0x51')));_0x49a944[_0x8dee('0x6')]('/api/cm/companies',require(_0x8dee('0x52')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x53'),require(_0x8dee('0x54')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x55'),require(_0x8dee('0x56')));_0x49a944['use'](_0x8dee('0x57'),require(_0x8dee('0x58')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x59'),require(_0x8dee('0x5a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x5b'),require(_0x8dee('0x5c')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x5d'),require(_0x8dee('0x5e')));_0x49a944['use']('/api/actions',require(_0x8dee('0x5f')));_0x49a944['use'](_0x8dee('0x60'),require(_0x8dee('0x61')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x62'),require(_0x8dee('0x63')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x64'),require(_0x8dee('0x65')));_0x49a944[_0x8dee('0x6')]('/api/conditions',require(_0x8dee('0x66')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x67'),require(_0x8dee('0x68')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x69'),require(_0x8dee('0x6a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x6b'),require('./api/cdr'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x6c'),require(_0x8dee('0x6d')));_0x49a944[_0x8dee('0x6')]('/api/schedules',require(_0x8dee('0x6e')));_0x49a944['use'](_0x8dee('0x6f'),require(_0x8dee('0x70')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x71'),require(_0x8dee('0x72')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x73'),require('./api/contactItemType'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x74'),require(_0x8dee('0x75')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x76'),require('./api/cmHopperAdditionalPhone'));_0x49a944[_0x8dee('0x6')]('/api/templates',require(_0x8dee('0x77')));_0x49a944['use'](_0x8dee('0x78'),require(_0x8dee('0x79')));_0x49a944['use'](_0x8dee('0x7a'),require(_0x8dee('0x7b')));_0x49a944[_0x8dee('0x6')]('/api/integrations',require(_0x8dee('0x7c')));_0x49a944[_0x8dee('0x6')]('/api/integrations/reports',require('./api/integrationReport'));_0x49a944[_0x8dee('0x6')](_0x8dee('0x7d'),require('./api/analyticCustomReport'));_0x49a944[_0x8dee('0x6')]('/api/analytics/default_reports',require(_0x8dee('0x7e')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x7f'),require(_0x8dee('0x80')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x81'),require(_0x8dee('0x82')));_0x49a944['use'](_0x8dee('0x83'),require(_0x8dee('0x84')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x85'),require(_0x8dee('0x86')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x87'),require(_0x8dee('0x88')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x89'),require(_0x8dee('0x8a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x8b'),require(_0x8dee('0x8c')));_0x49a944[_0x8dee('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x8dee('0x8d')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x8e'),require(_0x8dee('0x8f')));_0x49a944['use'](_0x8dee('0x90'),require(_0x8dee('0x91')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x92'),require(_0x8dee('0x93')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x94'),require(_0x8dee('0x95')));_0x49a944[_0x8dee('0x6')]('/api/integrations/desk/fields',require(_0x8dee('0x96')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x97'),require(_0x8dee('0x98')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x99'),require(_0x8dee('0x9a')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x9b'),require(_0x8dee('0x9c')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x9d'),require(_0x8dee('0x9e')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x9f'),require(_0x8dee('0xa0')));_0x49a944['use'](_0x8dee('0xa1'),require('./api/intZendeskField'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xa2'),require('./api/intFreshdeskAccount'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xa3'),require(_0x8dee('0xa4')));_0x49a944['use'](_0x8dee('0xa5'),require(_0x8dee('0xa6')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xa7'),require('./api/intVtigerAccount'));_0x49a944['use'](_0x8dee('0xa8'),require('./api/intVtigerConfiguration'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xa9'),require(_0x8dee('0xaa')));_0x49a944[_0x8dee('0x6')]('/api/integrations/servicenow/accounts',require(_0x8dee('0xab')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xac'),require(_0x8dee('0xad')));_0x49a944['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xae'),require(_0x8dee('0xaf')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xb0'),require(_0x8dee('0xb1')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xb2'),require('./api/intDynamics365Field'));_0x49a944['use'](_0x8dee('0xb3'),require(_0x8dee('0xb4')));_0x49a944['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x49a944[_0x8dee('0x6')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x49a944[_0x8dee('0x6')]('/api/networks',require('./api/network'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xb5'),require(_0x8dee('0xb6')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xb7'),require(_0x8dee('0xb8')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xb9'),require('./api/jscriptyAnswerReport'));_0x49a944['use'](_0x8dee('0xba'),require(_0x8dee('0xbb')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xbc'),require(_0x8dee('0xbd')));_0x49a944['use'](_0x8dee('0xbe'),require(_0x8dee('0xbf')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xc0'),require(_0x8dee('0xc1')));_0x49a944[_0x8dee('0x6')]('/api/square/details/reports',require(_0x8dee('0xc2')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xc3'),require('./api/jscriptyProject'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xc4'),require('./api/setting'));_0x49a944['use'](_0x8dee('0xc5'),require(_0x8dee('0xc6')));_0x49a944['use'](_0x8dee('0xc7'),require(_0x8dee('0xc8')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xc9'),require(_0x8dee('0xca')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xcb'),require(_0x8dee('0xcc')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xcd'),require(_0x8dee('0xce')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xcf'),require('./api/license'));_0x49a944['use'](_0x8dee('0xd0'),require('./api/campaign'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xd1'),require('./api/migration'));_0x49a944['use'](_0x8dee('0xd2'),require(_0x8dee('0xd3')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xd4'),require(_0x8dee('0xd5')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xd6'),require(_0x8dee('0xd7')));_0x49a944[_0x8dee('0x6')]('/api/chat/reports/transfer',require(_0x8dee('0xd8')));_0x49a944[_0x8dee('0x6')]('/api/fax/reports/transfer',require(_0x8dee('0xd9')));_0x49a944[_0x8dee('0x6')]('/api/openchannel/reports/transfer',require(_0x8dee('0xda')));_0x49a944['use'](_0x8dee('0xdb'),require(_0x8dee('0xdc')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xdd'),require(_0x8dee('0xde')));_0x49a944['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x49a944['use'](_0x8dee('0xdf'),require(_0x8dee('0xe0')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xe1'),require('./api/userProfileSection'));_0x49a944[_0x8dee('0x6')]('/api/userProfile/resources',require(_0x8dee('0xe2')));_0x49a944['use']('/api/userNotifications',require(_0x8dee('0xe3')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xe4'),require(_0x8dee('0xe5')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xe6'),require(_0x8dee('0xe7')));_0x49a944['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xe8'),require(_0x8dee('0xe9')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xea'),require(_0x8dee('0xeb')));_0x49a944[_0x8dee('0x6')]('/api/whatsapp/reports/transfer',require(_0x8dee('0xec')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xed'),require(_0x8dee('0xee')));_0x49a944['use'](_0x8dee('0xef'),require(_0x8dee('0xf0')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xf1'),require('./api/realtime'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xf2'),require(_0x8dee('0xf3')));_0x49a944['use'](_0x8dee('0xf4'),require(_0x8dee('0xf5')));_0x49a944[_0x8dee('0x6')]('/api/auth/google',require(_0x8dee('0xf6')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xf7'),require('./api/authActiveDirectory'));_0x49a944['use']('/api/jira',require(_0x8dee('0xf8')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xf9'),require('./api/rpc'));_0x49a944[_0x8dee('0x6')](_0x8dee('0xfa'),require(_0x8dee('0xfb')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xfc'),require(_0x8dee('0xfd')));_0x49a944[_0x8dee('0x6')](_0x8dee('0xfe'),require(_0x8dee('0xff')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x100'),require(_0x8dee('0x101')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x102'),clientSideLogs);_0x49a944[_0x8dee('0x6')]('/apidoc',express[_0x8dee('0x103')](path[_0x8dee('0x104')](config['root'],'/apidoc')));_0x49a944[_0x8dee('0x6')]('/www',express[_0x8dee('0x103')](path[_0x8dee('0x104')](config[_0x8dee('0x105')],'/www')));_0x49a944[_0x8dee('0x6')](_0x8dee('0x106'),express['static'](path[_0x8dee('0x104')](config[_0x8dee('0x105')],'/demo')));_0x49a944['use'](_0x8dee('0x107'),express[_0x8dee('0x103')](path[_0x8dee('0x104')](config[_0x8dee('0x105')],_0x8dee('0x108'),_0x8dee('0x109'))));_0x49a944['use']('/plugins',express[_0x8dee('0x103')](path[_0x8dee('0x104')](config[_0x8dee('0x105')],_0x8dee('0x10a'))));_0x49a944[_0x8dee('0x10b')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x8dee('0x10c')](errors[0x194]);_0x49a944[_0x8dee('0x10b')]('/*')[_0x8dee('0x10c')](function(_0x5a225b,_0x35140a){_0x35140a[_0x8dee('0x10d')](path[_0x8dee('0x10e')](_0x49a944[_0x8dee('0x10c')](_0x8dee('0x10f'))+'/index.html'));});return _0x49a944;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b0f5ba9..ffb95b4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0946=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/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/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x32b3ae,_0x3b632a){var _0x30b2e3=function(_0x4c0131){while(--_0x4c0131){_0x32b3ae['push'](_0x32b3ae['shift']());}};_0x30b2e3(++_0x3b632a);}(_0x0946,0xf5));var _0x6094=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x0946[_0x209ec9];return _0x129b1b;};'use strict';var jayson=require(_0x6094('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x6094('0x1')]=function(){return new Promise(function(_0x14ffc5,_0x244989){var _0xa9d4a2={};_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/voiceExtension/voiceExtension.rpc'));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x4')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x5')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x6')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x7')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x8')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x9')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0xa')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0xb')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0xc')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0xd')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0xe')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0xf')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x10')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x11')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x12')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/mailApplication/mailApplication.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x13')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x14')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/faxInteraction/faxInteraction.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x15')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x16')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x17')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/smsAccount/smsAccount.rpc'));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x18')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x19')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/smsQueue/smsQueue.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x1a')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x1b')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x1c')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/chatInteraction/chatInteraction.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x1d')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x1e')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/cmContact/cmContact.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x1f')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x20')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x21')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x22')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x23')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x24')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/sound/sound.rpc'));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x25')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x26')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x27')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x28')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x29')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2a')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2b')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2c')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2d')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2e')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x2f')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x30')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x31')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x32')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x33')));_0xa9d4a2=_['merge'](_0xa9d4a2,require('../api/squareReport/squareReport.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x34')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x35')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x36')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x37')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x38')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x39')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3a')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require('../api/attachment/attachment.rpc'));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3b')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3c')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3d')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x3e')));_0xa9d4a2=_['merge'](_0xa9d4a2,require(_0x6094('0x3f')));_0xa9d4a2=_[_0x6094('0x2')](_0xa9d4a2,require(_0x6094('0x40')));var _0xa145f1=jayson[_0x6094('0x41')](_0xa9d4a2)['http']();var _0xc1710c=config[_0x6094('0x42')]['port']||config['port']+0x1;var _0x394f9b=config['rpc']['ip']||'localhost';_0xa145f1['on']('error',function(_0x3afd06){return _0x244989(_0x3afd06);});_0xa145f1[_0x6094('0x1')](_0xc1710c,_0x394f9b,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x394f9b,_0xc1710c);require('../config/triggers')[_0x6094('0x43')]();return _0x14ffc5(_0x6094('0x44')+_0x394f9b+':'+_0xc1710c);});});}; \ No newline at end of file +var _0xc6c0=['../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6c0,0x142));var _0x0c6c=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xc6c0[_0x80d733];return _0x435868;};'use strict';var jayson=require(_0x0c6c('0x0'));var _=require(_0x0c6c('0x1'));var config=require('../config/environment');exports[_0x0c6c('0x2')]=function(){return new Promise(function(_0x355184,_0x311f5d){var _0x34f94e={};_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/user/user.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/voiceExtension/voiceExtension.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/voiceQueue/voiceQueue.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/voiceRecording/voiceRecording.rpc'));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x4')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x5')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x6')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x7')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x8')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x9')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xa')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xb')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xc')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xd')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xe')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0xf')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/faxAccount/faxAccount.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x10')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x11')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x12')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/faxQueue/faxQueue.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x13')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x14')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x15')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x16')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x17')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x18')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x19')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x1a')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x1b')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x1c')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x1d')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/chatMessage/chatMessage.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x1e')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x1f')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x20')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x21')));_0x34f94e=_['merge'](_0x34f94e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x22')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x23')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x24')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x25')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/sound/sound.rpc'));_0x34f94e=_['merge'](_0x34f94e,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x26')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x27')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x28')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x29')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x34f94e=_['merge'](_0x34f94e,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x2a')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x2b')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x2c')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x2d')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x2e')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x2f')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x30')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x31')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x32')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x33')));_0x34f94e=_['merge'](_0x34f94e,require(_0x0c6c('0x34')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/squareProject/squareProject.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x35')));_0x34f94e=_['merge'](_0x34f94e,require('../api/squareMessage/squareMessage.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x36')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x37')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/plugin/plugin.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x38')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x39')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require(_0x0c6c('0x3a')));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x34f94e=_[_0x0c6c('0x3')](_0x34f94e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x23fef8=jayson[_0x0c6c('0x3b')](_0x34f94e)[_0x0c6c('0x3c')]();var _0x366afd=config['rpc'][_0x0c6c('0x3d')]||config[_0x0c6c('0x3d')]+0x1;var _0x2ade13=config[_0x0c6c('0x3e')]['ip']||_0x0c6c('0x3f');_0x23fef8['on'](_0x0c6c('0x40'),function(_0x8d296b){return _0x311f5d(_0x8d296b);});_0x23fef8['listen'](_0x366afd,_0x2ade13,function(){console[_0x0c6c('0x41')](_0x0c6c('0x42'),_0x2ade13,_0x366afd);require(_0x0c6c('0x43'))[_0x0c6c('0x44')]();return _0x355184(_0x0c6c('0x45')+_0x2ade13+':'+_0x366afd);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e9bb4a3..1336ed2 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 _0x3336=['getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sendRequest','command','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s'];(function(_0x366412,_0x2899ed){var _0x548fef=function(_0x47c209){while(--_0x47c209){_0x366412['push'](_0x366412['shift']());}};_0x548fef(++_0x2899ed);}(_0x3336,0x106));var _0x6333=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x3336[_0x2b5b44];return _0x32cb66;};'use strict';var util=require(_0x6333('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x6333('0x1')];var AGIReply=require(_0x6333('0x2'));var AGIError=require(_0x6333('0x3'));function AGIChannel(_0x419d8d){var _0x450564=this,_0x371e97=new AGIReply(),_0x4c920e=![],_0xe53ff0={};EventEmitter[_0x6333('0x4')](_0x450564);_0x419d8d[_0x6333('0x5')](_0x6333('0x6'));_0x419d8d[_0x6333('0x7')](0x8*0x3c*0x3c*0x3e8);_0x371e97[_0x6333('0x5')](_0x6333('0x6'));_0x371e97['on'](_0x6333('0x8'),function(_0x38e635){for(var _0x5d04f7 in _0x38e635){_0x450564[_0x5d04f7]=_0x38e635[_0x5d04f7];}_0x450564[_0x6333('0x9')](_0x6333('0xa'));});_0x371e97['on'](_0x6333('0xb'),function(_0x4089da){if(_0x4089da[_0x6333('0xc')]()==_0x6333('0xd')){_0x450564[_0x6333('0x9')](_0x6333('0xd'));return;}if(_0x4089da[_0x6333('0xe')](0x0,0xb)=='520-Invalid'){_0x4c920e=!![];}if(_0x4c920e){_0xe53ff0['rx']+=_0x4089da+'\x0a';if(_0x4089da[_0x6333('0xf')](_0x6333('0x10'))!=-0x1){_0x4c920e=![];}}else{_0xe53ff0['rx']=_0x4089da;}if(_0x4c920e){return;}if(typeof _0xe53ff0['cb']==_0x6333('0x11')){var _0x314587=_0xe53ff0['rx'][_0x6333('0xe')](0x0,0x3),_0x2415b7=null,_0x4a28a2=null;_0x314587=parseInt(_0x314587);if(isNaN(_0x314587)){_0xe53ff0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6333('0x12')});return;}if(_0x314587!=0xc8){_0xe53ff0['cb'](null,{'code':_0x314587,'result':-0x1,'extra':'KO'});return;}_0x2415b7=_0xe53ff0['rx']['substring'](0x4)[_0x6333('0x13')]('result=','');if(_0x2415b7[_0x6333('0x14')]('\x20')!=-0x1){_0x2415b7=_0x2415b7[_0x6333('0x15')](0x0,_0x2415b7[_0x6333('0x14')]('\x20'));}if(_[_0x6333('0x16')](_0x2415b7,'-1')){_0x2415b7=parseInt(_0x2415b7);}_0x4a28a2=_0xe53ff0['rx'][_0x6333('0x17')]('\x20');if(_0x4a28a2[_0x6333('0x18')]==0x3){_0x4a28a2=_0x4a28a2[0x2][_0x6333('0xe')](0x1,_0x4a28a2[0x2][_0x6333('0x18')]-0x1);}else if(_0x4a28a2[_0x6333('0x18')]>0x3){var _0x20bc6d=/\((.+)\)/;var _0x1cf029=_0xe53ff0['rx'][_0x6333('0x19')](_0x20bc6d);if(_0x1cf029){_0x4a28a2=_0x1cf029[0x1];}else{_0x4a28a2=null;}}else{_0x4a28a2=null;}_0xe53ff0['cb'](null,{'code':_0x314587,'result':_0x2415b7,'extra':_0x4a28a2});}});_0x419d8d['on'](_0x6333('0x1a'),function(_0x20047e){_0x450564['emit'](_0x6333('0x1a'),new AGIError(_0x6333('0x1b'),_0x20047e[_0x6333('0x1c')]));});_0x419d8d['on'](_0x6333('0x1d'),function(){_0x450564[_0x6333('0x9')]('close',new AGIError(_0x6333('0x1e')));});_0x419d8d['on'](_0x6333('0x1f'),function(){_0x450564[_0x6333('0x9')]('timeout',new AGIError(_0x6333('0x20')));_0x419d8d[_0x6333('0x21')]();});_0x419d8d[_0x6333('0x22')](_0x371e97);this['command']=function(_0x4c2dfb,_0x11c95a){var _0x4c2dfb=_0x4c2dfb||'',_0x11c95a=typeof _0x11c95a==_0x6333('0x11')?_0x11c95a:new Function();_0xe53ff0={'tx':_0x4c2dfb,'rx':'','cb':_0x11c95a};_0x419d8d[_0x6333('0x23')](_0x4c2dfb+'\x0a');},this['close']=function(){_0x419d8d[_0x6333('0x21')]();};}util[_0x6333('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x6333('0x25')][_0x6333('0x26')]=function(_0x18230a){return this[_0x6333('0x27')]['sync'](this,_0x18230a);};AGIChannel[_0x6333('0x25')][_0x6333('0x28')]=function(){return this[_0x6333('0x26')](_0x6333('0x29'));};AGIChannel[_0x6333('0x25')][_0x6333('0x2a')]=function(_0x1d1990,_0x4fd2f6,_0x4e6766){_0x1d1990=_0x1d1990===undefined?_0x6333('0x2b'):_0x1d1990;_0x4fd2f6=_0x4fd2f6===undefined?'5':_0x4fd2f6;_0x4e6766=_0x4e6766===undefined?'1':_0x4e6766;return this[_0x6333('0x26')](util[_0x6333('0x2c')](_0x6333('0x2d'),_0x1d1990,_0x4fd2f6*0x3e8,_0x4e6766));};AGIChannel['prototype'][_0x6333('0x2e')]=function(_0x23aadb){_0x23aadb=_0x23aadb||'NO\x20MESSAGE';return this[_0x6333('0x26')](util[_0x6333('0x2c')](_0x6333('0x2f'),_0x23aadb));};AGIChannel[_0x6333('0x25')][_0x6333('0x30')]=function(_0x3a2372,_0x2f0ae2){if(_[_0x6333('0x31')](_0x2f0ae2)){return this[_0x6333('0x26')](util[_0x6333('0x2c')](_0x6333('0x32'),_0x3a2372,_0x2f0ae2[_0x6333('0x33')](',')));}return this[_0x6333('0x26')](util[_0x6333('0x2c')](_0x6333('0x32'),_0x3a2372,_0x2f0ae2));};AGIChannel[_0x6333('0x25')][_0x6333('0x34')]=function(_0x37e6fc){return this['sendRequest'](util[_0x6333('0x2c')]('SET\x20CONTEXT\x20%s',_0x37e6fc));};AGIChannel['prototype']['setExtension']=function(_0x297f20){return this[_0x6333('0x26')](util[_0x6333('0x2c')]('SET\x20EXTENSION\x20%s',_0x297f20));};AGIChannel[_0x6333('0x25')][_0x6333('0x35')]=function(_0x40f1f4){return this['sendRequest'](util[_0x6333('0x2c')](_0x6333('0x36'),_0x40f1f4));};AGIChannel[_0x6333('0x25')]['hangup']=function(){return this[_0x6333('0x26')](_0x6333('0x37'));};AGIChannel[_0x6333('0x25')][_0x6333('0x38')]=function(_0x1d8c08,_0x5c8bd8){var _0x468f3d=_[_0x6333('0x39')](_0x5c8bd8)||_[_0x6333('0x3a')](_0x5c8bd8)?_0x5c8bd8[_0x6333('0x3b')]():_0x5c8bd8;return this['sendRequest'](util[_0x6333('0x2c')](_0x6333('0x3c'),_0x1d8c08,_0x468f3d?_0x468f3d['toString']()[_0x6333('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6333('0x25')]['sayNumber']=function(_0x2d5555,_0x3c8710){return this[_0x6333('0x26')](util['format'](_0x6333('0x3d'),_0x2d5555,_0x3c8710));};AGIChannel[_0x6333('0x25')][_0x6333('0x3e')]=function(_0x20412f,_0x537b52){return this['sendRequest'](util['format'](_0x6333('0x3f'),_0x20412f,_0x537b52));};AGIChannel[_0x6333('0x25')][_0x6333('0x40')]=function(_0xa2411c,_0x1ae654){return this[_0x6333('0x26')](util['format'](_0x6333('0x41'),_0xa2411c,_0x1ae654));};AGIChannel[_0x6333('0x25')][_0x6333('0x42')]=function(_0x4c0f24,_0x58a3d3,_0x4c5c70){_0x58a3d3=_0x58a3d3||this[_0x6333('0x43')];_0x4c5c70=_0x4c5c70||0x1;this[_0x6333('0x34')](_0x4c0f24);this[_0x6333('0x44')](_0x58a3d3);this['setPriority'](_0x4c5c70);return this[_0x6333('0x2e')](util[_0x6333('0x2c')](_0x6333('0x45'),_0x4c0f24,_0x58a3d3,_0x4c5c70));};AGIChannel[_0x6333('0x25')][_0x6333('0x46')]=function(_0x501f7d){return this['sendRequest'](util[_0x6333('0x2c')](_0x6333('0x47'),_0x501f7d));};AGIChannel[_0x6333('0x25')]['recordFile']=function(_0x2f498c,_0x4f4336,_0x92dbb6,_0x404c05,_0x527feb,_0x477ab6){_0x4f4336=_0x4f4336||_0x6333('0x48');_0x92dbb6=_0x92dbb6||'';_0x404c05=_0x404c05===undefined?-0x1:_0x404c05==='-1'?-0x1:_0x404c05*0x3e8;_0x527feb=_0x527feb===undefined?'':'s='+_0x527feb;_0x477ab6=_0x477ab6?_0x6333('0x49'):'';return this[_0x6333('0x26')](util[_0x6333('0x2c')](_0x6333('0x4a'),_0x2f498c,_0x4f4336,_0x92dbb6,_0x404c05,_0x477ab6,_0x527feb));};AGIChannel[_0x6333('0x25')][_0x6333('0x4b')]=function(_0xd82819,_0x58eac7){_0x58eac7=_0x58eac7||'';return this[_0x6333('0x26')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xd82819,_0x58eac7));};AGIChannel[_0x6333('0x25')][_0x6333('0x4c')]=function(_0x53d7ac){return this['exec'](_0x6333('0x4d'),_0x53d7ac);};AGIChannel[_0x6333('0x25')][_0x6333('0x4e')]=function(_0x321b37){return this[_0x6333('0x30')](_0x6333('0x4f'),_0x321b37);};AGIChannel[_0x6333('0x25')][_0x6333('0x1a')]=function(_0x15c6b2,_0x3bf144){this[_0x6333('0x2e')](util[_0x6333('0x2c')](_0x6333('0x50'),_0x15c6b2['id'],_0x15c6b2[_0x6333('0x51')],_0x3bf144));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6333('0x52')]=AGIChannel; \ No newline at end of file +var _0x27cb=['destroy','command','write','prototype','sendRequest','sync','answer','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','isArray','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout'];(function(_0x272ed5,_0x174b1a){var _0x2e3657=function(_0xeef539){while(--_0xeef539){_0x272ed5['push'](_0x272ed5['shift']());}};_0x2e3657(++_0x174b1a);}(_0x27cb,0x73));var _0xb27c=function(_0x353623,_0x370d22){_0x353623=_0x353623-0x0;var _0x20022d=_0x27cb[_0x353623];return _0x20022d;};'use strict';var util=require(_0xb27c('0x0'));var _=require('lodash');var EventEmitter=require(_0xb27c('0x1'))[_0xb27c('0x2')];var AGIReply=require(_0xb27c('0x3'));var AGIError=require(_0xb27c('0x4'));function AGIChannel(_0x4bb03d){var _0x17c985=this,_0x5da5e9=new AGIReply(),_0x56412e=![],_0x4c2a87={};EventEmitter[_0xb27c('0x5')](_0x17c985);_0x4bb03d[_0xb27c('0x6')](_0xb27c('0x7'));_0x4bb03d[_0xb27c('0x8')](0x8*0x3c*0x3c*0x3e8);_0x5da5e9['setEncoding'](_0xb27c('0x7'));_0x5da5e9['on'](_0xb27c('0x9'),function(_0x1f4512){for(var _0x3a20fe in _0x1f4512){_0x17c985[_0x3a20fe]=_0x1f4512[_0x3a20fe];}_0x17c985[_0xb27c('0xa')](_0xb27c('0xb'));});_0x5da5e9['on'](_0xb27c('0xc'),function(_0x1b07be){if(_0x1b07be[_0xb27c('0xd')]()=='hangup'){_0x17c985[_0xb27c('0xa')](_0xb27c('0xe'));return;}if(_0x1b07be[_0xb27c('0xf')](0x0,0xb)==_0xb27c('0x10')){_0x56412e=!![];}if(_0x56412e){_0x4c2a87['rx']+=_0x1b07be+'\x0a';if(_0x1b07be['search']('520\x20End\x20of\x20proper')!=-0x1){_0x56412e=![];}}else{_0x4c2a87['rx']=_0x1b07be;}if(_0x56412e){return;}if(typeof _0x4c2a87['cb']==_0xb27c('0x11')){var _0x49f581=_0x4c2a87['rx'][_0xb27c('0xf')](0x0,0x3),_0x152b28=null,_0x2468e9=null;_0x49f581=parseInt(_0x49f581);if(isNaN(_0x49f581)){_0x4c2a87['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb27c('0x12')});return;}if(_0x49f581!=0xc8){_0x4c2a87['cb'](null,{'code':_0x49f581,'result':-0x1,'extra':'KO'});return;}_0x152b28=_0x4c2a87['rx'][_0xb27c('0xf')](0x4)[_0xb27c('0x13')](_0xb27c('0x14'),'');if(_0x152b28[_0xb27c('0x15')]('\x20')!=-0x1){_0x152b28=_0x152b28[_0xb27c('0x16')](0x0,_0x152b28[_0xb27c('0x15')]('\x20'));}if(_[_0xb27c('0x17')](_0x152b28,'-1')){_0x152b28=parseInt(_0x152b28);}_0x2468e9=_0x4c2a87['rx'][_0xb27c('0x18')]('\x20');if(_0x2468e9['length']==0x3){_0x2468e9=_0x2468e9[0x2]['substring'](0x1,_0x2468e9[0x2][_0xb27c('0x19')]-0x1);}else if(_0x2468e9['length']>0x3){var _0x13d295=/\((.+)\)/;var _0x331e7b=_0x4c2a87['rx']['match'](_0x13d295);if(_0x331e7b){_0x2468e9=_0x331e7b[0x1];}else{_0x2468e9=null;}}else{_0x2468e9=null;}_0x4c2a87['cb'](null,{'code':_0x49f581,'result':_0x152b28,'extra':_0x2468e9});}});_0x4bb03d['on'](_0xb27c('0x1a'),function(_0x2e903f){_0x17c985[_0xb27c('0xa')]('error',new AGIError(_0xb27c('0x1b'),_0x2e903f[_0xb27c('0x1c')]));});_0x4bb03d['on'](_0xb27c('0x1d'),function(){_0x17c985[_0xb27c('0xa')](_0xb27c('0x1d'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4bb03d['on'](_0xb27c('0x1e'),function(){_0x17c985[_0xb27c('0xa')](_0xb27c('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4bb03d[_0xb27c('0x1f')]();});_0x4bb03d['pipe'](_0x5da5e9);this[_0xb27c('0x20')]=function(_0x339e73,_0x39b0ab){var _0x339e73=_0x339e73||'',_0x39b0ab=typeof _0x39b0ab==_0xb27c('0x11')?_0x39b0ab:new Function();_0x4c2a87={'tx':_0x339e73,'rx':'','cb':_0x39b0ab};_0x4bb03d[_0xb27c('0x21')](_0x339e73+'\x0a');},this['close']=function(){_0x4bb03d['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xb27c('0x22')][_0xb27c('0x23')]=function(_0x49b7ee){return this['command'][_0xb27c('0x24')](this,_0x49b7ee);};AGIChannel[_0xb27c('0x22')][_0xb27c('0x25')]=function(){return this[_0xb27c('0x23')](_0xb27c('0x26'));};AGIChannel['prototype']['getData']=function(_0x3eb347,_0x2fa6aa,_0x41d93d){_0x3eb347=_0x3eb347===undefined?'beep':_0x3eb347;_0x2fa6aa=_0x2fa6aa===undefined?'5':_0x2fa6aa;_0x41d93d=_0x41d93d===undefined?'1':_0x41d93d;return this['sendRequest'](util['format'](_0xb27c('0x27'),_0x3eb347,_0x2fa6aa*0x3e8,_0x41d93d));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x28')]=function(_0xb83875){_0xb83875=_0xb83875||'NO\x20MESSAGE';return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x2a'),_0xb83875));};AGIChannel[_0xb27c('0x22')]['exec']=function(_0x156d93,_0x3538f1){if(_[_0xb27c('0x2b')](_0x3538f1)){return this[_0xb27c('0x23')](util[_0xb27c('0x29')]('EXEC\x20%s\x20%s',_0x156d93,_0x3538f1[_0xb27c('0x2c')](',')));}return this[_0xb27c('0x23')](util[_0xb27c('0x29')]('EXEC\x20%s\x20%s',_0x156d93,_0x3538f1));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x2d')]=function(_0x429efc){return this['sendRequest'](util[_0xb27c('0x29')](_0xb27c('0x2e'),_0x429efc));};AGIChannel['prototype'][_0xb27c('0x2f')]=function(_0x3a2ccc){return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x30'),_0x3a2ccc));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x31')]=function(_0x145d66){return this[_0xb27c('0x23')](util['format'](_0xb27c('0x32'),_0x145d66));};AGIChannel[_0xb27c('0x22')][_0xb27c('0xe')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xb27c('0x22')]['setVariable']=function(_0x1f7502,_0x1b0016){var _0x52f523=_[_0xb27c('0x33')](_0x1b0016)||_[_0xb27c('0x34')](_0x1b0016)?_0x1b0016[_0xb27c('0x35')]():_0x1b0016;return this[_0xb27c('0x23')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1f7502,_0x52f523?_0x52f523['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x36')]=function(_0xaa40e8,_0x351242){return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x37'),_0xaa40e8,_0x351242));};AGIChannel['prototype'][_0xb27c('0x38')]=function(_0xdbe0c5,_0x6f3a7c){return this[_0xb27c('0x23')](util['format'](_0xb27c('0x39'),_0xdbe0c5,_0x6f3a7c));};AGIChannel[_0xb27c('0x22')]['sayPhonetic']=function(_0xebe818,_0x46af9c){return this[_0xb27c('0x23')](util[_0xb27c('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xebe818,_0x46af9c));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x3a')]=function(_0x5f586f,_0xb03e7,_0x4fafe2){_0xb03e7=_0xb03e7||this[_0xb27c('0x3b')];_0x4fafe2=_0x4fafe2||0x1;this[_0xb27c('0x2d')](_0x5f586f);this['setExtension'](_0xb03e7);this['setPriority'](_0x4fafe2);return this[_0xb27c('0x28')](util[_0xb27c('0x29')](_0xb27c('0x3c'),_0x5f586f,_0xb03e7,_0x4fafe2));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x3d')]=function(_0x350bd2){return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x3e'),_0x350bd2));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x3f')]=function(_0x2ba56f,_0x51143a,_0x3f993a,_0x709e1,_0x3bb31e,_0x207222){_0x51143a=_0x51143a||_0xb27c('0x40');_0x3f993a=_0x3f993a||'';_0x709e1=_0x709e1===undefined?-0x1:_0x709e1==='-1'?-0x1:_0x709e1*0x3e8;_0x3bb31e=_0x3bb31e===undefined?'':'s='+_0x3bb31e;_0x207222=_0x207222?_0xb27c('0x41'):'';return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x42'),_0x2ba56f,_0x51143a,_0x3f993a,_0x709e1,_0x207222,_0x3bb31e));};AGIChannel['prototype'][_0xb27c('0x43')]=function(_0x512aa6,_0x233987){_0x233987=_0x233987||'';return this[_0xb27c('0x23')](util[_0xb27c('0x29')](_0xb27c('0x44'),_0x512aa6,_0x233987));};AGIChannel[_0xb27c('0x22')][_0xb27c('0x45')]=function(_0x51a58f){return this[_0xb27c('0x46')](_0xb27c('0x47'),_0x51a58f);};AGIChannel[_0xb27c('0x22')]['wait']=function(_0x2080a2){return this[_0xb27c('0x46')]('WAIT',_0x2080a2);};AGIChannel[_0xb27c('0x22')][_0xb27c('0x1a')]=function(_0x31413b,_0x11bfd9){this['noop'](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x31413b['id'],_0x31413b['label'],_0x11bfd9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb27c('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 68df02b..188619d 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 _0x7790=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util'];(function(_0x4e624f,_0x488557){var _0x2d8c36=function(_0x4200e7){while(--_0x4200e7){_0x4e624f['push'](_0x4e624f['shift']());}};_0x2d8c36(++_0x488557);}(_0x7790,0x1b4));var _0x0779=function(_0x93ecfe,_0x21a1a8){_0x93ecfe=_0x93ecfe-0x0;var _0xc5470b=_0x7790[_0x93ecfe];return _0xc5470b;};'use strict';var util=require(_0x0779('0x0'));var error={'E_AGI_UNDEFINED':_0x0779('0x1'),'E_AGI_ARGUMENT_PORT':_0x0779('0x2'),'E_AGI_SERVER_ERROR':_0x0779('0x3'),'E_AGI_SERVER_CLOSE':_0x0779('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x0779('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x0779('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x0779('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x0779('0x8'),'E_AGI_COMMAND_EMPTY':_0x0779('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0779('0xa'),'E_AGI_IVR_ENTRY':_0x0779('0xb')};function AGIError(_0x1ead58){var _0x1ead58=_0x1ead58||null,_0x38022f=_0x38022f||[],_0xf69405=0x1,_0x1a4b91='';if(!error[_0x1ead58]){_0x1ead58=_0x0779('0xc');}_0x38022f[_0x0779('0xd')](error[_0x1ead58]);while(arguments[_0xf69405]){_0x38022f[_0x0779('0xd')](arguments[_0xf69405]);_0xf69405++;}_0x1a4b91=util[_0x0779('0xe')][_0x0779('0xf')](util,_0x38022f);this[_0x0779('0x10')]=_0x1a4b91;this[_0x0779('0x11')]=_0x1ead58;}module[_0x0779('0x12')]=AGIError; \ No newline at end of file +var _0x0e4d=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x0e4d,0x6a));var _0xd0e4=function(_0x1d78fd,_0x2ca675){_0x1d78fd=_0x1d78fd-0x0;var _0x530f92=_0x0e4d[_0x1d78fd];return _0x530f92;};'use strict';var util=require(_0xd0e4('0x0'));var error={'E_AGI_UNDEFINED':_0xd0e4('0x1'),'E_AGI_ARGUMENT_PORT':_0xd0e4('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xd0e4('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xd0e4('0x4'),'E_AGI_SOCKET_ERROR':_0xd0e4('0x5'),'E_AGI_SOCKET_CLOSE':_0xd0e4('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xd0e4('0x7'),'E_AGI_COMMAND_EMPTY':_0xd0e4('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd0e4('0x9'),'E_AGI_IVR_ENTRY':_0xd0e4('0xa')};function AGIError(_0xb51e7c){var _0xb51e7c=_0xb51e7c||null,_0x33dbf9=_0x33dbf9||[],_0x2ad112=0x1,_0x43f4d1='';if(!error[_0xb51e7c]){_0xb51e7c='E_AGI_UNDEFINED';}_0x33dbf9[_0xd0e4('0xb')](error[_0xb51e7c]);while(arguments[_0x2ad112]){_0x33dbf9[_0xd0e4('0xb')](arguments[_0x2ad112]);_0x2ad112++;}_0x43f4d1=util[_0xd0e4('0xc')]['apply'](util,_0x33dbf9);this[_0xd0e4('0xd')]=_0x43f4d1;this['name']=_0xb51e7c;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b3ac89d..1d1b911 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90eb=['exports','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','error','E_AGI_SERVER_ERROR','message','parse','emit'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x90eb,0x1a5));var _0xb90e=function(_0x483870,_0x515904){_0x483870=_0x483870-0x0;var _0xa44164=_0x90eb[_0x483870];return _0xa44164;};'use strict';var _=require('lodash');var EventEmitter=require(_0xb90e('0x0'))[_0xb90e('0x1')];var Redis=require(_0xb90e('0x2'));var AGIError=require(_0xb90e('0x3'));var config=require(_0xb90e('0x4'));config[_0xb90e('0x5')]=_[_0xb90e('0x6')](config[_0xb90e('0x5')],{'host':_0xb90e('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb90e('0x5')]);sub[_0xb90e('0x8')]('agi',function(_0x220b9f){if(_0x220b9f)return eventEmitter['emit'](_0xb90e('0x9'),new AGIError(_0xb90e('0xa'),_0x220b9f));});sub['on'](_0xb90e('0xb'),function(_0x103d8b,_0x23e807){if(_0x103d8b!=='agi')return;try{var _0x555819=JSON[_0xb90e('0xc')](_0x23e807);eventEmitter['emit']('projectUpdate',_0x555819);}catch(_0x39d96d){eventEmitter[_0xb90e('0xd')]('error',new AGIError(_0xb90e('0xa'),_0x39d96d));}});module[_0xb90e('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xa54e=['parse','projectUpdate','error','exports','lodash','events','ioredis','../../config/environment','redis','defaults','localhost','subscribe','emit','E_AGI_SERVER_ERROR','message'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xa54e,0xa9));var _0xea54=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0xa54e[_0x7ea1fb];return _0x478241;};'use strict';var _=require(_0xea54('0x0'));var EventEmitter=require(_0xea54('0x1'))['EventEmitter'];var Redis=require(_0xea54('0x2'));var AGIError=require('./error');var config=require(_0xea54('0x3'));config[_0xea54('0x4')]=_[_0xea54('0x5')](config[_0xea54('0x4')],{'host':_0xea54('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xea54('0x4')]);sub[_0xea54('0x7')]('agi',function(_0x3f4fe4){if(_0x3f4fe4)return eventEmitter[_0xea54('0x8')]('error',new AGIError(_0xea54('0x9'),_0x3f4fe4));});sub['on'](_0xea54('0xa'),function(_0x31037c,_0x2ef0eb){if(_0x31037c!=='agi')return;try{var _0x5f1e59=JSON[_0xea54('0xb')](_0x2ef0eb);eventEmitter[_0xea54('0x8')](_0xea54('0xc'),_0x5f1e59);}catch(_0x3b1945){eventEmitter[_0xea54('0x8')](_0xea54('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x3b1945));}});module[_0xea54('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 6f8887d..cdb72b7 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 _0xb2c2=['vswitch','target','default','invalid','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','relations','getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand'];(function(_0x100547,_0x153b0c){var _0x2d638f=function(_0x1d86b8){while(--_0x1d86b8){_0x100547['push'](_0x100547['shift']());}};_0x2d638f(++_0x153b0c);}(_0xb2c2,0x1d9));var _0x2b2c=function(_0x4acf6f,_0x5072e5){_0x4acf6f=_0x4acf6f-0x0;var _0x3c6d3a=_0xb2c2[_0x4acf6f];return _0x3c6d3a;};'use strict';var _=require(_0x2b2c('0x0'));var logger=require(_0x2b2c('0x1'))(_0x2b2c('0x2'));var verticesWithRetry=[_0x2b2c('0x3'),'getdigits',_0x2b2c('0x4')];var Graph=function(){this[_0x2b2c('0x5')]={};this[_0x2b2c('0x6')]={};this[_0x2b2c('0x7')]=0x0;};Graph[_0x2b2c('0x8')][_0x2b2c('0x9')]=function(_0x38bf61){this[_0x2b2c('0x5')][_0x38bf61['id']]=_0x38bf61;this[_0x2b2c('0x6')][_0x38bf61['id']]=[];};Graph[_0x2b2c('0x8')]['addEdge']=function(_0x117a6c,_0x23cf99,_0x28a82d){this[_0x2b2c('0x6')][_0x117a6c][_0x2b2c('0xa')]({'target':_0x23cf99,'condition':_0x28a82d});this[_0x2b2c('0x7')]+=0x1;};Graph['prototype']['size']=function(){return _['size'](this[_0x2b2c('0x5')]);};Graph['prototype'][_0x2b2c('0xb')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x2b2c('0xc')]=function(_0x1139d8){return this[_0x2b2c('0x5')][_0x1139d8];};Graph['prototype']['traverseBFS']=function(_0x13b77d,_0x5b5465){if(!this[_0x2b2c('0x5')][_0x13b77d]){return logger['info']('no\x20vertex\x20found');}var _0x3a3798=_0x5b5465(this[_0x2b2c('0x5')][_0x13b77d]);if(!_0x3a3798){return logger[_0x2b2c('0xd')](_0x2b2c('0xe'));}if(this['edges'][_0x13b77d][_0x2b2c('0xf')]===0x0){return logger[_0x2b2c('0xd')](_0x2b2c('0x10'));}for(var _0x2805ea=0x0,_0x3e551d=[],_0x7cd25=![];_0x2805ea-0x1){if(_0x4fd05c['deleted']===!![]){projects[_0x82d1('0xc')](_0x1826ac,0x1);}else{projects[_0x1826ac]=_0x4fd05c;}}else{projects[_0x82d1('0xd')](_0x4fd05c);}}catch(_0x3f10a6){logger['error'](_0x3f10a6['stack']);}}function listeningHandler(){console[_0x82d1('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x82d1('0x5')][_0x82d1('0xf')]);logger['info'](util['format'](_0x82d1('0x10'),config[_0x82d1('0x5')]['ip'],config['agi'][_0x82d1('0xf')]));}function errorHandler(_0x3c3061){if(_0x3c3061&&_0x3c3061[_0x82d1('0x11')]&&_0x3c3061[_0x82d1('0x12')]){logger[_0x82d1('0xa')](util[_0x82d1('0x13')](_0x82d1('0x14'),_0x3c3061[_0x82d1('0x11')],_0x3c3061['message']));}else{logger['error'](util[_0x82d1('0x13')](_0x82d1('0x15'),_0x3c3061[_0x82d1('0xb')]));}}function closeHandler(){logger[_0x82d1('0x16')](util[_0x82d1('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82d1('0x17')],this[_0x82d1('0x18')],this[_0x82d1('0x19')],this[_0x82d1('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1c6a9){logger['error'](_0x1c6a9['stack']);}}function timeoutHandler(){logger[_0x82d1('0x16')](util[_0x82d1('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82d1('0x17')],this['calleridname'],this[_0x82d1('0x19')],this[_0x82d1('0x1a')],this[_0x82d1('0x1b')]));}function hangupHandler(){logger['info'](util[_0x82d1('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82d1('0x17')],this[_0x82d1('0x18')],this['callerid'],this[_0x82d1('0x1a')],this['uniqueid']));this[_0x82d1('0x1c')]=!![];}function createSquareReport(_0xc5afae,_0x282af9){rpc[_0x82d1('0x1d')](_0xc5afae)[_0x82d1('0x1e')](function(_0x515fd2){if(_0x282af9){_0x282af9(null,_0x515fd2);}})[_0x82d1('0x1f')](function(_0x424230){if(_0x282af9){_0x282af9(null,_0x424230);}});}function setChannelVariables(_0xcf2bc){for(var _0x43949d in _0xcf2bc){if(_0xcf2bc['hasOwnProperty'](_0x43949d)){if(_0x43949d['indexOf'](_0x82d1('0x20'))===0x0){_0xcf2bc[_0x43949d[_0x82d1('0x21')](0x4)]=_0xcf2bc[_0x43949d];delete _0xcf2bc[_0x43949d];}}}}function agiHandler(_0x2d4987){logger[_0x82d1('0x22')](_0x82d1('0x23'),JSON[_0x82d1('0x24')](_0x2d4987,null,0x2));logger[_0x82d1('0x16')](util[_0x82d1('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2d4987[_0x82d1('0x17')],_0x2d4987[_0x82d1('0x18')],_0x2d4987['callerid'],_0x2d4987[_0x82d1('0x1a')],_0x2d4987['uniqueid']));_0x2d4987['on']('error',errorHandler);_0x2d4987['on'](_0x82d1('0x25'),closeHandler);_0x2d4987['on'](_0x82d1('0x26'),timeoutHandler);_0x2d4987[_0x82d1('0x1c')]=![];_0x2d4987['on'](_0x82d1('0x27'),hangupHandler);var _0x3c1509=_['find'](projects,[_0x82d1('0x11'),_0x2d4987['arg_1']]);if(!_0x3c1509)return Project[_0x82d1('0x28')](_0x2d4987);if(!_0x3c1509[_0x82d1('0x29')])return Project[_0x82d1('0x2a')](_0x2d4987);return Project[_0x82d1('0x2b')](_0x3c1509,_0x2d4987);}function main(){var _0x1e661d;return utilLicense[_0x82d1('0x2c')]()['then'](function(_0x28de91){if(!_0x28de91)return;if(_0x28de91['voice']){if(_0x28de91['callysquare']&&_0x28de91['callysquare']>0x0){logger[_0x82d1('0x16')](util[_0x82d1('0x13')](_0x82d1('0x2d'),_0x28de91[_0x82d1('0x2e')]));_0x1e661d=_0x28de91[_0x82d1('0x2e')];}else{logger[_0x82d1('0x16')](_0x82d1('0x2f'));}}else{logger[_0x82d1('0x16')](_0x82d1('0x30'));_0x1e661d=-0x1;}})['then'](function(){return Project['getAll']();})[_0x82d1('0x1e')](function(_0x5ecdc2){projects=_0x5ecdc2;return;})['catch'](function(_0x1ca249){logger[_0x82d1('0xa')](_0x82d1('0x31'),_0x1ca249[_0x82d1('0xb')]);})[_0x82d1('0x32')](function(){var _0x4a6144=require(_0x82d1('0x33'))(config['agi']['port'],config[_0x82d1('0x5')]['ip'],_0x1e661d);_0x4a6144['on'](_0x82d1('0xa'),errorHandler);_0x4a6144['on']('listening',listeningHandler);_0x4a6144['on']('connection',connectionHandler);_0x4a6144['on'](_0x82d1('0x25'),closeHandler);});}main(); \ No newline at end of file +var _0x17a8=['message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','find','handleNotFound','production','handleUnpublished','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','./events','EventEmitter','agi','127.0.0.1','nextTick','stack','findIndex','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x17a8,0x15d));var _0x817a=function(_0x1e2f5b,_0x60bf47){_0x1e2f5b=_0x1e2f5b-0x0;var _0x2bb7bc=_0x17a8[_0x1e2f5b];return _0x2bb7bc;};'use strict';var _=require('lodash');var syncho=require(_0x817a('0x0'));var util=require(_0x817a('0x1'));var config=require(_0x817a('0x2'));var logger=require(_0x817a('0x3'))('agi');var utilLicense=require(_0x817a('0x4'));var rpc=require(_0x817a('0x5'));var Project=require(_0x817a('0x6'));var AGIEmitter=require(_0x817a('0x7'))[_0x817a('0x8')];var projects=[];config[_0x817a('0x9')]=_['defaults'](config[_0x817a('0x9')],{'ip':_0x817a('0xa'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x1f1c47){process[_0x817a('0xb')](function(){syncho(function(){try{setChannelVariables(_0x1f1c47);agiHandler(_0x1f1c47);}catch(_0x3610a1){logger['error'](_0x3610a1[_0x817a('0xc')]);}});});}function projectUpdateHandler(_0x2f038a){try{var _0x311003=_[_0x817a('0xd')](projects,['id',_0x2f038a['id']]);if(_0x311003>-0x1){if(_0x2f038a[_0x817a('0xe')]===!![]){projects['splice'](_0x311003,0x1);}else{projects[_0x311003]=_0x2f038a;}}else{projects[_0x817a('0xf')](_0x2f038a);}}catch(_0x105666){logger[_0x817a('0x10')](_0x105666[_0x817a('0xc')]);}}function listeningHandler(){console[_0x817a('0x11')](_0x817a('0x12'),config[_0x817a('0x9')][_0x817a('0x13')]);logger[_0x817a('0x14')](util['format'](_0x817a('0x15'),config['agi']['ip'],config[_0x817a('0x9')][_0x817a('0x13')]));}function errorHandler(_0x3e9f19){if(_0x3e9f19&&_0x3e9f19[_0x817a('0x16')]&&_0x3e9f19[_0x817a('0x17')]){logger[_0x817a('0x10')](util[_0x817a('0x18')](_0x817a('0x19'),_0x3e9f19[_0x817a('0x16')],_0x3e9f19[_0x817a('0x17')]));}else{logger[_0x817a('0x10')](util[_0x817a('0x18')](_0x817a('0x1a'),_0x3e9f19[_0x817a('0xc')]));}}function closeHandler(){logger[_0x817a('0x14')](util['format'](_0x817a('0x1b'),this[_0x817a('0x1c')],this['calleridname'],this['callerid'],this['dnid'],this[_0x817a('0x1d')]));try{createSquareReport(this);}catch(_0x4fdb25){logger['error'](_0x4fdb25[_0x817a('0xc')]);}}function timeoutHandler(){logger['info'](util['format'](_0x817a('0x1e'),this['arg_1'],this[_0x817a('0x1f')],this[_0x817a('0x20')],this['dnid'],this[_0x817a('0x1d')]));}function hangupHandler(){logger[_0x817a('0x14')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x817a('0x1f')],this[_0x817a('0x20')],this[_0x817a('0x21')],this[_0x817a('0x1d')]));this[_0x817a('0x22')]=!![];}function createSquareReport(_0x535df2,_0x4d5a3b){rpc[_0x817a('0x23')](_0x535df2)['then'](function(_0x330b94){if(_0x4d5a3b){_0x4d5a3b(null,_0x330b94);}})[_0x817a('0x24')](function(_0x4d92c0){if(_0x4d5a3b){_0x4d5a3b(null,_0x4d92c0);}});}function setChannelVariables(_0x4f7665){for(var _0x191069 in _0x4f7665){if(_0x4f7665[_0x817a('0x25')](_0x191069)){if(_0x191069[_0x817a('0x26')](_0x817a('0x27'))===0x0){_0x4f7665[_0x191069[_0x817a('0x28')](0x4)]=_0x4f7665[_0x191069];delete _0x4f7665[_0x191069];}}}}function agiHandler(_0x14cb20){logger['debug'](_0x817a('0x29'),JSON[_0x817a('0x2a')](_0x14cb20,null,0x2));logger['info'](util[_0x817a('0x18')](_0x817a('0x2b'),_0x14cb20[_0x817a('0x1c')],_0x14cb20[_0x817a('0x1f')],_0x14cb20['callerid'],_0x14cb20['dnid'],_0x14cb20[_0x817a('0x1d')]));_0x14cb20['on']('error',errorHandler);_0x14cb20['on'](_0x817a('0x2c'),closeHandler);_0x14cb20['on']('timeout',timeoutHandler);_0x14cb20[_0x817a('0x22')]=![];_0x14cb20['on']('hangup',hangupHandler);var _0x14e2ee=_[_0x817a('0x2d')](projects,['name',_0x14cb20['arg_1']]);if(!_0x14e2ee)return Project[_0x817a('0x2e')](_0x14cb20);if(!_0x14e2ee[_0x817a('0x2f')])return Project[_0x817a('0x30')](_0x14cb20);return Project[_0x817a('0x31')](_0x14e2ee,_0x14cb20);}function main(){var _0x5ef4a0;return utilLicense['getLicense']()[_0x817a('0x32')](function(_0x4694dc){if(!_0x4694dc)return;if(_0x4694dc[_0x817a('0x33')]){if(_0x4694dc[_0x817a('0x34')]&&_0x4694dc['callysquare']>0x0){logger[_0x817a('0x14')](util[_0x817a('0x18')](_0x817a('0x35'),_0x4694dc['callysquare']));_0x5ef4a0=_0x4694dc[_0x817a('0x34')];}else{logger[_0x817a('0x14')](_0x817a('0x36'));}}else{logger[_0x817a('0x14')](_0x817a('0x37'));_0x5ef4a0=-0x1;}})[_0x817a('0x32')](function(){return Project[_0x817a('0x38')]();})['then'](function(_0x4e7a02){projects=_0x4e7a02;return;})['catch'](function(_0xf8a6a9){logger[_0x817a('0x10')](_0x817a('0x39'),_0xf8a6a9[_0x817a('0xc')]);})[_0x817a('0x3a')](function(){var _0x242f6a=require(_0x817a('0x3b'))(config[_0x817a('0x9')]['port'],config[_0x817a('0x9')]['ip'],_0x5ef4a0);_0x242f6a['on']('error',errorHandler);_0x242f6a['on'](_0x817a('0x3c'),listeningHandler);_0x242f6a['on'](_0x817a('0x3d'),connectionHandler);_0x242f6a['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index ac295cf..5185595 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 _0xf7a1=['catch','sendMailMessage','SendMail','jayson/promise','client','http','request','error','result'];(function(_0x308d75,_0x308317){var _0x4af568=function(_0x2b2b74){while(--_0x2b2b74){_0x308d75['push'](_0x308d75['shift']());}};_0x4af568(++_0x308317);}(_0xf7a1,0x159));var _0x1f7a=function(_0xb983c4,_0x679e53){_0xb983c4=_0xb983c4-0x0;var _0x4d4570=_0xf7a1[_0xb983c4];return _0x4d4570;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x1f7a('0x0'));var client=jayson[_0x1f7a('0x1')][_0x1f7a('0x2')]({'port':0x232b});function request(_0x44eb22,_0x4a1967){return new BPromise(function(_0x2f04ea,_0x2ec3df){return client[_0x1f7a('0x3')](_0x44eb22,_0x4a1967)['then'](function(_0x30d04f){if(_0x30d04f[_0x1f7a('0x4')]){return _0x2ec3df(_0x30d04f[_0x1f7a('0x4')]['message']);}else{return _0x2f04ea(_0x30d04f[_0x1f7a('0x5')]);}})[_0x1f7a('0x6')](function(_0x253091){return _0x2ec3df(_0x253091);});});}exports[_0x1f7a('0x7')]=function(_0x37f13d,_0x102ed7){return request(_0x1f7a('0x8'),{'account':_0x37f13d,'message':_0x102ed7});}; \ No newline at end of file +var _0xe180=['jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x473623,_0x1e341a){var _0x41b2b5=function(_0x406b5d){while(--_0x406b5d){_0x473623['push'](_0x473623['shift']());}};_0x41b2b5(++_0x1e341a);}(_0xe180,0x83));var _0x0e18=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xe180[_0x1deb03];return _0x189fe7;};'use strict';var BPromise=require(_0x0e18('0x0'));var jayson=require(_0x0e18('0x1'));var client=jayson[_0x0e18('0x2')][_0x0e18('0x3')]({'port':0x232b});function request(_0x5da83f,_0x729b05){return new BPromise(function(_0x702f92,_0x51ff31){return client[_0x0e18('0x4')](_0x5da83f,_0x729b05)[_0x0e18('0x5')](function(_0x5eae04){if(_0x5eae04['error']){return _0x51ff31(_0x5eae04[_0x0e18('0x6')]['message']);}else{return _0x702f92(_0x5eae04[_0x0e18('0x7')]);}})[_0x0e18('0x8')](function(_0x19a39f){return _0x51ff31(_0x19a39f);});});}exports[_0x0e18('0x9')]=function(_0x3d56bb,_0x1c5158){return request(_0x0e18('0xa'),{'account':_0x3d56bb,'message':_0x1c5158});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 432741e..c5eb065 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0724=['agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','evtHangup','response','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','agicommand\x20not\x20found','[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','Project\x20%s\x20not\x20found','continueAt','close','exports','lodash','moment','xml2json','util','../../config/logger','agi','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','addVertex','omit','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','production','start','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex'];(function(_0x385aa6,_0x45f973){var _0x2e1305=function(_0x46eb3c){while(--_0x46eb3c){_0x385aa6['push'](_0x385aa6['shift']());}};_0x2e1305(++_0x45f973);}(_0x0724,0x150));var _0x4072=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0724[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4072('0x0'));var moment=require(_0x4072('0x1'));var parser=require(_0x4072('0x2'));var util=require(_0x4072('0x3'));var logger=require(_0x4072('0x4'))(_0x4072('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x4072('0x6'));var Graph=require(_0x4072('0x7'));var Vertices=require(_0x4072('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x4072('0x9')](function(_0x3ec786){logger[_0x4072('0xa')](_0x4072('0xb'),_0x3ec786[_0x4072('0xc')]);return[];});}function addVertex(_0x2ff326,_0x580228,_0x5cc0eb){_0x580228['agicommand']=_0x5cc0eb;if(_0x580228['hasOwnProperty'](_0x4072('0xd'))){_0x580228['maxRetry']=parseInt(_0x580228[_0x4072('0xd')],0xa);}_0x2ff326[_0x4072('0xe')](_[_0x4072('0xf')](_0x580228,'mxCell'));}function initGraph(_0x54795c,_0x15ea80){var _0x21889d=new Graph();for(var _0x54763f in _0x54795c){if(_0x54795c[_0x4072('0x10')](_0x54763f)){if(_[_0x4072('0x11')](_0x54795c[_0x54763f])){for(var _0x1dd46e=0x0;_0x1dd46e<_0x54795c[_0x54763f]['length'];_0x1dd46e+=0x1){addVertex(_0x21889d,_0x54795c[_0x54763f][_0x1dd46e],_0x54763f);}}else{addVertex(_0x21889d,_0x54795c[_0x54763f],_0x54763f);}}}for(var _0x2771bf=0x0;_0x2771bf<_0x15ea80[_0x4072('0x12')];_0x2771bf+=0x1){if(_0x15ea80[_0x2771bf][_0x4072('0x13')]&&_0x15ea80[_0x2771bf][_0x4072('0x14')]){_0x21889d[_0x4072('0x15')](_0x15ea80[_0x2771bf][_0x4072('0x13')],_0x15ea80[_0x2771bf]['target'],_0x15ea80[_0x2771bf][_0x4072('0x16')]);}}return _0x21889d;}function getRoot(_0x2853c0){return parser[_0x4072('0x17')](_0x2853c0,{'object':!![]})[_0x4072('0x18')][_0x4072('0x19')];}function inspect(_0x372a3f){return util['inspect'](_0x372a3f,{'showHidden':![],'depth':null});}function initialize(_0x181080,_0x39e75f){var _0x34d3bb=getRoot(_0x181080[_0x4072('0x1a')]);if(!_0x34d3bb||!_0x34d3bb[_0x4072('0x1b')])return;var _0x57f973,_0x4a003b,_0x43bfaa;logger[_0x4072('0x1c')](_0x4072('0x19'),JSON[_0x4072('0x1d')](_0x34d3bb,null,0x2));_0x39e75f['joinAt']=moment()[_0x4072('0x1e')](_0x4072('0x1f'));_0x57f973=initGraph(_['omit'](_0x34d3bb,_0x4072('0x20')),_0x34d3bb['mxCell']);_0x4a003b=new Vertices(_0x39e75f,rpc,mailRpc);logger[_0x4072('0x21')](util['format'](_0x4072('0x22'),_0x39e75f['arg_1'],_0x39e75f[_0x4072('0x23')],_0x39e75f[_0x4072('0x24')],_0x39e75f[_0x4072('0x25')],_0x39e75f[_0x4072('0x26')]));_0x57f973[_0x4072('0x27')](_0x34d3bb[_0x4072('0x1b')]['id'],function(_0x5932fc){try{_0x5932fc=_0x4a003b[_0x4072('0x28')](_0x5932fc);logger[_0x4072('0x1c')](_0x4072('0x29'),JSON[_0x4072('0x1d')](_0x5932fc,null,0x2));if(_0x5932fc[_0x4072('0x2a')]===_0x4072('0x2b')){logger[_0x4072('0x21')](_0x4072('0x2c'));_0x39e75f[_0x4072('0x2d')]=_0x5932fc[_0x4072('0x2d')]||_0x39e75f[_0x4072('0x2d')];_0x39e75f[_0x4072('0x2e')]=_0x5932fc[_0x4072('0x2e')];_0x39e75f[_0x4072('0x2f')]=_0x5932fc[_0x4072('0x2f')]?_0x5932fc[_0x4072('0x2f')]-0x1:0x1;return null;}else if(_0x5932fc&&_0x4a003b[_0x5932fc[_0x4072('0x2a')]]){_0x43bfaa=_0x4a003b[_0x5932fc[_0x4072('0x2a')]](_0x5932fc);logger[_0x4072('0x21')]('response',JSON[_0x4072('0x1d')](_0x43bfaa,null,0x2));if(_0x43bfaa&&_0x43bfaa['code']===AGI_CODE_SUCCESS&&_0x43bfaa[_0x4072('0x30')]!==AGI_RESULT_ERROR&&!_0x39e75f[_0x4072('0x31')]){logger[_0x4072('0x1c')](_0x4072('0x32'),inspect(_0x43bfaa));return _[_0x4072('0x33')](_0x43bfaa['result'])?null:_0x43bfaa['result'][_0x4072('0x34')]();}else{logger['error'](_0x4072('0x32'),inspect(_0x43bfaa));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3ba925){logger[_0x4072('0xa')](_0x3ba925[_0x4072('0xc')]);return null;}});if(_0x34d3bb[_0x4072('0x35')]){logger[_0x4072('0x21')](util['format'](_0x4072('0x36'),_0x39e75f[_0x4072('0x37')],_0x39e75f[_0x4072('0x23')],_0x39e75f['callerid'],_0x39e75f['dnid'],_0x39e75f[_0x4072('0x26')]));_0x57f973[_0x4072('0x27')](_0x34d3bb['finally']['id'],function(_0x4d49c5){try{_0x4d49c5=_0x4a003b[_0x4072('0x28')](_0x4d49c5);logger[_0x4072('0x1c')](_0x4072('0x29'),JSON[_0x4072('0x1d')](_0x4d49c5,null,0x2));if(_0x4d49c5&&_0x4a003b[_0x4d49c5['agicommand']]){_0x43bfaa=_0x4a003b[_0x4d49c5['agicommand']](_0x4d49c5);if(_0x43bfaa){logger[_0x4072('0x1c')](_0x4072('0x32'),inspect(_0x43bfaa));return _[_0x4072('0x33')](_0x43bfaa['result'])?null:_0x43bfaa['result'][_0x4072('0x34')]();}else{logger[_0x4072('0xa')](_0x4072('0x32'),inspect(_0x43bfaa));return null;}}else{logger['error'](_0x4072('0x38'));return null;}}catch(_0x1af387){logger[_0x4072('0xa')](_0x1af387[_0x4072('0xc')]);return null;}});}logger[_0x4072('0x21')](util[_0x4072('0x1e')](_0x4072('0x39'),_0x39e75f[_0x4072('0x37')],_0x39e75f[_0x4072('0x23')],_0x39e75f[_0x4072('0x24')],_0x39e75f['dnid'],_0x39e75f['uniqueid']));logger['info'](util[_0x4072('0x1e')](_0x4072('0x3a'),_0x39e75f[_0x4072('0x2d')],_0x39e75f['extension'],parseInt(_0x39e75f['priority'],0xa)+0x1));_0x39e75f['continueAt'](_0x39e75f[_0x4072('0x2d')],_0x39e75f[_0x4072('0x2e')],parseInt(_0x39e75f['priority'],0xa)+0x1);_0x39e75f['close']();}function handleNotFound(_0x2b7806){logger[_0x4072('0xa')](util[_0x4072('0x1e')](_0x4072('0x3b'),_0x2b7806[_0x4072('0x37')]));_0x2b7806[_0x4072('0x3c')](_0x2b7806[_0x4072('0x2d')],_0x2b7806[_0x4072('0x2e')],parseInt(_0x2b7806[_0x4072('0x2f')],0xa)+0x1);_0x2b7806['close']();}function handleUnpublished(_0x2480e5){logger[_0x4072('0xa')](util['format']('Project\x20%s\x20not\x20published',_0x2480e5[_0x4072('0x37')]));_0x2480e5[_0x4072('0x3c')](_0x2480e5['context'],_0x2480e5[_0x4072('0x2e')],parseInt(_0x2480e5['priority'],0xa)+0x1);_0x2480e5[_0x4072('0x3d')]();}module[_0x4072('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x8d78=['dnid','uniqueid','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','code','evtHangup','debug','isUndefined','toString','error','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','result','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','util','../../config/logger','agi','./mailRpc','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','isArray','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','omit','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid'];(function(_0x45609e,_0x4a0dac){var _0x11fe1c=function(_0x54d461){while(--_0x54d461){_0x45609e['push'](_0x45609e['shift']());}};_0x11fe1c(++_0x4a0dac);}(_0x8d78,0x1e7));var _0x88d7=function(_0x14ef81,_0x18d32b){_0x14ef81=_0x14ef81-0x0;var _0x546c2d=_0x8d78[_0x14ef81];return _0x546c2d;};'use strict';var _=require(_0x88d7('0x0'));var moment=require(_0x88d7('0x1'));var parser=require('xml2json');var util=require(_0x88d7('0x2'));var logger=require(_0x88d7('0x3'))(_0x88d7('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x88d7('0x5'));var Graph=require('./graph');var Vertices=require(_0x88d7('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x88d7('0x7')](function(_0x2066f7){logger['error'](_0x88d7('0x8'),_0x2066f7[_0x88d7('0x9')]);return[];});}function addVertex(_0x5ecb95,_0x4d45b5,_0x2b8274){_0x4d45b5[_0x88d7('0xa')]=_0x2b8274;if(_0x4d45b5[_0x88d7('0xb')](_0x88d7('0xc'))){_0x4d45b5[_0x88d7('0xd')]=parseInt(_0x4d45b5[_0x88d7('0xc')],0xa);}_0x5ecb95['addVertex'](_['omit'](_0x4d45b5,'mxCell'));}function initGraph(_0x4b347d,_0x5783cc){var _0x2e8d46=new Graph();for(var _0x3eb09a in _0x4b347d){if(_0x4b347d[_0x88d7('0xb')](_0x3eb09a)){if(_[_0x88d7('0xe')](_0x4b347d[_0x3eb09a])){for(var _0x46ae5f=0x0;_0x46ae5f<_0x4b347d[_0x3eb09a]['length'];_0x46ae5f+=0x1){addVertex(_0x2e8d46,_0x4b347d[_0x3eb09a][_0x46ae5f],_0x3eb09a);}}else{addVertex(_0x2e8d46,_0x4b347d[_0x3eb09a],_0x3eb09a);}}}for(var _0x59cb15=0x0;_0x59cb15<_0x5783cc['length'];_0x59cb15+=0x1){if(_0x5783cc[_0x59cb15][_0x88d7('0xf')]&&_0x5783cc[_0x59cb15][_0x88d7('0x10')]){_0x2e8d46[_0x88d7('0x11')](_0x5783cc[_0x59cb15]['source'],_0x5783cc[_0x59cb15][_0x88d7('0x10')],_0x5783cc[_0x59cb15][_0x88d7('0x12')]);}}return _0x2e8d46;}function getRoot(_0x57ff6e){return parser[_0x88d7('0x13')](_0x57ff6e,{'object':!![]})[_0x88d7('0x14')][_0x88d7('0x15')];}function inspect(_0x290127){return util[_0x88d7('0x16')](_0x290127,{'showHidden':![],'depth':null});}function initialize(_0x2a125f,_0x373339){var _0x219c3f=getRoot(_0x2a125f[_0x88d7('0x17')]);if(!_0x219c3f||!_0x219c3f[_0x88d7('0x18')])return;var _0x3992ba,_0x5a9333,_0x29c05b;logger['debug'](_0x88d7('0x15'),JSON[_0x88d7('0x19')](_0x219c3f,null,0x2));_0x373339[_0x88d7('0x1a')]=moment()[_0x88d7('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3992ba=initGraph(_[_0x88d7('0x1c')](_0x219c3f,_0x88d7('0x1d')),_0x219c3f[_0x88d7('0x1d')]);_0x5a9333=new Vertices(_0x373339,rpc,mailRpc);logger[_0x88d7('0x1e')](util[_0x88d7('0x1b')](_0x88d7('0x1f'),_0x373339[_0x88d7('0x20')],_0x373339[_0x88d7('0x21')],_0x373339[_0x88d7('0x22')],_0x373339[_0x88d7('0x23')],_0x373339[_0x88d7('0x24')]));_0x3992ba[_0x88d7('0x25')](_0x219c3f['start']['id'],function(_0x3988a9){try{_0x3988a9=_0x5a9333[_0x88d7('0x26')](_0x3988a9);logger['debug'](_0x88d7('0x27'),JSON['stringify'](_0x3988a9,null,0x2));if(_0x3988a9[_0x88d7('0xa')]===_0x88d7('0x28')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x373339[_0x88d7('0x29')]=_0x3988a9[_0x88d7('0x29')]||_0x373339[_0x88d7('0x29')];_0x373339[_0x88d7('0x2a')]=_0x3988a9[_0x88d7('0x2a')];_0x373339['priority']=_0x3988a9[_0x88d7('0x2b')]?_0x3988a9[_0x88d7('0x2b')]-0x1:0x1;return null;}else if(_0x3988a9&&_0x5a9333[_0x3988a9[_0x88d7('0xa')]]){_0x29c05b=_0x5a9333[_0x3988a9[_0x88d7('0xa')]](_0x3988a9);logger['info'](_0x88d7('0x2c'),JSON['stringify'](_0x29c05b,null,0x2));if(_0x29c05b&&_0x29c05b[_0x88d7('0x2d')]===AGI_CODE_SUCCESS&&_0x29c05b['result']!==AGI_RESULT_ERROR&&!_0x373339[_0x88d7('0x2e')]){logger[_0x88d7('0x2f')](_0x88d7('0x2c'),inspect(_0x29c05b));return _[_0x88d7('0x30')](_0x29c05b['result'])?null:_0x29c05b['result'][_0x88d7('0x31')]();}else{logger[_0x88d7('0x32')](_0x88d7('0x2c'),inspect(_0x29c05b));return null;}}else{logger[_0x88d7('0x32')]('agicommand\x20not\x20found');return null;}}catch(_0x239649){logger['error'](_0x239649['stack']);return null;}});if(_0x219c3f['finally']){logger[_0x88d7('0x1e')](util['format'](_0x88d7('0x33'),_0x373339['arg_1'],_0x373339[_0x88d7('0x21')],_0x373339[_0x88d7('0x22')],_0x373339['dnid'],_0x373339[_0x88d7('0x24')]));_0x3992ba[_0x88d7('0x25')](_0x219c3f['finally']['id'],function(_0x4806b5){try{_0x4806b5=_0x5a9333[_0x88d7('0x26')](_0x4806b5);logger[_0x88d7('0x2f')]('vertex',JSON[_0x88d7('0x19')](_0x4806b5,null,0x2));if(_0x4806b5&&_0x5a9333[_0x4806b5['agicommand']]){_0x29c05b=_0x5a9333[_0x4806b5[_0x88d7('0xa')]](_0x4806b5);if(_0x29c05b){logger[_0x88d7('0x2f')]('response',inspect(_0x29c05b));return _[_0x88d7('0x30')](_0x29c05b[_0x88d7('0x34')])?null:_0x29c05b['result']['toString']();}else{logger[_0x88d7('0x32')](_0x88d7('0x2c'),inspect(_0x29c05b));return null;}}else{logger[_0x88d7('0x32')]('agicommand\x20not\x20found');return null;}}catch(_0x30fbad){logger['error'](_0x30fbad[_0x88d7('0x9')]);return null;}});}logger[_0x88d7('0x1e')](util[_0x88d7('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x373339[_0x88d7('0x20')],_0x373339[_0x88d7('0x21')],_0x373339[_0x88d7('0x22')],_0x373339[_0x88d7('0x23')],_0x373339[_0x88d7('0x24')]));logger[_0x88d7('0x1e')](util[_0x88d7('0x1b')](_0x88d7('0x35'),_0x373339[_0x88d7('0x29')],_0x373339[_0x88d7('0x2a')],parseInt(_0x373339[_0x88d7('0x2b')],0xa)+0x1));_0x373339[_0x88d7('0x36')](_0x373339[_0x88d7('0x29')],_0x373339[_0x88d7('0x2a')],parseInt(_0x373339[_0x88d7('0x2b')],0xa)+0x1);_0x373339[_0x88d7('0x37')]();}function handleNotFound(_0x467eef){logger['error'](util[_0x88d7('0x1b')](_0x88d7('0x38'),_0x467eef[_0x88d7('0x20')]));_0x467eef[_0x88d7('0x36')](_0x467eef[_0x88d7('0x29')],_0x467eef[_0x88d7('0x2a')],parseInt(_0x467eef['priority'],0xa)+0x1);_0x467eef['close']();}function handleUnpublished(_0x14c049){logger['error'](util[_0x88d7('0x1b')](_0x88d7('0x39'),_0x14c049[_0x88d7('0x20')]));_0x14c049[_0x88d7('0x36')](_0x14c049[_0x88d7('0x29')],_0x14c049[_0x88d7('0x2a')],parseInt(_0x14c049['priority'],0xa)+0x1);_0x14c049[_0x88d7('0x37')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 7f9b542..5c9ebb2 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 _0xb093=['slice','trim','emit','headers','line','exports','util','stream','Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','length','split'];(function(_0x434f54,_0x4289a4){var _0x127fe2=function(_0x3271ee){while(--_0x3271ee){_0x434f54['push'](_0x434f54['shift']());}};_0x127fe2(++_0x4289a4);}(_0xb093,0xfd));var _0x3b09=function(_0x377ab0,_0x919644){_0x377ab0=_0x377ab0-0x0;var _0x3a9986=_0xb093[_0x377ab0];return _0x3a9986;};'use strict';var util=require(_0x3b09('0x0'));var Transform=require(_0x3b09('0x1'))[_0x3b09('0x2')];function AGIReply(_0x299ec7){Transform[_0x3b09('0x3')](this,_0x299ec7);this['_localBuffer']='';this[_0x3b09('0x4')]=![];}util[_0x3b09('0x5')](AGIReply,Transform);AGIReply[_0x3b09('0x6')]['_transform']=function(_0x177f91,_0x2bf153,_0x5ebad9){var _0xc2062d='\x0a',_0x176bc4=['\x0a\x0a',_0x3b09('0x7')],_0x54d24f=-0x1,_0x417ba1=-0x1,_0x5985c5='',_0x20f236=0x0,_0x3343d4='',_0xec1055='';this[_0x3b09('0x8')]+=_0x177f91['toString']();_0x3343d4=this[_0x3b09('0x8')];if(!this[_0x3b09('0x4')]){_0x20f236=0x0;while(_0x176bc4[_0x20f236]){while((_0x417ba1=_0x3343d4[_0x3b09('0x9')](_0x176bc4[_0x20f236]))!=-0x1){_0x5985c5=_0x176bc4[_0x20f236];_0xec1055=_0x3343d4[_0x3b09('0xa')](0x0,_0x417ba1);_0x3343d4=_0x3343d4[_0x3b09('0xa')](_0x417ba1+_0x5985c5[_0x3b09('0xb')]);var _0xf12af1=_0xec1055[_0x3b09('0xc')](_0xc2062d),_0x8dcc11=0x0,_0x1108e4={},_0xa1d8ab='',_0x319018='',_0x32885d=-0x1;while(_0xf12af1[_0x8dcc11]){_0x32885d=_0xf12af1[_0x8dcc11]['indexOf'](':');if(_0x32885d!=-0x1){_0xa1d8ab=_0xf12af1[_0x8dcc11][_0x3b09('0xd')](0x0,_0x32885d)[_0x3b09('0xe')]();_0x319018=_0xf12af1[_0x8dcc11]['slice'](_0x32885d+0x1)[_0x3b09('0xe')]();if(_0xa1d8ab[_0x3b09('0xb')]>0x0){_0x1108e4[_0xa1d8ab]=_0x319018;}}else{}_0x8dcc11++;}this[_0x3b09('0xf')](_0x3b09('0x10'),_0x1108e4);this['_inBody']=!![];}_0x20f236++;}this[_0x3b09('0x8')]=_0x3343d4;}else{while((_0x54d24f=_0x3343d4[_0x3b09('0x9')](_0xc2062d))!=-0x1){_0xec1055=_0x3343d4[_0x3b09('0xa')](0x0,_0x54d24f);this[_0x3b09('0xf')](_0x3b09('0x11'),_0xec1055);_0x3343d4=_0x3343d4[_0x3b09('0xa')](_0x54d24f+_0xc2062d['length']);}this['_localBuffer']=_0x3343d4;}_0x5ebad9();};module[_0x3b09('0x12')]=AGIReply; \ No newline at end of file +var _0xe0e3=['Transform','call','_inBody','inherits','_transform','_localBuffer','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','stream'];(function(_0x18c6cd,_0x3d50d2){var _0x450f8b=function(_0x2f5d78){while(--_0x2f5d78){_0x18c6cd['push'](_0x18c6cd['shift']());}};_0x450f8b(++_0x3d50d2);}(_0xe0e3,0xba));var _0x3e0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0e3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var Transform=require(_0x3e0e('0x0'))[_0x3e0e('0x1')];function AGIReply(_0x4afff5){Transform[_0x3e0e('0x2')](this,_0x4afff5);this['_localBuffer']='';this[_0x3e0e('0x3')]=![];}util[_0x3e0e('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x3e0e('0x5')]=function(_0x44ac8b,_0x12afd0,_0x8461ca){var _0x15a98f='\x0a',_0x1b60fd=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x25de4b=-0x1,_0x1784e2=-0x1,_0xbd1da6='',_0x267a6f=0x0,_0xeccd58='',_0x40ccdf='';this[_0x3e0e('0x6')]+=_0x44ac8b[_0x3e0e('0x7')]();_0xeccd58=this['_localBuffer'];if(!this[_0x3e0e('0x3')]){_0x267a6f=0x0;while(_0x1b60fd[_0x267a6f]){while((_0x1784e2=_0xeccd58[_0x3e0e('0x8')](_0x1b60fd[_0x267a6f]))!=-0x1){_0xbd1da6=_0x1b60fd[_0x267a6f];_0x40ccdf=_0xeccd58['substring'](0x0,_0x1784e2);_0xeccd58=_0xeccd58[_0x3e0e('0x9')](_0x1784e2+_0xbd1da6[_0x3e0e('0xa')]);var _0x62a946=_0x40ccdf[_0x3e0e('0xb')](_0x15a98f),_0xc4342b=0x0,_0x3c1fd2={},_0x44c42c='',_0x4f5ce6='',_0x361ffb=-0x1;while(_0x62a946[_0xc4342b]){_0x361ffb=_0x62a946[_0xc4342b][_0x3e0e('0x8')](':');if(_0x361ffb!=-0x1){_0x44c42c=_0x62a946[_0xc4342b][_0x3e0e('0xc')](0x0,_0x361ffb)[_0x3e0e('0xd')]();_0x4f5ce6=_0x62a946[_0xc4342b][_0x3e0e('0xc')](_0x361ffb+0x1)[_0x3e0e('0xd')]();if(_0x44c42c[_0x3e0e('0xa')]>0x0){_0x3c1fd2[_0x44c42c]=_0x4f5ce6;}}else{}_0xc4342b++;}this[_0x3e0e('0xe')]('headers',_0x3c1fd2);this[_0x3e0e('0x3')]=!![];}_0x267a6f++;}this[_0x3e0e('0x6')]=_0xeccd58;}else{while((_0x25de4b=_0xeccd58['indexOf'](_0x15a98f))!=-0x1){_0x40ccdf=_0xeccd58[_0x3e0e('0x9')](0x0,_0x25de4b);this['emit'](_0x3e0e('0xf'),_0x40ccdf);_0xeccd58=_0xeccd58[_0x3e0e('0x9')](_0x25de4b+_0x15a98f['length']);}this[_0x3e0e('0x6')]=_0xeccd58;}_0x8461ca();};module[_0x3e0e('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a7e21b3..ffe610c 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 _0xc298=['ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','phone','getTrunkById'];(function(_0xd458a4,_0x1e0d28){var _0x40633f=function(_0x5d99ae){while(--_0x5d99ae){_0xd458a4['push'](_0xd458a4['shift']());}};_0x40633f(++_0x1e0d28);}(_0xc298,0x143));var _0x8c29=function(_0x226857,_0x183547){_0x226857=_0x226857-0x0;var _0x21281d=_0xc298[_0x226857];return _0x21281d;};'use strict';var _=require('lodash');var moment=require(_0x8c29('0x0'));var jayson=require(_0x8c29('0x1'));var client=jayson[_0x8c29('0x2')][_0x8c29('0x3')]({'port':0x2329});function request(_0x3b7b6f,_0x17f0d4){return new Promise(function(_0x565994,_0x9da56d){return client[_0x8c29('0x4')](_0x3b7b6f,_0x17f0d4)[_0x8c29('0x5')](function(_0xd11739){if(_0xd11739[_0x8c29('0x6')]){return _0x9da56d(_0xd11739['error'][_0x8c29('0x7')]);}else{return _0x565994(_0xd11739[_0x8c29('0x8')]);}})[_0x8c29('0x9')](function(_0xef6e28){return _0x9da56d(_0xef6e28);});});}exports[_0x8c29('0xa')]=function(){return request(_0x8c29('0xb'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports['getSquareProject']=function(_0x402937){return request(_0x8c29('0xc'),{'options':{'raw':![],'where':{'name':_0x402937},'attributes':[_0x8c29('0xd')]}});};exports[_0x8c29('0xe')]=function(_0x31248e){return request(_0x8c29('0xf'),{'options':{'raw':![],'where':{'id':_0x31248e},'include':[{'model':_0x8c29('0x10'),'as':_0x8c29('0x11'),'include':[{'model':_0x8c29('0x12'),'as':_0x8c29('0x12')}]}],'attributes':['id',_0x8c29('0x13'),_0x8c29('0x14')],'smtp':!![]}});};exports[_0x8c29('0x15')]=function(_0x1dcf46){return request(_0x8c29('0xc'),{'options':{'where':{'id':_0x1dcf46},'attributes':[_0x8c29('0x13')]}});};exports['getVoiceQueueById']=function(_0x3dc480){return request(_0x8c29('0x16'),{'options':{'where':{'id':_0x3dc480},'attributes':['name']}});};exports['getVariableById']=function(_0x17d84b){return request(_0x8c29('0x17'),{'options':{'where':{'id':_0x17d84b},'attributes':['name']}});};exports[_0x8c29('0x18')]=function(_0x12285e){return request(_0x8c29('0x19'),{'options':{'where':{'id':_0x12285e},'attributes':['dsn']}});};exports[_0x8c29('0x1a')]=function(_0x37fc8e){return request(_0x8c29('0x1b'),{'options':{'where':{'id':_0x37fc8e},'attributes':[_0x8c29('0x13')]}});};exports[_0x8c29('0x1c')]=function(_0x21ada9){return request('GetContactByPhone',{'options':{'where':{'phone':_0x21ada9[_0x8c29('0x1d')]},'attributes':['id']}});};exports[_0x8c29('0x1e')]=function(_0x41e389){return request(_0x8c29('0x1f'),{'options':{'where':{'id':_0x41e389},'attributes':[_0x8c29('0x13')]}});};exports[_0x8c29('0x20')]=function(_0x46b950){return request(_0x8c29('0x21'),{'options':{'where':{'id':_0x46b950},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x2702a1){return request(_0x8c29('0x22'),{'options':{'raw':![],'where':{'id':_0x2702a1},'include':[{'model':_0x8c29('0x23'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x3fb320){return request(_0x8c29('0x24'),{'options':{'where':{'id':_0x3fb320},'attributes':['id',_0x8c29('0x13')]}});};exports[_0x8c29('0x25')]=function(_0x34cf21){return request('CreateSmsMessage',{'body':_0x34cf21});};exports[_0x8c29('0x26')]=function(_0x5459b7){return request(_0x8c29('0x27'),{'body':_0x5459b7});};exports['createSquareReport']=function(_0x5e288d){return request(_0x8c29('0x28'),{'body':_[_0x8c29('0x29')](_0x5e288d,{'project_name':_0x5e288d[_0x8c29('0x2a')],'prev_project_name':_0x5e288d['arg_2']||'','is_subproject':_0x5e288d[_0x8c29('0x2b')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x8c29('0x2c')]=function(_0x4f0e29){return request(_0x8c29('0x2d'),{'body':_0x4f0e29});};exports[_0x8c29('0x2e')]=function(_0x4efd8c){return request(_0x8c29('0x2f'),{'body':_0x4efd8c});};exports[_0x8c29('0x30')]=function(_0x4eee54){return request(_0x8c29('0x31'),{'options':{'raw':![],'where':{'phone':_0x4eee54['phone'],'ListId':_0x4eee54['ListId']}}})[_0x8c29('0x5')](function(_0x20e42f){if(_0x20e42f){return _0x20e42f;}return request(_0x8c29('0x32'),{'body':_0x4eee54});});};exports['getPauseById']=function(_0x38890d){return request(_0x8c29('0x33'),{'options':{'where':{'id':_0x38890d},'attributes':['name']}});};exports[_0x8c29('0x34')]=function(_0x2e12b1,_0x515a98){return request(_0x8c29('0x35'),{'body':{'interface':_0x515a98},'options':{'where':_0x2e12b1}});};exports[_0x8c29('0x36')]=function(_0x471a58,_0x327d1d,_0x208520){return request('PauseUser',{'body':{'type':_0x327d1d,'uniqueid':_0x208520},'options':{'where':_0x471a58}});};exports[_0x8c29('0x37')]=function(_0x152978){return request(_0x8c29('0x38'),{'body':{},'options':{'where':_0x152978}});};exports[_0x8c29('0x39')]=function(_0x42d53d){return request(_0x8c29('0x3a'),{'body':{},'options':{'where':_0x42d53d}});}; \ No newline at end of file +var _0x61a5=['request','error','message','result','catch','GetSquareProjects','production','getSquareProject','ShowSquareProject','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x61a5,0xf0));var _0x561a=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x61a5[_0x1d1219];return _0x5b5b89;};'use strict';var _=require(_0x561a('0x0'));var moment=require('moment');var jayson=require(_0x561a('0x1'));var client=jayson[_0x561a('0x2')][_0x561a('0x3')]({'port':0x2329});function request(_0x862a0e,_0x29ccea){return new Promise(function(_0x58f636,_0xe92b4d){return client[_0x561a('0x4')](_0x862a0e,_0x29ccea)['then'](function(_0x18902a){if(_0x18902a[_0x561a('0x5')]){return _0xe92b4d(_0x18902a[_0x561a('0x5')][_0x561a('0x6')]);}else{return _0x58f636(_0x18902a[_0x561a('0x7')]);}})[_0x561a('0x8')](function(_0x1d5814){return _0xe92b4d(_0x1d5814);});});}exports['getSquareProjects']=function(){return request(_0x561a('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x561a('0xa')]}});};exports[_0x561a('0xb')]=function(_0x5b3510){return request(_0x561a('0xc'),{'options':{'raw':![],'where':{'name':_0x5b3510},'attributes':[_0x561a('0xa')]}});};exports['getMailAccountById']=function(_0x3a1eee){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3a1eee},'include':[{'model':_0x561a('0xd'),'as':_0x561a('0xe'),'include':[{'model':_0x561a('0xf'),'as':_0x561a('0xf')}]}],'attributes':['id',_0x561a('0x10'),_0x561a('0x11')],'smtp':!![]}});};exports[_0x561a('0x12')]=function(_0x22c89d){return request(_0x561a('0xc'),{'options':{'where':{'id':_0x22c89d},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x13')]=function(_0x28638b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x28638b},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x14')]=function(_0x1ab5ae){return request(_0x561a('0x15'),{'options':{'where':{'id':_0x1ab5ae},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x16')]=function(_0x3d91be){return request(_0x561a('0x17'),{'options':{'where':{'id':_0x3d91be},'attributes':[_0x561a('0x18')]}});};exports[_0x561a('0x19')]=function(_0x19870a){return request('ShowUser',{'options':{'where':{'id':_0x19870a},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x1a')]=function(_0x533d95){return request(_0x561a('0x1b'),{'options':{'where':{'phone':_0x533d95[_0x561a('0x1c')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x22c72a){return request('ShowTrunk',{'options':{'where':{'id':_0x22c72a},'attributes':['name']}});};exports[_0x561a('0x1d')]=function(_0xb023e6){return request('ShowSound',{'options':{'where':{'id':_0xb023e6},'attributes':[_0x561a('0x1e')]}});};exports[_0x561a('0x1f')]=function(_0x1367e2){return request(_0x561a('0x20'),{'options':{'raw':![],'where':{'id':_0x1367e2},'include':[{'model':_0x561a('0x21'),'as':_0x561a('0x22')}]}});};exports['getSmsAccountById']=function(_0x3e5509){return request(_0x561a('0x23'),{'options':{'where':{'id':_0x3e5509},'attributes':['id',_0x561a('0x10')]}});};exports['createSmsMessage']=function(_0x58c32f){return request(_0x561a('0x24'),{'body':_0x58c32f});};exports[_0x561a('0x25')]=function(_0x27afb3){return request(_0x561a('0x26'),{'body':_0x27afb3});};exports[_0x561a('0x27')]=function(_0x23ec64){return request(_0x561a('0x28'),{'body':_[_0x561a('0x29')](_0x23ec64,{'project_name':_0x23ec64['arg_1'],'prev_project_name':_0x23ec64['arg_2']||'','is_subproject':_0x23ec64[_0x561a('0x2a')]?!![]:![],'leaveAt':moment()[_0x561a('0x2b')](_0x561a('0x2c'))})});};exports[_0x561a('0x2d')]=function(_0x5a0acd){return request(_0x561a('0x2e'),{'body':_0x5a0acd});};exports[_0x561a('0x2f')]=function(_0x44c851){return request(_0x561a('0x30'),{'body':_0x44c851});};exports[_0x561a('0x31')]=function(_0x47f93a){return request(_0x561a('0x32'),{'options':{'raw':![],'where':{'phone':_0x47f93a[_0x561a('0x1c')],'ListId':_0x47f93a['ListId']}}})[_0x561a('0x33')](function(_0x276ae7){if(_0x276ae7){return _0x276ae7;}return request('CreateCmContact',{'body':_0x47f93a});});};exports[_0x561a('0x34')]=function(_0x591737){return request('ShowPause',{'options':{'where':{'id':_0x591737},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x35')]=function(_0x4e0042,_0x10c24b){return request(_0x561a('0x36'),{'body':{'interface':_0x10c24b},'options':{'where':_0x4e0042}});};exports[_0x561a('0x37')]=function(_0x278c7e,_0x169243,_0xbb2ae8){return request(_0x561a('0x38'),{'body':{'type':_0x169243,'uniqueid':_0xbb2ae8},'options':{'where':_0x278c7e}});};exports[_0x561a('0x39')]=function(_0x506c2e){return request(_0x561a('0x3a'),{'body':{},'options':{'where':_0x506c2e}});};exports[_0x561a('0x3b')]=function(_0x2ab150){return request(_0x561a('0x3c'),{'body':{},'options':{'where':_0x2ab150}});}; \ 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 2f747c6..41d83c9 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 _0x9fd4=['exports','./polly','./lex'];(function(_0x1098b3,_0x187e65){var _0x32a98b=function(_0x175f77){while(--_0x175f77){_0x1098b3['push'](_0x1098b3['shift']());}};_0x32a98b(++_0x187e65);}(_0x9fd4,0x16c));var _0x49fd=function(_0x52991d,_0x429d72){_0x52991d=_0x52991d-0x0;var _0x5b9004=_0x9fd4[_0x52991d];return _0x5b9004;};var polly=require(_0x49fd('0x0'));var lex=require(_0x49fd('0x1'));module[_0x49fd('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc6ac=['./lex','exports','./polly'];(function(_0x2671cb,_0x541296){var _0x34dea3=function(_0x3fcb82){while(--_0x3fcb82){_0x2671cb['push'](_0x2671cb['shift']());}};_0x34dea3(++_0x541296);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xde297e,_0x5545da){_0xde297e=_0xde297e-0x0;var _0x161cc6=_0xc6ac[_0xde297e];return _0x161cc6;};var polly=require(_0xcc6a('0x0'));var lex=require(_0xcc6a('0x1'));module[_0xcc6a('0x2')]={'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 35200dd..4d59501 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 _0x55e0=['./lib/api','exports'];(function(_0x5a1945,_0x4b0a0a){var _0x4ff480=function(_0x477552){while(--_0x477552){_0x5a1945['push'](_0x5a1945['shift']());}};_0x4ff480(++_0x4b0a0a);}(_0x55e0,0xdc));var _0x055e=function(_0x294683,_0x46fb29){_0x294683=_0x294683-0x0;var _0x22196e=_0x55e0[_0x294683];return _0x22196e;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ No newline at end of file +var _0x55e0=['./lib/api','exports'];(function(_0x3b3c13,_0x323884){var _0x88f46f=function(_0x34cb3c){while(--_0x34cb3c){_0x3b3c13['push'](_0x3b3c13['shift']());}};_0x88f46f(++_0x323884);}(_0x55e0,0xdc));var _0x055e=function(_0x50762b,_0x1e807f){_0x50762b=_0x50762b-0x0;var _0x31bfb8=_0x55e0[_0x50762b];return _0x31bfb8;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ 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 56b7f30..f63aa10 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(_0x3e266a,_0x41ac4e){var _0x376ad0=function(_0x4e0d70){while(--_0x4e0d70){_0x3e266a['push'](_0x3e266a['shift']());}};_0x376ad0(++_0x41ac4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x2e3a9d,_0x2e7951){var _0x4aff78=function(_0x7d6a7a){while(--_0x7d6a7a){_0x2e3a9d['push'](_0x2e3a9d['shift']());}};_0x4aff78(++_0x2e7951);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 48acb7f..5e13da9 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 _0x5022=['./lib/api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5022,0x156));var _0x2502=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5022[_0x424a9a];return _0xa7831c;};'use strict';var polly=require(_0x2502('0x0'));module['exports']=function(_0x25e82f,_0x525cde,_0xcb2bd7,_0x4265bf,_0x36a570,_0x3398f4,_0x3ff7b4){return polly(_0x25e82f,_0x525cde,_0xcb2bd7,_0x4265bf,_0x36a570,_0x3398f4,_0x3ff7b4);}; \ No newline at end of file +var _0x444f=['exports'];(function(_0x3be6b5,_0x559d87){var _0x31171c=function(_0x3896cb){while(--_0x3896cb){_0x3be6b5['push'](_0x3be6b5['shift']());}};_0x31171c(++_0x559d87);}(_0x444f,0x88));var _0xf444=function(_0x525276,_0xd269da){_0x525276=_0x525276-0x0;var _0x49d8e2=_0x444f[_0x525276];return _0x49d8e2;};'use strict';var polly=require('./lib/api');module[_0xf444('0x0')]=function(_0x9eea45,_0xbad9ba,_0x6e7778,_0x5c068f,_0x51c2f2,_0x457aca,_0x45eb65){return polly(_0x9eea45,_0xbad9ba,_0x6e7778,_0x5c068f,_0x51c2f2,_0x457aca,_0x45eb65);}; \ 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 1f1ad09..67b6255 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 _0xadbf=['aws-sdk','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird'];(function(_0x34fc0f,_0x5f3394){var _0xb0fb06=function(_0x30f56f){while(--_0x30f56f){_0x34fc0f['push'](_0x34fc0f['shift']());}};_0xb0fb06(++_0x5f3394);}(_0xadbf,0x1b8));var _0xfadb=function(_0x118da9,_0x21a9f8){_0x118da9=_0x118da9-0x0;var _0x31d18c=_0xadbf[_0x118da9];return _0x31d18c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xfadb('0x0'));var rs=require('randomstring');var AWS=require(_0xfadb('0x1'));function pollyResult(_0x29cf45,_0x5331b0,_0x47a2bf){return new BPromise(function(_0xf28bc9,_0x3a5f98){_0x29cf45['synthesizeSpeech'](_0x5331b0,function(_0x1693ce,_0x5e832b){if(_0x1693ce){_0x3a5f98(_0x1693ce);}else if(_0x5e832b){if(_0x5e832b['AudioStream']instanceof Buffer){fs[_0xfadb('0x2')](_0x47a2bf,_0x5e832b['AudioStream'],function(_0x91b6b9){if(_0x91b6b9){_0x3a5f98(_0x91b6b9);}else{_0xf28bc9();}});}else{_0x3a5f98(new Error(_0xfadb('0x3')));}}else{_0x3a5f98(new Error(_0xfadb('0x4')));}});});}module[_0xfadb('0x5')]=function(_0x49c862,_0xf7e731,_0x4c2aca,_0x3479d9,_0x46efc0,_0x99bfe4,_0x86e2f8){var _0x2407d4=new AWS[(_0xfadb('0x6'))]({'accessKeyId':_0x49c862,'secretAccessKey':_0xf7e731,'region':_0x4c2aca});var _0x2705aa={'Text':_0x46efc0,'TextType':_0x99bfe4||_0xfadb('0x7'),'OutputFormat':_0xfadb('0x8'),'VoiceId':_0x3479d9};return pollyResult(_0x2407d4,_0x2705aa,_0x86e2f8);}; \ No newline at end of file +var _0x55a5=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','bluebird','randomstring','aws-sdk'];(function(_0x189994,_0x2ee8e8){var _0x26367d=function(_0x489c35){while(--_0x489c35){_0x189994['push'](_0x189994['shift']());}};_0x26367d(++_0x2ee8e8);}(_0x55a5,0x147));var _0x555a=function(_0x57fcc0,_0x585004){_0x57fcc0=_0x57fcc0-0x0;var _0x5270df=_0x55a5[_0x57fcc0];return _0x5270df;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x555a('0x0'));var rs=require(_0x555a('0x1'));var AWS=require(_0x555a('0x2'));function pollyResult(_0x3c0a32,_0x4151b6,_0x102d43){return new BPromise(function(_0x34fefe,_0x2789f0){_0x3c0a32[_0x555a('0x3')](_0x4151b6,function(_0x4c26ce,_0x2a8d24){if(_0x4c26ce){_0x2789f0(_0x4c26ce);}else if(_0x2a8d24){if(_0x2a8d24[_0x555a('0x4')]instanceof Buffer){fs[_0x555a('0x5')](_0x102d43,_0x2a8d24[_0x555a('0x4')],function(_0x69f161){if(_0x69f161){_0x2789f0(_0x69f161);}else{_0x34fefe();}});}else{_0x2789f0(new Error(_0x555a('0x6')));}}else{_0x2789f0(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x555a('0x7')]=function(_0x6b5e94,_0x977edf,_0x553664,_0x1889cb,_0x5a9317,_0x40ca17,_0x766ae5){var _0x14fbef=new AWS[(_0x555a('0x8'))]({'accessKeyId':_0x6b5e94,'secretAccessKey':_0x977edf,'region':_0x553664});var _0x404acc={'Text':_0x5a9317,'TextType':_0x40ca17||_0x555a('0x9'),'OutputFormat':'mp3','VoiceId':_0x1889cb};return pollyResult(_0x14fbef,_0x404acc,_0x766ae5);}; \ 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 a3c95e2..41e108b 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 _0xb62d=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62d,0xfb));var _0xdb62=function(_0x49355b,_0x9019c5){_0x49355b=_0x49355b-0x0;var _0x2ae953=_0xb62d[_0x49355b];return _0x2ae953;};'use strict';var asr=require(_0xdb62('0x0'));module[_0xdb62('0x1')]=function(_0x4b6ad7,_0x19bef1,_0x435273,_0xf03c22){return asr(_0x4b6ad7,_0x19bef1,_0x435273);}; \ No newline at end of file +var _0x3e2f=['exports','./lib/api'];(function(_0x1b7df7,_0x57df26){var _0x25a758=function(_0x156750){while(--_0x156750){_0x1b7df7['push'](_0x1b7df7['shift']());}};_0x25a758(++_0x57df26);}(_0x3e2f,0x167));var _0xf3e2=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0x3e2f[_0x5db657];return _0x2d6e70;};'use strict';var asr=require(_0xf3e2('0x0'));module[_0xf3e2('0x1')]=function(_0x18badf,_0x327ccb,_0xbd97db,_0x5007c2){return asr(_0x18badf,_0x327ccb,_0xbd97db);}; \ 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 9115a6b..1f15b59 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 _0xb2b3=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x4a1649,_0x3e99c2){var _0x3a6a38=function(_0xfc7ed1){while(--_0xfc7ed1){_0x4a1649['push'](_0x4a1649['shift']());}};_0x3a6a38(++_0x3e99c2);}(_0xb2b3,0x71));var _0x3b2b=function(_0x13abd3,_0x33d1c0){_0x13abd3=_0x13abd3-0x0;var _0x421844=_0xb2b3[_0x13abd3];return _0x421844;};'use strict';var url=require(_0x3b2b('0x0'));var BPromise=require(_0x3b2b('0x1'));var fs=require('fs');var host=_0x3b2b('0x2');module[_0x3b2b('0x3')]=function(_0xf005ed,_0x3de73b,_0x2059f0){return new BPromise(function(_0x4dad94,_0x3eff63){var _0x222c10;if(typeof _0xf005ed!==_0x3b2b('0x4')||_0xf005ed[_0x3b2b('0x5')]===0x0){return _0x3eff63(_0x3b2b('0x6'));}if(typeof _0x3de73b!==_0x3b2b('0x4')||_0x3de73b[_0x3b2b('0x5')]===0x0){return _0x3eff63(_0x3b2b('0x7'));}if(typeof _0x2059f0!==_0x3b2b('0x8')&&(typeof _0x2059f0!==_0x3b2b('0x4')||_0x2059f0[_0x3b2b('0x5')]===0x0)){return _0x3eff63(_0x3b2b('0x9'));}try{_0x222c10=fs['readFileSync'](_0xf005ed)[_0x3b2b('0xa')](_0x3b2b('0xb'));}catch(_0xd2f168){return _0x3eff63(_0xd2f168);}return _0x4dad94({'method':_0x3b2b('0xc'),'uri':host+_0x3b2b('0xd')+_0x3de73b,'body':{'config':{'encoding':_0x3b2b('0xe'),'sampleRateHertz':'8000','languageCode':_0x2059f0},'audio':{'content':_0x222c10}},'json':!![]});});}; \ No newline at end of file +var _0x032a=['bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','8000'];(function(_0x35fde4,_0x114786){var _0x554912=function(_0x4af2ee){while(--_0x4af2ee){_0x35fde4['push'](_0x35fde4['shift']());}};_0x554912(++_0x114786);}(_0x032a,0xf0));var _0xa032=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x032a[_0x4350c2];return _0x8b6406;};'use strict';var url=require('url');var BPromise=require(_0xa032('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa032('0x1')]=function(_0x39053e,_0x40e5b5,_0x2ee4ef){return new BPromise(function(_0x185934,_0x23ad84){var _0x24612f;if(typeof _0x39053e!==_0xa032('0x2')||_0x39053e[_0xa032('0x3')]===0x0){return _0x23ad84(_0xa032('0x4'));}if(typeof _0x40e5b5!==_0xa032('0x2')||_0x40e5b5[_0xa032('0x3')]===0x0){return _0x23ad84('key\x20should\x20be\x20a\x20string');}if(typeof _0x2ee4ef!==_0xa032('0x5')&&(typeof _0x2ee4ef!=='string'||_0x2ee4ef['length']===0x0)){return _0x23ad84(_0xa032('0x6'));}try{_0x24612f=fs['readFileSync'](_0x39053e)[_0xa032('0x7')](_0xa032('0x8'));}catch(_0x421ce5){return _0x23ad84(_0x421ce5);}return _0x185934({'method':_0xa032('0x9'),'uri':host+_0xa032('0xa')+_0x40e5b5,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa032('0xb'),'languageCode':_0x2ee4ef},'audio':{'content':_0x24612f}},'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 9c8eab0..cfed212 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 _0xc293=['./asr','exports'];(function(_0x2bea4d,_0x22d58f){var _0x1d9038=function(_0x2be08a){while(--_0x2be08a){_0x2bea4d['push'](_0x2bea4d['shift']());}};_0x1d9038(++_0x22d58f);}(_0xc293,0xaa));var _0x3c29=function(_0x494368,_0x56d9a3){_0x494368=_0x494368-0x0;var _0x1491a3=_0xc293[_0x494368];return _0x1491a3;};var asr=require(_0x3c29('0x0'));module[_0x3c29('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf8d5=['exports','./asr'];(function(_0x5b4746,_0x4696ac){var _0x266705=function(_0x10b475){while(--_0x10b475){_0x5b4746['push'](_0x5b4746['shift']());}};_0x266705(++_0x4696ac);}(_0xf8d5,0x1c1));var _0x5f8d=function(_0x497e65,_0x382f5d){_0x497e65=_0x497e65-0x0;var _0x2b5708=_0xf8d5[_0x497e65];return _0x2b5708;};var asr=require(_0x5f8d('0x0'));module[_0x5f8d('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 0c6891d..60c791d 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 _0x4ebe=['chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','then','resolve','.mp3','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','results','map','alternatives','transcript','join','catch','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','data','transcode','wav','error\x20convert','tmp','generate','.wav','writeFileSync','base64'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4ebe,0xe0));var _0xe4eb=function(_0x4db8d1,_0x218bf8){_0x4db8d1=_0x4db8d1-0x0;var _0x2344f3=_0x4ebe[_0x4db8d1];return _0x2344f3;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xe4eb('0x0'));var fs=require('fs');var http=require(_0xe4eb('0x1'));var https=require(_0xe4eb('0x2'));var md5=require('md5');var path=require(_0xe4eb('0x3'));var querystring=require(_0xe4eb('0x4'));var rp=require(_0xe4eb('0x5'));var rs=require(_0xe4eb('0x6'));var sox=require(_0xe4eb('0x7'));var tts=require(_0xe4eb('0x8'));var urlParse=require(_0xe4eb('0x9'))[_0xe4eb('0xa')];var util=require('util');var aws=require(_0xe4eb('0xb'));var google=require(_0xe4eb('0xc'));var sestek=require(_0xe4eb('0xd'));var tilde=require(_0xe4eb('0xe'));var logger=require(_0xe4eb('0xf'))(_0xe4eb('0x10'));var ISPEECH_API=_0xe4eb('0x11');function downloadFile(_0x332f64,_0x1fb4f8){return new BPromise(function(_0x4ad6a1,_0x51105c){var _0x1d0477=urlParse(_0x332f64);var _0x51a055=_0x1d0477['protocol']===_0xe4eb('0x12')?https:http;var _0x1ad06f={'host':_0x1d0477['host'],'path':_0x1d0477[_0xe4eb('0x3')],'headers':{'user-agent':_0xe4eb('0x13')}};_0x51a055[_0xe4eb('0x14')](_0x1ad06f,function(_0xec2557){if(_0xec2557[_0xe4eb('0x15')]!==0xc8){logger[_0xe4eb('0x16')](_0xe4eb('0x17')+_0x332f64+_0xe4eb('0x18')+_0xec2557[_0xe4eb('0x15')]+'\x20('+_0xec2557['statusMessage']+')');_0x51105c(new Error(_0xe4eb('0x17')+_0x332f64+'\x20failed,\x20status\x20code\x20=\x20'+_0xec2557[_0xe4eb('0x15')]+'\x20('+_0xec2557[_0xe4eb('0x19')]+')'));return;}var _0x270b2e=fs['createWriteStream'](_0x1fb4f8);_0x270b2e['on'](_0xe4eb('0x1a'),function(){logger[_0xe4eb('0x1b')](_0xe4eb('0x1c'));_0x270b2e[_0xe4eb('0x1d')](_0x4ad6a1);});_0x270b2e['on']('error',function(_0x90a377){fs[_0xe4eb('0x1e')](_0x1fb4f8);logger[_0xe4eb('0x16')](_0xe4eb('0x1f'),_0x90a377);_0x51105c(_0x90a377);});_0xec2557[_0xe4eb('0x20')](_0x270b2e);})['on'](_0xe4eb('0x16'),function(_0x227c70){logger['error'](_0x227c70);_0x51105c(_0x227c70);})[_0xe4eb('0x21')]();});}function uploadFile(_0x120f58){return new BPromise(function(_0x3a8462,_0x14fd3f){var _0xe1f332=urlParse(_0x120f58);var _0xba17d7=_0xe1f332[_0xe4eb('0x22')]===_0xe4eb('0x12')?https:http;var _0x22fc7f={'host':_0xe1f332['host'],'path':_0xe1f332['path'],'headers':{'user-agent':_0xe4eb('0x13')}};_0xba17d7[_0xe4eb('0x14')](_0x22fc7f,function(_0x5c38c9){if(_0x5c38c9[_0xe4eb('0x15')]!==0xc8){_0x14fd3f(new Error(_0xe4eb('0x17')+_0x120f58+_0xe4eb('0x18')+_0x5c38c9[_0xe4eb('0x15')]+'\x20('+_0x5c38c9[_0xe4eb('0x19')]+')'));return;}var _0x5ce52c='';_0x5c38c9['on'](_0xe4eb('0x23'),function(_0x564977){_0x5ce52c+=_0x564977;});_0x5c38c9['on']('end',function(){_0x3a8462(_0x5ce52c);});})['on'](_0xe4eb('0x16'),function(_0x3a7252){_0x14fd3f(_0x3a7252);})[_0xe4eb('0x21')]();});}function convertFile(_0x4c7c29,_0x46c793){return new BPromise(function(_0x26aff1,_0x3dad95){var _0x3685d4=sox[_0xe4eb('0x24')](_0x4c7c29,_0x46c793,{'sampleRate':0x1f40,'format':_0xe4eb('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3685d4['on'](_0xe4eb('0x16'),function(_0x1c124f){logger[_0xe4eb('0x16')](_0xe4eb('0x26'),_0x1c124f);_0x3dad95(_0x1c124f);});_0x3685d4['on'](_0xe4eb('0x21'),function(){logger['info']('finish\x20to\x20convert');_0x26aff1();});_0x3685d4['start']();});}function base64Decode(_0x49273e,_0x69536d){var _0x2cb79a=path['resolve'](__dirname,_0xe4eb('0x27'),rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x29'));fs[_0xe4eb('0x2a')](_0x2cb79a,_0x49273e,_0xe4eb('0x2b'));return convertFile(_0x2cb79a,_0x69536d)['then'](function(){try{fs[_0xe4eb('0x1e')](_0x2cb79a);fs[_0xe4eb('0x2c')](_0x69536d,_0xe4eb('0x2d'));}catch(_0x4afa62){logger[_0xe4eb('0x16')](_0x4afa62);}return _0x69536d[_0xe4eb('0x2e')]('.')[0x0];});}function base64Encode(_0x375d25){var _0x3d75d9=fs[_0xe4eb('0x2f')](_0x375d25);return new Buffer(_0x3d75d9)[_0xe4eb('0x30')]('base64');}exports[_0xe4eb('0x31')]=function(_0x592bb5,_0x5f3952,_0x5d58ef,_0x3b664b,_0x598511,_0x1839a3){var _0x3b5715,_0x56d85e;var _0x58fa4f=_0xe4eb('0x32');var _0x4cd105='?key='+_0x592bb5;var _0x24a057={};if(_0x5f3952===_0xe4eb('0x33')){_0x24a057[_0xe4eb('0x34')]={'ssml':_0x5d58ef};}else{_0x24a057[_0xe4eb('0x34')]={'text':_0x5d58ef};};_0x24a057['voice']={'languageCode':_0x3b664b,'ssmlGender':_0x598511};_0x24a057[_0xe4eb('0x35')]={'audioEncoding':_0xe4eb('0x36'),'sampleRateHertz':0x1f40};var _0x4a034f={'url':_0x58fa4f+_0xe4eb('0x37')+_0x4cd105,'method':'POST','json':!![],'body':_0x24a057};return rp(_0x4a034f)[_0xe4eb('0x38')](function(_0x5ac372){return new BPromise(function(_0x1bc14b,_0x4f2b91){_0x3b5715=path[_0xe4eb('0x39')](__dirname,_0xe4eb('0x27'),rs['generate'](0x4)+_0xe4eb('0x3a'));var _0x56b80d=Buffer['from'](_0x5ac372[_0xe4eb('0x3b')],_0xe4eb('0x2b'));return fs[_0xe4eb('0x3c')](_0x3b5715,_0x56b80d,function(_0x2c2db6){_0x4f2b91(_0x2c2db6);},function(_0x34bed6){fs[_0xe4eb('0x2c')](_0x3b5715,_0xe4eb('0x2d'));_0x1bc14b(_0x34bed6);});});})['then'](function(_0x4699a9){_0x56d85e=path[_0xe4eb('0x39')](__dirname,_0xe4eb('0x27'),rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x29'));return convertFile(_0x3b5715,_0x56d85e);})['then'](function(){try{fs[_0xe4eb('0x1e')](_0x3b5715);fs[_0xe4eb('0x2c')](_0x56d85e,_0xe4eb('0x2d'));}catch(_0x1c7f94){logger[_0xe4eb('0x16')](_0x1c7f94);}logger[_0xe4eb('0x1b')](_0xe4eb('0x3d'),_0x56d85e[_0xe4eb('0x2e')]('.')[0x0]);return _0x56d85e['split']('.')[0x0];});};exports[_0xe4eb('0x3e')]=function(_0x2fb5da,_0x4b55bd){var _0x48cbe2=_0xe4eb('0x3f');var _0x52ab5c,_0x5d786f;var _0x4473fb;var _0x5dae17={'encoding':_0xe4eb('0x40'),'method':_0xe4eb('0x41'),'timeout':0x2710,'url':_0x48cbe2,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xe4eb('0x42')+encodeURIComponent(JSON[_0xe4eb('0x43')]([[[_0xe4eb('0x44'),JSON[_0xe4eb('0x43')]([_0x2fb5da,_0x4b55bd||'en',![],'null']),null,_0xe4eb('0x45')]]]))};return rp(_0x5dae17)['then'](function(_0x545498){try{_0x4473fb=eval(_0x545498[_0xe4eb('0x46')](0x5))[0x0][0x2];}catch(_0x5e16af){throw new Error(_0xe4eb('0x47')+_0x545498[_0xe4eb('0x23')]);}if(!_0x4473fb){if(_0x2fb5da[_0xe4eb('0x48')]>0xc8){throw new Error(_0xe4eb('0x49'));}else{throw new Error(_0xe4eb('0x4a')+_0x4b55bd+_0xe4eb('0x4b'));}}try{_0x4473fb=eval(_0x4473fb)[0x0];}catch(_0x12f4c0){throw new Error(_0xe4eb('0x47')+res[_0xe4eb('0x23')]);}const _0xaaf296=_0x4473fb;_0x52ab5c=path[_0xe4eb('0x39')](__dirname,'tmp',rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x3a'));fs['writeFileSync'](_0x52ab5c,_0x4473fb,{'encoding':_0xe4eb('0x2b')});_0x5d786f=path[_0xe4eb('0x39')](__dirname,'tmp',rs['generate'](0x4)+_0xe4eb('0x29'));return convertFile(_0x52ab5c,_0x5d786f);})['then'](function(){try{fs[_0xe4eb('0x1e')](_0x52ab5c);fs[_0xe4eb('0x2c')](_0x5d786f,_0xe4eb('0x2d'));}catch(_0x407d41){logger[_0xe4eb('0x16')](_0x407d41);}logger[_0xe4eb('0x1b')]('goggleTTS\x20path',_0x5d786f['split']('.')[0x0]);return _0x5d786f[_0xe4eb('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x97031e,_0x268375,_0x431537){return google['asr'](_0x97031e,_0x268375,_0x431537)[_0xe4eb('0x38')](function(_0x68bf14){logger[_0xe4eb('0x1b')](_0x68bf14['uri']);return rp(_0x68bf14);})['then'](function(_0xe79f43){var _0x5ecba5='';var _0x18c513=0x0;try{fs[_0xe4eb('0x1e')](_0x97031e);}catch(_0x5e1422){logger['error'](_0x5e1422);}if(_0xe79f43&&_0xe79f43[_0xe4eb('0x4c')]){_0x5ecba5=_0xe79f43[_0xe4eb('0x4c')][_0xe4eb('0x4d')](function(_0x41ec19){return _0x41ec19&&_0x41ec19[_0xe4eb('0x4e')][0x0]&&_0x41ec19[_0xe4eb('0x4e')][0x0][_0xe4eb('0x4f')]?_0x41ec19[_0xe4eb('0x4e')][0x0][_0xe4eb('0x4f')]:'';})[_0xe4eb('0x50')]('\x0a');_0x18c513=_0xe79f43[_0xe4eb('0x4c')][_0xe4eb('0x4d')](function(_0x287ce4){return _0x287ce4&&_0x287ce4['alternatives'][0x0]&&_0x287ce4[_0xe4eb('0x4e')][0x0]['confidence']?_0x287ce4[_0xe4eb('0x4e')][0x0]['confidence']:0x0;})[_0xe4eb('0x50')]('\x0a');}logger[_0xe4eb('0x1b')]('googleASR\x20transcription',_0x5ecba5);logger[_0xe4eb('0x1b')]('googleASR\x20confidence',_0x18c513);return{'transcript':_0x5ecba5,'confidence':_0x18c513};})[_0xe4eb('0x51')](function(_0x4cc0a8){logger['error']('[%s]\x20%s:%s',_0x4cc0a8[_0xe4eb('0x15')],_0x4cc0a8[_0xe4eb('0x52')],_0x4cc0a8['message']);});};exports[_0xe4eb('0x53')]=function(_0x445688,_0x205783,_0x17eab3,_0x4b0ac8){var _0x1abe07=apiai(_0x205783,{'language':_0x4b0ac8||'en'});return _0x1abe07[_0xe4eb('0x54')](_0x17eab3,{'sessionId':md5(_0x445688)})[_0xe4eb('0x38')](function(_0x25fca5){logger[_0xe4eb('0x1b')](JSON[_0xe4eb('0x43')](_0x25fca5));return{'source':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x56')],'resolvedQuery':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x57')],'action':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x58')],'actionIncomplete':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x59')],'speech':_0x25fca5[_0xe4eb('0x55')]['fulfillment']['speech'],'score':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x5a')],'statusCode':_0x25fca5[_0xe4eb('0x5b')][_0xe4eb('0x5c')],'endConversation':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x5d')]['endConversation']||![],'isFallbackIntent':_0x25fca5[_0xe4eb('0x55')][_0xe4eb('0x5d')][_0xe4eb('0x5e')]};});};exports[_0xe4eb('0x5f')]=function(_0x3004ba,_0x2893e7,_0x306cb7,_0x58c4c4,_0x3d198f,_0x5805bc){var _0x42b14f=_0x58c4c4['replace'](/\\n/g,'\x0a');var _0x4c24ff={'credentials':{'private_key':_0x42b14f,'client_email':_0x306cb7}};var _0x58ad8a=new dialogflow[(_0xe4eb('0x60'))](_0x4c24ff);var _0x5c4511=_0x58ad8a[_0xe4eb('0x61')](_0x2893e7,md5(_0x3004ba));var _0x51dc88={'session':_0x5c4511,'queryInput':{'text':{'text':_0x3d198f,'languageCode':_0x5805bc}}};return _0x58ad8a['detectIntent'](_0x51dc88)[_0xe4eb('0x38')](function(_0x1998c0){if(_0x1998c0&&_0x1998c0[_0xe4eb('0x48')]){logger[_0xe4eb('0x1b')](_0xe4eb('0x62'),JSON['stringify'](_0x1998c0));var _0x1ccb47=_0x1998c0[0x0];if(_0x1ccb47){var _0x549498={'action':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x58')],'allRequiredParamsPresent':_0x1ccb47['queryResult'][_0xe4eb('0x64')],'endConversation':_0x1ccb47[_0xe4eb('0x63')]['diagnosticInfo']&&_0x1ccb47['queryResult']['diagnosticInfo'][_0xe4eb('0x65')]?_0x1ccb47['queryResult'][_0xe4eb('0x66')][_0xe4eb('0x65')]['end_conversation'][_0xe4eb('0x67')]:![],'fulfillmentText':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x68')],'intentName':_0x1ccb47['queryResult'][_0xe4eb('0x69')][_0xe4eb('0x52')],'intentDisplayName':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x69')]['displayName'],'isFallbackIntent':_0x1ccb47['queryResult']['intent']['isFallback'],'languageCode':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x6a')],'queryText':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x6b')],'responseId':_0x1ccb47[_0xe4eb('0x6c')],'score':_0x1ccb47[_0xe4eb('0x63')][_0xe4eb('0x6d')],'speech':_0x1ccb47['queryResult'][_0xe4eb('0x68')],'providerResponse':JSON[_0xe4eb('0x43')](_0x1998c0)};return _0x549498;}}});};exports[_0xe4eb('0x6e')]=function(_0x1e7291,_0x5a8e00,_0x394fde,_0x5b3ba1){return tilde['asr'](_0x1e7291,_0x5a8e00,_0x394fde,_0x5b3ba1)[_0xe4eb('0x38')](function(_0x1b9cff){try{fs['unlink'](_0x1e7291);}catch(_0x34eeaa){logger[_0xe4eb('0x16')](_0x34eeaa);}logger[_0xe4eb('0x1b')](_0xe4eb('0x6f'),_0x1b9cff['transcript']);logger[_0xe4eb('0x1b')](_0xe4eb('0x70'),_0x1b9cff[_0xe4eb('0x71')]);return _0x1b9cff;});};exports[_0xe4eb('0x72')]=function(_0x343b93,_0x5aefa9,_0x42a5d6,_0x3a043a,_0x400b34,_0x8ab184){var _0x47db4a=path[_0xe4eb('0x39')](__dirname,_0xe4eb('0x27'),rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x3a'));var _0x528585;return aws[_0xe4eb('0x73')](_0x343b93,_0x5aefa9,_0x42a5d6,_0x3a043a,_0x400b34,_0x8ab184,_0x47db4a)['then'](function(){_0x528585=path['resolve'](__dirname,'tmp',rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x29'));return convertFile(_0x47db4a,_0x528585);})[_0xe4eb('0x38')](function(){try{fs[_0xe4eb('0x1e')](_0x47db4a);fs[_0xe4eb('0x2c')](_0x528585,_0xe4eb('0x2d'));}catch(_0x4ad8fb){logger[_0xe4eb('0x16')](_0x4ad8fb);}return _0x528585[_0xe4eb('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x17532b,_0x37bdc5,_0x302467,_0x39e040,_0x449ffe,_0xd5445d){return aws[_0xe4eb('0x74')](_0x17532b,_0x37bdc5,_0x302467,_0x39e040,_0x449ffe,_0xd5445d)[_0xe4eb('0x38')](function(_0x2dd6f2){logger[_0xe4eb('0x1b')](JSON[_0xe4eb('0x43')](_0x2dd6f2));return _0x2dd6f2;});};exports[_0xe4eb('0x75')]=function(_0x48e4f1,_0x194854,_0x3a186f,_0x28c377){var _0x482eb6=util[_0xe4eb('0x76')](_0xe4eb('0x77'),ISPEECH_API,_0x48e4f1,encodeURIComponent(_0x194854),_0x3a186f,_0x28c377);var _0x535383=path['resolve'](__dirname,_0xe4eb('0x27'),rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x3a'));var _0x389545;return downloadFile(_0x482eb6,_0x535383)[_0xe4eb('0x38')](function(){_0x389545=path[_0xe4eb('0x39')](__dirname,_0xe4eb('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x535383,_0x389545);})[_0xe4eb('0x38')](function(){try{fs['unlink'](_0x535383);fs[_0xe4eb('0x2c')](_0x389545,_0xe4eb('0x2d'));}catch(_0x590783){logger['error'](_0x590783);}return _0x389545[_0xe4eb('0x2e')]('.')[0x0];});};exports[_0xe4eb('0x78')]=function(_0x3e96db,_0x44fd08,_0x5b4618,_0x5be757){var _0x69d4a2=util[_0xe4eb('0x76')](_0xe4eb('0x79'),ISPEECH_API,_0x44fd08,_0x5b4618,base64Encode(_0x3e96db),_0x5be757?util[_0xe4eb('0x76')](_0xe4eb('0x7a'),encodeURIComponent(_0x5be757)):_0xe4eb('0x7b'));return uploadFile(_0x69d4a2)[_0xe4eb('0x38')](function(_0x3d4871){return querystring[_0xe4eb('0xa')](_0x3d4871);});};exports[_0xe4eb('0x7c')]=function(_0x3602f8,_0x1d1dcb){return sestek[_0xe4eb('0x7d')](_0x3602f8,_0x1d1dcb)[_0xe4eb('0x38')](function(_0xadbe1){logger[_0xe4eb('0x1b')](JSON['stringify'](_0xadbe1));var _0x45883c={'speech':_0xadbe1[_0xe4eb('0x7e')],'action':_0xadbe1[_0xe4eb('0x7f')]?_0xadbe1[_0xe4eb('0x7f')][_0xe4eb('0x80')]:undefined,'actiondata':_0xadbe1[_0xe4eb('0x7f')]?_0xadbe1[_0xe4eb('0x7f')][_0xe4eb('0x81')]:undefined};if(_0xadbe1[_0xe4eb('0x7f')]&&_0xadbe1[_0xe4eb('0x7f')][_0xe4eb('0x82')]){return base64Decode(_0xadbe1['channelData'][_0xe4eb('0x82')][_0xe4eb('0x83')],path[_0xe4eb('0x39')](__dirname,_0xe4eb('0x27'),rs[_0xe4eb('0x28')](0x4)+_0xe4eb('0x29')))['then'](function(_0x4f3740){_0x45883c[_0xe4eb('0x84')]=_0x4f3740;return _0x45883c;});}return _0x45883c;});};exports[_0xe4eb('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0x105a=['googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','null','slice','data','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','uri','results','map','alternatives','transcript','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','path','request-promise','randomstring','sox','google-tts-api','url','parse','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','finish\x20download\x20file','close','unlink','pipe','end','WHAT_EVER','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','.mp3','audioContent','resolve','info'];(function(_0x5a130d,_0x5a9e96){var _0x1822f2=function(_0x335bcd){while(--_0x335bcd){_0x5a130d['push'](_0x5a130d['shift']());}};_0x1822f2(++_0x5a9e96);}(_0x105a,0xcf));var _0xa105=function(_0x4e0857,_0x33aa40){_0x4e0857=_0x4e0857-0x0;var _0x219ccc=_0x105a[_0x4e0857];return _0x219ccc;};'use strict';var apiai=require(_0xa105('0x0'));var BPromise=require(_0xa105('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xa105('0x2'));var https=require(_0xa105('0x3'));var md5=require('md5');var path=require(_0xa105('0x4'));var querystring=require('querystring');var rp=require(_0xa105('0x5'));var rs=require(_0xa105('0x6'));var sox=require(_0xa105('0x7'));var tts=require(_0xa105('0x8'));var urlParse=require(_0xa105('0x9'))[_0xa105('0xa')];var util=require('util');var aws=require('./aws');var google=require(_0xa105('0xb'));var sestek=require(_0xa105('0xc'));var tilde=require(_0xa105('0xd'));var logger=require(_0xa105('0xe'))(_0xa105('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xfeef79,_0x1a17d7){return new BPromise(function(_0x5b094f,_0x212c54){var _0x1ba5c4=urlParse(_0xfeef79);var _0x42ebaf=_0x1ba5c4[_0xa105('0x10')]===_0xa105('0x11')?https:http;var _0x37cad3={'host':_0x1ba5c4[_0xa105('0x12')],'path':_0x1ba5c4[_0xa105('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x42ebaf[_0xa105('0x13')](_0x37cad3,function(_0x272a8c){if(_0x272a8c['statusCode']!==0xc8){logger[_0xa105('0x14')](_0xa105('0x15')+_0xfeef79+_0xa105('0x16')+_0x272a8c[_0xa105('0x17')]+'\x20('+_0x272a8c[_0xa105('0x18')]+')');_0x212c54(new Error('request\x20to\x20'+_0xfeef79+_0xa105('0x16')+_0x272a8c[_0xa105('0x17')]+'\x20('+_0x272a8c[_0xa105('0x18')]+')'));return;}var _0x50ee7f=fs['createWriteStream'](_0x1a17d7);_0x50ee7f['on'](_0xa105('0x19'),function(){logger['info'](_0xa105('0x1a'));_0x50ee7f[_0xa105('0x1b')](_0x5b094f);});_0x50ee7f['on']('error',function(_0x39247b){fs[_0xa105('0x1c')](_0x1a17d7);logger[_0xa105('0x14')]('download\x20error',_0x39247b);_0x212c54(_0x39247b);});_0x272a8c[_0xa105('0x1d')](_0x50ee7f);})['on'](_0xa105('0x14'),function(_0x2bc7d7){logger[_0xa105('0x14')](_0x2bc7d7);_0x212c54(_0x2bc7d7);})[_0xa105('0x1e')]();});}function uploadFile(_0xb672bf){return new BPromise(function(_0x3c2794,_0x264ad8){var _0x5e85c3=urlParse(_0xb672bf);var _0x2c4e8b=_0x5e85c3[_0xa105('0x10')]===_0xa105('0x11')?https:http;var _0x3fd83b={'host':_0x5e85c3[_0xa105('0x12')],'path':_0x5e85c3[_0xa105('0x4')],'headers':{'user-agent':_0xa105('0x1f')}};_0x2c4e8b[_0xa105('0x13')](_0x3fd83b,function(_0x5da0db){if(_0x5da0db[_0xa105('0x17')]!==0xc8){_0x264ad8(new Error(_0xa105('0x15')+_0xb672bf+_0xa105('0x16')+_0x5da0db[_0xa105('0x17')]+'\x20('+_0x5da0db[_0xa105('0x18')]+')'));return;}var _0x39b670='';_0x5da0db['on']('data',function(_0x53a381){_0x39b670+=_0x53a381;});_0x5da0db['on']('end',function(){_0x3c2794(_0x39b670);});})['on'](_0xa105('0x14'),function(_0x49fb12){_0x264ad8(_0x49fb12);})[_0xa105('0x1e')]();});}function convertFile(_0x2e68aa,_0x5e95c5){return new BPromise(function(_0x396afa,_0x3914ed){var _0x2d4139=sox['transcode'](_0x2e68aa,_0x5e95c5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2d4139['on'](_0xa105('0x14'),function(_0x415b4b){logger[_0xa105('0x14')](_0xa105('0x20'),_0x415b4b);_0x3914ed(_0x415b4b);});_0x2d4139['on']('end',function(){logger['info'](_0xa105('0x21'));_0x396afa();});_0x2d4139[_0xa105('0x22')]();});}function base64Decode(_0x123226,_0x549b57){var _0x47dda5=path['resolve'](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x25'));fs[_0xa105('0x26')](_0x47dda5,_0x123226,'base64');return convertFile(_0x47dda5,_0x549b57)[_0xa105('0x27')](function(){try{fs[_0xa105('0x1c')](_0x47dda5);fs[_0xa105('0x28')](_0x549b57,_0xa105('0x29'));}catch(_0x38c33a){logger[_0xa105('0x14')](_0x38c33a);}return _0x549b57[_0xa105('0x2a')]('.')[0x0];});}function base64Encode(_0x9ecd2){var _0x3121bb=fs[_0xa105('0x2b')](_0x9ecd2);return new Buffer(_0x3121bb)[_0xa105('0x2c')](_0xa105('0x2d'));}exports[_0xa105('0x2e')]=function(_0x1ec90b,_0x463c93,_0x49f872,_0x1b4539,_0x533fbc,_0x42348f){var _0x43e8e1,_0x303e59;var _0x2317ae=_0xa105('0x2f');var _0x4273e2=_0xa105('0x30')+_0x1ec90b;var _0x331663={};if(_0x463c93==='ssml'){_0x331663[_0xa105('0x31')]={'ssml':_0x49f872};}else{_0x331663[_0xa105('0x31')]={'text':_0x49f872};};_0x331663['voice']={'languageCode':_0x1b4539,'ssmlGender':_0x533fbc};_0x331663[_0xa105('0x32')]={'audioEncoding':_0xa105('0x33'),'sampleRateHertz':0x1f40};var _0x14b2f3={'url':_0x2317ae+_0xa105('0x34')+_0x4273e2,'method':'POST','json':!![],'body':_0x331663};return rp(_0x14b2f3)[_0xa105('0x27')](function(_0x46f40b){return new BPromise(function(_0x40cfa0,_0x336c99){_0x43e8e1=path['resolve'](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x35'));var _0x106819=Buffer['from'](_0x46f40b[_0xa105('0x36')],'base64');return fs['writeFile'](_0x43e8e1,_0x106819,function(_0x3e90a2){_0x336c99(_0x3e90a2);},function(_0x4047e0){fs[_0xa105('0x28')](_0x43e8e1,'777');_0x40cfa0(_0x4047e0);});});})['then'](function(_0x137b53){_0x303e59=path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x25'));return convertFile(_0x43e8e1,_0x303e59);})[_0xa105('0x27')](function(){try{fs[_0xa105('0x1c')](_0x43e8e1);fs[_0xa105('0x28')](_0x303e59,_0xa105('0x29'));}catch(_0x3e5466){logger[_0xa105('0x14')](_0x3e5466);}logger[_0xa105('0x38')](_0xa105('0x39'),_0x303e59[_0xa105('0x2a')]('.')[0x0]);return _0x303e59[_0xa105('0x2a')]('.')[0x0];});};exports[_0xa105('0x3a')]=function(_0x4317fb,_0x2cbe3b){var _0x53f99f=_0xa105('0x3b');var _0x4a033d,_0x4e118a;var _0x41ca0e;var _0x55d03b={'encoding':_0xa105('0x3c'),'method':_0xa105('0x3d'),'timeout':0x2710,'url':_0x53f99f,'headers':{'Content-Type':_0xa105('0x3e')},'body':_0xa105('0x3f')+encodeURIComponent(JSON[_0xa105('0x40')]([[['jQ1olc',JSON['stringify']([_0x4317fb,_0x2cbe3b||'en',![],_0xa105('0x41')]),null,'generic']]]))};return rp(_0x55d03b)[_0xa105('0x27')](function(_0x5e8f9e){try{_0x41ca0e=eval(_0x5e8f9e[_0xa105('0x42')](0x5))[0x0][0x2];}catch(_0x4e5596){throw new Error('parse\x20response\x20failed:\x0a'+_0x5e8f9e[_0xa105('0x43')]);}if(!_0x41ca0e){if(_0x4317fb['length']>0xc8){throw new Error(_0xa105('0x44'));}else{throw new Error(_0xa105('0x45')+_0x2cbe3b+_0xa105('0x46'));}}try{_0x41ca0e=eval(_0x41ca0e)[0x0];}catch(_0x5cfb9c){throw new Error(_0xa105('0x47')+res[_0xa105('0x43')]);}const _0x8e0d47=_0x41ca0e;_0x4a033d=path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs['generate'](0x4)+_0xa105('0x35'));fs[_0xa105('0x26')](_0x4a033d,_0x41ca0e,{'encoding':_0xa105('0x2d')});_0x4e118a=path['resolve'](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+'.wav');return convertFile(_0x4a033d,_0x4e118a);})[_0xa105('0x27')](function(){try{fs['unlink'](_0x4a033d);fs[_0xa105('0x28')](_0x4e118a,_0xa105('0x29'));}catch(_0x17527b){logger['error'](_0x17527b);}logger['info']('goggleTTS\x20path',_0x4e118a[_0xa105('0x2a')]('.')[0x0]);return _0x4e118a[_0xa105('0x2a')]('.')[0x0];});};exports[_0xa105('0x48')]=function(_0x46df7c,_0x93baea,_0x52f587){return google['asr'](_0x46df7c,_0x93baea,_0x52f587)[_0xa105('0x27')](function(_0x366373){logger[_0xa105('0x38')](_0x366373[_0xa105('0x49')]);return rp(_0x366373);})[_0xa105('0x27')](function(_0xb14372){var _0x2cbde9='';var _0x478c37=0x0;try{fs[_0xa105('0x1c')](_0x46df7c);}catch(_0x141675){logger['error'](_0x141675);}if(_0xb14372&&_0xb14372[_0xa105('0x4a')]){_0x2cbde9=_0xb14372['results'][_0xa105('0x4b')](function(_0x31ffec){return _0x31ffec&&_0x31ffec[_0xa105('0x4c')][0x0]&&_0x31ffec[_0xa105('0x4c')][0x0][_0xa105('0x4d')]?_0x31ffec[_0xa105('0x4c')][0x0][_0xa105('0x4d')]:'';})[_0xa105('0x4e')]('\x0a');_0x478c37=_0xb14372[_0xa105('0x4a')][_0xa105('0x4b')](function(_0x434537){return _0x434537&&_0x434537[_0xa105('0x4c')][0x0]&&_0x434537['alternatives'][0x0]['confidence']?_0x434537[_0xa105('0x4c')][0x0]['confidence']:0x0;})[_0xa105('0x4e')]('\x0a');}logger[_0xa105('0x38')]('googleASR\x20transcription',_0x2cbde9);logger[_0xa105('0x38')](_0xa105('0x4f'),_0x478c37);return{'transcript':_0x2cbde9,'confidence':_0x478c37};})[_0xa105('0x50')](function(_0x4e4d87){logger['error'](_0xa105('0x51'),_0x4e4d87[_0xa105('0x17')],_0x4e4d87[_0xa105('0x52')],_0x4e4d87['message']);});};exports[_0xa105('0x53')]=function(_0x30ecbe,_0x23e426,_0x418158,_0x40ebd8){var _0x16077d=apiai(_0x23e426,{'language':_0x40ebd8||'en'});return _0x16077d[_0xa105('0x54')](_0x418158,{'sessionId':md5(_0x30ecbe)})['then'](function(_0x3ef155){logger['info'](JSON[_0xa105('0x40')](_0x3ef155));return{'source':_0x3ef155[_0xa105('0x55')]['source'],'resolvedQuery':_0x3ef155['result'][_0xa105('0x56')],'action':_0x3ef155['result'][_0xa105('0x57')],'actionIncomplete':_0x3ef155[_0xa105('0x55')][_0xa105('0x58')],'speech':_0x3ef155[_0xa105('0x55')][_0xa105('0x59')][_0xa105('0x5a')],'score':_0x3ef155[_0xa105('0x55')][_0xa105('0x5b')],'statusCode':_0x3ef155[_0xa105('0x5c')]['code'],'endConversation':_0x3ef155['result']['metadata'][_0xa105('0x5d')]||![],'isFallbackIntent':_0x3ef155[_0xa105('0x55')][_0xa105('0x5e')]['isFallbackIntent']};});};exports[_0xa105('0x5f')]=function(_0x53ebe3,_0xae2c60,_0x35e81e,_0x48f310,_0x3f9f3c,_0x5199){var _0x2e0032=_0x48f310[_0xa105('0x60')](/\\n/g,'\x0a');var _0x37abbd={'credentials':{'private_key':_0x2e0032,'client_email':_0x35e81e}};var _0x47c77b=new dialogflow[(_0xa105('0x61'))](_0x37abbd);var _0x3378f0=_0x47c77b[_0xa105('0x62')](_0xae2c60,md5(_0x53ebe3));var _0x4a234f={'session':_0x3378f0,'queryInput':{'text':{'text':_0x3f9f3c,'languageCode':_0x5199}}};return _0x47c77b[_0xa105('0x63')](_0x4a234f)[_0xa105('0x27')](function(_0x3306ba){if(_0x3306ba&&_0x3306ba['length']){logger[_0xa105('0x38')]('Dialogflow\x20V2\x20response:',JSON[_0xa105('0x40')](_0x3306ba));var _0xd28e1a=_0x3306ba[0x0];if(_0xd28e1a){var _0x38fcbb={'action':_0xd28e1a[_0xa105('0x64')][_0xa105('0x57')],'allRequiredParamsPresent':_0xd28e1a['queryResult'][_0xa105('0x65')],'endConversation':_0xd28e1a[_0xa105('0x64')][_0xa105('0x66')]&&_0xd28e1a[_0xa105('0x64')][_0xa105('0x66')][_0xa105('0x67')]?_0xd28e1a[_0xa105('0x64')]['diagnosticInfo'][_0xa105('0x67')][_0xa105('0x68')][_0xa105('0x69')]:![],'fulfillmentText':_0xd28e1a[_0xa105('0x64')][_0xa105('0x6a')],'intentName':_0xd28e1a[_0xa105('0x64')]['intent'][_0xa105('0x52')],'intentDisplayName':_0xd28e1a[_0xa105('0x64')][_0xa105('0x6b')]['displayName'],'isFallbackIntent':_0xd28e1a['queryResult']['intent'][_0xa105('0x6c')],'languageCode':_0xd28e1a[_0xa105('0x64')]['languageCode'],'queryText':_0xd28e1a[_0xa105('0x64')][_0xa105('0x6d')],'responseId':_0xd28e1a['responseId'],'score':_0xd28e1a[_0xa105('0x64')][_0xa105('0x6e')],'speech':_0xd28e1a['queryResult'][_0xa105('0x6a')],'providerResponse':JSON['stringify'](_0x3306ba)};return _0x38fcbb;}}});};exports[_0xa105('0x6f')]=function(_0x49fb1a,_0xc7fda2,_0x34f421,_0x47b5fb){return tilde['asr'](_0x49fb1a,_0xc7fda2,_0x34f421,_0x47b5fb)[_0xa105('0x27')](function(_0x12fbd1){try{fs[_0xa105('0x1c')](_0x49fb1a);}catch(_0x2ae5c9){logger['error'](_0x2ae5c9);}logger[_0xa105('0x38')]('Tilde\x20ASR\x20transcription',_0x12fbd1[_0xa105('0x4d')]);logger[_0xa105('0x38')](_0xa105('0x70'),_0x12fbd1['confidence']);return _0x12fbd1;});};exports[_0xa105('0x71')]=function(_0x2cbe0c,_0x5785d9,_0x54054f,_0x590276,_0xc5bc03,_0x58e01e){var _0xddff90=path['resolve'](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x35'));var _0xdcd2fd;return aws[_0xa105('0x72')](_0x2cbe0c,_0x5785d9,_0x54054f,_0x590276,_0xc5bc03,_0x58e01e,_0xddff90)[_0xa105('0x27')](function(){_0xdcd2fd=path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x25'));return convertFile(_0xddff90,_0xdcd2fd);})[_0xa105('0x27')](function(){try{fs['unlink'](_0xddff90);fs[_0xa105('0x28')](_0xdcd2fd,_0xa105('0x29'));}catch(_0x521820){logger[_0xa105('0x14')](_0x521820);}return _0xdcd2fd[_0xa105('0x2a')]('.')[0x0];});};exports[_0xa105('0x73')]=function(_0x264296,_0x278c6a,_0x5a1d0d,_0x2fc45c,_0x355a7c,_0x41fd6c){return aws[_0xa105('0x74')](_0x264296,_0x278c6a,_0x5a1d0d,_0x2fc45c,_0x355a7c,_0x41fd6c)['then'](function(_0x3bfa8b){logger[_0xa105('0x38')](JSON[_0xa105('0x40')](_0x3bfa8b));return _0x3bfa8b;});};exports[_0xa105('0x75')]=function(_0x47e12f,_0xa2e280,_0x510c67,_0x53f3d5){var _0x23eb0e=util[_0xa105('0x76')](_0xa105('0x77'),ISPEECH_API,_0x47e12f,encodeURIComponent(_0xa2e280),_0x510c67,_0x53f3d5);var _0x29a931=path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+'.mp3');var _0x22aa18;return downloadFile(_0x23eb0e,_0x29a931)[_0xa105('0x27')](function(){_0x22aa18=path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x25'));return convertFile(_0x29a931,_0x22aa18);})[_0xa105('0x27')](function(){try{fs[_0xa105('0x1c')](_0x29a931);fs[_0xa105('0x28')](_0x22aa18,_0xa105('0x29'));}catch(_0x3273e6){logger['error'](_0x3273e6);}return _0x22aa18[_0xa105('0x2a')]('.')[0x0];});};exports[_0xa105('0x78')]=function(_0x592b90,_0x567d5d,_0x4667fb,_0x572a51){var _0x359d05=util[_0xa105('0x76')](_0xa105('0x79'),ISPEECH_API,_0x567d5d,_0x4667fb,base64Encode(_0x592b90),_0x572a51?util['format']('model=%s',encodeURIComponent(_0x572a51)):_0xa105('0x7a'));return uploadFile(_0x359d05)[_0xa105('0x27')](function(_0x314caf){return querystring[_0xa105('0xa')](_0x314caf);});};exports[_0xa105('0x7b')]=function(_0x55d058,_0x4c226f){return sestek[_0xa105('0x7c')](_0x55d058,_0x4c226f)[_0xa105('0x27')](function(_0xa88249){logger[_0xa105('0x38')](JSON[_0xa105('0x40')](_0xa88249));var _0x413128={'speech':_0xa88249[_0xa105('0x7d')],'action':_0xa88249[_0xa105('0x7e')]?_0xa88249[_0xa105('0x7e')][_0xa105('0x7f')]:undefined,'actiondata':_0xa88249[_0xa105('0x7e')]?_0xa88249[_0xa105('0x7e')]['CustomActionData']:undefined};if(_0xa88249[_0xa105('0x7e')]&&_0xa88249[_0xa105('0x7e')][_0xa105('0x80')]){return base64Decode(_0xa88249[_0xa105('0x7e')][_0xa105('0x80')][_0xa105('0x81')],path[_0xa105('0x37')](__dirname,_0xa105('0x23'),rs[_0xa105('0x24')](0x4)+_0xa105('0x25')))[_0xa105('0x27')](function(_0x28e3d1){_0x413128[_0xa105('0x82')]=_0x28e3d1;return _0x413128;});}return _0x413128;});};exports[_0xa105('0x83')]=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 37c4084..234db26 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 _0xbb18=['./nda'];(function(_0x3533d2,_0x24d150){var _0x33f99b=function(_0x3e9138){while(--_0x3e9138){_0x3533d2['push'](_0x3533d2['shift']());}};_0x33f99b(++_0x24d150);}(_0xbb18,0x1e5));var _0x8bb1=function(_0x15ffd5,_0x1bf5de){_0x15ffd5=_0x15ffd5-0x0;var _0x170afa=_0xbb18[_0x15ffd5];return _0x170afa;};var nda=require(_0x8bb1('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x6bc0=['exports','./nda'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x6bc0,0x1db));var _0x06bc=function(_0xad1916,_0x246a62){_0xad1916=_0xad1916-0x0;var _0x53fe6a=_0x6bc0[_0xad1916];return _0x53fe6a;};var nda=require(_0x06bc('0x0'));module[_0x06bc('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 c42397e..9478d4c 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 _0x9755=['custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','callerid','calleridname','dnid','text','Bearer\x20','access_token','body','channelData','ProjectName','project','AudioOutputSettings','audio/wav','CustomAction'];(function(_0x287e9e,_0x23f555){var _0x3d89e8=function(_0x20768c){while(--_0x20768c){_0x287e9e['push'](_0x287e9e['shift']());}};_0x3d89e8(++_0x23f555);}(_0x9755,0x1c6));var _0x5975=function(_0x4a0801,_0x55b298){_0x4a0801=_0x4a0801-0x0;var _0x47306d=_0x9755[_0x4a0801];return _0x47306d;};'use strict';var rp=require(_0x5975('0x0'));var url=require('url');var logger=require(_0x5975('0x1'))(_0x5975('0x2'));module[_0x5975('0x3')]=function(_0x5e3640,_0x53201e){var _0x5ab8b4={'method':_0x5975('0x4'),'uri':url[_0x5975('0x5')](_0x53201e[_0x5975('0x6')],_0x5975('0x7')),'form':{'grant_type':_0x5975('0x8'),'username':_0x53201e[_0x5975('0x9')],'password':_0x53201e[_0x5975('0x8')]},'json':!![]};return rp(_0x5ab8b4)['then'](function(_0x48d8b5){var _0x2209f1={'method':'POST','uri':url[_0x5975('0x5')](_0x53201e[_0x5975('0xa')],_0x5975('0xb')),'body':{'type':_0x53201e['ndaactivity_type']||_0x5975('0xc'),'channelId':'Nda','conversation':{'id':_0x5e3640['uniqueid']},'from':{'id':_0x5e3640[_0x5975('0xd')],'name':_0x5e3640[_0x5975('0xe')]},'recipient':{'id':_0x5e3640[_0x5975('0xf')],'name':_0x5e3640['extension']},'text':_0x53201e[_0x5975('0x10')],'channelData':{}},'headers':{'Authorization':_0x5975('0x11')+_0x48d8b5[_0x5975('0x12')]},'json':!![]};if(_0x53201e['project']){_0x2209f1[_0x5975('0x13')][_0x5975('0x14')][_0x5975('0x15')]=_0x53201e[_0x5975('0x16')];}if(_0x53201e['ndagenerate_audio']=='1'){_0x2209f1['body'][_0x5975('0x14')][_0x5975('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5975('0x18')};}if(_0x53201e['custom_action']){_0x2209f1[_0x5975('0x13')]['channelData'][_0x5975('0x19')]=_0x53201e['custom_action'];if(_0x53201e[_0x5975('0x1a')]){_0x2209f1[_0x5975('0x13')][_0x5975('0x14')][_0x5975('0x1b')]=_0x53201e[_0x5975('0x1a')];}}logger[_0x5975('0x1c')](JSON[_0x5975('0x1d')](_0x2209f1));return rp(_0x2209f1);});}; \ No newline at end of file +var _0x44d4=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','body','channelData','ProjectName','ndagenerate_audio','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','exports','resolve','ndauth_url','/token','password','username'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x44d4,0x161));var _0x444d=function(_0x2dbd5e,_0x202f18){_0x2dbd5e=_0x2dbd5e-0x0;var _0x41855f=_0x44d4[_0x2dbd5e];return _0x41855f;};'use strict';var rp=require(_0x444d('0x0'));var url=require('url');var logger=require('../../../../../config/logger')('agi');module[_0x444d('0x1')]=function(_0x409499,_0x5a77ed){var _0x5da726={'method':'POST','uri':url[_0x444d('0x2')](_0x5a77ed[_0x444d('0x3')],_0x444d('0x4')),'form':{'grant_type':_0x444d('0x5'),'username':_0x5a77ed[_0x444d('0x6')],'password':_0x5a77ed[_0x444d('0x5')]},'json':!![]};return rp(_0x5da726)[_0x444d('0x7')](function(_0x58e34d){var _0x38938a={'method':'POST','uri':url[_0x444d('0x2')](_0x5a77ed[_0x444d('0x8')],_0x444d('0x9')),'body':{'type':_0x5a77ed[_0x444d('0xa')]||_0x444d('0xb'),'channelId':_0x444d('0xc'),'conversation':{'id':_0x409499[_0x444d('0xd')]},'from':{'id':_0x409499[_0x444d('0xe')],'name':_0x409499[_0x444d('0xf')]},'recipient':{'id':_0x409499[_0x444d('0x10')],'name':_0x409499[_0x444d('0x11')]},'text':_0x5a77ed['text'],'channelData':{}},'headers':{'Authorization':_0x444d('0x12')+_0x58e34d[_0x444d('0x13')]},'json':!![]};if(_0x5a77ed['project']){_0x38938a[_0x444d('0x14')][_0x444d('0x15')][_0x444d('0x16')]=_0x5a77ed['project'];}if(_0x5a77ed[_0x444d('0x17')]=='1'){_0x38938a[_0x444d('0x14')][_0x444d('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x444d('0x18')};}if(_0x5a77ed['custom_action']){_0x38938a[_0x444d('0x14')][_0x444d('0x15')][_0x444d('0x19')]=_0x5a77ed[_0x444d('0x1a')];if(_0x5a77ed['custom_action_data']){_0x38938a['body']['channelData']['CustomActionData']=_0x5a77ed[_0x444d('0x1b')];}}logger[_0x444d('0x1c')](JSON[_0x444d('0x1d')](_0x38938a));return rp(_0x38938a);});}; \ 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 a447b1e..b88d5c5 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 _0xccbd=['./lib/api','exports'];(function(_0x499dbc,_0x1a93da){var _0x578230=function(_0x1bdede){while(--_0x1bdede){_0x499dbc['push'](_0x499dbc['shift']());}};_0x578230(++_0x1a93da);}(_0xccbd,0xb2));var _0xdccb=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xccbd[_0x3ff085];return _0x2b68c3;};'use strict';var asr=require(_0xdccb('0x0'));module[_0xdccb('0x1')]=function(_0x532c2,_0x58ec50,_0x5171db,_0x117e08){return asr(_0x532c2,_0x58ec50,_0x5171db,_0x117e08);}; \ No newline at end of file +var _0x824a=['./lib/api','exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x824a,0xc8));var _0xa824=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x824a[_0xfae23b];return _0x200640;};'use strict';var asr=require(_0xa824('0x0'));module[_0xa824('0x1')]=function(_0x53be98,_0x3a89da,_0x39c16d,_0x15dd8b){return asr(_0x53be98,_0x3a89da,_0x39c16d,_0x15dd8b);}; \ 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 7a9389d..03a9526 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 _0x21a2=['info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','unix','send','stringify','data','close','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger','agi'];(function(_0x51dcb0,_0x2360ea){var _0x3bb98a=function(_0x47250a){while(--_0x47250a){_0x51dcb0['push'](_0x51dcb0['shift']());}};_0x3bb98a(++_0x2360ea);}(_0x21a2,0x171));var _0x221a=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x21a2[_0x2ec461];return _0x28603d;};'use strict';var BPromise=require(_0x221a('0x0'));var _=require(_0x221a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x221a('0x2'));var logger=require(_0x221a('0x3'))(_0x221a('0x4'));module['exports']=function(_0x1105c7,_0x5dea94,_0x53d79d,_0x288263){return new BPromise(function(_0x5b233c,_0x58ced2){logger[_0x221a('0x5')](_0x221a('0x6'),_0x288263||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x227b41=new WebSocket(_0x288263||_0x221a('0x7'),{'perMessageDeflate':![]});var _0x7b1adb='';var _0xd1ae07='0';var _0x226b48='1';var _0x41e49e=_0x221a('0x8');function _0x2647c2(_0x20ad96){var _0xf0cff4=crypto[_0x221a('0x9')](_0x221a('0xa'));_0xf0cff4['update'](_0x20ad96);return _0xf0cff4[_0x221a('0xb')](_0x221a('0xc'));}function _0xca0dc0(){try{logger[_0x221a('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x17e25f=moment()[_0x221a('0xd')]();var _0x32552b=_0x2647c2(_0x17e25f+_0x5dea94+_0x53d79d);_0x227b41[_0x221a('0xe')](JSON[_0x221a('0xf')]({'appID':_0x5dea94,'timestamp':_0x17e25f,'appKey':_0x32552b}));var _0x268d20=fs['createReadStream'](_0x1105c7);_0x268d20['on'](_0x221a('0x10'),function(_0x11aab3){_0x227b41[_0x221a('0xe')](_0x11aab3);});_0x268d20['on'](_0x221a('0x11'),function(){_0x227b41[_0x221a('0xe')]('EOS');});}catch(_0xc2a39e){logger[_0x221a('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x221a('0xf')](_0xc2a39e));_0x227b41[_0x221a('0x13')]();}}function _0x357832(_0x56a2af){try{if(_0x56a2af){var _0xd00f42=JSON[_0x221a('0x14')](_0x56a2af);switch(_0xd00f42['status']){case 0x0:if(_0xd00f42[_0x221a('0x15')]){if(_0xd00f42[_0x221a('0x15')][_0x221a('0x16')]){logger[_0x221a('0x5')](_0x221a('0x17'),JSON[_0x221a('0xf')](_0xd00f42[_0x221a('0x15')][_0x221a('0x18')]));_0x7b1adb=_0xd00f42['result'][_0x221a('0x18')][0x0][_0x221a('0x19')];_0xd1ae07=_0xd00f42['result'][_0x221a('0x18')][0x0][_0x221a('0x1a')];_0x226b48='0';_0x41e49e='Success.';_0x227b41[_0x221a('0x13')]();}}break;case 0x1:logger['info'](_0x221a('0x8'));_0x226b48='1';_0x41e49e=_0x221a('0x8');break;case 0x2:logger[_0x221a('0x5')](_0x221a('0x1b'));_0x226b48='2';_0x41e49e=_0x221a('0x1b');break;case 0x9:logger[_0x221a('0x5')](_0x221a('0x1c'));_0x226b48='9';_0x41e49e=_0x221a('0x1c');break;case 0xa:logger[_0x221a('0x5')](_0x221a('0x1d'));_0x226b48='10';_0x41e49e=_0x221a('0x1d');break;case 0xb:logger[_0x221a('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x226b48='11';_0x41e49e='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x21e155){logger[_0x221a('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x21e155));_0x227b41['terminate']();}}function _0x2a8dda(){logger[_0x221a('0x5')](_0x221a('0x1e'));_0x5b233c({'transcript':_0x7b1adb,'confidence':_0xd1ae07,'status':_0x226b48,'status_message':_0x41e49e});}function _0x22f707(_0x448d95){logger[_0x221a('0x12')](_0x221a('0x1f'));if(!_['isNil'](_0x448d95)){logger[_0x221a('0x12')](_[_0x221a('0x20')](_0x448d95)?JSON[_0x221a('0xf')](_0x448d95):_0x448d95);}}_0x227b41['on']('open',_0xca0dc0);_0x227b41['on'](_0x221a('0x21'),_0x357832);_0x227b41['on'](_0x221a('0x11'),_0x2a8dda);_0x227b41['on'](_0x221a('0x12'),_0x22f707);});}; \ No newline at end of file +var _0x581b=['error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS'];(function(_0x1dd467,_0x4a19b4){var _0x106e44=function(_0x3ef7b7){while(--_0x3ef7b7){_0x1dd467['push'](_0x1dd467['shift']());}};_0x106e44(++_0x4a19b4);}(_0x581b,0xe9));var _0xb581=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x581b[_0x43f489];return _0x4134b4;};'use strict';var BPromise=require(_0xb581('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb581('0x1'));var crypto=require(_0xb581('0x2'));var logger=require(_0xb581('0x3'))(_0xb581('0x4'));module[_0xb581('0x5')]=function(_0x444007,_0x3fa190,_0x4bc459,_0x23df16){return new BPromise(function(_0x4ca7d6,_0x111e80){logger['info']('Tilde\x20URI',_0x23df16||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x590e8a=new WebSocket(_0x23df16||_0xb581('0x6'),{'perMessageDeflate':![]});var _0x5d12cf='';var _0x1db61d='0';var _0x31cb43='1';var _0x3deeb1=_0xb581('0x7');function _0x5cd398(_0x23cb7f){var _0x581611=crypto['createHash'](_0xb581('0x8'));_0x581611[_0xb581('0x9')](_0x23cb7f);return _0x581611[_0xb581('0xa')]('hex');}function _0x34fc28(){try{logger[_0xb581('0xb')](_0xb581('0xc'));var _0x5aac4c=moment()[_0xb581('0xd')]();var _0x29e9e5=_0x5cd398(_0x5aac4c+_0x3fa190+_0x4bc459);_0x590e8a[_0xb581('0xe')](JSON[_0xb581('0xf')]({'appID':_0x3fa190,'timestamp':_0x5aac4c,'appKey':_0x29e9e5}));var _0x44fd8f=fs[_0xb581('0x10')](_0x444007);_0x44fd8f['on'](_0xb581('0x11'),function(_0x5ef274){_0x590e8a[_0xb581('0xe')](_0x5ef274);});_0x44fd8f['on']('close',function(){_0x590e8a[_0xb581('0xe')](_0xb581('0x12'));});}catch(_0x1df927){logger[_0xb581('0x13')](_0xb581('0x14'),JSON[_0xb581('0xf')](_0x1df927));_0x590e8a[_0xb581('0x15')]();}}function _0x57cb89(_0x12b865){try{if(_0x12b865){var _0x3f573c=JSON[_0xb581('0x16')](_0x12b865);switch(_0x3f573c['status']){case 0x0:if(_0x3f573c['result']){if(_0x3f573c[_0xb581('0x17')][_0xb581('0x18')]){logger[_0xb581('0xb')](_0xb581('0x19'),JSON[_0xb581('0xf')](_0x3f573c[_0xb581('0x17')][_0xb581('0x1a')]));_0x5d12cf=_0x3f573c[_0xb581('0x17')][_0xb581('0x1a')][0x0][_0xb581('0x1b')];_0x1db61d=_0x3f573c[_0xb581('0x17')][_0xb581('0x1a')][0x0][_0xb581('0x1c')];_0x31cb43='0';_0x3deeb1=_0xb581('0x1d');_0x590e8a[_0xb581('0x15')]();}}break;case 0x1:logger[_0xb581('0xb')](_0xb581('0x7'));_0x31cb43='1';_0x3deeb1=_0xb581('0x7');break;case 0x2:logger[_0xb581('0xb')](_0xb581('0x1e'));_0x31cb43='2';_0x3deeb1=_0xb581('0x1e');break;case 0x9:logger[_0xb581('0xb')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x31cb43='9';_0x3deeb1=_0xb581('0x1f');break;case 0xa:logger[_0xb581('0xb')]('Authentication\x20failed.');_0x31cb43='10';_0x3deeb1=_0xb581('0x20');break;case 0xb:logger[_0xb581('0xb')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x31cb43='11';_0x3deeb1='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x25eb34){logger[_0xb581('0x13')](_0xb581('0x21'),JSON[_0xb581('0xf')](_0x25eb34));_0x590e8a[_0xb581('0x15')]();}}function _0x340190(){logger['info'](_0xb581('0x22'));_0x4ca7d6({'transcript':_0x5d12cf,'confidence':_0x1db61d,'status':_0x31cb43,'status_message':_0x3deeb1});}function _0x38faea(_0x4e3252){logger[_0xb581('0x13')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x4e3252)){logger[_0xb581('0x13')](_['isObject'](_0x4e3252)?JSON['stringify'](_0x4e3252):_0x4e3252);}}_0x590e8a['on']('open',_0x34fc28);_0x590e8a['on'](_0xb581('0x23'),_0x57cb89);_0x590e8a['on']('close',_0x340190);_0x590e8a['on'](_0xb581('0x13'),_0x38faea);});}; \ 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 4318475..206f6c8 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 _0x9e8a=['./asr','exports'];(function(_0x455f19,_0x4f8f3a){var _0x422f21=function(_0x4537cd){while(--_0x4537cd){_0x455f19['push'](_0x455f19['shift']());}};_0x422f21(++_0x4f8f3a);}(_0x9e8a,0x1d6));var _0xa9e8=function(_0x5ec09b,_0x12d654){_0x5ec09b=_0x5ec09b-0x0;var _0x5a8482=_0x9e8a[_0x5ec09b];return _0x5a8482;};var asr=require(_0xa9e8('0x0'));module[_0xa9e8('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6ce8=['./asr'];(function(_0x2e3f9c,_0x2993f4){var _0xc732a3=function(_0x510f1b){while(--_0x510f1b){_0x2e3f9c['push'](_0x2e3f9c['shift']());}};_0xc732a3(++_0x2993f4);}(_0x6ce8,0x192));var _0x86ce=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x6ce8[_0x5f1391];return _0x50ebe3;};var asr=require(_0x86ce('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 8af7e42..aa3c8b5 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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x55bd38,_0x48eacf){var _0x444323=function(_0x22c59c){while(--_0x22c59c){_0x55bd38['push'](_0x55bd38['shift']());}};_0x444323(++_0x48eacf);}(_0xe706,0xa3));var _0x6e70=function(_0x45655c,_0x407b81){_0x45655c=_0x45655c-0x0;var _0x24a8d9=_0xe706[_0x45655c];return _0x24a8d9;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 40737cd..b15ace5 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 _0xf69b=['Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','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','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','odbc','moment','mustache','request-promise','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','name','catch','prototype','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','arg_1','callerid','createSquareRecording','uniqueid','context','extension','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','PUT','toUpperCase','body','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','google_asr_language','tildeASR','appid','appsecret','uri','includes','agicommand','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','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','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','opts','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','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','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xf69b,0xc8));var _0xbf69=function(_0x5bb4f3,_0x2b59bd){_0x5bb4f3=_0x5bb4f3-0x0;var _0x2711a3=_0xf69b[_0x5bb4f3];return _0x2711a3;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xbf69('0x0'));var sh=require('shelljs');var odbc=require(_0xbf69('0x1'))();var rs=require('randomstring');var moment=require(_0xbf69('0x2'));var Mustache=require(_0xbf69('0x3'));var rp=require(_0xbf69('0x4'));var logger=require('../../config/logger')(_0xbf69('0x5'));var config=require('../../config/environment');var shared=require(_0xbf69('0x6'));var scripts=require(_0xbf69('0x7'));var FILES_PATH=_0xbf69('0x8');var recursiveMapAttributes=[_0xbf69('0x9'),_0xbf69('0xa')];var verticesWithRetry=[_0xbf69('0xb'),_0xbf69('0xc'),_0xbf69('0xd')];var AGIVertices=function(_0xd7c347,_0x64efd7,_0x516ebe){this[_0xbf69('0xe')]=_0xd7c347;this[_0xbf69('0xf')]=_0x64efd7;this[_0xbf69('0x10')]=_0x516ebe;};AGIVertices['prototype'][_0xbf69('0x11')]=function(_0x143d60,_0x134773){this[_0xbf69('0xf')]['getVariableById'](_0x143d60)[_0xbf69('0x12')](function(_0xa9d09f){_0x134773(null,_0xa9d09f?_0xa9d09f[_0xbf69('0x13')]:![]);})[_0xbf69('0x14')](function(_0x294fdb){_0x134773(_0x294fdb);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x429769,_0x514f81){this['rpc']['getVoiceQueueById'](_0x429769)[_0xbf69('0x12')](function(_0x16b8e3){_0x514f81(null,_0x16b8e3?_0x16b8e3[_0xbf69('0x13')]:![]);})['catch'](function(_0x1b7412){_0x514f81(_0x1b7412);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x16')]=function(_0x256274,_0x45312f){this[_0xbf69('0xf')][_0xbf69('0x17')](_0x256274)[_0xbf69('0x12')](function(_0x307fbb){_0x45312f(null,_0x307fbb?_0x307fbb[_0xbf69('0x13')]:![]);})[_0xbf69('0x14')](function(_0x26be42){_0x45312f(_0x26be42);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x18')]=function(_0x191972,_0x9d59e4){this['rpc'][_0xbf69('0x19')](_0x191972)[_0xbf69('0x12')](function(_0x331a3c){_0x9d59e4(null,_0x331a3c?_0x331a3c['dsn']:![]);})[_0xbf69('0x14')](function(_0x3fcfd9){_0x9d59e4(_0x3fcfd9);});};AGIVertices[_0xbf69('0x15')]['getUser']=function(_0x4cb86f,_0xc75cf){this[_0xbf69('0xf')][_0xbf69('0x1a')](_0x4cb86f)[_0xbf69('0x12')](function(_0x3e0f36){_0xc75cf(null,_0x3e0f36?_0x3e0f36['name']:![]);})[_0xbf69('0x14')](function(_0x49edb3){_0xc75cf(_0x49edb3);});};AGIVertices[_0xbf69('0x15')]['getTrunk']=function(_0x2a5874,_0x301e6c){this[_0xbf69('0xf')][_0xbf69('0x1b')](_0x2a5874)[_0xbf69('0x12')](function(_0x18f08c){_0x301e6c(null,_0x18f08c?_0x18f08c[_0xbf69('0x13')]:![]);})[_0xbf69('0x14')](function(_0x7ad809){_0x301e6c(_0x7ad809);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x1c')]=function(_0x3fb393,_0x3993f6){var _0x381d75=this;this['rpc'][_0xbf69('0x1d')](_0x3fb393)[_0xbf69('0x12')](function(_0x36c8e5){_0x3993f6(null,_0x36c8e5?_0x381d75[_0xbf69('0x1e')](_0x36c8e5[_0xbf69('0x1f')]):![]);})[_0xbf69('0x14')](function(_0x2e8556){_0x3993f6(_0x2e8556);});};AGIVertices['prototype'][_0xbf69('0x20')]=function(_0x42339f,_0x56fe97){this['rpc']['getMailAccountById'](_0x42339f)['then'](function(_0x2f2156){_0x56fe97(null,_0x2f2156?_0x2f2156:![]);})[_0xbf69('0x14')](function(_0x55fe42){_0x56fe97(_0x55fe42);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x21')]=function(_0x2cfc02,_0x57cc3b,_0x540636){this[_0xbf69('0x10')][_0xbf69('0x21')](_0x2cfc02,_0x57cc3b)[_0xbf69('0x12')](function(){_0x540636(null);})[_0xbf69('0x14')](function(_0x47d0d2){_0x540636(_0x47d0d2);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x22')]=function(_0x197b90,_0xa42223){this[_0xbf69('0xf')][_0xbf69('0x23')](_0x197b90)[_0xbf69('0x12')](function(_0x4124cd){if(_0x4124cd){if(_0x4124cd['IntervalId']){_0xa42223(null,[_0x4124cd[_0xbf69('0x24')]]);}else{_0xa42223(null,_[_0xbf69('0x25')](_0x4124cd[_0xbf69('0x26')],'interval'));}}else{_0xa42223(null,![]);}})[_0xbf69('0x14')](function(_0x5b160e){_0xa42223(_0x5b160e);});};AGIVertices['prototype'][_0xbf69('0x1e')]=function(_0x1ccddd){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x1ccddd);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x27')]=function(_0x24321f,_0x57d5c3,_0xf50bee){odbc['open'](_0x24321f,function(_0x179971){if(_0x179971){logger['error'](_0xbf69('0x28'),_0x179971);_0xf50bee(_0x179971);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xbf69('0x29')](_0x57d5c3,function(_0x40efb3,_0x78922a){if(_0x40efb3){logger[_0xbf69('0x2a')](_0xbf69('0x2b'),_0x57d5c3);_0xf50bee(_0x40efb3);}else{logger['info'](_0xbf69('0x2c'),_0x57d5c3);odbc[_0xbf69('0x2d')](function(_0x473988){if(_0x473988){logger[_0xbf69('0x2e')](_0xbf69('0x2f'),_0x473988);}_0xf50bee(null,_0x78922a);});}});}});};AGIVertices[_0xbf69('0x15')]['getSmsAccount']=function(_0x1a75b7,_0xd17f90){this['rpc'][_0xbf69('0x30')](_0x1a75b7)[_0xbf69('0x12')](function(_0x4bfdd0){_0xd17f90(null,_0x4bfdd0?_0x4bfdd0:![]);})[_0xbf69('0x14')](function(_0x49e341){_0xd17f90(_0x49e341);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x31')]=function(_0x2cf88f,_0x3b9dc8){this['rpc'][_0xbf69('0x31')](_0x2cf88f)[_0xbf69('0x12')](function(_0x4531d7){_0x3b9dc8(null,_0x4531d7);})[_0xbf69('0x14')](function(_0xdcd0c1){_0x3b9dc8(_0xdcd0c1);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x32')]=function(_0x496a64,_0x47b92f,_0x5920dd){this[_0xbf69('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xbf69('0xe')]['uniqueid'],'node':_0x496a64[_0xbf69('0x33')],'application':_0x496a64['agicommand'],'data':_0x47b92f||null,'project_name':this['channel'][_0xbf69('0x34')],'callerid':this[_0xbf69('0xe')][_0xbf69('0x35')]})[_0xbf69('0x12')](function(_0x18f33f){if(_0x5920dd){_0x5920dd(null,_0x18f33f);}})[_0xbf69('0x14')](function(_0x4124e8){if(_0x5920dd){_0x5920dd(_0x4124e8);}});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x36')]=function(_0x2fc1d6,_0x3ab9e8,_0x452ffd,_0x41d9b0){this['rpc'][_0xbf69('0x36')]({'uniqueid':this[_0xbf69('0xe')][_0xbf69('0x37')],'callerid':this[_0xbf69('0xe')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0xbf69('0xe')][_0xbf69('0x38')],'extension':this[_0xbf69('0xe')][_0xbf69('0x39')],'priority':this[_0xbf69('0xe')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0xbf69('0xe')]['dnid'],'projectName':this['channel'][_0xbf69('0x34')],'saveName':_0x3ab9e8,'filename':_0x2fc1d6['file']||_0x3ab9e8,'savePath':_0x452ffd})[_0xbf69('0x12')](function(_0x3d23a2){_0x41d9b0(null,_0x3d23a2);})[_0xbf69('0x14')](function(_0x34df9f){_0x41d9b0(_0x34df9f);});};AGIVertices['prototype'][_0xbf69('0x3a')]=function(_0x38aca5,_0x525fa1,_0x63d062,_0x44ac40,_0x353b9a){this['rpc'][_0xbf69('0x3a')]({'uniqueid':this[_0xbf69('0xe')][_0xbf69('0x37')],'body':_0x38aca5,'direction':_0x525fa1,'providerName':_0x63d062,'providerResponse':_0x44ac40})[_0xbf69('0x12')](function(_0x17dd26){if(_0x353b9a){_0x353b9a(null,_0x17dd26);}})[_0xbf69('0x14')](function(_0x3d3b22){if(_0x353b9a){_0x353b9a(_0x3d3b22);}});};AGIVertices['prototype'][_0xbf69('0x3b')]=function(_0x515f65,_0x5220d1){this[_0xbf69('0xf')][_0xbf69('0x3b')]({'firstName':_[_0xbf69('0x3c')](_0x515f65[_0xbf69('0x13')])||_['isNil'](_0x515f65['name'])?_0xbf69('0x3d')+Math[_0xbf69('0x3e')]():_0x515f65[_0xbf69('0x13')],'lastName':_[_0xbf69('0x3c')](_0x515f65['lastName'])||_[_0xbf69('0x3f')](_0x515f65[_0xbf69('0x40')])?null:_0x515f65[_0xbf69('0x40')],'phone':_0x515f65[_0xbf69('0x41')],'ListId':_0x515f65['list_id'],'scheduledat':_0x515f65[_0xbf69('0x42')],'callbackUniqueid':this[_0xbf69('0xe')]['uniqueid'],'tags':_0xbf69('0x43'),'description':_0xbf69('0x44')+_0x515f65[_0xbf69('0x42')][_0xbf69('0x45')](),'priority':_0x515f65[_0xbf69('0x46')]})[_0xbf69('0x12')](function(_0x2136af){_0x5220d1(null,_0x2136af);})[_0xbf69('0x14')](function(_0x128d0d){_0x5220d1(_0x128d0d);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x47')]=function(_0x55b1d2,_0x39f593){this[_0xbf69('0xf')][_0xbf69('0x48')](_0x55b1d2)[_0xbf69('0x12')](function(_0x29481f){_0x39f593(null,_0x29481f?_0x29481f[_0xbf69('0x13')]:![]);})['catch'](function(_0x303d38){_0x39f593(_0x303d38);});};AGIVertices['prototype'][_0xbf69('0x49')]=function(_0x170e86,_0x528e46,_0x214126){var _0x23b38b={'role':_0xbf69('0x4a')};_0x23b38b[_0x170e86]=this[_0xbf69('0xe')]['callerid'];this[_0xbf69('0xf')][_0xbf69('0x49')](_0x23b38b,_0x528e46,this[_0xbf69('0xe')][_0xbf69('0x37')])[_0xbf69('0x12')](function(_0x432863){_0x214126(null,_[_0xbf69('0x3f')](_0x432863)?![]:!![]);})[_0xbf69('0x14')](function(_0x3406ed){logger[_0xbf69('0x2e')](_0x3406ed);_0x214126(null,![]);});};AGIVertices[_0xbf69('0x15')]['agentUnpause']=function(_0x1244df,_0x3cc6e3){var _0x58389d={'role':_0xbf69('0x4a')};_0x58389d[_0x1244df]=this[_0xbf69('0xe')][_0xbf69('0x35')];this[_0xbf69('0xf')][_0xbf69('0x4b')](_0x58389d)[_0xbf69('0x12')](function(_0x1fd6bb){_0x3cc6e3(null,_['isNil'](_0x1fd6bb)?![]:!![]);})[_0xbf69('0x14')](function(_0xe83e2){logger['error'](_0xe83e2);_0x3cc6e3(null,![]);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x4c')]=function(_0x4874c7,_0x4ce39e){var _0x240d4c={'role':_0xbf69('0x4a')};_0x240d4c[_0x4874c7]=this[_0xbf69('0xe')]['callerid'];this[_0xbf69('0xf')][_0xbf69('0x4c')](_0x240d4c)['then'](function(_0x598b6c){_0x4ce39e(null,_['isNil'](_0x598b6c)?![]:!![]);})['catch'](function(_0x3e7e77){logger['error'](_0x3e7e77);_0x4ce39e(null,![]);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x4d')]=function(_0x338ddc,_0x2ba0d8){var _0x5a3be0={'role':_0xbf69('0x4a')};_0x5a3be0[_0x338ddc]=this[_0xbf69('0xe')]['callerid'];var _0x1313cd=_0x338ddc!=_0xbf69('0x4e')?util[_0xbf69('0x4f')](_0xbf69('0x50'),_0xbf69('0x51'),this['channel'][_0xbf69('0x35')]):undefined;this[_0xbf69('0xf')]['agentLogin'](_0x5a3be0,_0x1313cd)[_0xbf69('0x12')](function(_0x4772b9){_0x2ba0d8(null,_[_0xbf69('0x3f')](_0x4772b9)?![]:!![]);})[_0xbf69('0x14')](function(_0x434d2f){logger[_0xbf69('0x2e')](_0x434d2f);_0x2ba0d8(null,![]);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x52')]=function(_0x3b437d,_0x43b6fe){sh[_0xbf69('0x53')](_[_0xbf69('0x54')](_0x3b437d),function(_0x309695,_0x5452c1){var _0x2a72c9=_0x5452c1[_0xbf69('0x55')](/(\r\n|\n|\r)/gm,'');_0x43b6fe(null,_0x2a72c9);});};AGIVertices['prototype'][_0xbf69('0x56')]=function(_0x334250,_0x4d4040){scripts['googleCloudTTS'](_0x334250[_0xbf69('0x57')],_0x334250[_0xbf69('0x58')]||_0xbf69('0x59'),_0x334250['text'],_0x334250['languageCode']||_0xbf69('0x5a'),_0x334250['ssmlGender']||'MALE',_0x334250[_0xbf69('0x5b')]||_0xbf69('0x5c'))['then'](function(_0x45c1ce){_0x4d4040(null,_0x45c1ce);})['catch'](function(_0x36d742){_0x4d4040(_0x36d742);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x5d')]=function(_0x442d90,_0x41fe74){scripts[_0xbf69('0x5d')](_0x442d90[_0xbf69('0x59')],_0x442d90[_0xbf69('0x5e')]||'en',0x1)['then'](function(_0x389f26){_0x41fe74(null,_0x389f26);})[_0xbf69('0x14')](function(_0xfbfa89){_0x41fe74(_0xfbfa89);});};AGIVertices[_0xbf69('0x15')]['restAPI']=function(_0x4db563,_0x5754ef){var _0x152f29={'uri':_0x4db563[_0xbf69('0x5f')],'method':_0x4db563[_0xbf69('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4db563[_0xbf69('0x61')])===_0xbf69('0x62')&&parseInt(_0x4db563[_0xbf69('0x61')])>=0x1?parseInt(_0x4db563[_0xbf69('0x61')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xbf69('0x63')],_0x152f29[_0xbf69('0x60')][_0xbf69('0x64')]())){try{_0x152f29[_0xbf69('0x65')]=_0x4db563['rawBody']?JSON['parse'](_0x4db563[_0xbf69('0xa')]):{};}catch(_0x170fcb){logger[_0xbf69('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x170fcb);}}try{_0x152f29[_0xbf69('0x66')]=_0x4db563[_0xbf69('0x9')]?JSON['parse'](_0x4db563[_0xbf69('0x9')]):{};}catch(_0x436436){logger[_0xbf69('0x2e')](_0xbf69('0x67'),_0x436436);}if(_0x4db563[_0xbf69('0x68')]){try{var _0x449245=require(_0x4db563[_0xbf69('0x68')])[_0xbf69('0x69')](this,_0x152f29);_0x152f29['uri']=Mustache['render'](_0x4db563[_0xbf69('0x5f')],_0x449245,{},['$$','$$']);if(_0x152f29['headers']){_0x152f29[_0xbf69('0x66')]=JSON[_0xbf69('0x6a')](Mustache[_0xbf69('0x6b')](JSON[_0xbf69('0x6c')](_0x152f29[_0xbf69('0x66')]),_0x449245,{},['$$','$$']));}if(_0x152f29[_0xbf69('0x65')]){_0x152f29[_0xbf69('0x65')]=JSON[_0xbf69('0x6a')](Mustache[_0xbf69('0x6b')](JSON[_0xbf69('0x6c')](_0x152f29[_0xbf69('0x65')]),_0x449245,{},['$$','$$']));}}catch(_0x40ac04){logger['error'](_0xbf69('0x6d'),_0x40ac04);}}rp(_0x152f29)[_0xbf69('0x12')](function(_0x312123){var _0x1d500c={'statusCode':_0x312123['statusCode']||0xc8,'statusMessage':_0x312123[_0xbf69('0x6e')]||'OK','headers':_0x312123['headers']||{},'body':_0x312123['body']||{}};_0x5754ef(null,_0x1d500c);})['catch'](function(_0x42e4ae){var _0x3c4f6e={'statusCode':_0x42e4ae[_0xbf69('0x6f')]||0x1f4,'statusMessage':_0x42e4ae[_0xbf69('0x70')]||_0xbf69('0x71'),'headers':_0x42e4ae[_0xbf69('0x72')][_0xbf69('0x66')]||{},'body':_0x42e4ae[_0xbf69('0x72')][_0xbf69('0x65')]||{}};_0x5754ef(null,_0x3c4f6e);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x73')]=function(_0x5c8a2e,_0x261f39){scripts[_0xbf69('0x73')](this[_0xbf69('0xe')][_0xbf69('0x37')],_0x5c8a2e[_0xbf69('0x74')],_0x5c8a2e[_0xbf69('0x59')],_0x5c8a2e[_0xbf69('0x75')]||'en')['then'](function(_0x1252da){_0x261f39(null,_0x1252da);})[_0xbf69('0x14')](function(_0x1873ef){_0x261f39(_0x1873ef);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x76')]=function(_0x585b53,_0x1b6d45){scripts[_0xbf69('0x76')](this[_0xbf69('0xe')][_0xbf69('0x37')],_0x585b53[_0xbf69('0x77')],_0x585b53[_0xbf69('0x78')],_0x585b53[_0xbf69('0x79')],_0x585b53[_0xbf69('0x59')],_0x585b53[_0xbf69('0x7a')]||'en')['then'](function(_0x530544){_0x1b6d45(null,_0x530544);})['catch'](function(_0x5001b0){_0x1b6d45(_0x5001b0);});};AGIVertices[_0xbf69('0x15')]['sestekNDA']=function(_0x422077,_0x343e9b){scripts[_0xbf69('0x7b')](this[_0xbf69('0xe')],_0x422077)[_0xbf69('0x12')](function(_0xc44824){_0x343e9b(null,_0xc44824);})[_0xbf69('0x14')](function(_0x4e319e){_0x343e9b(_0x4e319e);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x7c')]=function(_0x361f75,_0x2659a9){scripts[_0xbf69('0x7c')](_0x361f75[_0xbf69('0x74')],_0x361f75[_0xbf69('0x59')],_0x361f75[_0xbf69('0x7d')]||_0xbf69('0x5a'),_0x361f75['speed'])[_0xbf69('0x12')](function(_0x4483cf){_0x2659a9(null,_0x4483cf);})[_0xbf69('0x14')](function(_0x321e2f){_0x2659a9(_0x321e2f);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x7e')]=function(_0x57dbbe,_0x4b015f,_0x4d35e3){scripts[_0xbf69('0x7e')](_0x4b015f,_0x57dbbe[_0xbf69('0x74')],_0x57dbbe[_0xbf69('0x7f')]||_0xbf69('0x5a'),this[_0xbf69('0x80')](_0x57dbbe[_0xbf69('0x81')])?_0x57dbbe[_0xbf69('0x81')]:undefined)[_0xbf69('0x12')](function(_0x5b6a56){_0x4d35e3(null,_0x5b6a56);})['catch'](function(_0xde3cb4){_0x4d35e3(_0xde3cb4);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x82')]=function(_0x399151,_0x30296b){scripts['awsPolly'](_0x399151[_0xbf69('0x83')],_0x399151[_0xbf69('0x84')],_0x399151[_0xbf69('0x85')],_0x399151[_0xbf69('0x86')]||'Amy',_0x399151[_0xbf69('0x59')],_0x399151[_0xbf69('0x87')]||'text')['then'](function(_0x52f1b7){_0x30296b(null,_0x52f1b7);})[_0xbf69('0x14')](function(_0x2d6ad9){_0x30296b(_0x2d6ad9);});};AGIVertices[_0xbf69('0x15')]['awsLex']=function(_0x577814,_0x4ae0ad){scripts[_0xbf69('0x88')](this['channel'][_0xbf69('0x37')],_0x577814['aws_access_key_id'],_0x577814['aws_secret_access_key'],_0x577814[_0xbf69('0x89')],_0x577814['text'],_0x577814['aws_bot_name'])['then'](function(_0x8e548b){_0x4ae0ad(null,_0x8e548b);})[_0xbf69('0x14')](function(_0x285ece){_0x4ae0ad(_0x285ece);});};AGIVertices['prototype']['googleASR']=function(_0x30bdd9,_0xf357e,_0x9e1d8a){scripts['googleASR'](_0xf357e,_0x30bdd9['key'],_0x30bdd9[_0xbf69('0x8a')]||_0xbf69('0x5a'))[_0xbf69('0x12')](function(_0x52bf45){_0x9e1d8a(null,_0x52bf45);})[_0xbf69('0x14')](function(_0x4f2387){_0x9e1d8a(_0x4f2387);});};AGIVertices[_0xbf69('0x15')][_0xbf69('0x8b')]=function(_0x8fff4c,_0x5f1752,_0x1d9a51){scripts['tildeASR'](_0x5f1752,_0x8fff4c[_0xbf69('0x8c')],_0x8fff4c[_0xbf69('0x8d')],_0x8fff4c[_0xbf69('0x8e')])[_0xbf69('0x12')](function(_0x2f5f67){_0x1d9a51(null,_0x2f5f67);})['catch'](function(_0x3765c0){_0x1d9a51(_0x3765c0);});};AGIVertices['prototype']['clear']=function(_0x5c1aaf){var _0x149d0f=_[_0xbf69('0x8f')](verticesWithRetry,_0x5c1aaf[_0xbf69('0x90')])?_0x5c1aaf:_[_0xbf69('0x91')](_0x5c1aaf);for(var _0x2b1dcc in _0x149d0f){if(_0x149d0f['hasOwnProperty'](_0x2b1dcc)){if(_0x149d0f[_0x2b1dcc]&&_[_0xbf69('0x92')](_0x149d0f[_0x2b1dcc])){if(_[_0xbf69('0x8f')](recursiveMapAttributes,_0x2b1dcc)){_0x149d0f[_0x2b1dcc]=this[_0xbf69('0x93')](_0x149d0f[_0x2b1dcc]);}else{_0x149d0f[_0x2b1dcc]=this['replaceAllVariables'](_0x149d0f[_0x2b1dcc]);}}}}return _0x149d0f;};AGIVertices['prototype'][_0xbf69('0x94')]=function(_0x478816){for(var _0x16fe7e in _0x478816){if(_0x478816[_0xbf69('0x95')](_0x16fe7e)){if(_[_0xbf69('0x96')](_0x478816[_0x16fe7e])){this[_0xbf69('0x94')](_0x478816[_0x16fe7e]);}else if(_[_0xbf69('0x97')](_0x478816[_0x16fe7e])){for(var _0x3dd1bb=0x0;_0x3dd1bb<_0x478816[_0x16fe7e][_0xbf69('0x98')];_0x3dd1bb++){this['recursiveNodeIndex'](_0x478816[_0x16fe7e][_0x3dd1bb]);}}else if(_['isString'](_0x478816[_0x16fe7e])){_0x478816[_0x16fe7e]=this[_0xbf69('0x99')](_0x478816[_0x16fe7e]);}}}};AGIVertices[_0xbf69('0x15')]['saveRestApiResult']=function(_0x2cc943,_0x548548){for(var _0x4b5b5a in _0x2cc943){if(_0x2cc943[_0xbf69('0x95')](_0x4b5b5a)){if(_['isPlainObject'](_0x2cc943[_0x4b5b5a])){if(!_[_0xbf69('0x3c')](_0x2cc943[_0x4b5b5a])){this[_0xbf69('0x9a')](_0x2cc943[_0x4b5b5a],util[_0xbf69('0x4f')](_0xbf69('0x9b'),_0x548548,_0x4b5b5a));}}else if(_[_0xbf69('0x97')](_0x2cc943[_0x4b5b5a])){for(var _0x1f6dc1=0x0;_0x1f6dc1<_0x2cc943[_0x4b5b5a][_0xbf69('0x98')];_0x1f6dc1++){this['saveRestApiResult'](_0x2cc943[_0x4b5b5a][_0x1f6dc1],util[_0xbf69('0x4f')]('%s.%s',_0x548548,_0x4b5b5a+'['+_0x1f6dc1+']'));}}else{if(!_[_0xbf69('0x3f')](_0x2cc943[_0x4b5b5a])){this['channel'][_0xbf69('0x9c')](util[_0xbf69('0x4f')](_0xbf69('0x9b'),_0x548548,_0x4b5b5a),_0x2cc943[_0x4b5b5a]);}}}}};AGIVertices[_0xbf69('0x15')][_0xbf69('0x93')]=function(_0x44b613){try{var _0x21bb8e=JSON[_0xbf69('0x6a')](_0x44b613);this[_0xbf69('0x94')](_0x21bb8e);return JSON[_0xbf69('0x6c')](_0x21bb8e);}catch(_0x302734){return this['replaceAllVariables'](_0x44b613);}};AGIVertices[_0xbf69('0x15')][_0xbf69('0x99')]=function(_0x55f235){var _0x5aedf4=_0x55f235[_0xbf69('0x9d')]('{');for(var _0xc16a29=0x1;_0xc16a29<_0x5aedf4[_0xbf69('0x98')];_0xc16a29+=0x1){var _0x41f59b=_0x5aedf4[_0xc16a29][_0xbf69('0x9d')]('}');if(_0x41f59b[_0xbf69('0x98')]>0x1){_0x55f235=_0x55f235[_0xbf69('0x9e')]('{'+_0x41f59b[0x0]+'}',this[_0xbf69('0xe')][_0xbf69('0x11')](_0x41f59b[0x0])[_0xbf69('0x9f')]||_0x41f59b[0x0]);}}if(_0x5aedf4[_0xbf69('0x98')]===0x1){return _0x55f235['toString']();}return this[_0xbf69('0x99')](_0x55f235);};AGIVertices[_0xbf69('0x15')][_0xbf69('0xa0')]=function(_0x3e4bc7,_0x29df49){var _0xaa6f24=this[_0xbf69('0xe')][_0xbf69('0x11')](_0x3e4bc7);if(_0xaa6f24['result']===-0x1){return _0xaa6f24;}logger[_0xbf69('0x2a')](util['format'](_0xbf69('0xa1'),_0x29df49,_0xaa6f24[_0xbf69('0x9f')]));return this[_0xbf69('0xe')][_0xbf69('0x9c')](_0x29df49,_0xaa6f24[_0xbf69('0x9f')]);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x80')]=function(_0x507344){return _0x507344&&_0x507344!=='0'&&_0x507344!=='-1'&&_0x507344!=='';};AGIVertices[_0xbf69('0x15')][_0xbf69('0xa2')]=function(_0x133250){this[_0xbf69('0x32')]['sync'](this,_0x133250,'-');_0x133250[_0xbf69('0xa3')]=_0x133250[_0xbf69('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xbf69('0xa4')]=function(_0x1f8667){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xa5'),_0x1f8667[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x1f8667[_0xbf69('0x59')])){return this['channel'][_0xbf69('0xa6')]('no\x20text\x20configured');}var _0x4407bc='\x22'+_0x1f8667[_0xbf69('0x59')]+'\x22';if(this[_0xbf69('0x80')](_0x1f8667[_0xbf69('0x72')])){_0x4407bc+=','+_0x1f8667[_0xbf69('0x72')];}var _0x30d0da=this['channel'][_0xbf69('0x53')]('MRCPSynth',_0x4407bc);if(_0x30d0da[_0xbf69('0xa7')]===-0x1){return _0x30d0da;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4407bc));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xa8')]=function(_0x132f0e){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xa9'),_0x132f0e[_0xbf69('0x33')]));if(!this['isConfigured'](_0x132f0e[_0xbf69('0xaa')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xab'));}var _0xe7f70d=_0x132f0e[_0xbf69('0xaa')];if(this[_0xbf69('0x80')](_0x132f0e[_0xbf69('0x72')])){_0xe7f70d+=','+_0x132f0e['options'];}var _0x4dc572=this['channel'][_0xbf69('0x53')](_0xbf69('0xac'),_0xe7f70d);if(_0x4dc572[_0xbf69('0xa7')]===-0x1){return _0x4dc572;}var _0x436749=this[_0xbf69('0xa0')](_0xbf69('0xad'),_0xbf69('0xae'));if(_0x436749['result']===-0x1){return _0x436749;}var _0x3b7c75=this['getAndSetVariable'](_0xbf69('0xaf'),_0xbf69('0xb0'));if(_0x3b7c75[_0xbf69('0xa7')]===-0x1){return _0x3b7c75;}var _0x2d7c93=this['getAndSetVariable'](_0xbf69('0xb1'),_0xbf69('0xb2'));if(_0x2d7c93[_0xbf69('0xa7')]===-0x1){return _0x2d7c93;}return this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0xb3'),_0xe7f70d));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x5')]=function(_0x1fae17){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1fae17[_0xbf69('0x33')]));return this['channel'][_0xbf69('0x5')]([_0x1fae17[_0xbf69('0xb4')],_0x1fae17[_0xbf69('0xb5')]]);};AGIVertices[_0xbf69('0x15')][_0xbf69('0xb6')]=function(_0x382983){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0xb7'),_0x382983['label']));if(this['isConfigured'](_0x382983[_0xbf69('0x61')])){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0xb8'),_0x382983[_0xbf69('0x61')]));var _0x30c933=this[_0xbf69('0xe')][_0xbf69('0xb9')](_0x382983[_0xbf69('0x61')]);if(_0x30c933[_0xbf69('0xa7')]===-0x1){return _0x30c933;}}return this['channel'][_0xbf69('0xb6')]();};AGIVertices['prototype'][_0xbf69('0x43')]=function(_0x2438f8){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xba'),_0x2438f8[_0xbf69('0x33')]));if(!this['isConfigured'](_0x2438f8['list_id'])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x2438f8,_0xbf69('0xbb'));}_0x2438f8[_0xbf69('0x42')]=moment();if(this[_0xbf69('0x80')](_0x2438f8[_0xbf69('0xbc')])){_0x2438f8[_0xbf69('0x42')]=moment()[_0xbf69('0xbd')](_0x2438f8[_0xbf69('0xbc')],_0xbf69('0xbe'));}if(!this[_0xbf69('0x80')](_0x2438f8[_0xbf69('0x46')])){_0x2438f8[_0xbf69('0x46')]=0x2;}this['createCmContact'][_0xbf69('0x69')](this,_0x2438f8);return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2438f8[_0xbf69('0x41')],_0x2438f8['list_id'],_0x2438f8[_0xbf69('0x42')]));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xbf')]=function(_0x253333){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xc0'),_0x253333['label']));var _0x34d4a0=this[_0xbf69('0xe')][_0xbf69('0x53')](_0x253333[_0xbf69('0xc1')],_0x253333[_0xbf69('0x72')]);if(_0x34d4a0[_0xbf69('0xa7')]===-0x1){return _0x34d4a0;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('Executed\x20command\x20%s\x20%s',_0x253333['application'],_0x253333[_0xbf69('0x72')]));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xc2')]=function(_0x193652){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xc3'),_0x193652[_0xbf69('0x33')]));if(!this['isConfigured'](_0x193652[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xc4'));}var _0x2ceb7e='\x22'+_0x193652['text']+'\x22';if(this[_0xbf69('0x80')](_0x193652[_0xbf69('0x72')])){_0x2ceb7e+=','+_0x193652[_0xbf69('0x72')];}var _0x1b19ab=this[_0xbf69('0xe')]['exec'](_0xbf69('0xc5'),_0x2ceb7e);if(_0x1b19ab[_0xbf69('0xa7')]===-0x1){return _0x1b19ab;}return this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2ceb7e));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xc6')]=function(_0x340d98){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0xc7'),_0x340d98[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x340d98[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')]('no\x20text\x20configured');}var _0x2c0a1a='\x22'+_0x340d98[_0xbf69('0x59')]+'\x22';if(this[_0xbf69('0x80')](_0x340d98[_0xbf69('0x72')])){_0x2c0a1a+=','+_0x340d98[_0xbf69('0x72')];}var _0x1d9375=this[_0xbf69('0xe')][_0xbf69('0x53')](_0xbf69('0xc5'),_0x2c0a1a);if(_0x1d9375[_0xbf69('0xa7')]===-0x1){return _0x1d9375;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2c0a1a));};AGIVertices['prototype'][_0xbf69('0xc8')]=function(_0x424488){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0xc9'),_0x424488[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x424488[_0xbf69('0xaa')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')]('no\x20grammar\x20configured');}var _0x3e352f=_0x424488['grammar'];if(this[_0xbf69('0x80')](_0x424488[_0xbf69('0x72')])){_0x3e352f+=','+_0x424488['options'];}var _0x4061ad=this['channel'][_0xbf69('0x53')](_0xbf69('0xac'),_0x3e352f);if(_0x4061ad['result']===-0x1){return _0x4061ad;}var _0x39463f=this[_0xbf69('0xa0')](_0xbf69('0xad'),_0xbf69('0xca'));if(_0x39463f[_0xbf69('0xa7')]===-0x1){return _0x39463f;}var _0xa78390=this[_0xbf69('0xa0')](_0xbf69('0xaf'),_0xbf69('0xcb'));if(_0xa78390['result']===-0x1){return _0xa78390;}var _0x3a36f0=this[_0xbf69('0xa0')](_0xbf69('0xb1'),_0xbf69('0xcc'));if(_0x3a36f0[_0xbf69('0xa7')]===-0x1){return _0x3a36f0;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0xb3'),_0x3e352f));};AGIVertices['prototype']['sestekasr']=function(_0x289d4d){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xcd'),_0x289d4d[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x289d4d[_0xbf69('0xaa')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xab'));}var _0x2dd996=_0x289d4d['grammar'];if(this[_0xbf69('0x80')](_0x289d4d[_0xbf69('0x72')])){_0x2dd996+=','+_0x289d4d[_0xbf69('0x72')];}var _0x126ec6=this[_0xbf69('0xe')]['exec'](_0xbf69('0xac'),_0x2dd996);if(_0x126ec6['result']===-0x1){return _0x126ec6;}var _0x15824e=this[_0xbf69('0xa0')](_0xbf69('0xad'),_0xbf69('0xce'));if(_0x15824e[_0xbf69('0xa7')]===-0x1){return _0x15824e;}var _0x45d0df=this[_0xbf69('0xa0')](_0xbf69('0xaf'),_0xbf69('0xcf'));if(_0x45d0df[_0xbf69('0xa7')]===-0x1){return _0x45d0df;}var _0x101734=this[_0xbf69('0xa0')](_0xbf69('0xb1'),_0xbf69('0xd0'));if(_0x101734[_0xbf69('0xa7')]===-0x1){return _0x101734;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0xb3'),_0x2dd996));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xd1')]=function(_0x4bbd45){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xd2'),_0x4bbd45[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x4bbd45['odbc_id'])){return this[_0xbf69('0xe')]['error'](_0x4bbd45,_0xbf69('0xd3'));}var _0x24ae2b=this['getSquareOdbc'][_0xbf69('0x69')](this,_0x4bbd45[_0xbf69('0xd4')]);if(!_0x24ae2b){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x4bbd45,_0xbf69('0xd5'));}if(!this['isConfigured'](_0x4bbd45[_0xbf69('0x29')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x4bbd45,_0xbf69('0xd6'));}var _0x14df25=_0x4bbd45[_0xbf69('0x29')][_0xbf69('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('query:\x20%s',_0x14df25));var _0x2dc7a9=this['getQueryOdbc'][_0xbf69('0x69')](this,_0x24ae2b,_0x14df25);this['createSquareDetailsReport'][_0xbf69('0x69')](this,_0x4bbd45,_0x14df25);if(!this[_0xbf69('0x80')](_0x4bbd45[_0xbf69('0xd7')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xd8'));}var _0x4fde9e=this['getVariable'][_0xbf69('0x69')](this,_0x4bbd45[_0xbf69('0xd7')]);if(!_0x4fde9e){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x4bbd45,'no\x20variable\x20found');}var _0x3e6732=this;_0x2dc7a9['forEach'](function(_0xfff2eb,_0x12b1aa){Object['keys'](_0xfff2eb)[_0xbf69('0xd9')](function(_0x4ffff9){_0x3e6732[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')]('%s[%s][%s]',_0x4fde9e,_0x12b1aa,_0x4ffff9),_0xfff2eb[_0x4ffff9]);});});this[_0xbf69('0xe')]['setVariable'](util['format'](_0xbf69('0xda'),_0x4fde9e),_0x2dc7a9[_0xbf69('0x98')]);return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0xdb'),_0x4fde9e));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xdc')]=function(_0x5a79a3){logger[_0xbf69('0xdd')](util[_0xbf69('0x4f')](_0xbf69('0xde'),_0x5a79a3[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x5a79a3[_0xbf69('0xdf')])){return this[_0xbf69('0xe')]['error'](_0x5a79a3,_0xbf69('0xe0'));}var _0x5265dd=this[_0xbf69('0xe1')][_0xbf69('0x69')](this,_0x5a79a3[_0xbf69('0xdf')]);if(!_0x5265dd){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x5a79a3,_0xbf69('0xe2'));}var _0x475b31=this[_0xbf69('0xe')][_0xbf69('0x53')]('DIAL',[util[_0xbf69('0x4f')](_0xbf69('0xe3'),_0x5265dd),_0x5a79a3[_0xbf69('0x61')],_0x5a79a3[_0xbf69('0xe4')],_0x5a79a3[_0xbf69('0x5f')]]);if(_0x475b31['result']===-0x1){return _0x475b31;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('Executed\x20command\x20%s',_0xbf69('0xe5')));};AGIVertices[_0xbf69('0x15')]['dialogflow']=function(_0x28f785){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xe6'),_0x28f785[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x28f785[_0xbf69('0x74')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xe7'));}if(!this[_0xbf69('0x80')](_0x28f785[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')]('no\x20text\x20configured');}this['channel'][_0xbf69('0xe8')]=!![];this['createSquareDetailsReport'](_0x28f785);this['createSquareMessage'](_0x28f785[_0xbf69('0x59')],'in','','');this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0xe9'),_0x28f785[_0xbf69('0x59')]));var _0x12b596=this[_0xbf69('0x73')][_0xbf69('0x69')](this,_0x28f785);if(_0x12b596){for(var _0x184231 in _0x12b596){if(_0x12b596[_0xbf69('0x95')](_0x184231)){this[_0xbf69('0xe')][_0xbf69('0x9c')](util['format'](_0xbf69('0xea'),_0x184231[_0xbf69('0x64')]()),_0x12b596[_0x184231]);}}this['createSquareMessage'](_0x12b596[_0xbf69('0xeb')],_0xbf69('0xec'),_0xbf69('0xed'),'');return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0xee'),_0x12b596[_0xbf69('0xeb')]));}return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x28f785,_0xbf69('0xef'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xf0')]=function(_0x1d5804){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1d5804[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x1d5804['dialogflowV2_project_id'])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0xf1'));}if(!this[_0xbf69('0x80')](_0x1d5804[_0xbf69('0x78')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xf2'));}if(!this[_0xbf69('0x80')](_0x1d5804['private_key'])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xf3'));}if(!this[_0xbf69('0x80')](_0x1d5804['dialogflowV2_language'])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xf4'));}if(!this[_0xbf69('0x80')](_0x1d5804['text'])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xe8')]=!![];this[_0xbf69('0x32')](_0x1d5804);this[_0xbf69('0x3a')](_0x1d5804[_0xbf69('0x59')],'in','','');this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0xf5'),_0x1d5804[_0xbf69('0x59')]));var _0x4b491f=this[_0xbf69('0x76')][_0xbf69('0x69')](this,_0x1d5804);if(_0x4b491f){for(var _0xb15b76 in _0x4b491f){if(_0x4b491f[_0xbf69('0x95')](_0xb15b76)){if(_0xb15b76!=='providerResponse'){this['channel'][_0xbf69('0x9c')](util[_0xbf69('0x4f')](_0xbf69('0xea'),_0xb15b76[_0xbf69('0x64')]()),_0x4b491f[_0xb15b76]);}}}this[_0xbf69('0x3a')](_0x4b491f[_0xbf69('0xeb')],_0xbf69('0xec'),_0xbf69('0xf0'),_0x4b491f[_0xbf69('0xf6')]);return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0xf7'),_0x4b491f[_0xbf69('0xeb')]));}return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1d5804,_0xbf69('0xf8'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0xf9')]=function(_0x4f9fb7){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0xfa'),_0x4f9fb7[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x4f9fb7[_0xbf69('0xfb')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xbf69('0x80')](_0x4f9fb7[_0xbf69('0xfc')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xfd'));}if(!this[_0xbf69('0x80')](_0x4f9fb7[_0xbf69('0xfe')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xff'));}if(!this[_0xbf69('0x80')](_0x4f9fb7['ndassistant_url'])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xe8')]=!![];this[_0xbf69('0x32')](_0x4f9fb7);this[_0xbf69('0x3a')](_0x4f9fb7['text'],'in','','');this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x100'),_0x4f9fb7[_0xbf69('0x59')]));var _0x3d6f4d=this[_0xbf69('0x7b')]['sync'](this,_0x4f9fb7);if(_0x3d6f4d){for(var _0x406fba in _0x3d6f4d){if(_0x3d6f4d[_0xbf69('0x95')](_0x406fba)){this[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')]('SESTEK_NDA_%s',_0x406fba['toUpperCase']()),_0x3d6f4d[_0x406fba]);}}this[_0xbf69('0x3a')](_0x3d6f4d[_0xbf69('0xeb')],'out',_0xbf69('0xf9'),'');if(_0x3d6f4d[_0xbf69('0x101')]){this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x102'),_0x3d6f4d[_0xbf69('0x101')]));var _0x3d9300=this[_0xbf69('0xe')][_0xbf69('0x103')](_0x3d6f4d[_0xbf69('0x101')]);try{fs['unlink'](_0x3d6f4d['audiofile']+_0xbf69('0x104'));}catch(_0x36a1e3){logger[_0xbf69('0x2e')](_0x36a1e3);}return _0x3d9300;}else{return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x105'),_0x3d6f4d[_0xbf69('0xeb')]));}}return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x4f9fb7,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xbf69('0x106')]=function(_0x12eaa4){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20END\x20(%s)\x20block',_0x12eaa4[_0xbf69('0x33')]));return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x106'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x107')]=function(_0x1c8eea){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x108'),_0x1c8eea[_0xbf69('0x33')]));var _0x5d20cd='';if(_0x1c8eea[_0xbf69('0x109')]){if(!this[_0xbf69('0x80')](_0x1c8eea['trunk_id'])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1c8eea,_0xbf69('0x10a'));}else{var _0x5b17c4=parseInt(_0x1c8eea['trunk_id'],0xa);if(isNaN(_0x5b17c4)){_0x5d20cd=_0x1c8eea[_0xbf69('0x109')];}else{_0x5d20cd=this[_0xbf69('0x10b')][_0xbf69('0x69')](this,_0x1c8eea[_0xbf69('0x109')]);if(!_0x5d20cd){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1c8eea,_0xbf69('0x10c'));}}}}else if(_0x1c8eea[_0xbf69('0x10d')]){_0x5d20cd=_0x1c8eea[_0xbf69('0x10d')];}else{return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1c8eea,_0xbf69('0x10a'));}var _0x7b5063=this[_0xbf69('0xe')][_0xbf69('0x53')](_0xbf69('0xe5'),[util[_0xbf69('0x4f')](_0xbf69('0x10e'),_0x5d20cd,_0x1c8eea[_0xbf69('0x41')]),_0x1c8eea[_0xbf69('0x61')],_0x1c8eea[_0xbf69('0xe4')],_0x1c8eea[_0xbf69('0x5f')]]);if(_0x7b5063['result']===-0x1){return _0x7b5063;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x10f'),_0xbf69('0xe5')));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x110')]=function(_0x3ab0fe){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x111'),_0x3ab0fe[_0xbf69('0x33')]));return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x110'));};AGIVertices['prototype'][_0xbf69('0xc')]=function(_0x22f7b0){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x112'),_0x22f7b0['label']));if(_0x22f7b0['retry']===0x0){return this[_0xbf69('0xa2')](_0x22f7b0);}_0x22f7b0[_0xbf69('0xa3')]-=0x1;if(!this[_0xbf69('0x80')](_0x22f7b0['file_id'])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x22f7b0,_0xbf69('0x113'));}var _0x3c4172=this['getSound']['sync'](this,_0x22f7b0[_0xbf69('0x114')]);if(!_0x3c4172){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x22f7b0,'no\x20file\x20audio\x20found');}if(!this[_0xbf69('0x80')](_0x22f7b0['variable_id'])){return this['channel'][_0xbf69('0x2e')](_0xbf69('0xd8'));}var _0x3ca3da=this[_0xbf69('0xe')][_0xbf69('0x115')](_0x3c4172,_0x22f7b0['response'],_0x22f7b0[_0xbf69('0x116')]);var _0x376b8e=_0x3ca3da[_0xbf69('0xa7')]?_0x3ca3da[_0xbf69('0xa7')][_0xbf69('0x45')]():'';logger[_0xbf69('0x2a')]('test',JSON['stringify'](_0x3ca3da));if(_0x3ca3da[_0xbf69('0xa7')]===-0x1){this['createSquareDetailsReport'][_0xbf69('0x69')](this,_0x22f7b0,_0x376b8e);return _0x3ca3da;}else if(_0x3ca3da['extra']==='timeout'){_0x3ca3da[_0xbf69('0xa7')]=_0x376b8e[_0xbf69('0x98')]>=parseInt(_0x22f7b0['mindigit'])?'x':'i';}else{_0x3ca3da['result']=_0x376b8e[_0xbf69('0x98')]>=parseInt(_0x22f7b0[_0xbf69('0x117')])&&_0x376b8e[_0xbf69('0x98')]<=parseInt(_0x22f7b0[_0xbf69('0x116')])?'x':'i';}var _0x19be38=this['getVariable'][_0xbf69('0x69')](this,_0x22f7b0[_0xbf69('0xd7')]);if(!_0x19be38){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x22f7b0,_0xbf69('0x118'));}this[_0xbf69('0xe')][_0xbf69('0x9c')](_0x19be38,_0x376b8e);if(this[_0xbf69('0x80')](_0x22f7b0[_0xbf69('0x119')])){var _0x5977c8=parseInt(_0x22f7b0[_0xbf69('0x119')],0xa);var _0x49f45a=rs[_0xbf69('0x11a')]({'charset':'*','length':_0x5977c8});var _0x5e15fc=_0x376b8e[_0xbf69('0x98')];if(_0x5e15fc>0x0){if(_0x5e15fc>_0x5977c8){this[_0xbf69('0x32')][_0xbf69('0x69')](this,_0x22f7b0,_0x22f7b0[_0xbf69('0x11b')]==='first'?_0x49f45a+_0x376b8e[_0xbf69('0x11c')](_0x5977c8):_0x376b8e['substr'](0x0,_0x5e15fc-_0x5977c8)+_0x49f45a);}else{this[_0xbf69('0x32')]['sync'](this,_0x22f7b0,rs[_0xbf69('0x11a')]({'charset':'*','length':_0x5e15fc}));}}else{this[_0xbf69('0x32')][_0xbf69('0x69')](this,_0x22f7b0,'');}}else{this[_0xbf69('0x32')]['sync'](this,_0x22f7b0,_0x376b8e);}return _0x3ca3da;};AGIVertices[_0xbf69('0x15')][_0xbf69('0xd')]=function(_0x5d3168){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x11d'),_0x5d3168[_0xbf69('0x33')]));return this['getdigits'](_0x5d3168);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x11e')]=function(_0x59c979){logger['info'](util[_0xbf69('0x4f')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x59c979[_0xbf69('0x33')]));this['createSquareDetailsReport']['sync'](this,_0x59c979,_0x59c979[_0xbf69('0x11f')]);return this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x120'),_0x59c979[_0xbf69('0x11f')]));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x121')]=function(_0x19e3f3){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x122'),_0x19e3f3[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x19e3f3[_0xbf69('0x83')])||!this[_0xbf69('0x80')](_0x19e3f3[_0xbf69('0x84')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x123'));}if(!this['isConfigured'](_0x19e3f3[_0xbf69('0x59')])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x124'),_0x19e3f3['text']));var _0x47b252=this[_0xbf69('0x82')][_0xbf69('0x69')](this,_0x19e3f3);if(_0x47b252){this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x125'),_0x47b252));var _0x49d7e0=this[_0xbf69('0xe')][_0xbf69('0x103')](_0x47b252);try{fs[_0xbf69('0x126')](_0x47b252+_0xbf69('0x104'));}catch(_0xafd97a){logger[_0xbf69('0x2e')](_0xafd97a);}return _0x49d7e0;}return this['channel'][_0xbf69('0x2e')](_0x19e3f3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xbf69('0x15')][_0xbf69('0x127')]=function(_0x16c0dc){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x128'),_0x16c0dc[_0xbf69('0x33')]));if(!this['isConfigured'](_0x16c0dc[_0xbf69('0x83')])||!this['isConfigured'](_0x16c0dc['aws_secret_access_key'])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0x123'));}if(!this[_0xbf69('0x80')](_0x16c0dc['aws_bot_name'])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0x129'));}if(!this['isConfigured'](_0x16c0dc[_0xbf69('0x59')])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xe8')]=!![];this[_0xbf69('0x32')](_0x16c0dc);this[_0xbf69('0x3a')](_0x16c0dc[_0xbf69('0x59')],'in','','');this[_0xbf69('0xe')]['noop'](util['format'](_0xbf69('0x12a'),_0x16c0dc['text']));var _0x2d318d=this[_0xbf69('0x88')][_0xbf69('0x69')](this,_0x16c0dc);if(_0x2d318d){for(var _0x20b722 in _0x2d318d){if(_0x2d318d[_0xbf69('0x95')](_0x20b722)&&_['isString'](_0x2d318d[_0x20b722])){this[_0xbf69('0xe')][_0xbf69('0x9c')](util['format'](_0xbf69('0x12b'),_0x20b722['toUpperCase']()),_0x2d318d[_0x20b722]);}}if(_[_0xbf69('0x3f')](_0x2d318d[_0xbf69('0x70')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0x12c'));}else{this['createSquareMessage'](_0x2d318d[_0xbf69('0x70')],'out','amazonlex','');return this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x12d'),_0x2d318d[_0xbf69('0x70')]));}}return this[_0xbf69('0xe')]['error'](_0x16c0dc,_0xbf69('0x12e'));};AGIVertices['prototype'][_0xbf69('0x12f')]=function(_0x34f437){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x34f437[_0xbf69('0x33')],_0x34f437[_0xbf69('0x61')]));if(!this[_0xbf69('0x80')](_0x34f437[_0xbf69('0x74')])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0xe7'));}var _0x3fc439=_0xbf69('0x130');var _0x319f14=util[_0xbf69('0x4f')](_0xbf69('0x131'),FILES_PATH,rs[_0xbf69('0x11a')](0x4));var _0x876fcf=util[_0xbf69('0x4f')](_0xbf69('0x9b'),_0x319f14,_0x3fc439);var _0x40aa04=!![];if(_0x34f437['beep']===_0xbf69('0x132')){_0x40aa04=![];}var _0x38b0c0=this[_0xbf69('0xe')]['recordFile'](_0x319f14,_0x3fc439,_0x34f437['intKey'],_0x34f437['timeout'],undefined,_0x40aa04);if(_0x38b0c0['result']!==-0x1){this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x133'),_0x876fcf));var _0x4bbced=this[_0xbf69('0x134')][_0xbf69('0x69')](this,_0x34f437,_0x876fcf);if(_0x4bbced){for(var _0x59e055 in _0x4bbced){if(_0x4bbced[_0xbf69('0x95')](_0x59e055)){this[_0xbf69('0xe')][_0xbf69('0x9c')](util['format'](_0xbf69('0x135'),_0x59e055[_0xbf69('0x64')]()),_0x4bbced[_0x59e055]);}}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('GoogleASR\x20Result\x20%s',JSON[_0xbf69('0x6c')](_0x4bbced)));}}return _0x38b0c0;};AGIVertices['prototype'][_0xbf69('0x136')]=function(_0x39259f){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x137'),_0x39259f[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x39259f[_0xbf69('0x8c')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x138'));}if(!this[_0xbf69('0x80')](_0x39259f[_0xbf69('0x8d')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0x139'));}var _0x5080c9=_0xbf69('0x130');var _0x9ebd8d=util[_0xbf69('0x4f')](_0xbf69('0x131'),FILES_PATH,rs[_0xbf69('0x11a')](0x4));var _0x4391ef=util[_0xbf69('0x4f')](_0xbf69('0x9b'),_0x9ebd8d,_0x5080c9);var _0x1c7b8c=!![];if(_0x39259f[_0xbf69('0x13a')]===_0xbf69('0x132')){_0x1c7b8c=![];}var _0x38cb81=this[_0xbf69('0xe')]['recordFile'](_0x9ebd8d,_0x5080c9,_0x39259f[_0xbf69('0x13b')],_0x39259f['timeout'],undefined,_0x1c7b8c);if(_0x38cb81[_0xbf69('0xa7')]!==-0x1){this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x13c'),_0x4391ef));var _0x4349cf=this[_0xbf69('0x8b')]['sync'](this,_0x39259f,_0x4391ef);if(_0x4349cf){for(var _0x8e446e in _0x4349cf){if(_0x4349cf['hasOwnProperty'](_0x8e446e)){this[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')](_0xbf69('0x13d'),_0x8e446e[_0xbf69('0x64')]()),_0x4349cf[_0x8e446e]);}}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x13e'),JSON[_0xbf69('0x6c')](_0x4349cf)));}}return _0x38cb81;};AGIVertices['prototype']['gotoc']=function(_0x4db64c){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4db64c[_0xbf69('0x33')]));return this[_0xbf69('0xe')][_0xbf69('0x13f')](_0x4db64c['context'],_0x4db64c[_0xbf69('0x39')],_0x4db64c[_0xbf69('0x140')]);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x141')]=function(_0x24f44d){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x142'),_0x24f44d[_0xbf69('0x33')]));if(!this['isConfigured'](_0x24f44d[_0xbf69('0x143')])){return this['channel'][_0xbf69('0x2e')](_0x24f44d,_0xbf69('0x144'));}try{var _0x485f66=eval(_0x24f44d[_0xbf69('0x143')])?'true':_0xbf69('0x145');this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('EVAL\x20CONDITION\x20%s\x20%s',_0x24f44d['condition'],_0x485f66));return{'code':0xc8,'result':_0x485f66};}catch(_0x19cbc9){return{'code':0xc8,'result':_0xbf69('0x145')};}};AGIVertices[_0xbf69('0x15')]['gotoiftime']=function(_0x263326){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x146'),_0x263326[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x263326[_0xbf69('0x147')])){return this[_0xbf69('0xe')]['error'](_0x263326,_0xbf69('0x148'));}var _0x2aa4d4=this[_0xbf69('0x22')][_0xbf69('0x69')](this,_0x263326[_0xbf69('0x147')]);if(!_0x2aa4d4){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x263326,_0xbf69('0x149'));}for(var _0x2434fc=0x0;_0x2434fc<_0x2aa4d4[_0xbf69('0x98')];_0x2434fc+=0x1){var _0x1c4ef0=this[_0xbf69('0xe')][_0xbf69('0x11')](util['format']('IFTIME(%s?true:false)',_0x2aa4d4[_0x2434fc]));if(_0x1c4ef0[_0xbf69('0xa7')]===-0x1){return _0x1c4ef0;}logger['info'](util['format'](_0xbf69('0x14a'),_0x2aa4d4[_0x2434fc],_0x1c4ef0[_0xbf69('0x9f')]));if(_0x1c4ef0[_0xbf69('0x9f')]==='true'){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x14a'),_0x2aa4d4[_0x2434fc],_0xbf69('0x14b')));this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x14a'),_0x2aa4d4[_0x2434fc],'true'));return{'code':0xc8,'result':_0xbf69('0x14b')};}else{logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x14a'),_0x2aa4d4[_0x2434fc],'false'));this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x14a'),_0x2aa4d4[_0x2434fc],_0xbf69('0x145')));}}return{'code':0xc8,'result':_0xbf69('0x145')};};AGIVertices[_0xbf69('0x15')][_0xbf69('0x14c')]=function(_0x2ca187){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x14d'),_0x2ca187[_0xbf69('0x33')]));return this['channel'][_0xbf69('0x14c')]();};AGIVertices['prototype'][_0xbf69('0x14e')]=function(_0x26b7d5){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x14f'),_0x26b7d5[_0xbf69('0x33')]));if(!this['isConfigured'](_0x26b7d5[_0xbf69('0x74')])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0xe7'));}var _0x19f944=_0xbf69('0x130');var _0x39681a=util[_0xbf69('0x4f')](_0xbf69('0x131'),FILES_PATH,rs[_0xbf69('0x11a')](0x4));var _0x83d02e=util[_0xbf69('0x4f')](_0xbf69('0x9b'),_0x39681a,_0x19f944);var _0x5a414f=!![];if(_0x26b7d5[_0xbf69('0x13a')]==='NOBEEP'){_0x5a414f=![];}var _0x197369=this[_0xbf69('0xe')][_0xbf69('0x150')](_0x39681a,_0x19f944,_0x26b7d5[_0xbf69('0x13b')],_0x26b7d5[_0xbf69('0x61')],undefined,_0x5a414f);if(_0x197369[_0xbf69('0xa7')]!==-0x1){this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x151'),_0x83d02e));var _0x49961c=this['ispeechASR'][_0xbf69('0x69')](this,_0x26b7d5,_0x83d02e);if(_0x49961c){for(var _0x313aec in _0x49961c){if(_0x49961c[_0xbf69('0x95')](_0x313aec)){this[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')]('ISPEECH_ASR_%s',_0x313aec[_0xbf69('0x64')]()),_0x49961c[_0x313aec]);}}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x152'),JSON[_0xbf69('0x6c')](_0x49961c)));}}return _0x197369;};AGIVertices[_0xbf69('0x15')]['ispeechtts']=function(_0x206ee2){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x153'),_0x206ee2['label']));if(!this[_0xbf69('0x80')](_0x206ee2['key'])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xe7'));}if(!this[_0xbf69('0x80')](_0x206ee2[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('Trying\x20ispeech\x20TTS\x20%s',_0x206ee2[_0xbf69('0x59')]));var _0x282471=this[_0xbf69('0x7c')][_0xbf69('0x69')](this,_0x206ee2);if(_0x282471){this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x151'),_0x282471));var _0x21dc2b=this[_0xbf69('0xe')]['streamFile'](_0x282471,_0x206ee2['intKey']);try{fs[_0xbf69('0x126')](_0x282471+'.wav');}catch(_0x2cd702){logger['error'](_0x2cd702);}return _0x21dc2b;}return this[_0xbf69('0xe')]['error'](_0x206ee2,_0xbf69('0x154'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x155')]=function(_0x44276a){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x156'),_0x44276a[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x44276a[_0xbf69('0x157')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x44276a,_0xbf69('0x158'));}logger['info'](util[_0xbf69('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbf69('0xe')][_0xbf69('0x35')],_0x44276a[_0xbf69('0x157')]));var _0x4fc5d9=this[_0xbf69('0x4d')][_0xbf69('0x69')](this,_0x44276a['findBy']);if(_0x4fc5d9){logger['info'](util[_0xbf69('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbf69('0xe')]['callerid'],_0x44276a[_0xbf69('0x157')]));this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x159'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x44276a[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15a')};}else{logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x15b'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x44276a[_0xbf69('0x157')]));this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x15b'),this['channel']['callerid'],_0x44276a[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15c')};}};AGIVertices[_0xbf69('0x15')][_0xbf69('0x15d')]=function(_0x13c7f8){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x15e'),_0x13c7f8[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x13c7f8[_0xbf69('0x157')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x13c7f8,'no\x20find\x20by\x20configured');}logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbf69('0xe')][_0xbf69('0x35')],_0x13c7f8['findBy']));var _0x2660eb=this[_0xbf69('0x4c')][_0xbf69('0x69')](this,_0x13c7f8[_0xbf69('0x157')]);if(_0x2660eb){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x159'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x13c7f8['findBy']));this['channel'][_0xbf69('0xa6')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbf69('0xe')][_0xbf69('0x35')],_0x13c7f8[_0xbf69('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbf69('0xe')][_0xbf69('0x35')],_0x13c7f8[_0xbf69('0x157')]));this[_0xbf69('0xe')]['noop'](util['format'](_0xbf69('0x15b'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x13c7f8[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15c')};}};AGIVertices[_0xbf69('0x15')]['math']=function(_0x567f89){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x15f'),_0x567f89[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x567f89['operation'])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x567f89,_0xbf69('0x160'));}this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x161'),_0x567f89['operation']));var _0x205417=eval(_0x567f89['operation']);if(!this[_0xbf69('0x80')](_0x567f89[_0xbf69('0xd7')])){return this['channel'][_0xbf69('0xa6')](_0xbf69('0xd8'));}var _0x15929a=this['getVariable'][_0xbf69('0x69')](this,_0x567f89[_0xbf69('0xd7')]);if(!_0x15929a){return this['channel'][_0xbf69('0x2e')](_0x567f89,_0xbf69('0x118'));}if(_[_0xbf69('0x97')](_0x205417)){var _0x567feb=this;_0x205417[_0xbf69('0xd9')](function(_0x21e95c,_0x5a9721){_0x567feb[_0xbf69('0xe')][_0xbf69('0x9c')](util['format'](_0xbf69('0x162'),_0x15929a,_0x5a9721),_0x21e95c);});return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x163'),_0x15929a));}else{return this[_0xbf69('0xe')]['setVariable'](_0x15929a,_0x205417);}};AGIVertices[_0xbf69('0x15')][_0xbf69('0xb')]=function(_0x1bf5d0){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x164'),_0x1bf5d0[_0xbf69('0x33')]));if(_0x1bf5d0[_0xbf69('0xa3')]===0x0){return this['maxRetry'](_0x1bf5d0);}_0x1bf5d0[_0xbf69('0xa3')]-=0x1;if(!this[_0xbf69('0x80')](_0x1bf5d0[_0xbf69('0x114')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1bf5d0,_0xbf69('0x113'));}var _0x34de2a=this[_0xbf69('0x1c')]['sync'](this,_0x1bf5d0[_0xbf69('0x114')]);if(!_0x34de2a){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1bf5d0,_0xbf69('0x165'));}var _0x26a8bd=this[_0xbf69('0xe')]['getData'](_0x34de2a,_0x1bf5d0[_0xbf69('0x166')],_0x1bf5d0[_0xbf69('0x167')]);var _0x2ee5aa=_0x26a8bd[_0xbf69('0xa7')];if(_0x26a8bd[_0xbf69('0xa7')]===-0x1){this[_0xbf69('0x32')]['sync'](this,_0x1bf5d0,'-1');return _0x26a8bd;}else if(_0x26a8bd[_0xbf69('0x9f')]==='timeout'){_0x26a8bd['result']=_0x26a8bd[_0xbf69('0xa7')]['length']>0x0?_0x26a8bd[_0xbf69('0xa7')]:'t';}else if(_[_0xbf69('0x3c')](_0x26a8bd[_0xbf69('0xa7')])){_0x26a8bd[_0xbf69('0xa7')]='#';_0x2ee5aa='#';}if(!this[_0xbf69('0x80')](_0x1bf5d0[_0xbf69('0xd7')])){this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xd8'));}else{var _0x5f0db3=this[_0xbf69('0x11')][_0xbf69('0x69')](this,_0x1bf5d0['variable_id']);if(!_0x5f0db3){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x1bf5d0,_0xbf69('0x118'));}this[_0xbf69('0xe')]['setVariable'](_0x5f0db3,_0x2ee5aa);}this[_0xbf69('0x32')][_0xbf69('0x69')](this,_0x1bf5d0,_0x2ee5aa);return _0x26a8bd;};AGIVertices['prototype'][_0xbf69('0xa6')]=function(_0x2cb27a){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x168'),_0x2cb27a['label']));return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0x2cb27a['output']||_0x2cb27a[_0xbf69('0x33')]);};AGIVertices['prototype']['pause']=function(_0x446c31){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x169'),_0x446c31[_0xbf69('0x33')]));if(!this['isConfigured'](_0x446c31[_0xbf69('0x157')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x446c31,_0xbf69('0x158'));}logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbf69('0xe')][_0xbf69('0x35')],_0x446c31[_0xbf69('0x157')]));var _0x3fb7e1=this['getPause'][_0xbf69('0x69')](this,_0x446c31[_0xbf69('0x16a')]);var _0x4c8bcd=this[_0xbf69('0x49')][_0xbf69('0x69')](this,_0x446c31[_0xbf69('0x157')],_0x3fb7e1);if(_0x4c8bcd){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x159'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x446c31[_0xbf69('0x157')]));this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x159'),this['channel'][_0xbf69('0x35')],_0x446c31[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15a')};}else{logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x15b'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x446c31[_0xbf69('0x157')]));this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x159'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x446c31[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15c')};}};AGIVertices[_0xbf69('0x15')]['playback']=function(_0x207b24){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x16b'),_0x207b24['label']));if(!this[_0xbf69('0x80')](_0x207b24[_0xbf69('0x114')])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x207b24,'no\x20file\x20audio\x20selected');}var _0x263d2d=this['getSound'][_0xbf69('0x69')](this,_0x207b24['file_id']);if(!_0x263d2d){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x207b24,_0xbf69('0x165'));}var _0x1e095d=this[_0xbf69('0xe')][_0xbf69('0x53')]('PLAYBACK',[_0x263d2d,_0x207b24[_0xbf69('0xe4')]]);if(_0x1e095d[_0xbf69('0xa7')]===-0x1){return _0x1e095d;}return this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x16c'),_0xbf69('0x16d'),_0x263d2d));};AGIVertices['prototype'][_0xbf69('0x16e')]=function(_0x4864ce){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x16f'),_0x4864ce[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x4864ce['queue_id'])){return this[_0xbf69('0xe')]['error'](_0x4864ce,_0xbf69('0x170'));}var _0x2ae8b7='';var _0x3fb821=parseInt(_0x4864ce['queue_id'],0xa);if(isNaN(_0x3fb821)){_0x2ae8b7=_0x4864ce[_0xbf69('0x171')];}else{_0x2ae8b7=this[_0xbf69('0x172')][_0xbf69('0x69')](this,_0x4864ce[_0xbf69('0x171')]);if(!_0x2ae8b7){return this[_0xbf69('0xe')]['error'](_0x4864ce,'no\x20queue\x20found');}}var _0x53a30b='';if(this[_0xbf69('0x80')](_0x4864ce[_0xbf69('0x114')])){var _0x22cb50=this[_0xbf69('0x1c')][_0xbf69('0x69')](this,_0x4864ce['file_id']);if(_0x22cb50){_0x53a30b=_0x22cb50;}}this[_0xbf69('0x32')][_0xbf69('0x69')](this,_0x4864ce,_0x2ae8b7);if(_0x4864ce[_0xbf69('0xe4')][_0xbf69('0x173')]('x')<0x0){_0x4864ce[_0xbf69('0xe4')]+='x';}if(_0x4864ce['opts'][_0xbf69('0x173')]('X')<0x0){_0x4864ce[_0xbf69('0xe4')]+='X';}this[_0xbf69('0xe')][_0xbf69('0x9c')](_0xbf69('0x174'),_0x2ae8b7?_0x2ae8b7[_0xbf69('0x175')]():'');var _0x1c003d=this['channel']['exec'](_0xbf69('0x176'),[_0x2ae8b7,_0x4864ce['opts'],_0x4864ce[_0xbf69('0x5f')],_0x53a30b,_0x4864ce['timeout'],_0x4864ce[_0xbf69('0x5')],_0x4864ce[_0xbf69('0x177')],_0x4864ce['gosub'],'',_0x4864ce['position']]);if(_0x1c003d[_0xbf69('0xa7')]===-0x1){return _0x1c003d;}return this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x16c'),_0xbf69('0x176'),_0x2ae8b7));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x178')]=function(_0x36e71d){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x179'),_0x36e71d[_0xbf69('0x33')]));var _0x3ac2f5=_0x36e71d['recordingFormat']||_0xbf69('0x130');var _0x4b011a=util[_0xbf69('0x4f')](_0xbf69('0x17a'),this['channel'][_0xbf69('0x37')],rs['generate'](0x5));var _0x2f8b1f=util[_0xbf69('0x4f')](_0xbf69('0x17b'),FILES_PATH,_0x4b011a,_0x3ac2f5);var _0x10851b=util['format'](_0xbf69('0x131'),FILES_PATH,_0x4b011a);this[_0xbf69('0x36')][_0xbf69('0x69')](this,_0x36e71d,_0x4b011a,_0x2f8b1f);this['channel'][_0xbf69('0x9c')](_0xbf69('0x17c'),_0x4b011a);logger['info'](_0xbf69('0x17d'),_0x10851b,_0x3ac2f5,_0x36e71d['escape_digits'],_0x36e71d[_0xbf69('0x61')]);return this[_0xbf69('0xe')][_0xbf69('0x150')](_0x10851b,_0x3ac2f5,_0x36e71d['escape_digits'],_0x36e71d['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x7421fb){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x7421fb[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x7421fb['url'])){return this['channel'][_0xbf69('0xa6')]('no\x20url\x20configured');}var _0x48219c=this[_0xbf69('0x17e')][_0xbf69('0x69')](this,_0x7421fb);logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Response:',util[_0xbf69('0x17f')](_0x48219c,{'showHidden':![],'depth':null})));if(!this[_0xbf69('0x80')](_0x7421fb[_0xbf69('0xd7')])){return this[_0xbf69('0xe')]['noop'](_0xbf69('0x180'));}var _0x54b826=this[_0xbf69('0x11')][_0xbf69('0x69')](this,_0x7421fb[_0xbf69('0xd7')]);if(!_0x54b826){return this['channel'][_0xbf69('0x2e')](_0x7421fb,'no\x20variable\x20found');}this[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')](_0xbf69('0x181'),_0x54b826),_0x48219c[_0xbf69('0x6f')]?_0x48219c['statusCode']:_0xbf69('0x182'));this[_0xbf69('0xe')][_0xbf69('0x9c')](util[_0xbf69('0x4f')]('%s_STATUS_MESSAGE',_0x54b826),_0x48219c['statusMessage']?_0x48219c['statusMessage']:'OK');if(_0x48219c['body']){try{this['saveRestApiResult'](_0x48219c[_0xbf69('0x65')],_0x54b826);}catch(_0x42ac79){logger[_0xbf69('0x2e')](util[_0xbf69('0x4f')](_0xbf69('0x183'),_0x54b826));}}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')]('variable\x20%s\x20set',_0x54b826));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x184')]=function(_0x3475e6){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3475e6[_0xbf69('0x33')]));return this[_0xbf69('0xe')][_0xbf69('0x185')](_0x3475e6[_0xbf69('0x186')][_0xbf69('0x55')](/\s+/g,''),_0x3475e6[_0xbf69('0x187')]);};AGIVertices[_0xbf69('0x15')]['saynumber']=function(_0x5c3b85){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x188'),_0x5c3b85[_0xbf69('0x33')]));return this[_0xbf69('0xe')][_0xbf69('0x189')](_0x5c3b85[_0xbf69('0x62')][_0xbf69('0x55')](/\s+/g,''),_0x5c3b85[_0xbf69('0x187')]);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x18a')]=function(_0x24623c){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x18b'),_0x24623c[_0xbf69('0x33')]));return this['channel']['sayPhonetic'](_0x24623c[_0xbf69('0x59')],_0x24623c['escape_digits']);};AGIVertices[_0xbf69('0x15')][_0xbf69('0x18c')]=function(_0x3fe717){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x18d'),_0x3fe717[_0xbf69('0x33')]));if(!this['isConfigured'](_0x3fe717[_0xbf69('0x18e')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x18f'));}var _0x20ab25=this[_0xbf69('0x20')][_0xbf69('0x69')](this,_0x3fe717['account_id']);if(!_0x20ab25||!_0x20ab25[_0xbf69('0x190')]){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x3fe717,_0xbf69('0x191'));}var _0x3f7d71={'from':util[_0xbf69('0x4f')](_0xbf69('0x192'),_0x20ab25[_0xbf69('0x13')],_0x20ab25['email']||_0x20ab25[_0xbf69('0x190')]['user']),'to':_0x3fe717['to']||'','cc':_0x3fe717['cc']||'','bcc':_0x3fe717[_0xbf69('0x193')]||'','subject':_0x3fe717[_0xbf69('0x194')],'html':_0x3fe717[_0xbf69('0x59')],'text':_0x3fe717[_0xbf69('0x59')]};if(this[_0xbf69('0x80')](_0x3fe717[_0xbf69('0x195')])){}logger['debug'](_0xbf69('0x196'),JSON['stringify'](_0x3f7d71));this[_0xbf69('0x32')]['sync'](this,_0x3fe717,_0x3fe717['account_id']);this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x197'),_0x20ab25[_0xbf69('0x13')]));this[_0xbf69('0x21')][_0xbf69('0x69')](this,_0x20ab25[_0xbf69('0x198')],_0x3f7d71);return this['channel'][_0xbf69('0xa6')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xbf69('0x15')][_0xbf69('0x199')]=function(_0x22aa0f){logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x19a'),_0x22aa0f[_0xbf69('0x33')]));return this[_0xbf69('0xe')]['noop'](_0xbf69('0x19b'));};AGIVertices['prototype'][_0xbf69('0x19c')]=function(_0xee7102){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x19d'),_0xee7102[_0xbf69('0x33')]));if(!this['isConfigured'](_0xee7102[_0xbf69('0x19e')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x19f'));}var _0x5354b5=this['getSmsAccount'][_0xbf69('0x69')](this,_0xee7102[_0xbf69('0x19e')]);if(!_0x5354b5){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0xee7102,_0xbf69('0x1a0'));}var _0x56d2d7={'body':_0xee7102[_0xbf69('0x1a1')],'phone':_0xee7102['to']||'','SmsAccountId':_0x5354b5['id']};logger[_0xbf69('0xdd')](_0xbf69('0x1a2'),JSON['stringify'](_0x56d2d7));this[_0xbf69('0x32')][_0xbf69('0x69')](this,_0xee7102,_0xee7102[_0xbf69('0x19e')]);this['channel'][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x1a3'),_0x5354b5[_0xbf69('0x13')]));this[_0xbf69('0x31')][_0xbf69('0x69')](this,_0x56d2d7);return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x1a4'));};AGIVertices['prototype'][_0xbf69('0x1a5')]=function(_0x38a98c){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x1a6'),_0x38a98c['label']));if(!this[_0xbf69('0x80')](_0x38a98c[_0xbf69('0xd7')])){return this[_0xbf69('0xe')]['error'](_0x38a98c,'no\x20variable\x20selected');}var _0x1f1fff=this[_0xbf69('0x11')]['sync'](this,_0x38a98c['variable_id']);if(!_0x1f1fff){return this[_0xbf69('0xe')]['error'](_0x38a98c,_0xbf69('0x118'));}return this[_0xbf69('0xe')][_0xbf69('0x9c')](_0x1f1fff,_0x38a98c[_0xbf69('0x1a7')]);};AGIVertices['prototype']['start']=function(_0x109bf6){logger[_0xbf69('0x2a')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x109bf6[_0xbf69('0x33')]));this['channel'][_0xbf69('0xa6')]('START\x20CALLY\x20SQUARE');if(_0x109bf6[_0xbf69('0xb6')]===_0xbf69('0x1a8')){this[_0xbf69('0xe')]['noop'](_0xbf69('0x1a9'));return this[_0xbf69('0xe')][_0xbf69('0xb6')]();}return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x1aa'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x1ab')]=function(_0x36bade){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x36bade[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x36bade[_0xbf69('0x1ac')])){return this['channel'][_0xbf69('0x2e')](_0x36bade,_0xbf69('0x1ad'));}var _0x150237=this[_0xbf69('0x16')][_0xbf69('0x69')](this,_0x36bade[_0xbf69('0x1ac')]);if(!this[_0xbf69('0x80')](_0x150237)){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x36bade,util[_0xbf69('0x4f')](_0xbf69('0x1ae'),_0x36bade['project_id']));}if(_0x150237===this['channel'][_0xbf69('0x34')]){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0x36bade,_0xbf69('0x1af'));}this['createSquareDetailsReport'][_0xbf69('0x69')](this,_0x36bade,_0x150237);var _0x56a4b7=this[_0xbf69('0xe')][_0xbf69('0x53')](_0xbf69('0x1b0'),util[_0xbf69('0x4f')](_0xbf69('0x1b1'),config[_0xbf69('0x5')][_0xbf69('0x1b2')]||'127.0.0.1',_0x150237,this[_0xbf69('0xe')][_0xbf69('0x34')]));if(_0x56a4b7[_0xbf69('0xa7')]===-0x1){return _0x56a4b7;}return this['channel']['noop'](util[_0xbf69('0x4f')](_0xbf69('0x16c'),_0xbf69('0x1b0'),_0x150237));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x1b3')]=function(_0x5e6cfa){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5e6cfa[_0xbf69('0x33')]));var _0x3ff59b=this[_0xbf69('0x52')][_0xbf69('0x69')](this,_0x5e6cfa['command']);this['createSquareDetailsReport'][_0xbf69('0x69')](this,_0x5e6cfa,_0x5e6cfa[_0xbf69('0xb4')]);if(this[_0xbf69('0x80')](_0x5e6cfa['variable_id'])){var _0x2ae63e=this[_0xbf69('0x11')]['sync'](this,_0x5e6cfa[_0xbf69('0xd7')]);if(_0x2ae63e){this[_0xbf69('0xe')][_0xbf69('0x9c')](_0x2ae63e,_0x3ff59b);return this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x1b4'),_0x5e6cfa[_0xbf69('0xb4')],_0x2ae63e));}}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format'](_0xbf69('0x1b5'),_0x5e6cfa[_0xbf69('0xb4')]));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x1b6')]=function(_0x44c26f){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x1b7'),_0x44c26f['label']));_0x44c26f['text']=_0x44c26f[_0xbf69('0x59')][_0xbf69('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbf69('0x80')](_0x44c26f[_0xbf69('0x57')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0x1b8'));}if(!this[_0xbf69('0x80')](_0x44c26f[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x1b9'),_0x44c26f[_0xbf69('0x59')]));var _0x4760b3=this[_0xbf69('0x56')][_0xbf69('0x69')](this,_0x44c26f);if(_0x4760b3){this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x1ba'),_0x4760b3));var _0x3fb486=this['channel'][_0xbf69('0x103')](_0x4760b3);try{fs[_0xbf69('0x126')](_0x4760b3+_0xbf69('0x104'));}catch(_0x13add5){logger[_0xbf69('0x2e')](_0x13add5);}return _0x3fb486;}return this['channel'][_0xbf69('0x2e')](_0x44c26f,_0xbf69('0x1bb'));};AGIVertices[_0xbf69('0x15')][_0xbf69('0x1bc')]=function(_0x2174d0){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x1bd'),_0x2174d0[_0xbf69('0x33')]));_0x2174d0[_0xbf69('0x59')]=_0x2174d0[_0xbf69('0x59')][_0xbf69('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbf69('0x80')](_0x2174d0[_0xbf69('0x59')])){return this[_0xbf69('0xe')][_0xbf69('0xa6')](_0xbf69('0xc4'));}this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x1be'),_0x2174d0[_0xbf69('0x59')]));var _0x428242=this[_0xbf69('0x5d')][_0xbf69('0x69')](this,_0x2174d0);if(_0x428242){this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x1bf'),_0x428242));var _0x29026d=this['channel'][_0xbf69('0x103')](_0x428242);try{fs['unlink'](_0x428242+'.wav');}catch(_0x17ad3a){logger[_0xbf69('0x2e')](_0x17ad3a);}return _0x29026d;}return this['channel'][_0xbf69('0x2e')](_0x2174d0,_0xbf69('0x1c0'));};AGIVertices['prototype']['unpause']=function(_0x2b33ae){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x1c1'),_0x2b33ae[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0x2b33ae['findBy'])){return this[_0xbf69('0xe')]['error'](_0x2b33ae,_0xbf69('0x158'));}logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x1c2'),this['channel'][_0xbf69('0x35')],_0x2b33ae[_0xbf69('0x157')]));var _0x339c6e=this[_0xbf69('0x4b')][_0xbf69('0x69')](this,_0x2b33ae['findBy']);if(_0x339c6e){logger[_0xbf69('0x2a')](util['format'](_0xbf69('0x159'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x2b33ae[_0xbf69('0x157')]));this[_0xbf69('0xe')][_0xbf69('0xa6')](util[_0xbf69('0x4f')](_0xbf69('0x159'),this['channel'][_0xbf69('0x35')],_0x2b33ae[_0xbf69('0x157')]));return{'code':0xc8,'result':_0xbf69('0x15a')};}else{logger['info'](util[_0xbf69('0x4f')](_0xbf69('0x15b'),this['channel'][_0xbf69('0x35')],_0x2b33ae['findBy']));this[_0xbf69('0xe')]['noop'](util[_0xbf69('0x4f')](_0xbf69('0x15b'),this[_0xbf69('0xe')][_0xbf69('0x35')],_0x2b33ae['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xbf69('0x1c3')]=function(_0x58cfc0){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x1c4'),_0x58cfc0[_0xbf69('0x33')]));var _0x181897=this[_0xbf69('0xe')][_0xbf69('0x53')](_0xbf69('0x1c5'),[_0x58cfc0[_0xbf69('0x1c6')],_0x58cfc0[_0xbf69('0x72')]]);if(_0x181897[_0xbf69('0xa7')]===-0x1){return _0x181897;}return this[_0xbf69('0xe')][_0xbf69('0xa6')](util['format']('Executed\x20command\x20%s\x20%s',_0xbf69('0x1c5'),_0x58cfc0[_0xbf69('0x1c6')]));};AGIVertices['prototype']['vswitch']=function(_0xd92ec5){logger[_0xbf69('0x2a')](util[_0xbf69('0x4f')](_0xbf69('0x1c7'),_0xd92ec5[_0xbf69('0x33')]));if(!this[_0xbf69('0x80')](_0xd92ec5['variable_id'])){return this[_0xbf69('0xe')][_0xbf69('0x2e')](_0xd92ec5,'no\x20variable\x20selected');}var _0x2c2304=this['getVariable']['sync'](this,_0xd92ec5['variable_id']);if(!_0x2c2304){return this[_0xbf69('0xe')]['error'](_0xd92ec5,_0xbf69('0x118'));}var _0xe2322c=this['channel'][_0xbf69('0x11')](_0x2c2304);return{'code':0xc8,'result':_0xe2322c[_0xbf69('0x9f')]?_0xe2322c['extra']:'-'};};String['prototype'][_0xbf69('0x9e')]=function(_0x5f1331,_0x3365ca){return this[_0xbf69('0x9d')](_0x5f1331)[_0xbf69('0x1c8')](_0x3365ca);};module[_0xbf69('0x1c9')]=AGIVertices; \ No newline at end of file +var _0xc817=['Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','user','bcc','template_id','debug','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getSound','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_lex_region','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','%s.%s','saveRestApiResult','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','sync','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','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','MRCPRecog','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','substr','generate','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','awsLex','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block'];(function(_0x1ea978,_0x2c9450){var _0x5d1a1f=function(_0x3fbc2a){while(--_0x3fbc2a){_0x1ea978['push'](_0x1ea978['shift']());}};_0x5d1a1f(++_0x2c9450);}(_0xc817,0x75));var _0x7c81=function(_0x2c2659,_0xdc83c3){_0x2c2659=_0x2c2659-0x0;var _0x5d262a=_0xc817[_0x2c2659];return _0x5d262a;};'use strict';var fs=require('fs');var util=require(_0x7c81('0x0'));var _=require(_0x7c81('0x1'));var sh=require(_0x7c81('0x2'));var odbc=require(_0x7c81('0x3'))();var rs=require('randomstring');var moment=require(_0x7c81('0x4'));var Mustache=require(_0x7c81('0x5'));var rp=require(_0x7c81('0x6'));var logger=require(_0x7c81('0x7'))(_0x7c81('0x8'));var config=require(_0x7c81('0x9'));var shared=require('../../config/environment/shared');var scripts=require(_0x7c81('0xa'));var FILES_PATH=_0x7c81('0xb');var recursiveMapAttributes=['rawHeaders',_0x7c81('0xc')];var verticesWithRetry=[_0x7c81('0xd'),'getdigits',_0x7c81('0xe')];var AGIVertices=function(_0x210481,_0x813846,_0x3845f0){this[_0x7c81('0xf')]=_0x210481;this['rpc']=_0x813846;this[_0x7c81('0x10')]=_0x3845f0;};AGIVertices[_0x7c81('0x11')][_0x7c81('0x12')]=function(_0x323e76,_0x3bd047){this[_0x7c81('0x13')][_0x7c81('0x14')](_0x323e76)[_0x7c81('0x15')](function(_0x1d13ee){_0x3bd047(null,_0x1d13ee?_0x1d13ee[_0x7c81('0x16')]:![]);})[_0x7c81('0x17')](function(_0x1f7b5c){_0x3bd047(_0x1f7b5c);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x18')]=function(_0x2c4434,_0xebb73){this[_0x7c81('0x13')][_0x7c81('0x19')](_0x2c4434)[_0x7c81('0x15')](function(_0x5ed7d7){_0xebb73(null,_0x5ed7d7?_0x5ed7d7[_0x7c81('0x16')]:![]);})[_0x7c81('0x17')](function(_0x2f3de2){_0xebb73(_0x2f3de2);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1a')]=function(_0x11e06f,_0x46a745){this[_0x7c81('0x13')][_0x7c81('0x1b')](_0x11e06f)['then'](function(_0x14cce5){_0x46a745(null,_0x14cce5?_0x14cce5[_0x7c81('0x16')]:![]);})[_0x7c81('0x17')](function(_0x182a2e){_0x46a745(_0x182a2e);});};AGIVertices['prototype'][_0x7c81('0x1c')]=function(_0x2e2b44,_0x3fc314){this[_0x7c81('0x13')][_0x7c81('0x1d')](_0x2e2b44)['then'](function(_0x679b81){_0x3fc314(null,_0x679b81?_0x679b81[_0x7c81('0x1e')]:![]);})[_0x7c81('0x17')](function(_0x35761d){_0x3fc314(_0x35761d);});};AGIVertices[_0x7c81('0x11')]['getUser']=function(_0x887753,_0x198390){this[_0x7c81('0x13')][_0x7c81('0x1f')](_0x887753)['then'](function(_0x3bdca5){_0x198390(null,_0x3bdca5?_0x3bdca5[_0x7c81('0x16')]:![]);})['catch'](function(_0x53f49c){_0x198390(_0x53f49c);});};AGIVertices[_0x7c81('0x11')]['getTrunk']=function(_0x4a01fb,_0x587614){this[_0x7c81('0x13')]['getTrunkById'](_0x4a01fb)[_0x7c81('0x15')](function(_0x103c54){_0x587614(null,_0x103c54?_0x103c54[_0x7c81('0x16')]:![]);})['catch'](function(_0xaedec){_0x587614(_0xaedec);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x20')]=function(_0x26e2bc,_0x1645bf){var _0x4131b6=this;this['rpc'][_0x7c81('0x21')](_0x26e2bc)['then'](function(_0x2089c4){_0x1645bf(null,_0x2089c4?_0x4131b6['getSoundPath'](_0x2089c4[_0x7c81('0x22')]):![]);})[_0x7c81('0x17')](function(_0x1bcde9){_0x1645bf(_0x1bcde9);});};AGIVertices['prototype'][_0x7c81('0x23')]=function(_0x53a4d0,_0x527be1){this[_0x7c81('0x13')]['getMailAccountById'](_0x53a4d0)['then'](function(_0x11efe4){_0x527be1(null,_0x11efe4?_0x11efe4:![]);})[_0x7c81('0x17')](function(_0x974b37){_0x527be1(_0x974b37);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x24')]=function(_0x27d86f,_0x46e553,_0x24d34e){this['mailRpc'][_0x7c81('0x24')](_0x27d86f,_0x46e553)[_0x7c81('0x15')](function(){_0x24d34e(null);})['catch'](function(_0x29332d){_0x24d34e(_0x29332d);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x25')]=function(_0x59f8d3,_0x165f90){this[_0x7c81('0x13')][_0x7c81('0x26')](_0x59f8d3)[_0x7c81('0x15')](function(_0x40f035){if(_0x40f035){if(_0x40f035[_0x7c81('0x27')]){_0x165f90(null,[_0x40f035[_0x7c81('0x28')]]);}else{_0x165f90(null,_[_0x7c81('0x29')](_0x40f035[_0x7c81('0x2a')],_0x7c81('0x28')));}}else{_0x165f90(null,![]);}})[_0x7c81('0x17')](function(_0x2cebf1){_0x165f90(_0x2cebf1);});};AGIVertices[_0x7c81('0x11')]['getSoundPath']=function(_0x33717e){return util[_0x7c81('0x2b')](_0x7c81('0x2c'),FILES_PATH,_0x33717e);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x2d')]=function(_0x4f5599,_0x5ea728,_0x1a175b){odbc[_0x7c81('0x2e')](_0x4f5599,function(_0x397a61){if(_0x397a61){logger[_0x7c81('0x2f')](_0x7c81('0x30'),_0x397a61);_0x1a175b(_0x397a61);}else{logger['info'](_0x7c81('0x31'));odbc[_0x7c81('0x32')](_0x5ea728,function(_0x39438d,_0x5b2d87){if(_0x39438d){logger[_0x7c81('0x33')](_0x7c81('0x34'),_0x5ea728);_0x1a175b(_0x39438d);}else{logger[_0x7c81('0x33')]('Query\x20executed\x20correctly\x20%s',_0x5ea728);odbc[_0x7c81('0x35')](function(_0x35013d){if(_0x35013d){logger['error'](_0x7c81('0x36'),_0x35013d);}_0x1a175b(null,_0x5b2d87);});}});}});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x37')]=function(_0x12873b,_0x5d4f3b){this[_0x7c81('0x13')][_0x7c81('0x38')](_0x12873b)['then'](function(_0x1a10ee){_0x5d4f3b(null,_0x1a10ee?_0x1a10ee:![]);})[_0x7c81('0x17')](function(_0x415c30){_0x5d4f3b(_0x415c30);});};AGIVertices['prototype']['createSmsMessage']=function(_0x3aca34,_0x5ae31c){this[_0x7c81('0x13')][_0x7c81('0x39')](_0x3aca34)[_0x7c81('0x15')](function(_0x1757e9){_0x5ae31c(null,_0x1757e9);})['catch'](function(_0x10260e){_0x5ae31c(_0x10260e);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x3a')]=function(_0x341a8c,_0x215323,_0x5987cd){this[_0x7c81('0x13')][_0x7c81('0x3a')]({'uniqueid':this[_0x7c81('0xf')][_0x7c81('0x3b')],'node':_0x341a8c[_0x7c81('0x3c')],'application':_0x341a8c['agicommand'],'data':_0x215323||null,'project_name':this[_0x7c81('0xf')][_0x7c81('0x3d')],'callerid':this[_0x7c81('0xf')]['callerid']})[_0x7c81('0x15')](function(_0x1aa752){if(_0x5987cd){_0x5987cd(null,_0x1aa752);}})['catch'](function(_0x54367c){if(_0x5987cd){_0x5987cd(_0x54367c);}});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x3e')]=function(_0x2b6bea,_0x153600,_0x3b8ee1,_0x372119){this[_0x7c81('0x13')]['createSquareRecording']({'uniqueid':this[_0x7c81('0xf')]['uniqueid'],'callerid':this[_0x7c81('0xf')][_0x7c81('0x3f')],'calleridname':this[_0x7c81('0xf')][_0x7c81('0x40')],'context':this[_0x7c81('0xf')][_0x7c81('0x41')],'extension':this[_0x7c81('0xf')][_0x7c81('0x42')],'priority':this[_0x7c81('0xf')][_0x7c81('0x43')],'accountcode':this[_0x7c81('0xf')][_0x7c81('0x44')],'dnid':this[_0x7c81('0xf')][_0x7c81('0x45')],'projectName':this[_0x7c81('0xf')][_0x7c81('0x3d')],'saveName':_0x153600,'filename':_0x2b6bea['file']||_0x153600,'savePath':_0x3b8ee1})[_0x7c81('0x15')](function(_0x4c578c){_0x372119(null,_0x4c578c);})[_0x7c81('0x17')](function(_0x264558){_0x372119(_0x264558);});};AGIVertices[_0x7c81('0x11')]['createSquareMessage']=function(_0x588fe4,_0x2b4630,_0x5b3131,_0x2c2684,_0x215272){this[_0x7c81('0x13')][_0x7c81('0x46')]({'uniqueid':this[_0x7c81('0xf')][_0x7c81('0x3b')],'body':_0x588fe4,'direction':_0x2b4630,'providerName':_0x5b3131,'providerResponse':_0x2c2684})[_0x7c81('0x15')](function(_0x4f7102){if(_0x215272){_0x215272(null,_0x4f7102);}})[_0x7c81('0x17')](function(_0x2e03d2){if(_0x215272){_0x215272(_0x2e03d2);}});};AGIVertices['prototype'][_0x7c81('0x47')]=function(_0x5d38fd,_0x52445d){this[_0x7c81('0x13')][_0x7c81('0x47')]({'firstName':_[_0x7c81('0x48')](_0x5d38fd[_0x7c81('0x16')])||_[_0x7c81('0x49')](_0x5d38fd['name'])?_0x7c81('0x4a')+Math['random']():_0x5d38fd[_0x7c81('0x16')],'lastName':_[_0x7c81('0x48')](_0x5d38fd[_0x7c81('0x4b')])||_[_0x7c81('0x49')](_0x5d38fd[_0x7c81('0x4b')])?null:_0x5d38fd['lastName'],'phone':_0x5d38fd['phone'],'ListId':_0x5d38fd[_0x7c81('0x4c')],'scheduledat':_0x5d38fd[_0x7c81('0x4d')],'callbackUniqueid':this[_0x7c81('0xf')]['uniqueid'],'tags':_0x7c81('0x4e'),'description':'Callback\x20scheduled\x20at\x20'+_0x5d38fd[_0x7c81('0x4d')]['toString'](),'priority':_0x5d38fd[_0x7c81('0x4f')]})[_0x7c81('0x15')](function(_0x494d1b){_0x52445d(null,_0x494d1b);})[_0x7c81('0x17')](function(_0x4f9b33){_0x52445d(_0x4f9b33);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x50')]=function(_0x1c7d66,_0xfdf887){this[_0x7c81('0x13')][_0x7c81('0x51')](_0x1c7d66)[_0x7c81('0x15')](function(_0x8cabff){_0xfdf887(null,_0x8cabff?_0x8cabff[_0x7c81('0x16')]:![]);})[_0x7c81('0x17')](function(_0x5b323a){_0xfdf887(_0x5b323a);});};AGIVertices[_0x7c81('0x11')]['agentPause']=function(_0x5870c2,_0x12950e,_0x484ab8){var _0x53d546={'role':'agent'};_0x53d546[_0x5870c2]=this[_0x7c81('0xf')][_0x7c81('0x3f')];this['rpc'][_0x7c81('0x52')](_0x53d546,_0x12950e,this['channel']['uniqueid'])['then'](function(_0x2ad182){_0x484ab8(null,_[_0x7c81('0x49')](_0x2ad182)?![]:!![]);})['catch'](function(_0x3a5fd2){logger[_0x7c81('0x2f')](_0x3a5fd2);_0x484ab8(null,![]);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x53')]=function(_0x388dd2,_0x3d2913){var _0x50b481={'role':_0x7c81('0x54')};_0x50b481[_0x388dd2]=this[_0x7c81('0xf')][_0x7c81('0x3f')];this[_0x7c81('0x13')]['agentUnpause'](_0x50b481)[_0x7c81('0x15')](function(_0x2a4ef8){_0x3d2913(null,_[_0x7c81('0x49')](_0x2a4ef8)?![]:!![]);})[_0x7c81('0x17')](function(_0x3cbf23){logger['error'](_0x3cbf23);_0x3d2913(null,![]);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x55')]=function(_0x485d97,_0x5b5515){var _0x2017df={'role':_0x7c81('0x54')};_0x2017df[_0x485d97]=this[_0x7c81('0xf')][_0x7c81('0x3f')];this[_0x7c81('0x13')][_0x7c81('0x55')](_0x2017df)[_0x7c81('0x15')](function(_0x35484a){_0x5b5515(null,_[_0x7c81('0x49')](_0x35484a)?![]:!![]);})[_0x7c81('0x17')](function(_0x6a461f){logger[_0x7c81('0x2f')](_0x6a461f);_0x5b5515(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x3a9e2f,_0x272099){var _0x2b2a47={'role':_0x7c81('0x54')};_0x2b2a47[_0x3a9e2f]=this[_0x7c81('0xf')][_0x7c81('0x3f')];var _0x2fe611=_0x3a9e2f!=_0x7c81('0x56')?util[_0x7c81('0x2b')](_0x7c81('0x57'),_0x7c81('0x58'),this[_0x7c81('0xf')][_0x7c81('0x3f')]):undefined;this[_0x7c81('0x13')]['agentLogin'](_0x2b2a47,_0x2fe611)['then'](function(_0xbdbb6c){_0x272099(null,_[_0x7c81('0x49')](_0xbdbb6c)?![]:!![]);})['catch'](function(_0x361b9b){logger['error'](_0x361b9b);_0x272099(null,![]);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x59')]=function(_0x57181c,_0xfe0d90){sh[_0x7c81('0x5a')](_[_0x7c81('0x5b')](_0x57181c),function(_0x262b83,_0x370ab7){var _0x97b430=_0x370ab7[_0x7c81('0x5c')](/(\r\n|\n|\r)/gm,'');_0xfe0d90(null,_0x97b430);});};AGIVertices['prototype'][_0x7c81('0x5d')]=function(_0x19fd10,_0x37cebf){scripts['googleCloudTTS'](_0x19fd10[_0x7c81('0x5e')],_0x19fd10[_0x7c81('0x5f')]||_0x7c81('0x60'),_0x19fd10[_0x7c81('0x60')],_0x19fd10[_0x7c81('0x61')]||_0x7c81('0x62'),_0x19fd10[_0x7c81('0x63')]||'MALE',_0x19fd10[_0x7c81('0x64')]||'MP3')['then'](function(_0x5b97f3){_0x37cebf(null,_0x5b97f3);})[_0x7c81('0x17')](function(_0x489921){_0x37cebf(_0x489921);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x65')]=function(_0x500771,_0x10d7c){scripts[_0x7c81('0x65')](_0x500771[_0x7c81('0x60')],_0x500771[_0x7c81('0x66')]||'en',0x1)[_0x7c81('0x15')](function(_0x57921a){_0x10d7c(null,_0x57921a);})['catch'](function(_0x56a996){_0x10d7c(_0x56a996);});};AGIVertices['prototype'][_0x7c81('0x67')]=function(_0x1fe22f,_0x179e0b){var _0x15c4a7={'uri':_0x1fe22f[_0x7c81('0x68')],'method':_0x1fe22f[_0x7c81('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1fe22f[_0x7c81('0x6a')])===_0x7c81('0x6b')&&parseInt(_0x1fe22f[_0x7c81('0x6a')])>=0x1?parseInt(_0x1fe22f[_0x7c81('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0x7c81('0x6c')]([_0x7c81('0x6d'),'PUT'],_0x15c4a7[_0x7c81('0x69')][_0x7c81('0x6e')]())){try{_0x15c4a7[_0x7c81('0x6f')]=_0x1fe22f[_0x7c81('0xc')]?JSON[_0x7c81('0x70')](_0x1fe22f[_0x7c81('0xc')]):{};}catch(_0x418857){logger[_0x7c81('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x418857);}}try{_0x15c4a7[_0x7c81('0x71')]=_0x1fe22f[_0x7c81('0x72')]?JSON[_0x7c81('0x70')](_0x1fe22f[_0x7c81('0x72')]):{};}catch(_0x2bbe11){logger[_0x7c81('0x2f')](_0x7c81('0x73'),_0x2bbe11);}if(_0x1fe22f[_0x7c81('0x74')]){try{var _0x74353d=require(_0x1fe22f[_0x7c81('0x74')])['sync'](this,_0x15c4a7);_0x15c4a7[_0x7c81('0x75')]=Mustache['render'](_0x1fe22f[_0x7c81('0x68')],_0x74353d,{},['$$','$$']);if(_0x15c4a7[_0x7c81('0x71')]){_0x15c4a7['headers']=JSON[_0x7c81('0x70')](Mustache[_0x7c81('0x76')](JSON['stringify'](_0x15c4a7[_0x7c81('0x71')]),_0x74353d,{},['$$','$$']));}if(_0x15c4a7[_0x7c81('0x6f')]){_0x15c4a7['body']=JSON['parse'](Mustache[_0x7c81('0x76')](JSON[_0x7c81('0x77')](_0x15c4a7[_0x7c81('0x6f')]),_0x74353d,{},['$$','$$']));}}catch(_0x360ae9){logger[_0x7c81('0x2f')](_0x7c81('0x78'),_0x360ae9);}}rp(_0x15c4a7)[_0x7c81('0x15')](function(_0x451878){var _0xbf5ea={'statusCode':_0x451878[_0x7c81('0x79')]||0xc8,'statusMessage':_0x451878[_0x7c81('0x7a')]||'OK','headers':_0x451878[_0x7c81('0x71')]||{},'body':_0x451878[_0x7c81('0x6f')]||{}};_0x179e0b(null,_0xbf5ea);})[_0x7c81('0x17')](function(_0xe49da9){var _0x2087e5={'statusCode':_0xe49da9[_0x7c81('0x79')]||0x1f4,'statusMessage':_0xe49da9['message']||_0x7c81('0x7b'),'headers':_0xe49da9[_0x7c81('0x7c')][_0x7c81('0x71')]||{},'body':_0xe49da9[_0x7c81('0x7c')]['body']||{}};_0x179e0b(null,_0x2087e5);});};AGIVertices['prototype'][_0x7c81('0x7d')]=function(_0x75b623,_0x427be7){scripts['googleDialogflow'](this[_0x7c81('0xf')][_0x7c81('0x3b')],_0x75b623['key'],_0x75b623[_0x7c81('0x60')],_0x75b623['dialogflow_language']||'en')[_0x7c81('0x15')](function(_0x2c4f8f){_0x427be7(null,_0x2c4f8f);})[_0x7c81('0x17')](function(_0x374680){_0x427be7(_0x374680);});};AGIVertices[_0x7c81('0x11')]['googleDialogflowV2']=function(_0xaae1b8,_0x1e1290){scripts[_0x7c81('0x7e')](this[_0x7c81('0xf')][_0x7c81('0x3b')],_0xaae1b8[_0x7c81('0x7f')],_0xaae1b8[_0x7c81('0x80')],_0xaae1b8['private_key'],_0xaae1b8[_0x7c81('0x60')],_0xaae1b8[_0x7c81('0x81')]||'en')['then'](function(_0x5c2b2b){_0x1e1290(null,_0x5c2b2b);})[_0x7c81('0x17')](function(_0x460973){_0x1e1290(_0x460973);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x82')]=function(_0x1ac242,_0x6b36b9){scripts['sestekNDA'](this[_0x7c81('0xf')],_0x1ac242)[_0x7c81('0x15')](function(_0x475c2c){_0x6b36b9(null,_0x475c2c);})[_0x7c81('0x17')](function(_0x1a00f1){_0x6b36b9(_0x1a00f1);});};AGIVertices['prototype'][_0x7c81('0x83')]=function(_0x17673a,_0x11ae8b){scripts[_0x7c81('0x83')](_0x17673a[_0x7c81('0x84')],_0x17673a[_0x7c81('0x60')],_0x17673a[_0x7c81('0x85')]||_0x7c81('0x62'),_0x17673a[_0x7c81('0x86')])['then'](function(_0x39d3ba){_0x11ae8b(null,_0x39d3ba);})[_0x7c81('0x17')](function(_0x4bc2f9){_0x11ae8b(_0x4bc2f9);});};AGIVertices[_0x7c81('0x11')]['ispeechASR']=function(_0x35c10f,_0x1c3408,_0x416e38){scripts[_0x7c81('0x87')](_0x1c3408,_0x35c10f['key'],_0x35c10f[_0x7c81('0x88')]||_0x7c81('0x62'),this[_0x7c81('0x89')](_0x35c10f[_0x7c81('0x8a')])?_0x35c10f['model']:undefined)[_0x7c81('0x15')](function(_0x4e7f11){_0x416e38(null,_0x4e7f11);})[_0x7c81('0x17')](function(_0x43cdd3){_0x416e38(_0x43cdd3);});};AGIVertices[_0x7c81('0x11')]['awsPolly']=function(_0x3df9e4,_0x53e60c){scripts[_0x7c81('0x8b')](_0x3df9e4[_0x7c81('0x8c')],_0x3df9e4[_0x7c81('0x8d')],_0x3df9e4['aws_polly_region'],_0x3df9e4['aws_polly_voice']||_0x7c81('0x8e'),_0x3df9e4['text'],_0x3df9e4['aws_text_type']||'text')[_0x7c81('0x15')](function(_0x4d412e){_0x53e60c(null,_0x4d412e);})[_0x7c81('0x17')](function(_0x3d78cc){_0x53e60c(_0x3d78cc);});};AGIVertices[_0x7c81('0x11')]['awsLex']=function(_0x3bee7e,_0x5e05b0){scripts['awsLex'](this['channel'][_0x7c81('0x3b')],_0x3bee7e[_0x7c81('0x8c')],_0x3bee7e[_0x7c81('0x8d')],_0x3bee7e[_0x7c81('0x8f')],_0x3bee7e[_0x7c81('0x60')],_0x3bee7e['aws_bot_name'])[_0x7c81('0x15')](function(_0x45cd9b){_0x5e05b0(null,_0x45cd9b);})['catch'](function(_0x5553f6){_0x5e05b0(_0x5553f6);});};AGIVertices[_0x7c81('0x11')]['googleASR']=function(_0xcbbb09,_0x38efc6,_0x359555){scripts['googleASR'](_0x38efc6,_0xcbbb09[_0x7c81('0x84')],_0xcbbb09[_0x7c81('0x90')]||'en-US')[_0x7c81('0x15')](function(_0xd6bf49){_0x359555(null,_0xd6bf49);})['catch'](function(_0x4ecfa5){_0x359555(_0x4ecfa5);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x91')]=function(_0x582710,_0x3ae158,_0x38fcc9){scripts['tildeASR'](_0x3ae158,_0x582710[_0x7c81('0x92')],_0x582710[_0x7c81('0x93')],_0x582710[_0x7c81('0x75')])[_0x7c81('0x15')](function(_0x5d413e){_0x38fcc9(null,_0x5d413e);})['catch'](function(_0x20676f){_0x38fcc9(_0x20676f);});};AGIVertices[_0x7c81('0x11')][_0x7c81('0x94')]=function(_0x48c679){var _0xdf475a=_[_0x7c81('0x6c')](verticesWithRetry,_0x48c679[_0x7c81('0x95')])?_0x48c679:_[_0x7c81('0x96')](_0x48c679);for(var _0x2d38d7 in _0xdf475a){if(_0xdf475a[_0x7c81('0x97')](_0x2d38d7)){if(_0xdf475a[_0x2d38d7]&&_['isString'](_0xdf475a[_0x2d38d7])){if(_[_0x7c81('0x6c')](recursiveMapAttributes,_0x2d38d7)){_0xdf475a[_0x2d38d7]=this[_0x7c81('0x98')](_0xdf475a[_0x2d38d7]);}else{_0xdf475a[_0x2d38d7]=this[_0x7c81('0x99')](_0xdf475a[_0x2d38d7]);}}}}return _0xdf475a;};AGIVertices[_0x7c81('0x11')][_0x7c81('0x9a')]=function(_0x513bb5){for(var _0x2471b5 in _0x513bb5){if(_0x513bb5[_0x7c81('0x97')](_0x2471b5)){if(_[_0x7c81('0x9b')](_0x513bb5[_0x2471b5])){this[_0x7c81('0x9a')](_0x513bb5[_0x2471b5]);}else if(_[_0x7c81('0x9c')](_0x513bb5[_0x2471b5])){for(var _0xc6a1fd=0x0;_0xc6a1fd<_0x513bb5[_0x2471b5][_0x7c81('0x9d')];_0xc6a1fd++){this[_0x7c81('0x9a')](_0x513bb5[_0x2471b5][_0xc6a1fd]);}}else if(_[_0x7c81('0x9e')](_0x513bb5[_0x2471b5])){_0x513bb5[_0x2471b5]=this[_0x7c81('0x99')](_0x513bb5[_0x2471b5]);}}}};AGIVertices[_0x7c81('0x11')]['saveRestApiResult']=function(_0x515db8,_0x853aad){for(var _0x55d92f in _0x515db8){if(_0x515db8[_0x7c81('0x97')](_0x55d92f)){if(_['isPlainObject'](_0x515db8[_0x55d92f])){if(!_['isEmpty'](_0x515db8[_0x55d92f])){this['saveRestApiResult'](_0x515db8[_0x55d92f],util[_0x7c81('0x2b')](_0x7c81('0x9f'),_0x853aad,_0x55d92f));}}else if(_[_0x7c81('0x9c')](_0x515db8[_0x55d92f])){for(var _0x1c4e8a=0x0;_0x1c4e8a<_0x515db8[_0x55d92f][_0x7c81('0x9d')];_0x1c4e8a++){this[_0x7c81('0xa0')](_0x515db8[_0x55d92f][_0x1c4e8a],util[_0x7c81('0x2b')](_0x7c81('0x9f'),_0x853aad,_0x55d92f+'['+_0x1c4e8a+']'));}}else{if(!_['isNil'](_0x515db8[_0x55d92f])){this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')]('%s.%s',_0x853aad,_0x55d92f),_0x515db8[_0x55d92f]);}}}}};AGIVertices[_0x7c81('0x11')][_0x7c81('0x98')]=function(_0x57cf7f){try{var _0x20627a=JSON[_0x7c81('0x70')](_0x57cf7f);this['recursiveNodeIndex'](_0x20627a);return JSON['stringify'](_0x20627a);}catch(_0x554e0a){return this[_0x7c81('0x99')](_0x57cf7f);}};AGIVertices[_0x7c81('0x11')][_0x7c81('0x99')]=function(_0x5b31c1){var _0x39c4e0=_0x5b31c1['split']('{');for(var _0x567cce=0x1;_0x567cce<_0x39c4e0[_0x7c81('0x9d')];_0x567cce+=0x1){var _0x4497a6=_0x39c4e0[_0x567cce][_0x7c81('0xa2')]('}');if(_0x4497a6[_0x7c81('0x9d')]>0x1){_0x5b31c1=_0x5b31c1[_0x7c81('0xa3')]('{'+_0x4497a6[0x0]+'}',this['channel']['getVariable'](_0x4497a6[0x0])[_0x7c81('0xa4')]||_0x4497a6[0x0]);}}if(_0x39c4e0['length']===0x1){return _0x5b31c1[_0x7c81('0xa5')]();}return this['replaceAllVariables'](_0x5b31c1);};AGIVertices[_0x7c81('0x11')][_0x7c81('0xa6')]=function(_0x984fb9,_0x3875d1){var _0x1d6cd3=this[_0x7c81('0xf')][_0x7c81('0x12')](_0x984fb9);if(_0x1d6cd3[_0x7c81('0xa7')]===-0x1){return _0x1d6cd3;}logger['info'](util[_0x7c81('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3875d1,_0x1d6cd3[_0x7c81('0xa4')]));return this['channel'][_0x7c81('0xa1')](_0x3875d1,_0x1d6cd3[_0x7c81('0xa4')]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x89')]=function(_0x485cc8){return _0x485cc8&&_0x485cc8!=='0'&&_0x485cc8!=='-1'&&_0x485cc8!=='';};AGIVertices[_0x7c81('0x11')]['maxRetry']=function(_0x28a4dd){this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0x28a4dd,'-');_0x28a4dd['retry']=_0x28a4dd[_0x7c81('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x7c81('0xaa')]=function(_0xd1f495){logger['info'](util[_0x7c81('0x2b')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xd1f495['label']));if(!this['isConfigured'](_0xd1f495[_0x7c81('0x60')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xac'));}var _0xb812b9='\x22'+_0xd1f495[_0x7c81('0x60')]+'\x22';if(this[_0x7c81('0x89')](_0xd1f495['options'])){_0xb812b9+=','+_0xd1f495[_0x7c81('0x7c')];}var _0x5e515b=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0xad'),_0xb812b9);if(_0x5e515b[_0x7c81('0xa7')]===-0x1){return _0x5e515b;}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xae'),_0xb812b9));};AGIVertices['prototype'][_0x7c81('0xaf')]=function(_0xef7e61){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0xb0'),_0xef7e61[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0xef7e61['grammar'])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xb1'));}var _0x255591=_0xef7e61[_0x7c81('0xb2')];if(this['isConfigured'](_0xef7e61[_0x7c81('0x7c')])){_0x255591+=','+_0xef7e61[_0x7c81('0x7c')];}var _0x480792=this[_0x7c81('0xf')][_0x7c81('0x5a')]('MRCPRecog',_0x255591);if(_0x480792[_0x7c81('0xa7')]===-0x1){return _0x480792;}var _0x598c08=this[_0x7c81('0xa6')](_0x7c81('0xb3'),_0x7c81('0xb4'));if(_0x598c08['result']===-0x1){return _0x598c08;}var _0xfa9c0c=this[_0x7c81('0xa6')](_0x7c81('0xb5'),_0x7c81('0xb6'));if(_0xfa9c0c['result']===-0x1){return _0xfa9c0c;}var _0x4130f7=this[_0x7c81('0xa6')](_0x7c81('0xb7'),_0x7c81('0xb8'));if(_0x4130f7['result']===-0x1){return _0x4130f7;}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xb9'),_0x255591));};AGIVertices[_0x7c81('0x11')]['agi']=function(_0x463839){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xba'),_0x463839[_0x7c81('0x3c')]));return this[_0x7c81('0xf')][_0x7c81('0x8')]([_0x463839[_0x7c81('0xbb')],_0x463839[_0x7c81('0xbc')]]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0xbd')]=function(_0x3dd512){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xbe'),_0x3dd512['label']));if(this[_0x7c81('0x89')](_0x3dd512['timeout'])){logger[_0x7c81('0x33')](util['format'](_0x7c81('0xbf'),_0x3dd512[_0x7c81('0x6a')]));var _0x4c6706=this[_0x7c81('0xf')][_0x7c81('0xc0')](_0x3dd512[_0x7c81('0x6a')]);if(_0x4c6706['result']===-0x1){return _0x4c6706;}}return this[_0x7c81('0xf')][_0x7c81('0xbd')]();};AGIVertices[_0x7c81('0x11')]['callback']=function(_0x3bcb19){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xc1'),_0x3bcb19[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x3bcb19[_0x7c81('0x4c')])){return this[_0x7c81('0xf')]['error'](_0x3bcb19,_0x7c81('0xc2'));}_0x3bcb19[_0x7c81('0x4d')]=moment();if(this[_0x7c81('0x89')](_0x3bcb19[_0x7c81('0xc3')])){_0x3bcb19[_0x7c81('0x4d')]=moment()[_0x7c81('0xc4')](_0x3bcb19[_0x7c81('0xc3')],_0x7c81('0xc5'));}if(!this[_0x7c81('0x89')](_0x3bcb19[_0x7c81('0x4f')])){_0x3bcb19[_0x7c81('0x4f')]=0x2;}this[_0x7c81('0x47')]['sync'](this,_0x3bcb19);return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xc6'),_0x3bcb19[_0x7c81('0xc7')],_0x3bcb19['list_id'],_0x3bcb19[_0x7c81('0x4d')]));};AGIVertices['prototype'][_0x7c81('0xc8')]=function(_0xa4b6ee){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xc9'),_0xa4b6ee[_0x7c81('0x3c')]));var _0x27b58d=this['channel'][_0x7c81('0x5a')](_0xa4b6ee[_0x7c81('0xca')],_0xa4b6ee['options']);if(_0x27b58d[_0x7c81('0xa7')]===-0x1){return _0x27b58d;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0xcb'),_0xa4b6ee[_0x7c81('0xca')],_0xa4b6ee[_0x7c81('0x7c')]));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xcc')]=function(_0x1ffb53){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1ffb53[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x1ffb53[_0x7c81('0x60')])){return this['channel'][_0x7c81('0xab')](_0x7c81('0xac'));}var _0xa6619='\x22'+_0x1ffb53[_0x7c81('0x60')]+'\x22';if(this[_0x7c81('0x89')](_0x1ffb53['options'])){_0xa6619+=','+_0x1ffb53[_0x7c81('0x7c')];}var _0x53902b=this[_0x7c81('0xf')]['exec'](_0x7c81('0xad'),_0xa6619);if(_0x53902b[_0x7c81('0xa7')]===-0x1){return _0x53902b;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0xae'),_0xa6619));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xcd')]=function(_0x37baf4){logger['info'](util['format'](_0x7c81('0xce'),_0x37baf4['label']));if(!this[_0x7c81('0x89')](_0x37baf4['text'])){return this[_0x7c81('0xf')]['noop'](_0x7c81('0xac'));}var _0x3de2f9='\x22'+_0x37baf4[_0x7c81('0x60')]+'\x22';if(this[_0x7c81('0x89')](_0x37baf4['options'])){_0x3de2f9+=','+_0x37baf4[_0x7c81('0x7c')];}var _0x167fc2=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0xad'),_0x3de2f9);if(_0x167fc2[_0x7c81('0xa7')]===-0x1){return _0x167fc2;}return this['channel'][_0x7c81('0xab')](util['format'](_0x7c81('0xae'),_0x3de2f9));};AGIVertices['prototype'][_0x7c81('0xcf')]=function(_0x49b908){logger[_0x7c81('0x33')](util['format'](_0x7c81('0xd0'),_0x49b908[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x49b908['grammar'])){return this['channel']['noop'](_0x7c81('0xb1'));}var _0x5af5ea=_0x49b908[_0x7c81('0xb2')];if(this[_0x7c81('0x89')](_0x49b908['options'])){_0x5af5ea+=','+_0x49b908[_0x7c81('0x7c')];}var _0x3212c4=this['channel'][_0x7c81('0x5a')]('MRCPRecog',_0x5af5ea);if(_0x3212c4[_0x7c81('0xa7')]===-0x1){return _0x3212c4;}var _0x422100=this[_0x7c81('0xa6')](_0x7c81('0xb3'),_0x7c81('0xd1'));if(_0x422100[_0x7c81('0xa7')]===-0x1){return _0x422100;}var _0x51dc9a=this[_0x7c81('0xa6')](_0x7c81('0xb5'),_0x7c81('0xd2'));if(_0x51dc9a[_0x7c81('0xa7')]===-0x1){return _0x51dc9a;}var _0x4cd46c=this[_0x7c81('0xa6')](_0x7c81('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x4cd46c[_0x7c81('0xa7')]===-0x1){return _0x4cd46c;}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xb9'),_0x5af5ea));};AGIVertices[_0x7c81('0x11')]['sestekasr']=function(_0x30300){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xd3'),_0x30300['label']));if(!this['isConfigured'](_0x30300[_0x7c81('0xb2')])){return this[_0x7c81('0xf')]['noop']('no\x20grammar\x20configured');}var _0x13a397=_0x30300['grammar'];if(this[_0x7c81('0x89')](_0x30300[_0x7c81('0x7c')])){_0x13a397+=','+_0x30300['options'];}var _0x5e046c=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0xd4'),_0x13a397);if(_0x5e046c[_0x7c81('0xa7')]===-0x1){return _0x5e046c;}var _0x37cd7f=this[_0x7c81('0xa6')](_0x7c81('0xb3'),'SESTEK_ASR_CONFIDENCE');if(_0x37cd7f[_0x7c81('0xa7')]===-0x1){return _0x37cd7f;}var _0x3325d8=this['getAndSetVariable'](_0x7c81('0xb5'),_0x7c81('0xd5'));if(_0x3325d8[_0x7c81('0xa7')]===-0x1){return _0x3325d8;}var _0x312dfb=this[_0x7c81('0xa6')]('RECOG_INSTANCE()',_0x7c81('0xd6'));if(_0x312dfb['result']===-0x1){return _0x312dfb;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xb9'),_0x13a397));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xd7')]=function(_0x14165e){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0xd8'),_0x14165e['label']));if(!this[_0x7c81('0x89')](_0x14165e[_0x7c81('0xd9')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x14165e,_0x7c81('0xda'));}var _0x2d444f=this[_0x7c81('0x1c')]['sync'](this,_0x14165e['odbc_id']);if(!_0x2d444f){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x14165e,'no\x20odbc\x20database\x20found');}if(!this[_0x7c81('0x89')](_0x14165e[_0x7c81('0x32')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x14165e,_0x7c81('0xdb'));}var _0x28592e=_0x14165e[_0x7c81('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xdc'),_0x28592e));var _0x2d1f03=this[_0x7c81('0x2d')][_0x7c81('0xa8')](this,_0x2d444f,_0x28592e);this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0x14165e,_0x28592e);if(!this['isConfigured'](_0x14165e[_0x7c81('0xdd')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3dfe26=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0x14165e[_0x7c81('0xdd')]);if(!_0x3dfe26){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x14165e,_0x7c81('0xde'));}var _0x240d01=this;_0x2d1f03[_0x7c81('0xdf')](function(_0x2576dc,_0x4dda68){Object[_0x7c81('0xe0')](_0x2576dc)[_0x7c81('0xdf')](function(_0xf433ec){_0x240d01['channel'][_0x7c81('0xa1')](util['format']('%s[%s][%s]',_0x3dfe26,_0x4dda68,_0xf433ec),_0x2576dc[_0xf433ec]);});});this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')](_0x7c81('0xe1'),_0x3dfe26),_0x2d1f03[_0x7c81('0x9d')]);return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xe2'),_0x3dfe26));};AGIVertices['prototype'][_0x7c81('0xe3')]=function(_0x2f8209){logger['debug'](util[_0x7c81('0x2b')](_0x7c81('0xe4'),_0x2f8209['label']));if(!this[_0x7c81('0x89')](_0x2f8209[_0x7c81('0xe5')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2f8209,_0x7c81('0xe6'));}var _0x1abc03=this['getUser']['sync'](this,_0x2f8209[_0x7c81('0xe5')]);if(!_0x1abc03){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2f8209,_0x7c81('0xe7'));}var _0x465174=this['channel'][_0x7c81('0x5a')](_0x7c81('0xe8'),[util[_0x7c81('0x2b')]('SIP/%s',_0x1abc03),_0x2f8209[_0x7c81('0x6a')],_0x2f8209[_0x7c81('0xe9')],_0x2f8209[_0x7c81('0x68')]]);if(_0x465174[_0x7c81('0xa7')]===-0x1){return _0x465174;}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xea'),_0x7c81('0xe8')));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xeb')]=function(_0x273822){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x273822[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x273822[_0x7c81('0x84')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xec'));}if(!this[_0x7c81('0x89')](_0x273822['text'])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xac'));}this[_0x7c81('0xf')][_0x7c81('0xed')]=!![];this['createSquareDetailsReport'](_0x273822);this[_0x7c81('0x46')](_0x273822[_0x7c81('0x60')],'in','','');this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0xee'),_0x273822[_0x7c81('0x60')]));var _0x3632c0=this[_0x7c81('0x7d')][_0x7c81('0xa8')](this,_0x273822);if(_0x3632c0){for(var _0x183a9c in _0x3632c0){if(_0x3632c0[_0x7c81('0x97')](_0x183a9c)){this['channel'][_0x7c81('0xa1')](util[_0x7c81('0x2b')](_0x7c81('0xef'),_0x183a9c[_0x7c81('0x6e')]()),_0x3632c0[_0x183a9c]);}}this[_0x7c81('0x46')](_0x3632c0[_0x7c81('0xf0')],_0x7c81('0xf1'),_0x7c81('0xeb'),'');return this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xf2'),_0x3632c0['speech']));}return this[_0x7c81('0xf')]['error'](_0x273822,_0x7c81('0xf3'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xf4')]=function(_0x535b28){logger['info'](util['format'](_0x7c81('0xf5'),_0x535b28['label']));if(!this[_0x7c81('0x89')](_0x535b28[_0x7c81('0x7f')])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x535b28[_0x7c81('0x80')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xf6'));}if(!this[_0x7c81('0x89')](_0x535b28[_0x7c81('0xf7')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20private_key\x20configured');}if(!this[_0x7c81('0x89')](_0x535b28['dialogflowV2_language'])){return this['channel'][_0x7c81('0xab')](_0x7c81('0xf8'));}if(!this[_0x7c81('0x89')](_0x535b28[_0x7c81('0x60')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xac'));}this[_0x7c81('0xf')][_0x7c81('0xed')]=!![];this[_0x7c81('0x3a')](_0x535b28);this['createSquareMessage'](_0x535b28[_0x7c81('0x60')],'in','','');this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('Trying\x20DialogflowV2:\x20%s',_0x535b28[_0x7c81('0x60')]));var _0x4c5c45=this[_0x7c81('0x7e')]['sync'](this,_0x535b28);if(_0x4c5c45){for(var _0x2d8673 in _0x4c5c45){if(_0x4c5c45[_0x7c81('0x97')](_0x2d8673)){if(_0x2d8673!==_0x7c81('0xf9')){this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')]('DIALOGFLOW_%s',_0x2d8673[_0x7c81('0x6e')]()),_0x4c5c45[_0x2d8673]);}}}this['createSquareMessage'](_0x4c5c45[_0x7c81('0xf0')],'out',_0x7c81('0xf4'),_0x4c5c45[_0x7c81('0xf9')]);return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xfa'),_0x4c5c45['speech']));}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x535b28,_0x7c81('0xfb'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0xfc')]=function(_0x17ee49){logger[_0x7c81('0x33')](util['format'](_0x7c81('0xfd'),_0x17ee49[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x17ee49[_0x7c81('0xfe')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xff'));}if(!this[_0x7c81('0x89')](_0x17ee49['username'])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x100'));}if(!this[_0x7c81('0x89')](_0x17ee49[_0x7c81('0x101')])){return this[_0x7c81('0xf')]['noop'](_0x7c81('0x102'));}if(!this['isConfigured'](_0x17ee49[_0x7c81('0x103')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xac'));}this[_0x7c81('0xf')][_0x7c81('0xed')]=!![];this[_0x7c81('0x3a')](_0x17ee49);this[_0x7c81('0x46')](_0x17ee49[_0x7c81('0x60')],'in','','');this[_0x7c81('0xf')]['noop'](util['format'](_0x7c81('0x104'),_0x17ee49[_0x7c81('0x60')]));var _0x2715c5=this[_0x7c81('0x82')][_0x7c81('0xa8')](this,_0x17ee49);if(_0x2715c5){for(var _0x1ca279 in _0x2715c5){if(_0x2715c5[_0x7c81('0x97')](_0x1ca279)){this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')](_0x7c81('0x105'),_0x1ca279['toUpperCase']()),_0x2715c5[_0x1ca279]);}}this[_0x7c81('0x46')](_0x2715c5[_0x7c81('0xf0')],_0x7c81('0xf1'),_0x7c81('0xfc'),'');if(_0x2715c5[_0x7c81('0x106')]){this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x107'),_0x2715c5[_0x7c81('0x106')]));var _0xef02e8=this[_0x7c81('0xf')][_0x7c81('0x108')](_0x2715c5['audiofile']);try{fs[_0x7c81('0x109')](_0x2715c5[_0x7c81('0x106')]+'.wav');}catch(_0x5adcaf){logger['error'](_0x5adcaf);}return _0xef02e8;}else{return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x10a'),_0x2715c5[_0x7c81('0xf0')]));}}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x17ee49,_0x7c81('0x10b'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x10c')]=function(_0x1b8440){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x10d'),_0x1b8440[_0x7c81('0x3c')]));return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x10c'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x10e')]=function(_0x578f92){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x10f'),_0x578f92[_0x7c81('0x3c')]));var _0x1bf41e='';if(_0x578f92[_0x7c81('0x110')]){if(!this[_0x7c81('0x89')](_0x578f92[_0x7c81('0x110')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x578f92,_0x7c81('0x111'));}else{var _0x152463=parseInt(_0x578f92[_0x7c81('0x110')],0xa);if(isNaN(_0x152463)){_0x1bf41e=_0x578f92[_0x7c81('0x110')];}else{_0x1bf41e=this['getTrunk'][_0x7c81('0xa8')](this,_0x578f92['trunk_id']);if(!_0x1bf41e){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x578f92,_0x7c81('0x112'));}}}}else if(_0x578f92[_0x7c81('0x113')]){_0x1bf41e=_0x578f92['trunk_name'];}else{return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x578f92,_0x7c81('0x111'));}var _0xd5a64d=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0xe8'),[util[_0x7c81('0x2b')]('SIP/%s/%s',_0x1bf41e,_0x578f92[_0x7c81('0xc7')]),_0x578f92[_0x7c81('0x6a')],_0x578f92['opts'],_0x578f92[_0x7c81('0x68')]]);if(_0xd5a64d[_0x7c81('0xa7')]===-0x1){return _0xd5a64d;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('Executed\x20command\x20%s',_0x7c81('0xe8')));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x114')]=function(_0x292af5){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x115'),_0x292af5[_0x7c81('0x3c')]));return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x114'));};AGIVertices[_0x7c81('0x11')]['getdigits']=function(_0xcf1023){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x116'),_0xcf1023['label']));if(_0xcf1023[_0x7c81('0x117')]===0x0){return this['maxRetry'](_0xcf1023);}_0xcf1023[_0x7c81('0x117')]-=0x1;if(!this[_0x7c81('0x89')](_0xcf1023['file_id'])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0xcf1023,_0x7c81('0x118'));}var _0x2c62e8=this[_0x7c81('0x20')][_0x7c81('0xa8')](this,_0xcf1023[_0x7c81('0x119')]);if(!_0x2c62e8){return this[_0x7c81('0xf')]['error'](_0xcf1023,'no\x20file\x20audio\x20found');}if(!this[_0x7c81('0x89')](_0xcf1023['variable_id'])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x7c81('0x11a'));}var _0x2b119f=this[_0x7c81('0xf')][_0x7c81('0x11b')](_0x2c62e8,_0xcf1023['response'],_0xcf1023[_0x7c81('0x11c')]);var _0x4627ec=_0x2b119f['result']?_0x2b119f[_0x7c81('0xa7')][_0x7c81('0xa5')]():'';logger[_0x7c81('0x33')](_0x7c81('0x11d'),JSON[_0x7c81('0x77')](_0x2b119f));if(_0x2b119f['result']===-0x1){this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0xcf1023,_0x4627ec);return _0x2b119f;}else if(_0x2b119f[_0x7c81('0xa4')]===_0x7c81('0x6a')){_0x2b119f[_0x7c81('0xa7')]=_0x4627ec[_0x7c81('0x9d')]>=parseInt(_0xcf1023[_0x7c81('0x11e')])?'x':'i';}else{_0x2b119f['result']=_0x4627ec[_0x7c81('0x9d')]>=parseInt(_0xcf1023[_0x7c81('0x11e')])&&_0x4627ec['length']<=parseInt(_0xcf1023[_0x7c81('0x11c')])?'x':'i';}var _0x318242=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0xcf1023[_0x7c81('0xdd')]);if(!_0x318242){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0xcf1023,'no\x20variable\x20found');}this['channel'][_0x7c81('0xa1')](_0x318242,_0x4627ec);if(this[_0x7c81('0x89')](_0xcf1023[_0x7c81('0x11f')])){var _0x5a67e8=parseInt(_0xcf1023[_0x7c81('0x11f')],0xa);var _0x2f281f=rs['generate']({'charset':'*','length':_0x5a67e8});var _0x1fc9d1=_0x4627ec[_0x7c81('0x9d')];if(_0x1fc9d1>0x0){if(_0x1fc9d1>_0x5a67e8){this[_0x7c81('0x3a')]['sync'](this,_0xcf1023,_0xcf1023[_0x7c81('0x120')]==='first'?_0x2f281f+_0x4627ec[_0x7c81('0x121')](_0x5a67e8):_0x4627ec[_0x7c81('0x121')](0x0,_0x1fc9d1-_0x5a67e8)+_0x2f281f);}else{this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0xcf1023,rs[_0x7c81('0x122')]({'charset':'*','length':_0x1fc9d1}));}}else{this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0xcf1023,'');}}else{this[_0x7c81('0x3a')]['sync'](this,_0xcf1023,_0x4627ec);}return _0x2b119f;};AGIVertices['prototype'][_0x7c81('0xe')]=function(_0x2b3342){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2b3342[_0x7c81('0x3c')]));return this['getdigits'](_0x2b3342);};AGIVertices['prototype'][_0x7c81('0x123')]=function(_0x33d25a){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x33d25a[_0x7c81('0x3c')]));this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0x33d25a,_0x33d25a[_0x7c81('0x124')]);return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x125'),_0x33d25a[_0x7c81('0x124')]));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x126')]=function(_0x110ea5){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x127'),_0x110ea5[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x110ea5[_0x7c81('0x8c')])||!this[_0x7c81('0x89')](_0x110ea5[_0x7c81('0x8d')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x7c81('0x89')](_0x110ea5[_0x7c81('0x60')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20text\x20configured');}this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0x128'),_0x110ea5[_0x7c81('0x60')]));var _0x4f1f0d=this[_0x7c81('0x8b')][_0x7c81('0xa8')](this,_0x110ea5);if(_0x4f1f0d){this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x129'),_0x4f1f0d));var _0x34f1bc=this[_0x7c81('0xf')]['streamFile'](_0x4f1f0d);try{fs['unlink'](_0x4f1f0d+_0x7c81('0x12a'));}catch(_0x4e49d3){logger[_0x7c81('0x2f')](_0x4e49d3);}return _0x34f1bc;}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x110ea5,_0x7c81('0x12b'));};AGIVertices[_0x7c81('0x11')]['awslex']=function(_0x47d559){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x12c'),_0x47d559['label']));if(!this[_0x7c81('0x89')](_0x47d559[_0x7c81('0x8c')])||!this[_0x7c81('0x89')](_0x47d559[_0x7c81('0x8d')])){return this['channel']['noop'](_0x7c81('0x12d'));}if(!this[_0x7c81('0x89')](_0x47d559[_0x7c81('0x12e')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20bot\x20name\x20configured');}if(!this[_0x7c81('0x89')](_0x47d559[_0x7c81('0x60')])){return this[_0x7c81('0xf')]['noop']('no\x20text\x20configured');}this[_0x7c81('0xf')]['bot']=!![];this[_0x7c81('0x3a')](_0x47d559);this[_0x7c81('0x46')](_0x47d559[_0x7c81('0x60')],'in','','');this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x12f'),_0x47d559[_0x7c81('0x60')]));var _0xf7b926=this[_0x7c81('0x130')][_0x7c81('0xa8')](this,_0x47d559);if(_0xf7b926){for(var _0x139264 in _0xf7b926){if(_0xf7b926[_0x7c81('0x97')](_0x139264)&&_[_0x7c81('0x9e')](_0xf7b926[_0x139264])){this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')]('AWS_LEX_%s',_0x139264['toUpperCase']()),_0xf7b926[_0x139264]);}}if(_[_0x7c81('0x49')](_0xf7b926[_0x7c81('0x131')])){return this['channel']['noop'](_0x7c81('0x132'));}else{this[_0x7c81('0x46')](_0xf7b926[_0x7c81('0x131')],_0x7c81('0xf1'),'amazonlex','');return this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0x133'),_0xf7b926[_0x7c81('0x131')]));}}return this['channel'][_0x7c81('0x2f')](_0x47d559,_0x7c81('0x134'));};AGIVertices[_0x7c81('0x11')]['googleasr']=function(_0x4b9c6e){logger['info'](util['format'](_0x7c81('0x135'),_0x4b9c6e['label'],_0x4b9c6e[_0x7c81('0x6a')]));if(!this['isConfigured'](_0x4b9c6e['key'])){return this['channel'][_0x7c81('0xab')](_0x7c81('0xec'));}var _0x590baf=_0x7c81('0x136');var _0x5bca51=util[_0x7c81('0x2b')](_0x7c81('0x137'),FILES_PATH,rs[_0x7c81('0x122')](0x4));var _0x5871d4=util['format'](_0x7c81('0x9f'),_0x5bca51,_0x590baf);var _0x470e44=!![];if(_0x4b9c6e[_0x7c81('0x138')]===_0x7c81('0x139')){_0x470e44=![];}var _0x33f519=this[_0x7c81('0xf')][_0x7c81('0x13a')](_0x5bca51,_0x590baf,_0x4b9c6e[_0x7c81('0x13b')],_0x4b9c6e[_0x7c81('0x6a')],undefined,_0x470e44);if(_0x33f519['result']!==-0x1){this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x13c'),_0x5871d4));var _0x5a4fa9=this['googleASR'][_0x7c81('0xa8')](this,_0x4b9c6e,_0x5871d4);if(_0x5a4fa9){for(var _0x4d4f0c in _0x5a4fa9){if(_0x5a4fa9[_0x7c81('0x97')](_0x4d4f0c)){this[_0x7c81('0xf')][_0x7c81('0xa1')](util[_0x7c81('0x2b')]('GOOGLE_ASR_%s',_0x4d4f0c[_0x7c81('0x6e')]()),_0x5a4fa9[_0x4d4f0c]);}}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0x13d'),JSON[_0x7c81('0x77')](_0x5a4fa9)));}}return _0x33f519;};AGIVertices['prototype'][_0x7c81('0x13e')]=function(_0x377f06){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x13f'),_0x377f06[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x377f06[_0x7c81('0x92')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x140'));}if(!this[_0x7c81('0x89')](_0x377f06['appsecret'])){return this['channel']['noop'](_0x7c81('0x141'));}var _0x989fcf=_0x7c81('0x136');var _0x7e6c0b=util['format'](_0x7c81('0x137'),FILES_PATH,rs[_0x7c81('0x122')](0x4));var _0x399d91=util[_0x7c81('0x2b')](_0x7c81('0x9f'),_0x7e6c0b,_0x989fcf);var _0x6d0d10=!![];if(_0x377f06['beep']==='NOBEEP'){_0x6d0d10=![];}var _0x4da3e6=this[_0x7c81('0xf')][_0x7c81('0x13a')](_0x7e6c0b,_0x989fcf,_0x377f06[_0x7c81('0x13b')],_0x377f06[_0x7c81('0x6a')],undefined,_0x6d0d10);if(_0x4da3e6[_0x7c81('0xa7')]!==-0x1){this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0x142'),_0x399d91));var _0x4b7be7=this[_0x7c81('0x91')][_0x7c81('0xa8')](this,_0x377f06,_0x399d91);if(_0x4b7be7){for(var _0x3194ff in _0x4b7be7){if(_0x4b7be7[_0x7c81('0x97')](_0x3194ff)){this['channel'][_0x7c81('0xa1')](util[_0x7c81('0x2b')](_0x7c81('0x143'),_0x3194ff[_0x7c81('0x6e')]()),_0x4b7be7[_0x3194ff]);}}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0x7c81('0x77')](_0x4b7be7)));}}return _0x4da3e6;};AGIVertices['prototype'][_0x7c81('0x144')]=function(_0x1e70d0){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x145'),_0x1e70d0['label']));return this[_0x7c81('0xf')]['continueAt'](_0x1e70d0[_0x7c81('0x41')],_0x1e70d0[_0x7c81('0x42')],_0x1e70d0['priority']);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x146')]=function(_0x40a3de){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x40a3de[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x40a3de[_0x7c81('0x147')])){return this['channel'][_0x7c81('0x2f')](_0x40a3de,'no\x20condition\x20configured');}try{var _0x6a3bb9=eval(_0x40a3de[_0x7c81('0x147')])?_0x7c81('0x148'):_0x7c81('0x149');this[_0x7c81('0xf')]['noop'](util['format'](_0x7c81('0x14a'),_0x40a3de[_0x7c81('0x147')],_0x6a3bb9));return{'code':0xc8,'result':_0x6a3bb9};}catch(_0x41f1cd){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7c81('0x11')]['gotoiftime']=function(_0x2430e6){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x14b'),_0x2430e6[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x2430e6[_0x7c81('0x14c')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2430e6,_0x7c81('0x14d'));}var _0x2075f0=this[_0x7c81('0x25')][_0x7c81('0xa8')](this,_0x2430e6['interval_id']);if(!_0x2075f0){return this['channel'][_0x7c81('0x2f')](_0x2430e6,_0x7c81('0x14e'));}for(var _0x2734a6=0x0;_0x2734a6<_0x2075f0[_0x7c81('0x9d')];_0x2734a6+=0x1){var _0x37d280=this[_0x7c81('0xf')]['getVariable'](util[_0x7c81('0x2b')](_0x7c81('0x14f'),_0x2075f0[_0x2734a6]));if(_0x37d280[_0x7c81('0xa7')]===-0x1){return _0x37d280;}logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x150'),_0x2075f0[_0x2734a6],_0x37d280[_0x7c81('0xa4')]));if(_0x37d280[_0x7c81('0xa4')]===_0x7c81('0x148')){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x150'),_0x2075f0[_0x2734a6],_0x7c81('0x148')));this['channel'][_0x7c81('0xab')](util['format']('IFTIME\x20%s\x20%s',_0x2075f0[_0x2734a6],_0x7c81('0x148')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x7c81('0x2b')]('IFTIME\x20%s\x20%s',_0x2075f0[_0x2734a6],_0x7c81('0x149')));this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x150'),_0x2075f0[_0x2734a6],_0x7c81('0x149')));}}return{'code':0xc8,'result':_0x7c81('0x149')};};AGIVertices[_0x7c81('0x11')][_0x7c81('0x151')]=function(_0x223394){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x152'),_0x223394[_0x7c81('0x3c')]));return this['channel'][_0x7c81('0x151')]();};AGIVertices['prototype']['ispeechasr']=function(_0x10bee1){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x153'),_0x10bee1[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x10bee1[_0x7c81('0x84')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20key\x20configured');}var _0xa11593=_0x7c81('0x136');var _0x1b4e95=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x7c81('0x122')](0x4));var _0x1b84eb=util[_0x7c81('0x2b')]('%s.%s',_0x1b4e95,_0xa11593);var _0x325b8f=!![];if(_0x10bee1[_0x7c81('0x138')]===_0x7c81('0x139')){_0x325b8f=![];}var _0x37222f=this[_0x7c81('0xf')][_0x7c81('0x13a')](_0x1b4e95,_0xa11593,_0x10bee1[_0x7c81('0x13b')],_0x10bee1[_0x7c81('0x6a')],undefined,_0x325b8f);if(_0x37222f[_0x7c81('0xa7')]!==-0x1){this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x154'),_0x1b84eb));var _0x367694=this[_0x7c81('0x87')][_0x7c81('0xa8')](this,_0x10bee1,_0x1b84eb);if(_0x367694){for(var _0x5a1329 in _0x367694){if(_0x367694[_0x7c81('0x97')](_0x5a1329)){this[_0x7c81('0xf')][_0x7c81('0xa1')](util['format'](_0x7c81('0x155'),_0x5a1329[_0x7c81('0x6e')]()),_0x367694[_0x5a1329]);}}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x156'),JSON[_0x7c81('0x77')](_0x367694)));}}return _0x37222f;};AGIVertices[_0x7c81('0x11')][_0x7c81('0x157')]=function(_0x5271d7){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5271d7[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x5271d7[_0x7c81('0x84')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0xec'));}if(!this[_0x7c81('0x89')](_0x5271d7[_0x7c81('0x60')])){return this[_0x7c81('0xf')]['noop']('no\x20text\x20configured');}this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x158'),_0x5271d7[_0x7c81('0x60')]));var _0x155016=this['ispeechTTS']['sync'](this,_0x5271d7);if(_0x155016){this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x154'),_0x155016));var _0xaaf9d9=this['channel']['streamFile'](_0x155016,_0x5271d7[_0x7c81('0x13b')]);try{fs['unlink'](_0x155016+_0x7c81('0x12a'));}catch(_0x5b83cd){logger[_0x7c81('0x2f')](_0x5b83cd);}return _0xaaf9d9;}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5271d7,_0x7c81('0x159'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x15a')]=function(_0x5d82d8){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x15b'),_0x5d82d8[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x5d82d8[_0x7c81('0x15c')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5d82d8,_0x7c81('0x15d'));}logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x15e'),this[_0x7c81('0xf')]['callerid'],_0x5d82d8['findBy']));var _0x2f2fb7=this[_0x7c81('0x15f')]['sync'](this,_0x5d82d8['findBy']);if(_0x2f2fb7){logger['info'](util['format'](_0x7c81('0x160'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x5d82d8[_0x7c81('0x15c')]));this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x160'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x5d82d8[_0x7c81('0x15c')]));return{'code':0xc8,'result':_0x7c81('0x161')};}else{logger[_0x7c81('0x33')](util['format'](_0x7c81('0x162'),this['channel'][_0x7c81('0x3f')],_0x5d82d8[_0x7c81('0x15c')]));this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x5d82d8['findBy']));return{'code':0xc8,'result':_0x7c81('0x163')};}};AGIVertices[_0x7c81('0x11')][_0x7c81('0x164')]=function(_0x2f4166){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2f4166[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x2f4166['findBy'])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2f4166,'no\x20find\x20by\x20configured');}logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x15e'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x2f4166[_0x7c81('0x15c')]));var _0x14039c=this[_0x7c81('0x55')][_0x7c81('0xa8')](this,_0x2f4166[_0x7c81('0x15c')]);if(_0x14039c){logger['info'](util['format'](_0x7c81('0x160'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x2f4166[_0x7c81('0x15c')]));this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0x160'),this[_0x7c81('0xf')]['callerid'],_0x2f4166[_0x7c81('0x15c')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x7c81('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x2f4166[_0x7c81('0x15c')]));this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x2f4166['findBy']));return{'code':0xc8,'result':_0x7c81('0x163')};}};AGIVertices['prototype'][_0x7c81('0x165')]=function(_0x5dd2fc){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x166'),_0x5dd2fc[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x5dd2fc[_0x7c81('0x167')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5dd2fc,_0x7c81('0x168'));}this[_0x7c81('0xf')][_0x7c81('0xab')](util['format']('math\x20%s',_0x5dd2fc[_0x7c81('0x167')]));var _0x4292e0=eval(_0x5dd2fc['operation']);if(!this['isConfigured'](_0x5dd2fc[_0x7c81('0xdd')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x11a'));}var _0x4c6bbc=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0x5dd2fc[_0x7c81('0xdd')]);if(!_0x4c6bbc){return this['channel'][_0x7c81('0x2f')](_0x5dd2fc,_0x7c81('0xde'));}if(_[_0x7c81('0x9c')](_0x4292e0)){var _0x5416b3=this;_0x4292e0[_0x7c81('0xdf')](function(_0xfa099f,_0x2f9764){_0x5416b3[_0x7c81('0xf')]['setVariable'](util['format'](_0x7c81('0x169'),_0x4c6bbc,_0x2f9764),_0xfa099f);});return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x16a'),_0x4c6bbc));}else{return this[_0x7c81('0xf')]['setVariable'](_0x4c6bbc,_0x4292e0);}};AGIVertices[_0x7c81('0x11')][_0x7c81('0xd')]=function(_0x2aec0c){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x16b'),_0x2aec0c[_0x7c81('0x3c')]));if(_0x2aec0c[_0x7c81('0x117')]===0x0){return this[_0x7c81('0xa9')](_0x2aec0c);}_0x2aec0c[_0x7c81('0x117')]-=0x1;if(!this['isConfigured'](_0x2aec0c['file_id'])){return this['channel'][_0x7c81('0x2f')](_0x2aec0c,'no\x20file\x20audio\x20selected');}var _0x30a049=this['getSound'][_0x7c81('0xa8')](this,_0x2aec0c[_0x7c81('0x119')]);if(!_0x30a049){return this[_0x7c81('0xf')]['error'](_0x2aec0c,_0x7c81('0x16c'));}var _0x2799a5=this['channel'][_0x7c81('0x11b')](_0x30a049,_0x2aec0c['response'],_0x2aec0c[_0x7c81('0x16d')]);var _0x82c82c=_0x2799a5[_0x7c81('0xa7')];if(_0x2799a5[_0x7c81('0xa7')]===-0x1){this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0x2aec0c,'-1');return _0x2799a5;}else if(_0x2799a5[_0x7c81('0xa4')]==='timeout'){_0x2799a5[_0x7c81('0xa7')]=_0x2799a5[_0x7c81('0xa7')][_0x7c81('0x9d')]>0x0?_0x2799a5[_0x7c81('0xa7')]:'t';}else if(_[_0x7c81('0x48')](_0x2799a5['result'])){_0x2799a5[_0x7c81('0xa7')]='#';_0x82c82c='#';}if(!this[_0x7c81('0x89')](_0x2aec0c[_0x7c81('0xdd')])){this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x11a'));}else{var _0x4f8ac1=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0x2aec0c[_0x7c81('0xdd')]);if(!_0x4f8ac1){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2aec0c,_0x7c81('0xde'));}this[_0x7c81('0xf')][_0x7c81('0xa1')](_0x4f8ac1,_0x82c82c);}this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0x2aec0c,_0x82c82c);return _0x2799a5;};AGIVertices[_0x7c81('0x11')]['noop']=function(_0x5e7ddb){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5e7ddb['label']));return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x5e7ddb[_0x7c81('0x16e')]||_0x5e7ddb[_0x7c81('0x3c')]);};AGIVertices[_0x7c81('0x11')]['pause']=function(_0x362df8){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x16f'),_0x362df8['label']));if(!this[_0x7c81('0x89')](_0x362df8['findBy'])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x362df8,_0x7c81('0x15d'));}logger[_0x7c81('0x33')](util['format'](_0x7c81('0x15e'),this['channel']['callerid'],_0x362df8['findBy']));var _0x5f7325=this['getPause'][_0x7c81('0xa8')](this,_0x362df8['pause_id']);var _0x473a05=this['agentPause'][_0x7c81('0xa8')](this,_0x362df8['findBy'],_0x5f7325);if(_0x473a05){logger['info'](util['format'](_0x7c81('0x160'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x362df8['findBy']));this[_0x7c81('0xf')][_0x7c81('0xab')](util['format'](_0x7c81('0x160'),this['channel'][_0x7c81('0x3f')],_0x362df8[_0x7c81('0x15c')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x162'),this['channel']['callerid'],_0x362df8['findBy']));this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x160'),this['channel'][_0x7c81('0x3f')],_0x362df8['findBy']));return{'code':0xc8,'result':_0x7c81('0x163')};}};AGIVertices[_0x7c81('0x11')][_0x7c81('0x170')]=function(_0x263751){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x171'),_0x263751[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x263751[_0x7c81('0x119')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x263751,_0x7c81('0x118'));}var _0x52ba74=this[_0x7c81('0x20')]['sync'](this,_0x263751[_0x7c81('0x119')]);if(!_0x52ba74){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x263751,_0x7c81('0x16c'));}var _0x5ec2d8=this['channel'][_0x7c81('0x5a')]('PLAYBACK',[_0x52ba74,_0x263751[_0x7c81('0xe9')]]);if(_0x5ec2d8[_0x7c81('0xa7')]===-0x1){return _0x5ec2d8;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xcb'),'PLAYBACK',_0x52ba74));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x172')]=function(_0x10cd76){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x173'),_0x10cd76[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x10cd76[_0x7c81('0x174')])){return this['channel'][_0x7c81('0x2f')](_0x10cd76,_0x7c81('0x175'));}var _0x28f140='';var _0x7e8815=parseInt(_0x10cd76[_0x7c81('0x174')],0xa);if(isNaN(_0x7e8815)){_0x28f140=_0x10cd76[_0x7c81('0x174')];}else{_0x28f140=this[_0x7c81('0x18')][_0x7c81('0xa8')](this,_0x10cd76['queue_id']);if(!_0x28f140){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x10cd76,'no\x20queue\x20found');}}var _0x342ec6='';if(this[_0x7c81('0x89')](_0x10cd76[_0x7c81('0x119')])){var _0x218942=this[_0x7c81('0x20')]['sync'](this,_0x10cd76['file_id']);if(_0x218942){_0x342ec6=_0x218942;}}this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0x10cd76,_0x28f140);if(_0x10cd76[_0x7c81('0xe9')]['indexOf']('x')<0x0){_0x10cd76[_0x7c81('0xe9')]+='x';}if(_0x10cd76[_0x7c81('0xe9')]['indexOf']('X')<0x0){_0x10cd76[_0x7c81('0xe9')]+='X';}this[_0x7c81('0xf')][_0x7c81('0xa1')]('XMCS-QUEUE',_0x28f140?_0x28f140['toLowerCase']():'');var _0x1963cb=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0x176'),[_0x28f140,_0x10cd76[_0x7c81('0xe9')],_0x10cd76[_0x7c81('0x68')],_0x342ec6,_0x10cd76[_0x7c81('0x6a')],_0x10cd76[_0x7c81('0x8')],_0x10cd76[_0x7c81('0x177')],_0x10cd76[_0x7c81('0x178')],'',_0x10cd76[_0x7c81('0x179')]]);if(_0x1963cb[_0x7c81('0xa7')]===-0x1){return _0x1963cb;}return this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x28f140));};AGIVertices['prototype'][_0x7c81('0x17a')]=function(_0x5a38ff){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x17b'),_0x5a38ff[_0x7c81('0x3c')]));var _0x3d4f26=_0x5a38ff['recordingFormat']||_0x7c81('0x136');var _0x3044ba=util['format']('%s_%s',this[_0x7c81('0xf')][_0x7c81('0x3b')],rs[_0x7c81('0x122')](0x5));var _0x2a3007=util[_0x7c81('0x2b')](_0x7c81('0x17c'),FILES_PATH,_0x3044ba,_0x3d4f26);var _0x202483=util[_0x7c81('0x2b')]('%s/recordings/%s',FILES_PATH,_0x3044ba);this[_0x7c81('0x3e')][_0x7c81('0xa8')](this,_0x5a38ff,_0x3044ba,_0x2a3007);this[_0x7c81('0xf')][_0x7c81('0xa1')]('RECORDING_SAVENAME',_0x3044ba);logger['info'](_0x7c81('0x17d'),_0x202483,_0x3d4f26,_0x5a38ff[_0x7c81('0x17e')],_0x5a38ff[_0x7c81('0x6a')]);return this[_0x7c81('0xf')][_0x7c81('0x13a')](_0x202483,_0x3d4f26,_0x5a38ff[_0x7c81('0x17e')],_0x5a38ff['timeout'],undefined,!![]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x17f')]=function(_0x5c868f){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x180'),_0x5c868f[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x5c868f[_0x7c81('0x68')])){return this[_0x7c81('0xf')]['noop']('no\x20url\x20configured');}var _0x3d295d=this[_0x7c81('0x67')]['sync'](this,_0x5c868f);logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x181'),util['inspect'](_0x3d295d,{'showHidden':![],'depth':null})));if(!this[_0x7c81('0x89')](_0x5c868f[_0x7c81('0xdd')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x182'));}var _0x296f71=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0x5c868f[_0x7c81('0xdd')]);if(!_0x296f71){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5c868f,'no\x20variable\x20found');}this[_0x7c81('0xf')][_0x7c81('0xa1')](util['format'](_0x7c81('0x183'),_0x296f71),_0x3d295d[_0x7c81('0x79')]?_0x3d295d[_0x7c81('0x79')]:'200');this[_0x7c81('0xf')]['setVariable'](util[_0x7c81('0x2b')](_0x7c81('0x184'),_0x296f71),_0x3d295d[_0x7c81('0x7a')]?_0x3d295d['statusMessage']:'OK');if(_0x3d295d[_0x7c81('0x6f')]){try{this[_0x7c81('0xa0')](_0x3d295d[_0x7c81('0x6f')],_0x296f71);}catch(_0x41666c){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x296f71));}}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('variable\x20%s\x20set',_0x296f71));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x185')]=function(_0x321c49){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x186'),_0x321c49['label']));return this[_0x7c81('0xf')]['sayDigits'](_0x321c49[_0x7c81('0x187')][_0x7c81('0x5c')](/\s+/g,''),_0x321c49[_0x7c81('0x17e')]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x188')]=function(_0x2ec9dc){logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x189'),_0x2ec9dc['label']));return this[_0x7c81('0xf')]['sayNumber'](_0x2ec9dc['number'][_0x7c81('0x5c')](/\s+/g,''),_0x2ec9dc[_0x7c81('0x17e')]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x18a')]=function(_0x45c946){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x18b'),_0x45c946[_0x7c81('0x3c')]));return this[_0x7c81('0xf')][_0x7c81('0x18c')](_0x45c946[_0x7c81('0x60')],_0x45c946['escape_digits']);};AGIVertices[_0x7c81('0x11')]['sendMail']=function(_0x620cef){logger['info'](util['format'](_0x7c81('0x18d'),_0x620cef[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x620cef[_0x7c81('0x18e')])){return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x18f'));}var _0x17c64f=this[_0x7c81('0x23')][_0x7c81('0xa8')](this,_0x620cef[_0x7c81('0x18e')]);if(!_0x17c64f||!_0x17c64f['Smtp']){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x620cef,'no\x20mail\x20account\x20found');}var _0x5c6f18={'from':util['format'](_0x7c81('0x190'),_0x17c64f[_0x7c81('0x16')],_0x17c64f[_0x7c81('0x191')]||_0x17c64f['Smtp'][_0x7c81('0x192')]),'to':_0x620cef['to']||'','cc':_0x620cef['cc']||'','bcc':_0x620cef[_0x7c81('0x193')]||'','subject':_0x620cef['subject'],'html':_0x620cef[_0x7c81('0x60')],'text':_0x620cef[_0x7c81('0x60')]};if(this[_0x7c81('0x89')](_0x620cef[_0x7c81('0x194')])){}logger[_0x7c81('0x195')](_0x7c81('0x196'),JSON['stringify'](_0x5c6f18));this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0x620cef,_0x620cef[_0x7c81('0x18e')]);this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x17c64f[_0x7c81('0x16')]));this['sendMailMessage']['sync'](this,_0x17c64f[_0x7c81('0x197')],_0x5c6f18);return this['channel'][_0x7c81('0xab')](_0x7c81('0x198'));};AGIVertices['prototype'][_0x7c81('0x199')]=function(_0x4a4b01){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x19a'),_0x4a4b01['label']));return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x19b'));};AGIVertices['prototype'][_0x7c81('0x19c')]=function(_0x54c4f4){logger['info'](util['format'](_0x7c81('0x19d'),_0x54c4f4['label']));if(!this[_0x7c81('0x89')](_0x54c4f4[_0x7c81('0x19e')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20sms\x20account\x20configured');}var _0x45b9bf=this[_0x7c81('0x37')][_0x7c81('0xa8')](this,_0x54c4f4[_0x7c81('0x19e')]);if(!_0x45b9bf){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x54c4f4,_0x7c81('0x19f'));}var _0x12449c={'body':_0x54c4f4[_0x7c81('0x1a0')],'phone':_0x54c4f4['to']||'','SmsAccountId':_0x45b9bf['id']};logger[_0x7c81('0x195')](_0x7c81('0x1a1'),JSON['stringify'](_0x12449c));this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0x54c4f4,_0x54c4f4[_0x7c81('0x19e')]);this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x45b9bf[_0x7c81('0x16')]));this[_0x7c81('0x39')][_0x7c81('0xa8')](this,_0x12449c);return this[_0x7c81('0xf')][_0x7c81('0xab')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x7c81('0x1a2')]=function(_0x21e51){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x21e51[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x21e51[_0x7c81('0xdd')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x21e51,_0x7c81('0x1a3'));}var _0x54294d=this[_0x7c81('0x12')]['sync'](this,_0x21e51[_0x7c81('0xdd')]);if(!_0x54294d){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x21e51,_0x7c81('0xde'));}return this[_0x7c81('0xf')][_0x7c81('0xa1')](_0x54294d,_0x21e51[_0x7c81('0x1a4')]);};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1a5')]=function(_0x167c6d){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x1a6'),_0x167c6d[_0x7c81('0x3c')]));this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x1a7'));if(_0x167c6d['answer']===_0x7c81('0x1a8')){this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x1a9'));return this[_0x7c81('0xf')][_0x7c81('0xbd')]();}return this[_0x7c81('0xf')][_0x7c81('0xab')](_0x7c81('0x1aa'));};AGIVertices['prototype'][_0x7c81('0x1ab')]=function(_0x5150ed){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x1ac'),_0x5150ed[_0x7c81('0x3c')]));if(!this[_0x7c81('0x89')](_0x5150ed[_0x7c81('0x1ad')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5150ed,_0x7c81('0x1ae'));}var _0x3f0788=this[_0x7c81('0x1a')][_0x7c81('0xa8')](this,_0x5150ed[_0x7c81('0x1ad')]);if(!this[_0x7c81('0x89')](_0x3f0788)){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5150ed,util[_0x7c81('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5150ed[_0x7c81('0x1ad')]));}if(_0x3f0788===this[_0x7c81('0xf')][_0x7c81('0x3d')]){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5150ed,_0x7c81('0x1af'));}this[_0x7c81('0x3a')][_0x7c81('0xa8')](this,_0x5150ed,_0x3f0788);var _0x457664=this[_0x7c81('0xf')]['exec'](_0x7c81('0x1b0'),util['format'](_0x7c81('0x1b1'),config[_0x7c81('0x8')][_0x7c81('0x1b2')]||'127.0.0.1',_0x3f0788,this[_0x7c81('0xf')][_0x7c81('0x3d')]));if(_0x457664['result']===-0x1){return _0x457664;}return this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0xcb'),_0x7c81('0x1b0'),_0x3f0788));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1b3')]=function(_0x226847){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x1b4'),_0x226847[_0x7c81('0x3c')]));var _0x38bc0c=this[_0x7c81('0x59')]['sync'](this,_0x226847[_0x7c81('0xbb')]);this['createSquareDetailsReport'][_0x7c81('0xa8')](this,_0x226847,_0x226847[_0x7c81('0xbb')]);if(this[_0x7c81('0x89')](_0x226847[_0x7c81('0xdd')])){var _0x2433c0=this['getVariable'][_0x7c81('0xa8')](this,_0x226847[_0x7c81('0xdd')]);if(_0x2433c0){this[_0x7c81('0xf')][_0x7c81('0xa1')](_0x2433c0,_0x38bc0c);return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x1b5'),_0x226847['command'],_0x2433c0));}}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x1b6'),_0x226847[_0x7c81('0xbb')]));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1b7')]=function(_0x5cb3c0){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x5cb3c0[_0x7c81('0x3c')]));_0x5cb3c0[_0x7c81('0x60')]=_0x5cb3c0[_0x7c81('0x60')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5cb3c0[_0x7c81('0x5e')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20apiKey\x20configured');}if(!this[_0x7c81('0x89')](_0x5cb3c0[_0x7c81('0x60')])){return this[_0x7c81('0xf')][_0x7c81('0xab')]('no\x20text\x20configured');}this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x1b8'),_0x5cb3c0['text']));var _0x40dce9=this[_0x7c81('0x5d')][_0x7c81('0xa8')](this,_0x5cb3c0);if(_0x40dce9){this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x1b9'),_0x40dce9));var _0x13c139=this[_0x7c81('0xf')][_0x7c81('0x108')](_0x40dce9);try{fs[_0x7c81('0x109')](_0x40dce9+_0x7c81('0x12a'));}catch(_0x12d126){logger[_0x7c81('0x2f')](_0x12d126);}return _0x13c139;}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x5cb3c0,_0x7c81('0x1ba'));};AGIVertices['prototype'][_0x7c81('0x1bb')]=function(_0x892682){logger[_0x7c81('0x33')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x892682[_0x7c81('0x3c')]));_0x892682[_0x7c81('0x60')]=_0x892682[_0x7c81('0x60')][_0x7c81('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7c81('0x89')](_0x892682['text'])){return this[_0x7c81('0xf')]['noop']('no\x20text\x20configured');}this[_0x7c81('0xf')]['noop'](util[_0x7c81('0x2b')](_0x7c81('0x1bc'),_0x892682[_0x7c81('0x60')]));var _0x2728e4=this['googleTTS'][_0x7c81('0xa8')](this,_0x892682);if(_0x2728e4){this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x2728e4));var _0x1b0207=this['channel'][_0x7c81('0x108')](_0x2728e4);try{fs['unlink'](_0x2728e4+_0x7c81('0x12a'));}catch(_0x3976f8){logger[_0x7c81('0x2f')](_0x3976f8);}return _0x1b0207;}return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x892682,_0x7c81('0x1bd'));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1be')]=function(_0x3b9eb1){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x1bf'),_0x3b9eb1[_0x7c81('0x3c')]));if(!this['isConfigured'](_0x3b9eb1[_0x7c81('0x15c')])){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x3b9eb1,_0x7c81('0x15d'));}logger['info'](util[_0x7c81('0x2b')](_0x7c81('0x15e'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x3b9eb1[_0x7c81('0x15c')]));var _0x1bf3da=this[_0x7c81('0x53')][_0x7c81('0xa8')](this,_0x3b9eb1[_0x7c81('0x15c')]);if(_0x1bf3da){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x3b9eb1['findBy']));this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x3b9eb1[_0x7c81('0x15c')]));return{'code':0xc8,'result':_0x7c81('0x161')};}else{logger[_0x7c81('0x33')](util[_0x7c81('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x3b9eb1['findBy']));this['channel'][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0x162'),this[_0x7c81('0xf')][_0x7c81('0x3f')],_0x3b9eb1[_0x7c81('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x7c81('0x1c0')]=function(_0x18304a){logger[_0x7c81('0x33')](util['format'](_0x7c81('0x1c1'),_0x18304a['label']));var _0x1ee542=this[_0x7c81('0xf')][_0x7c81('0x5a')](_0x7c81('0x1c2'),[_0x18304a['mailbox'],_0x18304a[_0x7c81('0x7c')]]);if(_0x1ee542[_0x7c81('0xa7')]===-0x1){return _0x1ee542;}return this[_0x7c81('0xf')][_0x7c81('0xab')](util[_0x7c81('0x2b')](_0x7c81('0xcb'),_0x7c81('0x1c2'),_0x18304a[_0x7c81('0x1c3')]));};AGIVertices[_0x7c81('0x11')][_0x7c81('0x1c4')]=function(_0x2c557d){logger[_0x7c81('0x33')](util[_0x7c81('0x2b')](_0x7c81('0x1c5'),_0x2c557d['label']));if(!this['isConfigured'](_0x2c557d['variable_id'])){return this[_0x7c81('0xf')]['error'](_0x2c557d,_0x7c81('0x1a3'));}var _0x26923f=this[_0x7c81('0x12')][_0x7c81('0xa8')](this,_0x2c557d[_0x7c81('0xdd')]);if(!_0x26923f){return this[_0x7c81('0xf')][_0x7c81('0x2f')](_0x2c557d,_0x7c81('0xde'));}var _0x532298=this[_0x7c81('0xf')][_0x7c81('0x12')](_0x26923f);return{'code':0xc8,'result':_0x532298[_0x7c81('0xa4')]?_0x532298[_0x7c81('0xa4')]:'-'};};String[_0x7c81('0x11')][_0x7c81('0xa3')]=function(_0x479bcc,_0x403bb5){return this[_0x7c81('0xa2')](_0x479bcc)[_0x7c81('0x1c6')](_0x403bb5);};module[_0x7c81('0x1c7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c99777b..1620fe9 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 _0xeee8=['acwTimeout','lastPauseAt','format','uniqueid','update','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','message','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw'];(function(_0x4365bd,_0x4b939d){var _0x337edb=function(_0x4037b7){while(--_0x4037b7){_0x4365bd['push'](_0x4365bd['shift']());}};_0x337edb(++_0x4b939d);}(_0xeee8,0x174));var _0x8eee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeee8[_0x2dafbe];return _0x58a45a;};'use strict';var util=require('util');var _=require(_0x8eee('0x0'));var moment=require(_0x8eee('0x1'));var ami=require(_0x8eee('0x2'));var logger=require(_0x8eee('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x8eee('0x4'));function Acw(_0x561936){this[_0x8eee('0x5')]=_0x561936[_0x8eee('0x5')];this[_0x8eee('0x6')]=_0x561936[_0x8eee('0x6')];this['timers']=_0x561936[_0x8eee('0x7')];this[_0x8eee('0x8')]={};ami['on'](_0x8eee('0x9'),this[_0x8eee('0xa')][_0x8eee('0xb')](this));ami['on']('hanguprequest',this[_0x8eee('0xc')][_0x8eee('0xb')](this));ami['on'](_0x8eee('0xd'),this[_0x8eee('0xe')][_0x8eee('0xb')](this));ami['on'](_0x8eee('0xf'),this[_0x8eee('0x10')][_0x8eee('0xb')](this));ami['on'](_0x8eee('0x11'),this[_0x8eee('0x12')][_0x8eee('0xb')](this));ami['on'](_0x8eee('0x13'),this[_0x8eee('0x14')][_0x8eee('0xb')](this));ami['on'](_0x8eee('0x15'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x316c54){var _0x571e25=moment()[_0x8eee('0x16')](0x0);var _0x511117=moment(_0x316c54)[_0x8eee('0x16')](0x0);return _0x571e25[_0x8eee('0x17')](_0x511117,_0x8eee('0x18'));}Acw[_0x8eee('0x19')][_0x8eee('0x1a')]=function(_0x323add){try{var _0x486109=this;var _0x3ea7ad=this[_0x8eee('0x8')][_0x323add][_0x8eee('0x1b')];var _0x3a5664=this[_0x8eee('0x8')][_0x323add][_0x8eee('0x1c')];var _0x37209b=this[_0x8eee('0x5')][_0x3a5664];var _0x500245=![];var _0x1c525b='ACW';if(_0x37209b[_0x8eee('0x1d')]){if(_0x37209b['mandatoryDispositionPause'][_0x8eee('0x1e')]){_0x500245=!![];_0x1c525b=_0x37209b[_0x8eee('0x1f')]['name'];}}ami[_0x8eee('0x20')]({'action':'QueuePause','interface':_0x3ea7ad,'paused':!![],'reason':_0x1c525b})[_0x8eee('0x21')](function(_0xbf8087){if(_0x486109['agents'][_0x3ea7ad]){return RpcUser[_0x8eee('0x22')](_0x486109[_0x8eee('0x6')][_0x3ea7ad]['id'])[_0x8eee('0x21')](function(_0x2edd97){if(_0x2edd97&&!_0x2edd97[_0x8eee('0x23')]){logger[_0x8eee('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x323add,_0x3ea7ad,_0x3a5664);var _0x47810e=_0x486109[_0x8eee('0x8')][_0x323add][_0x8eee('0x25')]&&_0x486109['channels'][_0x323add][_0x8eee('0x26')]?_0x486109[_0x8eee('0x8')][_0x323add]['destlinkedid']:_0x323add;return RpcUser[_0x8eee('0x27')](_0x486109[_0x8eee('0x6')][_0x3ea7ad],_0x1c525b,_0x47810e)['then'](function(_0x1d5457){if(!_0x500245){_0x486109['timers'][_0x3ea7ad]={};logger[_0x8eee('0x24')](_0x8eee('0x28'),_0x323add,_0x486109[_0x8eee('0x5')][_0x3a5664]['acwTimeout'],_0x3ea7ad,_0x3a5664);_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x29')]=setTimeout(_0x486109[_0x8eee('0x2a')][_0x8eee('0xb')](_0x486109,_0x3ea7ad),_0x486109['voiceQueues'][_0x3a5664][_0x8eee('0x2b')]*0x3e8);_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x2c')]=moment()[_0x8eee('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x2e')]=_0x323add;_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x1c')]=_0x3a5664;_0x486109[_0x8eee('0x7')][_0x3ea7ad]['updateAcw']=function(){var _0x17043e=getDiff(_0x486109['timers'][_0x3ea7ad]['lastPauseAt']);clearTimeout(_0x486109['timers'][_0x3ea7ad][_0x8eee('0x29')]);_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x29')]=![];RpcVoiceAgentReport[_0x8eee('0x2f')]({'acwtime':_0x17043e},_0x486109[_0x8eee('0x7')][_0x3ea7ad][_0x8eee('0x2e')],_0x3ea7ad)['then'](function(_0x193364){logger[_0x8eee('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x323add,_0x17043e,_0x193364);})[_0x8eee('0x30')](function(_0xe6f71b){logger['error'](_0x8eee('0x31'),_0x323add,_0xe6f71b);});delete _0x486109[_0x8eee('0x7')][_0x3ea7ad];};}});}else{logger[_0x8eee('0x24')](_0x8eee('0x32'),_0x323add,_0x3ea7ad,_0x3a5664);}});}})['catch'](function(_0x290ce3){logger[_0x8eee('0x33')](_0x8eee('0x28'),_0x323add,_0x486109[_0x8eee('0x5')][_0x3a5664]['acwTimeout'],_0x3ea7ad,_0x3a5664);})[_0x8eee('0x34')](function(){delete _0x486109[_0x8eee('0x8')][_0x323add];});}catch(_0x5967d3){logger['error'](_0x8eee('0x35'),_0x5967d3['message']);}};Acw['prototype'][_0x8eee('0x2a')]=function(_0x5f14bd){try{var _0x4ae4fd=this;if(_0x4ae4fd['timers'][_0x5f14bd]){_0x4ae4fd[_0x8eee('0x7')][_0x5f14bd][_0x8eee('0x29')]=![];var _0x61f8c4=_0x4ae4fd[_0x8eee('0x7')][_0x5f14bd][_0x8eee('0x2e')];var _0x47ca17=_0x4ae4fd[_0x8eee('0x7')][_0x5f14bd]['queue'];var _0x1df5f4=_0x4ae4fd[_0x8eee('0x5')][_0x47ca17]['acwTimeout'];logger[_0x8eee('0x24')](_0x8eee('0x36'),_0x61f8c4,_0x5f14bd);RpcUser[_0x8eee('0x37')](this[_0x8eee('0x6')][_0x5f14bd]);RpcVoiceAgentReport[_0x8eee('0x2f')]({'acwtime':_0x1df5f4,'agentacw':!![]},_0x61f8c4,_0x5f14bd)[_0x8eee('0x21')](function(_0x414fca){logger[_0x8eee('0x24')](_0x8eee('0x38'),_0x61f8c4,_0x1df5f4,_0x414fca);})[_0x8eee('0x30')](function(_0x46170e){logger[_0x8eee('0x33')](_0x8eee('0x31'),_0x61f8c4,_0x46170e);});}else{logger[_0x8eee('0x33')](_0x8eee('0x39'),_0x5f14bd);if(_0x4ae4fd['timers']){logger[_0x8eee('0x24')](_0x8eee('0x3a'),JSON['stringify'](_0x4ae4fd[_0x8eee('0x7')]));}}}catch(_0xc3f00b){logger[_0x8eee('0x33')]('[ACW][STOP]\x20%s',_0xc3f00b[_0x8eee('0x3b')]);}};Acw[_0x8eee('0x19')][_0x8eee('0xa')]=function(_0x35e4a9){try{if(this[_0x8eee('0x5')][_0x35e4a9['queue']]&&(this[_0x8eee('0x5')][_0x35e4a9[_0x8eee('0x1c')]][_0x8eee('0x3c')]||this['voiceQueues'][_0x35e4a9[_0x8eee('0x1c')]][_0x8eee('0x1d')])){if(this[_0x8eee('0x6')][_0x35e4a9[_0x8eee('0x1b')]]){this[_0x8eee('0x8')][_0x35e4a9[_0x8eee('0x2e')]]={'queue':_0x35e4a9[_0x8eee('0x1c')],'interface':_0x35e4a9[_0x8eee('0x1b')],'destlinkedid':_0x35e4a9['destlinkedid']};}}}catch(_0x4ebb4c){logger[_0x8eee('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x4ebb4c['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x1180bf){try{if(this[_0x8eee('0x5')][_0x1180bf[_0x8eee('0x1c')]]&&(this[_0x8eee('0x5')][_0x1180bf[_0x8eee('0x1c')]]['acw']||this[_0x8eee('0x5')][_0x1180bf[_0x8eee('0x1c')]][_0x8eee('0x1d')])){if(this['agents'][_0x1180bf['interface']]){this['channels'][_0x1180bf['uniqueid']]={'queue':_0x1180bf[_0x8eee('0x1c')],'interface':_0x1180bf[_0x8eee('0x1b')]};}}}catch(_0x2f61b6){logger[_0x8eee('0x33')](_0x8eee('0x3d'),_0x2f61b6['message']);}};Acw[_0x8eee('0x19')][_0x8eee('0xc')]=function(_0x43d10a){try{if(this['channels'][_0x43d10a['uniqueid']]&&_[_0x8eee('0x3e')](this[_0x8eee('0x8')][_0x43d10a[_0x8eee('0x2e')]][_0x8eee('0x25')])){logger[_0x8eee('0x24')]('[%s][HANGUP:UNIQUEID]',_0x43d10a[_0x8eee('0x2e')]);this['startAcw'](_0x43d10a[_0x8eee('0x2e')]);}else if(this[_0x8eee('0x8')][_0x43d10a['linkedid']]&&_[_0x8eee('0x3e')](this[_0x8eee('0x8')][_0x43d10a[_0x8eee('0x3f')]][_0x8eee('0x25')])){logger['info'](_0x8eee('0x40'),_0x43d10a[_0x8eee('0x3f')]);this[_0x8eee('0x1a')](_0x43d10a[_0x8eee('0x3f')]);}}catch(_0x116176){logger[_0x8eee('0x33')](_0x8eee('0x41'),_0x116176[_0x8eee('0x3b')]);}};Acw[_0x8eee('0x19')][_0x8eee('0xe')]=function(_0x9ff0ff){try{if(this[_0x8eee('0x8')][_0x9ff0ff[_0x8eee('0x2e')]]&&this[_0x8eee('0x8')][_0x9ff0ff[_0x8eee('0x2e')]]['attended']){logger[_0x8eee('0x24')](_0x8eee('0x42'),_0x9ff0ff[_0x8eee('0x2e')]);this['startAcw'](_0x9ff0ff[_0x8eee('0x2e')]);}else if(this[_0x8eee('0x8')][_0x9ff0ff['linkedid']]&&this[_0x8eee('0x8')][_0x9ff0ff[_0x8eee('0x3f')]][_0x8eee('0x25')]){logger[_0x8eee('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x9ff0ff[_0x8eee('0x3f')]);this[_0x8eee('0x1a')](_0x9ff0ff['linkedid']);}}catch(_0x5778e2){logger[_0x8eee('0x33')](_0x8eee('0x43'),_0x5778e2[_0x8eee('0x3b')]);}};Acw[_0x8eee('0x19')][_0x8eee('0x12')]=function(_0x531873){try{if(!_['isNil'](this['channels'][_0x531873[_0x8eee('0x44')]])){this['startAcw'](_0x531873[_0x8eee('0x44')]);if(this[_0x8eee('0x8')][_0x531873['secondtransfereruniqueid']]){this[_0x8eee('0x8')][_0x531873[_0x8eee('0x45')]][_0x8eee('0x25')]=!![];this[_0x8eee('0x8')][_0x531873[_0x8eee('0x46')]]=this[_0x8eee('0x8')][_0x531873[_0x8eee('0x45')]];delete this['channels'][_0x531873[_0x8eee('0x45')]];}}else if(!_['isNil'](this[_0x8eee('0x8')][_0x531873[_0x8eee('0x46')]])){this['startAcw'](_0x531873[_0x8eee('0x46')]);if(this[_0x8eee('0x8')][_0x531873[_0x8eee('0x47')]]){this['channels'][_0x531873[_0x8eee('0x47')]][_0x8eee('0x25')]=!![];this[_0x8eee('0x8')][_0x531873[_0x8eee('0x44')]]=this[_0x8eee('0x8')][_0x531873[_0x8eee('0x47')]];delete this['channels'][_0x531873[_0x8eee('0x47')]];}}}catch(_0x36f249){logger['error'](_0x8eee('0x48'),_0x36f249[_0x8eee('0x3b')]);}};Acw['prototype'][_0x8eee('0x14')]=function(_0x1e7277){try{if(this[_0x8eee('0x8')][_0x1e7277['transfereruniqueid']]){logger[_0x8eee('0x24')](_0x8eee('0x49'),JSON[_0x8eee('0x4a')](_0x1e7277[_0x8eee('0x4b')]));this[_0x8eee('0x1a')](_0x1e7277['transfereruniqueid']);}else if(this['channels'][_0x1e7277['transfererlinkedid']]){logger[_0x8eee('0x24')](_0x8eee('0x4c'),JSON['stringify'](_0x1e7277['transfererlinkedid']));this[_0x8eee('0x1a')](_0x1e7277['transfererlinkedid']);}}catch(_0x3dbc5d){logger[_0x8eee('0x33')](_0x8eee('0x4d'),_0x3dbc5d['message']);}};Acw[_0x8eee('0x19')][_0x8eee('0x10')]=function(_0x270b14){try{if(this['voiceQueues'][_0x270b14[_0x8eee('0x1c')]]&&this[_0x8eee('0x5')][_0x270b14[_0x8eee('0x1c')]][_0x8eee('0x4e')]===_0x8eee('0x4f')){if(this[_0x8eee('0x6')][_0x270b14[_0x8eee('0x1b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x270b14['uniqueid'],_0x270b14[_0x8eee('0x1b')],_0x270b14[_0x8eee('0x1c')]);return RpcUser[_0x8eee('0x27')](this[_0x8eee('0x6')][_0x270b14['interface']],_0x8eee('0x50'),_0x270b14[_0x8eee('0x2e')]);}}}catch(_0x247c13){logger[_0x8eee('0x33')](_0x8eee('0x51'),_0x247c13[_0x8eee('0x3b')]);}};module[_0x8eee('0x52')]=Acw; \ No newline at end of file +var _0x01e8=['[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','destlinkedid','[ACW][syncAgentConnect]\x20%s','acw'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0x01e8,0x6e));var _0x801e=function(_0x2a7d57,_0x27a648){_0x2a7d57=_0x2a7d57-0x0;var _0x5daa90=_0x01e8[_0x2a7d57];return _0x5daa90;};'use strict';var util=require(_0x801e('0x0'));var _=require(_0x801e('0x1'));var moment=require(_0x801e('0x2'));var ami=require('../ami');var logger=require(_0x801e('0x3'))('acw');var RpcUser=require(_0x801e('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x261cb9){this['voiceQueues']=_0x261cb9[_0x801e('0x5')];this[_0x801e('0x6')]=_0x261cb9['agents'];this[_0x801e('0x7')]=_0x261cb9[_0x801e('0x7')];this[_0x801e('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x801e('0x9')](this));ami['on'](_0x801e('0xa'),this['syncHangupRequest'][_0x801e('0x9')](this));ami['on'](_0x801e('0xb'),this['syncHangup'][_0x801e('0x9')](this));ami['on'](_0x801e('0xc'),this[_0x801e('0xd')]['bind'](this));ami['on'](_0x801e('0xe'),this[_0x801e('0xf')][_0x801e('0x9')](this));ami['on'](_0x801e('0x10'),this[_0x801e('0x11')]['bind'](this));ami['on'](_0x801e('0x12'),this[_0x801e('0x13')][_0x801e('0x9')](this));}function getDiff(_0x25661e){var _0x59b6f1=moment()[_0x801e('0x14')](0x0);var _0x217c1b=moment(_0x25661e)[_0x801e('0x14')](0x0);return _0x59b6f1[_0x801e('0x15')](_0x217c1b,_0x801e('0x16'));}Acw[_0x801e('0x17')][_0x801e('0x18')]=function(_0x1d4251){try{var _0x575706=this;var _0x378434=this[_0x801e('0x8')][_0x1d4251][_0x801e('0x19')];var _0x4ae23b=this[_0x801e('0x8')][_0x1d4251][_0x801e('0x1a')];var _0xf37f04=this['voiceQueues'][_0x4ae23b];var _0x1f482d=![];var _0x15b068=_0x801e('0x1b');if(_0xf37f04[_0x801e('0x1c')]){if(_0xf37f04[_0x801e('0x1d')][_0x801e('0x1e')]){_0x1f482d=!![];_0x15b068=_0xf37f04['mandatoryDispositionPause'][_0x801e('0x1e')];}}ami[_0x801e('0x1f')]({'action':'QueuePause','interface':_0x378434,'paused':!![],'reason':_0x15b068})[_0x801e('0x20')](function(_0xb07cfc){if(_0x575706[_0x801e('0x6')][_0x378434]){return RpcUser[_0x801e('0x21')](_0x575706[_0x801e('0x6')][_0x378434]['id'])['then'](function(_0x4649d8){if(_0x4649d8&&!_0x4649d8[_0x801e('0x22')]){logger[_0x801e('0x23')](_0x801e('0x24'),_0x1d4251,_0x378434,_0x4ae23b);var _0x38bb5f=_0x575706['channels'][_0x1d4251]['attended']&&_0x575706[_0x801e('0x8')][_0x1d4251]['destlinkedid']?_0x575706['channels'][_0x1d4251]['destlinkedid']:_0x1d4251;return RpcUser['savePause'](_0x575706[_0x801e('0x6')][_0x378434],_0x15b068,_0x38bb5f)[_0x801e('0x20')](function(_0x101219){if(!_0x1f482d){_0x575706[_0x801e('0x7')][_0x378434]={};logger[_0x801e('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1d4251,_0x575706[_0x801e('0x5')][_0x4ae23b][_0x801e('0x25')],_0x378434,_0x4ae23b);_0x575706[_0x801e('0x7')][_0x378434][_0x801e('0x26')]=setTimeout(_0x575706[_0x801e('0x27')][_0x801e('0x9')](_0x575706,_0x378434),_0x575706[_0x801e('0x5')][_0x4ae23b][_0x801e('0x25')]*0x3e8);_0x575706[_0x801e('0x7')][_0x378434][_0x801e('0x28')]=moment()[_0x801e('0x29')](_0x801e('0x2a'));_0x575706[_0x801e('0x7')][_0x378434][_0x801e('0x2b')]=_0x1d4251;_0x575706[_0x801e('0x7')][_0x378434][_0x801e('0x1a')]=_0x4ae23b;_0x575706['timers'][_0x378434][_0x801e('0x2c')]=function(){var _0x2fc7cd=getDiff(_0x575706[_0x801e('0x7')][_0x378434]['lastPauseAt']);clearTimeout(_0x575706[_0x801e('0x7')][_0x378434]['timer']);_0x575706[_0x801e('0x7')][_0x378434]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x2fc7cd},_0x575706[_0x801e('0x7')][_0x378434][_0x801e('0x2b')],_0x378434)[_0x801e('0x20')](function(_0x5b5291){logger[_0x801e('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1d4251,_0x2fc7cd,_0x5b5291);})['catch'](function(_0x3eab4b){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1d4251,_0x3eab4b);});delete _0x575706[_0x801e('0x7')][_0x378434];};}});}else{logger[_0x801e('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1d4251,_0x378434,_0x4ae23b);}});}})[_0x801e('0x2d')](function(_0x905ff3){logger[_0x801e('0x2e')](_0x801e('0x2f'),_0x1d4251,_0x575706['voiceQueues'][_0x4ae23b][_0x801e('0x25')],_0x378434,_0x4ae23b);})['finally'](function(){delete _0x575706[_0x801e('0x8')][_0x1d4251];});}catch(_0x56b8cc){logger['error'](_0x801e('0x30'),_0x56b8cc[_0x801e('0x31')]);}};Acw['prototype'][_0x801e('0x27')]=function(_0x330370){try{var _0xa775d3=this;if(_0xa775d3[_0x801e('0x7')][_0x330370]){_0xa775d3[_0x801e('0x7')][_0x330370][_0x801e('0x26')]=![];var _0x135049=_0xa775d3[_0x801e('0x7')][_0x330370]['uniqueid'];var _0x185194=_0xa775d3[_0x801e('0x7')][_0x330370][_0x801e('0x1a')];var _0x549861=_0xa775d3[_0x801e('0x5')][_0x185194][_0x801e('0x25')];logger['info'](_0x801e('0x32'),_0x135049,_0x330370);RpcUser[_0x801e('0x33')](this['agents'][_0x330370]);RpcVoiceAgentReport['update']({'acwtime':_0x549861,'agentacw':!![]},_0x135049,_0x330370)['then'](function(_0x1e1dff){logger[_0x801e('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x135049,_0x549861,_0x1e1dff);})['catch'](function(_0xa8573c){logger[_0x801e('0x2e')](_0x801e('0x34'),_0x135049,_0xa8573c);});}else{logger[_0x801e('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x330370);if(_0xa775d3[_0x801e('0x7')]){logger['info'](_0x801e('0x35'),JSON[_0x801e('0x36')](_0xa775d3[_0x801e('0x7')]));}}}catch(_0x321c3b){logger[_0x801e('0x2e')](_0x801e('0x37'),_0x321c3b[_0x801e('0x31')]);}};Acw['prototype'][_0x801e('0x38')]=function(_0x199c8e){try{if(this[_0x801e('0x5')][_0x199c8e[_0x801e('0x1a')]]&&(this[_0x801e('0x5')][_0x199c8e[_0x801e('0x1a')]]['acw']||this['voiceQueues'][_0x199c8e[_0x801e('0x1a')]][_0x801e('0x1c')])){if(this[_0x801e('0x6')][_0x199c8e[_0x801e('0x19')]]){this[_0x801e('0x8')][_0x199c8e[_0x801e('0x2b')]]={'queue':_0x199c8e[_0x801e('0x1a')],'interface':_0x199c8e['interface'],'destlinkedid':_0x199c8e[_0x801e('0x39')]};}}}catch(_0xe2e78d){logger['error'](_0x801e('0x3a'),_0xe2e78d[_0x801e('0x31')]);}};Acw[_0x801e('0x17')][_0x801e('0x13')]=function(_0x3eb73b){try{if(this[_0x801e('0x5')][_0x3eb73b[_0x801e('0x1a')]]&&(this[_0x801e('0x5')][_0x3eb73b['queue']][_0x801e('0x3b')]||this[_0x801e('0x5')][_0x3eb73b['queue']][_0x801e('0x1c')])){if(this['agents'][_0x3eb73b[_0x801e('0x19')]]){this[_0x801e('0x8')][_0x3eb73b[_0x801e('0x2b')]]={'queue':_0x3eb73b[_0x801e('0x1a')],'interface':_0x3eb73b[_0x801e('0x19')]};}}}catch(_0x33b635){logger[_0x801e('0x2e')](_0x801e('0x3c'),_0x33b635[_0x801e('0x31')]);}};Acw['prototype'][_0x801e('0x3d')]=function(_0x447d29){try{if(this[_0x801e('0x8')][_0x447d29[_0x801e('0x2b')]]&&_[_0x801e('0x3e')](this['channels'][_0x447d29[_0x801e('0x2b')]][_0x801e('0x3f')])){logger['info'](_0x801e('0x40'),_0x447d29['uniqueid']);this[_0x801e('0x18')](_0x447d29['uniqueid']);}else if(this[_0x801e('0x8')][_0x447d29[_0x801e('0x41')]]&&_[_0x801e('0x3e')](this['channels'][_0x447d29[_0x801e('0x41')]][_0x801e('0x3f')])){logger[_0x801e('0x23')](_0x801e('0x42'),_0x447d29['linkedid']);this[_0x801e('0x18')](_0x447d29[_0x801e('0x41')]);}}catch(_0x276d79){logger['error'](_0x801e('0x43'),_0x276d79[_0x801e('0x31')]);}};Acw[_0x801e('0x17')][_0x801e('0x44')]=function(_0x3e1a2){try{if(this[_0x801e('0x8')][_0x3e1a2[_0x801e('0x2b')]]&&this[_0x801e('0x8')][_0x3e1a2[_0x801e('0x2b')]][_0x801e('0x3f')]){logger[_0x801e('0x23')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3e1a2[_0x801e('0x2b')]);this[_0x801e('0x18')](_0x3e1a2[_0x801e('0x2b')]);}else if(this[_0x801e('0x8')][_0x3e1a2['linkedid']]&&this[_0x801e('0x8')][_0x3e1a2[_0x801e('0x41')]][_0x801e('0x3f')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3e1a2[_0x801e('0x41')]);this['startAcw'](_0x3e1a2['linkedid']);}}catch(_0x523972){logger['error'](_0x801e('0x45'),_0x523972[_0x801e('0x31')]);}};Acw[_0x801e('0x17')][_0x801e('0xf')]=function(_0x1fe143){try{if(!_[_0x801e('0x46')](this[_0x801e('0x8')][_0x1fe143[_0x801e('0x47')]])){this['startAcw'](_0x1fe143[_0x801e('0x47')]);if(this['channels'][_0x1fe143[_0x801e('0x48')]]){this[_0x801e('0x8')][_0x1fe143[_0x801e('0x48')]]['attended']=!![];this[_0x801e('0x8')][_0x1fe143['transfertargetuniqueid']]=this['channels'][_0x1fe143[_0x801e('0x48')]];delete this[_0x801e('0x8')][_0x1fe143[_0x801e('0x48')]];}}else if(!_[_0x801e('0x46')](this['channels'][_0x1fe143[_0x801e('0x49')]])){this[_0x801e('0x18')](_0x1fe143['transfertargetuniqueid']);if(this[_0x801e('0x8')][_0x1fe143[_0x801e('0x4a')]]){this[_0x801e('0x8')][_0x1fe143[_0x801e('0x4a')]][_0x801e('0x3f')]=!![];this[_0x801e('0x8')][_0x1fe143[_0x801e('0x47')]]=this['channels'][_0x1fe143[_0x801e('0x4a')]];delete this[_0x801e('0x8')][_0x1fe143[_0x801e('0x4a')]];}}}catch(_0x31ff90){logger[_0x801e('0x2e')](_0x801e('0x4b'),_0x31ff90[_0x801e('0x31')]);}};Acw['prototype'][_0x801e('0x11')]=function(_0x1353e1){try{if(this[_0x801e('0x8')][_0x1353e1[_0x801e('0x4c')]]){logger[_0x801e('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x1353e1[_0x801e('0x4c')]));this[_0x801e('0x18')](_0x1353e1['transfereruniqueid']);}else if(this[_0x801e('0x8')][_0x1353e1[_0x801e('0x4d')]]){logger[_0x801e('0x23')](_0x801e('0x4e'),JSON[_0x801e('0x36')](_0x1353e1['transfererlinkedid']));this[_0x801e('0x18')](_0x1353e1[_0x801e('0x4d')]);}}catch(_0x5a58be){logger[_0x801e('0x2e')](_0x801e('0x4f'),_0x5a58be['message']);}};Acw[_0x801e('0x17')][_0x801e('0xd')]=function(_0x3e25c9){try{if(this[_0x801e('0x5')][_0x3e25c9[_0x801e('0x1a')]]&&this[_0x801e('0x5')][_0x3e25c9[_0x801e('0x1a')]][_0x801e('0x50')]===_0x801e('0x51')){if(this[_0x801e('0x6')][_0x3e25c9[_0x801e('0x19')]]){logger[_0x801e('0x23')](_0x801e('0x52'),_0x3e25c9[_0x801e('0x2b')],_0x3e25c9[_0x801e('0x19')],_0x3e25c9[_0x801e('0x1a')]);return RpcUser[_0x801e('0x53')](this['agents'][_0x3e25c9[_0x801e('0x19')]],'Auto-Pause',_0x3e25c9['uniqueid']);}}}catch(_0x4a4e0a){logger[_0x801e('0x2e')](_0x801e('0x54'),_0x4a4e0a[_0x801e('0x31')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a248fc2..56c6684 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 _0x0713=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','[ami.js][fullybooted]','exports','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error'];(function(_0x1ce9ea,_0x32e6f4){var _0x2a95b9=function(_0x1a0496){while(--_0x1a0496){_0x1ce9ea['push'](_0x1ce9ea['shift']());}};_0x2a95b9(++_0x32e6f4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var _=require(_0x3071('0x2'));var logger=require(_0x3071('0x3'))(_0x3071('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x3071('0x5')][_0x3071('0x6')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')][_0x3071('0x8')],!![]);ami[_0x3071('0x9')]();ami[_0x3071('0xa')]=BPromise[_0x3071('0xb')](ami[_0x3071('0xc')]);function error(_0x2fce7a){logger[_0x3071('0xd')](util['format'](_0x3071('0xe'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')]['port'],util[_0x3071('0xf')](_0x2fce7a,![],null)));}function close(){logger[_0x3071('0xd')](util[_0x3071('0x10')](_0x3071('0x11'),config[_0x3071('0x5')]['username'],config['asterisk']['ip'],config[_0x3071('0x5')]['port']));}ami[_0x3071('0x12')]=function(){return function(){return ami[_0x3071('0xa')]({'action':'sipshowregistry'});};};ami[_0x3071('0x13')]=function(){return function(){return ami['Action']({'action':_0x3071('0x14')});};};ami[_0x3071('0x15')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x16')});};};ami[_0x3071('0x17')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x18')});};};ami[_0x3071('0x19')]=function(){return function(){return ami[_0x3071('0xa')]({'action':_0x3071('0x1a')});};};function connect(_0x5f3c22){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x1c'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));ami['once'](_0x3071('0xd'),error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0x3071('0x1f'),function(_0x5cd80d){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x20'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')],util['inspect'](_0x5cd80d,![],null)));});ami['on']('fullybooted',function(_0x2ce48a){logger[_0x3071('0x1b')](util[_0x3071('0x10')](_0x3071('0x21'),config[_0x3071('0x5')][_0x3071('0x7')],config[_0x3071('0x5')]['ip'],config[_0x3071('0x5')][_0x3071('0x6')]));return BPromise['resolve']()[_0x3071('0x22')](ami[_0x3071('0x12')]())[_0x3071('0x22')](ami['actionDeviceStateList']())[_0x3071('0x22')](ami[_0x3071('0x15')]())[_0x3071('0x22')](ami[_0x3071('0x17')]())[_0x3071('0x22')](ami[_0x3071('0x19')]())[_0x3071('0x23')](function(_0x3921a1){logger[_0x3071('0xd')](_0x3071('0x24'),util[_0x3071('0xf')](_0x3921a1,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0x3071('0x1d')](_0x3071('0x1e'),close);module[_0x3071('0x25')]=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(_0x129b46,_0x11b256){var _0x61b8a0=function(_0x5ba629){while(--_0x5ba629){_0x129b46['push'](_0x129b46['shift']());}};_0x61b8a0(++_0x11b256);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b0c7cbd..bb466b0 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(_0x4640ce,_0xaa7776){var _0x233ed4=function(_0x1c9df1){while(--_0x1c9df1){_0x4640ce['push'](_0x4640ce['shift']());}};_0x233ed4(++_0xaa7776);}(_0xaa88,0x137));var _0x8aa8=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0xaa88[_0x5df033];return _0x445829;};'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 _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x4ff6e1,_0x1af5ca){_0x4ff6e1=_0x4ff6e1-0x0;var _0x2780aa=_0x70e0[_0x4ff6e1];return _0x2780aa;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 984c3b0..0c1cc23 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 _0x3886=['ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x241a41,_0x4dd61c){var _0x51a20a=function(_0x35a2be){while(--_0x35a2be){_0x241a41['push'](_0x241a41['shift']());}};_0x51a20a(++_0x4dd61c);}(_0x3886,0x9a));var _0x6388=function(_0xdcc6ab,_0x4a3611){_0xdcc6ab=_0xdcc6ab-0x0;var _0x2aa467=_0x3886[_0xdcc6ab];return _0x2aa467;};'use strict';var util=require(_0x6388('0x0'));var _=require(_0x6388('0x1'));var moment=require(_0x6388('0x2'));function checkNameSurname(_0x5d7919,_0x5666e5,_0x180d96){var _0x32529a='';if(!_['isNil'](_0x5666e5)&&'string'===typeof _0x5666e5){_0x32529a+=_0x5666e5;}if(!_[_0x6388('0x3')](_0x180d96)&&_0x6388('0x4')===typeof _0x180d96){_0x32529a+='\x20'+_0x180d96;}if(_0x32529a!==''){return _0x32529a;}return _0x5d7919;}function Action(_0x261daa,_0x5c5a0e,_0x286220){this['voiceQueue']=_0x261daa;this[_0x6388('0x5')]=_0x286220||undefined;this[_0x6388('0x6')]=checkNameSurname(_0x5c5a0e[_0x6388('0x7')][_0x6388('0x8')],_0x5c5a0e['Contact']['firstName'],_0x5c5a0e[_0x6388('0x7')][_0x6388('0x9')]);this[_0x6388('0xa')]=_0x5c5a0e['phone'];this[_0x6388('0xb')]=_0x261daa[_0x6388('0x6')];this[_0x6388('0xc')]=_0x5c5a0e[_0x6388('0xc')]||![];this['type']=_0x261daa[_0x6388('0xd')];this[_0x6388('0xe')]=_0x261daa[_0x6388('0xe')]||0x3;this[_0x6388('0xf')]=_0x5c5a0e[_0x6388('0xf')];this[_0x6388('0x10')]=_0x5c5a0e[_0x6388('0x10')];this[_0x6388('0x11')]=_0x5c5a0e[_0x6388('0x11')];this[_0x6388('0x12')]=_0x5c5a0e[_0x6388('0x12')];this[_0x6388('0x13')]=_0x5c5a0e[_0x6388('0x13')];this[_0x6388('0x14')]=_0x5c5a0e[_0x6388('0x14')];this[_0x6388('0x15')]=_0x5c5a0e[_0x6388('0x15')];this[_0x6388('0x16')]=_0x5c5a0e[_0x6388('0x16')];this[_0x6388('0x17')]=_0x5c5a0e['countagentrejectretry'];this['ContactId']=_0x5c5a0e[_0x6388('0x18')];this['ListId']=_0x5c5a0e[_0x6388('0x19')];this[_0x6388('0x1a')]=_0x5c5a0e[_0x6388('0x1a')];this[_0x6388('0x1b')]=_0x5c5a0e['VoiceQueueId'];this[_0x6388('0x1c')]=_0x5c5a0e[_0x6388('0x1c')];this[_0x6388('0x1d')]=_0x5c5a0e['id'];this[_0x6388('0x1e')]=_0x5c5a0e[_0x6388('0x7')][_0x6388('0x1f')]||'';this[_0x6388('0x20')]=moment()[_0x6388('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6388('0x22')]=_0x5c5a0e[_0x6388('0x22')];this[_0x6388('0x23')]=_0x5c5a0e['callbackuniqueid'];this['callbackat']=_0x5c5a0e[_0x6388('0x24')];this['recallme']=_0x5c5a0e[_0x6388('0x25')];this['originatecalleridnum']='';this[_0x6388('0x26')]='';}Action[_0x6388('0x27')][_0x6388('0x28')]=function(){return util[_0x6388('0x21')](_0x6388('0x29'),this[_0x6388('0x6')],this[_0x6388('0x2a')][_0x6388('0x2b')]>0x0?this[_0x6388('0xa')][_0x6388('0x2c')](this[_0x6388('0x2a')][_0x6388('0x2b')]):this['number']);};Action['prototype'][_0x6388('0x2d')]=function(){return this[_0x6388('0xb')];};module['exports']=Action; \ No newline at end of file +var _0x5444=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','string','voiceQueue','uniqueid','name','phone','Contact','number','queue','active','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5444,0xb9));var _0x4544=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5444[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x52f35d,_0x527b0b,_0x3bd886){var _0x56a220='';if(!_['isNil'](_0x527b0b)&&_0x4544('0x0')===typeof _0x527b0b){_0x56a220+=_0x527b0b;}if(!_['isNil'](_0x3bd886)&&_0x4544('0x0')===typeof _0x3bd886){_0x56a220+='\x20'+_0x3bd886;}if(_0x56a220!==''){return _0x56a220;}return _0x52f35d;}function Action(_0x5b8215,_0x457948,_0x3a2f85){this[_0x4544('0x1')]=_0x5b8215;this[_0x4544('0x2')]=_0x3a2f85||undefined;this[_0x4544('0x3')]=checkNameSurname(_0x457948['Contact'][_0x4544('0x4')],_0x457948[_0x4544('0x5')]['firstName'],_0x457948['Contact']['lastName']);this[_0x4544('0x6')]=_0x457948[_0x4544('0x4')];this[_0x4544('0x7')]=_0x5b8215[_0x4544('0x3')];this[_0x4544('0x8')]=_0x457948[_0x4544('0x8')]||![];this[_0x4544('0x9')]=_0x5b8215[_0x4544('0x9')];this['dialQueueTimeout']=_0x5b8215['dialQueueTimeout']||0x3;this['scheduledat']=_0x457948[_0x4544('0xa')];this[_0x4544('0xb')]=_0x457948['countbusyretry'];this[_0x4544('0xc')]=_0x457948[_0x4544('0xc')];this[_0x4544('0xd')]=_0x457948[_0x4544('0xd')];this[_0x4544('0xe')]=_0x457948[_0x4544('0xe')];this[_0x4544('0xf')]=_0x457948[_0x4544('0xf')];this[_0x4544('0x10')]=_0x457948[_0x4544('0x10')];this[_0x4544('0x11')]=_0x457948['countmachineretry'];this[_0x4544('0x12')]=_0x457948[_0x4544('0x12')];this[_0x4544('0x13')]=_0x457948[_0x4544('0x13')];this[_0x4544('0x14')]=_0x457948[_0x4544('0x14')];this['UserId']=_0x457948['UserId'];this[_0x4544('0x15')]=_0x457948['VoiceQueueId'];this[_0x4544('0x16')]=_0x457948['CampaignId'];this[_0x4544('0x17')]=_0x457948['id'];this['ContactFirstName']=_0x457948[_0x4544('0x5')][_0x4544('0x18')]||'';this[_0x4544('0x19')]=moment()[_0x4544('0x1a')](_0x4544('0x1b'));this['callback']=_0x457948[_0x4544('0x1c')];this[_0x4544('0x1d')]=_0x457948['callbackuniqueid'];this[_0x4544('0x1e')]=_0x457948[_0x4544('0x1e')];this[_0x4544('0x1f')]=_0x457948['recallme'];this['originatecalleridnum']='';this[_0x4544('0x20')]='';}Action[_0x4544('0x21')]['getCaller']=function(){return util[_0x4544('0x1a')](_0x4544('0x22'),this[_0x4544('0x3')],this[_0x4544('0x1')][_0x4544('0x23')]>0x0?this['number'][_0x4544('0x24')](this[_0x4544('0x1')][_0x4544('0x23')]):this['number']);};Action[_0x4544('0x21')][_0x4544('0x25')]=function(){return this[_0x4544('0x7')];};module[_0x4544('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 666a790..bc0da5d 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 _0x61f8=['state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff'];(function(_0x3e77fa,_0x17a4c1){var _0x4d83cf=function(_0x197fe8){while(--_0x197fe8){_0x3e77fa['push'](_0x3e77fa['shift']());}};_0x4d83cf(++_0x17a4c1);}(_0x61f8,0x83));var _0x861f=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x61f8[_0x45c981];return _0x4f62c8;};'use strict';var util=require(_0x861f('0x0'));var _=require(_0x861f('0x1'));var moment=require(_0x861f('0x2'));function getSeconds(_0xe19b27,_0x323b93){var _0x1d6ff9=moment(_0xe19b27)['milliseconds'](0x0);var _0x5b18bc=moment(_0x323b93)['milliseconds'](0x0);return _0x1d6ff9[_0x861f('0x3')](_0x5b18bc,'seconds');}function AgentComplete(_0x405c2d,_0x253042){this[_0x861f('0x4')]=0x4;this[_0x861f('0x5')]=_0x861f('0x6');this[_0x861f('0x7')]=_0x405c2d['scheduledat'];this[_0x861f('0x8')]=_0x405c2d[_0x861f('0x8')];this['campaigntype']=_0x405c2d[_0x861f('0x8')]===_0x861f('0x9')?'queue':_0x405c2d[_0x861f('0x8')];this[_0x861f('0xa')]=_0x405c2d[_0x861f('0xa')];this['countcongestionretry']=_0x405c2d[_0x861f('0xb')];this[_0x861f('0xc')]=_0x405c2d[_0x861f('0xc')];this[_0x861f('0xd')]=_0x405c2d[_0x861f('0xa')]+_0x405c2d[_0x861f('0xb')]+_0x405c2d[_0x861f('0xc')]+_0x405c2d[_0x861f('0xe')]+_0x405c2d[_0x861f('0xf')]+_0x405c2d[_0x861f('0x10')]+_0x405c2d[_0x861f('0x11')]+_0x405c2d['countagentrejectretry'];this[_0x861f('0xe')]=_0x405c2d[_0x861f('0xe')];this['countdropretry']=_0x405c2d['countdropretry'];this[_0x861f('0x10')]=_0x405c2d[_0x861f('0x10')];this[_0x861f('0x11')]=_0x405c2d[_0x861f('0x11')];this[_0x861f('0x12')]=_0x405c2d[_0x861f('0x12')];this[_0x861f('0x13')]=_0x253042[_0x861f('0x13')];this[_0x861f('0x14')]=_0x405c2d['name'];this[_0x861f('0x15')]=_0x405c2d[_0x861f('0x16')];this[_0x861f('0x17')]=_0x405c2d[_0x861f('0x17')];this[_0x861f('0x18')]=_0x405c2d['responsetime'];this[_0x861f('0x19')]=_0x405c2d[_0x861f('0x19')];this['endtime']=moment()['format'](_0x861f('0x1a'));this[_0x861f('0x1b')]=getSeconds(_0x405c2d[_0x861f('0x18')],_0x405c2d[_0x861f('0x17')]);this[_0x861f('0x1c')]=getSeconds(_0x405c2d[_0x861f('0x19')],_0x405c2d[_0x861f('0x18')]);this['talktime']=getSeconds(this[_0x861f('0x1d')],_0x405c2d['answertime']);this[_0x861f('0x1e')]=_0x253042[_0x861f('0x1e')];this[_0x861f('0x1f')]=_0x253042[_0x861f('0x1f')];this[_0x861f('0x20')]=_0x253042[_0x861f('0x20')];this[_0x861f('0x21')]=_0x405c2d[_0x861f('0x21')];this[_0x861f('0x22')]=_0x405c2d[_0x861f('0x22')];this[_0x861f('0x23')]=_0x405c2d[_0x861f('0x23')];this[_0x861f('0x24')]=_0x405c2d['recallme'];this[_0x861f('0x25')]=_0x405c2d[_0x861f('0x25')];this[_0x861f('0x26')]=_0x405c2d[_0x861f('0x26')];this[_0x861f('0x27')]=_0x405c2d[_0x861f('0x27')];this[_0x861f('0x28')]=_0x405c2d[_0x861f('0x28')];this[_0x861f('0x29')]=_0x405c2d[_0x861f('0x29')];this['originatecalleridnum']=_0x405c2d[_0x861f('0x2a')]||'';this[_0x861f('0x2b')]=_0x405c2d[_0x861f('0x2b')]||'';}module[_0x861f('0x2c')]=AgentComplete; \ No newline at end of file +var _0x9568=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','answertime'];(function(_0x3c33ec,_0xf3941a){var _0x185183=function(_0x1faeb1){while(--_0x1faeb1){_0x3c33ec['push'](_0x3c33ec['shift']());}};_0x185183(++_0xf3941a);}(_0x9568,0xc7));var _0x8956=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x9568[_0x441563];return _0x2369ec;};'use strict';var util=require(_0x8956('0x0'));var _=require(_0x8956('0x1'));var moment=require(_0x8956('0x2'));function getSeconds(_0x366f18,_0x31185d){var _0x5c43e7=moment(_0x366f18)['milliseconds'](0x0);var _0xb79c63=moment(_0x31185d)[_0x8956('0x3')](0x0);return _0x5c43e7['diff'](_0xb79c63,_0x8956('0x4'));}function AgentComplete(_0x506067,_0x3bc61b){this[_0x8956('0x5')]=0x4;this[_0x8956('0x6')]='Answer';this[_0x8956('0x7')]=_0x506067['scheduledat'];this[_0x8956('0x8')]=_0x506067[_0x8956('0x8')];this[_0x8956('0x9')]=_0x506067[_0x8956('0x8')]==='outbound'?_0x8956('0xa'):_0x506067[_0x8956('0x8')];this[_0x8956('0xb')]=_0x506067['countbusyretry'];this['countcongestionretry']=_0x506067[_0x8956('0xc')];this['countnoanswerretry']=_0x506067[_0x8956('0xd')];this[_0x8956('0xe')]=_0x506067['countbusyretry']+_0x506067[_0x8956('0xc')]+_0x506067[_0x8956('0xd')]+_0x506067[_0x8956('0xf')]+_0x506067[_0x8956('0x10')]+_0x506067[_0x8956('0x11')]+_0x506067[_0x8956('0x12')]+_0x506067[_0x8956('0x13')];this[_0x8956('0xf')]=_0x506067[_0x8956('0xf')];this[_0x8956('0x10')]=_0x506067[_0x8956('0x10')];this[_0x8956('0x11')]=_0x506067['countabandonedretry'];this[_0x8956('0x12')]=_0x506067[_0x8956('0x12')];this['countagentrejectretry']=_0x506067[_0x8956('0x13')];this['uniqueid']=_0x3bc61b[_0x8956('0x14')];this['calleridname']=_0x506067['name'];this[_0x8956('0x15')]=_0x506067[_0x8956('0x16')];this[_0x8956('0x17')]=_0x506067[_0x8956('0x17')];this[_0x8956('0x18')]=_0x506067[_0x8956('0x18')];this['answertime']=_0x506067['answertime'];this[_0x8956('0x19')]=moment()[_0x8956('0x1a')](_0x8956('0x1b'));this[_0x8956('0x1c')]=getSeconds(_0x506067['responsetime'],_0x506067[_0x8956('0x17')]);this[_0x8956('0x1d')]=getSeconds(_0x506067[_0x8956('0x1e')],_0x506067[_0x8956('0x18')]);this[_0x8956('0x1f')]=getSeconds(this[_0x8956('0x19')],_0x506067['answertime']);this[_0x8956('0xa')]=_0x3bc61b['queue'];this[_0x8956('0x20')]=_0x3bc61b[_0x8956('0x20')];this['reason']=_0x3bc61b[_0x8956('0x21')];this['callback']=_0x506067[_0x8956('0x22')];this[_0x8956('0x23')]=_0x506067[_0x8956('0x23')];this[_0x8956('0x24')]=_0x506067[_0x8956('0x24')];this[_0x8956('0x25')]=_0x506067[_0x8956('0x25')];this[_0x8956('0x26')]=_0x506067[_0x8956('0x26')];this['ListId']=_0x506067[_0x8956('0x27')];this[_0x8956('0x28')]=_0x506067[_0x8956('0x28')];this[_0x8956('0x29')]=_0x506067[_0x8956('0x29')];this[_0x8956('0x2a')]=_0x506067['CampaignId'];this[_0x8956('0x2b')]=_0x506067[_0x8956('0x2b')]||'';this[_0x8956('0x2c')]=_0x506067[_0x8956('0x2c')]||'';}module[_0x8956('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 0be3bcd..c685266 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 _0xd6d2=['countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x4f64bd,_0x509a17){_0x4f64bd=_0x4f64bd-0x0;var _0xb8927b=_0xd6d2[_0x4f64bd];return _0xb8927b;};'use strict';var util=require(_0x2d6d('0x0'));var _=require(_0x2d6d('0x1'));var moment=require('moment');function getSeconds(_0x19be1a,_0x224caa){var _0x5b4a5b=moment(_0x19be1a)[_0x2d6d('0x2')](0x0);var _0x482d86=moment(_0x224caa)[_0x2d6d('0x2')](0x0);return _0x5b4a5b[_0x2d6d('0x3')](_0x482d86,_0x2d6d('0x4'));}function Final(_0x4a4c5e){this[_0x2d6d('0x5')]=_0x4a4c5e[_0x2d6d('0x5')];this[_0x2d6d('0x6')]=_0x4a4c5e[_0x2d6d('0x6')];this[_0x2d6d('0x7')]=_0x4a4c5e[_0x2d6d('0x7')];this[_0x2d6d('0x8')]=_0x4a4c5e[_0x2d6d('0x7')]===_0x2d6d('0x9')?_0x2d6d('0xa'):_0x4a4c5e[_0x2d6d('0x7')];this['countbusyretry']=_0x4a4c5e[_0x2d6d('0xb')];this[_0x2d6d('0xc')]=_0x4a4c5e[_0x2d6d('0xc')];this[_0x2d6d('0xd')]=_0x4a4c5e[_0x2d6d('0xd')];this['countglobal']=_0x4a4c5e[_0x2d6d('0xb')]+_0x4a4c5e[_0x2d6d('0xc')]+_0x4a4c5e[_0x2d6d('0xd')]+_0x4a4c5e[_0x2d6d('0xe')]+_0x4a4c5e[_0x2d6d('0xf')]+_0x4a4c5e['countabandonedretry']+_0x4a4c5e[_0x2d6d('0x10')]+_0x4a4c5e[_0x2d6d('0x11')];this[_0x2d6d('0xe')]=_0x4a4c5e[_0x2d6d('0xe')];this['countdropretry']=_0x4a4c5e[_0x2d6d('0xf')];this[_0x2d6d('0x12')]=_0x4a4c5e['countabandonedretry'];this['countmachineretry']=_0x4a4c5e[_0x2d6d('0x10')];this[_0x2d6d('0x11')]=_0x4a4c5e[_0x2d6d('0x11')];this['queue']=_0x4a4c5e[_0x2d6d('0xa')];this['calleridname']=_0x4a4c5e['calleridname'];this['calleridnum']=_0x4a4c5e[_0x2d6d('0x13')];this[_0x2d6d('0x14')]=_0x4a4c5e[_0x2d6d('0x14')];this[_0x2d6d('0x15')]=_0x4a4c5e[_0x2d6d('0x15')];this[_0x2d6d('0x16')]=_0x4a4c5e[_0x2d6d('0x15')];this[_0x2d6d('0x17')]=_0x4a4c5e[_0x2d6d('0x17')]||0x0;this['holdtime']=_0x4a4c5e[_0x2d6d('0x18')]||0x0;this[_0x2d6d('0x19')]=_0x4a4c5e['talktime']||0x0;this[_0x2d6d('0x1a')]=_0x4a4c5e[_0x2d6d('0x1a')];this[_0x2d6d('0x1b')]=_0x4a4c5e[_0x2d6d('0x1b')];this[_0x2d6d('0x1c')]=_0x4a4c5e[_0x2d6d('0x1c')];this['recallme']=_0x4a4c5e[_0x2d6d('0x1d')];this[_0x2d6d('0x1e')]=_0x4a4c5e[_0x2d6d('0x1e')];this['ListId']=_0x4a4c5e['ListId'];this[_0x2d6d('0x1f')]=_0x4a4c5e['UserId'];this['VoiceQueueId']=_0x4a4c5e['VoiceQueueId'];this[_0x2d6d('0x20')]=_0x4a4c5e[_0x2d6d('0x20')];this[_0x2d6d('0x21')]=_0x4a4c5e[_0x2d6d('0x21')]||'';this[_0x2d6d('0x22')]=_0x4a4c5e['originatecalleridname']||'';}module[_0x2d6d('0x23')]=Final; \ No newline at end of file +var _0xb138=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','queue','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackat'];(function(_0x535b7b,_0x516f4c){var _0x3be52a=function(_0x522378){while(--_0x522378){_0x535b7b['push'](_0x535b7b['shift']());}};_0x3be52a(++_0x516f4c);}(_0xb138,0x1dd));var _0x8b13=function(_0x1c52ed,_0x351fdc){_0x1c52ed=_0x1c52ed-0x0;var _0x1760a5=_0xb138[_0x1c52ed];return _0x1760a5;};'use strict';var util=require(_0x8b13('0x0'));var _=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));function getSeconds(_0x33f214,_0xadad70){var _0x185752=moment(_0x33f214)[_0x8b13('0x3')](0x0);var _0x5369d4=moment(_0xadad70)[_0x8b13('0x3')](0x0);return _0x185752[_0x8b13('0x4')](_0x5369d4,_0x8b13('0x5'));}function Final(_0x5ae5b2){this[_0x8b13('0x6')]=_0x5ae5b2[_0x8b13('0x6')];this['scheduledat']=_0x5ae5b2[_0x8b13('0x7')];this[_0x8b13('0x8')]=_0x5ae5b2[_0x8b13('0x8')];this['campaigntype']=_0x5ae5b2[_0x8b13('0x8')]===_0x8b13('0x9')?'queue':_0x5ae5b2['type'];this[_0x8b13('0xa')]=_0x5ae5b2[_0x8b13('0xa')];this[_0x8b13('0xb')]=_0x5ae5b2[_0x8b13('0xb')];this[_0x8b13('0xc')]=_0x5ae5b2['countnoanswerretry'];this[_0x8b13('0xd')]=_0x5ae5b2[_0x8b13('0xa')]+_0x5ae5b2[_0x8b13('0xb')]+_0x5ae5b2[_0x8b13('0xc')]+_0x5ae5b2[_0x8b13('0xe')]+_0x5ae5b2[_0x8b13('0xf')]+_0x5ae5b2['countabandonedretry']+_0x5ae5b2['countmachineretry']+_0x5ae5b2[_0x8b13('0x10')];this[_0x8b13('0xe')]=_0x5ae5b2['countnosuchnumberretry'];this['countdropretry']=_0x5ae5b2['countdropretry'];this[_0x8b13('0x11')]=_0x5ae5b2[_0x8b13('0x11')];this[_0x8b13('0x12')]=_0x5ae5b2[_0x8b13('0x12')];this[_0x8b13('0x10')]=_0x5ae5b2['countagentrejectretry'];this[_0x8b13('0x13')]=_0x5ae5b2[_0x8b13('0x13')];this[_0x8b13('0x14')]=_0x5ae5b2[_0x8b13('0x14')];this[_0x8b13('0x15')]=_0x5ae5b2[_0x8b13('0x15')];this[_0x8b13('0x16')]=_0x5ae5b2[_0x8b13('0x16')];this['responsetime']=_0x5ae5b2['responsetime'];this[_0x8b13('0x17')]=_0x5ae5b2[_0x8b13('0x18')];this[_0x8b13('0x19')]=_0x5ae5b2[_0x8b13('0x19')]||0x0;this[_0x8b13('0x1a')]=_0x5ae5b2[_0x8b13('0x1a')]||0x0;this['talktime']=_0x5ae5b2[_0x8b13('0x1b')]||0x0;this[_0x8b13('0x1c')]=_0x5ae5b2[_0x8b13('0x1c')];this['callbackuniqueid']=_0x5ae5b2['callbackuniqueid'];this[_0x8b13('0x1d')]=_0x5ae5b2[_0x8b13('0x1d')];this['recallme']=_0x5ae5b2[_0x8b13('0x1e')];this[_0x8b13('0x1f')]=_0x5ae5b2[_0x8b13('0x1f')];this[_0x8b13('0x20')]=_0x5ae5b2[_0x8b13('0x20')];this['UserId']=_0x5ae5b2[_0x8b13('0x21')];this[_0x8b13('0x22')]=_0x5ae5b2['VoiceQueueId'];this[_0x8b13('0x23')]=_0x5ae5b2['CampaignId'];this[_0x8b13('0x24')]=_0x5ae5b2[_0x8b13('0x24')]||'';this['originatecalleridname']=_0x5ae5b2[_0x8b13('0x25')]||'';}module[_0x8b13('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index f933cb0..d105d01 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 _0xf43e=['countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','endtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3061b6,_0x292311){var _0x1d29ec=function(_0x3c26aa){while(--_0x3c26aa){_0x3061b6['push'](_0x3061b6['shift']());}};_0x1d29ec(++_0x292311);}(_0xf43e,0x73));var _0xef43=function(_0x499a07,_0x5bdd31){_0x499a07=_0x499a07-0x0;var _0x398bfb=_0xf43e[_0x499a07];return _0x398bfb;};'use strict';var util=require(_0xef43('0x0'));var _=require(_0xef43('0x1'));var moment=require(_0xef43('0x2'));function getSeconds(_0x529788,_0x15b673){var _0x35b558=moment(_0x529788)[_0xef43('0x3')](0x0);var _0x454e1d=moment(_0x15b673)[_0xef43('0x3')](0x0);return _0x35b558[_0xef43('0x4')](_0x454e1d,_0xef43('0x5'));}function Hangup(_0x4cb0c4,_0x10d98a){this[_0xef43('0x6')]=0x4;this[_0xef43('0x7')]=_0xef43('0x8');this[_0xef43('0x9')]=_0x4cb0c4['scheduledat'];this[_0xef43('0xa')]=_0x4cb0c4[_0xef43('0xa')];this[_0xef43('0xb')]=_0x4cb0c4[_0xef43('0xa')]===_0xef43('0xc')?_0xef43('0xd'):_0x4cb0c4['type'];this[_0xef43('0xe')]=_0x4cb0c4[_0xef43('0xe')];this['countcongestionretry']=_0x4cb0c4[_0xef43('0xf')];this[_0xef43('0x10')]=_0x4cb0c4[_0xef43('0x10')];this[_0xef43('0x11')]=_0x4cb0c4['countbusyretry']+_0x4cb0c4[_0xef43('0xf')]+_0x4cb0c4['countnoanswerretry']+_0x4cb0c4['countnosuchnumberretry']+_0x4cb0c4[_0xef43('0x12')]+_0x4cb0c4[_0xef43('0x13')]+_0x4cb0c4['countmachineretry']+_0x4cb0c4[_0xef43('0x14')];this[_0xef43('0x15')]=_0x4cb0c4[_0xef43('0x15')];this['countdropretry']=_0x4cb0c4[_0xef43('0x12')];this['countabandonedretry']=_0x4cb0c4[_0xef43('0x13')];this[_0xef43('0x16')]=_0x4cb0c4[_0xef43('0x16')];this[_0xef43('0x14')]=_0x4cb0c4[_0xef43('0x14')];this[_0xef43('0x17')]=_0x10d98a[_0xef43('0x17')];this[_0xef43('0x18')]=_0x4cb0c4[_0xef43('0x19')];this[_0xef43('0x1a')]=_0x4cb0c4['number'];this['starttime']=_0x4cb0c4[_0xef43('0x1b')];this[_0xef43('0x1c')]=_0x4cb0c4[_0xef43('0x1c')];this['endtime']=moment()[_0xef43('0x1d')](_0xef43('0x1e'));this['ringtime']=getSeconds(_0x4cb0c4[_0xef43('0x1c')],_0x4cb0c4[_0xef43('0x1b')]);this[_0xef43('0x1f')]=0x0;this['talktime']=getSeconds(this[_0xef43('0x20')],_0x4cb0c4[_0xef43('0x1c')]);this[_0xef43('0xd')]=_0x4cb0c4[_0xef43('0xd')];this['membername']='IVR';this[_0xef43('0x21')]=_0x10d98a[_0xef43('0x22')];this[_0xef43('0x23')]=_0x4cb0c4['callback'];this['callbackuniqueid']=_0x4cb0c4[_0xef43('0x24')];this['callbackat']=_0x4cb0c4[_0xef43('0x25')];this['recallme']=_0x4cb0c4[_0xef43('0x26')];this['ContactId']=_0x4cb0c4['ContactId'];this['ListId']=_0x4cb0c4[_0xef43('0x27')];this[_0xef43('0x28')]=_0x4cb0c4[_0xef43('0x28')];this[_0xef43('0x29')]=_0x4cb0c4[_0xef43('0x29')];this[_0xef43('0x2a')]=_0x4cb0c4[_0xef43('0x2a')];}module[_0xef43('0x2b')]=Hangup; \ No newline at end of file +var _0x4491=['campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type'];(function(_0x249c3c,_0x31ca64){var _0x1e3339=function(_0x237f68){while(--_0x237f68){_0x249c3c['push'](_0x249c3c['shift']());}};_0x1e3339(++_0x31ca64);}(_0x4491,0x1c5));var _0x1449=function(_0x39ab9b,_0x5e5ec6){_0x39ab9b=_0x39ab9b-0x0;var _0x5acc32=_0x4491[_0x39ab9b];return _0x5acc32;};'use strict';var util=require(_0x1449('0x0'));var _=require(_0x1449('0x1'));var moment=require(_0x1449('0x2'));function getSeconds(_0x4c77d7,_0x5d8400){var _0x308108=moment(_0x4c77d7)[_0x1449('0x3')](0x0);var _0x5c3ba2=moment(_0x5d8400)[_0x1449('0x3')](0x0);return _0x308108[_0x1449('0x4')](_0x5c3ba2,'seconds');}function Hangup(_0x58f9e2,_0x2fb4d6){this[_0x1449('0x5')]=0x4;this[_0x1449('0x6')]='Answer';this['scheduledat']=_0x58f9e2[_0x1449('0x7')];this[_0x1449('0x8')]=_0x58f9e2[_0x1449('0x8')];this[_0x1449('0x9')]=_0x58f9e2['type']===_0x1449('0xa')?_0x1449('0xb'):_0x58f9e2[_0x1449('0x8')];this[_0x1449('0xc')]=_0x58f9e2[_0x1449('0xc')];this['countcongestionretry']=_0x58f9e2['countcongestionretry'];this[_0x1449('0xd')]=_0x58f9e2[_0x1449('0xd')];this['countglobal']=_0x58f9e2[_0x1449('0xc')]+_0x58f9e2[_0x1449('0xe')]+_0x58f9e2[_0x1449('0xd')]+_0x58f9e2[_0x1449('0xf')]+_0x58f9e2[_0x1449('0x10')]+_0x58f9e2['countabandonedretry']+_0x58f9e2[_0x1449('0x11')]+_0x58f9e2[_0x1449('0x12')];this[_0x1449('0xf')]=_0x58f9e2[_0x1449('0xf')];this['countdropretry']=_0x58f9e2[_0x1449('0x10')];this[_0x1449('0x13')]=_0x58f9e2[_0x1449('0x13')];this[_0x1449('0x11')]=_0x58f9e2['countmachineretry'];this[_0x1449('0x12')]=_0x58f9e2[_0x1449('0x12')];this['uniqueid']=_0x2fb4d6[_0x1449('0x14')];this[_0x1449('0x15')]=_0x58f9e2['name'];this[_0x1449('0x16')]=_0x58f9e2['number'];this[_0x1449('0x17')]=_0x58f9e2[_0x1449('0x17')];this['responsetime']=_0x58f9e2[_0x1449('0x18')];this[_0x1449('0x19')]=moment()[_0x1449('0x1a')](_0x1449('0x1b'));this[_0x1449('0x1c')]=getSeconds(_0x58f9e2[_0x1449('0x18')],_0x58f9e2[_0x1449('0x17')]);this[_0x1449('0x1d')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x58f9e2[_0x1449('0x18')]);this['queue']=_0x58f9e2[_0x1449('0xb')];this[_0x1449('0x1e')]=_0x1449('0x1f');this[_0x1449('0x20')]=_0x2fb4d6['cause-txt'];this[_0x1449('0x21')]=_0x58f9e2['callback'];this[_0x1449('0x22')]=_0x58f9e2[_0x1449('0x22')];this[_0x1449('0x23')]=_0x58f9e2['callbackat'];this['recallme']=_0x58f9e2['recallme'];this[_0x1449('0x24')]=_0x58f9e2['ContactId'];this['ListId']=_0x58f9e2[_0x1449('0x25')];this['UserId']=_0x58f9e2[_0x1449('0x26')];this[_0x1449('0x27')]=_0x58f9e2[_0x1449('0x27')];this[_0x1449('0x28')]=_0x58f9e2['CampaignId'];}module[_0x1449('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 32eb25b..91963c0 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 _0x8303=['util','lodash','moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x400f12,_0x274ea7){var _0x516a14=function(_0x32c329){while(--_0x32c329){_0x400f12['push'](_0x400f12['shift']());}};_0x516a14(++_0x274ea7);}(_0x8303,0xa5));var _0x3830=function(_0x401652,_0x12fe30){_0x401652=_0x401652-0x0;var _0x5c92c4=_0x8303[_0x401652];return _0x5c92c4;};'use strict';var util=require(_0x3830('0x0'));var _=require(_0x3830('0x1'));var moment=require(_0x3830('0x2'));function getSeconds(_0x38fb4f,_0x119a78){var _0x5359c8=moment(_0x38fb4f)[_0x3830('0x3')](0x0);var _0x29074a=moment(_0x119a78)[_0x3830('0x3')](0x0);return _0x5359c8['diff'](_0x29074a,'seconds');}function History(_0x2a04ca){this['uniqueid']=_0x2a04ca[_0x3830('0x4')];this[_0x3830('0x5')]=_0x2a04ca[_0x3830('0x5')]||undefined;this[_0x3830('0x6')]=_0x2a04ca[_0x3830('0x6')];this['campaigntype']=_0x2a04ca['type']===_0x3830('0x7')?_0x3830('0x8'):_0x2a04ca[_0x3830('0x6')];this[_0x3830('0x9')]=_0x2a04ca[_0x3830('0x9')];this[_0x3830('0xa')]=_0x2a04ca[_0x3830('0xa')];this[_0x3830('0xb')]=_0x2a04ca['countnoanswerretry'];this['countglobal']=_0x2a04ca[_0x3830('0x9')]+_0x2a04ca[_0x3830('0xa')]+_0x2a04ca[_0x3830('0xb')]+_0x2a04ca[_0x3830('0xc')]+_0x2a04ca[_0x3830('0xd')]+_0x2a04ca['countabandonedretry']+_0x2a04ca[_0x3830('0xe')]+_0x2a04ca[_0x3830('0xf')];this[_0x3830('0xc')]=_0x2a04ca[_0x3830('0xc')];this[_0x3830('0xd')]=_0x2a04ca[_0x3830('0xd')];this[_0x3830('0x10')]=_0x2a04ca[_0x3830('0x10')];this[_0x3830('0xe')]=_0x2a04ca[_0x3830('0xe')];this[_0x3830('0xf')]=_0x2a04ca[_0x3830('0xf')];this[_0x3830('0x8')]=_0x2a04ca[_0x3830('0x8')];this['calleridname']=_0x2a04ca['name'];this['calleridnum']=_0x2a04ca[_0x3830('0x11')];this['starttime']=_0x2a04ca[_0x3830('0x12')];this[_0x3830('0x13')]=_0x2a04ca[_0x3830('0x13')];this[_0x3830('0x14')]=_0x2a04ca[_0x3830('0x13')];this[_0x3830('0x15')]=getSeconds(_0x2a04ca[_0x3830('0x13')],_0x2a04ca['starttime']);this[_0x3830('0x16')]=0x0;this['talktime']=0x0;this[_0x3830('0x17')]=_0x2a04ca[_0x3830('0x17')];this[_0x3830('0x18')]=_0x2a04ca[_0x3830('0x18')];this[_0x3830('0x19')]=_0x2a04ca[_0x3830('0x19')];this['recallme']=_0x2a04ca[_0x3830('0x1a')];this[_0x3830('0x1b')]=_0x2a04ca[_0x3830('0x1b')];this[_0x3830('0x1c')]=_0x2a04ca[_0x3830('0x1c')];this['UserId']=_0x2a04ca['UserId'];this[_0x3830('0x1d')]=_0x2a04ca[_0x3830('0x1d')];this[_0x3830('0x1e')]=_0x2a04ca['CampaignId'];this[_0x3830('0x1f')]=_0x2a04ca['originatecalleridnum']||'';this['originatecalleridname']=_0x2a04ca[_0x3830('0x20')]||'';}module['exports']=History; \ No newline at end of file +var _0x88ac=['number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x88ac,0x124));var _0xc88a=function(_0x4b2873,_0x368dcc){_0x4b2873=_0x4b2873-0x0;var _0x169a18=_0x88ac[_0x4b2873];return _0x169a18;};'use strict';var util=require(_0xc88a('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5be8d3,_0x3d02f8){var _0x3f981e=moment(_0x5be8d3)[_0xc88a('0x1')](0x0);var _0x2aedc5=moment(_0x3d02f8)[_0xc88a('0x1')](0x0);return _0x3f981e['diff'](_0x2aedc5,_0xc88a('0x2'));}function History(_0x246b78){this[_0xc88a('0x3')]=_0x246b78[_0xc88a('0x3')];this[_0xc88a('0x4')]=_0x246b78[_0xc88a('0x4')]||undefined;this[_0xc88a('0x5')]=_0x246b78[_0xc88a('0x5')];this[_0xc88a('0x6')]=_0x246b78[_0xc88a('0x5')]===_0xc88a('0x7')?_0xc88a('0x8'):_0x246b78[_0xc88a('0x5')];this['countbusyretry']=_0x246b78[_0xc88a('0x9')];this['countcongestionretry']=_0x246b78[_0xc88a('0xa')];this[_0xc88a('0xb')]=_0x246b78[_0xc88a('0xb')];this[_0xc88a('0xc')]=_0x246b78[_0xc88a('0x9')]+_0x246b78[_0xc88a('0xa')]+_0x246b78[_0xc88a('0xb')]+_0x246b78[_0xc88a('0xd')]+_0x246b78[_0xc88a('0xe')]+_0x246b78[_0xc88a('0xf')]+_0x246b78['countmachineretry']+_0x246b78['countagentrejectretry'];this[_0xc88a('0xd')]=_0x246b78[_0xc88a('0xd')];this[_0xc88a('0xe')]=_0x246b78['countdropretry'];this[_0xc88a('0xf')]=_0x246b78[_0xc88a('0xf')];this[_0xc88a('0x10')]=_0x246b78[_0xc88a('0x10')];this['countagentrejectretry']=_0x246b78[_0xc88a('0x11')];this[_0xc88a('0x8')]=_0x246b78[_0xc88a('0x8')];this[_0xc88a('0x12')]=_0x246b78[_0xc88a('0x13')];this['calleridnum']=_0x246b78[_0xc88a('0x14')];this[_0xc88a('0x15')]=_0x246b78['starttime'];this['responsetime']=_0x246b78['responsetime'];this[_0xc88a('0x16')]=_0x246b78[_0xc88a('0x17')];this[_0xc88a('0x18')]=getSeconds(_0x246b78['responsetime'],_0x246b78['starttime']);this[_0xc88a('0x19')]=0x0;this[_0xc88a('0x1a')]=0x0;this[_0xc88a('0x1b')]=_0x246b78['callback'];this[_0xc88a('0x1c')]=_0x246b78['callbackuniqueid'];this[_0xc88a('0x1d')]=_0x246b78['callbackat'];this['recallme']=_0x246b78[_0xc88a('0x1e')];this[_0xc88a('0x1f')]=_0x246b78[_0xc88a('0x1f')];this[_0xc88a('0x20')]=_0x246b78['ListId'];this[_0xc88a('0x21')]=_0x246b78[_0xc88a('0x21')];this['VoiceQueueId']=_0x246b78[_0xc88a('0x22')];this[_0xc88a('0x23')]=_0x246b78[_0xc88a('0x23')];this[_0xc88a('0x24')]=_0x246b78['originatecalleridnum']||'';this['originatecalleridname']=_0x246b78[_0xc88a('0x25')]||'';}module[_0xc88a('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 25ff120..3039756 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 _0x64d9=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','voice:queue:%s','ivr','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\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','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','milliseconds','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','reachable','unmonitored','saveInDb','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','state','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countabandonedretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','agiafterat','callAdditionalPhoneAfterMin','additional','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','voiceQueue','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncNewExten','syncQueueMember','actionid','locked','paused','agents','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','run','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','launchHandleIvr','handleIvr','loggedIn','dialTimezone','checkDialMethod','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:dialPreviewRecallReminder','syncCampaigns','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','NONE','\x22%s,%s%s,,,%s\x22','getCaller','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','[originateError]:\x20%s','OriginateError','[originate][error]','syncOriginateResponse','responsetime','getQueue','isSuccess','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','talking','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','busyFactor','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','[countReScheduled]\x20','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','p\x20=\x20','[busyFactor]','exports','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','seconds','emit','type','outbound','strategy','answered','pTalking','sumBillable','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x1005cb,_0x4a7ade){var _0x5e2696=function(_0x6ce4e2){while(--_0x6ce4e2){_0x1005cb['push'](_0x1005cb['shift']());}};_0x5e2696(++_0x4a7ade);}(_0x64d9,0x1d4));var _0x964d=function(_0x4a2dd1,_0x28dcd3){_0x4a2dd1=_0x4a2dd1-0x0;var _0x1cf616=_0x64d9[_0x4a2dd1];return _0x1cf616;};'use strict';var util=require(_0x964d('0x0'));var _=require(_0x964d('0x1'));var uuid=require(_0x964d('0x2'));var moment=require(_0x964d('0x3'));var rr=require('rr');var md5=require(_0x964d('0x4'));var Redis=require('ioredis');var ut=require(_0x964d('0x5'));var config=require(_0x964d('0x6'));var logger=require(_0x964d('0x7'))(_0x964d('0x8'));var loggerBooked=require(_0x964d('0x7'))(_0x964d('0x9'));var loggerPredictive=require(_0x964d('0x7'))(_0x964d('0xa'));var loggerPredictiveCalls=require(_0x964d('0x7'))(_0x964d('0xb'));var loggerSyncQueueSummary=require(_0x964d('0x7'))(_0x964d('0xc'));var ami=require(_0x964d('0xd'));config['redis']=_[_0x964d('0xe')](config[_0x964d('0xf')],{'host':'localhost','port':0x18eb});var io=require(_0x964d('0x10'))(new Redis(config[_0x964d('0xf')]));var cmHopper=require(_0x964d('0x11'));var cmHopperHistory=require(_0x964d('0x12'));var cmHopperAdditionalPhone=require(_0x964d('0x13'));var cmHopperBlack=require(_0x964d('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x964d('0x15'));var Action=require(_0x964d('0x16'));var History=require(_0x964d('0x17'));var Final=require('./final');var AgentComplete=require(_0x964d('0x18'));var QueueCallerAbandon=require(_0x964d('0x19'));var Hangup=require('./hangup');var ipAgi=process[_0x964d('0x1a')][_0x964d('0x1b')]||_0x964d('0x1c');var strategy={'rrmemory':_0x964d('0x1d'),'roundrobin':_0x964d('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x964d('0x1f')][_0x964d('0x20')]=function(_0x20f083){this[_0x964d('0x21')]=this[_0x964d('0x21')]?this[_0x964d('0x21')][_0x964d('0x22')](_0x20f083):_0x20f083();};function Dialer(_0x395e6e,_0x1ddc8d){this[_0x964d('0x23')]=new Sequence();this['preview']=_0x1ddc8d;this['voiceQueues']=_0x395e6e[_0x964d('0x24')];this['campaigns']=_0x395e6e[_0x964d('0x25')];this['agents']=_0x395e6e['agents'];this['trunks']=_0x395e6e[_0x964d('0x26')];this[_0x964d('0x27')]=config[_0x964d('0x27')]||0x2;this[_0x964d('0x28')]={};this[_0x964d('0x29')]={};this[_0x964d('0x2a')]={};this[_0x964d('0x2b')]={};this[_0x964d('0x2c')]={};this[_0x964d('0x2d')]={};this[_0x964d('0x2e')]={};this[_0x964d('0x2f')]={};this[_0x964d('0x30')]={};this[_0x964d('0x31')]={};ami['on'](_0x964d('0x32'),this[_0x964d('0x33')][_0x964d('0x34')](this));ami['on']('queuecallerabandon',this[_0x964d('0x35')][_0x964d('0x34')](this));ami['on'](_0x964d('0x36'),this['syncOriginateResponse'][_0x964d('0x34')](this));ami['on'](_0x964d('0x37'),this[_0x964d('0x38')]['bind'](this));ami['on'](_0x964d('0x39'),this[_0x964d('0xc')][_0x964d('0x34')](this));ami['on'](_0x964d('0x3a'),this[_0x964d('0x3b')][_0x964d('0x34')](this));ami['on'](_0x964d('0x3c'),this[_0x964d('0x3d')][_0x964d('0x34')](this));ami['on'](_0x964d('0x3e'),this['syncNewExten'][_0x964d('0x34')](this));ami['on']('varset',this[_0x964d('0x3f')]['bind'](this));ami['on'](_0x964d('0x40'),this['syncQueueMember']['bind'](this));ami['on'](_0x964d('0x41'),this[_0x964d('0x42')][_0x964d('0x34')](this));this['loopCampaigns']();this[_0x964d('0x43')]();RpcSetting[_0x964d('0x44')]()[_0x964d('0x45')](function(_0xe3088c){previewRecallmeReminderInterval=_0xe3088c[_0x964d('0x46')];});}function isNotNull(_0xbecc3d){return _0xbecc3d!==null&&!_[_0x964d('0x47')](_0xbecc3d);}function checkIsLoggedIn(_0x3e325f,_0x2617b1){return function(){if(_0x2617b1<=0x0){_0x3e325f[_0x964d('0x48')]=_0x964d('0x49');throw _0x3e325f[_0x964d('0x4a')]+_0x964d('0x4b');}};}function isActive(_0x1ae31a){return _0x1ae31a;}function checkIsActive(_0x9e117c,_0x10ac30){return function(){if(!isActive(_0x10ac30)){_0x9e117c[_0x964d('0x48')]=_0x964d('0x4c');throw _0x9e117c[_0x964d('0x4a')]+_0x964d('0x4d');}};}function checkInterval(_0x4c1a7a){return function(){if(!isNotNull(_0x4c1a7a[_0x964d('0x4e')])){_0x4c1a7a['message']=_0x964d('0x4f');throw _0x4c1a7a[_0x964d('0x4a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4c1a7a[_0x964d('0x4e')][_0x964d('0x50')])){_0x4c1a7a[_0x964d('0x48')]=_0x964d('0x4f');throw _0x4c1a7a[_0x964d('0x4a')]+_0x964d('0x51');}if(!isNotNull(_[_0x964d('0x52')](_0x4c1a7a[_0x964d('0x4e')][_0x964d('0x50')]))){_0x4c1a7a[_0x964d('0x48')]='INTERVAL_IS_NULL';throw _0x4c1a7a[_0x964d('0x4a')]+_0x964d('0x51');}};}function msgResponse(_0x3d4093,_0x56b530,_0x21e989){return{'action':_0x3d4093,'response':_0x56b530,'message':_0x21e989,'stack':_0x21e989};}function myreject(_0x288c5e){return function(_0x8b6078){return _0x288c5e(msgResponse(_0x964d('0x53'),_0x964d('0x54'),JSON[_0x964d('0x55')](_0x8b6078)));};}function getSeconds(_0x560cd8,_0x2dc6b1){var _0x363485=moment(_0x560cd8)['milliseconds'](0x0);var _0x5bc070=moment(_0x2dc6b1)['milliseconds'](0x0);return _0x363485['diff'](_0x5bc070,_0x964d('0x56'));}function emit(_0x51a682,_0x12d428,_0x2e79dc){io['to'](_0x51a682)[_0x964d('0x57')](_0x12d428,_0x2e79dc);}function emitVoiceQueueSummary(_0x42c830){if(_0x42c830[_0x964d('0x58')]===_0x964d('0x59')){var _0x282cae={'id':_0x42c830['id'],'name':_0x42c830[_0x964d('0x4a')],'strategy':_0x42c830[_0x964d('0x5a')],'answered':_0x42c830[_0x964d('0x5b')],'available':_0x42c830['available'],'loggedIn':_0x42c830['loggedIn'],'pTalking':_0x42c830[_0x964d('0x5c')],'sumBillable':_0x42c830[_0x964d('0x5d')],'sumDuration':_0x42c830['sumDuration'],'sumHoldTime':_0x42c830['sumHoldTime']||0x0,'talking':_0x42c830['talking'],'total':_0x42c830[_0x964d('0x5e')],'type':_0x42c830['type'],'unmanaged':_0x42c830[_0x964d('0x5f')],'abandoned':_0x42c830[_0x964d('0x60')],'waiting':_0x42c830['waiting'],'loggedInDb':_0x42c830[_0x964d('0x61')],'dialActive':_0x42c830[_0x964d('0x62')],'dialMethod':_0x42c830[_0x964d('0x63')],'dialOriginateCallerIdName':_0x42c830[_0x964d('0x64')],'dialOriginateCallerIdNumber':_0x42c830[_0x964d('0x65')],'dialOriginateTimeout':_0x42c830[_0x964d('0x66')],'dialPrefix':_0x42c830['dialPrefix'],'outboundAnswerAgiCallsDay':_0x42c830['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x42c830[_0x964d('0x67')],'outboundBlacklistCallsDay':_0x42c830[_0x964d('0x68')],'outboundBusyCallsDay':_0x42c830[_0x964d('0x69')],'outboundCongestionCallsDay':_0x42c830[_0x964d('0x6a')],'outboundDropCallsDayACS':_0x42c830['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x42c830[_0x964d('0x6b')],'outboundDropCallsDayTimeout':_0x42c830[_0x964d('0x6c')],'outboundNoAnswerCallsDay':_0x42c830[_0x964d('0x6d')],'outboundNoSuchCallsDay':_0x42c830[_0x964d('0x6e')],'outboundOriginateFailureCallsDay':_0x42c830[_0x964d('0x6f')],'outboundReCallsDay':_0x42c830[_0x964d('0x70')],'outboundRejectCallsDay':_0x42c830[_0x964d('0x71')],'outboundUnknownCallsDay':_0x42c830[_0x964d('0x72')],'predictiveIntervalAnsweredCalls':_0x42c830['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x42c830['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x42c830[_0x964d('0x73')],'predictiveIntervalDroppedCallsCallersExit':_0x42c830[_0x964d('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x42c830['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x42c830[_0x964d('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x42c830[_0x964d('0x76')],'predictiveIntervalHitRate':_0x42c830[_0x964d('0x77')],'predictiveIntervalMultiplicativeFactor':_0x42c830[_0x964d('0x78')],'predictiveIntervalPauses':_0x42c830['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x42c830[_0x964d('0x79')],'predictiveIntervalTotalCalls':_0x42c830[_0x964d('0x7a')],'message':_0x42c830[_0x964d('0x48')],'originated':_0x42c830[_0x964d('0x7b')],'erlangCalls':_0x42c830['erlangCalls'],'erlangCallToSecond':_0x42c830['erlangCallToSecond'],'erlangAbandonmentRate':_0x42c830[_0x964d('0x7c')],'erlangBusyFactor':_0x42c830[_0x964d('0x7d')],'startPredictive':_0x42c830[_0x964d('0x2d')],'startProgressive':_0x42c830[_0x964d('0x2e')]};if(_0x42c830['Trunk']){_0x282cae[_0x964d('0x7e')]={'id':_0x42c830[_0x964d('0x7e')]['id'],'name':_0x42c830[_0x964d('0x7e')][_0x964d('0x4a')],'active':_0x42c830['Trunk'][_0x964d('0x7f')],'callerid':_0x42c830['Trunk']['callerid']};}if(_0x42c830['Interval']){_0x282cae[_0x964d('0x4e')]={'id':_0x42c830['Interval']['id'],'name':_0x42c830[_0x964d('0x4e')][_0x964d('0x4a')]};}var _0x370305=md5(JSON[_0x964d('0x55')](_0x282cae));if(_0x42c830[_0x964d('0x4')]!==_0x370305){_0x42c830['md5']=_0x370305;emit(util['format'](_0x964d('0x80'),_0x282cae[_0x964d('0x4a')]),'voice_queue:save',_0x282cae);}}}function emitCampaignSummary(_0x5dc448){if(_0x5dc448[_0x964d('0x58')]===_0x964d('0x81')){emit(util[_0x964d('0x82')]('campaign:ivr:%s',_0x5dc448[_0x964d('0x4a')]),_0x964d('0x83'),_0x5dc448);}}function checkGetDataPredictive(_0xa3049){if(isNotNull(_0xa3049)&&!_[_0x964d('0x52')](_0xa3049)){loggerPredictive[_0x964d('0x84')](_0x964d('0x85'));loggerPredictive[_0x964d('0x84')](_0x964d('0x86'),_0xa3049[_0x964d('0x7a')]);loggerPredictive['info'](_0x964d('0x87'),_0xa3049[_0x964d('0x88')]);loggerPredictive[_0x964d('0x84')](_0x964d('0x89'),_0xa3049['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x964d('0x84')](_0x964d('0x8a'),_0xa3049[_0x964d('0x74')]);loggerPredictive[_0x964d('0x84')](_0x964d('0x8b'),_0xa3049[_0x964d('0x8c')]);loggerPredictive['info'](_0x964d('0x8d'),_0xa3049[_0x964d('0x73')]);loggerPredictive['info'](_0x964d('0x8e'));if(_0xa3049['predictiveIntervalTotalCalls']>0x0){if(!_[_0x964d('0x47')](_0xa3049['predictiveIntervalAvgTalktime'])&&_0xa3049['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x964d('0x8f'));if(!_[_0x964d('0x47')](_0xa3049[_0x964d('0x8c')])&&_0xa3049[_0x964d('0x8c')]>0x0){return!![];}loggerPredictive[_0x964d('0x84')](_0x964d('0x90'));}else{loggerPredictive[_0x964d('0x84')](_0x964d('0x91'));}}else{loggerPredictive[_0x964d('0x84')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2d4f4a){return function(_0x552820){loggerPredictive[_0x964d('0x84')](_0x964d('0x92'));loggerPredictive[_0x964d('0x84')](_0x964d('0x93'),_0x552820[_0x964d('0x94')]);loggerPredictive[_0x964d('0x84')](_0x964d('0x95'),_0x552820['erlangCallToSecond']);loggerPredictive[_0x964d('0x84')](_0x964d('0x96'),_0x552820[_0x964d('0x7c')]);loggerPredictive['info'](_0x964d('0x97'),_0x552820[_0x964d('0x7d')]);loggerPredictive['info'](_0x964d('0x96'),_0x552820[_0x964d('0x7c')]);loggerPredictive[_0x964d('0x84')](_0x964d('0x8e'));_[_0x964d('0x98')](_0x2d4f4a,_0x552820);};}function getDiff(_0x36edde){var _0x27cf49=moment()[_0x964d('0x99')](0x0);var _0x1d38a9=moment(_0x36edde)[_0x964d('0x99')](0x0);return _0x27cf49[_0x964d('0x9a')](_0x1d38a9,'seconds');}function ifInterval(_0x588ab6,_0x372dbb){if(_[_0x964d('0x47')](_0x372dbb)){return![];}return getDiff(_0x372dbb)<_0x588ab6*0x3c;}function freeVariablesPredictive(_0x560f9c){if(isNotNull(_0x560f9c)){if(!_['isUndefined'](_0x560f9c[_0x964d('0x2e')])){_0x560f9c[_0x964d('0x2e')]=undefined;loggerPredictive[_0x964d('0x84')](_0x560f9c[_0x964d('0x4a')],_0x964d('0x9b'));}if(!_[_0x964d('0x47')](_0x560f9c[_0x964d('0x2d')])){_0x560f9c[_0x964d('0x2d')]=undefined;loggerPredictive[_0x964d('0x84')](_0x560f9c[_0x964d('0x4a')],_0x964d('0x9c'));}if(!_[_0x964d('0x47')](_0x560f9c[_0x964d('0x9d')])){clearInterval(_0x560f9c[_0x964d('0x9d')]);_0x560f9c[_0x964d('0x9d')]=undefined;loggerPredictive[_0x964d('0x84')](_0x560f9c[_0x964d('0x4a')],_0x964d('0x9e'));}}}function erlangb(_0x42a1cf,_0x211f42){if(_0x211f42===0x0){return 0x0;}var _0xf27571=0x1;for(var _0x48a620=0x1;_0x48a620<=_0x211f42;_0x48a620+=0x1){_0xf27571=0x1+_0xf27571*_0x48a620/_0x42a1cf;}return 0x1/_0xf27571;}function isVoiceQueueOutbound(_0x52db41){return _0x52db41===_0x964d('0x59');}function isNotPreview(_0x4d28bf){return _0x4d28bf!==_0x964d('0x9f');}function isCampaignIvr(_0x138504){return _0x138504===_0x964d('0x81');}function getCallerId(_0x33ceed,_0x42166e,_0x2916af){if(!_[_0x964d('0x47')](_0x2916af)&&typeof _0x2916af===_0x964d('0xa0')&&!_[_0x964d('0x52')](_0x2916af)){if(!_[_0x964d('0x47')](_0x42166e)&&typeof _0x42166e===_0x964d('0xa0')&&!_[_0x964d('0x52')](_0x42166e)){return util[_0x964d('0x82')](_0x964d('0xa1'),_0x42166e,_0x2916af);}return util[_0x964d('0x82')](_0x964d('0xa1'),_0x2916af,_0x2916af);}if(!_[_0x964d('0x47')](_0x33ceed)&&typeof _0x33ceed===_0x964d('0xa0')&&!_[_0x964d('0x52')](_0x33ceed)){return _0x33ceed;}return _0x964d('0xa2');}function loggerCatchQueueSummary(_0x5569a2,_0x3ea324){return function(_0x1661d0){freeVariablesPredictive(_0x3ea324);emitVoiceQueueSummary(_0x3ea324);emitCampaignSummary(_0x3ea324);loggerSyncQueueSummary[_0x964d('0xa3')](_0x5569a2,util[_0x964d('0xa4')](_0x1661d0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x138cc8,_0xa88618){return function(_0x336496){loggerPredictive[_0x964d('0xa5')](_0xa88618[_0x964d('0x4a')],_0x138cc8);loggerPredictive['error'](_0x336496['stack']);freeVariablesPredictive(_0xa88618);};}function loggerCatch(_0x2f5d12){return function(_0x528314){logger[_0x964d('0xa5')](_0x2f5d12,util[_0x964d('0xa4')](_0x528314,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2cf7cb){return _0x2cf7cb&&!_[_0x964d('0x47')](_0x2cf7cb)&&_0x2cf7cb[_0x964d('0xa6')]>0x0;}function decremetOriginate(_0x5bd0ea){if(!_[_0x964d('0x47')](_0x5bd0ea)&&_0x5bd0ea!==null){if(typeof _0x5bd0ea[_0x964d('0x7b')]!==_0x964d('0xa7')){if(_0x5bd0ea[_0x964d('0x7b')]>0x0){_0x5bd0ea[_0x964d('0x7b')]-=0x1;}else{logger['error'](_0x964d('0xa8'));}}}else{logger['error'](_0x964d('0xa9'));}}function checkContactLowerLimitOriginate(_0x1864bd,_0x5efeb4,_0x3388ad){if(_0x5efeb4>_0x3388ad){for(var _0x34c330=0x0;_0x34c330<_0x5efeb4-_0x3388ad;_0x34c330+=0x1){decremetOriginate(_0x1864bd);}}}function loggerGetContactDialer(_0x4c97fb,_0x514652,_0x42e969){return function(_0xe80878){checkContactLowerLimitOriginate(_0x514652,_0x42e969,0x0);logger[_0x964d('0xa5')](_0x4c97fb,util[_0x964d('0xa4')](_0xe80878,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x465eac){return function(_0x22deed){if(isNotNull(_0x22deed)&&isNotNull(_0x22deed[0x0])){if(_0x22deed[0x0][_0x964d('0xaa')]>0x0){_0x465eac[_0x964d('0x48')]=_0x964d('0xab');logger[_0x964d('0x84')](_0x964d('0xac')+_0x465eac[_0x964d('0x4a')],_0x22deed[0x0]['contactsRescheduled'],_0x964d('0xad'));}else{_0x465eac[_0x964d('0x48')]=_0x964d('0xae');logger[_0x964d('0x84')]('[getContactDialer2][Empty]'+_0x465eac[_0x964d('0x4a')]);}}};}function notSendMessagesQueue(_0x10889a){if(_0x10889a[_0x964d('0xaf')]){freeVariablesPredictive(_0x10889a);if(_0x10889a[_0x964d('0x7b')]===0x0&&_0x10889a['talking']===0x0&&_0x10889a[_0x964d('0xb0')]===0x0&&(_0x10889a[_0x964d('0x5c')]||0x0)===0x0){_0x10889a[_0x964d('0xaf')]=![];_0x10889a[_0x964d('0xb1')]=0x0;_0x10889a['message']=_0x964d('0x4c');loggerSyncQueueSummary[_0x964d('0xa3')](_0x964d('0xb2'),_0x10889a['name'],'is\x20not\x20active');}else{_0x10889a[_0x964d('0x48')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x964d('0xa3')](_0x964d('0xb2'),_0x10889a[_0x964d('0x4a')],_0x964d('0xb3'));}emitVoiceQueueSummary(_0x10889a);}}function notSendMessagesCampaign(_0x4fc0a3){if(_0x4fc0a3[_0x964d('0xaf')]){if(_0x4fc0a3[_0x964d('0x7b')]===0x0){_0x4fc0a3[_0x964d('0xaf')]=![];_0x4fc0a3[_0x964d('0x48')]=_0x964d('0x4c');loggerSyncQueueSummary[_0x964d('0xa3')](_0x964d('0xb4'),_0x4fc0a3[_0x964d('0x4a')],'is\x20not\x20active');}else{_0x4fc0a3['message']=_0x964d('0xb5');loggerSyncQueueSummary[_0x964d('0xa3')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4fc0a3['name'],_0x964d('0xb3'));}emitCampaignSummary(_0x4fc0a3);}}function createObjHistory(_0x59c8e0,_0x1542c2,_0x552952,_0x3d7991,_0x125a09){_0x59c8e0[_0x964d('0x48')]=_0x552952;var _0x38ae5e=new Action(_0x59c8e0,_0x1542c2);var _0x12a241=new History(_0x38ae5e);_0x12a241['state']=_0x3d7991;_0x12a241[_0x964d('0xb6')]=_0x125a09;_0x12a241['endtime']=_0x38ae5e[_0x964d('0xb7')];return _0x12a241;}Dialer['prototype'][_0x964d('0x43')]=function(){var _0x4aa9f9=this;setInterval(function(){_0x4aa9f9[_0x964d('0xb8')](_0x4aa9f9[_0x964d('0x2b')],_0x964d('0xb9'));_0x4aa9f9[_0x964d('0xb8')](_0x4aa9f9[_0x964d('0x29')],'[actions]');},0x32c8);};Dialer[_0x964d('0x1f')][_0x964d('0xb8')]=function(_0x563679,_0x53f98e){var _0x4f3dce=this;for(var _0x42d7dc in _0x563679){if(typeof _0x563679[_0x42d7dc]!==_0x964d('0xa7')){this[_0x964d('0x23')][_0x964d('0x20')](function(){if(!_[_0x964d('0xba')](_0x563679[_0x42d7dc])){return ami[_0x964d('0xbb')]({'action':_0x964d('0xbc'),'channel':_0x563679[_0x42d7dc][_0x964d('0xbd')]})['catch'](function(_0x586dbe){if(_0x586dbe[_0x964d('0x48')]===_0x964d('0xbe')){setTimeout(function(){if(_0x563679[_0x42d7dc]&&_0x563679[_0x42d7dc][_0x964d('0x58')]!==_0x964d('0x81')){_0x4f3dce[_0x964d('0xbf')](_0x4f3dce[_0x964d('0x24')][_0x563679[_0x42d7dc]['queue']]);logger[_0x964d('0xa5')](_0x964d('0xc0'),_0x53f98e,_0x42d7dc,_0x563679[_0x42d7dc][_0x964d('0xc1')]);delete _0x563679[_0x42d7dc];}if(_0x563679[_0x42d7dc]&&_0x563679[_0x42d7dc][_0x964d('0x58')]==='ivr'){_0x4f3dce[_0x964d('0xbf')](_0x4f3dce[_0x964d('0x25')][_0x563679[_0x42d7dc]['queue']]);logger[_0x964d('0xa5')](_0x964d('0xc2'),_0x53f98e,_0x42d7dc,_0x563679[_0x42d7dc][_0x964d('0xc1')]);delete _0x563679[_0x42d7dc];}},0x2328);}});}});}}};Dialer[_0x964d('0x1f')][_0x964d('0xc3')]=function(_0x5bbc08){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0xc3')](_0x5bbc08))[_0x964d('0xc5')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x964d('0xc6')]=function(_0x369327){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopperBlack['checkIsBlackList'](_0x369327))[_0x964d('0xc5')](loggerCatch(_0x964d('0xc7')));};Dialer['prototype'][_0x964d('0xc8')]=function(_0x2bb32b,_0x72625e,_0x1dab0c){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopperAdditionalPhone[_0x964d('0xc8')](_0x2bb32b,_0x72625e,_0x1dab0c))[_0x964d('0xc5')](loggerCatch(_0x964d('0xc9')));};Dialer[_0x964d('0x1f')][_0x964d('0xca')]=function(_0x231ce8,_0x1faffd,_0x55f88e){return Promise['resolve']()[_0x964d('0x45')](cmHopperAdditionalPhone[_0x964d('0xca')](_0x231ce8,_0x1faffd,_0x55f88e))['catch'](loggerCatch(_0x964d('0xcb')));};Dialer[_0x964d('0x1f')]['checkIsBlackListIvr']=function(_0x377d0b){return Promise[_0x964d('0xc4')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x377d0b))[_0x964d('0xc5')](loggerCatch(_0x964d('0xcc')));};Dialer['prototype'][_0x964d('0xcd')]=function(_0x575a5c){return Promise['resolve']()[_0x964d('0x45')](cmHopperHistory[_0x964d('0xce')](_0x575a5c))[_0x964d('0xc5')](loggerCatch(_0x964d('0xcf')));};Dialer[_0x964d('0x1f')][_0x964d('0xd0')]=function(_0x5df005){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0xd0')](_0x5df005))['catch'](loggerCatch(_0x964d('0xd1')));};Dialer[_0x964d('0x1f')]['unlockContact']=function(_0x51b9e9,_0x406839,_0x3b2848){return Promise['resolve']()[_0x964d('0x45')](cmHopper['unlockContact'](_0x51b9e9,_0x406839,_0x3b2848))[_0x964d('0xc5')](loggerCatch(_0x964d('0xd2')));};Dialer['prototype']['getContactDialer']=function(_0x5d56f7,_0x256522,_0x3eca00,_0x835e51,_0x1852a0){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0xd3')](_0x5d56f7,_0x256522,_0x3eca00,_0x835e51))[_0x964d('0xc5')](function(_0x1e9380){_0x1852a0['temp']-=_0x3eca00;_0x1852a0[_0x964d('0xd4')]=_0x1852a0[_0x964d('0xd4')]>0x0?_0x1852a0['temp']:0x0;loggerCatch(_0x964d('0xd5'))(_0x1e9380);});};Dialer[_0x964d('0x1f')][_0x964d('0xd6')]=function(_0xce1316,_0x218b4c,_0x47a73a,_0x355a31){return Promise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0xce1316,_0x218b4c,_0x47a73a))[_0x964d('0xc5')](function(_0x5380ab){_0x355a31['temp']-=_0x218b4c;_0x355a31[_0x964d('0xd4')]=_0x355a31[_0x964d('0xd4')]>0x0?_0x355a31[_0x964d('0xd4')]:0x0;loggerCatch(_0x964d('0xd7'))(_0x5380ab);});};Dialer[_0x964d('0x1f')][_0x964d('0xd8')]=function(_0x3a0eab){return Promise['resolve']()[_0x964d('0x45')](voiceQueueRt[_0x964d('0xd8')](_0x3a0eab))['catch'](loggerCatch(_0x964d('0xd9')));};Dialer[_0x964d('0x1f')][_0x964d('0xda')]=function(_0x39fc97){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0xda')](_0x39fc97))['catch'](loggerCatch(_0x964d('0xdb')));};Dialer['prototype'][_0x964d('0xdc')]=function(_0x191a6b){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopperHistory[_0x964d('0xdc')](_0x191a6b))[_0x964d('0xc5')](loggerCatch(_0x964d('0xdd')));};Dialer[_0x964d('0x1f')]['updateOriginated']=function(_0x430de4){if(!_['isUndefined'](_0x430de4)&&_0x430de4!==null){if(typeof _0x430de4['originated']!==_0x964d('0xa7')){if(_0x430de4[_0x964d('0x7b')]>0x0){_0x430de4[_0x964d('0x7b')]-=0x1;}else{logger[_0x964d('0xa5')](_0x964d('0xde'));}}}else{logger[_0x964d('0xa5')](_0x964d('0xdf'));}};Dialer['prototype'][_0x964d('0xe0')]=function(_0x2d0cf4,_0x36ffc7){var _0x232bac=this;return function(_0x2798b6){_0x232bac[_0x964d('0xbf')](_0x36ffc7);logger[_0x964d('0xa5')](_0x2d0cf4,util[_0x964d('0xa4')](_0x2798b6,{'showHidden':![],'depth':null}));};};Dialer[_0x964d('0x1f')][_0x964d('0xe1')]=function(_0xecfc0,_0x29b44e,_0x13ecdc){var _0x18c2d1={'state':0x19,'statedesc':_0x964d('0xe2')};this['updateOriginated'](_0x29b44e);this['saveInDb'](_[_0x964d('0x98')](_0x18c2d1,_[_0x964d('0xe3')](_0x13ecdc,[_0x964d('0xe4'),_0x964d('0xe5'),'UserId',_0x964d('0xe6'),_0x964d('0xe7')])),_0x964d('0xe8'),'[emptyContact]');logger[_0x964d('0xa5')](_0xecfc0);};Dialer['prototype']['isSuccess']=function(_0x41e57f){return _0x41e57f===_0x964d('0xe9');};Dialer[_0x964d('0x1f')]['isTrunkReachable']=function(_0x466f57){return!_[_0x964d('0x47')](_0x466f57)&&_0x466f57&&!_[_0x964d('0x47')](_0x466f57[_0x964d('0x4a')])&&!_[_0x964d('0x47')](_0x466f57['active'])&&_0x466f57[_0x964d('0x7f')]&&(this[_0x964d('0x26')][util[_0x964d('0x82')](_0x964d('0xea'),_0x466f57['name'])][_0x964d('0xbc')]===_0x964d('0xeb')||this[_0x964d('0x26')][util[_0x964d('0x82')](_0x964d('0xea'),_0x466f57['name'])][_0x964d('0xbc')]===_0x964d('0xec'));};Dialer[_0x964d('0x1f')][_0x964d('0xed')]=function(_0x4fa84c,_0x93a6bd,_0x6606f){this[_0x964d('0xdc')](_0x4fa84c)[_0x964d('0xc5')](loggerCatch(_0x93a6bd));this['moveContactManagedDialer'](_0x4fa84c)[_0x964d('0xc5')](loggerCatch(_0x6606f));};Dialer[_0x964d('0x1f')][_0x964d('0x3f')]=function(_0x2a9336){var _0xb5bd42=this;var _0x3730df=this[_0x964d('0x2b')][_0x2a9336['uniqueid']];var _0x1b8047;if(!_[_0x964d('0xba')](_0x2a9336)&&!_['isNil'](_0x2a9336[_0x964d('0xee')])&&!_[_0x964d('0xba')](_0x2a9336[_0x964d('0xee')]['amdstatus'])&&_0x2a9336[_0x964d('0xef')]===_0x964d('0xf0')&&_0x3730df){if(_0x3730df[_0x964d('0x58')]!==_0x964d('0x81')&&this[_0x964d('0x24')][_0x3730df[_0x964d('0xc1')]][_0x964d('0xf1')]&&_0x2a9336[_0x964d('0xf2')]===_0x964d('0xf3')){delete this[_0x964d('0x2b')][_0x2a9336[_0x964d('0xf4')]];this['updateOriginated'](this[_0x964d('0x24')][_0x3730df['queue']]);this[_0x964d('0x24')][_0x3730df[_0x964d('0xc1')]][_0x964d('0x67')]+=0x1;this['voiceQueues'][_0x3730df['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x1b8047=new Hangup(_0x3730df,_0x2a9336);_0x1b8047[_0x964d('0xf5')]=0x12;_0x1b8047[_0x964d('0xb6')]=_0x964d('0xf6');_0x1b8047[_0x964d('0xf7')]=_0x964d('0xf8');ami[_0x964d('0x57')]('custom:amd',ut[_0x964d('0xf9')](_0x1b8047,_0x964d('0xfa')));this['saveInDb'](_0x1b8047,_0x964d('0xfb'),_0x964d('0xfc'));}if(_0x3730df[_0x964d('0x58')]!==_0x964d('0x81')&&this[_0x964d('0x24')][_0x3730df[_0x964d('0xc1')]][_0x964d('0xf1')]&&_0x2a9336[_0x964d('0xf2')]===_0x964d('0xfd')){return new Promise(function(_0x42a69b,_0x124663){delete _0xb5bd42['uniqueId'][_0x2a9336[_0x964d('0xf4')]];_0xb5bd42[_0x964d('0xbf')](_0xb5bd42[_0x964d('0x24')][_0x3730df[_0x964d('0xc1')]]);_0xb5bd42[_0x964d('0x24')][_0x3730df['queue']][_0x964d('0x67')]+=0x1;_0xb5bd42[_0x964d('0x24')][_0x3730df['queue']][_0x964d('0xfe')]+=0x1;var _0x247b47=_0xb5bd42['voiceQueues'][_0x3730df[_0x964d('0xc1')]];var _0x484710=new Hangup(_0x3730df,_0x2a9336);_0x484710[_0x964d('0xf5')]=0x13;_0x484710[_0x964d('0xb6')]=_0x964d('0xff');_0x484710[_0x964d('0xf7')]=_0x964d('0xf8');_0x484710[_0x964d('0x100')]+=0x1;_0x484710[_0x964d('0x101')]+=0x1;_0x484710[_0x964d('0xfa')]=!![];ami[_0x964d('0x57')](_0x964d('0x102'),ut[_0x964d('0xf9')](_0x484710,_0x964d('0xfa')));_0xb5bd42[_0x964d('0xdc')](_0x484710)[_0x964d('0xc5')](loggerCatch(_0x964d('0x103')));if(_0x484710['countbusyretry']+_0x484710[_0x964d('0x104')]+_0x484710[_0x964d('0x105')]+_0x484710[_0x964d('0x106')]+_0x484710[_0x964d('0x107')]+_0x484710['countabandonedretry']+_0x484710[_0x964d('0x100')]+_0x484710[_0x964d('0x108')]>=_0x247b47[_0x964d('0x109')]){_0xb5bd42[_0x964d('0x10a')](_0x484710,_0x42a69b,_0x124663,_0x964d('0x10b'));}else{if(_0x484710[_0x964d('0x100')]>=_0x247b47[_0x964d('0x10c')]){_0xb5bd42[_0x964d('0x10d')](_0x484710,_0x42a69b,_0x124663,_0x964d('0x10e'));}else{_0xb5bd42[_0x964d('0xd0')]({'active':![],'countmachineretry':_0x484710[_0x964d('0x100')],'scheduledat':moment()[_0x964d('0x10f')](_0x247b47['dialMachineRetryFrequency'],_0x964d('0x110'))[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x484710[_0x964d('0xe4')],'ListId':_0x484710[_0x964d('0xe5')],'VoiceQueueId':_0x484710[_0x964d('0xe6')]||undefined,'CampaignId':_0x484710[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x112')));_0x42a69b({'reschedule':0x1});}}});}if(_0x3730df[_0x964d('0x58')]===_0x964d('0x81')&&this[_0x964d('0x25')][_0x3730df[_0x964d('0xc1')]][_0x964d('0xf1')]&&_0x2a9336[_0x964d('0xf2')]==='HANGUP'){delete this['uniqueId'][_0x2a9336[_0x964d('0xf4')]];this[_0x964d('0xbf')](this[_0x964d('0x25')][_0x3730df[_0x964d('0xc1')]]);_0x1b8047=new Hangup(_0x3730df,_0x2a9336);_0x1b8047['state']=0x12;_0x1b8047[_0x964d('0xb6')]=_0x964d('0xf6');_0x1b8047[_0x964d('0xf7')]='AMD';ami[_0x964d('0x57')](_0x964d('0x102'),ut[_0x964d('0xf9')](_0x1b8047,'amd'));this[_0x964d('0xed')](_0x1b8047,_0x964d('0x113'),_0x964d('0x114'));}if(_0x3730df['type']==='ivr'&&this['campaigns'][_0x3730df['queue']]['dialAMDActive']&&_0x2a9336[_0x964d('0xf2')]===_0x964d('0xfd')){return new Promise(function(_0x40d7a3,_0x5e96d0){delete _0xb5bd42[_0x964d('0x2b')][_0x2a9336[_0x964d('0xf4')]];_0xb5bd42[_0x964d('0xbf')](_0xb5bd42['campaigns'][_0x3730df[_0x964d('0xc1')]]);_0xb5bd42[_0x964d('0x25')][_0x3730df[_0x964d('0xc1')]][_0x964d('0x67')]+=0x1;_0xb5bd42[_0x964d('0x25')][_0x3730df[_0x964d('0xc1')]][_0x964d('0xfe')]+=0x1;var _0x3f1333=_0xb5bd42['campaigns'][_0x3730df[_0x964d('0xc1')]];var _0x3bab50=new Hangup(_0x3730df,_0x2a9336);_0x3bab50[_0x964d('0xf5')]=0x13;_0x3bab50['statedesc']='Machine';_0x3bab50[_0x964d('0xf7')]=_0x964d('0xf8');_0x3bab50[_0x964d('0x100')]+=0x1;_0x3bab50[_0x964d('0x101')]+=0x1;_0x3bab50['amd']=!![];ami[_0x964d('0x57')](_0x964d('0x102'),ut[_0x964d('0xf9')](_0x3bab50,_0x964d('0xfa')));_0xb5bd42[_0x964d('0xdc')](_0x3bab50)[_0x964d('0xc5')](loggerCatch(_0x964d('0x103')));if(_0x3bab50[_0x964d('0x115')]+_0x3bab50[_0x964d('0x104')]+_0x3bab50['countnoanswerretry']+_0x3bab50['countnosuchnumberretry']+_0x3bab50[_0x964d('0x107')]+_0x3bab50[_0x964d('0x116')]+_0x3bab50[_0x964d('0x100')]+_0x3bab50[_0x964d('0x108')]>=_0x3f1333['dialGlobalMaxRetry']){_0xb5bd42[_0x964d('0x10a')](_0x3bab50,_0x40d7a3,_0x5e96d0,'reason19\x20machine....');}else{if(_0x3bab50[_0x964d('0x100')]>=_0x3f1333['dialMachineMaxRetry']){_0xb5bd42[_0x964d('0x10d')](_0x3bab50,_0x40d7a3,_0x5e96d0,_0x964d('0x10e'));}else{_0xb5bd42[_0x964d('0xd0')]({'active':![],'countmachineretry':_0x3bab50[_0x964d('0x100')],'scheduledat':moment()[_0x964d('0x10f')](_0x3f1333[_0x964d('0x117')],_0x964d('0x110'))[_0x964d('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3bab50['ContactId'],'ListId':_0x3bab50['ListId'],'VoiceQueueId':_0x3bab50[_0x964d('0xe6')]||undefined,'CampaignId':_0x3bab50[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x112')));_0x40d7a3({'reschedule':0x1});}}});}}};Dialer[_0x964d('0x1f')][_0x964d('0x3d')]=function(_0x218ebc){var _0x5024b4=this[_0x964d('0x2b')][_0x218ebc['uniqueid']];var _0x43bbb8;if(_0x5024b4&&_0x5024b4[_0x964d('0x58')]===_0x964d('0x81')){delete this[_0x964d('0x2b')][_0x218ebc[_0x964d('0xf4')]];this[_0x964d('0xbf')](this['campaigns'][_0x5024b4[_0x964d('0xc1')]]);this[_0x964d('0x25')][_0x5024b4[_0x964d('0xc1')]][_0x964d('0x118')]+=0x1;_0x43bbb8=new Hangup(_0x5024b4,_0x218ebc);this[_0x964d('0xdc')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch(_0x964d('0x119')));this[_0x964d('0xda')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch(_0x964d('0x11a')));}if(_0x5024b4&&_0x5024b4['type']!==_0x964d('0x81')&&isNotNull(this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]][_0x964d('0x11b')])){delete this[_0x964d('0x2b')][_0x218ebc['uniqueid']];this[_0x964d('0xbf')](this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]]);this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]]['outboundAnswerCallsDay']+=0x1;this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]][_0x964d('0xfe')]+=0x1;_0x43bbb8=new Hangup(_0x5024b4,_0x218ebc);_0x43bbb8['state']=0x10;_0x43bbb8['statedesc']=_0x964d('0x11c');_0x43bbb8[_0x964d('0xf7')]='AGI';this[_0x964d('0xdc')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x964d('0xda')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch(_0x964d('0x11a')));}if(_0x5024b4&&_0x5024b4['type']!==_0x964d('0x81')&&!isNotNull(this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]][_0x964d('0x11b')])){delete this[_0x964d('0x2b')][_0x218ebc[_0x964d('0xf4')]];this['updateOriginated'](this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]]);this[_0x964d('0x24')][_0x5024b4[_0x964d('0xc1')]]['outboundUnknownCallsDay']+=0x1;_0x43bbb8=new Hangup(_0x5024b4,_0x218ebc);_0x43bbb8[_0x964d('0xf5')]=0xc;_0x43bbb8['statedesc']=_0x218ebc[_0x964d('0x11d')];_0x43bbb8[_0x964d('0xf7')]=_0x964d('0x11e');this[_0x964d('0xdc')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch(_0x964d('0x119')));this[_0x964d('0xda')](_0x43bbb8)[_0x964d('0xc5')](loggerCatch(_0x964d('0x11a')));}};Dialer['prototype']['syncAgentComplete']=function(_0x5a6cd1){var _0x54b148=this[_0x964d('0x2b')][_0x5a6cd1['uniqueid']];if(this[_0x964d('0x24')][_0x5a6cd1[_0x964d('0xc1')]]){if(_0x54b148&&_0x54b148[_0x964d('0x58')]!==_0x964d('0x81')){delete this[_0x964d('0x2b')][_0x5a6cd1[_0x964d('0xf4')]];this[_0x964d('0x24')][_0x5a6cd1[_0x964d('0xc1')]][_0x964d('0x67')]+=0x1;var _0x10ea38=new AgentComplete(_0x54b148,_0x5a6cd1);if(_0x5a6cd1[_0x964d('0x11f')]===_0x964d('0x120')){_0x10ea38['agiafterat']=this[_0x964d('0x24')][_0x5a6cd1['queue']][_0x964d('0x121')]&&this[_0x964d('0x24')][_0x5a6cd1[_0x964d('0xc1')]][_0x964d('0x122')]?moment()[_0x964d('0x82')](_0x964d('0x111')):undefined;}this['createHistory'](_0x10ea38)[_0x964d('0xc5')](loggerCatch(_0x964d('0x123')));this[_0x964d('0xda')](_0x10ea38)['catch'](loggerCatch(_0x964d('0x124')));}}};Dialer[_0x964d('0x1f')][_0x964d('0x33')]=function(_0x193ad1){if(this['voiceQueues'][_0x193ad1[_0x964d('0xc1')]]){if(this[_0x964d('0x2b')][_0x193ad1[_0x964d('0xf4')]]&&this['uniqueId'][_0x193ad1['uniqueid']]['type']!=='ivr'){this['updateOriginated'](this['voiceQueues'][_0x193ad1[_0x964d('0xc1')]]);this[_0x964d('0x2b')][_0x193ad1[_0x964d('0xf4')]][_0x964d('0x125')]=moment()['format'](_0x964d('0x111'));}}};Dialer[_0x964d('0x1f')]['queueCallerAbandonCreateState']=function(_0x2918e7,_0x298160){this['createHistory'](_0x2918e7)['catch'](loggerCatch(_0x964d('0x123')));if(_0x298160==0x0){this[_0x964d('0xda')](_0x2918e7)[_0x964d('0xc5')](loggerCatch(_0x964d('0x126')));}};Dialer[_0x964d('0x1f')][_0x964d('0x35')]=function(_0x55d4eb){var _0x5533e5=this[_0x964d('0x2b')][_0x55d4eb['uniqueid']];var _0x2ca0b7=this;var _0x515e0a=![];var _0x1f37bc;var _0x3650f6;if(this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]]){if(_0x5533e5&&_0x5533e5['type']!==_0x964d('0x81')){delete this[_0x964d('0x2b')][_0x55d4eb[_0x964d('0xf4')]];this[_0x964d('0xbf')](this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]]);_0x5533e5[_0x964d('0x127')]=moment()[_0x964d('0x82')](_0x964d('0x111'));var _0x30827d=new QueueCallerAbandon(_0x5533e5,_0x55d4eb);if(getSeconds(_0x5533e5[_0x964d('0x127')],_0x5533e5['responsetime'])>=_0x5533e5[_0x964d('0x128')]){this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x129')]+=0x1;this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x6c')]+=0x1;this[_0x964d('0x24')][_0x55d4eb['queue']][_0x964d('0x76')]+=0x1;_0x30827d[_0x964d('0xf5')]=0xa;_0x30827d[_0x964d('0xb6')]=_0x964d('0x12a');_0x30827d[_0x964d('0x12b')]=_0x964d('0x12c');_0x30827d[_0x964d('0x12d')]=this['voiceQueues'][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x121')]?moment()[_0x964d('0x82')](_0x964d('0x111')):undefined;_0x30827d[_0x964d('0x107')]+=0x1;_0x30827d[_0x964d('0x101')]+=0x1;_0x1f37bc=this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]]['dialDropRetryFrequency'];_0x3650f6=this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x12e')];_0x2ca0b7[_0x964d('0xc8')](_0x30827d,_0x30827d['state'],_0x5533e5['voiceQueue'])['then'](function(_0x3392d6){_0x515e0a=_0x3392d6[_0x964d('0x12f')]==0x1;if(_0x30827d[_0x964d('0x107')]>=_0x2ca0b7[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]]['dialDropMaxRetry']){_0x2ca0b7[_0x964d('0x130')](_0x30827d,_0x3392d6[_0x964d('0x12f')]);}else{_0x2ca0b7[_0x964d('0xd0')]({'active':![],'countdropretry':_0x30827d[_0x964d('0x107')],'scheduledat':moment()[_0x964d('0x10f')](_0x2ca0b7[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x131')],_0x964d('0x110'))['format'](_0x964d('0x111')),'ContactId':_0x5533e5[_0x964d('0xe4')],'ListId':_0x5533e5['ListId'],'VoiceQueueId':_0x5533e5[_0x964d('0xe6')]||undefined,'CampaignId':_0x5533e5[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x132')));var _0x31ef55=new History(_0x30827d);_0x31ef55[_0x964d('0xf5')]=0xa;_0x31ef55[_0x964d('0xb6')]='Drop';_0x31ef55[_0x964d('0xb7')]=moment()[_0x964d('0x82')](_0x964d('0x111'));_0x31ef55[_0x964d('0x133')]=_0x31ef55['starttime'];_0x31ef55[_0x964d('0x134')]=_0x30827d[_0x964d('0x134')];_0x31ef55['calleridnum']=_0x30827d[_0x964d('0x135')];_0x2ca0b7[_0x964d('0xdc')](_0x31ef55)[_0x964d('0xc5')](loggerCatch(_0x964d('0x136')));}})[_0x964d('0x45')](function(){if(_0x515e0a)_0x2ca0b7[_0x964d('0xca')](_0x30827d,_0x1f37bc,_0x3650f6)[_0x964d('0x45')](function(){return 0x1;});});}else{this['voiceQueues'][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x74')]+=0x1;this[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x6b')]+=0x1;_0x30827d[_0x964d('0xf5')]=0xb;_0x30827d[_0x964d('0xb6')]=_0x964d('0x137');_0x30827d['dropreason']=_0x964d('0x138');_0x30827d[_0x964d('0x116')]+=0x1;_0x30827d[_0x964d('0x101')]+=0x1;_0x1f37bc=this['voiceQueues'][_0x55d4eb[_0x964d('0xc1')]]['dialAbandonedRetryFrequency'];_0x3650f6=this['voiceQueues'][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x12e')];_0x2ca0b7[_0x964d('0xc8')](_0x30827d,_0x30827d[_0x964d('0xf5')],_0x5533e5[_0x964d('0x139')])[_0x964d('0x45')](function(_0x3de624){if(_0x30827d[_0x964d('0x116')]>=_0x2ca0b7['voiceQueues'][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x13a')]){_0x2ca0b7[_0x964d('0x130')](_0x30827d,_0x3de624['additional']);}else{_0x2ca0b7[_0x964d('0xd0')]({'active':![],'countabandonedretry':_0x30827d[_0x964d('0x116')],'scheduledat':moment()[_0x964d('0x10f')](_0x2ca0b7[_0x964d('0x24')][_0x55d4eb[_0x964d('0xc1')]][_0x964d('0x13b')],_0x964d('0x110'))[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x5533e5['ContactId'],'ListId':_0x5533e5[_0x964d('0xe5')],'VoiceQueueId':_0x5533e5['VoiceQueueId']||undefined,'CampaignId':_0x5533e5[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x13c')));var _0x58800a=new History(_0x30827d);_0x58800a[_0x964d('0xf5')]=0xb;_0x58800a['statedesc']=_0x964d('0x137');_0x58800a[_0x964d('0xb7')]=moment()[_0x964d('0x82')](_0x964d('0x111'));_0x58800a[_0x964d('0x133')]=_0x58800a[_0x964d('0xb7')];_0x58800a['calleridname']=_0x30827d[_0x964d('0x134')];_0x58800a[_0x964d('0x135')]=_0x30827d[_0x964d('0x135')];_0x2ca0b7[_0x964d('0xdc')](_0x58800a)[_0x964d('0xc5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x964d('0x45')](function(){if(_0x515e0a)_0x2ca0b7[_0x964d('0xca')](_0x30827d,_0x1f37bc,_0x3650f6)['then'](function(){return 0x1;});});}}}};Dialer[_0x964d('0x1f')][_0x964d('0x13d')]=function(_0x4552e3){if(this[_0x964d('0x29')][_0x4552e3[_0x964d('0xf4')]]){this['actions'][_0x4552e3[_0x964d('0xf4')]][_0x964d('0xbd')]=_0x4552e3[_0x964d('0xbd')];}if(this[_0x964d('0x2b')][_0x4552e3[_0x964d('0xf4')]]){this[_0x964d('0x2b')][_0x4552e3[_0x964d('0xf4')]]['channel']=_0x4552e3[_0x964d('0xbd')];}};Dialer[_0x964d('0x1f')][_0x964d('0x13e')]=function(_0x4a310f){if(strategy[this[_0x964d('0x24')][this[_0x964d('0x29')][_0x4a310f['actionid']][_0x964d('0xc1')]][_0x964d('0x5a')]]===_0x964d('0x1e')){if(this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]]&&_[_0x964d('0xba')](this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]][_0x964d('0x140')])&&_0x4a310f[_0x964d('0xbc')]==='1'&&_0x4a310f[_0x964d('0x141')]==='0'){if(this[_0x964d('0x142')][_0x4a310f[_0x964d('0x143')]]){if(!this[_0x964d('0x142')][_0x4a310f[_0x964d('0x143')]][_0x964d('0x140')]){this['agents'][_0x4a310f[_0x964d('0x143')]][_0x964d('0x140')]=!![];this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]]['locked']=!![];this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]][_0x964d('0x143')]=_0x4a310f[_0x964d('0x143')];}}}}else if((strategy[this[_0x964d('0x24')][this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]][_0x964d('0xc1')]][_0x964d('0x5a')]]||_0x964d('0x1d'))===_0x964d('0x1d')){if(this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]]){if(this[_0x964d('0x142')][_0x4a310f['stateinterface']]){this['actions'][_0x4a310f['actionid']][_0x964d('0x143')]=_0x4a310f[_0x964d('0x143')];if(_[_0x964d('0xba')](this[_0x964d('0x30')][this['actions'][_0x4a310f[_0x964d('0x13f')]][_0x964d('0xc1')]])){this[_0x964d('0x30')][this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]][_0x964d('0xc1')]]=[];}this[_0x964d('0x30')][this[_0x964d('0x29')][_0x4a310f['actionid']][_0x964d('0xc1')]][_0x964d('0x144')](_[_0x964d('0x98')](_[_0x964d('0xe3')](this[_0x964d('0x29')][_0x4a310f[_0x964d('0x13f')]],[_0x964d('0x145'),_0x964d('0x143')]),{'status':_0x4a310f['status'],'paused':_0x4a310f['paused']}));}}}};function unlockQueueStatus(_0x31b4cf,_0x2f37e5){setTimeout(function(){if(_['isUndefined'](_0x31b4cf[_0x964d('0x146')])){loggerBooked['error'](_0x964d('0x147'),_0x2f37e5);}_0x31b4cf[_0x964d('0x146')]=!![];loggerBooked[_0x964d('0x84')](_0x964d('0x148'),_0x2f37e5,JSON[_0x964d('0x55')](_[_0x964d('0xe3')](_0x31b4cf,[_0x964d('0x4a'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x964d('0x1f')]['syncQueueStatusComplete']=function(_0x544b09){var _0x18b438=this;var _0x4532fe=_0x18b438['voiceQueues'][_0x18b438['actions'][_0x544b09[_0x964d('0x13f')]]['queue']];if(strategy[this[_0x964d('0x24')][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]]['queue']]['strategy']]===_0x964d('0x1e')){if(this[_0x964d('0x29')][_0x544b09['actionid']]&&this['actions'][_0x544b09[_0x964d('0x13f')]][_0x964d('0x143')]){this[_0x964d('0x9f')]['run'](this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]]['idHopper'],this[_0x964d('0x29')][_0x544b09['actionid']][_0x964d('0x143')])[_0x964d('0xc5')](function(_0x4269e4){logger[_0x964d('0xa5')](_0x964d('0x149'),util[_0x964d('0xa4')](_0x4269e4,{'showHidden':![],'depth':null}));})[_0x964d('0x22')](function(){_0x18b438[_0x964d('0xbf')](_0x18b438[_0x964d('0x24')][_0x18b438[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]);_0x18b438['agents'][_0x18b438[_0x964d('0x29')][_0x544b09['actionid']][_0x964d('0x143')]][_0x964d('0x140')]=![];delete _0x18b438[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]];unlockQueueStatus(_0x4532fe);});}else{this[_0x964d('0xbf')](this[_0x964d('0x24')][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]);this[_0x964d('0xd0')]({'active':![],'ContactId':this[_0x964d('0x29')][_0x544b09['actionid']][_0x964d('0xe4')],'ListId':this[_0x964d('0x29')][_0x544b09['actionid']]['ListId'],'VoiceQueueId':this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xe6')]||undefined,'CampaignId':this['actions'][_0x544b09[_0x964d('0x13f')]][_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x14a')));delete this['actions'][_0x544b09[_0x964d('0x13f')]];unlockQueueStatus(_0x4532fe);}}else if((strategy[this[_0x964d('0x24')][this[_0x964d('0x29')][_0x544b09['actionid']]['queue']][_0x964d('0x5a')]]||_0x964d('0x1d'))==='rrmemory'){var _0x429ca4;if(this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]]&&!_[_0x964d('0x52')](this[_0x964d('0x30')][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]]['queue']])){if(this[_0x964d('0x31')][_0x18b438[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]){this[_0x964d('0x31')][_0x18b438['actions'][_0x544b09['actionid']][_0x964d('0xc1')]]=this[_0x964d('0x31')][this['actions'][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]?this[_0x964d('0x31')][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]:this[_0x964d('0x30')][this[_0x964d('0x29')][_0x544b09['actionid']][_0x964d('0xc1')]]?this['queueBooked'][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]]['_rr']||0x0:0x0;}this[_0x964d('0x30')][this['actions'][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]][_0x964d('0x14b')]=this[_0x964d('0x31')][this[_0x964d('0x29')][_0x544b09[_0x964d('0x13f')]][_0x964d('0xc1')]];for(var _0x11d722=0x0;_0x11d722=0x0;})[_0x964d('0xc5')](myreject(_0xd81a70)));}}else{_0x2542f1[_0x964d('0x144')](ami['Action']({'action':_0x964d('0x165'),'command':util[_0x964d('0x82')](_0x964d('0x166'),_0x21224f,!_['isUndefined'](config[_0x964d('0x161')][_0x354eb2])?_0x354eb2:'')})[_0x964d('0x45')](function(_0x38b663){return _0x38b663[_0x964d('0x168')][_0x964d('0x169')](_0x964d('0x16a'))>=0x0;})[_0x964d('0xc5')](myreject(_0xd81a70)));}Promise[_0x964d('0x16b')](_0x2542f1)[_0x964d('0x45')](function(_0x2959ba){var _0x3b4c33=_['some'](_0x2959ba);if(_0x3b4c33){return _0x5d896f(_0x3b4c33);}else{_0x134cec['message']=_0x29d8b8?_0x964d('0x16c'):_0x964d('0x16d');return _0xd81a70(msgResponse(_0x964d('0x16e'),_0x964d('0x15e'),'Global:\x20'+_0x29d8b8+'\x20'+_0x3ba6cb+_0x964d('0x16f')+util[_0x964d('0xa4')](_0x21224f,{'showHidden':![],'depth':null})+_0x964d('0x170')+_0x354eb2));}})['catch'](function(_0x8b2c15){return _0xd81a70(msgResponse('ifTime',_0x964d('0x15e'),JSON[_0x964d('0x55')](_0x8b2c15)));});});};Dialer['prototype']['checkDialMethod']=function(_0x546a43){var _0x296abd=this;return function(){switch(_0x546a43[_0x964d('0x63')]){case _0x964d('0x171'):freeVariablesPredictive(_0x546a43);_0x296abd[_0x964d('0x172')](_0x546a43,0x1);break;case _0x964d('0x173'):freeVariablesPredictive(_0x546a43);_0x296abd[_0x964d('0x172')](_0x546a43,_0x546a43[_0x964d('0x174')]);break;case _0x964d('0xa'):_0x296abd['predictive'](_0x546a43);break;case _0x964d('0x9'):freeVariablesPredictive(_0x546a43);_0x296abd[_0x964d('0x172')](_0x546a43,0x1);break;default:freeVariablesPredictive(_0x546a43);logger[_0x964d('0xa5')](_0x964d('0x175'),_0x546a43[_0x964d('0x4a')],_0x964d('0x176'));}};};Dialer[_0x964d('0x1f')][_0x964d('0x177')]=function(_0x4f61d4){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0x178')](_0x4f61d4['id'],previewRecallmeReminderInterval))['then'](function(_0x89d78f){for(var _0xa82f77=0x0;_0xa82f77<_0x89d78f[_0x964d('0xa6')];_0xa82f77++){var _0x1df8c8=_0x89d78f[_0xa82f77]['Agent'][_0x964d('0x4a')];if(_0x1df8c8)io['to'](util[_0x964d('0x82')](_0x964d('0x179'),_0x1df8c8))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x89d78f[_0xa82f77]});}})[_0x964d('0xc5')](function(){});};Dialer['prototype'][_0x964d('0x17a')]=function(_0xf62c1d){var _0x107b47=this;return function(){_0x107b47[_0x964d('0x17b')](_0xf62c1d);};};Dialer[_0x964d('0x1f')][_0x964d('0xc')]=function(_0x45ffd3){var _0x51c9e5=this;if(isNotPreview(_0x45ffd3['dialMethod'])){if(isVoiceQueueOutbound(_0x45ffd3[_0x964d('0x58')])&&isActive(_0x45ffd3[_0x964d('0x62')])){_0x45ffd3[_0x964d('0xaf')]=!![];Promise[_0x964d('0xc4')]()[_0x964d('0x45')](checkIsLoggedIn(_0x45ffd3,_0x45ffd3[_0x964d('0x17c')]))[_0x964d('0x45')](checkIsActive(_0x45ffd3,_0x45ffd3[_0x964d('0x62')]))[_0x964d('0x45')](checkInterval(_0x45ffd3))[_0x964d('0x45')](_0x51c9e5[_0x964d('0x157')](_0x45ffd3))['then'](_0x51c9e5[_0x964d('0x15b')](_0x45ffd3['dialGlobalInterval'],_0x45ffd3[_0x964d('0x17d')],_0x45ffd3[_0x964d('0x4a')],_0x45ffd3))[_0x964d('0x45')](_0x51c9e5['checkIfTimeIntervals'](_0x45ffd3[_0x964d('0x4e')],_0x45ffd3['dialTimezone'],_0x45ffd3[_0x964d('0x4a')],_0x45ffd3))['then'](_0x51c9e5[_0x964d('0x17e')](_0x45ffd3))['catch'](loggerCatchQueueSummary(_0x964d('0x17f'),_0x45ffd3));}else{notSendMessagesQueue(_0x45ffd3);}}else{freeVariablesPredictive(_0x45ffd3);}};Dialer[_0x964d('0x1f')]['syncQueueSummaryComplete']=_[_0x964d('0x180')](function(){var _0x50d584=_[_0x964d('0x181')](this['voiceQueues'],function(_0x4fcaa2){return _0x4fcaa2[_0x964d('0x182')];});var _0x48d013=_[_0x964d('0x181')](this[_0x964d('0x142')],function(_0x5ac383){return _0x5ac383[_0x964d('0x183')]&&_0x5ac383[_0x964d('0xbc')]===_0x964d('0xeb');});if(_0x50d584[_0x964d('0xa6')]>0x0&&_0x48d013[_0x964d('0xa6')]>0x0){return Promise[_0x964d('0xc4')]()[_0x964d('0x45')](cmHopper[_0x964d('0x178')](_[_0x964d('0x184')](_0x50d584,'id'),previewRecallmeReminderInterval,_['map'](_0x48d013,'id')))[_0x964d('0x45')](function(_0xc3686e){for(var _0x2b6c7b=0x0;_0x2b6c7b<_0xc3686e[_0x964d('0xa6')];_0x2b6c7b++){var _0x481cb3=_0xc3686e[_0x2b6c7b][_0x964d('0x185')][_0x964d('0x4a')];if(_0x481cb3)io['to'](util['format'](_0x964d('0x179'),_0x481cb3))[_0x964d('0x57')](_0x964d('0x186'),{'hopper':_0xc3686e[_0x2b6c7b]});}})[_0x964d('0xc5')](function(_0x53d5be){logger[_0x964d('0xa5')]('checkPreviewRecallReminder',_0x53d5be);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x964d('0x187')]=function(){var _0xb2001b=this;var _0x627170;for(var _0xe58dfa in this[_0x964d('0x25')]){if(typeof this['campaigns'][_0xe58dfa]!==_0x964d('0xa7')){_0x627170=this[_0x964d('0x25')][_0xe58dfa];if(isCampaignIvr(_0x627170[_0x964d('0x58')])&&isActive(_0x627170[_0x964d('0x7f')])){_0x627170[_0x964d('0xaf')]=!![];Promise[_0x964d('0xc4')]()[_0x964d('0x45')](checkIsActive(_0x627170,_0x627170[_0x964d('0x7f')]))[_0x964d('0x45')](checkInterval(_0x627170))[_0x964d('0x45')](_0xb2001b[_0x964d('0x157')](_0x627170))[_0x964d('0x45')](_0xb2001b[_0x964d('0x15b')](_0x627170[_0x964d('0x188')],_0x627170['dialTimezone'],_0x627170[_0x964d('0x4a')],_0x627170))['then'](_0xb2001b['checkIfTimeIntervals'](_0x627170[_0x964d('0x4e')],_0x627170[_0x964d('0x17d')],_0x627170[_0x964d('0x4a')],_0x627170))[_0x964d('0x45')](_0xb2001b[_0x964d('0x17a')](_0x627170))[_0x964d('0xc5')](loggerCatchQueueSummary(_0x964d('0x189'),_0x627170));}else{notSendMessagesCampaign(_0x627170);}}}};function getCallerIdRandom(_0x772900,_0x269a8e){var _0x3605b4;var _0x53d229;var _0x125c87;if(_0x269a8e<=0x0){_0x269a8e=0x1;}_0x3605b4=new RegExp(_0x964d('0x18a')+_0x269a8e+'}$');_0x53d229=Math['pow'](0xa,_0x269a8e-0x1);_0x125c87=Math['pow'](0xa,_0x269a8e)-0x1;return util[_0x964d('0x82')]('%s',_[_0x964d('0x18b')](_0x772900,_0x3605b4,_['random'](_0x53d229,_0x125c87)));}function extractCalleridName(_0x1a507a){var _0x5236e6=_0x1a507a[_0x964d('0x18c')](/"(.*?)"/);return _0x5236e6?_0x5236e6[0x1]:_0x1a507a;}Dialer[_0x964d('0x1f')][_0x964d('0x18d')]=function(_0x3e969d,_0x3c0b3e){var _0x105605=this;var _0x4bb67f=uuid['v4']();this[_0x964d('0x29')][_0x4bb67f]=new Action(_0x3e969d,_0x3c0b3e,_0x4bb67f);return new Promise(function(_0x45c491,_0x77e40e){if(_['isUndefined'](_0x3e969d)&&typeof _0x3e969d!==_0x964d('0x18e')){return _0x77e40e(msgResponse(_0x964d('0x18f'),_0x964d('0x15e'),_0x964d('0x190')));}if(_[_0x964d('0x47')](_0x3c0b3e[_0x964d('0x191')])||_0x3c0b3e['phone']===null){return _0x77e40e(msgResponse('originate','Failure',_0x964d('0x192')));}var _0x26121f={'XMD-CALLERID':_0x105605['actions'][_0x4bb67f]['getCaller'](),'XMD-AGI':_0x3e969d[_0x964d('0x11b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3e969d[_0x964d('0x11b')]):'NONE','XMD-AGIAFTER':_0x3e969d[_0x964d('0x121')]?util[_0x964d('0x82')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3e969d[_0x964d('0x121')]):_0x964d('0x193'),'XMD-QUEUE':_0x3e969d['type']===_0x964d('0x59')?util[_0x964d('0x82')](_0x964d('0x194'),_0x3e969d['name'],_0x3e969d['dialQueueOptions']||'',_0x3e969d[_0x964d('0x122')]?'c':'',_0x3e969d['dialQueueTimeout']||0x3):_0x964d('0x193'),'XMD-CONTACTID':_0x3c0b3e[_0x964d('0xe4')],'XMD-CDRTYPE':_0x964d('0x8'),'CALLERID(all)':_0x105605['actions'][_0x4bb67f][_0x964d('0x195')](),'XMD-AMD':_0x3e969d[_0x964d('0xf1')]?'ACTIVE':_0x964d('0x193'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3e969d['dialAMDActive']){_0x26121f['XMD-AMDINITIALSILENCE']=_0x3e969d[_0x964d('0x196')]||0x9c4;_0x26121f['XMD-AMDGREETING']=_0x3e969d[_0x964d('0x197')]||0x5dc;_0x26121f[_0x964d('0x198')]=_0x3e969d[_0x964d('0x199')]||0x320;_0x26121f[_0x964d('0x19a')]=_0x3e969d[_0x964d('0x19b')]||0x1388;_0x26121f['XMD-AMDMINWORDLENGTH']=_0x3e969d[_0x964d('0x19c')]||0x64;_0x26121f['XMD-AMDBETWEENWORDSSILENCE']=_0x3e969d[_0x964d('0x19d')]||0x32;_0x26121f[_0x964d('0x19e')]=_0x3e969d[_0x964d('0x19f')]||0x3;_0x26121f[_0x964d('0x1a0')]=_0x3e969d['dialAMDSilenceThreshold']||0x100;_0x26121f[_0x964d('0x1a1')]=_0x3e969d[_0x964d('0x1a2')]||0x1388;}if(_0x3e969d[_0x964d('0x58')]===_0x964d('0x59')){_0x26121f[_0x964d('0x1a3')]=_0x3c0b3e['VoiceQueueId'];}else{_0x26121f[_0x964d('0x1a4')]=_0x3c0b3e['CampaignId'];}for(var _0x248ce6 in _0x3c0b3e['Contact']){if(typeof _0x3c0b3e['Contact'][_0x248ce6]!=='undefined'){if(isNotNull(_0x3c0b3e[_0x964d('0x1a5')][_0x248ce6])&&_0x248ce6!=='id'&&_0x248ce6!==_0x964d('0x1a6')&&_0x248ce6!==_0x964d('0x1a7')&&_0x248ce6!==_0x964d('0x1a8')){_0x26121f[util[_0x964d('0x82')](_0x964d('0x1a9'),'XMD-',_[_0x964d('0x1aa')](_0x248ce6))]=_0x3c0b3e['Contact'][_0x248ce6];}}}var _0x48a7e0=_0x105605[_0x964d('0x158')](_0x3e969d[_0x964d('0x7e')])?getCallerId(_0x3e969d[_0x964d('0x7e')]['callerid'],_0x3e969d['dialOriginateCallerIdName'],_0x3e969d[_0x964d('0x1ab')]>0x0?getCallerIdRandom(_0x3e969d['dialOriginateCallerIdNumber'],_0x3e969d[_0x964d('0x1ab')]):_0x3e969d[_0x964d('0x65')]):getCallerId(_['isNil'](_0x3e969d[_0x964d('0x159')])?_0x3e969d['Trunk'][_0x964d('0x1ac')]:_0x3e969d[_0x964d('0x159')][_0x964d('0x1ac')],_0x3e969d[_0x964d('0x64')],_0x3e969d[_0x964d('0x1ab')]>0x0?getCallerIdRandom(_0x3e969d[_0x964d('0x65')],_0x3e969d[_0x964d('0x1ab')]):_0x3e969d[_0x964d('0x65')]);if(_0x48a7e0){_0x26121f[_0x964d('0x1ad')]=_0x105605[_0x964d('0x29')][_0x4bb67f][_0x964d('0x1ae')]=extractCalleridName(_0x48a7e0);_0x26121f[_0x964d('0x1af')]=_0x3c0b3e[_0x964d('0x191')];}_0x3e969d[_0x964d('0x1b0')]=_0x26121f;return ami[_0x964d('0xbb')]({'actionid':_0x4bb67f,'action':_0x964d('0x18f'),'channel':_0x105605[_0x964d('0x158')](_0x3e969d[_0x964d('0x7e')])?util[_0x964d('0x82')](_0x964d('0x1b1'),_0x3e969d[_0x964d('0x7e')][_0x964d('0x4a')],isNotNull(_0x3e969d['dialPrefix'])?_0x3e969d['dialPrefix'][_0x964d('0x1b2')]()||'':'',_0x3e969d[_0x964d('0x1b3')]>0x0?_0x3c0b3e[_0x964d('0x191')]['substring'](_0x3e969d['dialCutDigit']):_0x3c0b3e['phone']):util['format']('SIP/%s/%s%s',_[_0x964d('0xba')](_0x3e969d[_0x964d('0x159')])?_0x3e969d[_0x964d('0x7e')][_0x964d('0x4a')]:_0x3e969d['TrunkBackup']['name'],isNotNull(_0x3e969d[_0x964d('0x1b4')])?_0x3e969d['dialPrefix'][_0x964d('0x1b2')]()||'':'',_0x3e969d['dialCutDigit']>0x0?_0x3c0b3e[_0x964d('0x191')][_0x964d('0x1b5')](_0x3e969d['dialCutDigit']):_0x3c0b3e[_0x964d('0x191')]),'callerid':_0x48a7e0,'Exten':_0x964d('0xf0'),'Context':'from-sip','Priority':'1','variable':_0x26121f,'timeout':(_0x3e969d[_0x964d('0x66')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4bb67f})[_0x964d('0x45')](function(_0x6ff4c6){return _0x45c491(_0x6ff4c6);})[_0x964d('0xc5')](function(_0x173bdd){_0x3e969d[_0x964d('0x6f')]+=0x1;var _0x140b3f=new History(_0x105605['actions'][_0x4bb67f]);logger[_0x964d('0xa5')](util[_0x964d('0x82')](_0x964d('0x1b6'),JSON[_0x964d('0x55')](_0x173bdd)));_0x140b3f[_0x964d('0xf5')]=0xe;_0x140b3f['statedesc']=_0x964d('0x1b7');_0x140b3f['starttime']=moment()[_0x964d('0x82')]('YYYY-MM-DD\x20HH:mm:ss');_0x140b3f['endtime']=_0x140b3f['starttime'];_0x105605['createHistory'](_0x140b3f)['catch'](loggerCatch(_0x964d('0x1b8')));_0x105605['moveContactManagedDialer'](_0x140b3f)[_0x964d('0xc5')](loggerCatch(_0x964d('0x1b8')))[_0x964d('0x22')](function(){delete _0x105605[_0x964d('0x29')][_0x4bb67f];return _0x77e40e(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer[_0x964d('0x1f')][_0x964d('0x1b9')]=function(_0x1adbc2){var _0x35be8e=this[_0x964d('0x29')][_0x1adbc2['actionid']];if(_0x35be8e){delete this['actions'][_0x1adbc2[_0x964d('0x13f')]];_0x35be8e[_0x964d('0x1ba')]=moment()[_0x964d('0x82')](_0x964d('0x111'));var _0x1e9a8b=_0x35be8e[_0x964d('0x58')]===_0x964d('0x81')?this[_0x964d('0x25')][_0x35be8e[_0x964d('0xc1')]]:this['voiceQueues'][_0x35be8e[_0x964d('0x1bb')]()];if(!this[_0x964d('0x1bc')](_0x1adbc2['response'])){this[_0x964d('0xbf')](_0x1e9a8b);return this[_0x964d('0x1bd')](_0x35be8e,_0x1e9a8b,_0x1adbc2)['catch'](loggerCatch(_0x964d('0x1be')));}this[_0x964d('0x2b')][_0x1adbc2[_0x964d('0xf4')]]=_0x35be8e;}};Dialer[_0x964d('0x1f')][_0x964d('0x1bf')]=function(_0x45d2ab,_0xf3b97b,_0x1fcb2c){var _0x2edf0b=new History(_0xf3b97b);if(_0x2edf0b[_0x964d('0x115')]+_0x2edf0b[_0x964d('0x104')]+_0x2edf0b[_0x964d('0x105')]+_0x2edf0b[_0x964d('0x106')]+_0x2edf0b[_0x964d('0x107')]+_0x2edf0b['countabandonedretry']+_0x2edf0b[_0x964d('0x100')]+_0x2edf0b[_0x964d('0x108')]>=_0x1fcb2c[_0x964d('0x109')]-0x1){return!![];}switch(_0x45d2ab){case 0x3:if(_0x2edf0b['countnoanswerretry']>=_0x1fcb2c[_0x964d('0x1c0')]-0x1){return!![];}this[_0x964d('0xd0')]({'active':![],'countnoanswerretry':_0x2edf0b[_0x964d('0x105')]+=0x1,'scheduledat':moment()['add'](_0x1fcb2c[_0x964d('0x1c1')],'minutes')[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x2edf0b['ContactId'],'ListId':_0x2edf0b['ListId'],'VoiceQueueId':_0x2edf0b['VoiceQueueId']||undefined,'CampaignId':_0x2edf0b['CampaignId']||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x1c2')));break;case 0x5:if(_0x2edf0b[_0x964d('0x115')]>=_0x1fcb2c[_0x964d('0x1c3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x2edf0b[_0x964d('0x115')]+=0x1,'scheduledat':moment()[_0x964d('0x10f')](_0x1fcb2c['dialBusyRetryFrequency'],_0x964d('0x110'))[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b[_0x964d('0xe5')],'VoiceQueueId':_0x2edf0b['VoiceQueueId']||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x1c4')));break;case 0x8:if(_0x2edf0b[_0x964d('0x104')]>=_0x1fcb2c[_0x964d('0x1c5')]-0x1){return!![];}this[_0x964d('0xd0')]({'active':![],'countcongestionretry':_0x2edf0b[_0x964d('0x104')]+=0x1,'scheduledat':moment()['add'](_0x1fcb2c[_0x964d('0x1c6')],'minutes')[_0x964d('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b[_0x964d('0xe5')],'VoiceQueueId':_0x2edf0b['VoiceQueueId']||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2edf0b[_0x964d('0x106')]>=_0x1fcb2c[_0x964d('0x1c7')]-0x1){return!![];}else{this[_0x964d('0xd0')]({'active':![],'countnosuchnumberretry':_0x2edf0b[_0x964d('0x106')]+=0x1,'scheduledat':moment()[_0x964d('0x10f')](_0x1fcb2c['dialNoSuchNumberRetryFrequency'],_0x964d('0x110'))[_0x964d('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b[_0x964d('0xe5')],'VoiceQueueId':_0x2edf0b[_0x964d('0xe6')]||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x1c8')));}break;case 0xa:if(_0x2edf0b[_0x964d('0x107')]>=_0x1fcb2c[_0x964d('0x1c9')]-0x1){return!![];}this[_0x964d('0xd0')]({'active':![],'countdropretry':_0x2edf0b[_0x964d('0x107')]+=0x1,'scheduledat':moment()[_0x964d('0x10f')](_0x1fcb2c[_0x964d('0x131')],_0x964d('0x110'))['format'](_0x964d('0x111')),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b['ListId'],'VoiceQueueId':_0x2edf0b['VoiceQueueId']||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x2edf0b[_0x964d('0x116')]>=_0x1fcb2c[_0x964d('0x13a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x2edf0b[_0x964d('0x116')]+=0x1,'scheduledat':moment()[_0x964d('0x10f')](_0x1fcb2c[_0x964d('0x13b')],_0x964d('0x110'))[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x2edf0b['ContactId'],'ListId':_0x2edf0b[_0x964d('0xe5')],'VoiceQueueId':_0x2edf0b[_0x964d('0xe6')]||undefined,'CampaignId':_0x2edf0b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2edf0b[_0x964d('0x100')]>=_0x1fcb2c[_0x964d('0x10c')]-0x1){return!![];}this[_0x964d('0xd0')]({'active':![],'countmachineretry':_0x2edf0b[_0x964d('0x100')]+=0x1,'scheduledat':moment()['add'](_0x1fcb2c['dialMachineRetryFrequency'],_0x964d('0x110'))['format'](_0x964d('0x111')),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b['ListId'],'VoiceQueueId':_0x2edf0b[_0x964d('0xe6')]||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2edf0b[_0x964d('0x108')]>=_0x1fcb2c[_0x964d('0x1ca')]-0x1){return!![];}this[_0x964d('0xd0')]({'active':![],'countagentrejectretry':_0x2edf0b[_0x964d('0x108')]+=0x1,'scheduledat':moment()['add'](_0x1fcb2c[_0x964d('0x1cb')],_0x964d('0x110'))[_0x964d('0x82')](_0x964d('0x111')),'ContactId':_0x2edf0b[_0x964d('0xe4')],'ListId':_0x2edf0b[_0x964d('0xe5')],'VoiceQueueId':_0x2edf0b[_0x964d('0xe6')]||undefined,'CampaignId':_0x2edf0b[_0x964d('0xe7')]||undefined})['catch'](loggerCatch(_0x964d('0x1cc')));break;default:return!![];}};Dialer[_0x964d('0x1f')][_0x964d('0x1bd')]=function(_0x529b53,_0x15606e,_0x1e47c4){var _0xe756d=this;var _0x4d6c26=new History(_0x529b53);var _0x2d755c=![];var _0x21342d;var _0x2213b2;return new Promise(function(_0x58fd1a,_0x5615bd){if(_[_0x964d('0x47')](_0x15606e)&&typeof _0x15606e!==_0x964d('0x18e')){return _0x5615bd(msgResponse(_0x964d('0x1cd'),_0x964d('0x15e'),_0x964d('0x1ce')));}if(_[_0x964d('0x47')](_0x1e47c4)&&typeof _0x1e47c4!==_0x964d('0x18e')){return _0x5615bd(msgResponse(_0x964d('0x1cd'),_0x964d('0x15e'),_0x964d('0x1cf')));}_0xe756d['verifyAdditionalPhones'](_0x4d6c26,_0x1e47c4[_0x964d('0x11f')],_0x15606e)['then'](function(_0x475305){if(_0x475305['additional']==0x1)_0x2d755c=!![];switch(_0x1e47c4[_0x964d('0x11f')]){case'0':_0x15606e['outboundNoSuchCallsDay']+=0x1;_0x4d6c26[_0x964d('0xf5')]=0x0;_0x4d6c26[_0x964d('0xb6')]='NoSuchNumber';_0x4d6c26['countnosuchnumberretry']+=0x1;_0x4d6c26[_0x964d('0x101')]+=0x1;ami[_0x964d('0x57')]('custom:agentnosuchnumber',ut[_0x964d('0xf9')](_0x529b53,_0x964d('0x1d0')));_0x21342d=_0x15606e[_0x964d('0x1d1')];_0x2213b2=_0x15606e['callAdditionalPhoneAfterMin'];_0xe756d['createHistory'](_0x4d6c26)[_0x964d('0xc5')](loggerCatch(_0x964d('0x103')));if(_0xe756d['checkRetriveMax'](0x0,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26[_0x964d('0x106')]>=_0x15606e['dialNoSuchNumberMaxRetry']){_0xe756d[_0x964d('0x10d')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1d2'));}else{_0xe756d['stateGlobal'](_0x4d6c26,_0x58fd1a,_0x5615bd,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x15606e[_0x964d('0x6d')]+=0x1;_0x4d6c26[_0x964d('0xf5')]=0x3;_0x4d6c26[_0x964d('0xb6')]=_0x964d('0x1d3');_0x4d6c26['countnoanswerretry']+=0x1;_0x4d6c26['countglobal']+=0x1;var _0xbc2d44=ut['buildNoAnswerEventPayload'](_0x529b53,_0x15606e);ami[_0x964d('0x57')](_0x964d('0x1d4'),_0xbc2d44);_0x21342d=_0x15606e[_0x964d('0x1c1')];_0x2213b2=_0x15606e[_0x964d('0x12e')];_0xe756d[_0x964d('0xdc')](_0x4d6c26)[_0x964d('0xc5')](loggerCatch(_0x964d('0x1d5')));if(_0xe756d[_0x964d('0x1bf')](0x3,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26[_0x964d('0x105')]>=_0x15606e[_0x964d('0x1c0')]){_0xe756d[_0x964d('0x10d')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1d6'));}else{_0xe756d[_0x964d('0x10a')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1d6'));}}break;case'5':_0x15606e[_0x964d('0x69')]+=0x1;_0x4d6c26[_0x964d('0xf5')]=0x5;_0x4d6c26[_0x964d('0xb6')]=_0x964d('0x1d7');_0x4d6c26[_0x964d('0x115')]+=0x1;_0x4d6c26[_0x964d('0x101')]+=0x1;ami[_0x964d('0x57')](_0x964d('0x1d8'),ut[_0x964d('0xf9')](_0x529b53,_0x964d('0x1d9')));_0x21342d=_0x15606e[_0x964d('0x1da')];_0x2213b2=_0x15606e[_0x964d('0x12e')];_0xe756d[_0x964d('0xdc')](_0x4d6c26)[_0x964d('0xc5')](loggerCatch(_0x964d('0x1db')));if(_0xe756d[_0x964d('0x1bf')](0x5,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26['countbusyretry']>=_0x15606e[_0x964d('0x1c3')]){_0xe756d['createStateFinal'](_0x4d6c26,_0x58fd1a,_0x5615bd,'reason\x205\x20busy');}else{_0xe756d[_0x964d('0x10a')](_0x4d6c26,_0x58fd1a,_0x5615bd,'reason\x205\x20busy');}}break;case'8':_0x15606e[_0x964d('0x6a')]+=0x1;_0x4d6c26['state']=0x8;_0x4d6c26[_0x964d('0xb6')]=_0x964d('0x1dc');_0x4d6c26[_0x964d('0x104')]+=0x1;_0x4d6c26[_0x964d('0x101')]+=0x1;_0x21342d=_0x15606e[_0x964d('0x1c6')];_0x2213b2=_0x15606e['callAdditionalPhoneAfterMin'];ami[_0x964d('0x57')](_0x964d('0x1dd'),ut['buildObj'](_0x529b53,_0x964d('0x1de')));_0xe756d[_0x964d('0xdc')](_0x4d6c26)['catch'](loggerCatch(_0x964d('0x1df')));if(_0xe756d['checkRetriveMax'](0x8,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26[_0x964d('0x104')]>=_0x15606e[_0x964d('0x1c5')]){_0xe756d[_0x964d('0x10d')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1e0'));}else{_0xe756d['stateGlobal'](_0x4d6c26,_0x58fd1a,_0x5615bd,'reason\x208\x20congestion');}}break;case'11':_0x15606e[_0x964d('0x1e1')]+=0x1;_0x4d6c26['state']=0xb;_0x4d6c26[_0x964d('0xb6')]=_0x964d('0x137');_0x4d6c26[_0x964d('0x116')]+=0x1;_0x4d6c26[_0x964d('0x101')]+=0x1;_0x21342d=_0x15606e[_0x964d('0x13b')];_0x2213b2=_0x15606e[_0x964d('0x12e')];_0xe756d[_0x964d('0xdc')](_0x4d6c26)[_0x964d('0xc5')](loggerCatch(_0x964d('0x1e2')));if(_0xe756d[_0x964d('0x1bf')](0xb,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26[_0x964d('0x116')]>=_0x15606e[_0x964d('0x13a')]){_0xe756d[_0x964d('0x10d')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1e3'));}else{_0xe756d[_0x964d('0x10a')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1e3'));}}break;case'20':_0x15606e[_0x964d('0x71')]+=0x1;_0x4d6c26[_0x964d('0xf5')]=0x14;_0x4d6c26[_0x964d('0xb6')]=_0x964d('0x1e4');_0x4d6c26[_0x964d('0x108')]+=0x1;_0x4d6c26[_0x964d('0x101')]+=0x1;_0x21342d=_0x15606e[_0x964d('0x1cb')];_0x2213b2=_0x15606e[_0x964d('0x12e')];ami[_0x964d('0x57')](_0x964d('0x1e5'),ut[_0x964d('0xf9')](_0x529b53,'agentreject'));_0xe756d[_0x964d('0xdc')](_0x4d6c26)[_0x964d('0xc5')](loggerCatch(_0x964d('0x1e6')));if(_0xe756d[_0x964d('0x1bf')](0x14,_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26[_0x964d('0x108')]>=_0x15606e[_0x964d('0x1ca')]){_0xe756d['createStateFinal'](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1e7'));}else{_0xe756d['stateGlobal'](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x964d('0x1e7'));}}break;default:_0x15606e[_0x964d('0x72')]+=0x1;_0x4d6c26[_0x964d('0xf5')]=0xc;_0x4d6c26[_0x964d('0xb6')]=_0x1e47c4[_0x964d('0x11f')];_0x21342d=_0x15606e[_0x964d('0x1cb')];_0x2213b2=_0x15606e['callAdditionalPhoneAfterMin'];_0xe756d[_0x964d('0xdc')](_0x4d6c26)['catch'](loggerCatch(_0x964d('0x1e8')));if(_0xe756d[_0x964d('0x1bf')](_0x1e47c4['reason'],_0x529b53,_0x15606e)&&!_0x2d755c){if(_0x4d6c26['countbusyretry']+_0x4d6c26[_0x964d('0x104')]+_0x4d6c26[_0x964d('0x105')]+_0x4d6c26['countnosuchnumberretry']+_0x4d6c26['countdropretry']+_0x4d6c26[_0x964d('0x116')]+_0x4d6c26[_0x964d('0x100')]+_0x4d6c26['countagentrejectretry']>=_0x15606e[_0x964d('0x109')]){_0xe756d[_0x964d('0x10a')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x1e47c4[_0x964d('0x11f')]);}else{_0xe756d[_0x964d('0x10d')](_0x4d6c26,_0x58fd1a,_0x5615bd,_0x1e47c4[_0x964d('0x11f')]);}}}})[_0x964d('0x45')](function(){if(_0x2d755c){_0xe756d[_0x964d('0xca')](_0x4d6c26,_0x21342d,_0x2213b2)[_0x964d('0x45')](function(){return _0x58fd1a(0x1);});}});});};Dialer[_0x964d('0x1f')][_0x964d('0x10a')]=function(_0x599b6c,_0x54e07e,_0x4ad331,_0x3aa95b){var _0x21bfd6=new Final(_0x599b6c);_0x21bfd6['state']=0xf;_0x21bfd6[_0x964d('0xb6')]=_0x964d('0x1e9');this[_0x964d('0x10d')](_0x21bfd6,_0x54e07e,_0x4ad331,_0x3aa95b);};Dialer['prototype']['createStateFinal']=function(_0x402e5d,_0x1cad5f,_0xd18428,_0x3ab829){this[_0x964d('0xda')](_0x402e5d)[_0x964d('0x45')](function(){return _0x1cad5f(msgResponse('[callProgressDetecting]',_0x964d('0xe9'),_0x3ab829));})['catch'](function(){return _0xd18428(msgResponse(_0x964d('0x1ea'),_0x964d('0x15e'),_0x964d('0x1eb')));});};Dialer[_0x964d('0x1f')]['predictive']=function(_0x4fa83f){var _0x12e0d9=_0x4fa83f['dialPredictiveOptimizationPercentage']/0x64;var _0xbd0ec4=_0x4fa83f[_0x964d('0x6c')]/(_0x4fa83f['outboundDropCallsDayTimeout']+_0x4fa83f['outboundAnswerCallsDay']);var _0x17a905=Math[_0x964d('0x1ec')](_0x4fa83f[_0x964d('0x79')]*(_0x4fa83f[_0x964d('0x1ed')]/0x64));var _0x2656e5=Math[_0x964d('0x1ec')](_0x4fa83f[_0x964d('0x79')]*(_0x4fa83f[_0x964d('0x1ee')]/0x64));var _0x1598f1=_0x4fa83f[_0x964d('0xb1')]+_0x4fa83f['talking'];var _0x153483=Math[_0x964d('0x1ef')](_0x4fa83f[_0x964d('0x94')]*_0x4fa83f[_0x964d('0x7c')]*_0x4fa83f[_0x964d('0x77')]*_0x4fa83f[_0x964d('0x78')]);if(_[_0x964d('0x47')](_0x4fa83f[_0x964d('0x2e')])){if(!_[_0x964d('0x47')](_0x4fa83f['startPredictive'])){_0x4fa83f['startPredictive']=undefined;loggerPredictive['error'](_0x964d('0x1f0'),_0x964d('0x1f1'));}if(!_[_0x964d('0x47')](_0x4fa83f['handlePredictive'])){loggerPredictive[_0x964d('0xa5')](_0x964d('0x1f0'),_0x964d('0x1f2'));clearInterval(_0x4fa83f[_0x964d('0x9d')]);_0x4fa83f[_0x964d('0x9d')]=undefined;}_0x4fa83f[_0x964d('0x2e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x964d('0x84')](_0x4fa83f['name'],_0x964d('0x1f3'),_0x4fa83f[_0x964d('0x2e')]);this[_0x964d('0x172')](_0x4fa83f,0x1);}else if(ifInterval(_0x4fa83f[_0x964d('0x1f4')],_0x4fa83f['startProgressive'])){this[_0x964d('0x172')](_0x4fa83f,0x1);loggerPredictiveCalls[_0x964d('0x84')]('[startMethodPredictive][StartProgressive][Loop]',_0x4fa83f[_0x964d('0x2e')],_0x4fa83f[_0x964d('0x4a')]);_0x4fa83f['erlangCalls']=0x0;_0x4fa83f[_0x964d('0x76')]=0x0;}else if(_0x12e0d9<_0xbd0ec4&&_0x4fa83f[_0x964d('0x1f5')]==='dropRate'){freeVariablesPredictive(_0x4fa83f);loggerPredictive['info'](_0x964d('0x1f6'),_0x964d('0x1f7'),_0xbd0ec4,_0x964d('0x2e'),_0x4fa83f['name']);}else if(_0x153483<_0x4fa83f[_0x964d('0x76')]&&_0x4fa83f[_0x964d('0x1f5')]===_0x964d('0x1f8')){freeVariablesPredictive(_0x4fa83f);loggerPredictive[_0x964d('0x84')](_0x964d('0x1f9'),_0x964d('0x1fa'),_0x153483,'Drop\x20in\x20this\x20interval',_0x4fa83f[_0x964d('0x76')],'startProgressive',_0x4fa83f[_0x964d('0x4a')]);}else if(!ifInterval(_0x4fa83f[_0x964d('0x1f4')],_0x4fa83f[_0x964d('0x2e')])&&_['isUndefined'](_0x4fa83f[_0x964d('0x2d')])&&!_[_0x964d('0x47')](_0x4fa83f['startProgressive'])){_0x4fa83f['startPredictive']=moment()['format'](_0x964d('0x111'));loggerPredictive[_0x964d('0x84')](_0x4fa83f['name'],_0x964d('0x1fb'),_0x4fa83f['startPredictive']);this[_0x964d('0xcd')](_0x4fa83f[_0x964d('0x1f4')])[_0x964d('0x45')](this[_0x964d('0x1fc')](_0x4fa83f))[_0x964d('0x45')](mergeDataErlangB(_0x4fa83f))[_0x964d('0x45')](this[_0x964d('0x1fd')](_0x4fa83f))[_0x964d('0xc5')](loggerCatchPredictive(_0x964d('0x1fe'),_0x4fa83f));}else if(!ifInterval(_0x4fa83f['dialPredictiveInterval'],_0x4fa83f['startPredictive'])){_0x4fa83f[_0x964d('0x76')]=0x0;_0x4fa83f[_0x964d('0x2d')]=moment()['format'](_0x964d('0x111'));loggerPredictive[_0x964d('0x84')](_0x4fa83f[_0x964d('0x4a')],_0x964d('0x1ff'),_0x4fa83f[_0x964d('0x2d')]);clearInterval(_0x4fa83f[_0x964d('0x9d')]);_0x4fa83f[_0x964d('0x9d')]=undefined;this[_0x964d('0xcd')](_0x4fa83f[_0x964d('0x1f4')])['then'](this[_0x964d('0x1fc')](_0x4fa83f))['then'](mergeDataErlangB(_0x4fa83f))[_0x964d('0x45')](this[_0x964d('0x1fd')](_0x4fa83f))[_0x964d('0xc5')](loggerCatchPredictive(_0x964d('0x200'),_0x4fa83f));}else if(_0x4fa83f[_0x964d('0x79')]&&_0x1598f1<_0x4fa83f['predictiveIntervalAvailable']-_0x2656e5){freeVariablesPredictive(_0x4fa83f);loggerPredictive['info'](_0x4fa83f[_0x964d('0x4a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1598f1,_0x964d('0x201'),_0x4fa83f[_0x964d('0x79')],'-',_0x2656e5,'=',_0x4fa83f[_0x964d('0x79')]-_0x2656e5,')');}else if(_0x4fa83f[_0x964d('0x79')]&&_0x1598f1>_0x4fa83f[_0x964d('0x79')]+_0x17a905){freeVariablesPredictive(_0x4fa83f);loggerPredictive[_0x964d('0x84')](_0x4fa83f[_0x964d('0x4a')],_0x964d('0x202'),_0x1598f1,')\x20are\x20more\x20than\x20threshold\x20(',_0x4fa83f[_0x964d('0x79')],'+',_0x17a905,'=',_0x4fa83f[_0x964d('0x79')]+_0x17a905,')');}};Dialer['prototype'][_0x964d('0x1fc')]=function(_0x32e7da){var _0x1b5f32=this;return function(_0x2c9538){return new Promise(function(_0x3d7860,_0x45c64a){_[_0x964d('0x98')](_0x32e7da,_0x2c9538[0x0]);if(checkGetDataPredictive(_0x2c9538[0x0])){var _0x425e11=_0x32e7da['predictiveIntervalAvailable']=_0x32e7da[_0x964d('0x203')]+_0x32e7da['available'];var _0x420022=_0x32e7da['dialPredictiveInterval']*0x3c;var _0x39ca9f=_0x2c9538[0x0]['predictiveIntervalAvgTalktime']+_0x2c9538[0x0][_0x964d('0x8c')];var _0x5a9f7e=(_0x2c9538[0x0][_0x964d('0x88')]+_0x2c9538[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2c9538[0x0][_0x964d('0x74')])/_0x2c9538[0x0][_0x964d('0x7a')];_0x32e7da['predictiveIntervalHitRate']=_0x5a9f7e>0x0?_0x5a9f7e:0x1;switch(_0x32e7da['dialPredictiveOptimization']){case'dropRate':var _0x30c718=_0x32e7da['dialPredictiveOptimizationPercentage']/0x64;return _0x1b5f32[_0x964d('0x204')](_0x425e11,_0x420022,_0x39ca9f,_0x5a9f7e,_0x30c718)[_0x964d('0x45')](function(_0x3b3315){return _0x3d7860(_0x3b3315);});case _0x964d('0x205'):var _0xe33a1a=_0x32e7da[_0x964d('0x206')]/0x64;return _0x1b5f32['busyFactor'](_0x425e11,_0x420022,_0x39ca9f,_0x5a9f7e,_0xe33a1a)[_0x964d('0x45')](function(_0x3922de){return _0x3d7860(_0x3922de);});default:return _0x45c64a(msgResponse(_0x964d('0x207'),_0x964d('0x15e'),_0x964d('0x208')));}}else{return _0x45c64a(msgResponse('[getDataPredictive]','Failure',_0x964d('0x209')));}});};};Dialer['prototype'][_0x964d('0x20a')]=function(_0x23fd52){var _0x261a06=this;return function(_0x13698e){return new Promise(function(_0x8155a8,_0x5816f4){_['merge'](_0x23fd52,_0x13698e[0x0]);if(checkGetDataPredictive(_0x13698e[0x0])){loggerPredictive[_0x964d('0x84')](JSON['stringify'](_0x13698e[0x0]));if(_0x23fd52[_0x964d('0x1f5')]==='dropRate'){return _0x261a06[_0x964d('0xd8')](_0x23fd52['id'])[_0x964d('0x45')](function(_0x55407e){var _0x272809=_0x23fd52[_0x964d('0x17c')]-_0x55407e[0x0][_0x964d('0x20b')];var _0x12d302=_0x23fd52[_0x964d('0x1f4')]*0x3c;var _0xa1a289=_0x13698e[0x0][_0x964d('0x73')]+_0x13698e[0x0]['predictiveIntervalAvgHoldtime'];var _0x58ffa8=(_0x13698e[0x0][_0x964d('0x88')]+_0x13698e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x13698e[0x0][_0x964d('0x74')])/_0x13698e[0x0][_0x964d('0x7a')];var _0x258af8=_0x23fd52['dialPredictiveOptimizationPercentage']/0x64;_0x23fd52[_0x964d('0x20c')]=_0x55407e[0x0]['outboundQueuePauses']||0x0;_0x23fd52[_0x964d('0x77')]=_0x58ffa8>0x0?_0x58ffa8:0x1;return _0x261a06[_0x964d('0x204')](_0x272809,_0x12d302,_0xa1a289,_0x58ffa8,_0x258af8);})[_0x964d('0x45')](function(_0x2bc285){return _0x8155a8(_0x2bc285);})[_0x964d('0xc5')](function(_0x153d2f){return _0x5816f4(msgResponse('[CatchErlangB]',_0x964d('0x15e'),JSON['stringify'](_0x153d2f)));});}if(_0x23fd52['dialPredictiveOptimization']===_0x964d('0x205')){return _0x261a06[_0x964d('0xd8')](_0x23fd52['id'])[_0x964d('0x45')](function(_0x1ef346){var _0x462bcb=_0x23fd52[_0x964d('0x17c')]-_0x1ef346[0x0][_0x964d('0x20b')];var _0x4b9d29=_0x23fd52[_0x964d('0x1f4')]*0x3c;var _0x5f3116=_0x13698e[0x0]['predictiveIntervalAvgTalktime']+_0x13698e[0x0][_0x964d('0x8c')];var _0x3e063f=(_0x13698e[0x0][_0x964d('0x88')]+_0x13698e[0x0][_0x964d('0x129')]+_0x13698e[0x0][_0x964d('0x74')])/_0x13698e[0x0][_0x964d('0x7a')];var _0x58c9ec=_0x23fd52[_0x964d('0x206')]/0x64;_0x23fd52[_0x964d('0x20c')]=_0x1ef346[0x0][_0x964d('0x20b')]||0x0;_0x23fd52[_0x964d('0x77')]=_0x3e063f>0x0?_0x3e063f:0x1;return _0x261a06[_0x964d('0x20d')](_0x462bcb,_0x4b9d29,_0x5f3116,_0x3e063f,_0x58c9ec);})['then'](function(_0x5431fa){return _0x8155a8(_0x5431fa);})['catch'](function(_0x10b339){return _0x5816f4(msgResponse(_0x964d('0x20e'),_0x964d('0x15e'),JSON['stringify'](_0x10b339)));});}}else{return _0x5816f4(msgResponse('[getDataPredictive]',_0x964d('0x15e'),_0x964d('0x209')));}});};};Dialer[_0x964d('0x1f')][_0x964d('0x1fd')]=function(_0x5457e5){var _0x2e23da=this;return function(){var _0x459cad=0x0;var _0x36849d=Math[_0x964d('0x1ef')](_0x5457e5[_0x964d('0x20f')]*0x3e8);if(_0x36849d>0x0){_0x36849d=_0x36849d<0x64?0x64:_0x36849d;loggerPredictive['info'](_0x5457e5[_0x964d('0x4a')],_0x964d('0x210'),_0x36849d,_0x964d('0x99'));_0x5457e5[_0x964d('0x9d')]=setInterval(function(){_0x2e23da[_0x964d('0x9d')](_0x5457e5);loggerPredictiveCalls[_0x964d('0x84')]('[handlePredictive]',_0x459cad+=0x1);},_0x36849d);}else{loggerPredictive['info'](_0x5457e5[_0x964d('0x4a')],_0x964d('0x211'));}};};Dialer[_0x964d('0x1f')][_0x964d('0x212')]=function(_0x4fbda3,_0x34ba3c){var _0x3f9075=this;return function(_0x297286){if(_[_0x964d('0x52')](_0x297286)){if(_[_0x964d('0xba')](_0x34ba3c['UserId'])||!_0x34ba3c[_0x964d('0x213')]){if(_0x4fbda3['dialMethod']===_0x964d('0x9')){_0x4fbda3[_0x964d('0x146')]=_[_0x964d('0x47')](_0x4fbda3[_0x964d('0x146')])?!![]:_0x4fbda3[_0x964d('0x146')];var _0x23f7cd=uuid['v4']();_0x3f9075[_0x964d('0x29')][_0x23f7cd]=new Action(_0x4fbda3,_0x34ba3c,_0x23f7cd);loggerBooked[_0x964d('0x84')](_0x964d('0x214'),_0x23f7cd,_0x964d('0x215'),JSON[_0x964d('0x55')](_0x4fbda3[_0x964d('0x146')]),_0x964d('0x216'),_0x4fbda3[_0x964d('0x4a')]);if(_0x4fbda3[_0x964d('0x146')]){_0x4fbda3['queueStatusComplete']=![];_0x3f9075[_0x964d('0x30')][_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xc1')]]=[];ami['Action']({'actionid':_0x23f7cd,'action':_0x964d('0x217'),'queue':_0x4fbda3[_0x964d('0x4a')]})['catch'](function(){_0x3f9075[_0x964d('0xbf')](_0x4fbda3);_0x3f9075[_0x964d('0xd0')]({'active':![],'ContactId':_0x3f9075['actions'][_0x23f7cd][_0x964d('0xe4')],'ListId':_0x3f9075['actions'][_0x23f7cd]['ListId'],'VoiceQueueId':_0x3f9075['actions'][_0x23f7cd]['VoiceQueueId']||undefined,'CampaignId':_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch(_0x964d('0x218')));delete _0x3f9075[_0x964d('0x29')][_0x23f7cd];});}else{loggerBooked[_0x964d('0x84')](_0x964d('0x219'),JSON[_0x964d('0x55')](_0x4fbda3['queueStatusComplete']),_0x964d('0x216'),_0x4fbda3[_0x964d('0x4a')]);_0x3f9075[_0x964d('0xbf')](_0x4fbda3);_0x3f9075['rescheduleContact']({'active':![],'ContactId':_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xe4')],'ListId':_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xe5')],'VoiceQueueId':_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xe6')]||undefined,'CampaignId':_0x3f9075[_0x964d('0x29')][_0x23f7cd][_0x964d('0xe7')]||undefined})[_0x964d('0xc5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3f9075['actions'][_0x23f7cd];}}else{return _0x3f9075['actionOriginate'](_0x4fbda3,_0x34ba3c);}}else{if(getDiff(_0x34ba3c[_0x964d('0x21a')])<_0x4fbda3[_0x964d('0x21b')]*0x3c){if(_0x34ba3c[_0x964d('0x185')]&&!_0x34ba3c[_0x964d('0x185')][_0x964d('0x21c')]){_0x3f9075['preview']['run'](_0x34ba3c['id'])[_0x964d('0x22')](function(){_0x3f9075[_0x964d('0xbf')](_0x4fbda3);});}else{_0x3f9075['unlockContact']({'active':![]},_0x34ba3c['id'],0x1)[_0x964d('0x22')](function(){_0x3f9075[_0x964d('0xbf')](_0x4fbda3);});}}else{_0x4fbda3[_0x964d('0x70')]+=0x1;_0x3f9075[_0x964d('0xbf')](_0x4fbda3);if(_0x4fbda3[_0x964d('0x21d')]){_0x3f9075[_0x964d('0xd0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x34ba3c[_0x964d('0xe4')],'ListId':_0x34ba3c[_0x964d('0xe5')],'VoiceQueueId':_0x34ba3c[_0x964d('0xe6')]||undefined,'CampaignId':_0x34ba3c[_0x964d('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3f9075['createHistory'](createObjHistory(_0x4fbda3,_0x34ba3c,_0x964d('0x21e'),0x17,'RecallInQueue'))[_0x964d('0xc5')](loggerCatch(_0x964d('0x21f')));}else{_0x3f9075[_0x964d('0xed')](createObjHistory(_0x4fbda3,_0x34ba3c,_0x964d('0x220'),0x16,'RecallFailedTimeout'),_0x964d('0x221'),_0x964d('0x222'));}}}}else{_0x4fbda3[_0x964d('0x68')]+=0x1;_0x3f9075['saveInDb'](createObjHistory(_0x4fbda3,_0x34ba3c,_0x964d('0x223'),0xd,_0x964d('0x224')),_0x964d('0x225'),_0x964d('0x226'));throw'inBlackList';}};};Dialer['prototype']['handleIvr']=function(_0x2b06bc){var _0x34ef9a=this;var _0x54094f=_0x2b06bc[_0x964d('0x227')]-_0x2b06bc['originated']-_0x2b06bc[_0x964d('0xd4')];emitCampaignSummary(_0x2b06bc);if(_0x54094f>0x0){if(_0x54094f>this['maxNumberOriginate']){_0x54094f=this[_0x964d('0x27')];}_0x2b06bc[_0x964d('0xd4')]+=_0x54094f;this['getContactDialerIvr'](_0x2b06bc['id'],_0x54094f,_0x2b06bc[_0x964d('0x228')],_0x2b06bc)[_0x964d('0x45')](function(_0x201f47){_0x2b06bc[_0x964d('0xd4')]-=_0x54094f;_0x2b06bc[_0x964d('0xd4')]=_0x2b06bc['temp']>0x0?_0x2b06bc[_0x964d('0xd4')]:0x0;if(!checkContactEmpty(_0x201f47)){_0x2b06bc['message']=_0x964d('0xae');logger[_0x964d('0x84')](_0x964d('0x229')+_0x2b06bc[_0x964d('0x4a')]);}else{_0x2b06bc[_0x964d('0x7b')]+=_0x201f47[_0x964d('0xa6')];_0x2b06bc[_0x964d('0x48')]=_0x964d('0x22a');for(var _0xb51f4=0x0;_0xb51f4<_0x201f47['length'];_0xb51f4+=0x1){_0x2b06bc[_0x964d('0x22b')]+=0x1;if(_[_0x964d('0xba')](_0x201f47[_0xb51f4])||_[_0x964d('0xba')](_0x201f47[_0xb51f4]['Contact'])||_[_0x964d('0xba')](_0x201f47[_0xb51f4][_0x964d('0x191')])){_0x34ef9a[_0x964d('0xe1')]('[actionOriginate]\x20',_0x2b06bc,_0x201f47[_0xb51f4]);}else{_0x34ef9a[_0x964d('0x22c')](_[_0x964d('0xe3')](_0x201f47[_0xb51f4],['CampaignId',_0x964d('0x191')]))[_0x964d('0x45')](_0x34ef9a[_0x964d('0x212')](_0x2b06bc,_0x201f47[_0xb51f4]))[_0x964d('0xc5')](_0x34ef9a[_0x964d('0xe0')](_0x964d('0x22d'),_0x2b06bc));}}}})[_0x964d('0xc5')](loggerGetContactDialer('[getContactCampaign2]',_0x2b06bc,_0x54094f));}};Dialer['prototype'][_0x964d('0x172')]=function(_0x5852ff,_0x3afc72){var _0x490815=this;var _0x81dc21=[];var _0x2a490b=_0x3afc72>=0x1?_0x3afc72:0x1;if(_0x5852ff[_0x964d('0x63')]===_0x964d('0x9')){_0x2a490b=0x1;}var _0x57da0b=Math[_0x964d('0x1ef')](_0x5852ff['available']*_0x2a490b)-_0x5852ff[_0x964d('0x7b')]-_0x5852ff[_0x964d('0xd4')];emitVoiceQueueSummary(_0x5852ff);if(_0x5852ff[_0x964d('0x22e')]>0x0){var _0x2dd2fe=_0x5852ff[_0x964d('0x22e')]-_0x5852ff[_0x964d('0x7b')]-_0x5852ff[_0x964d('0x203')]-_0x5852ff[_0x964d('0xd4')]-_0x5852ff[_0x964d('0x5c')];if(_0x57da0b>_0x2dd2fe){_0x57da0b=_0x2dd2fe;}}if(_0x57da0b>0x0){if(_0x5852ff[_0x964d('0x63')]===_0x964d('0x9')){_0x57da0b=0x1;}if(_0x57da0b>this[_0x964d('0x27')]){_0x57da0b=this[_0x964d('0x27')];}_0x5852ff['temp']+=_0x57da0b;for(var _0x5182b3 in this[_0x964d('0x142')]){if(typeof this[_0x964d('0x142')][_0x5182b3]!==_0x964d('0xa7')){if(this['agents'][_0x5182b3][_0x964d('0xf5')]==='not_inuse'&&this[_0x964d('0x142')][_0x5182b3][_0x964d('0xbc')]===_0x964d('0xeb')){_0x81dc21[_0x964d('0x144')](this[_0x964d('0x142')][_0x5182b3]['id']);}}}this[_0x964d('0xd3')](_0x5852ff['id'],_0x81dc21,_0x57da0b,_0x5852ff[_0x964d('0x228')],_0x5852ff)[_0x964d('0x45')](function(_0x2fb616){_0x5852ff[_0x964d('0xd4')]-=_0x57da0b;_0x5852ff[_0x964d('0xd4')]=_0x5852ff[_0x964d('0xd4')]>0x0?_0x5852ff[_0x964d('0xd4')]:0x0;if(!checkContactEmpty(_0x2fb616)){_0x490815['countReScheduled'](_0x5852ff)[_0x964d('0x45')](sendMessageReschedule(_0x5852ff))[_0x964d('0xc5')](loggerCatch(_0x964d('0x22f')));}else{_0x5852ff[_0x964d('0x7b')]+=_0x2fb616[_0x964d('0xa6')];_0x5852ff[_0x964d('0x48')]=_0x5852ff[_0x964d('0x63')]==='booked'?_0x964d('0x230'):_0x964d('0x22a');for(var _0x3eca8b=0x0;_0x3eca8b<_0x2fb616[_0x964d('0xa6')];_0x3eca8b+=0x1){if(_[_0x964d('0xba')](_0x2fb616[_0x3eca8b])||_['isNil'](_0x2fb616[_0x3eca8b][_0x964d('0x1a5')])||_[_0x964d('0xba')](_0x2fb616[_0x3eca8b][_0x964d('0x191')])){_0x490815[_0x964d('0xe1')](_0x964d('0x231'),_0x5852ff,_0x2fb616[_0x3eca8b]);}else{_0x490815['checkIsBlackList'](_[_0x964d('0xe3')](_0x2fb616[_0x3eca8b],[_0x964d('0xe6'),_0x964d('0x191')]))['then'](_0x490815['checkContactBlack'](_0x5852ff,_0x2fb616[_0x3eca8b]))[_0x964d('0xc5')](_0x490815[_0x964d('0xe0')]('[actionOriginate]\x20',_0x5852ff));}}}})[_0x964d('0xc5')](loggerGetContactDialer(_0x964d('0x232'),_0x5852ff,_0x57da0b));}};Dialer[_0x964d('0x1f')][_0x964d('0x9d')]=function(_0x3593e0){if(_0x3593e0[_0x964d('0x22e')]>0x0){var _0xab6ddd=_0x3593e0[_0x964d('0x22e')]-_0x3593e0[_0x964d('0x7b')]-_0x3593e0[_0x964d('0x203')];if(_0xab6ddd>0x0){this['tryOriginatePredictive'](_0x3593e0);}else{loggerPredictiveCalls['info'](_0x964d('0x233'));}}else{this[_0x964d('0x234')](_0x3593e0);}};Dialer[_0x964d('0x1f')][_0x964d('0x234')]=function(_0x3060dd){var _0x26ce3a=this;var _0x2455b7=[];_0x3060dd[_0x964d('0x7b')]+=0x1;for(var _0x1d3c22 in this[_0x964d('0x142')]){if(typeof this[_0x964d('0x142')][_0x1d3c22]!==_0x964d('0xa7')){if(this[_0x964d('0x142')][_0x1d3c22][_0x964d('0xf5')]===_0x964d('0x235')&&this[_0x964d('0x142')][_0x1d3c22]['status']==='reachable'){_0x2455b7[_0x964d('0x144')](this[_0x964d('0x142')][_0x1d3c22]['id']);}}}this['getContactDialer'](_0x3060dd['id'],_0x2455b7,0x1,_0x3060dd['dialOrderByScheduledAt'],_0x3060dd)[_0x964d('0x45')](function(_0x1d20bf){if(!checkContactEmpty(_0x1d20bf)){checkContactLowerLimitOriginate(_0x3060dd,0x1,0x0);_0x26ce3a[_0x964d('0xc3')](_0x3060dd)[_0x964d('0x45')](sendMessageReschedule(_0x3060dd))['catch'](loggerCatch(_0x964d('0x22f')));}else{_0x3060dd[_0x964d('0x48')]=_0x964d('0x22a');if(_['isNil'](_0x1d20bf[0x0])||_['isNil'](_0x1d20bf[0x0][_0x964d('0x1a5')])||_[_0x964d('0xba')](_0x1d20bf[0x0]['phone'])){_0x26ce3a['emptyContact'](_0x964d('0x231'),_0x3060dd,_0x1d20bf[0x0]);}else{_0x26ce3a[_0x964d('0xc6')](_[_0x964d('0xe3')](_0x1d20bf[0x0],[_0x964d('0xe6'),_0x964d('0x191')]))[_0x964d('0x45')](_0x26ce3a[_0x964d('0x212')](_0x3060dd,_0x1d20bf[0x0]))[_0x964d('0xc5')](_0x26ce3a[_0x964d('0xe0')](_0x964d('0x236'),_0x3060dd));}}})[_0x964d('0xc5')](loggerGetContactDialer(_0x964d('0x237'),_0x3060dd,0x1));emitVoiceQueueSummary(_0x3060dd);};Dialer[_0x964d('0x1f')]['abandonmentRate']=function(_0x141c6c,_0x52dd24,_0x26075d,_0x1e3572,_0x28faa7,_0x50074){loggerPredictive[_0x964d('0x84')](_0x964d('0x238'));loggerPredictive[_0x964d('0x84')](_0x964d('0x239'),_0x141c6c);loggerPredictive[_0x964d('0x84')](_0x964d('0x23a'),_0x52dd24);loggerPredictive[_0x964d('0x84')](_0x964d('0x23b'),_0x26075d);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e3572);loggerPredictive[_0x964d('0x84')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x28faa7);loggerPredictive[_0x964d('0x84')](_0x964d('0x8e'));return new Promise(function(_0x532324,_0xbee861){if(_0x141c6c<=0x0||isNaN(_0x141c6c)){return _0xbee861(msgResponse(_0x964d('0x23c'),'Error',_0x964d('0x23d')+_0x141c6c));}if(_0x26075d<=0x0||isNaN(_0x26075d)){return _0xbee861(msgResponse(_0x964d('0x23c'),_0x964d('0x54'),_0x964d('0x23e')+_0x26075d));}if(_0x1e3572<=0x0||isNaN(_0x1e3572)){return _0xbee861(msgResponse('[abandonmentRate]',_0x964d('0x54'),'p\x20=\x20'+_0x1e3572));}if(_0x52dd24<=0x0||isNaN(_0x52dd24)){return _0xbee861(msgResponse(_0x964d('0x23c'),_0x964d('0x54'),_0x964d('0x23f')+_0x52dd24));}if(_0x28faa7<=0x0||isNaN(_0x28faa7)){return _0xbee861(msgResponse(_0x964d('0x23c'),_0x964d('0x54'),_0x964d('0x240')+_0x28faa7));}_0x50074=_0x50074||0x0;var _0x2489e0=0x1/_0x26075d;var _0x1eaea8=0x0;var _0x4f20a4=0x0;var _0x447503=0x0;var _0x360937=0x0;for(var _0x3a6522=0x0;_0x447503<_0x28faa7;_0x3a6522+=0x1){_0x4f20a4=_0x3a6522/_0x52dd24;_0x1eaea8=(_0x1e3572*_0x4f20a4+_0x50074)/_0x2489e0;_0x447503=erlangb(_0x1eaea8,_0x141c6c);_0x360937=_0x1eaea8/_0x141c6c*(0x1-erlangb(_0x1eaea8,_0x141c6c));}return _0x532324({'erlangCalls':_0x3a6522,'erlangCallToSecond':_0x52dd24/_0x3a6522,'erlangAbandonmentRate':_0x447503,'erlangBusyFactor':_0x360937});});};Dialer['prototype']['busyFactor']=function(_0x297319,_0x3180a8,_0x3c21dd,_0x1e4d4f,_0x5c1a90,_0x7e128c){loggerPredictive[_0x964d('0x84')](_0x964d('0x241'));loggerPredictive[_0x964d('0x84')](_0x964d('0x239'),_0x297319);loggerPredictive[_0x964d('0x84')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3180a8);loggerPredictive[_0x964d('0x84')](_0x964d('0x23b'),_0x3c21dd);loggerPredictive[_0x964d('0x84')](_0x964d('0x242'),_0x1e4d4f);loggerPredictive[_0x964d('0x84')](_0x964d('0x243'),_0x5c1a90);loggerPredictive[_0x964d('0x84')](_0x964d('0x8e'));return new Promise(function(_0x179eca,_0x54def1){if(_0x297319<=0x0||isNaN(_0x297319)){return _0x54def1(msgResponse('[busyFactor]','Error',_0x964d('0x23d')+_0x297319));}if(_0x3c21dd<=0x0||isNaN(_0x3c21dd)){return _0x54def1(msgResponse('[busyFactor]',_0x964d('0x54'),_0x964d('0x23e')+_0x3c21dd));}if(_0x1e4d4f<=0x0||isNaN(_0x1e4d4f)){return _0x54def1(msgResponse('[busyFactor]',_0x964d('0x54'),_0x964d('0x244')+_0x1e4d4f));}if(_0x3180a8<=0x0||isNaN(_0x3180a8)){return _0x54def1(msgResponse(_0x964d('0x245'),_0x964d('0x54'),_0x964d('0x23f')+_0x3180a8));}if(_0x5c1a90<=0x0||isNaN(_0x5c1a90)){return _0x54def1(msgResponse(_0x964d('0x245'),_0x964d('0x54'),'Umin\x20=\x20'+_0x5c1a90));}_0x7e128c=_0x7e128c||0x0;var _0x56c7e8=0x1/_0x3c21dd;var _0x29adc3=0x0;var _0x560e0b=0x0;var _0xf4541e=0x0;var _0xddcd4e=0x0;for(var _0x3a91bb=0x0;_0xddcd4e<_0x5c1a90;_0x3a91bb+=0x1){_0x560e0b=_0x3a91bb/_0x3180a8;_0x29adc3=(_0x1e4d4f*_0x560e0b+_0x7e128c)/_0x56c7e8;_0xf4541e=erlangb(_0x29adc3,_0x297319);_0xddcd4e=_0x29adc3/_0x297319*(0x1-erlangb(_0x29adc3,_0x297319));}return _0x179eca({'erlangCalls':_0x3a91bb,'erlangCallToSecond':_0x3180a8/_0x3a91bb,'erlangAbandonmentRate':_0xf4541e,'erlangBusyFactor':_0xddcd4e});});};module[_0x964d('0x246')]=Dialer; \ No newline at end of file +var _0xf739=['---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','starttime','[uniqueid]','clearZombieChannels','[actions]','undefined','isNil','Action','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','variable','exten','value','uniqueid','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countnoanswerretry','countabandonedretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','endtime','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','map','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','object','evt\x20is\x20undefine','NoSuchNumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','agentreject','reason\x2020\x20agentreject','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\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]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','voice:queue:%s','voice_queue:save','type','ivr','format','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0xf739,0x199));var _0x9f73=function(_0x1aea03,_0x374d08){_0x1aea03=_0x1aea03-0x0;var _0x50b99d=_0xf739[_0x1aea03];return _0x50b99d;};'use strict';var util=require(_0x9f73('0x0'));var _=require(_0x9f73('0x1'));var uuid=require(_0x9f73('0x2'));var moment=require(_0x9f73('0x3'));var rr=require('rr');var md5=require(_0x9f73('0x4'));var Redis=require('ioredis');var ut=require(_0x9f73('0x5'));var config=require(_0x9f73('0x6'));var logger=require(_0x9f73('0x7'))(_0x9f73('0x8'));var loggerBooked=require(_0x9f73('0x7'))(_0x9f73('0x9'));var loggerPredictive=require(_0x9f73('0x7'))(_0x9f73('0xa'));var loggerPredictiveCalls=require(_0x9f73('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x9f73('0x7'))(_0x9f73('0xb'));var ami=require(_0x9f73('0xc'));config[_0x9f73('0xd')]=_[_0x9f73('0xe')](config[_0x9f73('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x9f73('0xf'))(new Redis(config[_0x9f73('0xd')]));var cmHopper=require(_0x9f73('0x10'));var cmHopperHistory=require(_0x9f73('0x11'));var cmHopperAdditionalPhone=require(_0x9f73('0x12'));var cmHopperBlack=require(_0x9f73('0x13'));var voiceQueueRt=require(_0x9f73('0x14'));var RpcSetting=require(_0x9f73('0x15'));var Action=require(_0x9f73('0x16'));var History=require(_0x9f73('0x17'));var Final=require(_0x9f73('0x18'));var AgentComplete=require(_0x9f73('0x19'));var QueueCallerAbandon=require(_0x9f73('0x1a'));var Hangup=require(_0x9f73('0x1b'));var ipAgi=process[_0x9f73('0x1c')][_0x9f73('0x1d')]||_0x9f73('0x1e');var strategy={'rrmemory':_0x9f73('0x1f'),'roundrobin':_0x9f73('0x20')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9f73('0x21')][_0x9f73('0x22')]=function(_0x5e18df){this[_0x9f73('0x23')]=this[_0x9f73('0x23')]?this[_0x9f73('0x23')][_0x9f73('0x24')](_0x5e18df):_0x5e18df();};function Dialer(_0x384984,_0x42fb6f){this[_0x9f73('0x25')]=new Sequence();this[_0x9f73('0x26')]=_0x42fb6f;this[_0x9f73('0x27')]=_0x384984[_0x9f73('0x27')];this[_0x9f73('0x28')]=_0x384984['campaigns'];this[_0x9f73('0x29')]=_0x384984['agents'];this[_0x9f73('0x2a')]=_0x384984[_0x9f73('0x2a')];this[_0x9f73('0x2b')]=config[_0x9f73('0x2b')]||0x2;this[_0x9f73('0x2c')]={};this[_0x9f73('0x2d')]={};this[_0x9f73('0x2e')]={};this[_0x9f73('0x2f')]={};this['optionPredictive']={};this[_0x9f73('0x30')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x9f73('0x31')]={};this[_0x9f73('0x32')]={};ami['on'](_0x9f73('0x33'),this['syncAgentConnect']['bind'](this));ami['on'](_0x9f73('0x34'),this[_0x9f73('0x35')][_0x9f73('0x36')](this));ami['on']('originateresponse',this[_0x9f73('0x37')][_0x9f73('0x36')](this));ami['on'](_0x9f73('0x38'),this[_0x9f73('0x39')][_0x9f73('0x36')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x9f73('0x36')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x9f73('0x36')](this));ami['on'](_0x9f73('0x3a'),this[_0x9f73('0x3b')][_0x9f73('0x36')](this));ami['on'](_0x9f73('0x3c'),this[_0x9f73('0x3d')][_0x9f73('0x36')](this));ami['on'](_0x9f73('0x3e'),this[_0x9f73('0x3f')]['bind'](this));ami['on'](_0x9f73('0x40'),this[_0x9f73('0x41')][_0x9f73('0x36')](this));ami['on'](_0x9f73('0x42'),this[_0x9f73('0x43')]['bind'](this));this[_0x9f73('0x44')]();this[_0x9f73('0x45')]();RpcSetting[_0x9f73('0x46')]()[_0x9f73('0x47')](function(_0x2854af){previewRecallmeReminderInterval=_0x2854af[_0x9f73('0x48')];});}function isNotNull(_0x134fa6){return _0x134fa6!==null&&!_['isUndefined'](_0x134fa6);}function checkIsLoggedIn(_0xe218aa,_0x28cb71){return function(){if(_0x28cb71<=0x0){_0xe218aa[_0x9f73('0x49')]=_0x9f73('0x4a');throw _0xe218aa[_0x9f73('0x4b')]+_0x9f73('0x4c');}};}function isActive(_0x12315d){return _0x12315d;}function checkIsActive(_0x561f5a,_0x15d270){return function(){if(!isActive(_0x15d270)){_0x561f5a[_0x9f73('0x49')]=_0x9f73('0x4d');throw _0x561f5a['name']+_0x9f73('0x4e');}};}function checkInterval(_0x1ba5cc){return function(){if(!isNotNull(_0x1ba5cc[_0x9f73('0x4f')])){_0x1ba5cc['message']=_0x9f73('0x50');throw _0x1ba5cc[_0x9f73('0x4b')]+_0x9f73('0x51');}if(!isNotNull(_0x1ba5cc['Interval'][_0x9f73('0x52')])){_0x1ba5cc[_0x9f73('0x49')]=_0x9f73('0x50');throw _0x1ba5cc[_0x9f73('0x4b')]+_0x9f73('0x51');}if(!isNotNull(_['isEmpty'](_0x1ba5cc[_0x9f73('0x4f')][_0x9f73('0x52')]))){_0x1ba5cc[_0x9f73('0x49')]='INTERVAL_IS_NULL';throw _0x1ba5cc[_0x9f73('0x4b')]+_0x9f73('0x51');}};}function msgResponse(_0x43c945,_0x532f02,_0x29c233){return{'action':_0x43c945,'response':_0x532f02,'message':_0x29c233,'stack':_0x29c233};}function myreject(_0x316177){return function(_0x483bb6){return _0x316177(msgResponse(_0x9f73('0x53'),_0x9f73('0x54'),JSON[_0x9f73('0x55')](_0x483bb6)));};}function getSeconds(_0x56b30f,_0x45ceb4){var _0x5b75f4=moment(_0x56b30f)[_0x9f73('0x56')](0x0);var _0x1b5893=moment(_0x45ceb4)['milliseconds'](0x0);return _0x5b75f4[_0x9f73('0x57')](_0x1b5893,_0x9f73('0x58'));}function emit(_0x5ced9e,_0x4688ca,_0x2dc65f){io['to'](_0x5ced9e)[_0x9f73('0x59')](_0x4688ca,_0x2dc65f);}function emitVoiceQueueSummary(_0x21d90d){if(_0x21d90d['type']===_0x9f73('0x5a')){var _0x5916e3={'id':_0x21d90d['id'],'name':_0x21d90d[_0x9f73('0x4b')],'strategy':_0x21d90d[_0x9f73('0x5b')],'answered':_0x21d90d[_0x9f73('0x5c')],'available':_0x21d90d[_0x9f73('0x5d')],'loggedIn':_0x21d90d['loggedIn'],'pTalking':_0x21d90d[_0x9f73('0x5e')],'sumBillable':_0x21d90d[_0x9f73('0x5f')],'sumDuration':_0x21d90d[_0x9f73('0x60')],'sumHoldTime':_0x21d90d['sumHoldTime']||0x0,'talking':_0x21d90d[_0x9f73('0x61')],'total':_0x21d90d[_0x9f73('0x62')],'type':_0x21d90d['type'],'unmanaged':_0x21d90d[_0x9f73('0x63')],'abandoned':_0x21d90d['abandoned'],'waiting':_0x21d90d[_0x9f73('0x64')],'loggedInDb':_0x21d90d[_0x9f73('0x65')],'dialActive':_0x21d90d[_0x9f73('0x66')],'dialMethod':_0x21d90d['dialMethod'],'dialOriginateCallerIdName':_0x21d90d[_0x9f73('0x67')],'dialOriginateCallerIdNumber':_0x21d90d[_0x9f73('0x68')],'dialOriginateTimeout':_0x21d90d[_0x9f73('0x69')],'dialPrefix':_0x21d90d[_0x9f73('0x6a')],'outboundAnswerAgiCallsDay':_0x21d90d[_0x9f73('0x6b')],'outboundAnswerCallsDay':_0x21d90d[_0x9f73('0x6c')],'outboundBlacklistCallsDay':_0x21d90d[_0x9f73('0x6d')],'outboundBusyCallsDay':_0x21d90d[_0x9f73('0x6e')],'outboundCongestionCallsDay':_0x21d90d[_0x9f73('0x6f')],'outboundDropCallsDayACS':_0x21d90d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x21d90d[_0x9f73('0x70')],'outboundDropCallsDayTimeout':_0x21d90d[_0x9f73('0x71')],'outboundNoAnswerCallsDay':_0x21d90d[_0x9f73('0x72')],'outboundNoSuchCallsDay':_0x21d90d[_0x9f73('0x73')],'outboundOriginateFailureCallsDay':_0x21d90d[_0x9f73('0x74')],'outboundReCallsDay':_0x21d90d['outboundReCallsDay'],'outboundRejectCallsDay':_0x21d90d[_0x9f73('0x75')],'outboundUnknownCallsDay':_0x21d90d[_0x9f73('0x76')],'predictiveIntervalAnsweredCalls':_0x21d90d['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x21d90d[_0x9f73('0x77')],'predictiveIntervalAvgTalktime':_0x21d90d[_0x9f73('0x78')],'predictiveIntervalDroppedCallsCallersExit':_0x21d90d[_0x9f73('0x79')],'predictiveIntervalDroppedCallsTimeout':_0x21d90d[_0x9f73('0x7a')],'predictiveIntervalErlangCalls':_0x21d90d[_0x9f73('0x7b')],'predictiveIntervalErlangCallsDroppedCalls':_0x21d90d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x21d90d[_0x9f73('0x7c')],'predictiveIntervalMultiplicativeFactor':_0x21d90d[_0x9f73('0x7d')],'predictiveIntervalPauses':_0x21d90d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x21d90d[_0x9f73('0x7e')],'predictiveIntervalTotalCalls':_0x21d90d[_0x9f73('0x7f')],'message':_0x21d90d[_0x9f73('0x49')],'originated':_0x21d90d['originated'],'erlangCalls':_0x21d90d[_0x9f73('0x80')],'erlangCallToSecond':_0x21d90d['erlangCallToSecond'],'erlangAbandonmentRate':_0x21d90d[_0x9f73('0x81')],'erlangBusyFactor':_0x21d90d[_0x9f73('0x82')],'startPredictive':_0x21d90d[_0x9f73('0x30')],'startProgressive':_0x21d90d[_0x9f73('0x83')]};if(_0x21d90d[_0x9f73('0x84')]){_0x5916e3[_0x9f73('0x84')]={'id':_0x21d90d['Trunk']['id'],'name':_0x21d90d[_0x9f73('0x84')]['name'],'active':_0x21d90d['Trunk']['active'],'callerid':_0x21d90d[_0x9f73('0x84')]['callerid']};}if(_0x21d90d[_0x9f73('0x4f')]){_0x5916e3['Interval']={'id':_0x21d90d[_0x9f73('0x4f')]['id'],'name':_0x21d90d[_0x9f73('0x4f')][_0x9f73('0x4b')]};}var _0x50807c=md5(JSON['stringify'](_0x5916e3));if(_0x21d90d['md5']!==_0x50807c){_0x21d90d[_0x9f73('0x4')]=_0x50807c;emit(util['format'](_0x9f73('0x85'),_0x5916e3[_0x9f73('0x4b')]),_0x9f73('0x86'),_0x5916e3);}}}function emitCampaignSummary(_0x4b343d){if(_0x4b343d[_0x9f73('0x87')]===_0x9f73('0x88')){emit(util[_0x9f73('0x89')]('campaign:ivr:%s',_0x4b343d['name']),_0x9f73('0x8a'),_0x4b343d);}}function checkGetDataPredictive(_0x233507){if(isNotNull(_0x233507)&&!_[_0x9f73('0x8b')](_0x233507)){loggerPredictive['info'](_0x9f73('0x8c'));loggerPredictive['info'](_0x9f73('0x8d'),_0x233507['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x9f73('0x8e'),_0x233507['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x90'),_0x233507[_0x9f73('0x7a')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x91'),_0x233507['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x9f73('0x92'),_0x233507[_0x9f73('0x77')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x93'),_0x233507[_0x9f73('0x78')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x94'));if(_0x233507[_0x9f73('0x7f')]>0x0){if(!_[_0x9f73('0x95')](_0x233507[_0x9f73('0x78')])&&_0x233507[_0x9f73('0x78')]>0x0){return!![];}loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x96'));if(!_[_0x9f73('0x95')](_0x233507[_0x9f73('0x77')])&&_0x233507[_0x9f73('0x77')]>0x0){return!![];}loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x97'));}else{loggerPredictive['info'](_0x9f73('0x98'));}}else{loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x99'));}return![];}function mergeDataErlangB(_0x27d0b8){return function(_0x595209){loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x9a'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x595209[_0x9f73('0x80')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x9b'),_0x595209[_0x9f73('0x9c')]);loggerPredictive['info'](_0x9f73('0x9d'),_0x595209[_0x9f73('0x81')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x9e'),_0x595209[_0x9f73('0x82')]);loggerPredictive[_0x9f73('0x8f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x595209[_0x9f73('0x81')]);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x94'));_[_0x9f73('0x9f')](_0x27d0b8,_0x595209);};}function getDiff(_0x1fd9a6){var _0x599aac=moment()[_0x9f73('0x56')](0x0);var _0x270a70=moment(_0x1fd9a6)[_0x9f73('0x56')](0x0);return _0x599aac[_0x9f73('0x57')](_0x270a70,_0x9f73('0x58'));}function ifInterval(_0x1ceae6,_0x3a273c){if(_['isUndefined'](_0x3a273c)){return![];}return getDiff(_0x3a273c)<_0x1ceae6*0x3c;}function freeVariablesPredictive(_0x8bf51e){if(isNotNull(_0x8bf51e)){if(!_[_0x9f73('0x95')](_0x8bf51e[_0x9f73('0x83')])){_0x8bf51e[_0x9f73('0x83')]=undefined;loggerPredictive[_0x9f73('0x8f')](_0x8bf51e[_0x9f73('0x4b')],_0x9f73('0xa0'));}if(!_[_0x9f73('0x95')](_0x8bf51e[_0x9f73('0x30')])){_0x8bf51e[_0x9f73('0x30')]=undefined;loggerPredictive[_0x9f73('0x8f')](_0x8bf51e[_0x9f73('0x4b')],_0x9f73('0xa1'));}if(!_[_0x9f73('0x95')](_0x8bf51e['handlePredictive'])){clearInterval(_0x8bf51e[_0x9f73('0xa2')]);_0x8bf51e['handlePredictive']=undefined;loggerPredictive['info'](_0x8bf51e[_0x9f73('0x4b')],_0x9f73('0xa3'));}}}function erlangb(_0x265947,_0x3bd5ed){if(_0x3bd5ed===0x0){return 0x0;}var _0x3ee6cd=0x1;for(var _0x11fae2=0x1;_0x11fae2<=_0x3bd5ed;_0x11fae2+=0x1){_0x3ee6cd=0x1+_0x3ee6cd*_0x11fae2/_0x265947;}return 0x1/_0x3ee6cd;}function isVoiceQueueOutbound(_0x57af7a){return _0x57af7a===_0x9f73('0x5a');}function isNotPreview(_0xa73007){return _0xa73007!==_0x9f73('0x26');}function isCampaignIvr(_0x1b5ca0){return _0x1b5ca0===_0x9f73('0x88');}function getCallerId(_0x731ca4,_0xd1e8d9,_0x58f0ef){if(!_[_0x9f73('0x95')](_0x58f0ef)&&typeof _0x58f0ef===_0x9f73('0xa4')&&!_[_0x9f73('0x8b')](_0x58f0ef)){if(!_[_0x9f73('0x95')](_0xd1e8d9)&&typeof _0xd1e8d9==='string'&&!_[_0x9f73('0x8b')](_0xd1e8d9)){return util[_0x9f73('0x89')]('\x22%s\x22\x20<%s>',_0xd1e8d9,_0x58f0ef);}return util[_0x9f73('0x89')](_0x9f73('0xa5'),_0x58f0ef,_0x58f0ef);}if(!_['isUndefined'](_0x731ca4)&&typeof _0x731ca4===_0x9f73('0xa4')&&!_['isEmpty'](_0x731ca4)){return _0x731ca4;}return _0x9f73('0xa6');}function loggerCatchQueueSummary(_0x50c640,_0x217d3a){return function(_0x335f7c){freeVariablesPredictive(_0x217d3a);emitVoiceQueueSummary(_0x217d3a);emitCampaignSummary(_0x217d3a);loggerSyncQueueSummary[_0x9f73('0xa7')](_0x50c640,util[_0x9f73('0xa8')](_0x335f7c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xa21fd2,_0x37a4c0){return function(_0x53575e){loggerPredictive[_0x9f73('0xa9')](_0x37a4c0['name'],_0xa21fd2);loggerPredictive[_0x9f73('0xa9')](_0x53575e[_0x9f73('0xaa')]);freeVariablesPredictive(_0x37a4c0);};}function loggerCatch(_0x52439d){return function(_0x637850){logger[_0x9f73('0xa9')](_0x52439d,util[_0x9f73('0xa8')](_0x637850,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x7223c){return _0x7223c&&!_[_0x9f73('0x95')](_0x7223c)&&_0x7223c[_0x9f73('0xab')]>0x0;}function decremetOriginate(_0x304588){if(!_[_0x9f73('0x95')](_0x304588)&&_0x304588!==null){if(typeof _0x304588[_0x9f73('0xac')]!=='undefined'){if(_0x304588[_0x9f73('0xac')]>0x0){_0x304588[_0x9f73('0xac')]-=0x1;}else{logger[_0x9f73('0xa9')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9f73('0xa9')](_0x9f73('0xad'));}}function checkContactLowerLimitOriginate(_0x237155,_0x26c327,_0x409ee5){if(_0x26c327>_0x409ee5){for(var _0x1ca047=0x0;_0x1ca047<_0x26c327-_0x409ee5;_0x1ca047+=0x1){decremetOriginate(_0x237155);}}}function loggerGetContactDialer(_0x105873,_0x17b209,_0x5776dd){return function(_0x2b8c11){checkContactLowerLimitOriginate(_0x17b209,_0x5776dd,0x0);logger[_0x9f73('0xa9')](_0x105873,util['inspect'](_0x2b8c11,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x548709){return function(_0x55afb8){if(isNotNull(_0x55afb8)&&isNotNull(_0x55afb8[0x0])){if(_0x55afb8[0x0]['contactsRescheduled']>0x0){_0x548709[_0x9f73('0x49')]=_0x9f73('0xae');logger[_0x9f73('0x8f')](_0x9f73('0xaf')+_0x548709[_0x9f73('0x4b')],_0x55afb8[0x0][_0x9f73('0xb0')],_0x9f73('0xb1'));}else{_0x548709['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x9f73('0x8f')](_0x9f73('0xb2')+_0x548709[_0x9f73('0x4b')]);}}};}function notSendMessagesQueue(_0xad0f60){if(_0xad0f60[_0x9f73('0xb3')]){freeVariablesPredictive(_0xad0f60);if(_0xad0f60[_0x9f73('0xac')]===0x0&&_0xad0f60[_0x9f73('0x61')]===0x0&&_0xad0f60['waiting']===0x0&&(_0xad0f60[_0x9f73('0x5e')]||0x0)===0x0){_0xad0f60[_0x9f73('0xb3')]=![];_0xad0f60['available']=0x0;_0xad0f60[_0x9f73('0x49')]=_0x9f73('0x4d');loggerSyncQueueSummary['debug'](_0x9f73('0xb4'),_0xad0f60[_0x9f73('0x4b')],_0x9f73('0xb5'));}else{_0xad0f60[_0x9f73('0x49')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x9f73('0xa7')](_0x9f73('0xb4'),_0xad0f60[_0x9f73('0x4b')],'is\x20disactive');}emitVoiceQueueSummary(_0xad0f60);}}function notSendMessagesCampaign(_0x2aa308){if(_0x2aa308[_0x9f73('0xb3')]){if(_0x2aa308[_0x9f73('0xac')]===0x0){_0x2aa308['sendMessageOneNotActive']=![];_0x2aa308[_0x9f73('0x49')]=_0x9f73('0x4d');loggerSyncQueueSummary[_0x9f73('0xa7')](_0x9f73('0xb6'),_0x2aa308[_0x9f73('0x4b')],'is\x20not\x20active');}else{_0x2aa308[_0x9f73('0x49')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x9f73('0xa7')](_0x9f73('0xb6'),_0x2aa308[_0x9f73('0x4b')],_0x9f73('0xb7'));}emitCampaignSummary(_0x2aa308);}}function createObjHistory(_0x1dd8ae,_0x522bda,_0x567b4c,_0x2c6e5e,_0x4dcb17){_0x1dd8ae[_0x9f73('0x49')]=_0x567b4c;var _0x22e0e9=new Action(_0x1dd8ae,_0x522bda);var _0x40e0bf=new History(_0x22e0e9);_0x40e0bf[_0x9f73('0xb8')]=_0x2c6e5e;_0x40e0bf[_0x9f73('0xb9')]=_0x4dcb17;_0x40e0bf['endtime']=_0x22e0e9[_0x9f73('0xba')];return _0x40e0bf;}Dialer[_0x9f73('0x21')][_0x9f73('0x45')]=function(){var _0x3e1c2d=this;setInterval(function(){_0x3e1c2d['clearZombieChannels'](_0x3e1c2d[_0x9f73('0x2f')],_0x9f73('0xbb'));_0x3e1c2d[_0x9f73('0xbc')](_0x3e1c2d[_0x9f73('0x2d')],_0x9f73('0xbd'));},0x32c8);};Dialer[_0x9f73('0x21')][_0x9f73('0xbc')]=function(_0x4aca7f,_0x1c5d9d){var _0x2051e1=this;for(var _0x3a5280 in _0x4aca7f){if(typeof _0x4aca7f[_0x3a5280]!==_0x9f73('0xbe')){this[_0x9f73('0x25')][_0x9f73('0x22')](function(){if(!_[_0x9f73('0xbf')](_0x4aca7f[_0x3a5280])){return ami[_0x9f73('0xc0')]({'action':'status','channel':_0x4aca7f[_0x3a5280][_0x9f73('0xc1')]})[_0x9f73('0xc2')](function(_0x302fa3){if(_0x302fa3['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x4aca7f[_0x3a5280]&&_0x4aca7f[_0x3a5280][_0x9f73('0x87')]!==_0x9f73('0x88')){_0x2051e1[_0x9f73('0xc3')](_0x2051e1['voiceQueues'][_0x4aca7f[_0x3a5280][_0x9f73('0xc4')]]);logger[_0x9f73('0xa9')](_0x9f73('0xc5'),_0x1c5d9d,_0x3a5280,_0x4aca7f[_0x3a5280][_0x9f73('0xc4')]);delete _0x4aca7f[_0x3a5280];}if(_0x4aca7f[_0x3a5280]&&_0x4aca7f[_0x3a5280][_0x9f73('0x87')]===_0x9f73('0x88')){_0x2051e1[_0x9f73('0xc3')](_0x2051e1[_0x9f73('0x28')][_0x4aca7f[_0x3a5280][_0x9f73('0xc4')]]);logger[_0x9f73('0xa9')](_0x9f73('0xc6'),_0x1c5d9d,_0x3a5280,_0x4aca7f[_0x3a5280]['queue']);delete _0x4aca7f[_0x3a5280];}},0x2328);}});}});}}};Dialer[_0x9f73('0x21')][_0x9f73('0xc7')]=function(_0x12b9e6){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopper[_0x9f73('0xc7')](_0x12b9e6))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xc9')));};Dialer[_0x9f73('0x21')]['checkIsBlackList']=function(_0x2b2637){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopperBlack[_0x9f73('0xca')](_0x2b2637))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xcb')));};Dialer[_0x9f73('0x21')][_0x9f73('0xcc')]=function(_0x5072,_0xe244b,_0x396c8d){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5072,_0xe244b,_0x396c8d))['catch'](loggerCatch(_0x9f73('0xcd')));};Dialer['prototype'][_0x9f73('0xce')]=function(_0x237af0,_0x1ca4bd,_0x1973e2){return Promise['resolve']()[_0x9f73('0x47')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x237af0,_0x1ca4bd,_0x1973e2))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xcf')));};Dialer[_0x9f73('0x21')][_0x9f73('0xd0')]=function(_0x237831){return Promise['resolve']()['then'](cmHopperBlack[_0x9f73('0xd0')](_0x237831))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x9f73('0x21')]['averageHandleTime']=function(_0x37080b){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopperHistory[_0x9f73('0xd1')](_0x37080b))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xd2')));};Dialer[_0x9f73('0x21')][_0x9f73('0xd3')]=function(_0x556297){return Promise['resolve']()[_0x9f73('0x47')](cmHopper[_0x9f73('0xd3')](_0x556297))['catch'](loggerCatch(_0x9f73('0xd4')));};Dialer[_0x9f73('0x21')][_0x9f73('0xd5')]=function(_0x55b2d3,_0x40e2f0,_0xcd1ea7){return Promise['resolve']()[_0x9f73('0x47')](cmHopper[_0x9f73('0xd5')](_0x55b2d3,_0x40e2f0,_0xcd1ea7))['catch'](loggerCatch(_0x9f73('0xd6')));};Dialer['prototype'][_0x9f73('0xd7')]=function(_0xedb513,_0x3e2098,_0xb3b20,_0x2c18e6,_0xc2dd27){return Promise[_0x9f73('0xc8')]()['then'](cmHopper[_0x9f73('0xd7')](_0xedb513,_0x3e2098,_0xb3b20,_0x2c18e6))[_0x9f73('0xc2')](function(_0x36ba25){_0xc2dd27[_0x9f73('0xd8')]-=_0xb3b20;_0xc2dd27['temp']=_0xc2dd27[_0x9f73('0xd8')]>0x0?_0xc2dd27['temp']:0x0;loggerCatch(_0x9f73('0xd9'))(_0x36ba25);});};Dialer[_0x9f73('0x21')][_0x9f73('0xda')]=function(_0x2d8461,_0x33f0d3,_0x84be57,_0x5dd4d0){return Promise['resolve']()[_0x9f73('0x47')](cmHopper[_0x9f73('0xda')](_0x2d8461,_0x33f0d3,_0x84be57))[_0x9f73('0xc2')](function(_0x19e8cc){_0x5dd4d0[_0x9f73('0xd8')]-=_0x33f0d3;_0x5dd4d0['temp']=_0x5dd4d0[_0x9f73('0xd8')]>0x0?_0x5dd4d0[_0x9f73('0xd8')]:0x0;loggerCatch(_0x9f73('0xdb'))(_0x19e8cc);});};Dialer['prototype'][_0x9f73('0xdc')]=function(_0x5b7381){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5b7381))[_0x9f73('0xc2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x9f73('0x21')][_0x9f73('0xdd')]=function(_0x23f7cf){return Promise['resolve']()[_0x9f73('0x47')](cmHopper[_0x9f73('0xdd')](_0x23f7cf))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xde')));};Dialer[_0x9f73('0x21')][_0x9f73('0xdf')]=function(_0xd385da){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopperHistory['createHistory'](_0xd385da))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xe0')));};Dialer[_0x9f73('0x21')][_0x9f73('0xc3')]=function(_0x132e60){if(!_[_0x9f73('0x95')](_0x132e60)&&_0x132e60!==null){if(typeof _0x132e60[_0x9f73('0xac')]!=='undefined'){if(_0x132e60[_0x9f73('0xac')]>0x0){_0x132e60[_0x9f73('0xac')]-=0x1;}else{logger[_0x9f73('0xa9')](_0x9f73('0xe1'));}}}else{logger['error'](_0x9f73('0xe2'));}};Dialer[_0x9f73('0x21')][_0x9f73('0xe3')]=function(_0x13c737,_0x5413d7){var _0x123ad5=this;return function(_0x143da4){_0x123ad5[_0x9f73('0xc3')](_0x5413d7);logger['error'](_0x13c737,util[_0x9f73('0xa8')](_0x143da4,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x9f73('0xe4')]=function(_0x1d712e,_0x34e8d6,_0xcb266e){var _0x858c57={'state':0x19,'statedesc':_0x9f73('0xe5')};this[_0x9f73('0xc3')](_0x34e8d6);this[_0x9f73('0xe6')](_[_0x9f73('0x9f')](_0x858c57,_[_0x9f73('0xe7')](_0xcb266e,[_0x9f73('0xe8'),'ListId','UserId','VoiceQueueId',_0x9f73('0xe9')])),_0x9f73('0xea'),_0x9f73('0xeb'));logger['error'](_0x1d712e);};Dialer['prototype'][_0x9f73('0xec')]=function(_0x20f4cf){return _0x20f4cf==='Success';};Dialer[_0x9f73('0x21')][_0x9f73('0xed')]=function(_0x18120e){return!_[_0x9f73('0x95')](_0x18120e)&&_0x18120e&&!_[_0x9f73('0x95')](_0x18120e['name'])&&!_[_0x9f73('0x95')](_0x18120e['active'])&&_0x18120e[_0x9f73('0xee')]&&(this[_0x9f73('0x2a')][util[_0x9f73('0x89')](_0x9f73('0xef'),_0x18120e['name'])][_0x9f73('0xf0')]===_0x9f73('0xf1')||this[_0x9f73('0x2a')][util[_0x9f73('0x89')](_0x9f73('0xef'),_0x18120e[_0x9f73('0x4b')])][_0x9f73('0xf0')]===_0x9f73('0xf2'));};Dialer[_0x9f73('0x21')][_0x9f73('0xe6')]=function(_0x2162f2,_0x58642f,_0x4129f4){this[_0x9f73('0xdf')](_0x2162f2)[_0x9f73('0xc2')](loggerCatch(_0x58642f));this[_0x9f73('0xdd')](_0x2162f2)[_0x9f73('0xc2')](loggerCatch(_0x4129f4));};Dialer['prototype']['syncVarSet']=function(_0x1fc127){var _0x4a110c=this;var _0xbfec81=this[_0x9f73('0x2f')][_0x1fc127['uniqueid']];var _0x385973;if(!_[_0x9f73('0xbf')](_0x1fc127)&&!_[_0x9f73('0xbf')](_0x1fc127['variable'])&&!_[_0x9f73('0xbf')](_0x1fc127[_0x9f73('0xf3')]['amdstatus'])&&_0x1fc127[_0x9f73('0xf4')]==='xcally-motion-dialer'&&_0xbfec81){if(_0xbfec81[_0x9f73('0x87')]!==_0x9f73('0x88')&&this[_0x9f73('0x27')][_0xbfec81[_0x9f73('0xc4')]]['dialAMDActive']&&_0x1fc127[_0x9f73('0xf5')]==='HANGUP'){delete this[_0x9f73('0x2f')][_0x1fc127[_0x9f73('0xf6')]];this[_0x9f73('0xc3')](this[_0x9f73('0x27')][_0xbfec81[_0x9f73('0xc4')]]);this[_0x9f73('0x27')][_0xbfec81['queue']][_0x9f73('0x6c')]+=0x1;this[_0x9f73('0x27')][_0xbfec81['queue']][_0x9f73('0x6b')]+=0x1;_0x385973=new Hangup(_0xbfec81,_0x1fc127);_0x385973[_0x9f73('0xb8')]=0x12;_0x385973[_0x9f73('0xb9')]=_0x9f73('0xf7');_0x385973[_0x9f73('0xf8')]=_0x9f73('0xf9');ami[_0x9f73('0x59')]('custom:amd',ut[_0x9f73('0xfa')](_0x385973,_0x9f73('0xfb')));this[_0x9f73('0xe6')](_0x385973,_0x9f73('0xfc'),_0x9f73('0xfd'));}if(_0xbfec81[_0x9f73('0x87')]!==_0x9f73('0x88')&&this['voiceQueues'][_0xbfec81['queue']][_0x9f73('0xfe')]&&_0x1fc127[_0x9f73('0xf5')]==='MACHINE'){return new Promise(function(_0xaff40,_0x2a99f2){delete _0x4a110c[_0x9f73('0x2f')][_0x1fc127[_0x9f73('0xf6')]];_0x4a110c['updateOriginated'](_0x4a110c[_0x9f73('0x27')][_0xbfec81[_0x9f73('0xc4')]]);_0x4a110c[_0x9f73('0x27')][_0xbfec81[_0x9f73('0xc4')]][_0x9f73('0x6c')]+=0x1;_0x4a110c[_0x9f73('0x27')][_0xbfec81['queue']][_0x9f73('0x6b')]+=0x1;var _0x56a0c2=_0x4a110c[_0x9f73('0x27')][_0xbfec81['queue']];var _0x4c284c=new Hangup(_0xbfec81,_0x1fc127);_0x4c284c['state']=0x13;_0x4c284c['statedesc']=_0x9f73('0xff');_0x4c284c[_0x9f73('0xf8')]='AMD';_0x4c284c[_0x9f73('0x100')]+=0x1;_0x4c284c[_0x9f73('0x101')]+=0x1;_0x4c284c[_0x9f73('0xfb')]=!![];ami[_0x9f73('0x59')]('custom:amd',ut['buildObj'](_0x4c284c,_0x9f73('0xfb')));_0x4a110c[_0x9f73('0xdf')](_0x4c284c)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x102')));if(_0x4c284c[_0x9f73('0x103')]+_0x4c284c[_0x9f73('0x104')]+_0x4c284c['countnoanswerretry']+_0x4c284c[_0x9f73('0x105')]+_0x4c284c[_0x9f73('0x106')]+_0x4c284c['countabandonedretry']+_0x4c284c[_0x9f73('0x100')]+_0x4c284c[_0x9f73('0x107')]>=_0x56a0c2[_0x9f73('0x108')]){_0x4a110c[_0x9f73('0x109')](_0x4c284c,_0xaff40,_0x2a99f2,_0x9f73('0x10a'));}else{if(_0x4c284c[_0x9f73('0x100')]>=_0x56a0c2[_0x9f73('0x10b')]){_0x4a110c[_0x9f73('0x10c')](_0x4c284c,_0xaff40,_0x2a99f2,_0x9f73('0x10d'));}else{_0x4a110c['rescheduleContact']({'active':![],'countmachineretry':_0x4c284c['countmachineretry'],'scheduledat':moment()[_0x9f73('0x10e')](_0x56a0c2['dialMachineRetryFrequency'],_0x9f73('0x10f'))[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x4c284c['ContactId'],'ListId':_0x4c284c[_0x9f73('0x111')],'VoiceQueueId':_0x4c284c[_0x9f73('0x112')]||undefined,'CampaignId':_0x4c284c[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x113')));_0xaff40({'reschedule':0x1});}}});}if(_0xbfec81[_0x9f73('0x87')]==='ivr'&&this[_0x9f73('0x28')][_0xbfec81['queue']][_0x9f73('0xfe')]&&_0x1fc127['value']===_0x9f73('0x114')){delete this['uniqueId'][_0x1fc127[_0x9f73('0xf6')]];this[_0x9f73('0xc3')](this[_0x9f73('0x28')][_0xbfec81[_0x9f73('0xc4')]]);_0x385973=new Hangup(_0xbfec81,_0x1fc127);_0x385973[_0x9f73('0xb8')]=0x12;_0x385973['statedesc']='HangupInAMD';_0x385973[_0x9f73('0xf8')]=_0x9f73('0xf9');ami[_0x9f73('0x59')](_0x9f73('0x115'),ut['buildObj'](_0x385973,'amd'));this[_0x9f73('0xe6')](_0x385973,_0x9f73('0x116'),_0x9f73('0x117'));}if(_0xbfec81[_0x9f73('0x87')]===_0x9f73('0x88')&&this[_0x9f73('0x28')][_0xbfec81[_0x9f73('0xc4')]][_0x9f73('0xfe')]&&_0x1fc127['value']===_0x9f73('0x118')){return new Promise(function(_0x28c241,_0x3d8e6e){delete _0x4a110c[_0x9f73('0x2f')][_0x1fc127['uniqueid']];_0x4a110c[_0x9f73('0xc3')](_0x4a110c[_0x9f73('0x28')][_0xbfec81['queue']]);_0x4a110c['campaigns'][_0xbfec81[_0x9f73('0xc4')]][_0x9f73('0x6c')]+=0x1;_0x4a110c[_0x9f73('0x28')][_0xbfec81[_0x9f73('0xc4')]][_0x9f73('0x6b')]+=0x1;var _0x880cdf=_0x4a110c[_0x9f73('0x28')][_0xbfec81[_0x9f73('0xc4')]];var _0x4d7ced=new Hangup(_0xbfec81,_0x1fc127);_0x4d7ced[_0x9f73('0xb8')]=0x13;_0x4d7ced[_0x9f73('0xb9')]='Machine';_0x4d7ced['membername']='AMD';_0x4d7ced[_0x9f73('0x100')]+=0x1;_0x4d7ced['countglobal']+=0x1;_0x4d7ced['amd']=!![];ami['emit'](_0x9f73('0x115'),ut['buildObj'](_0x4d7ced,_0x9f73('0xfb')));_0x4a110c[_0x9f73('0xdf')](_0x4d7ced)['catch'](loggerCatch(_0x9f73('0x102')));if(_0x4d7ced['countbusyretry']+_0x4d7ced['countcongestionretry']+_0x4d7ced[_0x9f73('0x119')]+_0x4d7ced[_0x9f73('0x105')]+_0x4d7ced['countdropretry']+_0x4d7ced[_0x9f73('0x11a')]+_0x4d7ced[_0x9f73('0x100')]+_0x4d7ced[_0x9f73('0x107')]>=_0x880cdf[_0x9f73('0x108')]){_0x4a110c[_0x9f73('0x109')](_0x4d7ced,_0x28c241,_0x3d8e6e,_0x9f73('0x10a'));}else{if(_0x4d7ced[_0x9f73('0x100')]>=_0x880cdf[_0x9f73('0x10b')]){_0x4a110c[_0x9f73('0x10c')](_0x4d7ced,_0x28c241,_0x3d8e6e,'reason\x2019\x20machine....');}else{_0x4a110c[_0x9f73('0xd3')]({'active':![],'countmachineretry':_0x4d7ced[_0x9f73('0x100')],'scheduledat':moment()[_0x9f73('0x10e')](_0x880cdf[_0x9f73('0x11b')],_0x9f73('0x10f'))[_0x9f73('0x89')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4d7ced[_0x9f73('0xe8')],'ListId':_0x4d7ced[_0x9f73('0x111')],'VoiceQueueId':_0x4d7ced[_0x9f73('0x112')]||undefined,'CampaignId':_0x4d7ced['CampaignId']||undefined})[_0x9f73('0xc2')](loggerCatch('[rescheduleContact][Machine]'));_0x28c241({'reschedule':0x1});}}});}}};Dialer[_0x9f73('0x21')][_0x9f73('0x3b')]=function(_0x4e659d){var _0x8f040b=this['uniqueId'][_0x4e659d[_0x9f73('0xf6')]];var _0x58b938;if(_0x8f040b&&_0x8f040b[_0x9f73('0x87')]===_0x9f73('0x88')){delete this['uniqueId'][_0x4e659d[_0x9f73('0xf6')]];this[_0x9f73('0xc3')](this['campaigns'][_0x8f040b[_0x9f73('0xc4')]]);this[_0x9f73('0x28')][_0x8f040b[_0x9f73('0xc4')]][_0x9f73('0x11c')]+=0x1;_0x58b938=new Hangup(_0x8f040b,_0x4e659d);this['createHistory'](_0x58b938)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x11d')));this[_0x9f73('0xdd')](_0x58b938)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x11e')));}if(_0x8f040b&&_0x8f040b['type']!==_0x9f73('0x88')&&isNotNull(this[_0x9f73('0x27')][_0x8f040b[_0x9f73('0xc4')]][_0x9f73('0x11f')])){delete this[_0x9f73('0x2f')][_0x4e659d[_0x9f73('0xf6')]];this['updateOriginated'](this[_0x9f73('0x27')][_0x8f040b[_0x9f73('0xc4')]]);this[_0x9f73('0x27')][_0x8f040b['queue']][_0x9f73('0x6c')]+=0x1;this[_0x9f73('0x27')][_0x8f040b['queue']][_0x9f73('0x6b')]+=0x1;_0x58b938=new Hangup(_0x8f040b,_0x4e659d);_0x58b938[_0x9f73('0xb8')]=0x10;_0x58b938[_0x9f73('0xb9')]=_0x9f73('0x120');_0x58b938[_0x9f73('0xf8')]='AGI';this[_0x9f73('0xdf')](_0x58b938)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x11d')));this[_0x9f73('0xdd')](_0x58b938)[_0x9f73('0xc2')](loggerCatch('[syncHangupIvr]'));}if(_0x8f040b&&_0x8f040b[_0x9f73('0x87')]!==_0x9f73('0x88')&&!isNotNull(this[_0x9f73('0x27')][_0x8f040b['queue']][_0x9f73('0x11f')])){delete this[_0x9f73('0x2f')][_0x4e659d[_0x9f73('0xf6')]];this['updateOriginated'](this[_0x9f73('0x27')][_0x8f040b[_0x9f73('0xc4')]]);this[_0x9f73('0x27')][_0x8f040b[_0x9f73('0xc4')]]['outboundUnknownCallsDay']+=0x1;_0x58b938=new Hangup(_0x8f040b,_0x4e659d);_0x58b938[_0x9f73('0xb8')]=0xc;_0x58b938[_0x9f73('0xb9')]=_0x4e659d['cause-txt'];_0x58b938['membername']='Unknow';this[_0x9f73('0xdf')](_0x58b938)['catch'](loggerCatch(_0x9f73('0x11d')));this[_0x9f73('0xdd')](_0x58b938)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x11e')));}};Dialer[_0x9f73('0x21')][_0x9f73('0x39')]=function(_0x45d158){var _0x28c35b=this[_0x9f73('0x2f')][_0x45d158['uniqueid']];if(this['voiceQueues'][_0x45d158[_0x9f73('0xc4')]]){if(_0x28c35b&&_0x28c35b[_0x9f73('0x87')]!==_0x9f73('0x88')){delete this[_0x9f73('0x2f')][_0x45d158[_0x9f73('0xf6')]];this['voiceQueues'][_0x45d158['queue']][_0x9f73('0x6c')]+=0x1;var _0x5a92a1=new AgentComplete(_0x28c35b,_0x45d158);if(_0x45d158[_0x9f73('0x121')]==='agent'){_0x5a92a1['agiafterat']=this[_0x9f73('0x27')][_0x45d158[_0x9f73('0xc4')]][_0x9f73('0x122')]&&this[_0x9f73('0x27')][_0x45d158[_0x9f73('0xc4')]][_0x9f73('0x123')]?moment()[_0x9f73('0x89')](_0x9f73('0x110')):undefined;}this['createHistory'](_0x5a92a1)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x124')));this[_0x9f73('0xdd')](_0x5a92a1)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x125')));}}};Dialer[_0x9f73('0x21')][_0x9f73('0x126')]=function(_0x544ba8){if(this[_0x9f73('0x27')][_0x544ba8[_0x9f73('0xc4')]]){if(this[_0x9f73('0x2f')][_0x544ba8[_0x9f73('0xf6')]]&&this[_0x9f73('0x2f')][_0x544ba8['uniqueid']]['type']!==_0x9f73('0x88')){this[_0x9f73('0xc3')](this['voiceQueues'][_0x544ba8[_0x9f73('0xc4')]]);this[_0x9f73('0x2f')][_0x544ba8[_0x9f73('0xf6')]][_0x9f73('0x127')]=moment()[_0x9f73('0x89')](_0x9f73('0x110'));}}};Dialer[_0x9f73('0x21')]['queueCallerAbandonCreateState']=function(_0xd1a73e,_0x562120){this[_0x9f73('0xdf')](_0xd1a73e)['catch'](loggerCatch(_0x9f73('0x124')));if(_0x562120==0x0){this[_0x9f73('0xdd')](_0xd1a73e)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x128')));}};Dialer[_0x9f73('0x21')][_0x9f73('0x35')]=function(_0x3a4da4){var _0x2814a9=this[_0x9f73('0x2f')][_0x3a4da4[_0x9f73('0xf6')]];var _0x170402=this;var _0x361d9c=![];var _0x68a16d;var _0x37fa1d;if(this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]]){if(_0x2814a9&&_0x2814a9[_0x9f73('0x87')]!==_0x9f73('0x88')){delete this[_0x9f73('0x2f')][_0x3a4da4[_0x9f73('0xf6')]];this['updateOriginated'](this[_0x9f73('0x27')][_0x3a4da4['queue']]);_0x2814a9[_0x9f73('0x129')]=moment()[_0x9f73('0x89')](_0x9f73('0x110'));var _0x1c19ff=new QueueCallerAbandon(_0x2814a9,_0x3a4da4);if(getSeconds(_0x2814a9['droptime'],_0x2814a9[_0x9f73('0x12a')])>=_0x2814a9[_0x9f73('0x12b')]){this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x7a')]+=0x1;this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x71')]+=0x1;this[_0x9f73('0x27')][_0x3a4da4['queue']][_0x9f73('0x12c')]+=0x1;_0x1c19ff[_0x9f73('0xb8')]=0xa;_0x1c19ff[_0x9f73('0xb9')]=_0x9f73('0x12d');_0x1c19ff[_0x9f73('0x12e')]=_0x9f73('0x12f');_0x1c19ff[_0x9f73('0x130')]=this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]]['dialQueueProject2']?moment()[_0x9f73('0x89')](_0x9f73('0x110')):undefined;_0x1c19ff['countdropretry']+=0x1;_0x1c19ff[_0x9f73('0x101')]+=0x1;_0x68a16d=this['voiceQueues'][_0x3a4da4[_0x9f73('0xc4')]]['dialDropRetryFrequency'];_0x37fa1d=this['voiceQueues'][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x131')];_0x170402[_0x9f73('0xcc')](_0x1c19ff,_0x1c19ff[_0x9f73('0xb8')],_0x2814a9[_0x9f73('0x132')])[_0x9f73('0x47')](function(_0xc2d192){_0x361d9c=_0xc2d192[_0x9f73('0x133')]==0x1;if(_0x1c19ff[_0x9f73('0x106')]>=_0x170402[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x134')]){_0x170402[_0x9f73('0x135')](_0x1c19ff,_0xc2d192[_0x9f73('0x133')]);}else{_0x170402[_0x9f73('0xd3')]({'active':![],'countdropretry':_0x1c19ff[_0x9f73('0x106')],'scheduledat':moment()['add'](_0x170402[_0x9f73('0x27')][_0x3a4da4['queue']][_0x9f73('0x136')],'minutes')[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x2814a9['ContactId'],'ListId':_0x2814a9[_0x9f73('0x111')],'VoiceQueueId':_0x2814a9['VoiceQueueId']||undefined,'CampaignId':_0x2814a9[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch('[rescheduleContact][Drop]'));var _0xad71a5=new History(_0x1c19ff);_0xad71a5[_0x9f73('0xb8')]=0xa;_0xad71a5['statedesc']='Drop';_0xad71a5[_0x9f73('0xba')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xad71a5['endtime']=_0xad71a5['starttime'];_0xad71a5['calleridname']=_0x1c19ff[_0x9f73('0x137')];_0xad71a5[_0x9f73('0x138')]=_0x1c19ff['calleridnum'];_0x170402[_0x9f73('0xdf')](_0xad71a5)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x139')));}})['then'](function(){if(_0x361d9c)_0x170402[_0x9f73('0xce')](_0x1c19ff,_0x68a16d,_0x37fa1d)['then'](function(){return 0x1;});});}else{this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x79')]+=0x1;this[_0x9f73('0x27')][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x70')]+=0x1;_0x1c19ff[_0x9f73('0xb8')]=0xb;_0x1c19ff['statedesc']=_0x9f73('0x13a');_0x1c19ff[_0x9f73('0x12e')]=_0x9f73('0x13b');_0x1c19ff[_0x9f73('0x11a')]+=0x1;_0x1c19ff[_0x9f73('0x101')]+=0x1;_0x68a16d=this['voiceQueues'][_0x3a4da4['queue']][_0x9f73('0x13c')];_0x37fa1d=this['voiceQueues'][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x131')];_0x170402[_0x9f73('0xcc')](_0x1c19ff,_0x1c19ff['state'],_0x2814a9[_0x9f73('0x132')])[_0x9f73('0x47')](function(_0x1fd3da){if(_0x1c19ff[_0x9f73('0x11a')]>=_0x170402['voiceQueues'][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x13d')]){_0x170402['queueCallerAbandonCreateState'](_0x1c19ff,_0x1fd3da['additional']);}else{_0x170402[_0x9f73('0xd3')]({'active':![],'countabandonedretry':_0x1c19ff['countabandonedretry'],'scheduledat':moment()['add'](_0x170402['voiceQueues'][_0x3a4da4[_0x9f73('0xc4')]][_0x9f73('0x13c')],_0x9f73('0x10f'))[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x2814a9[_0x9f73('0xe8')],'ListId':_0x2814a9['ListId'],'VoiceQueueId':_0x2814a9[_0x9f73('0x112')]||undefined,'CampaignId':_0x2814a9['CampaignId']||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x13e')));var _0x378fd6=new History(_0x1c19ff);_0x378fd6['state']=0xb;_0x378fd6[_0x9f73('0xb9')]=_0x9f73('0x13a');_0x378fd6[_0x9f73('0xba')]=moment()[_0x9f73('0x89')]('YYYY-MM-DD\x20HH:mm:ss');_0x378fd6[_0x9f73('0x13f')]=_0x378fd6[_0x9f73('0xba')];_0x378fd6[_0x9f73('0x137')]=_0x1c19ff[_0x9f73('0x137')];_0x378fd6[_0x9f73('0x138')]=_0x1c19ff[_0x9f73('0x138')];_0x170402['createHistory'](_0x378fd6)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x140')));}})['then'](function(){if(_0x361d9c)_0x170402[_0x9f73('0xce')](_0x1c19ff,_0x68a16d,_0x37fa1d)[_0x9f73('0x47')](function(){return 0x1;});});}}}};Dialer[_0x9f73('0x21')][_0x9f73('0x3d')]=function(_0x29e712){if(this['actions'][_0x29e712['uniqueid']]){this[_0x9f73('0x2d')][_0x29e712[_0x9f73('0xf6')]][_0x9f73('0xc1')]=_0x29e712['channel'];}if(this['uniqueId'][_0x29e712['uniqueid']]){this[_0x9f73('0x2f')][_0x29e712[_0x9f73('0xf6')]][_0x9f73('0xc1')]=_0x29e712['channel'];}};Dialer[_0x9f73('0x21')]['syncQueueMember']=function(_0x17ebeb){if(strategy[this[_0x9f73('0x27')][this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]][_0x9f73('0xc4')]][_0x9f73('0x5b')]]===_0x9f73('0x20')){if(this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]]&&_[_0x9f73('0xbf')](this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]]['locked'])&&_0x17ebeb[_0x9f73('0xf0')]==='1'&&_0x17ebeb[_0x9f73('0x142')]==='0'){if(this[_0x9f73('0x29')][_0x17ebeb[_0x9f73('0x143')]]){if(!this[_0x9f73('0x29')][_0x17ebeb[_0x9f73('0x143')]][_0x9f73('0x144')]){this[_0x9f73('0x29')][_0x17ebeb[_0x9f73('0x143')]][_0x9f73('0x144')]=!![];this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]][_0x9f73('0x144')]=!![];this[_0x9f73('0x2d')][_0x17ebeb['actionid']][_0x9f73('0x143')]=_0x17ebeb[_0x9f73('0x143')];}}}}else if((strategy[this[_0x9f73('0x27')][this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]][_0x9f73('0xc4')]]['strategy']]||'rrmemory')===_0x9f73('0x1f')){if(this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]]){if(this[_0x9f73('0x29')][_0x17ebeb['stateinterface']]){this[_0x9f73('0x2d')][_0x17ebeb['actionid']]['stateinterface']=_0x17ebeb[_0x9f73('0x143')];if(_['isNil'](this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]]['queue']])){this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]][_0x9f73('0xc4')]]=[];}this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x17ebeb[_0x9f73('0x141')]][_0x9f73('0xc4')]]['push'](_[_0x9f73('0x9f')](_[_0x9f73('0xe7')](this['actions'][_0x17ebeb[_0x9f73('0x141')]],[_0x9f73('0x145'),_0x9f73('0x143')]),{'status':_0x17ebeb[_0x9f73('0xf0')],'paused':_0x17ebeb[_0x9f73('0x142')]}));}}}};function unlockQueueStatus(_0x427646,_0x5825be){setTimeout(function(){if(_[_0x9f73('0x95')](_0x427646[_0x9f73('0x146')])){loggerBooked[_0x9f73('0xa9')]('[unlockQueueStatus][undefined]',_0x5825be);}_0x427646[_0x9f73('0x146')]=!![];loggerBooked[_0x9f73('0x8f')](_0x9f73('0x147'),_0x5825be,JSON[_0x9f73('0x55')](_[_0x9f73('0xe7')](_0x427646,[_0x9f73('0x4b'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x9f73('0x21')]['syncQueueStatusComplete']=function(_0x440272){var _0x3e6d07=this;var _0x3ff880=_0x3e6d07['voiceQueues'][_0x3e6d07[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]]['queue']];if(strategy[this[_0x9f73('0x27')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]][_0x9f73('0x5b')]]===_0x9f73('0x20')){if(this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]]&&this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0x143')]){this[_0x9f73('0x26')][_0x9f73('0x148')](this['actions'][_0x440272[_0x9f73('0x141')]][_0x9f73('0x145')],this[_0x9f73('0x2d')][_0x440272['actionid']][_0x9f73('0x143')])[_0x9f73('0xc2')](function(_0x546cb7){logger[_0x9f73('0xa9')](_0x9f73('0x149'),util['inspect'](_0x546cb7,{'showHidden':![],'depth':null}));})[_0x9f73('0x24')](function(){_0x3e6d07[_0x9f73('0xc3')](_0x3e6d07[_0x9f73('0x27')][_0x3e6d07[_0x9f73('0x2d')][_0x440272['actionid']][_0x9f73('0xc4')]]);_0x3e6d07[_0x9f73('0x29')][_0x3e6d07[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0x143')]][_0x9f73('0x144')]=![];delete _0x3e6d07[_0x9f73('0x2d')][_0x440272['actionid']];unlockQueueStatus(_0x3ff880);});}else{this['updateOriginated'](this[_0x9f73('0x27')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]]);this[_0x9f73('0xd3')]({'active':![],'ContactId':this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xe8')],'ListId':this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0x111')],'VoiceQueueId':this['actions'][_0x440272[_0x9f73('0x141')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x14a')));delete this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]];unlockQueueStatus(_0x3ff880);}}else if((strategy[this[_0x9f73('0x27')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]][_0x9f73('0x5b')]]||'rrmemory')==='rrmemory'){var _0x20c00c;if(this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]]&&!_[_0x9f73('0x8b')](this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]]['queue']])){if(this[_0x9f73('0x32')][_0x3e6d07[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]]){this['queueBookedRR'][_0x3e6d07[_0x9f73('0x2d')][_0x440272['actionid']][_0x9f73('0xc4')]]=this['queueBookedRR'][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]]?this['queueBookedRR'][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]]:this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]]?this[_0x9f73('0x31')][this[_0x9f73('0x2d')][_0x440272['actionid']][_0x9f73('0xc4')]]['_rr']||0x0:0x0;}this[_0x9f73('0x31')][this['actions'][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]][_0x9f73('0x14b')]=this[_0x9f73('0x32')][this[_0x9f73('0x2d')][_0x440272[_0x9f73('0x141')]][_0x9f73('0xc4')]];for(var _0x32bcc2=0x0;_0x32bcc2=0x0;})[_0x9f73('0xc2')](myreject(_0x1cd019)));}}else{_0x1e1b0c[_0x9f73('0x162')](ami['Action']({'action':_0x9f73('0x163'),'command':util['format'](_0x9f73('0x164'),_0x570f9f,!_['isUndefined'](config[_0x9f73('0x15e')][_0x27b6a7])?_0x27b6a7:'')})['then'](function(_0x5d5730){return _0x5d5730[_0x9f73('0x166')][_0x9f73('0x167')]('true')>=0x0;})[_0x9f73('0xc2')](myreject(_0x1cd019)));}Promise[_0x9f73('0x169')](_0x1e1b0c)['then'](function(_0xf8fced){var _0x241d91=_['some'](_0xf8fced);if(_0x241d91){return _0x353e05(_0x241d91);}else{_0x1a1b30[_0x9f73('0x49')]=_0x3cab56?_0x9f73('0x16a'):_0x9f73('0x16b');return _0x1cd019(msgResponse('[ifTime][promiseAll]',_0x9f73('0x15d'),'Global:\x20'+_0x3cab56+'\x20'+_0x595385+_0x9f73('0x16c')+util['inspect'](_0x570f9f,{'showHidden':![],'depth':null})+_0x9f73('0x16d')+_0x27b6a7));}})[_0x9f73('0xc2')](function(_0x4dde6d){return _0x1cd019(msgResponse('ifTime','Failure',JSON['stringify'](_0x4dde6d)));});});};Dialer['prototype'][_0x9f73('0x16e')]=function(_0x51a546){var _0x4ad98c=this;return function(){switch(_0x51a546[_0x9f73('0x16f')]){case _0x9f73('0x170'):freeVariablesPredictive(_0x51a546);_0x4ad98c[_0x9f73('0x171')](_0x51a546,0x1);break;case'power':freeVariablesPredictive(_0x51a546);_0x4ad98c[_0x9f73('0x171')](_0x51a546,_0x51a546[_0x9f73('0x172')]);break;case _0x9f73('0xa'):_0x4ad98c[_0x9f73('0xa')](_0x51a546);break;case _0x9f73('0x9'):freeVariablesPredictive(_0x51a546);_0x4ad98c[_0x9f73('0x171')](_0x51a546,0x1);break;default:freeVariablesPredictive(_0x51a546);logger['error']('Queue',_0x51a546[_0x9f73('0x4b')],_0x9f73('0x173'));}};};Dialer[_0x9f73('0x21')][_0x9f73('0x174')]=function(_0x31d026){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopper[_0x9f73('0x175')](_0x31d026['id'],previewRecallmeReminderInterval))[_0x9f73('0x47')](function(_0x491a9e){for(var _0xda93aa=0x0;_0xda93aa<_0x491a9e[_0x9f73('0xab')];_0xda93aa++){var _0x2dc9be=_0x491a9e[_0xda93aa][_0x9f73('0x176')][_0x9f73('0x4b')];if(_0x2dc9be)io['to'](util[_0x9f73('0x89')](_0x9f73('0x177'),_0x2dc9be))['emit'](_0x9f73('0x178'),{'hopper':_0x491a9e[_0xda93aa]});}})[_0x9f73('0xc2')](function(){});};Dialer['prototype'][_0x9f73('0x179')]=function(_0x3d62e3){var _0x26967a=this;return function(){_0x26967a[_0x9f73('0x17a')](_0x3d62e3);};};Dialer['prototype'][_0x9f73('0xb')]=function(_0x40f645){var _0x5958fa=this;if(isNotPreview(_0x40f645[_0x9f73('0x16f')])){if(isVoiceQueueOutbound(_0x40f645[_0x9f73('0x87')])&&isActive(_0x40f645[_0x9f73('0x66')])){_0x40f645[_0x9f73('0xb3')]=!![];Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](checkIsLoggedIn(_0x40f645,_0x40f645[_0x9f73('0x17b')]))[_0x9f73('0x47')](checkIsActive(_0x40f645,_0x40f645[_0x9f73('0x66')]))['then'](checkInterval(_0x40f645))[_0x9f73('0x47')](_0x5958fa[_0x9f73('0x156')](_0x40f645))[_0x9f73('0x47')](_0x5958fa[_0x9f73('0x159')](_0x40f645[_0x9f73('0x17c')],_0x40f645['dialTimezone'],_0x40f645[_0x9f73('0x4b')],_0x40f645))[_0x9f73('0x47')](_0x5958fa[_0x9f73('0x15b')](_0x40f645[_0x9f73('0x4f')],_0x40f645[_0x9f73('0x17d')],_0x40f645[_0x9f73('0x4b')],_0x40f645))[_0x9f73('0x47')](_0x5958fa['checkDialMethod'](_0x40f645))[_0x9f73('0xc2')](loggerCatchQueueSummary(_0x9f73('0x17e'),_0x40f645));}else{notSendMessagesQueue(_0x40f645);}}else{freeVariablesPredictive(_0x40f645);}};Dialer[_0x9f73('0x21')][_0x9f73('0x17f')]=_[_0x9f73('0x180')](function(){var _0xaf7cb3=_[_0x9f73('0x181')](this['voiceQueues'],function(_0x29bd0f){return _0x29bd0f[_0x9f73('0x182')];});var _0x4e8bd8=_[_0x9f73('0x181')](this[_0x9f73('0x29')],function(_0x10fa16){return _0x10fa16[_0x9f73('0x183')]&&_0x10fa16['status']===_0x9f73('0xf1');});if(_0xaf7cb3[_0x9f73('0xab')]>0x0&&_0x4e8bd8[_0x9f73('0xab')]>0x0){return Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](cmHopper['handlePreviewRecallNotifications'](_[_0x9f73('0x184')](_0xaf7cb3,'id'),previewRecallmeReminderInterval,_[_0x9f73('0x184')](_0x4e8bd8,'id')))[_0x9f73('0x47')](function(_0x4fc5bb){for(var _0x317118=0x0;_0x317118<_0x4fc5bb[_0x9f73('0xab')];_0x317118++){var _0x104812=_0x4fc5bb[_0x317118][_0x9f73('0x176')][_0x9f73('0x4b')];if(_0x104812)io['to'](util[_0x9f73('0x89')](_0x9f73('0x177'),_0x104812))[_0x9f73('0x59')](_0x9f73('0x178'),{'hopper':_0x4fc5bb[_0x317118]});}})[_0x9f73('0xc2')](function(_0xfef3ba){logger[_0x9f73('0xa9')]('checkPreviewRecallReminder',_0xfef3ba);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9f73('0x21')][_0x9f73('0x185')]=function(){var _0x26a23f=this;var _0x2c3aef;for(var _0x5d5959 in this['campaigns']){if(typeof this[_0x9f73('0x28')][_0x5d5959]!==_0x9f73('0xbe')){_0x2c3aef=this[_0x9f73('0x28')][_0x5d5959];if(isCampaignIvr(_0x2c3aef[_0x9f73('0x87')])&&isActive(_0x2c3aef['active'])){_0x2c3aef[_0x9f73('0xb3')]=!![];Promise[_0x9f73('0xc8')]()[_0x9f73('0x47')](checkIsActive(_0x2c3aef,_0x2c3aef['active']))[_0x9f73('0x47')](checkInterval(_0x2c3aef))[_0x9f73('0x47')](_0x26a23f[_0x9f73('0x156')](_0x2c3aef))[_0x9f73('0x47')](_0x26a23f[_0x9f73('0x159')](_0x2c3aef[_0x9f73('0x17c')],_0x2c3aef[_0x9f73('0x17d')],_0x2c3aef[_0x9f73('0x4b')],_0x2c3aef))[_0x9f73('0x47')](_0x26a23f[_0x9f73('0x15b')](_0x2c3aef['Interval'],_0x2c3aef['dialTimezone'],_0x2c3aef[_0x9f73('0x4b')],_0x2c3aef))[_0x9f73('0x47')](_0x26a23f['launchHandleIvr'](_0x2c3aef))[_0x9f73('0xc2')](loggerCatchQueueSummary(_0x9f73('0x186'),_0x2c3aef));}else{notSendMessagesCampaign(_0x2c3aef);}}}};function getCallerIdRandom(_0x5b86b6,_0x2f6594){var _0x84ca1a;var _0x25e26f;var _0x2ed9dc;if(_0x2f6594<=0x0){_0x2f6594=0x1;}_0x84ca1a=new RegExp(_0x9f73('0x187')+_0x2f6594+'}$');_0x25e26f=Math['pow'](0xa,_0x2f6594-0x1);_0x2ed9dc=Math[_0x9f73('0x188')](0xa,_0x2f6594)-0x1;return util[_0x9f73('0x89')]('%s',_[_0x9f73('0x189')](_0x5b86b6,_0x84ca1a,_[_0x9f73('0x18a')](_0x25e26f,_0x2ed9dc)));}function extractCalleridName(_0x3a0e77){var _0x51e944=_0x3a0e77[_0x9f73('0x18b')](/"(.*?)"/);return _0x51e944?_0x51e944[0x1]:_0x3a0e77;}Dialer[_0x9f73('0x21')][_0x9f73('0x18c')]=function(_0x3dae24,_0x2d0c88){var _0x437d9c=this;var _0x366a7b=uuid['v4']();this[_0x9f73('0x2d')][_0x366a7b]=new Action(_0x3dae24,_0x2d0c88,_0x366a7b);return new Promise(function(_0x2cc44c,_0x5e4303){if(_['isUndefined'](_0x3dae24)&&typeof _0x3dae24!=='object'){return _0x5e4303(msgResponse(_0x9f73('0x18d'),_0x9f73('0x15d'),'voiceQueue\x20is\x20undefine'));}if(_[_0x9f73('0x95')](_0x2d0c88[_0x9f73('0x18e')])||_0x2d0c88['phone']===null){return _0x5e4303(msgResponse(_0x9f73('0x18d'),_0x9f73('0x15d'),_0x9f73('0x18f')));}var _0x3aa7b6={'XMD-CALLERID':_0x437d9c[_0x9f73('0x2d')][_0x366a7b][_0x9f73('0x190')](),'XMD-AGI':_0x3dae24[_0x9f73('0x11f')]?util['format'](_0x9f73('0x191'),ipAgi,_0x3dae24[_0x9f73('0x11f')]):_0x9f73('0x192'),'XMD-AGIAFTER':_0x3dae24[_0x9f73('0x122')]?util[_0x9f73('0x89')](_0x9f73('0x191'),ipAgi,_0x3dae24['dialQueueProject2']):_0x9f73('0x192'),'XMD-QUEUE':_0x3dae24[_0x9f73('0x87')]===_0x9f73('0x5a')?util[_0x9f73('0x89')]('\x22%s,%s%s,,,%s\x22',_0x3dae24[_0x9f73('0x4b')],_0x3dae24['dialQueueOptions']||'',_0x3dae24[_0x9f73('0x123')]?'c':'',_0x3dae24[_0x9f73('0x12b')]||0x3):_0x9f73('0x192'),'XMD-CONTACTID':_0x2d0c88[_0x9f73('0xe8')],'XMD-CDRTYPE':_0x9f73('0x8'),'CALLERID(all)':_0x437d9c[_0x9f73('0x2d')][_0x366a7b][_0x9f73('0x190')](),'XMD-AMD':_0x3dae24[_0x9f73('0xfe')]?_0x9f73('0x193'):_0x9f73('0x192'),'XMD-DESTINATION':_0x9f73('0x194')};if(_0x3dae24[_0x9f73('0xfe')]){_0x3aa7b6[_0x9f73('0x195')]=_0x3dae24[_0x9f73('0x196')]||0x9c4;_0x3aa7b6[_0x9f73('0x197')]=_0x3dae24['dialAMDGreeting']||0x5dc;_0x3aa7b6[_0x9f73('0x198')]=_0x3dae24['dialAMDAfterGreetingSilence']||0x320;_0x3aa7b6['XMD-AMDTOTALANALYSISTIME']=_0x3dae24[_0x9f73('0x199')]||0x1388;_0x3aa7b6[_0x9f73('0x19a')]=_0x3dae24['dialAMDMinWordLength']||0x64;_0x3aa7b6[_0x9f73('0x19b')]=_0x3dae24[_0x9f73('0x19c')]||0x32;_0x3aa7b6['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3dae24[_0x9f73('0x19d')]||0x3;_0x3aa7b6[_0x9f73('0x19e')]=_0x3dae24[_0x9f73('0x19f')]||0x100;_0x3aa7b6['XMD-AMDMAXIMUMWORDLENGTH']=_0x3dae24[_0x9f73('0x1a0')]||0x1388;}if(_0x3dae24[_0x9f73('0x87')]===_0x9f73('0x5a')){_0x3aa7b6[_0x9f73('0x1a1')]=_0x2d0c88['VoiceQueueId'];}else{_0x3aa7b6[_0x9f73('0x1a2')]=_0x2d0c88['CampaignId'];}for(var _0x163e2e in _0x2d0c88[_0x9f73('0x1a3')]){if(typeof _0x2d0c88[_0x9f73('0x1a3')][_0x163e2e]!==_0x9f73('0xbe')){if(isNotNull(_0x2d0c88['Contact'][_0x163e2e])&&_0x163e2e!=='id'&&_0x163e2e!==_0x9f73('0x1a4')&&_0x163e2e!==_0x9f73('0x1a5')&&_0x163e2e!==_0x9f73('0x1a6')){_0x3aa7b6[util['format']('%s%s','XMD-',_['toUpper'](_0x163e2e))]=_0x2d0c88[_0x9f73('0x1a3')][_0x163e2e];}}}var _0x5ae11b=_0x437d9c[_0x9f73('0xed')](_0x3dae24[_0x9f73('0x84')])?getCallerId(_0x3dae24['Trunk'][_0x9f73('0x1a7')],_0x3dae24[_0x9f73('0x67')],_0x3dae24[_0x9f73('0x1a8')]>0x0?getCallerIdRandom(_0x3dae24[_0x9f73('0x68')],_0x3dae24['dialRandomLastDigitCallerIdNumber']):_0x3dae24[_0x9f73('0x68')]):getCallerId(_[_0x9f73('0xbf')](_0x3dae24[_0x9f73('0x157')])?_0x3dae24['Trunk']['callerid']:_0x3dae24['TrunkBackup'][_0x9f73('0x1a7')],_0x3dae24[_0x9f73('0x67')],_0x3dae24[_0x9f73('0x1a8')]>0x0?getCallerIdRandom(_0x3dae24[_0x9f73('0x68')],_0x3dae24['dialRandomLastDigitCallerIdNumber']):_0x3dae24[_0x9f73('0x68')]);if(_0x5ae11b){_0x3aa7b6[_0x9f73('0x1a9')]=_0x437d9c[_0x9f73('0x2d')][_0x366a7b][_0x9f73('0x1aa')]=extractCalleridName(_0x5ae11b);_0x3aa7b6[_0x9f73('0x1ab')]=_0x2d0c88[_0x9f73('0x18e')];}_0x3dae24['variables']=_0x3aa7b6;return ami[_0x9f73('0xc0')]({'actionid':_0x366a7b,'action':_0x9f73('0x18d'),'channel':_0x437d9c['isTrunkReachable'](_0x3dae24[_0x9f73('0x84')])?util['format'](_0x9f73('0x1ac'),_0x3dae24[_0x9f73('0x84')][_0x9f73('0x4b')],isNotNull(_0x3dae24[_0x9f73('0x6a')])?_0x3dae24[_0x9f73('0x6a')][_0x9f73('0x1ad')]()||'':'',_0x3dae24[_0x9f73('0x1ae')]>0x0?_0x2d0c88[_0x9f73('0x18e')]['substring'](_0x3dae24[_0x9f73('0x1ae')]):_0x2d0c88['phone']):util[_0x9f73('0x89')](_0x9f73('0x1ac'),_['isNil'](_0x3dae24[_0x9f73('0x157')])?_0x3dae24[_0x9f73('0x84')][_0x9f73('0x4b')]:_0x3dae24['TrunkBackup']['name'],isNotNull(_0x3dae24['dialPrefix'])?_0x3dae24['dialPrefix'][_0x9f73('0x1ad')]()||'':'',_0x3dae24[_0x9f73('0x1ae')]>0x0?_0x2d0c88[_0x9f73('0x18e')][_0x9f73('0x1af')](_0x3dae24['dialCutDigit']):_0x2d0c88[_0x9f73('0x18e')]),'callerid':_0x5ae11b,'Exten':_0x9f73('0x194'),'Context':'from-sip','Priority':'1','variable':_0x3aa7b6,'timeout':(_0x3dae24[_0x9f73('0x69')]||0x1e)*0x3e8,'async':!![],'channelid':_0x366a7b})[_0x9f73('0x47')](function(_0x22897c){return _0x2cc44c(_0x22897c);})[_0x9f73('0xc2')](function(_0x2636a0){_0x3dae24['outboundOriginateFailureCallsDay']+=0x1;var _0xd38ba8=new History(_0x437d9c['actions'][_0x366a7b]);logger[_0x9f73('0xa9')](util[_0x9f73('0x89')](_0x9f73('0x1b0'),JSON['stringify'](_0x2636a0)));_0xd38ba8[_0x9f73('0xb8')]=0xe;_0xd38ba8['statedesc']=_0x9f73('0x1b1');_0xd38ba8[_0x9f73('0xba')]=moment()[_0x9f73('0x89')]('YYYY-MM-DD\x20HH:mm:ss');_0xd38ba8['endtime']=_0xd38ba8[_0x9f73('0xba')];_0x437d9c['createHistory'](_0xd38ba8)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1b2')));_0x437d9c[_0x9f73('0xdd')](_0xd38ba8)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1b2')))[_0x9f73('0x24')](function(){delete _0x437d9c[_0x9f73('0x2d')][_0x366a7b];return _0x5e4303(msgResponse(_0x9f73('0x18d'),_0x9f73('0x54'),_0x9f73('0x1b3')));});});});};Dialer[_0x9f73('0x21')][_0x9f73('0x37')]=function(_0x28b272){var _0x515b33=this[_0x9f73('0x2d')][_0x28b272['actionid']];if(_0x515b33){delete this['actions'][_0x28b272[_0x9f73('0x141')]];_0x515b33[_0x9f73('0x12a')]=moment()[_0x9f73('0x89')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2a0153=_0x515b33[_0x9f73('0x87')]===_0x9f73('0x88')?this[_0x9f73('0x28')][_0x515b33['queue']]:this[_0x9f73('0x27')][_0x515b33[_0x9f73('0x1b4')]()];if(!this[_0x9f73('0xec')](_0x28b272[_0x9f73('0x1b5')])){this[_0x9f73('0xc3')](_0x2a0153);return this['callProgressDetecting'](_0x515b33,_0x2a0153,_0x28b272)[_0x9f73('0xc2')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x28b272[_0x9f73('0xf6')]]=_0x515b33;}};Dialer[_0x9f73('0x21')][_0x9f73('0x1b6')]=function(_0x3c7667,_0x1de447,_0x9237f4){var _0x24da63=new History(_0x1de447);if(_0x24da63['countbusyretry']+_0x24da63['countcongestionretry']+_0x24da63[_0x9f73('0x119')]+_0x24da63[_0x9f73('0x105')]+_0x24da63[_0x9f73('0x106')]+_0x24da63[_0x9f73('0x11a')]+_0x24da63[_0x9f73('0x100')]+_0x24da63[_0x9f73('0x107')]>=_0x9237f4[_0x9f73('0x108')]-0x1){return!![];}switch(_0x3c7667){case 0x3:if(_0x24da63[_0x9f73('0x119')]>=_0x9237f4['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x24da63['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x1b7')],_0x9f73('0x10f'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x24da63[_0x9f73('0x103')]>=_0x9237f4[_0x9f73('0x1b8')]-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countbusyretry':_0x24da63[_0x9f73('0x103')]+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x1b9')],_0x9f73('0x10f'))['format'](_0x9f73('0x110')),'ContactId':_0x24da63['ContactId'],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63['CampaignId']||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1ba')));break;case 0x8:if(_0x24da63[_0x9f73('0x104')]>=_0x9237f4['dialCongestionMaxRetry']-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countcongestionretry':_0x24da63[_0x9f73('0x104')]+=0x1,'scheduledat':moment()[_0x9f73('0x10e')](_0x9237f4[_0x9f73('0x1bb')],_0x9f73('0x10f'))[_0x9f73('0x89')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1bc')));break;case 0x0:if(_0x24da63[_0x9f73('0x105')]>=_0x9237f4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x9f73('0xd3')]({'active':![],'countnosuchnumberretry':_0x24da63[_0x9f73('0x105')]+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x1bd')],'minutes')[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1be')));}break;case 0xa:if(_0x24da63[_0x9f73('0x106')]>=_0x9237f4[_0x9f73('0x134')]-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countdropretry':_0x24da63[_0x9f73('0x106')]+=0x1,'scheduledat':moment()[_0x9f73('0x10e')](_0x9237f4[_0x9f73('0x136')],_0x9f73('0x10f'))[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63['CampaignId']||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1bf')));break;case 0xb:if(_0x24da63[_0x9f73('0x11a')]>=_0x9237f4[_0x9f73('0x13d')]-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countabandonedretry':_0x24da63['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x13c')],'minutes')[_0x9f73('0x89')](_0x9f73('0x110')),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x24da63['countmachineretry']>=_0x9237f4[_0x9f73('0x10b')]-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countmachineretry':_0x24da63[_0x9f73('0x100')]+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x11b')],'minutes')['format'](_0x9f73('0x110')),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63['VoiceQueueId']||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x113')));break;case 0x14:if(_0x24da63[_0x9f73('0x107')]>=_0x9237f4[_0x9f73('0x1c0')]-0x1){return!![];}this[_0x9f73('0xd3')]({'active':![],'countagentrejectretry':_0x24da63[_0x9f73('0x107')]+=0x1,'scheduledat':moment()['add'](_0x9237f4[_0x9f73('0x1c1')],'minutes')['format'](_0x9f73('0x110')),'ContactId':_0x24da63[_0x9f73('0xe8')],'ListId':_0x24da63[_0x9f73('0x111')],'VoiceQueueId':_0x24da63[_0x9f73('0x112')]||undefined,'CampaignId':_0x24da63[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1c2')));break;default:return!![];}};Dialer[_0x9f73('0x21')][_0x9f73('0x1c3')]=function(_0x51f43a,_0xd60c22,_0x1bc377){var _0x2370b6=this;var _0x16b240=new History(_0x51f43a);var _0x26e7ee=![];var _0x1a282f;var _0xd4f616;return new Promise(function(_0x186d41,_0x39225d){if(_[_0x9f73('0x95')](_0xd60c22)&&typeof _0xd60c22!=='object'){return _0x39225d(msgResponse(_0x9f73('0x1c4'),_0x9f73('0x15d'),_0x9f73('0x1c5')));}if(_[_0x9f73('0x95')](_0x1bc377)&&typeof _0x1bc377!==_0x9f73('0x1c6')){return _0x39225d(msgResponse(_0x9f73('0x1c4'),_0x9f73('0x15d'),_0x9f73('0x1c7')));}_0x2370b6['verifyAdditionalPhones'](_0x16b240,_0x1bc377[_0x9f73('0x121')],_0xd60c22)[_0x9f73('0x47')](function(_0x19b14d){if(_0x19b14d[_0x9f73('0x133')]==0x1)_0x26e7ee=!![];switch(_0x1bc377[_0x9f73('0x121')]){case'0':_0xd60c22['outboundNoSuchCallsDay']+=0x1;_0x16b240['state']=0x0;_0x16b240[_0x9f73('0xb9')]=_0x9f73('0x1c8');_0x16b240['countnosuchnumberretry']+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;ami[_0x9f73('0x59')]('custom:agentnosuchnumber',ut[_0x9f73('0xfa')](_0x51f43a,'nosuchnumber'));_0x1a282f=_0xd60c22['dialNoSuchNumberRetryFrequency'];_0xd4f616=_0xd60c22[_0x9f73('0x131')];_0x2370b6[_0x9f73('0xdf')](_0x16b240)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x102')));if(_0x2370b6[_0x9f73('0x1b6')](0x0,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240[_0x9f73('0x105')]>=_0xd60c22[_0x9f73('0x1c9')]){_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1ca'));}else{_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xd60c22[_0x9f73('0x72')]+=0x1;_0x16b240[_0x9f73('0xb8')]=0x3;_0x16b240[_0x9f73('0xb9')]=_0x9f73('0x1cb');_0x16b240[_0x9f73('0x119')]+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;var _0x50cb30=ut[_0x9f73('0x1cc')](_0x51f43a,_0xd60c22);ami[_0x9f73('0x59')](_0x9f73('0x1cd'),_0x50cb30);_0x1a282f=_0xd60c22[_0x9f73('0x1b7')];_0xd4f616=_0xd60c22[_0x9f73('0x131')];_0x2370b6[_0x9f73('0xdf')](_0x16b240)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1ce')));if(_0x2370b6[_0x9f73('0x1b6')](0x3,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240['countnoanswerretry']>=_0xd60c22[_0x9f73('0x1cf')]){_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1d0'));}else{_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1d0'));}}break;case'5':_0xd60c22['outboundBusyCallsDay']+=0x1;_0x16b240[_0x9f73('0xb8')]=0x5;_0x16b240[_0x9f73('0xb9')]=_0x9f73('0x1d1');_0x16b240[_0x9f73('0x103')]+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;ami[_0x9f73('0x59')](_0x9f73('0x1d2'),ut[_0x9f73('0xfa')](_0x51f43a,'busy'));_0x1a282f=_0xd60c22[_0x9f73('0x1b9')];_0xd4f616=_0xd60c22[_0x9f73('0x131')];_0x2370b6['createHistory'](_0x16b240)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1d3')));if(_0x2370b6['checkRetriveMax'](0x5,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240[_0x9f73('0x103')]>=_0xd60c22[_0x9f73('0x1b8')]){_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1d4'));}else{_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1d4'));}}break;case'8':_0xd60c22['outboundCongestionCallsDay']+=0x1;_0x16b240['state']=0x8;_0x16b240[_0x9f73('0xb9')]=_0x9f73('0x1d5');_0x16b240[_0x9f73('0x104')]+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;_0x1a282f=_0xd60c22[_0x9f73('0x1bb')];_0xd4f616=_0xd60c22[_0x9f73('0x131')];ami[_0x9f73('0x59')](_0x9f73('0x1d6'),ut[_0x9f73('0xfa')](_0x51f43a,_0x9f73('0x1d7')));_0x2370b6['createHistory'](_0x16b240)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x1d8')));if(_0x2370b6[_0x9f73('0x1b6')](0x8,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240[_0x9f73('0x104')]>=_0xd60c22[_0x9f73('0x1d9')]){_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,'reason\x208\x20congestion');}else{_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1da'));}}break;case'11':_0xd60c22[_0x9f73('0x1db')]+=0x1;_0x16b240[_0x9f73('0xb8')]=0xb;_0x16b240[_0x9f73('0xb9')]=_0x9f73('0x13a');_0x16b240[_0x9f73('0x11a')]+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;_0x1a282f=_0xd60c22[_0x9f73('0x13c')];_0xd4f616=_0xd60c22[_0x9f73('0x131')];_0x2370b6[_0x9f73('0xdf')](_0x16b240)[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x140')));if(_0x2370b6['checkRetriveMax'](0xb,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240['countabandonedretry']>=_0xd60c22[_0x9f73('0x13d')]){_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1dc'));}else{_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1dc'));}}break;case'20':_0xd60c22[_0x9f73('0x75')]+=0x1;_0x16b240[_0x9f73('0xb8')]=0x14;_0x16b240[_0x9f73('0xb9')]='AgentReject';_0x16b240[_0x9f73('0x107')]+=0x1;_0x16b240[_0x9f73('0x101')]+=0x1;_0x1a282f=_0xd60c22[_0x9f73('0x1c1')];_0xd4f616=_0xd60c22[_0x9f73('0x131')];ami['emit']('custom:agentreject',ut[_0x9f73('0xfa')](_0x51f43a,_0x9f73('0x1dd')));_0x2370b6[_0x9f73('0xdf')](_0x16b240)[_0x9f73('0xc2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2370b6['checkRetriveMax'](0x14,_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240['countagentrejectretry']>=_0xd60c22[_0x9f73('0x1c0')]){_0x2370b6['createStateFinal'](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1de'));}else{_0x2370b6['stateGlobal'](_0x16b240,_0x186d41,_0x39225d,_0x9f73('0x1de'));}}break;default:_0xd60c22['outboundUnknownCallsDay']+=0x1;_0x16b240[_0x9f73('0xb8')]=0xc;_0x16b240[_0x9f73('0xb9')]=_0x1bc377[_0x9f73('0x121')];_0x1a282f=_0xd60c22['dialAgentRejectRetryFrequency'];_0xd4f616=_0xd60c22[_0x9f73('0x131')];_0x2370b6[_0x9f73('0xdf')](_0x16b240)[_0x9f73('0xc2')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2370b6['checkRetriveMax'](_0x1bc377[_0x9f73('0x121')],_0x51f43a,_0xd60c22)&&!_0x26e7ee){if(_0x16b240['countbusyretry']+_0x16b240[_0x9f73('0x104')]+_0x16b240[_0x9f73('0x119')]+_0x16b240[_0x9f73('0x105')]+_0x16b240[_0x9f73('0x106')]+_0x16b240['countabandonedretry']+_0x16b240[_0x9f73('0x100')]+_0x16b240[_0x9f73('0x107')]>=_0xd60c22['dialGlobalMaxRetry']){_0x2370b6[_0x9f73('0x109')](_0x16b240,_0x186d41,_0x39225d,_0x1bc377[_0x9f73('0x121')]);}else{_0x2370b6[_0x9f73('0x10c')](_0x16b240,_0x186d41,_0x39225d,_0x1bc377[_0x9f73('0x121')]);}}}})[_0x9f73('0x47')](function(){if(_0x26e7ee){_0x2370b6[_0x9f73('0xce')](_0x16b240,_0x1a282f,_0xd4f616)[_0x9f73('0x47')](function(){return _0x186d41(0x1);});}});});};Dialer[_0x9f73('0x21')][_0x9f73('0x109')]=function(_0x3005c9,_0x28ef08,_0x21ed76,_0x3a2530){var _0x295faa=new Final(_0x3005c9);_0x295faa[_0x9f73('0xb8')]=0xf;_0x295faa[_0x9f73('0xb9')]='Global';this[_0x9f73('0x10c')](_0x295faa,_0x28ef08,_0x21ed76,_0x3a2530);};Dialer[_0x9f73('0x21')]['createStateFinal']=function(_0x18f134,_0x279909,_0x13e627,_0x3695ad){this[_0x9f73('0xdd')](_0x18f134)[_0x9f73('0x47')](function(){return _0x279909(msgResponse('[callProgressDetecting]',_0x9f73('0x1df'),_0x3695ad));})['catch'](function(){return _0x13e627(msgResponse('[moveContactManagedDialer][0]',_0x9f73('0x15d'),_0x9f73('0x1e0')));});};Dialer[_0x9f73('0x21')][_0x9f73('0xa')]=function(_0xe3e6b2){var _0x3eef0e=_0xe3e6b2[_0x9f73('0x1e1')]/0x64;var _0x1e5520=_0xe3e6b2['outboundDropCallsDayTimeout']/(_0xe3e6b2[_0x9f73('0x71')]+_0xe3e6b2[_0x9f73('0x6c')]);var _0x4b339b=Math['round'](_0xe3e6b2[_0x9f73('0x7e')]*(_0xe3e6b2['predictiveIntervalMaxThreshold']/0x64));var _0x42690d=Math['round'](_0xe3e6b2[_0x9f73('0x7e')]*(_0xe3e6b2[_0x9f73('0x1e2')]/0x64));var _0x2347ba=_0xe3e6b2['available']+_0xe3e6b2[_0x9f73('0x61')];var _0x483ab7=Math[_0x9f73('0x1e3')](_0xe3e6b2['erlangCalls']*_0xe3e6b2[_0x9f73('0x81')]*_0xe3e6b2[_0x9f73('0x7c')]*_0xe3e6b2[_0x9f73('0x7d')]);if(_['isUndefined'](_0xe3e6b2[_0x9f73('0x83')])){if(!_[_0x9f73('0x95')](_0xe3e6b2[_0x9f73('0x30')])){_0xe3e6b2[_0x9f73('0x30')]=undefined;loggerPredictive[_0x9f73('0xa9')]('[startMethodPredictive][StartProgressive]',_0x9f73('0x1e4'));}if(!_[_0x9f73('0x95')](_0xe3e6b2['handlePredictive'])){loggerPredictive[_0x9f73('0xa9')](_0x9f73('0x1e5'),_0x9f73('0x1e6'));clearInterval(_0xe3e6b2[_0x9f73('0xa2')]);_0xe3e6b2[_0x9f73('0xa2')]=undefined;}_0xe3e6b2[_0x9f73('0x83')]=moment()['format'](_0x9f73('0x110'));loggerPredictive[_0x9f73('0x8f')](_0xe3e6b2['name'],'collection\x20data\x20in\x20progressive\x20at',_0xe3e6b2[_0x9f73('0x83')]);this[_0x9f73('0x171')](_0xe3e6b2,0x1);}else if(ifInterval(_0xe3e6b2[_0x9f73('0x1e7')],_0xe3e6b2[_0x9f73('0x83')])){this[_0x9f73('0x171')](_0xe3e6b2,0x1);loggerPredictiveCalls[_0x9f73('0x8f')](_0x9f73('0x1e8'),_0xe3e6b2[_0x9f73('0x83')],_0xe3e6b2['name']);_0xe3e6b2[_0x9f73('0x80')]=0x0;_0xe3e6b2[_0x9f73('0x12c')]=0x0;}else if(_0x3eef0e<_0x1e5520&&_0xe3e6b2[_0x9f73('0x1e9')]===_0x9f73('0x1ea')){freeVariablesPredictive(_0xe3e6b2);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x9f73('0x1eb'),_0x1e5520,'startProgressive',_0xe3e6b2[_0x9f73('0x4b')]);}else if(_0x483ab7<_0xe3e6b2[_0x9f73('0x12c')]&&_0xe3e6b2[_0x9f73('0x1e9')]===_0x9f73('0x1ea')){freeVariablesPredictive(_0xe3e6b2);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x1ec'),_0x9f73('0x1ed'),_0x483ab7,_0x9f73('0x1ee'),_0xe3e6b2['predictiveIntervalErlangCallsDroppedCalls'],_0x9f73('0x83'),_0xe3e6b2[_0x9f73('0x4b')]);}else if(!ifInterval(_0xe3e6b2['dialPredictiveInterval'],_0xe3e6b2[_0x9f73('0x83')])&&_[_0x9f73('0x95')](_0xe3e6b2[_0x9f73('0x30')])&&!_[_0x9f73('0x95')](_0xe3e6b2['startProgressive'])){_0xe3e6b2[_0x9f73('0x30')]=moment()[_0x9f73('0x89')](_0x9f73('0x110'));loggerPredictive[_0x9f73('0x8f')](_0xe3e6b2['name'],_0x9f73('0x1ef'),_0xe3e6b2[_0x9f73('0x30')]);this[_0x9f73('0x1f0')](_0xe3e6b2[_0x9f73('0x1e7')])['then'](this[_0x9f73('0x1f1')](_0xe3e6b2))[_0x9f73('0x47')](mergeDataErlangB(_0xe3e6b2))['then'](this[_0x9f73('0x1f2')](_0xe3e6b2))['catch'](loggerCatchPredictive(_0x9f73('0x1f3'),_0xe3e6b2));}else if(!ifInterval(_0xe3e6b2[_0x9f73('0x1e7')],_0xe3e6b2[_0x9f73('0x30')])){_0xe3e6b2[_0x9f73('0x12c')]=0x0;_0xe3e6b2[_0x9f73('0x30')]=moment()[_0x9f73('0x89')](_0x9f73('0x110'));loggerPredictive[_0x9f73('0x8f')](_0xe3e6b2[_0x9f73('0x4b')],_0x9f73('0x1f4'),_0xe3e6b2[_0x9f73('0x30')]);clearInterval(_0xe3e6b2[_0x9f73('0xa2')]);_0xe3e6b2[_0x9f73('0xa2')]=undefined;this[_0x9f73('0x1f0')](_0xe3e6b2['dialPredictiveInterval'])[_0x9f73('0x47')](this[_0x9f73('0x1f1')](_0xe3e6b2))[_0x9f73('0x47')](mergeDataErlangB(_0xe3e6b2))[_0x9f73('0x47')](this[_0x9f73('0x1f2')](_0xe3e6b2))[_0x9f73('0xc2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xe3e6b2));}else if(_0xe3e6b2[_0x9f73('0x7e')]&&_0x2347ba<_0xe3e6b2['predictiveIntervalAvailable']-_0x42690d){freeVariablesPredictive(_0xe3e6b2);loggerPredictive[_0x9f73('0x8f')](_0xe3e6b2[_0x9f73('0x4b')],_0x9f73('0x1f5'),_0x2347ba,')\x20are\x20less\x20than\x20threshold\x20(',_0xe3e6b2[_0x9f73('0x7e')],'-',_0x42690d,'=',_0xe3e6b2['predictiveIntervalAvailable']-_0x42690d,')');}else if(_0xe3e6b2[_0x9f73('0x7e')]&&_0x2347ba>_0xe3e6b2['predictiveIntervalAvailable']+_0x4b339b){freeVariablesPredictive(_0xe3e6b2);loggerPredictive[_0x9f73('0x8f')](_0xe3e6b2[_0x9f73('0x4b')],_0x9f73('0x1f5'),_0x2347ba,_0x9f73('0x1f6'),_0xe3e6b2[_0x9f73('0x7e')],'+',_0x4b339b,'=',_0xe3e6b2['predictiveIntervalAvailable']+_0x4b339b,')');}};Dialer[_0x9f73('0x21')]['getDataPredictive']=function(_0x212d5c){var _0x2e2ab4=this;return function(_0x176614){return new Promise(function(_0x109489,_0x46abcf){_[_0x9f73('0x9f')](_0x212d5c,_0x176614[0x0]);if(checkGetDataPredictive(_0x176614[0x0])){var _0x12ba0e=_0x212d5c['predictiveIntervalAvailable']=_0x212d5c['talking']+_0x212d5c['available'];var _0x2c8405=_0x212d5c[_0x9f73('0x1e7')]*0x3c;var _0x5ceb0b=_0x176614[0x0]['predictiveIntervalAvgTalktime']+_0x176614[0x0]['predictiveIntervalAvgHoldtime'];var _0x4b075d=(_0x176614[0x0][_0x9f73('0x1f7')]+_0x176614[0x0][_0x9f73('0x7a')]+_0x176614[0x0][_0x9f73('0x79')])/_0x176614[0x0]['predictiveIntervalTotalCalls'];_0x212d5c['predictiveIntervalHitRate']=_0x4b075d>0x0?_0x4b075d:0x1;switch(_0x212d5c[_0x9f73('0x1e9')]){case _0x9f73('0x1ea'):var _0x1b9b87=_0x212d5c[_0x9f73('0x1e1')]/0x64;return _0x2e2ab4[_0x9f73('0x1f8')](_0x12ba0e,_0x2c8405,_0x5ceb0b,_0x4b075d,_0x1b9b87)[_0x9f73('0x47')](function(_0x157064){return _0x109489(_0x157064);});case _0x9f73('0x1f9'):var _0x1e2e84=_0x212d5c[_0x9f73('0x1e1')]/0x64;return _0x2e2ab4[_0x9f73('0x1fa')](_0x12ba0e,_0x2c8405,_0x5ceb0b,_0x4b075d,_0x1e2e84)[_0x9f73('0x47')](function(_0x392e72){return _0x109489(_0x392e72);});default:return _0x46abcf(msgResponse(_0x9f73('0x1fb'),_0x9f73('0x15d'),_0x9f73('0x1fc')));}}else{return _0x46abcf(msgResponse(_0x9f73('0x1fb'),'Failure',_0x9f73('0x1fd')));}});};};Dialer[_0x9f73('0x21')]['getDataPredictiveOld']=function(_0x59bd24){var _0x4c1684=this;return function(_0x5836e6){return new Promise(function(_0x3d7c63,_0x3a65ba){_[_0x9f73('0x9f')](_0x59bd24,_0x5836e6[0x0]);if(checkGetDataPredictive(_0x5836e6[0x0])){loggerPredictive['info'](JSON[_0x9f73('0x55')](_0x5836e6[0x0]));if(_0x59bd24[_0x9f73('0x1e9')]===_0x9f73('0x1ea')){return _0x4c1684['getVoiceQueueRtPauses'](_0x59bd24['id'])['then'](function(_0x24fea){var _0x5f9c5a=_0x59bd24[_0x9f73('0x17b')]-_0x24fea[0x0][_0x9f73('0x1fe')];var _0x5d7792=_0x59bd24['dialPredictiveInterval']*0x3c;var _0x54080a=_0x5836e6[0x0]['predictiveIntervalAvgTalktime']+_0x5836e6[0x0][_0x9f73('0x77')];var _0x21b998=(_0x5836e6[0x0]['predictiveIntervalAnsweredCalls']+_0x5836e6[0x0][_0x9f73('0x7a')]+_0x5836e6[0x0][_0x9f73('0x79')])/_0x5836e6[0x0][_0x9f73('0x7f')];var _0x1020e4=_0x59bd24[_0x9f73('0x1e1')]/0x64;_0x59bd24[_0x9f73('0x1ff')]=_0x24fea[0x0]['outboundQueuePauses']||0x0;_0x59bd24[_0x9f73('0x7c')]=_0x21b998>0x0?_0x21b998:0x1;return _0x4c1684[_0x9f73('0x1f8')](_0x5f9c5a,_0x5d7792,_0x54080a,_0x21b998,_0x1020e4);})[_0x9f73('0x47')](function(_0x2fff01){return _0x3d7c63(_0x2fff01);})[_0x9f73('0xc2')](function(_0x3bd84e){return _0x3a65ba(msgResponse('[CatchErlangB]','Failure',JSON[_0x9f73('0x55')](_0x3bd84e)));});}if(_0x59bd24['dialPredictiveOptimization']===_0x9f73('0x1f9')){return _0x4c1684['getVoiceQueueRtPauses'](_0x59bd24['id'])[_0x9f73('0x47')](function(_0x5550d8){var _0x3d1e54=_0x59bd24['loggedIn']-_0x5550d8[0x0][_0x9f73('0x1fe')];var _0x249634=_0x59bd24[_0x9f73('0x1e7')]*0x3c;var _0x4aecea=_0x5836e6[0x0][_0x9f73('0x78')]+_0x5836e6[0x0][_0x9f73('0x77')];var _0x317da3=(_0x5836e6[0x0][_0x9f73('0x1f7')]+_0x5836e6[0x0][_0x9f73('0x7a')]+_0x5836e6[0x0][_0x9f73('0x79')])/_0x5836e6[0x0][_0x9f73('0x7f')];var _0x3eae5c=_0x59bd24['dialPredictiveOptimizationPercentage']/0x64;_0x59bd24[_0x9f73('0x1ff')]=_0x5550d8[0x0][_0x9f73('0x1fe')]||0x0;_0x59bd24[_0x9f73('0x7c')]=_0x317da3>0x0?_0x317da3:0x1;return _0x4c1684[_0x9f73('0x1fa')](_0x3d1e54,_0x249634,_0x4aecea,_0x317da3,_0x3eae5c);})[_0x9f73('0x47')](function(_0x1c7487){return _0x3d7c63(_0x1c7487);})[_0x9f73('0xc2')](function(_0x7e9016){return _0x3a65ba(msgResponse(_0x9f73('0x200'),_0x9f73('0x15d'),JSON[_0x9f73('0x55')](_0x7e9016)));});}}else{return _0x3a65ba(msgResponse(_0x9f73('0x1fb'),_0x9f73('0x15d'),_0x9f73('0x1fd')));}});};};Dialer[_0x9f73('0x21')][_0x9f73('0x1f2')]=function(_0x1671ad){var _0x3735ab=this;return function(){var _0x5416e7=0x0;var _0x371c8f=Math['floor'](_0x1671ad['erlangCallToSecond']*0x3e8);if(_0x371c8f>0x0){_0x371c8f=_0x371c8f<0x64?0x64:_0x371c8f;loggerPredictive[_0x9f73('0x8f')](_0x1671ad[_0x9f73('0x4b')],_0x9f73('0x201'),_0x371c8f,_0x9f73('0x56'));_0x1671ad['handlePredictive']=setInterval(function(){_0x3735ab[_0x9f73('0xa2')](_0x1671ad);loggerPredictiveCalls['info'](_0x9f73('0x202'),_0x5416e7+=0x1);},_0x371c8f);}else{loggerPredictive[_0x9f73('0x8f')](_0x1671ad[_0x9f73('0x4b')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x9f73('0x203')]=function(_0x370984,_0xb171a0){var _0x1b2246=this;return function(_0x792b76){if(_[_0x9f73('0x8b')](_0x792b76)){if(_[_0x9f73('0xbf')](_0xb171a0[_0x9f73('0x204')])||!_0xb171a0[_0x9f73('0x205')]){if(_0x370984[_0x9f73('0x16f')]===_0x9f73('0x9')){_0x370984[_0x9f73('0x146')]=_[_0x9f73('0x95')](_0x370984['queueStatusComplete'])?!![]:_0x370984[_0x9f73('0x146')];var _0x25e85e=uuid['v4']();_0x1b2246[_0x9f73('0x2d')][_0x25e85e]=new Action(_0x370984,_0xb171a0,_0x25e85e);loggerBooked['info'](_0x9f73('0x206'),_0x25e85e,'queueStatusComplete:\x20',JSON[_0x9f73('0x55')](_0x370984[_0x9f73('0x146')]),_0x9f73('0x207'),_0x370984[_0x9f73('0x4b')]);if(_0x370984['queueStatusComplete']){_0x370984[_0x9f73('0x146')]=![];_0x1b2246[_0x9f73('0x31')][_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0xc4')]]=[];ami[_0x9f73('0xc0')]({'actionid':_0x25e85e,'action':_0x9f73('0x208'),'queue':_0x370984[_0x9f73('0x4b')]})[_0x9f73('0xc2')](function(){_0x1b2246['updateOriginated'](_0x370984);_0x1b2246[_0x9f73('0xd3')]({'active':![],'ContactId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0xe8')],'ListId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e]['ListId'],'VoiceQueueId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0x112')]||undefined,'CampaignId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e]['CampaignId']||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x209')));delete _0x1b2246[_0x9f73('0x2d')][_0x25e85e];});}else{loggerBooked[_0x9f73('0x8f')]('[booked][checkContactBlack][else]',JSON[_0x9f73('0x55')](_0x370984[_0x9f73('0x146')]),_0x9f73('0x207'),_0x370984[_0x9f73('0x4b')]);_0x1b2246[_0x9f73('0xc3')](_0x370984);_0x1b2246[_0x9f73('0xd3')]({'active':![],'ContactId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0xe8')],'ListId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0x111')],'VoiceQueueId':_0x1b2246['actions'][_0x25e85e]['VoiceQueueId']||undefined,'CampaignId':_0x1b2246[_0x9f73('0x2d')][_0x25e85e][_0x9f73('0xe9')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1b2246[_0x9f73('0x2d')][_0x25e85e];}}else{return _0x1b2246[_0x9f73('0x18c')](_0x370984,_0xb171a0);}}else{if(getDiff(_0xb171a0[_0x9f73('0x20a')])<_0x370984[_0x9f73('0x20b')]*0x3c){if(_0xb171a0[_0x9f73('0x176')]&&!_0xb171a0['Agent'][_0x9f73('0x20c')]){_0x1b2246[_0x9f73('0x26')][_0x9f73('0x148')](_0xb171a0['id'])[_0x9f73('0x24')](function(){_0x1b2246['updateOriginated'](_0x370984);});}else{_0x1b2246[_0x9f73('0xd5')]({'active':![]},_0xb171a0['id'],0x1)[_0x9f73('0x24')](function(){_0x1b2246[_0x9f73('0xc3')](_0x370984);});}}else{_0x370984[_0x9f73('0x20d')]+=0x1;_0x1b2246[_0x9f73('0xc3')](_0x370984);if(_0x370984[_0x9f73('0x20e')]){_0x1b2246[_0x9f73('0xd3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb171a0[_0x9f73('0xe8')],'ListId':_0xb171a0[_0x9f73('0x111')],'VoiceQueueId':_0xb171a0['VoiceQueueId']||undefined,'CampaignId':_0xb171a0[_0x9f73('0xe9')]||undefined})[_0x9f73('0xc2')](loggerCatch(_0x9f73('0x20f')));_0x1b2246['createHistory'](createObjHistory(_0x370984,_0xb171a0,_0x9f73('0x210'),0x17,'RecallInQueue'))[_0x9f73('0xc2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1b2246[_0x9f73('0xe6')](createObjHistory(_0x370984,_0xb171a0,_0x9f73('0x211'),0x16,'RecallFailedTimeout'),_0x9f73('0x212'),_0x9f73('0x213'));}}}}else{_0x370984[_0x9f73('0x6d')]+=0x1;_0x1b2246[_0x9f73('0xe6')](createObjHistory(_0x370984,_0xb171a0,_0x9f73('0x214'),0xd,_0x9f73('0x215')),_0x9f73('0x216'),_0x9f73('0x217'));throw _0x9f73('0x218');}};};Dialer[_0x9f73('0x21')]['handleIvr']=function(_0x565640){var _0x4abe4a=this;var _0x3600a5=_0x565640['limitCalls']-_0x565640[_0x9f73('0xac')]-_0x565640['temp'];emitCampaignSummary(_0x565640);if(_0x3600a5>0x0){if(_0x3600a5>this['maxNumberOriginate']){_0x3600a5=this[_0x9f73('0x2b')];}_0x565640[_0x9f73('0xd8')]+=_0x3600a5;this[_0x9f73('0xda')](_0x565640['id'],_0x3600a5,_0x565640[_0x9f73('0x219')],_0x565640)[_0x9f73('0x47')](function(_0x3753d7){_0x565640[_0x9f73('0xd8')]-=_0x3600a5;_0x565640[_0x9f73('0xd8')]=_0x565640[_0x9f73('0xd8')]>0x0?_0x565640[_0x9f73('0xd8')]:0x0;if(!checkContactEmpty(_0x3753d7)){_0x565640[_0x9f73('0x49')]=_0x9f73('0x21a');logger[_0x9f73('0x8f')](_0x9f73('0x21b')+_0x565640[_0x9f73('0x4b')]);}else{_0x565640['originated']+=_0x3753d7[_0x9f73('0xab')];_0x565640[_0x9f73('0x49')]=_0x9f73('0x21c');for(var _0x4e039b=0x0;_0x4e039b<_0x3753d7[_0x9f73('0xab')];_0x4e039b+=0x1){_0x565640['ivrTotalCallsDays']+=0x1;if(_[_0x9f73('0xbf')](_0x3753d7[_0x4e039b])||_[_0x9f73('0xbf')](_0x3753d7[_0x4e039b]['Contact'])||_[_0x9f73('0xbf')](_0x3753d7[_0x4e039b][_0x9f73('0x18e')])){_0x4abe4a['emptyContact'](_0x9f73('0x21d'),_0x565640,_0x3753d7[_0x4e039b]);}else{_0x4abe4a[_0x9f73('0xd0')](_['pick'](_0x3753d7[_0x4e039b],[_0x9f73('0xe9'),'phone']))[_0x9f73('0x47')](_0x4abe4a[_0x9f73('0x203')](_0x565640,_0x3753d7[_0x4e039b]))['catch'](_0x4abe4a[_0x9f73('0xe3')]('[actionOriginateIvr]\x20',_0x565640));}}}})[_0x9f73('0xc2')](loggerGetContactDialer(_0x9f73('0x21e'),_0x565640,_0x3600a5));}};Dialer[_0x9f73('0x21')]['handlePower']=function(_0xde15cf,_0x162d51){var _0x4741ed=this;var _0x1fa8e2=[];var _0x259565=_0x162d51>=0x1?_0x162d51:0x1;if(_0xde15cf[_0x9f73('0x16f')]===_0x9f73('0x9')){_0x259565=0x1;}var _0x5440a7=Math['floor'](_0xde15cf[_0x9f73('0x5d')]*_0x259565)-_0xde15cf[_0x9f73('0xac')]-_0xde15cf[_0x9f73('0xd8')];emitVoiceQueueSummary(_0xde15cf);if(_0xde15cf[_0x9f73('0x21f')]>0x0){var _0x42b539=_0xde15cf['dialLimitQueue']-_0xde15cf[_0x9f73('0xac')]-_0xde15cf[_0x9f73('0x61')]-_0xde15cf[_0x9f73('0xd8')]-_0xde15cf[_0x9f73('0x5e')];if(_0x5440a7>_0x42b539){_0x5440a7=_0x42b539;}}if(_0x5440a7>0x0){if(_0xde15cf[_0x9f73('0x16f')]==='booked'){_0x5440a7=0x1;}if(_0x5440a7>this[_0x9f73('0x2b')]){_0x5440a7=this[_0x9f73('0x2b')];}_0xde15cf['temp']+=_0x5440a7;for(var _0x4f4b95 in this[_0x9f73('0x29')]){if(typeof this[_0x9f73('0x29')][_0x4f4b95]!==_0x9f73('0xbe')){if(this[_0x9f73('0x29')][_0x4f4b95][_0x9f73('0xb8')]==='not_inuse'&&this[_0x9f73('0x29')][_0x4f4b95]['status']===_0x9f73('0xf1')){_0x1fa8e2[_0x9f73('0x162')](this[_0x9f73('0x29')][_0x4f4b95]['id']);}}}this['getContactDialer'](_0xde15cf['id'],_0x1fa8e2,_0x5440a7,_0xde15cf[_0x9f73('0x219')],_0xde15cf)['then'](function(_0x2ba435){_0xde15cf[_0x9f73('0xd8')]-=_0x5440a7;_0xde15cf[_0x9f73('0xd8')]=_0xde15cf['temp']>0x0?_0xde15cf[_0x9f73('0xd8')]:0x0;if(!checkContactEmpty(_0x2ba435)){_0x4741ed['countReScheduled'](_0xde15cf)[_0x9f73('0x47')](sendMessageReschedule(_0xde15cf))[_0x9f73('0xc2')](loggerCatch(_0x9f73('0xc9')));}else{_0xde15cf[_0x9f73('0xac')]+=_0x2ba435['length'];_0xde15cf[_0x9f73('0x49')]=_0xde15cf['dialMethod']===_0x9f73('0x9')?_0x9f73('0x193'):_0x9f73('0x21c');for(var _0xfa2f0=0x0;_0xfa2f0<_0x2ba435[_0x9f73('0xab')];_0xfa2f0+=0x1){if(_[_0x9f73('0xbf')](_0x2ba435[_0xfa2f0])||_[_0x9f73('0xbf')](_0x2ba435[_0xfa2f0][_0x9f73('0x1a3')])||_[_0x9f73('0xbf')](_0x2ba435[_0xfa2f0][_0x9f73('0x18e')])){_0x4741ed[_0x9f73('0xe4')]('[actionOriginate]\x20',_0xde15cf,_0x2ba435[_0xfa2f0]);}else{_0x4741ed['checkIsBlackList'](_[_0x9f73('0xe7')](_0x2ba435[_0xfa2f0],[_0x9f73('0x112'),_0x9f73('0x18e')]))[_0x9f73('0x47')](_0x4741ed[_0x9f73('0x203')](_0xde15cf,_0x2ba435[_0xfa2f0]))[_0x9f73('0xc2')](_0x4741ed[_0x9f73('0xe3')](_0x9f73('0x21d'),_0xde15cf));}}}})['catch'](loggerGetContactDialer(_0x9f73('0x220'),_0xde15cf,_0x5440a7));}};Dialer[_0x9f73('0x21')][_0x9f73('0xa2')]=function(_0x5bdbd6){if(_0x5bdbd6[_0x9f73('0x21f')]>0x0){var _0x3221fa=_0x5bdbd6[_0x9f73('0x21f')]-_0x5bdbd6['originated']-_0x5bdbd6[_0x9f73('0x61')];if(_0x3221fa>0x0){this[_0x9f73('0x221')](_0x5bdbd6);}else{loggerPredictiveCalls[_0x9f73('0x8f')](_0x9f73('0x222'));}}else{this['tryOriginatePredictive'](_0x5bdbd6);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x302303){var _0x3c4bdd=this;var _0x136dba=[];_0x302303[_0x9f73('0xac')]+=0x1;for(var _0x5db3c6 in this[_0x9f73('0x29')]){if(typeof this[_0x9f73('0x29')][_0x5db3c6]!=='undefined'){if(this['agents'][_0x5db3c6][_0x9f73('0xb8')]==='not_inuse'&&this['agents'][_0x5db3c6][_0x9f73('0xf0')]===_0x9f73('0xf1')){_0x136dba[_0x9f73('0x162')](this[_0x9f73('0x29')][_0x5db3c6]['id']);}}}this[_0x9f73('0xd7')](_0x302303['id'],_0x136dba,0x1,_0x302303[_0x9f73('0x219')],_0x302303)[_0x9f73('0x47')](function(_0x352815){if(!checkContactEmpty(_0x352815)){checkContactLowerLimitOriginate(_0x302303,0x1,0x0);_0x3c4bdd[_0x9f73('0xc7')](_0x302303)['then'](sendMessageReschedule(_0x302303))[_0x9f73('0xc2')](loggerCatch('[countReScheduled]\x20'));}else{_0x302303['message']=_0x9f73('0x21c');if(_['isNil'](_0x352815[0x0])||_['isNil'](_0x352815[0x0][_0x9f73('0x1a3')])||_[_0x9f73('0xbf')](_0x352815[0x0]['phone'])){_0x3c4bdd[_0x9f73('0xe4')](_0x9f73('0x21d'),_0x302303,_0x352815[0x0]);}else{_0x3c4bdd[_0x9f73('0xca')](_[_0x9f73('0xe7')](_0x352815[0x0],[_0x9f73('0x112'),_0x9f73('0x18e')]))[_0x9f73('0x47')](_0x3c4bdd['checkContactBlack'](_0x302303,_0x352815[0x0]))[_0x9f73('0xc2')](_0x3c4bdd[_0x9f73('0xe3')](_0x9f73('0x223'),_0x302303));}}})[_0x9f73('0xc2')](loggerGetContactDialer(_0x9f73('0x224'),_0x302303,0x1));emitVoiceQueueSummary(_0x302303);};Dialer['prototype'][_0x9f73('0x1f8')]=function(_0x1ada1c,_0x2377c3,_0xbf9e4d,_0x1f1153,_0x4b76a7,_0x481c31){loggerPredictive[_0x9f73('0x8f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x225'),_0x1ada1c);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x226'),_0x2377c3);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x227'),_0xbf9e4d);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x228'),_0x1f1153);loggerPredictive[_0x9f73('0x8f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b76a7);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x94'));return new Promise(function(_0x5da0f4,_0x447c6b){if(_0x1ada1c<=0x0||isNaN(_0x1ada1c)){return _0x447c6b(msgResponse(_0x9f73('0x229'),_0x9f73('0x54'),_0x9f73('0x22a')+_0x1ada1c));}if(_0xbf9e4d<=0x0||isNaN(_0xbf9e4d)){return _0x447c6b(msgResponse(_0x9f73('0x229'),_0x9f73('0x54'),_0x9f73('0x22b')+_0xbf9e4d));}if(_0x1f1153<=0x0||isNaN(_0x1f1153)){return _0x447c6b(msgResponse(_0x9f73('0x229'),'Error',_0x9f73('0x22c')+_0x1f1153));}if(_0x2377c3<=0x0||isNaN(_0x2377c3)){return _0x447c6b(msgResponse(_0x9f73('0x229'),_0x9f73('0x54'),'interval\x20=\x20'+_0x2377c3));}if(_0x4b76a7<=0x0||isNaN(_0x4b76a7)){return _0x447c6b(msgResponse(_0x9f73('0x229'),_0x9f73('0x54'),_0x9f73('0x22d')+_0x4b76a7));}_0x481c31=_0x481c31||0x0;var _0x3f6734=0x1/_0xbf9e4d;var _0x1ded13=0x0;var _0x3cb655=0x0;var _0x28615a=0x0;var _0x12497b=0x0;for(var _0x20752f=0x0;_0x28615a<_0x4b76a7;_0x20752f+=0x1){_0x3cb655=_0x20752f/_0x2377c3;_0x1ded13=(_0x1f1153*_0x3cb655+_0x481c31)/_0x3f6734;_0x28615a=erlangb(_0x1ded13,_0x1ada1c);_0x12497b=_0x1ded13/_0x1ada1c*(0x1-erlangb(_0x1ded13,_0x1ada1c));}return _0x5da0f4({'erlangCalls':_0x20752f,'erlangCallToSecond':_0x2377c3/_0x20752f,'erlangAbandonmentRate':_0x28615a,'erlangBusyFactor':_0x12497b});});};Dialer[_0x9f73('0x21')][_0x9f73('0x1fa')]=function(_0x4b59c3,_0x4d07d9,_0x385c98,_0x163eb0,_0x515c1a,_0x3e5e87){loggerPredictive[_0x9f73('0x8f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x225'),_0x4b59c3);loggerPredictive['info'](_0x9f73('0x226'),_0x4d07d9);loggerPredictive['info'](_0x9f73('0x227'),_0x385c98);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x163eb0);loggerPredictive[_0x9f73('0x8f')](_0x9f73('0x22e'),_0x515c1a);loggerPredictive['info'](_0x9f73('0x94'));return new Promise(function(_0x1f873a,_0x61372c){if(_0x4b59c3<=0x0||isNaN(_0x4b59c3)){return _0x61372c(msgResponse('[busyFactor]','Error',_0x9f73('0x22a')+_0x4b59c3));}if(_0x385c98<=0x0||isNaN(_0x385c98)){return _0x61372c(msgResponse(_0x9f73('0x22f'),_0x9f73('0x54'),'Ts\x20=\x20'+_0x385c98));}if(_0x163eb0<=0x0||isNaN(_0x163eb0)){return _0x61372c(msgResponse(_0x9f73('0x22f'),_0x9f73('0x54'),_0x9f73('0x22c')+_0x163eb0));}if(_0x4d07d9<=0x0||isNaN(_0x4d07d9)){return _0x61372c(msgResponse('[busyFactor]','Error',_0x9f73('0x230')+_0x4d07d9));}if(_0x515c1a<=0x0||isNaN(_0x515c1a)){return _0x61372c(msgResponse(_0x9f73('0x22f'),_0x9f73('0x54'),_0x9f73('0x231')+_0x515c1a));}_0x3e5e87=_0x3e5e87||0x0;var _0x3d9a20=0x1/_0x385c98;var _0x424e31=0x0;var _0x45d0c0=0x0;var _0x586d77=0x0;var _0x2b5265=0x0;for(var _0x221e8f=0x0;_0x2b5265<_0x515c1a;_0x221e8f+=0x1){_0x45d0c0=_0x221e8f/_0x4d07d9;_0x424e31=(_0x163eb0*_0x45d0c0+_0x3e5e87)/_0x3d9a20;_0x586d77=erlangb(_0x424e31,_0x4b59c3);_0x2b5265=_0x424e31/_0x4b59c3*(0x1-erlangb(_0x424e31,_0x4b59c3));}return _0x1f873a({'erlangCalls':_0x221e8f,'erlangCallToSecond':_0x4d07d9/_0x221e8f,'erlangAbandonmentRate':_0x586d77,'erlangBusyFactor':_0x2b5265});});};module[_0x9f73('0x232')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 1d943f7..494419e 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 _0xcd3a=['ringtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xcd3a,0x8e));var _0xacd3=function(_0x10ae24,_0xf16609){_0x10ae24=_0x10ae24-0x0;var _0x1b0f78=_0xcd3a[_0x10ae24];return _0x1b0f78;};'use strict';var util=require('util');var _=require(_0xacd3('0x0'));var moment=require(_0xacd3('0x1'));function getSeconds(_0x277b50,_0x772b79){var _0x422157=moment(_0x277b50)[_0xacd3('0x2')](0x0);var _0x3f1da3=moment(_0x772b79)[_0xacd3('0x2')](0x0);return _0x422157[_0xacd3('0x3')](_0x3f1da3,'seconds');}function QueueCallerAbandon(_0x38a440,_0x3ea033){this[_0xacd3('0x4')]=_0x38a440[_0xacd3('0x4')];this[_0xacd3('0x5')]=_0x38a440['type'];this[_0xacd3('0x6')]=_0x38a440[_0xacd3('0x5')]===_0xacd3('0x7')?_0xacd3('0x8'):_0x38a440['type'];this[_0xacd3('0x9')]=_0x38a440['countbusyretry'];this[_0xacd3('0xa')]=_0x38a440[_0xacd3('0xa')];this[_0xacd3('0xb')]=_0x38a440[_0xacd3('0xb')];this[_0xacd3('0xc')]=_0x38a440[_0xacd3('0x9')]+_0x38a440[_0xacd3('0xa')]+_0x38a440[_0xacd3('0xb')]+_0x38a440[_0xacd3('0xd')]+_0x38a440[_0xacd3('0xe')]+_0x38a440[_0xacd3('0xf')]+_0x38a440['countmachineretry']+_0x38a440[_0xacd3('0x10')];this[_0xacd3('0xd')]=_0x38a440[_0xacd3('0xd')];this[_0xacd3('0xe')]=_0x38a440[_0xacd3('0xe')];this[_0xacd3('0xf')]=_0x38a440[_0xacd3('0xf')];this[_0xacd3('0x11')]=_0x38a440[_0xacd3('0x11')];this['countagentrejectretry']=_0x38a440[_0xacd3('0x10')];this[_0xacd3('0x12')]=_0x3ea033[_0xacd3('0x12')];this['calleridname']=_0x38a440[_0xacd3('0x13')];this[_0xacd3('0x14')]=_0x38a440[_0xacd3('0x15')];this[_0xacd3('0x16')]=_0x38a440[_0xacd3('0x16')];this[_0xacd3('0x17')]=_0x38a440[_0xacd3('0x17')];this['droptime']=_0x38a440[_0xacd3('0x18')];this[_0xacd3('0x19')]=this[_0xacd3('0x18')];this[_0xacd3('0x1a')]=getSeconds(_0x38a440[_0xacd3('0x17')],_0x38a440[_0xacd3('0x16')]);this['holdtime']=getSeconds(this[_0xacd3('0x18')],_0x38a440['responsetime']);this[_0xacd3('0x1b')]=0x0;this[_0xacd3('0x8')]=_0x3ea033[_0xacd3('0x8')];this['membername']=_0x3ea033[_0xacd3('0x1c')];this[_0xacd3('0x1d')]=_0x3ea033[_0xacd3('0x1d')];this[_0xacd3('0x1e')]=_0x38a440[_0xacd3('0x1e')];this[_0xacd3('0x1f')]=_0x38a440[_0xacd3('0x1f')];this[_0xacd3('0x20')]=_0x38a440[_0xacd3('0x20')];this[_0xacd3('0x21')]=_0x38a440[_0xacd3('0x21')];this[_0xacd3('0x22')]=_0x38a440['ContactId'];this[_0xacd3('0x23')]=_0x38a440[_0xacd3('0x23')];this[_0xacd3('0x24')]=_0x38a440[_0xacd3('0x24')];this[_0xacd3('0x25')]=_0x38a440[_0xacd3('0x25')];this[_0xacd3('0x26')]=_0x38a440[_0xacd3('0x26')];this[_0xacd3('0x27')]=_0x38a440[_0xacd3('0x27')]||'';this[_0xacd3('0x28')]=_0x38a440[_0xacd3('0x28')]||'';}module[_0xacd3('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x3daa=['starttime','responsetime','holdtime','droptime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number'];(function(_0x191b58,_0xf9725d){var _0x4ab411=function(_0x15e9f8){while(--_0x15e9f8){_0x191b58['push'](_0x191b58['shift']());}};_0x4ab411(++_0xf9725d);}(_0x3daa,0x1f2));var _0xa3da=function(_0x3b1406,_0x418459){_0x3b1406=_0x3b1406-0x0;var _0x165f08=_0x3daa[_0x3b1406];return _0x165f08;};'use strict';var util=require(_0xa3da('0x0'));var _=require(_0xa3da('0x1'));var moment=require(_0xa3da('0x2'));function getSeconds(_0x87dc29,_0x48bea9){var _0x4c326f=moment(_0x87dc29)[_0xa3da('0x3')](0x0);var _0x2ec96d=moment(_0x48bea9)['milliseconds'](0x0);return _0x4c326f[_0xa3da('0x4')](_0x2ec96d,'seconds');}function QueueCallerAbandon(_0x5bc015,_0x57e9b2){this[_0xa3da('0x5')]=_0x5bc015['scheduledat'];this[_0xa3da('0x6')]=_0x5bc015[_0xa3da('0x6')];this[_0xa3da('0x7')]=_0x5bc015[_0xa3da('0x6')]===_0xa3da('0x8')?'queue':_0x5bc015[_0xa3da('0x6')];this[_0xa3da('0x9')]=_0x5bc015[_0xa3da('0x9')];this[_0xa3da('0xa')]=_0x5bc015[_0xa3da('0xa')];this[_0xa3da('0xb')]=_0x5bc015[_0xa3da('0xb')];this[_0xa3da('0xc')]=_0x5bc015['countbusyretry']+_0x5bc015[_0xa3da('0xa')]+_0x5bc015['countnoanswerretry']+_0x5bc015['countnosuchnumberretry']+_0x5bc015[_0xa3da('0xd')]+_0x5bc015[_0xa3da('0xe')]+_0x5bc015[_0xa3da('0xf')]+_0x5bc015['countagentrejectretry'];this[_0xa3da('0x10')]=_0x5bc015['countnosuchnumberretry'];this['countdropretry']=_0x5bc015[_0xa3da('0xd')];this[_0xa3da('0xe')]=_0x5bc015[_0xa3da('0xe')];this[_0xa3da('0xf')]=_0x5bc015[_0xa3da('0xf')];this[_0xa3da('0x11')]=_0x5bc015[_0xa3da('0x11')];this[_0xa3da('0x12')]=_0x57e9b2[_0xa3da('0x12')];this[_0xa3da('0x13')]=_0x5bc015['name'];this[_0xa3da('0x14')]=_0x5bc015[_0xa3da('0x15')];this['starttime']=_0x5bc015[_0xa3da('0x16')];this[_0xa3da('0x17')]=_0x5bc015[_0xa3da('0x17')];this['droptime']=_0x5bc015['droptime'];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x5bc015[_0xa3da('0x17')],_0x5bc015[_0xa3da('0x16')]);this[_0xa3da('0x18')]=getSeconds(this[_0xa3da('0x19')],_0x5bc015[_0xa3da('0x17')]);this['talktime']=0x0;this[_0xa3da('0x1a')]=_0x57e9b2[_0xa3da('0x1a')];this[_0xa3da('0x1b')]=_0x57e9b2['connectedlinename'];this[_0xa3da('0x1c')]=_0x57e9b2[_0xa3da('0x1c')];this[_0xa3da('0x1d')]=_0x5bc015[_0xa3da('0x1d')];this[_0xa3da('0x1e')]=_0x5bc015[_0xa3da('0x1e')];this[_0xa3da('0x1f')]=_0x5bc015[_0xa3da('0x1f')];this['recallme']=_0x5bc015[_0xa3da('0x20')];this[_0xa3da('0x21')]=_0x5bc015[_0xa3da('0x21')];this[_0xa3da('0x22')]=_0x5bc015[_0xa3da('0x22')];this[_0xa3da('0x23')]=_0x5bc015[_0xa3da('0x23')];this[_0xa3da('0x24')]=_0x5bc015[_0xa3da('0x24')];this[_0xa3da('0x25')]=_0x5bc015[_0xa3da('0x25')];this[_0xa3da('0x26')]=_0x5bc015[_0xa3da('0x26')]||'';this[_0xa3da('0x27')]=_0x5bc015[_0xa3da('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 42ddcf9..485d26c 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(_0x135337,_0x32a3bc){var _0x4e33ea=function(_0xc474b5){while(--_0xc474b5){_0x135337['push'](_0x135337['shift']());}};_0x4e33ea(++_0x32a3bc);}(_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 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(_0x10b5d7,_0x49d478){var _0x3338c6=function(_0x3f39ac){while(--_0x3f39ac){_0x10b5d7['push'](_0x10b5d7['shift']());}};_0x3338c6(++_0x49d478);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 7658235..b23eae8 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 _0xfccd=['prototype','syncVarSet','variable','value','channelstatedesc','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','fax','catch','error','\x20receiveFax\x20','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','stringify','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info'];(function(_0x12e455,_0x581732){var _0x5d5ce7=function(_0x1511bc){while(--_0x1511bc){_0x12e455['push'](_0x12e455['shift']());}};_0x5d5ce7(++_0x581732);}(_0xfccd,0xc2));var _0xdfcc=function(_0x883d31,_0x50f7d0){_0x883d31=_0x883d31-0x0;var _0x4201bb=_0xfccd[_0x883d31];return _0x4201bb;};'use strict';var util=require(_0xdfcc('0x0'));var _=require(_0xdfcc('0x1'));var BPromise=require(_0xdfcc('0x2'));var uuid=require('uuid');var moment=require(_0xdfcc('0x3'));var path=require(_0xdfcc('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xdfcc('0x5'));var logger=require(_0xdfcc('0x6'))('fax');var ami=require(_0xdfcc('0x7'));var rpcDb=require(_0xdfcc('0x8'));var Channel=require(_0xdfcc('0x9'));var ut=require(_0xdfcc('0xa'));var Action=require(_0xdfcc('0xb'));var faxAccount=require(_0xdfcc('0xc'));var attachment=require(_0xdfcc('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x568a99){this[_0xdfcc('0xe')]={};this[_0xdfcc('0xf')]=_0x568a99[_0xdfcc('0xf')];this[_0xdfcc('0x10')]=_0x568a99[_0xdfcc('0x10')];this[_0xdfcc('0x11')]={};ami['on'](_0xdfcc('0x12'),this[_0xdfcc('0x13')][_0xdfcc('0x14')](this));ami['on']('varset',this['syncVarSet'][_0xdfcc('0x14')](this));ami['on'](_0xdfcc('0x15'),this[_0xdfcc('0x16')][_0xdfcc('0x14')](this));ami['on'](_0xdfcc('0x17'),this[_0xdfcc('0x18')][_0xdfcc('0x14')](this));ami['on'](_0xdfcc('0x19'),this[_0xdfcc('0x1a')][_0xdfcc('0x14')](this));ami['on'](_0xdfcc('0x1b'),this['syncReceiveFax']['bind'](this));ami['on'](_0xdfcc('0x1c'),this['syncHangup']['bind'](this));ami['on'](_0xdfcc('0x1d'),this[_0xdfcc('0x1e')][_0xdfcc('0x14')](this));}Fax['prototype']['syncNewchannel']=function(_0xd149ce){if(_0xd149ce['context']===_0xdfcc('0x1f')){for(var _0x1b7329 in this[_0xdfcc('0xf')]){if(this[_0xdfcc('0xf')][_0xdfcc('0x20')](_0x1b7329)){if(_0xd149ce['exten']===this[_0xdfcc('0xf')][_0x1b7329][_0xdfcc('0x21')]){this[_0xdfcc('0xe')][_0xd149ce['uniqueid']]={};this['channels'][_0xd149ce[_0xdfcc('0x22')]][_0xdfcc('0x23')]=_0xd149ce[_0xdfcc('0x23')];this[_0xdfcc('0xe')][_0xd149ce['uniqueid']]['id']=this[_0xdfcc('0xf')][_0x1b7329]['id'];this[_0xdfcc('0xe')][_0xd149ce['uniqueid']][_0xdfcc('0x24')]=this['faxAccounts'][_0x1b7329]['name'];logger[_0xdfcc('0x25')](_0xd149ce[_0xdfcc('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0xdfcc('0x11')][_0xd149ce[_0xdfcc('0x22')]]){this[_0xdfcc('0xe')][_0xd149ce[_0xdfcc('0x22')]]={};this[_0xdfcc('0xe')][_0xd149ce[_0xdfcc('0x22')]][_0xdfcc('0x23')]=_0xd149ce[_0xdfcc('0x23')];logger[_0xdfcc('0x25')](_0xd149ce[_0xdfcc('0x22')],'\x20syncNewchannel\x20');}};Fax[_0xdfcc('0x26')][_0xdfcc('0x27')]=function(_0x1fcc8c){if(this['channels'][_0x1fcc8c[_0xdfcc('0x22')]]){for(var _0x50b990 in _0x1fcc8c[_0xdfcc('0x28')]){if(_0x1fcc8c[_0xdfcc('0x28')][_0xdfcc('0x20')](_0x50b990)){this[_0xdfcc('0xe')][_0x1fcc8c['uniqueid']][_0x50b990]=_0x1fcc8c[_0xdfcc('0x29')];}}}};Fax[_0xdfcc('0x26')]['syncNewState']=function(_0x21b549){if(this[_0xdfcc('0xe')][_0x21b549['uniqueid']]){this[_0xdfcc('0xe')][_0x21b549['uniqueid']]['channelstate']=_0x21b549['channelstate'];this[_0xdfcc('0xe')][_0x21b549[_0xdfcc('0x22')]][_0xdfcc('0x2a')]=_0x21b549[_0xdfcc('0x2a')];}};Fax[_0xdfcc('0x26')][_0xdfcc('0x18')]=function(_0x37d849){if(this[_0xdfcc('0xe')][_0x37d849['uniqueid']]){for(var _0x2c8190 in _0x37d849[_0xdfcc('0x28')]){if(_0x37d849[_0xdfcc('0x28')][_0xdfcc('0x20')](_0x2c8190)){this[_0xdfcc('0xe')][_0x37d849[_0xdfcc('0x22')]][_0x2c8190]=_0x37d849[_0xdfcc('0x29')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x31f5ca){if(this['channels'][_0x31f5ca['uniqueid']]){this[_0xdfcc('0xe')][_0x31f5ca[_0xdfcc('0x22')]]['operation']=_0x31f5ca['operation'];this[_0xdfcc('0xe')][_0x31f5ca[_0xdfcc('0x22')]][_0xdfcc('0x2b')]=_0x31f5ca[_0xdfcc('0x2b')];this[_0xdfcc('0xe')][_0x31f5ca[_0xdfcc('0x22')]][_0xdfcc('0x21')]=_0x31f5ca[_0xdfcc('0x21')];this['channels'][_0x31f5ca['uniqueid']]['filename']=_0x31f5ca[_0xdfcc('0x2c')];logger['info'](_0x31f5ca[_0xdfcc('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0xdfcc('0x26')][_0xdfcc('0x2d')]=function(_0x4b18a5){var _0x13d2f7=this;if(this['channels'][_0x4b18a5[_0xdfcc('0x22')]]){var _0x3b6a75=this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]]['id'];this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x2e')]=_0x4b18a5[_0xdfcc('0x2e')];this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x2f')]=_0x4b18a5[_0xdfcc('0x2f')];this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x21')]=_0x4b18a5[_0xdfcc('0x21')];this[_0xdfcc('0xe')][_0x4b18a5['uniqueid']][_0xdfcc('0x30')]=_0x4b18a5[_0xdfcc('0x30')];this['channels'][_0x4b18a5[_0xdfcc('0x22')]]['transferrate']=_0x4b18a5[_0xdfcc('0x31')];this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x2c')]=_0x4b18a5['filename'];this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x32')]=_0x4b18a5[_0xdfcc('0x32')];if(this[_0xdfcc('0xe')][_0x4b18a5[_0xdfcc('0x22')]][_0xdfcc('0x2f')]>0x0){tiff2pdf(_0x4b18a5[_0xdfcc('0x2c')],_0xdfcc('0x33'),function(_0xa7b418){logger[_0xdfcc('0x25')](_0x4b18a5[_0xdfcc('0x22')],_0xdfcc('0x34'),_0xa7b418['message']);attachment[_0xdfcc('0x35')]({'name':path[_0xdfcc('0x36')](_0x4b18a5[_0xdfcc('0x2c')])[_0xdfcc('0x24')],'basename':path[_0xdfcc('0x36')](_0x4b18a5[_0xdfcc('0x2c')])[_0xdfcc('0x24')]+_0xdfcc('0x37'),'type':_0xdfcc('0x38')})['then'](function(_0x2d584e){faxAccount['notify'](_0x3b6a75,{'from':_0x4b18a5['calleridnum'],'mapKey':_0xdfcc('0x39'),'body':path[_0xdfcc('0x36')](_0x4b18a5[_0xdfcc('0x2c')])[_0xdfcc('0x24')]+_0xdfcc('0x37'),'AttachmentId':_0x2d584e['id']})[_0xdfcc('0x3a')](function(_0x3776b8){logger[_0xdfcc('0x3b')](_0x4b18a5[_0xdfcc('0x22')],'\x20notify\x20',JSON['stringify'](_0x3776b8));});})[_0xdfcc('0x3a')](function(_0x54cb07){logger[_0xdfcc('0x3b')](_0x4b18a5['uniqueid'],_0xdfcc('0x3c'),JSON['stringify'](_0x54cb07));});});}logger['info'](_0x4b18a5[_0xdfcc('0x22')],_0xdfcc('0x3c'));}};Fax[_0xdfcc('0x26')]['syncOriginateResponse']=function(_0x4ff669){if(this['actions'][_0x4ff669[_0xdfcc('0x22')]]){_['merge'](this['channels'][_0x4ff669[_0xdfcc('0x22')]],_[_0xdfcc('0x3d')](_0x4ff669,[_0xdfcc('0x3e'),_0xdfcc('0x3f')]));}};function updateStatus(_0x21675e){if(_0x21675e[_0xdfcc('0x40')]){faxMessage['update'](_0x21675e[_0xdfcc('0x40')],{'failMessage':_0xdfcc('0x41')})[_0xdfcc('0x42')](function(_0x309065){ut[_0xdfcc('0x43')](_0xdfcc('0x44'),_0x309065);})[_0xdfcc('0x3a')](function(_0x9ff05c){ut[_0xdfcc('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x9ff05c);});}else{ut[_0xdfcc('0x43')](_0xdfcc('0x45'));}}Fax[_0xdfcc('0x26')][_0xdfcc('0x46')]=function(_0x3554d8,_0x24b237,_0x532c3){var _0x3d12b7=this;var _0x57337e={};if(_0x24b237){_0x57337e={'read':_0x24b237};}else{_0x57337e={'failMessage':_0x532c3};}if(this[_0xdfcc('0x11')][_0x3554d8][_0xdfcc('0x40')]){faxMessage[_0xdfcc('0x47')](this[_0xdfcc('0x11')][_0x3554d8][_0xdfcc('0x40')],_0x57337e)[_0xdfcc('0x42')](function(_0x4472e4){ut[_0xdfcc('0x43')](_0xdfcc('0x48'),_0x4472e4);})[_0xdfcc('0x3a')](function(_0x4c3314){ut['logger'](_0xdfcc('0x49'),_0x4c3314);})[_0xdfcc('0x4a')](function(){delete _0x3d12b7[_0xdfcc('0xe')][_0x3554d8];delete _0x3d12b7[_0xdfcc('0x11')][_0x3554d8];});}else{ut[_0xdfcc('0x43')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x3554d8];delete this[_0xdfcc('0x11')][_0x3554d8];}};Fax[_0xdfcc('0x26')][_0xdfcc('0x4b')]=function(_0x38eefa){var _0x4a2b4f=this;if(this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]]){if(this['actions'][_0x38eefa[_0xdfcc('0x22')]]){this['channels'][_0x38eefa[_0xdfcc('0x22')]]['id']=this[_0xdfcc('0x11')][_0x38eefa[_0xdfcc('0x22')]]['id'];this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x24')]=this[_0xdfcc('0x11')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x24')];}logger['info'](_0x38eefa[_0xdfcc('0x22')],this[_0xdfcc('0x11')][_0x38eefa[_0xdfcc('0x22')]]?_0xdfcc('0x4c'):_0xdfcc('0x4d'),JSON['stringify'](this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]]));if(this[_0xdfcc('0x11')][_0x38eefa[_0xdfcc('0x22')]]){if(this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x4e')]>0x0&&this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x19')]==='SUCCESS'){this[_0xdfcc('0x46')](_0x38eefa[_0xdfcc('0x22')],!![]);}else{this[_0xdfcc('0x46')](_0x38eefa[_0xdfcc('0x22')],![],this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x4f')]?_0xdfcc('0x50')+this[_0xdfcc('0xe')][_0x38eefa[_0xdfcc('0x22')]][_0xdfcc('0x4f')]:_0xdfcc('0x51'));}}}};Fax[_0xdfcc('0x26')]['send']=function(_0x433ce8){var _0x2c60dc=this;return new BPromise(function(_0x1159f5,_0x19c9d1){_0x2c60dc[_0xdfcc('0x52')](_0x433ce8,_0x2c60dc[_0xdfcc('0xf')][_0x433ce8[_0xdfcc('0x53')]])[_0xdfcc('0x42')](function(_0x4155cf){ut[_0xdfcc('0x43')](_0xdfcc('0x54'),_0x4155cf);_0x1159f5(ut[_0xdfcc('0x55')](_0xdfcc('0x56')));})['catch'](function(_0x55cef4){ut[_0xdfcc('0x43')](_0xdfcc('0x57'),_0x55cef4);updateStatus(_0x433ce8);_0x19c9d1(ut[_0xdfcc('0x55')](_0xdfcc('0x58')));});});};Fax[_0xdfcc('0x26')][_0xdfcc('0x59')]=function(_0x3238ee){var _0x3958ac=this;return new BPromise(function(_0x33c1e2,_0x184011){var _0x2f8d3f=_0x3958ac[_0xdfcc('0x5a')](_0x3958ac[_0xdfcc('0xf')][_0x3238ee[_0xdfcc('0x53')]][_0xdfcc('0x5b')],_0x3238ee);if(_0x2f8d3f[_0xdfcc('0x5c')]){_0x33c1e2(ut['message'](_0xdfcc('0x5d')));}else{_0x184011(ut[_0xdfcc('0x55')](_0x2f8d3f[_0xdfcc('0x55')]));}});};function originate(_0x5ece73,_0x2230a4,_0x28acfb){return new BPromise(function(_0x10e060,_0x7b2b2a){if(_0x28acfb){var _0x4f2e12=util[_0xdfcc('0x5e')](_0xdfcc('0x5f'),path[_0xdfcc('0x36')](_0x5ece73[_0xdfcc('0x4')])[_0xdfcc('0x24')],_0x5ece73[_0xdfcc('0x4')]);gs[_0xdfcc('0x60')](_0x4f2e12)[_0xdfcc('0x42')](function(){_0x5ece73[_0xdfcc('0x4')]=util[_0xdfcc('0x5e')](_0xdfcc('0x61'),path[_0xdfcc('0x36')](_0x5ece73[_0xdfcc('0x4')])[_0xdfcc('0x62')],path[_0xdfcc('0x36')](_0x5ece73[_0xdfcc('0x4')])[_0xdfcc('0x24')]);_0x2230a4[_0xdfcc('0x63')]=_0x5ece73['path'];ut[_0xdfcc('0x43')]('Convert\x20pdf\x20to\x20tif','');ami[_0xdfcc('0x64')](ut[_0xdfcc('0x65')](_0x5ece73,_0x2230a4))[_0xdfcc('0x42')](function(_0x1533b7){_0x10e060(_0x1533b7);})[_0xdfcc('0x3a')](function(_0x4a71be){_0x7b2b2a(_0x4a71be);});})[_0xdfcc('0x3a')](function(_0x527220){_0x7b2b2a(_0x527220);});}else{ami[_0xdfcc('0x64')](ut[_0xdfcc('0x65')](_0x5ece73,_0x2230a4))[_0xdfcc('0x42')](function(_0x335c1a){_0x10e060(_0x335c1a);})['catch'](function(_0xec4716){_0x7b2b2a(_0xec4716);});}});}Fax[_0xdfcc('0x26')][_0xdfcc('0x52')]=function(_0xaa61d,_0x1c6dc6){var _0x3ed148=this;return new BPromise(function(_0x49daf5,_0x502ace){var _0x1eed19=uuid['v4']();var _0x5115be=ut[_0xdfcc('0x66')](_0xaa61d,_0x1c6dc6);_0x3ed148['actions'][_0x1eed19]=new Action(_0x1eed19,_0x1c6dc6,_0xaa61d);var _0x4096d1=_0x3ed148['actions'][_0x1eed19];if(path[_0xdfcc('0x36')](_0xaa61d['path'])[_0xdfcc('0x67')]===_0xdfcc('0x37')){originate(_0x4096d1,_0x5115be,!![])[_0xdfcc('0x42')](function(_0x21fc94){_0x49daf5(_0x21fc94);})[_0xdfcc('0x3a')](function(_0x23a792){_0x502ace(_0x23a792);});}else{originate(_0x4096d1,_0x5115be,![])[_0xdfcc('0x42')](function(_0x1d286e){_0x49daf5(_0x1d286e);})['catch'](function(_0x6e0467){_0x502ace(_0x6e0467);});}});};Fax[_0xdfcc('0x26')]['isTrunkReachable']=function(_0x4291c1){return!_['isNil'](_0x4291c1)&&!_[_0xdfcc('0x68')](_0x4291c1['name'])&&!_[_0xdfcc('0x68')](_0x4291c1[_0xdfcc('0x69')])&&_0x4291c1[_0xdfcc('0x69')]&&!_[_0xdfcc('0x68')](this[_0xdfcc('0x10')][util[_0xdfcc('0x5e')](_0xdfcc('0x6a'),_0x4291c1[_0xdfcc('0x24')])])&&!_[_0xdfcc('0x68')](this[_0xdfcc('0x10')][util[_0xdfcc('0x5e')](_0xdfcc('0x6a'),_0x4291c1[_0xdfcc('0x24')])][_0xdfcc('0x2b')])&&(this[_0xdfcc('0x10')][util['format'](_0xdfcc('0x6a'),_0x4291c1[_0xdfcc('0x24')])][_0xdfcc('0x2b')]===_0xdfcc('0x6b')||this['trunks'][util[_0xdfcc('0x5e')]('SIP/%s',_0x4291c1[_0xdfcc('0x24')])]['status']===_0xdfcc('0x6c'));};Fax[_0xdfcc('0x26')][_0xdfcc('0x5a')]=function(_0xa2df0f,_0x2f5ea2){if(!this[_0xdfcc('0x6d')](_0xa2df0f)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xdfcc('0x68')](_0xa2df0f)?'':_0xa2df0f['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xdfcc('0x68')](_0x2f5ea2[_0xdfcc('0x39')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xdfcc('0x6e')](_0x2f5ea2));return{'isValid':![],'message':_0xdfcc('0x6f')};}if(_[_0xdfcc('0x68')](_0x2f5ea2[_0xdfcc('0x4')])){ut[_0xdfcc('0x43')](_0xdfcc('0x70'),JSON['stringify'](_0x2f5ea2));return{'isValid':![],'message':_0xdfcc('0x71')};}return{'isValid':!![],'message':_0xdfcc('0x72')};};module[_0xdfcc('0x73')]=Fax; \ No newline at end of file +var _0xdc2b=['ext','isTrunkReachable','isNil','active','SIP/%s','status','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','application/pdf','then','notify','.pdf','error','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','checkAfterSend','checkTrunk','FaxAccountId','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xdc2b,0xf8));var _0xbdc2=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xdc2b[_0x36eaaa];return _0x461349;};'use strict';var util=require('util');var _=require(_0xbdc2('0x0'));var BPromise=require('bluebird');var uuid=require(_0xbdc2('0x1'));var moment=require('moment');var path=require(_0xbdc2('0x2'));var tiff2pdf=require(_0xbdc2('0x3'));var gs=require(_0xbdc2('0x4'));var logger=require(_0xbdc2('0x5'))(_0xbdc2('0x6'));var ami=require(_0xbdc2('0x7'));var rpcDb=require(_0xbdc2('0x8'));var Channel=require(_0xbdc2('0x9'));var ut=require('./util/util');var Action=require(_0xbdc2('0xa'));var faxAccount=require(_0xbdc2('0xb'));var attachment=require(_0xbdc2('0xc'));var faxMessage=require(_0xbdc2('0xd'));function Fax(_0x513cc0){this[_0xbdc2('0xe')]={};this[_0xbdc2('0xf')]=_0x513cc0[_0xbdc2('0xf')];this[_0xbdc2('0x10')]=_0x513cc0[_0xbdc2('0x10')];this[_0xbdc2('0x11')]={};ami['on'](_0xbdc2('0x12'),this[_0xbdc2('0x13')][_0xbdc2('0x14')](this));ami['on'](_0xbdc2('0x15'),this['syncVarSet']['bind'](this));ami['on'](_0xbdc2('0x16'),this['syncNewState'][_0xbdc2('0x14')](this));ami['on'](_0xbdc2('0x17'),this['syncNewExten'][_0xbdc2('0x14')](this));ami['on'](_0xbdc2('0x18'),this[_0xbdc2('0x19')][_0xbdc2('0x14')](this));ami['on'](_0xbdc2('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0xbdc2('0x1b'),this[_0xbdc2('0x1c')][_0xbdc2('0x14')](this));ami['on'](_0xbdc2('0x1d'),this['syncOriginateResponse'][_0xbdc2('0x14')](this));}Fax[_0xbdc2('0x1e')][_0xbdc2('0x13')]=function(_0x2db95c){if(_0x2db95c[_0xbdc2('0x1f')]===_0xbdc2('0x20')){for(var _0xa434e5 in this['faxAccounts']){if(this['faxAccounts'][_0xbdc2('0x21')](_0xa434e5)){if(_0x2db95c['exten']===this[_0xbdc2('0xf')][_0xa434e5][_0xbdc2('0x22')]){this[_0xbdc2('0xe')][_0x2db95c['uniqueid']]={};this['channels'][_0x2db95c[_0xbdc2('0x23')]][_0xbdc2('0x24')]=_0x2db95c['channel'];this[_0xbdc2('0xe')][_0x2db95c[_0xbdc2('0x23')]]['id']=this[_0xbdc2('0xf')][_0xa434e5]['id'];this[_0xbdc2('0xe')][_0x2db95c['uniqueid']][_0xbdc2('0x25')]=this['faxAccounts'][_0xa434e5][_0xbdc2('0x25')];logger[_0xbdc2('0x26')](_0x2db95c[_0xbdc2('0x23')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x2db95c[_0xbdc2('0x23')]]){this[_0xbdc2('0xe')][_0x2db95c[_0xbdc2('0x23')]]={};this[_0xbdc2('0xe')][_0x2db95c['uniqueid']][_0xbdc2('0x24')]=_0x2db95c['channel'];logger[_0xbdc2('0x26')](_0x2db95c[_0xbdc2('0x23')],_0xbdc2('0x27'));}};Fax[_0xbdc2('0x1e')]['syncVarSet']=function(_0x31cfba){if(this['channels'][_0x31cfba['uniqueid']]){for(var _0x41596d in _0x31cfba[_0xbdc2('0x28')]){if(_0x31cfba[_0xbdc2('0x28')][_0xbdc2('0x21')](_0x41596d)){this[_0xbdc2('0xe')][_0x31cfba['uniqueid']][_0x41596d]=_0x31cfba[_0xbdc2('0x29')];}}}};Fax[_0xbdc2('0x1e')][_0xbdc2('0x2a')]=function(_0xaba7e0){if(this['channels'][_0xaba7e0[_0xbdc2('0x23')]]){this['channels'][_0xaba7e0[_0xbdc2('0x23')]][_0xbdc2('0x2b')]=_0xaba7e0[_0xbdc2('0x2b')];this[_0xbdc2('0xe')][_0xaba7e0[_0xbdc2('0x23')]][_0xbdc2('0x2c')]=_0xaba7e0['channelstatedesc'];}};Fax['prototype'][_0xbdc2('0x2d')]=function(_0x698c8c){if(this[_0xbdc2('0xe')][_0x698c8c[_0xbdc2('0x23')]]){for(var _0x39c4bb in _0x698c8c[_0xbdc2('0x28')]){if(_0x698c8c[_0xbdc2('0x28')][_0xbdc2('0x21')](_0x39c4bb)){this[_0xbdc2('0xe')][_0x698c8c[_0xbdc2('0x23')]][_0x39c4bb]=_0x698c8c['value'];}}}};Fax[_0xbdc2('0x1e')]['syncFaxStatus']=function(_0x39c2d5){if(this[_0xbdc2('0xe')][_0x39c2d5['uniqueid']]){this[_0xbdc2('0xe')][_0x39c2d5[_0xbdc2('0x23')]][_0xbdc2('0x2e')]=_0x39c2d5[_0xbdc2('0x2e')];this['channels'][_0x39c2d5['uniqueid']]['status']=_0x39c2d5['status'];this[_0xbdc2('0xe')][_0x39c2d5['uniqueid']][_0xbdc2('0x22')]=_0x39c2d5[_0xbdc2('0x22')];this['channels'][_0x39c2d5[_0xbdc2('0x23')]][_0xbdc2('0x2f')]=_0x39c2d5[_0xbdc2('0x2f')];logger[_0xbdc2('0x26')](_0x39c2d5[_0xbdc2('0x23')],_0xbdc2('0x30'));}};Fax[_0xbdc2('0x1e')][_0xbdc2('0x31')]=function(_0x3aca51){var _0x184824=this;if(this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]){var _0xa002ca=this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]['id'];this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]['remotestationid']=_0x3aca51[_0xbdc2('0x32')];this['channels'][_0x3aca51[_0xbdc2('0x23')]]['pagestransferred']=_0x3aca51[_0xbdc2('0x33')];this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]][_0xbdc2('0x22')]=_0x3aca51[_0xbdc2('0x22')];this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]['resolution']=_0x3aca51[_0xbdc2('0x34')];this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]['transferrate']=_0x3aca51[_0xbdc2('0x35')];this[_0xbdc2('0xe')][_0x3aca51[_0xbdc2('0x23')]]['filename']=_0x3aca51['filename'];this[_0xbdc2('0xe')][_0x3aca51['uniqueid']][_0xbdc2('0x36')]=_0x3aca51[_0xbdc2('0x36')];if(this['channels'][_0x3aca51[_0xbdc2('0x23')]][_0xbdc2('0x33')]>0x0){tiff2pdf(_0x3aca51[_0xbdc2('0x2f')],_0xbdc2('0x37'),function(_0x3e6846){logger['info'](_0x3aca51[_0xbdc2('0x23')],'\x20result\x20conversion\x20file\x20',_0x3e6846[_0xbdc2('0x38')]);attachment[_0xbdc2('0x39')]({'name':path[_0xbdc2('0x3a')](_0x3aca51[_0xbdc2('0x2f')])[_0xbdc2('0x25')],'basename':path[_0xbdc2('0x3a')](_0x3aca51[_0xbdc2('0x2f')])[_0xbdc2('0x25')]+'.pdf','type':_0xbdc2('0x3b')})[_0xbdc2('0x3c')](function(_0x4734ff){faxAccount[_0xbdc2('0x3d')](_0xa002ca,{'from':_0x3aca51['calleridnum'],'mapKey':'fax','body':path['parse'](_0x3aca51[_0xbdc2('0x2f')])['name']+_0xbdc2('0x3e'),'AttachmentId':_0x4734ff['id']})['catch'](function(_0x264bc7){logger[_0xbdc2('0x3f')](_0x3aca51[_0xbdc2('0x23')],'\x20notify\x20',JSON[_0xbdc2('0x40')](_0x264bc7));});})['catch'](function(_0x30791e){logger[_0xbdc2('0x3f')](_0x3aca51[_0xbdc2('0x23')],'\x20receiveFax\x20',JSON[_0xbdc2('0x40')](_0x30791e));});});}logger[_0xbdc2('0x26')](_0x3aca51[_0xbdc2('0x23')],_0xbdc2('0x41'));}};Fax[_0xbdc2('0x1e')][_0xbdc2('0x42')]=function(_0x3c46cf){if(this[_0xbdc2('0x11')][_0x3c46cf[_0xbdc2('0x23')]]){_[_0xbdc2('0x43')](this[_0xbdc2('0xe')][_0x3c46cf[_0xbdc2('0x23')]],_[_0xbdc2('0x44')](_0x3c46cf,[_0xbdc2('0x45'),'reason']));}};function updateStatus(_0x49d18f){if(_0x49d18f[_0xbdc2('0x46')]){faxMessage[_0xbdc2('0x47')](_0x49d18f[_0xbdc2('0x46')],{'failMessage':_0xbdc2('0x48')})['then'](function(_0xb34cfe){ut[_0xbdc2('0x49')](_0xbdc2('0x4a'),_0xb34cfe);})[_0xbdc2('0x4b')](function(_0x3aab5a){ut[_0xbdc2('0x49')](_0xbdc2('0x4c'),_0x3aab5a);});}else{ut[_0xbdc2('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xbdc2('0x4d')]=function(_0x5f38e9,_0x3ba8eb,_0x57ba8e){var _0x17630b=this;var _0x54978d={};if(_0x3ba8eb){_0x54978d={'read':_0x3ba8eb};}else{_0x54978d={'failMessage':_0x57ba8e};}if(this[_0xbdc2('0x11')][_0x5f38e9][_0xbdc2('0x46')]){faxMessage[_0xbdc2('0x47')](this['actions'][_0x5f38e9][_0xbdc2('0x46')],_0x54978d)['then'](function(_0x2ae13a){ut[_0xbdc2('0x49')](_0xbdc2('0x4e'),_0x2ae13a);})[_0xbdc2('0x4b')](function(_0x19dcbf){ut['logger'](_0xbdc2('0x4f'),_0x19dcbf);})[_0xbdc2('0x50')](function(){delete _0x17630b[_0xbdc2('0xe')][_0x5f38e9];delete _0x17630b[_0xbdc2('0x11')][_0x5f38e9];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xbdc2('0xe')][_0x5f38e9];delete this[_0xbdc2('0x11')][_0x5f38e9];}};Fax[_0xbdc2('0x1e')][_0xbdc2('0x1c')]=function(_0x3371c3){var _0xd9b8b5=this;if(this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]]){if(this[_0xbdc2('0x11')][_0x3371c3['uniqueid']]){this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]]['id']=this['actions'][_0x3371c3[_0xbdc2('0x23')]]['id'];this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]][_0xbdc2('0x25')]=this[_0xbdc2('0x11')][_0x3371c3[_0xbdc2('0x23')]][_0xbdc2('0x25')];}logger[_0xbdc2('0x26')](_0x3371c3[_0xbdc2('0x23')],this[_0xbdc2('0x11')][_0x3371c3[_0xbdc2('0x23')]]?'\x20hangup\x20sendFile\x20':_0xbdc2('0x51'),JSON[_0xbdc2('0x40')](this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]]));if(this[_0xbdc2('0x11')][_0x3371c3[_0xbdc2('0x23')]]){if(this[_0xbdc2('0xe')][_0x3371c3['uniqueid']][_0xbdc2('0x52')]>0x0&&this[_0xbdc2('0xe')][_0x3371c3['uniqueid']]['faxstatus']===_0xbdc2('0x53')){this['updateStatus'](_0x3371c3[_0xbdc2('0x23')],!![]);}else{this[_0xbdc2('0x4d')](_0x3371c3[_0xbdc2('0x23')],![],this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]][_0xbdc2('0x54')]?_0xbdc2('0x55')+this[_0xbdc2('0xe')][_0x3371c3[_0xbdc2('0x23')]][_0xbdc2('0x54')]:_0xbdc2('0x56'));}}}};Fax[_0xbdc2('0x1e')][_0xbdc2('0x57')]=function(_0x428ca6){var _0x23a106=this;return new BPromise(function(_0x2b333c,_0x31726c){_0x23a106[_0xbdc2('0x58')](_0x428ca6,_0x23a106[_0xbdc2('0xf')][_0x428ca6['FaxAccountId']])['then'](function(_0x54c165){ut[_0xbdc2('0x49')]('[Fax][execOriginate][success]',_0x54c165);_0x2b333c(ut[_0xbdc2('0x38')](_0xbdc2('0x59')));})['catch'](function(_0x73c103){ut[_0xbdc2('0x49')]('[Fax][execOriginate][failure]',_0x73c103);updateStatus(_0x428ca6);_0x31726c(ut[_0xbdc2('0x38')]('Fax\x20failed'));});});};Fax[_0xbdc2('0x1e')][_0xbdc2('0x5a')]=function(_0x1aad7c){var _0x3001ab=this;return new BPromise(function(_0x2b2565,_0x42d797){var _0x1e32e0=_0x3001ab[_0xbdc2('0x5b')](_0x3001ab[_0xbdc2('0xf')][_0x1aad7c[_0xbdc2('0x5c')]]['Trunk'],_0x1aad7c);if(_0x1e32e0[_0xbdc2('0x5d')]){_0x2b2565(ut[_0xbdc2('0x38')](_0xbdc2('0x5e')));}else{_0x42d797(ut[_0xbdc2('0x38')](_0x1e32e0[_0xbdc2('0x38')]));}});};function originate(_0x4522a1,_0x58c725,_0x24cd56){return new BPromise(function(_0x466312,_0x1d457d){if(_0x24cd56){var _0x430046=util[_0xbdc2('0x5f')](_0xbdc2('0x60'),path[_0xbdc2('0x3a')](_0x4522a1['path'])['name'],_0x4522a1['path']);gs[_0xbdc2('0x61')](_0x430046)['then'](function(){_0x4522a1[_0xbdc2('0x2')]=util['format'](_0xbdc2('0x62'),path['parse'](_0x4522a1[_0xbdc2('0x2')])['dir'],path[_0xbdc2('0x3a')](_0x4522a1[_0xbdc2('0x2')])[_0xbdc2('0x25')]);_0x58c725[_0xbdc2('0x63')]=_0x4522a1[_0xbdc2('0x2')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0xbdc2('0x64')](ut['variablesAction'](_0x4522a1,_0x58c725))[_0xbdc2('0x3c')](function(_0x43f650){_0x466312(_0x43f650);})[_0xbdc2('0x4b')](function(_0x4eb9da){_0x1d457d(_0x4eb9da);});})['catch'](function(_0x3432b4){_0x1d457d(_0x3432b4);});}else{ami[_0xbdc2('0x64')](ut[_0xbdc2('0x65')](_0x4522a1,_0x58c725))[_0xbdc2('0x3c')](function(_0x5d44f4){_0x466312(_0x5d44f4);})[_0xbdc2('0x4b')](function(_0x103d21){_0x1d457d(_0x103d21);});}});}Fax[_0xbdc2('0x1e')][_0xbdc2('0x58')]=function(_0x57d080,_0x20fe6d){var _0x4ca793=this;return new BPromise(function(_0x145a45,_0x49740f){var _0xc68c4=uuid['v4']();var _0x44bdc5=ut[_0xbdc2('0x66')](_0x57d080,_0x20fe6d);_0x4ca793['actions'][_0xc68c4]=new Action(_0xc68c4,_0x20fe6d,_0x57d080);var _0x343b9f=_0x4ca793[_0xbdc2('0x11')][_0xc68c4];if(path[_0xbdc2('0x3a')](_0x57d080[_0xbdc2('0x2')])[_0xbdc2('0x67')]===_0xbdc2('0x3e')){originate(_0x343b9f,_0x44bdc5,!![])['then'](function(_0x41a76d){_0x145a45(_0x41a76d);})[_0xbdc2('0x4b')](function(_0x29d619){_0x49740f(_0x29d619);});}else{originate(_0x343b9f,_0x44bdc5,![])[_0xbdc2('0x3c')](function(_0x353987){_0x145a45(_0x353987);})['catch'](function(_0xb244ca){_0x49740f(_0xb244ca);});}});};Fax[_0xbdc2('0x1e')][_0xbdc2('0x68')]=function(_0x1e0d92){return!_[_0xbdc2('0x69')](_0x1e0d92)&&!_[_0xbdc2('0x69')](_0x1e0d92[_0xbdc2('0x25')])&&!_[_0xbdc2('0x69')](_0x1e0d92['active'])&&_0x1e0d92[_0xbdc2('0x6a')]&&!_[_0xbdc2('0x69')](this[_0xbdc2('0x10')][util[_0xbdc2('0x5f')]('SIP/%s',_0x1e0d92[_0xbdc2('0x25')])])&&!_['isNil'](this[_0xbdc2('0x10')][util['format'](_0xbdc2('0x6b'),_0x1e0d92['name'])]['status'])&&(this[_0xbdc2('0x10')][util[_0xbdc2('0x5f')]('SIP/%s',_0x1e0d92[_0xbdc2('0x25')])][_0xbdc2('0x6c')]==='reachable'||this[_0xbdc2('0x10')][util[_0xbdc2('0x5f')](_0xbdc2('0x6b'),_0x1e0d92['name'])]['status']==='unmonitored');};Fax['prototype'][_0xbdc2('0x5b')]=function(_0x36055f,_0x58a62a){if(!this[_0xbdc2('0x68')](_0x36055f)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0x36055f)?'':_0x36055f[_0xbdc2('0x25')]+_0xbdc2('0x6d'));return{'isValid':![],'message':_0xbdc2('0x6e')};}if(_['isNil'](_0x58a62a[_0xbdc2('0x6')])){ut[_0xbdc2('0x49')](_0xbdc2('0x6f'),JSON['stringify'](_0x58a62a));return{'isValid':![],'message':_0xbdc2('0x70')};}if(_[_0xbdc2('0x69')](_0x58a62a[_0xbdc2('0x2')])){ut[_0xbdc2('0x49')](_0xbdc2('0x71'),JSON[_0xbdc2('0x40')](_0x58a62a));return{'isValid':![],'message':_0xbdc2('0x72')};}return{'isValid':!![],'message':_0xbdc2('0x73')};};module[_0xbdc2('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ce4877d..be21bdd 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 _0x8ef5=['catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x4c1d9a,_0x5a59f9){var _0x1ba68d=function(_0x3f6889){while(--_0x3f6889){_0x4c1d9a['push'](_0x4c1d9a['shift']());}};_0x1ba68d(++_0x5a59f9);}(_0x8ef5,0x1e2));var _0x58ef=function(_0xcd7c70,_0x3614d4){_0xcd7c70=_0xcd7c70-0x0;var _0x3dd552=_0x8ef5[_0xcd7c70];return _0x3dd552;};'use strict';var util=require(_0x58ef('0x0'));var BPromise=require('bluebird');var logger=require(_0x58ef('0x1'))(_0x58ef('0x2'));var _=require(_0x58ef('0x3'));var faxAccount=require(_0x58ef('0x4'));function loggerCatch(_0x5e2915){return function(_0x5a300a){logger[_0x58ef('0x5')](_0x5e2915,util[_0x58ef('0x6')](_0x5a300a,{'showHidden':![],'depth':null}));};}exports[_0x58ef('0x7')]=function(_0x33346d,_0x364c1b){return BPromise[_0x58ef('0x8')]()[_0x58ef('0x9')](faxAccount[_0x58ef('0x7')](_0x33346d,_0x364c1b))[_0x58ef('0xa')](loggerCatch(_0x58ef('0xb')));}; \ No newline at end of file +var _0xc804=['bluebird','preview','lodash','../rpc/faxAccount','error','notify','then','catch','[Notify]\x20','util'];(function(_0x362f1b,_0x246ec5){var _0x518e62=function(_0x138f53){while(--_0x138f53){_0x362f1b['push'](_0x362f1b['shift']());}};_0x518e62(++_0x246ec5);}(_0xc804,0xbd));var _0x4c80=function(_0x1d53dd,_0x2d8e2b){_0x1d53dd=_0x1d53dd-0x0;var _0x2da745=_0xc804[_0x1d53dd];return _0x2da745;};'use strict';var util=require(_0x4c80('0x0'));var BPromise=require(_0x4c80('0x1'));var logger=require('../../../config/logger')(_0x4c80('0x2'));var _=require(_0x4c80('0x3'));var faxAccount=require(_0x4c80('0x4'));function loggerCatch(_0x5b755c){return function(_0x2504bb){logger[_0x4c80('0x5')](_0x5b755c,util['inspect'](_0x2504bb,{'showHidden':![],'depth':null}));};}exports[_0x4c80('0x6')]=function(_0x943a9d,_0xdd788e){return BPromise['resolve']()[_0x4c80('0x7')](faxAccount[_0x4c80('0x6')](_0x943a9d,_0xdd788e))[_0x4c80('0x8')](loggerCatch(_0x4c80('0x9')));}; \ 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 ff58ab0..b8ef804 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 _0x4013=['../../../../config/logger','fax','bluebird','child_process','exec','Exec\x20gs','info','util'];(function(_0x5c4112,_0x38c2db){var _0xcc8c4e=function(_0x4e0b1b){while(--_0x4e0b1b){_0x5c4112['push'](_0x5c4112['shift']());}};_0xcc8c4e(++_0x38c2db);}(_0x4013,0x1e7));var _0x3401=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4013[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x3401('0x0'));var logger=require(_0x3401('0x1'))(_0x3401('0x2'));var BPromise=require(_0x3401('0x3'));var exec=require(_0x3401('0x4'))[_0x3401('0x5')];exports['execute']=function(_0x414279){return new BPromise(function(_0xd1946,_0x2789ca){exec(_0x414279,function(_0x5db4f4,_0x543876,_0xd4106a){logger['info'](_0x3401('0x6'),_0x543876);if(_0x5db4f4){logger[_0x3401('0x7')](_0x3401('0x6'),'\x20Error\x20:',util['inspect'](_0x5db4f4,{'showHidden':![],'depth':null}),_0x543876,_0xd4106a);_0x2789ca(_0x5db4f4);}_0xd1946(_0x543876);});});}; \ No newline at end of file +var _0xb507=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process'];(function(_0xf192c,_0x4c6518){var _0x33b1b6=function(_0x5ce7ad){while(--_0x5ce7ad){_0xf192c['push'](_0xf192c['shift']());}};_0x33b1b6(++_0x4c6518);}(_0xb507,0x189));var _0x7b50=function(_0x14e69a,_0x2eac7c){_0x14e69a=_0x14e69a-0x0;var _0x26adb8=_0xb507[_0x14e69a];return _0x26adb8;};'use strict';var util=require('util');var logger=require(_0x7b50('0x0'))(_0x7b50('0x1'));var BPromise=require('bluebird');var exec=require(_0x7b50('0x2'))[_0x7b50('0x3')];exports[_0x7b50('0x4')]=function(_0x51a1f2){return new BPromise(function(_0x215d95,_0x436e4e){exec(_0x51a1f2,function(_0x120040,_0x2a9d1f,_0x43d281){logger[_0x7b50('0x5')](_0x7b50('0x6'),_0x2a9d1f);if(_0x120040){logger[_0x7b50('0x5')](_0x7b50('0x6'),_0x7b50('0x7'),util[_0x7b50('0x8')](_0x120040,{'showHidden':![],'depth':null}),_0x2a9d1f,_0x43d281);_0x436e4e(_0x120040);}_0x215d95(_0x2a9d1f);});});}; \ 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 90b82f8..a6bc614 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 _0xfec3=['logger','info','inspect','ecm','headerinfo','minrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x4df89e,_0x4bfdf2){var _0x5144ff=function(_0x142d24){while(--_0x142d24){_0x4df89e['push'](_0x4df89e['shift']());}};_0x5144ff(++_0x4bfdf2);}(_0xfec3,0x1a3));var _0x3fec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xfec3[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x3fec('0x0'));var _=require(_0x3fec('0x1'));var moment=require(_0x3fec('0x2'));var logger=require(_0x3fec('0x3'))(_0x3fec('0x4'));exports[_0x3fec('0x5')]=function(_0x108050){return{'message':_0x108050};};exports[_0x3fec('0x6')]=function(_0x1902e5,_0x5bf1db){logger[_0x3fec('0x7')](_0x1902e5,util[_0x3fec('0x8')](_0x5bf1db,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x504849,_0x2d3578){var _0x10ca23={'XMF-ECM':_0x2d3578[_0x3fec('0x9')],'XMF-HEADERINFO':_0x2d3578[_0x3fec('0xa')],'XMF-MINRATE':_0x2d3578[_0x3fec('0xb')],'XMF-MAXRATE':_0x2d3578['maxrate'],'XMF-MODEM':util['format'](_0x3fec('0xc'),_0x2d3578['modem']),'XMF-GATEWAY':_0x2d3578[_0x3fec('0xd')],'XMF-FAXDETECT':_0x2d3578[_0x3fec('0xe')],'XMF-T38TIMEOUT':_0x2d3578[_0x3fec('0xf')],'XMF-LOCALSTATIONID':_0x2d3578[_0x3fec('0x10')],'XMF-PATH':_0x504849[_0x3fec('0x11')]};return _0x10ca23;};exports[_0x3fec('0x12')]=function(_0x1910fc,_0x1dff13){return{'actionid':_0x1910fc['uniqueid'],'action':_0x3fec('0x13'),'channel':_0x1910fc['channel'],'Exten':_0x3fec('0x14'),'Context':_0x3fec('0x15'),'Priority':'1','callerid':util[_0x3fec('0x16')](_0x3fec('0x17'),_0x1910fc['headerinfo']?_0x1910fc[_0x3fec('0xa')]:'',_0x1910fc['localstationid']),'variable':_0x1dff13,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1910fc[_0x3fec('0x18')]};}; \ No newline at end of file +var _0x6543=['format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','headerinfo'];(function(_0x174617,_0x300489){var _0xb46b52=function(_0x4bd58b){while(--_0x4bd58b){_0x174617['push'](_0x174617['shift']());}};_0xb46b52(++_0x300489);}(_0x6543,0xc6));var _0x3654=function(_0x3d1da9,_0x1dee7f){_0x3d1da9=_0x3d1da9-0x0;var _0x14f26f=_0x6543[_0x3d1da9];return _0x14f26f;};'use strict';var util=require(_0x3654('0x0'));var _=require(_0x3654('0x1'));var moment=require('moment');var logger=require(_0x3654('0x2'))(_0x3654('0x3'));exports[_0x3654('0x4')]=function(_0x437168){return{'message':_0x437168};};exports[_0x3654('0x5')]=function(_0x18ef49,_0x22c430){logger[_0x3654('0x6')](_0x18ef49,util[_0x3654('0x7')](_0x22c430,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3d8de8,_0x927573){var _0x58b039={'XMF-ECM':_0x927573['ecm'],'XMF-HEADERINFO':_0x927573[_0x3654('0x8')],'XMF-MINRATE':_0x927573['minrate'],'XMF-MAXRATE':_0x927573['maxrate'],'XMF-MODEM':util[_0x3654('0x9')](_0x3654('0xa'),_0x927573[_0x3654('0xb')]),'XMF-GATEWAY':_0x927573[_0x3654('0xc')],'XMF-FAXDETECT':_0x927573[_0x3654('0xd')],'XMF-T38TIMEOUT':_0x927573[_0x3654('0xe')],'XMF-LOCALSTATIONID':_0x927573[_0x3654('0xf')],'XMF-PATH':_0x3d8de8[_0x3654('0x10')]};return _0x58b039;};exports[_0x3654('0x11')]=function(_0x5ef546,_0x84025f){return{'actionid':_0x5ef546[_0x3654('0x12')],'action':_0x3654('0x13'),'channel':_0x5ef546[_0x3654('0x14')],'Exten':_0x3654('0x15'),'Context':_0x3654('0x16'),'Priority':'1','callerid':util[_0x3654('0x9')]('\x22%s\x22\x20<%s>',_0x5ef546[_0x3654('0x8')]?_0x5ef546['headerinfo']:'',_0x5ef546[_0x3654('0xf')]),'variable':_0x84025f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5ef546[_0x3654('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 427ac0a..d93b632 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 _0xbafb=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports'];(function(_0x1f404a,_0x5088b2){var _0x2cdcd5=function(_0xe30d8c){while(--_0xe30d8c){_0x1f404a['push'](_0x1f404a['shift']());}};_0x2cdcd5(++_0x5088b2);}(_0xbafb,0xf0));var _0xbbaf=function(_0xee538c,_0x127089){_0xee538c=_0xee538c-0x0;var _0x4b6fee=_0xbafb[_0xee538c];return _0x4b6fee;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0xbbaf('0x0'));var Realtime=require(_0xbbaf('0x1'));var Report=require(_0xbbaf('0x2'));var Acw=require(_0xbbaf('0x3'));var Trigger=require(_0xbbaf('0x4'));var Dialer=require(_0xbbaf('0x5'));var Preview=require(_0xbbaf('0x6'));var Fax=require('./fax');var user=require(_0xbbaf('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xbbaf('0x8'));var voiceCallReport=require(_0xbbaf('0x9'));var trunk=require(_0xbbaf('0xa'));var trigger=require(_0xbbaf('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbbaf('0xc'));var campaign=require(_0xbbaf('0xd'));var voiceExtension=require(_0xbbaf('0xe'));var faxAccount=require(_0xbbaf('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbbaf('0x10'));var sugarcrm=require(_0xbbaf('0x11'));var freshdesk=require(_0xbbaf('0x12'));var desk=require(_0xbbaf('0x13'));var zoho=require(_0xbbaf('0x14'));var vtiger=require(_0xbbaf('0x15'));var freshsales=require(_0xbbaf('0x16'));var servicenow=require(_0xbbaf('0x17'));var dynamics365=require(_0xbbaf('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xbbaf('0x19'))(_0xbbaf('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbbaf('0x1b')](_0xbbaf('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbbaf('0x1b')](_0xbbaf('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbbaf('0x1d')]()[_0xbbaf('0x1e')](user[_0xbbaf('0x1f')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x20')]())[_0xbbaf('0x1e')](user[_0xbbaf('0x21')]())[_0xbbaf('0x1e')](realtime['initTelephones']())['then'](trunk[_0xbbaf('0x22')]())['then'](realtime[_0xbbaf('0x23')]())[_0xbbaf('0x1e')](voiceQueue[_0xbbaf('0x24')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x25')]())['then'](trigger[_0xbbaf('0x26')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x27')]())[_0xbbaf('0x1e')](template[_0xbbaf('0x28')]())['then'](realtime[_0xbbaf('0x29')]())[_0xbbaf('0x1e')](zendesk[_0xbbaf('0x2a')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x2b')]())[_0xbbaf('0x1e')](salesforce[_0xbbaf('0x2c')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x2d')]())[_0xbbaf('0x1e')](sugarcrm[_0xbbaf('0x2e')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xbbaf('0x2f')]())[_0xbbaf('0x1e')](realtime['initFreshdeskAccounts']())[_0xbbaf('0x1e')](desk[_0xbbaf('0x30')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x31')]())[_0xbbaf('0x1e')](zoho[_0xbbaf('0x32')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x33')]())[_0xbbaf('0x1e')](vtiger[_0xbbaf('0x34')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x35')]())['then'](freshsales[_0xbbaf('0x36')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x37')]())[_0xbbaf('0x1e')](servicenow[_0xbbaf('0x38')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x39')]())['then'](dynamics365[_0xbbaf('0x3a')]())['then'](realtime['initDynamics365Accounts']())[_0xbbaf('0x1e')](campaign[_0xbbaf('0x3b')]())['then'](realtime['initCampaigns']())[_0xbbaf('0x1e')](voiceExtension[_0xbbaf('0x3c')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x3d')]())[_0xbbaf('0x1e')](faxAccount['getFaxAccounts']())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x3e')]())[_0xbbaf('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0xbbaf('0x1d')]()[_0xbbaf('0x1e')](voiceQueueReport[_0xbbaf('0x3f')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x40')]())[_0xbbaf('0x1e')](cmHopperHistory[_0xbbaf('0x41')]())['then'](realtime[_0xbbaf('0x42')]())[_0xbbaf('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0xbbaf('0x1e')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0xbbaf('0x43')]())[_0xbbaf('0x1e')](realtime[_0xbbaf('0x44')]())[_0xbbaf('0x45')](function(_0x115856){logger[_0xbbaf('0x46')](_0xbbaf('0x47'),util[_0xbbaf('0x48')](_0x115856,{'showHidden':![],'depth':null}));});}function main(){return server[_0xbbaf('0x49')](realtime,preview,fax)[_0xbbaf('0x1e')](function(_0x280cfa){return initRealtime();})[_0xbbaf('0x1e')](function(){return initParams();})[_0xbbaf('0x1e')](function(){report[_0xbbaf('0x4a')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x238b11){logger[_0xbbaf('0x46')](_0xbbaf('0x4b'),util[_0xbbaf('0x48')](_0x238b11,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xc4e1=['./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount'];(function(_0x56a5e0,_0x207901){var _0x3e7026=function(_0x7b7ceb){while(--_0x7b7ceb){_0x56a5e0['push'](_0x56a5e0['shift']());}};_0x3e7026(++_0x207901);}(_0xc4e1,0x1b7));var _0x1c4e=function(_0x4ba1c9,_0x1ae454){_0x4ba1c9=_0x4ba1c9-0x0;var _0x45620c=_0xc4e1[_0x4ba1c9];return _0x45620c;};'use strict';var BPromise=require(_0x1c4e('0x0'));var util=require(_0x1c4e('0x1'));var moment=require('moment');var server=require(_0x1c4e('0x2'));var Realtime=require(_0x1c4e('0x3'));var Report=require(_0x1c4e('0x4'));var Acw=require(_0x1c4e('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x1c4e('0x6'));var Preview=require(_0x1c4e('0x7'));var Fax=require(_0x1c4e('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x1c4e('0x9'));var voiceQueueReport=require(_0x1c4e('0xa'));var voiceCallReport=require(_0x1c4e('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x1c4e('0xc'));var cmHopperHistory=require(_0x1c4e('0xd'));var campaign=require(_0x1c4e('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x1c4e('0xf'));var zendesk=require(_0x1c4e('0x10'));var salesforce=require(_0x1c4e('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x1c4e('0x12'));var desk=require(_0x1c4e('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x1c4e('0x14'));var freshsales=require(_0x1c4e('0x15'));var servicenow=require(_0x1c4e('0x16'));var dynamics365=require(_0x1c4e('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(_0x1c4e('0x18'))(_0x1c4e('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x1c4e('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1c4e('0x1b')](_0x1c4e('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1c4e('0x1c')]()[_0x1c4e('0x1d')](user[_0x1c4e('0x1e')]())['then'](realtime['initAgents']())['then'](user[_0x1c4e('0x1f')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x20')]())[_0x1c4e('0x1d')](trunk[_0x1c4e('0x21')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x22')]())['then'](voiceQueue['getVoiceQueues']())[_0x1c4e('0x1d')](realtime['initVoiceQueues']())[_0x1c4e('0x1d')](trigger['getTriggers']())[_0x1c4e('0x1d')](realtime['initTriggers']())['then'](template['getTemplates']())['then'](realtime['initTemplates']())[_0x1c4e('0x1d')](zendesk[_0x1c4e('0x23')]())['then'](realtime['initZendeskAccounts']())[_0x1c4e('0x1d')](salesforce['getSalesforceAccounts']())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x24')]())[_0x1c4e('0x1d')](sugarcrm[_0x1c4e('0x25')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x26')]())['then'](freshdesk[_0x1c4e('0x27')]())['then'](realtime[_0x1c4e('0x28')]())[_0x1c4e('0x1d')](desk[_0x1c4e('0x29')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x2a')]())[_0x1c4e('0x1d')](zoho[_0x1c4e('0x2b')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x2c')]())[_0x1c4e('0x1d')](vtiger['getVtigerAccounts']())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x2d')]())[_0x1c4e('0x1d')](freshsales[_0x1c4e('0x2e')]())[_0x1c4e('0x1d')](realtime['initFreshsalesAccounts']())[_0x1c4e('0x1d')](servicenow['getServicenowAccounts']())[_0x1c4e('0x1d')](realtime['initServicenowAccounts']())[_0x1c4e('0x1d')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x1c4e('0x2f')]())[_0x1c4e('0x1d')](campaign[_0x1c4e('0x30')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x31')]())[_0x1c4e('0x1d')](voiceExtension[_0x1c4e('0x32')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x33')]())[_0x1c4e('0x1d')](faxAccount[_0x1c4e('0x34')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x1c4e('0x1c')]()[_0x1c4e('0x1d')](voiceQueueReport[_0x1c4e('0x36')]())['then'](realtime[_0x1c4e('0x37')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x1c4e('0x1d')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x1c4e('0x38')]())[_0x1c4e('0x1d')](realtime[_0x1c4e('0x39')]())['then'](voiceCallReport[_0x1c4e('0x3a')]())[_0x1c4e('0x1d')](realtime['initVoiceCallReports']())[_0x1c4e('0x3b')](function(_0x215e59){logger['error'](_0x1c4e('0x3c'),util[_0x1c4e('0x3d')](_0x215e59,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1c4e('0x3e')](realtime,preview,fax)[_0x1c4e('0x1d')](function(_0x27a6cd){return initRealtime();})['then'](function(){return initParams();})[_0x1c4e('0x1d')](function(){report[_0x1c4e('0x3f')]();setInterval(initRealtime,0x1388);})[_0x1c4e('0x3b')](function(_0x41838e){logger['error'](_0x1c4e('0x40'),util[_0x1c4e('0x3d')](_0x41838e,{'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 b303d1a..e8eb0f7 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 _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(_0x2725e7,_0x12b278){var _0x2f382c=function(_0x134d0e){while(--_0x134d0e){_0x2725e7['push'](_0x2725e7['shift']());}};_0x2f382c(++_0x12b278);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xe706[_0x2c1114];return _0x2b877c;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x46860c,_0x138ca1){var _0x276652=function(_0x42312d){while(--_0x42312d){_0x46860c['push'](_0x46860c['shift']());}};_0x276652(++_0x138ca1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xcb91[_0x421196];return _0x2738af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 74e0ffb..c551200 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 _0x2949=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x43b45e,_0x5b27c5){var _0x1e94c0=function(_0x2939d2){while(--_0x2939d2){_0x43b45e['push'](_0x43b45e['shift']());}};_0x1e94c0(++_0x5b27c5);}(_0x2949,0x161));var _0x9294=function(_0x27f616,_0xf48a6d){_0x27f616=_0x27f616-0x0;var _0x5ebae0=_0x2949[_0x27f616];return _0x5ebae0;};'use strict';function Campaign(_0x32ddd8){this['id']=_0x32ddd8['id']||0x0;this[_0x9294('0x0')]=_0x32ddd8[_0x9294('0x0')]||'';this[_0x9294('0x1')]=_0x32ddd8[_0x9294('0x1')]||_0x9294('0x2');this[_0x9294('0x3')]=0x0;this[_0x9294('0x4')]=0x0;this[_0x9294('0x5')]=0x0;this[_0x9294('0x6')]=0x0;this[_0x9294('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x9294('0x8')]=_0x32ddd8[_0x9294('0x8')];this[_0x9294('0x9')]=_0x32ddd8[_0x9294('0x9')];this['dialTimezone']=_0x32ddd8['dialTimezone']||null;this[_0x9294('0xa')]=_0x32ddd8[_0x9294('0xa')]?_0x32ddd8[_0x9294('0xa')]:null;this[_0x9294('0xb')]=_0x32ddd8['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x32ddd8['dialOriginateCallerIdNumber'];this[_0x9294('0xc')]=_0x32ddd8[_0x9294('0xc')]||0x1e;this[_0x9294('0xd')]=_0x32ddd8[_0x9294('0xd')];this[_0x9294('0xe')]=_0x32ddd8['dialCongestionRetryFrequency'];this[_0x9294('0xf')]=_0x32ddd8['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x32ddd8[_0x9294('0x10')];this[_0x9294('0x11')]=_0x32ddd8[_0x9294('0x11')];this['dialNoAnswerRetryFrequency']=_0x32ddd8['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x32ddd8[_0x9294('0x12')];this[_0x9294('0x13')]=_0x32ddd8[_0x9294('0x13')]||0x3;this[_0x9294('0x14')]=_0x32ddd8['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9294('0x15')]=_0x32ddd8[_0x9294('0x15')]||0x3;this['dialDropRetryFrequency']=_0x32ddd8[_0x9294('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x32ddd8[_0x9294('0x17')]||0x3;this[_0x9294('0x18')]=_0x32ddd8[_0x9294('0x18')]||0x96;this[_0x9294('0x19')]=_0x32ddd8['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x32ddd8[_0x9294('0x1a')]||0x96;this[_0x9294('0x1b')]=_0x32ddd8[_0x9294('0x1b')]||0x3;this[_0x9294('0x1c')]=_0x32ddd8[_0x9294('0x1c')]||0x96;this[_0x9294('0x1d')]=_0x32ddd8[_0x9294('0x1d')]||_0x9294('0x1e');this[_0x9294('0x1f')]=_0x32ddd8[_0x9294('0x1f')]||undefined;this[_0x9294('0x20')]=_0x32ddd8['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9294('0x21')]=_0x32ddd8[_0x9294('0x21')]||undefined;this['TrunkBackup']=_0x32ddd8[_0x9294('0x22')]?_0x32ddd8[_0x9294('0x22')]:undefined;this[_0x9294('0x23')]=_0x32ddd8[_0x9294('0x23')]?_0x32ddd8[_0x9294('0x23')]:undefined;this['Interval']=_0x32ddd8['Interval']?_0x32ddd8['Interval']:undefined;this['SquareProject']=_0x32ddd8[_0x9294('0x24')]?_0x32ddd8['SquareProject']:undefined;this[_0x9294('0x25')]=_0x32ddd8[_0x9294('0x24')]?_0x32ddd8[_0x9294('0x24')][_0x9294('0x0')]:undefined;this['dialAMDActive']=_0x32ddd8[_0x9294('0x26')]||![];this['dialAMDInitialSilence']=_0x32ddd8[_0x9294('0x27')];this[_0x9294('0x28')]=_0x32ddd8[_0x9294('0x28')];this[_0x9294('0x29')]=_0x32ddd8['dialAMDAfterGreetingSilence'];this[_0x9294('0x2a')]=_0x32ddd8[_0x9294('0x2a')];this[_0x9294('0x2b')]=_0x32ddd8['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x32ddd8[_0x9294('0x2c')];this[_0x9294('0x2d')]=_0x32ddd8[_0x9294('0x2d')];this[_0x9294('0x2e')]=_0x32ddd8['dialAMDSilenceThreshold'];this[_0x9294('0x2f')]=_0x32ddd8[_0x9294('0x2f')];}module[_0x9294('0x30')]=Campaign; \ No newline at end of file +var _0x7942=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x37cda9,_0x10843c){var _0x4d70fa=function(_0x46f82c){while(--_0x46f82c){_0x37cda9['push'](_0x37cda9['shift']());}};_0x4d70fa(++_0x10843c);}(_0x7942,0x1e8));var _0x2794=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7942[_0x57b54c];return _0x59cc19;};'use strict';function Campaign(_0xf96fe5){this['id']=_0xf96fe5['id']||0x0;this[_0x2794('0x0')]=_0xf96fe5['name']||'';this[_0x2794('0x1')]=_0xf96fe5['type']||_0x2794('0x2');this[_0x2794('0x3')]=0x0;this[_0x2794('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x2794('0x5')]=0x0;this[_0x2794('0x6')]='';this[_0x2794('0x7')]=!![];this['active']=_0xf96fe5[_0x2794('0x8')];this['limitCalls']=_0xf96fe5['limitCalls'];this[_0x2794('0x9')]=_0xf96fe5['dialTimezone']||null;this[_0x2794('0xa')]=_0xf96fe5[_0x2794('0xa')]?_0xf96fe5[_0x2794('0xa')]:null;this[_0x2794('0xb')]=_0xf96fe5[_0x2794('0xb')];this[_0x2794('0xc')]=_0xf96fe5['dialOriginateCallerIdNumber'];this[_0x2794('0xd')]=_0xf96fe5[_0x2794('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0xf96fe5[_0x2794('0xe')];this[_0x2794('0xf')]=_0xf96fe5[_0x2794('0xf')];this['dialBusyMaxRetry']=_0xf96fe5[_0x2794('0x10')];this[_0x2794('0x11')]=_0xf96fe5[_0x2794('0x11')];this['dialNoAnswerMaxRetry']=_0xf96fe5[_0x2794('0x12')];this['dialNoAnswerRetryFrequency']=_0xf96fe5[_0x2794('0x13')];this[_0x2794('0x14')]=_0xf96fe5[_0x2794('0x14')];this[_0x2794('0x15')]=_0xf96fe5[_0x2794('0x15')]||0x3;this[_0x2794('0x16')]=_0xf96fe5[_0x2794('0x16')]||0x96;this[_0x2794('0x17')]=_0xf96fe5[_0x2794('0x17')]||0x3;this[_0x2794('0x18')]=_0xf96fe5['dialDropRetryFrequency']||0x96;this[_0x2794('0x19')]=_0xf96fe5['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0xf96fe5['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0xf96fe5['dialMachineMaxRetry']||0x3;this[_0x2794('0x1a')]=_0xf96fe5[_0x2794('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0xf96fe5[_0x2794('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0xf96fe5[_0x2794('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0xf96fe5[_0x2794('0x1d')]||'DESC';this['dialPrefix']=_0xf96fe5[_0x2794('0x1e')]||undefined;this[_0x2794('0x1f')]=_0xf96fe5[_0x2794('0x1f')]||undefined;this['dialCutDigit']=_0xf96fe5[_0x2794('0x20')]||undefined;this[_0x2794('0x21')]=_0xf96fe5[_0x2794('0x21')]?_0xf96fe5[_0x2794('0x21')]:undefined;this[_0x2794('0x22')]=_0xf96fe5[_0x2794('0x22')]?_0xf96fe5[_0x2794('0x22')]:undefined;this[_0x2794('0x23')]=_0xf96fe5[_0x2794('0x23')]?_0xf96fe5['Interval']:undefined;this[_0x2794('0x24')]=_0xf96fe5[_0x2794('0x24')]?_0xf96fe5[_0x2794('0x24')]:undefined;this[_0x2794('0x25')]=_0xf96fe5['SquareProject']?_0xf96fe5[_0x2794('0x24')][_0x2794('0x0')]:undefined;this['dialAMDActive']=_0xf96fe5[_0x2794('0x26')]||![];this[_0x2794('0x27')]=_0xf96fe5[_0x2794('0x27')];this[_0x2794('0x28')]=_0xf96fe5[_0x2794('0x28')];this[_0x2794('0x29')]=_0xf96fe5[_0x2794('0x29')];this[_0x2794('0x2a')]=_0xf96fe5[_0x2794('0x2a')];this[_0x2794('0x2b')]=_0xf96fe5[_0x2794('0x2b')];this['dialAMDBetweenWordsSilence']=_0xf96fe5[_0x2794('0x2c')];this[_0x2794('0x2d')]=_0xf96fe5[_0x2794('0x2d')];this[_0x2794('0x2e')]=_0xf96fe5[_0x2794('0x2e')];this[_0x2794('0x2f')]=_0xf96fe5[_0x2794('0x2f')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b2bbe68..8a2f5ff 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 _0x3222=['uniqueid','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','type','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x39d908,_0x33971a){var _0x44d307=function(_0x4962ba){while(--_0x4962ba){_0x39d908['push'](_0x39d908['shift']());}};_0x44d307(++_0x33971a);}(_0x3222,0xe1));var _0x2322=function(_0xf869e4,_0x132bb3){_0xf869e4=_0xf869e4-0x0;var _0x206929=_0x3222[_0xf869e4];return _0x206929;};'use strict';function Channel(){this[_0x2322('0x0')]=null;this[_0x2322('0x1')]='';this[_0x2322('0x2')]='';this[_0x2322('0x3')]=0x0;this[_0x2322('0x4')]='';this[_0x2322('0x5')]=undefined;this[_0x2322('0x6')]=undefined;this[_0x2322('0x7')]=0x0;this[_0x2322('0x8')]='';this[_0x2322('0x9')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x2322('0xa')]=![];this[_0x2322('0xb')]=null;this[_0x2322('0xc')]=null;this['unmanaged']=![];this[_0x2322('0xd')]=![];this[_0x2322('0xe')]='';this[_0x2322('0xf')]='';this[_0x2322('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x2322('0x11')]=null;this['tag']=null;this[_0x2322('0x12')]=null;this['monitor']=![];this[_0x2322('0x13')]=null;this['queue']=null;this[_0x2322('0x14')]=[];this[_0x2322('0x15')]=undefined;this[_0x2322('0x16')]=undefined;this[_0x2322('0x17')]=undefined;this[_0x2322('0x18')]=0x0;}module[_0x2322('0x19')]=Channel; \ No newline at end of file +var _0x8710=['connectedlinenum','accountcode','context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum','calleridname'];(function(_0x53155a,_0x155807){var _0x417b00=function(_0x5ae2b8){while(--_0x5ae2b8){_0x53155a['push'](_0x53155a['shift']());}};_0x417b00(++_0x155807);}(_0x8710,0x68));var _0x0871=function(_0x1e9f42,_0x28173a){_0x1e9f42=_0x1e9f42-0x0;var _0x5e76e0=_0x8710[_0x1e9f42];return _0x5e76e0;};'use strict';function Channel(){this[_0x0871('0x0')]=null;this[_0x0871('0x1')]='';this['destinationchannel']='';this[_0x0871('0x2')]=0x0;this[_0x0871('0x3')]='';this[_0x0871('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x0871('0x5')]=0x0;this[_0x0871('0x6')]='';this['uniqueid']=0x0;this[_0x0871('0x7')]=0x0;this['exten']=0x0;this[_0x0871('0x8')]=![];this[_0x0871('0x9')]=null;this[_0x0871('0xa')]=null;this[_0x0871('0xb')]=![];this[_0x0871('0xc')]=![];this[_0x0871('0xd')]='';this['lastdata']='';this[_0x0871('0xe')]=0x0;this[_0x0871('0xf')]=0x0;this[_0x0871('0x10')]=0x0;this[_0x0871('0x11')]=null;this[_0x0871('0x12')]=null;this['disposition']=null;this[_0x0871('0x13')]=![];this[_0x0871('0x14')]=null;this[_0x0871('0x15')]=null;this[_0x0871('0x16')]=[];this[_0x0871('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x0871('0x18')]=undefined;this[_0x0871('0x19')]=0x0;}module[_0x0871('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 223b8cc..3e5fa64 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 _0xeb33=['tokenSecret','type','serverUrl','exports','name','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x356196,_0x3f914d){var _0x26533e=function(_0x58b268){while(--_0x58b268){_0x356196['push'](_0x356196['shift']());}};_0x26533e(++_0x3f914d);}(_0xeb33,0x101));var _0x3eb3=function(_0x44b40d,_0x77aa74){_0x44b40d=_0x44b40d-0x0;var _0xe1b421=_0xeb33[_0x44b40d];return _0xe1b421;};'use strict';function DeskAccount(_0x566caa){this['id']=_0x566caa['id']||0x0;this['name']=_0x566caa[_0x3eb3('0x0')]||'';this['username']=_0x566caa['username']||'';this[_0x3eb3('0x1')]=_0x566caa[_0x3eb3('0x1')]||'';this[_0x3eb3('0x2')]=_0x566caa[_0x3eb3('0x2')]||'';this['password']=_0x566caa[_0x3eb3('0x3')]||'';this[_0x3eb3('0x4')]=_0x566caa['consumerKey']||'';this['consumerSecret']=_0x566caa[_0x3eb3('0x5')]||'';this[_0x3eb3('0x6')]=_0x566caa[_0x3eb3('0x6')]||'';this[_0x3eb3('0x7')]=_0x566caa[_0x3eb3('0x7')]||'';this[_0x3eb3('0x8')]=_0x566caa[_0x3eb3('0x8')]||'';this['serverUrl']=_0x566caa[_0x3eb3('0x9')]||'';this['Configurations']=_0x566caa['Configurations']||{};}module[_0x3eb3('0xa')]=DeskAccount; \ No newline at end of file +var _0xafa3=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0xc5094a,_0x590bb2){var _0x362e69=function(_0x4c76ba){while(--_0x4c76ba){_0xc5094a['push'](_0xc5094a['shift']());}};_0x362e69(++_0x590bb2);}(_0xafa3,0x189));var _0x3afa=function(_0x1f1cc7,_0x26f365){_0x1f1cc7=_0x1f1cc7-0x0;var _0x5f49e9=_0xafa3[_0x1f1cc7];return _0x5f49e9;};'use strict';function DeskAccount(_0x570d5){this['id']=_0x570d5['id']||0x0;this[_0x3afa('0x0')]=_0x570d5['name']||'';this[_0x3afa('0x1')]=_0x570d5[_0x3afa('0x1')]||'';this[_0x3afa('0x2')]=_0x570d5['remoteUri']||'';this[_0x3afa('0x3')]=_0x570d5[_0x3afa('0x3')]||'';this[_0x3afa('0x4')]=_0x570d5[_0x3afa('0x4')]||'';this['consumerKey']=_0x570d5[_0x3afa('0x5')]||'';this['consumerSecret']=_0x570d5[_0x3afa('0x6')]||'';this[_0x3afa('0x7')]=_0x570d5[_0x3afa('0x7')]||'';this['tokenSecret']=_0x570d5[_0x3afa('0x8')]||'';this[_0x3afa('0x9')]=_0x570d5['type']||'';this['serverUrl']=_0x570d5[_0x3afa('0xa')]||'';this[_0x3afa('0xb')]=_0x570d5[_0x3afa('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 c53e743..bfebbe0 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 _0x598c=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x598c,0x83));var _0xc598=function(_0x45ce95,_0x455572){_0x45ce95=_0x45ce95-0x0;var _0x36ac41=_0x598c[_0x45ce95];return _0x36ac41;};'use strict';function Dynamics365Account(_0x1f41ff){this['id']=_0x1f41ff['id']||0x0;this[_0xc598('0x0')]=_0x1f41ff['name']||'';this[_0xc598('0x1')]=_0x1f41ff[_0xc598('0x1')]||'';this['password']=_0x1f41ff[_0xc598('0x2')]||'';this[_0xc598('0x3')]=_0x1f41ff[_0xc598('0x3')]||'';this[_0xc598('0x4')]=_0x1f41ff[_0xc598('0x4')]||'';this[_0xc598('0x5')]=_0x1f41ff[_0xc598('0x5')]||'';this[_0xc598('0x6')]=_0x1f41ff['clientSecret']||{};this['serverUrl']=_0x1f41ff[_0xc598('0x7')]||'';this[_0xc598('0x8')]=_0x1f41ff['modernAuthentication']||![];this[_0xc598('0x9')]=_0x1f41ff[_0xc598('0x9')]||{};this[_0xc598('0xa')]=_0x1f41ff['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xeccd=['exports','name','username','password','remoteUri','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xeccd,0x1e5));var _0xdecc=function(_0x8438c6,_0x126a34){_0x8438c6=_0x8438c6-0x0;var _0x2849e0=_0xeccd[_0x8438c6];return _0x2849e0;};'use strict';function Dynamics365Account(_0x83fd01){this['id']=_0x83fd01['id']||0x0;this['name']=_0x83fd01[_0xdecc('0x0')]||'';this[_0xdecc('0x1')]=_0x83fd01[_0xdecc('0x1')]||'';this[_0xdecc('0x2')]=_0x83fd01[_0xdecc('0x2')]||'';this['remoteUri']=_0x83fd01[_0xdecc('0x3')]||'';this['tenantId']=_0x83fd01['tenantId']||'';this[_0xdecc('0x4')]=_0x83fd01[_0xdecc('0x4')]||'';this['clientSecret']=_0x83fd01[_0xdecc('0x5')]||{};this[_0xdecc('0x6')]=_0x83fd01['serverUrl']||'';this['modernAuthentication']=_0x83fd01[_0xdecc('0x7')]||![];this[_0xdecc('0x8')]=_0x83fd01[_0xdecc('0x8')]||{};this[_0xdecc('0x9')]=_0x83fd01[_0xdecc('0x9')]||{};}module[_0xdecc('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index c2db7c2..bfdc70f 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 _0x4bb3=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x4bb3,0xc2));var _0x34bb=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x4bb3[_0x587dd0];return _0x56f153;};'use strict';function FaxAccount(_0x5cb898){this['id']=_0x5cb898['id']||0x0;this[_0x34bb('0x0')]=_0x5cb898[_0x34bb('0x0')]||'';this['description']=_0x5cb898[_0x34bb('0x1')];this[_0x34bb('0x2')]=_0x5cb898[_0x34bb('0x2')];this[_0x34bb('0x3')]=_0x5cb898['headerinfo'];this[_0x34bb('0x4')]=_0x5cb898[_0x34bb('0x4')];this[_0x34bb('0x5')]=_0x5cb898[_0x34bb('0x5')]||0x960;this[_0x34bb('0x6')]=_0x5cb898[_0x34bb('0x6')]||0x3840;this['modem']=_0x5cb898[_0x34bb('0x7')]||_0x34bb('0x8');this[_0x34bb('0x9')]=_0x5cb898[_0x34bb('0x9')]||'no';this[_0x34bb('0xa')]=_0x5cb898[_0x34bb('0xa')]||'no';this[_0x34bb('0xb')]=_0x5cb898[_0x34bb('0xb')]||0x1388;this[_0x34bb('0xc')]=_0x5cb898['tech']||_0x34bb('0xd');this[_0x34bb('0xe')]=_0x5cb898['Trunk']?_0x5cb898['Trunk']:undefined;this[_0x34bb('0xf')]=_0x5cb898[_0x34bb('0xf')];this[_0x34bb('0x10')]=_0x5cb898[_0x34bb('0x10')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xe3ef=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','tech'];(function(_0x47eadf,_0x3ce589){var _0x137585=function(_0x39088b){while(--_0x39088b){_0x47eadf['push'](_0x47eadf['shift']());}};_0x137585(++_0x3ce589);}(_0xe3ef,0x65));var _0xfe3e=function(_0x5da446,_0x53ff5c){_0x5da446=_0x5da446-0x0;var _0x284f7e=_0xe3ef[_0x5da446];return _0x284f7e;};'use strict';function FaxAccount(_0x382e5f){this['id']=_0x382e5f['id']||0x0;this[_0xfe3e('0x0')]=_0x382e5f['name']||'';this[_0xfe3e('0x1')]=_0x382e5f[_0xfe3e('0x1')];this[_0xfe3e('0x2')]=_0x382e5f[_0xfe3e('0x2')];this[_0xfe3e('0x3')]=_0x382e5f[_0xfe3e('0x3')];this[_0xfe3e('0x4')]=_0x382e5f[_0xfe3e('0x4')];this[_0xfe3e('0x5')]=_0x382e5f[_0xfe3e('0x5')]||0x960;this[_0xfe3e('0x6')]=_0x382e5f[_0xfe3e('0x6')]||0x3840;this[_0xfe3e('0x7')]=_0x382e5f['modem']||'v17,v27,v29';this['gateway']=_0x382e5f['gateway']||'no';this[_0xfe3e('0x8')]=_0x382e5f[_0xfe3e('0x8')]||'no';this['t38timeout']=_0x382e5f[_0xfe3e('0x9')]||0x1388;this[_0xfe3e('0xa')]=_0x382e5f[_0xfe3e('0xa')]||_0xfe3e('0xb');this[_0xfe3e('0xc')]=_0x382e5f[_0xfe3e('0xc')]?_0x382e5f[_0xfe3e('0xc')]:undefined;this[_0xfe3e('0xd')]=_0x382e5f[_0xfe3e('0xd')];this[_0xfe3e('0xe')]=_0x382e5f['key'];}module[_0xfe3e('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 510aecb..9cd9b7c 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 _0xc9f8=['Configurations','name','username','token','remoteUri','serverUrl'];(function(_0x46a40b,_0x435c9a){var _0x283733=function(_0x83f6fd){while(--_0x83f6fd){_0x46a40b['push'](_0x46a40b['shift']());}};_0x283733(++_0x435c9a);}(_0xc9f8,0x13f));var _0x8c9f=function(_0x3ebc58,_0x4d2749){_0x3ebc58=_0x3ebc58-0x0;var _0x5b5d69=_0xc9f8[_0x3ebc58];return _0x5b5d69;};'use strict';function FreshdeskAccount(_0x2515ed){this['id']=_0x2515ed['id']||0x0;this['name']=_0x2515ed[_0x8c9f('0x0')]||'';this[_0x8c9f('0x1')]=_0x2515ed[_0x8c9f('0x1')]||'';this['apiKey']=_0x2515ed[_0x8c9f('0x2')]||'';this[_0x8c9f('0x3')]=_0x2515ed[_0x8c9f('0x3')]||'';this[_0x8c9f('0x4')]=_0x2515ed[_0x8c9f('0x4')]||'';this[_0x8c9f('0x5')]=_0x2515ed[_0x8c9f('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x1cda=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x415004,_0x22909f){var _0x3f829f=function(_0x21e590){while(--_0x21e590){_0x415004['push'](_0x415004['shift']());}};_0x3f829f(++_0x22909f);}(_0x1cda,0x16a));var _0xa1cd=function(_0x5ee739,_0x597678){_0x5ee739=_0x5ee739-0x0;var _0x491bea=_0x1cda[_0x5ee739];return _0x491bea;};'use strict';function FreshdeskAccount(_0x445285){this['id']=_0x445285['id']||0x0;this['name']=_0x445285[_0xa1cd('0x0')]||'';this[_0xa1cd('0x1')]=_0x445285[_0xa1cd('0x1')]||'';this[_0xa1cd('0x2')]=_0x445285[_0xa1cd('0x3')]||'';this[_0xa1cd('0x4')]=_0x445285[_0xa1cd('0x4')]||'';this['serverUrl']=_0x445285[_0xa1cd('0x5')]||'';this[_0xa1cd('0x6')]=_0x445285[_0xa1cd('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 2a2a605..e2680e4 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 _0xfd6e=['name','username','apiKey','serverUrl','Configurations','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';function FreshsalesAccount(_0x501204){this['id']=_0x501204['id']||0x0;this['name']=_0x501204[_0xefd6('0x0')]||'';this['username']=_0x501204[_0xefd6('0x1')]||'';this[_0xefd6('0x2')]=_0x501204['token']||'';this['remoteUri']=_0x501204['remoteUri']||'';this[_0xefd6('0x3')]=_0x501204['serverUrl']||'';this['Configurations']=_0x501204[_0xefd6('0x4')]||{};}module[_0xefd6('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x8c32=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x335d2d,_0x26e065){var _0x379073=function(_0x51f553){while(--_0x51f553){_0x335d2d['push'](_0x335d2d['shift']());}};_0x379073(++_0x26e065);}(_0x8c32,0x130));var _0x28c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c32[_0x321bb2];return _0x9c12ed;};'use strict';function FreshsalesAccount(_0xc29edf){this['id']=_0xc29edf['id']||0x0;this[_0x28c3('0x0')]=_0xc29edf[_0x28c3('0x0')]||'';this[_0x28c3('0x1')]=_0xc29edf[_0x28c3('0x1')]||'';this[_0x28c3('0x2')]=_0xc29edf[_0x28c3('0x3')]||'';this[_0x28c3('0x4')]=_0xc29edf[_0x28c3('0x4')]||'';this[_0x28c3('0x5')]=_0xc29edf[_0x28c3('0x5')]||'';this[_0x28c3('0x6')]=_0xc29edf['Configurations']||{};}module[_0x28c3('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index b079035..a7cf31b 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 _0x0f3a=['exports','inbound','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','priority','holdtime','assigned','lastAssignedTo','motionChannel','mohtime'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0f3a,0x177));var _0xa0f3=function(_0x3de7e5,_0x52212e){_0x3de7e5=_0x3de7e5-0x0;var _0x1d3683=_0x0f3a[_0x3de7e5];return _0x1d3683;};'use strict';function QueueReport(){this['type']=_0xa0f3('0x0');this['uniqueid']='';this[_0xa0f3('0x1')]='';this['calleridname']='';this[_0xa0f3('0x2')]='';this[_0xa0f3('0x3')]=null;this['queuecallerleaveAt']=null;this[_0xa0f3('0x4')]=0x1;this[_0xa0f3('0x5')]=0x1;this[_0xa0f3('0x6')]=![];this[_0xa0f3('0x7')]=null;this[_0xa0f3('0x8')]=![];this[_0xa0f3('0x9')]=null;this[_0xa0f3('0xa')]=![];this[_0xa0f3('0xb')]=null;this[_0xa0f3('0xc')]=0x1;this['channel']='';this[_0xa0f3('0xd')]='';this[_0xa0f3('0xe')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0xa0f3('0xf')]='';this[_0xa0f3('0x10')]=0x0;this[_0xa0f3('0x11')]=![];this[_0xa0f3('0x12')]='';this[_0xa0f3('0x13')]='voice';this[_0xa0f3('0x14')]=0x0;this['variables']={};}module[_0xa0f3('0x15')]=QueueReport; \ No newline at end of file +var _0xef3a=['mohtime','variables','exports','type','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel'];(function(_0x244a42,_0x3fe9f6){var _0x4bd428=function(_0x251339){while(--_0x251339){_0x244a42['push'](_0x244a42['shift']());}};_0x4bd428(++_0x3fe9f6);}(_0xef3a,0x153));var _0xaef3=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xef3a[_0x152678];return _0x311a9;};'use strict';function QueueReport(){this[_0xaef3('0x0')]='inbound';this['uniqueid']='';this[_0xaef3('0x1')]='';this['calleridname']='';this[_0xaef3('0x2')]='';this[_0xaef3('0x3')]=null;this[_0xaef3('0x4')]=null;this[_0xaef3('0x5')]=0x1;this[_0xaef3('0x6')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xaef3('0x7')]=![];this['queuecallercompleteAt']=null;this[_0xaef3('0x8')]=![];this[_0xaef3('0x9')]=null;this[_0xaef3('0xa')]=0x1;this['channel']='';this[_0xaef3('0xb')]='';this[_0xaef3('0xc')]='';this[_0xaef3('0xd')]='';this[_0xaef3('0xe')]='';this[_0xaef3('0xf')]='';this[_0xaef3('0x10')]='';this[_0xaef3('0x11')]=0x0;this[_0xaef3('0x12')]=![];this[_0xaef3('0x13')]='';this[_0xaef3('0x14')]='voice';this[_0xaef3('0x15')]=0x0;this[_0xaef3('0x16')]={};}module[_0xaef3('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index fb459cd..c026a3d 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 _0x9931=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','exports','name','username'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9931,0x1b6));var _0x1993=function(_0x2b771e,_0x3bbe3e){_0x2b771e=_0x2b771e-0x0;var _0x39add7=_0x9931[_0x2b771e];return _0x39add7;};'use strict';function SalesforceAccount(_0xa53aca){this['id']=_0xa53aca['id']||0x0;this[_0x1993('0x0')]=_0xa53aca['name']||'';this[_0x1993('0x1')]=_0xa53aca[_0x1993('0x1')]||'';this[_0x1993('0x2')]=_0xa53aca[_0x1993('0x2')]||'';this[_0x1993('0x3')]=_0xa53aca[_0x1993('0x3')]||'';this[_0x1993('0x4')]=_0xa53aca[_0x1993('0x4')]||'';this[_0x1993('0x5')]=_0xa53aca[_0x1993('0x5')]||'';this[_0x1993('0x6')]=_0xa53aca[_0x1993('0x6')]||'';this[_0x1993('0x7')]=_0xa53aca[_0x1993('0x7')]||_0x1993('0x8');this[_0x1993('0x9')]=_0xa53aca[_0x1993('0x9')]||'';this['Configurations']=_0xa53aca['Configurations']||{};}module[_0x1993('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x4818=['serverUrl','Configurations','username','remoteUri','password','clientId','securityToken','type','integrationTab'];(function(_0x29bc5e,_0x3a5c7b){var _0x57cfc2=function(_0x49ae25){while(--_0x49ae25){_0x29bc5e['push'](_0x29bc5e['shift']());}};_0x57cfc2(++_0x3a5c7b);}(_0x4818,0xc8));var _0x8481=function(_0x2e9fb5,_0x124883){_0x2e9fb5=_0x2e9fb5-0x0;var _0x1e4c0b=_0x4818[_0x2e9fb5];return _0x1e4c0b;};'use strict';function SalesforceAccount(_0x1d931c){this['id']=_0x1d931c['id']||0x0;this['name']=_0x1d931c['name']||'';this[_0x8481('0x0')]=_0x1d931c['username']||'';this[_0x8481('0x1')]=_0x1d931c['remoteUri']||'';this['password']=_0x1d931c[_0x8481('0x2')]||'';this[_0x8481('0x3')]=_0x1d931c[_0x8481('0x3')]||'';this['clientSecret']=_0x1d931c['clientSecret']||'';this['securityToken']=_0x1d931c[_0x8481('0x4')]||'';this[_0x8481('0x5')]=_0x1d931c[_0x8481('0x5')]||_0x8481('0x6');this['serverUrl']=_0x1d931c[_0x8481('0x7')]||'';this[_0x8481('0x8')]=_0x1d931c[_0x8481('0x8')]||{};}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 b942008..a48e3c6 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 _0xb73a=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x8230ee,_0xa65339){var _0x45cd7=function(_0x2af977){while(--_0x2af977){_0x8230ee['push'](_0x8230ee['shift']());}};_0x45cd7(++_0xa65339);}(_0xb73a,0x1e8));var _0xab73=function(_0x3b39ce,_0x1fc022){_0x3b39ce=_0x3b39ce-0x0;var _0x3cdd22=_0xb73a[_0x3b39ce];return _0x3cdd22;};'use strict';function ServicenowAccount(_0x22f76f){this['id']=_0x22f76f['id']||0x0;this[_0xab73('0x0')]=_0x22f76f[_0xab73('0x0')]||'';this['username']=_0x22f76f[_0xab73('0x1')]||'';this['password']=_0x22f76f[_0xab73('0x2')]||'';this[_0xab73('0x3')]=_0x22f76f[_0xab73('0x3')]||'';this[_0xab73('0x4')]=_0x22f76f['serverUrl']||'';this['Configurations']=_0x22f76f[_0xab73('0x5')]||{};}module[_0xab73('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x1a06=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3e9155,_0x38e9d2){var _0x5de67a=function(_0x177031){while(--_0x177031){_0x3e9155['push'](_0x3e9155['shift']());}};_0x5de67a(++_0x38e9d2);}(_0x1a06,0x1d7));var _0x61a0=function(_0x2765f4,_0x2e82a4){_0x2765f4=_0x2765f4-0x0;var _0x4c3d54=_0x1a06[_0x2765f4];return _0x4c3d54;};'use strict';function ServicenowAccount(_0x829e21){this['id']=_0x829e21['id']||0x0;this[_0x61a0('0x0')]=_0x829e21['name']||'';this[_0x61a0('0x1')]=_0x829e21[_0x61a0('0x1')]||'';this['password']=_0x829e21['password']||'';this[_0x61a0('0x2')]=_0x829e21[_0x61a0('0x2')]||'';this[_0x61a0('0x3')]=_0x829e21[_0x61a0('0x3')]||'';this['Configurations']=_0x829e21[_0x61a0('0x4')]||{};}module[_0x61a0('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 72a1757..a08d093 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 _0x431a=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x3a768e,_0x2c981d){var _0x5c42af=function(_0x440beb){while(--_0x440beb){_0x3a768e['push'](_0x3a768e['shift']());}};_0x5c42af(++_0x2c981d);}(_0x431a,0x1e3));var _0xa431=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x431a[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x55736d){this['id']=_0x55736d['id']||0x0;this[_0xa431('0x0')]=_0x55736d[_0xa431('0x0')]||'';this['username']=_0x55736d[_0xa431('0x1')]||'';this[_0xa431('0x2')]=_0x55736d[_0xa431('0x2')]||'';this[_0xa431('0x3')]=_0x55736d[_0xa431('0x3')]||'';this[_0xa431('0x4')]=_0x55736d[_0xa431('0x4')]||'';this[_0xa431('0x5')]=_0x55736d[_0xa431('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x0c0d=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x40b0f,_0x3783e5){var _0x39a923=function(_0x1464b7){while(--_0x1464b7){_0x40b0f['push'](_0x40b0f['shift']());}};_0x39a923(++_0x3783e5);}(_0x0c0d,0x1b4));var _0xd0c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0c0d[_0x2dafbe];return _0x58a45a;};'use strict';function SugarcrmAccount(_0x2ed6c5){this['id']=_0x2ed6c5['id']||0x0;this[_0xd0c0('0x0')]=_0x2ed6c5[_0xd0c0('0x0')]||'';this['username']=_0x2ed6c5['username']||'';this['password']=_0x2ed6c5[_0xd0c0('0x1')]||'';this[_0xd0c0('0x2')]=_0x2ed6c5[_0xd0c0('0x2')]||'';this[_0xd0c0('0x3')]=_0x2ed6c5[_0xd0c0('0x3')]||'';this['Configurations']=_0x2ed6c5[_0xd0c0('0x4')]||{};}module[_0xd0c0('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 836d5bf..528e48d 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 _0xf4f5=['stateTime','status','unknown','address','name','accountcode','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f5,0x89));var _0x5f4f=function(_0x5634c0,_0x5dfad9){_0x5634c0=_0x5634c0-0x0;var _0x14851e=_0xf4f5[_0x5634c0];return _0x14851e;};'use strict';function Telephone(_0x23a7ea){this['id']=_0x23a7ea['id']||0x0;this[_0x5f4f('0x0')]=_0x23a7ea['name']||'';this[_0x5f4f('0x1')]=_0x23a7ea['accountcode']||'';this[_0x5f4f('0x2')]='unknown';this[_0x5f4f('0x3')]=0x0;this[_0x5f4f('0x4')]=_0x5f4f('0x5');this[_0x5f4f('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xcbe1=['stateTime','exports','name','unknown'];(function(_0x27a7b5,_0x1db0d4){var _0xfb725=function(_0xf85fca){while(--_0xf85fca){_0x27a7b5['push'](_0x27a7b5['shift']());}};_0xfb725(++_0x1db0d4);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x28a6ad,_0x351697){_0x28a6ad=_0x28a6ad-0x0;var _0xbb804=_0xcbe1[_0x28a6ad];return _0xbb804;};'use strict';function Telephone(_0x3b3df4){this['id']=_0x3b3df4['id']||0x0;this[_0x1cbe('0x0')]=_0x3b3df4['name']||'';this['accountcode']=_0x3b3df4['accountcode']||'';this['state']=_0x1cbe('0x1');this[_0x1cbe('0x2')]=0x0;this['status']=_0x1cbe('0x1');this['address']='';}module[_0x1cbe('0x3')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 50d662f..10892ba 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 _0xa9e0=['exports','name'];(function(_0x44c460,_0x43fb19){var _0x49eb28=function(_0xb8cb57){while(--_0xb8cb57){_0x44c460['push'](_0x44c460['shift']());}};_0x49eb28(++_0x43fb19);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2b6799,_0x3ec736){var _0x6af655=function(_0x3b4d0e){while(--_0x3b4d0e){_0x2b6799['push'](_0x2b6799['shift']());}};_0x6af655(++_0x3ec736);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 804db24..087ca18 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6bb814,_0x17196b){_0x6bb814=_0x6bb814-0x0;var _0x3c4bf6=_0x5eb8[_0x6bb814];return _0x3c4bf6;};'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 22a07f0..8d792de 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 _0x52f2=['address','defaultuser','active','name','state','status','unknown','registry','split','host','port','domainport','refresh','stateRegistry','registrationtime'];(function(_0x8e448c,_0x37a1a3){var _0x189909=function(_0x3db713){while(--_0x3db713){_0x8e448c['push'](_0x8e448c['shift']());}};_0x189909(++_0x37a1a3);}(_0x52f2,0x1d3));var _0x252f=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x52f2[_0x4ea69d];return _0x5318e0;};'use strict';function Trunk(_0x335f2a){this['id']=_0x335f2a['id']||0x0;this[_0x252f('0x0')]=_0x335f2a['active']||![];this['name']=_0x335f2a[_0x252f('0x1')]||'';this[_0x252f('0x2')]='unknown';this['stateTime']=0x0;this[_0x252f('0x3')]=_0x252f('0x4');this[_0x252f('0x5')]=_0x335f2a['registry']&&_0x335f2a[_0x252f('0x5')]['indexOf'](':')?_0x335f2a[_0x252f('0x5')][_0x252f('0x6')](':')[0x0]:'';this[_0x252f('0x7')]='';this[_0x252f('0x8')]='';this['domain']='';this[_0x252f('0x9')]='';this[_0x252f('0xa')]='';this[_0x252f('0xb')]=_0x252f('0x4');this[_0x252f('0xc')]='';this[_0x252f('0xd')]='';this[_0x252f('0xe')]=_0x335f2a[_0x252f('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x973a=['registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domainport','refresh','stateRegistry'];(function(_0x270382,_0x1db89d){var _0x5c384c=function(_0xca625){while(--_0xca625){_0x270382['push'](_0x270382['shift']());}};_0x5c384c(++_0x1db89d);}(_0x973a,0x146));var _0xa973=function(_0x20e07d,_0x5049cf){_0x20e07d=_0x20e07d-0x0;var _0xa5217=_0x973a[_0x20e07d];return _0xa5217;};'use strict';function Trunk(_0x388ddf){this['id']=_0x388ddf['id']||0x0;this[_0xa973('0x0')]=_0x388ddf['active']||![];this['name']=_0x388ddf[_0xa973('0x1')]||'';this[_0xa973('0x2')]=_0xa973('0x3');this[_0xa973('0x4')]=0x0;this[_0xa973('0x5')]='unknown';this[_0xa973('0x6')]=_0x388ddf[_0xa973('0x6')]&&_0x388ddf['registry'][_0xa973('0x7')](':')?_0x388ddf[_0xa973('0x6')][_0xa973('0x8')](':')[0x0]:'';this[_0xa973('0x9')]='';this[_0xa973('0xa')]='';this['domain']='';this[_0xa973('0xb')]='';this[_0xa973('0xc')]='';this[_0xa973('0xd')]=_0xa973('0x3');this[_0xa973('0xe')]='';this['address']='';this[_0xa973('0xf')]=_0x388ddf[_0xa973('0xf')]||'';}module[_0xa973('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0f6d315..c58648d 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 _0x510d=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x510d,0x1f1));var _0xd510=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x510d[_0x6c993a];return _0x27f547;};'use strict';function voiceExtension(_0x30df40){this['id']=_0x30df40['id']||0x0;this[_0xd510('0x0')]=_0x30df40[_0xd510('0x0')]||'';this[_0xd510('0x1')]=_0x30df40[_0xd510('0x1')]||_0xd510('0x2');this[_0xd510('0x3')]=_0x30df40['mandatoryDisposition']||![];}module[_0xd510('0x4')]=voiceExtension; \ No newline at end of file +var _0x18b0=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2ab350,_0x32859f){var _0x4acac=function(_0x58ddc6){while(--_0x58ddc6){_0x2ab350['push'](_0x2ab350['shift']());}};_0x4acac(++_0x32859f);}(_0x18b0,0xd2));var _0x018b=function(_0x424e51,_0x34be32){_0x424e51=_0x424e51-0x0;var _0x345c58=_0x18b0[_0x424e51];return _0x345c58;};'use strict';function voiceExtension(_0x17d77f){this['id']=_0x17d77f['id']||0x0;this[_0x018b('0x0')]=_0x17d77f['exten']||'';this[_0x018b('0x1')]=_0x17d77f[_0x018b('0x1')]||_0x018b('0x2');this[_0x018b('0x3')]=_0x17d77f[_0x018b('0x3')]||![];}module[_0x018b('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 6cb8368..394f703 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 _0x5cc3=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x118bf0,_0x53dd99){var _0x204345=function(_0x48706f){while(--_0x48706f){_0x118bf0['push'](_0x118bf0['shift']());}};_0x204345(++_0x53dd99);}(_0x5cc3,0x144));var _0x35cc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5cc3[_0x501510];return _0x1e6ee5;};'use strict';var statusDesc=[_0x35cc('0x0'),_0x35cc('0x1'),_0x35cc('0x2'),_0x35cc('0x3'),_0x35cc('0x4'),_0x35cc('0x5'),_0x35cc('0x6'),_0x35cc('0x7'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0x35cc('0x8'),'gsm':_0x35cc('0x9')};var strategy={'rrmemory':_0x35cc('0xa'),'roundrobin':_0x35cc('0xb')};function VoiceQueue(_0x40b600){this['id']=_0x40b600['id']||0x0;this[_0x35cc('0xc')]=_0x40b600[_0x35cc('0xc')]||'';this[_0x35cc('0xd')]=_0x40b600[_0x35cc('0xd')]||'';this[_0x35cc('0xe')]=_0x40b600[_0x35cc('0xe')]||_0x35cc('0xf');this[_0x35cc('0x10')]=0x0;this[_0x35cc('0x11')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x35cc('0x12')]=0x0;this[_0x35cc('0x13')]=0x0;this[_0x35cc('0x14')]=0x0;this[_0x35cc('0x15')]=0x0;this[_0x35cc('0x16')]=0x0;this['loggedIn']=0x0;this[_0x35cc('0x17')]=0x0;this['acw']=_0x40b600[_0x35cc('0x18')]||![];this[_0x35cc('0x19')]=_0x40b600[_0x35cc('0x19')]||0xa;this[_0x35cc('0x1a')]=_0x40b600[_0x35cc('0x1a')]||'no';this[_0x35cc('0x1b')]=!![];this[_0x35cc('0x1c')]='';this[_0x35cc('0x1d')]=0x0;this['temp']=0x0;this[_0x35cc('0x1e')]=_0x40b600['dialTimezone']||null;this[_0x35cc('0x1f')]=_0x40b600[_0x35cc('0x1f')]?_0x40b600[_0x35cc('0x1f')]:null;this[_0x35cc('0x20')]=_0x40b600[_0x35cc('0x20')];this[_0x35cc('0x21')]=_0x40b600[_0x35cc('0x21')]||_0x35cc('0x22');this[_0x35cc('0x23')]=_0x40b600[_0x35cc('0x23')]||0x0;this[_0x35cc('0x24')]=_0x40b600[_0x35cc('0x24')]||0x0;this['dialPowerLevel']=_0x40b600[_0x35cc('0x25')]||0x1;this[_0x35cc('0x26')]=_0x40b600['dialPredictiveOptimization']||_0x35cc('0x27');this[_0x35cc('0x28')]=_0x40b600['dialPredictiveOptimizationPercentage']||0.03;this[_0x35cc('0x29')]=_0x40b600[_0x35cc('0x29')]||0x258;this[_0x35cc('0x2a')]=_0x40b600['dialOriginateCallerIdName']||'anonymous';this[_0x35cc('0x2b')]=_0x40b600[_0x35cc('0x2b')]||'anonymous';this[_0x35cc('0x2c')]=_0x40b600[_0x35cc('0x2c')]||0x1e;this['dialQueueOptions']=_0x40b600[_0x35cc('0x2d')]||_0x35cc('0x2e');this[_0x35cc('0x2f')]=_0x40b600[_0x35cc('0x2f')]||0x3;this[_0x35cc('0x30')]=_0x40b600[_0x35cc('0x30')]||undefined;this[_0x35cc('0x31')]=_0x40b600[_0x35cc('0x31')]||0x3;this[_0x35cc('0x32')]=_0x40b600[_0x35cc('0x32')]||0x96;this[_0x35cc('0x33')]=_0x40b600['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x40b600['dialBusyRetryFrequency']||0x96;this[_0x35cc('0x34')]=_0x40b600[_0x35cc('0x34')]||0x3;this[_0x35cc('0x35')]=_0x40b600['dialNoAnswerRetryFrequency']||0x96;this[_0x35cc('0x36')]=_0x40b600[_0x35cc('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x40b600[_0x35cc('0x37')]||0x96;this[_0x35cc('0x38')]=_0x40b600['dialDropMaxRetry']||0x3;this[_0x35cc('0x39')]=_0x40b600['dialDropRetryFrequency']||0x96;this[_0x35cc('0x3a')]=_0x40b600[_0x35cc('0x3a')]||0x3;this[_0x35cc('0x3b')]=_0x40b600[_0x35cc('0x3b')]||0x96;this[_0x35cc('0x3c')]=_0x40b600[_0x35cc('0x3c')]||0x3;this['dialMachineRetryFrequency']=_0x40b600[_0x35cc('0x3d')]||0x96;this[_0x35cc('0x3e')]=_0x40b600[_0x35cc('0x3e')]||0x3;this[_0x35cc('0x3f')]=_0x40b600[_0x35cc('0x3f')]||0x96;this[_0x35cc('0x40')]=_0x40b600[_0x35cc('0x40')]||0x3;this[_0x35cc('0x41')]=_0x40b600[_0x35cc('0x41')]||0x4;this['Trunk']=_0x40b600[_0x35cc('0x42')]?_0x40b600['Trunk']:undefined;this['TrunkBackup']=_0x40b600[_0x35cc('0x43')]?_0x40b600['TrunkBackup']:undefined;this[_0x35cc('0x44')]=_0x40b600[_0x35cc('0x44')]||undefined;this[_0x35cc('0x45')]=_0x40b600['Interval']?_0x40b600[_0x35cc('0x45')]:undefined;this['dialOrderByScheduledAt']=_0x40b600[_0x35cc('0x46')]||_0x35cc('0x47');this[_0x35cc('0x48')]=_0x40b600['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x35cc('0x49')]=_0x40b600['dialCutDigit']||undefined;this['strategy']=strategy[_0x40b600['strategy']]||'rrmemory';this[_0x35cc('0x4a')]=!![];this[_0x35cc('0x4b')]=_0x40b600[_0x35cc('0x4b')]||![];this[_0x35cc('0x4c')]=_0x40b600['dialAMDInitialSilence'];this[_0x35cc('0x4d')]=_0x40b600[_0x35cc('0x4d')];this[_0x35cc('0x4e')]=_0x40b600[_0x35cc('0x4e')];this[_0x35cc('0x4f')]=_0x40b600[_0x35cc('0x4f')];this[_0x35cc('0x50')]=_0x40b600[_0x35cc('0x50')];this[_0x35cc('0x51')]=_0x40b600[_0x35cc('0x51')];this[_0x35cc('0x52')]=_0x40b600[_0x35cc('0x52')];this[_0x35cc('0x53')]=_0x40b600['dialAMDSilenceThreshold'];this[_0x35cc('0x54')]=_0x40b600[_0x35cc('0x54')];this[_0x35cc('0x55')]=0x0;this[_0x35cc('0x56')]=0x0;this[_0x35cc('0x57')]=_0x40b600[_0x35cc('0x57')];this[_0x35cc('0x58')]=0x0;this[_0x35cc('0x59')]=0x0;this[_0x35cc('0x5a')]=0x0;this[_0x35cc('0x5b')]=0x0;this[_0x35cc('0x5c')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x35cc('0x5d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x35cc('0x5e')]=0x0;this[_0x35cc('0x5f')]=0x0;this[_0x35cc('0x60')]=0x0;this[_0x35cc('0x61')]=0x0;this[_0x35cc('0x62')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x35cc('0x63')]=0x0;this[_0x35cc('0x64')]=0x0;this[_0x35cc('0x65')]=0x0;this[_0x35cc('0x66')]=0x0;this[_0x35cc('0x67')]=0x0;this[_0x35cc('0x68')]=0x0;this[_0x35cc('0x69')]=0x0;this[_0x35cc('0x6a')]=0x0;this[_0x35cc('0x6b')]=_0x40b600['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x40b600[_0x35cc('0x6c')]||0xa;this[_0x35cc('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x35cc('0x6e')]=0x0;this[_0x35cc('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x35cc('0x70')]=0x0;this['dialRecallMeTimeout']=_0x40b600['dialRecallMeTimeout']||0x1e;this[_0x35cc('0x71')]=_0x40b600[_0x35cc('0x71')]||![];this[_0x35cc('0x72')]=!!_0x40b600[_0x35cc('0x72')]||![];this[_0x35cc('0x73')]=!!_0x40b600[_0x35cc('0x73')]||![];this['dialQueueProject2']=_0x40b600[_0x35cc('0x74')]||undefined;this[_0x35cc('0x75')]=_0x40b600[_0x35cc('0x75')]||![];this[_0x35cc('0x76')]=_0x40b600['dialAgiAfterHangupAgent']||![];this[_0x35cc('0xd')]=monitorFormat[_0x40b600['monitor_format']]?monitorFormat[_0x40b600[_0x35cc('0xd')]]:undefined;this[_0x35cc('0x77')]=_0x40b600[_0x35cc('0x77')]||![];this[_0x35cc('0x78')]=_0x40b600[_0x35cc('0x78')]?_0x40b600[_0x35cc('0x78')]:undefined;}module[_0x35cc('0x79')]=VoiceQueue; \ No newline at end of file +var _0xb01e=['dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x163c3a,_0x1c6e3c){var _0x2962f4=function(_0x219596){while(--_0x219596){_0x163c3a['push'](_0x163c3a['shift']());}};_0x2962f4(++_0x1c6e3c);}(_0xb01e,0xb2));var _0xeb01=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb01e[_0x376b45];return _0x2341b3;};'use strict';var statusDesc=[_0xeb01('0x0'),'not_inuse','inuse',_0xeb01('0x1'),_0xeb01('0x2'),'unavailable',_0xeb01('0x3'),_0xeb01('0x4'),_0xeb01('0x5')];var monitorFormat={'wav':_0xeb01('0x6'),'wav49':'wav49','gsm':_0xeb01('0x7')};var strategy={'rrmemory':_0xeb01('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x55f1d6){this['id']=_0x55f1d6['id']||0x0;this[_0xeb01('0x9')]=_0x55f1d6[_0xeb01('0x9')]||'';this[_0xeb01('0xa')]=_0x55f1d6['monitor_format']||'';this[_0xeb01('0xb')]=_0x55f1d6['type']||_0xeb01('0xc');this[_0xeb01('0xd')]=0x0;this[_0xeb01('0xe')]=0x0;this[_0xeb01('0xf')]=0x0;this[_0xeb01('0x10')]=0x0;this[_0xeb01('0x11')]=0x0;this[_0xeb01('0x12')]=0x0;this[_0xeb01('0x13')]=0x0;this[_0xeb01('0x14')]=0x0;this['abandoned']=0x0;this[_0xeb01('0x15')]=0x0;this[_0xeb01('0x16')]=0x0;this[_0xeb01('0x17')]=_0x55f1d6[_0xeb01('0x17')]||![];this[_0xeb01('0x18')]=_0x55f1d6[_0xeb01('0x18')]||0xa;this[_0xeb01('0x19')]=_0x55f1d6[_0xeb01('0x19')]||'no';this[_0xeb01('0x1a')]=!![];this[_0xeb01('0x1b')]='';this[_0xeb01('0x1c')]=0x0;this['temp']=0x0;this[_0xeb01('0x1d')]=_0x55f1d6[_0xeb01('0x1d')]||null;this[_0xeb01('0x1e')]=_0x55f1d6['dialGlobalInterval']?_0x55f1d6[_0xeb01('0x1e')]:null;this[_0xeb01('0x1f')]=_0x55f1d6['dialActive'];this['dialMethod']=_0x55f1d6[_0xeb01('0x20')]||_0xeb01('0x21');this[_0xeb01('0x22')]=_0x55f1d6[_0xeb01('0x22')]||0x0;this[_0xeb01('0x23')]=_0x55f1d6[_0xeb01('0x23')]||0x0;this[_0xeb01('0x24')]=_0x55f1d6[_0xeb01('0x24')]||0x1;this[_0xeb01('0x25')]=_0x55f1d6[_0xeb01('0x25')]||_0xeb01('0x26');this[_0xeb01('0x27')]=_0x55f1d6[_0xeb01('0x27')]||0.03;this['dialPredictiveInterval']=_0x55f1d6[_0xeb01('0x28')]||0x258;this[_0xeb01('0x29')]=_0x55f1d6[_0xeb01('0x29')]||_0xeb01('0x2a');this[_0xeb01('0x2b')]=_0x55f1d6[_0xeb01('0x2b')]||_0xeb01('0x2a');this[_0xeb01('0x2c')]=_0x55f1d6[_0xeb01('0x2c')]||0x1e;this[_0xeb01('0x2d')]=_0x55f1d6['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x55f1d6['dialQueueTimeout']||0x3;this[_0xeb01('0x2e')]=_0x55f1d6[_0xeb01('0x2e')]||undefined;this[_0xeb01('0x2f')]=_0x55f1d6[_0xeb01('0x2f')]||0x3;this[_0xeb01('0x30')]=_0x55f1d6[_0xeb01('0x30')]||0x96;this['dialBusyMaxRetry']=_0x55f1d6[_0xeb01('0x31')]||0x3;this[_0xeb01('0x32')]=_0x55f1d6[_0xeb01('0x32')]||0x96;this[_0xeb01('0x33')]=_0x55f1d6[_0xeb01('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x55f1d6[_0xeb01('0x34')]||0x96;this[_0xeb01('0x35')]=_0x55f1d6[_0xeb01('0x35')]||0x3;this[_0xeb01('0x36')]=_0x55f1d6[_0xeb01('0x36')]||0x96;this['dialDropMaxRetry']=_0x55f1d6[_0xeb01('0x37')]||0x3;this['dialDropRetryFrequency']=_0x55f1d6['dialDropRetryFrequency']||0x96;this[_0xeb01('0x38')]=_0x55f1d6[_0xeb01('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x55f1d6[_0xeb01('0x39')]||0x96;this[_0xeb01('0x3a')]=_0x55f1d6[_0xeb01('0x3a')]||0x3;this[_0xeb01('0x3b')]=_0x55f1d6[_0xeb01('0x3b')]||0x96;this[_0xeb01('0x3c')]=_0x55f1d6[_0xeb01('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x55f1d6['dialAgentRejectRetryFrequency']||0x96;this[_0xeb01('0x3d')]=_0x55f1d6[_0xeb01('0x3d')]||0x3;this[_0xeb01('0x3e')]=_0x55f1d6[_0xeb01('0x3e')]||0x4;this[_0xeb01('0x3f')]=_0x55f1d6[_0xeb01('0x3f')]?_0x55f1d6['Trunk']:undefined;this[_0xeb01('0x40')]=_0x55f1d6[_0xeb01('0x40')]?_0x55f1d6['TrunkBackup']:undefined;this['dialPrefix']=_0x55f1d6[_0xeb01('0x41')]||undefined;this[_0xeb01('0x42')]=_0x55f1d6[_0xeb01('0x42')]?_0x55f1d6[_0xeb01('0x42')]:undefined;this[_0xeb01('0x43')]=_0x55f1d6['dialOrderByScheduledAt']||_0xeb01('0x44');this[_0xeb01('0x45')]=_0x55f1d6[_0xeb01('0x45')]||undefined;this['dialCutDigit']=_0x55f1d6['dialCutDigit']||undefined;this[_0xeb01('0x46')]=strategy[_0x55f1d6[_0xeb01('0x46')]]||'rrmemory';this[_0xeb01('0x47')]=!![];this[_0xeb01('0x48')]=_0x55f1d6[_0xeb01('0x48')]||![];this['dialAMDInitialSilence']=_0x55f1d6[_0xeb01('0x49')];this['dialAMDGreeting']=_0x55f1d6[_0xeb01('0x4a')];this['dialAMDAfterGreetingSilence']=_0x55f1d6['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x55f1d6[_0xeb01('0x4b')];this[_0xeb01('0x4c')]=_0x55f1d6['dialAMDMinWordLength'];this[_0xeb01('0x4d')]=_0x55f1d6['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x55f1d6[_0xeb01('0x4e')];this[_0xeb01('0x4f')]=_0x55f1d6[_0xeb01('0x4f')];this[_0xeb01('0x50')]=_0x55f1d6['dialAMDMaximumWordLength'];this[_0xeb01('0x51')]=0x0;this['pTalking']=0x0;this[_0xeb01('0x52')]=_0x55f1d6[_0xeb01('0x52')];this[_0xeb01('0x53')]=0x0;this[_0xeb01('0x54')]=0x0;this[_0xeb01('0x55')]=0x0;this[_0xeb01('0x56')]=0x0;this[_0xeb01('0x57')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xeb01('0x58')]=0x0;this[_0xeb01('0x59')]=0x0;this[_0xeb01('0x5a')]=0x0;this[_0xeb01('0x5b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xeb01('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this[_0xeb01('0x5d')]=0x0;this['startProgressive']=undefined;this[_0xeb01('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0xeb01('0x5f')]=1.05;this[_0xeb01('0x60')]=0x0;this[_0xeb01('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xeb01('0x62')]=0x0;this[_0xeb01('0x63')]=0x0;this[_0xeb01('0x64')]=0x0;this[_0xeb01('0x65')]=0x0;this['predictiveIntervalMaxThreshold']=_0x55f1d6[_0xeb01('0x66')]||0x14;this[_0xeb01('0x67')]=_0x55f1d6[_0xeb01('0x66')]||0xa;this[_0xeb01('0x68')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xeb01('0x69')]=0x1;this[_0xeb01('0x6a')]=0x0;this[_0xeb01('0x6b')]=0x0;this[_0xeb01('0x6c')]=0x0;this[_0xeb01('0x6d')]=0x0;this[_0xeb01('0x6e')]=_0x55f1d6['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x55f1d6[_0xeb01('0x6f')]||![];this['dialPreviewAutoRecallMe']=!!_0x55f1d6['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x55f1d6[_0xeb01('0x70')]||![];this[_0xeb01('0x71')]=_0x55f1d6[_0xeb01('0x71')]||undefined;this[_0xeb01('0x72')]=_0x55f1d6[_0xeb01('0x72')]||![];this[_0xeb01('0x73')]=_0x55f1d6['dialAgiAfterHangupAgent']||![];this[_0xeb01('0xa')]=monitorFormat[_0x55f1d6[_0xeb01('0xa')]]?monitorFormat[_0x55f1d6[_0xeb01('0xa')]]:undefined;this[_0xeb01('0x74')]=_0x55f1d6[_0xeb01('0x74')]||![];this[_0xeb01('0x75')]=_0x55f1d6[_0xeb01('0x75')]?_0x55f1d6[_0xeb01('0x75')]:undefined;}module[_0xeb01('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7b37be3..4db1e34 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 _0x2bc3=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x1d8295,_0xeb509d){var _0x259513=function(_0x162912){while(--_0x162912){_0x1d8295['push'](_0x1d8295['shift']());}};_0x259513(++_0xeb509d);}(_0x2bc3,0xd1));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x39ab19){this['id']=_0x39ab19['id']||0x0;this[_0x32bc('0x0')]=_0x39ab19[_0x32bc('0x0')]||'';this[_0x32bc('0x1')]=_0x39ab19['username']||'';this[_0x32bc('0x2')]=_0x39ab19[_0x32bc('0x2')]||'';this[_0x32bc('0x3')]=_0x39ab19[_0x32bc('0x3')]||'';this[_0x32bc('0x4')]=_0x39ab19[_0x32bc('0x4')]||'';this['Configurations']=_0x39ab19['Configurations']||{};}module[_0x32bc('0x5')]=VtigerAccount; \ No newline at end of file +var _0x60fc=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x60fc,0xe8));var _0xc60f=function(_0x22276c,_0x1851e2){_0x22276c=_0x22276c-0x0;var _0x526fea=_0x60fc[_0x22276c];return _0x526fea;};'use strict';function VtigerAccount(_0x105fc0){this['id']=_0x105fc0['id']||0x0;this[_0xc60f('0x0')]=_0x105fc0['name']||'';this[_0xc60f('0x1')]=_0x105fc0[_0xc60f('0x1')]||'';this[_0xc60f('0x2')]=_0x105fc0[_0xc60f('0x2')]||'';this['remoteUri']=_0x105fc0[_0xc60f('0x3')]||'';this[_0xc60f('0x4')]=_0x105fc0[_0xc60f('0x4')]||'';this[_0xc60f('0x5')]=_0x105fc0['Configurations']||{};}module[_0xc60f('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 3cd60e7..b6ee40e 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 _0x2658=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x5da54c,_0x520452){var _0x1246b0=function(_0x11e60b){while(--_0x11e60b){_0x5da54c['push'](_0x5da54c['shift']());}};_0x1246b0(++_0x520452);}(_0x2658,0x109));var _0x8265=function(_0x13d58b,_0x4ed10e){_0x13d58b=_0x13d58b-0x0;var _0x40eca1=_0x2658[_0x13d58b];return _0x40eca1;};'use strict';function ZendeskAccount(_0x5a6f64){this['id']=_0x5a6f64['id']||0x0;this[_0x8265('0x0')]=_0x5a6f64[_0x8265('0x0')]||'';this[_0x8265('0x1')]=_0x5a6f64['username']||'';this[_0x8265('0x2')]=_0x5a6f64[_0x8265('0x2')]||'';this[_0x8265('0x3')]=_0x5a6f64['token']||'';this[_0x8265('0x4')]=_0x5a6f64[_0x8265('0x4')]||'';this[_0x8265('0x5')]=_0x5a6f64['authType']||'';this[_0x8265('0x6')]=_0x5a6f64[_0x8265('0x6')]||'integrationTab';this[_0x8265('0x7')]=_0x5a6f64['serverUrl']||'';this[_0x8265('0x8')]=_0x5a6f64[_0x8265('0x8')]||{};}module[_0x8265('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xfe53=['authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x263714,_0x399b37){var _0x1cd43d=function(_0x2f2d3a){while(--_0x2f2d3a){_0x263714['push'](_0x263714['shift']());}};_0x1cd43d(++_0x399b37);}(_0xfe53,0x177));var _0x3fe5=function(_0x2b41e8,_0x86e285){_0x2b41e8=_0x2b41e8-0x0;var _0x396ab3=_0xfe53[_0x2b41e8];return _0x396ab3;};'use strict';function ZendeskAccount(_0x53992b){this['id']=_0x53992b['id']||0x0;this[_0x3fe5('0x0')]=_0x53992b[_0x3fe5('0x0')]||'';this[_0x3fe5('0x1')]=_0x53992b[_0x3fe5('0x1')]||'';this[_0x3fe5('0x2')]=_0x53992b[_0x3fe5('0x2')]||'';this['token']=_0x53992b[_0x3fe5('0x3')]||'';this[_0x3fe5('0x4')]=_0x53992b['remoteUri']||'';this['authType']=_0x53992b[_0x3fe5('0x5')]||'';this['type']=_0x53992b['type']||_0x3fe5('0x6');this[_0x3fe5('0x7')]=_0x53992b['serverUrl']||'';this[_0x3fe5('0x8')]=_0x53992b[_0x3fe5('0x8')]||{};}module[_0x3fe5('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index ea9851b..cdb7037 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 _0xdec4=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x1156cf,_0xc26149){var _0x4648a8=function(_0x12e645){while(--_0x12e645){_0x1156cf['push'](_0x1156cf['shift']());}};_0x4648a8(++_0xc26149);}(_0xdec4,0x137));var _0x4dec=function(_0x8b62a9,_0x17b817){_0x8b62a9=_0x8b62a9-0x0;var _0x1a9082=_0xdec4[_0x8b62a9];return _0x1a9082;};'use strict';function ZohoAccount(_0xeaeada){this['id']=_0xeaeada['id']||0x0;this['name']=_0xeaeada[_0x4dec('0x0')]||'';this[_0x4dec('0x1')]=_0xeaeada[_0x4dec('0x1')]||'';this[_0x4dec('0x2')]=_0xeaeada[_0x4dec('0x2')]||'';this[_0x4dec('0x3')]=_0xeaeada[_0x4dec('0x3')]||'';this[_0x4dec('0x4')]=_0xeaeada[_0x4dec('0x4')]||'';this[_0x4dec('0x5')]=_0xeaeada['clientSecret']||'';this[_0x4dec('0x6')]=_0xeaeada[_0x4dec('0x6')]||'';this['code']=_0xeaeada[_0x4dec('0x7')]||'';this['refreshToken']=_0xeaeada[_0x4dec('0x8')]||'';this[_0x4dec('0x9')]=_0xeaeada[_0x4dec('0x9')]||{};}module[_0x4dec('0xa')]=ZohoAccount; \ No newline at end of file +var _0xf6ae=['description','host','zone','clientId','serverUrl','refreshToken','Configurations'];(function(_0xb45cd2,_0x1dfee7){var _0x4827b5=function(_0x51572c){while(--_0x51572c){_0xb45cd2['push'](_0xb45cd2['shift']());}};_0x4827b5(++_0x1dfee7);}(_0xf6ae,0x9a));var _0xef6a=function(_0x32818e,_0x42d9db){_0x32818e=_0x32818e-0x0;var _0x40bfe2=_0xf6ae[_0x32818e];return _0x40bfe2;};'use strict';function ZohoAccount(_0x11a2d5){this['id']=_0x11a2d5['id']||0x0;this['name']=_0x11a2d5['name']||'';this[_0xef6a('0x0')]=_0x11a2d5[_0xef6a('0x0')]||'';this['host']=_0x11a2d5[_0xef6a('0x1')]||'';this['zone']=_0x11a2d5[_0xef6a('0x2')]||'';this[_0xef6a('0x3')]=_0x11a2d5['clientId']||'';this['clientSecret']=_0x11a2d5['clientSecret']||'';this['serverUrl']=_0x11a2d5[_0xef6a('0x4')]||'';this['code']=_0x11a2d5['code']||'';this[_0xef6a('0x5')]=_0x11a2d5[_0xef6a('0x5')]||'';this[_0xef6a('0x6')]=_0x11a2d5[_0xef6a('0x6')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 79e6fcc..9541f49 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 _0x0abf=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback'];(function(_0xdc3575,_0x592e0a){var _0x4e1b84=function(_0x1754b0){while(--_0x1754b0){_0xdc3575['push'](_0xdc3575['shift']());}};_0x4e1b84(++_0x592e0a);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xf0ab('0x0'));var _=require('lodash');var moment=require(_0xf0ab('0x1'));function checkNameSurname(_0x27c8c9,_0x528ef7,_0x598001){var _0x313b14='';if(!_['isNil'](_0x528ef7)&&_0xf0ab('0x2')===typeof _0x528ef7){_0x313b14+=_0x528ef7;}if(!_[_0xf0ab('0x3')](_0x598001)&&_0xf0ab('0x2')===typeof _0x598001){_0x313b14+='\x20'+_0x598001;}if(_0x313b14!==''){return _0x313b14;}return _0x27c8c9;}function Action(_0xbb1f91,_0x2ab7d6,_0x4d2ea8,_0x233afe,_0x57ff3b){this[_0xf0ab('0x4')]=_0x4d2ea8||undefined;this[_0xf0ab('0x5')]=_0xbb1f91['id'];this[_0xf0ab('0x6')]=_0x2ab7d6[_0xf0ab('0x7')];this['type']=_0x2ab7d6[_0xf0ab('0x8')];this[_0xf0ab('0x9')]=_0xf0ab('0x6');this['dialAnswer']=![];this['membername']=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?undefined:_0xbb1f91[_0xf0ab('0xa')][_0xf0ab('0x7')];this[_0xf0ab('0xb')]=this[_0xf0ab('0xc')]?util[_0xf0ab('0xd')](_0xf0ab('0xe'),this[_0xf0ab('0xc')]):_0x233afe||undefined;this['calleridname']=checkNameSurname(_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x10')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x11')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x12')]);this[_0xf0ab('0x13')]=_0xbb1f91[_0xf0ab('0x13')]||![];this[_0xf0ab('0x14')]=_0xbb1f91[_0xf0ab('0x10')];this[_0xf0ab('0x15')]=_0xbb1f91[_0xf0ab('0x15')];this[_0xf0ab('0x16')]=_0xbb1f91[_0xf0ab('0x16')]||0x0;this[_0xf0ab('0x17')]=_0xbb1f91['countcongestionretry']||0x0;this[_0xf0ab('0x18')]=_0xbb1f91[_0xf0ab('0x18')]||0x0;this[_0xf0ab('0x19')]=(_0xbb1f91[_0xf0ab('0x16')]||0x0)+(_0xbb1f91[_0xf0ab('0x17')]||0x0)+(_0xbb1f91[_0xf0ab('0x18')]||0x0)+(_0xbb1f91[_0xf0ab('0x1a')]||0x0)+(_0xbb1f91[_0xf0ab('0x1b')]||0x0)+(_0xbb1f91[_0xf0ab('0x1c')]||0x0)+(_0xbb1f91[_0xf0ab('0x1d')]||0x0)+(_0xbb1f91[_0xf0ab('0x1e')]||0x0);this[_0xf0ab('0x1a')]=_0xbb1f91[_0xf0ab('0x1a')]||0x0;this[_0xf0ab('0x1b')]=_0xbb1f91[_0xf0ab('0x1b')]||0x0;this[_0xf0ab('0x1c')]=_0xbb1f91['countabandonedretry']||0x0;this[_0xf0ab('0x1d')]=_0xbb1f91[_0xf0ab('0x1d')]||0x0;this[_0xf0ab('0x1e')]=_0xbb1f91[_0xf0ab('0x1e')]||0x0;this[_0xf0ab('0x1f')]=_0xbb1f91[_0xf0ab('0x1f')];this[_0xf0ab('0x20')]=_0xbb1f91[_0xf0ab('0x20')];this[_0xf0ab('0x21')]=_0xbb1f91[_0xf0ab('0x21')];this[_0xf0ab('0x22')]=_0xbb1f91['recallme'];this['ContactId']=_0xbb1f91['ContactId'];this[_0xf0ab('0x23')]=_0xbb1f91['ListId'];this[_0xf0ab('0x24')]=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?_0xbb1f91[_0xf0ab('0x24')]:_0xbb1f91[_0xf0ab('0xa')]['id'];this[_0xf0ab('0x25')]=_0xbb1f91[_0xf0ab('0x25')];this[_0xf0ab('0x26')]='';this['originatecalleridname']='';}Action[_0xf0ab('0x27')]['getCaller']=function(){return util['format'](_0xf0ab('0x28'),this[_0xf0ab('0x29')],this[_0xf0ab('0x2a')]);};module[_0xf0ab('0x2b')]=Action; \ No newline at end of file +var _0x57ca=['name','type','campaigntype','dialAnswer','Agent','membername','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x29cdaf,_0x1c29d7){var _0xddd806=function(_0x460b8a){while(--_0x460b8a){_0x29cdaf['push'](_0x29cdaf['shift']());}};_0xddd806(++_0x1c29d7);}(_0x57ca,0x108));var _0xa57c=function(_0x5addf7,_0x50785e){_0x5addf7=_0x5addf7-0x0;var _0xb0746a=_0x57ca[_0x5addf7];return _0xb0746a;};'use strict';var util=require('util');var _=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));function checkNameSurname(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7='';if(!_[_0xa57c('0x2')](_0x3a7394)&&_0xa57c('0x3')===typeof _0x3a7394){_0x1d38e7+=_0x3a7394;}if(!_['isNil'](_0x396613)&&_0xa57c('0x3')===typeof _0x396613){_0x1d38e7+='\x20'+_0x396613;}if(_0x1d38e7!==''){return _0x1d38e7;}return _0x4b1712;}function Action(_0x1c3e31,_0x113dcf,_0x19473f,_0xbdfffb,_0x314574){this[_0xa57c('0x4')]=_0x19473f||undefined;this[_0xa57c('0x5')]=_0x1c3e31['id'];this['queue']=_0x113dcf[_0xa57c('0x6')];this['type']=_0x113dcf[_0xa57c('0x7')];this[_0xa57c('0x8')]='queue';this[_0xa57c('0x9')]=![];this['membername']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?undefined:_0x1c3e31['Agent'][_0xa57c('0x6')];this['channelAgent']=this[_0xa57c('0xb')]?util[_0xa57c('0xc')](_0xa57c('0xd'),this[_0xa57c('0xb')]):_0xbdfffb||undefined;this[_0xa57c('0xe')]=checkNameSurname(_0x1c3e31['Contact'][_0xa57c('0xf')],_0x1c3e31['Contact'][_0xa57c('0x10')],_0x1c3e31[_0xa57c('0x11')][_0xa57c('0x12')]);this[_0xa57c('0x13')]=_0x1c3e31[_0xa57c('0x13')]||![];this[_0xa57c('0x14')]=_0x1c3e31[_0xa57c('0xf')];this['scheduledat']=_0x1c3e31[_0xa57c('0x15')];this[_0xa57c('0x16')]=_0x1c3e31[_0xa57c('0x16')]||0x0;this['countcongestionretry']=_0x1c3e31[_0xa57c('0x17')]||0x0;this['countnoanswerretry']=_0x1c3e31[_0xa57c('0x18')]||0x0;this[_0xa57c('0x19')]=(_0x1c3e31[_0xa57c('0x16')]||0x0)+(_0x1c3e31[_0xa57c('0x17')]||0x0)+(_0x1c3e31[_0xa57c('0x18')]||0x0)+(_0x1c3e31[_0xa57c('0x1a')]||0x0)+(_0x1c3e31[_0xa57c('0x1b')]||0x0)+(_0x1c3e31[_0xa57c('0x1c')]||0x0)+(_0x1c3e31['countmachineretry']||0x0)+(_0x1c3e31[_0xa57c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x1c3e31['countnosuchnumberretry']||0x0;this[_0xa57c('0x1b')]=_0x1c3e31[_0xa57c('0x1b')]||0x0;this[_0xa57c('0x1c')]=_0x1c3e31[_0xa57c('0x1c')]||0x0;this['countmachineretry']=_0x1c3e31[_0xa57c('0x1e')]||0x0;this[_0xa57c('0x1d')]=_0x1c3e31[_0xa57c('0x1d')]||0x0;this[_0xa57c('0x1f')]=_0x1c3e31[_0xa57c('0x1f')];this[_0xa57c('0x20')]=_0x1c3e31[_0xa57c('0x20')];this[_0xa57c('0x21')]=_0x1c3e31[_0xa57c('0x21')];this[_0xa57c('0x22')]=_0x1c3e31[_0xa57c('0x22')];this[_0xa57c('0x23')]=_0x1c3e31[_0xa57c('0x23')];this[_0xa57c('0x24')]=_0x1c3e31[_0xa57c('0x24')];this['UserId']=_[_0xa57c('0x2')](_0x1c3e31[_0xa57c('0xa')])?_0x1c3e31[_0xa57c('0x25')]:_0x1c3e31[_0xa57c('0xa')]['id'];this[_0xa57c('0x26')]=_0x1c3e31[_0xa57c('0x26')];this[_0xa57c('0x27')]='';this[_0xa57c('0x28')]='';}Action[_0xa57c('0x29')][_0xa57c('0x2a')]=function(){return util['format'](_0xa57c('0x2b'),this['calleridname'],this['number']);};module[_0xa57c('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e94da23..b52493e 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 _0x7f60=['dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','AnswerAGI','reason','[callProgressDetectingAgent][logCongestion]','updateOriginated','[originated][decrement][callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','disableContact','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','YYYY-MM-DD\x20HH:mm:ss','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','unlockContact','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','variable','addVariable','keys','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','name','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','logger','syncCampaigns','campaignsPreview','booked','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','originated:\x20','queue','dialAnswer','pick','UserId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','connect','acw','custom:agentConnectPreview','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','additional','Global','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','countnoanswerretry','NoAnswer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7f60,0x1e9));var _0x07f6=function(_0x17e397,_0x162b38){_0x17e397=_0x17e397-0x0;var _0x5cc201=_0x7f60[_0x17e397];return _0x5cc201;};'use strict';var util=require(_0x07f6('0x0'));var _=require(_0x07f6('0x1'));var uuid=require(_0x07f6('0x2'));var moment=require(_0x07f6('0x3'));var md5=require(_0x07f6('0x4'));var Redis=require(_0x07f6('0x5'));var config=require(_0x07f6('0x6'));var logger=require(_0x07f6('0x7'))(_0x07f6('0x8'));var loggerAction=require(_0x07f6('0x7'))(_0x07f6('0x9'));var ami=require('../ami');var rpcDb=require(_0x07f6('0xa'));var cmHopperAdditionalPhone=require(_0x07f6('0xb'));var Action=require(_0x07f6('0xc'));var ut=require(_0x07f6('0xd'));config[_0x07f6('0xe')]=_[_0x07f6('0xf')](config[_0x07f6('0xe')],{'host':_0x07f6('0x10'),'port':0x18eb});var io=require(_0x07f6('0x11'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x07f6('0x12')]['enqueue']=function(_0x26702f){this[_0x07f6('0x13')]=this['tail']?this[_0x07f6('0x13')][_0x07f6('0x14')](_0x26702f):_0x26702f();};function Preview(_0x4f40e0){this[_0x07f6('0x15')]=new Sequence();this['campaignsPreview']=_0x4f40e0[_0x07f6('0x16')];this[_0x07f6('0x17')]=_0x4f40e0[_0x07f6('0x17')];this[_0x07f6('0x18')]={};this['agents']=_0x4f40e0[_0x07f6('0x19')];this[_0x07f6('0x1a')]=0x0;ami['on'](_0x07f6('0x1b'),this[_0x07f6('0x1c')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x1e'),this[_0x07f6('0x1f')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x20'),this['syncHangupRequest']['bind'](this));ami['on'](_0x07f6('0x21'),this[_0x07f6('0x22')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x23'),this[_0x07f6('0x24')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x25'),this[_0x07f6('0x26')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x27'),this[_0x07f6('0x28')][_0x07f6('0x1d')](this));ami['on'](_0x07f6('0x29'),this['syncBlindTransfer'][_0x07f6('0x1d')](this));this[_0x07f6('0x2a')](this['campaignsPreview']);}function emit(_0x3e0032,_0x5b6dd2,_0xa23cf3){io['to'](_0x3e0032)[_0x07f6('0x2b')](_0x5b6dd2,_0xa23cf3);}function emitCampaignPreview(_0x4db911){if(_0x4db911[_0x07f6('0x2c')]===_0x07f6('0x2d')){var _0x2f9dfa={'id':_0x4db911['id'],'name':_0x4db911['name'],'strategy':_0x4db911[_0x07f6('0x2e')],'answered':_0x4db911[_0x07f6('0x2f')],'available':_0x4db911[_0x07f6('0x30')],'loggedIn':_0x4db911[_0x07f6('0x31')],'pTalking':_0x4db911['pTalking'],'sumBillable':_0x4db911[_0x07f6('0x32')],'sumDuration':_0x4db911['sumDuration'],'sumHoldTime':_0x4db911[_0x07f6('0x33')]||0x0,'talking':_0x4db911['talking'],'total':_0x4db911[_0x07f6('0x34')],'type':_0x4db911[_0x07f6('0x2c')],'unmanaged':_0x4db911[_0x07f6('0x35')],'abandoned':_0x4db911[_0x07f6('0x36')],'waiting':_0x4db911[_0x07f6('0x37')],'loggedInDb':_0x4db911[_0x07f6('0x38')],'dialActive':_0x4db911[_0x07f6('0x39')],'dialMethod':_0x4db911[_0x07f6('0x3a')],'dialOriginateCallerIdName':_0x4db911[_0x07f6('0x3b')],'dialOriginateCallerIdNumber':_0x4db911[_0x07f6('0x3c')],'dialOriginateTimeout':_0x4db911[_0x07f6('0x3d')],'dialPrefix':_0x4db911[_0x07f6('0x3e')],'outboundAnswerAgiCallsDay':_0x4db911['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4db911[_0x07f6('0x3f')],'outboundBlacklistCallsDay':_0x4db911[_0x07f6('0x40')],'outboundBusyCallsDay':_0x4db911['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4db911[_0x07f6('0x41')],'outboundDropCallsDayACS':_0x4db911['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4db911[_0x07f6('0x42')],'outboundDropCallsDayTimeout':_0x4db911['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4db911['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4db911[_0x07f6('0x43')],'outboundOriginateFailureCallsDay':_0x4db911[_0x07f6('0x44')],'outboundReCallsDay':_0x4db911['outboundReCallsDay'],'outboundRejectCallsDay':_0x4db911['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4db911[_0x07f6('0x45')],'outboundAbandonedCallsDay':_0x4db911['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4db911[_0x07f6('0x46')],'predictiveIntervalAvgHoldtime':_0x4db911[_0x07f6('0x47')],'predictiveIntervalAvgTalktime':_0x4db911['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4db911['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4db911['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4db911[_0x07f6('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x4db911['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4db911[_0x07f6('0x49')],'predictiveIntervalMultiplicativeFactor':_0x4db911[_0x07f6('0x4a')],'predictiveIntervalPauses':_0x4db911['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4db911[_0x07f6('0x4b')],'predictiveIntervalTotalCalls':_0x4db911['predictiveIntervalTotalCalls'],'message':_0x4db911[_0x07f6('0x4c')],'originated':_0x4db911[_0x07f6('0x4d')],'erlangCalls':_0x4db911['erlangCalls'],'erlangCallToSecond':_0x4db911[_0x07f6('0x4e')],'erlangAbandonmentRate':_0x4db911[_0x07f6('0x4f')],'erlangBusyFactor':_0x4db911['erlangBusyFactor'],'startPredictive':_0x4db911[_0x07f6('0x50')],'startProgressive':_0x4db911[_0x07f6('0x51')]};if(_0x4db911[_0x07f6('0x52')]){_0x2f9dfa['Trunk']={'id':_0x4db911[_0x07f6('0x52')]['id'],'name':_0x4db911[_0x07f6('0x52')]['name'],'active':_0x4db911[_0x07f6('0x52')][_0x07f6('0x53')],'callerid':_0x4db911[_0x07f6('0x52')][_0x07f6('0x54')]};}if(_0x4db911[_0x07f6('0x55')]){_0x2f9dfa[_0x07f6('0x55')]={'id':_0x4db911['Interval']['id'],'name':_0x4db911['Interval']['name']};}var _0x33857a=md5(JSON[_0x07f6('0x56')](_0x2f9dfa));if(_0x4db911[_0x07f6('0x4')]!==_0x33857a){_0x4db911[_0x07f6('0x4')]=_0x33857a;emit(util[_0x07f6('0x57')](_0x07f6('0x58'),_0x2f9dfa[_0x07f6('0x59')]),_0x07f6('0x5a'),_0x2f9dfa);}}}function emitVoiceQueueChannelRemove(_0x4892b5){logger[_0x07f6('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x4892b5));emit(util[_0x07f6('0x57')](_0x07f6('0x58'),_0x4892b5[_0x07f6('0x59')]),_0x07f6('0x5c'),_0x4892b5);io[_0x07f6('0x2b')](_0x07f6('0x5d'),_0x4892b5);}function notSendMessagesQueue(_0x34cdf7){if(_0x34cdf7[_0x07f6('0x5e')]){if(_0x34cdf7['originated']===0x0&&_0x34cdf7[_0x07f6('0x5f')]===0x0){_0x34cdf7[_0x07f6('0x5e')]=![];_0x34cdf7['available']=0x0;_0x34cdf7[_0x07f6('0x60')]=0x0;_0x34cdf7[_0x07f6('0x4c')]=_0x07f6('0x61');ut['logger'](_0x07f6('0x62'),_0x34cdf7[_0x07f6('0x59')]+_0x07f6('0x63'));}else{_0x34cdf7['message']=_0x07f6('0x64');ut[_0x07f6('0x65')](_0x07f6('0x62'),_0x34cdf7[_0x07f6('0x59')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x34cdf7);}}Preview[_0x07f6('0x12')][_0x07f6('0x2a')]=function(){var _0xc641d8=this;setInterval(function(){_0xc641d8[_0x07f6('0x66')]();},0x7cf);};Preview[_0x07f6('0x12')]['syncCampaigns']=function(){var _0x5681d8=this[_0x07f6('0x67')];this[_0x07f6('0x1a')]+=0x1;for(var _0x15bfaf in _0x5681d8){if(_0x5681d8['hasOwnProperty'](_0x15bfaf)&&(_0x5681d8[_0x15bfaf]['dialMethod']===_0x07f6('0x8')||_0x5681d8[_0x15bfaf][_0x07f6('0x3a')]===_0x07f6('0x68'))&&_0x5681d8[_0x15bfaf][_0x07f6('0x2c')]===_0x07f6('0x2d')){if(this[_0x07f6('0x1a')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x5681d8[_0x07f6('0x69')](_0x15bfaf)&&_0x5681d8[_0x15bfaf][_0x07f6('0x3a')]===_0x07f6('0x8')&&_0x5681d8[_0x15bfaf][_0x07f6('0x2c')]===_0x07f6('0x2d')){if(_0x5681d8[_0x15bfaf][_0x07f6('0x39')]){this[_0x07f6('0x6a')](_0x5681d8[_0x15bfaf]);if(_0x5681d8[_0x15bfaf][_0x07f6('0x6b')])this[_0x07f6('0x6c')](_0x5681d8[_0x15bfaf]);}else{notSendMessagesQueue(_0x5681d8[_0x15bfaf]);}}}};Preview[_0x07f6('0x12')][_0x07f6('0x6d')]=function(_0x2aa64f){var _0x33f2db=this;this[_0x07f6('0x15')][_0x07f6('0x6e')](function(){if(!_[_0x07f6('0x6f')](_0x33f2db[_0x07f6('0x18')][_0x2aa64f])){loggerAction[_0x07f6('0x5b')](_0x07f6('0x70'),_0x2aa64f,'Queue',_0x33f2db[_0x07f6('0x18')][_0x2aa64f]['queue'],_0x07f6('0x71'),JSON['stringify'](_0x33f2db[_0x07f6('0x67')][_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]][_0x07f6('0x4d')]),'pTalking:\x20',JSON['stringify'](_0x33f2db[_0x07f6('0x67')][_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]]['pTalking']),JSON['stringify'](_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x73')]),JSON[_0x07f6('0x56')](_[_0x07f6('0x74')](_0x33f2db[_0x07f6('0x18')][_0x2aa64f],['contactId',_0x07f6('0x75'),'VoiceQueueId','ListId'])));return ami[_0x07f6('0x76')]({'action':_0x07f6('0x77'),'channel':_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x78')]})[_0x07f6('0x79')](function(_0x4d8d87){if(_0x4d8d87[_0x07f6('0x4c')]===_0x07f6('0x7a')){setTimeout(function(){if(_0x33f2db[_0x07f6('0x18')][_0x2aa64f]){ut['updateOriginated'](_0x33f2db[_0x07f6('0x67')][_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]],_0x07f6('0x7b'));if(_0x33f2db['actions'][_0x2aa64f]['dialAnswer']===!![]){ut[_0x07f6('0x7c')](_0x33f2db[_0x07f6('0x67')][_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]],_0x07f6('0x7b'));ut[_0x07f6('0x7d')](_0x07f6('0x7e')+_0x2aa64f,_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]);}ut[_0x07f6('0x7d')](_0x07f6('0x7f')+_0x2aa64f,_0x33f2db[_0x07f6('0x18')][_0x2aa64f][_0x07f6('0x72')]);delete _0x33f2db[_0x07f6('0x18')][_0x2aa64f];}},0x2328);}});}});};Preview[_0x07f6('0x12')][_0x07f6('0x80')]=function(){var _0x195c10=this;loggerAction[_0x07f6('0x5b')](_0x07f6('0x81'),_[_0x07f6('0x82')](this[_0x07f6('0x18')]));for(var _0x47b833 in this[_0x07f6('0x18')]){if(_0x195c10[_0x07f6('0x18')][_0x07f6('0x69')](_0x47b833)){_0x195c10[_0x07f6('0x6d')](_0x47b833);}}};Preview[_0x07f6('0x12')][_0x07f6('0x6c')]=function(_0x4fc71e){var _0x3bfabc=this;rpcDb[_0x07f6('0x83')](_0x4fc71e['id'],ut[_0x07f6('0x84')](this[_0x07f6('0x19')]))[_0x07f6('0x85')](function(_0x50a6ef){if(!_[_0x07f6('0x6f')](_0x50a6ef)){for(var _0x28d943=0x0;_0x28d943<_0x50a6ef[_0x07f6('0x86')];_0x28d943+=0x1){if(ut[_0x07f6('0x87')](_0x50a6ef[_0x28d943][_0x07f6('0x88')])<_0x4fc71e[_0x07f6('0x89')]*0x3c){if(_0x50a6ef[_0x28d943][_0x07f6('0x8a')]&&!_0x50a6ef[_0x28d943]['Agent'][_0x07f6('0x8b')]){_0x3bfabc[_0x07f6('0x8c')](_0x50a6ef[_0x28d943]['id'])[_0x07f6('0x85')](ut[_0x07f6('0x8d')]('[RecallMe]'))[_0x07f6('0x79')](ut[_0x07f6('0x8d')](_0x07f6('0x8e')));}else{rpcDb['disableContact'](_0x50a6ef[_0x28d943]['id']);}}else{var _0x76a9e4=new Action(_0x50a6ef[_0x28d943],_0x4fc71e);_0x76a9e4['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4fc71e[_0x07f6('0x8f')]+=0x1;ut['logCustomer'](_0x76a9e4,0x17,_0x07f6('0x90'));if(_0x4fc71e[_0x07f6('0x91')]){rpcDb[_0x07f6('0x92')](ut[_0x07f6('0x93')](_0x50a6ef[_0x28d943]));rpcDb['createCustomerHistory'](_0x76a9e4,_0x07f6('0x94'));}else{ut[_0x07f6('0x95')](_0x76a9e4,0x16,'RecallFailedTimeout');rpcDb[_0x07f6('0x96')](_0x76a9e4,_0x07f6('0x97'));rpcDb['createCustomerFinal'](_0x76a9e4,_0x07f6('0x97'));}}}}})['catch'](ut[_0x07f6('0x8d')](_0x07f6('0x98')));};Preview['prototype'][_0x07f6('0x6a')]=function(_0x1d2876){_0x1d2876[_0x07f6('0x5e')]=!![];if(ut[_0x07f6('0x99')](_0x1d2876[_0x07f6('0x31')])){_0x1d2876[_0x07f6('0x4c')]=_0x07f6('0x9a');}else if(!ut[_0x07f6('0x9b')](_0x1d2876['dialActive'])){_0x1d2876[_0x07f6('0x4c')]=_0x07f6('0x61');}else if(!this[_0x07f6('0x9c')](_0x1d2876[_0x07f6('0x52')])){if(!this[_0x07f6('0x9c')](_0x1d2876[_0x07f6('0x9d')])){_0x1d2876[_0x07f6('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1d2876[_0x07f6('0x4c')]=_0x07f6('0x9e');}}else{_0x1d2876[_0x07f6('0x4c')]=_0x07f6('0x9e');}emitCampaignPreview(_0x1d2876);};Preview[_0x07f6('0x12')][_0x07f6('0x9f')]=function(_0x18c183,_0x38eac3,_0x122b41){var _0x4b3eba=this;var _0x2850ca=this[_0x07f6('0x18')][_0x38eac3];var _0x38c6ee=this[_0x07f6('0x67')][_0x2850ca[_0x07f6('0x72')]];var _0x1d0219;var _0x494eaf=![];var _0x4c1e04=0x2;var _0x28497e=0x3;if(_0x38c6ee){switch(_0x122b41){case'1':_0x38c6ee[_0x07f6('0x43')]+=0x1;_0x2850ca['countnosuchnumberretry']+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut[_0x07f6('0xa1')](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0x0,_0x07f6('0xa2'));ami['emit'](_0x07f6('0xa3'),ut[_0x07f6('0xa4')](_0x2850ca,_0x07f6('0xa5')));rpcDb['createCustomerHistory'](_0x2850ca,_0x07f6('0xa6'));_0x4b3eba['verifyAdditionalPhones'](_0x2850ca,'0',_0x38c6ee)[_0x07f6('0x85')](function(_0x2b4a67){_0x494eaf=_0x2b4a67['additional']==0x1;_0x4c1e04=_0x38c6ee[_0x07f6('0xa7')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,'Global');rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xac'));}else{if(_0x2850ca[_0x07f6('0xad')]>=_0x38c6ee[_0x07f6('0xae')]){rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xac'));}else{rpcDb[_0x07f6('0xaf')](ut[_0x07f6('0xb0')](_0x2850ca,_0x07f6('0xad'),_0x38c6ee[_0x07f6('0xa7')]),_0x2850ca[_0x07f6('0xb1')],_0x2850ca[_0x07f6('0xb2')]);}}delete this['actions'][_0x18c183[_0x07f6('0xb3')]];}else{_0x2850ca['countnosuchnumberretry']++;logger[_0x07f6('0x5b')](_0x07f6('0xb4'),_0x2850ca[_0x07f6('0xad')]);logger[_0x07f6('0x5b')]('id',_0x2850ca['idContact']);_0x4b3eba[_0x07f6('0xb5')]({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countnosuchnumberretry':_0x2850ca[_0x07f6('0xad')]}})['then'](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case _0x07f6('0xb8'):var _0x3c5d8f=moment()[_0x07f6('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x2850ca[_0x07f6('0xb9')]=_0x3c5d8f;_0x2850ca['answertime']=_0x3c5d8f;_0x2850ca[_0x07f6('0x73')]=!![];_0x38c6ee[_0x07f6('0x5f')]+=0x1;logger[_0x07f6('0x5b')](_0x07f6('0xba'),_0x2850ca[_0x07f6('0xbb')],_0x07f6('0xbc'),_0x38c6ee['name'],_0x07f6('0xbd'),_0x38c6ee[_0x07f6('0x5f')]);ami[_0x07f6('0x2b')]('custom:agentconnect',ut[_0x07f6('0xa4')](_0x2850ca,_0x07f6('0xbe'),this[_0x07f6('0x67')][_0x2850ca[_0x07f6('0x72')]]));if(_0x38c6ee[_0x07f6('0xbf')]){ami[_0x07f6('0x2b')](_0x07f6('0xc0'),ut['buildAcw'](_0x2850ca));}break;case'16':ami[_0x07f6('0x2b')]('custom:agentcomplete',ut[_0x07f6('0xa4')](_0x2850ca,'complete',this[_0x07f6('0x67')][_0x2850ca[_0x07f6('0x72')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2850ca,_0x07f6('0xc1')));_0x38c6ee[_0x07f6('0x3f')]+=0x1;_0x38c6ee[_0x07f6('0x34')]+=0x1;_0x38c6ee[_0x07f6('0x2f')]+=0x1;ut[_0x07f6('0x7c')](_0x38c6ee,_0x07f6('0xc2'));_0x2850ca['countglobal']=ut[_0x07f6('0xa1')](_0x2850ca);ut['logCustomer'](_0x2850ca,0x4,'Answer');rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xc3'));rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xc4'));rpcDb[_0x07f6('0xc5')](_0x2850ca);_0x38c6ee[_0x07f6('0xc6')]+=_0x2850ca[_0x07f6('0xc7')];_0x38c6ee[_0x07f6('0x32')]+=_0x2850ca[_0x07f6('0xc7')];logger[_0x07f6('0x5b')]('[syncHangup][talking][decrement]',_0x2850ca[_0x07f6('0xbb')],_0x07f6('0xbc'),_0x38c6ee[_0x07f6('0x59')],'pTalking:\x20',_0x38c6ee['pTalking']);delete this[_0x07f6('0x18')][_0x18c183[_0x07f6('0xb3')]];break;case _0x07f6('0xc8'):_0x38c6ee[_0x07f6('0xc9')]+=0x1;_0x2850ca[_0x07f6('0xca')]+=0x1;_0x2850ca['countglobal']=ut[_0x07f6('0xa1')](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0x5,_0x07f6('0xcb'));_0x4c1e04=_0x38c6ee[_0x07f6('0xcc')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];ami[_0x07f6('0x2b')](_0x07f6('0xcd'),ut[_0x07f6('0xa4')](_0x2850ca,_0x07f6('0xce')));rpcDb['createCustomerHistory'](_0x2850ca,_0x07f6('0xcf'));_0x4b3eba[_0x07f6('0xd0')](_0x2850ca,'5',_0x38c6ee)['then'](function(_0x3a0942){_0x494eaf=_0x3a0942[_0x07f6('0xd1')]==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut['cloneAction'](_0x2850ca,0xf,_0x07f6('0xd2'));rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xd3'));}else{if(_0x2850ca[_0x07f6('0xca')]>=_0x38c6ee['dialBusyMaxRetry']){rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xcf'));}else{rpcDb['rescheduleContact'](ut[_0x07f6('0xb0')](_0x2850ca,_0x07f6('0xca'),_0x38c6ee[_0x07f6('0xcc')]),_0x2850ca[_0x07f6('0xb1')],_0x2850ca[_0x07f6('0xb2')]);}}}else{_0x2850ca[_0x07f6('0xca')]++;_0x4b3eba['incrementPreviewCounters']({'id':_0x2850ca['idContact'],'field':{'countbusyretry':_0x2850ca[_0x07f6('0xca')]}})[_0x07f6('0x85')](function(){_0x4b3eba['swapAdditionalPhones'](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case _0x07f6('0xd4'):_0x38c6ee['outboundNoAnswerCallsDay']+=0x1;_0x2850ca[_0x07f6('0xd5')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut['totalGlobal'](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0x3,_0x07f6('0xd6'));_0x4c1e04=_0x38c6ee[_0x07f6('0xd7')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];var _0x955edd=ut[_0x07f6('0xd8')](_0x2850ca,_0x38c6ee);ami[_0x07f6('0x2b')](_0x07f6('0xd9'),_0x955edd);rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xda'));_0x4b3eba['verifyAdditionalPhones'](_0x2850ca,'3',_0x38c6ee)[_0x07f6('0x85')](function(_0x46f7fd){_0x494eaf=_0x46f7fd[_0x07f6('0xd1')]==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,_0x07f6('0xd2'));rpcDb['createCustomerFinal'](_0x1d0219,_0x07f6('0xdb'));}else{if(_0x2850ca['countnoanswerretry']>=_0x38c6ee['dialNoAnswerMaxRetry']){rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xda'));}else{rpcDb[_0x07f6('0xaf')](ut[_0x07f6('0xb0')](_0x2850ca,_0x07f6('0xd5'),_0x38c6ee[_0x07f6('0xd7')]),_0x2850ca['unlockAgent'],_0x2850ca[_0x07f6('0xb2')]);}}}else{_0x2850ca['countnoanswerretry']++;_0x4b3eba['incrementPreviewCounters']({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countnoanswerretry':_0x2850ca['countnoanswerretry']}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case _0x07f6('0xdc'):_0x38c6ee[_0x07f6('0x41')]+=0x1;_0x2850ca[_0x07f6('0xdd')]+=0x1;_0x2850ca['countglobal']=ut[_0x07f6('0xa1')](_0x2850ca);ut['logCustomer'](_0x2850ca,0x8,_0x07f6('0xde'));_0x4c1e04=_0x38c6ee[_0x07f6('0xdf')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];ami[_0x07f6('0x2b')](_0x07f6('0xe0'),ut['buildObj'](_0x2850ca,_0x07f6('0xe1')));rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xe2'));_0x4b3eba[_0x07f6('0xd0')](_0x2850ca,'8',_0x38c6ee)['then'](function(_0x4ec1b1){_0x494eaf=_0x4ec1b1[_0x07f6('0xd1')]==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,'Global');rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xe3'));}else{if(_0x2850ca[_0x07f6('0xdd')]>=_0x38c6ee[_0x07f6('0xe4')]){rpcDb[_0x07f6('0xab')](_0x2850ca,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x07f6('0xaf')](ut[_0x07f6('0xb0')](_0x2850ca,'countcongestionretry',_0x38c6ee[_0x07f6('0xcc')]),_0x2850ca['unlockAgent'],_0x2850ca[_0x07f6('0xb2')]);}}}else{_0x2850ca[_0x07f6('0xdd')]++;_0x4b3eba['incrementPreviewCounters']({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countcongestionretry':_0x2850ca['countcongestionretry']}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case _0x07f6('0xe5'):_0x38c6ee['outboundRejectCallsDay']+=0x1;_0x2850ca[_0x07f6('0xe6')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut[_0x07f6('0xa1')](_0x2850ca);ut['logCustomer'](_0x2850ca,0x14,_0x07f6('0xe7'));_0x4c1e04=_0x38c6ee[_0x07f6('0xe8')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];ami[_0x07f6('0x2b')](_0x07f6('0xe9'),ut[_0x07f6('0xa4')](_0x2850ca,'agentreject'));rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xea'));_0x4b3eba[_0x07f6('0xd0')](_0x2850ca,'20',_0x38c6ee)[_0x07f6('0x85')](function(_0x4ea4dd){_0x494eaf=_0x4ea4dd['additional']==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut['cloneAction'](_0x2850ca,0x14,_0x07f6('0xe7'));rpcDb['createCustomerFinal'](_0x1d0219,_0x07f6('0xeb'));}else{if(_0x2850ca['countagentrejectretry']>=_0x38c6ee[_0x07f6('0xec')]){rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xeb'));}else{rpcDb[_0x07f6('0xaf')](ut[_0x07f6('0xb0')](_0x2850ca,'countagentrejectretry',_0x38c6ee[_0x07f6('0xe8')]),_0x2850ca[_0x07f6('0xb1')],_0x2850ca[_0x07f6('0xb2')]);}}}else{_0x2850ca[_0x07f6('0xd5')]++;_0x4b3eba[_0x07f6('0xb5')]({'id':_0x2850ca['idContact'],'field':{'countnoanswerretry':_0x2850ca[_0x07f6('0xd5')]}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case _0x07f6('0xed'):_0x38c6ee[_0x07f6('0xee')]+=0x1;_0x2850ca[_0x07f6('0xef')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut[_0x07f6('0xa1')](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0xb,_0x07f6('0xf0'));rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xf1'));_0x4b3eba['verifyAdditionalPhones'](_0x2850ca,'11',_0x38c6ee)[_0x07f6('0x85')](function(_0x163080){_0x494eaf=_0x163080[_0x07f6('0xd1')]==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,_0x07f6('0xd2'));rpcDb['createCustomerFinal'](_0x1d0219,_0x07f6('0xf1'));}else{if(_0x2850ca['countabandonedetry']>=_0x38c6ee['dialAbandonedMaxRety']){rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xf1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2850ca,_0x07f6('0xef'),_0x38c6ee[_0x07f6('0xf2')]),_0x2850ca[_0x07f6('0xb1')],_0x2850ca[_0x07f6('0xb2')]);}}}else{_0x2850ca[_0x07f6('0xd5')]++;_0x4b3eba[_0x07f6('0xb5')]({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countnoanswerretry':_0x2850ca[_0x07f6('0xd5')]}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});break;case'18':_0x38c6ee[_0x07f6('0x45')]+=0x1;_0x2850ca[_0x07f6('0xf3')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut['totalGlobal'](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0x12,_0x18c183[_0x07f6('0xf4')]||_0x18c183['dialstatus']);ami[_0x07f6('0x2b')](_0x07f6('0xf5'),ut['buildObj'](_0x2850ca,_0x07f6('0xf6')));rpcDb[_0x07f6('0x96')](_0x2850ca,_0x07f6('0xf7'));_0x4b3eba['verifyAdditionalPhones'](_0x2850ca,'18',_0x38c6ee)['then'](function(_0x58a23e){_0x494eaf=_0x58a23e[_0x07f6('0xd1')]==0x1;if(!_0x494eaf){if(ut['totalGlobal'](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0x12,_0x07f6('0xd2'));rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xf7'));}else{rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xf7'));}}else{_0x2850ca[_0x07f6('0xd5')]++;_0x4b3eba[_0x07f6('0xb5')]({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countnoanswerretry':_0x2850ca[_0x07f6('0xd5')]}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});});}});delete this[_0x07f6('0x18')][_0x18c183[_0x07f6('0xb3')]];break;case'19':_0x38c6ee[_0x07f6('0x45')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut[_0x07f6('0xa1')](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0x13,_0x18c183['cause-txt']||_0x18c183[_0x07f6('0xf8')]);ami['emit'](_0x07f6('0xf5'),ut[_0x07f6('0xa4')](_0x2850ca,_0x07f6('0xf6')));rpcDb['createCustomerHistory'](_0x2850ca,_0x07f6('0xf9'));_0x4b3eba[_0x07f6('0xd0')](_0x2850ca,'18',_0x38c6ee)[_0x07f6('0x85')](function(_0x29ce04){_0x494eaf=_0x29ce04['additional']==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,'Global');rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xf9'));}else{rpcDb[_0x07f6('0xab')](_0x2850ca,_0x07f6('0xf9'));}}else{_0x2850ca['countnoanswerretry']++;_0x4b3eba[_0x07f6('0xb5')]({'id':_0x2850ca[_0x07f6('0xb6')],'field':{'countnoanswerretry':_0x2850ca[_0x07f6('0xd5')]}})[_0x07f6('0x85')](function(){_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)['then'](function(){});});}});delete this[_0x07f6('0x18')][_0x18c183[_0x07f6('0xb3')]];break;default:if(_0x2850ca[_0x07f6('0x73')]){ut['decrementTalkink'](_0x38c6ee,'[default]');ut[_0x07f6('0x7d')](_0x07f6('0xfa')+_0x38c6ee[_0x07f6('0x59')],_0x18c183);}_0x38c6ee[_0x07f6('0x45')]+=0x1;_0x2850ca[_0x07f6('0xa0')]=ut[_0x07f6('0xa1')](_0x2850ca);ut[_0x07f6('0x95')](_0x2850ca,0xc,_0x18c183[_0x07f6('0xf4')]||_0x18c183[_0x07f6('0xf8')]);_0x4c1e04=_0x38c6ee[_0x07f6('0xe8')];_0x28497e=_0x38c6ee[_0x07f6('0xa8')];rpcDb['createCustomerHistory'](_0x2850ca,'[callProgressDetectingCustomer][logUnknown]');_0x4b3eba['verifyAdditionalPhones'](_0x2850ca,'20',_0x38c6ee)[_0x07f6('0x85')](function(_0x5e8853){_0x494eaf=_0x5e8853['additional']==0x1;if(!_0x494eaf){if(ut[_0x07f6('0xa1')](_0x2850ca)>=_0x38c6ee[_0x07f6('0xa9')]){_0x1d0219=ut[_0x07f6('0xaa')](_0x2850ca,0xf,_0x07f6('0xd2'));rpcDb[_0x07f6('0xab')](_0x1d0219,_0x07f6('0xfb'));}else{rpcDb['createCustomerFinal'](_0x2850ca,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x18c183[_0x07f6('0xb3')]];}else{_0x4b3eba[_0x07f6('0xb7')](_0x2850ca,_0x4c1e04,_0x28497e)[_0x07f6('0x85')](function(){});}});}if(!(_0x2850ca[_0x07f6('0x73')]&&_0x122b41==='16')){ut['updateOriginated'](_0x38c6ee,_0x07f6('0xfc'));logger[_0x07f6('0x5b')](_0x07f6('0xfd'),_0x2850ca[_0x07f6('0xbb')],_0x07f6('0xbc'),_0x38c6ee[_0x07f6('0x59')],'originated:\x20',_0x38c6ee[_0x07f6('0x4d')]);}if(_0x122b41!==_0x07f6('0xb8')){delete this[_0x07f6('0x18')][_0x18c183[_0x07f6('0xb3')]];delete this[_0x07f6('0x18')][_0x18c183[_0x07f6('0xfe')]];}}};Preview['prototype'][_0x07f6('0xff')]=function(_0x30abf7,_0x10776b,_0x169817){if(_[_0x07f6('0x100')](_0x10776b)&&_0x07f6('0x101')!==typeof _0x10776b){return;}if(_['isUndefined'](_0x169817)&&'object'!==typeof _0x169817){return;}switch(_0x169817['reason']){case'0':ut[_0x07f6('0x102')](_0x30abf7,0x0,_0x07f6('0xa2'));rpcDb[_0x07f6('0x103')](_0x30abf7,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x30abf7,0x3,_0x07f6('0xd6'));rpcDb['createAgentHistory'](_0x30abf7,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x07f6('0x102')](_0x30abf7,0x5,_0x07f6('0xcb'));rpcDb[_0x07f6('0x103')](_0x30abf7,_0x07f6('0x104'));break;case'8':ut['logAgent'](_0x30abf7,0x8,_0x07f6('0xde'));rpcDb['createAgentHistory'](_0x30abf7,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x07f6('0x102')](_0x30abf7,0x16,_0x07f6('0x105'));rpcDb[_0x07f6('0x103')](_0x30abf7,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x30abf7,0xc,_0x169817[_0x07f6('0x106')]);rpcDb[_0x07f6('0x103')](_0x30abf7,_0x07f6('0x107'));}ut[_0x07f6('0x108')](_0x10776b,'[callProgressDetectingAgent]');logger[_0x07f6('0x5b')](_0x07f6('0x109'),_0x30abf7[_0x07f6('0xbb')],_0x07f6('0xbc'),_0x10776b['name'],'originated:\x20',_0x10776b[_0x07f6('0x4d')]);delete this[_0x07f6('0x18')][_0x30abf7['uniqueid']];};Preview[_0x07f6('0x12')]['verifyAdditionalPhones']=function(_0x3d147d,_0x1ad47e,_0x3534f5){return Promise[_0x07f6('0x10a')]()[_0x07f6('0x85')](cmHopperAdditionalPhone[_0x07f6('0xd0')](_0x3d147d,_0x1ad47e,_0x3534f5))['catch'](logger[_0x07f6('0x5b')]('[verifyAdditionalPhone]\x20'));};Preview[_0x07f6('0x12')]['swapAdditionalPhones']=function(_0x2bb85a,_0x471aaa,_0x38f5c8){return Promise[_0x07f6('0x10a')]()[_0x07f6('0x85')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2bb85a,_0x471aaa,_0x38f5c8))[_0x07f6('0x79')](logger[_0x07f6('0x5b')](_0x07f6('0x10b')));};Preview[_0x07f6('0x12')][_0x07f6('0xb5')]=function(_0x3fdc14){return Promise[_0x07f6('0x10a')]()['then'](cmHopperAdditionalPhone[_0x07f6('0xb5')](_0x3fdc14))[_0x07f6('0x79')](logger[_0x07f6('0x5b')](_0x07f6('0x10c')));};Preview['prototype'][_0x07f6('0x10d')]=function(_0x571c2d,_0x1b91c3,_0x4767a8,_0x5dc7e2,_0x26ecc5){var _0x1421a0=this;return new Promise(function(_0x5e3536,_0x5b2c77){if(_[_0x07f6('0x6f')](_0x1b91c3)||_['isNil'](_0x1b91c3[_0x07f6('0x10e')])||_[_0x07f6('0x6f')](_0x1b91c3[_0x07f6('0x10f')])||_['isNil'](_0x1b91c3[_0x07f6('0x110')])){_0x5b2c77(ut[_0x07f6('0x4c')](_0x07f6('0x111'),_0x5dc7e2,_0x26ecc5));return;}var _0x567ecc=uuid['v4']();var _0x2ff645=_0x1421a0[_0x07f6('0x67')][_0x1b91c3[_0x07f6('0x112')]['name']];var _0x1fd7ab=_0x4767a8?_0x1421a0['agents'][_0x4767a8]['id']:undefined;_0x1421a0[_0x07f6('0x18')][_0x567ecc]=new Action(_0x1b91c3,_0x2ff645,_0x567ecc,_0x4767a8,_0x1fd7ab);var _0x2b1a4b=_0x1421a0[_0x07f6('0x18')][_0x567ecc];_0x2b1a4b[_0x07f6('0xb1')]=_0x5dc7e2;_0x2b1a4b[_0x07f6('0xb2')]=_0x26ecc5;_0x2b1a4b[_0x07f6('0x113')]=_0x4767a8;if(_['isEmpty'](_0x571c2d)){_0x1421a0[_0x07f6('0x114')](_0x2b1a4b,_0x2ff645,_0x1b91c3,_0x4767a8)[_0x07f6('0x85')](function(_0xd9d0a0){logger[_0x07f6('0x5b')](_0x07f6('0x115'),_0x07f6('0x116')+_0x2b1a4b['queue']+_0x07f6('0x117')+_0x2b1a4b['idContact'],JSON['stringify'](_0xd9d0a0));ami[_0x07f6('0x2b')](_0x07f6('0x118'),ut[_0x07f6('0xa4')](_0x2b1a4b,_0x07f6('0x119'),_0x1421a0[_0x07f6('0x67')][_0x2b1a4b[_0x07f6('0x72')]]));_0x5e3536(ut[_0x07f6('0x4c')](_0x07f6('0x11a')));})[_0x07f6('0x79')](function(_0x4e2664){ut['logger'](_0x07f6('0x11b'),_0x4e2664);_0x5b2c77(ut[_0x07f6('0x4c')](_0x07f6('0x11c'),_0x5dc7e2,_0x26ecc5));});}else{_0x2ff645[_0x07f6('0x40')]+=0x1;ut[_0x07f6('0x11d')](_0x2b1a4b);rpcDb[_0x07f6('0x11e')](_0x2b1a4b,_0x07f6('0x11f'));delete _0x1421a0['actions'][_0x567ecc];_0x5b2c77(ut[_0x07f6('0x4c')]('Contact\x20in\x20black\x20List',_0x5dc7e2,_0x26ecc5));}});};Preview[_0x07f6('0x12')][_0x07f6('0x9c')]=function(_0x506c64){return!_[_0x07f6('0x6f')](_0x506c64)&&!_[_0x07f6('0x6f')](_0x506c64['name'])&&!_[_0x07f6('0x6f')](_0x506c64[_0x07f6('0x53')])&&_0x506c64[_0x07f6('0x53')]&&!_['isNil'](this[_0x07f6('0x17')][util[_0x07f6('0x57')](_0x07f6('0x120'),_0x506c64[_0x07f6('0x59')])])&&!_[_0x07f6('0x6f')](this[_0x07f6('0x17')][util[_0x07f6('0x57')](_0x07f6('0x120'),_0x506c64[_0x07f6('0x59')])][_0x07f6('0x77')])&&(this[_0x07f6('0x17')][util[_0x07f6('0x57')](_0x07f6('0x120'),_0x506c64['name'])][_0x07f6('0x77')]===_0x07f6('0x121')||this['trunks'][util[_0x07f6('0x57')](_0x07f6('0x120'),_0x506c64[_0x07f6('0x59')])][_0x07f6('0x77')]===_0x07f6('0x122'));};Preview[_0x07f6('0x12')]['run']=function(_0x3c4018,_0x30ec95){var _0x31d5ba=this;return new Promise(function(_0x3d3c52,_0x51901a){_0x31d5ba[_0x07f6('0x123')](_0x3c4018,_0x30ec95)['then'](function(_0x1e6ef6){_0x3d3c52(_[_0x07f6('0x74')](_0x1e6ef6,[_0x07f6('0x4c')]));})[_0x07f6('0x79')](function(_0x5cf01e){if(_0x5cf01e['unlock']){rpcDb['unlockContact'](_0x3c4018);}if(_0x5cf01e[_0x07f6('0x53')]){rpcDb[_0x07f6('0x124')](_0x3c4018);}_0x51901a(_[_0x07f6('0x74')](_0x5cf01e,[_0x07f6('0x4c')]));});});};Preview[_0x07f6('0x12')][_0x07f6('0x123')]=function(_0x2880c7,_0x31b041){var _0x6602fa=this;return new Promise(function(_0x239671,_0x2fd985){var _0x15ce00,_0x3fce69;rpcDb[_0x07f6('0x125')](_0x2880c7)[_0x07f6('0x85')](function(_0x55b376){if(!_[_0x07f6('0x6f')](_0x55b376[0x0])){_0x3fce69=_0x55b376[0x0][_0x07f6('0x126')]?![]:!![];_0x15ce00=_0x55b376[0x0]['recallme']?!![]:![];_0x15ce00=_0x31b041?!![]:_0x15ce00;}var _0x293dc9=_0x6602fa[_0x07f6('0x127')](_0x55b376);if(_0x293dc9[_0x07f6('0x128')]){rpcDb['checkIsBlackList'](_['pick'](_0x55b376[0x0],[_0x07f6('0x110'),'phone']))[_0x07f6('0x85')](function(_0x967c1e){_0x6602fa['checkInBlack'](_0x967c1e,_0x55b376[0x0],_0x31b041,_0x3fce69,_0x15ce00)[_0x07f6('0x85')](function(_0x48bd50){_0x239671(_0x48bd50);})[_0x07f6('0x79')](function(_0x1be136){_0x2fd985(_0x1be136);});})[_0x07f6('0x79')](function(_0x3cb9f9){ut[_0x07f6('0x65')](_0x07f6('0x129'),_0x3cb9f9);_0x2fd985(ut[_0x07f6('0x4c')](_0x07f6('0x12a'),_0x3fce69,_0x15ce00));});}else{_0x2fd985(ut[_0x07f6('0x4c')](_0x293dc9['message'],_0x3fce69,_0x15ce00));}})[_0x07f6('0x79')](function(_0x104277){ut[_0x07f6('0x65')](_0x07f6('0x12b'),_0x104277);_0x2fd985(ut['message'](_0x07f6('0x12a'),![],!![]));});});};Preview[_0x07f6('0x12')][_0x07f6('0x127')]=function(_0x492b33){if(_[_0x07f6('0x6f')](_0x492b33)||_[_0x07f6('0x12c')](_0x492b33)||!_[_0x07f6('0x6f')](_0x492b33[0x0][_0x07f6('0x8a')])&&_['isNil'](_0x492b33[0x0]['Agent'][_0x07f6('0x59')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x492b33);return{'isValid':![],'message':_0x07f6('0x12d')};}var _0x4521ac=this[_0x07f6('0x67')][_0x492b33[0x0][_0x07f6('0x112')][_0x07f6('0x59')]];_0x4521ac[_0x07f6('0x4c')]=_0x07f6('0x9e');if(_[_0x07f6('0x6f')](_0x4521ac)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x4521ac);return{'isValid':![],'message':_0x07f6('0x12e')};}if(!this[_0x07f6('0x9c')](_0x4521ac[_0x07f6('0x52')])){ut[_0x07f6('0x65')](_0x07f6('0x12f'),_0x07f6('0x130')+_0x4521ac[_0x07f6('0x59')]+_0x07f6('0x131'));if(!this[_0x07f6('0x9c')](_0x4521ac[_0x07f6('0x9d')])){ut[_0x07f6('0x65')](_0x07f6('0x12f'),_0x4521ac['name']+_0x07f6('0x132'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x07f6('0x9b')](_0x4521ac[_0x07f6('0x39')])){ut[_0x07f6('0x65')]('[Preview][validateContact][Campaign\x20Active]',_0x4521ac[_0x07f6('0x59')]+_0x07f6('0x133'));return{'isValid':![],'message':_0x07f6('0x130')+_0x4521ac[_0x07f6('0x59')]+_0x07f6('0x133')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x07f6('0x12')][_0x07f6('0x114')]=function(_0x2dede8,_0x4109b6,_0x2385f7,_0x1180e9){var _0x5cdd28=this;return new Promise(function(_0x377d22,_0x4af644){var _0xdb964c=_0x2dede8[_0x07f6('0xbb')];var _0x5d7565=_0x5cdd28[_0x07f6('0x9c')](_0x4109b6[_0x07f6('0x52')])?util['format'](_0x07f6('0x134'),_0x4109b6[_0x07f6('0x52')]['name'],_['isNil'](_0x4109b6[_0x07f6('0x3e')])?'':_0x4109b6[_0x07f6('0x3e')][_0x07f6('0x135')]()||'',_0x4109b6[_0x07f6('0x136')]>0x0?_0x2385f7[_0x07f6('0x10f')][_0x07f6('0x137')](_0x4109b6[_0x07f6('0x136')]):_0x2385f7['phone']):util[_0x07f6('0x57')]('SIP/%s/%s%s',_[_0x07f6('0x6f')](_0x4109b6['TrunkBackup'])?_0x4109b6[_0x07f6('0x52')][_0x07f6('0x59')]:_0x4109b6[_0x07f6('0x9d')]['name'],_[_0x07f6('0x6f')](_0x4109b6[_0x07f6('0x3e')])?'':_0x4109b6[_0x07f6('0x3e')][_0x07f6('0x135')]()||'',_0x4109b6[_0x07f6('0x136')]>0x0?_0x2385f7[_0x07f6('0x10f')][_0x07f6('0x137')](_0x4109b6[_0x07f6('0x136')]):_0x2385f7[_0x07f6('0x10f')]);var _0x54f684=_0x5cdd28[_0x07f6('0x9c')](_0x4109b6[_0x07f6('0x52')])?ut[_0x07f6('0x138')](_0x4109b6[_0x07f6('0x52')][_0x07f6('0x54')],_0x4109b6[_0x07f6('0x3b')],_0x4109b6[_0x07f6('0x139')]>0x0?ut[_0x07f6('0x13a')](_0x4109b6[_0x07f6('0x3c')],_0x4109b6[_0x07f6('0x139')]):_0x4109b6['dialOriginateCallerIdNumber']):ut[_0x07f6('0x138')](_['isNil'](_0x4109b6[_0x07f6('0x9d')])?_0x4109b6[_0x07f6('0x52')][_0x07f6('0x54')]:_0x4109b6[_0x07f6('0x9d')]['callerid'],_0x4109b6[_0x07f6('0x3b')],_0x4109b6[_0x07f6('0x139')]>0x0?ut[_0x07f6('0x13a')](_0x4109b6[_0x07f6('0x3c')],_0x4109b6[_0x07f6('0x139')]):_0x4109b6['dialOriginateCallerIdNumber']);if(_0x54f684){_0x2dede8[_0x07f6('0x13b')]=ut[_0x07f6('0x13c')](_0x54f684);_0x2dede8['originatecalleridnum']=ut[_0x07f6('0x13d')](_0x54f684);}var _0x1871f6=ut[_0x07f6('0x13e')](_0x4109b6,_0x2385f7,_0x5d7565,_0x54f684,_0xdb964c,_0x2dede8);_[_0x07f6('0x13f')](_0x2dede8,ut[_0x07f6('0x140')](_0x1871f6));_0x2dede8[_0x07f6('0x141')]=moment()[_0x07f6('0x57')](_0x07f6('0x142'));_0x4109b6['variables']=_0x1871f6;ami[_0x07f6('0x76')](ut[_0x07f6('0x143')](_0x2dede8,_0x4109b6,_0x1871f6,_0x2dede8[_0x07f6('0xb2')],_0x1180e9))[_0x07f6('0x85')](function(_0x353b54){_0x4109b6['originated']+=0x1;logger[_0x07f6('0x5b')]('[originated][increment]',_0xdb964c,'\x20Queue',_0x4109b6['name'],'originated:\x20',_0x4109b6[_0x07f6('0x4d')]);_0x377d22(_0x353b54);})[_0x07f6('0x79')](function(_0x5cb550){ut[_0x07f6('0x102')](_0x2dede8,0xe,_0x07f6('0x144'));rpcDb[_0x07f6('0x103')](_0x2dede8,_0x07f6('0x145'));_0x4af644(_0x5cb550);});});};Preview[_0x07f6('0x12')]['syncNewExten']=function(_0x369052){if(this[_0x07f6('0x18')][_0x369052['linkedid']]){this['actions'][_0x369052[_0x07f6('0xb3')]][_0x07f6('0x78')]=_0x369052[_0x07f6('0x78')];}};Preview['prototype'][_0x07f6('0x1c')]=function(_0x75790){var _0x5b2eec=this;var _0x230ddf=this[_0x07f6('0x18')][_0x75790[_0x07f6('0x146')]];if(_0x230ddf){if(_0x230ddf[_0x07f6('0x113')]&&this['agents'][_0x230ddf[_0x07f6('0x113')]]){ut['logLookAgent'](_0x230ddf,this[_0x07f6('0x19')][_0x230ddf[_0x07f6('0x113')]]['name'],this[_0x07f6('0x19')][_0x230ddf[_0x07f6('0x113')]]['id']);}var _0x201d3a=_[_0x07f6('0x147')](_0x230ddf);_0x201d3a['responsetime']=moment()[_0x07f6('0x57')](_0x07f6('0x142'));var _0x2e716e=_0x5b2eec['campaignsPreview'][_0x230ddf[_0x07f6('0x72')]];if(ut[_0x07f6('0x148')](_0x75790['response'])){if(_0x230ddf[_0x07f6('0xb1')]){rpcDb[_0x07f6('0x149')](_0x230ddf[_0x07f6('0xb6')]);}if(_0x230ddf[_0x07f6('0xb2')]){rpcDb['disableContact'](_0x230ddf['idContact']);}ami[_0x07f6('0x2b')](_0x07f6('0x14a'),ut[_0x07f6('0xa4')](_0x230ddf,'rejected',this[_0x07f6('0x67')][_0x230ddf[_0x07f6('0x72')]]));this[_0x07f6('0xff')](_0x201d3a,_0x2e716e,_0x75790);}else{_0x230ddf[_0x07f6('0x141')]=moment()[_0x07f6('0x57')](_0x07f6('0x142'));ut[_0x07f6('0x102')](_0x201d3a,0x4,_0x07f6('0x14b'));rpcDb[_0x07f6('0x103')](_0x201d3a,_0x07f6('0x14c'));}}};Preview[_0x07f6('0x12')][_0x07f6('0x1f')]=function(_0x268e13){var _0x28898a=this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]];var _0x4e209e;if(_0x28898a){_0x4e209e=this[_0x07f6('0x67')][_0x28898a[_0x07f6('0x72')]];logger[_0x07f6('0x5b')](_0x07f6('0x14d'),_0x268e13['linkedid'],_0x07f6('0xbc'),_0x4e209e[_0x07f6('0x59')],'pTalking:\x20',_0x4e209e[_0x07f6('0x5f')]);}if(this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]]&&_0x268e13[_0x07f6('0xb3')]!==_0x268e13[_0x07f6('0xbb')]){if(_0x268e13[_0x07f6('0x14e')]==='16'&&this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]]['dialAnswer']){this[_0x07f6('0x9f')](_0x268e13,_0x268e13['linkedid'],_0x268e13[_0x07f6('0x14e')]);}else if(this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]][_0x07f6('0x73')]){logger[_0x07f6('0x5b')]('[syncHangup][talking][cause]',_0x268e13['linkedid'],_0x268e13[_0x07f6('0x14e')],_0x07f6('0xbc'),_0x4e209e['name'],_0x07f6('0xbd'),_0x4e209e[_0x07f6('0x5f')]);this[_0x07f6('0x9f')](_0x268e13,_0x268e13[_0x07f6('0xb3')],_0x268e13[_0x07f6('0x14e')]);}}else if(_0x28898a&&_[_0x07f6('0x6f')](_0x28898a[_0x07f6('0x14f')])&&_0x4e209e[_0x07f6('0x150')]&&_0x268e13[_0x07f6('0xb3')]===_0x268e13[_0x07f6('0xbb')]&&_[_0x07f6('0x6f')](_0x268e13[_0x07f6('0x106')])&&_0x268e13[_0x07f6('0x14e')]==='16'&&_0x268e13['channelstate']==='6'&&_[_0x07f6('0x100')](_0x28898a[_0x07f6('0x151')])){if(_0x28898a['unlockAgent']){rpcDb[_0x07f6('0x149')](_0x28898a[_0x07f6('0xb6')]);}if(_0x28898a[_0x07f6('0xb2')]){rpcDb[_0x07f6('0x124')](_0x28898a['idContact']);}_0x268e13[_0x07f6('0x106')]='22';this['callProgressDetectingAgent'](_0x28898a,_0x4e209e,_0x268e13);}else if(_0x28898a&&_0x28898a[_0x07f6('0x151')]){if(_0x268e13[_0x07f6('0x14e')]==='16'&&this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]][_0x07f6('0x73')]){logger[_0x07f6('0x5b')](_0x07f6('0x152'),_0x268e13[_0x07f6('0xb3')],_0x268e13[_0x07f6('0x14e')],_0x07f6('0xbc'),_0x4e209e['name'],_0x07f6('0xbd'),_0x4e209e['pTalking']);this['callProgressDetectingCustomer'](_0x268e13,_0x268e13[_0x07f6('0xb3')],_0x268e13['cause']);}else if(this[_0x07f6('0x18')][_0x268e13[_0x07f6('0xb3')]][_0x07f6('0x73')]){logger['info']('[syncHangup][talking][cause]',_0x268e13['linkedid'],_0x268e13[_0x07f6('0x14e')],_0x07f6('0xbc'),_0x4e209e[_0x07f6('0x59')],_0x07f6('0xbd'),_0x4e209e['pTalking']);this[_0x07f6('0x9f')](_0x268e13,_0x268e13['linkedid'],_0x268e13[_0x07f6('0x14e')]);}}};Preview[_0x07f6('0x12')][_0x07f6('0x22')]=function(_0x18a303){if(this['actions'][_0x18a303['destlinkedid']]&&_0x18a303[_0x07f6('0xfe')]!==_0x18a303[_0x07f6('0x153')]){this[_0x07f6('0x9f')](_0x18a303,_0x18a303[_0x07f6('0xfe')],_0x18a303['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x39a31d){if(this['actions'][_0x39a31d[_0x07f6('0xb3')]]&&_0x39a31d[_0x07f6('0xb3')]!==_0x39a31d['uniqueid']&&!this[_0x07f6('0x18')][_0x39a31d['linkedid']][_0x07f6('0x73')]){if(_0x39a31d['cause']==='1'){this['callProgressDetectingCustomer'](_0x39a31d,_0x39a31d[_0x07f6('0xb3')],_0x39a31d[_0x07f6('0x14e')]);}}};Preview[_0x07f6('0x12')]['addVariable']=function(_0x5bdfc0,_0x4a828e,_0x316a5f){if(this[_0x07f6('0x18')][_0x5bdfc0]){if(_[_0x07f6('0x6f')](this['actions'][_0x5bdfc0]['variables'])){this[_0x07f6('0x18')][_0x5bdfc0][_0x07f6('0x154')]={};}this[_0x07f6('0x18')][_0x5bdfc0][_0x07f6('0x154')][_0x4a828e]=_0x316a5f;}};Preview['prototype'][_0x07f6('0x26')]=function(_0x1bf6ad){try{if(!_[_0x07f6('0x6f')](_0x1bf6ad)){if(ut[_0x07f6('0x155')](_['keys'](_0x1bf6ad[_0x07f6('0x156')])[0x0])){this[_0x07f6('0x157')](_0x1bf6ad[_0x07f6('0xbb')],_[_0x07f6('0x158')](_0x1bf6ad['variable'])[0x0],_0x1bf6ad[_0x07f6('0x159')]);}}}catch(_0x2cfdee){logger[_0x07f6('0x15a')]('[syncVarSet][Preview]',util[_0x07f6('0x15b')](_0x2cfdee,{'showHidden':![],'depth':null}));}};Preview[_0x07f6('0x12')][_0x07f6('0x28')]=function(_0x14f878){if(_0x14f878){if(this[_0x07f6('0x18')][_0x14f878[_0x07f6('0x15c')]]){this[_0x07f6('0x18')][_0x14f878[_0x07f6('0x15c')]]['transfer']=!![];}}};Preview[_0x07f6('0x12')][_0x07f6('0x15d')]=function(_0x233c46){if(_0x233c46){if(this[_0x07f6('0x18')][_0x233c46[_0x07f6('0x15e')]]){this[_0x07f6('0x18')][_0x233c46[_0x07f6('0x15e')]][_0x07f6('0x151')]=!![];}}};module[_0x07f6('0x15f')]=Preview; \ No newline at end of file +var _0xe7d3=['loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','disableContact','starttime','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','logger2','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','NOANSWER','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','emit','type','outbound','name','strategy','answered','available','pTalking','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','prototype','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink'];(function(_0x1eaf7f,_0x2d9267){var _0x56e2b0=function(_0x4d5d31){while(--_0x4d5d31){_0x1eaf7f['push'](_0x1eaf7f['shift']());}};_0x56e2b0(++_0x2d9267);}(_0xe7d3,0xdf));var _0x3e7d=function(_0xc28ff4,_0xa34f28){_0xc28ff4=_0xc28ff4-0x0;var _0xd0ad94=_0xe7d3[_0xc28ff4];return _0xd0ad94;};'use strict';var util=require(_0x3e7d('0x0'));var _=require('lodash');var uuid=require(_0x3e7d('0x1'));var moment=require('moment');var md5=require(_0x3e7d('0x2'));var Redis=require(_0x3e7d('0x3'));var config=require('../../../config/environment');var logger=require(_0x3e7d('0x4'))(_0x3e7d('0x5'));var loggerAction=require(_0x3e7d('0x4'))(_0x3e7d('0x6'));var ami=require(_0x3e7d('0x7'));var rpcDb=require(_0x3e7d('0x8'));var cmHopperAdditionalPhone=require(_0x3e7d('0x9'));var Action=require(_0x3e7d('0xa'));var ut=require(_0x3e7d('0xb'));config[_0x3e7d('0xc')]=_[_0x3e7d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3e7d('0xe'))(new Redis(config[_0x3e7d('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x3e7d('0xf')]=function(_0x2b4e6a){this[_0x3e7d('0x10')]=this[_0x3e7d('0x10')]?this[_0x3e7d('0x10')][_0x3e7d('0x11')](_0x2b4e6a):_0x2b4e6a();};function Preview(_0x481ad4){this['sequence']=new Sequence();this[_0x3e7d('0x12')]=_0x481ad4[_0x3e7d('0x13')];this['trunks']=_0x481ad4[_0x3e7d('0x14')];this[_0x3e7d('0x15')]={};this[_0x3e7d('0x16')]=_0x481ad4[_0x3e7d('0x16')];this[_0x3e7d('0x17')]=0x0;ami['on'](_0x3e7d('0x18'),this[_0x3e7d('0x19')]['bind'](this));ami['on'](_0x3e7d('0x1a'),this[_0x3e7d('0x1b')][_0x3e7d('0x1c')](this));ami['on'](_0x3e7d('0x1d'),this[_0x3e7d('0x1e')][_0x3e7d('0x1c')](this));ami['on'](_0x3e7d('0x1f'),this[_0x3e7d('0x20')][_0x3e7d('0x1c')](this));ami['on']('newexten',this[_0x3e7d('0x21')][_0x3e7d('0x1c')](this));ami['on'](_0x3e7d('0x22'),this[_0x3e7d('0x23')][_0x3e7d('0x1c')](this));ami['on'](_0x3e7d('0x24'),this[_0x3e7d('0x25')][_0x3e7d('0x1c')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x3e7d('0x1c')](this));this['loopCampaigns'](this[_0x3e7d('0x12')]);}function emit(_0x5c14bc,_0x5773f8,_0x587aa2){io['to'](_0x5c14bc)[_0x3e7d('0x26')](_0x5773f8,_0x587aa2);}function emitCampaignPreview(_0x1deb25){if(_0x1deb25[_0x3e7d('0x27')]===_0x3e7d('0x28')){var _0x46c53d={'id':_0x1deb25['id'],'name':_0x1deb25[_0x3e7d('0x29')],'strategy':_0x1deb25[_0x3e7d('0x2a')],'answered':_0x1deb25[_0x3e7d('0x2b')],'available':_0x1deb25[_0x3e7d('0x2c')],'loggedIn':_0x1deb25['loggedIn'],'pTalking':_0x1deb25[_0x3e7d('0x2d')],'sumBillable':_0x1deb25['sumBillable'],'sumDuration':_0x1deb25['sumDuration'],'sumHoldTime':_0x1deb25['sumHoldTime']||0x0,'talking':_0x1deb25[_0x3e7d('0x2e')],'total':_0x1deb25[_0x3e7d('0x2f')],'type':_0x1deb25[_0x3e7d('0x27')],'unmanaged':_0x1deb25[_0x3e7d('0x30')],'abandoned':_0x1deb25[_0x3e7d('0x31')],'waiting':_0x1deb25[_0x3e7d('0x32')],'loggedInDb':_0x1deb25['loggedInDb'],'dialActive':_0x1deb25[_0x3e7d('0x33')],'dialMethod':_0x1deb25[_0x3e7d('0x34')],'dialOriginateCallerIdName':_0x1deb25[_0x3e7d('0x35')],'dialOriginateCallerIdNumber':_0x1deb25['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1deb25[_0x3e7d('0x36')],'dialPrefix':_0x1deb25[_0x3e7d('0x37')],'outboundAnswerAgiCallsDay':_0x1deb25[_0x3e7d('0x38')],'outboundAnswerCallsDay':_0x1deb25[_0x3e7d('0x39')],'outboundBlacklistCallsDay':_0x1deb25[_0x3e7d('0x3a')],'outboundBusyCallsDay':_0x1deb25[_0x3e7d('0x3b')],'outboundCongestionCallsDay':_0x1deb25[_0x3e7d('0x3c')],'outboundDropCallsDayACS':_0x1deb25['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1deb25['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1deb25[_0x3e7d('0x3d')],'outboundNoAnswerCallsDay':_0x1deb25[_0x3e7d('0x3e')],'outboundNoSuchCallsDay':_0x1deb25[_0x3e7d('0x3f')],'outboundOriginateFailureCallsDay':_0x1deb25[_0x3e7d('0x40')],'outboundReCallsDay':_0x1deb25['outboundReCallsDay'],'outboundRejectCallsDay':_0x1deb25[_0x3e7d('0x41')],'outboundUnknownCallsDay':_0x1deb25[_0x3e7d('0x42')],'outboundAbandonedCallsDay':_0x1deb25[_0x3e7d('0x43')],'predictiveIntervalAnsweredCalls':_0x1deb25['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1deb25[_0x3e7d('0x44')],'predictiveIntervalAvgTalktime':_0x1deb25[_0x3e7d('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x1deb25['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1deb25[_0x3e7d('0x46')],'predictiveIntervalErlangCalls':_0x1deb25[_0x3e7d('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x1deb25[_0x3e7d('0x48')],'predictiveIntervalHitRate':_0x1deb25['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1deb25[_0x3e7d('0x49')],'predictiveIntervalPauses':_0x1deb25[_0x3e7d('0x4a')],'predictiveIntervalAvailable':_0x1deb25[_0x3e7d('0x4b')],'predictiveIntervalTotalCalls':_0x1deb25[_0x3e7d('0x4c')],'message':_0x1deb25[_0x3e7d('0x4d')],'originated':_0x1deb25[_0x3e7d('0x4e')],'erlangCalls':_0x1deb25[_0x3e7d('0x4f')],'erlangCallToSecond':_0x1deb25[_0x3e7d('0x50')],'erlangAbandonmentRate':_0x1deb25[_0x3e7d('0x51')],'erlangBusyFactor':_0x1deb25['erlangBusyFactor'],'startPredictive':_0x1deb25[_0x3e7d('0x52')],'startProgressive':_0x1deb25[_0x3e7d('0x53')]};if(_0x1deb25[_0x3e7d('0x54')]){_0x46c53d['Trunk']={'id':_0x1deb25['Trunk']['id'],'name':_0x1deb25['Trunk'][_0x3e7d('0x29')],'active':_0x1deb25[_0x3e7d('0x54')][_0x3e7d('0x55')],'callerid':_0x1deb25[_0x3e7d('0x54')]['callerid']};}if(_0x1deb25[_0x3e7d('0x56')]){_0x46c53d[_0x3e7d('0x56')]={'id':_0x1deb25[_0x3e7d('0x56')]['id'],'name':_0x1deb25[_0x3e7d('0x56')]['name']};}var _0x472336=md5(JSON[_0x3e7d('0x57')](_0x46c53d));if(_0x1deb25[_0x3e7d('0x2')]!==_0x472336){_0x1deb25[_0x3e7d('0x2')]=_0x472336;emit(util[_0x3e7d('0x58')](_0x3e7d('0x59'),_0x46c53d['name']),_0x3e7d('0x5a'),_0x46c53d);}}}function emitVoiceQueueChannelRemove(_0x4f0ee9){logger[_0x3e7d('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x3e7d('0x57')](_0x4f0ee9));emit(util[_0x3e7d('0x58')](_0x3e7d('0x59'),_0x4f0ee9[_0x3e7d('0x29')]),_0x3e7d('0x5c'),_0x4f0ee9);io[_0x3e7d('0x26')]('voice_queue_presence:remove',_0x4f0ee9);}function notSendMessagesQueue(_0x107b25){if(_0x107b25[_0x3e7d('0x5d')]){if(_0x107b25[_0x3e7d('0x4e')]===0x0&&_0x107b25[_0x3e7d('0x2d')]===0x0){_0x107b25[_0x3e7d('0x5d')]=![];_0x107b25['available']=0x0;_0x107b25[_0x3e7d('0x5e')]=0x0;_0x107b25[_0x3e7d('0x4d')]=_0x3e7d('0x5f');ut[_0x3e7d('0x60')](_0x3e7d('0x61'),_0x107b25[_0x3e7d('0x29')]+_0x3e7d('0x62'));}else{_0x107b25['message']=_0x3e7d('0x63');ut[_0x3e7d('0x60')](_0x3e7d('0x61'),_0x107b25['name']+_0x3e7d('0x64'));}emitCampaignPreview(_0x107b25);}}Preview['prototype'][_0x3e7d('0x65')]=function(){var _0x2e1dae=this;setInterval(function(){_0x2e1dae[_0x3e7d('0x66')]();},0x7cf);};Preview[_0x3e7d('0x67')][_0x3e7d('0x66')]=function(){var _0x45f70c=this[_0x3e7d('0x12')];this[_0x3e7d('0x17')]+=0x1;for(var _0x418f89 in _0x45f70c){if(_0x45f70c[_0x3e7d('0x68')](_0x418f89)&&(_0x45f70c[_0x418f89]['dialMethod']===_0x3e7d('0x5')||_0x45f70c[_0x418f89]['dialMethod']==='booked')&&_0x45f70c[_0x418f89][_0x3e7d('0x27')]===_0x3e7d('0x28')){if(this['clockClearZombieChannels']>0x7){this[_0x3e7d('0x17')]=0x0;this[_0x3e7d('0x69')]();}}if(_0x45f70c[_0x3e7d('0x68')](_0x418f89)&&_0x45f70c[_0x418f89][_0x3e7d('0x34')]===_0x3e7d('0x5')&&_0x45f70c[_0x418f89][_0x3e7d('0x27')]==='outbound'){if(_0x45f70c[_0x418f89][_0x3e7d('0x33')]){this[_0x3e7d('0x6a')](_0x45f70c[_0x418f89]);if(_0x45f70c[_0x418f89][_0x3e7d('0x6b')])this[_0x3e7d('0x6c')](_0x45f70c[_0x418f89]);}else{notSendMessagesQueue(_0x45f70c[_0x418f89]);}}}};Preview['prototype'][_0x3e7d('0x6d')]=function(_0x5ba5bd){var _0xc1a4b4=this;this[_0x3e7d('0x6e')][_0x3e7d('0xf')](function(){if(!_[_0x3e7d('0x6f')](_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd])){loggerAction[_0x3e7d('0x5b')](_0x3e7d('0x70'),_0x5ba5bd,_0x3e7d('0x71'),_0xc1a4b4['actions'][_0x5ba5bd][_0x3e7d('0x72')],_0x3e7d('0x73'),JSON[_0x3e7d('0x57')](_0xc1a4b4[_0x3e7d('0x12')][_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x72')]][_0x3e7d('0x4e')]),_0x3e7d('0x74'),JSON[_0x3e7d('0x57')](_0xc1a4b4[_0x3e7d('0x12')][_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x72')]][_0x3e7d('0x2d')]),JSON[_0x3e7d('0x57')](_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x75')]),JSON['stringify'](_[_0x3e7d('0x76')](_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd],[_0x3e7d('0x77'),_0x3e7d('0x78'),'VoiceQueueId',_0x3e7d('0x79')])));return ami[_0x3e7d('0x7a')]({'action':'status','channel':_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x7b')]})[_0x3e7d('0x7c')](function(_0x4e0f8d){if(_0x4e0f8d[_0x3e7d('0x4d')]===_0x3e7d('0x7d')){setTimeout(function(){if(_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd]){ut[_0x3e7d('0x7e')](_0xc1a4b4[_0x3e7d('0x12')][_0xc1a4b4['actions'][_0x5ba5bd][_0x3e7d('0x72')]],_0x3e7d('0x7f'));if(_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x75')]===!![]){ut[_0x3e7d('0x80')](_0xc1a4b4['campaignsPreview'][_0xc1a4b4[_0x3e7d('0x15')][_0x5ba5bd][_0x3e7d('0x72')]],_0x3e7d('0x7f'));ut[_0x3e7d('0x81')](_0x3e7d('0x82')+_0x5ba5bd,_0xc1a4b4['actions'][_0x5ba5bd][_0x3e7d('0x72')]);}ut['loggerError'](_0x3e7d('0x83')+_0x5ba5bd,_0xc1a4b4['actions'][_0x5ba5bd][_0x3e7d('0x72')]);delete _0xc1a4b4['actions'][_0x5ba5bd];}},0x2328);}});}});};Preview[_0x3e7d('0x67')]['clearZombieChannels']=function(){var _0x25a87c=this;loggerAction['info'](_0x3e7d('0x84'),_[_0x3e7d('0x85')](this['actions']));for(var _0x14e1ee in this['actions']){if(_0x25a87c[_0x3e7d('0x15')][_0x3e7d('0x68')](_0x14e1ee)){_0x25a87c['clearZombieChannel'](_0x14e1ee);}}};Preview[_0x3e7d('0x67')][_0x3e7d('0x6c')]=function(_0x2acb44){var _0x149f68=this;rpcDb['getContactRecallMe'](_0x2acb44['id'],ut[_0x3e7d('0x86')](this[_0x3e7d('0x16')]))[_0x3e7d('0x87')](function(_0x4a4376){if(!_[_0x3e7d('0x6f')](_0x4a4376)){for(var _0x903b70=0x0;_0x903b70<_0x4a4376['length'];_0x903b70+=0x1){if(ut[_0x3e7d('0x88')](_0x4a4376[_0x903b70][_0x3e7d('0x89')])<_0x2acb44[_0x3e7d('0x8a')]*0x3c){if(_0x4a4376[_0x903b70][_0x3e7d('0x8b')]&&!_0x4a4376[_0x903b70][_0x3e7d('0x8b')][_0x3e7d('0x8c')]){_0x149f68[_0x3e7d('0x8d')](_0x4a4376[_0x903b70]['id'])[_0x3e7d('0x87')](ut['logger2'](_0x3e7d('0x8e')))['catch'](ut['logger2'](_0x3e7d('0x8e')));}else{rpcDb[_0x3e7d('0x8f')](_0x4a4376[_0x903b70]['id']);}}else{var _0x3d6cc0=new Action(_0x4a4376[_0x903b70],_0x2acb44);_0x3d6cc0[_0x3e7d('0x90')]=moment()[_0x3e7d('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2acb44[_0x3e7d('0x91')]+=0x1;ut['logCustomer'](_0x3d6cc0,0x17,_0x3e7d('0x92'));if(_0x2acb44[_0x3e7d('0x93')]){rpcDb[_0x3e7d('0x94')](ut[_0x3e7d('0x95')](_0x4a4376[_0x903b70]));rpcDb[_0x3e7d('0x96')](_0x3d6cc0,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x3e7d('0x97')](_0x3d6cc0,0x16,_0x3e7d('0x98'));rpcDb[_0x3e7d('0x96')](_0x3d6cc0,_0x3e7d('0x99'));rpcDb['createCustomerFinal'](_0x3d6cc0,_0x3e7d('0x99'));}}}}})[_0x3e7d('0x7c')](ut[_0x3e7d('0x9a')]('[getContactRecallMe]'));};Preview[_0x3e7d('0x67')][_0x3e7d('0x6a')]=function(_0x263b1c){_0x263b1c[_0x3e7d('0x5d')]=!![];if(ut['IsNotLoggedIn'](_0x263b1c[_0x3e7d('0x9b')])){_0x263b1c[_0x3e7d('0x4d')]=_0x3e7d('0x9c');}else if(!ut[_0x3e7d('0x9d')](_0x263b1c[_0x3e7d('0x33')])){_0x263b1c[_0x3e7d('0x4d')]=_0x3e7d('0x5f');}else if(!this[_0x3e7d('0x9e')](_0x263b1c['Trunk'])){if(!this[_0x3e7d('0x9e')](_0x263b1c[_0x3e7d('0x9f')])){_0x263b1c[_0x3e7d('0x4d')]='TRUNK_IS_NOT_REACHABLE';}else{_0x263b1c[_0x3e7d('0x4d')]='ACTIVE';}}else{_0x263b1c[_0x3e7d('0x4d')]=_0x3e7d('0xa0');}emitCampaignPreview(_0x263b1c);};Preview[_0x3e7d('0x67')][_0x3e7d('0xa1')]=function(_0x5dbcd4,_0x3539f5,_0x2270b6){var _0x3d43cc=this;var _0x1b68ab=this[_0x3e7d('0x15')][_0x3539f5];var _0x2534ba=this[_0x3e7d('0x12')][_0x1b68ab[_0x3e7d('0x72')]];var _0x227cab;var _0x58731a=![];var _0x4b68f7=0x2;var _0x6d5979=0x3;if(_0x2534ba){switch(_0x2270b6){case'1':_0x2534ba['outboundNoSuchCallsDay']+=0x1;_0x1b68ab[_0x3e7d('0xa2')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x0,_0x3e7d('0xa5'));ami[_0x3e7d('0x26')](_0x3e7d('0xa6'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xa8')));rpcDb['createCustomerHistory'](_0x1b68ab,'[callProgressDetectingCustomer][logNoSuch]');_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'0',_0x2534ba)[_0x3e7d('0x87')](function(_0x406dce){_0x58731a=_0x406dce[_0x3e7d('0xaa')]==0x1;_0x4b68f7=_0x2534ba[_0x3e7d('0xab')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,_0x3e7d('0xaf'));rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xb1'));}else{if(_0x1b68ab['countnosuchnumberretry']>=_0x2534ba['dialNoSuchNumberMaxRetry']){rpcDb[_0x3e7d('0xb0')](_0x1b68ab,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x3e7d('0xb2')](ut[_0x3e7d('0xb3')](_0x1b68ab,_0x3e7d('0xa2'),_0x2534ba[_0x3e7d('0xab')]),_0x1b68ab[_0x3e7d('0xb4')],_0x1b68ab[_0x3e7d('0xb5')]);}}delete this[_0x3e7d('0x15')][_0x5dbcd4[_0x3e7d('0xb6')]];}else{_0x1b68ab[_0x3e7d('0xa2')]++;logger[_0x3e7d('0x5b')](_0x3e7d('0xb7'),_0x1b68ab[_0x3e7d('0xa2')]);logger['info']('id',_0x1b68ab[_0x3e7d('0xb8')]);_0x3d43cc[_0x3e7d('0xb9')]({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countnosuchnumberretry':_0x1b68ab[_0x3e7d('0xa2')]}})[_0x3e7d('0x87')](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});});}});break;case _0x3e7d('0xbb'):var _0x369a7a=moment()[_0x3e7d('0x58')](_0x3e7d('0xbc'));_0x1b68ab[_0x3e7d('0xbd')]=_0x369a7a;_0x1b68ab['answertime']=_0x369a7a;_0x1b68ab[_0x3e7d('0x75')]=!![];_0x2534ba['pTalking']+=0x1;logger[_0x3e7d('0x5b')]('[syncHangup][talking][increment]',_0x1b68ab['uniqueid'],_0x3e7d('0xbe'),_0x2534ba['name'],_0x3e7d('0x74'),_0x2534ba[_0x3e7d('0x2d')]);ami[_0x3e7d('0x26')](_0x3e7d('0xbf'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xc0'),this[_0x3e7d('0x12')][_0x1b68ab[_0x3e7d('0x72')]]));if(_0x2534ba[_0x3e7d('0xc1')]){ami[_0x3e7d('0x26')]('custom:agentConnectPreview',ut[_0x3e7d('0xc2')](_0x1b68ab));}break;case'16':ami[_0x3e7d('0x26')](_0x3e7d('0xc3'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xc4'),this[_0x3e7d('0x12')][_0x1b68ab[_0x3e7d('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xc4')));_0x2534ba[_0x3e7d('0x39')]+=0x1;_0x2534ba['total']+=0x1;_0x2534ba[_0x3e7d('0x2b')]+=0x1;ut['decrementTalkink'](_0x2534ba,_0x3e7d('0xc5'));_0x1b68ab[_0x3e7d('0xa3')]=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x4,'Answer');rpcDb['createCustomerHistory'](_0x1b68ab,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x1b68ab,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x1b68ab);_0x2534ba[_0x3e7d('0xc6')]+=_0x1b68ab[_0x3e7d('0xc7')];_0x2534ba['sumBillable']+=_0x1b68ab[_0x3e7d('0xc7')];logger['info'](_0x3e7d('0xc8'),_0x1b68ab[_0x3e7d('0xc9')],_0x3e7d('0xbe'),_0x2534ba['name'],_0x3e7d('0x74'),_0x2534ba['pTalking']);delete this[_0x3e7d('0x15')][_0x5dbcd4['linkedid']];break;case _0x3e7d('0xca'):_0x2534ba[_0x3e7d('0x3b')]+=0x1;_0x1b68ab[_0x3e7d('0xcb')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut['totalGlobal'](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x5,'Busy');_0x4b68f7=_0x2534ba[_0x3e7d('0xcc')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];ami[_0x3e7d('0x26')](_0x3e7d('0xcd'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xce')));rpcDb[_0x3e7d('0x96')](_0x1b68ab,'[callProgressDetectingCustomer][logBusy]');_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'5',_0x2534ba)[_0x3e7d('0x87')](function(_0x484d28){_0x58731a=_0x484d28['additional']==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba['dialGlobalMaxRetry']){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,'Global');rpcDb[_0x3e7d('0xb0')](_0x227cab,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x1b68ab[_0x3e7d('0xcb')]>=_0x2534ba[_0x3e7d('0xcf')]){rpcDb[_0x3e7d('0xb0')](_0x1b68ab,_0x3e7d('0xd0'));}else{rpcDb[_0x3e7d('0xb2')](ut[_0x3e7d('0xb3')](_0x1b68ab,_0x3e7d('0xcb'),_0x2534ba['dialBusyRetryFrequency']),_0x1b68ab[_0x3e7d('0xb4')],_0x1b68ab[_0x3e7d('0xb5')]);}}}else{_0x1b68ab[_0x3e7d('0xcb')]++;_0x3d43cc['incrementPreviewCounters']({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countbusyretry':_0x1b68ab[_0x3e7d('0xcb')]}})['then'](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});});}});break;case _0x3e7d('0xd1'):_0x2534ba[_0x3e7d('0x3e')]+=0x1;_0x1b68ab['countnoanswerretry']+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x3,'NoAnswer');_0x4b68f7=_0x2534ba[_0x3e7d('0xd2')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];var _0x363405=ut[_0x3e7d('0xd3')](_0x1b68ab,_0x2534ba);ami[_0x3e7d('0x26')](_0x3e7d('0xd4'),_0x363405);rpcDb['createCustomerHistory'](_0x1b68ab,_0x3e7d('0xd5'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'3',_0x2534ba)[_0x3e7d('0x87')](function(_0x1af97d){_0x58731a=_0x1af97d[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,_0x3e7d('0xaf'));rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xd6'));}else{if(_0x1b68ab['countnoanswerretry']>=_0x2534ba[_0x3e7d('0xd7')]){rpcDb[_0x3e7d('0xb0')](_0x1b68ab,_0x3e7d('0xd5'));}else{rpcDb[_0x3e7d('0xb2')](ut[_0x3e7d('0xb3')](_0x1b68ab,'countnoanswerretry',_0x2534ba['dialNoAnswerRetryFrequency']),_0x1b68ab[_0x3e7d('0xb4')],_0x1b68ab[_0x3e7d('0xb5')]);}}}else{_0x1b68ab[_0x3e7d('0xd8')]++;_0x3d43cc[_0x3e7d('0xb9')]({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countnoanswerretry':_0x1b68ab[_0x3e7d('0xd8')]}})['then'](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});});}});break;case _0x3e7d('0xd9'):_0x2534ba[_0x3e7d('0x3c')]+=0x1;_0x1b68ab[_0x3e7d('0xda')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x8,_0x3e7d('0xdb'));_0x4b68f7=_0x2534ba[_0x3e7d('0xdc')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];ami[_0x3e7d('0x26')](_0x3e7d('0xdd'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xde')));rpcDb[_0x3e7d('0x96')](_0x1b68ab,'[callProgressDetectingCustomer][logCongestion]');_0x3d43cc['verifyAdditionalPhones'](_0x1b68ab,'8',_0x2534ba)[_0x3e7d('0x87')](function(_0x231205){_0x58731a=_0x231205[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,'Global');rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xdf'));}else{if(_0x1b68ab[_0x3e7d('0xda')]>=_0x2534ba[_0x3e7d('0xe0')]){rpcDb[_0x3e7d('0xb0')](_0x1b68ab,_0x3e7d('0xe1'));}else{rpcDb[_0x3e7d('0xb2')](ut['scheduledAt'](_0x1b68ab,_0x3e7d('0xda'),_0x2534ba['dialBusyRetryFrequency']),_0x1b68ab[_0x3e7d('0xb4')],_0x1b68ab['activeContact']);}}}else{_0x1b68ab[_0x3e7d('0xda')]++;_0x3d43cc[_0x3e7d('0xb9')]({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countcongestionretry':_0x1b68ab[_0x3e7d('0xda')]}})[_0x3e7d('0x87')](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});});}});break;case'CANCEL':_0x2534ba['outboundRejectCallsDay']+=0x1;_0x1b68ab[_0x3e7d('0xe2')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x14,_0x3e7d('0xe3'));_0x4b68f7=_0x2534ba[_0x3e7d('0xe4')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];ami[_0x3e7d('0x26')](_0x3e7d('0xe5'),ut['buildObj'](_0x1b68ab,_0x3e7d('0xe6')));rpcDb[_0x3e7d('0x96')](_0x1b68ab,_0x3e7d('0xe7'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'20',_0x2534ba)[_0x3e7d('0x87')](function(_0x597411){_0x58731a=_0x597411[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0x14,'AgentReject');rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xe8'));}else{if(_0x1b68ab['countagentrejectretry']>=_0x2534ba[_0x3e7d('0xe9')]){rpcDb['createCustomerFinal'](_0x1b68ab,_0x3e7d('0xe8'));}else{rpcDb[_0x3e7d('0xb2')](ut[_0x3e7d('0xb3')](_0x1b68ab,_0x3e7d('0xe2'),_0x2534ba['dialAgentRejectRetryFrequency']),_0x1b68ab['unlockAgent'],_0x1b68ab[_0x3e7d('0xb5')]);}}}else{_0x1b68ab[_0x3e7d('0xd8')]++;_0x3d43cc[_0x3e7d('0xb9')]({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countnoanswerretry':_0x1b68ab[_0x3e7d('0xd8')]}})[_0x3e7d('0x87')](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)['then'](function(){});});}});break;case'ABANDONED':_0x2534ba['outboundAbandonedCallsDay']+=0x1;_0x1b68ab[_0x3e7d('0xea')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut['totalGlobal'](_0x1b68ab);ut['logCustomer'](_0x1b68ab,0xb,_0x3e7d('0xeb'));rpcDb[_0x3e7d('0x96')](_0x1b68ab,_0x3e7d('0xec'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'11',_0x2534ba)[_0x3e7d('0x87')](function(_0x1d4f19){_0x58731a=_0x1d4f19[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba['dialGlobalMaxRetry']){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,_0x3e7d('0xaf'));rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xec'));}else{if(_0x1b68ab[_0x3e7d('0xed')]>=_0x2534ba[_0x3e7d('0xee')]){rpcDb['createCustomerFinal'](_0x1b68ab,_0x3e7d('0xec'));}else{rpcDb[_0x3e7d('0xb2')](ut['scheduledAt'](_0x1b68ab,'countabandonedretry',_0x2534ba[_0x3e7d('0xef')]),_0x1b68ab['unlockAgent'],_0x1b68ab[_0x3e7d('0xb5')]);}}}else{_0x1b68ab[_0x3e7d('0xd8')]++;_0x3d43cc['incrementPreviewCounters']({'id':_0x1b68ab['idContact'],'field':{'countnoanswerretry':_0x1b68ab[_0x3e7d('0xd8')]}})[_0x3e7d('0x87')](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});});}});break;case'18':_0x2534ba['outboundUnknownCallsDay']+=0x1;_0x1b68ab[_0x3e7d('0xf0')]+=0x1;_0x1b68ab['countglobal']=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x12,_0x5dbcd4[_0x3e7d('0xf1')]||_0x5dbcd4[_0x3e7d('0xf2')]);ami[_0x3e7d('0x26')](_0x3e7d('0xf3'),ut[_0x3e7d('0xa7')](_0x1b68ab,_0x3e7d('0xf4')));rpcDb[_0x3e7d('0x96')](_0x1b68ab,_0x3e7d('0xf5'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'18',_0x2534ba)[_0x3e7d('0x87')](function(_0xad315f){_0x58731a=_0xad315f[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0x12,_0x3e7d('0xaf'));rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xf5'));}else{rpcDb[_0x3e7d('0xb0')](_0x1b68ab,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x1b68ab[_0x3e7d('0xd8')]++;_0x3d43cc['incrementPreviewCounters']({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countnoanswerretry':_0x1b68ab[_0x3e7d('0xd8')]}})['then'](function(){_0x3d43cc[_0x3e7d('0xba')](_0x1b68ab,_0x4b68f7,_0x6d5979)['then'](function(){});});}});delete this['actions'][_0x5dbcd4[_0x3e7d('0xb6')]];break;case'19':_0x2534ba[_0x3e7d('0x42')]+=0x1;_0x1b68ab[_0x3e7d('0xa3')]=ut['totalGlobal'](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0x13,_0x5dbcd4['cause-txt']||_0x5dbcd4[_0x3e7d('0xf2')]);ami[_0x3e7d('0x26')](_0x3e7d('0xf3'),ut[_0x3e7d('0xa7')](_0x1b68ab,'amd'));rpcDb[_0x3e7d('0x96')](_0x1b68ab,_0x3e7d('0xf6'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'18',_0x2534ba)[_0x3e7d('0x87')](function(_0x1c368b){_0x58731a=_0x1c368b[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba[_0x3e7d('0xad')]){_0x227cab=ut[_0x3e7d('0xae')](_0x1b68ab,0xf,_0x3e7d('0xaf'));rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xf6'));}else{rpcDb[_0x3e7d('0xb0')](_0x1b68ab,_0x3e7d('0xf6'));}}else{_0x1b68ab[_0x3e7d('0xd8')]++;_0x3d43cc['incrementPreviewCounters']({'id':_0x1b68ab[_0x3e7d('0xb8')],'field':{'countnoanswerretry':_0x1b68ab[_0x3e7d('0xd8')]}})[_0x3e7d('0x87')](function(){_0x3d43cc['swapAdditionalPhones'](_0x1b68ab,_0x4b68f7,_0x6d5979)['then'](function(){});});}});delete this['actions'][_0x5dbcd4['linkedid']];break;default:if(_0x1b68ab[_0x3e7d('0x75')]){ut[_0x3e7d('0x80')](_0x2534ba,_0x3e7d('0xf7'));ut[_0x3e7d('0x81')](_0x3e7d('0xf8')+_0x2534ba[_0x3e7d('0x29')],_0x5dbcd4);}_0x2534ba[_0x3e7d('0x42')]+=0x1;_0x1b68ab['countglobal']=ut[_0x3e7d('0xa4')](_0x1b68ab);ut[_0x3e7d('0x97')](_0x1b68ab,0xc,_0x5dbcd4[_0x3e7d('0xf1')]||_0x5dbcd4[_0x3e7d('0xf2')]);_0x4b68f7=_0x2534ba[_0x3e7d('0xe4')];_0x6d5979=_0x2534ba[_0x3e7d('0xac')];rpcDb['createCustomerHistory'](_0x1b68ab,_0x3e7d('0xf9'));_0x3d43cc[_0x3e7d('0xa9')](_0x1b68ab,'20',_0x2534ba)[_0x3e7d('0x87')](function(_0x4e096a){_0x58731a=_0x4e096a[_0x3e7d('0xaa')]==0x1;if(!_0x58731a){if(ut[_0x3e7d('0xa4')](_0x1b68ab)>=_0x2534ba['dialGlobalMaxRetry']){_0x227cab=ut['cloneAction'](_0x1b68ab,0xf,'Global');rpcDb[_0x3e7d('0xb0')](_0x227cab,_0x3e7d('0xfa'));}else{rpcDb['createCustomerFinal'](_0x1b68ab,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x5dbcd4[_0x3e7d('0xb6')]];}else{_0x3d43cc['swapAdditionalPhones'](_0x1b68ab,_0x4b68f7,_0x6d5979)[_0x3e7d('0x87')](function(){});}});}if(!(_0x1b68ab[_0x3e7d('0x75')]&&_0x2270b6==='16')){ut['updateOriginated'](_0x2534ba,'[callProgressDetectingCustomer]');logger[_0x3e7d('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0x1b68ab[_0x3e7d('0xc9')],_0x3e7d('0xbe'),_0x2534ba['name'],'originated:\x20',_0x2534ba[_0x3e7d('0x4e')]);}if(_0x2270b6!=='ANSWER'){delete this[_0x3e7d('0x15')][_0x5dbcd4[_0x3e7d('0xb6')]];delete this[_0x3e7d('0x15')][_0x5dbcd4[_0x3e7d('0xfb')]];}}};Preview[_0x3e7d('0x67')][_0x3e7d('0xfc')]=function(_0x68d86b,_0x3dd22f,_0xf0c7ec){if(_[_0x3e7d('0xfd')](_0x3dd22f)&&_0x3e7d('0xfe')!==typeof _0x3dd22f){return;}if(_['isUndefined'](_0xf0c7ec)&&_0x3e7d('0xfe')!==typeof _0xf0c7ec){return;}switch(_0xf0c7ec[_0x3e7d('0xff')]){case'0':ut[_0x3e7d('0x100')](_0x68d86b,0x0,_0x3e7d('0xa5'));rpcDb[_0x3e7d('0x101')](_0x68d86b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x3e7d('0x100')](_0x68d86b,0x3,_0x3e7d('0x102'));rpcDb[_0x3e7d('0x101')](_0x68d86b,_0x3e7d('0x103'));break;case'5':ut[_0x3e7d('0x100')](_0x68d86b,0x5,_0x3e7d('0x104'));rpcDb[_0x3e7d('0x101')](_0x68d86b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x3e7d('0x100')](_0x68d86b,0x8,_0x3e7d('0xdb'));rpcDb[_0x3e7d('0x101')](_0x68d86b,_0x3e7d('0x105'));break;case'22':ut[_0x3e7d('0x100')](_0x68d86b,0x16,_0x3e7d('0x106'));rpcDb[_0x3e7d('0x101')](_0x68d86b,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x3e7d('0x100')](_0x68d86b,0xc,_0xf0c7ec[_0x3e7d('0xff')]);rpcDb['createAgentHistory'](_0x68d86b,'[callProgressDetectingAgent][logCongestion]');}ut[_0x3e7d('0x7e')](_0x3dd22f,_0x3e7d('0x107'));logger[_0x3e7d('0x5b')](_0x3e7d('0x108'),_0x68d86b[_0x3e7d('0xc9')],_0x3e7d('0xbe'),_0x3dd22f[_0x3e7d('0x29')],_0x3e7d('0x73'),_0x3dd22f[_0x3e7d('0x4e')]);delete this[_0x3e7d('0x15')][_0x68d86b[_0x3e7d('0xc9')]];};Preview[_0x3e7d('0x67')]['verifyAdditionalPhones']=function(_0x5a0259,_0x1619c6,_0x34c1a2){return Promise[_0x3e7d('0x109')]()['then'](cmHopperAdditionalPhone[_0x3e7d('0xa9')](_0x5a0259,_0x1619c6,_0x34c1a2))[_0x3e7d('0x7c')](logger[_0x3e7d('0x5b')](_0x3e7d('0x10a')));};Preview[_0x3e7d('0x67')]['swapAdditionalPhones']=function(_0x39c4ab,_0x4dad26,_0x14d952){return Promise[_0x3e7d('0x109')]()['then'](cmHopperAdditionalPhone[_0x3e7d('0xba')](_0x39c4ab,_0x4dad26,_0x14d952))[_0x3e7d('0x7c')](logger[_0x3e7d('0x5b')](_0x3e7d('0x10b')));};Preview[_0x3e7d('0x67')][_0x3e7d('0xb9')]=function(_0x387420){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x3e7d('0xb9')](_0x387420))[_0x3e7d('0x7c')](logger['info'](_0x3e7d('0x10c')));};Preview[_0x3e7d('0x67')][_0x3e7d('0x10d')]=function(_0x568ea5,_0x430091,_0x37f008,_0x1076e0,_0x4cb8dd){var _0xfd04f0=this;return new Promise(function(_0x44ea7b,_0x552c4f){if(_['isNil'](_0x430091)||_['isNil'](_0x430091[_0x3e7d('0x10e')])||_[_0x3e7d('0x6f')](_0x430091[_0x3e7d('0x10f')])||_['isNil'](_0x430091['VoiceQueueId'])){_0x552c4f(ut[_0x3e7d('0x4d')](_0x3e7d('0x110'),_0x1076e0,_0x4cb8dd));return;}var _0x3a8689=uuid['v4']();var _0x306a4a=_0xfd04f0[_0x3e7d('0x12')][_0x430091[_0x3e7d('0x71')][_0x3e7d('0x29')]];var _0xf7e7bd=_0x37f008?_0xfd04f0[_0x3e7d('0x16')][_0x37f008]['id']:undefined;_0xfd04f0[_0x3e7d('0x15')][_0x3a8689]=new Action(_0x430091,_0x306a4a,_0x3a8689,_0x37f008,_0xf7e7bd);var _0x449c66=_0xfd04f0[_0x3e7d('0x15')][_0x3a8689];_0x449c66[_0x3e7d('0xb4')]=_0x1076e0;_0x449c66['activeContact']=_0x4cb8dd;_0x449c66[_0x3e7d('0x111')]=_0x37f008;if(_[_0x3e7d('0x112')](_0x568ea5)){_0xfd04f0[_0x3e7d('0x113')](_0x449c66,_0x306a4a,_0x430091,_0x37f008)['then'](function(_0x786618){logger['info'](_0x3e7d('0x114'),_0x3e7d('0x115')+_0x449c66[_0x3e7d('0x72')]+_0x3e7d('0x116')+_0x449c66['idContact'],JSON[_0x3e7d('0x57')](_0x786618));ami[_0x3e7d('0x26')](_0x3e7d('0x117'),ut[_0x3e7d('0xa7')](_0x449c66,_0x3e7d('0x118'),_0xfd04f0['campaignsPreview'][_0x449c66[_0x3e7d('0x72')]]));_0x44ea7b(ut[_0x3e7d('0x4d')]('Calling'));})[_0x3e7d('0x7c')](function(_0x651f6e){ut[_0x3e7d('0x60')](_0x3e7d('0x119'),_0x651f6e);_0x552c4f(ut[_0x3e7d('0x4d')](_0x3e7d('0x11a'),_0x1076e0,_0x4cb8dd));});}else{_0x306a4a[_0x3e7d('0x3a')]+=0x1;ut[_0x3e7d('0x11b')](_0x449c66);rpcDb['createHistory'](_0x449c66,_0x3e7d('0x11c'));delete _0xfd04f0[_0x3e7d('0x15')][_0x3a8689];_0x552c4f(ut[_0x3e7d('0x4d')](_0x3e7d('0x11d'),_0x1076e0,_0x4cb8dd));}});};Preview['prototype'][_0x3e7d('0x9e')]=function(_0x57179d){return!_[_0x3e7d('0x6f')](_0x57179d)&&!_[_0x3e7d('0x6f')](_0x57179d[_0x3e7d('0x29')])&&!_[_0x3e7d('0x6f')](_0x57179d['active'])&&_0x57179d[_0x3e7d('0x55')]&&!_[_0x3e7d('0x6f')](this[_0x3e7d('0x14')][util[_0x3e7d('0x58')](_0x3e7d('0x11e'),_0x57179d['name'])])&&!_['isNil'](this[_0x3e7d('0x14')][util[_0x3e7d('0x58')](_0x3e7d('0x11e'),_0x57179d[_0x3e7d('0x29')])]['status'])&&(this[_0x3e7d('0x14')][util[_0x3e7d('0x58')](_0x3e7d('0x11e'),_0x57179d[_0x3e7d('0x29')])][_0x3e7d('0x11f')]===_0x3e7d('0x120')||this[_0x3e7d('0x14')][util[_0x3e7d('0x58')](_0x3e7d('0x11e'),_0x57179d[_0x3e7d('0x29')])][_0x3e7d('0x11f')]===_0x3e7d('0x121'));};Preview['prototype'][_0x3e7d('0x8d')]=function(_0x31c35f,_0x4c2624){var _0x338d3a=this;return new Promise(function(_0x4a3ae5,_0x4bf0c9){_0x338d3a[_0x3e7d('0x122')](_0x31c35f,_0x4c2624)[_0x3e7d('0x87')](function(_0x17a870){_0x4a3ae5(_[_0x3e7d('0x76')](_0x17a870,[_0x3e7d('0x4d')]));})[_0x3e7d('0x7c')](function(_0x4f3dd2){if(_0x4f3dd2[_0x3e7d('0x123')]){rpcDb[_0x3e7d('0x124')](_0x31c35f);}if(_0x4f3dd2[_0x3e7d('0x55')]){rpcDb[_0x3e7d('0x8f')](_0x31c35f);}_0x4bf0c9(_[_0x3e7d('0x76')](_0x4f3dd2,[_0x3e7d('0x4d')]));});});};Preview[_0x3e7d('0x67')][_0x3e7d('0x122')]=function(_0x1933fb,_0x2d8a67){var _0xc83b99=this;return new Promise(function(_0x29dbfd,_0x5bbf61){var _0x3d870f,_0x4d5e8d;rpcDb[_0x3e7d('0x125')](_0x1933fb)[_0x3e7d('0x87')](function(_0x285700){if(!_[_0x3e7d('0x6f')](_0x285700[0x0])){_0x4d5e8d=_0x285700[0x0][_0x3e7d('0x126')]?![]:!![];_0x3d870f=_0x285700[0x0][_0x3e7d('0x126')]?!![]:![];_0x3d870f=_0x2d8a67?!![]:_0x3d870f;}var _0x2edbff=_0xc83b99[_0x3e7d('0x127')](_0x285700);if(_0x2edbff[_0x3e7d('0x128')]){rpcDb[_0x3e7d('0x129')](_[_0x3e7d('0x76')](_0x285700[0x0],[_0x3e7d('0x12a'),_0x3e7d('0x10f')]))[_0x3e7d('0x87')](function(_0x56b7a3){_0xc83b99[_0x3e7d('0x10d')](_0x56b7a3,_0x285700[0x0],_0x2d8a67,_0x4d5e8d,_0x3d870f)[_0x3e7d('0x87')](function(_0x276a1a){_0x29dbfd(_0x276a1a);})[_0x3e7d('0x7c')](function(_0x46445c){_0x5bbf61(_0x46445c);});})[_0x3e7d('0x7c')](function(_0x2536f7){ut['logger'](_0x3e7d('0x12b'),_0x2536f7);_0x5bbf61(ut[_0x3e7d('0x4d')]('Call\x20unsuccessful',_0x4d5e8d,_0x3d870f));});}else{_0x5bbf61(ut[_0x3e7d('0x4d')](_0x2edbff['message'],_0x4d5e8d,_0x3d870f));}})[_0x3e7d('0x7c')](function(_0x3c1605){ut[_0x3e7d('0x60')](_0x3e7d('0x12c'),_0x3c1605);_0x5bbf61(ut[_0x3e7d('0x4d')](_0x3e7d('0x12d'),![],!![]));});});};Preview[_0x3e7d('0x67')][_0x3e7d('0x127')]=function(_0x4dcbf0){if(_[_0x3e7d('0x6f')](_0x4dcbf0)||_['isEmpty'](_0x4dcbf0)||!_['isNil'](_0x4dcbf0[0x0][_0x3e7d('0x8b')])&&_[_0x3e7d('0x6f')](_0x4dcbf0[0x0][_0x3e7d('0x8b')]['name'])){ut['logger'](_0x3e7d('0x12e'),_0x4dcbf0);return{'isValid':![],'message':_0x3e7d('0x12f')};}var _0x227575=this['campaignsPreview'][_0x4dcbf0[0x0][_0x3e7d('0x71')][_0x3e7d('0x29')]];_0x227575[_0x3e7d('0x4d')]=_0x3e7d('0xa0');if(_[_0x3e7d('0x6f')](_0x227575)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x227575);return{'isValid':![],'message':_0x3e7d('0x130')};}if(!this[_0x3e7d('0x9e')](_0x227575[_0x3e7d('0x54')])){ut[_0x3e7d('0x60')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x3e7d('0x131')+_0x227575[_0x3e7d('0x29')]+_0x3e7d('0x132'));if(!this[_0x3e7d('0x9e')](_0x227575['TrunkBackup'])){ut[_0x3e7d('0x60')](_0x3e7d('0x133'),_0x227575[_0x3e7d('0x29')]+_0x3e7d('0x134'));return{'isValid':![],'message':_0x3e7d('0x135')};}}if(!ut['isActive'](_0x227575['dialActive'])){ut[_0x3e7d('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x227575['name']+_0x3e7d('0x136'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x227575[_0x3e7d('0x29')]+_0x3e7d('0x136')};}return{'isValid':!![],'message':_0x3e7d('0x137')};};Preview[_0x3e7d('0x67')]['execCall']=function(_0x5954c5,_0x10460a,_0x588ce7,_0x496ba6){var _0x7e45b2=this;return new Promise(function(_0x2f7727,_0x3adcd5){var _0x495efd=_0x5954c5[_0x3e7d('0xc9')];var _0x49381f=_0x7e45b2[_0x3e7d('0x9e')](_0x10460a['Trunk'])?util['format'](_0x3e7d('0x138'),_0x10460a[_0x3e7d('0x54')][_0x3e7d('0x29')],_[_0x3e7d('0x6f')](_0x10460a[_0x3e7d('0x37')])?'':_0x10460a[_0x3e7d('0x37')][_0x3e7d('0x139')]()||'',_0x10460a[_0x3e7d('0x13a')]>0x0?_0x588ce7[_0x3e7d('0x10f')][_0x3e7d('0x13b')](_0x10460a['dialCutDigit']):_0x588ce7[_0x3e7d('0x10f')]):util[_0x3e7d('0x58')](_0x3e7d('0x138'),_[_0x3e7d('0x6f')](_0x10460a[_0x3e7d('0x9f')])?_0x10460a[_0x3e7d('0x54')]['name']:_0x10460a[_0x3e7d('0x9f')][_0x3e7d('0x29')],_[_0x3e7d('0x6f')](_0x10460a[_0x3e7d('0x37')])?'':_0x10460a[_0x3e7d('0x37')][_0x3e7d('0x139')]()||'',_0x10460a[_0x3e7d('0x13a')]>0x0?_0x588ce7[_0x3e7d('0x10f')][_0x3e7d('0x13b')](_0x10460a[_0x3e7d('0x13a')]):_0x588ce7[_0x3e7d('0x10f')]);var _0x5a1ef4=_0x7e45b2[_0x3e7d('0x9e')](_0x10460a[_0x3e7d('0x54')])?ut['getCallerId'](_0x10460a['Trunk'][_0x3e7d('0x13c')],_0x10460a[_0x3e7d('0x35')],_0x10460a['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x10460a['dialOriginateCallerIdNumber'],_0x10460a[_0x3e7d('0x13d')]):_0x10460a[_0x3e7d('0x13e')]):ut['getCallerId'](_['isNil'](_0x10460a[_0x3e7d('0x9f')])?_0x10460a[_0x3e7d('0x54')]['callerid']:_0x10460a[_0x3e7d('0x9f')][_0x3e7d('0x13c')],_0x10460a['dialOriginateCallerIdName'],_0x10460a[_0x3e7d('0x13d')]>0x0?ut['getCallerIdRandom'](_0x10460a[_0x3e7d('0x13e')],_0x10460a[_0x3e7d('0x13d')]):_0x10460a[_0x3e7d('0x13e')]);if(_0x5a1ef4){_0x5954c5['originatecalleridname']=ut[_0x3e7d('0x13f')](_0x5a1ef4);_0x5954c5[_0x3e7d('0x140')]=ut[_0x3e7d('0x141')](_0x5a1ef4);}var _0x3ac715=ut['addVariables'](_0x10460a,_0x588ce7,_0x49381f,_0x5a1ef4,_0x495efd,_0x5954c5);_[_0x3e7d('0x142')](_0x5954c5,ut[_0x3e7d('0x143')](_0x3ac715));_0x5954c5[_0x3e7d('0x90')]=moment()[_0x3e7d('0x58')](_0x3e7d('0xbc'));_0x10460a[_0x3e7d('0x144')]=_0x3ac715;ami[_0x3e7d('0x7a')](ut[_0x3e7d('0x145')](_0x5954c5,_0x10460a,_0x3ac715,_0x5954c5[_0x3e7d('0xb5')],_0x496ba6))[_0x3e7d('0x87')](function(_0x12c19f){_0x10460a[_0x3e7d('0x4e')]+=0x1;logger[_0x3e7d('0x5b')](_0x3e7d('0x146'),_0x495efd,_0x3e7d('0xbe'),_0x10460a[_0x3e7d('0x29')],_0x3e7d('0x73'),_0x10460a['originated']);_0x2f7727(_0x12c19f);})['catch'](function(_0x24845e){ut[_0x3e7d('0x100')](_0x5954c5,0xe,'OriginateError');rpcDb[_0x3e7d('0x101')](_0x5954c5,_0x3e7d('0x147'));_0x3adcd5(_0x24845e);});});};Preview[_0x3e7d('0x67')][_0x3e7d('0x21')]=function(_0x407167){if(this[_0x3e7d('0x15')][_0x407167['linkedid']]){this['actions'][_0x407167['linkedid']]['channel']=_0x407167['channel'];}};Preview[_0x3e7d('0x67')][_0x3e7d('0x19')]=function(_0x2a07a1){var _0x399128=this;var _0x3d2ff6=this['actions'][_0x2a07a1['actionid']];if(_0x3d2ff6){if(_0x3d2ff6['lookAgent']&&this[_0x3e7d('0x16')][_0x3d2ff6['lookAgent']]){ut[_0x3e7d('0x148')](_0x3d2ff6,this[_0x3e7d('0x16')][_0x3d2ff6[_0x3e7d('0x111')]][_0x3e7d('0x29')],this[_0x3e7d('0x16')][_0x3d2ff6[_0x3e7d('0x111')]]['id']);}var _0x12aef5=_[_0x3e7d('0x149')](_0x3d2ff6);_0x12aef5[_0x3e7d('0xbd')]=moment()[_0x3e7d('0x58')](_0x3e7d('0xbc'));var _0x1675c2=_0x399128[_0x3e7d('0x12')][_0x3d2ff6[_0x3e7d('0x72')]];if(ut[_0x3e7d('0x14a')](_0x2a07a1['response'])){if(_0x3d2ff6[_0x3e7d('0xb4')]){rpcDb[_0x3e7d('0x124')](_0x3d2ff6[_0x3e7d('0xb8')]);}if(_0x3d2ff6[_0x3e7d('0xb5')]){rpcDb[_0x3e7d('0x8f')](_0x3d2ff6[_0x3e7d('0xb8')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x3d2ff6,_0x3e7d('0x14b'),this[_0x3e7d('0x12')][_0x3d2ff6[_0x3e7d('0x72')]]));this[_0x3e7d('0xfc')](_0x12aef5,_0x1675c2,_0x2a07a1);}else{_0x3d2ff6[_0x3e7d('0x90')]=moment()['format'](_0x3e7d('0xbc'));ut['logAgent'](_0x12aef5,0x4,_0x3e7d('0x14c'));rpcDb[_0x3e7d('0x101')](_0x12aef5,_0x3e7d('0x14d'));}}};Preview[_0x3e7d('0x67')]['syncHangup']=function(_0x347e6f){var _0x5451af=this[_0x3e7d('0x15')][_0x347e6f[_0x3e7d('0xb6')]];var _0x4eb597;if(_0x5451af){_0x4eb597=this[_0x3e7d('0x12')][_0x5451af[_0x3e7d('0x72')]];logger[_0x3e7d('0x5b')](_0x3e7d('0x14e'),_0x347e6f['linkedid'],'\x20Queue',_0x4eb597[_0x3e7d('0x29')],_0x3e7d('0x74'),_0x4eb597[_0x3e7d('0x2d')]);}if(this[_0x3e7d('0x15')][_0x347e6f[_0x3e7d('0xb6')]]&&_0x347e6f[_0x3e7d('0xb6')]!==_0x347e6f[_0x3e7d('0xc9')]){if(_0x347e6f[_0x3e7d('0x14f')]==='16'&&this[_0x3e7d('0x15')][_0x347e6f[_0x3e7d('0xb6')]][_0x3e7d('0x75')]){this[_0x3e7d('0xa1')](_0x347e6f,_0x347e6f[_0x3e7d('0xb6')],_0x347e6f[_0x3e7d('0x14f')]);}else if(this[_0x3e7d('0x15')][_0x347e6f[_0x3e7d('0xb6')]]['dialAnswer']){logger[_0x3e7d('0x5b')](_0x3e7d('0x150'),_0x347e6f['linkedid'],_0x347e6f[_0x3e7d('0x14f')],_0x3e7d('0xbe'),_0x4eb597[_0x3e7d('0x29')],_0x3e7d('0x74'),_0x4eb597[_0x3e7d('0x2d')]);this[_0x3e7d('0xa1')](_0x347e6f,_0x347e6f[_0x3e7d('0xb6')],_0x347e6f['cause']);}}else if(_0x5451af&&_[_0x3e7d('0x6f')](_0x5451af['statedesc'])&&_0x4eb597[_0x3e7d('0x151')]&&_0x347e6f['linkedid']===_0x347e6f['uniqueid']&&_[_0x3e7d('0x6f')](_0x347e6f[_0x3e7d('0xff')])&&_0x347e6f['cause']==='16'&&_0x347e6f[_0x3e7d('0x152')]==='6'&&_['isUndefined'](_0x5451af['transfer'])){if(_0x5451af[_0x3e7d('0xb4')]){rpcDb[_0x3e7d('0x124')](_0x5451af['idContact']);}if(_0x5451af[_0x3e7d('0xb5')]){rpcDb['disableContact'](_0x5451af[_0x3e7d('0xb8')]);}_0x347e6f[_0x3e7d('0xff')]='22';this[_0x3e7d('0xfc')](_0x5451af,_0x4eb597,_0x347e6f);}else if(_0x5451af&&_0x5451af[_0x3e7d('0x153')]){if(_0x347e6f[_0x3e7d('0x14f')]==='16'&&this[_0x3e7d('0x15')][_0x347e6f['linkedid']][_0x3e7d('0x75')]){logger[_0x3e7d('0x5b')](_0x3e7d('0x154'),_0x347e6f[_0x3e7d('0xb6')],_0x347e6f[_0x3e7d('0x14f')],_0x3e7d('0xbe'),_0x4eb597[_0x3e7d('0x29')],_0x3e7d('0x74'),_0x4eb597['pTalking']);this['callProgressDetectingCustomer'](_0x347e6f,_0x347e6f[_0x3e7d('0xb6')],_0x347e6f[_0x3e7d('0x14f')]);}else if(this[_0x3e7d('0x15')][_0x347e6f[_0x3e7d('0xb6')]][_0x3e7d('0x75')]){logger[_0x3e7d('0x5b')](_0x3e7d('0x150'),_0x347e6f['linkedid'],_0x347e6f['cause'],_0x3e7d('0xbe'),_0x4eb597['name'],_0x3e7d('0x74'),_0x4eb597[_0x3e7d('0x2d')]);this[_0x3e7d('0xa1')](_0x347e6f,_0x347e6f[_0x3e7d('0xb6')],_0x347e6f['cause']);}}};Preview[_0x3e7d('0x67')]['syncDialEnd']=function(_0x325849){if(this[_0x3e7d('0x15')][_0x325849['destlinkedid']]&&_0x325849[_0x3e7d('0xfb')]!==_0x325849[_0x3e7d('0x155')]){this[_0x3e7d('0xa1')](_0x325849,_0x325849['destlinkedid'],_0x325849[_0x3e7d('0xf2')]);}};Preview[_0x3e7d('0x67')][_0x3e7d('0x1e')]=function(_0x5e7216){if(this[_0x3e7d('0x15')][_0x5e7216[_0x3e7d('0xb6')]]&&_0x5e7216[_0x3e7d('0xb6')]!==_0x5e7216[_0x3e7d('0xc9')]&&!this[_0x3e7d('0x15')][_0x5e7216[_0x3e7d('0xb6')]][_0x3e7d('0x75')]){if(_0x5e7216[_0x3e7d('0x14f')]==='1'){this[_0x3e7d('0xa1')](_0x5e7216,_0x5e7216[_0x3e7d('0xb6')],_0x5e7216['cause']);}}};Preview[_0x3e7d('0x67')][_0x3e7d('0x156')]=function(_0x2cb3ca,_0x20b149,_0x32dee4){if(this[_0x3e7d('0x15')][_0x2cb3ca]){if(_[_0x3e7d('0x6f')](this[_0x3e7d('0x15')][_0x2cb3ca][_0x3e7d('0x144')])){this[_0x3e7d('0x15')][_0x2cb3ca]['variables']={};}this[_0x3e7d('0x15')][_0x2cb3ca][_0x3e7d('0x144')][_0x20b149]=_0x32dee4;}};Preview[_0x3e7d('0x67')][_0x3e7d('0x23')]=function(_0x4bcb1e){try{if(!_[_0x3e7d('0x6f')](_0x4bcb1e)){if(ut[_0x3e7d('0x157')](_[_0x3e7d('0x158')](_0x4bcb1e[_0x3e7d('0x159')])[0x0])){this['addVariable'](_0x4bcb1e['uniqueid'],_[_0x3e7d('0x158')](_0x4bcb1e[_0x3e7d('0x159')])[0x0],_0x4bcb1e['value']);}}}catch(_0x4371ed){logger[_0x3e7d('0x15a')](_0x3e7d('0x15b'),util[_0x3e7d('0x15c')](_0x4371ed,{'showHidden':![],'depth':null}));}};Preview[_0x3e7d('0x67')]['syncAttendedTransfer']=function(_0x13c137){if(_0x13c137){if(this[_0x3e7d('0x15')][_0x13c137[_0x3e7d('0x15d')]]){this['actions'][_0x13c137[_0x3e7d('0x15d')]][_0x3e7d('0x153')]=!![];}}};Preview[_0x3e7d('0x67')]['syncBlindTransfer']=function(_0x4defbd){if(_0x4defbd){if(this[_0x3e7d('0x15')][_0x4defbd[_0x3e7d('0x15e')]]){this['actions'][_0x4defbd[_0x3e7d('0x15e')]][_0x3e7d('0x153')]=!![];}}};module[_0x3e7d('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 0db0960..b79800d 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 _0xac79=['queuecallerleaveAt','queuecallercomplete','endtime','membername','context','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xac79,0x1a8));var _0x9ac7=function(_0x1e5215,_0x2dffee){_0x1e5215=_0x1e5215-0x0;var _0x111202=_0xac79[_0x1e5215];return _0x111202;};'use strict';var util=require(_0x9ac7('0x0'));var BPromise=require(_0x9ac7('0x1'));var logger=require(_0x9ac7('0x2'))(_0x9ac7('0x3'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x9ac7('0x4'));var cmHopperHistory=require(_0x9ac7('0x5'));var cmHopperBlack=require(_0x9ac7('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x9ac7('0x7'));var voiceQueueReport=require(_0x9ac7('0x8'));function loggerCatch(_0x5156dc){return function(_0x98b751){logger[_0x9ac7('0x9')](_0x5156dc,util[_0x9ac7('0xa')](_0x98b751,{'showHidden':![],'depth':null}));};}function create(_0x50b4f7){return BPromise[_0x9ac7('0xb')]()['then'](cmHopperHistory[_0x9ac7('0xc')](_0x50b4f7))[_0x9ac7('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x47d92b){return BPromise[_0x9ac7('0xb')]()['then'](agentReportPreview[_0x9ac7('0xc')](_0x47d92b))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0xe')));}function moveContact(_0x903e93){return BPromise[_0x9ac7('0xb')]()[_0x9ac7('0xf')](cmHopper[_0x9ac7('0x10')](_0x903e93,!![]))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0x11')));}exports['checkIsBlackList']=function(_0x597437){return BPromise[_0x9ac7('0xb')]()['then'](cmHopperBlack[_0x9ac7('0x12')](_0x597437))[_0x9ac7('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x123484){return BPromise['resolve']()[_0x9ac7('0xf')](cmHopper['getContactPreview'](_0x123484))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0x13')));};exports[_0x9ac7('0xc')]=function(_0x2c4120,_0x1757d6){create(_0x2c4120)[_0x9ac7('0xd')](loggerCatch(_0x1757d6));moveContact(_0x2c4120)[_0x9ac7('0xd')](loggerCatch(_0x1757d6));};exports['createAgentHistory']=function(_0x4316bd,_0x42feea){createAgent(_0x4316bd)[_0x9ac7('0xd')](loggerCatch(_0x42feea));};exports[_0x9ac7('0x14')]=function(_0x4d8d69,_0x36bf47){create(_0x4d8d69)['catch'](loggerCatch(_0x36bf47));};exports[_0x9ac7('0x15')]=function(_0xff0afe,_0x37c803){moveContact(_0xff0afe)[_0x9ac7('0xd')](loggerCatch(_0x37c803));};exports[_0x9ac7('0x16')]=function(_0x51bc3b,_0x2ebf8a,_0x2a8383){if(_0x2ebf8a){_0x51bc3b['UserId']=null;}if(_0x2a8383){_0x51bc3b[_0x9ac7('0x17')]=![];}return BPromise[_0x9ac7('0xb')]()['then'](cmHopper[_0x9ac7('0x16')](_0x51bc3b))[_0x9ac7('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x9ac7('0x18')]=function(_0x2b06b7){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x2b06b7))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0x19')));};exports[_0x9ac7('0x1a')]=function(_0x3eeaf1){return BPromise[_0x9ac7('0xb')]()[_0x9ac7('0xf')](cmHopper[_0x9ac7('0x1a')]({'UserId':null},_0x3eeaf1,0x1))[_0x9ac7('0xd')](loggerCatch('[unlockContact]\x20'));};exports[_0x9ac7('0x1b')]=function(_0x35c637){return BPromise[_0x9ac7('0xb')]()[_0x9ac7('0xf')](cmHopper[_0x9ac7('0x1a')]({'active':![]},_0x35c637,0x1))[_0x9ac7('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x2b3441){var _0x2be6d9={};_0x2be6d9[_0x9ac7('0x1c')]=_0x2b3441['type'];_0x2be6d9['uniqueid']=_0x2b3441[_0x9ac7('0x1d')];_0x2be6d9['calleridnum']=_0x2b3441[_0x9ac7('0x1e')];_0x2be6d9[_0x9ac7('0x1f')]=_0x2b3441['calleridname'];_0x2be6d9[_0x9ac7('0x20')]=_0x2b3441[_0x9ac7('0x20')];_0x2be6d9[_0x9ac7('0x21')]=_0x2b3441[_0x9ac7('0x22')];_0x2be6d9[_0x9ac7('0x23')]=_0x2b3441['answertime'];_0x2be6d9[_0x9ac7('0x24')]=0x1;_0x2be6d9['queuecallercompleteAt']=_0x2b3441[_0x9ac7('0x25')];_0x2be6d9['connectedlinename']=_0x2b3441[_0x9ac7('0x26')];_0x2be6d9[_0x9ac7('0x27')]=_0x9ac7('0x28');_0x2be6d9[_0x9ac7('0x29')]='xcally-motion-preview';_0x2be6d9[_0x9ac7('0x2a')]=0x0;_0x2be6d9['assigned']=0x1;_0x2be6d9[_0x9ac7('0x2b')]=_0x2b3441[_0x9ac7('0x26')];_0x2be6d9[_0x9ac7('0x2c')]=_0x9ac7('0x2d');return BPromise[_0x9ac7('0xb')]()[_0x9ac7('0xf')](voiceQueueReport[_0x9ac7('0x2e')](_0x2be6d9))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0x2f')));};exports[_0x9ac7('0x30')]=function(_0x2b3ccd,_0x2749ce){return BPromise[_0x9ac7('0xb')]()['then'](cmHopper['getContactRecallMe'](_0x2b3ccd,_0x2749ce))[_0x9ac7('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x9ac7('0x31')]=function(_0x1994c8){return BPromise[_0x9ac7('0xb')]()[_0x9ac7('0xf')](cmHopper['rescheduleContact'](_0x1994c8,!![],!![]))[_0x9ac7('0xd')](loggerCatch(_0x9ac7('0x32')));}; \ No newline at end of file +var _0x1dc6=['util','../../../config/logger','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','then','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20'];(function(_0x402070,_0x4f1dd5){var _0x4bfc14=function(_0x376a90){while(--_0x376a90){_0x402070['push'](_0x402070['shift']());}};_0x4bfc14(++_0x4f1dd5);}(_0x1dc6,0xd4));var _0x61dc=function(_0x2c88e0,_0x2841dd){_0x2c88e0=_0x2c88e0-0x0;var _0x35ced2=_0x1dc6[_0x2c88e0];return _0x35ced2;};'use strict';var util=require(_0x61dc('0x0'));var BPromise=require('bluebird');var logger=require(_0x61dc('0x1'))('preview');var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x61dc('0x2'));var cmHopperBlack=require(_0x61dc('0x3'));var voiceQueueRt=require(_0x61dc('0x4'));var agentReportPreview=require(_0x61dc('0x5'));var voiceQueueReport=require(_0x61dc('0x6'));function loggerCatch(_0x2a3f8f){return function(_0x391b57){logger[_0x61dc('0x7')](_0x2a3f8f,util[_0x61dc('0x8')](_0x391b57,{'showHidden':![],'depth':null}));};}function create(_0x41e815){return BPromise[_0x61dc('0x9')]()['then'](cmHopperHistory[_0x61dc('0xa')](_0x41e815))[_0x61dc('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x893985){return BPromise['resolve']()['then'](agentReportPreview[_0x61dc('0xa')](_0x893985))[_0x61dc('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x75535c){return BPromise[_0x61dc('0x9')]()[_0x61dc('0xc')](cmHopper['moveContactManagedDialer'](_0x75535c,!![]))['catch'](loggerCatch(_0x61dc('0xd')));}exports[_0x61dc('0xe')]=function(_0x339136){return BPromise[_0x61dc('0x9')]()['then'](cmHopperBlack[_0x61dc('0xe')](_0x339136))['catch'](loggerCatch(_0x61dc('0xf')));};exports[_0x61dc('0x10')]=function(_0x18a531){return BPromise['resolve']()[_0x61dc('0xc')](cmHopper[_0x61dc('0x10')](_0x18a531))[_0x61dc('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x61dc('0xa')]=function(_0x508e41,_0x337862){create(_0x508e41)[_0x61dc('0xb')](loggerCatch(_0x337862));moveContact(_0x508e41)[_0x61dc('0xb')](loggerCatch(_0x337862));};exports[_0x61dc('0x11')]=function(_0xb40bc1,_0x3f9335){createAgent(_0xb40bc1)[_0x61dc('0xb')](loggerCatch(_0x3f9335));};exports[_0x61dc('0x12')]=function(_0x5c431f,_0x2a7aa2){create(_0x5c431f)[_0x61dc('0xb')](loggerCatch(_0x2a7aa2));};exports[_0x61dc('0x13')]=function(_0x2caa5b,_0x17c3da){moveContact(_0x2caa5b)[_0x61dc('0xb')](loggerCatch(_0x17c3da));};exports[_0x61dc('0x14')]=function(_0xa7af66,_0x1da2ba,_0x3e810b){if(_0x1da2ba){_0xa7af66['UserId']=null;}if(_0x3e810b){_0xa7af66[_0x61dc('0x15')]=![];}return BPromise[_0x61dc('0x9')]()['then'](cmHopper[_0x61dc('0x14')](_0xa7af66))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x16')));};exports['countReScheduled']=function(_0x4f21ee){return BPromise[_0x61dc('0x9')]()['then'](cmHopper[_0x61dc('0x17')](_0x4f21ee))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x18')));};exports['unlockContact']=function(_0x305f13){return BPromise[_0x61dc('0x9')]()[_0x61dc('0xc')](cmHopper[_0x61dc('0x19')]({'UserId':null},_0x305f13,0x1))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x1a')));};exports[_0x61dc('0x1b')]=function(_0x12d447){return BPromise[_0x61dc('0x9')]()[_0x61dc('0xc')](cmHopper[_0x61dc('0x19')]({'active':![]},_0x12d447,0x1))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x1c')));};exports['crateCustomerReportQueue']=function(_0x2361a3){var _0x22073d={};_0x22073d[_0x61dc('0x1d')]=_0x2361a3[_0x61dc('0x1d')];_0x22073d['uniqueid']=_0x2361a3[_0x61dc('0x1e')];_0x22073d['calleridnum']=_0x2361a3['calleridnum'];_0x22073d[_0x61dc('0x1f')]=_0x2361a3[_0x61dc('0x1f')];_0x22073d['queue']=_0x2361a3[_0x61dc('0x20')];_0x22073d['queuecallerjoinAt']=_0x2361a3[_0x61dc('0x21')];_0x22073d[_0x61dc('0x22')]=_0x2361a3[_0x61dc('0x21')];_0x22073d[_0x61dc('0x23')]=0x1;_0x22073d[_0x61dc('0x24')]=_0x2361a3[_0x61dc('0x25')];_0x22073d[_0x61dc('0x26')]=_0x2361a3[_0x61dc('0x27')];_0x22073d[_0x61dc('0x28')]=_0x61dc('0x29');_0x22073d[_0x61dc('0x2a')]=_0x61dc('0x2b');_0x22073d[_0x61dc('0x2c')]=0x0;_0x22073d[_0x61dc('0x2d')]=0x1;_0x22073d['lastAssignedTo']=_0x2361a3[_0x61dc('0x27')];_0x22073d[_0x61dc('0x2e')]=_0x61dc('0x2f');return BPromise[_0x61dc('0x9')]()[_0x61dc('0xc')](voiceQueueReport[_0x61dc('0x30')](_0x22073d))[_0x61dc('0xb')](loggerCatch(_0x61dc('0x31')));};exports[_0x61dc('0x32')]=function(_0x5dda0d,_0x19e9e5){return BPromise[_0x61dc('0x9')]()[_0x61dc('0xc')](cmHopper['getContactRecallMe'](_0x5dda0d,_0x19e9e5))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x61dc('0x33')]=function(_0x1faed8){return BPromise['resolve']()['then'](cmHopper[_0x61dc('0x14')](_0x1faed8,!![],!![]))['catch'](loggerCatch(_0x61dc('0x34')));}; \ 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 beff18a..df894a6 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 _0xbadf=['rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','not_inuse','reachable','push','diff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countbusyretry','countglobal','callback','callbackuniqueid','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos'];(function(_0x176ebd,_0x25fcab){var _0x3e37fb=function(_0x4c3039){while(--_0x4c3039){_0x176ebd['push'](_0x176ebd['shift']());}};_0x3e37fb(++_0x25fcab);}(_0xbadf,0xa9));var _0xfbad=function(_0x22074d,_0x33df85){_0x22074d=_0x22074d-0x0;var _0x3a24ce=_0xbadf[_0x22074d];return _0x3a24ce;};'use strict';var util=require('util');var _=require(_0xfbad('0x0'));var moment=require(_0xfbad('0x1'));var logger=require(_0xfbad('0x2'))(_0xfbad('0x3'));var ipAgi=process['env'][_0xfbad('0x4')]||_0xfbad('0x5');function getSeconds(_0x38485f,_0x147422){var _0x11e391=moment(_0x38485f)[_0xfbad('0x6')](0x0);var _0x592ea8=moment(_0x147422)[_0xfbad('0x6')](0x0);return _0x11e391['diff'](_0x592ea8,_0xfbad('0x7'));}exports[_0xfbad('0x8')]=function(_0x3a3a3e){return function(_0x468434){logger['error'](_0x3a3a3e,util[_0xfbad('0x9')](_0x468434,{'showHidden':![],'depth':null}));};};exports[_0xfbad('0xa')]=function(_0x1ecbdc,_0x5bbec2){logger[_0xfbad('0xb')](_0x1ecbdc,util[_0xfbad('0x9')](_0x5bbec2,{'showHidden':![],'depth':null}));};exports[_0xfbad('0xc')]=function(_0x52eefc,_0x5e4077){logger[_0xfbad('0xd')](_0x52eefc,util['inspect'](_0x5e4077,{'showHidden':![],'depth':null}));};exports[_0xfbad('0xe')]=function(_0x4186c4){return function(_0x1a8c3b){logger['info'](_0x4186c4,util['inspect'](_0x1a8c3b,{'showHidden':![],'depth':null}));};};exports[_0xfbad('0xf')]=function(_0x13c998,_0x33c428,_0x4ef9fd){return{'message':_0x13c998,'unlock':_0x33c428,'active':_0x4ef9fd};};exports['getCallerId']=function(_0x1a931c,_0xc1e62a,_0x1390ad){if(!_['isUndefined'](_0x1390ad)&&_0xfbad('0x10')===typeof _0x1390ad&&!_[_0xfbad('0x11')](_0x1390ad)){if(!_[_0xfbad('0x12')](_0xc1e62a)&&_0xfbad('0x10')===typeof _0xc1e62a&&!_[_0xfbad('0x11')](_0xc1e62a)){return util['format'](_0xfbad('0x13'),_0xc1e62a,_0x1390ad);}return util[_0xfbad('0x14')](_0xfbad('0x13'),_0x1390ad,_0x1390ad);}if(!_[_0xfbad('0x12')](_0x1a931c)&&'string'===typeof _0x1a931c&&!_[_0xfbad('0x11')](_0x1a931c)){return _0x1a931c;}return'\x22\x22\x20<>';};exports[_0xfbad('0x15')]=function(_0x741780){if(_[_0xfbad('0x16')](_0x741780)){return![];}return _0x741780;};exports[_0xfbad('0x17')]=function(_0x1d7a95,_0x137155,_0xc13b0a,_0x1666a5,_0xbe9324,_0x48ff0a){var _0x2c7202={'XMD-QUEUE':_0x137155[_0xfbad('0x18')]?_0x137155[_0xfbad('0x18')][_0xfbad('0x19')]:'','XMD-CALLERID':_0x1666a5,'XMD-CALLERID-PREVIEW':_0x48ff0a?util[_0xfbad('0x14')]('\x22%s\x22\x20<%s>',_0x48ff0a[_0xfbad('0x1a')],_0x48ff0a[_0xfbad('0x1b')]):_0x1666a5,'XMD-DIALID':_0xbe9324,'XMD-CONTACTID':_0x137155[_0xfbad('0x1c')],'XMD-CDRTYPE':_0xfbad('0x1d'),'CALLERID(all)':_0x1666a5,'XMD-VOICEQUEUEID':_0x137155[_0xfbad('0x1e')],'XMD-DIALCHANNEL':_0xc13b0a,'XMD-DIALTIMEOUT':_0x1d7a95[_0xfbad('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xfbad('0x20'),_0x1d7a95[_0xfbad('0x21')]?'g':'',_[_0xfbad('0x11')](_0x1d7a95[_0xfbad('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1d7a95[_0xfbad('0x23')]||'','XMD-AGI':_0x1d7a95[_0xfbad('0x24')]?util[_0xfbad('0x14')](_0xfbad('0x25'),ipAgi,_0x1d7a95[_0xfbad('0x24')]):_0xfbad('0x26'),'XMD-AGIAFTER':_0x1d7a95['dialQueueProject2']?util['format'](_0xfbad('0x25'),ipAgi,_0x1d7a95['dialQueueProject2']):_0xfbad('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x48ff0a?_0x48ff0a[_0xfbad('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x48ff0a?_0x48ff0a[_0xfbad('0x28')]:'','XMD-DESTINATION':_0xfbad('0x29'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xfbad('0x11')](_0x1d7a95[_0xfbad('0x22')])){_0x2c7202[util[_0xfbad('0x14')]('%s',_0xfbad('0x2a'))]=_0x1d7a95[_0xfbad('0x22')];_0x2c7202[util[_0xfbad('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0xbe9324;}if(_0x137155&&_0x137155[_0xfbad('0x2b')]){for(var _0x1b8dac in _0x137155[_0xfbad('0x2b')]){if(_0x137155['Contact']['hasOwnProperty'](_0x1b8dac)){if(!_[_0xfbad('0x16')](_0x137155[_0xfbad('0x2b')][_0x1b8dac])&&_0x1b8dac!=='id'&&_0x1b8dac!==_0xfbad('0x2c')&&_0x1b8dac!==_0xfbad('0x2d')&&_0x1b8dac!==_0xfbad('0x2e')){_0x2c7202[util[_0xfbad('0x14')](_0xfbad('0x2f'),_0xfbad('0x30'),_[_0xfbad('0x31')](_0x1b8dac))]=_0x137155['Contact'][_0x1b8dac];}}}}return _0x2c7202;};exports['toLowerVariables']=function(_0x2c04fc){var _0x4fb66b={};for(var _0x42351f in _0x2c04fc){if(_0x2c04fc[_0xfbad('0x32')](_0x42351f)){_0x4fb66b[util[_0xfbad('0x14')]('%s',_['toLower'](_0x42351f))]=_0x2c04fc[_0x42351f];}}return{'variables':_0x4fb66b};};exports['updateOriginated']=function(_0x283a2e,_0x44ea60){if(!_[_0xfbad('0x16')](_0x283a2e)){if(_0x283a2e[_0xfbad('0x32')](_0xfbad('0x33'))){if(_0x283a2e['originated']>0x0){_0x283a2e[_0xfbad('0x33')]-=0x1;}else{logger['error'](_0xfbad('0x34'),_0x44ea60);}}}else{logger[_0xfbad('0xd')](_0xfbad('0x35'),_0x44ea60);}};exports[_0xfbad('0x36')]=function(_0x1bd4e2){var _0x7d42a4=moment()[_0xfbad('0x14')](_0xfbad('0x37'));_0x1bd4e2[_0xfbad('0x38')]=0xd;_0x1bd4e2['statedesc']='Blacklist';_0x1bd4e2[_0xfbad('0x39')]=_0x7d42a4;_0x1bd4e2[_0xfbad('0x3a')]=_0x7d42a4;_0x1bd4e2[_0xfbad('0x3b')]=_0x7d42a4;};exports[_0xfbad('0x3c')]=function(_0x140a52,_0x398b6c,_0x4d0bba){var _0xdf8787=moment()[_0xfbad('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x140a52[_0xfbad('0x38')]=_0x398b6c;_0x140a52[_0xfbad('0x3d')]=_0x4d0bba;_0x140a52[_0xfbad('0x3a')]=_0xdf8787;_0x140a52[_0xfbad('0x3e')]=getSeconds(_0x140a52[_0xfbad('0x3a')],_0x140a52[_0xfbad('0x39')]);};exports[_0xfbad('0x3f')]=function(_0x350014,_0x564965,_0x2f1770){_0x350014[_0xfbad('0x40')]=_0x564965;_0x350014[_0xfbad('0x41')]=_0x2f1770;};exports[_0xfbad('0x42')]=function(_0x248117,_0x58089f,_0x30e13f){var _0x260875=moment()[_0xfbad('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x248117[_0xfbad('0x38')]=_0x58089f;_0x248117[_0xfbad('0x3d')]=_0x30e13f;_0x248117[_0xfbad('0x3a')]=_0x248117[_0xfbad('0x3a')]?_0x248117[_0xfbad('0x3a')]:_0x260875;_0x248117[_0xfbad('0x3b')]=_0x248117['endtime']?_0x248117[_0xfbad('0x3b')]:_0x260875;_0x248117['ringtime']=getSeconds(_0x248117[_0xfbad('0x3a')]||0x0,_0x248117[_0xfbad('0x39')]||0x0);_0x248117['talktime']=_0x248117[_0xfbad('0x43')]?getSeconds(_0x248117[_0xfbad('0x3b')],_0x248117[_0xfbad('0x43')]):0x0;};exports[_0xfbad('0x44')]=function(_0x3a7630){return _0x3a7630===_0xfbad('0x45');};exports[_0xfbad('0x46')]=function(_0x4e8be2,_0x5b0a88,_0x2d8172,_0x1b3feb,_0x2d1033){var _0x32c593=_0x1b3feb?_0xfbad('0x47'):_0x4e8be2[_0xfbad('0x1a')];_0x32c593=_0x2d1033?_0xfbad('0x48'):_0x32c593;return{'actionid':_0x4e8be2[_0xfbad('0x49')],'action':_0xfbad('0x4a'),'channel':_0x4e8be2[_0xfbad('0x4b')],'callerid':util[_0xfbad('0x14')](_0xfbad('0x13'),_0x32c593,_0x4e8be2['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x2d8172,'timeout':(_0x5b0a88[_0xfbad('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4e8be2[_0xfbad('0x49')]};};exports['totalGlobal']=function(_0x2d6ece){return _0x2d6ece['countbusyretry']+_0x2d6ece['countcongestionretry']+_0x2d6ece[_0xfbad('0x4d')]+_0x2d6ece[_0xfbad('0x4e')]+_0x2d6ece[_0xfbad('0x4f')];};exports[_0xfbad('0x50')]=function(_0x2c3ee8){var _0x2526ad=_[_0xfbad('0x51')](_0x2c3ee8);_0x2526ad[_0xfbad('0x38')]=0xf;_0x2526ad[_0xfbad('0x3d')]=_0xfbad('0x52');return _0x2526ad;};exports[_0xfbad('0x53')]=function(_0x2139d8,_0x13981f,_0x32b487){var _0xd87be0={};_0xd87be0[_0x13981f]=_0x2139d8[_0x13981f];_0xd87be0[_0xfbad('0x54')]=![];_0xd87be0['scheduledat']=moment()[_0xfbad('0x55')](_0x32b487,'minutes')[_0xfbad('0x14')](_0xfbad('0x37'));_0xd87be0['ContactId']=_0x2139d8[_0xfbad('0x1c')];_0xd87be0[_0xfbad('0x56')]=_0x2139d8[_0xfbad('0x56')];_0xd87be0[_0xfbad('0x1e')]=_0x2139d8[_0xfbad('0x1e')]||undefined;return _0xd87be0;};exports[_0xfbad('0x57')]=function(_0x1ff4ea,_0x51bca1){if(!_[_0xfbad('0x16')](_0x1ff4ea)){if(_0x1ff4ea[_0xfbad('0x58')]>0x0){_0x1ff4ea[_0xfbad('0x58')]-=0x1;}else{logger[_0xfbad('0xd')](_0x51bca1,_0xfbad('0x59'));}}else{logger[_0xfbad('0xd')](_0x51bca1,_0xfbad('0x5a'));}};exports[_0xfbad('0x5b')]=function(_0x4db7a6){if(_0x4db7a6<=0x0){return!![];}return![];};function buildObj(_0x4d7a8f,_0x23beb9,_0x1ea5fe){_0x4d7a8f[_0xfbad('0x5c')]=_0x23beb9;_0x4d7a8f[_0xfbad('0x19')]=_0x4d7a8f[_0xfbad('0x5d')];_0x4d7a8f[_0xfbad('0x5e')]=_0x4d7a8f[_0xfbad('0x4b')];_0x4d7a8f[_0xfbad('0x5f')]=_0xfbad('0x60');if(_0x1ea5fe){_0x4d7a8f[_0xfbad('0x61')]=_0x1ea5fe[_0xfbad('0x61')];}return _0x4d7a8f;}exports[_0xfbad('0x62')]=buildObj;exports[_0xfbad('0x63')]=function(_0x175060){var _0x9caaec={};_0x9caaec[_0xfbad('0x5d')]=_0x175060[_0xfbad('0x5d')];_0x9caaec['interface']=_0x175060[_0xfbad('0x4b')];_0x9caaec[_0xfbad('0x49')]=_0x175060[_0xfbad('0x49')];return _0x9caaec;};exports['agentReadyId']=function(_0x1ae4c9){var _0x582857=[];for(var _0x1f9604 in _0x1ae4c9){if(_0x1ae4c9[_0xfbad('0x32')](_0x1f9604)){if(!_[_0xfbad('0x16')](_0x1ae4c9[_0x1f9604])&&_0x1ae4c9[_0x1f9604][_0xfbad('0x38')]===_0xfbad('0x64')&&_0x1ae4c9[_0x1f9604]['status']===_0xfbad('0x65')){_0x582857[_0xfbad('0x66')](_0x1ae4c9[_0x1f9604]['id']);}}}return _0x582857;};exports['getDiff']=function(_0x54ddcb){var _0x2f2e6e=moment()[_0xfbad('0x6')](0x0);var _0x57770e=moment(_0x54ddcb)[_0xfbad('0x6')](0x0);return _0x2f2e6e[_0xfbad('0x67')](_0x57770e,_0xfbad('0x7'));};exports[_0xfbad('0x68')]=function(_0x4dad1b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4dad1b['ContactId'],'ListId':_0x4dad1b[_0xfbad('0x56')],'VoiceQueueId':_0x4dad1b[_0xfbad('0x1e')]||undefined,'CampaignId':_0x4dad1b[_0xfbad('0x69')]||undefined};};exports[_0xfbad('0x6a')]=function(_0x3eac73){if(_0x3eac73===_0xfbad('0x49')||_0x3eac73===_0xfbad('0x6b')||_0x3eac73==='queue'||_0x3eac73==='type'||_0x3eac73===_0xfbad('0x6c')||_0x3eac73===_0xfbad('0x6d')||_0x3eac73===_0xfbad('0x40')||_0x3eac73===_0xfbad('0x4b')||_0x3eac73===_0xfbad('0x1a')||_0x3eac73==='active'||_0x3eac73===_0xfbad('0x1b')||_0x3eac73===_0xfbad('0x6e')||_0x3eac73===_0xfbad('0x6f')||_0x3eac73==='countcongestionretry'||_0x3eac73===_0xfbad('0x4d')||_0x3eac73===_0xfbad('0x70')||_0x3eac73===_0xfbad('0x71')||_0x3eac73===_0xfbad('0x72')||_0x3eac73==='callbackat'||_0x3eac73==='recallme'||_0x3eac73===_0xfbad('0x1c')||_0x3eac73===_0xfbad('0x56')||_0x3eac73===_0xfbad('0x41')||_0x3eac73===_0xfbad('0x1e')||_0x3eac73===_0xfbad('0x73')||_0x3eac73==='xmd-voicequeueid'||_0x3eac73===_0xfbad('0x74')||_0x3eac73==='xmd-phone'||_0x3eac73===_0xfbad('0x75')||_0x3eac73===_0xfbad('0x76')||_0x3eac73===_0xfbad('0x77')||_0x3eac73===_0xfbad('0x78')||_0x3eac73===_0xfbad('0x79')||_0x3eac73===_0xfbad('0x7a')||_0x3eac73===_0xfbad('0x7b')||_0x3eac73===_0xfbad('0x7c')||_0x3eac73===_0xfbad('0x7d')||_0x3eac73===_0xfbad('0x7e')||_0x3eac73===_0xfbad('0x7f')||_0x3eac73===_0xfbad('0x80')||_0x3eac73===_0xfbad('0x81')||_0x3eac73==='rtpaudioqosjitter'||_0x3eac73==='rtpaudioqosjitterbridged'||_0x3eac73===_0xfbad('0x82')||_0x3eac73===_0xfbad('0x83')||_0x3eac73==='rtpaudioqosrtt'||_0x3eac73===_0xfbad('0x84')||_0x3eac73===_0xfbad('0x80')||_0x3eac73==='rtpaudioqosbridged'||_0x3eac73===_0xfbad('0x85')||_0x3eac73===_0xfbad('0x86')||_0x3eac73==='rtpaudioqosloss'||_0x3eac73==='rtpaudioqoslossbridged'||_0x3eac73===_0xfbad('0x87')||_0x3eac73===_0xfbad('0x84')||_0x3eac73===_0xfbad('0x88')||_0x3eac73===_0xfbad('0x89')||_0x3eac73===_0xfbad('0x38')||_0x3eac73===_0xfbad('0x3d')){return![];}return!![];};exports[_0xfbad('0x8a')]=function(_0x1b9b50,_0x370202){var _0xba9293,_0x305a7d,_0xd05293;if(_0x370202<=0x0){_0x370202=0x1;}_0xba9293=new RegExp(_0xfbad('0x8b')+_0x370202+'}$');_0x305a7d=Math[_0xfbad('0x8c')](0xa,_0x370202-0x1);_0xd05293=Math[_0xfbad('0x8c')](0xa,_0x370202)-0x1;return util[_0xfbad('0x14')]('%s',_['replace'](_0x1b9b50,_0xba9293,_[_0xfbad('0x8d')](_0x305a7d,_0xd05293)));};exports['extractCalleridName']=function(_0x7d1c1e){var _0x2364c1=_0x7d1c1e[_0xfbad('0x8e')](/"(.*?)"/);return _0x2364c1?_0x2364c1[0x1]:_0x7d1c1e;};exports[_0xfbad('0x8f')]=function(_0x162f47){var _0x26e300=_0x162f47[_0xfbad('0x8e')](/<(.*?)>/);return _0x26e300?_0x26e300[0x1]:_0x162f47;};function buildNoAnswerEventPayload(_0x1fc16b,_0x31102e){var _0x3a3d2b=buildObj(_0x1fc16b,_0xfbad('0x90'));if(!_[_0xfbad('0x11')](_0x31102e[_0xfbad('0x91')])){Object['keys'](_0x31102e[_0xfbad('0x91')])[_0xfbad('0x92')](function(_0xe05f52){_0x3a3d2b[_0xe05f52[_0xfbad('0x93')]()]=_0x31102e['variables'][_0xe05f52];});}return _0x3a3d2b;}exports[_0xfbad('0x94')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xfe4d=['xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','loggerCatch','logger','info','inspect','error','logger2','message','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','state','ringtime','logLookAgent','membername','UserId','logCustomer','responsetime','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-contactid'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xfe4d,0xa8));var _0xdfe4=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0xfe4d[_0x1f7af5];return _0x576a87;};'use strict';var util=require(_0xdfe4('0x0'));var _=require(_0xdfe4('0x1'));var moment=require(_0xdfe4('0x2'));var logger=require(_0xdfe4('0x3'))(_0xdfe4('0x4'));var ipAgi=process[_0xdfe4('0x5')]['XCALLY_IP_AGI']||_0xdfe4('0x6');function getSeconds(_0xbd53a8,_0x3f2885){var _0x1a64a6=moment(_0xbd53a8)[_0xdfe4('0x7')](0x0);var _0x3731d1=moment(_0x3f2885)['milliseconds'](0x0);return _0x1a64a6[_0xdfe4('0x8')](_0x3731d1,'seconds');}exports[_0xdfe4('0x9')]=function(_0x17bd65){return function(_0x3c53ff){logger['error'](_0x17bd65,util['inspect'](_0x3c53ff,{'showHidden':![],'depth':null}));};};exports[_0xdfe4('0xa')]=function(_0x11b0f5,_0x31e804){logger[_0xdfe4('0xb')](_0x11b0f5,util[_0xdfe4('0xc')](_0x31e804,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x232eee,_0x22ae36){logger[_0xdfe4('0xd')](_0x232eee,util[_0xdfe4('0xc')](_0x22ae36,{'showHidden':![],'depth':null}));};exports[_0xdfe4('0xe')]=function(_0x4cc0ee){return function(_0x4cdd06){logger[_0xdfe4('0xb')](_0x4cc0ee,util[_0xdfe4('0xc')](_0x4cdd06,{'showHidden':![],'depth':null}));};};exports[_0xdfe4('0xf')]=function(_0x76358c,_0x1b88d2,_0x597d50){return{'message':_0x76358c,'unlock':_0x1b88d2,'active':_0x597d50};};exports[_0xdfe4('0x10')]=function(_0x38ef3a,_0x34588b,_0x15572e){if(!_[_0xdfe4('0x11')](_0x15572e)&&'string'===typeof _0x15572e&&!_[_0xdfe4('0x12')](_0x15572e)){if(!_['isUndefined'](_0x34588b)&&_0xdfe4('0x13')===typeof _0x34588b&&!_[_0xdfe4('0x12')](_0x34588b)){return util['format'](_0xdfe4('0x14'),_0x34588b,_0x15572e);}return util[_0xdfe4('0x15')]('\x22%s\x22\x20<%s>',_0x15572e,_0x15572e);}if(!_[_0xdfe4('0x11')](_0x38ef3a)&&_0xdfe4('0x13')===typeof _0x38ef3a&&!_[_0xdfe4('0x12')](_0x38ef3a)){return _0x38ef3a;}return _0xdfe4('0x16');};exports[_0xdfe4('0x17')]=function(_0x2fdf48){if(_[_0xdfe4('0x18')](_0x2fdf48)){return![];}return _0x2fdf48;};exports['addVariables']=function(_0x2b8056,_0x43899a,_0x5d8d65,_0x13ee03,_0x53056c,_0x2634c6){var _0x2c0ded={'XMD-QUEUE':_0x43899a[_0xdfe4('0x19')]?_0x43899a['Queue'][_0xdfe4('0x1a')]:'','XMD-CALLERID':_0x13ee03,'XMD-CALLERID-PREVIEW':_0x2634c6?util[_0xdfe4('0x15')](_0xdfe4('0x14'),_0x2634c6[_0xdfe4('0x1b')],_0x2634c6[_0xdfe4('0x1c')]):_0x13ee03,'XMD-DIALID':_0x53056c,'XMD-CONTACTID':_0x43899a[_0xdfe4('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x13ee03,'XMD-VOICEQUEUEID':_0x43899a[_0xdfe4('0x1e')],'XMD-DIALCHANNEL':_0x5d8d65,'XMD-DIALTIMEOUT':_0x2b8056[_0xdfe4('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x2b8056[_0xdfe4('0x20')]?'g':'',_[_0xdfe4('0x12')](_0x2b8056['monitor_format'])?'':_0xdfe4('0x21')),'XMD-DIALURL':_0x2b8056['dialPreviewUrl']||'','XMD-AGI':_0x2b8056[_0xdfe4('0x22')]?util[_0xdfe4('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2b8056[_0xdfe4('0x22')]):_0xdfe4('0x23'),'XMD-AGIAFTER':_0x2b8056[_0xdfe4('0x20')]?util[_0xdfe4('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2b8056[_0xdfe4('0x20')]):_0xdfe4('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x2634c6?_0x2634c6[_0xdfe4('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x2634c6?_0x2634c6[_0xdfe4('0x25')]:'','XMD-DESTINATION':_0xdfe4('0x26'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x2b8056[_0xdfe4('0x27')])){_0x2c0ded[util['format']('%s',_0xdfe4('0x28'))]=_0x2b8056[_0xdfe4('0x27')];_0x2c0ded[util[_0xdfe4('0x15')]('%s',_0xdfe4('0x29'))]=_0x53056c;}if(_0x43899a&&_0x43899a[_0xdfe4('0x2a')]){for(var _0x97ecd5 in _0x43899a[_0xdfe4('0x2a')]){if(_0x43899a[_0xdfe4('0x2a')][_0xdfe4('0x2b')](_0x97ecd5)){if(!_[_0xdfe4('0x18')](_0x43899a[_0xdfe4('0x2a')][_0x97ecd5])&&_0x97ecd5!=='id'&&_0x97ecd5!==_0xdfe4('0x2c')&&_0x97ecd5!==_0xdfe4('0x2d')&&_0x97ecd5!==_0xdfe4('0x2e')){_0x2c0ded[util[_0xdfe4('0x15')](_0xdfe4('0x2f'),'XMD-',_[_0xdfe4('0x30')](_0x97ecd5))]=_0x43899a[_0xdfe4('0x2a')][_0x97ecd5];}}}}return _0x2c0ded;};exports[_0xdfe4('0x31')]=function(_0x409453){var _0x30df50={};for(var _0x24e27a in _0x409453){if(_0x409453['hasOwnProperty'](_0x24e27a)){_0x30df50[util[_0xdfe4('0x15')]('%s',_[_0xdfe4('0x32')](_0x24e27a))]=_0x409453[_0x24e27a];}}return{'variables':_0x30df50};};exports['updateOriginated']=function(_0x267e9a,_0x5a7152){if(!_[_0xdfe4('0x18')](_0x267e9a)){if(_0x267e9a[_0xdfe4('0x2b')](_0xdfe4('0x33'))){if(_0x267e9a['originated']>0x0){_0x267e9a[_0xdfe4('0x33')]-=0x1;}else{logger[_0xdfe4('0xd')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5a7152);}}}else{logger[_0xdfe4('0xd')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5a7152);}};exports['logBlacklist']=function(_0x549bbd){var _0x85bac0=moment()['format'](_0xdfe4('0x34'));_0x549bbd['state']=0xd;_0x549bbd[_0xdfe4('0x35')]='Blacklist';_0x549bbd[_0xdfe4('0x36')]=_0x85bac0;_0x549bbd['responsetime']=_0x85bac0;_0x549bbd['endtime']=_0x85bac0;};exports['logAgent']=function(_0x31b91f,_0xf7839c,_0x4a2ab9){var _0x2bc5e6=moment()[_0xdfe4('0x15')](_0xdfe4('0x34'));_0x31b91f[_0xdfe4('0x37')]=_0xf7839c;_0x31b91f[_0xdfe4('0x35')]=_0x4a2ab9;_0x31b91f['responsetime']=_0x2bc5e6;_0x31b91f[_0xdfe4('0x38')]=getSeconds(_0x31b91f['responsetime'],_0x31b91f[_0xdfe4('0x36')]);};exports[_0xdfe4('0x39')]=function(_0x35a1c3,_0x82bc5f,_0x1226b6){_0x35a1c3[_0xdfe4('0x3a')]=_0x82bc5f;_0x35a1c3[_0xdfe4('0x3b')]=_0x1226b6;};exports[_0xdfe4('0x3c')]=function(_0x204bae,_0x104c4c,_0x1eb0a4){var _0x387386=moment()[_0xdfe4('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x204bae[_0xdfe4('0x37')]=_0x104c4c;_0x204bae[_0xdfe4('0x35')]=_0x1eb0a4;_0x204bae['responsetime']=_0x204bae[_0xdfe4('0x3d')]?_0x204bae[_0xdfe4('0x3d')]:_0x387386;_0x204bae[_0xdfe4('0x3e')]=_0x204bae[_0xdfe4('0x3e')]?_0x204bae[_0xdfe4('0x3e')]:_0x387386;_0x204bae[_0xdfe4('0x38')]=getSeconds(_0x204bae[_0xdfe4('0x3d')]||0x0,_0x204bae[_0xdfe4('0x36')]||0x0);_0x204bae[_0xdfe4('0x3f')]=_0x204bae[_0xdfe4('0x40')]?getSeconds(_0x204bae['endtime'],_0x204bae[_0xdfe4('0x40')]):0x0;};exports[_0xdfe4('0x41')]=function(_0x3f72f8){return _0x3f72f8===_0xdfe4('0x42');};exports[_0xdfe4('0x43')]=function(_0x526810,_0x450299,_0x6fba1f,_0x3ba437,_0xe22b13){var _0x538b90=_0x3ba437?_0xdfe4('0x44'):_0x526810['calleridname'];_0x538b90=_0xe22b13?_0xdfe4('0x45'):_0x538b90;return{'actionid':_0x526810[_0xdfe4('0x46')],'action':_0xdfe4('0x47'),'channel':_0x526810[_0xdfe4('0x48')],'callerid':util[_0xdfe4('0x15')](_0xdfe4('0x14'),_0x538b90,_0x526810[_0xdfe4('0x1c')]),'Exten':_0xdfe4('0x26'),'Context':_0xdfe4('0x49'),'Priority':'1','variable':_0x6fba1f,'timeout':(_0x450299['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x526810['uniqueid']};};exports['totalGlobal']=function(_0x53aa29){return _0x53aa29[_0xdfe4('0x4a')]+_0x53aa29['countcongestionretry']+_0x53aa29[_0xdfe4('0x4b')]+_0x53aa29[_0xdfe4('0x4c')]+_0x53aa29[_0xdfe4('0x4d')];};exports['cloneAction']=function(_0x4fd8a9){var _0x4fbe8d=_['clone'](_0x4fd8a9);_0x4fbe8d[_0xdfe4('0x37')]=0xf;_0x4fbe8d[_0xdfe4('0x35')]=_0xdfe4('0x4e');return _0x4fbe8d;};exports[_0xdfe4('0x4f')]=function(_0x24daef,_0x49d4ac,_0x21a284){var _0x403b05={};_0x403b05[_0x49d4ac]=_0x24daef[_0x49d4ac];_0x403b05[_0xdfe4('0x50')]=![];_0x403b05[_0xdfe4('0x51')]=moment()['add'](_0x21a284,_0xdfe4('0x52'))[_0xdfe4('0x15')](_0xdfe4('0x34'));_0x403b05['ContactId']=_0x24daef[_0xdfe4('0x1d')];_0x403b05[_0xdfe4('0x53')]=_0x24daef[_0xdfe4('0x53')];_0x403b05[_0xdfe4('0x1e')]=_0x24daef[_0xdfe4('0x1e')]||undefined;return _0x403b05;};exports[_0xdfe4('0x54')]=function(_0x5705b9,_0x5c5de9){if(!_['isNil'](_0x5705b9)){if(_0x5705b9[_0xdfe4('0x55')]>0x0){_0x5705b9[_0xdfe4('0x55')]-=0x1;}else{logger[_0xdfe4('0xd')](_0x5c5de9,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xdfe4('0xd')](_0x5c5de9,_0xdfe4('0x56'));}};exports[_0xdfe4('0x57')]=function(_0x590a0a){if(_0x590a0a<=0x0){return!![];}return![];};function buildObj(_0x5c002f,_0x477e25,_0x14904f){_0x5c002f[_0xdfe4('0x58')]=_0x477e25;_0x5c002f[_0xdfe4('0x1a')]=_0x5c002f[_0xdfe4('0x59')];_0x5c002f[_0xdfe4('0x5a')]=_0x5c002f['channelAgent'];_0x5c002f[_0xdfe4('0x5b')]=_0xdfe4('0x5c');if(_0x14904f){_0x5c002f[_0xdfe4('0x5d')]=_0x14904f[_0xdfe4('0x5d')];}return _0x5c002f;}exports[_0xdfe4('0x5e')]=buildObj;exports['buildAcw']=function(_0x41e834){var _0x21a0e8={};_0x21a0e8[_0xdfe4('0x59')]=_0x41e834['queue'];_0x21a0e8[_0xdfe4('0x5a')]=_0x41e834['channelAgent'];_0x21a0e8[_0xdfe4('0x46')]=_0x41e834[_0xdfe4('0x46')];return _0x21a0e8;};exports[_0xdfe4('0x5f')]=function(_0xa242f8){var _0x44d514=[];for(var _0x5a724a in _0xa242f8){if(_0xa242f8[_0xdfe4('0x2b')](_0x5a724a)){if(!_[_0xdfe4('0x18')](_0xa242f8[_0x5a724a])&&_0xa242f8[_0x5a724a][_0xdfe4('0x37')]===_0xdfe4('0x60')&&_0xa242f8[_0x5a724a][_0xdfe4('0x61')]===_0xdfe4('0x62')){_0x44d514[_0xdfe4('0x63')](_0xa242f8[_0x5a724a]['id']);}}}return _0x44d514;};exports[_0xdfe4('0x64')]=function(_0x146043){var _0xf95765=moment()['milliseconds'](0x0);var _0x52cafb=moment(_0x146043)[_0xdfe4('0x7')](0x0);return _0xf95765[_0xdfe4('0x8')](_0x52cafb,_0xdfe4('0x65'));};exports['createBody']=function(_0x3ee326){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3ee326[_0xdfe4('0x1d')],'ListId':_0x3ee326[_0xdfe4('0x53')],'VoiceQueueId':_0x3ee326[_0xdfe4('0x1e')]||undefined,'CampaignId':_0x3ee326['CampaignId']||undefined};};exports[_0xdfe4('0x66')]=function(_0x3f890c){if(_0x3f890c===_0xdfe4('0x46')||_0x3f890c===_0xdfe4('0x67')||_0x3f890c===_0xdfe4('0x59')||_0x3f890c===_0xdfe4('0x68')||_0x3f890c===_0xdfe4('0x69')||_0x3f890c===_0xdfe4('0x6a')||_0x3f890c===_0xdfe4('0x3a')||_0x3f890c===_0xdfe4('0x48')||_0x3f890c===_0xdfe4('0x1b')||_0x3f890c===_0xdfe4('0x50')||_0x3f890c==='calleridnum'||_0x3f890c===_0xdfe4('0x51')||_0x3f890c===_0xdfe4('0x4a')||_0x3f890c==='countcongestionretry'||_0x3f890c===_0xdfe4('0x4b')||_0x3f890c===_0xdfe4('0x6b')||_0x3f890c===_0xdfe4('0x6c')||_0x3f890c===_0xdfe4('0x6d')||_0x3f890c===_0xdfe4('0x6e')||_0x3f890c===_0xdfe4('0x6f')||_0x3f890c===_0xdfe4('0x1d')||_0x3f890c===_0xdfe4('0x53')||_0x3f890c==='UserId'||_0x3f890c===_0xdfe4('0x1e')||_0x3f890c===_0xdfe4('0x70')||_0x3f890c==='xmd-voicequeueid'||_0x3f890c==='xmd-queue'||_0x3f890c===_0xdfe4('0x71')||_0x3f890c===_0xdfe4('0x72')||_0x3f890c===_0xdfe4('0x73')||_0x3f890c==='xmd-dialtimeout'||_0x3f890c===_0xdfe4('0x74')||_0x3f890c==='xmd-dialid'||_0x3f890c==='xmd-dialchannel'||_0x3f890c===_0xdfe4('0x75')||_0x3f890c===_0xdfe4('0x76')||_0x3f890c===_0xdfe4('0x77')||_0x3f890c===_0xdfe4('0x78')||_0x3f890c===_0xdfe4('0x79')||_0x3f890c===_0xdfe4('0x7a')||_0x3f890c===_0xdfe4('0x7b')||_0x3f890c===_0xdfe4('0x7c')||_0x3f890c==='rtpaudioqosjitterbridged'||_0x3f890c==='rtpaudioqosloss'||_0x3f890c===_0xdfe4('0x7d')||_0x3f890c==='rtpaudioqosrtt'||_0x3f890c===_0xdfe4('0x7e')||_0x3f890c===_0xdfe4('0x7a')||_0x3f890c===_0xdfe4('0x7b')||_0x3f890c===_0xdfe4('0x7c')||_0x3f890c===_0xdfe4('0x7f')||_0x3f890c===_0xdfe4('0x80')||_0x3f890c===_0xdfe4('0x7d')||_0x3f890c===_0xdfe4('0x81')||_0x3f890c===_0xdfe4('0x7e')||_0x3f890c===_0xdfe4('0x82')||_0x3f890c===_0xdfe4('0x83')||_0x3f890c==='state'||_0x3f890c===_0xdfe4('0x35')){return![];}return!![];};exports[_0xdfe4('0x84')]=function(_0x3aa392,_0x1b61b6){var _0x2cba73,_0x5456d1,_0x158637;if(_0x1b61b6<=0x0){_0x1b61b6=0x1;}_0x2cba73=new RegExp(_0xdfe4('0x85')+_0x1b61b6+'}$');_0x5456d1=Math[_0xdfe4('0x86')](0xa,_0x1b61b6-0x1);_0x158637=Math['pow'](0xa,_0x1b61b6)-0x1;return util[_0xdfe4('0x15')]('%s',_[_0xdfe4('0x87')](_0x3aa392,_0x2cba73,_[_0xdfe4('0x88')](_0x5456d1,_0x158637)));};exports['extractCalleridName']=function(_0x41cbcd){var _0x3e0dfa=_0x41cbcd[_0xdfe4('0x89')](/"(.*?)"/);return _0x3e0dfa?_0x3e0dfa[0x1]:_0x41cbcd;};exports[_0xdfe4('0x8a')]=function(_0x126d2f){var _0x34213b=_0x126d2f['match'](/<(.*?)>/);return _0x34213b?_0x34213b[0x1]:_0x126d2f;};function buildNoAnswerEventPayload(_0x4a6dc4,_0x2fd2f6){var _0x2892b1=buildObj(_0x4a6dc4,'noanswer');if(!_[_0xdfe4('0x12')](_0x2fd2f6[_0xdfe4('0x8b')])){Object[_0xdfe4('0x8c')](_0x2fd2f6[_0xdfe4('0x8b')])[_0xdfe4('0x8d')](function(_0x31cc73){_0x2892b1[_0x31cc73[_0xdfe4('0x8e')]()]=_0x2fd2f6[_0xdfe4('0x8b')][_0x31cc73];});}return _0x2892b1;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7ba75ca..2bd769e 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 _0xd782=['number','queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x4e6e4a,_0x3d8293){var _0x48e505=function(_0x34f8ba){while(--_0x34f8ba){_0x4e6e4a['push'](_0x4e6e4a['shift']());}};_0x48e505(++_0x3d8293);}(_0xd782,0xf1));var _0x2d78=function(_0x278516,_0x222985){_0x278516=_0x278516-0x0;var _0x3bd9a0=_0xd782[_0x278516];return _0x3bd9a0;};'use strict';exports[_0x2d78('0x0')]={'queue':{'type':_0x2d78('0x1'),'required':!![]},'interface':{'type':_0x2d78('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x2d78('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x2d78('0x1'),'required':!![]},'interface':{'type':_0x2d78('0x1'),'required':!![]}};exports[_0x2d78('0x3')]={'interface':{'type':_0x2d78('0x1'),'required':!![]},'paused':{'type':_0x2d78('0x4')},'reason':{'type':'string','required':![]}};exports[_0x2d78('0x5')]={'module':{'type':_0x2d78('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x2d78('0x1'),'required':!![]}};exports[_0x2d78('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x2d78('0x1')}};exports[_0x2d78('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x2d78('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x2d78('0x1')}}; \ No newline at end of file +var _0x2366=['queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number'];(function(_0x18aef6,_0x348638){var _0x3c8a6d=function(_0x52a319){while(--_0x52a319){_0x18aef6['push'](_0x18aef6['shift']());}};_0x3c8a6d(++_0x348638);}(_0x2366,0xc4));var _0x6236=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x2366[_0x1d87fc];return _0x492b56;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6236('0x0'),'required':!![]},'membername':{'type':_0x6236('0x0'),'required':!![]},'penalty':{'type':_0x6236('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6236('0x2')]={'queue':{'type':_0x6236('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x6236('0x3')]={'interface':{'type':_0x6236('0x0'),'required':!![]},'paused':{'type':_0x6236('0x4')},'reason':{'type':_0x6236('0x0'),'required':![]}};exports[_0x6236('0x5')]={'module':{'type':_0x6236('0x0'),'required':![]}};exports[_0x6236('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x6236('0x7')]={'uniqueid':{'type':_0x6236('0x0'),'required':!![]},'filename':{'type':_0x6236('0x0')},'format':{'type':_0x6236('0x0')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6236('0x0'),'required':!![]}};exports[_0x6236('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6236('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 852fde6..d9493e9 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 _0xeb0f=['sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','total','unmanaged','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','telephones','initTrunks','trunks','initVoiceQueues','templates','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumHoldTime'];(function(_0x4b1df7,_0x331f15){var _0x2d52aa=function(_0xf0b183){while(--_0xf0b183){_0x4b1df7['push'](_0x4b1df7['shift']());}};_0x2d52aa(++_0x331f15);}(_0xeb0f,0x176));var _0xfeb0=function(_0x407084,_0x2690f1){_0x407084=_0x407084-0x0;var _0x1871cb=_0xeb0f[_0x407084];return _0x1871cb;};'use strict';var util=require(_0xfeb0('0x0'));var _=require('lodash');var moment=require(_0xfeb0('0x1'));var Agent=require(_0xfeb0('0x2'));var Telephone=require(_0xfeb0('0x3'));var Trunk=require(_0xfeb0('0x4'));var VoiceQueue=require(_0xfeb0('0x5'));var Trigger=require(_0xfeb0('0x6'));var Template=require('../model/template');var Campaign=require(_0xfeb0('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xfeb0('0x8'));var FreshdeskAccount=require(_0xfeb0('0x9'));var SugarcrmAccount=require(_0xfeb0('0xa'));var ZohoAccount=require(_0xfeb0('0xb'));var DeskAccount=require(_0xfeb0('0xc'));var VtigerAccount=require(_0xfeb0('0xd'));var ServicenowAccount=require(_0xfeb0('0xe'));var Dynamics365Account=require(_0xfeb0('0xf'));var FreshsalesAccount=require(_0xfeb0('0x10'));var FaxAccount=require(_0xfeb0('0x11'));var Realtime=function(){this[_0xfeb0('0x12')]={};this['telephones']={};this['trunks']={};this[_0xfeb0('0x13')]={};this[_0xfeb0('0x14')]={};this['campaigns']={};this['templates']={};this[_0xfeb0('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xfeb0('0x16')]={};this[_0xfeb0('0x17')]={};this[_0xfeb0('0x18')]={};this[_0xfeb0('0x19')]={};this['timers']={};this[_0xfeb0('0x1a')]={};this[_0xfeb0('0x1b')]={};this[_0xfeb0('0x1c')]={};this[_0xfeb0('0x1d')]={};this[_0xfeb0('0x1e')]={};this[_0xfeb0('0x1f')]={};this[_0xfeb0('0x20')]={};this[_0xfeb0('0x21')]={};this['servicenowAccounts']={};this[_0xfeb0('0x22')]={};this[_0xfeb0('0x23')]={};this[_0xfeb0('0x24')]={};};function freeIsNotKey(_0x58662b,_0x4f0c65,_0x4ede0e){var _0x1aa982=_[_0xfeb0('0x25')](_0x58662b,function(_0x3428ee,_0xf8f560){return _0x3428ee[_0x4ede0e];});for(var _0x3332ea in _0x4f0c65){if(_0x4f0c65[_0xfeb0('0x26')](_0x3332ea)){if(!_0x1aa982[_0x3332ea]){delete _0x4f0c65[_0x3332ea];}}}}function freeIsNotKeySip(_0x14bfc6,_0x2695ab){var _0x4c0611=_[_0xfeb0('0x25')](_0x14bfc6,function(_0x104a8d,_0x574194){return util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0x104a8d[_0xfeb0('0x29')]);});for(var _0x49088f in _0x2695ab){if(_0x2695ab[_0xfeb0('0x26')](_0x49088f)){if(!_0x4c0611[_0x49088f]){delete _0x2695ab[_0x49088f];}}}}function freeIsNotKeyAgent(_0x5f5d5c,_0x141cc0){var _0x43f155=_[_0xfeb0('0x25')](_0x5f5d5c,function(_0x42d053,_0x5aa08f){var _0x51cfc5=_[_0xfeb0('0x2a')](_0x42d053['interface'])?util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0x42d053[_0xfeb0('0x29')]):_0x42d053[_0xfeb0('0x2b')];return _0x51cfc5;});for(var _0x529fd4 in _0x141cc0){if(_0x141cc0[_0xfeb0('0x26')](_0x529fd4)){if(!_0x43f155[_0x529fd4]){delete _0x141cc0[_0x529fd4];}}}}function clearVoiceCallReports(_0x3b27c3){_0x3b27c3['total']=0x0;_0x3b27c3[_0xfeb0('0x2c')]=0x0;_0x3b27c3[_0xfeb0('0x2d')]=0x0;_0x3b27c3[_0xfeb0('0x2e')]=0x0;_0x3b27c3[_0xfeb0('0x2f')]=0x0;}function clearCampaigns(_0x2114dc){if(!_[_0xfeb0('0x30')](_0x2114dc)){for(var _0x298458 in _0x2114dc){if(_0x2114dc[_0xfeb0('0x26')](_0x298458)){_0x2114dc[_0x298458][_0xfeb0('0x31')]=0x0;_0x2114dc[_0x298458]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x44811a){if(!_[_0xfeb0('0x30')](_0x44811a)){for(var _0x4ef02c in _0x44811a){if(_0x44811a[_0xfeb0('0x26')](_0x4ef02c)){_0x44811a[_0x4ef02c][_0xfeb0('0x32')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x2c')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x33')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x34')]=0x0;_0x44811a[_0x4ef02c]['sumHoldTime']=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x2e')]=0x0;_0x44811a[_0x4ef02c]['sumBillable']=0x0;_0x44811a[_0x4ef02c]['outboundAnswerAgiCallsDay']=0x0;_0x44811a[_0x4ef02c]['outboundNoAnswerCallsDay']=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x35')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x36')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x37')]=0x0;_0x44811a[_0x4ef02c]['outboundUnknownCallsDay']=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x38')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x39')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x3a')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x3b')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x3c')]=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x3d')]=0x0;_0x44811a[_0x4ef02c]['outboundAnswerAgiCallsDay']=0x0;_0x44811a[_0x4ef02c]['outboundAnswerCallsDay']=0x0;_0x44811a[_0x4ef02c][_0xfeb0('0x3e')]=!![];}}}}Realtime['prototype'][_0xfeb0('0x3f')]=function(_0x1dde16,_0x3d4b51){for(var _0x1e0b98 in _0x3d4b51){if(_0x1dde16[_0xfeb0('0x26')](_0x1e0b98)){_0x1dde16[_0x1e0b98]=_0x3d4b51[_0x1e0b98];}}};Realtime[_0xfeb0('0x40')][_0xfeb0('0x41')]=function(){var _0x42db75=this;return function(_0x2f7c8a){if(_0x2f7c8a){freeIsNotKeyAgent(_0x2f7c8a,_0x42db75[_0xfeb0('0x12')]);for(var _0x41295c=0x0,_0x2cb4fb={},_0x28d4a6={};_0x41295c<_0x2f7c8a[_0xfeb0('0x42')];_0x41295c+=0x1){_0x2cb4fb=_0x2f7c8a[_0x41295c];var _0x1a59b1=_[_0xfeb0('0x2a')](_0x2cb4fb[_0xfeb0('0x2b')])?util['format'](_0xfeb0('0x28'),_0x2cb4fb[_0xfeb0('0x29')]):_0x2cb4fb['interface'];if(_[_0xfeb0('0x43')](_0x42db75[_0xfeb0('0x12')][_0x1a59b1])){_0x42db75[_0xfeb0('0x12')][_0x1a59b1]=new Agent(_0x2cb4fb);}else{_0x42db75[_0xfeb0('0x3f')](_0x42db75[_0xfeb0('0x12')][_0x1a59b1],_0x2cb4fb);}}}return _0x42db75['agents'];};};Realtime[_0xfeb0('0x40')]['initTelephones']=function(){var _0x52c48d=this;return function(_0x348c2c){if(_0x348c2c){freeIsNotKeySip(_0x348c2c,_0x52c48d['telephones']);for(var _0x3851fb=0x0,_0x58a729={},_0x2888f2={};_0x3851fb<_0x348c2c[_0xfeb0('0x42')];_0x3851fb+=0x1){_0x58a729=_0x348c2c[_0x3851fb];if(_[_0xfeb0('0x43')](_0x52c48d[_0xfeb0('0x44')][util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0x58a729[_0xfeb0('0x29')])])){_0x52c48d[_0xfeb0('0x44')][util[_0xfeb0('0x27')]('SIP/%s',_0x58a729[_0xfeb0('0x29')])]=new Telephone(_0x58a729);}else{_0x52c48d[_0xfeb0('0x3f')](_0x52c48d[_0xfeb0('0x44')][util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0x58a729['name'])],_0x58a729);}}}return _0x52c48d[_0xfeb0('0x44')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x45')]=function(){var _0x27f926=this;return function(_0x534642){if(_0x534642){freeIsNotKeySip(_0x534642,_0x27f926[_0xfeb0('0x46')]);for(var _0x461b60=0x0,_0xd742d7={},_0x189d7e={};_0x461b60<_0x534642[_0xfeb0('0x42')];_0x461b60+=0x1){_0xd742d7=_0x534642[_0x461b60];if(_[_0xfeb0('0x43')](_0x27f926['trunks'][util[_0xfeb0('0x27')]('SIP/%s',_0xd742d7[_0xfeb0('0x29')])])){_0x27f926['trunks'][util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0xd742d7[_0xfeb0('0x29')])]=new Trunk(_0xd742d7);}else{_0x27f926[_0xfeb0('0x3f')](_0x27f926[_0xfeb0('0x46')][util[_0xfeb0('0x27')](_0xfeb0('0x28'),_0xd742d7[_0xfeb0('0x29')])],_0xd742d7);}}}return _0x27f926[_0xfeb0('0x46')];};};Realtime['prototype'][_0xfeb0('0x47')]=function(){var _0x495d02=this;return function(_0x296565){if(_0x296565){freeIsNotKey(_0x296565,_0x495d02[_0xfeb0('0x13')],_0xfeb0('0x29'));for(var _0x35d4f3=0x0,_0x3c1b5d={},_0x5ba6d0={};_0x35d4f3<_0x296565['length'];_0x35d4f3+=0x1){_0x3c1b5d=_0x296565[_0x35d4f3];if(_[_0xfeb0('0x43')](_0x495d02[_0xfeb0('0x13')][_0x3c1b5d[_0xfeb0('0x29')]])){_0x495d02[_0xfeb0('0x13')][_0x3c1b5d[_0xfeb0('0x29')]]=new VoiceQueue(_0x3c1b5d);}else{_0x495d02[_0xfeb0('0x3f')](_0x495d02[_0xfeb0('0x13')][_0x3c1b5d[_0xfeb0('0x29')]],_0x3c1b5d);}}}return _0x495d02[_0xfeb0('0x13')];};};Realtime[_0xfeb0('0x40')]['initTriggers']=function(){var _0xad1f71=this;return function(_0x3e0e19){if(_0x3e0e19){freeIsNotKey(_0x3e0e19,_0xad1f71['triggers'],'id');for(var _0x3eb269=0x0,_0x3ee041={},_0x3f84ff={};_0x3eb269<_0x3e0e19['length'];_0x3eb269+=0x1){_0x3ee041=_0x3e0e19[_0x3eb269];if(_[_0xfeb0('0x43')](_0xad1f71[_0xfeb0('0x14')][_0x3ee041['id']])){_0xad1f71['triggers'][_0x3ee041['id']]=new Trigger(_0x3ee041);}else{_0xad1f71[_0xfeb0('0x3f')](_0xad1f71[_0xfeb0('0x14')][_0x3ee041['id']],_0x3ee041);}}}return _0xad1f71[_0xfeb0('0x14')];};};Realtime['prototype']['initTemplates']=function(){var _0x3f565e=this;return function(_0x491e81){if(_0x491e81){freeIsNotKey(_0x491e81,_0x3f565e[_0xfeb0('0x48')],'id');for(var _0xd774=0x0,_0x3dfb6b={},_0x3ebd6d={};_0xd774<_0x491e81[_0xfeb0('0x42')];_0xd774+=0x1){_0x3dfb6b=_0x491e81[_0xd774];if(_[_0xfeb0('0x43')](_0x3f565e[_0xfeb0('0x48')][_0x3dfb6b['id']])){_0x3f565e['templates'][_0x3dfb6b['id']]=new Template(_0x3dfb6b);}else{_0x3f565e['mergeFromDatabase'](_0x3f565e[_0xfeb0('0x48')][_0x3dfb6b['id']],_0x3dfb6b);}}}return _0x3f565e['templates'];};};Realtime[_0xfeb0('0x40')]['initZendeskAccounts']=function(){var _0x4c3c03=this;return function(_0x352d02){if(_0x352d02){freeIsNotKey(_0x352d02,_0x4c3c03[_0xfeb0('0x1b')],'id');for(var _0x450983=0x0,_0x1cb394={},_0x752bb0={};_0x450983<_0x352d02[_0xfeb0('0x42')];_0x450983+=0x1){_0x1cb394=_0x352d02[_0x450983];if(_[_0xfeb0('0x43')](_0x4c3c03[_0xfeb0('0x1b')][_0x1cb394['id']])){_0x4c3c03[_0xfeb0('0x1b')][_0x1cb394['id']]=new ZendeskAccount(_0x1cb394);}else{_0x4c3c03[_0xfeb0('0x3f')](_0x4c3c03[_0xfeb0('0x1b')][_0x1cb394['id']],_0x1cb394);}}}return _0x4c3c03[_0xfeb0('0x1b')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x49')]=function(){var _0x393681=this;return function(_0x4dbb57){if(_0x4dbb57){freeIsNotKey(_0x4dbb57,_0x393681['salesforceAccounts'],'id');for(var _0x18ec24=0x0,_0x574ad4={},_0x177541={};_0x18ec24<_0x4dbb57[_0xfeb0('0x42')];_0x18ec24+=0x1){_0x574ad4=_0x4dbb57[_0x18ec24];if(_[_0xfeb0('0x43')](_0x393681[_0xfeb0('0x1c')][_0x574ad4['id']])){_0x393681['salesforceAccounts'][_0x574ad4['id']]=new SalesforceAccount(_0x574ad4);}else{_0x393681['mergeFromDatabase'](_0x393681['salesforceAccounts'][_0x574ad4['id']],_0x574ad4);}}}return _0x393681[_0xfeb0('0x1c')];};};Realtime[_0xfeb0('0x40')]['initFreshdeskAccounts']=function(){var _0x11e95f=this;return function(_0x1dc290){if(_0x1dc290){freeIsNotKey(_0x1dc290,_0x11e95f[_0xfeb0('0x1e')],'id');for(var _0x5880cf=0x0,_0x58f7fe={},_0x2ea0d9={};_0x5880cf<_0x1dc290[_0xfeb0('0x42')];_0x5880cf+=0x1){_0x58f7fe=_0x1dc290[_0x5880cf];if(_[_0xfeb0('0x43')](_0x11e95f[_0xfeb0('0x1e')][_0x58f7fe['id']])){_0x11e95f[_0xfeb0('0x1e')][_0x58f7fe['id']]=new FreshdeskAccount(_0x58f7fe);}else{_0x11e95f[_0xfeb0('0x3f')](_0x11e95f[_0xfeb0('0x1e')][_0x58f7fe['id']],_0x58f7fe);}}}return _0x11e95f[_0xfeb0('0x1e')];};};Realtime['prototype'][_0xfeb0('0x4a')]=function(){var _0x39a8b8=this;return function(_0x339792){if(_0x339792){freeIsNotKey(_0x339792,_0x39a8b8['zohoAccounts'],'id');for(var _0x156683=0x0,_0x30a9d0={},_0x4e3c5a={};_0x156683<_0x339792[_0xfeb0('0x42')];_0x156683+=0x1){_0x30a9d0=_0x339792[_0x156683];if(_[_0xfeb0('0x43')](_0x39a8b8[_0xfeb0('0x1f')][_0x30a9d0['id']])){_0x39a8b8[_0xfeb0('0x1f')][_0x30a9d0['id']]=new ZohoAccount(_0x30a9d0);}else{_0x39a8b8[_0xfeb0('0x3f')](_0x39a8b8['zohoAccounts'][_0x30a9d0['id']],_0x30a9d0);}}}return _0x39a8b8[_0xfeb0('0x1f')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x4b')]=function(){var _0x4d02e4=this;return function(_0x4dd525){if(_0x4dd525){freeIsNotKey(_0x4dd525,_0x4d02e4[_0xfeb0('0x20')],'id');for(var _0x921bf3=0x0,_0x549534={},_0xa47efd={};_0x921bf3<_0x4dd525[_0xfeb0('0x42')];_0x921bf3+=0x1){_0x549534=_0x4dd525[_0x921bf3];if(_[_0xfeb0('0x43')](_0x4d02e4['deskAccounts'][_0x549534['id']])){_0x4d02e4[_0xfeb0('0x20')][_0x549534['id']]=new DeskAccount(_0x549534);}else{_0x4d02e4[_0xfeb0('0x3f')](_0x4d02e4[_0xfeb0('0x20')][_0x549534['id']],_0x549534);}}}return _0x4d02e4[_0xfeb0('0x20')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x4c')]=function(){var _0x1e928b=this;return function(_0x5f2cca){if(_0x5f2cca){freeIsNotKey(_0x5f2cca,_0x1e928b[_0xfeb0('0x1d')],'id');for(var _0x156c9c=0x0,_0x1df84e={},_0x91e193={};_0x156c9c<_0x5f2cca['length'];_0x156c9c+=0x1){_0x1df84e=_0x5f2cca[_0x156c9c];if(_['isUndefined'](_0x1e928b[_0xfeb0('0x1d')][_0x1df84e['id']])){_0x1e928b[_0xfeb0('0x1d')][_0x1df84e['id']]=new SugarcrmAccount(_0x1df84e);}else{_0x1e928b[_0xfeb0('0x3f')](_0x1e928b[_0xfeb0('0x1d')][_0x1df84e['id']],_0x1df84e);}}}return _0x1e928b[_0xfeb0('0x1d')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x4d')]=function(){var _0x14be8f=this;return function(_0x112836){if(_0x112836){freeIsNotKey(_0x112836,_0x14be8f[_0xfeb0('0x21')],'id');for(var _0x51c24c=0x0,_0x1a61e5={},_0x5efcab={};_0x51c24c<_0x112836['length'];_0x51c24c+=0x1){_0x1a61e5=_0x112836[_0x51c24c];if(_[_0xfeb0('0x43')](_0x14be8f['vtigerAccounts'][_0x1a61e5['id']])){_0x14be8f[_0xfeb0('0x21')][_0x1a61e5['id']]=new VtigerAccount(_0x1a61e5);}else{_0x14be8f[_0xfeb0('0x3f')](_0x14be8f[_0xfeb0('0x21')][_0x1a61e5['id']],_0x1a61e5);}}}return _0x14be8f[_0xfeb0('0x21')];};};Realtime[_0xfeb0('0x40')]['initServicenowAccounts']=function(){var _0x2ef790=this;return function(_0x5aaefc){if(_0x5aaefc){freeIsNotKey(_0x5aaefc,_0x2ef790[_0xfeb0('0x4e')],'id');for(var _0x5e5756=0x0,_0x5e0592={},_0x14f19e={};_0x5e5756<_0x5aaefc[_0xfeb0('0x42')];_0x5e5756+=0x1){_0x5e0592=_0x5aaefc[_0x5e5756];if(_[_0xfeb0('0x43')](_0x2ef790[_0xfeb0('0x4e')][_0x5e0592['id']])){_0x2ef790['servicenowAccounts'][_0x5e0592['id']]=new ServicenowAccount(_0x5e0592);}else{_0x2ef790[_0xfeb0('0x3f')](_0x2ef790[_0xfeb0('0x4e')][_0x5e0592['id']],_0x5e0592);}}}return _0x2ef790['servicenowAccounts'];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x4f')]=function(){var _0x29ee73=this;return function(_0x3ab187){if(_0x3ab187){freeIsNotKey(_0x3ab187,_0x29ee73[_0xfeb0('0x22')],'id');for(var _0x474556=0x0,_0x12d06e={},_0x5ac8e1={};_0x474556<_0x3ab187[_0xfeb0('0x42')];_0x474556+=0x1){_0x12d06e=_0x3ab187[_0x474556];if(_[_0xfeb0('0x43')](_0x29ee73[_0xfeb0('0x22')][_0x12d06e['id']])){_0x29ee73[_0xfeb0('0x22')][_0x12d06e['id']]=new Dynamics365Account(_0x12d06e);}else{_0x29ee73[_0xfeb0('0x3f')](_0x29ee73['dynamics365Accounts'][_0x12d06e['id']],_0x12d06e);}}}return _0x29ee73[_0xfeb0('0x22')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x50')]=function(){var _0x3ab640=this;return function(_0xfb22ad){if(_0xfb22ad){freeIsNotKey(_0xfb22ad,_0x3ab640[_0xfeb0('0x23')],'id');for(var _0x2065cd=0x0,_0x14ef45={},_0x442b84={};_0x2065cd<_0xfb22ad[_0xfeb0('0x42')];_0x2065cd+=0x1){_0x14ef45=_0xfb22ad[_0x2065cd];if(_[_0xfeb0('0x43')](_0x3ab640[_0xfeb0('0x23')][_0x14ef45['id']])){_0x3ab640[_0xfeb0('0x23')][_0x14ef45['id']]=new FreshsalesAccount(_0x14ef45);}else{_0x3ab640[_0xfeb0('0x3f')](_0x3ab640[_0xfeb0('0x23')][_0x14ef45['id']],_0x14ef45);}}}return _0x3ab640[_0xfeb0('0x23')];};};Realtime['prototype'][_0xfeb0('0x51')]=function(){var _0x2b7937=this;return function(_0x35eed5){for(var _0x3199a9=0x0;_0x3199a9<_0x35eed5[_0xfeb0('0x42')];_0x3199a9+=0x1){_[_0xfeb0('0x52')](_0x2b7937[_0xfeb0('0x13')][_0x35eed5[_0x3199a9][_0xfeb0('0x29')]],_0x35eed5[_0x3199a9]);}return _0x2b7937[_0xfeb0('0x13')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x53')]=function(){var _0x503f8e=this;return function(_0x155630){clearVoiceQueues(_0x503f8e['voiceQueues']);if(_0x155630){_0x155630=_['groupBy'](_0x155630,'uniqueid');for(var _0x3bf7d3 in _0x155630){if(_0x155630['hasOwnProperty'](_0x3bf7d3)){var _0x4ce381={};for(var _0x2be88f=0x0;_0x2be88f<_0x155630[_0x3bf7d3][_0xfeb0('0x42')];_0x2be88f+=0x1){var _0x4cfe88=_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x54')];if(_0x503f8e['voiceQueues'][_0x4cfe88]){if(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x55')]){_0x503f8e[_0xfeb0('0x13')][_0x4cfe88][_0xfeb0('0x33')]+=0x1;}if(_0x155630[_0x3bf7d3][_0x2be88f]['queuecallerabandon']){_0x503f8e[_0xfeb0('0x13')][_0x4cfe88][_0xfeb0('0x34')]+=0x1;}_0x503f8e[_0xfeb0('0x13')][_0x4cfe88]['sumHoldTime']+=moment(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x56')])[_0xfeb0('0x57')](moment(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x58')]),_0xfeb0('0x59'))||0x0;if(_0x2be88f===_0x155630[_0x3bf7d3][_0xfeb0('0x42')]-0x1){_0x503f8e['voiceQueues'][_0x4cfe88]['sumDuration']+=moment(_0x155630[_0x3bf7d3][_0x2be88f]['queuecallercompleteAt']||_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x5a')]||_0x155630[_0x3bf7d3][_0x2be88f]['queuecallerexitAt'])[_0xfeb0('0x57')](moment(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x58')]),_0xfeb0('0x59'))||0x0;_0x503f8e['voiceQueues'][_0x4cfe88]['total']+=0x1;if(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x5b')]){_0x503f8e[_0xfeb0('0x13')][_0x4cfe88][_0xfeb0('0x2c')]+=0x1;_0x503f8e[_0xfeb0('0x13')][_0x4cfe88]['sumBillable']+=moment(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x5c')])['diff'](moment(_0x155630[_0x3bf7d3][_0x2be88f][_0xfeb0('0x56')]),_0xfeb0('0x59'))||0x0;}}else{_0x503f8e[_0xfeb0('0x13')][_0x4cfe88]['sumDuration']+=_0x503f8e[_0xfeb0('0x13')][_0x4cfe88]['sumHoldTime']||0x0;}}}}}}return _0x503f8e[_0xfeb0('0x13')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x5d')]=function(){var _0x41d150=this;return function(_0x24b5f7){clearVoiceCallReports(_0x41d150[_0xfeb0('0x15')]);if(_0x24b5f7){for(var _0x32706a=0x0;_0x32706a<_0x24b5f7[_0xfeb0('0x42')];_0x32706a+=0x1){_0x41d150[_0xfeb0('0x15')][_0xfeb0('0x32')]+=0x1;_0x41d150[_0xfeb0('0x15')][_0xfeb0('0x2e')]+=_0x24b5f7[_0x32706a][_0xfeb0('0x5e')];if(_0x24b5f7[_0x32706a][_0xfeb0('0x5f')]===_0xfeb0('0x60')){_0x41d150[_0xfeb0('0x15')]['answered']+=0x1;_0x41d150[_0xfeb0('0x15')][_0xfeb0('0x2d')]+=_0x24b5f7[_0x32706a]['duration']-_0x24b5f7[_0x32706a][_0xfeb0('0x61')]||0x0;_0x41d150[_0xfeb0('0x15')]['sumBillable']+=_0x24b5f7[_0x32706a][_0xfeb0('0x61')];}}}return _0x41d150[_0xfeb0('0x15')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x62')]=function(){var _0x330195=this;return function(_0xee014b){if(_0xee014b){freeIsNotKey(_0xee014b,_0x330195['campaigns'],_0xfeb0('0x29'));for(var _0x3326b7=0x0,_0x68e26c={};_0x3326b7<_0xee014b[_0xfeb0('0x42')];_0x3326b7+=0x1){_0x68e26c=_0xee014b[_0x3326b7];if(_[_0xfeb0('0x43')](_0x330195['campaigns'][_0x68e26c[_0xfeb0('0x29')]])){_0x330195[_0xfeb0('0x63')][_0x68e26c[_0xfeb0('0x29')]]=new Campaign(_0x68e26c);}else{_0x330195[_0xfeb0('0x3f')](_0x330195[_0xfeb0('0x63')][_0x68e26c[_0xfeb0('0x29')]],_0x68e26c);_0x330195[_0xfeb0('0x63')][_0x68e26c[_0xfeb0('0x29')]][_0xfeb0('0x64')]=_0x68e26c[_0xfeb0('0x65')]?_0x68e26c[_0xfeb0('0x65')]['name']:undefined;}}}return _0x330195[_0xfeb0('0x63')];};};Realtime['prototype'][_0xfeb0('0x66')]=function(){var _0x5e33cb=this;return function(_0x2b7677){if(_0x2b7677){freeIsNotKey(_0x2b7677,_0x5e33cb[_0xfeb0('0x16')],'id');for(var _0x23e6a6=0x0,_0x44cfea={};_0x23e6a6<_0x2b7677['length'];_0x23e6a6+=0x1){_0x44cfea=_0x2b7677[_0x23e6a6];if(_[_0xfeb0('0x43')](_0x5e33cb['voiceExtensions'][_0x44cfea['id']])){_0x5e33cb[_0xfeb0('0x16')][_0x44cfea['id']]=new VoiceExtension(_0x44cfea);}else{_0x5e33cb[_0xfeb0('0x3f')](_0x5e33cb[_0xfeb0('0x16')][_0x44cfea['id']],_0x44cfea);}}}return _0x5e33cb[_0xfeb0('0x16')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x67')]=function(){var _0x58846e=this;return function(_0x2c328c){clearCampaigns(_0x58846e[_0xfeb0('0x63')]);for(var _0x50f4f9=0x0;_0x50f4f9<_0x2c328c[_0xfeb0('0x42')];_0x50f4f9+=0x1){_[_0xfeb0('0x52')](_0x58846e[_0xfeb0('0x63')][_0x2c328c[_0x50f4f9]['name']],_0x2c328c[_0x50f4f9]);}return _0x58846e[_0xfeb0('0x63')];};};Realtime[_0xfeb0('0x40')][_0xfeb0('0x68')]=function(){var _0x567538=this;return function(_0x51a847){if(_0x51a847){freeIsNotKey(_0x51a847,_0x567538[_0xfeb0('0x24')],'id');for(var _0x20e1fb=0x0,_0x1329a5={},_0x482edd={};_0x20e1fb<_0x51a847[_0xfeb0('0x42')];_0x20e1fb+=0x1){_0x1329a5=_0x51a847[_0x20e1fb];if(_[_0xfeb0('0x43')](_0x567538['faxAccounts'][_0x1329a5['id']])){_0x567538[_0xfeb0('0x24')][_0x1329a5['id']]=new FaxAccount(_0x1329a5);}else{_0x567538['mergeFromDatabase'](_0x567538['faxAccounts'][_0x1329a5['id']],_0x1329a5);}}}return _0x567538[_0xfeb0('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0xd9f4=['disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','initFaxAccounts','exports','util','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/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','total','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','trunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','sumBillable','queuecallerleaveAt','initVoiceCallReports','duration'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd9f4,0x7b));var _0x4d9f=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xd9f4[_0x292f93];return _0x5a94b1;};'use strict';var util=require(_0x4d9f('0x0'));var _=require(_0x4d9f('0x1'));var moment=require(_0x4d9f('0x2'));var Agent=require(_0x4d9f('0x3'));var Telephone=require(_0x4d9f('0x4'));var Trunk=require(_0x4d9f('0x5'));var VoiceQueue=require(_0x4d9f('0x6'));var Trigger=require(_0x4d9f('0x7'));var Template=require(_0x4d9f('0x8'));var Campaign=require(_0x4d9f('0x9'));var VoiceExtension=require(_0x4d9f('0xa'));var ZendeskAccount=require(_0x4d9f('0xb'));var SalesforceAccount=require(_0x4d9f('0xc'));var FreshdeskAccount=require(_0x4d9f('0xd'));var SugarcrmAccount=require(_0x4d9f('0xe'));var ZohoAccount=require(_0x4d9f('0xf'));var DeskAccount=require(_0x4d9f('0x10'));var VtigerAccount=require(_0x4d9f('0x11'));var ServicenowAccount=require(_0x4d9f('0x12'));var Dynamics365Account=require(_0x4d9f('0x13'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x4d9f('0x14'));var Realtime=function(){this[_0x4d9f('0x15')]={};this[_0x4d9f('0x16')]={};this['trunks']={};this[_0x4d9f('0x17')]={};this['triggers']={};this[_0x4d9f('0x18')]={};this[_0x4d9f('0x19')]={};this[_0x4d9f('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4d9f('0x1b')]={};this['channels']={};this[_0x4d9f('0x1c')]={};this[_0x4d9f('0x1d')]={};this[_0x4d9f('0x1e')]={};this[_0x4d9f('0x1f')]={};this[_0x4d9f('0x20')]={};this[_0x4d9f('0x21')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x4d9f('0x22')]={};this[_0x4d9f('0x23')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x4d9f('0x24')]={};this[_0x4d9f('0x25')]={};this[_0x4d9f('0x26')]={};};function freeIsNotKey(_0x340f01,_0x8d2523,_0xa7ef26){var _0x2781e0=_[_0x4d9f('0x27')](_0x340f01,function(_0x56c2d2,_0x1136e0){return _0x56c2d2[_0xa7ef26];});for(var _0x443fd3 in _0x8d2523){if(_0x8d2523[_0x4d9f('0x28')](_0x443fd3)){if(!_0x2781e0[_0x443fd3]){delete _0x8d2523[_0x443fd3];}}}}function freeIsNotKeySip(_0x308a87,_0x39b749){var _0x297b30=_[_0x4d9f('0x27')](_0x308a87,function(_0x13762d,_0x59ae9e){return util[_0x4d9f('0x29')](_0x4d9f('0x2a'),_0x13762d[_0x4d9f('0x2b')]);});for(var _0x2af0ab in _0x39b749){if(_0x39b749[_0x4d9f('0x28')](_0x2af0ab)){if(!_0x297b30[_0x2af0ab]){delete _0x39b749[_0x2af0ab];}}}}function freeIsNotKeyAgent(_0x2e1826,_0x36d954){var _0x45150b=_[_0x4d9f('0x27')](_0x2e1826,function(_0x1bb919,_0x311876){var _0x103777=_[_0x4d9f('0x2c')](_0x1bb919[_0x4d9f('0x2d')])?util[_0x4d9f('0x29')](_0x4d9f('0x2a'),_0x1bb919[_0x4d9f('0x2b')]):_0x1bb919[_0x4d9f('0x2d')];return _0x103777;});for(var _0x253fdf in _0x36d954){if(_0x36d954['hasOwnProperty'](_0x253fdf)){if(!_0x45150b[_0x253fdf]){delete _0x36d954[_0x253fdf];}}}}function clearVoiceCallReports(_0x17f3e8){_0x17f3e8['total']=0x0;_0x17f3e8[_0x4d9f('0x2e')]=0x0;_0x17f3e8[_0x4d9f('0x2f')]=0x0;_0x17f3e8[_0x4d9f('0x30')]=0x0;_0x17f3e8['sumBillable']=0x0;}function clearCampaigns(_0x128a07){if(!_['isEmpty'](_0x128a07)){for(var _0x40cc7c in _0x128a07){if(_0x128a07[_0x4d9f('0x28')](_0x40cc7c)){_0x128a07[_0x40cc7c][_0x4d9f('0x31')]=0x0;_0x128a07[_0x40cc7c][_0x4d9f('0x32')]=0x0;}}}}function clearVoiceQueues(_0x109766){if(!_[_0x4d9f('0x33')](_0x109766)){for(var _0x4be6b9 in _0x109766){if(_0x109766['hasOwnProperty'](_0x4be6b9)){_0x109766[_0x4be6b9][_0x4d9f('0x34')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x2e')]=0x0;_0x109766[_0x4be6b9]['unmanaged']=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x35')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x2f')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x30')]=0x0;_0x109766[_0x4be6b9]['sumBillable']=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x36')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x37')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x38')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x39')]=0x0;_0x109766[_0x4be6b9]['outboundNoSuchCallsDay']=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3a')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3b')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3c')]=0x0;_0x109766[_0x4be6b9]['outboundBlacklistCallsDay']=0x0;_0x109766[_0x4be6b9]['outboundOriginateFailureCallsDay']=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3d')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3e')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x36')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x3f')]=0x0;_0x109766[_0x4be6b9][_0x4d9f('0x40')]=!![];}}}}Realtime[_0x4d9f('0x41')][_0x4d9f('0x42')]=function(_0x36f2c9,_0x4f5f66){for(var _0x2e2379 in _0x4f5f66){if(_0x36f2c9[_0x4d9f('0x28')](_0x2e2379)){_0x36f2c9[_0x2e2379]=_0x4f5f66[_0x2e2379];}}};Realtime[_0x4d9f('0x41')][_0x4d9f('0x43')]=function(){var _0x31d71b=this;return function(_0x527d25){if(_0x527d25){freeIsNotKeyAgent(_0x527d25,_0x31d71b[_0x4d9f('0x15')]);for(var _0x5168a4=0x0,_0x4e6eb4={},_0x23f96d={};_0x5168a4<_0x527d25[_0x4d9f('0x44')];_0x5168a4+=0x1){_0x4e6eb4=_0x527d25[_0x5168a4];var _0x513bab=_[_0x4d9f('0x2c')](_0x4e6eb4[_0x4d9f('0x2d')])?util[_0x4d9f('0x29')](_0x4d9f('0x2a'),_0x4e6eb4[_0x4d9f('0x2b')]):_0x4e6eb4['interface'];if(_[_0x4d9f('0x45')](_0x31d71b['agents'][_0x513bab])){_0x31d71b[_0x4d9f('0x15')][_0x513bab]=new Agent(_0x4e6eb4);}else{_0x31d71b['mergeFromDatabase'](_0x31d71b['agents'][_0x513bab],_0x4e6eb4);}}}return _0x31d71b[_0x4d9f('0x15')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x46')]=function(){var _0xb5ffc2=this;return function(_0x216ad4){if(_0x216ad4){freeIsNotKeySip(_0x216ad4,_0xb5ffc2[_0x4d9f('0x16')]);for(var _0x26a961=0x0,_0x4f3e3a={},_0x531a08={};_0x26a961<_0x216ad4[_0x4d9f('0x44')];_0x26a961+=0x1){_0x4f3e3a=_0x216ad4[_0x26a961];if(_[_0x4d9f('0x45')](_0xb5ffc2[_0x4d9f('0x16')][util['format'](_0x4d9f('0x2a'),_0x4f3e3a[_0x4d9f('0x2b')])])){_0xb5ffc2[_0x4d9f('0x16')][util['format'](_0x4d9f('0x2a'),_0x4f3e3a['name'])]=new Telephone(_0x4f3e3a);}else{_0xb5ffc2[_0x4d9f('0x42')](_0xb5ffc2['telephones'][util[_0x4d9f('0x29')]('SIP/%s',_0x4f3e3a[_0x4d9f('0x2b')])],_0x4f3e3a);}}}return _0xb5ffc2['telephones'];};};Realtime[_0x4d9f('0x41')]['initTrunks']=function(){var _0x1f58d6=this;return function(_0xfa59ee){if(_0xfa59ee){freeIsNotKeySip(_0xfa59ee,_0x1f58d6[_0x4d9f('0x47')]);for(var _0x4853fe=0x0,_0x48b62a={},_0x3fdaa1={};_0x4853fe<_0xfa59ee[_0x4d9f('0x44')];_0x4853fe+=0x1){_0x48b62a=_0xfa59ee[_0x4853fe];if(_[_0x4d9f('0x45')](_0x1f58d6[_0x4d9f('0x47')][util['format'](_0x4d9f('0x2a'),_0x48b62a[_0x4d9f('0x2b')])])){_0x1f58d6['trunks'][util[_0x4d9f('0x29')](_0x4d9f('0x2a'),_0x48b62a[_0x4d9f('0x2b')])]=new Trunk(_0x48b62a);}else{_0x1f58d6[_0x4d9f('0x42')](_0x1f58d6[_0x4d9f('0x47')][util[_0x4d9f('0x29')](_0x4d9f('0x2a'),_0x48b62a[_0x4d9f('0x2b')])],_0x48b62a);}}}return _0x1f58d6['trunks'];};};Realtime['prototype'][_0x4d9f('0x48')]=function(){var _0x3727fa=this;return function(_0x4902cf){if(_0x4902cf){freeIsNotKey(_0x4902cf,_0x3727fa[_0x4d9f('0x17')],_0x4d9f('0x2b'));for(var _0x5ef12e=0x0,_0x961794={},_0x1d6f7a={};_0x5ef12e<_0x4902cf[_0x4d9f('0x44')];_0x5ef12e+=0x1){_0x961794=_0x4902cf[_0x5ef12e];if(_['isUndefined'](_0x3727fa['voiceQueues'][_0x961794[_0x4d9f('0x2b')]])){_0x3727fa[_0x4d9f('0x17')][_0x961794['name']]=new VoiceQueue(_0x961794);}else{_0x3727fa[_0x4d9f('0x42')](_0x3727fa['voiceQueues'][_0x961794[_0x4d9f('0x2b')]],_0x961794);}}}return _0x3727fa[_0x4d9f('0x17')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x49')]=function(){var _0x40c6b2=this;return function(_0xd9b82){if(_0xd9b82){freeIsNotKey(_0xd9b82,_0x40c6b2['triggers'],'id');for(var _0x1017cc=0x0,_0xd1de37={},_0x3cfaa5={};_0x1017cc<_0xd9b82['length'];_0x1017cc+=0x1){_0xd1de37=_0xd9b82[_0x1017cc];if(_[_0x4d9f('0x45')](_0x40c6b2[_0x4d9f('0x4a')][_0xd1de37['id']])){_0x40c6b2['triggers'][_0xd1de37['id']]=new Trigger(_0xd1de37);}else{_0x40c6b2[_0x4d9f('0x42')](_0x40c6b2[_0x4d9f('0x4a')][_0xd1de37['id']],_0xd1de37);}}}return _0x40c6b2[_0x4d9f('0x4a')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x4b')]=function(){var _0x1df8dc=this;return function(_0x35b401){if(_0x35b401){freeIsNotKey(_0x35b401,_0x1df8dc[_0x4d9f('0x19')],'id');for(var _0x442cf9=0x0,_0x3b8a8c={},_0x57ab71={};_0x442cf9<_0x35b401['length'];_0x442cf9+=0x1){_0x3b8a8c=_0x35b401[_0x442cf9];if(_[_0x4d9f('0x45')](_0x1df8dc[_0x4d9f('0x19')][_0x3b8a8c['id']])){_0x1df8dc['templates'][_0x3b8a8c['id']]=new Template(_0x3b8a8c);}else{_0x1df8dc[_0x4d9f('0x42')](_0x1df8dc[_0x4d9f('0x19')][_0x3b8a8c['id']],_0x3b8a8c);}}}return _0x1df8dc[_0x4d9f('0x19')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x4c')]=function(){var _0x229d0a=this;return function(_0x318bca){if(_0x318bca){freeIsNotKey(_0x318bca,_0x229d0a[_0x4d9f('0x20')],'id');for(var _0x154601=0x0,_0x307ca7={},_0x25e8c9={};_0x154601<_0x318bca[_0x4d9f('0x44')];_0x154601+=0x1){_0x307ca7=_0x318bca[_0x154601];if(_[_0x4d9f('0x45')](_0x229d0a['zendeskAccounts'][_0x307ca7['id']])){_0x229d0a[_0x4d9f('0x20')][_0x307ca7['id']]=new ZendeskAccount(_0x307ca7);}else{_0x229d0a[_0x4d9f('0x42')](_0x229d0a[_0x4d9f('0x20')][_0x307ca7['id']],_0x307ca7);}}}return _0x229d0a[_0x4d9f('0x20')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x4d')]=function(){var _0x519a99=this;return function(_0xd5c6dc){if(_0xd5c6dc){freeIsNotKey(_0xd5c6dc,_0x519a99[_0x4d9f('0x21')],'id');for(var _0x541508=0x0,_0x145c3d={},_0x3d2c80={};_0x541508<_0xd5c6dc[_0x4d9f('0x44')];_0x541508+=0x1){_0x145c3d=_0xd5c6dc[_0x541508];if(_[_0x4d9f('0x45')](_0x519a99[_0x4d9f('0x21')][_0x145c3d['id']])){_0x519a99[_0x4d9f('0x21')][_0x145c3d['id']]=new SalesforceAccount(_0x145c3d);}else{_0x519a99[_0x4d9f('0x42')](_0x519a99[_0x4d9f('0x21')][_0x145c3d['id']],_0x145c3d);}}}return _0x519a99['salesforceAccounts'];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x4e')]=function(){var _0x2bc523=this;return function(_0x26bf32){if(_0x26bf32){freeIsNotKey(_0x26bf32,_0x2bc523[_0x4d9f('0x4f')],'id');for(var _0x47b318=0x0,_0x5f2548={},_0x456edc={};_0x47b318<_0x26bf32[_0x4d9f('0x44')];_0x47b318+=0x1){_0x5f2548=_0x26bf32[_0x47b318];if(_[_0x4d9f('0x45')](_0x2bc523[_0x4d9f('0x4f')][_0x5f2548['id']])){_0x2bc523[_0x4d9f('0x4f')][_0x5f2548['id']]=new FreshdeskAccount(_0x5f2548);}else{_0x2bc523['mergeFromDatabase'](_0x2bc523[_0x4d9f('0x4f')][_0x5f2548['id']],_0x5f2548);}}}return _0x2bc523[_0x4d9f('0x4f')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x50')]=function(){var _0x3f678c=this;return function(_0x3262cb){if(_0x3262cb){freeIsNotKey(_0x3262cb,_0x3f678c[_0x4d9f('0x22')],'id');for(var _0x498262=0x0,_0x3f9878={},_0x1b4c95={};_0x498262<_0x3262cb[_0x4d9f('0x44')];_0x498262+=0x1){_0x3f9878=_0x3262cb[_0x498262];if(_[_0x4d9f('0x45')](_0x3f678c[_0x4d9f('0x22')][_0x3f9878['id']])){_0x3f678c[_0x4d9f('0x22')][_0x3f9878['id']]=new ZohoAccount(_0x3f9878);}else{_0x3f678c['mergeFromDatabase'](_0x3f678c[_0x4d9f('0x22')][_0x3f9878['id']],_0x3f9878);}}}return _0x3f678c['zohoAccounts'];};};Realtime[_0x4d9f('0x41')]['initDeskAccounts']=function(){var _0x48f679=this;return function(_0x556beb){if(_0x556beb){freeIsNotKey(_0x556beb,_0x48f679[_0x4d9f('0x23')],'id');for(var _0x26cf2c=0x0,_0x21a8c9={},_0x4e4b06={};_0x26cf2c<_0x556beb['length'];_0x26cf2c+=0x1){_0x21a8c9=_0x556beb[_0x26cf2c];if(_['isUndefined'](_0x48f679['deskAccounts'][_0x21a8c9['id']])){_0x48f679[_0x4d9f('0x23')][_0x21a8c9['id']]=new DeskAccount(_0x21a8c9);}else{_0x48f679[_0x4d9f('0x42')](_0x48f679[_0x4d9f('0x23')][_0x21a8c9['id']],_0x21a8c9);}}}return _0x48f679['deskAccounts'];};};Realtime['prototype'][_0x4d9f('0x51')]=function(){var _0x424c2e=this;return function(_0x4478fe){if(_0x4478fe){freeIsNotKey(_0x4478fe,_0x424c2e['sugarcrmAccounts'],'id');for(var _0x1ee526=0x0,_0x56e02f={},_0x1f858b={};_0x1ee526<_0x4478fe['length'];_0x1ee526+=0x1){_0x56e02f=_0x4478fe[_0x1ee526];if(_[_0x4d9f('0x45')](_0x424c2e[_0x4d9f('0x52')][_0x56e02f['id']])){_0x424c2e[_0x4d9f('0x52')][_0x56e02f['id']]=new SugarcrmAccount(_0x56e02f);}else{_0x424c2e[_0x4d9f('0x42')](_0x424c2e[_0x4d9f('0x52')][_0x56e02f['id']],_0x56e02f);}}}return _0x424c2e[_0x4d9f('0x52')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x53')]=function(){var _0x17d98f=this;return function(_0x2cc4bf){if(_0x2cc4bf){freeIsNotKey(_0x2cc4bf,_0x17d98f['vtigerAccounts'],'id');for(var _0x51352d=0x0,_0x38961f={},_0x27a9f0={};_0x51352d<_0x2cc4bf[_0x4d9f('0x44')];_0x51352d+=0x1){_0x38961f=_0x2cc4bf[_0x51352d];if(_[_0x4d9f('0x45')](_0x17d98f[_0x4d9f('0x54')][_0x38961f['id']])){_0x17d98f[_0x4d9f('0x54')][_0x38961f['id']]=new VtigerAccount(_0x38961f);}else{_0x17d98f[_0x4d9f('0x42')](_0x17d98f[_0x4d9f('0x54')][_0x38961f['id']],_0x38961f);}}}return _0x17d98f[_0x4d9f('0x54')];};};Realtime[_0x4d9f('0x41')]['initServicenowAccounts']=function(){var _0x478c40=this;return function(_0x4924af){if(_0x4924af){freeIsNotKey(_0x4924af,_0x478c40[_0x4d9f('0x55')],'id');for(var _0x5dd53d=0x0,_0x4d53c4={},_0x4c80c1={};_0x5dd53d<_0x4924af[_0x4d9f('0x44')];_0x5dd53d+=0x1){_0x4d53c4=_0x4924af[_0x5dd53d];if(_[_0x4d9f('0x45')](_0x478c40[_0x4d9f('0x55')][_0x4d53c4['id']])){_0x478c40[_0x4d9f('0x55')][_0x4d53c4['id']]=new ServicenowAccount(_0x4d53c4);}else{_0x478c40['mergeFromDatabase'](_0x478c40[_0x4d9f('0x55')][_0x4d53c4['id']],_0x4d53c4);}}}return _0x478c40['servicenowAccounts'];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x56')]=function(){var _0x336a42=this;return function(_0x7d0a7d){if(_0x7d0a7d){freeIsNotKey(_0x7d0a7d,_0x336a42['dynamics365Accounts'],'id');for(var _0x3bb86f=0x0,_0x44d18f={},_0x306960={};_0x3bb86f<_0x7d0a7d[_0x4d9f('0x44')];_0x3bb86f+=0x1){_0x44d18f=_0x7d0a7d[_0x3bb86f];if(_['isUndefined'](_0x336a42[_0x4d9f('0x24')][_0x44d18f['id']])){_0x336a42[_0x4d9f('0x24')][_0x44d18f['id']]=new Dynamics365Account(_0x44d18f);}else{_0x336a42[_0x4d9f('0x42')](_0x336a42[_0x4d9f('0x24')][_0x44d18f['id']],_0x44d18f);}}}return _0x336a42[_0x4d9f('0x24')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x57')]=function(){var _0xac796a=this;return function(_0x4cdba7){if(_0x4cdba7){freeIsNotKey(_0x4cdba7,_0xac796a['freshsalesAccounts'],'id');for(var _0x18ec3a=0x0,_0x283e0b={},_0xf8d34c={};_0x18ec3a<_0x4cdba7[_0x4d9f('0x44')];_0x18ec3a+=0x1){_0x283e0b=_0x4cdba7[_0x18ec3a];if(_[_0x4d9f('0x45')](_0xac796a['freshsalesAccounts'][_0x283e0b['id']])){_0xac796a[_0x4d9f('0x25')][_0x283e0b['id']]=new FreshsalesAccount(_0x283e0b);}else{_0xac796a[_0x4d9f('0x42')](_0xac796a['freshsalesAccounts'][_0x283e0b['id']],_0x283e0b);}}}return _0xac796a[_0x4d9f('0x25')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x58')]=function(){var _0x545fd6=this;return function(_0x384187){for(var _0x1d81ad=0x0;_0x1d81ad<_0x384187[_0x4d9f('0x44')];_0x1d81ad+=0x1){_[_0x4d9f('0x59')](_0x545fd6['voiceQueues'][_0x384187[_0x1d81ad]['name']],_0x384187[_0x1d81ad]);}return _0x545fd6[_0x4d9f('0x17')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x5a')]=function(){var _0x24b38b=this;return function(_0x275248){clearVoiceQueues(_0x24b38b['voiceQueues']);if(_0x275248){_0x275248=_[_0x4d9f('0x5b')](_0x275248,_0x4d9f('0x5c'));for(var _0x15a450 in _0x275248){if(_0x275248['hasOwnProperty'](_0x15a450)){var _0x14f1e2={};for(var _0x385314=0x0;_0x385314<_0x275248[_0x15a450]['length'];_0x385314+=0x1){var _0x4c4930=_0x275248[_0x15a450][_0x385314][_0x4d9f('0x5d')];if(_0x24b38b[_0x4d9f('0x17')][_0x4c4930]){if(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x5e')]){_0x24b38b[_0x4d9f('0x17')][_0x4c4930][_0x4d9f('0x5f')]+=0x1;}if(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x60')]){_0x24b38b[_0x4d9f('0x17')][_0x4c4930][_0x4d9f('0x35')]+=0x1;}_0x24b38b[_0x4d9f('0x17')][_0x4c4930][_0x4d9f('0x2f')]+=moment(_0x275248[_0x15a450][_0x385314]['queuecallerleaveAt'])[_0x4d9f('0x61')](moment(_0x275248[_0x15a450][_0x385314]['queuecallerjoinAt']),_0x4d9f('0x62'))||0x0;if(_0x385314===_0x275248[_0x15a450][_0x4d9f('0x44')]-0x1){_0x24b38b['voiceQueues'][_0x4c4930][_0x4d9f('0x30')]+=moment(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x63')]||_0x275248[_0x15a450][_0x385314][_0x4d9f('0x64')]||_0x275248[_0x15a450][_0x385314][_0x4d9f('0x65')])[_0x4d9f('0x61')](moment(_0x275248[_0x15a450][_0x385314]['queuecallerjoinAt']),_0x4d9f('0x62'))||0x0;_0x24b38b['voiceQueues'][_0x4c4930]['total']+=0x1;if(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x66')]){_0x24b38b[_0x4d9f('0x17')][_0x4c4930]['answered']+=0x1;_0x24b38b[_0x4d9f('0x17')][_0x4c4930][_0x4d9f('0x67')]+=moment(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x63')])[_0x4d9f('0x61')](moment(_0x275248[_0x15a450][_0x385314][_0x4d9f('0x68')]),_0x4d9f('0x62'))||0x0;}}else{_0x24b38b[_0x4d9f('0x17')][_0x4c4930][_0x4d9f('0x30')]+=_0x24b38b[_0x4d9f('0x17')][_0x4c4930]['sumHoldTime']||0x0;}}}}}}return _0x24b38b[_0x4d9f('0x17')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x69')]=function(){var _0x13bd94=this;return function(_0x10eb7c){clearVoiceCallReports(_0x13bd94[_0x4d9f('0x1a')]);if(_0x10eb7c){for(var _0x52b648=0x0;_0x52b648<_0x10eb7c[_0x4d9f('0x44')];_0x52b648+=0x1){_0x13bd94[_0x4d9f('0x1a')][_0x4d9f('0x34')]+=0x1;_0x13bd94[_0x4d9f('0x1a')][_0x4d9f('0x30')]+=_0x10eb7c[_0x52b648][_0x4d9f('0x6a')];if(_0x10eb7c[_0x52b648][_0x4d9f('0x6b')]===_0x4d9f('0x6c')){_0x13bd94[_0x4d9f('0x1a')]['answered']+=0x1;_0x13bd94[_0x4d9f('0x1a')][_0x4d9f('0x2f')]+=_0x10eb7c[_0x52b648]['duration']-_0x10eb7c[_0x52b648]['billableseconds']||0x0;_0x13bd94[_0x4d9f('0x1a')]['sumBillable']+=_0x10eb7c[_0x52b648][_0x4d9f('0x6d')];}}}return _0x13bd94[_0x4d9f('0x1a')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x6e')]=function(){var _0xe62ff6=this;return function(_0x1f3399){if(_0x1f3399){freeIsNotKey(_0x1f3399,_0xe62ff6[_0x4d9f('0x18')],_0x4d9f('0x2b'));for(var _0x3beac9=0x0,_0x514782={};_0x3beac9<_0x1f3399[_0x4d9f('0x44')];_0x3beac9+=0x1){_0x514782=_0x1f3399[_0x3beac9];if(_[_0x4d9f('0x45')](_0xe62ff6[_0x4d9f('0x18')][_0x514782['name']])){_0xe62ff6[_0x4d9f('0x18')][_0x514782[_0x4d9f('0x2b')]]=new Campaign(_0x514782);}else{_0xe62ff6[_0x4d9f('0x42')](_0xe62ff6['campaigns'][_0x514782['name']],_0x514782);_0xe62ff6[_0x4d9f('0x18')][_0x514782[_0x4d9f('0x2b')]][_0x4d9f('0x6f')]=_0x514782['SquareProject']?_0x514782['SquareProject']['name']:undefined;}}}return _0xe62ff6[_0x4d9f('0x18')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x70')]=function(){var _0xba6f81=this;return function(_0x13f640){if(_0x13f640){freeIsNotKey(_0x13f640,_0xba6f81[_0x4d9f('0x1b')],'id');for(var _0x5c4135=0x0,_0xe56464={};_0x5c4135<_0x13f640['length'];_0x5c4135+=0x1){_0xe56464=_0x13f640[_0x5c4135];if(_['isUndefined'](_0xba6f81['voiceExtensions'][_0xe56464['id']])){_0xba6f81[_0x4d9f('0x1b')][_0xe56464['id']]=new VoiceExtension(_0xe56464);}else{_0xba6f81[_0x4d9f('0x42')](_0xba6f81[_0x4d9f('0x1b')][_0xe56464['id']],_0xe56464);}}}return _0xba6f81[_0x4d9f('0x1b')];};};Realtime[_0x4d9f('0x41')]['initCampaignHopperHistory']=function(){var _0x32c493=this;return function(_0x27a6ee){clearCampaigns(_0x32c493[_0x4d9f('0x18')]);for(var _0x5c4591=0x0;_0x5c4591<_0x27a6ee['length'];_0x5c4591+=0x1){_[_0x4d9f('0x59')](_0x32c493[_0x4d9f('0x18')][_0x27a6ee[_0x5c4591]['name']],_0x27a6ee[_0x5c4591]);}return _0x32c493[_0x4d9f('0x18')];};};Realtime[_0x4d9f('0x41')][_0x4d9f('0x71')]=function(){var _0x3d27a4=this;return function(_0x1adc9b){if(_0x1adc9b){freeIsNotKey(_0x1adc9b,_0x3d27a4['faxAccounts'],'id');for(var _0x4328a4=0x0,_0x229afe={},_0xfd73da={};_0x4328a4<_0x1adc9b[_0x4d9f('0x44')];_0x4328a4+=0x1){_0x229afe=_0x1adc9b[_0x4328a4];if(_[_0x4d9f('0x45')](_0x3d27a4[_0x4d9f('0x26')][_0x229afe['id']])){_0x3d27a4[_0x4d9f('0x26')][_0x229afe['id']]=new FaxAccount(_0x229afe);}else{_0x3d27a4[_0x4d9f('0x42')](_0x3d27a4[_0x4d9f('0x26')][_0x229afe['id']],_0x229afe);}}}return _0x3d27a4['faxAccounts'];};};module[_0x4d9f('0x72')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 3aa0738..83e97f7 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 _0x54ee=['membername','monitors','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','isNil','accountcode','name','find','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','getCallType','channel','calleridnum','internal','destination','exten','type','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfereelinkedid','uniqueid','transfers','UserId','split'];(function(_0x387ed5,_0x44e590){var _0x20a79e=function(_0x54f5e5){while(--_0x54f5e5){_0x387ed5['push'](_0x387ed5['shift']());}};_0x20a79e(++_0x44e590);}(_0x54ee,0x17c));var _0xe54e=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x54ee[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xe54e('0x0'));var moment=require('moment');var util=require(_0xe54e('0x1'));var config=require('../../../config/environment');var ami=require(_0xe54e('0x2'));var RpcVoiceAgentReport=require(_0xe54e('0x3'));var RpcVoiceCallReport=require(_0xe54e('0x4'));var RpcVoiceDialReport=require(_0xe54e('0x5'));var RpcMemberReport=require(_0xe54e('0x6'));var RpcVoiceQueueReport=require(_0xe54e('0x7'));var RpcVoiceRecording=require(_0xe54e('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xe54e('0x9'));var VoiceCallReport=require(_0xe54e('0xa'));var VoiceAgentReport=require(_0xe54e('0xb'));var VoiceDialReport=require(_0xe54e('0xc'));var UserReport=require(_0xe54e('0xd'));function Report(_0x14fb31){this[_0xe54e('0xe')]=_0x14fb31;this[_0xe54e('0xf')]=_0x14fb31[_0xe54e('0xf')];this[_0xe54e('0x10')]=_0x14fb31[_0xe54e('0x10')];}Report[_0xe54e('0x11')]['sync']=function(_0x4fc7e7){var _0x104033=new VoiceQueueReport(this[_0xe54e('0xe')]);var _0x3f910d=new VoiceAgentReport(this[_0xe54e('0xe')]);var _0x28af7a=new VoiceDialReport(this[_0xe54e('0xe')]);var _0x14abbf=new VoiceCallReport(this[_0xe54e('0xe')]);var _0xdd546b=new UserReport(this['realtime']);if(config[_0xe54e('0x12')]&&config['xdr'][_0xe54e('0x13')]){ami['on'](_0xe54e('0x14'),this[_0xe54e('0x15')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xe54e('0x16')][_0xe54e('0x17')](this));ami['on']('custom:voiceAgentReport',this[_0xe54e('0x18')][_0xe54e('0x17')](this));ami['on'](_0xe54e('0x19'),this[_0xe54e('0x1a')]['bind'](this));ami['on'](_0xe54e('0x1b'),this[_0xe54e('0x1c')][_0xe54e('0x17')](this));ami['on'](_0xe54e('0x1d'),this['attendedTransfer'][_0xe54e('0x17')](this));}};Report[_0xe54e('0x11')]['findAgent']=function(_0x39376e){var _0x452a4e;_0x452a4e=_['find'](this[_0xe54e('0xf')],function(_0x3a2aba){return _0x3a2aba['accountcode']==_0x39376e||_0x3a2aba['name']==_0x39376e;});if(_[_0xe54e('0x1e')](_0x452a4e)){var _0x5eab55=_['find'](this['telephones'],function(_0x3e3527){return _0x3e3527[_0xe54e('0x1f')]==_0x39376e||_0x3e3527[_0xe54e('0x20')]==_0x39376e;});if(_0x5eab55){_0x452a4e=_[_0xe54e('0x21')](this[_0xe54e('0xf')],function(_0x521851){return _0x521851['interface']==util[_0xe54e('0x22')](_0xe54e('0x23'),_0x5eab55[_0xe54e('0x20')]);});}}return _0x452a4e;};Report[_0xe54e('0x11')][_0xe54e('0x15')]=function(_0x2d0323){for(var _0x2f9c10=0x0;_0x2f9c10<_0x2d0323[_0xe54e('0x24')];_0x2f9c10+=0x1){var _0x56faf7=this[_0xe54e('0x25')](_0x2d0323[_0x2f9c10][_0xe54e('0x26')]);if(_0x56faf7){_0x2d0323[_0x2f9c10]['accountcode']=_0x56faf7[_0xe54e('0x1f')];_0x2d0323[_0x2f9c10][_0xe54e('0x27')]=!![];_0x2d0323[_0x2f9c10][_0xe54e('0x28')]=_0x56faf7[_0xe54e('0x20')];_0x2d0323[_0x2f9c10][_0xe54e('0x29')]=_[_0xe54e('0x1e')](_0x56faf7[_0xe54e('0x29')])?util[_0xe54e('0x22')](_0xe54e('0x23'),_0x56faf7[_0xe54e('0x20')]):_0x56faf7[_0xe54e('0x29')];if(_0x2d0323[_0x2f9c10][_0xe54e('0x2a')]){_0x2d0323[_0x2f9c10][_0xe54e('0x2b')]=moment()['format'](_0xe54e('0x2c'));}if(_0x2d0323[_0x2f9c10][_0xe54e('0x2d')]){_0x2d0323[_0x2f9c10][_0xe54e('0x2e')]=moment()[_0xe54e('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x2d0323[_0x2f9c10]);}RpcVoiceQueueReport[_0xe54e('0x2f')](_0x2d0323[_0x2f9c10]);}};function extractCalleridNumber(_0x76e7e4){var _0x26e9ca=_0x76e7e4[_0xe54e('0x30')](/<(.*?)>/);return _0x26e9ca?_0x26e9ca[0x1]:_0x76e7e4;}Report[_0xe54e('0x11')][_0xe54e('0x31')]=function(_0x2d4ade){for(var _0x2a633c=0x0;_0x2a633c','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','type','getCallType','UserId','membername','monitor','monitorFilename','monitors','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','indexOf','phone','findAgent','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport'];(function(_0x1b8300,_0x472f39){var _0x49deb2=function(_0x150f25){while(--_0x150f25){_0x1b8300['push'](_0x1b8300['shift']());}};_0x49deb2(++_0x472f39);}(_0x2332,0x164));var _0x2233=function(_0x47d2bb,_0x40f48a){_0x47d2bb=_0x47d2bb-0x0;var _0x2d8aee=_0x2332[_0x47d2bb];return _0x2d8aee;};'use strict';var _=require(_0x2233('0x0'));var moment=require(_0x2233('0x1'));var util=require(_0x2233('0x2'));var config=require(_0x2233('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x2233('0x4'));var RpcVoiceDialReport=require(_0x2233('0x5'));var RpcMemberReport=require(_0x2233('0x6'));var RpcVoiceQueueReport=require(_0x2233('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x2233('0x8'));var VoiceQueueReport=require(_0x2233('0x9'));var VoiceCallReport=require(_0x2233('0xa'));var VoiceAgentReport=require(_0x2233('0xb'));var VoiceDialReport=require(_0x2233('0xc'));var UserReport=require('./userReport');function Report(_0x4de83e){this[_0x2233('0xd')]=_0x4de83e;this[_0x2233('0xe')]=_0x4de83e[_0x2233('0xe')];this[_0x2233('0xf')]=_0x4de83e[_0x2233('0xf')];}Report[_0x2233('0x10')]['sync']=function(_0x7ebe6c){var _0x1907a1=new VoiceQueueReport(this[_0x2233('0xd')]);var _0x15eec4=new VoiceAgentReport(this[_0x2233('0xd')]);var _0x18c2b8=new VoiceDialReport(this['realtime']);var _0x371f4c=new VoiceCallReport(this[_0x2233('0xd')]);var _0x11bc38=new UserReport(this[_0x2233('0xd')]);if(config['xdr']&&config['xdr'][_0x2233('0x11')]){ami['on'](_0x2233('0x12'),this['voiceQueueReport'][_0x2233('0x13')](this));ami['on'](_0x2233('0x14'),this[_0x2233('0x15')]['bind'](this));ami['on'](_0x2233('0x16'),this[_0x2233('0x17')][_0x2233('0x13')](this));ami['on'](_0x2233('0x18'),this['voiceDialReport'][_0x2233('0x13')](this));ami['on'](_0x2233('0x19'),this['blindTransfer'][_0x2233('0x13')](this));ami['on'](_0x2233('0x1a'),this['attendedTransfer'][_0x2233('0x13')](this));}};Report[_0x2233('0x10')]['findAgent']=function(_0x3a1072){var _0x24adae;_0x24adae=_[_0x2233('0x1b')](this[_0x2233('0xe')],function(_0x7d26cb){return _0x7d26cb['accountcode']==_0x3a1072||_0x7d26cb['name']==_0x3a1072;});if(_[_0x2233('0x1c')](_0x24adae)){var _0x25e22d=_[_0x2233('0x1b')](this[_0x2233('0xf')],function(_0x360efc){return _0x360efc[_0x2233('0x1d')]==_0x3a1072||_0x360efc[_0x2233('0x1e')]==_0x3a1072;});if(_0x25e22d){_0x24adae=_[_0x2233('0x1b')](this[_0x2233('0xe')],function(_0x4fd50f){return _0x4fd50f[_0x2233('0x1f')]==util[_0x2233('0x20')](_0x2233('0x21'),_0x25e22d[_0x2233('0x1e')]);});}}return _0x24adae;};Report[_0x2233('0x10')][_0x2233('0x22')]=function(_0x1253cf){for(var _0x3a856b=0x0;_0x3a856b<_0x1253cf[_0x2233('0x23')];_0x3a856b+=0x1){var _0xa57675=this['findAgent'](_0x1253cf[_0x3a856b][_0x2233('0x24')]);if(_0xa57675){_0x1253cf[_0x3a856b][_0x2233('0x1d')]=_0xa57675['accountcode'];_0x1253cf[_0x3a856b][_0x2233('0x25')]=!![];_0x1253cf[_0x3a856b][_0x2233('0x26')]=_0xa57675[_0x2233('0x1e')];_0x1253cf[_0x3a856b]['interface']=_[_0x2233('0x1c')](_0xa57675[_0x2233('0x1f')])?util[_0x2233('0x20')](_0x2233('0x21'),_0xa57675[_0x2233('0x1e')]):_0xa57675[_0x2233('0x1f')];if(_0x1253cf[_0x3a856b]['queuecallercomplete']){_0x1253cf[_0x3a856b][_0x2233('0x27')]=moment()['format'](_0x2233('0x28'));}if(_0x1253cf[_0x3a856b][_0x2233('0x29')]){_0x1253cf[_0x3a856b]['queuecallerexitAt']=moment()[_0x2233('0x20')](_0x2233('0x28'));}RpcMemberReport[_0x2233('0x22')](_0x1253cf[_0x3a856b]);}RpcVoiceQueueReport[_0x2233('0x2a')](_0x1253cf[_0x3a856b]);}};function extractCalleridNumber(_0x53dabf){var _0x2a0866=_0x53dabf['match'](/<(.*?)>/);return _0x2a0866?_0x2a0866[0x1]:_0x53dabf;}Report[_0x2233('0x10')][_0x2233('0x2b')]=function(_0x334772){for(var _0x519071=0x0;_0x5190710x0?_0x411eae:0x0;this[_0x6639('0x13')][_0x1f3bca[_0x6639('0x69')]][_0x6639('0x2f')]=this['voiceQueues'][_0x1f3bca[_0x6639('0x69')]][_0x6639('0x2f')]>_[_0x6639('0x6e')](_0x1f3bca[_0x6639('0x70')])?_[_0x6639('0x6e')](_0x1f3bca['loggedin']):this[_0x6639('0x13')][_0x1f3bca['queue']]['talking'];this[_0x6639('0x72')](this['voiceQueues'][_0x1f3bca[_0x6639('0x69')]],_0x6639('0x16'));}logger[_0x6639('0x48')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x6639('0x3d')](this[_0x6639('0x13')][_0x1f3bca[_0x6639('0x69')]],{'showHidden':![],'depth':null}));ami[_0x6639('0x46')]('custom:queuesummary',this[_0x6639('0x13')][_0x1f3bca['queue']]);}}}catch(_0x2d1076){logger[_0x6639('0x3f')]('[voiceQueueReport][queuesummary]',util[_0x6639('0x3d')](_0x2d1076,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')]['syncQueueSummaryComplete']=function(_0x8a72ff){logger['debug'](_0x6639('0x73'),util[_0x6639('0x3d')](_0x8a72ff,{'showHidden':![],'depth':null}));ami[_0x6639('0x46')](_0x6639('0x74'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x6639('0xa')][_0x6639('0x75')]=function(_0x221951){try{if(this[_0x6639('0x62')](_0x221951)){logger[_0x6639('0x48')](_0x6639('0x76'),_0x221951['uniqueid'],util[_0x6639('0x3d')](_0x221951,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x6639('0xf')][_0x221951['uniqueid']]))this[_0x6639('0xf')][_0x221951[_0x6639('0x4b')]]=[];if(_[_0x6639('0x63')](this['channels'][_0x221951[_0x6639('0x4b')]]))this[_0x6639('0x11')][_0x221951['uniqueid']]={};var _0x5bf855=new QueueReport();_0x5bf855[_0x6639('0x4d')]=_0x221951[_0x6639('0x69')];_0x5bf855[_0x6639('0x77')]=this[_0x6639('0x13')][_0x5bf855['name']]&&this[_0x6639('0x13')][_0x5bf855[_0x6639('0x4d')]][_0x6639('0x77')]?this[_0x6639('0x13')][_0x5bf855['name']][_0x6639('0x77')]||_0x6639('0x55'):_0x6639('0x55');_0x5bf855[_0x6639('0x69')]=_0x221951[_0x6639('0x69')];_0x5bf855[_0x6639('0x78')]=moment()[_0x6639('0x4c')](_0x6639('0x79'));_0x5bf855[_0x6639('0x7a')]=_0x221951[_0x6639('0x7a')];_0x5bf855['count']=_0x221951[_0x6639('0x7b')];_0x5bf855[_0x6639('0x4b')]=_0x221951['uniqueid'];_0x5bf855[_0x6639('0x7c')]=this[_0x6639('0x11')][_0x221951[_0x6639('0x4b')]]['routealias'];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5bf855[_0x6639('0x4d')],_0x5bf855[_0x6639('0x77')]);_[_0x6639('0x7d')](_0x5bf855,_[_0x6639('0x7e')](_0x221951,_[_0x6639('0x7f')](_0x5bf855)));this[_0x6639('0xf')][_0x221951[_0x6639('0x4b')]]['push'](_0x5bf855);this[_0x6639('0x11')][_0x221951[_0x6639('0x4b')]]=_0x5bf855;this[_0x6639('0x47')](_0x5bf855,_0x6639('0x1b'));}}catch(_0x4270a9){logger[_0x6639('0x3f')](_0x6639('0x76'),_0x221951['uniqueid'],util[_0x6639('0x3d')](_0x4270a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')][_0x6639('0x1c')]=function(_0x1b2a42){try{if(this[_0x6639('0x62')](_0x1b2a42)){logger[_0x6639('0x48')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1b2a42['uniqueid'],util[_0x6639('0x3d')](_0x1b2a42,{'showHidden':![],'depth':null}));if(this[_0x6639('0xf')][_0x1b2a42['uniqueid']]){var _0x4b5476=_[_0x6639('0x80')](this[_0x6639('0xf')][_0x1b2a42[_0x6639('0x4b')]]);_0x4b5476['queuecallercomplete']=![];_0x4b5476[_0x6639('0x81')]=null;_0x4b5476[_0x6639('0x82')]=_0x1b2a42[_0x6639('0x82')];_0x4b5476[_0x6639('0x83')]=_0x1b2a42['originalposition'];_0x4b5476['queuecallerabandon']=!![];_0x4b5476[_0x6639('0x84')]=moment()[_0x6639('0x4c')](_0x6639('0x79'));_0x4b5476[_0x6639('0x51')]='ABANDONED';_0x4b5476['lastAssignedTo']=null;logger[_0x6639('0x6b')](_0x6639('0x85'),_0x4b5476['name'],_0x4b5476[_0x6639('0x77')]);this[_0x6639('0x11')][_0x1b2a42['uniqueid']]=_0x4b5476;this[_0x6639('0x44')](_0x4b5476,'queuecallerabandon');}}}catch(_0x343c9b){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x1b2a42[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x343c9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')]['syncQueueCallerLeave']=function(_0x4152b7){try{if(this[_0x6639('0x62')](_0x4152b7)){logger['debug'](_0x6639('0x86'),_0x4152b7[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x4152b7,{'showHidden':![],'depth':null}));if(this[_0x6639('0xf')][_0x4152b7[_0x6639('0x4b')]]){var _0x283c28=_[_0x6639('0x80')](this[_0x6639('0xf')][_0x4152b7[_0x6639('0x4b')]]);_0x283c28['queuecallerleaveAt']=moment()['format'](_0x6639('0x79'));_0x283c28[_0x6639('0x87')]=_0x4152b7['connectedlinenum'];_0x283c28[_0x6639('0x88')]=_0x4152b7[_0x6639('0x88')];logger[_0x6639('0x6b')](_0x6639('0x89'),_0x283c28['name'],_0x283c28[_0x6639('0x77')],_0x4152b7[_0x6639('0x87')],_0x4152b7['connectedlinename']);this['channels'][_0x4152b7['uniqueid']]=_0x283c28;this[_0x6639('0x47')](_0x283c28,_0x6639('0x1d'));}}}catch(_0x5e2ffc){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x4152b7[_0x6639('0x4b')],util['inspect'](_0x5e2ffc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')]['syncAgentConnect']=function(_0x38cca6){try{if(this[_0x6639('0x62')](_0x38cca6)){logger['debug'](_0x6639('0x8a'),_0x38cca6[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x38cca6,{'showHidden':![],'depth':null}));if(this[_0x6639('0xf')][_0x38cca6[_0x6639('0x4b')]]){var _0x1ee473=_[_0x6639('0x80')](this[_0x6639('0xf')][_0x38cca6[_0x6639('0x4b')]]);_0x1ee473['queuecallercomplete']=!![];_0x1ee473['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x6639('0x6b')](_0x6639('0x8b'),_0x1ee473[_0x6639('0x4d')],_0x1ee473['type']);}}}catch(_0x48b8c2){logger['error'](_0x6639('0x8a'),_0x38cca6[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x48b8c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')][_0x6639('0x8c')]=function(_0x3fc99e){try{if(this[_0x6639('0x62')](_0x3fc99e)){logger[_0x6639('0x48')](_0x6639('0x8d'),_0x3fc99e[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x3fc99e,{'showHidden':![],'depth':null}));if(this[_0x6639('0xf')][_0x3fc99e[_0x6639('0x4b')]]){var _0x25666c=_[_0x6639('0x80')](this['queueReports'][_0x3fc99e['uniqueid']]);_0x25666c[_0x6639('0x8e')]=![];_0x25666c[_0x6639('0x84')]=null;_0x25666c['assigned']=!![];_0x25666c['lastAssignedTo']=_0x3fc99e[_0x6639('0x8f')];_0x25666c[_0x6639('0x82')]=_0x3fc99e[_0x6639('0x82')];_0x25666c['queuecallercomplete']=!![];_0x25666c[_0x6639('0x90')]=![];_0x25666c[_0x6639('0x91')]=null;if(!_0x25666c[_0x6639('0x92')]){if(_0x3fc99e[_0x6639('0x93')]==_0x6639('0x92')){_0x25666c[_0x6639('0x51')]='COMPLETED';logger[_0x6639('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x25666c['name'],_0x25666c[_0x6639('0x77')]);}else{if(_[_0x6639('0x94')](_0x3fc99e[_0x6639('0x39')][_0x6639('0x95')](),_0x6639('0x96'))){if(this[_0x6639('0xf')][_0x3fc99e[_0x6639('0x97')]]){var _0x57805e=_[_0x6639('0x80')](this['queueReports'][_0x3fc99e[_0x6639('0x97')]]);_0x57805e[_0x6639('0x98')]=![];_0x57805e['queuecallerexit']=!![];_0x57805e[_0x6639('0x91')]=moment(_0x25666c[_0x6639('0x78')])['add'](_0x3fc99e[_0x6639('0x82')],_0x6639('0x99'))[_0x6639('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x57805e[_0x6639('0x51')]=_0x6639('0x9a');_0x57805e[_0x6639('0x92')]=!![];_0x57805e[_0x6639('0x9b')]=_0x6639('0x9c');_0x57805e['transferexten']=_0x3fc99e[_0x6639('0x9d')];_0x57805e[_0x6639('0x9e')]=_0x3fc99e[_0x6639('0x4b')];logger['info'](_0x6639('0x9f'),_0x57805e[_0x6639('0x4d')],_0x57805e[_0x6639('0x77')]);var _0x123b69=this[_0x6639('0xf')][_0x3fc99e['linkedid']];this[_0x6639('0xf')][_0x3fc99e[_0x6639('0x97')]]=this[_0x6639('0xf')][_0x3fc99e[_0x6639('0x4b')]];this['queueReports'][_0x3fc99e[_0x6639('0x4b')]]=_0x123b69;}}else{_0x25666c['queuecallerexitreason']='COMPLETEDBY'+_0x3fc99e[_0x6639('0x93')][_0x6639('0xa0')]();logger[_0x6639('0x6b')](_0x6639('0xa1'),_0x25666c['name'],_0x25666c[_0x6639('0x77')],_0x25666c[_0x6639('0x51')]);}}}this[_0x6639('0x11')][_0x3fc99e[_0x6639('0x4b')]]=_0x25666c;this['emitVoiceQueueChannelRemove'](_0x25666c,'agentcomplete');}}}catch(_0x4b48c0){logger[_0x6639('0x3f')](_0x6639('0x8d'),_0x3fc99e[_0x6639('0x4b')],util['inspect'](_0x4b48c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')][_0x6639('0x21')]=function(_0x1a0749){try{if(this['isNotNull'](_0x1a0749)){logger[_0x6639('0x48')]('[%s][voiceQueueReport][varset]',_0x1a0749[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x1a0749,{'showHidden':![],'depth':null}));this[_0x6639('0xa2')](_0x1a0749[_0x6639('0x4b')],_[_0x6639('0x7f')](_0x1a0749['variable'])[0x0],_0x1a0749[_0x6639('0xa3')]);if(this[_0x6639('0xf')][_0x1a0749[_0x6639('0x4b')]]){var _0x55865a=_[_0x6639('0x80')](this[_0x6639('0xf')][_0x1a0749[_0x6639('0x4b')]]);if(_0x55865a){if(this[_0x6639('0x62')](_0x1a0749[_0x6639('0xa4')])&&this['isNotNull'](_0x1a0749[_0x6639('0xa4')][_0x6639('0xa5')])){switch(_0x1a0749['value']){case _0x6639('0xa6'):_0x55865a['queuecallerexit']=![];_0x55865a[_0x6639('0x91')]=null;break;case'TIMEOUT':_0x55865a[_0x6639('0xa7')]='timeout';_0x55865a['queuecallerexit']=!![];_0x55865a[_0x6639('0x91')]=moment()[_0x6639('0x4c')](_0x6639('0x79'));_0x55865a[_0x6639('0xa8')]=moment()[_0x6639('0x4c')](_0x6639('0x79'));logger['debug'](_0x6639('0xa9'),_0x1a0749[_0x6639('0x4b')],util[_0x6639('0x3d')](_0x55865a,{'showHidden':![],'depth':null}));ami[_0x6639('0x46')](_0x6639('0xaa'),_0x55865a);break;default:_0x55865a[_0x6639('0x90')]=!![];_0x55865a[_0x6639('0x91')]=moment()[_0x6639('0x4c')](_0x6639('0x79'));_0x55865a['queuecallerleaveAt']=moment()['format'](_0x6639('0x79'));}_0x55865a[_0x6639('0x8e')]=![];_0x55865a['queuecallerabandonAt']=null;_0x55865a[_0x6639('0x51')]=_0x1a0749[_0x6639('0xa3')];this[_0x6639('0x11')][_0x1a0749['uniqueid']]=_0x55865a;this[_0x6639('0x44')](_0x55865a,_0x6639('0xab'));}else if(this[_0x6639('0x62')](_0x1a0749['variable'])&&this[_0x6639('0x62')](_0x1a0749['variable'][_0x6639('0xac')])){if(!_0x55865a[_0x6639('0x8e')]){_0x55865a['queuecallerexit']=!![];_0x55865a[_0x6639('0x91')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x55865a[_0x6639('0x51')]=_0x6639('0xad');_0x55865a['queuecallerleaveAt']=moment()[_0x6639('0x4c')](_0x6639('0x79'));this[_0x6639('0x11')][_0x1a0749[_0x6639('0x4b')]]=_0x55865a;}}logger[_0x6639('0x6b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1a0749[_0x6639('0x4b')],_0x55865a[_0x6639('0x4d')],_0x55865a[_0x6639('0x77')],_[_0x6639('0x7f')](_0x1a0749[_0x6639('0xa4')])[0x0],_0x1a0749[_0x6639('0xa3')]);_0x55865a[_0x6639('0xae')]=this[_0x6639('0xae')][_0x1a0749[_0x6639('0x4b')]];}}}}catch(_0x2be70b){logger['error']('[%s][voiceQueueReport][varset]',_0x1a0749['uniqueid'],util['inspect'](_0x2be70b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6639('0xa')][_0x6639('0xa2')]=function(_0x1a4363,_0x27d387,_0x4c223e){var _0x49e2ff=[_0x6639('0xaf'),_0x6639('0xb0'),'rtpaudioqosjitter',_0x6639('0xb1'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x6639('0xb2'),_0x6639('0xb3'),_0x6639('0xb4'),_0x6639('0xb5'),'bridgepeer',_0x6639('0xb6'),_0x6639('0xb7'),'memberdynamic','memberinterface',_0x6639('0xb8'),_0x6639('0x8f'),_0x6639('0xb9'),_0x6639('0xba')];if(!_[_0x6639('0x36')](_0x27d387)&&!_[_0x6639('0xbb')](_0x49e2ff,_0x27d387)){if(_[_0x6639('0x63')](this[_0x6639('0xae')][_0x1a4363])){this['variables'][_0x1a4363]={};}this[_0x6639('0xae')][_0x1a4363][_0x27d387]=_0x4c223e;}};VoiceQueueReport[_0x6639('0xa')][_0x6639('0xbc')]=function(_0x11e349,_0x589a27,_0x48f987){var _0x1c77a7={};for(var _0x4f51ec=0x0;_0x4f51ec0x0?_0x522a58:0x0;this[_0x9a53('0x13')][_0x5430eb[_0x9a53('0x6f')]][_0x9a53('0x33')]=this['voiceQueues'][_0x5430eb['queue']][_0x9a53('0x33')]>_[_0x9a53('0x73')](_0x5430eb[_0x9a53('0x76')])?_[_0x9a53('0x73')](_0x5430eb[_0x9a53('0x76')]):this['voiceQueues'][_0x5430eb[_0x9a53('0x6f')]][_0x9a53('0x33')];this[_0x9a53('0x55')](this[_0x9a53('0x13')][_0x5430eb[_0x9a53('0x6f')]],_0x9a53('0x6c'));}logger['debug'](_0x9a53('0x77'),util[_0x9a53('0x43')](this[_0x9a53('0x13')][_0x5430eb[_0x9a53('0x6f')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9a53('0x78'),this[_0x9a53('0x13')][_0x5430eb['queue']]);}}}catch(_0x387108){logger[_0x9a53('0x41')](_0x9a53('0x6e'),util[_0x9a53('0x43')](_0x387108,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a53('0x37')][_0x9a53('0x19')]=function(_0x22b290){logger[_0x9a53('0x4b')](_0x9a53('0x79'),util[_0x9a53('0x43')](_0x22b290,{'showHidden':![],'depth':null}));ami[_0x9a53('0x49')]('custom:queuesummarycomplete',{});this[_0x9a53('0x14')]=!![];};VoiceQueueReport[_0x9a53('0x37')]['syncQueueCallerJoin']=function(_0x226856){try{if(this['isNotNull'](_0x226856)){logger[_0x9a53('0x4b')](_0x9a53('0x7a'),_0x226856[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x226856,{'showHidden':![],'depth':null}));if(_[_0x9a53('0x68')](this[_0x9a53('0xf')][_0x226856[_0x9a53('0x4e')]]))this[_0x9a53('0xf')][_0x226856[_0x9a53('0x4e')]]=[];if(_['isUndefined'](this[_0x9a53('0x11')][_0x226856[_0x9a53('0x4e')]]))this[_0x9a53('0x11')][_0x226856[_0x9a53('0x4e')]]={};var _0x25ca1d=new QueueReport();_0x25ca1d[_0x9a53('0x54')]=_0x226856[_0x9a53('0x6f')];_0x25ca1d[_0x9a53('0x56')]=this['voiceQueues'][_0x25ca1d[_0x9a53('0x54')]]&&this[_0x9a53('0x13')][_0x25ca1d['name']][_0x9a53('0x56')]?this[_0x9a53('0x13')][_0x25ca1d['name']][_0x9a53('0x56')]||_0x9a53('0x57'):_0x9a53('0x57');_0x25ca1d['queue']=_0x226856[_0x9a53('0x6f')];_0x25ca1d['queuecallerjoinAt']=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x25ca1d[_0x9a53('0x7c')]=_0x226856[_0x9a53('0x7c')];_0x25ca1d['count']=_0x226856[_0x9a53('0x7d')];_0x25ca1d[_0x9a53('0x4e')]=_0x226856[_0x9a53('0x4e')];_0x25ca1d[_0x9a53('0x7e')]=this[_0x9a53('0x11')][_0x226856['uniqueid']][_0x9a53('0x7e')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x25ca1d[_0x9a53('0x54')],_0x25ca1d[_0x9a53('0x56')]);_[_0x9a53('0x7f')](_0x25ca1d,_['pick'](_0x226856,_['keys'](_0x25ca1d)));this['queueReports'][_0x226856[_0x9a53('0x4e')]][_0x9a53('0x80')](_0x25ca1d);this[_0x9a53('0x11')][_0x226856['uniqueid']]=_0x25ca1d;this['emitVoiceQueueChannelSave'](_0x25ca1d,_0x9a53('0x81'));}}catch(_0x1cde9d){logger[_0x9a53('0x41')](_0x9a53('0x7a'),_0x226856[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x1cde9d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a53('0x37')][_0x9a53('0x1c')]=function(_0x1cee61){try{if(this['isNotNull'](_0x1cee61)){logger[_0x9a53('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1cee61[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x1cee61,{'showHidden':![],'depth':null}));if(this[_0x9a53('0xf')][_0x1cee61[_0x9a53('0x4e')]]){var _0x5145d8=_[_0x9a53('0x82')](this[_0x9a53('0xf')][_0x1cee61[_0x9a53('0x4e')]]);_0x5145d8[_0x9a53('0x83')]=![];_0x5145d8[_0x9a53('0x84')]=null;_0x5145d8[_0x9a53('0x85')]=_0x1cee61[_0x9a53('0x85')];_0x5145d8[_0x9a53('0x86')]=_0x1cee61[_0x9a53('0x86')];_0x5145d8[_0x9a53('0x1b')]=!![];_0x5145d8[_0x9a53('0x87')]=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x5145d8[_0x9a53('0x52')]=_0x9a53('0x88');_0x5145d8[_0x9a53('0x89')]=null;logger[_0x9a53('0x8a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5145d8[_0x9a53('0x54')],_0x5145d8['type']);this[_0x9a53('0x11')][_0x1cee61['uniqueid']]=_0x5145d8;this[_0x9a53('0x47')](_0x5145d8,'queuecallerabandon');}}}catch(_0x3e87c6){logger[_0x9a53('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1cee61[_0x9a53('0x4e')],util['inspect'](_0x3e87c6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a53('0x37')]['syncQueueCallerLeave']=function(_0x4bf026){try{if(this[_0x9a53('0x67')](_0x4bf026)){logger['debug'](_0x9a53('0x8b'),_0x4bf026[_0x9a53('0x4e')],util['inspect'](_0x4bf026,{'showHidden':![],'depth':null}));if(this[_0x9a53('0xf')][_0x4bf026[_0x9a53('0x4e')]]){var _0x22b698=_['last'](this[_0x9a53('0xf')][_0x4bf026[_0x9a53('0x4e')]]);_0x22b698[_0x9a53('0x8c')]=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x22b698[_0x9a53('0x8d')]=_0x4bf026[_0x9a53('0x8d')];_0x22b698['connectedlinename']=_0x4bf026['connectedlinename'];logger[_0x9a53('0x8a')](_0x9a53('0x8e'),_0x22b698[_0x9a53('0x54')],_0x22b698[_0x9a53('0x56')],_0x4bf026[_0x9a53('0x8d')],_0x4bf026['connectedlinename']);this[_0x9a53('0x11')][_0x4bf026[_0x9a53('0x4e')]]=_0x22b698;this[_0x9a53('0x4a')](_0x22b698,_0x9a53('0x1d'));}}}catch(_0x2e1f51){logger[_0x9a53('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x4bf026['uniqueid'],util['inspect'](_0x2e1f51,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a53('0x37')][_0x9a53('0x21')]=function(_0x2c3d1d){try{if(this[_0x9a53('0x67')](_0x2c3d1d)){logger[_0x9a53('0x4b')]('[%s][voiceQueueReport][agentconnect]',_0x2c3d1d['uniqueid'],util[_0x9a53('0x43')](_0x2c3d1d,{'showHidden':![],'depth':null}));if(this[_0x9a53('0xf')][_0x2c3d1d['uniqueid']]){var _0x4fa762=_['last'](this[_0x9a53('0xf')][_0x2c3d1d[_0x9a53('0x4e')]]);_0x4fa762[_0x9a53('0x83')]=!![];_0x4fa762[_0x9a53('0x52')]=_0x9a53('0x8f');logger[_0x9a53('0x8a')](_0x9a53('0x90'),_0x4fa762[_0x9a53('0x54')],_0x4fa762[_0x9a53('0x56')]);}}}catch(_0x188e96){logger[_0x9a53('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x2c3d1d['uniqueid'],util[_0x9a53('0x43')](_0x188e96,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9a53('0x37')][_0x9a53('0x1f')]=function(_0x36d9dc){try{if(this['isNotNull'](_0x36d9dc)){logger[_0x9a53('0x4b')](_0x9a53('0x91'),_0x36d9dc[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x36d9dc,{'showHidden':![],'depth':null}));if(this[_0x9a53('0xf')][_0x36d9dc[_0x9a53('0x4e')]]){var _0x2c5099=_['last'](this[_0x9a53('0xf')][_0x36d9dc['uniqueid']]);_0x2c5099['queuecallerabandon']=![];_0x2c5099[_0x9a53('0x87')]=null;_0x2c5099['assigned']=!![];_0x2c5099[_0x9a53('0x89')]=_0x36d9dc[_0x9a53('0x92')];_0x2c5099[_0x9a53('0x85')]=_0x36d9dc[_0x9a53('0x85')];_0x2c5099[_0x9a53('0x83')]=!![];_0x2c5099[_0x9a53('0x93')]=![];_0x2c5099[_0x9a53('0x94')]=null;if(!_0x2c5099[_0x9a53('0x95')]){if(_0x36d9dc['reason']==_0x9a53('0x95')){_0x2c5099['queuecallerexitreason']=_0x9a53('0x96');logger[_0x9a53('0x8a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2c5099[_0x9a53('0x54')],_0x2c5099[_0x9a53('0x56')]);}else{if(_['startsWith'](_0x36d9dc[_0x9a53('0x3d')]['toLowerCase'](),_0x9a53('0x97'))){if(this[_0x9a53('0xf')][_0x36d9dc[_0x9a53('0x98')]]){var _0x1e2202=_[_0x9a53('0x82')](this['queueReports'][_0x36d9dc[_0x9a53('0x98')]]);_0x1e2202[_0x9a53('0x83')]=![];_0x1e2202[_0x9a53('0x93')]=!![];_0x1e2202[_0x9a53('0x94')]=moment(_0x2c5099[_0x9a53('0x99')])[_0x9a53('0x9a')](_0x36d9dc['holdtime'],'seconds')[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x1e2202['queuecallerexitreason']='FORWARDTRANSFER';_0x1e2202[_0x9a53('0x95')]=!![];_0x1e2202['transfertype']='FORWARD';_0x1e2202[_0x9a53('0x9b')]=_0x36d9dc[_0x9a53('0x9c')];_0x1e2202[_0x9a53('0x9d')]=_0x36d9dc[_0x9a53('0x4e')];logger['info'](_0x9a53('0x9e'),_0x1e2202[_0x9a53('0x54')],_0x1e2202[_0x9a53('0x56')]);var _0x2de854=this[_0x9a53('0xf')][_0x36d9dc['linkedid']];this[_0x9a53('0xf')][_0x36d9dc['linkedid']]=this[_0x9a53('0xf')][_0x36d9dc[_0x9a53('0x4e')]];this[_0x9a53('0xf')][_0x36d9dc[_0x9a53('0x4e')]]=_0x2de854;}}else{_0x2c5099[_0x9a53('0x52')]=_0x9a53('0x9f')+_0x36d9dc[_0x9a53('0xa0')][_0x9a53('0xa1')]();logger[_0x9a53('0x8a')](_0x9a53('0xa2'),_0x2c5099[_0x9a53('0x54')],_0x2c5099['type'],_0x2c5099[_0x9a53('0x52')]);}}}this['channels'][_0x36d9dc[_0x9a53('0x4e')]]=_0x2c5099;this[_0x9a53('0x47')](_0x2c5099,_0x9a53('0xa3'));}}}catch(_0x5940fc){logger[_0x9a53('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x36d9dc[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x5940fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9a53('0x23')]=function(_0x135826){try{if(this[_0x9a53('0x67')](_0x135826)){logger['debug'](_0x9a53('0xa4'),_0x135826[_0x9a53('0x4e')],util['inspect'](_0x135826,{'showHidden':![],'depth':null}));this['addVariable'](_0x135826['uniqueid'],_[_0x9a53('0xa5')](_0x135826['variable'])[0x0],_0x135826[_0x9a53('0xa6')]);if(this[_0x9a53('0xf')][_0x135826[_0x9a53('0x4e')]]){var _0x4f5204=_[_0x9a53('0x82')](this['queueReports'][_0x135826['uniqueid']]);if(_0x4f5204){if(this[_0x9a53('0x67')](_0x135826[_0x9a53('0xa7')])&&this[_0x9a53('0x67')](_0x135826[_0x9a53('0xa7')]['queuestatus'])){switch(_0x135826[_0x9a53('0xa6')]){case'CONTINUE':_0x4f5204[_0x9a53('0x93')]=![];_0x4f5204[_0x9a53('0x94')]=null;break;case _0x9a53('0xa8'):_0x4f5204[_0x9a53('0xa9')]=_0x9a53('0xaa');_0x4f5204[_0x9a53('0x93')]=!![];_0x4f5204[_0x9a53('0x94')]=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x4f5204[_0x9a53('0x8c')]=moment()['format'](_0x9a53('0x7b'));logger[_0x9a53('0x4b')](_0x9a53('0xab'),_0x135826[_0x9a53('0x4e')],util[_0x9a53('0x43')](_0x4f5204,{'showHidden':![],'depth':null}));ami['emit'](_0x9a53('0xac'),_0x4f5204);break;default:_0x4f5204['queuecallerexit']=!![];_0x4f5204[_0x9a53('0x94')]=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));_0x4f5204[_0x9a53('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4f5204[_0x9a53('0x1b')]=![];_0x4f5204[_0x9a53('0x87')]=null;_0x4f5204[_0x9a53('0x52')]=_0x135826['value'];this[_0x9a53('0x11')][_0x135826[_0x9a53('0x4e')]]=_0x4f5204;this[_0x9a53('0x47')](_0x4f5204,_0x9a53('0x22'));}else if(this[_0x9a53('0x67')](_0x135826[_0x9a53('0xa7')])&&this[_0x9a53('0x67')](_0x135826[_0x9a53('0xa7')][_0x9a53('0xad')])){if(!_0x4f5204[_0x9a53('0x1b')]){_0x4f5204[_0x9a53('0x93')]=!![];_0x4f5204[_0x9a53('0x94')]=moment()[_0x9a53('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f5204[_0x9a53('0x52')]=_0x9a53('0xae');_0x4f5204[_0x9a53('0x8c')]=moment()[_0x9a53('0x4f')](_0x9a53('0x7b'));this['channels'][_0x135826['uniqueid']]=_0x4f5204;}}logger[_0x9a53('0x8a')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x135826[_0x9a53('0x4e')],_0x4f5204[_0x9a53('0x54')],_0x4f5204[_0x9a53('0x56')],_['keys'](_0x135826['variable'])[0x0],_0x135826['value']);_0x4f5204[_0x9a53('0x16')]=this[_0x9a53('0x16')][_0x135826[_0x9a53('0x4e')]];}}}}catch(_0x1210e5){logger[_0x9a53('0x41')](_0x9a53('0xa4'),_0x135826[_0x9a53('0x4e')],util['inspect'](_0x1210e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9a53('0xaf')]=function(_0x599741,_0x324c8c,_0x585e7f){var _0x5add3e=[_0x9a53('0xb0'),_0x9a53('0xb1'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x9a53('0xb2'),_0x9a53('0xb3'),_0x9a53('0xb4'),_0x9a53('0xb5'),_0x9a53('0xb6'),_0x9a53('0xb7'),_0x9a53('0xb8'),'bridgepvtcallid','membercalls',_0x9a53('0xb9'),_0x9a53('0xba'),_0x9a53('0xbb'),_0x9a53('0x92'),_0x9a53('0xbc'),_0x9a53('0xbd')];if(!_[_0x9a53('0xbe')](_0x324c8c)&&!_[_0x9a53('0xbf')](_0x5add3e,_0x324c8c)){if(_[_0x9a53('0x68')](this[_0x9a53('0x16')][_0x599741])){this[_0x9a53('0x16')][_0x599741]={};}this[_0x9a53('0x16')][_0x599741][_0x324c8c]=_0x585e7f;}};VoiceQueueReport[_0x9a53('0x37')][_0x9a53('0xc0')]=function(_0x5032b1,_0x2c9234,_0x5ae353){var _0x4d5f6a={};for(var _0x1c9507=0x0;_0x1c9507=0x0?moment(_0x330344[_0xfd53('0x15')])['diff'](_0x330344[_0xfd53('0x14')],_0xfd53('0xe')):null,'data1':_0xfd53('0x16'),'data2':_0x330344[_0xfd53('0x11')],'data3':_0x330344[_0xfd53('0x10')],'data4':_0x330344[_0xfd53('0x17')]||null,'role':_0xfd53('0x18'),'internal':_0x330344[_0xfd53('0x11')]?_[_0xfd53('0x19')](_0x330344[_0xfd53('0x11')]):undefined,'uniqueid':_0x330344[_0xfd53('0x12')]},'log':_0xfd53('0x5')});}; \ No newline at end of file +var _0x332d=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','membername','endtime','starttime','outbound','dialstring','uniqueid','moment','util','../client'];(function(_0x3fdab4,_0x41eca9){var _0x484516=function(_0x3ccbb3){while(--_0x3ccbb3){_0x3fdab4['push'](_0x3fdab4['shift']());}};_0x484516(++_0x41eca9);}(_0x332d,0xb1));var _0xd332=function(_0x3dd61a,_0x12aae1){_0x3dd61a=_0x3dd61a-0x0;var _0x119c41=_0x332d[_0x3dd61a];return _0x119c41;};'use strict';var moment=require(_0xd332('0x0'));var _=require('lodash');var util=require(_0xd332('0x1'));var client=require(_0xd332('0x2'));exports[_0xd332('0x3')]=function(_0x22d846){var _0x7ccdb5=_0x22d846[_0xd332('0x4')]||_0x22d846[_0xd332('0x5')];return client[_0xd332('0x6')](_0xd332('0x7'),{'body':{'channel':'voice','membername':_0x22d846[_0xd332('0x8')],'interface':_[_0xd332('0x9')](_0x22d846[_0xd332('0xa')])?util[_0xd332('0xb')](_0xd332('0xc'),_0x22d846[_0xd332('0x8')]):_0x22d846[_0xd332('0xa')],'type':_0xd332('0xd'),'enterAt':_0x22d846[_0xd332('0xe')],'exitAt':_0x7ccdb5,'duration':moment(_0x7ccdb5)[_0xd332('0xf')](_0x22d846[_0xd332('0xe')],_0xd332('0x10')),'data1':_0xd332('0x11'),'data2':_0x22d846[_0xd332('0x12')],'data3':_0x22d846[_0xd332('0x13')],'data4':null,'data5':_0x22d846[_0xd332('0x14')],'role':_0xd332('0x15'),'internal':_0x22d846[_0xd332('0x16')]?_[_0xd332('0x17')](_0x22d846[_0xd332('0x16')]):undefined,'uniqueid':_0x22d846['uniqueid']},'log':_0xd332('0x7')});};exports['voiceDialReport']=function(_0x40ada8){return client[_0xd332('0x6')](_0xd332('0x7'),{'body':{'channel':'voice','membername':_0x40ada8[_0xd332('0x18')],'interface':_0x40ada8['interface'],'type':_0xd332('0xd'),'enterAt':_0x40ada8['starttime'],'exitAt':_0x40ada8[_0xd332('0x19')],'duration':moment(_0x40ada8[_0xd332('0x19')])[_0xd332('0xf')](_0x40ada8[_0xd332('0x1a')],_0xd332('0x10'))>=0x0?moment(_0x40ada8[_0xd332('0x19')])['diff'](_0x40ada8['starttime'],_0xd332('0x10')):null,'data1':_0xd332('0x1b'),'data2':_0x40ada8[_0xd332('0x16')],'data3':_0x40ada8[_0xd332('0x13')],'data4':_0x40ada8[_0xd332('0x1c')]||null,'role':_0xd332('0x15'),'internal':_0x40ada8[_0xd332('0x16')]?_[_0xd332('0x17')](_0x40ada8[_0xd332('0x16')]):undefined,'uniqueid':_0x40ada8[_0xd332('0x1d')]},'log':_0xd332('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index b1a00e3..fbdf8cb 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 _0xe1ee=['getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xe1ee,0x158));var _0xee1e=function(_0x5acaea,_0x442cb0){_0x5acaea=_0x5acaea-0x0;var _0x509dfa=_0xe1ee[_0x5acaea];return _0x509dfa;};'use strict';var client=require(_0xee1e('0x0'));exports[_0xee1e('0x1')]=function(){return client['Request'](_0xee1e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xee1e('0x3'),'previewRecallmeReminderInterval']},'log':_0xee1e('0x4')});}; \ No newline at end of file +var _0x505d=['previewRecallmeReminderInterval','GetSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x505d,0x93));var _0xd505=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x505d[_0x58965a];return _0x254efc;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xd505('0x0')](_0xd505('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd505('0x2'),_0xd505('0x3')]},'log':_0xd505('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f0d1ab4..3f34412 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 _0xd8a2=['name','../client','getTemplates','Request','GetTemplate'];(function(_0x6bc5a4,_0x569afa){var _0x4af1c1=function(_0x2da28b){while(--_0x2da28b){_0x6bc5a4['push'](_0x6bc5a4['shift']());}};_0x4af1c1(++_0x569afa);}(_0xd8a2,0x128));var _0x2d8a=function(_0xb8cdd5,_0x29c11d){_0xb8cdd5=_0xb8cdd5-0x0;var _0x4d1f81=_0xd8a2[_0xb8cdd5];return _0x4d1f81;};'use strict';var client=require(_0x2d8a('0x0'));exports[_0x2d8a('0x1')]=function(_0x1e8391){return function(_0x293824){return client[_0x2d8a('0x2')](_0x2d8a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x2d8a('0x4'),'html']},'log':_0x2d8a('0x3')});};}; \ No newline at end of file +var _0x29b1=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x58ddbc,_0xb16c97){var _0x43be9f=function(_0x3aecaf){while(--_0x3aecaf){_0x58ddbc['push'](_0x58ddbc['shift']());}};_0x43be9f(++_0xb16c97);}(_0x29b1,0x16d));var _0x129b=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x29b1[_0xc4001c];return _0x49f7bc;};'use strict';var client=require(_0x129b('0x0'));exports[_0x129b('0x1')]=function(_0x45619b){return function(_0x458ca2){return client[_0x129b('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x129b('0x3'),_0x129b('0x4')]},'log':_0x129b('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 26e1e64..964ee44 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 _0x3baf=['getTriggers','Request','name','channel','status','Condition','AllConditions','operator','value','AnyConditions','field','Actions','data1','data2','data5','data6','data7','../client'];(function(_0x557023,_0xe2ecfd){var _0x16c4f7=function(_0x5dbb4a){while(--_0x5dbb4a){_0x557023['push'](_0x557023['shift']());}};_0x16c4f7(++_0xe2ecfd);}(_0x3baf,0x1d3));var _0xf3ba=function(_0x180ac2,_0x219d65){_0x180ac2=_0x180ac2-0x0;var _0xfcaede=_0x3baf[_0x180ac2];return _0xfcaede;};'use strict';var client=require(_0xf3ba('0x0'));exports[_0xf3ba('0x1')]=function(_0x1d78da){return function(_0x5902d4){return client[_0xf3ba('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xf3ba('0x3'),_0xf3ba('0x4'),_0xf3ba('0x5')],'include':[{'model':_0xf3ba('0x6'),'as':_0xf3ba('0x7'),'attributes':['id','field',_0xf3ba('0x8'),_0xf3ba('0x9')]},{'model':_0xf3ba('0x6'),'as':_0xf3ba('0xa'),'attributes':['id',_0xf3ba('0xb'),_0xf3ba('0x8'),_0xf3ba('0x9')]},{'model':'Action','as':_0xf3ba('0xc'),'attributes':['id','action',_0xf3ba('0xd'),_0xf3ba('0xe'),'data3','data4',_0xf3ba('0xf'),_0xf3ba('0x10'),_0xf3ba('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x0726=['../client','Request','GetTrigger','name','channel','status','Condition','field','operator','value','AnyConditions','Action','data1','data2','data3','data4','data5','data7'];(function(_0x2f632c,_0x214e78){var _0x1d7101=function(_0x356015){while(--_0x356015){_0x2f632c['push'](_0x2f632c['shift']());}};_0x1d7101(++_0x214e78);}(_0x0726,0x90));var _0x6072=function(_0x1ecdbb,_0x2df633){_0x1ecdbb=_0x1ecdbb-0x0;var _0x3e76b8=_0x0726[_0x1ecdbb];return _0x3e76b8;};'use strict';var client=require(_0x6072('0x0'));exports['getTriggers']=function(_0xa52714){return function(_0x3f5ada){return client[_0x6072('0x1')](_0x6072('0x2'),{'options':{'raw':![],'attributes':['id',_0x6072('0x3'),_0x6072('0x4'),_0x6072('0x5')],'include':[{'model':_0x6072('0x6'),'as':'AllConditions','attributes':['id',_0x6072('0x7'),_0x6072('0x8'),_0x6072('0x9')]},{'model':_0x6072('0x6'),'as':_0x6072('0xa'),'attributes':['id',_0x6072('0x7'),_0x6072('0x8'),_0x6072('0x9')]},{'model':_0x6072('0xb'),'as':'Actions','attributes':['id','action',_0x6072('0xc'),_0x6072('0xd'),_0x6072('0xe'),_0x6072('0xf'),_0x6072('0x10'),'data6',_0x6072('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f3ac211..8a7954d 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 _0xd187=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x22e714,_0x38d207){var _0x1955ab=function(_0x173287){while(--_0x173287){_0x22e714['push'](_0x22e714['shift']());}};_0x1955ab(++_0x38d207);}(_0xd187,0x90));var _0x7d18=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0xd187[_0x26bcec];return _0x1049dc;};'use strict';var client=require(_0x7d18('0x0'));exports[_0x7d18('0x1')]=function(_0x3423d6){return function(_0x53af61){return client[_0x7d18('0x2')](_0x7d18('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7d18('0x4'),_0x7d18('0x5'),_0x7d18('0x6')]},'log':_0x7d18('0x3')});};}; \ No newline at end of file +var _0xc651=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xc651,0x16a));var _0x1c65=function(_0x30cdb1,_0x2645a8){_0x30cdb1=_0x30cdb1-0x0;var _0x3f34db=_0xc651[_0x30cdb1];return _0x3f34db;};'use strict';var client=require(_0x1c65('0x0'));exports[_0x1c65('0x1')]=function(_0x9421e7){return function(_0x3e2eb4){return client[_0x1c65('0x2')](_0x1c65('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1c65('0x4'),_0x1c65('0x5'),_0x1c65('0x6')]},'log':_0x1c65('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index df6c0cf..2388e24 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x528ca0,_0xa5169e){var _0x32eb63=function(_0x3a9d0d){while(--_0x3a9d0d){_0x528ca0['push'](_0x528ca0['shift']());}};_0x32eb63(++_0xa5169e);}(_0x70e0,0x17b));var _0x070e=function(_0x5bf5b2,_0x221f5a){_0x5bf5b2=_0x5bf5b2-0x0;var _0x2eb929=_0x70e0[_0x5bf5b2];return _0x2eb929;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x309bc7,_0x376d50){var _0x1eda5c=function(_0x1bc516){while(--_0x1bc516){_0x309bc7['push'](_0x309bc7['shift']());}};_0x1eda5c(++_0x376d50);}(_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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index bb12c43..c3ccd31 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 _0x8666=['../client','create','CreateVoiceAgentReport','update'];(function(_0x296da5,_0x15ff68){var _0x38f517=function(_0x59edc7){while(--_0x59edc7){_0x296da5['push'](_0x296da5['shift']());}};_0x38f517(++_0x15ff68);}(_0x8666,0x170));var _0x6866=function(_0x5912cd,_0x5cc626){_0x5912cd=_0x5912cd-0x0;var _0x357e80=_0x8666[_0x5912cd];return _0x357e80;};'use strict';var client=require(_0x6866('0x0'));exports[_0x6866('0x1')]=function(_0x426f5b){return client['Request']('CreateVoiceAgentReport',{'body':_0x426f5b,'log':_0x6866('0x2')});};exports[_0x6866('0x3')]=function(_0x54e6cf,_0x19e06c,_0x50e9ba){return client['Request']('UpdateVoiceAgentReport',{'body':_0x54e6cf,'options':{'where':{'uniqueid':_0x19e06c,'interface':_0x50e9ba,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x72c9=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x72c9,0x1a9));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x972c('0x0'));exports[_0x972c('0x1')]=function(_0x436aaf){return client[_0x972c('0x2')](_0x972c('0x3'),{'body':_0x436aaf,'log':'CreateVoiceAgentReport'});};exports[_0x972c('0x4')]=function(_0x15aab1,_0xc4bf36,_0x514f70){return client[_0x972c('0x2')](_0x972c('0x5'),{'body':_0x15aab1,'options':{'where':{'uniqueid':_0xc4bf36,'interface':_0x514f70,'agentcomplete':!![]}},'log':_0x972c('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8f72c64..4bd49c7 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 _0x8e68=['endOf','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','merge','context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format'];(function(_0x3da413,_0x25e0fb){var _0x34b629=function(_0x37c478){while(--_0x37c478){_0x3da413['push'](_0x3da413['shift']());}};_0x34b629(++_0x25e0fb);}(_0x8e68,0x76));var _0x88e6=function(_0x29ff86,_0x573427){_0x29ff86=_0x29ff86-0x0;var _0x3d3a10=_0x8e68[_0x29ff86];return _0x3d3a10;};'use strict';var moment=require(_0x88e6('0x0'));var util=require(_0x88e6('0x1'));var _=require(_0x88e6('0x2'));var client=require(_0x88e6('0x3'));exports['create']=function(_0x398e73){return client[_0x88e6('0x4')]('CreateVoiceCallReport',{'body':_[_0x88e6('0x5')](_0x398e73,{'source':_0x398e73['calleridnum'],'destinationcontext':_0x398e73[_0x88e6('0x6')],'callerid':_0x398e73['callerid'],'amaflags':_0x88e6('0x7')}),'log':_0x88e6('0x8')});};exports[_0x88e6('0x9')]=function(){return function(){return client[_0x88e6('0x4')](_0x88e6('0xa'),{'options':{'where':{'type':[_0x88e6('0xb')],'createdAt':{'$between':[moment()[_0x88e6('0xc')]('day')[_0x88e6('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x88e6('0xe')](_0x88e6('0xf'))['format'](_0x88e6('0x10'))]}},'attributes':[_0x88e6('0x11'),_0x88e6('0x12'),_0x88e6('0x13'),_0x88e6('0x14')]},'log':_0x88e6('0x15')});};}; \ No newline at end of file +var _0x1420=['lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','GetVoiceCallReports','moment','util'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x1420,0x1cc));var _0x0142=function(_0x59230f,_0x404bde){_0x59230f=_0x59230f-0x0;var _0x1ababc=_0x1420[_0x59230f];return _0x1ababc;};'use strict';var moment=require(_0x0142('0x0'));var util=require(_0x0142('0x1'));var _=require(_0x0142('0x2'));var client=require(_0x0142('0x3'));exports[_0x0142('0x4')]=function(_0x2a2c33){return client[_0x0142('0x5')](_0x0142('0x6'),{'body':_[_0x0142('0x7')](_0x2a2c33,{'source':_0x2a2c33[_0x0142('0x8')],'destinationcontext':_0x2a2c33[_0x0142('0x9')],'callerid':_0x2a2c33[_0x0142('0xa')],'amaflags':_0x0142('0xb')}),'log':_0x0142('0x6')});};exports[_0x0142('0xc')]=function(){return function(){return client[_0x0142('0x5')](_0x0142('0xd'),{'options':{'where':{'type':[_0x0142('0xe')],'createdAt':{'$between':[moment()['startOf'](_0x0142('0xf'))[_0x0142('0x10')](_0x0142('0x11')),moment()[_0x0142('0x12')]('day')['format'](_0x0142('0x11'))]}},'attributes':[_0x0142('0x13'),_0x0142('0x14'),'duration','billableseconds']},'log':_0x0142('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 5659464..330090d 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 _0x2f1a=['../client','create','Request','CreateVoiceDialReport'];(function(_0x1315b8,_0x5bcd13){var _0x3606fb=function(_0x4f4c01){while(--_0x4f4c01){_0x1315b8['push'](_0x1315b8['shift']());}};_0x3606fb(++_0x5bcd13);}(_0x2f1a,0x94));var _0xa2f1=function(_0x402b24,_0x4c9387){_0x402b24=_0x402b24-0x0;var _0x1772a2=_0x2f1a[_0x402b24];return _0x1772a2;};'use strict';var client=require(_0xa2f1('0x0'));exports[_0xa2f1('0x1')]=function(_0x2097ec){return client[_0xa2f1('0x2')](_0xa2f1('0x3'),{'body':_0x2097ec,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4681=['CreateVoiceDialReport','../client','create','Request'];(function(_0x1c7f48,_0x255687){var _0x274c31=function(_0x58e252){while(--_0x58e252){_0x1c7f48['push'](_0x1c7f48['shift']());}};_0x274c31(++_0x255687);}(_0x4681,0x159));var _0x1468=function(_0x52bf74,_0x5a1bfc){_0x52bf74=_0x52bf74-0x0;var _0x23bde5=_0x4681[_0x52bf74];return _0x23bde5;};'use strict';var client=require(_0x1468('0x0'));exports[_0x1468('0x1')]=function(_0x25bdf7){return client[_0x1468('0x2')](_0x1468('0x3'),{'body':_0x25bdf7,'log':_0x1468('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index b62a47b..1017f72 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 _0x422f=['GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x422f,0x1c7));var _0xf422=function(_0x5d4596,_0x3d9191){_0x5d4596=_0x5d4596-0x0;var _0x2a83b2=_0x422f[_0x5d4596];return _0x2a83b2;};'use strict';var client=require('../client');exports[_0xf422('0x0')]=function(){return function(){return client['Request'](_0xf422('0x1'),{'options':{'raw':!![],'attributes':['id',_0xf422('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf422('0x0')});};}; \ No newline at end of file +var _0x94dc=['recordingFormat','getVoiceExtensions','../client','Request','exten'];(function(_0x367509,_0x365d7){var _0x4f0ff7=function(_0x434277){while(--_0x434277){_0x367509['push'](_0x367509['shift']());}};_0x4f0ff7(++_0x365d7);}(_0x94dc,0xb1));var _0xc94d=function(_0x40596f,_0x5d722f){_0x40596f=_0x40596f-0x0;var _0x3382e9=_0x94dc[_0x40596f];return _0x3382e9;};'use strict';var client=require(_0xc94d('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xc94d('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xc94d('0x2'),_0xc94d('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xc94d('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 39fab9b..fd03312 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 _0x6f7f=['dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout'];(function(_0x8c0bf5,_0x2456ab){var _0x447387=function(_0x4c2469){while(--_0x4c2469){_0x8c0bf5['push'](_0x8c0bf5['shift']());}};_0x447387(++_0x2456ab);}(_0x6f7f,0x11c));var _0xf6f7=function(_0x1dce1c,_0x497547){_0x1dce1c=_0x1dce1c-0x0;var _0x4dadff=_0x6f7f[_0x1dce1c];return _0x4dadff;};'use strict';var client=require(_0xf6f7('0x0'));exports[_0xf6f7('0x1')]=function(){return function(){return client[_0xf6f7('0x2')](_0xf6f7('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0xf6f7('0x4'),'autopause',_0xf6f7('0x5'),_0xf6f7('0x6'),_0xf6f7('0x7'),'dialMethod',_0xf6f7('0x8'),_0xf6f7('0x9'),_0xf6f7('0xa'),_0xf6f7('0xb'),_0xf6f7('0xc'),_0xf6f7('0xd'),_0xf6f7('0xe'),_0xf6f7('0xf'),_0xf6f7('0x10'),_0xf6f7('0x11'),_0xf6f7('0x12'),_0xf6f7('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xf6f7('0x14'),_0xf6f7('0x15'),_0xf6f7('0x16'),_0xf6f7('0x17'),_0xf6f7('0x18'),_0xf6f7('0x19'),_0xf6f7('0x1a'),_0xf6f7('0x1b'),_0xf6f7('0x1c'),'dialAMDActive',_0xf6f7('0x1d'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xf6f7('0x1e'),_0xf6f7('0x1f'),'dialAMDBetweenWordsSilence',_0xf6f7('0x20'),_0xf6f7('0x21'),_0xf6f7('0x22'),'timeout',_0xf6f7('0x23'),_0xf6f7('0x24'),'dialOrderByScheduledAt',_0xf6f7('0x25'),_0xf6f7('0x26'),_0xf6f7('0x27'),'monitor_format',_0xf6f7('0x28'),'dialRandomLastDigitCallerIdNumber',_0xf6f7('0x29'),_0xf6f7('0x2a'),_0xf6f7('0x2b'),_0xf6f7('0x2c'),_0xf6f7('0x2d'),'dialAbandonedMaxRetry',_0xf6f7('0x2e'),_0xf6f7('0x2f'),_0xf6f7('0x30'),'dialAgentRejectMaxRetry',_0xf6f7('0x31'),'mandatoryDisposition',_0xf6f7('0x32'),_0xf6f7('0x33'),_0xf6f7('0x34'),_0xf6f7('0x35'),_0xf6f7('0x36')],'include':[{'model':_0xf6f7('0x37'),'as':_0xf6f7('0x37'),'attributes':['id',_0xf6f7('0x38'),'callerid',_0xf6f7('0x39')]},{'model':_0xf6f7('0x3a'),'as':_0xf6f7('0x3b'),'attributes':['id','name']},{'model':_0xf6f7('0x37'),'as':_0xf6f7('0x3c'),'attributes':['id','name',_0xf6f7('0x3d'),_0xf6f7('0x39')]},{'model':_0xf6f7('0x3e'),'as':_0xf6f7('0x3e'),'attributes':['id',_0xf6f7('0x38')],'include':[{'model':_0xf6f7('0x3e'),'as':'Intervals','attributes':['id',_0xf6f7('0x38'),_0xf6f7('0x3f')]}]}]},'log':_0xf6f7('0x1')});};}; \ No newline at end of file +var _0xa4b1=['dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x182a0a,_0x536d9e){var _0x2a1fd6=function(_0xcfe41){while(--_0xcfe41){_0x182a0a['push'](_0x182a0a['shift']());}};_0x2a1fd6(++_0x536d9e);}(_0xa4b1,0x9b));var _0x1a4b=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xa4b1[_0x243b2f];return _0xcb3c2d;};'use strict';var client=require(_0x1a4b('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x1a4b('0x1'),{'options':{'raw':![],'attributes':['id',_0x1a4b('0x2'),'acw',_0x1a4b('0x3'),_0x1a4b('0x4'),_0x1a4b('0x5'),_0x1a4b('0x6'),_0x1a4b('0x7'),_0x1a4b('0x8'),'dialLimitChannel',_0x1a4b('0x9'),_0x1a4b('0xa'),_0x1a4b('0xb'),_0x1a4b('0xc'),'dialPredictiveInterval',_0x1a4b('0xd'),_0x1a4b('0xe'),'dialOriginateTimeout',_0x1a4b('0xf'),_0x1a4b('0x10'),_0x1a4b('0x11'),_0x1a4b('0x12'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x1a4b('0x13'),_0x1a4b('0x14'),_0x1a4b('0x15'),_0x1a4b('0x16'),_0x1a4b('0x17'),_0x1a4b('0x18'),_0x1a4b('0x19'),_0x1a4b('0x1a'),_0x1a4b('0x1b'),'dialAMDInitialSilence','dialAMDGreeting',_0x1a4b('0x1c'),_0x1a4b('0x1d'),_0x1a4b('0x1e'),_0x1a4b('0x1f'),_0x1a4b('0x20'),_0x1a4b('0x21'),_0x1a4b('0x22'),_0x1a4b('0x23'),_0x1a4b('0x24'),_0x1a4b('0x25'),_0x1a4b('0x26'),_0x1a4b('0x27'),'dialAgiAfterHangupClient',_0x1a4b('0x28'),_0x1a4b('0x5'),_0x1a4b('0x29'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x1a4b('0x2a'),_0x1a4b('0x2b'),_0x1a4b('0x2c'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x1a4b('0x2d'),'dialMachineMaxRetry',_0x1a4b('0x2e'),_0x1a4b('0x2f'),_0x1a4b('0x30'),_0x1a4b('0x31'),_0x1a4b('0x32'),_0x1a4b('0x33'),_0x1a4b('0x34'),_0x1a4b('0x35'),_0x1a4b('0x36')],'include':[{'model':_0x1a4b('0x37'),'as':_0x1a4b('0x37'),'attributes':['id',_0x1a4b('0x2'),_0x1a4b('0x38'),_0x1a4b('0x39')]},{'model':_0x1a4b('0x3a'),'as':_0x1a4b('0x3b'),'attributes':['id','name']},{'model':_0x1a4b('0x37'),'as':_0x1a4b('0x3c'),'attributes':['id',_0x1a4b('0x2'),_0x1a4b('0x38'),_0x1a4b('0x39')]},{'model':_0x1a4b('0x3d'),'as':_0x1a4b('0x3d'),'attributes':['id',_0x1a4b('0x2')],'include':[{'model':_0x1a4b('0x3d'),'as':'Intervals','attributes':['id','name',_0x1a4b('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 2d05f7e..95e32be 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(_0x43b339,_0x213319){var _0x573f74=function(_0x591d13){while(--_0x591d13){_0x43b339['push'](_0x43b339['shift']());}};_0x573f74(++_0x213319);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x1d63a8,_0x59d03c){var _0x493164=function(_0x478305){while(--_0x478305){_0x1d63a8['push'](_0x1d63a8['shift']());}};_0x493164(++_0x59d03c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 86c5a9e..2b1ba4b 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 _0xb62c=['getVoiceQueueRtPauses','Request'];(function(_0x2b1d5a,_0x459393){var _0x463347=function(_0x5d78ba){while(--_0x5d78ba){_0x2b1d5a['push'](_0x2b1d5a['shift']());}};_0x463347(++_0x459393);}(_0xb62c,0x1be));var _0xcb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xcb62('0x0')]=function(_0x50eb28){return function(){return client[_0xcb62('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x50eb28,'paused':!![]},'raw':!![]},'log':_0xcb62('0x0')});};}; \ No newline at end of file +var _0x64f1=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0xd7885d,_0xa6f72f){var _0x381d14=function(_0xdca464){while(--_0xdca464){_0xd7885d['push'](_0xd7885d['shift']());}};_0x381d14(++_0xa6f72f);}(_0x64f1,0xe6));var _0x164f=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x64f1[_0x1fc1f9];return _0x4987ca;};'use strict';var client=require(_0x164f('0x0'));exports[_0x164f('0x1')]=function(_0x2f3b92){return function(){return client[_0x164f('0x2')](_0x164f('0x3'),{'options':{'where':{'VoiceQueueId':_0x2f3b92,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0eb2b3f..9157e81 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2d16f7,_0x1c65bc){var _0x3118ef=function(_0x3122a5){while(--_0x3122a5){_0x2d16f7['push'](_0x2d16f7['shift']());}};_0x3118ef(++_0x1c65bc);}(_0x7a54,0x106));var _0x47a5=function(_0xfd2cfa,_0x3aa175){_0xfd2cfa=_0xfd2cfa-0x0;var _0x49fc64=_0x7a54[_0xfd2cfa];return _0x49fc64;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1e16b9,_0x28833c){var _0x47b87d=function(_0x229340){while(--_0x229340){_0x1e16b9['push'](_0x1e16b9['shift']());}};_0x47b87d(++_0x28833c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 fb6a05e..03a99ac 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 _0xde29=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde29,0x112));var _0x9de2=function(_0x4a9367,_0x1f99db){_0x4a9367=_0x4a9367-0x0;var _0x300ad3=_0xde29[_0x4a9367];return _0x300ad3;};'use strict';var client=require(_0x9de2('0x0'));exports[_0x9de2('0x1')]={};exports[_0x9de2('0x2')]=function(_0x493d02){return client[_0x9de2('0x3')](_0x9de2('0x4'),{'body':{'result':_0x493d02[_0x9de2('0x5')],'transfererchannel':_0x493d02['transfererchannel'],'transferercalleridnum':_0x493d02[_0x9de2('0x6')],'transferercalleridname':_0x493d02[_0x9de2('0x7')],'transfererconnectedlinenum':_0x493d02[_0x9de2('0x8')],'transfererconnectedlinename':_0x493d02[_0x9de2('0x9')],'transfereraccountcode':_0x493d02[_0x9de2('0xa')],'transferercontext':_0x493d02[_0x9de2('0xb')],'transfererexten':_0x493d02['transfererexten'],'transfererlinkedid':_0x493d02[_0x9de2('0xc')],'transfereechannel':_0x493d02[_0x9de2('0xd')],'transfereecalleridnum':_0x493d02[_0x9de2('0xe')],'transfereecalleridname':_0x493d02[_0x9de2('0xf')],'transfereeconnectedlinenum':_0x493d02[_0x9de2('0x10')],'transfereeconnectedlinename':_0x493d02['transfereeconnectedlinename'],'transfereeaccountcode':_0x493d02[_0x9de2('0x11')],'transfereecontext':_0x493d02[_0x9de2('0x12')],'transfereeexten':_0x493d02[_0x9de2('0x13')],'transfereelinkedid':_0x493d02[_0x9de2('0x14')],'isexternal':_0x493d02[_0x9de2('0x15')],'context':_0x493d02[_0x9de2('0x16')],'extension':_0x493d02[_0x9de2('0x17')],'type':_0x9de2('0x18')},'log':'CreateVoiceTransferReport'});};exports[_0x9de2('0x19')]=function(_0x4b3a93){return client['Request'](_0x9de2('0x4'),{'body':{'result':_0x4b3a93['result'],'transfererchannel':_0x4b3a93[_0x9de2('0x1a')],'transferercalleridnum':_0x4b3a93[_0x9de2('0x1b')],'transferercalleridname':_0x4b3a93[_0x9de2('0x1c')],'transfererconnectedlinenum':_0x4b3a93[_0x9de2('0x1d')],'transfererconnectedlinename':_0x4b3a93['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4b3a93['origtransfereraccountcode'],'transferercontext':_0x4b3a93[_0x9de2('0x1e')],'transfererexten':_0x4b3a93[_0x9de2('0x1f')],'transfererlinkedid':_0x4b3a93[_0x9de2('0x20')],'transfereechannel':_0x4b3a93[_0x9de2('0x21')],'transfereecalleridnum':_0x4b3a93[_0x9de2('0x22')],'transfereecalleridname':_0x4b3a93[_0x9de2('0x23')],'transfereeconnectedlinenum':_0x4b3a93[_0x9de2('0x24')],'transfereeconnectedlinename':_0x4b3a93[_0x9de2('0x25')],'transfereeaccountcode':_0x4b3a93[_0x9de2('0x26')],'transfereecontext':_0x4b3a93[_0x9de2('0x27')],'transfereeexten':_0x4b3a93[_0x9de2('0x28')],'transfereelinkedid':_0x4b3a93['transfertargetlinkedid'],'isexternal':_0x4b3a93[_0x9de2('0x15')],'context':_0x4b3a93['origtransferercontext'],'extension':_0x4b3a93[_0x9de2('0x29')],'type':_0x9de2('0x2a')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x500f=['transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x500f,0x1c4));var _0xf500=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x500f[_0x4c4042];return _0xbd10dc;};'use strict';var client=require(_0xf500('0x0'));exports[_0xf500('0x1')]={};exports[_0xf500('0x2')]=function(_0x23da64){return client['Request'](_0xf500('0x3'),{'body':{'result':_0x23da64[_0xf500('0x4')],'transfererchannel':_0x23da64[_0xf500('0x5')],'transferercalleridnum':_0x23da64['transferercalleridnum'],'transferercalleridname':_0x23da64[_0xf500('0x6')],'transfererconnectedlinenum':_0x23da64[_0xf500('0x7')],'transfererconnectedlinename':_0x23da64['transfererconnectedlinename'],'transfereraccountcode':_0x23da64['transfereraccountcode'],'transferercontext':_0x23da64['transferercontext'],'transfererexten':_0x23da64[_0xf500('0x8')],'transfererlinkedid':_0x23da64['transfererlinkedid'],'transfereechannel':_0x23da64[_0xf500('0x9')],'transfereecalleridnum':_0x23da64[_0xf500('0xa')],'transfereecalleridname':_0x23da64[_0xf500('0xb')],'transfereeconnectedlinenum':_0x23da64[_0xf500('0xc')],'transfereeconnectedlinename':_0x23da64[_0xf500('0xd')],'transfereeaccountcode':_0x23da64[_0xf500('0xe')],'transfereecontext':_0x23da64[_0xf500('0xf')],'transfereeexten':_0x23da64[_0xf500('0x10')],'transfereelinkedid':_0x23da64['transfereelinkedid'],'isexternal':_0x23da64[_0xf500('0x11')],'context':_0x23da64[_0xf500('0x12')],'extension':_0x23da64[_0xf500('0x13')],'type':_0xf500('0x14')},'log':_0xf500('0x3')});};exports[_0xf500('0x15')]=function(_0x5e8027){return client['Request'](_0xf500('0x3'),{'body':{'result':_0x5e8027['result'],'transfererchannel':_0x5e8027[_0xf500('0x16')],'transferercalleridnum':_0x5e8027['origtransferercalleridnum'],'transferercalleridname':_0x5e8027[_0xf500('0x17')],'transfererconnectedlinenum':_0x5e8027['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5e8027[_0xf500('0x18')],'transfereraccountcode':_0x5e8027[_0xf500('0x19')],'transferercontext':_0x5e8027[_0xf500('0x1a')],'transfererexten':_0x5e8027['secondtransfererexten'],'transfererlinkedid':_0x5e8027[_0xf500('0x1b')],'transfereechannel':_0x5e8027['transfertargetchannel'],'transfereecalleridnum':_0x5e8027[_0xf500('0x1c')],'transfereecalleridname':_0x5e8027['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5e8027[_0xf500('0x1d')],'transfereeconnectedlinename':_0x5e8027[_0xf500('0x1e')],'transfereeaccountcode':_0x5e8027[_0xf500('0x1f')],'transfereecontext':_0x5e8027['transfertargetcontext'],'transfereeexten':_0x5e8027[_0xf500('0x20')],'transfereelinkedid':_0x5e8027[_0xf500('0x21')],'isexternal':_0x5e8027[_0xf500('0x11')],'context':_0x5e8027[_0xf500('0x22')],'extension':_0x5e8027['origtransfererexten'],'type':_0xf500('0x23')},'log':_0xf500('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index daebb51..64e2c87 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 _0xe3d4=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','join','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','voicechannel','map','resolve','StopMixMonitor','destinationchannel','status','stop','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','then','catch','message','command','Command','voiceQueues','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','type','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls'];(function(_0x1a5166,_0x2b6a26){var _0x3c022f=function(_0x96a350){while(--_0x96a350){_0x1a5166['push'](_0x1a5166['shift']());}};_0x3c022f(++_0x2b6a26);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x752005,_0x14dc74){_0x752005=_0x752005-0x0;var _0x40629c=_0xe3d4[_0x752005];return _0x40629c;};'use strict';var _=require('lodash');var util=require(_0x4e3d('0x0'));var jayson=require(_0x4e3d('0x1'));var schema=require(_0x4e3d('0x2'));var moment=require('moment');var config=require(_0x4e3d('0x3'));var properties=require(_0x4e3d('0x4'));var ami=require('../ami');exports[_0x4e3d('0x5')]=function(_0x4ece82,_0x438b9a,_0x46b757){return new Promise(function(_0x4fd5ff,_0x3eaf60){var _0x1d5c04={'QueuePause':function(_0x5b544d){return new Promise(function(_0x40b814){var _0x4275b0=util[_0x4e3d('0x6')](_0x4e3d('0x7'),_0x4e3d('0x8'),_0x5b544d[_0x4e3d('0x9')]);if(_0x4ece82['timers']&&_0x4ece82['timers'][_0x4275b0]&&_0x4ece82[_0x4e3d('0xa')][_0x4275b0][_0x4e3d('0xb')]){_0x4ece82[_0x4e3d('0xa')][_0x4275b0][_0x4e3d('0xc')]();}if(_0x4ece82[_0x4e3d('0xd')][_0x4275b0]){_0x4ece82[_0x4e3d('0xd')][_0x4275b0]['updateStatusRealtime']({'statePause':_0x5b544d[_0x4e3d('0xe')]?!![]:![]});}_0x40b814({'code':0xc8,'message':_0x4e3d('0xf')});});},'Reload':function(_0x2fc5f6){var _0x30b359=this;return new Promise(function(_0x3556ec,_0xfedcb8){if(ami[_0x4e3d('0x10')]()==![]){return _0xfedcb8(_0x30b359[_0x4e3d('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x4e3d('0x12')][_0x4e3d('0x13')],_0x4e3d('0x14')]['join']('\x20')));}_0x2fc5f6=_[_0x4e3d('0x15')](_0x2fc5f6,_[_0x4e3d('0x16')](properties[_0x4e3d('0x17')]));_0x2fc5f6[_0x4e3d('0x18')]=_0x4e3d('0x19');return ami[_0x4e3d('0x1a')](_0x2fc5f6)[_0x4e3d('0x1b')](function(_0x381dc0){_0x3556ec({'code':0xc8,'message':_0x381dc0['message']});})[_0x4e3d('0x1c')](function(_0x5129d5){_0xfedcb8(_0x30b359['error'](0x1f5,_0x5129d5[_0x4e3d('0x1d')]));});});},'Command':function(_0x493949){var _0x5a2389=this;return new Promise(function(_0x46b227,_0x2e37ad){if(ami[_0x4e3d('0x10')]()==![]){return _0x2e37ad(_0x5a2389[_0x4e3d('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x4e3d('0x12')]['username'],_0x4e3d('0x14')]['join']('\x20')));}_0x493949=_[_0x4e3d('0x15')](_0x493949,_0x4e3d('0x1e'));_0x493949[_0x4e3d('0x18')]=_0x4e3d('0x1f');return ami[_0x4e3d('0x1a')](_0x493949)[_0x4e3d('0x1b')](function(_0x575c72){_0x46b227({'code':0xc8,'message':_0x575c72['content']});})[_0x4e3d('0x1c')](function(_0x7a0b3c){_0x2e37ad(_0x5a2389[_0x4e3d('0x11')](0x1f5,_0x7a0b3c[_0x4e3d('0x1d')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3e6b53){var _0x58a9cb=[];for(var _0xcec7a6 in _0x4ece82[_0x4e3d('0x20')]){if(_0x4ece82[_0x4e3d('0x20')]['hasOwnProperty'](_0xcec7a6)){var _0x2434ea=_0x4ece82[_0x4e3d('0x20')][_0xcec7a6];var _0x5b1a18={'id':_0x2434ea['id'],'name':_0x2434ea[_0x4e3d('0x9')],'strategy':_0x2434ea[_0x4e3d('0x21')],'answered':_0x2434ea[_0x4e3d('0x22')],'available':_0x2434ea['available'],'loggedIn':_0x2434ea[_0x4e3d('0x23')],'pTalking':_0x2434ea['pTalking'],'sumBillable':_0x2434ea[_0x4e3d('0x24')],'sumDuration':_0x2434ea['sumDuration'],'sumHoldTime':_0x2434ea[_0x4e3d('0x25')]||0x0,'talking':_0x2434ea[_0x4e3d('0x26')],'total':_0x2434ea[_0x4e3d('0x27')],'type':_0x2434ea['type'],'unmanaged':_0x2434ea[_0x4e3d('0x28')],'abandoned':_0x2434ea[_0x4e3d('0x29')],'waiting':_0x2434ea['waiting'],'loggedInDb':_0x2434ea['loggedInDb']};if(_0x2434ea[_0x4e3d('0x2a')]===_0x4e3d('0x2b')){_0x5b1a18[_0x4e3d('0x2c')]=_0x2434ea['dialActive'];_0x5b1a18[_0x4e3d('0x2d')]=_0x2434ea[_0x4e3d('0x2d')];_0x5b1a18['dialOriginateCallerIdName']=_0x2434ea['dialOriginateCallerIdName'];_0x5b1a18[_0x4e3d('0x2e')]=_0x2434ea[_0x4e3d('0x2e')];_0x5b1a18['dialOriginateTimeout']=_0x2434ea[_0x4e3d('0x2f')];_0x5b1a18['dialPrefix']=_0x2434ea[_0x4e3d('0x30')];_0x5b1a18[_0x4e3d('0x31')]=_0x2434ea['temp'];_0x5b1a18[_0x4e3d('0x32')]=_0x2434ea[_0x4e3d('0x32')];_0x5b1a18[_0x4e3d('0x33')]=_0x2434ea['outboundAnswerCallsDay'];_0x5b1a18[_0x4e3d('0x34')]=_0x2434ea[_0x4e3d('0x34')];_0x5b1a18['outboundBusyCallsDay']=_0x2434ea[_0x4e3d('0x35')];_0x5b1a18[_0x4e3d('0x36')]=_0x2434ea['outboundCongestionCallsDay'];_0x5b1a18[_0x4e3d('0x37')]=_0x2434ea[_0x4e3d('0x37')];_0x5b1a18[_0x4e3d('0x38')]=_0x2434ea[_0x4e3d('0x38')];_0x5b1a18[_0x4e3d('0x39')]=_0x2434ea[_0x4e3d('0x39')];_0x5b1a18[_0x4e3d('0x3a')]=_0x2434ea[_0x4e3d('0x3a')];_0x5b1a18[_0x4e3d('0x3b')]=_0x2434ea[_0x4e3d('0x3b')];_0x5b1a18[_0x4e3d('0x3c')]=_0x2434ea['outboundOriginateFailureCallsDay'];_0x5b1a18[_0x4e3d('0x3d')]=_0x2434ea[_0x4e3d('0x3d')];_0x5b1a18[_0x4e3d('0x3e')]=_0x2434ea[_0x4e3d('0x3e')];_0x5b1a18[_0x4e3d('0x3f')]=_0x2434ea[_0x4e3d('0x3f')];_0x5b1a18['predictiveIntervalAnsweredCalls']=_0x2434ea[_0x4e3d('0x40')];_0x5b1a18[_0x4e3d('0x41')]=_0x2434ea[_0x4e3d('0x41')];_0x5b1a18[_0x4e3d('0x42')]=_0x2434ea[_0x4e3d('0x42')];_0x5b1a18[_0x4e3d('0x43')]=_0x2434ea[_0x4e3d('0x43')];_0x5b1a18[_0x4e3d('0x44')]=_0x2434ea[_0x4e3d('0x44')];_0x5b1a18[_0x4e3d('0x45')]=_0x2434ea[_0x4e3d('0x45')];_0x5b1a18[_0x4e3d('0x46')]=_0x2434ea[_0x4e3d('0x46')];_0x5b1a18[_0x4e3d('0x47')]=_0x2434ea[_0x4e3d('0x47')];_0x5b1a18['predictiveIntervalMultiplicativeFactor']=_0x2434ea[_0x4e3d('0x48')];_0x5b1a18['predictiveIntervalPauses']=_0x2434ea[_0x4e3d('0x49')];_0x5b1a18[_0x4e3d('0x4a')]=_0x2434ea[_0x4e3d('0x4a')];_0x5b1a18[_0x4e3d('0x4b')]=_0x2434ea[_0x4e3d('0x4b')];_0x5b1a18[_0x4e3d('0x1d')]=_0x2434ea['message'];_0x5b1a18[_0x4e3d('0x4c')]=_0x2434ea[_0x4e3d('0x4c')];_0x5b1a18[_0x4e3d('0x4d')]=_0x2434ea[_0x4e3d('0x4d')];_0x5b1a18[_0x4e3d('0x4e')]=_0x2434ea['erlangCallToSecond'];_0x5b1a18['erlangAbandonmentRate']=_0x2434ea[_0x4e3d('0x4f')];_0x5b1a18[_0x4e3d('0x50')]=_0x2434ea[_0x4e3d('0x50')];_0x5b1a18['startPredictive']=_0x2434ea[_0x4e3d('0x51')];_0x5b1a18[_0x4e3d('0x52')]=_0x2434ea['startProgressive'];}if(_0x2434ea[_0x4e3d('0x53')]){_0x5b1a18['Trunk']={'id':_0x2434ea[_0x4e3d('0x53')]['id'],'name':_0x2434ea[_0x4e3d('0x53')][_0x4e3d('0x9')],'active':_0x2434ea['Trunk'][_0x4e3d('0x54')],'callerid':_0x2434ea['Trunk'][_0x4e3d('0x55')]};}if(_0x2434ea[_0x4e3d('0x56')]){_0x5b1a18[_0x4e3d('0x56')]={'id':_0x2434ea['Interval']['id'],'name':_0x2434ea[_0x4e3d('0x56')][_0x4e3d('0x9')]};}_0x58a9cb[_0x4e3d('0x57')](_0x5b1a18);}}_0x3e6b53({'count':_0x58a9cb[_0x4e3d('0x58')],'rows':_0x58a9cb});});},'UpdateVoiceQueue':function(_0x44926a){return new Promise(function(_0x2dad49,_0xee533a){var _0xa3ff1f=_[_0x4e3d('0x59')](_0x4ece82[_0x4e3d('0x20')],{'id':parseInt(_0x44926a['id'])});var _0x5430e5=_[_0x4e3d('0x5a')](_0x44926a,['id']);if(_0xa3ff1f){for(var _0x81f3a8 in _0x5430e5){if(typeof _0x5430e5[_0x81f3a8]!==_0x4e3d('0x5b')&&typeof _0xa3ff1f[_0x81f3a8]!==_0x4e3d('0x5b')){_0xa3ff1f[_0x81f3a8]=_0x5430e5[_0x81f3a8];}}_0x2dad49(_0xa3ff1f);}else{_0xee533a();}});},'VoiceChannels':function(){return new Promise(function(_0x145ea8){var _0xa88e0=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x5d')]);_0x145ea8({'count':_0xa88e0[_0x4e3d('0x58')],'rows':_0xa88e0});});},'VoiceChannelMixMonitor':function(_0x8b1cf){var _0x21ab53=this;return new Promise(function(_0x63bcae,_0x4fba01){if(ami['isConnected']()==![]){return _0x4fba01(_0x21ab53[_0x4e3d('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x4e3d('0x12')][_0x4e3d('0x13')],_0x4e3d('0x14')][_0x4e3d('0x5e')]('\x20')));}var _0x403fa7=schema(properties['voicechannel'])[_0x4e3d('0x2')](_0x8b1cf);if(_0x403fa7[_0x4e3d('0x58')]>0x0){return _0x4fba01(_0x21ab53['error'](0x1f4,_['map'](_0x403fa7,'message')['join'](',\x20')));}var _0x393854=_[_0x4e3d('0x59')](_0x4ece82[_0x4e3d('0x5d')],{'uniqueid':_0x8b1cf[_0x4e3d('0x5f')]});if(_0x393854&&_0x393854[_0x4e3d('0x60')]){var _0x2c59ec=util[_0x4e3d('0x6')]('%s.%s',_0x8b1cf[_0x4e3d('0x61')]||_0x8b1cf[_0x4e3d('0x5f')],_0x8b1cf[_0x4e3d('0x6')]||_0x4e3d('0x62'));return ami['Action']({'action':_0x4e3d('0x63'),'channel':_0x393854[_0x4e3d('0x60')],'file':_0x2c59ec,'options':_0x4e3d('0x64')})[_0x4e3d('0x1b')](function(_0x4b074a){var _0x46bd1a=_[_0x4e3d('0x59')](_0x393854[_0x4e3d('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x2c59ec[_0x4e3d('0x66')]()});if(_[_0x4e3d('0x67')](_0x46bd1a)){_0x393854['monitors']['push']({'filename':_0x4e3d('0x68')+_0x2c59ec[_0x4e3d('0x66')](),'createdAt':moment()[_0x4e3d('0x6')](_0x4e3d('0x69')),'mixmonitorid':_0x4b074a[_0x4e3d('0x6a')],'status':'rec'});}else{_0x46bd1a['mixmonitorid']=_0x4b074a[_0x4e3d('0x6a')];_0x46bd1a['status']=_0x4e3d('0x6b');}_0x63bcae({'code':0xc8,'message':[_0x8b1cf[_0x4e3d('0x5f')],'MixMonitor\x20Success',_0x4b074a[_0x4e3d('0x6a')]][_0x4e3d('0x5e')]('\x20'),'mixmonitorid':_0x4b074a['mixmonitorid']});})[_0x4e3d('0x1c')](function(_0x518dda){_0x4fba01(_0x21ab53[_0x4e3d('0x11')](0x1f5,[_0x8b1cf[_0x4e3d('0x5f')],_0x518dda[_0x4e3d('0x1d')]['toLowerCase']()][_0x4e3d('0x5e')]('\x20')));});}else{return _0x4fba01(_0x21ab53['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x18d4f8){var _0xb9f752=this;return new Promise(function(_0x726f33,_0x30cbb0){if(ami[_0x4e3d('0x10')]()==![]){return _0x30cbb0(_0xb9f752['error'](0x1f4,[config[_0x4e3d('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}var _0x2958ca=schema(properties[_0x4e3d('0x6c')])[_0x4e3d('0x2')](_0x18d4f8);if(_0x2958ca[_0x4e3d('0x58')]>0x0){return _0x30cbb0(_0xb9f752[_0x4e3d('0x11')](0x1f4,_[_0x4e3d('0x6d')](_0x2958ca,_0x4e3d('0x1d'))[_0x4e3d('0x5e')](',\x20')));}var _0x1334c2=_['find'](_0x4ece82[_0x4e3d('0x5d')],{'uniqueid':_0x18d4f8[_0x4e3d('0x5f')]});if(_0x1334c2){return Promise[_0x4e3d('0x6e')]()['then'](function(){if(_0x1334c2['channel']){return ami[_0x4e3d('0x1a')]({'action':_0x4e3d('0x6f'),'channel':_0x1334c2[_0x4e3d('0x60')],'mixmonitorid':_0x18d4f8[_0x4e3d('0x6a')]})[_0x4e3d('0x1c')](function(){});}})[_0x4e3d('0x1b')](function(){if(_0x1334c2[_0x4e3d('0x70')]){return ami[_0x4e3d('0x1a')]({'action':_0x4e3d('0x6f'),'channel':_0x1334c2[_0x4e3d('0x70')],'mixmonitorid':_0x18d4f8[_0x4e3d('0x6a')]})['catch'](function(){});}})[_0x4e3d('0x1b')](function(){var _0x19e760=_[_0x4e3d('0x59')](_0x1334c2['monitors'],{'mixmonitorid':_0x18d4f8[_0x4e3d('0x6a')]});if(_0x19e760){_0x19e760[_0x4e3d('0x71')]=_0x4e3d('0x72');}})[_0x4e3d('0x1b')](function(){var _0x1f47eb=util[_0x4e3d('0x6')]('%s.%s',_0x18d4f8[_0x4e3d('0x61')]||_0x18d4f8[_0x4e3d('0x5f')],_0x18d4f8['format']||_0x4e3d('0x62'));var _0x3839e0=_['find'](_0x1334c2['monitors'],{'filename':_0x4e3d('0x68')+_0x1f47eb[_0x4e3d('0x66')]()});if(_0x3839e0){_0x3839e0[_0x4e3d('0x71')]='stop';}})[_0x4e3d('0x1b')](function(){_0x726f33({'code':0xc8,'message':[_0x18d4f8['uniqueid'],'StopMixMonitor\x20Success'][_0x4e3d('0x5e')]('\x20')});})[_0x4e3d('0x1c')](function(_0x594ef0){_0x30cbb0(_0xb9f752['error'](0x1f5,[_0x18d4f8[_0x4e3d('0x5f')],_0x594ef0[_0x4e3d('0x1d')][_0x4e3d('0x66')]()][_0x4e3d('0x5e')]('\x20')));});}else{return _0x30cbb0(_0xb9f752[_0x4e3d('0x11')](0x1f5,_0x4e3d('0x73')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x272382){var _0x597ec0=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x74')]);_0x272382({'count':_0x597ec0[_0x4e3d('0x58')],'rows':_0x597ec0});});},'VoiceQueuesChannel':function(_0x92e147){var _0x523dec=this;return new Promise(function(_0x5cd6a3,_0x41f6db){var _0x1a70d6=schema(properties[_0x4e3d('0x75')])[_0x4e3d('0x2')](_0x92e147);if(_0x1a70d6[_0x4e3d('0x58')]>0x0){return _0x41f6db(_0x523dec[_0x4e3d('0x11')](0x1f4,_[_0x4e3d('0x6d')](_0x1a70d6,'message')[_0x4e3d('0x5e')](',\x20')));}var _0x8bc195=_[_0x4e3d('0x59')](_0x4ece82[_0x4e3d('0x74')],{'uniqueid':_0x92e147[_0x4e3d('0x5f')]});if(_0x8bc195){_0x5cd6a3(_0x8bc195);}else{return _0x41f6db(_0x523dec[_0x4e3d('0x11')](0x1f5,_0x4e3d('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x2e7d5c){var _0x388c2a=this;return new Promise(function(_0x592ee3,_0x125526){if(ami[_0x4e3d('0x10')]()==![]){return _0x125526(_0x388c2a[_0x4e3d('0x11')](0x1f4,[config[_0x4e3d('0x12')]['ip'],config['asterisk'][_0x4e3d('0x13')],_0x4e3d('0x14')][_0x4e3d('0x5e')]('\x20')));}var _0x5079b9=schema(properties[_0x4e3d('0x76')])[_0x4e3d('0x2')](_0x2e7d5c);if(_0x5079b9[_0x4e3d('0x58')]>0x0){return _0x125526(_0x388c2a[_0x4e3d('0x11')](0x1f4,_[_0x4e3d('0x6d')](_0x5079b9,_0x4e3d('0x1d'))[_0x4e3d('0x5e')](',\x20')));}var _0x2725e0=_[_0x4e3d('0x59')](_0x4ece82['queueChannels'],{'uniqueid':_0x2e7d5c[_0x4e3d('0x5f')]});if(_0x2725e0&&_0x2725e0[_0x4e3d('0x60')]){return ami[_0x4e3d('0x1a')]({'action':_0x4e3d('0x77'),'channel':_0x2725e0['channel']})['then'](function(_0x337629){_0x592ee3({'code':0xc8,'message':[_0x2e7d5c[_0x4e3d('0x5f')],_0x337629[_0x4e3d('0x1d')]['toLowerCase']()][_0x4e3d('0x5e')]('\x20')});})[_0x4e3d('0x1c')](function(_0x58f1c7){_0x125526(_0x388c2a[_0x4e3d('0x11')](0x1f5,[_0x2e7d5c[_0x4e3d('0x5f')],_0x58f1c7[_0x4e3d('0x1d')][_0x4e3d('0x66')]()]['join']('\x20')));});}else{return _0x125526(_0x388c2a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x363f71){var _0x5895f7=this;return new Promise(function(_0x5a26a6,_0x4bb959){if(ami[_0x4e3d('0x10')]()==![]){return _0x4bb959(_0x5895f7[_0x4e3d('0x11')](0x1f4,[config[_0x4e3d('0x12')]['ip'],config[_0x4e3d('0x12')][_0x4e3d('0x13')],_0x4e3d('0x14')][_0x4e3d('0x5e')]('\x20')));}var _0x37dac9=schema(properties[_0x4e3d('0x78')])[_0x4e3d('0x2')](_0x363f71);if(_0x37dac9['length']>0x0){return _0x4bb959(_0x5895f7[_0x4e3d('0x11')](0x1f4,_[_0x4e3d('0x6d')](_0x37dac9,_0x4e3d('0x1d'))[_0x4e3d('0x5e')](',\x20')));}var _0x282e03=_[_0x4e3d('0x59')](_0x4ece82[_0x4e3d('0x74')],{'uniqueid':_0x363f71[_0x4e3d('0x5f')]});if(_0x282e03&&_0x282e03['channel']){return ami[_0x4e3d('0x1a')]({'action':_0x4e3d('0x79'),'channel':_0x282e03[_0x4e3d('0x60')],'exten':_0x363f71[_0x4e3d('0x7a')],'context':_0x363f71['context']||_0x282e03[_0x4e3d('0x7b')],'priority':0x1})['then'](function(_0x2facbe){_0x5a26a6({'code':0xc8,'message':[_0x363f71[_0x4e3d('0x5f')],_0x2facbe[_0x4e3d('0x1d')][_0x4e3d('0x66')]()][_0x4e3d('0x5e')]('\x20')});})[_0x4e3d('0x1c')](function(_0x42a7b0){_0x4bb959(_0x5895f7[_0x4e3d('0x11')](0x1f5,[_0x363f71[_0x4e3d('0x5f')],_0x42a7b0[_0x4e3d('0x1d')][_0x4e3d('0x66')]()][_0x4e3d('0x5e')]('\x20')));});}else{return _0x4bb959(_0x5895f7[_0x4e3d('0x11')](0x1f5,_0x4e3d('0x73')));}});},'Agents':function(_0x14f259){return new Promise(function(_0x125691){var _0x443bac=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0xd')]);if(_0x14f259&&_0x14f259['id']){var _0x38f5a1=_[_0x4e3d('0x59')](_0x443bac,function(_0x1455cb){return _0x1455cb['id']===_0x14f259['id'];});_0x125691(_0x38f5a1);}else{_0x125691({'count':_0x443bac[_0x4e3d('0x58')],'rows':_0x443bac});}});},'Telephones':function(){return new Promise(function(_0x37990b){var _0x417ad4=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x7c')]);_0x37990b({'count':_0x417ad4[_0x4e3d('0x58')],'rows':_0x417ad4});});},'Trunks':function(){return new Promise(function(_0x4a7469){var _0x54af5b=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x7d')]);_0x4a7469({'count':_0x54af5b[_0x4e3d('0x58')],'rows':_0x54af5b});});},'OutboundChannels':function(){return new Promise(function(_0x3d9c0d){var _0x442ba7=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x7e')]);_0x3d9c0d({'count':_0x442ba7[_0x4e3d('0x58')],'rows':_0x442ba7});});},'Outbound':function(){return new Promise(function(_0x3cad3a){_0x3cad3a(_0x4ece82[_0x4e3d('0x2b')]);});},'Campaigns':function(){return new Promise(function(_0x30e260){var _0x1129ca=_[_0x4e3d('0x5c')](_0x4ece82['campaigns']);_0x30e260({'count':_0x1129ca['length'],'rows':_0x1129ca});});},'VoiceQueuesPreview':function(_0x5b8bc1){var _0x43bbde=this;return new Promise(function(_0x14ec13,_0x58fe2d){_0x438b9a['run'](_0x5b8bc1['id'])[_0x4e3d('0x1b')](function(_0x1eb37d){_0x14ec13({'code':0xc8,'message':_0x1eb37d[_0x4e3d('0x1d')]});})[_0x4e3d('0x1c')](function(_0x5549e9){_0x58fe2d(_0x43bbde['error'](0x1f4,_0x5549e9['message']));});});},'EventManager':function(_0x102132){var _0x29db4b=this;return new Promise(function(_0x2ecc83,_0x2e4d32){if(!_0x102132['event']){return _0x2e4d32(_0x29db4b['error'](0x1f4,_0x4e3d('0x7f')));}ami['emit'](_0x4e3d('0x80')+_0x102132['event'],_0x102132['message']);_0x2ecc83({'code':0xc8,'message':_0x102132});});},'FaxAccounts':function(){return new Promise(function(_0x34e65f){var _0x48dbf5=_[_0x4e3d('0x5c')](_0x4ece82[_0x4e3d('0x81')]);_0x34e65f({'count':_0x48dbf5[_0x4e3d('0x58')],'rows':_0x48dbf5});});},'SendFax':function(_0x647fbb){var _0x298fc6=this;return new Promise(function(_0x415708,_0x224874){_0x46b757[_0x4e3d('0x82')](_0x647fbb)['then'](function(_0x9edce3){_0x415708({'code':0xc8,'message':_0x9edce3['message']});})['catch'](function(_0x38ba1f){_0x224874(_0x298fc6[_0x4e3d('0x11')](0x1f4,_0x38ba1f[_0x4e3d('0x1d')]));});});},'CheckAfterSend':function(_0xd80c52){var _0x343253=this;return new Promise(function(_0x5f0bd4,_0x23cae0){_0x46b757[_0x4e3d('0x83')](_0xd80c52)[_0x4e3d('0x1b')](function(_0x3355d5){_0x5f0bd4({'code':0xc8,'message':_0x3355d5['message']});})['catch'](function(_0x1aaae1){_0x23cae0(_0x343253[_0x4e3d('0x11')](0x1f4,_0x1aaae1[_0x4e3d('0x1d')]));});});}};var _0x2fd93b=jayson[_0x4e3d('0x84')](_0x1d5c04)[_0x4e3d('0x85')]();_0x2fd93b['on']('error',function(_0x294bd4){return _0x3eaf60(_0x294bd4);});_0x2fd93b[_0x4e3d('0x5')](0x232a,_0x4e3d('0x86'),function(){console[_0x4e3d('0x87')](_0x4e3d('0x88'),0x232a);return _0x4fd5ff(_0x4e3d('0x89')+0x232a);});});}; \ No newline at end of file +var _0x5423=['loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','find','omit','values','channels','length','ami\x20disconnected','voicechannel','map','uniqueid','channel','%s.%s','filename','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','run','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','Reload','Action','message','catch','command','Command','then','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x5423,0xe3));var _0x3542=function(_0x4e8b2b,_0x324d09){_0x4e8b2b=_0x4e8b2b-0x0;var _0x73e9eb=_0x5423[_0x4e8b2b];return _0x73e9eb;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var jayson=require('jayson/promise');var schema=require(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var config=require('../../../config/environment');var properties=require(_0x3542('0x4'));var ami=require(_0x3542('0x5'));exports[_0x3542('0x6')]=function(_0x2a1864,_0x54ea2f,_0x8ba9d5){return new Promise(function(_0x2d2ae9,_0x15ee3b){var _0x29c3fa={'QueuePause':function(_0x2e1a62){return new Promise(function(_0x55413c){var _0x4cdc86=util[_0x3542('0x7')](_0x3542('0x8'),'SIP',_0x2e1a62[_0x3542('0x9')]);if(_0x2a1864[_0x3542('0xa')]&&_0x2a1864['timers'][_0x4cdc86]&&_0x2a1864[_0x3542('0xa')][_0x4cdc86][_0x3542('0xb')]){_0x2a1864['timers'][_0x4cdc86][_0x3542('0xc')]();}if(_0x2a1864[_0x3542('0xd')][_0x4cdc86]){_0x2a1864[_0x3542('0xd')][_0x4cdc86][_0x3542('0xe')]({'statePause':_0x2e1a62[_0x3542('0xf')]?!![]:![]});}_0x55413c({'code':0xc8,'message':_0x3542('0x10')});});},'Reload':function(_0x1cf710){var _0x43e977=this;return new Promise(function(_0x4ee86,_0x1a9062){if(ami[_0x3542('0x11')]()==![]){return _0x1a9062(_0x43e977[_0x3542('0x12')](0x1f4,[config[_0x3542('0x13')]['ip'],config['asterisk'][_0x3542('0x14')],'ami\x20disconnected'][_0x3542('0x15')]('\x20')));}_0x1cf710=_[_0x3542('0x16')](_0x1cf710,_[_0x3542('0x17')](properties['module']));_0x1cf710[_0x3542('0x18')]=_0x3542('0x19');return ami[_0x3542('0x1a')](_0x1cf710)['then'](function(_0x1ea67b){_0x4ee86({'code':0xc8,'message':_0x1ea67b[_0x3542('0x1b')]});})[_0x3542('0x1c')](function(_0x3d5199){_0x1a9062(_0x43e977['error'](0x1f5,_0x3d5199[_0x3542('0x1b')]));});});},'Command':function(_0x53d4aa){var _0x2fa983=this;return new Promise(function(_0x369e0c,_0x4d93bc){if(ami[_0x3542('0x11')]()==![]){return _0x4d93bc(_0x2fa983[_0x3542('0x12')](0x1f4,[config[_0x3542('0x13')]['ip'],config[_0x3542('0x13')][_0x3542('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x53d4aa=_['pick'](_0x53d4aa,_0x3542('0x1d'));_0x53d4aa['action']=_0x3542('0x1e');return ami['Action'](_0x53d4aa)[_0x3542('0x1f')](function(_0x55774d){_0x369e0c({'code':0xc8,'message':_0x55774d['content']});})[_0x3542('0x1c')](function(_0xe3f983){_0x4d93bc(_0x2fa983['error'](0x1f5,_0xe3f983['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x3fc964){var _0x5123f0=[];for(var _0x160caa in _0x2a1864[_0x3542('0x20')]){if(_0x2a1864[_0x3542('0x20')][_0x3542('0x21')](_0x160caa)){var _0x298763=_0x2a1864[_0x3542('0x20')][_0x160caa];var _0x412184={'id':_0x298763['id'],'name':_0x298763[_0x3542('0x9')],'strategy':_0x298763[_0x3542('0x22')],'answered':_0x298763[_0x3542('0x23')],'available':_0x298763[_0x3542('0x24')],'loggedIn':_0x298763[_0x3542('0x25')],'pTalking':_0x298763[_0x3542('0x26')],'sumBillable':_0x298763[_0x3542('0x27')],'sumDuration':_0x298763[_0x3542('0x28')],'sumHoldTime':_0x298763[_0x3542('0x29')]||0x0,'talking':_0x298763[_0x3542('0x2a')],'total':_0x298763[_0x3542('0x2b')],'type':_0x298763[_0x3542('0x2c')],'unmanaged':_0x298763['unmanaged'],'abandoned':_0x298763[_0x3542('0x2d')],'waiting':_0x298763[_0x3542('0x2e')],'loggedInDb':_0x298763[_0x3542('0x2f')]};if(_0x298763['type']===_0x3542('0x30')){_0x412184[_0x3542('0x31')]=_0x298763[_0x3542('0x31')];_0x412184[_0x3542('0x32')]=_0x298763['dialMethod'];_0x412184['dialOriginateCallerIdName']=_0x298763[_0x3542('0x33')];_0x412184[_0x3542('0x34')]=_0x298763[_0x3542('0x34')];_0x412184[_0x3542('0x35')]=_0x298763[_0x3542('0x35')];_0x412184[_0x3542('0x36')]=_0x298763[_0x3542('0x36')];_0x412184['temp']=_0x298763['temp'];_0x412184[_0x3542('0x37')]=_0x298763['outboundAnswerAgiCallsDay'];_0x412184['outboundAnswerCallsDay']=_0x298763[_0x3542('0x38')];_0x412184['outboundBlacklistCallsDay']=_0x298763['outboundBlacklistCallsDay'];_0x412184[_0x3542('0x39')]=_0x298763[_0x3542('0x39')];_0x412184[_0x3542('0x3a')]=_0x298763['outboundCongestionCallsDay'];_0x412184[_0x3542('0x3b')]=_0x298763['outboundDropCallsDayACS'];_0x412184[_0x3542('0x3c')]=_0x298763[_0x3542('0x3c')];_0x412184['outboundDropCallsDayTimeout']=_0x298763[_0x3542('0x3d')];_0x412184['outboundNoAnswerCallsDay']=_0x298763[_0x3542('0x3e')];_0x412184[_0x3542('0x3f')]=_0x298763[_0x3542('0x3f')];_0x412184['outboundOriginateFailureCallsDay']=_0x298763[_0x3542('0x40')];_0x412184['outboundReCallsDay']=_0x298763[_0x3542('0x41')];_0x412184[_0x3542('0x42')]=_0x298763[_0x3542('0x42')];_0x412184[_0x3542('0x43')]=_0x298763[_0x3542('0x43')];_0x412184[_0x3542('0x44')]=_0x298763[_0x3542('0x44')];_0x412184[_0x3542('0x45')]=_0x298763[_0x3542('0x45')];_0x412184[_0x3542('0x46')]=_0x298763[_0x3542('0x46')];_0x412184[_0x3542('0x47')]=_0x298763[_0x3542('0x47')];_0x412184['predictiveIntervalDroppedCallsTimeout']=_0x298763[_0x3542('0x48')];_0x412184['predictiveIntervalErlangCalls']=_0x298763['predictiveIntervalErlangCalls'];_0x412184[_0x3542('0x49')]=_0x298763[_0x3542('0x49')];_0x412184[_0x3542('0x4a')]=_0x298763[_0x3542('0x4a')];_0x412184[_0x3542('0x4b')]=_0x298763[_0x3542('0x4b')];_0x412184[_0x3542('0x4c')]=_0x298763[_0x3542('0x4c')];_0x412184['predictiveIntervalAvailable']=_0x298763[_0x3542('0x4d')];_0x412184['predictiveIntervalTotalCalls']=_0x298763[_0x3542('0x4e')];_0x412184[_0x3542('0x1b')]=_0x298763['message'];_0x412184[_0x3542('0x4f')]=_0x298763[_0x3542('0x4f')];_0x412184['erlangCalls']=_0x298763[_0x3542('0x50')];_0x412184[_0x3542('0x51')]=_0x298763['erlangCallToSecond'];_0x412184[_0x3542('0x52')]=_0x298763[_0x3542('0x52')];_0x412184[_0x3542('0x53')]=_0x298763[_0x3542('0x53')];_0x412184[_0x3542('0x54')]=_0x298763[_0x3542('0x54')];_0x412184[_0x3542('0x55')]=_0x298763['startProgressive'];}if(_0x298763['Trunk']){_0x412184[_0x3542('0x56')]={'id':_0x298763[_0x3542('0x56')]['id'],'name':_0x298763[_0x3542('0x56')][_0x3542('0x9')],'active':_0x298763[_0x3542('0x56')]['active'],'callerid':_0x298763[_0x3542('0x56')]['callerid']};}if(_0x298763[_0x3542('0x57')]){_0x412184[_0x3542('0x57')]={'id':_0x298763[_0x3542('0x57')]['id'],'name':_0x298763['Interval'][_0x3542('0x9')]};}_0x5123f0[_0x3542('0x58')](_0x412184);}}_0x3fc964({'count':_0x5123f0['length'],'rows':_0x5123f0});});},'UpdateVoiceQueue':function(_0x4090d0){return new Promise(function(_0x4491f3,_0x1ee217){var _0x2e5947=_[_0x3542('0x59')](_0x2a1864[_0x3542('0x20')],{'id':parseInt(_0x4090d0['id'])});var _0x2da4f4=_[_0x3542('0x5a')](_0x4090d0,['id']);if(_0x2e5947){for(var _0x5bfd88 in _0x2da4f4){if(typeof _0x2da4f4[_0x5bfd88]!=='undefined'&&typeof _0x2e5947[_0x5bfd88]!=='undefined'){_0x2e5947[_0x5bfd88]=_0x2da4f4[_0x5bfd88];}}_0x4491f3(_0x2e5947);}else{_0x1ee217();}});},'VoiceChannels':function(){return new Promise(function(_0x3b3719){var _0x3b48a4=_[_0x3542('0x5b')](_0x2a1864[_0x3542('0x5c')]);_0x3b3719({'count':_0x3b48a4[_0x3542('0x5d')],'rows':_0x3b48a4});});},'VoiceChannelMixMonitor':function(_0x1ef74c){var _0x7dbe54=this;return new Promise(function(_0x5adf34,_0x157683){if(ami[_0x3542('0x11')]()==![]){return _0x157683(_0x7dbe54[_0x3542('0x12')](0x1f4,[config[_0x3542('0x13')]['ip'],config['asterisk'][_0x3542('0x14')],_0x3542('0x5e')]['join']('\x20')));}var _0x528f8c=schema(properties[_0x3542('0x5f')])[_0x3542('0x2')](_0x1ef74c);if(_0x528f8c[_0x3542('0x5d')]>0x0){return _0x157683(_0x7dbe54[_0x3542('0x12')](0x1f4,_[_0x3542('0x60')](_0x528f8c,_0x3542('0x1b'))[_0x3542('0x15')](',\x20')));}var _0x594189=_[_0x3542('0x59')](_0x2a1864[_0x3542('0x5c')],{'uniqueid':_0x1ef74c[_0x3542('0x61')]});if(_0x594189&&_0x594189[_0x3542('0x62')]){var _0x1ebc82=util[_0x3542('0x7')](_0x3542('0x63'),_0x1ef74c[_0x3542('0x64')]||_0x1ef74c[_0x3542('0x61')],_0x1ef74c['format']||'wav');return ami[_0x3542('0x1a')]({'action':'MixMonitor','channel':_0x594189['channel'],'file':_0x1ebc82,'options':'ai(mixmonitorid)'})[_0x3542('0x1f')](function(_0xd5c5c3){var _0x381885=_['find'](_0x594189[_0x3542('0x65')],{'filename':_0x3542('0x66')+_0x1ebc82['toLowerCase']()});if(_[_0x3542('0x67')](_0x381885)){_0x594189[_0x3542('0x65')][_0x3542('0x58')]({'filename':_0x3542('0x66')+_0x1ebc82[_0x3542('0x68')](),'createdAt':moment()['format'](_0x3542('0x69')),'mixmonitorid':_0xd5c5c3[_0x3542('0x6a')],'status':_0x3542('0x6b')});}else{_0x381885[_0x3542('0x6a')]=_0xd5c5c3[_0x3542('0x6a')];_0x381885['status']='rec';}_0x5adf34({'code':0xc8,'message':[_0x1ef74c[_0x3542('0x61')],_0x3542('0x6c'),_0xd5c5c3[_0x3542('0x6a')]]['join']('\x20'),'mixmonitorid':_0xd5c5c3[_0x3542('0x6a')]});})[_0x3542('0x1c')](function(_0x274722){_0x157683(_0x7dbe54[_0x3542('0x12')](0x1f5,[_0x1ef74c[_0x3542('0x61')],_0x274722['message']['toLowerCase']()][_0x3542('0x15')]('\x20')));});}else{return _0x157683(_0x7dbe54['error'](0x1f5,_0x3542('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x3610b7){var _0x5cbe76=this;return new Promise(function(_0x1c5bd3,_0x422535){if(ami[_0x3542('0x11')]()==![]){return _0x422535(_0x5cbe76[_0x3542('0x12')](0x1f4,[config[_0x3542('0x13')]['ip'],config['asterisk']['username'],_0x3542('0x5e')]['join']('\x20')));}var _0x1ffa0a=schema(properties[_0x3542('0x5f')])[_0x3542('0x2')](_0x3610b7);if(_0x1ffa0a['length']>0x0){return _0x422535(_0x5cbe76[_0x3542('0x12')](0x1f4,_[_0x3542('0x60')](_0x1ffa0a,_0x3542('0x1b'))[_0x3542('0x15')](',\x20')));}var _0x1bf743=_[_0x3542('0x59')](_0x2a1864['channels'],{'uniqueid':_0x3610b7[_0x3542('0x61')]});if(_0x1bf743){return Promise[_0x3542('0x6e')]()[_0x3542('0x1f')](function(){if(_0x1bf743[_0x3542('0x62')]){return ami[_0x3542('0x1a')]({'action':_0x3542('0x6f'),'channel':_0x1bf743['channel'],'mixmonitorid':_0x3610b7[_0x3542('0x6a')]})[_0x3542('0x1c')](function(){});}})[_0x3542('0x1f')](function(){if(_0x1bf743[_0x3542('0x70')]){return ami['Action']({'action':_0x3542('0x6f'),'channel':_0x1bf743[_0x3542('0x70')],'mixmonitorid':_0x3610b7['mixmonitorid']})['catch'](function(){});}})[_0x3542('0x1f')](function(){var _0x522422=_[_0x3542('0x59')](_0x1bf743['monitors'],{'mixmonitorid':_0x3610b7['mixmonitorid']});if(_0x522422){_0x522422[_0x3542('0x71')]=_0x3542('0x72');}})[_0x3542('0x1f')](function(){var _0x3bba0d=util[_0x3542('0x7')](_0x3542('0x63'),_0x3610b7[_0x3542('0x64')]||_0x3610b7['uniqueid'],_0x3610b7[_0x3542('0x7')]||_0x3542('0x73'));var _0x16faf1=_[_0x3542('0x59')](_0x1bf743[_0x3542('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x3bba0d[_0x3542('0x68')]()});if(_0x16faf1){_0x16faf1[_0x3542('0x71')]=_0x3542('0x72');}})[_0x3542('0x1f')](function(){_0x1c5bd3({'code':0xc8,'message':[_0x3610b7[_0x3542('0x61')],_0x3542('0x74')][_0x3542('0x15')]('\x20')});})['catch'](function(_0x3410dd){_0x422535(_0x5cbe76['error'](0x1f5,[_0x3610b7[_0x3542('0x61')],_0x3410dd[_0x3542('0x1b')][_0x3542('0x68')]()][_0x3542('0x15')]('\x20')));});}else{return _0x422535(_0x5cbe76['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x5b3d44){var _0x2f36c6=_[_0x3542('0x5b')](_0x2a1864[_0x3542('0x75')]);_0x5b3d44({'count':_0x2f36c6[_0x3542('0x5d')],'rows':_0x2f36c6});});},'VoiceQueuesChannel':function(_0x1ebe3a){var _0x2afc71=this;return new Promise(function(_0x3c84fa,_0x77f0af){var _0x2b0de0=schema(properties['voicequeuechannel'])[_0x3542('0x2')](_0x1ebe3a);if(_0x2b0de0[_0x3542('0x5d')]>0x0){return _0x77f0af(_0x2afc71[_0x3542('0x12')](0x1f4,_[_0x3542('0x60')](_0x2b0de0,_0x3542('0x1b'))['join'](',\x20')));}var _0x4a5851=_[_0x3542('0x59')](_0x2a1864[_0x3542('0x75')],{'uniqueid':_0x1ebe3a['uniqueid']});if(_0x4a5851){_0x3c84fa(_0x4a5851);}else{return _0x77f0af(_0x2afc71[_0x3542('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3bdadf){var _0x5ab738=this;return new Promise(function(_0x318389,_0x153e1b){if(ami['isConnected']()==![]){return _0x153e1b(_0x5ab738['error'](0x1f4,[config['asterisk']['ip'],config[_0x3542('0x13')]['username'],_0x3542('0x5e')][_0x3542('0x15')]('\x20')));}var _0x53c469=schema(properties[_0x3542('0x76')])[_0x3542('0x2')](_0x3bdadf);if(_0x53c469[_0x3542('0x5d')]>0x0){return _0x153e1b(_0x5ab738['error'](0x1f4,_[_0x3542('0x60')](_0x53c469,'message')[_0x3542('0x15')](',\x20')));}var _0x4f48bc=_[_0x3542('0x59')](_0x2a1864[_0x3542('0x75')],{'uniqueid':_0x3bdadf[_0x3542('0x61')]});if(_0x4f48bc&&_0x4f48bc['channel']){return ami[_0x3542('0x1a')]({'action':_0x3542('0x77'),'channel':_0x4f48bc[_0x3542('0x62')]})[_0x3542('0x1f')](function(_0x4aaee2){_0x318389({'code':0xc8,'message':[_0x3bdadf['uniqueid'],_0x4aaee2[_0x3542('0x1b')][_0x3542('0x68')]()][_0x3542('0x15')]('\x20')});})[_0x3542('0x1c')](function(_0x191fdd){_0x153e1b(_0x5ab738[_0x3542('0x12')](0x1f5,[_0x3bdadf[_0x3542('0x61')],_0x191fdd[_0x3542('0x1b')][_0x3542('0x68')]()][_0x3542('0x15')]('\x20')));});}else{return _0x153e1b(_0x5ab738[_0x3542('0x12')](0x1f5,_0x3542('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x23f092){var _0x8a72fb=this;return new Promise(function(_0x33719d,_0x27e5f6){if(ami[_0x3542('0x11')]()==![]){return _0x27e5f6(_0x8a72fb[_0x3542('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x3542('0x13')][_0x3542('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x3a805f=schema(properties[_0x3542('0x78')])[_0x3542('0x2')](_0x23f092);if(_0x3a805f[_0x3542('0x5d')]>0x0){return _0x27e5f6(_0x8a72fb['error'](0x1f4,_[_0x3542('0x60')](_0x3a805f,_0x3542('0x1b'))['join'](',\x20')));}var _0x303c14=_['find'](_0x2a1864[_0x3542('0x75')],{'uniqueid':_0x23f092['uniqueid']});if(_0x303c14&&_0x303c14[_0x3542('0x62')]){return ami[_0x3542('0x1a')]({'action':_0x3542('0x79'),'channel':_0x303c14[_0x3542('0x62')],'exten':_0x23f092[_0x3542('0x7a')],'context':_0x23f092[_0x3542('0x7b')]||_0x303c14[_0x3542('0x7b')],'priority':0x1})['then'](function(_0x350c2a){_0x33719d({'code':0xc8,'message':[_0x23f092['uniqueid'],_0x350c2a['message'][_0x3542('0x68')]()][_0x3542('0x15')]('\x20')});})[_0x3542('0x1c')](function(_0x40c19c){_0x27e5f6(_0x8a72fb['error'](0x1f5,[_0x23f092[_0x3542('0x61')],_0x40c19c[_0x3542('0x1b')][_0x3542('0x68')]()][_0x3542('0x15')]('\x20')));});}else{return _0x27e5f6(_0x8a72fb[_0x3542('0x12')](0x1f5,_0x3542('0x6d')));}});},'Agents':function(_0x1bc57f){return new Promise(function(_0x3b6eb5){var _0x46396d=_[_0x3542('0x5b')](_0x2a1864['agents']);if(_0x1bc57f&&_0x1bc57f['id']){var _0x497bf1=_[_0x3542('0x59')](_0x46396d,function(_0x57e777){return _0x57e777['id']===_0x1bc57f['id'];});_0x3b6eb5(_0x497bf1);}else{_0x3b6eb5({'count':_0x46396d[_0x3542('0x5d')],'rows':_0x46396d});}});},'Telephones':function(){return new Promise(function(_0x3414df){var _0x840055=_['values'](_0x2a1864[_0x3542('0x7c')]);_0x3414df({'count':_0x840055[_0x3542('0x5d')],'rows':_0x840055});});},'Trunks':function(){return new Promise(function(_0x1ee95d){var _0x49c44d=_[_0x3542('0x5b')](_0x2a1864['trunks']);_0x1ee95d({'count':_0x49c44d[_0x3542('0x5d')],'rows':_0x49c44d});});},'OutboundChannels':function(){return new Promise(function(_0x17e7ec){var _0x3c06aa=_['values'](_0x2a1864[_0x3542('0x7d')]);_0x17e7ec({'count':_0x3c06aa['length'],'rows':_0x3c06aa});});},'Outbound':function(){return new Promise(function(_0x31c9c8){_0x31c9c8(_0x2a1864['outbound']);});},'Campaigns':function(){return new Promise(function(_0x533845){var _0x135967=_[_0x3542('0x5b')](_0x2a1864['campaigns']);_0x533845({'count':_0x135967[_0x3542('0x5d')],'rows':_0x135967});});},'VoiceQueuesPreview':function(_0x5432be){var _0x157700=this;return new Promise(function(_0x5017e0,_0xbb7139){_0x54ea2f[_0x3542('0x7e')](_0x5432be['id'])[_0x3542('0x1f')](function(_0x1d55f2){_0x5017e0({'code':0xc8,'message':_0x1d55f2[_0x3542('0x1b')]});})['catch'](function(_0x40ad35){_0xbb7139(_0x157700[_0x3542('0x12')](0x1f4,_0x40ad35[_0x3542('0x1b')]));});});},'EventManager':function(_0x5b7ef3){var _0x1beaec=this;return new Promise(function(_0x4725f3,_0x384d29){if(!_0x5b7ef3[_0x3542('0x7f')]){return _0x384d29(_0x1beaec[_0x3542('0x12')](0x1f4,_0x3542('0x80')));}ami[_0x3542('0x81')]('custom:'+_0x5b7ef3[_0x3542('0x7f')],_0x5b7ef3[_0x3542('0x1b')]);_0x4725f3({'code':0xc8,'message':_0x5b7ef3});});},'FaxAccounts':function(){return new Promise(function(_0x5d5cbd){var _0x53777e=_['values'](_0x2a1864[_0x3542('0x82')]);_0x5d5cbd({'count':_0x53777e[_0x3542('0x5d')],'rows':_0x53777e});});},'SendFax':function(_0x14ce7e){var _0x1e32e1=this;return new Promise(function(_0x46c163,_0x47a913){_0x8ba9d5['send'](_0x14ce7e)[_0x3542('0x1f')](function(_0x4d3a0b){_0x46c163({'code':0xc8,'message':_0x4d3a0b[_0x3542('0x1b')]});})[_0x3542('0x1c')](function(_0x1d275b){_0x47a913(_0x1e32e1[_0x3542('0x12')](0x1f4,_0x1d275b['message']));});});},'CheckAfterSend':function(_0x4737ee){var _0x40fa0d=this;return new Promise(function(_0x3605b8,_0x416a43){_0x8ba9d5[_0x3542('0x83')](_0x4737ee)[_0x3542('0x1f')](function(_0x1ac8bf){_0x3605b8({'code':0xc8,'message':_0x1ac8bf['message']});})['catch'](function(_0x30617d){_0x416a43(_0x40fa0d['error'](0x1f4,_0x30617d[_0x3542('0x1b')]));});});}};var _0x270a1a=jayson[_0x3542('0x84')](_0x29c3fa)[_0x3542('0x85')]();_0x270a1a['on']('error',function(_0xf1bb0b){return _0x15ee3b(_0xf1bb0b);});_0x270a1a[_0x3542('0x6')](0x232a,'127.0.0.1',function(){console[_0x3542('0x86')](_0x3542('0x87'),0x232a);return _0x2d2ae9(_0x3542('0x88')+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 038df83..e03561a 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 _0x40cb=['destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','merge','lodash','bluebird','ioredis','util','../../../../config/environment','redis','localhost','socket.io-emitter','info','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown'];(function(_0x4d9931,_0x3825b9){var _0x288ed9=function(_0x2ddd23){while(--_0x2ddd23){_0x4d9931['push'](_0x4d9931['shift']());}};_0x288ed9(++_0x3825b9);}(_0x40cb,0x105));var _0xb40c=function(_0x1c0dec,_0x2672ce){_0x1c0dec=_0x1c0dec-0x0;var _0x4ea01e=_0x40cb[_0x1c0dec];return _0x4ea01e;};'use strict';var _=require(_0xb40c('0x0'));var BPromise=require(_0xb40c('0x1'));var Redis=require(_0xb40c('0x2'));var util=require(_0xb40c('0x3'));var config=require(_0xb40c('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xb40c('0x5')]=_['defaults'](config[_0xb40c('0x5')],{'host':_0xb40c('0x6'),'port':0x18eb});var io=require(_0xb40c('0x7'))(new Redis(config[_0xb40c('0x5')]));function emit(_0xb0f2db,_0xb2c233,_0x374e92,_0x36c330,_0x29cbc7){logger[_0xb40c('0x8')]('[CM][%s][%s]',_0xb0f2db,_0xb2c233['id'],_0x374e92,_0x36c330,JSON['stringify'](_0x29cbc7));io['to'](_0x374e92)[_0xb40c('0x9')](_0x36c330,_0x29cbc7);}exports[_0xb40c('0xa')]=function(_0x55d108,_0xf1b0ba,_0x28a283,_0x947ccc){var _0x365af1,_0x2c8ba7;var _0x1ab9b7={};var _0x4d9701;var _0xf6e8fc=Number(_0x28a283['data1']);var _0x6a8623=_0x28a283[_0xb40c('0xb')]?Boolean(Number(_0x28a283['data2'])):![];var _0x2d0f99;var _0x2240e1=![];if(!_[_0xb40c('0xc')](_0x28a283['data5'])){if(_0x28a283[_0xb40c('0xd')]=='1')_0x2240e1=!![];}if(!_0x2240e1){if(_0x947ccc[_0xb40c('0xe')]){_0x1ab9b7['id']=_0x947ccc['xmd-contactid'];}}if(!_0x1ab9b7['id']){_0x1ab9b7[_0xb40c('0xf')]=_0xf6e8fc;_0x2d0f99=_0x28a283[_0xb40c('0x10')]&&_0x28a283[_0xb40c('0x10')]!=='0'?_0x28a283[_0xb40c('0x10')][_0xb40c('0x11')](','):[_0xb40c('0x12')];_0x1ab9b7['$or']=_['map'](_0x2d0f99,function(_0x486acc){var _0x56c7f8={};_0x56c7f8[_0x486acc]=_0x947ccc[_0xb40c('0x13')]?_0x947ccc[_0xb40c('0x14')]:_0x947ccc[_0xb40c('0x15')];return _0x56c7f8;});_0x4d9701=_0x947ccc[_0xb40c('0x13')]?_0x947ccc['destcalleridnum']:_0x947ccc[_0xb40c('0x15')];}var _0x349f35=['id',_0xb40c('0x16'),_0xb40c('0x17'),'phone',_0xb40c('0x18'),_0xb40c('0x19'),'ListId','createdAt','scheduledAt','updatedAt'];var _0x9f24cd=_['union'](_0x349f35,_0x2d0f99);BPromise['resolve']()[_0xb40c('0x1a')](cmContactRpc[_0xb40c('0x1b')]({'attributes':_0x9f24cd,'where':_0x1ab9b7,'phone':_0x4d9701}))[_0xb40c('0x1a')](function(_0x17c54b){_0x2c8ba7=_0x17c54b;if(!_[_0xb40c('0x1c')](_0x2c8ba7)){if(_0x2c8ba7[_0xb40c('0x1d')]===0x1){_0x365af1=_0x2c8ba7[0x0];logger[_0xb40c('0x8')](_0xb40c('0x1e'),_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id'],_0x365af1['id']);}else{logger[_0xb40c('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id'],_[_0xb40c('0x20')](_0x2c8ba7,'id')[_0xb40c('0x21')](','));}return;}else{logger['info'](_0xb40c('0x22'),_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id']);var _0x4e9d07={'ListId':_0xf6e8fc};var _0x5838d8=_0x28a283['data4']&&_0x28a283[_0xb40c('0x23')]!=='0'?_0x28a283[_0xb40c('0x23')]:'phone';if(_0x6a8623){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id']);_0x4e9d07[_0x5838d8]=_[_0xb40c('0xc')](_0x947ccc[_0xb40c('0x13')])?_0x947ccc[_0xb40c('0x15')]:_0x947ccc[_0xb40c('0x14')];if(_[_0xb40c('0xc')](_0x947ccc[_0xb40c('0x13')])){_0x4e9d07[_0xb40c('0x16')]=_0x947ccc[_0xb40c('0x24')]&&_0x947ccc['calleridname']!==_0xb40c('0x25')?_0x947ccc['calleridname']:_0xb40c('0x26');}else{_0x4e9d07['firstName']=_0x947ccc[_0xb40c('0x27')]&&_0x947ccc['destcalleridname']!==_0xb40c('0x25')?_0x947ccc[_0xb40c('0x27')]:_0xb40c('0x26');}return BPromise[_0xb40c('0x28')]()[_0xb40c('0x1a')](cmContactRpc[_0xb40c('0x29')](_0x4e9d07))['then'](function(_0x454ad3){_0x365af1=_0x454ad3;_0x2c8ba7[_0xb40c('0x2a')](_0x454ad3);if(_0x365af1){logger['info'](_0xb40c('0x2b'),_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id'],_0x365af1['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x947ccc[_0xb40c('0x1f')],_0xf1b0ba['id']);_0x4e9d07[_0x5838d8]=_[_0xb40c('0xc')](_0x947ccc[_0xb40c('0x13')])?_0x947ccc[_0xb40c('0x15')]:_0x947ccc[_0xb40c('0x14')];if(_[_0xb40c('0xc')](_0x947ccc['routeId'])){_0x4e9d07[_0xb40c('0x16')]=_0x947ccc['calleridname']&&_0x947ccc['calleridname']!==_0xb40c('0x25')?_0x947ccc['calleridname']:_0xb40c('0x26');}else{_0x4e9d07[_0xb40c('0x16')]=_0x947ccc[_0xb40c('0x27')]&&_0x947ccc[_0xb40c('0x27')]!==_0xb40c('0x25')?_0x947ccc[_0xb40c('0x27')]:_0xb40c('0x26');}_0x365af1=_0x4e9d07;_0x2c8ba7[_0xb40c('0x2a')](_0x4e9d07);return;}}})[_0xb40c('0x1a')](function(){if(_0x55d108){emit(_0x947ccc['uniqueid'],_0xf1b0ba,util[_0xb40c('0x2c')](_0xb40c('0x2d'),_0x55d108[_0xb40c('0x2e')]),util[_0xb40c('0x2c')](_0xb40c('0x2f'),_0x28a283[_0xb40c('0x30')]['toLowerCase']()),{'evt':_[_0xb40c('0x31')](_0x947ccc,{'autoCreate':_0x6a8623}),'contact':_0x365af1===undefined?{}:_0x365af1,'contacts':_0x2c8ba7[_0xb40c('0x1d')]===0x0?undefined:_0x2c8ba7});}});}; \ No newline at end of file +var _0x4c71=['../../../../config/logger','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','phone','mobile','ListId','scheduledAt','updatedAt','resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','Unknown','destcalleridname','','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','merge','lodash','bluebird','ioredis'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x4c71,0x1d1));var _0x14c7=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x4c71[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x14c7('0x0'));var BPromise=require(_0x14c7('0x1'));var Redis=require(_0x14c7('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x14c7('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x14c7('0x4')]=_[_0x14c7('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x14c7('0x6'))(new Redis(config[_0x14c7('0x4')]));function emit(_0x35cb97,_0x59d18e,_0x2ca2bc,_0x147e26,_0x50129b){logger['info'](_0x14c7('0x7'),_0x35cb97,_0x59d18e['id'],_0x2ca2bc,_0x147e26,JSON[_0x14c7('0x8')](_0x50129b));io['to'](_0x2ca2bc)[_0x14c7('0x9')](_0x147e26,_0x50129b);}exports[_0x14c7('0xa')]=function(_0x2d028f,_0x58dd9e,_0x480c0c,_0xe1f684){var _0x21e582,_0x3fdb79;var _0x4c528b={};var _0x36c3df;var _0x2d9ce1=Number(_0x480c0c[_0x14c7('0xb')]);var _0x464b9d=_0x480c0c[_0x14c7('0xc')]?Boolean(Number(_0x480c0c[_0x14c7('0xc')])):![];var _0x5b3658;var _0x5692e1=![];if(!_[_0x14c7('0xd')](_0x480c0c[_0x14c7('0xe')])){if(_0x480c0c[_0x14c7('0xe')]=='1')_0x5692e1=!![];}if(!_0x5692e1){if(_0xe1f684['xmd-contactid']){_0x4c528b['id']=_0xe1f684[_0x14c7('0xf')];}}if(!_0x4c528b['id']){_0x4c528b['ListId']=_0x2d9ce1;_0x5b3658=_0x480c0c['data3']&&_0x480c0c[_0x14c7('0x10')]!=='0'?_0x480c0c[_0x14c7('0x10')][_0x14c7('0x11')](','):['phone'];_0x4c528b['$or']=_[_0x14c7('0x12')](_0x5b3658,function(_0x420762){var _0x3098f9={};_0x3098f9[_0x420762]=_0xe1f684[_0x14c7('0x13')]?_0xe1f684[_0x14c7('0x14')]:_0xe1f684['calleridnum'];return _0x3098f9;});_0x36c3df=_0xe1f684['routeId']?_0xe1f684['destcalleridnum']:_0xe1f684[_0x14c7('0x15')];}var _0x3fd19b=['id',_0x14c7('0x16'),'lastName',_0x14c7('0x17'),_0x14c7('0x18'),'fax',_0x14c7('0x19'),'createdAt',_0x14c7('0x1a'),_0x14c7('0x1b')];var _0x3a9035=_['union'](_0x3fd19b,_0x5b3658);BPromise[_0x14c7('0x1c')]()[_0x14c7('0x1d')](cmContactRpc['getContacts']({'attributes':_0x3a9035,'where':_0x4c528b,'phone':_0x36c3df}))['then'](function(_0x3be042){_0x3fdb79=_0x3be042;if(!_[_0x14c7('0x1e')](_0x3fdb79)){if(_0x3fdb79[_0x14c7('0x1f')]===0x1){_0x21e582=_0x3fdb79[0x0];logger[_0x14c7('0x20')](_0x14c7('0x21'),_0xe1f684['uniqueid'],_0x58dd9e['id'],_0x21e582['id']);}else{logger[_0x14c7('0x20')](_0x14c7('0x22'),_0xe1f684[_0x14c7('0x23')],_0x58dd9e['id'],_[_0x14c7('0x12')](_0x3fdb79,'id')[_0x14c7('0x24')](','));}return;}else{logger['info'](_0x14c7('0x25'),_0xe1f684['uniqueid'],_0x58dd9e['id']);var _0x3ab4e1={'ListId':_0x2d9ce1};var _0x35ee94=_0x480c0c[_0x14c7('0x26')]&&_0x480c0c[_0x14c7('0x26')]!=='0'?_0x480c0c[_0x14c7('0x26')]:_0x14c7('0x17');if(_0x464b9d){logger[_0x14c7('0x20')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xe1f684[_0x14c7('0x23')],_0x58dd9e['id']);_0x3ab4e1[_0x35ee94]=_[_0x14c7('0xd')](_0xe1f684[_0x14c7('0x13')])?_0xe1f684[_0x14c7('0x15')]:_0xe1f684[_0x14c7('0x14')];if(_[_0x14c7('0xd')](_0xe1f684['routeId'])){_0x3ab4e1[_0x14c7('0x16')]=_0xe1f684[_0x14c7('0x27')]&&_0xe1f684[_0x14c7('0x27')]!==''?_0xe1f684[_0x14c7('0x27')]:_0x14c7('0x28');}else{_0x3ab4e1['firstName']=_0xe1f684[_0x14c7('0x29')]&&_0xe1f684[_0x14c7('0x29')]!==_0x14c7('0x2a')?_0xe1f684['destcalleridname']:_0x14c7('0x28');}return BPromise[_0x14c7('0x1c')]()[_0x14c7('0x1d')](cmContactRpc['createContact'](_0x3ab4e1))[_0x14c7('0x1d')](function(_0x426df1){_0x21e582=_0x426df1;_0x3fdb79[_0x14c7('0x2b')](_0x426df1);if(_0x21e582){logger[_0x14c7('0x20')](_0x14c7('0x2c'),_0xe1f684[_0x14c7('0x23')],_0x58dd9e['id'],_0x21e582['id']);}return;});}else{logger['info'](_0x14c7('0x2d'),_0xe1f684[_0x14c7('0x23')],_0x58dd9e['id']);_0x3ab4e1[_0x35ee94]=_['isNil'](_0xe1f684[_0x14c7('0x13')])?_0xe1f684[_0x14c7('0x15')]:_0xe1f684[_0x14c7('0x14')];if(_['isNil'](_0xe1f684[_0x14c7('0x13')])){_0x3ab4e1['firstName']=_0xe1f684['calleridname']&&_0xe1f684[_0x14c7('0x27')]!==''?_0xe1f684[_0x14c7('0x27')]:_0x14c7('0x28');}else{_0x3ab4e1[_0x14c7('0x16')]=_0xe1f684[_0x14c7('0x29')]&&_0xe1f684[_0x14c7('0x29')]!==''?_0xe1f684[_0x14c7('0x29')]:_0x14c7('0x28');}_0x21e582=_0x3ab4e1;_0x3fdb79[_0x14c7('0x2b')](_0x3ab4e1);return;}}})['then'](function(){if(_0x2d028f){emit(_0xe1f684['uniqueid'],_0x58dd9e,util[_0x14c7('0x2e')](_0x14c7('0x2f'),_0x2d028f[_0x14c7('0x30')]),util['format'](_0x14c7('0x31'),_0x480c0c[_0x14c7('0x32')]['toLowerCase']()),{'evt':_[_0x14c7('0x33')](_0xe1f684,{'autoCreate':_0x464b9d}),'contact':_0x21e582===undefined?{}:_0x21e582,'contacts':_0x3fdb79[_0x14c7('0x1f')]===0x0?undefined:_0x3fdb79});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0f499c8..3bdce4f 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 _0xfc65=['custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','contactmanager','motionbar','browser','TemplateId','data2','html','buildUri','isNil','data3','data4','location','data5','800','data6','600','winApplication','render','winArguments','format','user:%s','name','trigger:%s:%s','action','toLowerCase','data1','jscripty','trigger:%s','exec','queue','routeId','urlforward','script','parse','query','search','replace','channel','every','checkConditions','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','event','agent','membername','lastevent','null','substatus','undefined','offlineMessage','created','equals','exports','util','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction'];(function(_0x28ef27,_0x18cd04){var _0x59dc0b=function(_0x1a95d1){while(--_0x1a95d1){_0x28ef27['push'](_0x28ef27['shift']());}};_0x59dc0b(++_0x18cd04);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x33b6d2,_0x410fd4){_0x33b6d2=_0x33b6d2-0x0;var _0x5923e0=_0xfc65[_0x33b6d2];return _0x5923e0;};'use strict';var util=require(_0x5fc6('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0x5fc6('0x1'));var Redis=require(_0x5fc6('0x2'));var urlforward=require(_0x5fc6('0x3'));var integration=require(_0x5fc6('0x4'));var cmContact=require(_0x5fc6('0x5'));var script=require(_0x5fc6('0x6'));var config=require(_0x5fc6('0x7'));var logger=require(_0x5fc6('0x8'))(_0x5fc6('0x9'));var ami=require(_0x5fc6('0xa'));config[_0x5fc6('0xb')]=_[_0x5fc6('0xc')](config[_0x5fc6('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x5fc6('0xd'))(new Redis(config[_0x5fc6('0xb')]));var operators={'equals':function(_0x2d10be,_0x3d9a11){return _0x2d10be==_0x3d9a11;},'not_equals':function(_0x16c285,_0xbc3db9){return _0x16c285!=_0xbc3db9;}};var barAndWebActions=[_0x5fc6('0xe'),_0x5fc6('0xf'),_0x5fc6('0x10')];function Trigger(_0x29781f){this['triggers']=_0x29781f[_0x5fc6('0x11')];this['agents']=_0x29781f[_0x5fc6('0x12')];this[_0x5fc6('0x13')]=_0x29781f[_0x5fc6('0x13')];this[_0x5fc6('0x14')]=_0x29781f['templates'];this[_0x5fc6('0x15')]=_0x29781f[_0x5fc6('0x15')];this[_0x5fc6('0x16')]=_0x29781f[_0x5fc6('0x16')];this[_0x5fc6('0x17')]=_0x29781f[_0x5fc6('0x17')];this[_0x5fc6('0x18')]=_0x29781f[_0x5fc6('0x18')];this[_0x5fc6('0x19')]=_0x29781f[_0x5fc6('0x19')];this['zohoAccounts']=_0x29781f['zohoAccounts'];this[_0x5fc6('0x1a')]=_0x29781f[_0x5fc6('0x1a')];this['vtigerAccounts']=_0x29781f[_0x5fc6('0x1b')];this[_0x5fc6('0x1c')]=_0x29781f[_0x5fc6('0x1c')];this[_0x5fc6('0x1d')]=_0x29781f[_0x5fc6('0x1d')];this[_0x5fc6('0x1e')]=_0x29781f['freshsalesAccounts'];this[_0x5fc6('0x1f')]={'zendesk':this[_0x5fc6('0x16')],'salesforce':this[_0x5fc6('0x18')],'freshdesk':this[_0x5fc6('0x17')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x5fc6('0x20')],'desk':this[_0x5fc6('0x1a')],'vtiger':this[_0x5fc6('0x1b')],'dynamics365':this[_0x5fc6('0x1d')],'freshsales':this[_0x5fc6('0x1e')],'servicenow':this[_0x5fc6('0x1c')]};ami['on'](_0x5fc6('0x21'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x24'),this['syncCustomEvent'][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x25'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x26'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x27'),this['syncCustomEvent'][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x28'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x29'),this[_0x5fc6('0x22')]['bind'](this));ami['on'](_0x5fc6('0x2a'),this[_0x5fc6('0x22')]['bind'](this));ami['on'](_0x5fc6('0x2b'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x2c'),this[_0x5fc6('0x22')]['bind'](this));ami['on'](_0x5fc6('0x2d'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x2e'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x2f'),this[_0x5fc6('0x30')][_0x5fc6('0x23')](this));ami['on']('custom:dialconnect',this[_0x5fc6('0x30')]['bind'](this));ami['on'](_0x5fc6('0x31'),this[_0x5fc6('0x30')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x32'),this[_0x5fc6('0x22')]['bind'](this));ami['on'](_0x5fc6('0x33'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x34'),this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x35'),this[_0x5fc6('0x22')]['bind'](this));ami['on'](_0x5fc6('0x36'),this[_0x5fc6('0x22')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on']('custom:rejectmessage',this[_0x5fc6('0x22')][_0x5fc6('0x23')](this));ami['on'](_0x5fc6('0x37'),this[_0x5fc6('0x22')]['bind'](this));}Trigger['prototype'][_0x5fc6('0x38')]=function(_0x3eb4d4,_0x4c9f14,_0x58552a){logger[_0x5fc6('0x39')](_0x3eb4d4,_0x4c9f14,JSON[_0x5fc6('0x3a')](_0x58552a));io['to'](_0x3eb4d4)['emit'](_0x4c9f14,_0x58552a);};Trigger[_0x5fc6('0x3b')]['syncCustomEvent']=function(_0x2f95ba){var _0x593d73=_[_0x5fc6('0x3c')](_0x2f95ba);if(typeof _0x593d73[_0x5fc6('0x3d')]==='undefined'){_0x593d73[_0x5fc6('0x3d')]=_0x5fc6('0x3e');}this[_0x5fc6('0x3f')](_0x593d73);};Trigger[_0x5fc6('0x3b')][_0x5fc6('0x30')]=function(_0x3f786e){if(this['agents'][_0x3f786e[_0x5fc6('0x40')]]){this['syncCustomEvent'](_0x3f786e);}};Trigger[_0x5fc6('0x3b')][_0x5fc6('0x3f')]=function(_0x5df9d3){var _0x179598;for(var _0x2dc117 in this['triggers']){if(this['triggers'][_0x5fc6('0x41')](_0x2dc117)){if(this[_0x5fc6('0x11')][_0x2dc117][_0x5fc6('0x42')]){_0x179598=this[_0x5fc6('0x43')](this[_0x5fc6('0x11')][_0x2dc117],_0x5df9d3);if(_0x179598){_[_0x5fc6('0x44')](_0x5df9d3,_0x5df9d3[_0x5fc6('0x45')]);for(var _0xe64ad7=0x0,_0x7cdb2c,_0x1b72a3,_0x326956;_0xe64ad70x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x582840,_0x1e83ff){var _0x221d5b=function(_0x4b97db){while(--_0x4b97db){_0x582840['push'](_0x582840['shift']());}};_0x221d5b(++_0x1e83ff);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 70d6cd7..2f16af6 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 _0x0f1b=['picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','/contacts(','phonecall','callDirection','queue','/systemusers(','phonecalls','Subjects','Fields','headers','ticketId','format','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','userEmail','length','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','outbound','destcalleridnum','calleridnum','contacts','4.0','body','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string'];(function(_0x548ca8,_0x10bd67){var _0x23f996=function(_0x343243){while(--_0x343243){_0x548ca8['push'](_0x548ca8['shift']());}};_0x23f996(++_0x10bd67);}(_0x0f1b,0xaa));var _0xb0f1=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0f1b[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xb0f1('0x0'));var rp=require(_0xb0f1('0x1'));var util=require(_0xb0f1('0x2'));var intUtil=require('./util');var md5=require(_0xb0f1('0x3'));var Redis=require(_0xb0f1('0x4'));var logger=require('../../../../config/logger')(_0xb0f1('0x5'));var config=require(_0xb0f1('0x6'));config[_0xb0f1('0x7')]=_[_0xb0f1('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb0f1('0x9'))(new Redis(config[_0xb0f1('0x7')]));function getAuthToken(_0x20edba,_0x3a7401,_0x490230){if(_0x20edba['modernAuthentication']){_0x20edba[_0xb0f1('0xa')]=_0x20edba[_0xb0f1('0xb')][_0xb0f1('0xc')];_0x20edba[_0xb0f1('0xd')]=_0x20edba[_0xb0f1('0xb')][_0xb0f1('0xe')];return Promise[_0xb0f1('0xf')](_0x20edba[_0xb0f1('0xb')][_0xb0f1('0x10')]);}var _0x38780c={'method':_0xb0f1('0x11'),'uri':_0x3a7401,'form':{'client_id':_0x20edba[_0xb0f1('0x12')],'resource':_0x20edba[_0xb0f1('0xa')],'username':_0x20edba[_0xb0f1('0x13')],'password':_0x20edba[_0xb0f1('0x14')],'grant_type':_0xb0f1('0x14'),'client_secret':_0x20edba[_0xb0f1('0x15')]},'json':!![]};return rp(_0x38780c)[_0xb0f1('0x16')](function(_0x52b58a){return _0x52b58a[_0xb0f1('0x17')];})[_0xb0f1('0x18')](function(_0x15d49f){logger[_0xb0f1('0x19')]('['+[_0x490230[_0xb0f1('0x1a')]()]+_0xb0f1('0x1b'));return _0x15d49f[_0xb0f1('0x1c')];});}function getUser(_0x5ec983,_0xc33b4a,_0xf563d8,_0x4edb04,_0x259db9,_0x1ae15d){return new Promise(function(_0x2a0c5a,_0x403ed9){return getAuthToken(_0xc33b4a,_0x4edb04,_0x1ae15d)['then'](function(_0x2839a5){var _0x481f4d={'method':_0xb0f1('0x1d'),'uri':_0x259db9+_0xb0f1('0x1e'),'headers':{'Authorization':'Bearer\x20'+_0x2839a5,'OData-Version':'4.0'},'json':!![]};return rp(_0x481f4d);})[_0xb0f1('0x16')](function(_0x11be20){var _0x519461=_0x11be20[_0xb0f1('0x1f')];var _0x55011d=![];var _0x2a5f5e=null;if(!_[_0xb0f1('0x20')](_0xf563d8)){if(intUtil[_0xb0f1('0x21')](_0xf563d8['email'])){_0x5ec983[_0xb0f1('0x22')]=_0xf563d8['email'];for(_0x2a5f5e=0x0;_0x2a5f5e<_0x519461[_0xb0f1('0x23')];_0x2a5f5e++){if(_0x519461[_0x2a5f5e]['internalemailaddress']===_0xf563d8[_0xb0f1('0x24')]&&!_0x519461[_0x2a5f5e][_0xb0f1('0x25')]){_0x55011d=!![];logger[_0xb0f1('0x26')]('['+[_0x1ae15d[_0xb0f1('0x1a')]()]+_0xb0f1('0x27')+_0x519461[_0x2a5f5e][_0xb0f1('0x28')]+'!');_0x5ec983[_0xb0f1('0x29')]=_0x519461[_0x2a5f5e][_0xb0f1('0x28')];}}}}if(!_0x55011d){logger['info']('['+[_0x1ae15d[_0xb0f1('0x1a')]()]+_0xb0f1('0x2a'));_0x5ec983[_0xb0f1('0x22')]=_0xc33b4a['username'];for(_0x2a5f5e=0x0;_0x2a5f5e<_0x519461[_0xb0f1('0x23')];_0x2a5f5e++){if(_0x519461[_0x2a5f5e][_0xb0f1('0x2b')]===_0xc33b4a[_0xb0f1('0x13')]){_0x5ec983[_0xb0f1('0x29')]=_0x519461[_0x2a5f5e][_0xb0f1('0x28')];}}}_0x2a0c5a(_0x5ec983);})[_0xb0f1('0x18')](function(_0x332fc7){_0x403ed9(_0x332fc7[_0xb0f1('0x1c')]);});});}function createEndUser(_0x3ecaa4,_0x5ec137,_0x404609,_0x198657,_0x1b7627,_0x445d21,_0x596586){return new Promise(function(_0x51b167,_0x4c5074){return getAuthToken(_0x5ec137,_0x404609,_0x445d21)[_0xb0f1('0x16')](function(_0x196534){var _0x4dcbcf=_0x445d21['toLowerCase']()===_0xb0f1('0x2c')?_0x1b7627[_0xb0f1('0x2d')]:_0x1b7627[_0xb0f1('0x2e')];var _0x52a925={'method':_0xb0f1('0x11'),'uri':_0x198657+_0xb0f1('0x2f'),'body':{'fullname':_0x4dcbcf,'firstname':_0x4dcbcf,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3ecaa4[_0xb0f1('0x29')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x196534,'OData-Version':_0xb0f1('0x30')},'json':!![],'resolveWithFullResponse':!![]};_0x52a925[_0xb0f1('0x31')][_0x596586]=_0x4dcbcf;return rp(_0x52a925);})[_0xb0f1('0x16')](function(_0x38f64a){var _0x17bfcc=_0x38f64a['headers'][_0xb0f1('0x32')];var _0x5c27b9=_0x17bfcc[_0xb0f1('0x33')](_0x17bfcc['lastIndexOf']('(')+0x1,_0x17bfcc[_0xb0f1('0x34')](')'));_0x3ecaa4[_0xb0f1('0x35')]=_0x5c27b9;_0x51b167(_0x3ecaa4);})[_0xb0f1('0x18')](function(_0x2b67a0){_0x4c5074(_0x2b67a0['message']);});});}function getEndUser(_0x540ea7,_0x471862,_0x1b6c7f,_0x410580,_0x108ab0,_0x1342af,_0x27c820,_0xdc5f5a){var _0x403983=_0x1342af[_0xb0f1('0x36')]()===_0xb0f1('0x2c')?_0x108ab0[_0xb0f1('0x2d')]:_0x108ab0[_0xb0f1('0x2e')];return getAuthToken(_0x471862,_0x1b6c7f,_0x1342af)[_0xb0f1('0x16')](function(_0x1e2b47){_0xdc5f5a=_0xdc5f5a?_0xdc5f5a:_0xb0f1('0x37');var _0x4b012f={'method':_0xb0f1('0x1d'),'uri':_0x410580+_0xb0f1('0x38')+_0xdc5f5a+_0xb0f1('0x39')+_0xdc5f5a+_0xb0f1('0x3a')+_0x403983[_0xb0f1('0x3b')]('+',_0xb0f1('0x3c'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1e2b47,'If-None-Match':null,'OData-Version':_0xb0f1('0x30')},'json':!![]};return rp(_0x4b012f);})[_0xb0f1('0x16')](function(_0x5560a3){var _0x55074f=![];if(!_0x5560a3)return _0x55074f;var _0x3b3c6b=_0x5560a3[_0xb0f1('0x1f')];for(var _0x1e546c=0x0;_0x1e546c<_0x3b3c6b['length'];_0x1e546c++){if(_0x3b3c6b[_0x1e546c][_0xdc5f5a]===_0x403983){_0x55074f=!![];_0x540ea7[_0xb0f1('0x35')]=_0x3b3c6b[_0x1e546c][_0xb0f1('0x3d')];}}return _0x55074f;})[_0xb0f1('0x16')](function(_0x4179d7){if(_0x4179d7)return _0x540ea7;if(_0x27c820==='nothing'){logger[_0xb0f1('0x26')]('['+[_0x1342af[_0xb0f1('0x1a')]()]+_0xb0f1('0x3e'));return _0x540ea7;}return createEndUser(_0x540ea7,_0x471862,_0x1b6c7f,_0x410580,_0x108ab0,_0x1342af,_0xdc5f5a)['then'](function(_0x58e0be){logger[_0xb0f1('0x26')]('['+[_0x1342af['toUpperCase']()]+_0xb0f1('0x3f'),_0x58e0be[_0xb0f1('0x35')]);return _0x58e0be;});});}function getCustomFields(_0x41540d,_0x29eb93,_0x4169b2){var _0x4e20c1={};if(_0x41540d[_0xb0f1('0x23')]>0x0){_['forEach'](_0x41540d,function(_0x1356b1){if(_[_0xb0f1('0x40')]([_0xb0f1('0x41'),_0xb0f1('0x42')],_0x1356b1[_0xb0f1('0x43')])&&_0x1356b1[_0xb0f1('0x44')]&&!_0x1356b1[_0xb0f1('0x45')]){var _0x5e5bb2=_0x1356b1[_0xb0f1('0x46')][_0xb0f1('0x36')]();var _0x1212d3=_0x5e5bb2['substring'](0x0,_0x5e5bb2[_0xb0f1('0x47')]('_'));var _0x192b55=_0x5e5bb2[_0xb0f1('0x33')](_0x5e5bb2[_0xb0f1('0x47')]('_')+0x1);if(_0x1212d3===_0x4169b2){_0x4e20c1[_0x192b55]=_0x1356b1[_0xb0f1('0x48')];}}});}return _0x4e20c1;}function getTicket(_0x33b89f,_0x1cccf9,_0x3e4a4a,_0x5fbcc2,_0x401820,_0x1571cc,_0x4fc504){return new Promise(function(_0x28d30a,_0x250c18){var _0x35b7a9;return getAuthToken(_0x1cccf9,_0x3e4a4a,_0x4fc504)[_0xb0f1('0x16')](function(_0x20f1a2){if(_0x1571cc[_0xb0f1('0x49')]===_0xb0f1('0x4a')){_0x35b7a9={'method':'POST','uri':_0x5fbcc2+_0xb0f1('0x4b'),'body':Object[_0xb0f1('0x4c')]({},{'title':intUtil[_0xb0f1('0x4d')](_0x1571cc['Subjects'],_0x401820,'\x20'),'description':intUtil[_0xb0f1('0x4d')](_0x1571cc['Descriptions'],_0x401820,'\x0a'),'customerid_contact@odata.bind':_0x33b89f[_0xb0f1('0x35')]?_0xb0f1('0x4e')+_0x33b89f['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x33b89f[_0xb0f1('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x1571cc['Fields'],_0x401820,_0x1571cc[_0xb0f1('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0x20f1a2,'OData-Version':_0xb0f1('0x30')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1571cc[_0xb0f1('0x49')]===_0xb0f1('0x4f')){var _0x199b2f=_0x33b89f[_0xb0f1('0x35')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x33b89f[_0xb0f1('0x29')]+')','participationtypemask':_0x33b89f[_0xb0f1('0x50')]===_0xb0f1('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0xb0f1('0x4e')+_0x33b89f[_0xb0f1('0x35')]+')','participationtypemask':_0x33b89f[_0xb0f1('0x50')]===_0xb0f1('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb0f1('0x52')+_0x33b89f[_0xb0f1('0x29')]+')','participationtypemask':_0x33b89f[_0xb0f1('0x50')]===_0xb0f1('0x51')?0x2:0x1}];_0x35b7a9={'method':_0xb0f1('0x11'),'uri':_0x5fbcc2+_0xb0f1('0x53'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x1571cc[_0xb0f1('0x54')],_0x401820,'\x20'),'phonenumber':String(_0x401820[_0xb0f1('0x2e')]),'description':intUtil[_0xb0f1('0x4d')](_0x1571cc['Descriptions'],_0x401820,'\x0a'),'regardingobjectid_contact@odata.bind':_0x33b89f[_0xb0f1('0x35')]?_0xb0f1('0x4e')+_0x33b89f[_0xb0f1('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x33b89f['userId']+')','directioncode':_0x33b89f['callDirection']===_0xb0f1('0x51')?![]:!![],'phonecall_activity_parties':_0x199b2f},getCustomFields(_0x1571cc[_0xb0f1('0x55')],_0x401820,_0x1571cc[_0xb0f1('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0x20f1a2,'OData-Version':_0xb0f1('0x30')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35b7a9);})[_0xb0f1('0x16')](function(_0x1cc071){var _0x106879=_0x1cc071[_0xb0f1('0x56')][_0xb0f1('0x32')];var _0x1b565d=_0x106879[_0xb0f1('0x33')](_0x106879[_0xb0f1('0x34')]('(')+0x1,_0x106879[_0xb0f1('0x34')](')'));_0x33b89f[_0xb0f1('0x57')]=_0x1b565d;_0x28d30a(_0x33b89f);})[_0xb0f1('0x18')](function(_0x33e53c){_0x250c18(_0x33e53c['message']);});});}function emit(_0x5616e3,_0x448c07,_0x483911,_0x1ea2c){var _0x1c201f={'uri':util[_0xb0f1('0x58')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5616e3,_0x483911,_0x1ea2c)};io['to'](util[_0xb0f1('0x58')](_0xb0f1('0x59'),_0x448c07))[_0xb0f1('0x5a')](_0xb0f1('0x5b'),_0x1c201f);}exports['cs']=function(_0x46a0b6,_0x40e3dd,_0x29eb26,_0x404da0,_0xf61c84,_0x408b3b,_0x2f8700,_0x56cd32){var _0x2d8aa4={};_0x408b3b[_0xb0f1('0xa')]=_0x408b3b[_0xb0f1('0x5c')]?intUtil[_0xb0f1('0x5d')](_0x408b3b[_0xb0f1('0xb')][_0xb0f1('0xc')]):intUtil[_0xb0f1('0x5d')](_0x408b3b[_0xb0f1('0xa')]);_0x408b3b[_0xb0f1('0x5e')]=intUtil[_0xb0f1('0x5d')](_0x408b3b[_0xb0f1('0x5e')]);_0x2d8aa4['callDirection']=_0x56cd32===_0xb0f1('0x51')||_0x56cd32==='unmanaged'?'queue':_0xb0f1('0x2c');var _0x5bf09b=_0x408b3b[_0xb0f1('0x5c')]?util['format'](_0xb0f1('0x5f'),_0x408b3b[_0xb0f1('0xb')][_0xb0f1('0xc')]):util['format'](_0xb0f1('0x5f'),_0x408b3b['remoteUri']);var _0x106b9f=util['format'](_0xb0f1('0x60'),_0x408b3b[_0xb0f1('0xd')]);var _0x1d350b=util[_0xb0f1('0x58')](_0xb0f1('0x61'),_0x408b3b[_0xb0f1('0x5e')],_0x40e3dd[_0xb0f1('0x62')],md5(_0x40e3dd[_0xb0f1('0x62')]));if(_0xf61c84&&_0xf61c84['monitor_format']){logger[_0xb0f1('0x26')]('[QUEUE]',_0xb0f1('0x63'));_0x40e3dd[_0xb0f1('0x64')]=_0x1d350b;}else if(_0x2f8700&&_0x2f8700[_0xb0f1('0x65')]&&_0x2f8700[_0xb0f1('0x65')]!==_0xb0f1('0x66')){logger[_0xb0f1('0x26')](_0xb0f1('0x67'),_0xb0f1('0x63'));_0x40e3dd[_0xb0f1('0x64')]=_0x1d350b;}else{_0x40e3dd[_0xb0f1('0x64')]='';}return getUser(_0x2d8aa4,_0x408b3b,_0x404da0,_0x106b9f,_0x5bf09b,_0x56cd32)[_0xb0f1('0x16')](function(_0x4c74b9){logger[_0xb0f1('0x26')]('['+_0x56cd32['toUpperCase']()+_0xb0f1('0x68'),_0x4c74b9['userId']);logger[_0xb0f1('0x26')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x69'),_0x4c74b9[_0xb0f1('0x22')]);return getEndUser(_0x4c74b9,_0x408b3b,_0x106b9f,_0x5bf09b,_0x40e3dd,_0x56cd32,_0x29eb26[_0xb0f1('0x6a')],_0x29eb26[_0xb0f1('0x6b')]);})[_0xb0f1('0x16')](function(_0x3e7149){logger[_0xb0f1('0x26')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x6c'),_0x3e7149[_0xb0f1('0x35')]);logger[_0xb0f1('0x26')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x6d'),_0x40e3dd[_0xb0f1('0x2e')]);return getTicket(_0x3e7149,_0x408b3b,_0x106b9f,_0x5bf09b,_0x40e3dd,_0x29eb26,_0x56cd32);})[_0xb0f1('0x16')](function(_0x1cbbca){logger[_0xb0f1('0x26')](util[_0xb0f1('0x58')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x6e'),_0x29eb26[_0xb0f1('0x49')],_0x1cbbca['ticketId']));logger[_0xb0f1('0x26')](util[_0xb0f1('0x58')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x6f'),_0x56cd32));if(_0x56cd32!==_0xb0f1('0x70')&&_0x29eb26[_0xb0f1('0x71')]){logger['info']('['+_0x56cd32[_0xb0f1('0x1a')]()+']',_0xb0f1('0x72'));emit(_0x408b3b[_0xb0f1('0xa')],_0x404da0[_0xb0f1('0x73')],_0x29eb26[_0xb0f1('0x49')],_0x1cbbca[_0xb0f1('0x57')]);}})['catch'](function(_0x3f5c8b){logger[_0xb0f1('0x19')]('['+_0x56cd32[_0xb0f1('0x1a')]()+_0xb0f1('0x74'),_0x3f5c8b[_0xb0f1('0x1c')]);console[_0xb0f1('0x19')](_0xb0f1('0x75'),_0x3f5c8b);});}; \ No newline at end of file +var _0x57e2=['[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','idField','indexOf','content','ticketType','incidents','getString','Subjects','Fields','phonecall','callDirection','/contacts(','queue','assign','Descriptions','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','serverUrl','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat'];(function(_0x59d3d6,_0x17b64c){var _0x49575d=function(_0x447d40){while(--_0x447d40){_0x59d3d6['push'](_0x59d3d6['shift']());}};_0x49575d(++_0x17b64c);}(_0x57e2,0x73));var _0x257e=function(_0x56d0f5,_0x2bb1b6){_0x56d0f5=_0x56d0f5-0x0;var _0x10ab5d=_0x57e2[_0x56d0f5];return _0x10ab5d;};'use strict';var _=require(_0x257e('0x0'));var rp=require(_0x257e('0x1'));var util=require(_0x257e('0x2'));var intUtil=require(_0x257e('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config[_0x257e('0x4')]=_[_0x257e('0x5')](config[_0x257e('0x4')],{'host':_0x257e('0x6'),'port':0x18eb});var io=require(_0x257e('0x7'))(new Redis(config[_0x257e('0x4')]));function getAuthToken(_0x70bb6a,_0x5c59bf,_0x1bf5f3){if(_0x70bb6a[_0x257e('0x8')]){_0x70bb6a[_0x257e('0x9')]=_0x70bb6a[_0x257e('0xa')][_0x257e('0xb')];_0x70bb6a[_0x257e('0xc')]=_0x70bb6a['CloudProvider']['data2'];return Promise[_0x257e('0xd')](_0x70bb6a[_0x257e('0xa')]['data5']);}var _0x2238ef={'method':'POST','uri':_0x5c59bf,'form':{'client_id':_0x70bb6a[_0x257e('0xe')],'resource':_0x70bb6a[_0x257e('0x9')],'username':_0x70bb6a[_0x257e('0xf')],'password':_0x70bb6a[_0x257e('0x10')],'grant_type':'password','client_secret':_0x70bb6a[_0x257e('0x11')]},'json':!![]};return rp(_0x2238ef)[_0x257e('0x12')](function(_0x57e8df){return _0x57e8df[_0x257e('0x13')];})[_0x257e('0x14')](function(_0x1c31bd){logger[_0x257e('0x15')]('['+[_0x1bf5f3[_0x257e('0x16')]()]+_0x257e('0x17'));return _0x1c31bd[_0x257e('0x18')];});}function getUser(_0x3b3376,_0x49367f,_0x1c2a57,_0x3e8fc6,_0x25cd9c,_0x39b76f){return new Promise(function(_0xdfdc78,_0x14cc8e){return getAuthToken(_0x49367f,_0x3e8fc6,_0x39b76f)[_0x257e('0x12')](function(_0x4e3e4b){var _0x3b7f8b={'method':_0x257e('0x19'),'uri':_0x25cd9c+_0x257e('0x1a'),'headers':{'Authorization':'Bearer\x20'+_0x4e3e4b,'OData-Version':_0x257e('0x1b')},'json':!![]};return rp(_0x3b7f8b);})[_0x257e('0x12')](function(_0x430dc8){var _0x3e9e46=_0x430dc8['value'];var _0x5c2131=![];var _0x76537b=null;if(!_[_0x257e('0x1c')](_0x1c2a57)){if(intUtil['validateEmail'](_0x1c2a57[_0x257e('0x1d')])){_0x3b3376[_0x257e('0x1e')]=_0x1c2a57[_0x257e('0x1d')];for(_0x76537b=0x0;_0x76537b<_0x3e9e46[_0x257e('0x1f')];_0x76537b++){if(_0x3e9e46[_0x76537b]['internalemailaddress']===_0x1c2a57[_0x257e('0x1d')]&&!_0x3e9e46[_0x76537b]['isdisabled']){_0x5c2131=!![];logger[_0x257e('0x20')]('['+[_0x39b76f[_0x257e('0x16')]()]+_0x257e('0x21')+_0x3e9e46[_0x76537b][_0x257e('0x22')]+'!');_0x3b3376[_0x257e('0x23')]=_0x3e9e46[_0x76537b][_0x257e('0x22')];}}}}if(!_0x5c2131){logger[_0x257e('0x20')]('['+[_0x39b76f['toUpperCase']()]+_0x257e('0x24'));_0x3b3376[_0x257e('0x1e')]=_0x49367f[_0x257e('0xf')];for(_0x76537b=0x0;_0x76537b<_0x3e9e46[_0x257e('0x1f')];_0x76537b++){if(_0x3e9e46[_0x76537b]['internalemailaddress']===_0x49367f[_0x257e('0xf')]){_0x3b3376[_0x257e('0x23')]=_0x3e9e46[_0x76537b][_0x257e('0x22')];}}}_0xdfdc78(_0x3b3376);})[_0x257e('0x14')](function(_0x329adc){_0x14cc8e(_0x329adc[_0x257e('0x18')]);});});}function createEndUser(_0x198019,_0xfb62a2,_0x5aa250,_0x1be106,_0x356334,_0xd76f7a,_0x485d35){return new Promise(function(_0x337184,_0x588d5e){return getAuthToken(_0xfb62a2,_0x5aa250,_0xd76f7a)[_0x257e('0x12')](function(_0x439d96){var _0x5c1686=_0xd76f7a[_0x257e('0x25')]()===_0x257e('0x26')?_0x356334[_0x257e('0x27')]:_0x356334[_0x257e('0x28')];var _0x97fba8={'method':_0x257e('0x29'),'uri':_0x1be106+_0x257e('0x2a'),'body':{'fullname':_0x5c1686,'firstname':_0x5c1686,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x257e('0x2b')+_0x198019[_0x257e('0x23')]+')'},'headers':{'Authorization':_0x257e('0x2c')+_0x439d96,'OData-Version':_0x257e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x97fba8['body'][_0x485d35]=_0x5c1686;return rp(_0x97fba8);})[_0x257e('0x12')](function(_0x3994ef){var _0x485501=_0x3994ef[_0x257e('0x2d')][_0x257e('0x2e')];var _0x6b4e72=_0x485501[_0x257e('0x2f')](_0x485501[_0x257e('0x30')]('(')+0x1,_0x485501[_0x257e('0x30')](')'));_0x198019[_0x257e('0x31')]=_0x6b4e72;_0x337184(_0x198019);})[_0x257e('0x14')](function(_0x3ad8c3){_0x588d5e(_0x3ad8c3[_0x257e('0x18')]);});});}function getEndUser(_0x5426ca,_0x22822f,_0x6c7a67,_0x58277c,_0x35e4dd,_0x3a2373,_0x11c368,_0x2d5c73){var _0x4bd12f=_0x3a2373[_0x257e('0x25')]()===_0x257e('0x26')?_0x35e4dd[_0x257e('0x27')]:_0x35e4dd[_0x257e('0x28')];return getAuthToken(_0x22822f,_0x6c7a67,_0x3a2373)[_0x257e('0x12')](function(_0x36bb5e){_0x2d5c73=_0x2d5c73?_0x2d5c73:'telephone1';var _0xba3194={'method':'GET','uri':_0x58277c+_0x257e('0x32')+_0x2d5c73+_0x257e('0x33')+_0x2d5c73+_0x257e('0x34')+_0x4bd12f[_0x257e('0x35')]('+','%2b')+'\x27','headers':{'Authorization':_0x257e('0x2c')+_0x36bb5e,'If-None-Match':null,'OData-Version':_0x257e('0x1b')},'json':!![]};return rp(_0xba3194);})[_0x257e('0x12')](function(_0x3cb958){var _0x46dbee=![];if(!_0x3cb958)return _0x46dbee;var _0x1ae888=_0x3cb958[_0x257e('0x36')];for(var _0x3047be=0x0;_0x3047be<_0x1ae888[_0x257e('0x1f')];_0x3047be++){if(_0x1ae888[_0x3047be][_0x2d5c73]===_0x4bd12f){_0x46dbee=!![];_0x5426ca[_0x257e('0x31')]=_0x1ae888[_0x3047be][_0x257e('0x37')];}}return _0x46dbee;})[_0x257e('0x12')](function(_0x50691b){if(_0x50691b)return _0x5426ca;if(_0x11c368===_0x257e('0x38')){logger[_0x257e('0x20')]('['+[_0x3a2373[_0x257e('0x16')]()]+_0x257e('0x39'));return _0x5426ca;}return createEndUser(_0x5426ca,_0x22822f,_0x6c7a67,_0x58277c,_0x35e4dd,_0x3a2373,_0x2d5c73)['then'](function(_0x58022d){logger['info']('['+[_0x3a2373[_0x257e('0x16')]()]+_0x257e('0x3a'),_0x58022d[_0x257e('0x31')]);return _0x58022d;});});}function getCustomFields(_0x5cf413,_0x10313c,_0x57ee59){var _0x2764c1={};if(_0x5cf413[_0x257e('0x1f')]>0x0){_[_0x257e('0x3b')](_0x5cf413,function(_0x90783f){if(_[_0x257e('0x3c')](['string',_0x257e('0x3d')],_0x90783f['type'])&&_0x90783f['nameField']&&!_0x90783f['customField']){var _0xfcbe0c=_0x90783f[_0x257e('0x3e')][_0x257e('0x25')]();var _0x4b8c79=_0xfcbe0c[_0x257e('0x2f')](0x0,_0xfcbe0c[_0x257e('0x3f')]('_'));var _0xdf3b71=_0xfcbe0c['substring'](_0xfcbe0c[_0x257e('0x3f')]('_')+0x1);if(_0x4b8c79===_0x57ee59){_0x2764c1[_0xdf3b71]=_0x90783f[_0x257e('0x40')];}}});}return _0x2764c1;}function getTicket(_0x4cd649,_0x139cdd,_0x3b645d,_0x4550d9,_0x19056a,_0x14e85c,_0x528438){return new Promise(function(_0x5c9340,_0x4ddca7){var _0xb553b7;return getAuthToken(_0x139cdd,_0x3b645d,_0x528438)[_0x257e('0x12')](function(_0x5621bd){if(_0x14e85c[_0x257e('0x41')]==='incident'){_0xb553b7={'method':_0x257e('0x29'),'uri':_0x4550d9+_0x257e('0x42'),'body':Object['assign']({},{'title':intUtil[_0x257e('0x43')](_0x14e85c[_0x257e('0x44')],_0x19056a,'\x20'),'description':intUtil['getString'](_0x14e85c['Descriptions'],_0x19056a,'\x0a'),'customerid_contact@odata.bind':_0x4cd649[_0x257e('0x31')]?'/contacts('+_0x4cd649['enduserId']+')':undefined,'ownerid@odata.bind':_0x257e('0x2b')+_0x4cd649[_0x257e('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x14e85c[_0x257e('0x45')],_0x19056a,_0x14e85c[_0x257e('0x41')])),'headers':{'Authorization':_0x257e('0x2c')+_0x5621bd,'OData-Version':_0x257e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x14e85c[_0x257e('0x41')]===_0x257e('0x46')){var _0x3a0792=_0x4cd649[_0x257e('0x31')]?[{'partyid_systemuser@odata.bind':_0x257e('0x2b')+_0x4cd649[_0x257e('0x23')]+')','participationtypemask':_0x4cd649[_0x257e('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x257e('0x48')+_0x4cd649[_0x257e('0x31')]+')','participationtypemask':_0x4cd649[_0x257e('0x47')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x257e('0x2b')+_0x4cd649[_0x257e('0x23')]+')','participationtypemask':_0x4cd649[_0x257e('0x47')]===_0x257e('0x49')?0x2:0x1}];_0xb553b7={'method':_0x257e('0x29'),'uri':_0x4550d9+'phonecalls','body':Object[_0x257e('0x4a')]({},{'subject':intUtil[_0x257e('0x43')](_0x14e85c[_0x257e('0x44')],_0x19056a,'\x20'),'phonenumber':String(_0x19056a[_0x257e('0x28')]),'description':intUtil['getString'](_0x14e85c[_0x257e('0x4b')],_0x19056a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4cd649[_0x257e('0x31')]?_0x257e('0x48')+_0x4cd649[_0x257e('0x31')]+')':undefined,'ownerid@odata.bind':_0x257e('0x2b')+_0x4cd649[_0x257e('0x23')]+')','directioncode':_0x4cd649[_0x257e('0x47')]===_0x257e('0x49')?![]:!![],'phonecall_activity_parties':_0x3a0792},getCustomFields(_0x14e85c[_0x257e('0x45')],_0x19056a,_0x14e85c[_0x257e('0x41')])),'headers':{'Authorization':_0x257e('0x2c')+_0x5621bd,'OData-Version':_0x257e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xb553b7);})[_0x257e('0x12')](function(_0x3df1ff){var _0x5d82cd=_0x3df1ff[_0x257e('0x2d')]['odata-entityid'];var _0x44173f=_0x5d82cd[_0x257e('0x2f')](_0x5d82cd[_0x257e('0x30')]('(')+0x1,_0x5d82cd[_0x257e('0x30')](')'));_0x4cd649['ticketId']=_0x44173f;_0x5c9340(_0x4cd649);})[_0x257e('0x14')](function(_0x1d4a10){_0x4ddca7(_0x1d4a10['message']);});});}function emit(_0xbed918,_0x4be238,_0x484703,_0xca5278){var _0xb8c281={'uri':util[_0x257e('0x4c')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xbed918,_0x484703,_0xca5278)};io['to'](util[_0x257e('0x4c')](_0x257e('0x4d'),_0x4be238))[_0x257e('0x4e')](_0x257e('0x4f'),_0xb8c281);}exports['cs']=function(_0x4931f8,_0x18688a,_0x250f9d,_0x33cb8d,_0x33c1b0,_0x4aa617,_0x13670b,_0x503db1){var _0x118136={};_0x4aa617[_0x257e('0x9')]=_0x4aa617[_0x257e('0x8')]?intUtil['stripTrailingSlash'](_0x4aa617['CloudProvider']['data7']):intUtil[_0x257e('0x50')](_0x4aa617[_0x257e('0x9')]);_0x4aa617['serverUrl']=intUtil[_0x257e('0x50')](_0x4aa617['serverUrl']);_0x118136['callDirection']=_0x503db1===_0x257e('0x49')||_0x503db1==='unmanaged'?_0x257e('0x49'):_0x257e('0x26');var _0x4e4358=_0x4aa617[_0x257e('0x8')]?util[_0x257e('0x4c')](_0x257e('0x51'),_0x4aa617[_0x257e('0xa')]['data7']):util[_0x257e('0x4c')](_0x257e('0x51'),_0x4aa617['remoteUri']);var _0xd598a7=util[_0x257e('0x4c')](_0x257e('0x52'),_0x4aa617[_0x257e('0xc')]);var _0x1f6ea7=util[_0x257e('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4aa617[_0x257e('0x53')],_0x18688a[_0x257e('0x54')],md5(_0x18688a[_0x257e('0x54')]));if(_0x33c1b0&&_0x33c1b0[_0x257e('0x55')]){logger[_0x257e('0x20')](_0x257e('0x56'),'Recording\x20is\x20enabled!');_0x18688a[_0x257e('0x57')]=_0x1f6ea7;}else if(_0x13670b&&_0x13670b[_0x257e('0x58')]&&_0x13670b['recordingFormat']!=='none'){logger[_0x257e('0x20')](_0x257e('0x59'),_0x257e('0x5a'));_0x18688a[_0x257e('0x57')]=_0x1f6ea7;}else{_0x18688a[_0x257e('0x57')]='';}return getUser(_0x118136,_0x4aa617,_0x33cb8d,_0xd598a7,_0x4e4358,_0x503db1)[_0x257e('0x12')](function(_0x5ebf3c){logger[_0x257e('0x20')]('['+_0x503db1['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x5ebf3c[_0x257e('0x23')]);logger[_0x257e('0x20')]('['+_0x503db1[_0x257e('0x16')]()+_0x257e('0x5b'),_0x5ebf3c[_0x257e('0x1e')]);return getEndUser(_0x5ebf3c,_0x4aa617,_0xd598a7,_0x4e4358,_0x18688a,_0x503db1,_0x250f9d['moduleCreate'],_0x250f9d[_0x257e('0x5c')]);})[_0x257e('0x12')](function(_0x1e711a){logger[_0x257e('0x20')]('['+_0x503db1[_0x257e('0x16')]()+_0x257e('0x5d'),_0x1e711a[_0x257e('0x31')]);logger[_0x257e('0x20')]('['+_0x503db1['toUpperCase']()+_0x257e('0x5e'),_0x18688a[_0x257e('0x28')]);return getTicket(_0x1e711a,_0x4aa617,_0xd598a7,_0x4e4358,_0x18688a,_0x250f9d,_0x503db1);})['then'](function(_0x463fca){logger[_0x257e('0x20')](util[_0x257e('0x4c')]('['+_0x503db1[_0x257e('0x16')]()+_0x257e('0x5f'),_0x250f9d[_0x257e('0x41')],_0x463fca['ticketId']));logger[_0x257e('0x20')](util['format']('['+_0x503db1['toUpperCase']()+_0x257e('0x60'),_0x503db1));if(_0x503db1!==_0x257e('0x61')&&_0x250f9d[_0x257e('0x62')]){logger[_0x257e('0x20')]('['+_0x503db1[_0x257e('0x16')]()+']',_0x257e('0x63'));emit(_0x4aa617[_0x257e('0x9')],_0x33cb8d['name'],_0x250f9d[_0x257e('0x41')],_0x463fca['ticketId']);}})[_0x257e('0x14')](function(_0x192e49){logger[_0x257e('0x15')]('['+_0x503db1[_0x257e('0x16')]()+_0x257e('0x64'),_0x192e49[_0x257e('0x18')]);console[_0x257e('0x15')](_0x257e('0x65'),_0x192e49);});}; \ 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 7d6dfdf..f858766 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 _0x623f=['Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','%s/helpdesk/tickets/%d','catch','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','format','%s/api/v2/agents','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','string','type','nameField','toLowerCase','content','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x623f,0x17e));var _0xf623=function(_0x4ebd43,_0x19b7bf){_0x4ebd43=_0x4ebd43-0x0;var _0x259754=_0x623f[_0x4ebd43];return _0x259754;};'use strict';var _=require('lodash');var rp=require(_0xf623('0x0'));var md5=require(_0xf623('0x1'));var util=require(_0xf623('0x2'));var Redis=require(_0xf623('0x3'));var intUtil=require(_0xf623('0x4'));var config=require(_0xf623('0x5'));var logger=require(_0xf623('0x6'))(_0xf623('0x7'));config[_0xf623('0x8')]=_[_0xf623('0x9')](config[_0xf623('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf623('0xa'))(new Redis(config[_0xf623('0x8')]));var headers={'Content-Type':_0xf623('0xb'),'Accept':'application/json'};function emit(_0x283a6d,_0x93313d,_0x146496){io['to'](_0x283a6d)[_0xf623('0xc')](_0x93313d,_0x146496);}function getTicket(_0x53e236,_0x1888f2,_0x3d4cfe,_0x5cde8c,_0x57e4d3){logger[_0xf623('0xd')](_0xf623('0xe'));var _0x13a445=_[_0xf623('0xf')]({'responder_id':_0x1888f2['id'],'requester_id':_0x3d4cfe['id'],'name':util['format']('Caller\x20-\x20%s',_0x57e4d3[_0xf623('0x10')]),'phone':_0x57e4d3['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5cde8c[_0xf623('0x11')],_0x57e4d3,'\x20'),'description':intUtil[_0xf623('0x12')](_0x5cde8c[_0xf623('0x13')],_0x57e4d3,_0xf623('0x14')),'tags':getTags(_0x5cde8c[_0xf623('0x15')],_0xf623('0x16'))},getCustomFields(_0x5cde8c[_0xf623('0x17')],_0x57e4d3));_0x13a445[_0xf623('0x18')]=_['mapValues'](_['keyBy'](_0x13a445['custom_fields'],'id'),_0xf623('0x19'));return request({'uri':util['format']('%s/api/v2/tickets',_0x53e236[_0xf623('0x1a')]),'method':_0xf623('0x1b'),'body':_0x13a445})[_0xf623('0x1c')](function(_0x45a222){logger[_0xf623('0xd')](_0xf623('0x1d'));return _0x45a222;});}function getUser(_0x40e62e,_0x35fb10){if(intUtil[_0xf623('0x1e')](_0x35fb10)){return request({'uri':util[_0xf623('0x1f')](_0xf623('0x20'),_0x40e62e[_0xf623('0x1a')]),'qs':{'email':_0x35fb10}})[_0xf623('0x1c')](function(_0x2cfc33){if(_0x2cfc33[_0xf623('0x21')]){logger[_0xf623('0xd')](_0xf623('0x22'));return _[_0xf623('0x23')](_0x2cfc33,function(_0x32b482){return _0x32b482[_0xf623('0x24')]['email']===_0x35fb10;});}else{logger[_0xf623('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf623('0x1f')](_0xf623('0x25'),_0x40e62e[_0xf623('0x1a')])})['then'](function(_0x5e8b81){logger[_0xf623('0xd')](_0xf623('0x26'));return _0x5e8b81;});}});}else{logger['info'](_0xf623('0x27'));return request({'uri':util[_0xf623('0x1f')](_0xf623('0x25'),_0x40e62e[_0xf623('0x1a')])})[_0xf623('0x1c')](function(_0xe26475){logger[_0xf623('0xd')](_0xf623('0x26'));return _0xe26475;});}}function getEndUser(_0xab5338,_0x2fa902,_0x1c6e7c){logger[_0xf623('0xd')](_0xf623('0x28'),_0x1c6e7c);return request({'uri':util[_0xf623('0x1f')](_0xf623('0x29'),_0xab5338[_0xf623('0x1a')]),'qs':{'phone':_0x1c6e7c}})['then'](function(_0x102e0e){if(_0x102e0e[_0xf623('0x21')]){logger[_0xf623('0xd')]('Enduser\x20found!');return _[_0xf623('0x23')](_0x102e0e,{'phone':_0x1c6e7c});}else{logger[_0xf623('0xd')](_0xf623('0x2a'));return request({'uri':util[_0xf623('0x1f')](_0xf623('0x29'),_0xab5338[_0xf623('0x1a')]),'method':_0xf623('0x1b'),'body':{'name':_0x2fa902,'phone':_0x1c6e7c}})[_0xf623('0x1c')](function(_0x3fdb2d){logger[_0xf623('0xd')](_0xf623('0x2b'));return _0x3fdb2d;});}});}function getAuth(_0x45cd52){return util[_0xf623('0x1f')]('Basic\x20%s',new Buffer(_0x45cd52[_0xf623('0x2c')]+':X')[_0xf623('0x2d')](_0xf623('0x2e')));}function request(_0x2f8160){logger[_0xf623('0x2f')](_0xf623('0x30'),JSON[_0xf623('0x31')](_0x2f8160));return rp(_[_0xf623('0x9')](_0x2f8160,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2fdd00,_0x4d5809){var _0x5dcd88=[];if(_0x2fdd00&&_0x2fdd00[_0xf623('0x21')]>0x0){_0x5dcd88=_[_0xf623('0x32')](_0x2fdd00,_0x4d5809);}return _0x5dcd88;}function getCustomFields(_0x4191f2,_0x522002){var _0x4821af=[];var _0x49fe2e={'custom_fields':[]};if(_0x4191f2['length']>0x0){_[_0xf623('0x33')](_0x4191f2,function(_0x45c9d2){if(_[_0xf623('0x34')]([_0xf623('0x35'),'picklist'],_0x45c9d2[_0xf623('0x36')])&&_0x45c9d2['nameField']&&!_0x45c9d2['customField']){_0x49fe2e[_0x45c9d2[_0xf623('0x37')][_0xf623('0x38')]()]=_0x45c9d2[_0xf623('0x39')][_0xf623('0x2d')]();}else if(_['includes']([_0xf623('0x35'),'picklist'],_0x45c9d2[_0xf623('0x36')])&&_0x45c9d2[_0xf623('0x3a')]&&_0x45c9d2[_0xf623('0x3b')]){_0x49fe2e['custom_fields'][_0xf623('0x3c')]({'id':_0x45c9d2[_0xf623('0x3a')],'value':_0x45c9d2['content'][_0xf623('0x2d')]()});}else if(_0x45c9d2[_0xf623('0x36')]===_0xf623('0x3d')&&_0x45c9d2['variableName']&&_0x45c9d2['idField']&&_0x45c9d2[_0xf623('0x3b')]){_0x522002[_0x45c9d2[_0xf623('0x3e')]]&&_0x49fe2e['custom_fields']['push']({'id':_0x45c9d2[_0xf623('0x3a')],'value':_0x522002[_0x45c9d2[_0xf623('0x3e')]][_0xf623('0x2d')]()});}else if(_0x45c9d2[_0xf623('0x36')]==='customVariable'&&_0x45c9d2[_0xf623('0x3f')]&&_0x45c9d2[_0xf623('0x3f')][_0xf623('0x16')]&&_0x45c9d2[_0xf623('0x3a')]&&_0x45c9d2[_0xf623('0x3b')]){_0x522002[_0x45c9d2[_0xf623('0x3f')][_0xf623('0x16')][_0xf623('0x38')]()]&&_0x49fe2e[_0xf623('0x18')][_0xf623('0x3c')]({'id':_0x45c9d2[_0xf623('0x3a')],'value':_0x522002[_0x45c9d2[_0xf623('0x3f')][_0xf623('0x16')][_0xf623('0x38')]()][_0xf623('0x2d')]()});}});}return _0x49fe2e;}exports[_0xf623('0x40')]=function(_0x5ba737,_0x5ad242,_0x5e8f94,_0x512340,_0x28bcbb,_0x35b2a3){var _0x16a278,_0x486138;_0x35b2a3['remoteUri']=intUtil[_0xf623('0x41')](_0x35b2a3[_0xf623('0x1a')]);_0x35b2a3[_0xf623('0x42')]=intUtil[_0xf623('0x41')](_0x35b2a3[_0xf623('0x42')]);if(_0x28bcbb&&_0x28bcbb[_0xf623('0x43')]){logger['info'](_0xf623('0x44'),_0xf623('0x45'));_0x5ad242[_0xf623('0x46')]=util[_0xf623('0x1f')](_0xf623('0x47'),_0x35b2a3[_0xf623('0x42')],_0x5ad242[_0xf623('0x48')],md5(_0x5ad242[_0xf623('0x48')]));}else{_0x5ad242['recordingURL']='';}headers[_0xf623('0x49')]=getAuth(_0x35b2a3);return getUser(_0x35b2a3,_0x512340[_0xf623('0x4a')])[_0xf623('0x1c')](function(_0x1871b4){_0x16a278=_0x1871b4;logger[_0xf623('0xd')]('The\x20User\x20ID\x20is:',_0x16a278['id']);return getEndUser(_0x35b2a3,_0x5ad242[_0xf623('0x10')],_0x5ad242[_0xf623('0x4b')]);})['then'](function(_0x857639){_0x486138=_0x857639;logger[_0xf623('0xd')](_0xf623('0x4c'),_0x486138['id']);return getTicket(_0x35b2a3,_0x16a278,_0x486138,_0x5e8f94,_0x5ad242);})['then'](function(_0x275668){if(_0x275668&&_0x275668['id']){logger[_0xf623('0xd')](_0xf623('0x1d'));logger[_0xf623('0xd')](_0xf623('0x4d'),_0x275668['id']);logger['info'](_0xf623('0x44'),_0xf623('0x4e'));emit(util[_0xf623('0x1f')](_0xf623('0x4f'),_0x512340[_0xf623('0x16')]),_0xf623('0x50'),{'uri':util[_0xf623('0x1f')]('%s/helpdesk/tickets/%d',_0x35b2a3['remoteUri'],_0x275668['id'])});}})['catch'](function(_0x4c3fb2){logger[_0xf623('0x51')](_0xf623('0x44'),JSON[_0xf623('0x31')](_0x4c3fb2));});};exports[_0xf623('0x52')]=function(_0xf2925b,_0x2b6cfa,_0x233578,_0x1545a0,_0x391b3a,_0x31e2fd,_0x56505){var _0x3d12fd,_0x519a5a;_0x31e2fd['remoteUri']=intUtil['stripTrailingSlash'](_0x31e2fd[_0xf623('0x1a')]);_0x31e2fd[_0xf623('0x42')]=intUtil[_0xf623('0x41')](_0x31e2fd[_0xf623('0x42')]);if(_0x56505&&_0x56505[_0xf623('0x53')]&&_0x56505[_0xf623('0x53')]!=='none'){logger['info'](_0xf623('0x54'),_0xf623('0x45'));_0x2b6cfa[_0xf623('0x46')]=util[_0xf623('0x1f')](_0xf623('0x47'),_0x31e2fd[_0xf623('0x42')],_0x2b6cfa['uniqueid'],md5(_0x2b6cfa[_0xf623('0x48')]));}headers[_0xf623('0x49')]=getAuth(_0x31e2fd);return getUser(_0x31e2fd,_0x1545a0[_0xf623('0x4a')])[_0xf623('0x1c')](function(_0x1979d6){_0x3d12fd=_0x1979d6;logger[_0xf623('0xd')](_0xf623('0x55'),_0x3d12fd['id']);return getEndUser(_0x31e2fd,_0x2b6cfa[_0xf623('0x56')],_0x2b6cfa['destcalleridnum']);})[_0xf623('0x1c')](function(_0x39180b){_0x519a5a=_0x39180b;logger['info'](_0xf623('0x4c'),_0x519a5a['id']);return getTicket(_0x31e2fd,_0x3d12fd,_0x519a5a,_0x233578,_0x2b6cfa);})['then'](function(_0x5af48a){if(_0x5af48a&&_0x5af48a['id']){logger[_0xf623('0xd')](_0xf623('0x1d'));logger['info'](_0xf623('0x4d'),_0x5af48a['id']);logger[_0xf623('0xd')](_0xf623('0x54'),_0xf623('0x4e'));emit(util[_0xf623('0x1f')](_0xf623('0x4f'),_0x1545a0[_0xf623('0x16')]),'trigger:browser:url',{'uri':util[_0xf623('0x1f')](_0xf623('0x57'),_0x31e2fd[_0xf623('0x1a')],_0x5af48a['id'])});}})[_0xf623('0x58')](function(_0x18b137){logger['error']('[OUTBOUND]',JSON[_0xf623('0x31')](_0x18b137));});};exports['unmanaged']=function(_0x2d663a,_0x25e9b1,_0x5b4017,_0x4223d6,_0x305255,_0x342514){var _0x5d1b99,_0x5ef8c2;_0x342514[_0xf623('0x1a')]=intUtil[_0xf623('0x41')](_0x342514['remoteUri']);_0x342514[_0xf623('0x42')]=intUtil['stripTrailingSlash'](_0x342514[_0xf623('0x42')]);if(_0x305255&&_0x305255[_0xf623('0x43')]){logger[_0xf623('0xd')]('['+_0x25e9b1[_0xf623('0x59')][_0xf623('0x5a')]()+']',_0xf623('0x45'));_0x25e9b1[_0xf623('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x342514[_0xf623('0x42')],_0x25e9b1[_0xf623('0x48')],md5(_0x25e9b1[_0xf623('0x48')]));}else{_0x25e9b1[_0xf623('0x46')]='';}headers[_0xf623('0x49')]=getAuth(_0x342514);return getUser(_0x342514,'')[_0xf623('0x1c')](function(_0x43cec3){_0x5d1b99=_0x43cec3;logger['info'](_0xf623('0x55'),_0x5d1b99['id']);return getEndUser(_0x342514,_0x25e9b1[_0xf623('0x10')],_0x25e9b1[_0xf623('0x4b')]);})[_0xf623('0x1c')](function(_0x5f05d0){_0x5ef8c2=_0x5f05d0;logger[_0xf623('0xd')](_0xf623('0x4c'),_0x5ef8c2['id']);return getTicket(_0x342514,_0x5d1b99,_0x5ef8c2,_0x5b4017,_0x25e9b1);})[_0xf623('0x1c')](function(_0x11d555){if(_0x11d555){logger[_0xf623('0xd')]('Ticket\x20created!');logger[_0xf623('0xd')]('The\x20Ticket\x20ID\x20is:',_0x11d555['id']);}})['catch'](function(_0x21a859){logger['error']('['+_0x25e9b1[_0xf623('0x59')][_0xf623('0x5a')]()+']',JSON[_0xf623('0x31')](_0x21a859));});}; \ No newline at end of file +var _0x9422=['lastevent','toUpperCase','Authorization','The\x20User\x20ID\x20is:','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','value','%s/api/v2/tickets','POST','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','variable','Variable','name','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged'];(function(_0x101a61,_0x43011c){var _0x51d456=function(_0x2be688){while(--_0x2be688){_0x101a61['push'](_0x101a61['shift']());}};_0x51d456(++_0x43011c);}(_0x9422,0x121));var _0x2942=function(_0x47fc79,_0x3b0f61){_0x47fc79=_0x47fc79-0x0;var _0x5848de=_0x9422[_0x47fc79];return _0x5848de;};'use strict';var _=require(_0x2942('0x0'));var rp=require('request-promise');var md5=require(_0x2942('0x1'));var util=require(_0x2942('0x2'));var Redis=require('ioredis');var intUtil=require(_0x2942('0x3'));var config=require(_0x2942('0x4'));var logger=require(_0x2942('0x5'))(_0x2942('0x6'));config[_0x2942('0x7')]=_[_0x2942('0x8')](config[_0x2942('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2942('0x9'))(new Redis(config[_0x2942('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x2942('0xa')};function emit(_0x10d092,_0x1aa613,_0x3e8ea3){io['to'](_0x10d092)[_0x2942('0xb')](_0x1aa613,_0x3e8ea3);}function getTicket(_0x21fdac,_0x27f823,_0x577c81,_0x4fe199,_0x5de9c4){logger[_0x2942('0xc')](_0x2942('0xd'));var _0x1dfc06=_[_0x2942('0xe')]({'responder_id':_0x27f823['id'],'requester_id':_0x577c81['id'],'name':util[_0x2942('0xf')](_0x2942('0x10'),_0x5de9c4[_0x2942('0x11')]),'phone':_0x5de9c4[_0x2942('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2942('0x13')](_0x4fe199[_0x2942('0x14')],_0x5de9c4,'\x20'),'description':intUtil[_0x2942('0x13')](_0x4fe199[_0x2942('0x15')],_0x5de9c4,_0x2942('0x16')),'tags':getTags(_0x4fe199[_0x2942('0x17')],'name')},getCustomFields(_0x4fe199[_0x2942('0x18')],_0x5de9c4));_0x1dfc06[_0x2942('0x19')]=_['mapValues'](_['keyBy'](_0x1dfc06[_0x2942('0x19')],'id'),_0x2942('0x1a'));return request({'uri':util[_0x2942('0xf')](_0x2942('0x1b'),_0x21fdac['remoteUri']),'method':_0x2942('0x1c'),'body':_0x1dfc06})[_0x2942('0x1d')](function(_0x1d6233){logger[_0x2942('0xc')]('Ticket\x20created!');return _0x1d6233;});}function getUser(_0x492124,_0x37b1d2){if(intUtil[_0x2942('0x1e')](_0x37b1d2)){return request({'uri':util[_0x2942('0xf')](_0x2942('0x1f'),_0x492124[_0x2942('0x20')]),'qs':{'email':_0x37b1d2}})[_0x2942('0x1d')](function(_0x582dca){if(_0x582dca[_0x2942('0x21')]){logger[_0x2942('0xc')](_0x2942('0x22'));return _[_0x2942('0x23')](_0x582dca,function(_0x3a376e){return _0x3a376e[_0x2942('0x24')][_0x2942('0x25')]===_0x37b1d2;});}else{logger[_0x2942('0xc')](_0x2942('0x26'));return request({'uri':util[_0x2942('0xf')](_0x2942('0x27'),_0x492124[_0x2942('0x20')])})[_0x2942('0x1d')](function(_0x3a2d79){logger[_0x2942('0xc')](_0x2942('0x28'));return _0x3a2d79;});}});}else{logger['info'](_0x2942('0x29'));return request({'uri':util[_0x2942('0xf')]('%s/api/v2/agents/me',_0x492124[_0x2942('0x20')])})[_0x2942('0x1d')](function(_0x338fe0){logger[_0x2942('0xc')](_0x2942('0x28'));return _0x338fe0;});}}function getEndUser(_0xe5e81e,_0xe705cd,_0x13f8d1){logger[_0x2942('0xc')](_0x2942('0x2a'),_0x13f8d1);return request({'uri':util[_0x2942('0xf')]('%s/api/v2/contacts',_0xe5e81e[_0x2942('0x20')]),'qs':{'phone':_0x13f8d1}})[_0x2942('0x1d')](function(_0x28d6d0){if(_0x28d6d0['length']){logger[_0x2942('0xc')](_0x2942('0x2b'));return _['find'](_0x28d6d0,{'phone':_0x13f8d1});}else{logger['info'](_0x2942('0x2c'));return request({'uri':util[_0x2942('0xf')]('%s/api/v2/contacts',_0xe5e81e[_0x2942('0x20')]),'method':_0x2942('0x1c'),'body':{'name':_0xe705cd,'phone':_0x13f8d1}})[_0x2942('0x1d')](function(_0x374934){logger['info'](_0x2942('0x2d'));return _0x374934;});}});}function getAuth(_0x43d0f9){return util['format'](_0x2942('0x2e'),new Buffer(_0x43d0f9[_0x2942('0x2f')]+':X')[_0x2942('0x30')](_0x2942('0x31')));}function request(_0x365e12){logger[_0x2942('0x32')](_0x2942('0x33'),JSON[_0x2942('0x34')](_0x365e12));return rp(_[_0x2942('0x8')](_0x365e12,{'method':_0x2942('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x2156e0,_0x5265ec){var _0x78b4f1=[];if(_0x2156e0&&_0x2156e0[_0x2942('0x21')]>0x0){_0x78b4f1=_[_0x2942('0x36')](_0x2156e0,_0x5265ec);}return _0x78b4f1;}function getCustomFields(_0xfc76e3,_0x157dd2){var _0x766abe=[];var _0x282db2={'custom_fields':[]};if(_0xfc76e3[_0x2942('0x21')]>0x0){_['forEach'](_0xfc76e3,function(_0x5143b7){if(_[_0x2942('0x37')]([_0x2942('0x38'),'picklist'],_0x5143b7[_0x2942('0x39')])&&_0x5143b7['nameField']&&!_0x5143b7[_0x2942('0x3a')]){_0x282db2[_0x5143b7[_0x2942('0x3b')][_0x2942('0x3c')]()]=_0x5143b7[_0x2942('0x3d')][_0x2942('0x30')]();}else if(_['includes']([_0x2942('0x38'),_0x2942('0x3e')],_0x5143b7[_0x2942('0x39')])&&_0x5143b7[_0x2942('0x3f')]&&_0x5143b7[_0x2942('0x3a')]){_0x282db2[_0x2942('0x19')]['push']({'id':_0x5143b7[_0x2942('0x3f')],'value':_0x5143b7[_0x2942('0x3d')][_0x2942('0x30')]()});}else if(_0x5143b7[_0x2942('0x39')]===_0x2942('0x40')&&_0x5143b7['variableName']&&_0x5143b7[_0x2942('0x3f')]&&_0x5143b7[_0x2942('0x3a')]){_0x157dd2[_0x5143b7['variableName']]&&_0x282db2[_0x2942('0x19')]['push']({'id':_0x5143b7['idField'],'value':_0x157dd2[_0x5143b7['variableName']]['toString']()});}else if(_0x5143b7[_0x2942('0x39')]==='customVariable'&&_0x5143b7[_0x2942('0x41')]&&_0x5143b7[_0x2942('0x41')][_0x2942('0x42')]&&_0x5143b7[_0x2942('0x3f')]&&_0x5143b7[_0x2942('0x3a')]){_0x157dd2[_0x5143b7['Variable'][_0x2942('0x42')][_0x2942('0x3c')]()]&&_0x282db2[_0x2942('0x19')][_0x2942('0x43')]({'id':_0x5143b7[_0x2942('0x3f')],'value':_0x157dd2[_0x5143b7[_0x2942('0x41')][_0x2942('0x42')][_0x2942('0x3c')]()][_0x2942('0x30')]()});}});}return _0x282db2;}exports['queue']=function(_0x10f99e,_0x216891,_0x355fbf,_0x2249cf,_0x172be6,_0x406306){var _0x23537c,_0x35da7a;_0x406306[_0x2942('0x20')]=intUtil[_0x2942('0x44')](_0x406306[_0x2942('0x20')]);_0x406306[_0x2942('0x45')]=intUtil[_0x2942('0x44')](_0x406306[_0x2942('0x45')]);if(_0x172be6&&_0x172be6[_0x2942('0x46')]){logger[_0x2942('0xc')](_0x2942('0x47'),'Recording\x20is\x20enabled!');_0x216891[_0x2942('0x48')]=util[_0x2942('0xf')](_0x2942('0x49'),_0x406306[_0x2942('0x45')],_0x216891['uniqueid'],md5(_0x216891['uniqueid']));}else{_0x216891['recordingURL']='';}headers['Authorization']=getAuth(_0x406306);return getUser(_0x406306,_0x2249cf[_0x2942('0x25')])['then'](function(_0x124086){_0x23537c=_0x124086;logger[_0x2942('0xc')]('The\x20User\x20ID\x20is:',_0x23537c['id']);return getEndUser(_0x406306,_0x216891[_0x2942('0x11')],_0x216891[_0x2942('0x12')]);})[_0x2942('0x1d')](function(_0x425555){_0x35da7a=_0x425555;logger[_0x2942('0xc')](_0x2942('0x4a'),_0x35da7a['id']);return getTicket(_0x406306,_0x23537c,_0x35da7a,_0x355fbf,_0x216891);})[_0x2942('0x1d')](function(_0x44a547){if(_0x44a547&&_0x44a547['id']){logger[_0x2942('0xc')](_0x2942('0x4b'));logger['info'](_0x2942('0x4c'),_0x44a547['id']);logger[_0x2942('0xc')](_0x2942('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2942('0xf')](_0x2942('0x4d'),_0x2249cf[_0x2942('0x42')]),_0x2942('0x4e'),{'uri':util[_0x2942('0xf')](_0x2942('0x4f'),_0x406306['remoteUri'],_0x44a547['id'])});}})[_0x2942('0x50')](function(_0x5ed403){logger[_0x2942('0x51')](_0x2942('0x47'),JSON[_0x2942('0x34')](_0x5ed403));});};exports[_0x2942('0x52')]=function(_0x4bf1d3,_0x2b7f76,_0x44d8ad,_0x4bd536,_0x50b407,_0x875c34,_0x62bd03){var _0x124e26,_0xe1c1a;_0x875c34[_0x2942('0x20')]=intUtil[_0x2942('0x44')](_0x875c34['remoteUri']);_0x875c34[_0x2942('0x45')]=intUtil[_0x2942('0x44')](_0x875c34[_0x2942('0x45')]);if(_0x62bd03&&_0x62bd03['recordingFormat']&&_0x62bd03[_0x2942('0x53')]!=='none'){logger[_0x2942('0xc')](_0x2942('0x54'),_0x2942('0x55'));_0x2b7f76[_0x2942('0x48')]=util[_0x2942('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x875c34['serverUrl'],_0x2b7f76[_0x2942('0x56')],md5(_0x2b7f76[_0x2942('0x56')]));}headers['Authorization']=getAuth(_0x875c34);return getUser(_0x875c34,_0x4bd536[_0x2942('0x25')])[_0x2942('0x1d')](function(_0x5cb8b5){_0x124e26=_0x5cb8b5;logger[_0x2942('0xc')]('The\x20User\x20ID\x20is:',_0x124e26['id']);return getEndUser(_0x875c34,_0x2b7f76[_0x2942('0x57')],_0x2b7f76[_0x2942('0x58')]);})[_0x2942('0x1d')](function(_0x4000a4){_0xe1c1a=_0x4000a4;logger[_0x2942('0xc')](_0x2942('0x4a'),_0xe1c1a['id']);return getTicket(_0x875c34,_0x124e26,_0xe1c1a,_0x44d8ad,_0x2b7f76);})[_0x2942('0x1d')](function(_0x8faf5b){if(_0x8faf5b&&_0x8faf5b['id']){logger[_0x2942('0xc')](_0x2942('0x4b'));logger['info'](_0x2942('0x4c'),_0x8faf5b['id']);logger[_0x2942('0xc')]('[OUTBOUND]',_0x2942('0x59'));emit(util[_0x2942('0xf')](_0x2942('0x4d'),_0x4bd536[_0x2942('0x42')]),'trigger:browser:url',{'uri':util[_0x2942('0xf')](_0x2942('0x4f'),_0x875c34['remoteUri'],_0x8faf5b['id'])});}})[_0x2942('0x50')](function(_0x533ac9){logger[_0x2942('0x51')](_0x2942('0x54'),JSON[_0x2942('0x34')](_0x533ac9));});};exports[_0x2942('0x5a')]=function(_0x55249f,_0x70a2d2,_0x275007,_0x449490,_0xaa4ab5,_0x38ad21){var _0x27c151,_0x591335;_0x38ad21['remoteUri']=intUtil['stripTrailingSlash'](_0x38ad21[_0x2942('0x20')]);_0x38ad21[_0x2942('0x45')]=intUtil[_0x2942('0x44')](_0x38ad21[_0x2942('0x45')]);if(_0xaa4ab5&&_0xaa4ab5[_0x2942('0x46')]){logger['info']('['+_0x70a2d2[_0x2942('0x5b')][_0x2942('0x5c')]()+']',_0x2942('0x55'));_0x70a2d2['recordingURL']=util['format'](_0x2942('0x49'),_0x38ad21[_0x2942('0x45')],_0x70a2d2[_0x2942('0x56')],md5(_0x70a2d2[_0x2942('0x56')]));}else{_0x70a2d2[_0x2942('0x48')]='';}headers[_0x2942('0x5d')]=getAuth(_0x38ad21);return getUser(_0x38ad21,'')['then'](function(_0x28bf0b){_0x27c151=_0x28bf0b;logger[_0x2942('0xc')](_0x2942('0x5e'),_0x27c151['id']);return getEndUser(_0x38ad21,_0x70a2d2[_0x2942('0x11')],_0x70a2d2[_0x2942('0x12')]);})[_0x2942('0x1d')](function(_0x441569){_0x591335=_0x441569;logger[_0x2942('0xc')](_0x2942('0x4a'),_0x591335['id']);return getTicket(_0x38ad21,_0x27c151,_0x591335,_0x275007,_0x70a2d2);})[_0x2942('0x1d')](function(_0x3d4e1b){if(_0x3d4e1b){logger[_0x2942('0xc')](_0x2942('0x4b'));logger[_0x2942('0xc')](_0x2942('0x4c'),_0x3d4e1b['id']);}})[_0x2942('0x50')](function(_0x107506){logger[_0x2942('0x51')]('['+_0x70a2d2['lastevent']['toUpperCase']()+']',JSON[_0x2942('0x34')](_0x107506));});}; \ 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 00a744a..45704c3 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 _0x94d1=['callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name','lodash','request-promise','util','moment','bluebird','ioredis','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','userEmail','agentEmail','User\x20found:','userId','Admin\x20selected','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','contactNumber','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum'];(function(_0x3c7c72,_0x215c61){var _0x5048b7=function(_0x43751a){while(--_0x43751a){_0x3c7c72['push'](_0x3c7c72['shift']());}};_0x5048b7(++_0x215c61);}(_0x94d1,0x1d3));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x194d('0x0'));var rp=require(_0x194d('0x1'));var md5=require('md5');var util=require(_0x194d('0x2'));var moment=require(_0x194d('0x3'));var Promise=require(_0x194d('0x4'));var Redis=require(_0x194d('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x194d('0x6'));config[_0x194d('0x7')]=_[_0x194d('0x8')](config[_0x194d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x194d('0x9'))(new Redis(config[_0x194d('0x7')]));function getAdminId(_0x3ab429,_0x3a9a52,_0x370d19,_0x3ee4b8){return new Promise(function(_0x5dc3c2,_0x531f35){var _0x5cac2d=![];var _0x1fa8ef={'method':_0x194d('0xa'),'uri':_0x3ee4b8+_0x194d('0xb'),'json':!![]};_0x1fa8ef[_0x194d('0xc')]=_0x370d19;logger[_0x194d('0xd')](_0x194d('0xe'));return rp(_0x1fa8ef)[_0x194d('0xf')](function(_0x551847){if(_0x551847){var _0x3edf4e=_0x551847['users'];var _0x1777b0=null;for(_0x1777b0=0x0;_0x1777b0<_0x3edf4e[_0x194d('0x10')];_0x1777b0++){if(_0x3edf4e[_0x1777b0][_0x194d('0x11')]===_0x3ab429[_0x194d('0x12')]){_0x3ab429[_0x194d('0x13')]=_0x3edf4e[_0x1777b0]['id'];_0x5cac2d=!![];}}if(_0x5cac2d){logger['info']('Admin\x20found:',_0x3ab429[_0x194d('0x13')]);_0x5dc3c2(_0x3ab429);}else{_0x531f35({'statusCode':0x194,'message':_0x194d('0x14')});}}else{_0x531f35({'statusCode':0x194,'message':_0x194d('0x14')});}})['catch'](function(_0xd9a441){logger[_0x194d('0x15')]('['+[_0x3a9a52[_0x194d('0x16')]()]+']',_0xd9a441[_0x194d('0x17')]);_0x531f35(_0xd9a441);});});}function getUser(_0x4d4bae,_0x4f6db4,_0x2cc102){return function(_0x27011e){return new Promise(function(_0x5eb42d,_0x41bcf9){var _0x57dd54={'method':_0x194d('0xa'),'uri':_0x2cc102+_0x194d('0xb'),'json':!![]};_0x57dd54['headers']=_0x4f6db4;logger[_0x194d('0xd')](_0x194d('0x18'));return rp(_0x57dd54)[_0x194d('0xf')](function(_0x6bc48a){if(_0x6bc48a){var _0x4ebc8b=_0x6bc48a[_0x194d('0x19')];var _0x17b113=![];var _0xa5747b=null;if(_0x27011e['agentEmail']!==null){logger[_0x194d('0xd')]('Getting\x20user\x20with\x20email',_0x27011e['agentEmail']);_0x27011e[_0x194d('0x1a')]=_0x27011e[_0x194d('0x1b')];for(_0xa5747b=0x0;_0xa5747b<_0x4ebc8b[_0x194d('0x10')];_0xa5747b++){if(_0x4ebc8b[_0xa5747b][_0x194d('0x11')]===_0x27011e[_0x194d('0x1b')]){_0x17b113=!![];_0x27011e['userId']=_0x4ebc8b[_0xa5747b]['id'];logger[_0x194d('0xd')](_0x194d('0x1c'),_0x27011e[_0x194d('0x1d')]);}}}if(!_0x17b113){logger[_0x194d('0xd')](_0x194d('0x1e'));_0x27011e[_0x194d('0x1a')]=_0x27011e['adminEmail'];_0x27011e[_0x194d('0x1d')]=_0x27011e[_0x194d('0x13')];_0x17b113=!![];}if(_0x17b113){_0x5eb42d(_0x27011e);}else{_0x41bcf9({'statusCode':0x194,'message':_0x194d('0x14')});}}else{_0x41bcf9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x194d('0x1f')](function(_0x12f64a){logger['error']('['+[_0x4d4bae[_0x194d('0x16')]()]+']',_0x12f64a[_0x194d('0x17')]);_0x41bcf9(_0x12f64a);});});};}function searchContact(_0x3b75bf,_0x43e31a,_0x436b1f,_0xc7322a){return new Promise(function(_0x109ffd,_0x427180){var _0x51256b={'method':_0x194d('0xa'),'headers':_0x43e31a,'uri':_0x3b75bf+_0x194d('0x20')+_0xc7322a+_0x194d('0x21')+_0x436b1f+_0x194d('0x22'),'json':!![]};rp(_0x51256b)[_0x194d('0xf')](function(_0x5ab20b){var _0x292cd8=_[_0x194d('0x23')](_0x5ab20b[_0x194d('0x24')]['contacts'],[_0x436b1f,_0xc7322a]);_0x109ffd(_0x292cd8);})['catch'](function(_0x40db65){_0x427180(_0x40db65);});});}function getEndUser(_0x193133,_0x423de0,_0x46ed97){return function(_0x7ae814){return new Promise(function(_0x33bc92,_0x47c41f){logger[_0x194d('0xd')](util['format'](_0x194d('0x25'),_0x7ae814['contactNumber']));searchContact(_0x46ed97,_0x423de0,_0x194d('0x26'),_0x7ae814['contactNumber'])[_0x194d('0xf')](function(_0x2c2a79){if(_0x2c2a79){_0x7ae814[_0x194d('0x27')]=_0x2c2a79['id'];logger[_0x194d('0xd')]('Contact\x20found\x20mobile_number:',_0x7ae814[_0x194d('0x27')]);return _0x33bc92(_0x7ae814);}searchContact(_0x46ed97,_0x423de0,_0x194d('0x28'),_0x7ae814['contactNumber'])[_0x194d('0xf')](function(_0xdfc92c){if(_0xdfc92c){_0x7ae814[_0x194d('0x27')]=_0xdfc92c['id'];logger['info'](_0x194d('0x29'),_0x7ae814[_0x194d('0x27')]);return _0x33bc92(_0x7ae814);}createEndUser(_0x7ae814,_0x193133,_0x423de0,_0x46ed97)[_0x194d('0xf')](function(_0x5c0d44){logger['info'](_0x194d('0x2a'),_0x5c0d44[_0x194d('0x27')]);return _0x33bc92(_0x5c0d44);});});})['catch'](function(_0x506e36){_0x47c41f(_0x506e36);});});};}function createEndUser(_0x2148e8,_0x56acf8,_0x543f4c,_0x10cc9c){return new Promise(function(_0x1111f5,_0x5243ba){var _0x4917d8=moment();var _0x2b4ad0={'method':_0x194d('0x2b'),'uri':_0x10cc9c+'/api/contacts','body':{'contact':{'last_name':_0x2148e8[_0x194d('0x2c')],'work_number':_0x2148e8[_0x194d('0x2c')],'mobile_number':_0x2148e8[_0x194d('0x2c')],'owner_id':_0x2148e8[_0x194d('0x1d')],'created_at':_0x4917d8[_0x194d('0x2d')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x2b4ad0[_0x194d('0xc')]=_0x543f4c;logger[_0x194d('0xd')](_0x194d('0x2e'));return rp(_0x2b4ad0)['then'](function(_0x41cac2){_0x2148e8[_0x194d('0x27')]=_0x41cac2['contact']['id'];_0x1111f5(_0x2148e8);})[_0x194d('0x1f')](function(_0x1147aa){logger[_0x194d('0x15')]('['+[_0x56acf8[_0x194d('0x16')]()]+']',_0x1147aa[_0x194d('0x17')]);_0x5243ba(_0x1147aa[_0x194d('0x17')]);});});}function getTicket(_0x5311aa,_0x453b34,_0x2677c3,_0x1a6a65,_0x2134ca){return function(_0x32e545){logger[_0x194d('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x486e80,_0x336c41){var _0x524dc0=moment();var _0x189c3d={'method':_0x194d('0x2b'),'uri':_0x2677c3+'/api/tasks','body':{'title':intUtil[_0x194d('0x2f')](_0x1a6a65[_0x194d('0x30')],_0x2134ca,'\x20'),'description':intUtil[_0x194d('0x2f')](_0x1a6a65['Descriptions'],_0x2134ca,'\x0a'),'owner_id':_0x32e545['userId'],'creater_id':_0x32e545[_0x194d('0x13')],'targetable_id':_0x32e545[_0x194d('0x27')],'targetable_type':'Contact','created_at':_0x524dc0[_0x194d('0x2d')](_0x194d('0x31')),'due_date':_0x524dc0[_0x194d('0x32')](0x1e,'m')['format'](_0x194d('0x31'))},'json':!![]};_0x189c3d['headers']=_0x453b34;return rp(_0x189c3d)[_0x194d('0xf')](function(_0x35b368){_0x32e545[_0x194d('0x33')]=_0x35b368[_0x194d('0x34')]['id'];logger[_0x194d('0xd')](_0x194d('0x35'),_0x32e545[_0x194d('0x33')]);_0x486e80(_0x32e545);})[_0x194d('0x1f')](function(_0x284c53){logger['error']('['+[_0x5311aa[_0x194d('0x16')]()]+']',_0x284c53[_0x194d('0x17')]);_0x336c41(_0x284c53[_0x194d('0x17')]);});});};}function emit(_0x41ee6e,_0x11d2f4,_0x2216ab){var _0x38c9d6={'uri':_0x41ee6e+_0x194d('0x36')+_0x2216ab};io['to'](util[_0x194d('0x2d')]('user:%s',_0x11d2f4))[_0x194d('0x37')](_0x194d('0x38'),_0x38c9d6);}exports['cs']=function(_0xbf4a93,_0x48802b,_0x34abdc,_0x5d1d02,_0x141a5e,_0xd2199e,_0x3d394e,_0x58f319){var _0x4c0327={};var _0x5e9754={'Authorization':_0x194d('0x39')+_0xd2199e['apiKey']};_0xd2199e[_0x194d('0x3a')]=intUtil[_0x194d('0x3b')](_0xd2199e['remoteUri']);_0xd2199e[_0x194d('0x3c')]=intUtil[_0x194d('0x3b')](_0xd2199e[_0x194d('0x3c')]);var _0x9a149a=_0xd2199e[_0x194d('0x3a')];_0x4c0327[_0x194d('0x12')]=_0xd2199e[_0x194d('0x3d')];_0x4c0327[_0x194d('0x2c')]=_0x58f319[_0x194d('0x3e')]()==='outbound'?_0x48802b[_0x194d('0x3f')]:_0x48802b[_0x194d('0x40')];_0x4c0327[_0x194d('0x41')]=_0x58f319===_0x194d('0x42')||_0x58f319===_0x194d('0x43')?_0x194d('0x42'):'outbound';if(_0x5d1d02){_0x4c0327[_0x194d('0x1b')]=_0x5d1d02[_0x194d('0x11')];}var _0x11e747=util[_0x194d('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd2199e['serverUrl'],_0x48802b[_0x194d('0x44')],md5(_0x48802b[_0x194d('0x44')]));if(_0x141a5e&&_0x141a5e['monitor_format']){logger[_0x194d('0xd')](_0x194d('0x45'),_0x194d('0x46'));_0x48802b[_0x194d('0x47')]=_0x11e747;}else if(_0x3d394e&&_0x3d394e['recordingFormat']&&_0x3d394e['recordingFormat']!==_0x194d('0x48')){logger['info'](_0x194d('0x49'),'Recording\x20is\x20enabled!');_0x48802b[_0x194d('0x47')]=_0x11e747;}else{_0x48802b['recordingURL']='';}return getAdminId(_0x4c0327,_0x58f319,_0x5e9754,_0x9a149a)[_0x194d('0xf')](getUser(_0x58f319,_0x5e9754,_0x9a149a))['then'](getEndUser(_0x58f319,_0x5e9754,_0x9a149a))[_0x194d('0xf')](getTicket(_0x58f319,_0x5e9754,_0x9a149a,_0x34abdc,_0x48802b))[_0x194d('0xf')](function(_0x386339){logger[_0x194d('0xd')](util['format'](_0x194d('0x4a'),_0x386339[_0x194d('0x33')]));if(_0x58f319!==_0x194d('0x43')){logger[_0x194d('0xd')]('['+[_0x58f319[_0x194d('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x9a149a,_0x5d1d02[_0x194d('0x4b')],_0x386339[_0x194d('0x27')]);}})['catch'](function(_0x3597b9){logger[_0x194d('0x15')]('['+[_0x58f319[_0x194d('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x3597b9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1120=['agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','POST','/api/contacts','userId','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x1120,0xda));var _0x0112=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x1120[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0112('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var moment=require(_0x0112('0x1'));var Promise=require(_0x0112('0x2'));var Redis=require(_0x0112('0x3'));var intUtil=require('./util');var config=require(_0x0112('0x4'));var logger=require(_0x0112('0x5'))(_0x0112('0x6'));config['redis']=_[_0x0112('0x7')](config['redis'],{'host':_0x0112('0x8'),'port':0x18eb});var io=require(_0x0112('0x9'))(new Redis(config['redis']));function getAdminId(_0x3e56c3,_0x3e75ff,_0x64511e,_0x5d4cfa){return new Promise(function(_0x149465,_0x246009){var _0xb386e1=![];var _0x9a5b62={'method':_0x0112('0xa'),'uri':_0x5d4cfa+_0x0112('0xb'),'json':!![]};_0x9a5b62[_0x0112('0xc')]=_0x64511e;logger[_0x0112('0xd')]('Getting\x20admin\x20information');return rp(_0x9a5b62)[_0x0112('0xe')](function(_0x332f85){if(_0x332f85){var _0x21c969=_0x332f85[_0x0112('0xf')];var _0x169368=null;for(_0x169368=0x0;_0x169368<_0x21c969['length'];_0x169368++){if(_0x21c969[_0x169368][_0x0112('0x10')]===_0x3e56c3[_0x0112('0x11')]){_0x3e56c3[_0x0112('0x12')]=_0x21c969[_0x169368]['id'];_0xb386e1=!![];}}if(_0xb386e1){logger[_0x0112('0xd')](_0x0112('0x13'),_0x3e56c3[_0x0112('0x12')]);_0x149465(_0x3e56c3);}else{_0x246009({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x246009({'statusCode':0x194,'message':_0x0112('0x14')});}})[_0x0112('0x15')](function(_0x141b27){logger[_0x0112('0x16')]('['+[_0x3e75ff['toUpperCase']()]+']',_0x141b27[_0x0112('0x17')]);_0x246009(_0x141b27);});});}function getUser(_0x324e30,_0x5d633c,_0x48d47a){return function(_0x237ffe){return new Promise(function(_0x330c7d,_0x4dff63){var _0x39e046={'method':'GET','uri':_0x48d47a+_0x0112('0xb'),'json':!![]};_0x39e046['headers']=_0x5d633c;logger[_0x0112('0xd')](_0x0112('0x18'));return rp(_0x39e046)['then'](function(_0x360717){if(_0x360717){var _0x5243cb=_0x360717[_0x0112('0xf')];var _0xf575c7=![];var _0x29899b=null;if(_0x237ffe[_0x0112('0x19')]!==null){logger[_0x0112('0xd')](_0x0112('0x1a'),_0x237ffe[_0x0112('0x19')]);_0x237ffe[_0x0112('0x1b')]=_0x237ffe[_0x0112('0x19')];for(_0x29899b=0x0;_0x29899b<_0x5243cb['length'];_0x29899b++){if(_0x5243cb[_0x29899b][_0x0112('0x10')]===_0x237ffe[_0x0112('0x19')]){_0xf575c7=!![];_0x237ffe['userId']=_0x5243cb[_0x29899b]['id'];logger[_0x0112('0xd')](_0x0112('0x1c'),_0x237ffe['userId']);}}}if(!_0xf575c7){logger[_0x0112('0xd')](_0x0112('0x1d'));_0x237ffe[_0x0112('0x1b')]=_0x237ffe[_0x0112('0x11')];_0x237ffe['userId']=_0x237ffe[_0x0112('0x12')];_0xf575c7=!![];}if(_0xf575c7){_0x330c7d(_0x237ffe);}else{_0x4dff63({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4dff63({'statusCode':0x194,'message':_0x0112('0x14')});}})[_0x0112('0x15')](function(_0x232d93){logger[_0x0112('0x16')]('['+[_0x324e30[_0x0112('0x1e')]()]+']',_0x232d93[_0x0112('0x17')]);_0x4dff63(_0x232d93);});});};}function searchContact(_0xc2413,_0x504d1e,_0x4a7360,_0x89948){return new Promise(function(_0x316d95,_0xeaac34){var _0x4ff0c2={'method':_0x0112('0xa'),'headers':_0x504d1e,'uri':_0xc2413+_0x0112('0x1f')+_0x89948+'&f='+_0x4a7360+_0x0112('0x20'),'json':!![]};rp(_0x4ff0c2)[_0x0112('0xe')](function(_0x5b8b39){var _0x309a12=_[_0x0112('0x21')](_0x5b8b39[_0x0112('0x22')][_0x0112('0x22')],[_0x4a7360,_0x89948]);_0x316d95(_0x309a12);})[_0x0112('0x15')](function(_0x212d82){_0xeaac34(_0x212d82);});});}function getEndUser(_0xdb3d1,_0x1c4394,_0x5ecc47){return function(_0x11b94f){return new Promise(function(_0x185fed,_0xfd5ddc){logger[_0x0112('0xd')](util[_0x0112('0x23')](_0x0112('0x24'),_0x11b94f[_0x0112('0x25')]));searchContact(_0x5ecc47,_0x1c4394,_0x0112('0x26'),_0x11b94f[_0x0112('0x25')])[_0x0112('0xe')](function(_0x18678c){if(_0x18678c){_0x11b94f[_0x0112('0x27')]=_0x18678c['id'];logger[_0x0112('0xd')](_0x0112('0x28'),_0x11b94f[_0x0112('0x27')]);return _0x185fed(_0x11b94f);}searchContact(_0x5ecc47,_0x1c4394,'work_number',_0x11b94f[_0x0112('0x25')])[_0x0112('0xe')](function(_0x26c88f){if(_0x26c88f){_0x11b94f['endUserId']=_0x26c88f['id'];logger[_0x0112('0xd')]('Contact\x20found\x20work_number:',_0x11b94f[_0x0112('0x27')]);return _0x185fed(_0x11b94f);}createEndUser(_0x11b94f,_0xdb3d1,_0x1c4394,_0x5ecc47)[_0x0112('0xe')](function(_0x5c1076){logger[_0x0112('0xd')](_0x0112('0x29'),_0x5c1076[_0x0112('0x27')]);return _0x185fed(_0x5c1076);});});})['catch'](function(_0x3f4b5c){_0xfd5ddc(_0x3f4b5c);});});};}function createEndUser(_0x501bd8,_0x41ca0d,_0x4cb407,_0x40b390){return new Promise(function(_0x3b06a8,_0x3ff80c){var _0x3eba3e=moment();var _0x3dc514={'method':_0x0112('0x2a'),'uri':_0x40b390+_0x0112('0x2b'),'body':{'contact':{'last_name':_0x501bd8['contactNumber'],'work_number':_0x501bd8['contactNumber'],'mobile_number':_0x501bd8[_0x0112('0x25')],'owner_id':_0x501bd8[_0x0112('0x2c')],'created_at':_0x3eba3e[_0x0112('0x23')](_0x0112('0x2d'))}},'json':!![]};_0x3dc514[_0x0112('0xc')]=_0x4cb407;logger[_0x0112('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3dc514)[_0x0112('0xe')](function(_0x48fef0){_0x501bd8[_0x0112('0x27')]=_0x48fef0['contact']['id'];_0x3b06a8(_0x501bd8);})[_0x0112('0x15')](function(_0x5a014f){logger['error']('['+[_0x41ca0d[_0x0112('0x1e')]()]+']',_0x5a014f[_0x0112('0x17')]);_0x3ff80c(_0x5a014f[_0x0112('0x17')]);});});}function getTicket(_0x2a3295,_0x5a1a41,_0xf141b4,_0x4bd9ce,_0x4e8daa){return function(_0x30b5b3){logger[_0x0112('0xd')](_0x0112('0x2e'));return new Promise(function(_0x3dec44,_0x59aa81){var _0x4dc4ca=moment();var _0x5bdaf2={'method':_0x0112('0x2a'),'uri':_0xf141b4+_0x0112('0x2f'),'body':{'title':intUtil[_0x0112('0x30')](_0x4bd9ce[_0x0112('0x31')],_0x4e8daa,'\x20'),'description':intUtil[_0x0112('0x30')](_0x4bd9ce[_0x0112('0x32')],_0x4e8daa,'\x0a'),'owner_id':_0x30b5b3[_0x0112('0x2c')],'creater_id':_0x30b5b3[_0x0112('0x12')],'targetable_id':_0x30b5b3['endUserId'],'targetable_type':_0x0112('0x33'),'created_at':_0x4dc4ca['format'](_0x0112('0x2d')),'due_date':_0x4dc4ca[_0x0112('0x34')](0x1e,'m')[_0x0112('0x23')](_0x0112('0x2d'))},'json':!![]};_0x5bdaf2[_0x0112('0xc')]=_0x5a1a41;return rp(_0x5bdaf2)[_0x0112('0xe')](function(_0x23e573){_0x30b5b3[_0x0112('0x35')]=_0x23e573[_0x0112('0x36')]['id'];logger[_0x0112('0xd')](_0x0112('0x37'),_0x30b5b3['ticketId']);_0x3dec44(_0x30b5b3);})[_0x0112('0x15')](function(_0x22c8fb){logger['error']('['+[_0x2a3295[_0x0112('0x1e')]()]+']',_0x22c8fb[_0x0112('0x17')]);_0x59aa81(_0x22c8fb[_0x0112('0x17')]);});});};}function emit(_0x9389d2,_0x25cb54,_0x1acbc3){var _0x1e1dc1={'uri':_0x9389d2+_0x0112('0x38')+_0x1acbc3};io['to'](util[_0x0112('0x23')](_0x0112('0x39'),_0x25cb54))[_0x0112('0x3a')](_0x0112('0x3b'),_0x1e1dc1);}exports['cs']=function(_0x2b4b9f,_0x100ce7,_0x3e3422,_0x4c42d1,_0x5410e8,_0x4d764f,_0xd213b8,_0x1351ef){var _0x14490e={};var _0x2c0442={'Authorization':_0x0112('0x3c')+_0x4d764f[_0x0112('0x3d')]};_0x4d764f['remoteUri']=intUtil[_0x0112('0x3e')](_0x4d764f[_0x0112('0x3f')]);_0x4d764f[_0x0112('0x40')]=intUtil[_0x0112('0x3e')](_0x4d764f['serverUrl']);var _0x2446ad=_0x4d764f['remoteUri'];_0x14490e[_0x0112('0x11')]=_0x4d764f[_0x0112('0x41')];_0x14490e[_0x0112('0x25')]=_0x1351ef['toLowerCase']()===_0x0112('0x42')?_0x100ce7[_0x0112('0x43')]:_0x100ce7[_0x0112('0x44')];_0x14490e[_0x0112('0x45')]=_0x1351ef==='queue'||_0x1351ef==='unmanaged'?_0x0112('0x46'):_0x0112('0x42');if(_0x4c42d1){_0x14490e[_0x0112('0x19')]=_0x4c42d1[_0x0112('0x10')];}var _0x51316e=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d764f[_0x0112('0x40')],_0x100ce7[_0x0112('0x47')],md5(_0x100ce7[_0x0112('0x47')]));if(_0x5410e8&&_0x5410e8[_0x0112('0x48')]){logger[_0x0112('0xd')](_0x0112('0x49'),_0x0112('0x4a'));_0x100ce7['recordingURL']=_0x51316e;}else if(_0xd213b8&&_0xd213b8[_0x0112('0x4b')]&&_0xd213b8[_0x0112('0x4b')]!=='none'){logger[_0x0112('0xd')](_0x0112('0x4c'),_0x0112('0x4a'));_0x100ce7[_0x0112('0x4d')]=_0x51316e;}else{_0x100ce7[_0x0112('0x4d')]='';}return getAdminId(_0x14490e,_0x1351ef,_0x2c0442,_0x2446ad)['then'](getUser(_0x1351ef,_0x2c0442,_0x2446ad))[_0x0112('0xe')](getEndUser(_0x1351ef,_0x2c0442,_0x2446ad))[_0x0112('0xe')](getTicket(_0x1351ef,_0x2c0442,_0x2446ad,_0x3e3422,_0x100ce7))[_0x0112('0xe')](function(_0x1065db){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x1065db[_0x0112('0x35')]));if(_0x1351ef!=='unmanaged'){logger[_0x0112('0xd')]('['+[_0x1351ef[_0x0112('0x1e')]()]+']',_0x0112('0x4e'));emit(_0x2446ad,_0x4c42d1[_0x0112('0x4f')],_0x1065db['endUserId']);}})[_0x0112('0x15')](function(_0x453e3a){logger[_0x0112('0x16')]('['+[_0x1351ef['toUpperCase']()]+_0x0112('0x50'),util['inspect'](_0x453e3a,{'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 8b0ef41..661bdc9 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 _0xb413=['log','unmanaged','freshdesk','desk','unknown\x20integration','error','[EXEC]','format','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','zoho','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data1','data2','find','Configurations','queue','outbound'];(function(_0x4ebb5d,_0x1e92b6){var _0x5abafd=function(_0x2e1f57){while(--_0x2e1f57){_0x4ebb5d['push'](_0x4ebb5d['shift']());}};_0x5abafd(++_0x1e92b6);}(_0xb413,0x158));var _0x3b41=function(_0x5b4a5d,_0x50898d){_0x5b4a5d=_0x5b4a5d-0x0;var _0x5d8171=_0xb413[_0x5b4a5d];return _0x5d8171;};'use strict';var _=require(_0x3b41('0x0'));var util=require('util');var zendesk=require(_0x3b41('0x1'));var salesforce=require(_0x3b41('0x2'));var sugarcrm=require(_0x3b41('0x3'));var freshdesk=require(_0x3b41('0x4'));var zoho=require(_0x3b41('0x5'));var desk=require(_0x3b41('0x6'));var vtiger=require(_0x3b41('0x7'));var servicenow=require(_0x3b41('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x3b41('0x9'));var integrations=[_0x3b41('0xa'),_0x3b41('0xb'),_0x3b41('0xc'),'freshdesk',_0x3b41('0xd'),'desk',_0x3b41('0xe'),_0x3b41('0xf'),_0x3b41('0x10'),_0x3b41('0x11')];exports[_0x3b41('0x12')]=function(_0xf98d76,_0x4b9a22,_0x4de420,_0x18ae56,_0x433753,_0x416082){if(_0x4de420){if(_['includes'](integrations,_0xf98d76['data1'][_0x3b41('0x13')]())){try{var _0x523988=null;var _0x4d3e7c='';var _0x5e7dab=_0x4de420[_0xf98d76[_0x3b41('0x14')][_0x3b41('0x13')]()];if(_0x5e7dab){var _0x33bdd0=_0x5e7dab[_0xf98d76[_0x3b41('0x15')]];if(_0x33bdd0){var _0x2bdfdf=_[_0x3b41('0x16')](_0x33bdd0[_0x3b41('0x17')],{'id':parseInt(_0xf98d76['data3'],0xa)});if(_0x2bdfdf){if(_0x18ae56){if(_0x433753&&_0x4b9a22[_0x3b41('0x18')]){_0x4d3e7c=_0x3b41('0x18');}else if(_0x4b9a22['routeId']){_0x4d3e7c=_0x3b41('0x19');}else{console[_0x3b41('0x1a')]('EVENT\x20UNKNOWN',_0x4b9a22);}}else{_0x4d3e7c=_0x3b41('0x1b');}switch(_0xf98d76['data1']['toLowerCase']()){case _0x3b41('0xa'):zendesk[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0xb'):salesforce[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0xc'):sugarcrm[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0x1c'):freshdesk[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0xd'):zoho[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0x1d'):desk[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case'vtiger':vtiger[_0x4d3e7c](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082);break;case _0x3b41('0x10'):freshsales['cs'](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082,_0x4d3e7c);break;case _0x3b41('0x11'):servicenow['cs'](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082,_0x4d3e7c);break;case _0x3b41('0xf'):dynamics365['cs'](_0xf98d76,_0x4b9a22,_0x2bdfdf,_0x18ae56,_0x433753,_0x33bdd0,_0x416082,_0x4d3e7c);break;default:console[_0x3b41('0x1a')](_0x3b41('0x1e'));}}else{_0x523988=require('../../../../config/logger')(_0xf98d76[_0x3b41('0x14')][_0x3b41('0x13')]());_0x523988[_0x3b41('0x1f')](_0x3b41('0x20'),util[_0x3b41('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0xf98d76[_0x3b41('0x14')][_0x3b41('0x13')](),_0xf98d76[_0x3b41('0x22')]));}}else{_0x523988=require(_0x3b41('0x23'))(_0xf98d76[_0x3b41('0x14')][_0x3b41('0x13')]());_0x523988['error']('[EXEC]',util[_0x3b41('0x21')](_0x3b41('0x24'),_0xf98d76['data1'][_0x3b41('0x13')](),_0xf98d76['data2']));}}else{}}catch(_0x417e74){console['error'](_0x417e74);}}}}; \ No newline at end of file +var _0xc6ba=['../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','./zendesk','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','exec','data1','toLowerCase','data2','find','queue','routeId','outbound','EVENT\x20UNKNOWN','zendesk','freshsales','servicenow','log'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xc6ba,0x8f));var _0xac6b=function(_0x3a0037,_0xad381b){_0x3a0037=_0x3a0037-0x0;var _0x580408=_0xc6ba[_0x3a0037];return _0x580408;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xac6b('0x0'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xac6b('0x1'));var zoho=require(_0xac6b('0x2'));var desk=require('./desk');var vtiger=require(_0xac6b('0x3'));var servicenow=require(_0xac6b('0x4'));var dynamics365=require(_0xac6b('0x5'));var freshsales=require(_0xac6b('0x6'));var integrations=['zendesk',_0xac6b('0x7'),_0xac6b('0x8'),_0xac6b('0x9'),_0xac6b('0xa'),_0xac6b('0xb'),_0xac6b('0xc'),_0xac6b('0xd'),'freshsales','servicenow'];exports[_0xac6b('0xe')]=function(_0x5ece88,_0x33bec8,_0x52a6a2,_0x313d4b,_0x59676d,_0x6a98eb){if(_0x52a6a2){if(_['includes'](integrations,_0x5ece88[_0xac6b('0xf')][_0xac6b('0x10')]())){try{var _0x3f563f=null;var _0x7ef1f1='';var _0x2f4bcf=_0x52a6a2[_0x5ece88[_0xac6b('0xf')][_0xac6b('0x10')]()];if(_0x2f4bcf){var _0x1ecc1a=_0x2f4bcf[_0x5ece88[_0xac6b('0x11')]];if(_0x1ecc1a){var _0x24af89=_[_0xac6b('0x12')](_0x1ecc1a['Configurations'],{'id':parseInt(_0x5ece88['data3'],0xa)});if(_0x24af89){if(_0x313d4b){if(_0x59676d&&_0x33bec8[_0xac6b('0x13')]){_0x7ef1f1=_0xac6b('0x13');}else if(_0x33bec8[_0xac6b('0x14')]){_0x7ef1f1=_0xac6b('0x15');}else{console['log'](_0xac6b('0x16'),_0x33bec8);}}else{_0x7ef1f1='unmanaged';}switch(_0x5ece88['data1'][_0xac6b('0x10')]()){case _0xac6b('0x17'):zendesk[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case'salesforce':salesforce[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0x8'):sugarcrm[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0x9'):freshdesk[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0xa'):zoho[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0xb'):desk[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0xc'):vtiger[_0x7ef1f1](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb);break;case _0xac6b('0x18'):freshsales['cs'](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb,_0x7ef1f1);break;case _0xac6b('0x19'):servicenow['cs'](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb,_0x7ef1f1);break;case _0xac6b('0xd'):dynamics365['cs'](_0x5ece88,_0x33bec8,_0x24af89,_0x313d4b,_0x59676d,_0x1ecc1a,_0x6a98eb,_0x7ef1f1);break;default:console[_0xac6b('0x1a')]('unknown\x20integration');}}else{_0x3f563f=require(_0xac6b('0x1b'))(_0x5ece88[_0xac6b('0xf')][_0xac6b('0x10')]());_0x3f563f[_0xac6b('0x1c')](_0xac6b('0x1d'),util[_0xac6b('0x1e')](_0xac6b('0x1f'),_0x5ece88[_0xac6b('0xf')]['toLowerCase'](),_0x5ece88[_0xac6b('0x20')]));}}else{_0x3f563f=require(_0xac6b('0x1b'))(_0x5ece88[_0xac6b('0xf')]['toLowerCase']());_0x3f563f[_0xac6b('0x1c')]('[EXEC]',util[_0xac6b('0x1e')](_0xac6b('0x21'),_0x5ece88[_0xac6b('0xf')]['toLowerCase'](),_0x5ece88[_0xac6b('0x11')]));}}else{}}catch(_0x5740d9){console[_0xac6b('0x1c')](_0x5740d9);}}}}; \ 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 98c7835..5b7ce26 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 _0xa0ab=['content','toString','variableName','customVariable','name','toLowerCase','Variable','password','concat','securityToken','Connection','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','newTab','trigger:browser:url','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','recordingURL','calleridname',']\x20Ticket\x20%s\x20created.','lodash','moment','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','Case','contact','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','length','first','Name','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','No\x20Company','forEach','includes','string','picklist','idField'];(function(_0x2f506a,_0x41d7f1){var _0x20edb9=function(_0x344d18){while(--_0x344d18){_0x2f506a['push'](_0x2f506a['shift']());}};_0x20edb9(++_0x41d7f1);}(_0xa0ab,0x1bc));var _0xba0a=function(_0x2b825a,_0x51e538){_0x2b825a=_0x2b825a-0x0;var _0x516ffa=_0xa0ab[_0x2b825a];return _0x516ffa;};'use strict';var _=require(_0xba0a('0x0'));var rp=require('request-promise');var moment=require(_0xba0a('0x1'));var BPromise=require('bluebird');var md5=require(_0xba0a('0x2'));var jsforce=require(_0xba0a('0x3'));var util=require(_0xba0a('0x4'));var Redis=require('ioredis');var intUtil=require(_0xba0a('0x5'));var config=require(_0xba0a('0x6'));var logger=require(_0xba0a('0x7'))(_0xba0a('0x8'));config[_0xba0a('0x9')]=_[_0xba0a('0xa')](config[_0xba0a('0x9')],{'host':_0xba0a('0xb'),'port':0x18eb});var io=require(_0xba0a('0xc'))(new Redis(config[_0xba0a('0x9')]));function emit(_0x45f1f4,_0x4685ca,_0x3b482d){io['to'](_0x45f1f4)[_0xba0a('0xd')](_0x4685ca,_0x3b482d);}function getTicket(_0x27d184,_0x44a987,_0x348920,_0x2b6b19,_0x1e1682,_0x58b4f3,_0x391d3a,_0x554953){var _0x5ed7e5=Object[_0xba0a('0xe')]({},{'OwnerId':_0x44a987['id'],'Subject':intUtil[_0xba0a('0xf')](_0x2b6b19[_0xba0a('0x10')],_0x1e1682,'\x20'),'Description':intUtil['getString'](_0x2b6b19[_0xba0a('0x11')],_0x1e1682,'\x0a')},getCustomFields(_0x58b4f3,_0x1e1682));if(_0x348920){if(_0x2b6b19[_0xba0a('0x12')]==='Task'){_0x5ed7e5[_0xba0a('0x13')]=moment[_0xba0a('0x14')]();_0x5ed7e5[_0xba0a('0x15')]=![];_0x5ed7e5[_0xba0a('0x16')]=![];if(_0x348920['endUserType']==='contact'||_0x348920[_0xba0a('0x17')]===_0xba0a('0x18')){_0x5ed7e5['WhoId']=_0x348920['id'];}else if(_0x348920[_0xba0a('0x17')]===_0xba0a('0x19')){_0x5ed7e5[_0xba0a('0x1a')]=_0x348920['id'];}}else if(_0x2b6b19[_0xba0a('0x12')]===_0xba0a('0x1b')){if(_0x348920['endUserType']===_0xba0a('0x1c')){_0x5ed7e5['ContactId']=_0x348920['id'];}else if(_0x348920[_0xba0a('0x17')]===_0xba0a('0x19')){_0x5ed7e5[_0xba0a('0x1d')]=_0x348920['id'];}else if(_0x348920[_0xba0a('0x17')]===_0xba0a('0x18')&&_0x2b6b19['leadId']){_0x5ed7e5[_0x2b6b19[_0xba0a('0x1e')]]=_0x348920['id'];}else{logger[_0xba0a('0x1f')](_0xba0a('0x20'));}}}return _0x391d3a[_0xba0a('0x21')](_0x2b6b19[_0xba0a('0x12')])[_0xba0a('0x22')](_0x5ed7e5);}function getUser(_0x7f27f8,_0x34bc57,_0x1f0753){if(!_[_0xba0a('0x23')](_0x34bc57)&&intUtil[_0xba0a('0x24')](_0x34bc57)){var _0x133066={'Email':_0x34bc57};var _0x3a0053={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1f0753['sobject'](_0xba0a('0x25'))[_0xba0a('0x26')](_0x133066,_0x3a0053)[_0xba0a('0x27')]()['then'](function(_0x314a8e){if(_0x314a8e['length']){var _0x2abc92=_[_0xba0a('0x26')](_0x314a8e,function(_0x3b07fb){return _0x3b07fb[_0xba0a('0x28')]===_0x34bc57;});if(_0x2abc92){logger[_0xba0a('0x1f')](_0xba0a('0x29'),_0x34bc57);return BPromise[_0xba0a('0x2a')]({'id':_0x2abc92['Id'],'name':_0x2abc92['Name']});}}else{logger['info'](_0xba0a('0x2b'),_0x34bc57);return _0x1f0753['identity']()[_0xba0a('0x2c')](function(_0x4ce70c){return BPromise[_0xba0a('0x2a')]({'id':_0x4ce70c['user_id'],'name':_0x4ce70c[_0xba0a('0x2d')]});});}});}else{logger[_0xba0a('0x1f')](_0xba0a('0x2b'),_0x34bc57);return _0x1f0753[_0xba0a('0x2e')]()[_0xba0a('0x2c')](function(_0x8d888d){return BPromise[_0xba0a('0x2a')]({'id':_0x8d888d[_0xba0a('0x2f')],'name':_0x8d888d[_0xba0a('0x2d')]});});}}function getEndUser(_0x59ac06,_0x4358d9,_0x205130,_0x1dfec0,_0x34bb52){var _0x4eef1b={'$or':{'Phone':_0x1dfec0}};var _0x26e9a0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xba0a('0x2a')]()[_0xba0a('0x2c')](function(){logger[_0xba0a('0x1f')](_0xba0a('0x30'),_0x1dfec0,_0x4358d9[_0xba0a('0x31')]);switch(_0x4358d9['moduleSearch']){case'contact_lead':var _0x1903d3=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9['additionalSearchContact']){var _0x5c985b={};_0x5c985b[_0x4358d9[_0xba0a('0x33')]]=_0x1dfec0;_[_0xba0a('0x34')](_0x1903d3[_0xba0a('0x35')],_0x5c985b);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x36'))['find'](_0x1903d3,_0x26e9a0)['execute']()[_0xba0a('0x2c')](function(_0x23fe0b){if(_0x23fe0b&&_0x23fe0b['length']){return _0x23fe0b;}else{var _0x1bcfbb=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9[_0xba0a('0x37')]){var _0x556ad4={};_0x556ad4[_0x4358d9['additionalSearchLead']]=_0x1dfec0;_[_0xba0a('0x34')](_0x1bcfbb['$or'],_0x556ad4);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x38'))[_0xba0a('0x26')](_0x1bcfbb,_0x26e9a0);}});case _0xba0a('0x39'):var _0x44acd0=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9[_0xba0a('0x3a')]){var _0x5c985b={};_0x5c985b[_0x4358d9[_0xba0a('0x3a')]]=_0x1dfec0;_[_0xba0a('0x34')](_0x44acd0[_0xba0a('0x35')],_0x5c985b);}return _0x34bb52['sobject'](_0xba0a('0x3b'))[_0xba0a('0x26')](_0x44acd0,_0x26e9a0)[_0xba0a('0x27')]()[_0xba0a('0x2c')](function(_0xd484f6){if(_0xd484f6&&_0xd484f6['length']){return _0xd484f6;}else{var _0x4a180c=_['cloneDeep'](_0x4eef1b);if(_0x4358d9[_0xba0a('0x33')]){var _0x2f4983={};_0x2f4983[_0x4358d9[_0xba0a('0x33')]]=_0x1dfec0;_[_0xba0a('0x34')](_0x4a180c[_0xba0a('0x35')],_0x2f4983);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x36'))[_0xba0a('0x26')](_0x4a180c,_0x26e9a0)['then'](function(_0x599604){if(_0x599604&&_0x599604['length']){return _0x599604;}else{var _0x2c4424=_['cloneDeep'](_0x4eef1b);if(_0x4358d9['additionalSearchLead']){var _0x50c21c={};_0x50c21c[_0x4358d9[_0xba0a('0x37')]]=_0x1dfec0;_['merge'](_0x2c4424[_0xba0a('0x35')],_0x50c21c);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x38'))[_0xba0a('0x26')](_0x2c4424,_0x26e9a0);}});}});case _0xba0a('0x1c'):var _0x1903d3=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9[_0xba0a('0x33')]){var _0x5c985b={};_0x5c985b[_0x4358d9[_0xba0a('0x33')]]=_0x1dfec0;_[_0xba0a('0x34')](_0x1903d3[_0xba0a('0x35')],_0x5c985b);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x36'))['find'](_0x1903d3,_0x26e9a0)[_0xba0a('0x27')]();case _0xba0a('0x18'):var _0xd859df=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9[_0xba0a('0x37')]){var _0x5c985b={};_0x5c985b[_0x4358d9[_0xba0a('0x37')]]=_0x1dfec0;_[_0xba0a('0x34')](_0xd859df[_0xba0a('0x35')],_0x5c985b);}return _0x34bb52[_0xba0a('0x21')](_0xba0a('0x38'))[_0xba0a('0x26')](_0xd859df,_0x26e9a0);case _0xba0a('0x19'):var _0x44acd0=_[_0xba0a('0x32')](_0x4eef1b);if(_0x4358d9[_0xba0a('0x3a')]){var _0x5c985b={};_0x5c985b[_0x4358d9[_0xba0a('0x3a')]]=_0x1dfec0;_[_0xba0a('0x34')](_0x44acd0[_0xba0a('0x35')],_0x5c985b);}return _0x34bb52[_0xba0a('0x21')]('Account')[_0xba0a('0x26')](_0x44acd0,_0x26e9a0);default:return null;}})[_0xba0a('0x2c')](function(_0x53c19e){if(_0x53c19e&&_0x53c19e[_0xba0a('0x3c')]){var _0x4ca600=_[_0xba0a('0x3d')](_0x53c19e);if(_0x4ca600){return BPromise[_0xba0a('0x2a')]({'id':_0x4ca600['Id'],'name':_0x4ca600[_0xba0a('0x3e')],'phone':_0x4ca600[_0xba0a('0x3f')],'endUserType':_0x4ca600[_0xba0a('0x40')][_0xba0a('0x41')]['toLowerCase']()});}}})[_0xba0a('0x2c')](function(_0xd9c7eb){if(_0xd9c7eb){logger['info'](_0xba0a('0x42'),_0xd9c7eb['endUserType'],_0x1dfec0);return BPromise[_0xba0a('0x2a')](_0xd9c7eb);}else{logger[_0xba0a('0x1f')](_0xba0a('0x43'),_0x1dfec0);var _0x39dc66={'Phone':_0x1dfec0};if(_0x4358d9[_0xba0a('0x44')]){if(_0x4358d9[_0xba0a('0x44')]===_0xba0a('0x1c')){logger[_0xba0a('0x1f')](_0xba0a('0x45'),_0x1dfec0,_0x4358d9[_0xba0a('0x44')]);_0x39dc66[_0xba0a('0x46')]=_0x205130!==_0xba0a('0x47')?_0x205130:util[_0xba0a('0x48')](_0xba0a('0x49'),_0x1dfec0);}else if(_0x4358d9[_0xba0a('0x44')]===_0xba0a('0x18')){logger['info'](_0xba0a('0x45'),_0x1dfec0,_0x4358d9['moduleCreate']);_0x39dc66[_0xba0a('0x46')]=_0x205130!==_0xba0a('0x47')?_0x205130:util[_0xba0a('0x48')](_0xba0a('0x49'),_0x1dfec0);_0x39dc66['Company']=_0xba0a('0x4a');}else if(_0x4358d9['moduleCreate']===_0xba0a('0x19')){logger[_0xba0a('0x1f')](_0xba0a('0x45'),_0x1dfec0,_0x4358d9[_0xba0a('0x44')]);_0x39dc66[_0xba0a('0x3e')]=_0x205130!==_0xba0a('0x47')?_0x205130:util[_0xba0a('0x48')]('Caller\x20-\x20%s',_0x1dfec0);}else{return null;}}return _0x34bb52[_0xba0a('0x21')](_['upperFirst'](_0x4358d9[_0xba0a('0x44')]))[_0xba0a('0x22')](_0x39dc66)[_0xba0a('0x2c')](function(_0x15f00a){return BPromise[_0xba0a('0x2a')]({'id':_0x15f00a['id'],'endUserType':_0x4358d9[_0xba0a('0x44')]});});}});}function getCustomFields(_0x21509c,_0x307a79){var _0x48d6db={};if(_0x21509c[_0xba0a('0x3c')]>0x0){_[_0xba0a('0x4b')](_0x21509c,function(_0x267afd){if(_[_0xba0a('0x4c')]([_0xba0a('0x4d'),_0xba0a('0x4e')],_0x267afd['type'])&&_0x267afd[_0xba0a('0x4f')]){_0x48d6db[_0x267afd[_0xba0a('0x4f')]]=_0x267afd[_0xba0a('0x50')][_0xba0a('0x51')]();}else if(_0x267afd[_0xba0a('0x41')]==='variable'&&_0x267afd['variableName']&&_0x267afd[_0xba0a('0x4f')]){_0x307a79[_0x267afd[_0xba0a('0x52')]]&&(_0x48d6db[_0x267afd[_0xba0a('0x4f')]]=_0x307a79[_0x267afd['variableName']][_0xba0a('0x51')]());}else if(_0x267afd[_0xba0a('0x41')]===_0xba0a('0x53')&&_0x267afd['Variable']&&_0x267afd['Variable'][_0xba0a('0x54')]&&_0x267afd[_0xba0a('0x4f')]){_0x307a79[_0x267afd['Variable'][_0xba0a('0x54')][_0xba0a('0x55')]()]&&(_0x48d6db[_0x267afd[_0xba0a('0x4f')]]=_0x307a79[_0x267afd[_0xba0a('0x56')][_0xba0a('0x54')][_0xba0a('0x55')]()][_0xba0a('0x51')]());}});}return _0x48d6db;}function getConnection(_0x508665){var _0x461d2c=_0x508665[_0xba0a('0x57')][_0xba0a('0x58')](_0x508665[_0xba0a('0x59')]);var _0x3128a8=new jsforce[(_0xba0a('0x5a'))]({'oauth2':{'loginUrl':_0x508665['remoteUri']||'https://login.salesforce.com','clientId':_0x508665[_0xba0a('0x5b')],'clientSecret':_0x508665[_0xba0a('0x5c')]}});return _0x3128a8[_0xba0a('0x5d')](_0x508665['username'],_0x461d2c)[_0xba0a('0x2c')](function(){logger[_0xba0a('0x1f')](_0xba0a('0x5e'));return _0x3128a8;});}exports['queue']=function(_0x268d34,_0x22b247,_0x436079,_0x27d930,_0x46e382,_0x4ee459){var _0x561f2a,_0x2cd2a2,_0x41631f,_0x404cf1;_0x4ee459[_0xba0a('0x5f')]=intUtil[_0xba0a('0x60')](_0x4ee459[_0xba0a('0x5f')]);_0x4ee459[_0xba0a('0x61')]=intUtil['stripTrailingSlash'](_0x4ee459['remoteUri']);if(_0x46e382&&_0x46e382[_0xba0a('0x62')]){logger[_0xba0a('0x1f')](_0xba0a('0x63'),_0xba0a('0x64'));_0x22b247['recordingURL']=util[_0xba0a('0x48')](_0xba0a('0x65'),_0x4ee459[_0xba0a('0x5f')],_0x22b247[_0xba0a('0x66')],md5(_0x22b247[_0xba0a('0x66')]));}else{_0x22b247['recordingURL']='';}return getConnection(_0x4ee459)['then'](function(_0x33c97a){_0x404cf1=_0x33c97a;return getUser(_0x4ee459,_0x27d930[_0xba0a('0x67')],_0x404cf1);})[_0xba0a('0x2c')](function(_0x41dab4){_0x561f2a=_0x41dab4;return getEndUser(_0x4ee459,_0x436079,_0x22b247['calleridname'],_0x22b247[_0xba0a('0x68')],_0x404cf1);})[_0xba0a('0x2c')](function(_0x16a47f){_0x2cd2a2=_0x16a47f;return getTicket(_0x4ee459,_0x561f2a,_0x2cd2a2,_0x436079,_0x22b247,_0x436079[_0xba0a('0x69')],_0x404cf1,_0xba0a('0x6a'));})[_0xba0a('0x2c')](function(_0x326752){_0x41631f=_0x326752;logger[_0xba0a('0x1f')](_0xba0a('0x6b'),_0x41631f['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x41631f['id'],_0x27d930['name'],_0x4ee459[_0xba0a('0x41')]);switch(_0x4ee459['type']){case _0xba0a('0x6c'):emit(util[_0xba0a('0x48')](_0xba0a('0x6d'),_0x27d930[_0xba0a('0x54')]),'trigger:salesforce:display',{'recordId':_0x41631f['id']});break;case _0xba0a('0x6e'):emit(util['format'](_0xba0a('0x6d'),_0x27d930[_0xba0a('0x54')]),_0xba0a('0x6f'),{'uri':util[_0xba0a('0x48')]('%s/%s/e',_0x404cf1['instanceUrl'],_0x41631f['id'])});break;default:logger['error'](_0xba0a('0x70'));}})[_0xba0a('0x71')](function(_0x2d6f6f){logger[_0xba0a('0x72')]('[QUEUE]',_0x2d6f6f);});};exports['outbound']=function(_0x235f3f,_0x263bef,_0x51a890,_0x2d956c,_0x2cb515,_0x12c29e,_0x3e1b8f){var _0x5eb422,_0x5eda62,_0x5b0d33,_0x4a1c2e;_0x12c29e[_0xba0a('0x5f')]=intUtil['stripTrailingSlash'](_0x12c29e[_0xba0a('0x5f')]);_0x12c29e[_0xba0a('0x61')]=intUtil[_0xba0a('0x60')](_0x12c29e[_0xba0a('0x61')]);if(_0x3e1b8f&&_0x3e1b8f[_0xba0a('0x73')]&&_0x3e1b8f[_0xba0a('0x73')]!=='none'){logger[_0xba0a('0x1f')](_0xba0a('0x74'),_0xba0a('0x64'));_0x263bef['recordingURL']=util[_0xba0a('0x48')](_0xba0a('0x65'),_0x12c29e[_0xba0a('0x5f')],_0x263bef[_0xba0a('0x66')],md5(_0x263bef[_0xba0a('0x66')]));}return getConnection(_0x12c29e)['then'](function(_0x30ba40){_0x4a1c2e=_0x30ba40;return getUser(_0x12c29e,_0x2d956c[_0xba0a('0x67')],_0x4a1c2e);})[_0xba0a('0x2c')](function(_0x1e5339){_0x5eb422=_0x1e5339;return getEndUser(_0x12c29e,_0x51a890,_0x263bef[_0xba0a('0x75')],_0x263bef[_0xba0a('0x76')],_0x4a1c2e);})[_0xba0a('0x2c')](function(_0x58a6b3){_0x5eda62=_0x58a6b3;return getTicket(_0x12c29e,_0x5eb422,_0x5eda62,_0x51a890,_0x263bef,_0x51a890[_0xba0a('0x69')],_0x4a1c2e,_0xba0a('0x77'));})[_0xba0a('0x2c')](function(_0x6eb76c){_0x5b0d33=_0x6eb76c;logger[_0xba0a('0x1f')](_0xba0a('0x78'),_0x5b0d33['id']);logger[_0xba0a('0x1f')](_0xba0a('0x79'),_0x5b0d33['id'],_0x2d956c[_0xba0a('0x54')],_0x12c29e[_0xba0a('0x41')]);switch(_0x12c29e[_0xba0a('0x41')]){case _0xba0a('0x6c'):emit(util[_0xba0a('0x48')](_0xba0a('0x6d'),_0x2d956c['name']),_0xba0a('0x7a'),{'recordId':_0x5b0d33['id']});break;case _0xba0a('0x6e'):emit(util['format']('user:%s',_0x2d956c['name']),_0xba0a('0x6f'),{'uri':util[_0xba0a('0x48')]('%s/%s/e',_0x4a1c2e[_0xba0a('0x7b')],_0x5b0d33['id'])});break;default:logger['error']('[OUTBOUND]',_0xba0a('0x7c'));}})[_0xba0a('0x71')](function(_0x48b46b){logger['error'](_0xba0a('0x74'),_0x48b46b);});};exports[_0xba0a('0x7d')]=function(_0x20e5c6,_0x6e017a,_0x3ebb37,_0x424875,_0x152867,_0x1fe6ca){var _0x28dac1,_0x1c7e04,_0x451845,_0x3ef439;_0x1fe6ca[_0xba0a('0x5f')]=intUtil['stripTrailingSlash'](_0x1fe6ca[_0xba0a('0x5f')]);_0x1fe6ca[_0xba0a('0x61')]=intUtil[_0xba0a('0x60')](_0x1fe6ca[_0xba0a('0x61')]);if(_0x152867&&_0x152867['monitor_format']){logger[_0xba0a('0x1f')]('['+_0x6e017a[_0xba0a('0x7e')][_0xba0a('0x7f')]()+']','Recording\x20is\x20enabled!');_0x6e017a[_0xba0a('0x80')]=util[_0xba0a('0x48')](_0xba0a('0x65'),_0x1fe6ca[_0xba0a('0x5f')],_0x6e017a[_0xba0a('0x66')],md5(_0x6e017a[_0xba0a('0x66')]));}else{_0x6e017a['recordingURL']='';}return getConnection(_0x1fe6ca)['then'](function(_0x49b037){_0x3ef439=_0x49b037;if(!_[_0xba0a('0x23')](_0x424875)){return getUser(_0x1fe6ca,_0x424875[_0xba0a('0x54')],_0x3ef439);}else{return getUser(_0x1fe6ca,null,_0x3ef439);}})[_0xba0a('0x2c')](function(_0x43dc69){_0x28dac1=_0x43dc69;return getEndUser(_0x1fe6ca,_0x3ebb37,_0x6e017a[_0xba0a('0x81')],_0x6e017a[_0xba0a('0x68')],_0x3ef439);})['then'](function(_0x3ff6c6){_0x1c7e04=_0x3ff6c6;return getTicket(_0x1fe6ca,_0x28dac1,_0x1c7e04,_0x3ebb37,_0x6e017a,_0x3ebb37[_0xba0a('0x69')],_0x3ef439);})[_0xba0a('0x2c')](function(_0x224a02){_0x451845=_0x224a02;logger[_0xba0a('0x1f')]('['+_0x6e017a[_0xba0a('0x7e')]['toUpperCase']()+_0xba0a('0x82'),_0x451845['id']);logger[_0xba0a('0x1f')]('['+_0x6e017a[_0xba0a('0x7e')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x1fe6ca[_0xba0a('0x41')]);})[_0xba0a('0x71')](function(_0x49584b){logger[_0xba0a('0x72')]('['+_0x6e017a[_0xba0a('0x7e')]['toUpperCase']()+']',_0x49584b);});}; \ No newline at end of file +var _0xddcd=['Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','contact','first','resolve','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[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','newTab','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','%s/%s/e','instanceUrl','catch','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','ticketType','create','isNil','validateEmail','User','find','execute','then','length','Email'];(function(_0x24d64d,_0x2ffc07){var _0x14c101=function(_0x276cdc){while(--_0x276cdc){_0x24d64d['push'](_0x24d64d['shift']());}};_0x14c101(++_0x2ffc07);}(_0xddcd,0xdb));var _0xdddc=function(_0x20829a,_0x32ca56){_0x20829a=_0x20829a-0x0;var _0x13bf1d=_0xddcd[_0x20829a];return _0x13bf1d;};'use strict';var _=require(_0xdddc('0x0'));var rp=require(_0xdddc('0x1'));var moment=require('moment');var BPromise=require(_0xdddc('0x2'));var md5=require(_0xdddc('0x3'));var jsforce=require(_0xdddc('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xdddc('0x5'));var config=require(_0xdddc('0x6'));var logger=require(_0xdddc('0x7'))('salesforce');config[_0xdddc('0x8')]=_[_0xdddc('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xdddc('0xa'))(new Redis(config[_0xdddc('0x8')]));function emit(_0x18a3be,_0x3bfb24,_0x92a8bc){io['to'](_0x18a3be)[_0xdddc('0xb')](_0x3bfb24,_0x92a8bc);}function getTicket(_0x28baae,_0x476cc2,_0x5b537a,_0x3300bf,_0x2d2557,_0x431b0d,_0x5c42f9,_0x49bff2){var _0xddcc3d=Object[_0xdddc('0xc')]({},{'OwnerId':_0x476cc2['id'],'Subject':intUtil[_0xdddc('0xd')](_0x3300bf[_0xdddc('0xe')],_0x2d2557,'\x20'),'Description':intUtil[_0xdddc('0xd')](_0x3300bf[_0xdddc('0xf')],_0x2d2557,'\x0a')},getCustomFields(_0x431b0d,_0x2d2557));if(_0x5b537a){if(_0x3300bf['ticketType']===_0xdddc('0x10')){_0xddcc3d['ActivityDate']=moment[_0xdddc('0x11')]();_0xddcc3d[_0xdddc('0x12')]=![];_0xddcc3d[_0xdddc('0x13')]=![];if(_0x5b537a[_0xdddc('0x14')]==='contact'||_0x5b537a[_0xdddc('0x14')]===_0xdddc('0x15')){_0xddcc3d[_0xdddc('0x16')]=_0x5b537a['id'];}else if(_0x5b537a[_0xdddc('0x14')]===_0xdddc('0x17')){_0xddcc3d[_0xdddc('0x18')]=_0x5b537a['id'];}}else if(_0x3300bf['ticketType']==='Case'){if(_0x5b537a[_0xdddc('0x14')]==='contact'){_0xddcc3d[_0xdddc('0x19')]=_0x5b537a['id'];}else if(_0x5b537a[_0xdddc('0x14')]===_0xdddc('0x17')){_0xddcc3d[_0xdddc('0x1a')]=_0x5b537a['id'];}else if(_0x5b537a[_0xdddc('0x14')]===_0xdddc('0x15')&&_0x3300bf['leadId']){_0xddcc3d[_0x3300bf[_0xdddc('0x1b')]]=_0x5b537a['id'];}else{logger[_0xdddc('0x1c')](_0xdddc('0x1d'));}}}return _0x5c42f9[_0xdddc('0x1e')](_0x3300bf[_0xdddc('0x1f')])[_0xdddc('0x20')](_0xddcc3d);}function getUser(_0x508395,_0x2a8b82,_0x5b24dc){if(!_[_0xdddc('0x21')](_0x2a8b82)&&intUtil[_0xdddc('0x22')](_0x2a8b82)){var _0x51e629={'Email':_0x2a8b82};var _0x676593={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5b24dc['sobject'](_0xdddc('0x23'))[_0xdddc('0x24')](_0x51e629,_0x676593)[_0xdddc('0x25')]()[_0xdddc('0x26')](function(_0x4c7a36){if(_0x4c7a36[_0xdddc('0x27')]){var _0x3417f9=_['find'](_0x4c7a36,function(_0x2bd781){return _0x2bd781[_0xdddc('0x28')]===_0x2a8b82;});if(_0x3417f9){logger[_0xdddc('0x1c')](_0xdddc('0x29'),_0x2a8b82);return BPromise['resolve']({'id':_0x3417f9['Id'],'name':_0x3417f9[_0xdddc('0x2a')]});}}else{logger['info'](_0xdddc('0x2b'),_0x2a8b82);return _0x5b24dc[_0xdddc('0x2c')]()[_0xdddc('0x26')](function(_0x2ffa16){return BPromise['resolve']({'id':_0x2ffa16[_0xdddc('0x2d')],'name':_0x2ffa16[_0xdddc('0x2e')]});});}});}else{logger[_0xdddc('0x1c')](_0xdddc('0x2b'),_0x2a8b82);return _0x5b24dc[_0xdddc('0x2c')]()[_0xdddc('0x26')](function(_0x3f79d4){return BPromise['resolve']({'id':_0x3f79d4[_0xdddc('0x2d')],'name':_0x3f79d4[_0xdddc('0x2e')]});});}}function getEndUser(_0x74d25,_0x21489b,_0x2d8455,_0x33d79f,_0x490d2){var _0x13c8b9={'$or':{'Phone':_0x33d79f}};var _0x57b5b4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xdddc('0x26')](function(){logger[_0xdddc('0x1c')](_0xdddc('0x2f'),_0x33d79f,_0x21489b[_0xdddc('0x30')]);switch(_0x21489b[_0xdddc('0x30')]){case _0xdddc('0x31'):var _0x47029b=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b[_0xdddc('0x33')]){var _0x3fbebb={};_0x3fbebb[_0x21489b[_0xdddc('0x33')]]=_0x33d79f;_[_0xdddc('0x34')](_0x47029b[_0xdddc('0x35')],_0x3fbebb);}return _0x490d2[_0xdddc('0x1e')](_0xdddc('0x36'))['find'](_0x47029b,_0x57b5b4)[_0xdddc('0x25')]()[_0xdddc('0x26')](function(_0x4a3b74){if(_0x4a3b74&&_0x4a3b74['length']){return _0x4a3b74;}else{var _0x71e4ed=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b[_0xdddc('0x37')]){var _0x303a86={};_0x303a86[_0x21489b[_0xdddc('0x37')]]=_0x33d79f;_[_0xdddc('0x34')](_0x71e4ed[_0xdddc('0x35')],_0x303a86);}return _0x490d2[_0xdddc('0x1e')](_0xdddc('0x38'))[_0xdddc('0x24')](_0x71e4ed,_0x57b5b4);}});case'account_contact_lead':var _0x2a26f9=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b['additionalSearchAccount']){var _0x3fbebb={};_0x3fbebb[_0x21489b[_0xdddc('0x39')]]=_0x33d79f;_[_0xdddc('0x34')](_0x2a26f9[_0xdddc('0x35')],_0x3fbebb);}return _0x490d2['sobject'](_0xdddc('0x3a'))['find'](_0x2a26f9,_0x57b5b4)[_0xdddc('0x25')]()[_0xdddc('0x26')](function(_0x55b99d){if(_0x55b99d&&_0x55b99d[_0xdddc('0x27')]){return _0x55b99d;}else{var _0x3b7341=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b[_0xdddc('0x33')]){var _0x2cad71={};_0x2cad71[_0x21489b[_0xdddc('0x33')]]=_0x33d79f;_[_0xdddc('0x34')](_0x3b7341[_0xdddc('0x35')],_0x2cad71);}return _0x490d2[_0xdddc('0x1e')](_0xdddc('0x36'))['find'](_0x3b7341,_0x57b5b4)[_0xdddc('0x26')](function(_0xb3d35a){if(_0xb3d35a&&_0xb3d35a[_0xdddc('0x27')]){return _0xb3d35a;}else{var _0x5c49a7=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b[_0xdddc('0x37')]){var _0x2d526c={};_0x2d526c[_0x21489b[_0xdddc('0x37')]]=_0x33d79f;_[_0xdddc('0x34')](_0x5c49a7[_0xdddc('0x35')],_0x2d526c);}return _0x490d2['sobject'](_0xdddc('0x38'))[_0xdddc('0x24')](_0x5c49a7,_0x57b5b4);}});}});case _0xdddc('0x3b'):var _0x47029b=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b[_0xdddc('0x33')]){var _0x3fbebb={};_0x3fbebb[_0x21489b['additionalSearchContact']]=_0x33d79f;_[_0xdddc('0x34')](_0x47029b['$or'],_0x3fbebb);}return _0x490d2[_0xdddc('0x1e')](_0xdddc('0x36'))[_0xdddc('0x24')](_0x47029b,_0x57b5b4)['execute']();case _0xdddc('0x15'):var _0x3379b1=_[_0xdddc('0x32')](_0x13c8b9);if(_0x21489b['additionalSearchLead']){var _0x3fbebb={};_0x3fbebb[_0x21489b[_0xdddc('0x37')]]=_0x33d79f;_[_0xdddc('0x34')](_0x3379b1[_0xdddc('0x35')],_0x3fbebb);}return _0x490d2[_0xdddc('0x1e')](_0xdddc('0x38'))[_0xdddc('0x24')](_0x3379b1,_0x57b5b4);case'account':var _0x2a26f9=_['cloneDeep'](_0x13c8b9);if(_0x21489b['additionalSearchAccount']){var _0x3fbebb={};_0x3fbebb[_0x21489b[_0xdddc('0x39')]]=_0x33d79f;_[_0xdddc('0x34')](_0x2a26f9[_0xdddc('0x35')],_0x3fbebb);}return _0x490d2[_0xdddc('0x1e')]('Account')['find'](_0x2a26f9,_0x57b5b4);default:return null;}})['then'](function(_0x2734b0){if(_0x2734b0&&_0x2734b0[_0xdddc('0x27')]){var _0x22f60a=_[_0xdddc('0x3c')](_0x2734b0);if(_0x22f60a){return BPromise[_0xdddc('0x3d')]({'id':_0x22f60a['Id'],'name':_0x22f60a[_0xdddc('0x2a')],'phone':_0x22f60a['Phone'],'endUserType':_0x22f60a['attributes'][_0xdddc('0x3e')][_0xdddc('0x3f')]()});}}})[_0xdddc('0x26')](function(_0x4ba240){if(_0x4ba240){logger[_0xdddc('0x1c')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4ba240['endUserType'],_0x33d79f);return BPromise[_0xdddc('0x3d')](_0x4ba240);}else{logger['info'](_0xdddc('0x40'),_0x33d79f);var _0x4f72e8={'Phone':_0x33d79f};if(_0x21489b[_0xdddc('0x41')]){if(_0x21489b['moduleCreate']===_0xdddc('0x3b')){logger[_0xdddc('0x1c')](_0xdddc('0x42'),_0x33d79f,_0x21489b[_0xdddc('0x41')]);_0x4f72e8[_0xdddc('0x43')]=_0x2d8455!==_0xdddc('0x44')?_0x2d8455:util[_0xdddc('0x45')](_0xdddc('0x46'),_0x33d79f);}else if(_0x21489b[_0xdddc('0x41')]===_0xdddc('0x15')){logger[_0xdddc('0x1c')](_0xdddc('0x42'),_0x33d79f,_0x21489b['moduleCreate']);_0x4f72e8[_0xdddc('0x43')]=_0x2d8455!==_0xdddc('0x44')?_0x2d8455:util[_0xdddc('0x45')](_0xdddc('0x46'),_0x33d79f);_0x4f72e8['Company']=_0xdddc('0x47');}else if(_0x21489b[_0xdddc('0x41')]===_0xdddc('0x17')){logger[_0xdddc('0x1c')](_0xdddc('0x42'),_0x33d79f,_0x21489b[_0xdddc('0x41')]);_0x4f72e8[_0xdddc('0x2a')]=_0x2d8455!==_0xdddc('0x44')?_0x2d8455:util[_0xdddc('0x45')](_0xdddc('0x46'),_0x33d79f);}else{return null;}}return _0x490d2['sobject'](_[_0xdddc('0x48')](_0x21489b[_0xdddc('0x41')]))['create'](_0x4f72e8)[_0xdddc('0x26')](function(_0x25fed6){return BPromise['resolve']({'id':_0x25fed6['id'],'endUserType':_0x21489b[_0xdddc('0x41')]});});}});}function getCustomFields(_0x45fa9a,_0x45eec7){var _0x5a1dd0={};if(_0x45fa9a[_0xdddc('0x27')]>0x0){_[_0xdddc('0x49')](_0x45fa9a,function(_0x11f73b){if(_[_0xdddc('0x4a')]([_0xdddc('0x4b'),_0xdddc('0x4c')],_0x11f73b[_0xdddc('0x3e')])&&_0x11f73b[_0xdddc('0x4d')]){_0x5a1dd0[_0x11f73b['idField']]=_0x11f73b[_0xdddc('0x4e')]['toString']();}else if(_0x11f73b[_0xdddc('0x3e')]===_0xdddc('0x4f')&&_0x11f73b[_0xdddc('0x50')]&&_0x11f73b[_0xdddc('0x4d')]){_0x45eec7[_0x11f73b[_0xdddc('0x50')]]&&(_0x5a1dd0[_0x11f73b[_0xdddc('0x4d')]]=_0x45eec7[_0x11f73b['variableName']][_0xdddc('0x51')]());}else if(_0x11f73b['type']===_0xdddc('0x52')&&_0x11f73b[_0xdddc('0x53')]&&_0x11f73b[_0xdddc('0x53')][_0xdddc('0x54')]&&_0x11f73b[_0xdddc('0x4d')]){_0x45eec7[_0x11f73b['Variable'][_0xdddc('0x54')][_0xdddc('0x3f')]()]&&(_0x5a1dd0[_0x11f73b[_0xdddc('0x4d')]]=_0x45eec7[_0x11f73b[_0xdddc('0x53')][_0xdddc('0x54')][_0xdddc('0x3f')]()][_0xdddc('0x51')]());}});}return _0x5a1dd0;}function getConnection(_0x132e5a){var _0x5d5838=_0x132e5a[_0xdddc('0x55')][_0xdddc('0x56')](_0x132e5a[_0xdddc('0x57')]);var _0x70294d=new jsforce[(_0xdddc('0x58'))]({'oauth2':{'loginUrl':_0x132e5a[_0xdddc('0x59')]||_0xdddc('0x5a'),'clientId':_0x132e5a[_0xdddc('0x5b')],'clientSecret':_0x132e5a['clientSecret']}});return _0x70294d[_0xdddc('0x5c')](_0x132e5a[_0xdddc('0x5d')],_0x5d5838)[_0xdddc('0x26')](function(){logger[_0xdddc('0x1c')](_0xdddc('0x5e'));return _0x70294d;});}exports[_0xdddc('0x5f')]=function(_0x2db9d9,_0x103a5c,_0x4c20aa,_0x17b7d0,_0x43da97,_0x4e7a16){var _0x6fe3a8,_0x5a6f7b,_0x24f247,_0x2abf06;_0x4e7a16[_0xdddc('0x60')]=intUtil[_0xdddc('0x61')](_0x4e7a16[_0xdddc('0x60')]);_0x4e7a16[_0xdddc('0x59')]=intUtil[_0xdddc('0x61')](_0x4e7a16['remoteUri']);if(_0x43da97&&_0x43da97[_0xdddc('0x62')]){logger['info'](_0xdddc('0x63'),'Recording\x20is\x20enabled!');_0x103a5c[_0xdddc('0x64')]=util['format'](_0xdddc('0x65'),_0x4e7a16[_0xdddc('0x60')],_0x103a5c[_0xdddc('0x66')],md5(_0x103a5c[_0xdddc('0x66')]));}else{_0x103a5c[_0xdddc('0x64')]='';}return getConnection(_0x4e7a16)[_0xdddc('0x26')](function(_0x166d30){_0x2abf06=_0x166d30;return getUser(_0x4e7a16,_0x17b7d0['email'],_0x2abf06);})[_0xdddc('0x26')](function(_0x34c94b){_0x6fe3a8=_0x34c94b;return getEndUser(_0x4e7a16,_0x4c20aa,_0x103a5c[_0xdddc('0x67')],_0x103a5c[_0xdddc('0x68')],_0x2abf06);})[_0xdddc('0x26')](function(_0xc5098a){_0x5a6f7b=_0xc5098a;return getTicket(_0x4e7a16,_0x6fe3a8,_0x5a6f7b,_0x4c20aa,_0x103a5c,_0x4c20aa[_0xdddc('0x69')],_0x2abf06,_0xdddc('0x5f'));})['then'](function(_0x2a574b){_0x24f247=_0x2a574b;logger[_0xdddc('0x1c')](_0xdddc('0x6a'),_0x24f247['id']);logger[_0xdddc('0x1c')](_0xdddc('0x6b'),_0x24f247['id'],_0x17b7d0[_0xdddc('0x54')],_0x4e7a16[_0xdddc('0x3e')]);switch(_0x4e7a16[_0xdddc('0x3e')]){case _0xdddc('0x6c'):emit(util[_0xdddc('0x45')](_0xdddc('0x6d'),_0x17b7d0['name']),_0xdddc('0x6e'),{'recordId':_0x24f247['id']});break;case _0xdddc('0x6f'):emit(util[_0xdddc('0x45')]('user:%s',_0x17b7d0[_0xdddc('0x54')]),'trigger:browser:url',{'uri':util[_0xdddc('0x45')]('%s/%s/e',_0x2abf06['instanceUrl'],_0x24f247['id'])});break;default:logger[_0xdddc('0x70')](_0xdddc('0x71'));}})['catch'](function(_0x55cb25){logger[_0xdddc('0x70')](_0xdddc('0x63'),_0x55cb25);});};exports[_0xdddc('0x72')]=function(_0x233ef0,_0x2d278f,_0x1574c6,_0x151fb1,_0x590200,_0x434fcd,_0x57411a){var _0x50bbea,_0x4d2f25,_0x3a45ee,_0x35241b;_0x434fcd[_0xdddc('0x60')]=intUtil['stripTrailingSlash'](_0x434fcd[_0xdddc('0x60')]);_0x434fcd[_0xdddc('0x59')]=intUtil[_0xdddc('0x61')](_0x434fcd['remoteUri']);if(_0x57411a&&_0x57411a[_0xdddc('0x73')]&&_0x57411a[_0xdddc('0x73')]!==_0xdddc('0x74')){logger[_0xdddc('0x1c')](_0xdddc('0x75'),_0xdddc('0x76'));_0x2d278f[_0xdddc('0x64')]=util['format'](_0xdddc('0x65'),_0x434fcd[_0xdddc('0x60')],_0x2d278f[_0xdddc('0x66')],md5(_0x2d278f['uniqueid']));}return getConnection(_0x434fcd)['then'](function(_0x36a6a8){_0x35241b=_0x36a6a8;return getUser(_0x434fcd,_0x151fb1[_0xdddc('0x77')],_0x35241b);})[_0xdddc('0x26')](function(_0x2a2326){_0x50bbea=_0x2a2326;return getEndUser(_0x434fcd,_0x1574c6,_0x2d278f[_0xdddc('0x78')],_0x2d278f[_0xdddc('0x79')],_0x35241b);})['then'](function(_0x78c61e){_0x4d2f25=_0x78c61e;return getTicket(_0x434fcd,_0x50bbea,_0x4d2f25,_0x1574c6,_0x2d278f,_0x1574c6[_0xdddc('0x69')],_0x35241b,_0xdddc('0x72'));})[_0xdddc('0x26')](function(_0x420884){_0x3a45ee=_0x420884;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3a45ee['id']);logger['info'](_0xdddc('0x7a'),_0x3a45ee['id'],_0x151fb1[_0xdddc('0x54')],_0x434fcd['type']);switch(_0x434fcd[_0xdddc('0x3e')]){case _0xdddc('0x6c'):emit(util[_0xdddc('0x45')](_0xdddc('0x6d'),_0x151fb1[_0xdddc('0x54')]),_0xdddc('0x6e'),{'recordId':_0x3a45ee['id']});break;case'newTab':emit(util[_0xdddc('0x45')](_0xdddc('0x6d'),_0x151fb1[_0xdddc('0x54')]),_0xdddc('0x7b'),{'uri':util[_0xdddc('0x45')](_0xdddc('0x7c'),_0x35241b[_0xdddc('0x7d')],_0x3a45ee['id'])});break;default:logger['error'](_0xdddc('0x75'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xdddc('0x7e')](function(_0x6e2e77){logger[_0xdddc('0x70')](_0xdddc('0x75'),_0x6e2e77);});};exports['unmanaged']=function(_0x1d4df3,_0xaf5ac2,_0x159442,_0x3ae3e8,_0x2e8f6a,_0x33cd26){var _0xd023c6,_0x79fe2d,_0x515cef,_0x5addc5;_0x33cd26[_0xdddc('0x60')]=intUtil[_0xdddc('0x61')](_0x33cd26['serverUrl']);_0x33cd26[_0xdddc('0x59')]=intUtil[_0xdddc('0x61')](_0x33cd26[_0xdddc('0x59')]);if(_0x2e8f6a&&_0x2e8f6a[_0xdddc('0x62')]){logger['info']('['+_0xaf5ac2[_0xdddc('0x7f')][_0xdddc('0x80')]()+']','Recording\x20is\x20enabled!');_0xaf5ac2[_0xdddc('0x64')]=util[_0xdddc('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33cd26['serverUrl'],_0xaf5ac2[_0xdddc('0x66')],md5(_0xaf5ac2[_0xdddc('0x66')]));}else{_0xaf5ac2['recordingURL']='';}return getConnection(_0x33cd26)[_0xdddc('0x26')](function(_0x1bb2bb){_0x5addc5=_0x1bb2bb;if(!_[_0xdddc('0x21')](_0x3ae3e8)){return getUser(_0x33cd26,_0x3ae3e8['name'],_0x5addc5);}else{return getUser(_0x33cd26,null,_0x5addc5);}})[_0xdddc('0x26')](function(_0x1e785b){_0xd023c6=_0x1e785b;return getEndUser(_0x33cd26,_0x159442,_0xaf5ac2[_0xdddc('0x67')],_0xaf5ac2[_0xdddc('0x68')],_0x5addc5);})[_0xdddc('0x26')](function(_0x462f06){_0x79fe2d=_0x462f06;return getTicket(_0x33cd26,_0xd023c6,_0x79fe2d,_0x159442,_0xaf5ac2,_0x159442[_0xdddc('0x69')],_0x5addc5);})[_0xdddc('0x26')](function(_0x225c18){_0x515cef=_0x225c18;logger[_0xdddc('0x1c')]('['+_0xaf5ac2[_0xdddc('0x7f')][_0xdddc('0x80')]()+']\x20Ticket\x20%s\x20created.',_0x515cef['id']);logger[_0xdddc('0x1c')]('['+_0xaf5ac2[_0xdddc('0x7f')][_0xdddc('0x80')]()+_0xdddc('0x81'),_0x33cd26[_0xdddc('0x3e')]);})[_0xdddc('0x7e')](function(_0x8508a2){logger[_0xdddc('0x70')]('['+_0xaf5ac2[_0xdddc('0x7f')][_0xdddc('0x80')]()+']',_0x8508a2);});}; \ 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 76072b0..7552ba5 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 _0x503a=['userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','customVariable','Variable','name','outbound','incident','getString','Subjects','Descriptions','Fields','ticketId','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','forEach',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','info','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x29d23f,_0x3302d7){var _0x5855cc=function(_0x285e22){while(--_0x285e22){_0x29d23f['push'](_0x29d23f['shift']());}};_0x5855cc(++_0x3302d7);}(_0x503a,0xc3));var _0xa503=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x503a[_0xf55e73];return _0x116b99;};'use strict';var _=require('lodash');var Promise=require(_0xa503('0x0'));var rp=require(_0xa503('0x1'));var util=require(_0xa503('0x2'));var md5=require(_0xa503('0x3'));var Redis=require(_0xa503('0x4'));var intUtil=require(_0xa503('0x5'));var config=require(_0xa503('0x6'));var logger=require(_0xa503('0x7'))(_0xa503('0x8'));config[_0xa503('0x9')]=_['defaults'](config[_0xa503('0x9')],{'host':_0xa503('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x239124,_0x26b829,_0xc50fa0,_0x2dba96,_0x5bf2bd,_0x5577e3){return new Promise(function(_0x3952a7,_0x484e86){var _0x5c052b={'method':_0xa503('0xb'),'uri':_0x2dba96+_0xa503('0xc')+'&'+_0x5bf2bd+'&'+_0x5577e3,'auth':_0x26b829,'json':!![]};return rp(_0x5c052b)[_0xa503('0xd')](function(_0x2cb179){if(_0x2cb179[_0xa503('0xe')][_0xa503('0xf')]>0x0){_0xc50fa0['adminId']=_0x2cb179[_0xa503('0xe')][0x0][_0xa503('0x10')];}logger['info']('['+[_0x239124['toUpperCase']()]+_0xa503('0x11'),_0xc50fa0);_0x3952a7(_0xc50fa0);})[_0xa503('0x12')](function(_0x48f473){logger[_0xa503('0x13')]('['+[_0x239124[_0xa503('0x14')]()]+']',_0x48f473[_0xa503('0x15')]);_0x484e86(_0x48f473[_0xa503('0x15')]);});});}function getUser(_0x473bad,_0x55da67,_0xae0c67,_0x5ece10,_0x407b8f){return function(_0x594d0c){logger[_0xa503('0x16')]('['+[_0x473bad[_0xa503('0x14')]()]+_0xa503('0x17'),_0x594d0c);return new Promise(function(_0x5006a0,_0x59ba40){if(intUtil[_0xa503('0x18')](_0x594d0c[_0xa503('0x19')])){var _0x41016b={'method':_0xa503('0xb'),'uri':_0xae0c67+_0xa503('0x1a')+_0x594d0c[_0xa503('0x19')]+'&'+_0x5ece10+'&'+_0x407b8f,'auth':_0x55da67,'json':!![]};logger['info']('['+[_0x473bad['toUpperCase']()]+_0xa503('0x1b'),_0x41016b);return rp(_0x41016b)['then'](function(_0x28e81e){logger['info']('['+[_0x473bad['toUpperCase']()]+'],\x20getUser\x20entity',_0x28e81e);if(_0x28e81e[_0xa503('0xe')][_0xa503('0xf')]>0x0&&String(_0x28e81e[_0xa503('0xe')][0x0][_0xa503('0x1c')])===_0xa503('0x1d')){_0x594d0c[_0xa503('0x1e')]=_0x28e81e[_0xa503('0xe')][0x0][_0xa503('0x10')];}else{_0x594d0c[_0xa503('0x1e')]=_0x594d0c[_0xa503('0x1f')];_0x594d0c[_0xa503('0x19')]=_0x594d0c[_0xa503('0x20')];}logger[_0xa503('0x16')]('['+[_0x473bad[_0xa503('0x14')]()]+_0xa503('0x21'),_0x594d0c);_0x5006a0(_0x594d0c);})[_0xa503('0x12')](function(_0xdfda59){logger[_0xa503('0x13')]('['+[_0x473bad[_0xa503('0x14')]()]+']',_0xdfda59[_0xa503('0x15')]);_0x59ba40(_0xdfda59[_0xa503('0x15')]);});}else{logger[_0xa503('0x16')]('['+[_0x473bad[_0xa503('0x14')]()]+']\x20using\x20admin\x20profile');_0x594d0c[_0xa503('0x1e')]=_0x594d0c['adminId'];_0x594d0c['userEmail']=_0x594d0c['adminEmail'];_0x5006a0(_0x594d0c);}});};}function createEndUser(_0x32e7f1,_0x364f23,_0x158308,_0x289b50,_0x484505){logger[_0xa503('0x16')]('['+[_0x32e7f1[_0xa503('0x14')]()]+_0xa503('0x22'),_0x158308);return new Promise(function(_0x47a816,_0x5da32b){var _0x701476={'method':_0xa503('0x23'),'uri':_0x289b50+_0xa503('0x24')+_0x484505,'body':{'user_name':_0x158308[_0xa503('0x25')],'roles':'user','first_name':_0x158308['endUserNumber'],'active':_0xa503('0x1d'),'date_format':_0xa503('0x26'),'phone':_0x158308[_0xa503('0x25')]},'auth':_0x364f23,'json':!![]};return rp(_0x701476)[_0xa503('0xd')](function(_0xa13ba5){logger['info']('['+[_0x32e7f1[_0xa503('0x14')]()]+_0xa503('0x27'),_0xa13ba5[_0xa503('0xe')]);_0x158308[_0xa503('0x28')]=_0xa13ba5['result'][_0xa503('0x10')];_0x47a816(_0x158308);})[_0xa503('0x12')](function(_0x29dbb1){logger[_0xa503('0x13')]('['+[_0x32e7f1[_0xa503('0x14')]()]+']',_0x29dbb1[_0xa503('0x15')]);_0x5da32b(_0x29dbb1['message']);});});}function getEndUser(_0x40e9c2,_0x41a9af,_0x58ea94,_0x428c80,_0x2172eb){return function(_0x43fb64){logger[_0xa503('0x16')]('['+[_0x40e9c2[_0xa503('0x14')]()]+_0xa503('0x29'),_0x43fb64);return new Promise(function(_0x345c56,_0x58a9f8){var _0xfe8eea={'method':'GET','uri':_0x58ea94+_0xa503('0x2a')+_0x43fb64['endUserNumber']+'&'+_0x428c80+'&'+_0x2172eb,'auth':_0x41a9af,'json':!![]};return rp(_0xfe8eea)['then'](function(_0xaf527b){if(_0xaf527b[_0xa503('0xe')]['length']>0x0){_0x43fb64['endUserId']=_0xaf527b[_0xa503('0xe')][0x0][_0xa503('0x10')];logger[_0xa503('0x16')]('['+[_0x40e9c2[_0xa503('0x14')]()]+'],\x20getEndUser\x20crm',_0x43fb64);_0x345c56(_0x43fb64);}else{return createEndUser(_0x40e9c2,_0x41a9af,_0x43fb64,_0x58ea94,_0x428c80)[_0xa503('0xd')](function(_0x56d76c){logger[_0xa503('0x16')]('['+[_0x40e9c2['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x56d76c);_0x345c56(_0x56d76c);});}})[_0xa503('0x12')](function(_0x45e8eb){logger[_0xa503('0x13')]('['+[_0x40e9c2[_0xa503('0x14')]()]+']',_0x45e8eb[_0xa503('0x15')]);_0x58a9f8(_0x45e8eb['message']);});});};}function getCustomFields(_0x4f9676,_0x38a6f7){var _0x45a4a8={};if(_0x4f9676[_0xa503('0xf')]>0x0){_['forEach'](_0x4f9676,function(_0x1c314e){if(_[_0xa503('0x2b')]([_0xa503('0x2c'),_0xa503('0x2d')],_0x1c314e[_0xa503('0x2e')])&&_0x1c314e['nameField']&&!_0x1c314e[_0xa503('0x2f')]){_0x45a4a8[_0x1c314e[_0xa503('0x30')][_0xa503('0x31')]()]=_0x1c314e[_0xa503('0x32')][_0xa503('0x33')]();}else if(_[_0xa503('0x2b')]([_0xa503('0x2c'),_0xa503('0x2d')],_0x1c314e[_0xa503('0x2e')])&&_0x1c314e[_0xa503('0x34')]&&_0x1c314e['customField']){_0x45a4a8[_0x1c314e['idField'][_0xa503('0x31')]()]=_0x1c314e['content'][_0xa503('0x33')]();}else if(_0x1c314e['type']===_0xa503('0x35')&&_0x1c314e['variableName']&&_0x1c314e[_0xa503('0x34')]&&_0x1c314e[_0xa503('0x2f')]){_0x45a4a8[_0x1c314e[_0xa503('0x34')][_0xa503('0x31')]()]=_0x38a6f7[_0x1c314e['variableName']][_0xa503('0x33')]();}else if(_0x1c314e[_0xa503('0x2e')]===_0xa503('0x36')&&_0x1c314e[_0xa503('0x37')]&&_0x1c314e[_0xa503('0x37')]['name']&&_0x1c314e['idField']&&_0x1c314e[_0xa503('0x2f')]){_0x45a4a8[_0x1c314e[_0xa503('0x34')][_0xa503('0x31')]()]=_0x38a6f7[_0x1c314e[_0xa503('0x37')][_0xa503('0x38')][_0xa503('0x31')]()]['toString']();}});}return _0x45a4a8;}function getTicket(_0x120054,_0x306e36,_0x51202c,_0x3e100c,_0x572bdd,_0x392184){return function(_0x522b7e){logger[_0xa503('0x16')]('['+[_0x120054['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x522b7e);return new Promise(function(_0x7387ea,_0x498839){var _0x5d4341=_0x120054[_0xa503('0x31')]()===_0xa503('0x39')?_0x522b7e[_0xa503('0x1e')]:_0x522b7e[_0xa503('0x28')];var _0x4c82fd={'method':_0xa503('0x23'),'uri':_0x51202c+_0xa503('0x3a')+'?'+_0x392184,'body':Object['assign']({},{'active':_0xa503('0x1d'),'caller_id':_0x5d4341,'assigned_to':_0x522b7e[_0xa503('0x1e')],'short_description':intUtil[_0xa503('0x3b')](_0x3e100c[_0xa503('0x3c')],_0x572bdd,'\x20'),'description':intUtil[_0xa503('0x3b')](_0x3e100c[_0xa503('0x3d')],_0x572bdd,'\x0a')},getCustomFields(_0x3e100c[_0xa503('0x3e')],_0x572bdd)),'auth':_0x306e36,'json':!![]};return rp(_0x4c82fd)[_0xa503('0xd')](function(_0x48757d){logger[_0xa503('0x16')]('['+[_0x120054[_0xa503('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x48757d[_0xa503('0xe')]);_0x522b7e[_0xa503('0x3f')]=_0x48757d[_0xa503('0xe')][_0xa503('0x10')];_0x522b7e['ticketNumber']=_0x48757d[_0xa503('0xe')][_0xa503('0x40')];logger['info']('['+[_0x120054[_0xa503('0x14')]()]+']\x20getTicket\x20crm',_0x522b7e);_0x7387ea(_0x522b7e);})[_0xa503('0x12')](function(_0x3361bb){logger[_0xa503('0x13')]('['+[_0x120054[_0xa503('0x14')]()]+']',_0x3361bb[_0xa503('0x15')]);_0x498839(_0x3361bb[_0xa503('0x15')]);});});};}function createRemoteTag(_0x3b9775,_0x2a0a97,_0x970777,_0x8ae3b3){return new Promise(function(_0x3d679f,_0x247ad8){var _0x4c5ffb={'method':_0xa503('0x23'),'uri':_0x970777+_0xa503('0x41')+'?'+_0x8ae3b3,'body':{'short_description':_0x3b9775,'global':!![],'active':!![],'name':_0x3b9775},'auth':_0x2a0a97,'json':!![]};return rp(_0x4c5ffb)[_0xa503('0xd')](function(_0x5e6165){var _0x151f7c=_0x5e6165[_0xa503('0xe')][_0xa503('0x10')];_0x3d679f(_0x151f7c);});});}function getRemoteTag(_0x26b8eb,_0x5837e1,_0x3a1d71,_0x3d9706,_0x26d20c){return new Promise(function(_0x459215,_0x29b324){var _0x1f8735={'method':_0xa503('0xb'),'uri':_0x3a1d71+'label'+_0xa503('0x42')+_0x26b8eb+'&'+_0x3d9706,'auth':_0x5837e1,'json':!![]};return rp(_0x1f8735)[_0xa503('0xd')](function(_0x27b679){if(_0x27b679[_0xa503('0xe')][_0xa503('0xf')]>0x0){var _0xc7f4ee=_0x27b679[_0xa503('0xe')][0x0][_0xa503('0x10')];_0x459215(_0xc7f4ee);}else{return createRemoteTag(_0x26b8eb,_0x5837e1,_0x3a1d71,_0x3d9706)[_0xa503('0xd')](function(_0x4d074e){_0x459215(_0x4d074e);});}});});}function assignTagToIncident(_0x1354da,_0x5a1190,_0x1cc8b7,_0x50bd67,_0xb55210){return new Promise(function(_0x31156c,_0x132e93){var _0x2b8df1={'method':_0xa503('0x23'),'uri':_0x1cc8b7+_0xa503('0x43')+'?'+_0xb55210,'body':{'label':_0x1354da,'table':'incident','id_type':_0xa503('0x44'),'table_key':_0x50bd67['ticketId'],'title':_0xa503('0x45')+_0x50bd67[_0xa503('0x46')],'id_display':_0x50bd67[_0xa503('0x46')]},'auth':_0x5a1190,'json':!![]};return rp(_0x2b8df1)[_0xa503('0xd')](function(_0x6cc30b){_0x31156c();})[_0xa503('0x12')](function(){_0x31156c();});});}function manageTags(_0x9a681a,_0x1fb58e,_0x5db437,_0x4dc1b2,_0x3cc1b5,_0x47264c,_0xad8e77){return new Promise(function(_0x5bf772,_0x314132){var _0x90c965=[];_0x1fb58e[_0xa503('0x47')](function(_0x19563e){_0x90c965['push'](getRemoteTag(_0x19563e,_0x5db437,_0x4dc1b2,_0x47264c,_0xad8e77));});return Promise['all'](_0x90c965)[_0xa503('0xd')](function(_0x103d21){if(_0x103d21['length']){logger[_0xa503('0x16')]('['+[_0x9a681a[_0xa503('0x14')]()]+_0xa503('0x48'),_0x103d21);var _0x55bb14=[];_0x103d21[_0xa503('0x47')](function(_0x3507b6){_0x55bb14[_0xa503('0x49')](assignTagToIncident(_0x3507b6,_0x5db437,_0x4dc1b2,_0x3cc1b5,_0x47264c));});return Promise[_0xa503('0x4a')](_0x55bb14)['then'](function(){_0x5bf772();})[_0xa503('0x12')](function(){_0x5bf772();});}else{_0x5bf772();}});});}function getTags(_0x5c2e49,_0x2a283d,_0x11b235,_0x4e230f,_0x49f254,_0xcdb5fb){return function(_0x32ec48){return new Promise(function(_0xf342b1,_0x206523){var _0x391034=[];var _0x1d0389=_0x4e230f['Tags'];if(_0x1d0389&&_0x1d0389[_0xa503('0xf')]>0x0){_0x391034=_[_0xa503('0x4b')](_0x1d0389,'name');}if(_0x391034['length']>0x0){return manageTags(_0x5c2e49,_0x391034,_0x2a283d,_0x11b235,_0x32ec48,_0x49f254,_0xcdb5fb)[_0xa503('0xd')](function(){_0xf342b1(_0x32ec48);});}else{_0xf342b1(_0x32ec48);}});};}function emit(_0x581818,_0x5aaf76,_0x13dc11){var _0x3457a2=_0xa503('0x4c')+_0xa503('0x4d')+_0xa503('0x4e')+_0xa503('0x4f');var _0x44da85={'uri':_0x581818+_0xa503('0x50')+_0x13dc11+_0x3457a2};io['to'](util[_0xa503('0x51')](_0xa503('0x52'),_0x5aaf76))[_0xa503('0x53')](_0xa503('0x54'),_0x44da85);}exports['cs']=function(_0x4030fd,_0x201b47,_0x3d84d2,_0x24400f,_0x389819,_0x3d562c,_0x26e176,_0x3cb59d){var _0x7c3016={};var _0x43b059={'user':_0x3d562c[_0xa503('0x55')],'pass':_0x3d562c[_0xa503('0x56')]};var _0x4d101f=_0xa503('0x57');var _0x4b2352=_0xa503('0x58');_0x3d562c[_0xa503('0x59')]=intUtil[_0xa503('0x5a')](_0x3d562c[_0xa503('0x59')]);_0x3d562c[_0xa503('0x5b')]=intUtil[_0xa503('0x5a')](_0x3d562c[_0xa503('0x5b')]);var _0xdf1211=util['format']('%s/api/now/table/',_0x3d562c[_0xa503('0x59')]);_0x7c3016[_0xa503('0x19')]=!_[_0xa503('0x5c')](_0x24400f)?_0x24400f[_0xa503('0x5d')]:null;_0x7c3016[_0xa503('0x20')]=_0x3d562c[_0xa503('0x5d')];_0x7c3016['endUserNumber']=_0x3cb59d[_0xa503('0x31')]()===_0xa503('0x39')?_0x201b47[_0xa503('0x5e')]:_0x201b47[_0xa503('0x5f')];_0x7c3016['callDirection']=_0x3cb59d===_0xa503('0x60')||_0x3cb59d==='unmanaged'?_0xa503('0x60'):_0xa503('0x39');var _0x35e468=util[_0xa503('0x51')](_0xa503('0x61'),_0x3d562c[_0xa503('0x5b')],_0x201b47[_0xa503('0x62')],md5(_0x201b47['uniqueid']));if(_0x389819&&_0x389819['monitor_format']){logger[_0xa503('0x16')](_0xa503('0x63'),_0xa503('0x64'));_0x201b47[_0xa503('0x65')]=_0x35e468;}else if(_0x26e176&&_0x26e176[_0xa503('0x66')]&&_0x26e176['recordingFormat']!==_0xa503('0x67')){logger[_0xa503('0x16')](_0xa503('0x68'),_0xa503('0x64'));_0x201b47[_0xa503('0x65')]=_0x35e468;}else{_0x201b47[_0xa503('0x65')]='';}return getAdminUser(_0x3cb59d,_0x43b059,_0x7c3016,_0xdf1211,_0x4b2352,_0x4d101f)[_0xa503('0xd')](getUser(_0x3cb59d,_0x43b059,_0xdf1211,_0x4b2352,_0x4d101f))[_0xa503('0xd')](getEndUser(_0x3cb59d,_0x43b059,_0xdf1211,_0x4b2352,_0x4d101f))[_0xa503('0xd')](getTicket(_0x3cb59d,_0x43b059,_0xdf1211,_0x3d84d2,_0x201b47,_0x4b2352))[_0xa503('0xd')](function(_0x429310){logger[_0xa503('0x16')](util['format'](_0xa503('0x69'),_0x429310[_0xa503('0x3f')]));logger['info'](util[_0xa503('0x51')](_0xa503('0x6a'),_0x3cb59d));if(_0x3cb59d!==_0xa503('0x6b')){logger['info']('['+[_0x3cb59d[_0xa503('0x14')]()]+']',_0xa503('0x6c'));emit(_0x3d562c[_0xa503('0x59')],_0x24400f['name'],_0x429310[_0xa503('0x3f')]);}})[_0xa503('0x12')](function(_0x416d93){logger[_0xa503('0x13')]('['+[_0x3cb59d['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xa503('0x6d')](_0x416d93,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb1ae=['Incident\x20-\x20','ticketNumber','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','adminEmail','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','message','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','length','true','userId','sys_id','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','forEach','includes','picklist','type','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name','outbound','incident','assign','Subjects','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb1ae,0x193));var _0xeb1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeb1a('0x0'));var Promise=require(_0xeb1a('0x1'));var rp=require(_0xeb1a('0x2'));var util=require(_0xeb1a('0x3'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xeb1a('0x4'));var config=require(_0xeb1a('0x5'));var logger=require(_0xeb1a('0x6'))(_0xeb1a('0x7'));config[_0xeb1a('0x8')]=_['defaults'](config[_0xeb1a('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xeb1a('0x9'))(new Redis(config[_0xeb1a('0x8')]));function getAdminUser(_0x21c0e0,_0x23e6a3,_0x4a5955,_0x324548,_0x30b84f,_0x3e2ca4){return new Promise(function(_0x2beb76,_0x519d8e){var _0x3c501b={'method':_0xeb1a('0xa'),'uri':_0x324548+_0xeb1a('0xb')+'&'+_0x30b84f+'&'+_0x3e2ca4,'auth':_0x23e6a3,'json':!![]};return rp(_0x3c501b)[_0xeb1a('0xc')](function(_0x55433d){if(_0x55433d[_0xeb1a('0xd')]['length']>0x0){_0x4a5955[_0xeb1a('0xe')]=_0x55433d['result'][0x0]['sys_id'];}logger[_0xeb1a('0xf')]('['+[_0x21c0e0[_0xeb1a('0x10')]()]+_0xeb1a('0x11'),_0x4a5955);_0x2beb76(_0x4a5955);})['catch'](function(_0x4d5df3){logger['error']('['+[_0x21c0e0[_0xeb1a('0x10')]()]+']',_0x4d5df3[_0xeb1a('0x12')]);_0x519d8e(_0x4d5df3[_0xeb1a('0x12')]);});});}function getUser(_0x53dfa4,_0x5e4a9b,_0xc1a59b,_0x3dbf5f,_0x3119cb){return function(_0x23d159){logger[_0xeb1a('0xf')]('['+[_0x53dfa4[_0xeb1a('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x23d159);return new Promise(function(_0x4e41ce,_0x3c2b33){if(intUtil['validateEmail'](_0x23d159['userEmail'])){var _0x4fbfb4={'method':_0xeb1a('0xa'),'uri':_0xc1a59b+_0xeb1a('0x13')+_0x23d159[_0xeb1a('0x14')]+'&'+_0x3dbf5f+'&'+_0x3119cb,'auth':_0x5e4a9b,'json':!![]};logger[_0xeb1a('0xf')]('['+[_0x53dfa4[_0xeb1a('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x4fbfb4);return rp(_0x4fbfb4)[_0xeb1a('0xc')](function(_0x30da41){logger[_0xeb1a('0xf')]('['+[_0x53dfa4['toUpperCase']()]+_0xeb1a('0x15'),_0x30da41);if(_0x30da41[_0xeb1a('0xd')][_0xeb1a('0x16')]>0x0&&String(_0x30da41[_0xeb1a('0xd')][0x0]['active'])===_0xeb1a('0x17')){_0x23d159[_0xeb1a('0x18')]=_0x30da41[_0xeb1a('0xd')][0x0][_0xeb1a('0x19')];}else{_0x23d159['userId']=_0x23d159[_0xeb1a('0xe')];_0x23d159[_0xeb1a('0x14')]=_0x23d159['adminEmail'];}logger['info']('['+[_0x53dfa4[_0xeb1a('0x10')]()]+_0xeb1a('0x1a'),_0x23d159);_0x4e41ce(_0x23d159);})[_0xeb1a('0x1b')](function(_0x2cd286){logger[_0xeb1a('0x1c')]('['+[_0x53dfa4[_0xeb1a('0x10')]()]+']',_0x2cd286[_0xeb1a('0x12')]);_0x3c2b33(_0x2cd286['message']);});}else{logger['info']('['+[_0x53dfa4[_0xeb1a('0x10')]()]+_0xeb1a('0x1d'));_0x23d159['userId']=_0x23d159['adminId'];_0x23d159['userEmail']=_0x23d159['adminEmail'];_0x4e41ce(_0x23d159);}});};}function createEndUser(_0x204184,_0x484b92,_0x339c2a,_0x48fc68,_0x16dffa){logger['info']('['+[_0x204184[_0xeb1a('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x339c2a);return new Promise(function(_0x664332,_0x549dd7){var _0x20fff5={'method':_0xeb1a('0x1e'),'uri':_0x48fc68+_0xeb1a('0x1f')+_0x16dffa,'body':{'user_name':_0x339c2a[_0xeb1a('0x20')],'roles':_0xeb1a('0x21'),'first_name':_0x339c2a['endUserNumber'],'active':_0xeb1a('0x17'),'date_format':_0xeb1a('0x22'),'phone':_0x339c2a[_0xeb1a('0x20')]},'auth':_0x484b92,'json':!![]};return rp(_0x20fff5)[_0xeb1a('0xc')](function(_0x4c07f4){logger[_0xeb1a('0xf')]('['+[_0x204184[_0xeb1a('0x10')]()]+_0xeb1a('0x23'),_0x4c07f4[_0xeb1a('0xd')]);_0x339c2a['endUserId']=_0x4c07f4['result'][_0xeb1a('0x19')];_0x664332(_0x339c2a);})[_0xeb1a('0x1b')](function(_0x5b78ac){logger['error']('['+[_0x204184[_0xeb1a('0x10')]()]+']',_0x5b78ac['message']);_0x549dd7(_0x5b78ac['message']);});});}function getEndUser(_0x3d49df,_0xec065c,_0x9bc26c,_0x4ce489,_0x487d25){return function(_0x267ea9){logger[_0xeb1a('0xf')]('['+[_0x3d49df['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x267ea9);return new Promise(function(_0x4d4abc,_0x262812){var _0x4a192f={'method':'GET','uri':_0x9bc26c+'sys_user?sysparm_query=phone%3D'+_0x267ea9[_0xeb1a('0x20')]+'&'+_0x4ce489+'&'+_0x487d25,'auth':_0xec065c,'json':!![]};return rp(_0x4a192f)['then'](function(_0x357105){if(_0x357105[_0xeb1a('0xd')][_0xeb1a('0x16')]>0x0){_0x267ea9[_0xeb1a('0x24')]=_0x357105['result'][0x0]['sys_id'];logger[_0xeb1a('0xf')]('['+[_0x3d49df[_0xeb1a('0x10')]()]+'],\x20getEndUser\x20crm',_0x267ea9);_0x4d4abc(_0x267ea9);}else{return createEndUser(_0x3d49df,_0xec065c,_0x267ea9,_0x9bc26c,_0x4ce489)['then'](function(_0x4d05d4){logger['info']('['+[_0x3d49df[_0xeb1a('0x10')]()]+'],\x20createEndUser\x20crm',_0x4d05d4);_0x4d4abc(_0x4d05d4);});}})[_0xeb1a('0x1b')](function(_0x3160cb){logger[_0xeb1a('0x1c')]('['+[_0x3d49df[_0xeb1a('0x10')]()]+']',_0x3160cb[_0xeb1a('0x12')]);_0x262812(_0x3160cb[_0xeb1a('0x12')]);});});};}function getCustomFields(_0x396ffa,_0x434cf7){var _0x2dc59d={};if(_0x396ffa[_0xeb1a('0x16')]>0x0){_[_0xeb1a('0x25')](_0x396ffa,function(_0x3f4ee7){if(_[_0xeb1a('0x26')](['string',_0xeb1a('0x27')],_0x3f4ee7[_0xeb1a('0x28')])&&_0x3f4ee7['nameField']&&!_0x3f4ee7[_0xeb1a('0x29')]){_0x2dc59d[_0x3f4ee7['nameField'][_0xeb1a('0x2a')]()]=_0x3f4ee7[_0xeb1a('0x2b')][_0xeb1a('0x2c')]();}else if(_[_0xeb1a('0x26')]([_0xeb1a('0x2d'),_0xeb1a('0x27')],_0x3f4ee7[_0xeb1a('0x28')])&&_0x3f4ee7[_0xeb1a('0x2e')]&&_0x3f4ee7[_0xeb1a('0x29')]){_0x2dc59d[_0x3f4ee7['idField'][_0xeb1a('0x2a')]()]=_0x3f4ee7[_0xeb1a('0x2b')][_0xeb1a('0x2c')]();}else if(_0x3f4ee7[_0xeb1a('0x28')]===_0xeb1a('0x2f')&&_0x3f4ee7[_0xeb1a('0x30')]&&_0x3f4ee7[_0xeb1a('0x2e')]&&_0x3f4ee7['customField']){_0x2dc59d[_0x3f4ee7[_0xeb1a('0x2e')][_0xeb1a('0x2a')]()]=_0x434cf7[_0x3f4ee7['variableName']]['toString']();}else if(_0x3f4ee7[_0xeb1a('0x28')]===_0xeb1a('0x31')&&_0x3f4ee7[_0xeb1a('0x32')]&&_0x3f4ee7['Variable'][_0xeb1a('0x33')]&&_0x3f4ee7['idField']&&_0x3f4ee7[_0xeb1a('0x29')]){_0x2dc59d[_0x3f4ee7[_0xeb1a('0x2e')][_0xeb1a('0x2a')]()]=_0x434cf7[_0x3f4ee7['Variable'][_0xeb1a('0x33')]['toLowerCase']()]['toString']();}});}return _0x2dc59d;}function getTicket(_0x50ac0a,_0x58ca9d,_0x348025,_0x56015f,_0x4a3fae,_0x407ef0){return function(_0x4f2602){logger[_0xeb1a('0xf')]('['+[_0x50ac0a[_0xeb1a('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x4f2602);return new Promise(function(_0x25817d,_0x3f2145){var _0x6105c7=_0x50ac0a['toLowerCase']()===_0xeb1a('0x34')?_0x4f2602[_0xeb1a('0x18')]:_0x4f2602[_0xeb1a('0x24')];var _0x526e43={'method':_0xeb1a('0x1e'),'uri':_0x348025+_0xeb1a('0x35')+'?'+_0x407ef0,'body':Object[_0xeb1a('0x36')]({},{'active':_0xeb1a('0x17'),'caller_id':_0x6105c7,'assigned_to':_0x4f2602['userId'],'short_description':intUtil['getString'](_0x56015f[_0xeb1a('0x37')],_0x4a3fae,'\x20'),'description':intUtil['getString'](_0x56015f['Descriptions'],_0x4a3fae,'\x0a')},getCustomFields(_0x56015f['Fields'],_0x4a3fae)),'auth':_0x58ca9d,'json':!![]};return rp(_0x526e43)[_0xeb1a('0xc')](function(_0x836821){logger[_0xeb1a('0xf')]('['+[_0x50ac0a[_0xeb1a('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x836821['result']);_0x4f2602['ticketId']=_0x836821[_0xeb1a('0xd')][_0xeb1a('0x19')];_0x4f2602['ticketNumber']=_0x836821[_0xeb1a('0xd')][_0xeb1a('0x38')];logger[_0xeb1a('0xf')]('['+[_0x50ac0a[_0xeb1a('0x10')]()]+_0xeb1a('0x39'),_0x4f2602);_0x25817d(_0x4f2602);})[_0xeb1a('0x1b')](function(_0x465aec){logger[_0xeb1a('0x1c')]('['+[_0x50ac0a[_0xeb1a('0x10')]()]+']',_0x465aec[_0xeb1a('0x12')]);_0x3f2145(_0x465aec[_0xeb1a('0x12')]);});});};}function createRemoteTag(_0x5c8dc3,_0x4c803c,_0x3b1fae,_0x5282cd){return new Promise(function(_0x19285d,_0x450faa){var _0x5f2eee={'method':_0xeb1a('0x1e'),'uri':_0x3b1fae+_0xeb1a('0x3a')+'?'+_0x5282cd,'body':{'short_description':_0x5c8dc3,'global':!![],'active':!![],'name':_0x5c8dc3},'auth':_0x4c803c,'json':!![]};return rp(_0x5f2eee)[_0xeb1a('0xc')](function(_0x1ac233){var _0x589979=_0x1ac233[_0xeb1a('0xd')][_0xeb1a('0x19')];_0x19285d(_0x589979);});});}function getRemoteTag(_0x29689d,_0x5186f7,_0x360dd5,_0x3005a,_0x1fc225){return new Promise(function(_0x544f8e,_0x39d22e){var _0x24dd3f={'method':_0xeb1a('0xa'),'uri':_0x360dd5+'label'+'?sysparm_query=name%3D'+_0x29689d+'&'+_0x3005a,'auth':_0x5186f7,'json':!![]};return rp(_0x24dd3f)[_0xeb1a('0xc')](function(_0x375d38){if(_0x375d38[_0xeb1a('0xd')][_0xeb1a('0x16')]>0x0){var _0x3a3e5b=_0x375d38[_0xeb1a('0xd')][0x0][_0xeb1a('0x19')];_0x544f8e(_0x3a3e5b);}else{return createRemoteTag(_0x29689d,_0x5186f7,_0x360dd5,_0x3005a)[_0xeb1a('0xc')](function(_0x5b9dd1){_0x544f8e(_0x5b9dd1);});}});});}function assignTagToIncident(_0x14e36b,_0x5edd32,_0x28ee8c,_0x58ddaf,_0x25c2a2){return new Promise(function(_0x193c76,_0x33239d){var _0x4bcece={'method':'POST','uri':_0x28ee8c+_0xeb1a('0x3b')+'?'+_0x25c2a2,'body':{'label':_0x14e36b,'table':_0xeb1a('0x35'),'id_type':_0xeb1a('0x3c'),'table_key':_0x58ddaf[_0xeb1a('0x3d')],'title':_0xeb1a('0x3e')+_0x58ddaf[_0xeb1a('0x3f')],'id_display':_0x58ddaf[_0xeb1a('0x3f')]},'auth':_0x5edd32,'json':!![]};return rp(_0x4bcece)[_0xeb1a('0xc')](function(_0x51fa5b){_0x193c76();})[_0xeb1a('0x1b')](function(){_0x193c76();});});}function manageTags(_0x30cd8f,_0x3bbade,_0x4d51b7,_0x16ff0d,_0x5e89c1,_0x3e56ca,_0x559aa3){return new Promise(function(_0x3528a6,_0x2e5f23){var _0x5e60ea=[];_0x3bbade[_0xeb1a('0x25')](function(_0x3331e0){_0x5e60ea[_0xeb1a('0x40')](getRemoteTag(_0x3331e0,_0x4d51b7,_0x16ff0d,_0x3e56ca,_0x559aa3));});return Promise[_0xeb1a('0x41')](_0x5e60ea)[_0xeb1a('0xc')](function(_0xf7771b){if(_0xf7771b['length']){logger[_0xeb1a('0xf')]('['+[_0x30cd8f['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xf7771b);var _0x2c30e7=[];_0xf7771b[_0xeb1a('0x25')](function(_0x3de57e){_0x2c30e7[_0xeb1a('0x40')](assignTagToIncident(_0x3de57e,_0x4d51b7,_0x16ff0d,_0x5e89c1,_0x3e56ca));});return Promise['all'](_0x2c30e7)[_0xeb1a('0xc')](function(){_0x3528a6();})[_0xeb1a('0x1b')](function(){_0x3528a6();});}else{_0x3528a6();}});});}function getTags(_0x3a9cbd,_0x2a3a0c,_0x4709c7,_0x277012,_0x196f85,_0x2d66d3){return function(_0x4c9af4){return new Promise(function(_0xb0fc3c,_0x3eba9){var _0x360adb=[];var _0x254bf4=_0x277012[_0xeb1a('0x42')];if(_0x254bf4&&_0x254bf4[_0xeb1a('0x16')]>0x0){_0x360adb=_[_0xeb1a('0x43')](_0x254bf4,_0xeb1a('0x33'));}if(_0x360adb['length']>0x0){return manageTags(_0x3a9cbd,_0x360adb,_0x2a3a0c,_0x4709c7,_0x4c9af4,_0x196f85,_0x2d66d3)[_0xeb1a('0xc')](function(){_0xb0fc3c(_0x4c9af4);});}else{_0xb0fc3c(_0x4c9af4);}});};}function emit(_0x4857af,_0x3c956b,_0x59cbda){var _0x5b0185=_0xeb1a('0x44')+_0xeb1a('0x45')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x25d67a={'uri':_0x4857af+_0xeb1a('0x46')+_0x59cbda+_0x5b0185};io['to'](util[_0xeb1a('0x47')]('user:%s',_0x3c956b))['emit'](_0xeb1a('0x48'),_0x25d67a);}exports['cs']=function(_0x287cf4,_0x37c8e5,_0x4aa367,_0xe28afe,_0x1d2486,_0x4bde69,_0x33dac8,_0xdda496){var _0x120306={};var _0xebc815={'user':_0x4bde69[_0xeb1a('0x49')],'pass':_0x4bde69['password']};var _0x2e4f82='sysparm_limit=1';var _0x4eea1a='sysparm_display_value=true';_0x4bde69[_0xeb1a('0x4a')]=intUtil[_0xeb1a('0x4b')](_0x4bde69[_0xeb1a('0x4a')]);_0x4bde69[_0xeb1a('0x4c')]=intUtil[_0xeb1a('0x4b')](_0x4bde69['serverUrl']);var _0x28fd61=util['format'](_0xeb1a('0x4d'),_0x4bde69[_0xeb1a('0x4a')]);_0x120306[_0xeb1a('0x14')]=!_['isNil'](_0xe28afe)?_0xe28afe[_0xeb1a('0x4e')]:null;_0x120306[_0xeb1a('0x4f')]=_0x4bde69[_0xeb1a('0x4e')];_0x120306['endUserNumber']=_0xdda496[_0xeb1a('0x2a')]()==='outbound'?_0x37c8e5[_0xeb1a('0x50')]:_0x37c8e5['calleridnum'];_0x120306[_0xeb1a('0x51')]=_0xdda496===_0xeb1a('0x52')||_0xdda496===_0xeb1a('0x53')?'queue':_0xeb1a('0x34');var _0x1c80d7=util[_0xeb1a('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bde69[_0xeb1a('0x4c')],_0x37c8e5[_0xeb1a('0x54')],md5(_0x37c8e5[_0xeb1a('0x54')]));if(_0x1d2486&&_0x1d2486[_0xeb1a('0x55')]){logger[_0xeb1a('0xf')](_0xeb1a('0x56'),'Recording\x20is\x20enabled!');_0x37c8e5[_0xeb1a('0x57')]=_0x1c80d7;}else if(_0x33dac8&&_0x33dac8['recordingFormat']&&_0x33dac8[_0xeb1a('0x58')]!=='none'){logger[_0xeb1a('0xf')](_0xeb1a('0x59'),'Recording\x20is\x20enabled!');_0x37c8e5[_0xeb1a('0x57')]=_0x1c80d7;}else{_0x37c8e5[_0xeb1a('0x57')]='';}return getAdminUser(_0xdda496,_0xebc815,_0x120306,_0x28fd61,_0x4eea1a,_0x2e4f82)[_0xeb1a('0xc')](getUser(_0xdda496,_0xebc815,_0x28fd61,_0x4eea1a,_0x2e4f82))[_0xeb1a('0xc')](getEndUser(_0xdda496,_0xebc815,_0x28fd61,_0x4eea1a,_0x2e4f82))[_0xeb1a('0xc')](getTicket(_0xdda496,_0xebc815,_0x28fd61,_0x4aa367,_0x37c8e5,_0x4eea1a))[_0xeb1a('0xc')](function(_0x41a4cf){logger[_0xeb1a('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x41a4cf['ticketId']));logger[_0xeb1a('0xf')](util['format'](_0xeb1a('0x5a'),_0xdda496));if(_0xdda496!==_0xeb1a('0x53')){logger['info']('['+[_0xdda496['toUpperCase']()]+']',_0xeb1a('0x5b'));emit(_0x4bde69['remoteUri'],_0xe28afe['name'],_0x41a4cf['ticketId']);}})[_0xeb1a('0x1b')](function(_0x5344c3){logger[_0xeb1a('0x1c')]('['+[_0xdda496[_0xeb1a('0x10')]()]+_0xeb1a('0x5c'),util['inspect'](_0x5344c3,{'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 b022488..e46869a 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 _0x95af=['stripTrailingSlash','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','contacts','[OUTBOUND]','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_hours','parent_id','Contacts','parent_name','length','variableName','push','set_entry','JSON','stringify','Basic\x20%s','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','content','idField','custom_fields','variable','toString','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x95af,0x89));var _0xf95a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x95af[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf95a('0x0'));var rp=require(_0xf95a('0x1'));var BPromise=require('bluebird');var md5=require(_0xf95a('0x2'));var util=require('util');var Redis=require(_0xf95a('0x3'));var intUtil=require(_0xf95a('0x4'));var config=require(_0xf95a('0x5'));var logger=require(_0xf95a('0x6'))(_0xf95a('0x7'));config['redis']=_[_0xf95a('0x8')](config[_0xf95a('0x9')],{'host':_0xf95a('0xa'),'port':0x18eb});var io=require(_0xf95a('0xb'))(new Redis(config['redis']));var def={'method':_0xf95a('0xc'),'json':!![]};function emit(_0x1d5f71,_0x38cf94,_0x46f834){io['to'](_0x1d5f71)[_0xf95a('0xd')](_0x38cf94,_0x46f834);}function getTicket(_0x50e370,_0x1cf9b6,_0x5af72a,_0x5c6cb2,_0x37d119,_0x5bc69e,_0x150a16,_0x5b7e3b){logger[_0xf95a('0xe')](_0xf95a('0xf'));var _0x59c5d8=new Date();var _0x46f0b9=[{'name':_0xf95a('0x10'),'value':intUtil[_0xf95a('0x11')](_0x5c6cb2[_0xf95a('0x12')],_0x37d119,'\x20')},{'name':_0xf95a('0x13'),'value':_0x1cf9b6['id']},{'name':_0xf95a('0x14'),'value':_0x1cf9b6['id']},{'name':_0xf95a('0x15'),'value':intUtil[_0xf95a('0x11')](_0x5c6cb2[_0xf95a('0x16')],_0x37d119,'\x0a')},{'name':_0xf95a('0x17'),'value':_0x59c5d8[_0xf95a('0x18')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xf95a('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xf95a('0x1a'),'value':_0x5af72a['id']},{'name':'parent_type','value':_0xf95a('0x1b')},{'name':_0xf95a('0x1c'),'value':_0x5af72a['name']},{'name':'direction','value':_0x5b7e3b}];if(_0x5bc69e[_0xf95a('0x1d')]){_['forEach'](_0x5bc69e,function(_0x5b505f){if(_0x37d119[_0x5b505f[_0xf95a('0x1e')]]){_0x46f0b9[_0xf95a('0x1f')]({'name':_0x5b505f['idField'],'value':_0x37d119[_0x5b505f[_0xf95a('0x1e')]]});}});}return request({'form':{'method':_0xf95a('0x20'),'input_type':'JSON','response_type':_0xf95a('0x21'),'rest_data':JSON[_0xf95a('0x22')]({'session':_0x150a16['id'],'module_name':'Calls','name_value_list':_0x46f0b9})}});}function getAuth(_0x26b414){return util['format'](_0xf95a('0x23'),new Buffer(_0x26b414['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x5869b7){return request({'form':{'method':'get_server_info','input_type':_0xf95a('0x21'),'response_type':_0xf95a('0x21'),'rest_data':JSON['stringify']({'session':_0x5869b7['id']})}});}function getUser(_0x49f1bc,_0xeb4631,_0x46e3e1){if(!_[_0xf95a('0x24')](_0xeb4631)){logger['info'](_0xf95a('0x25'),_0xeb4631);return request({'form':{'method':_0xf95a('0x26'),'input_type':_0xf95a('0x21'),'response_type':_0xf95a('0x21'),'rest_data':JSON[_0xf95a('0x22')]({'session':_0x46e3e1['id'],'module_name':'Employees','query':util[_0xf95a('0x27')](_0xf95a('0x28'),_0xeb4631),'order_by':'','offset':'0','select_fields':['id',_0xf95a('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf95a('0x29')](function(_0x144193){if(_0x144193[_0xf95a('0x2a')][_0xf95a('0x1d')]){var _0x56f424=_[_0xf95a('0x2b')](_0x144193[_0xf95a('0x2a')],function(_0x21a57f){return _0x21a57f[_0xf95a('0x2c')][_0xf95a('0x2d')][_0xf95a('0x2e')]===_0xeb4631;});if(_0x56f424){logger[_0xf95a('0xe')](_0xf95a('0x2f'));return BPromise[_0xf95a('0x30')]({'id':_0x56f424[_0xf95a('0x2c')]['id']['value'],'name':_0x56f424[_0xf95a('0x2c')][_0xf95a('0x10')][_0xf95a('0x2e')]});}}logger[_0xf95a('0xe')](_0xf95a('0x31'));return BPromise[_0xf95a('0x30')]({'id':_0x46e3e1['name_value_list']['user_id'][_0xf95a('0x2e')],'name':_0x46e3e1[_0xf95a('0x2c')][_0xf95a('0x2d')][_0xf95a('0x2e')]});});}else{logger['info'](_0xf95a('0x32'));return BPromise['resolve']({'id':_0x46e3e1[_0xf95a('0x2c')][_0xf95a('0x33')]['value'],'name':_0x46e3e1[_0xf95a('0x2c')][_0xf95a('0x2d')][_0xf95a('0x2e')]});}}function getEndUser(_0x2f60df,_0x4c1b96,_0x20d636,_0xe8ac43){logger[_0xf95a('0xe')](_0xf95a('0x34'),_0x20d636);return request({'form':{'method':_0xf95a('0x26'),'input_type':_0xf95a('0x21'),'response_type':_0xf95a('0x21'),'rest_data':JSON[_0xf95a('0x22')]({'session':_0xe8ac43['id'],'module_name':_0xf95a('0x1b'),'query':util[_0xf95a('0x27')](_0xf95a('0x35'),_0x20d636),'order_by':'','offset':'0','select_fields':['id','name',_0xf95a('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf95a('0x29')](function(_0xbff943){if(_0xbff943[_0xf95a('0x2a')][_0xf95a('0x1d')]){var _0x35ba9b=_[_0xf95a('0x2b')](_0xbff943[_0xf95a('0x2a')],function(_0x2f2108){return _0x2f2108['name_value_list'][_0xf95a('0x36')]['value']===_0x20d636;});if(_0x35ba9b){logger['info'](_0xf95a('0x37'));return BPromise['resolve']({'id':_0x35ba9b[_0xf95a('0x2c')]['id']['value'],'name':_0x35ba9b['name_value_list'][_0xf95a('0x10')][_0xf95a('0x2e')],'phone':_0x35ba9b[_0xf95a('0x2c')][_0xf95a('0x36')]['value']});}}else{logger[_0xf95a('0xe')](_0xf95a('0x38'));return request({'form':{'method':_0xf95a('0x20'),'input_type':_0xf95a('0x21'),'response_type':'JSON','rest_data':JSON[_0xf95a('0x22')]({'session':_0xe8ac43['id'],'module_name':_0xf95a('0x1b'),'name_value_list':[{'name':_0xf95a('0x39'),'value':_0x4c1b96!==''?_0x4c1b96:util['format'](_0xf95a('0x3a'),_0x20d636)},{'name':'phone_home','value':_0x20d636}]})}})[_0xf95a('0x29')](function(_0x1bdad3){logger[_0xf95a('0xe')](_0xf95a('0x3b'));return BPromise[_0xf95a('0x30')]({'id':_0x1bdad3['id'],'name':_0x1bdad3['entry_list'][_0xf95a('0x39')][_0xf95a('0x2e')],'phone':_0x1bdad3[_0xf95a('0x2a')][_0xf95a('0x36')][_0xf95a('0x2e')]});});}});}function request(_0x472c67){logger[_0xf95a('0x3c')](_0xf95a('0x3d'),JSON[_0xf95a('0x22')](_0x472c67));return rp(_[_0xf95a('0x3e')](def,_0x472c67));}function getTags(_0x433a8a,_0x5d79e6){var _0x4529bd=[];if(_0x433a8a&&_0x433a8a[_0xf95a('0x1d')]>0x0){_0x4529bd=_[_0xf95a('0x3f')](_0x433a8a,_0x5d79e6);}return _0x4529bd;}function getCustomFields(_0x41b891,_0x58bf67){var _0x5221b6=[];var _0xbf32e7={'custom_fields':[]};if(_0x41b891[_0xf95a('0x1d')]>0x0){_['forEach'](_0x41b891,function(_0xcd4d09){if(_0xcd4d09[_0xf95a('0x40')]===_0xf95a('0x41')&&_0xcd4d09['nameField']&&!_0xcd4d09[_0xf95a('0x42')]){_0xbf32e7[_0xcd4d09[_0xf95a('0x43')][_0xf95a('0x44')]()]=_0xcd4d09[_0xf95a('0x45')]['toString']();}else if(_0xcd4d09[_0xf95a('0x40')]===_0xf95a('0x41')&&_0xcd4d09[_0xf95a('0x46')]&&_0xcd4d09[_0xf95a('0x42')]){_0xbf32e7[_0xf95a('0x47')][_0xf95a('0x1f')]({'id':_0xcd4d09[_0xf95a('0x46')],'value':_0xcd4d09[_0xf95a('0x45')]['toString']()});}else if(_0xcd4d09[_0xf95a('0x40')]===_0xf95a('0x48')&&_0xcd4d09[_0xf95a('0x1e')]&&_0xcd4d09['idField']&&_0xcd4d09[_0xf95a('0x42')]){_0x58bf67[_0xcd4d09[_0xf95a('0x1e')]]&&_0xbf32e7[_0xf95a('0x47')][_0xf95a('0x1f')]({'id':_0xcd4d09[_0xf95a('0x46')],'value':_0x58bf67[_0xcd4d09[_0xf95a('0x1e')]][_0xf95a('0x49')]()});}else if(_0xcd4d09['type']===_0xf95a('0x4a')&&_0xcd4d09[_0xf95a('0x4b')]&&_0xcd4d09[_0xf95a('0x4b')][_0xf95a('0x10')]&&_0xcd4d09[_0xf95a('0x46')]&&_0xcd4d09[_0xf95a('0x42')]){_0x58bf67[_0xcd4d09[_0xf95a('0x4b')][_0xf95a('0x10')][_0xf95a('0x44')]()]&&_0xbf32e7['custom_fields'][_0xf95a('0x1f')]({'id':_0xcd4d09[_0xf95a('0x46')],'value':_0x58bf67[_0xcd4d09[_0xf95a('0x4b')][_0xf95a('0x10')]['toLowerCase']()][_0xf95a('0x49')]()});}});}return _0xbf32e7;}function getConnection(_0x2dfd1a){return request({'method':_0xf95a('0xc'),'form':{'method':_0xf95a('0x4c'),'input_type':_0xf95a('0x21'),'response_type':_0xf95a('0x21'),'rest_data':JSON[_0xf95a('0x22')]({'user_auth':{'user_name':_0x2dfd1a[_0xf95a('0x4d')],'password':_0x2dfd1a['password'],'encryption':_0xf95a('0x4e')},'application':_0xf95a('0x4f')})}})[_0xf95a('0x29')](function(_0x4fede8){var _0x4d30c7=_0x4fede8;if(_0x4d30c7['id']){def[_0xf95a('0x50')]=_0x4d30c7['id'];return BPromise[_0xf95a('0x30')](_0x4d30c7);}else{throw new Error(util[_0xf95a('0x27')](_0xf95a('0x51'),_0x2dfd1a['id']));}});}function setRelationship(_0x2a71bc,_0x1e58f4,_0x149c74,_0x3ee50a){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2a71bc['id'],'module_name':_0xf95a('0x52'),'module_id':_0x149c74['id'],'link_field_name':_0x3ee50a,'related_ids':[_0x1e58f4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf95a('0x53')]=function(_0x1b56a1,_0x2e1497,_0xc7837d,_0x5a2f64,_0x53d5b0,_0x46b64d){var _0x44b9ef,_0x1d2934,_0x2f39d7,_0x39b4cd;_0x46b64d['remoteUri']=intUtil['stripTrailingSlash'](_0x46b64d['remoteUri']);_0x46b64d[_0xf95a('0x54')]=intUtil['stripTrailingSlash'](_0x46b64d[_0xf95a('0x54')]);def[_0xf95a('0x55')]=util[_0xf95a('0x27')](_0xf95a('0x56'),_0x46b64d[_0xf95a('0x57')]);if(_0x53d5b0&&_0x53d5b0[_0xf95a('0x58')]){logger[_0xf95a('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2e1497['recordingURL']=util[_0xf95a('0x27')](_0xf95a('0x59'),_0x46b64d[_0xf95a('0x54')],_0x2e1497[_0xf95a('0x5a')],md5(_0x2e1497[_0xf95a('0x5a')]));}else{_0x2e1497[_0xf95a('0x5b')]='';}return getConnection(_0x46b64d)[_0xf95a('0x29')](function(_0x14f162){_0x39b4cd=_0x14f162;return getUser(_0x46b64d,_0x5a2f64[_0xf95a('0x10')],_0x39b4cd);})[_0xf95a('0x29')](function(_0x1ac6f8){_0x44b9ef=_0x1ac6f8;logger[_0xf95a('0xe')](_0xf95a('0x5c'),_0x44b9ef['id']);return getEndUser(_0x46b64d,_0x2e1497[_0xf95a('0x5d')],_0x2e1497[_0xf95a('0x5e')],_0x39b4cd);})[_0xf95a('0x29')](function(_0x3a02fb){_0x1d2934=_0x3a02fb;logger[_0xf95a('0xe')](_0xf95a('0x5f'),_0x1d2934['id']);return getTicket(_0x46b64d,_0x44b9ef,_0x1d2934,_0xc7837d,_0x2e1497,_0xc7837d[_0xf95a('0x60')],_0x39b4cd,_0xf95a('0x61'));})[_0xf95a('0x29')](function(_0x2603b8){_0x2f39d7=_0x2603b8;logger[_0xf95a('0xe')]('Ticket\x20created!');logger['info'](_0xf95a('0x62'),_0x2f39d7['id']);return setRelationship(_0x39b4cd,_0x44b9ef,_0x2f39d7,_0xf95a('0x63'));})[_0xf95a('0x29')](function(){return setRelationship(_0x39b4cd,_0x1d2934,_0x2f39d7,'contacts');})[_0xf95a('0x29')](function(){return getServerInfo(_0x39b4cd);})['then'](function(_0x5b720c){var _0x4b1587=parseInt(_0x5b720c[_0xf95a('0x64')][_0xf95a('0x65')](0x0));var _0x496781=util[_0xf95a('0x27')](_0xf95a('0x66'),_0x46b64d[_0xf95a('0x57')],_0x2f39d7['id']);if(_0x4b1587>0x6){_0x496781=util[_0xf95a('0x27')](_0xf95a('0x67'),_0x46b64d[_0xf95a('0x57')],_0x2f39d7['id']);}logger[_0xf95a('0xe')](_0xf95a('0x68'),_0xf95a('0x69'));emit(util['format'](_0xf95a('0x6a'),_0x5a2f64[_0xf95a('0x10')]),_0xf95a('0x6b'),{'uri':_0x496781});})[_0xf95a('0x6c')](function(_0x3acc75){logger[_0xf95a('0x6d')]('[QUEUE]',JSON['stringify'](_0x3acc75));});};exports[_0xf95a('0x6e')]=function(_0x520e8e,_0x30494e,_0x328996,_0x5c9022,_0x406a2d,_0x17f418,_0x97ca41){var _0x3cb721,_0x28983f,_0x2555f8,_0x2a4c8f;_0x17f418[_0xf95a('0x57')]=intUtil[_0xf95a('0x6f')](_0x17f418['remoteUri']);_0x17f418[_0xf95a('0x54')]=intUtil[_0xf95a('0x6f')](_0x17f418['serverUrl']);def[_0xf95a('0x55')]=util[_0xf95a('0x27')]('%s/service/v4_1/rest.php',_0x17f418[_0xf95a('0x57')]);if(_0x97ca41&&_0x97ca41[_0xf95a('0x70')]&&_0x97ca41[_0xf95a('0x70')]!==_0xf95a('0x71')){logger['info']('[OUTBOUND]',_0xf95a('0x72'));_0x30494e[_0xf95a('0x5b')]=util[_0xf95a('0x27')](_0xf95a('0x59'),_0x17f418[_0xf95a('0x54')],_0x30494e[_0xf95a('0x5a')],md5(_0x30494e[_0xf95a('0x5a')]));}return getConnection(_0x17f418)[_0xf95a('0x29')](function(_0x49538d){_0x2a4c8f=_0x49538d;return getUser(_0x17f418,_0x5c9022['name'],_0x2a4c8f);})[_0xf95a('0x29')](function(_0x35be4f){_0x3cb721=_0x35be4f;logger[_0xf95a('0xe')](_0xf95a('0x5c'),_0x3cb721['id']);return getEndUser(_0x17f418,_0x30494e[_0xf95a('0x73')],_0x30494e[_0xf95a('0x74')],_0x2a4c8f);})['then'](function(_0x218c0b){_0x28983f=_0x218c0b;logger[_0xf95a('0xe')](_0xf95a('0x5f'),_0x28983f['id']);return getTicket(_0x17f418,_0x3cb721,_0x28983f,_0x328996,_0x30494e,_0x328996[_0xf95a('0x60')],_0x2a4c8f,_0xf95a('0x75'));})[_0xf95a('0x29')](function(_0x4cef88){_0x2555f8=_0x4cef88;logger[_0xf95a('0xe')](_0xf95a('0x76'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2555f8['id']);return setRelationship(_0x2a4c8f,_0x3cb721,_0x2555f8,_0xf95a('0x63'));})[_0xf95a('0x29')](function(){return setRelationship(_0x2a4c8f,_0x28983f,_0x2555f8,_0xf95a('0x77'));})[_0xf95a('0x29')](function(){return getServerInfo(_0x2a4c8f);})['then'](function(_0x38f504){var _0x43210c=parseInt(_0x38f504[_0xf95a('0x64')][_0xf95a('0x65')](0x0));var _0x469d94=util[_0xf95a('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x17f418[_0xf95a('0x57')],_0x2555f8['id']);if(_0x43210c>0x6){_0x469d94=util['format'](_0xf95a('0x67'),_0x17f418['remoteUri'],_0x2555f8['id']);}logger[_0xf95a('0xe')](_0xf95a('0x78'),_0xf95a('0x69'));emit(util[_0xf95a('0x27')](_0xf95a('0x6a'),_0x5c9022[_0xf95a('0x10')]),_0xf95a('0x6b'),{'uri':_0x469d94});})['catch'](function(_0x4d9bde){logger[_0xf95a('0x6d')]('[OUTBOUND]',JSON['stringify'](_0x4d9bde));});};exports[_0xf95a('0x79')]=function(_0x5d415d,_0x67b6a1,_0x435345,_0x4459b5,_0x3d2542,_0x32acc6){var _0x195b5e,_0x1d138f,_0x3c8967,_0x2e1410;_0x32acc6['remoteUri']=intUtil['stripTrailingSlash'](_0x32acc6[_0xf95a('0x57')]);_0x32acc6[_0xf95a('0x54')]=intUtil[_0xf95a('0x6f')](_0x32acc6[_0xf95a('0x54')]);def[_0xf95a('0x55')]=util['format'](_0xf95a('0x56'),_0x32acc6[_0xf95a('0x57')]);if(_0x3d2542&&_0x3d2542[_0xf95a('0x58')]){logger[_0xf95a('0xe')]('['+_0x67b6a1[_0xf95a('0x7a')][_0xf95a('0x7b')]()+']','Recording\x20is\x20enabled!');_0x67b6a1[_0xf95a('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x32acc6[_0xf95a('0x54')],_0x67b6a1[_0xf95a('0x5a')],md5(_0x67b6a1[_0xf95a('0x5a')]));}else{_0x67b6a1[_0xf95a('0x5b')]='';}return getConnection(_0x32acc6)[_0xf95a('0x29')](function(_0x7b8125){_0x2e1410=_0x7b8125;if(!_[_0xf95a('0x24')](_0x4459b5)){return getUser(_0x32acc6,_0x4459b5[_0xf95a('0x10')],_0x2e1410);}else{return getUser(_0x32acc6,null,_0x2e1410);}})['then'](function(_0x565ac5){_0x195b5e=_0x565ac5;logger[_0xf95a('0xe')](_0xf95a('0x5c'),_0x195b5e['id']);return getEndUser(_0x32acc6,_0x67b6a1['calleridname'],_0x67b6a1[_0xf95a('0x5e')],_0x2e1410);})[_0xf95a('0x29')](function(_0x4835d6){_0x1d138f=_0x4835d6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1d138f['id']);return getTicket(_0x32acc6,_0x195b5e,_0x1d138f,_0x435345,_0x67b6a1,_0x435345[_0xf95a('0x60')],_0x2e1410,'Inbound');})['then'](function(_0x346fac){_0x3c8967=_0x346fac;logger[_0xf95a('0xe')]('Ticket\x20created!');logger[_0xf95a('0xe')](_0xf95a('0x62'),_0x3c8967['id']);return setRelationship(_0x2e1410,_0x195b5e,_0x3c8967,_0xf95a('0x63'));})[_0xf95a('0x29')](function(){return setRelationship(_0x2e1410,_0x1d138f,_0x3c8967,_0xf95a('0x77'));})[_0xf95a('0x29')](function(){return getServerInfo(_0x2e1410);})[_0xf95a('0x6c')](function(_0x3c0eea){logger[_0xf95a('0x6d')]('['+_0x67b6a1['lastevent'][_0xf95a('0x7b')]()+']',JSON[_0xf95a('0x22')](_0x3c0eea));});}; \ No newline at end of file +var _0xdab3=['isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','customField','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Outbound','users','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','calleridname','lastevent','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','toString','base64','get_server_info'];(function(_0x3e91f3,_0x342816){var _0x254a1b=function(_0x267c4f){while(--_0x267c4f){_0x3e91f3['push'](_0x3e91f3['shift']());}};_0x254a1b(++_0x342816);}(_0xdab3,0x1ba));var _0x3dab=function(_0x5e4dae,_0x3605f4){_0x5e4dae=_0x5e4dae-0x0;var _0x4e5488=_0xdab3[_0x5e4dae];return _0x4e5488;};'use strict';var _=require('lodash');var rp=require(_0x3dab('0x0'));var BPromise=require(_0x3dab('0x1'));var md5=require(_0x3dab('0x2'));var util=require(_0x3dab('0x3'));var Redis=require(_0x3dab('0x4'));var intUtil=require(_0x3dab('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3dab('0x6'))(_0x3dab('0x7'));config[_0x3dab('0x8')]=_[_0x3dab('0x9')](config['redis'],{'host':_0x3dab('0xa'),'port':0x18eb});var io=require(_0x3dab('0xb'))(new Redis(config[_0x3dab('0x8')]));var def={'method':_0x3dab('0xc'),'json':!![]};function emit(_0x214f62,_0x121363,_0x55ce8b){io['to'](_0x214f62)[_0x3dab('0xd')](_0x121363,_0x55ce8b);}function getTicket(_0x3ad55b,_0x21c94a,_0x3206b3,_0xa52ee0,_0x21b1d4,_0x54e758,_0x2e396d,_0x36147c){logger['info'](_0x3dab('0xe'));var _0x4809b5=new Date();var _0x681b3f=[{'name':_0x3dab('0xf'),'value':intUtil[_0x3dab('0x10')](_0xa52ee0[_0x3dab('0x11')],_0x21b1d4,'\x20')},{'name':'assigned_user_id','value':_0x21c94a['id']},{'name':_0x3dab('0x12'),'value':_0x21c94a['id']},{'name':_0x3dab('0x13'),'value':intUtil['getString'](_0xa52ee0[_0x3dab('0x14')],_0x21b1d4,'\x0a')},{'name':_0x3dab('0x15'),'value':_0x4809b5[_0x3dab('0x16')]()[_0x3dab('0x17')](0x0,0x13)[_0x3dab('0x18')]('T','\x20')},{'name':_0x3dab('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x3206b3['id']},{'name':_0x3dab('0x1a'),'value':_0x3dab('0x1b')},{'name':_0x3dab('0x1c'),'value':_0x3206b3['name']},{'name':_0x3dab('0x1d'),'value':_0x36147c}];if(_0x54e758[_0x3dab('0x1e')]){_[_0x3dab('0x1f')](_0x54e758,function(_0x4c9963){if(_0x21b1d4[_0x4c9963[_0x3dab('0x20')]]){_0x681b3f[_0x3dab('0x21')]({'name':_0x4c9963[_0x3dab('0x22')],'value':_0x21b1d4[_0x4c9963['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x3dab('0x23'),'response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'session':_0x2e396d['id'],'module_name':_0x3dab('0x25'),'name_value_list':_0x681b3f})}});}function getAuth(_0x61f8ea){return util[_0x3dab('0x26')]('Basic\x20%s',new Buffer(_0x61f8ea['apiKey']+':X')[_0x3dab('0x27')](_0x3dab('0x28')));}function getServerInfo(_0x132d85){return request({'form':{'method':_0x3dab('0x29'),'input_type':_0x3dab('0x23'),'response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'session':_0x132d85['id']})}});}function getUser(_0x5678ef,_0x50d3e6,_0x4ca778){if(!_[_0x3dab('0x2a')](_0x50d3e6)){logger[_0x3dab('0x2b')](_0x3dab('0x2c'),_0x50d3e6);return request({'form':{'method':_0x3dab('0x2d'),'input_type':_0x3dab('0x23'),'response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'session':_0x4ca778['id'],'module_name':_0x3dab('0x2e'),'query':util[_0x3dab('0x26')](_0x3dab('0x2f'),_0x50d3e6),'order_by':'','offset':'0','select_fields':['id','name',_0x3dab('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3dab('0x31')](function(_0x3e25e4){if(_0x3e25e4[_0x3dab('0x32')][_0x3dab('0x1e')]){var _0x531d46=_[_0x3dab('0x33')](_0x3e25e4[_0x3dab('0x32')],function(_0x323f63){return _0x323f63[_0x3dab('0x34')][_0x3dab('0x30')][_0x3dab('0x35')]===_0x50d3e6;});if(_0x531d46){logger['info']('Agent\x20found!');return BPromise[_0x3dab('0x36')]({'id':_0x531d46[_0x3dab('0x34')]['id'][_0x3dab('0x35')],'name':_0x531d46[_0x3dab('0x34')][_0x3dab('0xf')]['value']});}}logger[_0x3dab('0x2b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3dab('0x36')]({'id':_0x4ca778[_0x3dab('0x34')][_0x3dab('0x37')]['value'],'name':_0x4ca778['name_value_list'][_0x3dab('0x30')][_0x3dab('0x35')]});});}else{logger[_0x3dab('0x2b')](_0x3dab('0x38'));return BPromise[_0x3dab('0x36')]({'id':_0x4ca778[_0x3dab('0x34')][_0x3dab('0x37')][_0x3dab('0x35')],'name':_0x4ca778[_0x3dab('0x34')][_0x3dab('0x30')]['value']});}}function getEndUser(_0x540e17,_0x52a711,_0x80e840,_0x45d2fa){logger[_0x3dab('0x2b')]('Searching\x20enduser\x20with\x20phone',_0x80e840);return request({'form':{'method':_0x3dab('0x2d'),'input_type':_0x3dab('0x23'),'response_type':'JSON','rest_data':JSON[_0x3dab('0x24')]({'session':_0x45d2fa['id'],'module_name':_0x3dab('0x1b'),'query':util[_0x3dab('0x26')](_0x3dab('0x39'),_0x80e840),'order_by':'','offset':'0','select_fields':['id','name',_0x3dab('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3dab('0x31')](function(_0x504a6d){if(_0x504a6d[_0x3dab('0x32')][_0x3dab('0x1e')]){var _0x3d38fa=_[_0x3dab('0x33')](_0x504a6d[_0x3dab('0x32')],function(_0x5cabb9){return _0x5cabb9[_0x3dab('0x34')]['phone_home'][_0x3dab('0x35')]===_0x80e840;});if(_0x3d38fa){logger[_0x3dab('0x2b')]('Enduser\x20found!');return BPromise[_0x3dab('0x36')]({'id':_0x3d38fa['name_value_list']['id'][_0x3dab('0x35')],'name':_0x3d38fa[_0x3dab('0x34')][_0x3dab('0xf')][_0x3dab('0x35')],'phone':_0x3d38fa[_0x3dab('0x34')][_0x3dab('0x3a')][_0x3dab('0x35')]});}}else{logger['info'](_0x3dab('0x3b'));return request({'form':{'method':'set_entry','input_type':_0x3dab('0x23'),'response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'session':_0x45d2fa['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3dab('0x3c'),'value':_0x52a711!==''?_0x52a711:util[_0x3dab('0x26')]('Caller\x20-\x20%s',_0x80e840)},{'name':_0x3dab('0x3a'),'value':_0x80e840}]})}})[_0x3dab('0x31')](function(_0x2797dc){logger['info']('Enduser\x20created.');return BPromise[_0x3dab('0x36')]({'id':_0x2797dc['id'],'name':_0x2797dc[_0x3dab('0x32')][_0x3dab('0x3c')]['value'],'phone':_0x2797dc[_0x3dab('0x32')]['phone_home'][_0x3dab('0x35')]});});}});}function request(_0xd9342e){logger[_0x3dab('0x3d')](_0x3dab('0x3e'),JSON[_0x3dab('0x24')](_0xd9342e));return rp(_[_0x3dab('0x3f')](def,_0xd9342e));}function getTags(_0x57970b,_0x435bb2){var _0x34df36=[];if(_0x57970b&&_0x57970b[_0x3dab('0x1e')]>0x0){_0x34df36=_[_0x3dab('0x40')](_0x57970b,_0x435bb2);}return _0x34df36;}function getCustomFields(_0x1417be,_0x1d55dc){var _0x3257ba=[];var _0x582e81={'custom_fields':[]};if(_0x1417be[_0x3dab('0x1e')]>0x0){_[_0x3dab('0x1f')](_0x1417be,function(_0x358e20){if(_0x358e20[_0x3dab('0x41')]===_0x3dab('0x42')&&_0x358e20['nameField']&&!_0x358e20['customField']){_0x582e81[_0x358e20[_0x3dab('0x43')][_0x3dab('0x44')]()]=_0x358e20[_0x3dab('0x45')][_0x3dab('0x27')]();}else if(_0x358e20[_0x3dab('0x41')]==='string'&&_0x358e20['idField']&&_0x358e20[_0x3dab('0x46')]){_0x582e81[_0x3dab('0x47')][_0x3dab('0x21')]({'id':_0x358e20['idField'],'value':_0x358e20[_0x3dab('0x45')][_0x3dab('0x27')]()});}else if(_0x358e20[_0x3dab('0x41')]===_0x3dab('0x48')&&_0x358e20[_0x3dab('0x20')]&&_0x358e20[_0x3dab('0x22')]&&_0x358e20[_0x3dab('0x46')]){_0x1d55dc[_0x358e20[_0x3dab('0x20')]]&&_0x582e81[_0x3dab('0x47')][_0x3dab('0x21')]({'id':_0x358e20[_0x3dab('0x22')],'value':_0x1d55dc[_0x358e20[_0x3dab('0x20')]][_0x3dab('0x27')]()});}else if(_0x358e20[_0x3dab('0x41')]===_0x3dab('0x49')&&_0x358e20[_0x3dab('0x4a')]&&_0x358e20[_0x3dab('0x4a')][_0x3dab('0xf')]&&_0x358e20[_0x3dab('0x22')]&&_0x358e20[_0x3dab('0x46')]){_0x1d55dc[_0x358e20[_0x3dab('0x4a')][_0x3dab('0xf')]['toLowerCase']()]&&_0x582e81[_0x3dab('0x47')][_0x3dab('0x21')]({'id':_0x358e20['idField'],'value':_0x1d55dc[_0x358e20['Variable']['name'][_0x3dab('0x44')]()][_0x3dab('0x27')]()});}});}return _0x582e81;}function getConnection(_0x53263c){return request({'method':_0x3dab('0xc'),'form':{'method':_0x3dab('0x4b'),'input_type':'JSON','response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'user_auth':{'user_name':_0x53263c[_0x3dab('0x4c')],'password':_0x53263c[_0x3dab('0x4d')],'encryption':_0x3dab('0x4e')},'application':_0x3dab('0x4f')})}})[_0x3dab('0x31')](function(_0x2b025e){var _0x3ad004=_0x2b025e;if(_0x3ad004['id']){def['sessionID']=_0x3ad004['id'];return BPromise[_0x3dab('0x36')](_0x3ad004);}else{throw new Error(util[_0x3dab('0x26')](_0x3dab('0x50'),_0x53263c['id']));}});}function setRelationship(_0x318fdf,_0x27c081,_0xd791d8,_0x4501cc){return request({'form':{'method':_0x3dab('0x51'),'input_type':_0x3dab('0x23'),'response_type':_0x3dab('0x23'),'rest_data':JSON[_0x3dab('0x24')]({'session':_0x318fdf['id'],'module_name':_0x3dab('0x25'),'module_id':_0xd791d8['id'],'link_field_name':_0x4501cc,'related_ids':[_0x27c081['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3dab('0x52')]=function(_0x5576e2,_0x7c0aaf,_0x576167,_0x144485,_0x3f0c1b,_0x186ea0){var _0x23a7cc,_0x1413eb,_0x3f64ab,_0x2c449c;_0x186ea0[_0x3dab('0x53')]=intUtil['stripTrailingSlash'](_0x186ea0[_0x3dab('0x53')]);_0x186ea0[_0x3dab('0x54')]=intUtil[_0x3dab('0x55')](_0x186ea0[_0x3dab('0x54')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x186ea0[_0x3dab('0x53')]);if(_0x3f0c1b&&_0x3f0c1b[_0x3dab('0x56')]){logger[_0x3dab('0x2b')](_0x3dab('0x57'),'Recording\x20is\x20enabled!');_0x7c0aaf[_0x3dab('0x58')]=util[_0x3dab('0x26')](_0x3dab('0x59'),_0x186ea0[_0x3dab('0x54')],_0x7c0aaf[_0x3dab('0x5a')],md5(_0x7c0aaf['uniqueid']));}else{_0x7c0aaf['recordingURL']='';}return getConnection(_0x186ea0)[_0x3dab('0x31')](function(_0x4a90f4){_0x2c449c=_0x4a90f4;return getUser(_0x186ea0,_0x144485[_0x3dab('0xf')],_0x2c449c);})[_0x3dab('0x31')](function(_0x19da0e){_0x23a7cc=_0x19da0e;logger[_0x3dab('0x2b')](_0x3dab('0x5b'),_0x23a7cc['id']);return getEndUser(_0x186ea0,_0x7c0aaf['calleridname'],_0x7c0aaf[_0x3dab('0x5c')],_0x2c449c);})[_0x3dab('0x31')](function(_0x3e5894){_0x1413eb=_0x3e5894;logger[_0x3dab('0x2b')](_0x3dab('0x5d'),_0x1413eb['id']);return getTicket(_0x186ea0,_0x23a7cc,_0x1413eb,_0x576167,_0x7c0aaf,_0x576167[_0x3dab('0x5e')],_0x2c449c,_0x3dab('0x5f'));})['then'](function(_0xa14ace){_0x3f64ab=_0xa14ace;logger['info'](_0x3dab('0x60'));logger[_0x3dab('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x3f64ab['id']);return setRelationship(_0x2c449c,_0x23a7cc,_0x3f64ab,'users');})[_0x3dab('0x31')](function(){return setRelationship(_0x2c449c,_0x1413eb,_0x3f64ab,'contacts');})[_0x3dab('0x31')](function(){return getServerInfo(_0x2c449c);})[_0x3dab('0x31')](function(_0x12c58c){var _0x59fa65=parseInt(_0x12c58c[_0x3dab('0x61')][_0x3dab('0x62')](0x0));var _0x2036be=util[_0x3dab('0x26')](_0x3dab('0x63'),_0x186ea0[_0x3dab('0x53')],_0x3f64ab['id']);if(_0x59fa65>0x6){_0x2036be=util[_0x3dab('0x26')](_0x3dab('0x64'),_0x186ea0['remoteUri'],_0x3f64ab['id']);}logger[_0x3dab('0x2b')](_0x3dab('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3dab('0x26')](_0x3dab('0x65'),_0x144485[_0x3dab('0xf')]),_0x3dab('0x66'),{'uri':_0x2036be});})[_0x3dab('0x67')](function(_0x140a37){logger[_0x3dab('0x68')]('[QUEUE]',JSON['stringify'](_0x140a37));});};exports[_0x3dab('0x69')]=function(_0x3a839f,_0x508c4d,_0x4eff1c,_0x2259c3,_0x4c99e5,_0x56e1ef,_0x5940cf){var _0x255504,_0x3d2fdd,_0x4c47b6,_0x5a0aa0;_0x56e1ef['remoteUri']=intUtil[_0x3dab('0x55')](_0x56e1ef[_0x3dab('0x53')]);_0x56e1ef['serverUrl']=intUtil['stripTrailingSlash'](_0x56e1ef[_0x3dab('0x54')]);def[_0x3dab('0x6a')]=util['format'](_0x3dab('0x6b'),_0x56e1ef[_0x3dab('0x53')]);if(_0x5940cf&&_0x5940cf[_0x3dab('0x6c')]&&_0x5940cf[_0x3dab('0x6c')]!==_0x3dab('0x6d')){logger['info'](_0x3dab('0x6e'),_0x3dab('0x6f'));_0x508c4d['recordingURL']=util[_0x3dab('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56e1ef['serverUrl'],_0x508c4d[_0x3dab('0x5a')],md5(_0x508c4d[_0x3dab('0x5a')]));}return getConnection(_0x56e1ef)[_0x3dab('0x31')](function(_0x3adbad){_0x5a0aa0=_0x3adbad;return getUser(_0x56e1ef,_0x2259c3[_0x3dab('0xf')],_0x5a0aa0);})['then'](function(_0x38eea0){_0x255504=_0x38eea0;logger[_0x3dab('0x2b')](_0x3dab('0x5b'),_0x255504['id']);return getEndUser(_0x56e1ef,_0x508c4d[_0x3dab('0x70')],_0x508c4d['destcalleridnum'],_0x5a0aa0);})[_0x3dab('0x31')](function(_0x4f9086){_0x3d2fdd=_0x4f9086;logger[_0x3dab('0x2b')](_0x3dab('0x5d'),_0x3d2fdd['id']);return getTicket(_0x56e1ef,_0x255504,_0x3d2fdd,_0x4eff1c,_0x508c4d,_0x4eff1c[_0x3dab('0x5e')],_0x5a0aa0,_0x3dab('0x71'));})['then'](function(_0x30e39f){_0x4c47b6=_0x30e39f;logger['info'](_0x3dab('0x60'));logger[_0x3dab('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x4c47b6['id']);return setRelationship(_0x5a0aa0,_0x255504,_0x4c47b6,_0x3dab('0x72'));})['then'](function(){return setRelationship(_0x5a0aa0,_0x3d2fdd,_0x4c47b6,_0x3dab('0x73'));})[_0x3dab('0x31')](function(){return getServerInfo(_0x5a0aa0);})[_0x3dab('0x31')](function(_0x5d197b){var _0x314393=parseInt(_0x5d197b[_0x3dab('0x61')][_0x3dab('0x62')](0x0));var _0x3a872f=util[_0x3dab('0x26')](_0x3dab('0x63'),_0x56e1ef[_0x3dab('0x53')],_0x4c47b6['id']);if(_0x314393>0x6){_0x3a872f=util[_0x3dab('0x26')](_0x3dab('0x64'),_0x56e1ef[_0x3dab('0x53')],_0x4c47b6['id']);}logger[_0x3dab('0x2b')](_0x3dab('0x6e'),_0x3dab('0x74'));emit(util[_0x3dab('0x26')](_0x3dab('0x65'),_0x2259c3['name']),_0x3dab('0x66'),{'uri':_0x3a872f});})[_0x3dab('0x67')](function(_0x7a62be){logger[_0x3dab('0x68')](_0x3dab('0x6e'),JSON[_0x3dab('0x24')](_0x7a62be));});};exports[_0x3dab('0x75')]=function(_0x55b2fd,_0x3b5b65,_0xc0b8e2,_0x51ddd3,_0x1b00f5,_0x5a109b){var _0x53cd37,_0x187949,_0x2e0325,_0x4a7009;_0x5a109b[_0x3dab('0x53')]=intUtil[_0x3dab('0x55')](_0x5a109b[_0x3dab('0x53')]);_0x5a109b[_0x3dab('0x54')]=intUtil[_0x3dab('0x55')](_0x5a109b[_0x3dab('0x54')]);def[_0x3dab('0x6a')]=util[_0x3dab('0x26')]('%s/service/v4_1/rest.php',_0x5a109b[_0x3dab('0x53')]);if(_0x1b00f5&&_0x1b00f5['monitor_format']){logger[_0x3dab('0x2b')]('['+_0x3b5b65['lastevent'][_0x3dab('0x76')]()+']',_0x3dab('0x6f'));_0x3b5b65[_0x3dab('0x58')]=util[_0x3dab('0x26')](_0x3dab('0x59'),_0x5a109b[_0x3dab('0x54')],_0x3b5b65['uniqueid'],md5(_0x3b5b65['uniqueid']));}else{_0x3b5b65[_0x3dab('0x58')]='';}return getConnection(_0x5a109b)['then'](function(_0xff96ae){_0x4a7009=_0xff96ae;if(!_[_0x3dab('0x2a')](_0x51ddd3)){return getUser(_0x5a109b,_0x51ddd3[_0x3dab('0xf')],_0x4a7009);}else{return getUser(_0x5a109b,null,_0x4a7009);}})[_0x3dab('0x31')](function(_0x21935c){_0x53cd37=_0x21935c;logger[_0x3dab('0x2b')](_0x3dab('0x5b'),_0x53cd37['id']);return getEndUser(_0x5a109b,_0x3b5b65[_0x3dab('0x77')],_0x3b5b65[_0x3dab('0x5c')],_0x4a7009);})['then'](function(_0x2f6d0c){_0x187949=_0x2f6d0c;logger[_0x3dab('0x2b')](_0x3dab('0x5d'),_0x187949['id']);return getTicket(_0x5a109b,_0x53cd37,_0x187949,_0xc0b8e2,_0x3b5b65,_0xc0b8e2[_0x3dab('0x5e')],_0x4a7009,_0x3dab('0x5f'));})['then'](function(_0x39fd87){_0x2e0325=_0x39fd87;logger[_0x3dab('0x2b')]('Ticket\x20created!');logger[_0x3dab('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x2e0325['id']);return setRelationship(_0x4a7009,_0x53cd37,_0x2e0325,_0x3dab('0x72'));})[_0x3dab('0x31')](function(){return setRelationship(_0x4a7009,_0x187949,_0x2e0325,_0x3dab('0x73'));})[_0x3dab('0x31')](function(){return getServerInfo(_0x4a7009);})['catch'](function(_0x14ed3a){logger[_0x3dab('0x68')]('['+_0x3b5b65[_0x3dab('0x78')][_0x3dab('0x76')]()+']',JSON['stringify'](_0x14ed3a));});}; \ 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 d969ea4..a0d559d 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 _0x4477=['util','getString','length','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4477,0x8b));var _0x7447=function(_0x13e28b,_0x5ee4de){_0x13e28b=_0x13e28b-0x0;var _0x302b7b=_0x4477[_0x13e28b];return _0x302b7b;};'use strict';var _=require(_0x7447('0x0'));var util=require(_0x7447('0x1'));exports[_0x7447('0x2')]=function(_0x2df11a,_0xc14997,_0x12d0c7){var _0x113682=[];if(_0x2df11a[_0x7447('0x3')]>0x0){var _0x7790bc=_['sortBy'](_0x2df11a,['id']);for(var _0x5860b3=0x0;_0x5860b3<_0x7790bc[_0x7447('0x3')];_0x5860b3++){var _0x586efa=_0x7790bc[_0x5860b3];if(_0x586efa[_0x7447('0x4')]===_0x7447('0x5')){_0x113682[_0x7447('0x6')](_0x586efa[_0x7447('0x7')]);}else if(_0x586efa['type']==='variable'&&_0x586efa['variableName']){_0xc14997[_0x586efa[_0x7447('0x8')]]&&_0x113682[_0x7447('0x6')](_0xc14997[_0x586efa['variableName']][_0x7447('0x9')]());}else if(_0x586efa[_0x7447('0x4')]===_0x7447('0xa')&&_0x586efa['Variable']&&_0x586efa[_0x7447('0xb')]['name']){_0xc14997[_0x586efa[_0x7447('0xb')][_0x7447('0xc')][_0x7447('0xd')]()]&&_0x113682[_0x7447('0x6')](_0xc14997[_0x586efa[_0x7447('0xb')][_0x7447('0xc')]['toLowerCase']()][_0x7447('0x9')]());}else if(_0x586efa[_0x7447('0x4')]==='keyValue'){if(_0x586efa[_0x7447('0xe')]==='string'&&_0x586efa[_0x7447('0xf')]){_0x113682[_0x7447('0x6')](util[_0x7447('0x10')](_0x7447('0x11'),_0x586efa['key'],_0x586efa[_0x7447('0x12')]));}else if(_0x586efa[_0x7447('0xe')]===_0x7447('0x13')&&_0x586efa[_0x7447('0x8')]&&_0x586efa['key']){_0xc14997[_0x586efa[_0x7447('0x8')]]&&_0x113682['push'](util[_0x7447('0x10')](_0x7447('0x11'),_0x586efa[_0x7447('0xf')],_0xc14997[_0x586efa['variableName']]));}else if(_0x586efa[_0x7447('0xe')]===_0x7447('0xa')&&_0x586efa[_0x7447('0xb')]&&_0x586efa[_0x7447('0xb')][_0x7447('0xc')]&&_0x586efa[_0x7447('0xf')]){_0xc14997[_0x586efa[_0x7447('0xb')][_0x7447('0xc')][_0x7447('0xd')]()]&&_0x113682[_0x7447('0x6')](util[_0x7447('0x10')](_0x7447('0x11'),_0x586efa['key'],_0xc14997[_0x586efa[_0x7447('0xb')][_0x7447('0xc')][_0x7447('0xd')]()]));}}}}return _0x113682[_0x7447('0x14')](_0x12d0c7);};exports[_0x7447('0x15')]=function(_0x4c8cca){var _0x16152c=_0x4c8cca[_0x7447('0x16')](-0x1);if(_0x16152c==='/'){_0x4c8cca=_0x4c8cca[_0x7447('0x17')](0x0,_0x4c8cca[_0x7447('0x18')](_0x16152c));}return _0x4c8cca;};exports[_0x7447('0x19')]=function(_0xa5a831){if(!_[_0x7447('0x1a')](_0xa5a831)&&_0xa5a831!==''){var _0x2ff837=/^(([^<>()\[\]\\.,;:\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 _0x2ff837[_0x7447('0x1b')](String(_0xa5a831)[_0x7447('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xa35e=['push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','format','%s:\x20%s','key','keyContent','join','stripTrailingSlash','substring','lastIndexOf','util','getString','length','sortBy','type','string'];(function(_0x3a5293,_0x552b4d){var _0x247fc5=function(_0x27f3c1){while(--_0x27f3c1){_0x3a5293['push'](_0x3a5293['shift']());}};_0x247fc5(++_0x552b4d);}(_0xa35e,0x1dd));var _0xea35=function(_0x3a4fb6,_0x3a1a1d){_0x3a4fb6=_0x3a4fb6-0x0;var _0x505e22=_0xa35e[_0x3a4fb6];return _0x505e22;};'use strict';var _=require('lodash');var util=require(_0xea35('0x0'));exports[_0xea35('0x1')]=function(_0x3373a5,_0x3e14f8,_0x252077){var _0x12af14=[];if(_0x3373a5[_0xea35('0x2')]>0x0){var _0x2d5587=_[_0xea35('0x3')](_0x3373a5,['id']);for(var _0x2c8b6c=0x0;_0x2c8b6c<_0x2d5587['length'];_0x2c8b6c++){var _0x558b1c=_0x2d5587[_0x2c8b6c];if(_0x558b1c[_0xea35('0x4')]===_0xea35('0x5')){_0x12af14[_0xea35('0x6')](_0x558b1c['content']);}else if(_0x558b1c['type']===_0xea35('0x7')&&_0x558b1c[_0xea35('0x8')]){_0x3e14f8[_0x558b1c['variableName']]&&_0x12af14['push'](_0x3e14f8[_0x558b1c[_0xea35('0x8')]][_0xea35('0x9')]());}else if(_0x558b1c[_0xea35('0x4')]===_0xea35('0xa')&&_0x558b1c[_0xea35('0xb')]&&_0x558b1c['Variable'][_0xea35('0xc')]){_0x3e14f8[_0x558b1c['Variable']['name'][_0xea35('0xd')]()]&&_0x12af14[_0xea35('0x6')](_0x3e14f8[_0x558b1c[_0xea35('0xb')][_0xea35('0xc')]['toLowerCase']()][_0xea35('0x9')]());}else if(_0x558b1c[_0xea35('0x4')]==='keyValue'){if(_0x558b1c[_0xea35('0xe')]===_0xea35('0x5')&&_0x558b1c['key']){_0x12af14[_0xea35('0x6')](util[_0xea35('0xf')](_0xea35('0x10'),_0x558b1c[_0xea35('0x11')],_0x558b1c[_0xea35('0x12')]));}else if(_0x558b1c[_0xea35('0xe')]===_0xea35('0x7')&&_0x558b1c[_0xea35('0x8')]&&_0x558b1c[_0xea35('0x11')]){_0x3e14f8[_0x558b1c[_0xea35('0x8')]]&&_0x12af14['push'](util[_0xea35('0xf')]('%s:\x20%s',_0x558b1c[_0xea35('0x11')],_0x3e14f8[_0x558b1c[_0xea35('0x8')]]));}else if(_0x558b1c[_0xea35('0xe')]==='customVariable'&&_0x558b1c[_0xea35('0xb')]&&_0x558b1c['Variable'][_0xea35('0xc')]&&_0x558b1c[_0xea35('0x11')]){_0x3e14f8[_0x558b1c[_0xea35('0xb')][_0xea35('0xc')][_0xea35('0xd')]()]&&_0x12af14[_0xea35('0x6')](util[_0xea35('0xf')](_0xea35('0x10'),_0x558b1c[_0xea35('0x11')],_0x3e14f8[_0x558b1c[_0xea35('0xb')][_0xea35('0xc')][_0xea35('0xd')]()]));}}}}return _0x12af14[_0xea35('0x13')](_0x252077);};exports[_0xea35('0x14')]=function(_0x2f3bb5){var _0x2228d3=_0x2f3bb5['slice'](-0x1);if(_0x2228d3==='/'){_0x2f3bb5=_0x2f3bb5[_0xea35('0x15')](0x0,_0x2f3bb5[_0xea35('0x16')](_0x2228d3));}return _0x2f3bb5;};exports['validateEmail']=function(_0x51bd18){if(!_['isNil'](_0x51bd18)&&_0x51bd18!==''){var _0x1c627a=/^(([^<>()\[\]\\.,;:\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 _0x1c627a['test'](String(_0x51bd18)[_0xea35('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 5152a47..273f3be 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','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]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 45a61cb..4dd9558 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 _0x0391=['Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','base64','debug','[HTTP]','stringify','map','picklist','nameField','toLowerCase','toString','includes','string','type','idField','customField','variable','variableName','push','Variable','custom_fields','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','find','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0391,0x11e));var _0x1039=function(_0x15246c,_0x520c2f){_0x15246c=_0x15246c-0x0;var _0x632639=_0x0391[_0x15246c];return _0x632639;};'use strict';var _=require('lodash');var rp=require(_0x1039('0x0'));var md5=require(_0x1039('0x1'));var util=require(_0x1039('0x2'));var Redis=require(_0x1039('0x3'));var intUtil=require('./util');var config=require(_0x1039('0x4'));var logger=require(_0x1039('0x5'))('zendesk');config[_0x1039('0x6')]=_[_0x1039('0x7')](config[_0x1039('0x6')],{'host':_0x1039('0x8'),'port':0x18eb});var io=require(_0x1039('0x9'))(new Redis(config[_0x1039('0x6')]));function emit(_0x2dc75f,_0x69c9a1,_0x120860){io['to'](_0x2dc75f)[_0x1039('0xa')](_0x69c9a1,_0x120860);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x3ed90b,_0x1b9e7a,_0x5d35a6,_0x5e9c49,_0x33c433){logger[_0x1039('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x1039('0xc')](_0x1039('0xd'),_0x3ed90b[_0x1039('0xe')]),'method':_0x1039('0xf'),'body':{'ticket':_[_0x1039('0x10')]({'requester_id':_0x5d35a6['id'],'submitter_id':_0x1b9e7a?_0x1b9e7a['id']:undefined,'assignee_id':_0x1b9e7a?_0x1b9e7a['id']:undefined,'tags':getTags(_0x5e9c49[_0x1039('0x11')],_0x1039('0x12')),'subject':intUtil[_0x1039('0x13')](_0x5e9c49['Subjects'],_0x33c433,'\x20'),'description':intUtil[_0x1039('0x13')](_0x5e9c49[_0x1039('0x14')],_0x33c433,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1039('0x13')](_0x5e9c49[_0x1039('0x14')],_0x33c433,'\x0a')}},getCustomFields(_0x5e9c49['Fields'],_0x33c433))}})[_0x1039('0x15')](function(_0x430c1d){logger['info'](_0x1039('0x16'));return _0x430c1d[_0x1039('0x17')];});}function getUser(_0x5ea263,_0x6613a5){if(intUtil[_0x1039('0x18')](_0x6613a5)){logger[_0x1039('0xb')](_0x1039('0x19'),_0x6613a5);return request({'uri':util[_0x1039('0xc')](_0x1039('0x1a'),_0x5ea263[_0x1039('0xe')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x6613a5)}})[_0x1039('0x15')](function(_0x501f4e){if(_0x501f4e[_0x1039('0x1b')]){logger[_0x1039('0xb')]('Agent\x20found!');return _[_0x1039('0x1c')](_0x501f4e[_0x1039('0x1d')],{'email':_0x6613a5,'role':_0x1039('0x1e')});}else{logger[_0x1039('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1039('0xc')]('%s/users/me.json',_0x5ea263[_0x1039('0xe')])})[_0x1039('0x15')](function(_0x1fbd03){logger['info']('Admin\x20account\x20selected.');return _0x1fbd03[_0x1039('0x1f')];});}});}else{logger['info'](_0x1039('0x20'));return request({'uri':util[_0x1039('0xc')](_0x1039('0x21'),_0x5ea263['remoteUri'])})['then'](function(_0x25068f){logger[_0x1039('0xb')](_0x1039('0x22'));return _0x25068f['user'];});}}function getEndUser(_0x2a67ec,_0xffa582,_0x1d1250){logger[_0x1039('0xb')](_0x1039('0x23'),_0x1d1250);return request({'uri':util[_0x1039('0xc')](_0x1039('0x1a'),_0x2a67ec['remoteUri']),'qs':{'query':util[_0x1039('0xc')](_0x1039('0x24'),_0x1d1250)}})[_0x1039('0x15')](function(_0xcd365d){var _0x18e856;if(_0xcd365d['results']['length']){_0xcd365d[_0x1039('0x1d')]=_['filter'](_0xcd365d['results'],{'suspended':![],'role':_0x1039('0x25')});if(_0xcd365d[_0x1039('0x1d')][_0x1039('0x26')]){_0x18e856=_[_0x1039('0x27')](_0xcd365d['results']);}}if(_0x18e856){logger['info'](_0x1039('0x28'));return _0x18e856;}else{logger['info'](_0x1039('0x29'));return request({'uri':util[_0x1039('0xc')](_0x1039('0x2a'),_0x2a67ec[_0x1039('0xe')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x1039('0xc')](_0x1039('0x2b'),_0xffa582||_0x1d1250),'phone':_0x1d1250}}})[_0x1039('0x15')](function(_0x7e62d7){logger[_0x1039('0xb')](_0x1039('0x2c'));return _0x7e62d7[_0x1039('0x1f')];});}});}function getAuth(_0x4db516){var _0x2cec52;if(_0x4db516[_0x1039('0x2d')]==='password'){_0x2cec52=util[_0x1039('0xc')](_0x1039('0x2e'),_0x4db516[_0x1039('0x2f')],_0x4db516[_0x1039('0x30')]);}else if(_0x4db516['authType']===_0x1039('0x31')){_0x2cec52=util[_0x1039('0xc')](_0x1039('0x32'),_0x4db516['username'],_0x4db516[_0x1039('0x31')]);}return util[_0x1039('0xc')]('Basic\x20%s',new Buffer(_0x2cec52)['toString'](_0x1039('0x33')));}function request(_0x55d028){logger[_0x1039('0x34')](_0x1039('0x35'),JSON[_0x1039('0x36')](_0x55d028));return rp(_[_0x1039('0x7')](_0x55d028,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x45fc51,_0x354808){var _0x4eec60=[];if(_0x45fc51&&_0x45fc51['length']>0x0){_0x4eec60=_[_0x1039('0x37')](_0x45fc51,_0x354808);}return _0x4eec60;}function getCustomFields(_0xe81736,_0x59d6e4){var _0x29f2e5=[];var _0x10ff0b={'custom_fields':[]};if(_0xe81736[_0x1039('0x26')]>0x0){_['forEach'](_0xe81736,function(_0x18ade8){if(_['includes'](['string',_0x1039('0x38')],_0x18ade8['type'])&&_0x18ade8[_0x1039('0x39')]&&!_0x18ade8['customField']){_0x10ff0b[_0x18ade8[_0x1039('0x39')][_0x1039('0x3a')]()]=_0x18ade8['content'][_0x1039('0x3b')]();}else if(_[_0x1039('0x3c')]([_0x1039('0x3d'),_0x1039('0x38')],_0x18ade8[_0x1039('0x3e')])&&_0x18ade8[_0x1039('0x3f')]&&_0x18ade8[_0x1039('0x40')]){_0x10ff0b['custom_fields']['push']({'id':_0x18ade8['idField'],'value':_0x18ade8['content'][_0x1039('0x3b')]()});}else if(_0x18ade8[_0x1039('0x3e')]===_0x1039('0x41')&&_0x18ade8[_0x1039('0x42')]&&_0x18ade8[_0x1039('0x3f')]&&_0x18ade8['customField']){_0x59d6e4[_0x18ade8[_0x1039('0x42')]]&&_0x10ff0b['custom_fields'][_0x1039('0x43')]({'id':_0x18ade8[_0x1039('0x3f')],'value':_0x59d6e4[_0x18ade8[_0x1039('0x42')]]['toString']()});}else if(_0x18ade8[_0x1039('0x3e')]==='customVariable'&&_0x18ade8[_0x1039('0x44')]&&_0x18ade8[_0x1039('0x44')][_0x1039('0x12')]&&_0x18ade8['idField']&&_0x18ade8[_0x1039('0x40')]){_0x59d6e4[_0x18ade8[_0x1039('0x44')]['name'][_0x1039('0x3a')]()]&&_0x10ff0b[_0x1039('0x45')][_0x1039('0x43')]({'id':_0x18ade8['idField'],'value':_0x59d6e4[_0x18ade8[_0x1039('0x44')][_0x1039('0x12')]['toLowerCase']()][_0x1039('0x3b')]()});}});}return _0x10ff0b;}exports[_0x1039('0x46')]=function(_0x18cb14,_0xb6b27e,_0x1f3a26,_0x368277,_0x24ee4a,_0x1ff411){var _0x43cdb5,_0x314a64;_0x1ff411[_0x1039('0xe')]=intUtil[_0x1039('0x47')](_0x1ff411[_0x1039('0xe')]);_0x1ff411['serverUrl']=intUtil['stripTrailingSlash'](_0x1ff411['serverUrl']);if(_0x24ee4a&&_0x24ee4a[_0x1039('0x48')]){logger['info'](_0x1039('0x49'),'Recording\x20is\x20enabled!');_0xb6b27e[_0x1039('0x4a')]=util[_0x1039('0xc')](_0x1039('0x4b'),_0x1ff411[_0x1039('0x4c')],_0xb6b27e[_0x1039('0x4d')],md5(_0xb6b27e['uniqueid']));}else{_0xb6b27e['recordingURL']='';}headers[_0x1039('0x4e')]=getAuth(_0x1ff411);return getUser(_0x1ff411,_0x368277[_0x1039('0x4f')])[_0x1039('0x15')](function(_0x52309f){_0x43cdb5=_0x52309f;logger[_0x1039('0xb')](_0x1039('0x50'),_0x43cdb5['id']);return getEndUser(_0x1ff411,_0xb6b27e[_0x1039('0x51')],_0xb6b27e['calleridnum']);})[_0x1039('0x15')](function(_0x1eb783){_0x314a64=_0x1eb783;logger[_0x1039('0xb')](_0x1039('0x52'),_0x314a64['id']);return getTicket(_0x1ff411,_0x43cdb5,_0x314a64,_0x1f3a26,_0xb6b27e);})[_0x1039('0x15')](function(_0x52478f){if(_0x52478f){logger[_0x1039('0xb')](_0x1039('0x53'),_0x52478f['id']);switch(_0x1ff411['type']){case _0x1039('0x54'):logger[_0x1039('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1039('0xc')](_0x1039('0x55'),_0x1ff411[_0x1039('0xe')],_0x43cdb5['id'],_0x52478f['id']),'method':_0x1039('0xf')});case _0x1039('0x56'):logger[_0x1039('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1039('0xc')](_0x1039('0x57'),_0x368277['name']),_0x1039('0x58'),{'uri':util[_0x1039('0xc')](_0x1039('0x59'),_0x1ff411[_0x1039('0xe')][_0x1039('0x5a')](_0x1039('0x5b'),''),_0x52478f['id'])});break;default:logger[_0x1039('0x5c')](_0x1039('0x49'),_0x1039('0x5d'));}}})[_0x1039('0x5e')](function(_0x1b58cd){logger[_0x1039('0x5c')](_0x1039('0x5f'),util[_0x1039('0x60')](_0x1b58cd,{'showHidden':!![],'depth':null}));});};exports[_0x1039('0x61')]=function(_0x24ef54,_0xc6fe6a,_0x6b140f,_0x590791,_0x29f418,_0x280c8d,_0x40a7f2){var _0xd879a9,_0x45afed;_0x280c8d['remoteUri']=intUtil[_0x1039('0x47')](_0x280c8d[_0x1039('0xe')]);_0x280c8d[_0x1039('0x4c')]=intUtil[_0x1039('0x47')](_0x280c8d[_0x1039('0x4c')]);if(_0x40a7f2&&_0x40a7f2[_0x1039('0x62')]&&_0x40a7f2[_0x1039('0x62')]!==_0x1039('0x63')){logger[_0x1039('0xb')]('[OUTBOUND]',_0x1039('0x64'));_0xc6fe6a[_0x1039('0x4a')]=util[_0x1039('0xc')](_0x1039('0x4b'),_0x280c8d[_0x1039('0x4c')],_0xc6fe6a['uniqueid'],md5(_0xc6fe6a[_0x1039('0x4d')]));}headers[_0x1039('0x4e')]=getAuth(_0x280c8d);return getUser(_0x280c8d,_0x590791[_0x1039('0x4f')])[_0x1039('0x15')](function(_0x593beb){_0xd879a9=_0x593beb;logger[_0x1039('0xb')](_0x1039('0x50'),_0xd879a9['id']);return getEndUser(_0x280c8d,_0xc6fe6a['destcalleridname'],_0xc6fe6a['destcalleridnum']);})[_0x1039('0x15')](function(_0x1d81f1){_0x45afed=_0x1d81f1;logger[_0x1039('0xb')](_0x1039('0x52'),_0x45afed['id']);return getTicket(_0x280c8d,_0xd879a9,_0x45afed,_0x6b140f,_0xc6fe6a);})[_0x1039('0x15')](function(_0x1182d2){if(_0x1182d2){logger[_0x1039('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1182d2['id']);switch(_0x280c8d[_0x1039('0x3e')]){case _0x1039('0x54'):logger[_0x1039('0xb')](_0x1039('0x65'),_0x1039('0x66'));return request({'uri':util[_0x1039('0xc')](_0x1039('0x55'),_0x280c8d[_0x1039('0xe')],_0xd879a9['id'],_0x1182d2['id']),'method':'POST'});case _0x1039('0x56'):logger[_0x1039('0xb')](_0x1039('0x65'),_0x1039('0x67'));emit(util[_0x1039('0xc')](_0x1039('0x57'),_0x590791[_0x1039('0x12')]),_0x1039('0x58'),{'uri':util[_0x1039('0xc')](_0x1039('0x59'),_0x280c8d['remoteUri'][_0x1039('0x5a')](_0x1039('0x5b'),''),_0x1182d2['id'])});break;default:logger['error'](_0x1039('0x65'),_0x1039('0x5d'));}}})[_0x1039('0x5e')](function(_0x1f2850){logger[_0x1039('0x5c')](_0x1039('0x68'),util[_0x1039('0x60')](_0x1f2850,{'showHidden':!![],'depth':null}));});};exports[_0x1039('0x69')]=function(_0x17fdf6,_0x384ba1,_0x2e2351,_0x27821a,_0x51cff5,_0x59e924){var _0x8d5026,_0x43af1e;_0x59e924[_0x1039('0xe')]=intUtil[_0x1039('0x47')](_0x59e924['remoteUri']);_0x59e924['serverUrl']=intUtil[_0x1039('0x47')](_0x59e924['serverUrl']);if(_0x51cff5&&_0x51cff5['monitor_format']){logger['info']('['+_0x384ba1[_0x1039('0x6a')][_0x1039('0x6b')]()+']',_0x1039('0x64'));_0x384ba1['recordingURL']=util[_0x1039('0xc')](_0x1039('0x4b'),_0x59e924[_0x1039('0x4c')],_0x384ba1[_0x1039('0x4d')],md5(_0x384ba1[_0x1039('0x4d')]));}else{_0x384ba1[_0x1039('0x4a')]='';}headers[_0x1039('0x4e')]=getAuth(_0x59e924);return getUser(_0x59e924)[_0x1039('0x15')](function(_0x5ea4bb){_0x8d5026=_0x5ea4bb;logger[_0x1039('0xb')](_0x1039('0x50'),_0x8d5026['id']);return getEndUser(_0x59e924,_0x384ba1['calleridname'],_0x384ba1[_0x1039('0x6c')]);})['then'](function(_0x303501){_0x43af1e=_0x303501;logger['info'](_0x1039('0x52'),_0x43af1e['id']);return getTicket(_0x59e924,_0x8d5026,_0x43af1e,_0x2e2351,_0x384ba1);})[_0x1039('0x15')](function(_0x3fe021){if(_0x3fe021){logger[_0x1039('0xb')](_0x1039('0x53'),_0x3fe021['id']);}})[_0x1039('0x5e')](function(_0x3cb2f7){logger[_0x1039('0x5c')]('['+_0x384ba1[_0x1039('0x6a')][_0x1039('0x6b')]()+']'+_0x1039('0x6d'),util[_0x1039('0x60')](_0x3cb2f7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1c37=['catch','error','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','zendesk','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','Subjects','getString','Descriptions','Fields','then','validateEmail','info','type:user\x20role:agent\x20email:%s','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','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.','authType','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','push','variable','variableName','idField','custom_fields','customVariable','Variable','name','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','serverUrl','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized'];(function(_0x2fca74,_0x4be6e5){var _0xd43fc4=function(_0x565142){while(--_0x565142){_0x2fca74['push'](_0x2fca74['shift']());}};_0xd43fc4(++_0x4be6e5);}(_0x1c37,0x16a));var _0x71c3=function(_0x45cd0f,_0x513d53){_0x45cd0f=_0x45cd0f-0x0;var _0x45d9c6=_0x1c37[_0x45cd0f];return _0x45d9c6;};'use strict';var _=require(_0x71c3('0x0'));var rp=require(_0x71c3('0x1'));var md5=require('md5');var util=require(_0x71c3('0x2'));var Redis=require(_0x71c3('0x3'));var intUtil=require(_0x71c3('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x71c3('0x5'));config[_0x71c3('0x6')]=_['defaults'](config[_0x71c3('0x6')],{'host':_0x71c3('0x7'),'port':0x18eb});var io=require(_0x71c3('0x8'))(new Redis(config[_0x71c3('0x6')]));function emit(_0x28795e,_0x350bb2,_0x1beb6b){io['to'](_0x28795e)[_0x71c3('0x9')](_0x350bb2,_0x1beb6b);}var headers={'Content-Type':'application/json','Accept':_0x71c3('0xa')};function getTicket(_0x532e5c,_0x357e72,_0x3831e9,_0x57730d,_0x22035f){logger['info'](_0x71c3('0xb'));return request({'uri':util[_0x71c3('0xc')](_0x71c3('0xd'),_0x532e5c[_0x71c3('0xe')]),'method':_0x71c3('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x3831e9['id'],'submitter_id':_0x357e72?_0x357e72['id']:undefined,'assignee_id':_0x357e72?_0x357e72['id']:undefined,'tags':getTags(_0x57730d[_0x71c3('0x10')],'name'),'subject':intUtil['getString'](_0x57730d[_0x71c3('0x11')],_0x22035f,'\x20'),'description':intUtil[_0x71c3('0x12')](_0x57730d['Descriptions'],_0x22035f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x71c3('0x12')](_0x57730d[_0x71c3('0x13')],_0x22035f,'\x0a')}},getCustomFields(_0x57730d[_0x71c3('0x14')],_0x22035f))}})[_0x71c3('0x15')](function(_0x4eedd8){logger['info']('Ticket\x20created!');return _0x4eedd8['ticket'];});}function getUser(_0xa23d61,_0x16e507){if(intUtil[_0x71c3('0x16')](_0x16e507)){logger[_0x71c3('0x17')]('Getting\x20agent\x20with\x20email',_0x16e507);return request({'uri':util[_0x71c3('0xc')]('%s/search.json',_0xa23d61['remoteUri']),'qs':{'query':util[_0x71c3('0xc')](_0x71c3('0x18'),_0x16e507)}})[_0x71c3('0x15')](function(_0x39aef0){if(_0x39aef0[_0x71c3('0x19')]){logger[_0x71c3('0x17')](_0x71c3('0x1a'));return _[_0x71c3('0x1b')](_0x39aef0[_0x71c3('0x1c')],{'email':_0x16e507,'role':_0x71c3('0x1d')});}else{logger['info'](_0x71c3('0x1e'));return request({'uri':util[_0x71c3('0xc')]('%s/users/me.json',_0xa23d61[_0x71c3('0xe')])})[_0x71c3('0x15')](function(_0xa44c20){logger[_0x71c3('0x17')](_0x71c3('0x1f'));return _0xa44c20[_0x71c3('0x20')];});}});}else{logger[_0x71c3('0x17')](_0x71c3('0x1e'));return request({'uri':util[_0x71c3('0xc')](_0x71c3('0x21'),_0xa23d61['remoteUri'])})[_0x71c3('0x15')](function(_0x4f2e1f){logger[_0x71c3('0x17')](_0x71c3('0x1f'));return _0x4f2e1f[_0x71c3('0x20')];});}}function getEndUser(_0x5f09df,_0x299cab,_0x1b9819){logger[_0x71c3('0x17')](_0x71c3('0x22'),_0x1b9819);return request({'uri':util[_0x71c3('0xc')](_0x71c3('0x23'),_0x5f09df[_0x71c3('0xe')]),'qs':{'query':util[_0x71c3('0xc')](_0x71c3('0x24'),_0x1b9819)}})['then'](function(_0x46814f){var _0x3216b4;if(_0x46814f[_0x71c3('0x1c')][_0x71c3('0x25')]){_0x46814f['results']=_['filter'](_0x46814f['results'],{'suspended':![],'role':'end-user'});if(_0x46814f[_0x71c3('0x1c')][_0x71c3('0x25')]){_0x3216b4=_[_0x71c3('0x26')](_0x46814f[_0x71c3('0x1c')]);}}if(_0x3216b4){logger[_0x71c3('0x17')](_0x71c3('0x27'));return _0x3216b4;}else{logger[_0x71c3('0x17')](_0x71c3('0x28'));return request({'uri':util[_0x71c3('0xc')](_0x71c3('0x29'),_0x5f09df[_0x71c3('0xe')]),'method':_0x71c3('0xf'),'body':{'user':{'role':_0x71c3('0x2a'),'name':util['format']('Caller\x20-\x20%s',_0x299cab||_0x1b9819),'phone':_0x1b9819}}})[_0x71c3('0x15')](function(_0x4a5042){logger['info'](_0x71c3('0x2b'));return _0x4a5042['user'];});}});}function getAuth(_0x5e433d){var _0x4531a7;if(_0x5e433d[_0x71c3('0x2c')]==='password'){_0x4531a7=util[_0x71c3('0xc')](_0x71c3('0x2d'),_0x5e433d['username'],_0x5e433d[_0x71c3('0x2e')]);}else if(_0x5e433d[_0x71c3('0x2c')]===_0x71c3('0x2f')){_0x4531a7=util[_0x71c3('0xc')](_0x71c3('0x30'),_0x5e433d[_0x71c3('0x31')],_0x5e433d['token']);}return util[_0x71c3('0xc')](_0x71c3('0x32'),new Buffer(_0x4531a7)[_0x71c3('0x33')]('base64'));}function request(_0x10f3e8){logger['debug'](_0x71c3('0x34'),JSON[_0x71c3('0x35')](_0x10f3e8));return rp(_[_0x71c3('0x36')](_0x10f3e8,{'method':_0x71c3('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x28c103,_0x2a7906){var _0x6d1756=[];if(_0x28c103&&_0x28c103[_0x71c3('0x25')]>0x0){_0x6d1756=_[_0x71c3('0x38')](_0x28c103,_0x2a7906);}return _0x6d1756;}function getCustomFields(_0x2da8ad,_0x411c43){var _0x3dda5a=[];var _0x36b5fa={'custom_fields':[]};if(_0x2da8ad[_0x71c3('0x25')]>0x0){_[_0x71c3('0x39')](_0x2da8ad,function(_0x3b5c6f){if(_[_0x71c3('0x3a')]([_0x71c3('0x3b'),_0x71c3('0x3c')],_0x3b5c6f[_0x71c3('0x3d')])&&_0x3b5c6f['nameField']&&!_0x3b5c6f[_0x71c3('0x3e')]){_0x36b5fa[_0x3b5c6f[_0x71c3('0x3f')][_0x71c3('0x40')]()]=_0x3b5c6f[_0x71c3('0x41')][_0x71c3('0x33')]();}else if(_[_0x71c3('0x3a')]([_0x71c3('0x3b'),_0x71c3('0x3c')],_0x3b5c6f[_0x71c3('0x3d')])&&_0x3b5c6f['idField']&&_0x3b5c6f['customField']){_0x36b5fa['custom_fields'][_0x71c3('0x42')]({'id':_0x3b5c6f['idField'],'value':_0x3b5c6f[_0x71c3('0x41')][_0x71c3('0x33')]()});}else if(_0x3b5c6f['type']===_0x71c3('0x43')&&_0x3b5c6f[_0x71c3('0x44')]&&_0x3b5c6f[_0x71c3('0x45')]&&_0x3b5c6f[_0x71c3('0x3e')]){_0x411c43[_0x3b5c6f[_0x71c3('0x44')]]&&_0x36b5fa[_0x71c3('0x46')][_0x71c3('0x42')]({'id':_0x3b5c6f[_0x71c3('0x45')],'value':_0x411c43[_0x3b5c6f[_0x71c3('0x44')]][_0x71c3('0x33')]()});}else if(_0x3b5c6f['type']===_0x71c3('0x47')&&_0x3b5c6f['Variable']&&_0x3b5c6f[_0x71c3('0x48')]['name']&&_0x3b5c6f[_0x71c3('0x45')]&&_0x3b5c6f['customField']){_0x411c43[_0x3b5c6f[_0x71c3('0x48')][_0x71c3('0x49')][_0x71c3('0x40')]()]&&_0x36b5fa[_0x71c3('0x46')]['push']({'id':_0x3b5c6f[_0x71c3('0x45')],'value':_0x411c43[_0x3b5c6f['Variable'][_0x71c3('0x49')][_0x71c3('0x40')]()]['toString']()});}});}return _0x36b5fa;}exports[_0x71c3('0x4a')]=function(_0x17e9cf,_0x200e59,_0x27fc95,_0x16a9b8,_0x59a004,_0x60cd69){var _0x315eb4,_0x5acb22;_0x60cd69[_0x71c3('0xe')]=intUtil[_0x71c3('0x4b')](_0x60cd69['remoteUri']);_0x60cd69['serverUrl']=intUtil[_0x71c3('0x4b')](_0x60cd69['serverUrl']);if(_0x59a004&&_0x59a004[_0x71c3('0x4c')]){logger[_0x71c3('0x17')](_0x71c3('0x4d'),_0x71c3('0x4e'));_0x200e59['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x60cd69[_0x71c3('0x4f')],_0x200e59['uniqueid'],md5(_0x200e59[_0x71c3('0x50')]));}else{_0x200e59[_0x71c3('0x51')]='';}headers[_0x71c3('0x52')]=getAuth(_0x60cd69);return getUser(_0x60cd69,_0x16a9b8[_0x71c3('0x53')])['then'](function(_0x37c31f){_0x315eb4=_0x37c31f;logger[_0x71c3('0x17')](_0x71c3('0x54'),_0x315eb4['id']);return getEndUser(_0x60cd69,_0x200e59[_0x71c3('0x55')],_0x200e59['calleridnum']);})[_0x71c3('0x15')](function(_0x3310f8){_0x5acb22=_0x3310f8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5acb22['id']);return getTicket(_0x60cd69,_0x315eb4,_0x5acb22,_0x27fc95,_0x200e59);})['then'](function(_0x242b1c){if(_0x242b1c){logger[_0x71c3('0x17')]('The\x20Ticket\x20ID\x20is:',_0x242b1c['id']);switch(_0x60cd69[_0x71c3('0x3d')]){case _0x71c3('0x56'):logger[_0x71c3('0x17')](_0x71c3('0x4d'),_0x71c3('0x57'));return request({'uri':util[_0x71c3('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x60cd69[_0x71c3('0xe')],_0x315eb4['id'],_0x242b1c['id']),'method':_0x71c3('0xf')});case _0x71c3('0x58'):logger[_0x71c3('0x17')]('[QUEUE]',_0x71c3('0x59'));emit(util[_0x71c3('0xc')]('user:%s',_0x16a9b8['name']),_0x71c3('0x5a'),{'uri':util['format']('%s/agent/tickets/%s',_0x60cd69[_0x71c3('0xe')][_0x71c3('0x5b')](_0x71c3('0x5c'),''),_0x242b1c['id'])});break;default:logger['error'](_0x71c3('0x4d'),_0x71c3('0x5d'));}}})[_0x71c3('0x5e')](function(_0x34fb38){logger[_0x71c3('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x71c3('0x60')](_0x34fb38,{'showHidden':!![],'depth':null}));});};exports[_0x71c3('0x61')]=function(_0x5adf1d,_0x226d02,_0x53fdf0,_0x1c65db,_0x18c2f2,_0x38e02e,_0x290f09){var _0x49acf6,_0x3d715e;_0x38e02e[_0x71c3('0xe')]=intUtil[_0x71c3('0x4b')](_0x38e02e[_0x71c3('0xe')]);_0x38e02e['serverUrl']=intUtil[_0x71c3('0x4b')](_0x38e02e[_0x71c3('0x4f')]);if(_0x290f09&&_0x290f09[_0x71c3('0x62')]&&_0x290f09[_0x71c3('0x62')]!==_0x71c3('0x63')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x226d02[_0x71c3('0x51')]=util[_0x71c3('0xc')](_0x71c3('0x64'),_0x38e02e['serverUrl'],_0x226d02[_0x71c3('0x50')],md5(_0x226d02['uniqueid']));}headers[_0x71c3('0x52')]=getAuth(_0x38e02e);return getUser(_0x38e02e,_0x1c65db[_0x71c3('0x53')])[_0x71c3('0x15')](function(_0x94dcc8){_0x49acf6=_0x94dcc8;logger[_0x71c3('0x17')](_0x71c3('0x54'),_0x49acf6['id']);return getEndUser(_0x38e02e,_0x226d02['destcalleridname'],_0x226d02[_0x71c3('0x65')]);})['then'](function(_0xc18335){_0x3d715e=_0xc18335;logger[_0x71c3('0x17')](_0x71c3('0x66'),_0x3d715e['id']);return getTicket(_0x38e02e,_0x49acf6,_0x3d715e,_0x53fdf0,_0x226d02);})[_0x71c3('0x15')](function(_0x41d80f){if(_0x41d80f){logger[_0x71c3('0x17')](_0x71c3('0x67'),_0x41d80f['id']);switch(_0x38e02e[_0x71c3('0x3d')]){case _0x71c3('0x56'):logger[_0x71c3('0x17')](_0x71c3('0x68'),_0x71c3('0x57'));return request({'uri':util['format'](_0x71c3('0x69'),_0x38e02e[_0x71c3('0xe')],_0x49acf6['id'],_0x41d80f['id']),'method':_0x71c3('0xf')});case _0x71c3('0x58'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x71c3('0xc')](_0x71c3('0x6a'),_0x1c65db['name']),_0x71c3('0x5a'),{'uri':util[_0x71c3('0xc')](_0x71c3('0x6b'),_0x38e02e[_0x71c3('0xe')][_0x71c3('0x5b')](_0x71c3('0x5c'),''),_0x41d80f['id'])});break;default:logger[_0x71c3('0x5f')](_0x71c3('0x68'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x71c3('0x5e')](function(_0x27dffb){logger[_0x71c3('0x5f')](_0x71c3('0x6c'),util[_0x71c3('0x60')](_0x27dffb,{'showHidden':!![],'depth':null}));});};exports[_0x71c3('0x6d')]=function(_0x292f46,_0x1c3941,_0x4011dd,_0x28d093,_0xfd0389,_0x48ed61){var _0x58872f,_0x1bbcf2;_0x48ed61[_0x71c3('0xe')]=intUtil[_0x71c3('0x4b')](_0x48ed61[_0x71c3('0xe')]);_0x48ed61[_0x71c3('0x4f')]=intUtil[_0x71c3('0x4b')](_0x48ed61[_0x71c3('0x4f')]);if(_0xfd0389&&_0xfd0389[_0x71c3('0x4c')]){logger['info']('['+_0x1c3941[_0x71c3('0x6e')][_0x71c3('0x6f')]()+']',_0x71c3('0x4e'));_0x1c3941['recordingURL']=util[_0x71c3('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x48ed61[_0x71c3('0x4f')],_0x1c3941[_0x71c3('0x50')],md5(_0x1c3941[_0x71c3('0x50')]));}else{_0x1c3941[_0x71c3('0x51')]='';}headers[_0x71c3('0x52')]=getAuth(_0x48ed61);return getUser(_0x48ed61)[_0x71c3('0x15')](function(_0x6a2f1){_0x58872f=_0x6a2f1;logger[_0x71c3('0x17')](_0x71c3('0x54'),_0x58872f['id']);return getEndUser(_0x48ed61,_0x1c3941[_0x71c3('0x55')],_0x1c3941[_0x71c3('0x70')]);})[_0x71c3('0x15')](function(_0x1ad4f1){_0x1bbcf2=_0x1ad4f1;logger[_0x71c3('0x17')]('The\x20Enduser\x20ID\x20is:',_0x1bbcf2['id']);return getTicket(_0x48ed61,_0x58872f,_0x1bbcf2,_0x4011dd,_0x1c3941);})['then'](function(_0x2ab6c5){if(_0x2ab6c5){logger[_0x71c3('0x17')](_0x71c3('0x67'),_0x2ab6c5['id']);}})[_0x71c3('0x5e')](function(_0x2c77c7){logger['error']('['+_0x1c3941['lastevent'][_0x71c3('0x6f')]()+']'+_0x71c3('0x71'),util[_0x71c3('0x60')](_0x2c77c7,{'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 a226bcc..fde3f3e 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 _0xde9c=['First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','diff','mm:ss','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Fields','SUCCESS','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','https://crm.','lastevent','calleridname','toUpperCase','lodash','request-promise','md5','ioredis','bluebird','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','role','first_name','then','code','details','startCase','moduleCreate','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','last_name','getString','Description','Descriptions','enduserType','Who_Id','Full_Name'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xde9c,0xc4));var _0xcde9=function(_0x296d5d,_0x5ec80d){_0x296d5d=_0x296d5d-0x0;var _0x6d8947=_0xde9c[_0x296d5d];return _0x6d8947;};'use strict';var _=require(_0xcde9('0x0'));var rp=require(_0xcde9('0x1'));var md5=require(_0xcde9('0x2'));var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xcde9('0x3'));var BPromise=require(_0xcde9('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcde9('0x5'))(_0xcde9('0x6'));config[_0xcde9('0x7')]=_['defaults'](config[_0xcde9('0x7')],{'host':_0xcde9('0x8'),'port':0x18eb});var io=require(_0xcde9('0x9'))(new Redis(config['redis']));function emit(_0x2d98ca,_0x4a7483,_0x5f693e){io['to'](_0x2d98ca)[_0xcde9('0xa')](_0x4a7483,_0x5f693e);}function request(_0x2d8dcc){logger['debug'](_0xcde9('0xb'),JSON[_0xcde9('0xc')](_0x2d8dcc));return rp(_0x2d8dcc);}function getCustomFields(_0x39d0ed,_0x337618){var _0x32e113={};if(_0x39d0ed[_0xcde9('0xd')]>0x0){_[_0xcde9('0xe')](_0x39d0ed,function(_0xd47b25){if(_[_0xcde9('0xf')]([_0xcde9('0x10'),_0xcde9('0x11')],_0xd47b25[_0xcde9('0x12')])&&_0xd47b25[_0xcde9('0x13')]){_0x32e113[_0xd47b25[_0xcde9('0x13')]]=_0xd47b25['content']['toString']();}else if(_0xd47b25[_0xcde9('0x12')]==='variable'&&_0xd47b25[_0xcde9('0x14')]&&_0xd47b25[_0xcde9('0x13')]&&_0x337618[_0xd47b25[_0xcde9('0x14')]]){_0x32e113[_0xd47b25[_0xcde9('0x13')]]=_0x337618[_0xd47b25[_0xcde9('0x14')]]['toString']();}else if(_0xd47b25[_0xcde9('0x12')]===_0xcde9('0x15')&&_0xd47b25[_0xcde9('0x16')]&&_0xd47b25[_0xcde9('0x16')][_0xcde9('0x17')]&&_0xd47b25[_0xcde9('0x13')]&&_0x337618[_0xd47b25[_0xcde9('0x16')][_0xcde9('0x17')][_0xcde9('0x18')]()]){_0x32e113[_0xd47b25['idField']]=_0x337618[_0xd47b25[_0xcde9('0x16')][_0xcde9('0x17')][_0xcde9('0x18')]()]['toString']();}});}return _0x32e113;}function getName(_0x43d65c){if(_0x43d65c['indexOf']('\x20')>0x0){var _0x4b9199=_0x43d65c[_0xcde9('0x19')](/ (.+)/);if(_0x4b9199[0x1]){return _0x4b9199;}}return[_0x43d65c,_0x43d65c];}var accountsTokens={};function getAccessToken(_0x1a986c){return new Promise(function(_0x2bb012,_0x12a798){if(!_[_0xcde9('0x1a')](accountsTokens[_0x1a986c['id']])&&!_[_0xcde9('0x1a')](accountsTokens[_0x1a986c['id']][_0xcde9('0x1b')])){if(moment()[_0xcde9('0x1c')](accountsTokens[_0x1a986c['id']][_0xcde9('0x1d')])){_0x2bb012(accountsTokens[_0x1a986c['id']][_0xcde9('0x1b')]);}}var _0x2ccd17;switch(_0x1a986c[_0xcde9('0x1e')]){case'US':_0x2ccd17='https://accounts.zoho.com';break;case'AU':_0x2ccd17=_0xcde9('0x1f');break;case'EU':_0x2ccd17=_0xcde9('0x20');break;case'IN':_0x2ccd17='https://accounts.zoho.in';break;case'CN':_0x2ccd17=_0xcde9('0x21');break;default:_0x2ccd17='https://accounts.zoho.eu';break;}var _0x2a3568={'method':_0xcde9('0x22'),'uri':_0x2ccd17+'/oauth/v2/token','qs':{'refresh_token':_0x1a986c['refreshToken'],'client_id':_0x1a986c['clientId'],'client_secret':_0x1a986c['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x2a3568)['then'](function(_0x2cd9ed){accountsTokens[_0x1a986c['id']]={'access_token':_0x2cd9ed['access_token'],'expires_in':moment()['add'](_0x2cd9ed[_0xcde9('0x1d')],_0xcde9('0x23'))};_0x2bb012(_0x2cd9ed['access_token']);})[_0xcde9('0x24')](function(_0xdd9cb4){logger['error']('Failing\x20creating\x20the\x20access_token',_0xdd9cb4[_0xcde9('0x25')]);_0x12a798(_0xdd9cb4);});});}function getUser(_0x4052a9,_0x492fb1,_0x140db0,_0x42722e){logger[_0xcde9('0x26')](_0xcde9('0x27'));return request({'method':_0xcde9('0x28'),'uri':util[_0xcde9('0x29')](_0xcde9('0x2a'),_0x492fb1),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xcde9('0x2b')+_0x4052a9},'json':!![]})['then'](function(_0x3b6e9f){if(_0x3b6e9f[_0xcde9('0x2c')]){var _0x491aae=-0x1;if(_['isArrayLikeObject'](_0x3b6e9f[_0xcde9('0x2c')])){if(!_['isNil'](_0x42722e)){_0x491aae=_[_0xcde9('0x2d')](_0x3b6e9f[_0xcde9('0x2c')],function(_0x3a48b5){return _0x3a48b5[_0xcde9('0x2e')]===_0x42722e;});}if(_0x491aae>=0x0){logger[_0xcde9('0x26')](_0xcde9('0x2f'));}else{logger[_0xcde9('0x26')](_0xcde9('0x30'));_0x491aae=_[_0xcde9('0x2d')](_0x3b6e9f['users'],function(_0x5ba9d1){return _0x5ba9d1[_0xcde9('0x31')][_0xcde9('0x17')]==='Administrator';});}return _0x3b6e9f[_0xcde9('0x2c')][_0x491aae];}else{if(_0x3b6e9f[_0xcde9('0x32')]['profile'][_0xcde9('0x17')]===_0xcde9('0x33')){logger['info'](_0xcde9('0x30'));user=_0x3b6e9f[_0xcde9('0x32')];return user;}else{logger[_0xcde9('0x34')](_0xcde9('0x35'),JSON[_0xcde9('0xc')](_0x3b6e9f));throw new Error(_0xcde9('0x36')+JSON['stringify'](_0x3b6e9f));}}}else{logger[_0xcde9('0x34')](_0xcde9('0x35'),JSON[_0xcde9('0xc')](_0x3b6e9f));throw new Error(_0xcde9('0x36')+JSON['stringify'](_0x3b6e9f));}})['catch'](function(_0x5009d5){console[_0xcde9('0x34')](_0x5009d5);});}function getZohoUser(_0x36dc44,_0xfc5c02){return new BPromise(function(_0x51d9cb,_0x182893){request(_0x36dc44)['then'](function(_0xfb388){var _0x1b72ad=null;if(_0xfb388){_0x1b72ad=_0xfb388[_0xcde9('0x37')][0x0];_0x1b72ad['enduserType']=_0xfc5c02;}_0x51d9cb(_0x1b72ad);})[_0xcde9('0x24')](function(_0xccf95e){_0x182893(_0xccf95e);});});}function createEndUser(_0x3e7b8f,_0x4f7cc1,_0x20a6f1,_0x1413ac,_0x376bd5,_0x5ab886){var _0x20a6f1=getName(_0x20a6f1);return request({'method':'POST','uri':_0xcde9('0x38')+_0x4f7cc1+'/crm/v2/'+_['startCase'](_0x5ab886['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x20a6f1[0x1],'First_Name':_0x20a6f1[0x0],'Phone':_0x1413ac,'Owner':{'name':!_['isNil'](_0x376bd5[_0xcde9('0x39')][_0xcde9('0x17')])?_0x376bd5[_0xcde9('0x39')][_0xcde9('0x17')]:!_[_0xcde9('0x1a')](_0x376bd5[_0xcde9('0x3a')])?_0x376bd5[_0xcde9('0x3a')]+'\x20'+_0x376bd5['last_name']:_0x376bd5['last_name'],'id':_0x376bd5['id']}}]},'headers':{'Authorization':_0xcde9('0x2b')+_0x3e7b8f},'json':!![]})[_0xcde9('0x3b')](function(_0x37f60c){if(_0x37f60c&&_0x37f60c['data'][0x0][_0xcde9('0x3c')]==='SUCCESS'){var _0x5a752e=_0x37f60c[_0xcde9('0x37')][0x0][_0xcde9('0x3d')];_0x5a752e['enduserType']=_[_0xcde9('0x3e')](_0x5ab886[_0xcde9('0x3f')])+'s';return _0x5a752e;}logger['error'](_0xcde9('0x35'),JSON['stringify'](data));throw new Error(_0xcde9('0x40')+JSON['stringify'](data));})[_0xcde9('0x24')](function(_0x3432cc){console[_0xcde9('0x41')]('CREATE\x20ERROR',_0x3432cc);});}function getEndUser(_0x3e1c5d,_0x201fcf,_0x18773e,_0x3aac06,_0x4e2f64,_0x463102,_0x130500){var _0x5ee9b3={'method':'GET','uri':'','headers':{'Authorization':_0xcde9('0x2b')+_0x3e1c5d},'json':!![]};switch(_0x130500['moduleSearch']){case _0xcde9('0x42'):_0x5ee9b3[_0xcde9('0x43')]=_0xcde9('0x38')+_0x201fcf+_0xcde9('0x44')+_0x4e2f64+'))';return getZohoUser(_0x5ee9b3,_0xcde9('0x45'))['then'](function(_0x3759f6){if(_0x3759f6)return _0x3759f6;_0x5ee9b3[_0xcde9('0x43')]='https://www.zohoapis.'+_0x201fcf+_0xcde9('0x46')+_0x4e2f64+'))';return getZohoUser(_0x5ee9b3,_0xcde9('0x47'))[_0xcde9('0x3b')](function(_0x40b170){if(_0x40b170)return _0x40b170;if(_0x130500['moduleCreate']!='nothing'){return createEndUser(_0x3e1c5d,_0x201fcf,_0x3aac06,_0x4e2f64,_0x463102,_0x130500);}else{return{};}});});break;case'contact':_0x5ee9b3[_0xcde9('0x43')]=_0xcde9('0x38')+_0x201fcf+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4e2f64+'))';return getZohoUser(_0x5ee9b3,_0xcde9('0x45'))[_0xcde9('0x3b')](function(_0x214adc){if(_0x214adc)return _0x214adc;if(_0x130500[_0xcde9('0x3f')]!=_0xcde9('0x48')){return createEndUser(_0x3e1c5d,_0x201fcf,_0x3aac06,_0x4e2f64,_0x463102,_0x130500);}else{return{};}});break;case _0xcde9('0x49'):_0x5ee9b3[_0xcde9('0x43')]='https://www.zohoapis.'+_0x201fcf+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4e2f64+'))';return getZohoUser(_0x5ee9b3,_0xcde9('0x47'))[_0xcde9('0x3b')](function(_0x15ef4e){if(_0x15ef4e)return _0x15ef4e;if(_0x130500['moduleCreate']!=_0xcde9('0x48')){return createEndUser(_0x3e1c5d,_0x201fcf,_0x3aac06,_0x4e2f64,_0x463102,_0x130500);}else{return{};}});break;}}function getCall(_0x3c6348,_0x485ad1,_0x1e0105,_0x9da9ec,_0x54653f,_0x1cb028,_0x4cd355,_0x162963){logger[_0xcde9('0x26')](_0xcde9('0x4a'));var _0x109d82={};_0x109d82[_0xcde9('0x4b')]={'name':!_[_0xcde9('0x1a')](_0x9da9ec[_0xcde9('0x39')][_0xcde9('0x17')])&&!_[_0xcde9('0x1a')](_0x9da9ec[_0xcde9('0x31')][_0xcde9('0x17')])&&_0x9da9ec[_0xcde9('0x31')][_0xcde9('0x17')]===_0xcde9('0x4c')?_0x9da9ec[_0xcde9('0x39')][_0xcde9('0x17')]:!_[_0xcde9('0x1a')](_0x9da9ec[_0xcde9('0x3a')])?_0x9da9ec['first_name']+'\x20'+_0x9da9ec['last_name']:_0x9da9ec[_0xcde9('0x4d')],'id':_0x9da9ec['id']};_0x109d82['Subject']=intUtil[_0xcde9('0x4e')](_0x1cb028['Subjects'],_0x4cd355,'\x20');_0x109d82[_0xcde9('0x4f')]=intUtil['getString'](_0x1cb028[_0xcde9('0x50')],_0x4cd355,'\x0a');if(_0x54653f[_0xcde9('0x51')]===_0xcde9('0x45')){_0x109d82[_0xcde9('0x52')]={'name':!_[_0xcde9('0x1a')](_0x54653f[_0xcde9('0x53')])?_0x54653f[_0xcde9('0x53')]:!_[_0xcde9('0x1a')](_0x54653f['First_Name'])?_0x54653f[_0xcde9('0x54')]+'\x20'+_0x54653f[_0xcde9('0x55')]:_0x54653f[_0xcde9('0x55')],'id':_0x54653f['id']};}if(_0x54653f['enduserType']===_0xcde9('0x47')){_0x109d82[_0xcde9('0x56')]={'name':!_[_0xcde9('0x1a')](_0x54653f[_0xcde9('0x53')])?_0x54653f[_0xcde9('0x53')]:!_[_0xcde9('0x1a')](_0x54653f[_0xcde9('0x54')])?_0x54653f[_0xcde9('0x54')]+'\x20'+_0x54653f[_0xcde9('0x55')]:_0x54653f[_0xcde9('0x55')],'id':_0x54653f['id']};_0x109d82[_0xcde9('0x57')]=_[_0xcde9('0x3e')](_0x54653f['enduserType']);}if(_0x4cd355[_0xcde9('0x58')]){_0x109d82[_0xcde9('0x59')]=moment[_0xcde9('0x5a')](parseInt(_0x4cd355[_0xcde9('0x58')])*0x3e8)['format']('mm:ss');}else if(_0x4cd355[_0xcde9('0x5b')]&&_0x4cd355[_0xcde9('0x5c')]){_0x109d82[_0xcde9('0x59')]=moment['utc'](moment(_0x4cd355[_0xcde9('0x5c')],'YYYY-MM-DDTHH:mm:ss')[_0xcde9('0x5d')](moment(_0x4cd355['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xcde9('0x29')](_0xcde9('0x5e'));}switch(_0x4cd355['lastevent']){case _0xcde9('0x5f'):_0x109d82[_0xcde9('0x60')]=_0xcde9('0x61');break;case _0xcde9('0x62'):case _0xcde9('0x63'):_0x109d82[_0xcde9('0x60')]=_0xcde9('0x64');break;case _0xcde9('0x65'):_0x109d82[_0xcde9('0x60')]=_0xcde9('0x66');break;case _0xcde9('0x67'):_0x109d82['Call_Result']='Abandoned';break;case _0xcde9('0x68'):_0x109d82[_0xcde9('0x60')]='Timeout';default:}_0x109d82[_0xcde9('0x69')]=(_0x162963===_0xcde9('0x6a')?moment(_0x4cd355['starttime'])[_0xcde9('0x29')](_0xcde9('0x6b')):moment(_0x4cd355[_0xcde9('0x6c')])[_0xcde9('0x29')](_0xcde9('0x6b')))||moment()['format'](_0xcde9('0x6b'));_0x109d82[_0xcde9('0x6d')]=_0x162963||'Inbound';_0x109d82=_['merge'](_0x109d82,getCustomFields(_0x1cb028[_0xcde9('0x6e')],_0x4cd355));return request({'method':_0xcde9('0x22'),'uri':_0xcde9('0x38')+_0x485ad1+'/crm/v2/Calls','headers':{'Authorization':_0xcde9('0x2b')+_0x3c6348},'body':{'data':[_0x109d82]},'json':!![]})[_0xcde9('0x3b')](function(_0x42afe3){if(_0x42afe3&&_0x42afe3[_0xcde9('0x37')][0x0][_0xcde9('0x3c')]===_0xcde9('0x6f')){logger[_0xcde9('0x26')]('Call\x20created!');return{'id':_0x42afe3[_0xcde9('0x37')][0x0][_0xcde9('0x3d')]['id']};}})['catch'](function(_0x4fd30c){logger[_0xcde9('0x26')](_0xcde9('0x70'),_0x4fd30c[_0xcde9('0x25')]);console[_0xcde9('0x41')](_0xcde9('0x70'),_0x4fd30c);});}exports[_0xcde9('0x71')]=function(_0x3bcc9a,_0x1237f5,_0x1aad17,_0x38b11c,_0x36bbf1,_0x177416){var _0x2f891a,_0x7fa101,_0x4ccdf9;_0x177416[_0xcde9('0x72')]=intUtil[_0xcde9('0x73')](_0x177416[_0xcde9('0x72')]);_0x177416[_0xcde9('0x74')]=intUtil[_0xcde9('0x73')](_0x177416['serverUrl']);if(_0x36bbf1&&_0x36bbf1[_0xcde9('0x75')]){logger[_0xcde9('0x26')](_0xcde9('0x76'),_0xcde9('0x77'));_0x1237f5['recordingURL']=_0x177416['serverUrl']+_0xcde9('0x78')+_0x1237f5['uniqueid']+_0xcde9('0x79')+md5(_0x1237f5['uniqueid']);}else{_0x1237f5[_0xcde9('0x7a')]='';}var _0x5c383b=_0x177416[_0xcde9('0x72')]===_0xcde9('0x7b')?'eu':_0xcde9('0x7c');return getAccessToken(_0x177416)[_0xcde9('0x3b')](function(_0x19cfc1){_0x4ccdf9=_0x19cfc1;return getUser(_0x4ccdf9,_0x5c383b,_0x177416,_0x38b11c[_0xcde9('0x2e')]);})['then'](function(_0xae351d){_0x2f891a=_0xae351d;logger[_0xcde9('0x26')]('The\x20User\x20ID\x20is:',_0x2f891a['id']);return getEndUser(_0x4ccdf9,_0x5c383b,_0x177416,_0x1237f5['calleridname'],_0x1237f5[_0xcde9('0x7d')],_0x2f891a,_0x1aad17);})[_0xcde9('0x3b')](function(_0x53fb36){_0x7fa101=_0x53fb36;return getCall(_0x4ccdf9,_0x5c383b,_0x177416,_0x2f891a,_0x7fa101,_0x1aad17,_0x1237f5,_0xcde9('0x7e'));})[_0xcde9('0x3b')](function(_0x4154f9){if(_0x4154f9){logger[_0xcde9('0x26')](_0xcde9('0x7f'),_0x4154f9['id']);logger[_0xcde9('0x26')](_0xcde9('0x76'),_0xcde9('0x80'));emit(util[_0xcde9('0x29')](_0xcde9('0x81'),_0x38b11c[_0xcde9('0x17')]),_0xcde9('0x82'),{'uri':'https://crm.'+_0x177416[_0xcde9('0x72')]+'/crm/EntityInfo.do?module=Calls&id='+_0x4154f9['id']});}})[_0xcde9('0x24')](function(_0x36c473){logger[_0xcde9('0x34')](_0xcde9('0x76'),JSON['stringify'](_0x36c473));});};exports[_0xcde9('0x6a')]=function(_0x14f41a,_0x41a540,_0xfcdb37,_0x3917b3,_0x3a2486,_0x9833be,_0x6d785f){var _0x30e012,_0x59773b,_0x4e66c2;_0x9833be['host']=intUtil[_0xcde9('0x73')](_0x9833be['host']);_0x9833be[_0xcde9('0x74')]=intUtil['stripTrailingSlash'](_0x9833be[_0xcde9('0x74')]);if(_0x6d785f&&_0x6d785f[_0xcde9('0x83')]&&_0x6d785f[_0xcde9('0x83')]!==_0xcde9('0x84')){logger['info'](_0xcde9('0x85'),'Recording\x20is\x20enabled!');_0x41a540[_0xcde9('0x7a')]=_0x9833be['serverUrl']+_0xcde9('0x78')+_0x41a540['uniqueid']+_0xcde9('0x79')+md5(_0x41a540[_0xcde9('0x86')]);}var _0x3a6830=_0x9833be[_0xcde9('0x72')]==='zoho.eu'?'eu':_0xcde9('0x7c');return getAccessToken(_0x9833be)['then'](function(_0x4f2ef7){_0x4e66c2=_0x4f2ef7;return getUser(_0x4e66c2,_0x3a6830,_0x9833be,_0x3917b3['email']);})[_0xcde9('0x3b')](function(_0x18eeae){_0x30e012=_0x18eeae;logger[_0xcde9('0x26')](_0xcde9('0x87'),_0x30e012['id']);return getEndUser(_0x4e66c2,_0x3a6830,_0x9833be,_0x41a540['destcalleridname'],_0x41a540['destcalleridnum'],_0x30e012,_0xfcdb37);})['then'](function(_0x1ebecd){_0x59773b=_0x1ebecd;return getCall(_0x4e66c2,_0x3a6830,_0x9833be,_0x30e012,_0x59773b,_0xfcdb37,_0x41a540,'Outbound');})['then'](function(_0x206a03){if(_0x206a03){logger[_0xcde9('0x26')](_0xcde9('0x7f'),_0x206a03['id']);logger[_0xcde9('0x26')](_0xcde9('0x85'),_0xcde9('0x80'));emit(util[_0xcde9('0x29')](_0xcde9('0x81'),_0x3917b3[_0xcde9('0x17')]),_0xcde9('0x82'),{'uri':_0xcde9('0x88')+_0x9833be[_0xcde9('0x72')]+'/crm/EntityInfo.do?module=Calls&id='+_0x206a03['id']});}})[_0xcde9('0x24')](function(_0x506b08){logger[_0xcde9('0x34')](_0xcde9('0x85'),JSON['stringify'](_0x506b08));});};exports['unmanaged']=function(_0x3c0750,_0x2f7cff,_0x757820,_0x35fffc,_0x18b9a3,_0x8241e){var _0x294d4e,_0x4b69ac,_0x567dc6;_0x8241e[_0xcde9('0x72')]=intUtil['stripTrailingSlash'](_0x8241e[_0xcde9('0x72')]);_0x8241e['serverUrl']=intUtil[_0xcde9('0x73')](_0x8241e['serverUrl']);if(_0x18b9a3&&_0x18b9a3[_0xcde9('0x75')]){logger[_0xcde9('0x26')]('['+_0x2f7cff[_0xcde9('0x89')]['toUpperCase']()+']',_0xcde9('0x77'));_0x2f7cff[_0xcde9('0x7a')]=_0x8241e[_0xcde9('0x74')]+_0xcde9('0x78')+_0x2f7cff[_0xcde9('0x86')]+_0xcde9('0x79')+md5(_0x2f7cff['uniqueid']);}else{_0x2f7cff[_0xcde9('0x7a')]='';}var _0x4a35e8=_0x8241e[_0xcde9('0x72')]===_0xcde9('0x7b')?'eu':_0xcde9('0x7c');return getAccessToken(_0x8241e)[_0xcde9('0x3b')](function(_0x5cc52f){_0x567dc6=_0x5cc52f;return getUser(_0x567dc6,_0x4a35e8,_0x8241e);})[_0xcde9('0x3b')](function(_0x57f413){_0x294d4e=_0x57f413;logger[_0xcde9('0x26')](_0xcde9('0x87'),_0x294d4e['id']);return getEndUser(_0x567dc6,_0x4a35e8,_0x8241e,_0x2f7cff[_0xcde9('0x8a')],_0x2f7cff['calleridnum'],_0x294d4e,_0x757820);})[_0xcde9('0x3b')](function(_0x589819){_0x4b69ac=_0x589819;return getCall(_0x567dc6,_0x4a35e8,_0x8241e,_0x294d4e,_0x4b69ac,_0x757820,_0x2f7cff,'Inbound');})[_0xcde9('0x3b')](function(_0x1c72f6){if(_0x1c72f6){logger['info'](_0xcde9('0x7f'),_0x1c72f6['id']);}})[_0xcde9('0x24')](function(_0x5be953){logger[_0xcde9('0x34')]('['+_0x2f7cff[_0xcde9('0x89')][_0xcde9('0x8b')]()+']',JSON[_0xcde9('0xc')](_0x5be953));});}; \ No newline at end of file +var _0xf784=['uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','emit','[HTTP]','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','details','The\x20failing\x20result\x20is','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','format','lastevent','called','Call_Result','Called','rejected','Rejected','abandoned','Abandoned','timeout','outbound','starttime','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xf784,0xb4));var _0x4f78=function(_0x4efb6c,_0x2eb1b2){_0x4efb6c=_0x4efb6c-0x0;var _0x5c67de=_0xf784[_0x4efb6c];return _0x5c67de;};'use strict';var _=require(_0x4f78('0x0'));var rp=require(_0x4f78('0x1'));var md5=require(_0x4f78('0x2'));var util=require(_0x4f78('0x3'));var intUtil=require(_0x4f78('0x4'));var moment=require(_0x4f78('0x5'));var Redis=require('ioredis');var BPromise=require(_0x4f78('0x6'));var config=require(_0x4f78('0x7'));var logger=require(_0x4f78('0x8'))(_0x4f78('0x9'));config[_0x4f78('0xa')]=_['defaults'](config[_0x4f78('0xa')],{'host':_0x4f78('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4f78('0xa')]));function emit(_0x18650a,_0x4a80f1,_0x5708d5){io['to'](_0x18650a)[_0x4f78('0xc')](_0x4a80f1,_0x5708d5);}function request(_0x16c7e9){logger['debug'](_0x4f78('0xd'),JSON['stringify'](_0x16c7e9));return rp(_0x16c7e9);}function getCustomFields(_0x58e55e,_0x231977){var _0x2e2f8c={};if(_0x58e55e[_0x4f78('0xe')]>0x0){_[_0x4f78('0xf')](_0x58e55e,function(_0x1886c1){if(_[_0x4f78('0x10')](['string',_0x4f78('0x11')],_0x1886c1['type'])&&_0x1886c1[_0x4f78('0x12')]){_0x2e2f8c[_0x1886c1[_0x4f78('0x12')]]=_0x1886c1[_0x4f78('0x13')][_0x4f78('0x14')]();}else if(_0x1886c1[_0x4f78('0x15')]===_0x4f78('0x16')&&_0x1886c1[_0x4f78('0x17')]&&_0x1886c1[_0x4f78('0x12')]&&_0x231977[_0x1886c1[_0x4f78('0x17')]]){_0x2e2f8c[_0x1886c1['idField']]=_0x231977[_0x1886c1[_0x4f78('0x17')]]['toString']();}else if(_0x1886c1[_0x4f78('0x15')]===_0x4f78('0x18')&&_0x1886c1[_0x4f78('0x19')]&&_0x1886c1['Variable']['name']&&_0x1886c1[_0x4f78('0x12')]&&_0x231977[_0x1886c1[_0x4f78('0x19')]['name'][_0x4f78('0x1a')]()]){_0x2e2f8c[_0x1886c1[_0x4f78('0x12')]]=_0x231977[_0x1886c1['Variable'][_0x4f78('0x1b')]['toLowerCase']()][_0x4f78('0x14')]();}});}return _0x2e2f8c;}function getName(_0x4ed317){if(_0x4ed317[_0x4f78('0x1c')]('\x20')>0x0){var _0x34bb24=_0x4ed317[_0x4f78('0x1d')](/ (.+)/);if(_0x34bb24[0x1]){return _0x34bb24;}}return[_0x4ed317,_0x4ed317];}var accountsTokens={};function getAccessToken(_0x2e0f9b){return new Promise(function(_0x5270fe,_0x2c80a6){if(!_[_0x4f78('0x1e')](accountsTokens[_0x2e0f9b['id']])&&!_[_0x4f78('0x1e')](accountsTokens[_0x2e0f9b['id']]['access_token'])){if(moment()[_0x4f78('0x1f')](accountsTokens[_0x2e0f9b['id']][_0x4f78('0x20')])){_0x5270fe(accountsTokens[_0x2e0f9b['id']][_0x4f78('0x21')]);}}var _0x58db53;switch(_0x2e0f9b[_0x4f78('0x22')]){case'US':_0x58db53=_0x4f78('0x23');break;case'AU':_0x58db53=_0x4f78('0x24');break;case'EU':_0x58db53='https://accounts.zoho.eu';break;case'IN':_0x58db53=_0x4f78('0x25');break;case'CN':_0x58db53=_0x4f78('0x26');break;default:_0x58db53=_0x4f78('0x27');break;}var _0x29b52a={'method':_0x4f78('0x28'),'uri':_0x58db53+_0x4f78('0x29'),'qs':{'refresh_token':_0x2e0f9b['refreshToken'],'client_id':_0x2e0f9b[_0x4f78('0x2a')],'client_secret':_0x2e0f9b[_0x4f78('0x2b')],'grant_type':_0x4f78('0x2c')},'json':!![]};return rp(_0x29b52a)[_0x4f78('0x2d')](function(_0x2b0676){accountsTokens[_0x2e0f9b['id']]={'access_token':_0x2b0676[_0x4f78('0x21')],'expires_in':moment()[_0x4f78('0x2e')](_0x2b0676[_0x4f78('0x20')],_0x4f78('0x2f'))};_0x5270fe(_0x2b0676[_0x4f78('0x21')]);})['catch'](function(_0x4d84c6){logger[_0x4f78('0x30')](_0x4f78('0x31'),_0x4d84c6[_0x4f78('0x32')]);_0x2c80a6(_0x4d84c6);});});}function getUser(_0x55c25e,_0x5cca6e,_0x3a5fc5,_0x419c8d){logger['info'](_0x4f78('0x33'));return request({'method':_0x4f78('0x34'),'uri':util['format'](_0x4f78('0x35'),_0x5cca6e),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x4f78('0x36')+_0x55c25e},'json':!![]})[_0x4f78('0x2d')](function(_0x63290f){if(_0x63290f[_0x4f78('0x37')]){var _0x423b24=-0x1;if(_[_0x4f78('0x38')](_0x63290f[_0x4f78('0x37')])){if(!_[_0x4f78('0x1e')](_0x419c8d)){_0x423b24=_['findIndex'](_0x63290f[_0x4f78('0x37')],function(_0x232285){return _0x232285[_0x4f78('0x39')]===_0x419c8d;});}if(_0x423b24>=0x0){logger[_0x4f78('0x3a')](_0x4f78('0x3b'));}else{logger[_0x4f78('0x3a')](_0x4f78('0x3c'));_0x423b24=_[_0x4f78('0x3d')](_0x63290f['users'],function(_0x1a737c){return _0x1a737c[_0x4f78('0x3e')][_0x4f78('0x1b')]==='Administrator';});}return _0x63290f['users'][_0x423b24];}else{if(_0x63290f['user'][_0x4f78('0x3e')][_0x4f78('0x1b')]===_0x4f78('0x3f')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x63290f[_0x4f78('0x40')];return user;}else{logger[_0x4f78('0x30')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x63290f));throw new Error(_0x4f78('0x41')+JSON[_0x4f78('0x42')](_0x63290f));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x4f78('0x42')](_0x63290f));throw new Error(_0x4f78('0x41')+JSON[_0x4f78('0x42')](_0x63290f));}})[_0x4f78('0x43')](function(_0x39c512){console['error'](_0x39c512);});}function getZohoUser(_0x5ab365,_0x4fa4dc){return new BPromise(function(_0x3ef0a0,_0x180a15){request(_0x5ab365)[_0x4f78('0x2d')](function(_0x21c5d9){var _0x452ae8=null;if(_0x21c5d9){_0x452ae8=_0x21c5d9[_0x4f78('0x44')][0x0];_0x452ae8[_0x4f78('0x45')]=_0x4fa4dc;}_0x3ef0a0(_0x452ae8);})['catch'](function(_0xf9d8d5){_0x180a15(_0xf9d8d5);});});}function createEndUser(_0x185f30,_0x4c3261,_0x479abe,_0x52cc6d,_0x2bc47a,_0x4a8f00){var _0x479abe=getName(_0x479abe);return request({'method':'POST','uri':_0x4f78('0x46')+_0x4c3261+_0x4f78('0x47')+_[_0x4f78('0x48')](_0x4a8f00[_0x4f78('0x49')])+'s','body':{'data':[{'Last_Name':_0x479abe[0x1],'First_Name':_0x479abe[0x0],'Phone':_0x52cc6d,'Owner':{'name':!_[_0x4f78('0x1e')](_0x2bc47a[_0x4f78('0x4a')][_0x4f78('0x1b')])?_0x2bc47a[_0x4f78('0x4a')][_0x4f78('0x1b')]:!_[_0x4f78('0x1e')](_0x2bc47a['first_name'])?_0x2bc47a['first_name']+'\x20'+_0x2bc47a[_0x4f78('0x4b')]:_0x2bc47a['last_name'],'id':_0x2bc47a['id']}}]},'headers':{'Authorization':_0x4f78('0x36')+_0x185f30},'json':!![]})[_0x4f78('0x2d')](function(_0x12b770){if(_0x12b770&&_0x12b770['data'][0x0][_0x4f78('0x4c')]==='SUCCESS'){var _0x3935d5=_0x12b770[_0x4f78('0x44')][0x0][_0x4f78('0x4d')];_0x3935d5[_0x4f78('0x45')]=_[_0x4f78('0x48')](_0x4a8f00[_0x4f78('0x49')])+'s';return _0x3935d5;}logger[_0x4f78('0x30')](_0x4f78('0x4e'),JSON[_0x4f78('0x42')](data));throw new Error(_0x4f78('0x4f')+JSON[_0x4f78('0x42')](data));})[_0x4f78('0x43')](function(_0x1bc276){console['log'](_0x4f78('0x50'),_0x1bc276);});}function getEndUser(_0x159aed,_0x4fb63a,_0x200ff6,_0x5b34aa,_0x49ecf1,_0x2437f6,_0x332f18){var _0x1b876d={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x159aed},'json':!![]};switch(_0x332f18[_0x4f78('0x51')]){case'contact_lead':_0x1b876d[_0x4f78('0x52')]=_0x4f78('0x46')+_0x4fb63a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x49ecf1+'))';return getZohoUser(_0x1b876d,_0x4f78('0x53'))[_0x4f78('0x2d')](function(_0x4528f4){if(_0x4528f4)return _0x4528f4;_0x1b876d[_0x4f78('0x52')]=_0x4f78('0x46')+_0x4fb63a+_0x4f78('0x54')+_0x49ecf1+'))';return getZohoUser(_0x1b876d,_0x4f78('0x55'))[_0x4f78('0x2d')](function(_0x275534){if(_0x275534)return _0x275534;if(_0x332f18[_0x4f78('0x49')]!=_0x4f78('0x56')){return createEndUser(_0x159aed,_0x4fb63a,_0x5b34aa,_0x49ecf1,_0x2437f6,_0x332f18);}else{return{};}});});break;case _0x4f78('0x57'):_0x1b876d['uri']=_0x4f78('0x46')+_0x4fb63a+_0x4f78('0x58')+_0x49ecf1+'))';return getZohoUser(_0x1b876d,_0x4f78('0x53'))[_0x4f78('0x2d')](function(_0x1cff34){if(_0x1cff34)return _0x1cff34;if(_0x332f18[_0x4f78('0x49')]!=_0x4f78('0x56')){return createEndUser(_0x159aed,_0x4fb63a,_0x5b34aa,_0x49ecf1,_0x2437f6,_0x332f18);}else{return{};}});break;case _0x4f78('0x59'):_0x1b876d[_0x4f78('0x52')]='https://www.zohoapis.'+_0x4fb63a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x49ecf1+'))';return getZohoUser(_0x1b876d,'Leads')[_0x4f78('0x2d')](function(_0x420dc3){if(_0x420dc3)return _0x420dc3;if(_0x332f18[_0x4f78('0x49')]!=_0x4f78('0x56')){return createEndUser(_0x159aed,_0x4fb63a,_0x5b34aa,_0x49ecf1,_0x2437f6,_0x332f18);}else{return{};}});break;}}function getCall(_0x1d55f4,_0x466ecd,_0x517ed9,_0x464de4,_0x4423fc,_0x4f861e,_0x5a3366,_0x5a8236){logger['info'](_0x4f78('0x5a'));var _0x37dccc={};_0x37dccc[_0x4f78('0x5b')]={'name':!_[_0x4f78('0x1e')](_0x464de4[_0x4f78('0x4a')][_0x4f78('0x1b')])&&!_[_0x4f78('0x1e')](_0x464de4[_0x4f78('0x3e')][_0x4f78('0x1b')])&&_0x464de4[_0x4f78('0x3e')][_0x4f78('0x1b')]===_0x4f78('0x5c')?_0x464de4[_0x4f78('0x4a')][_0x4f78('0x1b')]:!_[_0x4f78('0x1e')](_0x464de4['first_name'])?_0x464de4[_0x4f78('0x5d')]+'\x20'+_0x464de4[_0x4f78('0x4b')]:_0x464de4[_0x4f78('0x4b')],'id':_0x464de4['id']};_0x37dccc[_0x4f78('0x5e')]=intUtil[_0x4f78('0x5f')](_0x4f861e['Subjects'],_0x5a3366,'\x20');_0x37dccc[_0x4f78('0x60')]=intUtil[_0x4f78('0x5f')](_0x4f861e[_0x4f78('0x61')],_0x5a3366,'\x0a');if(_0x4423fc[_0x4f78('0x45')]===_0x4f78('0x53')){_0x37dccc['Who_Id']={'name':!_['isNil'](_0x4423fc[_0x4f78('0x62')])?_0x4423fc['Full_Name']:!_['isNil'](_0x4423fc['First_Name'])?_0x4423fc[_0x4f78('0x63')]+'\x20'+_0x4423fc['Last_Name']:_0x4423fc[_0x4f78('0x64')],'id':_0x4423fc['id']};}if(_0x4423fc[_0x4f78('0x45')]===_0x4f78('0x55')){_0x37dccc['What_Id']={'name':!_[_0x4f78('0x1e')](_0x4423fc['Full_Name'])?_0x4423fc[_0x4f78('0x62')]:!_[_0x4f78('0x1e')](_0x4423fc[_0x4f78('0x63')])?_0x4423fc[_0x4f78('0x63')]+'\x20'+_0x4423fc[_0x4f78('0x64')]:_0x4423fc[_0x4f78('0x64')],'id':_0x4423fc['id']};_0x37dccc['$se_module']=_[_0x4f78('0x48')](_0x4423fc[_0x4f78('0x45')]);}if(_0x5a3366[_0x4f78('0x65')]){_0x37dccc[_0x4f78('0x66')]=moment[_0x4f78('0x67')](parseInt(_0x5a3366[_0x4f78('0x65')])*0x3e8)['format'](_0x4f78('0x68'));}else if(_0x5a3366['answertime']&&_0x5a3366[_0x4f78('0x69')]){_0x37dccc[_0x4f78('0x66')]=moment[_0x4f78('0x67')](moment(_0x5a3366[_0x4f78('0x69')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x5a3366['starttime'],_0x4f78('0x6a'))))[_0x4f78('0x6b')]('mm:ss');}switch(_0x5a3366[_0x4f78('0x6c')]){case _0x4f78('0x6d'):_0x37dccc[_0x4f78('0x6e')]=_0x4f78('0x6f');break;case'complete':case'connect':_0x37dccc[_0x4f78('0x6e')]='Answered';break;case _0x4f78('0x70'):_0x37dccc[_0x4f78('0x6e')]=_0x4f78('0x71');break;case _0x4f78('0x72'):_0x37dccc[_0x4f78('0x6e')]=_0x4f78('0x73');break;case _0x4f78('0x74'):_0x37dccc[_0x4f78('0x6e')]='Timeout';default:}_0x37dccc['Call_Start_Time']=(_0x5a8236===_0x4f78('0x75')?moment(_0x5a3366[_0x4f78('0x76')])['format'](_0x4f78('0x6a')):moment(_0x5a3366[_0x4f78('0x77')])[_0x4f78('0x6b')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x4f78('0x6a'));_0x37dccc[_0x4f78('0x78')]=_0x5a8236||'Inbound';_0x37dccc=_[_0x4f78('0x79')](_0x37dccc,getCustomFields(_0x4f861e[_0x4f78('0x7a')],_0x5a3366));return request({'method':'POST','uri':_0x4f78('0x46')+_0x466ecd+_0x4f78('0x7b'),'headers':{'Authorization':_0x4f78('0x36')+_0x1d55f4},'body':{'data':[_0x37dccc]},'json':!![]})[_0x4f78('0x2d')](function(_0x4b50d3){if(_0x4b50d3&&_0x4b50d3[_0x4f78('0x44')][0x0][_0x4f78('0x4c')]==='SUCCESS'){logger[_0x4f78('0x3a')](_0x4f78('0x7c'));return{'id':_0x4b50d3[_0x4f78('0x44')][0x0][_0x4f78('0x4d')]['id']};}})['catch'](function(_0x141cdd){logger[_0x4f78('0x3a')](_0x4f78('0x7d'),_0x141cdd['stack']);console[_0x4f78('0x7e')](_0x4f78('0x7d'),_0x141cdd);});}exports['queue']=function(_0xb3a433,_0x368a61,_0x280710,_0xc69b5,_0x44df9a,_0x58a95c){var _0x550e61,_0x412076,_0x238969;_0x58a95c[_0x4f78('0x7f')]=intUtil[_0x4f78('0x80')](_0x58a95c['host']);_0x58a95c[_0x4f78('0x81')]=intUtil[_0x4f78('0x80')](_0x58a95c[_0x4f78('0x81')]);if(_0x44df9a&&_0x44df9a[_0x4f78('0x82')]){logger['info'](_0x4f78('0x83'),_0x4f78('0x84'));_0x368a61[_0x4f78('0x85')]=_0x58a95c[_0x4f78('0x81')]+'/api/voice/recordings/'+_0x368a61[_0x4f78('0x86')]+_0x4f78('0x87')+md5(_0x368a61[_0x4f78('0x86')]);}else{_0x368a61[_0x4f78('0x85')]='';}var _0x29047c=_0x58a95c[_0x4f78('0x7f')]==='zoho.eu'?'eu':_0x4f78('0x88');return getAccessToken(_0x58a95c)[_0x4f78('0x2d')](function(_0x49d396){_0x238969=_0x49d396;return getUser(_0x238969,_0x29047c,_0x58a95c,_0xc69b5['email']);})[_0x4f78('0x2d')](function(_0x675272){_0x550e61=_0x675272;logger[_0x4f78('0x3a')](_0x4f78('0x89'),_0x550e61['id']);return getEndUser(_0x238969,_0x29047c,_0x58a95c,_0x368a61[_0x4f78('0x8a')],_0x368a61[_0x4f78('0x8b')],_0x550e61,_0x280710);})[_0x4f78('0x2d')](function(_0x18509b){_0x412076=_0x18509b;return getCall(_0x238969,_0x29047c,_0x58a95c,_0x550e61,_0x412076,_0x280710,_0x368a61,_0x4f78('0x8c'));})['then'](function(_0x695712){if(_0x695712){logger[_0x4f78('0x3a')](_0x4f78('0x8d'),_0x695712['id']);logger[_0x4f78('0x3a')](_0x4f78('0x83'),_0x4f78('0x8e'));emit(util[_0x4f78('0x6b')](_0x4f78('0x8f'),_0xc69b5[_0x4f78('0x1b')]),'trigger:browser:url',{'uri':_0x4f78('0x90')+_0x58a95c[_0x4f78('0x7f')]+_0x4f78('0x91')+_0x695712['id']});}})[_0x4f78('0x43')](function(_0x88017a){logger[_0x4f78('0x30')](_0x4f78('0x83'),JSON[_0x4f78('0x42')](_0x88017a));});};exports[_0x4f78('0x75')]=function(_0xdadfa9,_0x228171,_0x42d8b8,_0x32728b,_0x52f5a2,_0x3c0218,_0x552c4d){var _0x185284,_0x4f47d2,_0xfed317;_0x3c0218[_0x4f78('0x7f')]=intUtil[_0x4f78('0x80')](_0x3c0218['host']);_0x3c0218[_0x4f78('0x81')]=intUtil[_0x4f78('0x80')](_0x3c0218[_0x4f78('0x81')]);if(_0x552c4d&&_0x552c4d[_0x4f78('0x92')]&&_0x552c4d[_0x4f78('0x92')]!==_0x4f78('0x93')){logger[_0x4f78('0x3a')](_0x4f78('0x94'),_0x4f78('0x84'));_0x228171['recordingURL']=_0x3c0218[_0x4f78('0x81')]+_0x4f78('0x95')+_0x228171['uniqueid']+_0x4f78('0x87')+md5(_0x228171[_0x4f78('0x86')]);}var _0x1e5b44=_0x3c0218[_0x4f78('0x7f')]===_0x4f78('0x96')?'eu':_0x4f78('0x88');return getAccessToken(_0x3c0218)[_0x4f78('0x2d')](function(_0x4cfd7e){_0xfed317=_0x4cfd7e;return getUser(_0xfed317,_0x1e5b44,_0x3c0218,_0x32728b[_0x4f78('0x39')]);})[_0x4f78('0x2d')](function(_0x5b66e4){_0x185284=_0x5b66e4;logger[_0x4f78('0x3a')]('The\x20User\x20ID\x20is:',_0x185284['id']);return getEndUser(_0xfed317,_0x1e5b44,_0x3c0218,_0x228171[_0x4f78('0x97')],_0x228171[_0x4f78('0x98')],_0x185284,_0x42d8b8);})[_0x4f78('0x2d')](function(_0x17328c){_0x4f47d2=_0x17328c;return getCall(_0xfed317,_0x1e5b44,_0x3c0218,_0x185284,_0x4f47d2,_0x42d8b8,_0x228171,_0x4f78('0x99'));})[_0x4f78('0x2d')](function(_0x3c03be){if(_0x3c03be){logger[_0x4f78('0x3a')](_0x4f78('0x8d'),_0x3c03be['id']);logger[_0x4f78('0x3a')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4f78('0x6b')]('user:%s',_0x32728b[_0x4f78('0x1b')]),_0x4f78('0x9a'),{'uri':_0x4f78('0x90')+_0x3c0218['host']+_0x4f78('0x91')+_0x3c03be['id']});}})[_0x4f78('0x43')](function(_0x14b866){logger[_0x4f78('0x30')](_0x4f78('0x94'),JSON[_0x4f78('0x42')](_0x14b866));});};exports[_0x4f78('0x9b')]=function(_0x42b557,_0x2345ea,_0x31a7fa,_0xaf34b3,_0x524ec8,_0x403617){var _0x4f78f2,_0x31196d,_0x534ff3;_0x403617[_0x4f78('0x7f')]=intUtil[_0x4f78('0x80')](_0x403617[_0x4f78('0x7f')]);_0x403617['serverUrl']=intUtil[_0x4f78('0x80')](_0x403617['serverUrl']);if(_0x524ec8&&_0x524ec8[_0x4f78('0x82')]){logger[_0x4f78('0x3a')]('['+_0x2345ea[_0x4f78('0x6c')][_0x4f78('0x9c')]()+']',_0x4f78('0x84'));_0x2345ea[_0x4f78('0x85')]=_0x403617[_0x4f78('0x81')]+_0x4f78('0x95')+_0x2345ea['uniqueid']+_0x4f78('0x87')+md5(_0x2345ea[_0x4f78('0x86')]);}else{_0x2345ea[_0x4f78('0x85')]='';}var _0x43c4b6=_0x403617[_0x4f78('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x403617)[_0x4f78('0x2d')](function(_0x5e91bd){_0x534ff3=_0x5e91bd;return getUser(_0x534ff3,_0x43c4b6,_0x403617);})[_0x4f78('0x2d')](function(_0x39454f){_0x4f78f2=_0x39454f;logger[_0x4f78('0x3a')](_0x4f78('0x89'),_0x4f78f2['id']);return getEndUser(_0x534ff3,_0x43c4b6,_0x403617,_0x2345ea[_0x4f78('0x8a')],_0x2345ea[_0x4f78('0x8b')],_0x4f78f2,_0x31a7fa);})['then'](function(_0x51e7d9){_0x31196d=_0x51e7d9;return getCall(_0x534ff3,_0x43c4b6,_0x403617,_0x4f78f2,_0x31196d,_0x31a7fa,_0x2345ea,'Inbound');})[_0x4f78('0x2d')](function(_0x8e5930){if(_0x8e5930){logger[_0x4f78('0x3a')]('The\x20Call\x20ID\x20is:',_0x8e5930['id']);}})['catch'](function(_0xba9d23){logger[_0x4f78('0x30')]('['+_0x2345ea[_0x4f78('0x6c')][_0x4f78('0x9c')]()+']',JSON[_0x4f78('0x42')](_0xba9d23));});}; \ 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 a6a4762..5d5c955 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 _0xa850=['shelljs','../../../../config/logger','trigger','data2','Script','render','data3','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x376ae3,_0x4b18d9){var _0x4a536a=function(_0x45a33b){while(--_0x45a33b){_0x376ae3['push'](_0x376ae3['shift']());}};_0x4a536a(++_0x4b18d9);}(_0xa850,0x185));var _0x0a85=function(_0x182677,_0x6998db){_0x182677=_0x182677-0x0;var _0x40e998=_0xa850[_0x182677];return _0x40e998;};'use strict';var util=require(_0x0a85('0x0'));var sh=require(_0x0a85('0x1'));var Mustache=require('mustache');var logger=require(_0x0a85('0x2'))(_0x0a85('0x3'));exports['exec']=function(_0x3a4275,_0x5040f4){var _0x2e4c60=_0x3a4275[_0x0a85('0x4')]?_0x3a4275[_0x0a85('0x4')]:_0x0a85('0x5');var _0xddffa=_0x3a4275['data3']?Mustache[_0x0a85('0x6')](_0x3a4275[_0x0a85('0x7')],_0x5040f4):_0x5040f4;sh[_0x0a85('0x8')](_0xddffa,function(_0x200cb9,_0x1d94aa,_0x3bf6d9){if(_0x200cb9!==0x0){logger[_0x0a85('0x9')](util['format'](_0x0a85('0xa'),_0x2e4c60,_0xddffa,_0x200cb9,_0x3bf6d9));}else{logger[_0x0a85('0xb')](util['format'](_0x0a85('0xc'),_0x2e4c60,_0xddffa,_0x1d94aa));}});}; \ No newline at end of file +var _0xcb28=['util','mustache','../../../../config/logger','trigger','data2','data3','exec','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x2c6660,_0x389dff){var _0x5e20f0=function(_0x5c0f22){while(--_0x5c0f22){_0x2c6660['push'](_0x2c6660['shift']());}};_0x5e20f0(++_0x389dff);}(_0xcb28,0x90));var _0x8cb2=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xcb28[_0x3fe6df];return _0x372a0e;};'use strict';var util=require(_0x8cb2('0x0'));var sh=require('shelljs');var Mustache=require(_0x8cb2('0x1'));var logger=require(_0x8cb2('0x2'))(_0x8cb2('0x3'));exports['exec']=function(_0x1fc35c,_0x1bd2a6){var _0x5da91c=_0x1fc35c['data2']?_0x1fc35c[_0x8cb2('0x4')]:'Script';var _0x1124a3=_0x1fc35c[_0x8cb2('0x5')]?Mustache['render'](_0x1fc35c[_0x8cb2('0x5')],_0x1bd2a6):_0x1bd2a6;sh[_0x8cb2('0x6')](_0x1124a3,function(_0x2ce586,_0x36d515,_0x5c1578){if(_0x2ce586!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5da91c,_0x1124a3,_0x2ce586,_0x5c1578));}else{logger['info'](util[_0x8cb2('0x7')](_0x8cb2('0x8'),_0x5da91c,_0x1124a3,_0x36d515));}});}; \ 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 7b4615c..4c6e30b 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 _0x8884=['message','request-promise','util','mustache','../../../../config/logger','trigger','toUpperCase','render','data5','number','data6','parse','error','stack','data1','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify',',\x20request\x20body:\x20','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0x8884,0x194));var _0x4888=function(_0x5276b0,_0x2b179a){_0x5276b0=_0x5276b0-0x0;var _0x5f4875=_0x8884[_0x5276b0];return _0x5f4875;};'use strict';var rp=require(_0x4888('0x0'));var util=require(_0x4888('0x1'));var _=require('lodash');var Mustache=require(_0x4888('0x2'));var logger=require(_0x4888('0x3'))(_0x4888('0x4'));exports['exec']=function(_0x1133f3,_0x28fb5e){var _0x3d9639,_0x108b9f;var _0x1eaf85={'method':_0x1133f3['data1'][_0x4888('0x5')](),'uri':Mustache[_0x4888('0x6')](_0x1133f3['data2'],_0x28fb5e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1133f3[_0x4888('0x7')])===_0x4888('0x8')&&parseInt(_0x1133f3[_0x4888('0x7')])>=0x1&&parseInt(_0x1133f3[_0x4888('0x7')])<=0xa?parseInt(_0x1133f3[_0x4888('0x7')])*0x3e8:0x5*0x3e8};try{_0x1eaf85['headers']=_0x1133f3[_0x4888('0x9')]?JSON[_0x4888('0xa')](Mustache[_0x4888('0x6')](_0x1133f3[_0x4888('0x9')],_0x28fb5e)):{};}catch(_0x1fb93f){logger[_0x4888('0xb')](_0x1fb93f[_0x4888('0xc')]);}switch(_0x1133f3[_0x4888('0xd')][_0x4888('0x5')]()){case'GET':case _0x4888('0xe'):_0x3d9639=null;_0x1eaf85['qs']=_0x28fb5e;break;case _0x4888('0xf'):case _0x4888('0x10'):if(_0x1133f3[_0x4888('0x11')]){try{_0x3d9639=JSON['parse'](Mustache[_0x4888('0x6')](_0x1133f3['data7'],_0x28fb5e));_0x1eaf85['body']=_0x3d9639;}catch(_0x41f599){logger[_0x4888('0xb')](_0x41f599[_0x4888('0xc')]);logger[_0x4888('0xb')](_0x4888('0x12'));}}else{_0x3d9639=_0x28fb5e;_0x1eaf85[_0x4888('0x13')]=_0x3d9639;}break;}logger[_0x4888('0x14')](util['format'](_0x4888('0x15'),_0x1133f3['data1'],_0x1133f3[_0x4888('0x16')],JSON[_0x4888('0x17')](_0x1eaf85)));rp(_0x1eaf85)['then'](function(_0xd6f5af){_0x3d9639=!_['isNil'](_0x3d9639)?_0x4888('0x18')+_0x3d9639:'';_0x108b9f=typeof _0xd6f5af[_0x4888('0x13')]==='object'?JSON[_0x4888('0x17')](_0xd6f5af[_0x4888('0x13')]):_0xd6f5af[_0x4888('0x13')];logger[_0x4888('0x14')](util[_0x4888('0x19')](_0x4888('0x1a'),_0x1133f3['data1'],_0x1133f3[_0x4888('0x16')],_0xd6f5af['statusCode'],_0x108b9f));})[_0x4888('0x1b')](function(_0x1914f9){logger['error'](util[_0x4888('0x19')](_0x4888('0x1c'),_0x1133f3[_0x4888('0xd')],_0x1133f3[_0x4888('0x16')],_0x1914f9[_0x4888('0x1d')],_0x1914f9['name'],_0x1914f9[_0x4888('0x1e')]));});}; \ No newline at end of file +var _0x41f5=['object','stringify','%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','name','message','request-promise','util','mustache','../../../../config/logger','exec','toUpperCase','render','data2','data5','parse','error','stack','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','then'];(function(_0x2a814f,_0x186c39){var _0x31f082=function(_0x17225d){while(--_0x17225d){_0x2a814f['push'](_0x2a814f['shift']());}};_0x31f082(++_0x186c39);}(_0x41f5,0xbc));var _0x541f=function(_0x4bad42,_0x2c5e2e){_0x4bad42=_0x4bad42-0x0;var _0x3487bc=_0x41f5[_0x4bad42];return _0x3487bc;};'use strict';var rp=require(_0x541f('0x0'));var util=require(_0x541f('0x1'));var _=require('lodash');var Mustache=require(_0x541f('0x2'));var logger=require(_0x541f('0x3'))('trigger');exports[_0x541f('0x4')]=function(_0x56d65a,_0x5181e3){var _0x385d83,_0x17e30a;var _0x120456={'method':_0x56d65a['data1'][_0x541f('0x5')](),'uri':Mustache[_0x541f('0x6')](_0x56d65a[_0x541f('0x7')],_0x5181e3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x56d65a[_0x541f('0x8')])==='number'&&parseInt(_0x56d65a[_0x541f('0x8')])>=0x1&&parseInt(_0x56d65a['data5'])<=0xa?parseInt(_0x56d65a[_0x541f('0x8')])*0x3e8:0x5*0x3e8};try{_0x120456['headers']=_0x56d65a['data6']?JSON[_0x541f('0x9')](Mustache[_0x541f('0x6')](_0x56d65a['data6'],_0x5181e3)):{};}catch(_0x4ab78e){logger[_0x541f('0xa')](_0x4ab78e[_0x541f('0xb')]);}switch(_0x56d65a['data1'][_0x541f('0x5')]()){case'GET':case _0x541f('0xc'):_0x385d83=null;_0x120456['qs']=_0x5181e3;break;case _0x541f('0xd'):case'PUT':if(_0x56d65a[_0x541f('0xe')]){try{_0x385d83=JSON[_0x541f('0x9')](Mustache[_0x541f('0x6')](_0x56d65a[_0x541f('0xe')],_0x5181e3));_0x120456[_0x541f('0xf')]=_0x385d83;}catch(_0x2f38c2){logger[_0x541f('0xa')](_0x2f38c2[_0x541f('0xb')]);logger[_0x541f('0xa')](_0x541f('0x10'));}}else{_0x385d83=_0x5181e3;_0x120456['body']=_0x385d83;}break;}logger[_0x541f('0x11')](util[_0x541f('0x12')](_0x541f('0x13'),_0x56d65a[_0x541f('0x14')],_0x56d65a[_0x541f('0x7')],JSON['stringify'](_0x120456)));rp(_0x120456)[_0x541f('0x15')](function(_0x254e96){_0x385d83=!_['isNil'](_0x385d83)?',\x20request\x20body:\x20'+_0x385d83:'';_0x17e30a=typeof _0x254e96['body']===_0x541f('0x16')?JSON[_0x541f('0x17')](_0x254e96[_0x541f('0xf')]):_0x254e96['body'];logger['info'](util[_0x541f('0x12')](_0x541f('0x18'),_0x56d65a[_0x541f('0x14')],_0x56d65a['data2'],_0x254e96[_0x541f('0x19')],_0x17e30a));})[_0x541f('0x1a')](function(_0x501b11){logger[_0x541f('0xa')](util[_0x541f('0x12')](_0x541f('0x1b'),_0x56d65a[_0x541f('0x14')],_0x56d65a['data2'],_0x501b11[_0x541f('0x19')],_0x501b11[_0x541f('0x1c')],_0x501b11[_0x541f('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 945165a..03a05bd 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 _0xf88e=['request','debug','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf88e,0x19a));var _0xef88=function(_0x6bec06,_0x30b172){_0x6bec06=_0x6bec06-0x0;var _0x30e317=_0xf88e[_0x6bec06];return _0x30e317;};'use strict';var jayson=require(_0xef88('0x0'));var BPromise=require(_0xef88('0x1'));var logger=require(_0xef88('0x2'))(_0xef88('0x3'));var client=jayson[_0xef88('0x4')][_0xef88('0x5')]({'port':0x2329});client['Request']=function(_0x577360,_0x120fc9){return new BPromise(function(_0x5a9de4,_0x113fea){return client[_0xef88('0x6')](_0x577360,_0x120fc9)['then'](function(_0xf01a8a){logger[_0xef88('0x7')]('rpc',_0xef88('0x3'),_0x577360,_0x120fc9,_0xf01a8a);if(_0xf01a8a[_0xef88('0x8')]){logger[_0xef88('0x8')]('rpc',_0xef88('0x3'),_0x577360,_0xf01a8a[_0xef88('0x8')][_0xef88('0x9')],_0x120fc9);return _0x113fea(_0xf01a8a[_0xef88('0x8')][_0xef88('0x9')]);}else{return _0x5a9de4(_0xf01a8a[_0xef88('0xa')]);}})[_0xef88('0xb')](function(_0x33eed4){logger[_0xef88('0x8')]('rpc',_0xef88('0x3'),_0x577360,_0x33eed4,_0x120fc9);return _0x113fea(_0x33eed4);});});};module[_0xef88('0xc')]=client; \ No newline at end of file +var _0x7ad0=['error','message','result','catch','exports','bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc'];(function(_0x2f3b86,_0x1fffad){var _0x9741a0=function(_0x654b64){while(--_0x654b64){_0x2f3b86['push'](_0x2f3b86['shift']());}};_0x9741a0(++_0x1fffad);}(_0x7ad0,0xad));var _0x07ad=function(_0x52ab0a,_0xf641d5){_0x52ab0a=_0x52ab0a-0x0;var _0x1d2cab=_0x7ad0[_0x52ab0a];return _0x1d2cab;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x07ad('0x0'));var logger=require(_0x07ad('0x1'))(_0x07ad('0x2'));var client=jayson[_0x07ad('0x3')][_0x07ad('0x4')]({'port':0x2329});client[_0x07ad('0x5')]=function(_0x21ec40,_0x4689db){return new BPromise(function(_0x22613e,_0xd5cf03){return client[_0x07ad('0x6')](_0x21ec40,_0x4689db)['then'](function(_0x8a9557){logger[_0x07ad('0x7')](_0x07ad('0x8'),_0x07ad('0x2'),_0x21ec40,_0x4689db,_0x8a9557);if(_0x8a9557[_0x07ad('0x9')]){logger[_0x07ad('0x9')](_0x07ad('0x8'),_0x07ad('0x2'),_0x21ec40,_0x8a9557[_0x07ad('0x9')][_0x07ad('0xa')],_0x4689db);return _0xd5cf03(_0x8a9557[_0x07ad('0x9')]['message']);}else{return _0x22613e(_0x8a9557[_0x07ad('0xb')]);}})[_0x07ad('0xc')](function(_0x3b7459){logger[_0x07ad('0x9')](_0x07ad('0x8'),_0x07ad('0x2'),_0x21ec40,_0x3b7459,_0x4689db);return _0xd5cf03(_0x3b7459);});});};module[_0x07ad('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 51dfcfe..b7afc30 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 _0x290d=['mailAccounts','getSettings','loginMailFrequency','catch','error','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh'];(function(_0x3c8d8c,_0x3ae344){var _0x2f5589=function(_0x20587e){while(--_0x20587e){_0x3c8d8c['push'](_0x3c8d8c['shift']());}};_0x2f5589(++_0x3ae344);}(_0x290d,0x135));var _0xd290=function(_0x539e54,_0x5c044c){_0x539e54=_0x539e54-0x0;var _0x94e144=_0x290d[_0x539e54];return _0x94e144;};'use strict';var server=require('./server');var Realtime=require(_0xd290('0x0'));var EmailChannel=require(_0xd290('0x1'));var mailAccount=require(_0xd290('0x2'));var setting=require(_0xd290('0x3'));var logger=require(_0xd290('0x4'))(_0xd290('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd290('0x6')]()['then'](mailAccount[_0xd290('0x7')]())[_0xd290('0x8')](realtime[_0xd290('0x9')]())[_0xd290('0x8')](function(){email[_0xd290('0xa')](realtime[_0xd290('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xd290('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0xd290('0xc')]();})[_0xd290('0x8')](function(_0x4c38b6){return setInterval(initRealtime,_0x4c38b6[_0xd290('0xd')]*0x3e8);})[_0xd290('0xe')](function(_0x46008f){logger[_0xd290('0xf')]('Email\x20service\x20initialization',_0x46008f);});}main(); \ No newline at end of file +var _0x8bf1=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','getSettings','loginMailFrequency','catch','error','./realtime'];(function(_0x50022f,_0x34646d){var _0xd9280f=function(_0x1140de){while(--_0x1140de){_0x50022f['push'](_0x50022f['shift']());}};_0xd9280f(++_0x34646d);}(_0x8bf1,0xdf));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var server=require('./server');var Realtime=require(_0x18bf('0x0'));var EmailChannel=require(_0x18bf('0x1'));var mailAccount=require(_0x18bf('0x2'));var setting=require(_0x18bf('0x3'));var logger=require(_0x18bf('0x4'))(_0x18bf('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x18bf('0x6')]()[_0x18bf('0x7')](mailAccount[_0x18bf('0x8')]())[_0x18bf('0x7')](realtime[_0x18bf('0x9')]())[_0x18bf('0x7')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x18bf('0x7')](function(){return initRealtime();})[_0x18bf('0x7')](function(){return setting[_0x18bf('0xa')]();})[_0x18bf('0x7')](function(_0xc9fe68){return setInterval(initRealtime,_0xc9fe68[_0x18bf('0xb')]*0x3e8);})[_0x18bf('0xc')](function(_0x77ffc){logger[_0x18bf('0xd')]('Email\x20service\x20initialization',_0x77ffc);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 99b3985..f5844b6 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 _0xa2e7=['bluebird','md5','ioredis','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','mailAccounts','smtp','prototype','name','key','active','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','hasOwnProperty','service','provider','custom','imapAccounts','bind','end','handleImapEnd','error','handleImapError','status','disabled','handleImapBox','connected','messages','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment'];(function(_0x718fe9,_0x207ebc){var _0x24dc33=function(_0x161f79){while(--_0x161f79){_0x718fe9['push'](_0x718fe9['shift']());}};_0x24dc33(++_0x207ebc);}(_0xa2e7,0x6e));var _0x7a2e=function(_0x1b7ba7,_0x5f1a2a){_0x1b7ba7=_0x1b7ba7-0x0;var _0xc7ab78=_0xa2e7[_0x1b7ba7];return _0xc7ab78;};'use strict';var _=require(_0x7a2e('0x0'));var moment=require(_0x7a2e('0x1'));var BPromise=require(_0x7a2e('0x2'));var md5=require(_0x7a2e('0x3'));var Redis=require(_0x7a2e('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7a2e('0x5'));config[_0x7a2e('0x6')]=_[_0x7a2e('0x7')](config[_0x7a2e('0x6')],{'host':_0x7a2e('0x8'),'port':0x18eb});var io=require(_0x7a2e('0x9'))(new Redis(config[_0x7a2e('0x6')]));var EmailImap=require(_0x7a2e('0xa'));var EmailSmtp=require(_0x7a2e('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2adcb1){logger['info']('start\x20email\x20channel');this[_0x7a2e('0xc')]=_0x2adcb1[_0x7a2e('0xc')];this['imapAccounts']={};this[_0x7a2e('0xd')]=new EmailSmtp();}EmailChannel[_0x7a2e('0xe')]['emit']=function(_0x4f471a){var _0x2a4657=this['mailAccounts'][_0x4f471a];var _0x4fba11={'id':_0x2a4657['id'],'name':_0x2a4657[_0x7a2e('0xf')],'key':_0x2a4657[_0x7a2e('0x10')],'active':_0x2a4657[_0x7a2e('0x11')],'Imap':{'status':_0x2a4657[_0x7a2e('0x12')]['status'],'messageStatus':_0x2a4657[_0x7a2e('0x12')][_0x7a2e('0x13')],'total':_0x2a4657[_0x7a2e('0x12')][_0x7a2e('0x14')]}};if(_[_0x7a2e('0x15')](md5Accounts[_0x4f471a])){md5Accounts[_0x4f471a]={};}var _0x2b0aa0=md5(JSON[_0x7a2e('0x16')](_0x4fba11));if(md5Accounts[_0x4f471a][_0x7a2e('0x3')]!==_0x2b0aa0){md5Accounts[_0x4f471a][_0x7a2e('0x3')]=_0x2b0aa0;io[_0x7a2e('0x17')](_0x7a2e('0x18'),_0x4fba11);}};EmailChannel[_0x7a2e('0xe')]['refresh']=function(_0x578b28){for(var _0x2e95bf in _0x578b28){if(_0x578b28[_0x7a2e('0x19')](_0x2e95bf)){if(_0x578b28[_0x2e95bf][_0x7a2e('0x12')]&&_0x578b28[_0x2e95bf][_0x7a2e('0x11')]){var _0x4f8dca=_0x578b28[_0x2e95bf][_0x7a2e('0x12')];if(!_0x4f8dca[_0x7a2e('0x1a')]&&_0x578b28[_0x2e95bf][_0x7a2e('0x1b')]!==_0x7a2e('0x1c'))_0x4f8dca[_0x7a2e('0x1a')]=_0x578b28[_0x2e95bf]['provider'];if(!this[_0x7a2e('0x1d')][_0x7a2e('0x19')](_0x4f8dca['id'])){this['imapAccounts'][_0x4f8dca['id']]=new EmailImap(_0x4f8dca,_0x578b28[_0x2e95bf][_0x7a2e('0x5')]);this[_0x7a2e('0x1d')][_0x4f8dca['id']]['on']('box',this['handleImapBox'][_0x7a2e('0x1e')](this,_0x2e95bf));this['imapAccounts'][_0x4f8dca['id']]['on'](_0x7a2e('0x5'),this['handleImapEmail'][_0x7a2e('0x1e')](this,_0x2e95bf));this[_0x7a2e('0x1d')][_0x4f8dca['id']]['on'](_0x7a2e('0x1f'),this[_0x7a2e('0x20')]['bind'](this,_0x2e95bf));this[_0x7a2e('0x1d')][_0x4f8dca['id']]['on'](_0x7a2e('0x21'),this[_0x7a2e('0x22')][_0x7a2e('0x1e')](this,_0x2e95bf));}}else{if(_[_0x7a2e('0x15')](this['mailAccounts'][_0x2e95bf][_0x7a2e('0x12')])){this[_0x7a2e('0xc')][_0x2e95bf]['Imap']={};}this[_0x7a2e('0xc')][_0x2e95bf][_0x7a2e('0x12')][_0x7a2e('0x23')]=_0x7a2e('0x24');this['mailAccounts'][_0x2e95bf][_0x7a2e('0x12')][_0x7a2e('0x13')]='';this[_0x7a2e('0x17')](_0x2e95bf);}}}};EmailChannel['prototype'][_0x7a2e('0x25')]=function(_0x5e4784,_0x42bdcb){if(this[_0x7a2e('0xc')][_0x5e4784]){this['mailAccounts'][_0x5e4784][_0x7a2e('0x12')]['status']=_0x7a2e('0x26');this[_0x7a2e('0xc')][_0x5e4784][_0x7a2e('0x12')][_0x7a2e('0x13')]=_0x42bdcb[_0x7a2e('0xf')];if(_0x42bdcb[_0x7a2e('0x27')]){this[_0x7a2e('0xc')][_0x5e4784][_0x7a2e('0x12')][_0x7a2e('0x14')]=_0x42bdcb[_0x7a2e('0x27')][_0x7a2e('0x14')];}return this[_0x7a2e('0x17')](_0x5e4784);}};EmailChannel[_0x7a2e('0xe')][_0x7a2e('0x28')]=function(_0x30aaed,_0x1794e9){logger[_0x7a2e('0x29')](_0x7a2e('0x2a'),_0x1794e9['firstName'],_0x1794e9[_0x7a2e('0x2b')],_0x1794e9[_0x7a2e('0x2c')],_0x30aaed);if(this[_0x7a2e('0xc')][_0x30aaed]){return mailAccount['notify'](_0x30aaed,_0x1794e9)[_0x7a2e('0x2d')](function(_0x4c2cfc){if(_0x4c2cfc){logger['info'](_0x7a2e('0x2e'));}})[_0x7a2e('0x2f')](function(_0x55cfef){logger[_0x7a2e('0x21')](_0x7a2e('0x30'),JSON[_0x7a2e('0x16')](_0x55cfef));});}};EmailChannel[_0x7a2e('0xe')]['handleImapEnd']=function(_0x20b6b8){if(this['mailAccounts'][_0x20b6b8]&&this[_0x7a2e('0xc')][_0x20b6b8][_0x7a2e('0x12')]){if(this[_0x7a2e('0x1d')][this['mailAccounts'][_0x20b6b8][_0x7a2e('0x12')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x20b6b8]['Imap']['id']];}this[_0x7a2e('0xc')][_0x20b6b8][_0x7a2e('0x12')][_0x7a2e('0x31')]=moment();this['emit'](_0x20b6b8);}};EmailChannel[_0x7a2e('0xe')][_0x7a2e('0x22')]=function(_0x1da7e1,_0x1bcd73){if(this['mailAccounts'][_0x1da7e1]){this[_0x7a2e('0xc')][_0x1da7e1][_0x7a2e('0x12')][_0x7a2e('0x23')]='error';this['mailAccounts'][_0x1da7e1][_0x7a2e('0x12')]['messageStatus']=_0x1bcd73;return this[_0x7a2e('0x17')](_0x1da7e1);}};EmailChannel[_0x7a2e('0xe')][_0x7a2e('0x32')]=function(_0xaab2af,_0x3d134f){return this[_0x7a2e('0xd')]['send'](_0xaab2af,_0x3d134f);};EmailChannel['prototype'][_0x7a2e('0x33')]=function(_0x5e11b5){var _0x250af9=this;if(this[_0x7a2e('0xc')][_0x5e11b5['id']]){if(_[_0x7a2e('0x15')](this[_0x7a2e('0xc')][_0x5e11b5['id']][_0x7a2e('0x34')])){this['mailAccounts'][_0x5e11b5['id']][_0x7a2e('0x34')]={};}this[_0x7a2e('0xc')][_0x5e11b5['id']][_0x7a2e('0x34')][_0x7a2e('0x31')]=moment();return new BPromise(function(_0x1fdb6b,_0x27e076){return _0x250af9[_0x7a2e('0xd')][_0x7a2e('0x35')](_0x5e11b5)[_0x7a2e('0x2d')](function(_0x413b80){_0x250af9[_0x7a2e('0xc')][_0x5e11b5['id']][_0x7a2e('0x34')]['status']=_0x7a2e('0x36');_0x250af9[_0x7a2e('0xc')][_0x5e11b5['id']][_0x7a2e('0x34')][_0x7a2e('0x13')]='';_0x250af9[_0x7a2e('0x17')](_0x5e11b5['id']);_0x1fdb6b(_0x413b80);})[_0x7a2e('0x2f')](function(_0x218baf){_0x250af9['mailAccounts'][_0x5e11b5['id']][_0x7a2e('0x34')][_0x7a2e('0x23')]='error';_0x250af9['mailAccounts'][_0x5e11b5['id']][_0x7a2e('0x34')][_0x7a2e('0x13')]=_0x218baf;_0x250af9[_0x7a2e('0x17')](_0x5e11b5['id']);_0x27e076(_0x218baf);});});}return this[_0x7a2e('0xd')]['verify'](_0x5e11b5);};module[_0x7a2e('0x37')]=EmailChannel; \ No newline at end of file +var _0xb1f5=['emit','refresh','hasOwnProperty','provider','custom','service','imapAccounts','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','verifySmtp','Smtp','verify','then','verified','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','smtp','prototype','name','key','active','status','messageStatus','Imap','total','isNil','stringify'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xb1f5,0x161));var _0x5b1f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb1f5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var moment=require(_0x5b1f('0x0'));var BPromise=require('bluebird');var md5=require(_0x5b1f('0x1'));var Redis=require(_0x5b1f('0x2'));var config=require(_0x5b1f('0x3'));var logger=require(_0x5b1f('0x4'))(_0x5b1f('0x5'));config[_0x5b1f('0x6')]=_['defaults'](config['redis'],{'host':_0x5b1f('0x7'),'port':0x18eb});var io=require(_0x5b1f('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x5b1f('0x9'));var EmailSmtp=require(_0x5b1f('0xa'));var mailAccount=require(_0x5b1f('0xb'));var md5Accounts={};function EmailChannel(_0x23e64a){logger[_0x5b1f('0xc')]('start\x20email\x20channel');this[_0x5b1f('0xd')]=_0x23e64a[_0x5b1f('0xd')];this['imapAccounts']={};this[_0x5b1f('0xe')]=new EmailSmtp();}EmailChannel[_0x5b1f('0xf')]['emit']=function(_0x2d58b6){var _0x28d51f=this['mailAccounts'][_0x2d58b6];var _0x249a2a={'id':_0x28d51f['id'],'name':_0x28d51f[_0x5b1f('0x10')],'key':_0x28d51f[_0x5b1f('0x11')],'active':_0x28d51f[_0x5b1f('0x12')],'Imap':{'status':_0x28d51f['Imap'][_0x5b1f('0x13')],'messageStatus':_0x28d51f['Imap'][_0x5b1f('0x14')],'total':_0x28d51f[_0x5b1f('0x15')][_0x5b1f('0x16')]}};if(_[_0x5b1f('0x17')](md5Accounts[_0x2d58b6])){md5Accounts[_0x2d58b6]={};}var _0x46c92b=md5(JSON[_0x5b1f('0x18')](_0x249a2a));if(md5Accounts[_0x2d58b6][_0x5b1f('0x1')]!==_0x46c92b){md5Accounts[_0x2d58b6][_0x5b1f('0x1')]=_0x46c92b;io[_0x5b1f('0x19')]('mailAccount:update',_0x249a2a);}};EmailChannel[_0x5b1f('0xf')][_0x5b1f('0x1a')]=function(_0x19ab41){for(var _0x5cdd63 in _0x19ab41){if(_0x19ab41[_0x5b1f('0x1b')](_0x5cdd63)){if(_0x19ab41[_0x5cdd63][_0x5b1f('0x15')]&&_0x19ab41[_0x5cdd63][_0x5b1f('0x12')]){var _0x248917=_0x19ab41[_0x5cdd63][_0x5b1f('0x15')];if(!_0x248917['service']&&_0x19ab41[_0x5cdd63][_0x5b1f('0x1c')]!==_0x5b1f('0x1d'))_0x248917[_0x5b1f('0x1e')]=_0x19ab41[_0x5cdd63]['provider'];if(!this[_0x5b1f('0x1f')][_0x5b1f('0x1b')](_0x248917['id'])){this[_0x5b1f('0x1f')][_0x248917['id']]=new EmailImap(_0x248917,_0x19ab41[_0x5cdd63]['email']);this[_0x5b1f('0x1f')][_0x248917['id']]['on'](_0x5b1f('0x20'),this['handleImapBox'][_0x5b1f('0x21')](this,_0x5cdd63));this[_0x5b1f('0x1f')][_0x248917['id']]['on'](_0x5b1f('0x5'),this[_0x5b1f('0x22')][_0x5b1f('0x21')](this,_0x5cdd63));this[_0x5b1f('0x1f')][_0x248917['id']]['on'](_0x5b1f('0x23'),this['handleImapEnd'][_0x5b1f('0x21')](this,_0x5cdd63));this[_0x5b1f('0x1f')][_0x248917['id']]['on'](_0x5b1f('0x24'),this[_0x5b1f('0x25')][_0x5b1f('0x21')](this,_0x5cdd63));}}else{if(_[_0x5b1f('0x17')](this[_0x5b1f('0xd')][_0x5cdd63]['Imap'])){this[_0x5b1f('0xd')][_0x5cdd63][_0x5b1f('0x15')]={};}this[_0x5b1f('0xd')][_0x5cdd63]['Imap'][_0x5b1f('0x13')]=_0x5b1f('0x26');this['mailAccounts'][_0x5cdd63]['Imap'][_0x5b1f('0x14')]='';this[_0x5b1f('0x19')](_0x5cdd63);}}}};EmailChannel[_0x5b1f('0xf')][_0x5b1f('0x27')]=function(_0x3ad9cf,_0x4a91f2){if(this['mailAccounts'][_0x3ad9cf]){this[_0x5b1f('0xd')][_0x3ad9cf][_0x5b1f('0x15')][_0x5b1f('0x13')]=_0x5b1f('0x28');this[_0x5b1f('0xd')][_0x3ad9cf][_0x5b1f('0x15')][_0x5b1f('0x14')]=_0x4a91f2['name'];if(_0x4a91f2[_0x5b1f('0x29')]){this[_0x5b1f('0xd')][_0x3ad9cf][_0x5b1f('0x15')][_0x5b1f('0x16')]=_0x4a91f2['messages']['total'];}return this[_0x5b1f('0x19')](_0x3ad9cf);}};EmailChannel[_0x5b1f('0xf')][_0x5b1f('0x22')]=function(_0x696a7f,_0x58807c){logger[_0x5b1f('0xc')](_0x5b1f('0x2a'),_0x58807c['firstName'],_0x58807c['lastName'],_0x58807c['from'],_0x696a7f);if(this[_0x5b1f('0xd')][_0x696a7f]){return mailAccount['notify'](_0x696a7f,_0x58807c)['then'](function(_0x31efdb){if(_0x31efdb){logger[_0x5b1f('0xc')](_0x5b1f('0x2b'));}})[_0x5b1f('0x2c')](function(_0x1156c1){logger[_0x5b1f('0x24')](_0x5b1f('0x2d'),JSON['stringify'](_0x1156c1));});}};EmailChannel['prototype'][_0x5b1f('0x2e')]=function(_0x3f1dfc){if(this['mailAccounts'][_0x3f1dfc]&&this[_0x5b1f('0xd')][_0x3f1dfc][_0x5b1f('0x15')]){if(this[_0x5b1f('0x1f')][this[_0x5b1f('0xd')][_0x3f1dfc][_0x5b1f('0x15')]['id']]){delete this['imapAccounts'][this[_0x5b1f('0xd')][_0x3f1dfc][_0x5b1f('0x15')]['id']];}this[_0x5b1f('0xd')][_0x3f1dfc][_0x5b1f('0x15')]['lastSync']=moment();this[_0x5b1f('0x19')](_0x3f1dfc);}};EmailChannel['prototype'][_0x5b1f('0x25')]=function(_0x1de68c,_0x35037b){if(this['mailAccounts'][_0x1de68c]){this[_0x5b1f('0xd')][_0x1de68c][_0x5b1f('0x15')]['status']=_0x5b1f('0x24');this[_0x5b1f('0xd')][_0x1de68c]['Imap']['messageStatus']=_0x35037b;return this[_0x5b1f('0x19')](_0x1de68c);}};EmailChannel[_0x5b1f('0xf')][_0x5b1f('0x2f')]=function(_0x85485,_0x47454b){return this['smtp']['send'](_0x85485,_0x47454b);};EmailChannel[_0x5b1f('0xf')][_0x5b1f('0x30')]=function(_0x44572e){var _0x1bc204=this;if(this[_0x5b1f('0xd')][_0x44572e['id']]){if(_[_0x5b1f('0x17')](this[_0x5b1f('0xd')][_0x44572e['id']][_0x5b1f('0x31')])){this[_0x5b1f('0xd')][_0x44572e['id']][_0x5b1f('0x31')]={};}this[_0x5b1f('0xd')][_0x44572e['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x2ba6e9,_0x49aa0a){return _0x1bc204['smtp'][_0x5b1f('0x32')](_0x44572e)[_0x5b1f('0x33')](function(_0x4a7ce){_0x1bc204[_0x5b1f('0xd')][_0x44572e['id']][_0x5b1f('0x31')][_0x5b1f('0x13')]=_0x5b1f('0x34');_0x1bc204['mailAccounts'][_0x44572e['id']]['Smtp'][_0x5b1f('0x14')]='';_0x1bc204[_0x5b1f('0x19')](_0x44572e['id']);_0x2ba6e9(_0x4a7ce);})[_0x5b1f('0x2c')](function(_0x48885c){_0x1bc204['mailAccounts'][_0x44572e['id']][_0x5b1f('0x31')][_0x5b1f('0x13')]=_0x5b1f('0x24');_0x1bc204[_0x5b1f('0xd')][_0x44572e['id']][_0x5b1f('0x31')]['messageStatus']=_0x48885c;_0x1bc204[_0x5b1f('0x19')](_0x44572e['id']);_0x49aa0a(_0x48885c);});});}return this[_0x5b1f('0xe')][_0x5b1f('0x32')](_0x44572e);};module[_0x5b1f('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b188348..13f7b40 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 _0x3a6d=['closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','handleFetchEnd','stringify','textCode','hasOwnProperty','emit','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchError'];(function(_0x3a37df,_0x46c381){var _0x33845c=function(_0x276b10){while(--_0x276b10){_0x3a37df['push'](_0x3a37df['shift']());}};_0x33845c(++_0x46c381);}(_0x3a6d,0x143));var _0xd3a6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x3a6d[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var Imap=require('imap');var simpleParser=require(_0xd3a6('0x2'))[_0xd3a6('0x3')];var Iconv=require(_0xd3a6('0x4'))[_0xd3a6('0x5')];var EventEmitter=require(_0xd3a6('0x6'))['EventEmitter'];var utils=require(_0xd3a6('0x7'));var logger=require(_0xd3a6('0x8'))(_0xd3a6('0x9'));function EmailImap(_0x1fc450,_0x25b042){this[_0xd3a6('0xa')]='INBOX';this[_0xd3a6('0xb')]=this[_0xd3a6('0xc')](_0x1fc450,_0x25b042);this[_0xd3a6('0xd')]=new Imap(this[_0xd3a6('0xb')]);this[_0xd3a6('0xd')][_0xd3a6('0xe')](_0xd3a6('0xf'),this[_0xd3a6('0x10')][_0xd3a6('0x11')](this));this['imap'][_0xd3a6('0xe')](_0xd3a6('0x12'),this[_0xd3a6('0x13')][_0xd3a6('0x11')](this));this[_0xd3a6('0xd')]['on']('error',this['handleError']['bind'](this));this[_0xd3a6('0xd')][_0xd3a6('0x14')]();}util[_0xd3a6('0x15')](EmailImap,EventEmitter);EmailImap[_0xd3a6('0x16')][_0xd3a6('0xc')]=function(_0x2911a0,_0xa56452){var _0x4e67fb={'connTimeout':_0x2911a0[_0xd3a6('0x17')]?_0x2911a0[_0xd3a6('0x17')]*0x3e8:0x2710,'authTimeout':_0x2911a0[_0xd3a6('0x18')]?_0x2911a0['authTimeout']*0x3e8:0x1388};if(_0x2911a0[_0xd3a6('0x19')]){_0x4e67fb[_0xd3a6('0x1a')]=_0x2911a0[_0xd3a6('0x1a')];_0x4e67fb['email']=_0xa56452||_0x2911a0[_0xd3a6('0x1a')]||'anonymous@xcally.com';if(_0x2911a0['modernAuthentication']){_0x4e67fb[_0xd3a6('0x1b')]=utils[_0xd3a6('0x1c')](_0x2911a0[_0xd3a6('0x1d')][_0xd3a6('0x1e')],_0x2911a0[_0xd3a6('0x1a')]);}else{_0x4e67fb[_0xd3a6('0x1f')]=_0x2911a0[_0xd3a6('0x1f')];}}else{if(_0x2911a0['authentication']){_0x4e67fb[_0xd3a6('0x1a')]=_0x2911a0['user'];_0x4e67fb[_0xd3a6('0x1f')]=_0x2911a0[_0xd3a6('0x1f')];}}_0x4e67fb[_0xd3a6('0x20')]=_0x2911a0[_0xd3a6('0x20')];_0x4e67fb[_0xd3a6('0x21')]=_0x2911a0[_0xd3a6('0x21')]||0x3e1;if(_0x2911a0['tls']){_0x4e67fb[_0xd3a6('0x22')]=!![];}else{_0x4e67fb[_0xd3a6('0x22')]=![];_0x4e67fb['autotls']='required';}return _0x4e67fb;};EmailImap['prototype']['handleReady']=function(){this['imap'][_0xd3a6('0x23')](this[_0xd3a6('0xa')],![],this[_0xd3a6('0x24')]['bind'](this));};EmailImap[_0xd3a6('0x16')]['handleOpenBox']=function(_0x350a11,_0x16afc8){if(_0x350a11){this[_0xd3a6('0x25')](_0x350a11,!![]);}else{this['emit'](_0xd3a6('0x26'),_0x16afc8);this[_0xd3a6('0x27')]();}};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x28')]=function(_0x169d11){if(_0x169d11){this[_0xd3a6('0x25')](_0x169d11,!![]);}else{this['imap'][_0xd3a6('0x12')]();}};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x27')]=function(){this[_0xd3a6('0xd')][_0xd3a6('0x29')]([_0xd3a6('0x2a')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x2b')]=function(_0x35981c,_0x1fd9e5){if(_0x35981c){this['handleError'](_0x35981c,!![]);}else{if(_0x1fd9e5[_0xd3a6('0x2c')]){try{var _0xa4efd=this['imap'][_0xd3a6('0x2d')](_0x1fd9e5,{'bodies':'','markSeen':!![]});_0xa4efd['on']('message',this[_0xd3a6('0x2e')][_0xd3a6('0x11')](this));_0xa4efd[_0xd3a6('0xe')](_0xd3a6('0x2f'),this[_0xd3a6('0x30')][_0xd3a6('0x11')](this));_0xa4efd[_0xd3a6('0xe')]('end',this['handleFetchEnd'][_0xd3a6('0x11')](this));}catch(_0x155640){logger[_0xd3a6('0x2f')](_0x155640);}}else{this['imap'][_0xd3a6('0x31')](!![],this[_0xd3a6('0x28')][_0xd3a6('0x11')](this));}}};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x2e')]=function(_0x36b28a){_0x36b28a['on'](_0xd3a6('0x32'),this[_0xd3a6('0x33')]['bind'](this));_0x36b28a[_0xd3a6('0xe')](_0xd3a6('0x34'),this[_0xd3a6('0x35')][_0xd3a6('0x11')](this));_0x36b28a[_0xd3a6('0xe')](_0xd3a6('0x12'),this['handleMessageEnd'][_0xd3a6('0x11')](this));};EmailImap['prototype'][_0xd3a6('0x33')]=function(_0x459e78){simpleParser(_0x459e78,{'Iconv':Iconv},this[_0xd3a6('0x36')][_0xd3a6('0x11')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x37')]=function(){};EmailImap[_0xd3a6('0x16')]['handleSimpleParser']=function(_0x2bc0c7,_0x114784){if(_0x2bc0c7){logger['error'](_0x2bc0c7);}else{var _0x2f8e33=this;utils['parser'](this[_0xd3a6('0xb')],_0x114784,function(_0x2aa1dc){_0x2f8e33['emit'](_0xd3a6('0x9'),_0x2aa1dc);});}};EmailImap['prototype'][_0xd3a6('0x38')]=function(){this[_0xd3a6('0xd')]['closeBox'](!![],this[_0xd3a6('0x28')][_0xd3a6('0x11')](this));};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x30')]=function(_0x5e412f){this[_0xd3a6('0x25')](_0x5e412f);this[_0xd3a6('0xd')][_0xd3a6('0x31')](!![],this[_0xd3a6('0x28')][_0xd3a6('0x11')](this));};EmailImap['prototype'][_0xd3a6('0x13')]=function(){this['emit'](_0xd3a6('0x12'));};EmailImap[_0xd3a6('0x16')][_0xd3a6('0x25')]=function(_0x5469cc,_0x74242e){logger['error'](_0xd3a6('0x25'),this['account'][_0xd3a6('0x9')],JSON[_0xd3a6('0x39')](_0x5469cc));var _0x27af5b='';if(_0x5469cc){if(_0x5469cc[_0xd3a6('0x3a')]){_0x27af5b=_0x5469cc[_0xd3a6('0x3a')];}else{for(var _0x74bb6e in _0x5469cc){if(_0x5469cc[_0xd3a6('0x3b')](_0x74bb6e)){_0x27af5b+=_['upperFirst'](_0x74bb6e)+':\x20'+_0x5469cc[_0x74bb6e]+'\x0a';}}}}if(_0x74242e){this[_0xd3a6('0xd')][_0xd3a6('0x12')]();}else{this[_0xd3a6('0x3c')](_0xd3a6('0x2f'),_0x27af5b);this['emit'](_0xd3a6('0x12'));}};module[_0xd3a6('0x3d')]=EmailImap; \ No newline at end of file +var _0xd4e3=['required','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','once','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','textCode','hasOwnProperty','upperFirst','exports','lodash','util','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','ready','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls'];(function(_0x1cadc2,_0x5b56cc){var _0x147414=function(_0x209907){while(--_0x209907){_0x1cadc2['push'](_0x1cadc2['shift']());}};_0x147414(++_0x5b56cc);}(_0xd4e3,0x1da));var _0x3d4e=function(_0x49ed7a,_0x473b84){_0x49ed7a=_0x49ed7a-0x0;var _0x3d6981=_0xd4e3[_0x49ed7a];return _0x3d6981;};'use strict';var _=require(_0x3d4e('0x0'));var util=require(_0x3d4e('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x3d4e('0x2'))['Iconv'];var EventEmitter=require(_0x3d4e('0x3'))[_0x3d4e('0x4')];var utils=require(_0x3d4e('0x5'));var logger=require(_0x3d4e('0x6'))(_0x3d4e('0x7'));function EmailImap(_0x2071f9,_0x4830d6){this[_0x3d4e('0x8')]=_0x3d4e('0x9');this[_0x3d4e('0xa')]=this[_0x3d4e('0xb')](_0x2071f9,_0x4830d6);this[_0x3d4e('0xc')]=new Imap(this[_0x3d4e('0xa')]);this[_0x3d4e('0xc')]['once'](_0x3d4e('0xd'),this['handleReady'][_0x3d4e('0xe')](this));this[_0x3d4e('0xc')]['once'](_0x3d4e('0xf'),this[_0x3d4e('0x10')][_0x3d4e('0xe')](this));this[_0x3d4e('0xc')]['on'](_0x3d4e('0x11'),this[_0x3d4e('0x12')][_0x3d4e('0xe')](this));this['imap'][_0x3d4e('0x13')]();}util[_0x3d4e('0x14')](EmailImap,EventEmitter);EmailImap[_0x3d4e('0x15')][_0x3d4e('0xb')]=function(_0x1e6738,_0x3facb5){var _0x5531b8={'connTimeout':_0x1e6738[_0x3d4e('0x16')]?_0x1e6738[_0x3d4e('0x16')]*0x3e8:0x2710,'authTimeout':_0x1e6738[_0x3d4e('0x17')]?_0x1e6738[_0x3d4e('0x17')]*0x3e8:0x1388};if(_0x1e6738[_0x3d4e('0x18')]){_0x5531b8[_0x3d4e('0x19')]=_0x1e6738[_0x3d4e('0x19')];if(_0x1e6738[_0x3d4e('0x1a')]){_0x5531b8[_0x3d4e('0x1b')]=utils[_0x3d4e('0x1c')](_0x1e6738[_0x3d4e('0x1d')][_0x3d4e('0x1e')],_0x1e6738[_0x3d4e('0x19')]);}else{_0x5531b8[_0x3d4e('0x1f')]=_0x1e6738[_0x3d4e('0x1f')];}}else{if(_0x1e6738[_0x3d4e('0x20')]){_0x5531b8[_0x3d4e('0x19')]=_0x1e6738[_0x3d4e('0x19')];_0x5531b8[_0x3d4e('0x1f')]=_0x1e6738[_0x3d4e('0x1f')];}}_0x5531b8['email']=_0x3facb5||_0x1e6738['user']||_0x3d4e('0x21');_0x5531b8['host']=_0x1e6738[_0x3d4e('0x22')];_0x5531b8[_0x3d4e('0x23')]=_0x1e6738[_0x3d4e('0x23')]||0x3e1;if(_0x1e6738[_0x3d4e('0x24')]){_0x5531b8[_0x3d4e('0x24')]=!![];}else{_0x5531b8[_0x3d4e('0x24')]=![];_0x5531b8[_0x3d4e('0x25')]=_0x3d4e('0x26');}return _0x5531b8;};EmailImap['prototype']['handleReady']=function(){this[_0x3d4e('0xc')]['openBox'](this[_0x3d4e('0x8')],![],this[_0x3d4e('0x27')][_0x3d4e('0xe')](this));};EmailImap['prototype'][_0x3d4e('0x27')]=function(_0x88efa4,_0x1fbf8b){if(_0x88efa4){this[_0x3d4e('0x12')](_0x88efa4,!![]);}else{this[_0x3d4e('0x28')](_0x3d4e('0x29'),_0x1fbf8b);this[_0x3d4e('0x2a')]();}};EmailImap[_0x3d4e('0x15')][_0x3d4e('0x2b')]=function(_0x5c2d64){if(_0x5c2d64){this[_0x3d4e('0x12')](_0x5c2d64,!![]);}else{this[_0x3d4e('0xc')]['end']();}};EmailImap[_0x3d4e('0x15')]['readUnseen']=function(){this[_0x3d4e('0xc')][_0x3d4e('0x2c')]([_0x3d4e('0x2d')],this[_0x3d4e('0x2e')][_0x3d4e('0xe')](this));};EmailImap['prototype'][_0x3d4e('0x2e')]=function(_0x56f769,_0x31fb3d){if(_0x56f769){this[_0x3d4e('0x12')](_0x56f769,!![]);}else{if(_0x31fb3d[_0x3d4e('0x2f')]){try{var _0xbf8a74=this[_0x3d4e('0xc')][_0x3d4e('0x30')](_0x31fb3d,{'bodies':'','markSeen':!![]});_0xbf8a74['on'](_0x3d4e('0x31'),this['handleFetchMessage'][_0x3d4e('0xe')](this));_0xbf8a74[_0x3d4e('0x32')](_0x3d4e('0x11'),this[_0x3d4e('0x33')][_0x3d4e('0xe')](this));_0xbf8a74['once']('end',this[_0x3d4e('0x34')]['bind'](this));}catch(_0x4275d2){logger[_0x3d4e('0x11')](_0x4275d2);}}else{this['imap'][_0x3d4e('0x35')](!![],this['handleCloseBox'][_0x3d4e('0xe')](this));}}};EmailImap[_0x3d4e('0x15')][_0x3d4e('0x36')]=function(_0x14966c){_0x14966c['on'](_0x3d4e('0x37'),this[_0x3d4e('0x38')][_0x3d4e('0xe')](this));_0x14966c[_0x3d4e('0x32')](_0x3d4e('0x39'),this[_0x3d4e('0x3a')][_0x3d4e('0xe')](this));_0x14966c[_0x3d4e('0x32')](_0x3d4e('0xf'),this[_0x3d4e('0x3b')][_0x3d4e('0xe')](this));};EmailImap[_0x3d4e('0x15')]['handleMessageBody']=function(_0x4b0258){simpleParser(_0x4b0258,{'Iconv':Iconv},this['handleSimpleParser'][_0x3d4e('0xe')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x3d4e('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x3d4e('0x15')]['handleSimpleParser']=function(_0x18e0f6,_0x5a7861){if(_0x18e0f6){logger[_0x3d4e('0x11')](_0x18e0f6);}else{var _0xc0633e=this;utils['parser'](this[_0x3d4e('0xa')],_0x5a7861,function(_0x388431){_0xc0633e['emit'](_0x3d4e('0x7'),_0x388431);});}};EmailImap[_0x3d4e('0x15')]['handleFetchEnd']=function(){this[_0x3d4e('0xc')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x3d4e('0x15')]['handleFetchError']=function(_0x15e8e2){this[_0x3d4e('0x12')](_0x15e8e2);this[_0x3d4e('0xc')][_0x3d4e('0x35')](!![],this['handleCloseBox'][_0x3d4e('0xe')](this));};EmailImap[_0x3d4e('0x15')][_0x3d4e('0x10')]=function(){this[_0x3d4e('0x28')](_0x3d4e('0xf'));};EmailImap[_0x3d4e('0x15')][_0x3d4e('0x12')]=function(_0xc084cb,_0x1b270c){logger[_0x3d4e('0x11')](_0x3d4e('0x12'),this[_0x3d4e('0xa')][_0x3d4e('0x7')],JSON['stringify'](_0xc084cb));var _0x215482='';if(_0xc084cb){if(_0xc084cb[_0x3d4e('0x3c')]){_0x215482=_0xc084cb['textCode'];}else{for(var _0x1594dc in _0xc084cb){if(_0xc084cb[_0x3d4e('0x3d')](_0x1594dc)){_0x215482+=_[_0x3d4e('0x3e')](_0x1594dc)+':\x20'+_0xc084cb[_0x1594dc]+'\x0a';}}}}if(_0x1b270c){this[_0x3d4e('0xc')][_0x3d4e('0xf')]();}else{this[_0x3d4e('0x28')](_0x3d4e('0x11'),_0x215482);this[_0x3d4e('0x28')](_0x3d4e('0xf'));}};module[_0x3d4e('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 4c04dfb..62c612f 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 _0x1a90=['use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x44fbe1,_0x1209a9){var _0x3c6322=function(_0x2d4c81){while(--_0x2d4c81){_0x44fbe1['push'](_0x44fbe1['shift']());}};_0x3c6322(++_0x1209a9);}(_0x1a90,0x164));var _0x01a9=function(_0x4e300d,_0x1b0a35){_0x4e300d=_0x4e300d-0x0;var _0x38730a=_0x1a90[_0x4e300d];return _0x38730a;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x01a9('0x0'));function EmailSmtp(){}EmailSmtp[_0x01a9('0x1')][_0x01a9('0x2')]=function(_0x17dc01,_0x4f9efe){return new Promise(function(_0x4f16f2,_0x12852a){var _0x56c3c1=nodemailer[_0x01a9('0x3')](_0x17dc01);_0x56c3c1[_0x01a9('0x4')]('compile',inlineBase64());_0x56c3c1[_0x01a9('0x5')](_0x4f9efe,function(_0x42d986,_0x522aed){if(_0x42d986){_0x12852a(_0x42d986[_0x01a9('0x6')]());}else{_0x4f16f2(_0x522aed);}});});};EmailSmtp['prototype'][_0x01a9('0x7')]=function(_0x2797a4){return new Promise(function(_0x526bf2,_0xd360ef){var _0x2e1447=nodemailer[_0x01a9('0x3')](_0x2797a4);_0x2e1447[_0x01a9('0x7')](function(_0x192d06,_0x129cad){if(_0x192d06){_0xd360ef(_0x192d06[_0x01a9('0x6')]());}else{if(_0x129cad){_0x526bf2(_0x129cad);}else{_0xd360ef(_0x01a9('0x8'));}}});});};module[_0x01a9('0x9')]=EmailSmtp; \ No newline at end of file +var _0xf26d=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','verify','Not\x20verifired','exports','nodemailer'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0xf26d,0x77));var _0xdf26=function(_0x4a7eb7,_0xe84e77){_0x4a7eb7=_0x4a7eb7-0x0;var _0x2764a9=_0xf26d[_0x4a7eb7];return _0x2764a9;};'use strict';var nodemailer=require(_0xdf26('0x0'));var inlineBase64=require(_0xdf26('0x1'));function EmailSmtp(){}EmailSmtp[_0xdf26('0x2')][_0xdf26('0x3')]=function(_0x2ccdc7,_0x243ae6){return new Promise(function(_0x54590f,_0x33fb7a){var _0x5757aa=nodemailer[_0xdf26('0x4')](_0x2ccdc7);_0x5757aa[_0xdf26('0x5')](_0xdf26('0x6'),inlineBase64());_0x5757aa['sendMail'](_0x243ae6,function(_0x280e5f,_0x52828d){if(_0x280e5f){_0x33fb7a(_0x280e5f['toString']());}else{_0x54590f(_0x52828d);}});});};EmailSmtp[_0xdf26('0x2')]['verify']=function(_0x13382a){return new Promise(function(_0x1a2749,_0x557a8f){var _0x27e4c1=nodemailer['createTransport'](_0x13382a);_0x27e4c1[_0xdf26('0x7')](function(_0x105fce,_0x383b5d){if(_0x105fce){_0x557a8f(_0x105fce['toString']());}else{if(_0x383b5d){_0x1a2749(_0x383b5d);}else{_0x557a8f(_0xdf26('0x8'));}}});});};module[_0xdf26('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 5468b22..b826b72 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 _0x1c37=['replace','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','node-tnef','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','value','pop','isEmpty','html','test'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c37,0x197));var _0x71c3=function(_0x3b7095,_0x49dcfd){_0x3b7095=_0x3b7095-0x0;var _0x4aec9c=_0x1c37[_0x3b7095];return _0x4aec9c;};'use strict';var _=require(_0x71c3('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x71c3('0x1'));var logger=require('../../../config/logger')(_0x71c3('0x2'));var config=require(_0x71c3('0x3'));function getAddress(_0xb6b29d){var _0x301463=_[_0x71c3('0x4')](_0xb6b29d['value']);return _0x301463&&_0x301463[_0x71c3('0x5')]?_0x301463[_0x71c3('0x5')]:_0x71c3('0x6')+random[_0x71c3('0x7')](0x6)+_0x71c3('0x8');}function getFirstName(_0x1ac00f){var _0x1d4abb=_['head'](_0x1ac00f['value']);if(_0x1d4abb&&_0x1d4abb[_0x71c3('0x9')]){if(_0x1d4abb[_0x71c3('0x9')]==_0x1d4abb['address']){return _0x1d4abb[_0x71c3('0x9')]['substring'](0x0,_0x1d4abb[_0x71c3('0x9')]['indexOf']('@'));}var _0x283012=_0x1d4abb[_0x71c3('0x9')][_0x71c3('0xa')](/\s+/);return _0x283012[_0x71c3('0xb')]>0x1?_0x283012['slice'](0x0,-0x1)[_0x71c3('0xc')]('\x20'):_0x1d4abb['name'];}return _0x71c3('0xd');}function getLastName(_0x75c357){var _0x15a0e2=_[_0x71c3('0x4')](_0x75c357[_0x71c3('0xe')]);if(_0x15a0e2&&_0x15a0e2['name']){var _0x2a722d=_0x15a0e2[_0x71c3('0x9')]['split'](/\s+/);return _0x2a722d['length']>0x1?_0x2a722d[_0x71c3('0xf')]():'';}return'';}function getMails(_0x14ebc6,_0x122a0c){var _0x2a4b4c='';for(var _0x33601c=0x0;_0x33601c<_0x122a0c[_0x71c3('0xe')][_0x71c3('0xb')];_0x33601c+=0x1){if(_0x122a0c['value'][_0x33601c][_0x71c3('0x5')]!==_0x14ebc6){if(!_[_0x71c3('0x10')](_0x2a4b4c)){_0x2a4b4c+=',';}_0x2a4b4c+=_0x122a0c[_0x71c3('0xe')][_0x33601c][_0x71c3('0x9')]||_0x122a0c['value'][_0x33601c][_0x71c3('0x5')]||'';_0x2a4b4c+='\x20<';_0x2a4b4c+=_0x122a0c['value'][_0x33601c][_0x71c3('0x5')]?_0x122a0c[_0x71c3('0xe')][_0x33601c][_0x71c3('0x5')]:_0x71c3('0x6')+random['generate'](0x6)+'@xcally.com';_0x2a4b4c+='>';}}return _0x2a4b4c;}function parseEmail(_0x5b8ded,_0x24a0de,_0x5b10e7){if(_0x24a0de[_0x71c3('0x11')]){var _0x30152b=/)<[^<]*)*<\/script>/gi;while(_0x30152b[_0x71c3('0x12')](_0x24a0de[_0x71c3('0x11')])){_0x24a0de['html']=_0x24a0de[_0x71c3('0x11')][_0x71c3('0x13')](_0x30152b,'');}if(_0x24a0de[_0x71c3('0x11')]['includes'](_0x71c3('0x14'))){var _0x3d6b7d=[];_0x24a0de['attachments'][_0x71c3('0x15')](_0x42cd26=>{_0x3d6b7d[_0x71c3('0x16')](_0x42cd26[_0x71c3('0x17')]);});var _0x50ac1d=/]+>/g;var _0x2f0729=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5e9a51=_0x24a0de[_0x71c3('0x11')][_0x71c3('0x13')](_0x2f0729,'_SRC');var _0x437510=_0x5e9a51[_0x71c3('0x13')](_0x50ac1d,_0x71c3('0x18'));for(let _0x3a1d2f=0x0;_0x3a1d2f<_0x3d6b7d[_0x71c3('0xb')];_0x3a1d2f++){var _0xef004=_0x437510[_0x71c3('0x13')]('_IMG',_0x71c3('0x19')+_0x3d6b7d[_0x3a1d2f]+'\x20]');_0x437510=_0xef004;}_0x24a0de['html']=_0x437510;}_0x5b10e7[_0x71c3('0x1a')]=_0x24a0de[_0x71c3('0x11')];}else{_0x5b10e7['body']=_0x24a0de[_0x71c3('0x1b')];}if(_0x5b10e7[_0x71c3('0x1a')]){_0x5b10e7[_0x71c3('0x1a')]=_0x5b10e7[_0x71c3('0x1a')][_0x71c3('0x13')](/0x0){var _0x38556a=[_0x71c3('0x2e'),_0x71c3('0x2f'),_0x71c3('0x30')];for(var _0x4e6859=0x0;_0x4e6859<_0x24a0de[_0x71c3('0x2d')][_0x71c3('0xb')];_0x4e6859++){var _0x2d3566=_['indexOf'](_0x38556a,_0x24a0de['headerLines'][_0x4e6859][_0x71c3('0x31')]);if(_0x2d3566>=0x0){_0x5b10e7['isAutoreply']=!![];}}}return _0x5b10e7;}exports[_0x71c3('0x32')]=function(_0x22d82e,_0x2bfeb5,_0x5eadc6){var _0x1cd1a4={'from':getAddress(_0x2bfeb5['from']),'firstName':getFirstName(_0x2bfeb5['from']),'lastName':getLastName(_0x2bfeb5['from']),'mapKey':_0x71c3('0x2'),'message':{'from':getMails(_0x22d82e['email'],_0x2bfeb5['from']),'to':_0x22d82e[_0x71c3('0x2')],'cc':'','subject':_0x2bfeb5[_0x71c3('0x33')]||'','messageId':_0x2bfeb5['messageId'],'inReplyTo':_0x2bfeb5['inReplyTo'],'sentAt':moment(_0x2bfeb5[_0x71c3('0x34')])[_0x71c3('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2bfeb5[_0x71c3('0x11')]&&!_0x2bfeb5['textAsHtml']){var _0x481e01=_[_0x71c3('0x36')](_0x2bfeb5['attachments'],{'contentType':_0x71c3('0x37')});if(_0x481e01[_0x71c3('0xb')]){logger['info'](util[_0x71c3('0x35')](_0x71c3('0x38'),_0x2bfeb5[_0x71c3('0x39')]));tnef[_0x71c3('0x3a')](_[_0x71c3('0x3b')](_0x481e01)[_0x71c3('0x2b')],function(_0x42dee6,_0x4aa4fa){if(_0x4aa4fa){_0x2bfeb5['html']=_0x4aa4fa[_0x71c3('0x3c')]||'

Empty\x20message

';if(_0x4aa4fa[_0x71c3('0x3d')]){for(var _0x471647=0x0;_0x471647<_0x4aa4fa['Attachments'][_0x71c3('0xb')];_0x471647++){var _0x12faa3=_0x4aa4fa[_0x71c3('0x3d')][_0x471647];_0x1cd1a4[_0x71c3('0x1d')][_0x71c3('0x22')]['push']({'filename':_0x12faa3[_0x71c3('0x3e')],'content':Buffer[_0x71c3('0x3f')](_0x12faa3[_0x71c3('0x40')])});}}}_0x5eadc6(parseEmail(_0x22d82e,_0x2bfeb5,_0x1cd1a4));});}else{_0x2bfeb5[_0x71c3('0x11')]=_0x71c3('0x41');_0x5eadc6(parseEmail(_0x22d82e,_0x2bfeb5,_0x1cd1a4));}}else{_0x5eadc6(parseEmail(_0x22d82e,_0x2bfeb5,_0x1cd1a4));}};exports[_0x71c3('0x42')]=function(_0x525d49,_0x53182f){var _0x4afc62=[_0x71c3('0x43')+(_0x53182f||''),'auth=Bearer\x20'+_0x525d49,'',''];return Buffer[_0x71c3('0x3f')](_0x4afc62[_0x71c3('0xc')](''),_0x71c3('0x44'))[_0x71c3('0x45')](_0x71c3('0x46'));}; \ No newline at end of file +var _0xa2ed=['../../../config/environment','head','address','@xcally.com','value','name','substring','indexOf','split','slice','join','Anonymous','pop','length','isEmpty','anonymous','generate','html','test','includes','attachments','forEach','push','filename','replace','_SRC','_IMG','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email'];(function(_0x338813,_0x25b2fa){var _0x468faa=function(_0x510805){while(--_0x510805){_0x338813['push'](_0x338813['shift']());}};_0x468faa(++_0x25b2fa);}(_0xa2ed,0x95));var _0xda2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2ed[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xda2e('0x0'));var moment=require(_0xda2e('0x1'));var random=require(_0xda2e('0x2'));var fs=require('fs');var path=require(_0xda2e('0x3'));var util=require('util');var tnef=require(_0xda2e('0x4'));var logger=require(_0xda2e('0x5'))(_0xda2e('0x6'));var config=require(_0xda2e('0x7'));function getAddress(_0x2c9fe9){var _0x6c5fd3=_[_0xda2e('0x8')](_0x2c9fe9['value']);return _0x6c5fd3&&_0x6c5fd3[_0xda2e('0x9')]?_0x6c5fd3[_0xda2e('0x9')]:'anonymous'+random['generate'](0x6)+_0xda2e('0xa');}function getFirstName(_0x479f5f){var _0xf53838=_[_0xda2e('0x8')](_0x479f5f[_0xda2e('0xb')]);if(_0xf53838&&_0xf53838[_0xda2e('0xc')]){if(_0xf53838[_0xda2e('0xc')]==_0xf53838[_0xda2e('0x9')]){return _0xf53838['name'][_0xda2e('0xd')](0x0,_0xf53838['name'][_0xda2e('0xe')]('@'));}var _0x4e4bb2=_0xf53838[_0xda2e('0xc')][_0xda2e('0xf')](/\s+/);return _0x4e4bb2['length']>0x1?_0x4e4bb2[_0xda2e('0x10')](0x0,-0x1)[_0xda2e('0x11')]('\x20'):_0xf53838[_0xda2e('0xc')];}return _0xda2e('0x12');}function getLastName(_0x151d05){var _0x4fd581=_['head'](_0x151d05[_0xda2e('0xb')]);if(_0x4fd581&&_0x4fd581[_0xda2e('0xc')]){var _0x3277e1=_0x4fd581[_0xda2e('0xc')]['split'](/\s+/);return _0x3277e1['length']>0x1?_0x3277e1[_0xda2e('0x13')]():'';}return'';}function getMails(_0x18df3b,_0x2ed212){var _0x53307c='';for(var _0x2d4978=0x0;_0x2d4978<_0x2ed212[_0xda2e('0xb')][_0xda2e('0x14')];_0x2d4978+=0x1){if(_0x2ed212[_0xda2e('0xb')][_0x2d4978][_0xda2e('0x9')]!==_0x18df3b){if(!_[_0xda2e('0x15')](_0x53307c)){_0x53307c+=',';}_0x53307c+=_0x2ed212[_0xda2e('0xb')][_0x2d4978][_0xda2e('0xc')]||_0x2ed212['value'][_0x2d4978][_0xda2e('0x9')]||'';_0x53307c+='\x20<';_0x53307c+=_0x2ed212['value'][_0x2d4978][_0xda2e('0x9')]?_0x2ed212['value'][_0x2d4978][_0xda2e('0x9')]:_0xda2e('0x16')+random[_0xda2e('0x17')](0x6)+_0xda2e('0xa');_0x53307c+='>';}}return _0x53307c;}function parseEmail(_0x4ac7e8,_0x239fc6,_0x1c95e7){if(_0x239fc6[_0xda2e('0x18')]){var _0x18b760=/)<[^<]*)*<\/script>/gi;while(_0x18b760[_0xda2e('0x19')](_0x239fc6[_0xda2e('0x18')])){_0x239fc6[_0xda2e('0x18')]=_0x239fc6[_0xda2e('0x18')]['replace'](_0x18b760,'');}if(_0x239fc6[_0xda2e('0x18')][_0xda2e('0x1a')]('{_0x5dd21a[_0xda2e('0x1d')](_0x1de78f[_0xda2e('0x1e')]);});var _0x5e37dd=/]+>/g;var _0x100365=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1ad5c3=_0x239fc6[_0xda2e('0x18')][_0xda2e('0x1f')](_0x100365,_0xda2e('0x20'));var _0x2c365d=_0x1ad5c3['replace'](_0x5e37dd,_0xda2e('0x21'));for(let _0x196fd4=0x0;_0x196fd4<_0x5dd21a[_0xda2e('0x14')];_0x196fd4++){var _0x3f009c=_0x2c365d[_0xda2e('0x1f')](_0xda2e('0x21'),'\x20[Attachment:\x20'+_0x5dd21a[_0x196fd4]+_0xda2e('0x22'));_0x2c365d=_0x3f009c;}_0x239fc6[_0xda2e('0x18')]=_0x2c365d;}_0x1c95e7[_0xda2e('0x23')]=_0x239fc6[_0xda2e('0x18')];}else{_0x1c95e7[_0xda2e('0x23')]=_0x239fc6[_0xda2e('0x24')];}if(_0x1c95e7[_0xda2e('0x23')]){_0x1c95e7[_0xda2e('0x23')]=_0x1c95e7[_0xda2e('0x23')]['replace'](/0x0){var _0x3c1d5b=[_0xda2e('0x34'),_0xda2e('0x35'),_0xda2e('0x36')];for(var _0x5c3538=0x0;_0x5c3538<_0x239fc6[_0xda2e('0x33')]['length'];_0x5c3538++){var _0x44b2d6=_['indexOf'](_0x3c1d5b,_0x239fc6[_0xda2e('0x33')][_0x5c3538][_0xda2e('0x37')]);if(_0x44b2d6>=0x0){_0x1c95e7[_0xda2e('0x38')]=!![];}}}return _0x1c95e7;}exports[_0xda2e('0x39')]=function(_0x4bc664,_0x13130c,_0x1778c1){var _0x48e7d1={'from':getAddress(_0x13130c[_0xda2e('0x3a')]),'firstName':getFirstName(_0x13130c[_0xda2e('0x3a')]),'lastName':getLastName(_0x13130c[_0xda2e('0x3a')]),'mapKey':'email','message':{'from':getMails(_0x4bc664[_0xda2e('0x6')],_0x13130c[_0xda2e('0x3a')]),'to':_0x4bc664[_0xda2e('0x6')],'cc':'','subject':_0x13130c[_0xda2e('0x3b')]||'','messageId':_0x13130c[_0xda2e('0x3c')],'inReplyTo':_0x13130c['inReplyTo'],'sentAt':moment(_0x13130c[_0xda2e('0x3d')])[_0xda2e('0x3e')](_0xda2e('0x3f')),'attach':![],'attachments':[]}};if(!_0x13130c[_0xda2e('0x18')]&&!_0x13130c[_0xda2e('0x24')]){var _0x4ad747=_[_0xda2e('0x40')](_0x13130c[_0xda2e('0x1b')],{'contentType':'application/ms-tnef'});if(_0x4ad747[_0xda2e('0x14')]){logger[_0xda2e('0x41')](util[_0xda2e('0x3e')](_0xda2e('0x42'),_0x13130c[_0xda2e('0x3c')]));tnef[_0xda2e('0x43')](_[_0xda2e('0x44')](_0x4ad747)[_0xda2e('0x31')],function(_0x570f83,_0x46fcf4){if(_0x46fcf4){_0x13130c[_0xda2e('0x18')]=_0x46fcf4[_0xda2e('0x45')]||_0xda2e('0x46');if(_0x46fcf4[_0xda2e('0x47')]){for(var _0x52e48e=0x0;_0x52e48e<_0x46fcf4[_0xda2e('0x47')]['length'];_0x52e48e++){var _0x16fc96=_0x46fcf4['Attachments'][_0x52e48e];_0x48e7d1[_0xda2e('0x26')][_0xda2e('0x1b')]['push']({'filename':_0x16fc96[_0xda2e('0x48')],'content':Buffer[_0xda2e('0x3a')](_0x16fc96['Data'])});}}}_0x1778c1(parseEmail(_0x4bc664,_0x13130c,_0x48e7d1));});}else{_0x13130c[_0xda2e('0x18')]=_0xda2e('0x46');_0x1778c1(parseEmail(_0x4bc664,_0x13130c,_0x48e7d1));}}else{_0x1778c1(parseEmail(_0x4bc664,_0x13130c,_0x48e7d1));}};exports[_0xda2e('0x49')]=function(_0x1aa192,_0x16b924){var _0xf5d54b=[_0xda2e('0x4a')+(_0x16b924||''),_0xda2e('0x4b')+_0x1aa192,'',''];return Buffer[_0xda2e('0x3a')](_0xf5d54b[_0xda2e('0x11')](''),_0xda2e('0x4c'))[_0xda2e('0x4d')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 91f9d2e..9205355 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 _0x1bd4=['key','active','Imap','Smtp','exports','name','Service'];(function(_0x1b96c6,_0x45e55a){var _0x4a20fa=function(_0x2b6da4){while(--_0x2b6da4){_0x1b96c6['push'](_0x1b96c6['shift']());}};_0x4a20fa(++_0x45e55a);}(_0x1bd4,0x132));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');function MailAccount(_0x52c591){this['id']=_0x52c591['id']||0x0;this[_0x41bd('0x0')]=_0x52c591['name']||_0x41bd('0x1');this[_0x41bd('0x2')]=_0x52c591[_0x41bd('0x2')]||'SERV';this[_0x41bd('0x3')]=_0x52c591[_0x41bd('0x3')]||![];this[_0x41bd('0x4')]=_0x52c591[_0x41bd('0x4')]||[];this[_0x41bd('0x5')]=_0x52c591[_0x41bd('0x5')]||[];}module[_0x41bd('0x6')]=MailAccount; \ No newline at end of file +var _0xca94=['key','active','Imap','Smtp','exports','lodash','Service'];(function(_0x4728c9,_0x33eb45){var _0xbef55f=function(_0x59dfd4){while(--_0x59dfd4){_0x4728c9['push'](_0x4728c9['shift']());}};_0xbef55f(++_0x33eb45);}(_0xca94,0x116));var _0x4ca9=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0xca94[_0x1064bc];return _0x5edc45;};'use strict';var _=require(_0x4ca9('0x0'));function MailAccount(_0x145d9a){this['id']=_0x145d9a['id']||0x0;this['name']=_0x145d9a['name']||_0x4ca9('0x1');this['key']=_0x145d9a[_0x4ca9('0x2')]||'SERV';this[_0x4ca9('0x3')]=_0x145d9a['active']||![];this[_0x4ca9('0x4')]=_0x145d9a[_0x4ca9('0x4')]||[];this[_0x4ca9('0x5')]=_0x145d9a[_0x4ca9('0x5')]||[];}module[_0x4ca9('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 560f057..f2bc1b4 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 _0x0e8a=['mailAccounts','prototype','hasOwnProperty','initMailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x5f2a3d,_0x5c2fa0){var _0x127146=function(_0x3559bb){while(--_0x3559bb){_0x5f2a3d['push'](_0x5f2a3d['shift']());}};_0x127146(++_0x5c2fa0);}(_0x0e8a,0x1ae));var _0xa0e8=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0x0e8a[_0x57e00e];return _0x415e60;};'use strict';var _=require(_0xa0e8('0x0'));var MailAccount=require(_0xa0e8('0x1'));var Realtime=function(){this[_0xa0e8('0x2')]={};};function freeIsNotKey(_0x207a14,_0x1b0aa3,_0x4cca15){var _0x984745=_['mapKeys'](_0x207a14,function(_0x46fe35,_0x2fe96b){return _0x46fe35[_0x4cca15];});for(var _0x1c2abf in _0x1b0aa3){if(_0x1b0aa3['hasOwnProperty'](_0x1c2abf)){if(!_0x984745[_0x1c2abf]){delete _0x1b0aa3[_0x1c2abf];}}}}Realtime[_0xa0e8('0x3')]['mergeFromDatabase']=function(_0x410e3f,_0x5f556a){for(var _0x318cc2 in _0x5f556a){if(_0x410e3f[_0xa0e8('0x4')](_0x318cc2)){_0x410e3f[_0x318cc2]=_0x5f556a[_0x318cc2];}}};Realtime[_0xa0e8('0x3')][_0xa0e8('0x5')]=function(){var _0x4ac2c0=this;return function(_0x8570e9){if(_0x8570e9){freeIsNotKey(_0x8570e9,_0x4ac2c0['mailAccounts'],'id');for(var _0x22c9f8=0x0,_0x346eb8={},_0x19266e={};_0x22c9f8<_0x8570e9['length'];_0x22c9f8+=0x1){_0x346eb8=_0x8570e9[_0x22c9f8];if(_[_0xa0e8('0x6')](_0x4ac2c0[_0xa0e8('0x2')][_0x346eb8['id']])){_0x4ac2c0[_0xa0e8('0x2')][_0x346eb8['id']]=new MailAccount(_0x346eb8);}else{_[_0xa0e8('0x7')](_0x4ac2c0['mailAccounts'][_0x346eb8['id']],_0x346eb8);}}}return _0x4ac2c0[_0xa0e8('0x2')];};};module[_0xa0e8('0x8')]=Realtime; \ No newline at end of file +var _0x3ac1=['hasOwnProperty','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0x3ac1,0x7c));var _0x13ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x13ac('0x0'));var MailAccount=require(_0x13ac('0x1'));var Realtime=function(){this[_0x13ac('0x2')]={};};function freeIsNotKey(_0x3456e4,_0x6cc93d,_0x545d2e){var _0x1822c3=_[_0x13ac('0x3')](_0x3456e4,function(_0x398557,_0x4a1a11){return _0x398557[_0x545d2e];});for(var _0x1bcd82 in _0x6cc93d){if(_0x6cc93d['hasOwnProperty'](_0x1bcd82)){if(!_0x1822c3[_0x1bcd82]){delete _0x6cc93d[_0x1bcd82];}}}}Realtime[_0x13ac('0x4')][_0x13ac('0x5')]=function(_0x50da8f,_0x27fd39){for(var _0x324c0c in _0x27fd39){if(_0x50da8f[_0x13ac('0x6')](_0x324c0c)){_0x50da8f[_0x324c0c]=_0x27fd39[_0x324c0c];}}};Realtime[_0x13ac('0x4')]['initMailAccounts']=function(){var _0xbb9ed5=this;return function(_0x23ca58){if(_0x23ca58){freeIsNotKey(_0x23ca58,_0xbb9ed5[_0x13ac('0x2')],'id');for(var _0x4a022c=0x0,_0x3612d1={},_0x75f628={};_0x4a022c<_0x23ca58['length'];_0x4a022c+=0x1){_0x3612d1=_0x23ca58[_0x4a022c];if(_[_0x13ac('0x7')](_0xbb9ed5[_0x13ac('0x2')][_0x3612d1['id']])){_0xbb9ed5['mailAccounts'][_0x3612d1['id']]=new MailAccount(_0x3612d1);}else{_[_0x13ac('0x8')](_0xbb9ed5[_0x13ac('0x2')][_0x3612d1['id']],_0x3612d1);}}}return _0xbb9ed5[_0x13ac('0x2')];};};module[_0x13ac('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 28115c6..6e2cc7e 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 _0x544f=['key','TemplateId','MailServerIn','service','type','data5','MailServerOut','Smtp','CloudProvider','getMailAccount','notify','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','name','provider','email','active'];(function(_0x2fc2ca,_0x5a2b12){var _0x39b5ea=function(_0x40b734){while(--_0x40b734){_0x2fc2ca['push'](_0x2fc2ca['shift']());}};_0x39b5ea(++_0x5a2b12);}(_0x544f,0x104));var _0xf544=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x544f[_0x39e283];return _0x7de89f;};'use strict';var client=require('../client');exports[_0xf544('0x0')]=function(){return function(){return client['Request'](_0xf544('0x1'),{'options':{'attributes':['id',_0xf544('0x2'),_0xf544('0x3'),'service',_0xf544('0x4'),_0xf544('0x5'),_0xf544('0x6'),'ListId',_0xf544('0x7')],'raw':![],'include':[{'model':_0xf544('0x8'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id','name',_0xf544('0x9'),_0xf544('0xa'),_0xf544('0xb')],'as':'CloudProvider'}]},{'model':_0xf544('0xc'),'as':_0xf544('0xd'),'include':[{'model':_0xf544('0xe'),'attributes':['id',_0xf544('0x2'),_0xf544('0x9'),_0xf544('0xa'),_0xf544('0xb')],'as':_0xf544('0xe')}]}]},'log':_0xf544('0xf')});};};exports[_0xf544('0x10')]=function(_0x262b2c,_0x27240f){return client[_0xf544('0x11')](_0xf544('0x12'),{'account':{'id':_0x262b2c},'body':_0x27240f,'log':_0xf544('0x12')});}; \ No newline at end of file +var _0xf435=['ListId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','email','active','key'];(function(_0x4a7893,_0x15f933){var _0x47271e=function(_0x4e7e9e){while(--_0x4e7e9e){_0x4a7893['push'](_0x4a7893['shift']());}};_0x47271e(++_0x15f933);}(_0xf435,0x174));var _0x5f43=function(_0x585572,_0x3a3d4f){_0x585572=_0x585572-0x0;var _0x94a2a3=_0xf435[_0x585572];return _0x94a2a3;};'use strict';var client=require('../client');exports[_0x5f43('0x0')]=function(){return function(){return client[_0x5f43('0x1')](_0x5f43('0x2'),{'options':{'attributes':['id',_0x5f43('0x3'),_0x5f43('0x4'),'service',_0x5f43('0x5'),_0x5f43('0x6'),_0x5f43('0x7'),_0x5f43('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x5f43('0x9'),'as':_0x5f43('0xa'),'include':[{'model':_0x5f43('0xb'),'attributes':['id','name',_0x5f43('0xc'),_0x5f43('0xd'),_0x5f43('0xe')],'as':_0x5f43('0xb')}]},{'model':_0x5f43('0xf'),'as':_0x5f43('0x10'),'include':[{'model':_0x5f43('0xb'),'attributes':['id',_0x5f43('0x3'),_0x5f43('0xc'),_0x5f43('0xd'),_0x5f43('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x5f43('0x11')]=function(_0x43627f,_0x46a927){return client[_0x5f43('0x1')](_0x5f43('0x12'),{'account':{'id':_0x43627f},'body':_0x46a927,'log':_0x5f43('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4271de9..bcae0b7 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 _0x1646=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x1646,0xd8));var _0x6164=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x1646[_0x593d89];return _0x4aa403;};'use strict';var client=require(_0x6164('0x0'));exports[_0x6164('0x1')]=function(){return client[_0x6164('0x2')](_0x6164('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x6164('0x4')});}; \ No newline at end of file +var _0xce19=['../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x44ccea,_0xc92a33){var _0x5b15e2=function(_0x1f5c5b){while(--_0x1f5c5b){_0x44ccea['push'](_0x44ccea['shift']());}};_0x5b15e2(++_0xc92a33);}(_0xce19,0x6e));var _0x9ce1=function(_0x359759,_0x5cba87){_0x359759=_0x359759-0x0;var _0x1237bb=_0xce19[_0x359759];return _0x1237bb;};'use strict';var client=require(_0x9ce1('0x0'));exports[_0x9ce1('0x1')]=function(){return client[_0x9ce1('0x2')](_0x9ce1('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9ce1('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index f274fac..c86fe7b 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +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(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 0603934..4b5080e 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 _0xd1ae=['exports','lodash','express','sticky-session','ioredis','../../config/environment','socket.io','websocket','polling','redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','port'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1ae,0x94));var _0xed1a=function(_0x3bf307,_0xa227e8){_0x3bf307=_0x3bf307-0x0;var _0x183eeb=_0xd1ae[_0x3bf307];return _0x183eeb;};'use strict';var _=require(_0xed1a('0x0'));var http=require('http');var express=require(_0xed1a('0x1'));var sticky=require(_0xed1a('0x2'));var Redis=require(_0xed1a('0x3'));var config=require(_0xed1a('0x4'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xed1a('0x5'))(server,{'transports':[_0xed1a('0x6'),_0xed1a('0x7')]});config[_0xed1a('0x8')]=_['defaults'](config[_0xed1a('0x8')],{'host':'localhost','port':0x18eb});socketio[_0xed1a('0x9')](require(_0xed1a('0xa'))({'pubClient':new Redis(config[_0xed1a('0x8')]),'subClient':new Redis(config[_0xed1a('0x8')])}));require(_0xed1a('0xb'))[_0xed1a('0xc')]();require(_0xed1a('0xd'))['default'](socketio);require(_0xed1a('0xe'))[_0xed1a('0xc')](app);require(_0xed1a('0xf'))['default'](app);}else{server[_0xed1a('0x10')](_0xed1a('0x11'),function(){console[_0xed1a('0x12')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xed1a('0x13')]);});}exports=module[_0xed1a('0x14')]=app; \ No newline at end of file +var _0x71d2=['adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','../../config/environment','createServer','socket.io','websocket','polling','redis','defaults'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x71d2,0x182));var _0x271d=function(_0x376f8f,_0x4966f9){_0x376f8f=_0x376f8f-0x0;var _0x8f5985=_0x71d2[_0x376f8f];return _0x8f5985;};'use strict';var _=require(_0x271d('0x0'));var http=require('http');var express=require(_0x271d('0x1'));var sticky=require(_0x271d('0x2'));var Redis=require('ioredis');var config=require(_0x271d('0x3'));var app=express();var server=http[_0x271d('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x271d('0x5'))(server,{'transports':[_0x271d('0x6'),_0x271d('0x7')]});config[_0x271d('0x8')]=_[_0x271d('0x9')](config[_0x271d('0x8')],{'host':'localhost','port':0x18eb});socketio[_0x271d('0xa')](require(_0x271d('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x271d('0x8')])}));require(_0x271d('0xc'))[_0x271d('0xd')]();require(_0x271d('0xe'))[_0x271d('0xd')](socketio);require('../../config/express')['default'](app);require(_0x271d('0xf'))['default'](app);}else{server[_0x271d('0x10')](_0x271d('0x11'),function(){console[_0x271d('0x12')](_0x271d('0x13'),config[_0x271d('0x14')]);});}exports=module[_0x271d('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index c9eefed..7b159c6 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 _0x9f91=['exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','error','rpc','message','catch'];(function(_0xf43cb,_0x465374){var _0x14e869=function(_0x454719){while(--_0x454719){_0xf43cb['push'](_0xf43cb['shift']());}};_0x14e869(++_0x465374);}(_0x9f91,0x115));var _0x19f9=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x9f91[_0x166e96];return _0x553d73;};'use strict';var jayson=require(_0x19f9('0x0'));var BPromise=require(_0x19f9('0x1'));var logger=require(_0x19f9('0x2'))(_0x19f9('0x3'));var client=jayson[_0x19f9('0x4')]['http']({'port':0x2329});client[_0x19f9('0x5')]=function(_0x2b6ffd,_0x5f3f6a){return new BPromise(function(_0x29aa39,_0x795d10){return client[_0x19f9('0x6')](_0x2b6ffd,_0x5f3f6a)['then'](function(_0x334152){logger['debug']('rpc',_0x19f9('0x3'),_0x2b6ffd,_0x5f3f6a,_0x334152);if(_0x334152[_0x19f9('0x7')]){logger[_0x19f9('0x7')](_0x19f9('0x8'),_0x19f9('0x3'),_0x2b6ffd,_0x334152[_0x19f9('0x7')][_0x19f9('0x9')],_0x5f3f6a);return _0x795d10(_0x334152[_0x19f9('0x7')]['message']);}else{return _0x29aa39(_0x334152['result']);}})[_0x19f9('0xa')](function(_0x505535){logger[_0x19f9('0x7')](_0x19f9('0x8'),_0x19f9('0x3'),_0x2b6ffd,_0x505535,_0x5f3f6a);return _0x795d10(_0x505535);});});};module[_0x19f9('0xb')]=client; \ No newline at end of file +var _0x052d=['Request','request','then','error','message','catch','rpc','exports','bluebird','routing','client','http'];(function(_0x145635,_0x315064){var _0x26b640=function(_0x50d3d8){while(--_0x50d3d8){_0x145635['push'](_0x145635['shift']());}};_0x26b640(++_0x315064);}(_0x052d,0x1d0));var _0xd052=function(_0x5d3c1f,_0x3351f6){_0x5d3c1f=_0x5d3c1f-0x0;var _0x1f366f=_0x052d[_0x5d3c1f];return _0x1f366f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xd052('0x0'));var logger=require('../../config/logger')(_0xd052('0x1'));var client=jayson[_0xd052('0x2')][_0xd052('0x3')]({'port':0x2329});client[_0xd052('0x4')]=function(_0x2cc50d,_0x36eaa7){return new BPromise(function(_0x5dd4bc,_0x1ce706){return client[_0xd052('0x5')](_0x2cc50d,_0x36eaa7)[_0xd052('0x6')](function(_0x5c66ca){logger['debug']('rpc',_0xd052('0x1'),_0x2cc50d,_0x36eaa7,_0x5c66ca);if(_0x5c66ca['error']){logger[_0xd052('0x7')]('rpc','routing',_0x2cc50d,_0x5c66ca['error'][_0xd052('0x8')],_0x36eaa7);return _0x1ce706(_0x5c66ca[_0xd052('0x7')]['message']);}else{return _0x5dd4bc(_0x5c66ca['result']);}})[_0xd052('0x9')](function(_0x1392b0){logger[_0xd052('0x7')](_0xd052('0xa'),_0xd052('0x1'),_0x2cc50d,_0x1392b0,_0x36eaa7);return _0x1ce706(_0x1392b0);});});};module[_0xd052('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 239d5ad..49d79d8 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 _0xdfea=['getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x23a7b3,_0x52b39b){var _0x4e3bd2=function(_0x540d55){while(--_0x540d55){_0x23a7b3['push'](_0x23a7b3['shift']());}};_0x4e3bd2(++_0x52b39b);}(_0xdfea,0x71));var _0xadfe=function(_0x168d80,_0x39e2ca){_0x168d80=_0x168d80-0x0;var _0x1fd38c=_0xdfea[_0x168d80];return _0x1fd38c;};'use strict';var BPromise=require('bluebird');var server=require(_0xadfe('0x0'));var Realtime=require(_0xadfe('0x1'));var user=require(_0xadfe('0x2'));var interval=require(_0xadfe('0x3'));var openchannelQueue=require(_0xadfe('0x4'));var chatQueue=require(_0xadfe('0x5'));var smsQueue=require(_0xadfe('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xadfe('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xadfe('0x8')]()[_0xadfe('0x9')](user[_0xadfe('0xa')]())[_0xadfe('0x9')](realtime[_0xadfe('0xb')]())[_0xadfe('0x9')](interval[_0xadfe('0xc')]())['then'](realtime[_0xadfe('0xd')]())[_0xadfe('0x9')](openchannelQueue[_0xadfe('0xe')]())[_0xadfe('0x9')](realtime['initOpenchannelQueues']())[_0xadfe('0x9')](chatQueue[_0xadfe('0xf')]())[_0xadfe('0x9')](realtime[_0xadfe('0x10')]())[_0xadfe('0x9')](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0xadfe('0x9')](mailQueue[_0xadfe('0x11')]())[_0xadfe('0x9')](realtime[_0xadfe('0x12')]())[_0xadfe('0x9')](faxQueue[_0xadfe('0x13')]())[_0xadfe('0x9')](realtime[_0xadfe('0x14')]())[_0xadfe('0x9')](whatsappQueue[_0xadfe('0x15')]())['then'](realtime[_0xadfe('0x16')]())[_0xadfe('0x9')](function(){return realtime;});}function main(){return server[_0xadfe('0x17')](realtime)[_0xadfe('0x9')](function(_0x4f2351){return initRealtime();})[_0xadfe('0x9')](function(_0x38ca94){return setInterval(initRealtime,0x1388);})[_0xadfe('0x18')](function(_0x1b622b){console[_0xadfe('0x19')](_0x1b622b);});}main(); \ No newline at end of file +var _0x3561=['getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x3561,0x9d));var _0x1356=function(_0x5e484b,_0x4bedac){_0x5e484b=_0x5e484b-0x0;var _0x226773=_0x3561[_0x5e484b];return _0x226773;};'use strict';var BPromise=require(_0x1356('0x0'));var server=require(_0x1356('0x1'));var Realtime=require(_0x1356('0x2'));var user=require(_0x1356('0x3'));var interval=require(_0x1356('0x4'));var openchannelQueue=require(_0x1356('0x5'));var chatQueue=require(_0x1356('0x6'));var smsQueue=require(_0x1356('0x7'));var mailQueue=require(_0x1356('0x8'));var faxQueue=require(_0x1356('0x9'));var whatsappQueue=require(_0x1356('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1356('0xb')]()[_0x1356('0xc')](user['getAgents']())['then'](realtime[_0x1356('0xd')]())[_0x1356('0xc')](interval[_0x1356('0xe')]())[_0x1356('0xc')](realtime[_0x1356('0xf')]())[_0x1356('0xc')](openchannelQueue[_0x1356('0x10')]())[_0x1356('0xc')](realtime['initOpenchannelQueues']())[_0x1356('0xc')](chatQueue[_0x1356('0x11')]())[_0x1356('0xc')](realtime['initChatQueues']())['then'](smsQueue[_0x1356('0x12')]())[_0x1356('0xc')](realtime[_0x1356('0x13')]())['then'](mailQueue['getMailQueues']())[_0x1356('0xc')](realtime[_0x1356('0x14')]())['then'](faxQueue[_0x1356('0x15')]())['then'](realtime[_0x1356('0x16')]())[_0x1356('0xc')](whatsappQueue['getWhatsappQueues']())[_0x1356('0xc')](realtime[_0x1356('0x17')]())[_0x1356('0xc')](function(){return realtime;});}function main(){return server[_0x1356('0x18')](realtime)[_0x1356('0xc')](function(_0x468943){return initRealtime();})[_0x1356('0xc')](function(_0x53de18){return setInterval(initRealtime,0x1388);})['catch'](function(_0x415d8e){console['log'](_0x415d8e);});}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 af578a7..183a89c 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x183459,_0x473ebc){var _0x59fff1=function(_0x21edda){while(--_0x21edda){_0x183459['push'](_0x183459['shift']());}};_0x59fff1(++_0x473ebc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x17dd1d,_0x31f1b5){var _0x5e9d0c=function(_0x2a4c95){while(--_0x2a4c95){_0x17dd1d['push'](_0x17dd1d['shift']());}};_0x5e9d0c(++_0x31f1b5);}(_0x326f,0xd1));var _0xf326=function(_0x1ec907,_0x22d0b6){_0x1ec907=_0x1ec907-0x0;var _0x4caa10=_0x326f[_0x1ec907];return _0x4caa10;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};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 3564587..baa3970 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 _0xbfa4=['result','catch','sendMailMessage','SendMail','bluebird','request','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfa4,0x104));var _0x4bfa=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xbfa4[_0x1ac120];return _0x19b703;};'use strict';var BPromise=require(_0x4bfa('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x22edb4,_0x46afe1){return new BPromise(function(_0xcdafb3,_0x22a39e){return client[_0x4bfa('0x1')](_0x22edb4,_0x46afe1)[_0x4bfa('0x2')](function(_0x7d7dc2){if(_0x7d7dc2[_0x4bfa('0x3')]){return _0x22a39e(_0x7d7dc2[_0x4bfa('0x3')]['message']);}else{return _0xcdafb3(_0x7d7dc2[_0x4bfa('0x4')]);}})[_0x4bfa('0x5')](function(_0x581cd2){return _0x22a39e(_0x581cd2);});});}exports[_0x4bfa('0x6')]=function(_0x16ed2d,_0x58ae36){return request(_0x4bfa('0x7'),{'account':_0x16ed2d,'message':_0x58ae36});}; \ No newline at end of file +var _0x223c=['result','catch','SendMail','client','http','request','then','error'];(function(_0x47dce9,_0x3216f9){var _0x2e9c72=function(_0x1d075d){while(--_0x1d075d){_0x47dce9['push'](_0x47dce9['shift']());}};_0x2e9c72(++_0x3216f9);}(_0x223c,0x153));var _0xc223=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x223c[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xc223('0x0')][_0xc223('0x1')]({'port':0x232b});function request(_0xb32842,_0x1fc60c){return new BPromise(function(_0x2cde0f,_0xedbcd8){return client[_0xc223('0x2')](_0xb32842,_0x1fc60c)[_0xc223('0x3')](function(_0x222f55){if(_0x222f55[_0xc223('0x4')]){return _0xedbcd8(_0x222f55['error']['message']);}else{return _0x2cde0f(_0x222f55[_0xc223('0x5')]);}})[_0xc223('0x6')](function(_0x2a9ba7){return _0xedbcd8(_0x2a9ba7);});});}exports['sendMailMessage']=function(_0x31c27e,_0x365a6d){return request(_0xc223('0x7'),{'account':_0x31c27e,'message':_0x365a6d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ff49e84..b98efe7 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 _0x1a3f=['smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','updateRealtime','mail','chat','openchannel','Status','toNumber','format','mailStatusTime','faxStatusTime','whatsappStatusTime','openchannelCurrentCapacity','busyQueue','emit','user:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause'];(function(_0x2dd0c6,_0x536625){var _0xba55cd=function(_0x520177){while(--_0x520177){_0x2dd0c6['push'](_0x2dd0c6['shift']());}};_0xba55cd(++_0x536625);}(_0x1a3f,0x68));var _0xf1a3=function(_0x417f13,_0x1528d9){_0x417f13=_0x417f13-0x0;var _0x5b4d82=_0x1a3f[_0x417f13];return _0x5b4d82;};'use strict';var _=require(_0xf1a3('0x0'));var moment=require('moment');var md5=require(_0xf1a3('0x1'));var Redis=require(_0xf1a3('0x2'));var config=require(_0xf1a3('0x3'));config[_0xf1a3('0x4')]=_[_0xf1a3('0x5')](config[_0xf1a3('0x4')],{'host':_0xf1a3('0x6'),'port':0x18eb});var io=require(_0xf1a3('0x7'))(new Redis(config['redis']));function Agent(_0x122c82){this['id']=_0x122c82['id']||0x0;this[_0xf1a3('0x8')]=_0x122c82[_0xf1a3('0x8')]||'';this['online']=_0x122c82[_0xf1a3('0x9')]||!![];this['voicePause']=_0x122c82[_0xf1a3('0xa')]||![];this[_0xf1a3('0xb')]=_0x122c82['chatPause']||![];this[_0xf1a3('0xc')]=_0x122c82['mailPause']||![];this['faxPause']=_0x122c82[_0xf1a3('0xd')]||![];this[_0xf1a3('0xe')]=_0x122c82[_0xf1a3('0xe')]||![];this[_0xf1a3('0xf')]=_0x122c82[_0xf1a3('0xf')]||![];this[_0xf1a3('0x10')]=_0xf1a3('0x11');this[_0xf1a3('0x12')]=0x0;this[_0xf1a3('0x13')]=_0x122c82[_0xf1a3('0x13')]||0x0;this[_0xf1a3('0x14')]=0x0;this[_0xf1a3('0x15')]=_0xf1a3('0x11');this['mailStatusTime']=0x0;this[_0xf1a3('0x16')]=_0x122c82[_0xf1a3('0x16')]||0x0;this[_0xf1a3('0x17')]=0x0;this[_0xf1a3('0x18')]='unknown';this['faxStatusTime']=0x0;this[_0xf1a3('0x19')]=_0x122c82[_0xf1a3('0x19')]||0x0;this[_0xf1a3('0x1a')]=0x0;this[_0xf1a3('0x1b')]=_0xf1a3('0x11');this[_0xf1a3('0x1c')]=0x0;this['smsCapacity']=_0x122c82[_0xf1a3('0x1d')]||0x0;this[_0xf1a3('0x1e')]=0x0;this[_0xf1a3('0x1f')]=_0xf1a3('0x11');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x122c82[_0xf1a3('0x20')]||0x0;this[_0xf1a3('0x21')]=0x0;this[_0xf1a3('0x22')]=_0xf1a3('0x11');this[_0xf1a3('0x23')]=0x0;this[_0xf1a3('0x24')]=_0x122c82[_0xf1a3('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xf1a3('0x25')]=![];this['busyQueue']=undefined;this[_0xf1a3('0x1')]='';this['updateRealtime']();}Agent['prototype'][_0xf1a3('0x26')]=function(_0x565001){if(this[_0x565001+'CurrentCapacity']>0x0){if(this[_0x565001+_0xf1a3('0x27')]>0x0&&this[_0x565001+_0xf1a3('0x28')]>=this[_0x565001+_0xf1a3('0x27')]){return _0xf1a3('0x29');}else{return _0xf1a3('0x2a');}}else{return _0xf1a3('0x2b');}};Agent[_0xf1a3('0x2c')][_0xf1a3('0x2d')]=function(){var _0xb01039=[_0xf1a3('0x2e'),_0xf1a3('0x2f'),_0xf1a3('0x30'),'fax','sms','whatsapp'];for(var _0x465015=0x0;_0x465015<_0xb01039['length'];_0x465015+=0x1){var _0x2c2999=this[_0xf1a3('0x26')](_0xb01039[_0x465015]);if(this[_0xb01039[_0x465015]+_0xf1a3('0x31')]!==_0x2c2999){this[_0xb01039[_0x465015]+'StatusTime']=_[_0xf1a3('0x32')](moment()[_0xf1a3('0x33')]('x'));}this[_0xb01039[_0x465015]+_0xf1a3('0x31')]=_0x2c2999;}var _0x599ff9={'id':this['id'],'name':this[_0xf1a3('0x8')],'online':this[_0xf1a3('0x9')],'voicePause':this[_0xf1a3('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0xf1a3('0xc')],'smsPause':this[_0xf1a3('0xe')],'faxPause':this[_0xf1a3('0xd')],'openchannelPause':this[_0xf1a3('0xf')],'chatStatus':this[_0xf1a3('0x10')],'chatStatusTime':this[_0xf1a3('0x12')],'chatCapacity':this[_0xf1a3('0x13')],'chatCurrentCapacity':this[_0xf1a3('0x14')],'mailStatus':this[_0xf1a3('0x15')],'mailStatusTime':this[_0xf1a3('0x34')],'mailCapacity':this[_0xf1a3('0x16')],'mailCurrentCapacity':this[_0xf1a3('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf1a3('0x35')],'faxCapacity':this[_0xf1a3('0x19')],'faxCurrentCapacity':this[_0xf1a3('0x1a')],'smsStatus':this[_0xf1a3('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xf1a3('0x1d')],'smsCurrentCapacity':this[_0xf1a3('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xf1a3('0x36')],'whatsappCapacity':this[_0xf1a3('0x20')],'whatsappCurrentCapacity':this[_0xf1a3('0x21')],'openchannelStatus':this[_0xf1a3('0x22')],'openchannelStatusTime':this[_0xf1a3('0x23')],'openchannelCapacity':this[_0xf1a3('0x24')],'openchannelCurrentCapacity':this[_0xf1a3('0x37')],'busy':this[_0xf1a3('0x25')],'busyQueue':this[_0xf1a3('0x38')]};var _0x456196=md5(JSON['stringify'](_0x599ff9));if(this[_0xf1a3('0x1')]!==_0x456196){this[_0xf1a3('0x1')]=_0x456196;io[_0xf1a3('0x39')](_0xf1a3('0x3a'),_0x599ff9);}};module['exports']=Agent; \ No newline at end of file +var _0xe890=['user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','chatCapacity','mailCapacity','mailCurrentCapacity','emit'];(function(_0x4b4844,_0x2f0dfb){var _0x575192=function(_0x13ee1b){while(--_0x13ee1b){_0x4b4844['push'](_0x4b4844['shift']());}};_0x575192(++_0x2f0dfb);}(_0xe890,0x1a6));var _0x0e89=function(_0x504608,_0x466886){_0x504608=_0x504608-0x0;var _0x467e8e=_0xe890[_0x504608];return _0x467e8e;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x0e89('0x0'));var Redis=require(_0x0e89('0x1'));var config=require(_0x0e89('0x2'));config[_0x0e89('0x3')]=_[_0x0e89('0x4')](config[_0x0e89('0x3')],{'host':_0x0e89('0x5'),'port':0x18eb});var io=require(_0x0e89('0x6'))(new Redis(config[_0x0e89('0x3')]));function Agent(_0x361901){this['id']=_0x361901['id']||0x0;this['name']=_0x361901['name']||'';this[_0x0e89('0x7')]=_0x361901[_0x0e89('0x7')]||!![];this['voicePause']=_0x361901[_0x0e89('0x8')]||![];this[_0x0e89('0x9')]=_0x361901['chatPause']||![];this[_0x0e89('0xa')]=_0x361901[_0x0e89('0xa')]||![];this[_0x0e89('0xb')]=_0x361901[_0x0e89('0xb')]||![];this[_0x0e89('0xc')]=_0x361901[_0x0e89('0xc')]||![];this[_0x0e89('0xd')]=_0x361901[_0x0e89('0xd')]||![];this[_0x0e89('0xe')]='unknown';this['chatStatusTime']=0x0;this['chatCapacity']=_0x361901['chatCapacity']||0x0;this[_0x0e89('0xf')]=0x0;this[_0x0e89('0x10')]=_0x0e89('0x11');this[_0x0e89('0x12')]=0x0;this['mailCapacity']=_0x361901['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x0e89('0x13')]=_0x0e89('0x11');this[_0x0e89('0x14')]=0x0;this[_0x0e89('0x15')]=_0x361901[_0x0e89('0x15')]||0x0;this[_0x0e89('0x16')]=0x0;this[_0x0e89('0x17')]=_0x0e89('0x11');this[_0x0e89('0x18')]=0x0;this[_0x0e89('0x19')]=_0x361901[_0x0e89('0x19')]||0x0;this[_0x0e89('0x1a')]=0x0;this[_0x0e89('0x1b')]=_0x0e89('0x11');this[_0x0e89('0x1c')]=0x0;this[_0x0e89('0x1d')]=_0x361901[_0x0e89('0x1d')]||0x0;this[_0x0e89('0x1e')]=0x0;this[_0x0e89('0x1f')]=_0x0e89('0x11');this[_0x0e89('0x20')]=0x0;this['openchannelCapacity']=_0x361901[_0x0e89('0x21')]||0x0;this[_0x0e89('0x22')]=0x0;this[_0x0e89('0x23')]=![];this[_0x0e89('0x24')]=undefined;this[_0x0e89('0x0')]='';this[_0x0e89('0x25')]();}Agent[_0x0e89('0x26')][_0x0e89('0x27')]=function(_0x19ed04){if(this[_0x19ed04+_0x0e89('0x28')]>0x0){if(this[_0x19ed04+_0x0e89('0x29')]>0x0&&this[_0x19ed04+_0x0e89('0x28')]>=this[_0x19ed04+_0x0e89('0x29')]){return _0x0e89('0x2a');}else{return'working';}}else{return'idle';}};Agent['prototype'][_0x0e89('0x25')]=function(){var _0x8d02e2=[_0x0e89('0x2b'),_0x0e89('0x2c'),'openchannel',_0x0e89('0x2d'),_0x0e89('0x2e'),_0x0e89('0x2f')];for(var _0x4b6f00=0x0;_0x4b6f00<_0x8d02e2[_0x0e89('0x30')];_0x4b6f00+=0x1){var _0x589ed1=this[_0x0e89('0x27')](_0x8d02e2[_0x4b6f00]);if(this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x31')]!==_0x589ed1){this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x32')]=_[_0x0e89('0x33')](moment()[_0x0e89('0x34')]('x'));}this[_0x8d02e2[_0x4b6f00]+_0x0e89('0x31')]=_0x589ed1;}var _0x14a17c={'id':this['id'],'name':this['name'],'online':this[_0x0e89('0x7')],'voicePause':this[_0x0e89('0x8')],'chatPause':this[_0x0e89('0x9')],'mailPause':this[_0x0e89('0xa')],'smsPause':this[_0x0e89('0xc')],'faxPause':this[_0x0e89('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x0e89('0xe')],'chatStatusTime':this[_0x0e89('0x35')],'chatCapacity':this[_0x0e89('0x36')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x0e89('0x10')],'mailStatusTime':this[_0x0e89('0x12')],'mailCapacity':this[_0x0e89('0x37')],'mailCurrentCapacity':this[_0x0e89('0x38')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x0e89('0x14')],'faxCapacity':this[_0x0e89('0x15')],'faxCurrentCapacity':this[_0x0e89('0x16')],'smsStatus':this[_0x0e89('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x0e89('0x19')],'smsCurrentCapacity':this[_0x0e89('0x1a')],'whatsappStatus':this[_0x0e89('0x1b')],'whatsappStatusTime':this[_0x0e89('0x1c')],'whatsappCapacity':this[_0x0e89('0x1d')],'whatsappCurrentCapacity':this[_0x0e89('0x1e')],'openchannelStatus':this[_0x0e89('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x0e89('0x21')],'openchannelCurrentCapacity':this[_0x0e89('0x22')],'busy':this[_0x0e89('0x23')],'busyQueue':this[_0x0e89('0x24')]};var _0x34d17b=md5(JSON['stringify'](_0x14a17c));if(this[_0x0e89('0x0')]!==_0x34d17b){this[_0x0e89('0x0')]=_0x34d17b;io[_0x0e89('0x39')](_0x0e89('0x3a'),_0x14a17c);}};module[_0x0e89('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 1d9dd86..be0898e 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 _0x6a88=['chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','loggedIn','length','online','paused','available','format','chat:queue:%s'];(function(_0x36828e,_0x1e401c){var _0x129fe3=function(_0x43c656){while(--_0x43c656){_0x36828e['push'](_0x36828e['shift']());}};_0x129fe3(++_0x1e401c);}(_0x6a88,0xf5));var _0x86a8=function(_0x35268e,_0x4acfd1){_0x35268e=_0x35268e-0x0;var _0x28ba11=_0x6a88[_0x35268e];return _0x28ba11;};'use strict';var _=require(_0x86a8('0x0'));var md5=require(_0x86a8('0x1'));var util=require(_0x86a8('0x2'));var Redis=require(_0x86a8('0x3'));var config=require(_0x86a8('0x4'));config['redis']=_[_0x86a8('0x5')](config[_0x86a8('0x6')],{'host':_0x86a8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x1cc730){this['id']=_0x1cc730['id']||0x0;this[_0x86a8('0x8')]=_0x1cc730[_0x86a8('0x8')]||'';this[_0x86a8('0x9')]=_0x1cc730[_0x86a8('0x9')]||0xa;this[_0x86a8('0xa')]=_0x1cc730[_0x86a8('0xa')]||_0x86a8('0xb');this[_0x86a8('0xc')]=_0x1cc730[_0x86a8('0xc')];this[_0x86a8('0xd')]={};this[_0x86a8('0xe')]=0x0;this[_0x86a8('0x1')]='';this['updateRouting']();this[_0x86a8('0xf')]();}ChatQueue['prototype'][_0x86a8('0x10')]=function(){var _0x2b4eb3=this[_0x86a8('0xd')][_0x86a8('0x11')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x86a8('0xd')][_0x86a8('0x11')]=_0x2b4eb3;};ChatQueue['prototype'][_0x86a8('0xf')]=function(){this[_0x86a8('0x12')]=0x0;this['paused']=0x0;for(var _0x2093db=0x0;_0x2093db=0x0?this['available']:0x0;var _0x3dac2b={'id':this['id'],'available':this[_0x86a8('0x16')],'loggedIn':this[_0x86a8('0x12')],'name':this[_0x86a8('0x8')],'paused':this[_0x86a8('0x15')],'waiting':this['waiting']};var _0x1c42e7=md5(JSON['stringify'](_0x3dac2b));if(this['md5']!==_0x1c42e7){this['md5']=_0x1c42e7;io['to'](util[_0x86a8('0x17')](_0x86a8('0x18'),_0x3dac2b[_0x86a8('0x8')]))['emit'](_0x86a8('0x19'),_0x3dac2b);}};module[_0x86a8('0x1a')]=ChatQueue; \ No newline at end of file +var _0x487c=['prototype','_rr','map','length','online','chatPause','available','stringify','format','emit','chat_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x5e4836,_0x5d9116){var _0xfb7381=function(_0x3e770b){while(--_0x3e770b){_0x5e4836['push'](_0x5e4836['shift']());}};_0xfb7381(++_0x5d9116);}(_0x487c,0xff));var _0xc487=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x487c[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0xc487('0x0'));var md5=require(_0xc487('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xc487('0x2'));config['redis']=_[_0xc487('0x3')](config[_0xc487('0x4')],{'host':_0xc487('0x5'),'port':0x18eb});var io=require(_0xc487('0x6'))(new Redis(config[_0xc487('0x4')]));function ChatQueue(_0x4d7d7a){this['id']=_0x4d7d7a['id']||0x0;this[_0xc487('0x7')]=_0x4d7d7a[_0xc487('0x7')]||'';this['timeout']=_0x4d7d7a['timeout']||0xa;this[_0xc487('0x8')]=_0x4d7d7a['strategy']||_0xc487('0x9');this['Agents']=_0x4d7d7a[_0xc487('0xa')];this[_0xc487('0xb')]={};this[_0xc487('0xc')]=0x0;this['md5']='';this[_0xc487('0xd')]();this[_0xc487('0xe')]();}ChatQueue[_0xc487('0xf')][_0xc487('0xd')]=function(){var _0x1c334c=this[_0xc487('0xb')][_0xc487('0x10')];this[_0xc487('0xb')]=_[_0xc487('0x11')](this[_0xc487('0xa')],'id');this[_0xc487('0xb')][_0xc487('0x10')]=_0x1c334c;};ChatQueue[_0xc487('0xf')][_0xc487('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xdbbc9b=0x0;_0xdbbc9b=0x0?this[_0xc487('0x15')]:0x0;var _0x5a4857={'id':this['id'],'available':this[_0xc487('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xc487('0xc')]};var _0x20e892=md5(JSON[_0xc487('0x16')](_0x5a4857));if(this[_0xc487('0x1')]!==_0x20e892){this['md5']=_0x20e892;io['to'](util[_0xc487('0x17')]('chat:queue:%s',_0x5a4857['name']))[_0xc487('0x18')](_0xc487('0x19'),_0x5a4857);}};module[_0xc487('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index bdf425d..3f902a9 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 _0xe320=['waiting','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','online','loggedIn','faxPause','available','name','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents'];(function(_0x13ab7f,_0x35c4f9){var _0x28c68e=function(_0x570aea){while(--_0x570aea){_0x13ab7f['push'](_0x13ab7f['shift']());}};_0x28c68e(++_0x35c4f9);}(_0xe320,0xf9));var _0x0e32=function(_0x1ce17a,_0x99b128){_0x1ce17a=_0x1ce17a-0x0;var _0x3f2c4d=_0xe320[_0x1ce17a];return _0x3f2c4d;};'use strict';var _=require(_0x0e32('0x0'));var md5=require(_0x0e32('0x1'));var util=require(_0x0e32('0x2'));var Redis=require(_0x0e32('0x3'));var config=require('../../../config/environment');config[_0x0e32('0x4')]=_[_0x0e32('0x5')](config[_0x0e32('0x4')],{'host':_0x0e32('0x6'),'port':0x18eb});var io=require(_0x0e32('0x7'))(new Redis(config['redis']));function FaxQueue(_0x51a0a4){this['id']=_0x51a0a4['id']||0x0;this['name']=_0x51a0a4['name']||'';this[_0x0e32('0x8')]=_0x51a0a4[_0x0e32('0x8')]||0xa;this[_0x0e32('0x9')]=_0x51a0a4[_0x0e32('0x9')]||_0x0e32('0xa');this[_0x0e32('0xb')]=_0x51a0a4[_0x0e32('0xb')];this['mapAgentsId']={};this[_0x0e32('0xc')]=0x0;this[_0x0e32('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x0e32('0xd')]['updateRouting']=function(){var _0x31c6a0=this[_0x0e32('0xe')][_0x0e32('0xf')];this[_0x0e32('0xe')]=_[_0x0e32('0x10')](this[_0x0e32('0xb')],'id');this[_0x0e32('0xe')][_0x0e32('0xf')]=_0x31c6a0;};FaxQueue[_0x0e32('0xd')][_0x0e32('0x11')]=function(){this['loggedIn']=0x0;this[_0x0e32('0x12')]=0x0;for(var _0x47108c=0x0;_0x47108c=0x0?this['available']:0x0;var _0x4fa44c={'id':this['id'],'available':this[_0x0e32('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x0e32('0x18')],'paused':this[_0x0e32('0x12')],'waiting':this[_0x0e32('0xc')]};var _0x1693b7=md5(JSON['stringify'](_0x4fa44c));if(this[_0x0e32('0x1')]!==_0x1693b7){this['md5']=_0x1693b7;io['to'](util[_0x0e32('0x19')](_0x0e32('0x1a'),_0x4fa44c[_0x0e32('0x18')]))[_0x0e32('0x1b')](_0x0e32('0x1c'),_0x4fa44c);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x904b=['map','loggedIn','paused','online','faxPause','available','stringify','format','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x5c944e,_0x3c7912){var _0x2b8c98=function(_0x59a6a7){while(--_0x59a6a7){_0x5c944e['push'](_0x5c944e['shift']());}};_0x2b8c98(++_0x3c7912);}(_0x904b,0x107));var _0xb904=function(_0x402594,_0x357ddf){_0x402594=_0x402594-0x0;var _0x22e0a9=_0x904b[_0x402594];return _0x22e0a9;};'use strict';var _=require(_0xb904('0x0'));var md5=require(_0xb904('0x1'));var util=require(_0xb904('0x2'));var Redis=require('ioredis');var config=require(_0xb904('0x3'));config['redis']=_[_0xb904('0x4')](config[_0xb904('0x5')],{'host':_0xb904('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb904('0x5')]));function FaxQueue(_0x244b4c){this['id']=_0x244b4c['id']||0x0;this['name']=_0x244b4c[_0xb904('0x7')]||'';this[_0xb904('0x8')]=_0x244b4c[_0xb904('0x8')]||0xa;this[_0xb904('0x9')]=_0x244b4c[_0xb904('0x9')]||'beepall';this[_0xb904('0xa')]=_0x244b4c[_0xb904('0xa')];this[_0xb904('0xb')]={};this[_0xb904('0xc')]=0x0;this[_0xb904('0x1')]='';this[_0xb904('0xd')]();this[_0xb904('0xe')]();}FaxQueue[_0xb904('0xf')][_0xb904('0xd')]=function(){var _0x617145=this[_0xb904('0xb')][_0xb904('0x10')];this[_0xb904('0xb')]=_[_0xb904('0x11')](this[_0xb904('0xa')],'id');this[_0xb904('0xb')][_0xb904('0x10')]=_0x617145;};FaxQueue[_0xb904('0xf')][_0xb904('0xe')]=function(){this[_0xb904('0x12')]=0x0;this[_0xb904('0x13')]=0x0;for(var _0x1b3da6=0x0;_0x1b3da6=0x0?this[_0xb904('0x16')]:0x0;var _0x2b0e2b={'id':this['id'],'available':this[_0xb904('0x16')],'loggedIn':this[_0xb904('0x12')],'name':this[_0xb904('0x7')],'paused':this['paused'],'waiting':this[_0xb904('0xc')]};var _0x5431df=md5(JSON[_0xb904('0x17')](_0x2b0e2b));if(this['md5']!==_0x5431df){this['md5']=_0x5431df;io['to'](util[_0xb904('0x18')]('fax:queue:%s',_0x2b0e2b[_0xb904('0x7')]))[_0xb904('0x19')](_0xb904('0x1a'),_0x2b0e2b);}};module[_0xb904('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9247f47..e61c05f 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 _0x2155=['Intervals','exports','name'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x2155,0x1a6));var _0x5215=function(_0xf85978,_0x52a3a4){_0xf85978=_0xf85978-0x0;var _0x27376e=_0x2155[_0xf85978];return _0x27376e;};'use strict';function Interval(_0x290243){this['id']=_0x290243['id']||0x0;this[_0x5215('0x0')]=_0x290243['name']||'';this['Intervals']=_0x290243[_0x5215('0x1')]||{};}module[_0x5215('0x2')]=Interval; \ No newline at end of file +var _0xfca6=['Intervals','exports','name'];(function(_0x221379,_0x5132a8){var _0x291609=function(_0x2f8857){while(--_0x2f8857){_0x221379['push'](_0x221379['shift']());}};_0x291609(++_0x5132a8);}(_0xfca6,0xa1));var _0x6fca=function(_0xbe6cf5,_0x4b0559){_0xbe6cf5=_0xbe6cf5-0x0;var _0x28c9f2=_0xfca6[_0xbe6cf5];return _0x28c9f2;};'use strict';function Interval(_0xf911bb){this['id']=_0xf911bb['id']||0x0;this[_0x6fca('0x0')]=_0xf911bb['name']||'';this[_0x6fca('0x1')]=_0xf911bb[_0x6fca('0x1')]||{};}module[_0x6fca('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index cf53c82..7829832 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 _0x94af=['emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','map','_rr','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format'];(function(_0x3224d9,_0x340d1e){var _0x2c6374=function(_0x3e4e2a){while(--_0x3e4e2a){_0x3224d9['push'](_0x3224d9['shift']());}};_0x2c6374(++_0x340d1e);}(_0x94af,0x198));var _0xf94a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x94af[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf94a('0x0'));var md5=require(_0xf94a('0x1'));var util=require(_0xf94a('0x2'));var Redis=require(_0xf94a('0x3'));var config=require('../../../config/environment');config[_0xf94a('0x4')]=_[_0xf94a('0x5')](config[_0xf94a('0x4')],{'host':_0xf94a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf94a('0x4')]));function MailQueue(_0x347dce){this['id']=_0x347dce['id']||0x0;this[_0xf94a('0x7')]=_0x347dce['name']||'';this[_0xf94a('0x8')]=_0x347dce[_0xf94a('0x8')]||0xa;this[_0xf94a('0x9')]=_0x347dce['strategy']||_0xf94a('0xa');this[_0xf94a('0xb')]=_0x347dce['Agents'];this['mapAgentsId']={};this[_0xf94a('0xc')]=0x0;this[_0xf94a('0x1')]='';this['updateRouting']();this[_0xf94a('0xd')]();}MailQueue['prototype'][_0xf94a('0xe')]=function(){var _0x36ccaa=this['mapAgentsId']['_rr'];this[_0xf94a('0xf')]=_[_0xf94a('0x10')](this[_0xf94a('0xb')],'id');this[_0xf94a('0xf')][_0xf94a('0x11')]=_0x36ccaa;};MailQueue[_0xf94a('0x12')]['updateRealtime']=function(){this[_0xf94a('0x13')]=0x0;this[_0xf94a('0x14')]=0x0;for(var _0x4fb33e=0x0;_0x4fb33e=0x0?this[_0xf94a('0x18')]:0x0;var _0x420d91={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf94a('0x7')],'paused':this[_0xf94a('0x14')],'waiting':this[_0xf94a('0xc')]};var _0x206f8c=md5(JSON[_0xf94a('0x19')](_0x420d91));if(this[_0xf94a('0x1')]!==_0x206f8c){this[_0xf94a('0x1')]=_0x206f8c;io['to'](util[_0xf94a('0x1a')]('mail:queue:%s',_0x420d91[_0xf94a('0x7')]))[_0xf94a('0x1b')]('mail_queue:save',_0x420d91);}};module[_0xf94a('0x1c')]=MailQueue; \ No newline at end of file +var _0xf5e2=['format','mail:queue:%s','mail_queue:save','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','map','_rr','prototype','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify'];(function(_0x272799,_0x33b5eb){var _0x22598f=function(_0x5a9cfa){while(--_0x5a9cfa){_0x272799['push'](_0x272799['shift']());}};_0x22598f(++_0x33b5eb);}(_0xf5e2,0x111));var _0x2f5e=function(_0x1c2d33,_0x1be9b8){_0x1c2d33=_0x1c2d33-0x0;var _0x5dd6f5=_0xf5e2[_0x1c2d33];return _0x5dd6f5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x2f5e('0x0'));var Redis=require('ioredis');var config=require(_0x2f5e('0x1'));config[_0x2f5e('0x2')]=_[_0x2f5e('0x3')](config[_0x2f5e('0x2')],{'host':_0x2f5e('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2f5e('0x2')]));function MailQueue(_0x2e8d19){this['id']=_0x2e8d19['id']||0x0;this[_0x2f5e('0x5')]=_0x2e8d19['name']||'';this['timeout']=_0x2e8d19[_0x2f5e('0x6')]||0xa;this[_0x2f5e('0x7')]=_0x2e8d19[_0x2f5e('0x7')]||_0x2f5e('0x8');this['Agents']=_0x2e8d19[_0x2f5e('0x9')];this[_0x2f5e('0xa')]={};this['waiting']=0x0;this[_0x2f5e('0xb')]='';this[_0x2f5e('0xc')]();this['updateRealtime']();}MailQueue['prototype']['updateRouting']=function(){var _0x192683=this[_0x2f5e('0xa')]['_rr'];this[_0x2f5e('0xa')]=_[_0x2f5e('0xd')](this[_0x2f5e('0x9')],'id');this[_0x2f5e('0xa')][_0x2f5e('0xe')]=_0x192683;};MailQueue[_0x2f5e('0xf')][_0x2f5e('0x10')]=function(){this[_0x2f5e('0x11')]=0x0;this[_0x2f5e('0x12')]=0x0;for(var _0x2497cb=0x0;_0x2497cb=0x0?this['available']:0x0;var _0x50825b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2f5e('0x11')],'name':this['name'],'paused':this[_0x2f5e('0x12')],'waiting':this['waiting']};var _0x132792=md5(JSON[_0x2f5e('0x17')](_0x50825b));if(this[_0x2f5e('0xb')]!==_0x132792){this[_0x2f5e('0xb')]=_0x132792;io['to'](util[_0x2f5e('0x18')](_0x2f5e('0x19'),_0x50825b[_0x2f5e('0x5')]))['emit'](_0x2f5e('0x1a'),_0x50825b);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b3078b8..a099941 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x326f,0xd1));var _0xf326=function(_0x734198,_0x29dcd8){_0x734198=_0x734198-0x0;var _0x45b067=_0x326f[_0x734198];return _0x45b067;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x1261,0x144));var _0x1126=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x1261[_0x151418];return _0x40e29a;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('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 58b8a6f..9d1aa55 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 _0x097c=['map','length','online','paused','loggedIn','available','format','emit','sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x097c,0x1d5));var _0xc097=function(_0x420338,_0x1e7ed9){_0x420338=_0x420338-0x0;var _0x1d54ce=_0x097c[_0x420338];return _0x1d54ce;};'use strict';var _=require(_0xc097('0x0'));var md5=require(_0xc097('0x1'));var util=require(_0xc097('0x2'));var Redis=require('ioredis');var config=require(_0xc097('0x3'));config[_0xc097('0x4')]=_[_0xc097('0x5')](config[_0xc097('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xc097('0x6'))(new Redis(config['redis']));function SmsQueue(_0x22fe81){this['id']=_0x22fe81['id']||0x0;this[_0xc097('0x7')]=_0x22fe81[_0xc097('0x7')]||'';this[_0xc097('0x8')]=_0x22fe81['timeout']||0xa;this[_0xc097('0x9')]=_0x22fe81['strategy']||'beepall';this[_0xc097('0xa')]=_0x22fe81[_0xc097('0xa')];this[_0xc097('0xb')]={};this[_0xc097('0xc')]=0x0;this[_0xc097('0x1')]='';this[_0xc097('0xd')]();this[_0xc097('0xe')]();}SmsQueue[_0xc097('0xf')][_0xc097('0xd')]=function(){var _0x48c376=this[_0xc097('0xb')][_0xc097('0x10')];this['mapAgentsId']=_[_0xc097('0x11')](this[_0xc097('0xa')],'id');this[_0xc097('0xb')][_0xc097('0x10')]=_0x48c376;};SmsQueue[_0xc097('0xf')][_0xc097('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x42fd3a=0x0;_0x42fd3a=0x0?this[_0xc097('0x16')]:0x0;var _0x560cbb={'id':this['id'],'available':this[_0xc097('0x16')],'loggedIn':this[_0xc097('0x15')],'name':this[_0xc097('0x7')],'paused':this[_0xc097('0x14')],'waiting':this['waiting']};var _0x38da65=md5(JSON['stringify'](_0x560cbb));if(this['md5']!==_0x38da65){this['md5']=_0x38da65;io['to'](util[_0xc097('0x17')]('sms:queue:%s',_0x560cbb['name']))[_0xc097('0x18')](_0xc097('0x19'),_0x560cbb);}};module[_0xc097('0x1a')]=SmsQueue; \ No newline at end of file +var _0x3036=['strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','length','online','loggedIn','smsPause','paused','available','stringify','format','sms:queue:%s','exports','util','ioredis','../../../config/environment','defaults','redis','name','timeout'];(function(_0x418ed5,_0xc2bd64){var _0x2d3432=function(_0x851ba2){while(--_0x851ba2){_0x418ed5['push'](_0x418ed5['shift']());}};_0x2d3432(++_0xc2bd64);}(_0x3036,0x1a9));var _0x6303=function(_0x59cad6,_0x4078f6){_0x59cad6=_0x59cad6-0x0;var _0x175c00=_0x3036[_0x59cad6];return _0x175c00;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6303('0x0'));var Redis=require(_0x6303('0x1'));var config=require(_0x6303('0x2'));config['redis']=_[_0x6303('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6303('0x4')]));function SmsQueue(_0x48d0c8){this['id']=_0x48d0c8['id']||0x0;this[_0x6303('0x5')]=_0x48d0c8[_0x6303('0x5')]||'';this[_0x6303('0x6')]=_0x48d0c8['timeout']||0xa;this[_0x6303('0x7')]=_0x48d0c8[_0x6303('0x7')]||_0x6303('0x8');this[_0x6303('0x9')]=_0x48d0c8[_0x6303('0x9')];this[_0x6303('0xa')]={};this[_0x6303('0xb')]=0x0;this[_0x6303('0xc')]='';this[_0x6303('0xd')]();this['updateRealtime']();}SmsQueue[_0x6303('0xe')][_0x6303('0xd')]=function(){var _0x3ac7ef=this[_0x6303('0xa')][_0x6303('0xf')];this['mapAgentsId']=_[_0x6303('0x10')](this[_0x6303('0x9')],'id');this[_0x6303('0xa')][_0x6303('0xf')]=_0x3ac7ef;};SmsQueue[_0x6303('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2726ef=0x0;_0x2726ef=0x0?this[_0x6303('0x16')]:0x0;var _0x36a6af={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6303('0x13')],'name':this[_0x6303('0x5')],'paused':this[_0x6303('0x15')],'waiting':this[_0x6303('0xb')]};var _0x33474f=md5(JSON[_0x6303('0x17')](_0x36a6af));if(this[_0x6303('0xc')]!==_0x33474f){this[_0x6303('0xc')]=_0x33474f;io['to'](util[_0x6303('0x18')](_0x6303('0x19'),_0x36a6af[_0x6303('0x5')]))['emit']('sms_queue:save',_0x36a6af);}};module[_0x6303('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 797a36e..605d6c2 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 _0xcafc=['redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','waiting','updateRouting','updateRealtime','mapAgentsId','map','_rr','prototype','loggedIn','paused','length','Agents','online','available','stringify','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','../../../config/environment'];(function(_0x59f7b8,_0xb2ac21){var _0x7b28c5=function(_0x427d2d){while(--_0x427d2d){_0x59f7b8['push'](_0x59f7b8['shift']());}};_0x7b28c5(++_0xb2ac21);}(_0xcafc,0x147));var _0xccaf=function(_0x136271,_0x5946f6){_0x136271=_0x136271-0x0;var _0x2ecffc=_0xcafc[_0x136271];return _0x2ecffc;};'use strict';var _=require(_0xccaf('0x0'));var md5=require('md5');var util=require(_0xccaf('0x1'));var Redis=require('ioredis');var config=require(_0xccaf('0x2'));config[_0xccaf('0x3')]=_[_0xccaf('0x4')](config[_0xccaf('0x3')],{'host':_0xccaf('0x5'),'port':0x18eb});var io=require(_0xccaf('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x6465af){this['id']=_0x6465af['id']||0x0;this[_0xccaf('0x7')]=_0x6465af[_0xccaf('0x7')]||'';this['timeout']=_0x6465af['timeout']||0xa;this[_0xccaf('0x8')]=_0x6465af[_0xccaf('0x8')]||_0xccaf('0x9');this['Agents']=_0x6465af['Agents'];this['mapAgentsId']={};this[_0xccaf('0xa')]=0x0;this['md5']='';this[_0xccaf('0xb')]();this[_0xccaf('0xc')]();}WhatsappQueue['prototype'][_0xccaf('0xb')]=function(){var _0x2f5dc2=this[_0xccaf('0xd')]['_rr'];this[_0xccaf('0xd')]=_[_0xccaf('0xe')](this['Agents'],'id');this[_0xccaf('0xd')][_0xccaf('0xf')]=_0x2f5dc2;};WhatsappQueue[_0xccaf('0x10')][_0xccaf('0xc')]=function(){this[_0xccaf('0x11')]=0x0;this[_0xccaf('0x12')]=0x0;for(var _0x20ec72=0x0;_0x20ec72=0x0?this['available']:0x0;var _0x459866={'id':this['id'],'available':this[_0xccaf('0x16')],'loggedIn':this[_0xccaf('0x11')],'name':this[_0xccaf('0x7')],'paused':this[_0xccaf('0x12')],'waiting':this[_0xccaf('0xa')]};var _0x47244a=md5(JSON[_0xccaf('0x17')](_0x459866));if(this[_0xccaf('0x18')]!==_0x47244a){this[_0xccaf('0x18')]=_0x47244a;io['to'](util[_0xccaf('0x19')](_0xccaf('0x1a'),_0x459866[_0xccaf('0x7')]))[_0xccaf('0x1b')](_0xccaf('0x1c'),_0x459866);}};module[_0xccaf('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x98ae=['whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn'];(function(_0x309be2,_0x1cf925){var _0x5935c2=function(_0x280683){while(--_0x280683){_0x309be2['push'](_0x309be2['shift']());}};_0x5935c2(++_0x1cf925);}(_0x98ae,0x173));var _0xe98a=function(_0x3b5189,_0x5f1397){_0x3b5189=_0x3b5189-0x0;var _0x2c8bf0=_0x98ae[_0x3b5189];return _0x2c8bf0;};'use strict';var _=require('lodash');var md5=require(_0xe98a('0x0'));var util=require('util');var Redis=require(_0xe98a('0x1'));var config=require(_0xe98a('0x2'));config[_0xe98a('0x3')]=_[_0xe98a('0x4')](config[_0xe98a('0x3')],{'host':_0xe98a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x1d3fef){this['id']=_0x1d3fef['id']||0x0;this[_0xe98a('0x6')]=_0x1d3fef[_0xe98a('0x6')]||'';this[_0xe98a('0x7')]=_0x1d3fef[_0xe98a('0x7')]||0xa;this[_0xe98a('0x8')]=_0x1d3fef[_0xe98a('0x8')]||_0xe98a('0x9');this[_0xe98a('0xa')]=_0x1d3fef['Agents'];this[_0xe98a('0xb')]={};this[_0xe98a('0xc')]=0x0;this['md5']='';this[_0xe98a('0xd')]();this[_0xe98a('0xe')]();}WhatsappQueue[_0xe98a('0xf')][_0xe98a('0xd')]=function(){var _0x1fea4a=this[_0xe98a('0xb')][_0xe98a('0x10')];this[_0xe98a('0xb')]=_['map'](this[_0xe98a('0xa')],'id');this[_0xe98a('0xb')]['_rr']=_0x1fea4a;};WhatsappQueue[_0xe98a('0xf')][_0xe98a('0xe')]=function(){this['loggedIn']=0x0;this[_0xe98a('0x11')]=0x0;for(var _0x3ac248=0x0;_0x3ac248=0x0?this['available']:0x0;var _0xc7e914={'id':this['id'],'available':this[_0xe98a('0x16')],'loggedIn':this[_0xe98a('0x14')],'name':this[_0xe98a('0x6')],'paused':this['paused'],'waiting':this[_0xe98a('0xc')]};var _0x3d5b97=md5(JSON[_0xe98a('0x17')](_0xc7e914));if(this[_0xe98a('0x0')]!==_0x3d5b97){this['md5']=_0x3d5b97;io['to'](util[_0xe98a('0x18')](_0xe98a('0x19'),_0xc7e914[_0xe98a('0x6')]))[_0xe98a('0x1a')](_0xe98a('0x1b'),_0xc7e914);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 5e725e8..52397ea 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(_0x366284,_0x307e72){var _0x10e497=function(_0x26b09f){while(--_0x26b09f){_0x366284['push'](_0x366284['shift']());}};_0x10e497(++_0x307e72);}(_0xb10b,0x12a));var _0xbb10=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0xb10b[_0x699200];return _0x266fd1;};'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 _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(_0x4f94a8,_0x6f1535){var _0x195d01=function(_0x54c4a6){while(--_0x54c4a6){_0x4f94a8['push'](_0x4f94a8['shift']());}};_0x195d01(++_0x6f1535);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d1187,_0x2a8e79){_0x3d1187=_0x3d1187-0x0;var _0x3ceb4d=_0xb10b[_0x3d1187];return _0x3ceb4d;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 2cfb9a8..f139b21 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 _0x0987=['addTagsToChatInteraction','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x380991,_0x3bd436){var _0x173ccb=function(_0x15b58a){while(--_0x15b58a){_0x380991['push'](_0x380991['shift']());}};_0x173ccb(++_0x3bd436);}(_0x0987,0x157));var _0x7098=function(_0x8172fd,_0x10c0f3){_0x8172fd=_0x8172fd-0x0;var _0x15cfe1=_0x0987[_0x8172fd];return _0x15cfe1;};'use strict';var client=require('../client');exports[_0x7098('0x0')]=function(_0x56998f,_0x9c7166){return client[_0x7098('0x1')]('UpdateChatInteraction',{'body':_0x9c7166,'options':{'where':{'id':_0x56998f}},'log':_0x7098('0x2')});};exports[_0x7098('0x3')]=function(_0x3d0ea9,_0x52d71d){return client[_0x7098('0x1')](_0x7098('0x4'),{'body':_0x52d71d,'options':{'where':{'id':_0x3d0ea9}},'log':_0x7098('0x5')});}; \ No newline at end of file +var _0xfb71=['addTagsToChatInteraction','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x4ad898,_0x5f0c2f){var _0x68b412=function(_0x369947){while(--_0x369947){_0x4ad898['push'](_0x4ad898['shift']());}};_0x68b412(++_0x5f0c2f);}(_0xfb71,0xf6));var _0x1fb7=function(_0x31afd2,_0x1d8eb3){_0x31afd2=_0x31afd2-0x0;var _0x38459e=_0xfb71[_0x31afd2];return _0x38459e;};'use strict';var client=require('../client');exports[_0x1fb7('0x0')]=function(_0x3899ba,_0x243691){return client['Request'](_0x1fb7('0x1'),{'body':_0x243691,'options':{'where':{'id':_0x3899ba}},'log':_0x1fb7('0x2')});};exports[_0x1fb7('0x3')]=function(_0x4212a5,_0x2566a3){return client[_0x1fb7('0x4')](_0x1fb7('0x5'),{'body':_0x2566a3,'options':{'where':{'id':_0x4212a5}},'log':_0x1fb7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 385b622..2dec5f8 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 _0x6ac9=['createChatMessage','../client','create','CreateChatMessage'];(function(_0x3496d2,_0x54193c){var _0x282531=function(_0x366974){while(--_0x366974){_0x3496d2['push'](_0x3496d2['shift']());}};_0x282531(++_0x54193c);}(_0x6ac9,0x131));var _0x96ac=function(_0x280025,_0x27ce69){_0x280025=_0x280025-0x0;var _0x34338a=_0x6ac9[_0x280025];return _0x34338a;};'use strict';var client=require(_0x96ac('0x0'));exports[_0x96ac('0x1')]=function(_0x31df2a){return client['Request'](_0x96ac('0x2'),{'body':_0x31df2a,'log':_0x96ac('0x3')});}; \ No newline at end of file +var _0x642b=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x31faee,_0x2e0e7d){var _0x5537c1=function(_0x2fbf9c){while(--_0x2fbf9c){_0x31faee['push'](_0x31faee['shift']());}};_0x5537c1(++_0x2e0e7d);}(_0x642b,0x1c5));var _0xb642=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x642b[_0x199572];return _0x13cfa3;};'use strict';var client=require('../client');exports[_0xb642('0x0')]=function(_0x4caa14){return client[_0xb642('0x1')](_0xb642('0x2'),{'body':_0x4caa14,'log':_0xb642('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index e75d28a..b2cbced 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 _0x3148=['getChatQueues','GetChatQueue','name','timeout','strategy','Agents','online','chatPause','../client'];(function(_0xfde72e,_0x3847c1){var _0x18ca84=function(_0x3d343e){while(--_0x3d343e){_0xfde72e['push'](_0xfde72e['shift']());}};_0x18ca84(++_0x3847c1);}(_0x3148,0x1d3));var _0x8314=function(_0x29e9e3,_0x4deb93){_0x29e9e3=_0x29e9e3-0x0;var _0x58452d=_0x3148[_0x29e9e3];return _0x58452d;};'use strict';var client=require(_0x8314('0x0'));exports[_0x8314('0x1')]=function(){return function(){return client['Request'](_0x8314('0x2'),{'options':{'raw':![],'attributes':['id',_0x8314('0x3'),_0x8314('0x4'),_0x8314('0x5')],'include':[{'model':'User','as':_0x8314('0x6'),'attributes':['id',_0x8314('0x3'),_0x8314('0x7'),_0x8314('0x8')]}]},'log':_0x8314('0x1')});};}; \ No newline at end of file +var _0x3248=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','online'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3248,0x1b0));var _0x8324=function(_0x3b1265,_0x2b89c9){_0x3b1265=_0x3b1265-0x0;var _0x214e99=_0x3248[_0x3b1265];return _0x214e99;};'use strict';var client=require(_0x8324('0x0'));exports[_0x8324('0x1')]=function(){return function(){return client[_0x8324('0x2')](_0x8324('0x3'),{'options':{'raw':![],'attributes':['id',_0x8324('0x4'),_0x8324('0x5'),_0x8324('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x8324('0x4'),_0x8324('0x7'),'chatPause']}]},'log':_0x8324('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a876a1b..731249c 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 _0xb6b1=['CreateChatQueueReport','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xb6b1[_0x4ae829];return _0x256b31;};'use strict';var client=require(_0x1b6b('0x0'));exports['create']=function(_0x669faa){return client['Request'](_0x1b6b('0x1'),{'body':_0x669faa,'log':_0x1b6b('0x1')});};exports['update']=function(_0x3f12e2,_0x5100e5){return client[_0x1b6b('0x2')](_0x1b6b('0x3'),{'body':_0x5100e5,'options':{'where':{'uniqueid':_0x3f12e2},'order':[['id',_0x1b6b('0x4')]],'limit':0x1},'log':_0x1b6b('0x3')});}; \ No newline at end of file +var _0x340c=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc340('0x0'));exports[_0xc340('0x1')]=function(_0x4053b6){return client[_0xc340('0x2')]('CreateChatQueueReport',{'body':_0x4053b6,'log':_0xc340('0x3')});};exports[_0xc340('0x4')]=function(_0x1d4fa7,_0x43c651){return client['Request'](_0xc340('0x5'),{'body':_0x43c651,'options':{'where':{'uniqueid':_0x1d4fa7},'order':[['id',_0xc340('0x6')]],'limit':0x1},'log':_0xc340('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e678690..a515f02 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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x7a54,0x106));var _0x47a5=function(_0x59a876,_0x133206){_0x59a876=_0x59a876-0x0;var _0x5b26d5=_0x7a54[_0x59a876];return _0x5b26d5;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2f2a91,_0x2d4d82){var _0xbbce1b=function(_0x36349a){while(--_0x36349a){_0x2f2a91['push'](_0x2f2a91['shift']());}};_0xbbce1b(++_0x2d4d82);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 667b00b..835fe79 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 _0x71fe=['Request','CreateFaxMessage','../client','create'];(function(_0x457348,_0x3e90f9){var _0x1310ce=function(_0x50482e){while(--_0x50482e){_0x457348['push'](_0x457348['shift']());}};_0x1310ce(++_0x3e90f9);}(_0x71fe,0x1de));var _0xe71f=function(_0x34d36a,_0x200da9){_0x34d36a=_0x34d36a-0x0;var _0xc4f7b=_0x71fe[_0x34d36a];return _0xc4f7b;};'use strict';var client=require(_0xe71f('0x0'));exports[_0xe71f('0x1')]=function(_0x5bbb07){return client[_0xe71f('0x2')](_0xe71f('0x3'),{'body':_0x5bbb07,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xcfb9=['Request','createFaxMessage','../client','create'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xcfb9,0x122));var _0x9cfb=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0xcfb9[_0x5f746f];return _0x198d15;};'use strict';var client=require(_0x9cfb('0x0'));exports[_0x9cfb('0x1')]=function(_0x1eb52a){return client[_0x9cfb('0x2')]('CreateFaxMessage',{'body':_0x1eb52a,'log':_0x9cfb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 47855b3..a85aadc 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 _0x2c38=['timeout','Agents','online','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2c38,0x1e6));var _0x82c3=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x2c38[_0x414297];return _0x51ea47;};'use strict';var client=require(_0x82c3('0x0'));exports[_0x82c3('0x1')]=function(){return function(){return client['Request'](_0x82c3('0x2'),{'options':{'raw':![],'attributes':['id',_0x82c3('0x3'),_0x82c3('0x4'),'strategy'],'include':[{'model':'User','as':_0x82c3('0x5'),'attributes':['id',_0x82c3('0x3'),_0x82c3('0x6'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x2de5=['timeout','strategy','User','Agents','faxPause','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x3da3c8,_0x3423d7){var _0x49d5be=function(_0x167821){while(--_0x167821){_0x3da3c8['push'](_0x3da3c8['shift']());}};_0x49d5be(++_0x3423d7);}(_0x2de5,0x1ac));var _0x52de=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x2de5[_0x136619];return _0x38c4a5;};'use strict';var client=require('../client');exports[_0x52de('0x0')]=function(){return function(){return client[_0x52de('0x1')](_0x52de('0x2'),{'options':{'raw':![],'attributes':['id',_0x52de('0x3'),_0x52de('0x4'),_0x52de('0x5')],'include':[{'model':_0x52de('0x6'),'as':_0x52de('0x7'),'attributes':['id','name','online',_0x52de('0x8')]}]},'log':_0x52de('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0fbd066..be9541c 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 _0x8931=['../client','create','Request','UpdateFaxQueueReport'];(function(_0x117581,_0x307e77){var _0x25cfa7=function(_0xcb89ee){while(--_0xcb89ee){_0x117581['push'](_0x117581['shift']());}};_0x25cfa7(++_0x307e77);}(_0x8931,0x14c));var _0x1893=function(_0x52747c,_0x2ed053){_0x52747c=_0x52747c-0x0;var _0x41e9ed=_0x8931[_0x52747c];return _0x41e9ed;};'use strict';var client=require(_0x1893('0x0'));exports[_0x1893('0x1')]=function(_0x187c15){return client['Request']('CreateFaxQueueReport',{'body':_0x187c15,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x318f02,_0x4b5732){return client[_0x1893('0x2')](_0x1893('0x3'),{'body':_0x4b5732,'options':{'where':{'uniqueid':_0x318f02},'order':[['id','DESC']],'limit':0x1},'log':_0x1893('0x3')});}; \ No newline at end of file +var _0x163d=['update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x25c250,_0x5056aa){var _0x542f5d=function(_0x4ff341){while(--_0x4ff341){_0x25c250['push'](_0x25c250['shift']());}};_0x542f5d(++_0x5056aa);}(_0x163d,0x69));var _0xd163=function(_0x31c969,_0x5c2869){_0x31c969=_0x31c969-0x0;var _0x5e781b=_0x163d[_0x31c969];return _0x5e781b;};'use strict';var client=require(_0xd163('0x0'));exports[_0xd163('0x1')]=function(_0x145ca7){return client[_0xd163('0x2')]('CreateFaxQueueReport',{'body':_0x145ca7,'log':'CreateFaxQueueReport'});};exports[_0xd163('0x3')]=function(_0x2ccb64,_0x161229){return client[_0xd163('0x2')](_0xd163('0x4'),{'body':_0x161229,'options':{'where':{'uniqueid':_0x2ccb64},'order':[['id',_0xd163('0x5')]],'limit':0x1},'log':_0xd163('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 142d40c..59a3821 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 _0x5be9=['name','Interval','Intervals','interval','getIntervals','Request'];(function(_0x3da577,_0x1fe4f3){var _0x33e935=function(_0x3b714b){while(--_0x3b714b){_0x3da577['push'](_0x3da577['shift']());}};_0x33e935(++_0x1fe4f3);}(_0x5be9,0xca));var _0x95be=function(_0x42b985,_0xe75128){_0x42b985=_0x42b985-0x0;var _0x4e528f=_0x5be9[_0x42b985];return _0x4e528f;};'use strict';var client=require('../client');exports[_0x95be('0x0')]=function(){return function(){return client[_0x95be('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x95be('0x2')],'include':[{'model':_0x95be('0x3'),'as':_0x95be('0x4'),'attributes':['id',_0x95be('0x2'),_0x95be('0x5')]}]},'log':_0x95be('0x0')});};}; \ No newline at end of file +var _0xd2cf=['GetInterval','name','Interval','Intervals','getIntervals','../client'];(function(_0x16e50a,_0x5aec08){var _0x1bf2b6=function(_0x449873){while(--_0x449873){_0x16e50a['push'](_0x16e50a['shift']());}};_0x1bf2b6(++_0x5aec08);}(_0xd2cf,0x1f1));var _0xfd2c=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0xd2cf[_0x3b0c9d];return _0xcfc8d7;};'use strict';var client=require(_0xfd2c('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xfd2c('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xfd2c('0x2')],'include':[{'model':_0xfd2c('0x3'),'as':_0xfd2c('0x4'),'attributes':['id','name','interval']}]},'log':_0xfd2c('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index cc20ac5..bcbfbf4 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 _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x3d888d,_0x1661ce){var _0x403191=function(_0x9a52cd){while(--_0x9a52cd){_0x3d888d['push'](_0x3d888d['shift']());}};_0x403191(++_0x1661ce);}(_0x28f2,0x193));var _0x228f=function(_0x395205,_0x810a86){_0x395205=_0x395205-0x0;var _0x55c3be=_0x28f2[_0x395205];return _0x55c3be;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file +var _0xfff0=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x32e9e9,_0x3df5aa){var _0x400b63=function(_0x5d0454){while(--_0x5d0454){_0x32e9e9['push'](_0x32e9e9['shift']());}};_0x400b63(++_0x3df5aa);}(_0xfff0,0x139));var _0x0fff=function(_0x4a08bb,_0x2edca7){_0x4a08bb=_0x4a08bb-0x0;var _0x955f35=_0xfff0[_0x4a08bb];return _0x955f35;};'use strict';var client=require('../client');exports[_0x0fff('0x0')]=function(_0x2b95e0,_0x148db8){return client['Request'](_0x0fff('0x1'),{'body':_0x148db8,'options':{'where':{'id':_0x2b95e0}},'log':_0x0fff('0x2')});};exports[_0x0fff('0x3')]=function(_0x4bec60,_0x2cd3d5){return client[_0x0fff('0x4')]('AddTagsToMailInteraction',{'body':_0x2cd3d5,'options':{'where':{'id':_0x4bec60}},'log':_0x0fff('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a42e548..ade21db 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 _0x6970=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x518990,_0x8fa098){var _0x258811=function(_0x479279){while(--_0x479279){_0x518990['push'](_0x518990['shift']());}};_0x258811(++_0x8fa098);}(_0x6970,0x1c7));var _0x0697=function(_0x39d6c2,_0x4746f6){_0x39d6c2=_0x39d6c2-0x0;var _0x2a1795=_0x6970[_0x39d6c2];return _0x2a1795;};'use strict';var client=require(_0x0697('0x0'));exports[_0x0697('0x1')]=function(_0x123773){return client[_0x0697('0x2')](_0x0697('0x3'),{'body':_0x123773,'log':_0x0697('0x4')});}; \ No newline at end of file +var _0xb8b1=['Request','createMailMessage','../client','create'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb8b1,0x86));var _0x1b8b=function(_0x502a1c,_0x3c8a0f){_0x502a1c=_0x502a1c-0x0;var _0xf4aef7=_0xb8b1[_0x502a1c];return _0xf4aef7;};'use strict';var client=require(_0x1b8b('0x0'));exports[_0x1b8b('0x1')]=function(_0x508f5b){return client[_0x1b8b('0x2')]('CreateMailMessage',{'body':_0x508f5b,'log':_0x1b8b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 233bf88..a918540 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 _0x292c=['User','Agents','mailPause','getMailQueues','name','strategy'];(function(_0x8d77d7,_0x3be0c5){var _0x5110ae=function(_0x1f39ae){while(--_0x1f39ae){_0x8d77d7['push'](_0x8d77d7['shift']());}};_0x5110ae(++_0x3be0c5);}(_0x292c,0x17d));var _0xc292=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x292c[_0x236d24];return _0x1574cf;};'use strict';var client=require('../client');exports[_0xc292('0x0')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xc292('0x1'),'timeout',_0xc292('0x2')],'include':[{'model':_0xc292('0x3'),'as':_0xc292('0x4'),'attributes':['id','name','online',_0xc292('0x5')]}]},'log':_0xc292('0x0')});};}; \ No newline at end of file +var _0x8b1d=['mailPause','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents','online'];(function(_0x40162a,_0x265b0c){var _0x488161=function(_0x9307e6){while(--_0x9307e6){_0x40162a['push'](_0x40162a['shift']());}};_0x488161(++_0x265b0c);}(_0x8b1d,0x1de));var _0xd8b1=function(_0x24f822,_0x983343){_0x24f822=_0x24f822-0x0;var _0x2688dc=_0x8b1d[_0x24f822];return _0x2688dc;};'use strict';var client=require('../client');exports[_0xd8b1('0x0')]=function(){return function(){return client[_0xd8b1('0x1')](_0xd8b1('0x2'),{'options':{'raw':![],'attributes':['id',_0xd8b1('0x3'),_0xd8b1('0x4'),_0xd8b1('0x5')],'include':[{'model':'User','as':_0xd8b1('0x6'),'attributes':['id',_0xd8b1('0x3'),_0xd8b1('0x7'),_0xd8b1('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f9a8c55..fc0b8fd 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 _0x839b=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x173e4e,_0x24de6){var _0x52597c=function(_0x4c1916){while(--_0x4c1916){_0x173e4e['push'](_0x173e4e['shift']());}};_0x52597c(++_0x24de6);}(_0x839b,0x16b));var _0xb839=function(_0x296431,_0x32287f){_0x296431=_0x296431-0x0;var _0x4c18cb=_0x839b[_0x296431];return _0x4c18cb;};'use strict';var client=require(_0xb839('0x0'));exports[_0xb839('0x1')]=function(_0x1ee3f2){return client[_0xb839('0x2')](_0xb839('0x3'),{'body':_0x1ee3f2,'log':_0xb839('0x3')});};exports[_0xb839('0x4')]=function(_0x4ef791,_0x59f201){return client[_0xb839('0x2')](_0xb839('0x5'),{'body':_0x59f201,'options':{'where':{'uniqueid':_0x4ef791},'order':[['id','DESC']],'limit':0x1},'log':_0xb839('0x5')});}; \ No newline at end of file +var _0x08af=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x355d31,_0xd17777){var _0x2c85f8=function(_0x2338a8){while(--_0x2338a8){_0x355d31['push'](_0x355d31['shift']());}};_0x2c85f8(++_0xd17777);}(_0x08af,0xe4));var _0xf08a=function(_0x455abf,_0x4ae86d){_0x455abf=_0x455abf-0x0;var _0x3ab136=_0x08af[_0x455abf];return _0x3ab136;};'use strict';var client=require(_0xf08a('0x0'));exports[_0xf08a('0x1')]=function(_0x5b7a1c){return client[_0xf08a('0x2')](_0xf08a('0x3'),{'body':_0x5b7a1c,'log':'CreateMailQueueReport'});};exports[_0xf08a('0x4')]=function(_0x4b3bf8,_0x583e7c){return client[_0xf08a('0x2')]('UpdateMailQueueReport',{'body':_0x583e7c,'options':{'where':{'uniqueid':_0x4b3bf8},'order':[['id',_0xf08a('0x5')]],'limit':0x1},'log':_0xf08a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 687ad09..c3dd81d 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 _0xa8bd=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x17bf38,_0x2935a2){var _0x3d7b40=function(_0x4f2c43){while(--_0x4f2c43){_0x17bf38['push'](_0x17bf38['shift']());}};_0x3d7b40(++_0x2935a2);}(_0xa8bd,0x1df));var _0xda8b=function(_0x4528f5,_0x4caa39){_0x4528f5=_0x4528f5-0x0;var _0x28b6d2=_0xa8bd[_0x4528f5];return _0x28b6d2;};'use strict';var client=require(_0xda8b('0x0'));exports[_0xda8b('0x1')]=function(_0xea20c1,_0x3ba167){return client[_0xda8b('0x2')](_0xda8b('0x3'),{'body':_0x3ba167,'options':{'where':{'id':_0xea20c1}},'log':_0xda8b('0x4')});};exports[_0xda8b('0x5')]=function(_0x69ecc0,_0x550036){return client[_0xda8b('0x2')](_0xda8b('0x6'),{'body':_0x550036,'options':{'where':{'id':_0x69ecc0}},'log':_0xda8b('0x7')});}; \ No newline at end of file +var _0x34f7=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x34f7,0x109));var _0x734f=function(_0x5f0953,_0x1ee999){_0x5f0953=_0x5f0953-0x0;var _0x322565=_0x34f7[_0x5f0953];return _0x322565;};'use strict';var client=require(_0x734f('0x0'));exports['update']=function(_0x5c0f97,_0x43d26f){return client[_0x734f('0x1')](_0x734f('0x2'),{'body':_0x43d26f,'options':{'where':{'id':_0x5c0f97}},'log':_0x734f('0x3')});};exports[_0x734f('0x4')]=function(_0x38cc56,_0x52d626){return client[_0x734f('0x1')](_0x734f('0x5'),{'body':_0x52d626,'options':{'where':{'id':_0x38cc56}},'log':_0x734f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index cfdab77..ea8ae4d 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 _0x460c=['createOpenchannelMessage','create','Request'];(function(_0x25b8b1,_0xe0b951){var _0x2d04f7=function(_0x1a45b8){while(--_0x1a45b8){_0x25b8b1['push'](_0x25b8b1['shift']());}};_0x2d04f7(++_0xe0b951);}(_0x460c,0x6d));var _0xc460=function(_0xa8918f,_0x478a38){_0xa8918f=_0xa8918f-0x0;var _0x223bcc=_0x460c[_0xa8918f];return _0x223bcc;};'use strict';var client=require('../client');exports[_0xc460('0x0')]=function(_0x4dcfe6){return client[_0xc460('0x1')]('CreateOpenchannelMessage',{'body':_0x4dcfe6,'log':_0xc460('0x2')});}; \ No newline at end of file +var _0x413c=['create','Request','createOpenchannelMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x413c,0x6b));var _0xc413=function(_0x6f943b,_0x181d53){_0x6f943b=_0x6f943b-0x0;var _0x215294=_0x413c[_0x6f943b];return _0x215294;};'use strict';var client=require(_0xc413('0x0'));exports[_0xc413('0x1')]=function(_0x56fee4){return client[_0xc413('0x2')]('CreateOpenchannelMessage',{'body':_0x56fee4,'log':_0xc413('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6256f5b..840dd87 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 _0xc8d8=['openchannelPause','getOpenchannelQueues','strategy','User','Agents','name'];(function(_0xa57d66,_0x19cb3a){var _0x3b06a2=function(_0x28c6f9){while(--_0x28c6f9){_0xa57d66['push'](_0xa57d66['shift']());}};_0x3b06a2(++_0x19cb3a);}(_0xc8d8,0xe5));var _0x8c8d=function(_0x5a7521,_0x2d1d5e){_0x5a7521=_0x5a7521-0x0;var _0x3d6e6a=_0xc8d8[_0x5a7521];return _0x3d6e6a;};'use strict';var client=require('../client');exports[_0x8c8d('0x0')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x8c8d('0x1')],'include':[{'model':_0x8c8d('0x2'),'as':_0x8c8d('0x3'),'attributes':['id',_0x8c8d('0x4'),'online',_0x8c8d('0x5')]}]},'log':_0x8c8d('0x0')});};}; \ No newline at end of file +var _0xf98f=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','online','openchannelPause'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf98f,0x1a7));var _0xff98=function(_0x23e5bc,_0x35fabb){_0x23e5bc=_0x23e5bc-0x0;var _0x51c7aa=_0xf98f[_0x23e5bc];return _0x51c7aa;};'use strict';var client=require(_0xff98('0x0'));exports[_0xff98('0x1')]=function(){return function(){return client[_0xff98('0x2')](_0xff98('0x3'),{'options':{'raw':![],'attributes':['id',_0xff98('0x4'),_0xff98('0x5'),'strategy'],'include':[{'model':_0xff98('0x6'),'as':'Agents','attributes':['id',_0xff98('0x4'),_0xff98('0x7'),_0xff98('0x8')]}]},'log':_0xff98('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d055f22..1ba9442 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 _0x7a92=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0xe92c4f,_0x5c3971){var _0x3372a3=function(_0x4a8576){while(--_0x4a8576){_0xe92c4f['push'](_0xe92c4f['shift']());}};_0x3372a3(++_0x5c3971);}(_0x7a92,0x1bc));var _0x27a9=function(_0x6ba357,_0xd5a7b9){_0x6ba357=_0x6ba357-0x0;var _0xc4d7a6=_0x7a92[_0x6ba357];return _0xc4d7a6;};'use strict';var client=require(_0x27a9('0x0'));exports[_0x27a9('0x1')]=function(_0x479ea6){return client[_0x27a9('0x2')](_0x27a9('0x3'),{'body':_0x479ea6,'log':_0x27a9('0x3')});};exports[_0x27a9('0x4')]=function(_0x386ee5,_0x338804){return client[_0x27a9('0x2')](_0x27a9('0x5'),{'body':_0x338804,'options':{'where':{'uniqueid':_0x386ee5},'order':[['id',_0x27a9('0x6')]],'limit':0x1},'log':_0x27a9('0x5')});}; \ No newline at end of file +var _0x5acb=['DESC','../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x21ed8a,_0x111266){var _0x351399=function(_0x1fc44f){while(--_0x1fc44f){_0x21ed8a['push'](_0x21ed8a['shift']());}};_0x351399(++_0x111266);}(_0x5acb,0x12d));var _0xb5ac=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5acb[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xb5ac('0x0'));exports[_0xb5ac('0x1')]=function(_0x22aa71){return client[_0xb5ac('0x2')](_0xb5ac('0x3'),{'body':_0x22aa71,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x1c4683,_0x31d5d8){return client[_0xb5ac('0x2')](_0xb5ac('0x4'),{'body':_0x31d5d8,'options':{'where':{'uniqueid':_0x1c4683},'order':[['id',_0xb5ac('0x5')]],'limit':0x1},'log':_0xb5ac('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 89e22d8..8e0d548 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 _0x10af=['../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x32c2d3,_0x2ff9d5){var _0x4361df=function(_0x27ad03){while(--_0x27ad03){_0x32c2d3['push'](_0x32c2d3['shift']());}};_0x4361df(++_0x2ff9d5);}(_0x10af,0xfc));var _0xf10a=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x10af[_0x486f4a];return _0x135d99;};'use strict';var client=require(_0xf10a('0x0'));exports['update']=function(_0x24a86d,_0x6b2db9){return client[_0xf10a('0x1')](_0xf10a('0x2'),{'body':_0x6b2db9,'options':{'where':{'id':_0x24a86d}},'log':_0xf10a('0x3')});};exports[_0xf10a('0x4')]=function(_0xbffc71,_0x13b338){return client['Request'](_0xf10a('0x5'),{'body':_0x13b338,'options':{'where':{'id':_0xbffc71}},'log':_0xf10a('0x6')});}; \ No newline at end of file +var _0xc7b4=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4c7b('0x0'));exports['update']=function(_0x6edfa6,_0x14a4c3){return client['Request'](_0x4c7b('0x1'),{'body':_0x14a4c3,'options':{'where':{'id':_0x6edfa6}},'log':_0x4c7b('0x2')});};exports[_0x4c7b('0x3')]=function(_0x2a8b1d,_0x109687){return client['Request'](_0x4c7b('0x4'),{'body':_0x109687,'options':{'where':{'id':_0x2a8b1d}},'log':_0x4c7b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9bff242..afe5d6d 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 _0xe083=['../client','create','Request','CreateSmsMessage'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe083,0x168));var _0x3e08=function(_0x69ecb0,_0x5a46d8){_0x69ecb0=_0x69ecb0-0x0;var _0x29eb9a=_0xe083[_0x69ecb0];return _0x29eb9a;};'use strict';var client=require(_0x3e08('0x0'));exports[_0x3e08('0x1')]=function(_0x337dde){return client[_0x3e08('0x2')](_0x3e08('0x3'),{'body':_0x337dde,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xc638=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xc638,0xc3));var _0x8c63=function(_0x465c4f,_0x18a72e){_0x465c4f=_0x465c4f-0x0;var _0x4d3933=_0xc638[_0x465c4f];return _0x4d3933;};'use strict';var client=require(_0x8c63('0x0'));exports[_0x8c63('0x1')]=function(_0x2038e9){return client[_0x8c63('0x2')](_0x8c63('0x3'),{'body':_0x2038e9,'log':_0x8c63('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 957e7e6..a023641 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x32ece9,_0x35c9a1){var _0x4244ef=function(_0x4995cb){while(--_0x4995cb){_0x32ece9['push'](_0x32ece9['shift']());}};_0x4244ef(++_0x35c9a1);}(_0xe706,0xa3));var _0x6e70=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xe706[_0x576e2b];return _0x46461a;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x3b54f6,_0x227ca1){var _0x5238b6=function(_0x570a07){while(--_0x570a07){_0x3b54f6['push'](_0x3b54f6['shift']());}};_0x5238b6(++_0x227ca1);}(_0x70e0,0x17b));var _0x070e=function(_0x5eadfb,_0x1d8d3b){_0x5eadfb=_0x5eadfb-0x0;var _0x2f65bd=_0x70e0[_0x5eadfb];return _0x2f65bd;};'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 eae992f..1e27ab1 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x11a88e,_0x326a52){var _0x330d18=function(_0x393158){while(--_0x393158){_0x11a88e['push'](_0x11a88e['shift']());}};_0x330d18(++_0x326a52);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2ab350,_0x32859f){var _0x4acac=function(_0x58ddc6){while(--_0x58ddc6){_0x2ab350['push'](_0x2ab350['shift']());}};_0x4acac(++_0x32859f);}(_0x008c,0x188));var _0xc008=function(_0xa1b0d4,_0xbeba0){_0xa1b0d4=_0xa1b0d4-0x0;var _0x19f06c=_0x008c[_0xa1b0d4];return _0x19f06c;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 0a333af..06a5830 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(_0x4562b2,_0x1d236f){var _0x711917=function(_0x2af728){while(--_0x2af728){_0x4562b2['push'](_0x4562b2['shift']());}};_0x711917(++_0x1d236f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x56bb5a,_0x3af70a){var _0x53e04e=function(_0x542ef3){while(--_0x542ef3){_0x56bb5a['push'](_0x56bb5a['shift']());}};_0x53e04e(++_0x3af70a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 36afb12..3f4d237 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 _0xef4d=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xef4d,0x165));var _0xdef4=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xef4d[_0x36eaaa];return _0x461349;};'use strict';var client=require(_0xdef4('0x0'));exports[_0xdef4('0x1')]=function(_0x3a58e5,_0x19554d){return client[_0xdef4('0x2')](_0xdef4('0x3'),{'body':_0x19554d,'options':{'where':{'id':_0x3a58e5}},'log':_0xdef4('0x4')});};exports[_0xdef4('0x5')]=function(_0x71c4c5,_0x267244){return client[_0xdef4('0x2')](_0xdef4('0x6'),{'body':_0x267244,'options':{'where':{'id':_0x71c4c5}},'log':_0xdef4('0x7')});}; \ No newline at end of file +var _0x814b=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x10ad7e,_0x1a9d2a){var _0x15f3c9=function(_0x4ec799){while(--_0x4ec799){_0x10ad7e['push'](_0x10ad7e['shift']());}};_0x15f3c9(++_0x1a9d2a);}(_0x814b,0x1a2));var _0xb814=function(_0x269e23,_0x14d11c){_0x269e23=_0x269e23-0x0;var _0x69ad53=_0x814b[_0x269e23];return _0x69ad53;};'use strict';var client=require(_0xb814('0x0'));exports[_0xb814('0x1')]=function(_0x434f30,_0x2f4ece){return client[_0xb814('0x2')](_0xb814('0x3'),{'body':_0x2f4ece,'options':{'where':{'id':_0x434f30}},'log':'updateWhatsappInteraction'});};exports[_0xb814('0x4')]=function(_0x3e1e9,_0x258866){return client[_0xb814('0x2')](_0xb814('0x5'),{'body':_0x258866,'options':{'where':{'id':_0x3e1e9}},'log':_0xb814('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index da056b0..550cb4e 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 _0xac65=['create','Request','CreateWhatsappMessage'];(function(_0xa92559,_0x1d2e45){var _0x502df8=function(_0x3321db){while(--_0x3321db){_0xa92559['push'](_0xa92559['shift']());}};_0x502df8(++_0x1d2e45);}(_0xac65,0x1d4));var _0x5ac6=function(_0x22f58c,_0x49cf92){_0x22f58c=_0x22f58c-0x0;var _0x3abef3=_0xac65[_0x22f58c];return _0x3abef3;};'use strict';var client=require('../client');exports[_0x5ac6('0x0')]=function(_0x39109f){return client[_0x5ac6('0x1')](_0x5ac6('0x2'),{'body':_0x39109f,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x75d8=['createWhatsappMessage','../client','CreateWhatsappMessage'];(function(_0x2d8543,_0x540bfb){var _0x1a8d3b=function(_0x3df969){while(--_0x3df969){_0x2d8543['push'](_0x2d8543['shift']());}};_0x1a8d3b(++_0x540bfb);}(_0x75d8,0xac));var _0x875d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75d8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x875d('0x0'));exports['create']=function(_0x534c57){return client['Request'](_0x875d('0x1'),{'body':_0x534c57,'log':_0x875d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 66ff064..15cd581 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 _0x7afc=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','../client'];(function(_0x48e6a1,_0x15743d){var _0x45fd3d=function(_0x59d4bb){while(--_0x59d4bb){_0x48e6a1['push'](_0x48e6a1['shift']());}};_0x45fd3d(++_0x15743d);}(_0x7afc,0x1d3));var _0xc7af=function(_0x86c0d5,_0x39c768){_0x86c0d5=_0x86c0d5-0x0;var _0x2a7ed0=_0x7afc[_0x86c0d5];return _0x2a7ed0;};'use strict';var client=require(_0xc7af('0x0'));exports[_0xc7af('0x1')]=function(){return function(){return client[_0xc7af('0x2')](_0xc7af('0x3'),{'options':{'raw':![],'attributes':['id',_0xc7af('0x4'),_0xc7af('0x5'),_0xc7af('0x6')],'include':[{'model':_0xc7af('0x7'),'as':_0xc7af('0x8'),'attributes':['id',_0xc7af('0x4'),'online','whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xcd4d=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','strategy','User','Agents'];(function(_0x21acd5,_0x4e6e91){var _0x1c5e8e=function(_0x957c7c){while(--_0x957c7c){_0x21acd5['push'](_0x21acd5['shift']());}};_0x1c5e8e(++_0x4e6e91);}(_0xcd4d,0xa4));var _0xdcd4=function(_0x29f189,_0x1289dc){_0x29f189=_0x29f189-0x0;var _0x244ba3=_0xcd4d[_0x29f189];return _0x244ba3;};'use strict';var client=require(_0xdcd4('0x0'));exports[_0xdcd4('0x1')]=function(){return function(){return client[_0xdcd4('0x2')](_0xdcd4('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xdcd4('0x4')],'include':[{'model':_0xdcd4('0x5'),'as':_0xdcd4('0x6'),'attributes':['id','name',_0xdcd4('0x7'),_0xdcd4('0x8')]}]},'log':_0xdcd4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 02546a2..594811b 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 _0xbc05=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x496fa2,_0x437e47){var _0x22ce22=function(_0x322163){while(--_0x322163){_0x496fa2['push'](_0x496fa2['shift']());}};_0x22ce22(++_0x437e47);}(_0xbc05,0x8e));var _0x5bc0=function(_0x1afa2d,_0x5ddeca){_0x1afa2d=_0x1afa2d-0x0;var _0x334a0d=_0xbc05[_0x1afa2d];return _0x334a0d;};'use strict';var client=require(_0x5bc0('0x0'));exports[_0x5bc0('0x1')]=function(_0x3792bc){return client[_0x5bc0('0x2')](_0x5bc0('0x3'),{'body':_0x3792bc,'log':_0x5bc0('0x3')});};exports[_0x5bc0('0x4')]=function(_0x2a9d95,_0x3846f1){return client[_0x5bc0('0x2')](_0x5bc0('0x5'),{'body':_0x3846f1,'options':{'where':{'uniqueid':_0x2a9d95},'order':[['id',_0x5bc0('0x6')]],'limit':0x1},'log':_0x5bc0('0x5')});}; \ No newline at end of file +var _0xe1a8=['DESC','UpdateWhatsappQueueReport','create','Request','update'];(function(_0x2b646b,_0x160427){var _0x52e823=function(_0x265dd9){while(--_0x265dd9){_0x2b646b['push'](_0x2b646b['shift']());}};_0x52e823(++_0x160427);}(_0xe1a8,0x70));var _0x8e1a=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0xe1a8[_0x1e5068];return _0x2230b6;};'use strict';var client=require('../client');exports[_0x8e1a('0x0')]=function(_0x5fb0f5){return client[_0x8e1a('0x1')]('CreateWhatsappQueueReport',{'body':_0x5fb0f5,'log':'CreateWhatsappQueueReport'});};exports[_0x8e1a('0x2')]=function(_0x7599ba,_0x52d8b4){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x52d8b4,'options':{'where':{'uniqueid':_0x7599ba},'order':[['id',_0x8e1a('0x3')]],'limit':0x1},'log':_0x8e1a('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 0c46c3f..67135a0 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 _0x574a=['timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','error','map','message','join','stop','find','agents','timeout','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','routing','./strategy','string'];(function(_0x297d89,_0x33d7e2){var _0x2597ef=function(_0x274897){while(--_0x274897){_0x297d89['push'](_0x297d89['shift']());}};_0x2597ef(++_0x33d7e2);}(_0x574a,0xb3));var _0xa574=function(_0x1bd34f,_0xe08e1b){_0x1bd34f=_0x1bd34f-0x0;var _0x4ce664=_0x574a[_0x1bd34f];return _0x4ce664;};'use strict';var schema=require(_0xa574('0x0'));var _=require(_0xa574('0x1'));var util=require(_0xa574('0x2'));var seqqueue=require(_0xa574('0x3'));var logger=require('../../../../config/logger')(_0xa574('0x4'));var strategy=require(_0xa574('0x5'));var queue=schema({'name':{'type':_0xa574('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xa574('0x7')}});function writeLog(_0x5d6ecf,_0x27278b,_0x14f34d){return logger[_0xa574('0x8')](util[_0xa574('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5d6ecf,_0x27278b[_0xa574('0xa')],_0x14f34d));}function handleFindAgent(_0x267f3f){return function(_0x2ba2c5){return _0x2ba2c5[_0xa574('0xa')]['toLowerCase']()===_0x267f3f[_0xa574('0xb')]();};}exports[_0xa574('0xc')]=function(_0x18ac85,_0x554240,_0x1fcc40,_0x1f1676){return function(_0x15d492){try{var _0x2daf71={'name':_0x554240[0x0],'timeout':_0x554240[0x1]};var _0x2981b3=queue[_0xa574('0x0')](_0x2daf71,{'typecast':!![]});if(_0x2981b3['length']){logger[_0xa574('0xd')]('[%s][AGENT]\x20%s',_0x18ac85,_[_0xa574('0xe')](_0x2981b3,_0xa574('0xf'))[_0xa574('0x10')](',\x20'));_0x15d492[_0xa574('0x11')]();}else{var _0x47a67e=_[_0xa574('0x12')](_0x1fcc40[_0xa574('0x13')],handleFindAgent(_0x2daf71[_0xa574('0xa')]));if(_0x47a67e){var _0x41f1f3=(_0x2daf71[_0xa574('0x14')]||0xa)*0x3e8;var _0x5b8f7f,_0x35e8f8;var _0xfd8519=seqqueue['createQueue'](_0x41f1f3);_0xfd8519['id']=_0x18ac85;_0xfd8519['atimeout']=_0x41f1f3;_0xfd8519['channel']=_0x1f1676['channel'];writeLog(_0x18ac85,_0x47a67e,util[_0xa574('0x9')](_0xa574('0x15'),_0x41f1f3));_0x1fcc40[_0xa574('0x16')][_0x18ac85]['on']('end',function(){logger['info'](_0xa574('0x17'),_0x18ac85);clearTimeout(_0x35e8f8);_0x35e8f8=undefined;_0xfd8519[_0xa574('0x18')]();if(_0x1fcc40['rules'][_0x18ac85]){delete _0x1fcc40[_0xa574('0x16')][_0x18ac85];}_0x15d492[_0xa574('0x11')]();});_0x1fcc40['rules'][_0x18ac85]['on'](_0xa574('0x19'),function(){if(_0x1fcc40[_0xa574('0x16')][_0x18ac85]){delete _0x1fcc40[_0xa574('0x16')][_0x18ac85];}});_0x35e8f8=setTimeout(function(){logger[_0xa574('0x8')](_0xa574('0x1a'),_0x18ac85);clearTimeout(_0x35e8f8);_0xfd8519['close']();_0x15d492['next']();},_0x41f1f3);strategy[_0xa574('0x1b')](_0xfd8519,_0x47a67e,_0x1fcc40,_0x1f1676);}else{logger['error'](_0xa574('0x1c'),_0x18ac85,_0x2daf71[_0xa574('0xa')]);_0x15d492[_0xa574('0x11')]();}}}catch(_0x2cb39a){console[_0xa574('0x1d')](_0x2cb39a);logger['error'](_0xa574('0x1e'),_0x18ac85,_0x2cb39a['stack']);_0x15d492[_0xa574('0x11')]();}};}; \ No newline at end of file +var _0x996e=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','channel','format','rules'];(function(_0x299985,_0x2e692a){var _0x1e1772=function(_0x266793){while(--_0x266793){_0x299985['push'](_0x299985['shift']());}};_0x1e1772(++_0x2e692a);}(_0x996e,0x1df));var _0xe996=function(_0x518969,_0x2866fb){_0x518969=_0x518969-0x0;var _0x43c283=_0x996e[_0x518969];return _0x43c283;};'use strict';var schema=require(_0xe996('0x0'));var _=require(_0xe996('0x1'));var util=require(_0xe996('0x2'));var seqqueue=require(_0xe996('0x3'));var logger=require('../../../../config/logger')(_0xe996('0x4'));var strategy=require(_0xe996('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xe996('0x6')},'timeout':{'type':_0xe996('0x7'),'message':_0xe996('0x8')}});function writeLog(_0x37ed47,_0x365d98,_0x6181c){return logger[_0xe996('0x9')](util['format'](_0xe996('0xa'),_0x37ed47,_0x365d98['name'],_0x6181c));}function handleFindAgent(_0x7fdda7){return function(_0x59b969){return _0x59b969[_0xe996('0xb')]['toLowerCase']()===_0x7fdda7['toLowerCase']();};}exports[_0xe996('0xc')]=function(_0x4556e9,_0x1ea9ed,_0x442c9a,_0x3dd614){return function(_0x45bfbe){try{var _0xeca864={'name':_0x1ea9ed[0x0],'timeout':_0x1ea9ed[0x1]};var _0x5317f4=queue[_0xe996('0x0')](_0xeca864,{'typecast':!![]});if(_0x5317f4['length']){logger[_0xe996('0xd')](_0xe996('0xe'),_0x4556e9,_[_0xe996('0xf')](_0x5317f4,_0xe996('0x10'))[_0xe996('0x11')](',\x20'));_0x45bfbe[_0xe996('0x12')]();}else{var _0xa83707=_[_0xe996('0x13')](_0x442c9a[_0xe996('0x14')],handleFindAgent(_0xeca864[_0xe996('0xb')]));if(_0xa83707){var _0x4a0dc2=(_0xeca864['timeout']||0xa)*0x3e8;var _0x40f2b6,_0x483a7d;var _0x2fee2d=seqqueue[_0xe996('0x15')](_0x4a0dc2);_0x2fee2d['id']=_0x4556e9;_0x2fee2d['atimeout']=_0x4a0dc2;_0x2fee2d[_0xe996('0x16')]=_0x3dd614[_0xe996('0x16')];writeLog(_0x4556e9,_0xa83707,util[_0xe996('0x17')]('START:%s',_0x4a0dc2));_0x442c9a[_0xe996('0x18')][_0x4556e9]['on'](_0xe996('0x19'),function(){logger['info'](_0xe996('0x1a'),_0x4556e9);clearTimeout(_0x483a7d);_0x483a7d=undefined;_0x2fee2d['close']();if(_0x442c9a[_0xe996('0x18')][_0x4556e9]){delete _0x442c9a['rules'][_0x4556e9];}_0x45bfbe[_0xe996('0x12')]();});_0x442c9a['rules'][_0x4556e9]['on'](_0xe996('0x1b'),function(){if(_0x442c9a[_0xe996('0x18')][_0x4556e9]){delete _0x442c9a[_0xe996('0x18')][_0x4556e9];}});_0x483a7d=setTimeout(function(){logger[_0xe996('0x9')](_0xe996('0x1c'),_0x4556e9);clearTimeout(_0x483a7d);_0x2fee2d[_0xe996('0x1d')]();_0x45bfbe[_0xe996('0x1e')]();},_0x4a0dc2);strategy[_0xe996('0x1f')](_0x2fee2d,_0xa83707,_0x442c9a,_0x3dd614);}else{logger['error'](_0xe996('0x20'),_0x4556e9,_0xeca864[_0xe996('0xb')]);_0x45bfbe[_0xe996('0x12')]();}}}catch(_0x208b65){console[_0xe996('0x21')](_0x208b65);logger['error'](_0xe996('0x22'),_0x4556e9,_0x208b65[_0xe996('0x23')]);_0x45bfbe['stop']();}};}; \ 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 ed332ee..fdccfa7 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 _0x2b87=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','Failed','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction','created','Message','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2b87,0x17b));var _0x72b8=function(_0xb554d2,_0x9fda1d){_0xb554d2=_0xb554d2-0x0;var _0x558050=_0x2b87[_0xb554d2];return _0x558050;};'use strict';var _=require(_0x72b8('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x72b8('0x1'));var logger=require('../../../../config/logger')(_0x72b8('0x2'));var rpc={'chatMessage':require(_0x72b8('0x3')),'openchannelMessage':require(_0x72b8('0x4')),'mailMessage':require(_0x72b8('0x5')),'smsMessage':require(_0x72b8('0x6')),'faxMessage':require(_0x72b8('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x72b8('0x8')]=function(_0xf52c16,_0x5be14c){return function(_0x5bf2dc){try{if(!_[_0x72b8('0x9')](this['interaction'][_0x72b8('0xa')])){logger[_0x72b8('0xb')](_0x72b8('0xc'),_0xf52c16,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5bf2dc[_0x72b8('0xd')]();}var _0x13f9a6={'ContactId':this[_0x72b8('0xe')]['id'],'sentAt':moment()[_0x72b8('0xf')](_0x72b8('0x10')),'direction':'out'};if(this[_0x72b8('0x11')]==='sms'||this[_0x72b8('0x11')]===_0x72b8('0x12')){_0x13f9a6[_0x72b8('0x13')]=this['interaction'][_0x72b8('0x13')];}var _0x380c5c=this[_0x72b8('0x11')];if(_0x380c5c===_0x72b8('0x14')){_0x13f9a6[_0x72b8('0x15')]=this[_0x72b8('0x16')]['id'];}else{_0x13f9a6[_[_0x72b8('0x17')](_0x380c5c)+_0x72b8('0x18')]=this[_0x72b8('0x16')]['id'];}_0x13f9a6[_[_0x72b8('0x17')](_0x380c5c)+'InteractionId']=this[_0x72b8('0x19')]['id'];if(this[_0x72b8('0x19')][_0x72b8('0x1a')]){var _0x100e73=_0x5be14c[0x4];if(!_['isEmpty'](_0x100e73)){_0x13f9a6['body']=utils['getMustacheRender'](_0x100e73,this);return rpc[_0x380c5c+_0x72b8('0x1b')]['create'](_0x13f9a6)[_0x72b8('0x1c')](function(_0x51fe2e){logger['info'](_0x72b8('0xc'),_0xf52c16,_0x13f9a6[_0x72b8('0x1d')]);})['catch'](function(_0x5d9213){logger[_0x72b8('0x1e')](_0x72b8('0xc'),_0xf52c16,JSON[_0x72b8('0x1f')](_0x5d9213));})[_0x72b8('0x20')](function(){logger[_0x72b8('0xb')](_0x72b8('0x21'),_0xf52c16);_0x5bf2dc[_0x72b8('0x22')]();});}else{logger[_0x72b8('0xb')](_0x72b8('0x23'),_0xf52c16);_0x5bf2dc[_0x72b8('0x22')]();}}else{var _0x13af9e=this;var _0x308a67=new AWS['LexRuntime']({'accessKeyId':_0x5be14c[0x0],'secretAccessKey':_0x5be14c[0x1],'region':_0x5be14c[0x2]});var _0x4a0fbf={'botAlias':_0x72b8('0x24'),'botName':_0x5be14c[0x3],'inputText':this[_0x72b8('0x25')][_0x72b8('0x1d')],'userId':this[_0x72b8('0x11')]+':'+this[_0x72b8('0x19')]['id'][_0x72b8('0x26')]()};_0x308a67[_0x72b8('0x27')](_0x4a0fbf,function(_0xd49094,_0x3144f2){if(_0xd49094){logger[_0x72b8('0x1e')](_0x72b8('0xc'),_0xf52c16,_0xd49094['message']);_0x5bf2dc['next']();}else if(_0x3144f2&&_0x3144f2[_0x72b8('0x25')]){_0x13af9e[_0x72b8('0x1d')][_0x72b8('0x28')]=_0x3144f2;_0x13f9a6[_0x72b8('0x1d')]=_0x3144f2[_0x72b8('0x25')];_0x13f9a6[_0x72b8('0x29')]='amazonlex';_0x13f9a6[_0x72b8('0x2a')]=JSON[_0x72b8('0x1f')](_0x3144f2);return rpc[_0x380c5c+'Message'][_0x72b8('0x2b')](_0x13f9a6)['then'](function(_0x4e1c43){logger[_0x72b8('0xb')](_0x72b8('0xc'),_0xf52c16,_0x13f9a6[_0x72b8('0x1d')]);if(_0x3144f2[_0x72b8('0x2c')]==_0x72b8('0x2d')){_0x5bf2dc['next']();}else{_0x5bf2dc['stop']();}})['catch'](function(_0x165895){logger[_0x72b8('0x1e')]('[%s][AMAZONLEX]\x20%s',_0xf52c16,JSON[_0x72b8('0x1f')](_0x165895));_0x5bf2dc['next']();});}else{_0x5bf2dc[_0x72b8('0xd')]();}});}}catch(_0x5b7bc5){logger[_0x72b8('0x1e')](_0x72b8('0xc'),_0xf52c16,JSON[_0x72b8('0x1f')](_0x5b7bc5));_0x5bf2dc[_0x72b8('0x22')]();}};}; \ No newline at end of file +var _0x36c2=['toString','next','providerName','providerResponse','dialogState','Failed','catch','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','sms','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','then','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!','LexRuntime','$LATEST','message'];(function(_0x2ff705,_0x500860){var _0x4b9510=function(_0x533cea){while(--_0x533cea){_0x2ff705['push'](_0x2ff705['shift']());}};_0x4b9510(++_0x500860);}(_0x36c2,0xc7));var _0x236c=function(_0x50ece8,_0x5a0f8e){_0x50ece8=_0x50ece8-0x0;var _0x579597=_0x36c2[_0x50ece8];return _0x579597;};'use strict';var _=require(_0x236c('0x0'));var moment=require('moment');var AWS=require(_0x236c('0x1'));var utils=require(_0x236c('0x2'));var logger=require(_0x236c('0x3'))(_0x236c('0x4'));var rpc={'chatMessage':require(_0x236c('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x236c('0x6')),'smsMessage':require(_0x236c('0x7')),'faxMessage':require(_0x236c('0x8')),'whatsappMessage':require(_0x236c('0x9'))};exports[_0x236c('0xa')]=function(_0x3c04e8,_0x196b8f){return function(_0x3b1a93){try{if(!_['isNil'](this[_0x236c('0xb')][_0x236c('0xc')])){logger[_0x236c('0xd')](_0x236c('0xe'),_0x3c04e8,_0x236c('0xf'));return _0x3b1a93['next']();}var _0x1a09b9={'ContactId':this[_0x236c('0x10')]['id'],'sentAt':moment()[_0x236c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x236c('0x12')]===_0x236c('0x13')||this[_0x236c('0x12')]===_0x236c('0x14')){_0x1a09b9[_0x236c('0x15')]=this['interaction'][_0x236c('0x15')];}var _0x4750e5=this['channel'];if(_0x4750e5===_0x236c('0x16')){_0x1a09b9['ChatWebsiteId']=this[_0x236c('0x17')]['id'];}else{_0x1a09b9[_[_0x236c('0x18')](_0x4750e5)+'AccountId']=this[_0x236c('0x17')]['id'];}_0x1a09b9[_[_0x236c('0x18')](_0x4750e5)+_0x236c('0x19')]=this[_0x236c('0xb')]['id'];if(this[_0x236c('0xb')][_0x236c('0x1a')]){var _0x336daf=_0x196b8f[0x4];if(!_[_0x236c('0x1b')](_0x336daf)){_0x1a09b9[_0x236c('0x1c')]=utils[_0x236c('0x1d')](_0x336daf,this);return rpc[_0x4750e5+'Message'][_0x236c('0x1e')](_0x1a09b9)[_0x236c('0x1f')](function(_0x2e8c17){logger[_0x236c('0xd')](_0x236c('0xe'),_0x3c04e8,_0x1a09b9[_0x236c('0x1c')]);})['catch'](function(_0x22275e){logger[_0x236c('0x20')]('[%s][AMAZONLEX]\x20%s',_0x3c04e8,JSON[_0x236c('0x21')](_0x22275e));})[_0x236c('0x22')](function(){logger[_0x236c('0xd')](_0x236c('0x23'),_0x3c04e8);_0x3b1a93[_0x236c('0x24')]();});}else{logger[_0x236c('0xd')](_0x236c('0x25'),_0x3c04e8);_0x3b1a93[_0x236c('0x24')]();}}else{var _0x253cb2=this;var _0x264db2=new AWS[(_0x236c('0x26'))]({'accessKeyId':_0x196b8f[0x0],'secretAccessKey':_0x196b8f[0x1],'region':_0x196b8f[0x2]});var _0x42c9ce={'botAlias':_0x236c('0x27'),'botName':_0x196b8f[0x3],'inputText':this[_0x236c('0x28')][_0x236c('0x1c')],'userId':this[_0x236c('0x12')]+':'+this['interaction']['id'][_0x236c('0x29')]()};_0x264db2['postText'](_0x42c9ce,function(_0x2e6acc,_0x1623bc){if(_0x2e6acc){logger[_0x236c('0x20')](_0x236c('0xe'),_0x3c04e8,_0x2e6acc[_0x236c('0x28')]);_0x3b1a93[_0x236c('0x2a')]();}else if(_0x1623bc&&_0x1623bc[_0x236c('0x28')]){_0x253cb2[_0x236c('0x1c')]['amazonlex']=_0x1623bc;_0x1a09b9[_0x236c('0x1c')]=_0x1623bc[_0x236c('0x28')];_0x1a09b9[_0x236c('0x2b')]='amazonlex';_0x1a09b9[_0x236c('0x2c')]=JSON['stringify'](_0x1623bc);return rpc[_0x4750e5+'Message'][_0x236c('0x1e')](_0x1a09b9)[_0x236c('0x1f')](function(_0x201916){logger[_0x236c('0xd')](_0x236c('0xe'),_0x3c04e8,_0x1a09b9['body']);if(_0x1623bc[_0x236c('0x2d')]==_0x236c('0x2e')){_0x3b1a93[_0x236c('0x2a')]();}else{_0x3b1a93[_0x236c('0x24')]();}})[_0x236c('0x2f')](function(_0x535373){logger[_0x236c('0x20')]('[%s][AMAZONLEX]\x20%s',_0x3c04e8,JSON[_0x236c('0x21')](_0x535373));_0x3b1a93[_0x236c('0x2a')]();});}else{_0x3b1a93[_0x236c('0x2a')]();}});}}catch(_0x58dab1){logger[_0x236c('0x20')](_0x236c('0xe'),_0x3c04e8,JSON[_0x236c('0x21')](_0x58dab1));_0x3b1a93['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 888c694..851a581 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 _0x6332=['../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','info','Autoreply\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','message','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','messageId','','replace','','headers','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','then','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x6332,0xfb));var _0x2633=function(_0x219d0f,_0x281336){_0x219d0f=_0x219d0f-0x0;var _0x3dd5c6=_0x6332[_0x219d0f];return _0x3dd5c6;};'use strict';var _=require('lodash');var moment=require(_0x2633('0x0'));var utils=require(_0x2633('0x1'));var logger=require('../../../../config/logger')(_0x2633('0x2'));var rpc={'chatMessage':require(_0x2633('0x3')),'openchannelMessage':require(_0x2633('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2633('0x5')),'faxMessage':require(_0x2633('0x6')),'whatsappMessage':require(_0x2633('0x7')),'chatInteraction':require(_0x2633('0x8')),'openchannelInteraction':require(_0x2633('0x9')),'mailInteraction':require(_0x2633('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x2633('0xb')),'whatsappInteraction':require(_0x2633('0xc'))};var mailRpc=require(_0x2633('0xd'));exports[_0x2633('0xe')]=function(_0x53b896,_0x3741e4,_0xf901e5,_0x592544){return function(_0xc9fe03){try{var _0x1298ba=this[_0x2633('0xf')];if(_0x1298ba===_0x2633('0x10')&&_0x592544[_0x2633('0x11')][_0x2633('0x12')]){logger['info'](_0x2633('0x13'),_0x53b896,_0x2633('0x14'));return _0xc9fe03[_0x2633('0x15')]();}if(_0x3741e4[0x0]==='1'&&(_['isNil'](this[_0x2633('0x16')]['created'])||!this[_0x2633('0x16')][_0x2633('0x17')])){logger[_0x2633('0x18')](_0x2633('0x13'),_0x53b896,_0x2633('0x19'));return _0xc9fe03[_0x2633('0x15')]();}if(_0x3741e4[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x53b896,'One\x20Time\x20already\x20sent');return _0xc9fe03[_0x2633('0x15')]();}var _0x2c321e={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2633('0x1a')](_0x2633('0x1b')),'direction':_0x2633('0x1c')};if(this[_0x2633('0xf')]===_0x2633('0x10')){_0x2c321e[_0x2633('0x11')]=utils['getMustacheRender'](_0x3741e4[0x2],this);}else{_0x2c321e[_0x2633('0x11')]=utils['getMustacheRender'](_0x3741e4[0x1],this);}if(this[_0x2633('0x1d')]){_0x2c321e['to']=this[_0x2633('0x1d')]['from']||'';if(this[_0x2633('0xf')]==='mail'&&_0x3741e4[0x1]==='1'){_0x2c321e['cc']=this[_0x2633('0x1d')]['cc']||'';}_0x2c321e['from']=this[_0x2633('0x1d')]['to']||'';_0x2c321e[_0x2633('0x1e')]=this[_0x2633('0x1d')][_0x2633('0x1e')]||'';_0x2c321e[_0x2633('0x1f')]=!![];if(this[_0x2633('0x1d')]['subject']){_0x2c321e[_0x2633('0x20')]='';_0x2c321e['subject']+=_[_0x2633('0x21')](this[_0x2633('0x1d')][_0x2633('0x20')],'Re:')?'':_0x2633('0x22');_0x2c321e[_0x2633('0x20')]+=this[_0x2633('0x1d')]['subject'];}}if(this[_0x2633('0xf')]===_0x2633('0x23')){_0x2c321e[_0x2633('0x24')]=this[_0x2633('0x25')]['id'];}else{_0x2c321e[_[_0x2633('0x26')](this[_0x2633('0xf')])+_0x2633('0x27')]=this['account']['id'];}_0x2c321e[_[_0x2633('0x26')](this['channel'])+_0x2633('0x28')]=this['interaction']['id'];var _0x16b6a4=this[_0x2633('0x16')];if(rpc[this[_0x2633('0xf')]+'Message']){if(this[_0x2633('0xf')]===_0x2633('0x10')){_0x2c321e[_0x2633('0x29')]=this['message'][_0x2633('0x2a')];_0x2c321e['html']=_0x2633('0x2b')+_[_0x2633('0x2c')](_0x2c321e['body'],_0x2633('0x2d'),_0x2633('0x2e'))+_0x2633('0x2f');_0x2c321e[_0x2633('0x30')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x2633('0x31'),'Precedence':'auto_reply'};return mailRpc[_0x2633('0x32')](this[_0x2633('0x25')][_0x2633('0x33')],_0x2c321e)['then'](function(_0x545a82){logger[_0x2633('0x18')](_0x2633('0x34'),_0x53b896);_0x2c321e[_0x2633('0x2a')]=_0x545a82[_0x2633('0x1d')][_0x2633('0x2a')];return rpc[_0x1298ba+_0x2633('0x35')][_0x2633('0x36')](_0x2c321e);})[_0x2633('0x37')](function(_0x2d6e8b){logger[_0x2633('0x18')]('[%s][AUTOREPLY]\x20%s',_0x53b896,JSON['stringify'](_0x2d6e8b));})[_0x2633('0x38')](function(_0x144391){logger[_0x2633('0x39')](_0x2633('0x3a'),_0x53b896,JSON[_0x2633('0x3b')](_0x144391));})[_0x2633('0x3c')](function(){Promise[_0x2633('0x3d')]()['then'](function(){if(_0x3741e4[0x0]!=='2'||_0x16b6a4[_0x2633('0x3e')])return;return rpc[_0x1298ba+'Interaction'][_0x2633('0x3f')](_0x16b6a4['id'],{'autoreplyExecuted':!![]})[_0x2633('0x37')](function(_0x121dea){logger[_0x2633('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x53b896,JSON['stringify'](_0x121dea));})['catch'](function(_0x1fcd8b){logger[_0x2633('0x39')](_0x2633('0x40'),_0x53b896,JSON['stringify'](_0x1fcd8b));});})[_0x2633('0x37')](function(){_0xc9fe03[_0x2633('0x15')]();});});}else{return rpc[this['channel']+'Message'][_0x2633('0x36')](_0x2c321e)['then'](function(){logger[_0x2633('0x18')]('[%s][AUTOREPLY]\x20%s',_0x53b896,_0x2c321e[_0x2633('0x11')]);})[_0x2633('0x38')](function(_0x3ec4bc){logger['error'](_0x2633('0x13'),_0x53b896,JSON[_0x2633('0x3b')](_0x3ec4bc));})[_0x2633('0x3c')](function(){Promise[_0x2633('0x3d')]()[_0x2633('0x37')](function(){if(_0x3741e4[0x0]!=='2'||_0x16b6a4[_0x2633('0x3e')])return;return rpc[_0x1298ba+'Interaction'][_0x2633('0x3f')](_0x16b6a4['id'],{'autoreplyExecuted':!![]})[_0x2633('0x37')](function(_0x282951){logger[_0x2633('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x53b896,JSON[_0x2633('0x3b')](_0x282951));})['catch'](function(_0x53cc14){logger['error'](_0x2633('0x40'),_0x53b896,JSON['stringify'](_0x53cc14));});})[_0x2633('0x37')](function(){_0xc9fe03[_0x2633('0x15')]();});});}}}catch(_0x1d4a02){logger['error'](_0x2633('0x13'),_0x53b896,JSON[_0x2633('0x3b')](_0x1d4a02));_0xc9fe03[_0x2633('0x41')]();}};}; \ No newline at end of file +var _0x4841=['auto-replied','All','sendMailMessage','smtpOptions','then','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','body','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','replace','','headers'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x4841,0x174));var _0x1484=function(_0x50b4e1,_0x596e9a){_0x50b4e1=_0x50b4e1-0x0;var _0x54a577=_0x4841[_0x50b4e1];return _0x54a577;};'use strict';var _=require(_0x1484('0x0'));var moment=require(_0x1484('0x1'));var utils=require(_0x1484('0x2'));var logger=require(_0x1484('0x3'))(_0x1484('0x4'));var rpc={'chatMessage':require(_0x1484('0x5')),'openchannelMessage':require(_0x1484('0x6')),'mailMessage':require(_0x1484('0x7')),'smsMessage':require(_0x1484('0x8')),'faxMessage':require(_0x1484('0x9')),'whatsappMessage':require(_0x1484('0xa')),'chatInteraction':require(_0x1484('0xb')),'openchannelInteraction':require(_0x1484('0xc')),'mailInteraction':require(_0x1484('0xd')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1484('0xe'))};var mailRpc=require(_0x1484('0xf'));exports['consequence']=function(_0x2887df,_0x431ccd,_0x816f01,_0x10340c){return function(_0x3e2e19){try{var _0x1a7905=this['channel'];if(_0x1a7905===_0x1484('0x10')&&_0x10340c['body']['isAutoreply']){logger[_0x1484('0x11')]('[%s][AUTOREPLY]\x20%s',_0x2887df,_0x1484('0x12'));return _0x3e2e19[_0x1484('0x13')]();}if(_0x431ccd[0x0]==='1'&&(_[_0x1484('0x14')](this['interaction']['created'])||!this[_0x1484('0x15')][_0x1484('0x16')])){logger['info'](_0x1484('0x17'),_0x2887df,'Autoreply\x20already\x20sent');return _0x3e2e19['next']();}if(_0x431ccd[0x0]==='2'&&this[_0x1484('0x15')][_0x1484('0x18')]){logger[_0x1484('0x11')](_0x1484('0x19'),_0x2887df,'One\x20Time\x20already\x20sent');return _0x3e2e19[_0x1484('0x13')]();}var _0x4e1f2e={'ContactId':this[_0x1484('0x1a')]['id'],'sentAt':moment()[_0x1484('0x1b')](_0x1484('0x1c')),'direction':_0x1484('0x1d')};if(this[_0x1484('0x1e')]===_0x1484('0x10')){_0x4e1f2e[_0x1484('0x1f')]=utils['getMustacheRender'](_0x431ccd[0x2],this);}else{_0x4e1f2e[_0x1484('0x1f')]=utils[_0x1484('0x20')](_0x431ccd[0x1],this);}if(this[_0x1484('0x21')]){_0x4e1f2e['to']=this['message'][_0x1484('0x22')]||'';if(this['channel']===_0x1484('0x10')&&_0x431ccd[0x1]==='1'){_0x4e1f2e['cc']=this['message']['cc']||'';}_0x4e1f2e[_0x1484('0x22')]=this[_0x1484('0x21')]['to']||'';_0x4e1f2e[_0x1484('0x23')]=this[_0x1484('0x21')]['phone']||'';_0x4e1f2e['read']=!![];if(this[_0x1484('0x21')][_0x1484('0x24')]){_0x4e1f2e['subject']='';_0x4e1f2e[_0x1484('0x24')]+=_[_0x1484('0x25')](this[_0x1484('0x21')][_0x1484('0x24')],_0x1484('0x26'))?'':_0x1484('0x27');_0x4e1f2e[_0x1484('0x24')]+=this[_0x1484('0x21')][_0x1484('0x24')];}}if(this[_0x1484('0x1e')]===_0x1484('0x28')){_0x4e1f2e[_0x1484('0x29')]=this[_0x1484('0x2a')]['id'];}else{_0x4e1f2e[_[_0x1484('0x2b')](this[_0x1484('0x1e')])+_0x1484('0x2c')]=this[_0x1484('0x2a')]['id'];}_0x4e1f2e[_[_0x1484('0x2b')](this[_0x1484('0x1e')])+_0x1484('0x2d')]=this['interaction']['id'];var _0x36a7f5=this['interaction'];if(rpc[this[_0x1484('0x1e')]+_0x1484('0x2e')]){if(this[_0x1484('0x1e')]===_0x1484('0x10')){_0x4e1f2e[_0x1484('0x2f')]=this[_0x1484('0x21')]['messageId'];_0x4e1f2e[_0x1484('0x30')]=_0x1484('0x31')+_[_0x1484('0x32')](_0x4e1f2e[_0x1484('0x1f')],']+(>|$)/g,''),'priorityTrue':_0x54a8c2[0x1],'priorityFalse':_0x54a8c2[0x2]};var _0x495ef5=gotoif[_0xf76a('0x0')](_0x43f94d,{'typecast':!![]});if(_0x495ef5[_0xf76a('0xc')]){logger[_0xf76a('0xd')](_0xf76a('0xe'),_0x33040a,_['map'](_0x495ef5,_0xf76a('0xf'))[_0xf76a('0x10')](',\x20'));_0x2bd8f3['stop']();}else{try{var _0x8753ab=eval('('+_0x43f94d[_0xf76a('0x11')]+')');var _0x5941dc=_0x8753ab?_0x43f94d[_0xf76a('0x12')]:_0x43f94d[_0xf76a('0x13')];logger[_0xf76a('0x14')](_0xf76a('0x15'),_0x33040a,_0x43f94d[_0xf76a('0x11')],_0x8753ab,_0x5941dc||_0xf76a('0x16'));if(_0x5941dc){var _0x169535=_[_0xf76a('0x17')](_0x2bd8f3[_0xf76a('0x18')](),{'p':_0x5941dc});if(_0x169535>=0x0){logger[_0xf76a('0x14')](_0xf76a('0x19'),_0x33040a,_0x5941dc||'next',_0x169535);_0x2bd8f3[_0xf76a('0x16')](_0x169535);}else{logger[_0xf76a('0x14')](_0xf76a('0x1a'),_0x33040a,_0x5941dc||'next');_0x2bd8f3[_0xf76a('0x1b')]();}}else{_0x2bd8f3[_0xf76a('0x16')]();}}catch(_0xcc4cb8){logger[_0xf76a('0xd')](_0xf76a('0x1c'),_0x33040a,_0xcc4cb8['message']);_0x2bd8f3[_0xf76a('0x1b')]();}}}catch(_0x49f8f4){logger[_0xf76a('0xd')](_0xf76a('0xe'),_0x33040a,JSON['stringify'](_0x49f8f4));_0x2bd8f3['stop']();}};}; \ No newline at end of file +var _0xcb6a=['validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xcb6a,0x134));var _0xacb6=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xcb6a[_0x19b3f9];return _0x18c3f6;};'use strict';var schema=require(_0xacb6('0x0'));var _=require(_0xacb6('0x1'));var htmlToText=require(_0xacb6('0x2'));var utils=require(_0xacb6('0x3'));var logger=require('../../../../config/logger')(_0xacb6('0x4'));var gotoif=schema({'condition':{'type':_0xacb6('0x5'),'required':!![],'message':_0xacb6('0x6')},'priorityTrue':{'type':_0xacb6('0x7'),'message':_0xacb6('0x8')},'priorityFalse':{'type':_0xacb6('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xacb6('0x9')]=function(_0x5233f4,_0x42a7e2){return function(_0x218a4e){try{var _0x21cb98={'condition':htmlToText[_0xacb6('0xa')](utils['getMustacheRender'](_0x42a7e2[0x0],this),{'wordwrap':![]})[_0xacb6('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x42a7e2[0x1],'priorityFalse':_0x42a7e2[0x2]};var _0x5674e9=gotoif[_0xacb6('0x0')](_0x21cb98,{'typecast':!![]});if(_0x5674e9[_0xacb6('0xc')]){logger[_0xacb6('0xd')](_0xacb6('0xe'),_0x5233f4,_['map'](_0x5674e9,_0xacb6('0xf'))[_0xacb6('0x10')](',\x20'));_0x218a4e[_0xacb6('0x11')]();}else{try{var _0x5bdb5c=eval('('+_0x21cb98[_0xacb6('0x12')]+')');var _0x4a2acd=_0x5bdb5c?_0x21cb98[_0xacb6('0x13')]:_0x21cb98[_0xacb6('0x14')];logger['info'](_0xacb6('0x15'),_0x5233f4,_0x21cb98[_0xacb6('0x12')],_0x5bdb5c,_0x4a2acd||_0xacb6('0x16'));if(_0x4a2acd){var _0x3588da=_[_0xacb6('0x17')](_0x218a4e['rules'](),{'p':_0x4a2acd});if(_0x3588da>=0x0){logger[_0xacb6('0x18')](_0xacb6('0x19'),_0x5233f4,_0x4a2acd||_0xacb6('0x16'),_0x3588da);_0x218a4e[_0xacb6('0x16')](_0x3588da);}else{logger[_0xacb6('0x18')](_0xacb6('0x1a'),_0x5233f4,_0x4a2acd||_0xacb6('0x16'));_0x218a4e[_0xacb6('0x11')]();}}else{_0x218a4e[_0xacb6('0x16')]();}}catch(_0x4c79c6){logger['error'](_0xacb6('0x1b'),_0x5233f4,_0x4c79c6['message']);_0x218a4e[_0xacb6('0x11')]();}}}catch(_0x2fe394){logger['error'](_0xacb6('0xe'),_0x5233f4,JSON['stringify'](_0x2fe394));_0x218a4e[_0xacb6('0x11')]();}};}; \ 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 22334c0..359a406 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 _0x663a=['[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error'];(function(_0x3813ed,_0x52ac41){var _0x3537aa=function(_0x4237af){while(--_0x4237af){_0x3813ed['push'](_0x3813ed['shift']());}};_0x3537aa(++_0x52ac41);}(_0x663a,0x13d));var _0xa663=function(_0x1d13c9,_0xf6db87){_0x1d13c9=_0x1d13c9-0x0;var _0xeba7e7=_0x663a[_0x1d13c9];return _0xeba7e7;};'use strict';var schema=require('validate');var _=require(_0xa663('0x0'));var logger=require('../../../../config/logger')(_0xa663('0x1'));var gotop=schema({'priority':{'type':_0xa663('0x2'),'required':!![],'message':_0xa663('0x3')}});exports['consequence']=function(_0x1a7a26,_0x1d97de){return function(_0x5ea821){try{var _0x55c068={'priority':_0x1d97de[0x0]};var _0x1a4983=gotop[_0xa663('0x4')](_0x55c068,{'typecast':!![]});if(_0x1a4983[_0xa663('0x5')]){logger[_0xa663('0x6')](_0xa663('0x7'),_0x1a7a26,_[_0xa663('0x8')](_0x1a4983,'message')[_0xa663('0x9')](',\x20'));_0x5ea821['stop']();}else{logger[_0xa663('0xa')](_0xa663('0xb'),_0x1a7a26,_0x55c068['priority']);if(_0x55c068[_0xa663('0xc')]){var _0x4bb875=_[_0xa663('0xd')](_0x5ea821['rules'](),{'p':_0x55c068[_0xa663('0xc')]});if(_0x4bb875>=0x0){logger[_0xa663('0xa')](_0xa663('0xe'),_0x1a7a26,_0x55c068[_0xa663('0xc')]||'next',_0x4bb875);_0x5ea821[_0xa663('0xf')](_0x4bb875);}else{logger[_0xa663('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1a7a26,_0x55c068[_0xa663('0xc')]||_0xa663('0xf'));_0x5ea821[_0xa663('0x10')]();}}else{_0x5ea821['next']();}}}catch(_0x198513){logger[_0xa663('0x6')](_0xa663('0x7'),_0x1a7a26,JSON[_0xa663('0x11')](_0x198513));_0x5ea821[_0xa663('0x10')]();}};}; \ No newline at end of file +var _0xacb5=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','join','stop'];(function(_0x1572e4,_0x1a6ae7){var _0x513685=function(_0x4b29e3){while(--_0x4b29e3){_0x1572e4['push'](_0x1572e4['shift']());}};_0x513685(++_0x1a6ae7);}(_0xacb5,0x121));var _0x5acb=function(_0x3e45a6,_0x576195){_0x3e45a6=_0x3e45a6-0x0;var _0x4751f7=_0xacb5[_0x3e45a6];return _0x4751f7;};'use strict';var schema=require(_0x5acb('0x0'));var _=require(_0x5acb('0x1'));var logger=require(_0x5acb('0x2'))('routing');var gotop=schema({'priority':{'type':_0x5acb('0x3'),'required':!![],'message':_0x5acb('0x4')}});exports[_0x5acb('0x5')]=function(_0x486b9e,_0x3fbb78){return function(_0x13f500){try{var _0x2c389c={'priority':_0x3fbb78[0x0]};var _0x1fce8f=gotop['validate'](_0x2c389c,{'typecast':!![]});if(_0x1fce8f['length']){logger[_0x5acb('0x6')](_0x5acb('0x7'),_0x486b9e,_[_0x5acb('0x8')](_0x1fce8f,'message')[_0x5acb('0x9')](',\x20'));_0x13f500[_0x5acb('0xa')]();}else{logger[_0x5acb('0xb')](_0x5acb('0xc'),_0x486b9e,_0x2c389c['priority']);if(_0x2c389c[_0x5acb('0xd')]){var _0xa9a259=_[_0x5acb('0xe')](_0x13f500[_0x5acb('0xf')](),{'p':_0x2c389c[_0x5acb('0xd')]});if(_0xa9a259>=0x0){logger[_0x5acb('0xb')](_0x5acb('0x10'),_0x486b9e,_0x2c389c[_0x5acb('0xd')]||'next',_0xa9a259);_0x13f500[_0x5acb('0x11')](_0xa9a259);}else{logger[_0x5acb('0xb')](_0x5acb('0x12'),_0x486b9e,_0x2c389c[_0x5acb('0xd')]||'next');_0x13f500[_0x5acb('0xa')]();}}else{_0x13f500[_0x5acb('0x11')]();}}}catch(_0x10cbda){logger[_0x5acb('0x6')]('[%s][GOTOP]\x20%s',_0x486b9e,JSON[_0x5acb('0x13')](_0x10cbda));_0x13f500[_0x5acb('0xa')]();}};}; \ 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 e174291..e5ebe2c 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 _0x7426=['AccountId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','chat','ChatWebsiteId','account','upperFirst','channel'];(function(_0x37dab4,_0x5322ef){var _0x42eea8=function(_0x378d7b){while(--_0x378d7b){_0x37dab4['push'](_0x37dab4['shift']());}};_0x42eea8(++_0x5322ef);}(_0x7426,0x1df));var _0x6742=function(_0x3582a9,_0x150168){_0x3582a9=_0x3582a9-0x0;var _0x19c3d9=_0x7426[_0x3582a9];return _0x19c3d9;};'use strict';var _=require('lodash');var utils=require(_0x6742('0x0'));var logger=require(_0x6742('0x1'))(_0x6742('0x2'));var rpc={'chatMessage':require(_0x6742('0x3')),'openchannelMessage':require(_0x6742('0x4')),'mailMessage':require(_0x6742('0x5')),'smsMessage':require(_0x6742('0x6')),'faxMessage':require(_0x6742('0x7')),'whatsappMessage':require(_0x6742('0x8'))};exports['consequence']=function(_0x38ec2a,_0x4ecd1f){return function(_0x27f04a){try{var _0x14219c={'body':utils[_0x6742('0x9')](_0x4ecd1f[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x6742('0xa')){_0x14219c[_0x6742('0xb')]=this[_0x6742('0xc')]['id'];}else{_0x14219c[_[_0x6742('0xd')](this[_0x6742('0xe')])+_0x6742('0xf')]=this['account']['id'];}_0x14219c[_[_0x6742('0xd')](this[_0x6742('0xe')])+'InteractionId']=this[_0x6742('0x10')]['id'];if(rpc[this[_0x6742('0xe')]+_0x6742('0x11')]){return rpc[this[_0x6742('0xe')]+_0x6742('0x11')][_0x6742('0x12')](_0x14219c)['then'](function(_0x5914de){logger[_0x6742('0x13')](_0x6742('0x14'),_0x38ec2a,_0x14219c['body']);_0x27f04a[_0x6742('0x15')]();})[_0x6742('0x16')](function(_0xaf4cdc){logger[_0x6742('0x17')](_0x6742('0x14'),_0x38ec2a,JSON[_0x6742('0x18')](_0xaf4cdc));_0x27f04a['stop']();});}}catch(_0x3d89e2){logger[_0x6742('0x17')](_0x6742('0x14'),_0x38ec2a,JSON['stringify'](_0x3d89e2));_0x27f04a[_0x6742('0x19')]();}};}; \ No newline at end of file +var _0xa400=['AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0x2e1f7e,_0x34f690){var _0x304c03=function(_0x3054ba){while(--_0x3054ba){_0x2e1f7e['push'](_0x2e1f7e['shift']());}};_0x304c03(++_0x34f690);}(_0xa400,0x1cf));var _0x0a40=function(_0x386bcb,_0x521e62){_0x386bcb=_0x386bcb-0x0;var _0x2e1d47=_0xa400[_0x386bcb];return _0x2e1d47;};'use strict';var _=require(_0x0a40('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0a40('0x1')),'openchannelMessage':require(_0x0a40('0x2')),'mailMessage':require(_0x0a40('0x3')),'smsMessage':require(_0x0a40('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x2a6a7b,_0x235f65){return function(_0x3559b5){try{var _0x1bd797={'body':utils[_0x0a40('0x5')](_0x235f65[0x0],this),'ContactId':this[_0x0a40('0x6')]['id']};if(this[_0x0a40('0x7')]===_0x0a40('0x8')){_0x1bd797[_0x0a40('0x9')]=this[_0x0a40('0xa')]['id'];}else{_0x1bd797[_[_0x0a40('0xb')](this['channel'])+_0x0a40('0xc')]=this['account']['id'];}_0x1bd797[_[_0x0a40('0xb')](this[_0x0a40('0x7')])+_0x0a40('0xd')]=this[_0x0a40('0xe')]['id'];if(rpc[this[_0x0a40('0x7')]+_0x0a40('0xf')]){return rpc[this['channel']+_0x0a40('0xf')][_0x0a40('0x10')](_0x1bd797)[_0x0a40('0x11')](function(_0x26386f){logger[_0x0a40('0x12')](_0x0a40('0x13'),_0x2a6a7b,_0x1bd797[_0x0a40('0x14')]);_0x3559b5[_0x0a40('0x15')]();})['catch'](function(_0x4fb0c1){logger[_0x0a40('0x16')](_0x0a40('0x13'),_0x2a6a7b,JSON[_0x0a40('0x17')](_0x4fb0c1));_0x3559b5[_0x0a40('0x18')]();});}}catch(_0x547dd7){logger[_0x0a40('0x16')](_0x0a40('0x13'),_0x2a6a7b,JSON[_0x0a40('0x17')](_0x547dd7));_0x3559b5[_0x0a40('0x18')]();}};}; \ 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 e4ae84d..fe6fb8a 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 _0xeba7=['info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop','./utils','consequence'];(function(_0x399114,_0x34e9cf){var _0x5dac88=function(_0x9d06c3){while(--_0x9d06c3){_0x399114['push'](_0x399114['shift']());}};_0x5dac88(++_0x34e9cf);}(_0xeba7,0x7e));var _0x7eba=function(_0x519c0f,_0x26b0b5){_0x519c0f=_0x519c0f-0x0;var _0x69a46f=_0xeba7[_0x519c0f];return _0x69a46f;};'use strict';var utils=require(_0x7eba('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x7eba('0x1')]=function(_0x5f5794,_0xa00d6a){return function(_0x3681c7){try{logger[_0x7eba('0x2')](_0x7eba('0x3'),_0x5f5794,utils[_0x7eba('0x4')](_0xa00d6a[0x0],this));_0x3681c7['next']();}catch(_0x100462){logger[_0x7eba('0x5')]('[%s][NOOP]\x20%s',_0x5f5794,JSON[_0x7eba('0x6')](_0x100462));_0x3681c7[_0x7eba('0x7')]();}};}; \ No newline at end of file +var _0x18ed=['getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x5158b3,_0x10070b){var _0x365543=function(_0x56c956){while(--_0x56c956){_0x5158b3['push'](_0x5158b3['shift']());}};_0x365543(++_0x10070b);}(_0x18ed,0xaa));var _0xd18e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x18ed[_0x2641f9];return _0x585741;};'use strict';var utils=require(_0xd18e('0x0'));var logger=require(_0xd18e('0x1'))(_0xd18e('0x2'));exports[_0xd18e('0x3')]=function(_0x142019,_0x454c6b){return function(_0x2ea9db){try{logger[_0xd18e('0x4')](_0xd18e('0x5'),_0x142019,utils[_0xd18e('0x6')](_0x454c6b[0x0],this));_0x2ea9db[_0xd18e('0x7')]();}catch(_0x4fb9b9){logger[_0xd18e('0x8')](_0xd18e('0x5'),_0x142019,JSON[_0xd18e('0x9')](_0x4fb9b9));_0x2ea9db[_0xd18e('0xa')]();}};}; \ 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 b9d606c..6332163 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 _0x7505=['seq-queue','moment','ioredis','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','next','beepall','stack','validate','util'];(function(_0x3279cf,_0x1e0fec){var _0x53bdc6=function(_0x8232a4){while(--_0x8232a4){_0x3279cf['push'](_0x3279cf['shift']());}};_0x53bdc6(++_0x1e0fec);}(_0x7505,0x1d2));var _0x5750=function(_0x16d68f,_0x576779){_0x16d68f=_0x16d68f-0x0;var _0xbc18bd=_0x7505[_0x16d68f];return _0xbc18bd;};'use strict';var schema=require(_0x5750('0x0'));var _=require('lodash');var util=require(_0x5750('0x1'));var seqqueue=require(_0x5750('0x2'));var moment=require(_0x5750('0x3'));var Redis=require(_0x5750('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x5750('0x5'));var strategy=require(_0x5750('0x6'));config[_0x5750('0x7')]=_[_0x5750('0x8')](config['redis'],{'host':_0x5750('0x9'),'port':0x18eb});var io=require(_0x5750('0xa'))(new Redis(config['redis']));var attributes=['id',_0x5750('0xb'),_0x5750('0xc'),_0x5750('0xd'),_0x5750('0xe'),_0x5750('0xf')];function emit(_0x1fefb1,_0xac89c2,_0x3782c5){io['to'](_0x1fefb1)[_0x5750('0x10')](_0xac89c2,_0x3782c5);}function emitChannelQueueInteraction(_0x4da250,_0x3fcf74,_0x2287a2,_0x497f9c,_0x2b8099,_0x583c63,_0x58b69f,_0x261c84){var _0x46514b=_[_0x5750('0x11')](_0x2287a2);_0x46514b['queue_id']=_0x261c84;_0x46514b[_0x5750('0xd')]=_0x3fcf74;_0x46514b[_0x5750('0xc')]=_0x497f9c;_0x46514b['id']=_0x2b8099;if(_0x583c63){_0x58b69f[util[_0x5750('0x12')](_0x5750('0x13'),_0x4da250)][_0x2b8099]=_['pick'](_0x46514b,attributes);}else{delete _0x58b69f[util['format'](_0x5750('0x13'),_0x4da250)][_0x2b8099];}emit(util[_0x5750('0x12')](_0x5750('0x14'),_0x4da250,_0x3fcf74),util[_0x5750('0x12')](_0x5750('0x15'),_0x4da250,_0x583c63?'save':_0x5750('0x16')),_[_0x5750('0x17')](_0x46514b,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x5750('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x5750('0x19')),'whatsappQueueReport':require(_0x5750('0x1a'))};var queue=schema({'name':{'type':_0x5750('0x1b'),'required':!![],'message':_0x5750('0x1c')},'timeout':{'type':_0x5750('0x1d'),'message':_0x5750('0x1e')}});function startRouting(_0x4469d6,_0x516a28,_0x2c91ad,_0x179844){if(_0x4469d6&&_0x516a28&&_0x2c91ad){_0x516a28['waiting']+=0x1;var _0x1e8c1c={'uniqueid':_0x4469d6,'from':_0x2c91ad[_0x5750('0x1f')]?_0x2c91ad[_0x5750('0x1f')][_0x5750('0xe')]:'','joinAt':moment()['format'](_0x5750('0x20')),'ContactId':_0x2c91ad['contact']?_0x2c91ad[_0x5750('0x21')]['id']:null,'ListId':_0x2c91ad[_0x5750('0x22')]?_0x2c91ad[_0x5750('0x22')]['id']:null};_0x1e8c1c[_[_0x5750('0x23')](_0x2c91ad[_0x5750('0x24')])+_0x5750('0x25')]=_0x516a28['id']||null;_0x1e8c1c[_[_0x5750('0x23')](_0x2c91ad['channel'])+_0x5750('0x26')]=_0x2c91ad[_0x5750('0x27')]?_0x2c91ad[_0x5750('0x27')]['id']:null;_0x1e8c1c[_[_0x5750('0x23')](_0x2c91ad[_0x5750('0x24')])+_0x5750('0x28')]=_0x2c91ad[_0x5750('0x29')]?_0x2c91ad[_0x5750('0x29')]['id']:null;_0x1e8c1c[_[_0x5750('0x23')](_0x2c91ad[_0x5750('0x24')])+(_0x2c91ad[_0x5750('0x24')]!==_0x5750('0x2a')?_0x5750('0x2b'):_0x5750('0x2c'))]=_0x2c91ad[_0x5750('0xc')]?_0x2c91ad[_0x5750('0xc')]['id']:null;logger['info'](util['format'](_0x5750('0x2d'),_0x4469d6,_0x516a28[_0x5750('0x2e')]));emitChannelQueueInteraction(_0x2c91ad['channel'],_0x516a28[_0x5750('0x2e')],_0x1e8c1c,_0x2c91ad[_0x5750('0xc')][_0x5750('0x2e')],_0x2c91ad[_0x5750('0x29')]['id'],!![],_0x179844,_0x516a28['id']);if(rpc[_0x2c91ad[_0x5750('0x24')]+'QueueReport']){return rpc[_0x2c91ad['channel']+_0x5750('0x2f')][_0x5750('0x30')](_0x1e8c1c)['catch'](function(_0x1fb14c){logger[_0x5750('0x31')](_0x5750('0x32'));});}}}function stopRouting(_0x42ee90,_0x11acf3,_0x5240fc,_0x4c09ab){if(_0x42ee90&&_0x11acf3){_0x11acf3[_0x5750('0x33')]-=0x1;var _0xc602b2={'leaveAt':moment()[_0x5750('0x12')](_0x5750('0x20')),'acceptAt':moment()['format'](_0x5750('0x20')),'reason':_0x5750('0x34')};logger['info'](util['format'](_0x5750('0x35'),_0x42ee90,_0x11acf3[_0x5750('0x2e')]));emitChannelQueueInteraction(_0x5240fc[_0x5750('0x24')],_0x11acf3['name'],_0x5240fc[_0x5750('0x1f')],_0x5240fc[_0x5750('0xc')][_0x5750('0x2e')],_0x5240fc['message']['id'],![],_0x4c09ab,_0x11acf3['id']);if(rpc[_0x5240fc[_0x5750('0x24')]+_0x5750('0x2f')]){return rpc[_0x5240fc[_0x5750('0x24')]+_0x5750('0x2f')][_0x5750('0x36')](_0x42ee90,_0xc602b2)[_0x5750('0x37')](function(_0x1652bf){logger['error'](_0x5750('0x38'));});}}}function endRouting(_0x2dde8e,_0x51bb32,_0x3978fc,_0x4ee4b6){if(_0x2dde8e&&_0x51bb32){_0x51bb32[_0x5750('0x33')]-=0x1;var _0x31126c={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x5750('0x12')](_0x5750('0x20')),'reason':_0x5750('0x39')};logger[_0x5750('0x3a')](util['format'](_0x5750('0x3b'),_0x2dde8e,_0x51bb32[_0x5750('0x2e')]));emitChannelQueueInteraction(_0x3978fc[_0x5750('0x24')],_0x51bb32[_0x5750('0x2e')],_0x3978fc[_0x5750('0x1f')],_0x3978fc[_0x5750('0xc')][_0x5750('0x2e')],_0x3978fc[_0x5750('0x29')]['id'],![],_0x4ee4b6);if(rpc[_0x3978fc[_0x5750('0x24')]+_0x5750('0x2f')]){return rpc[_0x3978fc[_0x5750('0x24')]+'QueueReport'][_0x5750('0x36')](_0x2dde8e,_0x31126c)[_0x5750('0x37')](function(_0xefc110){logger[_0x5750('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x2e5e92){return function(_0x597b23){return _0x597b23[_0x5750('0x2e')][_0x5750('0x3c')]()===_0x2e5e92[_0x5750('0x3c')]();};}exports[_0x5750('0x3d')]=function(_0x38cf5b,_0x104038,_0x581067,_0x4b0e7f){return function(_0x2647cf){try{var _0x401804={'name':_0x104038[0x0],'timeout':_0x104038[0x1]};var _0x790abf=queue[_0x5750('0x0')](_0x401804,{'typecast':!![]});if(_0x790abf[_0x5750('0x3e')]){logger['error'](_0x5750('0x3f'),_0x38cf5b,_['map'](_0x790abf,_0x5750('0x29'))[_0x5750('0x40')](',\x20'));_0x2647cf[_0x5750('0x41')]();}else{var _0x54d68a=_[_0x5750('0x42')](_0x581067[_0x4b0e7f[_0x5750('0x24')]+_0x5750('0x43')],handleFindQueue(_0x401804[_0x5750('0x2e')]));if(_0x54d68a){startRouting(_0x38cf5b,_0x54d68a,_0x4b0e7f,_0x581067);var _0x3ff56b=(_0x54d68a[_0x5750('0x39')]||0xa)*0x3e8;var _0x5153b9=(_0x401804[_0x5750('0x39')]||0x14)*0x3e8;var _0x1385e5,_0x143789;if(_0x3ff56b>_0x5153b9){_0x5153b9=_0x3ff56b;}var _0x3c7b0e=seqqueue[_0x5750('0x44')](_0x3ff56b);_0x3c7b0e['id']=_0x38cf5b;_0x3c7b0e[_0x5750('0x45')]=_0x3ff56b;_0x3c7b0e['qtimeout']=_0x5153b9;_0x3c7b0e[_0x5750('0x24')]=_0x4b0e7f[_0x5750('0x24')];_0x581067['rules'][_0x38cf5b]['on'](_0x5750('0x46'),function(){logger[_0x5750('0x3a')](_0x5750('0x47'),_0x38cf5b);stopRouting(_0x38cf5b,_0x54d68a,_0x4b0e7f,_0x581067);clearTimeout(_0x1385e5);_0x1385e5=undefined;_0x3c7b0e[_0x5750('0x48')](!![]);if(_0x581067[_0x5750('0x49')][_0x38cf5b]){delete _0x581067['rules'][_0x38cf5b];}_0x2647cf['stop']();});_0x581067[_0x5750('0x49')][_0x38cf5b]['on'](_0x5750('0x4a'),function(){if(_0x581067[_0x5750('0x49')][_0x38cf5b]){delete _0x581067[_0x5750('0x49')][_0x38cf5b];}});_0x1385e5=setTimeout(function(){logger[_0x5750('0x3a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x38cf5b);endRouting(_0x38cf5b,_0x54d68a,_0x4b0e7f,_0x581067);clearTimeout(_0x1385e5);_0x3c7b0e['close'](!![]);_0x2647cf[_0x5750('0x4b')]();},_0x5153b9);switch(_0x54d68a['strategy']){case'rrmemory':strategy['rrmemory'](_0x3c7b0e,_0x54d68a,_0x581067,_0x4b0e7f);break;default:strategy[_0x5750('0x4c')](_0x3c7b0e,_0x54d68a,_0x581067,_0x4b0e7f);}}else{logger[_0x5750('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x38cf5b,_0x401804[_0x5750('0x2e')]);_0x2647cf[_0x5750('0x41')]();}}}catch(_0x3358ab){console['log'](_0x3358ab);logger[_0x5750('0x31')](_0x5750('0x3f'),_0x38cf5b,_0x3358ab[_0x5750('0x4d')]);_0x2647cf[_0x5750('0x41')]();}};}; \ No newline at end of file +var _0x2028=['info','[%s][END:QUEUE][NAME:%s]','error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout'];(function(_0x290ff7,_0x3f9da2){var _0x336f73=function(_0x464058){while(--_0x464058){_0x290ff7['push'](_0x290ff7['shift']());}};_0x336f73(++_0x3f9da2);}(_0x2028,0x64));var _0x8202=function(_0x57fabc,_0x4f89c2){_0x57fabc=_0x57fabc-0x0;var _0x4fd94a=_0x2028[_0x57fabc];return _0x4fd94a;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8202('0x0'));var seqqueue=require(_0x8202('0x1'));var moment=require(_0x8202('0x2'));var Redis=require('ioredis');var config=require(_0x8202('0x3'));var logger=require(_0x8202('0x4'))(_0x8202('0x5'));var strategy=require('./strategy');config[_0x8202('0x6')]=_['defaults'](config[_0x8202('0x6')],{'host':_0x8202('0x7'),'port':0x18eb});var io=require(_0x8202('0x8'))(new Redis(config[_0x8202('0x6')]));var attributes=['id','queue_id',_0x8202('0x9'),_0x8202('0xa'),_0x8202('0xb'),_0x8202('0xc')];function emit(_0x304e44,_0x2240e8,_0x28d36e){io['to'](_0x304e44)['emit'](_0x2240e8,_0x28d36e);}function emitChannelQueueInteraction(_0x15ea36,_0x30c55e,_0xb427eb,_0x14ccd2,_0x46589d,_0x362211,_0x3075d7,_0xd6fe9){var _0x40027d=_[_0x8202('0xd')](_0xb427eb);_0x40027d[_0x8202('0xe')]=_0xd6fe9;_0x40027d[_0x8202('0xa')]=_0x30c55e;_0x40027d[_0x8202('0x9')]=_0x14ccd2;_0x40027d['id']=_0x46589d;if(_0x362211){_0x3075d7[util[_0x8202('0xf')](_0x8202('0x10'),_0x15ea36)][_0x46589d]=_[_0x8202('0x11')](_0x40027d,attributes);}else{delete _0x3075d7[util[_0x8202('0xf')]('%sQueuesWaitingInteractions',_0x15ea36)][_0x46589d];}emit(util[_0x8202('0xf')](_0x8202('0x12'),_0x15ea36,_0x30c55e),util[_0x8202('0xf')](_0x8202('0x13'),_0x15ea36,_0x362211?_0x8202('0x14'):_0x8202('0x15')),_[_0x8202('0x11')](_0x40027d,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8202('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8202('0x17'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8202('0x18'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x127666,_0x2cba24,_0x9086cf,_0x43c242){if(_0x127666&&_0x2cba24&&_0x9086cf){_0x2cba24[_0x8202('0x19')]+=0x1;var _0x57472f={'uniqueid':_0x127666,'from':_0x9086cf[_0x8202('0x1a')]?_0x9086cf['body'][_0x8202('0xb')]:'','joinAt':moment()[_0x8202('0xf')](_0x8202('0x1b')),'ContactId':_0x9086cf[_0x8202('0x1c')]?_0x9086cf[_0x8202('0x1c')]['id']:null,'ListId':_0x9086cf[_0x8202('0x1d')]?_0x9086cf['list']['id']:null};_0x57472f[_[_0x8202('0x1e')](_0x9086cf[_0x8202('0x1f')])+_0x8202('0x20')]=_0x2cba24['id']||null;_0x57472f[_[_0x8202('0x1e')](_0x9086cf[_0x8202('0x1f')])+_0x8202('0x21')]=_0x9086cf[_0x8202('0x22')]?_0x9086cf[_0x8202('0x22')]['id']:null;_0x57472f[_['upperFirst'](_0x9086cf[_0x8202('0x1f')])+_0x8202('0x23')]=_0x9086cf[_0x8202('0x24')]?_0x9086cf[_0x8202('0x24')]['id']:null;_0x57472f[_[_0x8202('0x1e')](_0x9086cf['channel'])+(_0x9086cf[_0x8202('0x1f')]!==_0x8202('0x25')?_0x8202('0x26'):'WebsiteId')]=_0x9086cf['account']?_0x9086cf[_0x8202('0x9')]['id']:null;logger['info'](util[_0x8202('0xf')](_0x8202('0x27'),_0x127666,_0x2cba24[_0x8202('0x28')]));emitChannelQueueInteraction(_0x9086cf[_0x8202('0x1f')],_0x2cba24['name'],_0x57472f,_0x9086cf['account'][_0x8202('0x28')],_0x9086cf['message']['id'],!![],_0x43c242,_0x2cba24['id']);if(rpc[_0x9086cf[_0x8202('0x1f')]+_0x8202('0x29')]){return rpc[_0x9086cf[_0x8202('0x1f')]+_0x8202('0x29')][_0x8202('0x2a')](_0x57472f)[_0x8202('0x2b')](function(_0x41562a){logger['error'](_0x8202('0x2c'));});}}}function stopRouting(_0x55c120,_0x24a44e,_0x3cf230,_0x28fb2d){if(_0x55c120&&_0x24a44e){_0x24a44e[_0x8202('0x19')]-=0x1;var _0x36343c={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x8202('0xf')](_0x8202('0x1b')),'reason':_0x8202('0x2d')};logger['info'](util[_0x8202('0xf')](_0x8202('0x2e'),_0x55c120,_0x24a44e[_0x8202('0x28')]));emitChannelQueueInteraction(_0x3cf230[_0x8202('0x1f')],_0x24a44e[_0x8202('0x28')],_0x3cf230['body'],_0x3cf230[_0x8202('0x9')][_0x8202('0x28')],_0x3cf230[_0x8202('0x24')]['id'],![],_0x28fb2d,_0x24a44e['id']);if(rpc[_0x3cf230[_0x8202('0x1f')]+_0x8202('0x29')]){return rpc[_0x3cf230[_0x8202('0x1f')]+_0x8202('0x29')][_0x8202('0x2f')](_0x55c120,_0x36343c)[_0x8202('0x2b')](function(_0x244018){logger['error'](_0x8202('0x30'));});}}}function endRouting(_0x51ad55,_0x5c0dcc,_0x9daf71,_0x2c8d74){if(_0x51ad55&&_0x5c0dcc){_0x5c0dcc[_0x8202('0x19')]-=0x1;var _0x2ec65b={'leaveAt':moment()[_0x8202('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x8202('0xf')](_0x8202('0x1b')),'reason':_0x8202('0x31')};logger[_0x8202('0x32')](util[_0x8202('0xf')](_0x8202('0x33'),_0x51ad55,_0x5c0dcc[_0x8202('0x28')]));emitChannelQueueInteraction(_0x9daf71[_0x8202('0x1f')],_0x5c0dcc['name'],_0x9daf71['body'],_0x9daf71[_0x8202('0x9')]['name'],_0x9daf71[_0x8202('0x24')]['id'],![],_0x2c8d74);if(rpc[_0x9daf71[_0x8202('0x1f')]+_0x8202('0x29')]){return rpc[_0x9daf71[_0x8202('0x1f')]+_0x8202('0x29')]['update'](_0x51ad55,_0x2ec65b)[_0x8202('0x2b')](function(_0x4cdd14){logger[_0x8202('0x34')](_0x8202('0x30'));});}}}function handleFindQueue(_0x1346c7){return function(_0x125903){return _0x125903[_0x8202('0x28')][_0x8202('0x35')]()===_0x1346c7[_0x8202('0x35')]();};}exports[_0x8202('0x36')]=function(_0x1b671a,_0x4184cc,_0x199c54,_0x3a2e7b){return function(_0xe8d583){try{var _0x23e275={'name':_0x4184cc[0x0],'timeout':_0x4184cc[0x1]};var _0x3aef80=queue['validate'](_0x23e275,{'typecast':!![]});if(_0x3aef80[_0x8202('0x37')]){logger[_0x8202('0x34')](_0x8202('0x38'),_0x1b671a,_[_0x8202('0x39')](_0x3aef80,_0x8202('0x24'))[_0x8202('0x3a')](',\x20'));_0xe8d583[_0x8202('0x3b')]();}else{var _0x1a7b6a=_[_0x8202('0x3c')](_0x199c54[_0x3a2e7b[_0x8202('0x1f')]+'Queues'],handleFindQueue(_0x23e275[_0x8202('0x28')]));if(_0x1a7b6a){startRouting(_0x1b671a,_0x1a7b6a,_0x3a2e7b,_0x199c54);var _0x51771d=(_0x1a7b6a['timeout']||0xa)*0x3e8;var _0x4689c2=(_0x23e275[_0x8202('0x31')]||0x14)*0x3e8;var _0x599992,_0x569384;if(_0x51771d>_0x4689c2){_0x4689c2=_0x51771d;}var _0x1a205d=seqqueue[_0x8202('0x3d')](_0x51771d);_0x1a205d['id']=_0x1b671a;_0x1a205d[_0x8202('0x3e')]=_0x51771d;_0x1a205d[_0x8202('0x3f')]=_0x4689c2;_0x1a205d[_0x8202('0x1f')]=_0x3a2e7b[_0x8202('0x1f')];_0x199c54[_0x8202('0x40')][_0x1b671a]['on'](_0x8202('0x41'),function(){logger[_0x8202('0x32')](_0x8202('0x42'),_0x1b671a);stopRouting(_0x1b671a,_0x1a7b6a,_0x3a2e7b,_0x199c54);clearTimeout(_0x599992);_0x599992=undefined;_0x1a205d[_0x8202('0x43')](!![]);if(_0x199c54[_0x8202('0x40')][_0x1b671a]){delete _0x199c54['rules'][_0x1b671a];}_0xe8d583['stop']();});_0x199c54['rules'][_0x1b671a]['on'](_0x8202('0x44'),function(){if(_0x199c54['rules'][_0x1b671a]){delete _0x199c54['rules'][_0x1b671a];}});_0x599992=setTimeout(function(){logger[_0x8202('0x32')](_0x8202('0x45'),_0x1b671a);endRouting(_0x1b671a,_0x1a7b6a,_0x3a2e7b,_0x199c54);clearTimeout(_0x599992);_0x1a205d['close'](!![]);_0xe8d583[_0x8202('0x46')]();},_0x4689c2);switch(_0x1a7b6a['strategy']){case'rrmemory':strategy[_0x8202('0x47')](_0x1a205d,_0x1a7b6a,_0x199c54,_0x3a2e7b);break;default:strategy[_0x8202('0x48')](_0x1a205d,_0x1a7b6a,_0x199c54,_0x3a2e7b);}}else{logger[_0x8202('0x34')](_0x8202('0x49'),_0x1b671a,_0x23e275[_0x8202('0x28')]);_0xe8d583[_0x8202('0x3b')]();}}}catch(_0x3d37fc){console[_0x8202('0x4a')](_0x3d37fc);logger[_0x8202('0x34')](_0x8202('0x38'),_0x1b671a,_0x3d37fc['stack']);_0xe8d583[_0x8202('0x3b')]();}};}; \ 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 5b389d3..3585654 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 _0xabb3=['prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xabb3,0x1d2));var _0x3abb=function(_0x4bd181,_0x1175d8){_0x4bd181=_0x4bd181-0x0;var _0x1ca876=_0xabb3[_0x4bd181];return _0x1ca876;};'use strict';var _=require(_0x3abb('0x0'));var uuid=require('uuid');var util=require(_0x3abb('0x1'));var logger=require(_0x3abb('0x2'))(_0x3abb('0x3'));var Agent=function(_0x4ad414,_0x122944,_0x221265,_0xfc65f7){this[_0x3abb('0x4')]=uuid['v4']();this[_0x3abb('0x5')]=_0x4ad414;this[_0x3abb('0x6')]=_0x122944;this[_0x3abb('0x7')]=_0x221265;this[_0x3abb('0x3')]=_0xfc65f7;this[_0x3abb('0x5')][_0x3abb('0x8')](this[_0x3abb('0x9')][_0x3abb('0xa')](this),this[_0x3abb('0xb')][_0x3abb('0xa')](this));this['squeue']['on']('timeout',this['handleTimeout']['bind'](this));this['squeue']['on'](_0x3abb('0xc'),this[_0x3abb('0xd')][_0x3abb('0xa')](this));};Agent['prototype'][_0x3abb('0x8')]=function(){this[_0x3abb('0x5')]['push'](this[_0x3abb('0x9')]['bind'](this),this[_0x3abb('0xb')][_0x3abb('0xa')](this));};Agent[_0x3abb('0xe')][_0x3abb('0xd')]=function(){this[_0x3abb('0xb')](!![]);};Agent[_0x3abb('0xe')][_0x3abb('0x9')]=function(){logger[_0x3abb('0xf')](_0x3abb('0x10'),this[_0x3abb('0x5')]['id'],this[_0x3abb('0x6')]['id']);if(_[_0x3abb('0x11')](this[_0x3abb('0x7')][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']])){logger['debug'](_0x3abb('0x13'),this[_0x3abb('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x3abb('0x8')][_0x3abb('0xa')](this),0x3e8);}else{if(this[_0x3abb('0x3')][_0x3abb('0x14')]||util['isAgentAvailable'](this[_0x3abb('0x5')]['id'],this[_0x3abb('0x7')][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']],this['squeue'][_0x3abb('0x15')],![])){this[_0x3abb('0x7')][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']]['busy']=!![];this[_0x3abb('0x7')][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']][_0x3abb('0x16')]=undefined;util[_0x3abb('0x17')](this[_0x3abb('0x4')],this[_0x3abb('0x5')]['id'],this['realtime'][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']],null,this[_0x3abb('0x3')]);util['writeLog'](this[_0x3abb('0x5')]['id'],this[_0x3abb('0x7')][_0x3abb('0x12')][this[_0x3abb('0x6')]['id']],'RINGING'+(this[_0x3abb('0x3')][_0x3abb('0x14')]?':FORCED':''));}else{logger[_0x3abb('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x3abb('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x3abb('0x8')][_0x3abb('0xa')](this),0x3e8);}}};Agent[_0x3abb('0xe')][_0x3abb('0xb')]=function(_0x15af0c){if(_[_0x3abb('0x11')](this['realtime']['agents'][this[_0x3abb('0x6')]['id']])){return logger[_0x3abb('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x3abb('0x5')]['id'],this[_0x3abb('0x6')]['id']);}else{logger[_0x3abb('0xf')](_0x3abb('0x18'),this['squeue']['id'],this[_0x3abb('0x6')]['id']);util[_0x3abb('0x19')](this[_0x3abb('0x4')],this[_0x3abb('0x5')]['id'],this[_0x3abb('0x7')][_0x3abb('0x12')][this['agent']['id']],null,this[_0x3abb('0x3')]);this[_0x3abb('0x7')]['agents'][this['agent']['id']][_0x3abb('0x1a')]=![];this['realtime']['agents'][this[_0x3abb('0x6')]['id']][_0x3abb('0x16')]=undefined;util['writeLog'](this[_0x3abb('0x5')]['id'],this[_0x3abb('0x7')]['agents'][this[_0x3abb('0x6')]['id']],_0x15af0c?_0x3abb('0x1b'):_0x3abb('0x1c'));}if(!_0x15af0c){setTimeout(this[_0x3abb('0x8')]['bind'](this),0x3e8);}};function agent(_0x17a0ee,_0x4cc6dc,_0x2d566f,_0x441040){return new Agent(_0x17a0ee,_0x4cc6dc,_0x2d566f,_0x441040);}module[_0x3abb('0x1d')]=agent; \ No newline at end of file +var _0x04ab=['timeout','drained','handleDrained','prototype','handleRun','isNil','agents','debug','forcedOwnership','isAgentAvailable','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','notificationId','agent','realtime','routing','push','bind','handleTimeout','squeue'];(function(_0x5bdbfd,_0x3aaf24){var _0x5711c0=function(_0x14b3ac){while(--_0x14b3ac){_0x5bdbfd['push'](_0x5bdbfd['shift']());}};_0x5711c0(++_0x3aaf24);}(_0x04ab,0x1e4));var _0xb04a=function(_0x157602,_0x29ed83){_0x157602=_0x157602-0x0;var _0x161e15=_0x04ab[_0x157602];return _0x161e15;};'use strict';var _=require('lodash');var uuid=require(_0xb04a('0x0'));var util=require(_0xb04a('0x1'));var logger=require(_0xb04a('0x2'))('routing');var Agent=function(_0x47dcfd,_0x59d218,_0x1263e6,_0x1a9054){this[_0xb04a('0x3')]=uuid['v4']();this['squeue']=_0x47dcfd;this[_0xb04a('0x4')]=_0x59d218;this[_0xb04a('0x5')]=_0x1263e6;this[_0xb04a('0x6')]=_0x1a9054;this['squeue'][_0xb04a('0x7')](this['handleRun'][_0xb04a('0x8')](this),this[_0xb04a('0x9')][_0xb04a('0x8')](this));this[_0xb04a('0xa')]['on'](_0xb04a('0xb'),this[_0xb04a('0x9')][_0xb04a('0x8')](this));this[_0xb04a('0xa')]['on'](_0xb04a('0xc'),this[_0xb04a('0xd')]['bind'](this));};Agent[_0xb04a('0xe')][_0xb04a('0x7')]=function(){this[_0xb04a('0xa')][_0xb04a('0x7')](this[_0xb04a('0xf')]['bind'](this),this['handleTimeout'][_0xb04a('0x8')](this));};Agent[_0xb04a('0xe')][_0xb04a('0xd')]=function(){this[_0xb04a('0x9')](!![]);};Agent[_0xb04a('0xe')][_0xb04a('0xf')]=function(){logger['debug']('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0xb04a('0x4')]['id']);if(_[_0xb04a('0x10')](this[_0xb04a('0x5')][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']])){logger[_0xb04a('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb04a('0xa')]['id'],this['agent']['id']);setTimeout(this[_0xb04a('0x7')][_0xb04a('0x8')](this),0x3e8);}else{if(this[_0xb04a('0x6')][_0xb04a('0x13')]||util[_0xb04a('0x14')](this[_0xb04a('0xa')]['id'],this['realtime'][_0xb04a('0x11')][this['agent']['id']],this[_0xb04a('0xa')]['channel'],![])){this[_0xb04a('0x5')][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']]['busy']=!![];this[_0xb04a('0x5')][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']][_0xb04a('0x15')]=undefined;util[_0xb04a('0x16')](this[_0xb04a('0x3')],this[_0xb04a('0xa')]['id'],this[_0xb04a('0x5')][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']],null,this['routing']);util[_0xb04a('0x17')](this[_0xb04a('0xa')]['id'],this['realtime']['agents'][this[_0xb04a('0x4')]['id']],_0xb04a('0x18')+(this[_0xb04a('0x6')][_0xb04a('0x13')]?_0xb04a('0x19'):''));}else{logger[_0xb04a('0x12')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xb04a('0xa')]['id'],this[_0xb04a('0x4')]['id']);setTimeout(this[_0xb04a('0x7')][_0xb04a('0x8')](this),0x3e8);}}};Agent['prototype'][_0xb04a('0x9')]=function(_0x5801b9){if(_[_0xb04a('0x10')](this[_0xb04a('0x5')][_0xb04a('0x11')][this['agent']['id']])){return logger[_0xb04a('0x12')](_0xb04a('0x1a'),this[_0xb04a('0xa')]['id'],this['agent']['id']);}else{logger[_0xb04a('0x12')](_0xb04a('0x1b'),this['squeue']['id'],this[_0xb04a('0x4')]['id']);util[_0xb04a('0x1c')](this[_0xb04a('0x3')],this[_0xb04a('0xa')]['id'],this['realtime']['agents'][this[_0xb04a('0x4')]['id']],null,this[_0xb04a('0x6')]);this['realtime'][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']][_0xb04a('0x1d')]=![];this['realtime'][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']][_0xb04a('0x15')]=undefined;util[_0xb04a('0x17')](this['squeue']['id'],this[_0xb04a('0x5')][_0xb04a('0x11')][this[_0xb04a('0x4')]['id']],_0x5801b9?_0xb04a('0x1e'):_0xb04a('0x1f'));}if(!_0x5801b9){setTimeout(this[_0xb04a('0x7')]['bind'](this),0x3e8);}};function agent(_0x4199c9,_0x3e20e7,_0x51bb2d,_0xe435a1){return new Agent(_0x4199c9,_0x3e20e7,_0x51bb2d,_0xe435a1);}module[_0xb04a('0x20')]=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 ce41ffd..261c7a7 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 _0xee53=['drained','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','busy','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout'];(function(_0x2963b7,_0x41f398){var _0x3d202a=function(_0x4bef40){while(--_0x4bef40){_0x2963b7['push'](_0x2963b7['shift']());}};_0x3d202a(++_0x41f398);}(_0xee53,0xa8));var _0x3ee5=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0xee53[_0x318256];return _0xb1e352;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x3ee5('0x0'));var logger=require(_0x3ee5('0x1'))(_0x3ee5('0x2'));var Beepall=function(_0x5d31e0,_0x3217ab,_0x25de7e,_0x17d29c){this[_0x3ee5('0x3')]=uuid['v4']();this[_0x3ee5('0x4')]=_0x5d31e0;this[_0x3ee5('0x5')]=_0x3217ab;this[_0x3ee5('0x6')]=_0x25de7e;this[_0x3ee5('0x2')]=_0x17d29c;this[_0x3ee5('0x4')][_0x3ee5('0x7')](this[_0x3ee5('0x8')][_0x3ee5('0x9')](this),this[_0x3ee5('0xa')]['bind'](this));this[_0x3ee5('0x4')]['on'](_0x3ee5('0xb'),this[_0x3ee5('0xa')][_0x3ee5('0x9')](this));this['squeue']['on'](_0x3ee5('0xc'),this[_0x3ee5('0xd')][_0x3ee5('0x9')](this));};Beepall[_0x3ee5('0xe')]['push']=function(){this[_0x3ee5('0x4')][_0x3ee5('0x7')](this['handleRun'][_0x3ee5('0x9')](this),this['handleTimeout'][_0x3ee5('0x9')](this));};Beepall['prototype']['handleDrained']=function(){this[_0x3ee5('0xa')](!![]);};Beepall[_0x3ee5('0xe')][_0x3ee5('0x8')]=function(){var _0x21c9b6=!![];if(!_[_0x3ee5('0xf')](this[_0x3ee5('0x5')])&&!_[_0x3ee5('0xf')](this[_0x3ee5('0x5')][_0x3ee5('0x10')])&&this['queue'][_0x3ee5('0x10')]['length']>0x0){for(var _0xab5013=0x0,_0x3428e6;_0xab50130x0){for(var _0x39adfc=0x0,_0x24f356;_0x39adfc0x0&&_0x1fc715[_0x3291cd+_0x82bd('0x25')]>=_0x1fc715[_0x3291cd+_0x82bd('0x24')]){writeLog(_0x32954d,_0x1fc715,_0x3291cd[_0x82bd('0x26')]()+_0x82bd('0x27'));return![];}}return!![];};exports[_0x82bd('0x28')]=function(_0x3c7751,_0xbef23b,_0x2f0bb6,_0x2add80,_0x53a2a6){return sendNotification(!![],_0x3c7751,_0xbef23b,_0x2f0bb6,_0x2add80,_0x53a2a6);};exports['hideNotification']=function(_0x5609b7,_0x5d1015,_0x714d70,_0x52bcd8,_0x351d3d){return sendNotification(![],_0x5609b7,_0x5d1015,_0x714d70,_0x52bcd8,_0x351d3d);};exports[_0x82bd('0x29')]=writeLog; \ No newline at end of file +var _0xdc97=['redis','localhost','socket.io-emitter','format','user:%s','name','user:save','split','\x20interaction','body','queue','msg','account','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','emit','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','../../../../../config/environment','routing'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0xdc97,0x13b));var _0x7dc9=function(_0x40925a,_0x346835){_0x40925a=_0x40925a-0x0;var _0xacce2d=_0xdc97[_0x40925a];return _0xacce2d;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var utils=require(_0x7dc9('0x2'));var Redis=require('ioredis');var config=require(_0x7dc9('0x3'));var logger=require('../../../../../config/logger')(_0x7dc9('0x4'));config[_0x7dc9('0x5')]=_['defaults'](config[_0x7dc9('0x5')],{'host':_0x7dc9('0x6'),'port':0x18eb});var io=require(_0x7dc9('0x7'))(new Redis(config[_0x7dc9('0x5')]));function sendNotification(_0x589f02,_0x2636ef,_0x4f91c7,_0x4b3229,_0x2ff923,_0x23737d){io['to'](util[_0x7dc9('0x8')](_0x7dc9('0x9'),_0x4b3229[_0x7dc9('0xa')]))['emit'](_0x7dc9('0xb'),_0x4b3229);var _0x44fe24=_0x23737d||{};var _0x37dfc=_0x4f91c7[_0x7dc9('0xc')]('.');var _0x359c88={'uniqueid':_0x2636ef,'channel':_0x37dfc[0x0],'id':_0x37dfc[0x1],'title':_0x37dfc[0x0]+_0x7dc9('0xd'),'interactionId':_0x37dfc[0x2],'queue':_0x2ff923?_0x2ff923[_0x7dc9('0xa')]:null,'sound':_0x44fe24['account']['notificationSound'],'shake':_0x44fe24['account']['notificationShake']};try{if(!_0x44fe24[_0x7dc9('0xe')]){_0x44fe24[_0x7dc9('0xe')]={};}if(_0x2ff923){_0x44fe24['body'][_0x7dc9('0xf')]=_0x2ff923;}else if(_0x44fe24[_0x7dc9('0xe')][_0x7dc9('0xf')]){delete _0x44fe24[_0x7dc9('0xe')][_0x7dc9('0xf')];}_0x359c88[_0x7dc9('0x10')]=utils['getMustacheRender'](_0x44fe24[_0x7dc9('0x11')][_0x7dc9('0x12')],_0x44fe24);}catch(_0x1b0aa1){_0x359c88[_0x7dc9('0x10')]=_0x7dc9('0x13');logger[_0x7dc9('0x14')](util[_0x7dc9('0x8')](_0x7dc9('0x15'),_0x2636ef,_0x1b0aa1[_0x7dc9('0x16')]));}io['to'](util['format'](_0x7dc9('0x9'),_0x4b3229['name']))[_0x7dc9('0x17')](util[_0x7dc9('0x8')]('notification:%s',_0x589f02?_0x7dc9('0x18'):_0x7dc9('0x19')),_0x359c88);}function writeLog(_0x12f08d,_0x4b2703,_0x43ec33){return logger[_0x7dc9('0x1a')](util[_0x7dc9('0x8')](_0x7dc9('0x1b'),_0x12f08d,_0x4b2703[_0x7dc9('0xa')],_0x43ec33));}exports[_0x7dc9('0x1c')]=function(_0x576681,_0x593e60,_0x12954f,_0x5981e2){if(_0x593e60['busy']){writeLog(_0x576681,_0x593e60,_0x7dc9('0x1d'));return![];}if(!_0x593e60[_0x7dc9('0x1e')]){writeLog(_0x576681,_0x593e60,'OFFLINE');return![];}if(_0x593e60[_0x12954f+_0x7dc9('0x1f')]){writeLog(_0x576681,_0x593e60,_0x7dc9('0x20'));return![];}if(_0x5981e2&&_0x593e60[_0x7dc9('0x21')](_0x12954f+'Capacity')&&_0x593e60[_0x7dc9('0x21')](_0x12954f+_0x7dc9('0x22'))){if(_0x593e60[_0x12954f+_0x7dc9('0x23')]>0x0&&_0x593e60[_0x12954f+'CurrentCapacity']>=_0x593e60[_0x12954f+'Capacity']){writeLog(_0x576681,_0x593e60,_0x12954f['toUpperCase']()+_0x7dc9('0x24'));return![];}}return!![];};exports[_0x7dc9('0x25')]=function(_0x5843bf,_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb){return sendNotification(!![],_0x5843bf,_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb);};exports[_0x7dc9('0x26')]=function(_0x3a74a0,_0x3e4102,_0xa2aaa9,_0x450124,_0x236d42){return sendNotification(![],_0x3a74a0,_0x3e4102,_0xa2aaa9,_0x450124,_0x236d42);};exports[_0x7dc9('0x27')]=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 2c86548..cb71bd2 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 _0x60d4=['body','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','lodash','./utils','routing','string','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x60d4,0xa4));var _0x460d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x60d4[_0x4b369d];return _0x571a98;};'use strict';var schema=require(_0x460d('0x0'));var sh=require(_0x460d('0x1'));var _=require(_0x460d('0x2'));var utils=require(_0x460d('0x3'));var logger=require('../../../../config/logger')(_0x460d('0x4'));var system=schema({'command':{'type':_0x460d('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x23b41a,_0x2cfa03){return function(_0x403035){try{var _0x3ab4ae={'command':_0x2cfa03[0x0]};var _0x27e4c3=system['validate'](_0x3ab4ae,{'typecast':!![]});if(_0x27e4c3['length']){logger[_0x460d('0x6')]('[%s][SYSTEM]\x20%s',_0x23b41a,_[_0x460d('0x7')](_0x27e4c3,'message')[_0x460d('0x8')](',\x20'));logger[_0x460d('0x9')](_0x460d('0xa'),_0x23b41a);_0x403035[_0x460d('0xb')]();}else{var _0x5d25af=this;var _0x5ce0ac=utils[_0x460d('0xc')](_0x2cfa03[0x0],this);logger[_0x460d('0x9')](_0x460d('0xd'),_0x23b41a,_0x5ce0ac);sh['exec'](_[_0x460d('0xe')](_0x5ce0ac),function(_0x139afc,_0x2ccce3){logger[_0x460d('0x9')](_0x460d('0xf'),_0x23b41a,_0x139afc);if(_0x139afc==0x0){var _0xa3071c=_0x2ccce3[_0x460d('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x460d('0x11')](_0x2cfa03[0x1])||_[_0x460d('0x12')](_0x2cfa03[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x23b41a);_0x5d25af['body'][_0x2cfa03[0x1]]=_0xa3071c;}else{logger[_0x460d('0x9')](_0x460d('0x13'),_0x23b41a,_0x2cfa03[0x1],_0xa3071c);_0x5d25af[_0x460d('0x14')][_0x2cfa03[0x1]]=_0xa3071c;}}_0x403035['next']();});}}catch(_0x100fa0){logger[_0x460d('0x6')](_0x460d('0x15'),_0x23b41a,_[_0x460d('0x16')](_0x100fa0)?JSON['stringify'](_0x100fa0):_0x100fa0);logger[_0x460d('0x9')](_0x460d('0xa'),_0x23b41a);_0x403035['next']();}};}; \ No newline at end of file +var _0xf351=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','shelljs','lodash','./utils'];(function(_0x65959d,_0x4dd888){var _0x2d71aa=function(_0x51c2ae){while(--_0x51c2ae){_0x65959d['push'](_0x65959d['shift']());}};_0x2d71aa(++_0x4dd888);}(_0xf351,0x1a5));var _0x1f35=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0xf351[_0x590b61];return _0x1a14dc;};'use strict';var schema=require(_0x1f35('0x0'));var sh=require(_0x1f35('0x1'));var _=require(_0x1f35('0x2'));var utils=require(_0x1f35('0x3'));var logger=require(_0x1f35('0x4'))(_0x1f35('0x5'));var system=schema({'command':{'type':_0x1f35('0x6'),'required':!![],'message':_0x1f35('0x7')}});exports[_0x1f35('0x8')]=function(_0x3c2a3f,_0x290dd8){return function(_0x137865){try{var _0x5a6185={'command':_0x290dd8[0x0]};var _0xbe2a37=system[_0x1f35('0x0')](_0x5a6185,{'typecast':!![]});if(_0xbe2a37[_0x1f35('0x9')]){logger[_0x1f35('0xa')](_0x1f35('0xb'),_0x3c2a3f,_[_0x1f35('0xc')](_0xbe2a37,_0x1f35('0xd'))['join'](',\x20'));logger[_0x1f35('0xe')](_0x1f35('0xf'),_0x3c2a3f);_0x137865[_0x1f35('0x10')]();}else{var _0x44b71e=this;var _0x385600=utils[_0x1f35('0x11')](_0x290dd8[0x0],this);logger[_0x1f35('0xe')](_0x1f35('0x12'),_0x3c2a3f,_0x385600);sh[_0x1f35('0x13')](_[_0x1f35('0x14')](_0x385600),function(_0x31be16,_0x5efdf2){logger[_0x1f35('0xe')](_0x1f35('0x15'),_0x3c2a3f,_0x31be16);if(_0x31be16==0x0){var _0x5b598f=_0x5efdf2['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x290dd8[0x1])||_['isEmpty'](_0x290dd8[0x1])){logger[_0x1f35('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0x3c2a3f);_0x44b71e['body'][_0x290dd8[0x1]]=_0x5b598f;}else{logger[_0x1f35('0xe')](_0x1f35('0x16'),_0x3c2a3f,_0x290dd8[0x1],_0x5b598f);_0x44b71e[_0x1f35('0x17')][_0x290dd8[0x1]]=_0x5b598f;}}_0x137865[_0x1f35('0x10')]();});}}catch(_0x1f4f82){logger[_0x1f35('0xa')](_0x1f35('0xb'),_0x3c2a3f,_['isObject'](_0x1f4f82)?JSON[_0x1f35('0x18')](_0x1f4f82):_0x1f4f82);logger['info'](_0x1f35('0xf'),_0x3c2a3f);_0x137865['next']();}};}; \ 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 a4124b2..a330b44 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 _0x48fd=['map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s'];(function(_0x49d168,_0x145c84){var _0x1f6e43=function(_0x59d93e){while(--_0x59d93e){_0x49d168['push'](_0x49d168['shift']());}};_0x1f6e43(++_0x145c84);}(_0x48fd,0x1a4));var _0xd48f=function(_0x4ea90e,_0x197739){_0x4ea90e=_0x4ea90e-0x0;var _0x570f4f=_0x48fd[_0x4ea90e];return _0x570f4f;};'use strict';var schema=require(_0xd48f('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xd48f('0x1')),'openchannelInteraction':require(_0xd48f('0x2')),'smsInteraction':require(_0xd48f('0x3')),'mailInteraction':require(_0xd48f('0x4')),'faxInteraction':require(_0xd48f('0x5')),'whatsappInteraction':require(_0xd48f('0x6'))};var logger=require(_0xd48f('0x7'))('routing');var tag=schema({'tag':{'type':_0xd48f('0x8'),'required':!![],'message':_0xd48f('0x9')}});exports['consequence']=function(_0x3b71d7,_0xe12eb3,_0x2c5234,_0x4e45a9){return function(_0x1a677c){try{var _0xaed731={'tag':_0xe12eb3[0x0]};var _0x229eef=tag[_0xd48f('0x0')](_0xaed731,{'typecast':!![]});if(_0x229eef['length']){logger[_0xd48f('0xa')](_0xd48f('0xb'),_0x3b71d7,_[_0xd48f('0xc')](_0x229eef,'message')[_0xd48f('0xd')](',\x20'));logger[_0xd48f('0xe')](_0xd48f('0xf'),_0x3b71d7);_0x1a677c[_0xd48f('0x10')]();}else{var _0x49b185={'ids':[_0xe12eb3[0x0]]};if(rpc[_0x4e45a9[_0xd48f('0x11')]+'Interaction']){rpc[_0x4e45a9[_0xd48f('0x11')]+_0xd48f('0x12')]['addTags'](_0x4e45a9[_0xd48f('0x13')]['id'],_0x49b185)[_0xd48f('0x14')](function(_0x99d759){logger[_0xd48f('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3b71d7,_0xe12eb3[0x1],_0x4e45a9[_0xd48f('0x11')],_0x4e45a9['interaction']['id']);})['catch'](function(_0x16fdcd){logger[_0xd48f('0xa')](_0xd48f('0xb'),_0x3b71d7,JSON[_0xd48f('0x15')](_0x16fdcd));logger['info'](_0xd48f('0xf'),_0x3b71d7);})[_0xd48f('0x16')](function(){_0x1a677c[_0xd48f('0x10')]();});}}}catch(_0x213b93){logger[_0xd48f('0xa')]('[%s][TAG]\x20%s',_0x3b71d7,_[_0xd48f('0x17')](_0x213b93)?JSON[_0xd48f('0x15')](_0x213b93):_0x213b93);logger['info'](_0xd48f('0xf'),_0x3b71d7);_0x1a677c[_0xd48f('0x10')]();}};}; \ No newline at end of file +var _0x2247=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','finally','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x1a0275,_0x17c3ef){var _0xc63ddf=function(_0x54f5fe){while(--_0x54f5fe){_0x1a0275['push'](_0x1a0275['shift']());}};_0xc63ddf(++_0x17c3ef);}(_0x2247,0xa1));var _0x7224=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x2247[_0x53ccf2];return _0x5a2964;};'use strict';var schema=require('validate');var _=require(_0x7224('0x0'));var rpc={'chatInteraction':require(_0x7224('0x1')),'openchannelInteraction':require(_0x7224('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7224('0x3')),'faxInteraction':require(_0x7224('0x4')),'whatsappInteraction':require(_0x7224('0x5'))};var logger=require(_0x7224('0x6'))('routing');var tag=schema({'tag':{'type':_0x7224('0x7'),'required':!![],'message':_0x7224('0x8')}});exports[_0x7224('0x9')]=function(_0x372a8d,_0x1164df,_0x34b013,_0x40e696){return function(_0x4fbf58){try{var _0x3351a3={'tag':_0x1164df[0x0]};var _0x5e57d6=tag[_0x7224('0xa')](_0x3351a3,{'typecast':!![]});if(_0x5e57d6['length']){logger['error'](_0x7224('0xb'),_0x372a8d,_['map'](_0x5e57d6,_0x7224('0xc'))[_0x7224('0xd')](',\x20'));logger[_0x7224('0xe')](_0x7224('0xf'),_0x372a8d);_0x4fbf58[_0x7224('0x10')]();}else{var _0x1ce670={'ids':[_0x1164df[0x0]]};if(rpc[_0x40e696[_0x7224('0x11')]+'Interaction']){rpc[_0x40e696[_0x7224('0x11')]+_0x7224('0x12')][_0x7224('0x13')](_0x40e696[_0x7224('0x14')]['id'],_0x1ce670)[_0x7224('0x15')](function(_0x35e135){logger[_0x7224('0xe')](_0x7224('0x16'),_0x372a8d,_0x1164df[0x1],_0x40e696['channel'],_0x40e696[_0x7224('0x14')]['id']);})[_0x7224('0x17')](function(_0xd0ce92){logger[_0x7224('0x18')](_0x7224('0xb'),_0x372a8d,JSON['stringify'](_0xd0ce92));logger[_0x7224('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x372a8d);})[_0x7224('0x19')](function(){_0x4fbf58[_0x7224('0x10')]();});}}}catch(_0x5571e1){logger[_0x7224('0x18')](_0x7224('0xb'),_0x372a8d,_[_0x7224('0x1a')](_0x5571e1)?JSON[_0x7224('0x1b')](_0x5571e1):_0x5571e1);logger[_0x7224('0xe')](_0x7224('0xf'),_0x372a8d);_0x4fbf58[_0x7224('0x10')]();}};}; \ 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 85f8131..d39630b 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 _0xab8c=['catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','channelId=','&serviceId=','&sessionId=','&data=','info','stop'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0xab8c,0x6e));var _0xcab8=function(_0x412694,_0xcdb2d0){_0x412694=_0x412694-0x0;var _0xe0008b=_0xab8c[_0x412694];return _0xe0008b;};'use strict';var rp=require(_0xcab8('0x0'));var logger=require(_0xcab8('0x1'))(_0xcab8('0x2'));var _=require(_0xcab8('0x3'));var arr=[];exports[_0xcab8('0x4')]=function(_0x39ae4c,_0x7e30d3){return function(_0xa5a37a){var _0x558e60=_0x7e30d3[0xa];var _0x130e9e=_0x7e30d3[0xb];var _0x74b87d=_0x7e30d3[0xc];var _0x3002a0=_0x7e30d3[0xd];var _0x276105=_0x7e30d3[0xe];var _0x4fee97=_0x7e30d3[0xf][_0xcab8('0x5')](/\n/g,_0xcab8('0x6'));var _0x2692ac=_0x7e30d3[0x10][_0xcab8('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x130e9e)){arr[_0xcab8('0x7')](_0x130e9e);var _0x161e1b=_0x7e30d3[0x3];var _0x42aa96=_0x7e30d3[0x4];var _0x533a9f=_0x7e30d3[0x1];var _0x573bad=_0x7e30d3[0x0];var _0x5ee869={};_0x5ee869[_0xcab8('0x8')]=_0x7e30d3[0x8]+_0xcab8('0x9')+_0x74b87d+'|'+_0x558e60+'|'+_0x3002a0+'|'+_0x130e9e+'|'+_0x276105;_0x5ee869[_0xcab8('0xa')]=_0x7e30d3[0x7]+'?params='+_0x74b87d+'|'+_0x558e60+'|'+_0x3002a0+'|'+_0x130e9e+'|'+_0x276105+'|'+_0x4fee97+'|'+_0x2692ac;_0x5ee869[_0xcab8('0xb')]=_0x7e30d3[0x9];var _0x4effca={};_0x4effca[_0xcab8('0xc')]=_0xcab8('0xd');_0x4effca[_0xcab8('0xe')]=_0xcab8('0xf');var _0x47bf11=[];_0x47bf11[_0xcab8('0x7')](_0x7e30d3[0x2]);_0x47bf11[_0xcab8('0x7')](_0x7e30d3[0x5]);_0x47bf11[_0xcab8('0x7')](_0x7e30d3[0x6]);_0x4effca[_0xcab8('0x10')]=_0x47bf11;_0x4effca['id']=0x1;var _0x4b6e28=JSON[_0xcab8('0x11')](_0x4effca);var _0x490694={'encoding':_0xcab8('0x12'),'method':_0xcab8('0x13'),'timeout':0x2710,'url':_0x161e1b,'headers':{'Content-Type':_0xcab8('0x14')},'body':_0x4b6e28};return rp(_0x490694)[_0xcab8('0x15')](function(_0x4576dd){const _0x4845d1=JSON[_0xcab8('0x16')](_0x4576dd);if(!_0x4845d1[_0xcab8('0x17')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x14821d=_0x130e9e;var _0x3c84ae=_0xcab8('0x18')+_0x533a9f+_0xcab8('0x19')+_0x573bad+_0xcab8('0x1a')+_0x14821d+_0xcab8('0x1b')+JSON[_0xcab8('0x11')](_0x5ee869);var _0x1e581c=_0x42aa96+'?'+_0x3c84ae;return rp(_0x1e581c);})['then'](function(_0x2de8f4){logger[_0xcab8('0x1c')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x39ae4c,_0x2de8f4);_0xa5a37a[_0xcab8('0x1d')]();})[_0xcab8('0x1e')](function(_0x3bd827){logger[_0xcab8('0x1f')](_0xcab8('0x20'),_0x39ae4c,_[_0xcab8('0x21')](_0x3bd827)?JSON['stringify'](_0x3bd827):_0x3bd827);_0xa5a37a[_0xcab8('0x1d')]();});}else{logger[_0xcab8('0x1c')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x39ae4c);_0xa5a37a[_0xcab8('0x22')]();}};}; \ No newline at end of file +var _0xba13=['info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','lodash','\x20-\x20','includes','urlOnAnswer','?params=','title','jsonrpc','method','push','params','utf8','POST','application/json-rpc','then','parse','logged','channelId=','&serviceId=','&sessionId=','&data=','stringify'];(function(_0x28d775,_0x3ac562){var _0x1477e0=function(_0x5c28ed){while(--_0x5c28ed){_0x28d775['push'](_0x28d775['shift']());}};_0x1477e0(++_0x3ac562);}(_0xba13,0xf8));var _0x3ba1=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xba13[_0x903228];return _0xcec81d;};'use strict';var rp=require('request-promise');var logger=require(_0x3ba1('0x0'))('routing');var _=require(_0x3ba1('0x1'));var arr=[];exports['consequence']=function(_0x1e811f,_0x463c29){return function(_0x3fba68){var _0x9b914c=_0x463c29[0xa];var _0x5507e8=_0x463c29[0xb];var _0x68cb9c=_0x463c29[0xc];var _0xc62c18=_0x463c29[0xd];var _0xbba262=_0x463c29[0xe];var _0x193f2f=_0x463c29[0xf]['replace'](/\n/g,_0x3ba1('0x2'));var _0x57023d=_0x463c29[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x3ba1('0x3')](_0x5507e8)){arr['push'](_0x5507e8);var _0x113817=_0x463c29[0x3];var _0x2f9faa=_0x463c29[0x4];var _0x517333=_0x463c29[0x1];var _0x5abd3e=_0x463c29[0x0];var _0x1f7416={};_0x1f7416[_0x3ba1('0x4')]=_0x463c29[0x8]+_0x3ba1('0x5')+_0x68cb9c+'|'+_0x9b914c+'|'+_0xc62c18+'|'+_0x5507e8+'|'+_0xbba262;_0x1f7416['urlOnRing']=_0x463c29[0x7]+_0x3ba1('0x5')+_0x68cb9c+'|'+_0x9b914c+'|'+_0xc62c18+'|'+_0x5507e8+'|'+_0xbba262+'|'+_0x193f2f+'|'+_0x57023d;_0x1f7416[_0x3ba1('0x6')]=_0x463c29[0x9];var _0x432ee7={};_0x432ee7[_0x3ba1('0x7')]='2.0';_0x432ee7[_0x3ba1('0x8')]='login';var _0x2d13c7=[];_0x2d13c7[_0x3ba1('0x9')](_0x463c29[0x2]);_0x2d13c7['push'](_0x463c29[0x5]);_0x2d13c7[_0x3ba1('0x9')](_0x463c29[0x6]);_0x432ee7[_0x3ba1('0xa')]=_0x2d13c7;_0x432ee7['id']=0x1;var _0x437910=JSON['stringify'](_0x432ee7);var _0x152fa9={'encoding':_0x3ba1('0xb'),'method':_0x3ba1('0xc'),'timeout':0x2710,'url':_0x113817,'headers':{'Content-Type':_0x3ba1('0xd')},'body':_0x437910};return rp(_0x152fa9)[_0x3ba1('0xe')](function(_0x52e19e){const _0x2bb7d1=JSON[_0x3ba1('0xf')](_0x52e19e);if(!_0x2bb7d1['result'][_0x3ba1('0x10')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x20d3ee=_0x5507e8;var _0x34ad41=_0x3ba1('0x11')+_0x517333+_0x3ba1('0x12')+_0x5abd3e+_0x3ba1('0x13')+_0x20d3ee+_0x3ba1('0x14')+JSON[_0x3ba1('0x15')](_0x1f7416);var _0x3fe862=_0x2f9faa+'?'+_0x34ad41;return rp(_0x3fe862);})[_0x3ba1('0xe')](function(_0x517f50){logger[_0x3ba1('0x16')](_0x3ba1('0x17'),_0x1e811f,_0x517f50);_0x3fba68[_0x3ba1('0x18')]();})[_0x3ba1('0x19')](function(_0x79c1f4){logger[_0x3ba1('0x1a')]('[%s][TVOX]\x20%s',_0x1e811f,_[_0x3ba1('0x1b')](_0x79c1f4)?JSON['stringify'](_0x79c1f4):_0x79c1f4);_0x3fba68['stop']();});}else{logger[_0x3ba1('0x16')](_0x3ba1('0x1c'),_0x1e811f);_0x3fba68[_0x3ba1('0x1d')]();}};}; \ 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 b4eaa8e..8c02d40 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(_0x3ab9e2,_0x221b04){var _0x2c1104=function(_0x553f71){while(--_0x553f71){_0x3ab9e2['push'](_0x3ab9e2['shift']());}};_0x2c1104(++_0x221b04);}(_0xe706,0xa3));var _0x6e70=function(_0x25e3d3,_0x1d2882){_0x25e3d3=_0x25e3d3-0x0;var _0x42ad83=_0xe706[_0x25e3d3];return _0x42ad83;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x191646,_0x9313df){var _0x42f910=function(_0x14584d){while(--_0x14584d){_0x191646['push'](_0x191646['shift']());}};_0x42f910(++_0x9313df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 7247a10..1e29f19 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 _0x6b19=['priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','find','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflowv2','tag','tvox','notificationTemplate','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x6b19,0xe8));var _0x96b1=function(_0x3bb7a7,_0x2f6106){_0x3bb7a7=_0x3bb7a7-0x0;var _0x274b83=_0x6b19[_0x3bb7a7];return _0x274b83;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x96b1('0x2'));var BPromise=require('bluebird');var utils=require('./applications/utils');var logger=require(_0x96b1('0x3'))(_0x96b1('0x4'));var rpc={'openchannelQueueReport':require(_0x96b1('0x5')),'mailQueueReport':require(_0x96b1('0x6')),'chatQueueReport':require(_0x96b1('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x96b1('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x96b1('0x9'));function getId(_0x572fde,_0x57a23a,_0x307e65){return util['format'](_0x96b1('0xa'),_0x572fde,_0x57a23a||0x0,_0x307e65||0x0);}function getIntervals(_0x4d2f1c,_0x36ea50){var _0x34c81c=[];if(!_[_0x96b1('0xb')](_0x36ea50[_0x96b1('0xc')])&&!_[_0x96b1('0xb')](_0x4d2f1c[_0x36ea50[_0x96b1('0xc')]])&&!_[_0x96b1('0xb')](_0x4d2f1c[_0x36ea50['IntervalId']]['Intervals'])){_0x34c81c=_[_0x96b1('0xd')](_0x4d2f1c[_0x36ea50['IntervalId']]['Intervals'],_0x96b1('0xe'));}else if(!_[_0x96b1('0xb')](_0x36ea50[_0x96b1('0xe')])){_0x34c81c=[_0x36ea50['interval']];}return _0x34c81c;}exports[_0x96b1('0xf')]=function(_0x1af8c1){_0x1af8c1[_0x96b1('0x10')]={};return new BPromise(function(_0x2119b1,_0x46b2bb){var _0x4f4150={'Start':function(_0x27254a){var _0x375781=this;return new Promise(function(_0x23ce63,_0x12233d){if(_0x27254a){try{var _0x2cd1f5=[];var _0x43b7f5=getId(_0x27254a[_0x96b1('0x11')],_0x27254a[_0x96b1('0x12')]?_0x27254a[_0x96b1('0x12')]['id']:0x0,_0x27254a[_0x96b1('0x13')]?_0x27254a[_0x96b1('0x13')]['id']:0x0);if(_0x27254a[_0x96b1('0x14')]&&_[_0x96b1('0x15')](_0x27254a[_0x96b1('0x14')])&&_0x27254a[_0x96b1('0x14')]['length']){for(var _0x13e891=0x0;_0x13e891<_0x27254a['applications'][_0x96b1('0x16')];_0x13e891+=0x1){var _0x2f98a2=_0x27254a[_0x96b1('0x14')][_0x13e891];if(fs['existsSync'](path[_0x96b1('0x17')](__dirname,_0x96b1('0x14'),_0x2f98a2[_0x96b1('0x18')]+'.js'))){var _0x2b7d4d=[];switch(_0x2f98a2[_0x96b1('0x18')][_0x96b1('0x19')]()){case _0x96b1('0x1a'):var _0x555185=_0x2f98a2[_0x96b1('0x1b')][_0x96b1('0x1c')](',');if(_0x27254a[_0x96b1('0x11')]==='mail'){_0x2b7d4d[_0x96b1('0x1d')](_0x555185[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x555185[0x1]);_0x2b7d4d[_0x96b1('0x1d')](_0x555185[_0x96b1('0x1e')](0x2,_0x555185['length'])[_0x96b1('0x17')](','));}else{_0x2b7d4d['push'](_0x555185[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x555185['slice'](0x1,_0x555185[_0x96b1('0x16')])[_0x96b1('0x17')](','));}break;case'dialogflow':var _0x50dcbc=_0x2f98a2['appdata'][_0x96b1('0x1c')](',');_0x2b7d4d[_0x96b1('0x1d')](_0x50dcbc[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x50dcbc[0x1]);_0x2b7d4d[_0x96b1('0x1d')](_0x50dcbc[_0x96b1('0x1e')](0x2,_0x50dcbc['length'])[_0x96b1('0x17')](','));break;case _0x96b1('0x1f'):var _0x3cadbb=_0x2f98a2[_0x96b1('0x1b')]['split'](',');_0x2b7d4d[_0x96b1('0x1d')](_0x3cadbb[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x3cadbb[0x1]);_0x2b7d4d['push'](_0x3cadbb[0x2]);_0x2b7d4d['push'](_0x3cadbb[0x3]);_0x2b7d4d[_0x96b1('0x1d')](_0x3cadbb['slice'](0x4,_0x3cadbb[_0x96b1('0x16')])[_0x96b1('0x17')](','));break;case'amazonlex':var _0x191ef3=_0x2f98a2[_0x96b1('0x1b')]['split'](',');_0x2b7d4d[_0x96b1('0x1d')](_0x191ef3[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x191ef3[0x1]);_0x2b7d4d[_0x96b1('0x1d')](_0x191ef3[0x2]);_0x2b7d4d['push'](_0x191ef3[0x3]);_0x2b7d4d[_0x96b1('0x1d')](_0x191ef3[_0x96b1('0x1e')](0x4,_0x191ef3[_0x96b1('0x16')])[_0x96b1('0x17')](','));break;case _0x96b1('0x12'):_0x2b7d4d[_0x96b1('0x1d')](_0x2f98a2['appdata']);break;case _0x96b1('0x20'):_0x2b7d4d[_0x96b1('0x1d')](_0x2f98a2['TagId']);_0x2b7d4d['push'](_0x2f98a2[_0x96b1('0x1b')]);break;case _0x96b1('0x21'):var _0x1745d1=utils['getMustacheRender'](_0x27254a['account'][_0x96b1('0x22')],_0x27254a);var _0x3a2512=_0x2f98a2[_0x96b1('0x1b')][_0x96b1('0x1c')](',');_0x2b7d4d['push'](_0x3a2512[0x0]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x1]);_0x2b7d4d['push'](_0x3a2512[0x2]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x3]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x4]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x5]);_0x2b7d4d['push'](_0x3a2512[0x6]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x7]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x8]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0x9]);_0x2b7d4d[_0x96b1('0x1d')](_0x3a2512[0xa]);_0x2b7d4d[_0x96b1('0x1d')](_0x27254a[_0x96b1('0x13')]['id']);_0x2b7d4d['push'](_0x27254a[_0x96b1('0x12')]['id']);_0x2b7d4d[_0x96b1('0x1d')](_0x2f98a2['ChatWebsiteId']);_0x2b7d4d[_0x96b1('0x1d')](_0x27254a['interaction'][_0x96b1('0x23')]);_0x2b7d4d[_0x96b1('0x1d')](_0x27254a[_0x96b1('0x24')][_0x96b1('0x24')]);_0x2b7d4d[_0x96b1('0x1d')](_0x1745d1);break;default:_0x2b7d4d=_[_0x96b1('0xb')](_0x2f98a2[_0x96b1('0x1b')])?[]:_0x2f98a2[_0x96b1('0x1b')][_0x96b1('0x1c')](',');}var _0x5d5c8f={'id':util[_0x96b1('0x25')](_0x96b1('0x26'),_0x43b7f5,_0x2f98a2['id'],_0x2f98a2[_0x96b1('0x18')]),'condition':require(_0x96b1('0x27'))[_0x96b1('0x28')](_0x43b7f5,getIntervals(_0x1af8c1[_0x96b1('0x29')],_0x2f98a2),_0x1af8c1),'consequence':require(_0x96b1('0x2a')+_0x2f98a2[_0x96b1('0x18')])[_0x96b1('0x2b')](_0x43b7f5,_0x2b7d4d,_0x1af8c1,_0x27254a),'p':_0x2f98a2[_0x96b1('0x2c')]||0x0};logger[_0x96b1('0x2d')](_0x96b1('0x2e'),_0x5d5c8f['id'],_0x96b1('0x2f'),getIntervals(_0x1af8c1[_0x96b1('0x29')],_0x2f98a2)[_0x96b1('0x17')]('\x20|\x20'));_0x2cd1f5['push'](_0x5d5c8f);}else{logger[_0x96b1('0x30')](_0x96b1('0x31'),path['join'](__dirname,_0x96b1('0x14'),_0x2f98a2[_0x96b1('0x18')]+'.js'));}}_0x1af8c1['rules'][_0x43b7f5]=new RuleEngine(_0x2cd1f5);_0x1af8c1['rules'][_0x43b7f5][_0x96b1('0x32')](_0x27254a,function(_0x307645){logger[_0x96b1('0x2d')](_0x96b1('0x33'),JSON[_0x96b1('0x34')](_0x307645[_0x96b1('0x35')]));if(_0x1af8c1[_0x96b1('0x10')][_0x43b7f5]){_0x1af8c1[_0x96b1('0x10')][_0x43b7f5][_0x96b1('0x36')](_0x96b1('0x37'));}});return _0x23ce63({'code':0xc8,'message':_0x27254a});}else{logger['info'](_0x96b1('0x38'));return _0x23ce63({'code':0xc8,'message':_0x27254a});}}catch(_0x54acd9){logger[_0x96b1('0x30')](_0x54acd9['stack']);return _0x12233d(_0x375781[_0x96b1('0x30')](0x1f4,_0x54acd9));}}return _0x12233d('routing\x20is\x20empty');});},'AcceptMessage':function(_0x219393){var _0x1a50b7=this;return new Promise(function(_0x200839,_0x266eaa){if(_0x219393[_0x96b1('0x39')]&&_0x219393['agent']['id']){if(_0x1af8c1[_0x96b1('0x3a')][_0x219393[_0x96b1('0x39')]['id']]){_0x1af8c1[_0x96b1('0x3a')][_0x219393['agent']['id']][_0x96b1('0x3b')]=![];_0x1af8c1[_0x96b1('0x3a')][_0x219393[_0x96b1('0x39')]['id']][_0x96b1('0x3c')]=undefined;}}if(_0x219393['message']&&_0x219393[_0x96b1('0x12')]['id']){try{var _0x466ad1=getId(_0x219393['channel'],_0x219393[_0x96b1('0x12')]?_0x219393[_0x96b1('0x12')]['id']:0x0,_0x219393[_0x96b1('0x13')]?_0x219393[_0x96b1('0x13')]['id']:0x0);if(_0x1af8c1[_0x96b1('0x10')][_0x466ad1]){_0x1af8c1[_0x96b1('0x10')][_0x466ad1]['emit'](_0x96b1('0x3d'));if(rpc[_0x219393['channel']+_0x96b1('0x3e')]){rpc[_0x219393[_0x96b1('0x11')]+'QueueReport'][_0x96b1('0x3f')](_0x466ad1,{'UserId':_0x219393[_0x96b1('0x12')]['UserId']})[_0x96b1('0x40')](function(){logger[_0x96b1('0x30')](_0x96b1('0x41'));});}}return _0x200839({'code':0xc8,'message':_0x219393});}catch(_0x3a7301){logger[_0x96b1('0x30')](_0x3a7301[_0x96b1('0x42')]);return _0x266eaa(_0x1a50b7[_0x96b1('0x30')](0x1f4,_0x3a7301));}}logger[_0x96b1('0x30')](_0x96b1('0x43'));return _0x266eaa(_0x1a50b7[_0x96b1('0x30')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x296960){var _0x220551=this;return new Promise(function(_0x12b862,_0x1e89fe){if(_0x296960[_0x96b1('0x39')]&&_0x296960[_0x96b1('0x39')]['id']){try{if(_0x1af8c1[_0x96b1('0x3a')][_0x296960[_0x96b1('0x39')]['id']]){_0x1af8c1['agents'][_0x296960['agent']['id']][_0x96b1('0x3b')]=![];_0x1af8c1[_0x96b1('0x3a')][_0x296960['agent']['id']][_0x96b1('0x3c')]=undefined;}return _0x12b862({'code':0xc8,'message':_0x296960});}catch(_0x2863b2){logger[_0x96b1('0x30')](_0x2863b2['stack']);return _0x1e89fe(_0x220551[_0x96b1('0x30')](0x1f4,_0x2863b2));}}logger[_0x96b1('0x30')]('message\x20is\x20empty');return _0x1e89fe(_0x220551['error'](0x1f4,_0x96b1('0x43')));});},'AbandonInteraction':function(_0x19cc23){var _0x3b0fe6=this;return new Promise(function(_0x203b62,_0x22aa61){if(_0x19cc23[_0x96b1('0x11')]&&_0x19cc23[_0x96b1('0x13')]&&_0x19cc23[_0x96b1('0x13')]['id']){try{var _0x332b1c=getId(_0x19cc23[_0x96b1('0x11')],_0x19cc23[_0x96b1('0x12')]?_0x19cc23[_0x96b1('0x12')]['id']:0x0,_0x19cc23['interaction']?_0x19cc23[_0x96b1('0x13')]['id']:0x0);if(_0x1af8c1[_0x96b1('0x10')][_0x332b1c]){_0x1af8c1[_0x96b1('0x10')][_0x332b1c][_0x96b1('0x36')](_0x96b1('0x3d'));}return _0x203b62({'code':0xc8,'message':_0x19cc23});}catch(_0x1bf97f){logger[_0x96b1('0x30')](_0x1bf97f['stack']);return _0x22aa61(_0x3b0fe6[_0x96b1('0x30')](0x1f4,_0x1bf97f));}}logger['error']('message\x20is\x20empty');return _0x22aa61(_0x3b0fe6[_0x96b1('0x30')](0x1f4,_0x96b1('0x43')));});},'AgentCapacity':function(_0x20b121){var _0x1f3f4b=this;return new Promise(function(_0x41cca1,_0x192744){if(_0x1af8c1[_0x96b1('0x3a')]['hasOwnProperty'](_0x20b121['id'])){for(var _0x26a496 in _0x20b121['capacity']){if(_0x20b121[_0x96b1('0x44')]['hasOwnProperty'](_0x26a496)){if(_0x1af8c1[_0x96b1('0x3a')][_0x20b121['id']][_0x96b1('0x45')](_0x26a496+'CurrentCapacity')){_0x1af8c1[_0x96b1('0x3a')][_0x20b121['id']][_0x26a496+_0x96b1('0x46')]=parseInt(_0x20b121[_0x96b1('0x44')][_0x26a496],0xa);}}}_0x1af8c1[_0x96b1('0x3a')][_0x20b121['id']]['updateRealtime']();return _0x41cca1({'code':0xc8,'message':_0x1af8c1['agents'][_0x20b121['id']]});}else{return _0x192744(_0x1f3f4b[_0x96b1('0x30')](0x1f4,_0x96b1('0x47')));}});},'Agents':function(_0x474bad){return new Promise(function(_0x3a7063){var _0x5555bb=_[_0x96b1('0x48')](_0x1af8c1[_0x96b1('0x3a')]);if(_0x474bad&&_0x474bad['id']){var _0x2c2c71=_[_0x96b1('0x49')](_0x5555bb,function(_0x2b2b18){return _0x2b2b18['id']===_0x474bad['id'];});_0x3a7063(_0x2c2c71);}else{_0x3a7063({'count':_0x5555bb[_0x96b1('0x16')],'rows':_0x5555bb});}});},'ChatQueues':function(){return new Promise(function(_0x226568){var _0x337b31=[];for(var _0x1ebb27 in _0x1af8c1['chatQueues']){if(_0x1af8c1['chatQueues'][_0x96b1('0x45')](_0x1ebb27)){var _0x22b054=_0x1af8c1['chatQueues'][_0x1ebb27];var _0x541e26={'id':_0x22b054['id'],'available':_0x22b054[_0x96b1('0x4a')],'loggedIn':_0x22b054[_0x96b1('0x4b')],'name':_0x22b054[_0x96b1('0x4c')],'paused':_0x22b054[_0x96b1('0x4d')],'waiting':_0x22b054[_0x96b1('0x4e')]};_0x337b31[_0x96b1('0x1d')](_0x541e26);}}_0x226568({'count':_0x337b31[_0x96b1('0x16')],'rows':_0x337b31});});},'MailQueues':function(){return new Promise(function(_0x5aa89a){var _0x4ada71=[];for(var _0x316cfa in _0x1af8c1[_0x96b1('0x4f')]){if(_0x1af8c1['mailQueues']['hasOwnProperty'](_0x316cfa)){var _0x2be24e=_0x1af8c1[_0x96b1('0x4f')][_0x316cfa];var _0x4c0aa4={'id':_0x2be24e['id'],'available':_0x2be24e[_0x96b1('0x4a')],'loggedIn':_0x2be24e[_0x96b1('0x4b')],'name':_0x2be24e[_0x96b1('0x4c')],'paused':_0x2be24e[_0x96b1('0x4d')],'waiting':_0x2be24e[_0x96b1('0x4e')]};_0x4ada71[_0x96b1('0x1d')](_0x4c0aa4);}}_0x5aa89a({'count':_0x4ada71['length'],'rows':_0x4ada71});});},'OpenchannelQueues':function(){return new Promise(function(_0xa0877f){var _0x1db88a=[];for(var _0x47faf2 in _0x1af8c1[_0x96b1('0x50')]){if(_0x1af8c1['openchannelQueues'][_0x96b1('0x45')](_0x47faf2)){var _0x56d007=_0x1af8c1[_0x96b1('0x50')][_0x47faf2];var _0x30547f={'id':_0x56d007['id'],'available':_0x56d007[_0x96b1('0x4a')],'loggedIn':_0x56d007[_0x96b1('0x4b')],'name':_0x56d007[_0x96b1('0x4c')],'paused':_0x56d007[_0x96b1('0x4d')],'waiting':_0x56d007[_0x96b1('0x4e')]};_0x1db88a[_0x96b1('0x1d')](_0x30547f);}}_0xa0877f({'count':_0x1db88a[_0x96b1('0x16')],'rows':_0x1db88a});});},'SmsQueues':function(){return new Promise(function(_0x30553c){var _0x3e7a23=[];for(var _0x4e173b in _0x1af8c1[_0x96b1('0x51')]){if(_0x1af8c1[_0x96b1('0x51')][_0x96b1('0x45')](_0x4e173b)){var _0x1b35ed=_0x1af8c1[_0x96b1('0x51')][_0x4e173b];var _0x51b25b={'id':_0x1b35ed['id'],'available':_0x1b35ed[_0x96b1('0x4a')],'loggedIn':_0x1b35ed[_0x96b1('0x4b')],'name':_0x1b35ed['name'],'paused':_0x1b35ed[_0x96b1('0x4d')],'waiting':_0x1b35ed[_0x96b1('0x4e')]};_0x3e7a23[_0x96b1('0x1d')](_0x51b25b);}}_0x30553c({'count':_0x3e7a23[_0x96b1('0x16')],'rows':_0x3e7a23});});},'FaxQueues':function(){return new Promise(function(_0x54994e){var _0x5c807d=[];for(var _0x4d81a2 in _0x1af8c1['faxQueues']){if(_0x1af8c1[_0x96b1('0x52')][_0x96b1('0x45')](_0x4d81a2)){var _0x559cb4=_0x1af8c1[_0x96b1('0x52')][_0x4d81a2];var _0x430987={'id':_0x559cb4['id'],'available':_0x559cb4[_0x96b1('0x4a')],'loggedIn':_0x559cb4['loggedIn'],'name':_0x559cb4[_0x96b1('0x4c')],'paused':_0x559cb4[_0x96b1('0x4d')],'waiting':_0x559cb4[_0x96b1('0x4e')]};_0x5c807d['push'](_0x430987);}}_0x54994e({'count':_0x5c807d[_0x96b1('0x16')],'rows':_0x5c807d});});},'WhatsappQueues':function(){return new Promise(function(_0xbf5224){var _0x34b1b5=[];for(var _0x25ef88 in _0x1af8c1[_0x96b1('0x53')]){if(_0x1af8c1['whatsappQueues'][_0x96b1('0x45')](_0x25ef88)){var _0x5f28c2=_0x1af8c1['whatsappQueues'][_0x25ef88];var _0x377a43={'id':_0x5f28c2['id'],'available':_0x5f28c2[_0x96b1('0x4a')],'loggedIn':_0x5f28c2[_0x96b1('0x4b')],'name':_0x5f28c2[_0x96b1('0x4c')],'paused':_0x5f28c2['paused'],'waiting':_0x5f28c2['waiting']};_0x34b1b5['push'](_0x377a43);}}_0xbf5224({'count':_0x34b1b5['length'],'rows':_0x34b1b5});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x50b5c4){var _0x306bf8=_['values'](_0x1af8c1[_0x96b1('0x54')]);_0x50b5c4({'count':_0x306bf8[_0x96b1('0x16')],'rows':_0x306bf8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x331e21){var _0x378c78=_['values'](_0x1af8c1[_0x96b1('0x55')]);_0x331e21({'count':_0x378c78[_0x96b1('0x16')],'rows':_0x378c78});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5957d3){var _0x41c37d=_['values'](_0x1af8c1['openchannelQueuesWaitingInteractions']);_0x5957d3({'count':_0x41c37d[_0x96b1('0x16')],'rows':_0x41c37d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4826b6){var _0x451825=_['values'](_0x1af8c1[_0x96b1('0x56')]);_0x4826b6({'count':_0x451825[_0x96b1('0x16')],'rows':_0x451825});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x379256){var _0x5e2e61=_[_0x96b1('0x48')](_0x1af8c1[_0x96b1('0x57')]);_0x379256({'count':_0x5e2e61[_0x96b1('0x16')],'rows':_0x5e2e61});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5ae305){var _0x1e126a=_[_0x96b1('0x48')](_0x1af8c1['whatsappQueuesWaitingInteractions']);_0x5ae305({'count':_0x1e126a[_0x96b1('0x16')],'rows':_0x1e126a});});}};var _0x882723=jayson['server'](_0x4f4150)['http']();_0x882723['on'](_0x96b1('0x30'),function(_0x4c7cf3){logger[_0x96b1('0x30')](JSON['stringify'](_0x4c7cf3));return _0x46b2bb(_0x4c7cf3);});_0x882723[_0x96b1('0xf')](0x232c,_0x96b1('0x58'),function(){console[_0x96b1('0x59')](_0x96b1('0x5a'),0x232c);return _0x2119b1(_0x96b1('0x5b')+0x232c);});});}; \ No newline at end of file +var _0xf9f7=['find','chatQueues','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','available','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','applications','isArray','length','existsSync','join','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','app','./interval','condition','intervals','./applications/','priority','info','\x20|\x20','error','rules','execute','Applications\x20executed','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x4b281a,_0x1733de){_0x4b281a=_0x4b281a-0x0;var _0x3149a7=_0xf9f7[_0x4b281a];return _0x3149a7;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var path=require(_0x7f9f('0x2'));var fs=require('fs');var jayson=require(_0x7f9f('0x3'));var BPromise=require(_0x7f9f('0x4'));var utils=require(_0x7f9f('0x5'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x7f9f('0x6')),'mailQueueReport':require(_0x7f9f('0x7')),'chatQueueReport':require(_0x7f9f('0x8')),'smsQueueReport':require(_0x7f9f('0x9')),'faxQueueReport':require(_0x7f9f('0xa')),'whatsappQueueReport':require(_0x7f9f('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x37e39f,_0x3da87e,_0x181328){return util[_0x7f9f('0xc')](_0x7f9f('0xd'),_0x37e39f,_0x3da87e||0x0,_0x181328||0x0);}function getIntervals(_0x55cff9,_0x3fda85){var _0x229d32=[];if(!_[_0x7f9f('0xe')](_0x3fda85[_0x7f9f('0xf')])&&!_[_0x7f9f('0xe')](_0x55cff9[_0x3fda85[_0x7f9f('0xf')]])&&!_[_0x7f9f('0xe')](_0x55cff9[_0x3fda85['IntervalId']][_0x7f9f('0x10')])){_0x229d32=_[_0x7f9f('0x11')](_0x55cff9[_0x3fda85['IntervalId']]['Intervals'],_0x7f9f('0x12'));}else if(!_['isNil'](_0x3fda85[_0x7f9f('0x12')])){_0x229d32=[_0x3fda85[_0x7f9f('0x12')]];}return _0x229d32;}exports['listen']=function(_0x40e375){_0x40e375['rules']={};return new BPromise(function(_0x292470,_0x39adff){var _0x1e0ac5={'Start':function(_0x25beca){var _0x12b182=this;return new Promise(function(_0x5cbd29,_0x331a98){if(_0x25beca){try{var _0x3768ee=[];var _0x5a045e=getId(_0x25beca[_0x7f9f('0x13')],_0x25beca['message']?_0x25beca[_0x7f9f('0x14')]['id']:0x0,_0x25beca[_0x7f9f('0x15')]?_0x25beca[_0x7f9f('0x15')]['id']:0x0);if(_0x25beca[_0x7f9f('0x16')]&&_[_0x7f9f('0x17')](_0x25beca[_0x7f9f('0x16')])&&_0x25beca['applications'][_0x7f9f('0x18')]){for(var _0x214720=0x0;_0x214720<_0x25beca['applications'][_0x7f9f('0x18')];_0x214720+=0x1){var _0x52af88=_0x25beca[_0x7f9f('0x16')][_0x214720];if(fs[_0x7f9f('0x19')](path[_0x7f9f('0x1a')](__dirname,_0x7f9f('0x16'),_0x52af88['app']+_0x7f9f('0x1b')))){var _0x598dcc=[];switch(_0x52af88['app'][_0x7f9f('0x1c')]()){case _0x7f9f('0x1d'):var _0x1f3f66=_0x52af88[_0x7f9f('0x1e')][_0x7f9f('0x1f')](',');if(_0x25beca['channel']==='mail'){_0x598dcc[_0x7f9f('0x20')](_0x1f3f66[0x0]);_0x598dcc['push'](_0x1f3f66[0x1]);_0x598dcc[_0x7f9f('0x20')](_0x1f3f66[_0x7f9f('0x21')](0x2,_0x1f3f66[_0x7f9f('0x18')])[_0x7f9f('0x1a')](','));}else{_0x598dcc[_0x7f9f('0x20')](_0x1f3f66[0x0]);_0x598dcc[_0x7f9f('0x20')](_0x1f3f66['slice'](0x1,_0x1f3f66[_0x7f9f('0x18')])['join'](','));}break;case _0x7f9f('0x22'):var _0x3464f2=_0x52af88[_0x7f9f('0x1e')]['split'](',');_0x598dcc[_0x7f9f('0x20')](_0x3464f2[0x0]);_0x598dcc[_0x7f9f('0x20')](_0x3464f2[0x1]);_0x598dcc[_0x7f9f('0x20')](_0x3464f2['slice'](0x2,_0x3464f2[_0x7f9f('0x18')])[_0x7f9f('0x1a')](','));break;case'dialogflowv2':var _0x479687=_0x52af88['appdata'][_0x7f9f('0x1f')](',');_0x598dcc['push'](_0x479687[0x0]);_0x598dcc[_0x7f9f('0x20')](_0x479687[0x1]);_0x598dcc[_0x7f9f('0x20')](_0x479687[0x2]);_0x598dcc['push'](_0x479687[0x3]);_0x598dcc['push'](_0x479687[_0x7f9f('0x21')](0x4,_0x479687['length'])[_0x7f9f('0x1a')](','));break;case'amazonlex':var _0x5668e3=_0x52af88['appdata'][_0x7f9f('0x1f')](',');_0x598dcc['push'](_0x5668e3[0x0]);_0x598dcc[_0x7f9f('0x20')](_0x5668e3[0x1]);_0x598dcc[_0x7f9f('0x20')](_0x5668e3[0x2]);_0x598dcc[_0x7f9f('0x20')](_0x5668e3[0x3]);_0x598dcc[_0x7f9f('0x20')](_0x5668e3[_0x7f9f('0x21')](0x4,_0x5668e3['length'])['join'](','));break;case _0x7f9f('0x14'):_0x598dcc['push'](_0x52af88['appdata']);break;case _0x7f9f('0x23'):_0x598dcc[_0x7f9f('0x20')](_0x52af88[_0x7f9f('0x24')]);_0x598dcc[_0x7f9f('0x20')](_0x52af88[_0x7f9f('0x1e')]);break;case _0x7f9f('0x25'):var _0x121fff=utils[_0x7f9f('0x26')](_0x25beca[_0x7f9f('0x27')][_0x7f9f('0x28')],_0x25beca);var _0x476e36=_0x52af88[_0x7f9f('0x1e')][_0x7f9f('0x1f')](',');_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x0]);_0x598dcc['push'](_0x476e36[0x1]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x2]);_0x598dcc['push'](_0x476e36[0x3]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x4]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x5]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x6]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x7]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0x8]);_0x598dcc['push'](_0x476e36[0x9]);_0x598dcc[_0x7f9f('0x20')](_0x476e36[0xa]);_0x598dcc[_0x7f9f('0x20')](_0x25beca['interaction']['id']);_0x598dcc[_0x7f9f('0x20')](_0x25beca[_0x7f9f('0x14')]['id']);_0x598dcc[_0x7f9f('0x20')](_0x52af88[_0x7f9f('0x29')]);_0x598dcc[_0x7f9f('0x20')](_0x25beca[_0x7f9f('0x15')][_0x7f9f('0x2a')]);_0x598dcc[_0x7f9f('0x20')](_0x25beca[_0x7f9f('0x2b')][_0x7f9f('0x2b')]);_0x598dcc[_0x7f9f('0x20')](_0x121fff);break;default:_0x598dcc=_['isNil'](_0x52af88[_0x7f9f('0x1e')])?[]:_0x52af88[_0x7f9f('0x1e')]['split'](',');}var _0x605a74={'id':util[_0x7f9f('0xc')](_0x7f9f('0x2c'),_0x5a045e,_0x52af88['id'],_0x52af88[_0x7f9f('0x2d')]),'condition':require(_0x7f9f('0x2e'))[_0x7f9f('0x2f')](_0x5a045e,getIntervals(_0x40e375[_0x7f9f('0x30')],_0x52af88),_0x40e375),'consequence':require(_0x7f9f('0x31')+_0x52af88[_0x7f9f('0x2d')])['consequence'](_0x5a045e,_0x598dcc,_0x40e375,_0x25beca),'p':_0x52af88[_0x7f9f('0x32')]||0x0};logger[_0x7f9f('0x33')]('Push\x20new\x20rule',_0x605a74['id'],'on\x20interval',getIntervals(_0x40e375[_0x7f9f('0x30')],_0x52af88)[_0x7f9f('0x1a')](_0x7f9f('0x34')));_0x3768ee[_0x7f9f('0x20')](_0x605a74);}else{logger[_0x7f9f('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x7f9f('0x16'),_0x52af88[_0x7f9f('0x2d')]+_0x7f9f('0x1b')));}}_0x40e375[_0x7f9f('0x36')][_0x5a045e]=new RuleEngine(_0x3768ee);_0x40e375[_0x7f9f('0x36')][_0x5a045e][_0x7f9f('0x37')](_0x25beca,function(_0x7f6787){logger[_0x7f9f('0x33')](_0x7f9f('0x38'),JSON['stringify'](_0x7f6787['matchPath']));if(_0x40e375[_0x7f9f('0x36')][_0x5a045e]){_0x40e375[_0x7f9f('0x36')][_0x5a045e][_0x7f9f('0x39')]('complete');}});return _0x5cbd29({'code':0xc8,'message':_0x25beca});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x5cbd29({'code':0xc8,'message':_0x25beca});}}catch(_0x32dfd2){logger['error'](_0x32dfd2[_0x7f9f('0x3a')]);return _0x331a98(_0x12b182[_0x7f9f('0x35')](0x1f4,_0x32dfd2));}}return _0x331a98(_0x7f9f('0x3b'));});},'AcceptMessage':function(_0x12eb98){var _0x513d32=this;return new Promise(function(_0x4ffb9c,_0x28d27d){if(_0x12eb98[_0x7f9f('0x3c')]&&_0x12eb98['agent']['id']){if(_0x40e375[_0x7f9f('0x3d')][_0x12eb98['agent']['id']]){_0x40e375[_0x7f9f('0x3d')][_0x12eb98['agent']['id']][_0x7f9f('0x3e')]=![];_0x40e375[_0x7f9f('0x3d')][_0x12eb98[_0x7f9f('0x3c')]['id']][_0x7f9f('0x3f')]=undefined;}}if(_0x12eb98['message']&&_0x12eb98[_0x7f9f('0x14')]['id']){try{var _0x46a493=getId(_0x12eb98[_0x7f9f('0x13')],_0x12eb98['message']?_0x12eb98[_0x7f9f('0x14')]['id']:0x0,_0x12eb98[_0x7f9f('0x15')]?_0x12eb98['interaction']['id']:0x0);if(_0x40e375['rules'][_0x46a493]){_0x40e375['rules'][_0x46a493][_0x7f9f('0x39')]('end');if(rpc[_0x12eb98[_0x7f9f('0x13')]+_0x7f9f('0x40')]){rpc[_0x12eb98[_0x7f9f('0x13')]+'QueueReport'][_0x7f9f('0x41')](_0x46a493,{'UserId':_0x12eb98['message'][_0x7f9f('0x42')]})[_0x7f9f('0x43')](function(){logger[_0x7f9f('0x35')](_0x7f9f('0x44'));});}}return _0x4ffb9c({'code':0xc8,'message':_0x12eb98});}catch(_0xd93926){logger[_0x7f9f('0x35')](_0xd93926['stack']);return _0x28d27d(_0x513d32[_0x7f9f('0x35')](0x1f4,_0xd93926));}}logger[_0x7f9f('0x35')](_0x7f9f('0x45'));return _0x28d27d(_0x513d32['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x36cbc1){var _0x53cc51=this;return new Promise(function(_0x369294,_0x3d0e41){if(_0x36cbc1['agent']&&_0x36cbc1[_0x7f9f('0x3c')]['id']){try{if(_0x40e375[_0x7f9f('0x3d')][_0x36cbc1[_0x7f9f('0x3c')]['id']]){_0x40e375[_0x7f9f('0x3d')][_0x36cbc1[_0x7f9f('0x3c')]['id']]['busy']=![];_0x40e375[_0x7f9f('0x3d')][_0x36cbc1[_0x7f9f('0x3c')]['id']][_0x7f9f('0x3f')]=undefined;}return _0x369294({'code':0xc8,'message':_0x36cbc1});}catch(_0x393484){logger[_0x7f9f('0x35')](_0x393484['stack']);return _0x3d0e41(_0x53cc51['error'](0x1f4,_0x393484));}}logger['error']('message\x20is\x20empty');return _0x3d0e41(_0x53cc51['error'](0x1f4,_0x7f9f('0x45')));});},'AbandonInteraction':function(_0x3ad395){var _0x2bc8d6=this;return new Promise(function(_0x4f628e,_0x127507){if(_0x3ad395[_0x7f9f('0x13')]&&_0x3ad395[_0x7f9f('0x15')]&&_0x3ad395[_0x7f9f('0x15')]['id']){try{var _0x558d26=getId(_0x3ad395['channel'],_0x3ad395[_0x7f9f('0x14')]?_0x3ad395['message']['id']:0x0,_0x3ad395[_0x7f9f('0x15')]?_0x3ad395['interaction']['id']:0x0);if(_0x40e375[_0x7f9f('0x36')][_0x558d26]){_0x40e375[_0x7f9f('0x36')][_0x558d26][_0x7f9f('0x39')](_0x7f9f('0x46'));}return _0x4f628e({'code':0xc8,'message':_0x3ad395});}catch(_0x11f462){logger['error'](_0x11f462[_0x7f9f('0x3a')]);return _0x127507(_0x2bc8d6[_0x7f9f('0x35')](0x1f4,_0x11f462));}}logger['error'](_0x7f9f('0x45'));return _0x127507(_0x2bc8d6[_0x7f9f('0x35')](0x1f4,_0x7f9f('0x45')));});},'AgentCapacity':function(_0x215960){var _0x58b7de=this;return new Promise(function(_0xa27ba7,_0x138097){if(_0x40e375[_0x7f9f('0x3d')]['hasOwnProperty'](_0x215960['id'])){for(var _0x76f357 in _0x215960['capacity']){if(_0x215960[_0x7f9f('0x47')][_0x7f9f('0x48')](_0x76f357)){if(_0x40e375[_0x7f9f('0x3d')][_0x215960['id']][_0x7f9f('0x48')](_0x76f357+'CurrentCapacity')){_0x40e375[_0x7f9f('0x3d')][_0x215960['id']][_0x76f357+_0x7f9f('0x49')]=parseInt(_0x215960[_0x7f9f('0x47')][_0x76f357],0xa);}}}_0x40e375[_0x7f9f('0x3d')][_0x215960['id']][_0x7f9f('0x4a')]();return _0xa27ba7({'code':0xc8,'message':_0x40e375[_0x7f9f('0x3d')][_0x215960['id']]});}else{return _0x138097(_0x58b7de['error'](0x1f4,_0x7f9f('0x4b')));}});},'Agents':function(_0x2a414c){return new Promise(function(_0x278aff){var _0x288754=_[_0x7f9f('0x4c')](_0x40e375[_0x7f9f('0x3d')]);if(_0x2a414c&&_0x2a414c['id']){var _0x1b0170=_[_0x7f9f('0x4d')](_0x288754,function(_0x452695){return _0x452695['id']===_0x2a414c['id'];});_0x278aff(_0x1b0170);}else{_0x278aff({'count':_0x288754[_0x7f9f('0x18')],'rows':_0x288754});}});},'ChatQueues':function(){return new Promise(function(_0x56983d){var _0x2b52ae=[];for(var _0x46e2fd in _0x40e375[_0x7f9f('0x4e')]){if(_0x40e375['chatQueues'][_0x7f9f('0x48')](_0x46e2fd)){var _0x4c9e5=_0x40e375[_0x7f9f('0x4e')][_0x46e2fd];var _0x3ca07f={'id':_0x4c9e5['id'],'available':_0x4c9e5['available'],'loggedIn':_0x4c9e5['loggedIn'],'name':_0x4c9e5['name'],'paused':_0x4c9e5[_0x7f9f('0x4f')],'waiting':_0x4c9e5[_0x7f9f('0x50')]};_0x2b52ae[_0x7f9f('0x20')](_0x3ca07f);}}_0x56983d({'count':_0x2b52ae[_0x7f9f('0x18')],'rows':_0x2b52ae});});},'MailQueues':function(){return new Promise(function(_0x636b19){var _0x2ecf19=[];for(var _0x1d603d in _0x40e375[_0x7f9f('0x51')]){if(_0x40e375['mailQueues'][_0x7f9f('0x48')](_0x1d603d)){var _0x2ff255=_0x40e375[_0x7f9f('0x51')][_0x1d603d];var _0x2f9b4f={'id':_0x2ff255['id'],'available':_0x2ff255['available'],'loggedIn':_0x2ff255[_0x7f9f('0x52')],'name':_0x2ff255[_0x7f9f('0x53')],'paused':_0x2ff255['paused'],'waiting':_0x2ff255['waiting']};_0x2ecf19[_0x7f9f('0x20')](_0x2f9b4f);}}_0x636b19({'count':_0x2ecf19[_0x7f9f('0x18')],'rows':_0x2ecf19});});},'OpenchannelQueues':function(){return new Promise(function(_0x3cf07d){var _0x75a34b=[];for(var _0xa9a9c2 in _0x40e375[_0x7f9f('0x54')]){if(_0x40e375[_0x7f9f('0x54')]['hasOwnProperty'](_0xa9a9c2)){var _0x390360=_0x40e375['openchannelQueues'][_0xa9a9c2];var _0x5094f2={'id':_0x390360['id'],'available':_0x390360['available'],'loggedIn':_0x390360['loggedIn'],'name':_0x390360['name'],'paused':_0x390360['paused'],'waiting':_0x390360[_0x7f9f('0x50')]};_0x75a34b[_0x7f9f('0x20')](_0x5094f2);}}_0x3cf07d({'count':_0x75a34b[_0x7f9f('0x18')],'rows':_0x75a34b});});},'SmsQueues':function(){return new Promise(function(_0x3b161c){var _0xcef813=[];for(var _0x311f51 in _0x40e375[_0x7f9f('0x55')]){if(_0x40e375[_0x7f9f('0x55')][_0x7f9f('0x48')](_0x311f51)){var _0xe118d7=_0x40e375[_0x7f9f('0x55')][_0x311f51];var _0x3c4458={'id':_0xe118d7['id'],'available':_0xe118d7[_0x7f9f('0x56')],'loggedIn':_0xe118d7[_0x7f9f('0x52')],'name':_0xe118d7[_0x7f9f('0x53')],'paused':_0xe118d7[_0x7f9f('0x4f')],'waiting':_0xe118d7[_0x7f9f('0x50')]};_0xcef813[_0x7f9f('0x20')](_0x3c4458);}}_0x3b161c({'count':_0xcef813[_0x7f9f('0x18')],'rows':_0xcef813});});},'FaxQueues':function(){return new Promise(function(_0x3d0747){var _0x16172d=[];for(var _0x5d5ed7 in _0x40e375[_0x7f9f('0x57')]){if(_0x40e375[_0x7f9f('0x57')][_0x7f9f('0x48')](_0x5d5ed7)){var _0x21d41b=_0x40e375['faxQueues'][_0x5d5ed7];var _0x26e11b={'id':_0x21d41b['id'],'available':_0x21d41b[_0x7f9f('0x56')],'loggedIn':_0x21d41b['loggedIn'],'name':_0x21d41b[_0x7f9f('0x53')],'paused':_0x21d41b[_0x7f9f('0x4f')],'waiting':_0x21d41b[_0x7f9f('0x50')]};_0x16172d['push'](_0x26e11b);}}_0x3d0747({'count':_0x16172d[_0x7f9f('0x18')],'rows':_0x16172d});});},'WhatsappQueues':function(){return new Promise(function(_0x404ec0){var _0xc2d77a=[];for(var _0x24b244 in _0x40e375[_0x7f9f('0x58')]){if(_0x40e375[_0x7f9f('0x58')][_0x7f9f('0x48')](_0x24b244)){var _0x27ea61=_0x40e375[_0x7f9f('0x58')][_0x24b244];var _0x614919={'id':_0x27ea61['id'],'available':_0x27ea61[_0x7f9f('0x56')],'loggedIn':_0x27ea61['loggedIn'],'name':_0x27ea61['name'],'paused':_0x27ea61[_0x7f9f('0x4f')],'waiting':_0x27ea61[_0x7f9f('0x50')]};_0xc2d77a['push'](_0x614919);}}_0x404ec0({'count':_0xc2d77a[_0x7f9f('0x18')],'rows':_0xc2d77a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x184976){var _0x395c58=_['values'](_0x40e375[_0x7f9f('0x59')]);_0x184976({'count':_0x395c58[_0x7f9f('0x18')],'rows':_0x395c58});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x43d4f9){var _0x570396=_['values'](_0x40e375[_0x7f9f('0x5a')]);_0x43d4f9({'count':_0x570396['length'],'rows':_0x570396});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4ef81e){var _0x17a260=_['values'](_0x40e375[_0x7f9f('0x5b')]);_0x4ef81e({'count':_0x17a260[_0x7f9f('0x18')],'rows':_0x17a260});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x46f19d){var _0x12e7c8=_['values'](_0x40e375[_0x7f9f('0x5c')]);_0x46f19d({'count':_0x12e7c8[_0x7f9f('0x18')],'rows':_0x12e7c8});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x45e85f){var _0x3f6782=_['values'](_0x40e375['faxQueuesWaitingInteractions']);_0x45e85f({'count':_0x3f6782[_0x7f9f('0x18')],'rows':_0x3f6782});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3fd1d7){var _0x474175=_[_0x7f9f('0x4c')](_0x40e375[_0x7f9f('0x5d')]);_0x3fd1d7({'count':_0x474175[_0x7f9f('0x18')],'rows':_0x474175});});}};var _0x33811f=jayson[_0x7f9f('0x5e')](_0x1e0ac5)['http']();_0x33811f['on']('error',function(_0x1bf939){logger[_0x7f9f('0x35')](JSON[_0x7f9f('0x5f')](_0x1bf939));return _0x39adff(_0x1bf939);});_0x33811f[_0x7f9f('0x60')](0x232c,_0x7f9f('0x61'),function(){console['log'](_0x7f9f('0x62'),0x232c);return _0x292470(_0x7f9f('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index a0c4595..f102afe 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 _0xb2b9=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','join','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result'];(function(_0x42d987,_0x5e756e){var _0x34d473=function(_0x23b635){while(--_0x23b635){_0x42d987['push'](_0x42d987['shift']());}};_0x34d473(++_0x5e756e);}(_0xb2b9,0x15c));var _0x9b2b=function(_0x1a11aa,_0x5eeb4d){_0x1a11aa=_0x1a11aa-0x0;var _0x2d54b5=_0xb2b9[_0x1a11aa];return _0x2d54b5;};'use strict';var util=require(_0x9b2b('0x0'));var BPromise=require(_0x9b2b('0x1'));var jayson=require(_0x9b2b('0x2'));var _=require(_0x9b2b('0x3'));var logger=require('../../../config/logger')(_0x9b2b('0x4'));var client=jayson[_0x9b2b('0x5')][_0x9b2b('0x6')]({'port':0x232a});function request(_0x391839,_0x1918c7){return new BPromise(function(_0x5a3a6b,_0x4e1d0a){return client[_0x9b2b('0x7')](_0x391839,_0x1918c7)[_0x9b2b('0x8')](function(_0x1b996b){if(_0x1b996b[_0x9b2b('0x9')]){return _0x4e1d0a(_0x1b996b[_0x9b2b('0x9')][_0x9b2b('0xa')]);}else{return _0x5a3a6b(_0x1b996b[_0x9b2b('0xb')]);}})[_0x9b2b('0xc')](function(_0x4419ef){return _0x4e1d0a(_0x4419ef);});});}exports[_0x9b2b('0xd')]=function(_0xf593bd,_0x10709d,_0x59c766){return function(_0x22acb9){if(_0x59c766['rules']&&!_0x59c766[_0x9b2b('0xe')][_0xf593bd]){logger[_0x9b2b('0xf')](_0x9b2b('0x10'),_0xf593bd);return _0x22acb9[_0x9b2b('0x11')]();}var _0x28275b=[];for(var _0x3123b6=0x0;_0x3123b6<_0x10709d[_0x9b2b('0x12')];_0x3123b6+=0x1){_0x28275b[_0x9b2b('0x13')](request('Command',{'command':util['format'](_0x9b2b('0x14'),_0x10709d[_0x3123b6])})['then'](function(_0x2fd73a){return _0x2fd73a&&_0x2fd73a['message']&&_0x2fd73a[_0x9b2b('0xa')][_0x9b2b('0x15')](_0x9b2b('0x16'))>=0x0?!![]:![];})[_0x9b2b('0xc')](function(_0xec1509){logger['error'](_0x9b2b('0x17'),_0xf593bd,_0x10709d[_0x3123b6]);}));}BPromise['all'](_0x28275b)[_0x9b2b('0x8')](function(_0x118dee){var _0x1dbeda=_[_0x9b2b('0x18')](_0x118dee);logger[_0x9b2b('0xf')]('[%s][INTERVAL]\x20%s\x20%s',_0xf593bd,_0x10709d[_0x9b2b('0x19')]('\x20|\x20'),_0x1dbeda);_0x22acb9['when'](_0x1dbeda);})[_0x9b2b('0xc')](function(_0x3243c2){console[_0x9b2b('0x1a')](_0x3243c2);logger[_0x9b2b('0x9')](_0x9b2b('0x1b'),_0xf593bd,_0x10709d[_0x9b2b('0x19')](_0x9b2b('0x1c')),_0x3243c2[_0x9b2b('0x1d')]);_0x22acb9[_0x9b2b('0x11')]();});};}; \ No newline at end of file +var _0x7319=['condition','rules','info','stop','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','error','message','result','catch'];(function(_0x28cb1f,_0x5e81e6){var _0x5d1fc9=function(_0x34785a){while(--_0x34785a){_0x28cb1f['push'](_0x28cb1f['shift']());}};_0x5d1fc9(++_0x5e81e6);}(_0x7319,0x133));var _0x9731=function(_0x122eec,_0x549d70){_0x122eec=_0x122eec-0x0;var _0x388d7f=_0x7319[_0x122eec];return _0x388d7f;};'use strict';var util=require(_0x9731('0x0'));var BPromise=require(_0x9731('0x1'));var jayson=require(_0x9731('0x2'));var _=require(_0x9731('0x3'));var logger=require(_0x9731('0x4'))(_0x9731('0x5'));var client=jayson[_0x9731('0x6')]['http']({'port':0x232a});function request(_0x1011b4,_0x18b648){return new BPromise(function(_0x5041d8,_0x5110a1){return client[_0x9731('0x7')](_0x1011b4,_0x18b648)['then'](function(_0x4d41b3){if(_0x4d41b3[_0x9731('0x8')]){return _0x5110a1(_0x4d41b3[_0x9731('0x8')][_0x9731('0x9')]);}else{return _0x5041d8(_0x4d41b3[_0x9731('0xa')]);}})[_0x9731('0xb')](function(_0x85d70f){return _0x5110a1(_0x85d70f);});});}exports[_0x9731('0xc')]=function(_0xd14b79,_0x436ef6,_0xe1fb7a){return function(_0x2bfcb2){if(_0xe1fb7a['rules']&&!_0xe1fb7a[_0x9731('0xd')][_0xd14b79]){logger[_0x9731('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xd14b79);return _0x2bfcb2[_0x9731('0xf')]();}var _0xd5d1a0=[];for(var _0x5f146e=0x0;_0x5f146e<_0x436ef6['length'];_0x5f146e+=0x1){_0xd5d1a0[_0x9731('0x10')](request(_0x9731('0x11'),{'command':util[_0x9731('0x12')](_0x9731('0x13'),_0x436ef6[_0x5f146e])})['then'](function(_0x53fa75){return _0x53fa75&&_0x53fa75[_0x9731('0x9')]&&_0x53fa75[_0x9731('0x9')][_0x9731('0x14')](_0x9731('0x15'))>=0x0?!![]:![];})['catch'](function(_0x520a89){logger[_0x9731('0x8')](_0x9731('0x16'),_0xd14b79,_0x436ef6[_0x5f146e]);}));}BPromise[_0x9731('0x17')](_0xd5d1a0)['then'](function(_0x42e0eb){var _0x2e2580=_[_0x9731('0x18')](_0x42e0eb);logger[_0x9731('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0xd14b79,_0x436ef6['join']('\x20|\x20'),_0x2e2580);_0x2bfcb2['when'](_0x2e2580);})['catch'](function(_0x1bf010){console[_0x9731('0x19')](_0x1bf010);logger[_0x9731('0x8')](_0x9731('0x1a'),_0xd14b79,_0x436ef6['join'](_0x9731('0x1b')),_0x1bf010[_0x9731('0x1c')]);_0x2bfcb2[_0x9731('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f1d0578..e9fb61b 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 _0xd404=['channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','abandoned','agentconnect','info','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','secondtransfererlinkedid','transfertargetuniqueid','calleridname','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','diffTime','agent','complete','[%s][agents][hangup]','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd404,0x15b));var _0x4d40=function(_0x1ff1da,_0x3eb6cd){_0x1ff1da=_0x1ff1da-0x0;var _0x4d0b2f=_0xd404[_0x1ff1da];return _0x4d0b2f;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0xb6576c,_0x2322e5){utils['info'](util[_0x4d40('0x2')](_0x4d40('0x3'),_0xb6576c[_0x4d40('0x4')],_0xb6576c[_0x4d40('0x5')],_0xb6576c[_0x4d40('0x6')],_0xb6576c[_0x4d40('0x7')],_0xb6576c[_0x4d40('0x8')],_0xb6576c[_0x4d40('0x9')],_0xb6576c[_0x4d40('0xa')],_0xb6576c['lastevent']));if(_0xb6576c[_0x4d40('0x6')]){utils[_0x4d40('0xb')](_0xb6576c['queue'])[_0x4d40('0xc')](function(_0x5e31bc){if(_0x5e31bc){_0xb6576c['type']=_0x5e31bc[_0x4d40('0xd')];_0xb6576c[_0x4d40('0xe')]=_0xb6576c[_0x4d40('0xf')]?_0x5e31bc[_0x4d40('0x10')]:![];_0xb6576c[_0x4d40('0x11')]=_0xb6576c[_0x4d40('0xe')]?_0x5e31bc[_0x4d40('0x12')]:0x0;}utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);});}else{utils[_0x4d40('0x13')](_0x4d40('0x14'),_0xb6576c);}if(_0x2322e5){delete transfers[_0xb6576c[_0x4d40('0x4')]];}else{delete agents[_0xb6576c[_0x4d40('0x15')]];}}exports[_0x4d40('0x16')]=function(_0x5162f9){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x5162f9);agents[_0x5162f9[_0x4d40('0x15')]]=_0x5162f9;agents[_0x5162f9['destuniqueid']][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1b')]=_0x4d40('0x1c');agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0xa')]=null;agents[_0x5162f9[_0x4d40('0x15')]][_0x4d40('0x1d')]=null;utils['info'](util['format'](_0x4d40('0x1e'),_0x5162f9[_0x4d40('0x4')],agents[_0x5162f9['destuniqueid']][_0x4d40('0x7')],_0x5162f9[_0x4d40('0x15')]));}catch(_0x4eec1d){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x18'),_0x5162f9[_0x4d40('0x4')]),_0x4eec1d);}};exports['agentringnoanswer']=function(_0x57c997){try{if(!_[_0x4d40('0x20')](agents[_0x57c997[_0x4d40('0x15')]])){utils['debug'](util[_0x4d40('0x2')](_0x4d40('0x21'),_0x57c997[_0x4d40('0x4')]),_0x57c997);utils['info'](util[_0x4d40('0x2')](_0x4d40('0x22'),_0x57c997[_0x4d40('0x4')],agents[_0x57c997['destuniqueid']]['membername'],_0x57c997[_0x4d40('0x15')]));agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x23')]=!![];agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x24')]=utils['now']();agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x1b')]='timeout';agents[_0x57c997['destuniqueid']][_0x4d40('0x25')]=_0x4d40('0x26');agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x27')]=_0x57c997[_0x4d40('0x28')]?parseInt(_0x57c997[_0x4d40('0x28')])/0x3e8:0x0;agents[_0x57c997[_0x4d40('0x15')]][_0x4d40('0x29')]=0x0;unanswered[_0x4d40('0x2a')](_0x57c997[_0x4d40('0x15')]);}}catch(_0x1c0fcf){utils['error'](util['format']('[%s][agents][agentringnoanswer]',_0x57c997[_0x4d40('0x4')]),_0x1c0fcf);}};exports[_0x4d40('0x2b')]=function(_0x1ac240){try{_[_0x4d40('0x2c')](agents,function(_0x598ca9,_0x18e601){if(_0x598ca9[_0x4d40('0x4')]==_0x1ac240[_0x4d40('0x4')]&&!_['includes'](unanswered,_0x598ca9[_0x4d40('0x15')])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x1ac240);utils['info'](util[_0x4d40('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ac240[_0x4d40('0x4')],_0x598ca9[_0x4d40('0x7')],_0x598ca9[_0x4d40('0x15')]));_0x598ca9[_0x4d40('0x23')]=!![];_0x598ca9['agentringnoanswerAt']=utils['now']();_0x598ca9[_0x4d40('0x1b')]=_0x4d40('0x2e');_0x598ca9[_0x4d40('0x25')]=_0x4d40('0x2e');_0x598ca9['holdtime']=_0x1ac240[_0x4d40('0x27')];_0x598ca9['talktime']=0x0;writeDB(_0x598ca9);}});}catch(_0x2fde16){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x2d'),_0x1ac240[_0x4d40('0x4')]),_0x2fde16);}};exports[_0x4d40('0x2f')]=function(_0x1d1ba9){try{if(agents[_0x1d1ba9[_0x4d40('0x15')]]){utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1d1ba9);utils[_0x4d40('0x30')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1d1ba9['uniqueid'],agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x7')],_0x1d1ba9['destuniqueid']));agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0xa')]=_0x1d1ba9['connectedlinenum'];agents[_0x1d1ba9[_0x4d40('0x15')]][_0x4d40('0x1d')]=_0x1d1ba9['connectedlinename'];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x27')]=_0x1d1ba9[_0x4d40('0x28')];agents[_0x1d1ba9['destuniqueid']][_0x4d40('0x1b')]=_0x4d40('0x32');_['forIn'](agents,function(_0x1e8427,_0x1a9586){if(_0x1e8427['destuniqueid']!=_0x1d1ba9[_0x4d40('0x15')]&&_0x1e8427[_0x4d40('0x4')]==_0x1d1ba9['uniqueid']){_0x1e8427[_0x4d40('0x29')]=0x0;_0x1e8427['holdtime']=_0x1d1ba9[_0x4d40('0x28')];_0x1e8427[_0x4d40('0x23')]=!![];_0x1e8427[_0x4d40('0x24')]=utils[_0x4d40('0x1a')]();_0x1e8427[_0x4d40('0x1b')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x25')]=_0x4d40('0x33');_0x1e8427[_0x4d40('0x34')]=_0x1d1ba9['destuniqueid'];_0x1e8427[_0x4d40('0x35')]=_0x1d1ba9[_0x4d40('0x7')];writeDB(_0x1e8427);}});}}catch(_0x1c2fa8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][agentconnect]',_0x1d1ba9[_0x4d40('0x4')]),_0x1c2fa8);}};exports['agentcomplete']=function(_0x2e7f75){try{if(!_[_0x4d40('0x20')](agents[_0x2e7f75[_0x4d40('0x15')]])){utils[_0x4d40('0x17')](util['format'](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x2e7f75);utils['info'](util[_0x4d40('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2e7f75[_0x4d40('0x4')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x7')],_0x2e7f75[_0x4d40('0x15')]));agents[_0x2e7f75['destuniqueid']][_0x4d40('0xf')]=!![];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x29')]=utils['diffTime'](agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x37')],agents[_0x2e7f75[_0x4d40('0x15')]][_0x4d40('0x31')]);agents[_0x2e7f75['destuniqueid']][_0x4d40('0x25')]=_0x2e7f75[_0x4d40('0x25')];agents[_0x2e7f75['destuniqueid']][_0x4d40('0x1b')]='complete';writeDB(agents[_0x2e7f75[_0x4d40('0x15')]]);}}catch(_0x1777e8){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')](_0x4d40('0x36'),_0x2e7f75[_0x4d40('0x4')]),_0x1777e8);}};exports[_0x4d40('0x38')]=function(_0x37b6bf){try{if(!_[_0x4d40('0x20')](agents[_0x37b6bf['transfereruniqueid']])){utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x39'),_0x37b6bf[_0x4d40('0x4')]),_0x37b6bf);utils[_0x4d40('0x30')](util['format'](_0x4d40('0x3a'),_0x37b6bf[_0x4d40('0x4')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x7')],agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x4')]));agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3c')]=!![];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x3d')]=_0x4d40('0x3e');agents[_0x37b6bf[_0x4d40('0x3b')]][_0x4d40('0x3f')]=_0x37b6bf[_0x4d40('0x40')];agents[_0x37b6bf['transfereruniqueid']][_0x4d40('0x41')]=agents[_0x37b6bf[_0x4d40('0x3b')]]['uniqueid'];}}catch(_0x1000f4){utils['error'](util[_0x4d40('0x2')]('[%s][agents][blindtransfer]',_0x37b6bf[_0x4d40('0x4')]),_0x1000f4);}};exports[_0x4d40('0x42')]=function(_0x539df4){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')](_0x4d40('0x43'),_0x539df4[_0x4d40('0x44')]),_0x539df4);if(_0x539df4[_0x4d40('0x44')]==_0x539df4[_0x4d40('0x45')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x46')]])){utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x3d')]=_0x4d40('0x48');agents[_0x539df4['secondtransfereruniqueid']][_0x4d40('0x3f')]=_0x539df4[_0x4d40('0x49')];agents[_0x539df4['secondtransfereruniqueid']]['transferuniqueid']=_0x539df4[_0x4d40('0x44')];}if(_0x539df4[_0x4d40('0x4a')]&&agents[_0x539df4['transfereeuniqueid']]){agents[_0x539df4['transfereeuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4['transfereeuniqueid']]=_[_0x4d40('0x4c')](agents[_0x539df4['transfereeuniqueid']]);transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x9')]=agents[_0x539df4[_0x4d40('0x46')]][_0x4d40('0x9')];transfers[_0x539df4[_0x4d40('0x4a')]]['calleridname']=agents[_0x539df4['secondtransfereruniqueid']]['calleridname'];transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x19')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x31')]=utils['now']();transfers[_0x539df4[_0x4d40('0x4a')]]['holdtime']=0x0;transfers[_0x539df4[_0x4d40('0x4a')]][_0x4d40('0x4b')]=0x2;}}else if(_0x539df4[_0x4d40('0x46')]==_0x539df4[_0x4d40('0x4d')]){if(!_[_0x4d40('0x20')](agents[_0x539df4[_0x4d40('0x44')]])){utils['info'](util['format'](_0x4d40('0x47'),_0x539df4[_0x4d40('0x44')],agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x7')]));agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3c')]=!![];agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x3d')]='ATTENDED';agents[_0x539df4[_0x4d40('0x44')]]['transferexten']=_0x539df4['secondtransfererexten'];agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x41')]=_0x539df4[_0x4d40('0x46')];}if(_0x539df4[_0x4d40('0x4e')]&&agents[_0x539df4[_0x4d40('0x4e')]]){agents[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4b')]=0x1;transfers[_0x539df4[_0x4d40('0x4e')]]=_[_0x4d40('0x4c')](agents[_0x539df4[_0x4d40('0x4e')]]);transfers[_0x539df4[_0x4d40('0x4e')]]['calleridnum']=agents[_0x539df4['origtransfereruniqueid']][_0x4d40('0x9')];transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x4f')]=agents[_0x539df4[_0x4d40('0x44')]][_0x4d40('0x4f')];transfers[_0x539df4['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x31')]=utils[_0x4d40('0x1a')]();transfers[_0x539df4['transfertargetuniqueid']][_0x4d40('0x27')]=0x0;transfers[_0x539df4[_0x4d40('0x4e')]][_0x4d40('0x4b')]=0x2;}}}catch(_0x3bce3d){utils[_0x4d40('0x1f')](util[_0x4d40('0x2')]('[%s][agents][attendedtransfer]',_0x539df4['origtransfereruniqueid']),_0x3bce3d);}};exports['hangup']=function(_0x13872b){try{utils[_0x4d40('0x17')](util[_0x4d40('0x2')]('[%s][agents][hangup]',_0x13872b[_0x4d40('0x4')]),_0x13872b);if(agents[_0x13872b[_0x4d40('0x4')]]&&agents[_0x13872b['uniqueid']]['reason']===_0x4d40('0x26')){if(_0x13872b[_0x4d40('0x50')]==='21'){agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=_0x4d40('0x51');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x51');}utils[_0x4d40('0x30')](util['format'](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b[_0x4d40('0x4')]]);var _0x7df23=unanswered['indexOf'](_0x13872b[_0x4d40('0x4')]);if(_0x7df23>-0x1){unanswered[_0x4d40('0x53')](_0x7df23,0x1);}}if(transfers[_0x13872b[_0x4d40('0x4')]]){transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];transfers[_0x13872b['uniqueid']][_0x4d40('0x37')]=utils[_0x4d40('0x1a')]();transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x29')]=utils[_0x4d40('0x54')](transfers[_0x13872b[_0x4d40('0x4')]]['agentcompleteAt'],transfers[_0x13872b[_0x4d40('0x4')]]['agentconnectAt']);transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')]=_0x4d40('0x55');transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]='complete';utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b[_0x4d40('0x4')],transfers[_0x13872b['uniqueid']][_0x4d40('0x7')],transfers[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x25')],transfers[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(transfers[_0x13872b[_0x4d40('0x4')]],!![]);}if(agents[_0x13872b['uniqueid']]&&agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]){agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0xf')]=!![];agents[_0x13872b['uniqueid']]['agentcompleteAt']=utils[_0x4d40('0x1a')]();agents[_0x13872b[_0x4d40('0x4')]]['talktime']=utils[_0x4d40('0x54')](agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x37')],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x31')]);agents[_0x13872b['uniqueid']][_0x4d40('0x25')]=agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x3c')]?_0x4d40('0x3c'):_0x4d40('0x55');agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x1b')]=_0x4d40('0x56');utils[_0x4d40('0x30')](util[_0x4d40('0x2')](_0x4d40('0x52'),_0x13872b['uniqueid'],agents[_0x13872b[_0x4d40('0x4')]][_0x4d40('0x7')],agents[_0x13872b['uniqueid']][_0x4d40('0x25')],agents[_0x13872b[_0x4d40('0x4')]]['lastevent']));writeDB(agents[_0x13872b['uniqueid']]);}}catch(_0x33b8f3){utils[_0x4d40('0x1f')](util['format'](_0x4d40('0x57'),_0x13872b[_0x4d40('0x4')]),_0x33b8f3);}}; \ No newline at end of file +var _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0xb67b89,_0x5c30f8){var _0x30708f=function(_0x1c232f){while(--_0x1c232f){_0xb67b89['push'](_0xb67b89['shift']());}};_0x30708f(++_0x5c30f8);}(_0x2f68,0x9a));var _0x82f6=function(_0xe80c22,_0x306ae7){_0xe80c22=_0xe80c22-0x0;var _0x426fa4=_0x2f68[_0xe80c22];return _0x426fa4;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d446558..33e335f 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 _0x4bd3=['callerid','cause-txt','endtime','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','[%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','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','./utils','./transfers.controller','NO\x20ANSWER','BUSY','FAILED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','membername','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','recording','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4bd3,0x174));var _0x34bd=function(_0x5f3117,_0x344b24){_0x5f3117=_0x5f3117-0x0;var _0x14a451=_0x4bd3[_0x5f3117];return _0x14a451;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var utils=require(_0x34bd('0x1'));var transfers=require(_0x34bd('0x2'));var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0x34bd('0x3'),_0x34bd('0x3'),_0x34bd('0x3'),'ANSWERED',_0x34bd('0x4'),_0x34bd('0x5'),'FAILED',_0x34bd('0x5')];var channels={};function writeDB(_0x213716){var _0x51a4d7;if(transfers[_0x34bd('0x6')][_0x213716[_0x34bd('0x7')]]){_0x51a4d7=_0x213716[_0x34bd('0x7')];_0x213716[_0x34bd('0x7')]=transfers[_0x34bd('0x6')][_0x213716[_0x34bd('0x7')]]['transfereeuniqueid'];}utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0xa'),_0x213716[_0x34bd('0x7')],_0x213716['channel'],_0x213716['queue'],_0x213716[_0x34bd('0xb')],_0x213716['interface'],_0x213716['calleridnum'],_0x213716[_0x34bd('0xc')],_0x213716[_0x34bd('0xd')]));if(_0x213716[_0x34bd('0xe')]){utils[_0x34bd('0xf')](_0x213716[_0x34bd('0xe')])[_0x34bd('0x10')](function(_0x4134ee){if(_0x4134ee){_0x213716[_0x34bd('0x11')]=_0x4134ee['id'];}utils[_0x34bd('0x12')]('CreateVoiceCallReport',_0x213716);});}else{utils[_0x34bd('0x12')]('CreateVoiceCallReport',_0x213716);}if(channels[_0x213716['uniqueid']]){delete channels[_0x213716[_0x34bd('0x7')]];}else if(_0x51a4d7&&channels[_0x51a4d7]){if(!transfers[_0x34bd('0x6')][_0x51a4d7][_0x34bd('0x13')])delete transfers[_0x34bd('0x6')][_0x51a4d7];delete channels[_0x51a4d7];}}exports[_0x34bd('0x14')]=function(_0x1643af){try{utils[_0x34bd('0x15')](util[_0x34bd('0x9')](_0x34bd('0x16'),_0x1643af[_0x34bd('0x7')]),_0x1643af);if(_0x1643af[_0x34bd('0x7')]==_0x1643af['linkedid']&&_0x1643af[_0x34bd('0x17')]!=_0x34bd('0x18')){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x19'),_0x1643af[_0x34bd('0x7')],_0x1643af[_0x34bd('0x1a')],_0x1643af[_0x34bd('0x1b')]));channels[_0x1643af[_0x34bd('0x7')]]={'uniqueid':_0x1643af['uniqueid'],'accountcode':_0x1643af[_0x34bd('0xe')],'source':_0x1643af[_0x34bd('0x1c')],'destination':_0x1643af[_0x34bd('0x1b')],'destinationcontext':_0x1643af[_0x34bd('0x1a')],'channel':_0x1643af[_0x34bd('0x17')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x4edf84){utils[_0x34bd('0x1d')](util['format'](_0x34bd('0x16'),_0x1643af[_0x34bd('0x7')]),_0x4edf84);}};exports[_0x34bd('0x1e')]=function(_0x5c3c85){try{utils[_0x34bd('0x15')](util[_0x34bd('0x9')](_0x34bd('0x1f'),_0x5c3c85[_0x34bd('0x7')]),_0x5c3c85);if(!_['isNil'](channels[_0x5c3c85[_0x34bd('0x7')]])&&_0x5c3c85[_0x34bd('0x20')]==0x6){utils[_0x34bd('0x8')](util[_0x34bd('0x9')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5c3c85[_0x34bd('0x7')],_0x5c3c85[_0x34bd('0x1a')],_0x5c3c85['channel']));if(_[_0x34bd('0x21')](channels[_0x5c3c85[_0x34bd('0x7')]][_0x34bd('0x22')])){channels[_0x5c3c85[_0x34bd('0x7')]][_0x34bd('0x22')]=utils[_0x34bd('0x23')]();}}else if(!_[_0x34bd('0x21')](channels[_0x5c3c85['linkedid']])&&_0x5c3c85[_0x34bd('0x20')]==0x6&&_0x5c3c85[_0x34bd('0x1a')]!='transfer'){utils['info'](util[_0x34bd('0x9')](_0x34bd('0x24'),_0x5c3c85[_0x34bd('0x7')],_0x5c3c85['linkedid'],_0x5c3c85['context'],_0x5c3c85[_0x34bd('0x17')]));channels[_0x5c3c85[_0x34bd('0x25')]][_0x34bd('0xe')]=_0x5c3c85[_0x34bd('0xe')];channels[_0x5c3c85['linkedid']][_0x34bd('0x26')]=_0x5c3c85[_0x34bd('0x17')];if(_[_0x34bd('0x21')](channels[_0x5c3c85[_0x34bd('0x25')]][_0x34bd('0x27')])){channels[_0x5c3c85[_0x34bd('0x25')]]['answertime']=utils[_0x34bd('0x23')]();}channels[_0x5c3c85['linkedid']][_0x34bd('0x28')]=dispositions[_[_0x34bd('0x29')](_0x5c3c85[_0x34bd('0x20')])]||'ANSWERED';}}catch(_0x2ff72e){utils[_0x34bd('0x1d')](util['format'](_0x34bd('0x1f'),_0x5c3c85[_0x34bd('0x7')]),_0x2ff72e);}};exports[_0x34bd('0x2a')]=function(_0x4d0a02){try{if(!_[_0x34bd('0x21')](channels[_0x4d0a02[_0x34bd('0x7')]])){utils['debug'](util[_0x34bd('0x9')](_0x34bd('0x2b'),_0x4d0a02[_0x34bd('0x7')]),_0x4d0a02);if(_[_0x34bd('0x21')](channels[_0x4d0a02[_0x34bd('0x7')]][_0x34bd('0x2c')])){channels[_0x4d0a02['uniqueid']]['callerid']=_0x4d0a02['calleridname']+'\x20<'+_0x4d0a02[_0x34bd('0x1c')]+'>';}utils[_0x34bd('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4d0a02[_0x34bd('0x7')],channels[_0x4d0a02['uniqueid']]['callerid'],_0x4d0a02[_0x34bd('0x2d')]));channels[_0x4d0a02[_0x34bd('0x7')]][_0x34bd('0x2e')]=utils[_0x34bd('0x23')]();channels[_0x4d0a02[_0x34bd('0x7')]]['duration']=utils['diffTime'](channels[_0x4d0a02[_0x34bd('0x7')]]['endtime'],channels[_0x4d0a02[_0x34bd('0x7')]][_0x34bd('0x2f')]);channels[_0x4d0a02[_0x34bd('0x7')]][_0x34bd('0x30')]=channels[_0x4d0a02[_0x34bd('0x7')]]['answertime']?utils[_0x34bd('0x31')](channels[_0x4d0a02[_0x34bd('0x7')]][_0x34bd('0x2e')],channels[_0x4d0a02[_0x34bd('0x7')]]['answertime']):0x0;writeDB(channels[_0x4d0a02[_0x34bd('0x7')]]);}}catch(_0x55e2d4){utils[_0x34bd('0x1d')](util[_0x34bd('0x9')]('[%s][calls][hangup]',_0x4d0a02[_0x34bd('0x7')]),_0x55e2d4);}};exports['attendedtransfer']=function(_0x1bd8d8){try{if(!_[_0x34bd('0x21')](channels[_0x1bd8d8[_0x34bd('0x32')]])){utils[_0x34bd('0x15')](util[_0x34bd('0x9')](_0x34bd('0x33'),_0x1bd8d8[_0x34bd('0x34')]),_0x1bd8d8);if(channels[_0x1bd8d8['localtwolinkedid']]['channel']==_0x1bd8d8['transfereechannel']){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x35'),_0x1bd8d8[_0x34bd('0x34')],_0x1bd8d8['localtwolinkedid'],_0x1bd8d8[_0x34bd('0x36')]));channels[_0x1bd8d8[_0x34bd('0x32')]][_0x34bd('0x26')]=_0x1bd8d8[_0x34bd('0x36')];channels[_0x1bd8d8[_0x34bd('0x32')]]['userfield']=_0x34bd('0x37');}else if(channels[_0x1bd8d8['localtwolinkedid']]['channel']=_0x1bd8d8[_0x34bd('0x38')]){utils['info'](util[_0x34bd('0x9')](_0x34bd('0x35'),_0x1bd8d8[_0x34bd('0x34')],_0x1bd8d8[_0x34bd('0x32')],_0x1bd8d8[_0x34bd('0x39')]));channels[_0x1bd8d8['localtwolinkedid']]['destinationchannel']=_0x1bd8d8[_0x34bd('0x39')];channels[_0x1bd8d8['localtwolinkedid']][_0x34bd('0x3a')]=_0x34bd('0x37');}}}catch(_0x23b29){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x1bd8d8['origtransfereruniqueid']),_0x23b29);}};exports[_0x34bd('0x3b')]=function(_0x510c27){try{if(!_[_0x34bd('0x21')](channels[_0x510c27['uniqueid']])){utils[_0x34bd('0x15')](util[_0x34bd('0x9')](_0x34bd('0x3c'),_0x510c27[_0x34bd('0x7')]),_0x510c27);channels[_0x510c27[_0x34bd('0x7')]]['musiconholdstartAt']=utils[_0x34bd('0x23')]();utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x3d'),_0x510c27[_0x34bd('0x7')],channels[_0x510c27['uniqueid']][_0x34bd('0x3e')]));}}catch(_0x3bfd9d){utils['error'](util[_0x34bd('0x9')](_0x34bd('0x3c'),_0x510c27['uniqueid']),_0x3bfd9d);}};exports['musiconholdstop']=function(_0x37ac16){try{if(!_['isNil'](channels[_0x37ac16['uniqueid']])){utils[_0x34bd('0x15')](util[_0x34bd('0x9')]('[%s][calls][musiconholdstop]',_0x37ac16['uniqueid']),_0x37ac16);if(!_['isNil'](channels[_0x37ac16['uniqueid']][_0x34bd('0x3e')])){channels[_0x37ac16[_0x34bd('0x7')]]['mohtime']+=utils['diffTime'](utils['now'](),channels[_0x37ac16[_0x34bd('0x7')]][_0x34bd('0x3e')]);utils['info'](util[_0x34bd('0x9')](_0x34bd('0x3f'),_0x37ac16[_0x34bd('0x7')],channels[_0x37ac16[_0x34bd('0x7')]][_0x34bd('0x40')]));delete channels[_0x37ac16[_0x34bd('0x7')]]['musiconholdstartAt'];}}}catch(_0x3241e1){utils[_0x34bd('0x1d')](util[_0x34bd('0x9')](_0x34bd('0x41'),_0x37ac16['uniqueid']),_0x3241e1);}};exports[_0x34bd('0x42')]=function(_0x5235e4){try{if(!_[_0x34bd('0x21')](channels[_0x5235e4['uniqueid']])){utils[_0x34bd('0x15')](util[_0x34bd('0x9')](_0x34bd('0x43'),_0x5235e4[_0x34bd('0x7')]),_0x5235e4);if(!_[_0x34bd('0x21')](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x45')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x46'),_0x5235e4[_0x34bd('0x7')],_0x5235e4['value']));channels[_0x5235e4[_0x34bd('0x7')]]['source']=_0x5235e4[_0x34bd('0x47')];}if(!_['isNil'](_0x5235e4[_0x34bd('0x44')]['xmd-phone'])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x48'),_0x5235e4[_0x34bd('0x7')],_0x5235e4[_0x34bd('0x47')]));channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x49')]=_0x5235e4[_0x34bd('0x47')];channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x2c')]='\x22'+_0x5235e4[_0x34bd('0x47')]+_0x34bd('0x4a')+_0x5235e4[_0x34bd('0x47')]+'>';}if(!_[_0x34bd('0x21')](_0x5235e4[_0x34bd('0x44')]['xmd-callerid-preview'])||!_['isNil'](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x4b')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x4c'),_0x5235e4['uniqueid'],!_['isNil'](_0x5235e4['variable']['xmd-callerid-preview'])?_0x34bd('0x4d'):_0x34bd('0x4b'),_0x5235e4['value']));channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x2c')]=_0x5235e4[_0x34bd('0x47')];}if(!_['isNil'](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x4e')])||!_[_0x34bd('0x21')](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x4f')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x4c'),_0x5235e4['uniqueid'],!_['isNil'](_0x5235e4[_0x34bd('0x44')]['xmd-queue'])?_0x34bd('0x4e'):_0x34bd('0x4f'),_0x5235e4[_0x34bd('0x47')]));channels[_0x5235e4['uniqueid']]['lastapplication']=_0x34bd('0x50');channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x51')]=_0x5235e4['value'];channels[_0x5235e4['uniqueid']][_0x34bd('0x52')]=!![];}if(!_[_0x34bd('0x21')](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x53')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x54'),_0x5235e4[_0x34bd('0x7')],_0x5235e4[_0x34bd('0x47')]));channels[_0x5235e4['uniqueid']]['ContactId']=_0x5235e4[_0x34bd('0x47')];}if(!_['isNil'](_0x5235e4[_0x34bd('0x44')][_0x34bd('0x55')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5235e4['uniqueid'],_0x5235e4[_0x34bd('0x47')]));channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x56')]=_0x5235e4['value'];}if(!_[_0x34bd('0x21')](_0x5235e4['variable'][_0x34bd('0x57')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5235e4[_0x34bd('0x7')],_0x5235e4['value']));channels[_0x5235e4['uniqueid']][_0x34bd('0x58')]=_0x5235e4[_0x34bd('0x47')];}if(!_[_0x34bd('0x21')](_0x5235e4['variable'][_0x34bd('0x59')])){utils[_0x34bd('0x8')](util[_0x34bd('0x9')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5235e4[_0x34bd('0x7')],_0x5235e4[_0x34bd('0x47')]));channels[_0x5235e4[_0x34bd('0x7')]][_0x34bd('0x59')]=_0x5235e4[_0x34bd('0x47')];}}}catch(_0xbb9b5d){utils[_0x34bd('0x1d')](util[_0x34bd('0x9')](_0x34bd('0x43'),_0x5235e4[_0x34bd('0x7')]),_0xbb9b5d);}};exports[_0x34bd('0x5a')]=function(_0x59e377){try{if(!_[_0x34bd('0x21')](channels[_0x59e377['uniqueid']])){utils[_0x34bd('0x15')](util['format'](_0x34bd('0x5b'),_0x59e377[_0x34bd('0x7')]),_0x59e377);utils[_0x34bd('0x8')](util[_0x34bd('0x9')](_0x34bd('0x5c'),_0x59e377[_0x34bd('0x7')],_0x59e377[_0x34bd('0x5d')],_0x59e377[_0x34bd('0x5e')]));if(_0x59e377[_0x34bd('0x5d')][_0x34bd('0x5f')]()=='set'&&_['startsWith'](_0x59e377[_0x34bd('0x5e')][_0x34bd('0x5f')](),_0x34bd('0x60'))){var _0x5b60b4=_0x59e377['appdata']['split']('=');var _0x278e21=_0x5b60b4[0x0][_0x34bd('0x61')](_0x5b60b4[0x0][_0x34bd('0x62')]('(')+0x1,_0x5b60b4[0x0][_0x34bd('0x62')](')'));var _0x7fef8b=_0x5b60b4[0x1];channels[_0x59e377['uniqueid']][_0x278e21]=_0x7fef8b;}if(!_[_0x34bd('0x63')](['hangup',_0x34bd('0x64'),_0x34bd('0x65'),'set',_0x34bd('0x66')],_0x59e377['application'][_0x34bd('0x5f')]())){channels[_0x59e377['uniqueid']][_0x34bd('0x67')]=_0x59e377['application'];channels[_0x59e377[_0x34bd('0x7')]][_0x34bd('0x51')]=_0x59e377[_0x34bd('0x5e')];}}}catch(_0x35d257){utils[_0x34bd('0x1d')](util[_0x34bd('0x9')](_0x34bd('0x5b'),_0x59e377[_0x34bd('0x7')]),_0x35d257);}}; \ No newline at end of file +var _0xfc4f=['origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','execif','gotoif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','systemanswertime','now','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfc4f,0x192));var _0xffc4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfc4f[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xffc4('0x0'));var utils=require(_0xffc4('0x1'));var transfers=require(_0xffc4('0x2'));var dispositions=[_0xffc4('0x3'),_0xffc4('0x4'),_0xffc4('0x4'),_0xffc4('0x3'),'NO\x20ANSWER',_0xffc4('0x3'),_0xffc4('0x5'),_0xffc4('0x6'),_0xffc4('0x4'),'FAILED',_0xffc4('0x4')];var channels={};function writeDB(_0x261d03){var _0x4c69e0;if(transfers[_0xffc4('0x7')][_0x261d03[_0xffc4('0x8')]]){_0x4c69e0=_0x261d03[_0xffc4('0x8')];_0x261d03[_0xffc4('0x8')]=transfers['blinds'][_0x261d03[_0xffc4('0x8')]][_0xffc4('0x9')];}utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0xc'),_0x261d03[_0xffc4('0x8')],_0x261d03['channel'],_0x261d03[_0xffc4('0xd')],_0x261d03[_0xffc4('0xe')],_0x261d03[_0xffc4('0xf')],_0x261d03[_0xffc4('0x10')],_0x261d03[_0xffc4('0x11')],_0x261d03[_0xffc4('0x12')]));if(_0x261d03[_0xffc4('0x13')]){utils['getUserByInternal'](_0x261d03[_0xffc4('0x13')])[_0xffc4('0x14')](function(_0x5155ab){if(_0x5155ab){_0x261d03[_0xffc4('0x15')]=_0x5155ab['id'];}utils[_0xffc4('0x16')]('CreateVoiceCallReport',_0x261d03);});}else{utils[_0xffc4('0x16')](_0xffc4('0x17'),_0x261d03);}if(channels[_0x261d03[_0xffc4('0x8')]]){delete channels[_0x261d03[_0xffc4('0x8')]];}else if(_0x4c69e0&&channels[_0x4c69e0]){if(!transfers['blinds'][_0x4c69e0][_0xffc4('0x18')])delete transfers[_0xffc4('0x7')][_0x4c69e0];delete channels[_0x4c69e0];}}exports[_0xffc4('0x19')]=function(_0x937baa){try{utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x1b'),_0x937baa[_0xffc4('0x8')]),_0x937baa);if(_0x937baa[_0xffc4('0x8')]==_0x937baa[_0xffc4('0x1c')]&&_0x937baa['channel']!=_0xffc4('0x1d')){utils['info'](util['format'](_0xffc4('0x1e'),_0x937baa[_0xffc4('0x8')],_0x937baa[_0xffc4('0x1f')],_0x937baa['exten']));channels[_0x937baa[_0xffc4('0x8')]]={'uniqueid':_0x937baa[_0xffc4('0x8')],'accountcode':_0x937baa[_0xffc4('0x13')],'source':_0x937baa[_0xffc4('0x10')],'destination':_0x937baa[_0xffc4('0x20')],'destinationcontext':_0x937baa[_0xffc4('0x1f')],'channel':_0x937baa[_0xffc4('0x21')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xffc4('0x3'),'amaflags':_0xffc4('0x22')};}}catch(_0x2a705e){utils[_0xffc4('0x23')](util['format']('[%s][calls][newchannel]',_0x937baa[_0xffc4('0x8')]),_0x2a705e);}};exports[_0xffc4('0x24')]=function(_0x516c5b){try{utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x25'),_0x516c5b['uniqueid']),_0x516c5b);if(!_[_0xffc4('0x26')](channels[_0x516c5b['uniqueid']])&&_0x516c5b['channelstate']==0x6){utils[_0xffc4('0xa')](util[_0xffc4('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x516c5b[_0xffc4('0x8')],_0x516c5b[_0xffc4('0x1f')],_0x516c5b[_0xffc4('0x21')]));if(_[_0xffc4('0x26')](channels[_0x516c5b[_0xffc4('0x8')]][_0xffc4('0x27')])){channels[_0x516c5b[_0xffc4('0x8')]]['systemanswertime']=utils[_0xffc4('0x28')]();}}else if(!_[_0xffc4('0x26')](channels[_0x516c5b[_0xffc4('0x1c')]])&&_0x516c5b[_0xffc4('0x29')]==0x6&&_0x516c5b[_0xffc4('0x1f')]!=_0xffc4('0x2a')){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x2b'),_0x516c5b[_0xffc4('0x8')],_0x516c5b[_0xffc4('0x1c')],_0x516c5b['context'],_0x516c5b[_0xffc4('0x21')]));channels[_0x516c5b[_0xffc4('0x1c')]][_0xffc4('0x13')]=_0x516c5b[_0xffc4('0x13')];channels[_0x516c5b[_0xffc4('0x1c')]][_0xffc4('0x2c')]=_0x516c5b['channel'];if(_[_0xffc4('0x26')](channels[_0x516c5b[_0xffc4('0x1c')]][_0xffc4('0x2d')])){channels[_0x516c5b[_0xffc4('0x1c')]][_0xffc4('0x2d')]=utils[_0xffc4('0x28')]();}channels[_0x516c5b['linkedid']][_0xffc4('0x2e')]=dispositions[_['toNumber'](_0x516c5b['channelstate'])]||_0xffc4('0x5');}}catch(_0x127ad4){utils[_0xffc4('0x23')](util[_0xffc4('0xb')]('[%s][calls][newstate]',_0x516c5b[_0xffc4('0x8')]),_0x127ad4);}};exports['hangup']=function(_0x41986e){try{if(!_[_0xffc4('0x26')](channels[_0x41986e['uniqueid']])){utils['debug'](util[_0xffc4('0xb')](_0xffc4('0x2f'),_0x41986e[_0xffc4('0x8')]),_0x41986e);if(_[_0xffc4('0x26')](channels[_0x41986e['uniqueid']][_0xffc4('0x30')])){channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x30')]=_0x41986e[_0xffc4('0x31')]+'\x20<'+_0x41986e['calleridnum']+'>';}utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x32'),_0x41986e[_0xffc4('0x8')],channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x30')],_0x41986e[_0xffc4('0x33')]));channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x34')]=utils[_0xffc4('0x28')]();channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x35')]=utils[_0xffc4('0x36')](channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x34')],channels[_0x41986e[_0xffc4('0x8')]]['starttime']);channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x37')]=channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x2d')]?utils[_0xffc4('0x36')](channels[_0x41986e[_0xffc4('0x8')]][_0xffc4('0x34')],channels[_0x41986e[_0xffc4('0x8')]]['answertime']):0x0;writeDB(channels[_0x41986e[_0xffc4('0x8')]]);}}catch(_0x58e0e8){utils[_0xffc4('0x23')](util[_0xffc4('0xb')](_0xffc4('0x2f'),_0x41986e[_0xffc4('0x8')]),_0x58e0e8);}};exports[_0xffc4('0x38')]=function(_0x4ce2e7){try{if(!_[_0xffc4('0x26')](channels[_0x4ce2e7['localtwolinkedid']])){utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x39'),_0x4ce2e7[_0xffc4('0x3a')]),_0x4ce2e7);if(channels[_0x4ce2e7[_0xffc4('0x3b')]][_0xffc4('0x21')]==_0x4ce2e7[_0xffc4('0x3c')]){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x3d'),_0x4ce2e7['origtransfereruniqueid'],_0x4ce2e7[_0xffc4('0x3b')],_0x4ce2e7[_0xffc4('0x3e')]));channels[_0x4ce2e7['localtwolinkedid']][_0xffc4('0x2c')]=_0x4ce2e7[_0xffc4('0x3e')];channels[_0x4ce2e7[_0xffc4('0x3b')]][_0xffc4('0x3f')]=_0xffc4('0x40');}else if(channels[_0x4ce2e7[_0xffc4('0x3b')]][_0xffc4('0x21')]=_0x4ce2e7[_0xffc4('0x41')]){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x3d'),_0x4ce2e7[_0xffc4('0x3a')],_0x4ce2e7[_0xffc4('0x3b')],_0x4ce2e7[_0xffc4('0x42')]));channels[_0x4ce2e7[_0xffc4('0x3b')]]['destinationchannel']=_0x4ce2e7[_0xffc4('0x42')];channels[_0x4ce2e7['localtwolinkedid']]['userfield']=_0xffc4('0x40');}}}catch(_0x53f8d2){utils[_0xffc4('0x23')](util[_0xffc4('0xb')](_0xffc4('0x39'),_0x4ce2e7[_0xffc4('0x3a')]),_0x53f8d2);}};exports['musiconholdstart']=function(_0xf7c067){try{if(!_[_0xffc4('0x26')](channels[_0xf7c067['uniqueid']])){utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x43'),_0xf7c067['uniqueid']),_0xf7c067);channels[_0xf7c067[_0xffc4('0x8')]][_0xffc4('0x44')]=utils[_0xffc4('0x28')]();utils[_0xffc4('0xa')](util[_0xffc4('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0xf7c067[_0xffc4('0x8')],channels[_0xf7c067[_0xffc4('0x8')]][_0xffc4('0x44')]));}}catch(_0x5d8524){utils[_0xffc4('0x23')](util[_0xffc4('0xb')]('[%s][calls][musiconholdstart]',_0xf7c067[_0xffc4('0x8')]),_0x5d8524);}};exports[_0xffc4('0x45')]=function(_0x47938b){try{if(!_[_0xffc4('0x26')](channels[_0x47938b['uniqueid']])){utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x46'),_0x47938b[_0xffc4('0x8')]),_0x47938b);if(!_[_0xffc4('0x26')](channels[_0x47938b[_0xffc4('0x8')]]['musiconholdstartAt'])){channels[_0x47938b['uniqueid']][_0xffc4('0x47')]+=utils['diffTime'](utils[_0xffc4('0x28')](),channels[_0x47938b[_0xffc4('0x8')]][_0xffc4('0x44')]);utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x48'),_0x47938b[_0xffc4('0x8')],channels[_0x47938b['uniqueid']][_0xffc4('0x47')]));delete channels[_0x47938b[_0xffc4('0x8')]][_0xffc4('0x44')];}}}catch(_0x37c7f3){utils[_0xffc4('0x23')](util['format'](_0xffc4('0x46'),_0x47938b['uniqueid']),_0x37c7f3);}};exports['varset']=function(_0x160bba){try{if(!_[_0xffc4('0x26')](channels[_0x160bba[_0xffc4('0x8')]])){utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x49'),_0x160bba[_0xffc4('0x8')]),_0x160bba);if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x4b')])){utils['info'](util[_0xffc4('0xb')](_0xffc4('0x4c'),_0x160bba[_0xffc4('0x8')],_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0x4e')]=_0x160bba[_0xffc4('0x4d')];}if(!_[_0xffc4('0x26')](_0x160bba['variable']['xmd-phone'])){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x4f'),_0x160bba['uniqueid'],_0x160bba['value']));channels[_0x160bba['uniqueid']][_0xffc4('0x50')]=_0x160bba[_0xffc4('0x4d')];channels[_0x160bba['uniqueid']]['callerid']='\x22'+_0x160bba[_0xffc4('0x4d')]+_0xffc4('0x51')+_0x160bba[_0xffc4('0x4d')]+'>';}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x52')])||!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x53')])){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x54'),_0x160bba['uniqueid'],!_[_0xffc4('0x26')](_0x160bba['variable'][_0xffc4('0x52')])?'xmd-callerid-preview':'xmd-callerid',_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]]['callerid']=_0x160bba[_0xffc4('0x4d')];}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x55')])||!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x56')])){utils['info'](util['format'](_0xffc4('0x54'),_0x160bba[_0xffc4('0x8')],!_['isNil'](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x55')])?_0xffc4('0x55'):_0xffc4('0x56'),_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0x57')]=_0xffc4('0x58');channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0x59')]=_0x160bba[_0xffc4('0x4d')];channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0xd')]=!![];}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x5a')])){utils['info'](util[_0xffc4('0xb')](_0xffc4('0x5b'),_0x160bba[_0xffc4('0x8')],_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]]['ContactId']=_0x160bba[_0xffc4('0x4d')];}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x5c')])){utils[_0xffc4('0xa')](util[_0xffc4('0xb')](_0xffc4('0x5d'),_0x160bba[_0xffc4('0x8')],_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0x5e')]=_0x160bba['value'];}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x5f')])){utils[_0xffc4('0xa')](util['format'](_0xffc4('0x60'),_0x160bba[_0xffc4('0x8')],_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba['uniqueid']][_0xffc4('0x61')]=_0x160bba[_0xffc4('0x4d')];}if(!_[_0xffc4('0x26')](_0x160bba[_0xffc4('0x4a')][_0xffc4('0x62')])){utils[_0xffc4('0xa')](util[_0xffc4('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x160bba['uniqueid'],_0x160bba[_0xffc4('0x4d')]));channels[_0x160bba[_0xffc4('0x8')]][_0xffc4('0x62')]=_0x160bba[_0xffc4('0x4d')];}}}catch(_0x3b91a6){utils[_0xffc4('0x23')](util[_0xffc4('0xb')](_0xffc4('0x49'),_0x160bba[_0xffc4('0x8')]),_0x3b91a6);}};exports[_0xffc4('0x63')]=function(_0x2ca489){try{if(!_[_0xffc4('0x26')](channels[_0x2ca489[_0xffc4('0x8')]])){utils[_0xffc4('0x1a')](util[_0xffc4('0xb')](_0xffc4('0x64'),_0x2ca489[_0xffc4('0x8')]),_0x2ca489);utils['info'](util[_0xffc4('0xb')](_0xffc4('0x65'),_0x2ca489[_0xffc4('0x8')],_0x2ca489['application'],_0x2ca489[_0xffc4('0x66')]));if(_0x2ca489[_0xffc4('0x67')][_0xffc4('0x68')]()==_0xffc4('0x69')&&_[_0xffc4('0x6a')](_0x2ca489[_0xffc4('0x66')]['toLowerCase'](),_0xffc4('0x6b'))){var _0x2ac107=_0x2ca489[_0xffc4('0x66')][_0xffc4('0x6c')]('=');var _0x49e258=_0x2ac107[0x0][_0xffc4('0x6d')](_0x2ac107[0x0][_0xffc4('0x6e')]('(')+0x1,_0x2ac107[0x0][_0xffc4('0x6e')](')'));var _0x32050a=_0x2ac107[0x1];channels[_0x2ca489[_0xffc4('0x8')]][_0x49e258]=_0x32050a;}if(!_[_0xffc4('0x6f')]([_0xffc4('0x70'),'noop',_0xffc4('0x71'),_0xffc4('0x69'),_0xffc4('0x72')],_0x2ca489[_0xffc4('0x67')][_0xffc4('0x68')]())){channels[_0x2ca489['uniqueid']][_0xffc4('0x57')]=_0x2ca489[_0xffc4('0x67')];channels[_0x2ca489[_0xffc4('0x8')]][_0xffc4('0x59')]=_0x2ca489[_0xffc4('0x66')];}}}catch(_0x23492b){utils['error'](util[_0xffc4('0xb')](_0xffc4('0x64'),_0x2ca489['uniqueid']),_0x23492b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index adcc3b6..413a55b 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 _0xfad1=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xfad1,0xce));var _0x1fad=function(_0x3ab3e3,_0x5825d8){_0x3ab3e3=_0x3ab3e3-0x0;var _0x247e3d=_0xfad1[_0x3ab3e3];return _0x247e3d;};'use strict';var utils=require(_0x1fad('0x0'));exports[_0x1fad('0x1')]=function(){utils[_0x1fad('0x2')](_0x1fad('0x3'));};exports[_0x1fad('0x4')]=function(){utils[_0x1fad('0x2')](_0x1fad('0x5'));};exports[_0x1fad('0x6')]=function(){utils[_0x1fad('0x2')]('[core]\x20fullybooted');};exports[_0x1fad('0x7')]=function(_0x4c2b5d){utils[_0x1fad('0x7')](_0x1fad('0x8'),_0x4c2b5d);};exports[_0x1fad('0x9')]=function(){utils[_0x1fad('0x2')](_0x1fad('0xa'));};exports[_0x1fad('0xb')]=function(_0x22f859){}; \ No newline at end of file +var _0xf61a=['[core]\x20fullybooted','error','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown'];(function(_0x3057f2,_0x25b5a4){var _0x36d418=function(_0x10003d){while(--_0x10003d){_0x3057f2['push'](_0x3057f2['shift']());}};_0x36d418(++_0x25b5a4);}(_0xf61a,0xe3));var _0xaf61=function(_0x77fdb1,_0x164603){_0x77fdb1=_0x77fdb1-0x0;var _0x40ac0d=_0xf61a[_0x77fdb1];return _0x40ac0d;};'use strict';var utils=require('./utils');exports[_0xaf61('0x0')]=function(){utils[_0xaf61('0x1')](_0xaf61('0x2'));};exports['shutdown']=function(){utils['info'](_0xaf61('0x3'));};exports['fullybooted']=function(){utils[_0xaf61('0x1')](_0xaf61('0x4'));};exports[_0xaf61('0x5')]=function(_0x14572c){utils[_0xaf61('0x5')]('[core]\x20error',_0x14572c);};exports['close']=function(){utils[_0xaf61('0x1')]('[core]\x20close');};exports[_0xaf61('0x6')]=function(_0x29dbad){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d212bcc..f93c2c5 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 _0x579c=['[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','error','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','dialend'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x579c,0x109));var _0xc579=function(_0x210729,_0x48136d){_0x210729=_0x210729-0x0;var _0x7687ee=_0x579c[_0x210729];return _0x7687ee;};'use strict';var _=require('lodash');var util=require(_0xc579('0x0'));var utils=require(_0xc579('0x1'));var dials={};function writeDB(_0x3cba05){utils[_0xc579('0x2')](util['format'](_0xc579('0x3'),_0x3cba05[_0xc579('0x4')],_0x3cba05['channel'],_0x3cba05[_0xc579('0x5')],_0x3cba05[_0xc579('0x6')],_0x3cba05[_0xc579('0x7')],_0x3cba05['dialstatus']));utils[_0xc579('0x8')](_0xc579('0x9'),_0x3cba05);delete dials[_0x3cba05['uniqueid']];}exports[_0xc579('0xa')]=function(_0x501dcf){try{utils['debug'](util[_0xc579('0xb')](_0xc579('0xc'),_0x501dcf[_0xc579('0x4')]),_0x501dcf);utils['info'](util[_0xc579('0xb')](_0xc579('0xd'),_0x501dcf[_0xc579('0x4')],_0x501dcf[_0xc579('0xe')],_0x501dcf[_0xc579('0xf')]));if(_0x501dcf[_0xc579('0xe')]['toLowerCase']()==_0xc579('0x10')&&_[_0xc579('0x11')](_0x501dcf['appdata']['toLowerCase'](),_0xc579('0x12'))){var _0x5e28a5=_0x501dcf[_0xc579('0xf')]['split']('=');dials[_0x501dcf[_0xc579('0x4')]]={'routeId':_0x5e28a5[0x1]};}}catch(_0x5f5dae){utils[_0xc579('0x13')](util[_0xc579('0xb')](_0xc579('0xc'),_0x501dcf[_0xc579('0x4')]),_0x5f5dae);}};exports[_0xc579('0x14')]=function(_0x24e095){try{utils[_0xc579('0x15')](util[_0xc579('0xb')](_0xc579('0x16'),_0x24e095[_0xc579('0x4')]),_0x24e095);if(!_[_0xc579('0x17')](_0x24e095[_0xc579('0x18')][_0xc579('0x19')])){utils[_0xc579('0x2')](util['format'](_0xc579('0x1a'),_0x24e095[_0xc579('0x4')],_0x24e095[_0xc579('0x1b')]));dials[_0x24e095['uniqueid']]={'routeId':_0x24e095[_0xc579('0x1b')]};}}catch(_0x4a1e3f){utils[_0xc579('0x13')](util[_0xc579('0xb')]('[%s][dials][varset]',_0x24e095[_0xc579('0x4')]),_0x4a1e3f);}};exports[_0xc579('0x1c')]=function(_0x28cb70){try{if(!_[_0xc579('0x17')](dials[_0x28cb70[_0xc579('0x4')]])){utils[_0xc579('0x15')](util[_0xc579('0xb')](_0xc579('0x1d'),_0x28cb70[_0xc579('0x4')]),_0x28cb70);dials[_0x28cb70[_0xc579('0x4')]]=_[_0xc579('0x1e')](dials[_0x28cb70['uniqueid']],_0x28cb70);dials[_0x28cb70['uniqueid']][_0xc579('0x1f')]=utils['now']();dials[_0x28cb70['uniqueid']][_0xc579('0x20')]=_0xc579('0x21');utils[_0xc579('0x2')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x28cb70[_0xc579('0x4')],dials[_0x28cb70[_0xc579('0x4')]][_0xc579('0x1f')]));}}catch(_0x295147){utils['error'](util[_0xc579('0xb')](_0xc579('0x1d'),_0x28cb70[_0xc579('0x4')]),_0x295147);}};exports[_0xc579('0x22')]=function(_0x509933){try{if(!_[_0xc579('0x17')](dials[_0x509933[_0xc579('0x4')]])){utils[_0xc579('0x15')](util[_0xc579('0xb')](_0xc579('0x23'),_0x509933[_0xc579('0x4')]),_0x509933);dials[_0x509933['uniqueid']][_0xc579('0x24')]=_0x509933['dialstatus'];if(_0x509933[_0xc579('0x24')]==_0xc579('0x25')){dials[_0x509933[_0xc579('0x4')]]=_['assign'](dials[_0x509933[_0xc579('0x4')]],_0x509933);dials[_0x509933['uniqueid']][_0xc579('0x26')]=utils[_0xc579('0x27')]();dials[_0x509933[_0xc579('0x4')]][_0xc579('0x20')]=_0xc579('0x28');utils['info'](util[_0xc579('0xb')](_0xc579('0x29'),_0x509933['uniqueid'],_0x509933[_0xc579('0x24')],dials[_0x509933[_0xc579('0x4')]][_0xc579('0x26')]));}else{utils['info'](util[_0xc579('0xb')]('[%s][dials][dialend]\x20dialstatus:%s',_0x509933[_0xc579('0x4')],_0x509933['dialstatus']));}}}catch(_0x1591b7){utils['error'](util[_0xc579('0xb')]('[%s][dials][dialend]',_0x509933[_0xc579('0x4')]),_0x1591b7);}};exports['hangup']=function(_0x2473c2){try{if(!_[_0xc579('0x17')](dials[_0x2473c2[_0xc579('0x4')]])){utils['debug'](util['format'](_0xc579('0x2a'),_0x2473c2[_0xc579('0x4')]),_0x2473c2);utils[_0xc579('0x2')](util['format'](_0xc579('0x2b'),_0x2473c2['uniqueid'],_0x2473c2['calleridnum'],_0x2473c2[_0xc579('0x2c')],_0x2473c2[_0xc579('0x2d')]));dials[_0x2473c2[_0xc579('0x4')]]=_[_0xc579('0x1e')](dials[_0x2473c2[_0xc579('0x4')]],{'endtime':utils[_0xc579('0x27')](),'lastevent':_0xc579('0x2e')});dials[_0x2473c2[_0xc579('0x4')]][_0xc579('0x2f')]=utils[_0xc579('0x30')](dials[_0x2473c2[_0xc579('0x4')]]['endtime'],dials[_0x2473c2['uniqueid']][_0xc579('0x1f')]);dials[_0x2473c2['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x2473c2[_0xc579('0x4')]][_0xc579('0x26')]||dials[_0x2473c2[_0xc579('0x4')]][_0xc579('0x31')],dials[_0x2473c2['uniqueid']][_0xc579('0x1f')]);dials[_0x2473c2[_0xc579('0x4')]]['billableseconds']=dials[_0x2473c2[_0xc579('0x4')]][_0xc579('0x26')]?utils[_0xc579('0x30')](dials[_0x2473c2['uniqueid']]['endtime'],dials[_0x2473c2[_0xc579('0x4')]]['answertime']):0x0;writeDB(dials[_0x2473c2[_0xc579('0x4')]]);}}catch(_0x495c2a){utils[_0xc579('0x13')](util['format'](_0xc579('0x2a'),_0x2473c2['uniqueid']),_0x495c2a);}}; \ No newline at end of file +var _0xf9e0=['uniqueid','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','dialstatus','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','diffTime','endtime','holdtime','billableseconds','lodash','format','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]'];(function(_0x2ea818,_0xb728e7){var _0x5613bc=function(_0xfaead7){while(--_0xfaead7){_0x2ea818['push'](_0x2ea818['shift']());}};_0x5613bc(++_0xb728e7);}(_0xf9e0,0x128));var _0x0f9e=function(_0x59b046,_0x5261f8){_0x59b046=_0x59b046-0x0;var _0x10b72c=_0xf9e0[_0x59b046];return _0x10b72c;};'use strict';var _=require(_0x0f9e('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xc506cd){utils['info'](util[_0x0f9e('0x1')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0xc506cd['uniqueid'],_0xc506cd[_0x0f9e('0x2')],_0xc506cd[_0x0f9e('0x3')],_0xc506cd[_0x0f9e('0x4')],_0xc506cd[_0x0f9e('0x5')],_0xc506cd['dialstatus']));utils[_0x0f9e('0x6')](_0x0f9e('0x7'),_0xc506cd);delete dials[_0xc506cd['uniqueid']];}exports['newexten']=function(_0x49dc0c){try{utils[_0x0f9e('0x8')](util['format'](_0x0f9e('0x9'),_0x49dc0c['uniqueid']),_0x49dc0c);utils['info'](util[_0x0f9e('0x1')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x49dc0c[_0x0f9e('0xa')],_0x49dc0c[_0x0f9e('0xb')],_0x49dc0c[_0x0f9e('0xc')]));if(_0x49dc0c[_0x0f9e('0xb')][_0x0f9e('0xd')]()==_0x0f9e('0xe')&&_[_0x0f9e('0xf')](_0x49dc0c[_0x0f9e('0xc')][_0x0f9e('0xd')](),_0x0f9e('0x10'))){var _0x59b1aa=_0x49dc0c['appdata'][_0x0f9e('0x11')]('=');dials[_0x49dc0c['uniqueid']]={'routeId':_0x59b1aa[0x1]};}}catch(_0x4c1303){utils[_0x0f9e('0x12')](util[_0x0f9e('0x1')](_0x0f9e('0x9'),_0x49dc0c[_0x0f9e('0xa')]),_0x4c1303);}};exports[_0x0f9e('0x13')]=function(_0x2bbd9d){try{utils['debug'](util[_0x0f9e('0x1')]('[%s][dials][varset]',_0x2bbd9d[_0x0f9e('0xa')]),_0x2bbd9d);if(!_[_0x0f9e('0x14')](_0x2bbd9d[_0x0f9e('0x15')][_0x0f9e('0x16')])){utils[_0x0f9e('0x17')](util[_0x0f9e('0x1')](_0x0f9e('0x18'),_0x2bbd9d[_0x0f9e('0xa')],_0x2bbd9d[_0x0f9e('0x19')]));dials[_0x2bbd9d[_0x0f9e('0xa')]]={'routeId':_0x2bbd9d[_0x0f9e('0x19')]};}}catch(_0x461478){utils[_0x0f9e('0x12')](util[_0x0f9e('0x1')](_0x0f9e('0x1a'),_0x2bbd9d[_0x0f9e('0xa')]),_0x461478);}};exports[_0x0f9e('0x1b')]=function(_0x27e9cc){try{if(!_[_0x0f9e('0x14')](dials[_0x27e9cc[_0x0f9e('0xa')]])){utils[_0x0f9e('0x8')](util['format'](_0x0f9e('0x1c'),_0x27e9cc[_0x0f9e('0xa')]),_0x27e9cc);dials[_0x27e9cc[_0x0f9e('0xa')]]=_[_0x0f9e('0x1d')](dials[_0x27e9cc[_0x0f9e('0xa')]],_0x27e9cc);dials[_0x27e9cc[_0x0f9e('0xa')]]['starttime']=utils[_0x0f9e('0x1e')]();dials[_0x27e9cc[_0x0f9e('0xa')]][_0x0f9e('0x1f')]=_0x0f9e('0x20');utils[_0x0f9e('0x17')](util[_0x0f9e('0x1')](_0x0f9e('0x21'),_0x27e9cc[_0x0f9e('0xa')],dials[_0x27e9cc[_0x0f9e('0xa')]][_0x0f9e('0x22')]));}}catch(_0x5c1cea){utils[_0x0f9e('0x12')](util[_0x0f9e('0x1')](_0x0f9e('0x1c'),_0x27e9cc[_0x0f9e('0xa')]),_0x5c1cea);}};exports[_0x0f9e('0x23')]=function(_0x5f4b60){try{if(!_['isNil'](dials[_0x5f4b60[_0x0f9e('0xa')]])){utils[_0x0f9e('0x8')](util[_0x0f9e('0x1')](_0x0f9e('0x24'),_0x5f4b60['uniqueid']),_0x5f4b60);dials[_0x5f4b60[_0x0f9e('0xa')]]['dialstatus']=_0x5f4b60['dialstatus'];if(_0x5f4b60['dialstatus']==_0x0f9e('0x25')){dials[_0x5f4b60[_0x0f9e('0xa')]]=_[_0x0f9e('0x1d')](dials[_0x5f4b60[_0x0f9e('0xa')]],_0x5f4b60);dials[_0x5f4b60['uniqueid']][_0x0f9e('0x26')]=utils[_0x0f9e('0x1e')]();dials[_0x5f4b60[_0x0f9e('0xa')]][_0x0f9e('0x1f')]=_0x0f9e('0x27');utils[_0x0f9e('0x17')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x5f4b60[_0x0f9e('0xa')],_0x5f4b60[_0x0f9e('0x28')],dials[_0x5f4b60['uniqueid']]['answertime']));}else{utils[_0x0f9e('0x17')](util[_0x0f9e('0x1')](_0x0f9e('0x29'),_0x5f4b60['uniqueid'],_0x5f4b60[_0x0f9e('0x28')]));}}}catch(_0x9350fe){utils[_0x0f9e('0x12')](util[_0x0f9e('0x1')](_0x0f9e('0x24'),_0x5f4b60[_0x0f9e('0xa')]),_0x9350fe);}};exports[_0x0f9e('0x2a')]=function(_0x19a825){try{if(!_['isNil'](dials[_0x19a825[_0x0f9e('0xa')]])){utils[_0x0f9e('0x8')](util[_0x0f9e('0x1')](_0x0f9e('0x2b'),_0x19a825[_0x0f9e('0xa')]),_0x19a825);utils[_0x0f9e('0x17')](util[_0x0f9e('0x1')](_0x0f9e('0x2c'),_0x19a825[_0x0f9e('0xa')],_0x19a825['calleridnum'],_0x19a825[_0x0f9e('0x2d')],_0x19a825['cause-txt']));dials[_0x19a825[_0x0f9e('0xa')]]=_[_0x0f9e('0x1d')](dials[_0x19a825[_0x0f9e('0xa')]],{'endtime':utils[_0x0f9e('0x1e')](),'lastevent':_0x0f9e('0x2e')});dials[_0x19a825[_0x0f9e('0xa')]]['duration']=utils[_0x0f9e('0x2f')](dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x30')],dials[_0x19a825['uniqueid']][_0x0f9e('0x22')]);dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x31')]=utils[_0x0f9e('0x2f')](dials[_0x19a825[_0x0f9e('0xa')]]['answertime']||dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x30')],dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x22')]);dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x32')]=dials[_0x19a825['uniqueid']][_0x0f9e('0x26')]?utils[_0x0f9e('0x2f')](dials[_0x19a825[_0x0f9e('0xa')]][_0x0f9e('0x30')],dials[_0x19a825['uniqueid']][_0x0f9e('0x26')]):0x0;writeDB(dials[_0x19a825[_0x0f9e('0xa')]]);}}catch(_0x337071){utils[_0x0f9e('0x12')](util[_0x0f9e('0x1')]('[%s][dials][hangup]',_0x19a825[_0x0f9e('0xa')]),_0x337071);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 26ac8b4..12ed12c 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 _0xd2b1=['dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','port','asterisk','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]'];(function(_0x480ab1,_0x5b37ae){var _0x354609=function(_0x343c3c){while(--_0x343c3c){_0x480ab1['push'](_0x480ab1['shift']());}};_0x354609(++_0x5b37ae);}(_0xd2b1,0x1b2));var _0x1d2b=function(_0x2beb09,_0x466fff){_0x2beb09=_0x2beb09-0x0;var _0x13d67=_0xd2b1[_0x2beb09];return _0x13d67;};var AsteriskManager=require(_0x1d2b('0x0'));var config=require('../../config/environment');var utils=require(_0x1d2b('0x1'));var util=require(_0x1d2b('0x2'));var isXDREnabled=config[_0x1d2b('0x3')]&&config[_0x1d2b('0x3')][_0x1d2b('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x1d2b('0x5')]===_0x1d2b('0x6')||![];var isLocalAsterisk=config[_0x1d2b('0x3')]&&config[_0x1d2b('0x3')][_0x1d2b('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x1d2b('0x8')],config[_0x1d2b('0x9')]['ip'],config['asterisk']['username'],config[_0x1d2b('0x9')][_0x1d2b('0xa')],!![]);ami[_0x1d2b('0xb')]();if(!isXDREnabled){utils[_0x1d2b('0xc')](_0x1d2b('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1d2b('0xc')](_0x1d2b('0xe'));}else{var agents=require(_0x1d2b('0xf'));var calls=require(_0x1d2b('0x10'));var queues=require(_0x1d2b('0x11'));var recordings=require(_0x1d2b('0x12'));var members=require('./members.controller');var dials=require(_0x1d2b('0x13'));var transfers=require(_0x1d2b('0x14'));var core=require(_0x1d2b('0x15'));ami['on'](_0x1d2b('0x16'),core[_0x1d2b('0x16')]);ami['on']('shutdown',core[_0x1d2b('0x17')]);ami['on'](_0x1d2b('0x18'),core['fullybooted']);ami['on'](_0x1d2b('0x19'),core[_0x1d2b('0x19')]);ami['on'](_0x1d2b('0x1a'),core[_0x1d2b('0x1a')]);ami['on'](_0x1d2b('0x1b'),core[_0x1d2b('0x1b')]);ami['on'](_0x1d2b('0x1c'),function(_0x35fa25){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x1f'),_0x35fa25[_0x1d2b('0x20')]),_0x35fa25);members['devicestatechange'](_0x35fa25);}catch(_0x5e90c4){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')]('[%s][index][devicestatechange]',_0x35fa25['device']),_0x5e90c4);}});ami['on'](_0x1d2b('0x21'),function(_0x1b7c51){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x22'),_0x1b7c51[_0x1d2b('0x23')]),_0x1b7c51);agents['agentcalled'](_0x1b7c51);}catch(_0x130ee3){utils['error'](util[_0x1d2b('0x1e')](_0x1d2b('0x22'),_0x1b7c51[_0x1d2b('0x23')]),_0x130ee3);}});ami['on']('agentringnoanswer',function(_0x51cea7){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x24'),_0x51cea7['uniqueid']),_0x51cea7);agents[_0x1d2b('0x25')](_0x51cea7);}catch(_0x40aa23){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')]('[%s][index][agentringnoanswer]',_0x51cea7['uniqueid']),_0x40aa23);}});ami['on']('agentconnect',function(_0x48851d){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')]('[%s][index][agentconnect]',_0x48851d[_0x1d2b('0x23')]),_0x48851d);agents[_0x1d2b('0x26')](_0x48851d);queues[_0x1d2b('0x26')](_0x48851d);}catch(_0x4181c3){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x27'),_0x48851d[_0x1d2b('0x23')]),_0x4181c3);}});ami['on'](_0x1d2b('0x28'),function(_0x358b37){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x29'),_0x358b37[_0x1d2b('0x23')]),_0x358b37);agents['agentcomplete'](_0x358b37);queues[_0x1d2b('0x28')](_0x358b37);members[_0x1d2b('0x28')](_0x358b37);}catch(_0x1440e6){utils['error'](util[_0x1d2b('0x1e')]('[%s][index][agentcomplete]',_0x358b37[_0x1d2b('0x23')]),_0x1440e6);}});ami['on'](_0x1d2b('0x2a'),function(_0x413ae7){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')]('[%s][index][queuecallerabandon]',_0x413ae7['uniqueid']),_0x413ae7);agents['queuecallerabandon'](_0x413ae7);queues['queuecallerabandon'](_0x413ae7);}catch(_0x17790f){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x2b'),_0x413ae7[_0x1d2b('0x23')]),_0x17790f);}});ami['on'](_0x1d2b('0x2c'),function(_0x30ede1){try{utils['debug'](util[_0x1d2b('0x1e')](_0x1d2b('0x2d'),_0x30ede1[_0x1d2b('0x23')]),_0x30ede1);queues[_0x1d2b('0x2c')](_0x30ede1);recordings[_0x1d2b('0x2c')](_0x30ede1);}catch(_0x1a91a8){utils['error'](util[_0x1d2b('0x1e')](_0x1d2b('0x2d'),_0x30ede1['uniqueid']),_0x1a91a8);}});ami['on']('queuecallerleave',function(_0x388260){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x2e'),_0x388260[_0x1d2b('0x23')]),_0x388260);queues['queuecallerleave'](_0x388260);}catch(_0x4d2c5f){utils[_0x1d2b('0x19')](util['format'](_0x1d2b('0x2e'),_0x388260[_0x1d2b('0x23')]),_0x4d2c5f);}});ami['on'](_0x1d2b('0x2f'),function(_0x34ed34){try{utils['debug'](util[_0x1d2b('0x1e')](_0x1d2b('0x30'),_0x34ed34[_0x1d2b('0x23')]),_0x34ed34);queues['musiconholdstart'](_0x34ed34);calls[_0x1d2b('0x2f')](_0x34ed34);}catch(_0x47166d){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x30'),_0x34ed34['uniqueid']),_0x47166d);}});ami['on'](_0x1d2b('0x31'),function(_0x218e71){try{utils[_0x1d2b('0x1d')](util['format'](_0x1d2b('0x32'),_0x218e71[_0x1d2b('0x23')]),_0x218e71);queues[_0x1d2b('0x31')](_0x218e71);calls['musiconholdstop'](_0x218e71);}catch(_0x1f7331){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x32'),_0x218e71[_0x1d2b('0x23')]),_0x1f7331);}});ami['on'](_0x1d2b('0x33'),function(_0x193657){try{utils['debug'](util[_0x1d2b('0x1e')]('[%s][index][newstate]',_0x193657[_0x1d2b('0x23')]),_0x193657);calls[_0x1d2b('0x33')](_0x193657);recordings[_0x1d2b('0x33')](_0x193657);}catch(_0x3ab327){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x34'),_0x193657[_0x1d2b('0x23')]),_0x3ab327);}});ami['on'](_0x1d2b('0x35'),function(_0x4e1664){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x36'),_0x4e1664[_0x1d2b('0x23')]),_0x4e1664);calls[_0x1d2b('0x35')](_0x4e1664);recordings[_0x1d2b('0x35')](_0x4e1664);dials[_0x1d2b('0x35')](_0x4e1664);agents[_0x1d2b('0x35')](_0x4e1664);queues[_0x1d2b('0x35')](_0x4e1664);}catch(_0x20f36d){utils['error'](util[_0x1d2b('0x1e')]('[%s][index][hangup]',_0x4e1664[_0x1d2b('0x23')]),_0x20f36d);}});ami['on'](_0x1d2b('0x37'),function(_0x1ab524){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x38'),_0x1ab524['uniqueid']),_0x1ab524);members[_0x1d2b('0x37')](_0x1ab524);}catch(_0x4d2f9f){utils[_0x1d2b('0x19')](util['format'](_0x1d2b('0x38'),_0x1ab524['uniqueid']),_0x4d2f9f);}});ami['on'](_0x1d2b('0x39'),function(_0x31fd96){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')]('[%s][index][blindtransfer]',_0x31fd96[_0x1d2b('0x23')]),_0x31fd96);queues['blindtransfer'](_0x31fd96);agents['blindtransfer'](_0x31fd96);transfers[_0x1d2b('0x39')](_0x31fd96);recordings[_0x1d2b('0x39')](_0x31fd96);}catch(_0x1f1b71){utils['error'](util[_0x1d2b('0x1e')](_0x1d2b('0x3a'),_0x31fd96[_0x1d2b('0x23')]),_0x1f1b71);}});ami['on'](_0x1d2b('0x3b'),function(_0x14dabb){try{utils['debug'](util[_0x1d2b('0x1e')](_0x1d2b('0x3c'),_0x14dabb[_0x1d2b('0x3d')]),_0x14dabb);queues[_0x1d2b('0x3b')](_0x14dabb);transfers['attendedtransfer'](_0x14dabb);agents[_0x1d2b('0x3b')](_0x14dabb);calls['attendedtransfer'](_0x14dabb);}catch(_0x1c2a27){utils[_0x1d2b('0x19')](util['format']('[%s][index][attendedtransfer]',_0x14dabb[_0x1d2b('0x3d')]),_0x1c2a27);}});ami['on'](_0x1d2b('0x3e'),function(_0x2a1771){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x3f'),_0x2a1771[_0x1d2b('0x23')]),_0x2a1771);queues[_0x1d2b('0x3e')](_0x2a1771);recordings['varset'](_0x2a1771);calls[_0x1d2b('0x3e')](_0x2a1771);dials['varset'](_0x2a1771);}catch(_0xc5155){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x3f'),_0x2a1771[_0x1d2b('0x23')]),_0xc5155);}});ami['on'](_0x1d2b('0x40'),function(_0x2eb473){try{utils['debug'](util[_0x1d2b('0x1e')](_0x1d2b('0x41'),_0x2eb473[_0x1d2b('0x23')]),_0x2eb473);calls['newexten'](_0x2eb473);recordings['newexten'](_0x2eb473);dials[_0x1d2b('0x40')](_0x2eb473);}catch(_0x34b8d3){utils['error'](util['format'](_0x1d2b('0x41'),_0x2eb473[_0x1d2b('0x23')]),_0x34b8d3);}});ami['on'](_0x1d2b('0x42'),function(_0x6b1aa5){try{utils['debug'](util[_0x1d2b('0x1e')](_0x1d2b('0x43'),_0x6b1aa5['uniqueid']),_0x6b1aa5);calls[_0x1d2b('0x42')](_0x6b1aa5);recordings[_0x1d2b('0x42')](_0x6b1aa5);}catch(_0x261c27){utils['error'](util[_0x1d2b('0x1e')](_0x1d2b('0x43'),_0x6b1aa5[_0x1d2b('0x23')]),_0x261c27);}});ami['on'](_0x1d2b('0x44'),function(_0x417db6){try{utils[_0x1d2b('0x1d')](util[_0x1d2b('0x1e')](_0x1d2b('0x45'),_0x417db6[_0x1d2b('0x23')]),_0x417db6);dials['dialbegin'](_0x417db6);}catch(_0xd64995){utils['error'](util[_0x1d2b('0x1e')]('[%s]dialbegin',_0x417db6[_0x1d2b('0x23')]),_0xd64995);}});ami['on'](_0x1d2b('0x46'),function(_0x43ba1a){try{utils[_0x1d2b('0x1d')](util['format'](_0x1d2b('0x47'),_0x43ba1a['uniqueid']),_0x43ba1a);dials[_0x1d2b('0x46')](_0x43ba1a);}catch(_0x33a206){utils[_0x1d2b('0x19')](util[_0x1d2b('0x1e')](_0x1d2b('0x47'),_0x43ba1a[_0x1d2b('0x23')]),_0x33a206);}});} \ No newline at end of file +var _0xe0c5=['agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','[%s][index][agentcalled]','uniqueid'];(function(_0x41832c,_0x5b625f){var _0x5de72f=function(_0x24f1ea){while(--_0x24f1ea){_0x41832c['push'](_0x41832c['shift']());}};_0x5de72f(++_0x5b625f);}(_0xe0c5,0xf2));var _0x5e0c=function(_0xad40d0,_0x299801){_0xad40d0=_0xad40d0-0x0;var _0x56e045=_0xe0c5[_0xad40d0];return _0x56e045;};var AsteriskManager=require(_0x5e0c('0x0'));var config=require(_0x5e0c('0x1'));var utils=require(_0x5e0c('0x2'));var util=require('util');var isXDREnabled=config[_0x5e0c('0x3')]&&config[_0x5e0c('0x3')]['disabled']?!config[_0x5e0c('0x3')]['disabled']:!![];var isProduction=config[_0x5e0c('0x4')]===_0x5e0c('0x5')||![];var isLocalAsterisk=config[_0x5e0c('0x3')]&&config[_0x5e0c('0x3')][_0x5e0c('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x5e0c('0x7')][_0x5e0c('0x8')],config[_0x5e0c('0x7')]['ip'],config[_0x5e0c('0x7')][_0x5e0c('0x9')],config[_0x5e0c('0x7')][_0x5e0c('0xa')],!![]);ami[_0x5e0c('0xb')]();if(!isXDREnabled){utils[_0x5e0c('0xc')](_0x5e0c('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x5e0c('0xc')](_0x5e0c('0xe'));}else{var agents=require(_0x5e0c('0xf'));var calls=require(_0x5e0c('0x10'));var queues=require('./queues.controller');var recordings=require(_0x5e0c('0x11'));var members=require('./members.controller');var dials=require(_0x5e0c('0x12'));var transfers=require(_0x5e0c('0x13'));var core=require(_0x5e0c('0x14'));ami['on']('connect',core[_0x5e0c('0x15')]);ami['on'](_0x5e0c('0x16'),core[_0x5e0c('0x16')]);ami['on'](_0x5e0c('0x17'),core[_0x5e0c('0x17')]);ami['on'](_0x5e0c('0x18'),core['error']);ami['on'](_0x5e0c('0x19'),core[_0x5e0c('0x19')]);ami['on'](_0x5e0c('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x2ba575){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')](_0x5e0c('0x1d'),_0x2ba575[_0x5e0c('0x1e')]),_0x2ba575);members[_0x5e0c('0x1f')](_0x2ba575);}catch(_0x4b492f){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x1d'),_0x2ba575[_0x5e0c('0x1e')]),_0x4b492f);}});ami['on']('agentcalled',function(_0x5dc650){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')](_0x5e0c('0x20'),_0x5dc650[_0x5e0c('0x21')]),_0x5dc650);agents['agentcalled'](_0x5dc650);}catch(_0x43a4a8){utils['error'](util[_0x5e0c('0x1c')]('[%s][index][agentcalled]',_0x5dc650[_0x5e0c('0x21')]),_0x43a4a8);}});ami['on'](_0x5e0c('0x22'),function(_0x4951e2){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][agentringnoanswer]',_0x4951e2[_0x5e0c('0x21')]),_0x4951e2);agents[_0x5e0c('0x22')](_0x4951e2);}catch(_0x2cf65e){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x23'),_0x4951e2['uniqueid']),_0x2cf65e);}});ami['on']('agentconnect',function(_0x2ab0e0){try{utils['debug'](util[_0x5e0c('0x1c')](_0x5e0c('0x24'),_0x2ab0e0['uniqueid']),_0x2ab0e0);agents[_0x5e0c('0x25')](_0x2ab0e0);queues[_0x5e0c('0x25')](_0x2ab0e0);}catch(_0x22ea03){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x24'),_0x2ab0e0[_0x5e0c('0x21')]),_0x22ea03);}});ami['on'](_0x5e0c('0x26'),function(_0x57b5af){try{utils[_0x5e0c('0x1b')](util['format']('[%s][index][agentcomplete]',_0x57b5af[_0x5e0c('0x21')]),_0x57b5af);agents[_0x5e0c('0x26')](_0x57b5af);queues['agentcomplete'](_0x57b5af);members[_0x5e0c('0x26')](_0x57b5af);}catch(_0x522e84){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x27'),_0x57b5af[_0x5e0c('0x21')]),_0x522e84);}});ami['on'](_0x5e0c('0x28'),function(_0x5464e7){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x29'),_0x5464e7[_0x5e0c('0x21')]),_0x5464e7);agents[_0x5e0c('0x28')](_0x5464e7);queues[_0x5e0c('0x28')](_0x5464e7);}catch(_0x405c24){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x5464e7[_0x5e0c('0x21')]),_0x405c24);}});ami['on'](_0x5e0c('0x2a'),function(_0x378cd4){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][queuecallerjoin]',_0x378cd4[_0x5e0c('0x21')]),_0x378cd4);queues[_0x5e0c('0x2a')](_0x378cd4);recordings[_0x5e0c('0x2a')](_0x378cd4);}catch(_0x6cb0fc){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')]('[%s][index][queuecallerjoin]',_0x378cd4[_0x5e0c('0x21')]),_0x6cb0fc);}});ami['on'](_0x5e0c('0x2b'),function(_0x11c739){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x2c'),_0x11c739[_0x5e0c('0x21')]),_0x11c739);queues[_0x5e0c('0x2b')](_0x11c739);}catch(_0x34ba00){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x2c'),_0x11c739[_0x5e0c('0x21')]),_0x34ba00);}});ami['on'](_0x5e0c('0x2d'),function(_0x31bd66){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')](_0x5e0c('0x2e'),_0x31bd66[_0x5e0c('0x21')]),_0x31bd66);queues['musiconholdstart'](_0x31bd66);calls[_0x5e0c('0x2d')](_0x31bd66);}catch(_0x58235c){utils[_0x5e0c('0x18')](util['format'](_0x5e0c('0x2e'),_0x31bd66[_0x5e0c('0x21')]),_0x58235c);}});ami['on'](_0x5e0c('0x2f'),function(_0x1ac7f8){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][musiconholdstop]',_0x1ac7f8['uniqueid']),_0x1ac7f8);queues[_0x5e0c('0x2f')](_0x1ac7f8);calls[_0x5e0c('0x2f')](_0x1ac7f8);}catch(_0x4c172b){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x30'),_0x1ac7f8[_0x5e0c('0x21')]),_0x4c172b);}});ami['on'](_0x5e0c('0x31'),function(_0x58af6d){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x32'),_0x58af6d[_0x5e0c('0x21')]),_0x58af6d);calls[_0x5e0c('0x31')](_0x58af6d);recordings[_0x5e0c('0x31')](_0x58af6d);}catch(_0x4abb02){utils['error'](util[_0x5e0c('0x1c')](_0x5e0c('0x32'),_0x58af6d[_0x5e0c('0x21')]),_0x4abb02);}});ami['on']('hangup',function(_0x5418a4){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x33'),_0x5418a4[_0x5e0c('0x21')]),_0x5418a4);calls['hangup'](_0x5418a4);recordings[_0x5e0c('0x34')](_0x5418a4);dials[_0x5e0c('0x34')](_0x5418a4);agents[_0x5e0c('0x34')](_0x5418a4);queues[_0x5e0c('0x34')](_0x5418a4);}catch(_0x3c6f3b){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x33'),_0x5418a4[_0x5e0c('0x21')]),_0x3c6f3b);}});ami['on'](_0x5e0c('0x35'),function(_0x5db888){try{utils['debug'](util[_0x5e0c('0x1c')](_0x5e0c('0x36'),_0x5db888[_0x5e0c('0x21')]),_0x5db888);members[_0x5e0c('0x35')](_0x5db888);}catch(_0x3727f3){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x36'),_0x5db888['uniqueid']),_0x3727f3);}});ami['on'](_0x5e0c('0x37'),function(_0x3acc98){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][blindtransfer]',_0x3acc98['uniqueid']),_0x3acc98);queues['blindtransfer'](_0x3acc98);agents[_0x5e0c('0x37')](_0x3acc98);transfers[_0x5e0c('0x37')](_0x3acc98);recordings['blindtransfer'](_0x3acc98);}catch(_0x10e268){utils['error'](util['format']('[%s][index][blindtransfer]',_0x3acc98[_0x5e0c('0x21')]),_0x10e268);}});ami['on']('attendedtransfer',function(_0x1f3e0b){try{utils['debug'](util['format'](_0x5e0c('0x38'),_0x1f3e0b[_0x5e0c('0x39')]),_0x1f3e0b);queues[_0x5e0c('0x3a')](_0x1f3e0b);transfers[_0x5e0c('0x3a')](_0x1f3e0b);agents[_0x5e0c('0x3a')](_0x1f3e0b);calls['attendedtransfer'](_0x1f3e0b);}catch(_0x1372d0){utils['error'](util[_0x5e0c('0x1c')](_0x5e0c('0x38'),_0x1f3e0b[_0x5e0c('0x39')]),_0x1372d0);}});ami['on'](_0x5e0c('0x3b'),function(_0x708cb2){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x3c'),_0x708cb2[_0x5e0c('0x21')]),_0x708cb2);queues[_0x5e0c('0x3b')](_0x708cb2);recordings[_0x5e0c('0x3b')](_0x708cb2);calls['varset'](_0x708cb2);dials[_0x5e0c('0x3b')](_0x708cb2);}catch(_0x2fa2bc){utils['error'](util[_0x5e0c('0x1c')](_0x5e0c('0x3c'),_0x708cb2['uniqueid']),_0x2fa2bc);}});ami['on'](_0x5e0c('0x3d'),function(_0x2ff466){try{utils['debug'](util[_0x5e0c('0x1c')](_0x5e0c('0x3e'),_0x2ff466[_0x5e0c('0x21')]),_0x2ff466);calls['newexten'](_0x2ff466);recordings[_0x5e0c('0x3d')](_0x2ff466);dials[_0x5e0c('0x3d')](_0x2ff466);}catch(_0x5b1bf3){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')]('[%s][index][newexten]',_0x2ff466['uniqueid']),_0x5b1bf3);}});ami['on'](_0x5e0c('0x3f'),function(_0x51612c){try{utils[_0x5e0c('0x1b')](util['format'](_0x5e0c('0x40'),_0x51612c['uniqueid']),_0x51612c);calls[_0x5e0c('0x3f')](_0x51612c);recordings[_0x5e0c('0x3f')](_0x51612c);}catch(_0x17cca1){utils['error'](util[_0x5e0c('0x1c')](_0x5e0c('0x40'),_0x51612c[_0x5e0c('0x21')]),_0x17cca1);}});ami['on'](_0x5e0c('0x41'),function(_0x527124){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][dialbegin]',_0x527124['uniqueid']),_0x527124);dials[_0x5e0c('0x41')](_0x527124);}catch(_0xb3fc8a){utils['error'](util['format'](_0x5e0c('0x42'),_0x527124[_0x5e0c('0x21')]),_0xb3fc8a);}});ami['on'](_0x5e0c('0x43'),function(_0x1a91ac){try{utils[_0x5e0c('0x1b')](util[_0x5e0c('0x1c')]('[%s][index][dialend]',_0x1a91ac[_0x5e0c('0x21')]),_0x1a91ac);dials['dialend'](_0x1a91ac);}catch(_0x29e75b){utils[_0x5e0c('0x18')](util[_0x5e0c('0x1c')](_0x5e0c('0x44'),_0x1a91ac['uniqueid']),_0x29e75b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4cc9ca6..7574991 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 _0x45c8=['assign','queue','cdr','[%s][members][cdr]','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','split','error','[%s][members][writeDB]','uniqueid','some','debug','format','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s'];(function(_0x44b0de,_0x213afa){var _0x21da2a=function(_0x264f30){while(--_0x264f30){_0x44b0de['push'](_0x44b0de['shift']());}};_0x21da2a(++_0x213afa);}(_0x45c8,0xef));var _0x845c=function(_0x1f113e,_0x37d8f6){_0x1f113e=_0x1f113e-0x0;var _0x2be681=_0x45c8[_0x1f113e];return _0x2be681;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var utils=require(_0x845c('0x1'));var members={};var exclude=[_0x845c('0x2'),_0x845c('0x3')];function writeDB(_0x343dc5){utils['info'](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x343dc5['uniqueid'],_0x343dc5[_0x845c('0x4')],_0x343dc5[_0x845c('0x5')],_0x343dc5[_0x845c('0x6')],_0x343dc5['membername'],_0x343dc5[_0x845c('0x7')]));if(_0x343dc5['interface']){utils[_0x845c('0x8')](_0x343dc5[_0x845c('0x4')])[_0x845c('0x9')](function(_0x36b3aa){if(_0x36b3aa){_0x343dc5[_0x845c('0xa')]=_0x36b3aa[_0x845c('0xb')];_0x343dc5[_0x845c('0xc')]=_0x36b3aa[_0x845c('0xc')];utils[_0x845c('0xd')](_0x845c('0xe'),_0x343dc5);}else{utils['getUserByName'](_0x343dc5['interface'][_0x845c('0xf')]('/')[0x1])[_0x845c('0x9')](function(_0x571283){if(_0x571283){_0x343dc5[_0x845c('0xa')]=_0x571283[_0x845c('0xb')];_0x343dc5[_0x845c('0xc')]=_0x571283[_0x845c('0xc')];utils[_0x845c('0xd')](_0x845c('0xe'),_0x343dc5);}});}})['catch'](function(_0x7a46e8){utils[_0x845c('0x10')](util['format'](_0x845c('0x11'),_0x343dc5[_0x845c('0x12')]),_0x7a46e8);});}delete members[_0x343dc5[_0x845c('0x4')]];}function startsWith(_0x3ce72b,_0xf0cc1b){return _[_0x845c('0x13')](_0x3ce72b,function(_0x14b400){return _['startsWith'](_0xf0cc1b,_0x14b400);});}exports['devicestatechange']=function(_0x3b1ff9){try{utils[_0x845c('0x14')](util[_0x845c('0x15')]('[%s][members][devicestatechange]',members[_0x3b1ff9[_0x845c('0x16')]]?members[_0x3b1ff9[_0x845c('0x16')]][_0x845c('0x12')]:_0x3b1ff9['device']),_0x3b1ff9);utils['info'](util['format'](_0x845c('0x17'),members[_0x3b1ff9['device']]?members[_0x3b1ff9[_0x845c('0x16')]][_0x845c('0x12')]:_0x3b1ff9[_0x845c('0x16')],_0x3b1ff9[_0x845c('0x18')],_0x3b1ff9[_0x845c('0x16')]));switch(_0x3b1ff9['state']){case _0x845c('0x19'):case'BUSY':if(!startsWith(exclude,_0x3b1ff9[_0x845c('0x16')])){members[_0x3b1ff9['device']]={'channel':_0x845c('0x1a'),'interface':_0x3b1ff9['device'],'type':_0x845c('0x1b'),'enterAt':utils['now'](),'role':_0x845c('0x1c')};}break;case _0x845c('0x1d'):if(!_[_0x845c('0x1e')](members[_0x3b1ff9[_0x845c('0x16')]])){members[_0x3b1ff9[_0x845c('0x16')]][_0x845c('0x1f')]=utils['now']();members[_0x3b1ff9[_0x845c('0x16')]]['duration']=utils[_0x845c('0x20')](members[_0x3b1ff9[_0x845c('0x16')]]['exitAt'],members[_0x3b1ff9[_0x845c('0x16')]][_0x845c('0x21')]);if(members[_0x3b1ff9[_0x845c('0x16')]]['uniqueid']){writeDB(members[_0x3b1ff9['device']]);}}break;default:break;}}catch(_0x27b211){utils[_0x845c('0x10')](util[_0x845c('0x15')]('[%s][members][devicestatechange]',members[_0x3b1ff9[_0x845c('0x16')]]?members[_0x3b1ff9[_0x845c('0x16')]][_0x845c('0x12')]:_0x3b1ff9[_0x845c('0x16')]),_0x27b211);}};exports['agentcomplete']=function(_0x19a44b){try{if(!_[_0x845c('0x1e')](members[_0x19a44b[_0x845c('0x4')]])){utils['debug'](util[_0x845c('0x15')](_0x845c('0x22'),_0x19a44b['uniqueid']),_0x19a44b);utils[_0x845c('0x23')](util[_0x845c('0x15')](_0x845c('0x24'),_0x19a44b[_0x845c('0x12')],_0x19a44b['interface'],_0x19a44b['queue']));members[_0x19a44b[_0x845c('0x4')]]=_[_0x845c('0x25')](members[_0x19a44b[_0x845c('0x4')]],{'data4':_0x19a44b[_0x845c('0x26')],'uniqueid':_0x19a44b[_0x845c('0x12')]});}}catch(_0x13c610){utils[_0x845c('0x10')](util[_0x845c('0x15')](_0x845c('0x22'),_0x19a44b[_0x845c('0x12')]),_0x13c610);}};exports[_0x845c('0x27')]=function(_0x4f2aa5){try{utils[_0x845c('0x14')](util['format'](_0x845c('0x28'),_0x4f2aa5[_0x845c('0x12')]),_0x4f2aa5);if(_0x4f2aa5[_0x845c('0x5')]){var _0x276516=_0x4f2aa5[_0x845c('0x5')]['split']('-')[0x0];if(!_[_0x845c('0x1e')](members[_0x276516])){members[_0x276516]=_[_0x845c('0x25')](members[_0x276516],{'data1':members[_0x276516]['data1']||_0x4f2aa5['type'],'data2':members[_0x276516][_0x845c('0x6')]||_0x4f2aa5['source'],'data3':members[_0x276516][_0x845c('0x29')]||_0x4f2aa5['destination'],'uniqueid':members[_0x276516][_0x845c('0x12')]||_0x4f2aa5['uniqueid']});utils['info'](util[_0x845c('0x15')](_0x845c('0x2a'),_0x4f2aa5[_0x845c('0x12')],members[_0x276516][_0x845c('0x2b')],members[_0x276516][_0x845c('0x6')],members[_0x276516][_0x845c('0x29')]));if(members[_0x276516]['exitAt']){writeDB(members[_0x276516]);}}}if(_0x4f2aa5[_0x845c('0x2c')]){var _0x4e9550=_0x4f2aa5[_0x845c('0x2c')][_0x845c('0xf')]('-')[0x0];if(!_[_0x845c('0x1e')](members[_0x4e9550])){members[_0x4e9550]=_[_0x845c('0x25')](members[_0x4e9550],{'data1':members[_0x4e9550][_0x845c('0x2b')]||_0x4f2aa5[_0x845c('0x7')],'data2':members[_0x4e9550][_0x845c('0x6')]||_0x4f2aa5[_0x845c('0x2d')],'data3':members[_0x4e9550][_0x845c('0x29')]||_0x4f2aa5['destination'],'uniqueid':members[_0x4e9550][_0x845c('0x12')]||_0x4f2aa5[_0x845c('0x12')]});utils[_0x845c('0x23')](util[_0x845c('0x15')](_0x845c('0x2a'),_0x4f2aa5[_0x845c('0x12')],members[_0x4e9550][_0x845c('0x2b')],members[_0x4e9550][_0x845c('0x6')],members[_0x4e9550][_0x845c('0x29')]));if(members[_0x4e9550][_0x845c('0x1f')]){writeDB(members[_0x4e9550]);}}}}catch(_0x5b3d29){utils[_0x845c('0x10')](util[_0x845c('0x15')](_0x845c('0x28'),_0x4f2aa5[_0x845c('0x12')]),_0x5b3d29);}}; \ No newline at end of file +var _0xb201=['assign','data1','type','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','membername','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','[%s][members][writeDB]','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','now','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','split'];(function(_0x49393c,_0x7bfcc7){var _0x1386be=function(_0x151741){while(--_0x151741){_0x49393c['push'](_0x49393c['shift']());}};_0x1386be(++_0x7bfcc7);}(_0xb201,0x1b1));var _0x1b20=function(_0x2fd450,_0xeb4f0e){_0x2fd450=_0x2fd450-0x0;var _0x271bb0=_0xb201[_0x2fd450];return _0x271bb0;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var utils=require(_0x1b20('0x1'));var members={};var exclude=[_0x1b20('0x2'),_0x1b20('0x3')];function writeDB(_0x30b3a4){utils[_0x1b20('0x4')](util[_0x1b20('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x30b3a4[_0x1b20('0x6')],_0x30b3a4[_0x1b20('0x7')],_0x30b3a4[_0x1b20('0x8')],_0x30b3a4['data2'],_0x30b3a4[_0x1b20('0x9')],_0x30b3a4['type']));if(_0x30b3a4[_0x1b20('0x7')]){utils[_0x1b20('0xa')](_0x30b3a4[_0x1b20('0x7')])[_0x1b20('0xb')](function(_0x4973ae){if(_0x4973ae){_0x30b3a4[_0x1b20('0x9')]=_0x4973ae[_0x1b20('0xc')];_0x30b3a4[_0x1b20('0xd')]=_0x4973ae['internal'];utils[_0x1b20('0xe')]('CreateMemberReport',_0x30b3a4);}else{utils[_0x1b20('0xf')](_0x30b3a4['interface']['split']('/')[0x1])[_0x1b20('0xb')](function(_0x21f698){if(_0x21f698){_0x30b3a4[_0x1b20('0x9')]=_0x21f698[_0x1b20('0xc')];_0x30b3a4[_0x1b20('0xd')]=_0x21f698['internal'];utils[_0x1b20('0xe')](_0x1b20('0x10'),_0x30b3a4);}});}})[_0x1b20('0x11')](function(_0x3db888){utils[_0x1b20('0x12')](util['format'](_0x1b20('0x13'),_0x30b3a4[_0x1b20('0x6')]),_0x3db888);});}delete members[_0x30b3a4[_0x1b20('0x7')]];}function startsWith(_0x4fcdf7,_0x39c398){return _['some'](_0x4fcdf7,function(_0x348f79){return _[_0x1b20('0x14')](_0x39c398,_0x348f79);});}exports['devicestatechange']=function(_0x44e713){try{utils[_0x1b20('0x15')](util[_0x1b20('0x5')](_0x1b20('0x16'),members[_0x44e713[_0x1b20('0x17')]]?members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x6')]:_0x44e713[_0x1b20('0x17')]),_0x44e713);utils[_0x1b20('0x4')](util[_0x1b20('0x5')](_0x1b20('0x18'),members[_0x44e713[_0x1b20('0x17')]]?members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x6')]:_0x44e713[_0x1b20('0x17')],_0x44e713['state'],_0x44e713[_0x1b20('0x17')]));switch(_0x44e713['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x44e713[_0x1b20('0x17')])){members[_0x44e713['device']]={'channel':'voice','interface':_0x44e713[_0x1b20('0x17')],'type':'TALKING','enterAt':utils[_0x1b20('0x19')](),'role':'agent'};}break;case _0x1b20('0x1a'):if(!_[_0x1b20('0x1b')](members[_0x44e713[_0x1b20('0x17')]])){members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x1c')]=utils[_0x1b20('0x19')]();members[_0x44e713['device']]['duration']=utils[_0x1b20('0x1d')](members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x1c')],members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x1e')]);if(members[_0x44e713[_0x1b20('0x17')]][_0x1b20('0x6')]){writeDB(members[_0x44e713[_0x1b20('0x17')]]);}}break;default:break;}}catch(_0x1f4d52){utils[_0x1b20('0x12')](util['format']('[%s][members][devicestatechange]',members[_0x44e713[_0x1b20('0x17')]]?members[_0x44e713['device']]['uniqueid']:_0x44e713['device']),_0x1f4d52);}};exports[_0x1b20('0x1f')]=function(_0x1fb8bf){try{if(!_[_0x1b20('0x1b')](members[_0x1fb8bf[_0x1b20('0x7')]])){utils[_0x1b20('0x15')](util[_0x1b20('0x5')](_0x1b20('0x20'),_0x1fb8bf['uniqueid']),_0x1fb8bf);utils['info'](util[_0x1b20('0x5')](_0x1b20('0x21'),_0x1fb8bf[_0x1b20('0x6')],_0x1fb8bf[_0x1b20('0x7')],_0x1fb8bf[_0x1b20('0x22')]));members[_0x1fb8bf[_0x1b20('0x7')]]=_['assign'](members[_0x1fb8bf['interface']],{'data4':_0x1fb8bf[_0x1b20('0x22')],'uniqueid':_0x1fb8bf[_0x1b20('0x6')]});}}catch(_0x39f388){utils[_0x1b20('0x12')](util['format'](_0x1b20('0x20'),_0x1fb8bf[_0x1b20('0x6')]),_0x39f388);}};exports[_0x1b20('0x23')]=function(_0x16c0db){try{utils['debug'](util[_0x1b20('0x5')]('[%s][members][cdr]',_0x16c0db[_0x1b20('0x6')]),_0x16c0db);if(_0x16c0db[_0x1b20('0x8')]){var _0x1af673=_0x16c0db[_0x1b20('0x8')][_0x1b20('0x24')]('-')[0x0];if(!_['isNil'](members[_0x1af673])){members[_0x1af673]=_[_0x1b20('0x25')](members[_0x1af673],{'data1':members[_0x1af673][_0x1b20('0x26')]||_0x16c0db[_0x1b20('0x27')],'data2':members[_0x1af673][_0x1b20('0x28')]||_0x16c0db[_0x1b20('0x29')],'data3':members[_0x1af673][_0x1b20('0x2a')]||_0x16c0db[_0x1b20('0x2b')],'uniqueid':members[_0x1af673][_0x1b20('0x6')]||_0x16c0db[_0x1b20('0x6')]});utils['info'](util[_0x1b20('0x5')](_0x1b20('0x2c'),_0x16c0db[_0x1b20('0x6')],members[_0x1af673]['data1'],members[_0x1af673][_0x1b20('0x28')],members[_0x1af673][_0x1b20('0x2a')]));if(members[_0x1af673][_0x1b20('0x1c')]){writeDB(members[_0x1af673]);}}}if(_0x16c0db['destinationchannel']){var _0x4a77aa=_0x16c0db[_0x1b20('0x2d')]['split']('-')[0x0];if(!_['isNil'](members[_0x4a77aa])){members[_0x4a77aa]=_[_0x1b20('0x25')](members[_0x4a77aa],{'data1':members[_0x4a77aa][_0x1b20('0x26')]||_0x16c0db['type'],'data2':members[_0x4a77aa][_0x1b20('0x28')]||_0x16c0db[_0x1b20('0x29')],'data3':members[_0x4a77aa][_0x1b20('0x2a')]||_0x16c0db[_0x1b20('0x2b')],'uniqueid':members[_0x4a77aa][_0x1b20('0x6')]||_0x16c0db[_0x1b20('0x6')]});utils[_0x1b20('0x4')](util['format'](_0x1b20('0x2c'),_0x16c0db['uniqueid'],members[_0x4a77aa][_0x1b20('0x26')],members[_0x4a77aa][_0x1b20('0x28')],members[_0x4a77aa][_0x1b20('0x2a')]));if(members[_0x4a77aa][_0x1b20('0x1c')]){writeDB(members[_0x4a77aa]);}}}}catch(_0x4bd24e){utils['error'](util[_0x1b20('0x5')](_0x1b20('0x2e'),_0x16c0db[_0x1b20('0x6')]),_0x4bd24e);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 91e5b1e..474e5fa 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 _0x94a9=['BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','format','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','transferuniqueid'];(function(_0x345695,_0x2ba140){var _0x5002d3=function(_0x1f6cbb){while(--_0x1f6cbb){_0x345695['push'](_0x345695['shift']());}};_0x5002d3(++_0x2ba140);}(_0x94a9,0xe3));var _0x994a=function(_0x39a2ec,_0xa1f7dd){_0x39a2ec=_0x39a2ec-0x0;var _0x14bc4d=_0x94a9[_0x39a2ec];return _0x14bc4d;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x3d4cd9){utils[_0x994a('0x0')](util[_0x994a('0x1')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3d4cd9['uniqueid'],_0x3d4cd9[_0x994a('0x2')],_0x3d4cd9[_0x994a('0x3')],_0x3d4cd9[_0x994a('0x4')],_0x3d4cd9[_0x994a('0x5')],_0x3d4cd9[_0x994a('0x6')],_0x3d4cd9[_0x994a('0x7')]));if(_0x3d4cd9[_0x994a('0x3')]){utils['getVoiceQueueByName'](_0x3d4cd9[_0x994a('0x3')])[_0x994a('0x8')](function(_0x3854ad){if(_0x3854ad){_0x3d4cd9[_0x994a('0x9')]=_0x3854ad[_0x994a('0x9')];}utils['request']('CreateVoiceQueueReport',_0x3d4cd9);});}else{utils['request'](_0x994a('0xa'),_0x3d4cd9);}if(_0x3d4cd9[_0x994a('0xb')]){delete queues[_0x3d4cd9[_0x994a('0xb')]];}else{delete queues[_0x3d4cd9[_0x994a('0xc')]];}}exports[_0x994a('0xd')]=function(_0x2e73f4){try{utils[_0x994a('0xe')](util['format'](_0x994a('0xf'),_0x2e73f4[_0x994a('0xc')]),_0x2e73f4);utils['info'](util[_0x994a('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2e73f4[_0x994a('0xc')],_0x2e73f4[_0x994a('0x3')],_0x2e73f4[_0x994a('0x10')]));queues[_0x2e73f4[_0x994a('0xc')]]=_[_0x994a('0x11')](_0x2e73f4,{'originalposition':_0x2e73f4[_0x994a('0x10')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5366ed){utils[_0x994a('0x12')](util[_0x994a('0x1')](_0x994a('0xf'),_0x2e73f4[_0x994a('0xc')]),_0x5366ed);}};exports[_0x994a('0x13')]=function(_0x2084ba){try{if(!_[_0x994a('0x14')](queues[_0x2084ba[_0x994a('0xc')]])){utils[_0x994a('0xe')](util[_0x994a('0x1')](_0x994a('0x15'),_0x2084ba['uniqueid']),_0x2084ba);if(queues[_0x2084ba['uniqueid']][_0x994a('0x16')]){if(!queues[_0x2084ba['uniqueid']][_0x994a('0x17')]&&!queues[_0x2084ba['uniqueid']][_0x994a('0x18')]){queues[_0x2084ba[_0x994a('0xc')]]['queuecallercomplete']=!![];queues[_0x2084ba['uniqueid']][_0x994a('0x19')]=utils['now']();queues[_0x2084ba[_0x994a('0xc')]][_0x994a('0x7')]='COMPLETEDBYAGENT';}utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x1a'),_0x2084ba[_0x994a('0xc')],queues[_0x2084ba['uniqueid']]['name'],queues[_0x2084ba[_0x994a('0xc')]]['queuecallerexitreason']));writeDB(queues[_0x2084ba[_0x994a('0xc')]]);}else if(queues[_0x2084ba[_0x994a('0xc')]][_0x994a('0xb')]){utils['info'](util['format'](_0x994a('0x1b'),_0x2084ba[_0x994a('0xc')],queues[_0x2084ba[_0x994a('0xc')]][_0x994a('0x1c')],queues[_0x2084ba[_0x994a('0xc')]][_0x994a('0xb')]));queues[queues[_0x2084ba[_0x994a('0xc')]]['transfereduniqueid']]=queues[_0x2084ba['uniqueid']];queues[queues[_0x2084ba['uniqueid']]['transfereduniqueid']][_0x994a('0x1d')]=0x2;delete queues[_0x2084ba[_0x994a('0xc')]];}}}catch(_0x301704){utils[_0x994a('0x12')](util[_0x994a('0x1')](_0x994a('0x15'),_0x2084ba[_0x994a('0xc')]),_0x301704);}};exports[_0x994a('0x1e')]=function(_0x248185){try{utils['debug'](util[_0x994a('0x1')](_0x994a('0x1f'),_0x248185[_0x994a('0xc')]),_0x248185);if(!_[_0x994a('0x14')](_0x248185[_0x994a('0x20')]['queuestatus'])&&_0x248185[_0x994a('0x21')][_0x994a('0x22')]()!==_0x994a('0x23')){if(!_[_0x994a('0x14')](queues[_0x248185[_0x994a('0xc')]])){queues[_0x248185[_0x994a('0xc')]][_0x994a('0x17')]=![];queues[_0x248185[_0x994a('0xc')]][_0x994a('0x24')]=null;queues[_0x248185[_0x994a('0xc')]][_0x994a('0x18')]=!![];queues[_0x248185[_0x994a('0xc')]][_0x994a('0x25')]=utils[_0x994a('0x26')]();queues[_0x248185[_0x994a('0xc')]]['queuecallerexitreason']=_0x248185[_0x994a('0x21')][_0x994a('0x22')]();utils['info'](util['format'](_0x994a('0x27'),_0x248185[_0x994a('0xc')],queues[_0x248185['uniqueid']]['name'],_0x248185[_0x994a('0x21')],queues[_0x248185['uniqueid']][_0x994a('0x7')]));writeDB(queues[_0x248185['uniqueid']]);}}else if(!_[_0x994a('0x14')](_0x248185[_0x994a('0x20')]['queueposition'])){if(!_[_0x994a('0x14')](queues[_0x248185[_0x994a('0xc')]])&&!queues[_0x248185[_0x994a('0xc')]]['queuecallerabandon']){queues[_0x248185[_0x994a('0xc')]][_0x994a('0x17')]=![];queues[_0x248185['uniqueid']][_0x994a('0x24')]=null;queues[_0x248185['uniqueid']][_0x994a('0x18')]=!![];queues[_0x248185['uniqueid']][_0x994a('0x25')]=utils[_0x994a('0x26')]();queues[_0x248185['uniqueid']][_0x994a('0x7')]='EXITWITHKEY';utils[_0x994a('0x0')](util[_0x994a('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x248185[_0x994a('0xc')],queues[_0x248185[_0x994a('0xc')]][_0x994a('0x1c')],_0x248185['value'],queues[_0x248185[_0x994a('0xc')]]['queuecallerexitreason']));}}}catch(_0x184e0a){utils[_0x994a('0x12')](util[_0x994a('0x1')]('[%s][queues][varset]',_0x248185[_0x994a('0xc')]),_0x184e0a);}};exports[_0x994a('0x17')]=function(_0x37e2d5){try{if(!_[_0x994a('0x14')](queues[_0x37e2d5[_0x994a('0xc')]])){utils[_0x994a('0xe')](util[_0x994a('0x1')](_0x994a('0x28'),_0x37e2d5[_0x994a('0xc')]),_0x37e2d5);queues[_0x37e2d5[_0x994a('0xc')]][_0x994a('0x18')]=![];queues[_0x37e2d5[_0x994a('0xc')]][_0x994a('0x25')]=null;queues[_0x37e2d5[_0x994a('0xc')]]['queuecallerabandon']=!![];queues[_0x37e2d5[_0x994a('0xc')]][_0x994a('0x24')]=utils[_0x994a('0x26')]();queues[_0x37e2d5['uniqueid']][_0x994a('0x7')]=_0x994a('0x29');utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x2a'),_0x37e2d5[_0x994a('0xc')],queues[_0x37e2d5['uniqueid']][_0x994a('0x1c')],queues[_0x37e2d5[_0x994a('0xc')]]['queuecallerexitreason']));}}catch(_0x196e94){utils[_0x994a('0x12')](util[_0x994a('0x1')](_0x994a('0x28'),_0x37e2d5[_0x994a('0xc')]),_0x196e94);}};exports[_0x994a('0x2b')]=function(_0x3bfdec){try{if(!_[_0x994a('0x14')](queues[_0x3bfdec[_0x994a('0xc')]])){utils[_0x994a('0xe')](util[_0x994a('0x1')](_0x994a('0x2c'),_0x3bfdec[_0x994a('0xc')]),_0x3bfdec);utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x2d'),_0x3bfdec['uniqueid'],queues[_0x3bfdec[_0x994a('0xc')]][_0x994a('0x1c')],_0x3bfdec[_0x994a('0x2e')],_0x3bfdec['connectedlinename']));queues[_0x3bfdec['uniqueid']][_0x994a('0x2b')]=!![];queues[_0x3bfdec[_0x994a('0xc')]]['queuecallerleaveAt']=utils[_0x994a('0x26')]();queues[_0x3bfdec[_0x994a('0xc')]][_0x994a('0x2f')]=utils[_0x994a('0x30')](queues[_0x3bfdec[_0x994a('0xc')]][_0x994a('0x16')],queues[_0x3bfdec[_0x994a('0xc')]][_0x994a('0x31')]);queues[_0x3bfdec['uniqueid']][_0x994a('0x10')]=_0x3bfdec['position'];queues[_0x3bfdec[_0x994a('0xc')]][_0x994a('0x32')]=_0x3bfdec[_0x994a('0x32')];queues[_0x3bfdec['uniqueid']][_0x994a('0x2e')]=_0x3bfdec[_0x994a('0x2e')];queues[_0x3bfdec['uniqueid']][_0x994a('0x33')]=_0x3bfdec[_0x994a('0x33')];}}catch(_0x1a941d){utils[_0x994a('0x12')](util['format'](_0x994a('0x2c'),_0x3bfdec['uniqueid']),_0x1a941d);}};exports[_0x994a('0x34')]=function(_0x1b89d9){try{if(!_[_0x994a('0x14')](queues[_0x1b89d9['uniqueid']])){utils[_0x994a('0xe')](util['format'](_0x994a('0x35'),_0x1b89d9['uniqueid']),_0x1b89d9);utils[_0x994a('0x0')](util['format'](_0x994a('0x36'),_0x1b89d9[_0x994a('0xc')],queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x1c')],_0x1b89d9[_0x994a('0x37')],_0x1b89d9[_0x994a('0x38')]));queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x17')]=![];queues[_0x1b89d9[_0x994a('0xc')]]['queuecallerabandon']=![];queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x24')]=null;queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x18')]=![];queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x7')]=null;queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x25')]=null;queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x39')]=!![];queues[_0x1b89d9[_0x994a('0xc')]]['accountcode']=_0x1b89d9[_0x994a('0x38')];queues[_0x1b89d9[_0x994a('0xc')]][_0x994a('0x4')]=_0x1b89d9[_0x994a('0x37')];}}catch(_0x56932d){utils['error'](util['format'](_0x994a('0x35'),_0x1b89d9[_0x994a('0xc')]),_0x56932d);}};exports[_0x994a('0x3a')]=function(_0x1a5602){try{if(!_['isNil'](queues[_0x1a5602[_0x994a('0xc')]])){if(queues[_0x1a5602['uniqueid']][_0x994a('0x16')]){utils[_0x994a('0xe')](util[_0x994a('0x1')](_0x994a('0x3b'),_0x1a5602[_0x994a('0xc')]),_0x1a5602);queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x17')]=![];queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x17')]=![];queues[_0x1a5602['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x18')]=![];queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x25')]=null;queues[_0x1a5602['uniqueid']][_0x994a('0x39')]=!![];queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x4')]=_0x1a5602['membername'];queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x3c')]=!![];queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x19')]=utils['now']();if(_0x1a5602[_0x994a('0x3d')]==_0x994a('0x3e')){if(!queues[_0x1a5602['uniqueid']][_0x994a('0x3e')]){queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x7')]='TRANSFER';}}else{queues[_0x1a5602[_0x994a('0xc')]]['queuecallerexitreason']=_0x994a('0x3f')+_0x1a5602[_0x994a('0x3d')][_0x994a('0x22')]();}utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x40'),_0x1a5602['uniqueid'],queues[_0x1a5602['uniqueid']][_0x994a('0x1c')],_0x1a5602['membername'],queues[_0x1a5602[_0x994a('0xc')]][_0x994a('0x7')]));writeDB(queues[_0x1a5602[_0x994a('0xc')]]);}}}catch(_0x58db66){utils[_0x994a('0x12')](util[_0x994a('0x1')](_0x994a('0x3b'),_0x1a5602[_0x994a('0xc')]),_0x58db66);}};exports[_0x994a('0x41')]=function(_0x3f0fc3){try{if(!_[_0x994a('0x14')](queues[_0x3f0fc3[_0x994a('0x42')]])){utils[_0x994a('0xe')](util['format']('[%s][queues][blindtransfer]',_0x3f0fc3['uniqueid']),_0x3f0fc3);queues[_0x3f0fc3['transfereeuniqueid']]['transfer']=!![];queues[_0x3f0fc3[_0x994a('0x42')]][_0x994a('0x43')]='BLIND';queues[_0x3f0fc3[_0x994a('0x42')]][_0x994a('0x44')]=_0x3f0fc3['extension'];queues[_0x3f0fc3['transfereeuniqueid']][_0x994a('0x45')]=_0x3f0fc3[_0x994a('0x42')];queues[_0x3f0fc3[_0x994a('0x42')]][_0x994a('0x7')]=_0x994a('0x46');utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x47'),_0x3f0fc3['uniqueid'],queues[_0x3f0fc3[_0x994a('0x42')]][_0x994a('0x1c')],_0x3f0fc3[_0x994a('0x42')],_0x3f0fc3[_0x994a('0x48')]));}}catch(_0x1d9bbf){utils['error'](util[_0x994a('0x1')](_0x994a('0x49'),_0x3f0fc3[_0x994a('0xc')]),_0x1d9bbf);}};exports['attendedtransfer']=function(_0x579ced){try{utils[_0x994a('0xe')](util[_0x994a('0x1')]('[%s][queues][attendedtransfer]',_0x579ced[_0x994a('0x4a')]),_0x579ced);if(_0x579ced[_0x994a('0x4a')]==_0x579ced[_0x994a('0x4b')]){if(!_[_0x994a('0x14')](queues[_0x579ced['secondtransfererlinkedid']])){utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x4c'),_0x579ced['origtransfereruniqueid'],queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x1c')],_0x579ced[_0x994a('0x4e')]));queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x3e')]=!![];queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x43')]=_0x994a('0x4f');queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x44')]=_0x579ced['origtransfererexten'];queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x45')]=_0x579ced[_0x994a('0x4a')];queues[_0x579ced['secondtransfererlinkedid']][_0x994a('0x7')]=_0x994a('0x50');}if(!_[_0x994a('0x14')](queues[_0x579ced[_0x994a('0x4b')]])){if(_0x579ced['transfereelinkedid']&&queues[_0x579ced[_0x994a('0x51')]]){queues[_0x579ced['transfereelinkedid']][_0x994a('0x1d')]=0x1;queues[_0x579ced[_0x994a('0x42')]]=_[_0x994a('0x52')](queues[_0x579ced[_0x994a('0x51')]]);queues[_0x579ced[_0x994a('0x42')]][_0x994a('0xb')]=_0x579ced[_0x994a('0x53')];queues[_0x579ced['transfereeuniqueid']][_0x994a('0x1d')]=0x2;queues[_0x579ced[_0x994a('0x42')]][_0x994a('0x5')]=queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x5')];queues[_0x579ced['transfereeuniqueid']][_0x994a('0x54')]=queues[_0x579ced['secondtransfererlinkedid']][_0x994a('0x54')];queues[_0x579ced[_0x994a('0x42')]][_0x994a('0x31')]=utils[_0x994a('0x26')]();queues[_0x579ced[_0x994a('0x42')]][_0x994a('0x16')]=utils['now']();queues[_0x579ced[_0x994a('0x42')]][_0x994a('0x2f')]=0x0;queues[_0x579ced['transfereeuniqueid']]['mohtime']=0x0;utils['info'](util[_0x994a('0x1')](_0x994a('0x55'),_0x579ced[_0x994a('0x4a')],queues[_0x579ced[_0x994a('0x42')]]['name'],queues[_0x579ced[_0x994a('0x42')]]['calleridnum'],queues[_0x579ced[_0x994a('0x42')]][_0x994a('0x54')]));}else{utils[_0x994a('0x0')](util['format'](_0x994a('0x56'),_0x579ced[_0x994a('0x4a')],queues[_0x579ced[_0x994a('0x4b')]][_0x994a('0x1c')],_0x579ced['secondtransfererlinkedid']));queues[_0x579ced['origtransfererlinkedid']][_0x994a('0xb')]=_0x579ced[_0x994a('0x4d')];}}}else if(_0x579ced[_0x994a('0x57')]==_0x579ced[_0x994a('0x4d')]){if(!_[_0x994a('0x14')](queues[_0x579ced[_0x994a('0x4b')]])){utils[_0x994a('0x0')](util['format'](_0x994a('0x58'),_0x579ced['origtransfereruniqueid'],queues[_0x579ced[_0x994a('0x4b')]]['name'],_0x579ced[_0x994a('0x57')],_0x579ced[_0x994a('0x59')]));queues[_0x579ced['origtransfererlinkedid']]['transfer']=!![];queues[_0x579ced[_0x994a('0x4b')]][_0x994a('0x43')]='ATTENDED';queues[_0x579ced[_0x994a('0x4b')]][_0x994a('0x44')]=_0x579ced[_0x994a('0x59')];queues[_0x579ced['origtransfererlinkedid']][_0x994a('0x45')]=_0x579ced[_0x994a('0x57')];queues[_0x579ced[_0x994a('0x4b')]][_0x994a('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x994a('0x14')](queues[_0x579ced[_0x994a('0x4d')]])){if(_0x579ced['transfertargetlinkedid']&&queues[_0x579ced[_0x994a('0x5a')]]){queues[_0x579ced[_0x994a('0x5a')]][_0x994a('0x1d')]=0x1;queues[_0x579ced[_0x994a('0x53')]]=_[_0x994a('0x52')](queues[_0x579ced[_0x994a('0x5a')]]);queues[_0x579ced[_0x994a('0x53')]][_0x994a('0xb')]=_0x579ced['transfertargetuniqueid'];queues[_0x579ced[_0x994a('0x53')]]['queuecallerenterreason']=0x2;queues[_0x579ced['transfertargetuniqueid']][_0x994a('0x5')]=queues[_0x579ced[_0x994a('0x4b')]][_0x994a('0x5')];queues[_0x579ced[_0x994a('0x53')]][_0x994a('0x54')]=queues[_0x579ced[_0x994a('0x4b')]]['calleridname'];queues[_0x579ced['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x994a('0x26')]();queues[_0x579ced['transfertargetuniqueid']][_0x994a('0x16')]=utils[_0x994a('0x26')]();queues[_0x579ced[_0x994a('0x53')]][_0x994a('0x2f')]=0x0;queues[_0x579ced[_0x994a('0x53')]][_0x994a('0x5b')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x579ced['origtransfereruniqueid'],queues[_0x579ced[_0x994a('0x53')]][_0x994a('0x1c')],queues[_0x579ced['transfertargetuniqueid']][_0x994a('0xb')],queues[_0x579ced[_0x994a('0x53')]][_0x994a('0x5')],queues[_0x579ced['transfertargetuniqueid']][_0x994a('0x54')]));}else{utils[_0x994a('0x0')](util[_0x994a('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x579ced['origtransfereruniqueid'],queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0x1c')],_0x579ced[_0x994a('0x4b')]));queues[_0x579ced[_0x994a('0x4d')]][_0x994a('0xb')]=_0x579ced[_0x994a('0x4b')];}}}}catch(_0x7025e2){utils['error'](util[_0x994a('0x1')](_0x994a('0x5c'),_0x579ced[_0x994a('0x4a')]),_0x7025e2);}};exports['musiconholdstart']=function(_0x3193e2){try{if(!_[_0x994a('0x14')](queues[_0x3193e2['uniqueid']])){utils['debug'](util[_0x994a('0x1')](_0x994a('0x5d'),_0x3193e2['uniqueid']),_0x3193e2);queues[_0x3193e2['uniqueid']][_0x994a('0x5e')]=utils['now']();utils[_0x994a('0x0')](util[_0x994a('0x1')](_0x994a('0x5f'),_0x3193e2[_0x994a('0xc')],queues[_0x3193e2['uniqueid']]['name'],queues[_0x3193e2[_0x994a('0xc')]][_0x994a('0x5e')]));}}catch(_0x161296){utils[_0x994a('0x12')](util[_0x994a('0x1')]('[%s][queues][musiconholdstart]',_0x3193e2[_0x994a('0xc')]),_0x161296);}};exports[_0x994a('0x60')]=function(_0x2134a9){try{if(!_[_0x994a('0x14')](queues[_0x2134a9[_0x994a('0xc')]])){if(!_[_0x994a('0x14')](queues[_0x2134a9['uniqueid']][_0x994a('0x5e')])){utils[_0x994a('0xe')](util['format'](_0x994a('0x61'),_0x2134a9[_0x994a('0xc')]),_0x2134a9);queues[_0x2134a9[_0x994a('0xc')]]['mohtime']+=utils[_0x994a('0x30')](utils['now'](),queues[_0x2134a9[_0x994a('0xc')]]['musiconholdstartAt']);utils[_0x994a('0x0')](util['format'](_0x994a('0x62'),_0x2134a9[_0x994a('0xc')],queues[_0x2134a9[_0x994a('0xc')]][_0x994a('0x1c')],queues[_0x2134a9[_0x994a('0xc')]][_0x994a('0x5b')]));delete queues[_0x2134a9['uniqueid']][_0x994a('0x5e')];}}}catch(_0x20953e){utils[_0x994a('0x12')](util[_0x994a('0x1')]('[%s][queues][musiconholdstop]',_0x2134a9[_0x994a('0xc')]),_0x20953e);}}; \ No newline at end of file +var _0xa23c=['agentcomplete','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','[%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','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned'];(function(_0x57d326,_0x20c3ff){var _0xf8aa25=function(_0x269a5d){while(--_0x269a5d){_0x57d326['push'](_0x57d326['shift']());}};_0xf8aa25(++_0x20c3ff);}(_0xa23c,0xfc));var _0xca23=function(_0x531a41,_0x508134){_0x531a41=_0x531a41-0x0;var _0x2d0c3b=_0xa23c[_0x531a41];return _0x2d0c3b;};'use strict';var _=require(_0xca23('0x0'));var util=require('util');var utils=require(_0xca23('0x1'));var queues={};function writeDB(_0x4ae841){utils[_0xca23('0x2')](util[_0xca23('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4ae841[_0xca23('0x4')],_0x4ae841[_0xca23('0x5')],_0x4ae841[_0xca23('0x6')],_0x4ae841[_0xca23('0x7')],_0x4ae841[_0xca23('0x8')],_0x4ae841[_0xca23('0x9')],_0x4ae841['queuecallerexitreason']));if(_0x4ae841['queue']){utils['getVoiceQueueByName'](_0x4ae841['queue'])[_0xca23('0xa')](function(_0x490de2){if(_0x490de2){_0x4ae841[_0xca23('0xb')]=_0x490de2[_0xca23('0xb')];}utils[_0xca23('0xc')](_0xca23('0xd'),_0x4ae841);});}else{utils['request'](_0xca23('0xd'),_0x4ae841);}if(_0x4ae841['transfereduniqueid']){delete queues[_0x4ae841[_0xca23('0xe')]];}else{delete queues[_0x4ae841[_0xca23('0x4')]];}}exports['queuecallerjoin']=function(_0x3e6e66){try{utils[_0xca23('0xf')](util[_0xca23('0x3')](_0xca23('0x10'),_0x3e6e66[_0xca23('0x4')]),_0x3e6e66);utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x11'),_0x3e6e66[_0xca23('0x4')],_0x3e6e66['queue'],_0x3e6e66[_0xca23('0x12')]));queues[_0x3e6e66[_0xca23('0x4')]]=_[_0xca23('0x13')](_0x3e6e66,{'originalposition':_0x3e6e66[_0xca23('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x320275){utils[_0xca23('0x14')](util[_0xca23('0x3')]('[%s][queues][queuecallerjoin]',_0x3e6e66[_0xca23('0x4')]),_0x320275);}};exports[_0xca23('0x15')]=function(_0x51b5da){try{if(!_['isNil'](queues[_0x51b5da[_0xca23('0x4')]])){utils['debug'](util[_0xca23('0x3')]('[%s][queues][hangup]',_0x51b5da['uniqueid']),_0x51b5da);if(queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x16')]){if(!queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x17')]&&!queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x18')]){queues[_0x51b5da[_0xca23('0x4')]]['queuecallercomplete']=!![];queues[_0x51b5da['uniqueid']]['queuecallercompleteAt']=utils[_0xca23('0x19')]();queues[_0x51b5da['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x1a'),_0x51b5da['uniqueid'],queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x1b')],queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x1c')]));writeDB(queues[_0x51b5da[_0xca23('0x4')]]);}else if(queues[_0x51b5da[_0xca23('0x4')]]['transfereduniqueid']){utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x1d'),_0x51b5da['uniqueid'],queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0x1b')],queues[_0x51b5da[_0xca23('0x4')]]['transfereduniqueid']));queues[queues[_0x51b5da['uniqueid']][_0xca23('0xe')]]=queues[_0x51b5da[_0xca23('0x4')]];queues[queues[_0x51b5da[_0xca23('0x4')]][_0xca23('0xe')]][_0xca23('0x1e')]=0x2;delete queues[_0x51b5da[_0xca23('0x4')]];}}}catch(_0x4eb8da){utils[_0xca23('0x14')](util[_0xca23('0x3')](_0xca23('0x1f'),_0x51b5da[_0xca23('0x4')]),_0x4eb8da);}};exports[_0xca23('0x20')]=function(_0x49ad48){try{utils[_0xca23('0xf')](util[_0xca23('0x3')](_0xca23('0x21'),_0x49ad48['uniqueid']),_0x49ad48);if(!_[_0xca23('0x22')](_0x49ad48[_0xca23('0x23')][_0xca23('0x24')])&&_0x49ad48[_0xca23('0x25')][_0xca23('0x26')]()!==_0xca23('0x27')){if(!_['isNil'](queues[_0x49ad48[_0xca23('0x4')]])){queues[_0x49ad48[_0xca23('0x4')]]['queuecallerabandon']=![];queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x28')]=null;queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x18')]=!![];queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x29')]=utils['now']();queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x1c')]=_0x49ad48['value'][_0xca23('0x26')]();utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x2a'),_0x49ad48['uniqueid'],queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x1b')],_0x49ad48['value'],queues[_0x49ad48[_0xca23('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x49ad48[_0xca23('0x4')]]);}}else if(!_[_0xca23('0x22')](_0x49ad48[_0xca23('0x23')][_0xca23('0x2b')])){if(!_[_0xca23('0x22')](queues[_0x49ad48[_0xca23('0x4')]])&&!queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x17')]){queues[_0x49ad48[_0xca23('0x4')]][_0xca23('0x17')]=![];queues[_0x49ad48[_0xca23('0x4')]]['queuecallerabandonAt']=null;queues[_0x49ad48[_0xca23('0x4')]]['queuecallerexit']=!![];queues[_0x49ad48[_0xca23('0x4')]]['queuecallerexitAt']=utils[_0xca23('0x19')]();queues[_0x49ad48['uniqueid']][_0xca23('0x1c')]=_0xca23('0x2c');utils[_0xca23('0x2')](util['format'](_0xca23('0x2d'),_0x49ad48[_0xca23('0x4')],queues[_0x49ad48['uniqueid']]['name'],_0x49ad48[_0xca23('0x25')],queues[_0x49ad48['uniqueid']]['queuecallerexitreason']));}}}catch(_0x58b3ec){utils[_0xca23('0x14')](util[_0xca23('0x3')](_0xca23('0x21'),_0x49ad48['uniqueid']),_0x58b3ec);}};exports[_0xca23('0x17')]=function(_0x9e8adf){try{if(!_['isNil'](queues[_0x9e8adf[_0xca23('0x4')]])){utils[_0xca23('0xf')](util[_0xca23('0x3')](_0xca23('0x2e'),_0x9e8adf[_0xca23('0x4')]),_0x9e8adf);queues[_0x9e8adf[_0xca23('0x4')]][_0xca23('0x18')]=![];queues[_0x9e8adf['uniqueid']]['queuecallerexitAt']=null;queues[_0x9e8adf[_0xca23('0x4')]][_0xca23('0x17')]=!![];queues[_0x9e8adf[_0xca23('0x4')]][_0xca23('0x28')]=utils[_0xca23('0x19')]();queues[_0x9e8adf[_0xca23('0x4')]]['queuecallerexitreason']=_0xca23('0x2f');utils['info'](util['format'](_0xca23('0x30'),_0x9e8adf['uniqueid'],queues[_0x9e8adf[_0xca23('0x4')]][_0xca23('0x1b')],queues[_0x9e8adf[_0xca23('0x4')]][_0xca23('0x1c')]));}}catch(_0x47d7a8){utils[_0xca23('0x14')](util[_0xca23('0x3')](_0xca23('0x2e'),_0x9e8adf['uniqueid']),_0x47d7a8);}};exports['queuecallerleave']=function(_0x5d59cd){try{if(!_['isNil'](queues[_0x5d59cd['uniqueid']])){utils[_0xca23('0xf')](util[_0xca23('0x3')](_0xca23('0x31'),_0x5d59cd[_0xca23('0x4')]),_0x5d59cd);utils[_0xca23('0x2')](util['format'](_0xca23('0x32'),_0x5d59cd[_0xca23('0x4')],queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x1b')],_0x5d59cd['connectedlinenum'],_0x5d59cd[_0xca23('0x33')]));queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x34')]=!![];queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x16')]=utils[_0xca23('0x19')]();queues[_0x5d59cd['uniqueid']][_0xca23('0x35')]=utils[_0xca23('0x36')](queues[_0x5d59cd[_0xca23('0x4')]]['queuecallerleaveAt'],queues[_0x5d59cd['uniqueid']][_0xca23('0x37')]);queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x12')]=_0x5d59cd[_0xca23('0x12')];queues[_0x5d59cd[_0xca23('0x4')]]['count']=_0x5d59cd[_0xca23('0x38')];queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x39')]=_0x5d59cd['connectedlinenum'];queues[_0x5d59cd[_0xca23('0x4')]][_0xca23('0x33')]=_0x5d59cd[_0xca23('0x33')];}}catch(_0x27c087){utils[_0xca23('0x14')](util[_0xca23('0x3')](_0xca23('0x31'),_0x5d59cd[_0xca23('0x4')]),_0x27c087);}};exports[_0xca23('0x3a')]=function(_0x5100db){try{if(!_[_0xca23('0x22')](queues[_0x5100db[_0xca23('0x4')]])){utils['debug'](util[_0xca23('0x3')](_0xca23('0x3b'),_0x5100db[_0xca23('0x4')]),_0x5100db);utils[_0xca23('0x2')](util[_0xca23('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5100db[_0xca23('0x4')],queues[_0x5100db[_0xca23('0x4')]]['name'],_0x5100db[_0xca23('0x3c')],_0x5100db[_0xca23('0x3d')]));queues[_0x5100db['uniqueid']][_0xca23('0x17')]=![];queues[_0x5100db['uniqueid']]['queuecallerabandon']=![];queues[_0x5100db[_0xca23('0x4')]][_0xca23('0x28')]=null;queues[_0x5100db[_0xca23('0x4')]]['queuecallerexit']=![];queues[_0x5100db['uniqueid']]['queuecallerexitreason']=null;queues[_0x5100db[_0xca23('0x4')]]['queuecallerexitAt']=null;queues[_0x5100db[_0xca23('0x4')]][_0xca23('0x3e')]=!![];queues[_0x5100db['uniqueid']]['accountcode']=_0x5100db[_0xca23('0x3d')];queues[_0x5100db[_0xca23('0x4')]][_0xca23('0x7')]=_0x5100db[_0xca23('0x3c')];}}catch(_0x3ef4eb){utils['error'](util[_0xca23('0x3')](_0xca23('0x3b'),_0x5100db[_0xca23('0x4')]),_0x3ef4eb);}};exports[_0xca23('0x3f')]=function(_0xa42179){try{if(!_['isNil'](queues[_0xa42179['uniqueid']])){if(queues[_0xa42179['uniqueid']][_0xca23('0x16')]){utils[_0xca23('0xf')](util[_0xca23('0x3')]('[%s][queues][agentcomplete]',_0xa42179[_0xca23('0x4')]),_0xa42179);queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x17')]=![];queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x17')]=![];queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x28')]=null;queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x18')]=![];queues[_0xa42179[_0xca23('0x4')]]['queuecallerexitAt']=null;queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x3e')]=!![];queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x7')]=_0xa42179['membername'];queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x40')]=!![];queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x41')]=utils[_0xca23('0x19')]();if(_0xa42179[_0xca23('0x42')]=='transfer'){if(!queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x43')]){queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x1c')]=_0xca23('0x44');}}else{queues[_0xa42179['uniqueid']][_0xca23('0x1c')]='COMPLETEDBY'+_0xa42179[_0xca23('0x42')][_0xca23('0x26')]();}utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x45'),_0xa42179['uniqueid'],queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x1b')],_0xa42179[_0xca23('0x3c')],queues[_0xa42179[_0xca23('0x4')]][_0xca23('0x1c')]));writeDB(queues[_0xa42179[_0xca23('0x4')]]);}}}catch(_0x900a2){utils[_0xca23('0x14')](util['format'](_0xca23('0x46'),_0xa42179[_0xca23('0x4')]),_0x900a2);}};exports['blindtransfer']=function(_0x4de81c){try{if(!_[_0xca23('0x22')](queues[_0x4de81c[_0xca23('0x47')]])){utils['debug'](util[_0xca23('0x3')](_0xca23('0x48'),_0x4de81c[_0xca23('0x4')]),_0x4de81c);queues[_0x4de81c['transfereeuniqueid']]['transfer']=!![];queues[_0x4de81c[_0xca23('0x47')]][_0xca23('0x49')]=_0xca23('0x4a');queues[_0x4de81c[_0xca23('0x47')]]['transferexten']=_0x4de81c[_0xca23('0x4b')];queues[_0x4de81c[_0xca23('0x47')]]['transferuniqueid']=_0x4de81c[_0xca23('0x47')];queues[_0x4de81c[_0xca23('0x47')]][_0xca23('0x1c')]='BLINDTRANSFER';utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x4c'),_0x4de81c[_0xca23('0x4')],queues[_0x4de81c[_0xca23('0x47')]][_0xca23('0x1b')],_0x4de81c[_0xca23('0x47')],_0x4de81c['extension']));}}catch(_0x55ecd6){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x4de81c['uniqueid']),_0x55ecd6);}};exports[_0xca23('0x4d')]=function(_0x50440c){try{utils['debug'](util[_0xca23('0x3')](_0xca23('0x4e'),_0x50440c[_0xca23('0x4f')]),_0x50440c);if(_0x50440c['origtransfereruniqueid']==_0x50440c[_0xca23('0x50')]){if(!_['isNil'](queues[_0x50440c['secondtransfererlinkedid']])){utils[_0xca23('0x2')](util['format'](_0xca23('0x51'),_0x50440c[_0xca23('0x4f')],queues[_0x50440c['secondtransfererlinkedid']]['name'],_0x50440c[_0xca23('0x52')]));queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x43')]=!![];queues[_0x50440c['secondtransfererlinkedid']][_0xca23('0x49')]=_0xca23('0x54');queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x55')]=_0x50440c[_0xca23('0x52')];queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x56')]=_0x50440c[_0xca23('0x4f')];queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x1c')]=_0xca23('0x57');}if(!_['isNil'](queues[_0x50440c[_0xca23('0x50')]])){if(_0x50440c[_0xca23('0x58')]&&queues[_0x50440c['transfereelinkedid']]){queues[_0x50440c[_0xca23('0x58')]][_0xca23('0x1e')]=0x1;queues[_0x50440c[_0xca23('0x47')]]=_[_0xca23('0x59')](queues[_0x50440c[_0xca23('0x58')]]);queues[_0x50440c[_0xca23('0x47')]][_0xca23('0xe')]=_0x50440c['transfertargetuniqueid'];queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x1e')]=0x2;queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x8')]=queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x8')];queues[_0x50440c['transfereeuniqueid']][_0xca23('0x5a')]=queues[_0x50440c[_0xca23('0x53')]][_0xca23('0x5a')];queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x37')]=utils[_0xca23('0x19')]();queues[_0x50440c['transfereeuniqueid']][_0xca23('0x16')]=utils[_0xca23('0x19')]();queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x35')]=0x0;queues[_0x50440c['transfereeuniqueid']][_0xca23('0x5b')]=0x0;utils[_0xca23('0x2')](util[_0xca23('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x50440c['origtransfereruniqueid'],queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x1b')],queues[_0x50440c['transfereeuniqueid']]['calleridnum'],queues[_0x50440c[_0xca23('0x47')]][_0xca23('0x5a')]));}else{utils['info'](util[_0xca23('0x3')](_0xca23('0x5c'),_0x50440c['origtransfereruniqueid'],queues[_0x50440c[_0xca23('0x50')]][_0xca23('0x1b')],_0x50440c['secondtransfererlinkedid']));queues[_0x50440c[_0xca23('0x50')]][_0xca23('0xe')]=_0x50440c[_0xca23('0x53')];}}}else if(_0x50440c[_0xca23('0x5d')]==_0x50440c[_0xca23('0x53')]){if(!_[_0xca23('0x22')](queues[_0x50440c[_0xca23('0x50')]])){utils[_0xca23('0x2')](util[_0xca23('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x50440c[_0xca23('0x4f')],queues[_0x50440c[_0xca23('0x50')]]['name'],_0x50440c[_0xca23('0x5d')],_0x50440c[_0xca23('0x5e')]));queues[_0x50440c[_0xca23('0x50')]][_0xca23('0x43')]=!![];queues[_0x50440c[_0xca23('0x50')]][_0xca23('0x49')]=_0xca23('0x54');queues[_0x50440c['origtransfererlinkedid']][_0xca23('0x55')]=_0x50440c[_0xca23('0x5e')];queues[_0x50440c[_0xca23('0x50')]]['transferuniqueid']=_0x50440c['secondtransfereruniqueid'];queues[_0x50440c['origtransfererlinkedid']][_0xca23('0x1c')]=_0xca23('0x57');}if(!_[_0xca23('0x22')](queues[_0x50440c['secondtransfererlinkedid']])){if(_0x50440c[_0xca23('0x5f')]&&queues[_0x50440c[_0xca23('0x5f')]]){queues[_0x50440c[_0xca23('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x50440c[_0xca23('0x60')]]=_[_0xca23('0x59')](queues[_0x50440c[_0xca23('0x5f')]]);queues[_0x50440c[_0xca23('0x60')]][_0xca23('0xe')]=_0x50440c['transfertargetuniqueid'];queues[_0x50440c[_0xca23('0x60')]][_0xca23('0x1e')]=0x2;queues[_0x50440c[_0xca23('0x60')]][_0xca23('0x8')]=queues[_0x50440c['origtransfererlinkedid']][_0xca23('0x8')];queues[_0x50440c['transfertargetuniqueid']][_0xca23('0x5a')]=queues[_0x50440c['origtransfererlinkedid']][_0xca23('0x5a')];queues[_0x50440c['transfertargetuniqueid']][_0xca23('0x37')]=utils[_0xca23('0x19')]();queues[_0x50440c[_0xca23('0x60')]][_0xca23('0x16')]=utils[_0xca23('0x19')]();queues[_0x50440c[_0xca23('0x60')]]['holdtime']=0x0;queues[_0x50440c[_0xca23('0x60')]][_0xca23('0x5b')]=0x0;utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x61'),_0x50440c['origtransfereruniqueid'],queues[_0x50440c['transfertargetuniqueid']][_0xca23('0x1b')],queues[_0x50440c[_0xca23('0x60')]][_0xca23('0xe')],queues[_0x50440c[_0xca23('0x60')]][_0xca23('0x8')],queues[_0x50440c['transfertargetuniqueid']][_0xca23('0x5a')]));}else{utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x5c'),_0x50440c['origtransfereruniqueid'],queues[_0x50440c[_0xca23('0x53')]]['name'],_0x50440c[_0xca23('0x50')]));queues[_0x50440c[_0xca23('0x53')]][_0xca23('0xe')]=_0x50440c[_0xca23('0x50')];}}}}catch(_0x2c7796){utils[_0xca23('0x14')](util['format'](_0xca23('0x4e'),_0x50440c[_0xca23('0x4f')]),_0x2c7796);}};exports[_0xca23('0x62')]=function(_0x4841db){try{if(!_[_0xca23('0x22')](queues[_0x4841db[_0xca23('0x4')]])){utils[_0xca23('0xf')](util['format'](_0xca23('0x63'),_0x4841db['uniqueid']),_0x4841db);queues[_0x4841db[_0xca23('0x4')]][_0xca23('0x64')]=utils[_0xca23('0x19')]();utils['info'](util[_0xca23('0x3')](_0xca23('0x65'),_0x4841db[_0xca23('0x4')],queues[_0x4841db['uniqueid']][_0xca23('0x1b')],queues[_0x4841db[_0xca23('0x4')]][_0xca23('0x64')]));}}catch(_0x442f55){utils[_0xca23('0x14')](util['format']('[%s][queues][musiconholdstart]',_0x4841db['uniqueid']),_0x442f55);}};exports[_0xca23('0x66')]=function(_0xae35c2){try{if(!_['isNil'](queues[_0xae35c2[_0xca23('0x4')]])){if(!_['isNil'](queues[_0xae35c2[_0xca23('0x4')]][_0xca23('0x64')])){utils[_0xca23('0xf')](util['format']('[%s][queues][musiconholdstop]',_0xae35c2['uniqueid']),_0xae35c2);queues[_0xae35c2[_0xca23('0x4')]][_0xca23('0x5b')]+=utils['diffTime'](utils[_0xca23('0x19')](),queues[_0xae35c2[_0xca23('0x4')]][_0xca23('0x64')]);utils[_0xca23('0x2')](util[_0xca23('0x3')](_0xca23('0x67'),_0xae35c2[_0xca23('0x4')],queues[_0xae35c2[_0xca23('0x4')]][_0xca23('0x1b')],queues[_0xae35c2[_0xca23('0x4')]][_0xca23('0x5b')]));delete queues[_0xae35c2[_0xca23('0x4')]]['musiconholdstartAt'];}}}catch(_0x44f5f1){utils[_0xca23('0x14')](util[_0xca23('0x3')](_0xca23('0x68'),_0xae35c2['uniqueid']),_0x44f5f1);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 61a0495..ec97b78 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 _0x0116=['isNil','channelstate','linkedid','context','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','error','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','info','exten','channel','newstate','[%s][recordings][newstate]'];(function(_0x2d90b3,_0x23647c){var _0x492d18=function(_0x37f39f){while(--_0x37f39f){_0x2d90b3['push'](_0x2d90b3['shift']());}};_0x492d18(++_0x23647c);}(_0x0116,0x1cd));var _0x6011=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0116[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x6011('0x0'));var util=require(_0x6011('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x505740){var _0x35e400;utils['info'](util[_0x6011('0x2')](_0x6011('0x3'),_0x505740[_0x6011('0x4')]));if(transfers[_0x6011('0x5')][_0x505740[_0x6011('0x4')]]){_0x35e400=_0x505740[_0x6011('0x4')];_0x505740['uniqueid']=transfers[_0x6011('0x5')][_0x505740[_0x6011('0x4')]][_0x6011('0x6')];}if(_0x505740[_0x6011('0x7')]){utils[_0x6011('0x8')](_0x505740[_0x6011('0x7')])[_0x6011('0x9')](function(_0x3841d3){if(_0x3841d3){_0x505740[_0x6011('0xa')]=_0x3841d3[_0x6011('0xb')];_0x505740[_0x6011('0xc')]=_0x3841d3['id'];}utils['request'](_0x6011('0xd'),_0x505740);});}else{utils['request'](_0x6011('0xd'),_0x505740);}if(_0x35e400)delete transfers[_0x6011('0x5')][_0x35e400];}exports[_0x6011('0xe')]=function(_0x547105){try{utils[_0x6011('0xf')](util[_0x6011('0x2')](_0x6011('0x10'),_0x547105[_0x6011('0x4')]),_0x547105);if(_0x547105[_0x6011('0x4')]==_0x547105['linkedid']){utils[_0x6011('0x11')](util[_0x6011('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x547105[_0x6011('0x4')],_0x547105['context'],_0x547105[_0x6011('0x12')]));recordings[_0x547105[_0x6011('0x4')]]={'uniqueid':_0x547105[_0x6011('0x4')],'accountcode':_0x547105[_0x6011('0x7')],'exten':_0x547105[_0x6011('0x12')],'context':_0x547105['context'],'channel':_0x547105[_0x6011('0x13')],'monitors':[]};}}catch(_0x25effd){utils['error'](util[_0x6011('0x2')](_0x6011('0x10'),_0x547105[_0x6011('0x4')]),_0x25effd);}};exports[_0x6011('0x14')]=function(_0x3b358c){try{utils['debug'](util[_0x6011('0x2')](_0x6011('0x15'),_0x3b358c[_0x6011('0x4')]),_0x3b358c);if(!_[_0x6011('0x16')](recordings[_0x3b358c[_0x6011('0x4')]])&&_0x3b358c[_0x6011('0x17')]==0x6){utils[_0x6011('0x11')](util[_0x6011('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3b358c['uniqueid'],_0x3b358c['context'],_0x3b358c[_0x6011('0x13')]));}else if(!_['isNil'](recordings[_0x3b358c[_0x6011('0x18')]])&&_0x3b358c['channelstate']==0x6&&_0x3b358c[_0x6011('0x19')]!=_0x6011('0x1a')){utils[_0x6011('0x11')](util[_0x6011('0x2')](_0x6011('0x1b'),_0x3b358c[_0x6011('0x4')],_0x3b358c['linkedid'],_0x3b358c[_0x6011('0x19')],_0x3b358c[_0x6011('0x13')]));recordings[_0x3b358c[_0x6011('0x18')]][_0x6011('0x7')]=_0x3b358c[_0x6011('0x7')];}}catch(_0x5da02d){utils['error'](util[_0x6011('0x2')](_0x6011('0x15'),_0x3b358c[_0x6011('0x4')]),_0x5da02d);}};exports['varset']=function(_0x38eed1){try{if(!_[_0x6011('0x16')](_0x38eed1[_0x6011('0x1c')])&&!_[_0x6011('0x16')](_0x38eed1[_0x6011('0x1c')]['mixmonitor_filename'])){utils[_0x6011('0xf')](util['format'](_0x6011('0x1d'),_0x38eed1[_0x6011('0x4')]),_0x38eed1);utils['info'](util[_0x6011('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x38eed1[_0x6011('0x4')],_0x38eed1[_0x6011('0x1c')],_0x38eed1[_0x6011('0x1e')]));if(_[_0x6011('0x1f')](_0x38eed1[_0x6011('0x1e')],_0x6011('0x20'))){_0x38eed1['value']=_0x38eed1[_0x6011('0x1e')][_0x6011('0x21')](_0x6011('0x20'),_0x6011('0x22'));}if(recordings[_0x38eed1[_0x6011('0x18')]]){var _0x12e217=_[_0x6011('0x23')](recordings[_0x38eed1['linkedid']][_0x6011('0x24')],{'value':_0x38eed1[_0x6011('0x1e')]});if(_[_0x6011('0x16')](_0x12e217)){recordings[_0x38eed1[_0x6011('0x18')]]['monitors']['push']({'value':_0x38eed1[_0x6011('0x1e')]});}}}}catch(_0x2df471){utils['error'](util['format'](_0x6011('0x1d'),_0x38eed1[_0x6011('0x4')]),_0x2df471);}};exports['hangup']=function(_0x3401ea){try{if(!_['isNil'](recordings[_0x3401ea[_0x6011('0x4')]])){utils['debug'](util[_0x6011('0x2')](_0x6011('0x25'),_0x3401ea[_0x6011('0x4')]),_0x3401ea);utils['info'](util[_0x6011('0x2')](_0x6011('0x26'),_0x3401ea[_0x6011('0x4')],_0x3401ea[_0x6011('0x27')],_0x3401ea['calleridname'],_0x3401ea[_0x6011('0x28')]));recordings[_0x3401ea['uniqueid']][_0x6011('0x27')]=_0x3401ea[_0x6011('0x27')];recordings[_0x3401ea['uniqueid']]['calleridname']=_0x3401ea[_0x6011('0x29')];recordings[_0x3401ea[_0x6011('0x4')]][_0x6011('0x2a')]=_0x3401ea[_0x6011('0x2a')];recordings[_0x3401ea['uniqueid']][_0x6011('0x2b')]=_0x3401ea[_0x6011('0x2b')];if(recordings[_0x3401ea['uniqueid']][_0x6011('0x2c')]==_0x6011('0x2d')&&recordings[_0x3401ea[_0x6011('0x4')]][_0x6011('0x7')]){recordings[_0x3401ea[_0x6011('0x4')]]['connectedlinenum']=recordings[_0x3401ea[_0x6011('0x4')]][_0x6011('0x7')];recordings[_0x3401ea['uniqueid']][_0x6011('0x2b')]='';}recordings[_0x3401ea[_0x6011('0x4')]][_0x6011('0x24')]['forEach'](function(_0x408708){var _0x4d5865=_[_0x6011('0x2e')](recordings[_0x3401ea[_0x6011('0x4')]]);_0x4d5865[_0x6011('0x1e')]=_0x408708[_0x6011('0x1e')];writeDB(_0x4d5865);});delete recordings[_0x3401ea[_0x6011('0x4')]];}}catch(_0x1877cc){utils['error'](util[_0x6011('0x2')]('[%s][recordings][hangup]',_0x3401ea['uniqueid']),_0x1877cc);}};exports[_0x6011('0x2f')]=function(_0x54f7c6){try{if(!_[_0x6011('0x16')](recordings[_0x54f7c6[_0x6011('0x4')]])){utils[_0x6011('0xf')](util['format'](_0x6011('0x30'),_0x54f7c6[_0x6011('0x4')]),_0x54f7c6);utils[_0x6011('0x11')](util['format'](_0x6011('0x31'),_0x54f7c6[_0x6011('0x4')],_0x54f7c6[_0x6011('0x32')],_0x54f7c6[_0x6011('0x33')]));if(_0x54f7c6[_0x6011('0x32')][_0x6011('0x34')]()=='set'&&_[_0x6011('0x35')](_0x54f7c6['appdata']['toLowerCase'](),_0x6011('0x36'))){var _0x3739f1=_0x54f7c6[_0x6011('0x33')]['split']('=');var _0x40a32b=_0x3739f1[0x0][_0x6011('0x37')](_0x3739f1[0x0][_0x6011('0x38')]('(')+0x1,_0x3739f1[0x0][_0x6011('0x38')](')'));var _0x1a030c=_0x3739f1[0x1];recordings[_0x54f7c6[_0x6011('0x4')]][_0x40a32b]=_0x1a030c;}}}catch(_0x2e8836){utils[_0x6011('0x39')](util[_0x6011('0x2')](_0x6011('0x30'),_0x54f7c6[_0x6011('0x4')]),_0x2e8836);}};exports['queuecallerjoin']=function(_0x22e92c){try{if(!_[_0x6011('0x16')](recordings[_0x22e92c['uniqueid']])){utils['debug'](util[_0x6011('0x2')]('[%s][recordings][queuecallerjoin]',_0x22e92c[_0x6011('0x4')]),_0x22e92c);utils[_0x6011('0x11')](util[_0x6011('0x2')](_0x6011('0x3a'),_0x22e92c[_0x6011('0x4')],_0x22e92c[_0x6011('0x3b')]));recordings[_0x22e92c[_0x6011('0x4')]]['queue']=_0x22e92c[_0x6011('0x3b')];}}catch(_0x2dfb95){utils[_0x6011('0x39')](util[_0x6011('0x2')](_0x6011('0x3c'),_0x22e92c[_0x6011('0x4')]),_0x2dfb95);}};exports[_0x6011('0x3d')]=function(_0x3afe9e){try{utils['debug'](util['format'](_0x6011('0x3e'),_0x3afe9e[_0x6011('0x4')]),_0x3afe9e);utils[_0x6011('0x11')](util['format'](_0x6011('0x3f'),_0x3afe9e['uniqueid'],_0x3afe9e[_0x6011('0x40')],_0x3afe9e[_0x6011('0x41')],_0x3afe9e[_0x6011('0x42')],_0x3afe9e['transfereecalleridname']));if(recordings[_0x3afe9e[_0x6011('0x43')]]&&transfers[_0x6011('0x5')][_0x3afe9e[_0x6011('0x43')]]){transfers[_0x6011('0x5')][_0x3afe9e['transfereruniqueid']][_0x6011('0x44')]=!![];}}catch(_0x257d6f){utils[_0x6011('0x39')](util['format']('[%s][recordings][blindtransfer]',_0x3afe9e[_0x6011('0x4')]),_0x257d6f);}}; \ No newline at end of file +var _0x9f59=['appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','[%s][recordings][varset]','hangup','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','toLowerCase'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x9f59,0x164));var _0x99f5=function(_0x2afb7a,_0x23a56b){_0x2afb7a=_0x2afb7a-0x0;var _0x2aae45=_0x9f59[_0x2afb7a];return _0x2aae45;};'use strict';var _=require(_0x99f5('0x0'));var util=require(_0x99f5('0x1'));var utils=require('./utils');var transfers=require(_0x99f5('0x2'));var recordings={};function writeDB(_0x6b0e2c){var _0x214372;utils['info'](util[_0x99f5('0x3')](_0x99f5('0x4'),_0x6b0e2c[_0x99f5('0x5')]));if(transfers[_0x99f5('0x6')][_0x6b0e2c['uniqueid']]){_0x214372=_0x6b0e2c[_0x99f5('0x5')];_0x6b0e2c[_0x99f5('0x5')]=transfers[_0x99f5('0x6')][_0x6b0e2c[_0x99f5('0x5')]][_0x99f5('0x7')];}if(_0x6b0e2c[_0x99f5('0x8')]){utils[_0x99f5('0x9')](_0x6b0e2c[_0x99f5('0x8')])[_0x99f5('0xa')](function(_0x173357){if(_0x173357){_0x6b0e2c[_0x99f5('0xb')]=_0x173357['name'];_0x6b0e2c[_0x99f5('0xc')]=_0x173357['id'];}utils[_0x99f5('0xd')](_0x99f5('0xe'),_0x6b0e2c);});}else{utils[_0x99f5('0xd')]('CreateVoiceRecording',_0x6b0e2c);}if(_0x214372)delete transfers[_0x99f5('0x6')][_0x214372];}exports[_0x99f5('0xf')]=function(_0x407bca){try{utils['debug'](util[_0x99f5('0x3')](_0x99f5('0x10'),_0x407bca[_0x99f5('0x5')]),_0x407bca);if(_0x407bca[_0x99f5('0x5')]==_0x407bca[_0x99f5('0x11')]){utils[_0x99f5('0x12')](util[_0x99f5('0x3')](_0x99f5('0x13'),_0x407bca[_0x99f5('0x5')],_0x407bca[_0x99f5('0x14')],_0x407bca[_0x99f5('0x15')]));recordings[_0x407bca[_0x99f5('0x5')]]={'uniqueid':_0x407bca[_0x99f5('0x5')],'accountcode':_0x407bca['accountcode'],'exten':_0x407bca[_0x99f5('0x15')],'context':_0x407bca['context'],'channel':_0x407bca[_0x99f5('0x16')],'monitors':[]};}}catch(_0x5cff40){utils[_0x99f5('0x17')](util[_0x99f5('0x3')](_0x99f5('0x10'),_0x407bca[_0x99f5('0x5')]),_0x5cff40);}};exports[_0x99f5('0x18')]=function(_0x11b332){try{utils[_0x99f5('0x19')](util['format'](_0x99f5('0x1a'),_0x11b332[_0x99f5('0x5')]),_0x11b332);if(!_[_0x99f5('0x1b')](recordings[_0x11b332[_0x99f5('0x5')]])&&_0x11b332[_0x99f5('0x1c')]==0x6){utils[_0x99f5('0x12')](util[_0x99f5('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x11b332['uniqueid'],_0x11b332[_0x99f5('0x14')],_0x11b332['channel']));}else if(!_[_0x99f5('0x1b')](recordings[_0x11b332[_0x99f5('0x11')]])&&_0x11b332[_0x99f5('0x1c')]==0x6&&_0x11b332[_0x99f5('0x14')]!=_0x99f5('0x1d')){utils[_0x99f5('0x12')](util['format'](_0x99f5('0x1e'),_0x11b332[_0x99f5('0x5')],_0x11b332[_0x99f5('0x11')],_0x11b332[_0x99f5('0x14')],_0x11b332[_0x99f5('0x16')]));recordings[_0x11b332[_0x99f5('0x11')]]['accountcode']=_0x11b332['accountcode'];}}catch(_0xcacecc){utils[_0x99f5('0x17')](util[_0x99f5('0x3')]('[%s][recordings][newstate]',_0x11b332[_0x99f5('0x5')]),_0xcacecc);}};exports['varset']=function(_0x4faac5){try{if(!_['isNil'](_0x4faac5[_0x99f5('0x1f')])&&!_[_0x99f5('0x1b')](_0x4faac5[_0x99f5('0x1f')]['mixmonitor_filename'])){utils[_0x99f5('0x19')](util[_0x99f5('0x3')]('[%s][recordings][varset]',_0x4faac5[_0x99f5('0x5')]),_0x4faac5);utils[_0x99f5('0x12')](util[_0x99f5('0x3')](_0x99f5('0x20'),_0x4faac5[_0x99f5('0x5')],_0x4faac5['variable'],_0x4faac5[_0x99f5('0x21')]));if(_['endsWith'](_0x4faac5[_0x99f5('0x21')],_0x99f5('0x22'))){_0x4faac5[_0x99f5('0x21')]=_0x4faac5[_0x99f5('0x21')][_0x99f5('0x23')](_0x99f5('0x22'),_0x99f5('0x24'));}if(recordings[_0x4faac5[_0x99f5('0x11')]]){var _0x49fa01=_['find'](recordings[_0x4faac5['linkedid']][_0x99f5('0x25')],{'value':_0x4faac5[_0x99f5('0x21')]});if(_['isNil'](_0x49fa01)){recordings[_0x4faac5[_0x99f5('0x11')]][_0x99f5('0x25')]['push']({'value':_0x4faac5['value']});}}}}catch(_0x5143ad){utils[_0x99f5('0x17')](util[_0x99f5('0x3')](_0x99f5('0x26'),_0x4faac5[_0x99f5('0x5')]),_0x5143ad);}};exports[_0x99f5('0x27')]=function(_0x5e8069){try{if(!_[_0x99f5('0x1b')](recordings[_0x5e8069[_0x99f5('0x5')]])){utils[_0x99f5('0x19')](util[_0x99f5('0x3')]('[%s][recordings][hangup]',_0x5e8069[_0x99f5('0x5')]),_0x5e8069);utils[_0x99f5('0x12')](util[_0x99f5('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5e8069[_0x99f5('0x5')],_0x5e8069[_0x99f5('0x28')],_0x5e8069[_0x99f5('0x29')],_0x5e8069[_0x99f5('0x2a')]));recordings[_0x5e8069[_0x99f5('0x5')]]['calleridnum']=_0x5e8069[_0x99f5('0x28')];recordings[_0x5e8069[_0x99f5('0x5')]]['calleridname']=_0x5e8069[_0x99f5('0x29')];recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x2b')]=_0x5e8069['connectedlinenum'];recordings[_0x5e8069[_0x99f5('0x5')]]['connectedlinename']=_0x5e8069[_0x99f5('0x2c')];if(recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x2d')]==_0x99f5('0x2e')&&recordings[_0x5e8069['uniqueid']][_0x99f5('0x8')]){recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x2b')]=recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x8')];recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x2c')]='';}recordings[_0x5e8069[_0x99f5('0x5')]][_0x99f5('0x25')][_0x99f5('0x2f')](function(_0x41b46e){var _0xf01c29=_['clone'](recordings[_0x5e8069[_0x99f5('0x5')]]);_0xf01c29[_0x99f5('0x21')]=_0x41b46e[_0x99f5('0x21')];writeDB(_0xf01c29);});delete recordings[_0x5e8069['uniqueid']];}}catch(_0xe0fbb9){utils['error'](util[_0x99f5('0x3')]('[%s][recordings][hangup]',_0x5e8069[_0x99f5('0x5')]),_0xe0fbb9);}};exports[_0x99f5('0x30')]=function(_0x525322){try{if(!_[_0x99f5('0x1b')](recordings[_0x525322['uniqueid']])){utils['debug'](util['format'](_0x99f5('0x31'),_0x525322[_0x99f5('0x5')]),_0x525322);utils[_0x99f5('0x12')](util[_0x99f5('0x3')](_0x99f5('0x32'),_0x525322[_0x99f5('0x5')],_0x525322['application'],_0x525322['appdata']));if(_0x525322['application'][_0x99f5('0x33')]()=='set'&&_['startsWith'](_0x525322[_0x99f5('0x34')]['toLowerCase'](),_0x99f5('0x35'))){var _0x235e67=_0x525322[_0x99f5('0x34')][_0x99f5('0x36')]('=');var _0x58cea1=_0x235e67[0x0][_0x99f5('0x37')](_0x235e67[0x0][_0x99f5('0x38')]('(')+0x1,_0x235e67[0x0][_0x99f5('0x38')](')'));var _0x55fce2=_0x235e67[0x1];recordings[_0x525322[_0x99f5('0x5')]][_0x58cea1]=_0x55fce2;}}}catch(_0x16c593){utils[_0x99f5('0x17')](util['format'](_0x99f5('0x31'),_0x525322['uniqueid']),_0x16c593);}};exports[_0x99f5('0x39')]=function(_0x35a2f6){try{if(!_[_0x99f5('0x1b')](recordings[_0x35a2f6[_0x99f5('0x5')]])){utils[_0x99f5('0x19')](util['format'](_0x99f5('0x3a'),_0x35a2f6['uniqueid']),_0x35a2f6);utils[_0x99f5('0x12')](util['format'](_0x99f5('0x3b'),_0x35a2f6[_0x99f5('0x5')],_0x35a2f6[_0x99f5('0x3c')]));recordings[_0x35a2f6[_0x99f5('0x5')]]['queue']=_0x35a2f6[_0x99f5('0x3c')];}}catch(_0x5a9af6){utils[_0x99f5('0x17')](util['format'](_0x99f5('0x3a'),_0x35a2f6[_0x99f5('0x5')]),_0x5a9af6);}};exports[_0x99f5('0x3d')]=function(_0x49e6c4){try{utils[_0x99f5('0x19')](util['format'](_0x99f5('0x3e'),_0x49e6c4[_0x99f5('0x5')]),_0x49e6c4);utils['info'](util[_0x99f5('0x3')](_0x99f5('0x3f'),_0x49e6c4['uniqueid'],_0x49e6c4[_0x99f5('0x40')],_0x49e6c4['transferercalleridname'],_0x49e6c4[_0x99f5('0x41')],_0x49e6c4[_0x99f5('0x42')]));if(recordings[_0x49e6c4[_0x99f5('0x43')]]&&transfers[_0x99f5('0x6')][_0x49e6c4['transfereruniqueid']]){transfers[_0x99f5('0x6')][_0x49e6c4[_0x99f5('0x43')]]['recording']=!![];}}catch(_0x16c360){utils['error'](util[_0x99f5('0x3')](_0x99f5('0x3e'),_0x49e6c4[_0x99f5('0x5')]),_0x16c360);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 7e504c4..b19d5a4 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 _0x0eba=['transferercalleridname','transfereecalleridnum','transfereecalleridname','type','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','blinds','blindtransfer','[%s][transfers][blindtransfer]','info','transferercalleridnum'];(function(_0x4a14d2,_0x3e949e){var _0x324939=function(_0x35faca){while(--_0x35faca){_0x4a14d2['push'](_0x4a14d2['shift']());}};_0x324939(++_0x3e949e);}(_0x0eba,0x114));var _0xa0eb=function(_0x3b30d9,_0x5b0292){_0x3b30d9=_0x3b30d9-0x0;var _0x542351=_0x0eba[_0x3b30d9];return _0x542351;};'use strict';var _=require(_0xa0eb('0x0'));var util=require('util');var utils=require(_0xa0eb('0x1'));function writeDB(_0x3648e1){utils['info'](util[_0xa0eb('0x2')](_0xa0eb('0x3'),_0x3648e1['type']===_0xa0eb('0x4')?_0x3648e1['origtransfereruniqueid']:_0x3648e1[_0xa0eb('0x5')],_0x3648e1['type']));utils['request']('CreateVoiceTransferReport',_0x3648e1);}exports[_0xa0eb('0x6')]={};exports[_0xa0eb('0x7')]=function(_0x539784){try{utils['debug'](util[_0xa0eb('0x2')](_0xa0eb('0x8'),_0x539784[_0xa0eb('0x5')]),_0x539784);utils[_0xa0eb('0x9')](util[_0xa0eb('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x539784[_0xa0eb('0x5')],_0x539784[_0xa0eb('0xa')],_0x539784[_0xa0eb('0xb')],_0x539784[_0xa0eb('0xc')],_0x539784[_0xa0eb('0xd')]));_0x539784[_0xa0eb('0xe')]='blind';exports[_0xa0eb('0x6')][_0x539784[_0xa0eb('0xf')]]=_0x539784;writeDB(_0x539784);}catch(_0x3d2418){utils[_0xa0eb('0x10')](util[_0xa0eb('0x2')](_0xa0eb('0x8'),_0x539784[_0xa0eb('0x5')]),_0x3d2418);}};exports[_0xa0eb('0x11')]=function(_0x764576){try{utils[_0xa0eb('0x12')](util[_0xa0eb('0x2')](_0xa0eb('0x13'),_0x764576[_0xa0eb('0x14')]),_0x764576);utils[_0xa0eb('0x9')](util[_0xa0eb('0x2')](_0xa0eb('0x15'),_0x764576[_0xa0eb('0x14')],_0x764576[_0xa0eb('0x16')],_0x764576[_0xa0eb('0x17')],_0x764576[_0xa0eb('0x18')],_0x764576['transfertargetcalleridname']));_0x764576=_['assign'](_0x764576,{'transfererchannel':_0x764576['origtransfererchannel'],'transferercalleridnum':_0x764576['origtransferercalleridnum'],'transferercalleridname':_0x764576[_0xa0eb('0x17')],'transfererconnectedlinenum':_0x764576['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x764576[_0xa0eb('0x19')],'transfereraccountcode':_0x764576['origtransfereraccountcode'],'transferercontext':_0x764576[_0xa0eb('0x1a')],'transfererexten':_0x764576[_0xa0eb('0x1b')],'transfererlinkedid':_0x764576[_0xa0eb('0x1c')],'context':_0x764576[_0xa0eb('0x1d')],'extension':_0x764576[_0xa0eb('0x1e')],'type':_0xa0eb('0x4')});if(_[_0xa0eb('0x1f')](_0x764576[_0xa0eb('0x20')])){_0x764576=_[_0xa0eb('0x21')](_0x764576,{'transfereechannel':_0x764576[_0xa0eb('0x22')],'transfereecalleridnum':_0x764576[_0xa0eb('0x18')],'transfereecalleridname':_0x764576[_0xa0eb('0x23')],'transfereeconnectedlinenum':_0x764576[_0xa0eb('0x24')],'transfereeconnectedlinename':_0x764576['transfertargetconnectedlinename'],'transfereeaccountcode':_0x764576[_0xa0eb('0x25')],'transfereecontext':_0x764576[_0xa0eb('0x26')],'transfereeexten':_0x764576[_0xa0eb('0x27')],'transfereelinkedid':_0x764576[_0xa0eb('0x28')]});}writeDB(_0x764576);}catch(_0x266abb){utils[_0xa0eb('0x10')](util[_0xa0eb('0x2')](_0xa0eb('0x13'),_0x764576['origtransfereruniqueid']),_0x266abb);}}; \ No newline at end of file +var _0x694b=['lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','debug','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','error'];(function(_0x295bf7,_0x325cb4){var _0x21cade=function(_0x48c78c){while(--_0x48c78c){_0x295bf7['push'](_0x295bf7['shift']());}};_0x21cade(++_0x325cb4);}(_0x694b,0x69));var _0xb694=function(_0x3907b4,_0x291a7e){_0x3907b4=_0x3907b4-0x0;var _0x5dd9ce=_0x694b[_0x3907b4];return _0x5dd9ce;};'use strict';var _=require(_0xb694('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x5aa749){utils[_0xb694('0x1')](util[_0xb694('0x2')](_0xb694('0x3'),_0x5aa749[_0xb694('0x4')]===_0xb694('0x5')?_0x5aa749[_0xb694('0x6')]:_0x5aa749['uniqueid'],_0x5aa749[_0xb694('0x4')]));utils[_0xb694('0x7')](_0xb694('0x8'),_0x5aa749);}exports[_0xb694('0x9')]={};exports['blindtransfer']=function(_0x1ef644){try{utils[_0xb694('0xa')](util['format']('[%s][transfers][blindtransfer]',_0x1ef644[_0xb694('0xb')]),_0x1ef644);utils[_0xb694('0x1')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1ef644[_0xb694('0xb')],_0x1ef644[_0xb694('0xc')],_0x1ef644[_0xb694('0xd')],_0x1ef644[_0xb694('0xe')],_0x1ef644[_0xb694('0xf')]));_0x1ef644[_0xb694('0x4')]='blind';exports['blinds'][_0x1ef644[_0xb694('0x10')]]=_0x1ef644;writeDB(_0x1ef644);}catch(_0x2c95c3){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x1ef644[_0xb694('0xb')]),_0x2c95c3);}};exports[_0xb694('0x11')]=function(_0x23c2c5){try{utils[_0xb694('0xa')](util[_0xb694('0x2')](_0xb694('0x12'),_0x23c2c5[_0xb694('0x6')]),_0x23c2c5);utils[_0xb694('0x1')](util[_0xb694('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x23c2c5[_0xb694('0x6')],_0x23c2c5['origtransferercalleridnum'],_0x23c2c5['origtransferercalleridname'],_0x23c2c5[_0xb694('0x13')],_0x23c2c5[_0xb694('0x14')]));_0x23c2c5=_[_0xb694('0x15')](_0x23c2c5,{'transfererchannel':_0x23c2c5[_0xb694('0x16')],'transferercalleridnum':_0x23c2c5[_0xb694('0x17')],'transferercalleridname':_0x23c2c5['origtransferercalleridname'],'transfererconnectedlinenum':_0x23c2c5['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x23c2c5[_0xb694('0x18')],'transfereraccountcode':_0x23c2c5[_0xb694('0x19')],'transferercontext':_0x23c2c5[_0xb694('0x1a')],'transfererexten':_0x23c2c5['secondtransfererexten'],'transfererlinkedid':_0x23c2c5[_0xb694('0x1b')],'context':_0x23c2c5[_0xb694('0x1c')],'extension':_0x23c2c5[_0xb694('0x1d')],'type':_0xb694('0x5')});if(_['isNil'](_0x23c2c5['transfereechannel'])){_0x23c2c5=_['assign'](_0x23c2c5,{'transfereechannel':_0x23c2c5[_0xb694('0x1e')],'transfereecalleridnum':_0x23c2c5[_0xb694('0x13')],'transfereecalleridname':_0x23c2c5['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x23c2c5[_0xb694('0x1f')],'transfereeconnectedlinename':_0x23c2c5[_0xb694('0x20')],'transfereeaccountcode':_0x23c2c5['transfertargetaccountcode'],'transfereecontext':_0x23c2c5['transfertargetcontext'],'transfereeexten':_0x23c2c5[_0xb694('0x21')],'transfereelinkedid':_0x23c2c5['transfertargetlinkedid']});}writeDB(_0x23c2c5);}catch(_0x3e097c){utils[_0xb694('0x22')](util['format'](_0xb694('0x12'),_0x23c2c5[_0xb694('0x6')]),_0x3e097c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3ae7d22..89b7038 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 _0x7801=['stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7801,0x11a));var _0x1780=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7801[_0xa148b7];return _0x51efd3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x1780('0x0'));var moment=require(_0x1780('0x1'));var util=require(_0x1780('0x2'));var client=jayson[_0x1780('0x3')][_0x1780('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x1780('0x5'));exports[_0x1780('0x6')]=function(_0x2d9971,_0x21a5da){logger[_0x1780('0x6')](_0x2d9971,_0x21a5da?util[_0x1780('0x7')](_0x21a5da,{'showHidden':![],'depth':null}):'');};exports[_0x1780('0x8')]=function(_0x4ac93f,_0x56b7f6){logger[_0x1780('0x8')](_0x4ac93f,_0x56b7f6?util[_0x1780('0x7')](_0x56b7f6,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5c9274,_0x22f121){logger[_0x1780('0x9')](_0x5c9274,_0x22f121?util[_0x1780('0x7')](_0x22f121,{'showHidden':![],'depth':null}):'');};exports[_0x1780('0xa')]=function(_0x1778ac,_0x470573){return client[_0x1780('0xa')](_0x1778ac,{'body':_0x470573})[_0x1780('0xb')](function(_0x2b3c2b){logger[_0x1780('0x8')](_0x1780('0xc'),_0x1778ac,_0x2b3c2b?util[_0x1780('0x7')](_0x2b3c2b,{'showHidden':![],'depth':null}):'');})[_0x1780('0xd')](function(_0x24b7d7){logger['error']('[utils][request]\x20name:%s',_0x1778ac,_0x24b7d7?util['inspect'](_0x24b7d7,{'showHidden':![],'depth':null}):'');});};function getUser(_0x85dd0c){return client[_0x1780('0xa')](_0x1780('0xe'),{'options':{'raw':!![],'attributes':['id',_0x1780('0xf'),'name',_0x1780('0x10')],'where':_0x85dd0c,'limit':0x1}})['then'](function(_0x44126b){logger[_0x1780('0x8')](_0x1780('0x11'),JSON[_0x1780('0x12')](_0x85dd0c),_0x44126b?util[_0x1780('0x7')](_0x44126b,{'showHidden':![],'depth':null}):'');return _0x44126b['result']['length']?_0x44126b[_0x1780('0x13')][0x0]:null;});}exports[_0x1780('0x14')]=function(_0x7e86c0){return new BPromise(function(_0x43360f,_0x491076){if(_0x7e86c0){return getUser({'internal':_0x7e86c0})[_0x1780('0xb')](function(_0x4955a6){logger[_0x1780('0x6')](_0x1780('0x15'),_0x7e86c0,_0x4955a6?_0x1780('0x16'):_0x1780('0x17'));return _0x43360f(_0x4955a6);})[_0x1780('0xd')](function(_0x1f6514){logger[_0x1780('0x9')](_0x1780('0x18'),_0x1f6514?util['inspect'](_0x1f6514,{'showHidden':![],'depth':null}):'');return _0x43360f(null);});}return _0x43360f(null);});};exports[_0x1780('0x19')]=function(_0x24e4e9){return new BPromise(function(_0x296c71,_0x5c483a){if(_0x24e4e9){return getUser({'interface':_0x24e4e9})[_0x1780('0xb')](function(_0x42b9b8){logger[_0x1780('0x6')](_0x1780('0x1a'),_0x24e4e9,_0x42b9b8?_0x1780('0x16'):'notfound');return _0x296c71(_0x42b9b8);})[_0x1780('0xd')](function(_0x5eae3f){logger['error']('[utils][getUserByInterface]',_0x5eae3f?util[_0x1780('0x7')](_0x5eae3f,{'showHidden':![],'depth':null}):'');return _0x296c71(null);});}return _0x296c71(null);});};exports[_0x1780('0x1b')]=function(_0x3091d9){return new BPromise(function(_0x1e77a9,_0x68bf4d){if(_0x3091d9){return getUser({'name':_0x3091d9})[_0x1780('0xb')](function(_0x2b1862){logger[_0x1780('0x6')](_0x1780('0x1c'),_0x3091d9,_0x2b1862?_0x1780('0x16'):_0x1780('0x17'));return _0x1e77a9(_0x2b1862);})[_0x1780('0xd')](function(_0x1921e5){logger['error']('[utils][getUserByName]',_0x1921e5?util[_0x1780('0x7')](_0x1921e5,{'showHidden':![],'depth':null}):'');return _0x1e77a9(null);});}return _0x1e77a9(null);});};exports[_0x1780('0x1d')]=function(_0x3215bc){return new BPromise(function(_0x38e58b,_0x2d0214){if(_0x3215bc){return client[_0x1780('0xa')](_0x1780('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x1780('0x1f'),_0x1780('0x20'),'acw',_0x1780('0x21')],'where':{'name':_0x3215bc},'limit':0x1}})['then'](function(_0x45482d){logger[_0x1780('0x8')](_0x1780('0x22'),_0x3215bc,_0x45482d?util[_0x1780('0x7')](_0x45482d,{'showHidden':![],'depth':null}):'');logger[_0x1780('0x6')](_0x1780('0x23'),_0x3215bc,_0x45482d?_0x1780('0x16'):_0x1780('0x17'));return _0x38e58b(_0x45482d['result'][_0x1780('0x24')]?_0x45482d[_0x1780('0x13')][0x0]:null);})['catch'](function(_0x28aca9){logger[_0x1780('0x9')](_0x1780('0x25'),_0x28aca9?util[_0x1780('0x7')](_0x28aca9,{'showHidden':![],'depth':null}):'');return _0x38e58b(null);});}return _0x38e58b(null);});};exports[_0x1780('0x26')]=function(_0x2ed140,_0x5ae4aa){return moment(_0x2ed140)[_0x1780('0x27')](_0x5ae4aa,_0x1780('0x28'))[_0x1780('0x29')](_0x1780('0x2a'));};exports[_0x1780('0x2b')]=function(_0x23f361,_0x391793){return moment(_0x23f361)[_0x1780('0x2c')](_0x391793,_0x1780('0x28'))[_0x1780('0x29')](_0x1780('0x2a'));};exports[_0x1780('0x2d')]=function(_0x5afec1,_0x224aa0){return moment(_0x5afec1)[_0x1780('0x2e')](moment(_0x224aa0),_0x1780('0x28'));};exports['sumTime']=function(_0x510a63,_0x17ee2e){return parseInt(_0x510a63,0xa)+parseInt(_0x17ee2e,0xa);};exports[_0x1780('0x2f')]=function(){return moment()[_0x1780('0x29')](_0x1780('0x2a'));};exports[_0x1780('0x30')]=function(_0x221ee4,_0x3c7476){if(_0x3c7476){return moment(_0x221ee4)[_0x1780('0x30')](_0x3c7476);}return!![];};exports[_0x1780('0x31')]=function(_0x28ccf9,_0xef764d){if(_0xef764d){return moment(_0x28ccf9)[_0x1780('0x31')](_0xef764d);}else if(_0x28ccf9){return!![];}return![];}; \ No newline at end of file +var _0x801b=['notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','[utils][getUser]\x20where:%s','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0xaa45e4,_0x2a1a62){var _0x2f5fb9=function(_0x52ec4d){while(--_0x52ec4d){_0xaa45e4['push'](_0xaa45e4['shift']());}};_0x2f5fb9(++_0x2a1a62);}(_0x801b,0xf2));var _0xb801=function(_0x463d76,_0x4128d5){_0x463d76=_0x463d76-0x0;var _0x261cb3=_0x801b[_0x463d76];return _0x261cb3;};'use strict';var BPromise=require(_0xb801('0x0'));var jayson=require(_0xb801('0x1'));var moment=require('moment');var util=require(_0xb801('0x2'));var client=jayson['client'][_0xb801('0x3')]({'port':0x2329});var logger=require(_0xb801('0x4'))(_0xb801('0x5'));exports[_0xb801('0x6')]=function(_0x1ff436,_0x10d2f7){logger[_0xb801('0x6')](_0x1ff436,_0x10d2f7?util[_0xb801('0x7')](_0x10d2f7,{'showHidden':![],'depth':null}):'');};exports[_0xb801('0x8')]=function(_0x23609d,_0x1f0c1e){logger[_0xb801('0x8')](_0x23609d,_0x1f0c1e?util['inspect'](_0x1f0c1e,{'showHidden':![],'depth':null}):'');};exports[_0xb801('0x9')]=function(_0x48ed91,_0x21ce2b){logger['error'](_0x48ed91,_0x21ce2b?util[_0xb801('0x7')](_0x21ce2b,{'showHidden':![],'depth':null}):'');};exports[_0xb801('0xa')]=function(_0x463f08,_0x30b64c){return client['request'](_0x463f08,{'body':_0x30b64c})[_0xb801('0xb')](function(_0x2ddfba){logger[_0xb801('0x8')](_0xb801('0xc'),_0x463f08,_0x2ddfba?util[_0xb801('0x7')](_0x2ddfba,{'showHidden':![],'depth':null}):'');})[_0xb801('0xd')](function(_0x2be116){logger[_0xb801('0x9')](_0xb801('0xc'),_0x463f08,_0x2be116?util[_0xb801('0x7')](_0x2be116,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4947e0){return client[_0xb801('0xa')](_0xb801('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xb801('0xf'),'interface'],'where':_0x4947e0,'limit':0x1}})[_0xb801('0xb')](function(_0x9c0f08){logger[_0xb801('0x8')](_0xb801('0x10'),JSON['stringify'](_0x4947e0),_0x9c0f08?util[_0xb801('0x7')](_0x9c0f08,{'showHidden':![],'depth':null}):'');return _0x9c0f08['result'][_0xb801('0x11')]?_0x9c0f08[_0xb801('0x12')][0x0]:null;});}exports[_0xb801('0x13')]=function(_0x44f3d5){return new BPromise(function(_0xeef9b2,_0x13e013){if(_0x44f3d5){return getUser({'internal':_0x44f3d5})[_0xb801('0xb')](function(_0x1e130e){logger[_0xb801('0x6')](_0xb801('0x14'),_0x44f3d5,_0x1e130e?_0xb801('0x15'):_0xb801('0x16'));return _0xeef9b2(_0x1e130e);})[_0xb801('0xd')](function(_0x506421){logger[_0xb801('0x9')](_0xb801('0x17'),_0x506421?util[_0xb801('0x7')](_0x506421,{'showHidden':![],'depth':null}):'');return _0xeef9b2(null);});}return _0xeef9b2(null);});};exports['getUserByInterface']=function(_0x176a99){return new BPromise(function(_0x3a1e96,_0xe9eed2){if(_0x176a99){return getUser({'interface':_0x176a99})[_0xb801('0xb')](function(_0x49471a){logger[_0xb801('0x6')](_0xb801('0x18'),_0x176a99,_0x49471a?_0xb801('0x15'):_0xb801('0x16'));return _0x3a1e96(_0x49471a);})['catch'](function(_0x1b1c6d){logger[_0xb801('0x9')](_0xb801('0x19'),_0x1b1c6d?util[_0xb801('0x7')](_0x1b1c6d,{'showHidden':![],'depth':null}):'');return _0x3a1e96(null);});}return _0x3a1e96(null);});};exports[_0xb801('0x1a')]=function(_0x547c25){return new BPromise(function(_0x25b116,_0x4e8f05){if(_0x547c25){return getUser({'name':_0x547c25})[_0xb801('0xb')](function(_0x2cbf2f){logger[_0xb801('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x547c25,_0x2cbf2f?_0xb801('0x15'):_0xb801('0x16'));return _0x25b116(_0x2cbf2f);})['catch'](function(_0x52e42a){logger[_0xb801('0x9')](_0xb801('0x1b'),_0x52e42a?util[_0xb801('0x7')](_0x52e42a,{'showHidden':![],'depth':null}):'');return _0x25b116(null);});}return _0x25b116(null);});};exports[_0xb801('0x1c')]=function(_0x159e91){return new BPromise(function(_0x3faab0,_0x5abc46){if(_0x159e91){return client[_0xb801('0xa')](_0xb801('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xb801('0xf'),_0xb801('0x1e'),'acw','acwTimeout'],'where':{'name':_0x159e91},'limit':0x1}})[_0xb801('0xb')](function(_0x32a071){logger[_0xb801('0x8')](_0xb801('0x1f'),_0x159e91,_0x32a071?util[_0xb801('0x7')](_0x32a071,{'showHidden':![],'depth':null}):'');logger[_0xb801('0x6')](_0xb801('0x20'),_0x159e91,_0x32a071?'found':'notfound');return _0x3faab0(_0x32a071[_0xb801('0x12')][_0xb801('0x11')]?_0x32a071['result'][0x0]:null);})[_0xb801('0xd')](function(_0x17f633){logger[_0xb801('0x9')]('[utils][getVoiceQueueByName]',_0x17f633?util[_0xb801('0x7')](_0x17f633,{'showHidden':![],'depth':null}):'');return _0x3faab0(null);});}return _0x3faab0(null);});};exports[_0xb801('0x21')]=function(_0x2f1c52,_0x8a3248){return moment(_0x2f1c52)[_0xb801('0x22')](_0x8a3248,_0xb801('0x23'))[_0xb801('0x24')](_0xb801('0x25'));};exports[_0xb801('0x26')]=function(_0x307069,_0x3d4e66){return moment(_0x307069)['subtract'](_0x3d4e66,_0xb801('0x23'))['format'](_0xb801('0x25'));};exports['diffTime']=function(_0x53b641,_0x3ddf78){return moment(_0x53b641)[_0xb801('0x27')](moment(_0x3ddf78),_0xb801('0x23'));};exports[_0xb801('0x28')]=function(_0x144b71,_0x286a41){return parseInt(_0x144b71,0xa)+parseInt(_0x286a41,0xa);};exports[_0xb801('0x29')]=function(){return moment()[_0xb801('0x24')](_0xb801('0x25'));};exports[_0xb801('0x2a')]=function(_0x5f48ae,_0x351874){if(_0x351874){return moment(_0x5f48ae)['isAfter'](_0x351874);}return!![];};exports['isBefore']=function(_0x12bebb,_0x5df461){if(_0x5df461){return moment(_0x12bebb)[_0xb801('0x2b')](_0x5df461);}else if(_0x12bebb){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 b66b04f..ec94c1b 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 _0xee3a=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','device','agent_name','test','express-winston','path','util','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','role','inspect'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xee3a,0x115));var _0xaee3=function(_0xf6e274,_0x4ef39e){_0xf6e274=_0xf6e274-0x0;var _0x55f02d=_0xee3a[_0xf6e274];return _0x55f02d;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0xaee3('0x0'));var path=require(_0xaee3('0x1'));var util=require(_0xaee3('0x2'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0xaee3('0x3'))['safeTemplate'];var maskSensitiveData=require(_0xaee3('0x4'))[_0xaee3('0x5')];function ClientSideLogger(){function _0x99851c(_0x39c8b3){var _0x4a5d30=path[_0xaee3('0x6')](_0xaee3('0x7'),_0xaee3('0x8'),_0xaee3('0x9'));var _0x3337b3=path['join'](_0xaee3('0xa'),_0x39c8b3['role']+'-'+_0x39c8b3[_0xaee3('0xb')]);return fs[_0xaee3('0xc')](path[_0xaee3('0x6')](_0x4a5d30,_0x3337b3))[_0xaee3('0xd')](function(){var _0x1a2cba=fileLogger(_0xaee3('0xa'),path[_0xaee3('0x6')](_0x4a5d30,_0x3337b3));return _0x1a2cba;})[_0xaee3('0xe')](function(_0x4c5ee7){throw _0x4c5ee7;});}this['log']=function(_0x1bdc99,_0x452865,_0x399b41,_0x59f00e){return _0x99851c(_0x1bdc99[_0xaee3('0xf')])[_0xaee3('0xd')](function(_0x543a5d){var _0x2f51a2=_0x543a5d[_0x452865];return _0x2f51a2;})[_0xaee3('0xd')](function(_0x4ef8cb){var _0xc8eef0=_0x1bdc99['user']?_0x1bdc99[_0xaee3('0xf')]['id']:_0xaee3('0x10');var _0x5171e4=_0x59f00e[_0xaee3('0x11')];var _0x14ddf8=_0x59f00e[_0xaee3('0x12')];var _0xf38a3=new Date(Number(_0x14ddf8));return _0x4ef8cb(_0xc8eef0,_0xf38a3,_0x399b41,_0x5171e4);})[_0xaee3('0xe')](function(_0x45626e){fileLogger(_0xaee3('0xa'))[_0xaee3('0x13')](_0x45626e);});};}function setupLoggers(_0x37a9cc){return new Promise(function(_0x5af6ab){var _0x5ba3e8=new ClientSideLogger();var _0x182f46=fileLogger(_0xaee3('0x14'));var _0x54c49c=fileLogger(_0xaee3('0x15'));_0x37a9cc[_0xaee3('0x16')](_0xaee3('0x17'),_0x5ba3e8);_0x37a9cc[_0xaee3('0x18')](ewinston[_0xaee3('0x19')]({'winstonInstance':_0x182f46,'meta':![],'statusLevels':!![],'msg':function(_0x760bc9,_0x152f87){var _0x1b4cff=_0xaee3('0x1a');if(!_[_0xaee3('0x1b')](_0x760bc9[_0xaee3('0x1c')])){_0x1b4cff+='\x20body=%s';var _0x2b4fc5=_0x760bc9[_0xaee3('0x1c')];maskSensitiveData(_0x2b4fc5);}return safeTemplate(util[_0xaee3('0x1d')](_0x1b4cff,_0x760bc9[_0xaee3('0x1e')],_0x760bc9[_0xaee3('0x1f')][_0xaee3('0x20')]?_0x760bc9['headers'][_0xaee3('0x20')]:_0x760bc9['connection'][_0xaee3('0x21')]||_0x760bc9['ip'],_0x760bc9[_0xaee3('0x22')],_0x152f87[_0xaee3('0x23')],_0x152f87['responseTime'],_0x760bc9[_0xaee3('0xf')]?_0x760bc9[_0xaee3('0xf')]['id']:null,_0x760bc9[_0xaee3('0xf')]?_0x760bc9[_0xaee3('0xf')][_0xaee3('0xb')]:null,_0x760bc9[_0xaee3('0xf')]?_0x760bc9[_0xaee3('0xf')][_0xaee3('0x24')]:null,_0x2b4fc5?util[_0xaee3('0x25')](_0x2b4fc5,![],null):''));}}));_0x37a9cc[_0xaee3('0x18')](ewinston[_0xaee3('0x19')]({'winstonInstance':_0x54c49c,'meta':![],'statusLevels':!![],'msg':function(_0x4539c2,_0xbbddae){var _0x29fef2=_0xaee3('0x26');if(_0x4539c2[_0xaee3('0x1c')]&&_0x4539c2[_0xaee3('0x1c')]['device']&&_0x4539c2['body']['agent_id']){_0x29fef2=_0xaee3('0x27');}return util[_0xaee3('0x1d')](_0x29fef2,_0x4539c2['method'],_0x4539c2[_0xaee3('0x1f')][_0xaee3('0x20')]?_0x4539c2['headers']['x-forwarded-for']:_0x4539c2[_0xaee3('0x28')][_0xaee3('0x21')]||_0x4539c2['ip'],_0x4539c2['url'],_0xbbddae[_0xaee3('0x23')],_0xbbddae[_0xaee3('0x29')],_0x4539c2['user']?_0x4539c2[_0xaee3('0xf')]['id']:null,_0x4539c2[_0xaee3('0xf')]?_0x4539c2['user'][_0xaee3('0xb')]:null,_0x4539c2['user']?_0x4539c2[_0xaee3('0xf')][_0xaee3('0x24')]:null,_0x4539c2[_0xaee3('0x1c')]&&_0x4539c2[_0xaee3('0x1c')][_0xaee3('0x2a')]?_0x4539c2[_0xaee3('0x1c')]['device']:'other',_0x4539c2[_0xaee3('0x1c')]&&_0x4539c2[_0xaee3('0x1c')]['agent_id']?_0x4539c2[_0xaee3('0x1c')]['agent_id']:'',_0x4539c2[_0xaee3('0x1c')]&&_0x4539c2[_0xaee3('0x1c')][_0xaee3('0x2b')]?_0x4539c2[_0xaee3('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0x225b91){var _0x271e3c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x271e3c[_0xaee3('0x2c')](_0x225b91[_0xaee3('0x22')]);}}));return _0x5af6ab();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x2b42=['catch','user','no-user','timestamp','error','api','auth','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','other','agent_name','test','fs-extra','lodash','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2b42,0x10e));var _0x22b4=function(_0x5de85c,_0x67c18e){_0x5de85c=_0x5de85c-0x0;var _0x515b90=_0x2b42[_0x5de85c];return _0x515b90;};var fs=require(_0x22b4('0x0'));var _=require(_0x22b4('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x22b4('0x2'));var fileLogger=require(_0x22b4('0x3'))[_0x22b4('0x4')];var safeTemplate=require(_0x22b4('0x5'))[_0x22b4('0x6')];var maskSensitiveData=require(_0x22b4('0x7'))[_0x22b4('0x8')];function ClientSideLogger(){function _0x3499d4(_0x4dc565){var _0x5ea757=path[_0x22b4('0x9')](_0x22b4('0xa'),_0x22b4('0xb'),_0x22b4('0xc'));var _0xc3a747=path['join'](_0x22b4('0xd'),_0x4dc565[_0x22b4('0xe')]+'-'+_0x4dc565[_0x22b4('0xf')]);return fs[_0x22b4('0x10')](path['join'](_0x5ea757,_0xc3a747))[_0x22b4('0x11')](function(){var _0x4e0503=fileLogger(_0x22b4('0xd'),path[_0x22b4('0x9')](_0x5ea757,_0xc3a747));return _0x4e0503;})[_0x22b4('0x12')](function(_0x14de64){throw _0x14de64;});}this[_0x22b4('0xb')]=function(_0x36acf8,_0x2b8ca1,_0x29e49a,_0xae7f83){return _0x3499d4(_0x36acf8[_0x22b4('0x13')])[_0x22b4('0x11')](function(_0x34384e){var _0x159e46=_0x34384e[_0x2b8ca1];return _0x159e46;})[_0x22b4('0x11')](function(_0x1865ad){var _0xae6e55=_0x36acf8[_0x22b4('0x13')]?_0x36acf8['user']['id']:_0x22b4('0x14');var _0x5978ca=_0xae7f83['data'];var _0x55153e=_0xae7f83[_0x22b4('0x15')];var _0x38144f=new Date(Number(_0x55153e));return _0x1865ad(_0xae6e55,_0x38144f,_0x29e49a,_0x5978ca);})['catch'](function(_0x356075){fileLogger('client')[_0x22b4('0x16')](_0x356075);});};}function setupLoggers(_0x520104){return new Promise(function(_0x51bc04){var _0x30f60a=new ClientSideLogger();var _0x5a420f=fileLogger(_0x22b4('0x17'));var _0x5e9461=fileLogger(_0x22b4('0x18'));_0x520104[_0x22b4('0x19')](_0x22b4('0x1a'),_0x30f60a);_0x520104[_0x22b4('0x1b')](ewinston['logger']({'winstonInstance':_0x5a420f,'meta':![],'statusLevels':!![],'msg':function(_0xb36086,_0x38592c){var _0x3780da=_0x22b4('0x1c');if(!_[_0x22b4('0x1d')](_0xb36086['body'])){_0x3780da+=_0x22b4('0x1e');var _0x1c7492=_0xb36086[_0x22b4('0x1f')];maskSensitiveData(_0x1c7492);}return safeTemplate(util[_0x22b4('0x20')](_0x3780da,_0xb36086[_0x22b4('0x21')],_0xb36086[_0x22b4('0x22')][_0x22b4('0x23')]?_0xb36086['headers'][_0x22b4('0x23')]:_0xb36086[_0x22b4('0x24')][_0x22b4('0x25')]||_0xb36086['ip'],_0xb36086[_0x22b4('0x26')],_0x38592c[_0x22b4('0x27')],_0x38592c[_0x22b4('0x28')],_0xb36086[_0x22b4('0x13')]?_0xb36086['user']['id']:null,_0xb36086['user']?_0xb36086[_0x22b4('0x13')][_0x22b4('0xf')]:null,_0xb36086[_0x22b4('0x13')]?_0xb36086[_0x22b4('0x13')][_0x22b4('0xe')]:null,_0x1c7492?util[_0x22b4('0x29')](_0x1c7492,![],null):''));}}));_0x520104[_0x22b4('0x1b')](ewinston['logger']({'winstonInstance':_0x5e9461,'meta':![],'statusLevels':!![],'msg':function(_0xaa5609,_0xd33d69){var _0x278a1a=_0x22b4('0x2a');if(_0xaa5609['body']&&_0xaa5609['body'][_0x22b4('0x2b')]&&_0xaa5609['body'][_0x22b4('0x2c')]){_0x278a1a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x278a1a,_0xaa5609[_0x22b4('0x21')],_0xaa5609[_0x22b4('0x22')]['x-forwarded-for']?_0xaa5609[_0x22b4('0x22')][_0x22b4('0x23')]:_0xaa5609['connection'][_0x22b4('0x25')]||_0xaa5609['ip'],_0xaa5609['url'],_0xd33d69['statusCode'],_0xd33d69['responseTime'],_0xaa5609[_0x22b4('0x13')]?_0xaa5609[_0x22b4('0x13')]['id']:null,_0xaa5609['user']?_0xaa5609[_0x22b4('0x13')][_0x22b4('0xf')]:null,_0xaa5609[_0x22b4('0x13')]?_0xaa5609[_0x22b4('0x13')][_0x22b4('0xe')]:null,_0xaa5609[_0x22b4('0x1f')]&&_0xaa5609[_0x22b4('0x1f')]['device']?_0xaa5609[_0x22b4('0x1f')][_0x22b4('0x2b')]:_0x22b4('0x2d'),_0xaa5609[_0x22b4('0x1f')]&&_0xaa5609[_0x22b4('0x1f')]['agent_id']?_0xaa5609[_0x22b4('0x1f')][_0x22b4('0x2c')]:'',_0xaa5609['body']&&_0xaa5609[_0x22b4('0x1f')][_0x22b4('0x2e')]?_0xaa5609['body'][_0x22b4('0x2e')]:'');},'ignoreRoute':function(_0x2d77f3){var _0x4ee5a0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4ee5a0[_0x22b4('0x2f')](_0x2d77f3[_0x22b4('0x26')]);}}));return _0x51bc04();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 376fae7..39b86ef 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53c8=['white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','{{{','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','error','File','fileLogger','util','winston','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow'];(function(_0x1d6f0d,_0xe970f0){var _0x48dde1=function(_0x2b39f6){while(--_0x2b39f6){_0x1d6f0d['push'](_0x1d6f0d['shift']());}};_0x48dde1(++_0xe970f0);}(_0x53c8,0x19d));var _0x853c=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0x53c8[_0x10316a];return _0x36ac2e;};'use strict';var path=require('path');var util=require(_0x853c('0x0'));var moment=require('moment');var winston=require(_0x853c('0x1'));var config=require('../config/environment');var debugLevel=config[_0x853c('0x2')]?config[_0x853c('0x2')][_0x853c('0x3')]():'info';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':_0x853c('0x4'),'error':_0x853c('0x5'),'warn':_0x853c('0x6'),'info':_0x853c('0x7'),'print':_0x853c('0x8'),'success':_0x853c('0x9'),'http':_0x853c('0xa'),'verbose':'bold\x20magenta','debug':_0x853c('0xb'),'silly':_0x853c('0xc')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x254321,_0x3a7dd5,_0x2e8eb9){var _0x199fd1=_0x254321||_0x853c('0xd');return path[_0x853c('0xe')](_0x199fd1,util[_0x853c('0xf')](_0x853c('0x10'),_0x3a7dd5,_0x2e8eb9));}function formatter(_0x59e10a,_0x495ee0){_0x495ee0['message']=_0x495ee0[_0x853c('0x11')]['replace'](/@@{/g,'{{{')[_0x853c('0x12')](/}@@/g,_0x853c('0x13'))['replace'](/@{/g,'{{')[_0x853c('0x12')](/}@/g,'}}');return util[_0x853c('0xf')](_0x853c('0x14'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x495ee0['level'][_0x853c('0x15')](),_0x59e10a,_0x495ee0['message']);}function fileFormat(_0x39ecdd,_0x4cd15a){_0x4cd15a[_0x853c('0x11')]=_0x4cd15a[_0x853c('0x11')][_0x853c('0x12')](/@@{/g,_0x853c('0x16'))[_0x853c('0x12')](/}@@/g,_0x853c('0x13'))[_0x853c('0x12')](/@{/g,'{{')[_0x853c('0x12')](/}@/g,'}}');var _0x4af894=_0x4cd15a[_0x853c('0x17')]&&Object[_0x853c('0x18')](_0x4cd15a[_0x853c('0x17')])[_0x853c('0x19')]?'\x0a\x09'+JSON['stringify'](_0x4cd15a['meta']):'';return util[_0x853c('0xf')](_0x853c('0x1a'),moment()[_0x853c('0xf')](_0x853c('0x1b')),_0x4cd15a['level'][_0x853c('0x15')](),_0x39ecdd,_0x4cd15a[_0x853c('0x11')],_0x4af894);}function consoleLogger(){var _0x3ef9b2=new winston[(_0x853c('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x853c('0x1d'))][(_0x853c('0x1e'))]({'level':_0x853c('0x1f'),'json':![],'formatter':function(_0x3a173f){return formatter('',_0x3a173f);}})]});return _0x3ef9b2;}function fileLogger(_0x2c739e,_0x1f958f){var _0xed5341=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x853c('0x1d'))]['File']({'name':util[_0x853c('0xf')]('%s-%s',_0x2c739e,_0x853c('0x20')),'filename':getLogFileName(_0x1f958f,_0x2c739e,_0x853c('0x20')),'level':_0x853c('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x300f46){return fileFormat(_0x2c739e,_0x300f46);}}),new winston[(_0x853c('0x1d'))][(_0x853c('0x21'))]({'name':util[_0x853c('0xf')]('%s-%s',_0x2c739e,debugLevel),'filename':getLogFileName(_0x1f958f,_0x2c739e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3b1b39){return fileFormat(_0x2c739e,_0x3b1b39);}}),new winston['transports'][(_0x853c('0x1e'))]({'level':_0x853c('0x1f'),'json':![],'formatter':function(_0x4f22eb){return fileFormat(_0x2c739e,_0x4f22eb);}})]});return _0xed5341;}exports['consoleLogger']=consoleLogger;exports[_0x853c('0x22')]=fileLogger; \ No newline at end of file +var _0xc07d=['toUpperCase','message','{{{','meta','length','stringify','Logger','transports','warn','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x4c27f5,_0x4a1c5f){var _0x187baa=function(_0x3f6309){while(--_0x3f6309){_0x4c27f5['push'](_0x4c27f5['shift']());}};_0x187baa(++_0x4a1c5f);}(_0xc07d,0x147));var _0xdc07=function(_0x55b7fb,_0x55098d){_0x55b7fb=_0x55b7fb-0x0;var _0x1b9c01=_0xc07d[_0x55b7fb];return _0x1b9c01;};'use strict';var path=require(_0xdc07('0x0'));var util=require(_0xdc07('0x1'));var moment=require(_0xdc07('0x2'));var winston=require(_0xdc07('0x3'));var config=require('../config/environment');var debugLevel=config[_0xdc07('0x4')]?config[_0xdc07('0x4')]['toLowerCase']():'info';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':_0xdc07('0x5'),'error':_0xdc07('0x6'),'warn':_0xdc07('0x7'),'info':_0xdc07('0x8'),'print':_0xdc07('0x9'),'success':_0xdc07('0xa'),'http':_0xdc07('0xb'),'verbose':_0xdc07('0xc'),'debug':_0xdc07('0xd'),'silly':_0xdc07('0xe')};winston[_0xdc07('0xf')](XC_LOG_COLORS);function getLogFileName(_0x3b6bae,_0x245146,_0x1d2904){var _0x2dd483=_0x3b6bae||'/var/log/xcally';return path[_0xdc07('0x10')](_0x2dd483,util[_0xdc07('0x11')](_0xdc07('0x12'),_0x245146,_0x1d2904));}function formatter(_0x2aa3ba,_0xdf5408){_0xdf5408['message']=_0xdf5408['message'][_0xdc07('0x13')](/@@{/g,'{{{')[_0xdc07('0x13')](/}@@/g,_0xdc07('0x14'))[_0xdc07('0x13')](/@{/g,'{{')[_0xdc07('0x13')](/}@/g,'}}');return util[_0xdc07('0x11')](_0xdc07('0x15'),moment()[_0xdc07('0x11')](_0xdc07('0x16')),_0xdf5408[_0xdc07('0x17')][_0xdc07('0x18')](),_0x2aa3ba,_0xdf5408[_0xdc07('0x19')]);}function fileFormat(_0x1fdffe,_0x817b99){_0x817b99[_0xdc07('0x19')]=_0x817b99[_0xdc07('0x19')]['replace'](/@@{/g,_0xdc07('0x1a'))['replace'](/}@@/g,_0xdc07('0x14'))['replace'](/@{/g,'{{')[_0xdc07('0x13')](/}@/g,'}}');var _0x2e9079=_0x817b99['meta']&&Object['keys'](_0x817b99[_0xdc07('0x1b')])[_0xdc07('0x1c')]?'\x0a\x09'+JSON[_0xdc07('0x1d')](_0x817b99[_0xdc07('0x1b')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xdc07('0x11')](_0xdc07('0x16')),_0x817b99[_0xdc07('0x17')][_0xdc07('0x18')](),_0x1fdffe,_0x817b99[_0xdc07('0x19')],_0x2e9079);}function consoleLogger(){var _0x3ff60f=new winston[(_0xdc07('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdc07('0x1f'))]['Console']({'level':_0xdc07('0x20'),'json':![],'formatter':function(_0xae05e2){return formatter('',_0xae05e2);}})]});return _0x3ff60f;}function fileLogger(_0x5e3ca4,_0x29255d){var _0x3e9dfd=new winston[(_0xdc07('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdc07('0x1f'))][(_0xdc07('0x21'))]({'name':util[_0xdc07('0x11')](_0xdc07('0x22'),_0x5e3ca4,_0xdc07('0x23')),'filename':getLogFileName(_0x29255d,_0x5e3ca4,_0xdc07('0x23')),'level':_0xdc07('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x32bb63){return fileFormat(_0x5e3ca4,_0x32bb63);}}),new winston[(_0xdc07('0x1f'))][(_0xdc07('0x21'))]({'name':util['format'](_0xdc07('0x22'),_0x5e3ca4,debugLevel),'filename':getLogFileName(_0x29255d,_0x5e3ca4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3b4dec){return fileFormat(_0x5e3ca4,_0x3b4dec);}}),new winston[(_0xdc07('0x1f'))][(_0xdc07('0x24'))]({'level':'warn','json':![],'formatter':function(_0x1c6ab7){return fileFormat(_0x5e3ca4,_0x1c6ab7);}})]});return _0x3e9dfd;}exports[_0xdc07('0x25')]=consoleLogger;exports[_0xdc07('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 012a38d..6df0e57 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 _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x13c25a,_0x39f8c9){var _0xc8e448=function(_0x32a07e){while(--_0x32a07e){_0x13c25a['push'](_0x13c25a['shift']());}};_0xc8e448(++_0x39f8c9);}(_0xda2d,0x102));var _0xdda2=function(_0x5a3e07,_0x5e55d5){_0x5a3e07=_0x5a3e07-0x0;var _0x110c7e=_0xda2d[_0x5a3e07];return _0x110c7e;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x1a85,0x178));var _0x51a8=function(_0x17723c,_0x1ea81d){_0x17723c=_0x17723c-0x0;var _0x1ffbf3=_0x1a85[_0x17723c];return _0x1ffbf3;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 1a15ca1..ac8a818 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 _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x44c325,_0x19c625){var _0x55f09e=function(_0x322d1b){while(--_0x322d1b){_0x44c325['push'](_0x44c325['shift']());}};_0x55f09e(++_0x19c625);}(_0x80ed,0x11c));var _0xd80e=function(_0x400e0a,_0x4aacf9){_0x400e0a=_0x400e0a-0x0;var _0x33bea5=_0x80ed[_0x400e0a];return _0x33bea5;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file +var _0xb10b=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x4d438e,_0x2e2a9d){var _0x2c91ee=function(_0x160ab3){while(--_0x160ab3){_0x4d438e['push'](_0x4d438e['shift']());}};_0x2c91ee(++_0x2e2a9d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3878e9,_0x14fcf2){_0x3878e9=_0x3878e9-0x0;var _0x2ad526=_0xb10b[_0x3878e9];return _0x2ad526;};var _=require(_0xbb10('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4bb7bb){return _0x4bb7bb==='{{'?_0xbb10('0x1'):_0xbb10('0x2');}function safeTemplate(_0x1dcb08){var _0x4d688c=_0x1dcb08;if(typeof _0x1dcb08===_0xbb10('0x3')){_0x4d688c=_0x1dcb08[_0xbb10('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xbb10('0x5')](_0x1dcb08)){_0x4d688c=_0x1dcb08[_0xbb10('0x6')](function(_0x49baf4){return safeTemplate(_0x49baf4);});}else if(_[_0xbb10('0x7')](_0x1dcb08)){_0x4d688c=Object['keys'](_0x1dcb08)[_0xbb10('0x8')](function(_0x3cdd53,_0x513741){_0x3cdd53[_0x513741]=safeTemplate(_0x1dcb08[_0x513741]);return _0x3cdd53;},{});}return _0x4d688c;}module[_0xbb10('0x9')][_0xbb10('0xa')]=safeTemplate; \ No newline at end of file -- 1.7.1